From ef61ee07328b983637a50109dcbb13f17de1219f Mon Sep 17 00:00:00 2001 From: support Date: Wed, 27 Apr 2022 14:18:33 +0000 Subject: [PATCH] Built motion from commit 4008ba15.|2.6.9 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- public/tvox/answer.controller.js | 3 --- public/tvox/answer.html | 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 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/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.events.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/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/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 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/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 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/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 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/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/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.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.events.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/realtime/index.js | 2 +- server/api/realtime/realtime.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 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.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-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.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/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.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 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.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/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.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/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.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/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.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/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.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/api.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/events.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/project.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/freshsalesAccount.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/cmHopperAdditionalPhone.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/freshsales.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/setting.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 +- .../services/ami/trigger/integration/freshsales.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/rpc/setting.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/model/whatsappQueue.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 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.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 +- .../routing/server/applications/dialogflowV2.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/tvox.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 +- server/utils/client-side-logger.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1197 files changed, 1197 insertions(+), 1200 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 4a41b30..ddaca6b 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-27T13:00:08.207Z", + "time": "2022-04-27T14:10:39.517Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index cd1f595..9e84374 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-27T13:00:08.207Z", + "time": "2022-04-27T14:10:39.517Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/public/tvox/answer.controller.js b/public/tvox/answer.controller.js index 9aa5de5..177b62b 100644 --- a/public/tvox/answer.controller.js +++ b/public/tvox/answer.controller.js @@ -50,7 +50,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', $scope.dispo.mandatoryDisposition = false; $scope.dispo.mandatoryDispositionPause = ''; $scope.dispo.note = ''; - tvoxCallId = ""; @@ -100,7 +99,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', } } - this.$onInit = function() { var urlParams = new URLSearchParams(window.location.search); var params = urlParams.get("params"); @@ -306,7 +304,6 @@ angular.module('AnswerApp', ['ngMaterial', 'ngCookies', 'motion', 'ngResource', }). then( function ret(response) { - console.log("RMID", response.data.id); $scope.reportMemberId = response.data.id; } ); diff --git a/public/tvox/answer.html b/public/tvox/answer.html index 36fd6cd..f4edc0d 100644 --- a/public/tvox/answer.html +++ b/public/tvox/answer.html @@ -53,14 +53,14 @@
{{contactName}} - {{message.createdAt.substring(11,16)}} + {{ message.createdAt | date: 'medium'}}
- {{message.createdAt.substring(11,16)}} + {{ message.createdAt | date: 'medium' }}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 8664e2c..87dac77 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 _0x0171=['TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','motionbar','jscripty','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0171,0x1d3));var _0x1017=function(_0x1dc8c0,_0xb09ea1){_0x1dc8c0=_0x1dc8c0-0x0;var _0x5bbe2f=_0x0171[_0x1dc8c0];return _0x5bbe2f;};'use strict';var Sequelize=require(_0x1017('0x0'));module[_0x1017('0x1')]={'name':{'type':Sequelize[_0x1017('0x2')],'get':function(_0x225c43){return this['getDataValue'](_0x1017('0x3'));}},'action':{'type':Sequelize[_0x1017('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x1017('0x5'),_0x1017('0x6'),'urlForward','browser',_0x1017('0x7'),'script']],'msg':_0x1017('0x8')}},'comment':_0x1017('0x8')},'data1':{'type':Sequelize[_0x1017('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x1017('0x4')](0x1000),'comment':_0x1017('0x9')},'data3':{'type':Sequelize[_0x1017('0x4')](0x1000),'comment':_0x1017('0xa')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x1017('0xb')},'data6':{'type':Sequelize['STRING'],'comments':_0x1017('0xc')},'data7':{'type':Sequelize[_0x1017('0xd')],'comments':_0x1017('0xe')}}; \ No newline at end of file +var _0xa566=['exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize'];(function(_0x4120a6,_0x5ae598){var _0x7c2220=function(_0x3fd0ef){while(--_0x3fd0ef){_0x4120a6['push'](_0x4120a6['shift']());}};_0x7c2220(++_0x5ae598);}(_0xa566,0x1c1));var _0x6a56=function(_0x4a6a8b,_0x4e9b87){_0x4a6a8b=_0x4a6a8b-0x0;var _0x3548ed=_0xa566[_0x4a6a8b];return _0x3548ed;};'use strict';var Sequelize=require(_0x6a56('0x0'));module[_0x6a56('0x1')]={'name':{'type':Sequelize[_0x6a56('0x2')],'get':function(_0x5ccd87){return this[_0x6a56('0x3')](_0x6a56('0x4'));}},'action':{'type':Sequelize[_0x6a56('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6a56('0x6'),'integration',_0x6a56('0x7'),'jscripty','urlForward','browser','bot',_0x6a56('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x6a56('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6a56('0xa')},'data2':{'type':Sequelize[_0x6a56('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x6a56('0x5')](0x1000),'comment':_0x6a56('0xb')},'data4':{'type':Sequelize[_0x6a56('0x5')](0x1000),'comments':_0x6a56('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x6a56('0xd')},'data6':{'type':Sequelize[_0x6a56('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x6a56('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index fde79fa..98cd05c 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 _0x9b96=['body','find','params','catch','destroy','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send'];(function(_0x46b599,_0x4e12b9){var _0x470496=function(_0x5764c8){while(--_0x5764c8){_0x46b599['push'](_0x46b599['shift']());}};_0x470496(++_0x4e12b9);}(_0x9b96,0x175));var _0x69b9=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9b96[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69b9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69b9('0x1'));var rp=require(_0x69b9('0x2'));var moment=require(_0x69b9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x69b9('0x4'));var util=require(_0x69b9('0x5'));var path=require(_0x69b9('0x6'));var sox=require(_0x69b9('0x7'));var csv=require(_0x69b9('0x8'));var ejs=require(_0x69b9('0x9'));var fs=require('fs');var fs_extra=require(_0x69b9('0xa'));var _=require(_0x69b9('0xb'));var squel=require('squel');var crypto=require(_0x69b9('0xc'));var jsforce=require(_0x69b9('0xd'));var deskjs=require(_0x69b9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x69b9('0xf'));var Redis=require('ioredis');var authService=require(_0x69b9('0x10'));var qs=require(_0x69b9('0x11'));var as=require(_0x69b9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69b9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x69b9('0x14'));var licenseUtil=require(_0x69b9('0x15'));var db=require(_0x69b9('0x16'))['db'];function respondWithStatusCode(_0x3c1df4,_0x2730c7){_0x2730c7=_0x2730c7||0xcc;return function(_0xcf551b){if(_0xcf551b){return _0x3c1df4[_0x69b9('0x17')](_0x2730c7);}return _0x3c1df4[_0x69b9('0x18')](_0x2730c7)['end']();};}function respondWithResult(_0xb3ca5b,_0x2bf3b0){_0x2bf3b0=_0x2bf3b0||0xc8;return function(_0x406ce4){if(_0x406ce4){return _0xb3ca5b[_0x69b9('0x18')](_0x2bf3b0)[_0x69b9('0x19')](_0x406ce4);}};}function respondWithFilteredResult(_0x2a9304,_0x1b2c0b){return function(_0x58a13a){if(_0x58a13a){var _0x6de9f=typeof _0x1b2c0b[_0x69b9('0x1a')]===_0x69b9('0x1b')&&typeof _0x1b2c0b[_0x69b9('0x1c')]==='undefined';var _0x2bae03=_0x58a13a[_0x69b9('0x1d')];var _0x1448df=_0x6de9f?0x0:_0x1b2c0b[_0x69b9('0x1a')];var _0x2a25d7=_0x6de9f?_0x58a13a['count']:_0x1b2c0b['offset']+_0x1b2c0b[_0x69b9('0x1c')];var _0x4576b7;if(_0x2a25d7>=_0x2bae03){_0x2a25d7=_0x2bae03;_0x4576b7=0xc8;}else{_0x4576b7=0xce;}_0x2a9304[_0x69b9('0x18')](_0x4576b7);return _0x2a9304[_0x69b9('0x1e')](_0x69b9('0x1f'),_0x1448df+'-'+_0x2a25d7+'/'+_0x2bae03)['json'](_0x58a13a);}return null;};}function patchUpdates(_0xe3606d){return function(_0x9e20c2){try{jsonpatch[_0x69b9('0x20')](_0x9e20c2,_0xe3606d,!![]);}catch(_0x5475f3){return BPromise['reject'](_0x5475f3);}return _0x9e20c2[_0x69b9('0x21')]();};}function saveUpdates(_0x2d1c44,_0x243a13){return function(_0x4d3373){if(_0x4d3373){return _0x4d3373[_0x69b9('0x22')](_0x2d1c44)['then'](function(_0x2740a7){return _0x2740a7;});}return null;};}function removeEntity(_0x15894b,_0x312da3){return function(_0x1cfc1f){if(_0x1cfc1f){return _0x1cfc1f['destroy']()[_0x69b9('0x23')](function(){_0x15894b[_0x69b9('0x18')](0xcc)[_0x69b9('0x24')]();});}};}function handleEntityNotFound(_0x252c78,_0x5e7615){return function(_0x145273){if(!_0x145273){_0x252c78[_0x69b9('0x17')](0x194);}return _0x145273;};}function handleError(_0x10454f,_0x6b437e){_0x6b437e=_0x6b437e||0x1f4;return function(_0x192177){logger[_0x69b9('0x25')](_0x192177[_0x69b9('0x26')]);if(_0x192177[_0x69b9('0x27')]){delete _0x192177['name'];}_0x10454f['status'](_0x6b437e)[_0x69b9('0x28')](_0x192177);};}exports[_0x69b9('0x22')]=function(_0x3be6b8,_0x37845b){if(_0x3be6b8[_0x69b9('0x29')]['id']){delete _0x3be6b8['body']['id'];}return db['Action'][_0x69b9('0x2a')]({'where':{'id':_0x3be6b8[_0x69b9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x37845b,null))[_0x69b9('0x23')](saveUpdates(_0x3be6b8[_0x69b9('0x29')],null))[_0x69b9('0x23')](respondWithResult(_0x37845b,null))[_0x69b9('0x2c')](handleError(_0x37845b,null));};exports[_0x69b9('0x2d')]=function(_0x3d550d,_0x329fe8){return db['Action'][_0x69b9('0x2a')]({'where':{'id':_0x3d550d['params']['id']}})['then'](handleEntityNotFound(_0x329fe8,null))[_0x69b9('0x23')](removeEntity(_0x329fe8,null))[_0x69b9('0x2c')](handleError(_0x329fe8,null));}; \ No newline at end of file +var _0x9c49=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','body','find','params','Action','catch','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x9c49,0x1b1));var _0x99c4=function(_0x5befc7,_0x68c46d){_0x5befc7=_0x5befc7-0x0;var _0x294581=_0x9c49[_0x5befc7];return _0x294581;};'use strict';var emlformat=require(_0x99c4('0x0'));var rimraf=require(_0x99c4('0x1'));var zipdir=require(_0x99c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x99c4('0x3'));var BPromise=require(_0x99c4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x99c4('0x5'));var sox=require(_0x99c4('0x6'));var csv=require(_0x99c4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99c4('0x8'));var _=require(_0x99c4('0x9'));var squel=require(_0x99c4('0xa'));var crypto=require('crypto');var jsforce=require(_0x99c4('0xb'));var deskjs=require(_0x99c4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x99c4('0xd'));var Papa=require(_0x99c4('0xe'));var Redis=require(_0x99c4('0xf'));var authService=require(_0x99c4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x99c4('0x11'));var hardwareService=require(_0x99c4('0x12'));var logger=require('../../config/logger')(_0x99c4('0x13'));var utils=require(_0x99c4('0x14'));var config=require(_0x99c4('0x15'));var licenseUtil=require(_0x99c4('0x16'));var db=require(_0x99c4('0x17'))['db'];function respondWithStatusCode(_0x364dd5,_0x3b0778){_0x3b0778=_0x3b0778||0xcc;return function(_0x5cd823){if(_0x5cd823){return _0x364dd5['sendStatus'](_0x3b0778);}return _0x364dd5[_0x99c4('0x18')](_0x3b0778)['end']();};}function respondWithResult(_0x298c47,_0x371ac2){_0x371ac2=_0x371ac2||0xc8;return function(_0x526e0b){if(_0x526e0b){return _0x298c47[_0x99c4('0x18')](_0x371ac2)[_0x99c4('0x19')](_0x526e0b);}};}function respondWithFilteredResult(_0x2e85af,_0xa2d7bd){return function(_0x4269c0){if(_0x4269c0){var _0x327565=typeof _0xa2d7bd[_0x99c4('0x1a')]==='undefined'&&typeof _0xa2d7bd[_0x99c4('0x1b')]===_0x99c4('0x1c');var _0x50179e=_0x4269c0[_0x99c4('0x1d')];var _0x19d2b0=_0x327565?0x0:_0xa2d7bd[_0x99c4('0x1a')];var _0x3f7e97=_0x327565?_0x4269c0[_0x99c4('0x1d')]:_0xa2d7bd[_0x99c4('0x1a')]+_0xa2d7bd[_0x99c4('0x1b')];var _0x4cfac5;if(_0x3f7e97>=_0x50179e){_0x3f7e97=_0x50179e;_0x4cfac5=0xc8;}else{_0x4cfac5=0xce;}_0x2e85af[_0x99c4('0x18')](_0x4cfac5);return _0x2e85af[_0x99c4('0x1e')](_0x99c4('0x1f'),_0x19d2b0+'-'+_0x3f7e97+'/'+_0x50179e)['json'](_0x4269c0);}return null;};}function patchUpdates(_0x3f2001){return function(_0x4c22d7){try{jsonpatch[_0x99c4('0x20')](_0x4c22d7,_0x3f2001,!![]);}catch(_0x10e54f){return BPromise[_0x99c4('0x21')](_0x10e54f);}return _0x4c22d7[_0x99c4('0x22')]();};}function saveUpdates(_0x50237c,_0xbaa780){return function(_0x2db03b){if(_0x2db03b){return _0x2db03b[_0x99c4('0x23')](_0x50237c)['then'](function(_0x51e042){return _0x51e042;});}return null;};}function removeEntity(_0x47eefa,_0xd9a591){return function(_0x188fdb){if(_0x188fdb){return _0x188fdb[_0x99c4('0x24')]()[_0x99c4('0x25')](function(){_0x47eefa[_0x99c4('0x18')](0xcc)[_0x99c4('0x26')]();});}};}function handleEntityNotFound(_0x278469,_0x2ef9c4){return function(_0x209212){if(!_0x209212){_0x278469[_0x99c4('0x27')](0x194);}return _0x209212;};}function handleError(_0x5827d2,_0x50b30a){_0x50b30a=_0x50b30a||0x1f4;return function(_0x3ef3c4){logger[_0x99c4('0x28')](_0x3ef3c4[_0x99c4('0x29')]);if(_0x3ef3c4[_0x99c4('0x2a')]){delete _0x3ef3c4['name'];}_0x5827d2['status'](_0x50b30a)[_0x99c4('0x2b')](_0x3ef3c4);};}exports[_0x99c4('0x23')]=function(_0x1c486d,_0x4bccf5){if(_0x1c486d[_0x99c4('0x2c')]['id']){delete _0x1c486d['body']['id'];}return db['Action'][_0x99c4('0x2d')]({'where':{'id':_0x1c486d[_0x99c4('0x2e')]['id']}})[_0x99c4('0x25')](handleEntityNotFound(_0x4bccf5,null))[_0x99c4('0x25')](saveUpdates(_0x1c486d[_0x99c4('0x2c')],null))[_0x99c4('0x25')](respondWithResult(_0x4bccf5,null))['catch'](handleError(_0x4bccf5,null));};exports[_0x99c4('0x24')]=function(_0x2203ea,_0x1674f0){return db[_0x99c4('0x2f')][_0x99c4('0x2d')]({'where':{'id':_0x2203ea[_0x99c4('0x2e')]['id']}})[_0x99c4('0x25')](handleEntityNotFound(_0x1674f0,null))[_0x99c4('0x25')](removeEntity(_0x1674f0,null))[_0x99c4('0x30')](handleError(_0x1674f0,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9102437..4100721 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 _0x992a=['tools_actions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','Action'];(function(_0x19bd9d,_0x508bde){var _0x572e75=function(_0x3e442c){while(--_0x3e442c){_0x19bd9d['push'](_0x19bd9d['shift']());}};_0x572e75(++_0x508bde);}(_0x992a,0xbc));var _0xa992=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x992a[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xa992('0x0'));var util=require(_0xa992('0x1'));var logger=require(_0xa992('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa992('0x3'));var rp=require(_0xa992('0x4'));var fs=require('fs');var path=require(_0xa992('0x5'));var rimraf=require(_0xa992('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xa992('0x7')]=function(_0x3c527c,_0x53f19b){return _0x3c527c[_0xa992('0x8')](_0xa992('0x9'),attributes,{'tableName':_0xa992('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4131=['path','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2005a6,_0x5c9f66){var _0x16cf92=function(_0x1ee89b){while(--_0x1ee89b){_0x2005a6['push'](_0x2005a6['shift']());}};_0x16cf92(++_0x5c9f66);}(_0x4131,0x10e));var _0x1413=function(_0xcf0d77,_0x2195aa){_0xcf0d77=_0xcf0d77-0x0;var _0x13b05f=_0x4131[_0xcf0d77];return _0x13b05f;};'use strict';var _=require(_0x1413('0x0'));var util=require(_0x1413('0x1'));var logger=require(_0x1413('0x2'))(_0x1413('0x3'));var moment=require(_0x1413('0x4'));var BPromise=require(_0x1413('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1413('0x6'));var rimraf=require(_0x1413('0x7'));var config=require(_0x1413('0x8'));var attributes=require(_0x1413('0x9'));module['exports']=function(_0x133add,_0xecefba){return _0x133add[_0x1413('0xa')]('Action',attributes,{'tableName':_0x1413('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 3a5fda4..0461288 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x814b,0x1a2));var _0xb814=function(_0x5da63e,_0x4d3503){_0x5da63e=_0x5da63e-0x0;var _0x442aca=_0x814b[_0x5da63e];return _0x442aca;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xf494,0x1c6));var _0x4f49=function(_0x3105ad,_0x57d140){_0x3105ad=_0x3105ad-0x0;var _0x51c358=_0xf494[_0x3105ad];return _0x51c358;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index ffb610b..4900ed4 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 _0x7c3b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./action.controller','isAuthenticated','update','delete','/:id','destroy','exports'];(function(_0x1eeeac,_0x1d2625){var _0x526c23=function(_0xf76a25){while(--_0xf76a25){_0x1eeeac['push'](_0x1eeeac['shift']());}};_0x526c23(++_0x1d2625);}(_0x7c3b,0x186));var _0xb7c3=function(_0x17387e,_0x2a45a6){_0x17387e=_0x17387e-0x0;var _0x74a5e4=_0x7c3b[_0x17387e];return _0x74a5e4;};'use strict';var multer=require(_0xb7c3('0x0'));var util=require(_0xb7c3('0x1'));var path=require(_0xb7c3('0x2'));var timeout=require(_0xb7c3('0x3'));var express=require(_0xb7c3('0x4'));var router=express[_0xb7c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb7c3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb7c3('0x7'));var controller=require(_0xb7c3('0x8'));router['put']('/:id',auth[_0xb7c3('0x9')](),controller[_0xb7c3('0xa')]);router[_0xb7c3('0xb')](_0xb7c3('0xc'),auth[_0xb7c3('0x9')](),controller[_0xb7c3('0xd')]);module[_0xb7c3('0xe')]=router; \ No newline at end of file +var _0x41c7=['./action.controller','isAuthenticated','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2e831b,_0x2685a3){var _0x90026e=function(_0x3abbaf){while(--_0x3abbaf){_0x2e831b['push'](_0x2e831b['shift']());}};_0x90026e(++_0x2685a3);}(_0x41c7,0x15f));var _0x741c=function(_0x4ef5fe,_0x55cdf5){_0x4ef5fe=_0x4ef5fe-0x0;var _0x4537f4=_0x41c7[_0x4ef5fe];return _0x4537f4;};'use strict';var multer=require(_0x741c('0x0'));var util=require(_0x741c('0x1'));var path=require(_0x741c('0x2'));var timeout=require(_0x741c('0x3'));var express=require(_0x741c('0x4'));var router=express[_0x741c('0x5')]();var fs_extra=require(_0x741c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x741c('0x7'));var config=require(_0x741c('0x8'));var controller=require(_0x741c('0x9'));router['put']('/:id',auth[_0x741c('0xa')](),controller['update']);router[_0x741c('0xb')](_0x741c('0xc'),auth['isAuthenticated'](),controller[_0x741c('0xd')]);module[_0x741c('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 c089548..05dd201 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 _0xbd51=['sequelize','STRING'];(function(_0x8f7cb6,_0xf929c8){var _0xf4d3a1=function(_0x3e3d31){while(--_0x3e3d31){_0x8f7cb6['push'](_0x8f7cb6['shift']());}};_0xf4d3a1(++_0xf929c8);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x409253,_0x2916c2){_0x409253=_0x409253-0x0;var _0x11952e=_0xbd51[_0x409253];return _0x11952e;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x1e016c,_0x5b378b){var _0x30bf42=function(_0x346db8){while(--_0x346db8){_0x1e016c['push'](_0x1e016c['shift']());}};_0x30bf42(++_0x5b378b);}(_0xeda8,0x104));var _0x8eda=function(_0x3824d0,_0x56c1a7){_0x3824d0=_0x3824d0-0x0;var _0x52f3b5=_0xeda8[_0x3824d0];return _0x52f3b5;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index ec83f8e..714736d 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 _0xb8eb=['limit','count','set','Content-Range','reject','update','then','destroy','CustomReports','error','name','send','index','map','rawAttributes','fieldName','type','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','select','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','COUNT(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','ValidationErrorItem','AnalyticMetric','DESC','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SELECT','run','runReport','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0xb8eb,0x1d3));var _0xbb8e=function(_0x5d7661,_0x3f4c1c){_0x5d7661=_0x5d7661-0x0;var _0xa69dd3=_0xb8eb[_0x5d7661];return _0xa69dd3;};'use strict';var emlformat=require(_0xbb8e('0x0'));var rimraf=require(_0xbb8e('0x1'));var zipdir=require(_0xbb8e('0x2'));var jsonpatch=require(_0xbb8e('0x3'));var rp=require(_0xbb8e('0x4'));var moment=require(_0xbb8e('0x5'));var BPromise=require(_0xbb8e('0x6'));var Mustache=require('mustache');var util=require(_0xbb8e('0x7'));var path=require(_0xbb8e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb8e('0x9'));var fs=require('fs');var fs_extra=require(_0xbb8e('0xa'));var _=require(_0xbb8e('0xb'));var squel=require(_0xbb8e('0xc'));var crypto=require(_0xbb8e('0xd'));var jsforce=require(_0xbb8e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbb8e('0xf'));var querystring=require(_0xbb8e('0x10'));var Papa=require('papaparse');var Redis=require(_0xbb8e('0x11'));var authService=require(_0xbb8e('0x12'));var qs=require(_0xbb8e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb8e('0x14'));var logger=require(_0xbb8e('0x15'))(_0xbb8e('0x16'));var utils=require(_0xbb8e('0x17'));var config=require(_0xbb8e('0x18'));var licenseUtil=require(_0xbb8e('0x19'));var db=require(_0xbb8e('0x1a'))['db'];var dbH=require('../../mysqldb')[_0xbb8e('0x1b')];function respondWithStatusCode(_0x53b314,_0x25a02a){_0x25a02a=_0x25a02a||0xcc;return function(_0x45d067){if(_0x45d067){return _0x53b314[_0xbb8e('0x1c')](_0x25a02a);}return _0x53b314[_0xbb8e('0x1d')](_0x25a02a)[_0xbb8e('0x1e')]();};}function respondWithResult(_0x513e5d,_0x11d162){_0x11d162=_0x11d162||0xc8;return function(_0x20acb3){if(_0x20acb3){return _0x513e5d[_0xbb8e('0x1d')](_0x11d162)[_0xbb8e('0x1f')](_0x20acb3);}};}function respondWithFilteredResult(_0x513bb0,_0x5a6429){return function(_0x31c3c1){if(_0x31c3c1){var _0x533c44=typeof _0x5a6429[_0xbb8e('0x20')]===_0xbb8e('0x21')&&typeof _0x5a6429[_0xbb8e('0x22')]==='undefined';var _0x436cf7=_0x31c3c1[_0xbb8e('0x23')];var _0x48f7f0=_0x533c44?0x0:_0x5a6429[_0xbb8e('0x20')];var _0x359614=_0x533c44?_0x31c3c1['count']:_0x5a6429['offset']+_0x5a6429[_0xbb8e('0x22')];var _0x44daed;if(_0x359614>=_0x436cf7){_0x359614=_0x436cf7;_0x44daed=0xc8;}else{_0x44daed=0xce;}_0x513bb0['status'](_0x44daed);return _0x513bb0[_0xbb8e('0x24')](_0xbb8e('0x25'),_0x48f7f0+'-'+_0x359614+'/'+_0x436cf7)[_0xbb8e('0x1f')](_0x31c3c1);}return null;};}function patchUpdates(_0x39b75d){return function(_0x5c7c8b){try{jsonpatch['apply'](_0x5c7c8b,_0x39b75d,!![]);}catch(_0x1ba005){return BPromise[_0xbb8e('0x26')](_0x1ba005);}return _0x5c7c8b['save']();};}function saveUpdates(_0x2a662e,_0x1eaa65){return function(_0x4cd345){if(_0x4cd345){return _0x4cd345[_0xbb8e('0x27')](_0x2a662e)[_0xbb8e('0x28')](function(_0x27036a){return _0x27036a;});}return null;};}function removeEntity(_0x1dc5b0,_0x51f862){return function(_0x758e67){if(_0x758e67){return _0x758e67[_0xbb8e('0x29')]()['then'](function(){var _0x36bcfb=_0x758e67['get']({'plain':!![]});var _0x48b719=_0xbb8e('0x2a');return db['UserProfileResource'][_0xbb8e('0x29')]({'where':{'type':_0x48b719,'resourceId':_0x36bcfb['id']}})['then'](function(){return _0x758e67;});})[_0xbb8e('0x28')](function(){_0x1dc5b0[_0xbb8e('0x1d')](0xcc)[_0xbb8e('0x1e')]();});}};}function handleEntityNotFound(_0x62633,_0x5a1916){return function(_0x8c917){if(!_0x8c917){_0x62633[_0xbb8e('0x1c')](0x194);}return _0x8c917;};}function handleError(_0x17e2e3,_0x146f89){_0x146f89=_0x146f89||0x1f4;return function(_0x90b96c){logger[_0xbb8e('0x2b')](_0x90b96c['stack']);if(_0x90b96c['name']){delete _0x90b96c[_0xbb8e('0x2c')];}_0x17e2e3[_0xbb8e('0x1d')](_0x146f89)[_0xbb8e('0x2d')](_0x90b96c);};}exports[_0xbb8e('0x2e')]=function(_0x4cbb98,_0x1ab76e){var _0x1e38aa={},_0x2b3cfb={},_0x36971c={'count':0x0,'rows':[]};var _0x3ce882=_[_0xbb8e('0x2f')](db['AnalyticCustomReport'][_0xbb8e('0x30')],function(_0x1c5844){return{'name':_0x1c5844[_0xbb8e('0x31')],'type':_0x1c5844[_0xbb8e('0x32')]['key']};});_0x2b3cfb['model']=_[_0xbb8e('0x2f')](_0x3ce882,_0xbb8e('0x2c'));_0x2b3cfb['query']=_['keys'](_0x4cbb98[_0xbb8e('0x33')]);_0x2b3cfb['filters']=_['intersection'](_0x2b3cfb[_0xbb8e('0x34')],_0x2b3cfb[_0xbb8e('0x33')]);_0x1e38aa[_0xbb8e('0x35')]=_[_0xbb8e('0x36')](_0x2b3cfb[_0xbb8e('0x34')],qs[_0xbb8e('0x37')](_0x4cbb98[_0xbb8e('0x33')][_0xbb8e('0x37')]));_0x1e38aa['attributes']=_0x1e38aa['attributes'][_0xbb8e('0x38')]?_0x1e38aa[_0xbb8e('0x35')]:_0x2b3cfb[_0xbb8e('0x34')];if(!_0x4cbb98[_0xbb8e('0x33')][_0xbb8e('0x39')]('nolimit')){_0x1e38aa['limit']=qs[_0xbb8e('0x22')](_0x4cbb98[_0xbb8e('0x33')]['limit']);_0x1e38aa['offset']=qs['offset'](_0x4cbb98[_0xbb8e('0x33')][_0xbb8e('0x20')]);}_0x1e38aa[_0xbb8e('0x3a')]=qs['sort'](_0x4cbb98['query'][_0xbb8e('0x3b')]);_0x1e38aa['where']=qs[_0xbb8e('0x3c')](_[_0xbb8e('0x3d')](_0x4cbb98['query'],_0x2b3cfb[_0xbb8e('0x3c')]),_0x3ce882);if(_0x4cbb98[_0xbb8e('0x33')][_0xbb8e('0x3e')]){_0x1e38aa[_0xbb8e('0x3f')]=_[_0xbb8e('0x40')](_0x1e38aa[_0xbb8e('0x3f')],{'$or':_[_0xbb8e('0x2f')](_0x3ce882,function(_0x377835){if(_0x377835[_0xbb8e('0x32')]!=='VIRTUAL'){var _0x32a551={};_0x32a551[_0x377835[_0xbb8e('0x2c')]]={'$like':'%'+_0x4cbb98[_0xbb8e('0x33')][_0xbb8e('0x3e')]+'%'};return _0x32a551;}})});}_0x1e38aa=_[_0xbb8e('0x40')]({},_0x1e38aa,_0x4cbb98[_0xbb8e('0x41')]);var _0x191784={'where':_0x1e38aa[_0xbb8e('0x3f')]};return db[_0xbb8e('0x42')][_0xbb8e('0x23')](_0x191784)[_0xbb8e('0x28')](function(_0x403d57){_0x36971c[_0xbb8e('0x23')]=_0x403d57;if(_0x4cbb98[_0xbb8e('0x33')][_0xbb8e('0x43')]){_0x1e38aa[_0xbb8e('0x44')]=[{'all':!![]}];}return db[_0xbb8e('0x42')][_0xbb8e('0x45')](_0x1e38aa);})['then'](function(_0x4d12b){_0x36971c[_0xbb8e('0x46')]=_0x4d12b;return _0x36971c;})[_0xbb8e('0x28')](respondWithFilteredResult(_0x1ab76e,_0x1e38aa))[_0xbb8e('0x47')](handleError(_0x1ab76e,null));};exports[_0xbb8e('0x48')]=function(_0x4f0cb4,_0x3ffd3c){var _0x553ae0={'raw':![],'where':{'id':_0x4f0cb4[_0xbb8e('0x49')]['id']}},_0x5dc7b8={};_0x5dc7b8[_0xbb8e('0x34')]=_[_0xbb8e('0x4a')](db[_0xbb8e('0x42')][_0xbb8e('0x30')]);_0x5dc7b8['query']=_[_0xbb8e('0x4a')](_0x4f0cb4['query']);_0x5dc7b8[_0xbb8e('0x3c')]=_[_0xbb8e('0x36')](_0x5dc7b8[_0xbb8e('0x34')],_0x5dc7b8['query']);_0x553ae0['attributes']=_['intersection'](_0x5dc7b8[_0xbb8e('0x34')],qs['fields'](_0x4f0cb4[_0xbb8e('0x33')][_0xbb8e('0x37')]));_0x553ae0[_0xbb8e('0x35')]=_0x553ae0[_0xbb8e('0x35')][_0xbb8e('0x38')]?_0x553ae0['attributes']:_0x5dc7b8[_0xbb8e('0x34')];if(_0x4f0cb4[_0xbb8e('0x33')]['includeAll']){_0x553ae0[_0xbb8e('0x44')]=[{'all':!![]}];}_0x553ae0=_[_0xbb8e('0x40')]({},_0x553ae0,_0x4f0cb4[_0xbb8e('0x41')]);return db[_0xbb8e('0x42')][_0xbb8e('0x4b')](_0x553ae0)[_0xbb8e('0x28')](handleEntityNotFound(_0x3ffd3c,null))[_0xbb8e('0x28')](respondWithResult(_0x3ffd3c,null))[_0xbb8e('0x47')](handleError(_0x3ffd3c,null));};exports['create']=function(_0xe80dc2,_0x373cdf){return db[_0xbb8e('0x42')][_0xbb8e('0x4c')](_0xe80dc2[_0xbb8e('0x4d')],{})[_0xbb8e('0x28')](function(_0x1bf521){var _0x2e8f97=_0xe80dc2[_0xbb8e('0x4e')][_0xbb8e('0x4f')]({'plain':!![]});if(!_0x2e8f97)throw new Error(_0xbb8e('0x50'));if(_0x2e8f97[_0xbb8e('0x51')]==='user'){var _0x2c207c=_0x1bf521[_0xbb8e('0x4f')]({'plain':!![]});var _0x59b758='Reports';return db[_0xbb8e('0x52')][_0xbb8e('0x4b')]({'where':{'name':_0x59b758,'userProfileId':_0x2e8f97['userProfileId']},'raw':!![]})[_0xbb8e('0x28')](function(_0x3d8a04){if(_0x3d8a04&&_0x3d8a04[_0xbb8e('0x53')]===0x0){return db[_0xbb8e('0x54')][_0xbb8e('0x4c')]({'name':_0x2c207c[_0xbb8e('0x2c')],'resourceId':_0x2c207c['id'],'type':'CustomReports','sectionId':_0x3d8a04['id']},{})[_0xbb8e('0x28')](function(){return _0x1bf521;});}else{return _0x1bf521;}})['catch'](function(_0x1324c2){logger[_0xbb8e('0x2b')](_0xbb8e('0x55'),_0x1324c2);throw _0x1324c2;});}return _0x1bf521;})['then'](respondWithResult(_0x373cdf,0xc9))[_0xbb8e('0x47')](handleError(_0x373cdf,null));};exports[_0xbb8e('0x27')]=function(_0x13fece,_0x42242b){if(_0x13fece[_0xbb8e('0x4d')]['id']){delete _0x13fece[_0xbb8e('0x4d')]['id'];}return db[_0xbb8e('0x42')]['find']({'where':{'id':_0x13fece[_0xbb8e('0x49')]['id']}})['then'](handleEntityNotFound(_0x42242b,null))[_0xbb8e('0x28')](saveUpdates(_0x13fece[_0xbb8e('0x4d')],null))[_0xbb8e('0x28')](respondWithResult(_0x42242b,null))[_0xbb8e('0x47')](handleError(_0x42242b,null));};exports['destroy']=function(_0x80818c,_0xe40306){return db[_0xbb8e('0x42')]['find']({'where':{'id':_0x80818c['params']['id']}})[_0xbb8e('0x28')](handleEntityNotFound(_0xe40306,null))[_0xbb8e('0x28')](removeEntity(_0xe40306,null))[_0xbb8e('0x47')](handleError(_0xe40306,null));};exports[_0xbb8e('0x56')]=function(_0x15e73e,_0x3120d1){var _0x46c847=0xa;var _0x55e3b5=[_0xbb8e('0x57'),_0xbb8e('0x58'),_0xbb8e('0x59'),_0xbb8e('0x5a')];var _0x31ecba={'SUM':_0xbb8e('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbb8e('0x5c'),'MAX':_0xbb8e('0x5d'),'MIN':_0xbb8e('0x5e'),'AVG':_0xbb8e('0x5f'),'GROUP_CONCAT':_0xbb8e('0x60'),'GROUP_CONCAT ASC':_0xbb8e('0x61'),'GROUP_CONCAT DESC':_0xbb8e('0x62')};var _0x5dbef4={'SEC_TO_TIME':_0xbb8e('0x63'),'DATE':_0xbb8e('0x64'),'HOUR':_0xbb8e('0x65'),'ROUND':_0xbb8e('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x12daa4=function(_0x585494){return!_[_0xbb8e('0x67')]([_0xbb8e('0x68'),'IS\x20NOT\x20NULL',_0xbb8e('0x69'),_0xbb8e('0x6a')],_0x585494);};var _0x1451d6=function(_0x137e7a){if(!_0x137e7a||!_0x137e7a[_0xbb8e('0x6b')][_0xbb8e('0x38')]){return'';}for(var _0x292e3c='(',_0x1ca1b5=0x0;_0x1ca1b5<_0x137e7a[_0xbb8e('0x6b')][_0xbb8e('0x38')];_0x1ca1b5+=0x1){_0x1ca1b5>0x0&&(_0x292e3c+='\x20'+_0x137e7a['operator']+'\x20');_0x292e3c+=_0x137e7a[_0xbb8e('0x6b')][_0x1ca1b5][_0xbb8e('0x6c')]?_0x1451d6(_0x137e7a[_0xbb8e('0x6b')][_0x1ca1b5][_0xbb8e('0x6c')]):_0x137e7a[_0xbb8e('0x6b')][_0x1ca1b5]['field']+'\x20'+_0x137e7a['rules'][_0x1ca1b5][_0xbb8e('0x6d')]+(_0x12daa4(_0x137e7a[_0xbb8e('0x6b')][_0x1ca1b5]['condition'])?'\x20'+_0x137e7a[_0xbb8e('0x6b')][_0x1ca1b5][_0xbb8e('0x6e')]:'');}return _0x292e3c+')';};var _0x1b62bd={'where':{'id':_0x15e73e[_0xbb8e('0x49')]['id']}},_0x3fba7d,_0x19b6e9,_0x43621f,_0x10fe22,_0x411fb1;_0x1b62bd=_[_0xbb8e('0x40')]({},_0x1b62bd,_0x15e73e['options']);return db[_0xbb8e('0x42')][_0xbb8e('0x4b')](_0x1b62bd)[_0xbb8e('0x28')](function(_0x1941ec){if(_0x1941ec){_0x3fba7d=_0x1941ec;return _0x1941ec[_0xbb8e('0x6f')]();}return null;})[_0xbb8e('0x28')](function(_0x27a603){if(_0x27a603){if(!_0x27a603[_0xbb8e('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xbb8e('0x70'),0x193);}_0x19b6e9=_0x27a603;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xbb8e('0x28')](function(_0x3907d3){if(_0x3907d3){_0x43621f=_['keyBy'](_0x3907d3,'id');var _0x2c17c7;var _0x32e522=squel[_0xbb8e('0x71')]();_0x32e522[_0xbb8e('0x72')](_0x3fba7d['table']);for(var _0x37cdc6=0x0;_0x37cdc6<_0x19b6e9[_0xbb8e('0x38')];_0x37cdc6+=0x1){_0x2c17c7=_0x19b6e9[_0x37cdc6][_0xbb8e('0x73')]?_0x43621f[_0x19b6e9[_0x37cdc6][_0xbb8e('0x73')]][_0xbb8e('0x74')]:_0x19b6e9[_0x37cdc6][_0xbb8e('0x75')];_0x2c17c7=_0x19b6e9[_0x37cdc6][_0xbb8e('0x76')]?_[_0xbb8e('0x77')](_0x31ecba[_0x19b6e9[_0x37cdc6][_0xbb8e('0x76')]],'%s',_0x2c17c7):_0x2c17c7;_0x2c17c7=_0x19b6e9[_0x37cdc6]['format']?_[_0xbb8e('0x77')](_0x5dbef4[_0x19b6e9[_0x37cdc6][_0xbb8e('0x78')]],'%s',_0x2c17c7):_0x2c17c7;if(_0x19b6e9[_0x37cdc6][_0xbb8e('0x79')]){_0x32e522[_0xbb8e('0x6c')](_0x2c17c7);}_0x19b6e9[_0x37cdc6]['orderBy']&&_0x32e522[_0xbb8e('0x3a')](_0x2c17c7,_0x19b6e9[_0x37cdc6][_0xbb8e('0x7a')]==='DESC'?![]:!![]);_0x32e522[_0xbb8e('0x75')](_0x2c17c7,_0x19b6e9[_0x37cdc6][_0xbb8e('0x7b')]||_0x2c17c7);}if(_0x3fba7d[_0xbb8e('0x7c')]){_0x3fba7d[_0xbb8e('0x7c')]=JSON[_0xbb8e('0x7d')](_0x3fba7d['joins']);for(var _0x3b6fae=0x0;_0x3b6fae<_0x3fba7d['joins']['length'];_0x3b6fae+=0x1){if(_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae][_0xbb8e('0x32')]&&_[_0xbb8e('0x67')](_0x55e3b5,_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae][_0xbb8e('0x32')])&&_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae][_0xbb8e('0x7e')]&&_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae][_0xbb8e('0x7f')]&&_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae][_0xbb8e('0x80')]){_0x32e522[_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae][_0xbb8e('0x32')]](_0x3fba7d['joins'][_0x3b6fae][_0xbb8e('0x7f')],null,util['format'](_0xbb8e('0x81'),_0x3fba7d[_0xbb8e('0x82')],_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae]['parentKey'],_0x3fba7d['joins'][_0x3b6fae][_0xbb8e('0x7f')],_0x3fba7d[_0xbb8e('0x7c')][_0x3b6fae][_0xbb8e('0x80')]));}}}if(_0x3fba7d[_0xbb8e('0x83')]){_0x3fba7d[_0xbb8e('0x83')]=JSON['parse'](_0x3fba7d[_0xbb8e('0x83')]);_0x32e522[_0xbb8e('0x3f')](_0x1451d6(_0x3fba7d[_0xbb8e('0x83')]['group']));}_0x411fb1=_0x32e522[_0xbb8e('0x84')]();_0x32e522[_0xbb8e('0x22')](_0x46c847);_0x32e522[_0xbb8e('0x20')](0x0);logger[_0xbb8e('0x85')](_0xbb8e('0x86'),_0x32e522[_0xbb8e('0x87')]());return dbH['sequelize'][_0xbb8e('0x33')](_0x32e522[_0xbb8e('0x87')](),{'type':dbH[_0xbb8e('0x88')]['QueryTypes']['SELECT']});}})[_0xbb8e('0x28')](respondWithResult(_0x3120d1,null))['catch'](handleError(_0x3120d1,null));};function runReport(_0x3986ce,_0x13f2fe,_0x4d02b8){var _0x295bb0=_0x13f2fe[_0xbb8e('0x2c')];var _0xb5ed7d=0xa;var _0x122a18=[_0xbb8e('0x57'),_0xbb8e('0x58'),_0xbb8e('0x59'),_0xbb8e('0x5a')];var _0x4d6763={'SUM':'SUM(%s)','COUNT':_0xbb8e('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xbb8e('0x5d'),'MIN':'MIN(%s)','AVG':_0xbb8e('0x5f'),'GROUP_CONCAT':_0xbb8e('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xbb8e('0x62')};var _0x22b6cb={'SEC_TO_TIME':_0xbb8e('0x63'),'DATE':_0xbb8e('0x64'),'HOUR':_0xbb8e('0x65'),'ROUND':_0xbb8e('0x66'),'UNIX_TIMESTAMP':_0xbb8e('0x8a')};var _0xa3cc52=function(_0x266ce6){return!_[_0xbb8e('0x67')](['IS\x20NULL',_0xbb8e('0x8b'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x266ce6);};var _0x1fec51=function(_0x56f32d){if(!_0x56f32d||!_0x56f32d[_0xbb8e('0x6b')][_0xbb8e('0x38')]){return'';}for(var _0x44d189='(',_0x13afc9=0x0;_0x13afc9<_0x56f32d[_0xbb8e('0x6b')][_0xbb8e('0x38')];_0x13afc9+=0x1){_0x13afc9>0x0&&(_0x44d189+='\x20'+_0x56f32d['operator']+'\x20');_0x44d189+=_0x56f32d[_0xbb8e('0x6b')][_0x13afc9][_0xbb8e('0x6c')]?_0x1fec51(_0x56f32d[_0xbb8e('0x6b')][_0x13afc9][_0xbb8e('0x6c')]):_0x56f32d[_0xbb8e('0x6b')][_0x13afc9][_0xbb8e('0x75')]+'\x20'+_0x56f32d[_0xbb8e('0x6b')][_0x13afc9][_0xbb8e('0x6d')]+(_0xa3cc52(_0x56f32d['rules'][_0x13afc9][_0xbb8e('0x6d')])?'\x20'+_0x56f32d['rules'][_0x13afc9]['value']:'');}return _0x44d189+')';};var _0xa9085d={'where':{'id':_0x3986ce['id']}},_0x2ec9f8,_0x3d7d4f,_0x17e05e,_0x4d26e0,_0x53ddf8;_0xa9085d=_[_0xbb8e('0x40')]({},_0xa9085d,_0x4d02b8);return db[_0xbb8e('0x42')][_0xbb8e('0x4b')](_0xa9085d)[_0xbb8e('0x28')](function(_0x2380b1){if(_0x2380b1){_0x2ec9f8=_0x2380b1;return _0x2380b1[_0xbb8e('0x6f')]();}return null;})[_0xbb8e('0x28')](function(_0x2e720c){if(_0x2e720c){if(!_0x2e720c[_0xbb8e('0x38')]){throw new db[(_0xbb8e('0x8c'))][(_0xbb8e('0x8d'))](_0xbb8e('0x70'),0x193);}_0x3d7d4f=_0x2e720c;return db[_0xbb8e('0x8e')][_0xbb8e('0x45')]({'raw':!![]});}return null;})[_0xbb8e('0x28')](function(_0x2b2210){if(_0x2b2210){_0x17e05e=_['keyBy'](_0x2b2210,'id');var _0x15ba0d;var _0x23d914=squel['select']();_0x23d914[_0xbb8e('0x72')](_0x2ec9f8[_0xbb8e('0x82')]);for(var _0x4ba5bf=0x0;_0x4ba5bf<_0x3d7d4f['length'];_0x4ba5bf+=0x1){_0x15ba0d=_0x3d7d4f[_0x4ba5bf][_0xbb8e('0x73')]?_0x17e05e[_0x3d7d4f[_0x4ba5bf]['MetricId']]['metric']:_0x3d7d4f[_0x4ba5bf]['field'];_0x15ba0d=_0x3d7d4f[_0x4ba5bf][_0xbb8e('0x76')]?_[_0xbb8e('0x77')](_0x4d6763[_0x3d7d4f[_0x4ba5bf]['function']],'%s',_0x15ba0d):_0x15ba0d;_0x15ba0d=_0x3d7d4f[_0x4ba5bf][_0xbb8e('0x78')]?_[_0xbb8e('0x77')](_0x22b6cb[_0x3d7d4f[_0x4ba5bf]['format']],'%s',_0x15ba0d):_0x15ba0d;if(_0x3d7d4f[_0x4ba5bf][_0xbb8e('0x79')]){_0x23d914[_0xbb8e('0x6c')](_0x15ba0d);}_0x3d7d4f[_0x4ba5bf]['orderBy']&&_0x23d914[_0xbb8e('0x3a')](_0x15ba0d,_0x3d7d4f[_0x4ba5bf][_0xbb8e('0x7a')]===_0xbb8e('0x8f')?![]:!![]);_0x23d914[_0xbb8e('0x75')](_0x15ba0d,_0x3d7d4f[_0x4ba5bf][_0xbb8e('0x7b')]||_0x15ba0d);}if(_0x2ec9f8[_0xbb8e('0x7c')]){_0x2ec9f8[_0xbb8e('0x7c')]=JSON[_0xbb8e('0x7d')](_0x2ec9f8[_0xbb8e('0x7c')]);for(var _0x2ee7ee=0x0;_0x2ee7ee<_0x2ec9f8[_0xbb8e('0x7c')]['length'];_0x2ee7ee+=0x1){if(_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x32')]&&_[_0xbb8e('0x67')](_0x122a18,_0x2ec9f8['joins'][_0x2ee7ee]['type'])&&_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x7e')]&&_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x7f')]&&_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x80')]){_0x23d914[_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x32')]](_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x7f')],null,util['format'](_0xbb8e('0x81'),_0x2ec9f8[_0xbb8e('0x82')],_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x7e')],_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x7f')],_0x2ec9f8[_0xbb8e('0x7c')][_0x2ee7ee][_0xbb8e('0x80')]));}}}if(_0x2ec9f8['conditions']){_0x2ec9f8[_0xbb8e('0x83')]=JSON[_0xbb8e('0x7d')](_0x2ec9f8[_0xbb8e('0x83')]);_0x23d914['where'](_0x1fec51(_0x2ec9f8[_0xbb8e('0x83')][_0xbb8e('0x6c')]));}_0x53ddf8=_0x23d914['clone']();_0x23d914[_0xbb8e('0x22')](_0xb5ed7d);_0x23d914['offset'](0x0);return;}})[_0xbb8e('0x28')](function(){if(_0x13f2fe[_0xbb8e('0x90')]==='web'){return null;}var _0x155e0f=_['merge'](_0x13f2fe,{'name':_0x13f2fe[_0xbb8e('0x91')]||_0x13f2fe[_0xbb8e('0x2c')]||_0x2ec9f8['name'],'basename':_0x295bb0,'savename':util[_0xbb8e('0x78')](_0xbb8e('0x92'),_0x13f2fe[_0xbb8e('0x2c')]||_0x2ec9f8[_0xbb8e('0x2c')],require(_0xbb8e('0x93'))[_0xbb8e('0x94')](0x4),_0x13f2fe[_0xbb8e('0x90')]||_0xbb8e('0x95')),'reportId':_0x2ec9f8['id'],'reportType':_0xbb8e('0x96')});return db[_0xbb8e('0x97')][_0xbb8e('0x4c')](_0x155e0f,{'raw':!![]});})['then'](function(_0x5c941e){if(_0x2ec9f8['table']==='cdr'){_0x53ddf8[_0xbb8e('0x3f')](_0x2ec9f8[_0xbb8e('0x82')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x13f2fe['startDate'],_0x13f2fe['endDate']);}else{_0x53ddf8[_0xbb8e('0x3f')](_0x2ec9f8['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x13f2fe['startDate'],_0x13f2fe[_0xbb8e('0x98')]);}if(_0x5c941e){logger[_0xbb8e('0x99')](_0xbb8e('0x9a'),_0x53ddf8[_0xbb8e('0x87')]());require(_0xbb8e('0x9b'))[_0xbb8e('0x9c')](path['join'](__dirname,_0xbb8e('0x9d'),_0x5c941e[_0xbb8e('0x90')]),[_0x5c941e['id'],_0x53ddf8[_0xbb8e('0x87')](),path[_0xbb8e('0x57')](__dirname,_0xbb8e('0x9e'),_0x5c941e[_0xbb8e('0x9f')]),_0x295bb0]);return _0x5c941e;}else{var _0x517d90=squel['select']();_0x517d90[_0xbb8e('0x72')]('('+_0x53ddf8[_0xbb8e('0x87')]()+')',_0xbb8e('0xa0'));_0x517d90[_0xbb8e('0x75')](_0xbb8e('0xa1'),_0xbb8e('0x23'));_0x53ddf8[_0xbb8e('0x22')](_0x13f2fe[_0xbb8e('0x22')]||_0xb5ed7d);_0x53ddf8['offset'](_0x13f2fe[_0xbb8e('0x20')]||0x0);return dbH['sequelize'][_0xbb8e('0x33')](_0x517d90[_0xbb8e('0x87')](),{'type':dbH['sequelize'][_0xbb8e('0xa2')]['SELECT']})['then'](function(_0x1252a1){if(!_0x1252a1[_0xbb8e('0x38')]){_0x4d26e0=0x0;}else{_0x4d26e0=_0x1252a1[0x0][_0xbb8e('0x23')]||0x0;}return dbH[_0xbb8e('0x88')][_0xbb8e('0x33')](_0x53ddf8[_0xbb8e('0x87')](),{'type':dbH[_0xbb8e('0x88')]['QueryTypes'][_0xbb8e('0xa3')]});})[_0xbb8e('0x28')](function(_0x6b3c47){return{'rows':_0x6b3c47||[],'count':_0x4d26e0};});}});}exports[_0xbb8e('0xa4')]=function(_0x2485cf,_0x497917){return runReport(_0x2485cf['params'],_0x2485cf[_0xbb8e('0x33')],_0x2485cf[_0xbb8e('0x41')])['then'](respondWithResult(_0x497917,null))[_0xbb8e('0x47')](handleError(_0x497917,null));};exports[_0xbb8e('0xa5')]=runReport;exports[_0xbb8e('0x33')]=function(_0x5646b9,_0x325be9){var _0x24b98e=0xa;var _0x2aab1c=['join',_0xbb8e('0x58'),_0xbb8e('0x59'),_0xbb8e('0x5a')];var _0x470967={'SUM':_0xbb8e('0x5b'),'COUNT':_0xbb8e('0x89'),'COUNT DISTINCT':_0xbb8e('0x5c'),'MAX':_0xbb8e('0x5d'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xbb8e('0x62')};var _0x31e523={'SEC_TO_TIME':_0xbb8e('0x63'),'DATE':_0xbb8e('0x64'),'HOUR':_0xbb8e('0x65'),'ROUND':_0xbb8e('0x66'),'UNIX_TIMESTAMP':_0xbb8e('0x8a')};var _0x508dd3=function(_0x4ff720){return!_['includes']([_0xbb8e('0x68'),'IS\x20NOT\x20NULL',_0xbb8e('0x69'),_0xbb8e('0x6a')],_0x4ff720);};var _0x46db3d=function(_0x4c30d7){if(!_0x4c30d7||!_0x4c30d7['rules'][_0xbb8e('0x38')]){return'';}for(var _0x15e798='(',_0xd7bb20=0x0;_0xd7bb20<_0x4c30d7[_0xbb8e('0x6b')][_0xbb8e('0x38')];_0xd7bb20+=0x1){_0xd7bb20>0x0&&(_0x15e798+='\x20'+_0x4c30d7[_0xbb8e('0xa6')]+'\x20');_0x15e798+=_0x4c30d7['rules'][_0xd7bb20][_0xbb8e('0x6c')]?_0x46db3d(_0x4c30d7[_0xbb8e('0x6b')][_0xd7bb20][_0xbb8e('0x6c')]):_0x4c30d7['rules'][_0xd7bb20][_0xbb8e('0x75')]+'\x20'+_0x4c30d7[_0xbb8e('0x6b')][_0xd7bb20][_0xbb8e('0x6d')]+(_0x508dd3(_0x4c30d7[_0xbb8e('0x6b')][_0xd7bb20][_0xbb8e('0x6d')])?'\x20'+_0x4c30d7[_0xbb8e('0x6b')][_0xd7bb20][_0xbb8e('0x6e')]:'');}return _0x15e798+')';};var _0x4b271e={'where':{'id':_0x5646b9[_0xbb8e('0x49')]['id']}},_0x1f7971,_0x5b4e3f,_0x135a7b,_0x11c2c6,_0x5ab987;_0x4b271e=_[_0xbb8e('0x40')]({},_0x4b271e,_0x5646b9[_0xbb8e('0x41')]);return db[_0xbb8e('0x42')]['find'](_0x4b271e)['then'](function(_0x25cb41){if(_0x25cb41){_0x1f7971=_0x25cb41;return _0x25cb41[_0xbb8e('0x6f')]();}return null;})[_0xbb8e('0x28')](function(_0xde9bff){if(_0xde9bff){if(!_0xde9bff[_0xbb8e('0x38')]){throw new db['Sequelize'][(_0xbb8e('0x8d'))](_0xbb8e('0x70'),0x193);}_0x5b4e3f=_0xde9bff;return db['AnalyticMetric'][_0xbb8e('0x45')]({'raw':!![]});}return null;})['then'](function(_0x682688){if(_0x682688){_0x135a7b=_['keyBy'](_0x682688,'id');var _0x4c6283;var _0x17d3ea=squel[_0xbb8e('0x71')]();_0x17d3ea['from'](_0x1f7971[_0xbb8e('0x82')]);for(var _0x1c4df9=0x0;_0x1c4df9<_0x5b4e3f[_0xbb8e('0x38')];_0x1c4df9+=0x1){_0x4c6283=_0x5b4e3f[_0x1c4df9][_0xbb8e('0x73')]?_0x135a7b[_0x5b4e3f[_0x1c4df9][_0xbb8e('0x73')]][_0xbb8e('0x74')]:_0x5b4e3f[_0x1c4df9][_0xbb8e('0x75')];_0x4c6283=_0x5b4e3f[_0x1c4df9]['function']?_[_0xbb8e('0x77')](_0x470967[_0x5b4e3f[_0x1c4df9][_0xbb8e('0x76')]],'%s',_0x4c6283):_0x4c6283;_0x4c6283=_0x5b4e3f[_0x1c4df9]['format']?_[_0xbb8e('0x77')](_0x31e523[_0x5b4e3f[_0x1c4df9][_0xbb8e('0x78')]],'%s',_0x4c6283):_0x4c6283;if(_0x5b4e3f[_0x1c4df9][_0xbb8e('0x79')]){_0x17d3ea['group'](_0x4c6283);}_0x5b4e3f[_0x1c4df9][_0xbb8e('0x7a')]&&_0x17d3ea['order'](_0x4c6283,_0x5b4e3f[_0x1c4df9][_0xbb8e('0x7a')]===_0xbb8e('0x8f')?![]:!![]);_0x17d3ea[_0xbb8e('0x75')](_0x4c6283,_0x5b4e3f[_0x1c4df9][_0xbb8e('0x7b')]||_0x4c6283);}if(_0x1f7971[_0xbb8e('0x7c')]){_0x1f7971[_0xbb8e('0x7c')]=JSON[_0xbb8e('0x7d')](_0x1f7971['joins']);for(var _0x3af21f=0x0;_0x3af21f<_0x1f7971['joins'][_0xbb8e('0x38')];_0x3af21f+=0x1){if(_0x1f7971[_0xbb8e('0x7c')][_0x3af21f][_0xbb8e('0x32')]&&_['includes'](_0x2aab1c,_0x1f7971[_0xbb8e('0x7c')][_0x3af21f][_0xbb8e('0x32')])&&_0x1f7971[_0xbb8e('0x7c')][_0x3af21f]['parentKey']&&_0x1f7971[_0xbb8e('0x7c')][_0x3af21f][_0xbb8e('0x7f')]&&_0x1f7971[_0xbb8e('0x7c')][_0x3af21f][_0xbb8e('0x80')]){_0x17d3ea[_0x1f7971[_0xbb8e('0x7c')][_0x3af21f]['type']](_0x1f7971[_0xbb8e('0x7c')][_0x3af21f]['foreignTable'],null,util['format'](_0xbb8e('0x81'),_0x1f7971[_0xbb8e('0x82')],_0x1f7971[_0xbb8e('0x7c')][_0x3af21f][_0xbb8e('0x7e')],_0x1f7971[_0xbb8e('0x7c')][_0x3af21f][_0xbb8e('0x7f')],_0x1f7971[_0xbb8e('0x7c')][_0x3af21f]['foreignKey']));}}}if(_0x1f7971['conditions']){_0x1f7971[_0xbb8e('0x83')]=JSON[_0xbb8e('0x7d')](_0x1f7971[_0xbb8e('0x83')]);_0x17d3ea['where'](_0x46db3d(_0x1f7971[_0xbb8e('0x83')]['group']));}_0x5ab987=_0x17d3ea[_0xbb8e('0x84')]();_0x17d3ea[_0xbb8e('0x22')](_0x24b98e);_0x17d3ea[_0xbb8e('0x20')](0x0);logger[_0xbb8e('0x85')](_0xbb8e('0x86'),_0x17d3ea[_0xbb8e('0x87')]());return dbH[_0xbb8e('0x88')][_0xbb8e('0x33')](_0x17d3ea[_0xbb8e('0x87')](),{'type':dbH[_0xbb8e('0x88')][_0xbb8e('0xa2')][_0xbb8e('0xa3')]});}})['then'](function(){return{'sql':_0x5ab987[_0xbb8e('0x87')]()};})[_0xbb8e('0x28')](respondWithResult(_0x325be9,null))['catch'](handleError(_0x325be9,null));}; \ No newline at end of file +var _0xe8a1=['to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','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','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','field','function','replace','groupBy','order','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','AnalyticMetric','keyBy','output','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','countTable','COUNT(*)','run','runReport','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto'];(function(_0x29ca31,_0x533b71){var _0xe163bc=function(_0x2e9432){while(--_0x2e9432){_0x29ca31['push'](_0x29ca31['shift']());}};_0xe163bc(++_0x533b71);}(_0xe8a1,0x1d8));var _0x1e8a=function(_0x26ba35,_0x40e9fa){_0x26ba35=_0x26ba35-0x0;var _0x5c2561=_0xe8a1[_0x26ba35];return _0x5c2561;};'use strict';var emlformat=require(_0x1e8a('0x0'));var rimraf=require(_0x1e8a('0x1'));var zipdir=require(_0x1e8a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e8a('0x3'));var moment=require(_0x1e8a('0x4'));var BPromise=require(_0x1e8a('0x5'));var Mustache=require(_0x1e8a('0x6'));var util=require(_0x1e8a('0x7'));var path=require(_0x1e8a('0x8'));var sox=require(_0x1e8a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e8a('0xa'));var _=require(_0x1e8a('0xb'));var squel=require(_0x1e8a('0xc'));var crypto=require(_0x1e8a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1e8a('0xe'));var querystring=require('querystring');var Papa=require(_0x1e8a('0xf'));var Redis=require(_0x1e8a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1e8a('0x11'));var hardwareService=require(_0x1e8a('0x12'));var logger=require(_0x1e8a('0x13'))('api');var utils=require(_0x1e8a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1e8a('0x15'));var db=require(_0x1e8a('0x16'))['db'];var dbH=require(_0x1e8a('0x16'))[_0x1e8a('0x17')];function respondWithStatusCode(_0x486f09,_0x50a1a8){_0x50a1a8=_0x50a1a8||0xcc;return function(_0x53dcb3){if(_0x53dcb3){return _0x486f09['sendStatus'](_0x50a1a8);}return _0x486f09[_0x1e8a('0x18')](_0x50a1a8)[_0x1e8a('0x19')]();};}function respondWithResult(_0x2187e7,_0x5f2006){_0x5f2006=_0x5f2006||0xc8;return function(_0x5a70bf){if(_0x5a70bf){return _0x2187e7[_0x1e8a('0x18')](_0x5f2006)[_0x1e8a('0x1a')](_0x5a70bf);}};}function respondWithFilteredResult(_0x5dc0d3,_0x1a466a){return function(_0x2546f7){if(_0x2546f7){var _0x14654e=typeof _0x1a466a[_0x1e8a('0x1b')]===_0x1e8a('0x1c')&&typeof _0x1a466a['limit']===_0x1e8a('0x1c');var _0x5aab0e=_0x2546f7[_0x1e8a('0x1d')];var _0x54d6fc=_0x14654e?0x0:_0x1a466a[_0x1e8a('0x1b')];var _0x4d0e63=_0x14654e?_0x2546f7['count']:_0x1a466a['offset']+_0x1a466a[_0x1e8a('0x1e')];var _0x2a9e0e;if(_0x4d0e63>=_0x5aab0e){_0x4d0e63=_0x5aab0e;_0x2a9e0e=0xc8;}else{_0x2a9e0e=0xce;}_0x5dc0d3[_0x1e8a('0x18')](_0x2a9e0e);return _0x5dc0d3['set'](_0x1e8a('0x1f'),_0x54d6fc+'-'+_0x4d0e63+'/'+_0x5aab0e)['json'](_0x2546f7);}return null;};}function patchUpdates(_0x546f0e){return function(_0x4d7995){try{jsonpatch['apply'](_0x4d7995,_0x546f0e,!![]);}catch(_0x3fdb89){return BPromise[_0x1e8a('0x20')](_0x3fdb89);}return _0x4d7995['save']();};}function saveUpdates(_0xb957c7,_0x184d2b){return function(_0x84c223){if(_0x84c223){return _0x84c223[_0x1e8a('0x21')](_0xb957c7)[_0x1e8a('0x22')](function(_0x45a515){return _0x45a515;});}return null;};}function removeEntity(_0x4f9815,_0x1de545){return function(_0x52985e){if(_0x52985e){return _0x52985e[_0x1e8a('0x23')]()['then'](function(){var _0x57e70c=_0x52985e['get']({'plain':!![]});var _0xd4a087=_0x1e8a('0x24');return db[_0x1e8a('0x25')][_0x1e8a('0x23')]({'where':{'type':_0xd4a087,'resourceId':_0x57e70c['id']}})[_0x1e8a('0x22')](function(){return _0x52985e;});})[_0x1e8a('0x22')](function(){_0x4f9815[_0x1e8a('0x18')](0xcc)[_0x1e8a('0x19')]();});}};}function handleEntityNotFound(_0x1fa07b,_0x925562){return function(_0x3963ce){if(!_0x3963ce){_0x1fa07b[_0x1e8a('0x26')](0x194);}return _0x3963ce;};}function handleError(_0x5eea6c,_0x3ee751){_0x3ee751=_0x3ee751||0x1f4;return function(_0x235427){logger[_0x1e8a('0x27')](_0x235427[_0x1e8a('0x28')]);if(_0x235427[_0x1e8a('0x29')]){delete _0x235427[_0x1e8a('0x29')];}_0x5eea6c['status'](_0x3ee751)[_0x1e8a('0x2a')](_0x235427);};}exports[_0x1e8a('0x2b')]=function(_0x307dca,_0x33d056){var _0x2bd9a9={},_0x162611={},_0x514ed7={'count':0x0,'rows':[]};var _0xa3042e=_[_0x1e8a('0x2c')](db[_0x1e8a('0x2d')][_0x1e8a('0x2e')],function(_0x264d8f){return{'name':_0x264d8f['fieldName'],'type':_0x264d8f[_0x1e8a('0x2f')][_0x1e8a('0x30')]};});_0x162611[_0x1e8a('0x31')]=_[_0x1e8a('0x2c')](_0xa3042e,_0x1e8a('0x29'));_0x162611[_0x1e8a('0x32')]=_['keys'](_0x307dca[_0x1e8a('0x32')]);_0x162611[_0x1e8a('0x33')]=_[_0x1e8a('0x34')](_0x162611[_0x1e8a('0x31')],_0x162611['query']);_0x2bd9a9[_0x1e8a('0x35')]=_[_0x1e8a('0x34')](_0x162611[_0x1e8a('0x31')],qs[_0x1e8a('0x36')](_0x307dca[_0x1e8a('0x32')][_0x1e8a('0x36')]));_0x2bd9a9[_0x1e8a('0x35')]=_0x2bd9a9['attributes'][_0x1e8a('0x37')]?_0x2bd9a9['attributes']:_0x162611['model'];if(!_0x307dca['query']['hasOwnProperty'](_0x1e8a('0x38'))){_0x2bd9a9['limit']=qs[_0x1e8a('0x1e')](_0x307dca[_0x1e8a('0x32')][_0x1e8a('0x1e')]);_0x2bd9a9['offset']=qs['offset'](_0x307dca[_0x1e8a('0x32')][_0x1e8a('0x1b')]);}_0x2bd9a9['order']=qs[_0x1e8a('0x39')](_0x307dca[_0x1e8a('0x32')]['sort']);_0x2bd9a9[_0x1e8a('0x3a')]=qs[_0x1e8a('0x33')](_[_0x1e8a('0x3b')](_0x307dca['query'],_0x162611['filters']),_0xa3042e);if(_0x307dca[_0x1e8a('0x32')]['filter']){_0x2bd9a9[_0x1e8a('0x3a')]=_[_0x1e8a('0x3c')](_0x2bd9a9[_0x1e8a('0x3a')],{'$or':_[_0x1e8a('0x2c')](_0xa3042e,function(_0x257718){if(_0x257718[_0x1e8a('0x2f')]!==_0x1e8a('0x3d')){var _0xed3bee={};_0xed3bee[_0x257718[_0x1e8a('0x29')]]={'$like':'%'+_0x307dca[_0x1e8a('0x32')]['filter']+'%'};return _0xed3bee;}})});}_0x2bd9a9=_[_0x1e8a('0x3c')]({},_0x2bd9a9,_0x307dca[_0x1e8a('0x3e')]);var _0x98facc={'where':_0x2bd9a9[_0x1e8a('0x3a')]};return db[_0x1e8a('0x2d')][_0x1e8a('0x1d')](_0x98facc)[_0x1e8a('0x22')](function(_0x77cdc2){_0x514ed7[_0x1e8a('0x1d')]=_0x77cdc2;if(_0x307dca[_0x1e8a('0x32')][_0x1e8a('0x3f')]){_0x2bd9a9[_0x1e8a('0x40')]=[{'all':!![]}];}return db[_0x1e8a('0x2d')][_0x1e8a('0x41')](_0x2bd9a9);})['then'](function(_0x198d1f){_0x514ed7[_0x1e8a('0x42')]=_0x198d1f;return _0x514ed7;})[_0x1e8a('0x22')](respondWithFilteredResult(_0x33d056,_0x2bd9a9))[_0x1e8a('0x43')](handleError(_0x33d056,null));};exports[_0x1e8a('0x44')]=function(_0x22c709,_0x4a9a14){var _0x22c600={'raw':![],'where':{'id':_0x22c709[_0x1e8a('0x45')]['id']}},_0x1fbf0a={};_0x1fbf0a[_0x1e8a('0x31')]=_[_0x1e8a('0x46')](db[_0x1e8a('0x2d')][_0x1e8a('0x2e')]);_0x1fbf0a[_0x1e8a('0x32')]=_[_0x1e8a('0x46')](_0x22c709[_0x1e8a('0x32')]);_0x1fbf0a[_0x1e8a('0x33')]=_[_0x1e8a('0x34')](_0x1fbf0a[_0x1e8a('0x31')],_0x1fbf0a[_0x1e8a('0x32')]);_0x22c600['attributes']=_[_0x1e8a('0x34')](_0x1fbf0a[_0x1e8a('0x31')],qs['fields'](_0x22c709[_0x1e8a('0x32')][_0x1e8a('0x36')]));_0x22c600[_0x1e8a('0x35')]=_0x22c600['attributes'][_0x1e8a('0x37')]?_0x22c600[_0x1e8a('0x35')]:_0x1fbf0a[_0x1e8a('0x31')];if(_0x22c709[_0x1e8a('0x32')]['includeAll']){_0x22c600[_0x1e8a('0x40')]=[{'all':!![]}];}_0x22c600=_[_0x1e8a('0x3c')]({},_0x22c600,_0x22c709[_0x1e8a('0x3e')]);return db['AnalyticCustomReport'][_0x1e8a('0x47')](_0x22c600)[_0x1e8a('0x22')](handleEntityNotFound(_0x4a9a14,null))[_0x1e8a('0x22')](respondWithResult(_0x4a9a14,null))[_0x1e8a('0x43')](handleError(_0x4a9a14,null));};exports[_0x1e8a('0x48')]=function(_0x162e62,_0x32e243){return db[_0x1e8a('0x2d')][_0x1e8a('0x48')](_0x162e62[_0x1e8a('0x49')],{})[_0x1e8a('0x22')](function(_0x270eb8){var _0x219fec=_0x162e62[_0x1e8a('0x4a')][_0x1e8a('0x4b')]({'plain':!![]});if(!_0x219fec)throw new Error(_0x1e8a('0x4c'));if(_0x219fec['role']==='user'){var _0xe774f1=_0x270eb8['get']({'plain':!![]});var _0x2c825b=_0x1e8a('0x4d');return db['UserProfileSection'][_0x1e8a('0x47')]({'where':{'name':_0x2c825b,'userProfileId':_0x219fec[_0x1e8a('0x4e')]},'raw':!![]})[_0x1e8a('0x22')](function(_0x2ece68){if(_0x2ece68&&_0x2ece68[_0x1e8a('0x4f')]===0x0){return db[_0x1e8a('0x25')][_0x1e8a('0x48')]({'name':_0xe774f1[_0x1e8a('0x29')],'resourceId':_0xe774f1['id'],'type':_0x1e8a('0x24'),'sectionId':_0x2ece68['id']},{})[_0x1e8a('0x22')](function(){return _0x270eb8;});}else{return _0x270eb8;}})['catch'](function(_0x55cad5){logger[_0x1e8a('0x27')](_0x1e8a('0x50'),_0x55cad5);throw _0x55cad5;});}return _0x270eb8;})['then'](respondWithResult(_0x32e243,0xc9))[_0x1e8a('0x43')](handleError(_0x32e243,null));};exports[_0x1e8a('0x21')]=function(_0x70c6e5,_0x25106f){if(_0x70c6e5[_0x1e8a('0x49')]['id']){delete _0x70c6e5[_0x1e8a('0x49')]['id'];}return db[_0x1e8a('0x2d')]['find']({'where':{'id':_0x70c6e5[_0x1e8a('0x45')]['id']}})[_0x1e8a('0x22')](handleEntityNotFound(_0x25106f,null))[_0x1e8a('0x22')](saveUpdates(_0x70c6e5['body'],null))[_0x1e8a('0x22')](respondWithResult(_0x25106f,null))[_0x1e8a('0x43')](handleError(_0x25106f,null));};exports[_0x1e8a('0x23')]=function(_0x1a1b97,_0x4d2235){return db[_0x1e8a('0x2d')][_0x1e8a('0x47')]({'where':{'id':_0x1a1b97['params']['id']}})['then'](handleEntityNotFound(_0x4d2235,null))['then'](removeEntity(_0x4d2235,null))['catch'](handleError(_0x4d2235,null));};exports['preview']=function(_0x3f4e0d,_0x3f4a2c){var _0x50cc55=0xa;var _0x6dd56d=[_0x1e8a('0x51'),_0x1e8a('0x52'),_0x1e8a('0x53'),_0x1e8a('0x54')];var _0x34656a={'SUM':_0x1e8a('0x55'),'COUNT':_0x1e8a('0x56'),'COUNT DISTINCT':_0x1e8a('0x57'),'MAX':_0x1e8a('0x58'),'MIN':_0x1e8a('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1e8a('0x5a'),'GROUP_CONCAT ASC':_0x1e8a('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x304ec9={'SEC_TO_TIME':_0x1e8a('0x5c'),'DATE':_0x1e8a('0x5d'),'HOUR':_0x1e8a('0x5e'),'ROUND':_0x1e8a('0x5f'),'UNIX_TIMESTAMP':_0x1e8a('0x60')};var _0x439e46=function(_0x142baf){return!_[_0x1e8a('0x61')]([_0x1e8a('0x62'),'IS\x20NOT\x20NULL',_0x1e8a('0x63'),_0x1e8a('0x64')],_0x142baf);};var _0x4dc35b=function(_0x396e69){if(!_0x396e69||!_0x396e69[_0x1e8a('0x65')][_0x1e8a('0x37')]){return'';}for(var _0x15f2ab='(',_0x5a3d3a=0x0;_0x5a3d3a<_0x396e69[_0x1e8a('0x65')]['length'];_0x5a3d3a+=0x1){_0x5a3d3a>0x0&&(_0x15f2ab+='\x20'+_0x396e69[_0x1e8a('0x66')]+'\x20');_0x15f2ab+=_0x396e69['rules'][_0x5a3d3a][_0x1e8a('0x67')]?_0x4dc35b(_0x396e69[_0x1e8a('0x65')][_0x5a3d3a][_0x1e8a('0x67')]):_0x396e69['rules'][_0x5a3d3a]['field']+'\x20'+_0x396e69[_0x1e8a('0x65')][_0x5a3d3a][_0x1e8a('0x68')]+(_0x439e46(_0x396e69[_0x1e8a('0x65')][_0x5a3d3a][_0x1e8a('0x68')])?'\x20'+_0x396e69[_0x1e8a('0x65')][_0x5a3d3a][_0x1e8a('0x69')]:'');}return _0x15f2ab+')';};var _0x26c238={'where':{'id':_0x3f4e0d['params']['id']}},_0x59d62a,_0xf48a10,_0x50411e,_0xf8c3ba,_0x40e5cd;_0x26c238=_['merge']({},_0x26c238,_0x3f4e0d[_0x1e8a('0x3e')]);return db['AnalyticCustomReport'][_0x1e8a('0x47')](_0x26c238)[_0x1e8a('0x22')](function(_0x5deed9){if(_0x5deed9){_0x59d62a=_0x5deed9;return _0x5deed9[_0x1e8a('0x6a')]();}return null;})[_0x1e8a('0x22')](function(_0x4b6feb){if(_0x4b6feb){if(!_0x4b6feb['length']){throw new db[(_0x1e8a('0x6b'))][(_0x1e8a('0x6c'))](_0x1e8a('0x6d'),0x193);}_0xf48a10=_0x4b6feb;return db['AnalyticMetric'][_0x1e8a('0x41')]({'raw':!![]});}return null;})[_0x1e8a('0x22')](function(_0x463f83){if(_0x463f83){_0x50411e=_['keyBy'](_0x463f83,'id');var _0x28a29a;var _0x216c32=squel[_0x1e8a('0x6e')]();_0x216c32[_0x1e8a('0x6f')](_0x59d62a[_0x1e8a('0x70')]);for(var _0x59fb72=0x0;_0x59fb72<_0xf48a10['length'];_0x59fb72+=0x1){_0x28a29a=_0xf48a10[_0x59fb72][_0x1e8a('0x71')]?_0x50411e[_0xf48a10[_0x59fb72][_0x1e8a('0x71')]][_0x1e8a('0x72')]:_0xf48a10[_0x59fb72][_0x1e8a('0x73')];_0x28a29a=_0xf48a10[_0x59fb72][_0x1e8a('0x74')]?_[_0x1e8a('0x75')](_0x34656a[_0xf48a10[_0x59fb72][_0x1e8a('0x74')]],'%s',_0x28a29a):_0x28a29a;_0x28a29a=_0xf48a10[_0x59fb72]['format']?_[_0x1e8a('0x75')](_0x304ec9[_0xf48a10[_0x59fb72]['format']],'%s',_0x28a29a):_0x28a29a;if(_0xf48a10[_0x59fb72][_0x1e8a('0x76')]){_0x216c32[_0x1e8a('0x67')](_0x28a29a);}_0xf48a10[_0x59fb72]['orderBy']&&_0x216c32[_0x1e8a('0x77')](_0x28a29a,_0xf48a10[_0x59fb72][_0x1e8a('0x78')]===_0x1e8a('0x79')?![]:!![]);_0x216c32[_0x1e8a('0x73')](_0x28a29a,_0xf48a10[_0x59fb72][_0x1e8a('0x7a')]||_0x28a29a);}if(_0x59d62a[_0x1e8a('0x7b')]){_0x59d62a['joins']=JSON[_0x1e8a('0x7c')](_0x59d62a[_0x1e8a('0x7b')]);for(var _0x349deb=0x0;_0x349deb<_0x59d62a[_0x1e8a('0x7b')]['length'];_0x349deb+=0x1){if(_0x59d62a[_0x1e8a('0x7b')][_0x349deb]['type']&&_[_0x1e8a('0x61')](_0x6dd56d,_0x59d62a[_0x1e8a('0x7b')][_0x349deb][_0x1e8a('0x2f')])&&_0x59d62a['joins'][_0x349deb][_0x1e8a('0x7d')]&&_0x59d62a[_0x1e8a('0x7b')][_0x349deb][_0x1e8a('0x7e')]&&_0x59d62a[_0x1e8a('0x7b')][_0x349deb][_0x1e8a('0x7f')]){_0x216c32[_0x59d62a[_0x1e8a('0x7b')][_0x349deb][_0x1e8a('0x2f')]](_0x59d62a[_0x1e8a('0x7b')][_0x349deb][_0x1e8a('0x7e')],null,util[_0x1e8a('0x80')](_0x1e8a('0x81'),_0x59d62a['table'],_0x59d62a[_0x1e8a('0x7b')][_0x349deb]['parentKey'],_0x59d62a[_0x1e8a('0x7b')][_0x349deb][_0x1e8a('0x7e')],_0x59d62a[_0x1e8a('0x7b')][_0x349deb]['foreignKey']));}}}if(_0x59d62a['conditions']){_0x59d62a[_0x1e8a('0x82')]=JSON[_0x1e8a('0x7c')](_0x59d62a[_0x1e8a('0x82')]);_0x216c32[_0x1e8a('0x3a')](_0x4dc35b(_0x59d62a['conditions'][_0x1e8a('0x67')]));}_0x40e5cd=_0x216c32[_0x1e8a('0x83')]();_0x216c32[_0x1e8a('0x1e')](_0x50cc55);_0x216c32[_0x1e8a('0x1b')](0x0);logger['debug'](_0x1e8a('0x84'),_0x216c32['toString']());return dbH[_0x1e8a('0x85')][_0x1e8a('0x32')](_0x216c32[_0x1e8a('0x86')](),{'type':dbH[_0x1e8a('0x85')][_0x1e8a('0x87')][_0x1e8a('0x88')]});}})[_0x1e8a('0x22')](respondWithResult(_0x3f4a2c,null))['catch'](handleError(_0x3f4a2c,null));};function runReport(_0x339271,_0x3d773c,_0x4c42f6){var _0x18dff7=_0x3d773c['name'];var _0x3654af=0xa;var _0x16a7f6=[_0x1e8a('0x51'),_0x1e8a('0x52'),_0x1e8a('0x53'),_0x1e8a('0x54')];var _0x1ab659={'SUM':_0x1e8a('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1e8a('0x58'),'MIN':_0x1e8a('0x59'),'AVG':_0x1e8a('0x89'),'GROUP_CONCAT':_0x1e8a('0x5a'),'GROUP_CONCAT ASC':_0x1e8a('0x5b'),'GROUP_CONCAT DESC':_0x1e8a('0x8a')};var _0x3e3a25={'SEC_TO_TIME':_0x1e8a('0x5c'),'DATE':_0x1e8a('0x5d'),'HOUR':_0x1e8a('0x5e'),'ROUND':_0x1e8a('0x5f'),'UNIX_TIMESTAMP':_0x1e8a('0x60')};var _0x7e6620=function(_0x17fed3){return!_['includes'](['IS\x20NULL',_0x1e8a('0x8b'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x17fed3);};var _0x4bcf58=function(_0x3fec7d){if(!_0x3fec7d||!_0x3fec7d[_0x1e8a('0x65')]['length']){return'';}for(var _0x144941='(',_0x4b6f15=0x0;_0x4b6f15<_0x3fec7d['rules'][_0x1e8a('0x37')];_0x4b6f15+=0x1){_0x4b6f15>0x0&&(_0x144941+='\x20'+_0x3fec7d[_0x1e8a('0x66')]+'\x20');_0x144941+=_0x3fec7d[_0x1e8a('0x65')][_0x4b6f15][_0x1e8a('0x67')]?_0x4bcf58(_0x3fec7d[_0x1e8a('0x65')][_0x4b6f15][_0x1e8a('0x67')]):_0x3fec7d[_0x1e8a('0x65')][_0x4b6f15][_0x1e8a('0x73')]+'\x20'+_0x3fec7d[_0x1e8a('0x65')][_0x4b6f15][_0x1e8a('0x68')]+(_0x7e6620(_0x3fec7d['rules'][_0x4b6f15][_0x1e8a('0x68')])?'\x20'+_0x3fec7d['rules'][_0x4b6f15]['value']:'');}return _0x144941+')';};var _0x1052ad={'where':{'id':_0x339271['id']}},_0x99724e,_0x131f9f,_0x1485b7,_0x2074b8,_0x167d20;_0x1052ad=_[_0x1e8a('0x3c')]({},_0x1052ad,_0x4c42f6);return db[_0x1e8a('0x2d')][_0x1e8a('0x47')](_0x1052ad)[_0x1e8a('0x22')](function(_0x5575a7){if(_0x5575a7){_0x99724e=_0x5575a7;return _0x5575a7[_0x1e8a('0x6a')]();}return null;})[_0x1e8a('0x22')](function(_0x414050){if(_0x414050){if(!_0x414050[_0x1e8a('0x37')]){throw new db[(_0x1e8a('0x6b'))][(_0x1e8a('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x131f9f=_0x414050;return db[_0x1e8a('0x8c')]['findAll']({'raw':!![]});}return null;})[_0x1e8a('0x22')](function(_0x470d41){if(_0x470d41){_0x1485b7=_[_0x1e8a('0x8d')](_0x470d41,'id');var _0x350eb4;var _0x461d1d=squel['select']();_0x461d1d['from'](_0x99724e[_0x1e8a('0x70')]);for(var _0x3c2f3a=0x0;_0x3c2f3a<_0x131f9f['length'];_0x3c2f3a+=0x1){_0x350eb4=_0x131f9f[_0x3c2f3a]['MetricId']?_0x1485b7[_0x131f9f[_0x3c2f3a][_0x1e8a('0x71')]]['metric']:_0x131f9f[_0x3c2f3a][_0x1e8a('0x73')];_0x350eb4=_0x131f9f[_0x3c2f3a][_0x1e8a('0x74')]?_[_0x1e8a('0x75')](_0x1ab659[_0x131f9f[_0x3c2f3a][_0x1e8a('0x74')]],'%s',_0x350eb4):_0x350eb4;_0x350eb4=_0x131f9f[_0x3c2f3a][_0x1e8a('0x80')]?_[_0x1e8a('0x75')](_0x3e3a25[_0x131f9f[_0x3c2f3a]['format']],'%s',_0x350eb4):_0x350eb4;if(_0x131f9f[_0x3c2f3a][_0x1e8a('0x76')]){_0x461d1d[_0x1e8a('0x67')](_0x350eb4);}_0x131f9f[_0x3c2f3a][_0x1e8a('0x78')]&&_0x461d1d[_0x1e8a('0x77')](_0x350eb4,_0x131f9f[_0x3c2f3a][_0x1e8a('0x78')]===_0x1e8a('0x79')?![]:!![]);_0x461d1d[_0x1e8a('0x73')](_0x350eb4,_0x131f9f[_0x3c2f3a][_0x1e8a('0x7a')]||_0x350eb4);}if(_0x99724e[_0x1e8a('0x7b')]){_0x99724e['joins']=JSON[_0x1e8a('0x7c')](_0x99724e[_0x1e8a('0x7b')]);for(var _0x456976=0x0;_0x456976<_0x99724e['joins'][_0x1e8a('0x37')];_0x456976+=0x1){if(_0x99724e['joins'][_0x456976][_0x1e8a('0x2f')]&&_['includes'](_0x16a7f6,_0x99724e[_0x1e8a('0x7b')][_0x456976][_0x1e8a('0x2f')])&&_0x99724e[_0x1e8a('0x7b')][_0x456976]['parentKey']&&_0x99724e[_0x1e8a('0x7b')][_0x456976][_0x1e8a('0x7e')]&&_0x99724e['joins'][_0x456976][_0x1e8a('0x7f')]){_0x461d1d[_0x99724e['joins'][_0x456976][_0x1e8a('0x2f')]](_0x99724e[_0x1e8a('0x7b')][_0x456976][_0x1e8a('0x7e')],null,util[_0x1e8a('0x80')](_0x1e8a('0x81'),_0x99724e[_0x1e8a('0x70')],_0x99724e[_0x1e8a('0x7b')][_0x456976][_0x1e8a('0x7d')],_0x99724e[_0x1e8a('0x7b')][_0x456976][_0x1e8a('0x7e')],_0x99724e[_0x1e8a('0x7b')][_0x456976][_0x1e8a('0x7f')]));}}}if(_0x99724e[_0x1e8a('0x82')]){_0x99724e[_0x1e8a('0x82')]=JSON['parse'](_0x99724e[_0x1e8a('0x82')]);_0x461d1d[_0x1e8a('0x3a')](_0x4bcf58(_0x99724e[_0x1e8a('0x82')][_0x1e8a('0x67')]));}_0x167d20=_0x461d1d[_0x1e8a('0x83')]();_0x461d1d[_0x1e8a('0x1e')](_0x3654af);_0x461d1d[_0x1e8a('0x1b')](0x0);return;}})[_0x1e8a('0x22')](function(){if(_0x3d773c[_0x1e8a('0x8e')]==='web'){return null;}var _0x11756d=_[_0x1e8a('0x3c')](_0x3d773c,{'name':_0x3d773c[_0x1e8a('0x8f')]||_0x3d773c[_0x1e8a('0x29')]||_0x99724e[_0x1e8a('0x29')],'basename':_0x18dff7,'savename':util[_0x1e8a('0x80')]('%s-%s.%s',_0x3d773c['name']||_0x99724e[_0x1e8a('0x29')],require(_0x1e8a('0x90'))[_0x1e8a('0x91')](0x4),_0x3d773c[_0x1e8a('0x8e')]||_0x1e8a('0x92')),'reportId':_0x99724e['id'],'reportType':_0x1e8a('0x93')});return db[_0x1e8a('0x94')][_0x1e8a('0x48')](_0x11756d,{'raw':!![]});})[_0x1e8a('0x22')](function(_0x3729ec){if(_0x99724e[_0x1e8a('0x70')]===_0x1e8a('0x95')){_0x167d20[_0x1e8a('0x3a')](_0x99724e[_0x1e8a('0x70')]+_0x1e8a('0x96'),_0x3d773c[_0x1e8a('0x97')],_0x3d773c[_0x1e8a('0x98')]);}else{_0x167d20[_0x1e8a('0x3a')](_0x99724e[_0x1e8a('0x70')]+_0x1e8a('0x99'),_0x3d773c[_0x1e8a('0x97')],_0x3d773c[_0x1e8a('0x98')]);}if(_0x3729ec){logger['info'](_0x1e8a('0x9a'),_0x167d20[_0x1e8a('0x86')]());require('child_process')[_0x1e8a('0x9b')](path[_0x1e8a('0x51')](__dirname,_0x1e8a('0x9c'),_0x3729ec[_0x1e8a('0x8e')]),[_0x3729ec['id'],_0x167d20[_0x1e8a('0x86')](),path[_0x1e8a('0x51')](__dirname,'../../files/reports',_0x3729ec['savename']),_0x18dff7]);return _0x3729ec;}else{var _0x18e215=squel[_0x1e8a('0x6e')]();_0x18e215['from']('('+_0x167d20['toString']()+')',_0x1e8a('0x9d'));_0x18e215[_0x1e8a('0x73')](_0x1e8a('0x9e'),'count');_0x167d20['limit'](_0x3d773c[_0x1e8a('0x1e')]||_0x3654af);_0x167d20[_0x1e8a('0x1b')](_0x3d773c[_0x1e8a('0x1b')]||0x0);return dbH['sequelize'][_0x1e8a('0x32')](_0x18e215[_0x1e8a('0x86')](),{'type':dbH[_0x1e8a('0x85')][_0x1e8a('0x87')][_0x1e8a('0x88')]})[_0x1e8a('0x22')](function(_0x435847){if(!_0x435847[_0x1e8a('0x37')]){_0x2074b8=0x0;}else{_0x2074b8=_0x435847[0x0][_0x1e8a('0x1d')]||0x0;}return dbH['sequelize'][_0x1e8a('0x32')](_0x167d20['toString'](),{'type':dbH[_0x1e8a('0x85')][_0x1e8a('0x87')][_0x1e8a('0x88')]});})[_0x1e8a('0x22')](function(_0x2a25e1){return{'rows':_0x2a25e1||[],'count':_0x2074b8};});}});}exports[_0x1e8a('0x9f')]=function(_0xcf4992,_0x52c5e3){return runReport(_0xcf4992[_0x1e8a('0x45')],_0xcf4992[_0x1e8a('0x32')],_0xcf4992['options'])[_0x1e8a('0x22')](respondWithResult(_0x52c5e3,null))[_0x1e8a('0x43')](handleError(_0x52c5e3,null));};exports[_0x1e8a('0xa0')]=runReport;exports[_0x1e8a('0x32')]=function(_0x5a5ac5,_0x390e8f){var _0x165a27=0xa;var _0x3c9cf4=[_0x1e8a('0x51'),_0x1e8a('0x52'),_0x1e8a('0x53'),_0x1e8a('0x54')];var _0x409c02={'SUM':_0x1e8a('0x55'),'COUNT':_0x1e8a('0x56'),'COUNT DISTINCT':_0x1e8a('0x57'),'MAX':'MAX(%s)','MIN':_0x1e8a('0x59'),'AVG':_0x1e8a('0x89'),'GROUP_CONCAT':_0x1e8a('0x5a'),'GROUP_CONCAT ASC':_0x1e8a('0x5b'),'GROUP_CONCAT DESC':_0x1e8a('0x8a')};var _0x3362c4={'SEC_TO_TIME':_0x1e8a('0x5c'),'DATE':_0x1e8a('0x5d'),'HOUR':_0x1e8a('0x5e'),'ROUND':_0x1e8a('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45acee=function(_0x2ff9a9){return!_[_0x1e8a('0x61')](['IS\x20NULL',_0x1e8a('0x8b'),_0x1e8a('0x63'),'IS\x20NOT\x20EMPTY'],_0x2ff9a9);};var _0xee3c=function(_0x498c51){if(!_0x498c51||!_0x498c51[_0x1e8a('0x65')][_0x1e8a('0x37')]){return'';}for(var _0x3539b7='(',_0x259e77=0x0;_0x259e77<_0x498c51['rules'][_0x1e8a('0x37')];_0x259e77+=0x1){_0x259e77>0x0&&(_0x3539b7+='\x20'+_0x498c51[_0x1e8a('0x66')]+'\x20');_0x3539b7+=_0x498c51[_0x1e8a('0x65')][_0x259e77][_0x1e8a('0x67')]?_0xee3c(_0x498c51[_0x1e8a('0x65')][_0x259e77]['group']):_0x498c51[_0x1e8a('0x65')][_0x259e77][_0x1e8a('0x73')]+'\x20'+_0x498c51[_0x1e8a('0x65')][_0x259e77][_0x1e8a('0x68')]+(_0x45acee(_0x498c51['rules'][_0x259e77][_0x1e8a('0x68')])?'\x20'+_0x498c51['rules'][_0x259e77][_0x1e8a('0x69')]:'');}return _0x3539b7+')';};var _0x5b736b={'where':{'id':_0x5a5ac5['params']['id']}},_0x37c405,_0x59f590,_0x198333,_0x34b541,_0x5a3da1;_0x5b736b=_['merge']({},_0x5b736b,_0x5a5ac5[_0x1e8a('0x3e')]);return db[_0x1e8a('0x2d')][_0x1e8a('0x47')](_0x5b736b)['then'](function(_0x3cb6f9){if(_0x3cb6f9){_0x37c405=_0x3cb6f9;return _0x3cb6f9[_0x1e8a('0x6a')]();}return null;})['then'](function(_0x3f3cfb){if(_0x3f3cfb){if(!_0x3f3cfb[_0x1e8a('0x37')]){throw new db[(_0x1e8a('0x6b'))][(_0x1e8a('0x6c'))](_0x1e8a('0x6d'),0x193);}_0x59f590=_0x3f3cfb;return db['AnalyticMetric'][_0x1e8a('0x41')]({'raw':!![]});}return null;})[_0x1e8a('0x22')](function(_0x17d7f2){if(_0x17d7f2){_0x198333=_[_0x1e8a('0x8d')](_0x17d7f2,'id');var _0x57317b;var _0x5bc22e=squel[_0x1e8a('0x6e')]();_0x5bc22e[_0x1e8a('0x6f')](_0x37c405[_0x1e8a('0x70')]);for(var _0x1ee05e=0x0;_0x1ee05e<_0x59f590[_0x1e8a('0x37')];_0x1ee05e+=0x1){_0x57317b=_0x59f590[_0x1ee05e][_0x1e8a('0x71')]?_0x198333[_0x59f590[_0x1ee05e]['MetricId']]['metric']:_0x59f590[_0x1ee05e][_0x1e8a('0x73')];_0x57317b=_0x59f590[_0x1ee05e]['function']?_[_0x1e8a('0x75')](_0x409c02[_0x59f590[_0x1ee05e][_0x1e8a('0x74')]],'%s',_0x57317b):_0x57317b;_0x57317b=_0x59f590[_0x1ee05e]['format']?_['replace'](_0x3362c4[_0x59f590[_0x1ee05e][_0x1e8a('0x80')]],'%s',_0x57317b):_0x57317b;if(_0x59f590[_0x1ee05e]['groupBy']){_0x5bc22e[_0x1e8a('0x67')](_0x57317b);}_0x59f590[_0x1ee05e][_0x1e8a('0x78')]&&_0x5bc22e['order'](_0x57317b,_0x59f590[_0x1ee05e]['orderBy']===_0x1e8a('0x79')?![]:!![]);_0x5bc22e['field'](_0x57317b,_0x59f590[_0x1ee05e]['alias']||_0x57317b);}if(_0x37c405[_0x1e8a('0x7b')]){_0x37c405[_0x1e8a('0x7b')]=JSON[_0x1e8a('0x7c')](_0x37c405[_0x1e8a('0x7b')]);for(var _0x36f5f7=0x0;_0x36f5f7<_0x37c405[_0x1e8a('0x7b')]['length'];_0x36f5f7+=0x1){if(_0x37c405['joins'][_0x36f5f7]['type']&&_[_0x1e8a('0x61')](_0x3c9cf4,_0x37c405[_0x1e8a('0x7b')][_0x36f5f7]['type'])&&_0x37c405[_0x1e8a('0x7b')][_0x36f5f7][_0x1e8a('0x7d')]&&_0x37c405[_0x1e8a('0x7b')][_0x36f5f7][_0x1e8a('0x7e')]&&_0x37c405['joins'][_0x36f5f7]['foreignKey']){_0x5bc22e[_0x37c405[_0x1e8a('0x7b')][_0x36f5f7]['type']](_0x37c405['joins'][_0x36f5f7][_0x1e8a('0x7e')],null,util[_0x1e8a('0x80')](_0x1e8a('0x81'),_0x37c405[_0x1e8a('0x70')],_0x37c405[_0x1e8a('0x7b')][_0x36f5f7][_0x1e8a('0x7d')],_0x37c405[_0x1e8a('0x7b')][_0x36f5f7][_0x1e8a('0x7e')],_0x37c405[_0x1e8a('0x7b')][_0x36f5f7][_0x1e8a('0x7f')]));}}}if(_0x37c405['conditions']){_0x37c405[_0x1e8a('0x82')]=JSON[_0x1e8a('0x7c')](_0x37c405[_0x1e8a('0x82')]);_0x5bc22e[_0x1e8a('0x3a')](_0xee3c(_0x37c405[_0x1e8a('0x82')][_0x1e8a('0x67')]));}_0x5a3da1=_0x5bc22e[_0x1e8a('0x83')]();_0x5bc22e['limit'](_0x165a27);_0x5bc22e[_0x1e8a('0x1b')](0x0);logger[_0x1e8a('0xa1')](_0x1e8a('0x84'),_0x5bc22e['toString']());return dbH['sequelize']['query'](_0x5bc22e[_0x1e8a('0x86')](),{'type':dbH[_0x1e8a('0x85')][_0x1e8a('0x87')][_0x1e8a('0x88')]});}})[_0x1e8a('0x22')](function(){return{'sql':_0x5a3da1[_0x1e8a('0x86')]()};})[_0x1e8a('0x22')](respondWithResult(_0x390e8f,null))['catch'](handleError(_0x390e8f,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 857b7cb..fb4b977 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 _0xbc52=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc52,0x19a));var _0x2bc5=function(_0xe4e224,_0x325438){_0xe4e224=_0xe4e224-0x0;var _0x32124b=_0xbc52[_0xe4e224];return _0x32124b;};'use strict';var _=require(_0x2bc5('0x0'));var util=require(_0x2bc5('0x1'));var logger=require(_0x2bc5('0x2'))(_0x2bc5('0x3'));var moment=require(_0x2bc5('0x4'));var BPromise=require(_0x2bc5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bc5('0x6'));var rimraf=require(_0x2bc5('0x7'));var config=require(_0x2bc5('0x8'));var attributes=require(_0x2bc5('0x9'));module[_0x2bc5('0xa')]=function(_0x1e2228,_0x33acb1){return _0x1e2228[_0x2bc5('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x2bc5('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb40=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','lodash','util','../../config/logger'];(function(_0x3b557e,_0x40c2b5){var _0x56c690=function(_0x3d991b){while(--_0x3d991b){_0x3b557e['push'](_0x3b557e['shift']());}};_0x56c690(++_0x40c2b5);}(_0xbb40,0x1e9));var _0x0bb4=function(_0x3cfe4c,_0x14a5bc){_0x3cfe4c=_0x3cfe4c-0x0;var _0x4f6f43=_0xbb40[_0x3cfe4c];return _0x4f6f43;};'use strict';var _=require(_0x0bb4('0x0'));var util=require(_0x0bb4('0x1'));var logger=require(_0x0bb4('0x2'))(_0x0bb4('0x3'));var moment=require(_0x0bb4('0x4'));var BPromise=require(_0x0bb4('0x5'));var rp=require(_0x0bb4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0bb4('0x7'));var config=require(_0x0bb4('0x8'));var attributes=require(_0x0bb4('0x9'));module[_0x0bb4('0xa')]=function(_0x3853ed,_0x105719){return _0x3853ed['define'](_0x0bb4('0xb'),attributes,{'tableName':'analytics_custom_reports','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 c9a60b2..e90a98c 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 _0x57f3=['http','request','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x43cc3b,_0x2f3963){var _0x44fe5e=function(_0x101a19){while(--_0x101a19){_0x43cc3b['push'](_0x43cc3b['shift']());}};_0x44fe5e(++_0x2f3963);}(_0x57f3,0x10f));var _0x357f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57f3[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x357f('0x0'));var moment=require(_0x357f('0x1'));var BPromise=require(_0x357f('0x2'));var rs=require(_0x357f('0x3'));var fs=require('fs');var Redis=require(_0x357f('0x4'));var db=require(_0x357f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x357f('0x6'))(_0x357f('0x7'));var config=require('../../config/environment');var jayson=require(_0x357f('0x8'));var client=jayson['client'][_0x357f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b889c,_0x534d27,_0x160291){return new BPromise(function(_0x283699,_0x2733a8){return client[_0x357f('0xa')](_0x4b889c,_0x160291)[_0x357f('0xb')](function(_0x38aa54){logger[_0x357f('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x534d27,_0x357f('0xd'));logger[_0x357f('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x534d27,_0x357f('0xd'),JSON[_0x357f('0xf')](_0x38aa54));if(_0x38aa54[_0x357f('0x10')]){if(_0x38aa54['error'][_0x357f('0x11')]===0x1f4){logger[_0x357f('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x534d27,_0x38aa54[_0x357f('0x10')][_0x357f('0x12')]);return _0x2733a8(_0x38aa54[_0x357f('0x10')][_0x357f('0x12')]);}logger[_0x357f('0x10')](_0x357f('0x13'),_0x534d27,_0x38aa54[_0x357f('0x10')][_0x357f('0x12')]);return _0x283699(_0x38aa54[_0x357f('0x10')]['message']);}else{logger[_0x357f('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x534d27,_0x357f('0xd'));_0x283699(_0x38aa54['result'][_0x357f('0x12')]);}})['catch'](function(_0x158563){logger[_0x357f('0x10')](_0x357f('0x13'),_0x534d27,_0x158563);_0x2733a8(_0x158563);});});} \ No newline at end of file +var _0x62d0=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xded36,_0x1462cb){var _0x39e06c=function(_0x3068dc){while(--_0x3068dc){_0xded36['push'](_0xded36['shift']());}};_0x39e06c(++_0x1462cb);}(_0x62d0,0xdc));var _0x062d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x62d0[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x062d('0x0'));var util=require(_0x062d('0x1'));var moment=require(_0x062d('0x2'));var BPromise=require(_0x062d('0x3'));var rs=require(_0x062d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x062d('0x5'));var logger=require(_0x062d('0x6'))(_0x062d('0x7'));var config=require(_0x062d('0x8'));var jayson=require(_0x062d('0x9'));var client=jayson[_0x062d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c4fe0,_0x280afe,_0x297157){return new BPromise(function(_0x5b86ef,_0x55860d){return client[_0x062d('0xb')](_0x4c4fe0,_0x297157)[_0x062d('0xc')](function(_0x168b48){logger[_0x062d('0xd')](_0x062d('0xe'),_0x280afe,_0x062d('0xf'));logger[_0x062d('0x10')](_0x062d('0x11'),_0x280afe,_0x062d('0xf'),JSON[_0x062d('0x12')](_0x168b48));if(_0x168b48[_0x062d('0x13')]){if(_0x168b48[_0x062d('0x13')][_0x062d('0x14')]===0x1f4){logger['error'](_0x062d('0xe'),_0x280afe,_0x168b48[_0x062d('0x13')][_0x062d('0x15')]);return _0x55860d(_0x168b48['error'][_0x062d('0x15')]);}logger['error'](_0x062d('0xe'),_0x280afe,_0x168b48[_0x062d('0x13')]['message']);return _0x5b86ef(_0x168b48[_0x062d('0x13')][_0x062d('0x15')]);}else{logger[_0x062d('0xd')](_0x062d('0xe'),_0x280afe,_0x062d('0xf'));_0x5b86ef(_0x168b48[_0x062d('0x16')][_0x062d('0x15')]);}})[_0x062d('0x17')](function(_0x256296){logger[_0x062d('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x280afe,_0x256296);_0x55860d(_0x256296);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 99fed1c..f52c1ef 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 _0xde80=['/:id/query','query','post','create','/:id','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xde80,0xf8));var _0x0de8=function(_0x3588c3,_0x5e4eed){_0x3588c3=_0x3588c3-0x0;var _0x96d818=_0xde80[_0x3588c3];return _0x96d818;};'use strict';var multer=require('multer');var util=require(_0x0de8('0x0'));var path=require('path');var timeout=require(_0x0de8('0x1'));var express=require(_0x0de8('0x2'));var router=express[_0x0de8('0x3')]();var fs_extra=require(_0x0de8('0x4'));var auth=require(_0x0de8('0x5'));var interaction=require(_0x0de8('0x6'));var config=require('../../config/environment');var controller=require(_0x0de8('0x7'));router[_0x0de8('0x8')]('/',auth[_0x0de8('0x9')](),controller[_0x0de8('0xa')]);router[_0x0de8('0x8')]('/:id',auth[_0x0de8('0x9')](),controller[_0x0de8('0xb')]);router[_0x0de8('0x8')](_0x0de8('0xc'),auth[_0x0de8('0x9')](),controller[_0x0de8('0xd')]);router['get'](_0x0de8('0xe'),auth[_0x0de8('0x9')](),controller[_0x0de8('0xf')]);router[_0x0de8('0x8')](_0x0de8('0x10'),auth[_0x0de8('0x9')](),controller[_0x0de8('0x11')]);router[_0x0de8('0x12')]('/',auth[_0x0de8('0x9')](),controller[_0x0de8('0x13')]);router['put'](_0x0de8('0x14'),auth[_0x0de8('0x9')](),controller[_0x0de8('0x15')]);router[_0x0de8('0x16')]('/:id',auth[_0x0de8('0x9')](),controller[_0x0de8('0x17')]);module['exports']=router; \ No newline at end of file +var _0x3d03=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','put','update','delete','destroy','exports','util'];(function(_0x1e3d6e,_0x487503){var _0x52b481=function(_0x11edfe){while(--_0x11edfe){_0x1e3d6e['push'](_0x1e3d6e['shift']());}};_0x52b481(++_0x487503);}(_0x3d03,0x17f));var _0x33d0=function(_0x5d0e5c,_0x1eb95f){_0x5d0e5c=_0x5d0e5c-0x0;var _0x2c4bd4=_0x3d03[_0x5d0e5c];return _0x2c4bd4;};'use strict';var multer=require('multer');var util=require(_0x33d0('0x0'));var path=require(_0x33d0('0x1'));var timeout=require(_0x33d0('0x2'));var express=require(_0x33d0('0x3'));var router=express['Router']();var fs_extra=require(_0x33d0('0x4'));var auth=require(_0x33d0('0x5'));var interaction=require(_0x33d0('0x6'));var config=require(_0x33d0('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x33d0('0x8')]('/',auth[_0x33d0('0x9')](),controller[_0x33d0('0xa')]);router[_0x33d0('0x8')](_0x33d0('0xb'),auth[_0x33d0('0x9')](),controller[_0x33d0('0xc')]);router[_0x33d0('0x8')](_0x33d0('0xd'),auth['isAuthenticated'](),controller[_0x33d0('0xe')]);router[_0x33d0('0x8')](_0x33d0('0xf'),auth[_0x33d0('0x9')](),controller[_0x33d0('0x10')]);router['get']('/:id/query',auth[_0x33d0('0x9')](),controller[_0x33d0('0x11')]);router[_0x33d0('0x12')]('/',auth[_0x33d0('0x9')](),controller['create']);router[_0x33d0('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x33d0('0x14')]);router[_0x33d0('0x15')](_0x33d0('0xb'),auth[_0x33d0('0x9')](),controller[_0x33d0('0x16')]);module[_0x33d0('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index feb7ddc..dc126e9 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 _0x6aa7=['TEXT','sequelize','STRING'];(function(_0x30a193,_0x158ad6){var _0x5d6ccd=function(_0xaf5a46){while(--_0xaf5a46){_0x30a193['push'](_0x30a193['shift']());}};_0x5d6ccd(++_0x158ad6);}(_0x6aa7,0x178));var _0x76aa=function(_0x7bdba0,_0x6a7eca){_0x7bdba0=_0x7bdba0-0x0;var _0xe6232d=_0x6aa7[_0x7bdba0];return _0xe6232d;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x76aa('0x1')]},'parent':{'type':Sequelize[_0x76aa('0x1')]},'table':{'type':Sequelize[_0x76aa('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x76aa('0x2')]}}; \ No newline at end of file +var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x5d4db8,_0x4ad01b){var _0x415548=function(_0x7ae456){while(--_0x7ae456){_0x5d4db8['push'](_0x5d4db8['shift']());}};_0x415548(++_0x4ad01b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0xf2ca[_0x1ff2ec];return _0x405683;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index eef8650..a3d0552 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x20f61b,_0x3363a5){var _0x33a9fd=function(_0x4eb80c){while(--_0x4eb80c){_0x20f61b['push'](_0x20f61b['shift']());}};_0x33a9fd(++_0x3363a5);}(_0xba34,0x119));var _0x4ba3=function(_0x3e5744,_0x1e8008){_0x3e5744=_0x3e5744-0x0;var _0x3d242e=_0xba34[_0x3e5744];return _0x3d242e;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file +var _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','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','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x5a8e88,_0x513cab){var _0x2132d2=function(_0x138459){while(--_0x138459){_0x5a8e88['push'](_0x5a8e88['shift']());}};_0x2132d2(++_0x513cab);}(_0x46ed,0x168));var _0xd46e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x46ed[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 7f42f1e..b7543b3 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 _0xd494=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd494,0xfa));var _0x4d49=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd494[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4d49('0x0'))(_0x4d49('0x1'));var moment=require(_0x4d49('0x2'));var BPromise=require(_0x4d49('0x3'));var rp=require(_0x4d49('0x4'));var fs=require('fs');var path=require(_0x4d49('0x5'));var rimraf=require(_0x4d49('0x6'));var config=require(_0x4d49('0x7'));var attributes=require(_0x4d49('0x8'));module['exports']=function(_0x24027c,_0x5046f9){return _0x24027c[_0x4d49('0x9')](_0x4d49('0xa'),attributes,{'tableName':_0x4d49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd290=['exports','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x3d078a,_0x28ee11){var _0x390a12=function(_0x1bdd3d){while(--_0x1bdd3d){_0x3d078a['push'](_0x3d078a['shift']());}};_0x390a12(++_0x28ee11);}(_0xd290,0x1a8));var _0x0d29=function(_0x5b14d7,_0x10b373){_0x5b14d7=_0x5b14d7-0x0;var _0x1eb341=_0xd290[_0x5b14d7];return _0x1eb341;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var logger=require(_0x0d29('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0d29('0x3'));var fs=require('fs');var path=require(_0x0d29('0x4'));var rimraf=require(_0x0d29('0x5'));var config=require(_0x0d29('0x6'));var attributes=require(_0x0d29('0x7'));module[_0x0d29('0x8')]=function(_0x27e2ac,_0x4a1168){return _0x27e2ac['define']('AnalyticDefaultReport',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 6bc772f..f77ac8f 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 _0xcedc=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','randomstring','ioredis','../../mysqldb','rpc'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcedc,0x19d));var _0xcced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcedc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcced('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcced('0x1'));var fs=require('fs');var Redis=require(_0xcced('0x2'));var db=require(_0xcced('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcced('0x4'));var config=require(_0xcced('0x5'));var jayson=require(_0xcced('0x6'));var client=jayson[_0xcced('0x7')][_0xcced('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55ca73,_0x17c3ce,_0x3ef92a){return new BPromise(function(_0x479cd8,_0x36e0ce){return client[_0xcced('0x9')](_0x55ca73,_0x3ef92a)[_0xcced('0xa')](function(_0x3823a1){logger[_0xcced('0xb')](_0xcced('0xc'),_0x17c3ce,'request\x20sent');logger[_0xcced('0xd')](_0xcced('0xe'),_0x17c3ce,'request\x20sent',JSON[_0xcced('0xf')](_0x3823a1));if(_0x3823a1[_0xcced('0x10')]){if(_0x3823a1[_0xcced('0x10')][_0xcced('0x11')]===0x1f4){logger[_0xcced('0x10')](_0xcced('0xc'),_0x17c3ce,_0x3823a1[_0xcced('0x10')][_0xcced('0x12')]);return _0x36e0ce(_0x3823a1['error'][_0xcced('0x12')]);}logger[_0xcced('0x10')](_0xcced('0xc'),_0x17c3ce,_0x3823a1['error'][_0xcced('0x12')]);return _0x479cd8(_0x3823a1[_0xcced('0x10')][_0xcced('0x12')]);}else{logger[_0xcced('0xb')](_0xcced('0xc'),_0x17c3ce,_0xcced('0x13'));_0x479cd8(_0x3823a1[_0xcced('0x14')][_0xcced('0x12')]);}})[_0xcced('0x15')](function(_0x436d42){logger[_0xcced('0x10')](_0xcced('0xc'),_0x17c3ce,_0x436d42);_0x36e0ce(_0x436d42);});});} \ No newline at end of file +var _0xcf91=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x113388,_0x15e949){var _0x312b39=function(_0x234ec5){while(--_0x234ec5){_0x113388['push'](_0x113388['shift']());}};_0x312b39(++_0x15e949);}(_0xcf91,0x193));var _0x1cf9=function(_0xc5926f,_0x4c3d57){_0xc5926f=_0xc5926f-0x0;var _0x322997=_0xcf91[_0xc5926f];return _0x322997;};'use strict';var _=require(_0x1cf9('0x0'));var util=require('util');var moment=require(_0x1cf9('0x1'));var BPromise=require(_0x1cf9('0x2'));var rs=require(_0x1cf9('0x3'));var fs=require('fs');var Redis=require(_0x1cf9('0x4'));var db=require(_0x1cf9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cf9('0x6'))('rpc');var config=require(_0x1cf9('0x7'));var jayson=require(_0x1cf9('0x8'));var client=jayson[_0x1cf9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3adb15,_0x384d40,_0x3ea7c5){return new BPromise(function(_0x3c342c,_0x5ea854){return client[_0x1cf9('0xa')](_0x3adb15,_0x3ea7c5)[_0x1cf9('0xb')](function(_0x283399){logger[_0x1cf9('0xc')](_0x1cf9('0xd'),_0x384d40,'request\x20sent');logger[_0x1cf9('0xe')](_0x1cf9('0xf'),_0x384d40,_0x1cf9('0x10'),JSON[_0x1cf9('0x11')](_0x283399));if(_0x283399[_0x1cf9('0x12')]){if(_0x283399[_0x1cf9('0x12')]['code']===0x1f4){logger[_0x1cf9('0x12')](_0x1cf9('0xd'),_0x384d40,_0x283399['error'][_0x1cf9('0x13')]);return _0x5ea854(_0x283399[_0x1cf9('0x12')]['message']);}logger['error'](_0x1cf9('0xd'),_0x384d40,_0x283399[_0x1cf9('0x12')][_0x1cf9('0x13')]);return _0x3c342c(_0x283399[_0x1cf9('0x12')][_0x1cf9('0x13')]);}else{logger[_0x1cf9('0xc')](_0x1cf9('0xd'),_0x384d40,_0x1cf9('0x10'));_0x3c342c(_0x283399[_0x1cf9('0x14')]['message']);}})[_0x1cf9('0x15')](function(_0x3bd881){logger[_0x1cf9('0x12')](_0x1cf9('0xd'),_0x384d40,_0x3bd881);_0x5ea854(_0x3bd881);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index dcf17a7..b696388 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 _0x8cd4=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','index','show','/:id/preview','preview','/:id/run','/:id/query','isAuthenticated','query','post','put','/:id','update','multer'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x8cd4,0x175));var _0x48cd=function(_0x350744,_0x7d9b13){_0x350744=_0x350744-0x0;var _0x14ad39=_0x8cd4[_0x350744];return _0x14ad39;};'use strict';var multer=require(_0x48cd('0x0'));var util=require(_0x48cd('0x1'));var path=require(_0x48cd('0x2'));var timeout=require(_0x48cd('0x3'));var express=require(_0x48cd('0x4'));var router=express[_0x48cd('0x5')]();var fs_extra=require(_0x48cd('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x48cd('0x7'));var controller=require(_0x48cd('0x8'));router[_0x48cd('0x9')]('/',auth['isAuthenticated'](),controller[_0x48cd('0xa')]);router[_0x48cd('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x48cd('0xb')]);router[_0x48cd('0x9')](_0x48cd('0xc'),auth['isAuthenticated'](),controller[_0x48cd('0xd')]);router['get'](_0x48cd('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x48cd('0x9')](_0x48cd('0xf'),auth[_0x48cd('0x10')](),controller[_0x48cd('0x11')]);router[_0x48cd('0x12')]('/',auth[_0x48cd('0x10')](),controller['create']);router[_0x48cd('0x13')](_0x48cd('0x14'),auth[_0x48cd('0x10')](),controller[_0x48cd('0x15')]);router['delete'](_0x48cd('0x14'),auth[_0x48cd('0x10')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb4de=['express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xb4de,0x194));var _0xeb4d=function(_0x417eb7,_0x4a0779){_0x417eb7=_0x417eb7-0x0;var _0xf00a10=_0xb4de[_0x417eb7];return _0xf00a10;};'use strict';var multer=require(_0xeb4d('0x0'));var util=require(_0xeb4d('0x1'));var path=require(_0xeb4d('0x2'));var timeout=require(_0xeb4d('0x3'));var express=require(_0xeb4d('0x4'));var router=express[_0xeb4d('0x5')]();var fs_extra=require(_0xeb4d('0x6'));var auth=require(_0xeb4d('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb4d('0x8'));router[_0xeb4d('0x9')]('/',auth[_0xeb4d('0xa')](),controller[_0xeb4d('0xb')]);router[_0xeb4d('0x9')](_0xeb4d('0xc'),auth[_0xeb4d('0xa')](),controller[_0xeb4d('0xd')]);router[_0xeb4d('0x9')](_0xeb4d('0xe'),auth[_0xeb4d('0xa')](),controller[_0xeb4d('0xf')]);router[_0xeb4d('0x9')](_0xeb4d('0x10'),auth[_0xeb4d('0xa')](),controller[_0xeb4d('0x11')]);router[_0xeb4d('0x9')]('/:id/query',auth[_0xeb4d('0xa')](),controller[_0xeb4d('0x12')]);router[_0xeb4d('0x13')]('/',auth[_0xeb4d('0xa')](),controller['create']);router[_0xeb4d('0x14')](_0xeb4d('0xc'),auth[_0xeb4d('0xa')](),controller[_0xeb4d('0x15')]);router['delete']('/:id',auth[_0xeb4d('0xa')](),controller[_0xeb4d('0x16')]);module[_0xeb4d('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index dd90015..16c04fb 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 _0x3d50=['csv','pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0x3d50,0x140));var _0x03d5=function(_0x417395,_0x57a90c){_0x417395=_0x417395-0x0;var _0x468299=_0x3d50[_0x417395];return _0x468299;};'use strict';var Sequelize=require(_0x03d5('0x0'));var moment=require('moment');module[_0x03d5('0x1')]={'name':{'type':Sequelize[_0x03d5('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x03d5('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x03d5('0x3')](_0x03d5('0x4'),_0x03d5('0x5'),_0x03d5('0x6')),'allowNull':![],'defaultValue':_0x03d5('0x4')},'savename':{'type':Sequelize[_0x03d5('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x03d5('0x7')]},'endDate':{'type':Sequelize[_0x03d5('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x03d5('0x8')},'type':{'type':Sequelize[_0x03d5('0x3')](_0x03d5('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x03d5('0x9')},'reportId':{'type':Sequelize[_0x03d5('0xa')](0xb)[_0x03d5('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x462f=['INTEGER','UNSIGNED','sequelize','moment','csv','pdf','xlsx','STRING','Loading','ENUM','manual','scheduled'];(function(_0x41f745,_0x4b5c4a){var _0x2cbbcb=function(_0x4d5c74){while(--_0x4d5c74){_0x41f745['push'](_0x41f745['shift']());}};_0x2cbbcb(++_0x4b5c4a);}(_0x462f,0x9e));var _0xf462=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x462f[_0x339129];return _0x1570df;};'use strict';var Sequelize=require(_0xf462('0x0'));var moment=require(_0xf462('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xf462('0x2'),_0xf462('0x3'),_0xf462('0x4')),'allowNull':![],'defaultValue':_0xf462('0x2')},'savename':{'type':Sequelize[_0xf462('0x5')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xf462('0x5')],'defaultValue':_0xf462('0x6')},'type':{'type':Sequelize[_0xf462('0x7')](_0xf462('0x8'),_0xf462('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf462('0xa')](0xb)[_0xf462('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 4727cf7..d69a83e 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 _0x694e=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','update','destroy','then','ExtractedReports','UserProfileResource','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','length','find','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x4a367f,_0x4e05f2){var _0x2bedd5=function(_0x5b5e70){while(--_0x5b5e70){_0x4a367f['push'](_0x4a367f['shift']());}};_0x2bedd5(++_0x4e05f2);}(_0x694e,0x1d3));var _0xe694=function(_0x50b3cd,_0x5654db){_0x50b3cd=_0x50b3cd-0x0;var _0x3d03b4=_0x694e[_0x50b3cd];return _0x3d03b4;};'use strict';var emlformat=require(_0xe694('0x0'));var rimraf=require(_0xe694('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe694('0x2'));var rp=require('request-promise');var moment=require(_0xe694('0x3'));var BPromise=require(_0xe694('0x4'));var Mustache=require(_0xe694('0x5'));var util=require('util');var path=require(_0xe694('0x6'));var sox=require(_0xe694('0x7'));var csv=require(_0xe694('0x8'));var ejs=require(_0xe694('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe694('0xa'));var squel=require(_0xe694('0xb'));var crypto=require('crypto');var jsforce=require(_0xe694('0xc'));var deskjs=require(_0xe694('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe694('0xe'));var Papa=require(_0xe694('0xf'));var Redis=require(_0xe694('0x10'));var authService=require(_0xe694('0x11'));var qs=require(_0xe694('0x12'));var as=require(_0xe694('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe694('0x14'))(_0xe694('0x15'));var utils=require(_0xe694('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe694('0x17'));var db=require(_0xe694('0x18'))['db'];function respondWithStatusCode(_0x3b78be,_0x569362){_0x569362=_0x569362||0xcc;return function(_0xa3ac02){if(_0xa3ac02){return _0x3b78be[_0xe694('0x19')](_0x569362);}return _0x3b78be['status'](_0x569362)[_0xe694('0x1a')]();};}function respondWithResult(_0x9cc8d1,_0x90003a){_0x90003a=_0x90003a||0xc8;return function(_0x24d4a4){if(_0x24d4a4){return _0x9cc8d1[_0xe694('0x1b')](_0x90003a)[_0xe694('0x1c')](_0x24d4a4);}};}function respondWithFilteredResult(_0x386862,_0x146f12){return function(_0x100c4f){if(_0x100c4f){var _0x4b4534=typeof _0x146f12['offset']===_0xe694('0x1d')&&typeof _0x146f12[_0xe694('0x1e')]==='undefined';var _0x486114=_0x100c4f[_0xe694('0x1f')];var _0x3984bb=_0x4b4534?0x0:_0x146f12[_0xe694('0x20')];var _0x5e65b2=_0x4b4534?_0x100c4f[_0xe694('0x1f')]:_0x146f12['offset']+_0x146f12[_0xe694('0x1e')];var _0x5de1de;if(_0x5e65b2>=_0x486114){_0x5e65b2=_0x486114;_0x5de1de=0xc8;}else{_0x5de1de=0xce;}_0x386862[_0xe694('0x1b')](_0x5de1de);return _0x386862[_0xe694('0x21')]('Content-Range',_0x3984bb+'-'+_0x5e65b2+'/'+_0x486114)[_0xe694('0x1c')](_0x100c4f);}return null;};}function patchUpdates(_0x404659){return function(_0x349a2a){try{jsonpatch['apply'](_0x349a2a,_0x404659,!![]);}catch(_0x3928f4){return BPromise[_0xe694('0x22')](_0x3928f4);}return _0x349a2a['save']();};}function saveUpdates(_0x147be6,_0x17558e){return function(_0x5cf8d4){if(_0x5cf8d4){return _0x5cf8d4[_0xe694('0x23')](_0x147be6)['then'](function(_0xa6fca8){return _0xa6fca8;});}return null;};}function removeEntity(_0xec52e5,_0x19d2fd){return function(_0x43b670){if(_0x43b670){return _0x43b670[_0xe694('0x24')]()[_0xe694('0x25')](function(){var _0x3c4be6=_0x43b670['get']({'plain':!![]});var _0xea480f=_0xe694('0x26');return db[_0xe694('0x27')]['destroy']({'where':{'type':_0xea480f,'resourceId':_0x3c4be6['id']}})[_0xe694('0x25')](function(){return _0x43b670;});})[_0xe694('0x25')](function(){_0xec52e5[_0xe694('0x1b')](0xcc)[_0xe694('0x1a')]();});}};}function handleEntityNotFound(_0x5011fe,_0x2414f8){return function(_0x52041a){if(!_0x52041a){_0x5011fe[_0xe694('0x19')](0x194);}return _0x52041a;};}function handleError(_0x1c8878,_0x268ad6){_0x268ad6=_0x268ad6||0x1f4;return function(_0x302a00){logger['error'](_0x302a00['stack']);if(_0x302a00[_0xe694('0x28')]){delete _0x302a00['name'];}_0x1c8878['status'](_0x268ad6)[_0xe694('0x29')](_0x302a00);};}exports[_0xe694('0x2a')]=function(_0x4baa28,_0x934539){var _0x4b9521={},_0x3ac1fc={},_0x3418eb={'count':0x0,'rows':[]};var _0x49c651=_[_0xe694('0x2b')](db[_0xe694('0x2c')][_0xe694('0x2d')],function(_0x5166cf){return{'name':_0x5166cf['fieldName'],'type':_0x5166cf[_0xe694('0x2e')][_0xe694('0x2f')]};});_0x3ac1fc[_0xe694('0x30')]=_[_0xe694('0x2b')](_0x49c651,_0xe694('0x28'));_0x3ac1fc[_0xe694('0x31')]=_[_0xe694('0x32')](_0x4baa28[_0xe694('0x31')]);_0x3ac1fc[_0xe694('0x33')]=_[_0xe694('0x34')](_0x3ac1fc[_0xe694('0x30')],_0x3ac1fc[_0xe694('0x31')]);_0x4b9521[_0xe694('0x35')]=_[_0xe694('0x34')](_0x3ac1fc['model'],qs[_0xe694('0x36')](_0x4baa28['query']['fields']));_0x4b9521['attributes']=_0x4b9521[_0xe694('0x35')]['length']?_0x4b9521[_0xe694('0x35')]:_0x3ac1fc['model'];if(!_0x4baa28[_0xe694('0x31')][_0xe694('0x37')](_0xe694('0x38'))){_0x4b9521[_0xe694('0x1e')]=qs[_0xe694('0x1e')](_0x4baa28[_0xe694('0x31')]['limit']);_0x4b9521[_0xe694('0x20')]=qs[_0xe694('0x20')](_0x4baa28[_0xe694('0x31')][_0xe694('0x20')]);}_0x4b9521[_0xe694('0x39')]=qs[_0xe694('0x3a')](_0x4baa28[_0xe694('0x31')][_0xe694('0x3a')]);_0x4b9521[_0xe694('0x3b')]=qs[_0xe694('0x33')](_[_0xe694('0x3c')](_0x4baa28[_0xe694('0x31')],_0x3ac1fc[_0xe694('0x33')]),_0x49c651);if(_0x4baa28[_0xe694('0x31')]['filter']){_0x4b9521[_0xe694('0x3b')]=_[_0xe694('0x3d')](_0x4b9521['where'],{'$or':_['map'](_0x49c651,function(_0x20e566){if(_0x20e566[_0xe694('0x2e')]!==_0xe694('0x3e')){var _0x4ea197={};_0x4ea197[_0x20e566[_0xe694('0x28')]]={'$like':'%'+_0x4baa28['query'][_0xe694('0x3f')]+'%'};return _0x4ea197;}})});}_0x4b9521=_[_0xe694('0x3d')]({},_0x4b9521,_0x4baa28[_0xe694('0x40')]);var _0x13a57f={'where':_0x4b9521[_0xe694('0x3b')]};return db[_0xe694('0x2c')][_0xe694('0x1f')](_0x13a57f)[_0xe694('0x25')](function(_0x43d76b){_0x3418eb[_0xe694('0x1f')]=_0x43d76b;if(_0x4baa28[_0xe694('0x31')][_0xe694('0x41')]){_0x4b9521[_0xe694('0x42')]=[{'all':!![]}];}return db[_0xe694('0x2c')][_0xe694('0x43')](_0x4b9521);})[_0xe694('0x25')](function(_0x1fe2d8){_0x3418eb['rows']=_0x1fe2d8;return _0x3418eb;})['then'](respondWithFilteredResult(_0x934539,_0x4b9521))[_0xe694('0x44')](handleError(_0x934539,null));};exports[_0xe694('0x45')]=function(_0xacc628,_0x61c05c){var _0xdbd938={'raw':!![],'where':{'id':_0xacc628['params']['id']}},_0x42a815={};_0x42a815[_0xe694('0x30')]=_[_0xe694('0x32')](db[_0xe694('0x2c')]['rawAttributes']);_0x42a815[_0xe694('0x31')]=_[_0xe694('0x32')](_0xacc628['query']);_0x42a815['filters']=_[_0xe694('0x34')](_0x42a815[_0xe694('0x30')],_0x42a815[_0xe694('0x31')]);_0xdbd938[_0xe694('0x35')]=_['intersection'](_0x42a815[_0xe694('0x30')],qs['fields'](_0xacc628[_0xe694('0x31')][_0xe694('0x36')]));_0xdbd938[_0xe694('0x35')]=_0xdbd938[_0xe694('0x35')][_0xe694('0x46')]?_0xdbd938[_0xe694('0x35')]:_0x42a815[_0xe694('0x30')];if(_0xacc628[_0xe694('0x31')][_0xe694('0x41')]){_0xdbd938[_0xe694('0x42')]=[{'all':!![]}];}_0xdbd938=_[_0xe694('0x3d')]({},_0xdbd938,_0xacc628[_0xe694('0x40')]);return db[_0xe694('0x2c')][_0xe694('0x47')](_0xdbd938)[_0xe694('0x25')](handleEntityNotFound(_0x61c05c,null))[_0xe694('0x25')](respondWithResult(_0x61c05c,null))[_0xe694('0x44')](handleError(_0x61c05c,null));};exports[_0xe694('0x48')]=function(_0x8732f3,_0x173c9b){return db[_0xe694('0x2c')]['create'](_0x8732f3[_0xe694('0x49')],{})['then'](function(_0x57a5b1){var _0x2f6b7f=_0x8732f3['user'][_0xe694('0x4a')]({'plain':!![]});if(!_0x2f6b7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f6b7f[_0xe694('0x4b')]===_0xe694('0x4c')){var _0x19eb1f=_0x57a5b1[_0xe694('0x4a')]({'plain':!![]});var _0x5d4c27='ExtractedReports';return db[_0xe694('0x4d')][_0xe694('0x47')]({'where':{'name':_0x5d4c27,'userProfileId':_0x2f6b7f[_0xe694('0x4e')]},'raw':!![]})[_0xe694('0x25')](function(_0x5bfd64){if(_0x5bfd64&&_0x5bfd64[_0xe694('0x4f')]===0x0){return db[_0xe694('0x27')][_0xe694('0x48')]({'name':_0x19eb1f['name'],'resourceId':_0x19eb1f['id'],'type':_0x5bfd64[_0xe694('0x28')],'sectionId':_0x5bfd64['id']},{})[_0xe694('0x25')](function(){return _0x57a5b1;});}else{return _0x57a5b1;}})[_0xe694('0x44')](function(_0x3f6d1a){logger[_0xe694('0x50')](_0xe694('0x51'),_0x3f6d1a);throw _0x3f6d1a;});}return _0x57a5b1;})[_0xe694('0x25')](respondWithResult(_0x173c9b,0xc9))[_0xe694('0x44')](handleError(_0x173c9b,null));};exports['update']=function(_0x1a5943,_0x4d6229){if(_0x1a5943[_0xe694('0x49')]['id']){delete _0x1a5943[_0xe694('0x49')]['id'];}return db['AnalyticExtractedReport'][_0xe694('0x47')]({'where':{'id':_0x1a5943[_0xe694('0x52')]['id']}})[_0xe694('0x25')](handleEntityNotFound(_0x4d6229,null))[_0xe694('0x25')](saveUpdates(_0x1a5943[_0xe694('0x49')],null))[_0xe694('0x25')](respondWithResult(_0x4d6229,null))[_0xe694('0x44')](handleError(_0x4d6229,null));};exports[_0xe694('0x24')]=function(_0x2f8315,_0x53bdbb){return db[_0xe694('0x2c')][_0xe694('0x47')]({'where':{'id':_0x2f8315[_0xe694('0x52')]['id']}})[_0xe694('0x25')](handleEntityNotFound(_0x53bdbb,null))[_0xe694('0x25')](removeEntity(_0x53bdbb,null))['catch'](handleError(_0x53bdbb,null));};exports[_0xe694('0x53')]=function(_0x118821,_0x8a6ead,_0x6c2198){return db[_0xe694('0x2c')][_0xe694('0x47')]({'where':{'id':_0x118821['params']['id']},'attributes':['name','basename',_0xe694('0x54'),_0xe694('0x55')],'raw':!![]})[_0xe694('0x25')](handleEntityNotFound(_0x8a6ead,null))[_0xe694('0x25')](function(_0x597b41){if(_0x597b41){if(!fs[_0xe694('0x56')](path[_0xe694('0x57')](config[_0xe694('0x58')],_0xe694('0x59'),_0x597b41['savename']))){throw new db[(_0xe694('0x5a'))][(_0xe694('0x5b'))](_0xe694('0x5c'));}if(_0x118821[_0xe694('0x31')][_0xe694('0x5d')]){return _0x8a6ead[_0xe694('0x19')](0xc8);}return _0x8a6ead['download'](path[_0xe694('0x57')](config[_0xe694('0x58')],_0xe694('0x59'),_0x597b41[_0xe694('0x54')]),util[_0xe694('0x5e')](_0xe694('0x5f'),_0x597b41[_0xe694('0x60')]||_0x597b41['name'],_0x597b41[_0xe694('0x55')][_0xe694('0x61')]()));}})[_0xe694('0x44')](handleError(_0x8a6ead,null));}; \ No newline at end of file +var _0x4ffe=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','root','server/files/reports','ValidationError','exists','download','join','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','AnalyticExtractedReport','rawAttributes','key','model','map','query','keys','filters','intersection'];(function(_0xbc8df5,_0x3311d3){var _0x1eddd2=function(_0x1466d5){while(--_0x1466d5){_0xbc8df5['push'](_0xbc8df5['shift']());}};_0x1eddd2(++_0x3311d3);}(_0x4ffe,0x1b5));var _0xe4ff=function(_0x51dada,_0x4ddb59){_0x51dada=_0x51dada-0x0;var _0x209d74=_0x4ffe[_0x51dada];return _0x209d74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4ff('0x0'));var zipdir=require(_0xe4ff('0x1'));var jsonpatch=require(_0xe4ff('0x2'));var rp=require(_0xe4ff('0x3'));var moment=require('moment');var BPromise=require(_0xe4ff('0x4'));var Mustache=require(_0xe4ff('0x5'));var util=require(_0xe4ff('0x6'));var path=require(_0xe4ff('0x7'));var sox=require(_0xe4ff('0x8'));var csv=require(_0xe4ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4ff('0xa'));var _=require(_0xe4ff('0xb'));var squel=require(_0xe4ff('0xc'));var crypto=require(_0xe4ff('0xd'));var jsforce=require(_0xe4ff('0xe'));var deskjs=require(_0xe4ff('0xf'));var toCsv=require(_0xe4ff('0x9'));var querystring=require(_0xe4ff('0x10'));var Papa=require(_0xe4ff('0x11'));var Redis=require(_0xe4ff('0x12'));var authService=require(_0xe4ff('0x13'));var qs=require(_0xe4ff('0x14'));var as=require(_0xe4ff('0x15'));var hardwareService=require(_0xe4ff('0x16'));var logger=require('../../config/logger')(_0xe4ff('0x17'));var utils=require(_0xe4ff('0x18'));var config=require(_0xe4ff('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4ff('0x1a'))['db'];function respondWithStatusCode(_0x581678,_0x241a41){_0x241a41=_0x241a41||0xcc;return function(_0x5906e8){if(_0x5906e8){return _0x581678[_0xe4ff('0x1b')](_0x241a41);}return _0x581678['status'](_0x241a41)[_0xe4ff('0x1c')]();};}function respondWithResult(_0x4d1cfa,_0x366136){_0x366136=_0x366136||0xc8;return function(_0x53f892){if(_0x53f892){return _0x4d1cfa[_0xe4ff('0x1d')](_0x366136)[_0xe4ff('0x1e')](_0x53f892);}};}function respondWithFilteredResult(_0x41e44c,_0x510fba){return function(_0x446817){if(_0x446817){var _0x11000a=typeof _0x510fba[_0xe4ff('0x1f')]===_0xe4ff('0x20')&&typeof _0x510fba[_0xe4ff('0x21')]===_0xe4ff('0x20');var _0x597f96=_0x446817[_0xe4ff('0x22')];var _0x2a3c5b=_0x11000a?0x0:_0x510fba[_0xe4ff('0x1f')];var _0x17ac12=_0x11000a?_0x446817[_0xe4ff('0x22')]:_0x510fba[_0xe4ff('0x1f')]+_0x510fba[_0xe4ff('0x21')];var _0x31b830;if(_0x17ac12>=_0x597f96){_0x17ac12=_0x597f96;_0x31b830=0xc8;}else{_0x31b830=0xce;}_0x41e44c['status'](_0x31b830);return _0x41e44c[_0xe4ff('0x23')](_0xe4ff('0x24'),_0x2a3c5b+'-'+_0x17ac12+'/'+_0x597f96)['json'](_0x446817);}return null;};}function patchUpdates(_0x166f03){return function(_0x3487ff){try{jsonpatch[_0xe4ff('0x25')](_0x3487ff,_0x166f03,!![]);}catch(_0x326d8d){return BPromise[_0xe4ff('0x26')](_0x326d8d);}return _0x3487ff[_0xe4ff('0x27')]();};}function saveUpdates(_0x3e6655,_0x569218){return function(_0x2874c9){if(_0x2874c9){return _0x2874c9[_0xe4ff('0x28')](_0x3e6655)[_0xe4ff('0x29')](function(_0x4fc17b){return _0x4fc17b;});}return null;};}function removeEntity(_0x4e0dbc,_0x42c5e9){return function(_0x405354){if(_0x405354){return _0x405354[_0xe4ff('0x2a')]()[_0xe4ff('0x29')](function(){var _0xea010e=_0x405354[_0xe4ff('0x2b')]({'plain':!![]});var _0x562fe8=_0xe4ff('0x2c');return db[_0xe4ff('0x2d')][_0xe4ff('0x2a')]({'where':{'type':_0x562fe8,'resourceId':_0xea010e['id']}})['then'](function(){return _0x405354;});})[_0xe4ff('0x29')](function(){_0x4e0dbc[_0xe4ff('0x1d')](0xcc)[_0xe4ff('0x1c')]();});}};}function handleEntityNotFound(_0x9d3a0d,_0x19107d){return function(_0x515b86){if(!_0x515b86){_0x9d3a0d[_0xe4ff('0x1b')](0x194);}return _0x515b86;};}function handleError(_0x5ab6cb,_0x5dafd0){_0x5dafd0=_0x5dafd0||0x1f4;return function(_0x1c3afb){logger['error'](_0x1c3afb[_0xe4ff('0x2e')]);if(_0x1c3afb[_0xe4ff('0x2f')]){delete _0x1c3afb[_0xe4ff('0x2f')];}_0x5ab6cb[_0xe4ff('0x1d')](_0x5dafd0)[_0xe4ff('0x30')](_0x1c3afb);};}exports['index']=function(_0x499942,_0x47d105){var _0x543b90={},_0x56705b={},_0x21b72f={'count':0x0,'rows':[]};var _0x2e5f94=_['map'](db[_0xe4ff('0x31')][_0xe4ff('0x32')],function(_0x3f7a2d){return{'name':_0x3f7a2d['fieldName'],'type':_0x3f7a2d['type'][_0xe4ff('0x33')]};});_0x56705b[_0xe4ff('0x34')]=_[_0xe4ff('0x35')](_0x2e5f94,_0xe4ff('0x2f'));_0x56705b[_0xe4ff('0x36')]=_[_0xe4ff('0x37')](_0x499942['query']);_0x56705b[_0xe4ff('0x38')]=_[_0xe4ff('0x39')](_0x56705b[_0xe4ff('0x34')],_0x56705b[_0xe4ff('0x36')]);_0x543b90[_0xe4ff('0x3a')]=_[_0xe4ff('0x39')](_0x56705b[_0xe4ff('0x34')],qs['fields'](_0x499942[_0xe4ff('0x36')][_0xe4ff('0x3b')]));_0x543b90['attributes']=_0x543b90['attributes'][_0xe4ff('0x3c')]?_0x543b90[_0xe4ff('0x3a')]:_0x56705b[_0xe4ff('0x34')];if(!_0x499942[_0xe4ff('0x36')][_0xe4ff('0x3d')](_0xe4ff('0x3e'))){_0x543b90[_0xe4ff('0x21')]=qs[_0xe4ff('0x21')](_0x499942['query']['limit']);_0x543b90[_0xe4ff('0x1f')]=qs[_0xe4ff('0x1f')](_0x499942[_0xe4ff('0x36')]['offset']);}_0x543b90['order']=qs[_0xe4ff('0x3f')](_0x499942[_0xe4ff('0x36')][_0xe4ff('0x3f')]);_0x543b90[_0xe4ff('0x40')]=qs[_0xe4ff('0x38')](_[_0xe4ff('0x41')](_0x499942['query'],_0x56705b['filters']),_0x2e5f94);if(_0x499942[_0xe4ff('0x36')][_0xe4ff('0x42')]){_0x543b90[_0xe4ff('0x40')]=_[_0xe4ff('0x43')](_0x543b90[_0xe4ff('0x40')],{'$or':_[_0xe4ff('0x35')](_0x2e5f94,function(_0x2fa725){if(_0x2fa725['type']!==_0xe4ff('0x44')){var _0x1359af={};_0x1359af[_0x2fa725['name']]={'$like':'%'+_0x499942['query'][_0xe4ff('0x42')]+'%'};return _0x1359af;}})});}_0x543b90=_['merge']({},_0x543b90,_0x499942[_0xe4ff('0x45')]);var _0x25dd48={'where':_0x543b90['where']};return db['AnalyticExtractedReport'][_0xe4ff('0x22')](_0x25dd48)['then'](function(_0x3a22d7){_0x21b72f[_0xe4ff('0x22')]=_0x3a22d7;if(_0x499942['query']['includeAll']){_0x543b90[_0xe4ff('0x46')]=[{'all':!![]}];}return db[_0xe4ff('0x31')][_0xe4ff('0x47')](_0x543b90);})[_0xe4ff('0x29')](function(_0x13e41f){_0x21b72f[_0xe4ff('0x48')]=_0x13e41f;return _0x21b72f;})[_0xe4ff('0x29')](respondWithFilteredResult(_0x47d105,_0x543b90))[_0xe4ff('0x49')](handleError(_0x47d105,null));};exports[_0xe4ff('0x4a')]=function(_0x47b298,_0x5531e7){var _0x2eba3a={'raw':!![],'where':{'id':_0x47b298[_0xe4ff('0x4b')]['id']}},_0x378851={};_0x378851['model']=_[_0xe4ff('0x37')](db[_0xe4ff('0x31')][_0xe4ff('0x32')]);_0x378851['query']=_[_0xe4ff('0x37')](_0x47b298[_0xe4ff('0x36')]);_0x378851[_0xe4ff('0x38')]=_[_0xe4ff('0x39')](_0x378851[_0xe4ff('0x34')],_0x378851[_0xe4ff('0x36')]);_0x2eba3a['attributes']=_[_0xe4ff('0x39')](_0x378851[_0xe4ff('0x34')],qs['fields'](_0x47b298[_0xe4ff('0x36')][_0xe4ff('0x3b')]));_0x2eba3a['attributes']=_0x2eba3a[_0xe4ff('0x3a')]['length']?_0x2eba3a[_0xe4ff('0x3a')]:_0x378851[_0xe4ff('0x34')];if(_0x47b298[_0xe4ff('0x36')][_0xe4ff('0x4c')]){_0x2eba3a['include']=[{'all':!![]}];}_0x2eba3a=_[_0xe4ff('0x43')]({},_0x2eba3a,_0x47b298[_0xe4ff('0x45')]);return db[_0xe4ff('0x31')][_0xe4ff('0x4d')](_0x2eba3a)['then'](handleEntityNotFound(_0x5531e7,null))[_0xe4ff('0x29')](respondWithResult(_0x5531e7,null))['catch'](handleError(_0x5531e7,null));};exports[_0xe4ff('0x4e')]=function(_0x8b5472,_0x34ff6b){return db[_0xe4ff('0x31')][_0xe4ff('0x4e')](_0x8b5472[_0xe4ff('0x4f')],{})['then'](function(_0x158a9b){var _0x3b8f16=_0x8b5472[_0xe4ff('0x50')][_0xe4ff('0x2b')]({'plain':!![]});if(!_0x3b8f16)throw new Error(_0xe4ff('0x51'));if(_0x3b8f16['role']===_0xe4ff('0x50')){var _0x4fcd78=_0x158a9b[_0xe4ff('0x2b')]({'plain':!![]});var _0x33233e='ExtractedReports';return db[_0xe4ff('0x52')][_0xe4ff('0x4d')]({'where':{'name':_0x33233e,'userProfileId':_0x3b8f16['userProfileId']},'raw':!![]})[_0xe4ff('0x29')](function(_0xd84209){if(_0xd84209&&_0xd84209[_0xe4ff('0x53')]===0x0){return db[_0xe4ff('0x2d')][_0xe4ff('0x4e')]({'name':_0x4fcd78[_0xe4ff('0x2f')],'resourceId':_0x4fcd78['id'],'type':_0xd84209[_0xe4ff('0x2f')],'sectionId':_0xd84209['id']},{})['then'](function(){return _0x158a9b;});}else{return _0x158a9b;}})['catch'](function(_0x212242){logger[_0xe4ff('0x54')](_0xe4ff('0x55'),_0x212242);throw _0x212242;});}return _0x158a9b;})[_0xe4ff('0x29')](respondWithResult(_0x34ff6b,0xc9))[_0xe4ff('0x49')](handleError(_0x34ff6b,null));};exports[_0xe4ff('0x28')]=function(_0x5ee54d,_0x5ed702){if(_0x5ee54d['body']['id']){delete _0x5ee54d[_0xe4ff('0x4f')]['id'];}return db[_0xe4ff('0x31')][_0xe4ff('0x4d')]({'where':{'id':_0x5ee54d[_0xe4ff('0x4b')]['id']}})[_0xe4ff('0x29')](handleEntityNotFound(_0x5ed702,null))[_0xe4ff('0x29')](saveUpdates(_0x5ee54d[_0xe4ff('0x4f')],null))[_0xe4ff('0x29')](respondWithResult(_0x5ed702,null))['catch'](handleError(_0x5ed702,null));};exports[_0xe4ff('0x2a')]=function(_0x1da0d9,_0x2ce9f1){return db['AnalyticExtractedReport'][_0xe4ff('0x4d')]({'where':{'id':_0x1da0d9[_0xe4ff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ce9f1,null))[_0xe4ff('0x29')](removeEntity(_0x2ce9f1,null))[_0xe4ff('0x49')](handleError(_0x2ce9f1,null));};exports['download']=function(_0x1ed118,_0x151fc1,_0x251ba6){return db[_0xe4ff('0x31')][_0xe4ff('0x4d')]({'where':{'id':_0x1ed118[_0xe4ff('0x4b')]['id']},'attributes':[_0xe4ff('0x2f'),_0xe4ff('0x56'),_0xe4ff('0x57'),_0xe4ff('0x58')],'raw':!![]})[_0xe4ff('0x29')](handleEntityNotFound(_0x151fc1,null))[_0xe4ff('0x29')](function(_0x53db4a){if(_0x53db4a){if(!fs[_0xe4ff('0x59')](path['join'](config[_0xe4ff('0x5a')],_0xe4ff('0x5b'),_0x53db4a[_0xe4ff('0x57')]))){throw new db['Sequelize'][(_0xe4ff('0x5c'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x1ed118['query'][_0xe4ff('0x5d')]){return _0x151fc1[_0xe4ff('0x1b')](0xc8);}return _0x151fc1[_0xe4ff('0x5e')](path[_0xe4ff('0x5f')](config[_0xe4ff('0x5a')],'server/files/reports',_0x53db4a[_0xe4ff('0x57')]),util[_0xe4ff('0x60')](_0xe4ff('0x61'),_0x53db4a[_0xe4ff('0x56')]||_0x53db4a[_0xe4ff('0x2f')],_0x53db4a[_0xe4ff('0x58')][_0xe4ff('0x62')]()));}})[_0xe4ff('0x49')](handleError(_0x151fc1,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7fa04f9..b60f380 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 _0x5ec6=['api','moment','bluebird','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','lodash','util','../../config/logger'];(function(_0x43df13,_0x363ab0){var _0x4464ee=function(_0x5dc6b3){while(--_0x5dc6b3){_0x43df13['push'](_0x43df13['shift']());}};_0x4464ee(++_0x363ab0);}(_0x5ec6,0x151));var _0x65ec=function(_0x6a91d,_0xf6ede5){_0x6a91d=_0x6a91d-0x0;var _0x1c0f0b=_0x5ec6[_0x6a91d];return _0x1c0f0b;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var logger=require(_0x65ec('0x2'))(_0x65ec('0x3'));var moment=require(_0x65ec('0x4'));var BPromise=require(_0x65ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x65ec('0x6'));var config=require(_0x65ec('0x7'));var attributes=require(_0x65ec('0x8'));module['exports']=function(_0x569ef4,_0x47efb8){return _0x569ef4[_0x65ec('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f13=['../../config/environment','define','AnalyticExtractedReport','analytics_extracted_reports','api','request-promise','path'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x3f13,0x1bd));var _0x33f1=function(_0x35338c,_0x51792c){_0x35338c=_0x35338c-0x0;var _0x400ed5=_0x3f13[_0x35338c];return _0x400ed5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x33f1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x33f1('0x1'));var fs=require('fs');var path=require(_0x33f1('0x2'));var rimraf=require('rimraf');var config=require(_0x33f1('0x3'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x340aec,_0xce26dd){return _0x340aec[_0x33f1('0x4')](_0x33f1('0x5'),attributes,{'tableName':_0x33f1('0x6'),'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 51bb48c..b5e894a 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 _0xb889=['lodash','util','bluebird','ioredis','rpc','../../config/environment','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x4fea28,_0x4d5298){var _0x892cab=function(_0x162046){while(--_0x162046){_0x4fea28['push'](_0x4fea28['shift']());}};_0x892cab(++_0x4d5298);}(_0xb889,0x10a));var _0x9b88=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb889[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x9b88('0x0'));var util=require(_0x9b88('0x1'));var moment=require('moment');var BPromise=require(_0x9b88('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b88('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9b88('0x4'));var config=require(_0x9b88('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b88('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x40c7e2,_0x4419ce,_0xc97049){return new BPromise(function(_0x23d54e,_0x23195b){return client[_0x9b88('0x7')](_0x40c7e2,_0xc97049)[_0x9b88('0x8')](function(_0x141a0e){logger[_0x9b88('0x9')](_0x9b88('0xa'),_0x4419ce,_0x9b88('0xb'));logger[_0x9b88('0xc')](_0x9b88('0xd'),_0x4419ce,'request\x20sent',JSON[_0x9b88('0xe')](_0x141a0e));if(_0x141a0e[_0x9b88('0xf')]){if(_0x141a0e[_0x9b88('0xf')]['code']===0x1f4){logger[_0x9b88('0xf')](_0x9b88('0xa'),_0x4419ce,_0x141a0e['error'][_0x9b88('0x10')]);return _0x23195b(_0x141a0e[_0x9b88('0xf')][_0x9b88('0x10')]);}logger[_0x9b88('0xf')](_0x9b88('0xa'),_0x4419ce,_0x141a0e['error'][_0x9b88('0x10')]);return _0x23d54e(_0x141a0e[_0x9b88('0xf')][_0x9b88('0x10')]);}else{logger['info'](_0x9b88('0xa'),_0x4419ce,_0x9b88('0xb'));_0x23d54e(_0x141a0e[_0x9b88('0x11')][_0x9b88('0x10')]);}})[_0x9b88('0x12')](function(_0x296a6b){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4419ce,_0x296a6b);_0x23195b(_0x296a6b);});});} \ No newline at end of file +var _0x253d=['rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','result','AnalyticExtractedReport,\x20%s,\x20%s','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x253d,0x1b3));var _0xd253=function(_0x2284b7,_0x3c5ab8){_0x2284b7=_0x2284b7-0x0;var _0x5aac1e=_0x253d[_0x2284b7];return _0x5aac1e;};'use strict';var _=require(_0xd253('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd253('0x1'));var db=require(_0xd253('0x2'))['db'];var utils=require(_0xd253('0x3'));var logger=require(_0xd253('0x4'))(_0xd253('0x5'));var config=require('../../config/environment');var jayson=require(_0xd253('0x6'));var client=jayson[_0xd253('0x7')][_0xd253('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17589a,_0xf4b457,_0x487f4e){return new BPromise(function(_0x2c4de4,_0x712c81){return client[_0xd253('0x9')](_0x17589a,_0x487f4e)[_0xd253('0xa')](function(_0x351047){logger[_0xd253('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xf4b457,'request\x20sent');logger[_0xd253('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'),JSON[_0xd253('0xe')](_0x351047));if(_0x351047[_0xd253('0xf')]){if(_0x351047[_0xd253('0xf')][_0xd253('0x10')]===0x1f4){logger[_0xd253('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xf4b457,_0x351047['error'][_0xd253('0x11')]);return _0x712c81(_0x351047[_0xd253('0xf')][_0xd253('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xf4b457,_0x351047[_0xd253('0xf')][_0xd253('0x11')]);return _0x2c4de4(_0x351047[_0xd253('0xf')]['message']);}else{logger[_0xd253('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'));_0x2c4de4(_0x351047[_0xd253('0x12')][_0xd253('0x11')]);}})['catch'](function(_0x1b7ed1){logger['error'](_0xd253('0x13'),_0xf4b457,_0x1b7ed1);_0x712c81(_0x1b7ed1);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 6136c22..02ffcb1 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 _0xe67c=['util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','create','put','delete','destroy','multer'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe67c,0x10d));var _0xce67=function(_0x2e85c6,_0x4edc93){_0x2e85c6=_0x2e85c6-0x0;var _0x37ef84=_0xe67c[_0x2e85c6];return _0x37ef84;};'use strict';var multer=require(_0xce67('0x0'));var util=require(_0xce67('0x1'));var path=require(_0xce67('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xce67('0x3'));var auth=require(_0xce67('0x4'));var interaction=require(_0xce67('0x5'));var config=require('../../config/environment');var controller=require(_0xce67('0x6'));router[_0xce67('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xce67('0x8'),auth[_0xce67('0x9')](),controller[_0xce67('0xa')]);router[_0xce67('0x7')](_0xce67('0xb'),auth['isAuthenticated'](),controller[_0xce67('0xc')]);router[_0xce67('0xd')]('/',auth[_0xce67('0x9')](),controller[_0xce67('0xe')]);router[_0xce67('0xf')]('/:id',auth[_0xce67('0x9')](),controller['update']);router[_0xce67('0x10')](_0xce67('0x8'),auth[_0xce67('0x9')](),controller[_0xce67('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1a71=['post','create','put','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a71,0xcc));var _0x11a7=function(_0x2770a9,_0x3bb210){_0x2770a9=_0x2770a9-0x0;var _0x59d922=_0x1a71[_0x2770a9];return _0x59d922;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11a7('0x0'));var timeout=require('connect-timeout');var express=require(_0x11a7('0x1'));var router=express['Router']();var fs_extra=require(_0x11a7('0x2'));var auth=require(_0x11a7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x11a7('0x4'));router[_0x11a7('0x5')]('/',auth[_0x11a7('0x6')](),controller[_0x11a7('0x7')]);router[_0x11a7('0x5')](_0x11a7('0x8'),auth[_0x11a7('0x6')](),controller[_0x11a7('0x9')]);router['get'](_0x11a7('0xa'),auth['isAuthenticated'](),controller[_0x11a7('0xb')]);router[_0x11a7('0xc')]('/',auth[_0x11a7('0x6')](),controller[_0x11a7('0xd')]);router[_0x11a7('0xe')](_0x11a7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x11a7('0xf')](_0x11a7('0x8'),auth[_0x11a7('0x6')](),controller[_0x11a7('0x10')]);module[_0x11a7('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index f20430a..7e2bf68 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 _0x8343=['sequelize','exports','BOOLEAN'];(function(_0x1a0dfd,_0x3caebf){var _0x7c9899=function(_0xd76d84){while(--_0xd76d84){_0x1a0dfd['push'](_0x1a0dfd['shift']());}};_0x7c9899(++_0x3caebf);}(_0x8343,0x10e));var _0x3834=function(_0x28e136,_0x534b53){_0x28e136=_0x28e136-0x0;var _0x41f7b8=_0x8343[_0x28e136];return _0x41f7b8;};'use strict';var Sequelize=require(_0x3834('0x0'));module[_0x3834('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x3834('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x3834('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x2eb2=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2eb2,0x189));var _0x22eb=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x2eb2[_0x521929];return _0x632436;};'use strict';var Sequelize=require(_0x22eb('0x0'));module[_0x22eb('0x1')]={'field':{'type':Sequelize[_0x22eb('0x2')]},'alias':{'type':Sequelize[_0x22eb('0x3')]},'function':{'type':Sequelize[_0x22eb('0x3')]},'format':{'type':Sequelize[_0x22eb('0x3')]},'groupBy':{'type':Sequelize[_0x22eb('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x22eb('0x3')]},'custom':{'type':Sequelize[_0x22eb('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 420049d..8e5946f 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 _0xf51e=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','sendStatus','stack','index','AnalyticFieldReport','rawAttributes','fieldName','model','map','name','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','then','includeAll','include','rows','catch','show','intersection','length','options','find','create','bulkCreate','update','body','params','ids','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0xf51e,0x1c8));var _0xef51=function(_0x40f02f,_0x1ec9c6){_0x40f02f=_0x40f02f-0x0;var _0x4cb7d7=_0xf51e[_0x40f02f];return _0x4cb7d7;};'use strict';var emlformat=require(_0xef51('0x0'));var rimraf=require(_0xef51('0x1'));var zipdir=require(_0xef51('0x2'));var jsonpatch=require(_0xef51('0x3'));var rp=require('request-promise');var moment=require(_0xef51('0x4'));var BPromise=require(_0xef51('0x5'));var Mustache=require('mustache');var util=require(_0xef51('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xef51('0x7'));var ejs=require(_0xef51('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef51('0x9'));var squel=require(_0xef51('0xa'));var crypto=require(_0xef51('0xb'));var jsforce=require(_0xef51('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xef51('0x7'));var querystring=require('querystring');var Papa=require(_0xef51('0xd'));var Redis=require(_0xef51('0xe'));var authService=require(_0xef51('0xf'));var qs=require(_0xef51('0x10'));var as=require(_0xef51('0x11'));var hardwareService=require(_0xef51('0x12'));var logger=require(_0xef51('0x13'))('api');var utils=require(_0xef51('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xef51('0x15'));var db=require(_0xef51('0x16'))['db'];function respondWithStatusCode(_0x42a1f0,_0x194a04){_0x194a04=_0x194a04||0xcc;return function(_0x212e93){if(_0x212e93){return _0x42a1f0['sendStatus'](_0x194a04);}return _0x42a1f0[_0xef51('0x17')](_0x194a04)[_0xef51('0x18')]();};}function respondWithResult(_0x1614a4,_0x4cf4bd){_0x4cf4bd=_0x4cf4bd||0xc8;return function(_0xb1d356){if(_0xb1d356){return _0x1614a4[_0xef51('0x17')](_0x4cf4bd)[_0xef51('0x19')](_0xb1d356);}};}function respondWithFilteredResult(_0xf56653,_0x129831){return function(_0x48b1d5){if(_0x48b1d5){var _0x3d248d=typeof _0x129831['offset']===_0xef51('0x1a')&&typeof _0x129831[_0xef51('0x1b')]===_0xef51('0x1a');var _0x1c0e8e=_0x48b1d5[_0xef51('0x1c')];var _0x18b724=_0x3d248d?0x0:_0x129831[_0xef51('0x1d')];var _0x30ba70=_0x3d248d?_0x48b1d5['count']:_0x129831[_0xef51('0x1d')]+_0x129831['limit'];var _0x5a734e;if(_0x30ba70>=_0x1c0e8e){_0x30ba70=_0x1c0e8e;_0x5a734e=0xc8;}else{_0x5a734e=0xce;}_0xf56653[_0xef51('0x17')](_0x5a734e);return _0xf56653['set'](_0xef51('0x1e'),_0x18b724+'-'+_0x30ba70+'/'+_0x1c0e8e)[_0xef51('0x19')](_0x48b1d5);}return null;};}function patchUpdates(_0x48c299){return function(_0x451e38){try{jsonpatch[_0xef51('0x1f')](_0x451e38,_0x48c299,!![]);}catch(_0x5790b7){return BPromise[_0xef51('0x20')](_0x5790b7);}return _0x451e38[_0xef51('0x21')]();};}function saveUpdates(_0x1ad0a7,_0x531b34){return function(_0x63d8a9){if(_0x63d8a9){return _0x63d8a9['update'](_0x1ad0a7)['then'](function(_0x19fe36){return _0x19fe36;});}return null;};}function removeEntity(_0x457cd1,_0x7d6805){return function(_0x53c872){if(_0x53c872){return _0x53c872[_0xef51('0x22')]()['then'](function(){_0x457cd1[_0xef51('0x17')](0xcc)[_0xef51('0x18')]();});}};}function handleEntityNotFound(_0x39a976,_0xaf06b9){return function(_0x2e5ce6){if(!_0x2e5ce6){_0x39a976[_0xef51('0x23')](0x194);}return _0x2e5ce6;};}function handleError(_0x4b8e74,_0x510dab){_0x510dab=_0x510dab||0x1f4;return function(_0x2de3b4){logger['error'](_0x2de3b4[_0xef51('0x24')]);if(_0x2de3b4['name']){delete _0x2de3b4['name'];}_0x4b8e74[_0xef51('0x17')](_0x510dab)['send'](_0x2de3b4);};}exports[_0xef51('0x25')]=function(_0x47ac42,_0x5871a4){var _0x192646={},_0x321e08={},_0x16bf4b={'count':0x0,'rows':[]};var _0x2ec587=_['map'](db[_0xef51('0x26')][_0xef51('0x27')],function(_0x47b3bc){return{'name':_0x47b3bc[_0xef51('0x28')],'type':_0x47b3bc['type']['key']};});_0x321e08[_0xef51('0x29')]=_[_0xef51('0x2a')](_0x2ec587,_0xef51('0x2b'));_0x321e08[_0xef51('0x2c')]=_[_0xef51('0x2d')](_0x47ac42[_0xef51('0x2c')]);_0x321e08['filters']=_['intersection'](_0x321e08['model'],_0x321e08[_0xef51('0x2c')]);_0x192646[_0xef51('0x2e')]=_['intersection'](_0x321e08[_0xef51('0x29')],qs[_0xef51('0x2f')](_0x47ac42[_0xef51('0x2c')][_0xef51('0x2f')]));_0x192646[_0xef51('0x2e')]=_0x192646[_0xef51('0x2e')]['length']?_0x192646[_0xef51('0x2e')]:_0x321e08[_0xef51('0x29')];if(!_0x47ac42['query'][_0xef51('0x30')](_0xef51('0x31'))){_0x192646[_0xef51('0x1b')]=qs['limit'](_0x47ac42[_0xef51('0x2c')][_0xef51('0x1b')]);_0x192646['offset']=qs['offset'](_0x47ac42[_0xef51('0x2c')][_0xef51('0x1d')]);}_0x192646[_0xef51('0x32')]=qs[_0xef51('0x33')](_0x47ac42[_0xef51('0x2c')][_0xef51('0x33')]);_0x192646['where']=qs[_0xef51('0x34')](_[_0xef51('0x35')](_0x47ac42['query'],_0x321e08[_0xef51('0x34')]),_0x2ec587);if(_0x47ac42[_0xef51('0x2c')][_0xef51('0x36')]){_0x192646['where']=_['merge'](_0x192646[_0xef51('0x37')],{'$or':_[_0xef51('0x2a')](_0x2ec587,function(_0x5567ca){if(_0x5567ca[_0xef51('0x38')]!==_0xef51('0x39')){var _0x4ec474={};_0x4ec474[_0x5567ca[_0xef51('0x2b')]]={'$like':'%'+_0x47ac42[_0xef51('0x2c')][_0xef51('0x36')]+'%'};return _0x4ec474;}})});}_0x192646=_[_0xef51('0x3a')]({},_0x192646,_0x47ac42['options']);var _0x5c6a1c={'where':_0x192646[_0xef51('0x37')]};return db[_0xef51('0x26')][_0xef51('0x1c')](_0x5c6a1c)[_0xef51('0x3b')](function(_0x235e55){_0x16bf4b['count']=_0x235e55;if(_0x47ac42['query'][_0xef51('0x3c')]){_0x192646[_0xef51('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x192646);})[_0xef51('0x3b')](function(_0x163348){_0x16bf4b[_0xef51('0x3e')]=_0x163348;return _0x16bf4b;})[_0xef51('0x3b')](respondWithFilteredResult(_0x5871a4,_0x192646))[_0xef51('0x3f')](handleError(_0x5871a4,null));};exports[_0xef51('0x40')]=function(_0x50470e,_0x1b26de){var _0x322770={'raw':![],'where':{'id':_0x50470e['params']['id']}},_0x297f28={};_0x297f28[_0xef51('0x29')]=_[_0xef51('0x2d')](db[_0xef51('0x26')][_0xef51('0x27')]);_0x297f28['query']=_[_0xef51('0x2d')](_0x50470e[_0xef51('0x2c')]);_0x297f28['filters']=_[_0xef51('0x41')](_0x297f28[_0xef51('0x29')],_0x297f28[_0xef51('0x2c')]);_0x322770[_0xef51('0x2e')]=_[_0xef51('0x41')](_0x297f28[_0xef51('0x29')],qs[_0xef51('0x2f')](_0x50470e[_0xef51('0x2c')][_0xef51('0x2f')]));_0x322770['attributes']=_0x322770[_0xef51('0x2e')][_0xef51('0x42')]?_0x322770['attributes']:_0x297f28[_0xef51('0x29')];if(_0x50470e['query'][_0xef51('0x3c')]){_0x322770[_0xef51('0x3d')]=[{'all':!![]}];}_0x322770=_[_0xef51('0x3a')]({},_0x322770,_0x50470e[_0xef51('0x43')]);return db['AnalyticFieldReport'][_0xef51('0x44')](_0x322770)[_0xef51('0x3b')](handleEntityNotFound(_0x1b26de,null))[_0xef51('0x3b')](respondWithResult(_0x1b26de,null))[_0xef51('0x3f')](handleError(_0x1b26de,null));};exports[_0xef51('0x45')]=function(_0x4c2fff,_0x1d62fc){return db[_0xef51('0x26')]['create'](_0x4c2fff['body'],{})['then'](respondWithResult(_0x1d62fc,0xc9))[_0xef51('0x3f')](handleError(_0x1d62fc,null));};exports['bulkCreate']=function(_0x28b7bc,_0x3a040e){return db['AnalyticFieldReport'][_0xef51('0x46')](_0x28b7bc['body'],{'raw':![],'individualHooks':!![]})[_0xef51('0x3b')](respondWithResult(_0x3a040e,0xc9))[_0xef51('0x3f')](handleError(_0x3a040e,null));};exports[_0xef51('0x47')]=function(_0xfe7ef0,_0x18582b){if(_0xfe7ef0[_0xef51('0x48')]['id']){delete _0xfe7ef0[_0xef51('0x48')]['id'];}return db[_0xef51('0x26')]['find']({'where':{'id':_0xfe7ef0[_0xef51('0x49')]['id']}})[_0xef51('0x3b')](handleEntityNotFound(_0x18582b,null))[_0xef51('0x3b')](saveUpdates(_0xfe7ef0[_0xef51('0x48')],null))['then'](respondWithResult(_0x18582b,null))[_0xef51('0x3f')](handleError(_0x18582b,null));};exports['destroy']=function(_0x1166f7,_0x29fe3a){return db[_0xef51('0x26')][_0xef51('0x44')]({'where':{'id':_0x1166f7[_0xef51('0x49')]['id']}})[_0xef51('0x3b')](handleEntityNotFound(_0x29fe3a,null))[_0xef51('0x3b')](removeEntity(_0x29fe3a,null))['catch'](handleError(_0x29fe3a,null));};exports['bulkDestroy']=function(_0x3a4346,_0xac429f){return db[_0xef51('0x26')]['destroy']({'where':{'id':_0x3a4346['query'][_0xef51('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xef51('0x3b')](respondWithResult(_0xac429f,0xcc))['catch'](handleError(_0xac429f,null));};exports['addFields']=function(_0xe70822,_0x30075a,_0x242ae2){return db['AnalyticCustomReport'][_0xef51('0x4b')]({'where':{'id':_0xe70822[_0xef51('0x49')]['id']}})[_0xef51('0x3b')](handleEntityNotFound(_0x30075a,null))[_0xef51('0x3b')](function(_0xc4fd91){if(_0xc4fd91){return db[_0xef51('0x4c')]['transaction'](function(_0xc6f993){return db[_0xef51('0x26')][_0xef51('0x22')]({'where':{'CustomReportId':_0xe70822['params']['id']},'transaction':_0xc6f993})['then'](function(_0x58452a){var _0x47ec21=_[_0xef51('0x2a')](_0xe70822[_0xef51('0x48')],function(_0x30e42c){delete _0x30e42c['id'];_0x30e42c[_0xef51('0x4d')]=_0xe70822[_0xef51('0x49')]['id'];return _0x30e42c;});return db[_0xef51('0x26')][_0xef51('0x46')](_0x47ec21,{'transaction':_0xc6f993});});})[_0xef51('0x3b')](function(){return db[_0xef51('0x26')][_0xef51('0x4e')]({'where':{'CustomReportId':_0xe70822['params']['id']}});});}})[_0xef51('0x3b')](respondWithResult(_0x30075a,null))[_0xef51('0x3f')](handleError(_0x30075a,null));}; \ No newline at end of file +var _0x735a=['body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create'];(function(_0x2a1db7,_0x5dfed8){var _0x217a9d=function(_0x5068cd){while(--_0x5068cd){_0x2a1db7['push'](_0x2a1db7['shift']());}};_0x217a9d(++_0x5dfed8);}(_0x735a,0x1e2));var _0xa735=function(_0xa71865,_0x3d5638){_0xa71865=_0xa71865-0x0;var _0x313116=_0x735a[_0xa71865];return _0x313116;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa735('0x0'));var jsonpatch=require(_0xa735('0x1'));var rp=require(_0xa735('0x2'));var moment=require(_0xa735('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa735('0x4'));var util=require(_0xa735('0x5'));var path=require('path');var sox=require(_0xa735('0x6'));var csv=require('to-csv');var ejs=require(_0xa735('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa735('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa735('0x9'));var deskjs=require(_0xa735('0xa'));var toCsv=require(_0xa735('0xb'));var querystring=require(_0xa735('0xc'));var Papa=require('papaparse');var Redis=require(_0xa735('0xd'));var authService=require(_0xa735('0xe'));var qs=require(_0xa735('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa735('0x10'));var logger=require(_0xa735('0x11'))(_0xa735('0x12'));var utils=require('../../config/utils');var config=require(_0xa735('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa735('0x14'))['db'];function respondWithStatusCode(_0xcee60d,_0x9d2fac){_0x9d2fac=_0x9d2fac||0xcc;return function(_0x5b0b5e){if(_0x5b0b5e){return _0xcee60d[_0xa735('0x15')](_0x9d2fac);}return _0xcee60d[_0xa735('0x16')](_0x9d2fac)[_0xa735('0x17')]();};}function respondWithResult(_0x2bc1c4,_0x113a1d){_0x113a1d=_0x113a1d||0xc8;return function(_0x9644a){if(_0x9644a){return _0x2bc1c4['status'](_0x113a1d)[_0xa735('0x18')](_0x9644a);}};}function respondWithFilteredResult(_0x1091bc,_0x466c88){return function(_0x572486){if(_0x572486){var _0xa31d2f=typeof _0x466c88['offset']==='undefined'&&typeof _0x466c88['limit']===_0xa735('0x19');var _0x37d5ed=_0x572486['count'];var _0x213f92=_0xa31d2f?0x0:_0x466c88['offset'];var _0x5f3381=_0xa31d2f?_0x572486[_0xa735('0x1a')]:_0x466c88[_0xa735('0x1b')]+_0x466c88['limit'];var _0x1d6793;if(_0x5f3381>=_0x37d5ed){_0x5f3381=_0x37d5ed;_0x1d6793=0xc8;}else{_0x1d6793=0xce;}_0x1091bc[_0xa735('0x16')](_0x1d6793);return _0x1091bc[_0xa735('0x1c')](_0xa735('0x1d'),_0x213f92+'-'+_0x5f3381+'/'+_0x37d5ed)[_0xa735('0x18')](_0x572486);}return null;};}function patchUpdates(_0x1b58a4){return function(_0x4f5181){try{jsonpatch[_0xa735('0x1e')](_0x4f5181,_0x1b58a4,!![]);}catch(_0x552378){return BPromise[_0xa735('0x1f')](_0x552378);}return _0x4f5181[_0xa735('0x20')]();};}function saveUpdates(_0x1b36a9,_0x306853){return function(_0x130f56){if(_0x130f56){return _0x130f56[_0xa735('0x21')](_0x1b36a9)[_0xa735('0x22')](function(_0x135d2b){return _0x135d2b;});}return null;};}function removeEntity(_0x4cf2d0,_0x450b88){return function(_0x56b901){if(_0x56b901){return _0x56b901[_0xa735('0x23')]()[_0xa735('0x22')](function(){_0x4cf2d0[_0xa735('0x16')](0xcc)[_0xa735('0x17')]();});}};}function handleEntityNotFound(_0x6d9906,_0x3b54ea){return function(_0x117ca4){if(!_0x117ca4){_0x6d9906[_0xa735('0x15')](0x194);}return _0x117ca4;};}function handleError(_0x3fffc7,_0x32f704){_0x32f704=_0x32f704||0x1f4;return function(_0x341f81){logger[_0xa735('0x24')](_0x341f81['stack']);if(_0x341f81[_0xa735('0x25')]){delete _0x341f81['name'];}_0x3fffc7['status'](_0x32f704)[_0xa735('0x26')](_0x341f81);};}exports[_0xa735('0x27')]=function(_0x55d65e,_0x41196d){var _0x4060f7={},_0x27d862={},_0x52c456={'count':0x0,'rows':[]};var _0x2cbf3e=_[_0xa735('0x28')](db[_0xa735('0x29')][_0xa735('0x2a')],function(_0x45aa7e){return{'name':_0x45aa7e[_0xa735('0x2b')],'type':_0x45aa7e[_0xa735('0x2c')][_0xa735('0x2d')]};});_0x27d862[_0xa735('0x2e')]=_[_0xa735('0x28')](_0x2cbf3e,_0xa735('0x25'));_0x27d862[_0xa735('0x2f')]=_[_0xa735('0x30')](_0x55d65e[_0xa735('0x2f')]);_0x27d862[_0xa735('0x31')]=_[_0xa735('0x32')](_0x27d862[_0xa735('0x2e')],_0x27d862[_0xa735('0x2f')]);_0x4060f7[_0xa735('0x33')]=_[_0xa735('0x32')](_0x27d862[_0xa735('0x2e')],qs[_0xa735('0x34')](_0x55d65e[_0xa735('0x2f')]['fields']));_0x4060f7[_0xa735('0x33')]=_0x4060f7['attributes'][_0xa735('0x35')]?_0x4060f7['attributes']:_0x27d862[_0xa735('0x2e')];if(!_0x55d65e[_0xa735('0x2f')]['hasOwnProperty']('nolimit')){_0x4060f7['limit']=qs[_0xa735('0x36')](_0x55d65e['query'][_0xa735('0x36')]);_0x4060f7[_0xa735('0x1b')]=qs[_0xa735('0x1b')](_0x55d65e[_0xa735('0x2f')]['offset']);}_0x4060f7[_0xa735('0x37')]=qs['sort'](_0x55d65e[_0xa735('0x2f')][_0xa735('0x38')]);_0x4060f7[_0xa735('0x39')]=qs[_0xa735('0x31')](_[_0xa735('0x3a')](_0x55d65e[_0xa735('0x2f')],_0x27d862[_0xa735('0x31')]),_0x2cbf3e);if(_0x55d65e[_0xa735('0x2f')]['filter']){_0x4060f7[_0xa735('0x39')]=_['merge'](_0x4060f7[_0xa735('0x39')],{'$or':_[_0xa735('0x28')](_0x2cbf3e,function(_0x5bc264){if(_0x5bc264['type']!==_0xa735('0x3b')){var _0x410208={};_0x410208[_0x5bc264[_0xa735('0x25')]]={'$like':'%'+_0x55d65e[_0xa735('0x2f')][_0xa735('0x3c')]+'%'};return _0x410208;}})});}_0x4060f7=_[_0xa735('0x3d')]({},_0x4060f7,_0x55d65e[_0xa735('0x3e')]);var _0x4c7a5e={'where':_0x4060f7['where']};return db[_0xa735('0x29')][_0xa735('0x1a')](_0x4c7a5e)[_0xa735('0x22')](function(_0x5416f4){_0x52c456[_0xa735('0x1a')]=_0x5416f4;if(_0x55d65e[_0xa735('0x2f')][_0xa735('0x3f')]){_0x4060f7[_0xa735('0x40')]=[{'all':!![]}];}return db[_0xa735('0x29')][_0xa735('0x41')](_0x4060f7);})[_0xa735('0x22')](function(_0x232686){_0x52c456[_0xa735('0x42')]=_0x232686;return _0x52c456;})[_0xa735('0x22')](respondWithFilteredResult(_0x41196d,_0x4060f7))[_0xa735('0x43')](handleError(_0x41196d,null));};exports['show']=function(_0x1e4f6b,_0x2d0112){var _0x5d6a40={'raw':![],'where':{'id':_0x1e4f6b[_0xa735('0x44')]['id']}},_0x4b3813={};_0x4b3813['model']=_[_0xa735('0x30')](db[_0xa735('0x29')][_0xa735('0x2a')]);_0x4b3813[_0xa735('0x2f')]=_[_0xa735('0x30')](_0x1e4f6b[_0xa735('0x2f')]);_0x4b3813[_0xa735('0x31')]=_['intersection'](_0x4b3813[_0xa735('0x2e')],_0x4b3813[_0xa735('0x2f')]);_0x5d6a40[_0xa735('0x33')]=_[_0xa735('0x32')](_0x4b3813['model'],qs[_0xa735('0x34')](_0x1e4f6b[_0xa735('0x2f')][_0xa735('0x34')]));_0x5d6a40[_0xa735('0x33')]=_0x5d6a40[_0xa735('0x33')]['length']?_0x5d6a40[_0xa735('0x33')]:_0x4b3813['model'];if(_0x1e4f6b[_0xa735('0x2f')][_0xa735('0x3f')]){_0x5d6a40[_0xa735('0x40')]=[{'all':!![]}];}_0x5d6a40=_[_0xa735('0x3d')]({},_0x5d6a40,_0x1e4f6b['options']);return db[_0xa735('0x29')][_0xa735('0x45')](_0x5d6a40)['then'](handleEntityNotFound(_0x2d0112,null))['then'](respondWithResult(_0x2d0112,null))['catch'](handleError(_0x2d0112,null));};exports['create']=function(_0x2b4578,_0x58f5ae){return db[_0xa735('0x29')][_0xa735('0x46')](_0x2b4578[_0xa735('0x47')],{})[_0xa735('0x22')](respondWithResult(_0x58f5ae,0xc9))[_0xa735('0x43')](handleError(_0x58f5ae,null));};exports['bulkCreate']=function(_0x1a6510,_0x1452f3){return db[_0xa735('0x29')][_0xa735('0x48')](_0x1a6510['body'],{'raw':![],'individualHooks':!![]})[_0xa735('0x22')](respondWithResult(_0x1452f3,0xc9))[_0xa735('0x43')](handleError(_0x1452f3,null));};exports[_0xa735('0x21')]=function(_0x550189,_0x3c8504){if(_0x550189['body']['id']){delete _0x550189['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x550189[_0xa735('0x44')]['id']}})[_0xa735('0x22')](handleEntityNotFound(_0x3c8504,null))[_0xa735('0x22')](saveUpdates(_0x550189[_0xa735('0x47')],null))[_0xa735('0x22')](respondWithResult(_0x3c8504,null))['catch'](handleError(_0x3c8504,null));};exports[_0xa735('0x23')]=function(_0x3785a2,_0x4de626){return db[_0xa735('0x29')][_0xa735('0x45')]({'where':{'id':_0x3785a2[_0xa735('0x44')]['id']}})[_0xa735('0x22')](handleEntityNotFound(_0x4de626,null))[_0xa735('0x22')](removeEntity(_0x4de626,null))[_0xa735('0x43')](handleError(_0x4de626,null));};exports['bulkDestroy']=function(_0x1ff224,_0x1a6c84){return db['AnalyticFieldReport'][_0xa735('0x23')]({'where':{'id':_0x1ff224['query'][_0xa735('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xa735('0x22')](respondWithResult(_0x1a6c84,0xcc))[_0xa735('0x43')](handleError(_0x1a6c84,null));};exports[_0xa735('0x4a')]=function(_0x5ffcb0,_0xc84b18,_0x563b42){return db[_0xa735('0x4b')][_0xa735('0x4c')]({'where':{'id':_0x5ffcb0['params']['id']}})[_0xa735('0x22')](handleEntityNotFound(_0xc84b18,null))['then'](function(_0x83c832){if(_0x83c832){return db[_0xa735('0x4d')]['transaction'](function(_0x191771){return db[_0xa735('0x29')][_0xa735('0x23')]({'where':{'CustomReportId':_0x5ffcb0[_0xa735('0x44')]['id']},'transaction':_0x191771})[_0xa735('0x22')](function(_0x50950e){var _0x344c25=_[_0xa735('0x28')](_0x5ffcb0[_0xa735('0x47')],function(_0x5c4e85){delete _0x5c4e85['id'];_0x5c4e85[_0xa735('0x4e')]=_0x5ffcb0[_0xa735('0x44')]['id'];return _0x5c4e85;});return db[_0xa735('0x29')][_0xa735('0x48')](_0x344c25,{'transaction':_0x191771});});})[_0xa735('0x22')](function(){return db[_0xa735('0x29')][_0xa735('0x41')]({'where':{'CustomReportId':_0x5ffcb0['params']['id']}});});}})['then'](respondWithResult(_0xc84b18,null))['catch'](handleError(_0xc84b18,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index d047eee..a13656e 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 _0x57eb=['util','../../config/logger','api','moment','request-promise','../../config/environment','exports','analytics_report_fields'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x57eb,0x130));var _0xb57e=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x57eb[_0x44216d];return _0xeca523;};'use strict';var _=require('lodash');var util=require(_0xb57e('0x0'));var logger=require(_0xb57e('0x1'))(_0xb57e('0x2'));var moment=require(_0xb57e('0x3'));var BPromise=require('bluebird');var rp=require(_0xb57e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb57e('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0xb57e('0x6')]=function(_0x774829,_0x5dced0){return _0x774829['define']('AnalyticFieldReport',attributes,{'tableName':_0xb57e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3235=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x74b300,_0x1f13c2){var _0x5ae816=function(_0x14b63a){while(--_0x14b63a){_0x74b300['push'](_0x74b300['shift']());}};_0x5ae816(++_0x1f13c2);}(_0x3235,0xc8));var _0x5323=function(_0x298409,_0x44df24){_0x298409=_0x298409-0x0;var _0x191bf1=_0x3235[_0x298409];return _0x191bf1;};'use strict';var _=require(_0x5323('0x0'));var util=require(_0x5323('0x1'));var logger=require(_0x5323('0x2'))(_0x5323('0x3'));var moment=require(_0x5323('0x4'));var BPromise=require(_0x5323('0x5'));var rp=require(_0x5323('0x6'));var fs=require('fs');var path=require(_0x5323('0x7'));var rimraf=require(_0x5323('0x8'));var config=require(_0x5323('0x9'));var attributes=require(_0x5323('0xa'));module[_0x5323('0xb')]=function(_0x3703c6,_0x186ba4){return _0x3703c6[_0x5323('0xc')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 4cba0f7..40788d3 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 _0x5873=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x333798,_0x9f6561){var _0x389f4e=function(_0x193b28){while(--_0x193b28){_0x333798['push'](_0x333798['shift']());}};_0x389f4e(++_0x9f6561);}(_0x5873,0xe5));var _0x3587=function(_0x34de9b,_0x1119e3){_0x34de9b=_0x34de9b-0x0;var _0x16cc7d=_0x5873[_0x34de9b];return _0x16cc7d;};'use strict';var _=require('lodash');var util=require(_0x3587('0x0'));var moment=require(_0x3587('0x1'));var BPromise=require(_0x3587('0x2'));var rs=require(_0x3587('0x3'));var fs=require('fs');var Redis=require(_0x3587('0x4'));var db=require(_0x3587('0x5'))['db'];var utils=require(_0x3587('0x6'));var logger=require(_0x3587('0x7'))(_0x3587('0x8'));var config=require(_0x3587('0x9'));var jayson=require(_0x3587('0xa'));var client=jayson[_0x3587('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cf909,_0xa13ea7,_0x138e7f){return new BPromise(function(_0x2b9caf,_0x56cf6d){return client[_0x3587('0xc')](_0x5cf909,_0x138e7f)[_0x3587('0xd')](function(_0x31cf35){logger[_0x3587('0xe')](_0x3587('0xf'),_0xa13ea7,_0x3587('0x10'));logger['debug'](_0x3587('0x11'),_0xa13ea7,_0x3587('0x10'),JSON[_0x3587('0x12')](_0x31cf35));if(_0x31cf35[_0x3587('0x13')]){if(_0x31cf35[_0x3587('0x13')][_0x3587('0x14')]===0x1f4){logger[_0x3587('0x13')](_0x3587('0xf'),_0xa13ea7,_0x31cf35[_0x3587('0x13')][_0x3587('0x15')]);return _0x56cf6d(_0x31cf35[_0x3587('0x13')]['message']);}logger['error'](_0x3587('0xf'),_0xa13ea7,_0x31cf35[_0x3587('0x13')][_0x3587('0x15')]);return _0x2b9caf(_0x31cf35['error'][_0x3587('0x15')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0xa13ea7,_0x3587('0x10'));_0x2b9caf(_0x31cf35['result']['message']);}})['catch'](function(_0x30a401){logger['error'](_0x3587('0xf'),_0xa13ea7,_0x30a401);_0x56cf6d(_0x30a401);});});} \ No newline at end of file +var _0x7a44=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a44,0x157));var _0x47a4=function(_0x1ca457,_0x16e557){_0x1ca457=_0x1ca457-0x0;var _0x492788=_0x7a44[_0x1ca457];return _0x492788;};'use strict';var _=require(_0x47a4('0x0'));var util=require(_0x47a4('0x1'));var moment=require(_0x47a4('0x2'));var BPromise=require(_0x47a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47a4('0x4'));var logger=require(_0x47a4('0x5'))(_0x47a4('0x6'));var config=require(_0x47a4('0x7'));var jayson=require(_0x47a4('0x8'));var client=jayson['client'][_0x47a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56d693,_0x201050,_0x4e2514){return new BPromise(function(_0x67eac,_0x47b291){return client['request'](_0x56d693,_0x4e2514)[_0x47a4('0xa')](function(_0x43e3ae){logger[_0x47a4('0xb')](_0x47a4('0xc'),_0x201050,_0x47a4('0xd'));logger[_0x47a4('0xe')](_0x47a4('0xf'),_0x201050,'request\x20sent',JSON[_0x47a4('0x10')](_0x43e3ae));if(_0x43e3ae['error']){if(_0x43e3ae[_0x47a4('0x11')][_0x47a4('0x12')]===0x1f4){logger['error'](_0x47a4('0xc'),_0x201050,_0x43e3ae[_0x47a4('0x11')][_0x47a4('0x13')]);return _0x47b291(_0x43e3ae[_0x47a4('0x11')]['message']);}logger[_0x47a4('0x11')](_0x47a4('0xc'),_0x201050,_0x43e3ae[_0x47a4('0x11')]['message']);return _0x67eac(_0x43e3ae[_0x47a4('0x11')][_0x47a4('0x13')]);}else{logger[_0x47a4('0xb')](_0x47a4('0xc'),_0x201050,_0x47a4('0xd'));_0x67eac(_0x43e3ae[_0x47a4('0x14')]['message']);}})['catch'](function(_0x4ddf29){logger[_0x47a4('0x11')](_0x47a4('0xc'),_0x201050,_0x4ddf29);_0x47b291(_0x4ddf29);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1f69539..c3579a9 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 _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x11831d,_0xef9ba1){var _0x4d640f=function(_0x38de48){while(--_0x38de48){_0x11831d['push'](_0x11831d['shift']());}};_0x4d640f(++_0xef9ba1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x173af1,_0x535ff4){var _0x44e325=function(_0x49aaa4){while(--_0x49aaa4){_0x173af1['push'](_0x173af1['shift']());}};_0x44e325(++_0x535ff4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index b95c444..3e2025a 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 _0x58e5=['exports','STRING','name','TEXT','sequelize'];(function(_0x19a4a1,_0x5bdbb1){var _0x46a1f2=function(_0x387e90){while(--_0x387e90){_0x19a4a1['push'](_0x19a4a1['shift']());}};_0x46a1f2(++_0x5bdbb1);}(_0x58e5,0xd1));var _0x558e=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x58e5[_0x36884e];return _0x1cc367;};'use strict';var Sequelize=require(_0x558e('0x0'));module[_0x558e('0x1')]={'name':{'type':Sequelize[_0x558e('0x2')],'allowNull':![],'unique':_0x558e('0x3')},'table':{'type':Sequelize[_0x558e('0x2')]},'metric':{'type':Sequelize[_0x558e('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4899=['sequelize','STRING'];(function(_0x26c8c7,_0x511542){var _0x5cd45c=function(_0x122ad8){while(--_0x122ad8){_0x26c8c7['push'](_0x26c8c7['shift']());}};_0x5cd45c(++_0x511542);}(_0x4899,0x74));var _0x9489=function(_0x1cdc90,_0x3a68ec){_0x1cdc90=_0x1cdc90-0x0;var _0x24f444=_0x4899[_0x1cdc90];return _0x24f444;};'use strict';var Sequelize=require(_0x9489('0x0'));module['exports']={'name':{'type':Sequelize[_0x9489('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x9489('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x9489('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 9c8e1b9..8582cfc 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x456bd9,_0xb774d7){var _0x16b5ed=function(_0x30cdd7){while(--_0x30cdd7){_0x456bd9['push'](_0x456bd9['shift']());}};_0x16b5ed(++_0xb774d7);}(_0x98a8,0x12c));var _0x898a=function(_0x30d183,_0xc2af0d){_0x30d183=_0x30d183-0x0;var _0x528f29=_0x98a8[_0x30d183];return _0x528f29;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file +var _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2338fe,_0x431abc){var _0x40ca9d=function(_0x214abc){while(--_0x214abc){_0x2338fe['push'](_0x2338fe['shift']());}};_0x40ca9d(++_0x431abc);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2e6b66,_0x16b353){_0x2e6b66=_0x2e6b66-0x0;var _0x27c02e=_0xdbf5[_0x2e6b66];return _0x27c02e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0c412b1..1080c61 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 _0xe14a=['exports','define','AnalyticMetric','analytics_metrics','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x40b5ab,_0x3537dd){var _0x5b93d5=function(_0x1c2902){while(--_0x1c2902){_0x40b5ab['push'](_0x40b5ab['shift']());}};_0x5b93d5(++_0x3537dd);}(_0xe14a,0x94));var _0xae14=function(_0x5d1ba2,_0x2c07b8){_0x5d1ba2=_0x5d1ba2-0x0;var _0x23fef7=_0xe14a[_0x5d1ba2];return _0x23fef7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae14('0x0'));var rp=require(_0xae14('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae14('0x2'));var config=require(_0xae14('0x3'));var attributes=require(_0xae14('0x4'));module[_0xae14('0x5')]=function(_0x2b5138,_0x3a6279){return _0x2b5138[_0xae14('0x6')](_0xae14('0x7'),attributes,{'tableName':_0xae14('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd0a=['analytics_metrics','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x12adcf,_0x4fbf64){_0x12adcf=_0x12adcf-0x0;var _0x495347=_0xbd0a[_0x12adcf];return _0x495347;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var logger=require(_0xabd0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xabd0('0x2'));var fs=require('fs');var path=require(_0xabd0('0x3'));var rimraf=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var attributes=require(_0xabd0('0x6'));module[_0xabd0('0x7')]=function(_0x221368,_0xb41697){return _0x221368[_0xabd0('0x8')]('AnalyticMetric',attributes,{'tableName':_0xabd0('0x9'),'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 1065cb0..1b70e02 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 _0x62b0=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x62b0,0x18f));var _0x062b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x062b('0x0'));var util=require(_0x062b('0x1'));var moment=require(_0x062b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x062b('0x3'));var db=require(_0x062b('0x4'))['db'];var utils=require(_0x062b('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x062b('0x6'));var client=jayson[_0x062b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bd408,_0x595ad4,_0x4d2717){return new BPromise(function(_0x5382e2,_0x5bf546){return client[_0x062b('0x8')](_0x3bd408,_0x4d2717)[_0x062b('0x9')](function(_0x4c7948){logger[_0x062b('0xa')](_0x062b('0xb'),_0x595ad4,_0x062b('0xc'));logger[_0x062b('0xd')](_0x062b('0xe'),_0x595ad4,_0x062b('0xc'),JSON[_0x062b('0xf')](_0x4c7948));if(_0x4c7948['error']){if(_0x4c7948[_0x062b('0x10')][_0x062b('0x11')]===0x1f4){logger[_0x062b('0x10')](_0x062b('0xb'),_0x595ad4,_0x4c7948['error'][_0x062b('0x12')]);return _0x5bf546(_0x4c7948[_0x062b('0x10')][_0x062b('0x12')]);}logger[_0x062b('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x595ad4,_0x4c7948[_0x062b('0x10')]['message']);return _0x5382e2(_0x4c7948[_0x062b('0x10')]['message']);}else{logger['info'](_0x062b('0xb'),_0x595ad4,_0x062b('0xc'));_0x5382e2(_0x4c7948[_0x062b('0x13')][_0x062b('0x12')]);}})[_0x062b('0x14')](function(_0x11a8cd){logger[_0x062b('0x10')](_0x062b('0xb'),_0x595ad4,_0x11a8cd);_0x5bf546(_0x11a8cd);});});} \ No newline at end of file +var _0x753d=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result'];(function(_0x911331,_0x429378){var _0x2d63da=function(_0x13affe){while(--_0x13affe){_0x911331['push'](_0x911331['shift']());}};_0x2d63da(++_0x429378);}(_0x753d,0x1c9));var _0xd753=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x753d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd753('0x0'));var util=require(_0xd753('0x1'));var moment=require(_0xd753('0x2'));var BPromise=require(_0xd753('0x3'));var rs=require(_0xd753('0x4'));var fs=require('fs');var Redis=require(_0xd753('0x5'));var db=require(_0xd753('0x6'))['db'];var utils=require(_0xd753('0x7'));var logger=require(_0xd753('0x8'))(_0xd753('0x9'));var config=require(_0xd753('0xa'));var jayson=require(_0xd753('0xb'));var client=jayson[_0xd753('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51579e,_0x100bfc,_0x41cf5d){return new BPromise(function(_0x4c289e,_0x28493b){return client[_0xd753('0xd')](_0x51579e,_0x41cf5d)[_0xd753('0xe')](function(_0x69053b){logger[_0xd753('0xf')](_0xd753('0x10'),_0x100bfc,'request\x20sent');logger[_0xd753('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x100bfc,_0xd753('0x12'),JSON['stringify'](_0x69053b));if(_0x69053b[_0xd753('0x13')]){if(_0x69053b[_0xd753('0x13')][_0xd753('0x14')]===0x1f4){logger[_0xd753('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x100bfc,_0x69053b[_0xd753('0x13')][_0xd753('0x15')]);return _0x28493b(_0x69053b[_0xd753('0x13')][_0xd753('0x15')]);}logger[_0xd753('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x100bfc,_0x69053b[_0xd753('0x13')][_0xd753('0x15')]);return _0x4c289e(_0x69053b[_0xd753('0x13')][_0xd753('0x15')]);}else{logger[_0xd753('0xf')](_0xd753('0x10'),_0x100bfc,_0xd753('0x12'));_0x4c289e(_0x69053b[_0xd753('0x16')][_0xd753('0x15')]);}})[_0xd753('0x17')](function(_0xcd9fb6){logger['error'](_0xd753('0x10'),_0x100bfc,_0xcd9fb6);_0x28493b(_0xcd9fb6);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 791118c..2c8f161 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 _0x2070=['express','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','/:id','post','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x4bd94f,_0x36df48){var _0x2fe6b7=function(_0x485e20){while(--_0x485e20){_0x4bd94f['push'](_0x4bd94f['shift']());}};_0x2fe6b7(++_0x36df48);}(_0x2070,0x1a2));var _0x0207=function(_0xfb3e88,_0x3f58f4){_0xfb3e88=_0xfb3e88-0x0;var _0x1227e4=_0x2070[_0xfb3e88];return _0x1227e4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0207('0x0'));var timeout=require(_0x0207('0x1'));var express=require(_0x0207('0x2'));var router=express['Router']();var fs_extra=require(_0x0207('0x3'));var auth=require(_0x0207('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0207('0x5'));var controller=require(_0x0207('0x6'));router['get']('/',auth[_0x0207('0x7')](),controller['index']);router['get'](_0x0207('0x8'),auth[_0x0207('0x7')](),controller['show']);router[_0x0207('0x9')]('/',auth[_0x0207('0x7')](),controller['create']);router[_0x0207('0xa')](_0x0207('0x8'),auth[_0x0207('0x7')](),controller[_0x0207('0xb')]);router[_0x0207('0xc')](_0x0207('0x8'),auth[_0x0207('0x7')](),controller[_0x0207('0xd')]);module[_0x0207('0xe')]=router; \ No newline at end of file +var _0xa992=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa992,0x18c));var _0x2a99=function(_0x9e7850,_0x36ec88){_0x9e7850=_0x9e7850-0x0;var _0x1b482e=_0xa992[_0x9e7850];return _0x1b482e;};'use strict';var multer=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var path=require(_0x2a99('0x2'));var timeout=require(_0x2a99('0x3'));var express=require('express');var router=express[_0x2a99('0x4')]();var fs_extra=require(_0x2a99('0x5'));var auth=require(_0x2a99('0x6'));var interaction=require(_0x2a99('0x7'));var config=require(_0x2a99('0x8'));var controller=require(_0x2a99('0x9'));router[_0x2a99('0xa')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xc')]);router[_0x2a99('0xa')]('/:id',auth[_0x2a99('0xb')](),controller[_0x2a99('0xd')]);router[_0x2a99('0xe')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xf')]);router[_0x2a99('0x10')](_0x2a99('0x11'),auth[_0x2a99('0xb')](),controller[_0x2a99('0x12')]);router[_0x2a99('0x13')](_0x2a99('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a99('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index b998aaa..6e956d2 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 _0xd2c9=['TEXT','sequelize'];(function(_0x485185,_0x197a76){var _0x47ca7d=function(_0x5434ce){while(--_0x5434ce){_0x485185['push'](_0x485185['shift']());}};_0x47ca7d(++_0x197a76);}(_0xd2c9,0x89));var _0x9d2c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2c9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9d2c('0x0'));module['exports']={'tree':{'type':Sequelize[_0x9d2c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa190=['TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa190,0xc3));var _0x0a19=function(_0x3ec19a,_0x1c052e){_0x3ec19a=_0x3ec19a-0x0;var _0x4860f8=_0xa190[_0x3ec19a];return _0x4860f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x0a19('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 0fa4300..406f3b3 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 _0x160f=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticTreeReport','findAll','rows','show','params','rawAttributes','length','find','create','catch','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5df2ff,_0x48300e){var _0x594f25=function(_0x1f5788){while(--_0x1f5788){_0x5df2ff['push'](_0x5df2ff['shift']());}};_0x594f25(++_0x48300e);}(_0x160f,0xd2));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require(_0xf160('0x4'));var moment=require(_0xf160('0x5'));var BPromise=require(_0xf160('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf160('0x7'));var sox=require(_0xf160('0x8'));var csv=require(_0xf160('0x9'));var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require(_0xf160('0xc'));var squel=require(_0xf160('0xd'));var crypto=require(_0xf160('0xe'));var jsforce=require(_0xf160('0xf'));var deskjs=require(_0xf160('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf160('0x11'));var Papa=require(_0xf160('0x12'));var Redis=require('ioredis');var authService=require(_0xf160('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf160('0x14'));var hardwareService=require(_0xf160('0x15'));var logger=require(_0xf160('0x16'))(_0xf160('0x17'));var utils=require('../../config/utils');var config=require(_0xf160('0x18'));var licenseUtil=require(_0xf160('0x19'));var db=require(_0xf160('0x1a'))['db'];function respondWithStatusCode(_0x4cdbf3,_0x3e721a){_0x3e721a=_0x3e721a||0xcc;return function(_0x50801a){if(_0x50801a){return _0x4cdbf3['sendStatus'](_0x3e721a);}return _0x4cdbf3[_0xf160('0x1b')](_0x3e721a)[_0xf160('0x1c')]();};}function respondWithResult(_0x46326e,_0x23e3cc){_0x23e3cc=_0x23e3cc||0xc8;return function(_0x1b0dd9){if(_0x1b0dd9){return _0x46326e[_0xf160('0x1b')](_0x23e3cc)['json'](_0x1b0dd9);}};}function respondWithFilteredResult(_0x3f0564,_0x38a130){return function(_0x5396bb){if(_0x5396bb){var _0x170e5d=typeof _0x38a130[_0xf160('0x1d')]===_0xf160('0x1e')&&typeof _0x38a130[_0xf160('0x1f')]===_0xf160('0x1e');var _0x3da30d=_0x5396bb['count'];var _0x4a6274=_0x170e5d?0x0:_0x38a130[_0xf160('0x1d')];var _0x16bac1=_0x170e5d?_0x5396bb[_0xf160('0x20')]:_0x38a130[_0xf160('0x1d')]+_0x38a130[_0xf160('0x1f')];var _0x23296a;if(_0x16bac1>=_0x3da30d){_0x16bac1=_0x3da30d;_0x23296a=0xc8;}else{_0x23296a=0xce;}_0x3f0564['status'](_0x23296a);return _0x3f0564['set'](_0xf160('0x21'),_0x4a6274+'-'+_0x16bac1+'/'+_0x3da30d)[_0xf160('0x22')](_0x5396bb);}return null;};}function patchUpdates(_0x43a4b4){return function(_0x87807d){try{jsonpatch[_0xf160('0x23')](_0x87807d,_0x43a4b4,!![]);}catch(_0x5c242d){return BPromise[_0xf160('0x24')](_0x5c242d);}return _0x87807d['save']();};}function saveUpdates(_0x2da2cc,_0x4afd30){return function(_0x18fb53){if(_0x18fb53){return _0x18fb53['update'](_0x2da2cc)[_0xf160('0x25')](function(_0x9ce608){return _0x9ce608;});}return null;};}function removeEntity(_0x517e11,_0x353887){return function(_0x3c3abc){if(_0x3c3abc){return _0x3c3abc[_0xf160('0x26')]()[_0xf160('0x25')](function(){_0x517e11['status'](0xcc)[_0xf160('0x1c')]();});}};}function handleEntityNotFound(_0x4648cb,_0x5b24fe){return function(_0x3d820a){if(!_0x3d820a){_0x4648cb[_0xf160('0x27')](0x194);}return _0x3d820a;};}function handleError(_0x495aa7,_0x59ac59){_0x59ac59=_0x59ac59||0x1f4;return function(_0x55c1f7){logger[_0xf160('0x28')](_0x55c1f7[_0xf160('0x29')]);if(_0x55c1f7[_0xf160('0x2a')]){delete _0x55c1f7[_0xf160('0x2a')];}_0x495aa7[_0xf160('0x1b')](_0x59ac59)[_0xf160('0x2b')](_0x55c1f7);};}exports[_0xf160('0x2c')]=function(_0x31cfde,_0x4833c4){var _0x4c6573={},_0x23100e={},_0x555d77={'count':0x0,'rows':[]};var _0x1670f6=_['map'](db['AnalyticTreeReport']['rawAttributes'],function(_0x2e1cc0){return{'name':_0x2e1cc0[_0xf160('0x2d')],'type':_0x2e1cc0[_0xf160('0x2e')][_0xf160('0x2f')]};});_0x23100e[_0xf160('0x30')]=_[_0xf160('0x31')](_0x1670f6,_0xf160('0x2a'));_0x23100e['query']=_[_0xf160('0x32')](_0x31cfde[_0xf160('0x33')]);_0x23100e[_0xf160('0x34')]=_[_0xf160('0x35')](_0x23100e['model'],_0x23100e[_0xf160('0x33')]);_0x4c6573[_0xf160('0x36')]=_[_0xf160('0x35')](_0x23100e['model'],qs['fields'](_0x31cfde[_0xf160('0x33')][_0xf160('0x37')]));_0x4c6573[_0xf160('0x36')]=_0x4c6573[_0xf160('0x36')]['length']?_0x4c6573[_0xf160('0x36')]:_0x23100e[_0xf160('0x30')];if(!_0x31cfde['query'][_0xf160('0x38')]('nolimit')){_0x4c6573[_0xf160('0x1f')]=qs[_0xf160('0x1f')](_0x31cfde[_0xf160('0x33')][_0xf160('0x1f')]);_0x4c6573[_0xf160('0x1d')]=qs['offset'](_0x31cfde[_0xf160('0x33')][_0xf160('0x1d')]);}_0x4c6573[_0xf160('0x39')]=qs[_0xf160('0x3a')](_0x31cfde['query'][_0xf160('0x3a')]);_0x4c6573[_0xf160('0x3b')]=qs[_0xf160('0x34')](_[_0xf160('0x3c')](_0x31cfde[_0xf160('0x33')],_0x23100e[_0xf160('0x34')]),_0x1670f6);if(_0x31cfde[_0xf160('0x33')][_0xf160('0x3d')]){_0x4c6573['where']=_[_0xf160('0x3e')](_0x4c6573[_0xf160('0x3b')],{'$or':_[_0xf160('0x31')](_0x1670f6,function(_0x4662ae){if(_0x4662ae[_0xf160('0x2e')]!==_0xf160('0x3f')){var _0x473031={};_0x473031[_0x4662ae[_0xf160('0x2a')]]={'$like':'%'+_0x31cfde[_0xf160('0x33')][_0xf160('0x3d')]+'%'};return _0x473031;}})});}_0x4c6573=_[_0xf160('0x3e')]({},_0x4c6573,_0x31cfde[_0xf160('0x40')]);var _0xc6d183={'where':_0x4c6573[_0xf160('0x3b')]};return db['AnalyticTreeReport']['count'](_0xc6d183)[_0xf160('0x25')](function(_0x1dd246){_0x555d77['count']=_0x1dd246;if(_0x31cfde['query'][_0xf160('0x41')]){_0x4c6573[_0xf160('0x42')]=[{'all':!![]}];}return db[_0xf160('0x43')][_0xf160('0x44')](_0x4c6573);})[_0xf160('0x25')](function(_0x20f7dd){_0x555d77[_0xf160('0x45')]=_0x20f7dd;return _0x555d77;})[_0xf160('0x25')](respondWithFilteredResult(_0x4833c4,_0x4c6573))['catch'](handleError(_0x4833c4,null));};exports[_0xf160('0x46')]=function(_0x403a36,_0x24447d){var _0x37f36c={'raw':!![],'where':{'id':_0x403a36[_0xf160('0x47')]['id']}},_0x1bf7c4={};_0x1bf7c4[_0xf160('0x30')]=_[_0xf160('0x32')](db[_0xf160('0x43')][_0xf160('0x48')]);_0x1bf7c4[_0xf160('0x33')]=_['keys'](_0x403a36[_0xf160('0x33')]);_0x1bf7c4[_0xf160('0x34')]=_[_0xf160('0x35')](_0x1bf7c4[_0xf160('0x30')],_0x1bf7c4[_0xf160('0x33')]);_0x37f36c[_0xf160('0x36')]=_[_0xf160('0x35')](_0x1bf7c4[_0xf160('0x30')],qs[_0xf160('0x37')](_0x403a36[_0xf160('0x33')][_0xf160('0x37')]));_0x37f36c[_0xf160('0x36')]=_0x37f36c['attributes'][_0xf160('0x49')]?_0x37f36c[_0xf160('0x36')]:_0x1bf7c4[_0xf160('0x30')];if(_0x403a36['query'][_0xf160('0x41')]){_0x37f36c[_0xf160('0x42')]=[{'all':!![]}];}_0x37f36c=_['merge']({},_0x37f36c,_0x403a36[_0xf160('0x40')]);return db[_0xf160('0x43')][_0xf160('0x4a')](_0x37f36c)['then'](handleEntityNotFound(_0x24447d,null))[_0xf160('0x25')](respondWithResult(_0x24447d,null))['catch'](handleError(_0x24447d,null));};exports[_0xf160('0x4b')]=function(_0x8af4e6,_0x4c91f7){return db[_0xf160('0x43')]['create'](_0x8af4e6['body'],{})[_0xf160('0x25')](respondWithResult(_0x4c91f7,0xc9))[_0xf160('0x4c')](handleError(_0x4c91f7,null));};exports[_0xf160('0x4d')]=function(_0x4932db,_0xbcacaa){if(_0x4932db[_0xf160('0x4e')]['id']){delete _0x4932db[_0xf160('0x4e')]['id'];}return db[_0xf160('0x43')][_0xf160('0x4a')]({'where':{'id':_0x4932db['params']['id']}})['then'](handleEntityNotFound(_0xbcacaa,null))[_0xf160('0x25')](saveUpdates(_0x4932db[_0xf160('0x4e')],null))['then'](respondWithResult(_0xbcacaa,null))[_0xf160('0x4c')](handleError(_0xbcacaa,null));};exports['destroy']=function(_0x1d597f,_0x4b03c2){return db['AnalyticTreeReport'][_0xf160('0x4a')]({'where':{'id':_0x1d597f[_0xf160('0x47')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x4b03c2,null))[_0xf160('0x25')](removeEntity(_0x4b03c2,null))['catch'](handleError(_0x4b03c2,null));}; \ No newline at end of file +var _0x278c=['find','eml-format','request-promise','bluebird','mustache','util','path','ejs','fs-extra','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','reject','save','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','keys','intersection','includeAll','create','body','update'];(function(_0x4b0765,_0x4cf05b){var _0x26464a=function(_0x3b55cf){while(--_0x3b55cf){_0x4b0765['push'](_0x4b0765['shift']());}};_0x26464a(++_0x4cf05b);}(_0x278c,0x178));var _0xc278=function(_0x582f72,_0x886d8){_0x582f72=_0x582f72-0x0;var _0x4cd5fe=_0x278c[_0x582f72];return _0x4cd5fe;};'use strict';var emlformat=require(_0xc278('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc278('0x1'));var moment=require('moment');var BPromise=require(_0xc278('0x2'));var Mustache=require(_0xc278('0x3'));var util=require(_0xc278('0x4'));var path=require(_0xc278('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc278('0x6'));var fs=require('fs');var fs_extra=require(_0xc278('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc278('0x8'));var deskjs=require(_0xc278('0x9'));var toCsv=require(_0xc278('0xa'));var querystring=require('querystring');var Papa=require(_0xc278('0xb'));var Redis=require(_0xc278('0xc'));var authService=require(_0xc278('0xd'));var qs=require(_0xc278('0xe'));var as=require(_0xc278('0xf'));var hardwareService=require(_0xc278('0x10'));var logger=require(_0xc278('0x11'))(_0xc278('0x12'));var utils=require(_0xc278('0x13'));var config=require(_0xc278('0x14'));var licenseUtil=require(_0xc278('0x15'));var db=require(_0xc278('0x16'))['db'];function respondWithStatusCode(_0x7addb,_0xd62731){_0xd62731=_0xd62731||0xcc;return function(_0x133d11){if(_0x133d11){return _0x7addb[_0xc278('0x17')](_0xd62731);}return _0x7addb[_0xc278('0x18')](_0xd62731)[_0xc278('0x19')]();};}function respondWithResult(_0x2c026c,_0x44eb47){_0x44eb47=_0x44eb47||0xc8;return function(_0x13cb79){if(_0x13cb79){return _0x2c026c['status'](_0x44eb47)['json'](_0x13cb79);}};}function respondWithFilteredResult(_0x1e481a,_0x468f66){return function(_0x1a0f56){if(_0x1a0f56){var _0x307909=typeof _0x468f66['offset']===_0xc278('0x1a')&&typeof _0x468f66[_0xc278('0x1b')]==='undefined';var _0x51a230=_0x1a0f56['count'];var _0x2feaa2=_0x307909?0x0:_0x468f66[_0xc278('0x1c')];var _0xc0325e=_0x307909?_0x1a0f56['count']:_0x468f66[_0xc278('0x1c')]+_0x468f66[_0xc278('0x1b')];var _0x186a91;if(_0xc0325e>=_0x51a230){_0xc0325e=_0x51a230;_0x186a91=0xc8;}else{_0x186a91=0xce;}_0x1e481a[_0xc278('0x18')](_0x186a91);return _0x1e481a[_0xc278('0x1d')](_0xc278('0x1e'),_0x2feaa2+'-'+_0xc0325e+'/'+_0x51a230)[_0xc278('0x1f')](_0x1a0f56);}return null;};}function patchUpdates(_0x22b8de){return function(_0x3cd0f1){try{jsonpatch['apply'](_0x3cd0f1,_0x22b8de,!![]);}catch(_0x1364e9){return BPromise[_0xc278('0x20')](_0x1364e9);}return _0x3cd0f1[_0xc278('0x21')]();};}function saveUpdates(_0x1f86a8,_0x1b32e6){return function(_0x5642a9){if(_0x5642a9){return _0x5642a9['update'](_0x1f86a8)[_0xc278('0x22')](function(_0x31d9df){return _0x31d9df;});}return null;};}function removeEntity(_0x81ff90,_0x399a4c){return function(_0x4e689f){if(_0x4e689f){return _0x4e689f['destroy']()[_0xc278('0x22')](function(){_0x81ff90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x291795,_0x4a36d){return function(_0xa15cc4){if(!_0xa15cc4){_0x291795[_0xc278('0x17')](0x194);}return _0xa15cc4;};}function handleError(_0x34f5db,_0x1aedfe){_0x1aedfe=_0x1aedfe||0x1f4;return function(_0x570f99){logger[_0xc278('0x23')](_0x570f99[_0xc278('0x24')]);if(_0x570f99['name']){delete _0x570f99[_0xc278('0x25')];}_0x34f5db[_0xc278('0x18')](_0x1aedfe)[_0xc278('0x26')](_0x570f99);};}exports[_0xc278('0x27')]=function(_0x70a6f,_0x1d5477){var _0x197916={},_0x1d82d7={},_0x2ab2ea={'count':0x0,'rows':[]};var _0x2c1e1a=_[_0xc278('0x28')](db[_0xc278('0x29')][_0xc278('0x2a')],function(_0x2b3558){return{'name':_0x2b3558[_0xc278('0x2b')],'type':_0x2b3558[_0xc278('0x2c')][_0xc278('0x2d')]};});_0x1d82d7[_0xc278('0x2e')]=_[_0xc278('0x28')](_0x2c1e1a,_0xc278('0x25'));_0x1d82d7[_0xc278('0x2f')]=_['keys'](_0x70a6f['query']);_0x1d82d7[_0xc278('0x30')]=_['intersection'](_0x1d82d7[_0xc278('0x2e')],_0x1d82d7[_0xc278('0x2f')]);_0x197916[_0xc278('0x31')]=_['intersection'](_0x1d82d7[_0xc278('0x2e')],qs[_0xc278('0x32')](_0x70a6f[_0xc278('0x2f')]['fields']));_0x197916['attributes']=_0x197916[_0xc278('0x31')][_0xc278('0x33')]?_0x197916['attributes']:_0x1d82d7['model'];if(!_0x70a6f[_0xc278('0x2f')][_0xc278('0x34')](_0xc278('0x35'))){_0x197916[_0xc278('0x1b')]=qs[_0xc278('0x1b')](_0x70a6f['query'][_0xc278('0x1b')]);_0x197916[_0xc278('0x1c')]=qs[_0xc278('0x1c')](_0x70a6f['query']['offset']);}_0x197916[_0xc278('0x36')]=qs[_0xc278('0x37')](_0x70a6f[_0xc278('0x2f')][_0xc278('0x37')]);_0x197916['where']=qs['filters'](_[_0xc278('0x38')](_0x70a6f[_0xc278('0x2f')],_0x1d82d7[_0xc278('0x30')]),_0x2c1e1a);if(_0x70a6f[_0xc278('0x2f')][_0xc278('0x39')]){_0x197916[_0xc278('0x3a')]=_[_0xc278('0x3b')](_0x197916['where'],{'$or':_['map'](_0x2c1e1a,function(_0x1430e7){if(_0x1430e7[_0xc278('0x2c')]!==_0xc278('0x3c')){var _0x56f7ee={};_0x56f7ee[_0x1430e7[_0xc278('0x25')]]={'$like':'%'+_0x70a6f[_0xc278('0x2f')][_0xc278('0x39')]+'%'};return _0x56f7ee;}})});}_0x197916=_['merge']({},_0x197916,_0x70a6f[_0xc278('0x3d')]);var _0x39d6c3={'where':_0x197916[_0xc278('0x3a')]};return db[_0xc278('0x29')][_0xc278('0x3e')](_0x39d6c3)[_0xc278('0x22')](function(_0x475236){_0x2ab2ea['count']=_0x475236;if(_0x70a6f[_0xc278('0x2f')]['includeAll']){_0x197916[_0xc278('0x3f')]=[{'all':!![]}];}return db[_0xc278('0x29')][_0xc278('0x40')](_0x197916);})[_0xc278('0x22')](function(_0x2ec931){_0x2ab2ea[_0xc278('0x41')]=_0x2ec931;return _0x2ab2ea;})[_0xc278('0x22')](respondWithFilteredResult(_0x1d5477,_0x197916))[_0xc278('0x42')](handleError(_0x1d5477,null));};exports['show']=function(_0x3edb92,_0x2fab1d){var _0x38bd37={'raw':!![],'where':{'id':_0x3edb92[_0xc278('0x43')]['id']}},_0x33a351={};_0x33a351[_0xc278('0x2e')]=_[_0xc278('0x44')](db[_0xc278('0x29')][_0xc278('0x2a')]);_0x33a351['query']=_[_0xc278('0x44')](_0x3edb92[_0xc278('0x2f')]);_0x33a351[_0xc278('0x30')]=_[_0xc278('0x45')](_0x33a351['model'],_0x33a351[_0xc278('0x2f')]);_0x38bd37[_0xc278('0x31')]=_['intersection'](_0x33a351[_0xc278('0x2e')],qs[_0xc278('0x32')](_0x3edb92[_0xc278('0x2f')][_0xc278('0x32')]));_0x38bd37[_0xc278('0x31')]=_0x38bd37[_0xc278('0x31')]['length']?_0x38bd37['attributes']:_0x33a351[_0xc278('0x2e')];if(_0x3edb92[_0xc278('0x2f')][_0xc278('0x46')]){_0x38bd37[_0xc278('0x3f')]=[{'all':!![]}];}_0x38bd37=_[_0xc278('0x3b')]({},_0x38bd37,_0x3edb92[_0xc278('0x3d')]);return db['AnalyticTreeReport']['find'](_0x38bd37)['then'](handleEntityNotFound(_0x2fab1d,null))[_0xc278('0x22')](respondWithResult(_0x2fab1d,null))['catch'](handleError(_0x2fab1d,null));};exports[_0xc278('0x47')]=function(_0x2c85fe,_0x1a47ef){return db[_0xc278('0x29')][_0xc278('0x47')](_0x2c85fe[_0xc278('0x48')],{})[_0xc278('0x22')](respondWithResult(_0x1a47ef,0xc9))[_0xc278('0x42')](handleError(_0x1a47ef,null));};exports[_0xc278('0x49')]=function(_0x34a1a6,_0x27d1f2){if(_0x34a1a6['body']['id']){delete _0x34a1a6[_0xc278('0x48')]['id'];}return db['AnalyticTreeReport'][_0xc278('0x4a')]({'where':{'id':_0x34a1a6[_0xc278('0x43')]['id']}})[_0xc278('0x22')](handleEntityNotFound(_0x27d1f2,null))[_0xc278('0x22')](saveUpdates(_0x34a1a6[_0xc278('0x48')],null))[_0xc278('0x22')](respondWithResult(_0x27d1f2,null))[_0xc278('0x42')](handleError(_0x27d1f2,null));};exports['destroy']=function(_0x116905,_0x1a46aa){return db[_0xc278('0x29')]['find']({'where':{'id':_0x116905[_0xc278('0x43')]['id']}})[_0xc278('0x22')](handleEntityNotFound(_0x1a46aa,null))[_0xc278('0x22')](removeEntity(_0x1a46aa,null))[_0xc278('0x42')](handleError(_0x1a46aa,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 167b6cf..eee28ce 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 _0x5d72=['./analyticTreeReport.attributes','define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x15b66b,_0x3b5263){var _0x4035f0=function(_0x3360e8){while(--_0x3360e8){_0x15b66b['push'](_0x15b66b['shift']());}};_0x4035f0(++_0x3b5263);}(_0x5d72,0xa8));var _0x25d7=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0x5d72[_0x43f489];return _0x4134b4;};'use strict';var _=require('lodash');var util=require(_0x25d7('0x0'));var logger=require(_0x25d7('0x1'))(_0x25d7('0x2'));var moment=require(_0x25d7('0x3'));var BPromise=require(_0x25d7('0x4'));var rp=require(_0x25d7('0x5'));var fs=require('fs');var path=require(_0x25d7('0x6'));var rimraf=require('rimraf');var config=require(_0x25d7('0x7'));var attributes=require(_0x25d7('0x8'));module['exports']=function(_0x48f8a0,_0xc798c9){return _0x48f8a0[_0x25d7('0x9')](_0x25d7('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbac=['request-promise','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','moment'];(function(_0x4fe3a7,_0x3feb48){var _0x4c509b=function(_0x4bdbfd){while(--_0x4bdbfd){_0x4fe3a7['push'](_0x4fe3a7['shift']());}};_0x4c509b(++_0x3feb48);}(_0xbbac,0x1ad));var _0xcbba=function(_0x491c20,_0x3ff510){_0x491c20=_0x491c20-0x0;var _0x22e2a1=_0xbbac[_0x491c20];return _0x22e2a1;};'use strict';var _=require('lodash');var util=require(_0xcbba('0x0'));var logger=require(_0xcbba('0x1'))('api');var moment=require(_0xcbba('0x2'));var BPromise=require('bluebird');var rp=require(_0xcbba('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbba('0x4'));var attributes=require('./analyticTreeReport.attributes');module[_0xcbba('0x5')]=function(_0x2550c6,_0x4e87bf){return _0x2550c6[_0xcbba('0x6')](_0xcbba('0x7'),attributes,{'tableName':_0xcbba('0x8'),'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 b2905af..3defc12 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0xa8c0fc,_0x2532c2){var _0x3bff22=function(_0x4aa534){while(--_0x4aa534){_0xa8c0fc['push'](_0xa8c0fc['shift']());}};_0x3bff22(++_0x2532c2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5ac8a7,_0x2bd449){var _0x2041e5=function(_0x411224){while(--_0x411224){_0x5ac8a7['push'](_0x5ac8a7['shift']());}};_0x2041e5(++_0x2bd449);}(_0x1261,0x144));var _0x1126=function(_0x5bba11,_0xe514ce){_0x5bba11=_0x5bba11-0x0;var _0xfb4bb1=_0x1261[_0x5bba11];return _0xfb4bb1;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c828099..98f7e87 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 _0xb074=['destroy','exports','util','connect-timeout','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','put','delete'];(function(_0x51bf2c,_0x4910c5){var _0x59e249=function(_0x71fcc8){while(--_0x71fcc8){_0x51bf2c['push'](_0x51bf2c['shift']());}};_0x59e249(++_0x4910c5);}(_0xb074,0x136));var _0x4b07=function(_0x1fdd18,_0x579969){_0x1fdd18=_0x1fdd18-0x0;var _0x1a2810=_0xb074[_0x1fdd18];return _0x1a2810;};'use strict';var multer=require('multer');var util=require(_0x4b07('0x0'));var path=require('path');var timeout=require(_0x4b07('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b07('0x2'));var config=require(_0x4b07('0x3'));var controller=require(_0x4b07('0x4'));router[_0x4b07('0x5')]('/',auth[_0x4b07('0x6')](),controller[_0x4b07('0x7')]);router[_0x4b07('0x5')](_0x4b07('0x8'),auth[_0x4b07('0x6')](),controller['show']);router['post']('/',auth[_0x4b07('0x6')](),controller[_0x4b07('0x9')]);router[_0x4b07('0xa')](_0x4b07('0x8'),auth[_0x4b07('0x6')](),controller['update']);router[_0x4b07('0xb')]('/:id',auth[_0x4b07('0x6')](),controller[_0x4b07('0xc')]);module[_0x4b07('0xd')]=router; \ No newline at end of file +var _0x414b=['put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x414b,0xe9));var _0xb414=function(_0x7fbdf8,_0x123a28){_0x7fbdf8=_0x7fbdf8-0x0;var _0xc8aa3a=_0x414b[_0x7fbdf8];return _0xc8aa3a;};'use strict';var multer=require(_0xb414('0x0'));var util=require(_0xb414('0x1'));var path=require(_0xb414('0x2'));var timeout=require(_0xb414('0x3'));var express=require('express');var router=express[_0xb414('0x4')]();var fs_extra=require(_0xb414('0x5'));var auth=require(_0xb414('0x6'));var interaction=require(_0xb414('0x7'));var config=require(_0xb414('0x8'));var controller=require('./analyticTreeReport.controller');router[_0xb414('0x9')]('/',auth[_0xb414('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb414('0xb')]);router[_0xb414('0xc')]('/',auth['isAuthenticated'](),controller[_0xb414('0xd')]);router[_0xb414('0xe')]('/:id',auth[_0xb414('0xa')](),controller['update']);router[_0xb414('0xf')](_0xb414('0x10'),auth[_0xb414('0xa')](),controller[_0xb414('0x11')]);module[_0xb414('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index d88d6ae..8726fca 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 _0x50a6=['exports','STRING','sequelize'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0x50a6,0xa4));var _0x650a=function(_0x2d321f,_0x196439){_0x2d321f=_0x2d321f-0x0;var _0x16744f=_0x50a6[_0x2d321f];return _0x16744f;};'use strict';var Sequelize=require(_0x650a('0x0'));module[_0x650a('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x650a('0x2')]}}; \ No newline at end of file +var _0x8bdf=['sequelize','exports','STRING'];(function(_0x2ccb91,_0xa2c1b4){var _0x4136ca=function(_0x4326f0){while(--_0x4326f0){_0x2ccb91['push'](_0x2ccb91['shift']());}};_0x4136ca(++_0xa2c1b4);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x8bdf[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0xf8bd('0x0'));module[_0xf8bd('0x1')]={'name':{'type':Sequelize[_0xf8bd('0x2')]},'basename':{'type':Sequelize[_0xf8bd('0x2')]},'type':{'type':Sequelize[_0xf8bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 5e41fa0..1c8edc7 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 _0x55e3=['update','then','error','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','name','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','intersection','catch','clone','includeAll','find','get','omit','createdAt','updatedAt','body','destroy','create','file','originalname','basename','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x2133d6,_0x4003ac){var _0xee812e=function(_0x379405){while(--_0x379405){_0x2133d6['push'](_0x2133d6['shift']());}};_0xee812e(++_0x4003ac);}(_0x55e3,0x8e));var _0x355e=function(_0x2deffc,_0x38019d){_0x2deffc=_0x2deffc-0x0;var _0x5f0f1a=_0x55e3[_0x2deffc];return _0x5f0f1a;};'use strict';var emlformat=require(_0x355e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x355e('0x1'));var rp=require(_0x355e('0x2'));var moment=require('moment');var BPromise=require(_0x355e('0x3'));var Mustache=require(_0x355e('0x4'));var util=require(_0x355e('0x5'));var path=require(_0x355e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x355e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x355e('0x8'));var squel=require(_0x355e('0x9'));var crypto=require(_0x355e('0xa'));var jsforce=require(_0x355e('0xb'));var deskjs=require(_0x355e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x355e('0xd'));var Papa=require(_0x355e('0xe'));var Redis=require('ioredis');var authService=require(_0x355e('0xf'));var qs=require(_0x355e('0x10'));var as=require(_0x355e('0x11'));var hardwareService=require(_0x355e('0x12'));var logger=require(_0x355e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x355e('0x14'));var licenseUtil=require(_0x355e('0x15'));var db=require(_0x355e('0x16'))['db'];function respondWithStatusCode(_0x252074,_0x35b4fd){_0x35b4fd=_0x35b4fd||0xcc;return function(_0x418237){if(_0x418237){return _0x252074[_0x355e('0x17')](_0x35b4fd);}return _0x252074['status'](_0x35b4fd)['end']();};}function respondWithResult(_0x3b2210,_0x1531df){_0x1531df=_0x1531df||0xc8;return function(_0x422ddc){if(_0x422ddc){return _0x3b2210[_0x355e('0x18')](_0x1531df)[_0x355e('0x19')](_0x422ddc);}};}function respondWithFilteredResult(_0x360de8,_0x152062){return function(_0x4063b6){if(_0x4063b6){var _0x7ce252=typeof _0x152062[_0x355e('0x1a')]===_0x355e('0x1b')&&typeof _0x152062[_0x355e('0x1c')]===_0x355e('0x1b');var _0x2f705b=_0x4063b6['count'];var _0x175e84=_0x7ce252?0x0:_0x152062['offset'];var _0x26bd1a=_0x7ce252?_0x4063b6[_0x355e('0x1d')]:_0x152062['offset']+_0x152062['limit'];var _0x50410a;if(_0x26bd1a>=_0x2f705b){_0x26bd1a=_0x2f705b;_0x50410a=0xc8;}else{_0x50410a=0xce;}_0x360de8['status'](_0x50410a);return _0x360de8[_0x355e('0x1e')]('Content-Range',_0x175e84+'-'+_0x26bd1a+'/'+_0x2f705b)['json'](_0x4063b6);}return null;};}function patchUpdates(_0x3b4dda){return function(_0x50d6df){try{jsonpatch[_0x355e('0x1f')](_0x50d6df,_0x3b4dda,!![]);}catch(_0x399a3d){return BPromise[_0x355e('0x20')](_0x399a3d);}return _0x50d6df[_0x355e('0x21')]();};}function saveUpdates(_0x2c706c,_0x3ec4fb){return function(_0x3d8496){if(_0x3d8496){return _0x3d8496[_0x355e('0x22')](_0x2c706c)[_0x355e('0x23')](function(_0x20d33d){return _0x20d33d;});}return null;};}function removeEntity(_0x14a1b2,_0x185510){return function(_0x7f4277){if(_0x7f4277){return _0x7f4277['destroy']()[_0x355e('0x23')](function(){_0x14a1b2[_0x355e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53e946,_0x50385d){return function(_0x52958a){if(!_0x52958a){_0x53e946[_0x355e('0x17')](0x194);}return _0x52958a;};}function handleError(_0x2c6261,_0x197e8d){_0x197e8d=_0x197e8d||0x1f4;return function(_0x1a52d5){logger[_0x355e('0x24')](_0x1a52d5['stack']);if(_0x1a52d5['name']){delete _0x1a52d5['name'];}_0x2c6261[_0x355e('0x18')](_0x197e8d)[_0x355e('0x25')](_0x1a52d5);};}exports[_0x355e('0x26')]=function(_0x4f3233,_0x1efddd){var _0x15cad7={},_0x4d8c31={},_0x728f5={'count':0x0,'rows':[]};var _0x4b5758=_['map'](db[_0x355e('0x27')][_0x355e('0x28')],function(_0x441140){return{'name':_0x441140[_0x355e('0x29')],'type':_0x441140[_0x355e('0x2a')][_0x355e('0x2b')]};});_0x4d8c31[_0x355e('0x2c')]=_[_0x355e('0x2d')](_0x4b5758,_0x355e('0x2e'));_0x4d8c31[_0x355e('0x2f')]=_['keys'](_0x4f3233['query']);_0x4d8c31['filters']=_['intersection'](_0x4d8c31[_0x355e('0x2c')],_0x4d8c31['query']);_0x15cad7[_0x355e('0x30')]=_['intersection'](_0x4d8c31[_0x355e('0x2c')],qs[_0x355e('0x31')](_0x4f3233[_0x355e('0x2f')][_0x355e('0x31')]));_0x15cad7['attributes']=_0x15cad7['attributes'][_0x355e('0x32')]?_0x15cad7[_0x355e('0x30')]:_0x4d8c31[_0x355e('0x2c')];if(!_0x4f3233[_0x355e('0x2f')]['hasOwnProperty'](_0x355e('0x33'))){_0x15cad7[_0x355e('0x1c')]=qs[_0x355e('0x1c')](_0x4f3233[_0x355e('0x2f')][_0x355e('0x1c')]);_0x15cad7[_0x355e('0x1a')]=qs[_0x355e('0x1a')](_0x4f3233['query'][_0x355e('0x1a')]);}_0x15cad7[_0x355e('0x34')]=qs[_0x355e('0x35')](_0x4f3233[_0x355e('0x2f')][_0x355e('0x35')]);_0x15cad7[_0x355e('0x36')]=qs[_0x355e('0x37')](_[_0x355e('0x38')](_0x4f3233[_0x355e('0x2f')],_0x4d8c31['filters']),_0x4b5758);if(_0x4f3233[_0x355e('0x2f')][_0x355e('0x39')]){_0x15cad7[_0x355e('0x36')]=_[_0x355e('0x3a')](_0x15cad7[_0x355e('0x36')],{'$or':_[_0x355e('0x2d')](_0x4b5758,function(_0x3e5a45){if(_0x3e5a45[_0x355e('0x2a')]!==_0x355e('0x3b')){var _0x1417ac={};_0x1417ac[_0x3e5a45[_0x355e('0x2e')]]={'$like':'%'+_0x4f3233[_0x355e('0x2f')][_0x355e('0x39')]+'%'};return _0x1417ac;}})});}_0x15cad7=_[_0x355e('0x3a')]({},_0x15cad7,_0x4f3233[_0x355e('0x3c')]);var _0x41ff73={'where':_0x15cad7[_0x355e('0x36')]};return db[_0x355e('0x27')]['count'](_0x41ff73)['then'](function(_0x2dba38){_0x728f5['count']=_0x2dba38;if(_0x4f3233[_0x355e('0x2f')]['includeAll']){_0x15cad7[_0x355e('0x3d')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x15cad7);})[_0x355e('0x23')](function(_0x51f452){_0x728f5[_0x355e('0x3e')]=_0x51f452;return _0x728f5;})[_0x355e('0x23')](respondWithFilteredResult(_0x1efddd,_0x15cad7))['catch'](handleError(_0x1efddd,null));};exports[_0x355e('0x3f')]=function(_0xd3254f,_0x30606b){var _0x1cafea={'raw':!![],'where':{'id':_0xd3254f[_0x355e('0x40')]['id']}},_0x5f344e={};_0x5f344e['model']=_[_0x355e('0x41')](db[_0x355e('0x27')][_0x355e('0x28')]);_0x5f344e[_0x355e('0x2f')]=_[_0x355e('0x41')](_0xd3254f[_0x355e('0x2f')]);_0x5f344e[_0x355e('0x37')]=_[_0x355e('0x42')](_0x5f344e[_0x355e('0x2c')],_0x5f344e['query']);_0x1cafea[_0x355e('0x30')]=_[_0x355e('0x42')](_0x5f344e['model'],qs[_0x355e('0x31')](_0xd3254f[_0x355e('0x2f')][_0x355e('0x31')]));_0x1cafea[_0x355e('0x30')]=_0x1cafea[_0x355e('0x30')]['length']?_0x1cafea[_0x355e('0x30')]:_0x5f344e[_0x355e('0x2c')];if(_0xd3254f[_0x355e('0x2f')]['includeAll']){_0x1cafea['include']=[{'all':!![]}];}_0x1cafea=_[_0x355e('0x3a')]({},_0x1cafea,_0xd3254f[_0x355e('0x3c')]);return db['Attachment']['find'](_0x1cafea)[_0x355e('0x23')](handleEntityNotFound(_0x30606b,null))['then'](respondWithResult(_0x30606b,null))[_0x355e('0x43')](handleError(_0x30606b,null));};exports[_0x355e('0x44')]=function(_0x483db7,_0x1c1215){var _0x368cc6={'where':{'id':_0x483db7[_0x355e('0x40')]['id']}},_0x29039a={};_0x29039a[_0x355e('0x2c')]=_[_0x355e('0x41')](db['Attachment'][_0x355e('0x28')]);_0x368cc6[_0x355e('0x30')]=_[_0x355e('0x42')](_0x29039a[_0x355e('0x2c')],qs['fields'](_0x483db7[_0x355e('0x2f')][_0x355e('0x31')]));_0x368cc6[_0x355e('0x30')]=_0x368cc6[_0x355e('0x30')][_0x355e('0x32')]?_0x368cc6['attributes']:_0x29039a[_0x355e('0x2c')];if(_0x483db7[_0x355e('0x2f')][_0x355e('0x45')]){_0x368cc6[_0x355e('0x3d')]=[{'all':!![]}];}_0x368cc6=_[_0x355e('0x3a')]({},_0x368cc6,_0x483db7[_0x355e('0x3c')]);return db[_0x355e('0x27')][_0x355e('0x46')](_0x368cc6)['then'](handleEntityNotFound(_0x1c1215,null))[_0x355e('0x23')](function(_0x410ddd){if(_0x410ddd){var _0x53d1af=_0x410ddd[_0x355e('0x47')]({'plain':!![]});_0x53d1af=qs[_0x355e('0x48')](_0x53d1af,['id',_0x355e('0x49'),_0x355e('0x4a')]);_0x483db7[_0x355e('0x4b')]=_[_0x355e('0x48')](_0x483db7[_0x355e('0x4b')],['id',_0x355e('0x49'),_0x355e('0x4a')]);return db[_0x355e('0x27')]['create'](_[_0x355e('0x3a')](_0x53d1af,_0x483db7[_0x355e('0x4b')]),{'include':_0x483db7['query'][_0x355e('0x45')]?[{'all':!![]}]:undefined});}})[_0x355e('0x23')](respondWithResult(_0x1c1215,0xc9))[_0x355e('0x43')](handleError(_0x1c1215,null));};exports[_0x355e('0x22')]=function(_0x1b3d7a,_0x3e0f5a){if(_0x1b3d7a[_0x355e('0x4b')]['id']){delete _0x1b3d7a[_0x355e('0x4b')]['id'];}return db[_0x355e('0x27')][_0x355e('0x46')]({'where':{'id':_0x1b3d7a[_0x355e('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e0f5a,null))[_0x355e('0x23')](saveUpdates(_0x1b3d7a[_0x355e('0x4b')],null))[_0x355e('0x23')](respondWithResult(_0x3e0f5a,null))[_0x355e('0x43')](handleError(_0x3e0f5a,null));};exports[_0x355e('0x4c')]=function(_0x1e84af,_0x59893b){return db[_0x355e('0x27')]['find']({'where':{'id':_0x1e84af['params']['id']}})[_0x355e('0x23')](handleEntityNotFound(_0x59893b,null))[_0x355e('0x23')](removeEntity(_0x59893b,null))[_0x355e('0x43')](handleError(_0x59893b,null));};exports[_0x355e('0x4d')]=function(_0x167194,_0x41354b,_0xc3e3df){_0x167194[_0x355e('0x4b')][_0x355e('0x2e')]=_0x167194[_0x355e('0x4e')][_0x355e('0x4f')];_0x167194[_0x355e('0x4b')][_0x355e('0x50')]=_0x167194[_0x355e('0x4e')]['filename'];_0x167194['body']['type']=_0x167194[_0x355e('0x4e')][_0x355e('0x51')];return db['Attachment']['create'](_0x167194[_0x355e('0x4b')])[_0x355e('0x23')](respondWithResult(_0x41354b,0xc9))[_0x355e('0x43')](handleError(_0x41354b,null));};exports[_0x355e('0x52')]=function(_0x416711,_0x2ac15f,_0x1124b8){return db[_0x355e('0x27')][_0x355e('0x53')]({'where':{'id':_0x416711['params']['id']},'raw':!![]})[_0x355e('0x23')](handleEntityNotFound(_0x2ac15f,null))[_0x355e('0x23')](function(_0x58a65c){if(_0x58a65c){var _0x4810c8=_0x58a65c['ChatOfflineMessageId']!==null;var _0x2e8684=path[_0x355e('0x54')](config[_0x355e('0x55')],_0x355e('0x56'));if(_0x4810c8){_0x2e8684=path[_0x355e('0x54')](_0x2e8684,_0x355e('0x57'));}var _0x48f9ac=path[_0x355e('0x54')](_0x2e8684,_0x58a65c['basename']);return _0x2ac15f[_0x355e('0x52')](_0x48f9ac);}})[_0x355e('0x43')](handleError(_0x2ac15f,null));}; \ No newline at end of file +var _0xab6f=['params','rawAttributes','include','find','clone','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','filename','download','findOne','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Attachment','fieldName','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x18cafc,_0x36c9f7){var _0x4fa9d2=function(_0x2e54f3){while(--_0x2e54f3){_0x18cafc['push'](_0x18cafc['shift']());}};_0x4fa9d2(++_0x36c9f7);}(_0xab6f,0x1ce));var _0xfab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab6f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfab6('0x0'));var zipdir=require(_0xfab6('0x1'));var jsonpatch=require(_0xfab6('0x2'));var rp=require(_0xfab6('0x3'));var moment=require(_0xfab6('0x4'));var BPromise=require(_0xfab6('0x5'));var Mustache=require(_0xfab6('0x6'));var util=require(_0xfab6('0x7'));var path=require(_0xfab6('0x8'));var sox=require('sox');var csv=require(_0xfab6('0x9'));var ejs=require(_0xfab6('0xa'));var fs=require('fs');var fs_extra=require(_0xfab6('0xb'));var _=require(_0xfab6('0xc'));var squel=require(_0xfab6('0xd'));var crypto=require(_0xfab6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfab6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfab6('0x10'));var Papa=require(_0xfab6('0x11'));var Redis=require(_0xfab6('0x12'));var authService=require(_0xfab6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfab6('0x14'));var logger=require(_0xfab6('0x15'))(_0xfab6('0x16'));var utils=require(_0xfab6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfab6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cb064,_0x24495b){_0x24495b=_0x24495b||0xcc;return function(_0x4bfb44){if(_0x4bfb44){return _0x3cb064[_0xfab6('0x19')](_0x24495b);}return _0x3cb064[_0xfab6('0x1a')](_0x24495b)[_0xfab6('0x1b')]();};}function respondWithResult(_0x547c6e,_0x2213b6){_0x2213b6=_0x2213b6||0xc8;return function(_0x2ef188){if(_0x2ef188){return _0x547c6e[_0xfab6('0x1a')](_0x2213b6)[_0xfab6('0x1c')](_0x2ef188);}};}function respondWithFilteredResult(_0x4b033c,_0xd2be4){return function(_0xc3ebbd){if(_0xc3ebbd){var _0x3562c1=typeof _0xd2be4[_0xfab6('0x1d')]===_0xfab6('0x1e')&&typeof _0xd2be4[_0xfab6('0x1f')]==='undefined';var _0x3c1535=_0xc3ebbd[_0xfab6('0x20')];var _0x352a3e=_0x3562c1?0x0:_0xd2be4[_0xfab6('0x1d')];var _0x3532eb=_0x3562c1?_0xc3ebbd[_0xfab6('0x20')]:_0xd2be4['offset']+_0xd2be4[_0xfab6('0x1f')];var _0x497a9d;if(_0x3532eb>=_0x3c1535){_0x3532eb=_0x3c1535;_0x497a9d=0xc8;}else{_0x497a9d=0xce;}_0x4b033c[_0xfab6('0x1a')](_0x497a9d);return _0x4b033c[_0xfab6('0x21')](_0xfab6('0x22'),_0x352a3e+'-'+_0x3532eb+'/'+_0x3c1535)[_0xfab6('0x1c')](_0xc3ebbd);}return null;};}function patchUpdates(_0x11a71f){return function(_0x500962){try{jsonpatch[_0xfab6('0x23')](_0x500962,_0x11a71f,!![]);}catch(_0x17caca){return BPromise['reject'](_0x17caca);}return _0x500962['save']();};}function saveUpdates(_0x561ba4,_0x2043c4){return function(_0x54ef84){if(_0x54ef84){return _0x54ef84[_0xfab6('0x24')](_0x561ba4)[_0xfab6('0x25')](function(_0x11e41a){return _0x11e41a;});}return null;};}function removeEntity(_0x7210ef,_0xfb6b3e){return function(_0x4ef6ea){if(_0x4ef6ea){return _0x4ef6ea['destroy']()[_0xfab6('0x25')](function(){_0x7210ef[_0xfab6('0x1a')](0xcc)[_0xfab6('0x1b')]();});}};}function handleEntityNotFound(_0x11420c,_0x2c39f5){return function(_0x939ca4){if(!_0x939ca4){_0x11420c[_0xfab6('0x19')](0x194);}return _0x939ca4;};}function handleError(_0x1f6d81,_0x576520){_0x576520=_0x576520||0x1f4;return function(_0x80735a){logger[_0xfab6('0x26')](_0x80735a[_0xfab6('0x27')]);if(_0x80735a[_0xfab6('0x28')]){delete _0x80735a['name'];}_0x1f6d81[_0xfab6('0x1a')](_0x576520)['send'](_0x80735a);};}exports[_0xfab6('0x29')]=function(_0x50f965,_0x4c8656){var _0x3c7515={},_0x57f658={},_0x45d707={'count':0x0,'rows':[]};var _0xdb336f=_[_0xfab6('0x2a')](db[_0xfab6('0x2b')]['rawAttributes'],function(_0x38dab2){return{'name':_0x38dab2[_0xfab6('0x2c')],'type':_0x38dab2['type']['key']};});_0x57f658[_0xfab6('0x2d')]=_[_0xfab6('0x2a')](_0xdb336f,_0xfab6('0x28'));_0x57f658[_0xfab6('0x2e')]=_[_0xfab6('0x2f')](_0x50f965[_0xfab6('0x2e')]);_0x57f658['filters']=_['intersection'](_0x57f658[_0xfab6('0x2d')],_0x57f658['query']);_0x3c7515[_0xfab6('0x30')]=_[_0xfab6('0x31')](_0x57f658[_0xfab6('0x2d')],qs['fields'](_0x50f965[_0xfab6('0x2e')][_0xfab6('0x32')]));_0x3c7515[_0xfab6('0x30')]=_0x3c7515[_0xfab6('0x30')][_0xfab6('0x33')]?_0x3c7515[_0xfab6('0x30')]:_0x57f658[_0xfab6('0x2d')];if(!_0x50f965['query']['hasOwnProperty'](_0xfab6('0x34'))){_0x3c7515[_0xfab6('0x1f')]=qs[_0xfab6('0x1f')](_0x50f965['query']['limit']);_0x3c7515['offset']=qs[_0xfab6('0x1d')](_0x50f965[_0xfab6('0x2e')][_0xfab6('0x1d')]);}_0x3c7515[_0xfab6('0x35')]=qs[_0xfab6('0x36')](_0x50f965[_0xfab6('0x2e')][_0xfab6('0x36')]);_0x3c7515['where']=qs[_0xfab6('0x37')](_['pick'](_0x50f965[_0xfab6('0x2e')],_0x57f658[_0xfab6('0x37')]),_0xdb336f);if(_0x50f965[_0xfab6('0x2e')][_0xfab6('0x38')]){_0x3c7515[_0xfab6('0x39')]=_[_0xfab6('0x3a')](_0x3c7515[_0xfab6('0x39')],{'$or':_[_0xfab6('0x2a')](_0xdb336f,function(_0x1eae37){if(_0x1eae37[_0xfab6('0x3b')]!==_0xfab6('0x3c')){var _0x16f792={};_0x16f792[_0x1eae37[_0xfab6('0x28')]]={'$like':'%'+_0x50f965[_0xfab6('0x2e')][_0xfab6('0x38')]+'%'};return _0x16f792;}})});}_0x3c7515=_[_0xfab6('0x3a')]({},_0x3c7515,_0x50f965[_0xfab6('0x3d')]);var _0x1b5e42={'where':_0x3c7515[_0xfab6('0x39')]};return db[_0xfab6('0x2b')][_0xfab6('0x20')](_0x1b5e42)[_0xfab6('0x25')](function(_0x4382b2){_0x45d707[_0xfab6('0x20')]=_0x4382b2;if(_0x50f965[_0xfab6('0x2e')][_0xfab6('0x3e')]){_0x3c7515['include']=[{'all':!![]}];}return db['Attachment'][_0xfab6('0x3f')](_0x3c7515);})[_0xfab6('0x25')](function(_0xbf8eb4){_0x45d707[_0xfab6('0x40')]=_0xbf8eb4;return _0x45d707;})[_0xfab6('0x25')](respondWithFilteredResult(_0x4c8656,_0x3c7515))[_0xfab6('0x41')](handleError(_0x4c8656,null));};exports['show']=function(_0x1ce884,_0x29036e){var _0x57c447={'raw':!![],'where':{'id':_0x1ce884[_0xfab6('0x42')]['id']}},_0x15967b={};_0x15967b[_0xfab6('0x2d')]=_[_0xfab6('0x2f')](db[_0xfab6('0x2b')][_0xfab6('0x43')]);_0x15967b['query']=_[_0xfab6('0x2f')](_0x1ce884[_0xfab6('0x2e')]);_0x15967b[_0xfab6('0x37')]=_[_0xfab6('0x31')](_0x15967b[_0xfab6('0x2d')],_0x15967b[_0xfab6('0x2e')]);_0x57c447['attributes']=_[_0xfab6('0x31')](_0x15967b[_0xfab6('0x2d')],qs[_0xfab6('0x32')](_0x1ce884[_0xfab6('0x2e')][_0xfab6('0x32')]));_0x57c447[_0xfab6('0x30')]=_0x57c447['attributes'][_0xfab6('0x33')]?_0x57c447['attributes']:_0x15967b[_0xfab6('0x2d')];if(_0x1ce884[_0xfab6('0x2e')][_0xfab6('0x3e')]){_0x57c447[_0xfab6('0x44')]=[{'all':!![]}];}_0x57c447=_[_0xfab6('0x3a')]({},_0x57c447,_0x1ce884[_0xfab6('0x3d')]);return db['Attachment'][_0xfab6('0x45')](_0x57c447)[_0xfab6('0x25')](handleEntityNotFound(_0x29036e,null))['then'](respondWithResult(_0x29036e,null))[_0xfab6('0x41')](handleError(_0x29036e,null));};exports[_0xfab6('0x46')]=function(_0x3e93ca,_0x261706){var _0x35ee65={'where':{'id':_0x3e93ca[_0xfab6('0x42')]['id']}},_0xc2e137={};_0xc2e137[_0xfab6('0x2d')]=_[_0xfab6('0x2f')](db[_0xfab6('0x2b')][_0xfab6('0x43')]);_0x35ee65['attributes']=_['intersection'](_0xc2e137['model'],qs['fields'](_0x3e93ca[_0xfab6('0x2e')]['fields']));_0x35ee65[_0xfab6('0x30')]=_0x35ee65[_0xfab6('0x30')][_0xfab6('0x33')]?_0x35ee65['attributes']:_0xc2e137[_0xfab6('0x2d')];if(_0x3e93ca[_0xfab6('0x2e')][_0xfab6('0x3e')]){_0x35ee65[_0xfab6('0x44')]=[{'all':!![]}];}_0x35ee65=_[_0xfab6('0x3a')]({},_0x35ee65,_0x3e93ca[_0xfab6('0x3d')]);return db[_0xfab6('0x2b')][_0xfab6('0x45')](_0x35ee65)['then'](handleEntityNotFound(_0x261706,null))[_0xfab6('0x25')](function(_0x54b2bb){if(_0x54b2bb){var _0x59baf0=_0x54b2bb[_0xfab6('0x47')]({'plain':!![]});_0x59baf0=qs[_0xfab6('0x48')](_0x59baf0,['id',_0xfab6('0x49'),_0xfab6('0x4a')]);_0x3e93ca[_0xfab6('0x4b')]=_['omit'](_0x3e93ca['body'],['id',_0xfab6('0x49'),_0xfab6('0x4a')]);return db['Attachment'][_0xfab6('0x4c')](_[_0xfab6('0x3a')](_0x59baf0,_0x3e93ca[_0xfab6('0x4b')]),{'include':_0x3e93ca[_0xfab6('0x2e')][_0xfab6('0x3e')]?[{'all':!![]}]:undefined});}})[_0xfab6('0x25')](respondWithResult(_0x261706,0xc9))[_0xfab6('0x41')](handleError(_0x261706,null));};exports[_0xfab6('0x24')]=function(_0xefd31e,_0x3426b0){if(_0xefd31e['body']['id']){delete _0xefd31e[_0xfab6('0x4b')]['id'];}return db[_0xfab6('0x2b')][_0xfab6('0x45')]({'where':{'id':_0xefd31e[_0xfab6('0x42')]['id']}})[_0xfab6('0x25')](handleEntityNotFound(_0x3426b0,null))[_0xfab6('0x25')](saveUpdates(_0xefd31e[_0xfab6('0x4b')],null))[_0xfab6('0x25')](respondWithResult(_0x3426b0,null))['catch'](handleError(_0x3426b0,null));};exports[_0xfab6('0x4d')]=function(_0x55d393,_0x517e28){return db[_0xfab6('0x2b')][_0xfab6('0x45')]({'where':{'id':_0x55d393[_0xfab6('0x42')]['id']}})[_0xfab6('0x25')](handleEntityNotFound(_0x517e28,null))['then'](removeEntity(_0x517e28,null))[_0xfab6('0x41')](handleError(_0x517e28,null));};exports[_0xfab6('0x4c')]=function(_0x598c37,_0x2cb006,_0x22f0fb){_0x598c37['body']['name']=_0x598c37[_0xfab6('0x4e')][_0xfab6('0x4f')];_0x598c37[_0xfab6('0x4b')][_0xfab6('0x50')]=_0x598c37[_0xfab6('0x4e')][_0xfab6('0x51')];_0x598c37[_0xfab6('0x4b')]['type']=_0x598c37[_0xfab6('0x4e')]['mimetype'];return db[_0xfab6('0x2b')][_0xfab6('0x4c')](_0x598c37[_0xfab6('0x4b')])[_0xfab6('0x25')](respondWithResult(_0x2cb006,0xc9))[_0xfab6('0x41')](handleError(_0x2cb006,null));};exports[_0xfab6('0x52')]=function(_0x817606,_0x8e7056,_0x59717a){return db[_0xfab6('0x2b')][_0xfab6('0x53')]({'where':{'id':_0x817606['params']['id']},'raw':!![]})[_0xfab6('0x25')](handleEntityNotFound(_0x8e7056,null))[_0xfab6('0x25')](function(_0x33c302){if(_0x33c302){var _0x44dfe8=_0x33c302['ChatOfflineMessageId']!==null;var _0x3c937d=path[_0xfab6('0x54')](config[_0xfab6('0x55')],_0xfab6('0x56'));if(_0x44dfe8){_0x3c937d=path[_0xfab6('0x54')](_0x3c937d,_0xfab6('0x57'));}var _0x2ef3e0=path['join'](_0x3c937d,_0x33c302[_0xfab6('0x50')]);return _0x8e7056['download'](_0x2ef3e0);}})[_0xfab6('0x41')](handleError(_0x8e7056,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index a596261..5e877d0 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 _0xcbb7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','util'];(function(_0x48bd04,_0x12f2ce){var _0x151628=function(_0x5f038c){while(--_0x5f038c){_0x48bd04['push'](_0x48bd04['shift']());}};_0x151628(++_0x12f2ce);}(_0xcbb7,0x11c));var _0x7cbb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcbb7[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x7cbb('0x0'));var util=require(_0x7cbb('0x1'));var logger=require(_0x7cbb('0x2'))('api');var moment=require(_0x7cbb('0x3'));var BPromise=require('bluebird');var rp=require(_0x7cbb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cbb('0x5'));var config=require(_0x7cbb('0x6'));var attributes=require(_0x7cbb('0x7'));module[_0x7cbb('0x8')]=function(_0x16bb3f,_0x561b58){return _0x16bb3f['define'](_0x7cbb('0x9'),attributes,{'tableName':_0x7cbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37a4=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x4f1618,_0x23340c){var _0xb80243=function(_0x15d8b7){while(--_0x15d8b7){_0x4f1618['push'](_0x4f1618['shift']());}};_0xb80243(++_0x23340c);}(_0x37a4,0x14c));var _0x437a=function(_0x38e50e,_0x19af56){_0x38e50e=_0x38e50e-0x0;var _0x1da741=_0x37a4[_0x38e50e];return _0x1da741;};'use strict';var _=require(_0x437a('0x0'));var util=require(_0x437a('0x1'));var logger=require(_0x437a('0x2'))('api');var moment=require(_0x437a('0x3'));var BPromise=require(_0x437a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x437a('0x5'));var config=require(_0x437a('0x6'));var attributes=require(_0x437a('0x7'));module['exports']=function(_0x28f203,_0x12a6fd){return _0x28f203[_0x437a('0x8')](_0x437a('0x9'),attributes,{'tableName':_0x437a('0xa'),'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 7f7b052..a5c6f8f 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 _0x01fe=['rpc','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','create','options','raw','stringify','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x01fe,0x102));var _0xe01f=function(_0x3e72f2,_0xb6d69a){_0x3e72f2=_0x3e72f2-0x0;var _0x841fa1=_0x01fe[_0x3e72f2];return _0x841fa1;};'use strict';var _=require(_0xe01f('0x0'));var util=require('util');var moment=require(_0xe01f('0x1'));var BPromise=require(_0xe01f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe01f('0x3'))['db'];var utils=require(_0xe01f('0x4'));var logger=require(_0xe01f('0x5'))(_0xe01f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe01f('0x7'));var client=jayson['client'][_0xe01f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b754f,_0x45431b,_0x40376f){return new BPromise(function(_0x377881,_0x4d1775){return client[_0xe01f('0x9')](_0x3b754f,_0x40376f)[_0xe01f('0xa')](function(_0x47dc30){logger[_0xe01f('0xb')]('Attachment,\x20%s,\x20%s',_0x45431b,_0xe01f('0xc'));logger[_0xe01f('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x45431b,_0xe01f('0xc'),JSON['stringify'](_0x47dc30));if(_0x47dc30[_0xe01f('0xe')]){if(_0x47dc30[_0xe01f('0xe')][_0xe01f('0xf')]===0x1f4){logger[_0xe01f('0xe')](_0xe01f('0x10'),_0x45431b,_0x47dc30[_0xe01f('0xe')][_0xe01f('0x11')]);return _0x4d1775(_0x47dc30[_0xe01f('0xe')]['message']);}logger[_0xe01f('0xe')](_0xe01f('0x10'),_0x45431b,_0x47dc30[_0xe01f('0xe')][_0xe01f('0x11')]);return _0x377881(_0x47dc30[_0xe01f('0xe')][_0xe01f('0x11')]);}else{logger[_0xe01f('0xb')]('Attachment,\x20%s,\x20%s',_0x45431b,'request\x20sent');_0x377881(_0x47dc30['result'][_0xe01f('0x11')]);}})[_0xe01f('0x12')](function(_0x88606f){logger[_0xe01f('0xe')](_0xe01f('0x10'),_0x45431b,_0x88606f);_0x4d1775(_0x88606f);});});}exports[_0xe01f('0x13')]=function(_0x144eef){var _0x26cd4d=this;return new Promise(function(_0x9ee4b5,_0x2ddaa3){return db['Attachment'][_0xe01f('0x14')](_0x144eef['body'],{'raw':_0x144eef[_0xe01f('0x15')]?_0x144eef[_0xe01f('0x15')][_0xe01f('0x16')]===undefined?!![]:![]:!![]})[_0xe01f('0xa')](function(_0x5e9523){logger[_0xe01f('0xb')](_0xe01f('0x13'),_0x144eef);logger[_0xe01f('0xd')](_0xe01f('0x13'),_0x144eef,JSON[_0xe01f('0x17')](_0x5e9523));_0x9ee4b5(_0x5e9523);})[_0xe01f('0x12')](function(_0x570d48){logger[_0xe01f('0xe')](_0xe01f('0x13'),_0x570d48[_0xe01f('0x11')],_0x144eef);_0x2ddaa3(_0x26cd4d[_0xe01f('0xe')](0x1f4,_0x570d48[_0xe01f('0x11')]));});});}; \ No newline at end of file +var _0x407f=['rpc','../../config/environment','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','options','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x531e45,_0x409428){var _0x5ec65c=function(_0x1f02ab){while(--_0x1f02ab){_0x531e45['push'](_0x531e45['shift']());}};_0x5ec65c(++_0x409428);}(_0x407f,0xc2));var _0xf407=function(_0xe166e1,_0x4becb1){_0xe166e1=_0xe166e1-0x0;var _0x1b66f2=_0x407f[_0xe166e1];return _0x1b66f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf407('0x0'));var rs=require(_0xf407('0x1'));var fs=require('fs');var Redis=require(_0xf407('0x2'));var db=require(_0xf407('0x3'))['db'];var utils=require(_0xf407('0x4'));var logger=require(_0xf407('0x5'))(_0xf407('0x6'));var config=require(_0xf407('0x7'));var jayson=require(_0xf407('0x8'));var client=jayson[_0xf407('0x9')][_0xf407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bce9d,_0x2d4ec6,_0x3ac774){return new BPromise(function(_0x38ee37,_0x3ab539){return client['request'](_0x2bce9d,_0x3ac774)[_0xf407('0xb')](function(_0xc3473a){logger[_0xf407('0xc')](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x2d4ec6,_0xf407('0xe'),JSON[_0xf407('0xf')](_0xc3473a));if(_0xc3473a[_0xf407('0x10')]){if(_0xc3473a[_0xf407('0x10')][_0xf407('0x11')]===0x1f4){logger['error'](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);return _0x3ab539(_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);}logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')]['message']);return _0x38ee37(_0xc3473a['error'][_0xf407('0x12')]);}else{logger['info'](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');_0x38ee37(_0xc3473a['result'][_0xf407('0x12')]);}})[_0xf407('0x13')](function(_0x1cdc81){logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0x1cdc81);_0x3ab539(_0x1cdc81);});});}exports[_0xf407('0x14')]=function(_0x4ddbe6){var _0x2e346f=this;return new Promise(function(_0x588fe4,_0x128faf){return db[_0xf407('0x15')][_0xf407('0x16')](_0x4ddbe6[_0xf407('0x17')],{'raw':_0x4ddbe6[_0xf407('0x18')]?_0x4ddbe6[_0xf407('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xf407('0xb')](function(_0x39febd){logger[_0xf407('0xc')](_0xf407('0x14'),_0x4ddbe6);logger['debug'](_0xf407('0x14'),_0x4ddbe6,JSON[_0xf407('0xf')](_0x39febd));_0x588fe4(_0x39febd);})[_0xf407('0x13')](function(_0xa6f11e){logger['error']('CreateAttachment',_0xa6f11e[_0xf407('0x12')],_0x4ddbe6);_0x128faf(_0x2e346f[_0xf407('0x10')](0x1f4,_0xa6f11e[_0xf407('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 9e078bf..16092ea 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x195f68,_0x44cdcd){var _0x2d8228=function(_0x4c81bd){while(--_0x4c81bd){_0x195f68['push'](_0x195f68['shift']());}};_0x2d8228(++_0x44cdcd);}(_0xadb5,0xad));var _0x5adb=function(_0x393bd8,_0x49ead4){_0x393bd8=_0x393bd8-0x0;var _0xe4fae0=_0xadb5[_0x393bd8];return _0xe4fae0;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x3dae5e,_0x95f6b6){_0x3dae5e=_0x3dae5e-0x0;var _0x52fbad=_0xdb28[_0x3dae5e];return _0x52fbad;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 20edfd9..66cab23 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e45=['ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','admin','agent','name','add','clearBlockUser','getLicense','catch','status','send','message','login'];(function(_0xe52764,_0x1d1150){var _0x559fca=function(_0x4dc5aa){while(--_0x4dc5aa){_0xe52764['push'](_0xe52764['shift']());}};_0x559fca(++_0x1d1150);}(_0x4e45,0x124));var _0x54e4=function(_0x352bbe,_0x385eca){_0x352bbe=_0x352bbe-0x0;var _0x1d35f3=_0x4e45[_0x352bbe];return _0x1d35f3;};'use strict';var passport=require(_0x54e4('0x0'));var LocalStrategy=require(_0x54e4('0x1'))[_0x54e4('0x2')];var moment=require(_0x54e4('0x3'));var ActiveDirectory=require(_0x54e4('0x4'));var BPromise=require(_0x54e4('0x5'));var util=require(_0x54e4('0x6'));var db=require(_0x54e4('0x7'))['db'];var authService=require(_0x54e4('0x8'));var utils=require('../../config/utils');var config=require(_0x54e4('0x9'));var logger=require(_0x54e4('0xa'))(_0x54e4('0xb'));function isActiveDirectoryConfigured(_0x13ee5a){var _0x489fa3=![];if(typeof _0x13ee5a[_0x54e4('0xc')]!==_0x54e4('0xd')){_0x489fa3=_0x13ee5a[_0x54e4('0xc')]['baseDN']&&_0x13ee5a['activedirectory'][_0x54e4('0xe')]&&_0x13ee5a['activedirectory'][_0x54e4('0xf')];}return _0x489fa3;}function adAuthenticate(_0x4af77c,_0x238d08,_0x4d713d){return new BPromise(function(_0x4c8438,_0xdcc336){try{var _0xb431dc=new ActiveDirectory(_0x4af77c);_0xb431dc[_0x54e4('0x10')](_0x238d08,_0x4d713d,function(_0x4ca914,_0x2ac63d){if(_0x4ca914){logger[_0x54e4('0x11')](_0x54e4('0x12'),_0x238d08,util['inspect'](_0x4ca914,{'showHidden':![],'depth':null}));_0xdcc336(_0x54e4('0x13'));}else if(!_0x2ac63d){logger[_0x54e4('0x11')](_0x54e4('0x14'),_0x238d08);_0xdcc336(_0x54e4('0x13'));}else{_0x4c8438(_0x2ac63d);}});}catch(_0x533e77){_0xdcc336(_0x533e77);}});}function ActiveDirectoryAuthenticate(_0x421f95,_0xf2dea4,_0x1d58da,_0x4ed588){var _0x1dbe83,_0x3d389b;if(!isActiveDirectoryConfigured(config)){logger[_0x54e4('0x11')](_0x54e4('0x15'),_0xf2dea4);return _0x4ed588(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x54e4('0x16')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x54e4('0x17')],'raw':!![]})[_0x54e4('0x18')](function(_0x21f7bd){_0x1dbe83=_0x21f7bd;if(!_0x1dbe83[_0x54e4('0x19')]){logger['error'](_0x54e4('0x1a'),_0xf2dea4);throw new Error(_0x54e4('0x13'));}return _0x421f95[_0x54e4('0x1b')]({'attributes':['id','name',_0x54e4('0x1c'),_0x54e4('0x1d'),_0x54e4('0x1e'),_0x54e4('0x1f'),_0x54e4('0x20'),'blockedAt','online'],'where':{'name':_0xf2dea4,'role':{'$or':[_0x54e4('0x21'),'user',_0x54e4('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x51de66){if(!_0x51de66||_0x51de66&&_0x51de66[_0x54e4('0x23')]!==_0xf2dea4){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x3d389b=_0x51de66;var _0x3e8162=_0x3d389b[_0x54e4('0x23')]+'@'+config[_0x54e4('0xc')][_0x54e4('0xf')];return adAuthenticate(config[_0x54e4('0xc')],_0x3e8162,_0x1d58da);})[_0x54e4('0x18')](function(_0x469a52){if(_0x3d389b['disabled']){throw new Error(_0x54e4('0x13'));}if(_0x1dbe83['blockDuration']>0x0){if(_0x3d389b['blocked']){if(moment(_0x3d389b['blockedAt'])[_0x54e4('0x24')](_0x1dbe83[_0x54e4('0x17')],'minutes')>moment()){throw new Error(_0x54e4('0x13'));}return utils[_0x54e4('0x25')](_0x3d389b,0x0,![],null)[_0x54e4('0x18')](function(){return utils[_0x54e4('0x26')](_0x3d389b);})[_0x54e4('0x18')](function(){return _0x4ed588(null,_0x3d389b);});}else{return utils['getLicense'](_0x3d389b)[_0x54e4('0x18')](function(){return _0x4ed588(null,_0x3d389b);});}}else{return utils[_0x54e4('0x26')](_0x3d389b)[_0x54e4('0x18')](function(){return _0x4ed588(null,_0x3d389b);});}})[_0x54e4('0x27')](function(_0x5e3061){return _0x4ed588(null,![],_0x5e3061);});}function handleError(_0x59033f,_0x103901,_0x45e249){return _0x59033f[_0x54e4('0x28')](_0x103901||0x1f4)[_0x54e4('0x29')]({'message':_0x45e249?_0x45e249[_0x54e4('0x2a')]||_0x45e249:''});}exports[_0x54e4('0x2b')]=function(_0x5aed8b,_0x4f18aa,_0x17f9e1){passport[_0x54e4('0x10')](_0x54e4('0x2c'),function(_0x26f421,_0x338e50,_0x32c4b0){var _0x5daf58=_0x26f421||_0x32c4b0;if(_0x5daf58){return handleError(_0x4f18aa,0x191,_0x5daf58);}if(!_0x338e50){return handleError(_0x4f18aa,0x194,{'message':_0x54e4('0x2d')});}else{var _0x4c8515={'payload':{'id':_0x338e50['id'],'role':_0x338e50[_0x54e4('0x1e')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4c8515)['then'](function(_0x514229){_0x4f18aa['json']({'id':_0x338e50['id'],'token':_0x514229,'statusCall':'','isAlreadyLogged':_0x338e50[_0x54e4('0x2e')]});});}})(_0x5aed8b,_0x4f18aa,_0x17f9e1);};passport[_0x54e4('0x2f')](_0x54e4('0x2c'),new LocalStrategy({'usernameField':_0x54e4('0x23'),'passwordField':_0x54e4('0x1c')},function(_0x246961,_0x3ea6df,_0x42b226){return ActiveDirectoryAuthenticate(db['User'],_0x246961,_0x3ea6df,_0x42b226);})); \ No newline at end of file +var _0x8b5c=['then','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','online','use','User','passport-local','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','disabled','blocked','blockedAt','admin','user','agent'];(function(_0x1c946a,_0x5b312d){var _0x5b1e14=function(_0x3d621d){while(--_0x3d621d){_0x1c946a['push'](_0x1c946a['shift']());}};_0x5b1e14(++_0x5b312d);}(_0x8b5c,0x1bf));var _0xc8b5=function(_0x150983,_0x5b97db){_0x150983=_0x150983-0x0;var _0x271597=_0x8b5c[_0x150983];return _0x271597;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xc8b5('0x0'))['Strategy'];var moment=require(_0xc8b5('0x1'));var ActiveDirectory=require(_0xc8b5('0x2'));var BPromise=require('bluebird');var util=require(_0xc8b5('0x3'));var db=require(_0xc8b5('0x4'))['db'];var authService=require(_0xc8b5('0x5'));var utils=require(_0xc8b5('0x6'));var config=require(_0xc8b5('0x7'));var logger=require(_0xc8b5('0x8'))(_0xc8b5('0x9'));function isActiveDirectoryConfigured(_0x6cdee1){var _0x38a84a=![];if(typeof _0x6cdee1[_0xc8b5('0xa')]!==_0xc8b5('0xb')){_0x38a84a=_0x6cdee1[_0xc8b5('0xa')]['baseDN']&&_0x6cdee1[_0xc8b5('0xa')][_0xc8b5('0xc')]&&_0x6cdee1[_0xc8b5('0xa')]['domain'];}return _0x38a84a;}function adAuthenticate(_0x11070f,_0x584c0f,_0xdac9f2){return new BPromise(function(_0x428d39,_0x114b84){try{var _0x2d774e=new ActiveDirectory(_0x11070f);_0x2d774e[_0xc8b5('0xd')](_0x584c0f,_0xdac9f2,function(_0x573b21,_0x310964){if(_0x573b21){logger['error'](_0xc8b5('0xe'),_0x584c0f,util[_0xc8b5('0xf')](_0x573b21,{'showHidden':![],'depth':null}));_0x114b84('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x310964){logger[_0xc8b5('0x10')](_0xc8b5('0x11'),_0x584c0f);_0x114b84('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x428d39(_0x310964);}});}catch(_0x357da4){_0x114b84(_0x357da4);}});}function ActiveDirectoryAuthenticate(_0x1f3415,_0x334af5,_0x3b9fcd,_0x4d5d18){var _0xa678d,_0x44d77e;if(!isActiveDirectoryConfigured(config)){logger[_0xc8b5('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x334af5);return _0x4d5d18(null,![],{'message':_0xc8b5('0x12')});}return db[_0xc8b5('0x13')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xc8b5('0x14')],'raw':!![]})['then'](function(_0x500cf5){_0xa678d=_0x500cf5;if(!_0xa678d[_0xc8b5('0x15')]){logger[_0xc8b5('0x10')](_0xc8b5('0x16'),_0x334af5);throw new Error(_0xc8b5('0x12'));}return _0x1f3415[_0xc8b5('0x17')]({'attributes':['id',_0xc8b5('0x18'),_0xc8b5('0x19'),'salt',_0xc8b5('0x1a'),_0xc8b5('0x1b'),_0xc8b5('0x1c'),_0xc8b5('0x1d'),'online'],'where':{'name':_0x334af5,'role':{'$or':[_0xc8b5('0x1e'),_0xc8b5('0x1f'),_0xc8b5('0x20')]},'adSsoEnabled':!![]}});})[_0xc8b5('0x21')](function(_0x3f053a){if(!_0x3f053a||_0x3f053a&&_0x3f053a[_0xc8b5('0x18')]!==_0x334af5){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x44d77e=_0x3f053a;var _0x337b2c=_0x44d77e[_0xc8b5('0x18')]+'@'+config[_0xc8b5('0xa')]['domain'];return adAuthenticate(config['activedirectory'],_0x337b2c,_0x3b9fcd);})[_0xc8b5('0x21')](function(_0x4384de){if(_0x44d77e[_0xc8b5('0x1b')]){throw new Error(_0xc8b5('0x12'));}if(_0xa678d['blockDuration']>0x0){if(_0x44d77e[_0xc8b5('0x1c')]){if(moment(_0x44d77e[_0xc8b5('0x1d')])['add'](_0xa678d['blockDuration'],_0xc8b5('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xc8b5('0x23')](_0x44d77e,0x0,![],null)[_0xc8b5('0x21')](function(){return utils['getLicense'](_0x44d77e);})['then'](function(){return _0x4d5d18(null,_0x44d77e);});}else{return utils['getLicense'](_0x44d77e)[_0xc8b5('0x21')](function(){return _0x4d5d18(null,_0x44d77e);});}}else{return utils[_0xc8b5('0x24')](_0x44d77e)[_0xc8b5('0x21')](function(){return _0x4d5d18(null,_0x44d77e);});}})[_0xc8b5('0x25')](function(_0x49db7b){return _0x4d5d18(null,![],_0x49db7b);});}function handleError(_0x8f1eec,_0x5e972c,_0x37537a){return _0x8f1eec[_0xc8b5('0x26')](_0x5e972c||0x1f4)[_0xc8b5('0x27')]({'message':_0x37537a?_0x37537a[_0xc8b5('0x28')]||_0x37537a:''});}exports[_0xc8b5('0x29')]=function(_0x501a3c,_0x943837,_0xdf1196){passport['authenticate'](_0xc8b5('0x2a'),function(_0x377bfc,_0x3ec33a,_0x10dcb1){var _0x131003=_0x377bfc||_0x10dcb1;if(_0x131003){return handleError(_0x943837,0x191,_0x131003);}if(!_0x3ec33a){return handleError(_0x943837,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x48af49={'payload':{'id':_0x3ec33a['id'],'role':_0x3ec33a[_0xc8b5('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xc8b5('0x2b')](_0x48af49)['then'](function(_0x47aa75){_0x943837[_0xc8b5('0x2c')]({'id':_0x3ec33a['id'],'token':_0x47aa75,'statusCall':'','isAlreadyLogged':_0x3ec33a[_0xc8b5('0x2d')]});});}})(_0x501a3c,_0x943837,_0xdf1196);};passport[_0xc8b5('0x2e')](_0xc8b5('0x2a'),new LocalStrategy({'usernameField':_0xc8b5('0x18'),'passwordField':_0xc8b5('0x19')},function(_0x20b000,_0x32b2de,_0x3e66d5){return ActiveDirectoryAuthenticate(db[_0xc8b5('0x2f')],_0x20b000,_0x32b2de,_0x3e66d5);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index d338378..5afff6a 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91f1=['Router','./authActiveDirectory.controller','exports'];(function(_0x6cd67d,_0x5d4670){var _0x3dff1a=function(_0x549d48){while(--_0x549d48){_0x6cd67d['push'](_0x6cd67d['shift']());}};_0x3dff1a(++_0x5d4670);}(_0x91f1,0x153));var _0x191f=function(_0x20c403,_0x56a7aa){_0x20c403=_0x20c403-0x0;var _0x23f13c=_0x91f1[_0x20c403];return _0x23f13c;};'use strict';var express=require('express');var router=express[_0x191f('0x0')]();var controller=require(_0x191f('0x1'));router['post']('/',controller['login']);module[_0x191f('0x2')]=router; \ No newline at end of file +var _0xbc2f=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x14145a,_0x561605){var _0x3231f5=function(_0x501f94){while(--_0x501f94){_0x14145a['push'](_0x14145a['shift']());}};_0x3231f5(++_0x561605);}(_0xbc2f,0x1a1));var _0xfbc2=function(_0x4e8a59,_0x32bc84){_0x4e8a59=_0x4e8a59-0x0;var _0x22ba3e=_0xbc2f[_0x4e8a59];return _0x22ba3e;};'use strict';var express=require(_0xfbc2('0x0'));var router=express[_0xfbc2('0x1')]();var controller=require(_0xfbc2('0x2'));router['post']('/',controller[_0xfbc2('0x3')]);module[_0xfbc2('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e83083d..85cd622 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x7a54,0x106));var _0x47a5=function(_0x11367d,_0x385ddd){_0x11367d=_0x11367d-0x0;var _0x3a9354=_0x7a54[_0x11367d];return _0x3a9354;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x7a54,0x106));var _0x47a5=function(_0x21bf69,_0x518b68){_0x21bf69=_0x21bf69-0x0;var _0x2ee24f=_0x7a54[_0x21bf69];return _0x2ee24f;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 4c8478f..18c1ac8 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 _0x523a=['setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','/callback','callback'];(function(_0x538dd2,_0x553983){var _0x3b7899=function(_0x240153){while(--_0x240153){_0x538dd2['push'](_0x538dd2['shift']());}};_0x3b7899(++_0x553983);}(_0x523a,0x7a));var _0xa523=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x523a[_0x1a89a1];return _0x3d5b46;};'use strict';var express=require(_0xa523('0x0'));var passport=require(_0xa523('0x1'));var router=express[_0xa523('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xa523('0x3'));var authService=require(_0xa523('0x4'));router[_0xa523('0x5')]('/',controller['login']);router[_0xa523('0x5')](_0xa523('0x6'),controller[_0xa523('0x7')],authService['isMiddleware'],userController['login'],authService[_0xa523('0x8')]);module[_0xa523('0x9')]=router; \ No newline at end of file +var _0x3bd0=['get','login','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0x3bd0,0x196));var _0x03bd=function(_0x5bc3fc,_0x54db61){_0x5bc3fc=_0x5bc3fc-0x0;var _0x1253d0=_0x3bd0[_0x5bc3fc];return _0x1253d0;};'use strict';var express=require('express');var passport=require(_0x03bd('0x0'));var router=express[_0x03bd('0x1')]();var controller=require(_0x03bd('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x03bd('0x3'));router[_0x03bd('0x4')]('/',controller[_0x03bd('0x5')]);router['get']('/callback',controller[_0x03bd('0x6')],authService[_0x03bd('0x7')],userController[_0x03bd('0x5')],authService[_0x03bd('0x8')]);module[_0x03bd('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 2749e71..93866aa 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 _0x4a52=['email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','role','signToken','json','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','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','https://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','password','salt','disabled','blockedAt','loginAttempts','admin','user','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find'];(function(_0x2f430a,_0x46d370){var _0x10def3=function(_0x347eaa){while(--_0x347eaa){_0x2f430a['push'](_0x2f430a['shift']());}};_0x10def3(++_0x46d370);}(_0x4a52,0x1d0));var _0x24a5=function(_0x3ac6a3,_0x3dc212){_0x3ac6a3=_0x3ac6a3-0x0;var _0x16951c=_0x4a52[_0x3ac6a3];return _0x16951c;};'use strict';var util=require(_0x24a5('0x0'));var passport=require('passport');var LocalStrategy=require(_0x24a5('0x1'))[_0x24a5('0x2')];var jayson=require(_0x24a5('0x3'));var _=require(_0x24a5('0x4'));var rs=require(_0x24a5('0x5'));var moment=require(_0x24a5('0x6'));var db=require(_0x24a5('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x24a5('0x8'));var client=jayson[_0x24a5('0x9')][_0x24a5('0xa')]({'port':0x232b});function localAuthenticate(_0x43a359,_0x57689e,_0x55cdde,_0x2000fa){var _0xaa9bc8,_0x44f108;return db['Setting'][_0x24a5('0xb')]({'where':{'id':0x1},'attributes':[_0x24a5('0xc'),_0x24a5('0xd')],'raw':!![]})['then'](function(_0x1e93c7){_0xaa9bc8=_0x1e93c7;return _0x43a359[_0x24a5('0xb')]({'attributes':['id','name',_0x24a5('0xe'),_0x24a5('0xf'),'role',_0x24a5('0x10'),'blocked',_0x24a5('0x11'),_0x24a5('0x12')],'where':{'name':_0x57689e,'role':{'$or':[_0x24a5('0x13'),_0x24a5('0x14'),_0x24a5('0x15')]}}});})[_0x24a5('0x16')](function(_0x11b956){if(!_0x11b956||_0x11b956&&_0x11b956[_0x24a5('0x17')]!==_0x57689e){throw new Error(_0x24a5('0x18'));}else{_0x44f108=_0x11b956;return _0x44f108;}})[_0x24a5('0x16')](function(){_0x44f108[_0x24a5('0x19')](_0x55cdde,function(_0x366f05,_0x199931){var _0x535d5b=_0x44f108[_0x24a5('0x12')]+0x1;if(_0x366f05){return _0x2000fa(_0x366f05);}else if(!_0x199931){if(_0x44f108[_0x24a5('0x10')]){return _0x2000fa(null,![],{'message':_0x24a5('0x18')});}else if(_0xaa9bc8['allowedLoginAttempts']>0x0){if(_0x44f108[_0x24a5('0x1a')]){if(_0xaa9bc8[_0x24a5('0xd')]>0x0){if(moment(_0x44f108[_0x24a5('0x11')])['add'](_0xaa9bc8[_0x24a5('0xd')],_0x24a5('0x1b'))>moment()){return _0x2000fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x24a5('0x1c')](_0x44f108,_0x535d5b,![],null)['then'](function(){return _0x2000fa(null,![],{'message':_0x24a5('0x18')});});}}else{return _0x2000fa(null,![],{'message':_0x24a5('0x18')});}}else{if(_0x535d5b>=_0xaa9bc8[_0x24a5('0xc')]){return utils[_0x24a5('0x1c')](_0x44f108,0x0,!![],moment())[_0x24a5('0x16')](function(){return _0x2000fa(null,![],{'message':_0x24a5('0x18')});});}else{return utils[_0x24a5('0x1c')](_0x44f108,_0x535d5b,![],null)[_0x24a5('0x16')](function(){return _0x2000fa(null,![],{'message':_0x24a5('0x18')});});}}}else{return _0x2000fa(null,![],{'message':_0x24a5('0x18')});}}else{if(_0x44f108[_0x24a5('0x10')]){return _0x2000fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xaa9bc8[_0x24a5('0xc')]>0x0){if(_0x44f108[_0x24a5('0x1a')]){if(_0xaa9bc8[_0x24a5('0xd')]>0x0){if(moment(_0x44f108[_0x24a5('0x11')])[_0x24a5('0x1d')](_0xaa9bc8['blockDuration'],_0x24a5('0x1b'))>moment()){return _0x2000fa(null,![],{'message':_0x24a5('0x18')});}else{return utils[_0x24a5('0x1c')](_0x44f108,0x0,![],null)[_0x24a5('0x16')](function(){return utils[_0x24a5('0x1e')](_0x44f108);})[_0x24a5('0x16')](function(){return _0x2000fa(null,_0x44f108);});}}else{return _0x2000fa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x24a5('0x1c')](_0x44f108,0x0,![],null)[_0x24a5('0x16')](function(){return utils[_0x24a5('0x1e')](_0x44f108);})[_0x24a5('0x16')](function(){return _0x2000fa(null,_0x44f108);})[_0x24a5('0x1f')](function(_0x3d3b1b){return _0x2000fa(null,![],_0x3d3b1b);});}}else{if(_0x44f108[_0x24a5('0x1a')]){return _0x2000fa(null,![],{'message':_0x24a5('0x18')});}else{return utils['getLicense'](_0x44f108)[_0x24a5('0x16')](function(){return _0x2000fa(null,_0x44f108);});}}}});})[_0x24a5('0x1f')](function(_0x4b0413){return _0x2000fa(null,![],_0x4b0413);});}function sendServiceMail(_0x73c32d){return db[_0x24a5('0x20')][_0x24a5('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x24a5('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x24a5('0x23'),'include':[{'model':db[_0x24a5('0x24')],'as':'CloudProvider'}]}]})[_0x24a5('0x16')](function(_0x4c883c){if(!_0x4c883c){throw new Error(_0x24a5('0x25'));}var _0xb6105d=_0x4c883c[_0x24a5('0x26')]();var _0x59a400={'account':_0xb6105d,'message':_[_0x24a5('0x27')]({'from':util[_0x24a5('0x28')](_0x24a5('0x29'),_0x4c883c[_0x24a5('0x17')],_0x4c883c[_0x24a5('0x22')]||_0x4c883c[_0x24a5('0x23')][_0x24a5('0x14')])},_0x73c32d)};return client[_0x24a5('0x2a')](_0x24a5('0x2b'),_0x59a400);})[_0x24a5('0x16')](function(_0x41199c){if(_0x41199c[_0x24a5('0x2c')]){throw new Error(util['format'](_0x24a5('0x2d'),_0x41199c[_0x24a5('0x2c')][_0x24a5('0x2e')]||JSON[_0x24a5('0x2f')](_0x41199c[_0x24a5('0x2c')])));}return!![];});}function handleError(_0xfd2e1e,_0x2ee96f,_0x55e70a){return _0xfd2e1e[_0x24a5('0x30')](_0x2ee96f||0x1f4)[_0x24a5('0x31')]({'message':_0x55e70a?_0x55e70a['message']||_0x55e70a:''});}exports[_0x24a5('0x32')]=function(_0x44a03d,_0x230a88,_0x5349bb){passport[_0x24a5('0x19')](_0x24a5('0x33'),function(_0x532582,_0xbb2ba2,_0xb4cdc2){var _0x2f5d5b=_0x532582||_0xb4cdc2;if(_0x2f5d5b){return handleError(_0x230a88,0x191,_0x2f5d5b);}if(!_0xbb2ba2){return handleError(_0x230a88,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x34f9ff={'payload':{'id':_0xbb2ba2['id'],'role':_0xbb2ba2[_0x24a5('0x34')]},'options':{'expiresIn':0x15180}};return authService[_0x24a5('0x35')](_0x34f9ff)['then'](function(_0x1f37ec){_0x230a88[_0x24a5('0x36')]({'id':_0xbb2ba2['id'],'token':_0x1f37ec,'statusCall':'','isAlreadyLogged':_0xbb2ba2['online']});});}})(_0x44a03d,_0x230a88,_0x5349bb);};exports[_0x24a5('0x37')]=function(_0x58ab6e,_0x33169f){if(!_0x58ab6e[_0x24a5('0x38')][_0x24a5('0x22')]){return handleError(_0x33169f,0x1f4,{'message':_0x24a5('0x39')});}var _0x6cec1b=rs[_0x24a5('0x3a')]();_0x58ab6e[_0x24a5('0x38')]['email']=_0x58ab6e[_0x24a5('0x38')][_0x24a5('0x22')][_0x24a5('0x3b')]()[_0x24a5('0x3c')]();var _0x447fc3;return db['Setting'][_0x24a5('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x24a5('0x16')](function(_0x23af03){_0x447fc3=_0x23af03;return db[_0x24a5('0x3d')][_0x24a5('0x21')]({'where':{'email':_0x58ab6e[_0x24a5('0x38')][_0x24a5('0x22')]}});})[_0x24a5('0x16')](function(_0x45ca3c){if(!_0x45ca3c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x45ca3c[_0x24a5('0x10')]){throw new Error(_0x24a5('0x3e'));}if(_0x45ca3c[_0x24a5('0x1a')]){if(moment(_0x45ca3c[_0x24a5('0x11')])[_0x24a5('0x1d')](_0x447fc3[_0x24a5('0xd')],_0x24a5('0x1b'))>moment()){throw new Error(_0x24a5('0x3f'));}else{_0x45ca3c['blocked']=![];_0x45ca3c[_0x24a5('0x11')]=null;}}_0x45ca3c[_0x24a5('0x40')]=_0x6cec1b;_0x45ca3c[_0x24a5('0x41')]=Date['now']()+0x36ee80;return _0x45ca3c[_0x24a5('0x42')]();})[_0x24a5('0x16')](function(){return sendServiceMail({'to':_0x58ab6e[_0x24a5('0x38')][_0x24a5('0x22')],'subject':_0x24a5('0x43'),'text':_0x24a5('0x44')+_0x24a5('0x45')+_0x24a5('0x46')+_0x58ab6e['headers'][_0x24a5('0x47')]+'/reset/'+_0x6cec1b+'\x0a\x0a'+_0x24a5('0x48')});})[_0x24a5('0x16')](function(){_0x33169f[_0x24a5('0x30')](0xc8)[_0x24a5('0x31')]({'message':_0x24a5('0x49')});})['catch'](function(_0x1acafb){return handleError(_0x33169f,0x1f4,_0x1acafb);});};exports['reset']=function(_0x4dd22c,_0xcbf3d4){return db[_0x24a5('0x3d')][_0x24a5('0x21')]({'where':{'resetPasswordToken':_0x4dd22c[_0x24a5('0x4a')][_0x24a5('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x24a5('0x16')](function(_0x6fb920){if(!_0x6fb920){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x24a5('0xb')]({'attributes':['id',_0x24a5('0x4c'),_0x24a5('0x4d'),'passwordHistoryLimit']})[_0x24a5('0x16')](function(_0x4a830f){if(_0x4a830f[_0x24a5('0x4c')])authService[_0x24a5('0x4e')](_0x4dd22c[_0x24a5('0x38')][_0x24a5('0xe')]);if(!_0x4a830f[_0x24a5('0x4d')]||!_0x6fb920['previousPasswords'])return _0x6fb920;authService[_0x24a5('0x4f')](_0x4dd22c[_0x24a5('0x38')][_0x24a5('0xe')],_0x6fb920[_0x24a5('0x50')],_0x4a830f[_0x24a5('0x51')]);return _0x6fb920;})[_0x24a5('0x16')](function(){_0x6fb920[_0x24a5('0xe')]=_0x4dd22c[_0x24a5('0x38')]['password'];_0x6fb920[_0x24a5('0x40')]=null;_0x6fb920[_0x24a5('0x41')]=null;return _0x6fb920['save']();});})[_0x24a5('0x16')](function(){_0xcbf3d4['status'](0xc8)['send']({'message':_0x24a5('0x52')});})['catch'](function(_0x23df89){return handleError(_0xcbf3d4,0x1f4,_0x23df89);});};passport['use'](_0x24a5('0x33'),new LocalStrategy({'usernameField':_0x24a5('0x17'),'passwordField':_0x24a5('0xe')},function(_0x2d5510,_0x2acd39,_0x3d56ac){return localAuthenticate(db[_0x24a5('0x3d')],_0x2d5510,_0x2acd39,_0x3d56ac);})); \ No newline at end of file +var _0xcc8d=['Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordExpires','Password\x20reset!','use','local-login','util','passport','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','findOne','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','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','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.'];(function(_0x416468,_0x2e7a72){var _0x2ee9b7=function(_0xf354ce){while(--_0xf354ce){_0x416468['push'](_0x416468['shift']());}};_0x2ee9b7(++_0x2e7a72);}(_0xcc8d,0xfc));var _0xdcc8=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0xcc8d[_0x40b3f2];return _0x4ce90c;};'use strict';var util=require(_0xdcc8('0x0'));var passport=require(_0xdcc8('0x1'));var LocalStrategy=require('passport-local')[_0xdcc8('0x2')];var jayson=require('jayson/promise');var _=require(_0xdcc8('0x3'));var rs=require(_0xdcc8('0x4'));var moment=require(_0xdcc8('0x5'));var db=require(_0xdcc8('0x6'))['db'];var authService=require(_0xdcc8('0x7'));var utils=require('../../config/utils');var client=jayson[_0xdcc8('0x8')][_0xdcc8('0x9')]({'port':0x232b});function localAuthenticate(_0x50bf40,_0x2c5482,_0x1e7153,_0x29b045){var _0x4f3511,_0x1a94a2;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x118448){_0x4f3511=_0x118448;return _0x50bf40[_0xdcc8('0xa')]({'attributes':['id',_0xdcc8('0xb'),_0xdcc8('0xc'),_0xdcc8('0xd'),_0xdcc8('0xe'),_0xdcc8('0xf'),_0xdcc8('0x10'),_0xdcc8('0x11'),_0xdcc8('0x12')],'where':{'name':_0x2c5482,'role':{'$or':[_0xdcc8('0x13'),_0xdcc8('0x14'),_0xdcc8('0x15')]}}});})['then'](function(_0x2da1ae){if(!_0x2da1ae||_0x2da1ae&&_0x2da1ae[_0xdcc8('0xb')]!==_0x2c5482){throw new Error(_0xdcc8('0x16'));}else{_0x1a94a2=_0x2da1ae;return _0x1a94a2;}})[_0xdcc8('0x17')](function(){_0x1a94a2[_0xdcc8('0x18')](_0x1e7153,function(_0xcc88f0,_0x193be9){var _0x2eb6a3=_0x1a94a2['loginAttempts']+0x1;if(_0xcc88f0){return _0x29b045(_0xcc88f0);}else if(!_0x193be9){if(_0x1a94a2[_0xdcc8('0xf')]){return _0x29b045(null,![],{'message':_0xdcc8('0x16')});}else if(_0x4f3511['allowedLoginAttempts']>0x0){if(_0x1a94a2[_0xdcc8('0x10')]){if(_0x4f3511[_0xdcc8('0x19')]>0x0){if(moment(_0x1a94a2[_0xdcc8('0x11')])[_0xdcc8('0x1a')](_0x4f3511[_0xdcc8('0x19')],_0xdcc8('0x1b'))>moment()){return _0x29b045(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x1a94a2,_0x2eb6a3,![],null)[_0xdcc8('0x17')](function(){return _0x29b045(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x29b045(null,![],{'message':_0xdcc8('0x16')});}}else{if(_0x2eb6a3>=_0x4f3511['allowedLoginAttempts']){return utils['clearBlockUser'](_0x1a94a2,0x0,!![],moment())['then'](function(){return _0x29b045(null,![],{'message':_0xdcc8('0x16')});});}else{return utils[_0xdcc8('0x1c')](_0x1a94a2,_0x2eb6a3,![],null)['then'](function(){return _0x29b045(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x29b045(null,![],{'message':_0xdcc8('0x16')});}}else{if(_0x1a94a2[_0xdcc8('0xf')]){return _0x29b045(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4f3511['allowedLoginAttempts']>0x0){if(_0x1a94a2[_0xdcc8('0x10')]){if(_0x4f3511[_0xdcc8('0x19')]>0x0){if(moment(_0x1a94a2[_0xdcc8('0x11')])[_0xdcc8('0x1a')](_0x4f3511['blockDuration'],'minutes')>moment()){return _0x29b045(null,![],{'message':_0xdcc8('0x16')});}else{return utils[_0xdcc8('0x1c')](_0x1a94a2,0x0,![],null)[_0xdcc8('0x17')](function(){return utils['getLicense'](_0x1a94a2);})['then'](function(){return _0x29b045(null,_0x1a94a2);});}}else{return _0x29b045(null,![],{'message':_0xdcc8('0x16')});}}else{return utils[_0xdcc8('0x1c')](_0x1a94a2,0x0,![],null)[_0xdcc8('0x17')](function(){return utils['getLicense'](_0x1a94a2);})[_0xdcc8('0x17')](function(){return _0x29b045(null,_0x1a94a2);})['catch'](function(_0x3d8fc7){return _0x29b045(null,![],_0x3d8fc7);});}}else{if(_0x1a94a2[_0xdcc8('0x10')]){return _0x29b045(null,![],{'message':_0xdcc8('0x16')});}else{return utils[_0xdcc8('0x1d')](_0x1a94a2)[_0xdcc8('0x17')](function(){return _0x29b045(null,_0x1a94a2);});}}}});})[_0xdcc8('0x1e')](function(_0x25963e){return _0x29b045(null,![],_0x25963e);});}function sendServiceMail(_0x50ed1c){return db['MailAccount'][_0xdcc8('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xdcc8('0xb'),'email'],'include':[{'model':db[_0xdcc8('0x20')],'as':_0xdcc8('0x21'),'include':[{'model':db[_0xdcc8('0x22')],'as':_0xdcc8('0x22')}]}]})['then'](function(_0xe505a9){if(!_0xe505a9){throw new Error(_0xdcc8('0x23'));}var _0x5f01df=_0xe505a9[_0xdcc8('0x24')]();var _0x330a14={'account':_0x5f01df,'message':_[_0xdcc8('0x25')]({'from':util['format']('\x22%s\x22\x20<%s>',_0xe505a9[_0xdcc8('0xb')],_0xe505a9[_0xdcc8('0x26')]||_0xe505a9[_0xdcc8('0x21')][_0xdcc8('0x14')])},_0x50ed1c)};return client[_0xdcc8('0x27')](_0xdcc8('0x28'),_0x330a14);})[_0xdcc8('0x17')](function(_0x1b0179){if(_0x1b0179[_0xdcc8('0x29')]){throw new Error(util['format'](_0xdcc8('0x2a'),_0x1b0179[_0xdcc8('0x29')][_0xdcc8('0x2b')]||JSON[_0xdcc8('0x2c')](_0x1b0179[_0xdcc8('0x29')])));}return!![];});}function handleError(_0x54e641,_0x50ce7a,_0x439b65){return _0x54e641[_0xdcc8('0x2d')](_0x50ce7a||0x1f4)[_0xdcc8('0x2e')]({'message':_0x439b65?_0x439b65[_0xdcc8('0x2b')]||_0x439b65:''});}exports[_0xdcc8('0x2f')]=function(_0xf8d100,_0x816007,_0x68d0cb){passport[_0xdcc8('0x18')]('local-login',function(_0x4fd973,_0x3dab3c,_0x15baac){var _0x183281=_0x4fd973||_0x15baac;if(_0x183281){return handleError(_0x816007,0x191,_0x183281);}if(!_0x3dab3c){return handleError(_0x816007,0x194,{'message':_0xdcc8('0x30')});}else{var _0x4e1291={'payload':{'id':_0x3dab3c['id'],'role':_0x3dab3c['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4e1291)['then'](function(_0xe97dc0){_0x816007[_0xdcc8('0x31')]({'id':_0x3dab3c['id'],'token':_0xe97dc0,'statusCall':'','isAlreadyLogged':_0x3dab3c[_0xdcc8('0x32')]});});}})(_0xf8d100,_0x816007,_0x68d0cb);};exports[_0xdcc8('0x33')]=function(_0x56ea43,_0x436b60){if(!_0x56ea43[_0xdcc8('0x34')][_0xdcc8('0x26')]){return handleError(_0x436b60,0x1f4,{'message':_0xdcc8('0x35')});}var _0x288367=rs[_0xdcc8('0x36')]();_0x56ea43[_0xdcc8('0x34')]['email']=_0x56ea43[_0xdcc8('0x34')][_0xdcc8('0x26')]['trim']()['toLowerCase']();var _0x420f53;return db['Setting'][_0xdcc8('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xdcc8('0x17')](function(_0x5718a6){_0x420f53=_0x5718a6;return db[_0xdcc8('0x37')]['find']({'where':{'email':_0x56ea43[_0xdcc8('0x34')][_0xdcc8('0x26')]}});})[_0xdcc8('0x17')](function(_0x11ebce){if(!_0x11ebce){throw new Error(_0xdcc8('0x38'));}if(_0x11ebce[_0xdcc8('0xf')]){throw new Error(_0xdcc8('0x39'));}if(_0x11ebce[_0xdcc8('0x10')]){if(moment(_0x11ebce[_0xdcc8('0x11')])[_0xdcc8('0x1a')](_0x420f53[_0xdcc8('0x19')],_0xdcc8('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x11ebce[_0xdcc8('0x10')]=![];_0x11ebce[_0xdcc8('0x11')]=null;}}_0x11ebce[_0xdcc8('0x3a')]=_0x288367;_0x11ebce['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x11ebce[_0xdcc8('0x3b')]();})[_0xdcc8('0x17')](function(){return sendServiceMail({'to':_0x56ea43[_0xdcc8('0x34')][_0xdcc8('0x26')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xdcc8('0x3c')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xdcc8('0x3d')+_0x56ea43[_0xdcc8('0x3e')][_0xdcc8('0x3f')]+_0xdcc8('0x40')+_0x288367+'\x0a\x0a'+_0xdcc8('0x41')});})[_0xdcc8('0x17')](function(){_0x436b60[_0xdcc8('0x2d')](0xc8)[_0xdcc8('0x2e')]({'message':_0xdcc8('0x42')});})[_0xdcc8('0x1e')](function(_0x1fa8ca){return handleError(_0x436b60,0x1f4,_0x1fa8ca);});};exports[_0xdcc8('0x43')]=function(_0x3520f7,_0x259e55){return db[_0xdcc8('0x37')][_0xdcc8('0x1f')]({'where':{'resetPasswordToken':_0x3520f7[_0xdcc8('0x44')][_0xdcc8('0x45')],'resetPasswordExpires':{'$gt':Date[_0xdcc8('0x46')]()}}})[_0xdcc8('0x17')](function(_0x557270){if(!_0x557270){throw new Error(_0xdcc8('0x47'));}return db[_0xdcc8('0x48')][_0xdcc8('0xa')]({'attributes':['id',_0xdcc8('0x49'),_0xdcc8('0x4a'),_0xdcc8('0x4b')]})[_0xdcc8('0x17')](function(_0x2fbe26){if(_0x2fbe26[_0xdcc8('0x49')])authService['validatePasswordPattern'](_0x3520f7[_0xdcc8('0x34')][_0xdcc8('0xc')]);if(!_0x2fbe26[_0xdcc8('0x4a')]||!_0x557270[_0xdcc8('0x4c')])return _0x557270;authService['validatePasswordHistory'](_0x3520f7[_0xdcc8('0x34')][_0xdcc8('0xc')],_0x557270['previousPasswords'],_0x2fbe26[_0xdcc8('0x4b')]);return _0x557270;})[_0xdcc8('0x17')](function(){_0x557270[_0xdcc8('0xc')]=_0x3520f7[_0xdcc8('0x34')][_0xdcc8('0xc')];_0x557270[_0xdcc8('0x3a')]=null;_0x557270[_0xdcc8('0x4d')]=null;return _0x557270[_0xdcc8('0x3b')]();});})[_0xdcc8('0x17')](function(){_0x259e55[_0xdcc8('0x2d')](0xc8)['send']({'message':_0xdcc8('0x4e')});})[_0xdcc8('0x1e')](function(_0x268c96){return handleError(_0x259e55,0x1f4,_0x268c96);});};passport[_0xdcc8('0x4f')](_0xdcc8('0x50'),new LocalStrategy({'usernameField':_0xdcc8('0xb'),'passwordField':_0xdcc8('0xc')},function(_0x11800f,_0x498ed2,_0x1aabd3){return localAuthenticate(db[_0xdcc8('0x37')],_0x11800f,_0x498ed2,_0x1aabd3);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 6b94656..dbfc4ad 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 _0x62ee=['post','/forgot','forgot','reset'];(function(_0xd14085,_0x43ada7){var _0x5d6821=function(_0x40a678){while(--_0x40a678){_0xd14085['push'](_0xd14085['shift']());}};_0x5d6821(++_0x43ada7);}(_0x62ee,0xec));var _0xe62e=function(_0xa1c82e,_0x407696){_0xa1c82e=_0xa1c82e-0x0;var _0x1d3cb4=_0x62ee[_0xa1c82e];return _0x1d3cb4;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0xe62e('0x0')]('/',controller['login']);router[_0xe62e('0x0')](_0xe62e('0x1'),controller[_0xe62e('0x2')]);router['post']('/reset/:token',controller[_0xe62e('0x3')]);module['exports']=router; \ No newline at end of file +var _0xd724=['post','login','forgot','reset','exports','express','Router','./authLocal.controller'];(function(_0x1c57a5,_0x433064){var _0x3dadb9=function(_0x5cf957){while(--_0x5cf957){_0x1c57a5['push'](_0x1c57a5['shift']());}};_0x3dadb9(++_0x433064);}(_0xd724,0x6d));var _0x4d72=function(_0x5a5d3a,_0x1cc3b5){_0x5a5d3a=_0x5a5d3a-0x0;var _0x5856fb=_0xd724[_0x5a5d3a];return _0x5856fb;};'use strict';var express=require(_0x4d72('0x0'));var router=express[_0x4d72('0x1')]();var controller=require(_0x4d72('0x2'));router[_0x4d72('0x3')]('/',controller[_0x4d72('0x4')]);router['post']('/forgot',controller[_0x4d72('0x5')]);router['post']('/reset/:token',controller[_0x4d72('0x6')]);module[_0x4d72('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 1f356ae..bd46664 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 _0x4b83=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x88b314,_0x2775ed){var _0x474c53=function(_0x1dba35){while(--_0x1dba35){_0x88b314['push'](_0x88b314['shift']());}};_0x474c53(++_0x2775ed);}(_0x4b83,0x1ed));var _0x34b8=function(_0x1ec381,_0x26306b){_0x1ec381=_0x1ec381-0x0;var _0x130dd9=_0x4b83[_0x1ec381];return _0x130dd9;};'use strict';var Sequelize=require('sequelize');module[_0x34b8('0x0')]={'name':{'type':Sequelize[_0x34b8('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x34b8('0x1')]},'description':{'type':Sequelize[_0x34b8('0x1')]},'status':{'type':Sequelize[_0x34b8('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x34b8('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x7e8c=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x24c010,_0xfe4e6f){var _0x702c25=function(_0x994200){while(--_0x994200){_0x24c010['push'](_0x24c010['shift']());}};_0x702c25(++_0xfe4e6f);}(_0x7e8c,0x135));var _0xc7e8=function(_0x5d4982,_0x3a3cad){_0x5d4982=_0x5d4982-0x0;var _0x53156e=_0x7e8c[_0x5d4982];return _0x53156e;};'use strict';var Sequelize=require(_0xc7e8('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7e8('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc7e8('0x1')]},'status':{'type':Sequelize[_0xc7e8('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc7e8('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 6bda431..90139c1 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 _0xecbd=['filter','merge','map','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','find','create','body','update','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','sendStatus','error','name','send','index','Automation','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecbd,0x6a));var _0xdecb=function(_0x58e316,_0x360da9){_0x58e316=_0x58e316-0x0;var _0x1c946d=_0xecbd[_0x58e316];return _0x1c946d;};'use strict';var emlformat=require(_0xdecb('0x0'));var rimraf=require(_0xdecb('0x1'));var zipdir=require(_0xdecb('0x2'));var jsonpatch=require(_0xdecb('0x3'));var rp=require(_0xdecb('0x4'));var moment=require('moment');var BPromise=require(_0xdecb('0x5'));var Mustache=require('mustache');var util=require(_0xdecb('0x6'));var path=require(_0xdecb('0x7'));var sox=require(_0xdecb('0x8'));var csv=require('to-csv');var ejs=require(_0xdecb('0x9'));var fs=require('fs');var fs_extra=require(_0xdecb('0xa'));var _=require(_0xdecb('0xb'));var squel=require(_0xdecb('0xc'));var crypto=require(_0xdecb('0xd'));var jsforce=require(_0xdecb('0xe'));var deskjs=require(_0xdecb('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdecb('0x10'));var Papa=require('papaparse');var Redis=require(_0xdecb('0x11'));var authService=require(_0xdecb('0x12'));var qs=require(_0xdecb('0x13'));var as=require(_0xdecb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdecb('0x15'))(_0xdecb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdecb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x199ed0,_0x4e092b){_0x4e092b=_0x4e092b||0xcc;return function(_0x1eaaac){if(_0x1eaaac){return _0x199ed0['sendStatus'](_0x4e092b);}return _0x199ed0[_0xdecb('0x18')](_0x4e092b)[_0xdecb('0x19')]();};}function respondWithResult(_0xd1cc34,_0x4eafc4){_0x4eafc4=_0x4eafc4||0xc8;return function(_0x59922f){if(_0x59922f){return _0xd1cc34[_0xdecb('0x18')](_0x4eafc4)[_0xdecb('0x1a')](_0x59922f);}};}function respondWithFilteredResult(_0x1e66cd,_0xd09fb5){return function(_0x5cbf89){if(_0x5cbf89){var _0x83ab87=typeof _0xd09fb5[_0xdecb('0x1b')]==='undefined'&&typeof _0xd09fb5['limit']===_0xdecb('0x1c');var _0x2bb301=_0x5cbf89['count'];var _0x693c35=_0x83ab87?0x0:_0xd09fb5[_0xdecb('0x1b')];var _0x3fe10c=_0x83ab87?_0x5cbf89[_0xdecb('0x1d')]:_0xd09fb5[_0xdecb('0x1b')]+_0xd09fb5[_0xdecb('0x1e')];var _0x16bdda;if(_0x3fe10c>=_0x2bb301){_0x3fe10c=_0x2bb301;_0x16bdda=0xc8;}else{_0x16bdda=0xce;}_0x1e66cd[_0xdecb('0x18')](_0x16bdda);return _0x1e66cd[_0xdecb('0x1f')]('Content-Range',_0x693c35+'-'+_0x3fe10c+'/'+_0x2bb301)[_0xdecb('0x1a')](_0x5cbf89);}return null;};}function patchUpdates(_0x13c981){return function(_0x162afb){try{jsonpatch[_0xdecb('0x20')](_0x162afb,_0x13c981,!![]);}catch(_0x4624b6){return BPromise[_0xdecb('0x21')](_0x4624b6);}return _0x162afb[_0xdecb('0x22')]();};}function saveUpdates(_0x428805,_0x1facc3){return function(_0x14c4b0){if(_0x14c4b0){return _0x14c4b0['update'](_0x428805)[_0xdecb('0x23')](function(_0x3ceb66){return _0x3ceb66;});}return null;};}function removeEntity(_0x3e38a2,_0x248c36){return function(_0x302e72){if(_0x302e72){return _0x302e72[_0xdecb('0x24')]()[_0xdecb('0x23')](function(){_0x3e38a2[_0xdecb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18da92,_0x211308){return function(_0x4182c5){if(!_0x4182c5){_0x18da92[_0xdecb('0x25')](0x194);}return _0x4182c5;};}function handleError(_0x2d4f73,_0x45e420){_0x45e420=_0x45e420||0x1f4;return function(_0x6e7fe0){logger[_0xdecb('0x26')](_0x6e7fe0['stack']);if(_0x6e7fe0[_0xdecb('0x27')]){delete _0x6e7fe0[_0xdecb('0x27')];}_0x2d4f73[_0xdecb('0x18')](_0x45e420)[_0xdecb('0x28')](_0x6e7fe0);};}exports[_0xdecb('0x29')]=function(_0x2ce509,_0x3d572f){var _0x5c3b4b={},_0x4e78b0={},_0x5c2668={'count':0x0,'rows':[]};var _0x4996d2=_['map'](db[_0xdecb('0x2a')]['rawAttributes'],function(_0x42cd91){return{'name':_0x42cd91[_0xdecb('0x2b')],'type':_0x42cd91[_0xdecb('0x2c')][_0xdecb('0x2d')]};});_0x4e78b0['model']=_['map'](_0x4996d2,_0xdecb('0x27'));_0x4e78b0[_0xdecb('0x2e')]=_[_0xdecb('0x2f')](_0x2ce509[_0xdecb('0x2e')]);_0x4e78b0[_0xdecb('0x30')]=_[_0xdecb('0x31')](_0x4e78b0[_0xdecb('0x32')],_0x4e78b0[_0xdecb('0x2e')]);_0x5c3b4b[_0xdecb('0x33')]=_[_0xdecb('0x31')](_0x4e78b0['model'],qs[_0xdecb('0x34')](_0x2ce509[_0xdecb('0x2e')][_0xdecb('0x34')]));_0x5c3b4b[_0xdecb('0x33')]=_0x5c3b4b[_0xdecb('0x33')][_0xdecb('0x35')]?_0x5c3b4b['attributes']:_0x4e78b0['model'];if(!_0x2ce509['query'][_0xdecb('0x36')](_0xdecb('0x37'))){_0x5c3b4b['limit']=qs['limit'](_0x2ce509['query'][_0xdecb('0x1e')]);_0x5c3b4b['offset']=qs['offset'](_0x2ce509[_0xdecb('0x2e')][_0xdecb('0x1b')]);}_0x5c3b4b[_0xdecb('0x38')]=qs[_0xdecb('0x39')](_0x2ce509[_0xdecb('0x2e')][_0xdecb('0x39')]);_0x5c3b4b[_0xdecb('0x3a')]=qs['filters'](_[_0xdecb('0x3b')](_0x2ce509[_0xdecb('0x2e')],_0x4e78b0['filters']),_0x4996d2);if(_0x2ce509[_0xdecb('0x2e')][_0xdecb('0x3c')]){_0x5c3b4b[_0xdecb('0x3a')]=_[_0xdecb('0x3d')](_0x5c3b4b[_0xdecb('0x3a')],{'$or':_[_0xdecb('0x3e')](_0x4996d2,function(_0x5a5b66){if(_0x5a5b66[_0xdecb('0x2c')]!==_0xdecb('0x3f')){var _0x36fa38={};_0x36fa38[_0x5a5b66['name']]={'$like':'%'+_0x2ce509['query'][_0xdecb('0x3c')]+'%'};return _0x36fa38;}})});}_0x5c3b4b=_[_0xdecb('0x3d')]({},_0x5c3b4b,_0x2ce509[_0xdecb('0x40')]);var _0x4f4fc2={'where':_0x5c3b4b[_0xdecb('0x3a')]};return db['Automation']['count'](_0x4f4fc2)[_0xdecb('0x23')](function(_0x39548a){_0x5c2668[_0xdecb('0x1d')]=_0x39548a;if(_0x2ce509[_0xdecb('0x2e')][_0xdecb('0x41')]){_0x5c3b4b['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x5c3b4b);})[_0xdecb('0x23')](function(_0x3a8f91){_0x5c2668[_0xdecb('0x42')]=_0x3a8f91;return _0x5c2668;})[_0xdecb('0x23')](respondWithFilteredResult(_0x3d572f,_0x5c3b4b))[_0xdecb('0x43')](handleError(_0x3d572f,null));};exports['show']=function(_0x24e2b3,_0x28460e){var _0x30ea8a={'raw':![],'where':{'id':_0x24e2b3[_0xdecb('0x44')]['id']}},_0x5e06ce={};_0x5e06ce[_0xdecb('0x32')]=_['keys'](db[_0xdecb('0x2a')][_0xdecb('0x45')]);_0x5e06ce[_0xdecb('0x2e')]=_[_0xdecb('0x2f')](_0x24e2b3['query']);_0x5e06ce['filters']=_[_0xdecb('0x31')](_0x5e06ce['model'],_0x5e06ce[_0xdecb('0x2e')]);_0x30ea8a['attributes']=_[_0xdecb('0x31')](_0x5e06ce[_0xdecb('0x32')],qs['fields'](_0x24e2b3['query']['fields']));_0x30ea8a[_0xdecb('0x33')]=_0x30ea8a[_0xdecb('0x33')][_0xdecb('0x35')]?_0x30ea8a[_0xdecb('0x33')]:_0x5e06ce['model'];if(_0x24e2b3['query'][_0xdecb('0x41')]){_0x30ea8a['include']=[{'all':!![]}];}_0x30ea8a=_[_0xdecb('0x3d')]({},_0x30ea8a,_0x24e2b3[_0xdecb('0x40')]);return db[_0xdecb('0x2a')][_0xdecb('0x46')](_0x30ea8a)[_0xdecb('0x23')](handleEntityNotFound(_0x28460e,null))[_0xdecb('0x23')](respondWithResult(_0x28460e,null))[_0xdecb('0x43')](handleError(_0x28460e,null));};exports['create']=function(_0x2249c0,_0x35854b){return db[_0xdecb('0x2a')][_0xdecb('0x47')](_0x2249c0[_0xdecb('0x48')],{})['then'](respondWithResult(_0x35854b,0xc9))['catch'](handleError(_0x35854b,null));};exports[_0xdecb('0x49')]=function(_0x58c674,_0x115666){if(_0x58c674['body']['id']){delete _0x58c674['body']['id'];}return db['Automation'][_0xdecb('0x46')]({'where':{'id':_0x58c674['params']['id']}})[_0xdecb('0x23')](handleEntityNotFound(_0x115666,null))[_0xdecb('0x23')](saveUpdates(_0x58c674[_0xdecb('0x48')],null))[_0xdecb('0x23')](respondWithResult(_0x115666,null))['catch'](handleError(_0x115666,null));};exports[_0xdecb('0x24')]=function(_0x441b45,_0x6a851a){return db[_0xdecb('0x2a')][_0xdecb('0x46')]({'where':{'id':_0x441b45[_0xdecb('0x44')]['id']}})['then'](handleEntityNotFound(_0x6a851a,null))[_0xdecb('0x23')](removeEntity(_0x6a851a,null))[_0xdecb('0x43')](handleError(_0x6a851a,null));};exports[_0xdecb('0x4a')]=function(_0x4cfc69,_0xbc96c7,_0x1bf295){return db[_0xdecb('0x4b')][_0xdecb('0x46')]({'where':{'id':_0x4cfc69[_0xdecb('0x44')]['id']}})[_0xdecb('0x23')](handleEntityNotFound(_0xbc96c7,null))['then'](function(_0x5e4de3){if(_0x5e4de3){return _0x5e4de3[_0xdecb('0x4a')](_0x4cfc69[_0xdecb('0x48')][_0xdecb('0x4c')],_[_0xdecb('0x4d')](_0x4cfc69[_0xdecb('0x48')],[_0xdecb('0x4c'),'id'])||{});}})[_0xdecb('0x23')](respondWithResult(_0xbc96c7,null))[_0xdecb('0x43')](handleError(_0xbc96c7,null));};exports['getConditions']=function(_0x1f3763,_0xf8d8be,_0x3fa684){var _0x1ba836={};var _0x1d5729={};var _0x15b69b;var _0x6ea6da;return db[_0xdecb('0x2a')][_0xdecb('0x4e')]({'where':{'id':_0x1f3763[_0xdecb('0x44')]['id']}})[_0xdecb('0x23')](handleEntityNotFound(_0xf8d8be,null))[_0xdecb('0x23')](function(_0x4d3c5a){if(_0x4d3c5a){_0x15b69b=_0x4d3c5a;_0x1d5729[_0xdecb('0x32')]=_['keys'](db['Condition']['rawAttributes']);_0x1d5729[_0xdecb('0x2e')]=_[_0xdecb('0x2f')](_0x1f3763[_0xdecb('0x2e')]);_0x1d5729[_0xdecb('0x30')]=_[_0xdecb('0x31')](_0x1d5729[_0xdecb('0x32')],_0x1d5729['query']);_0x1ba836['attributes']=_['intersection'](_0x1d5729[_0xdecb('0x32')],qs[_0xdecb('0x34')](_0x1f3763[_0xdecb('0x2e')][_0xdecb('0x34')]));_0x1ba836[_0xdecb('0x33')]=_0x1ba836[_0xdecb('0x33')][_0xdecb('0x35')]?_0x1ba836[_0xdecb('0x33')]:_0x1d5729[_0xdecb('0x32')];_0x1ba836[_0xdecb('0x38')]=qs[_0xdecb('0x39')](_0x1f3763[_0xdecb('0x2e')][_0xdecb('0x39')]);_0x1ba836[_0xdecb('0x3a')]=qs[_0xdecb('0x30')](_[_0xdecb('0x3b')](_0x1f3763['query'],_0x1d5729[_0xdecb('0x30')]));if(_0x1f3763[_0xdecb('0x2e')]['filter']){_0x1ba836[_0xdecb('0x3a')]=_[_0xdecb('0x3d')](_0x1ba836[_0xdecb('0x3a')],{'$or':_[_0xdecb('0x3e')](_0x1ba836[_0xdecb('0x33')],function(_0x555202){var _0x601b91={};_0x601b91[_0x555202]={'$like':'%'+_0x1f3763[_0xdecb('0x2e')][_0xdecb('0x3c')]+'%'};return _0x601b91;})});}_0x1ba836=_[_0xdecb('0x3d')]({},_0x1ba836,_0x1f3763['options']);return _0x15b69b['getConditions'](_0x1ba836);}})[_0xdecb('0x23')](function(_0x351fc6){if(_0x351fc6){_0x6ea6da=_0x351fc6[_0xdecb('0x35')];if(!_0x1f3763[_0xdecb('0x2e')][_0xdecb('0x36')]('nolimit')){_0x1ba836[_0xdecb('0x1e')]=qs[_0xdecb('0x1e')](_0x1f3763['query'][_0xdecb('0x1e')]);_0x1ba836['offset']=qs[_0xdecb('0x1b')](_0x1f3763[_0xdecb('0x2e')][_0xdecb('0x1b')]);}return _0x15b69b[_0xdecb('0x4f')](_0x1ba836);}})[_0xdecb('0x23')](function(_0x3802e7){if(_0x3802e7){return _0x3802e7?{'count':_0x6ea6da,'rows':_0x3802e7}:null;}})[_0xdecb('0x23')](respondWithResult(_0xf8d8be,null))[_0xdecb('0x43')](handleError(_0xf8d8be,null));};exports[_0xdecb('0x50')]=function(_0x131b08,_0x3b940c,_0x236729){return db[_0xdecb('0x51')][_0xdecb('0x46')]({'where':{'id':_0x131b08[_0xdecb('0x44')]['id']}})[_0xdecb('0x23')](handleEntityNotFound(_0x3b940c,null))[_0xdecb('0x23')](function(_0x4e054f){if(_0x4e054f){return _0x4e054f[_0xdecb('0x50')](_0x131b08[_0xdecb('0x48')][_0xdecb('0x4c')],_['omit'](_0x131b08['body'],['ids','id'])||{});}})[_0xdecb('0x23')](respondWithResult(_0x3b940c,null))[_0xdecb('0x43')](handleError(_0x3b940c,null));};exports[_0xdecb('0x52')]=function(_0x4fbb54,_0x4fda74,_0x5ab384){var _0x4832e2={};var _0x5c327b={};var _0x5309ed;var _0xcf6a7c;return db[_0xdecb('0x2a')][_0xdecb('0x4e')]({'where':{'id':_0x4fbb54['params']['id']}})[_0xdecb('0x23')](handleEntityNotFound(_0x4fda74,null))[_0xdecb('0x23')](function(_0x36bdc4){if(_0x36bdc4){_0x5309ed=_0x36bdc4;_0x5c327b[_0xdecb('0x32')]=_[_0xdecb('0x2f')](db[_0xdecb('0x51')][_0xdecb('0x45')]);_0x5c327b[_0xdecb('0x2e')]=_[_0xdecb('0x2f')](_0x4fbb54[_0xdecb('0x2e')]);_0x5c327b[_0xdecb('0x30')]=_[_0xdecb('0x31')](_0x5c327b[_0xdecb('0x32')],_0x5c327b[_0xdecb('0x2e')]);_0x4832e2[_0xdecb('0x33')]=_[_0xdecb('0x31')](_0x5c327b[_0xdecb('0x32')],qs['fields'](_0x4fbb54[_0xdecb('0x2e')][_0xdecb('0x34')]));_0x4832e2['attributes']=_0x4832e2['attributes'][_0xdecb('0x35')]?_0x4832e2[_0xdecb('0x33')]:_0x5c327b['model'];_0x4832e2[_0xdecb('0x38')]=qs[_0xdecb('0x39')](_0x4fbb54[_0xdecb('0x2e')][_0xdecb('0x39')]);_0x4832e2[_0xdecb('0x3a')]=qs[_0xdecb('0x30')](_[_0xdecb('0x3b')](_0x4fbb54[_0xdecb('0x2e')],_0x5c327b['filters']));if(_0x4fbb54[_0xdecb('0x2e')][_0xdecb('0x3c')]){_0x4832e2[_0xdecb('0x3a')]=_[_0xdecb('0x3d')](_0x4832e2[_0xdecb('0x3a')],{'$or':_[_0xdecb('0x3e')](_0x4832e2[_0xdecb('0x33')],function(_0x6be21f){var _0x3bd527={};_0x3bd527[_0x6be21f]={'$like':'%'+_0x4fbb54[_0xdecb('0x2e')][_0xdecb('0x3c')]+'%'};return _0x3bd527;})});}_0x4832e2=_[_0xdecb('0x3d')]({},_0x4832e2,_0x4fbb54[_0xdecb('0x40')]);return _0x5309ed[_0xdecb('0x52')](_0x4832e2);}})['then'](function(_0x537b69){if(_0x537b69){_0xcf6a7c=_0x537b69[_0xdecb('0x35')];if(!_0x4fbb54['query']['hasOwnProperty'](_0xdecb('0x37'))){_0x4832e2['limit']=qs[_0xdecb('0x1e')](_0x4fbb54[_0xdecb('0x2e')][_0xdecb('0x1e')]);_0x4832e2[_0xdecb('0x1b')]=qs[_0xdecb('0x1b')](_0x4fbb54[_0xdecb('0x2e')]['offset']);}return _0x5309ed['getActions'](_0x4832e2);}})[_0xdecb('0x23')](function(_0x46d457){if(_0x46d457){return _0x46d457?{'count':_0xcf6a7c,'rows':_0x46d457}:null;}})['then'](respondWithResult(_0x4fda74,null))[_0xdecb('0x43')](handleError(_0x4fda74,null));}; \ No newline at end of file +var _0x19e3=['mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','send','index','Automation','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','pick','filter','nolimit','addActions','Action','getActions','eml-format','rimraf','request-promise','bluebird'];(function(_0x455d72,_0xeec814){var _0x54343b=function(_0x65e0f2){while(--_0x65e0f2){_0x455d72['push'](_0x455d72['shift']());}};_0x54343b(++_0xeec814);}(_0x19e3,0x1e8));var _0x319e=function(_0x48c147,_0x2aa77f){_0x48c147=_0x48c147-0x0;var _0x4b1a3b=_0x19e3[_0x48c147];return _0x4b1a3b;};'use strict';var emlformat=require(_0x319e('0x0'));var rimraf=require(_0x319e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x319e('0x2'));var moment=require('moment');var BPromise=require(_0x319e('0x3'));var Mustache=require(_0x319e('0x4'));var util=require(_0x319e('0x5'));var path=require(_0x319e('0x6'));var sox=require(_0x319e('0x7'));var csv=require(_0x319e('0x8'));var ejs=require(_0x319e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x319e('0xa'));var crypto=require(_0x319e('0xb'));var jsforce=require(_0x319e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x319e('0x8'));var querystring=require(_0x319e('0xd'));var Papa=require(_0x319e('0xe'));var Redis=require('ioredis');var authService=require(_0x319e('0xf'));var qs=require(_0x319e('0x10'));var as=require(_0x319e('0x11'));var hardwareService=require(_0x319e('0x12'));var logger=require('../../config/logger')(_0x319e('0x13'));var utils=require(_0x319e('0x14'));var config=require(_0x319e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x319e('0x16'))['db'];function respondWithStatusCode(_0x35b4a1,_0x3d0a4c){_0x3d0a4c=_0x3d0a4c||0xcc;return function(_0x5385f7){if(_0x5385f7){return _0x35b4a1[_0x319e('0x17')](_0x3d0a4c);}return _0x35b4a1['status'](_0x3d0a4c)[_0x319e('0x18')]();};}function respondWithResult(_0x2014bd,_0x42c3d0){_0x42c3d0=_0x42c3d0||0xc8;return function(_0x1bbf9d){if(_0x1bbf9d){return _0x2014bd[_0x319e('0x19')](_0x42c3d0)[_0x319e('0x1a')](_0x1bbf9d);}};}function respondWithFilteredResult(_0x41ffea,_0x30d2c9){return function(_0xbcb9c1){if(_0xbcb9c1){var _0x1bc0d8=typeof _0x30d2c9['offset']===_0x319e('0x1b')&&typeof _0x30d2c9[_0x319e('0x1c')]===_0x319e('0x1b');var _0xf9a7da=_0xbcb9c1[_0x319e('0x1d')];var _0x1154b4=_0x1bc0d8?0x0:_0x30d2c9[_0x319e('0x1e')];var _0x3c3633=_0x1bc0d8?_0xbcb9c1['count']:_0x30d2c9['offset']+_0x30d2c9[_0x319e('0x1c')];var _0x1b240d;if(_0x3c3633>=_0xf9a7da){_0x3c3633=_0xf9a7da;_0x1b240d=0xc8;}else{_0x1b240d=0xce;}_0x41ffea[_0x319e('0x19')](_0x1b240d);return _0x41ffea['set'](_0x319e('0x1f'),_0x1154b4+'-'+_0x3c3633+'/'+_0xf9a7da)[_0x319e('0x1a')](_0xbcb9c1);}return null;};}function patchUpdates(_0x2fa583){return function(_0x29f477){try{jsonpatch[_0x319e('0x20')](_0x29f477,_0x2fa583,!![]);}catch(_0x14a25c){return BPromise[_0x319e('0x21')](_0x14a25c);}return _0x29f477['save']();};}function saveUpdates(_0xede7fb,_0x5b1ef4){return function(_0x4145fd){if(_0x4145fd){return _0x4145fd[_0x319e('0x22')](_0xede7fb)[_0x319e('0x23')](function(_0x94398c){return _0x94398c;});}return null;};}function removeEntity(_0x595f02,_0x4ed22a){return function(_0x3b70f5){if(_0x3b70f5){return _0x3b70f5[_0x319e('0x24')]()[_0x319e('0x23')](function(){_0x595f02[_0x319e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x496c07,_0x32a840){return function(_0x26691d){if(!_0x26691d){_0x496c07[_0x319e('0x17')](0x194);}return _0x26691d;};}function handleError(_0x11e03a,_0x23eb71){_0x23eb71=_0x23eb71||0x1f4;return function(_0x29dcc3){logger[_0x319e('0x25')](_0x29dcc3['stack']);if(_0x29dcc3[_0x319e('0x26')]){delete _0x29dcc3[_0x319e('0x26')];}_0x11e03a[_0x319e('0x19')](_0x23eb71)[_0x319e('0x27')](_0x29dcc3);};}exports[_0x319e('0x28')]=function(_0xd71007,_0xa806ad){var _0x36152e={},_0x2544c8={},_0x613948={'count':0x0,'rows':[]};var _0x4c3b2d=_['map'](db[_0x319e('0x29')]['rawAttributes'],function(_0x128d93){return{'name':_0x128d93[_0x319e('0x2a')],'type':_0x128d93['type']['key']};});_0x2544c8['model']=_[_0x319e('0x2b')](_0x4c3b2d,'name');_0x2544c8['query']=_[_0x319e('0x2c')](_0xd71007[_0x319e('0x2d')]);_0x2544c8[_0x319e('0x2e')]=_[_0x319e('0x2f')](_0x2544c8[_0x319e('0x30')],_0x2544c8['query']);_0x36152e[_0x319e('0x31')]=_[_0x319e('0x2f')](_0x2544c8[_0x319e('0x30')],qs[_0x319e('0x32')](_0xd71007['query'][_0x319e('0x32')]));_0x36152e[_0x319e('0x31')]=_0x36152e[_0x319e('0x31')][_0x319e('0x33')]?_0x36152e[_0x319e('0x31')]:_0x2544c8[_0x319e('0x30')];if(!_0xd71007[_0x319e('0x2d')][_0x319e('0x34')]('nolimit')){_0x36152e[_0x319e('0x1c')]=qs[_0x319e('0x1c')](_0xd71007[_0x319e('0x2d')][_0x319e('0x1c')]);_0x36152e['offset']=qs['offset'](_0xd71007['query']['offset']);}_0x36152e[_0x319e('0x35')]=qs[_0x319e('0x36')](_0xd71007['query']['sort']);_0x36152e[_0x319e('0x37')]=qs[_0x319e('0x2e')](_['pick'](_0xd71007['query'],_0x2544c8[_0x319e('0x2e')]),_0x4c3b2d);if(_0xd71007[_0x319e('0x2d')]['filter']){_0x36152e[_0x319e('0x37')]=_[_0x319e('0x38')](_0x36152e[_0x319e('0x37')],{'$or':_['map'](_0x4c3b2d,function(_0x5d5e42){if(_0x5d5e42[_0x319e('0x39')]!==_0x319e('0x3a')){var _0x2314a3={};_0x2314a3[_0x5d5e42[_0x319e('0x26')]]={'$like':'%'+_0xd71007[_0x319e('0x2d')]['filter']+'%'};return _0x2314a3;}})});}_0x36152e=_['merge']({},_0x36152e,_0xd71007[_0x319e('0x3b')]);var _0x202f1d={'where':_0x36152e[_0x319e('0x37')]};return db[_0x319e('0x29')][_0x319e('0x1d')](_0x202f1d)[_0x319e('0x23')](function(_0x37ed6a){_0x613948[_0x319e('0x1d')]=_0x37ed6a;if(_0xd71007[_0x319e('0x2d')][_0x319e('0x3c')]){_0x36152e['include']=[{'all':!![]}];}return db['Automation']['findAll'](_0x36152e);})[_0x319e('0x23')](function(_0x48695b){_0x613948[_0x319e('0x3d')]=_0x48695b;return _0x613948;})['then'](respondWithFilteredResult(_0xa806ad,_0x36152e))[_0x319e('0x3e')](handleError(_0xa806ad,null));};exports[_0x319e('0x3f')]=function(_0x41320a,_0x6d7bc7){var _0x51fee1={'raw':![],'where':{'id':_0x41320a[_0x319e('0x40')]['id']}},_0x2b59ab={};_0x2b59ab['model']=_[_0x319e('0x2c')](db['Automation'][_0x319e('0x41')]);_0x2b59ab[_0x319e('0x2d')]=_['keys'](_0x41320a[_0x319e('0x2d')]);_0x2b59ab[_0x319e('0x2e')]=_['intersection'](_0x2b59ab['model'],_0x2b59ab[_0x319e('0x2d')]);_0x51fee1[_0x319e('0x31')]=_[_0x319e('0x2f')](_0x2b59ab[_0x319e('0x30')],qs['fields'](_0x41320a[_0x319e('0x2d')][_0x319e('0x32')]));_0x51fee1['attributes']=_0x51fee1[_0x319e('0x31')][_0x319e('0x33')]?_0x51fee1['attributes']:_0x2b59ab[_0x319e('0x30')];if(_0x41320a['query'][_0x319e('0x3c')]){_0x51fee1[_0x319e('0x42')]=[{'all':!![]}];}_0x51fee1=_['merge']({},_0x51fee1,_0x41320a['options']);return db[_0x319e('0x29')][_0x319e('0x43')](_0x51fee1)['then'](handleEntityNotFound(_0x6d7bc7,null))[_0x319e('0x23')](respondWithResult(_0x6d7bc7,null))[_0x319e('0x3e')](handleError(_0x6d7bc7,null));};exports[_0x319e('0x44')]=function(_0x492589,_0x2152c9){return db[_0x319e('0x29')]['create'](_0x492589['body'],{})[_0x319e('0x23')](respondWithResult(_0x2152c9,0xc9))['catch'](handleError(_0x2152c9,null));};exports[_0x319e('0x22')]=function(_0x1dca36,_0x4e9f1f){if(_0x1dca36[_0x319e('0x45')]['id']){delete _0x1dca36['body']['id'];}return db['Automation'][_0x319e('0x43')]({'where':{'id':_0x1dca36['params']['id']}})[_0x319e('0x23')](handleEntityNotFound(_0x4e9f1f,null))[_0x319e('0x23')](saveUpdates(_0x1dca36['body'],null))[_0x319e('0x23')](respondWithResult(_0x4e9f1f,null))[_0x319e('0x3e')](handleError(_0x4e9f1f,null));};exports['destroy']=function(_0x1b7716,_0x47f666){return db[_0x319e('0x29')][_0x319e('0x43')]({'where':{'id':_0x1b7716[_0x319e('0x40')]['id']}})[_0x319e('0x23')](handleEntityNotFound(_0x47f666,null))[_0x319e('0x23')](removeEntity(_0x47f666,null))[_0x319e('0x3e')](handleError(_0x47f666,null));};exports[_0x319e('0x46')]=function(_0x163d06,_0x522103,_0x3837d4){return db[_0x319e('0x47')][_0x319e('0x43')]({'where':{'id':_0x163d06['params']['id']}})[_0x319e('0x23')](handleEntityNotFound(_0x522103,null))[_0x319e('0x23')](function(_0x8c8602){if(_0x8c8602){return _0x8c8602[_0x319e('0x46')](_0x163d06[_0x319e('0x45')][_0x319e('0x48')],_[_0x319e('0x49')](_0x163d06[_0x319e('0x45')],['ids','id'])||{});}})[_0x319e('0x23')](respondWithResult(_0x522103,null))[_0x319e('0x3e')](handleError(_0x522103,null));};exports[_0x319e('0x4a')]=function(_0x23c2d6,_0x1bda81,_0x2c4549){var _0x5e5331={};var _0x585606={};var _0x4e4961;var _0x3a8d56;return db[_0x319e('0x29')][_0x319e('0x4b')]({'where':{'id':_0x23c2d6['params']['id']}})['then'](handleEntityNotFound(_0x1bda81,null))[_0x319e('0x23')](function(_0x103ba9){if(_0x103ba9){_0x4e4961=_0x103ba9;_0x585606[_0x319e('0x30')]=_[_0x319e('0x2c')](db[_0x319e('0x47')][_0x319e('0x41')]);_0x585606[_0x319e('0x2d')]=_[_0x319e('0x2c')](_0x23c2d6[_0x319e('0x2d')]);_0x585606['filters']=_[_0x319e('0x2f')](_0x585606['model'],_0x585606[_0x319e('0x2d')]);_0x5e5331['attributes']=_[_0x319e('0x2f')](_0x585606[_0x319e('0x30')],qs[_0x319e('0x32')](_0x23c2d6[_0x319e('0x2d')][_0x319e('0x32')]));_0x5e5331[_0x319e('0x31')]=_0x5e5331[_0x319e('0x31')][_0x319e('0x33')]?_0x5e5331[_0x319e('0x31')]:_0x585606['model'];_0x5e5331[_0x319e('0x35')]=qs[_0x319e('0x36')](_0x23c2d6['query'][_0x319e('0x36')]);_0x5e5331[_0x319e('0x37')]=qs[_0x319e('0x2e')](_[_0x319e('0x4c')](_0x23c2d6['query'],_0x585606['filters']));if(_0x23c2d6[_0x319e('0x2d')][_0x319e('0x4d')]){_0x5e5331['where']=_['merge'](_0x5e5331[_0x319e('0x37')],{'$or':_['map'](_0x5e5331[_0x319e('0x31')],function(_0x20fd0e){var _0x578b50={};_0x578b50[_0x20fd0e]={'$like':'%'+_0x23c2d6[_0x319e('0x2d')][_0x319e('0x4d')]+'%'};return _0x578b50;})});}_0x5e5331=_['merge']({},_0x5e5331,_0x23c2d6['options']);return _0x4e4961[_0x319e('0x4a')](_0x5e5331);}})['then'](function(_0x54c9aa){if(_0x54c9aa){_0x3a8d56=_0x54c9aa[_0x319e('0x33')];if(!_0x23c2d6[_0x319e('0x2d')][_0x319e('0x34')](_0x319e('0x4e'))){_0x5e5331[_0x319e('0x1c')]=qs['limit'](_0x23c2d6['query'][_0x319e('0x1c')]);_0x5e5331['offset']=qs[_0x319e('0x1e')](_0x23c2d6[_0x319e('0x2d')]['offset']);}return _0x4e4961[_0x319e('0x4a')](_0x5e5331);}})[_0x319e('0x23')](function(_0x35028a){if(_0x35028a){return _0x35028a?{'count':_0x3a8d56,'rows':_0x35028a}:null;}})['then'](respondWithResult(_0x1bda81,null))[_0x319e('0x3e')](handleError(_0x1bda81,null));};exports[_0x319e('0x4f')]=function(_0x172503,_0x12a5ed,_0x548e99){return db['Action']['find']({'where':{'id':_0x172503['params']['id']}})[_0x319e('0x23')](handleEntityNotFound(_0x12a5ed,null))[_0x319e('0x23')](function(_0x6d7753){if(_0x6d7753){return _0x6d7753[_0x319e('0x4f')](_0x172503[_0x319e('0x45')][_0x319e('0x48')],_[_0x319e('0x49')](_0x172503[_0x319e('0x45')],[_0x319e('0x48'),'id'])||{});}})[_0x319e('0x23')](respondWithResult(_0x12a5ed,null))[_0x319e('0x3e')](handleError(_0x12a5ed,null));};exports['getActions']=function(_0x2678af,_0x326875,_0x1ea841){var _0x5e890e={};var _0x28bca3={};var _0x3c9b69;var _0x4f859e;return db['Automation'][_0x319e('0x4b')]({'where':{'id':_0x2678af[_0x319e('0x40')]['id']}})[_0x319e('0x23')](handleEntityNotFound(_0x326875,null))['then'](function(_0x282362){if(_0x282362){_0x3c9b69=_0x282362;_0x28bca3['model']=_[_0x319e('0x2c')](db[_0x319e('0x50')][_0x319e('0x41')]);_0x28bca3[_0x319e('0x2d')]=_[_0x319e('0x2c')](_0x2678af[_0x319e('0x2d')]);_0x28bca3[_0x319e('0x2e')]=_['intersection'](_0x28bca3[_0x319e('0x30')],_0x28bca3['query']);_0x5e890e['attributes']=_['intersection'](_0x28bca3['model'],qs[_0x319e('0x32')](_0x2678af['query'][_0x319e('0x32')]));_0x5e890e[_0x319e('0x31')]=_0x5e890e['attributes'][_0x319e('0x33')]?_0x5e890e['attributes']:_0x28bca3[_0x319e('0x30')];_0x5e890e['order']=qs[_0x319e('0x36')](_0x2678af[_0x319e('0x2d')][_0x319e('0x36')]);_0x5e890e[_0x319e('0x37')]=qs['filters'](_['pick'](_0x2678af[_0x319e('0x2d')],_0x28bca3[_0x319e('0x2e')]));if(_0x2678af['query'][_0x319e('0x4d')]){_0x5e890e[_0x319e('0x37')]=_[_0x319e('0x38')](_0x5e890e[_0x319e('0x37')],{'$or':_[_0x319e('0x2b')](_0x5e890e[_0x319e('0x31')],function(_0x3f36eb){var _0x13e00a={};_0x13e00a[_0x3f36eb]={'$like':'%'+_0x2678af[_0x319e('0x2d')][_0x319e('0x4d')]+'%'};return _0x13e00a;})});}_0x5e890e=_['merge']({},_0x5e890e,_0x2678af[_0x319e('0x3b')]);return _0x3c9b69[_0x319e('0x51')](_0x5e890e);}})[_0x319e('0x23')](function(_0xeccb08){if(_0xeccb08){_0x4f859e=_0xeccb08[_0x319e('0x33')];if(!_0x2678af[_0x319e('0x2d')][_0x319e('0x34')](_0x319e('0x4e'))){_0x5e890e[_0x319e('0x1c')]=qs[_0x319e('0x1c')](_0x2678af[_0x319e('0x2d')][_0x319e('0x1c')]);_0x5e890e['offset']=qs[_0x319e('0x1e')](_0x2678af[_0x319e('0x2d')][_0x319e('0x1e')]);}return _0x3c9b69['getActions'](_0x5e890e);}})[_0x319e('0x23')](function(_0x1a527b){if(_0x1a527b){return _0x1a527b?{'count':_0x4f859e,'rows':_0x1a527b}:null;}})[_0x319e('0x23')](respondWithResult(_0x326875,null))['catch'](handleError(_0x326875,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b92846f..ffc63bc 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 _0x3ab3=['exports','define','Automation','tools_automations','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes'];(function(_0x540548,_0x19ded9){var _0x357892=function(_0x3485e3){while(--_0x3485e3){_0x540548['push'](_0x540548['shift']());}};_0x357892(++_0x19ded9);}(_0x3ab3,0x148));var _0x33ab=function(_0x17b94e,_0x1b2f59){_0x17b94e=_0x17b94e-0x0;var _0x14ab53=_0x3ab3[_0x17b94e];return _0x14ab53;};'use strict';var _=require(_0x33ab('0x0'));var util=require('util');var logger=require(_0x33ab('0x1'))(_0x33ab('0x2'));var moment=require('moment');var BPromise=require(_0x33ab('0x3'));var rp=require(_0x33ab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33ab('0x5'));var config=require(_0x33ab('0x6'));var attributes=require(_0x33ab('0x7'));module[_0x33ab('0x8')]=function(_0xd6d1c8,_0x34eec0){return _0xd6d1c8[_0x33ab('0x9')](_0x33ab('0xa'),attributes,{'tableName':_0x33ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbf9=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations','lodash','../../config/logger','api'];(function(_0x4dc520,_0x152c05){var _0x48a121=function(_0x280801){while(--_0x280801){_0x4dc520['push'](_0x4dc520['shift']());}};_0x48a121(++_0x152c05);}(_0xfbf9,0x9d));var _0x9fbf=function(_0x7074d5,_0x427953){_0x7074d5=_0x7074d5-0x0;var _0xced075=_0xfbf9[_0x7074d5];return _0xced075;};'use strict';var _=require(_0x9fbf('0x0'));var util=require('util');var logger=require(_0x9fbf('0x1'))(_0x9fbf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9fbf('0x3'));var fs=require('fs');var path=require(_0x9fbf('0x4'));var rimraf=require(_0x9fbf('0x5'));var config=require(_0x9fbf('0x6'));var attributes=require(_0x9fbf('0x7'));module[_0x9fbf('0x8')]=function(_0x2aa471,_0x108ae3){return _0x2aa471['define']('Automation',attributes,{'tableName':_0x9fbf('0x9'),'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 9397395..f04535d 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 _0x2d07=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d07,0x13a));var _0x72d0=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0x2d07[_0x1655bb];return _0x5e2020;};'use strict';var _=require(_0x72d0('0x0'));var util=require(_0x72d0('0x1'));var moment=require('moment');var BPromise=require(_0x72d0('0x2'));var rs=require(_0x72d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d0('0x4'))['db'];var utils=require(_0x72d0('0x5'));var logger=require(_0x72d0('0x6'))(_0x72d0('0x7'));var config=require(_0x72d0('0x8'));var jayson=require(_0x72d0('0x9'));var client=jayson['client'][_0x72d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdad2db,_0x2a4100,_0x47a826){return new BPromise(function(_0x4f2c34,_0x6d0ff6){return client['request'](_0xdad2db,_0x47a826)['then'](function(_0x5db523){logger[_0x72d0('0xb')](_0x72d0('0xc'),_0x2a4100,_0x72d0('0xd'));logger[_0x72d0('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x2a4100,'request\x20sent',JSON['stringify'](_0x5db523));if(_0x5db523[_0x72d0('0xf')]){if(_0x5db523[_0x72d0('0xf')][_0x72d0('0x10')]===0x1f4){logger[_0x72d0('0xf')](_0x72d0('0xc'),_0x2a4100,_0x5db523['error'][_0x72d0('0x11')]);return _0x6d0ff6(_0x5db523[_0x72d0('0xf')][_0x72d0('0x11')]);}logger['error'](_0x72d0('0xc'),_0x2a4100,_0x5db523[_0x72d0('0xf')][_0x72d0('0x11')]);return _0x4f2c34(_0x5db523[_0x72d0('0xf')][_0x72d0('0x11')]);}else{logger[_0x72d0('0xb')]('Automation,\x20%s,\x20%s',_0x2a4100,_0x72d0('0xd'));_0x4f2c34(_0x5db523[_0x72d0('0x12')][_0x72d0('0x11')]);}})[_0x72d0('0x13')](function(_0x2a761c){logger[_0x72d0('0xf')](_0x72d0('0xc'),_0x2a4100,_0x2a761c);_0x6d0ff6(_0x2a761c);});});} \ No newline at end of file +var _0x9805=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x432546,_0x3a28da){var _0x331a54=function(_0x46f73e){while(--_0x46f73e){_0x432546['push'](_0x432546['shift']());}};_0x331a54(++_0x3a28da);}(_0x9805,0x18f));var _0x5980=function(_0x26cb03,_0x38d271){_0x26cb03=_0x26cb03-0x0;var _0x5b7ac9=_0x9805[_0x26cb03];return _0x5b7ac9;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var moment=require(_0x5980('0x2'));var BPromise=require(_0x5980('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5980('0x4'))['db'];var utils=require(_0x5980('0x5'));var logger=require(_0x5980('0x6'))(_0x5980('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5980('0x8')][_0x5980('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9b,_0x1d6536,_0x175728){return new BPromise(function(_0x3399a9,_0xf8b3c0){return client[_0x5980('0xa')](_0x326b9b,_0x175728)[_0x5980('0xb')](function(_0x35b0ad){logger[_0x5980('0xc')](_0x5980('0xd'),_0x1d6536,'request\x20sent');logger['debug'](_0x5980('0xe'),_0x1d6536,_0x5980('0xf'),JSON[_0x5980('0x10')](_0x35b0ad));if(_0x35b0ad[_0x5980('0x11')]){if(_0x35b0ad['error'][_0x5980('0x12')]===0x1f4){logger[_0x5980('0x11')]('Automation,\x20%s,\x20%s',_0x1d6536,_0x35b0ad['error'][_0x5980('0x13')]);return _0xf8b3c0(_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);}logger[_0x5980('0x11')](_0x5980('0xd'),_0x1d6536,_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);return _0x3399a9(_0x35b0ad[_0x5980('0x11')]['message']);}else{logger[_0x5980('0xc')]('Automation,\x20%s,\x20%s',_0x1d6536,_0x5980('0xf'));_0x3399a9(_0x35b0ad[_0x5980('0x14')][_0x5980('0x13')]);}})[_0x5980('0x15')](function(_0x183261){logger['error'](_0x5980('0xd'),_0x1d6536,_0x183261);_0xf8b3c0(_0x183261);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c857b6e..d6be0f8 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 _0x7dfc=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','/:id/conditions','getActions','post','addConditions','addActions','put','update'];(function(_0x4a6102,_0xedf422){var _0x416650=function(_0x4be9ec){while(--_0x4be9ec){_0x4a6102['push'](_0x4a6102['shift']());}};_0x416650(++_0xedf422);}(_0x7dfc,0x19b));var _0xc7df=function(_0x2882d6,_0x2bd8d9){_0x2882d6=_0x2882d6-0x0;var _0x320195=_0x7dfc[_0x2882d6];return _0x320195;};'use strict';var multer=require(_0xc7df('0x0'));var util=require(_0xc7df('0x1'));var path=require('path');var timeout=require(_0xc7df('0x2'));var express=require(_0xc7df('0x3'));var router=express[_0xc7df('0x4')]();var fs_extra=require(_0xc7df('0x5'));var auth=require(_0xc7df('0x6'));var interaction=require(_0xc7df('0x7'));var config=require(_0xc7df('0x8'));var controller=require(_0xc7df('0x9'));router['get']('/',auth[_0xc7df('0xa')](),controller[_0xc7df('0xb')]);router[_0xc7df('0xc')](_0xc7df('0xd'),auth[_0xc7df('0xa')](),controller['show']);router[_0xc7df('0xc')](_0xc7df('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0xc7df('0xc')]('/:id/actions',auth[_0xc7df('0xa')](),controller[_0xc7df('0xf')]);router[_0xc7df('0x10')]('/',auth[_0xc7df('0xa')](),controller['create']);router['post'](_0xc7df('0xe'),auth[_0xc7df('0xa')](),controller[_0xc7df('0x11')]);router[_0xc7df('0x10')]('/:id/actions',auth[_0xc7df('0xa')](),controller[_0xc7df('0x12')]);router[_0xc7df('0x13')](_0xc7df('0xd'),auth['isAuthenticated'](),controller[_0xc7df('0x14')]);router[_0xc7df('0x15')](_0xc7df('0xd'),auth[_0xc7df('0xa')](),controller[_0xc7df('0x16')]);module[_0xc7df('0x17')]=router; \ No newline at end of file +var _0x9b83=['/:id/conditions','addConditions','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/actions','getActions','post','create'];(function(_0x298ab3,_0x55d7c0){var _0x44e6ed=function(_0x4e49c9){while(--_0x4e49c9){_0x298ab3['push'](_0x298ab3['shift']());}};_0x44e6ed(++_0x55d7c0);}(_0x9b83,0x84));var _0x39b8=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x9b83[_0x18abd2];return _0x1dcad6;};'use strict';var multer=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var path=require(_0x39b8('0x2'));var timeout=require(_0x39b8('0x3'));var express=require(_0x39b8('0x4'));var router=express[_0x39b8('0x5')]();var fs_extra=require(_0x39b8('0x6'));var auth=require(_0x39b8('0x7'));var interaction=require(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var controller=require('./automation.controller');router[_0x39b8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x39b8('0xa')](_0x39b8('0xb'),auth[_0x39b8('0xc')](),controller[_0x39b8('0xd')]);router[_0x39b8('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x39b8('0xa')](_0x39b8('0xe'),auth[_0x39b8('0xc')](),controller[_0x39b8('0xf')]);router[_0x39b8('0x10')]('/',auth[_0x39b8('0xc')](),controller[_0x39b8('0x11')]);router[_0x39b8('0x10')](_0x39b8('0x12'),auth['isAuthenticated'](),controller[_0x39b8('0x13')]);router['post'](_0x39b8('0xe'),auth[_0x39b8('0xc')](),controller[_0x39b8('0x14')]);router[_0x39b8('0x15')]('/:id',auth[_0x39b8('0xc')](),controller[_0x39b8('0x16')]);router[_0x39b8('0x17')](_0x39b8('0xb'),auth['isAuthenticated'](),controller[_0x39b8('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 328b2c1..e1d7700 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 _0x7218=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','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)'];(function(_0x1b1c1d,_0x34518e){var _0x3ec953=function(_0x595897){while(--_0x595897){_0x1b1c1d['push'](_0x1b1c1d['shift']());}};_0x3ec953(++_0x34518e);}(_0x7218,0x196));var _0x8721=function(_0x228600,_0x416328){_0x228600=_0x228600-0x0;var _0xaab27c=_0x7218[_0x228600];return _0xaab27c;};'use strict';var Sequelize=require(_0x8721('0x0'));module['exports']={'name':{'type':Sequelize[_0x8721('0x1')],'unique':_0x8721('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8721('0x3')](_0x8721('0x4')),'allowNull':![],'defaultValue':_0x8721('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8721('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x8721('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x8721('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8721('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8721('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8721('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8721('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8721('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8721('0x7')](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8721('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8721('0x6')],'defaultValue':0x3,'comment':_0x8721('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8721('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8721('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8721('0xe')},'dialTimezone':{'type':Sequelize[_0x8721('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x8721('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x8721('0x3')]('always','never',_0x8721('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x8721('0x11')],'defaultValue':0x0,'comment':_0x8721('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8721('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x8721('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8721('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8721('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8721('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8721('0x7')](0x9)[_0x8721('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8721('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8721('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8721('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8721('0x7')](0x9)[_0x8721('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8721('0x7')](0x9)[_0x8721('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8721('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8721('0x7')](0x5)[_0x8721('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8721('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8721('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8721('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8721('0x3')](_0x8721('0x1b'),_0x8721('0x1c')),'defaultValue':_0x8721('0x1b')},'dialPrefix':{'type':Sequelize[_0x8721('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8721('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8721('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8721('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8721('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x8721('0x7')](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8721('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8721('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8721('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8721('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8721('0x7')](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8721('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8721('0x7')](0x3)[_0x8721('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8721('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8721('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x9af4=['#Busy\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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x2dcbb4,_0x5101ee){var _0x1cd307=function(_0x1516e9){while(--_0x1516e9){_0x2dcbb4['push'](_0x2dcbb4['shift']());}};_0x1cd307(++_0x5101ee);}(_0x9af4,0x1a7));var _0x49af=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9af4[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0x49af('0x0'));module['exports']={'name':{'type':Sequelize[_0x49af('0x1')],'unique':_0x49af('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x49af('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x49af('0x1')]},'active':{'type':Sequelize[_0x49af('0x4')],'defaultValue':0x0,'comment':_0x49af('0x5')},'limitCalls':{'type':Sequelize[_0x49af('0x6')](0x4)[_0x49af('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x49af('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x49af('0x6')](0x3)[_0x49af('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49af('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x49af('0x6')](0x3)[_0x49af('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x49af('0x6')](0x5)[_0x49af('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x49af('0x6')](0x3)[_0x49af('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49af('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x49af('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49af('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x49af('0x6')](0x3)[_0x49af('0x7')],'defaultValue':0x3,'comment':_0x49af('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x49af('0x6')](0x5)[_0x49af('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49af('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x49af('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x49af('0xd')},'dialTimezone':{'type':Sequelize[_0x49af('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x49af('0x1')],'defaultValue':_0x49af('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x49af('0xf')](_0x49af('0x10'),_0x49af('0x11'),_0x49af('0x12')),'defaultValue':_0x49af('0x10')},'dialAMDActive':{'type':Sequelize[_0x49af('0x4')],'defaultValue':0x0,'comment':_0x49af('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x49af('0x6')](0x9)[_0x49af('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x49af('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x49af('0x6')](0x9)[_0x49af('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x49af('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x49af('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x49af('0x6')](0x9)[_0x49af('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x49af('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x49af('0x6')](0x9)[_0x49af('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x49af('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x49af('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x49af('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x49af('0x6')](0x5)[_0x49af('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x49af('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x49af('0x6')](0x9)[_0x49af('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x49af('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x49af('0xf')](_0x49af('0x1c'),_0x49af('0x1d')),'defaultValue':_0x49af('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x49af('0x6')](0x3)[_0x49af('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x49af('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x49af('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x49af('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x49af('0x6')](0x5)[_0x49af('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x49af('0x6')](0x3)[_0x49af('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49af('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x49af('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49af('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x49af('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x49af('0x6')](0x5)[_0x49af('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x49af('0x6')](0x3)[_0x49af('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49af('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x49af('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x49af('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x49af('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x49af('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x49af('0x6')](0x5)[_0x49af('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index e43d661..712f821 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 _0x4cdf=['where','pick','merge','VIRTUAL','Campaign','findAll','rows','show','params','keys','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','omit','updatedAt','update','findOne','CmHopper','filter','getHopperHistories','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','onlyIfOpen','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','sequelize','all','removeLists','destroy','getBlackLists','addBlackLists','push','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','IvrCampaigns','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x4cdf,0x180));var _0xf4cd=function(_0xe985eb,_0x5a9465){_0xe985eb=_0xe985eb-0x0;var _0x2dd145=_0x4cdf[_0xe985eb];return _0x2dd145;};'use strict';var emlformat=require(_0xf4cd('0x0'));var rimraf=require(_0xf4cd('0x1'));var zipdir=require(_0xf4cd('0x2'));var jsonpatch=require(_0xf4cd('0x3'));var rp=require(_0xf4cd('0x4'));var moment=require(_0xf4cd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf4cd('0x6'));var util=require(_0xf4cd('0x7'));var path=require('path');var sox=require(_0xf4cd('0x8'));var csv=require(_0xf4cd('0x9'));var ejs=require(_0xf4cd('0xa'));var fs=require('fs');var fs_extra=require(_0xf4cd('0xb'));var _=require(_0xf4cd('0xc'));var squel=require('squel');var crypto=require(_0xf4cd('0xd'));var jsforce=require(_0xf4cd('0xe'));var deskjs=require(_0xf4cd('0xf'));var toCsv=require(_0xf4cd('0x9'));var querystring=require('querystring');var Papa=require(_0xf4cd('0x10'));var Redis=require(_0xf4cd('0x11'));var authService=require(_0xf4cd('0x12'));var qs=require(_0xf4cd('0x13'));var as=require(_0xf4cd('0x14'));var hardwareService=require(_0xf4cd('0x15'));var logger=require(_0xf4cd('0x16'))('api');var utils=require(_0xf4cd('0x17'));var config=require(_0xf4cd('0x18'));var licenseUtil=require(_0xf4cd('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58a73a,_0x240614){_0x240614=_0x240614||0xcc;return function(_0x16c4a1){if(_0x16c4a1){return _0x58a73a[_0xf4cd('0x1a')](_0x240614);}return _0x58a73a['status'](_0x240614)[_0xf4cd('0x1b')]();};}function respondWithResult(_0x3c9a6e,_0x216b55){_0x216b55=_0x216b55||0xc8;return function(_0xf12547){if(_0xf12547){return _0x3c9a6e[_0xf4cd('0x1c')](_0x216b55)[_0xf4cd('0x1d')](_0xf12547);}};}function respondWithFilteredResult(_0x5e4a4e,_0x1cfb21){return function(_0xa1ee6){if(_0xa1ee6){var _0x1488c0=typeof _0x1cfb21[_0xf4cd('0x1e')]==='undefined'&&typeof _0x1cfb21[_0xf4cd('0x1f')]===_0xf4cd('0x20');var _0x26ce07=_0xa1ee6[_0xf4cd('0x21')];var _0x4f56b4=_0x1488c0?0x0:_0x1cfb21['offset'];var _0x4042b0=_0x1488c0?_0xa1ee6[_0xf4cd('0x21')]:_0x1cfb21['offset']+_0x1cfb21[_0xf4cd('0x1f')];var _0x51ffbc;if(_0x4042b0>=_0x26ce07){_0x4042b0=_0x26ce07;_0x51ffbc=0xc8;}else{_0x51ffbc=0xce;}_0x5e4a4e[_0xf4cd('0x1c')](_0x51ffbc);return _0x5e4a4e[_0xf4cd('0x22')](_0xf4cd('0x23'),_0x4f56b4+'-'+_0x4042b0+'/'+_0x26ce07)[_0xf4cd('0x1d')](_0xa1ee6);}return null;};}function patchUpdates(_0x36ab1a){return function(_0x7e607){try{jsonpatch[_0xf4cd('0x24')](_0x7e607,_0x36ab1a,!![]);}catch(_0xface7d){return BPromise[_0xf4cd('0x25')](_0xface7d);}return _0x7e607[_0xf4cd('0x26')]();};}function saveUpdates(_0x53603b,_0xfdfbd9){return function(_0x5b634b){if(_0x5b634b){return _0x5b634b['update'](_0x53603b)[_0xf4cd('0x27')](function(_0x7413fa){return _0x7413fa;});}return null;};}function removeEntity(_0x2a6938,_0x18000c){return function(_0x4e81cc){if(_0x4e81cc){return _0x4e81cc['destroy']()['then'](function(){var _0x2e642b=_0x4e81cc[_0xf4cd('0x28')]({'plain':!![]});var _0x347c46=_0xf4cd('0x29');return db[_0xf4cd('0x2a')]['destroy']({'where':{'type':_0x347c46,'resourceId':_0x2e642b['id']}})[_0xf4cd('0x27')](function(){return _0x4e81cc;});})[_0xf4cd('0x27')](function(){_0x2a6938[_0xf4cd('0x1c')](0xcc)[_0xf4cd('0x1b')]();});}};}function handleEntityNotFound(_0x1b314c,_0x57e05d){return function(_0x2dd43b){if(!_0x2dd43b){_0x1b314c[_0xf4cd('0x1a')](0x194);}return _0x2dd43b;};}function handleError(_0x436741,_0x6c7d33){_0x6c7d33=_0x6c7d33||0x1f4;return function(_0x5348a0){logger[_0xf4cd('0x2b')](_0x5348a0[_0xf4cd('0x2c')]);if(_0x5348a0[_0xf4cd('0x2d')]){delete _0x5348a0[_0xf4cd('0x2d')];}_0x436741[_0xf4cd('0x1c')](_0x6c7d33)['send'](_0x5348a0);};}exports[_0xf4cd('0x2e')]=function(_0x589acb,_0x2f0e01){var _0x3def8e={},_0x3fb418={},_0x2143d6={'count':0x0,'rows':[]};var _0x578a9c=_['map'](db['Campaign'][_0xf4cd('0x2f')],function(_0x2cb7d7){return{'name':_0x2cb7d7[_0xf4cd('0x30')],'type':_0x2cb7d7[_0xf4cd('0x31')][_0xf4cd('0x32')]};});_0x3fb418[_0xf4cd('0x33')]=_[_0xf4cd('0x34')](_0x578a9c,_0xf4cd('0x2d'));_0x3fb418[_0xf4cd('0x35')]=_['keys'](_0x589acb['query']);_0x3fb418[_0xf4cd('0x36')]=_[_0xf4cd('0x37')](_0x3fb418[_0xf4cd('0x33')],_0x3fb418[_0xf4cd('0x35')]);_0x3def8e['attributes']=_[_0xf4cd('0x37')](_0x3fb418[_0xf4cd('0x33')],qs[_0xf4cd('0x38')](_0x589acb[_0xf4cd('0x35')][_0xf4cd('0x38')]));_0x3def8e[_0xf4cd('0x39')]=_0x3def8e[_0xf4cd('0x39')][_0xf4cd('0x3a')]?_0x3def8e[_0xf4cd('0x39')]:_0x3fb418[_0xf4cd('0x33')];if(!_0x589acb[_0xf4cd('0x35')][_0xf4cd('0x3b')](_0xf4cd('0x3c'))){_0x3def8e['limit']=qs[_0xf4cd('0x1f')](_0x589acb['query']['limit']);_0x3def8e['offset']=qs[_0xf4cd('0x1e')](_0x589acb[_0xf4cd('0x35')][_0xf4cd('0x1e')]);}_0x3def8e[_0xf4cd('0x3d')]=qs['sort'](_0x589acb['query'][_0xf4cd('0x3e')]);_0x3def8e[_0xf4cd('0x3f')]=qs['filters'](_[_0xf4cd('0x40')](_0x589acb[_0xf4cd('0x35')],_0x3fb418[_0xf4cd('0x36')]),_0x578a9c);if(_0x589acb[_0xf4cd('0x35')]['filter']){_0x3def8e['where']=_[_0xf4cd('0x41')](_0x3def8e[_0xf4cd('0x3f')],{'$or':_[_0xf4cd('0x34')](_0x578a9c,function(_0xaa7fc9){if(_0xaa7fc9['type']!==_0xf4cd('0x42')){var _0x38b08b={};_0x38b08b[_0xaa7fc9[_0xf4cd('0x2d')]]={'$like':'%'+_0x589acb[_0xf4cd('0x35')]['filter']+'%'};return _0x38b08b;}})});}_0x3def8e=_['merge']({},_0x3def8e,_0x589acb['options']);var _0x2899d1={'where':_0x3def8e[_0xf4cd('0x3f')]};return db[_0xf4cd('0x43')][_0xf4cd('0x21')](_0x2899d1)['then'](function(_0x277129){_0x2143d6[_0xf4cd('0x21')]=_0x277129;if(_0x589acb['query']['includeAll']){_0x3def8e['include']=[{'all':!![]}];}return db['Campaign'][_0xf4cd('0x44')](_0x3def8e);})[_0xf4cd('0x27')](function(_0xaec9ac){_0x2143d6[_0xf4cd('0x45')]=_0xaec9ac;return _0x2143d6;})[_0xf4cd('0x27')](respondWithFilteredResult(_0x2f0e01,_0x3def8e))['catch'](handleError(_0x2f0e01,null));};exports[_0xf4cd('0x46')]=function(_0x14416f,_0x1e1b82){var _0x11ea91={'raw':![],'where':{'id':_0x14416f[_0xf4cd('0x47')]['id']}},_0x3e86d2={};_0x3e86d2[_0xf4cd('0x33')]=_[_0xf4cd('0x48')](db['Campaign'][_0xf4cd('0x2f')]);_0x3e86d2['query']=_['keys'](_0x14416f[_0xf4cd('0x35')]);_0x3e86d2[_0xf4cd('0x36')]=_[_0xf4cd('0x37')](_0x3e86d2['model'],_0x3e86d2[_0xf4cd('0x35')]);_0x11ea91['attributes']=_['intersection'](_0x3e86d2[_0xf4cd('0x33')],qs[_0xf4cd('0x38')](_0x14416f['query'][_0xf4cd('0x38')]));_0x11ea91[_0xf4cd('0x39')]=_0x11ea91[_0xf4cd('0x39')][_0xf4cd('0x3a')]?_0x11ea91[_0xf4cd('0x39')]:_0x3e86d2[_0xf4cd('0x33')];if(_0x14416f[_0xf4cd('0x35')][_0xf4cd('0x49')]){_0x11ea91[_0xf4cd('0x4a')]=[{'all':!![]}];}_0x11ea91=_[_0xf4cd('0x41')]({},_0x11ea91,_0x14416f[_0xf4cd('0x4b')]);return db[_0xf4cd('0x43')][_0xf4cd('0x4c')](_0x11ea91)[_0xf4cd('0x27')](handleEntityNotFound(_0x1e1b82,null))['then'](respondWithResult(_0x1e1b82,null))['catch'](handleError(_0x1e1b82,null));};exports[_0xf4cd('0x4d')]=function(_0x35086a,_0x8d3408){return db['Campaign'][_0xf4cd('0x4d')](_0x35086a[_0xf4cd('0x4e')],{})[_0xf4cd('0x27')](function(_0x5c4d7c){var _0x3c3b1c=_0x35086a[_0xf4cd('0x4f')][_0xf4cd('0x28')]({'plain':!![]});if(!_0x3c3b1c)throw new Error(_0xf4cd('0x50'));if(_0x3c3b1c[_0xf4cd('0x51')]===_0xf4cd('0x4f')){var _0x3eacd5=_0x5c4d7c['get']({'plain':!![]});var _0x13216a=_0xf4cd('0x29');return db[_0xf4cd('0x52')][_0xf4cd('0x4c')]({'where':{'name':_0x13216a,'userProfileId':_0x3c3b1c[_0xf4cd('0x53')]},'raw':!![]})[_0xf4cd('0x27')](function(_0x5e00c9){if(_0x5e00c9&&_0x5e00c9[_0xf4cd('0x54')]===0x0){return db[_0xf4cd('0x2a')][_0xf4cd('0x4d')]({'name':_0x3eacd5[_0xf4cd('0x2d')],'resourceId':_0x3eacd5['id'],'type':_0x5e00c9['name'],'sectionId':_0x5e00c9['id']},{})[_0xf4cd('0x27')](function(){return _0x5c4d7c;});}else{return _0x5c4d7c;}})['catch'](function(_0x8538e0){logger[_0xf4cd('0x2b')](_0xf4cd('0x55'),_0x8538e0);throw _0x8538e0;});}return _0x5c4d7c;})[_0xf4cd('0x27')](respondWithResult(_0x8d3408,0xc9))[_0xf4cd('0x56')](handleError(_0x8d3408,null));};exports['clone']=function(_0xb78392,_0x1d996e){var _0x4cb7bd={'where':{'id':_0xb78392[_0xf4cd('0x47')]['id']}},_0x5c7286={};_0x5c7286[_0xf4cd('0x33')]=_[_0xf4cd('0x48')](db[_0xf4cd('0x43')]['rawAttributes']);_0x4cb7bd[_0xf4cd('0x39')]=_[_0xf4cd('0x37')](_0x5c7286[_0xf4cd('0x33')],qs[_0xf4cd('0x38')](_0xb78392[_0xf4cd('0x35')][_0xf4cd('0x38')]));_0x4cb7bd[_0xf4cd('0x39')]=_0x4cb7bd[_0xf4cd('0x39')][_0xf4cd('0x3a')]?_0x4cb7bd[_0xf4cd('0x39')]:_0x5c7286[_0xf4cd('0x33')];if(_0xb78392[_0xf4cd('0x35')]['includeAll']){_0x4cb7bd[_0xf4cd('0x4a')]=[{'all':!![]}];}_0x4cb7bd=_[_0xf4cd('0x41')]({},_0x4cb7bd,_0xb78392[_0xf4cd('0x4b')]);return db[_0xf4cd('0x43')][_0xf4cd('0x4c')](_0x4cb7bd)[_0xf4cd('0x27')](handleEntityNotFound(_0x1d996e,null))[_0xf4cd('0x27')](function(_0x6a21bb){if(_0x6a21bb){var _0x418e2d=_0x6a21bb[_0xf4cd('0x28')]({'plain':!![]});_0x418e2d=qs[_0xf4cd('0x57')](_0x418e2d,['id','createdAt',_0xf4cd('0x58')]);_0xb78392[_0xf4cd('0x4e')]=_[_0xf4cd('0x57')](_0xb78392[_0xf4cd('0x4e')],['id','createdAt','updatedAt']);return db['Campaign'][_0xf4cd('0x4d')](_[_0xf4cd('0x41')](_0x418e2d,_0xb78392[_0xf4cd('0x4e')]),{'include':_0xb78392[_0xf4cd('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0xf4cd('0x27')](function(_0x3dee04){var _0x48ebfe=_0xb78392[_0xf4cd('0x4f')][_0xf4cd('0x28')]({'plain':!![]});if(!_0x48ebfe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48ebfe[_0xf4cd('0x51')]===_0xf4cd('0x4f')){var _0x3df471=_0x3dee04[_0xf4cd('0x28')]({'plain':!![]});var _0x48895b=_0xf4cd('0x29');return db[_0xf4cd('0x52')][_0xf4cd('0x4c')]({'where':{'name':_0x48895b,'userProfileId':_0x48ebfe[_0xf4cd('0x53')]},'raw':!![]})['then'](function(_0x1af3dd){if(_0x1af3dd&&_0x1af3dd[_0xf4cd('0x54')]===0x0){return db['UserProfileResource'][_0xf4cd('0x4d')]({'name':_0x3df471[_0xf4cd('0x2d')],'resourceId':_0x3df471['id'],'type':_0x1af3dd[_0xf4cd('0x2d')],'sectionId':_0x1af3dd['id']},{})[_0xf4cd('0x27')](function(){return _0x3dee04;});}else{return _0x3dee04;}})[_0xf4cd('0x56')](function(_0x42f5ba){logger[_0xf4cd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42f5ba);throw _0x42f5ba;});}return _0x3dee04;});}})[_0xf4cd('0x27')](respondWithResult(_0x1d996e,0xc9))['catch'](handleError(_0x1d996e,null));};exports[_0xf4cd('0x59')]=function(_0x221d5d,_0x10751b){if(_0x221d5d[_0xf4cd('0x4e')]['id']){delete _0x221d5d[_0xf4cd('0x4e')]['id'];}return db[_0xf4cd('0x43')][_0xf4cd('0x4c')]({'where':{'id':_0x221d5d[_0xf4cd('0x47')]['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x10751b,null))[_0xf4cd('0x27')](saveUpdates(_0x221d5d[_0xf4cd('0x4e')],null))[_0xf4cd('0x27')](respondWithResult(_0x10751b,null))[_0xf4cd('0x56')](handleError(_0x10751b,null));};exports['destroy']=function(_0x599707,_0x1f7609){return db['Campaign'][_0xf4cd('0x4c')]({'where':{'id':_0x599707[_0xf4cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f7609,null))['then'](removeEntity(_0x1f7609,null))[_0xf4cd('0x56')](handleError(_0x1f7609,null));};exports['getHoppers']=function(_0x470124,_0x1ea5cb,_0x384290){var _0x3c9caa={'raw':!![],'where':{}};var _0x51f54e={};var _0xcdd031={'count':0x0,'rows':[]};return db[_0xf4cd('0x43')][_0xf4cd('0x5a')]({'where':{'id':_0x470124[_0xf4cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ea5cb,null))[_0xf4cd('0x27')](function(_0x129e2e){if(_0x129e2e){_0x51f54e[_0xf4cd('0x33')]=_['keys'](db[_0xf4cd('0x5b')][_0xf4cd('0x2f')]);_0x51f54e[_0xf4cd('0x35')]=_[_0xf4cd('0x48')](_0x470124[_0xf4cd('0x35')]);_0x51f54e[_0xf4cd('0x36')]=_[_0xf4cd('0x37')](_0x51f54e['model'],_0x51f54e[_0xf4cd('0x35')]);_0x3c9caa[_0xf4cd('0x39')]=_[_0xf4cd('0x37')](_0x51f54e[_0xf4cd('0x33')],qs[_0xf4cd('0x38')](_0x470124[_0xf4cd('0x35')][_0xf4cd('0x38')]));_0x3c9caa[_0xf4cd('0x39')]=_0x3c9caa[_0xf4cd('0x39')][_0xf4cd('0x3a')]?_0x3c9caa[_0xf4cd('0x39')]:_0x51f54e[_0xf4cd('0x33')];if(!_0x470124['query']['hasOwnProperty'](_0xf4cd('0x3c'))){_0x3c9caa['limit']=qs[_0xf4cd('0x1f')](_0x470124['query'][_0xf4cd('0x1f')]);_0x3c9caa['offset']=qs[_0xf4cd('0x1e')](_0x470124['query'][_0xf4cd('0x1e')]);}_0x3c9caa[_0xf4cd('0x3d')]=qs[_0xf4cd('0x3e')](_0x470124['query'][_0xf4cd('0x3e')]);_0x3c9caa['where']=qs['filters'](_['pick'](_0x470124[_0xf4cd('0x35')],_0x51f54e[_0xf4cd('0x36')]));_0x3c9caa['where']['CampaignId']=_0x129e2e['id'];if(_0x470124[_0xf4cd('0x35')][_0xf4cd('0x5c')]){_0x3c9caa[_0xf4cd('0x3f')]=_['merge'](_0x3c9caa[_0xf4cd('0x3f')],{'$or':_[_0xf4cd('0x34')](_0x3c9caa['attributes'],function(_0x3dc388){var _0x48bb30={};_0x48bb30[_0x3dc388]={'$like':'%'+_0x470124[_0xf4cd('0x35')][_0xf4cd('0x5c')]+'%'};return _0x48bb30;})});}_0x3c9caa=_[_0xf4cd('0x41')]({},_0x3c9caa,_0x470124[_0xf4cd('0x4b')]);return db[_0xf4cd('0x5b')]['count']({'where':_0x3c9caa[_0xf4cd('0x3f')]})[_0xf4cd('0x27')](function(_0x9069d3){_0xcdd031[_0xf4cd('0x21')]=_0x9069d3;if(_0x470124['query'][_0xf4cd('0x49')]){_0x3c9caa['include']=[{'all':!![]}];}return db[_0xf4cd('0x5b')][_0xf4cd('0x44')](_0x3c9caa);})[_0xf4cd('0x27')](function(_0x97abbd){_0xcdd031[_0xf4cd('0x45')]=_0x97abbd;return _0xcdd031;});}})['then'](respondWithFilteredResult(_0x1ea5cb,_0x3c9caa))[_0xf4cd('0x56')](handleError(_0x1ea5cb,null));};exports[_0xf4cd('0x5d')]=function(_0x2a051e,_0x345989,_0x31c39d){var _0x5c2930={'raw':!![],'where':{}};var _0x623617={};var _0x423e90={'count':0x0,'rows':[]};return db[_0xf4cd('0x43')][_0xf4cd('0x5a')]({'where':{'id':_0x2a051e['params']['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x345989,null))[_0xf4cd('0x27')](function(_0x135ee8){if(_0x135ee8){_0x623617[_0xf4cd('0x33')]=_[_0xf4cd('0x48')](db['CmHopperHistory'][_0xf4cd('0x2f')]);_0x623617[_0xf4cd('0x35')]=_['keys'](_0x2a051e['query']);_0x623617[_0xf4cd('0x36')]=_[_0xf4cd('0x37')](_0x623617[_0xf4cd('0x33')],_0x623617[_0xf4cd('0x35')]);_0x5c2930[_0xf4cd('0x39')]=_['intersection'](_0x623617[_0xf4cd('0x33')],qs[_0xf4cd('0x38')](_0x2a051e[_0xf4cd('0x35')][_0xf4cd('0x38')]));_0x5c2930[_0xf4cd('0x39')]=_0x5c2930[_0xf4cd('0x39')][_0xf4cd('0x3a')]?_0x5c2930[_0xf4cd('0x39')]:_0x623617[_0xf4cd('0x33')];if(!_0x2a051e[_0xf4cd('0x35')][_0xf4cd('0x3b')](_0xf4cd('0x3c'))){_0x5c2930[_0xf4cd('0x1f')]=qs[_0xf4cd('0x1f')](_0x2a051e[_0xf4cd('0x35')][_0xf4cd('0x1f')]);_0x5c2930['offset']=qs[_0xf4cd('0x1e')](_0x2a051e[_0xf4cd('0x35')][_0xf4cd('0x1e')]);}_0x5c2930['order']=qs['sort'](_0x2a051e[_0xf4cd('0x35')]['sort']);_0x5c2930[_0xf4cd('0x3f')]=qs[_0xf4cd('0x36')](_[_0xf4cd('0x40')](_0x2a051e['query'],_0x623617[_0xf4cd('0x36')]));_0x5c2930['where'][_0xf4cd('0x5e')]=_0x135ee8['id'];if(_0x2a051e['query']['filter']){_0x5c2930['where']=_[_0xf4cd('0x41')](_0x5c2930[_0xf4cd('0x3f')],{'$or':_[_0xf4cd('0x34')](_0x5c2930[_0xf4cd('0x39')],function(_0x4f20f4){var _0x43a1c9={};_0x43a1c9[_0x4f20f4]={'$like':'%'+_0x2a051e['query']['filter']+'%'};return _0x43a1c9;})});}_0x5c2930=_[_0xf4cd('0x41')]({},_0x5c2930,_0x2a051e[_0xf4cd('0x4b')]);return db[_0xf4cd('0x5f')][_0xf4cd('0x21')]({'where':_0x5c2930[_0xf4cd('0x3f')]})[_0xf4cd('0x27')](function(_0xa0621c){_0x423e90['count']=_0xa0621c;if(_0x2a051e[_0xf4cd('0x35')][_0xf4cd('0x49')]){_0x5c2930['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xf4cd('0x44')](_0x5c2930);})['then'](function(_0x3bb6aa){_0x423e90['rows']=_0x3bb6aa;return _0x423e90;});}})[_0xf4cd('0x27')](respondWithFilteredResult(_0x345989,_0x5c2930))[_0xf4cd('0x56')](handleError(_0x345989,null));};exports[_0xf4cd('0x60')]=function(_0x51757c,_0x59131f,_0x2df15c){var _0x30c9d1={'raw':!![],'where':{}};var _0xdb7811={};var _0xdea913={'count':0x0,'rows':[]};return db[_0xf4cd('0x43')][_0xf4cd('0x5a')]({'where':{'id':_0x51757c['params']['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x59131f,null))[_0xf4cd('0x27')](function(_0x21b784){if(_0x21b784){_0xdb7811[_0xf4cd('0x33')]=_['keys'](db[_0xf4cd('0x61')]['rawAttributes']);_0xdb7811[_0xf4cd('0x35')]=_[_0xf4cd('0x48')](_0x51757c['query']);_0xdb7811[_0xf4cd('0x36')]=_[_0xf4cd('0x37')](_0xdb7811[_0xf4cd('0x33')],_0xdb7811[_0xf4cd('0x35')]);_0x30c9d1[_0xf4cd('0x39')]=_['intersection'](_0xdb7811['model'],qs[_0xf4cd('0x38')](_0x51757c[_0xf4cd('0x35')][_0xf4cd('0x38')]));_0x30c9d1[_0xf4cd('0x39')]=_0x30c9d1['attributes']['length']?_0x30c9d1[_0xf4cd('0x39')]:_0xdb7811[_0xf4cd('0x33')];if(!_0x51757c[_0xf4cd('0x35')][_0xf4cd('0x3b')](_0xf4cd('0x3c'))){_0x30c9d1[_0xf4cd('0x1f')]=qs[_0xf4cd('0x1f')](_0x51757c['query'][_0xf4cd('0x1f')]);_0x30c9d1['offset']=qs[_0xf4cd('0x1e')](_0x51757c['query']['offset']);}_0x30c9d1['order']=qs[_0xf4cd('0x3e')](_0x51757c['query'][_0xf4cd('0x3e')]);_0x30c9d1[_0xf4cd('0x3f')]=qs[_0xf4cd('0x36')](_[_0xf4cd('0x40')](_0x51757c[_0xf4cd('0x35')],_0xdb7811[_0xf4cd('0x36')]));_0x30c9d1[_0xf4cd('0x3f')][_0xf4cd('0x5e')]=_0x21b784['id'];if(_0x51757c[_0xf4cd('0x35')][_0xf4cd('0x5c')]){_0x30c9d1[_0xf4cd('0x3f')]=_[_0xf4cd('0x41')](_0x30c9d1[_0xf4cd('0x3f')],{'$or':_[_0xf4cd('0x34')](_0x30c9d1[_0xf4cd('0x39')],function(_0x374911){var _0x2142f8={};_0x2142f8[_0x374911]={'$like':'%'+_0x51757c[_0xf4cd('0x35')][_0xf4cd('0x5c')]+'%'};return _0x2142f8;})});}_0x30c9d1=_[_0xf4cd('0x41')]({},_0x30c9d1,_0x51757c[_0xf4cd('0x4b')]);return db['CmHopperFinal']['count']({'where':_0x30c9d1[_0xf4cd('0x3f')]})[_0xf4cd('0x27')](function(_0x43d5d3){_0xdea913[_0xf4cd('0x21')]=_0x43d5d3;if(_0x51757c[_0xf4cd('0x35')]['includeAll']){_0x30c9d1[_0xf4cd('0x4a')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x30c9d1);})['then'](function(_0x42560a){_0xdea913[_0xf4cd('0x45')]=_0x42560a;return _0xdea913;});}})[_0xf4cd('0x27')](respondWithFilteredResult(_0x59131f,_0x30c9d1))['catch'](handleError(_0x59131f,null));};exports[_0xf4cd('0x62')]=function(_0x36f5be,_0x48d0be,_0x2a3160){var _0x488365={'raw':!![],'where':{}};var _0x2d547a={};var _0x1aee2a={'count':0x0,'rows':[]};return db[_0xf4cd('0x43')][_0xf4cd('0x5a')]({'where':{'id':_0x36f5be[_0xf4cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x48d0be,null))[_0xf4cd('0x27')](function(_0x2f5be4){if(_0x2f5be4){_0x2d547a[_0xf4cd('0x33')]=_[_0xf4cd('0x48')](db[_0xf4cd('0x63')][_0xf4cd('0x2f')]);_0x2d547a[_0xf4cd('0x35')]=_['keys'](_0x36f5be[_0xf4cd('0x35')]);_0x2d547a['filters']=_['intersection'](_0x2d547a['model'],_0x2d547a[_0xf4cd('0x35')]);_0x488365[_0xf4cd('0x39')]=_[_0xf4cd('0x37')](_0x2d547a[_0xf4cd('0x33')],qs[_0xf4cd('0x38')](_0x36f5be['query'][_0xf4cd('0x38')]));_0x488365['attributes']=_0x488365[_0xf4cd('0x39')][_0xf4cd('0x3a')]?_0x488365[_0xf4cd('0x39')]:_0x2d547a[_0xf4cd('0x33')];if(!_0x36f5be[_0xf4cd('0x35')]['hasOwnProperty'](_0xf4cd('0x3c'))){_0x488365[_0xf4cd('0x1f')]=qs[_0xf4cd('0x1f')](_0x36f5be['query'][_0xf4cd('0x1f')]);_0x488365[_0xf4cd('0x1e')]=qs[_0xf4cd('0x1e')](_0x36f5be[_0xf4cd('0x35')]['offset']);}_0x488365[_0xf4cd('0x3d')]=qs[_0xf4cd('0x3e')](_0x36f5be['query'][_0xf4cd('0x3e')]);_0x488365[_0xf4cd('0x3f')]=qs[_0xf4cd('0x36')](_['pick'](_0x36f5be[_0xf4cd('0x35')],_0x2d547a[_0xf4cd('0x36')]));_0x488365[_0xf4cd('0x3f')]['CampaignId']=_0x2f5be4['id'];if(_0x36f5be['query'][_0xf4cd('0x5c')]){_0x488365[_0xf4cd('0x3f')]=_[_0xf4cd('0x41')](_0x488365[_0xf4cd('0x3f')],{'$or':_[_0xf4cd('0x34')](_0x488365['attributes'],function(_0x4d6c24){var _0x14c454={};_0x14c454[_0x4d6c24]={'$like':'%'+_0x36f5be['query'][_0xf4cd('0x5c')]+'%'};return _0x14c454;})});}_0x488365=_[_0xf4cd('0x41')]({},_0x488365,_0x36f5be[_0xf4cd('0x4b')]);return db['CmHopperBlack'][_0xf4cd('0x21')]({'where':_0x488365[_0xf4cd('0x3f')]})[_0xf4cd('0x27')](function(_0x2c6a52){_0x1aee2a[_0xf4cd('0x21')]=_0x2c6a52;if(_0x36f5be['query'][_0xf4cd('0x49')]){_0x488365[_0xf4cd('0x4a')]=[{'all':!![]}];}return db[_0xf4cd('0x63')][_0xf4cd('0x44')](_0x488365);})[_0xf4cd('0x27')](function(_0x14dfd1){_0x1aee2a[_0xf4cd('0x45')]=_0x14dfd1;return _0x1aee2a;});}})[_0xf4cd('0x27')](respondWithFilteredResult(_0x48d0be,_0x488365))[_0xf4cd('0x56')](handleError(_0x48d0be,null));};exports[_0xf4cd('0x64')]=function(_0x12758c,_0x42cfbb,_0x437520){var _0x1c96d5={};var _0x336266={};var _0x3bab6f;var _0x3bdad6;return db[_0xf4cd('0x43')][_0xf4cd('0x5a')]({'where':{'id':_0x12758c[_0xf4cd('0x47')]['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x42cfbb,null))[_0xf4cd('0x27')](function(_0x6633){if(_0x6633){_0x3bab6f=_0x6633;_0x336266['model']=_['keys'](db[_0xf4cd('0x65')][_0xf4cd('0x2f')]);_0x336266[_0xf4cd('0x35')]=_[_0xf4cd('0x48')](_0x12758c[_0xf4cd('0x35')]);_0x336266[_0xf4cd('0x36')]=_[_0xf4cd('0x37')](_0x336266[_0xf4cd('0x33')],_0x336266[_0xf4cd('0x35')]);_0x1c96d5[_0xf4cd('0x39')]=_[_0xf4cd('0x37')](_0x336266[_0xf4cd('0x33')],qs['fields'](_0x12758c[_0xf4cd('0x35')][_0xf4cd('0x38')]));_0x1c96d5[_0xf4cd('0x39')]=_0x1c96d5['attributes']['length']?_0x1c96d5[_0xf4cd('0x39')]:_0x336266[_0xf4cd('0x33')];_0x1c96d5['order']=qs[_0xf4cd('0x3e')](_0x12758c[_0xf4cd('0x35')]['sort']);_0x1c96d5[_0xf4cd('0x3f')]=qs[_0xf4cd('0x36')](_['pick'](_0x12758c['query'],_0x336266['filters']));if(_0x12758c[_0xf4cd('0x35')][_0xf4cd('0x5c')]){_0x1c96d5[_0xf4cd('0x3f')]=_[_0xf4cd('0x41')](_0x1c96d5[_0xf4cd('0x3f')],{'$or':_[_0xf4cd('0x34')](_0x1c96d5['attributes'],function(_0x1dbaf0){var _0x58662d={};_0x58662d[_0x1dbaf0]={'$like':'%'+_0x12758c['query'][_0xf4cd('0x5c')]+'%'};return _0x58662d;})});}_0x1c96d5=_[_0xf4cd('0x41')]({},_0x1c96d5,_0x12758c[_0xf4cd('0x4b')]);return _0x3bab6f[_0xf4cd('0x64')](_0x1c96d5);}})[_0xf4cd('0x27')](function(_0x1e6554){if(_0x1e6554){_0x3bdad6=_0x1e6554[_0xf4cd('0x3a')];if(!_0x12758c['query'][_0xf4cd('0x3b')](_0xf4cd('0x3c'))){_0x1c96d5['limit']=qs[_0xf4cd('0x1f')](_0x12758c[_0xf4cd('0x35')][_0xf4cd('0x1f')]);_0x1c96d5['offset']=qs[_0xf4cd('0x1e')](_0x12758c['query'][_0xf4cd('0x1e')]);}return _0x3bab6f[_0xf4cd('0x64')](_0x1c96d5);}})[_0xf4cd('0x27')](function(_0x1d4b9a){if(_0x1d4b9a){return _0x1d4b9a?{'count':_0x3bdad6,'rows':_0x1d4b9a}:null;}})[_0xf4cd('0x27')](respondWithResult(_0x42cfbb,null))[_0xf4cd('0x56')](handleError(_0x42cfbb,null));};exports[_0xf4cd('0x66')]=function(_0x161de5,_0x2a5923,_0x26f2f8){var _0x2d873e,_0x43852f;var _0x411369=[];var _0x1be0c3=moment()[_0xf4cd('0x67')](_0xf4cd('0x68'));return db[_0xf4cd('0x43')][_0xf4cd('0x4c')]({'where':{'id':_0x161de5[_0xf4cd('0x47')]['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x2a5923,null))[_0xf4cd('0x27')](function(_0x302ce5){if(_0x302ce5){_0x43852f=_0x302ce5;return _0x302ce5[_0xf4cd('0x66')](_0x161de5[_0xf4cd('0x4e')][_0xf4cd('0x69')],_['omit'](_0x161de5[_0xf4cd('0x4e')],[_0xf4cd('0x69'),'id'])||{});}return null;})[_0xf4cd('0x6a')](function(_0x5b2f5){var _0x560ac6;var _0x5aa44b;_0x2d873e=_0x5b2f5||[];var _0x119602=[];if(_0x5b2f5){for(var _0x51eb1b=0x0;_0x51eb1b<_0x5b2f5[_0xf4cd('0x3a')];_0x51eb1b+=0x1){var _0x1b4bcd=_0x5b2f5[_0x51eb1b][_0xf4cd('0x28')]({'plain':!![]});_0x43852f[_0xf4cd('0x6b')]=_0x161de5[_0xf4cd('0x4e')][_0xf4cd('0x6b')]?_0x161de5[_0xf4cd('0x4e')]['dialCheckDuplicateType']:_0x43852f[_0xf4cd('0x6b')];switch(_0x43852f[_0xf4cd('0x6b')]){case _0xf4cd('0x6c'):_0x560ac6=squel[_0xf4cd('0x6d')]()[_0xf4cd('0x6e')](_0xf4cd('0x6f'))[_0xf4cd('0x70')]([_0xf4cd('0x71'),_0xf4cd('0x72'),_0xf4cd('0x73'),_0xf4cd('0x74'),_0xf4cd('0x5e'),_0xf4cd('0x75'),_0xf4cd('0x58')],squel['select']()['field'](_0xf4cd('0x71'),_0xf4cd('0x71'))[_0xf4cd('0x76')](_0xf4cd('0x77'),_0xf4cd('0x72'))[_0xf4cd('0x76')]('id',_0xf4cd('0x73'))[_0xf4cd('0x76')](_0x1b4bcd[_0xf4cd('0x78')][_0xf4cd('0x79')](),_0xf4cd('0x74'))['field'](_0x161de5[_0xf4cd('0x47')]['id'][_0xf4cd('0x79')](),_0xf4cd('0x5e'))[_0xf4cd('0x76')]('\x27'+_0x1be0c3+'\x27',_0xf4cd('0x75'))['field']('\x27'+_0x1be0c3+'\x27',_0xf4cd('0x58'))[_0xf4cd('0x7a')](_0xf4cd('0x7b'))[_0xf4cd('0x3f')]('deletedAt\x20IS\x20NULL')[_0xf4cd('0x3f')]('ListId\x20=\x20?',_0x1b4bcd['CmListId']['toString']())[_0xf4cd('0x3f')](_0xf4cd('0x7c'))[_0xf4cd('0x3f')](_0xf4cd('0x7d'),squel['select']()[_0xf4cd('0x76')](_0xf4cd('0x7e'))[_0xf4cd('0x7a')](_0xf4cd('0x7f'))[_0xf4cd('0x3f')](_0xf4cd('0x80'),_0x161de5[_0xf4cd('0x47')]['id']['toString']()))[_0xf4cd('0x3f')](_0xf4cd('0x7d'),squel[_0xf4cd('0x81')]()[_0xf4cd('0x76')]('COALESCE(phone,\x27\x27)')['from'](_0xf4cd('0x6f'))[_0xf4cd('0x3f')](_0xf4cd('0x80'),_0x161de5[_0xf4cd('0x47')]['id'][_0xf4cd('0x79')]())))['toString']();break;case _0xf4cd('0x82'):_0x560ac6=squel[_0xf4cd('0x6d')]()['into'](_0xf4cd('0x6f'))[_0xf4cd('0x70')]([_0xf4cd('0x71'),_0xf4cd('0x72'),'ContactId',_0xf4cd('0x74'),_0xf4cd('0x5e'),_0xf4cd('0x75'),_0xf4cd('0x58')],squel[_0xf4cd('0x81')]()['field'](_0xf4cd('0x71'),_0xf4cd('0x71'))['field'](_0xf4cd('0x77'),'scheduledAt')[_0xf4cd('0x76')]('id',_0xf4cd('0x73'))[_0xf4cd('0x76')](_0x1b4bcd[_0xf4cd('0x78')]['toString'](),_0xf4cd('0x74'))['field'](_0x161de5['params']['id'][_0xf4cd('0x79')](),_0xf4cd('0x5e'))[_0xf4cd('0x76')]('\x27'+_0x1be0c3+'\x27',_0xf4cd('0x75'))[_0xf4cd('0x76')]('\x27'+_0x1be0c3+'\x27','updatedAt')['from'](_0xf4cd('0x7b'))[_0xf4cd('0x3f')](_0xf4cd('0x83'))[_0xf4cd('0x3f')](_0xf4cd('0x84'),_0x1b4bcd[_0xf4cd('0x78')][_0xf4cd('0x79')]())['where'](_0xf4cd('0x7c'))[_0xf4cd('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4cd('0x81')]()['field'](_0xf4cd('0x85'))['from']('cm_hopper')[_0xf4cd('0x3f')](_0xf4cd('0x80'),_0x161de5[_0xf4cd('0x47')]['id']['toString']())))[_0xf4cd('0x79')]();break;default:_0x560ac6=squel['insert']()[_0xf4cd('0x6e')]('cm_hopper')[_0xf4cd('0x70')]([_0xf4cd('0x71'),_0xf4cd('0x72'),_0xf4cd('0x73'),_0xf4cd('0x74'),_0xf4cd('0x5e'),'createdAt',_0xf4cd('0x58')],squel[_0xf4cd('0x81')]()['field'](_0xf4cd('0x71'),_0xf4cd('0x71'))[_0xf4cd('0x76')](_0xf4cd('0x77'),_0xf4cd('0x72'))[_0xf4cd('0x76')]('id','ContactId')[_0xf4cd('0x76')](_0x1b4bcd[_0xf4cd('0x78')][_0xf4cd('0x79')](),_0xf4cd('0x74'))[_0xf4cd('0x76')](_0x161de5[_0xf4cd('0x47')]['id'][_0xf4cd('0x79')](),_0xf4cd('0x5e'))[_0xf4cd('0x76')]('\x27'+_0x1be0c3+'\x27','createdAt')[_0xf4cd('0x76')]('\x27'+_0x1be0c3+'\x27',_0xf4cd('0x58'))[_0xf4cd('0x7a')](_0xf4cd('0x7b'))[_0xf4cd('0x3f')](_0xf4cd('0x83'))[_0xf4cd('0x3f')](_0xf4cd('0x84'),_0x1b4bcd[_0xf4cd('0x78')][_0xf4cd('0x79')]())['where'](_0xf4cd('0x7c')))[_0xf4cd('0x79')]();}_0x5aa44b=squel['insert']()[_0xf4cd('0x6e')](_0xf4cd('0x86'))[_0xf4cd('0x70')]([_0xf4cd('0x87'),_0xf4cd('0x72'),_0xf4cd('0x71'),_0xf4cd('0x88'),_0xf4cd('0x75'),'updatedAt'],squel['select']()[_0xf4cd('0x76')]('h.id','id')[_0xf4cd('0x76')](_0xf4cd('0x77'),_0xf4cd('0x72'))[_0xf4cd('0x76')](_0xf4cd('0x89'),_0xf4cd('0x71'))['field']('ci.OrderBY',_0xf4cd('0x88'))[_0xf4cd('0x76')]('\x27'+_0x1be0c3+'\x27',_0xf4cd('0x75'))[_0xf4cd('0x76')]('\x27'+_0x1be0c3+'\x27',_0xf4cd('0x58'))[_0xf4cd('0x7a')](_0xf4cd('0x8a'),'ci')['join']('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0xf4cd('0x3f')](_0xf4cd('0x8b'),_0x1b4bcd[_0xf4cd('0x78')][_0xf4cd('0x79')]())[_0xf4cd('0x3f')]('h.CampaignId=?',_0x161de5[_0xf4cd('0x47')]['id'][_0xf4cd('0x79')]())['where'](_0xf4cd('0x8c'),_0x1be0c3))[_0xf4cd('0x79')]();_0x119602['push'](db[_0xf4cd('0x8d')][_0xf4cd('0x35')](_0x560ac6));_0x411369['push'](db[_0xf4cd('0x8d')][_0xf4cd('0x35')](_0x5aa44b));}return BPromise[_0xf4cd('0x8e')](_0x119602);}})['then'](function(){return BPromise['all'](_0x411369);})[_0xf4cd('0x27')](function(){return _0x2d873e;})[_0xf4cd('0x27')](respondWithResult(_0x2a5923,null))[_0xf4cd('0x56')](handleError(_0x2a5923,null));};exports[_0xf4cd('0x8f')]=function(_0x475aff,_0x161ddd,_0x998c76){return db[_0xf4cd('0x43')][_0xf4cd('0x4c')]({'where':{'id':_0x475aff[_0xf4cd('0x47')]['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x161ddd,null))[_0xf4cd('0x27')](function(_0x31f416){if(_0x31f416){return _0x31f416['removeLists'](_0x475aff[_0xf4cd('0x35')][_0xf4cd('0x69')]);}})[_0xf4cd('0x27')](function(_0x1ae302){if(_0x1ae302){return db[_0xf4cd('0x5b')][_0xf4cd('0x90')]({'where':{'ListId':_0x475aff[_0xf4cd('0x35')][_0xf4cd('0x69')],'CampaignId':_0x475aff[_0xf4cd('0x47')]['id']}})[_0xf4cd('0x27')](function(){return _0x1ae302;});}})['then'](respondWithStatusCode(_0x161ddd,null))[_0xf4cd('0x56')](handleError(_0x161ddd,null));};exports[_0xf4cd('0x91')]=function(_0x406761,_0x5c949a,_0x388918){var _0x49a528={};var _0x1920b6={};var _0x2b5459;var _0x3fa3e2;return db[_0xf4cd('0x43')][_0xf4cd('0x5a')]({'where':{'id':_0x406761['params']['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x5c949a,null))[_0xf4cd('0x27')](function(_0x3152f6){if(_0x3152f6){_0x2b5459=_0x3152f6;_0x1920b6[_0xf4cd('0x33')]=_[_0xf4cd('0x48')](db[_0xf4cd('0x65')][_0xf4cd('0x2f')]);_0x1920b6[_0xf4cd('0x35')]=_[_0xf4cd('0x48')](_0x406761['query']);_0x1920b6[_0xf4cd('0x36')]=_[_0xf4cd('0x37')](_0x1920b6[_0xf4cd('0x33')],_0x1920b6['query']);_0x49a528[_0xf4cd('0x39')]=_[_0xf4cd('0x37')](_0x1920b6['model'],qs[_0xf4cd('0x38')](_0x406761[_0xf4cd('0x35')][_0xf4cd('0x38')]));_0x49a528['attributes']=_0x49a528[_0xf4cd('0x39')][_0xf4cd('0x3a')]?_0x49a528[_0xf4cd('0x39')]:_0x1920b6['model'];_0x49a528[_0xf4cd('0x3d')]=qs['sort'](_0x406761[_0xf4cd('0x35')][_0xf4cd('0x3e')]);_0x49a528[_0xf4cd('0x3f')]=qs[_0xf4cd('0x36')](_[_0xf4cd('0x40')](_0x406761['query'],_0x1920b6[_0xf4cd('0x36')]));if(_0x406761[_0xf4cd('0x35')][_0xf4cd('0x5c')]){_0x49a528[_0xf4cd('0x3f')]=_[_0xf4cd('0x41')](_0x49a528[_0xf4cd('0x3f')],{'$or':_[_0xf4cd('0x34')](_0x49a528[_0xf4cd('0x39')],function(_0x281132){var _0x2ff463={};_0x2ff463[_0x281132]={'$like':'%'+_0x406761[_0xf4cd('0x35')][_0xf4cd('0x5c')]+'%'};return _0x2ff463;})});}_0x49a528=_[_0xf4cd('0x41')]({},_0x49a528,_0x406761['options']);return _0x2b5459[_0xf4cd('0x91')](_0x49a528);}})[_0xf4cd('0x27')](function(_0x17a7e4){if(_0x17a7e4){_0x3fa3e2=_0x17a7e4[_0xf4cd('0x3a')];if(!_0x406761[_0xf4cd('0x35')][_0xf4cd('0x3b')](_0xf4cd('0x3c'))){_0x49a528[_0xf4cd('0x1f')]=qs[_0xf4cd('0x1f')](_0x406761[_0xf4cd('0x35')][_0xf4cd('0x1f')]);_0x49a528['offset']=qs[_0xf4cd('0x1e')](_0x406761[_0xf4cd('0x35')][_0xf4cd('0x1e')]);}return _0x2b5459[_0xf4cd('0x91')](_0x49a528);}})[_0xf4cd('0x27')](function(_0x25f137){if(_0x25f137){return _0x25f137?{'count':_0x3fa3e2,'rows':_0x25f137}:null;}})['then'](respondWithResult(_0x5c949a,null))[_0xf4cd('0x56')](handleError(_0x5c949a,null));};exports[_0xf4cd('0x92')]=function(_0x37de16,_0x547cac,_0x58d97d){var _0xaf7ed2,_0x421834;var _0x1e0757=[];var _0x331f68=moment()[_0xf4cd('0x67')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xf4cd('0x43')][_0xf4cd('0x4c')]({'where':{'id':_0x37de16[_0xf4cd('0x47')]['id']}})[_0xf4cd('0x27')](handleEntityNotFound(_0x547cac,null))['then'](function(_0x3b0d43){if(_0x3b0d43){_0x421834=_0x3b0d43;return _0x3b0d43[_0xf4cd('0x92')](_0x37de16[_0xf4cd('0x4e')][_0xf4cd('0x69')],_[_0xf4cd('0x57')](_0x37de16[_0xf4cd('0x4e')],[_0xf4cd('0x69'),'id'])||{});}return null;})[_0xf4cd('0x6a')](function(_0x3fbf04){var _0x2c64ae;var _0x210bc3;_0xaf7ed2=_0x3fbf04||[];var _0x989703=[];if(_0x3fbf04){for(var _0x4fed60=0x0;_0x4fed60<_0x3fbf04['length'];_0x4fed60+=0x1){var _0x347068=_0x3fbf04[_0x4fed60]['get']({'plain':!![]});_0x2c64ae=squel['insert']()['into']('cm_hopper_black')[_0xf4cd('0x70')]([_0xf4cd('0x71'),_0xf4cd('0x73'),'ListId','CampaignId',_0xf4cd('0x75'),_0xf4cd('0x58')],squel[_0xf4cd('0x81')]()[_0xf4cd('0x76')](_0xf4cd('0x71'),_0xf4cd('0x71'))[_0xf4cd('0x76')]('id',_0xf4cd('0x73'))[_0xf4cd('0x76')](_0x347068['CmListId'][_0xf4cd('0x79')](),'ListId')['field'](_0x37de16[_0xf4cd('0x47')]['id'][_0xf4cd('0x79')](),'CampaignId')[_0xf4cd('0x76')](_0xf4cd('0x77'),_0xf4cd('0x75'))[_0xf4cd('0x76')](_0xf4cd('0x77'),_0xf4cd('0x58'))[_0xf4cd('0x7a')](_0xf4cd('0x7b'))[_0xf4cd('0x3f')](_0xf4cd('0x83'))['where'](_0xf4cd('0x84'),_0x347068[_0xf4cd('0x78')][_0xf4cd('0x79')]())[_0xf4cd('0x3f')](_0xf4cd('0x7c')))[_0xf4cd('0x79')]();_0x989703[_0xf4cd('0x93')](db['sequelize']['query'](_0x2c64ae));}return BPromise[_0xf4cd('0x8e')](_0x989703);}})['then'](function(){return _0xaf7ed2;})['then'](respondWithResult(_0x547cac,null))[_0xf4cd('0x56')](handleError(_0x547cac,null));};exports[_0xf4cd('0x94')]=function(_0x3bc5ba,_0x5471e9,_0x5db3ef){return db[_0xf4cd('0x43')]['find']({'where':{'id':_0x3bc5ba[_0xf4cd('0x47')]['id']}})['then'](handleEntityNotFound(_0x5471e9,null))[_0xf4cd('0x27')](function(_0x259efe){if(_0x259efe){return _0x259efe[_0xf4cd('0x94')](_0x3bc5ba[_0xf4cd('0x35')][_0xf4cd('0x69')]);}})['then'](function(_0x40c4a7){if(_0x40c4a7){return db[_0xf4cd('0x63')][_0xf4cd('0x90')]({'where':{'ListId':_0x3bc5ba[_0xf4cd('0x35')]['ids'],'CampaignId':_0x3bc5ba[_0xf4cd('0x47')]['id']}})['then'](function(){return _0x40c4a7;});}})['then'](respondWithStatusCode(_0x5471e9,null))[_0xf4cd('0x56')](handleError(_0x5471e9,null));}; \ No newline at end of file +var _0x9d62=['onlyIfOpen','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','CmHopper','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','IvrCampaigns','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Campaign','include','findAll','rows','catch','options','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','clone','params','includeAll','omit','createdAt','updatedAt','findOne','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)'];(function(_0x319919,_0x2343ec){var _0xd9976e=function(_0x27add6){while(--_0x27add6){_0x319919['push'](_0x319919['shift']());}};_0xd9976e(++_0x2343ec);}(_0x9d62,0xaf));var _0x29d6=function(_0x4aa7aa,_0x1ba934){_0x4aa7aa=_0x4aa7aa-0x0;var _0x5390a0=_0x9d62[_0x4aa7aa];return _0x5390a0;};'use strict';var emlformat=require(_0x29d6('0x0'));var rimraf=require(_0x29d6('0x1'));var zipdir=require(_0x29d6('0x2'));var jsonpatch=require(_0x29d6('0x3'));var rp=require(_0x29d6('0x4'));var moment=require('moment');var BPromise=require(_0x29d6('0x5'));var Mustache=require(_0x29d6('0x6'));var util=require(_0x29d6('0x7'));var path=require(_0x29d6('0x8'));var sox=require(_0x29d6('0x9'));var csv=require('to-csv');var ejs=require(_0x29d6('0xa'));var fs=require('fs');var fs_extra=require(_0x29d6('0xb'));var _=require(_0x29d6('0xc'));var squel=require(_0x29d6('0xd'));var crypto=require(_0x29d6('0xe'));var jsforce=require(_0x29d6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x29d6('0x10'));var querystring=require(_0x29d6('0x11'));var Papa=require(_0x29d6('0x12'));var Redis=require(_0x29d6('0x13'));var authService=require(_0x29d6('0x14'));var qs=require(_0x29d6('0x15'));var as=require(_0x29d6('0x16'));var hardwareService=require(_0x29d6('0x17'));var logger=require('../../config/logger')(_0x29d6('0x18'));var utils=require(_0x29d6('0x19'));var config=require(_0x29d6('0x1a'));var licenseUtil=require(_0x29d6('0x1b'));var db=require(_0x29d6('0x1c'))['db'];function respondWithStatusCode(_0x5ab9fb,_0x4666f9){_0x4666f9=_0x4666f9||0xcc;return function(_0x4bb3e2){if(_0x4bb3e2){return _0x5ab9fb[_0x29d6('0x1d')](_0x4666f9);}return _0x5ab9fb['status'](_0x4666f9)[_0x29d6('0x1e')]();};}function respondWithResult(_0x16b739,_0x2f4968){_0x2f4968=_0x2f4968||0xc8;return function(_0x305a69){if(_0x305a69){return _0x16b739['status'](_0x2f4968)['json'](_0x305a69);}};}function respondWithFilteredResult(_0x4efeb8,_0x158e45){return function(_0x30d39f){if(_0x30d39f){var _0x261225=typeof _0x158e45[_0x29d6('0x1f')]===_0x29d6('0x20')&&typeof _0x158e45[_0x29d6('0x21')]===_0x29d6('0x20');var _0x59355a=_0x30d39f[_0x29d6('0x22')];var _0x46307e=_0x261225?0x0:_0x158e45[_0x29d6('0x1f')];var _0x50c734=_0x261225?_0x30d39f[_0x29d6('0x22')]:_0x158e45[_0x29d6('0x1f')]+_0x158e45[_0x29d6('0x21')];var _0x294764;if(_0x50c734>=_0x59355a){_0x50c734=_0x59355a;_0x294764=0xc8;}else{_0x294764=0xce;}_0x4efeb8[_0x29d6('0x23')](_0x294764);return _0x4efeb8[_0x29d6('0x24')](_0x29d6('0x25'),_0x46307e+'-'+_0x50c734+'/'+_0x59355a)[_0x29d6('0x26')](_0x30d39f);}return null;};}function patchUpdates(_0x5ccdac){return function(_0x4701ca){try{jsonpatch[_0x29d6('0x27')](_0x4701ca,_0x5ccdac,!![]);}catch(_0x5c2774){return BPromise[_0x29d6('0x28')](_0x5c2774);}return _0x4701ca[_0x29d6('0x29')]();};}function saveUpdates(_0x3e254f,_0x585e72){return function(_0x53f285){if(_0x53f285){return _0x53f285[_0x29d6('0x2a')](_0x3e254f)['then'](function(_0x473fde){return _0x473fde;});}return null;};}function removeEntity(_0x1c2920,_0x51cff7){return function(_0x8d91f5){if(_0x8d91f5){return _0x8d91f5[_0x29d6('0x2b')]()[_0x29d6('0x2c')](function(){var _0xe7997e=_0x8d91f5[_0x29d6('0x2d')]({'plain':!![]});var _0x4d0f45=_0x29d6('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d0f45,'resourceId':_0xe7997e['id']}})['then'](function(){return _0x8d91f5;});})[_0x29d6('0x2c')](function(){_0x1c2920['status'](0xcc)[_0x29d6('0x1e')]();});}};}function handleEntityNotFound(_0xd911f7,_0x54ea45){return function(_0x210ee1){if(!_0x210ee1){_0xd911f7['sendStatus'](0x194);}return _0x210ee1;};}function handleError(_0x469c2f,_0x4abf4f){_0x4abf4f=_0x4abf4f||0x1f4;return function(_0x4af26f){logger[_0x29d6('0x2f')](_0x4af26f[_0x29d6('0x30')]);if(_0x4af26f['name']){delete _0x4af26f[_0x29d6('0x31')];}_0x469c2f[_0x29d6('0x23')](_0x4abf4f)[_0x29d6('0x32')](_0x4af26f);};}exports[_0x29d6('0x33')]=function(_0x4fc84e,_0xa9b5e){var _0x5eb783={},_0x49abc9={},_0x47ebba={'count':0x0,'rows':[]};var _0x420a15=_[_0x29d6('0x34')](db['Campaign'][_0x29d6('0x35')],function(_0xdf63d7){return{'name':_0xdf63d7[_0x29d6('0x36')],'type':_0xdf63d7[_0x29d6('0x37')][_0x29d6('0x38')]};});_0x49abc9['model']=_[_0x29d6('0x34')](_0x420a15,_0x29d6('0x31'));_0x49abc9[_0x29d6('0x39')]=_[_0x29d6('0x3a')](_0x4fc84e['query']);_0x49abc9[_0x29d6('0x3b')]=_[_0x29d6('0x3c')](_0x49abc9[_0x29d6('0x3d')],_0x49abc9[_0x29d6('0x39')]);_0x5eb783[_0x29d6('0x3e')]=_['intersection'](_0x49abc9[_0x29d6('0x3d')],qs[_0x29d6('0x3f')](_0x4fc84e[_0x29d6('0x39')][_0x29d6('0x3f')]));_0x5eb783[_0x29d6('0x3e')]=_0x5eb783[_0x29d6('0x3e')][_0x29d6('0x40')]?_0x5eb783[_0x29d6('0x3e')]:_0x49abc9[_0x29d6('0x3d')];if(!_0x4fc84e[_0x29d6('0x39')][_0x29d6('0x41')](_0x29d6('0x42'))){_0x5eb783['limit']=qs['limit'](_0x4fc84e['query'][_0x29d6('0x21')]);_0x5eb783[_0x29d6('0x1f')]=qs['offset'](_0x4fc84e[_0x29d6('0x39')][_0x29d6('0x1f')]);}_0x5eb783[_0x29d6('0x43')]=qs[_0x29d6('0x44')](_0x4fc84e[_0x29d6('0x39')][_0x29d6('0x44')]);_0x5eb783['where']=qs[_0x29d6('0x3b')](_[_0x29d6('0x45')](_0x4fc84e[_0x29d6('0x39')],_0x49abc9[_0x29d6('0x3b')]),_0x420a15);if(_0x4fc84e[_0x29d6('0x39')][_0x29d6('0x46')]){_0x5eb783[_0x29d6('0x47')]=_[_0x29d6('0x48')](_0x5eb783[_0x29d6('0x47')],{'$or':_[_0x29d6('0x34')](_0x420a15,function(_0x369150){if(_0x369150[_0x29d6('0x37')]!==_0x29d6('0x49')){var _0x1d651e={};_0x1d651e[_0x369150[_0x29d6('0x31')]]={'$like':'%'+_0x4fc84e[_0x29d6('0x39')][_0x29d6('0x46')]+'%'};return _0x1d651e;}})});}_0x5eb783=_['merge']({},_0x5eb783,_0x4fc84e['options']);var _0x4598bc={'where':_0x5eb783[_0x29d6('0x47')]};return db[_0x29d6('0x4a')][_0x29d6('0x22')](_0x4598bc)[_0x29d6('0x2c')](function(_0x24313f){_0x47ebba[_0x29d6('0x22')]=_0x24313f;if(_0x4fc84e[_0x29d6('0x39')]['includeAll']){_0x5eb783[_0x29d6('0x4b')]=[{'all':!![]}];}return db[_0x29d6('0x4a')][_0x29d6('0x4c')](_0x5eb783);})[_0x29d6('0x2c')](function(_0x2b4ebd){_0x47ebba[_0x29d6('0x4d')]=_0x2b4ebd;return _0x47ebba;})[_0x29d6('0x2c')](respondWithFilteredResult(_0xa9b5e,_0x5eb783))[_0x29d6('0x4e')](handleError(_0xa9b5e,null));};exports['show']=function(_0x40bfb5,_0x3df6a3){var _0x2c3cd5={'raw':![],'where':{'id':_0x40bfb5['params']['id']}},_0x43042d={};_0x43042d[_0x29d6('0x3d')]=_[_0x29d6('0x3a')](db[_0x29d6('0x4a')][_0x29d6('0x35')]);_0x43042d[_0x29d6('0x39')]=_[_0x29d6('0x3a')](_0x40bfb5[_0x29d6('0x39')]);_0x43042d['filters']=_[_0x29d6('0x3c')](_0x43042d[_0x29d6('0x3d')],_0x43042d[_0x29d6('0x39')]);_0x2c3cd5['attributes']=_['intersection'](_0x43042d[_0x29d6('0x3d')],qs[_0x29d6('0x3f')](_0x40bfb5[_0x29d6('0x39')][_0x29d6('0x3f')]));_0x2c3cd5[_0x29d6('0x3e')]=_0x2c3cd5['attributes'][_0x29d6('0x40')]?_0x2c3cd5[_0x29d6('0x3e')]:_0x43042d['model'];if(_0x40bfb5['query']['includeAll']){_0x2c3cd5[_0x29d6('0x4b')]=[{'all':!![]}];}_0x2c3cd5=_[_0x29d6('0x48')]({},_0x2c3cd5,_0x40bfb5[_0x29d6('0x4f')]);return db[_0x29d6('0x4a')][_0x29d6('0x50')](_0x2c3cd5)[_0x29d6('0x2c')](handleEntityNotFound(_0x3df6a3,null))[_0x29d6('0x2c')](respondWithResult(_0x3df6a3,null))['catch'](handleError(_0x3df6a3,null));};exports[_0x29d6('0x51')]=function(_0x1845a7,_0x2979c1){return db['Campaign'][_0x29d6('0x51')](_0x1845a7[_0x29d6('0x52')],{})[_0x29d6('0x2c')](function(_0xe839b7){var _0x1eb37d=_0x1845a7[_0x29d6('0x53')][_0x29d6('0x2d')]({'plain':!![]});if(!_0x1eb37d)throw new Error(_0x29d6('0x54'));if(_0x1eb37d[_0x29d6('0x55')]==='user'){var _0x3127b1=_0xe839b7[_0x29d6('0x2d')]({'plain':!![]});var _0x1acbac=_0x29d6('0x2e');return db[_0x29d6('0x56')][_0x29d6('0x50')]({'where':{'name':_0x1acbac,'userProfileId':_0x1eb37d[_0x29d6('0x57')]},'raw':!![]})[_0x29d6('0x2c')](function(_0x4cbad3){if(_0x4cbad3&&_0x4cbad3[_0x29d6('0x58')]===0x0){return db[_0x29d6('0x59')][_0x29d6('0x51')]({'name':_0x3127b1['name'],'resourceId':_0x3127b1['id'],'type':_0x4cbad3[_0x29d6('0x31')],'sectionId':_0x4cbad3['id']},{})[_0x29d6('0x2c')](function(){return _0xe839b7;});}else{return _0xe839b7;}})['catch'](function(_0x27ddad){logger[_0x29d6('0x2f')](_0x29d6('0x5a'),_0x27ddad);throw _0x27ddad;});}return _0xe839b7;})[_0x29d6('0x2c')](respondWithResult(_0x2979c1,0xc9))[_0x29d6('0x4e')](handleError(_0x2979c1,null));};exports[_0x29d6('0x5b')]=function(_0x5ae807,_0x152148){var _0x59f9ea={'where':{'id':_0x5ae807[_0x29d6('0x5c')]['id']}},_0x49e2fe={};_0x49e2fe[_0x29d6('0x3d')]=_['keys'](db[_0x29d6('0x4a')][_0x29d6('0x35')]);_0x59f9ea['attributes']=_[_0x29d6('0x3c')](_0x49e2fe[_0x29d6('0x3d')],qs[_0x29d6('0x3f')](_0x5ae807[_0x29d6('0x39')][_0x29d6('0x3f')]));_0x59f9ea[_0x29d6('0x3e')]=_0x59f9ea[_0x29d6('0x3e')][_0x29d6('0x40')]?_0x59f9ea[_0x29d6('0x3e')]:_0x49e2fe['model'];if(_0x5ae807[_0x29d6('0x39')][_0x29d6('0x5d')]){_0x59f9ea['include']=[{'all':!![]}];}_0x59f9ea=_[_0x29d6('0x48')]({},_0x59f9ea,_0x5ae807['options']);return db[_0x29d6('0x4a')][_0x29d6('0x50')](_0x59f9ea)[_0x29d6('0x2c')](handleEntityNotFound(_0x152148,null))[_0x29d6('0x2c')](function(_0x36296c){if(_0x36296c){var _0x94cd94=_0x36296c[_0x29d6('0x2d')]({'plain':!![]});_0x94cd94=qs[_0x29d6('0x5e')](_0x94cd94,['id',_0x29d6('0x5f'),_0x29d6('0x60')]);_0x5ae807[_0x29d6('0x52')]=_[_0x29d6('0x5e')](_0x5ae807[_0x29d6('0x52')],['id',_0x29d6('0x5f'),'updatedAt']);return db[_0x29d6('0x4a')][_0x29d6('0x51')](_[_0x29d6('0x48')](_0x94cd94,_0x5ae807[_0x29d6('0x52')]),{'include':_0x5ae807['query']['includeAll']?[{'all':!![]}]:undefined})[_0x29d6('0x2c')](function(_0x355237){var _0x42bc78=_0x5ae807[_0x29d6('0x53')][_0x29d6('0x2d')]({'plain':!![]});if(!_0x42bc78)throw new Error(_0x29d6('0x54'));if(_0x42bc78['role']===_0x29d6('0x53')){var _0x4c3398=_0x355237['get']({'plain':!![]});var _0x37c370=_0x29d6('0x2e');return db[_0x29d6('0x56')][_0x29d6('0x50')]({'where':{'name':_0x37c370,'userProfileId':_0x42bc78[_0x29d6('0x57')]},'raw':!![]})['then'](function(_0x24c549){if(_0x24c549&&_0x24c549[_0x29d6('0x58')]===0x0){return db[_0x29d6('0x59')][_0x29d6('0x51')]({'name':_0x4c3398[_0x29d6('0x31')],'resourceId':_0x4c3398['id'],'type':_0x24c549['name'],'sectionId':_0x24c549['id']},{})[_0x29d6('0x2c')](function(){return _0x355237;});}else{return _0x355237;}})[_0x29d6('0x4e')](function(_0x48eb9b){logger[_0x29d6('0x2f')](_0x29d6('0x5a'),_0x48eb9b);throw _0x48eb9b;});}return _0x355237;});}})[_0x29d6('0x2c')](respondWithResult(_0x152148,0xc9))['catch'](handleError(_0x152148,null));};exports['update']=function(_0x54ab3b,_0x13132e){if(_0x54ab3b[_0x29d6('0x52')]['id']){delete _0x54ab3b[_0x29d6('0x52')]['id'];}return db[_0x29d6('0x4a')][_0x29d6('0x50')]({'where':{'id':_0x54ab3b['params']['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x13132e,null))['then'](saveUpdates(_0x54ab3b[_0x29d6('0x52')],null))['then'](respondWithResult(_0x13132e,null))['catch'](handleError(_0x13132e,null));};exports['destroy']=function(_0x1dac11,_0x168636){return db['Campaign'][_0x29d6('0x50')]({'where':{'id':_0x1dac11[_0x29d6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x168636,null))['then'](removeEntity(_0x168636,null))[_0x29d6('0x4e')](handleError(_0x168636,null));};exports['getHoppers']=function(_0x166d9f,_0x4a12cd,_0x4ae73b){var _0x56f05f={'raw':!![],'where':{}};var _0x353c4c={};var _0x437724={'count':0x0,'rows':[]};return db[_0x29d6('0x4a')][_0x29d6('0x61')]({'where':{'id':_0x166d9f[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x4a12cd,null))[_0x29d6('0x2c')](function(_0x2eba2e){if(_0x2eba2e){_0x353c4c[_0x29d6('0x3d')]=_[_0x29d6('0x3a')](db['CmHopper'][_0x29d6('0x35')]);_0x353c4c[_0x29d6('0x39')]=_['keys'](_0x166d9f['query']);_0x353c4c[_0x29d6('0x3b')]=_[_0x29d6('0x3c')](_0x353c4c[_0x29d6('0x3d')],_0x353c4c[_0x29d6('0x39')]);_0x56f05f[_0x29d6('0x3e')]=_[_0x29d6('0x3c')](_0x353c4c[_0x29d6('0x3d')],qs[_0x29d6('0x3f')](_0x166d9f[_0x29d6('0x39')][_0x29d6('0x3f')]));_0x56f05f[_0x29d6('0x3e')]=_0x56f05f[_0x29d6('0x3e')]['length']?_0x56f05f['attributes']:_0x353c4c[_0x29d6('0x3d')];if(!_0x166d9f[_0x29d6('0x39')]['hasOwnProperty'](_0x29d6('0x42'))){_0x56f05f[_0x29d6('0x21')]=qs[_0x29d6('0x21')](_0x166d9f[_0x29d6('0x39')][_0x29d6('0x21')]);_0x56f05f[_0x29d6('0x1f')]=qs[_0x29d6('0x1f')](_0x166d9f[_0x29d6('0x39')][_0x29d6('0x1f')]);}_0x56f05f[_0x29d6('0x43')]=qs[_0x29d6('0x44')](_0x166d9f[_0x29d6('0x39')][_0x29d6('0x44')]);_0x56f05f[_0x29d6('0x47')]=qs[_0x29d6('0x3b')](_['pick'](_0x166d9f[_0x29d6('0x39')],_0x353c4c[_0x29d6('0x3b')]));_0x56f05f[_0x29d6('0x47')][_0x29d6('0x62')]=_0x2eba2e['id'];if(_0x166d9f[_0x29d6('0x39')]['filter']){_0x56f05f[_0x29d6('0x47')]=_[_0x29d6('0x48')](_0x56f05f[_0x29d6('0x47')],{'$or':_[_0x29d6('0x34')](_0x56f05f[_0x29d6('0x3e')],function(_0x7559da){var _0x2abf89={};_0x2abf89[_0x7559da]={'$like':'%'+_0x166d9f[_0x29d6('0x39')][_0x29d6('0x46')]+'%'};return _0x2abf89;})});}_0x56f05f=_[_0x29d6('0x48')]({},_0x56f05f,_0x166d9f[_0x29d6('0x4f')]);return db['CmHopper']['count']({'where':_0x56f05f[_0x29d6('0x47')]})[_0x29d6('0x2c')](function(_0x315f51){_0x437724['count']=_0x315f51;if(_0x166d9f[_0x29d6('0x39')][_0x29d6('0x5d')]){_0x56f05f[_0x29d6('0x4b')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x56f05f);})[_0x29d6('0x2c')](function(_0x40e0a4){_0x437724[_0x29d6('0x4d')]=_0x40e0a4;return _0x437724;});}})[_0x29d6('0x2c')](respondWithFilteredResult(_0x4a12cd,_0x56f05f))[_0x29d6('0x4e')](handleError(_0x4a12cd,null));};exports[_0x29d6('0x63')]=function(_0x37523a,_0x1ce77f,_0x3e96e8){var _0xd954fc={'raw':!![],'where':{}};var _0x183fce={};var _0x29a070={'count':0x0,'rows':[]};return db[_0x29d6('0x4a')][_0x29d6('0x61')]({'where':{'id':_0x37523a[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x1ce77f,null))[_0x29d6('0x2c')](function(_0x12a698){if(_0x12a698){_0x183fce[_0x29d6('0x3d')]=_[_0x29d6('0x3a')](db[_0x29d6('0x64')][_0x29d6('0x35')]);_0x183fce['query']=_[_0x29d6('0x3a')](_0x37523a['query']);_0x183fce[_0x29d6('0x3b')]=_['intersection'](_0x183fce['model'],_0x183fce[_0x29d6('0x39')]);_0xd954fc['attributes']=_[_0x29d6('0x3c')](_0x183fce[_0x29d6('0x3d')],qs[_0x29d6('0x3f')](_0x37523a[_0x29d6('0x39')][_0x29d6('0x3f')]));_0xd954fc[_0x29d6('0x3e')]=_0xd954fc[_0x29d6('0x3e')][_0x29d6('0x40')]?_0xd954fc['attributes']:_0x183fce['model'];if(!_0x37523a['query']['hasOwnProperty']('nolimit')){_0xd954fc[_0x29d6('0x21')]=qs[_0x29d6('0x21')](_0x37523a[_0x29d6('0x39')]['limit']);_0xd954fc[_0x29d6('0x1f')]=qs[_0x29d6('0x1f')](_0x37523a[_0x29d6('0x39')][_0x29d6('0x1f')]);}_0xd954fc[_0x29d6('0x43')]=qs['sort'](_0x37523a[_0x29d6('0x39')][_0x29d6('0x44')]);_0xd954fc[_0x29d6('0x47')]=qs[_0x29d6('0x3b')](_[_0x29d6('0x45')](_0x37523a['query'],_0x183fce['filters']));_0xd954fc[_0x29d6('0x47')][_0x29d6('0x62')]=_0x12a698['id'];if(_0x37523a[_0x29d6('0x39')][_0x29d6('0x46')]){_0xd954fc['where']=_['merge'](_0xd954fc[_0x29d6('0x47')],{'$or':_[_0x29d6('0x34')](_0xd954fc['attributes'],function(_0x4f2330){var _0x235e84={};_0x235e84[_0x4f2330]={'$like':'%'+_0x37523a[_0x29d6('0x39')]['filter']+'%'};return _0x235e84;})});}_0xd954fc=_['merge']({},_0xd954fc,_0x37523a[_0x29d6('0x4f')]);return db[_0x29d6('0x64')][_0x29d6('0x22')]({'where':_0xd954fc[_0x29d6('0x47')]})[_0x29d6('0x2c')](function(_0xbf4e80){_0x29a070[_0x29d6('0x22')]=_0xbf4e80;if(_0x37523a[_0x29d6('0x39')][_0x29d6('0x5d')]){_0xd954fc[_0x29d6('0x4b')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xd954fc);})['then'](function(_0xd44129){_0x29a070[_0x29d6('0x4d')]=_0xd44129;return _0x29a070;});}})[_0x29d6('0x2c')](respondWithFilteredResult(_0x1ce77f,_0xd954fc))[_0x29d6('0x4e')](handleError(_0x1ce77f,null));};exports[_0x29d6('0x65')]=function(_0x1b2091,_0x4fd697,_0xf2a47a){var _0x1d1f54={'raw':!![],'where':{}};var _0x4c8c36={};var _0x245c72={'count':0x0,'rows':[]};return db[_0x29d6('0x4a')][_0x29d6('0x61')]({'where':{'id':_0x1b2091[_0x29d6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4fd697,null))[_0x29d6('0x2c')](function(_0x581263){if(_0x581263){_0x4c8c36[_0x29d6('0x3d')]=_[_0x29d6('0x3a')](db['CmHopperFinal'][_0x29d6('0x35')]);_0x4c8c36[_0x29d6('0x39')]=_[_0x29d6('0x3a')](_0x1b2091[_0x29d6('0x39')]);_0x4c8c36[_0x29d6('0x3b')]=_['intersection'](_0x4c8c36[_0x29d6('0x3d')],_0x4c8c36[_0x29d6('0x39')]);_0x1d1f54[_0x29d6('0x3e')]=_['intersection'](_0x4c8c36[_0x29d6('0x3d')],qs[_0x29d6('0x3f')](_0x1b2091[_0x29d6('0x39')][_0x29d6('0x3f')]));_0x1d1f54[_0x29d6('0x3e')]=_0x1d1f54[_0x29d6('0x3e')]['length']?_0x1d1f54[_0x29d6('0x3e')]:_0x4c8c36[_0x29d6('0x3d')];if(!_0x1b2091[_0x29d6('0x39')][_0x29d6('0x41')](_0x29d6('0x42'))){_0x1d1f54[_0x29d6('0x21')]=qs['limit'](_0x1b2091[_0x29d6('0x39')][_0x29d6('0x21')]);_0x1d1f54[_0x29d6('0x1f')]=qs[_0x29d6('0x1f')](_0x1b2091[_0x29d6('0x39')][_0x29d6('0x1f')]);}_0x1d1f54['order']=qs[_0x29d6('0x44')](_0x1b2091[_0x29d6('0x39')]['sort']);_0x1d1f54[_0x29d6('0x47')]=qs[_0x29d6('0x3b')](_[_0x29d6('0x45')](_0x1b2091[_0x29d6('0x39')],_0x4c8c36[_0x29d6('0x3b')]));_0x1d1f54[_0x29d6('0x47')][_0x29d6('0x62')]=_0x581263['id'];if(_0x1b2091[_0x29d6('0x39')][_0x29d6('0x46')]){_0x1d1f54[_0x29d6('0x47')]=_[_0x29d6('0x48')](_0x1d1f54[_0x29d6('0x47')],{'$or':_[_0x29d6('0x34')](_0x1d1f54[_0x29d6('0x3e')],function(_0x477ebb){var _0x2e3d05={};_0x2e3d05[_0x477ebb]={'$like':'%'+_0x1b2091[_0x29d6('0x39')][_0x29d6('0x46')]+'%'};return _0x2e3d05;})});}_0x1d1f54=_[_0x29d6('0x48')]({},_0x1d1f54,_0x1b2091[_0x29d6('0x4f')]);return db[_0x29d6('0x66')][_0x29d6('0x22')]({'where':_0x1d1f54['where']})[_0x29d6('0x2c')](function(_0x39e027){_0x245c72['count']=_0x39e027;if(_0x1b2091[_0x29d6('0x39')][_0x29d6('0x5d')]){_0x1d1f54[_0x29d6('0x4b')]=[{'all':!![]}];}return db[_0x29d6('0x66')][_0x29d6('0x4c')](_0x1d1f54);})[_0x29d6('0x2c')](function(_0x2a87ae){_0x245c72['rows']=_0x2a87ae;return _0x245c72;});}})[_0x29d6('0x2c')](respondWithFilteredResult(_0x4fd697,_0x1d1f54))[_0x29d6('0x4e')](handleError(_0x4fd697,null));};exports['getHopperBlacks']=function(_0x3da35f,_0x31abea,_0x5b3eb0){var _0x504046={'raw':!![],'where':{}};var _0x5b1e2b={};var _0x3705f9={'count':0x0,'rows':[]};return db[_0x29d6('0x4a')][_0x29d6('0x61')]({'where':{'id':_0x3da35f['params']['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x31abea,null))[_0x29d6('0x2c')](function(_0x243e35){if(_0x243e35){_0x5b1e2b['model']=_['keys'](db[_0x29d6('0x67')]['rawAttributes']);_0x5b1e2b['query']=_[_0x29d6('0x3a')](_0x3da35f[_0x29d6('0x39')]);_0x5b1e2b[_0x29d6('0x3b')]=_['intersection'](_0x5b1e2b[_0x29d6('0x3d')],_0x5b1e2b[_0x29d6('0x39')]);_0x504046[_0x29d6('0x3e')]=_[_0x29d6('0x3c')](_0x5b1e2b[_0x29d6('0x3d')],qs['fields'](_0x3da35f['query'][_0x29d6('0x3f')]));_0x504046[_0x29d6('0x3e')]=_0x504046[_0x29d6('0x3e')]['length']?_0x504046[_0x29d6('0x3e')]:_0x5b1e2b['model'];if(!_0x3da35f[_0x29d6('0x39')][_0x29d6('0x41')](_0x29d6('0x42'))){_0x504046[_0x29d6('0x21')]=qs[_0x29d6('0x21')](_0x3da35f['query'][_0x29d6('0x21')]);_0x504046[_0x29d6('0x1f')]=qs[_0x29d6('0x1f')](_0x3da35f[_0x29d6('0x39')]['offset']);}_0x504046['order']=qs[_0x29d6('0x44')](_0x3da35f['query'][_0x29d6('0x44')]);_0x504046[_0x29d6('0x47')]=qs[_0x29d6('0x3b')](_['pick'](_0x3da35f[_0x29d6('0x39')],_0x5b1e2b[_0x29d6('0x3b')]));_0x504046[_0x29d6('0x47')][_0x29d6('0x62')]=_0x243e35['id'];if(_0x3da35f[_0x29d6('0x39')][_0x29d6('0x46')]){_0x504046[_0x29d6('0x47')]=_[_0x29d6('0x48')](_0x504046[_0x29d6('0x47')],{'$or':_[_0x29d6('0x34')](_0x504046['attributes'],function(_0x1f507c){var _0xa3fb5a={};_0xa3fb5a[_0x1f507c]={'$like':'%'+_0x3da35f[_0x29d6('0x39')][_0x29d6('0x46')]+'%'};return _0xa3fb5a;})});}_0x504046=_[_0x29d6('0x48')]({},_0x504046,_0x3da35f[_0x29d6('0x4f')]);return db[_0x29d6('0x67')][_0x29d6('0x22')]({'where':_0x504046['where']})['then'](function(_0x58e06c){_0x3705f9[_0x29d6('0x22')]=_0x58e06c;if(_0x3da35f['query'][_0x29d6('0x5d')]){_0x504046[_0x29d6('0x4b')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x29d6('0x4c')](_0x504046);})[_0x29d6('0x2c')](function(_0x1ad7c9){_0x3705f9['rows']=_0x1ad7c9;return _0x3705f9;});}})[_0x29d6('0x2c')](respondWithFilteredResult(_0x31abea,_0x504046))[_0x29d6('0x4e')](handleError(_0x31abea,null));};exports['getLists']=function(_0x21502e,_0x3af990,_0x1154b7){var _0x25291a={};var _0x36d761={};var _0x4fa5f4;var _0x14fa36;return db[_0x29d6('0x4a')][_0x29d6('0x61')]({'where':{'id':_0x21502e[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x3af990,null))['then'](function(_0x49b131){if(_0x49b131){_0x4fa5f4=_0x49b131;_0x36d761[_0x29d6('0x3d')]=_[_0x29d6('0x3a')](db[_0x29d6('0x68')][_0x29d6('0x35')]);_0x36d761[_0x29d6('0x39')]=_['keys'](_0x21502e['query']);_0x36d761[_0x29d6('0x3b')]=_[_0x29d6('0x3c')](_0x36d761[_0x29d6('0x3d')],_0x36d761[_0x29d6('0x39')]);_0x25291a[_0x29d6('0x3e')]=_['intersection'](_0x36d761[_0x29d6('0x3d')],qs['fields'](_0x21502e['query'][_0x29d6('0x3f')]));_0x25291a[_0x29d6('0x3e')]=_0x25291a[_0x29d6('0x3e')]['length']?_0x25291a[_0x29d6('0x3e')]:_0x36d761[_0x29d6('0x3d')];_0x25291a['order']=qs[_0x29d6('0x44')](_0x21502e[_0x29d6('0x39')][_0x29d6('0x44')]);_0x25291a[_0x29d6('0x47')]=qs['filters'](_[_0x29d6('0x45')](_0x21502e['query'],_0x36d761[_0x29d6('0x3b')]));if(_0x21502e[_0x29d6('0x39')][_0x29d6('0x46')]){_0x25291a[_0x29d6('0x47')]=_[_0x29d6('0x48')](_0x25291a[_0x29d6('0x47')],{'$or':_[_0x29d6('0x34')](_0x25291a['attributes'],function(_0x1aaf17){var _0x43c26f={};_0x43c26f[_0x1aaf17]={'$like':'%'+_0x21502e[_0x29d6('0x39')]['filter']+'%'};return _0x43c26f;})});}_0x25291a=_[_0x29d6('0x48')]({},_0x25291a,_0x21502e[_0x29d6('0x4f')]);return _0x4fa5f4[_0x29d6('0x69')](_0x25291a);}})[_0x29d6('0x2c')](function(_0x47b67d){if(_0x47b67d){_0x14fa36=_0x47b67d[_0x29d6('0x40')];if(!_0x21502e[_0x29d6('0x39')]['hasOwnProperty'](_0x29d6('0x42'))){_0x25291a[_0x29d6('0x21')]=qs[_0x29d6('0x21')](_0x21502e[_0x29d6('0x39')][_0x29d6('0x21')]);_0x25291a[_0x29d6('0x1f')]=qs[_0x29d6('0x1f')](_0x21502e[_0x29d6('0x39')][_0x29d6('0x1f')]);}return _0x4fa5f4[_0x29d6('0x69')](_0x25291a);}})['then'](function(_0x18ae0b){if(_0x18ae0b){return _0x18ae0b?{'count':_0x14fa36,'rows':_0x18ae0b}:null;}})[_0x29d6('0x2c')](respondWithResult(_0x3af990,null))[_0x29d6('0x4e')](handleError(_0x3af990,null));};exports['addLists']=function(_0x2a3999,_0x33e2f9,_0x43fa17){var _0x206cff,_0x45c707;var _0x81e1f0=[];var _0x3a1c44=moment()['format'](_0x29d6('0x6a'));return db[_0x29d6('0x4a')][_0x29d6('0x50')]({'where':{'id':_0x2a3999[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x33e2f9,null))['then'](function(_0x1853b7){if(_0x1853b7){_0x45c707=_0x1853b7;return _0x1853b7[_0x29d6('0x6b')](_0x2a3999[_0x29d6('0x52')][_0x29d6('0x6c')],_[_0x29d6('0x5e')](_0x2a3999[_0x29d6('0x52')],[_0x29d6('0x6c'),'id'])||{});}return null;})['spread'](function(_0x4d5bbf){var _0x23af0e;var _0x168c4a;_0x206cff=_0x4d5bbf||[];var _0x238208=[];if(_0x4d5bbf){for(var _0x520390=0x0;_0x520390<_0x4d5bbf[_0x29d6('0x40')];_0x520390+=0x1){var _0x28fc89=_0x4d5bbf[_0x520390]['get']({'plain':!![]});_0x45c707[_0x29d6('0x6d')]=_0x2a3999['body'][_0x29d6('0x6d')]?_0x2a3999['body'][_0x29d6('0x6d')]:_0x45c707[_0x29d6('0x6d')];switch(_0x45c707['dialCheckDuplicateType']){case _0x29d6('0x6e'):_0x23af0e=squel[_0x29d6('0x6f')]()[_0x29d6('0x70')](_0x29d6('0x71'))[_0x29d6('0x72')]([_0x29d6('0x73'),_0x29d6('0x74'),_0x29d6('0x75'),_0x29d6('0x76'),_0x29d6('0x62'),_0x29d6('0x5f'),'updatedAt'],squel[_0x29d6('0x77')]()[_0x29d6('0x78')](_0x29d6('0x73'),_0x29d6('0x73'))[_0x29d6('0x78')](_0x29d6('0x79'),_0x29d6('0x74'))['field']('id',_0x29d6('0x75'))[_0x29d6('0x78')](_0x28fc89[_0x29d6('0x7a')][_0x29d6('0x7b')](),_0x29d6('0x76'))[_0x29d6('0x78')](_0x2a3999[_0x29d6('0x5c')]['id']['toString'](),_0x29d6('0x62'))[_0x29d6('0x78')]('\x27'+_0x3a1c44+'\x27',_0x29d6('0x5f'))['field']('\x27'+_0x3a1c44+'\x27',_0x29d6('0x60'))[_0x29d6('0x7c')](_0x29d6('0x7d'))[_0x29d6('0x47')](_0x29d6('0x7e'))[_0x29d6('0x47')](_0x29d6('0x7f'),_0x28fc89['CmListId']['toString']())[_0x29d6('0x47')](_0x29d6('0x80'))[_0x29d6('0x47')](_0x29d6('0x81'),squel[_0x29d6('0x77')]()[_0x29d6('0x78')]('COALESCE(calleridnum,\x27\x27)')[_0x29d6('0x7c')](_0x29d6('0x82'))[_0x29d6('0x47')](_0x29d6('0x83'),_0x2a3999['params']['id'][_0x29d6('0x7b')]()))[_0x29d6('0x47')](_0x29d6('0x81'),squel[_0x29d6('0x77')]()[_0x29d6('0x78')](_0x29d6('0x84'))[_0x29d6('0x7c')]('cm_hopper')[_0x29d6('0x47')](_0x29d6('0x83'),_0x2a3999[_0x29d6('0x5c')]['id']['toString']())))[_0x29d6('0x7b')]();break;case _0x29d6('0x85'):_0x23af0e=squel[_0x29d6('0x6f')]()[_0x29d6('0x70')](_0x29d6('0x71'))['fromQuery']([_0x29d6('0x73'),_0x29d6('0x74'),'ContactId',_0x29d6('0x76'),_0x29d6('0x62'),_0x29d6('0x5f'),_0x29d6('0x60')],squel['select']()[_0x29d6('0x78')](_0x29d6('0x73'),'phone')['field'](_0x29d6('0x79'),_0x29d6('0x74'))['field']('id',_0x29d6('0x75'))['field'](_0x28fc89['CmListId'][_0x29d6('0x7b')](),'ListId')[_0x29d6('0x78')](_0x2a3999['params']['id'][_0x29d6('0x7b')](),_0x29d6('0x62'))[_0x29d6('0x78')]('\x27'+_0x3a1c44+'\x27','createdAt')['field']('\x27'+_0x3a1c44+'\x27','updatedAt')[_0x29d6('0x7c')]('cm_contacts')[_0x29d6('0x47')]('deletedAt\x20IS\x20NULL')[_0x29d6('0x47')]('ListId\x20=\x20?',_0x28fc89[_0x29d6('0x7a')][_0x29d6('0x7b')]())[_0x29d6('0x47')](_0x29d6('0x80'))[_0x29d6('0x47')](_0x29d6('0x81'),squel['select']()[_0x29d6('0x78')]('COALESCE(phone,\x27\x27)')['from'](_0x29d6('0x71'))['where'](_0x29d6('0x83'),_0x2a3999[_0x29d6('0x5c')]['id'][_0x29d6('0x7b')]())))[_0x29d6('0x7b')]();break;default:_0x23af0e=squel[_0x29d6('0x6f')]()[_0x29d6('0x70')]('cm_hopper')[_0x29d6('0x72')]([_0x29d6('0x73'),_0x29d6('0x74'),_0x29d6('0x75'),_0x29d6('0x76'),'CampaignId',_0x29d6('0x5f'),'updatedAt'],squel[_0x29d6('0x77')]()[_0x29d6('0x78')](_0x29d6('0x73'),'phone')[_0x29d6('0x78')]('NOW()',_0x29d6('0x74'))[_0x29d6('0x78')]('id',_0x29d6('0x75'))['field'](_0x28fc89[_0x29d6('0x7a')][_0x29d6('0x7b')](),_0x29d6('0x76'))[_0x29d6('0x78')](_0x2a3999[_0x29d6('0x5c')]['id'][_0x29d6('0x7b')](),_0x29d6('0x62'))[_0x29d6('0x78')]('\x27'+_0x3a1c44+'\x27',_0x29d6('0x5f'))[_0x29d6('0x78')]('\x27'+_0x3a1c44+'\x27',_0x29d6('0x60'))[_0x29d6('0x7c')]('cm_contacts')[_0x29d6('0x47')]('deletedAt\x20IS\x20NULL')[_0x29d6('0x47')](_0x29d6('0x7f'),_0x28fc89[_0x29d6('0x7a')][_0x29d6('0x7b')]())[_0x29d6('0x47')](_0x29d6('0x80')))[_0x29d6('0x7b')]();}_0x168c4a=squel[_0x29d6('0x6f')]()[_0x29d6('0x70')](_0x29d6('0x86'))['fromQuery']([_0x29d6('0x87'),'scheduledAt',_0x29d6('0x73'),_0x29d6('0x88'),_0x29d6('0x5f'),'updatedAt'],squel['select']()['field'](_0x29d6('0x89'),'id')[_0x29d6('0x78')]('NOW()',_0x29d6('0x74'))['field'](_0x29d6('0x8a'),_0x29d6('0x73'))[_0x29d6('0x78')](_0x29d6('0x8b'),_0x29d6('0x88'))[_0x29d6('0x78')]('\x27'+_0x3a1c44+'\x27',_0x29d6('0x5f'))[_0x29d6('0x78')]('\x27'+_0x3a1c44+'\x27',_0x29d6('0x60'))[_0x29d6('0x7c')](_0x29d6('0x8c'),'ci')[_0x29d6('0x8d')](_0x29d6('0x71'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x29d6('0x47')]('h.ListId\x20=\x20?',_0x28fc89['CmListId'][_0x29d6('0x7b')]())[_0x29d6('0x47')](_0x29d6('0x8e'),_0x2a3999[_0x29d6('0x5c')]['id'][_0x29d6('0x7b')]())[_0x29d6('0x47')](_0x29d6('0x8f'),_0x3a1c44))['toString']();_0x238208[_0x29d6('0x90')](db['sequelize'][_0x29d6('0x39')](_0x23af0e));_0x81e1f0[_0x29d6('0x90')](db[_0x29d6('0x91')]['query'](_0x168c4a));}return BPromise[_0x29d6('0x92')](_0x238208);}})[_0x29d6('0x2c')](function(){return BPromise['all'](_0x81e1f0);})[_0x29d6('0x2c')](function(){return _0x206cff;})[_0x29d6('0x2c')](respondWithResult(_0x33e2f9,null))[_0x29d6('0x4e')](handleError(_0x33e2f9,null));};exports[_0x29d6('0x93')]=function(_0x245b8e,_0x511eaf,_0x1b84d9){return db[_0x29d6('0x4a')]['find']({'where':{'id':_0x245b8e['params']['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x511eaf,null))[_0x29d6('0x2c')](function(_0xb2d8e4){if(_0xb2d8e4){return _0xb2d8e4[_0x29d6('0x93')](_0x245b8e[_0x29d6('0x39')][_0x29d6('0x6c')]);}})[_0x29d6('0x2c')](function(_0x3a323e){if(_0x3a323e){return db[_0x29d6('0x94')][_0x29d6('0x2b')]({'where':{'ListId':_0x245b8e['query']['ids'],'CampaignId':_0x245b8e[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](function(){return _0x3a323e;});}})[_0x29d6('0x2c')](respondWithStatusCode(_0x511eaf,null))[_0x29d6('0x4e')](handleError(_0x511eaf,null));};exports[_0x29d6('0x95')]=function(_0x56fc6c,_0x2c30e9,_0x247035){var _0x1c91d8={};var _0x330a7a={};var _0x333d3c;var _0x749cb1;return db['Campaign'][_0x29d6('0x61')]({'where':{'id':_0x56fc6c[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x2c30e9,null))[_0x29d6('0x2c')](function(_0x56183d){if(_0x56183d){_0x333d3c=_0x56183d;_0x330a7a[_0x29d6('0x3d')]=_['keys'](db[_0x29d6('0x68')][_0x29d6('0x35')]);_0x330a7a['query']=_[_0x29d6('0x3a')](_0x56fc6c['query']);_0x330a7a['filters']=_[_0x29d6('0x3c')](_0x330a7a[_0x29d6('0x3d')],_0x330a7a[_0x29d6('0x39')]);_0x1c91d8['attributes']=_[_0x29d6('0x3c')](_0x330a7a[_0x29d6('0x3d')],qs['fields'](_0x56fc6c[_0x29d6('0x39')][_0x29d6('0x3f')]));_0x1c91d8[_0x29d6('0x3e')]=_0x1c91d8['attributes'][_0x29d6('0x40')]?_0x1c91d8['attributes']:_0x330a7a[_0x29d6('0x3d')];_0x1c91d8[_0x29d6('0x43')]=qs[_0x29d6('0x44')](_0x56fc6c[_0x29d6('0x39')][_0x29d6('0x44')]);_0x1c91d8['where']=qs[_0x29d6('0x3b')](_[_0x29d6('0x45')](_0x56fc6c[_0x29d6('0x39')],_0x330a7a[_0x29d6('0x3b')]));if(_0x56fc6c[_0x29d6('0x39')][_0x29d6('0x46')]){_0x1c91d8[_0x29d6('0x47')]=_[_0x29d6('0x48')](_0x1c91d8['where'],{'$or':_[_0x29d6('0x34')](_0x1c91d8['attributes'],function(_0x2e555e){var _0x13f78c={};_0x13f78c[_0x2e555e]={'$like':'%'+_0x56fc6c[_0x29d6('0x39')]['filter']+'%'};return _0x13f78c;})});}_0x1c91d8=_[_0x29d6('0x48')]({},_0x1c91d8,_0x56fc6c['options']);return _0x333d3c['getBlackLists'](_0x1c91d8);}})[_0x29d6('0x2c')](function(_0x213b19){if(_0x213b19){_0x749cb1=_0x213b19[_0x29d6('0x40')];if(!_0x56fc6c['query'][_0x29d6('0x41')](_0x29d6('0x42'))){_0x1c91d8[_0x29d6('0x21')]=qs[_0x29d6('0x21')](_0x56fc6c[_0x29d6('0x39')][_0x29d6('0x21')]);_0x1c91d8[_0x29d6('0x1f')]=qs[_0x29d6('0x1f')](_0x56fc6c[_0x29d6('0x39')][_0x29d6('0x1f')]);}return _0x333d3c[_0x29d6('0x95')](_0x1c91d8);}})[_0x29d6('0x2c')](function(_0x5cb616){if(_0x5cb616){return _0x5cb616?{'count':_0x749cb1,'rows':_0x5cb616}:null;}})[_0x29d6('0x2c')](respondWithResult(_0x2c30e9,null))[_0x29d6('0x4e')](handleError(_0x2c30e9,null));};exports[_0x29d6('0x96')]=function(_0x19a601,_0x3471d0,_0x267fe3){var _0x54f859,_0x2cfbbd;var _0x21dc0f=[];var _0x415f68=moment()['format'](_0x29d6('0x6a'));return db['Campaign'][_0x29d6('0x50')]({'where':{'id':_0x19a601[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](handleEntityNotFound(_0x3471d0,null))[_0x29d6('0x2c')](function(_0x5695d7){if(_0x5695d7){_0x2cfbbd=_0x5695d7;return _0x5695d7['addBlackLists'](_0x19a601[_0x29d6('0x52')][_0x29d6('0x6c')],_['omit'](_0x19a601['body'],[_0x29d6('0x6c'),'id'])||{});}return null;})[_0x29d6('0x97')](function(_0x39ac3e){var _0x1ef741;var _0x184ba3;_0x54f859=_0x39ac3e||[];var _0x435ab8=[];if(_0x39ac3e){for(var _0x5ab7ec=0x0;_0x5ab7ec<_0x39ac3e[_0x29d6('0x40')];_0x5ab7ec+=0x1){var _0x79b417=_0x39ac3e[_0x5ab7ec][_0x29d6('0x2d')]({'plain':!![]});_0x1ef741=squel[_0x29d6('0x6f')]()['into'](_0x29d6('0x98'))['fromQuery']([_0x29d6('0x73'),'ContactId',_0x29d6('0x76'),'CampaignId',_0x29d6('0x5f'),'updatedAt'],squel[_0x29d6('0x77')]()[_0x29d6('0x78')]('phone',_0x29d6('0x73'))[_0x29d6('0x78')]('id',_0x29d6('0x75'))[_0x29d6('0x78')](_0x79b417[_0x29d6('0x7a')][_0x29d6('0x7b')](),'ListId')[_0x29d6('0x78')](_0x19a601[_0x29d6('0x5c')]['id'][_0x29d6('0x7b')](),'CampaignId')[_0x29d6('0x78')](_0x29d6('0x79'),'createdAt')[_0x29d6('0x78')](_0x29d6('0x79'),_0x29d6('0x60'))['from'](_0x29d6('0x7d'))[_0x29d6('0x47')]('deletedAt\x20IS\x20NULL')[_0x29d6('0x47')](_0x29d6('0x7f'),_0x79b417[_0x29d6('0x7a')]['toString']())[_0x29d6('0x47')](_0x29d6('0x80')))[_0x29d6('0x7b')]();_0x435ab8[_0x29d6('0x90')](db[_0x29d6('0x91')]['query'](_0x1ef741));}return BPromise['all'](_0x435ab8);}})[_0x29d6('0x2c')](function(){return _0x54f859;})[_0x29d6('0x2c')](respondWithResult(_0x3471d0,null))[_0x29d6('0x4e')](handleError(_0x3471d0,null));};exports[_0x29d6('0x99')]=function(_0x234c1e,_0x2de2ea,_0x2b37a8){return db[_0x29d6('0x4a')]['find']({'where':{'id':_0x234c1e[_0x29d6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2de2ea,null))[_0x29d6('0x2c')](function(_0x59046e){if(_0x59046e){return _0x59046e['removeBlackLists'](_0x234c1e[_0x29d6('0x39')][_0x29d6('0x6c')]);}})['then'](function(_0x40af2e){if(_0x40af2e){return db[_0x29d6('0x67')][_0x29d6('0x2b')]({'where':{'ListId':_0x234c1e[_0x29d6('0x39')][_0x29d6('0x6c')],'CampaignId':_0x234c1e[_0x29d6('0x5c')]['id']}})[_0x29d6('0x2c')](function(){return _0x40af2e;});}})[_0x29d6('0x2c')](respondWithStatusCode(_0x2de2ea,null))[_0x29d6('0x4e')](handleError(_0x2de2ea,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 53f46f6..e7fc9eb 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1c36b3,_0x26d4cd){var _0x329667=function(_0x1a233d){while(--_0x1a233d){_0x1c36b3['push'](_0x1c36b3['shift']());}};_0x329667(++_0x26d4cd);}(_0x7a54,0x106));var _0x47a5=function(_0x2408ae,_0x2d71cd){_0x2408ae=_0x2408ae-0x0;var _0x378f03=_0x7a54[_0x2408ae];return _0x378f03;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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':'campaigns','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 fc36123..21d1d56 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 _0x34e5=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','util','bluebird','randomstring','ioredis'];(function(_0x3b5014,_0x21e44b){var _0x4d1fb8=function(_0x5f2bd0){while(--_0x5f2bd0){_0x3b5014['push'](_0x3b5014['shift']());}};_0x4d1fb8(++_0x21e44b);}(_0x34e5,0x172));var _0x534e=function(_0x6c59db,_0x44604e){_0x6c59db=_0x6c59db-0x0;var _0x4f03cf=_0x34e5[_0x6c59db];return _0x4f03cf;};'use strict';var _=require('lodash');var util=require(_0x534e('0x0'));var moment=require('moment');var BPromise=require(_0x534e('0x1'));var rs=require(_0x534e('0x2'));var fs=require('fs');var Redis=require(_0x534e('0x3'));var db=require(_0x534e('0x4'))['db'];var utils=require(_0x534e('0x5'));var logger=require('../../config/logger')(_0x534e('0x6'));var config=require(_0x534e('0x7'));var jayson=require(_0x534e('0x8'));var client=jayson[_0x534e('0x9')][_0x534e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d0370,_0x2760e7,_0x5620d4){return new BPromise(function(_0x24d562,_0x929597){return client[_0x534e('0xb')](_0x2d0370,_0x5620d4)['then'](function(_0x59fcff){logger[_0x534e('0xc')]('Campaign,\x20%s,\x20%s',_0x2760e7,_0x534e('0xd'));logger['debug'](_0x534e('0xe'),_0x2760e7,_0x534e('0xd'),JSON[_0x534e('0xf')](_0x59fcff));if(_0x59fcff['error']){if(_0x59fcff[_0x534e('0x10')][_0x534e('0x11')]===0x1f4){logger[_0x534e('0x10')](_0x534e('0x12'),_0x2760e7,_0x59fcff[_0x534e('0x10')]['message']);return _0x929597(_0x59fcff[_0x534e('0x10')][_0x534e('0x13')]);}logger[_0x534e('0x10')](_0x534e('0x12'),_0x2760e7,_0x59fcff[_0x534e('0x10')][_0x534e('0x13')]);return _0x24d562(_0x59fcff[_0x534e('0x10')][_0x534e('0x13')]);}else{logger[_0x534e('0xc')]('Campaign,\x20%s,\x20%s',_0x2760e7,_0x534e('0xd'));_0x24d562(_0x59fcff[_0x534e('0x14')]['message']);}})['catch'](function(_0x2de9d0){logger[_0x534e('0x10')](_0x534e('0x12'),_0x2760e7,_0x2de9d0);_0x929597(_0x2de9d0);});});}exports[_0x534e('0x15')]=function(_0x22bc92){var _0x26938d=this;return new Promise(function(_0x100751,_0x54d399){return db[_0x534e('0x16')][_0x534e('0x17')]({'raw':_0x22bc92[_0x534e('0x18')]?_0x22bc92[_0x534e('0x18')][_0x534e('0x19')]===undefined?!![]:![]:!![],'where':_0x22bc92['options']?_0x22bc92[_0x534e('0x18')][_0x534e('0x1a')]||null:null,'attributes':_0x22bc92[_0x534e('0x18')]?_0x22bc92[_0x534e('0x18')][_0x534e('0x1b')]||null:null,'limit':_0x22bc92[_0x534e('0x18')]?_0x22bc92[_0x534e('0x18')][_0x534e('0x1c')]||null:null,'include':_0x22bc92[_0x534e('0x18')]?_0x22bc92['options'][_0x534e('0x1d')]?_[_0x534e('0x1e')](_0x22bc92[_0x534e('0x18')][_0x534e('0x1d')],function(_0x324205){return{'model':db[_0x324205[_0x534e('0x1f')]],'as':_0x324205['as'],'attributes':_0x324205[_0x534e('0x1b')],'include':_0x324205[_0x534e('0x1d')]?_['map'](_0x324205[_0x534e('0x1d')],function(_0x588c08){return{'model':db[_0x588c08[_0x534e('0x1f')]],'as':_0x588c08['as'],'attributes':_0x588c08[_0x534e('0x1b')],'include':_0x588c08[_0x534e('0x1d')]?_[_0x534e('0x1e')](_0x588c08[_0x534e('0x1d')],function(_0x57b216){return{'model':db[_0x57b216[_0x534e('0x1f')]],'as':_0x57b216['as'],'attributes':_0x57b216[_0x534e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bd073){logger[_0x534e('0xc')]('GetCampaign',_0x22bc92);logger[_0x534e('0x20')](_0x534e('0x15'),_0x22bc92,JSON[_0x534e('0xf')](_0x4bd073));_0x100751(_0x4bd073);})[_0x534e('0x21')](function(_0x15be5c){logger[_0x534e('0x10')](_0x534e('0x15'),_0x15be5c['message'],_0x22bc92);_0x54d399(_0x26938d['error'](0x1f4,_0x15be5c[_0x534e('0x13')]));});});}; \ No newline at end of file +var _0x3379=['attributes','map','include','model','GetCampaign','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Campaign','findAll','options','raw','where'];(function(_0x381119,_0x5e11f9){var _0x144927=function(_0x5a3938){while(--_0x5a3938){_0x381119['push'](_0x381119['shift']());}};_0x144927(++_0x5e11f9);}(_0x3379,0x115));var _0x9337=function(_0x2cad47,_0x4df2a3){_0x2cad47=_0x2cad47-0x0;var _0x34d75f=_0x3379[_0x2cad47];return _0x34d75f;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var moment=require(_0x9337('0x2'));var BPromise=require(_0x9337('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9337('0x4'));var db=require(_0x9337('0x5'))['db'];var utils=require(_0x9337('0x6'));var logger=require(_0x9337('0x7'))('rpc');var config=require(_0x9337('0x8'));var jayson=require(_0x9337('0x9'));var client=jayson[_0x9337('0xa')][_0x9337('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a59ab,_0x16e2a4,_0x5b1986){return new BPromise(function(_0x268943,_0xdaec59){return client[_0x9337('0xc')](_0x5a59ab,_0x5b1986)[_0x9337('0xd')](function(_0x15c578){logger['info'](_0x9337('0xe'),_0x16e2a4,_0x9337('0xf'));logger[_0x9337('0x10')](_0x9337('0x11'),_0x16e2a4,_0x9337('0xf'),JSON['stringify'](_0x15c578));if(_0x15c578[_0x9337('0x12')]){if(_0x15c578[_0x9337('0x12')][_0x9337('0x13')]===0x1f4){logger[_0x9337('0x12')](_0x9337('0xe'),_0x16e2a4,_0x15c578[_0x9337('0x12')][_0x9337('0x14')]);return _0xdaec59(_0x15c578['error']['message']);}logger[_0x9337('0x12')](_0x9337('0xe'),_0x16e2a4,_0x15c578[_0x9337('0x12')][_0x9337('0x14')]);return _0x268943(_0x15c578['error']['message']);}else{logger[_0x9337('0x15')]('Campaign,\x20%s,\x20%s',_0x16e2a4,'request\x20sent');_0x268943(_0x15c578[_0x9337('0x16')][_0x9337('0x14')]);}})[_0x9337('0x17')](function(_0x48644e){logger[_0x9337('0x12')](_0x9337('0xe'),_0x16e2a4,_0x48644e);_0xdaec59(_0x48644e);});});}exports['GetCampaign']=function(_0x5e49e7){var _0x424f11=this;return new Promise(function(_0x462196,_0x4a27cc){return db[_0x9337('0x18')][_0x9337('0x19')]({'raw':_0x5e49e7['options']?_0x5e49e7[_0x9337('0x1a')][_0x9337('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e49e7['options']?_0x5e49e7[_0x9337('0x1a')][_0x9337('0x1c')]||null:null,'attributes':_0x5e49e7['options']?_0x5e49e7['options'][_0x9337('0x1d')]||null:null,'limit':_0x5e49e7['options']?_0x5e49e7[_0x9337('0x1a')]['limit']||null:null,'include':_0x5e49e7[_0x9337('0x1a')]?_0x5e49e7['options']['include']?_[_0x9337('0x1e')](_0x5e49e7['options'][_0x9337('0x1f')],function(_0x543cfc){return{'model':db[_0x543cfc[_0x9337('0x20')]],'as':_0x543cfc['as'],'attributes':_0x543cfc[_0x9337('0x1d')],'include':_0x543cfc[_0x9337('0x1f')]?_[_0x9337('0x1e')](_0x543cfc[_0x9337('0x1f')],function(_0xb49ff1){return{'model':db[_0xb49ff1['model']],'as':_0xb49ff1['as'],'attributes':_0xb49ff1['attributes'],'include':_0xb49ff1[_0x9337('0x1f')]?_[_0x9337('0x1e')](_0xb49ff1[_0x9337('0x1f')],function(_0x178ed5){return{'model':db[_0x178ed5['model']],'as':_0x178ed5['as'],'attributes':_0x178ed5[_0x9337('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e2c6e){logger[_0x9337('0x15')](_0x9337('0x21'),_0x5e49e7);logger[_0x9337('0x10')]('GetCampaign',_0x5e49e7,JSON['stringify'](_0x2e2c6e));_0x462196(_0x2e2c6e);})[_0x9337('0x17')](function(_0x1bcb04){logger[_0x9337('0x12')](_0x9337('0x21'),_0x1bcb04[_0x9337('0x14')],_0x5e49e7);_0x4a27cc(_0x424f11['error'](0x1f4,_0x1bcb04[_0x9337('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 84f6af0..1135903 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 _0xf4e5=['/:id/clone','clone','addBlackLists','put','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create'];(function(_0x2b21d1,_0x472a10){var _0x446efa=function(_0x3a4e57){while(--_0x3a4e57){_0x2b21d1['push'](_0x2b21d1['shift']());}};_0x446efa(++_0x472a10);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x2da35e,_0x283073){_0x2da35e=_0x2da35e-0x0;var _0x4e684c=_0xf4e5[_0x2da35e];return _0x4e684c;};'use strict';var multer=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var path=require(_0x5f4e('0x2'));var timeout=require(_0x5f4e('0x3'));var express=require(_0x5f4e('0x4'));var router=express[_0x5f4e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5f4e('0x6'));var config=require(_0x5f4e('0x7'));var controller=require(_0x5f4e('0x8'));router['get']('/',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0xa')]);router[_0x5f4e('0xb')](_0x5f4e('0xc'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0xd')]);router[_0x5f4e('0xb')](_0x5f4e('0xe'),auth[_0x5f4e('0x9')](),controller['getHoppers']);router['get'](_0x5f4e('0xf'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x10')]);router['get'](_0x5f4e('0x11'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x12')]);router[_0x5f4e('0xb')](_0x5f4e('0x13'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x14')]);router[_0x5f4e('0xb')](_0x5f4e('0x15'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x16')]);router['get'](_0x5f4e('0x17'),auth[_0x5f4e('0x9')](),controller['getBlackLists']);router[_0x5f4e('0x18')]('/',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x19')]);router['post'](_0x5f4e('0x1a'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x1b')]);router['post'](_0x5f4e('0x15'),auth[_0x5f4e('0x9')](),controller['addLists']);router[_0x5f4e('0x18')](_0x5f4e('0x17'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x1c')]);router[_0x5f4e('0x1d')]('/:id',auth[_0x5f4e('0x9')](),controller['update']);router[_0x5f4e('0x1e')](_0x5f4e('0xc'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x1f')]);router[_0x5f4e('0x1e')](_0x5f4e('0x15'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x20')]);router[_0x5f4e('0x1e')](_0x5f4e('0x17'),auth[_0x5f4e('0x9')](),controller['removeBlackLists']);module[_0x5f4e('0x21')]=router; \ No newline at end of file +var _0x2881=['removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','delete','destroy','removeLists'];(function(_0x29fc26,_0x2d112a){var _0x21a90c=function(_0x17075f){while(--_0x17075f){_0x29fc26['push'](_0x29fc26['shift']());}};_0x21a90c(++_0x2d112a);}(_0x2881,0x1f1));var _0x1288=function(_0x26945f,_0x18aabc){_0x26945f=_0x26945f-0x0;var _0x4b7041=_0x2881[_0x26945f];return _0x4b7041;};'use strict';var multer=require(_0x1288('0x0'));var util=require(_0x1288('0x1'));var path=require(_0x1288('0x2'));var timeout=require(_0x1288('0x3'));var express=require(_0x1288('0x4'));var router=express['Router']();var fs_extra=require(_0x1288('0x5'));var auth=require(_0x1288('0x6'));var interaction=require(_0x1288('0x7'));var config=require('../../config/environment');var controller=require(_0x1288('0x8'));router[_0x1288('0x9')]('/',auth[_0x1288('0xa')](),controller[_0x1288('0xb')]);router[_0x1288('0x9')](_0x1288('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x1288('0x9')](_0x1288('0xd'),auth[_0x1288('0xa')](),controller[_0x1288('0xe')]);router[_0x1288('0x9')]('/:id/hopper_histories',auth[_0x1288('0xa')](),controller[_0x1288('0xf')]);router[_0x1288('0x9')](_0x1288('0x10'),auth[_0x1288('0xa')](),controller['getHopperFinals']);router[_0x1288('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x1288('0x11')]);router[_0x1288('0x9')]('/:id/lists',auth[_0x1288('0xa')](),controller[_0x1288('0x12')]);router['get'](_0x1288('0x13'),auth['isAuthenticated'](),controller[_0x1288('0x14')]);router['post']('/',auth[_0x1288('0xa')](),controller['create']);router[_0x1288('0x15')](_0x1288('0x16'),auth[_0x1288('0xa')](),controller[_0x1288('0x17')]);router[_0x1288('0x15')](_0x1288('0x18'),auth['isAuthenticated'](),controller[_0x1288('0x19')]);router[_0x1288('0x15')](_0x1288('0x13'),auth['isAuthenticated'](),controller[_0x1288('0x1a')]);router[_0x1288('0x1b')]('/:id',auth[_0x1288('0xa')](),controller['update']);router[_0x1288('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x1288('0x1d')]);router[_0x1288('0x1c')](_0x1288('0x18'),auth['isAuthenticated'](),controller[_0x1288('0x1e')]);router['delete'](_0x1288('0x13'),auth[_0x1288('0xa')](),controller[_0x1288('0x1f')]);module[_0x1288('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 8641c0d..e3a9dbb 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 _0x087f=['getDataValue','key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x453704,_0xcf42a8){var _0x1d1ba5=function(_0x433ba0){while(--_0x433ba0){_0x453704['push'](_0x453704['shift']());}};_0x1d1ba5(++_0xcf42a8);}(_0x087f,0xaa));var _0xf087=function(_0x41c389,_0x12c287){_0x41c389=_0x41c389-0x0;var _0x313ad5=_0x087f[_0x41c389];return _0x313ad5;};'use strict';var Sequelize=require(_0xf087('0x0'));module[_0xf087('0x1')]={'key':{'type':Sequelize[_0xf087('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf087('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf087('0x2')]},'name':{'type':Sequelize[_0xf087('0x4')],'get':function(){return this[_0xf087('0x5')](_0xf087('0x6'));}}}; \ No newline at end of file +var _0x4b35=['sequelize','exports','STRING','TEXT','getDataValue','key'];(function(_0x39a7da,_0x18f312){var _0x1e0fc5=function(_0x2ed66d){while(--_0x2ed66d){_0x39a7da['push'](_0x39a7da['shift']());}};_0x1e0fc5(++_0x18f312);}(_0x4b35,0x66));var _0x54b3=function(_0x5ad85a,_0x5bdc6d){_0x5ad85a=_0x5ad85a-0x0;var _0x6eeeb5=_0x4b35[_0x5ad85a];return _0x6eeeb5;};'use strict';var Sequelize=require(_0x54b3('0x0'));module[_0x54b3('0x1')]={'key':{'type':Sequelize[_0x54b3('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x54b3('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x54b3('0x4')](_0x54b3('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 23226ad..02328aa 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 _0x2463=['where','pick','filter','merge','includeAll','include','findAll','rows','catch','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2463,0xc7));var _0x3246=function(_0x204fb5,_0x23cd68){_0x204fb5=_0x204fb5-0x0;var _0x5032b8=_0x2463[_0x204fb5];return _0x5032b8;};'use strict';var emlformat=require(_0x3246('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3246('0x1'));var jsonpatch=require(_0x3246('0x2'));var rp=require(_0x3246('0x3'));var moment=require(_0x3246('0x4'));var BPromise=require(_0x3246('0x5'));var Mustache=require(_0x3246('0x6'));var util=require('util');var path=require(_0x3246('0x7'));var sox=require('sox');var csv=require(_0x3246('0x8'));var ejs=require(_0x3246('0x9'));var fs=require('fs');var fs_extra=require(_0x3246('0xa'));var _=require(_0x3246('0xb'));var squel=require(_0x3246('0xc'));var crypto=require(_0x3246('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3246('0x8'));var querystring=require('querystring');var Papa=require(_0x3246('0xe'));var Redis=require(_0x3246('0xf'));var authService=require(_0x3246('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3246('0x11'));var hardwareService=require(_0x3246('0x12'));var logger=require(_0x3246('0x13'))(_0x3246('0x14'));var utils=require('../../config/utils');var config=require(_0x3246('0x15'));var licenseUtil=require(_0x3246('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x986a30,_0x402a44){_0x402a44=_0x402a44||0xcc;return function(_0x52194a){if(_0x52194a){return _0x986a30['sendStatus'](_0x402a44);}return _0x986a30['status'](_0x402a44)[_0x3246('0x17')]();};}function respondWithResult(_0x47e9aa,_0x3e76b2){_0x3e76b2=_0x3e76b2||0xc8;return function(_0x2ee7f5){if(_0x2ee7f5){return _0x47e9aa[_0x3246('0x18')](_0x3e76b2)[_0x3246('0x19')](_0x2ee7f5);}};}function respondWithFilteredResult(_0x103c03,_0xb878d8){return function(_0x3a2ef0){if(_0x3a2ef0){var _0x2fa065=typeof _0xb878d8['offset']===_0x3246('0x1a')&&typeof _0xb878d8[_0x3246('0x1b')]===_0x3246('0x1a');var _0x2777b5=_0x3a2ef0[_0x3246('0x1c')];var _0x360449=_0x2fa065?0x0:_0xb878d8[_0x3246('0x1d')];var _0x3ca487=_0x2fa065?_0x3a2ef0[_0x3246('0x1c')]:_0xb878d8['offset']+_0xb878d8['limit'];var _0x4f6217;if(_0x3ca487>=_0x2777b5){_0x3ca487=_0x2777b5;_0x4f6217=0xc8;}else{_0x4f6217=0xce;}_0x103c03[_0x3246('0x18')](_0x4f6217);return _0x103c03[_0x3246('0x1e')](_0x3246('0x1f'),_0x360449+'-'+_0x3ca487+'/'+_0x2777b5)[_0x3246('0x19')](_0x3a2ef0);}return null;};}function patchUpdates(_0x1bf8fd){return function(_0x165765){try{jsonpatch['apply'](_0x165765,_0x1bf8fd,!![]);}catch(_0x5c0d0c){return BPromise[_0x3246('0x20')](_0x5c0d0c);}return _0x165765[_0x3246('0x21')]();};}function saveUpdates(_0x1f7226,_0x116ec5){return function(_0x1b938d){if(_0x1b938d){return _0x1b938d['update'](_0x1f7226)[_0x3246('0x22')](function(_0x5563e0){return _0x5563e0;});}return null;};}function removeEntity(_0x5dd4b5,_0x1f0ae6){return function(_0x22aa49){if(_0x22aa49){return _0x22aa49[_0x3246('0x23')]()[_0x3246('0x22')](function(){var _0x41cfd4=_0x22aa49[_0x3246('0x24')]({'plain':!![]});var _0x4b5eda='CannedAnswers';return db[_0x3246('0x25')][_0x3246('0x23')]({'where':{'type':_0x4b5eda,'resourceId':_0x41cfd4['id']}})[_0x3246('0x22')](function(){return _0x22aa49;});})[_0x3246('0x22')](function(){_0x5dd4b5[_0x3246('0x18')](0xcc)[_0x3246('0x17')]();});}};}function handleEntityNotFound(_0x23ade6,_0x362684){return function(_0x30b3a3){if(!_0x30b3a3){_0x23ade6[_0x3246('0x26')](0x194);}return _0x30b3a3;};}function handleError(_0x363a54,_0x3af9fa){_0x3af9fa=_0x3af9fa||0x1f4;return function(_0x586a19){logger[_0x3246('0x27')](_0x586a19[_0x3246('0x28')]);if(_0x586a19[_0x3246('0x29')]){delete _0x586a19['name'];}_0x363a54[_0x3246('0x18')](_0x3af9fa)[_0x3246('0x2a')](_0x586a19);};}exports[_0x3246('0x2b')]=function(_0x3686e8,_0x4a74ab){var _0x444783={},_0x5678eb={},_0xccae37={'count':0x0,'rows':[]};var _0x319f6f=_[_0x3246('0x2c')](db[_0x3246('0x2d')][_0x3246('0x2e')],function(_0x4dca66){return{'name':_0x4dca66[_0x3246('0x2f')],'type':_0x4dca66[_0x3246('0x30')][_0x3246('0x31')]};});_0x5678eb[_0x3246('0x32')]=_[_0x3246('0x2c')](_0x319f6f,_0x3246('0x29'));_0x5678eb[_0x3246('0x33')]=_[_0x3246('0x34')](_0x3686e8[_0x3246('0x33')]);_0x5678eb[_0x3246('0x35')]=_[_0x3246('0x36')](_0x5678eb[_0x3246('0x32')],_0x5678eb[_0x3246('0x33')]);_0x444783[_0x3246('0x37')]=_['intersection'](_0x5678eb[_0x3246('0x32')],qs[_0x3246('0x38')](_0x3686e8[_0x3246('0x33')][_0x3246('0x38')]));_0x444783[_0x3246('0x37')]=_0x444783[_0x3246('0x37')][_0x3246('0x39')]?_0x444783[_0x3246('0x37')]:_0x5678eb[_0x3246('0x32')];if(!_0x3686e8[_0x3246('0x33')]['hasOwnProperty'](_0x3246('0x3a'))){_0x444783[_0x3246('0x1b')]=qs[_0x3246('0x1b')](_0x3686e8[_0x3246('0x33')][_0x3246('0x1b')]);_0x444783[_0x3246('0x1d')]=qs[_0x3246('0x1d')](_0x3686e8['query'][_0x3246('0x1d')]);}_0x444783['order']=qs['sort'](_0x3686e8[_0x3246('0x33')]['sort']);_0x444783[_0x3246('0x3b')]=qs[_0x3246('0x35')](_[_0x3246('0x3c')](_0x3686e8[_0x3246('0x33')],_0x5678eb[_0x3246('0x35')]),_0x319f6f);if(_0x3686e8[_0x3246('0x33')][_0x3246('0x3d')]){_0x444783['where']=_[_0x3246('0x3e')](_0x444783[_0x3246('0x3b')],{'$or':[{'key':{'$like':'%'+_0x3686e8['query'][_0x3246('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3686e8['query']['filter']+'%'}}]});}_0x444783=_[_0x3246('0x3e')]({},_0x444783,_0x3686e8['options']);var _0x17e1f6={'where':_0x444783['where']};return db[_0x3246('0x2d')][_0x3246('0x1c')](_0x17e1f6)[_0x3246('0x22')](function(_0x3d12cf){_0xccae37[_0x3246('0x1c')]=_0x3d12cf;if(_0x3686e8[_0x3246('0x33')][_0x3246('0x3f')]){_0x444783[_0x3246('0x40')]=[{'all':!![]}];}return db[_0x3246('0x2d')][_0x3246('0x41')](_0x444783);})[_0x3246('0x22')](function(_0x1375b2){_0xccae37[_0x3246('0x42')]=_0x1375b2;return _0xccae37;})[_0x3246('0x22')](respondWithFilteredResult(_0x4a74ab,_0x444783))[_0x3246('0x43')](handleError(_0x4a74ab,null));};exports['show']=function(_0x55488a,_0x22c8f0){var _0x47a74b={'raw':!![],'where':{'id':_0x55488a['params']['id']}},_0x34708f={};_0x34708f['model']=_[_0x3246('0x34')](db[_0x3246('0x2d')][_0x3246('0x2e')]);_0x34708f[_0x3246('0x33')]=_[_0x3246('0x34')](_0x55488a[_0x3246('0x33')]);_0x34708f[_0x3246('0x35')]=_[_0x3246('0x36')](_0x34708f[_0x3246('0x32')],_0x34708f[_0x3246('0x33')]);_0x47a74b[_0x3246('0x37')]=_[_0x3246('0x36')](_0x34708f[_0x3246('0x32')],qs[_0x3246('0x38')](_0x55488a['query'][_0x3246('0x38')]));_0x47a74b[_0x3246('0x37')]=_0x47a74b[_0x3246('0x37')][_0x3246('0x39')]?_0x47a74b[_0x3246('0x37')]:_0x34708f['model'];if(_0x55488a[_0x3246('0x33')]['includeAll']){_0x47a74b[_0x3246('0x40')]=[{'all':!![]}];}_0x47a74b=_[_0x3246('0x3e')]({},_0x47a74b,_0x55488a[_0x3246('0x44')]);return db['CannedAnswer'][_0x3246('0x45')](_0x47a74b)['then'](handleEntityNotFound(_0x22c8f0,null))[_0x3246('0x22')](respondWithResult(_0x22c8f0,null))['catch'](handleError(_0x22c8f0,null));};exports['update']=function(_0x2a5115,_0x5ec183){if(_0x2a5115[_0x3246('0x46')]['id']){delete _0x2a5115[_0x3246('0x46')]['id'];}return db[_0x3246('0x2d')][_0x3246('0x45')]({'where':{'id':_0x2a5115['params']['id']}})[_0x3246('0x22')](handleEntityNotFound(_0x5ec183,null))[_0x3246('0x22')](saveUpdates(_0x2a5115[_0x3246('0x46')],null))[_0x3246('0x22')](respondWithResult(_0x5ec183,null))[_0x3246('0x43')](handleError(_0x5ec183,null));};exports[_0x3246('0x23')]=function(_0x20c3b4,_0x36d689){return db[_0x3246('0x2d')]['find']({'where':{'id':_0x20c3b4[_0x3246('0x47')]['id']}})[_0x3246('0x22')](handleEntityNotFound(_0x36d689,null))['then'](removeEntity(_0x36d689,null))[_0x3246('0x43')](handleError(_0x36d689,null));};exports[_0x3246('0x48')]=function(_0x3d695f,_0x481ccf){var _0x54df5c={'key':_0x3d695f[_0x3246('0x46')]['key']};if(_0x3d695f[_0x3246('0x46')][_0x3246('0x49')]){_0x54df5c[_0x3246('0x49')]=_0x3d695f[_0x3246('0x46')]['MailAccountId'];}else if(_0x3d695f[_0x3246('0x46')][_0x3246('0x4a')]){_0x54df5c[_0x3246('0x4a')]=_0x3d695f['body'][_0x3246('0x4a')];}else if(_0x3d695f[_0x3246('0x46')][_0x3246('0x4b')]){_0x54df5c[_0x3246('0x4b')]=_0x3d695f[_0x3246('0x46')][_0x3246('0x4b')];}else if(_0x3d695f['body'][_0x3246('0x4c')]){_0x54df5c[_0x3246('0x4c')]=_0x3d695f['body'][_0x3246('0x4c')];}return db['CannedAnswer']['find']({'where':_0x54df5c})[_0x3246('0x22')](function(_0x3b0d89){if(_0x3b0d89){throw new db[(_0x3246('0x4d'))][(_0x3246('0x4e'))](_0x3246('0x4f'));}return db[_0x3246('0x2d')][_0x3246('0x48')](_0x3d695f[_0x3246('0x46')]);})['then'](function(_0x2a70c5){var _0x2defb1=_0x3d695f[_0x3246('0x50')][_0x3246('0x24')]({'plain':!![]});if(!_0x2defb1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2defb1[_0x3246('0x51')]===_0x3246('0x50')){var _0x31c2fa=_0x2a70c5[_0x3246('0x24')]({'plain':!![]});return db[_0x3246('0x52')][_0x3246('0x45')]({'where':{'name':_0x3246('0x53'),'userProfileId':_0x2defb1['userProfileId']},'raw':!![]})[_0x3246('0x22')](function(_0x17f342){if(_0x17f342&&_0x17f342[_0x3246('0x54')]===0x0){return db[_0x3246('0x25')][_0x3246('0x48')]({'name':_0x31c2fa[_0x3246('0x29')],'resourceId':_0x31c2fa['id'],'type':_0x17f342['name'],'sectionId':_0x17f342['id']},{})['then'](function(){return _0x2a70c5;});}else{return _0x2a70c5;}})[_0x3246('0x43')](function(_0x5c58b1){logger['error'](_0x3246('0x55'),_0x5c58b1);throw _0x5c58b1;});}return _0x2a70c5;})['then'](respondWithResult(_0x481ccf,0xc9))[_0x3246('0x43')](handleError(_0x481ccf,null));}; \ No newline at end of file +var _0xe601=['offset','apply','reject','save','update','then','destroy','get','sendStatus','name','index','map','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','include','findAll','show','params','options','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','UserProfileSection','CannedAnswers','userProfileId','UserProfileResource','error','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count'];(function(_0x46fcc4,_0x3170b1){var _0x564b70=function(_0x330191){while(--_0x330191){_0x46fcc4['push'](_0x46fcc4['shift']());}};_0x564b70(++_0x3170b1);}(_0xe601,0xd5));var _0x1e60=function(_0x3715a3,_0x28c18d){_0x3715a3=_0x3715a3-0x0;var _0x2cc886=_0xe601[_0x3715a3];return _0x2cc886;};'use strict';var emlformat=require(_0x1e60('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1e60('0x1'));var moment=require(_0x1e60('0x2'));var BPromise=require(_0x1e60('0x3'));var Mustache=require(_0x1e60('0x4'));var util=require(_0x1e60('0x5'));var path=require(_0x1e60('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1e60('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e60('0x8'));var jsforce=require(_0x1e60('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1e60('0xa'));var querystring=require(_0x1e60('0xb'));var Papa=require(_0x1e60('0xc'));var Redis=require(_0x1e60('0xd'));var authService=require(_0x1e60('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1e60('0xf'));var hardwareService=require(_0x1e60('0x10'));var logger=require('../../config/logger')(_0x1e60('0x11'));var utils=require('../../config/utils');var config=require(_0x1e60('0x12'));var licenseUtil=require(_0x1e60('0x13'));var db=require(_0x1e60('0x14'))['db'];function respondWithStatusCode(_0x722d36,_0x45d276){_0x45d276=_0x45d276||0xcc;return function(_0x507978){if(_0x507978){return _0x722d36['sendStatus'](_0x45d276);}return _0x722d36[_0x1e60('0x15')](_0x45d276)[_0x1e60('0x16')]();};}function respondWithResult(_0x17291f,_0xcd078){_0xcd078=_0xcd078||0xc8;return function(_0x3c1dd2){if(_0x3c1dd2){return _0x17291f[_0x1e60('0x15')](_0xcd078)[_0x1e60('0x17')](_0x3c1dd2);}};}function respondWithFilteredResult(_0x47a0c7,_0x213ba8){return function(_0x5c1393){if(_0x5c1393){var _0x271be7=typeof _0x213ba8['offset']===_0x1e60('0x18')&&typeof _0x213ba8[_0x1e60('0x19')]===_0x1e60('0x18');var _0x43b407=_0x5c1393[_0x1e60('0x1a')];var _0x1134f7=_0x271be7?0x0:_0x213ba8[_0x1e60('0x1b')];var _0x59b48c=_0x271be7?_0x5c1393[_0x1e60('0x1a')]:_0x213ba8[_0x1e60('0x1b')]+_0x213ba8[_0x1e60('0x19')];var _0xa8ba1b;if(_0x59b48c>=_0x43b407){_0x59b48c=_0x43b407;_0xa8ba1b=0xc8;}else{_0xa8ba1b=0xce;}_0x47a0c7[_0x1e60('0x15')](_0xa8ba1b);return _0x47a0c7['set']('Content-Range',_0x1134f7+'-'+_0x59b48c+'/'+_0x43b407)[_0x1e60('0x17')](_0x5c1393);}return null;};}function patchUpdates(_0x347b94){return function(_0x5aa2ae){try{jsonpatch[_0x1e60('0x1c')](_0x5aa2ae,_0x347b94,!![]);}catch(_0x1715cd){return BPromise[_0x1e60('0x1d')](_0x1715cd);}return _0x5aa2ae[_0x1e60('0x1e')]();};}function saveUpdates(_0x39141e,_0x44f665){return function(_0x13709d){if(_0x13709d){return _0x13709d[_0x1e60('0x1f')](_0x39141e)[_0x1e60('0x20')](function(_0x1783df){return _0x1783df;});}return null;};}function removeEntity(_0x555722,_0x718902){return function(_0x37241e){if(_0x37241e){return _0x37241e[_0x1e60('0x21')]()[_0x1e60('0x20')](function(){var _0x5a02ce=_0x37241e[_0x1e60('0x22')]({'plain':!![]});var _0x376c9a='CannedAnswers';return db['UserProfileResource'][_0x1e60('0x21')]({'where':{'type':_0x376c9a,'resourceId':_0x5a02ce['id']}})[_0x1e60('0x20')](function(){return _0x37241e;});})['then'](function(){_0x555722['status'](0xcc)[_0x1e60('0x16')]();});}};}function handleEntityNotFound(_0x2d1732,_0x3f6955){return function(_0x2e50e9){if(!_0x2e50e9){_0x2d1732[_0x1e60('0x23')](0x194);}return _0x2e50e9;};}function handleError(_0x340952,_0x2e099e){_0x2e099e=_0x2e099e||0x1f4;return function(_0x269af9){logger['error'](_0x269af9['stack']);if(_0x269af9[_0x1e60('0x24')]){delete _0x269af9[_0x1e60('0x24')];}_0x340952[_0x1e60('0x15')](_0x2e099e)['send'](_0x269af9);};}exports[_0x1e60('0x25')]=function(_0x501930,_0x44bb7d){var _0x304b60={},_0x509145={},_0x7b4e17={'count':0x0,'rows':[]};var _0x333b60=_[_0x1e60('0x26')](db[_0x1e60('0x27')][_0x1e60('0x28')],function(_0x184a8e){return{'name':_0x184a8e['fieldName'],'type':_0x184a8e[_0x1e60('0x29')][_0x1e60('0x2a')]};});_0x509145[_0x1e60('0x2b')]=_['map'](_0x333b60,_0x1e60('0x24'));_0x509145['query']=_[_0x1e60('0x2c')](_0x501930[_0x1e60('0x2d')]);_0x509145[_0x1e60('0x2e')]=_[_0x1e60('0x2f')](_0x509145[_0x1e60('0x2b')],_0x509145['query']);_0x304b60[_0x1e60('0x30')]=_['intersection'](_0x509145[_0x1e60('0x2b')],qs[_0x1e60('0x31')](_0x501930['query'][_0x1e60('0x31')]));_0x304b60[_0x1e60('0x30')]=_0x304b60[_0x1e60('0x30')][_0x1e60('0x32')]?_0x304b60[_0x1e60('0x30')]:_0x509145['model'];if(!_0x501930[_0x1e60('0x2d')][_0x1e60('0x33')](_0x1e60('0x34'))){_0x304b60[_0x1e60('0x19')]=qs['limit'](_0x501930[_0x1e60('0x2d')][_0x1e60('0x19')]);_0x304b60[_0x1e60('0x1b')]=qs[_0x1e60('0x1b')](_0x501930[_0x1e60('0x2d')][_0x1e60('0x1b')]);}_0x304b60[_0x1e60('0x35')]=qs['sort'](_0x501930[_0x1e60('0x2d')][_0x1e60('0x36')]);_0x304b60['where']=qs[_0x1e60('0x2e')](_['pick'](_0x501930[_0x1e60('0x2d')],_0x509145[_0x1e60('0x2e')]),_0x333b60);if(_0x501930['query']['filter']){_0x304b60[_0x1e60('0x37')]=_[_0x1e60('0x38')](_0x304b60['where'],{'$or':[{'key':{'$like':'%'+_0x501930[_0x1e60('0x2d')][_0x1e60('0x39')]+'%'}},{'value':{'$like':'%'+_0x501930[_0x1e60('0x2d')][_0x1e60('0x39')]+'%'}}]});}_0x304b60=_[_0x1e60('0x38')]({},_0x304b60,_0x501930['options']);var _0x44b477={'where':_0x304b60[_0x1e60('0x37')]};return db['CannedAnswer'][_0x1e60('0x1a')](_0x44b477)['then'](function(_0x43fd46){_0x7b4e17[_0x1e60('0x1a')]=_0x43fd46;if(_0x501930['query'][_0x1e60('0x3a')]){_0x304b60[_0x1e60('0x3b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1e60('0x3c')](_0x304b60);})[_0x1e60('0x20')](function(_0x49339a){_0x7b4e17['rows']=_0x49339a;return _0x7b4e17;})[_0x1e60('0x20')](respondWithFilteredResult(_0x44bb7d,_0x304b60))['catch'](handleError(_0x44bb7d,null));};exports[_0x1e60('0x3d')]=function(_0x5a1171,_0x235d8a){var _0x5ba803={'raw':!![],'where':{'id':_0x5a1171[_0x1e60('0x3e')]['id']}},_0x4e4c86={};_0x4e4c86['model']=_['keys'](db[_0x1e60('0x27')]['rawAttributes']);_0x4e4c86[_0x1e60('0x2d')]=_[_0x1e60('0x2c')](_0x5a1171[_0x1e60('0x2d')]);_0x4e4c86[_0x1e60('0x2e')]=_['intersection'](_0x4e4c86[_0x1e60('0x2b')],_0x4e4c86[_0x1e60('0x2d')]);_0x5ba803[_0x1e60('0x30')]=_['intersection'](_0x4e4c86[_0x1e60('0x2b')],qs[_0x1e60('0x31')](_0x5a1171[_0x1e60('0x2d')][_0x1e60('0x31')]));_0x5ba803[_0x1e60('0x30')]=_0x5ba803[_0x1e60('0x30')][_0x1e60('0x32')]?_0x5ba803[_0x1e60('0x30')]:_0x4e4c86[_0x1e60('0x2b')];if(_0x5a1171[_0x1e60('0x2d')][_0x1e60('0x3a')]){_0x5ba803['include']=[{'all':!![]}];}_0x5ba803=_[_0x1e60('0x38')]({},_0x5ba803,_0x5a1171[_0x1e60('0x3f')]);return db[_0x1e60('0x27')][_0x1e60('0x40')](_0x5ba803)[_0x1e60('0x20')](handleEntityNotFound(_0x235d8a,null))['then'](respondWithResult(_0x235d8a,null))[_0x1e60('0x41')](handleError(_0x235d8a,null));};exports['update']=function(_0x3e0035,_0x483f37){if(_0x3e0035[_0x1e60('0x42')]['id']){delete _0x3e0035['body']['id'];}return db[_0x1e60('0x27')][_0x1e60('0x40')]({'where':{'id':_0x3e0035[_0x1e60('0x3e')]['id']}})['then'](handleEntityNotFound(_0x483f37,null))[_0x1e60('0x20')](saveUpdates(_0x3e0035['body'],null))[_0x1e60('0x20')](respondWithResult(_0x483f37,null))[_0x1e60('0x41')](handleError(_0x483f37,null));};exports[_0x1e60('0x21')]=function(_0x19dc61,_0x594f75){return db[_0x1e60('0x27')][_0x1e60('0x40')]({'where':{'id':_0x19dc61[_0x1e60('0x3e')]['id']}})[_0x1e60('0x20')](handleEntityNotFound(_0x594f75,null))[_0x1e60('0x20')](removeEntity(_0x594f75,null))[_0x1e60('0x41')](handleError(_0x594f75,null));};exports[_0x1e60('0x43')]=function(_0x471548,_0xed3537){var _0x25c518={'key':_0x471548[_0x1e60('0x42')][_0x1e60('0x2a')]};if(_0x471548[_0x1e60('0x42')]['MailAccountId']){_0x25c518[_0x1e60('0x44')]=_0x471548[_0x1e60('0x42')][_0x1e60('0x44')];}else if(_0x471548['body'][_0x1e60('0x45')]){_0x25c518[_0x1e60('0x45')]=_0x471548[_0x1e60('0x42')][_0x1e60('0x45')];}else if(_0x471548[_0x1e60('0x42')][_0x1e60('0x46')]){_0x25c518[_0x1e60('0x46')]=_0x471548[_0x1e60('0x42')][_0x1e60('0x46')];}else if(_0x471548['body']['ChatWebsiteId']){_0x25c518[_0x1e60('0x47')]=_0x471548[_0x1e60('0x42')][_0x1e60('0x47')];}return db[_0x1e60('0x27')][_0x1e60('0x40')]({'where':_0x25c518})[_0x1e60('0x20')](function(_0x6e45a6){if(_0x6e45a6){throw new db[(_0x1e60('0x48'))][(_0x1e60('0x49'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x1e60('0x27')][_0x1e60('0x43')](_0x471548[_0x1e60('0x42')]);})['then'](function(_0x3a2658){var _0xdef4be=_0x471548[_0x1e60('0x4a')][_0x1e60('0x22')]({'plain':!![]});if(!_0xdef4be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdef4be['role']===_0x1e60('0x4a')){var _0x27a128=_0x3a2658[_0x1e60('0x22')]({'plain':!![]});return db[_0x1e60('0x4b')][_0x1e60('0x40')]({'where':{'name':_0x1e60('0x4c'),'userProfileId':_0xdef4be[_0x1e60('0x4d')]},'raw':!![]})[_0x1e60('0x20')](function(_0x4e75d4){if(_0x4e75d4&&_0x4e75d4['autoAssociation']===0x0){return db[_0x1e60('0x4e')][_0x1e60('0x43')]({'name':_0x27a128[_0x1e60('0x24')],'resourceId':_0x27a128['id'],'type':_0x4e75d4[_0x1e60('0x24')],'sectionId':_0x4e75d4['id']},{})[_0x1e60('0x20')](function(){return _0x3a2658;});}else{return _0x3a2658;}})['catch'](function(_0x56e155){logger[_0x1e60('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56e155);throw _0x56e155;});}return _0x3a2658;})[_0x1e60('0x20')](respondWithResult(_0xed3537,0xc9))[_0x1e60('0x41')](handleError(_0xed3537,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 85e1cf2..5c12dc6 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 _0x67da=['bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x1727a6,_0x23f49c){var _0x10788c=function(_0x53e0cd){while(--_0x53e0cd){_0x1727a6['push'](_0x1727a6['shift']());}};_0x10788c(++_0x23f49c);}(_0x67da,0x192));var _0xa67d=function(_0x12ba3a,_0x3fc25c){_0x12ba3a=_0x12ba3a-0x0;var _0x39b770=_0x67da[_0x12ba3a];return _0x39b770;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var logger=require(_0xa67d('0x1'))(_0xa67d('0x2'));var moment=require(_0xa67d('0x3'));var BPromise=require(_0xa67d('0x4'));var rp=require(_0xa67d('0x5'));var fs=require('fs');var path=require(_0xa67d('0x6'));var rimraf=require(_0xa67d('0x7'));var config=require(_0xa67d('0x8'));var attributes=require(_0xa67d('0x9'));module['exports']=function(_0x5b8ec7,_0x408786){return _0x5b8ec7['define'](_0xa67d('0xa'),attributes,{'tableName':_0xa67d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa67d('0xc'),'collate':_0xa67d('0xd')});}; \ No newline at end of file +var _0x418f=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','tools_canned_answers'];(function(_0x1780d6,_0x2fac42){var _0x463634=function(_0x5bf6d9){while(--_0x5bf6d9){_0x1780d6['push'](_0x1780d6['shift']());}};_0x463634(++_0x2fac42);}(_0x418f,0xdf));var _0xf418=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0x418f[_0x4aba15];return _0x1c8122;};'use strict';var _=require(_0xf418('0x0'));var util=require(_0xf418('0x1'));var logger=require(_0xf418('0x2'))(_0xf418('0x3'));var moment=require(_0xf418('0x4'));var BPromise=require('bluebird');var rp=require(_0xf418('0x5'));var fs=require('fs');var path=require(_0xf418('0x6'));var rimraf=require(_0xf418('0x7'));var config=require(_0xf418('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0xf418('0x9')]=function(_0x535456,_0x544059){return _0x535456['define']('CannedAnswer',attributes,{'tableName':_0xf418('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf418('0xb'),'collate':_0xf418('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 8c2947f..e835ed7 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 _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x334791,_0x5f250e){var _0x371e07=function(_0x2c3b6e){while(--_0x2c3b6e){_0x334791['push'](_0x334791['shift']());}};_0x371e07(++_0x5f250e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x21b7c0,_0xc5bdd5){var _0x2df891=function(_0x1bc8f2){while(--_0x1bc8f2){_0x21b7c0['push'](_0x21b7c0['shift']());}};_0x2df891(++_0xc5bdd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index f24b277..2f9ad38 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 _0x873b=['show','update','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated'];(function(_0x49eecc,_0x51998d){var _0x515a40=function(_0x14c375){while(--_0x14c375){_0x49eecc['push'](_0x49eecc['shift']());}};_0x515a40(++_0x51998d);}(_0x873b,0x8b));var _0xb873=function(_0x161ec6,_0x580285){_0x161ec6=_0x161ec6-0x0;var _0x477176=_0x873b[_0x161ec6];return _0x477176;};'use strict';var multer=require(_0xb873('0x0'));var util=require('util');var path=require(_0xb873('0x1'));var timeout=require('connect-timeout');var express=require(_0xb873('0x2'));var router=express['Router']();var fs_extra=require(_0xb873('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb873('0x4'));var config=require(_0xb873('0x5'));var controller=require(_0xb873('0x6'));router[_0xb873('0x7')]('/',auth['isAuthenticated'](),controller[_0xb873('0x8')]);router[_0xb873('0x7')](_0xb873('0x9'),auth[_0xb873('0xa')](),controller[_0xb873('0xb')]);router['post']('/',auth[_0xb873('0xa')](),controller['create']);router['put']('/:id',auth[_0xb873('0xa')](),controller[_0xb873('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb873('0xd')]);module[_0xb873('0xe')]=router; \ No newline at end of file +var _0x3049=['/:id','show','post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0x3049,0xcc));var _0x9304=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3049[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x9304('0x0'));var util=require(_0x9304('0x1'));var path=require(_0x9304('0x2'));var timeout=require(_0x9304('0x3'));var express=require(_0x9304('0x4'));var router=express[_0x9304('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9304('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9304('0x7'));var controller=require(_0x9304('0x8'));router['get']('/',auth[_0x9304('0x9')](),controller[_0x9304('0xa')]);router[_0x9304('0xb')](_0x9304('0xc'),auth[_0x9304('0x9')](),controller[_0x9304('0xd')]);router[_0x9304('0xe')]('/',auth[_0x9304('0x9')](),controller[_0x9304('0xf')]);router[_0x9304('0x10')](_0x9304('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9304('0xc'),auth[_0x9304('0x9')](),controller['destroy']);module[_0x9304('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index c135293..a087ac5 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 _0x634d=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x634d,0x120));var _0xd634=function(_0x57e6b5,_0x3abc13){_0x57e6b5=_0x57e6b5-0x0;var _0x455206=_0x634d[_0x57e6b5];return _0x455206;};'use strict';var Sequelize=require(_0xd634('0x0'));module[_0xd634('0x1')]={'calldate':{'type':Sequelize[_0xd634('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xd634('0x3')]},'dcontext':{'type':Sequelize[_0xd634('0x3')]},'channel':{'type':Sequelize[_0xd634('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd634('0x3')]},'lastdata':{'type':Sequelize[_0xd634('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd634('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd634('0x3')]},'amaflags':{'type':Sequelize[_0xd634('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd634('0x3')]},'userfield':{'type':Sequelize[_0xd634('0x3')]},'uniqueid':{'type':Sequelize[_0xd634('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd634('0x3')]},'peeraccount':{'type':Sequelize[_0xd634('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xd634('0x3')]}}; \ No newline at end of file +var _0x69e6=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2656a4,_0x28dd1b){var _0x48ce85=function(_0x41d957){while(--_0x41d957){_0x2656a4['push'](_0x2656a4['shift']());}};_0x48ce85(++_0x28dd1b);}(_0x69e6,0x1e0));var _0x669e=function(_0x3152e8,_0x3d2089){_0x3152e8=_0x3152e8-0x0;var _0x35dad6=_0x69e6[_0x3152e8];return _0x35dad6;};'use strict';var Sequelize=require('sequelize');module[_0x669e('0x0')]={'calldate':{'type':Sequelize[_0x669e('0x1')],'allowNull':![],'defaultValue':_0x669e('0x2')},'clid':{'type':Sequelize[_0x669e('0x3')]},'src':{'type':Sequelize[_0x669e('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x669e('0x3')]},'channel':{'type':Sequelize[_0x669e('0x3')]},'dstchannel':{'type':Sequelize[_0x669e('0x3')]},'lastapp':{'type':Sequelize[_0x669e('0x3')]},'lastdata':{'type':Sequelize[_0x669e('0x3')]},'duration':{'type':Sequelize[_0x669e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x669e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x669e('0x3')]},'amaflags':{'type':Sequelize[_0x669e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x669e('0x3')]},'userfield':{'type':Sequelize[_0x669e('0x3')]},'uniqueid':{'type':Sequelize[_0x669e('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x669e('0x3')]},'peeraccount':{'type':Sequelize[_0x669e('0x3')]},'type':{'type':Sequelize[_0x669e('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 42f8e27..acf1449 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 _0x885a=['include','findAll','rows','show','params','rawAttributes','length','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','reject','save','update','then','error','stack','name','map','Cdr','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','count','includeAll'];(function(_0x483753,_0x243cc6){var _0x380839=function(_0x40e01b){while(--_0x40e01b){_0x483753['push'](_0x483753['shift']());}};_0x380839(++_0x243cc6);}(_0x885a,0x180));var _0xa885=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x885a[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa885('0x0'));var zipdir=require(_0xa885('0x1'));var jsonpatch=require(_0xa885('0x2'));var rp=require(_0xa885('0x3'));var moment=require('moment');var BPromise=require(_0xa885('0x4'));var Mustache=require(_0xa885('0x5'));var util=require(_0xa885('0x6'));var path=require(_0xa885('0x7'));var sox=require(_0xa885('0x8'));var csv=require(_0xa885('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa885('0xa'));var _=require(_0xa885('0xb'));var squel=require(_0xa885('0xc'));var crypto=require('crypto');var jsforce=require(_0xa885('0xd'));var deskjs=require(_0xa885('0xe'));var toCsv=require(_0xa885('0x9'));var querystring=require('querystring');var Papa=require(_0xa885('0xf'));var Redis=require(_0xa885('0x10'));var authService=require(_0xa885('0x11'));var qs=require(_0xa885('0x12'));var as=require(_0xa885('0x13'));var hardwareService=require(_0xa885('0x14'));var logger=require(_0xa885('0x15'))('api');var utils=require(_0xa885('0x16'));var config=require(_0xa885('0x17'));var licenseUtil=require(_0xa885('0x18'));var db=require(_0xa885('0x19'))['db'];function respondWithStatusCode(_0x412b2a,_0x3e9c7a){_0x3e9c7a=_0x3e9c7a||0xcc;return function(_0x4585d9){if(_0x4585d9){return _0x412b2a['sendStatus'](_0x3e9c7a);}return _0x412b2a[_0xa885('0x1a')](_0x3e9c7a)[_0xa885('0x1b')]();};}function respondWithResult(_0x27b24a,_0x12d81c){_0x12d81c=_0x12d81c||0xc8;return function(_0x33ce2e){if(_0x33ce2e){return _0x27b24a['status'](_0x12d81c)[_0xa885('0x1c')](_0x33ce2e);}};}function respondWithFilteredResult(_0x2ca5c5,_0x5296e6){return function(_0x14bff1){if(_0x14bff1){var _0x32fc86=typeof _0x5296e6['offset']===_0xa885('0x1d')&&typeof _0x5296e6[_0xa885('0x1e')]==='undefined';var _0x20a206=_0x14bff1['count'];var _0x2e9290=_0x32fc86?0x0:_0x5296e6[_0xa885('0x1f')];var _0x8c26c=_0x32fc86?_0x14bff1['count']:_0x5296e6[_0xa885('0x1f')]+_0x5296e6['limit'];var _0x127a86;if(_0x8c26c>=_0x20a206){_0x8c26c=_0x20a206;_0x127a86=0xc8;}else{_0x127a86=0xce;}_0x2ca5c5[_0xa885('0x1a')](_0x127a86);return _0x2ca5c5[_0xa885('0x20')]('Content-Range',_0x2e9290+'-'+_0x8c26c+'/'+_0x20a206)[_0xa885('0x1c')](_0x14bff1);}return null;};}function patchUpdates(_0x32b8df){return function(_0x1530b6){try{jsonpatch['apply'](_0x1530b6,_0x32b8df,!![]);}catch(_0x273988){return BPromise[_0xa885('0x21')](_0x273988);}return _0x1530b6[_0xa885('0x22')]();};}function saveUpdates(_0x4ad909,_0x303830){return function(_0x582b59){if(_0x582b59){return _0x582b59[_0xa885('0x23')](_0x4ad909)[_0xa885('0x24')](function(_0x5d2b43){return _0x5d2b43;});}return null;};}function removeEntity(_0x1d94c1,_0x190a57){return function(_0x21c98c){if(_0x21c98c){return _0x21c98c['destroy']()[_0xa885('0x24')](function(){_0x1d94c1[_0xa885('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ae58,_0x47daee){return function(_0x15ff4d){if(!_0x15ff4d){_0x39ae58['sendStatus'](0x194);}return _0x15ff4d;};}function handleError(_0x1a28d6,_0x110e63){_0x110e63=_0x110e63||0x1f4;return function(_0x3e347e){logger[_0xa885('0x25')](_0x3e347e[_0xa885('0x26')]);if(_0x3e347e[_0xa885('0x27')]){delete _0x3e347e[_0xa885('0x27')];}_0x1a28d6[_0xa885('0x1a')](_0x110e63)['send'](_0x3e347e);};}exports['index']=function(_0x5c4ca7,_0x4fc438){var _0x1c94ab={},_0x3e9e22={},_0x3af5d9={'count':0x0,'rows':[]};var _0x17c0eb=_[_0xa885('0x28')](db[_0xa885('0x29')]['rawAttributes'],function(_0x40d982){return{'name':_0x40d982['fieldName'],'type':_0x40d982[_0xa885('0x2a')]['key']};});_0x3e9e22[_0xa885('0x2b')]=_['map'](_0x17c0eb,_0xa885('0x27'));_0x3e9e22[_0xa885('0x2c')]=_[_0xa885('0x2d')](_0x5c4ca7['query']);_0x3e9e22[_0xa885('0x2e')]=_[_0xa885('0x2f')](_0x3e9e22['model'],_0x3e9e22[_0xa885('0x2c')]);_0x1c94ab['attributes']=_[_0xa885('0x2f')](_0x3e9e22[_0xa885('0x2b')],qs[_0xa885('0x30')](_0x5c4ca7['query'][_0xa885('0x30')]));_0x1c94ab[_0xa885('0x31')]=_0x1c94ab[_0xa885('0x31')]['length']?_0x1c94ab[_0xa885('0x31')]:_0x3e9e22[_0xa885('0x2b')];if(!_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x32')](_0xa885('0x33'))){_0x1c94ab[_0xa885('0x1e')]=qs[_0xa885('0x1e')](_0x5c4ca7[_0xa885('0x2c')]['limit']);_0x1c94ab['offset']=qs[_0xa885('0x1f')](_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x1f')]);}_0x1c94ab[_0xa885('0x34')]=qs[_0xa885('0x35')](_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x35')]);_0x1c94ab[_0xa885('0x36')]=qs[_0xa885('0x2e')](_['pick'](_0x5c4ca7['query'],_0x3e9e22[_0xa885('0x2e')]),_0x17c0eb);if(_0x5c4ca7['query']['filter']){_0x1c94ab[_0xa885('0x36')]=_['merge'](_0x1c94ab[_0xa885('0x36')],{'$or':_[_0xa885('0x28')](_0x17c0eb,function(_0x39503d){if(_0x39503d[_0xa885('0x2a')]!==_0xa885('0x37')){var _0xc35213={};_0xc35213[_0x39503d[_0xa885('0x27')]]={'$like':'%'+_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x38')]+'%'};return _0xc35213;}})});}_0x1c94ab=_[_0xa885('0x39')]({},_0x1c94ab,_0x5c4ca7['options']);var _0x30759d={'where':_0x1c94ab[_0xa885('0x36')]};return db[_0xa885('0x29')][_0xa885('0x3a')](_0x30759d)[_0xa885('0x24')](function(_0x5e327f){_0x3af5d9['count']=_0x5e327f;if(_0x5c4ca7[_0xa885('0x2c')][_0xa885('0x3b')]){_0x1c94ab[_0xa885('0x3c')]=[{'all':!![]}];}return db[_0xa885('0x29')][_0xa885('0x3d')](_0x1c94ab);})['then'](function(_0x1f2a71){_0x3af5d9[_0xa885('0x3e')]=_0x1f2a71;return _0x3af5d9;})['then'](respondWithFilteredResult(_0x4fc438,_0x1c94ab))['catch'](handleError(_0x4fc438,null));};exports[_0xa885('0x3f')]=function(_0x299baf,_0x4da64c){var _0x561bf0={'raw':!![],'where':{'id':_0x299baf[_0xa885('0x40')]['id']}},_0x1089e5={};_0x1089e5[_0xa885('0x2b')]=_[_0xa885('0x2d')](db[_0xa885('0x29')][_0xa885('0x41')]);_0x1089e5[_0xa885('0x2c')]=_[_0xa885('0x2d')](_0x299baf[_0xa885('0x2c')]);_0x1089e5[_0xa885('0x2e')]=_[_0xa885('0x2f')](_0x1089e5['model'],_0x1089e5[_0xa885('0x2c')]);_0x561bf0[_0xa885('0x31')]=_[_0xa885('0x2f')](_0x1089e5['model'],qs[_0xa885('0x30')](_0x299baf[_0xa885('0x2c')][_0xa885('0x30')]));_0x561bf0[_0xa885('0x31')]=_0x561bf0['attributes'][_0xa885('0x42')]?_0x561bf0['attributes']:_0x1089e5[_0xa885('0x2b')];if(_0x299baf[_0xa885('0x2c')]['includeAll']){_0x561bf0[_0xa885('0x3c')]=[{'all':!![]}];}_0x561bf0=_[_0xa885('0x39')]({},_0x561bf0,_0x299baf[_0xa885('0x43')]);return db[_0xa885('0x29')][_0xa885('0x44')](_0x561bf0)['then'](handleEntityNotFound(_0x4da64c,null))[_0xa885('0x24')](respondWithResult(_0x4da64c,null))[_0xa885('0x45')](handleError(_0x4da64c,null));};exports[_0xa885('0x46')]=function(_0x51f4df,_0x4d146e){return db['Cdr'][_0xa885('0x46')](_0x51f4df[_0xa885('0x47')],{})[_0xa885('0x24')](respondWithResult(_0x4d146e,0xc9))[_0xa885('0x45')](handleError(_0x4d146e,null));};exports[_0xa885('0x23')]=function(_0x49aa9b,_0x43245c){if(_0x49aa9b[_0xa885('0x47')]['id']){delete _0x49aa9b[_0xa885('0x47')]['id'];}return db[_0xa885('0x29')][_0xa885('0x44')]({'where':{'id':_0x49aa9b['params']['id']}})['then'](handleEntityNotFound(_0x43245c,null))['then'](saveUpdates(_0x49aa9b[_0xa885('0x47')],null))[_0xa885('0x24')](respondWithResult(_0x43245c,null))[_0xa885('0x45')](handleError(_0x43245c,null));};exports[_0xa885('0x48')]=function(_0x164d9d,_0x66a035){return db[_0xa885('0x29')]['find']({'where':{'id':_0x164d9d[_0xa885('0x40')]['id']}})[_0xa885('0x24')](handleEntityNotFound(_0x66a035,null))[_0xa885('0x24')](removeEntity(_0x66a035,null))[_0xa885('0x45')](handleError(_0x66a035,null));};exports[_0xa885('0x49')]=function(_0x1bd3a2,_0x159d12){return db['Cdr'][_0xa885('0x49')]()[_0xa885('0x24')](respondWithResult(_0x159d12,null))[_0xa885('0x45')](handleError(_0x159d12,null));}; \ No newline at end of file +var _0x0bde=['end','json','offset','undefined','count','set','Content-Range','reject','save','then','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options','Cdr','include','findAll','rows','catch','params','length','includeAll','merge','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5cf17d,_0x16d5dd){var _0x53efb0=function(_0x559aaf){while(--_0x559aaf){_0x5cf17d['push'](_0x5cf17d['shift']());}};_0x53efb0(++_0x16d5dd);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe0bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0bd('0x1'));var jsonpatch=require(_0xe0bd('0x2'));var rp=require('request-promise');var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require(_0xe0bd('0xd'));var jsforce=require(_0xe0bd('0xe'));var deskjs=require(_0xe0bd('0xf'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0x10'));var Papa=require(_0xe0bd('0x11'));var Redis=require('ioredis');var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0bd('0x14'));var logger=require('../../config/logger')(_0xe0bd('0x15'));var utils=require(_0xe0bd('0x16'));var config=require(_0xe0bd('0x17'));var licenseUtil=require(_0xe0bd('0x18'));var db=require(_0xe0bd('0x19'))['db'];function respondWithStatusCode(_0x16c3a9,_0x1905b2){_0x1905b2=_0x1905b2||0xcc;return function(_0x500a9e){if(_0x500a9e){return _0x16c3a9[_0xe0bd('0x1a')](_0x1905b2);}return _0x16c3a9[_0xe0bd('0x1b')](_0x1905b2)[_0xe0bd('0x1c')]();};}function respondWithResult(_0x5c76f1,_0x479438){_0x479438=_0x479438||0xc8;return function(_0x48afde){if(_0x48afde){return _0x5c76f1[_0xe0bd('0x1b')](_0x479438)[_0xe0bd('0x1d')](_0x48afde);}};}function respondWithFilteredResult(_0x3f5ef7,_0x3042e1){return function(_0x361429){if(_0x361429){var _0x302f5f=typeof _0x3042e1[_0xe0bd('0x1e')]===_0xe0bd('0x1f')&&typeof _0x3042e1['limit']==='undefined';var _0x2d2ba3=_0x361429[_0xe0bd('0x20')];var _0x1c4533=_0x302f5f?0x0:_0x3042e1[_0xe0bd('0x1e')];var _0xa6be32=_0x302f5f?_0x361429[_0xe0bd('0x20')]:_0x3042e1['offset']+_0x3042e1['limit'];var _0x29bd21;if(_0xa6be32>=_0x2d2ba3){_0xa6be32=_0x2d2ba3;_0x29bd21=0xc8;}else{_0x29bd21=0xce;}_0x3f5ef7[_0xe0bd('0x1b')](_0x29bd21);return _0x3f5ef7[_0xe0bd('0x21')](_0xe0bd('0x22'),_0x1c4533+'-'+_0xa6be32+'/'+_0x2d2ba3)[_0xe0bd('0x1d')](_0x361429);}return null;};}function patchUpdates(_0x154480){return function(_0x3dbd98){try{jsonpatch['apply'](_0x3dbd98,_0x154480,!![]);}catch(_0x5ad8bf){return BPromise[_0xe0bd('0x23')](_0x5ad8bf);}return _0x3dbd98[_0xe0bd('0x24')]();};}function saveUpdates(_0x3927ab,_0xdcb789){return function(_0x290c1e){if(_0x290c1e){return _0x290c1e['update'](_0x3927ab)[_0xe0bd('0x25')](function(_0x4795ac){return _0x4795ac;});}return null;};}function removeEntity(_0x242cbe,_0x296f64){return function(_0x3f24b6){if(_0x3f24b6){return _0x3f24b6['destroy']()[_0xe0bd('0x25')](function(){_0x242cbe[_0xe0bd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ca10,_0x5e6496){return function(_0x2debcb){if(!_0x2debcb){_0x41ca10['sendStatus'](0x194);}return _0x2debcb;};}function handleError(_0x198a1c,_0x72e284){_0x72e284=_0x72e284||0x1f4;return function(_0x3c851d){logger['error'](_0x3c851d[_0xe0bd('0x26')]);if(_0x3c851d['name']){delete _0x3c851d[_0xe0bd('0x27')];}_0x198a1c[_0xe0bd('0x1b')](_0x72e284)['send'](_0x3c851d);};}exports['index']=function(_0x273b95,_0x3789a1){var _0x441475={},_0x23a317={},_0x2d7f2f={'count':0x0,'rows':[]};var _0x17e614=_[_0xe0bd('0x28')](db['Cdr'][_0xe0bd('0x29')],function(_0x137206){return{'name':_0x137206[_0xe0bd('0x2a')],'type':_0x137206[_0xe0bd('0x2b')][_0xe0bd('0x2c')]};});_0x23a317[_0xe0bd('0x2d')]=_['map'](_0x17e614,_0xe0bd('0x27'));_0x23a317[_0xe0bd('0x2e')]=_[_0xe0bd('0x2f')](_0x273b95[_0xe0bd('0x2e')]);_0x23a317[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x23a317[_0xe0bd('0x2d')],_0x23a317[_0xe0bd('0x2e')]);_0x441475['attributes']=_['intersection'](_0x23a317[_0xe0bd('0x2d')],qs[_0xe0bd('0x32')](_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x32')]));_0x441475[_0xe0bd('0x33')]=_0x441475['attributes']['length']?_0x441475['attributes']:_0x23a317[_0xe0bd('0x2d')];if(!_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x34')](_0xe0bd('0x35'))){_0x441475[_0xe0bd('0x36')]=qs[_0xe0bd('0x36')](_0x273b95['query'][_0xe0bd('0x36')]);_0x441475[_0xe0bd('0x1e')]=qs[_0xe0bd('0x1e')](_0x273b95['query'][_0xe0bd('0x1e')]);}_0x441475[_0xe0bd('0x37')]=qs['sort'](_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x38')]);_0x441475[_0xe0bd('0x39')]=qs['filters'](_[_0xe0bd('0x3a')](_0x273b95['query'],_0x23a317[_0xe0bd('0x30')]),_0x17e614);if(_0x273b95[_0xe0bd('0x2e')][_0xe0bd('0x3b')]){_0x441475[_0xe0bd('0x39')]=_['merge'](_0x441475[_0xe0bd('0x39')],{'$or':_[_0xe0bd('0x28')](_0x17e614,function(_0x7f9272){if(_0x7f9272['type']!=='VIRTUAL'){var _0x23064a={};_0x23064a[_0x7f9272[_0xe0bd('0x27')]]={'$like':'%'+_0x273b95[_0xe0bd('0x2e')]['filter']+'%'};return _0x23064a;}})});}_0x441475=_['merge']({},_0x441475,_0x273b95[_0xe0bd('0x3c')]);var _0x383b08={'where':_0x441475[_0xe0bd('0x39')]};return db[_0xe0bd('0x3d')]['count'](_0x383b08)[_0xe0bd('0x25')](function(_0x23b596){_0x2d7f2f[_0xe0bd('0x20')]=_0x23b596;if(_0x273b95['query']['includeAll']){_0x441475[_0xe0bd('0x3e')]=[{'all':!![]}];}return db[_0xe0bd('0x3d')][_0xe0bd('0x3f')](_0x441475);})[_0xe0bd('0x25')](function(_0x5ada76){_0x2d7f2f[_0xe0bd('0x40')]=_0x5ada76;return _0x2d7f2f;})[_0xe0bd('0x25')](respondWithFilteredResult(_0x3789a1,_0x441475))[_0xe0bd('0x41')](handleError(_0x3789a1,null));};exports['show']=function(_0x499e16,_0x27a582){var _0x52a0af={'raw':!![],'where':{'id':_0x499e16[_0xe0bd('0x42')]['id']}},_0x24be53={};_0x24be53['model']=_[_0xe0bd('0x2f')](db[_0xe0bd('0x3d')][_0xe0bd('0x29')]);_0x24be53['query']=_[_0xe0bd('0x2f')](_0x499e16[_0xe0bd('0x2e')]);_0x24be53[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x24be53[_0xe0bd('0x2d')],_0x24be53[_0xe0bd('0x2e')]);_0x52a0af[_0xe0bd('0x33')]=_[_0xe0bd('0x31')](_0x24be53['model'],qs[_0xe0bd('0x32')](_0x499e16[_0xe0bd('0x2e')][_0xe0bd('0x32')]));_0x52a0af[_0xe0bd('0x33')]=_0x52a0af[_0xe0bd('0x33')][_0xe0bd('0x43')]?_0x52a0af[_0xe0bd('0x33')]:_0x24be53[_0xe0bd('0x2d')];if(_0x499e16['query'][_0xe0bd('0x44')]){_0x52a0af[_0xe0bd('0x3e')]=[{'all':!![]}];}_0x52a0af=_[_0xe0bd('0x45')]({},_0x52a0af,_0x499e16[_0xe0bd('0x3c')]);return db[_0xe0bd('0x3d')]['find'](_0x52a0af)[_0xe0bd('0x25')](handleEntityNotFound(_0x27a582,null))['then'](respondWithResult(_0x27a582,null))['catch'](handleError(_0x27a582,null));};exports['create']=function(_0x2d7e00,_0x55dd83){return db['Cdr'][_0xe0bd('0x46')](_0x2d7e00[_0xe0bd('0x47')],{})[_0xe0bd('0x25')](respondWithResult(_0x55dd83,0xc9))[_0xe0bd('0x41')](handleError(_0x55dd83,null));};exports[_0xe0bd('0x48')]=function(_0x220147,_0xe2b989){if(_0x220147[_0xe0bd('0x47')]['id']){delete _0x220147[_0xe0bd('0x47')]['id'];}return db[_0xe0bd('0x3d')]['find']({'where':{'id':_0x220147[_0xe0bd('0x42')]['id']}})['then'](handleEntityNotFound(_0xe2b989,null))['then'](saveUpdates(_0x220147[_0xe0bd('0x47')],null))[_0xe0bd('0x25')](respondWithResult(_0xe2b989,null))[_0xe0bd('0x41')](handleError(_0xe2b989,null));};exports['destroy']=function(_0x281a60,_0x3fe076){return db[_0xe0bd('0x3d')][_0xe0bd('0x49')]({'where':{'id':_0x281a60[_0xe0bd('0x42')]['id']}})[_0xe0bd('0x25')](handleEntityNotFound(_0x3fe076,null))[_0xe0bd('0x25')](removeEntity(_0x3fe076,null))[_0xe0bd('0x41')](handleError(_0x3fe076,null));};exports[_0xe0bd('0x4a')]=function(_0x1f85ef,_0x29c7f8){return db[_0xe0bd('0x3d')]['describe']()[_0xe0bd('0x25')](respondWithResult(_0x29c7f8,null))[_0xe0bd('0x41')](handleError(_0x29c7f8,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7516161..1a0b22e 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x6bdee2,_0x5caba1){var _0x2a2cff=function(_0x131e5d){while(--_0x131e5d){_0x6bdee2['push'](_0x6bdee2['shift']());}};_0x2a2cff(++_0x5caba1);}(_0x7a54,0x106));var _0x47a5=function(_0x3c713b,_0x137b8a){_0x3c713b=_0x3c713b-0x0;var _0x42f2d8=_0x7a54[_0x3c713b];return _0x42f2d8;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1d9ef2,_0x53bd86){var _0x1610ae=function(_0x236a1f){while(--_0x236a1f){_0x1d9ef2['push'](_0x1d9ef2['shift']());}};_0x1610ae(++_0x53bd86);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1d06,_0x3c1d88){_0x5e1d06=_0x5e1d06-0x0;var _0x4ce180=_0x7a54[_0x5e1d06];return _0x4ce180;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 102a105..4a2cf91 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 _0x7afa=['../../config/logger','rpc','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x109946,_0x3494b7){var _0x4ed20b=function(_0x578aa4){while(--_0x578aa4){_0x109946['push'](_0x109946['shift']());}};_0x4ed20b(++_0x3494b7);}(_0x7afa,0x8d));var _0xa7af=function(_0x1d4491,_0x501c68){_0x1d4491=_0x1d4491-0x0;var _0x41f100=_0x7afa[_0x1d4491];return _0x41f100;};'use strict';var _=require('lodash');var util=require(_0xa7af('0x0'));var moment=require(_0xa7af('0x1'));var BPromise=require('bluebird');var rs=require(_0xa7af('0x2'));var fs=require('fs');var Redis=require(_0xa7af('0x3'));var db=require(_0xa7af('0x4'))['db'];var utils=require(_0xa7af('0x5'));var logger=require(_0xa7af('0x6'))(_0xa7af('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa7af('0x8')][_0xa7af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445f75,_0x1c6049,_0x36d68f){return new BPromise(function(_0x367122,_0x3f6da2){return client[_0xa7af('0xa')](_0x445f75,_0x36d68f)[_0xa7af('0xb')](function(_0x5bf19b){logger['info'](_0xa7af('0xc'),_0x1c6049,_0xa7af('0xd'));logger[_0xa7af('0xe')](_0xa7af('0xf'),_0x1c6049,_0xa7af('0xd'),JSON[_0xa7af('0x10')](_0x5bf19b));if(_0x5bf19b['error']){if(_0x5bf19b[_0xa7af('0x11')][_0xa7af('0x12')]===0x1f4){logger['error'](_0xa7af('0xc'),_0x1c6049,_0x5bf19b['error'][_0xa7af('0x13')]);return _0x3f6da2(_0x5bf19b['error']['message']);}logger['error'](_0xa7af('0xc'),_0x1c6049,_0x5bf19b[_0xa7af('0x11')][_0xa7af('0x13')]);return _0x367122(_0x5bf19b[_0xa7af('0x11')][_0xa7af('0x13')]);}else{logger[_0xa7af('0x14')](_0xa7af('0xc'),_0x1c6049,_0xa7af('0xd'));_0x367122(_0x5bf19b['result'][_0xa7af('0x13')]);}})['catch'](function(_0x3ce899){logger[_0xa7af('0x11')](_0xa7af('0xc'),_0x1c6049,_0x3ce899);_0x3f6da2(_0x3ce899);});});} \ No newline at end of file +var _0xbc09=['Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5515c1,_0xfcf523){var _0x4ea4cc=function(_0x1016f8){while(--_0x1016f8){_0x5515c1['push'](_0x5515c1['shift']());}};_0x4ea4cc(++_0xfcf523);}(_0xbc09,0x1d5));var _0x9bc0=function(_0x51b779,_0x1f28b3){_0x51b779=_0x51b779-0x0;var _0x3899f4=_0xbc09[_0x51b779];return _0x3899f4;};'use strict';var _=require(_0x9bc0('0x0'));var util=require(_0x9bc0('0x1'));var moment=require(_0x9bc0('0x2'));var BPromise=require(_0x9bc0('0x3'));var rs=require(_0x9bc0('0x4'));var fs=require('fs');var Redis=require(_0x9bc0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9bc0('0x6'))(_0x9bc0('0x7'));var config=require(_0x9bc0('0x8'));var jayson=require(_0x9bc0('0x9'));var client=jayson[_0x9bc0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec9cc,_0x395f56,_0x3d1bb8){return new BPromise(function(_0x4b56f0,_0x3c1aa4){return client[_0x9bc0('0xb')](_0x5ec9cc,_0x3d1bb8)[_0x9bc0('0xc')](function(_0x45d5c8){logger[_0x9bc0('0xd')](_0x9bc0('0xe'),_0x395f56,'request\x20sent');logger[_0x9bc0('0xf')](_0x9bc0('0x10'),_0x395f56,_0x9bc0('0x11'),JSON[_0x9bc0('0x12')](_0x45d5c8));if(_0x45d5c8[_0x9bc0('0x13')]){if(_0x45d5c8['error'][_0x9bc0('0x14')]===0x1f4){logger[_0x9bc0('0x13')]('Cdr,\x20%s,\x20%s',_0x395f56,_0x45d5c8[_0x9bc0('0x13')][_0x9bc0('0x15')]);return _0x3c1aa4(_0x45d5c8[_0x9bc0('0x13')][_0x9bc0('0x15')]);}logger[_0x9bc0('0x13')](_0x9bc0('0xe'),_0x395f56,_0x45d5c8[_0x9bc0('0x13')]['message']);return _0x4b56f0(_0x45d5c8[_0x9bc0('0x13')][_0x9bc0('0x15')]);}else{logger[_0x9bc0('0xd')](_0x9bc0('0xe'),_0x395f56,_0x9bc0('0x11'));_0x4b56f0(_0x45d5c8['result']['message']);}})[_0x9bc0('0x16')](function(_0x8af69){logger[_0x9bc0('0x13')](_0x9bc0('0xe'),_0x395f56,_0x8af69);_0x3c1aa4(_0x8af69);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 618b593..00a31ce 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5b4e3f,_0x347f17){var _0x19b8aa=function(_0x3a10c9){while(--_0x3a10c9){_0x5b4e3f['push'](_0x5b4e3f['shift']());}};_0x19b8aa(++_0x347f17);}(_0xb10b,0x12a));var _0xbb10=function(_0x1feefe,_0x2018ad){_0x1feefe=_0x1feefe-0x0;var _0x56471a=_0xb10b[_0x1feefe];return _0x56471a;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 109fdb2..d2d2f96 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 _0xf9d7=['TEXT','sequelize','exports','STRING','noop'];(function(_0xc6b7e4,_0x58baf0){var _0x1aaff5=function(_0x16ef4d){while(--_0x16ef4d){_0xc6b7e4['push'](_0xc6b7e4['shift']());}};_0x1aaff5(++_0x58baf0);}(_0xf9d7,0x164));var _0x7f9d=function(_0x34ecbf,_0x210898){_0x34ecbf=_0x34ecbf-0x0;var _0x115f8a=_0xf9d7[_0x34ecbf];return _0x115f8a;};'use strict';var Sequelize=require(_0x7f9d('0x0'));module[_0x7f9d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7f9d('0x2')],'allowNull':![],'defaultValue':_0x7f9d('0x3')},'appdata':{'type':Sequelize[_0x7f9d('0x4')]()},'description':{'type':Sequelize[_0x7f9d('0x2')]},'interval':{'type':Sequelize[_0x7f9d('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x570b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x570b,0x159));var _0xb570=function(_0x4f37ab,_0x137060){_0x4f37ab=_0x4f37ab-0x0;var _0x198d33=_0x570b[_0x4f37ab];return _0x198d33;};'use strict';var Sequelize=require(_0xb570('0x0'));module[_0xb570('0x1')]={'priority':{'type':Sequelize[_0xb570('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb570('0x3')],'allowNull':![],'defaultValue':_0xb570('0x4')},'appdata':{'type':Sequelize[_0xb570('0x5')]()},'description':{'type':Sequelize[_0xb570('0x3')]},'interval':{'type':Sequelize[_0xb570('0x3')],'defaultValue':_0xb570('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 4c1bf92..ac19da7 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 _0x9993=['set','apply','reject','save','update','then','sendStatus','error','stack','name','send','show','params','model','query','keys','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count'];(function(_0x5e9c8b,_0x93e2a3){var _0x129ad=function(_0x3471fc){while(--_0x3471fc){_0x5e9c8b['push'](_0x5e9c8b['shift']());}};_0x129ad(++_0x93e2a3);}(_0x9993,0x109));var _0x3999=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x9993[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0x3999('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3999('0x1'));var jsonpatch=require(_0x3999('0x2'));var rp=require(_0x3999('0x3'));var moment=require('moment');var BPromise=require(_0x3999('0x4'));var Mustache=require('mustache');var util=require(_0x3999('0x5'));var path=require(_0x3999('0x6'));var sox=require(_0x3999('0x7'));var csv=require('to-csv');var ejs=require(_0x3999('0x8'));var fs=require('fs');var fs_extra=require(_0x3999('0x9'));var _=require('lodash');var squel=require(_0x3999('0xa'));var crypto=require(_0x3999('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3999('0xc'));var toCsv=require(_0x3999('0xd'));var querystring=require('querystring');var Papa=require(_0x3999('0xe'));var Redis=require('ioredis');var authService=require(_0x3999('0xf'));var qs=require(_0x3999('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3999('0x11'));var logger=require(_0x3999('0x12'))(_0x3999('0x13'));var utils=require(_0x3999('0x14'));var config=require(_0x3999('0x15'));var licenseUtil=require(_0x3999('0x16'));var db=require(_0x3999('0x17'))['db'];function respondWithStatusCode(_0x52c26b,_0x7f35f5){_0x7f35f5=_0x7f35f5||0xcc;return function(_0x3e34e9){if(_0x3e34e9){return _0x52c26b['sendStatus'](_0x7f35f5);}return _0x52c26b[_0x3999('0x18')](_0x7f35f5)[_0x3999('0x19')]();};}function respondWithResult(_0x335b4b,_0x30ca58){_0x30ca58=_0x30ca58||0xc8;return function(_0x5a36b0){if(_0x5a36b0){return _0x335b4b[_0x3999('0x18')](_0x30ca58)['json'](_0x5a36b0);}};}function respondWithFilteredResult(_0x2072bf,_0x5803af){return function(_0x1756e7){if(_0x1756e7){var _0x56787c=typeof _0x5803af[_0x3999('0x1a')]===_0x3999('0x1b')&&typeof _0x5803af[_0x3999('0x1c')]===_0x3999('0x1b');var _0x51f56a=_0x1756e7['count'];var _0xdd19a=_0x56787c?0x0:_0x5803af[_0x3999('0x1a')];var _0x5705f6=_0x56787c?_0x1756e7[_0x3999('0x1d')]:_0x5803af[_0x3999('0x1a')]+_0x5803af['limit'];var _0x1afedd;if(_0x5705f6>=_0x51f56a){_0x5705f6=_0x51f56a;_0x1afedd=0xc8;}else{_0x1afedd=0xce;}_0x2072bf['status'](_0x1afedd);return _0x2072bf[_0x3999('0x1e')]('Content-Range',_0xdd19a+'-'+_0x5705f6+'/'+_0x51f56a)['json'](_0x1756e7);}return null;};}function patchUpdates(_0x5c414){return function(_0x3e4509){try{jsonpatch[_0x3999('0x1f')](_0x3e4509,_0x5c414,!![]);}catch(_0x367dd8){return BPromise[_0x3999('0x20')](_0x367dd8);}return _0x3e4509[_0x3999('0x21')]();};}function saveUpdates(_0x560c2d,_0xb7a29f){return function(_0x53ea75){if(_0x53ea75){return _0x53ea75[_0x3999('0x22')](_0x560c2d)[_0x3999('0x23')](function(_0xf34704){return _0xf34704;});}return null;};}function removeEntity(_0x39858b,_0xb17e81){return function(_0x553535){if(_0x553535){return _0x553535['destroy']()[_0x3999('0x23')](function(){_0x39858b[_0x3999('0x18')](0xcc)[_0x3999('0x19')]();});}};}function handleEntityNotFound(_0x11a394,_0xedc3db){return function(_0x5f3883){if(!_0x5f3883){_0x11a394[_0x3999('0x24')](0x194);}return _0x5f3883;};}function handleError(_0x2cfd2a,_0x2e0b94){_0x2e0b94=_0x2e0b94||0x1f4;return function(_0xe8ed9e){logger[_0x3999('0x25')](_0xe8ed9e[_0x3999('0x26')]);if(_0xe8ed9e[_0x3999('0x27')]){delete _0xe8ed9e[_0x3999('0x27')];}_0x2cfd2a['status'](_0x2e0b94)[_0x3999('0x28')](_0xe8ed9e);};}exports[_0x3999('0x29')]=function(_0x31d7c0,_0x404d3f){var _0xe22b0a={'raw':!![],'where':{'id':_0x31d7c0[_0x3999('0x2a')]['id']}},_0x5937ef={};_0x5937ef[_0x3999('0x2b')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x5937ef[_0x3999('0x2c')]=_[_0x3999('0x2d')](_0x31d7c0[_0x3999('0x2c')]);_0x5937ef[_0x3999('0x2e')]=_[_0x3999('0x2f')](_0x5937ef[_0x3999('0x2b')],_0x5937ef['query']);_0xe22b0a[_0x3999('0x30')]=_[_0x3999('0x2f')](_0x5937ef[_0x3999('0x2b')],qs[_0x3999('0x31')](_0x31d7c0[_0x3999('0x2c')][_0x3999('0x31')]));_0xe22b0a['attributes']=_0xe22b0a['attributes'][_0x3999('0x32')]?_0xe22b0a[_0x3999('0x30')]:_0x5937ef[_0x3999('0x2b')];if(_0x31d7c0['query']['includeAll']){_0xe22b0a[_0x3999('0x33')]=[{'all':!![]}];}_0xe22b0a=_[_0x3999('0x34')]({},_0xe22b0a,_0x31d7c0[_0x3999('0x35')]);return db[_0x3999('0x36')][_0x3999('0x37')](_0xe22b0a)[_0x3999('0x23')](handleEntityNotFound(_0x404d3f,null))[_0x3999('0x23')](respondWithResult(_0x404d3f,null))[_0x3999('0x38')](handleError(_0x404d3f,null));};exports[_0x3999('0x22')]=function(_0x257cb8,_0x31694c){if(_0x257cb8[_0x3999('0x39')]['id']){delete _0x257cb8['body']['id'];}return db['ChatApplication'][_0x3999('0x37')]({'where':{'id':_0x257cb8[_0x3999('0x2a')]['id']}})[_0x3999('0x23')](handleEntityNotFound(_0x31694c,null))[_0x3999('0x23')](saveUpdates(_0x257cb8[_0x3999('0x39')],null))['then'](respondWithResult(_0x31694c,null))[_0x3999('0x38')](handleError(_0x31694c,null));};exports[_0x3999('0x3a')]=function(_0x2204c1,_0x4d2e5c){return db[_0x3999('0x36')][_0x3999('0x37')]({'where':{'id':_0x2204c1[_0x3999('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4d2e5c,null))[_0x3999('0x23')](removeEntity(_0x4d2e5c,null))['catch'](handleError(_0x4d2e5c,null));}; \ No newline at end of file +var _0x6c50=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','filters','model','attributes','fields','length','query','includeAll','include','merge','catch','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6c50,0xa4));var _0x06c5=function(_0x31a2fa,_0x41f9f7){_0x31a2fa=_0x31a2fa-0x0;var _0x32c763=_0x6c50[_0x31a2fa];return _0x32c763;};'use strict';var emlformat=require(_0x06c5('0x0'));var rimraf=require(_0x06c5('0x1'));var zipdir=require(_0x06c5('0x2'));var jsonpatch=require(_0x06c5('0x3'));var rp=require('request-promise');var moment=require(_0x06c5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x06c5('0x5'));var util=require(_0x06c5('0x6'));var path=require(_0x06c5('0x7'));var sox=require(_0x06c5('0x8'));var csv=require(_0x06c5('0x9'));var ejs=require(_0x06c5('0xa'));var fs=require('fs');var fs_extra=require(_0x06c5('0xb'));var _=require(_0x06c5('0xc'));var squel=require(_0x06c5('0xd'));var crypto=require(_0x06c5('0xe'));var jsforce=require(_0x06c5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x06c5('0x9'));var querystring=require(_0x06c5('0x10'));var Papa=require(_0x06c5('0x11'));var Redis=require(_0x06c5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06c5('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x06c5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x06c5('0x15'))['db'];function respondWithStatusCode(_0x2d7502,_0x68194e){_0x68194e=_0x68194e||0xcc;return function(_0x4ce581){if(_0x4ce581){return _0x2d7502[_0x06c5('0x16')](_0x68194e);}return _0x2d7502[_0x06c5('0x17')](_0x68194e)[_0x06c5('0x18')]();};}function respondWithResult(_0x39e176,_0x5d456e){_0x5d456e=_0x5d456e||0xc8;return function(_0x4e8669){if(_0x4e8669){return _0x39e176[_0x06c5('0x17')](_0x5d456e)[_0x06c5('0x19')](_0x4e8669);}};}function respondWithFilteredResult(_0x13a8d4,_0x4eeeca){return function(_0x16c36e){if(_0x16c36e){var _0x117371=typeof _0x4eeeca['offset']===_0x06c5('0x1a')&&typeof _0x4eeeca[_0x06c5('0x1b')]===_0x06c5('0x1a');var _0xb48b48=_0x16c36e[_0x06c5('0x1c')];var _0x36b9e9=_0x117371?0x0:_0x4eeeca[_0x06c5('0x1d')];var _0x18a070=_0x117371?_0x16c36e[_0x06c5('0x1c')]:_0x4eeeca[_0x06c5('0x1d')]+_0x4eeeca[_0x06c5('0x1b')];var _0x46471b;if(_0x18a070>=_0xb48b48){_0x18a070=_0xb48b48;_0x46471b=0xc8;}else{_0x46471b=0xce;}_0x13a8d4[_0x06c5('0x17')](_0x46471b);return _0x13a8d4[_0x06c5('0x1e')](_0x06c5('0x1f'),_0x36b9e9+'-'+_0x18a070+'/'+_0xb48b48)[_0x06c5('0x19')](_0x16c36e);}return null;};}function patchUpdates(_0x26a653){return function(_0x4ba7e9){try{jsonpatch[_0x06c5('0x20')](_0x4ba7e9,_0x26a653,!![]);}catch(_0x3c2d52){return BPromise[_0x06c5('0x21')](_0x3c2d52);}return _0x4ba7e9[_0x06c5('0x22')]();};}function saveUpdates(_0xa3659b,_0x3c9e49){return function(_0x29db18){if(_0x29db18){return _0x29db18['update'](_0xa3659b)[_0x06c5('0x23')](function(_0x1b0cc7){return _0x1b0cc7;});}return null;};}function removeEntity(_0x414dda,_0x20ba9e){return function(_0x368e2f){if(_0x368e2f){return _0x368e2f[_0x06c5('0x24')]()[_0x06c5('0x23')](function(){_0x414dda['status'](0xcc)[_0x06c5('0x18')]();});}};}function handleEntityNotFound(_0x5aeb6c,_0x564f96){return function(_0x512dbc){if(!_0x512dbc){_0x5aeb6c['sendStatus'](0x194);}return _0x512dbc;};}function handleError(_0xa33539,_0x2f6a65){_0x2f6a65=_0x2f6a65||0x1f4;return function(_0x1067e1){logger[_0x06c5('0x25')](_0x1067e1[_0x06c5('0x26')]);if(_0x1067e1['name']){delete _0x1067e1[_0x06c5('0x27')];}_0xa33539[_0x06c5('0x17')](_0x2f6a65)[_0x06c5('0x28')](_0x1067e1);};}exports[_0x06c5('0x29')]=function(_0x2f8ac9,_0x4d4d04){var _0x38f6a7={'raw':!![],'where':{'id':_0x2f8ac9[_0x06c5('0x2a')]['id']}},_0x432de5={};_0x432de5['model']=_[_0x06c5('0x2b')](db[_0x06c5('0x2c')][_0x06c5('0x2d')]);_0x432de5['query']=_['keys'](_0x2f8ac9['query']);_0x432de5[_0x06c5('0x2e')]=_['intersection'](_0x432de5[_0x06c5('0x2f')],_0x432de5['query']);_0x38f6a7[_0x06c5('0x30')]=_['intersection'](_0x432de5[_0x06c5('0x2f')],qs['fields'](_0x2f8ac9['query'][_0x06c5('0x31')]));_0x38f6a7['attributes']=_0x38f6a7['attributes'][_0x06c5('0x32')]?_0x38f6a7[_0x06c5('0x30')]:_0x432de5[_0x06c5('0x2f')];if(_0x2f8ac9[_0x06c5('0x33')][_0x06c5('0x34')]){_0x38f6a7[_0x06c5('0x35')]=[{'all':!![]}];}_0x38f6a7=_[_0x06c5('0x36')]({},_0x38f6a7,_0x2f8ac9['options']);return db[_0x06c5('0x2c')]['find'](_0x38f6a7)['then'](handleEntityNotFound(_0x4d4d04,null))[_0x06c5('0x23')](respondWithResult(_0x4d4d04,null))[_0x06c5('0x37')](handleError(_0x4d4d04,null));};exports[_0x06c5('0x38')]=function(_0x31bd7f,_0x1e9d9f){if(_0x31bd7f[_0x06c5('0x39')]['id']){delete _0x31bd7f[_0x06c5('0x39')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x31bd7f[_0x06c5('0x2a')]['id']}})[_0x06c5('0x23')](handleEntityNotFound(_0x1e9d9f,null))['then'](saveUpdates(_0x31bd7f['body'],null))[_0x06c5('0x23')](respondWithResult(_0x1e9d9f,null))[_0x06c5('0x37')](handleError(_0x1e9d9f,null));};exports[_0x06c5('0x24')]=function(_0x503d3f,_0x44b651){return db[_0x06c5('0x2c')][_0x06c5('0x3a')]({'where':{'id':_0x503d3f['params']['id']}})[_0x06c5('0x23')](handleEntityNotFound(_0x44b651,null))[_0x06c5('0x23')](removeEntity(_0x44b651,null))['catch'](handleError(_0x44b651,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9b73480..dac261c 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 _0x275d=['../../config/environment','define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x13a2af,_0x24a9cb){var _0x453703=function(_0x5372af){while(--_0x5372af){_0x13a2af['push'](_0x13a2af['shift']());}};_0x453703(++_0x24a9cb);}(_0x275d,0x1a6));var _0xd275=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x275d[_0x836465];return _0x2150ea;};'use strict';var _=require(_0xd275('0x0'));var util=require(_0xd275('0x1'));var logger=require(_0xd275('0x2'))(_0xd275('0x3'));var moment=require(_0xd275('0x4'));var BPromise=require(_0xd275('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd275('0x6'));var rimraf=require('rimraf');var config=require(_0xd275('0x7'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x43f706,_0x556f47){return _0x43f706[_0xd275('0x8')](_0xd275('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd275('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2b51=['../../config/logger','api','moment','bluebird','path','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x2b51,0x1c5));var _0x12b5=function(_0x4d2753,_0x331d3b){_0x4d2753=_0x4d2753-0x0;var _0x8f4643=_0x2b51[_0x4d2753];return _0x8f4643;};'use strict';var _=require(_0x12b5('0x0'));var util=require(_0x12b5('0x1'));var logger=require(_0x12b5('0x2'))(_0x12b5('0x3'));var moment=require(_0x12b5('0x4'));var BPromise=require(_0x12b5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12b5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x12b5('0x7'));module[_0x12b5('0x8')]=function(_0x38a245,_0x3fa276){return _0x38a245[_0x12b5('0x9')](_0x12b5('0xa'),attributes,{'tableName':_0x12b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12b5('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f17bb25..e673aa5 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 _0xa693=['ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug'];(function(_0x4aba5e,_0x2b0e14){var _0xeea674=function(_0x2122fa){while(--_0x2122fa){_0x4aba5e['push'](_0x4aba5e['shift']());}};_0xeea674(++_0x2b0e14);}(_0xa693,0x177));var _0x3a69=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0xa693[_0x34b87f];return _0x449805;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var moment=require(_0x3a69('0x2'));var BPromise=require('bluebird');var rs=require(_0x3a69('0x3'));var fs=require('fs');var Redis=require(_0x3a69('0x4'));var db=require(_0x3a69('0x5'))['db'];var utils=require(_0x3a69('0x6'));var logger=require(_0x3a69('0x7'))('rpc');var config=require(_0x3a69('0x8'));var jayson=require(_0x3a69('0x9'));var client=jayson[_0x3a69('0xa')][_0x3a69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x416c0c,_0x28f4f2,_0x4ad7f2){return new BPromise(function(_0x159a2d,_0x3fa6a0){return client['request'](_0x416c0c,_0x4ad7f2)[_0x3a69('0xc')](function(_0x445fa5){logger[_0x3a69('0xd')](_0x3a69('0xe'),_0x28f4f2,'request\x20sent');logger[_0x3a69('0xf')](_0x3a69('0x10'),_0x28f4f2,_0x3a69('0x11'),JSON['stringify'](_0x445fa5));if(_0x445fa5[_0x3a69('0x12')]){if(_0x445fa5[_0x3a69('0x12')][_0x3a69('0x13')]===0x1f4){logger[_0x3a69('0x12')](_0x3a69('0xe'),_0x28f4f2,_0x445fa5['error'][_0x3a69('0x14')]);return _0x3fa6a0(_0x445fa5[_0x3a69('0x12')][_0x3a69('0x14')]);}logger[_0x3a69('0x12')](_0x3a69('0xe'),_0x28f4f2,_0x445fa5['error'][_0x3a69('0x14')]);return _0x159a2d(_0x445fa5[_0x3a69('0x12')]['message']);}else{logger[_0x3a69('0xd')]('ChatApplication,\x20%s,\x20%s',_0x28f4f2,_0x3a69('0x11'));_0x159a2d(_0x445fa5[_0x3a69('0x15')][_0x3a69('0x14')]);}})[_0x3a69('0x16')](function(_0x38474a){logger[_0x3a69('0x12')](_0x3a69('0xe'),_0x28f4f2,_0x38474a);_0x3fa6a0(_0x38474a);});});} \ No newline at end of file +var _0x73c3=['ChatApplication,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code'];(function(_0x558e45,_0x4f5e4f){var _0x3e9075=function(_0x289725){while(--_0x289725){_0x558e45['push'](_0x558e45['shift']());}};_0x3e9075(++_0x4f5e4f);}(_0x73c3,0x157));var _0x373c=function(_0x4222e3,_0x269e2e){_0x4222e3=_0x4222e3-0x0;var _0x1249c3=_0x73c3[_0x4222e3];return _0x1249c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x373c('0x0'));var BPromise=require(_0x373c('0x1'));var rs=require(_0x373c('0x2'));var fs=require('fs');var Redis=require(_0x373c('0x3'));var db=require(_0x373c('0x4'))['db'];var utils=require(_0x373c('0x5'));var logger=require(_0x373c('0x6'))('rpc');var config=require(_0x373c('0x7'));var jayson=require(_0x373c('0x8'));var client=jayson[_0x373c('0x9')][_0x373c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57dd78,_0x29fd3c,_0x537233){return new BPromise(function(_0x11c73e,_0x11de73){return client[_0x373c('0xb')](_0x57dd78,_0x537233)[_0x373c('0xc')](function(_0x20e314){logger['info']('ChatApplication,\x20%s,\x20%s',_0x29fd3c,_0x373c('0xd'));logger[_0x373c('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x29fd3c,'request\x20sent',JSON['stringify'](_0x20e314));if(_0x20e314[_0x373c('0xf')]){if(_0x20e314[_0x373c('0xf')][_0x373c('0x10')]===0x1f4){logger[_0x373c('0xf')](_0x373c('0x11'),_0x29fd3c,_0x20e314['error']['message']);return _0x11de73(_0x20e314[_0x373c('0xf')][_0x373c('0x12')]);}logger[_0x373c('0xf')]('ChatApplication,\x20%s,\x20%s',_0x29fd3c,_0x20e314[_0x373c('0xf')]['message']);return _0x11c73e(_0x20e314[_0x373c('0xf')]['message']);}else{logger['info'](_0x373c('0x11'),_0x29fd3c,_0x373c('0xd'));_0x11c73e(_0x20e314['result'][_0x373c('0x12')]);}})[_0x373c('0x13')](function(_0x3f765a){logger['error'](_0x373c('0x11'),_0x29fd3c,_0x3f765a);_0x11de73(_0x3f765a);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index beeb00c..89137c3 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 _0xa5da=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5ea0c7,_0x4896b6){var _0x1d32a2=function(_0x163902){while(--_0x163902){_0x5ea0c7['push'](_0x5ea0c7['shift']());}};_0x1d32a2(++_0x4896b6);}(_0xa5da,0x149));var _0xaa5d=function(_0x238a91,_0x3b006d){_0x238a91=_0x238a91-0x0;var _0x270f30=_0xa5da[_0x238a91];return _0x270f30;};'use strict';var multer=require(_0xaa5d('0x0'));var util=require(_0xaa5d('0x1'));var path=require(_0xaa5d('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa5d('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5d('0x4'));var auth=require(_0xaa5d('0x5'));var interaction=require(_0xaa5d('0x6'));var config=require(_0xaa5d('0x7'));var controller=require(_0xaa5d('0x8'));router[_0xaa5d('0x9')](_0xaa5d('0xa'),auth[_0xaa5d('0xb')](),controller[_0xaa5d('0xc')]);router[_0xaa5d('0xd')]('/:id',auth[_0xaa5d('0xb')](),controller['update']);router['delete'](_0xaa5d('0xa'),auth[_0xaa5d('0xb')](),controller[_0xaa5d('0xe')]);module[_0xaa5d('0xf')]=router; \ No newline at end of file +var _0xfa75=['../../config/environment','./chatApplication.controller','get','isAuthenticated','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5dd4c9,_0x5ddabd){var _0x27e0b5=function(_0x37056e){while(--_0x37056e){_0x5dd4c9['push'](_0x5dd4c9['shift']());}};_0x27e0b5(++_0x5ddabd);}(_0xfa75,0x98));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5fa7('0x0'));var util=require(_0x5fa7('0x1'));var path=require(_0x5fa7('0x2'));var timeout=require(_0x5fa7('0x3'));var express=require(_0x5fa7('0x4'));var router=express[_0x5fa7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5fa7('0x6'));var interaction=require(_0x5fa7('0x7'));var config=require(_0x5fa7('0x8'));var controller=require(_0x5fa7('0x9'));router[_0x5fa7('0xa')]('/:id',auth[_0x5fa7('0xb')](),controller['show']);router['put'](_0x5fa7('0xc'),auth['isAuthenticated'](),controller[_0x5fa7('0xd')]);router['delete'](_0x5fa7('0xc'),auth[_0x5fa7('0xb')](),controller[_0x5fa7('0xe')]);module[_0x5fa7('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index b31b05d..1ff5d26 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 _0x8a62=['sequelize','STRING','BOOLEAN'];(function(_0x53d9a7,_0x44c4a3){var _0x1c8958=function(_0x597d99){while(--_0x597d99){_0x53d9a7['push'](_0x53d9a7['shift']());}};_0x1c8958(++_0x44c4a3);}(_0x8a62,0x18f));var _0x28a6=function(_0x308b7b,_0x467c20){_0x308b7b=_0x308b7b-0x0;var _0x1ef9dc=_0x8a62[_0x308b7b];return _0x1ef9dc;};'use strict';var Sequelize=require(_0x28a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x28a6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x28a6('0x1')]},'write':{'type':Sequelize[_0x28a6('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd9a5=['BOOLEAN','sequelize','exports','STRING'];(function(_0x47da0c,_0x35e485){var _0x121316=function(_0x1f4599){while(--_0x1f4599){_0x47da0c['push'](_0x47da0c['shift']());}};_0x121316(++_0x35e485);}(_0xd9a5,0x135));var _0x5d9a=function(_0x39eaa6,_0x360b97){_0x39eaa6=_0x39eaa6-0x0;var _0xdeae9b=_0xd9a5[_0x39eaa6];return _0xdeae9b;};'use strict';var Sequelize=require(_0x5d9a('0x0'));module[_0x5d9a('0x1')]={'name':{'type':Sequelize[_0x5d9a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5d9a('0x2')]},'write':{'type':Sequelize[_0x5d9a('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 3fcee96..b80e117 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 _0xed09=['then','destroy','error','stack','name','send','index','ChatGroup','fieldName','type','map','keys','query','filters','intersection','attributes','fields','model','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','length','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','options','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','rawAttributes','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x5eb581,_0x2efdc2){var _0x523691=function(_0x53720c){while(--_0x53720c){_0x5eb581['push'](_0x5eb581['shift']());}};_0x523691(++_0x2efdc2);}(_0xed09,0x1ad));var _0x9ed0=function(_0x395a89,_0xd62b36){_0x395a89=_0x395a89-0x0;var _0x447f82=_0xed09[_0x395a89];return _0x447f82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ed0('0x0'));var zipdir=require(_0x9ed0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ed0('0x2'));var moment=require('moment');var BPromise=require(_0x9ed0('0x3'));var Mustache=require(_0x9ed0('0x4'));var util=require('util');var path=require(_0x9ed0('0x5'));var sox=require(_0x9ed0('0x6'));var csv=require(_0x9ed0('0x7'));var ejs=require(_0x9ed0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ed0('0x9'));var squel=require(_0x9ed0('0xa'));var crypto=require(_0x9ed0('0xb'));var jsforce=require(_0x9ed0('0xc'));var deskjs=require(_0x9ed0('0xd'));var toCsv=require(_0x9ed0('0x7'));var querystring=require('querystring');var Papa=require(_0x9ed0('0xe'));var Redis=require(_0x9ed0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9ed0('0x10'));var as=require(_0x9ed0('0x11'));var hardwareService=require(_0x9ed0('0x12'));var logger=require(_0x9ed0('0x13'))(_0x9ed0('0x14'));var utils=require(_0x9ed0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9ed0('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9ed0('0x17')](config[_0x9ed0('0x18')],{'host':_0x9ed0('0x19'),'port':0x18eb});var socket=require(_0x9ed0('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0xbe85fe,_0x4febac){_0x4febac=_0x4febac||0xcc;return function(_0x4d38c6){if(_0x4d38c6){return _0xbe85fe[_0x9ed0('0x1b')](_0x4febac);}return _0xbe85fe['status'](_0x4febac)[_0x9ed0('0x1c')]();};}function respondWithResult(_0x1b0cf4,_0x5cddff){_0x5cddff=_0x5cddff||0xc8;return function(_0x13e653){if(_0x13e653){return _0x1b0cf4[_0x9ed0('0x1d')](_0x5cddff)[_0x9ed0('0x1e')](_0x13e653);}};}function respondWithFilteredResult(_0x5c3b67,_0x3eef49){return function(_0x33cf38){if(_0x33cf38){var _0x556c3b=typeof _0x3eef49[_0x9ed0('0x1f')]===_0x9ed0('0x20')&&typeof _0x3eef49['limit']==='undefined';var _0x5af91d=_0x33cf38[_0x9ed0('0x21')];var _0x36bb11=_0x556c3b?0x0:_0x3eef49[_0x9ed0('0x1f')];var _0x4b57d2=_0x556c3b?_0x33cf38[_0x9ed0('0x21')]:_0x3eef49[_0x9ed0('0x1f')]+_0x3eef49[_0x9ed0('0x22')];var _0x3e711c;if(_0x4b57d2>=_0x5af91d){_0x4b57d2=_0x5af91d;_0x3e711c=0xc8;}else{_0x3e711c=0xce;}_0x5c3b67[_0x9ed0('0x1d')](_0x3e711c);return _0x5c3b67[_0x9ed0('0x23')](_0x9ed0('0x24'),_0x36bb11+'-'+_0x4b57d2+'/'+_0x5af91d)['json'](_0x33cf38);}return null;};}function patchUpdates(_0xe493a8){return function(_0x4c277d){try{jsonpatch[_0x9ed0('0x25')](_0x4c277d,_0xe493a8,!![]);}catch(_0x65d9fc){return BPromise[_0x9ed0('0x26')](_0x65d9fc);}return _0x4c277d[_0x9ed0('0x27')]();};}function saveUpdates(_0x4f9d2c,_0x2fa41a){return function(_0x4a6cf6){if(_0x4a6cf6){return _0x4a6cf6[_0x9ed0('0x28')](_0x4f9d2c)[_0x9ed0('0x29')](function(_0x466bae){return _0x466bae;});}return null;};}function removeEntity(_0x4409d0,_0x417823){return function(_0x4dccfc){if(_0x4dccfc){return _0x4dccfc[_0x9ed0('0x2a')]()[_0x9ed0('0x29')](function(){_0x4409d0[_0x9ed0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ba86,_0x149979){return function(_0x2f3796){if(!_0x2f3796){_0x32ba86['sendStatus'](0x194);}return _0x2f3796;};}function handleError(_0x5dfa2d,_0x180721){_0x180721=_0x180721||0x1f4;return function(_0x16e9d9){logger[_0x9ed0('0x2b')](_0x16e9d9[_0x9ed0('0x2c')]);if(_0x16e9d9[_0x9ed0('0x2d')]){delete _0x16e9d9['name'];}_0x5dfa2d[_0x9ed0('0x1d')](_0x180721)[_0x9ed0('0x2e')](_0x16e9d9);};}exports[_0x9ed0('0x2f')]=function(_0x4f99ff,_0x29516a){var _0x166b07={},_0x2528f4={},_0x52b897={'count':0x0,'rows':[]};var _0x2a6084=_['map'](db[_0x9ed0('0x30')]['rawAttributes'],function(_0x641753){return{'name':_0x641753[_0x9ed0('0x31')],'type':_0x641753[_0x9ed0('0x32')]['key']};});_0x2528f4['model']=_[_0x9ed0('0x33')](_0x2a6084,_0x9ed0('0x2d'));_0x2528f4['query']=_[_0x9ed0('0x34')](_0x4f99ff[_0x9ed0('0x35')]);_0x2528f4[_0x9ed0('0x36')]=_[_0x9ed0('0x37')](_0x2528f4['model'],_0x2528f4[_0x9ed0('0x35')]);_0x166b07[_0x9ed0('0x38')]=_[_0x9ed0('0x37')](_0x2528f4['model'],qs[_0x9ed0('0x39')](_0x4f99ff[_0x9ed0('0x35')][_0x9ed0('0x39')]));_0x166b07[_0x9ed0('0x38')]=_0x166b07[_0x9ed0('0x38')]['length']?_0x166b07[_0x9ed0('0x38')]:_0x2528f4[_0x9ed0('0x3a')];if(!_0x4f99ff['query']['hasOwnProperty'](_0x9ed0('0x3b'))){_0x166b07[_0x9ed0('0x22')]=qs[_0x9ed0('0x22')](_0x4f99ff[_0x9ed0('0x35')]['limit']);_0x166b07[_0x9ed0('0x1f')]=qs['offset'](_0x4f99ff['query']['offset']);}_0x166b07[_0x9ed0('0x3c')]=qs['sort'](_0x4f99ff[_0x9ed0('0x35')][_0x9ed0('0x3d')]);_0x166b07[_0x9ed0('0x3e')]=qs[_0x9ed0('0x36')](_[_0x9ed0('0x3f')](_0x4f99ff[_0x9ed0('0x35')],_0x2528f4[_0x9ed0('0x36')]),_0x2a6084);if(_0x4f99ff[_0x9ed0('0x35')][_0x9ed0('0x40')]){_0x166b07['where']=_[_0x9ed0('0x41')](_0x166b07['where'],{'$or':_[_0x9ed0('0x33')](_0x2a6084,function(_0x2f3665){if(_0x2f3665[_0x9ed0('0x32')]!==_0x9ed0('0x42')){var _0x585a3e={};_0x585a3e[_0x2f3665[_0x9ed0('0x2d')]]={'$like':'%'+_0x4f99ff[_0x9ed0('0x35')][_0x9ed0('0x40')]+'%'};return _0x585a3e;}})});}_0x166b07=_[_0x9ed0('0x41')]({},_0x166b07,_0x4f99ff['options']);var _0xfe2f54={'where':_0x166b07[_0x9ed0('0x3e')]};return db[_0x9ed0('0x30')][_0x9ed0('0x21')](_0xfe2f54)[_0x9ed0('0x29')](function(_0x5151a6){_0x52b897['count']=_0x5151a6;if(_0x4f99ff['query'][_0x9ed0('0x43')]){_0x166b07[_0x9ed0('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x9ed0('0x45')](_0x166b07);})[_0x9ed0('0x29')](function(_0x103bb3){_0x52b897['rows']=_0x103bb3;return _0x52b897;})[_0x9ed0('0x29')](respondWithFilteredResult(_0x29516a,_0x166b07))[_0x9ed0('0x46')](handleError(_0x29516a,null));};exports['show']=function(_0x4c68af,_0xe26956){var _0x4020da={'raw':!![],'where':{'id':_0x4c68af[_0x9ed0('0x47')]['id']}},_0xc08bf1={};_0xc08bf1[_0x9ed0('0x3a')]=_['keys'](db['ChatGroup']['rawAttributes']);_0xc08bf1[_0x9ed0('0x35')]=_['keys'](_0x4c68af[_0x9ed0('0x35')]);_0xc08bf1[_0x9ed0('0x36')]=_[_0x9ed0('0x37')](_0xc08bf1['model'],_0xc08bf1[_0x9ed0('0x35')]);_0x4020da[_0x9ed0('0x38')]=_[_0x9ed0('0x37')](_0xc08bf1[_0x9ed0('0x3a')],qs[_0x9ed0('0x39')](_0x4c68af[_0x9ed0('0x35')]['fields']));_0x4020da[_0x9ed0('0x38')]=_0x4020da[_0x9ed0('0x38')][_0x9ed0('0x48')]?_0x4020da[_0x9ed0('0x38')]:_0xc08bf1[_0x9ed0('0x3a')];if(_0x4c68af[_0x9ed0('0x35')][_0x9ed0('0x43')]){_0x4020da[_0x9ed0('0x44')]=[{'all':!![]}];}_0x4020da=_[_0x9ed0('0x41')]({},_0x4020da,_0x4c68af['options']);return db[_0x9ed0('0x30')]['find'](_0x4020da)[_0x9ed0('0x29')](handleEntityNotFound(_0xe26956,null))[_0x9ed0('0x29')](respondWithResult(_0xe26956,null))[_0x9ed0('0x46')](handleError(_0xe26956,null));};exports['create']=function(_0x133c04,_0x421ad3){return db[_0x9ed0('0x30')][_0x9ed0('0x49')](_0x133c04[_0x9ed0('0x4a')],{})[_0x9ed0('0x29')](respondWithResult(_0x421ad3,0xc9))[_0x9ed0('0x46')](handleError(_0x421ad3,null));};exports[_0x9ed0('0x28')]=function(_0x75874e,_0x8ecf3a){if(_0x75874e[_0x9ed0('0x4a')]['id']){delete _0x75874e[_0x9ed0('0x4a')]['id'];}return db[_0x9ed0('0x30')][_0x9ed0('0x4b')]({'where':{'id':_0x75874e[_0x9ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x8ecf3a,null))[_0x9ed0('0x29')](saveUpdates(_0x75874e[_0x9ed0('0x4a')],null))[_0x9ed0('0x29')](respondWithResult(_0x8ecf3a,null))[_0x9ed0('0x46')](handleError(_0x8ecf3a,null));};exports[_0x9ed0('0x2a')]=function(_0x4f02ea,_0x510c2f){return db[_0x9ed0('0x30')]['find']({'where':{'id':_0x4f02ea['params']['id']}})['then'](handleEntityNotFound(_0x510c2f,null))[_0x9ed0('0x29')](removeEntity(_0x510c2f,null))[_0x9ed0('0x46')](handleError(_0x510c2f,null));};exports[_0x9ed0('0x4c')]=function(_0x3c76f5,_0x3b84f1){return db[_0x9ed0('0x30')][_0x9ed0('0x4c')]()['then'](respondWithResult(_0x3b84f1,null))[_0x9ed0('0x46')](handleError(_0x3b84f1,null));};exports[_0x9ed0('0x4d')]=function(_0x4ca21f,_0x26c7f9,_0xed2ef5){return db[_0x9ed0('0x4e')]['count']({'where':{'ChatGroupId':_0x4ca21f['params']['id'],'ToId':_0x4ca21f[_0x9ed0('0x4f')]['id'],'read':![]}})['then'](function(_0x108f51){return{'id':_[_0x9ed0('0x50')](_0x4ca21f[_0x9ed0('0x47')]['id']),'count':_0x108f51};})[_0x9ed0('0x29')](respondWithResult(_0x26c7f9,null))['catch'](handleError(_0x26c7f9,null));};exports['addMembers']=function(_0x19f7ee,_0x2bb3ab,_0x5c8759){return db[_0x9ed0('0x30')][_0x9ed0('0x4b')]({'where':{'id':_0x19f7ee[_0x9ed0('0x47')]['id']}})[_0x9ed0('0x29')](handleEntityNotFound(_0x2bb3ab,null))[_0x9ed0('0x29')](function(_0x2bdc8a){if(_0x2bdc8a){return _0x2bdc8a[_0x9ed0('0x51')](_0x19f7ee[_0x9ed0('0x4a')][_0x9ed0('0x52')],_['omit'](_0x19f7ee['body'],['ids','id'])||{});}})[_0x9ed0('0x29')](respondWithResult(_0x2bb3ab,null))[_0x9ed0('0x46')](handleError(_0x2bb3ab,null));};exports['getMembers']=function(_0x7712b7,_0x50cc6d,_0x582e3c){var _0x1f755c={};var _0xbc3604={};var _0x5cf3f7;var _0x1582dd;return db['ChatGroup']['findOne']({'where':{'id':_0x7712b7[_0x9ed0('0x47')]['id']}})['then'](handleEntityNotFound(_0x50cc6d,null))[_0x9ed0('0x29')](function(_0x12afb6){if(_0x12afb6){_0x5cf3f7=_0x12afb6;_0xbc3604[_0x9ed0('0x3a')]=_[_0x9ed0('0x34')](db['User']['rawAttributes']);_0xbc3604[_0x9ed0('0x35')]=_[_0x9ed0('0x34')](_0x7712b7[_0x9ed0('0x35')]);_0xbc3604[_0x9ed0('0x36')]=_['intersection'](_0xbc3604['model'],_0xbc3604[_0x9ed0('0x35')]);_0x1f755c[_0x9ed0('0x38')]=_['intersection'](_0xbc3604[_0x9ed0('0x3a')],qs[_0x9ed0('0x39')](_0x7712b7[_0x9ed0('0x35')]['fields']));_0x1f755c[_0x9ed0('0x38')]=_0x1f755c[_0x9ed0('0x38')]['length']?_0x1f755c[_0x9ed0('0x38')]:_0xbc3604['model'];_0x1f755c[_0x9ed0('0x3c')]=qs['sort'](_0x7712b7['query'][_0x9ed0('0x3d')]);_0x1f755c['where']=qs['filters'](_['pick'](_0x7712b7[_0x9ed0('0x35')],_0xbc3604[_0x9ed0('0x36')]));if(_0x7712b7[_0x9ed0('0x35')][_0x9ed0('0x40')]){_0x1f755c[_0x9ed0('0x3e')]=_['merge'](_0x1f755c[_0x9ed0('0x3e')],{'$or':_[_0x9ed0('0x33')](_0x1f755c[_0x9ed0('0x38')],function(_0x41ceb5){var _0x144ef6={};_0x144ef6[_0x41ceb5]={'$like':'%'+_0x7712b7[_0x9ed0('0x35')][_0x9ed0('0x40')]+'%'};return _0x144ef6;})});}_0x1f755c=_['merge']({},_0x1f755c,_0x7712b7[_0x9ed0('0x53')]);return _0x5cf3f7[_0x9ed0('0x54')](_0x1f755c);}})[_0x9ed0('0x29')](function(_0x306e1e){if(_0x306e1e){_0x1582dd=_0x306e1e['length'];if(!_0x7712b7['query']['hasOwnProperty'](_0x9ed0('0x3b'))){_0x1f755c[_0x9ed0('0x22')]=qs[_0x9ed0('0x22')](_0x7712b7[_0x9ed0('0x35')][_0x9ed0('0x22')]);_0x1f755c['offset']=qs['offset'](_0x7712b7['query']['offset']);}return _0x5cf3f7['getMembers'](_0x1f755c);}})[_0x9ed0('0x29')](function(_0x5a2ee5){if(_0x5a2ee5){return _0x5a2ee5?{'count':_0x1582dd,'rows':_0x5a2ee5}:null;}})[_0x9ed0('0x29')](respondWithResult(_0x50cc6d,null))['catch'](handleError(_0x50cc6d,null));};exports[_0x9ed0('0x55')]=function(_0x3686da,_0x4d9807,_0x41de2b){return db[_0x9ed0('0x30')][_0x9ed0('0x4b')]({'where':{'id':_0x3686da[_0x9ed0('0x47')]['id']}})[_0x9ed0('0x29')](handleEntityNotFound(_0x4d9807,null))[_0x9ed0('0x29')](function(_0x9569c8){if(_0x9569c8){return _0x9569c8['removeMembers'](_0x3686da[_0x9ed0('0x35')][_0x9ed0('0x52')]);}})['then'](respondWithStatusCode(_0x4d9807,null))['catch'](handleError(_0x4d9807,null));};exports[_0x9ed0('0x56')]=function(_0x1b9b4e,_0x186a94,_0x40cac7){if(_0x1b9b4e[_0x9ed0('0x4a')]['id']){delete _0x1b9b4e[_0x9ed0('0x4a')]['id'];}return db[_0x9ed0('0x30')][_0x9ed0('0x4b')]({'where':{'id':_0x1b9b4e['params']['id']}})[_0x9ed0('0x29')](handleEntityNotFound(_0x186a94,null))[_0x9ed0('0x29')](function(_0x3c7b5d){if(_0x3c7b5d){_0x1b9b4e['body'][_0x9ed0('0x57')]=_0x3c7b5d['id'];return db[_0x9ed0('0x4e')][_0x9ed0('0x49')](_0x1b9b4e['body']);}})['then'](respondWithResult(_0x186a94,null))[_0x9ed0('0x46')](handleError(_0x186a94,null));};exports[_0x9ed0('0x58')]=function(_0x128c1f,_0x1670ba,_0x8754e4){var _0x5b5d05={};var _0x22e94c={};var _0x58906c;var _0x3b20cb;return db['ChatGroup'][_0x9ed0('0x59')]({'where':{'id':_0x128c1f[_0x9ed0('0x47')]['id']}})[_0x9ed0('0x29')](handleEntityNotFound(_0x1670ba,null))[_0x9ed0('0x29')](function(_0x4f25c6){if(_0x4f25c6){_0x58906c=_0x4f25c6;_0x22e94c[_0x9ed0('0x3a')]=_['keys'](db[_0x9ed0('0x4e')][_0x9ed0('0x5a')]);_0x22e94c[_0x9ed0('0x35')]=_[_0x9ed0('0x34')](_0x128c1f[_0x9ed0('0x35')]);_0x22e94c['filters']=_['intersection'](_0x22e94c[_0x9ed0('0x3a')],_0x22e94c[_0x9ed0('0x35')]);_0x5b5d05[_0x9ed0('0x38')]=_[_0x9ed0('0x37')](_0x22e94c['model'],qs[_0x9ed0('0x39')](_0x128c1f[_0x9ed0('0x35')][_0x9ed0('0x39')]));_0x5b5d05['attributes']=_0x5b5d05[_0x9ed0('0x38')]['length']?_0x5b5d05[_0x9ed0('0x38')]:_0x22e94c['model'];_0x5b5d05[_0x9ed0('0x3c')]=qs['sort'](_0x128c1f['query'][_0x9ed0('0x3d')]);_0x5b5d05['where']=qs[_0x9ed0('0x36')](_[_0x9ed0('0x3f')](_0x128c1f[_0x9ed0('0x35')],_0x22e94c[_0x9ed0('0x36')]));if(_0x128c1f['query']['filter']){_0x5b5d05[_0x9ed0('0x3e')]=_[_0x9ed0('0x41')](_0x5b5d05[_0x9ed0('0x3e')],{'$or':_[_0x9ed0('0x33')](_0x5b5d05['attributes'],function(_0x412ef3){var _0x78fb6={};_0x78fb6[_0x412ef3]={'$like':'%'+_0x128c1f[_0x9ed0('0x35')][_0x9ed0('0x40')]+'%'};return _0x78fb6;})});}if(_0x128c1f[_0x9ed0('0x35')][_0x9ed0('0x5b')]){var _0x1802b7=_0x128c1f[_0x9ed0('0x35')][_0x9ed0('0x5b')]['split'](',');var _0x285811={};_0x285811[_0x1802b7[0x0]]={'$gte':moment(_0x1802b7[0x1])[_0x9ed0('0x5c')](_0x9ed0('0x5d'))};_0x5b5d05[_0x9ed0('0x3e')]=_[_0x9ed0('0x41')](_0x5b5d05['where'],_0x285811);}_0x5b5d05=_[_0x9ed0('0x41')]({},_0x5b5d05,_0x128c1f[_0x9ed0('0x53')]);return _0x58906c['getMessages'](_0x5b5d05);}})['then'](function(_0x276992){if(_0x276992){_0x3b20cb=_0x276992[_0x9ed0('0x48')];if(!_0x128c1f[_0x9ed0('0x35')]['hasOwnProperty'](_0x9ed0('0x3b'))){_0x5b5d05[_0x9ed0('0x22')]=qs[_0x9ed0('0x22')](_0x128c1f[_0x9ed0('0x35')][_0x9ed0('0x22')]);_0x5b5d05['offset']=qs[_0x9ed0('0x1f')](_0x128c1f['query'][_0x9ed0('0x1f')]);}return _0x58906c[_0x9ed0('0x58')](_0x5b5d05);}})['then'](function(_0xc6a7b8){if(_0xc6a7b8){return _0xc6a7b8?{'count':_0x3b20cb,'rows':_0xc6a7b8}:null;}})['then'](respondWithResult(_0x1670ba,null))['catch'](handleError(_0x1670ba,null));}; \ No newline at end of file +var _0x6d22=['redis','localhost','./chatGroup.socket','register','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','ChatGroup','includeAll','include','show','params','length','options','find','catch','create','body','getUnread','user','toInteger','addMembers','omit','ids','getMembers','rawAttributes','removeMembers','addMessage','ChatInternalMessage','findOne','$gte','format','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults'];(function(_0x2d82e1,_0x196524){var _0x38fd08=function(_0x5b3ddb){while(--_0x5b3ddb){_0x2d82e1['push'](_0x2d82e1['shift']());}};_0x38fd08(++_0x196524);}(_0x6d22,0x100));var _0x26d2=function(_0x9a28d6,_0x5e2125){_0x9a28d6=_0x9a28d6-0x0;var _0x438c21=_0x6d22[_0x9a28d6];return _0x438c21;};'use strict';var emlformat=require(_0x26d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26d2('0x1'));var jsonpatch=require(_0x26d2('0x2'));var rp=require(_0x26d2('0x3'));var moment=require(_0x26d2('0x4'));var BPromise=require(_0x26d2('0x5'));var Mustache=require(_0x26d2('0x6'));var util=require(_0x26d2('0x7'));var path=require('path');var sox=require(_0x26d2('0x8'));var csv=require(_0x26d2('0x9'));var ejs=require(_0x26d2('0xa'));var fs=require('fs');var fs_extra=require(_0x26d2('0xb'));var _=require('lodash');var squel=require(_0x26d2('0xc'));var crypto=require(_0x26d2('0xd'));var jsforce=require(_0x26d2('0xe'));var deskjs=require(_0x26d2('0xf'));var toCsv=require(_0x26d2('0x9'));var querystring=require(_0x26d2('0x10'));var Papa=require(_0x26d2('0x11'));var Redis=require('ioredis');var authService=require(_0x26d2('0x12'));var qs=require(_0x26d2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x26d2('0x14'));var utils=require(_0x26d2('0x15'));var config=require(_0x26d2('0x16'));var licenseUtil=require(_0x26d2('0x17'));var db=require(_0x26d2('0x18'))['db'];config['redis']=_[_0x26d2('0x19')](config[_0x26d2('0x1a')],{'host':_0x26d2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26d2('0x1a')]));require(_0x26d2('0x1c'))[_0x26d2('0x1d')](socket);function respondWithStatusCode(_0x5d2a19,_0x174b4d){_0x174b4d=_0x174b4d||0xcc;return function(_0x3dd519){if(_0x3dd519){return _0x5d2a19['sendStatus'](_0x174b4d);}return _0x5d2a19[_0x26d2('0x1e')](_0x174b4d)[_0x26d2('0x1f')]();};}function respondWithResult(_0x38438d,_0xaad5d4){_0xaad5d4=_0xaad5d4||0xc8;return function(_0x1c5df8){if(_0x1c5df8){return _0x38438d[_0x26d2('0x1e')](_0xaad5d4)['json'](_0x1c5df8);}};}function respondWithFilteredResult(_0x4301e4,_0x1d61f0){return function(_0x5dd221){if(_0x5dd221){var _0x4559b3=typeof _0x1d61f0['offset']===_0x26d2('0x20')&&typeof _0x1d61f0[_0x26d2('0x21')]===_0x26d2('0x20');var _0x5c5a19=_0x5dd221[_0x26d2('0x22')];var _0x30391b=_0x4559b3?0x0:_0x1d61f0[_0x26d2('0x23')];var _0x47abb9=_0x4559b3?_0x5dd221[_0x26d2('0x22')]:_0x1d61f0['offset']+_0x1d61f0[_0x26d2('0x21')];var _0x4b1271;if(_0x47abb9>=_0x5c5a19){_0x47abb9=_0x5c5a19;_0x4b1271=0xc8;}else{_0x4b1271=0xce;}_0x4301e4['status'](_0x4b1271);return _0x4301e4[_0x26d2('0x24')](_0x26d2('0x25'),_0x30391b+'-'+_0x47abb9+'/'+_0x5c5a19)[_0x26d2('0x26')](_0x5dd221);}return null;};}function patchUpdates(_0x3f468e){return function(_0x4da47e){try{jsonpatch[_0x26d2('0x27')](_0x4da47e,_0x3f468e,!![]);}catch(_0x6be2bc){return BPromise[_0x26d2('0x28')](_0x6be2bc);}return _0x4da47e[_0x26d2('0x29')]();};}function saveUpdates(_0x8cb31e,_0x19a1a8){return function(_0xfe1704){if(_0xfe1704){return _0xfe1704[_0x26d2('0x2a')](_0x8cb31e)['then'](function(_0x2f8713){return _0x2f8713;});}return null;};}function removeEntity(_0x4c46ba,_0x254e14){return function(_0xe52127){if(_0xe52127){return _0xe52127['destroy']()[_0x26d2('0x2b')](function(){_0x4c46ba[_0x26d2('0x1e')](0xcc)[_0x26d2('0x1f')]();});}};}function handleEntityNotFound(_0x435533,_0x3d3621){return function(_0x4759f6){if(!_0x4759f6){_0x435533[_0x26d2('0x2c')](0x194);}return _0x4759f6;};}function handleError(_0x1cbc71,_0x41066b){_0x41066b=_0x41066b||0x1f4;return function(_0x4533e9){logger[_0x26d2('0x2d')](_0x4533e9[_0x26d2('0x2e')]);if(_0x4533e9[_0x26d2('0x2f')]){delete _0x4533e9[_0x26d2('0x2f')];}_0x1cbc71[_0x26d2('0x1e')](_0x41066b)[_0x26d2('0x30')](_0x4533e9);};}exports[_0x26d2('0x31')]=function(_0x5d9198,_0x3bbdfa){var _0xbd159b={},_0x581df7={},_0x1bbb30={'count':0x0,'rows':[]};var _0x3c8693=_[_0x26d2('0x32')](db['ChatGroup']['rawAttributes'],function(_0x13df3a){return{'name':_0x13df3a['fieldName'],'type':_0x13df3a['type'][_0x26d2('0x33')]};});_0x581df7[_0x26d2('0x34')]=_['map'](_0x3c8693,'name');_0x581df7['query']=_[_0x26d2('0x35')](_0x5d9198[_0x26d2('0x36')]);_0x581df7[_0x26d2('0x37')]=_[_0x26d2('0x38')](_0x581df7[_0x26d2('0x34')],_0x581df7['query']);_0xbd159b['attributes']=_[_0x26d2('0x38')](_0x581df7['model'],qs[_0x26d2('0x39')](_0x5d9198[_0x26d2('0x36')][_0x26d2('0x39')]));_0xbd159b['attributes']=_0xbd159b[_0x26d2('0x3a')]['length']?_0xbd159b['attributes']:_0x581df7[_0x26d2('0x34')];if(!_0x5d9198[_0x26d2('0x36')][_0x26d2('0x3b')](_0x26d2('0x3c'))){_0xbd159b[_0x26d2('0x21')]=qs[_0x26d2('0x21')](_0x5d9198[_0x26d2('0x36')]['limit']);_0xbd159b[_0x26d2('0x23')]=qs['offset'](_0x5d9198[_0x26d2('0x36')]['offset']);}_0xbd159b[_0x26d2('0x3d')]=qs['sort'](_0x5d9198[_0x26d2('0x36')][_0x26d2('0x3e')]);_0xbd159b['where']=qs[_0x26d2('0x37')](_[_0x26d2('0x3f')](_0x5d9198['query'],_0x581df7[_0x26d2('0x37')]),_0x3c8693);if(_0x5d9198[_0x26d2('0x36')]['filter']){_0xbd159b[_0x26d2('0x40')]=_['merge'](_0xbd159b[_0x26d2('0x40')],{'$or':_[_0x26d2('0x32')](_0x3c8693,function(_0x9faf07){if(_0x9faf07['type']!==_0x26d2('0x41')){var _0x457483={};_0x457483[_0x9faf07[_0x26d2('0x2f')]]={'$like':'%'+_0x5d9198['query'][_0x26d2('0x42')]+'%'};return _0x457483;}})});}_0xbd159b=_[_0x26d2('0x43')]({},_0xbd159b,_0x5d9198['options']);var _0x2eb262={'where':_0xbd159b[_0x26d2('0x40')]};return db[_0x26d2('0x44')][_0x26d2('0x22')](_0x2eb262)[_0x26d2('0x2b')](function(_0x2f5373){_0x1bbb30['count']=_0x2f5373;if(_0x5d9198[_0x26d2('0x36')][_0x26d2('0x45')]){_0xbd159b[_0x26d2('0x46')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0xbd159b);})['then'](function(_0x2290bb){_0x1bbb30['rows']=_0x2290bb;return _0x1bbb30;})[_0x26d2('0x2b')](respondWithFilteredResult(_0x3bbdfa,_0xbd159b))['catch'](handleError(_0x3bbdfa,null));};exports[_0x26d2('0x47')]=function(_0x340c38,_0x11ccd9){var _0x265db5={'raw':!![],'where':{'id':_0x340c38[_0x26d2('0x48')]['id']}},_0x31da16={};_0x31da16[_0x26d2('0x34')]=_[_0x26d2('0x35')](db['ChatGroup']['rawAttributes']);_0x31da16[_0x26d2('0x36')]=_['keys'](_0x340c38[_0x26d2('0x36')]);_0x31da16['filters']=_['intersection'](_0x31da16['model'],_0x31da16[_0x26d2('0x36')]);_0x265db5['attributes']=_[_0x26d2('0x38')](_0x31da16[_0x26d2('0x34')],qs['fields'](_0x340c38[_0x26d2('0x36')]['fields']));_0x265db5['attributes']=_0x265db5[_0x26d2('0x3a')][_0x26d2('0x49')]?_0x265db5[_0x26d2('0x3a')]:_0x31da16[_0x26d2('0x34')];if(_0x340c38[_0x26d2('0x36')][_0x26d2('0x45')]){_0x265db5['include']=[{'all':!![]}];}_0x265db5=_[_0x26d2('0x43')]({},_0x265db5,_0x340c38[_0x26d2('0x4a')]);return db['ChatGroup'][_0x26d2('0x4b')](_0x265db5)[_0x26d2('0x2b')](handleEntityNotFound(_0x11ccd9,null))['then'](respondWithResult(_0x11ccd9,null))[_0x26d2('0x4c')](handleError(_0x11ccd9,null));};exports[_0x26d2('0x4d')]=function(_0x38768b,_0x3511ab){return db[_0x26d2('0x44')][_0x26d2('0x4d')](_0x38768b['body'],{})[_0x26d2('0x2b')](respondWithResult(_0x3511ab,0xc9))[_0x26d2('0x4c')](handleError(_0x3511ab,null));};exports[_0x26d2('0x2a')]=function(_0x461d17,_0x358a0d){if(_0x461d17[_0x26d2('0x4e')]['id']){delete _0x461d17[_0x26d2('0x4e')]['id'];}return db[_0x26d2('0x44')][_0x26d2('0x4b')]({'where':{'id':_0x461d17[_0x26d2('0x48')]['id']}})[_0x26d2('0x2b')](handleEntityNotFound(_0x358a0d,null))[_0x26d2('0x2b')](saveUpdates(_0x461d17[_0x26d2('0x4e')],null))[_0x26d2('0x2b')](respondWithResult(_0x358a0d,null))[_0x26d2('0x4c')](handleError(_0x358a0d,null));};exports['destroy']=function(_0x564862,_0x31aa08){return db[_0x26d2('0x44')][_0x26d2('0x4b')]({'where':{'id':_0x564862['params']['id']}})[_0x26d2('0x2b')](handleEntityNotFound(_0x31aa08,null))[_0x26d2('0x2b')](removeEntity(_0x31aa08,null))[_0x26d2('0x4c')](handleError(_0x31aa08,null));};exports['describe']=function(_0x4a582a,_0x5a0f57){return db['ChatGroup']['describe']()[_0x26d2('0x2b')](respondWithResult(_0x5a0f57,null))[_0x26d2('0x4c')](handleError(_0x5a0f57,null));};exports[_0x26d2('0x4f')]=function(_0x185928,_0x15befe,_0x405033){return db['ChatInternalMessage'][_0x26d2('0x22')]({'where':{'ChatGroupId':_0x185928[_0x26d2('0x48')]['id'],'ToId':_0x185928[_0x26d2('0x50')]['id'],'read':![]}})[_0x26d2('0x2b')](function(_0x3601d6){return{'id':_[_0x26d2('0x51')](_0x185928['params']['id']),'count':_0x3601d6};})[_0x26d2('0x2b')](respondWithResult(_0x15befe,null))[_0x26d2('0x4c')](handleError(_0x15befe,null));};exports[_0x26d2('0x52')]=function(_0x4b891c,_0x1a58b9,_0x1dc930){return db['ChatGroup'][_0x26d2('0x4b')]({'where':{'id':_0x4b891c[_0x26d2('0x48')]['id']}})[_0x26d2('0x2b')](handleEntityNotFound(_0x1a58b9,null))['then'](function(_0x2a8de1){if(_0x2a8de1){return _0x2a8de1[_0x26d2('0x52')](_0x4b891c['body']['ids'],_[_0x26d2('0x53')](_0x4b891c[_0x26d2('0x4e')],[_0x26d2('0x54'),'id'])||{});}})['then'](respondWithResult(_0x1a58b9,null))[_0x26d2('0x4c')](handleError(_0x1a58b9,null));};exports[_0x26d2('0x55')]=function(_0x1a3ff5,_0x1d4a07,_0x1e90e0){var _0x46c7ea={};var _0x2a9d37={};var _0x5c0fcb;var _0x42d35d;return db[_0x26d2('0x44')]['findOne']({'where':{'id':_0x1a3ff5['params']['id']}})['then'](handleEntityNotFound(_0x1d4a07,null))[_0x26d2('0x2b')](function(_0x1e2079){if(_0x1e2079){_0x5c0fcb=_0x1e2079;_0x2a9d37[_0x26d2('0x34')]=_[_0x26d2('0x35')](db['User'][_0x26d2('0x56')]);_0x2a9d37['query']=_[_0x26d2('0x35')](_0x1a3ff5[_0x26d2('0x36')]);_0x2a9d37[_0x26d2('0x37')]=_[_0x26d2('0x38')](_0x2a9d37[_0x26d2('0x34')],_0x2a9d37['query']);_0x46c7ea[_0x26d2('0x3a')]=_['intersection'](_0x2a9d37[_0x26d2('0x34')],qs[_0x26d2('0x39')](_0x1a3ff5[_0x26d2('0x36')][_0x26d2('0x39')]));_0x46c7ea[_0x26d2('0x3a')]=_0x46c7ea[_0x26d2('0x3a')][_0x26d2('0x49')]?_0x46c7ea[_0x26d2('0x3a')]:_0x2a9d37[_0x26d2('0x34')];_0x46c7ea[_0x26d2('0x3d')]=qs['sort'](_0x1a3ff5[_0x26d2('0x36')]['sort']);_0x46c7ea[_0x26d2('0x40')]=qs[_0x26d2('0x37')](_[_0x26d2('0x3f')](_0x1a3ff5['query'],_0x2a9d37[_0x26d2('0x37')]));if(_0x1a3ff5['query'][_0x26d2('0x42')]){_0x46c7ea[_0x26d2('0x40')]=_[_0x26d2('0x43')](_0x46c7ea['where'],{'$or':_['map'](_0x46c7ea['attributes'],function(_0x31700c){var _0x220979={};_0x220979[_0x31700c]={'$like':'%'+_0x1a3ff5[_0x26d2('0x36')][_0x26d2('0x42')]+'%'};return _0x220979;})});}_0x46c7ea=_[_0x26d2('0x43')]({},_0x46c7ea,_0x1a3ff5[_0x26d2('0x4a')]);return _0x5c0fcb[_0x26d2('0x55')](_0x46c7ea);}})[_0x26d2('0x2b')](function(_0x1ac11e){if(_0x1ac11e){_0x42d35d=_0x1ac11e[_0x26d2('0x49')];if(!_0x1a3ff5['query'][_0x26d2('0x3b')]('nolimit')){_0x46c7ea[_0x26d2('0x21')]=qs[_0x26d2('0x21')](_0x1a3ff5[_0x26d2('0x36')]['limit']);_0x46c7ea['offset']=qs[_0x26d2('0x23')](_0x1a3ff5[_0x26d2('0x36')][_0x26d2('0x23')]);}return _0x5c0fcb[_0x26d2('0x55')](_0x46c7ea);}})['then'](function(_0x3f4dbf){if(_0x3f4dbf){return _0x3f4dbf?{'count':_0x42d35d,'rows':_0x3f4dbf}:null;}})[_0x26d2('0x2b')](respondWithResult(_0x1d4a07,null))[_0x26d2('0x4c')](handleError(_0x1d4a07,null));};exports[_0x26d2('0x57')]=function(_0x2bda90,_0x20ebde,_0x2214ec){return db[_0x26d2('0x44')][_0x26d2('0x4b')]({'where':{'id':_0x2bda90[_0x26d2('0x48')]['id']}})[_0x26d2('0x2b')](handleEntityNotFound(_0x20ebde,null))[_0x26d2('0x2b')](function(_0x521658){if(_0x521658){return _0x521658[_0x26d2('0x57')](_0x2bda90[_0x26d2('0x36')][_0x26d2('0x54')]);}})[_0x26d2('0x2b')](respondWithStatusCode(_0x20ebde,null))[_0x26d2('0x4c')](handleError(_0x20ebde,null));};exports[_0x26d2('0x58')]=function(_0x3c47a0,_0x173fbb,_0x1760de){if(_0x3c47a0[_0x26d2('0x4e')]['id']){delete _0x3c47a0[_0x26d2('0x4e')]['id'];}return db['ChatGroup'][_0x26d2('0x4b')]({'where':{'id':_0x3c47a0[_0x26d2('0x48')]['id']}})[_0x26d2('0x2b')](handleEntityNotFound(_0x173fbb,null))[_0x26d2('0x2b')](function(_0x553758){if(_0x553758){_0x3c47a0['body']['ChatGroupId']=_0x553758['id'];return db[_0x26d2('0x59')][_0x26d2('0x4d')](_0x3c47a0[_0x26d2('0x4e')]);}})[_0x26d2('0x2b')](respondWithResult(_0x173fbb,null))[_0x26d2('0x4c')](handleError(_0x173fbb,null));};exports['getMessages']=function(_0x3a4861,_0x5d944e,_0x27df7f){var _0x4f2280={};var _0x497d8c={};var _0x492f99;var _0x4c72df;return db['ChatGroup'][_0x26d2('0x5a')]({'where':{'id':_0x3a4861[_0x26d2('0x48')]['id']}})[_0x26d2('0x2b')](handleEntityNotFound(_0x5d944e,null))['then'](function(_0x10e539){if(_0x10e539){_0x492f99=_0x10e539;_0x497d8c[_0x26d2('0x34')]=_['keys'](db['ChatInternalMessage'][_0x26d2('0x56')]);_0x497d8c[_0x26d2('0x36')]=_[_0x26d2('0x35')](_0x3a4861['query']);_0x497d8c['filters']=_['intersection'](_0x497d8c['model'],_0x497d8c[_0x26d2('0x36')]);_0x4f2280[_0x26d2('0x3a')]=_[_0x26d2('0x38')](_0x497d8c[_0x26d2('0x34')],qs[_0x26d2('0x39')](_0x3a4861[_0x26d2('0x36')]['fields']));_0x4f2280[_0x26d2('0x3a')]=_0x4f2280[_0x26d2('0x3a')][_0x26d2('0x49')]?_0x4f2280[_0x26d2('0x3a')]:_0x497d8c[_0x26d2('0x34')];_0x4f2280[_0x26d2('0x3d')]=qs['sort'](_0x3a4861[_0x26d2('0x36')][_0x26d2('0x3e')]);_0x4f2280[_0x26d2('0x40')]=qs[_0x26d2('0x37')](_[_0x26d2('0x3f')](_0x3a4861[_0x26d2('0x36')],_0x497d8c[_0x26d2('0x37')]));if(_0x3a4861[_0x26d2('0x36')][_0x26d2('0x42')]){_0x4f2280['where']=_[_0x26d2('0x43')](_0x4f2280[_0x26d2('0x40')],{'$or':_[_0x26d2('0x32')](_0x4f2280[_0x26d2('0x3a')],function(_0x44697f){var _0x430e8c={};_0x430e8c[_0x44697f]={'$like':'%'+_0x3a4861[_0x26d2('0x36')][_0x26d2('0x42')]+'%'};return _0x430e8c;})});}if(_0x3a4861[_0x26d2('0x36')][_0x26d2('0x5b')]){var _0x2ad87b=_0x3a4861['query']['$gte']['split'](',');var _0x5b4809={};_0x5b4809[_0x2ad87b[0x0]]={'$gte':moment(_0x2ad87b[0x1])[_0x26d2('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4f2280[_0x26d2('0x40')]=_[_0x26d2('0x43')](_0x4f2280['where'],_0x5b4809);}_0x4f2280=_[_0x26d2('0x43')]({},_0x4f2280,_0x3a4861[_0x26d2('0x4a')]);return _0x492f99[_0x26d2('0x5d')](_0x4f2280);}})['then'](function(_0x2ccdc4){if(_0x2ccdc4){_0x4c72df=_0x2ccdc4[_0x26d2('0x49')];if(!_0x3a4861['query'][_0x26d2('0x3b')](_0x26d2('0x3c'))){_0x4f2280[_0x26d2('0x21')]=qs[_0x26d2('0x21')](_0x3a4861[_0x26d2('0x36')][_0x26d2('0x21')]);_0x4f2280[_0x26d2('0x23')]=qs[_0x26d2('0x23')](_0x3a4861[_0x26d2('0x36')]['offset']);}return _0x492f99[_0x26d2('0x5d')](_0x4f2280);}})[_0x26d2('0x2b')](function(_0x49dd07){if(_0x49dd07){return _0x49dd07?{'count':_0x4c72df,'rows':_0x49dd07}:null;}})[_0x26d2('0x2b')](respondWithResult(_0x5d944e,null))[_0x26d2('0x4c')](handleError(_0x5d944e,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 6162dbc..fc3610a 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 _0x7156=['hook','exports','../../mysqldb','ChatGroup','save','update','remove','emit'];(function(_0x315c51,_0x46251d){var _0x54cad2=function(_0x3e763c){while(--_0x3e763c){_0x315c51['push'](_0x315c51['shift']());}};_0x54cad2(++_0x46251d);}(_0x7156,0x122));var _0x6715=function(_0x56aef5,_0xc42093){_0x56aef5=_0x56aef5-0x0;var _0x5115dd=_0x7156[_0x56aef5];return _0x5115dd;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x6715('0x0'))['db'][_0x6715('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6715('0x2'),'afterUpdate':_0x6715('0x3'),'afterDestroy':_0x6715('0x4')};function emitEvent(_0x41e60f){return function(_0x546916,_0x521ce4,_0x3558a1){ChatGroupEvents[_0x6715('0x5')](_0x41e60f+':'+_0x546916['id'],_0x546916);ChatGroupEvents[_0x6715('0x5')](_0x41e60f,_0x546916);_0x3558a1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x6715('0x6')](e,emitEvent(event));}}module[_0x6715('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x9931=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x9931,0x1b6));var _0x1993=function(_0x2dcf37,_0x2b80f6){_0x2dcf37=_0x2dcf37-0x0;var _0x29bd77=_0x9931[_0x2dcf37];return _0x29bd77;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1993('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1993('0x1')](0x0);var events={'afterCreate':_0x1993('0x2'),'afterUpdate':_0x1993('0x3'),'afterDestroy':_0x1993('0x4')};function emitEvent(_0x311444){return function(_0x38e764,_0x31e1a5,_0x401ac4){ChatGroupEvents[_0x1993('0x5')](_0x311444+':'+_0x38e764['id'],_0x38e764);ChatGroupEvents[_0x1993('0x5')](_0x311444,_0x38e764);_0x401ac4(null);};}for(var e in events){if(events[_0x1993('0x6')](e)){var event=events[e];ChatGroup[_0x1993('0x7')](e,emitEvent(event));}}module[_0x1993('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index f960c99..cff1a68 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 _0x32f8=['moment','request-promise','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger','api'];(function(_0x4b1634,_0x1b1258){var _0x2f9f9f=function(_0x189b9d){while(--_0x189b9d){_0x4b1634['push'](_0x4b1634['shift']());}};_0x2f9f9f(++_0x1b1258);}(_0x32f8,0x92));var _0x832f=function(_0xd1b50d,_0x2d8ee7){_0xd1b50d=_0xd1b50d-0x0;var _0x4df98a=_0x32f8[_0xd1b50d];return _0x4df98a;};'use strict';var _=require(_0x832f('0x0'));var util=require(_0x832f('0x1'));var logger=require(_0x832f('0x2'))(_0x832f('0x3'));var moment=require(_0x832f('0x4'));var BPromise=require('bluebird');var rp=require(_0x832f('0x5'));var fs=require('fs');var path=require(_0x832f('0x6'));var rimraf=require(_0x832f('0x7'));var config=require(_0x832f('0x8'));var attributes=require('./chatGroup.attributes');module[_0x832f('0x9')]=function(_0x3797b9,_0x65fe56){return _0x3797b9['define']('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8de=['moment','bluebird','request-promise','path','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','api'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc8de,0xe1));var _0xec8d=function(_0x2c701e,_0x23e272){_0x2c701e=_0x2c701e-0x0;var _0x4b5dfe=_0xc8de[_0x2c701e];return _0x4b5dfe;};'use strict';var _=require(_0xec8d('0x0'));var util=require(_0xec8d('0x1'));var logger=require('../../config/logger')(_0xec8d('0x2'));var moment=require(_0xec8d('0x3'));var BPromise=require(_0xec8d('0x4'));var rp=require(_0xec8d('0x5'));var fs=require('fs');var path=require(_0xec8d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xec8d('0x7'));module[_0xec8d('0x8')]=function(_0x40310d,_0x2071ec){return _0x40310d[_0xec8d('0x9')](_0xec8d('0xa'),attributes,{'tableName':_0xec8d('0xb'),'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 70f41f1..5ed3f3e 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 _0x1979=['stringify','error','code','message','catch','ChatGroup,\x20%s,\x20%s','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x43190d,_0x375400){var _0x109c98=function(_0x12c214){while(--_0x12c214){_0x43190d['push'](_0x43190d['shift']());}};_0x109c98(++_0x375400);}(_0x1979,0xa2));var _0x9197=function(_0x53f402,_0x326920){_0x53f402=_0x53f402-0x0;var _0x45a76d=_0x1979[_0x53f402];return _0x45a76d;};'use strict';var _=require(_0x9197('0x0'));var util=require('util');var moment=require(_0x9197('0x1'));var BPromise=require('bluebird');var rs=require(_0x9197('0x2'));var fs=require('fs');var Redis=require(_0x9197('0x3'));var db=require(_0x9197('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9197('0x5'));var config=require(_0x9197('0x6'));var jayson=require(_0x9197('0x7'));var client=jayson['client'][_0x9197('0x8')]({'port':0x232a});config[_0x9197('0x9')]=_[_0x9197('0xa')](config[_0x9197('0x9')],{'host':_0x9197('0xb'),'port':0x18eb});var socket=require(_0x9197('0xc'))(new Redis(config[_0x9197('0x9')]));require(_0x9197('0xd'))[_0x9197('0xe')](socket);function respondWithRpcPromise(_0x512d04,_0x74d248,_0x4e83a1){return new BPromise(function(_0x10a6e6,_0x4abed5){return client[_0x9197('0xf')](_0x512d04,_0x4e83a1)['then'](function(_0x56ef79){logger[_0x9197('0x10')]('ChatGroup,\x20%s,\x20%s',_0x74d248,_0x9197('0x11'));logger[_0x9197('0x12')](_0x9197('0x13'),_0x74d248,_0x9197('0x11'),JSON[_0x9197('0x14')](_0x56ef79));if(_0x56ef79[_0x9197('0x15')]){if(_0x56ef79['error'][_0x9197('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x74d248,_0x56ef79[_0x9197('0x15')][_0x9197('0x17')]);return _0x4abed5(_0x56ef79[_0x9197('0x15')]['message']);}logger[_0x9197('0x15')]('ChatGroup,\x20%s,\x20%s',_0x74d248,_0x56ef79[_0x9197('0x15')][_0x9197('0x17')]);return _0x10a6e6(_0x56ef79[_0x9197('0x15')]['message']);}else{logger[_0x9197('0x10')]('ChatGroup,\x20%s,\x20%s',_0x74d248,_0x9197('0x11'));_0x10a6e6(_0x56ef79['result'][_0x9197('0x17')]);}})[_0x9197('0x18')](function(_0x5736d5){logger['error'](_0x9197('0x19'),_0x74d248,_0x5736d5);_0x4abed5(_0x5736d5);});});} \ No newline at end of file +var _0x3edb=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis'];(function(_0x56d117,_0x55c2a4){var _0x47ee45=function(_0xa35897){while(--_0xa35897){_0x56d117['push'](_0x56d117['shift']());}};_0x47ee45(++_0x55c2a4);}(_0x3edb,0x1c9));var _0xb3ed=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3edb[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xb3ed('0x0'));var util=require(_0xb3ed('0x1'));var moment=require('moment');var BPromise=require(_0xb3ed('0x2'));var rs=require(_0xb3ed('0x3'));var fs=require('fs');var Redis=require(_0xb3ed('0x4'));var db=require(_0xb3ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3ed('0x6'))('rpc');var config=require(_0xb3ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb3ed('0x8')][_0xb3ed('0x9')]({'port':0x232a});config[_0xb3ed('0xa')]=_['defaults'](config[_0xb3ed('0xa')],{'host':_0xb3ed('0xb'),'port':0x18eb});var socket=require(_0xb3ed('0xc'))(new Redis(config[_0xb3ed('0xa')]));require(_0xb3ed('0xd'))[_0xb3ed('0xe')](socket);function respondWithRpcPromise(_0x4f1692,_0x21fa7f,_0x5c5fec){return new BPromise(function(_0x5402f0,_0x245eec){return client[_0xb3ed('0xf')](_0x4f1692,_0x5c5fec)[_0xb3ed('0x10')](function(_0xda646b){logger[_0xb3ed('0x11')]('ChatGroup,\x20%s,\x20%s',_0x21fa7f,_0xb3ed('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x21fa7f,_0xb3ed('0x12'),JSON[_0xb3ed('0x13')](_0xda646b));if(_0xda646b['error']){if(_0xda646b[_0xb3ed('0x14')][_0xb3ed('0x15')]===0x1f4){logger[_0xb3ed('0x14')](_0xb3ed('0x16'),_0x21fa7f,_0xda646b[_0xb3ed('0x14')][_0xb3ed('0x17')]);return _0x245eec(_0xda646b['error'][_0xb3ed('0x17')]);}logger[_0xb3ed('0x14')]('ChatGroup,\x20%s,\x20%s',_0x21fa7f,_0xda646b[_0xb3ed('0x14')][_0xb3ed('0x17')]);return _0x5402f0(_0xda646b[_0xb3ed('0x14')]['message']);}else{logger['info'](_0xb3ed('0x16'),_0x21fa7f,_0xb3ed('0x12'));_0x5402f0(_0xda646b[_0xb3ed('0x18')][_0xb3ed('0x17')]);}})[_0xb3ed('0x19')](function(_0x184038){logger[_0xb3ed('0x14')](_0xb3ed('0x16'),_0x21fa7f,_0x184038);_0x245eec(_0x184038);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c573a90..1c7e4b7 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 _0x81e8=['save','remove','removeListener','register','length','./chatGroup.events'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0x81e8,0x113));var _0x881e=function(_0x223977,_0x27138c){_0x223977=_0x223977-0x0;var _0x5e75fa=_0x81e8[_0x223977];return _0x5e75fa;};'use strict';var ChatGroupEvents=require(_0x881e('0x0'));var events=[_0x881e('0x1'),_0x881e('0x2'),'update'];function createListener(_0x57f4f0,_0x56ae70){return function(_0x44d8c9){_0x56ae70['emit'](_0x57f4f0,_0x44d8c9);};}function removeListener(_0x480fb3,_0x590ce2){return function(){ChatGroupEvents[_0x881e('0x3')](_0x480fb3,_0x590ce2);};}exports[_0x881e('0x4')]=function(_0x508f9c){for(var _0x58bee7=0x0,_0x271710=events[_0x881e('0x5')];_0x58bee7<_0x271710;_0x58bee7++){var _0x226935=events[_0x58bee7];var _0x2a0f0b=createListener('chatGroup:'+_0x226935,_0x508f9c);ChatGroupEvents['on'](_0x226935,_0x2a0f0b);}}; \ No newline at end of file +var _0x75b3=['emit','removeListener','chatGroup:','./chatGroup.events','remove','update'];(function(_0x2f10ab,_0x50177c){var _0x4c238d=function(_0x4351cf){while(--_0x4351cf){_0x2f10ab['push'](_0x2f10ab['shift']());}};_0x4c238d(++_0x50177c);}(_0x75b3,0x189));var _0x375b=function(_0x1d3552,_0x3fd22d){_0x1d3552=_0x1d3552-0x0;var _0x3e4a3f=_0x75b3[_0x1d3552];return _0x3e4a3f;};'use strict';var ChatGroupEvents=require(_0x375b('0x0'));var events=['save',_0x375b('0x1'),_0x375b('0x2')];function createListener(_0x4a5ca9,_0x341202){return function(_0x4095bf){_0x341202[_0x375b('0x3')](_0x4a5ca9,_0x4095bf);};}function removeListener(_0x3b0b66,_0x51fdba){return function(){ChatGroupEvents[_0x375b('0x4')](_0x3b0b66,_0x51fdba);};}exports['register']=function(_0x1eb50e){for(var _0x2d0eac=0x0,_0x367256=events['length'];_0x2d0eac<_0x367256;_0x2d0eac++){var _0x20135f=events[_0x2d0eac];var _0x548436=createListener(_0x375b('0x5')+_0x20135f,_0x1eb50e);ChatGroupEvents['on'](_0x20135f,_0x548436);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 8e09fb2..e2c7625 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 _0x024c=['getMessages','post','create','addMembers','/:id/messages','put','/:id','update','delete','destroy','removeMembers','exports','util','connect-timeout','express','Router','../../components/interaction/service','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members','getMembers'];(function(_0x2be5e7,_0x1a8c59){var _0x23a1cd=function(_0x39f141){while(--_0x39f141){_0x2be5e7['push'](_0x2be5e7['shift']());}};_0x23a1cd(++_0x1a8c59);}(_0x024c,0x178));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xc024('0x0'));var path=require('path');var timeout=require(_0xc024('0x1'));var express=require(_0xc024('0x2'));var router=express[_0xc024('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc024('0x4'));var config=require('../../config/environment');var controller=require(_0xc024('0x5'));router[_0xc024('0x6')]('/',auth['isAuthenticated'](),controller[_0xc024('0x7')]);router[_0xc024('0x6')](_0xc024('0x8'),auth[_0xc024('0x9')](),controller[_0xc024('0xa')]);router[_0xc024('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xc024('0xb')]);router[_0xc024('0x6')](_0xc024('0xc'),auth['isAuthenticated'](),controller[_0xc024('0xd')]);router[_0xc024('0x6')](_0xc024('0xe'),auth[_0xc024('0x9')](),controller[_0xc024('0xf')]);router[_0xc024('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc024('0x10')]);router[_0xc024('0x11')]('/',auth[_0xc024('0x9')](),controller[_0xc024('0x12')]);router['post'](_0xc024('0xe'),auth[_0xc024('0x9')](),controller[_0xc024('0x13')]);router[_0xc024('0x11')](_0xc024('0x14'),auth[_0xc024('0x9')](),controller['addMessage']);router[_0xc024('0x15')](_0xc024('0x16'),auth[_0xc024('0x9')](),controller[_0xc024('0x17')]);router[_0xc024('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xc024('0x19')]);router['delete'](_0xc024('0xe'),auth[_0xc024('0x9')](),controller[_0xc024('0x1a')]);module[_0xc024('0x1b')]=router; \ No newline at end of file +var _0xffd9=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','/:id/messages','getMessages','post','create','/:id/members','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x250f2e,_0x2a8b40){var _0x49a437=function(_0x44946b){while(--_0x44946b){_0x250f2e['push'](_0x250f2e['shift']());}};_0x49a437(++_0x2a8b40);}(_0xffd9,0x14a));var _0x9ffd=function(_0x44da75,_0x4e4ef9){_0x44da75=_0x44da75-0x0;var _0x293c52=_0xffd9[_0x44da75];return _0x293c52;};'use strict';var multer=require(_0x9ffd('0x0'));var util=require(_0x9ffd('0x1'));var path=require(_0x9ffd('0x2'));var timeout=require(_0x9ffd('0x3'));var express=require(_0x9ffd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9ffd('0x5'));var interaction=require(_0x9ffd('0x6'));var config=require(_0x9ffd('0x7'));var controller=require(_0x9ffd('0x8'));router[_0x9ffd('0x9')]('/',auth[_0x9ffd('0xa')](),controller[_0x9ffd('0xb')]);router[_0x9ffd('0x9')](_0x9ffd('0xc'),auth[_0x9ffd('0xa')](),controller[_0x9ffd('0xd')]);router['get'](_0x9ffd('0xe'),auth[_0x9ffd('0xa')](),controller[_0x9ffd('0xf')]);router[_0x9ffd('0x9')](_0x9ffd('0x10'),auth[_0x9ffd('0xa')](),controller['getUnread']);router[_0x9ffd('0x9')]('/:id/members',auth[_0x9ffd('0xa')](),controller['getMembers']);router['get'](_0x9ffd('0x11'),auth[_0x9ffd('0xa')](),controller[_0x9ffd('0x12')]);router[_0x9ffd('0x13')]('/',auth[_0x9ffd('0xa')](),controller[_0x9ffd('0x14')]);router[_0x9ffd('0x13')](_0x9ffd('0x15'),auth[_0x9ffd('0xa')](),controller['addMembers']);router[_0x9ffd('0x13')](_0x9ffd('0x11'),auth[_0x9ffd('0xa')](),controller[_0x9ffd('0x16')]);router[_0x9ffd('0x17')](_0x9ffd('0xe'),auth[_0x9ffd('0xa')](),controller['update']);router[_0x9ffd('0x18')](_0x9ffd('0xe'),auth[_0x9ffd('0xa')](),controller[_0x9ffd('0x19')]);router[_0x9ffd('0x18')](_0x9ffd('0x15'),auth[_0x9ffd('0xa')](),controller[_0x9ffd('0x1a')]);module[_0x9ffd('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 a0a0228..fd16cdf 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 _0xaf1d=['TEXT','STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER','star','thumb'];(function(_0x123da7,_0x1da803){var _0x48b201=function(_0x1ccda1){while(--_0x1ccda1){_0x123da7['push'](_0x123da7['shift']());}};_0x48b201(++_0x1da803);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x1a1f0d,_0x540353){_0x1a1f0d=_0x1a1f0d-0x0;var _0xd6a4d3=_0xaf1d[_0x1a1f0d];return _0xd6a4d3;};'use strict';var Sequelize=require(_0xdaf1('0x0'));module[_0xdaf1('0x1')]={'closed':{'type':Sequelize[_0xdaf1('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdaf1('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xdaf1('0x4'),_0xdaf1('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xdaf1('0x6')]},'pathTranscript':{'type':Sequelize[_0xdaf1('0x6')]},'mailTranscript':{'type':Sequelize[_0xdaf1('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdaf1('0x8')]},'disposition':{'type':Sequelize[_0xdaf1('0x7')]},'secondDisposition':{'type':Sequelize[_0xdaf1('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xdaf1('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xdaf1('0x7')]},'deviceVendor':{'type':Sequelize[_0xdaf1('0x7')]},'deviceType':{'type':Sequelize[_0xdaf1('0x7')]},'referer':{'type':Sequelize[_0xdaf1('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xdaf1('0x6')](_0xdaf1('0x9'))},'read1stAt':{'type':Sequelize[_0xdaf1('0x8')]},'lastMsgAt':{'type':Sequelize[_0xdaf1('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xdaf1('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdaf1('0x7')]},'customerPort':{'type':Sequelize[_0xdaf1('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xdaf1('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xdaf1('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7275=['STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','thumb','star','TEXT'];(function(_0x6dc4a5,_0x58a155){var _0x57b3e2=function(_0xe3f0d){while(--_0xe3f0d){_0x6dc4a5['push'](_0x6dc4a5['shift']());}};_0x57b3e2(++_0x58a155);}(_0x7275,0x143));var _0x5727=function(_0x3f410b,_0x42ab42){_0x3f410b=_0x3f410b-0x0;var _0x327295=_0x7275[_0x3f410b];return _0x327295;};'use strict';var Sequelize=require(_0x5727('0x0'));module[_0x5727('0x1')]={'closed':{'type':Sequelize[_0x5727('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x5727('0x3')]('star',_0x5727('0x4')),'defaultValue':_0x5727('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x5727('0x6')]},'mailTranscript':{'type':Sequelize[_0x5727('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5727('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x5727('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x5727('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x5727('0x7')]},'deviceVendor':{'type':Sequelize[_0x5727('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x5727('0x6')]},'customerIp':{'type':Sequelize[_0x5727('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x5727('0x8'))},'read1stAt':{'type':Sequelize[_0x5727('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5727('0x3')]('in',_0x5727('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5727('0x7')]},'customerPort':{'type':Sequelize[_0x5727('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x5727('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x5727('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index e3c1876..00d0fa4 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 _0x651c=['customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','attachId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ChatWebsiteId','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','createdAt','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','offset','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','secret','options','includeAgent','push','rows','setTags','spread','Tag','chatInteractionTags:save','removeTags','toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','Chat','N.A.','closedAt','browserName','customerIp','customerPort','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','Content-Range','json','stack','name','render','body','interaction','account','index','map','rawAttributes','fieldName','type','key','findAll','query','user','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','ChatInteraction','find','create','update','destroy','params','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','contact','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes'];(function(_0x360803,_0x273fa6){var _0x3c4a4a=function(_0x56c3bf){while(--_0x56c3bf){_0x360803['push'](_0x360803['shift']());}};_0x3c4a4a(++_0x273fa6);}(_0x651c,0x68));var _0xc651=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x651c[_0x1b51ea];return _0x18bbdc;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc651('0x0'));var rp=require('request-promise');var moment=require(_0xc651('0x1'));var BPromise=require(_0xc651('0x2'));var Mustache=require('mustache');var util=require(_0xc651('0x3'));var path=require(_0xc651('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xc651('0x5'));var interaction=require(_0xc651('0x6'));var qs=require(_0xc651('0x7'));var pdf=require(_0xc651('0x8'));var logger=require(_0xc651('0x9'))(_0xc651('0xa'));var config=require(_0xc651('0xb'));var db=require(_0xc651('0xc'))['db'];config[_0xc651('0xd')]=_['defaults'](config[_0xc651('0xd')],{'host':_0xc651('0xe'),'port':0x18eb});var socket=require(_0xc651('0xf'))(new Redis(config[_0xc651('0xd')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xc651('0x10'));var client=jayson[_0xc651('0x11')][_0xc651('0x12')]({'port':0x232b});var client9004=jayson['client'][_0xc651('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x2e8b00,_0x29a970,_0x406b3d,_0x54e8f4){return new BPromise(function(_0x4e2b71,_0x2c8eee){var _0x758f20=_0x54e8f4||client;return _0x758f20[_0xc651('0x13')](_0x2e8b00,_0x406b3d)[_0xc651('0x14')](function(_0x12937f){logger[_0xc651('0x15')](_0xc651('0x16'),_0x29a970,'request\x20sent');logger[_0xc651('0x17')](_0xc651('0x18'),_0x29a970,_0xc651('0x19'),JSON[_0xc651('0x1a')](_0x12937f));if(_0x12937f[_0xc651('0x1b')]){if(_0x12937f[_0xc651('0x1b')][_0xc651('0x1c')]===0x1f4){logger[_0xc651('0x1b')](_0xc651('0x16'),_0x29a970,_0x12937f[_0xc651('0x1b')][_0xc651('0x1d')]);return _0x2c8eee(_0x12937f[_0xc651('0x1b')][_0xc651('0x1d')]);}logger[_0xc651('0x1b')](_0xc651('0x16'),_0x29a970,_0x12937f[_0xc651('0x1b')][_0xc651('0x1d')]);return _0x4e2b71(_0x12937f[_0xc651('0x1b')][_0xc651('0x1d')]);}else{logger[_0xc651('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x29a970,_0xc651('0x19'));_0x4e2b71(_0x12937f[_0xc651('0x1e')][_0xc651('0x1d')]);}})[_0xc651('0x1f')](function(_0xe2fcc8){logger[_0xc651('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x29a970,_0xe2fcc8);_0x2c8eee(_0xe2fcc8);});});}function respondWithStatusCode(_0x30463a,_0x5d6e01){_0x5d6e01=_0x5d6e01||0xcc;return function(_0x35e93c){if(_0x35e93c){return _0x30463a[_0xc651('0x20')](_0x5d6e01);}return _0x30463a[_0xc651('0x21')](_0x5d6e01)[_0xc651('0x22')]();};}function respondWithResult(_0x1225fd,_0x373015){_0x373015=_0x373015||0xc8;return function(_0xb1e239){if(_0xb1e239){return _0x1225fd['status'](_0x373015)['json'](_0xb1e239);}};}function respondWithFilteredResult(_0x35ffc9,_0x341913){return function(_0x3e6469){if(_0x3e6469){var _0x37fc31=typeof _0x341913['offset']===_0xc651('0x23')&&typeof _0x341913[_0xc651('0x24')]===_0xc651('0x23');var _0x21959f=_0x3e6469[_0xc651('0x25')];var _0x422dae=_0x37fc31?0x0:_0x341913['offset'];var _0x4b4bd2=_0x37fc31?_0x3e6469[_0xc651('0x25')]:_0x341913['offset']+_0x341913[_0xc651('0x24')];var _0x9f8c4e;if(_0x4b4bd2>=_0x21959f){_0x4b4bd2=_0x21959f;_0x9f8c4e=0xc8;}else{_0x9f8c4e=0xce;}_0x35ffc9[_0xc651('0x21')](_0x9f8c4e);return _0x35ffc9['set'](_0xc651('0x26'),_0x422dae+'-'+_0x4b4bd2+'/'+_0x21959f)[_0xc651('0x27')](_0x3e6469);}return null;};}function saveUpdates(_0x542d47){return function(_0x194646){if(_0x194646){return _0x194646['update'](_0x542d47)[_0xc651('0x14')](function(_0x5cef70){return _0x5cef70;});}return null;};}function removeEntity(_0x42c3ae){return function(_0x4a0cac){if(_0x4a0cac){return _0x4a0cac['destroy']()[_0xc651('0x14')](function(){_0x42c3ae[_0xc651('0x21')](0xcc)[_0xc651('0x22')]();});}};}function handleEntityNotFound(_0x57ae65){return function(_0x3ee0fb){if(!_0x3ee0fb){_0x57ae65[_0xc651('0x20')](0x194);}return _0x3ee0fb;};}function handleError(_0x2e103e,_0xf3affe){_0xf3affe=_0xf3affe||0x1f4;return function(_0x1f0fda){logger['error'](_0x1f0fda[_0xc651('0x28')]);if(_0x1f0fda[_0xc651('0x29')]){delete _0x1f0fda['name'];}_0x2e103e[_0xc651('0x21')](_0xf3affe)['send'](_0x1f0fda);};}function getMustacheRender(_0x54cb35,_0x411e46){return Mustache[_0xc651('0x2a')](_0x54cb35,_['merge'](_0x411e46[_0xc651('0x2b')],{'contact':_0x411e46['contact'],'message':_0x411e46[_0xc651('0x1d')],'agent':_0x411e46['agent'],'interaction':_0x411e46[_0xc651('0x2c')],'account':_0x411e46[_0xc651('0x2d')]}))||'';}exports[_0xc651('0x2e')]=function(_0x1a7e37,_0x120f00){var _0x326f3d={};var _0x1193e6=_[_0xc651('0x2f')](db['ChatInteraction'][_0xc651('0x30')],function(_0x2d969a){return{'name':_0x2d969a[_0xc651('0x31')],'type':_0x2d969a[_0xc651('0x32')][_0xc651('0x33')]};});_0x326f3d=qs['getOptions'](_0x1193e6,_0x1a7e37);return interaction[_0xc651('0x34')]('chat',_0x1a7e37[_0xc651('0x35')],_0x1a7e37[_0xc651('0x36')],_0x326f3d,_0x1193e6)[_0xc651('0x14')](respondWithFilteredResult(_0x120f00,_0x326f3d))[_0xc651('0x1f')](handleError(_0x120f00,null));};exports['show']=function(_0x4b9c4e,_0x505844){var _0x27116f={'raw':![],'where':{'id':_0x4b9c4e['params']['id']}},_0x1fa41e={};_0x1fa41e[_0xc651('0x37')]=_[_0xc651('0x38')](db['ChatInteraction']['rawAttributes']);_0x1fa41e[_0xc651('0x35')]=_[_0xc651('0x38')](_0x4b9c4e[_0xc651('0x35')]);_0x1fa41e[_0xc651('0x39')]=_[_0xc651('0x3a')](_0x1fa41e[_0xc651('0x37')],_0x1fa41e['query']);_0x27116f['attributes']=_[_0xc651('0x3a')](_0x1fa41e[_0xc651('0x37')],qs['fields'](_0x4b9c4e[_0xc651('0x35')][_0xc651('0x3b')]));_0x27116f['attributes']=_0x27116f[_0xc651('0x3c')][_0xc651('0x3d')]?_0x27116f[_0xc651('0x3c')]:_0x1fa41e['model'];if(_0x4b9c4e[_0xc651('0x35')][_0xc651('0x3e')]){_0x27116f[_0xc651('0x3f')]=[{'all':!![]}];}_0x27116f=_[_0xc651('0x40')]({},_0x27116f,_0x4b9c4e['options']);return db[_0xc651('0x41')][_0xc651('0x42')](_0x27116f)[_0xc651('0x14')](handleEntityNotFound(_0x505844,null))[_0xc651('0x14')](respondWithResult(_0x505844,null))[_0xc651('0x1f')](handleError(_0x505844,null));};exports['create']=function(_0x5711e4,_0x434345){return db['ChatInteraction'][_0xc651('0x43')](_0x5711e4[_0xc651('0x2b')],{})[_0xc651('0x14')](respondWithResult(_0x434345,0xc9))[_0xc651('0x1f')](handleError(_0x434345,null));};exports[_0xc651('0x44')]=function(_0x2ffff4,_0x5a7b6e){if(_0x2ffff4['body']['id']){delete _0x2ffff4[_0xc651('0x2b')]['id'];}return db['ChatInteraction'][_0xc651('0x42')]({'where':{'id':_0x2ffff4['params']['id']}})[_0xc651('0x14')](handleEntityNotFound(_0x5a7b6e,null))[_0xc651('0x14')](saveUpdates(_0x2ffff4[_0xc651('0x2b')],null))[_0xc651('0x14')](respondWithResult(_0x5a7b6e,null))[_0xc651('0x1f')](handleError(_0x5a7b6e,null));};exports[_0xc651('0x45')]=function(_0xfc2113,_0x436184){return db[_0xc651('0x41')][_0xc651('0x42')]({'where':{'id':_0xfc2113[_0xc651('0x46')]['id']}})[_0xc651('0x14')](handleEntityNotFound(_0x436184,null))[_0xc651('0x14')](removeEntity(_0x436184,null))[_0xc651('0x1f')](handleError(_0x436184,null));};exports[_0xc651('0x47')]=function(_0x5270ea,_0x3c8b87){return db[_0xc651('0x41')][_0xc651('0x47')]()[_0xc651('0x14')](respondWithResult(_0x3c8b87,null))[_0xc651('0x1f')](handleError(_0x3c8b87,null));};exports['createVidaooSession']=function(_0x59a4de,_0x7e6b96){var _0x46d54f=_0x59a4de[_0xc651('0x46')]['id'];var _0x4f323b;var _0x9eca1c;var _0x2f6bfa;return db[_0xc651('0x41')][_0xc651('0x48')]({'where':{'id':_0x46d54f}})[_0xc651('0x14')](function(_0x5b10b0){_0x4f323b=_0x5b10b0;return db[_0xc651('0x49')][_0xc651('0x48')]({'where':{'id':_0x5b10b0['ChatWebsiteId']},'attributes':['id',_0xc651('0x4a'),_0xc651('0x4b'),'vidaooTopic',_0xc651('0x4c'),_0xc651('0x4d')],'raw':!![]});})['then'](function(_0x324b26){if(_0x324b26&&_0x324b26['vidaooApiKey']&&_0x324b26[_0xc651('0x4b')]){_0x9eca1c=_0x324b26;var _0x3ee425={'interaction':{'id':_0x46d54f},'agent':{'id':_0x59a4de['user']['id'],'name':_0x59a4de['user'][_0xc651('0x29')],'fullname':_0x59a4de[_0xc651('0x36')][_0xc651('0x4e')],'email':_0x59a4de[_0xc651('0x36')][_0xc651('0x4f')]},'contact':_0x59a4de[_0xc651('0x2b')][_0xc651('0x50')],'account':_0x59a4de[_0xc651('0x2b')][_0xc651('0x2d')]};var _0x1e6fb7={'rejectUnauthorized':![],'method':'POST','url':_0xc651('0x51'),'headers':{'X-APIKEY':_0x324b26['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x59a4de['user'][_0xc651('0x4f')]],'buttons':null,'topic':_0x9eca1c['vidaooTopic'],'note':_[_0xc651('0x52')](_0x9eca1c[_0xc651('0x4c')])?null:getMustacheRender(_0x9eca1c[_0xc651('0x4c')],_0x3ee425),'metadata':null},'redirect':_0xc651('0x53'),'json':!![]};try{if(!_[_0xc651('0x52')](_0x9eca1c[_0xc651('0x4d')])){var _0x137f74=getMustacheRender(_0x9eca1c[_0xc651('0x4d')],_0x3ee425);var _0x44acca=JSON[_0xc651('0x54')](_0x137f74);_0x1e6fb7[_0xc651('0x2b')][_0xc651('0x55')]=_0x44acca;}}catch(_0x13787a){throw new db[(_0xc651('0x56'))][(_0xc651('0x57'))](_0xc651('0x58'));}return rp(_0x1e6fb7);}else{throw new db['Sequelize']['ValidationError'](_0xc651('0x59'));}})[_0xc651('0x14')](function(_0x318c55){_0x2f6bfa=_0x318c55;if(_0x2f6bfa['id']){var _0x41b673={'body':_0x2f6bfa[_0xc651('0x5a')],'ChatWebsiteId':_0x9eca1c['id'],'ChatInteractionId':_0x4f323b['id'],'direction':_0xc651('0x5b'),'UserId':_0x59a4de[_0xc651('0x36')]['id']};return db[_0xc651('0x5c')][_0xc651('0x43')](_0x41b673,{});}else{throw new db[(_0xc651('0x56'))]['ValidationError'](_0xc651('0x5d'));}})[_0xc651('0x14')](function(){return _0x4f323b[_0xc651('0x5e')]({'vidaooSessionId':_0x2f6bfa['id']});})[_0xc651('0x14')](respondWithResult(_0x7e6b96,null))['catch'](handleError(_0x7e6b96,null));};exports[_0xc651('0x5f')]=function(_0x5c0f84,_0x3f8237){if(_0x5c0f84[_0xc651('0x2b')]['id']){delete _0x5c0f84[_0xc651('0x2b')]['id'];}return db[_0xc651('0x41')]['find']({'where':{'id':_0x5c0f84[_0xc651('0x46')]['id']},'include':[{'model':db[_0xc651('0x60')],'as':_0xc651('0x61')}]})[_0xc651('0x14')](handleEntityNotFound(_0x3f8237,null))[_0xc651('0x14')](saveUpdates(_0x5c0f84[_0xc651('0x2b')],null))[_0xc651('0x14')](respondWithResult(_0x3f8237,null))[_0xc651('0x1f')](handleError(_0x3f8237,null));};exports['abandon']=function(_0x16323d,_0x1b7847){if(_0x16323d[_0xc651('0x2b')]['id']){delete _0x16323d['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x16323d[_0xc651('0x46')]['id']}})[_0xc651('0x14')](function(_0x102e8){if(!_0x102e8){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xc651('0x62'),0x194,_0xc651('0x63'));_0x1b7847[_0xc651('0x20')](0x194);}else{if(_0x102e8[_0xc651('0x64')]){throw new db[(_0xc651('0x56'))]['ValidationError'](_0xc651('0x65'));}}return _0x102e8;})['then'](function(_0x206267){if(_0x206267){return _0x206267[_0xc651('0x44')]({'closed':_0x16323d['body'][_0xc651('0x66')],'disposition':_0x16323d['body'][_0xc651('0x67')]})[_0xc651('0x14')](function(_0x5efd4b){return _0x5efd4b;});}})[_0xc651('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0xc651('0x62'),_0x16323d[_0xc651('0x2b')],client9004);})[_0xc651('0x14')](respondWithResult(_0x1b7847,null))['catch'](handleError(_0x1b7847,null));};exports[_0xc651('0x68')]=function(_0x1f2ed2,_0x474ab7){_0x1f2ed2[_0xc651('0x2b')][_0xc651('0x29')]=_0x1f2ed2[_0xc651('0x69')][_0xc651('0x6a')];_0x1f2ed2['body'][_0xc651('0x6b')]=_0x1f2ed2[_0xc651('0x69')][_0xc651('0x6c')];_0x1f2ed2[_0xc651('0x2b')][_0xc651('0x32')]=_0x1f2ed2[_0xc651('0x69')][_0xc651('0x6d')];return db[_0xc651('0x6e')][_0xc651('0x43')](_0x1f2ed2[_0xc651('0x2b')])['then'](respondWithResult(_0x474ab7,0xc9))['catch'](handleError(_0x474ab7,null));};exports[_0xc651('0x6f')]=function(_0x454984,_0x4da14c){return db[_0xc651('0x41')][_0xc651('0x48')]({'where':{'id':_0x454984[_0xc651('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4da14c,null))[_0xc651('0x14')](function(_0x3ddd39){if(_0x3ddd39){if(_0x3ddd39[_0xc651('0x66')]){return _0x4da14c[_0xc651('0x21')](0x193)[_0xc651('0x27')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0xc651('0x48')]({'where':{'id':_0x454984[_0xc651('0x35')][_0xc651('0x70')]},'raw':!![]})[_0xc651('0x14')](handleEntityNotFound(_0x4da14c,null));}})[_0xc651('0x14')](function(_0x1d145e){if(_0x1d145e){var _0x57bc9c=_0x1d145e['ChatOfflineMessageId']!==null;var _0x2bdd79=path[_0xc651('0x71')](config['root'],_0xc651('0x72'));if(_0x57bc9c){_0x2bdd79=path[_0xc651('0x71')](_0x2bdd79,_0xc651('0x73'));}var _0x2aabeb=path[_0xc651('0x71')](_0x2bdd79,_0x1d145e[_0xc651('0x6b')]);return _0x4da14c[_0xc651('0x74')](_0x2aabeb);}})[_0xc651('0x1f')](handleError(_0x4da14c,null));};exports[_0xc651('0x75')]=function(_0x3abfe7,_0xb96031){var _0x34c8e3=null;var _0x41f356=null;var _0x2af156=null;if(_0x3abfe7['body']['id']){delete _0x3abfe7[_0xc651('0x2b')]['id'];}if(_0x3abfe7[_0xc651('0x2b')][_0xc651('0x76')]){_0x2af156=path[_0xc651('0x71')](config[_0xc651('0x77')],_0xc651('0x78'),util[_0xc651('0x79')](_0xc651('0x7a'),Date[_0xc651('0x7b')]()));_0x3abfe7[_0xc651('0x2b')]['pathTranscript']=_0x2af156;}return db[_0xc651('0x41')][_0xc651('0x42')]({'where':{'id':_0x3abfe7['params']['id']},'include':[{'model':db[_0xc651('0x5c')],'as':_0xc651('0x7c'),'include':[{'model':db[_0xc651('0x7d')],'as':_0xc651('0x7d')}]}]})['then'](handleEntityNotFound(_0xb96031,null))[_0xc651('0x14')](saveUpdates(_0x3abfe7[_0xc651('0x2b')],null))[_0xc651('0x14')](function(_0x3d7760){if(_0x3d7760){_0x34c8e3=_0x3d7760;return db['ChatWebsite']['find']({'where':{'id':_0x34c8e3[_0xc651('0x7e')]}});}})[_0xc651('0x14')](function(_0x915490){if(_0x915490){_0x41f356=_0x915490;return db[_0xc651('0x60')][_0xc651('0x42')]({'where':{'id':_0x34c8e3[_0xc651('0x7f')]}});}})[_0xc651('0x14')](function(_0xc73eab){if(_0xc73eab){if(_0x2af156){var _0x1dbc07=null;for(var _0xc39903=0x1;_0xc39903<_0x34c8e3['Messages'][_0xc651('0x3d')];++_0xc39903){_0x1dbc07=_0x34c8e3[_0xc651('0x7c')][_0xc39903];var _0x6b499e=_0x1dbc07[_0xc651('0x64')]?util[_0xc651('0x79')](_0xc651('0x80'),_0x41f356[_0xc651('0x81')],_0x1dbc07['UserId']):_0xc651('0x82');var _0x399c96=_0x3abfe7['body']['customer']||util[_0xc651('0x79')]('%s%d',_0xc651('0x83'),_0x1dbc07['ContactId']);switch(_0x41f356[_0xc651('0x84')]){case _0xc651('0x85'):_0x6b499e=_0x1dbc07['UserId']?util[_0xc651('0x79')](_0xc651('0x80'),_0x41f356[_0xc651('0x81')],_0x1dbc07[_0xc651('0x64')]):_0xc651('0x82');break;case _0xc651('0x86'):_0x6b499e=_0x1dbc07['UserId']?_0x1dbc07[_0xc651('0x7d')]['alias']||_0x1dbc07[_0xc651('0x7d')][_0xc651('0x4e')]:_0xc651('0x82');break;case'agent_fullname':_0x6b499e=_0x1dbc07[_0xc651('0x64')]?_0x1dbc07['User']['fullname']:_0xc651('0x82');break;default:_0x6b499e=_0x1dbc07[_0xc651('0x64')]?util['format']('%s%d',_0x41f356[_0xc651('0x81')],_0x1dbc07[_0xc651('0x64')]):_0xc651('0x82');}var _0x382f72=util[_0xc651('0x79')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1dbc07[_0xc651('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x1dbc07[_0xc651('0x88')]==='in'?_0x399c96:_0x6b499e,_0x1dbc07[_0xc651('0x2b')]);if(!_0x1dbc07['secret']){fs[_0xc651('0x89')](_0x2af156,_0x382f72);}}return db[_0xc651('0x8a')][_0xc651('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0xc651('0x8b')],'as':_0xc651('0x8c'),'raw':!![],'include':[{'model':db[_0xc651('0x8d')],'as':_0xc651('0x8d'),'raw':!![]}]}]});}}})[_0xc651('0x14')](function(_0x226771){if(!_0x226771||!_0x226771[_0xc651('0x8c')]||!_0x3abfe7[_0xc651('0x2b')])return _0x34c8e3;var _0x545b9a=_0x226771[_0xc651('0x8e')]();return respondWithRpcPromise('SendMail',_0xc651('0x8f'),{'account':_0x545b9a,'message':{'from':util['format'](_0xc651('0x90'),_0x226771['name'],_0x226771[_0xc651('0x4f')]||_0x226771['Smtp'][_0xc651('0x36')]),'to':_0x3abfe7[_0xc651('0x2b')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xc651('0x79')](_0xc651('0x91'),_0x3abfe7[_0xc651('0x2b')][_0xc651('0x76')]),'attachments':[{'path':_0x2af156}]}})[_0xc651('0x14')](function(){return _0x34c8e3;})[_0xc651('0x1f')](function(_0x236315){logger[_0xc651('0x1b')](_0x236315);});})[_0xc651('0x14')](respondWithStatusCode(_0xb96031,0xc8))[_0xc651('0x1f')](handleError(_0xb96031,null));};exports['addMessage']=function(_0x589394,_0x476da7){return db[_0xc651('0x5c')][_0xc651('0x42')]({'where':{'id':_0x589394[_0xc651('0x46')]['id']}})[_0xc651('0x14')](handleEntityNotFound(_0x476da7,null))[_0xc651('0x14')](function(_0x540145){if(_0x540145){return _0x540145[_0xc651('0x92')](_0x589394[_0xc651('0x2b')]['ids'],_[_0xc651('0x93')](_0x589394[_0xc651('0x2b')],[_0xc651('0x94'),'id'])||{});}})['then'](respondWithResult(_0x476da7,null))[_0xc651('0x1f')](handleError(_0x476da7,null));};exports[_0xc651('0x95')]=function(_0xdd59f,_0x4b4c03){var _0x73718={'raw':![],'where':{}};var _0x1ad7ae={};var _0x1c24fb={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xc651('0x48')]({'where':{'id':_0xdd59f[_0xc651('0x46')]['id']}})[_0xc651('0x14')](handleEntityNotFound(_0x4b4c03,null))[_0xc651('0x14')](function(_0x585fa9){if(_0x585fa9){_0x1ad7ae[_0xc651('0x37')]=_[_0xc651('0x38')](db['ChatMessage']['rawAttributes']);_0x1ad7ae[_0xc651('0x35')]=_[_0xc651('0x38')](_0xdd59f[_0xc651('0x35')]);_0x1ad7ae[_0xc651('0x39')]=_[_0xc651('0x3a')](_0x1ad7ae['model'],_0x1ad7ae[_0xc651('0x35')]);_0x73718['attributes']=_[_0xc651('0x3a')](_0x1ad7ae[_0xc651('0x37')],qs['fields'](_0xdd59f[_0xc651('0x35')][_0xc651('0x3b')]));_0x73718['attributes']=_0x73718[_0xc651('0x3c')][_0xc651('0x3d')]?_0x73718[_0xc651('0x3c')]:_0x1ad7ae[_0xc651('0x37')];if(!_0xdd59f[_0xc651('0x35')][_0xc651('0x96')](_0xc651('0x97'))){_0x73718[_0xc651('0x24')]=qs[_0xc651('0x24')](_0xdd59f[_0xc651('0x35')][_0xc651('0x24')]);_0x73718[_0xc651('0x98')]=qs[_0xc651('0x98')](_0xdd59f['query']['offset']);}_0x73718[_0xc651('0x99')]=qs['sort'](_0xdd59f[_0xc651('0x35')][_0xc651('0x9a')]);_0x73718[_0xc651('0x9b')]=qs[_0xc651('0x39')](_[_0xc651('0x9c')](_0xdd59f['query'],_0x1ad7ae[_0xc651('0x39')]));_0x73718['where'][_0xc651('0x9d')]=_0x585fa9['id'];if(_0xdd59f['query'][_0xc651('0x9e')]){_0x73718[_0xc651('0x9b')]=_[_0xc651('0x40')](_0x73718[_0xc651('0x9b')],{'$or':_[_0xc651('0x2f')](_0x73718[_0xc651('0x3c')],function(_0xaa680){var _0x1bcbd2={};_0x1bcbd2[_0xaa680]={'$like':'%'+_0xdd59f['query'][_0xc651('0x9e')]+'%'};return _0x1bcbd2;})});}if(_0xdd59f[_0xc651('0x35')][_0xc651('0x9f')]){var _0x59969a=_0xdd59f[_0xc651('0x35')][_0xc651('0x9f')]['split'](',');var _0x44f50f={};_0x44f50f[_0x59969a[0x0]]={'$gte':moment(_0x59969a[0x1])[_0xc651('0x79')](_0xc651('0xa0'))};_0x73718[_0xc651('0x9b')]=_['merge'](_0x73718['where'],_0x44f50f);}_0x73718=_[_0xc651('0x40')]({},_0x73718,_0xdd59f['options']);return db[_0xc651('0x5c')][_0xc651('0x25')]({'where':_0x73718[_0xc651('0x9b')]})[_0xc651('0x14')](function(_0x3074a7){_0x1c24fb[_0xc651('0x25')]=_0x3074a7;if(_0xdd59f[_0xc651('0x35')][_0xc651('0x3e')]){_0x73718['include']=[{'all':!![]}];}return db[_0xc651('0x5c')][_0xc651('0x34')](_0x73718);})['then'](function(_0x36a5f1){_0x1c24fb['rows']=_0x36a5f1;return _0x1c24fb;});}})[_0xc651('0x14')](respondWithFilteredResult(_0x4b4c03,_0x73718))['catch'](handleError(_0x4b4c03,null));};exports[_0xc651('0xa1')]=function(_0x1c08a7,_0x5eb08b){var _0x5a32a1={'where':{}},_0x22be29={},_0x4576b5={'count':0x0,'rows':[]};return db[_0xc651('0x41')][_0xc651('0x48')]({'where':{'id':_0x1c08a7['params']['id']}})[_0xc651('0x14')](handleEntityNotFound(_0x5eb08b,null))['then'](function(_0x41a04c){if(_0x41a04c){_0x22be29[_0xc651('0x37')]=_[_0xc651('0x38')](db[_0xc651('0x5c')][_0xc651('0x30')]);_0x22be29[_0xc651('0x35')]=_[_0xc651('0x38')](_0x1c08a7[_0xc651('0x35')]);_0x22be29[_0xc651('0x39')]=_[_0xc651('0x3a')](_0x22be29[_0xc651('0x37')],_0x22be29[_0xc651('0x35')]);_0x5a32a1[_0xc651('0x3c')]=_['intersection'](_0x22be29[_0xc651('0x37')],qs[_0xc651('0x3b')](_0x1c08a7[_0xc651('0x35')]['fields']));_0x5a32a1[_0xc651('0x3c')]=_0x5a32a1[_0xc651('0x3c')][_0xc651('0x3d')]?_0x5a32a1['attributes']:_0x22be29[_0xc651('0x37')];if(!_0x1c08a7['query'][_0xc651('0x96')](_0xc651('0x97'))){_0x5a32a1['limit']=qs['limit'](_0x1c08a7[_0xc651('0x35')][_0xc651('0x24')]);_0x5a32a1['offset']=qs[_0xc651('0x98')](_0x1c08a7[_0xc651('0x35')][_0xc651('0x98')]);}_0x5a32a1[_0xc651('0x99')]=qs[_0xc651('0x9a')](_0x1c08a7['query']['sort']);_0x5a32a1['where']=qs['filters'](_[_0xc651('0x9c')](_0x1c08a7['query'],_0x22be29[_0xc651('0x39')]));_0x5a32a1[_0xc651('0x9b')][_0xc651('0x9d')]=_0x41a04c['id'];if(_0x1c08a7[_0xc651('0x35')][_0xc651('0x9e')]){_0x5a32a1[_0xc651('0x9b')]=_[_0xc651('0x40')](_0x5a32a1[_0xc651('0x9b')],{'$or':_[_0xc651('0x2f')](_0x5a32a1['attributes'],function(_0x4c9458){var _0x401268={};_0x401268[_0x4c9458]={'$like':'%'+_0x1c08a7[_0xc651('0x35')][_0xc651('0x9e')]+'%'};return _0x401268;})});}_0x5a32a1[_0xc651('0x9b')][_0xc651('0xa2')]=![];if(_0x1c08a7[_0xc651('0x35')]['id']){_0x5a32a1['where']['id']={'$gt':_0x1c08a7[_0xc651('0x35')]['id']};}_0x5a32a1=_['merge']({},_0x5a32a1,_0x1c08a7[_0xc651('0xa3')]);return db[_0xc651('0x5c')][_0xc651('0x25')]({'where':_0x5a32a1[_0xc651('0x9b')]})[_0xc651('0x14')](function(_0x2ac351){_0x4576b5[_0xc651('0x25')]=_0x2ac351;_0x5a32a1['include']=[];if(_0x1c08a7[_0xc651('0x35')][_0xc651('0xa4')]){_0x5a32a1[_0xc651('0x3f')][_0xc651('0xa5')]({'model':db[_0xc651('0x7d')],'as':_0xc651('0x7d'),'attributes':['id',_0xc651('0x4e'),'alias']});}if(_0x1c08a7['query'][_0xc651('0x3e')]){_0x5a32a1[_0xc651('0x3f')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x5a32a1);})[_0xc651('0x14')](function(_0x5743f6){_0x4576b5[_0xc651('0xa6')]=_0x5743f6;return _0x4576b5;});}})['then'](respondWithFilteredResult(_0x5eb08b,_0x5a32a1))[_0xc651('0x1f')](handleError(_0x5eb08b,null));};exports['addTags']=function(_0x4154d1,_0x29c9d3){return db[_0xc651('0x41')][_0xc651('0x42')]({'where':{'id':_0x4154d1[_0xc651('0x46')]['id']}})[_0xc651('0x14')](handleEntityNotFound(_0x29c9d3,null))[_0xc651('0x14')](function(_0x198319){if(_0x198319){return _0x198319[_0xc651('0xa7')](_0x4154d1[_0xc651('0x2b')][_0xc651('0x94')],_[_0xc651('0x93')](_0x4154d1[_0xc651('0x2b')],[_0xc651('0x94'),'id'])||{})[_0xc651('0xa8')](function(){return db[_0xc651('0xa9')][_0xc651('0x34')]({'attributes':['id',_0xc651('0x29'),'color'],'where':{'id':_0x4154d1[_0xc651('0x2b')][_0xc651('0x94')]}});})['then'](function(_0xacb73d){socket['emit'](_0xc651('0xaa'),{'id':Number(_0x4154d1['params']['id']),'tags':_0xacb73d||[]});return{'id':Number(_0x4154d1[_0xc651('0x46')]['id']),'tags':_0xacb73d||[]};});}})['then'](respondWithResult(_0x29c9d3,null))[_0xc651('0x1f')](handleError(_0x29c9d3,null));};exports[_0xc651('0xab')]=function(_0x46d951,_0x49d286){return db[_0xc651('0x41')][_0xc651('0x42')]({'where':{'id':_0x46d951[_0xc651('0x46')]['id']}})[_0xc651('0x14')](handleEntityNotFound(_0x49d286,null))[_0xc651('0x14')](function(_0x4c1d44){if(_0x4c1d44){return _0x4c1d44[_0xc651('0xab')](_0x46d951['query']['ids']);}})[_0xc651('0x14')](respondWithStatusCode(_0x49d286,null))['catch'](handleError(_0x49d286,null));};exports[_0xc651('0x74')]=function(_0x219685,_0x3ef5c0){var _0x16d775=moment()['unix']()[_0xc651('0xac')]();var _0x18af29=path[_0xc651('0x71')](config['root'],_0xc651('0xad'),_0xc651('0xae'),'tmp');var _0x5de025=path['join'](config[_0xc651('0x77')],_0xc651('0xad'),_0xc651('0xae'),_0xc651('0xaf'));var _0x4be6fa=path[_0xc651('0x71')](_0x18af29,_0x16d775);var _0x52bfb6=util[_0xc651('0x79')](_0xc651('0xb0'),_0x219685[_0xc651('0x46')]['id'],_0x16d775);var _0x5a5c43=path['join'](_0x18af29,_0x52bfb6);var _0x4e18ae=[];_0x4e18ae[_0xc651('0xa5')]({'model':db[_0xc651('0x7d')],'as':_0xc651('0x7d'),'attributes':['id',_0xc651('0x4e')],'raw':!![]});_0x4e18ae['push']({'model':db[_0xc651('0x60')],'as':'Contact','attributes':['id',_0xc651('0xb1'),_0xc651('0xb2')],'raw':!![]});if(_0x219685[_0xc651('0x35')][_0xc651('0xaf')]){_0x4e18ae['push']({'model':db[_0xc651('0x6e')],'as':'Attachment','raw':!![]});}var _0x36b297=[{'model':db[_0xc651('0x5c')],'as':_0xc651('0x7c'),'attributes':['id',_0xc651('0x2b'),'createdAt',_0xc651('0x88'),_0xc651('0xa2'),_0xc651('0xb3')],'include':_0x4e18ae}];_0x36b297[_0xc651('0xa5')]({'model':db[_0xc651('0x49')],'as':_0xc651('0xb4'),'attributes':['id',_0xc651('0x29')]});_0x36b297['push']({'model':db[_0xc651('0x7d')],'as':_0xc651('0xb5'),'attributes':['id',_0xc651('0x4e')]});return db[_0xc651('0x41')][_0xc651('0x42')]({'where':{'id':_0x219685[_0xc651('0x46')]['id']},'include':_0x36b297})[_0xc651('0x14')](handleEntityNotFound(_0x3ef5c0,null))[_0xc651('0x14')](function(_0x4d780f){if(_0x4d780f){var _0x14d2be=_0x4d780f[_0xc651('0xb6')]({'plain':!![]});fs['mkdirSync'](_0x4be6fa);var _0x55b265={'channel':_0xc651('0xb7'),'account':_0x14d2be[_0xc651('0xb4')]['name'],'agent':_0x14d2be[_0xc651('0xb5')]?_0x14d2be[_0xc651('0xb5')][_0xc651('0x4e')]:_0xc651('0xb8'),'createdAt':moment(_0x14d2be[_0xc651('0x87')])[_0xc651('0x79')](_0xc651('0xa0'))[_0xc651('0xac')](),'closedAt':_0x14d2be[_0xc651('0x66')]?moment(_0x14d2be[_0xc651('0xb9')])[_0xc651('0x79')](_0xc651('0xa0'))[_0xc651('0xac')]():'','disposition':_0x14d2be['disposition'],'chatInfo':{'browser':_0x14d2be[_0xc651('0xba')],'os':_0x14d2be['osName'],'referer':_0x14d2be['referer'],'customerIp':_0x14d2be[_0xc651('0xbb')],'customerPort':_0x14d2be['customerPort']?_0x14d2be[_0xc651('0xbc')]:_0xc651('0xb8')},'messages':_(_0x14d2be[_0xc651('0x7c')])['tail']()[_0xc651('0x9e')]({'secret':![]})[_0xc651('0x2f')](function(_0x230abc){if(_0x230abc[_0xc651('0x6e')]){var _0x1c961a=path[_0xc651('0x71')](_0x5de025,_0x230abc[_0xc651('0x6e')][_0xc651('0x6b')]);if(fs['existsSync'](_0x1c961a)){fs[_0xc651('0xbd')](_0x1c961a)[_0xc651('0xbe')](fs['createWriteStream'](path[_0xc651('0x71')](_0x4be6fa,_0x230abc['Attachment'][_0xc651('0x6b')])));}}return{'date':moment(_0x230abc[_0xc651('0x87')])[_0xc651('0x79')](_0xc651('0xa0'))['toString'](),'sender':_0x230abc[_0xc651('0x88')]==='out'?_0x230abc['User']?_0x230abc[_0xc651('0x7d')]['fullname']:_0xc651('0x82'):_0x230abc[_0xc651('0x61')][_0xc651('0xb1')]+(_0x230abc[_0xc651('0x61')][_0xc651('0xb2')]?'\x20'+_0x230abc['Contact'][_0xc651('0xb2')]:''),'body':_0x230abc[_0xc651('0x6e')]?_0x230abc['Attachment'][_0xc651('0x6b')]:_0x230abc[_0xc651('0x2b')],'direction':_0x230abc[_0xc651('0x88')]==='out'?'A':'C','secret':_0x230abc['secret'],'read':_0x230abc['read'],'attachment':_0x230abc[_0xc651('0x6e')]};})['value']()};return ejs[_0xc651('0xbf')](path[_0xc651('0x71')](config['root'],_0xc651('0xad'),_0xc651('0xc0'),_0xc651('0xc1')),{'interaction':_0x55b265})[_0xc651('0x14')](function(_0x204aba){var _0x5d5d27=path['join'](_0x4be6fa,_0xc651('0xc2')+_0x14d2be['id']+'-'+_0x16d775+_0xc651('0xc3'));var _0x12e1cc={'path':_0x5d5d27,'channel':_0xc651('0xb7'),'interactionId':_0x14d2be['id']};return pdf[_0xc651('0xc4')](_0x204aba,_0x12e1cc);})[_0xc651('0x14')](function(){return new Promise(function(_0x4349dd,_0x2ba8f0){zipdir(_0x4be6fa,{'saveTo':_0x5a5c43},function(_0x4fc6a2,_0x2b1418){if(_0x4fc6a2)return _0x2ba8f0(_0x4fc6a2);return _0x4349dd(_0x2b1418);});})[_0xc651('0x14')](function(){return new BPromise(function(_0x449682,_0x2b9502){rimraf(_0x4be6fa,function(_0x5b032a){if(_0x5b032a)_0x2b9502(_0x5b032a);return _0x449682();});});})[_0xc651('0x14')](function(){return _0x3ef5c0['download'](_0x5a5c43,_0x52bfb6,function(_0x1aba4d){if(_0x1aba4d){logger[_0xc651('0x1b')](_0xc651('0xc5'),_0x1aba4d);}else{fs[_0xc651('0xc6')](_0x5a5c43);}});});});}else{return _0x3ef5c0[_0xc651('0x20')](0xc8);}})[_0xc651('0x1f')](handleError(_0x3ef5c0,null));}; \ No newline at end of file +var _0x565d=['now','User','ChatWebsiteId','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','MailAccount','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','order','options','push','addTags','omit','spread','Tag','color','chatInteractionTags:save','removeTags','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','toString','closedAt','browserName','osName','referer','customerIp','customerPort','map','existsSync','createReadStream','createWriteStream','value','views','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','name','render','merge','body','agent','interaction','account','index','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','create','find','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','user','fullname','contact','POST','email','isNull','vidaooNote','follow','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format'];(function(_0x3def66,_0x230a16){var _0x28e91e=function(_0x46fe0e){while(--_0x46fe0e){_0x3def66['push'](_0x3def66['shift']());}};_0x28e91e(++_0x230a16);}(_0x565d,0x1f3));var _0xd565=function(_0x5ee390,_0x5edd64){_0x5ee390=_0x5ee390-0x0;var _0x1d7dc4=_0x565d[_0x5ee390];return _0x1d7dc4;};'use strict';var rimraf=require(_0xd565('0x0'));var zipdir=require(_0xd565('0x1'));var rp=require(_0xd565('0x2'));var moment=require(_0xd565('0x3'));var BPromise=require(_0xd565('0x4'));var Mustache=require('mustache');var util=require(_0xd565('0x5'));var path=require(_0xd565('0x6'));var ejs=require(_0xd565('0x7'));var fs=require('fs');var _=require(_0xd565('0x8'));var Redis=require(_0xd565('0x9'));var interaction=require(_0xd565('0xa'));var qs=require(_0xd565('0xb'));var pdf=require(_0xd565('0xc'));var logger=require(_0xd565('0xd'))(_0xd565('0xe'));var config=require(_0xd565('0xf'));var db=require(_0xd565('0x10'))['db'];config[_0xd565('0x11')]=_[_0xd565('0x12')](config[_0xd565('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xd565('0x13'))(new Redis(config['redis']));require(_0xd565('0x14'))[_0xd565('0x15')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd565('0x16')][_0xd565('0x17')]({'port':0x232b});var client9004=jayson[_0xd565('0x16')][_0xd565('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x1ef575,_0x3aca43,_0x3a046a,_0x1214b4){return new BPromise(function(_0x5d6dd1,_0x54b5e4){var _0x22e304=_0x1214b4||client;return _0x22e304[_0xd565('0x18')](_0x1ef575,_0x3a046a)[_0xd565('0x19')](function(_0x374854){logger[_0xd565('0x1a')](_0xd565('0x1b'),_0x3aca43,_0xd565('0x1c'));logger[_0xd565('0x1d')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3aca43,'request\x20sent',JSON[_0xd565('0x1e')](_0x374854));if(_0x374854[_0xd565('0x1f')]){if(_0x374854['error'][_0xd565('0x20')]===0x1f4){logger[_0xd565('0x1f')](_0xd565('0x1b'),_0x3aca43,_0x374854[_0xd565('0x1f')]['message']);return _0x54b5e4(_0x374854['error'][_0xd565('0x21')]);}logger['error'](_0xd565('0x1b'),_0x3aca43,_0x374854[_0xd565('0x1f')][_0xd565('0x21')]);return _0x5d6dd1(_0x374854[_0xd565('0x1f')]['message']);}else{logger[_0xd565('0x1a')](_0xd565('0x1b'),_0x3aca43,_0xd565('0x1c'));_0x5d6dd1(_0x374854[_0xd565('0x22')]['message']);}})[_0xd565('0x23')](function(_0x7722ed){logger[_0xd565('0x1f')](_0xd565('0x1b'),_0x3aca43,_0x7722ed);_0x54b5e4(_0x7722ed);});});}function respondWithStatusCode(_0x1cd195,_0x261bec){_0x261bec=_0x261bec||0xcc;return function(_0x1ca4cc){if(_0x1ca4cc){return _0x1cd195[_0xd565('0x24')](_0x261bec);}return _0x1cd195[_0xd565('0x25')](_0x261bec)[_0xd565('0x26')]();};}function respondWithResult(_0x16db93,_0x252028){_0x252028=_0x252028||0xc8;return function(_0xccdc6c){if(_0xccdc6c){return _0x16db93['status'](_0x252028)[_0xd565('0x27')](_0xccdc6c);}};}function respondWithFilteredResult(_0x25eb45,_0x25094a){return function(_0x11a7db){if(_0x11a7db){var _0x52dd91=typeof _0x25094a[_0xd565('0x28')]===_0xd565('0x29')&&typeof _0x25094a['limit']===_0xd565('0x29');var _0x43e728=_0x11a7db[_0xd565('0x2a')];var _0x1cc9ec=_0x52dd91?0x0:_0x25094a[_0xd565('0x28')];var _0x52e0ed=_0x52dd91?_0x11a7db['count']:_0x25094a[_0xd565('0x28')]+_0x25094a[_0xd565('0x2b')];var _0xe33117;if(_0x52e0ed>=_0x43e728){_0x52e0ed=_0x43e728;_0xe33117=0xc8;}else{_0xe33117=0xce;}_0x25eb45[_0xd565('0x25')](_0xe33117);return _0x25eb45[_0xd565('0x2c')](_0xd565('0x2d'),_0x1cc9ec+'-'+_0x52e0ed+'/'+_0x43e728)['json'](_0x11a7db);}return null;};}function saveUpdates(_0x53b76e){return function(_0x2a192b){if(_0x2a192b){return _0x2a192b[_0xd565('0x2e')](_0x53b76e)['then'](function(_0x4e1d8a){return _0x4e1d8a;});}return null;};}function removeEntity(_0x5ead40){return function(_0xa42576){if(_0xa42576){return _0xa42576[_0xd565('0x2f')]()[_0xd565('0x19')](function(){_0x5ead40[_0xd565('0x25')](0xcc)[_0xd565('0x26')]();});}};}function handleEntityNotFound(_0x24dc63){return function(_0xdddef8){if(!_0xdddef8){_0x24dc63['sendStatus'](0x194);}return _0xdddef8;};}function handleError(_0x308e66,_0x72c9b3){_0x72c9b3=_0x72c9b3||0x1f4;return function(_0x2c6ed4){logger[_0xd565('0x1f')](_0x2c6ed4['stack']);if(_0x2c6ed4['name']){delete _0x2c6ed4[_0xd565('0x30')];}_0x308e66[_0xd565('0x25')](_0x72c9b3)['send'](_0x2c6ed4);};}function getMustacheRender(_0x41870c,_0x428f0f){return Mustache[_0xd565('0x31')](_0x41870c,_[_0xd565('0x32')](_0x428f0f[_0xd565('0x33')],{'contact':_0x428f0f['contact'],'message':_0x428f0f[_0xd565('0x21')],'agent':_0x428f0f[_0xd565('0x34')],'interaction':_0x428f0f[_0xd565('0x35')],'account':_0x428f0f[_0xd565('0x36')]}))||'';}exports[_0xd565('0x37')]=function(_0x108c1b,_0x380b55){var _0x2819ae={};var _0x385ffb=_['map'](db[_0xd565('0x38')][_0xd565('0x39')],function(_0x42a3cb){return{'name':_0x42a3cb[_0xd565('0x3a')],'type':_0x42a3cb[_0xd565('0x3b')]['key']};});_0x2819ae=qs[_0xd565('0x3c')](_0x385ffb,_0x108c1b);return interaction[_0xd565('0x3d')](_0xd565('0x3e'),_0x108c1b['query'],_0x108c1b['user'],_0x2819ae,_0x385ffb)[_0xd565('0x19')](respondWithFilteredResult(_0x380b55,_0x2819ae))[_0xd565('0x23')](handleError(_0x380b55,null));};exports['show']=function(_0x56c779,_0x48f193){var _0x1f8f2e={'raw':![],'where':{'id':_0x56c779[_0xd565('0x3f')]['id']}},_0x2c08a5={};_0x2c08a5[_0xd565('0x40')]=_[_0xd565('0x41')](db[_0xd565('0x38')]['rawAttributes']);_0x2c08a5['query']=_[_0xd565('0x41')](_0x56c779[_0xd565('0x42')]);_0x2c08a5[_0xd565('0x43')]=_[_0xd565('0x44')](_0x2c08a5[_0xd565('0x40')],_0x2c08a5[_0xd565('0x42')]);_0x1f8f2e[_0xd565('0x45')]=_[_0xd565('0x44')](_0x2c08a5['model'],qs[_0xd565('0x46')](_0x56c779[_0xd565('0x42')][_0xd565('0x46')]));_0x1f8f2e[_0xd565('0x45')]=_0x1f8f2e[_0xd565('0x45')][_0xd565('0x47')]?_0x1f8f2e[_0xd565('0x45')]:_0x2c08a5['model'];if(_0x56c779[_0xd565('0x42')][_0xd565('0x48')]){_0x1f8f2e[_0xd565('0x49')]=[{'all':!![]}];}_0x1f8f2e=_[_0xd565('0x32')]({},_0x1f8f2e,_0x56c779['options']);return db[_0xd565('0x38')]['find'](_0x1f8f2e)[_0xd565('0x19')](handleEntityNotFound(_0x48f193,null))['then'](respondWithResult(_0x48f193,null))[_0xd565('0x23')](handleError(_0x48f193,null));};exports[_0xd565('0x4a')]=function(_0x93ec6b,_0x586e4a){return db['ChatInteraction'][_0xd565('0x4a')](_0x93ec6b[_0xd565('0x33')],{})[_0xd565('0x19')](respondWithResult(_0x586e4a,0xc9))[_0xd565('0x23')](handleError(_0x586e4a,null));};exports['update']=function(_0x4ea7c7,_0x3b1caf){if(_0x4ea7c7[_0xd565('0x33')]['id']){delete _0x4ea7c7[_0xd565('0x33')]['id'];}return db[_0xd565('0x38')][_0xd565('0x4b')]({'where':{'id':_0x4ea7c7['params']['id']}})[_0xd565('0x19')](handleEntityNotFound(_0x3b1caf,null))[_0xd565('0x19')](saveUpdates(_0x4ea7c7['body'],null))[_0xd565('0x19')](respondWithResult(_0x3b1caf,null))[_0xd565('0x23')](handleError(_0x3b1caf,null));};exports[_0xd565('0x2f')]=function(_0x35e725,_0x3b14f1){return db[_0xd565('0x38')][_0xd565('0x4b')]({'where':{'id':_0x35e725[_0xd565('0x3f')]['id']}})[_0xd565('0x19')](handleEntityNotFound(_0x3b14f1,null))[_0xd565('0x19')](removeEntity(_0x3b14f1,null))[_0xd565('0x23')](handleError(_0x3b14f1,null));};exports['describe']=function(_0x5bd551,_0x2831be){return db[_0xd565('0x38')]['describe']()[_0xd565('0x19')](respondWithResult(_0x2831be,null))[_0xd565('0x23')](handleError(_0x2831be,null));};exports[_0xd565('0x4c')]=function(_0x4f1c63,_0x1ab15a){var _0x5c802b=_0x4f1c63['params']['id'];var _0x32fbcd;var _0x2c1e80;var _0x40ac86;return db[_0xd565('0x38')]['findOne']({'where':{'id':_0x5c802b}})['then'](function(_0x582856){_0x32fbcd=_0x582856;return db[_0xd565('0x4d')][_0xd565('0x4e')]({'where':{'id':_0x582856['ChatWebsiteId']},'attributes':['id',_0xd565('0x4f'),'vidaooEscalation',_0xd565('0x50'),'vidaooNote',_0xd565('0x51')],'raw':!![]});})[_0xd565('0x19')](function(_0x2c327){if(_0x2c327&&_0x2c327[_0xd565('0x4f')]&&_0x2c327[_0xd565('0x52')]){_0x2c1e80=_0x2c327;var _0x2bc8a8={'interaction':{'id':_0x5c802b},'agent':{'id':_0x4f1c63[_0xd565('0x53')]['id'],'name':_0x4f1c63[_0xd565('0x53')][_0xd565('0x30')],'fullname':_0x4f1c63[_0xd565('0x53')][_0xd565('0x54')],'email':_0x4f1c63[_0xd565('0x53')]['email']},'contact':_0x4f1c63[_0xd565('0x33')][_0xd565('0x55')],'account':_0x4f1c63[_0xd565('0x33')]['account']};var _0x386db5={'rejectUnauthorized':![],'method':_0xd565('0x56'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2c327[_0xd565('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f1c63[_0xd565('0x53')][_0xd565('0x57')]],'buttons':null,'topic':_0x2c1e80[_0xd565('0x50')],'note':_[_0xd565('0x58')](_0x2c1e80[_0xd565('0x59')])?null:getMustacheRender(_0x2c1e80[_0xd565('0x59')],_0x2bc8a8),'metadata':null},'redirect':_0xd565('0x5a'),'json':!![]};try{if(!_[_0xd565('0x58')](_0x2c1e80[_0xd565('0x51')])){var _0x2366f8=getMustacheRender(_0x2c1e80[_0xd565('0x51')],_0x2bc8a8);var _0x281c63=JSON[_0xd565('0x5b')](_0x2366f8);_0x386db5[_0xd565('0x33')][_0xd565('0x5c')]=_0x281c63;}}catch(_0x3d01cc){throw new db['Sequelize'][(_0xd565('0x5d'))](_0xd565('0x5e'));}return rp(_0x386db5);}else{throw new db[(_0xd565('0x5f'))][(_0xd565('0x5d'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd565('0x19')](function(_0x1b71a0){_0x40ac86=_0x1b71a0;if(_0x40ac86['id']){var _0x4b852d={'body':_0x40ac86[_0xd565('0x60')],'ChatWebsiteId':_0x2c1e80['id'],'ChatInteractionId':_0x32fbcd['id'],'direction':_0xd565('0x61'),'UserId':_0x4f1c63[_0xd565('0x53')]['id']};return db[_0xd565('0x62')][_0xd565('0x4a')](_0x4b852d,{});}else{throw new db[(_0xd565('0x5f'))][(_0xd565('0x5d'))](_0xd565('0x63'));}})['then'](function(){return _0x32fbcd[_0xd565('0x64')]({'vidaooSessionId':_0x40ac86['id']});})['then'](respondWithResult(_0x1ab15a,null))[_0xd565('0x23')](handleError(_0x1ab15a,null));};exports[_0xd565('0x65')]=function(_0x2ef829,_0xb86652){if(_0x2ef829[_0xd565('0x33')]['id']){delete _0x2ef829[_0xd565('0x33')]['id'];}return db['ChatInteraction'][_0xd565('0x4b')]({'where':{'id':_0x2ef829['params']['id']},'include':[{'model':db[_0xd565('0x66')],'as':_0xd565('0x67')}]})[_0xd565('0x19')](handleEntityNotFound(_0xb86652,null))[_0xd565('0x19')](saveUpdates(_0x2ef829[_0xd565('0x33')],null))['then'](respondWithResult(_0xb86652,null))[_0xd565('0x23')](handleError(_0xb86652,null));};exports['abandon']=function(_0x4e3308,_0x11245d){if(_0x4e3308['body']['id']){delete _0x4e3308[_0xd565('0x33')]['id'];}return db[_0xd565('0x38')][_0xd565('0x4b')]({'where':{'id':_0x4e3308['params']['id']}})[_0xd565('0x19')](function(_0x4054e5){if(!_0x4054e5){logger[_0xd565('0x1f')](_0xd565('0x68'),_0xd565('0x69'),0x194,_0xd565('0x6a'));_0x11245d[_0xd565('0x24')](0x194);}else{if(_0x4054e5[_0xd565('0x6b')]){throw new db[(_0xd565('0x5f'))][(_0xd565('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x4054e5;})[_0xd565('0x19')](function(_0x5b8691){if(_0x5b8691){return _0x5b8691[_0xd565('0x2e')]({'closed':_0x4e3308['body'][_0xd565('0x6c')],'disposition':_0x4e3308['body'][_0xd565('0x6d')]})[_0xd565('0x19')](function(_0x111079){return _0x111079;});}})[_0xd565('0x19')](function(){return respondWithRpcPromise(_0xd565('0x6e'),'abandon',_0x4e3308[_0xd565('0x33')],client9004);})[_0xd565('0x19')](respondWithResult(_0x11245d,null))[_0xd565('0x23')](handleError(_0x11245d,null));};exports['attachmentUpload']=function(_0x1f73d8,_0x4d19af){_0x1f73d8[_0xd565('0x33')][_0xd565('0x30')]=_0x1f73d8[_0xd565('0x6f')]['originalname'];_0x1f73d8['body'][_0xd565('0x70')]=_0x1f73d8['file'][_0xd565('0x71')];_0x1f73d8['body'][_0xd565('0x3b')]=_0x1f73d8[_0xd565('0x6f')][_0xd565('0x72')];return db['Attachment']['create'](_0x1f73d8[_0xd565('0x33')])[_0xd565('0x19')](respondWithResult(_0x4d19af,0xc9))[_0xd565('0x23')](handleError(_0x4d19af,null));};exports[_0xd565('0x73')]=function(_0x2aca1f,_0x3301f8){return db['ChatInteraction'][_0xd565('0x4e')]({'where':{'id':_0x2aca1f['params']['id']},'raw':!![]})[_0xd565('0x19')](handleEntityNotFound(_0x3301f8,null))[_0xd565('0x19')](function(_0x4d4141){if(_0x4d4141){if(_0x4d4141[_0xd565('0x6c')]){return _0x3301f8[_0xd565('0x25')](0x193)[_0xd565('0x27')]({'status':0x193,'message':_0xd565('0x74')});}return db[_0xd565('0x75')][_0xd565('0x4e')]({'where':{'id':_0x2aca1f[_0xd565('0x42')][_0xd565('0x76')]},'raw':!![]})[_0xd565('0x19')](handleEntityNotFound(_0x3301f8,null));}})[_0xd565('0x19')](function(_0x5e6dc3){if(_0x5e6dc3){var _0x2d1537=_0x5e6dc3[_0xd565('0x77')]!==null;var _0x3edaca=path[_0xd565('0x78')](config[_0xd565('0x79')],_0xd565('0x7a'));if(_0x2d1537){_0x3edaca=path[_0xd565('0x78')](_0x3edaca,_0xd565('0x7b'));}var _0x39f9b9=path['join'](_0x3edaca,_0x5e6dc3[_0xd565('0x70')]);return _0x3301f8[_0xd565('0x7c')](_0x39f9b9);}})[_0xd565('0x23')](handleError(_0x3301f8,null));};exports[_0xd565('0x7d')]=function(_0x1241d6,_0x22c905){var _0x14ba71=null;var _0x580cc8=null;var _0x3bdfff=null;if(_0x1241d6[_0xd565('0x33')]['id']){delete _0x1241d6[_0xd565('0x33')]['id'];}if(_0x1241d6['body'][_0xd565('0x7e')]){_0x3bdfff=path[_0xd565('0x78')](config['root'],'server/files/chat/upload/',util[_0xd565('0x7f')]('transcript-%s.txt',Date[_0xd565('0x80')]()));_0x1241d6[_0xd565('0x33')]['pathTranscript']=_0x3bdfff;}return db[_0xd565('0x38')][_0xd565('0x4b')]({'where':{'id':_0x1241d6[_0xd565('0x3f')]['id']},'include':[{'model':db[_0xd565('0x62')],'as':'Messages','include':[{'model':db[_0xd565('0x81')],'as':'User'}]}]})[_0xd565('0x19')](handleEntityNotFound(_0x22c905,null))[_0xd565('0x19')](saveUpdates(_0x1241d6[_0xd565('0x33')],null))['then'](function(_0x16605b){if(_0x16605b){_0x14ba71=_0x16605b;return db[_0xd565('0x4d')][_0xd565('0x4b')]({'where':{'id':_0x14ba71[_0xd565('0x82')]}});}})[_0xd565('0x19')](function(_0x540599){if(_0x540599){_0x580cc8=_0x540599;return db[_0xd565('0x66')][_0xd565('0x4b')]({'where':{'id':_0x14ba71[_0xd565('0x83')]}});}})['then'](function(_0x31d519){if(_0x31d519){if(_0x3bdfff){var _0x57e0bd=null;for(var _0x2c40ec=0x1;_0x2c40ec<_0x14ba71[_0xd565('0x84')]['length'];++_0x2c40ec){_0x57e0bd=_0x14ba71['Messages'][_0x2c40ec];var _0x51cdf2=_0x57e0bd[_0xd565('0x6b')]?util[_0xd565('0x7f')](_0xd565('0x85'),_0x580cc8[_0xd565('0x86')],_0x57e0bd['UserId']):_0xd565('0x87');var _0x585d90=_0x1241d6['body'][_0xd565('0x88')]||util[_0xd565('0x7f')](_0xd565('0x85'),_0xd565('0x89'),_0x57e0bd[_0xd565('0x83')]);switch(_0x580cc8[_0xd565('0x8a')]){case _0xd565('0x8b'):_0x51cdf2=_0x57e0bd[_0xd565('0x6b')]?util[_0xd565('0x7f')](_0xd565('0x85'),_0x580cc8['agentAlias'],_0x57e0bd[_0xd565('0x6b')]):_0xd565('0x87');break;case _0xd565('0x8c'):_0x51cdf2=_0x57e0bd['UserId']?_0x57e0bd[_0xd565('0x81')][_0xd565('0x8d')]||_0x57e0bd[_0xd565('0x81')]['fullname']:_0xd565('0x87');break;case _0xd565('0x8e'):_0x51cdf2=_0x57e0bd[_0xd565('0x6b')]?_0x57e0bd[_0xd565('0x81')][_0xd565('0x54')]:_0xd565('0x87');break;default:_0x51cdf2=_0x57e0bd['UserId']?util['format'](_0xd565('0x85'),_0x580cc8[_0xd565('0x86')],_0x57e0bd[_0xd565('0x6b')]):'System';}var _0x4bf091=util['format'](_0xd565('0x8f'),moment(_0x57e0bd[_0xd565('0x90')])[_0xd565('0x7f')]('MM/DD/YYYY\x20HH:mm:ss'),_0x57e0bd[_0xd565('0x91')]==='in'?_0x585d90:_0x51cdf2,_0x57e0bd[_0xd565('0x33')]);if(!_0x57e0bd[_0xd565('0x92')]){fs['appendFileSync'](_0x3bdfff,_0x4bf091);}}return db[_0xd565('0x93')][_0xd565('0x4e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xd565('0x94'),'raw':!![]}]}]});}}})[_0xd565('0x19')](function(_0x8b0270){if(!_0x8b0270||!_0x8b0270[_0xd565('0x95')]||!_0x1241d6[_0xd565('0x33')])return _0x14ba71;var _0x26ebf9=_0x8b0270[_0xd565('0x96')]();return respondWithRpcPromise(_0xd565('0x97'),_0xd565('0x98'),{'account':_0x26ebf9,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x8b0270[_0xd565('0x30')],_0x8b0270[_0xd565('0x57')]||_0x8b0270['Smtp']['user']),'to':_0x1241d6[_0xd565('0x33')][_0xd565('0x7e')],'subject':'Mail\x20Transcript','text':util[_0xd565('0x7f')](_0xd565('0x99'),_0x1241d6[_0xd565('0x33')][_0xd565('0x7e')]),'attachments':[{'path':_0x3bdfff}]}})[_0xd565('0x19')](function(){return _0x14ba71;})['catch'](function(_0x2e6487){logger['error'](_0x2e6487);});})[_0xd565('0x19')](respondWithStatusCode(_0x22c905,0xc8))[_0xd565('0x23')](handleError(_0x22c905,null));};exports['addMessage']=function(_0x20685c,_0x4d42cd){return db[_0xd565('0x62')]['find']({'where':{'id':_0x20685c['params']['id']}})[_0xd565('0x19')](handleEntityNotFound(_0x4d42cd,null))[_0xd565('0x19')](function(_0x4c3315){if(_0x4c3315){return _0x4c3315[_0xd565('0x9a')](_0x20685c['body'][_0xd565('0x9b')],_['omit'](_0x20685c[_0xd565('0x33')],['ids','id'])||{});}})[_0xd565('0x19')](respondWithResult(_0x4d42cd,null))[_0xd565('0x23')](handleError(_0x4d42cd,null));};exports[_0xd565('0x9c')]=function(_0x20e9f0,_0x597174){var _0x4231d6={'raw':![],'where':{}};var _0x34b8cb={};var _0x25eec3={'count':0x0,'rows':[]};return db[_0xd565('0x38')][_0xd565('0x4e')]({'where':{'id':_0x20e9f0[_0xd565('0x3f')]['id']}})[_0xd565('0x19')](handleEntityNotFound(_0x597174,null))[_0xd565('0x19')](function(_0x24bc8b){if(_0x24bc8b){_0x34b8cb['model']=_[_0xd565('0x41')](db['ChatMessage'][_0xd565('0x39')]);_0x34b8cb['query']=_[_0xd565('0x41')](_0x20e9f0[_0xd565('0x42')]);_0x34b8cb[_0xd565('0x43')]=_['intersection'](_0x34b8cb[_0xd565('0x40')],_0x34b8cb[_0xd565('0x42')]);_0x4231d6[_0xd565('0x45')]=_['intersection'](_0x34b8cb['model'],qs[_0xd565('0x46')](_0x20e9f0[_0xd565('0x42')][_0xd565('0x46')]));_0x4231d6['attributes']=_0x4231d6[_0xd565('0x45')][_0xd565('0x47')]?_0x4231d6[_0xd565('0x45')]:_0x34b8cb['model'];if(!_0x20e9f0[_0xd565('0x42')][_0xd565('0x9d')](_0xd565('0x9e'))){_0x4231d6['limit']=qs[_0xd565('0x2b')](_0x20e9f0[_0xd565('0x42')][_0xd565('0x2b')]);_0x4231d6['offset']=qs[_0xd565('0x28')](_0x20e9f0['query'][_0xd565('0x28')]);}_0x4231d6['order']=qs[_0xd565('0x9f')](_0x20e9f0['query']['sort']);_0x4231d6[_0xd565('0xa0')]=qs[_0xd565('0x43')](_[_0xd565('0xa1')](_0x20e9f0[_0xd565('0x42')],_0x34b8cb[_0xd565('0x43')]));_0x4231d6[_0xd565('0xa0')][_0xd565('0xa2')]=_0x24bc8b['id'];if(_0x20e9f0[_0xd565('0x42')][_0xd565('0xa3')]){_0x4231d6[_0xd565('0xa0')]=_['merge'](_0x4231d6[_0xd565('0xa0')],{'$or':_['map'](_0x4231d6[_0xd565('0x45')],function(_0x1a626c){var _0x3e2c7b={};_0x3e2c7b[_0x1a626c]={'$like':'%'+_0x20e9f0[_0xd565('0x42')][_0xd565('0xa3')]+'%'};return _0x3e2c7b;})});}if(_0x20e9f0['query'][_0xd565('0xa4')]){var _0x145463=_0x20e9f0[_0xd565('0x42')]['$gte'][_0xd565('0xa5')](',');var _0x9c583={};_0x9c583[_0x145463[0x0]]={'$gte':moment(_0x145463[0x1])[_0xd565('0x7f')](_0xd565('0xa6'))};_0x4231d6['where']=_[_0xd565('0x32')](_0x4231d6[_0xd565('0xa0')],_0x9c583);}_0x4231d6=_[_0xd565('0x32')]({},_0x4231d6,_0x20e9f0['options']);return db[_0xd565('0x62')][_0xd565('0x2a')]({'where':_0x4231d6[_0xd565('0xa0')]})[_0xd565('0x19')](function(_0x28197f){_0x25eec3[_0xd565('0x2a')]=_0x28197f;if(_0x20e9f0['query'][_0xd565('0x48')]){_0x4231d6[_0xd565('0x49')]=[{'all':!![]}];}return db[_0xd565('0x62')][_0xd565('0x3d')](_0x4231d6);})[_0xd565('0x19')](function(_0x545704){_0x25eec3[_0xd565('0xa7')]=_0x545704;return _0x25eec3;});}})['then'](respondWithFilteredResult(_0x597174,_0x4231d6))[_0xd565('0x23')](handleError(_0x597174,null));};exports['getMyMessages']=function(_0x7a10b8,_0x32ad28){var _0x43daf5={'where':{}},_0xf4f022={},_0x16da94={'count':0x0,'rows':[]};return db[_0xd565('0x38')][_0xd565('0x4e')]({'where':{'id':_0x7a10b8[_0xd565('0x3f')]['id']}})['then'](handleEntityNotFound(_0x32ad28,null))[_0xd565('0x19')](function(_0x302b7d){if(_0x302b7d){_0xf4f022[_0xd565('0x40')]=_[_0xd565('0x41')](db[_0xd565('0x62')][_0xd565('0x39')]);_0xf4f022[_0xd565('0x42')]=_['keys'](_0x7a10b8[_0xd565('0x42')]);_0xf4f022['filters']=_['intersection'](_0xf4f022[_0xd565('0x40')],_0xf4f022[_0xd565('0x42')]);_0x43daf5[_0xd565('0x45')]=_[_0xd565('0x44')](_0xf4f022[_0xd565('0x40')],qs[_0xd565('0x46')](_0x7a10b8[_0xd565('0x42')][_0xd565('0x46')]));_0x43daf5[_0xd565('0x45')]=_0x43daf5[_0xd565('0x45')]['length']?_0x43daf5[_0xd565('0x45')]:_0xf4f022[_0xd565('0x40')];if(!_0x7a10b8[_0xd565('0x42')][_0xd565('0x9d')](_0xd565('0x9e'))){_0x43daf5[_0xd565('0x2b')]=qs['limit'](_0x7a10b8[_0xd565('0x42')]['limit']);_0x43daf5['offset']=qs[_0xd565('0x28')](_0x7a10b8[_0xd565('0x42')][_0xd565('0x28')]);}_0x43daf5[_0xd565('0xa8')]=qs[_0xd565('0x9f')](_0x7a10b8[_0xd565('0x42')][_0xd565('0x9f')]);_0x43daf5[_0xd565('0xa0')]=qs[_0xd565('0x43')](_[_0xd565('0xa1')](_0x7a10b8[_0xd565('0x42')],_0xf4f022[_0xd565('0x43')]));_0x43daf5[_0xd565('0xa0')]['ChatInteractionId']=_0x302b7d['id'];if(_0x7a10b8[_0xd565('0x42')][_0xd565('0xa3')]){_0x43daf5[_0xd565('0xa0')]=_[_0xd565('0x32')](_0x43daf5[_0xd565('0xa0')],{'$or':_['map'](_0x43daf5[_0xd565('0x45')],function(_0x1153da){var _0x3a2e68={};_0x3a2e68[_0x1153da]={'$like':'%'+_0x7a10b8[_0xd565('0x42')][_0xd565('0xa3')]+'%'};return _0x3a2e68;})});}_0x43daf5[_0xd565('0xa0')]['secret']=![];if(_0x7a10b8[_0xd565('0x42')]['id']){_0x43daf5[_0xd565('0xa0')]['id']={'$gt':_0x7a10b8[_0xd565('0x42')]['id']};}_0x43daf5=_[_0xd565('0x32')]({},_0x43daf5,_0x7a10b8[_0xd565('0xa9')]);return db[_0xd565('0x62')][_0xd565('0x2a')]({'where':_0x43daf5[_0xd565('0xa0')]})[_0xd565('0x19')](function(_0x5183de){_0x16da94['count']=_0x5183de;_0x43daf5[_0xd565('0x49')]=[];if(_0x7a10b8[_0xd565('0x42')]['includeAgent']){_0x43daf5[_0xd565('0x49')][_0xd565('0xaa')]({'model':db[_0xd565('0x81')],'as':_0xd565('0x81'),'attributes':['id',_0xd565('0x54'),'alias']});}if(_0x7a10b8['query']['includeAll']){_0x43daf5[_0xd565('0x49')]=[{'all':!![]}];}return db[_0xd565('0x62')]['findAll'](_0x43daf5);})[_0xd565('0x19')](function(_0x585176){_0x16da94[_0xd565('0xa7')]=_0x585176;return _0x16da94;});}})[_0xd565('0x19')](respondWithFilteredResult(_0x32ad28,_0x43daf5))[_0xd565('0x23')](handleError(_0x32ad28,null));};exports[_0xd565('0xab')]=function(_0x209f41,_0x502e70){return db[_0xd565('0x38')]['find']({'where':{'id':_0x209f41['params']['id']}})['then'](handleEntityNotFound(_0x502e70,null))[_0xd565('0x19')](function(_0x1ff1cf){if(_0x1ff1cf){return _0x1ff1cf['setTags'](_0x209f41[_0xd565('0x33')]['ids'],_[_0xd565('0xac')](_0x209f41[_0xd565('0x33')],[_0xd565('0x9b'),'id'])||{})[_0xd565('0xad')](function(){return db[_0xd565('0xae')][_0xd565('0x3d')]({'attributes':['id',_0xd565('0x30'),_0xd565('0xaf')],'where':{'id':_0x209f41[_0xd565('0x33')][_0xd565('0x9b')]}});})['then'](function(_0x52797d){socket['emit'](_0xd565('0xb0'),{'id':Number(_0x209f41[_0xd565('0x3f')]['id']),'tags':_0x52797d||[]});return{'id':Number(_0x209f41[_0xd565('0x3f')]['id']),'tags':_0x52797d||[]};});}})[_0xd565('0x19')](respondWithResult(_0x502e70,null))[_0xd565('0x23')](handleError(_0x502e70,null));};exports[_0xd565('0xb1')]=function(_0x184fbe,_0x511445){return db['ChatInteraction']['find']({'where':{'id':_0x184fbe['params']['id']}})['then'](handleEntityNotFound(_0x511445,null))[_0xd565('0x19')](function(_0x3b15b6){if(_0x3b15b6){return _0x3b15b6[_0xd565('0xb1')](_0x184fbe[_0xd565('0x42')][_0xd565('0x9b')]);}})[_0xd565('0x19')](respondWithStatusCode(_0x511445,null))[_0xd565('0x23')](handleError(_0x511445,null));};exports[_0xd565('0x7c')]=function(_0x2fd4b7,_0x3e5503){var _0x42861e=moment()['unix']()['toString']();var _0x422e8b=path[_0xd565('0x78')](config[_0xd565('0x79')],_0xd565('0xb2'),'files',_0xd565('0xb3'));var _0x5a511b=path[_0xd565('0x78')](config[_0xd565('0x79')],_0xd565('0xb2'),_0xd565('0xb4'),_0xd565('0xb5'));var _0x2dd0ec=path[_0xd565('0x78')](_0x422e8b,_0x42861e);var _0x316dbf=util['format'](_0xd565('0xb6'),_0x2fd4b7['params']['id'],_0x42861e);var _0x13c03f=path[_0xd565('0x78')](_0x422e8b,_0x316dbf);var _0x27306e=[];_0x27306e[_0xd565('0xaa')]({'model':db[_0xd565('0x81')],'as':_0xd565('0x81'),'attributes':['id',_0xd565('0x54')],'raw':!![]});_0x27306e[_0xd565('0xaa')]({'model':db[_0xd565('0x66')],'as':_0xd565('0x67'),'attributes':['id',_0xd565('0xb7'),_0xd565('0xb8')],'raw':!![]});if(_0x2fd4b7[_0xd565('0x42')][_0xd565('0xb5')]){_0x27306e[_0xd565('0xaa')]({'model':db[_0xd565('0x75')],'as':'Attachment','raw':!![]});}var _0x32487f=[{'model':db[_0xd565('0x62')],'as':'Messages','attributes':['id',_0xd565('0x33'),_0xd565('0x90'),_0xd565('0x91'),_0xd565('0x92'),_0xd565('0xb9')],'include':_0x27306e}];_0x32487f[_0xd565('0xaa')]({'model':db['ChatWebsite'],'as':_0xd565('0xba'),'attributes':['id','name']});_0x32487f[_0xd565('0xaa')]({'model':db[_0xd565('0x81')],'as':_0xd565('0xbb'),'attributes':['id',_0xd565('0x54')]});return db[_0xd565('0x38')][_0xd565('0x4b')]({'where':{'id':_0x2fd4b7[_0xd565('0x3f')]['id']},'include':_0x32487f})[_0xd565('0x19')](handleEntityNotFound(_0x3e5503,null))[_0xd565('0x19')](function(_0x411bb5){if(_0x411bb5){var _0x21fe52=_0x411bb5[_0xd565('0xbc')]({'plain':!![]});fs[_0xd565('0xbd')](_0x2dd0ec);var _0x473069={'channel':'Chat','account':_0x21fe52[_0xd565('0xba')][_0xd565('0x30')],'agent':_0x21fe52['Owner']?_0x21fe52[_0xd565('0xbb')][_0xd565('0x54')]:'N.A.','createdAt':moment(_0x21fe52[_0xd565('0x90')])[_0xd565('0x7f')](_0xd565('0xa6'))[_0xd565('0xbe')](),'closedAt':_0x21fe52[_0xd565('0x6c')]?moment(_0x21fe52[_0xd565('0xbf')])[_0xd565('0x7f')](_0xd565('0xa6'))['toString']():'','disposition':_0x21fe52['disposition'],'chatInfo':{'browser':_0x21fe52[_0xd565('0xc0')],'os':_0x21fe52[_0xd565('0xc1')],'referer':_0x21fe52[_0xd565('0xc2')],'customerIp':_0x21fe52[_0xd565('0xc3')],'customerPort':_0x21fe52['customerPort']?_0x21fe52[_0xd565('0xc4')]:'N.A.'},'messages':_(_0x21fe52[_0xd565('0x84')])['tail']()['filter']({'secret':![]})[_0xd565('0xc5')](function(_0xe5fbd1){if(_0xe5fbd1[_0xd565('0x75')]){var _0x51d776=path[_0xd565('0x78')](_0x5a511b,_0xe5fbd1['Attachment']['basename']);if(fs[_0xd565('0xc6')](_0x51d776)){fs[_0xd565('0xc7')](_0x51d776)['pipe'](fs[_0xd565('0xc8')](path[_0xd565('0x78')](_0x2dd0ec,_0xe5fbd1[_0xd565('0x75')][_0xd565('0x70')])));}}return{'date':moment(_0xe5fbd1[_0xd565('0x90')])[_0xd565('0x7f')](_0xd565('0xa6'))[_0xd565('0xbe')](),'sender':_0xe5fbd1[_0xd565('0x91')]===_0xd565('0x61')?_0xe5fbd1[_0xd565('0x81')]?_0xe5fbd1[_0xd565('0x81')][_0xd565('0x54')]:_0xd565('0x87'):_0xe5fbd1['Contact'][_0xd565('0xb7')]+(_0xe5fbd1[_0xd565('0x67')][_0xd565('0xb8')]?'\x20'+_0xe5fbd1[_0xd565('0x67')]['lastName']:''),'body':_0xe5fbd1[_0xd565('0x75')]?_0xe5fbd1[_0xd565('0x75')][_0xd565('0x70')]:_0xe5fbd1['body'],'direction':_0xe5fbd1[_0xd565('0x91')]===_0xd565('0x61')?'A':'C','secret':_0xe5fbd1[_0xd565('0x92')],'read':_0xe5fbd1['read'],'attachment':_0xe5fbd1[_0xd565('0x75')]};})[_0xd565('0xc9')]()};return ejs['renderFile'](path[_0xd565('0x78')](config[_0xd565('0x79')],_0xd565('0xb2'),_0xd565('0xca'),_0xd565('0xcb')),{'interaction':_0x473069})[_0xd565('0x19')](function(_0x41a892){var _0x2971bc=path['join'](_0x2dd0ec,_0xd565('0xcc')+_0x21fe52['id']+'-'+_0x42861e+'.pdf');var _0x3a756b={'path':_0x2971bc,'channel':_0xd565('0xcd'),'interactionId':_0x21fe52['id']};return pdf[_0xd565('0xce')](_0x41a892,_0x3a756b);})['then'](function(){return new Promise(function(_0x2e9556,_0x306fa7){zipdir(_0x2dd0ec,{'saveTo':_0x13c03f},function(_0x5081ba,_0x47861b){if(_0x5081ba)return _0x306fa7(_0x5081ba);return _0x2e9556(_0x47861b);});})[_0xd565('0x19')](function(){return new BPromise(function(_0x339db1,_0x416ae2){rimraf(_0x2dd0ec,function(_0x4800ad){if(_0x4800ad)_0x416ae2(_0x4800ad);return _0x339db1();});});})[_0xd565('0x19')](function(){return _0x3e5503[_0xd565('0x7c')](_0x13c03f,_0x316dbf,function(_0x3d8420){if(_0x3d8420){logger[_0xd565('0x1f')](_0xd565('0xcf'),_0x3d8420);}else{fs[_0xd565('0xd0')](_0x13c03f);}});});});}else{return _0x3e5503[_0xd565('0x24')](0xc8);}})[_0xd565('0x23')](handleError(_0x3e5503,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9f36096..795c922 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 _0x2325=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x3baf54,_0x4e198c){var _0x31de77=function(_0x5a1be8){while(--_0x5a1be8){_0x3baf54['push'](_0x3baf54['shift']());}};_0x31de77(++_0x4e198c);}(_0x2325,0x1ee));var _0x5232=function(_0x2224df,_0x4b0c4a){_0x2224df=_0x2224df-0x0;var _0x5391a5=_0x2325[_0x2224df];return _0x5391a5;};'use strict';var EventEmitter=require(_0x5232('0x0'));var ChatInteraction=require(_0x5232('0x1'))['db'][_0x5232('0x2')];var ChatMessage=require(_0x5232('0x1'))['db'][_0x5232('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5232('0x4')](0x0);var events={'afterCreate':_0x5232('0x5'),'afterUpdate':_0x5232('0x6'),'afterDestroy':_0x5232('0x7')};function emitEvent(_0x1a5738){return function(_0x4523d4,_0x4406e0,_0x3e1da2){_0x4523d4[_0x5232('0x8')]({'attributes':['id'],'raw':!![]})[_0x5232('0x9')](function(_0x5c07aa){_0x4523d4['setDataValue']('Users',_0x5c07aa['map'](function(_0x23ac41){return{'id':_0x23ac41['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4523d4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5232('0x9')](function(_0x18ff42){_0x4523d4[_0x5232('0xa')](_0x5232('0xb'),_0x18ff42['length']);ChatInteractionEvents[_0x5232('0xc')](_0x1a5738+':'+_0x4523d4['id'],_0x4523d4);ChatInteractionEvents[_0x5232('0xc')](_0x1a5738,_0x4523d4);_0x3e1da2(null);})[_0x5232('0xd')](_0x3e1da2(null));};}for(var e in events){if(events[_0x5232('0xe')](e)){var event=events[e];ChatInteraction[_0x5232('0xf')](e,emitEvent(event));}}module[_0x5232('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x58d5=['hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','map','then','unreadMessages','length','emit','catch'];(function(_0x49b766,_0x3304bd){var _0x5556d7=function(_0x3ac4c6){while(--_0x3ac4c6){_0x49b766['push'](_0x49b766['shift']());}};_0x5556d7(++_0x3304bd);}(_0x58d5,0x146));var _0x558d=function(_0x31dcfb,_0x24c91c){_0x31dcfb=_0x31dcfb-0x0;var _0x5c9f04=_0x58d5[_0x31dcfb];return _0x5c9f04;};'use strict';var EventEmitter=require(_0x558d('0x0'));var ChatInteraction=require(_0x558d('0x1'))['db'][_0x558d('0x2')];var ChatMessage=require(_0x558d('0x1'))['db'][_0x558d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x558d('0x4')](0x0);var events={'afterCreate':_0x558d('0x5'),'afterUpdate':'update','afterDestroy':_0x558d('0x6')};function emitEvent(_0xe49697){return function(_0x4f1237,_0x3ffda6,_0x291590){_0x4f1237[_0x558d('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1ff123){_0x4f1237[_0x558d('0x8')](_0x558d('0x9'),_0x1ff123[_0x558d('0xa')](function(_0x1e0def){return{'id':_0x1e0def['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4f1237['id'],'direction':'in','read':![]},'raw':!![]});})[_0x558d('0xb')](function(_0x5ddf4b){_0x4f1237[_0x558d('0x8')](_0x558d('0xc'),_0x5ddf4b[_0x558d('0xd')]);ChatInteractionEvents[_0x558d('0xe')](_0xe49697+':'+_0x4f1237['id'],_0x4f1237);ChatInteractionEvents['emit'](_0xe49697,_0x4f1237);_0x291590(null);})[_0x558d('0xf')](_0x291590(null));};}for(var e in events){if(events[_0x558d('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x558d('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 20b9e74..adbbe87 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 _0x6287=['chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','./chatInteraction.attributes','exports','define'];(function(_0x31cb77,_0x51c4bf){var _0x109e49=function(_0x5d3111){while(--_0x5d3111){_0x31cb77['push'](_0x31cb77['shift']());}};_0x109e49(++_0x51c4bf);}(_0x6287,0x97));var _0x7628=function(_0x5ba549,_0x425afd){_0x5ba549=_0x5ba549-0x0;var _0x36e3a1=_0x6287[_0x5ba549];return _0x36e3a1;};'use strict';var _=require('lodash');var util=require(_0x7628('0x0'));var logger=require(_0x7628('0x1'))(_0x7628('0x2'));var moment=require(_0x7628('0x3'));var BPromise=require(_0x7628('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7628('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7628('0x6'));module[_0x7628('0x7')]=function(_0x409c05,_0x3fe156){return _0x409c05[_0x7628('0x8')]('ChatInteraction',attributes,{'tableName':_0x7628('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x74af34,_0x28d532,_0x2a6071){if(_0x74af34[_0x7628('0xa')](_0x7628('0xb'))){_0x74af34[_0x7628('0xc')]=moment()[_0x7628('0xd')](_0x7628('0xe'));}_0x2a6071(null,_0x74af34);}},'charset':'utf8mb4','collate':_0x7628('0xf')});}; \ No newline at end of file +var _0x960d=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','closedAt','format','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x59f201,_0x2bc0a3){var _0x35750d=function(_0x19bd14){while(--_0x19bd14){_0x59f201['push'](_0x59f201['shift']());}};_0x35750d(++_0x2bc0a3);}(_0x960d,0x1cd));var _0xd960=function(_0x346e25,_0x3bd1ad){_0x346e25=_0x346e25-0x0;var _0x1be589=_0x960d[_0x346e25];return _0x1be589;};'use strict';var _=require('lodash');var util=require(_0xd960('0x0'));var logger=require(_0xd960('0x1'))(_0xd960('0x2'));var moment=require('moment');var BPromise=require(_0xd960('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd960('0x4'));var rimraf=require(_0xd960('0x5'));var config=require(_0xd960('0x6'));var attributes=require(_0xd960('0x7'));module[_0xd960('0x8')]=function(_0x104473,_0x55b442){return _0x104473[_0xd960('0x9')](_0xd960('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x565846,_0x51d82c,_0x20caca){if(_0x565846['changed']('closed')){_0x565846[_0xd960('0xb')]=moment()[_0xd960('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x20caca(null,_0x565846);}},'charset':_0xd960('0xd'),'collate':_0xd960('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 8443151..d12fb21 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 _0x4ed3=['AddTagsToChatInteraction','where','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','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','ChatInteraction','update','body','options','raw','attributes','limit','debug'];(function(_0x5aa729,_0x8165c6){var _0x3496ca=function(_0x26703f){while(--_0x26703f){_0x5aa729['push'](_0x5aa729['shift']());}};_0x3496ca(++_0x8165c6);}(_0x4ed3,0x1ea));var _0x34ed=function(_0x4a92a4,_0xb1c3b3){_0x4a92a4=_0x4a92a4-0x0;var _0x4b043f=_0x4ed3[_0x4a92a4];return _0x4b043f;};'use strict';var _=require(_0x34ed('0x0'));var util=require(_0x34ed('0x1'));var moment=require(_0x34ed('0x2'));var BPromise=require(_0x34ed('0x3'));var rs=require(_0x34ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34ed('0x5'))['db'];var utils=require(_0x34ed('0x6'));var logger=require(_0x34ed('0x7'))(_0x34ed('0x8'));var config=require(_0x34ed('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x34ed('0xa')][_0x34ed('0xb')]({'port':0x232a});config[_0x34ed('0xc')]=_[_0x34ed('0xd')](config['redis'],{'host':_0x34ed('0xe'),'port':0x18eb});var socket=require(_0x34ed('0xf'))(new Redis(config['redis']));require(_0x34ed('0x10'))[_0x34ed('0x11')](socket);function respondWithRpcPromise(_0xdd10ab,_0x2944c7,_0x21654b){return new BPromise(function(_0x2e2e11,_0x5d298f){return client['request'](_0xdd10ab,_0x21654b)[_0x34ed('0x12')](function(_0x16ef18){logger[_0x34ed('0x13')](_0x34ed('0x14'),_0x2944c7,_0x34ed('0x15'));logger['debug'](_0x34ed('0x16'),_0x2944c7,'request\x20sent',JSON[_0x34ed('0x17')](_0x16ef18));if(_0x16ef18[_0x34ed('0x18')]){if(_0x16ef18[_0x34ed('0x18')][_0x34ed('0x19')]===0x1f4){logger['error'](_0x34ed('0x14'),_0x2944c7,_0x16ef18['error'][_0x34ed('0x1a')]);return _0x5d298f(_0x16ef18['error']['message']);}logger[_0x34ed('0x18')](_0x34ed('0x14'),_0x2944c7,_0x16ef18[_0x34ed('0x18')][_0x34ed('0x1a')]);return _0x2e2e11(_0x16ef18['error'][_0x34ed('0x1a')]);}else{logger['info'](_0x34ed('0x14'),_0x2944c7,'request\x20sent');_0x2e2e11(_0x16ef18[_0x34ed('0x1b')]['message']);}})[_0x34ed('0x1c')](function(_0x230188){logger[_0x34ed('0x18')](_0x34ed('0x14'),_0x2944c7,_0x230188);_0x5d298f(_0x230188);});});}exports[_0x34ed('0x1d')]=function(_0x1b5fd1){var _0x1804cc=this;return new Promise(function(_0x5684b0,_0x2d632d){return db[_0x34ed('0x1e')][_0x34ed('0x1f')](_0x1b5fd1[_0x34ed('0x20')],{'raw':_0x1b5fd1[_0x34ed('0x21')]?_0x1b5fd1[_0x34ed('0x21')][_0x34ed('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5fd1[_0x34ed('0x21')]?_0x1b5fd1[_0x34ed('0x21')]['where']||null:null,'attributes':_0x1b5fd1[_0x34ed('0x21')]?_0x1b5fd1[_0x34ed('0x21')][_0x34ed('0x23')]||null:null,'limit':_0x1b5fd1[_0x34ed('0x21')]?_0x1b5fd1[_0x34ed('0x21')][_0x34ed('0x24')]||null:null})[_0x34ed('0x12')](function(_0xdad875){logger['info']('UpdateChatInteraction',_0x1b5fd1);logger[_0x34ed('0x25')](_0x34ed('0x1d'),_0x1b5fd1,JSON[_0x34ed('0x17')](_0xdad875));_0x5684b0(_0xdad875);})['catch'](function(_0x27473a){logger['error'](_0x34ed('0x1d'),_0x27473a[_0x34ed('0x1a')],_0x1b5fd1);_0x2d632d(_0x1804cc[_0x34ed('0x18')](0x1f4,_0x27473a[_0x34ed('0x1a')]));});});};exports[_0x34ed('0x26')]=function(_0x158867){return new Promise(function(_0x5a2c5f,_0x59127a){return db['ChatInteraction']['find']({'where':_0x158867[_0x34ed('0x21')]?_0x158867[_0x34ed('0x21')][_0x34ed('0x27')]||null:null})[_0x34ed('0x12')](function(_0x5e9b62){if(_0x5e9b62){return _0x5e9b62['addTags'](_0x158867[_0x34ed('0x20')][_0x34ed('0x28')],_[_0x34ed('0x29')](_0x158867[_0x34ed('0x20')],[_0x34ed('0x28'),'id'])||{});}})[_0x34ed('0x2a')](function(_0x4bb3ae){logger[_0x34ed('0x13')](_0x34ed('0x2b'),_0x158867);logger['debug'](_0x34ed('0x2b'),_0x158867,JSON[_0x34ed('0x17')](_0x4bb3ae));_0x5a2c5f(_0x4bb3ae);})[_0x34ed('0x1c')](function(_0x876ce0){logger[_0x34ed('0x18')](_0x34ed('0x2b'),_0x876ce0['message'],_0x158867);_0x59127a(_this[_0x34ed('0x18')](0x1f4,_0x876ce0[_0x34ed('0x1a')]));});});}; \ No newline at end of file +var _0x89da=['../../mysqldb','../../config/logger','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x9447f1,_0x2c6eba){var _0x4aed96=function(_0x4d78b6){while(--_0x4d78b6){_0x9447f1['push'](_0x9447f1['shift']());}};_0x4aed96(++_0x2c6eba);}(_0x89da,0xa6));var _0xa89d=function(_0xbbbca0,_0x219e6f){_0xbbbca0=_0xbbbca0-0x0;var _0x45fc29=_0x89da[_0xbbbca0];return _0x45fc29;};'use strict';var _=require(_0xa89d('0x0'));var util=require(_0xa89d('0x1'));var moment=require(_0xa89d('0x2'));var BPromise=require(_0xa89d('0x3'));var rs=require(_0xa89d('0x4'));var fs=require('fs');var Redis=require(_0xa89d('0x5'));var db=require(_0xa89d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa89d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa89d('0x8')][_0xa89d('0x9')]({'port':0x232a});config[_0xa89d('0xa')]=_['defaults'](config[_0xa89d('0xa')],{'host':_0xa89d('0xb'),'port':0x18eb});var socket=require(_0xa89d('0xc'))(new Redis(config['redis']));require(_0xa89d('0xd'))[_0xa89d('0xe')](socket);function respondWithRpcPromise(_0x52fc86,_0x199e73,_0x56c945){return new BPromise(function(_0x300390,_0x1b0df3){return client[_0xa89d('0xf')](_0x52fc86,_0x56c945)[_0xa89d('0x10')](function(_0x84f3a6){logger['info'](_0xa89d('0x11'),_0x199e73,_0xa89d('0x12'));logger[_0xa89d('0x13')](_0xa89d('0x14'),_0x199e73,_0xa89d('0x12'),JSON[_0xa89d('0x15')](_0x84f3a6));if(_0x84f3a6[_0xa89d('0x16')]){if(_0x84f3a6['error'][_0xa89d('0x17')]===0x1f4){logger[_0xa89d('0x16')](_0xa89d('0x11'),_0x199e73,_0x84f3a6[_0xa89d('0x16')][_0xa89d('0x18')]);return _0x1b0df3(_0x84f3a6['error'][_0xa89d('0x18')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x199e73,_0x84f3a6['error']['message']);return _0x300390(_0x84f3a6[_0xa89d('0x16')][_0xa89d('0x18')]);}else{logger[_0xa89d('0x19')](_0xa89d('0x11'),_0x199e73,_0xa89d('0x12'));_0x300390(_0x84f3a6[_0xa89d('0x1a')][_0xa89d('0x18')]);}})[_0xa89d('0x1b')](function(_0x5e7325){logger[_0xa89d('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x199e73,_0x5e7325);_0x1b0df3(_0x5e7325);});});}exports[_0xa89d('0x1c')]=function(_0x15a6bc){var _0x3bb56d=this;return new Promise(function(_0xa3d797,_0x2e9864){return db[_0xa89d('0x1d')][_0xa89d('0x1e')](_0x15a6bc[_0xa89d('0x1f')],{'raw':_0x15a6bc[_0xa89d('0x20')]?_0x15a6bc[_0xa89d('0x20')][_0xa89d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15a6bc['options']?_0x15a6bc[_0xa89d('0x20')]['where']||null:null,'attributes':_0x15a6bc[_0xa89d('0x20')]?_0x15a6bc['options'][_0xa89d('0x22')]||null:null,'limit':_0x15a6bc[_0xa89d('0x20')]?_0x15a6bc['options'][_0xa89d('0x23')]||null:null})[_0xa89d('0x10')](function(_0x4111e0){logger['info']('UpdateChatInteraction',_0x15a6bc);logger['debug'](_0xa89d('0x1c'),_0x15a6bc,JSON[_0xa89d('0x15')](_0x4111e0));_0xa3d797(_0x4111e0);})[_0xa89d('0x1b')](function(_0x2b8dad){logger['error'](_0xa89d('0x1c'),_0x2b8dad[_0xa89d('0x18')],_0x15a6bc);_0x2e9864(_0x3bb56d[_0xa89d('0x16')](0x1f4,_0x2b8dad[_0xa89d('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x498d0f){return new Promise(function(_0x16ae72,_0x2b952b){return db[_0xa89d('0x1d')][_0xa89d('0x24')]({'where':_0x498d0f[_0xa89d('0x20')]?_0x498d0f[_0xa89d('0x20')][_0xa89d('0x25')]||null:null})[_0xa89d('0x10')](function(_0x433e3f){if(_0x433e3f){return _0x433e3f[_0xa89d('0x26')](_0x498d0f['body'][_0xa89d('0x27')],_[_0xa89d('0x28')](_0x498d0f[_0xa89d('0x1f')],['ids','id'])||{});}})[_0xa89d('0x29')](function(_0x32f5d5){logger[_0xa89d('0x19')](_0xa89d('0x2a'),_0x498d0f);logger[_0xa89d('0x13')]('AddTags',_0x498d0f,JSON[_0xa89d('0x15')](_0x32f5d5));_0x16ae72(_0x32f5d5);})[_0xa89d('0x1b')](function(_0xf096c){logger[_0xa89d('0x16')](_0xa89d('0x2a'),_0xf096c[_0xa89d('0x18')],_0x498d0f);_0x2b952b(_this['error'](0x1f4,_0xf096c[_0xa89d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index caafdd8..fb5c382 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 _0x9adb=['save','remove','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x332942,_0x5874db){var _0x1df66c=function(_0x3b7c92){while(--_0x3b7c92){_0x332942['push'](_0x332942['shift']());}};_0x1df66c(++_0x5874db);}(_0x9adb,0x1b8));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';var ChatInteractionEvents=require(_0xb9ad('0x0'));var events=[_0xb9ad('0x1'),_0xb9ad('0x2'),'update'];function createListener(_0xd60681,_0x3d794f){return function(_0x3da4c3){_0x3d794f['emit'](_0xd60681,_0x3da4c3);};}function removeListener(_0x5c4c91,_0x2c2831){return function(){ChatInteractionEvents[_0xb9ad('0x3')](_0x5c4c91,_0x2c2831);};}exports[_0xb9ad('0x4')]=function(_0x1bb6bc){for(var _0x5968fb=0x0,_0x5f5a79=events[_0xb9ad('0x5')];_0x5968fb<_0x5f5a79;_0x5968fb++){var _0x17e520=events[_0x5968fb];var _0x5dab38=createListener(_0xb9ad('0x6')+_0x17e520,_0x1bb6bc);ChatInteractionEvents['on'](_0x17e520,_0x5dab38);}}; \ No newline at end of file +var _0xe79a=['register','chatInteraction:','remove','emit','removeListener'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0xe79a,0x70));var _0xae79=function(_0x1d73ab,_0x4db32c){_0x1d73ab=_0x1d73ab-0x0;var _0x2ed1df=_0xe79a[_0x1d73ab];return _0x2ed1df;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xae79('0x0'),'update'];function createListener(_0x9b2c0d,_0x1d8bf8){return function(_0x42d748){_0x1d8bf8[_0xae79('0x1')](_0x9b2c0d,_0x42d748);};}function removeListener(_0x492be8,_0x33b85d){return function(){ChatInteractionEvents[_0xae79('0x2')](_0x492be8,_0x33b85d);};}exports[_0xae79('0x3')]=function(_0x590be7){for(var _0x1a9185=0x0,_0x3a92bf=events['length'];_0x1a9185<_0x3a92bf;_0x1a9185++){var _0x54e61d=events[_0x1a9185];var _0x459e6d=createListener(_0xae79('0x4')+_0x54e61d,_0x590be7);ChatInteractionEvents['on'](_0x54e61d,_0x459e6d);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 6f13c02..8074ca8 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 _0xb4a1=['download','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','post','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download'];(function(_0x4bad42,_0x2c5e2e){var _0x3487bc=function(_0x205662){while(--_0x205662){_0x4bad42['push'](_0x4bad42['shift']());}};_0x3487bc(++_0x2c5e2e);}(_0xb4a1,0xe8));var _0x1b4a=function(_0x83bf,_0x4b3273){_0x83bf=_0x83bf-0x0;var _0x14a6d3=_0xb4a1[_0x83bf];return _0x14a6d3;};'use strict';var multer=require(_0x1b4a('0x0'));var util=require(_0x1b4a('0x1'));var path=require(_0x1b4a('0x2'));var timeout=require(_0x1b4a('0x3'));var express=require(_0x1b4a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1b4a('0x5'));var interaction=require(_0x1b4a('0x6'));var config=require(_0x1b4a('0x7'));var controller=require('./chatInteraction.controller');router[_0x1b4a('0x8')]('/',auth[_0x1b4a('0x9')](),controller[_0x1b4a('0xa')]);router['get'](_0x1b4a('0xb'),auth[_0x1b4a('0x9')](),controller[_0x1b4a('0xc')]);router['get'](_0x1b4a('0xd'),auth[_0x1b4a('0xe')](),controller[_0x1b4a('0xf')]);router[_0x1b4a('0x8')](_0x1b4a('0x10'),auth[_0x1b4a('0xe')](),controller[_0x1b4a('0x11')]);router[_0x1b4a('0x8')](_0x1b4a('0x12'),auth[_0x1b4a('0x9')](),controller[_0x1b4a('0x13')]);router[_0x1b4a('0x8')](_0x1b4a('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x1b4a('0x15')]);router[_0x1b4a('0x8')](_0x1b4a('0x16'),auth[_0x1b4a('0x9')](),controller[_0x1b4a('0x17')]);router['post']('/',auth[_0x1b4a('0x9')](),controller[_0x1b4a('0x18')]);router['post'](_0x1b4a('0x19'),auth[_0x1b4a('0x9')](),controller[_0x1b4a('0x1a')]);var upload=multer({'storage':multer[_0x1b4a('0x1b')]({'destination':function(_0x3aa632,_0x39ad6e,_0x3191fa){_0x3191fa(null,path['join'](config['root'],_0x1b4a('0x1c')));},'filename':function(_0x16593d,_0x3c2253,_0x392d68){_0x392d68(null,util[_0x1b4a('0x1d')](_0x1b4a('0x1e'),Date[_0x1b4a('0x1f')](),_0x3c2253[_0x1b4a('0x20')][_0x1b4a('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1b4a('0x22')](_0x1b4a('0x23'),upload[_0x1b4a('0x24')](_0x1b4a('0x25')),controller[_0x1b4a('0x26')]);router[_0x1b4a('0x22')](_0x1b4a('0x12'),auth[_0x1b4a('0xe')](),controller[_0x1b4a('0x27')]);router['post'](_0x1b4a('0x28'),auth[_0x1b4a('0x9')](),interaction[_0x1b4a('0x29')](_0x1b4a('0x2a'),'chatinteraction:addtags'),controller['addTags']);router[_0x1b4a('0x2b')]('/:id',auth[_0x1b4a('0x9')](),interaction['tracked'](_0x1b4a('0x2a'),'chatinteraction:update'),controller['update']);router['put'](_0x1b4a('0x2c'),controller[_0x1b4a('0x2d')]);router[_0x1b4a('0x2b')](_0x1b4a('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0x1b4a('0x2f')]);router['put'](_0x1b4a('0x30'),controller['close']);router[_0x1b4a('0x31')]('/:id',auth[_0x1b4a('0x9')](),interaction[_0x1b4a('0x29')](_0x1b4a('0x2a'),'chatinteraction:destroy'),controller[_0x1b4a('0x32')]);router[_0x1b4a('0x31')](_0x1b4a('0x28'),auth[_0x1b4a('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x2534=['/:id/close','delete','chatinteraction:destroy','removeTags','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','isChatInteractionAuthorized','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon'];(function(_0x30c06c,_0x253c3d){var _0x5b1d52=function(_0x1a2ca3){while(--_0x1a2ca3){_0x30c06c['push'](_0x30c06c['shift']());}};_0x5b1d52(++_0x253c3d);}(_0x2534,0x8b));var _0x4253=function(_0x2c1e29,_0x82a5e6){_0x2c1e29=_0x2c1e29-0x0;var _0x45c600=_0x2534[_0x2c1e29];return _0x45c600;};'use strict';var multer=require('multer');var util=require(_0x4253('0x0'));var path=require('path');var timeout=require(_0x4253('0x1'));var express=require('express');var router=express[_0x4253('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4253('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4253('0x4'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4253('0x5')](_0x4253('0x6'),auth[_0x4253('0x7')](),controller[_0x4253('0x8')]);router[_0x4253('0x5')](_0x4253('0x9'),auth['isChatInteractionAuthorized'](),controller[_0x4253('0xa')]);router[_0x4253('0x5')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x4253('0xb')]);router[_0x4253('0x5')](_0x4253('0xc'),auth[_0x4253('0x7')](),controller['getMessages']);router[_0x4253('0x5')](_0x4253('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x4253('0xe')]);router['get'](_0x4253('0xf'),auth[_0x4253('0x7')](),controller[_0x4253('0x10')]);router[_0x4253('0x11')]('/',auth[_0x4253('0x7')](),controller[_0x4253('0x12')]);router[_0x4253('0x11')]('/:id/vidaoo',auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4253('0x13')]({'destination':function(_0x2b613c,_0x23350e,_0x4223f8){_0x4223f8(null,path[_0x4253('0x14')](config[_0x4253('0x15')],_0x4253('0x16')));},'filename':function(_0x247f7f,_0xf810f9,_0x499139){_0x499139(null,util[_0x4253('0x17')](_0x4253('0x18'),Date[_0x4253('0x19')](),_0xf810f9['originalname'][_0x4253('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x4253('0x1b'),upload[_0x4253('0x1c')](_0x4253('0x1d')),controller['attachmentUpload']);router[_0x4253('0x11')]('/:id/messages',auth[_0x4253('0x1e')](),controller[_0x4253('0x1f')]);router[_0x4253('0x11')]('/:id/tags',auth[_0x4253('0x7')](),interaction[_0x4253('0x20')](_0x4253('0x21'),_0x4253('0x22')),controller[_0x4253('0x23')]);router[_0x4253('0x24')](_0x4253('0x9'),auth[_0x4253('0x7')](),interaction[_0x4253('0x20')](_0x4253('0x21'),_0x4253('0x25')),controller['update']);router[_0x4253('0x24')](_0x4253('0x26'),controller[_0x4253('0x27')]);router[_0x4253('0x24')]('/:id/abandon',auth[_0x4253('0x1e')](),controller[_0x4253('0x28')]);router['put'](_0x4253('0x29'),controller['close']);router[_0x4253('0x2a')](_0x4253('0x9'),auth[_0x4253('0x7')](),interaction[_0x4253('0x20')](_0x4253('0x21'),_0x4253('0x2b')),controller['destroy']);router['delete']('/:id/tags',auth[_0x4253('0x7')](),controller[_0x4253('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d2edfa8..c751b42 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 _0x393a=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x393a,0xe8));var _0xa393=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0x393a[_0x5f42f1];return _0x5534ee;};'use strict';var Sequelize=require(_0xa393('0x0'));module[_0xa393('0x1')]={'body':{'type':Sequelize[_0xa393('0x2')](_0xa393('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa393('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x83ed=['sequelize','exports','TEXT','BOOLEAN','INTEGER'];(function(_0x496c5b,_0x4d5916){var _0x3d3764=function(_0x4cb006){while(--_0x4cb006){_0x496c5b['push'](_0x496c5b['shift']());}};_0x3d3764(++_0x4d5916);}(_0x83ed,0x1d6));var _0xd83e=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x83ed[_0x2cf2e9];return _0xd3670d;};'use strict';var Sequelize=require(_0xd83e('0x0'));module[_0xd83e('0x1')]={'body':{'type':Sequelize[_0xd83e('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd83e('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd83e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index ae09e37..430d0f3 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 _0x70a7=['Agents','userProfileId','autoAssociation','isEmpty','push','FromId','ToId','read','-createdAt','all','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0xd04d43,_0x184e0d){var _0x127d95=function(_0xee6239){while(--_0xee6239){_0xd04d43['push'](_0xd04d43['shift']());}};_0x127d95(++_0x184e0d);}(_0x70a7,0xea));var _0x770a=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x70a7[_0x23b655];return _0x364b32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x770a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x770a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x770a('0x2'));var Mustache=require(_0x770a('0x3'));var util=require(_0x770a('0x4'));var path=require(_0x770a('0x5'));var sox=require(_0x770a('0x6'));var csv=require('to-csv');var ejs=require(_0x770a('0x7'));var fs=require('fs');var fs_extra=require(_0x770a('0x8'));var _=require('lodash');var squel=require(_0x770a('0x9'));var crypto=require(_0x770a('0xa'));var jsforce=require(_0x770a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x770a('0xc'));var querystring=require(_0x770a('0xd'));var Papa=require(_0x770a('0xe'));var Redis=require(_0x770a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x770a('0x10'));var as=require(_0x770a('0x11'));var hardwareService=require(_0x770a('0x12'));var logger=require(_0x770a('0x13'))('api');var utils=require(_0x770a('0x14'));var config=require(_0x770a('0x15'));var licenseUtil=require(_0x770a('0x16'));var db=require(_0x770a('0x17'))['db'];config[_0x770a('0x18')]=_[_0x770a('0x19')](config[_0x770a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x770a('0x1a'))(new Redis(config[_0x770a('0x18')]));require(_0x770a('0x1b'))['register'](socket);function respondWithStatusCode(_0xc81cfd,_0x2d3868){_0x2d3868=_0x2d3868||0xcc;return function(_0x42290b){if(_0x42290b){return _0xc81cfd[_0x770a('0x1c')](_0x2d3868);}return _0xc81cfd['status'](_0x2d3868)[_0x770a('0x1d')]();};}function respondWithResult(_0x11cc4e,_0x10aae6){_0x10aae6=_0x10aae6||0xc8;return function(_0x56d5ae){if(_0x56d5ae){return _0x11cc4e[_0x770a('0x1e')](_0x10aae6)[_0x770a('0x1f')](_0x56d5ae);}};}function respondWithFilteredResult(_0x5209ac,_0x3d027b){return function(_0x2ade4b){if(_0x2ade4b){var _0x3941bd=typeof _0x3d027b[_0x770a('0x20')]===_0x770a('0x21')&&typeof _0x3d027b[_0x770a('0x22')]===_0x770a('0x21');var _0x4cac9e=_0x2ade4b[_0x770a('0x23')];var _0x19f906=_0x3941bd?0x0:_0x3d027b[_0x770a('0x20')];var _0x45b8b8=_0x3941bd?_0x2ade4b['count']:_0x3d027b[_0x770a('0x20')]+_0x3d027b[_0x770a('0x22')];var _0x4a281e;if(_0x45b8b8>=_0x4cac9e){_0x45b8b8=_0x4cac9e;_0x4a281e=0xc8;}else{_0x4a281e=0xce;}_0x5209ac['status'](_0x4a281e);return _0x5209ac[_0x770a('0x24')]('Content-Range',_0x19f906+'-'+_0x45b8b8+'/'+_0x4cac9e)[_0x770a('0x1f')](_0x2ade4b);}return null;};}function patchUpdates(_0x17cee2){return function(_0x24b983){try{jsonpatch[_0x770a('0x25')](_0x24b983,_0x17cee2,!![]);}catch(_0xb5c44b){return BPromise[_0x770a('0x26')](_0xb5c44b);}return _0x24b983[_0x770a('0x27')]();};}function saveUpdates(_0x262001,_0x1bd1f3){return function(_0x193c98){if(_0x193c98){return _0x193c98[_0x770a('0x28')](_0x262001)[_0x770a('0x29')](function(_0x57dab7){return _0x57dab7;});}return null;};}function removeEntity(_0x131f6e,_0x24997f){return function(_0x225da5){if(_0x225da5){return _0x225da5[_0x770a('0x2a')]()['then'](function(){_0x131f6e[_0x770a('0x1e')](0xcc)[_0x770a('0x1d')]();});}};}function handleEntityNotFound(_0x29052a,_0xa8a0a1){return function(_0x205665){if(!_0x205665){_0x29052a['sendStatus'](0x194);}return _0x205665;};}function handleError(_0x53237b,_0x52d962){_0x52d962=_0x52d962||0x1f4;return function(_0x58ff74){logger[_0x770a('0x2b')](_0x58ff74[_0x770a('0x2c')]);if(_0x58ff74[_0x770a('0x2d')]){delete _0x58ff74[_0x770a('0x2d')];}_0x53237b['status'](_0x52d962)[_0x770a('0x2e')](_0x58ff74);};}exports['index']=function(_0x4eb3d0,_0xa37c99){var _0x328365={},_0x48c996={},_0x465679={'count':0x0,'rows':[]};var _0x59e644=_['map'](db[_0x770a('0x2f')][_0x770a('0x30')],function(_0x2527f7){return{'name':_0x2527f7['fieldName'],'type':_0x2527f7[_0x770a('0x31')][_0x770a('0x32')]};});_0x48c996[_0x770a('0x33')]=_[_0x770a('0x34')](_0x59e644,'name');_0x48c996[_0x770a('0x35')]=_[_0x770a('0x36')](_0x4eb3d0[_0x770a('0x35')]);_0x48c996['filters']=_[_0x770a('0x37')](_0x48c996[_0x770a('0x33')],_0x48c996['query']);_0x328365[_0x770a('0x38')]=_[_0x770a('0x37')](_0x48c996[_0x770a('0x33')],qs['fields'](_0x4eb3d0['query'][_0x770a('0x39')]));_0x328365['attributes']=_0x328365[_0x770a('0x38')]['length']?_0x328365['attributes']:_0x48c996[_0x770a('0x33')];if(!_0x4eb3d0[_0x770a('0x35')][_0x770a('0x3a')]('nolimit')){_0x328365[_0x770a('0x22')]=qs[_0x770a('0x22')](_0x4eb3d0['query'][_0x770a('0x22')]);_0x328365[_0x770a('0x20')]=qs[_0x770a('0x20')](_0x4eb3d0['query'][_0x770a('0x20')]);}_0x328365['order']=qs[_0x770a('0x3b')](_0x4eb3d0[_0x770a('0x35')][_0x770a('0x3b')]);_0x328365[_0x770a('0x3c')]=qs[_0x770a('0x3d')](_[_0x770a('0x3e')](_0x4eb3d0[_0x770a('0x35')],_0x48c996[_0x770a('0x3d')]),_0x59e644);if(_0x4eb3d0[_0x770a('0x35')][_0x770a('0x3f')]){_0x328365['where']=_[_0x770a('0x40')](_0x328365[_0x770a('0x3c')],{'$or':_[_0x770a('0x34')](_0x59e644,function(_0x5951c5){if(_0x5951c5[_0x770a('0x31')]!==_0x770a('0x41')){var _0x43d842={};_0x43d842[_0x5951c5['name']]={'$like':'%'+_0x4eb3d0[_0x770a('0x35')][_0x770a('0x3f')]+'%'};return _0x43d842;}})});}_0x328365=_[_0x770a('0x40')]({},_0x328365,_0x4eb3d0[_0x770a('0x42')]);var _0x261ccb={'where':_0x328365['where']};return db[_0x770a('0x2f')][_0x770a('0x23')](_0x261ccb)[_0x770a('0x29')](function(_0x231481){_0x465679[_0x770a('0x23')]=_0x231481;if(_0x4eb3d0['query'][_0x770a('0x43')]){_0x328365[_0x770a('0x44')]=[{'all':!![]}];}return db[_0x770a('0x2f')][_0x770a('0x45')](_0x328365);})[_0x770a('0x29')](function(_0x2c1be6){_0x465679[_0x770a('0x46')]=_0x2c1be6;return _0x465679;})['then'](respondWithFilteredResult(_0xa37c99,_0x328365))[_0x770a('0x47')](handleError(_0xa37c99,null));};exports[_0x770a('0x48')]=function(_0x2e16d4,_0x4e9dc8){var _0x40d1d7={'raw':!![],'where':{'id':_0x2e16d4[_0x770a('0x49')]['id']}},_0x7c5ad4={};_0x7c5ad4[_0x770a('0x33')]=_[_0x770a('0x36')](db[_0x770a('0x2f')][_0x770a('0x30')]);_0x7c5ad4['query']=_[_0x770a('0x36')](_0x2e16d4[_0x770a('0x35')]);_0x7c5ad4[_0x770a('0x3d')]=_[_0x770a('0x37')](_0x7c5ad4[_0x770a('0x33')],_0x7c5ad4[_0x770a('0x35')]);_0x40d1d7['attributes']=_['intersection'](_0x7c5ad4['model'],qs[_0x770a('0x39')](_0x2e16d4[_0x770a('0x35')][_0x770a('0x39')]));_0x40d1d7[_0x770a('0x38')]=_0x40d1d7[_0x770a('0x38')][_0x770a('0x4a')]?_0x40d1d7[_0x770a('0x38')]:_0x7c5ad4[_0x770a('0x33')];if(_0x2e16d4['query']['includeAll']){_0x40d1d7[_0x770a('0x44')]=[{'all':!![]}];}_0x40d1d7=_['merge']({},_0x40d1d7,_0x2e16d4[_0x770a('0x42')]);return db[_0x770a('0x2f')][_0x770a('0x4b')](_0x40d1d7)[_0x770a('0x29')](handleEntityNotFound(_0x4e9dc8,null))['then'](respondWithResult(_0x4e9dc8,null))[_0x770a('0x47')](handleError(_0x4e9dc8,null));};exports[_0x770a('0x4c')]=function(_0xb6a407,_0x2dfa9e){return db[_0x770a('0x2f')][_0x770a('0x4c')](_0xb6a407[_0x770a('0x4d')],{})[_0x770a('0x29')](respondWithResult(_0x2dfa9e,0xc9))[_0x770a('0x47')](handleError(_0x2dfa9e,null));};exports[_0x770a('0x28')]=function(_0x37eaa0,_0x5a2a6c){if(_0x37eaa0[_0x770a('0x4d')]['id']){delete _0x37eaa0[_0x770a('0x4d')]['id'];}return db[_0x770a('0x2f')][_0x770a('0x4b')]({'where':{'id':_0x37eaa0[_0x770a('0x49')]['id']}})[_0x770a('0x29')](handleEntityNotFound(_0x5a2a6c,null))[_0x770a('0x29')](saveUpdates(_0x37eaa0[_0x770a('0x4d')],null))[_0x770a('0x29')](respondWithResult(_0x5a2a6c,null))[_0x770a('0x47')](handleError(_0x5a2a6c,null));};exports[_0x770a('0x2a')]=function(_0x14d23d,_0x354217){return db['ChatInternalMessage'][_0x770a('0x4b')]({'where':{'id':_0x14d23d[_0x770a('0x49')]['id']}})[_0x770a('0x29')](handleEntityNotFound(_0x354217,null))[_0x770a('0x29')](removeEntity(_0x354217,null))['catch'](handleError(_0x354217,null));};exports[_0x770a('0x4e')]=function(_0x3a3da1,_0x1e0742){return db[_0x770a('0x2f')][_0x770a('0x4e')]()[_0x770a('0x29')](respondWithResult(_0x1e0742,null))[_0x770a('0x47')](handleError(_0x1e0742,null));};function wrapUser(_0x176ee8){return function(_0x39af13){var _0x1e0ab7=_0x176ee8['get']({'plain':!![]});_0x1e0ab7[_0x770a('0x4f')]=[];if(_0x39af13){_0x1e0ab7[_0x770a('0x50')]=_0x39af13[_0x770a('0x51')];_0x1e0ab7['lastMessage']=_0x39af13;}else{_0x1e0ab7[_0x770a('0x50')]=moment(0x0)[_0x770a('0x52')](_0x770a('0x53'));_0x1e0ab7['lastMessage']={};}return _0x1e0ab7;};}exports[_0x770a('0x54')]=function(_0x397f5a,_0x1e4404,_0x1da794){var _0x4d649f=[];return db[_0x770a('0x55')][_0x770a('0x45')]({'where':{'role':[_0x770a('0x56'),_0x770a('0x57'),_0x770a('0x58')]},'attributes':['id',_0x770a('0x59'),_0x770a('0x2d'),'role',_0x770a('0x5a'),_0x770a('0x5b'),_0x770a('0x5c'),_0x770a('0x5d'),'allowmessenger',_0x770a('0x5e')],'order':qs[_0x770a('0x3b')](_0x770a('0x5f')),'include':[{'model':db[_0x770a('0x60')],'as':_0x770a('0x61'),'attributes':['id','name',_0x770a('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x5145db){if(_0x5145db){var _0x457098=_0x397f5a[_0x770a('0x58')][_0x770a('0x62')]({'plain':!![]});if(!_0x457098)throw new Error(_0x770a('0x63'));if(_0x457098[_0x770a('0x64')]===_0x770a('0x58')){return db[_0x770a('0x65')][_0x770a('0x4b')]({'where':{'name':_0x770a('0x66'),'userProfileId':_0x457098[_0x770a('0x67')]},'raw':!![]})[_0x770a('0x29')](function(_0x35a73b){if(_0x35a73b){if(_0x35a73b[_0x770a('0x68')]===0x0){return db['UserProfileResource'][_0x770a('0x45')]({'where':{'sectionId':_0x35a73b['id']},'raw':!![]})[_0x770a('0x29')](function(_0x43cd4c){var _0x37db9f=[];if(_[_0x770a('0x69')](_0x43cd4c)){_0x37db9f=_[_0x770a('0x3f')](_0x5145db,function(_0x24f346){if(_0x24f346['role']!==_0x770a('0x56')){return _0x24f346;}});return _0x37db9f;}else{for(var _0xccd9e7=0x0;_0xccd9e7<_0x5145db['length'];_0xccd9e7++){var _0x35c4ad=_0x5145db[_0xccd9e7];if(_0x35c4ad[_0x770a('0x64')]===_0x770a('0x56')){var _0x556600=_[_0x770a('0x4b')](_0x43cd4c,function(_0x3af767){return _0x3af767['resourceId']===_0x35c4ad['id'];});if(_0x556600)_0x37db9f['push'](_0x35c4ad);}else{_0x37db9f[_0x770a('0x6a')](_0x35c4ad);}}return _0x37db9f;}});}else{return _0x5145db;}}else{var _0x18f262=_[_0x770a('0x3f')](_0x5145db,function(_0x4ad18a){if(_0x4ad18a['role']!==_0x770a('0x56')){return _0x4ad18a;}});return _0x18f262;}});}else{return _0x5145db;}}})[_0x770a('0x29')](function(_0x13b92f){var _0x4f7d2c=[];if(_0x13b92f){_0x4d649f=_0x13b92f;for(var _0x149dd8=0x0;_0x149dd8<_0x13b92f[_0x770a('0x4a')];_0x149dd8+=0x1){_0x4d649f[_0x149dd8][_0x770a('0x4f')]=[];_0x4f7d2c[_0x770a('0x6a')](db['ChatInternalMessage'][_0x770a('0x4b')]({'where':{'FromId':[_0x397f5a[_0x770a('0x58')]['id'],_0x13b92f[_0x149dd8]['id']],'ToId':[_0x397f5a[_0x770a('0x58')]['id'],_0x13b92f[_0x149dd8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x770a('0x6b'),_0x770a('0x6c'),_0x770a('0x6d'),'body'],'order':qs[_0x770a('0x3b')](_0x770a('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x770a('0x29')](wrapUser(_0x13b92f[_0x149dd8])));}return BPromise[_0x770a('0x6f')](_0x4f7d2c);}return[];})[_0x770a('0x29')](function(_0x4fe6f1){return{'rows':_0x4fe6f1,'count':_0x4fe6f1['length']};})[_0x770a('0x29')](respondWithResult(_0x1e4404,null))['catch'](handleError(_0x1e4404,null));}; \ No newline at end of file +var _0x78cd=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','fields','length','include','find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','VoiceQueue','get','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x2233bb,_0x1fd7ed){var _0x4fb754=function(_0x46869f){while(--_0x46869f){_0x2233bb['push'](_0x2233bb['shift']());}};_0x4fb754(++_0x1fd7ed);}(_0x78cd,0xcf));var _0xd78c=function(_0x209eca,_0x2e57d1){_0x209eca=_0x209eca-0x0;var _0x2dad03=_0x78cd[_0x209eca];return _0x2dad03;};'use strict';var emlformat=require(_0xd78c('0x0'));var rimraf=require(_0xd78c('0x1'));var zipdir=require(_0xd78c('0x2'));var jsonpatch=require(_0xd78c('0x3'));var rp=require(_0xd78c('0x4'));var moment=require(_0xd78c('0x5'));var BPromise=require(_0xd78c('0x6'));var Mustache=require(_0xd78c('0x7'));var util=require(_0xd78c('0x8'));var path=require(_0xd78c('0x9'));var sox=require('sox');var csv=require(_0xd78c('0xa'));var ejs=require(_0xd78c('0xb'));var fs=require('fs');var fs_extra=require(_0xd78c('0xc'));var _=require(_0xd78c('0xd'));var squel=require('squel');var crypto=require(_0xd78c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd78c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd78c('0x10'));var Papa=require(_0xd78c('0x11'));var Redis=require(_0xd78c('0x12'));var authService=require(_0xd78c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd78c('0x14'));var hardwareService=require(_0xd78c('0x15'));var logger=require(_0xd78c('0x16'))(_0xd78c('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd78c('0x18'));var db=require(_0xd78c('0x19'))['db'];config[_0xd78c('0x1a')]=_[_0xd78c('0x1b')](config[_0xd78c('0x1a')],{'host':_0xd78c('0x1c'),'port':0x18eb});var socket=require(_0xd78c('0x1d'))(new Redis(config[_0xd78c('0x1a')]));require(_0xd78c('0x1e'))['register'](socket);function respondWithStatusCode(_0x15f61f,_0x4040d6){_0x4040d6=_0x4040d6||0xcc;return function(_0x1b2be7){if(_0x1b2be7){return _0x15f61f['sendStatus'](_0x4040d6);}return _0x15f61f[_0xd78c('0x1f')](_0x4040d6)[_0xd78c('0x20')]();};}function respondWithResult(_0x17b88d,_0x565d9e){_0x565d9e=_0x565d9e||0xc8;return function(_0x4f0f0a){if(_0x4f0f0a){return _0x17b88d['status'](_0x565d9e)[_0xd78c('0x21')](_0x4f0f0a);}};}function respondWithFilteredResult(_0x5b7c7d,_0x2cb5e3){return function(_0xa7f1b){if(_0xa7f1b){var _0x3c503f=typeof _0x2cb5e3[_0xd78c('0x22')]===_0xd78c('0x23')&&typeof _0x2cb5e3[_0xd78c('0x24')]===_0xd78c('0x23');var _0x1d5fa=_0xa7f1b[_0xd78c('0x25')];var _0x10c560=_0x3c503f?0x0:_0x2cb5e3[_0xd78c('0x22')];var _0x58ea72=_0x3c503f?_0xa7f1b[_0xd78c('0x25')]:_0x2cb5e3[_0xd78c('0x22')]+_0x2cb5e3[_0xd78c('0x24')];var _0x4835af;if(_0x58ea72>=_0x1d5fa){_0x58ea72=_0x1d5fa;_0x4835af=0xc8;}else{_0x4835af=0xce;}_0x5b7c7d['status'](_0x4835af);return _0x5b7c7d[_0xd78c('0x26')]('Content-Range',_0x10c560+'-'+_0x58ea72+'/'+_0x1d5fa)[_0xd78c('0x21')](_0xa7f1b);}return null;};}function patchUpdates(_0x4abc00){return function(_0x12717c){try{jsonpatch[_0xd78c('0x27')](_0x12717c,_0x4abc00,!![]);}catch(_0x762593){return BPromise['reject'](_0x762593);}return _0x12717c[_0xd78c('0x28')]();};}function saveUpdates(_0x4384f0,_0x30954d){return function(_0x2446ba){if(_0x2446ba){return _0x2446ba[_0xd78c('0x29')](_0x4384f0)[_0xd78c('0x2a')](function(_0x1a0190){return _0x1a0190;});}return null;};}function removeEntity(_0x23b78b,_0x51e441){return function(_0x3d9b6d){if(_0x3d9b6d){return _0x3d9b6d[_0xd78c('0x2b')]()[_0xd78c('0x2a')](function(){_0x23b78b['status'](0xcc)[_0xd78c('0x20')]();});}};}function handleEntityNotFound(_0x727068,_0x263815){return function(_0x4478d3){if(!_0x4478d3){_0x727068[_0xd78c('0x2c')](0x194);}return _0x4478d3;};}function handleError(_0x107abe,_0x591599){_0x591599=_0x591599||0x1f4;return function(_0x48fae4){logger['error'](_0x48fae4[_0xd78c('0x2d')]);if(_0x48fae4[_0xd78c('0x2e')]){delete _0x48fae4['name'];}_0x107abe[_0xd78c('0x1f')](_0x591599)[_0xd78c('0x2f')](_0x48fae4);};}exports[_0xd78c('0x30')]=function(_0x4e894d,_0x3ac797){var _0x483f89={},_0xb5528e={},_0x570e4b={'count':0x0,'rows':[]};var _0x17d13f=_[_0xd78c('0x31')](db[_0xd78c('0x32')][_0xd78c('0x33')],function(_0x1ddfb9){return{'name':_0x1ddfb9['fieldName'],'type':_0x1ddfb9[_0xd78c('0x34')][_0xd78c('0x35')]};});_0xb5528e[_0xd78c('0x36')]=_[_0xd78c('0x31')](_0x17d13f,_0xd78c('0x2e'));_0xb5528e['query']=_[_0xd78c('0x37')](_0x4e894d[_0xd78c('0x38')]);_0xb5528e[_0xd78c('0x39')]=_[_0xd78c('0x3a')](_0xb5528e[_0xd78c('0x36')],_0xb5528e[_0xd78c('0x38')]);_0x483f89[_0xd78c('0x3b')]=_[_0xd78c('0x3a')](_0xb5528e[_0xd78c('0x36')],qs['fields'](_0x4e894d[_0xd78c('0x38')]['fields']));_0x483f89[_0xd78c('0x3b')]=_0x483f89[_0xd78c('0x3b')]['length']?_0x483f89[_0xd78c('0x3b')]:_0xb5528e['model'];if(!_0x4e894d[_0xd78c('0x38')][_0xd78c('0x3c')](_0xd78c('0x3d'))){_0x483f89['limit']=qs[_0xd78c('0x24')](_0x4e894d[_0xd78c('0x38')]['limit']);_0x483f89['offset']=qs[_0xd78c('0x22')](_0x4e894d[_0xd78c('0x38')]['offset']);}_0x483f89[_0xd78c('0x3e')]=qs[_0xd78c('0x3f')](_0x4e894d[_0xd78c('0x38')][_0xd78c('0x3f')]);_0x483f89[_0xd78c('0x40')]=qs[_0xd78c('0x39')](_['pick'](_0x4e894d[_0xd78c('0x38')],_0xb5528e[_0xd78c('0x39')]),_0x17d13f);if(_0x4e894d['query']['filter']){_0x483f89[_0xd78c('0x40')]=_['merge'](_0x483f89['where'],{'$or':_[_0xd78c('0x31')](_0x17d13f,function(_0x52f0fc){if(_0x52f0fc[_0xd78c('0x34')]!==_0xd78c('0x41')){var _0x19e69d={};_0x19e69d[_0x52f0fc['name']]={'$like':'%'+_0x4e894d[_0xd78c('0x38')][_0xd78c('0x42')]+'%'};return _0x19e69d;}})});}_0x483f89=_[_0xd78c('0x43')]({},_0x483f89,_0x4e894d[_0xd78c('0x44')]);var _0x26081d={'where':_0x483f89[_0xd78c('0x40')]};return db['ChatInternalMessage'][_0xd78c('0x25')](_0x26081d)['then'](function(_0x4f9d17){_0x570e4b[_0xd78c('0x25')]=_0x4f9d17;if(_0x4e894d['query'][_0xd78c('0x45')]){_0x483f89['include']=[{'all':!![]}];}return db[_0xd78c('0x32')]['findAll'](_0x483f89);})[_0xd78c('0x2a')](function(_0x9d3cb2){_0x570e4b[_0xd78c('0x46')]=_0x9d3cb2;return _0x570e4b;})[_0xd78c('0x2a')](respondWithFilteredResult(_0x3ac797,_0x483f89))[_0xd78c('0x47')](handleError(_0x3ac797,null));};exports[_0xd78c('0x48')]=function(_0x1378e0,_0x510c4b){var _0x1bd061={'raw':!![],'where':{'id':_0x1378e0[_0xd78c('0x49')]['id']}},_0xb14681={};_0xb14681[_0xd78c('0x36')]=_[_0xd78c('0x37')](db['ChatInternalMessage']['rawAttributes']);_0xb14681['query']=_['keys'](_0x1378e0[_0xd78c('0x38')]);_0xb14681[_0xd78c('0x39')]=_[_0xd78c('0x3a')](_0xb14681[_0xd78c('0x36')],_0xb14681[_0xd78c('0x38')]);_0x1bd061[_0xd78c('0x3b')]=_[_0xd78c('0x3a')](_0xb14681['model'],qs[_0xd78c('0x4a')](_0x1378e0['query'][_0xd78c('0x4a')]));_0x1bd061[_0xd78c('0x3b')]=_0x1bd061['attributes'][_0xd78c('0x4b')]?_0x1bd061[_0xd78c('0x3b')]:_0xb14681[_0xd78c('0x36')];if(_0x1378e0[_0xd78c('0x38')]['includeAll']){_0x1bd061[_0xd78c('0x4c')]=[{'all':!![]}];}_0x1bd061=_[_0xd78c('0x43')]({},_0x1bd061,_0x1378e0['options']);return db[_0xd78c('0x32')][_0xd78c('0x4d')](_0x1bd061)[_0xd78c('0x2a')](handleEntityNotFound(_0x510c4b,null))[_0xd78c('0x2a')](respondWithResult(_0x510c4b,null))[_0xd78c('0x47')](handleError(_0x510c4b,null));};exports[_0xd78c('0x4e')]=function(_0x281b07,_0x4c47f0){return db['ChatInternalMessage'][_0xd78c('0x4e')](_0x281b07['body'],{})[_0xd78c('0x2a')](respondWithResult(_0x4c47f0,0xc9))[_0xd78c('0x47')](handleError(_0x4c47f0,null));};exports[_0xd78c('0x29')]=function(_0x4828f8,_0x14bc03){if(_0x4828f8[_0xd78c('0x4f')]['id']){delete _0x4828f8[_0xd78c('0x4f')]['id'];}return db[_0xd78c('0x32')][_0xd78c('0x4d')]({'where':{'id':_0x4828f8[_0xd78c('0x49')]['id']}})[_0xd78c('0x2a')](handleEntityNotFound(_0x14bc03,null))['then'](saveUpdates(_0x4828f8['body'],null))[_0xd78c('0x2a')](respondWithResult(_0x14bc03,null))[_0xd78c('0x47')](handleError(_0x14bc03,null));};exports[_0xd78c('0x2b')]=function(_0x5a57f8,_0x270620){return db[_0xd78c('0x32')]['find']({'where':{'id':_0x5a57f8['params']['id']}})[_0xd78c('0x2a')](handleEntityNotFound(_0x270620,null))[_0xd78c('0x2a')](removeEntity(_0x270620,null))[_0xd78c('0x47')](handleError(_0x270620,null));};exports[_0xd78c('0x50')]=function(_0x4d4b64,_0x2825c0){return db[_0xd78c('0x32')][_0xd78c('0x50')]()[_0xd78c('0x2a')](respondWithResult(_0x2825c0,null))[_0xd78c('0x47')](handleError(_0x2825c0,null));};function wrapUser(_0x2765ea){return function(_0x10a6d1){var _0x1267b9=_0x2765ea['get']({'plain':!![]});_0x1267b9[_0xd78c('0x51')]=[];if(_0x10a6d1){_0x1267b9[_0xd78c('0x52')]=_0x10a6d1[_0xd78c('0x53')];_0x1267b9[_0xd78c('0x54')]=_0x10a6d1;}else{_0x1267b9[_0xd78c('0x52')]=moment(0x0)[_0xd78c('0x55')](_0xd78c('0x56'));_0x1267b9[_0xd78c('0x54')]={};}return _0x1267b9;};}exports[_0xd78c('0x57')]=function(_0x8bb1a0,_0x935537,_0x367bfb){var _0x2bf4b2=[];return db[_0xd78c('0x58')][_0xd78c('0x59')]({'where':{'role':['agent',_0xd78c('0x5a'),_0xd78c('0x5b')]},'attributes':['id',_0xd78c('0x5c'),_0xd78c('0x2e'),'role',_0xd78c('0x5d'),_0xd78c('0x5e'),_0xd78c('0x5f'),'lastLoginAt',_0xd78c('0x60'),_0xd78c('0x61')],'order':qs['sort']('-online'),'include':[{'model':db[_0xd78c('0x62')],'as':'VoiceQueues','attributes':['id','name',_0xd78c('0x34')],'through':{'attributes':[]}}]})[_0xd78c('0x2a')](function(_0x442247){if(_0x442247){var _0x1912e4=_0x8bb1a0[_0xd78c('0x5b')][_0xd78c('0x63')]({'plain':!![]});if(!_0x1912e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1912e4[_0xd78c('0x64')]===_0xd78c('0x5b')){return db[_0xd78c('0x65')][_0xd78c('0x4d')]({'where':{'name':_0xd78c('0x66'),'userProfileId':_0x1912e4[_0xd78c('0x67')]},'raw':!![]})[_0xd78c('0x2a')](function(_0x5ad07c){if(_0x5ad07c){if(_0x5ad07c['autoAssociation']===0x0){return db[_0xd78c('0x68')][_0xd78c('0x59')]({'where':{'sectionId':_0x5ad07c['id']},'raw':!![]})[_0xd78c('0x2a')](function(_0x5628f6){var _0xf73a2e=[];if(_[_0xd78c('0x69')](_0x5628f6)){_0xf73a2e=_[_0xd78c('0x42')](_0x442247,function(_0x4d6d64){if(_0x4d6d64[_0xd78c('0x64')]!=='agent'){return _0x4d6d64;}});return _0xf73a2e;}else{for(var _0x3ed513=0x0;_0x3ed513<_0x442247['length'];_0x3ed513++){var _0x315a5c=_0x442247[_0x3ed513];if(_0x315a5c['role']===_0xd78c('0x6a')){var _0x4f9ea7=_[_0xd78c('0x4d')](_0x5628f6,function(_0x3149e7){return _0x3149e7[_0xd78c('0x6b')]===_0x315a5c['id'];});if(_0x4f9ea7)_0xf73a2e['push'](_0x315a5c);}else{_0xf73a2e[_0xd78c('0x6c')](_0x315a5c);}}return _0xf73a2e;}});}else{return _0x442247;}}else{var _0x968963=_[_0xd78c('0x42')](_0x442247,function(_0x59e8fa){if(_0x59e8fa[_0xd78c('0x64')]!==_0xd78c('0x6a')){return _0x59e8fa;}});return _0x968963;}});}else{return _0x442247;}}})[_0xd78c('0x2a')](function(_0x2a0f02){var _0x2c2ee9=[];if(_0x2a0f02){_0x2bf4b2=_0x2a0f02;for(var _0x3d7d38=0x0;_0x3d7d38<_0x2a0f02[_0xd78c('0x4b')];_0x3d7d38+=0x1){_0x2bf4b2[_0x3d7d38]['messages']=[];_0x2c2ee9[_0xd78c('0x6c')](db[_0xd78c('0x32')]['find']({'where':{'FromId':[_0x8bb1a0[_0xd78c('0x5b')]['id'],_0x2a0f02[_0x3d7d38]['id']],'ToId':[_0x8bb1a0[_0xd78c('0x5b')]['id'],_0x2a0f02[_0x3d7d38]['id']],'ChatGroupId':null},'attributes':['id',_0xd78c('0x53'),_0xd78c('0x6d'),_0xd78c('0x6e'),_0xd78c('0x6f'),_0xd78c('0x4f')],'order':qs[_0xd78c('0x3f')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd78c('0x2a')](wrapUser(_0x2a0f02[_0x3d7d38])));}return BPromise[_0xd78c('0x70')](_0x2c2ee9);}return[];})[_0xd78c('0x2a')](function(_0x5757fd){return{'rows':_0x5757fd,'count':_0x5757fd['length']};})['then'](respondWithResult(_0x935537,null))[_0xd78c('0x47')](handleError(_0x935537,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 334a512..45a6234 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 _0x14e9=['../../mysqldb','ChatInternalMessage','emit','hook','events'];(function(_0x3b968a,_0x283bd5){var _0x4a912b=function(_0x48ca2f){while(--_0x48ca2f){_0x3b968a['push'](_0x3b968a['shift']());}};_0x4a912b(++_0x283bd5);}(_0x14e9,0x126));var _0x914e=function(_0x399fcb,_0x302cad){_0x399fcb=_0x399fcb-0x0;var _0x4d5f0f=_0x14e9[_0x399fcb];return _0x4d5f0f;};'use strict';var EventEmitter=require(_0x914e('0x0'));var ChatInternalMessage=require(_0x914e('0x1'))['db'][_0x914e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b6e23){return function(_0x542854,_0x22785a,_0x57c057){ChatInternalMessageEvents[_0x914e('0x3')](_0x1b6e23+':'+_0x542854['id'],_0x542854);ChatInternalMessageEvents['emit'](_0x1b6e23,_0x542854);_0x57c057(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x914e('0x4')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x6755=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x6755,0x193));var _0x5675=function(_0x2ff24c,_0x14a10f){_0x2ff24c=_0x2ff24c-0x0;var _0xad1b68=_0x6755[_0x2ff24c];return _0xad1b68;};'use strict';var EventEmitter=require(_0x5675('0x0'));var ChatInternalMessage=require(_0x5675('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5675('0x2')](0x0);var events={'afterCreate':_0x5675('0x3'),'afterUpdate':'update','afterDestroy':_0x5675('0x4')};function emitEvent(_0x33a71d){return function(_0x507a30,_0x16f508,_0x4a87ab){ChatInternalMessageEvents[_0x5675('0x5')](_0x33a71d+':'+_0x507a30['id'],_0x507a30);ChatInternalMessageEvents[_0x5675('0x5')](_0x33a71d,_0x507a30);_0x4a87ab(null);};}for(var e in events){if(events[_0x5675('0x6')](e)){var event=events[e];ChatInternalMessage[_0x5675('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 00b8d17..374747f 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 _0xcc73=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x43815b,_0x1e6550){var _0x5d5bf0=function(_0x343846){while(--_0x343846){_0x43815b['push'](_0x43815b['shift']());}};_0x5d5bf0(++_0x1e6550);}(_0xcc73,0x195));var _0x3cc7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcc73[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x3cc7('0x0'));var util=require(_0x3cc7('0x1'));var logger=require(_0x3cc7('0x2'))('api');var moment=require(_0x3cc7('0x3'));var BPromise=require(_0x3cc7('0x4'));var rp=require(_0x3cc7('0x5'));var fs=require('fs');var path=require(_0x3cc7('0x6'));var rimraf=require('rimraf');var config=require(_0x3cc7('0x7'));var attributes=require(_0x3cc7('0x8'));module[_0x3cc7('0x9')]=function(_0x567127,_0x262054){return _0x567127[_0x3cc7('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3cc7('0xb'),'collate':_0x3cc7('0xc')});}; \ No newline at end of file +var _0x529c=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','util','../../config/logger','api','path','../../config/environment','./chatInternalMessage.attributes'];(function(_0x242c29,_0x168f0a){var _0x3f4d1c=function(_0x87d119){while(--_0x87d119){_0x242c29['push'](_0x242c29['shift']());}};_0x3f4d1c(++_0x168f0a);}(_0x529c,0x170));var _0xc529=function(_0x542fc9,_0x19be0f){_0x542fc9=_0x542fc9-0x0;var _0x14f212=_0x529c[_0x542fc9];return _0x14f212;};'use strict';var _=require('lodash');var util=require(_0xc529('0x0'));var logger=require(_0xc529('0x1'))(_0xc529('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc529('0x3'));var rimraf=require('rimraf');var config=require(_0xc529('0x4'));var attributes=require(_0xc529('0x5'));module[_0xc529('0x6')]=function(_0x36b6f1,_0x260672){return _0x36b6f1[_0xc529('0x7')](_0xc529('0x8'),attributes,{'tableName':_0xc529('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc529('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 6609998..bedfbc1 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 _0xd91d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xd91d,0x71));var _0xdd91=function(_0x555f6f,_0x1d06d9){_0x555f6f=_0x555f6f-0x0;var _0x5d6623=_0xd91d[_0x555f6f];return _0x5d6623;};'use strict';var _=require(_0xdd91('0x0'));var util=require(_0xdd91('0x1'));var moment=require(_0xdd91('0x2'));var BPromise=require(_0xdd91('0x3'));var rs=require(_0xdd91('0x4'));var fs=require('fs');var Redis=require(_0xdd91('0x5'));var db=require(_0xdd91('0x6'))['db'];var utils=require(_0xdd91('0x7'));var logger=require(_0xdd91('0x8'))(_0xdd91('0x9'));var config=require('../../config/environment');var jayson=require(_0xdd91('0xa'));var client=jayson[_0xdd91('0xb')][_0xdd91('0xc')]({'port':0x232a});config[_0xdd91('0xd')]=_[_0xdd91('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdd91('0xf'))(new Redis(config['redis']));require(_0xdd91('0x10'))[_0xdd91('0x11')](socket);function respondWithRpcPromise(_0x2b718f,_0x3a078d,_0x49c33e){return new BPromise(function(_0x19b021,_0x2a4213){return client[_0xdd91('0x12')](_0x2b718f,_0x49c33e)['then'](function(_0x1a40c4){logger[_0xdd91('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a078d,_0xdd91('0x14'));logger['debug'](_0xdd91('0x15'),_0x3a078d,_0xdd91('0x14'),JSON[_0xdd91('0x16')](_0x1a40c4));if(_0x1a40c4['error']){if(_0x1a40c4[_0xdd91('0x17')][_0xdd91('0x18')]===0x1f4){logger[_0xdd91('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a078d,_0x1a40c4['error'][_0xdd91('0x19')]);return _0x2a4213(_0x1a40c4[_0xdd91('0x17')][_0xdd91('0x19')]);}logger['error'](_0xdd91('0x1a'),_0x3a078d,_0x1a40c4[_0xdd91('0x17')][_0xdd91('0x19')]);return _0x19b021(_0x1a40c4[_0xdd91('0x17')]['message']);}else{logger[_0xdd91('0x13')](_0xdd91('0x1a'),_0x3a078d,'request\x20sent');_0x19b021(_0x1a40c4[_0xdd91('0x1b')]['message']);}})[_0xdd91('0x1c')](function(_0x3e957d){logger[_0xdd91('0x17')](_0xdd91('0x1a'),_0x3a078d,_0x3e957d);_0x2a4213(_0x3e957d);});});} \ No newline at end of file +var _0xaff8=['register','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaff8,0x78));var _0x8aff=function(_0x4cd22f,_0x57c3ea){_0x4cd22f=_0x4cd22f-0x0;var _0x2342d3=_0xaff8[_0x4cd22f];return _0x2342d3;};'use strict';var _=require(_0x8aff('0x0'));var util=require('util');var moment=require(_0x8aff('0x1'));var BPromise=require(_0x8aff('0x2'));var rs=require(_0x8aff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8aff('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8aff('0x5'));var config=require(_0x8aff('0x6'));var jayson=require(_0x8aff('0x7'));var client=jayson[_0x8aff('0x8')][_0x8aff('0x9')]({'port':0x232a});config['redis']=_[_0x8aff('0xa')](config['redis'],{'host':_0x8aff('0xb'),'port':0x18eb});var socket=require(_0x8aff('0xc'))(new Redis(config[_0x8aff('0xd')]));require(_0x8aff('0xe'))[_0x8aff('0xf')](socket);function respondWithRpcPromise(_0x3b8a8c,_0x1e6747,_0x4a8b09){return new BPromise(function(_0x3ecdc9,_0x575fe7){return client['request'](_0x3b8a8c,_0x4a8b09)[_0x8aff('0x10')](function(_0x549613){logger[_0x8aff('0x11')](_0x8aff('0x12'),_0x1e6747,'request\x20sent');logger['debug'](_0x8aff('0x13'),_0x1e6747,_0x8aff('0x14'),JSON[_0x8aff('0x15')](_0x549613));if(_0x549613[_0x8aff('0x16')]){if(_0x549613[_0x8aff('0x16')][_0x8aff('0x17')]===0x1f4){logger[_0x8aff('0x16')](_0x8aff('0x12'),_0x1e6747,_0x549613[_0x8aff('0x16')]['message']);return _0x575fe7(_0x549613[_0x8aff('0x16')][_0x8aff('0x18')]);}logger[_0x8aff('0x16')](_0x8aff('0x12'),_0x1e6747,_0x549613[_0x8aff('0x16')][_0x8aff('0x18')]);return _0x3ecdc9(_0x549613['error'][_0x8aff('0x18')]);}else{logger[_0x8aff('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1e6747,_0x8aff('0x14'));_0x3ecdc9(_0x549613[_0x8aff('0x19')][_0x8aff('0x18')]);}})[_0x8aff('0x1a')](function(_0x2ee920){logger[_0x8aff('0x16')](_0x8aff('0x12'),_0x1e6747,_0x2ee920);_0x575fe7(_0x2ee920);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 92f3aa6..d1f8624 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 _0x9a8e=['length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener','register'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9a8e,0x132));var _0xe9a8=function(_0x459dd0,_0x69ad60){_0x459dd0=_0x459dd0-0x0;var _0x515fd6=_0x9a8e[_0x459dd0];return _0x515fd6;};'use strict';var ChatInternalMessageEvents=require(_0xe9a8('0x0'));var events=['save',_0xe9a8('0x1'),_0xe9a8('0x2')];function createListener(_0x285d89,_0x56f613){return function(_0x3fbb9d){_0x56f613[_0xe9a8('0x3')](_0x285d89,_0x3fbb9d);};}function removeListener(_0x44b799,_0x548162){return function(){ChatInternalMessageEvents[_0xe9a8('0x4')](_0x44b799,_0x548162);};}exports[_0xe9a8('0x5')]=function(_0x59e1e5){for(var _0x5a903f=0x0,_0x3cc785=events[_0xe9a8('0x6')];_0x5a903f<_0x3cc785;_0x5a903f++){var _0x3bf5cb=events[_0x5a903f];var _0x4ed0cc=createListener(_0xe9a8('0x7')+_0x3bf5cb,_0x59e1e5);ChatInternalMessageEvents['on'](_0x3bf5cb,_0x4ed0cc);}}; \ No newline at end of file +var _0x5073=['save','remove','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x1db506,_0x1a4765){var _0x398baf=function(_0x47fbbb){while(--_0x47fbbb){_0x1db506['push'](_0x1db506['shift']());}};_0x398baf(++_0x1a4765);}(_0x5073,0x157));var _0x3507=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0x5073[_0x5645ad];return _0x17d292;};'use strict';var ChatInternalMessageEvents=require(_0x3507('0x0'));var events=[_0x3507('0x1'),_0x3507('0x2'),_0x3507('0x3')];function createListener(_0x3cb018,_0x5ded8d){return function(_0x240145){_0x5ded8d[_0x3507('0x4')](_0x3cb018,_0x240145);};}function removeListener(_0x384dad,_0x3fe81f){return function(){ChatInternalMessageEvents['removeListener'](_0x384dad,_0x3fe81f);};}exports[_0x3507('0x5')]=function(_0x1f31e1){for(var _0x916f32=0x0,_0x48ed0d=events[_0x3507('0x6')];_0x916f32<_0x48ed0d;_0x916f32++){var _0x464be5=events[_0x916f32];var _0x49a6bd=createListener(_0x3507('0x7')+_0x464be5,_0x1f31e1);ChatInternalMessageEvents['on'](_0x464be5,_0x49a6bd);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a722b4d..a2e878d 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 _0x9ee5=['/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe'];(function(_0x4e38fd,_0x13d776){var _0x2fe8b7=function(_0x22127a){while(--_0x22127a){_0x4e38fd['push'](_0x4e38fd['shift']());}};_0x2fe8b7(++_0x13d776);}(_0x9ee5,0x82));var _0x59ee=function(_0x453466,_0x21ec45){_0x453466=_0x453466-0x0;var _0x8d2baf=_0x9ee5[_0x453466];return _0x8d2baf;};'use strict';var multer=require(_0x59ee('0x0'));var util=require(_0x59ee('0x1'));var path=require(_0x59ee('0x2'));var timeout=require(_0x59ee('0x3'));var express=require(_0x59ee('0x4'));var router=express[_0x59ee('0x5')]();var fs_extra=require(_0x59ee('0x6'));var auth=require(_0x59ee('0x7'));var interaction=require(_0x59ee('0x8'));var config=require(_0x59ee('0x9'));var controller=require(_0x59ee('0xa'));router[_0x59ee('0xb')]('/',auth[_0x59ee('0xc')](),controller['index']);router[_0x59ee('0xb')](_0x59ee('0xd'),auth[_0x59ee('0xc')](),controller['describe']);router[_0x59ee('0xb')](_0x59ee('0xe'),auth[_0x59ee('0xc')](),controller[_0x59ee('0xf')]);router[_0x59ee('0xb')](_0x59ee('0x10'),auth[_0x59ee('0xc')](),controller[_0x59ee('0x11')]);router[_0x59ee('0x12')]('/',auth[_0x59ee('0xc')](),controller[_0x59ee('0x13')]);router['put'](_0x59ee('0x10'),controller[_0x59ee('0x14')]);router[_0x59ee('0x15')](_0x59ee('0x10'),auth[_0x59ee('0xc')](),controller[_0x59ee('0x16')]);module[_0x59ee('0x17')]=router; \ No newline at end of file +var _0xcf31=['put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xcf31,0x7b));var _0x1cf3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcf31[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1cf3('0x0'));var util=require(_0x1cf3('0x1'));var path=require(_0x1cf3('0x2'));var timeout=require(_0x1cf3('0x3'));var express=require(_0x1cf3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cf3('0x5'));var interaction=require(_0x1cf3('0x6'));var config=require(_0x1cf3('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x1cf3('0x8')]('/',auth[_0x1cf3('0x9')](),controller[_0x1cf3('0xa')]);router[_0x1cf3('0x8')](_0x1cf3('0xb'),auth[_0x1cf3('0x9')](),controller[_0x1cf3('0xc')]);router[_0x1cf3('0x8')]('/users',auth['isAuthenticated'](),controller[_0x1cf3('0xd')]);router['get'](_0x1cf3('0xe'),auth['isAuthenticated'](),controller[_0x1cf3('0xf')]);router[_0x1cf3('0x10')]('/',auth[_0x1cf3('0x9')](),controller['create']);router[_0x1cf3('0x11')](_0x1cf3('0xe'),controller['update']);router[_0x1cf3('0x12')]('/:id',auth[_0x1cf3('0x9')](),controller['destroy']);module[_0x1cf3('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2098d7f..f4ebcb7 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 _0xf17f=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','out'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf17f,0x113));var _0xff17=function(_0x47159c,_0x1c8216){_0x47159c=_0x47159c-0x0;var _0x454dbe=_0xf17f[_0x47159c];return _0x454dbe;};'use strict';var Sequelize=require(_0xff17('0x0'));module[_0xff17('0x1')]={'body':{'type':Sequelize[_0xff17('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xff17('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xff17('0x4')),'defaultValue':_0xff17('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xff17('0x5')]},'providerName':{'type':Sequelize[_0xff17('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf7b4=['STRING','TEXT','sequelize','medium','BOOLEAN','out','DATE'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xf7b4,0x152));var _0x4f7b=function(_0x44ba3d,_0x363415){_0x44ba3d=_0x44ba3d-0x0;var _0x350ad9=_0xf7b4[_0x44ba3d];return _0x350ad9;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4f7b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4f7b('0x3')),'defaultValue':_0x4f7b('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4f7b('0x4')]},'providerName':{'type':Sequelize[_0x4f7b('0x5')]},'providerResponse':{'type':Sequelize[_0x4f7b('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index aa5f976..488a559 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 _0x0feb=['name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatMessage','findAll','show','params','includeAll','find','create','body','destroy','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','User','email','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update'];(function(_0x4d8c71,_0xbe137e){var _0xb96294=function(_0x3e9ac1){while(--_0x3e9ac1){_0x4d8c71['push'](_0x4d8c71['shift']());}};_0xb96294(++_0xbe137e);}(_0x0feb,0x152));var _0xb0fe=function(_0x1bfd7d,_0x4a9565){_0x1bfd7d=_0x1bfd7d-0x0;var _0x558466=_0x0feb[_0x1bfd7d];return _0x558466;};'use strict';var emlformat=require(_0xb0fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0fe('0x1'));var jsonpatch=require(_0xb0fe('0x2'));var rp=require(_0xb0fe('0x3'));var moment=require(_0xb0fe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb0fe('0x5'));var path=require(_0xb0fe('0x6'));var sox=require(_0xb0fe('0x7'));var csv=require(_0xb0fe('0x8'));var ejs=require(_0xb0fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0fe('0xa'));var squel=require(_0xb0fe('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0fe('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb0fe('0xd'));var Papa=require(_0xb0fe('0xe'));var Redis=require(_0xb0fe('0xf'));var authService=require(_0xb0fe('0x10'));var qs=require(_0xb0fe('0x11'));var as=require(_0xb0fe('0x12'));var hardwareService=require(_0xb0fe('0x13'));var logger=require(_0xb0fe('0x14'))(_0xb0fe('0x15'));var utils=require(_0xb0fe('0x16'));var config=require(_0xb0fe('0x17'));var licenseUtil=require(_0xb0fe('0x18'));var db=require('../../mysqldb')['db'];config[_0xb0fe('0x19')]=_[_0xb0fe('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb0fe('0x1b'))(new Redis(config['redis']));require(_0xb0fe('0x1c'))[_0xb0fe('0x1d')](socket);var jayson=require(_0xb0fe('0x1e'));var client=jayson[_0xb0fe('0x1f')][_0xb0fe('0x20')]({'port':0x232c});var client9002=jayson[_0xb0fe('0x1f')][_0xb0fe('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xda710f,_0x10bbea,_0x54742f,_0x863ede){return new BPromise(function(_0x87c8ef,_0xcd4719){var _0x3b3e6c=_0x863ede||client;return _0x3b3e6c[_0xb0fe('0x21')](_0xda710f,_0x54742f)[_0xb0fe('0x22')](function(_0x5399a9){logger[_0xb0fe('0x23')]('ChatMessage,\x20%s,\x20%s',_0x10bbea,_0xb0fe('0x24'));logger[_0xb0fe('0x25')](_0xb0fe('0x26'),_0x10bbea,'request\x20sent',JSON[_0xb0fe('0x27')](_0x5399a9));if(_0x5399a9[_0xb0fe('0x28')]){if(_0x5399a9[_0xb0fe('0x28')][_0xb0fe('0x29')]===0x1f4){logger[_0xb0fe('0x28')](_0xb0fe('0x2a'),_0x10bbea,_0x5399a9[_0xb0fe('0x28')]['message']);return _0xcd4719(_0x5399a9[_0xb0fe('0x28')][_0xb0fe('0x2b')]);}logger[_0xb0fe('0x28')]('ChatMessage,\x20%s,\x20%s',_0x10bbea,_0x5399a9['error'][_0xb0fe('0x2b')]);return _0x87c8ef(_0x5399a9[_0xb0fe('0x28')][_0xb0fe('0x2b')]);}else{logger['info'](_0xb0fe('0x2a'),_0x10bbea,_0xb0fe('0x24'));_0x87c8ef(_0x5399a9['result'][_0xb0fe('0x2b')]);}})[_0xb0fe('0x2c')](function(_0x186d87){logger[_0xb0fe('0x28')](_0xb0fe('0x2a'),_0x10bbea,_0x186d87);_0xcd4719(_0x186d87);});});}function respondWithStatusCode(_0x4f28be,_0x4c5256){_0x4c5256=_0x4c5256||0xcc;return function(_0x1185a2){if(_0x1185a2){return _0x4f28be[_0xb0fe('0x2d')](_0x4c5256);}return _0x4f28be[_0xb0fe('0x2e')](_0x4c5256)[_0xb0fe('0x2f')]();};}function respondWithResult(_0x5e9b29,_0x5075d0){_0x5075d0=_0x5075d0||0xc8;return function(_0x20d933){if(_0x20d933){return _0x5e9b29[_0xb0fe('0x2e')](_0x5075d0)[_0xb0fe('0x30')](_0x20d933);}};}function respondWithFilteredResult(_0x2a42cc,_0x2f0030){return function(_0x24c803){if(_0x24c803){var _0xf46387=typeof _0x2f0030[_0xb0fe('0x31')]===_0xb0fe('0x32')&&typeof _0x2f0030['limit']==='undefined';var _0x16f055=_0x24c803[_0xb0fe('0x33')];var _0x393853=_0xf46387?0x0:_0x2f0030[_0xb0fe('0x31')];var _0x2ab5e1=_0xf46387?_0x24c803[_0xb0fe('0x33')]:_0x2f0030['offset']+_0x2f0030[_0xb0fe('0x34')];var _0x242f5e;if(_0x2ab5e1>=_0x16f055){_0x2ab5e1=_0x16f055;_0x242f5e=0xc8;}else{_0x242f5e=0xce;}_0x2a42cc[_0xb0fe('0x2e')](_0x242f5e);return _0x2a42cc[_0xb0fe('0x35')](_0xb0fe('0x36'),_0x393853+'-'+_0x2ab5e1+'/'+_0x16f055)[_0xb0fe('0x30')](_0x24c803);}return null;};}function patchUpdates(_0x6a5380){return function(_0x4beceb){try{jsonpatch[_0xb0fe('0x37')](_0x4beceb,_0x6a5380,!![]);}catch(_0x196a8b){return BPromise[_0xb0fe('0x38')](_0x196a8b);}return _0x4beceb['save']();};}function saveUpdates(_0x5f5090,_0x3077a5){return function(_0x25d0ee){if(_0x25d0ee){return _0x25d0ee[_0xb0fe('0x39')](_0x5f5090)['then'](function(_0x356fc5){return _0x356fc5;});}return null;};}function removeEntity(_0x307857,_0xf3e291){return function(_0x2e3265){if(_0x2e3265){return _0x2e3265['destroy']()[_0xb0fe('0x22')](function(){_0x307857[_0xb0fe('0x2e')](0xcc)[_0xb0fe('0x2f')]();});}};}function handleEntityNotFound(_0x2d3cda,_0xfa7031){return function(_0x2f18d4){if(!_0x2f18d4){_0x2d3cda[_0xb0fe('0x2d')](0x194);}return _0x2f18d4;};}function handleError(_0x4f5f66,_0xc9f630){_0xc9f630=_0xc9f630||0x1f4;return function(_0x3d55cf){logger[_0xb0fe('0x28')](_0x3d55cf['stack']);if(_0x3d55cf[_0xb0fe('0x3a')]){delete _0x3d55cf[_0xb0fe('0x3a')];}_0x4f5f66[_0xb0fe('0x2e')](_0xc9f630)[_0xb0fe('0x3b')](_0x3d55cf);};}exports['index']=function(_0x40e65c,_0x39d687){var _0x27a174={},_0x4c7d0e={},_0x1245a2={'count':0x0,'rows':[]};var _0x10866f=_[_0xb0fe('0x3c')](db['ChatMessage'][_0xb0fe('0x3d')],function(_0x562a7e){return{'name':_0x562a7e[_0xb0fe('0x3e')],'type':_0x562a7e[_0xb0fe('0x3f')][_0xb0fe('0x40')]};});_0x4c7d0e[_0xb0fe('0x41')]=_[_0xb0fe('0x3c')](_0x10866f,'name');_0x4c7d0e[_0xb0fe('0x42')]=_[_0xb0fe('0x43')](_0x40e65c[_0xb0fe('0x42')]);_0x4c7d0e['filters']=_[_0xb0fe('0x44')](_0x4c7d0e[_0xb0fe('0x41')],_0x4c7d0e[_0xb0fe('0x42')]);_0x27a174['attributes']=_['intersection'](_0x4c7d0e[_0xb0fe('0x41')],qs['fields'](_0x40e65c[_0xb0fe('0x42')][_0xb0fe('0x45')]));_0x27a174[_0xb0fe('0x46')]=_0x27a174[_0xb0fe('0x46')][_0xb0fe('0x47')]?_0x27a174['attributes']:_0x4c7d0e[_0xb0fe('0x41')];if(!_0x40e65c['query']['hasOwnProperty']('nolimit')){_0x27a174[_0xb0fe('0x34')]=qs[_0xb0fe('0x34')](_0x40e65c[_0xb0fe('0x42')]['limit']);_0x27a174[_0xb0fe('0x31')]=qs[_0xb0fe('0x31')](_0x40e65c[_0xb0fe('0x42')][_0xb0fe('0x31')]);}_0x27a174[_0xb0fe('0x48')]=qs[_0xb0fe('0x49')](_0x40e65c['query'][_0xb0fe('0x49')]);_0x27a174[_0xb0fe('0x4a')]=qs[_0xb0fe('0x4b')](_[_0xb0fe('0x4c')](_0x40e65c[_0xb0fe('0x42')],_0x4c7d0e['filters']),_0x10866f);if(_0x40e65c[_0xb0fe('0x42')][_0xb0fe('0x4d')]){_0x27a174[_0xb0fe('0x4a')]=_[_0xb0fe('0x4e')](_0x27a174[_0xb0fe('0x4a')],{'$or':_[_0xb0fe('0x3c')](_0x10866f,function(_0x714250){if(_0x714250['type']!==_0xb0fe('0x4f')){var _0x13b27e={};_0x13b27e[_0x714250['name']]={'$like':'%'+_0x40e65c[_0xb0fe('0x42')]['filter']+'%'};return _0x13b27e;}})});}_0x27a174=_['merge']({},_0x27a174,_0x40e65c[_0xb0fe('0x50')]);var _0x46ca46={'where':_0x27a174[_0xb0fe('0x4a')]};return db[_0xb0fe('0x51')][_0xb0fe('0x33')](_0x46ca46)['then'](function(_0xd246a9){_0x1245a2[_0xb0fe('0x33')]=_0xd246a9;if(_0x40e65c[_0xb0fe('0x42')]['includeAll']){_0x27a174['include']=[{'all':!![]}];}return db[_0xb0fe('0x51')][_0xb0fe('0x52')](_0x27a174);})[_0xb0fe('0x22')](function(_0x3def4d){_0x1245a2['rows']=_0x3def4d;return _0x1245a2;})[_0xb0fe('0x22')](respondWithFilteredResult(_0x39d687,_0x27a174))[_0xb0fe('0x2c')](handleError(_0x39d687,null));};exports[_0xb0fe('0x53')]=function(_0x458fa9,_0x4d578f){var _0x44086f={'raw':!![],'where':{'id':_0x458fa9[_0xb0fe('0x54')]['id']}},_0x4975d3={};_0x4975d3[_0xb0fe('0x41')]=_['keys'](db[_0xb0fe('0x51')]['rawAttributes']);_0x4975d3[_0xb0fe('0x42')]=_[_0xb0fe('0x43')](_0x458fa9[_0xb0fe('0x42')]);_0x4975d3[_0xb0fe('0x4b')]=_[_0xb0fe('0x44')](_0x4975d3[_0xb0fe('0x41')],_0x4975d3[_0xb0fe('0x42')]);_0x44086f[_0xb0fe('0x46')]=_[_0xb0fe('0x44')](_0x4975d3[_0xb0fe('0x41')],qs['fields'](_0x458fa9[_0xb0fe('0x42')][_0xb0fe('0x45')]));_0x44086f[_0xb0fe('0x46')]=_0x44086f[_0xb0fe('0x46')][_0xb0fe('0x47')]?_0x44086f[_0xb0fe('0x46')]:_0x4975d3[_0xb0fe('0x41')];if(_0x458fa9[_0xb0fe('0x42')][_0xb0fe('0x55')]){_0x44086f['include']=[{'all':!![]}];}_0x44086f=_[_0xb0fe('0x4e')]({},_0x44086f,_0x458fa9[_0xb0fe('0x50')]);return db[_0xb0fe('0x51')][_0xb0fe('0x56')](_0x44086f)[_0xb0fe('0x22')](handleEntityNotFound(_0x4d578f,null))[_0xb0fe('0x22')](respondWithResult(_0x4d578f,null))[_0xb0fe('0x2c')](handleError(_0x4d578f,null));};exports['create']=function(_0x3324a8,_0x4bdc3c){return db['ChatMessage'][_0xb0fe('0x57')](_0x3324a8[_0xb0fe('0x58')],{})[_0xb0fe('0x22')](respondWithResult(_0x4bdc3c,0xc9))[_0xb0fe('0x2c')](handleError(_0x4bdc3c,null));};exports[_0xb0fe('0x39')]=function(_0x5eca27,_0x46df24){if(_0x5eca27[_0xb0fe('0x58')]['id']){delete _0x5eca27[_0xb0fe('0x58')]['id'];}return db['ChatMessage'][_0xb0fe('0x56')]({'where':{'id':_0x5eca27['params']['id']}})[_0xb0fe('0x22')](handleEntityNotFound(_0x46df24,null))[_0xb0fe('0x22')](saveUpdates(_0x5eca27[_0xb0fe('0x58')],null))['then'](respondWithResult(_0x46df24,null))[_0xb0fe('0x2c')](handleError(_0x46df24,null));};exports[_0xb0fe('0x59')]=function(_0x29c534,_0x8a77ee){return db[_0xb0fe('0x51')][_0xb0fe('0x56')]({'where':{'id':_0x29c534[_0xb0fe('0x54')]['id']}})['then'](handleEntityNotFound(_0x8a77ee,null))[_0xb0fe('0x22')](removeEntity(_0x8a77ee,null))[_0xb0fe('0x2c')](handleError(_0x8a77ee,null));};exports[_0xb0fe('0x5a')]=function(_0x1fd655,_0x44b38f){return db['ChatMessage'][_0xb0fe('0x5a')]()[_0xb0fe('0x22')](respondWithResult(_0x44b38f,null))['catch'](handleError(_0x44b38f,null));};var interaction_log=require(_0xb0fe('0x14'))(_0xb0fe('0x5b'));exports[_0xb0fe('0x5c')]=function(_0x14fbeb,_0x3fdf1b,_0xe37da8){var _0x1a0c1c={'agent':{},'channel':_0xb0fe('0x5d')};if(_0x14fbeb[_0xb0fe('0x58')]['id']){delete _0x14fbeb[_0xb0fe('0x58')]['id'];}_0x14fbeb[_0xb0fe('0x58')][_0xb0fe('0x5e')]=!![];_0x14fbeb[_0xb0fe('0x58')]['readAt']=moment()['format'](_0xb0fe('0x5f'));_0x14fbeb[_0xb0fe('0x58')][_0xb0fe('0x60')]=_0x14fbeb[_0xb0fe('0x58')][_0xb0fe('0x60')]||_0x14fbeb[_0xb0fe('0x61')]['id'];_0x1a0c1c['agent']['id']=_0x14fbeb[_0xb0fe('0x58')][_0xb0fe('0x60')];return db[_0xb0fe('0x51')][_0xb0fe('0x56')]({'where':{'id':_0x14fbeb['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3fdf1b,null))[_0xb0fe('0x22')](saveUpdates(_0x14fbeb['body'],null))[_0xb0fe('0x22')](function(_0x3565bf){if(_0x3565bf){_0x1a0c1c[_0xb0fe('0x2b')]=_0x3565bf[_0xb0fe('0x62')]({'plain':!![]});return db['ChatInteraction'][_0xb0fe('0x56')]({'where':{'id':_0x3565bf[_0xb0fe('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x3fdf1b,null))[_0xb0fe('0x22')](function(_0x346a41){if(_0x346a41){return _0x346a41[_0xb0fe('0x39')]({'UserId':_0x14fbeb[_0xb0fe('0x58')][_0xb0fe('0x60')],'read1stAt':_[_0xb0fe('0x64')](_0x346a41['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb0fe('0x22')](function(_0x3fd8e8){if(_0x3fd8e8){_0x1a0c1c[_0xb0fe('0x65')]=_0x3fd8e8[_0xb0fe('0x62')]({'plain':!![]});interaction_log['info'](_0xb0fe('0x66'),_0x14fbeb[_0xb0fe('0x61')]['id'],_0x14fbeb[_0xb0fe('0x61')]['name'],_0x14fbeb[_0xb0fe('0x61')]['role'],_0x1a0c1c[_0xb0fe('0x65')]['id'],_0x14fbeb[_0xb0fe('0x58')]?JSON[_0xb0fe('0x27')](_0x14fbeb[_0xb0fe('0x58')]):'null');return respondWithRpcPromise(_0xb0fe('0x67'),'acceptMessage',_0x1a0c1c);}return null;})[_0xb0fe('0x22')](function(_0x65ff04){var _0x42d1c5=_0xb0fe('0x68')+_0x65ff04['message']['ContactId'];return db[_0xb0fe('0x69')]['query'](_0x42d1c5,{'type':db[_0xb0fe('0x6a')][_0xb0fe('0x6b')][_0xb0fe('0x6c')],'raw':!![]})[_0xb0fe('0x22')](function(_0x2a7de9){return _0x2a7de9;});})[_0xb0fe('0x22')](function(_0x509c0a){if(_0x509c0a){_0x1a0c1c[_0xb0fe('0x2b')][_0xb0fe('0x6d')]=_0x509c0a[0x0];if(!_0x14fbeb[_0xb0fe('0x58')][_0xb0fe('0x60')])return;return db['User'][_0xb0fe('0x56')]({'where':{'id':_0x14fbeb[_0xb0fe('0x58')][_0xb0fe('0x60')],'role':_0xb0fe('0x6e')},'attributes':['id','name',_0xb0fe('0x6f'),'email',_0xb0fe('0x70')],'raw':!![]});}return null;})[_0xb0fe('0x22')](function(_0x552302){if(!_0x552302)return null;_0x1a0c1c[_0xb0fe('0x2b')][_0xb0fe('0x6e')]=_0x552302;return _0x1a0c1c;})[_0xb0fe('0x22')](function(_0x4b494a){if(_0x4b494a){if(_0x14fbeb['body'][_0xb0fe('0x71')]){_0x1a0c1c[_0xb0fe('0x2b')][_0xb0fe('0x72')]=util[_0xb0fe('0x73')](_0xb0fe('0x74'),_0x14fbeb[_0xb0fe('0x61')][_0xb0fe('0x3a')]);_0x1a0c1c[_0xb0fe('0x2b')]['channel']=_0x1a0c1c[_0xb0fe('0x75')];_0x1a0c1c[_0xb0fe('0x2b')][_0xb0fe('0x76')]=_0x1a0c1c[_0xb0fe('0x75')];_0x1a0c1c[_0xb0fe('0x2b')][_0xb0fe('0x77')]=_0xb0fe('0x5c');return respondWithRpcPromise(_0xb0fe('0x78'),'EventManager',{'event':_0xb0fe('0x79'),'message':_[_0xb0fe('0x4e')](_0x1a0c1c[_0xb0fe('0x2b')],JSON['parse'](_0x1a0c1c[_0xb0fe('0x65')][_0xb0fe('0x7a')]))},client9002)[_0xb0fe('0x22')](function(){return _0x1a0c1c;});}return _0x1a0c1c;}return null;})[_0xb0fe('0x22')](respondWithResult(_0x3fdf1b,null))[_0xb0fe('0x2c')](handleError(_0x3fdf1b,null));};var interaction_log=require(_0xb0fe('0x14'))(_0xb0fe('0x5b'));exports[_0xb0fe('0x38')]=function(_0xddd8a2,_0x35ef49,_0x31e7ab){var _0x35a75d={'agent':{},'channel':'chat'};if(_0xddd8a2[_0xb0fe('0x58')]['id']){delete _0xddd8a2[_0xb0fe('0x58')]['id'];}_0xddd8a2[_0xb0fe('0x58')][_0xb0fe('0x60')]=_0xddd8a2[_0xb0fe('0x58')][_0xb0fe('0x60')]||_0xddd8a2[_0xb0fe('0x61')]['id'];_0x35a75d[_0xb0fe('0x6e')]['id']=_0xddd8a2[_0xb0fe('0x58')][_0xb0fe('0x60')];return db[_0xb0fe('0x51')][_0xb0fe('0x56')]({'where':{'id':_0xddd8a2[_0xb0fe('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35ef49,null))[_0xb0fe('0x22')](function(_0x2b9762){if(_0x2b9762){_0x35a75d['message']=_0x2b9762[_0xb0fe('0x62')]({'plain':!![]});return db['ChatInteraction'][_0xb0fe('0x56')]({'where':{'id':_0x2b9762[_0xb0fe('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x35ef49,null))[_0xb0fe('0x22')](function(_0x2709f7){if(_0x2709f7){_0x35a75d[_0xb0fe('0x65')]=_0x2709f7[_0xb0fe('0x62')]({'plain':!![]});interaction_log[_0xb0fe('0x23')](_0xb0fe('0x7b'),_0xddd8a2[_0xb0fe('0x61')]['id'],_0xddd8a2[_0xb0fe('0x61')]['name'],_0xddd8a2['user'][_0xb0fe('0x7c')],_0x35a75d[_0xb0fe('0x65')]['id'],_0xddd8a2[_0xb0fe('0x58')]?JSON['stringify'](_0xddd8a2[_0xb0fe('0x58')]):'null');return respondWithRpcPromise(_0xb0fe('0x7d'),_0xb0fe('0x7e'),_0x35a75d);}return null;})['then'](function(_0x3c532d){var _0x484e92=_0xb0fe('0x68')+_0x3c532d[_0xb0fe('0x2b')][_0xb0fe('0x7f')];return db[_0xb0fe('0x69')][_0xb0fe('0x42')](_0x484e92,{'type':db[_0xb0fe('0x6a')][_0xb0fe('0x6b')][_0xb0fe('0x6c')],'raw':!![]})[_0xb0fe('0x22')](function(_0x4b3f9b){return _0x4b3f9b;});})[_0xb0fe('0x22')](function(_0x4d6b1b){if(_0x4d6b1b){_0x35a75d[_0xb0fe('0x2b')][_0xb0fe('0x6d')]=_0x4d6b1b[0x0];if(!_0xddd8a2['body'][_0xb0fe('0x60')])return;return db[_0xb0fe('0x80')][_0xb0fe('0x56')]({'where':{'id':_0xddd8a2[_0xb0fe('0x58')][_0xb0fe('0x60')],'role':_0xb0fe('0x6e')},'attributes':['id',_0xb0fe('0x3a'),'fullname',_0xb0fe('0x81'),'internal'],'raw':!![]});}return null;})[_0xb0fe('0x22')](function(_0x4d0762){if(!_0x4d0762)return null;_0x35a75d[_0xb0fe('0x2b')][_0xb0fe('0x6e')]=_0x4d0762;return _0x35a75d;})[_0xb0fe('0x22')](function(_0x22af7d){if(_0x22af7d){_0x22af7d[_0xb0fe('0x2b')][_0xb0fe('0x72')]=util[_0xb0fe('0x73')](_0xb0fe('0x74'),_0xddd8a2['user'][_0xb0fe('0x3a')]);_0x22af7d[_0xb0fe('0x2b')]['channel']=_0x35a75d[_0xb0fe('0x75')];_0x22af7d[_0xb0fe('0x2b')][_0xb0fe('0x76')]=_0x35a75d[_0xb0fe('0x75')];_0x22af7d['message'][_0xb0fe('0x77')]=_0xb0fe('0x38');respondWithRpcPromise(_0xb0fe('0x78'),_0xb0fe('0x78'),{'event':_0xb0fe('0x82'),'message':_['merge'](_0x35a75d[_0xb0fe('0x2b')],JSON[_0xb0fe('0x83')](_0x35a75d[_0xb0fe('0x65')][_0xb0fe('0x7a')]))},client9002);return _0x35a75d;}return null;})['then'](respondWithResult(_0x35ef49,null))[_0xb0fe('0x2c')](handleError(_0x35ef49,null));}; \ No newline at end of file +var _0xfd12=['socket.io-emitter','./chatMessage.socket','register','client','http','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','ChatMessage','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','find','create','body','chat-interactions','accept','chat','read','readAt','format','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','info','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','event','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost'];(function(_0x59f2e1,_0x484830){var _0x3e4dfb=function(_0x1c6dbe){while(--_0x1c6dbe){_0x59f2e1['push'](_0x59f2e1['shift']());}};_0x3e4dfb(++_0x484830);}(_0xfd12,0x182));var _0x2fd1=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0xfd12[_0x1d04b5];return _0x161342;};'use strict';var emlformat=require(_0x2fd1('0x0'));var rimraf=require(_0x2fd1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2fd1('0x2'));var rp=require('request-promise');var moment=require(_0x2fd1('0x3'));var BPromise=require(_0x2fd1('0x4'));var Mustache=require(_0x2fd1('0x5'));var util=require(_0x2fd1('0x6'));var path=require(_0x2fd1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2fd1('0x8'));var fs=require('fs');var fs_extra=require(_0x2fd1('0x9'));var _=require(_0x2fd1('0xa'));var squel=require(_0x2fd1('0xb'));var crypto=require('crypto');var jsforce=require(_0x2fd1('0xc'));var deskjs=require(_0x2fd1('0xd'));var toCsv=require(_0x2fd1('0xe'));var querystring=require(_0x2fd1('0xf'));var Papa=require(_0x2fd1('0x10'));var Redis=require(_0x2fd1('0x11'));var authService=require(_0x2fd1('0x12'));var qs=require(_0x2fd1('0x13'));var as=require(_0x2fd1('0x14'));var hardwareService=require(_0x2fd1('0x15'));var logger=require(_0x2fd1('0x16'))(_0x2fd1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2fd1('0x18'))['db'];config[_0x2fd1('0x19')]=_[_0x2fd1('0x1a')](config[_0x2fd1('0x19')],{'host':_0x2fd1('0x1b'),'port':0x18eb});var socket=require(_0x2fd1('0x1c'))(new Redis(config[_0x2fd1('0x19')]));require(_0x2fd1('0x1d'))[_0x2fd1('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2fd1('0x1f')][_0x2fd1('0x20')]({'port':0x232c});var client9002=jayson[_0x2fd1('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30ab88,_0x20590a,_0x54c126,_0xaee9fc){return new BPromise(function(_0x34236b,_0x558c51){var _0x3fb9e6=_0xaee9fc||client;return _0x3fb9e6[_0x2fd1('0x21')](_0x30ab88,_0x54c126)[_0x2fd1('0x22')](function(_0x440667){logger['info']('ChatMessage,\x20%s,\x20%s',_0x20590a,_0x2fd1('0x23'));logger[_0x2fd1('0x24')](_0x2fd1('0x25'),_0x20590a,_0x2fd1('0x23'),JSON[_0x2fd1('0x26')](_0x440667));if(_0x440667[_0x2fd1('0x27')]){if(_0x440667[_0x2fd1('0x27')][_0x2fd1('0x28')]===0x1f4){logger['error'](_0x2fd1('0x29'),_0x20590a,_0x440667[_0x2fd1('0x27')][_0x2fd1('0x2a')]);return _0x558c51(_0x440667['error'][_0x2fd1('0x2a')]);}logger[_0x2fd1('0x27')]('ChatMessage,\x20%s,\x20%s',_0x20590a,_0x440667['error'][_0x2fd1('0x2a')]);return _0x34236b(_0x440667['error']['message']);}else{logger['info'](_0x2fd1('0x29'),_0x20590a,_0x2fd1('0x23'));_0x34236b(_0x440667[_0x2fd1('0x2b')][_0x2fd1('0x2a')]);}})[_0x2fd1('0x2c')](function(_0x14208e){logger[_0x2fd1('0x27')]('ChatMessage,\x20%s,\x20%s',_0x20590a,_0x14208e);_0x558c51(_0x14208e);});});}function respondWithStatusCode(_0x493663,_0xb0532f){_0xb0532f=_0xb0532f||0xcc;return function(_0x204a9d){if(_0x204a9d){return _0x493663[_0x2fd1('0x2d')](_0xb0532f);}return _0x493663[_0x2fd1('0x2e')](_0xb0532f)[_0x2fd1('0x2f')]();};}function respondWithResult(_0x5d2b4c,_0x482748){_0x482748=_0x482748||0xc8;return function(_0x229613){if(_0x229613){return _0x5d2b4c['status'](_0x482748)[_0x2fd1('0x30')](_0x229613);}};}function respondWithFilteredResult(_0x1ccd14,_0x466110){return function(_0x4d6de9){if(_0x4d6de9){var _0x33fcda=typeof _0x466110[_0x2fd1('0x31')]===_0x2fd1('0x32')&&typeof _0x466110['limit']===_0x2fd1('0x32');var _0x2994f2=_0x4d6de9[_0x2fd1('0x33')];var _0x10d848=_0x33fcda?0x0:_0x466110['offset'];var _0x1bbcea=_0x33fcda?_0x4d6de9[_0x2fd1('0x33')]:_0x466110[_0x2fd1('0x31')]+_0x466110[_0x2fd1('0x34')];var _0x4a475c;if(_0x1bbcea>=_0x2994f2){_0x1bbcea=_0x2994f2;_0x4a475c=0xc8;}else{_0x4a475c=0xce;}_0x1ccd14[_0x2fd1('0x2e')](_0x4a475c);return _0x1ccd14[_0x2fd1('0x35')](_0x2fd1('0x36'),_0x10d848+'-'+_0x1bbcea+'/'+_0x2994f2)['json'](_0x4d6de9);}return null;};}function patchUpdates(_0x4286e8){return function(_0x37f281){try{jsonpatch[_0x2fd1('0x37')](_0x37f281,_0x4286e8,!![]);}catch(_0x4b6ceb){return BPromise[_0x2fd1('0x38')](_0x4b6ceb);}return _0x37f281[_0x2fd1('0x39')]();};}function saveUpdates(_0x15bfe3,_0x25b65f){return function(_0x287457){if(_0x287457){return _0x287457[_0x2fd1('0x3a')](_0x15bfe3)['then'](function(_0x5a1787){return _0x5a1787;});}return null;};}function removeEntity(_0x5c87bf,_0x1cff54){return function(_0x4d08d2){if(_0x4d08d2){return _0x4d08d2[_0x2fd1('0x3b')]()[_0x2fd1('0x22')](function(){_0x5c87bf[_0x2fd1('0x2e')](0xcc)[_0x2fd1('0x2f')]();});}};}function handleEntityNotFound(_0x52ea0d,_0x2245b5){return function(_0x14458e){if(!_0x14458e){_0x52ea0d['sendStatus'](0x194);}return _0x14458e;};}function handleError(_0x1b9f11,_0x3ccb12){_0x3ccb12=_0x3ccb12||0x1f4;return function(_0x37db3c){logger[_0x2fd1('0x27')](_0x37db3c['stack']);if(_0x37db3c[_0x2fd1('0x3c')]){delete _0x37db3c['name'];}_0x1b9f11[_0x2fd1('0x2e')](_0x3ccb12)[_0x2fd1('0x3d')](_0x37db3c);};}exports[_0x2fd1('0x3e')]=function(_0x2d9a09,_0x26baaf){var _0x9fed8={},_0x50eb8f={},_0x87e288={'count':0x0,'rows':[]};var _0xae0211=_[_0x2fd1('0x3f')](db[_0x2fd1('0x40')][_0x2fd1('0x41')],function(_0x3ed34b){return{'name':_0x3ed34b['fieldName'],'type':_0x3ed34b[_0x2fd1('0x42')]['key']};});_0x50eb8f[_0x2fd1('0x43')]=_['map'](_0xae0211,_0x2fd1('0x3c'));_0x50eb8f[_0x2fd1('0x44')]=_['keys'](_0x2d9a09['query']);_0x50eb8f[_0x2fd1('0x45')]=_[_0x2fd1('0x46')](_0x50eb8f[_0x2fd1('0x43')],_0x50eb8f[_0x2fd1('0x44')]);_0x9fed8[_0x2fd1('0x47')]=_['intersection'](_0x50eb8f[_0x2fd1('0x43')],qs[_0x2fd1('0x48')](_0x2d9a09[_0x2fd1('0x44')][_0x2fd1('0x48')]));_0x9fed8[_0x2fd1('0x47')]=_0x9fed8[_0x2fd1('0x47')][_0x2fd1('0x49')]?_0x9fed8['attributes']:_0x50eb8f[_0x2fd1('0x43')];if(!_0x2d9a09[_0x2fd1('0x44')][_0x2fd1('0x4a')](_0x2fd1('0x4b'))){_0x9fed8[_0x2fd1('0x34')]=qs[_0x2fd1('0x34')](_0x2d9a09[_0x2fd1('0x44')][_0x2fd1('0x34')]);_0x9fed8[_0x2fd1('0x31')]=qs[_0x2fd1('0x31')](_0x2d9a09[_0x2fd1('0x44')][_0x2fd1('0x31')]);}_0x9fed8[_0x2fd1('0x4c')]=qs[_0x2fd1('0x4d')](_0x2d9a09[_0x2fd1('0x44')][_0x2fd1('0x4d')]);_0x9fed8['where']=qs[_0x2fd1('0x45')](_[_0x2fd1('0x4e')](_0x2d9a09[_0x2fd1('0x44')],_0x50eb8f[_0x2fd1('0x45')]),_0xae0211);if(_0x2d9a09[_0x2fd1('0x44')][_0x2fd1('0x4f')]){_0x9fed8[_0x2fd1('0x50')]=_['merge'](_0x9fed8[_0x2fd1('0x50')],{'$or':_['map'](_0xae0211,function(_0x5ff344){if(_0x5ff344['type']!==_0x2fd1('0x51')){var _0x2c0f07={};_0x2c0f07[_0x5ff344[_0x2fd1('0x3c')]]={'$like':'%'+_0x2d9a09[_0x2fd1('0x44')]['filter']+'%'};return _0x2c0f07;}})});}_0x9fed8=_[_0x2fd1('0x52')]({},_0x9fed8,_0x2d9a09[_0x2fd1('0x53')]);var _0x564d45={'where':_0x9fed8[_0x2fd1('0x50')]};return db['ChatMessage'][_0x2fd1('0x33')](_0x564d45)['then'](function(_0x56ceb1){_0x87e288[_0x2fd1('0x33')]=_0x56ceb1;if(_0x2d9a09[_0x2fd1('0x44')]['includeAll']){_0x9fed8['include']=[{'all':!![]}];}return db[_0x2fd1('0x40')][_0x2fd1('0x54')](_0x9fed8);})[_0x2fd1('0x22')](function(_0x26b37b){_0x87e288[_0x2fd1('0x55')]=_0x26b37b;return _0x87e288;})[_0x2fd1('0x22')](respondWithFilteredResult(_0x26baaf,_0x9fed8))[_0x2fd1('0x2c')](handleError(_0x26baaf,null));};exports[_0x2fd1('0x56')]=function(_0x5bcdb5,_0x4b9b22){var _0x524cc1={'raw':!![],'where':{'id':_0x5bcdb5[_0x2fd1('0x57')]['id']}},_0x3ab610={};_0x3ab610['model']=_[_0x2fd1('0x58')](db[_0x2fd1('0x40')][_0x2fd1('0x41')]);_0x3ab610[_0x2fd1('0x44')]=_[_0x2fd1('0x58')](_0x5bcdb5[_0x2fd1('0x44')]);_0x3ab610['filters']=_[_0x2fd1('0x46')](_0x3ab610[_0x2fd1('0x43')],_0x3ab610[_0x2fd1('0x44')]);_0x524cc1[_0x2fd1('0x47')]=_[_0x2fd1('0x46')](_0x3ab610['model'],qs[_0x2fd1('0x48')](_0x5bcdb5[_0x2fd1('0x44')][_0x2fd1('0x48')]));_0x524cc1[_0x2fd1('0x47')]=_0x524cc1['attributes'][_0x2fd1('0x49')]?_0x524cc1[_0x2fd1('0x47')]:_0x3ab610[_0x2fd1('0x43')];if(_0x5bcdb5['query'][_0x2fd1('0x59')]){_0x524cc1[_0x2fd1('0x5a')]=[{'all':!![]}];}_0x524cc1=_['merge']({},_0x524cc1,_0x5bcdb5[_0x2fd1('0x53')]);return db['ChatMessage'][_0x2fd1('0x5b')](_0x524cc1)[_0x2fd1('0x22')](handleEntityNotFound(_0x4b9b22,null))[_0x2fd1('0x22')](respondWithResult(_0x4b9b22,null))[_0x2fd1('0x2c')](handleError(_0x4b9b22,null));};exports['create']=function(_0x2df881,_0x1177b8){return db[_0x2fd1('0x40')][_0x2fd1('0x5c')](_0x2df881['body'],{})[_0x2fd1('0x22')](respondWithResult(_0x1177b8,0xc9))[_0x2fd1('0x2c')](handleError(_0x1177b8,null));};exports['update']=function(_0x597694,_0x8f6958){if(_0x597694[_0x2fd1('0x5d')]['id']){delete _0x597694['body']['id'];}return db[_0x2fd1('0x40')]['find']({'where':{'id':_0x597694['params']['id']}})[_0x2fd1('0x22')](handleEntityNotFound(_0x8f6958,null))[_0x2fd1('0x22')](saveUpdates(_0x597694[_0x2fd1('0x5d')],null))[_0x2fd1('0x22')](respondWithResult(_0x8f6958,null))[_0x2fd1('0x2c')](handleError(_0x8f6958,null));};exports['destroy']=function(_0x217bab,_0xbe5945){return db[_0x2fd1('0x40')]['find']({'where':{'id':_0x217bab['params']['id']}})[_0x2fd1('0x22')](handleEntityNotFound(_0xbe5945,null))[_0x2fd1('0x22')](removeEntity(_0xbe5945,null))['catch'](handleError(_0xbe5945,null));};exports['describe']=function(_0x1482d7,_0x3dd884){return db[_0x2fd1('0x40')]['describe']()[_0x2fd1('0x22')](respondWithResult(_0x3dd884,null))[_0x2fd1('0x2c')](handleError(_0x3dd884,null));};var interaction_log=require(_0x2fd1('0x16'))(_0x2fd1('0x5e'));exports[_0x2fd1('0x5f')]=function(_0x47205b,_0x4fbc65,_0x43e866){var _0x51d885={'agent':{},'channel':_0x2fd1('0x60')};if(_0x47205b[_0x2fd1('0x5d')]['id']){delete _0x47205b[_0x2fd1('0x5d')]['id'];}_0x47205b[_0x2fd1('0x5d')][_0x2fd1('0x61')]=!![];_0x47205b[_0x2fd1('0x5d')][_0x2fd1('0x62')]=moment()[_0x2fd1('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x47205b['body']['UserId']=_0x47205b['body'][_0x2fd1('0x64')]||_0x47205b['user']['id'];_0x51d885[_0x2fd1('0x65')]['id']=_0x47205b[_0x2fd1('0x5d')][_0x2fd1('0x64')];return db[_0x2fd1('0x40')][_0x2fd1('0x5b')]({'where':{'id':_0x47205b[_0x2fd1('0x57')]['id'],'UserId':null}})[_0x2fd1('0x22')](handleEntityNotFound(_0x4fbc65,null))[_0x2fd1('0x22')](saveUpdates(_0x47205b['body'],null))[_0x2fd1('0x22')](function(_0x39b75b){if(_0x39b75b){_0x51d885[_0x2fd1('0x2a')]=_0x39b75b[_0x2fd1('0x66')]({'plain':!![]});return db[_0x2fd1('0x67')]['find']({'where':{'id':_0x39b75b[_0x2fd1('0x68')]}});}return null;})[_0x2fd1('0x22')](handleEntityNotFound(_0x4fbc65,null))[_0x2fd1('0x22')](function(_0x4deb12){if(_0x4deb12){return _0x4deb12['update']({'UserId':_0x47205b['body']['UserId'],'read1stAt':_[_0x2fd1('0x69')](_0x4deb12['read1stAt'])?moment()[_0x2fd1('0x63')](_0x2fd1('0x6a')):undefined});}return null;})[_0x2fd1('0x22')](function(_0x28fc2c){if(_0x28fc2c){_0x51d885[_0x2fd1('0x6b')]=_0x28fc2c[_0x2fd1('0x66')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47205b[_0x2fd1('0x6c')]['id'],_0x47205b[_0x2fd1('0x6c')][_0x2fd1('0x3c')],_0x47205b[_0x2fd1('0x6c')][_0x2fd1('0x6d')],_0x51d885['interaction']['id'],_0x47205b[_0x2fd1('0x5d')]?JSON['stringify'](_0x47205b[_0x2fd1('0x5d')]):_0x2fd1('0x6e'));return respondWithRpcPromise(_0x2fd1('0x6f'),_0x2fd1('0x70'),_0x51d885);}return null;})[_0x2fd1('0x22')](function(_0xe90551){var _0x553c36=_0x2fd1('0x71')+_0xe90551[_0x2fd1('0x2a')][_0x2fd1('0x72')];return db[_0x2fd1('0x73')][_0x2fd1('0x44')](_0x553c36,{'type':db[_0x2fd1('0x74')]['QueryTypes'][_0x2fd1('0x75')],'raw':!![]})[_0x2fd1('0x22')](function(_0x1dca8c){return _0x1dca8c;});})[_0x2fd1('0x22')](function(_0x1c1475){if(_0x1c1475){_0x51d885[_0x2fd1('0x2a')]['contact']=_0x1c1475[0x0];if(!_0x47205b[_0x2fd1('0x5d')]['UserId'])return;return db[_0x2fd1('0x76')][_0x2fd1('0x5b')]({'where':{'id':_0x47205b['body'][_0x2fd1('0x64')],'role':_0x2fd1('0x65')},'attributes':['id',_0x2fd1('0x3c'),_0x2fd1('0x77'),_0x2fd1('0x78'),_0x2fd1('0x79')],'raw':!![]});}return null;})['then'](function(_0x100596){if(!_0x100596)return null;_0x51d885[_0x2fd1('0x2a')][_0x2fd1('0x65')]=_0x100596;return _0x51d885;})[_0x2fd1('0x22')](function(_0xe272a2){if(_0xe272a2){if(_0x47205b[_0x2fd1('0x5d')][_0x2fd1('0x7a')]){_0x51d885[_0x2fd1('0x2a')][_0x2fd1('0x7b')]=util[_0x2fd1('0x63')](_0x2fd1('0x7c'),_0x47205b[_0x2fd1('0x6c')][_0x2fd1('0x3c')]);_0x51d885[_0x2fd1('0x2a')][_0x2fd1('0x7d')]=_0x51d885[_0x2fd1('0x7d')];_0x51d885[_0x2fd1('0x2a')][_0x2fd1('0x7e')]=_0x51d885[_0x2fd1('0x7d')];_0x51d885[_0x2fd1('0x2a')]['event']=_0x2fd1('0x5f');return respondWithRpcPromise(_0x2fd1('0x7f'),_0x2fd1('0x7f'),{'event':_0x2fd1('0x80'),'message':_['merge'](_0x51d885['message'],JSON[_0x2fd1('0x81')](_0x51d885['interaction'][_0x2fd1('0x82')]))},client9002)['then'](function(){return _0x51d885;});}return _0x51d885;}return null;})[_0x2fd1('0x22')](respondWithResult(_0x4fbc65,null))[_0x2fd1('0x2c')](handleError(_0x4fbc65,null));};var interaction_log=require('../../config/logger')(_0x2fd1('0x5e'));exports[_0x2fd1('0x38')]=function(_0x3258ba,_0x1eeba4,_0x21311f){var _0x5b8b58={'agent':{},'channel':_0x2fd1('0x60')};if(_0x3258ba[_0x2fd1('0x5d')]['id']){delete _0x3258ba[_0x2fd1('0x5d')]['id'];}_0x3258ba['body'][_0x2fd1('0x64')]=_0x3258ba[_0x2fd1('0x5d')][_0x2fd1('0x64')]||_0x3258ba[_0x2fd1('0x6c')]['id'];_0x5b8b58[_0x2fd1('0x65')]['id']=_0x3258ba[_0x2fd1('0x5d')]['UserId'];return db[_0x2fd1('0x40')]['find']({'where':{'id':_0x3258ba[_0x2fd1('0x57')]['id'],'UserId':null}})[_0x2fd1('0x22')](handleEntityNotFound(_0x1eeba4,null))[_0x2fd1('0x22')](function(_0x581a71){if(_0x581a71){_0x5b8b58[_0x2fd1('0x2a')]=_0x581a71[_0x2fd1('0x66')]({'plain':!![]});return db['ChatInteraction'][_0x2fd1('0x5b')]({'where':{'id':_0x581a71[_0x2fd1('0x68')]}});}return null;})[_0x2fd1('0x22')](handleEntityNotFound(_0x1eeba4,null))[_0x2fd1('0x22')](function(_0x14c6f6){if(_0x14c6f6){_0x5b8b58['interaction']=_0x14c6f6['get']({'plain':!![]});interaction_log[_0x2fd1('0x83')](_0x2fd1('0x84'),_0x3258ba[_0x2fd1('0x6c')]['id'],_0x3258ba[_0x2fd1('0x6c')][_0x2fd1('0x3c')],_0x3258ba['user'][_0x2fd1('0x6d')],_0x5b8b58['interaction']['id'],_0x3258ba[_0x2fd1('0x5d')]?JSON[_0x2fd1('0x26')](_0x3258ba[_0x2fd1('0x5d')]):_0x2fd1('0x6e'));return respondWithRpcPromise(_0x2fd1('0x85'),_0x2fd1('0x86'),_0x5b8b58);}return null;})['then'](function(_0x5e4dd9){var _0x37f5f4=_0x2fd1('0x71')+_0x5e4dd9[_0x2fd1('0x2a')][_0x2fd1('0x72')];return db[_0x2fd1('0x73')]['query'](_0x37f5f4,{'type':db[_0x2fd1('0x74')]['QueryTypes'][_0x2fd1('0x75')],'raw':!![]})['then'](function(_0x422263){return _0x422263;});})[_0x2fd1('0x22')](function(_0x1f7c8c){if(_0x1f7c8c){_0x5b8b58[_0x2fd1('0x2a')][_0x2fd1('0x87')]=_0x1f7c8c[0x0];if(!_0x3258ba[_0x2fd1('0x5d')]['UserId'])return;return db[_0x2fd1('0x76')]['find']({'where':{'id':_0x3258ba[_0x2fd1('0x5d')][_0x2fd1('0x64')],'role':_0x2fd1('0x65')},'attributes':['id',_0x2fd1('0x3c'),_0x2fd1('0x77'),_0x2fd1('0x78'),_0x2fd1('0x79')],'raw':!![]});}return null;})[_0x2fd1('0x22')](function(_0x2dd721){if(!_0x2dd721)return null;_0x5b8b58[_0x2fd1('0x2a')][_0x2fd1('0x65')]=_0x2dd721;return _0x5b8b58;})[_0x2fd1('0x22')](function(_0x1cec20){if(_0x1cec20){_0x1cec20['message']['interface']=util[_0x2fd1('0x63')]('SIP/%s',_0x3258ba[_0x2fd1('0x6c')][_0x2fd1('0x3c')]);_0x1cec20[_0x2fd1('0x2a')][_0x2fd1('0x7d')]=_0x5b8b58[_0x2fd1('0x7d')];_0x1cec20['message'][_0x2fd1('0x7e')]=_0x5b8b58[_0x2fd1('0x7d')];_0x1cec20[_0x2fd1('0x2a')][_0x2fd1('0x88')]=_0x2fd1('0x38');respondWithRpcPromise('EventManager',_0x2fd1('0x7f'),{'event':_0x2fd1('0x89'),'message':_[_0x2fd1('0x52')](_0x5b8b58[_0x2fd1('0x2a')],JSON['parse'](_0x5b8b58[_0x2fd1('0x6b')][_0x2fd1('0x82')]))},client9002);return _0x5b8b58;}return null;})['then'](respondWithResult(_0x1eeba4,null))[_0x2fd1('0x2c')](handleError(_0x1eeba4,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 4c8dd70..daef9c1 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 _0xe4b5=['hook','exports','events','save','remove','emit','hasOwnProperty'];(function(_0x3ed25b,_0x41c9fe){var _0x3754ab=function(_0x33950f){while(--_0x33950f){_0x3ed25b['push'](_0x3ed25b['shift']());}};_0x3754ab(++_0x41c9fe);}(_0xe4b5,0xe9));var _0x5e4b=function(_0x54060d,_0x38d096){_0x54060d=_0x54060d-0x0;var _0x465a58=_0xe4b5[_0x54060d];return _0x465a58;};'use strict';var EventEmitter=require(_0x5e4b('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e4b('0x1'),'afterUpdate':'update','afterDestroy':_0x5e4b('0x2')};function emitEvent(_0x2367d7){return function(_0x14aa6b,_0x43b156,_0x5681fc){ChatMessageEvents[_0x5e4b('0x3')](_0x2367d7+':'+_0x14aa6b['id'],_0x14aa6b);ChatMessageEvents[_0x5e4b('0x3')](_0x2367d7,_0x14aa6b);_0x5681fc(null);};}for(var e in events){if(events[_0x5e4b('0x4')](e)){var event=events[e];ChatMessage[_0x5e4b('0x5')](e,emitEvent(event));}}module[_0x5e4b('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x49dd=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove','emit'];(function(_0x338ddb,_0x360186){var _0x438bc1=function(_0x157ff3){while(--_0x157ff3){_0x338ddb['push'](_0x338ddb['shift']());}};_0x438bc1(++_0x360186);}(_0x49dd,0x1bb));var _0xd49d=function(_0x9a3bfe,_0x3ef590){_0x9a3bfe=_0x9a3bfe-0x0;var _0x59beba=_0x49dd[_0x9a3bfe];return _0x59beba;};'use strict';var EventEmitter=require(_0xd49d('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd49d('0x1')](0x0);var events={'afterCreate':_0xd49d('0x2'),'afterUpdate':'update','afterDestroy':_0xd49d('0x3')};function emitEvent(_0x54dc15){return function(_0x3c05a6,_0x1dfa77,_0x479547){ChatMessageEvents[_0xd49d('0x4')](_0x54dc15+':'+_0x3c05a6['id'],_0x3c05a6);ChatMessageEvents[_0xd49d('0x4')](_0x54dc15,_0x3c05a6);_0x479547(null);};}for(var e in events){if(events[_0xd49d('0x5')](e)){var event=events[e];ChatMessage[_0xd49d('0x6')](e,emitEvent(event));}}module[_0xd49d('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 51dd5e8..59ccf81 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 _0xbcfe=['bluebird','request-promise','path','../../config/environment','exports','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','error','lodash','../../config/logger','api','moment'];(function(_0x5069d9,_0x438a44){var _0x3009c9=function(_0x2e1cdb){while(--_0x2e1cdb){_0x5069d9['push'](_0x5069d9['shift']());}};_0x3009c9(++_0x438a44);}(_0xbcfe,0x128));var _0xebcf=function(_0x436496,_0x184e35){_0x436496=_0x436496-0x0;var _0x8848d4=_0xbcfe[_0x436496];return _0x8848d4;};'use strict';var _=require(_0xebcf('0x0'));var util=require('util');var logger=require(_0xebcf('0x1'))(_0xebcf('0x2'));var moment=require(_0xebcf('0x3'));var BPromise=require(_0xebcf('0x4'));var rp=require(_0xebcf('0x5'));var fs=require('fs');var path=require(_0xebcf('0x6'));var rimraf=require('rimraf');var config=require(_0xebcf('0x7'));var attributes=require('./chatMessage.attributes');module[_0xebcf('0x8')]=function(_0x44aaa5,_0x2ef12b){return _0x44aaa5[_0xebcf('0x9')]('ChatMessage',attributes,{'tableName':_0xebcf('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xebcf('0xb')],'type':_0xebcf('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x98e292,_0x194a38,_0x4195b6){var _0x4bf072=_0x44aaa5[_0xebcf('0xd')];var _0x225b56=_0x98e292[_0xebcf('0xe')]({'plain':!![]});if(_0x225b56[_0xebcf('0xf')][_0xebcf('0x10')]()==='in'||_0x225b56['direction'][_0xebcf('0x10')]()===_0xebcf('0x11')&&!_0x225b56[_0xebcf('0x12')]&&!_['isNil'](_0x225b56[_0xebcf('0x13')])){_0x4bf072[_0xebcf('0x14')]['findOne']({'where':{'id':_0x225b56[_0xebcf('0x15')]}})[_0xebcf('0x16')](function(_0x4415cc){if(_0x4415cc){_0x4415cc[_0xebcf('0x17')]({'lastMsgAt':_0x225b56['createdAt'],'lastMsgDirection':_0x225b56['direction'][_0xebcf('0x10')]()});}})['catch'](function(_0x458f50){console[_0xebcf('0x18')](_0x458f50);});}_0x4195b6();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x628a=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','ChatInteraction','findOne','then','update','createdAt','catch'];(function(_0x2a810a,_0x18fd80){var _0x18a4fa=function(_0x5db930){while(--_0x5db930){_0x2a810a['push'](_0x2a810a['shift']());}};_0x18a4fa(++_0x18fd80);}(_0x628a,0x16e));var _0xa628=function(_0x54c374,_0x55f5f9){_0x54c374=_0x54c374-0x0;var _0x207e08=_0x628a[_0x54c374];return _0x207e08;};'use strict';var _=require('lodash');var util=require(_0xa628('0x0'));var logger=require(_0xa628('0x1'))(_0xa628('0x2'));var moment=require(_0xa628('0x3'));var BPromise=require(_0xa628('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa628('0x5'));var rimraf=require(_0xa628('0x6'));var config=require(_0xa628('0x7'));var attributes=require(_0xa628('0x8'));module[_0xa628('0x9')]=function(_0x4bb082,_0xb75c03){return _0x4bb082[_0xa628('0xa')]('ChatMessage',attributes,{'tableName':_0xa628('0xb'),'paranoid':![],'indexes':[{'name':_0xa628('0xc'),'fields':[_0xa628('0xd')],'type':_0xa628('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15953a,_0x4bdfab,_0x1e17cc){var _0x489744=_0x4bb082[_0xa628('0xf')];var _0x5d14cc=_0x15953a[_0xa628('0x10')]({'plain':!![]});if(_0x5d14cc[_0xa628('0x11')][_0xa628('0x12')]()==='in'||_0x5d14cc['direction'][_0xa628('0x12')]()===_0xa628('0x13')&&!_0x5d14cc['secret']&&!_['isNil'](_0x5d14cc['UserId'])){_0x489744[_0xa628('0x14')][_0xa628('0x15')]({'where':{'id':_0x5d14cc['ChatInteractionId']}})[_0xa628('0x16')](function(_0x1f7bb2){if(_0x1f7bb2){_0x1f7bb2[_0xa628('0x17')]({'lastMsgAt':_0x5d14cc[_0xa628('0x18')],'lastMsgDirection':_0x5d14cc[_0xa628('0x11')][_0xa628('0x12')]()});}})[_0xa628('0x19')](function(_0x43b79d){console['error'](_0x43b79d);});}_0x1e17cc();}},'charset':_0xa628('0x1a'),'collate':_0xa628('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 0351149..3732704 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 _0xc0b9=['redis','localhost','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','ChatMessage','create','body','options','raw','CreateChatMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc0b9,0x12d));var _0x9c0b=function(_0x57ac3a,_0x44146d){_0x57ac3a=_0x57ac3a-0x0;var _0x4213d7=_0xc0b9[_0x57ac3a];return _0x4213d7;};'use strict';var _=require(_0x9c0b('0x0'));var util=require(_0x9c0b('0x1'));var moment=require(_0x9c0b('0x2'));var BPromise=require(_0x9c0b('0x3'));var rs=require(_0x9c0b('0x4'));var fs=require('fs');var Redis=require(_0x9c0b('0x5'));var db=require(_0x9c0b('0x6'))['db'];var utils=require(_0x9c0b('0x7'));var logger=require(_0x9c0b('0x8'))(_0x9c0b('0x9'));var config=require(_0x9c0b('0xa'));var jayson=require(_0x9c0b('0xb'));var client=jayson[_0x9c0b('0xc')][_0x9c0b('0xd')]({'port':0x232a});config[_0x9c0b('0xe')]=_['defaults'](config[_0x9c0b('0xe')],{'host':_0x9c0b('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c0b('0xe')]));require(_0x9c0b('0x10'))['register'](socket);function respondWithRpcPromise(_0x25a1d7,_0x4988e8,_0x1b606b){return new BPromise(function(_0x2701ef,_0x1db8b6){return client[_0x9c0b('0x11')](_0x25a1d7,_0x1b606b)[_0x9c0b('0x12')](function(_0x5e26b6){logger[_0x9c0b('0x13')](_0x9c0b('0x14'),_0x4988e8,_0x9c0b('0x15'));logger[_0x9c0b('0x16')](_0x9c0b('0x17'),_0x4988e8,_0x9c0b('0x15'),JSON['stringify'](_0x5e26b6));if(_0x5e26b6[_0x9c0b('0x18')]){if(_0x5e26b6['error'][_0x9c0b('0x19')]===0x1f4){logger['error'](_0x9c0b('0x14'),_0x4988e8,_0x5e26b6[_0x9c0b('0x18')][_0x9c0b('0x1a')]);return _0x1db8b6(_0x5e26b6['error'][_0x9c0b('0x1a')]);}logger[_0x9c0b('0x18')](_0x9c0b('0x14'),_0x4988e8,_0x5e26b6[_0x9c0b('0x18')][_0x9c0b('0x1a')]);return _0x2701ef(_0x5e26b6[_0x9c0b('0x18')][_0x9c0b('0x1a')]);}else{logger[_0x9c0b('0x13')](_0x9c0b('0x14'),_0x4988e8,'request\x20sent');_0x2701ef(_0x5e26b6['result'][_0x9c0b('0x1a')]);}})[_0x9c0b('0x1b')](function(_0x405ad1){logger[_0x9c0b('0x18')](_0x9c0b('0x14'),_0x4988e8,_0x405ad1);_0x1db8b6(_0x405ad1);});});}exports['CreateChatMessage']=function(_0x420669){var _0x22bc4e=this;return new Promise(function(_0x5b96a1,_0x14ed73){return db[_0x9c0b('0x1c')][_0x9c0b('0x1d')](_0x420669[_0x9c0b('0x1e')],{'raw':_0x420669[_0x9c0b('0x1f')]?_0x420669[_0x9c0b('0x1f')][_0x9c0b('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ad33c){logger[_0x9c0b('0x13')](_0x9c0b('0x21'),_0x420669);logger[_0x9c0b('0x16')](_0x9c0b('0x21'),_0x420669,JSON[_0x9c0b('0x22')](_0x1ad33c));_0x5b96a1(_0x1ad33c);})[_0x9c0b('0x1b')](function(_0x390a7e){logger[_0x9c0b('0x18')]('CreateChatMessage',_0x390a7e[_0x9c0b('0x1a')],_0x420669);_0x14ed73(_0x22bc4e['error'](0x1f4,_0x390a7e[_0x9c0b('0x1a')]));});});}; \ No newline at end of file +var _0x689b=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14c65b,_0x10b662){var _0x7ed29a=function(_0x70006){while(--_0x70006){_0x14c65b['push'](_0x14c65b['shift']());}};_0x7ed29a(++_0x10b662);}(_0x689b,0x85));var _0xb689=function(_0x4eb323,_0x49d8f9){_0x4eb323=_0x4eb323-0x0;var _0x7f586b=_0x689b[_0x4eb323];return _0x7f586b;};'use strict';var _=require('lodash');var util=require(_0xb689('0x0'));var moment=require(_0xb689('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb689('0x2'));var db=require(_0xb689('0x3'))['db'];var utils=require(_0xb689('0x4'));var logger=require(_0xb689('0x5'))(_0xb689('0x6'));var config=require(_0xb689('0x7'));var jayson=require(_0xb689('0x8'));var client=jayson[_0xb689('0x9')][_0xb689('0xa')]({'port':0x232a});config[_0xb689('0xb')]=_[_0xb689('0xc')](config[_0xb689('0xb')],{'host':_0xb689('0xd'),'port':0x18eb});var socket=require(_0xb689('0xe'))(new Redis(config[_0xb689('0xb')]));require(_0xb689('0xf'))[_0xb689('0x10')](socket);function respondWithRpcPromise(_0xb66f20,_0x540d0a,_0x28bf5a){return new BPromise(function(_0x8c1455,_0x329dbd){return client[_0xb689('0x11')](_0xb66f20,_0x28bf5a)['then'](function(_0x4f791e){logger[_0xb689('0x12')](_0xb689('0x13'),_0x540d0a,_0xb689('0x14'));logger[_0xb689('0x15')](_0xb689('0x16'),_0x540d0a,_0xb689('0x14'),JSON[_0xb689('0x17')](_0x4f791e));if(_0x4f791e['error']){if(_0x4f791e[_0xb689('0x18')][_0xb689('0x19')]===0x1f4){logger[_0xb689('0x18')](_0xb689('0x13'),_0x540d0a,_0x4f791e[_0xb689('0x18')][_0xb689('0x1a')]);return _0x329dbd(_0x4f791e['error'][_0xb689('0x1a')]);}logger['error'](_0xb689('0x13'),_0x540d0a,_0x4f791e[_0xb689('0x18')]['message']);return _0x8c1455(_0x4f791e[_0xb689('0x18')]['message']);}else{logger[_0xb689('0x12')](_0xb689('0x13'),_0x540d0a,_0xb689('0x14'));_0x8c1455(_0x4f791e[_0xb689('0x1b')][_0xb689('0x1a')]);}})[_0xb689('0x1c')](function(_0x433448){logger['error']('ChatMessage,\x20%s,\x20%s',_0x540d0a,_0x433448);_0x329dbd(_0x433448);});});}exports[_0xb689('0x1d')]=function(_0x10c612){var _0x4faccd=this;return new Promise(function(_0x20e71b,_0x47ae2d){return db[_0xb689('0x1e')][_0xb689('0x1f')](_0x10c612[_0xb689('0x20')],{'raw':_0x10c612[_0xb689('0x21')]?_0x10c612['options'][_0xb689('0x22')]===undefined?!![]:![]:!![]})[_0xb689('0x23')](function(_0xd97bd){logger['info']('CreateChatMessage',_0x10c612);logger[_0xb689('0x15')](_0xb689('0x1d'),_0x10c612,JSON[_0xb689('0x17')](_0xd97bd));_0x20e71b(_0xd97bd);})['catch'](function(_0x168991){logger[_0xb689('0x18')](_0xb689('0x1d'),_0x168991['message'],_0x10c612);_0x47ae2d(_0x4faccd[_0xb689('0x18')](0x1f4,_0x168991[_0xb689('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f7debec..b43fc9d 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 _0x3248=['save','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3248,0x1bc));var _0x8324=function(_0x2ac24f,_0x5a1436){_0x2ac24f=_0x2ac24f-0x0;var _0x3dcb45=_0x3248[_0x2ac24f];return _0x3dcb45;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x8324('0x0'),'remove','update'];function createListener(_0x1daa25,_0xf7c3f5){return function(_0x257d13){_0xf7c3f5[_0x8324('0x1')](_0x1daa25,_0x257d13);};}function removeListener(_0x2cfce9,_0x334505){return function(){ChatMessageEvents['removeListener'](_0x2cfce9,_0x334505);};}exports[_0x8324('0x2')]=function(_0x1c5c2a){for(var _0x5157f4=0x0,_0x25ee7a=events[_0x8324('0x3')];_0x5157f4<_0x25ee7a;_0x5157f4++){var _0x4302c5=events[_0x5157f4];var _0x1514c0=createListener('chatMessage:'+_0x4302c5,_0x1c5c2a);ChatMessageEvents['on'](_0x4302c5,_0x1514c0);}}; \ No newline at end of file +var _0x56a4=['removeListener','register','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x161923,_0x577a7f){var _0x2421b5=function(_0x4100ad){while(--_0x4100ad){_0x161923['push'](_0x161923['shift']());}};_0x2421b5(++_0x577a7f);}(_0x56a4,0x11b));var _0x456a=function(_0x4f9c46,_0x361afe){_0x4f9c46=_0x4f9c46-0x0;var _0x155365=_0x56a4[_0x4f9c46];return _0x155365;};'use strict';var ChatMessageEvents=require(_0x456a('0x0'));var events=[_0x456a('0x1'),'remove',_0x456a('0x2')];function createListener(_0x93d98f,_0x5f3fe1){return function(_0x478cac){_0x5f3fe1[_0x456a('0x3')](_0x93d98f,_0x478cac);};}function removeListener(_0x3a11ee,_0x143999){return function(){ChatMessageEvents[_0x456a('0x4')](_0x3a11ee,_0x143999);};}exports[_0x456a('0x5')]=function(_0x4b8eec){for(var _0x3b0145=0x0,_0x52b38d=events['length'];_0x3b0145<_0x52b38d;_0x3b0145++){var _0x2b6329=events[_0x3b0145];var _0x20c8e0=createListener(_0x456a('0x6')+_0x2b6329,_0x4b8eec);ChatMessageEvents['on'](_0x2b6329,_0x20c8e0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a38d0aa..cc0415f 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 _0x4249=['../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x46781d,_0x425b8b){var _0x5b8ebe=function(_0x400946){while(--_0x400946){_0x46781d['push'](_0x46781d['shift']());}};_0x5b8ebe(++_0x425b8b);}(_0x4249,0x91));var _0x9424=function(_0x83541,_0x4e8110){_0x83541=_0x83541-0x0;var _0x5512cd=_0x4249[_0x83541];return _0x5512cd;};'use strict';var multer=require(_0x9424('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9424('0x1')]();var fs_extra=require(_0x9424('0x2'));var auth=require(_0x9424('0x3'));var interaction=require(_0x9424('0x4'));var config=require(_0x9424('0x5'));var controller=require(_0x9424('0x6'));router['get']('/',auth[_0x9424('0x7')](),controller[_0x9424('0x8')]);router['get'](_0x9424('0x9'),auth[_0x9424('0x7')](),controller[_0x9424('0xa')]);router[_0x9424('0xb')](_0x9424('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9424('0xd')]('/',auth['isAuthenticated'](),interaction[_0x9424('0xe')](_0x9424('0xf'),_0x9424('0x10')),controller[_0x9424('0x11')]);router[_0x9424('0x12')](_0x9424('0xc'),controller[_0x9424('0x13')]);router[_0x9424('0x12')]('/:id/accept',auth[_0x9424('0x7')](),controller[_0x9424('0x14')]);router[_0x9424('0x12')](_0x9424('0x15'),auth[_0x9424('0x7')](),controller[_0x9424('0x16')]);router['delete'](_0x9424('0xc'),auth[_0x9424('0x7')](),controller[_0x9424('0x17')]);module[_0x9424('0x18')]=router; \ No newline at end of file +var _0xf139=['delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','create','put','/:id/accept','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf139,0x1ac));var _0x9f13=function(_0x1ae85a,_0x51954e){_0x1ae85a=_0x1ae85a-0x0;var _0x3b3f6e=_0xf139[_0x1ae85a];return _0x3b3f6e;};'use strict';var multer=require(_0x9f13('0x0'));var util=require(_0x9f13('0x1'));var path=require(_0x9f13('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f13('0x3'));var router=express['Router']();var fs_extra=require(_0x9f13('0x4'));var auth=require(_0x9f13('0x5'));var interaction=require(_0x9f13('0x6'));var config=require('../../config/environment');var controller=require(_0x9f13('0x7'));router['get']('/',auth[_0x9f13('0x8')](),controller[_0x9f13('0x9')]);router[_0x9f13('0xa')](_0x9f13('0xb'),auth['isAuthenticated'](),controller[_0x9f13('0xc')]);router[_0x9f13('0xa')](_0x9f13('0xd'),auth['isAuthenticated'](),controller[_0x9f13('0xe')]);router[_0x9f13('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9f13('0x10')](_0x9f13('0x11'),'chatmessage:create'),controller[_0x9f13('0x12')]);router[_0x9f13('0x13')](_0x9f13('0xd'),controller['update']);router['put'](_0x9f13('0x14'),auth[_0x9f13('0x8')](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x9f13('0x15')]);router[_0x9f13('0x16')](_0x9f13('0xd'),auth[_0x9f13('0x8')](),controller[_0x9f13('0x17')]);module[_0x9f13('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 e812a44..d8cfa43 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x43463c,_0x35b85e){var _0x27de00=function(_0x4ddcc1){while(--_0x4ddcc1){_0x43463c['push'](_0x43463c['shift']());}};_0x27de00(++_0x35b85e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x235d9e,_0x19ec87){_0x235d9e=_0x235d9e-0x0;var _0x1d0697=_0x5f2f[_0x235d9e];return _0x1d0697;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x51a552,_0x2538a0){var _0x64c74f=function(_0x28b3fe){while(--_0x28b3fe){_0x51a552['push'](_0x51a552['shift']());}};_0x64c74f(++_0x2538a0);}(_0xdb28,0x106));var _0x8db2=function(_0x246bc3,_0x568e40){_0x246bc3=_0x246bc3-0x0;var _0x4d7565=_0xdb28[_0x246bc3];return _0x4d7565;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('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 b1f28c1..6ef6c85 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x7a54,0x106));var _0x47a5=function(_0x51d81d,_0x1ce950){_0x51d81d=_0x51d81d-0x0;var _0x1ed4bd=_0x7a54[_0x51d81d];return _0x1ed4bd;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));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 as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2382bd,_0x200fa9){var _0x910c96=function(_0x10d6b8){while(--_0x10d6b8){_0x2382bd['push'](_0x2382bd['shift']());}};_0x910c96(++_0x200fa9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));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 as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 5d23189..467c8e8 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x161e=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xb973a0,_0x3a6a43){var _0x2e343c=function(_0x1da96a){while(--_0x1da96a){_0xb973a0['push'](_0xb973a0['shift']());}};_0x2e343c(++_0x3a6a43);}(_0x161e,0x1e8));var _0xe161=function(_0x98ed0a,_0x1d8283){_0x98ed0a=_0x98ed0a-0x0;var _0x165ba7=_0x161e[_0x98ed0a];return _0x165ba7;};'use strict';var EventEmitter=require(_0xe161('0x0'));var ChatOfflineMessage=require(_0xe161('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe161('0x2')](0x0);var events={'afterCreate':_0xe161('0x3'),'afterUpdate':_0xe161('0x4'),'afterDestroy':_0xe161('0x5')};function emitEvent(_0x2921f5){return function(_0x561153,_0x1dc560,_0x117337){ChatOfflineMessageEvents[_0xe161('0x6')](_0x2921f5+':'+_0x561153['id'],_0x561153);ChatOfflineMessageEvents[_0xe161('0x6')](_0x2921f5,_0x561153);_0x117337(null);};}for(var e in events){if(events[_0xe161('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xd4ff=['../../mysqldb','save','update','emit','exports','events'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0xd4ff,0x18b));var _0xfd4f=function(_0x10156d,_0x5a451a){_0x10156d=_0x10156d-0x0;var _0x4ba0c6=_0xd4ff[_0x10156d];return _0x4ba0c6;};'use strict';var EventEmitter=require(_0xfd4f('0x0'));var ChatOfflineMessage=require(_0xfd4f('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfd4f('0x2'),'afterUpdate':_0xfd4f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x33e7ef){return function(_0x46677e,_0x2d507d,_0x601134){ChatOfflineMessageEvents[_0xfd4f('0x4')](_0x33e7ef+':'+_0x46677e['id'],_0x46677e);ChatOfflineMessageEvents[_0xfd4f('0x4')](_0x33e7ef,_0x46677e);_0x601134(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xfd4f('0x5')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index a49f5da..15995b2 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 _0x70a4=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x70a4,0x130));var _0x470a=function(_0x15949f,_0x1d5394){_0x15949f=_0x15949f-0x0;var _0x46e687=_0x70a4[_0x15949f];return _0x46e687;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x4da7e8){return _0x4da7e8[_0x470a('0x0')]('ChatOfflineMessage',attributes,{'tableName':_0x470a('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x470a('0x2'),'collate':_0x470a('0x3')});}; \ No newline at end of file +var _0xd6cf=['utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x4c6d08,_0x3ed890){var _0x4d7854=function(_0x3eea59){while(--_0x3eea59){_0x4c6d08['push'](_0x4c6d08['shift']());}};_0x4d7854(++_0x3ed890);}(_0xd6cf,0x73));var _0xfd6c=function(_0x4b5409,_0x472b71){_0x4b5409=_0x4b5409-0x0;var _0x90b623=_0xd6cf[_0x4b5409];return _0x90b623;};'use strict';var attributes=require(_0xfd6c('0x0'));module[_0xfd6c('0x1')]=function(_0x32db12){return _0x32db12[_0xfd6c('0x2')](_0xfd6c('0x3'),attributes,{'tableName':_0xfd6c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd6c('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3c40bb1..f7d7070 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 _0xdbf7=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x369375,_0x563830){_0x369375=_0x369375-0x0;var _0x3538db=_0xdbf7[_0x369375];return _0x3538db;};'use strict';var _=require(_0x7dbf('0x0'));var util=require(_0x7dbf('0x1'));var moment=require(_0x7dbf('0x2'));var BPromise=require(_0x7dbf('0x3'));var rs=require(_0x7dbf('0x4'));var fs=require('fs');var Redis=require(_0x7dbf('0x5'));var db=require(_0x7dbf('0x6'))['db'];var utils=require(_0x7dbf('0x7'));var logger=require('../../config/logger')(_0x7dbf('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dbf('0x9')][_0x7dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x601b60,_0x3df94e,_0x29f02b){return new BPromise(function(_0x3e7a9c,_0x3f4efe){return client[_0x7dbf('0xb')](_0x601b60,_0x29f02b)[_0x7dbf('0xc')](function(_0x1851fc){logger[_0x7dbf('0xd')](_0x7dbf('0xe'),_0x3df94e,_0x7dbf('0xf'));logger[_0x7dbf('0x10')](_0x7dbf('0x11'),_0x3df94e,'request\x20sent',JSON[_0x7dbf('0x12')](_0x1851fc));if(_0x1851fc[_0x7dbf('0x13')]){if(_0x1851fc[_0x7dbf('0x13')][_0x7dbf('0x14')]===0x1f4){logger[_0x7dbf('0x13')](_0x7dbf('0xe'),_0x3df94e,_0x1851fc['error'][_0x7dbf('0x15')]);return _0x3f4efe(_0x1851fc['error']['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3df94e,_0x1851fc[_0x7dbf('0x13')][_0x7dbf('0x15')]);return _0x3e7a9c(_0x1851fc[_0x7dbf('0x13')]['message']);}else{logger[_0x7dbf('0xd')](_0x7dbf('0xe'),_0x3df94e,_0x7dbf('0xf'));_0x3e7a9c(_0x1851fc['result'][_0x7dbf('0x15')]);}})[_0x7dbf('0x16')](function(_0x11ee4d){logger[_0x7dbf('0x13')](_0x7dbf('0xe'),_0x3df94e,_0x11ee4d);_0x3f4efe(_0x11ee4d);});});} \ No newline at end of file +var _0x3be5=['code','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x220f7d,_0x6be322){var _0x2dbe6a=function(_0x35e6d7){while(--_0x35e6d7){_0x220f7d['push'](_0x220f7d['shift']());}};_0x2dbe6a(++_0x6be322);}(_0x3be5,0x155));var _0x53be=function(_0x4d2865,_0x1f9567){_0x4d2865=_0x4d2865-0x0;var _0x2476c9=_0x3be5[_0x4d2865];return _0x2476c9;};'use strict';var _=require(_0x53be('0x0'));var util=require('util');var moment=require(_0x53be('0x1'));var BPromise=require(_0x53be('0x2'));var rs=require(_0x53be('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53be('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x53be('0x5'));var jayson=require(_0x53be('0x6'));var client=jayson[_0x53be('0x7')][_0x53be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24d38b,_0x3bfe8f,_0x2672ca){return new BPromise(function(_0x4e694e,_0x5e4340){return client[_0x53be('0x9')](_0x24d38b,_0x2672ca)[_0x53be('0xa')](function(_0x5e7b6b){logger[_0x53be('0xb')](_0x53be('0xc'),_0x3bfe8f,_0x53be('0xd'));logger[_0x53be('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3bfe8f,_0x53be('0xd'),JSON[_0x53be('0xf')](_0x5e7b6b));if(_0x5e7b6b['error']){if(_0x5e7b6b['error'][_0x53be('0x10')]===0x1f4){logger['error'](_0x53be('0xc'),_0x3bfe8f,_0x5e7b6b['error']['message']);return _0x5e4340(_0x5e7b6b[_0x53be('0x11')][_0x53be('0x12')]);}logger[_0x53be('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3bfe8f,_0x5e7b6b[_0x53be('0x11')][_0x53be('0x12')]);return _0x4e694e(_0x5e7b6b[_0x53be('0x11')][_0x53be('0x12')]);}else{logger[_0x53be('0xb')](_0x53be('0xc'),_0x3bfe8f,_0x53be('0xd'));_0x4e694e(_0x5e7b6b[_0x53be('0x13')][_0x53be('0x12')]);}})[_0x53be('0x14')](function(_0x360775){logger[_0x53be('0x11')](_0x53be('0xc'),_0x3bfe8f,_0x360775);_0x5e4340(_0x360775);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 68a8cbf..e0961b9 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 _0xb547=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports'];(function(_0x487761,_0x2c24d9){var _0x9ca629=function(_0x3b602e){while(--_0x3b602e){_0x487761['push'](_0x487761['shift']());}};_0x9ca629(++_0x2c24d9);}(_0xb547,0x1e3));var _0x7b54=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0xb547[_0xbc1a4b];return _0x108b87;};'use strict';var multer=require('multer');var util=require(_0x7b54('0x0'));var path=require(_0x7b54('0x1'));var timeout=require(_0x7b54('0x2'));var express=require(_0x7b54('0x3'));var router=express[_0x7b54('0x4')]();var fs_extra=require(_0x7b54('0x5'));var auth=require(_0x7b54('0x6'));var interaction=require(_0x7b54('0x7'));var config=require(_0x7b54('0x8'));var controller=require(_0x7b54('0x9'));router[_0x7b54('0xa')]('/',auth[_0x7b54('0xb')](),controller[_0x7b54('0xc')]);router[_0x7b54('0xa')](_0x7b54('0xd'),auth['isAuthenticated'](),controller[_0x7b54('0xe')]);router[_0x7b54('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7b54('0xf')]);router[_0x7b54('0x10')]('/',auth[_0x7b54('0xb')](),controller['create']);router[_0x7b54('0x11')](_0x7b54('0x12'),auth[_0x7b54('0xb')](),controller[_0x7b54('0x13')]);router[_0x7b54('0x14')]('/:id',auth[_0x7b54('0xb')](),controller[_0x7b54('0x15')]);module[_0x7b54('0x16')]=router; \ No newline at end of file +var _0x2f34=['../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x1e8ef9,_0x357b01){var _0x48cbb0=function(_0x436482){while(--_0x436482){_0x1e8ef9['push'](_0x1e8ef9['shift']());}};_0x48cbb0(++_0x357b01);}(_0x2f34,0x6e));var _0x42f3=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x2f34[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require(_0x42f3('0x0'));var util=require(_0x42f3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x42f3('0x2'));var router=express[_0x42f3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x42f3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x42f3('0x5')]('/',auth[_0x42f3('0x6')](),controller[_0x42f3('0x7')]);router[_0x42f3('0x5')](_0x42f3('0x8'),auth[_0x42f3('0x6')](),controller[_0x42f3('0x9')]);router[_0x42f3('0x5')](_0x42f3('0xa'),auth[_0x42f3('0x6')](),controller[_0x42f3('0xb')]);router[_0x42f3('0xc')]('/',auth[_0x42f3('0x6')](),controller[_0x42f3('0xd')]);router[_0x42f3('0xe')](_0x42f3('0xa'),auth[_0x42f3('0x6')](),controller[_0x42f3('0xf')]);router[_0x42f3('0x10')]('/:id',auth[_0x42f3('0x6')](),controller[_0x42f3('0x11')]);module[_0x42f3('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index fc0a4d0..7b5b0f5 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 _0xe82b=['mouseOver','STRING','sequelize','timeout'];(function(_0x415ef1,_0x2cb3e2){var _0x32422c=function(_0x11136b){while(--_0x11136b){_0x415ef1['push'](_0x415ef1['shift']());}};_0x32422c(++_0x2cb3e2);}(_0xe82b,0x18a));var _0xbe82=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe82b[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xbe82('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xbe82('0x1')),'defaultValue':_0xbe82('0x2')},'selector':{'type':Sequelize[_0xbe82('0x3')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4322=['timeout','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4322,0xd9));var _0x2432=function(_0x3609a6,_0x398caf){_0x3609a6=_0x3609a6-0x0;var _0x18429b=_0x4322[_0x3609a6];return _0x18429b;};'use strict';var Sequelize=require(_0x2432('0x0'));module[_0x2432('0x1')]={'name':{'type':Sequelize[_0x2432('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2432('0x3')](_0x2432('0x4'),_0x2432('0x5')),'defaultValue':_0x2432('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 5431cab..0785bb2 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 _0xa991=['fields','length','include','merge','create','body','catch','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','attributes','intersection'];(function(_0x2c53bc,_0x5edba0){var _0x37886c=function(_0x4cb3b7){while(--_0x4cb3b7){_0x2c53bc['push'](_0x2c53bc['shift']());}};_0x37886c(++_0x5edba0);}(_0xa991,0x143));var _0x1a99=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa991[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0x1a99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a99('0x1'));var jsonpatch=require(_0x1a99('0x2'));var rp=require(_0x1a99('0x3'));var moment=require(_0x1a99('0x4'));var BPromise=require(_0x1a99('0x5'));var Mustache=require('mustache');var util=require(_0x1a99('0x6'));var path=require(_0x1a99('0x7'));var sox=require(_0x1a99('0x8'));var csv=require(_0x1a99('0x9'));var ejs=require(_0x1a99('0xa'));var fs=require('fs');var fs_extra=require(_0x1a99('0xb'));var _=require(_0x1a99('0xc'));var squel=require('squel');var crypto=require(_0x1a99('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a99('0xe'));var toCsv=require(_0x1a99('0x9'));var querystring=require(_0x1a99('0xf'));var Papa=require(_0x1a99('0x10'));var Redis=require(_0x1a99('0x11'));var authService=require(_0x1a99('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1a99('0x13'));var hardwareService=require(_0x1a99('0x14'));var logger=require(_0x1a99('0x15'))('api');var utils=require(_0x1a99('0x16'));var config=require(_0x1a99('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a99('0x18'))['db'];function respondWithStatusCode(_0x539d17,_0x4839ed){_0x4839ed=_0x4839ed||0xcc;return function(_0x11e4a7){if(_0x11e4a7){return _0x539d17[_0x1a99('0x19')](_0x4839ed);}return _0x539d17[_0x1a99('0x1a')](_0x4839ed)[_0x1a99('0x1b')]();};}function respondWithResult(_0x49d5f7,_0x957f06){_0x957f06=_0x957f06||0xc8;return function(_0x2eb92f){if(_0x2eb92f){return _0x49d5f7[_0x1a99('0x1a')](_0x957f06)[_0x1a99('0x1c')](_0x2eb92f);}};}function respondWithFilteredResult(_0x2ef6f4,_0x4efdb6){return function(_0x257450){if(_0x257450){var _0x4a4e28=typeof _0x4efdb6[_0x1a99('0x1d')]===_0x1a99('0x1e')&&typeof _0x4efdb6[_0x1a99('0x1f')]===_0x1a99('0x1e');var _0x26b4d0=_0x257450[_0x1a99('0x20')];var _0x5c0f09=_0x4a4e28?0x0:_0x4efdb6['offset'];var _0x250781=_0x4a4e28?_0x257450['count']:_0x4efdb6[_0x1a99('0x1d')]+_0x4efdb6[_0x1a99('0x1f')];var _0x4753b4;if(_0x250781>=_0x26b4d0){_0x250781=_0x26b4d0;_0x4753b4=0xc8;}else{_0x4753b4=0xce;}_0x2ef6f4[_0x1a99('0x1a')](_0x4753b4);return _0x2ef6f4[_0x1a99('0x21')](_0x1a99('0x22'),_0x5c0f09+'-'+_0x250781+'/'+_0x26b4d0)[_0x1a99('0x1c')](_0x257450);}return null;};}function patchUpdates(_0x4f6087){return function(_0x41d1d0){try{jsonpatch[_0x1a99('0x23')](_0x41d1d0,_0x4f6087,!![]);}catch(_0x3fccfb){return BPromise[_0x1a99('0x24')](_0x3fccfb);}return _0x41d1d0[_0x1a99('0x25')]();};}function saveUpdates(_0x583f65,_0x31d6e5){return function(_0x9875db){if(_0x9875db){return _0x9875db[_0x1a99('0x26')](_0x583f65)[_0x1a99('0x27')](function(_0x510ec6){return _0x510ec6;});}return null;};}function removeEntity(_0xca6db7,_0x2e6a05){return function(_0x5dfe1f){if(_0x5dfe1f){return _0x5dfe1f[_0x1a99('0x28')]()[_0x1a99('0x27')](function(){_0xca6db7['status'](0xcc)[_0x1a99('0x1b')]();});}};}function handleEntityNotFound(_0x1812be,_0x1c4033){return function(_0x54faf6){if(!_0x54faf6){_0x1812be['sendStatus'](0x194);}return _0x54faf6;};}function handleError(_0x2a5e66,_0x5c5c83){_0x5c5c83=_0x5c5c83||0x1f4;return function(_0x210060){logger[_0x1a99('0x29')](_0x210060[_0x1a99('0x2a')]);if(_0x210060[_0x1a99('0x2b')]){delete _0x210060[_0x1a99('0x2b')];}_0x2a5e66[_0x1a99('0x1a')](_0x5c5c83)[_0x1a99('0x2c')](_0x210060);};}exports[_0x1a99('0x2d')]=function(_0x66b7a4,_0xe92ae1){var _0x5ddaf4={'raw':!![],'where':{'id':_0x66b7a4[_0x1a99('0x2e')]['id']}},_0x5d4545={};_0x5d4545[_0x1a99('0x2f')]=_['keys'](db[_0x1a99('0x30')][_0x1a99('0x31')]);_0x5d4545[_0x1a99('0x32')]=_[_0x1a99('0x33')](_0x66b7a4[_0x1a99('0x32')]);_0x5d4545[_0x1a99('0x34')]=_['intersection'](_0x5d4545['model'],_0x5d4545[_0x1a99('0x32')]);_0x5ddaf4[_0x1a99('0x35')]=_[_0x1a99('0x36')](_0x5d4545[_0x1a99('0x2f')],qs['fields'](_0x66b7a4[_0x1a99('0x32')][_0x1a99('0x37')]));_0x5ddaf4[_0x1a99('0x35')]=_0x5ddaf4[_0x1a99('0x35')][_0x1a99('0x38')]?_0x5ddaf4[_0x1a99('0x35')]:_0x5d4545['model'];if(_0x66b7a4[_0x1a99('0x32')]['includeAll']){_0x5ddaf4[_0x1a99('0x39')]=[{'all':!![]}];}_0x5ddaf4=_[_0x1a99('0x3a')]({},_0x5ddaf4,_0x66b7a4['options']);return db[_0x1a99('0x30')]['find'](_0x5ddaf4)['then'](handleEntityNotFound(_0xe92ae1,null))[_0x1a99('0x27')](respondWithResult(_0xe92ae1,null))['catch'](handleError(_0xe92ae1,null));};exports[_0x1a99('0x3b')]=function(_0x46c4c7,_0x1f66ac){return db[_0x1a99('0x30')][_0x1a99('0x3b')](_0x46c4c7[_0x1a99('0x3c')],{})[_0x1a99('0x27')](respondWithResult(_0x1f66ac,0xc9))[_0x1a99('0x3d')](handleError(_0x1f66ac,null));};exports[_0x1a99('0x26')]=function(_0x52c781,_0x37c141){if(_0x52c781[_0x1a99('0x3c')]['id']){delete _0x52c781[_0x1a99('0x3c')]['id'];}return db[_0x1a99('0x30')][_0x1a99('0x3e')]({'where':{'id':_0x52c781[_0x1a99('0x2e')]['id']}})[_0x1a99('0x27')](handleEntityNotFound(_0x37c141,null))[_0x1a99('0x27')](saveUpdates(_0x52c781['body'],null))[_0x1a99('0x27')](respondWithResult(_0x37c141,null))[_0x1a99('0x3d')](handleError(_0x37c141,null));};exports[_0x1a99('0x28')]=function(_0x5040e8,_0x3508cb){return db[_0x1a99('0x30')][_0x1a99('0x3e')]({'where':{'id':_0x5040e8[_0x1a99('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3508cb,null))[_0x1a99('0x27')](removeEntity(_0x3508cb,null))[_0x1a99('0x3d')](handleError(_0x3508cb,null));}; \ No newline at end of file +var _0x85d0=['util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','keys','query','intersection','fields','attributes','length','includeAll','include','merge','options','catch','create','body','find','request-promise','moment','bluebird','mustache'];(function(_0x1e0b4c,_0x592811){var _0x333654=function(_0x28f012){while(--_0x28f012){_0x1e0b4c['push'](_0x1e0b4c['shift']());}};_0x333654(++_0x592811);}(_0x85d0,0x164));var _0x085d=function(_0x37a2c3,_0x326611){_0x37a2c3=_0x37a2c3-0x0;var _0x508f89=_0x85d0[_0x37a2c3];return _0x508f89;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={'raw':!![],'where':{'id':_0x3faf6b[_0x085d('0x2a')]['id']}},_0x2eae2c={};_0x2eae2c[_0x085d('0x2b')]=_['keys'](db[_0x085d('0x2c')][_0x085d('0x2d')]);_0x2eae2c['query']=_[_0x085d('0x2e')](_0x3faf6b[_0x085d('0x2f')]);_0x2eae2c['filters']=_[_0x085d('0x30')](_0x2eae2c[_0x085d('0x2b')],_0x2eae2c[_0x085d('0x2f')]);_0x2f670c['attributes']=_[_0x085d('0x30')](_0x2eae2c[_0x085d('0x2b')],qs[_0x085d('0x31')](_0x3faf6b['query'][_0x085d('0x31')]));_0x2f670c['attributes']=_0x2f670c[_0x085d('0x32')][_0x085d('0x33')]?_0x2f670c[_0x085d('0x32')]:_0x2eae2c[_0x085d('0x2b')];if(_0x3faf6b['query'][_0x085d('0x34')]){_0x2f670c[_0x085d('0x35')]=[{'all':!![]}];}_0x2f670c=_[_0x085d('0x36')]({},_0x2f670c,_0x3faf6b[_0x085d('0x37')]);return db['ChatProactiveAction']['find'](_0x2f670c)[_0x085d('0x24')](handleEntityNotFound(_0x5c7849,null))[_0x085d('0x24')](respondWithResult(_0x5c7849,null))[_0x085d('0x38')](handleError(_0x5c7849,null));};exports[_0x085d('0x39')]=function(_0x22a83f,_0x2f2b65){return db[_0x085d('0x2c')][_0x085d('0x39')](_0x22a83f[_0x085d('0x3a')],{})['then'](respondWithResult(_0x2f2b65,0xc9))[_0x085d('0x38')](handleError(_0x2f2b65,null));};exports[_0x085d('0x23')]=function(_0x5cf104,_0x254a9b){if(_0x5cf104['body']['id']){delete _0x5cf104[_0x085d('0x3a')]['id'];}return db[_0x085d('0x2c')]['find']({'where':{'id':_0x5cf104[_0x085d('0x2a')]['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x254a9b,null))[_0x085d('0x24')](saveUpdates(_0x5cf104[_0x085d('0x3a')],null))[_0x085d('0x24')](respondWithResult(_0x254a9b,null))['catch'](handleError(_0x254a9b,null));};exports[_0x085d('0x25')]=function(_0x4842c3,_0x5d52be){return db[_0x085d('0x2c')][_0x085d('0x3b')]({'where':{'id':_0x4842c3[_0x085d('0x2a')]['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x5d52be,null))[_0x085d('0x24')](removeEntity(_0x5d52be,null))['catch'](handleError(_0x5d52be,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index a78a61e..141204f 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 _0x9507=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_proactive_actions','lodash'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x9507,0x1a1));var _0x7950=function(_0x2a31f5,_0x28e656){_0x2a31f5=_0x2a31f5-0x0;var _0x32820a=_0x9507[_0x2a31f5];return _0x32820a;};'use strict';var _=require(_0x7950('0x0'));var util=require(_0x7950('0x1'));var logger=require(_0x7950('0x2'))('api');var moment=require(_0x7950('0x3'));var BPromise=require(_0x7950('0x4'));var rp=require(_0x7950('0x5'));var fs=require('fs');var path=require(_0x7950('0x6'));var rimraf=require(_0x7950('0x7'));var config=require(_0x7950('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x7950('0x9')]=function(_0x417c08,_0x4e0253){return _0x417c08['define']('ChatProactiveAction',attributes,{'tableName':_0x7950('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf3d=['moment','bluebird','request-promise','path','./chatProactiveAction.attributes','exports','define','util','../../config/logger','api'];(function(_0x24783a,_0x75041){var _0x227a77=function(_0x2b736d){while(--_0x2b736d){_0x24783a['push'](_0x24783a['shift']());}};_0x227a77(++_0x75041);}(_0xdf3d,0x115));var _0xddf3=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0xdf3d[_0x462999];return _0x4b1366;};'use strict';var _=require('lodash');var util=require(_0xddf3('0x0'));var logger=require(_0xddf3('0x1'))(_0xddf3('0x2'));var moment=require(_0xddf3('0x3'));var BPromise=require(_0xddf3('0x4'));var rp=require(_0xddf3('0x5'));var fs=require('fs');var path=require(_0xddf3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xddf3('0x7'));module[_0xddf3('0x8')]=function(_0xbfd3c9,_0x4e97a2){return _0xbfd3c9[_0xddf3('0x9')]('ChatProactiveAction',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 401be08..585a702 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 _0x5125=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x2f0a3b,_0x1c1224){var _0x556f01=function(_0x5c7c53){while(--_0x5c7c53){_0x2f0a3b['push'](_0x2f0a3b['shift']());}};_0x556f01(++_0x1c1224);}(_0x5125,0x19d));var _0x5512=function(_0xae7ebf,_0x340293){_0xae7ebf=_0xae7ebf-0x0;var _0x45478d=_0x5125[_0xae7ebf];return _0x45478d;};'use strict';var _=require('lodash');var util=require(_0x5512('0x0'));var moment=require(_0x5512('0x1'));var BPromise=require(_0x5512('0x2'));var rs=require(_0x5512('0x3'));var fs=require('fs');var Redis=require(_0x5512('0x4'));var db=require(_0x5512('0x5'))['db'];var utils=require(_0x5512('0x6'));var logger=require(_0x5512('0x7'))(_0x5512('0x8'));var config=require(_0x5512('0x9'));var jayson=require(_0x5512('0xa'));var client=jayson[_0x5512('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1df15a,_0x3e9943,_0x40369f){return new BPromise(function(_0x474ffd,_0x5a9428){return client['request'](_0x1df15a,_0x40369f)[_0x5512('0xc')](function(_0x8aac4f){logger[_0x5512('0xd')](_0x5512('0xe'),_0x3e9943,_0x5512('0xf'));logger[_0x5512('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3e9943,_0x5512('0xf'),JSON[_0x5512('0x11')](_0x8aac4f));if(_0x8aac4f[_0x5512('0x12')]){if(_0x8aac4f[_0x5512('0x12')][_0x5512('0x13')]===0x1f4){logger[_0x5512('0x12')](_0x5512('0xe'),_0x3e9943,_0x8aac4f[_0x5512('0x12')][_0x5512('0x14')]);return _0x5a9428(_0x8aac4f['error']['message']);}logger[_0x5512('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x3e9943,_0x8aac4f['error']['message']);return _0x474ffd(_0x8aac4f[_0x5512('0x12')][_0x5512('0x14')]);}else{logger[_0x5512('0xd')](_0x5512('0xe'),_0x3e9943,_0x5512('0xf'));_0x474ffd(_0x8aac4f[_0x5512('0x15')]['message']);}})[_0x5512('0x16')](function(_0x24a6f6){logger['error'](_0x5512('0xe'),_0x3e9943,_0x24a6f6);_0x5a9428(_0x24a6f6);});});} \ No newline at end of file +var _0xa672=['error','code','message','ChatProactiveAction,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x11ca1f,_0x41cdac){var _0x5e05a0=function(_0x304e0f){while(--_0x304e0f){_0x11ca1f['push'](_0x11ca1f['shift']());}};_0x5e05a0(++_0x41cdac);}(_0xa672,0x131));var _0x2a67=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa672[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x2a67('0x0'));var util=require(_0x2a67('0x1'));var moment=require('moment');var BPromise=require(_0x2a67('0x2'));var rs=require(_0x2a67('0x3'));var fs=require('fs');var Redis=require(_0x2a67('0x4'));var db=require(_0x2a67('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a67('0x6'))(_0x2a67('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2a67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e9d16,_0x55be85,_0x5078b1){return new BPromise(function(_0x1c330b,_0x72c365){return client[_0x2a67('0x9')](_0x1e9d16,_0x5078b1)[_0x2a67('0xa')](function(_0x1f8f84){logger[_0x2a67('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x55be85,_0x2a67('0xc'));logger[_0x2a67('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x55be85,'request\x20sent',JSON[_0x2a67('0xe')](_0x1f8f84));if(_0x1f8f84[_0x2a67('0xf')]){if(_0x1f8f84[_0x2a67('0xf')][_0x2a67('0x10')]===0x1f4){logger[_0x2a67('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x55be85,_0x1f8f84[_0x2a67('0xf')]['message']);return _0x72c365(_0x1f8f84[_0x2a67('0xf')][_0x2a67('0x11')]);}logger[_0x2a67('0xf')](_0x2a67('0x12'),_0x55be85,_0x1f8f84[_0x2a67('0xf')][_0x2a67('0x11')]);return _0x1c330b(_0x1f8f84['error'][_0x2a67('0x11')]);}else{logger[_0x2a67('0xb')](_0x2a67('0x12'),_0x55be85,'request\x20sent');_0x1c330b(_0x1f8f84['result'][_0x2a67('0x11')]);}})[_0x2a67('0x13')](function(_0x4a7129){logger[_0x2a67('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x55be85,_0x4a7129);_0x72c365(_0x4a7129);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a8a871b..c4befd7 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x5c0dac,_0x16af8a){var _0x120f7a=function(_0x13720c){while(--_0x13720c){_0x5c0dac['push'](_0x5c0dac['shift']());}};_0x120f7a(++_0x16af8a);}(_0xd8fb,0x99));var _0xbd8f=function(_0x34dc64,_0x130468){_0x34dc64=_0x34dc64-0x0;var _0x15b4c1=_0xd8fb[_0x34dc64];return _0x15b4c1;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router; \ No newline at end of file +var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x593941,_0x54b080){var _0x292692=function(_0x9eaf6c){while(--_0x9eaf6c){_0x593941['push'](_0x593941['shift']());}};_0x292692(++_0x54b080);}(_0x7c09,0x102));var _0x97c0=function(_0x15f5a5,_0x24f721){_0x15f5a5=_0x15f5a5-0x0;var _0x5b8ca8=_0x7c09[_0x15f5a5];return _0x5b8ca8;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('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 a8aaa77..db2b247 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 _0x4e92=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x63f089,_0x2bcbb5){var _0x14ff71=function(_0x3fe12e){while(--_0x3fe12e){_0x63f089['push'](_0x63f089['shift']());}};_0x14ff71(++_0x2bcbb5);}(_0x4e92,0x72));var _0x24e9=function(_0x3bc04d,_0x28ab50){_0x3bc04d=_0x3bc04d-0x0;var _0x2a543b=_0x4e92[_0x3bc04d];return _0x2a543b;};'use strict';var Sequelize=require(_0x24e9('0x0'));module[_0x24e9('0x1')]={'name':{'type':Sequelize[_0x24e9('0x2')],'unique':_0x24e9('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x24e9('0x2')]},'timeout':{'type':Sequelize[_0x24e9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x24e9('0x5'),_0x24e9('0x6'))}}; \ No newline at end of file +var _0xa35a=['ENUM','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0xefea40,_0x11f910){var _0x344a2b=function(_0x4b3252){while(--_0x4b3252){_0xefea40['push'](_0xefea40['shift']());}};_0x344a2b(++_0x11f910);}(_0xa35a,0x1b8));var _0xaa35=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xa35a[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0xaa35('0x0'));module['exports']={'name':{'type':Sequelize[_0xaa35('0x1')],'unique':_0xaa35('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaa35('0x1')]},'timeout':{'type':Sequelize[_0xaa35('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaa35('0x4')]('rrmemory','beepall',_0xaa35('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 30c6830..d7dcc4b 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 _0x070e=['describe','findOne','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','getTeams','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','UserChatQueue','findOrCreate','forEach','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','UserProfileResource','end','stack','name','send','index','ChatQueue','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','destroy'];(function(_0x5084c2,_0x1a184a){var _0x1502ba=function(_0x21ff2b){while(--_0x21ff2b){_0x5084c2['push'](_0x5084c2['shift']());}};_0x1502ba(++_0x1a184a);}(_0x070e,0xcb));var _0xe070=function(_0x5b64da,_0x183c4d){_0x5b64da=_0x5b64da-0x0;var _0x1e4b9f=_0x070e[_0x5b64da];return _0x1e4b9f;};'use strict';var emlformat=require(_0xe070('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe070('0x1'));var jsonpatch=require(_0xe070('0x2'));var rp=require(_0xe070('0x3'));var moment=require('moment');var BPromise=require(_0xe070('0x4'));var Mustache=require(_0xe070('0x5'));var util=require(_0xe070('0x6'));var path=require(_0xe070('0x7'));var sox=require(_0xe070('0x8'));var csv=require(_0xe070('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe070('0xa'));var _=require(_0xe070('0xb'));var squel=require(_0xe070('0xc'));var crypto=require(_0xe070('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe070('0xe'));var Papa=require(_0xe070('0xf'));var Redis=require(_0xe070('0x10'));var authService=require(_0xe070('0x11'));var qs=require(_0xe070('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe070('0x13'));var logger=require(_0xe070('0x14'))(_0xe070('0x15'));var utils=require('../../config/utils');var config=require(_0xe070('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe070('0x17'))['db'];config[_0xe070('0x18')]=_['defaults'](config[_0xe070('0x18')],{'host':_0xe070('0x19'),'port':0x18eb});var socket=require(_0xe070('0x1a'))(new Redis(config[_0xe070('0x18')]));require('./chatQueue.socket')[_0xe070('0x1b')](socket);var jayson=require(_0xe070('0x1c'));var client=jayson[_0xe070('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19c23d,_0xdc4b0f,_0x22c771,_0x501baa){return new BPromise(function(_0x12da32,_0xe88fc9){var _0x13fc49=_0x501baa||client;return _0x13fc49[_0xe070('0x1e')](_0x19c23d,_0x22c771)['then'](function(_0x23eadb){logger[_0xe070('0x1f')](_0xe070('0x20'),_0xdc4b0f,_0xe070('0x21'));logger['debug'](_0xe070('0x22'),_0xdc4b0f,_0xe070('0x21'),JSON[_0xe070('0x23')](_0x23eadb));if(_0x23eadb[_0xe070('0x24')]){if(_0x23eadb['error']['code']===0x1f4){logger['error'](_0xe070('0x20'),_0xdc4b0f,_0x23eadb['error'][_0xe070('0x25')]);return _0xe88fc9(_0x23eadb[_0xe070('0x24')][_0xe070('0x25')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0xdc4b0f,_0x23eadb[_0xe070('0x24')]['message']);return _0x12da32(_0x23eadb[_0xe070('0x24')][_0xe070('0x25')]);}else{logger[_0xe070('0x1f')]('ChatQueue,\x20%s,\x20%s',_0xdc4b0f,'request\x20sent');_0x12da32(_0x23eadb[_0xe070('0x26')][_0xe070('0x25')]);}})[_0xe070('0x27')](function(_0x2c0cfd){logger[_0xe070('0x24')](_0xe070('0x20'),_0xdc4b0f,_0x2c0cfd);_0xe88fc9(_0x2c0cfd);});});}function respondWithStatusCode(_0x2fdb6c,_0x5483ad){_0x5483ad=_0x5483ad||0xcc;return function(_0x51c6f3){if(_0x51c6f3){return _0x2fdb6c['sendStatus'](_0x5483ad);}return _0x2fdb6c['status'](_0x5483ad)['end']();};}function respondWithResult(_0x28c3bc,_0x4b5adb){_0x4b5adb=_0x4b5adb||0xc8;return function(_0x439c2f){if(_0x439c2f){return _0x28c3bc[_0xe070('0x28')](_0x4b5adb)['json'](_0x439c2f);}};}function respondWithFilteredResult(_0x3b2d35,_0x1a5ff2){return function(_0x18ec91){if(_0x18ec91){var _0x1a5d82=typeof _0x1a5ff2[_0xe070('0x29')]===_0xe070('0x2a')&&typeof _0x1a5ff2[_0xe070('0x2b')]==='undefined';var _0x2aaa65=_0x18ec91['count'];var _0x18ad79=_0x1a5d82?0x0:_0x1a5ff2[_0xe070('0x29')];var _0x1219cd=_0x1a5d82?_0x18ec91[_0xe070('0x2c')]:_0x1a5ff2[_0xe070('0x29')]+_0x1a5ff2[_0xe070('0x2b')];var _0x1fe192;if(_0x1219cd>=_0x2aaa65){_0x1219cd=_0x2aaa65;_0x1fe192=0xc8;}else{_0x1fe192=0xce;}_0x3b2d35['status'](_0x1fe192);return _0x3b2d35[_0xe070('0x2d')](_0xe070('0x2e'),_0x18ad79+'-'+_0x1219cd+'/'+_0x2aaa65)[_0xe070('0x2f')](_0x18ec91);}return null;};}function patchUpdates(_0x2140d8){return function(_0x19bd9e){try{jsonpatch[_0xe070('0x30')](_0x19bd9e,_0x2140d8,!![]);}catch(_0x2ddcf5){return BPromise[_0xe070('0x31')](_0x2ddcf5);}return _0x19bd9e[_0xe070('0x32')]();};}function saveUpdates(_0x116cf9,_0x15cfe3){return function(_0x5cb1ac){if(_0x5cb1ac){return _0x5cb1ac[_0xe070('0x33')](_0x116cf9)[_0xe070('0x34')](function(_0x175384){return _0x175384;});}return null;};}function removeEntity(_0x4715b5,_0x5e1a22){return function(_0x5be67d){if(_0x5be67d){return _0x5be67d['destroy']()[_0xe070('0x34')](function(){var _0x192d84=_0x5be67d['get']({'plain':!![]});var _0x14d6df='ChatQueues';return db[_0xe070('0x35')]['destroy']({'where':{'type':_0x14d6df,'resourceId':_0x192d84['id']}})[_0xe070('0x34')](function(){return _0x5be67d;});})[_0xe070('0x34')](function(){_0x4715b5['status'](0xcc)[_0xe070('0x36')]();});}};}function handleEntityNotFound(_0x1e8997,_0x4704a2){return function(_0x5ea146){if(!_0x5ea146){_0x1e8997['sendStatus'](0x194);}return _0x5ea146;};}function handleError(_0xb127fb,_0x2af318){_0x2af318=_0x2af318||0x1f4;return function(_0x119162){logger[_0xe070('0x24')](_0x119162[_0xe070('0x37')]);if(_0x119162[_0xe070('0x38')]){delete _0x119162[_0xe070('0x38')];}_0xb127fb[_0xe070('0x28')](_0x2af318)[_0xe070('0x39')](_0x119162);};}exports[_0xe070('0x3a')]=function(_0x102628,_0x57a789){var _0x3a2cbe={},_0x1b4863={},_0x2527c5={'count':0x0,'rows':[]};var _0x21bf69=_['map'](db[_0xe070('0x3b')][_0xe070('0x3c')],function(_0x29815b){return{'name':_0x29815b[_0xe070('0x3d')],'type':_0x29815b['type']['key']};});_0x1b4863[_0xe070('0x3e')]=_[_0xe070('0x3f')](_0x21bf69,_0xe070('0x38'));_0x1b4863[_0xe070('0x40')]=_[_0xe070('0x41')](_0x102628[_0xe070('0x40')]);_0x1b4863['filters']=_[_0xe070('0x42')](_0x1b4863[_0xe070('0x3e')],_0x1b4863[_0xe070('0x40')]);_0x3a2cbe[_0xe070('0x43')]=_[_0xe070('0x42')](_0x1b4863[_0xe070('0x3e')],qs[_0xe070('0x44')](_0x102628[_0xe070('0x40')][_0xe070('0x44')]));_0x3a2cbe[_0xe070('0x43')]=_0x3a2cbe[_0xe070('0x43')][_0xe070('0x45')]?_0x3a2cbe[_0xe070('0x43')]:_0x1b4863[_0xe070('0x3e')];if(!_0x102628[_0xe070('0x40')][_0xe070('0x46')](_0xe070('0x47'))){_0x3a2cbe['limit']=qs[_0xe070('0x2b')](_0x102628[_0xe070('0x40')][_0xe070('0x2b')]);_0x3a2cbe[_0xe070('0x29')]=qs[_0xe070('0x29')](_0x102628['query'][_0xe070('0x29')]);}_0x3a2cbe[_0xe070('0x48')]=qs[_0xe070('0x49')](_0x102628[_0xe070('0x40')][_0xe070('0x49')]);_0x3a2cbe['where']=qs[_0xe070('0x4a')](_[_0xe070('0x4b')](_0x102628['query'],_0x1b4863['filters']),_0x21bf69);if(_0x102628[_0xe070('0x40')][_0xe070('0x4c')]){_0x3a2cbe[_0xe070('0x4d')]=_[_0xe070('0x4e')](_0x3a2cbe[_0xe070('0x4d')],{'$or':_['map'](_0x21bf69,function(_0x324b7c){if(_0x324b7c[_0xe070('0x4f')]!==_0xe070('0x50')){var _0xca80db={};_0xca80db[_0x324b7c[_0xe070('0x38')]]={'$like':'%'+_0x102628[_0xe070('0x40')][_0xe070('0x4c')]+'%'};return _0xca80db;}})});}_0x3a2cbe=_[_0xe070('0x4e')]({},_0x3a2cbe,_0x102628[_0xe070('0x51')]);var _0x3fbbe5={'where':_0x3a2cbe[_0xe070('0x4d')]};return db[_0xe070('0x3b')][_0xe070('0x2c')](_0x3fbbe5)[_0xe070('0x34')](function(_0x1b458b){_0x2527c5[_0xe070('0x2c')]=_0x1b458b;if(_0x102628[_0xe070('0x40')][_0xe070('0x52')]){_0x3a2cbe['include']=[{'all':!![]}];}return db['ChatQueue'][_0xe070('0x53')](_0x3a2cbe);})[_0xe070('0x34')](function(_0x45b4f0){_0x2527c5['rows']=_0x45b4f0;return _0x2527c5;})['then'](respondWithFilteredResult(_0x57a789,_0x3a2cbe))[_0xe070('0x27')](handleError(_0x57a789,null));};exports[_0xe070('0x54')]=function(_0x510ee4,_0x5ea185){var _0xc2bd43={'raw':!![],'where':{'id':_0x510ee4[_0xe070('0x55')]['id']}},_0x3a7044={};_0x3a7044['model']=_[_0xe070('0x41')](db['ChatQueue'][_0xe070('0x3c')]);_0x3a7044['query']=_[_0xe070('0x41')](_0x510ee4[_0xe070('0x40')]);_0x3a7044[_0xe070('0x4a')]=_[_0xe070('0x42')](_0x3a7044['model'],_0x3a7044[_0xe070('0x40')]);_0xc2bd43[_0xe070('0x43')]=_[_0xe070('0x42')](_0x3a7044['model'],qs[_0xe070('0x44')](_0x510ee4[_0xe070('0x40')][_0xe070('0x44')]));_0xc2bd43['attributes']=_0xc2bd43[_0xe070('0x43')][_0xe070('0x45')]?_0xc2bd43[_0xe070('0x43')]:_0x3a7044[_0xe070('0x3e')];if(_0x510ee4[_0xe070('0x40')][_0xe070('0x52')]){_0xc2bd43[_0xe070('0x56')]=[{'all':!![]}];}_0xc2bd43=_['merge']({},_0xc2bd43,_0x510ee4[_0xe070('0x51')]);return db['ChatQueue'][_0xe070('0x57')](_0xc2bd43)['then'](handleEntityNotFound(_0x5ea185,null))['then'](respondWithResult(_0x5ea185,null))[_0xe070('0x27')](handleError(_0x5ea185,null));};exports[_0xe070('0x58')]=function(_0x57b751,_0xbc2cf1){return db[_0xe070('0x3b')]['create'](_0x57b751[_0xe070('0x59')],{})[_0xe070('0x34')](function(_0x3a100d){var _0x4f8ebd=_0x57b751[_0xe070('0x5a')][_0xe070('0x5b')]({'plain':!![]});if(!_0x4f8ebd)throw new Error(_0xe070('0x5c'));if(_0x4f8ebd['role']===_0xe070('0x5a')){var _0x1b3aac=_0x3a100d[_0xe070('0x5b')]({'plain':!![]});var _0xee6ec6=_0xe070('0x5d');return db[_0xe070('0x5e')][_0xe070('0x57')]({'where':{'name':_0xee6ec6,'userProfileId':_0x4f8ebd[_0xe070('0x5f')]},'raw':!![]})['then'](function(_0x47a18d){if(_0x47a18d&&_0x47a18d['autoAssociation']===0x0){return db[_0xe070('0x35')][_0xe070('0x58')]({'name':_0x1b3aac[_0xe070('0x38')],'resourceId':_0x1b3aac['id'],'type':_0x47a18d[_0xe070('0x38')],'sectionId':_0x47a18d['id']},{})[_0xe070('0x34')](function(){return _0x3a100d;});}else{return _0x3a100d;}})['catch'](function(_0xd2822e){logger[_0xe070('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd2822e);throw _0xd2822e;});}return _0x3a100d;})[_0xe070('0x34')](respondWithResult(_0xbc2cf1,0xc9))[_0xe070('0x27')](handleError(_0xbc2cf1,null));};exports[_0xe070('0x33')]=function(_0x2470fb,_0x11759c){if(_0x2470fb[_0xe070('0x59')]['id']){delete _0x2470fb[_0xe070('0x59')]['id'];}return db['ChatQueue'][_0xe070('0x57')]({'where':{'id':_0x2470fb[_0xe070('0x55')]['id']}})[_0xe070('0x34')](handleEntityNotFound(_0x11759c,null))[_0xe070('0x34')](saveUpdates(_0x2470fb[_0xe070('0x59')],null))[_0xe070('0x34')](respondWithResult(_0x11759c,null))[_0xe070('0x27')](handleError(_0x11759c,null));};exports[_0xe070('0x60')]=function(_0x4e3973,_0x56ad6d){return db[_0xe070('0x3b')][_0xe070('0x57')]({'where':{'id':_0x4e3973[_0xe070('0x55')]['id']}})['then'](handleEntityNotFound(_0x56ad6d,null))[_0xe070('0x34')](removeEntity(_0x56ad6d,null))['catch'](handleError(_0x56ad6d,null));};exports[_0xe070('0x61')]=function(_0x24217a,_0x29617b){return db[_0xe070('0x3b')][_0xe070('0x61')]()[_0xe070('0x34')](respondWithResult(_0x29617b,null))['catch'](handleError(_0x29617b,null));};exports['getMembers']=function(_0x5cb56b,_0x14f924,_0x387e78){var _0x3fc3d8={'raw':!![],'where':{}},_0x314b87={},_0x589dfe;return db[_0xe070('0x3b')][_0xe070('0x62')]({'where':{'id':_0x5cb56b['params']['id']}})[_0xe070('0x34')](handleEntityNotFound(_0x14f924,null))[_0xe070('0x34')](function(_0x1a1a8f){if(_0x1a1a8f){_0x589dfe=_0x1a1a8f['get']({'plain':!![]});_0x314b87['model']=_[_0xe070('0x41')](db['UserChatQueue'][_0xe070('0x3c')]);_0x314b87[_0xe070('0x40')]=_['keys'](_0x5cb56b[_0xe070('0x40')]);_0x314b87[_0xe070('0x4a')]=_['intersection'](_0x314b87['model'],_0x314b87[_0xe070('0x40')]);_0x3fc3d8[_0xe070('0x43')]=_['intersection'](_0x314b87[_0xe070('0x3e')],qs[_0xe070('0x44')](_0x5cb56b['query']['fields']));_0x3fc3d8['attributes']=_0x3fc3d8[_0xe070('0x43')][_0xe070('0x45')]?_0x3fc3d8[_0xe070('0x43')]:_0x314b87[_0xe070('0x3e')];if(!_0x5cb56b['query'][_0xe070('0x46')](_0xe070('0x47'))){_0x3fc3d8[_0xe070('0x2b')]=qs[_0xe070('0x2b')](_0x5cb56b[_0xe070('0x40')][_0xe070('0x2b')]);_0x3fc3d8[_0xe070('0x29')]=qs['offset'](_0x5cb56b[_0xe070('0x40')][_0xe070('0x29')]);}_0x3fc3d8['order']=qs[_0xe070('0x49')](_0x5cb56b[_0xe070('0x40')][_0xe070('0x49')]);_0x3fc3d8[_0xe070('0x4d')]=qs[_0xe070('0x4a')](_[_0xe070('0x4b')](_0x5cb56b[_0xe070('0x40')],_0x314b87[_0xe070('0x4a')]));_0x3fc3d8[_0xe070('0x4d')][_0xe070('0x63')]=_0x1a1a8f['id'];if(_0x5cb56b[_0xe070('0x40')][_0xe070('0x4c')]){_0x3fc3d8[_0xe070('0x4d')]=_[_0xe070('0x4e')](_0x3fc3d8[_0xe070('0x4d')],{'$or':_[_0xe070('0x3f')](_0x3fc3d8[_0xe070('0x43')],function(_0x5ee091){var _0x53c60f={};_0x53c60f[_0x5ee091]={'$like':'%'+_0x5cb56b[_0xe070('0x40')][_0xe070('0x4c')]+'%'};return _0x53c60f;})});}_0x3fc3d8=_['merge']({},_0x3fc3d8,_0x5cb56b['options']);return db['UserChatQueue']['findAll'](_0x3fc3d8);}})[_0xe070('0x34')](function(_0x51b066){if(_0x51b066){return db[_0xe070('0x64')][_0xe070('0x65')]({'where':{'id':_[_0xe070('0x3f')](_0x51b066,_0xe070('0x66')),'role':_0xe070('0x67')},'attributes':['id',_0xe070('0x38'),_0xe070('0x68'),_0xe070('0x69'),_0xe070('0x6a')]});}})['then'](function(_0x1709b5){if(_0x1709b5){return{'count':_0x1709b5[_0xe070('0x2c')],'rows':_['map'](_0x1709b5[_0xe070('0x6b')],function(_0x30c557){return{'membername':_0x30c557[_0xe070('0x38')],'UserId':_0x30c557['id'],'queue_name':_0x589dfe['name'],'ChatQueueId':_0x589dfe['id'],'interface':util[_0xe070('0x6c')]('%s/%s','SIP',_0x30c557['name']),'penalty':0x0,'paused':_0x30c557[_0xe070('0x68')],'createdAt':_0x30c557[_0xe070('0x6a')],'updatedAt':_0x30c557[_0xe070('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x14f924,_0x3fc3d8))[_0xe070('0x27')](handleError(_0x14f924,null));};exports['getTeams']=function(_0x430ba0,_0x354f1d,_0x45c124){var _0x47c397={};var _0x25d2e7={};var _0x69e285;var _0x3cb317;return db[_0xe070('0x3b')][_0xe070('0x62')]({'where':{'id':_0x430ba0[_0xe070('0x55')]['id']}})[_0xe070('0x34')](handleEntityNotFound(_0x354f1d,null))[_0xe070('0x34')](function(_0x50b897){if(_0x50b897){_0x69e285=_0x50b897;_0x25d2e7['model']=_[_0xe070('0x41')](db['Team'][_0xe070('0x3c')]);_0x25d2e7[_0xe070('0x40')]=_['keys'](_0x430ba0['query']);_0x25d2e7['filters']=_['intersection'](_0x25d2e7['model'],_0x25d2e7[_0xe070('0x40')]);_0x47c397[_0xe070('0x43')]=_[_0xe070('0x42')](_0x25d2e7[_0xe070('0x3e')],qs[_0xe070('0x44')](_0x430ba0['query'][_0xe070('0x44')]));_0x47c397[_0xe070('0x43')]=_0x47c397['attributes'][_0xe070('0x45')]?_0x47c397[_0xe070('0x43')]:_0x25d2e7[_0xe070('0x3e')];_0x47c397['order']=qs[_0xe070('0x49')](_0x430ba0[_0xe070('0x40')][_0xe070('0x49')]);_0x47c397['where']=qs[_0xe070('0x4a')](_[_0xe070('0x4b')](_0x430ba0['query'],_0x25d2e7[_0xe070('0x4a')]));if(_0x430ba0[_0xe070('0x40')][_0xe070('0x4c')]){_0x47c397[_0xe070('0x4d')]=_[_0xe070('0x4e')](_0x47c397['where'],{'$or':_['map'](_0x47c397[_0xe070('0x43')],function(_0x491a93){var _0x355f7a={};_0x355f7a[_0x491a93]={'$like':'%'+_0x430ba0[_0xe070('0x40')][_0xe070('0x4c')]+'%'};return _0x355f7a;})});}_0x47c397=_[_0xe070('0x4e')]({},_0x47c397,_0x430ba0[_0xe070('0x51')]);return _0x69e285[_0xe070('0x6d')](_0x47c397);}})[_0xe070('0x34')](function(_0xf9485e){if(_0xf9485e){_0x3cb317=_0xf9485e['length'];if(!_0x430ba0['query'][_0xe070('0x46')](_0xe070('0x47'))){_0x47c397[_0xe070('0x2b')]=qs[_0xe070('0x2b')](_0x430ba0[_0xe070('0x40')]['limit']);_0x47c397[_0xe070('0x29')]=qs[_0xe070('0x29')](_0x430ba0[_0xe070('0x40')][_0xe070('0x29')]);}return _0x69e285[_0xe070('0x6d')](_0x47c397);}})[_0xe070('0x34')](function(_0x4e3e21){if(_0x4e3e21){return _0x4e3e21?{'count':_0x3cb317,'rows':_0x4e3e21}:null;}})[_0xe070('0x34')](respondWithResult(_0x354f1d,null))[_0xe070('0x27')](handleError(_0x354f1d,null));};exports['addTeams']=function(_0x16834f,_0x4d67fa,_0x292087){var _0x49cdf0=_0x16834f[_0xe070('0x59')][_0xe070('0x6e')];return db[_0xe070('0x6f')][_0xe070('0x53')]({'where':{'id':_0x49cdf0},'attributes':['id'],'include':[{'model':db[_0xe070('0x64')],'as':_0xe070('0x70'),'attributes':['id',_0xe070('0x38'),_0xe070('0x71'),'voicePause',_0xe070('0x72')],'raw':!![]}]})[_0xe070('0x34')](function(_0x1b40c4){if(_0x1b40c4){var _0xd0d5f5=_[_0xe070('0x73')](_0x1b40c4,function(_0x208384){var _0x23d73a=_0x208384[_0xe070('0x5b')]({'plain':!![]});return _0x23d73a[_0xe070('0x70')];});return db['ChatQueue'][_0xe070('0x57')]({'where':{'id':_0x16834f['params']['id']}})[_0xe070('0x34')](function(_0x556703){return db[_0xe070('0x74')][_0xe070('0x75')](function(_0x10544a){return _0x556703[_0xe070('0x76')](_0x49cdf0,{'transaction':_0x10544a})['then'](function(){return BPromise[_0xe070('0x77')](_0xd0d5f5,function(_0x23839e){return db[_0xe070('0x78')][_0xe070('0x79')]({'where':{'UserId':_0x23839e['id'],'ChatQueueId':_0x16834f['params']['id']},'transaction':_0x10544a});});})[_0xe070('0x34')](function(){_0xd0d5f5[_0xe070('0x7a')](function(_0xbcd9aa){socket['emit'](_0xe070('0x7b'),{'UserId':_0xbcd9aa['id'],'ChatQueueId':_0x556703['id']});});});});});}})[_0xe070('0x34')](respondWithStatusCode(_0x4d67fa,null))[_0xe070('0x27')](handleError(_0x4d67fa,null));};exports['removeTeams']=function(_0x1abf30,_0x9b353e,_0x463c6c){return db[_0xe070('0x6f')][_0xe070('0x53')]({'where':{'id':_0x1abf30[_0xe070('0x40')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe070('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe070('0x34')](handleEntityNotFound(_0x9b353e,null))[_0xe070('0x34')](function(_0x4eb10b){var _0x203857=_[_0xe070('0x3f')](_0x4eb10b,'id');var _0x2e52f4=[];var _0x20d85e=[];var _0xc38e20=squel['select']();_0xc38e20[_0xe070('0x7c')](_0xe070('0x7d'))[_0xe070('0x7e')](_0xe070('0x7f'),'tq')[_0xe070('0x80')](_0xe070('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe070('0x4d')](_0xe070('0x82'),_0x1abf30[_0xe070('0x55')]['id']);for(var _0x5da405=0x0;_0x5da405<_0x4eb10b[_0xe070('0x45')];_0x5da405+=0x1){let _0x5028a6=_0x4eb10b[_0x5da405];for(var _0xf5a047=0x0;_0xf5a047<_0x5028a6[_0xe070('0x70')]['length'];_0xf5a047+=0x1){let _0xeb061b=_0x5028a6[_0xe070('0x70')][_0xf5a047];var _0x23bb17=_0xc38e20[_0xe070('0x83')]();_0x23bb17['where'](_0xe070('0x84'),_0xeb061b['id']);_0x20d85e[_0xe070('0x85')](db[_0xe070('0x74')]['query'](_0x23bb17[_0xe070('0x86')](),{'type':db[_0xe070('0x74')][_0xe070('0x87')]['SELECT']})[_0xe070('0x34')](function(_0x2ea371){if(_0x2ea371[_0xe070('0x45')]===0x1){return _0xeb061b['id'];}else{var _0x8b9b01=_[_0xe070('0x88')](_[_0xe070('0x3f')](_0x2ea371,'TeamId'),function(_0x3ae932){return _[_0xe070('0x89')](_0x203857,_0x3ae932);});if(_0x8b9b01){return _0xeb061b['id'];}}}));}}return BPromise['all'](_0x20d85e)[_0xe070('0x34')](function(_0xbd055c){_0x2e52f4=_(_0x2e52f4)[_0xe070('0x8a')](_0xbd055c)[_0xe070('0x8b')]()[_0xe070('0x8c')]();return db[_0xe070('0x3b')]['find']({'where':{'id':_0x1abf30['params']['id']}})[_0xe070('0x34')](function(_0x1ad18e){return db[_0xe070('0x74')]['transaction'](function(_0x405787){return _0x1ad18e[_0xe070('0x8d')](_0x1abf30[_0xe070('0x40')][_0xe070('0x6e')],{'transaction':_0x405787})[_0xe070('0x34')](function(){if(!_[_0xe070('0x8e')](_0x2e52f4)){return _0x1ad18e[_0xe070('0x8f')](_0x2e52f4,{'transaction':_0x405787});}})['then'](function(){_0x2e52f4[_0xe070('0x7a')](function(_0x560d79){socket[_0xe070('0x90')](_0xe070('0x91'),{'UserId':_0x560d79,'ChatQueueId':_0x1ad18e['id']});});});});});});})[_0xe070('0x34')](respondWithStatusCode(_0x9b353e,null))[_0xe070('0x27')](handleError(_0x9b353e,null));};exports[_0xe070('0x92')]=function(_0x4579a6,_0x2d76f1,_0x3282e8){return db[_0xe070('0x3b')][_0xe070('0x57')]({'where':{'id':_0x4579a6[_0xe070('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d76f1,null))['then'](function(_0x406804){if(_0x406804){return _0x406804['addAgents'](_0x4579a6[_0xe070('0x59')][_0xe070('0x6e')],_[_0xe070('0x93')](_0x4579a6[_0xe070('0x59')],[_0xe070('0x6e'),'id'])||{})['spread'](function(_0x417b84){for(var _0xe5ae28=0x0;_0xe5ae28<_0x4579a6[_0xe070('0x59')][_0xe070('0x6e')]['length'];_0xe5ae28+=0x1){socket['emit'](_0xe070('0x7b'),{'UserId':Number(_0x4579a6['body'][_0xe070('0x6e')][_0xe5ae28]),'ChatQueueId':Number(_0x4579a6['params']['id'])});}return _0x417b84;});}})[_0xe070('0x34')](respondWithResult(_0x2d76f1,null))[_0xe070('0x27')](handleError(_0x2d76f1,null));};exports[_0xe070('0x8f')]=function(_0x4484b7,_0x2b82f3,_0xa4240a){return db[_0xe070('0x3b')][_0xe070('0x57')]({'where':{'id':_0x4484b7[_0xe070('0x55')]['id']}})[_0xe070('0x34')](handleEntityNotFound(_0x2b82f3,null))['then'](function(_0x141451){if(_0x141451){return _0x141451[_0xe070('0x8f')](_0x4484b7[_0xe070('0x40')][_0xe070('0x6e')])[_0xe070('0x34')](function(){if(_[_0xe070('0x94')](_0x4484b7[_0xe070('0x40')][_0xe070('0x6e')])){for(var _0x66af43=0x0;_0x66af43<_0x4484b7[_0xe070('0x40')][_0xe070('0x6e')][_0xe070('0x45')];_0x66af43+=0x1){socket['emit'](_0xe070('0x91'),{'UserId':Number(_0x4484b7[_0xe070('0x40')][_0xe070('0x6e')][_0x66af43]),'ChatQueueId':Number(_0x4484b7[_0xe070('0x55')]['id'])});}}else{socket[_0xe070('0x90')](_0xe070('0x91'),{'UserId':Number(_0x4484b7['query']['ids']),'ChatQueueId':Number(_0x4484b7[_0xe070('0x55')]['id'])});}});}})[_0xe070('0x34')](respondWithStatusCode(_0x2b82f3,null))[_0xe070('0x27')](handleError(_0x2b82f3,null));};exports[_0xe070('0x95')]=function(_0x430e26,_0x4e74c3,_0x557724){var _0xf9fa12={};var _0x2559ab={};var _0x3f3d23;var _0x259e3c;return db[_0xe070('0x3b')][_0xe070('0x62')]({'where':{'id':_0x430e26[_0xe070('0x55')]['id']}})[_0xe070('0x34')](handleEntityNotFound(_0x4e74c3,null))[_0xe070('0x34')](function(_0x49e409){if(_0x49e409){_0x3f3d23=_0x49e409;_0x2559ab[_0xe070('0x3e')]=_[_0xe070('0x41')](db[_0xe070('0x64')][_0xe070('0x3c')]);_0x2559ab[_0xe070('0x40')]=_[_0xe070('0x41')](_0x430e26[_0xe070('0x40')]);_0x2559ab[_0xe070('0x4a')]=_[_0xe070('0x42')](_0x2559ab['model'],_0x2559ab['query']);_0xf9fa12[_0xe070('0x43')]=_[_0xe070('0x42')](_0x2559ab[_0xe070('0x3e')],qs[_0xe070('0x44')](_0x430e26[_0xe070('0x40')][_0xe070('0x44')]));_0xf9fa12[_0xe070('0x43')]=_0xf9fa12[_0xe070('0x43')][_0xe070('0x45')]?_0xf9fa12[_0xe070('0x43')]:_0x2559ab[_0xe070('0x3e')];_0xf9fa12['order']=qs[_0xe070('0x49')](_0x430e26[_0xe070('0x40')][_0xe070('0x49')]);_0xf9fa12[_0xe070('0x4d')]=qs[_0xe070('0x4a')](_[_0xe070('0x4b')](_0x430e26['query'],_0x2559ab[_0xe070('0x4a')]));if(_0x430e26[_0xe070('0x40')][_0xe070('0x4c')]){_0xf9fa12['where']=_[_0xe070('0x4e')](_0xf9fa12[_0xe070('0x4d')],{'$or':_['map'](_0xf9fa12[_0xe070('0x43')],function(_0x536e37){var _0x252b63={};_0x252b63[_0x536e37]={'$like':'%'+_0x430e26[_0xe070('0x40')][_0xe070('0x4c')]+'%'};return _0x252b63;})});}_0xf9fa12=_[_0xe070('0x4e')]({},_0xf9fa12,_0x430e26[_0xe070('0x51')]);return _0x3f3d23[_0xe070('0x95')](_0xf9fa12);}})[_0xe070('0x34')](function(_0x546b04){if(_0x546b04){_0x259e3c=_0x546b04[_0xe070('0x45')];if(!_0x430e26[_0xe070('0x40')][_0xe070('0x46')](_0xe070('0x47'))){_0xf9fa12[_0xe070('0x2b')]=qs[_0xe070('0x2b')](_0x430e26[_0xe070('0x40')][_0xe070('0x2b')]);_0xf9fa12[_0xe070('0x29')]=qs[_0xe070('0x29')](_0x430e26[_0xe070('0x40')][_0xe070('0x29')]);}return _0x3f3d23[_0xe070('0x95')](_0xf9fa12);}})['then'](function(_0x12844e){if(_0x12844e){return _0x12844e?{'count':_0x259e3c,'rows':_0x12844e}:null;}})['then'](respondWithResult(_0x4e74c3,null))[_0xe070('0x27')](handleError(_0x4e74c3,null));}; \ No newline at end of file +var _0x2f2f=['ids','Agents','online','interface','flatMap','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','ChatQueues','UserProfileResource','destroy','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','findOne','UserChatQueue','length','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams'];(function(_0x59db48,_0xe2798){var _0xe15da0=function(_0x331df8){while(--_0x331df8){_0x59db48['push'](_0x59db48['shift']());}};_0xe15da0(++_0xe2798);}(_0x2f2f,0xbf));var _0xf2f2=function(_0x4b27ac,_0x2d12a4){_0x4b27ac=_0x4b27ac-0x0;var _0x32a496=_0x2f2f[_0x4b27ac];return _0x32a496;};'use strict';var emlformat=require(_0xf2f2('0x0'));var rimraf=require(_0xf2f2('0x1'));var zipdir=require(_0xf2f2('0x2'));var jsonpatch=require(_0xf2f2('0x3'));var rp=require(_0xf2f2('0x4'));var moment=require(_0xf2f2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf2f2('0x6'));var util=require(_0xf2f2('0x7'));var path=require('path');var sox=require(_0xf2f2('0x8'));var csv=require(_0xf2f2('0x9'));var ejs=require(_0xf2f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf2f2('0xb'));var _=require(_0xf2f2('0xc'));var squel=require(_0xf2f2('0xd'));var crypto=require(_0xf2f2('0xe'));var jsforce=require(_0xf2f2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf2f2('0x9'));var querystring=require(_0xf2f2('0x10'));var Papa=require('papaparse');var Redis=require(_0xf2f2('0x11'));var authService=require(_0xf2f2('0x12'));var qs=require(_0xf2f2('0x13'));var as=require(_0xf2f2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2f2('0x15'))(_0xf2f2('0x16'));var utils=require(_0xf2f2('0x17'));var config=require(_0xf2f2('0x18'));var licenseUtil=require(_0xf2f2('0x19'));var db=require(_0xf2f2('0x1a'))['db'];config[_0xf2f2('0x1b')]=_['defaults'](config[_0xf2f2('0x1b')],{'host':_0xf2f2('0x1c'),'port':0x18eb});var socket=require(_0xf2f2('0x1d'))(new Redis(config[_0xf2f2('0x1b')]));require('./chatQueue.socket')[_0xf2f2('0x1e')](socket);var jayson=require(_0xf2f2('0x1f'));var client=jayson[_0xf2f2('0x20')][_0xf2f2('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5b782a,_0x4fded7,_0x2a5d51,_0x3b6b26){return new BPromise(function(_0x315fd8,_0x1f52d6){var _0x363083=_0x3b6b26||client;return _0x363083[_0xf2f2('0x22')](_0x5b782a,_0x2a5d51)[_0xf2f2('0x23')](function(_0x4704b3){logger[_0xf2f2('0x24')](_0xf2f2('0x25'),_0x4fded7,_0xf2f2('0x26'));logger[_0xf2f2('0x27')](_0xf2f2('0x28'),_0x4fded7,_0xf2f2('0x26'),JSON[_0xf2f2('0x29')](_0x4704b3));if(_0x4704b3[_0xf2f2('0x2a')]){if(_0x4704b3[_0xf2f2('0x2a')][_0xf2f2('0x2b')]===0x1f4){logger[_0xf2f2('0x2a')](_0xf2f2('0x25'),_0x4fded7,_0x4704b3[_0xf2f2('0x2a')]['message']);return _0x1f52d6(_0x4704b3[_0xf2f2('0x2a')][_0xf2f2('0x2c')]);}logger[_0xf2f2('0x2a')](_0xf2f2('0x25'),_0x4fded7,_0x4704b3[_0xf2f2('0x2a')][_0xf2f2('0x2c')]);return _0x315fd8(_0x4704b3['error'][_0xf2f2('0x2c')]);}else{logger[_0xf2f2('0x24')](_0xf2f2('0x25'),_0x4fded7,_0xf2f2('0x26'));_0x315fd8(_0x4704b3['result']['message']);}})[_0xf2f2('0x2d')](function(_0x3e6ad4){logger['error'](_0xf2f2('0x25'),_0x4fded7,_0x3e6ad4);_0x1f52d6(_0x3e6ad4);});});}function respondWithStatusCode(_0x32ecd8,_0xf0bdd9){_0xf0bdd9=_0xf0bdd9||0xcc;return function(_0x124d4b){if(_0x124d4b){return _0x32ecd8[_0xf2f2('0x2e')](_0xf0bdd9);}return _0x32ecd8['status'](_0xf0bdd9)[_0xf2f2('0x2f')]();};}function respondWithResult(_0x35f658,_0xbb452f){_0xbb452f=_0xbb452f||0xc8;return function(_0x1aade7){if(_0x1aade7){return _0x35f658[_0xf2f2('0x30')](_0xbb452f)[_0xf2f2('0x31')](_0x1aade7);}};}function respondWithFilteredResult(_0xa1d7b8,_0x525d5c){return function(_0x1d4288){if(_0x1d4288){var _0x2f40aa=typeof _0x525d5c[_0xf2f2('0x32')]===_0xf2f2('0x33')&&typeof _0x525d5c[_0xf2f2('0x34')]===_0xf2f2('0x33');var _0x6edecd=_0x1d4288[_0xf2f2('0x35')];var _0x1bd886=_0x2f40aa?0x0:_0x525d5c['offset'];var _0x3ee65c=_0x2f40aa?_0x1d4288[_0xf2f2('0x35')]:_0x525d5c[_0xf2f2('0x32')]+_0x525d5c[_0xf2f2('0x34')];var _0x1aa42d;if(_0x3ee65c>=_0x6edecd){_0x3ee65c=_0x6edecd;_0x1aa42d=0xc8;}else{_0x1aa42d=0xce;}_0xa1d7b8[_0xf2f2('0x30')](_0x1aa42d);return _0xa1d7b8['set']('Content-Range',_0x1bd886+'-'+_0x3ee65c+'/'+_0x6edecd)['json'](_0x1d4288);}return null;};}function patchUpdates(_0x559417){return function(_0x5e964e){try{jsonpatch['apply'](_0x5e964e,_0x559417,!![]);}catch(_0x49aa75){return BPromise[_0xf2f2('0x36')](_0x49aa75);}return _0x5e964e[_0xf2f2('0x37')]();};}function saveUpdates(_0x56ac38,_0x580572){return function(_0x2248d2){if(_0x2248d2){return _0x2248d2[_0xf2f2('0x38')](_0x56ac38)[_0xf2f2('0x23')](function(_0x3da1cf){return _0x3da1cf;});}return null;};}function removeEntity(_0x209bc0,_0x357a57){return function(_0x675e7c){if(_0x675e7c){return _0x675e7c['destroy']()[_0xf2f2('0x23')](function(){var _0x324fe8=_0x675e7c['get']({'plain':!![]});var _0x290e53=_0xf2f2('0x39');return db[_0xf2f2('0x3a')][_0xf2f2('0x3b')]({'where':{'type':_0x290e53,'resourceId':_0x324fe8['id']}})[_0xf2f2('0x23')](function(){return _0x675e7c;});})[_0xf2f2('0x23')](function(){_0x209bc0[_0xf2f2('0x30')](0xcc)[_0xf2f2('0x2f')]();});}};}function handleEntityNotFound(_0x1ad0ec,_0xb153e){return function(_0x236792){if(!_0x236792){_0x1ad0ec[_0xf2f2('0x2e')](0x194);}return _0x236792;};}function handleError(_0x379122,_0x373ee0){_0x373ee0=_0x373ee0||0x1f4;return function(_0x318005){logger[_0xf2f2('0x2a')](_0x318005['stack']);if(_0x318005[_0xf2f2('0x3c')]){delete _0x318005['name'];}_0x379122[_0xf2f2('0x30')](_0x373ee0)[_0xf2f2('0x3d')](_0x318005);};}exports[_0xf2f2('0x3e')]=function(_0x4013e9,_0x27dbfe){var _0x5c8492={},_0x4909e1={},_0x22f7ae={'count':0x0,'rows':[]};var _0x551b95=_[_0xf2f2('0x3f')](db[_0xf2f2('0x40')][_0xf2f2('0x41')],function(_0x293bb0){return{'name':_0x293bb0[_0xf2f2('0x42')],'type':_0x293bb0[_0xf2f2('0x43')][_0xf2f2('0x44')]};});_0x4909e1[_0xf2f2('0x45')]=_[_0xf2f2('0x3f')](_0x551b95,'name');_0x4909e1['query']=_[_0xf2f2('0x46')](_0x4013e9[_0xf2f2('0x47')]);_0x4909e1[_0xf2f2('0x48')]=_['intersection'](_0x4909e1['model'],_0x4909e1['query']);_0x5c8492[_0xf2f2('0x49')]=_[_0xf2f2('0x4a')](_0x4909e1[_0xf2f2('0x45')],qs[_0xf2f2('0x4b')](_0x4013e9[_0xf2f2('0x47')][_0xf2f2('0x4b')]));_0x5c8492[_0xf2f2('0x49')]=_0x5c8492[_0xf2f2('0x49')]['length']?_0x5c8492[_0xf2f2('0x49')]:_0x4909e1[_0xf2f2('0x45')];if(!_0x4013e9['query'][_0xf2f2('0x4c')](_0xf2f2('0x4d'))){_0x5c8492['limit']=qs[_0xf2f2('0x34')](_0x4013e9[_0xf2f2('0x47')]['limit']);_0x5c8492[_0xf2f2('0x32')]=qs[_0xf2f2('0x32')](_0x4013e9[_0xf2f2('0x47')][_0xf2f2('0x32')]);}_0x5c8492[_0xf2f2('0x4e')]=qs[_0xf2f2('0x4f')](_0x4013e9[_0xf2f2('0x47')][_0xf2f2('0x4f')]);_0x5c8492['where']=qs[_0xf2f2('0x48')](_[_0xf2f2('0x50')](_0x4013e9[_0xf2f2('0x47')],_0x4909e1[_0xf2f2('0x48')]),_0x551b95);if(_0x4013e9['query'][_0xf2f2('0x51')]){_0x5c8492[_0xf2f2('0x52')]=_[_0xf2f2('0x53')](_0x5c8492['where'],{'$or':_[_0xf2f2('0x3f')](_0x551b95,function(_0x205daf){if(_0x205daf[_0xf2f2('0x43')]!==_0xf2f2('0x54')){var _0x557a62={};_0x557a62[_0x205daf[_0xf2f2('0x3c')]]={'$like':'%'+_0x4013e9[_0xf2f2('0x47')]['filter']+'%'};return _0x557a62;}})});}_0x5c8492=_[_0xf2f2('0x53')]({},_0x5c8492,_0x4013e9[_0xf2f2('0x55')]);var _0x433471={'where':_0x5c8492[_0xf2f2('0x52')]};return db[_0xf2f2('0x40')][_0xf2f2('0x35')](_0x433471)[_0xf2f2('0x23')](function(_0x55153c){_0x22f7ae['count']=_0x55153c;if(_0x4013e9[_0xf2f2('0x47')][_0xf2f2('0x56')]){_0x5c8492[_0xf2f2('0x57')]=[{'all':!![]}];}return db[_0xf2f2('0x40')][_0xf2f2('0x58')](_0x5c8492);})[_0xf2f2('0x23')](function(_0x72ba68){_0x22f7ae[_0xf2f2('0x59')]=_0x72ba68;return _0x22f7ae;})[_0xf2f2('0x23')](respondWithFilteredResult(_0x27dbfe,_0x5c8492))['catch'](handleError(_0x27dbfe,null));};exports[_0xf2f2('0x5a')]=function(_0x2c136e,_0x3ec912){var _0x529f81={'raw':!![],'where':{'id':_0x2c136e[_0xf2f2('0x5b')]['id']}},_0x25d0f6={};_0x25d0f6[_0xf2f2('0x45')]=_[_0xf2f2('0x46')](db[_0xf2f2('0x40')][_0xf2f2('0x41')]);_0x25d0f6[_0xf2f2('0x47')]=_[_0xf2f2('0x46')](_0x2c136e['query']);_0x25d0f6[_0xf2f2('0x48')]=_[_0xf2f2('0x4a')](_0x25d0f6[_0xf2f2('0x45')],_0x25d0f6[_0xf2f2('0x47')]);_0x529f81[_0xf2f2('0x49')]=_[_0xf2f2('0x4a')](_0x25d0f6['model'],qs[_0xf2f2('0x4b')](_0x2c136e['query'][_0xf2f2('0x4b')]));_0x529f81[_0xf2f2('0x49')]=_0x529f81[_0xf2f2('0x49')]['length']?_0x529f81['attributes']:_0x25d0f6['model'];if(_0x2c136e['query']['includeAll']){_0x529f81[_0xf2f2('0x57')]=[{'all':!![]}];}_0x529f81=_['merge']({},_0x529f81,_0x2c136e['options']);return db[_0xf2f2('0x40')][_0xf2f2('0x5c')](_0x529f81)[_0xf2f2('0x23')](handleEntityNotFound(_0x3ec912,null))['then'](respondWithResult(_0x3ec912,null))['catch'](handleError(_0x3ec912,null));};exports[_0xf2f2('0x5d')]=function(_0x3df991,_0x499316){return db[_0xf2f2('0x40')][_0xf2f2('0x5d')](_0x3df991['body'],{})[_0xf2f2('0x23')](function(_0x42a6d6){var _0x115f13=_0x3df991['user'][_0xf2f2('0x5e')]({'plain':!![]});if(!_0x115f13)throw new Error(_0xf2f2('0x5f'));if(_0x115f13[_0xf2f2('0x60')]===_0xf2f2('0x61')){var _0x58062a=_0x42a6d6['get']({'plain':!![]});var _0x201942='ChatQueues';return db[_0xf2f2('0x62')]['find']({'where':{'name':_0x201942,'userProfileId':_0x115f13[_0xf2f2('0x63')]},'raw':!![]})['then'](function(_0x1feb6a){if(_0x1feb6a&&_0x1feb6a[_0xf2f2('0x64')]===0x0){return db[_0xf2f2('0x3a')]['create']({'name':_0x58062a[_0xf2f2('0x3c')],'resourceId':_0x58062a['id'],'type':_0x1feb6a[_0xf2f2('0x3c')],'sectionId':_0x1feb6a['id']},{})[_0xf2f2('0x23')](function(){return _0x42a6d6;});}else{return _0x42a6d6;}})[_0xf2f2('0x2d')](function(_0x385af4){logger[_0xf2f2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x385af4);throw _0x385af4;});}return _0x42a6d6;})['then'](respondWithResult(_0x499316,0xc9))[_0xf2f2('0x2d')](handleError(_0x499316,null));};exports['update']=function(_0x212455,_0x77b4ff){if(_0x212455['body']['id']){delete _0x212455[_0xf2f2('0x65')]['id'];}return db['ChatQueue'][_0xf2f2('0x5c')]({'where':{'id':_0x212455[_0xf2f2('0x5b')]['id']}})[_0xf2f2('0x23')](handleEntityNotFound(_0x77b4ff,null))[_0xf2f2('0x23')](saveUpdates(_0x212455[_0xf2f2('0x65')],null))[_0xf2f2('0x23')](respondWithResult(_0x77b4ff,null))[_0xf2f2('0x2d')](handleError(_0x77b4ff,null));};exports[_0xf2f2('0x3b')]=function(_0x34413e,_0x645cb3){return db[_0xf2f2('0x40')]['find']({'where':{'id':_0x34413e[_0xf2f2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x645cb3,null))[_0xf2f2('0x23')](removeEntity(_0x645cb3,null))[_0xf2f2('0x2d')](handleError(_0x645cb3,null));};exports['describe']=function(_0x160c09,_0x45658c){return db[_0xf2f2('0x40')][_0xf2f2('0x66')]()[_0xf2f2('0x23')](respondWithResult(_0x45658c,null))[_0xf2f2('0x2d')](handleError(_0x45658c,null));};exports['getMembers']=function(_0x2802ed,_0x4228aa,_0x314287){var _0x2153a5={'raw':!![],'where':{}},_0x30a966={},_0xf126ab;return db['ChatQueue'][_0xf2f2('0x67')]({'where':{'id':_0x2802ed[_0xf2f2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4228aa,null))[_0xf2f2('0x23')](function(_0x140029){if(_0x140029){_0xf126ab=_0x140029['get']({'plain':!![]});_0x30a966[_0xf2f2('0x45')]=_[_0xf2f2('0x46')](db[_0xf2f2('0x68')]['rawAttributes']);_0x30a966[_0xf2f2('0x47')]=_['keys'](_0x2802ed[_0xf2f2('0x47')]);_0x30a966['filters']=_[_0xf2f2('0x4a')](_0x30a966['model'],_0x30a966[_0xf2f2('0x47')]);_0x2153a5[_0xf2f2('0x49')]=_[_0xf2f2('0x4a')](_0x30a966['model'],qs[_0xf2f2('0x4b')](_0x2802ed[_0xf2f2('0x47')][_0xf2f2('0x4b')]));_0x2153a5[_0xf2f2('0x49')]=_0x2153a5[_0xf2f2('0x49')][_0xf2f2('0x69')]?_0x2153a5[_0xf2f2('0x49')]:_0x30a966['model'];if(!_0x2802ed[_0xf2f2('0x47')][_0xf2f2('0x4c')](_0xf2f2('0x4d'))){_0x2153a5[_0xf2f2('0x34')]=qs[_0xf2f2('0x34')](_0x2802ed[_0xf2f2('0x47')][_0xf2f2('0x34')]);_0x2153a5[_0xf2f2('0x32')]=qs[_0xf2f2('0x32')](_0x2802ed[_0xf2f2('0x47')][_0xf2f2('0x32')]);}_0x2153a5[_0xf2f2('0x4e')]=qs[_0xf2f2('0x4f')](_0x2802ed['query'][_0xf2f2('0x4f')]);_0x2153a5[_0xf2f2('0x52')]=qs[_0xf2f2('0x48')](_[_0xf2f2('0x50')](_0x2802ed[_0xf2f2('0x47')],_0x30a966['filters']));_0x2153a5['where'][_0xf2f2('0x6a')]=_0x140029['id'];if(_0x2802ed[_0xf2f2('0x47')][_0xf2f2('0x51')]){_0x2153a5[_0xf2f2('0x52')]=_[_0xf2f2('0x53')](_0x2153a5[_0xf2f2('0x52')],{'$or':_['map'](_0x2153a5[_0xf2f2('0x49')],function(_0x4d96b6){var _0x454077={};_0x454077[_0x4d96b6]={'$like':'%'+_0x2802ed[_0xf2f2('0x47')][_0xf2f2('0x51')]+'%'};return _0x454077;})});}_0x2153a5=_[_0xf2f2('0x53')]({},_0x2153a5,_0x2802ed[_0xf2f2('0x55')]);return db[_0xf2f2('0x68')]['findAll'](_0x2153a5);}})['then'](function(_0x599ec8){if(_0x599ec8){return db[_0xf2f2('0x6b')][_0xf2f2('0x6c')]({'where':{'id':_[_0xf2f2('0x3f')](_0x599ec8,'UserId'),'role':_0xf2f2('0x6d')},'attributes':['id','name',_0xf2f2('0x6e'),_0xf2f2('0x6f'),_0xf2f2('0x70')]});}})[_0xf2f2('0x23')](function(_0x3f06a6){if(_0x3f06a6){return{'count':_0x3f06a6[_0xf2f2('0x35')],'rows':_[_0xf2f2('0x3f')](_0x3f06a6[_0xf2f2('0x59')],function(_0x121b2e){return{'membername':_0x121b2e[_0xf2f2('0x3c')],'UserId':_0x121b2e['id'],'queue_name':_0xf126ab[_0xf2f2('0x3c')],'ChatQueueId':_0xf126ab['id'],'interface':util['format'](_0xf2f2('0x71'),'SIP',_0x121b2e[_0xf2f2('0x3c')]),'penalty':0x0,'paused':_0x121b2e[_0xf2f2('0x6e')],'createdAt':_0x121b2e['createdAt'],'updatedAt':_0x121b2e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf2f2('0x23')](respondWithFilteredResult(_0x4228aa,_0x2153a5))[_0xf2f2('0x2d')](handleError(_0x4228aa,null));};exports[_0xf2f2('0x72')]=function(_0x10f826,_0x42dc8f,_0x3281cf){var _0x49c7e4={};var _0x2223d9={};var _0x41d3d1;var _0x388f8a;return db[_0xf2f2('0x40')][_0xf2f2('0x67')]({'where':{'id':_0x10f826[_0xf2f2('0x5b')]['id']}})[_0xf2f2('0x23')](handleEntityNotFound(_0x42dc8f,null))[_0xf2f2('0x23')](function(_0x57e832){if(_0x57e832){_0x41d3d1=_0x57e832;_0x2223d9[_0xf2f2('0x45')]=_[_0xf2f2('0x46')](db[_0xf2f2('0x73')]['rawAttributes']);_0x2223d9['query']=_[_0xf2f2('0x46')](_0x10f826['query']);_0x2223d9[_0xf2f2('0x48')]=_[_0xf2f2('0x4a')](_0x2223d9[_0xf2f2('0x45')],_0x2223d9[_0xf2f2('0x47')]);_0x49c7e4['attributes']=_['intersection'](_0x2223d9[_0xf2f2('0x45')],qs[_0xf2f2('0x4b')](_0x10f826[_0xf2f2('0x47')][_0xf2f2('0x4b')]));_0x49c7e4[_0xf2f2('0x49')]=_0x49c7e4[_0xf2f2('0x49')][_0xf2f2('0x69')]?_0x49c7e4['attributes']:_0x2223d9[_0xf2f2('0x45')];_0x49c7e4[_0xf2f2('0x4e')]=qs[_0xf2f2('0x4f')](_0x10f826[_0xf2f2('0x47')][_0xf2f2('0x4f')]);_0x49c7e4[_0xf2f2('0x52')]=qs['filters'](_[_0xf2f2('0x50')](_0x10f826[_0xf2f2('0x47')],_0x2223d9[_0xf2f2('0x48')]));if(_0x10f826['query']['filter']){_0x49c7e4[_0xf2f2('0x52')]=_[_0xf2f2('0x53')](_0x49c7e4[_0xf2f2('0x52')],{'$or':_['map'](_0x49c7e4[_0xf2f2('0x49')],function(_0x40e4e9){var _0x26011c={};_0x26011c[_0x40e4e9]={'$like':'%'+_0x10f826[_0xf2f2('0x47')][_0xf2f2('0x51')]+'%'};return _0x26011c;})});}_0x49c7e4=_[_0xf2f2('0x53')]({},_0x49c7e4,_0x10f826['options']);return _0x41d3d1[_0xf2f2('0x72')](_0x49c7e4);}})['then'](function(_0x5350c6){if(_0x5350c6){_0x388f8a=_0x5350c6['length'];if(!_0x10f826[_0xf2f2('0x47')][_0xf2f2('0x4c')](_0xf2f2('0x4d'))){_0x49c7e4[_0xf2f2('0x34')]=qs[_0xf2f2('0x34')](_0x10f826[_0xf2f2('0x47')][_0xf2f2('0x34')]);_0x49c7e4[_0xf2f2('0x32')]=qs[_0xf2f2('0x32')](_0x10f826[_0xf2f2('0x47')]['offset']);}return _0x41d3d1[_0xf2f2('0x72')](_0x49c7e4);}})[_0xf2f2('0x23')](function(_0x5905da){if(_0x5905da){return _0x5905da?{'count':_0x388f8a,'rows':_0x5905da}:null;}})[_0xf2f2('0x23')](respondWithResult(_0x42dc8f,null))['catch'](handleError(_0x42dc8f,null));};exports[_0xf2f2('0x74')]=function(_0x5b6e42,_0x40ce5f,_0x487702){var _0x358c32=_0x5b6e42[_0xf2f2('0x65')][_0xf2f2('0x75')];return db['Team'][_0xf2f2('0x58')]({'where':{'id':_0x358c32},'attributes':['id'],'include':[{'model':db[_0xf2f2('0x6b')],'as':_0xf2f2('0x76'),'attributes':['id','name',_0xf2f2('0x77'),'voicePause',_0xf2f2('0x78')],'raw':!![]}]})[_0xf2f2('0x23')](function(_0x3fe11a){if(_0x3fe11a){var _0x1019fe=_[_0xf2f2('0x79')](_0x3fe11a,function(_0x43239f){var _0x2f0ab0=_0x43239f['get']({'plain':!![]});return _0x2f0ab0[_0xf2f2('0x76')];});return db['ChatQueue']['find']({'where':{'id':_0x5b6e42[_0xf2f2('0x5b')]['id']}})['then'](function(_0x271014){return db['sequelize']['transaction'](function(_0x1da1b9){return _0x271014[_0xf2f2('0x74')](_0x358c32,{'transaction':_0x1da1b9})['then'](function(){return BPromise['each'](_0x1019fe,function(_0x386283){return db[_0xf2f2('0x68')][_0xf2f2('0x7a')]({'where':{'UserId':_0x386283['id'],'ChatQueueId':_0x5b6e42[_0xf2f2('0x5b')]['id']},'transaction':_0x1da1b9});});})[_0xf2f2('0x23')](function(){_0x1019fe[_0xf2f2('0x7b')](function(_0x28b0c0){socket[_0xf2f2('0x7c')](_0xf2f2('0x7d'),{'UserId':_0x28b0c0['id'],'ChatQueueId':_0x271014['id']});});});});});}})['then'](respondWithStatusCode(_0x40ce5f,null))[_0xf2f2('0x2d')](handleError(_0x40ce5f,null));};exports[_0xf2f2('0x7e')]=function(_0x333dbe,_0x268f1d,_0x24f9c5){return db[_0xf2f2('0x73')]['findAll']({'where':{'id':_0x333dbe[_0xf2f2('0x47')][_0xf2f2('0x75')]},'attributes':['id'],'include':[{'model':db[_0xf2f2('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf2f2('0x23')](handleEntityNotFound(_0x268f1d,null))[_0xf2f2('0x23')](function(_0x1e361b){var _0x85ac8f=_['map'](_0x1e361b,'id');var _0x1b199c=[];var _0x382f03=[];var _0x57d969=squel[_0xf2f2('0x7f')]();_0x57d969[_0xf2f2('0x80')](_0xf2f2('0x81'))[_0xf2f2('0x82')](_0xf2f2('0x83'),'tq')[_0xf2f2('0x84')](_0xf2f2('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf2f2('0x52')](_0xf2f2('0x86'),_0x333dbe[_0xf2f2('0x5b')]['id']);for(var _0x42badf=0x0;_0x42badf<_0x1e361b[_0xf2f2('0x69')];_0x42badf+=0x1){let _0x525988=_0x1e361b[_0x42badf];for(var _0x355903=0x0;_0x355903<_0x525988[_0xf2f2('0x76')][_0xf2f2('0x69')];_0x355903+=0x1){let _0x514318=_0x525988[_0xf2f2('0x76')][_0x355903];var _0x12d417=_0x57d969[_0xf2f2('0x87')]();_0x12d417['where'](_0xf2f2('0x88'),_0x514318['id']);_0x382f03[_0xf2f2('0x89')](db[_0xf2f2('0x8a')][_0xf2f2('0x47')](_0x12d417[_0xf2f2('0x8b')](),{'type':db['sequelize'][_0xf2f2('0x8c')][_0xf2f2('0x8d')]})[_0xf2f2('0x23')](function(_0x48ae39){if(_0x48ae39[_0xf2f2('0x69')]===0x1){return _0x514318['id'];}else{var _0x3af329=_[_0xf2f2('0x8e')](_[_0xf2f2('0x3f')](_0x48ae39,'TeamId'),function(_0x371810){return _[_0xf2f2('0x8f')](_0x85ac8f,_0x371810);});if(_0x3af329){return _0x514318['id'];}}}));}}return BPromise[_0xf2f2('0x90')](_0x382f03)[_0xf2f2('0x23')](function(_0x39e021){_0x1b199c=_(_0x1b199c)['union'](_0x39e021)[_0xf2f2('0x91')]()[_0xf2f2('0x92')]();return db[_0xf2f2('0x40')][_0xf2f2('0x5c')]({'where':{'id':_0x333dbe[_0xf2f2('0x5b')]['id']}})[_0xf2f2('0x23')](function(_0x1a2311){return db[_0xf2f2('0x8a')]['transaction'](function(_0x2e2ee9){return _0x1a2311['removeTeams'](_0x333dbe[_0xf2f2('0x47')][_0xf2f2('0x75')],{'transaction':_0x2e2ee9})[_0xf2f2('0x23')](function(){if(!_[_0xf2f2('0x93')](_0x1b199c)){return _0x1a2311['removeAgents'](_0x1b199c,{'transaction':_0x2e2ee9});}})[_0xf2f2('0x23')](function(){_0x1b199c[_0xf2f2('0x7b')](function(_0x47c51a){socket[_0xf2f2('0x7c')](_0xf2f2('0x94'),{'UserId':_0x47c51a,'ChatQueueId':_0x1a2311['id']});});});});});});})['then'](respondWithStatusCode(_0x268f1d,null))['catch'](handleError(_0x268f1d,null));};exports[_0xf2f2('0x95')]=function(_0x5034b4,_0x215f43,_0x21455e){return db[_0xf2f2('0x40')][_0xf2f2('0x5c')]({'where':{'id':_0x5034b4[_0xf2f2('0x5b')]['id']}})[_0xf2f2('0x23')](handleEntityNotFound(_0x215f43,null))[_0xf2f2('0x23')](function(_0x13bcb9){if(_0x13bcb9){return _0x13bcb9['addAgents'](_0x5034b4[_0xf2f2('0x65')][_0xf2f2('0x75')],_[_0xf2f2('0x96')](_0x5034b4[_0xf2f2('0x65')],[_0xf2f2('0x75'),'id'])||{})[_0xf2f2('0x97')](function(_0x1ab7bc){for(var _0x4ef2b3=0x0;_0x4ef2b3<_0x5034b4[_0xf2f2('0x65')][_0xf2f2('0x75')][_0xf2f2('0x69')];_0x4ef2b3+=0x1){socket['emit'](_0xf2f2('0x7d'),{'UserId':Number(_0x5034b4[_0xf2f2('0x65')][_0xf2f2('0x75')][_0x4ef2b3]),'ChatQueueId':Number(_0x5034b4[_0xf2f2('0x5b')]['id'])});}return _0x1ab7bc;});}})[_0xf2f2('0x23')](respondWithResult(_0x215f43,null))[_0xf2f2('0x2d')](handleError(_0x215f43,null));};exports['removeAgents']=function(_0x4d7614,_0x100fc5,_0x114a9b){return db['ChatQueue'][_0xf2f2('0x5c')]({'where':{'id':_0x4d7614[_0xf2f2('0x5b')]['id']}})[_0xf2f2('0x23')](handleEntityNotFound(_0x100fc5,null))[_0xf2f2('0x23')](function(_0x310abf){if(_0x310abf){return _0x310abf[_0xf2f2('0x98')](_0x4d7614[_0xf2f2('0x47')][_0xf2f2('0x75')])[_0xf2f2('0x23')](function(){if(_['isArray'](_0x4d7614[_0xf2f2('0x47')][_0xf2f2('0x75')])){for(var _0x5d99ee=0x0;_0x5d99ee<_0x4d7614[_0xf2f2('0x47')][_0xf2f2('0x75')][_0xf2f2('0x69')];_0x5d99ee+=0x1){socket[_0xf2f2('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x4d7614[_0xf2f2('0x47')][_0xf2f2('0x75')][_0x5d99ee]),'ChatQueueId':Number(_0x4d7614[_0xf2f2('0x5b')]['id'])});}}else{socket['emit'](_0xf2f2('0x94'),{'UserId':Number(_0x4d7614[_0xf2f2('0x47')][_0xf2f2('0x75')]),'ChatQueueId':Number(_0x4d7614[_0xf2f2('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x100fc5,null))[_0xf2f2('0x2d')](handleError(_0x100fc5,null));};exports[_0xf2f2('0x99')]=function(_0x219ace,_0x3a61b6,_0x10f82d){var _0x15046a={};var _0x1c0b91={};var _0x414b03;var _0x2e07d5;return db[_0xf2f2('0x40')][_0xf2f2('0x67')]({'where':{'id':_0x219ace[_0xf2f2('0x5b')]['id']}})[_0xf2f2('0x23')](handleEntityNotFound(_0x3a61b6,null))['then'](function(_0x17ffa3){if(_0x17ffa3){_0x414b03=_0x17ffa3;_0x1c0b91['model']=_[_0xf2f2('0x46')](db['User']['rawAttributes']);_0x1c0b91[_0xf2f2('0x47')]=_[_0xf2f2('0x46')](_0x219ace[_0xf2f2('0x47')]);_0x1c0b91[_0xf2f2('0x48')]=_[_0xf2f2('0x4a')](_0x1c0b91[_0xf2f2('0x45')],_0x1c0b91[_0xf2f2('0x47')]);_0x15046a[_0xf2f2('0x49')]=_[_0xf2f2('0x4a')](_0x1c0b91['model'],qs['fields'](_0x219ace[_0xf2f2('0x47')][_0xf2f2('0x4b')]));_0x15046a[_0xf2f2('0x49')]=_0x15046a[_0xf2f2('0x49')][_0xf2f2('0x69')]?_0x15046a[_0xf2f2('0x49')]:_0x1c0b91[_0xf2f2('0x45')];_0x15046a[_0xf2f2('0x4e')]=qs[_0xf2f2('0x4f')](_0x219ace[_0xf2f2('0x47')]['sort']);_0x15046a[_0xf2f2('0x52')]=qs[_0xf2f2('0x48')](_['pick'](_0x219ace['query'],_0x1c0b91['filters']));if(_0x219ace[_0xf2f2('0x47')][_0xf2f2('0x51')]){_0x15046a[_0xf2f2('0x52')]=_[_0xf2f2('0x53')](_0x15046a[_0xf2f2('0x52')],{'$or':_[_0xf2f2('0x3f')](_0x15046a['attributes'],function(_0x77979b){var _0xeb6f94={};_0xeb6f94[_0x77979b]={'$like':'%'+_0x219ace[_0xf2f2('0x47')]['filter']+'%'};return _0xeb6f94;})});}_0x15046a=_[_0xf2f2('0x53')]({},_0x15046a,_0x219ace['options']);return _0x414b03[_0xf2f2('0x99')](_0x15046a);}})['then'](function(_0x2134c7){if(_0x2134c7){_0x2e07d5=_0x2134c7[_0xf2f2('0x69')];if(!_0x219ace[_0xf2f2('0x47')]['hasOwnProperty'](_0xf2f2('0x4d'))){_0x15046a[_0xf2f2('0x34')]=qs[_0xf2f2('0x34')](_0x219ace[_0xf2f2('0x47')][_0xf2f2('0x34')]);_0x15046a[_0xf2f2('0x32')]=qs[_0xf2f2('0x32')](_0x219ace[_0xf2f2('0x47')]['offset']);}return _0x414b03[_0xf2f2('0x99')](_0x15046a);}})[_0xf2f2('0x23')](function(_0x4c854d){if(_0x4c854d){return _0x4c854d?{'count':_0x2e07d5,'rows':_0x4c854d}:null;}})[_0xf2f2('0x23')](respondWithResult(_0x3a61b6,null))[_0xf2f2('0x2d')](handleError(_0x3a61b6,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8c963c3..e1884a0 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 _0x1975=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit'];(function(_0x5461ad,_0x2b0685){var _0x50cecc=function(_0x652b1b){while(--_0x652b1b){_0x5461ad['push'](_0x5461ad['shift']());}};_0x50cecc(++_0x2b0685);}(_0x1975,0x19d));var _0x5197=function(_0x4c49c0,_0x4adb76){_0x4c49c0=_0x4c49c0-0x0;var _0x596b70=_0x1975[_0x4c49c0];return _0x596b70;};'use strict';var EventEmitter=require(_0x5197('0x0'));var ChatQueue=require(_0x5197('0x1'))['db'][_0x5197('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5197('0x3')](0x0);var events={'afterCreate':_0x5197('0x4'),'afterUpdate':_0x5197('0x5'),'afterDestroy':'remove'};function emitEvent(_0x366003){return function(_0x3353a2,_0x2cc16b,_0x18c806){ChatQueueEvents[_0x5197('0x6')](_0x366003+':'+_0x3353a2['id'],_0x3353a2);ChatQueueEvents[_0x5197('0x6')](_0x366003,_0x3353a2);_0x18c806(null);};}for(var e in events){if(events[_0x5197('0x7')](e)){var event=events[e];ChatQueue[_0x5197('0x8')](e,emitEvent(event));}}module[_0x5197('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xfb9d=['events','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xfb9d,0x120));var _0xdfb9=function(_0x4944a7,_0x3d6fca){_0x4944a7=_0x4944a7-0x0;var _0x2878a3=_0xfb9d[_0x4944a7];return _0x2878a3;};'use strict';var EventEmitter=require(_0xdfb9('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xdfb9('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdfb9('0x2')](0x0);var events={'afterCreate':_0xdfb9('0x3'),'afterUpdate':'update','afterDestroy':_0xdfb9('0x4')};function emitEvent(_0x123fa0){return function(_0xf306c7,_0x3ba62d,_0x39c690){ChatQueueEvents[_0xdfb9('0x5')](_0x123fa0+':'+_0xf306c7['id'],_0xf306c7);ChatQueueEvents['emit'](_0x123fa0,_0xf306c7);_0x39c690(null);};}for(var e in events){if(events[_0xdfb9('0x6')](e)){var event=events[e];ChatQueue[_0xdfb9('0x7')](e,emitEvent(event));}}module[_0xdfb9('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 8ce16a8..af37bfc 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 _0x555e=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x2ccead,_0x4d2522){var _0x273bcf=function(_0x3063de){while(--_0x3063de){_0x2ccead['push'](_0x2ccead['shift']());}};_0x273bcf(++_0x4d2522);}(_0x555e,0x178));var _0xe555=function(_0x5e010d,_0x14008e){_0x5e010d=_0x5e010d-0x0;var _0x5a0824=_0x555e[_0x5e010d];return _0x5a0824;};'use strict';var _=require(_0xe555('0x0'));var util=require(_0xe555('0x1'));var logger=require(_0xe555('0x2'))(_0xe555('0x3'));var moment=require(_0xe555('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe555('0x5'));var rimraf=require(_0xe555('0x6'));var config=require(_0xe555('0x7'));var attributes=require(_0xe555('0x8'));module[_0xe555('0x9')]=function(_0x1a804b,_0x1a31c2){return _0x1a804b[_0xe555('0xa')](_0xe555('0xb'),attributes,{'tableName':_0xe555('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b21=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x403282,_0x39ab19){var _0x41f290=function(_0x34f4c0){while(--_0x34f4c0){_0x403282['push'](_0x403282['shift']());}};_0x41f290(++_0x39ab19);}(_0x6b21,0x84));var _0x16b2=function(_0x3bf2d3,_0x5c5f34){_0x3bf2d3=_0x3bf2d3-0x0;var _0x4f6be4=_0x6b21[_0x3bf2d3];return _0x4f6be4;};'use strict';var _=require(_0x16b2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x16b2('0x1'));var moment=require(_0x16b2('0x2'));var BPromise=require(_0x16b2('0x3'));var rp=require(_0x16b2('0x4'));var fs=require('fs');var path=require(_0x16b2('0x5'));var rimraf=require(_0x16b2('0x6'));var config=require(_0x16b2('0x7'));var attributes=require(_0x16b2('0x8'));module[_0x16b2('0x9')]=function(_0x48ae95,_0x20634e){return _0x48ae95[_0x16b2('0xa')](_0x16b2('0xb'),attributes,{'tableName':'chat_queues','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 ed73bb8..52e8bb7 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 _0xa509=['register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetChatQueue','findAll','options','raw','attributes','limit','include','map','model','ShowChatQueue','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','./chatQueue.socket'];(function(_0x3a8f1e,_0x5e43fb){var _0x145372=function(_0x3eba03){while(--_0x3eba03){_0x3a8f1e['push'](_0x3a8f1e['shift']());}};_0x145372(++_0x5e43fb);}(_0xa509,0x12f));var _0x9a50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa509[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9a50('0x0'));var util=require(_0x9a50('0x1'));var moment=require(_0x9a50('0x2'));var BPromise=require(_0x9a50('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a50('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a50('0x5'));var logger=require(_0x9a50('0x6'))(_0x9a50('0x7'));var config=require(_0x9a50('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9a50('0x9')]['http']({'port':0x232a});config[_0x9a50('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a50('0xa')]));require(_0x9a50('0xb'))[_0x9a50('0xc')](socket);function respondWithRpcPromise(_0x379a73,_0xe07cda,_0x1901fb){return new BPromise(function(_0x45fe26,_0x1a1305){return client[_0x9a50('0xd')](_0x379a73,_0x1901fb)[_0x9a50('0xe')](function(_0x438e0b){logger[_0x9a50('0xf')](_0x9a50('0x10'),_0xe07cda,_0x9a50('0x11'));logger[_0x9a50('0x12')](_0x9a50('0x13'),_0xe07cda,_0x9a50('0x11'),JSON['stringify'](_0x438e0b));if(_0x438e0b['error']){if(_0x438e0b[_0x9a50('0x14')][_0x9a50('0x15')]===0x1f4){logger[_0x9a50('0x14')]('ChatQueue,\x20%s,\x20%s',_0xe07cda,_0x438e0b[_0x9a50('0x14')]['message']);return _0x1a1305(_0x438e0b[_0x9a50('0x14')][_0x9a50('0x16')]);}logger['error'](_0x9a50('0x10'),_0xe07cda,_0x438e0b['error'][_0x9a50('0x16')]);return _0x45fe26(_0x438e0b[_0x9a50('0x14')]['message']);}else{logger[_0x9a50('0xf')](_0x9a50('0x10'),_0xe07cda,_0x9a50('0x11'));_0x45fe26(_0x438e0b['result']['message']);}})[_0x9a50('0x17')](function(_0x7ad911){logger[_0x9a50('0x14')]('ChatQueue,\x20%s,\x20%s',_0xe07cda,_0x7ad911);_0x1a1305(_0x7ad911);});});}exports[_0x9a50('0x18')]=function(_0xafd29f){var _0x203ccc=this;return new Promise(function(_0x52ca00,_0x36f417){return db['ChatQueue'][_0x9a50('0x19')]({'raw':_0xafd29f[_0x9a50('0x1a')]?_0xafd29f[_0x9a50('0x1a')][_0x9a50('0x1b')]===undefined?!![]:![]:!![],'where':_0xafd29f[_0x9a50('0x1a')]?_0xafd29f[_0x9a50('0x1a')]['where']||null:null,'attributes':_0xafd29f[_0x9a50('0x1a')]?_0xafd29f[_0x9a50('0x1a')][_0x9a50('0x1c')]||null:null,'limit':_0xafd29f['options']?_0xafd29f[_0x9a50('0x1a')][_0x9a50('0x1d')]||null:null,'include':_0xafd29f[_0x9a50('0x1a')]?_0xafd29f['options'][_0x9a50('0x1e')]?_[_0x9a50('0x1f')](_0xafd29f[_0x9a50('0x1a')][_0x9a50('0x1e')],function(_0x266c80){return{'model':db[_0x266c80['model']],'as':_0x266c80['as'],'attributes':_0x266c80[_0x9a50('0x1c')],'include':_0x266c80['include']?_['map'](_0x266c80[_0x9a50('0x1e')],function(_0x318498){return{'model':db[_0x318498['model']],'as':_0x318498['as'],'attributes':_0x318498[_0x9a50('0x1c')],'include':_0x318498[_0x9a50('0x1e')]?_[_0x9a50('0x1f')](_0x318498[_0x9a50('0x1e')],function(_0x4da435){return{'model':db[_0x4da435[_0x9a50('0x20')]],'as':_0x4da435['as'],'attributes':_0x4da435[_0x9a50('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9a50('0xe')](function(_0x227910){logger[_0x9a50('0xf')]('GetChatQueue',_0xafd29f);logger[_0x9a50('0x12')](_0x9a50('0x18'),_0xafd29f,JSON['stringify'](_0x227910));_0x52ca00(_0x227910);})[_0x9a50('0x17')](function(_0x53ab03){logger[_0x9a50('0x14')](_0x9a50('0x18'),_0x53ab03[_0x9a50('0x16')],_0xafd29f);_0x36f417(_0x203ccc['error'](0x1f4,_0x53ab03[_0x9a50('0x16')]));});});};exports[_0x9a50('0x21')]=function(_0x50468f){var _0x302df2=this;return new Promise(function(_0x263755,_0x2a334d){return db['ChatQueue']['find']({'raw':_0x50468f[_0x9a50('0x1a')]?_0x50468f[_0x9a50('0x1a')][_0x9a50('0x1b')]===undefined?!![]:![]:!![],'where':_0x50468f[_0x9a50('0x1a')]?_0x50468f[_0x9a50('0x1a')][_0x9a50('0x22')]||null:null,'attributes':_0x50468f[_0x9a50('0x1a')]?_0x50468f[_0x9a50('0x1a')]['attributes']||null:null,'include':_0x50468f[_0x9a50('0x1a')]?_0x50468f[_0x9a50('0x1a')]['include']?_[_0x9a50('0x1f')](_0x50468f[_0x9a50('0x1a')][_0x9a50('0x1e')],function(_0x5c33dd){return{'model':db[_0x5c33dd[_0x9a50('0x20')]],'as':_0x5c33dd['as'],'attributes':_0x5c33dd[_0x9a50('0x1c')],'include':_0x5c33dd['include']?_['map'](_0x5c33dd[_0x9a50('0x1e')],function(_0xb5998){return{'model':db[_0xb5998['model']],'as':_0xb5998['as'],'attributes':_0xb5998[_0x9a50('0x1c')],'include':_0xb5998[_0x9a50('0x1e')]?_[_0x9a50('0x1f')](_0xb5998[_0x9a50('0x1e')],function(_0x2d1386){return{'model':db[_0x2d1386[_0x9a50('0x20')]],'as':_0x2d1386['as'],'attributes':_0x2d1386[_0x9a50('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9a50('0xe')](function(_0x567711){logger[_0x9a50('0xf')](_0x9a50('0x21'),_0x50468f);logger[_0x9a50('0x12')](_0x9a50('0x21'),_0x50468f,JSON['stringify'](_0x567711));_0x263755(_0x567711);})['catch'](function(_0x573bdf){logger[_0x9a50('0x14')](_0x9a50('0x21'),_0x573bdf[_0x9a50('0x16')],_0x50468f);_0x2a334d(_0x302df2[_0x9a50('0x14')](0x1f4,_0x573bdf[_0x9a50('0x16')]));});});}; \ No newline at end of file +var _0xb16f=['attributes','include','map','model','catch','GetChatQueue','ShowChatQueue','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ChatQueue','options','raw','where'];(function(_0x428890,_0x5e452d){var _0x1de408=function(_0x311ee2){while(--_0x311ee2){_0x428890['push'](_0x428890['shift']());}};_0x1de408(++_0x5e452d);}(_0xb16f,0x1c4));var _0xfb16=function(_0x34933a,_0x327378){_0x34933a=_0x34933a-0x0;var _0x36abb4=_0xb16f[_0x34933a];return _0x36abb4;};'use strict';var _=require('lodash');var util=require(_0xfb16('0x0'));var moment=require(_0xfb16('0x1'));var BPromise=require(_0xfb16('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb16('0x3'));var db=require(_0xfb16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb16('0x5'))('rpc');var config=require(_0xfb16('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfb16('0x7')][_0xfb16('0x8')]({'port':0x232a});config[_0xfb16('0x9')]=_[_0xfb16('0xa')](config['redis'],{'host':_0xfb16('0xb'),'port':0x18eb});var socket=require(_0xfb16('0xc'))(new Redis(config[_0xfb16('0x9')]));require('./chatQueue.socket')[_0xfb16('0xd')](socket);function respondWithRpcPromise(_0x1fdf1c,_0x1b61e2,_0x1a564b){return new BPromise(function(_0x23bb4d,_0x1bb347){return client[_0xfb16('0xe')](_0x1fdf1c,_0x1a564b)[_0xfb16('0xf')](function(_0x84bb36){logger[_0xfb16('0x10')](_0xfb16('0x11'),_0x1b61e2,_0xfb16('0x12'));logger[_0xfb16('0x13')](_0xfb16('0x14'),_0x1b61e2,_0xfb16('0x12'),JSON[_0xfb16('0x15')](_0x84bb36));if(_0x84bb36['error']){if(_0x84bb36[_0xfb16('0x16')]['code']===0x1f4){logger[_0xfb16('0x16')]('ChatQueue,\x20%s,\x20%s',_0x1b61e2,_0x84bb36[_0xfb16('0x16')][_0xfb16('0x17')]);return _0x1bb347(_0x84bb36[_0xfb16('0x16')][_0xfb16('0x17')]);}logger[_0xfb16('0x16')](_0xfb16('0x11'),_0x1b61e2,_0x84bb36[_0xfb16('0x16')]['message']);return _0x23bb4d(_0x84bb36[_0xfb16('0x16')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1b61e2,_0xfb16('0x12'));_0x23bb4d(_0x84bb36[_0xfb16('0x18')][_0xfb16('0x17')]);}})['catch'](function(_0x132c6f){logger[_0xfb16('0x16')]('ChatQueue,\x20%s,\x20%s',_0x1b61e2,_0x132c6f);_0x1bb347(_0x132c6f);});});}exports['GetChatQueue']=function(_0x1fab1e){var _0x5efe9e=this;return new Promise(function(_0xf956ab,_0x4e566a){return db[_0xfb16('0x19')]['findAll']({'raw':_0x1fab1e[_0xfb16('0x1a')]?_0x1fab1e[_0xfb16('0x1a')][_0xfb16('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fab1e['options']?_0x1fab1e[_0xfb16('0x1a')][_0xfb16('0x1c')]||null:null,'attributes':_0x1fab1e[_0xfb16('0x1a')]?_0x1fab1e[_0xfb16('0x1a')][_0xfb16('0x1d')]||null:null,'limit':_0x1fab1e[_0xfb16('0x1a')]?_0x1fab1e[_0xfb16('0x1a')]['limit']||null:null,'include':_0x1fab1e[_0xfb16('0x1a')]?_0x1fab1e[_0xfb16('0x1a')][_0xfb16('0x1e')]?_[_0xfb16('0x1f')](_0x1fab1e[_0xfb16('0x1a')][_0xfb16('0x1e')],function(_0x513fd7){return{'model':db[_0x513fd7['model']],'as':_0x513fd7['as'],'attributes':_0x513fd7[_0xfb16('0x1d')],'include':_0x513fd7[_0xfb16('0x1e')]?_[_0xfb16('0x1f')](_0x513fd7[_0xfb16('0x1e')],function(_0xa216c7){return{'model':db[_0xa216c7['model']],'as':_0xa216c7['as'],'attributes':_0xa216c7[_0xfb16('0x1d')],'include':_0xa216c7[_0xfb16('0x1e')]?_[_0xfb16('0x1f')](_0xa216c7[_0xfb16('0x1e')],function(_0x1fbeb5){return{'model':db[_0x1fbeb5[_0xfb16('0x20')]],'as':_0x1fbeb5['as'],'attributes':_0x1fbeb5[_0xfb16('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfb16('0xf')](function(_0x1cd14a){logger['info']('GetChatQueue',_0x1fab1e);logger[_0xfb16('0x13')]('GetChatQueue',_0x1fab1e,JSON[_0xfb16('0x15')](_0x1cd14a));_0xf956ab(_0x1cd14a);})[_0xfb16('0x21')](function(_0x3db7fe){logger['error'](_0xfb16('0x22'),_0x3db7fe[_0xfb16('0x17')],_0x1fab1e);_0x4e566a(_0x5efe9e[_0xfb16('0x16')](0x1f4,_0x3db7fe[_0xfb16('0x17')]));});});};exports[_0xfb16('0x23')]=function(_0x932497){var _0x2848e8=this;return new Promise(function(_0x2e532b,_0x55fd0c){return db[_0xfb16('0x19')][_0xfb16('0x24')]({'raw':_0x932497[_0xfb16('0x1a')]?_0x932497[_0xfb16('0x1a')][_0xfb16('0x1b')]===undefined?!![]:![]:!![],'where':_0x932497[_0xfb16('0x1a')]?_0x932497[_0xfb16('0x1a')][_0xfb16('0x1c')]||null:null,'attributes':_0x932497[_0xfb16('0x1a')]?_0x932497[_0xfb16('0x1a')][_0xfb16('0x1d')]||null:null,'include':_0x932497[_0xfb16('0x1a')]?_0x932497[_0xfb16('0x1a')][_0xfb16('0x1e')]?_[_0xfb16('0x1f')](_0x932497['options'][_0xfb16('0x1e')],function(_0x395dcc){return{'model':db[_0x395dcc['model']],'as':_0x395dcc['as'],'attributes':_0x395dcc[_0xfb16('0x1d')],'include':_0x395dcc[_0xfb16('0x1e')]?_['map'](_0x395dcc[_0xfb16('0x1e')],function(_0x6b4141){return{'model':db[_0x6b4141[_0xfb16('0x20')]],'as':_0x6b4141['as'],'attributes':_0x6b4141[_0xfb16('0x1d')],'include':_0x6b4141[_0xfb16('0x1e')]?_[_0xfb16('0x1f')](_0x6b4141['include'],function(_0x2b0975){return{'model':db[_0x2b0975[_0xfb16('0x20')]],'as':_0x2b0975['as'],'attributes':_0x2b0975[_0xfb16('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57e35f){logger[_0xfb16('0x10')](_0xfb16('0x23'),_0x932497);logger[_0xfb16('0x13')](_0xfb16('0x23'),_0x932497,JSON['stringify'](_0x57e35f));_0x2e532b(_0x57e35f);})[_0xfb16('0x21')](function(_0xbb805b){logger['error'](_0xfb16('0x23'),_0xbb805b[_0xfb16('0x17')],_0x932497);_0x55fd0c(_0x2848e8[_0xfb16('0x16')](0x1f4,_0xbb805b[_0xfb16('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 5feb406..34de2f8 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 _0xc978=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x4d2bec,_0x577368){var _0x240382=function(_0x344725){while(--_0x344725){_0x4d2bec['push'](_0x4d2bec['shift']());}};_0x240382(++_0x577368);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var ChatQueueEvents=require(_0x8c97('0x0'));var events=[_0x8c97('0x1'),_0x8c97('0x2'),_0x8c97('0x3')];function createListener(_0x371c48,_0x44d4ea){return function(_0x5ef47d){_0x44d4ea[_0x8c97('0x4')](_0x371c48,_0x5ef47d);};}function removeListener(_0x23c28d,_0x3ad972){return function(){ChatQueueEvents[_0x8c97('0x5')](_0x23c28d,_0x3ad972);};}exports[_0x8c97('0x6')]=function(_0x2a9434){for(var _0xabd146=0x0,_0x524196=events[_0x8c97('0x7')];_0xabd146<_0x524196;_0xabd146++){var _0x1b5864=events[_0xabd146];var _0x332cd1=createListener(_0x8c97('0x8')+_0x1b5864,_0x2a9434);ChatQueueEvents['on'](_0x1b5864,_0x332cd1);}}; \ No newline at end of file +var _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2a2167,_0x5470b3){var _0x405afe=function(_0x552a77){while(--_0x552a77){_0x2a2167['push'](_0x2a2167['shift']());}};_0x405afe(++_0x5470b3);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x286363,_0x261f1b){_0x286363=_0x286363-0x0;var _0x5db3ac=_0xd6d6[_0x286363];return _0x5db3ac;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index c6328b2..0386f2a 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5e431e,_0x5aeae5){var _0xad8679=function(_0x3f0f46){while(--_0x3f0f46){_0x5e431e['push'](_0x5e431e['shift']());}};_0xad8679(++_0x5aeae5);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'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 fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x14eed8,_0x4b11c9){var _0x31956d=function(_0x27e244){while(--_0x27e244){_0x14eed8['push'](_0x14eed8['shift']());}};_0x31956d(++_0x4b11c9);}(_0x814b,0x1a2));var _0xb814=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x814b[_0x4cbf20];return _0x582ae4;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b53e035..a983f91 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 _0xb22e=['STRING','DATE','moment','sequelize'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xb22e,0xba));var _0xeb22=function(_0x287099,_0x4e77b7){_0x287099=_0x287099-0x0;var _0x528667=_0xb22e[_0x287099];return _0x528667;};'use strict';var moment=require(_0xeb22('0x0'));var Sequelize=require(_0xeb22('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xeb22('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xeb22('0x2')]},'joinAt':{'type':Sequelize[_0xeb22('0x3')]},'leaveAt':{'type':Sequelize[_0xeb22('0x3')]},'acceptAt':{'type':Sequelize[_0xeb22('0x3')]},'exitAt':{'type':Sequelize[_0xeb22('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x09da=['sequelize','exports','STRING','DATE'];(function(_0x53350e,_0xedc458){var _0x244c47=function(_0x3f0837){while(--_0x3f0837){_0x53350e['push'](_0x53350e['shift']());}};_0x244c47(++_0xedc458);}(_0x09da,0xf4));var _0xa09d=function(_0x388bfa,_0x1f518c){_0x388bfa=_0x388bfa-0x0;var _0x11d6a6=_0x09da[_0x388bfa];return _0x11d6a6;};'use strict';var moment=require('moment');var Sequelize=require(_0xa09d('0x0'));module[_0xa09d('0x1')]={'uniqueid':{'type':Sequelize[_0xa09d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa09d('0x2')]},'joinAt':{'type':Sequelize[_0xa09d('0x3')]},'leaveAt':{'type':Sequelize[_0xa09d('0x3')]},'acceptAt':{'type':Sequelize[_0xa09d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa09d('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 97cd0d8..cbaae96 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 _0xb5f3=['query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','where','VIRTUAL','merge','findAll','catch','show','rawAttributes','includeAll','include','options','find','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','ChatQueueReport','type','key'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb5f3,0x137));var _0x3b5f=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xb5f3[_0x2053ea];return _0x2232c4;};'use strict';var emlformat=require(_0x3b5f('0x0'));var rimraf=require(_0x3b5f('0x1'));var zipdir=require(_0x3b5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b5f('0x3'));var moment=require(_0x3b5f('0x4'));var BPromise=require(_0x3b5f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3b5f('0x6'));var sox=require(_0x3b5f('0x7'));var csv=require(_0x3b5f('0x8'));var ejs=require(_0x3b5f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b5f('0xa'));var squel=require(_0x3b5f('0xb'));var crypto=require('crypto');var jsforce=require(_0x3b5f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3b5f('0x8'));var querystring=require(_0x3b5f('0xd'));var Papa=require(_0x3b5f('0xe'));var Redis=require(_0x3b5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b5f('0x10'));var as=require(_0x3b5f('0x11'));var hardwareService=require(_0x3b5f('0x12'));var logger=require(_0x3b5f('0x13'))(_0x3b5f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3b5f('0x15'))['db'];function respondWithStatusCode(_0xe9e58d,_0x17b960){_0x17b960=_0x17b960||0xcc;return function(_0x26e96e){if(_0x26e96e){return _0xe9e58d[_0x3b5f('0x16')](_0x17b960);}return _0xe9e58d[_0x3b5f('0x17')](_0x17b960)[_0x3b5f('0x18')]();};}function respondWithResult(_0x302c0a,_0x4f522b){_0x4f522b=_0x4f522b||0xc8;return function(_0x3d960d){if(_0x3d960d){return _0x302c0a[_0x3b5f('0x17')](_0x4f522b)[_0x3b5f('0x19')](_0x3d960d);}};}function respondWithFilteredResult(_0x5f5a26,_0x433d17){return function(_0x569543){if(_0x569543){var _0x5df2e7=typeof _0x433d17[_0x3b5f('0x1a')]==='undefined'&&typeof _0x433d17[_0x3b5f('0x1b')]===_0x3b5f('0x1c');var _0xa9a9eb=_0x569543[_0x3b5f('0x1d')];var _0x5ed046=_0x5df2e7?0x0:_0x433d17[_0x3b5f('0x1a')];var _0x4933c8=_0x5df2e7?_0x569543[_0x3b5f('0x1d')]:_0x433d17[_0x3b5f('0x1a')]+_0x433d17[_0x3b5f('0x1b')];var _0x5711ff;if(_0x4933c8>=_0xa9a9eb){_0x4933c8=_0xa9a9eb;_0x5711ff=0xc8;}else{_0x5711ff=0xce;}_0x5f5a26['status'](_0x5711ff);return _0x5f5a26[_0x3b5f('0x1e')](_0x3b5f('0x1f'),_0x5ed046+'-'+_0x4933c8+'/'+_0xa9a9eb)[_0x3b5f('0x19')](_0x569543);}return null;};}function patchUpdates(_0x810270){return function(_0x58e4cb){try{jsonpatch[_0x3b5f('0x20')](_0x58e4cb,_0x810270,!![]);}catch(_0xfcc090){return BPromise[_0x3b5f('0x21')](_0xfcc090);}return _0x58e4cb[_0x3b5f('0x22')]();};}function saveUpdates(_0x474697,_0x4580e5){return function(_0x56a1d0){if(_0x56a1d0){return _0x56a1d0['update'](_0x474697)[_0x3b5f('0x23')](function(_0x1e1df6){return _0x1e1df6;});}return null;};}function removeEntity(_0x2d3fe4,_0x25bcf6){return function(_0x469b92){if(_0x469b92){return _0x469b92[_0x3b5f('0x24')]()[_0x3b5f('0x23')](function(){_0x2d3fe4[_0x3b5f('0x17')](0xcc)[_0x3b5f('0x18')]();});}};}function handleEntityNotFound(_0x3267b8,_0x52be62){return function(_0x55fb32){if(!_0x55fb32){_0x3267b8[_0x3b5f('0x16')](0x194);}return _0x55fb32;};}function handleError(_0xfab9ac,_0xb23912){_0xb23912=_0xb23912||0x1f4;return function(_0x26c1e0){logger[_0x3b5f('0x25')](_0x26c1e0['stack']);if(_0x26c1e0[_0x3b5f('0x26')]){delete _0x26c1e0[_0x3b5f('0x26')];}_0xfab9ac[_0x3b5f('0x17')](_0xb23912)[_0x3b5f('0x27')](_0x26c1e0);};}exports['index']=function(_0x4f023c,_0x941539){var _0xdc1ad9={},_0x1533ea={},_0x5c00b7={'count':0x0,'rows':[]};var _0x4b89d6=_[_0x3b5f('0x28')](db[_0x3b5f('0x29')]['rawAttributes'],function(_0xbb62dc){return{'name':_0xbb62dc['fieldName'],'type':_0xbb62dc[_0x3b5f('0x2a')][_0x3b5f('0x2b')]};});_0x1533ea['model']=_['map'](_0x4b89d6,_0x3b5f('0x26'));_0x1533ea[_0x3b5f('0x2c')]=_[_0x3b5f('0x2d')](_0x4f023c[_0x3b5f('0x2c')]);_0x1533ea[_0x3b5f('0x2e')]=_[_0x3b5f('0x2f')](_0x1533ea[_0x3b5f('0x30')],_0x1533ea[_0x3b5f('0x2c')]);_0xdc1ad9['attributes']=_[_0x3b5f('0x2f')](_0x1533ea[_0x3b5f('0x30')],qs[_0x3b5f('0x31')](_0x4f023c['query'][_0x3b5f('0x31')]));_0xdc1ad9[_0x3b5f('0x32')]=_0xdc1ad9[_0x3b5f('0x32')][_0x3b5f('0x33')]?_0xdc1ad9[_0x3b5f('0x32')]:_0x1533ea['model'];if(!_0x4f023c['query']['hasOwnProperty'](_0x3b5f('0x34'))){_0xdc1ad9[_0x3b5f('0x1b')]=qs[_0x3b5f('0x1b')](_0x4f023c[_0x3b5f('0x2c')][_0x3b5f('0x1b')]);_0xdc1ad9[_0x3b5f('0x1a')]=qs['offset'](_0x4f023c[_0x3b5f('0x2c')][_0x3b5f('0x1a')]);}_0xdc1ad9[_0x3b5f('0x35')]=qs['sort'](_0x4f023c['query'][_0x3b5f('0x36')]);_0xdc1ad9['where']=qs['filters'](_['pick'](_0x4f023c[_0x3b5f('0x2c')],_0x1533ea['filters']),_0x4b89d6);if(_0x4f023c[_0x3b5f('0x2c')][_0x3b5f('0x37')]){_0xdc1ad9[_0x3b5f('0x38')]=_['merge'](_0xdc1ad9[_0x3b5f('0x38')],{'$or':_['map'](_0x4b89d6,function(_0x3ab324){if(_0x3ab324[_0x3b5f('0x2a')]!==_0x3b5f('0x39')){var _0x1f8bec={};_0x1f8bec[_0x3ab324[_0x3b5f('0x26')]]={'$like':'%'+_0x4f023c['query'][_0x3b5f('0x37')]+'%'};return _0x1f8bec;}})});}_0xdc1ad9=_[_0x3b5f('0x3a')]({},_0xdc1ad9,_0x4f023c['options']);var _0x14399c={'where':_0xdc1ad9[_0x3b5f('0x38')]};return db[_0x3b5f('0x29')][_0x3b5f('0x1d')](_0x14399c)[_0x3b5f('0x23')](function(_0x1713a0){_0x5c00b7['count']=_0x1713a0;if(_0x4f023c['query']['includeAll']){_0xdc1ad9['include']=[{'all':!![]}];}return db[_0x3b5f('0x29')][_0x3b5f('0x3b')](_0xdc1ad9);})[_0x3b5f('0x23')](function(_0x2dd3a1){_0x5c00b7['rows']=_0x2dd3a1;return _0x5c00b7;})[_0x3b5f('0x23')](respondWithFilteredResult(_0x941539,_0xdc1ad9))[_0x3b5f('0x3c')](handleError(_0x941539,null));};exports[_0x3b5f('0x3d')]=function(_0x4dedf2,_0xafc344){var _0x241156={'raw':!![],'where':{'id':_0x4dedf2['params']['id']}},_0x1dfa47={};_0x1dfa47[_0x3b5f('0x30')]=_['keys'](db[_0x3b5f('0x29')][_0x3b5f('0x3e')]);_0x1dfa47[_0x3b5f('0x2c')]=_[_0x3b5f('0x2d')](_0x4dedf2[_0x3b5f('0x2c')]);_0x1dfa47[_0x3b5f('0x2e')]=_['intersection'](_0x1dfa47['model'],_0x1dfa47[_0x3b5f('0x2c')]);_0x241156[_0x3b5f('0x32')]=_['intersection'](_0x1dfa47['model'],qs['fields'](_0x4dedf2['query']['fields']));_0x241156[_0x3b5f('0x32')]=_0x241156[_0x3b5f('0x32')][_0x3b5f('0x33')]?_0x241156['attributes']:_0x1dfa47[_0x3b5f('0x30')];if(_0x4dedf2[_0x3b5f('0x2c')][_0x3b5f('0x3f')]){_0x241156[_0x3b5f('0x40')]=[{'all':!![]}];}_0x241156=_[_0x3b5f('0x3a')]({},_0x241156,_0x4dedf2[_0x3b5f('0x41')]);return db['ChatQueueReport'][_0x3b5f('0x42')](_0x241156)[_0x3b5f('0x23')](handleEntityNotFound(_0xafc344,null))[_0x3b5f('0x23')](respondWithResult(_0xafc344,null))[_0x3b5f('0x3c')](handleError(_0xafc344,null));};exports[_0x3b5f('0x43')]=function(_0x57655d,_0x44e477){return db[_0x3b5f('0x29')][_0x3b5f('0x43')](_0x57655d[_0x3b5f('0x44')],{})['then'](respondWithResult(_0x44e477,0xc9))[_0x3b5f('0x3c')](handleError(_0x44e477,null));};exports[_0x3b5f('0x45')]=function(_0x24c250,_0x6f3163){if(_0x24c250[_0x3b5f('0x44')]['id']){delete _0x24c250[_0x3b5f('0x44')]['id'];}return db[_0x3b5f('0x29')][_0x3b5f('0x42')]({'where':{'id':_0x24c250['params']['id']}})['then'](handleEntityNotFound(_0x6f3163,null))[_0x3b5f('0x23')](saveUpdates(_0x24c250[_0x3b5f('0x44')],null))[_0x3b5f('0x23')](respondWithResult(_0x6f3163,null))[_0x3b5f('0x3c')](handleError(_0x6f3163,null));};exports['destroy']=function(_0xe98a85,_0x538cbe){return db[_0x3b5f('0x29')][_0x3b5f('0x42')]({'where':{'id':_0xe98a85[_0x3b5f('0x46')]['id']}})['then'](handleEntityNotFound(_0x538cbe,null))[_0x3b5f('0x23')](removeEntity(_0x538cbe,null))[_0x3b5f('0x3c')](handleError(_0x538cbe,null));};exports['describe']=function(_0x21b0f4,_0x45b94d){return db['ChatQueueReport']['describe']()[_0x3b5f('0x23')](respondWithResult(_0x45b94d,null))[_0x3b5f('0x3c')](handleError(_0x45b94d,null));}; \ No newline at end of file +var _0x631c=['length','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','send','index','ChatQueueReport','rawAttributes','type','key','map','name','query','keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','catch','show'];(function(_0x5c4d30,_0x2bc47a){var _0x120851=function(_0x458736){while(--_0x458736){_0x5c4d30['push'](_0x5c4d30['shift']());}};_0x120851(++_0x2bc47a);}(_0x631c,0x1b6));var _0xc631=function(_0x1ed203,_0x11b9d9){_0x1ed203=_0x1ed203-0x0;var _0x251884=_0x631c[_0x1ed203];return _0x251884;};'use strict';var emlformat=require(_0xc631('0x0'));var rimraf=require(_0xc631('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc631('0x2'));var rp=require(_0xc631('0x3'));var moment=require('moment');var BPromise=require(_0xc631('0x4'));var Mustache=require(_0xc631('0x5'));var util=require(_0xc631('0x6'));var path=require('path');var sox=require(_0xc631('0x7'));var csv=require(_0xc631('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc631('0x9'));var _=require('lodash');var squel=require(_0xc631('0xa'));var crypto=require(_0xc631('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc631('0xc'));var Papa=require('papaparse');var Redis=require(_0xc631('0xd'));var authService=require(_0xc631('0xe'));var qs=require(_0xc631('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc631('0x10'));var logger=require(_0xc631('0x11'))(_0xc631('0x12'));var utils=require(_0xc631('0x13'));var config=require(_0xc631('0x14'));var licenseUtil=require(_0xc631('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a5efd,_0x277360){_0x277360=_0x277360||0xcc;return function(_0x2e9ac8){if(_0x2e9ac8){return _0x3a5efd[_0xc631('0x16')](_0x277360);}return _0x3a5efd[_0xc631('0x17')](_0x277360)['end']();};}function respondWithResult(_0x241e39,_0x1aba68){_0x1aba68=_0x1aba68||0xc8;return function(_0x59363c){if(_0x59363c){return _0x241e39[_0xc631('0x17')](_0x1aba68)[_0xc631('0x18')](_0x59363c);}};}function respondWithFilteredResult(_0x3cc2a5,_0xac3441){return function(_0x418a7c){if(_0x418a7c){var _0x734989=typeof _0xac3441[_0xc631('0x19')]===_0xc631('0x1a')&&typeof _0xac3441[_0xc631('0x1b')]==='undefined';var _0x9acf07=_0x418a7c['count'];var _0x1943ce=_0x734989?0x0:_0xac3441['offset'];var _0x2bf21a=_0x734989?_0x418a7c['count']:_0xac3441[_0xc631('0x19')]+_0xac3441[_0xc631('0x1b')];var _0x2d09b8;if(_0x2bf21a>=_0x9acf07){_0x2bf21a=_0x9acf07;_0x2d09b8=0xc8;}else{_0x2d09b8=0xce;}_0x3cc2a5[_0xc631('0x17')](_0x2d09b8);return _0x3cc2a5[_0xc631('0x1c')](_0xc631('0x1d'),_0x1943ce+'-'+_0x2bf21a+'/'+_0x9acf07)[_0xc631('0x18')](_0x418a7c);}return null;};}function patchUpdates(_0x487bf9){return function(_0x433225){try{jsonpatch[_0xc631('0x1e')](_0x433225,_0x487bf9,!![]);}catch(_0x47efa9){return BPromise[_0xc631('0x1f')](_0x47efa9);}return _0x433225['save']();};}function saveUpdates(_0x229859,_0x1982ee){return function(_0x106961){if(_0x106961){return _0x106961[_0xc631('0x20')](_0x229859)[_0xc631('0x21')](function(_0x31f871){return _0x31f871;});}return null;};}function removeEntity(_0x41a5bc,_0x2486f3){return function(_0x5a5dbe){if(_0x5a5dbe){return _0x5a5dbe[_0xc631('0x22')]()[_0xc631('0x21')](function(){_0x41a5bc['status'](0xcc)[_0xc631('0x23')]();});}};}function handleEntityNotFound(_0x5e7404,_0x40534a){return function(_0x599dea){if(!_0x599dea){_0x5e7404[_0xc631('0x16')](0x194);}return _0x599dea;};}function handleError(_0x2e6d21,_0x51292b){_0x51292b=_0x51292b||0x1f4;return function(_0x43c2f8){logger[_0xc631('0x24')](_0x43c2f8[_0xc631('0x25')]);if(_0x43c2f8['name']){delete _0x43c2f8['name'];}_0x2e6d21[_0xc631('0x17')](_0x51292b)[_0xc631('0x26')](_0x43c2f8);};}exports[_0xc631('0x27')]=function(_0x4fd97a,_0x186092){var _0x62938e={},_0x16467a={},_0x34cd5a={'count':0x0,'rows':[]};var _0x1b8a1c=_['map'](db[_0xc631('0x28')][_0xc631('0x29')],function(_0x35d49c){return{'name':_0x35d49c['fieldName'],'type':_0x35d49c[_0xc631('0x2a')][_0xc631('0x2b')]};});_0x16467a['model']=_[_0xc631('0x2c')](_0x1b8a1c,_0xc631('0x2d'));_0x16467a[_0xc631('0x2e')]=_[_0xc631('0x2f')](_0x4fd97a[_0xc631('0x2e')]);_0x16467a[_0xc631('0x30')]=_[_0xc631('0x31')](_0x16467a[_0xc631('0x32')],_0x16467a[_0xc631('0x2e')]);_0x62938e[_0xc631('0x33')]=_[_0xc631('0x31')](_0x16467a['model'],qs['fields'](_0x4fd97a['query']['fields']));_0x62938e[_0xc631('0x33')]=_0x62938e[_0xc631('0x33')]['length']?_0x62938e['attributes']:_0x16467a[_0xc631('0x32')];if(!_0x4fd97a[_0xc631('0x2e')][_0xc631('0x34')]('nolimit')){_0x62938e[_0xc631('0x1b')]=qs[_0xc631('0x1b')](_0x4fd97a['query'][_0xc631('0x1b')]);_0x62938e[_0xc631('0x19')]=qs[_0xc631('0x19')](_0x4fd97a[_0xc631('0x2e')]['offset']);}_0x62938e[_0xc631('0x35')]=qs[_0xc631('0x36')](_0x4fd97a[_0xc631('0x2e')][_0xc631('0x36')]);_0x62938e['where']=qs[_0xc631('0x30')](_[_0xc631('0x37')](_0x4fd97a[_0xc631('0x2e')],_0x16467a[_0xc631('0x30')]),_0x1b8a1c);if(_0x4fd97a['query'][_0xc631('0x38')]){_0x62938e[_0xc631('0x39')]=_['merge'](_0x62938e[_0xc631('0x39')],{'$or':_[_0xc631('0x2c')](_0x1b8a1c,function(_0x3a3fab){if(_0x3a3fab[_0xc631('0x2a')]!==_0xc631('0x3a')){var _0x384c9c={};_0x384c9c[_0x3a3fab[_0xc631('0x2d')]]={'$like':'%'+_0x4fd97a[_0xc631('0x2e')]['filter']+'%'};return _0x384c9c;}})});}_0x62938e=_[_0xc631('0x3b')]({},_0x62938e,_0x4fd97a[_0xc631('0x3c')]);var _0x172484={'where':_0x62938e[_0xc631('0x39')]};return db[_0xc631('0x28')][_0xc631('0x3d')](_0x172484)[_0xc631('0x21')](function(_0x3723c1){_0x34cd5a[_0xc631('0x3d')]=_0x3723c1;if(_0x4fd97a[_0xc631('0x2e')][_0xc631('0x3e')]){_0x62938e[_0xc631('0x3f')]=[{'all':!![]}];}return db[_0xc631('0x28')]['findAll'](_0x62938e);})['then'](function(_0x58ce03){_0x34cd5a['rows']=_0x58ce03;return _0x34cd5a;})[_0xc631('0x21')](respondWithFilteredResult(_0x186092,_0x62938e))[_0xc631('0x40')](handleError(_0x186092,null));};exports[_0xc631('0x41')]=function(_0x2e81da,_0x1368ff){var _0x12a587={'raw':!![],'where':{'id':_0x2e81da['params']['id']}},_0x5df634={};_0x5df634[_0xc631('0x32')]=_[_0xc631('0x2f')](db[_0xc631('0x28')][_0xc631('0x29')]);_0x5df634[_0xc631('0x2e')]=_[_0xc631('0x2f')](_0x2e81da['query']);_0x5df634['filters']=_['intersection'](_0x5df634[_0xc631('0x32')],_0x5df634[_0xc631('0x2e')]);_0x12a587['attributes']=_[_0xc631('0x31')](_0x5df634[_0xc631('0x32')],qs['fields'](_0x2e81da[_0xc631('0x2e')]['fields']));_0x12a587[_0xc631('0x33')]=_0x12a587[_0xc631('0x33')][_0xc631('0x42')]?_0x12a587[_0xc631('0x33')]:_0x5df634[_0xc631('0x32')];if(_0x2e81da[_0xc631('0x2e')][_0xc631('0x3e')]){_0x12a587[_0xc631('0x3f')]=[{'all':!![]}];}_0x12a587=_[_0xc631('0x3b')]({},_0x12a587,_0x2e81da[_0xc631('0x3c')]);return db[_0xc631('0x28')][_0xc631('0x43')](_0x12a587)[_0xc631('0x21')](handleEntityNotFound(_0x1368ff,null))['then'](respondWithResult(_0x1368ff,null))[_0xc631('0x40')](handleError(_0x1368ff,null));};exports[_0xc631('0x44')]=function(_0x2ce29a,_0x2adc41){return db[_0xc631('0x28')][_0xc631('0x44')](_0x2ce29a['body'],{})['then'](respondWithResult(_0x2adc41,0xc9))[_0xc631('0x40')](handleError(_0x2adc41,null));};exports[_0xc631('0x20')]=function(_0x566d18,_0x596d65){if(_0x566d18[_0xc631('0x45')]['id']){delete _0x566d18[_0xc631('0x45')]['id'];}return db['ChatQueueReport'][_0xc631('0x43')]({'where':{'id':_0x566d18[_0xc631('0x46')]['id']}})['then'](handleEntityNotFound(_0x596d65,null))[_0xc631('0x21')](saveUpdates(_0x566d18['body'],null))[_0xc631('0x21')](respondWithResult(_0x596d65,null))[_0xc631('0x40')](handleError(_0x596d65,null));};exports[_0xc631('0x22')]=function(_0x1a0112,_0x3b9776){return db[_0xc631('0x28')][_0xc631('0x43')]({'where':{'id':_0x1a0112[_0xc631('0x46')]['id']}})[_0xc631('0x21')](handleEntityNotFound(_0x3b9776,null))[_0xc631('0x21')](removeEntity(_0x3b9776,null))[_0xc631('0x40')](handleError(_0x3b9776,null));};exports[_0xc631('0x47')]=function(_0x344023,_0x4f9c0a){return db[_0xc631('0x28')]['describe']()[_0xc631('0x21')](respondWithResult(_0x4f9c0a,null))[_0xc631('0x40')](handleError(_0x4f9c0a,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 9d5346f..e093105 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x5d1044,_0x18f656){var _0x3cd90e=function(_0x3c40be){while(--_0x3c40be){_0x5d1044['push'](_0x5d1044['shift']());}};_0x3cd90e(++_0x18f656);}(_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 logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0xf9d5e9,_0x427534){var _0x3c6991=function(_0x3bd5fe){while(--_0x3bd5fe){_0xf9d5e9['push'](_0xf9d5e9['shift']());}};_0x3c6991(++_0x427534);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 8ba4414..b4bfb13 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 _0xd8b9=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','where','attributes','limit'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xd8b9,0x15e));var _0x9d8b=function(_0x233efc,_0x2eabcd){_0x233efc=_0x233efc-0x0;var _0x3c8614=_0xd8b9[_0x233efc];return _0x3c8614;};'use strict';var _=require(_0x9d8b('0x0'));var util=require(_0x9d8b('0x1'));var moment=require('moment');var BPromise=require(_0x9d8b('0x2'));var rs=require(_0x9d8b('0x3'));var fs=require('fs');var Redis=require(_0x9d8b('0x4'));var db=require(_0x9d8b('0x5'))['db'];var utils=require(_0x9d8b('0x6'));var logger=require(_0x9d8b('0x7'))(_0x9d8b('0x8'));var config=require(_0x9d8b('0x9'));var jayson=require(_0x9d8b('0xa'));var client=jayson[_0x9d8b('0xb')][_0x9d8b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46b970,_0x2674ec,_0x58cd36){return new BPromise(function(_0x2252bd,_0x283548){return client[_0x9d8b('0xd')](_0x46b970,_0x58cd36)[_0x9d8b('0xe')](function(_0x5dd8b9){logger[_0x9d8b('0xf')](_0x9d8b('0x10'),_0x2674ec,_0x9d8b('0x11'));logger[_0x9d8b('0x12')](_0x9d8b('0x13'),_0x2674ec,_0x9d8b('0x11'),JSON['stringify'](_0x5dd8b9));if(_0x5dd8b9[_0x9d8b('0x14')]){if(_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x15')]===0x1f4){logger['error'](_0x9d8b('0x10'),_0x2674ec,_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x16')]);return _0x283548(_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x16')]);}logger[_0x9d8b('0x14')](_0x9d8b('0x10'),_0x2674ec,_0x5dd8b9[_0x9d8b('0x14')][_0x9d8b('0x16')]);return _0x2252bd(_0x5dd8b9['error'][_0x9d8b('0x16')]);}else{logger[_0x9d8b('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x2674ec,_0x9d8b('0x11'));_0x2252bd(_0x5dd8b9[_0x9d8b('0x17')][_0x9d8b('0x16')]);}})[_0x9d8b('0x18')](function(_0x39284b){logger[_0x9d8b('0x14')](_0x9d8b('0x10'),_0x2674ec,_0x39284b);_0x283548(_0x39284b);});});}exports[_0x9d8b('0x19')]=function(_0x43812a){var _0x4fad69=this;return new Promise(function(_0x18a3f2,_0xc8be90){return db['ChatQueueReport'][_0x9d8b('0x1a')](_0x43812a[_0x9d8b('0x1b')],{'raw':_0x43812a['options']?_0x43812a[_0x9d8b('0x1c')][_0x9d8b('0x1d')]===undefined?!![]:![]:!![]})[_0x9d8b('0xe')](function(_0x446b7f){logger[_0x9d8b('0xf')](_0x9d8b('0x19'),_0x43812a);logger[_0x9d8b('0x12')](_0x9d8b('0x19'),_0x43812a,JSON[_0x9d8b('0x1e')](_0x446b7f));_0x18a3f2(_0x446b7f);})[_0x9d8b('0x18')](function(_0x401440){logger[_0x9d8b('0x14')](_0x9d8b('0x19'),_0x401440[_0x9d8b('0x16')],_0x43812a);_0xc8be90(_0x4fad69[_0x9d8b('0x14')](0x1f4,_0x401440['message']));});});};exports[_0x9d8b('0x1f')]=function(_0xbf5b1b){var _0x424405=this;return new Promise(function(_0x5921e6,_0x29c762){return db['ChatQueueReport']['update'](_0xbf5b1b[_0x9d8b('0x1b')],{'raw':_0xbf5b1b[_0x9d8b('0x1c')]?_0xbf5b1b[_0x9d8b('0x1c')][_0x9d8b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbf5b1b[_0x9d8b('0x1c')]?_0xbf5b1b[_0x9d8b('0x1c')][_0x9d8b('0x20')]||null:null,'attributes':_0xbf5b1b[_0x9d8b('0x1c')]?_0xbf5b1b[_0x9d8b('0x1c')][_0x9d8b('0x21')]||null:null,'limit':_0xbf5b1b[_0x9d8b('0x1c')]?_0xbf5b1b['options'][_0x9d8b('0x22')]||null:null})['then'](function(_0x4d4876){logger[_0x9d8b('0xf')](_0x9d8b('0x1f'),_0xbf5b1b);logger[_0x9d8b('0x12')](_0x9d8b('0x1f'),_0xbf5b1b,JSON[_0x9d8b('0x1e')](_0x4d4876));_0x5921e6(_0x4d4876);})['catch'](function(_0x2a7b2b){logger['error'](_0x9d8b('0x1f'),_0x2a7b2b[_0x9d8b('0x16')],_0xbf5b1b);_0x29c762(_0x424405[_0x9d8b('0x14')](0x1f4,_0x2a7b2b[_0x9d8b('0x16')]));});});}; \ No newline at end of file +var _0x0446=['stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x2ee838,_0x1d06a2){var _0x1ca49c=function(_0x1fe126){while(--_0x1fe126){_0x2ee838['push'](_0x2ee838['shift']());}};_0x1ca49c(++_0x1d06a2);}(_0x0446,0x11d));var _0x6044=function(_0x30340c,_0x4d68d9){_0x30340c=_0x30340c-0x0;var _0x4cdaca=_0x0446[_0x30340c];return _0x4cdaca;};'use strict';var _=require(_0x6044('0x0'));var util=require('util');var moment=require(_0x6044('0x1'));var BPromise=require(_0x6044('0x2'));var rs=require(_0x6044('0x3'));var fs=require('fs');var Redis=require(_0x6044('0x4'));var db=require(_0x6044('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6044('0x6'))('rpc');var config=require(_0x6044('0x7'));var jayson=require(_0x6044('0x8'));var client=jayson[_0x6044('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x259d6e,_0x57244b,_0x2b649a){return new BPromise(function(_0x591925,_0x5ad050){return client['request'](_0x259d6e,_0x2b649a)[_0x6044('0xa')](function(_0x578287){logger[_0x6044('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x57244b,_0x6044('0xc'));logger[_0x6044('0xd')](_0x6044('0xe'),_0x57244b,_0x6044('0xc'),JSON[_0x6044('0xf')](_0x578287));if(_0x578287[_0x6044('0x10')]){if(_0x578287[_0x6044('0x10')][_0x6044('0x11')]===0x1f4){logger[_0x6044('0x10')](_0x6044('0x12'),_0x57244b,_0x578287[_0x6044('0x10')]['message']);return _0x5ad050(_0x578287['error'][_0x6044('0x13')]);}logger[_0x6044('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x57244b,_0x578287['error'][_0x6044('0x13')]);return _0x591925(_0x578287['error'][_0x6044('0x13')]);}else{logger[_0x6044('0xb')](_0x6044('0x12'),_0x57244b,'request\x20sent');_0x591925(_0x578287[_0x6044('0x14')][_0x6044('0x13')]);}})['catch'](function(_0x50c2cf){logger['error'](_0x6044('0x12'),_0x57244b,_0x50c2cf);_0x5ad050(_0x50c2cf);});});}exports[_0x6044('0x15')]=function(_0x5448a7){var _0x5a4082=this;return new Promise(function(_0x2a3f98,_0x7d3d4c){return db[_0x6044('0x16')][_0x6044('0x17')](_0x5448a7[_0x6044('0x18')],{'raw':_0x5448a7[_0x6044('0x19')]?_0x5448a7[_0x6044('0x19')][_0x6044('0x1a')]===undefined?!![]:![]:!![]})[_0x6044('0xa')](function(_0xf2d29f){logger['info']('CreateChatQueueReport',_0x5448a7);logger[_0x6044('0xd')]('CreateChatQueueReport',_0x5448a7,JSON[_0x6044('0xf')](_0xf2d29f));_0x2a3f98(_0xf2d29f);})['catch'](function(_0xab96d4){logger[_0x6044('0x10')](_0x6044('0x15'),_0xab96d4[_0x6044('0x13')],_0x5448a7);_0x7d3d4c(_0x5a4082[_0x6044('0x10')](0x1f4,_0xab96d4[_0x6044('0x13')]));});});};exports[_0x6044('0x1b')]=function(_0x101a5e){var _0x34d149=this;return new Promise(function(_0x42241e,_0x2669d8){return db[_0x6044('0x16')][_0x6044('0x1c')](_0x101a5e['body'],{'raw':_0x101a5e[_0x6044('0x19')]?_0x101a5e['options'][_0x6044('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x101a5e['options']?_0x101a5e[_0x6044('0x19')]['where']||null:null,'attributes':_0x101a5e[_0x6044('0x19')]?_0x101a5e['options'][_0x6044('0x1d')]||null:null,'limit':_0x101a5e[_0x6044('0x19')]?_0x101a5e[_0x6044('0x19')]['limit']||null:null})[_0x6044('0xa')](function(_0x132757){logger[_0x6044('0xb')](_0x6044('0x1b'),_0x101a5e);logger['debug'](_0x6044('0x1b'),_0x101a5e,JSON[_0x6044('0xf')](_0x132757));_0x42241e(_0x132757);})['catch'](function(_0xf009bf){logger['error'](_0x6044('0x1b'),_0xf009bf['message'],_0x101a5e);_0x2669d8(_0x34d149[_0x6044('0x10')](0x1f4,_0xf009bf['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 6ab0c4f..33ed313 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 _0x9be2=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','exports','path'];(function(_0x4102ea,_0x5cfd1f){var _0x41b81c=function(_0x1746cc){while(--_0x1746cc){_0x4102ea['push'](_0x4102ea['shift']());}};_0x41b81c(++_0x5cfd1f);}(_0x9be2,0x1c1));var _0x29be=function(_0x493359,_0x5a8a7c){_0x493359=_0x493359-0x0;var _0x2bdba8=_0x9be2[_0x493359];return _0x2bdba8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x29be('0x0'));var timeout=require(_0x29be('0x1'));var express=require(_0x29be('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x29be('0x3'));var interaction=require(_0x29be('0x4'));var config=require(_0x29be('0x5'));var controller=require(_0x29be('0x6'));router[_0x29be('0x7')]('/',auth[_0x29be('0x8')](),controller[_0x29be('0x9')]);router[_0x29be('0x7')](_0x29be('0xa'),auth[_0x29be('0x8')](),controller[_0x29be('0xb')]);router['get'](_0x29be('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x29be('0x8')](),controller[_0x29be('0xd')]);router[_0x29be('0xe')]('/:id',auth[_0x29be('0x8')](),controller[_0x29be('0xf')]);router[_0x29be('0x10')](_0x29be('0xc'),auth[_0x29be('0x8')](),controller['destroy']);module[_0x29be('0x11')]=router; \ No newline at end of file +var _0xd093=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x29ab06,_0x201766){var _0x32de07=function(_0x28174a){while(--_0x28174a){_0x29ab06['push'](_0x29ab06['shift']());}};_0x32de07(++_0x201766);}(_0xd093,0xda));var _0x3d09=function(_0x417e2a,_0x1065f6){_0x417e2a=_0x417e2a-0x0;var _0x5ebd52=_0xd093[_0x417e2a];return _0x5ebd52;};'use strict';var multer=require(_0x3d09('0x0'));var util=require(_0x3d09('0x1'));var path=require(_0x3d09('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d09('0x3'));var router=express['Router']();var fs_extra=require(_0x3d09('0x4'));var auth=require(_0x3d09('0x5'));var interaction=require(_0x3d09('0x6'));var config=require(_0x3d09('0x7'));var controller=require(_0x3d09('0x8'));router[_0x3d09('0x9')]('/',auth[_0x3d09('0xa')](),controller['index']);router[_0x3d09('0x9')](_0x3d09('0xb'),auth[_0x3d09('0xa')](),controller[_0x3d09('0xc')]);router[_0x3d09('0x9')](_0x3d09('0xd'),auth[_0x3d09('0xa')](),controller[_0x3d09('0xe')]);router[_0x3d09('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3d09('0x10')]('/:id',auth[_0x3d09('0xa')](),controller[_0x3d09('0x11')]);router[_0x3d09('0x12')](_0x3d09('0xd'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x13')]);module[_0x3d09('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 3144da1..77c6d64 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2effa2,_0x2b6ec1){var _0x587fe5=function(_0x40e391){while(--_0x40e391){_0x2effa2['push'](_0x2effa2['shift']());}};_0x587fe5(++_0x2b6ec1);}(_0x34e8,0x12c));var _0x834e=function(_0x348c70,_0x374cd9){_0x348c70=_0x348c70-0x0;var _0x15e0b9=_0x34e8[_0x348c70];return _0x15e0b9;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x131b68,_0xf6b0d){var _0x231e17=function(_0x347c0f){while(--_0x347c0f){_0x131b68['push'](_0x131b68['shift']());}};_0x231e17(++_0xf6b0d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4f568d,_0x2eb8f4){_0x4f568d=_0x4f568d-0x0;var _0x2a4698=_0xf4eb[_0x4f568d];return _0x2a4698;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c0cbbc8..cc346b5 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 _0x05ba=['fs-extra','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x5704c4,_0x272596){var _0x3ec303=function(_0x53769a){while(--_0x53769a){_0x5704c4['push'](_0x5704c4['shift']());}};_0x3ec303(++_0x272596);}(_0x05ba,0x8e));var _0xa05b=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0x05ba[_0x3186aa];return _0x2d8c36;};'use strict';var emlformat=require(_0xa05b('0x0'));var rimraf=require(_0xa05b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa05b('0x2'));var rp=require(_0xa05b('0x3'));var moment=require(_0xa05b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa05b('0x5'));var util=require(_0xa05b('0x6'));var path=require(_0xa05b('0x7'));var sox=require(_0xa05b('0x8'));var csv=require('to-csv');var ejs=require(_0xa05b('0x9'));var fs=require('fs');var fs_extra=require(_0xa05b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa05b('0xb'));var deskjs=require(_0xa05b('0xc'));var toCsv=require(_0xa05b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa05b('0xe'));var authService=require(_0xa05b('0xf'));var qs=require(_0xa05b('0x10'));var as=require(_0xa05b('0x11'));var hardwareService=require(_0xa05b('0x12'));var logger=require(_0xa05b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa05b('0x14'));var licenseUtil=require(_0xa05b('0x15'));var db=require(_0xa05b('0x16'))['db'];function respondWithStatusCode(_0x4cfc3c,_0x135955){_0x135955=_0x135955||0xcc;return function(_0x2cdd76){if(_0x2cdd76){return _0x4cfc3c[_0xa05b('0x17')](_0x135955);}return _0x4cfc3c[_0xa05b('0x18')](_0x135955)[_0xa05b('0x19')]();};}function respondWithResult(_0x435521,_0x37e6ed){_0x37e6ed=_0x37e6ed||0xc8;return function(_0x28ebc8){if(_0x28ebc8){return _0x435521['status'](_0x37e6ed)[_0xa05b('0x1a')](_0x28ebc8);}};}function respondWithFilteredResult(_0x5ca1dd,_0xc07faa){return function(_0x52b8ea){if(_0x52b8ea){var _0x47bf5e=typeof _0xc07faa[_0xa05b('0x1b')]===_0xa05b('0x1c')&&typeof _0xc07faa['limit']==='undefined';var _0x1bad54=_0x52b8ea['count'];var _0x238a30=_0x47bf5e?0x0:_0xc07faa[_0xa05b('0x1b')];var _0x531250=_0x47bf5e?_0x52b8ea[_0xa05b('0x1d')]:_0xc07faa[_0xa05b('0x1b')]+_0xc07faa[_0xa05b('0x1e')];var _0x4e79a7;if(_0x531250>=_0x1bad54){_0x531250=_0x1bad54;_0x4e79a7=0xc8;}else{_0x4e79a7=0xce;}_0x5ca1dd[_0xa05b('0x18')](_0x4e79a7);return _0x5ca1dd[_0xa05b('0x1f')](_0xa05b('0x20'),_0x238a30+'-'+_0x531250+'/'+_0x1bad54)['json'](_0x52b8ea);}return null;};}function patchUpdates(_0x829b43){return function(_0xad766f){try{jsonpatch[_0xa05b('0x21')](_0xad766f,_0x829b43,!![]);}catch(_0x42a9dd){return BPromise[_0xa05b('0x22')](_0x42a9dd);}return _0xad766f['save']();};}function saveUpdates(_0xddaa59,_0x3b5f72){return function(_0x462076){if(_0x462076){return _0x462076[_0xa05b('0x23')](_0xddaa59)[_0xa05b('0x24')](function(_0x61a8b9){return _0x61a8b9;});}return null;};}function removeEntity(_0x2cf1ab,_0x5daa3e){return function(_0x2e2254){if(_0x2e2254){return _0x2e2254['destroy']()[_0xa05b('0x24')](function(){_0x2cf1ab['status'](0xcc)[_0xa05b('0x19')]();});}};}function handleEntityNotFound(_0x59ac03,_0x5c0778){return function(_0xae4266){if(!_0xae4266){_0x59ac03[_0xa05b('0x17')](0x194);}return _0xae4266;};}function handleError(_0x15a220,_0x9628ec){_0x9628ec=_0x9628ec||0x1f4;return function(_0xb8a2f7){logger[_0xa05b('0x25')](_0xb8a2f7[_0xa05b('0x26')]);if(_0xb8a2f7[_0xa05b('0x27')]){delete _0xb8a2f7[_0xa05b('0x27')];}_0x15a220['status'](_0x9628ec)[_0xa05b('0x28')](_0xb8a2f7);};}exports[_0xa05b('0x29')]=function(_0x2ae8b6,_0x53ff09){var _0x2fc115={},_0x371db1={},_0x1fab86={'count':0x0,'rows':[]};var _0x34f0f8=_[_0xa05b('0x2a')](db['ChatTransferReport'][_0xa05b('0x2b')],function(_0x1464a7){return{'name':_0x1464a7['fieldName'],'type':_0x1464a7[_0xa05b('0x2c')][_0xa05b('0x2d')]};});_0x371db1[_0xa05b('0x2e')]=_['map'](_0x34f0f8,'name');_0x371db1[_0xa05b('0x2f')]=_['keys'](_0x2ae8b6[_0xa05b('0x2f')]);_0x371db1['filters']=_[_0xa05b('0x30')](_0x371db1[_0xa05b('0x2e')],_0x371db1[_0xa05b('0x2f')]);_0x2fc115[_0xa05b('0x31')]=_[_0xa05b('0x30')](_0x371db1['model'],qs['fields'](_0x2ae8b6[_0xa05b('0x2f')]['fields']));_0x2fc115['attributes']=_0x2fc115[_0xa05b('0x31')][_0xa05b('0x32')]?_0x2fc115[_0xa05b('0x31')]:_0x371db1[_0xa05b('0x2e')];if(!_0x2ae8b6[_0xa05b('0x2f')][_0xa05b('0x33')](_0xa05b('0x34'))){_0x2fc115[_0xa05b('0x1e')]=qs[_0xa05b('0x1e')](_0x2ae8b6[_0xa05b('0x2f')][_0xa05b('0x1e')]);_0x2fc115[_0xa05b('0x1b')]=qs['offset'](_0x2ae8b6[_0xa05b('0x2f')][_0xa05b('0x1b')]);}_0x2fc115[_0xa05b('0x35')]=qs[_0xa05b('0x36')](_0x2ae8b6[_0xa05b('0x2f')][_0xa05b('0x36')]);_0x2fc115['where']=qs['filters'](_[_0xa05b('0x37')](_0x2ae8b6[_0xa05b('0x2f')],_0x371db1[_0xa05b('0x38')]),_0x34f0f8);if(_0x2ae8b6[_0xa05b('0x2f')]['filter']){_0x2fc115[_0xa05b('0x39')]=_[_0xa05b('0x3a')](_0x2fc115[_0xa05b('0x39')],{'$or':_['map'](_0x34f0f8,function(_0x290208){if(_0x290208['type']!==_0xa05b('0x3b')){var _0x59a9e2={};_0x59a9e2[_0x290208[_0xa05b('0x27')]]={'$like':'%'+_0x2ae8b6[_0xa05b('0x2f')][_0xa05b('0x3c')]+'%'};return _0x59a9e2;}})});}_0x2fc115=_['merge']({},_0x2fc115,_0x2ae8b6[_0xa05b('0x3d')]);var _0x83556={'where':_0x2fc115['where']};return db[_0xa05b('0x3e')][_0xa05b('0x1d')](_0x83556)['then'](function(_0x60c16d){_0x1fab86['count']=_0x60c16d;if(_0x2ae8b6[_0xa05b('0x2f')][_0xa05b('0x3f')]){_0x2fc115[_0xa05b('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa05b('0x41')](_0x2fc115);})[_0xa05b('0x24')](function(_0x4bc11a){_0x1fab86[_0xa05b('0x42')]=_0x4bc11a;return _0x1fab86;})[_0xa05b('0x24')](respondWithFilteredResult(_0x53ff09,_0x2fc115))[_0xa05b('0x43')](handleError(_0x53ff09,null));};exports[_0xa05b('0x44')]=function(_0x30546d,_0x7b0bd8){var _0x5a643e={'raw':!![],'where':{'id':_0x30546d[_0xa05b('0x45')]['id']}},_0x4808e5={};_0x4808e5[_0xa05b('0x2e')]=_[_0xa05b('0x46')](db[_0xa05b('0x3e')][_0xa05b('0x2b')]);_0x4808e5[_0xa05b('0x2f')]=_[_0xa05b('0x46')](_0x30546d[_0xa05b('0x2f')]);_0x4808e5[_0xa05b('0x38')]=_[_0xa05b('0x30')](_0x4808e5['model'],_0x4808e5[_0xa05b('0x2f')]);_0x5a643e['attributes']=_[_0xa05b('0x30')](_0x4808e5[_0xa05b('0x2e')],qs[_0xa05b('0x47')](_0x30546d[_0xa05b('0x2f')][_0xa05b('0x47')]));_0x5a643e[_0xa05b('0x31')]=_0x5a643e['attributes'][_0xa05b('0x32')]?_0x5a643e[_0xa05b('0x31')]:_0x4808e5[_0xa05b('0x2e')];if(_0x30546d[_0xa05b('0x2f')][_0xa05b('0x3f')]){_0x5a643e[_0xa05b('0x40')]=[{'all':!![]}];}_0x5a643e=_[_0xa05b('0x3a')]({},_0x5a643e,_0x30546d['options']);return db['ChatTransferReport'][_0xa05b('0x48')](_0x5a643e)['then'](handleEntityNotFound(_0x7b0bd8,null))[_0xa05b('0x24')](respondWithResult(_0x7b0bd8,null))[_0xa05b('0x43')](handleError(_0x7b0bd8,null));};exports['create']=function(_0x4868c9,_0x5d7005){return db[_0xa05b('0x3e')]['create'](_0x4868c9[_0xa05b('0x49')],{})[_0xa05b('0x24')](respondWithResult(_0x5d7005,0xc9))['catch'](handleError(_0x5d7005,null));};exports['update']=function(_0x2caecf,_0x3d506c){if(_0x2caecf['body']['id']){delete _0x2caecf['body']['id'];}return db[_0xa05b('0x3e')][_0xa05b('0x48')]({'where':{'id':_0x2caecf['params']['id']}})['then'](handleEntityNotFound(_0x3d506c,null))['then'](saveUpdates(_0x2caecf[_0xa05b('0x49')],null))[_0xa05b('0x24')](respondWithResult(_0x3d506c,null))[_0xa05b('0x43')](handleError(_0x3d506c,null));};exports[_0xa05b('0x4a')]=function(_0x474042,_0x32f63d){return db[_0xa05b('0x3e')][_0xa05b('0x48')]({'where':{'id':_0x474042[_0xa05b('0x45')]['id']}})[_0xa05b('0x24')](handleEntityNotFound(_0x32f63d,null))[_0xa05b('0x24')](removeEntity(_0x32f63d,null))['catch'](handleError(_0x32f63d,null));};exports[_0xa05b('0x4b')]=function(_0xc02cae,_0x1ded70){return db[_0xa05b('0x3e')][_0xa05b('0x4b')]()[_0xa05b('0x24')](respondWithResult(_0x1ded70,null))[_0xa05b('0x43')](handleError(_0x1ded70,null));}; \ No newline at end of file +var _0x118a=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','update','then','destroy','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','body','catch','describe'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x118a,0x128));var _0xa118=function(_0x2c1f11,_0xeff74d){_0x2c1f11=_0x2c1f11-0x0;var _0x49a14e=_0x118a[_0x2c1f11];return _0x49a14e;};'use strict';var emlformat=require(_0xa118('0x0'));var rimraf=require(_0xa118('0x1'));var zipdir=require(_0xa118('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa118('0x3'));var moment=require(_0xa118('0x4'));var BPromise=require(_0xa118('0x5'));var Mustache=require(_0xa118('0x6'));var util=require(_0xa118('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa118('0x8'));var ejs=require(_0xa118('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa118('0xa'));var squel=require('squel');var crypto=require(_0xa118('0xb'));var jsforce=require(_0xa118('0xc'));var deskjs=require(_0xa118('0xd'));var toCsv=require(_0xa118('0x8'));var querystring=require('querystring');var Papa=require(_0xa118('0xe'));var Redis=require(_0xa118('0xf'));var authService=require(_0xa118('0x10'));var qs=require(_0xa118('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa118('0x12'));var logger=require(_0xa118('0x13'))(_0xa118('0x14'));var utils=require(_0xa118('0x15'));var config=require(_0xa118('0x16'));var licenseUtil=require(_0xa118('0x17'));var db=require(_0xa118('0x18'))['db'];function respondWithStatusCode(_0x170de0,_0x34bf6e){_0x34bf6e=_0x34bf6e||0xcc;return function(_0x4f196d){if(_0x4f196d){return _0x170de0[_0xa118('0x19')](_0x34bf6e);}return _0x170de0['status'](_0x34bf6e)[_0xa118('0x1a')]();};}function respondWithResult(_0x14fed5,_0x32712e){_0x32712e=_0x32712e||0xc8;return function(_0x4a87d6){if(_0x4a87d6){return _0x14fed5[_0xa118('0x1b')](_0x32712e)[_0xa118('0x1c')](_0x4a87d6);}};}function respondWithFilteredResult(_0x27536a,_0x4b79b6){return function(_0x41a0ef){if(_0x41a0ef){var _0x3bd39b=typeof _0x4b79b6[_0xa118('0x1d')]===_0xa118('0x1e')&&typeof _0x4b79b6['limit']===_0xa118('0x1e');var _0x8fe0ab=_0x41a0ef[_0xa118('0x1f')];var _0x284318=_0x3bd39b?0x0:_0x4b79b6[_0xa118('0x1d')];var _0x2ef65c=_0x3bd39b?_0x41a0ef[_0xa118('0x1f')]:_0x4b79b6[_0xa118('0x1d')]+_0x4b79b6[_0xa118('0x20')];var _0x2ce11e;if(_0x2ef65c>=_0x8fe0ab){_0x2ef65c=_0x8fe0ab;_0x2ce11e=0xc8;}else{_0x2ce11e=0xce;}_0x27536a[_0xa118('0x1b')](_0x2ce11e);return _0x27536a[_0xa118('0x21')]('Content-Range',_0x284318+'-'+_0x2ef65c+'/'+_0x8fe0ab)[_0xa118('0x1c')](_0x41a0ef);}return null;};}function patchUpdates(_0x18b6de){return function(_0x5debaf){try{jsonpatch['apply'](_0x5debaf,_0x18b6de,!![]);}catch(_0x27e6dc){return BPromise[_0xa118('0x22')](_0x27e6dc);}return _0x5debaf['save']();};}function saveUpdates(_0x2047dd,_0x23dc11){return function(_0x2b89b8){if(_0x2b89b8){return _0x2b89b8[_0xa118('0x23')](_0x2047dd)[_0xa118('0x24')](function(_0x5e9c64){return _0x5e9c64;});}return null;};}function removeEntity(_0x2ae489,_0x54f5d9){return function(_0x4dbc9a){if(_0x4dbc9a){return _0x4dbc9a[_0xa118('0x25')]()[_0xa118('0x24')](function(){_0x2ae489['status'](0xcc)[_0xa118('0x1a')]();});}};}function handleEntityNotFound(_0x2b2a10,_0xdac55e){return function(_0x169484){if(!_0x169484){_0x2b2a10['sendStatus'](0x194);}return _0x169484;};}function handleError(_0x258ea2,_0x5f1628){_0x5f1628=_0x5f1628||0x1f4;return function(_0x30bca6){logger['error'](_0x30bca6[_0xa118('0x26')]);if(_0x30bca6[_0xa118('0x27')]){delete _0x30bca6[_0xa118('0x27')];}_0x258ea2[_0xa118('0x1b')](_0x5f1628)[_0xa118('0x28')](_0x30bca6);};}exports[_0xa118('0x29')]=function(_0x4390f3,_0x4a36ab){var _0x465f31={},_0x357cf0={},_0x79abe9={'count':0x0,'rows':[]};var _0x11aac7=_[_0xa118('0x2a')](db[_0xa118('0x2b')][_0xa118('0x2c')],function(_0x537f6a){return{'name':_0x537f6a[_0xa118('0x2d')],'type':_0x537f6a['type'][_0xa118('0x2e')]};});_0x357cf0[_0xa118('0x2f')]=_['map'](_0x11aac7,_0xa118('0x27'));_0x357cf0['query']=_['keys'](_0x4390f3[_0xa118('0x30')]);_0x357cf0['filters']=_[_0xa118('0x31')](_0x357cf0['model'],_0x357cf0['query']);_0x465f31['attributes']=_['intersection'](_0x357cf0[_0xa118('0x2f')],qs[_0xa118('0x32')](_0x4390f3[_0xa118('0x30')][_0xa118('0x32')]));_0x465f31['attributes']=_0x465f31['attributes'][_0xa118('0x33')]?_0x465f31[_0xa118('0x34')]:_0x357cf0[_0xa118('0x2f')];if(!_0x4390f3[_0xa118('0x30')][_0xa118('0x35')](_0xa118('0x36'))){_0x465f31[_0xa118('0x20')]=qs['limit'](_0x4390f3[_0xa118('0x30')]['limit']);_0x465f31[_0xa118('0x1d')]=qs['offset'](_0x4390f3[_0xa118('0x30')]['offset']);}_0x465f31[_0xa118('0x37')]=qs['sort'](_0x4390f3[_0xa118('0x30')][_0xa118('0x38')]);_0x465f31['where']=qs[_0xa118('0x39')](_['pick'](_0x4390f3[_0xa118('0x30')],_0x357cf0[_0xa118('0x39')]),_0x11aac7);if(_0x4390f3[_0xa118('0x30')][_0xa118('0x3a')]){_0x465f31[_0xa118('0x3b')]=_[_0xa118('0x3c')](_0x465f31['where'],{'$or':_[_0xa118('0x2a')](_0x11aac7,function(_0x5c7878){if(_0x5c7878['type']!==_0xa118('0x3d')){var _0x160d99={};_0x160d99[_0x5c7878[_0xa118('0x27')]]={'$like':'%'+_0x4390f3['query'][_0xa118('0x3a')]+'%'};return _0x160d99;}})});}_0x465f31=_[_0xa118('0x3c')]({},_0x465f31,_0x4390f3[_0xa118('0x3e')]);var _0x4ef34a={'where':_0x465f31[_0xa118('0x3b')]};return db['ChatTransferReport'][_0xa118('0x1f')](_0x4ef34a)[_0xa118('0x24')](function(_0x2dc135){_0x79abe9[_0xa118('0x1f')]=_0x2dc135;if(_0x4390f3[_0xa118('0x30')][_0xa118('0x3f')]){_0x465f31[_0xa118('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa118('0x41')](_0x465f31);})[_0xa118('0x24')](function(_0x5c60a7){_0x79abe9[_0xa118('0x42')]=_0x5c60a7;return _0x79abe9;})[_0xa118('0x24')](respondWithFilteredResult(_0x4a36ab,_0x465f31))['catch'](handleError(_0x4a36ab,null));};exports[_0xa118('0x43')]=function(_0x39516f,_0x15933d){var _0x106b3d={'raw':!![],'where':{'id':_0x39516f[_0xa118('0x44')]['id']}},_0x18fd60={};_0x18fd60[_0xa118('0x2f')]=_[_0xa118('0x45')](db[_0xa118('0x2b')][_0xa118('0x2c')]);_0x18fd60['query']=_['keys'](_0x39516f[_0xa118('0x30')]);_0x18fd60['filters']=_[_0xa118('0x31')](_0x18fd60['model'],_0x18fd60[_0xa118('0x30')]);_0x106b3d[_0xa118('0x34')]=_[_0xa118('0x31')](_0x18fd60[_0xa118('0x2f')],qs[_0xa118('0x32')](_0x39516f[_0xa118('0x30')][_0xa118('0x32')]));_0x106b3d[_0xa118('0x34')]=_0x106b3d[_0xa118('0x34')][_0xa118('0x33')]?_0x106b3d['attributes']:_0x18fd60[_0xa118('0x2f')];if(_0x39516f['query'][_0xa118('0x3f')]){_0x106b3d[_0xa118('0x40')]=[{'all':!![]}];}_0x106b3d=_[_0xa118('0x3c')]({},_0x106b3d,_0x39516f[_0xa118('0x3e')]);return db['ChatTransferReport'][_0xa118('0x46')](_0x106b3d)[_0xa118('0x24')](handleEntityNotFound(_0x15933d,null))[_0xa118('0x24')](respondWithResult(_0x15933d,null))['catch'](handleError(_0x15933d,null));};exports['create']=function(_0x5b47cb,_0x272080){return db[_0xa118('0x2b')]['create'](_0x5b47cb[_0xa118('0x47')],{})[_0xa118('0x24')](respondWithResult(_0x272080,0xc9))[_0xa118('0x48')](handleError(_0x272080,null));};exports[_0xa118('0x23')]=function(_0x4bc0e6,_0x2b1b89){if(_0x4bc0e6['body']['id']){delete _0x4bc0e6['body']['id'];}return db[_0xa118('0x2b')]['find']({'where':{'id':_0x4bc0e6['params']['id']}})['then'](handleEntityNotFound(_0x2b1b89,null))['then'](saveUpdates(_0x4bc0e6['body'],null))[_0xa118('0x24')](respondWithResult(_0x2b1b89,null))[_0xa118('0x48')](handleError(_0x2b1b89,null));};exports[_0xa118('0x25')]=function(_0x1d48ef,_0x1559b9){return db[_0xa118('0x2b')][_0xa118('0x46')]({'where':{'id':_0x1d48ef[_0xa118('0x44')]['id']}})[_0xa118('0x24')](handleEntityNotFound(_0x1559b9,null))[_0xa118('0x24')](removeEntity(_0x1559b9,null))['catch'](handleError(_0x1559b9,null));};exports['describe']=function(_0x1a4764,_0x510944){return db[_0xa118('0x2b')][_0xa118('0x49')]()[_0xa118('0x24')](respondWithResult(_0x510944,null))[_0xa118('0x48')](handleError(_0x510944,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 6dba672..e8c5149 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 _0x61a3=['uniqueid','api','moment','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','report_chat_transfer'];(function(_0x3775f6,_0x31e31e){var _0x3216b5=function(_0x5da2f8){while(--_0x5da2f8){_0x3775f6['push'](_0x3775f6['shift']());}};_0x3216b5(++_0x31e31e);}(_0x61a3,0x149));var _0x361a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x61a3[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x361a('0x0'));var moment=require(_0x361a('0x1'));var BPromise=require(_0x361a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x361a('0x3'));var config=require(_0x361a('0x4'));var attributes=require(_0x361a('0x5'));module['exports']=function(_0x22174d,_0x3ed654){return _0x22174d['define']('ChatTransferReport',attributes,{'tableName':_0x361a('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x361a('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fe9=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x339948,_0x1e07fe){var _0x3fe9cc=function(_0x5bfc39){while(--_0x5bfc39){_0x339948['push'](_0x339948['shift']());}};_0x3fe9cc(++_0x1e07fe);}(_0x3fe9,0xf4));var _0x93fe=function(_0x4778bc,_0x4345c7){_0x4778bc=_0x4778bc-0x0;var _0x1b0e0f=_0x3fe9[_0x4778bc];return _0x1b0e0f;};'use strict';var _=require(_0x93fe('0x0'));var util=require(_0x93fe('0x1'));var logger=require(_0x93fe('0x2'))(_0x93fe('0x3'));var moment=require('moment');var BPromise=require(_0x93fe('0x4'));var rp=require(_0x93fe('0x5'));var fs=require('fs');var path=require(_0x93fe('0x6'));var rimraf=require(_0x93fe('0x7'));var config=require(_0x93fe('0x8'));var attributes=require(_0x93fe('0x9'));module[_0x93fe('0xa')]=function(_0x2c5a33,_0xad1bd6){return _0x2c5a33['define'](_0x93fe('0xb'),attributes,{'tableName':_0x93fe('0xc'),'paranoid':![],'indexes':[{'name':_0x93fe('0xd'),'fields':[_0x93fe('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index d2479a0..fb68c4f 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 _0x4488=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3d54f5,_0x22cd69){var _0x233fdc=function(_0x4f2813){while(--_0x4f2813){_0x3d54f5['push'](_0x3d54f5['shift']());}};_0x233fdc(++_0x22cd69);}(_0x4488,0x1f3));var _0x8448=function(_0x4557e0,_0xe9581){_0x4557e0=_0x4557e0-0x0;var _0x23e871=_0x4488[_0x4557e0];return _0x23e871;};'use strict';var _=require(_0x8448('0x0'));var util=require(_0x8448('0x1'));var moment=require('moment');var BPromise=require(_0x8448('0x2'));var rs=require(_0x8448('0x3'));var fs=require('fs');var Redis=require(_0x8448('0x4'));var db=require(_0x8448('0x5'))['db'];var utils=require(_0x8448('0x6'));var logger=require('../../config/logger')(_0x8448('0x7'));var config=require(_0x8448('0x8'));var jayson=require(_0x8448('0x9'));var client=jayson[_0x8448('0xa')][_0x8448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5481d6,_0x10dcfc,_0x3be1ab){return new BPromise(function(_0x37ebd5,_0x3c926){return client[_0x8448('0xc')](_0x5481d6,_0x3be1ab)[_0x8448('0xd')](function(_0x295d08){logger['info'](_0x8448('0xe'),_0x10dcfc,_0x8448('0xf'));logger[_0x8448('0x10')](_0x8448('0x11'),_0x10dcfc,_0x8448('0xf'),JSON[_0x8448('0x12')](_0x295d08));if(_0x295d08[_0x8448('0x13')]){if(_0x295d08[_0x8448('0x13')][_0x8448('0x14')]===0x1f4){logger[_0x8448('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x10dcfc,_0x295d08[_0x8448('0x13')]['message']);return _0x3c926(_0x295d08['error'][_0x8448('0x15')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x10dcfc,_0x295d08[_0x8448('0x13')][_0x8448('0x15')]);return _0x37ebd5(_0x295d08[_0x8448('0x13')]['message']);}else{logger['info'](_0x8448('0xe'),_0x10dcfc,_0x8448('0xf'));_0x37ebd5(_0x295d08[_0x8448('0x16')][_0x8448('0x15')]);}})[_0x8448('0x17')](function(_0x19d91c){logger[_0x8448('0x13')](_0x8448('0xe'),_0x10dcfc,_0x19d91c);_0x3c926(_0x19d91c);});});} \ No newline at end of file +var _0x2daa=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4dfa76,_0x53e4fb){var _0x14d3eb=function(_0x3ccf07){while(--_0x3ccf07){_0x4dfa76['push'](_0x4dfa76['shift']());}};_0x14d3eb(++_0x53e4fb);}(_0x2daa,0x67));var _0xa2da=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0x2daa[_0x1d70db];return _0x3060c6;};'use strict';var _=require(_0xa2da('0x0'));var util=require('util');var moment=require(_0xa2da('0x1'));var BPromise=require(_0xa2da('0x2'));var rs=require(_0xa2da('0x3'));var fs=require('fs');var Redis=require(_0xa2da('0x4'));var db=require(_0xa2da('0x5'))['db'];var utils=require(_0xa2da('0x6'));var logger=require(_0xa2da('0x7'))(_0xa2da('0x8'));var config=require(_0xa2da('0x9'));var jayson=require(_0xa2da('0xa'));var client=jayson[_0xa2da('0xb')][_0xa2da('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ca6d4,_0x38cb93,_0x2e1298){return new BPromise(function(_0x6f9b92,_0x4b7bd7){return client['request'](_0x4ca6d4,_0x2e1298)[_0xa2da('0xd')](function(_0x4e159b){logger[_0xa2da('0xe')](_0xa2da('0xf'),_0x38cb93,_0xa2da('0x10'));logger[_0xa2da('0x11')](_0xa2da('0x12'),_0x38cb93,_0xa2da('0x10'),JSON[_0xa2da('0x13')](_0x4e159b));if(_0x4e159b[_0xa2da('0x14')]){if(_0x4e159b[_0xa2da('0x14')]['code']===0x1f4){logger[_0xa2da('0x14')](_0xa2da('0xf'),_0x38cb93,_0x4e159b['error'][_0xa2da('0x15')]);return _0x4b7bd7(_0x4e159b['error'][_0xa2da('0x15')]);}logger[_0xa2da('0x14')](_0xa2da('0xf'),_0x38cb93,_0x4e159b[_0xa2da('0x14')][_0xa2da('0x15')]);return _0x6f9b92(_0x4e159b[_0xa2da('0x14')][_0xa2da('0x15')]);}else{logger[_0xa2da('0xe')](_0xa2da('0xf'),_0x38cb93,_0xa2da('0x10'));_0x6f9b92(_0x4e159b[_0xa2da('0x16')][_0xa2da('0x15')]);}})[_0xa2da('0x17')](function(_0x2fd1bc){logger[_0xa2da('0x14')](_0xa2da('0xf'),_0x38cb93,_0x2fd1bc);_0x4b7bd7(_0x2fd1bc);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ab548a2..02b7585 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 _0x59e1=['put','/:id','delete','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','post'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x59e1,0x81));var _0x159e=function(_0x307ccb,_0x5bfd93){_0x307ccb=_0x307ccb-0x0;var _0x24d520=_0x59e1[_0x307ccb];return _0x24d520;};'use strict';var multer=require('multer');var util=require(_0x159e('0x0'));var path=require(_0x159e('0x1'));var timeout=require('connect-timeout');var express=require(_0x159e('0x2'));var router=express[_0x159e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x159e('0x4'));var interaction=require(_0x159e('0x5'));var config=require(_0x159e('0x6'));var controller=require(_0x159e('0x7'));router[_0x159e('0x8')]('/',auth['isAuthenticated'](),controller[_0x159e('0x9')]);router[_0x159e('0x8')](_0x159e('0xa'),auth[_0x159e('0xb')](),controller[_0x159e('0xc')]);router[_0x159e('0x8')]('/:id',auth[_0x159e('0xb')](),controller[_0x159e('0xd')]);router[_0x159e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x159e('0xf')](_0x159e('0x10'),auth[_0x159e('0xb')](),controller['update']);router[_0x159e('0x11')]('/:id',auth[_0x159e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x389f=['create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x389f,0x99));var _0xf389=function(_0x12daa3,_0x5725c8){_0x12daa3=_0x12daa3-0x0;var _0x219113=_0x389f[_0x12daa3];return _0x219113;};'use strict';var multer=require(_0xf389('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf389('0x1'));var express=require(_0xf389('0x2'));var router=express[_0xf389('0x3')]();var fs_extra=require(_0xf389('0x4'));var auth=require(_0xf389('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf389('0x6'));var controller=require(_0xf389('0x7'));router[_0xf389('0x8')]('/',auth[_0xf389('0x9')](),controller[_0xf389('0xa')]);router[_0xf389('0x8')](_0xf389('0xb'),auth[_0xf389('0x9')](),controller[_0xf389('0xc')]);router['get'](_0xf389('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf389('0xe')]('/',auth[_0xf389('0x9')](),controller[_0xf389('0xf')]);router[_0xf389('0x10')](_0xf389('0xd'),auth[_0xf389('0x9')](),controller[_0xf389('0x11')]);router[_0xf389('0x12')]('/:id',auth[_0xf389('0x9')](),controller[_0xf389('0x13')]);module[_0xf389('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 4c43845..3d60cf5 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 _0x1be1=['textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','TEXT','stringify','input','name','getDataValue','onlineForm','parse','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1be1,0x192));var _0x11be=function(_0x11ab8f,_0x11ce60){_0x11ab8f=_0x11ab8f-0x0;var _0x334573=_0x1be1[_0x11ab8f];return _0x334573;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x11be('0x0')]={'name':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x11be('0x2')},'description':{'type':Sequelize[_0x11be('0x1')]},'mapKey':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x3')},'key':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x9'),_0x11be('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xb')},'start_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x10')},'noteTitle':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x12')},'closingMessageButton':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x13')},'ratingType':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x14'),_0x11be('0x15')),'defaultValue':_0x11be('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON[_0x11be('0x17')]({'items':[{'type':_0x11be('0x18'),'variable':null,'config':{'placeholder':_0x11be('0x19'),'type':'text','required':!![]},'props':{'title':_0x11be('0x19'),'helpText':''}},{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x11be('0x1a')](_0x11be('0x1b'))?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x1b'))):{};},'set':function(_0x518e2b){return this[_0x11be('0x1d')]('onlineForm',JSON[_0x11be('0x17')](_0x518e2b));}},'offlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x11be('0x3'),'type':_0x11be('0x3')},'variable':null},{'type':_0x11be('0x1e'),'config':{'placeholder':_0x11be('0x1f')},'props':{'title':_0x11be('0x1f'),'helpText':_0x11be('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x11be('0x1a')]('offlineForm')?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x21'))):{};},'set':function(_0x147b62){return this['setDataValue']('offlineForm',JSON[_0x11be('0x17')](_0x147b62));}},'token':{'type':Sequelize[_0x11be('0x1')],'defaultValue':function(){return rs[_0x11be('0x22')]();}},'autoclose':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x11be('0x1')]},'forwardOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x11be('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x23')},'waitingMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x25')},'offlineMessageBody':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x26')},'skipUnmanaged':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x27')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x28')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x29')},'defaultTitle':{'type':Sequelize[_0x11be('0x1')]},'customerAvatar':{'type':Sequelize[_0x11be('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x2b')},'systemAvatar':{'type':Sequelize[_0x11be('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11be('0x6')],'comment':_0x11be('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2618f5){if(!_0x2618f5)this[_0x11be('0x1d')]('mandatoryDispositionPauseId',null);this[_0x11be('0x1d')](_0x11be('0x2d'),_0x2618f5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x11be('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x11be('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x11be('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x11be('0x16')]}}; \ No newline at end of file +var _0xaa88=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Skip','Feedback','star','thumb','input','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','generate','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','bottom_right','INTEGER','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xaa88,0x137));var _0x8aa8=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0xaa88[_0x3794a0];return _0x5bdaba;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aa8('0x4')},'description':{'type':Sequelize[_0x8aa8('0x3')]},'mapKey':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8aa8('0x3')]},'animation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0xb'),'squared'),'defaultValue':_0x8aa8('0xb')},'header_online':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xc')},'offline_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xd')},'download_transcript':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8aa8('0xe')]},'closingQuestion':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x11')},'noteTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x13')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x14')},'conditionAgreement':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x15')},'ratingType':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0x16'),_0x8aa8('0x17')),'defaultValue':_0x8aa8('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x8aa8('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8aa8('0x18'),'props':{'title':_0x8aa8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8aa8('0x1a')](_0x8aa8('0x1b'))?JSON[_0x8aa8('0x1c')](this['getDataValue']('onlineForm')):{};},'set':function(_0x2d1508){return this[_0x8aa8('0x1d')](_0x8aa8('0x1b'),JSON[_0x8aa8('0x1e')](_0x2d1508));}},'offlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':_0x8aa8('0x5')},'variable':null},{'type':_0x8aa8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8aa8('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8aa8('0x21'))?JSON[_0x8aa8('0x1c')](this[_0x8aa8('0x1a')](_0x8aa8('0x21'))):{};},'set':function(_0xe07a83){return this['setDataValue'](_0x8aa8('0x21'),JSON[_0x8aa8('0x1e')](_0xe07a83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x22')]();}},'autoclose':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8aa8('0x3')]},'forwardOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8aa8('0x3')]},'waitingTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x23')},'waitingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return _0x8aa8('0x28');}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2c')},'messagesAlignment':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8aa8('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0x2b')],'comment':_0x8aa8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aa8('0x30'),'set':function(_0x3c6115){if(!_0x3c6115)this[_0x8aa8('0x1d')](_0x8aa8('0x31'),null);this[_0x8aa8('0x1d')](_0x8aa8('0x32'),_0x3c6115);}},'vidaooEscalation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8aa8('0x3')]},'vidaooTopic':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x33')},'vidaooNote':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':function(){return _0x8aa8('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8aa8('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 13e657b..fa9aef5 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 _0xa4a5=['lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','%s\x20%s\x20%s','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','render','toPairs','offlineMessageBody','fromString','offline-chat','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','originalname','mimetype','toPairsIn','mapValues','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','Intervals','virtual','increment','chatLicenseExceeded','push','all','server/files/chat/iframe.ejs','utf8','remote','connection','remoteAddress','alignment','verticalAlignment','textButtonColor','color_button','backgroundColor','addApplications','sequelize','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','ChatWebsite,\x20%s,\x20%s','request\x20sent','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','Disposition','hasOwnProperty','ChatWebsiteId','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','ids','addLogo','sitepic','file','customerAvatar','addSystemAvatar','systemAvatar','filename','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','root','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','applications','list','priority','account','ListId','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0xa4a5,0x1b1));var _0x5a4a=function(_0x26d035,_0x369667){_0x26d035=_0x26d035-0x0;var _0x26fe57=_0xa4a5[_0x26d035];return _0x26fe57;};'use strict';var BPromise=require(_0x5a4a('0x0'));var Mustache=require(_0x5a4a('0x1'));var util=require('util');var path=require(_0x5a4a('0x2'));var ejs=require(_0x5a4a('0x3'));var fs=require('fs');var fs_extra=require(_0x5a4a('0x4'));var _=require(_0x5a4a('0x5'));var querystring=require(_0x5a4a('0x6'));var Redis=require(_0x5a4a('0x7'));var qs=require(_0x5a4a('0x8'));var logger=require(_0x5a4a('0x9'))(_0x5a4a('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5a4a('0xb')]=_['defaults'](config[_0x5a4a('0xb')],{'host':_0x5a4a('0xc'),'port':0x18eb});var socket=require(_0x5a4a('0xd'))(new Redis(config[_0x5a4a('0xb')]));require(_0x5a4a('0xe'))['register'](socket);var htmlToText=require(_0x5a4a('0xf'));var jayson=require(_0x5a4a('0x10'));var client=jayson[_0x5a4a('0x11')]['http']({'port':0x232c});var client9002=jayson[_0x5a4a('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x5a4a('0x11')][_0x5a4a('0x12')]({'port':0x232b});var client9001=jayson[_0x5a4a('0x11')][_0x5a4a('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x25c0f6,_0x3360b2,_0x5d3c9b,_0x3ecde4){return new BPromise(function(_0x4b370a,_0xadf54){var _0x377cf2=_0x3ecde4||client;return _0x377cf2[_0x5a4a('0x13')](_0x25c0f6,_0x5d3c9b)[_0x5a4a('0x14')](function(_0x3df9ea){logger[_0x5a4a('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x3360b2,'request\x20sent');logger[_0x5a4a('0x16')](_0x5a4a('0x17'),_0x3360b2,'request\x20sent',JSON['stringify'](_0x3df9ea));if(_0x3df9ea[_0x5a4a('0x18')]){if(_0x3df9ea[_0x5a4a('0x18')]['code']===0x1f4){logger[_0x5a4a('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x3360b2,_0x3df9ea['error'][_0x5a4a('0x19')]);return _0xadf54(_0x3df9ea[_0x5a4a('0x18')][_0x5a4a('0x19')]);}logger[_0x5a4a('0x18')](_0x5a4a('0x1a'),_0x3360b2,_0x3df9ea[_0x5a4a('0x18')][_0x5a4a('0x19')]);return _0x4b370a(_0x3df9ea[_0x5a4a('0x18')][_0x5a4a('0x19')]);}else{logger['info'](_0x5a4a('0x1a'),_0x3360b2,_0x5a4a('0x1b'));_0x4b370a(_0x3df9ea[_0x5a4a('0x1c')][_0x5a4a('0x19')]);}})[_0x5a4a('0x1d')](function(_0x3dc400){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3360b2,_0x3dc400);_0xadf54(_0x3dc400);});});}function respondWithStatusCode(_0x14d54a,_0x1ac6cb){_0x1ac6cb=_0x1ac6cb||0xcc;return function(_0x2b2817){if(_0x2b2817){return _0x14d54a['sendStatus'](_0x1ac6cb);}return _0x14d54a[_0x5a4a('0x1e')](_0x1ac6cb)[_0x5a4a('0x1f')]();};}function respondWithResult(_0x3710c0,_0x2bf133){_0x2bf133=_0x2bf133||0xc8;return function(_0x2462d6){if(_0x2462d6){return _0x3710c0['status'](_0x2bf133)[_0x5a4a('0x20')](_0x2462d6);}};}function respondWithFilteredResult(_0x2f4911,_0x5b39d2){return function(_0x11e2cd){if(_0x11e2cd){var _0x20d7ec=typeof _0x5b39d2[_0x5a4a('0x21')]==='undefined'&&typeof _0x5b39d2[_0x5a4a('0x22')]===_0x5a4a('0x23');var _0x1e7fa7=_0x11e2cd[_0x5a4a('0x24')];var _0xa3d3e5=_0x20d7ec?0x0:_0x5b39d2[_0x5a4a('0x21')];var _0x311808=_0x20d7ec?_0x11e2cd[_0x5a4a('0x24')]:_0x5b39d2[_0x5a4a('0x21')]+_0x5b39d2['limit'];var _0xb6b22e;if(_0x311808>=_0x1e7fa7){_0x311808=_0x1e7fa7;_0xb6b22e=0xc8;}else{_0xb6b22e=0xce;}_0x2f4911['status'](_0xb6b22e);return _0x2f4911[_0x5a4a('0x25')](_0x5a4a('0x26'),_0xa3d3e5+'-'+_0x311808+'/'+_0x1e7fa7)[_0x5a4a('0x20')](_0x11e2cd);}return null;};}function saveUpdates(_0x10a1cf){return function(_0x4af453){if(_0x4af453){return _0x4af453['update'](_0x10a1cf)[_0x5a4a('0x14')](function(_0x523151){return _0x523151;});}return null;};}function removeEntity(_0x3ff96a){return function(_0x3cf1f9){if(_0x3cf1f9){return _0x3cf1f9['destroy']()[_0x5a4a('0x14')](function(){var _0x380d89=_0x3cf1f9['get']({'plain':!![]});var _0x134576=_0x5a4a('0x27');return db[_0x5a4a('0x28')][_0x5a4a('0x29')]({'where':{'type':_0x134576,'resourceId':_0x380d89['id']}})[_0x5a4a('0x14')](function(){return _0x3cf1f9;});})[_0x5a4a('0x14')](function(){_0x3ff96a[_0x5a4a('0x1e')](0xcc)[_0x5a4a('0x1f')]();});}};}function handleEntityNotFound(_0xf53f0a){return function(_0x520802){if(!_0x520802){_0xf53f0a[_0x5a4a('0x2a')](0x194);}return _0x520802;};}function handleError(_0x4c8c88,_0x129b5c){_0x129b5c=_0x129b5c||0x1f4;return function(_0x3be032){logger[_0x5a4a('0x18')](_0x3be032[_0x5a4a('0x2b')]);if(_0x3be032[_0x5a4a('0x2c')]){delete _0x3be032[_0x5a4a('0x2c')];}_0x4c8c88[_0x5a4a('0x1e')](_0x129b5c)[_0x5a4a('0x2d')](_0x3be032);};}exports[_0x5a4a('0x2e')]=function(_0x534881,_0x43349a){var _0x5b533f={'include':[{'model':db[_0x5a4a('0x2f')],'as':_0x5a4a('0x30')}]},_0x3ce655={},_0x472262={'count':0x0,'rows':[]};var _0x3a6a68=_[_0x5a4a('0x31')](db[_0x5a4a('0x32')][_0x5a4a('0x33')],function(_0x4b140b){return{'name':_0x4b140b[_0x5a4a('0x34')],'type':_0x4b140b[_0x5a4a('0x35')]['key']};});_0x3ce655['model']=_[_0x5a4a('0x31')](_0x3a6a68,_0x5a4a('0x2c'));_0x3ce655[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x534881['query']);_0x3ce655[_0x5a4a('0x38')]=_[_0x5a4a('0x39')](_0x3ce655['model'],_0x3ce655['query']);_0x5b533f[_0x5a4a('0x3a')]=_[_0x5a4a('0x39')](_0x3ce655[_0x5a4a('0x3b')],qs[_0x5a4a('0x3c')](_0x534881[_0x5a4a('0x36')][_0x5a4a('0x3c')]));_0x5b533f['attributes']=_0x5b533f['attributes'][_0x5a4a('0x3d')]?_0x5b533f[_0x5a4a('0x3a')]:_0x3ce655[_0x5a4a('0x3b')];if(!_0x534881[_0x5a4a('0x36')]['hasOwnProperty'](_0x5a4a('0x3e'))){_0x5b533f[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x534881[_0x5a4a('0x36')][_0x5a4a('0x22')]);_0x5b533f[_0x5a4a('0x21')]=qs[_0x5a4a('0x21')](_0x534881[_0x5a4a('0x36')]['offset']);}_0x5b533f[_0x5a4a('0x3f')]=qs[_0x5a4a('0x40')](_0x534881['query'][_0x5a4a('0x40')]);_0x5b533f[_0x5a4a('0x41')]=qs[_0x5a4a('0x38')](_[_0x5a4a('0x42')](_0x534881[_0x5a4a('0x36')],_0x3ce655[_0x5a4a('0x38')]),_0x3a6a68);if(_0x534881[_0x5a4a('0x36')][_0x5a4a('0x43')]){_0x5b533f[_0x5a4a('0x41')]=_['merge'](_0x5b533f['where'],{'$or':_[_0x5a4a('0x31')](_0x3a6a68,function(_0x57e69f){if(_0x57e69f[_0x5a4a('0x35')]!==_0x5a4a('0x44')){var _0x5089f8={};_0x5089f8[_0x57e69f['name']]={'$like':'%'+_0x534881[_0x5a4a('0x36')][_0x5a4a('0x43')]+'%'};return _0x5089f8;}})});}_0x5b533f=_[_0x5a4a('0x45')]({},_0x5b533f,_0x534881[_0x5a4a('0x46')]);var _0x2b9067={'where':_0x5b533f['where']};return db[_0x5a4a('0x32')][_0x5a4a('0x24')](_0x2b9067)['then'](function(_0x411f1d){_0x472262['count']=_0x411f1d;if(_0x534881[_0x5a4a('0x36')][_0x5a4a('0x47')]){_0x5b533f[_0x5a4a('0x48')]=[{'all':!![]}];}return db[_0x5a4a('0x32')]['findAll'](_0x5b533f);})[_0x5a4a('0x14')](function(_0x15b47a){_0x472262[_0x5a4a('0x49')]=_0x15b47a;return _0x472262;})['then'](respondWithFilteredResult(_0x43349a,_0x5b533f))[_0x5a4a('0x1d')](handleError(_0x43349a,null));};exports[_0x5a4a('0x4a')]=function(_0x487da,_0x3dc741){var _0x5c1ff2={'raw':![],'where':{'id':_0x487da['params']['id']},'include':[{'model':db[_0x5a4a('0x2f')],'as':_0x5a4a('0x30')}]},_0x44e228={};_0x44e228[_0x5a4a('0x3b')]=_[_0x5a4a('0x37')](db[_0x5a4a('0x32')][_0x5a4a('0x33')]);_0x44e228[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x487da[_0x5a4a('0x36')]);_0x44e228[_0x5a4a('0x38')]=_['intersection'](_0x44e228[_0x5a4a('0x3b')],_0x44e228[_0x5a4a('0x36')]);_0x5c1ff2[_0x5a4a('0x3a')]=_['intersection'](_0x44e228[_0x5a4a('0x3b')],qs[_0x5a4a('0x3c')](_0x487da[_0x5a4a('0x36')][_0x5a4a('0x3c')]));_0x5c1ff2[_0x5a4a('0x3a')]=_0x5c1ff2['attributes'][_0x5a4a('0x3d')]?_0x5c1ff2[_0x5a4a('0x3a')]:_0x44e228['model'];if(_0x487da[_0x5a4a('0x36')]['includeAll']){_0x5c1ff2[_0x5a4a('0x48')]=[{'all':!![]}];}_0x5c1ff2=_[_0x5a4a('0x45')]({},_0x5c1ff2,_0x487da[_0x5a4a('0x46')]);return db['ChatWebsite'][_0x5a4a('0x4b')](_0x5c1ff2)[_0x5a4a('0x14')](handleEntityNotFound(_0x3dc741,null))[_0x5a4a('0x14')](respondWithResult(_0x3dc741,null))[_0x5a4a('0x1d')](handleError(_0x3dc741,null));};exports['create']=function(_0x3064f9,_0x13dba0){return db['ChatWebsite'][_0x5a4a('0x4c')](_0x3064f9[_0x5a4a('0x4d')],{})['then'](function(_0x51dc28){var _0x34c88b=_0x3064f9[_0x5a4a('0x4e')]['get']({'plain':!![]});if(!_0x34c88b)throw new Error(_0x5a4a('0x4f'));if(_0x34c88b[_0x5a4a('0x50')]===_0x5a4a('0x4e')){var _0x447c50=_0x51dc28[_0x5a4a('0x51')]({'plain':!![]});var _0x1266cd=_0x5a4a('0x27');return db[_0x5a4a('0x52')][_0x5a4a('0x4b')]({'where':{'name':_0x1266cd,'userProfileId':_0x34c88b['userProfileId']},'raw':!![]})['then'](function(_0x217d2b){if(_0x217d2b&&_0x217d2b[_0x5a4a('0x53')]===0x0){return db[_0x5a4a('0x28')][_0x5a4a('0x4c')]({'name':_0x447c50[_0x5a4a('0x2c')],'resourceId':_0x447c50['id'],'type':_0x217d2b[_0x5a4a('0x2c')],'sectionId':_0x217d2b['id']},{})[_0x5a4a('0x14')](function(){return _0x51dc28;});}else{return _0x51dc28;}})['catch'](function(_0x539aac){logger['error'](_0x5a4a('0x54'),_0x539aac);throw _0x539aac;});}return _0x51dc28;})[_0x5a4a('0x14')](respondWithResult(_0x13dba0,0xc9))[_0x5a4a('0x1d')](handleError(_0x13dba0,null));};exports[_0x5a4a('0x55')]=function(_0x438503,_0x1708c5){if(_0x438503[_0x5a4a('0x4d')]['id']){delete _0x438503[_0x5a4a('0x4d')]['id'];}return db[_0x5a4a('0x32')][_0x5a4a('0x4b')]({'where':{'id':_0x438503[_0x5a4a('0x56')]['id']},'include':[{'model':db[_0x5a4a('0x2f')],'as':_0x5a4a('0x30')}]})[_0x5a4a('0x14')](handleEntityNotFound(_0x1708c5,null))[_0x5a4a('0x14')](saveUpdates(_0x438503['body'],null))['then'](respondWithResult(_0x1708c5,null))[_0x5a4a('0x1d')](handleError(_0x1708c5,null));};exports[_0x5a4a('0x29')]=function(_0x4b5bff,_0x13958b){return db['ChatWebsite'][_0x5a4a('0x4b')]({'where':{'id':_0x4b5bff['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x13958b,null))[_0x5a4a('0x14')](removeEntity(_0x13958b,null))[_0x5a4a('0x1d')](handleError(_0x13958b,null));};exports[_0x5a4a('0x57')]=function(_0x5b189e,_0x95b7a2){return db['ChatWebsite'][_0x5a4a('0x57')]()[_0x5a4a('0x14')](respondWithResult(_0x95b7a2,null))[_0x5a4a('0x1d')](handleError(_0x95b7a2,null));};exports[_0x5a4a('0x58')]=function(_0xb82557,_0x1a5f9a){if(_0xb82557[_0x5a4a('0x4d')]['id']){delete _0xb82557['body']['id'];}return db[_0x5a4a('0x32')]['find']({'where':{'id':_0xb82557[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x1a5f9a,null))['then'](function(_0x4923fc){if(_0x4923fc){_0xb82557['body']['ChatWebsiteId']=_0x4923fc['id'];return db['Disposition']['create'](_0xb82557['body']);}})['then'](respondWithResult(_0x1a5f9a,null))['catch'](handleError(_0x1a5f9a,null));};exports['getDispositions']=function(_0x2008ef,_0x1a49e8){var _0x11f65e={'raw':![],'where':{}};var _0x215750={};var _0x332e89={'count':0x0,'rows':[]};return db[_0x5a4a('0x32')]['findOne']({'where':{'id':_0x2008ef[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x1a49e8,null))['then'](function(_0x420c62){if(_0x420c62){_0x215750[_0x5a4a('0x3b')]=_['keys'](db[_0x5a4a('0x59')][_0x5a4a('0x33')]);_0x215750[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x2008ef[_0x5a4a('0x36')]);_0x215750[_0x5a4a('0x38')]=_['intersection'](_0x215750[_0x5a4a('0x3b')],_0x215750[_0x5a4a('0x36')]);_0x11f65e[_0x5a4a('0x3a')]=_[_0x5a4a('0x39')](_0x215750['model'],qs[_0x5a4a('0x3c')](_0x2008ef[_0x5a4a('0x36')][_0x5a4a('0x3c')]));_0x11f65e[_0x5a4a('0x3a')]=_0x11f65e[_0x5a4a('0x3a')][_0x5a4a('0x3d')]?_0x11f65e['attributes']:_0x215750[_0x5a4a('0x3b')];if(!_0x2008ef[_0x5a4a('0x36')][_0x5a4a('0x5a')]('nolimit')){_0x11f65e[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x2008ef[_0x5a4a('0x36')][_0x5a4a('0x22')]);_0x11f65e[_0x5a4a('0x21')]=qs[_0x5a4a('0x21')](_0x2008ef[_0x5a4a('0x36')][_0x5a4a('0x21')]);}_0x11f65e[_0x5a4a('0x3f')]=qs['sort'](_0x2008ef['query'][_0x5a4a('0x40')]);_0x11f65e[_0x5a4a('0x41')]=qs['filters'](_['pick'](_0x2008ef[_0x5a4a('0x36')],_0x215750[_0x5a4a('0x38')]));_0x11f65e['where'][_0x5a4a('0x5b')]=_0x420c62['id'];if(_0x2008ef[_0x5a4a('0x36')]['filter']){_0x11f65e[_0x5a4a('0x41')]=_['merge'](_0x11f65e[_0x5a4a('0x41')],{'$or':_['map'](_0x11f65e[_0x5a4a('0x3a')],function(_0x16a047){var _0x4cd357={};_0x4cd357[_0x16a047]={'$like':'%'+_0x2008ef[_0x5a4a('0x36')]['filter']+'%'};return _0x4cd357;})});}_0x11f65e=_['merge']({},_0x11f65e,_0x2008ef[_0x5a4a('0x46')]);return db[_0x5a4a('0x59')][_0x5a4a('0x24')]({'where':_0x11f65e[_0x5a4a('0x41')]})[_0x5a4a('0x14')](function(_0x4e849d){_0x332e89['count']=_0x4e849d;if(_0x2008ef[_0x5a4a('0x36')][_0x5a4a('0x47')]){_0x11f65e[_0x5a4a('0x48')]=[{'all':!![]}];}return db[_0x5a4a('0x59')]['findAll'](_0x11f65e);})[_0x5a4a('0x14')](function(_0x50bfd0){_0x332e89[_0x5a4a('0x49')]=_0x50bfd0;return _0x332e89;});}})[_0x5a4a('0x14')](respondWithFilteredResult(_0x1a49e8,_0x11f65e))[_0x5a4a('0x1d')](handleError(_0x1a49e8,null));};exports[_0x5a4a('0x5c')]=function(_0x98fdfc,_0xd1ceca){return db[_0x5a4a('0x32')]['find']({'where':{'id':_0x98fdfc[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0xd1ceca,null))[_0x5a4a('0x14')](function(_0x32acbf){if(_0x32acbf){return _0x32acbf[_0x5a4a('0x5c')](_0x98fdfc[_0x5a4a('0x36')]['ids']);}})[_0x5a4a('0x14')](respondWithStatusCode(_0xd1ceca,null))['catch'](handleError(_0xd1ceca,null));};exports[_0x5a4a('0x5d')]=function(_0x4f8443,_0x22e688){if(_0x4f8443[_0x5a4a('0x4d')]['id']){delete _0x4f8443[_0x5a4a('0x4d')]['id'];}return db['ChatWebsite'][_0x5a4a('0x4b')]({'where':{'id':_0x4f8443['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x22e688,null))[_0x5a4a('0x14')](function(_0x346af0){if(_0x346af0){_0x4f8443[_0x5a4a('0x4d')]['ChatWebsiteId']=_0x346af0['id'];return db[_0x5a4a('0x5e')][_0x5a4a('0x4c')](_0x4f8443[_0x5a4a('0x4d')]);}})['then'](respondWithResult(_0x22e688,null))['catch'](handleError(_0x22e688,null));};exports[_0x5a4a('0x5f')]=function(_0x4986cb,_0x50f581){var _0x1bedb3={'raw':![],'where':{}};var _0x2d1684={};var _0x5459bf={'count':0x0,'rows':[]};return db[_0x5a4a('0x32')][_0x5a4a('0x60')]({'where':{'id':_0x4986cb[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x50f581,null))[_0x5a4a('0x14')](function(_0x207db9){if(_0x207db9){_0x2d1684['model']=_[_0x5a4a('0x37')](db[_0x5a4a('0x5e')][_0x5a4a('0x33')]);_0x2d1684['query']=_[_0x5a4a('0x37')](_0x4986cb[_0x5a4a('0x36')]);_0x2d1684[_0x5a4a('0x38')]=_['intersection'](_0x2d1684[_0x5a4a('0x3b')],_0x2d1684[_0x5a4a('0x36')]);_0x1bedb3[_0x5a4a('0x3a')]=_['intersection'](_0x2d1684['model'],qs[_0x5a4a('0x3c')](_0x4986cb[_0x5a4a('0x36')][_0x5a4a('0x3c')]));_0x1bedb3[_0x5a4a('0x3a')]=_0x1bedb3[_0x5a4a('0x3a')][_0x5a4a('0x3d')]?_0x1bedb3[_0x5a4a('0x3a')]:_0x2d1684[_0x5a4a('0x3b')];if(!_0x4986cb['query'][_0x5a4a('0x5a')](_0x5a4a('0x3e'))){_0x1bedb3[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x4986cb[_0x5a4a('0x36')][_0x5a4a('0x22')]);_0x1bedb3[_0x5a4a('0x21')]=qs[_0x5a4a('0x21')](_0x4986cb['query'][_0x5a4a('0x21')]);}_0x1bedb3[_0x5a4a('0x3f')]=qs[_0x5a4a('0x40')](_0x4986cb[_0x5a4a('0x36')][_0x5a4a('0x40')]);_0x1bedb3[_0x5a4a('0x41')]=qs[_0x5a4a('0x38')](_[_0x5a4a('0x42')](_0x4986cb[_0x5a4a('0x36')],_0x2d1684[_0x5a4a('0x38')]));_0x1bedb3['where']['ChatWebsiteId']=_0x207db9['id'];if(_0x4986cb[_0x5a4a('0x36')]['filter']){_0x1bedb3[_0x5a4a('0x41')]=_['merge'](_0x1bedb3[_0x5a4a('0x41')],{'$or':_[_0x5a4a('0x31')](_0x1bedb3[_0x5a4a('0x3a')],function(_0x381066){var _0x56ad30={};_0x56ad30[_0x381066]={'$like':'%'+_0x4986cb[_0x5a4a('0x36')]['filter']+'%'};return _0x56ad30;})});}_0x1bedb3=_[_0x5a4a('0x45')]({},_0x1bedb3,_0x4986cb['options']);return db['CannedAnswer'][_0x5a4a('0x24')]({'where':_0x1bedb3[_0x5a4a('0x41')]})[_0x5a4a('0x14')](function(_0x49e8f6){_0x5459bf[_0x5a4a('0x24')]=_0x49e8f6;if(_0x4986cb[_0x5a4a('0x36')][_0x5a4a('0x47')]){_0x1bedb3[_0x5a4a('0x48')]=[{'all':!![]}];}return db[_0x5a4a('0x5e')][_0x5a4a('0x61')](_0x1bedb3);})[_0x5a4a('0x14')](function(_0x37b7cd){_0x5459bf['rows']=_0x37b7cd;return _0x5459bf;});}})[_0x5a4a('0x14')](respondWithFilteredResult(_0x50f581,_0x1bedb3))['catch'](handleError(_0x50f581,null));};exports[_0x5a4a('0x62')]=function(_0x4bf18a,_0x1813a5){return db[_0x5a4a('0x32')]['find']({'where':{'id':_0x4bf18a['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x1813a5,null))['then'](function(_0x4da039){if(_0x4da039){return _0x4da039[_0x5a4a('0x62')](_0x4bf18a['query'][_0x5a4a('0x63')]);}})[_0x5a4a('0x14')](respondWithStatusCode(_0x1813a5,null))['catch'](handleError(_0x1813a5,null));};exports[_0x5a4a('0x64')]=function(_0x31ebe8,_0x27cc41){_0x31ebe8[_0x5a4a('0x4d')][_0x5a4a('0x65')]=_0x31ebe8['file']['filename'];return db[_0x5a4a('0x32')][_0x5a4a('0x4b')]({'where':{'id':_0x31ebe8[_0x5a4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x27cc41,null))[_0x5a4a('0x14')](saveUpdates(_0x31ebe8[_0x5a4a('0x4d')],null))['then'](respondWithResult(_0x27cc41,null))['catch'](handleError(_0x27cc41,null));};exports['addAvatar']=function(_0x16c405,_0x5c61a2){_0x16c405[_0x5a4a('0x4d')]['agentAvatar']=_0x16c405[_0x5a4a('0x66')]['filename'];return db[_0x5a4a('0x32')][_0x5a4a('0x4b')]({'where':{'id':_0x16c405['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x5c61a2,null))['then'](saveUpdates(_0x16c405[_0x5a4a('0x4d')],null))[_0x5a4a('0x14')](respondWithResult(_0x5c61a2,null))['catch'](handleError(_0x5c61a2,null));};exports['addCustomerAvatar']=function(_0x5ab199,_0x61d1ae){_0x5ab199[_0x5a4a('0x4d')][_0x5a4a('0x67')]=_0x5ab199['file']['filename'];return db[_0x5a4a('0x32')]['find']({'where':{'id':_0x5ab199[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x61d1ae,null))['then'](saveUpdates(_0x5ab199[_0x5a4a('0x4d')],null))[_0x5a4a('0x14')](respondWithResult(_0x61d1ae,null))[_0x5a4a('0x1d')](handleError(_0x61d1ae,null));};exports[_0x5a4a('0x68')]=function(_0x24f3bb,_0x1603bf){_0x24f3bb[_0x5a4a('0x4d')][_0x5a4a('0x69')]=_0x24f3bb[_0x5a4a('0x66')][_0x5a4a('0x6a')];return db[_0x5a4a('0x32')]['find']({'where':{'id':_0x24f3bb['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x1603bf,null))[_0x5a4a('0x14')](saveUpdates(_0x24f3bb[_0x5a4a('0x4d')],null))[_0x5a4a('0x14')](respondWithResult(_0x1603bf,null))['catch'](handleError(_0x1603bf,null));};exports[_0x5a4a('0x6b')]=function(_0x243b6e,_0x4a4b95){var _0x519d77=path[_0x5a4a('0x6c')](config['root'],_0x5a4a('0x6d'));var _0x3cc22d={'where':{'id':_0x243b6e['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4dc108=![];return require(_0x5a4a('0x6e'))[_0x5a4a('0x6f')]()[_0x5a4a('0x14')](function(_0x3d7a7f){if(_0x3d7a7f){_0x4dc108=_0x3d7a7f[_0x5a4a('0x70')];}})[_0x5a4a('0x14')](function(){return db[_0x5a4a('0x32')][_0x5a4a('0x4b')](_0x3cc22d);})[_0x5a4a('0x14')](handleEntityNotFound(_0x4a4b95,null))[_0x5a4a('0x14')](function(_0xa936f1){if(_0xa936f1){if(!_[_0x5a4a('0x71')](_0xa936f1[_0x5a4a('0x65')])){if(fs['existsSync'](path[_0x5a4a('0x6c')](config[_0x5a4a('0x72')],_0x5a4a('0x73'),_0xa936f1['sitepic']))&&_0x4dc108){_0x519d77=path['join'](config[_0x5a4a('0x72')],_0x5a4a('0x73'),_0xa936f1[_0x5a4a('0x65')]);}}return _0x4a4b95[_0x5a4a('0x74')](_0x519d77);}})[_0x5a4a('0x1d')](handleError(_0x4a4b95,null));};exports[_0x5a4a('0x75')]=function(_0x398b5b,_0x462119){var _0xb40938=path['join'](config[_0x5a4a('0x72')],'server/files/images/avatars/default_avatar.png');var _0x496218={'where':{'id':_0x398b5b['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x5a4a('0x32')]['find'](_0x496218)['then'](handleEntityNotFound(_0x462119,null))['then'](function(_0x1b4c88){if(_0x1b4c88){if(!_[_0x5a4a('0x71')](_0x1b4c88['agentAvatar'])){if(fs[_0x5a4a('0x76')](path['join'](config['root'],_0x5a4a('0x77'),_0x1b4c88[_0x5a4a('0x78')]))){_0xb40938=path['join'](config[_0x5a4a('0x72')],_0x5a4a('0x77'),_0x1b4c88[_0x5a4a('0x78')]);}}return _0x462119[_0x5a4a('0x74')](_0xb40938);}})['catch'](handleError(_0x462119,null));};exports[_0x5a4a('0x79')]=function(_0x4efb64,_0x5403eb){var _0x29fc55=path[_0x5a4a('0x6c')](config[_0x5a4a('0x72')],_0x5a4a('0x7a'));var _0x33b7af={'where':{'id':_0x4efb64['params']['id']},'attributes':['id','customerAvatar',_0x5a4a('0x7b')],'raw':!![]};return db[_0x5a4a('0x32')][_0x5a4a('0x4b')](_0x33b7af)[_0x5a4a('0x14')](handleEntityNotFound(_0x5403eb,null))[_0x5a4a('0x14')](function(_0x3e5b18){if(_0x3e5b18){if(!_[_0x5a4a('0x71')](_0x3e5b18['customerAvatar'])){if(fs[_0x5a4a('0x76')](path[_0x5a4a('0x6c')](config[_0x5a4a('0x72')],'server/files/images/avatars/',_0x3e5b18['customerAvatar']))&&_0x3e5b18['showCustomerAvatar']){_0x29fc55=path[_0x5a4a('0x6c')](config[_0x5a4a('0x72')],'server/files/images/avatars/',_0x3e5b18[_0x5a4a('0x67')]);}}return _0x5403eb[_0x5a4a('0x74')](_0x29fc55);}})[_0x5a4a('0x1d')](handleError(_0x5403eb,null));};exports['getSystemAvatar']=function(_0x390196,_0x28c643){var _0x171ea3=path['join'](config['root'],_0x5a4a('0x7c'));var _0x1a9c3a={'where':{'id':_0x390196['params']['id']},'attributes':['id',_0x5a4a('0x69')],'raw':!![]};return db[_0x5a4a('0x32')][_0x5a4a('0x4b')](_0x1a9c3a)[_0x5a4a('0x14')](handleEntityNotFound(_0x28c643,null))[_0x5a4a('0x14')](function(_0x547f03){if(_0x547f03){if(!_[_0x5a4a('0x71')](_0x547f03['systemAvatar'])){if(fs[_0x5a4a('0x76')](path[_0x5a4a('0x6c')](config[_0x5a4a('0x72')],_0x5a4a('0x77'),_0x547f03[_0x5a4a('0x69')]))){_0x171ea3=path[_0x5a4a('0x6c')](config['root'],_0x5a4a('0x77'),_0x547f03['systemAvatar']);}}return _0x28c643['download'](_0x171ea3);}})['catch'](handleError(_0x28c643,null));};exports[_0x5a4a('0x7d')]=function(_0x19fa9a,_0x4d0577){var _0x4f6e2e=require(_0x5a4a('0x7e'));var _0x280f1a=new _0x4f6e2e();var _0x10f784=_0x280f1a[_0x5a4a('0x7f')](_0x19fa9a['headers']['user-agent'])[_0x5a4a('0x80')]();var _0x39436a={'body':_0x19fa9a['body'],'channel':_0x5a4a('0x81')};var _0x5ba27c=[];var _0x2f8ed9=[];var _0x4f8c45={};var _0x2ea0cf=![];return db[_0x5a4a('0x82')][_0x5a4a('0x57')]()[_0x5a4a('0x14')](function(_0x540d49){if(!_0x540d49){throw new db[(_0x5a4a('0x83'))][(_0x5a4a('0x84'))](_0x5a4a('0x85'));}_0x5ba27c=_[_0x5a4a('0x86')](_['keys'](_0x540d49),[_0x5a4a('0x87'),_0x5a4a('0x88')]);_0x2f8ed9=_[_0x5a4a('0x86')](_['keys'](_0x540d49),[_0x5a4a('0x87'),_0x5a4a('0x88'),'CompanyId','ListId']);if(_0x19fa9a[_0x5a4a('0x4d')]['id']){delete _0x19fa9a[_0x5a4a('0x4d')]['id'];}if(_[_0x5a4a('0x71')](_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0x89')])){throw new db['Sequelize'][(_0x5a4a('0x84'))](_0x5a4a('0x8a'));}if(_[_0x5a4a('0x71')](_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0x4d')])||_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0x4d')]===''){throw new db[(_0x5a4a('0x83'))]['ValidationError'](_0x5a4a('0x8b'));}if(_[_0x5a4a('0x71')](_0x19fa9a[_0x5a4a('0x4d')]['mapKey'])){throw new db[(_0x5a4a('0x83'))][(_0x5a4a('0x84'))](_0x5a4a('0x8c')+_0x2f8ed9);}if(!_[_0x5a4a('0x8d')](_0x2f8ed9,_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0x8e')])){throw new db[(_0x5a4a('0x83'))][(_0x5a4a('0x84'))](_0x5a4a('0x8f')+_0x2f8ed9);}_0x4f8c45[_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0x8e')]]=_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0x89')];})[_0x5a4a('0x14')](function(){return db[_0x5a4a('0x32')]['find']({'where':{'id':_0x19fa9a['params']['id']},'include':[{'model':db['CmList'],'as':_0x5a4a('0x90'),'include':[{'model':db['CmContact'],'as':_0x5a4a('0x91'),'where':_0x4f8c45,'limit':0x1,'order':[[_0x5a4a('0x88'),_0x5a4a('0x92')]]}]},{'model':db[_0x5a4a('0x93')],'as':_0x5a4a('0x94')}]});})[_0x5a4a('0x14')](handleEntityNotFound(_0x4d0577,null))['then'](function(_0x327304){if(_0x327304&&_0x327304['List']){_0x39436a['account']=_0x327304;_0x39436a[_0x5a4a('0x95')]=_0x327304['Applications'];_0x39436a[_0x5a4a('0x96')]=_0x327304['List'];_0x39436a['applications']=_['orderBy'](_0x39436a[_0x5a4a('0x95')],[_0x5a4a('0x97')],['asc']);if(_0x39436a[_0x5a4a('0x98')][_0x5a4a('0x94')]){delete _0x39436a[_0x5a4a('0x98')][_0x5a4a('0x94')];}if(_0x39436a[_0x5a4a('0x98')][_0x5a4a('0x90')]&&_0x39436a[_0x5a4a('0x98')]['List'][_0x5a4a('0x91')][_0x5a4a('0x3d')]){return _0x39436a[_0x5a4a('0x98')]['List'][_0x5a4a('0x91')][0x0];}var _0x4e9130=_['defaults'](_0x19fa9a[_0x5a4a('0x4d')],{'firstName':_0x19fa9a['body'][_0x5a4a('0x89')],'ListId':_0x327304[_0x5a4a('0x99')]});_0x4e9130[_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0x8e')]]=_0x19fa9a[_0x5a4a('0x4d')]['from'];return db[_0x5a4a('0x82')]['create'](_0x4e9130,{'fields':_0x5ba27c,'raw':!![]});}})['then'](handleEntityNotFound(_0x4d0577,null))[_0x5a4a('0x14')](function(_0x404f83){_0x39436a[_0x5a4a('0x9a')]=_0x404f83;var _0x4c0e95=_0x19fa9a[_0x5a4a('0x4d')]['customerIp'];if(_0x19fa9a[_0x5a4a('0x9b')][_0x5a4a('0x9c')]){_0x4c0e95=_0x19fa9a[_0x5a4a('0x9b')][_0x5a4a('0x9c')];}else if(_0x19fa9a[_0x5a4a('0x9b')][_0x5a4a('0x9d')]){_0x4c0e95=_[_0x5a4a('0x9e')](_0x19fa9a[_0x5a4a('0x9b')][_0x5a4a('0x9d')][_0x5a4a('0x9f')](','));}if(_0x404f83){var _0x291ef8={'ContactId':_0x404f83['id'],'ChatWebsiteId':_0x19fa9a['params']['id'],'from':(_0x404f83[_0x5a4a('0xa0')]||'')+'\x20'+(_0x404f83[_0x5a4a('0xa1')]||''),'customerIp':_0x4c0e95,'customerPort':_0x19fa9a[_0x5a4a('0x9b')][_0x5a4a('0xa2')]?_0x19fa9a[_0x5a4a('0x9b')][_0x5a4a('0xa2')]:null,'referer':_0x19fa9a['body'][_0x5a4a('0xa3')],'browserName':_0x10f784['browser'][_0x5a4a('0x2c')]&&_0x10f784[_0x5a4a('0xa4')][_0x5a4a('0xa5')]?util[_0x5a4a('0xa6')](_0x5a4a('0xa7'),_0x10f784[_0x5a4a('0xa4')][_0x5a4a('0x2c')],_0x10f784[_0x5a4a('0xa4')][_0x5a4a('0xa5')]):_0x5a4a('0xa8'),'browserVersion':_0x10f784[_0x5a4a('0xa4')][_0x5a4a('0xa5')]||_0x5a4a('0xa8'),'osName':util[_0x5a4a('0xa6')](_0x5a4a('0xa7'),_0x10f784['os']['name'],_0x10f784['os'][_0x5a4a('0xa5')]),'osVersion':_0x10f784['os']['version'],'deviceModel':_0x10f784['device']['model']&&_0x10f784['device']['vendor']?util[_0x5a4a('0xa6')](_0x5a4a('0xa9'),_0x10f784[_0x5a4a('0xaa')][_0x5a4a('0x3b')],_0x10f784['device'][_0x5a4a('0xab')],_0x10f784[_0x5a4a('0xaa')][_0x5a4a('0x35')]):null,'deviceVendor':_0x10f784[_0x5a4a('0xaa')][_0x5a4a('0xab')],'deviceType':_0x10f784[_0x5a4a('0xaa')][_0x5a4a('0x35')],'formData':JSON[_0x5a4a('0xac')](_0x19fa9a[_0x5a4a('0x4d')])};var _0x4b8519={'ChatWebsiteId':_0x19fa9a['params']['id'],'closed':![]};if(_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xad')]){_0x4b8519[_0x5a4a('0xad')]=_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xad')];return db[_0x5a4a('0xae')][_0x5a4a('0x4b')]({'where':_0x4b8519})[_0x5a4a('0x14')](function(_0x5d20c6){if(_0x5d20c6){return[_0x5d20c6,![]];}_0x291ef8[_0x5a4a('0xad')]=_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xad')];_0x291ef8[_0x5a4a('0xaf')]=_0x19fa9a['body'][_0x5a4a('0xaf')];return db[_0x5a4a('0xae')][_0x5a4a('0x4c')](_0x291ef8)[_0x5a4a('0x14')](function(_0xa91e31){return[_0xa91e31,!![]];});});}_0x4b8519[_0x5a4a('0xb0')]=_0x404f83['id'];if(_0x19fa9a[_0x5a4a('0x4d')]['interaction']&&_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xb1')]['id']){_0x4b8519['id']=_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xb1')]['id'];return db[_0x5a4a('0xae')][_0x5a4a('0x4b')]({'where':_0x4b8519})[_0x5a4a('0x14')](function(_0x3d6854){if(_0x3d6854){return[_0x3d6854,![]];}return db[_0x5a4a('0xae')][_0x5a4a('0x4c')](_0x291ef8)[_0x5a4a('0x14')](function(_0x2ac715){return[_0x2ac715,!![]];});});}return db[_0x5a4a('0xae')][_0x5a4a('0x4c')](_0x291ef8)['then'](function(_0x38145d){return[_0x38145d,!![]];});}})[_0x5a4a('0xb2')](function(_0x8499c5,_0x38cb1c){if(_0x8499c5){_0x2ea0cf=_0x38cb1c;if(!_0x38cb1c){var _0x2b1ec5={'from':(_0x39436a['contact'][_0x5a4a('0xa0')]||'')+'\x20'+(_0x39436a[_0x5a4a('0x9a')][_0x5a4a('0xa1')]||'')};if(_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xad')]&&_0x19fa9a[_0x5a4a('0x4d')]['messageId']&&_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xad')]!=_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xb3')]){_0x2b1ec5[_0x5a4a('0xad')]=_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xb3')];}return _0x8499c5[_0x5a4a('0x55')](_0x2b1ec5);}else{return _0x8499c5;}}})['then'](function(_0xc0f9cd){_0x39436a['interaction']=_0xc0f9cd[_0x5a4a('0x51')]({'plain':!![]});_0x39436a[_0x5a4a('0xb1')][_0x5a4a('0xb4')]=_0x2ea0cf;if(_0x39436a[_0x5a4a('0xb1')][_0x5a4a('0xb4')]){if(_0x39436a['account'][_0x5a4a('0xb5')]){_0x39436a['applications']['push']({'id':0x0,'priority':_0x39436a[_0x5a4a('0x95')]['length']+0x1,'app':_0x5a4a('0xb6'),'appdata':_0x5a4a('0xb7'),'interval':_0x5a4a('0xb8')});}}return db[_0x5a4a('0xb9')][_0x5a4a('0x4c')]({'body':_0x19fa9a['body'][_0x5a4a('0x4d')],'ChatWebsiteId':_0x19fa9a['params']['id'],'ChatInteractionId':_0xc0f9cd['id'],'direction':'in','ContactId':_0x39436a['contact']['id'],'AttachmentId':_0x19fa9a[_0x5a4a('0x4d')][_0x5a4a('0xba')]});})[_0x5a4a('0x14')](function(_0x176eaa){_0x39436a[_0x5a4a('0x19')]=_0x176eaa;if(_0x39436a[_0x5a4a('0xb1')][_0x5a4a('0xbb')]){return db[_0x5a4a('0xbc')][_0x5a4a('0x4b')]({'attributes':['id','name'],'where':{'id':_0x39436a[_0x5a4a('0xb1')][_0x5a4a('0xbb')]}})[_0x5a4a('0x14')](function(_0x5bdb76){if(_0x5bdb76){_0x39436a['applications'][_0x5a4a('0xbd')]({'id':0x0,'priority':0x0,'app':_0x5a4a('0xbe'),'appdata':_0x5bdb76['name']+','+(_0x39436a[_0x5a4a('0x98')][_0x5a4a('0xbf')]||0xa),'interval':'*,*,*,*'});_0x39436a[_0x5a4a('0xc0')]=!![];}return respondWithRpcPromise(_0x5a4a('0xc1'),_0x5a4a('0xc2'),_0x39436a);});}return respondWithRpcPromise(_0x5a4a('0xc1'),'startRouting',_0x39436a);})[_0x5a4a('0x14')](function(_0x349104){respondWithRpcPromise(_0x5a4a('0xc3'),_0x5a4a('0xc3'),{'event':_0x5a4a('0x7d'),'message':_0x349104},client9002);return _0x349104;})['then'](respondWithResult(_0x4d0577,null))[_0x5a4a('0x1d')](handleError(_0x4d0577,null));};exports[_0x5a4a('0xc4')]=function(_0x3c7816,_0x578359){var _0x1bdc3f,_0x1db882,_0x2788d8;var _0x6f1c73=[];var _0x5a7d8f={};var _0x374ec3=_0x3c7816[_0x5a4a('0xc5')]||[];var _0x1aaf94=[];var _0x1e5d68;return db[_0x5a4a('0x82')]['describe']()[_0x5a4a('0x14')](function(_0x29e8c7){if(!_0x29e8c7){throw new db[(_0x5a4a('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x6f1c73=_['difference'](_[_0x5a4a('0x37')](_0x29e8c7),[_0x5a4a('0x87'),_0x5a4a('0x88'),_0x5a4a('0xc6'),'ListId']);if(_0x3c7816[_0x5a4a('0x4d')]['id']){delete _0x3c7816['body']['id'];}if(_[_0x5a4a('0x71')](_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x89')])){throw _0x578359[_0x5a4a('0x1e')](0x1f4)[_0x5a4a('0x2d')](new db[(_0x5a4a('0x83'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x5a4a('0x71')](_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x4d')])||_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x4d')]===''){throw _0x578359[_0x5a4a('0x1e')](0x1f4)[_0x5a4a('0x2d')](new db[(_0x5a4a('0x83'))][(_0x5a4a('0x84'))](_0x5a4a('0x8b')));}if(_[_0x5a4a('0x71')](_0x3c7816['body'][_0x5a4a('0xc7')])){throw _0x578359[_0x5a4a('0x1e')](0x1f4)[_0x5a4a('0x2d')](new db[(_0x5a4a('0x83'))][(_0x5a4a('0x84'))](_0x5a4a('0xc8')+_0x6f1c73));}if(!_[_0x5a4a('0x8d')](_0x6f1c73,_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0xc7')])){throw _0x578359[_0x5a4a('0x1e')](0x1f4)[_0x5a4a('0x2d')](new db[(_0x5a4a('0x83'))]['ValidationError'](_0x5a4a('0xc9')+_0x6f1c73));}_0x5a7d8f[_0x3c7816[_0x5a4a('0x4d')]['mapKeyOffline']]=_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x89')];})[_0x5a4a('0x14')](function(){return db[_0x5a4a('0x32')][_0x5a4a('0x4b')]({'where':{'id':_0x3c7816[_0x5a4a('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x5a4a('0x90')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x5a4a('0x14')](handleEntityNotFound(_0x578359,null))['then'](function(_0x4dcf76){if(_0x4dcf76&&_0x4dcf76['List']){_0x1db882=_0x4dcf76;var _0x3066f5=_['defaults'](_0x3c7816['body'],{'firstName':_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x89')],'phone':_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x89')],'ListId':_0x4dcf76[_0x5a4a('0x99')]});_0x3066f5[_0x3c7816['body'][_0x5a4a('0xc7')]]=_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x89')];return db['CmContact'][_0x5a4a('0xca')]({'where':_0x5a7d8f,'defaults':_0x3066f5});}})['spread'](function(_0x1bb3aa){if(_0x1bb3aa){_0x2788d8=_0x1bb3aa;var _0x2b5306=fs[_0x5a4a('0xcb')](path['join'](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x3b9dbd=ejs[_0x5a4a('0xcc')](_0x2b5306,{'body':_[_0x5a4a('0xcd')](_0x3c7816[_0x5a4a('0x4d')][_0x5a4a('0x4d')]),'bodyTitle':_0x1db882[_0x5a4a('0xce')]});return db['ChatOfflineMessage'][_0x5a4a('0x4c')]({'body':_0x3b9dbd,'plainBody':htmlToText[_0x5a4a('0xcf')](_0x3b9dbd),'ContactId':_0x1bb3aa['id'],'ChatWebsiteId':_0x1db882['id']});}})[_0x5a4a('0x14')](function(_0x43f1b4){_0x1e5d68=_0x43f1b4;if(_0x374ec3[_0x5a4a('0x3d')]){var _0x3affe6=_0x374ec3[_0x5a4a('0x31')](function(_0x58c9ba){return{'name':_0x58c9ba['originalname'],'basename':_0x58c9ba[_0x5a4a('0x6a')],'type':_0x58c9ba['mimetype'],'ChatOfflineMessageId':_0x43f1b4['id']};});_0x1aaf94=_0x3affe6[_0x5a4a('0x31')](_0x3de0c7=>{var _0x2e47ea={'filename':_0x3de0c7['name'],'path':path[_0x5a4a('0x6c')](config[_0x5a4a('0x72')],'server',_0x5a4a('0xc5'),'attachments',_0x5a4a('0xd0'),_0x3de0c7['basename'])};return _0x2e47ea;});if(!_0x1db882['openNewInteraction']){return db['sequelize']['transaction'](function(_0x46debc){return db['Attachment'][_0x5a4a('0xd1')](_0x3affe6,{'transaction':_0x46debc});});}}})['then'](function(){if(_0x1e5d68){_0x1bdc3f=_0x1e5d68;return db[_0x5a4a('0xd2')][_0x5a4a('0x60')]({'where':{'service':!![]},'include':[{'model':db[_0x5a4a('0xd3')],'as':_0x5a4a('0xd4'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5a4a('0xd5'),'raw':!![]}]}]});}})[_0x5a4a('0x14')](function(_0x1d5cd8){if(_0x1d5cd8&&_0x1d5cd8['Smtp']&&_0x1db882[_0x5a4a('0xd6')]&&_0x1db882['forwardOfflineAddress']){var _0x3b8044=_0x1d5cd8[_0x5a4a('0xd7')]();return respondWithRpcPromise(_0x5a4a('0xd8'),_0x5a4a('0xd9'),{'account':_0x3b8044,'message':{'from':util[_0x5a4a('0xa6')](_0x5a4a('0xda'),_0x1d5cd8[_0x5a4a('0x2c')],_0x1d5cd8[_0x5a4a('0xdb')]||_0x1d5cd8[_0x5a4a('0xd4')]['user']),'to':_0x1db882[_0x5a4a('0xdc')],'subject':_0x1db882[_0x5a4a('0xdd')],'html':_0x1bdc3f['body'],'attachments':_0x1aaf94}},client9003)[_0x5a4a('0x14')](function(){return _0x1bdc3f;})['catch'](function(_0x5ad60d){logger['error'](_0x5ad60d);});}})[_0x5a4a('0x14')](function(){if(_0x1db882&&_0x1db882[_0x5a4a('0xde')]&&_0x1db882['MailAccountId']){var _0x1a7203=[];if(_0x374ec3[_0x5a4a('0x3d')]){_0x1a7203=_0x374ec3[_0x5a4a('0x31')](function(_0x546400){return{'name':_0x546400[_0x5a4a('0xdf')],'basename':_0x546400[_0x5a4a('0x6a')],'type':_0x546400[_0x5a4a('0xe0')],'ChatOfflineMessageId':_0x1e5d68['id']};});}var _0xdf3e8d;if(!_['isNil'](_0x1db882['subjectOffline'])){var _0x531b01=_[_0x5a4a('0x31')](_0x3c7816[_0x5a4a('0x4d')],function(_0x58e8d9){return _0x58e8d9;});var _0x53d5cc=_[_0x5a4a('0xe1')](_0x531b01)[0x0];var _0x4e7547=_[_0x5a4a('0xe2')](_0x53d5cc,function(_0x3866f5){return _0x3866f5;});_0xdf3e8d=_0x4e7547[0x1][_0x1db882[_0x5a4a('0xe3')]];}var _0x4ebdf7={'from':_0x2788d8[_0x5a4a('0xdb')],'firstName':_0x2788d8['firstName'],'lastName':_0x2788d8[_0x5a4a('0xa1')],'mapKey':_0x5a4a('0xdb'),'message':{'from':_0x2788d8['email'],'to':_0x1db882[_0x5a4a('0xd2')][_0x5a4a('0xdb')],'cc':'','subject':_[_0x5a4a('0x71')](_0xdf3e8d)?_0x1db882[_0x5a4a('0xdd')]:_0xdf3e8d,'messageId':'','sentAt':new Date(),'attach':_0x1a7203[_0x5a4a('0x3d')],'attachments':_0x1a7203,'originChannel':_0x5a4a('0xe4'),'ChatWebsiteId':_0x1db882['id'],'ChatOfflineMessageId':_0x1bdc3f['id'],'originTo':_0x1db882['MailAccount'][_0x5a4a('0xdb')]},'body':_0x1bdc3f[_0x5a4a('0x4d')]};var _0x471eeb={'account':{'id':_0x1db882[_0x5a4a('0xe5')]},'body':_0x4ebdf7,'log':_0x5a4a('0xe6')};return respondWithRpcPromise(_0x5a4a('0xe6'),_0x5a4a('0xe7'),_0x471eeb,client9001)['then'](function(){return _0x1bdc3f;})[_0x5a4a('0x1d')](function(_0x4cf294){logger[_0x5a4a('0x18')](_0x4cf294);});}return;})['then'](function(){if(_0x1bdc3f){return _0x1bdc3f;}})[_0x5a4a('0x14')](respondWithResult(_0x578359,null))['catch'](function(_0x3fa48d){logger[_0x5a4a('0x18')](_0x5a4a('0x1d'),_0x3fa48d);for(var _0x19a79b of _0x374ec3){var _0x2f27e0=path[_0x5a4a('0x6c')](config['root'],'server',_0x5a4a('0xc5'),'attachments',_0x5a4a('0xd0'),_0x19a79b[_0x5a4a('0x6a')]);fs_extra[_0x5a4a('0xe8')](_0x2f27e0)['catch'](function(_0x335647){logger[_0x5a4a('0x18')](_0x5a4a('0xe9'),_0x2f27e0,_0x335647);});}});};exports[_0x5a4a('0xea')]=function(_0x37b356,_0x3b99ef){return db['ChatInteraction'][_0x5a4a('0x4b')]({'where':{'id':_0x37b356[_0x5a4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b99ef,null))[_0x5a4a('0x14')](function(_0x49f393){if(_0x49f393){return _0x49f393[_0x5a4a('0xea')](_0x37b356[_0x5a4a('0x4d')][_0x5a4a('0x63')],_[_0x5a4a('0xeb')](_0x37b356['body'],[_0x5a4a('0x63'),'id'])||{});}})[_0x5a4a('0x14')](respondWithResult(_0x3b99ef,null))[_0x5a4a('0x1d')](handleError(_0x3b99ef,null));};exports[_0x5a4a('0xec')]=function(_0x15664e,_0xbee235){var _0x1a2d83={'raw':![],'where':{}};var _0x44541e={};var _0x479b1e={'count':0x0,'rows':[]};return db[_0x5a4a('0x32')][_0x5a4a('0x60')]({'where':{'id':_0x15664e['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0xbee235,null))['then'](function(_0x5e6197){if(_0x5e6197){_0x44541e[_0x5a4a('0x3b')]=_['keys'](db[_0x5a4a('0xae')]['rawAttributes']);_0x44541e[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x15664e['query']);_0x44541e[_0x5a4a('0x38')]=_['intersection'](_0x44541e['model'],_0x44541e[_0x5a4a('0x36')]);_0x1a2d83['attributes']=_[_0x5a4a('0x39')](_0x44541e['model'],qs[_0x5a4a('0x3c')](_0x15664e[_0x5a4a('0x36')]['fields']));_0x1a2d83[_0x5a4a('0x3a')]=_0x1a2d83['attributes'][_0x5a4a('0x3d')]?_0x1a2d83['attributes']:_0x44541e[_0x5a4a('0x3b')];if(!_0x15664e[_0x5a4a('0x36')]['hasOwnProperty']('nolimit')){_0x1a2d83[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x15664e[_0x5a4a('0x36')][_0x5a4a('0x22')]);_0x1a2d83[_0x5a4a('0x21')]=qs[_0x5a4a('0x21')](_0x15664e[_0x5a4a('0x36')][_0x5a4a('0x21')]);}_0x1a2d83['order']=qs[_0x5a4a('0x40')](_0x15664e[_0x5a4a('0x36')]['sort']);_0x1a2d83[_0x5a4a('0x41')]=qs['filters'](_[_0x5a4a('0x42')](_0x15664e[_0x5a4a('0x36')],_0x44541e['filters']));_0x1a2d83[_0x5a4a('0x41')]['ChatWebsiteId']=_0x5e6197['id'];if(_0x15664e['query'][_0x5a4a('0x43')]){_0x1a2d83[_0x5a4a('0x41')]=_[_0x5a4a('0x45')](_0x1a2d83[_0x5a4a('0x41')],{'$or':_[_0x5a4a('0x31')](_0x1a2d83['attributes'],function(_0x3ed56c){var _0x341ef3={};_0x341ef3[_0x3ed56c]={'$like':'%'+_0x15664e['query'][_0x5a4a('0x43')]+'%'};return _0x341ef3;})});}_0x1a2d83=_[_0x5a4a('0x45')]({},_0x1a2d83,_0x15664e[_0x5a4a('0x46')]);return db['ChatInteraction']['count']({'where':_0x1a2d83[_0x5a4a('0x41')]})['then'](function(_0x50230b){_0x479b1e['count']=_0x50230b;if(_0x15664e[_0x5a4a('0x36')]['includeAll']){_0x1a2d83[_0x5a4a('0x48')]=[{'model':db['CmContact'],'as':_0x5a4a('0xed'),'required':![]},{'model':db[_0x5a4a('0xbc')],'as':_0x5a4a('0xee'),'attributes':['name',_0x5a4a('0xef'),_0x5a4a('0xf0')],'required':![]},{'model':db[_0x5a4a('0xf1')],'as':'Tags','attributes':['id',_0x5a4a('0x2c'),_0x5a4a('0xf2')],'where':_0x15664e[_0x5a4a('0x36')][_0x5a4a('0xf3')]?{'id':_0x15664e[_0x5a4a('0x36')]['tag']}:undefined,'required':_0x15664e[_0x5a4a('0x36')]['tag']?!![]:![]}];}return db[_0x5a4a('0xae')][_0x5a4a('0x61')](_0x1a2d83);})['then'](function(_0x2e6787){_0x479b1e[_0x5a4a('0x49')]=_0x2e6787;return _0x479b1e;});}})[_0x5a4a('0x14')](respondWithFilteredResult(_0xbee235,_0x1a2d83))['catch'](handleError(_0xbee235,null));};function iftimePromise(_0x5106bd,_0x142981){return respondWithRpcPromise(_0x5a4a('0xf4'),'getSnippet',{'command':_0x142981[_0x5a4a('0xf5')]?util[_0x5a4a('0xa6')](_0x5a4a('0xf6'),_0x5106bd[_0x5a4a('0xf7')],_0x142981['timezone']):util[_0x5a4a('0xa6')](_0x5a4a('0xf8'),_0x5106bd[_0x5a4a('0xf7')])},client9002)['then'](function(_0x2e6615){var _0x2c201b=_0x2e6615&&_0x2e6615[_0x5a4a('0xf9')](_0x5a4a('0xfa'))>=0x0?!![]:![];logger[_0x5a4a('0x15')](_0x5a4a('0xfb'),_0x142981['id'],_0x5106bd['id'],_0x5106bd[_0x5a4a('0xf7')],_0x2c201b?'ONLINE':_0x5a4a('0xfc'),_0x142981[_0x5a4a('0xf5')]?_0x142981[_0x5a4a('0xf5')]:_0x5a4a('0xfd'));return _0x2c201b;})[_0x5a4a('0x1d')](function(_0x583865){logger['error'](_0x5a4a('0xfb'),_0x142981['id'],_0x5106bd['id'],_0x5106bd['interval'],util['inspect'](_0x583865,{'showHidden':![],'depth':null}),_0x142981[_0x5a4a('0xf5')]?_0x142981[_0x5a4a('0xf5')]:_0x5a4a('0xfd'));return![];});}exports['getSnippet']=function(_0xdd5b52,_0x1fec2d){var _0x3a6141=0x0;var _0x2d5fe4=0x0;var _0xa361e8=![];var _0x1d95d6;var _0x2f0ae3;return db['ChatWebsite'][_0x5a4a('0x4b')]({'where':{'id':_0xdd5b52[_0x5a4a('0x56')]['id']},'include':[{'model':db[_0x5a4a('0xfe')],'as':'Interval','include':[{'model':db[_0x5a4a('0xfe')],'as':_0x5a4a('0xff'),'attributes':['id',_0x5a4a('0xf7')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1fec2d,null))['then'](function(_0x245ee8){if(_0x245ee8){_0x1d95d6=_0x245ee8;return _0x245ee8['getProactiveActions']({'raw':!![]});}})[_0x5a4a('0x14')](function(_0x43f371){if(_0x1d95d6){if(_0x43f371){_0x2f0ae3=_0x43f371;}}return require(_0x5a4a('0x6e'))[_0x5a4a('0x6f')]();})['then'](function(_0xe2908b){if(_0xe2908b){_0x2d5fe4=_0xe2908b[_0x5a4a('0x100')];_0xa361e8=_0xe2908b[_0x5a4a('0x70')];}})[_0x5a4a('0x14')](function(){return db[_0x5a4a('0xae')][_0x5a4a('0x24')]({'where':{'closed':![]}});})['then'](function(_0x4ee0de){_0x3a6141=_0x4ee0de;if(_0x2d5fe4&&_0x4ee0de>_0x2d5fe4){return db['License'][_0x5a4a('0x60')]({'where':{'id':0x1}})[_0x5a4a('0x14')](function(_0xa5a66e){if(_0xa5a66e){_0xa5a66e[_0x5a4a('0x101')](_0x5a4a('0x102'));}});}})['then'](function(){if(_0x1d95d6[_0x5a4a('0xfe')]&&_0x1d95d6[_0x5a4a('0xfe')][_0x5a4a('0xff')]){var _0x2e11e4=[];for(var _0x383b44=0x0;_0x383b44<_0x1d95d6['Interval']['Intervals'][_0x5a4a('0x3d')];_0x383b44++){var _0x166c6f=_0x1d95d6['Interval']['Intervals'][_0x383b44][_0x5a4a('0x51')]({'plain':!![]});_0x2e11e4[_0x5a4a('0x103')](iftimePromise(_0x166c6f,_0x1d95d6));}return BPromise[_0x5a4a('0x104')](_0x2e11e4)[_0x5a4a('0x14')](function(_0xa75ee9){return _['some'](_0xa75ee9);});}else{return!![];}})[_0x5a4a('0x14')](function(_0x124724){var _0x45573a=fs[_0x5a4a('0xcb')](path['join'](config[_0x5a4a('0x72')],_0x5a4a('0x105')),_0x5a4a('0x106'));var _0x1a7980={'remote':_0x1d95d6[_0x5a4a('0x107')],'query':querystring['stringify'](_[_0x5a4a('0x45')](_0x1d95d6[_0x5a4a('0x51')]({'plain':!![]}),{'customerIp':_0xdd5b52[_0x5a4a('0x9b')][_0x5a4a('0x9d')]||_0xdd5b52['headers']['x-real-ip']||_0xdd5b52[_0x5a4a('0x108')][_0x5a4a('0x109')]||_0xdd5b52['ip'],'referer':_0xdd5b52[_0x5a4a('0x9b')][_0x5a4a('0xa3')],'openedInteractions':_0x3a6141,'maxInteractions':_0x2d5fe4,'virtual':_0xa361e8['virtual'],'online':_0x124724,'custom':_0xa361e8}))['replace'](/'/g,'\x5c\x27')};_0x1fec2d[_0x5a4a('0x2d')](ejs[_0x5a4a('0xcc')](Mustache[_0x5a4a('0xcc')](_0x45573a,_0x1a7980),{'proactiveActions':_0x2f0ae3,'alignment':_0x1d95d6[_0x5a4a('0x10a')],'verticalAlignment':_0x1d95d6[_0x5a4a('0x10b')],'div_color':_0x1d95d6[_0x5a4a('0xf2')],'labelText':_0x1d95d6['labelText'],'text_color':_0x1d95d6['textColor'],'text_button_color':_0x1d95d6[_0x5a4a('0x10c')],'button_color':_0x1d95d6[_0x5a4a('0x10d')],'background_color':_0x1d95d6[_0x5a4a('0x10e')],'hideWhenOffline':_0x1d95d6['hideWhenOffline'],'interval':_0x1d95d6['IntervalId']}));})['catch'](handleError(_0x1fec2d,null));};exports[_0x5a4a('0x10f')]=function(_0x471ed1,_0x48dd58){var _0xdcbb4e=_0x471ed1[_0x5a4a('0x56')]['id'];var _0x377be2=_0x471ed1[_0x5a4a('0x4d')];var _0xdd3c5e=0xc8;var _0x36b047=null;return db[_0x5a4a('0x110')]['transaction']({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x5a4a('0x111')]},function(_0x2e23f3){return db['ChatWebsite']['findOne']({'where':{'id':_0xdcbb4e},'transaction':_0x2e23f3})[_0x5a4a('0x14')](function(_0x366102){if(_0x366102){return db[_0x5a4a('0x93')][_0x5a4a('0x29')]({'where':{'ChatWebsiteId':_0xdcbb4e},'transaction':_0x2e23f3})[_0x5a4a('0x14')](function(){var _0x1093f9=_['map'](_0x377be2,function(_0x3119c3){_0x3119c3[_0x5a4a('0x5b')]=_0xdcbb4e;return _0x3119c3;});return db[_0x5a4a('0x93')][_0x5a4a('0xd1')](_0x1093f9,{'transaction':_0x2e23f3});});}else{_0xdd3c5e=0x194;_0x36b047=[];}});})[_0x5a4a('0x14')](function(){if(_0xdd3c5e!==0x194){return db[_0x5a4a('0x93')][_0x5a4a('0x112')]({'where':{'ChatWebsiteId':_0xdcbb4e},'order':_0x5a4a('0x97')})[_0x5a4a('0x14')](function(_0x224271){_0x36b047=_0x224271;});}})[_0x5a4a('0x1d')](function(_0x175fa3){_0xdd3c5e=0x1f4;logger[_0x5a4a('0x18')](_0x175fa3[_0x5a4a('0x2b')]);if(_0x175fa3[_0x5a4a('0x2c')]){delete _0x175fa3[_0x5a4a('0x2c')];}_0x36b047=_0x175fa3;})[_0x5a4a('0x113')](function(){if(_0x36b047===null){_0x48dd58[_0x5a4a('0x2a')](_0xdd3c5e);}else{if(_0xdd3c5e===0x1f4){_0x48dd58['status'](_0xdd3c5e)[_0x5a4a('0x2d')](_0x36b047);}else{_0x48dd58[_0x5a4a('0x1e')](_0xdd3c5e)[_0x5a4a('0x20')](_0x36b047);}}});};exports[_0x5a4a('0x114')]=function(_0x4ffdba,_0x182876){var _0x52bd5c={};var _0x374086={};var _0x5234c3;var _0x29f761;return db['ChatWebsite'][_0x5a4a('0x60')]({'where':{'id':_0x4ffdba[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x182876,null))['then'](function(_0x39795d){if(_0x39795d){_0x5234c3=_0x39795d;_0x374086[_0x5a4a('0x3b')]=_[_0x5a4a('0x37')](db[_0x5a4a('0x93')][_0x5a4a('0x33')]);_0x374086[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x4ffdba[_0x5a4a('0x36')]);_0x374086[_0x5a4a('0x38')]=_[_0x5a4a('0x39')](_0x374086[_0x5a4a('0x3b')],_0x374086['query']);_0x52bd5c[_0x5a4a('0x3a')]=_[_0x5a4a('0x39')](_0x374086[_0x5a4a('0x3b')],qs['fields'](_0x4ffdba[_0x5a4a('0x36')][_0x5a4a('0x3c')]));_0x52bd5c['attributes']=_0x52bd5c[_0x5a4a('0x3a')]['length']?_0x52bd5c['attributes']:_0x374086[_0x5a4a('0x3b')];_0x52bd5c['order']=qs[_0x5a4a('0x40')](_0x4ffdba[_0x5a4a('0x36')][_0x5a4a('0x40')]);_0x52bd5c['where']=qs[_0x5a4a('0x38')](_[_0x5a4a('0x42')](_0x4ffdba['query'],_0x374086[_0x5a4a('0x38')]));if(_0x4ffdba[_0x5a4a('0x36')][_0x5a4a('0x43')]){_0x52bd5c[_0x5a4a('0x41')]=_[_0x5a4a('0x45')](_0x52bd5c[_0x5a4a('0x41')],{'$or':_['map'](_0x52bd5c[_0x5a4a('0x3a')],function(_0x2c90a4){var _0xbb3876={};_0xbb3876[_0x2c90a4]={'$like':'%'+_0x4ffdba['query']['filter']+'%'};return _0xbb3876;})});}_0x52bd5c=_['merge']({},_0x52bd5c,_0x4ffdba['options']);return _0x5234c3[_0x5a4a('0x114')](_0x52bd5c);}})['then'](function(_0x2b2820){if(_0x2b2820){_0x29f761=_0x2b2820['length'];if(!_0x4ffdba[_0x5a4a('0x36')][_0x5a4a('0x5a')](_0x5a4a('0x3e'))){_0x52bd5c[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x4ffdba[_0x5a4a('0x36')][_0x5a4a('0x22')]);_0x52bd5c[_0x5a4a('0x21')]=qs[_0x5a4a('0x21')](_0x4ffdba[_0x5a4a('0x36')][_0x5a4a('0x21')]);}return _0x5234c3[_0x5a4a('0x114')](_0x52bd5c);}})[_0x5a4a('0x14')](function(_0xd741a5){if(_0xd741a5){return _0xd741a5?{'count':_0x29f761,'rows':_0xd741a5}:null;}})['then'](respondWithResult(_0x182876,null))[_0x5a4a('0x1d')](handleError(_0x182876,null));};exports[_0x5a4a('0x115')]=function(_0xc687f3,_0x4a630d){return db[_0x5a4a('0x116')][_0x5a4a('0x4b')]({'where':{'id':_0xc687f3['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x4a630d,null))['then'](function(_0x1a2295){if(_0x1a2295){return _0x1a2295[_0x5a4a('0x115')](_0xc687f3['body'][_0x5a4a('0x63')],_[_0x5a4a('0xeb')](_0xc687f3['body'],[_0x5a4a('0x63'),'id'])||{});}})[_0x5a4a('0x14')](respondWithResult(_0x4a630d,null))[_0x5a4a('0x1d')](handleError(_0x4a630d,null));};exports[_0x5a4a('0x117')]=function(_0x30b6ed,_0x4063ec){var _0x14e365={};var _0x59385e={};var _0xaf6613;var _0x4d232f;return db[_0x5a4a('0x32')][_0x5a4a('0x60')]({'where':{'id':_0x30b6ed[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x4063ec,null))[_0x5a4a('0x14')](function(_0x725393){if(_0x725393){_0xaf6613=_0x725393;_0x59385e[_0x5a4a('0x3b')]=_[_0x5a4a('0x37')](db['ChatProactiveAction']['rawAttributes']);_0x59385e[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x30b6ed[_0x5a4a('0x36')]);_0x59385e[_0x5a4a('0x38')]=_[_0x5a4a('0x39')](_0x59385e[_0x5a4a('0x3b')],_0x59385e['query']);_0x14e365[_0x5a4a('0x3a')]=_[_0x5a4a('0x39')](_0x59385e[_0x5a4a('0x3b')],qs[_0x5a4a('0x3c')](_0x30b6ed[_0x5a4a('0x36')][_0x5a4a('0x3c')]));_0x14e365[_0x5a4a('0x3a')]=_0x14e365[_0x5a4a('0x3a')][_0x5a4a('0x3d')]?_0x14e365[_0x5a4a('0x3a')]:_0x59385e[_0x5a4a('0x3b')];_0x14e365[_0x5a4a('0x3f')]=qs[_0x5a4a('0x40')](_0x30b6ed['query'][_0x5a4a('0x40')]);_0x14e365[_0x5a4a('0x41')]=qs[_0x5a4a('0x38')](_['pick'](_0x30b6ed['query'],_0x59385e['filters']));if(_0x30b6ed[_0x5a4a('0x36')][_0x5a4a('0x43')]){_0x14e365[_0x5a4a('0x41')]=_[_0x5a4a('0x45')](_0x14e365[_0x5a4a('0x41')],{'$or':_[_0x5a4a('0x31')](_0x14e365[_0x5a4a('0x3a')],function(_0x2aa9c6){var _0x16a84a={};_0x16a84a[_0x2aa9c6]={'$like':'%'+_0x30b6ed[_0x5a4a('0x36')][_0x5a4a('0x43')]+'%'};return _0x16a84a;})});}_0x14e365=_[_0x5a4a('0x45')]({},_0x14e365,_0x30b6ed[_0x5a4a('0x46')]);return _0xaf6613[_0x5a4a('0x117')](_0x14e365);}})[_0x5a4a('0x14')](function(_0x22154c){if(_0x22154c){_0x4d232f=_0x22154c[_0x5a4a('0x3d')];if(!_0x30b6ed[_0x5a4a('0x36')][_0x5a4a('0x5a')](_0x5a4a('0x3e'))){_0x14e365[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x30b6ed[_0x5a4a('0x36')][_0x5a4a('0x22')]);_0x14e365[_0x5a4a('0x21')]=qs[_0x5a4a('0x21')](_0x30b6ed[_0x5a4a('0x36')][_0x5a4a('0x21')]);}return _0xaf6613[_0x5a4a('0x117')](_0x14e365);}})[_0x5a4a('0x14')](function(_0x339117){if(_0x339117){return _0x339117?{'count':_0x4d232f,'rows':_0x339117}:null;}})[_0x5a4a('0x14')](respondWithResult(_0x4063ec,null))[_0x5a4a('0x1d')](handleError(_0x4063ec,null));};exports[_0x5a4a('0x118')]=function(_0x43cb15,_0x1cdc6e){var _0x16cbb0=_0x43cb15[_0x5a4a('0x36')][_0x5a4a('0x119')]===_0x5a4a('0x11a')?_0x5a4a('0x11b'):'onlineForm';return db[_0x5a4a('0x32')]['find']({'attributes':['id',_0x16cbb0],'where':{'id':_0x43cb15[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x1cdc6e,null))[_0x5a4a('0x14')](function(_0x45fcdc){if(_0x45fcdc){var _0x2fbd68=_0x45fcdc[_0x16cbb0];var _0x2ffb02=_0x2fbd68&&_0x2fbd68['items']?_0x2fbd68[_0x5a4a('0x11c')]:[];_0x1cdc6e[_0x5a4a('0x2d')]({'fromKey':_[_0x5a4a('0x71')](_0x2fbd68[_0x5a4a('0x11d')])?undefined:_0x2fbd68['fromKey'],'count':_0x2ffb02[_0x5a4a('0x3d')],'rows':_0x2ffb02});}})[_0x5a4a('0x1d')](handleError(_0x1cdc6e,null));};exports[_0x5a4a('0x11e')]=function(_0x297c25,_0x267d0b){var _0x278650={'raw':![],'where':{}};var _0x4c7a5c={};var _0x20edee={'count':0x0,'rows':[]};return db[_0x5a4a('0x32')]['findOne']({'where':{'id':_0x297c25[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x267d0b,null))[_0x5a4a('0x14')](function(_0x16e9a2){if(_0x16e9a2){_0x4c7a5c['model']=_[_0x5a4a('0x37')](db[_0x5a4a('0x11f')][_0x5a4a('0x33')]);_0x4c7a5c[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x297c25[_0x5a4a('0x36')]);_0x4c7a5c['filters']=_[_0x5a4a('0x39')](_0x4c7a5c[_0x5a4a('0x3b')],_0x4c7a5c['query']);_0x278650['attributes']=_[_0x5a4a('0x39')](_0x4c7a5c[_0x5a4a('0x3b')],qs[_0x5a4a('0x3c')](_0x297c25[_0x5a4a('0x36')][_0x5a4a('0x3c')]));_0x278650['attributes']=_0x278650[_0x5a4a('0x3a')]['length']?_0x278650[_0x5a4a('0x3a')]:_0x4c7a5c[_0x5a4a('0x3b')];if(!_0x297c25['query'][_0x5a4a('0x5a')]('nolimit')){_0x278650[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x297c25[_0x5a4a('0x36')][_0x5a4a('0x22')]);_0x278650['offset']=qs[_0x5a4a('0x21')](_0x297c25[_0x5a4a('0x36')][_0x5a4a('0x21')]);}_0x278650[_0x5a4a('0x3f')]=qs['sort'](_0x297c25[_0x5a4a('0x36')][_0x5a4a('0x40')]);_0x278650['where']=qs['filters'](_[_0x5a4a('0x42')](_0x297c25[_0x5a4a('0x36')],_0x4c7a5c[_0x5a4a('0x38')]));_0x278650[_0x5a4a('0x41')][_0x5a4a('0x5b')]=_0x16e9a2['id'];if(_0x297c25[_0x5a4a('0x36')][_0x5a4a('0x43')]){_0x278650[_0x5a4a('0x41')]=_[_0x5a4a('0x45')](_0x278650['where'],{'$or':_[_0x5a4a('0x31')](_0x278650[_0x5a4a('0x3a')],function(_0x12d4c4){var _0x32b620={};_0x32b620[_0x12d4c4]={'$like':'%'+_0x297c25['query'][_0x5a4a('0x43')]+'%'};return _0x32b620;})});}_0x278650=_[_0x5a4a('0x45')]({},_0x278650,_0x297c25[_0x5a4a('0x46')]);return db[_0x5a4a('0x11f')][_0x5a4a('0x24')]({'where':_0x278650[_0x5a4a('0x41')]})[_0x5a4a('0x14')](function(_0x1a7f33){_0x20edee[_0x5a4a('0x24')]=_0x1a7f33;if(_0x297c25[_0x5a4a('0x36')]['includeAll']){_0x278650['include']=[{'all':!![]}];}else{_0x278650[_0x5a4a('0x48')]=[{'model':db[_0x5a4a('0x82')],'as':'Contact','required':![]},{'model':db[_0x5a4a('0x120')],'as':_0x5a4a('0x121'),'required':![]}];}return db[_0x5a4a('0x11f')][_0x5a4a('0x61')](_0x278650);})[_0x5a4a('0x14')](function(_0x1f4ce5){_0x20edee['rows']=_0x1f4ce5;return _0x20edee;});}})[_0x5a4a('0x14')](respondWithFilteredResult(_0x267d0b,_0x278650))[_0x5a4a('0x1d')](handleError(_0x267d0b,null));};exports[_0x5a4a('0x122')]=function(_0x2b9b2a,_0x56af22){return db[_0x5a4a('0x32')]['find']({'where':{'id':_0x2b9b2a[_0x5a4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x56af22,null))[_0x5a4a('0x14')](function(_0x399951){if(_0x399951){return _0x399951['addAgents'](_0x2b9b2a['body'][_0x5a4a('0x63')],_[_0x5a4a('0xeb')](_0x2b9b2a[_0x5a4a('0x4d')],[_0x5a4a('0x63'),'id'])||{})[_0x5a4a('0xb2')](function(_0x5bd766){for(var _0xa5d180=0x0;_0xa5d180<_0x2b9b2a[_0x5a4a('0x4d')][_0x5a4a('0x63')][_0x5a4a('0x3d')];_0xa5d180+=0x1){socket[_0x5a4a('0x123')](_0x5a4a('0x124'),{'UserId':Number(_0x2b9b2a[_0x5a4a('0x4d')]['ids'][_0xa5d180]),'ChatWebsiteId':Number(_0x2b9b2a[_0x5a4a('0x56')]['id'])});}return _0x5bd766;});}})[_0x5a4a('0x14')](respondWithResult(_0x56af22,null))['catch'](handleError(_0x56af22,null));};exports['removeAgents']=function(_0x4b72c4,_0x164c97){return db[_0x5a4a('0x32')][_0x5a4a('0x4b')]({'where':{'id':_0x4b72c4['params']['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x164c97,null))['then'](function(_0x519485){if(_0x519485){return _0x519485[_0x5a4a('0x125')](_0x4b72c4['query'][_0x5a4a('0x63')])[_0x5a4a('0x14')](function(){if(_[_0x5a4a('0x126')](_0x4b72c4[_0x5a4a('0x36')][_0x5a4a('0x63')])){for(var _0x54e39b=0x0;_0x54e39b<_0x4b72c4[_0x5a4a('0x36')][_0x5a4a('0x63')][_0x5a4a('0x3d')];_0x54e39b+=0x1){socket[_0x5a4a('0x123')](_0x5a4a('0x127'),{'UserId':Number(_0x4b72c4['query']['ids'][_0x54e39b]),'ChatWebsiteId':Number(_0x4b72c4[_0x5a4a('0x56')]['id'])});}}else{socket[_0x5a4a('0x123')](_0x5a4a('0x127'),{'UserId':Number(_0x4b72c4['query'][_0x5a4a('0x63')]),'ChatWebsiteId':Number(_0x4b72c4[_0x5a4a('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x164c97,null))[_0x5a4a('0x1d')](handleError(_0x164c97,null));};exports[_0x5a4a('0x128')]=function(_0x421872,_0x202604){var _0x585775={};var _0x3e9e9f={};var _0x5aa077;var _0x18c9a5;return db[_0x5a4a('0x32')][_0x5a4a('0x60')]({'where':{'id':_0x421872[_0x5a4a('0x56')]['id']}})[_0x5a4a('0x14')](handleEntityNotFound(_0x202604,null))[_0x5a4a('0x14')](function(_0x55f705){if(_0x55f705){_0x5aa077=_0x55f705;_0x3e9e9f['model']=_[_0x5a4a('0x37')](db[_0x5a4a('0xbc')][_0x5a4a('0x33')]);_0x3e9e9f[_0x5a4a('0x36')]=_[_0x5a4a('0x37')](_0x421872[_0x5a4a('0x36')]);_0x3e9e9f['filters']=_['intersection'](_0x3e9e9f[_0x5a4a('0x3b')],_0x3e9e9f[_0x5a4a('0x36')]);_0x585775[_0x5a4a('0x3a')]=_[_0x5a4a('0x39')](_0x3e9e9f[_0x5a4a('0x3b')],qs[_0x5a4a('0x3c')](_0x421872['query'][_0x5a4a('0x3c')]));_0x585775['attributes']=_0x585775[_0x5a4a('0x3a')]['length']?_0x585775[_0x5a4a('0x3a')]:_0x3e9e9f[_0x5a4a('0x3b')];_0x585775['order']=qs[_0x5a4a('0x40')](_0x421872[_0x5a4a('0x36')][_0x5a4a('0x40')]);_0x585775[_0x5a4a('0x41')]=qs[_0x5a4a('0x38')](_['pick'](_0x421872[_0x5a4a('0x36')],_0x3e9e9f[_0x5a4a('0x38')]));if(_0x421872[_0x5a4a('0x36')][_0x5a4a('0x43')]){_0x585775[_0x5a4a('0x41')]=_[_0x5a4a('0x45')](_0x585775[_0x5a4a('0x41')],{'$or':_[_0x5a4a('0x31')](_0x585775[_0x5a4a('0x3a')],function(_0x46e7ae){var _0x383c5e={};_0x383c5e[_0x46e7ae]={'$like':'%'+_0x421872[_0x5a4a('0x36')]['filter']+'%'};return _0x383c5e;})});}_0x585775=_[_0x5a4a('0x45')]({},_0x585775,_0x421872[_0x5a4a('0x46')]);return _0x5aa077[_0x5a4a('0x128')](_0x585775);}})[_0x5a4a('0x14')](function(_0x3bef1c){if(_0x3bef1c){_0x18c9a5=_0x3bef1c[_0x5a4a('0x3d')];if(!_0x421872[_0x5a4a('0x36')]['hasOwnProperty']('nolimit')){_0x585775[_0x5a4a('0x22')]=qs[_0x5a4a('0x22')](_0x421872[_0x5a4a('0x36')]['limit']);_0x585775[_0x5a4a('0x21')]=qs[_0x5a4a('0x21')](_0x421872[_0x5a4a('0x36')][_0x5a4a('0x21')]);}return _0x5aa077[_0x5a4a('0x128')](_0x585775);}})['then'](function(_0xc0b54a){if(_0xc0b54a){return _0xc0b54a?{'count':_0x18c9a5,'rows':_0xc0b54a}:null;}})['then'](respondWithResult(_0x202604,null))[_0x5a4a('0x1d')](handleError(_0x202604,null));}; \ No newline at end of file +var _0x8e34=['autoAssociation','update','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','../../config/license/util','custom','isNil','existsSync','join','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','showCustomerAvatar','getSystemAvatar','user-agent-parser','setUA','headers','chat','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','ChatApplication','account','applications','list','orderBy','priority','asc','Applications','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','offline','files','no\x20available\x20attributes','from\x20is\x20mandatory','send','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','from','MailAccount','findOrCreate','render','ChatOfflineMessage','originalname','server','attachments','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','some','readFileSync','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','color','labelText','textColor','textButtonColor','backgroundColor','addApplications','Transaction','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-to-text','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','json','offset','undefined','count','Content-Range','then','destroy','get','ChatWebsites','UserProfileResource','end','name','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','map','VIRTUAL','where','includeAll','include','findAll','catch','show','Pause','options','find','create','body','user','role','UserProfileSection','userProfileId'];(function(_0x2a3163,_0x488192){var _0x263b1b=function(_0x47078e){while(--_0x47078e){_0x2a3163['push'](_0x2a3163['shift']());}};_0x263b1b(++_0x488192);}(_0x8e34,0xcb));var _0x48e3=function(_0x48d993,_0x4968b1){_0x48d993=_0x48d993-0x0;var _0x67aa86=_0x8e34[_0x48d993];return _0x67aa86;};'use strict';var BPromise=require(_0x48e3('0x0'));var Mustache=require(_0x48e3('0x1'));var util=require(_0x48e3('0x2'));var path=require('path');var ejs=require(_0x48e3('0x3'));var fs=require('fs');var fs_extra=require(_0x48e3('0x4'));var _=require(_0x48e3('0x5'));var querystring=require(_0x48e3('0x6'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x48e3('0x7'))('api');var config=require('../../config/environment');var db=require(_0x48e3('0x8'))['db'];config[_0x48e3('0x9')]=_[_0x48e3('0xa')](config[_0x48e3('0x9')],{'host':_0x48e3('0xb'),'port':0x18eb});var socket=require(_0x48e3('0xc'))(new Redis(config[_0x48e3('0x9')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0x48e3('0xd'));var jayson=require('jayson/promise');var client=jayson[_0x48e3('0xe')][_0x48e3('0xf')]({'port':0x232c});var client9002=jayson[_0x48e3('0xe')][_0x48e3('0xf')]({'port':0x232a});var client9003=jayson[_0x48e3('0xe')]['http']({'port':0x232b});var client9001=jayson[_0x48e3('0xe')][_0x48e3('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x1a61e2,_0x4257a9,_0x28a250,_0x465cad){return new BPromise(function(_0x3e7aa5,_0x3a7836){var _0x10b8cb=_0x465cad||client;return _0x10b8cb[_0x48e3('0x10')](_0x1a61e2,_0x28a250)['then'](function(_0x58412f){logger[_0x48e3('0x11')](_0x48e3('0x12'),_0x4257a9,_0x48e3('0x13'));logger[_0x48e3('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4257a9,'request\x20sent',JSON['stringify'](_0x58412f));if(_0x58412f['error']){if(_0x58412f[_0x48e3('0x15')]['code']===0x1f4){logger['error'](_0x48e3('0x12'),_0x4257a9,_0x58412f[_0x48e3('0x15')][_0x48e3('0x16')]);return _0x3a7836(_0x58412f[_0x48e3('0x15')][_0x48e3('0x16')]);}logger[_0x48e3('0x15')](_0x48e3('0x12'),_0x4257a9,_0x58412f[_0x48e3('0x15')][_0x48e3('0x16')]);return _0x3e7aa5(_0x58412f[_0x48e3('0x15')]['message']);}else{logger[_0x48e3('0x11')](_0x48e3('0x12'),_0x4257a9,_0x48e3('0x13'));_0x3e7aa5(_0x58412f[_0x48e3('0x17')]['message']);}})['catch'](function(_0x40357d){logger[_0x48e3('0x15')](_0x48e3('0x12'),_0x4257a9,_0x40357d);_0x3a7836(_0x40357d);});});}function respondWithStatusCode(_0x4c2997,_0x17ad00){_0x17ad00=_0x17ad00||0xcc;return function(_0x5aaded){if(_0x5aaded){return _0x4c2997[_0x48e3('0x18')](_0x17ad00);}return _0x4c2997[_0x48e3('0x19')](_0x17ad00)['end']();};}function respondWithResult(_0x4ce7bf,_0x79a9f2){_0x79a9f2=_0x79a9f2||0xc8;return function(_0x39e765){if(_0x39e765){return _0x4ce7bf[_0x48e3('0x19')](_0x79a9f2)[_0x48e3('0x1a')](_0x39e765);}};}function respondWithFilteredResult(_0x643eb9,_0x55212f){return function(_0x2e6771){if(_0x2e6771){var _0x193282=typeof _0x55212f[_0x48e3('0x1b')]==='undefined'&&typeof _0x55212f['limit']===_0x48e3('0x1c');var _0x1a789f=_0x2e6771[_0x48e3('0x1d')];var _0x502720=_0x193282?0x0:_0x55212f[_0x48e3('0x1b')];var _0xcb5713=_0x193282?_0x2e6771[_0x48e3('0x1d')]:_0x55212f[_0x48e3('0x1b')]+_0x55212f['limit'];var _0x11fc8e;if(_0xcb5713>=_0x1a789f){_0xcb5713=_0x1a789f;_0x11fc8e=0xc8;}else{_0x11fc8e=0xce;}_0x643eb9['status'](_0x11fc8e);return _0x643eb9['set'](_0x48e3('0x1e'),_0x502720+'-'+_0xcb5713+'/'+_0x1a789f)[_0x48e3('0x1a')](_0x2e6771);}return null;};}function saveUpdates(_0xbebeb4){return function(_0x1b763e){if(_0x1b763e){return _0x1b763e['update'](_0xbebeb4)[_0x48e3('0x1f')](function(_0x417124){return _0x417124;});}return null;};}function removeEntity(_0x22522b){return function(_0x1f903b){if(_0x1f903b){return _0x1f903b[_0x48e3('0x20')]()[_0x48e3('0x1f')](function(){var _0x4be9b8=_0x1f903b[_0x48e3('0x21')]({'plain':!![]});var _0x2b1875=_0x48e3('0x22');return db[_0x48e3('0x23')][_0x48e3('0x20')]({'where':{'type':_0x2b1875,'resourceId':_0x4be9b8['id']}})[_0x48e3('0x1f')](function(){return _0x1f903b;});})[_0x48e3('0x1f')](function(){_0x22522b['status'](0xcc)[_0x48e3('0x24')]();});}};}function handleEntityNotFound(_0x5cd706){return function(_0x48588a){if(!_0x48588a){_0x5cd706[_0x48e3('0x18')](0x194);}return _0x48588a;};}function handleError(_0x5511e3,_0x1ddda6){_0x1ddda6=_0x1ddda6||0x1f4;return function(_0x282f5d){logger[_0x48e3('0x15')](_0x282f5d['stack']);if(_0x282f5d[_0x48e3('0x25')]){delete _0x282f5d['name'];}_0x5511e3[_0x48e3('0x19')](_0x1ddda6)['send'](_0x282f5d);};}exports['index']=function(_0x30802a,_0x3eca8e){var _0x18ae61={'include':[{'model':db['Pause'],'as':_0x48e3('0x26')}]},_0x2e450a={},_0x526a2f={'count':0x0,'rows':[]};var _0x1678d9=_['map'](db[_0x48e3('0x27')][_0x48e3('0x28')],function(_0x38f98f){return{'name':_0x38f98f[_0x48e3('0x29')],'type':_0x38f98f[_0x48e3('0x2a')][_0x48e3('0x2b')]};});_0x2e450a[_0x48e3('0x2c')]=_['map'](_0x1678d9,_0x48e3('0x25'));_0x2e450a[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0x30802a[_0x48e3('0x2d')]);_0x2e450a[_0x48e3('0x2f')]=_[_0x48e3('0x30')](_0x2e450a[_0x48e3('0x2c')],_0x2e450a[_0x48e3('0x2d')]);_0x18ae61['attributes']=_['intersection'](_0x2e450a[_0x48e3('0x2c')],qs[_0x48e3('0x31')](_0x30802a[_0x48e3('0x2d')][_0x48e3('0x31')]));_0x18ae61[_0x48e3('0x32')]=_0x18ae61[_0x48e3('0x32')][_0x48e3('0x33')]?_0x18ae61[_0x48e3('0x32')]:_0x2e450a[_0x48e3('0x2c')];if(!_0x30802a[_0x48e3('0x2d')][_0x48e3('0x34')](_0x48e3('0x35'))){_0x18ae61[_0x48e3('0x36')]=qs['limit'](_0x30802a['query'][_0x48e3('0x36')]);_0x18ae61[_0x48e3('0x1b')]=qs['offset'](_0x30802a[_0x48e3('0x2d')][_0x48e3('0x1b')]);}_0x18ae61[_0x48e3('0x37')]=qs['sort'](_0x30802a[_0x48e3('0x2d')][_0x48e3('0x38')]);_0x18ae61['where']=qs[_0x48e3('0x2f')](_[_0x48e3('0x39')](_0x30802a['query'],_0x2e450a[_0x48e3('0x2f')]),_0x1678d9);if(_0x30802a[_0x48e3('0x2d')][_0x48e3('0x3a')]){_0x18ae61['where']=_[_0x48e3('0x3b')](_0x18ae61['where'],{'$or':_[_0x48e3('0x3c')](_0x1678d9,function(_0x188df7){if(_0x188df7[_0x48e3('0x2a')]!==_0x48e3('0x3d')){var _0x18f3b2={};_0x18f3b2[_0x188df7['name']]={'$like':'%'+_0x30802a[_0x48e3('0x2d')][_0x48e3('0x3a')]+'%'};return _0x18f3b2;}})});}_0x18ae61=_[_0x48e3('0x3b')]({},_0x18ae61,_0x30802a['options']);var _0x3c0673={'where':_0x18ae61[_0x48e3('0x3e')]};return db[_0x48e3('0x27')][_0x48e3('0x1d')](_0x3c0673)[_0x48e3('0x1f')](function(_0x2e0a9f){_0x526a2f[_0x48e3('0x1d')]=_0x2e0a9f;if(_0x30802a[_0x48e3('0x2d')][_0x48e3('0x3f')]){_0x18ae61[_0x48e3('0x40')]=[{'all':!![]}];}return db[_0x48e3('0x27')][_0x48e3('0x41')](_0x18ae61);})[_0x48e3('0x1f')](function(_0x1132c9){_0x526a2f['rows']=_0x1132c9;return _0x526a2f;})[_0x48e3('0x1f')](respondWithFilteredResult(_0x3eca8e,_0x18ae61))[_0x48e3('0x42')](handleError(_0x3eca8e,null));};exports[_0x48e3('0x43')]=function(_0x1fa6dd,_0x10dd0e){var _0x2ef256={'raw':![],'where':{'id':_0x1fa6dd['params']['id']},'include':[{'model':db[_0x48e3('0x44')],'as':_0x48e3('0x26')}]},_0x46dd10={};_0x46dd10[_0x48e3('0x2c')]=_[_0x48e3('0x2e')](db[_0x48e3('0x27')][_0x48e3('0x28')]);_0x46dd10[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0x1fa6dd['query']);_0x46dd10[_0x48e3('0x2f')]=_[_0x48e3('0x30')](_0x46dd10[_0x48e3('0x2c')],_0x46dd10[_0x48e3('0x2d')]);_0x2ef256['attributes']=_['intersection'](_0x46dd10['model'],qs[_0x48e3('0x31')](_0x1fa6dd['query'][_0x48e3('0x31')]));_0x2ef256[_0x48e3('0x32')]=_0x2ef256['attributes'][_0x48e3('0x33')]?_0x2ef256[_0x48e3('0x32')]:_0x46dd10[_0x48e3('0x2c')];if(_0x1fa6dd[_0x48e3('0x2d')][_0x48e3('0x3f')]){_0x2ef256[_0x48e3('0x40')]=[{'all':!![]}];}_0x2ef256=_[_0x48e3('0x3b')]({},_0x2ef256,_0x1fa6dd[_0x48e3('0x45')]);return db[_0x48e3('0x27')][_0x48e3('0x46')](_0x2ef256)[_0x48e3('0x1f')](handleEntityNotFound(_0x10dd0e,null))[_0x48e3('0x1f')](respondWithResult(_0x10dd0e,null))['catch'](handleError(_0x10dd0e,null));};exports['create']=function(_0x549bf3,_0x3851e7){return db['ChatWebsite'][_0x48e3('0x47')](_0x549bf3[_0x48e3('0x48')],{})[_0x48e3('0x1f')](function(_0x3cc52d){var _0x329595=_0x549bf3[_0x48e3('0x49')][_0x48e3('0x21')]({'plain':!![]});if(!_0x329595)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x329595[_0x48e3('0x4a')]===_0x48e3('0x49')){var _0x422a0e=_0x3cc52d[_0x48e3('0x21')]({'plain':!![]});var _0x4bf973='ChatWebsites';return db[_0x48e3('0x4b')][_0x48e3('0x46')]({'where':{'name':_0x4bf973,'userProfileId':_0x329595[_0x48e3('0x4c')]},'raw':!![]})[_0x48e3('0x1f')](function(_0xa42367){if(_0xa42367&&_0xa42367[_0x48e3('0x4d')]===0x0){return db[_0x48e3('0x23')][_0x48e3('0x47')]({'name':_0x422a0e['name'],'resourceId':_0x422a0e['id'],'type':_0xa42367['name'],'sectionId':_0xa42367['id']},{})[_0x48e3('0x1f')](function(){return _0x3cc52d;});}else{return _0x3cc52d;}})['catch'](function(_0xb838b1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb838b1);throw _0xb838b1;});}return _0x3cc52d;})[_0x48e3('0x1f')](respondWithResult(_0x3851e7,0xc9))['catch'](handleError(_0x3851e7,null));};exports[_0x48e3('0x4e')]=function(_0x161b95,_0x5ca440){if(_0x161b95[_0x48e3('0x48')]['id']){delete _0x161b95[_0x48e3('0x48')]['id'];}return db[_0x48e3('0x27')]['find']({'where':{'id':_0x161b95[_0x48e3('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0x48e3('0x26')}]})[_0x48e3('0x1f')](handleEntityNotFound(_0x5ca440,null))['then'](saveUpdates(_0x161b95['body'],null))[_0x48e3('0x1f')](respondWithResult(_0x5ca440,null))[_0x48e3('0x42')](handleError(_0x5ca440,null));};exports[_0x48e3('0x20')]=function(_0x9441e6,_0x49086f){return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x9441e6[_0x48e3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49086f,null))[_0x48e3('0x1f')](removeEntity(_0x49086f,null))[_0x48e3('0x42')](handleError(_0x49086f,null));};exports['describe']=function(_0x58408b,_0x3a9f4a){return db['ChatWebsite'][_0x48e3('0x50')]()[_0x48e3('0x1f')](respondWithResult(_0x3a9f4a,null))[_0x48e3('0x42')](handleError(_0x3a9f4a,null));};exports['addDisposition']=function(_0x22a023,_0x2612df){if(_0x22a023[_0x48e3('0x48')]['id']){delete _0x22a023[_0x48e3('0x48')]['id'];}return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x22a023['params']['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x2612df,null))[_0x48e3('0x1f')](function(_0x4ab2ff){if(_0x4ab2ff){_0x22a023[_0x48e3('0x48')][_0x48e3('0x51')]=_0x4ab2ff['id'];return db[_0x48e3('0x52')][_0x48e3('0x47')](_0x22a023[_0x48e3('0x48')]);}})[_0x48e3('0x1f')](respondWithResult(_0x2612df,null))[_0x48e3('0x42')](handleError(_0x2612df,null));};exports[_0x48e3('0x53')]=function(_0x16b06d,_0x360d85){var _0x1dd31={'raw':![],'where':{}};var _0x2d520b={};var _0x1cd553={'count':0x0,'rows':[]};return db[_0x48e3('0x27')][_0x48e3('0x54')]({'where':{'id':_0x16b06d[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x360d85,null))[_0x48e3('0x1f')](function(_0x36f191){if(_0x36f191){_0x2d520b[_0x48e3('0x2c')]=_[_0x48e3('0x2e')](db[_0x48e3('0x52')][_0x48e3('0x28')]);_0x2d520b[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0x16b06d[_0x48e3('0x2d')]);_0x2d520b['filters']=_[_0x48e3('0x30')](_0x2d520b[_0x48e3('0x2c')],_0x2d520b[_0x48e3('0x2d')]);_0x1dd31[_0x48e3('0x32')]=_[_0x48e3('0x30')](_0x2d520b[_0x48e3('0x2c')],qs[_0x48e3('0x31')](_0x16b06d[_0x48e3('0x2d')]['fields']));_0x1dd31[_0x48e3('0x32')]=_0x1dd31[_0x48e3('0x32')][_0x48e3('0x33')]?_0x1dd31[_0x48e3('0x32')]:_0x2d520b[_0x48e3('0x2c')];if(!_0x16b06d[_0x48e3('0x2d')][_0x48e3('0x34')]('nolimit')){_0x1dd31['limit']=qs[_0x48e3('0x36')](_0x16b06d[_0x48e3('0x2d')][_0x48e3('0x36')]);_0x1dd31[_0x48e3('0x1b')]=qs[_0x48e3('0x1b')](_0x16b06d[_0x48e3('0x2d')][_0x48e3('0x1b')]);}_0x1dd31['order']=qs[_0x48e3('0x38')](_0x16b06d['query'][_0x48e3('0x38')]);_0x1dd31['where']=qs[_0x48e3('0x2f')](_[_0x48e3('0x39')](_0x16b06d[_0x48e3('0x2d')],_0x2d520b[_0x48e3('0x2f')]));_0x1dd31[_0x48e3('0x3e')][_0x48e3('0x51')]=_0x36f191['id'];if(_0x16b06d[_0x48e3('0x2d')][_0x48e3('0x3a')]){_0x1dd31['where']=_[_0x48e3('0x3b')](_0x1dd31[_0x48e3('0x3e')],{'$or':_[_0x48e3('0x3c')](_0x1dd31[_0x48e3('0x32')],function(_0x24ba54){var _0x5cccd9={};_0x5cccd9[_0x24ba54]={'$like':'%'+_0x16b06d['query']['filter']+'%'};return _0x5cccd9;})});}_0x1dd31=_[_0x48e3('0x3b')]({},_0x1dd31,_0x16b06d['options']);return db[_0x48e3('0x52')][_0x48e3('0x1d')]({'where':_0x1dd31['where']})['then'](function(_0x111043){_0x1cd553[_0x48e3('0x1d')]=_0x111043;if(_0x16b06d[_0x48e3('0x2d')][_0x48e3('0x3f')]){_0x1dd31[_0x48e3('0x40')]=[{'all':!![]}];}return db[_0x48e3('0x52')][_0x48e3('0x41')](_0x1dd31);})[_0x48e3('0x1f')](function(_0x5f153f){_0x1cd553[_0x48e3('0x55')]=_0x5f153f;return _0x1cd553;});}})['then'](respondWithFilteredResult(_0x360d85,_0x1dd31))[_0x48e3('0x42')](handleError(_0x360d85,null));};exports['removeDispositions']=function(_0x476c66,_0x48397b){return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x476c66[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x48397b,null))[_0x48e3('0x1f')](function(_0x53d7b7){if(_0x53d7b7){return _0x53d7b7[_0x48e3('0x56')](_0x476c66['query'][_0x48e3('0x57')]);}})[_0x48e3('0x1f')](respondWithStatusCode(_0x48397b,null))[_0x48e3('0x42')](handleError(_0x48397b,null));};exports[_0x48e3('0x58')]=function(_0xfd1d02,_0x11890f){if(_0xfd1d02[_0x48e3('0x48')]['id']){delete _0xfd1d02[_0x48e3('0x48')]['id'];}return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0xfd1d02['params']['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x11890f,null))[_0x48e3('0x1f')](function(_0x5baab4){if(_0x5baab4){_0xfd1d02[_0x48e3('0x48')][_0x48e3('0x51')]=_0x5baab4['id'];return db[_0x48e3('0x59')]['create'](_0xfd1d02[_0x48e3('0x48')]);}})['then'](respondWithResult(_0x11890f,null))['catch'](handleError(_0x11890f,null));};exports[_0x48e3('0x5a')]=function(_0x497384,_0x12aa85){var _0x40e16b={'raw':![],'where':{}};var _0x5f0ec6={};var _0x35fa8f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x48e3('0x54')]({'where':{'id':_0x497384[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x12aa85,null))['then'](function(_0x28d680){if(_0x28d680){_0x5f0ec6[_0x48e3('0x2c')]=_[_0x48e3('0x2e')](db[_0x48e3('0x59')][_0x48e3('0x28')]);_0x5f0ec6['query']=_[_0x48e3('0x2e')](_0x497384[_0x48e3('0x2d')]);_0x5f0ec6[_0x48e3('0x2f')]=_[_0x48e3('0x30')](_0x5f0ec6[_0x48e3('0x2c')],_0x5f0ec6['query']);_0x40e16b[_0x48e3('0x32')]=_[_0x48e3('0x30')](_0x5f0ec6[_0x48e3('0x2c')],qs['fields'](_0x497384[_0x48e3('0x2d')]['fields']));_0x40e16b[_0x48e3('0x32')]=_0x40e16b[_0x48e3('0x32')][_0x48e3('0x33')]?_0x40e16b['attributes']:_0x5f0ec6[_0x48e3('0x2c')];if(!_0x497384[_0x48e3('0x2d')][_0x48e3('0x34')](_0x48e3('0x35'))){_0x40e16b[_0x48e3('0x36')]=qs[_0x48e3('0x36')](_0x497384['query'][_0x48e3('0x36')]);_0x40e16b['offset']=qs[_0x48e3('0x1b')](_0x497384['query']['offset']);}_0x40e16b[_0x48e3('0x37')]=qs['sort'](_0x497384[_0x48e3('0x2d')][_0x48e3('0x38')]);_0x40e16b[_0x48e3('0x3e')]=qs[_0x48e3('0x2f')](_['pick'](_0x497384['query'],_0x5f0ec6[_0x48e3('0x2f')]));_0x40e16b[_0x48e3('0x3e')]['ChatWebsiteId']=_0x28d680['id'];if(_0x497384[_0x48e3('0x2d')][_0x48e3('0x3a')]){_0x40e16b[_0x48e3('0x3e')]=_['merge'](_0x40e16b['where'],{'$or':_[_0x48e3('0x3c')](_0x40e16b['attributes'],function(_0x55527e){var _0x44537d={};_0x44537d[_0x55527e]={'$like':'%'+_0x497384[_0x48e3('0x2d')][_0x48e3('0x3a')]+'%'};return _0x44537d;})});}_0x40e16b=_[_0x48e3('0x3b')]({},_0x40e16b,_0x497384[_0x48e3('0x45')]);return db['CannedAnswer'][_0x48e3('0x1d')]({'where':_0x40e16b[_0x48e3('0x3e')]})[_0x48e3('0x1f')](function(_0x15263a){_0x35fa8f[_0x48e3('0x1d')]=_0x15263a;if(_0x497384['query'][_0x48e3('0x3f')]){_0x40e16b[_0x48e3('0x40')]=[{'all':!![]}];}return db[_0x48e3('0x59')][_0x48e3('0x41')](_0x40e16b);})[_0x48e3('0x1f')](function(_0x5f288e){_0x35fa8f[_0x48e3('0x55')]=_0x5f288e;return _0x35fa8f;});}})[_0x48e3('0x1f')](respondWithFilteredResult(_0x12aa85,_0x40e16b))[_0x48e3('0x42')](handleError(_0x12aa85,null));};exports[_0x48e3('0x5b')]=function(_0x1af9b7,_0x87b085){return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x1af9b7[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x87b085,null))[_0x48e3('0x1f')](function(_0x2dec3f){if(_0x2dec3f){return _0x2dec3f['removeAnswers'](_0x1af9b7[_0x48e3('0x2d')][_0x48e3('0x57')]);}})[_0x48e3('0x1f')](respondWithStatusCode(_0x87b085,null))['catch'](handleError(_0x87b085,null));};exports[_0x48e3('0x5c')]=function(_0x41dfc7,_0x1e47ff){_0x41dfc7[_0x48e3('0x48')][_0x48e3('0x5d')]=_0x41dfc7[_0x48e3('0x5e')][_0x48e3('0x5f')];return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x41dfc7['params']['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x1e47ff,null))[_0x48e3('0x1f')](saveUpdates(_0x41dfc7[_0x48e3('0x48')],null))[_0x48e3('0x1f')](respondWithResult(_0x1e47ff,null))['catch'](handleError(_0x1e47ff,null));};exports[_0x48e3('0x60')]=function(_0x494c3b,_0x397a41){_0x494c3b[_0x48e3('0x48')][_0x48e3('0x61')]=_0x494c3b[_0x48e3('0x5e')][_0x48e3('0x5f')];return db[_0x48e3('0x27')]['find']({'where':{'id':_0x494c3b[_0x48e3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x397a41,null))['then'](saveUpdates(_0x494c3b['body'],null))[_0x48e3('0x1f')](respondWithResult(_0x397a41,null))[_0x48e3('0x42')](handleError(_0x397a41,null));};exports[_0x48e3('0x62')]=function(_0x490dcd,_0x19848c){_0x490dcd['body'][_0x48e3('0x63')]=_0x490dcd['file'][_0x48e3('0x5f')];return db['ChatWebsite'][_0x48e3('0x46')]({'where':{'id':_0x490dcd[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x19848c,null))[_0x48e3('0x1f')](saveUpdates(_0x490dcd[_0x48e3('0x48')],null))[_0x48e3('0x1f')](respondWithResult(_0x19848c,null))[_0x48e3('0x42')](handleError(_0x19848c,null));};exports[_0x48e3('0x64')]=function(_0x5b2499,_0x3d76ef){_0x5b2499[_0x48e3('0x48')][_0x48e3('0x65')]=_0x5b2499[_0x48e3('0x5e')]['filename'];return db['ChatWebsite'][_0x48e3('0x46')]({'where':{'id':_0x5b2499[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x3d76ef,null))[_0x48e3('0x1f')](saveUpdates(_0x5b2499['body'],null))[_0x48e3('0x1f')](respondWithResult(_0x3d76ef,null))[_0x48e3('0x42')](handleError(_0x3d76ef,null));};exports['getLogo']=function(_0x5f1faf,_0x403990){var _0x2298f9=path['join'](config['root'],'server/files/images/logos/default_logo.svg');var _0x20a9a3={'where':{'id':_0x5f1faf[_0x48e3('0x4f')]['id']},'attributes':['id',_0x48e3('0x5d')],'raw':!![]};var _0xc12fcd=![];return require(_0x48e3('0x66'))['getLicense']()[_0x48e3('0x1f')](function(_0x9196f2){if(_0x9196f2){_0xc12fcd=_0x9196f2[_0x48e3('0x67')];}})[_0x48e3('0x1f')](function(){return db[_0x48e3('0x27')][_0x48e3('0x46')](_0x20a9a3);})['then'](handleEntityNotFound(_0x403990,null))['then'](function(_0x2f0c48){if(_0x2f0c48){if(!_[_0x48e3('0x68')](_0x2f0c48[_0x48e3('0x5d')])){if(fs[_0x48e3('0x69')](path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],_0x48e3('0x6c'),_0x2f0c48['sitepic']))&&_0xc12fcd){_0x2298f9=path['join'](config[_0x48e3('0x6b')],_0x48e3('0x6c'),_0x2f0c48[_0x48e3('0x5d')]);}}return _0x403990['download'](_0x2298f9);}})['catch'](handleError(_0x403990,null));};exports[_0x48e3('0x6d')]=function(_0x1dd6e8,_0x5b40f6){var _0x1214ec=path[_0x48e3('0x6a')](config['root'],_0x48e3('0x6e'));var _0x557003={'where':{'id':_0x1dd6e8[_0x48e3('0x4f')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x48e3('0x46')](_0x557003)[_0x48e3('0x1f')](handleEntityNotFound(_0x5b40f6,null))[_0x48e3('0x1f')](function(_0x253dd2){if(_0x253dd2){if(!_[_0x48e3('0x68')](_0x253dd2['agentAvatar'])){if(fs[_0x48e3('0x69')](path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],_0x48e3('0x6f'),_0x253dd2[_0x48e3('0x61')]))){_0x1214ec=path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],_0x48e3('0x6f'),_0x253dd2[_0x48e3('0x61')]);}}return _0x5b40f6[_0x48e3('0x70')](_0x1214ec);}})[_0x48e3('0x42')](handleError(_0x5b40f6,null));};exports['getCustomerAvatar']=function(_0x21ba4e,_0xca8659){var _0xcd3b84=path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],'server/files/images/avatars/customer_avatar.png');var _0x194b52={'where':{'id':_0x21ba4e[_0x48e3('0x4f')]['id']},'attributes':['id','customerAvatar',_0x48e3('0x71')],'raw':!![]};return db[_0x48e3('0x27')][_0x48e3('0x46')](_0x194b52)[_0x48e3('0x1f')](handleEntityNotFound(_0xca8659,null))[_0x48e3('0x1f')](function(_0x56c658){if(_0x56c658){if(!_[_0x48e3('0x68')](_0x56c658['customerAvatar'])){if(fs[_0x48e3('0x69')](path['join'](config[_0x48e3('0x6b')],_0x48e3('0x6f'),_0x56c658['customerAvatar']))&&_0x56c658[_0x48e3('0x71')]){_0xcd3b84=path[_0x48e3('0x6a')](config['root'],_0x48e3('0x6f'),_0x56c658[_0x48e3('0x63')]);}}return _0xca8659[_0x48e3('0x70')](_0xcd3b84);}})[_0x48e3('0x42')](handleError(_0xca8659,null));};exports[_0x48e3('0x72')]=function(_0x180235,_0x388217){var _0x1e0926=path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],'server/files/images/avatars/system_avatar.png');var _0x13036f={'where':{'id':_0x180235[_0x48e3('0x4f')]['id']},'attributes':['id',_0x48e3('0x65')],'raw':!![]};return db[_0x48e3('0x27')][_0x48e3('0x46')](_0x13036f)[_0x48e3('0x1f')](handleEntityNotFound(_0x388217,null))['then'](function(_0x33a445){if(_0x33a445){if(!_[_0x48e3('0x68')](_0x33a445[_0x48e3('0x65')])){if(fs['existsSync'](path['join'](config[_0x48e3('0x6b')],_0x48e3('0x6f'),_0x33a445['systemAvatar']))){_0x1e0926=path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],_0x48e3('0x6f'),_0x33a445['systemAvatar']);}}return _0x388217[_0x48e3('0x70')](_0x1e0926);}})['catch'](handleError(_0x388217,null));};exports['notify']=function(_0x2d9138,_0x5dd215){var _0x49e5aa=require(_0x48e3('0x73'));var _0x1e5c2e=new _0x49e5aa();var _0x4fad9e=_0x1e5c2e[_0x48e3('0x74')](_0x2d9138[_0x48e3('0x75')]['user-agent'])['getResult']();var _0x27bcf0={'body':_0x2d9138[_0x48e3('0x48')],'channel':_0x48e3('0x76')};var _0x101e7a=[];var _0x47c288=[];var _0x152740={};var _0x1c4115=![];return db[_0x48e3('0x77')]['describe']()['then'](function(_0x1655a8){if(!_0x1655a8){throw new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))]('no\x20available\x20attributes');}_0x101e7a=_['difference'](_['keys'](_0x1655a8),[_0x48e3('0x7a'),_0x48e3('0x7b')]);_0x47c288=_[_0x48e3('0x7c')](_['keys'](_0x1655a8),['createdAt','updatedAt',_0x48e3('0x7d'),_0x48e3('0x7e')]);if(_0x2d9138[_0x48e3('0x48')]['id']){delete _0x2d9138[_0x48e3('0x48')]['id'];}if(_['isNil'](_0x2d9138[_0x48e3('0x48')]['from'])){throw new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2d9138['body']['body'])||_0x2d9138[_0x48e3('0x48')][_0x48e3('0x48')]===''){throw new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))](_0x48e3('0x7f'));}if(_[_0x48e3('0x68')](_0x2d9138['body'][_0x48e3('0x80')])){throw new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))](_0x48e3('0x81')+_0x47c288);}if(!_[_0x48e3('0x82')](_0x47c288,_0x2d9138['body'][_0x48e3('0x80')])){throw new db['Sequelize'][(_0x48e3('0x79'))](_0x48e3('0x83')+_0x47c288);}_0x152740[_0x2d9138[_0x48e3('0x48')][_0x48e3('0x80')]]=_0x2d9138[_0x48e3('0x48')]['from'];})[_0x48e3('0x1f')](function(){return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x2d9138[_0x48e3('0x4f')]['id']},'include':[{'model':db['CmList'],'as':_0x48e3('0x84'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x152740,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x48e3('0x85')],'as':'Applications'}]});})[_0x48e3('0x1f')](handleEntityNotFound(_0x5dd215,null))[_0x48e3('0x1f')](function(_0x41429f){if(_0x41429f&&_0x41429f[_0x48e3('0x84')]){_0x27bcf0[_0x48e3('0x86')]=_0x41429f;_0x27bcf0[_0x48e3('0x87')]=_0x41429f['Applications'];_0x27bcf0[_0x48e3('0x88')]=_0x41429f[_0x48e3('0x84')];_0x27bcf0[_0x48e3('0x87')]=_[_0x48e3('0x89')](_0x27bcf0['applications'],[_0x48e3('0x8a')],[_0x48e3('0x8b')]);if(_0x27bcf0[_0x48e3('0x86')][_0x48e3('0x8c')]){delete _0x27bcf0[_0x48e3('0x86')]['Applications'];}if(_0x27bcf0[_0x48e3('0x86')][_0x48e3('0x84')]&&_0x27bcf0[_0x48e3('0x86')][_0x48e3('0x84')]['Contacts']['length']){return _0x27bcf0[_0x48e3('0x86')]['List'][_0x48e3('0x8d')][0x0];}var _0xf3a7af=_[_0x48e3('0xa')](_0x2d9138[_0x48e3('0x48')],{'firstName':_0x2d9138[_0x48e3('0x48')]['from'],'ListId':_0x41429f['ListId']});_0xf3a7af[_0x2d9138[_0x48e3('0x48')][_0x48e3('0x80')]]=_0x2d9138[_0x48e3('0x48')]['from'];return db['CmContact']['create'](_0xf3a7af,{'fields':_0x101e7a,'raw':!![]});}})['then'](handleEntityNotFound(_0x5dd215,null))[_0x48e3('0x1f')](function(_0x54ddac){_0x27bcf0[_0x48e3('0x8e')]=_0x54ddac;var _0x3da491=_0x2d9138[_0x48e3('0x48')][_0x48e3('0x8f')];if(_0x2d9138[_0x48e3('0x75')][_0x48e3('0x90')]){_0x3da491=_0x2d9138[_0x48e3('0x75')][_0x48e3('0x90')];}else if(_0x2d9138[_0x48e3('0x75')]['x-forwarded-for']){_0x3da491=_['first'](_0x2d9138[_0x48e3('0x75')][_0x48e3('0x91')]['split'](','));}if(_0x54ddac){var _0xa279a={'ContactId':_0x54ddac['id'],'ChatWebsiteId':_0x2d9138[_0x48e3('0x4f')]['id'],'from':(_0x54ddac['firstName']||'')+'\x20'+(_0x54ddac[_0x48e3('0x92')]||''),'customerIp':_0x3da491,'customerPort':_0x2d9138[_0x48e3('0x75')][_0x48e3('0x93')]?_0x2d9138[_0x48e3('0x75')]['x-real-port']:null,'referer':_0x2d9138[_0x48e3('0x48')][_0x48e3('0x94')],'browserName':_0x4fad9e[_0x48e3('0x95')][_0x48e3('0x25')]&&_0x4fad9e[_0x48e3('0x95')][_0x48e3('0x96')]?util[_0x48e3('0x97')](_0x48e3('0x98'),_0x4fad9e['browser'][_0x48e3('0x25')],_0x4fad9e[_0x48e3('0x95')][_0x48e3('0x96')]):_0x48e3('0x99'),'browserVersion':_0x4fad9e[_0x48e3('0x95')]['version']||_0x48e3('0x99'),'osName':util['format']('%s\x20%s',_0x4fad9e['os']['name'],_0x4fad9e['os'][_0x48e3('0x96')]),'osVersion':_0x4fad9e['os'][_0x48e3('0x96')],'deviceModel':_0x4fad9e[_0x48e3('0x9a')][_0x48e3('0x2c')]&&_0x4fad9e[_0x48e3('0x9a')]['vendor']?util[_0x48e3('0x97')](_0x48e3('0x9b'),_0x4fad9e[_0x48e3('0x9a')][_0x48e3('0x2c')],_0x4fad9e[_0x48e3('0x9a')][_0x48e3('0x9c')],_0x4fad9e['device'][_0x48e3('0x2a')]):null,'deviceVendor':_0x4fad9e[_0x48e3('0x9a')][_0x48e3('0x9c')],'deviceType':_0x4fad9e[_0x48e3('0x9a')][_0x48e3('0x2a')],'formData':JSON['stringify'](_0x2d9138['body'])};var _0x4a44ec={'ChatWebsiteId':_0x2d9138[_0x48e3('0x4f')]['id'],'closed':![]};if(_0x2d9138['body'][_0x48e3('0x9d')]){_0x4a44ec[_0x48e3('0x9d')]=_0x2d9138[_0x48e3('0x48')][_0x48e3('0x9d')];return db[_0x48e3('0x9e')][_0x48e3('0x46')]({'where':_0x4a44ec})[_0x48e3('0x1f')](function(_0x5c7751){if(_0x5c7751){return[_0x5c7751,![]];}_0xa279a['threadId']=_0x2d9138[_0x48e3('0x48')]['threadId'];_0xa279a['externalUrl']=_0x2d9138[_0x48e3('0x48')]['externalUrl'];return db[_0x48e3('0x9e')][_0x48e3('0x47')](_0xa279a)[_0x48e3('0x1f')](function(_0x243afa){return[_0x243afa,!![]];});});}_0x4a44ec[_0x48e3('0x9f')]=_0x54ddac['id'];if(_0x2d9138[_0x48e3('0x48')]['interaction']&&_0x2d9138[_0x48e3('0x48')][_0x48e3('0xa0')]['id']){_0x4a44ec['id']=_0x2d9138[_0x48e3('0x48')]['interaction']['id'];return db[_0x48e3('0x9e')][_0x48e3('0x46')]({'where':_0x4a44ec})[_0x48e3('0x1f')](function(_0x3609b5){if(_0x3609b5){return[_0x3609b5,![]];}return db[_0x48e3('0x9e')][_0x48e3('0x47')](_0xa279a)[_0x48e3('0x1f')](function(_0x5a4454){return[_0x5a4454,!![]];});});}return db[_0x48e3('0x9e')][_0x48e3('0x47')](_0xa279a)[_0x48e3('0x1f')](function(_0x4e99d8){return[_0x4e99d8,!![]];});}})[_0x48e3('0xa1')](function(_0x2a1a56,_0x5d9256){if(_0x2a1a56){_0x1c4115=_0x5d9256;if(!_0x5d9256){var _0x5422fc={'from':(_0x27bcf0[_0x48e3('0x8e')][_0x48e3('0xa2')]||'')+'\x20'+(_0x27bcf0[_0x48e3('0x8e')]['lastName']||'')};if(_0x2d9138['body'][_0x48e3('0x9d')]&&_0x2d9138['body'][_0x48e3('0xa3')]&&_0x2d9138[_0x48e3('0x48')][_0x48e3('0x9d')]!=_0x2d9138[_0x48e3('0x48')][_0x48e3('0xa3')]){_0x5422fc['threadId']=_0x2d9138[_0x48e3('0x48')][_0x48e3('0xa3')];}return _0x2a1a56[_0x48e3('0x4e')](_0x5422fc);}else{return _0x2a1a56;}}})[_0x48e3('0x1f')](function(_0x5972ce){_0x27bcf0['interaction']=_0x5972ce[_0x48e3('0x21')]({'plain':!![]});_0x27bcf0[_0x48e3('0xa0')][_0x48e3('0xa4')]=_0x1c4115;if(_0x27bcf0[_0x48e3('0xa0')][_0x48e3('0xa4')]){if(_0x27bcf0['account'][_0x48e3('0xa5')]){_0x27bcf0['applications'][_0x48e3('0xa6')]({'id':0x0,'priority':_0x27bcf0[_0x48e3('0x87')][_0x48e3('0x33')]+0x1,'app':_0x48e3('0xa7'),'appdata':_0x48e3('0xa8'),'interval':_0x48e3('0xa9')});}}return db[_0x48e3('0xaa')][_0x48e3('0x47')]({'body':_0x2d9138[_0x48e3('0x48')][_0x48e3('0x48')],'ChatWebsiteId':_0x2d9138['params']['id'],'ChatInteractionId':_0x5972ce['id'],'direction':'in','ContactId':_0x27bcf0[_0x48e3('0x8e')]['id'],'AttachmentId':_0x2d9138['body'][_0x48e3('0xab')]});})[_0x48e3('0x1f')](function(_0x38396b){_0x27bcf0[_0x48e3('0x16')]=_0x38396b;if(_0x27bcf0[_0x48e3('0xa0')][_0x48e3('0xac')]){return db[_0x48e3('0xad')][_0x48e3('0x46')]({'attributes':['id','name'],'where':{'id':_0x27bcf0[_0x48e3('0xa0')]['UserId']}})[_0x48e3('0x1f')](function(_0x3a311c){if(_0x3a311c){_0x27bcf0['applications'][_0x48e3('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3a311c[_0x48e3('0x25')]+','+(_0x27bcf0['account'][_0x48e3('0xaf')]||0xa),'interval':_0x48e3('0xa9')});_0x27bcf0[_0x48e3('0xb0')]=!![];}return respondWithRpcPromise('Start',_0x48e3('0xb1'),_0x27bcf0);});}return respondWithRpcPromise(_0x48e3('0xb2'),_0x48e3('0xb1'),_0x27bcf0);})['then'](function(_0x2d5def){respondWithRpcPromise(_0x48e3('0xb3'),_0x48e3('0xb3'),{'event':_0x48e3('0xb4'),'message':_0x2d5def},client9002);return _0x2d5def;})[_0x48e3('0x1f')](respondWithResult(_0x5dd215,null))[_0x48e3('0x42')](handleError(_0x5dd215,null));};exports[_0x48e3('0xb5')]=function(_0x4bd524,_0xaf4fa4){var _0x5d9268,_0x555077,_0x230770;var _0x406b8a=[];var _0x52349a={};var _0x5ab192=_0x4bd524[_0x48e3('0xb6')]||[];var _0x9b69fa=[];var _0x5e8e99;return db[_0x48e3('0x77')]['describe']()['then'](function(_0x57bf57){if(!_0x57bf57){throw new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))](_0x48e3('0xb7'));}_0x406b8a=_[_0x48e3('0x7c')](_[_0x48e3('0x2e')](_0x57bf57),[_0x48e3('0x7a'),'updatedAt',_0x48e3('0x7d'),_0x48e3('0x7e')]);if(_0x4bd524[_0x48e3('0x48')]['id']){delete _0x4bd524[_0x48e3('0x48')]['id'];}if(_[_0x48e3('0x68')](_0x4bd524[_0x48e3('0x48')]['from'])){throw _0xaf4fa4['status'](0x1f4)['send'](new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))](_0x48e3('0xb8')));}if(_[_0x48e3('0x68')](_0x4bd524['body']['body'])||_0x4bd524[_0x48e3('0x48')][_0x48e3('0x48')]===''){throw _0xaf4fa4[_0x48e3('0x19')](0x1f4)[_0x48e3('0xb9')](new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))](_0x48e3('0x7f')));}if(_[_0x48e3('0x68')](_0x4bd524[_0x48e3('0x48')]['mapKeyOffline'])){throw _0xaf4fa4[_0x48e3('0x19')](0x1f4)[_0x48e3('0xb9')](new db[(_0x48e3('0x78'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x406b8a));}if(!_[_0x48e3('0x82')](_0x406b8a,_0x4bd524[_0x48e3('0x48')]['mapKeyOffline'])){throw _0xaf4fa4[_0x48e3('0x19')](0x1f4)[_0x48e3('0xb9')](new db[(_0x48e3('0x78'))][(_0x48e3('0x79'))](_0x48e3('0xba')+_0x406b8a));}_0x52349a[_0x4bd524[_0x48e3('0x48')][_0x48e3('0xbb')]]=_0x4bd524['body'][_0x48e3('0xbc')];})[_0x48e3('0x1f')](function(){return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x4bd524[_0x48e3('0x4f')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x48e3('0xbd')],'as':_0x48e3('0xbd')}]});})[_0x48e3('0x1f')](handleEntityNotFound(_0xaf4fa4,null))[_0x48e3('0x1f')](function(_0x30a854){if(_0x30a854&&_0x30a854['List']){_0x555077=_0x30a854;var _0x5f1e29=_[_0x48e3('0xa')](_0x4bd524[_0x48e3('0x48')],{'firstName':_0x4bd524['body']['from'],'phone':_0x4bd524[_0x48e3('0x48')]['from'],'ListId':_0x30a854[_0x48e3('0x7e')]});_0x5f1e29[_0x4bd524[_0x48e3('0x48')][_0x48e3('0xbb')]]=_0x4bd524['body'][_0x48e3('0xbc')];return db['CmContact'][_0x48e3('0xbe')]({'where':_0x52349a,'defaults':_0x5f1e29});}})[_0x48e3('0xa1')](function(_0x36185f){if(_0x36185f){_0x230770=_0x36185f;var _0xe7c29c=fs['readFileSync'](path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x1fdeba=ejs[_0x48e3('0xbf')](_0xe7c29c,{'body':_['toPairs'](_0x4bd524[_0x48e3('0x48')][_0x48e3('0x48')]),'bodyTitle':_0x555077['offlineMessageBody']});return db[_0x48e3('0xc0')][_0x48e3('0x47')]({'body':_0x1fdeba,'plainBody':htmlToText['fromString'](_0x1fdeba),'ContactId':_0x36185f['id'],'ChatWebsiteId':_0x555077['id']});}})['then'](function(_0x2ee07d){_0x5e8e99=_0x2ee07d;if(_0x5ab192[_0x48e3('0x33')]){var _0xdabd49=_0x5ab192[_0x48e3('0x3c')](function(_0x2bae2b){return{'name':_0x2bae2b[_0x48e3('0xc1')],'basename':_0x2bae2b[_0x48e3('0x5f')],'type':_0x2bae2b['mimetype'],'ChatOfflineMessageId':_0x2ee07d['id']};});_0x9b69fa=_0xdabd49[_0x48e3('0x3c')](_0x48e8a6=>{var _0x160243={'filename':_0x48e8a6[_0x48e3('0x25')],'path':path['join'](config[_0x48e3('0x6b')],_0x48e3('0xc2'),'files',_0x48e3('0xc3'),'offline-chat',_0x48e8a6['basename'])};return _0x160243;});if(!_0x555077['openNewInteraction']){return db[_0x48e3('0xc4')][_0x48e3('0xc5')](function(_0x151644){return db[_0x48e3('0xc6')][_0x48e3('0xc7')](_0xdabd49,{'transaction':_0x151644});});}}})[_0x48e3('0x1f')](function(){if(_0x5e8e99){_0x5d9268=_0x5e8e99;return db[_0x48e3('0xbd')][_0x48e3('0x54')]({'where':{'service':!![]},'include':[{'model':db[_0x48e3('0xc8')],'as':_0x48e3('0xc9'),'raw':!![],'include':[{'model':db[_0x48e3('0xca')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x48e3('0x1f')](function(_0x50cd5f){if(_0x50cd5f&&_0x50cd5f[_0x48e3('0xc9')]&&_0x555077['forwardOffline']&&_0x555077[_0x48e3('0xcb')]){var _0x44ab3a=_0x50cd5f[_0x48e3('0xcc')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x44ab3a,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x50cd5f[_0x48e3('0x25')],_0x50cd5f[_0x48e3('0xcd')]||_0x50cd5f[_0x48e3('0xc9')][_0x48e3('0x49')]),'to':_0x555077[_0x48e3('0xcb')],'subject':_0x555077[_0x48e3('0xce')],'html':_0x5d9268[_0x48e3('0x48')],'attachments':_0x9b69fa}},client9003)[_0x48e3('0x1f')](function(){return _0x5d9268;})[_0x48e3('0x42')](function(_0x4fe9f7){logger[_0x48e3('0x15')](_0x4fe9f7);});}})[_0x48e3('0x1f')](function(){if(_0x555077&&_0x555077[_0x48e3('0xcf')]&&_0x555077[_0x48e3('0xd0')]){var _0x2d7c50=[];if(_0x5ab192['length']){_0x2d7c50=_0x5ab192['map'](function(_0x132de0){return{'name':_0x132de0[_0x48e3('0xc1')],'basename':_0x132de0[_0x48e3('0x5f')],'type':_0x132de0[_0x48e3('0xd1')],'ChatOfflineMessageId':_0x5e8e99['id']};});}var _0x804fce;if(!_[_0x48e3('0x68')](_0x555077[_0x48e3('0xd2')])){var _0x5dfde3=_[_0x48e3('0x3c')](_0x4bd524['body'],function(_0x18962f){return _0x18962f;});var _0x4807e0=_['toPairsIn'](_0x5dfde3)[0x0];var _0x269332=_[_0x48e3('0xd3')](_0x4807e0,function(_0x3056cf){return _0x3056cf;});_0x804fce=_0x269332[0x1][_0x555077['subjectOffline']];}var _0x4c9c16={'from':_0x230770[_0x48e3('0xcd')],'firstName':_0x230770['firstName'],'lastName':_0x230770[_0x48e3('0x92')],'mapKey':_0x48e3('0xcd'),'message':{'from':_0x230770[_0x48e3('0xcd')],'to':_0x555077[_0x48e3('0xbd')][_0x48e3('0xcd')],'cc':'','subject':_[_0x48e3('0x68')](_0x804fce)?_0x555077['offlineMessageSubject']:_0x804fce,'messageId':'','sentAt':new Date(),'attach':_0x2d7c50[_0x48e3('0x33')],'attachments':_0x2d7c50,'originChannel':_0x48e3('0xd4'),'ChatWebsiteId':_0x555077['id'],'ChatOfflineMessageId':_0x5d9268['id'],'originTo':_0x555077['MailAccount']['email']},'body':_0x5d9268[_0x48e3('0x48')]};var _0xb2e222={'account':{'id':_0x555077[_0x48e3('0xd0')]},'body':_0x4c9c16,'log':_0x48e3('0xd5')};return respondWithRpcPromise(_0x48e3('0xd5'),_0x48e3('0xd6'),_0xb2e222,client9001)['then'](function(){return _0x5d9268;})[_0x48e3('0x42')](function(_0x4dfc93){logger[_0x48e3('0x15')](_0x4dfc93);});}return;})[_0x48e3('0x1f')](function(){if(_0x5d9268){return _0x5d9268;}})[_0x48e3('0x1f')](respondWithResult(_0xaf4fa4,null))[_0x48e3('0x42')](function(_0x28acc3){logger['error'](_0x48e3('0x42'),_0x28acc3);for(var _0x16cc6d of _0x5ab192){var _0x11804c=path[_0x48e3('0x6a')](config[_0x48e3('0x6b')],_0x48e3('0xc2'),_0x48e3('0xb6'),'attachments',_0x48e3('0xd7'),_0x16cc6d[_0x48e3('0x5f')]);fs_extra[_0x48e3('0xd8')](_0x11804c)[_0x48e3('0x42')](function(_0x56b3c6){logger[_0x48e3('0x15')](_0x48e3('0xd9'),_0x11804c,_0x56b3c6);});}});};exports['addInteraction']=function(_0x20d9ae,_0x5423c3){return db[_0x48e3('0x9e')][_0x48e3('0x46')]({'where':{'id':_0x20d9ae[_0x48e3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5423c3,null))[_0x48e3('0x1f')](function(_0x4d02db){if(_0x4d02db){return _0x4d02db[_0x48e3('0xda')](_0x20d9ae['body'][_0x48e3('0x57')],_[_0x48e3('0xdb')](_0x20d9ae[_0x48e3('0x48')],[_0x48e3('0x57'),'id'])||{});}})['then'](respondWithResult(_0x5423c3,null))[_0x48e3('0x42')](handleError(_0x5423c3,null));};exports['getInteractions']=function(_0x13c3d8,_0x4c502d){var _0x3c22b5={'raw':![],'where':{}};var _0x494eac={};var _0x203882={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x48e3('0x54')]({'where':{'id':_0x13c3d8[_0x48e3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4c502d,null))[_0x48e3('0x1f')](function(_0xe3be79){if(_0xe3be79){_0x494eac[_0x48e3('0x2c')]=_[_0x48e3('0x2e')](db[_0x48e3('0x9e')][_0x48e3('0x28')]);_0x494eac[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0x13c3d8[_0x48e3('0x2d')]);_0x494eac[_0x48e3('0x2f')]=_[_0x48e3('0x30')](_0x494eac[_0x48e3('0x2c')],_0x494eac[_0x48e3('0x2d')]);_0x3c22b5[_0x48e3('0x32')]=_['intersection'](_0x494eac[_0x48e3('0x2c')],qs['fields'](_0x13c3d8[_0x48e3('0x2d')][_0x48e3('0x31')]));_0x3c22b5[_0x48e3('0x32')]=_0x3c22b5[_0x48e3('0x32')][_0x48e3('0x33')]?_0x3c22b5[_0x48e3('0x32')]:_0x494eac[_0x48e3('0x2c')];if(!_0x13c3d8[_0x48e3('0x2d')][_0x48e3('0x34')]('nolimit')){_0x3c22b5[_0x48e3('0x36')]=qs['limit'](_0x13c3d8[_0x48e3('0x2d')][_0x48e3('0x36')]);_0x3c22b5[_0x48e3('0x1b')]=qs[_0x48e3('0x1b')](_0x13c3d8['query'][_0x48e3('0x1b')]);}_0x3c22b5[_0x48e3('0x37')]=qs[_0x48e3('0x38')](_0x13c3d8[_0x48e3('0x2d')]['sort']);_0x3c22b5[_0x48e3('0x3e')]=qs['filters'](_[_0x48e3('0x39')](_0x13c3d8[_0x48e3('0x2d')],_0x494eac['filters']));_0x3c22b5[_0x48e3('0x3e')]['ChatWebsiteId']=_0xe3be79['id'];if(_0x13c3d8[_0x48e3('0x2d')][_0x48e3('0x3a')]){_0x3c22b5[_0x48e3('0x3e')]=_[_0x48e3('0x3b')](_0x3c22b5[_0x48e3('0x3e')],{'$or':_[_0x48e3('0x3c')](_0x3c22b5['attributes'],function(_0x2cc93f){var _0x48a267={};_0x48a267[_0x2cc93f]={'$like':'%'+_0x13c3d8[_0x48e3('0x2d')]['filter']+'%'};return _0x48a267;})});}_0x3c22b5=_['merge']({},_0x3c22b5,_0x13c3d8[_0x48e3('0x45')]);return db[_0x48e3('0x9e')]['count']({'where':_0x3c22b5[_0x48e3('0x3e')]})['then'](function(_0xcbe458){_0x203882[_0x48e3('0x1d')]=_0xcbe458;if(_0x13c3d8['query'][_0x48e3('0x3f')]){_0x3c22b5[_0x48e3('0x40')]=[{'model':db[_0x48e3('0x77')],'as':_0x48e3('0xdc'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x48e3('0xdd'),'internal'],'required':![]},{'model':db[_0x48e3('0xde')],'as':_0x48e3('0xdf'),'attributes':['id',_0x48e3('0x25'),'color'],'where':_0x13c3d8[_0x48e3('0x2d')][_0x48e3('0xe0')]?{'id':_0x13c3d8[_0x48e3('0x2d')][_0x48e3('0xe0')]}:undefined,'required':_0x13c3d8[_0x48e3('0x2d')][_0x48e3('0xe0')]?!![]:![]}];}return db[_0x48e3('0x9e')][_0x48e3('0x41')](_0x3c22b5);})[_0x48e3('0x1f')](function(_0x41afb0){_0x203882[_0x48e3('0x55')]=_0x41afb0;return _0x203882;});}})[_0x48e3('0x1f')](respondWithFilteredResult(_0x4c502d,_0x3c22b5))[_0x48e3('0x42')](handleError(_0x4c502d,null));};function iftimePromise(_0xd98ba3,_0x1b46f0){return respondWithRpcPromise(_0x48e3('0xe1'),_0x48e3('0xe2'),{'command':_0x1b46f0[_0x48e3('0xe3')]?util[_0x48e3('0x97')](_0x48e3('0xe4'),_0xd98ba3['interval'],_0x1b46f0['timezone']):util[_0x48e3('0x97')](_0x48e3('0xe5'),_0xd98ba3[_0x48e3('0xe6')])},client9002)[_0x48e3('0x1f')](function(_0x2d3ede){var _0x20a276=_0x2d3ede&&_0x2d3ede[_0x48e3('0xe7')](_0x48e3('0xe8'))>=0x0?!![]:![];logger[_0x48e3('0x11')](_0x48e3('0xe9'),_0x1b46f0['id'],_0xd98ba3['id'],_0xd98ba3[_0x48e3('0xe6')],_0x20a276?_0x48e3('0xea'):_0x48e3('0xeb'),_0x1b46f0[_0x48e3('0xe3')]?_0x1b46f0[_0x48e3('0xe3')]:_0x48e3('0xec'));return _0x20a276;})['catch'](function(_0x2ef449){logger[_0x48e3('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1b46f0['id'],_0xd98ba3['id'],_0xd98ba3[_0x48e3('0xe6')],util[_0x48e3('0xed')](_0x2ef449,{'showHidden':![],'depth':null}),_0x1b46f0['timezone']?_0x1b46f0[_0x48e3('0xe3')]:_0x48e3('0xec'));return![];});}exports['getSnippet']=function(_0x34d732,_0x29b8cb){var _0x760d13=0x0;var _0x8a46a0=0x0;var _0x303351=![];var _0x67a852;var _0x157e3f;return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x34d732[_0x48e3('0x4f')]['id']},'include':[{'model':db[_0x48e3('0xee')],'as':_0x48e3('0xee'),'include':[{'model':db[_0x48e3('0xee')],'as':'Intervals','attributes':['id',_0x48e3('0xe6')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x29b8cb,null))[_0x48e3('0x1f')](function(_0x1dba21){if(_0x1dba21){_0x67a852=_0x1dba21;return _0x1dba21[_0x48e3('0xef')]({'raw':!![]});}})[_0x48e3('0x1f')](function(_0x11dbbf){if(_0x67a852){if(_0x11dbbf){_0x157e3f=_0x11dbbf;}}return require(_0x48e3('0x66'))['getLicense']();})[_0x48e3('0x1f')](function(_0x50f58b){if(_0x50f58b){_0x8a46a0=_0x50f58b[_0x48e3('0xf0')];_0x303351=_0x50f58b[_0x48e3('0x67')];}})[_0x48e3('0x1f')](function(){return db[_0x48e3('0x9e')][_0x48e3('0x1d')]({'where':{'closed':![]}});})['then'](function(_0x249200){_0x760d13=_0x249200;if(_0x8a46a0&&_0x249200>_0x8a46a0){return db[_0x48e3('0xf1')]['findOne']({'where':{'id':0x1}})[_0x48e3('0x1f')](function(_0x192204){if(_0x192204){_0x192204[_0x48e3('0xf2')](_0x48e3('0xf3'));}});}})[_0x48e3('0x1f')](function(){if(_0x67a852[_0x48e3('0xee')]&&_0x67a852[_0x48e3('0xee')][_0x48e3('0xf4')]){var _0x55eb1d=[];for(var _0x21a121=0x0;_0x21a121<_0x67a852[_0x48e3('0xee')]['Intervals'][_0x48e3('0x33')];_0x21a121++){var _0x56a084=_0x67a852[_0x48e3('0xee')][_0x48e3('0xf4')][_0x21a121]['get']({'plain':!![]});_0x55eb1d[_0x48e3('0xa6')](iftimePromise(_0x56a084,_0x67a852));}return BPromise['all'](_0x55eb1d)['then'](function(_0x1bece2){return _[_0x48e3('0xf5')](_0x1bece2);});}else{return!![];}})[_0x48e3('0x1f')](function(_0x3a7dd1){var _0x51c84a=fs[_0x48e3('0xf6')](path['join'](config['root'],_0x48e3('0xf7')),_0x48e3('0xf8'));var _0x2654e3={'remote':_0x67a852[_0x48e3('0xf9')],'query':querystring['stringify'](_['merge'](_0x67a852[_0x48e3('0x21')]({'plain':!![]}),{'customerIp':_0x34d732[_0x48e3('0x75')][_0x48e3('0x91')]||_0x34d732[_0x48e3('0x75')][_0x48e3('0xfa')]||_0x34d732[_0x48e3('0xfb')][_0x48e3('0xfc')]||_0x34d732['ip'],'referer':_0x34d732[_0x48e3('0x75')]['referer'],'openedInteractions':_0x760d13,'maxInteractions':_0x8a46a0,'virtual':_0x303351[_0x48e3('0xf0')],'online':_0x3a7dd1,'custom':_0x303351}))[_0x48e3('0xfd')](/'/g,'\x5c\x27')};_0x29b8cb[_0x48e3('0xb9')](ejs[_0x48e3('0xbf')](Mustache['render'](_0x51c84a,_0x2654e3),{'proactiveActions':_0x157e3f,'alignment':_0x67a852['alignment'],'verticalAlignment':_0x67a852[_0x48e3('0xfe')],'div_color':_0x67a852[_0x48e3('0xff')],'labelText':_0x67a852[_0x48e3('0x100')],'text_color':_0x67a852[_0x48e3('0x101')],'text_button_color':_0x67a852[_0x48e3('0x102')],'button_color':_0x67a852['color_button'],'background_color':_0x67a852[_0x48e3('0x103')],'hideWhenOffline':_0x67a852['hideWhenOffline'],'interval':_0x67a852['IntervalId']}));})[_0x48e3('0x42')](handleError(_0x29b8cb,null));};exports[_0x48e3('0x104')]=function(_0x4c8a38,_0x4912d6){var _0x38560b=_0x4c8a38[_0x48e3('0x4f')]['id'];var _0x53faa9=_0x4c8a38['body'];var _0x1abc1d=0xc8;var _0x50b622=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x48e3('0xc4')][_0x48e3('0x105')]['ISOLATION_LEVELS'][_0x48e3('0x106')]},function(_0x2e03bc){return db[_0x48e3('0x27')]['findOne']({'where':{'id':_0x38560b},'transaction':_0x2e03bc})[_0x48e3('0x1f')](function(_0x19f325){if(_0x19f325){return db[_0x48e3('0x85')][_0x48e3('0x20')]({'where':{'ChatWebsiteId':_0x38560b},'transaction':_0x2e03bc})[_0x48e3('0x1f')](function(){var _0x16f046=_[_0x48e3('0x3c')](_0x53faa9,function(_0x7617df){_0x7617df[_0x48e3('0x51')]=_0x38560b;return _0x7617df;});return db['ChatApplication'][_0x48e3('0xc7')](_0x16f046,{'transaction':_0x2e03bc});});}else{_0x1abc1d=0x194;_0x50b622=[];}});})[_0x48e3('0x1f')](function(){if(_0x1abc1d!==0x194){return db[_0x48e3('0x85')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x38560b},'order':_0x48e3('0x8a')})['then'](function(_0x185ad0){_0x50b622=_0x185ad0;});}})['catch'](function(_0x3aac19){_0x1abc1d=0x1f4;logger[_0x48e3('0x15')](_0x3aac19['stack']);if(_0x3aac19[_0x48e3('0x25')]){delete _0x3aac19[_0x48e3('0x25')];}_0x50b622=_0x3aac19;})[_0x48e3('0x107')](function(){if(_0x50b622===null){_0x4912d6[_0x48e3('0x18')](_0x1abc1d);}else{if(_0x1abc1d===0x1f4){_0x4912d6[_0x48e3('0x19')](_0x1abc1d)['send'](_0x50b622);}else{_0x4912d6['status'](_0x1abc1d)['json'](_0x50b622);}}});};exports[_0x48e3('0x108')]=function(_0x12c2a7,_0x55c407){var _0x319f99={};var _0x4ef119={};var _0xf3442c;var _0x25a734;return db[_0x48e3('0x27')][_0x48e3('0x54')]({'where':{'id':_0x12c2a7[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x55c407,null))[_0x48e3('0x1f')](function(_0x378925){if(_0x378925){_0xf3442c=_0x378925;_0x4ef119[_0x48e3('0x2c')]=_[_0x48e3('0x2e')](db[_0x48e3('0x85')][_0x48e3('0x28')]);_0x4ef119[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0x12c2a7[_0x48e3('0x2d')]);_0x4ef119[_0x48e3('0x2f')]=_['intersection'](_0x4ef119[_0x48e3('0x2c')],_0x4ef119[_0x48e3('0x2d')]);_0x319f99[_0x48e3('0x32')]=_[_0x48e3('0x30')](_0x4ef119[_0x48e3('0x2c')],qs[_0x48e3('0x31')](_0x12c2a7['query'][_0x48e3('0x31')]));_0x319f99['attributes']=_0x319f99[_0x48e3('0x32')][_0x48e3('0x33')]?_0x319f99['attributes']:_0x4ef119[_0x48e3('0x2c')];_0x319f99['order']=qs[_0x48e3('0x38')](_0x12c2a7[_0x48e3('0x2d')]['sort']);_0x319f99[_0x48e3('0x3e')]=qs['filters'](_[_0x48e3('0x39')](_0x12c2a7['query'],_0x4ef119[_0x48e3('0x2f')]));if(_0x12c2a7[_0x48e3('0x2d')][_0x48e3('0x3a')]){_0x319f99['where']=_[_0x48e3('0x3b')](_0x319f99[_0x48e3('0x3e')],{'$or':_['map'](_0x319f99['attributes'],function(_0x31ff3d){var _0x519ef9={};_0x519ef9[_0x31ff3d]={'$like':'%'+_0x12c2a7[_0x48e3('0x2d')][_0x48e3('0x3a')]+'%'};return _0x519ef9;})});}_0x319f99=_[_0x48e3('0x3b')]({},_0x319f99,_0x12c2a7[_0x48e3('0x45')]);return _0xf3442c[_0x48e3('0x108')](_0x319f99);}})[_0x48e3('0x1f')](function(_0x34da7d){if(_0x34da7d){_0x25a734=_0x34da7d[_0x48e3('0x33')];if(!_0x12c2a7[_0x48e3('0x2d')][_0x48e3('0x34')](_0x48e3('0x35'))){_0x319f99[_0x48e3('0x36')]=qs[_0x48e3('0x36')](_0x12c2a7[_0x48e3('0x2d')][_0x48e3('0x36')]);_0x319f99[_0x48e3('0x1b')]=qs['offset'](_0x12c2a7[_0x48e3('0x2d')]['offset']);}return _0xf3442c[_0x48e3('0x108')](_0x319f99);}})[_0x48e3('0x1f')](function(_0x1582ab){if(_0x1582ab){return _0x1582ab?{'count':_0x25a734,'rows':_0x1582ab}:null;}})[_0x48e3('0x1f')](respondWithResult(_0x55c407,null))[_0x48e3('0x42')](handleError(_0x55c407,null));};exports[_0x48e3('0x109')]=function(_0x169772,_0x3c98d9){return db[_0x48e3('0x10a')][_0x48e3('0x46')]({'where':{'id':_0x169772[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x3c98d9,null))[_0x48e3('0x1f')](function(_0x5cd1da){if(_0x5cd1da){return _0x5cd1da[_0x48e3('0x109')](_0x169772[_0x48e3('0x48')][_0x48e3('0x57')],_[_0x48e3('0xdb')](_0x169772[_0x48e3('0x48')],['ids','id'])||{});}})[_0x48e3('0x1f')](respondWithResult(_0x3c98d9,null))[_0x48e3('0x42')](handleError(_0x3c98d9,null));};exports[_0x48e3('0xef')]=function(_0x5e6dde,_0x173d25){var _0x5e9b23={};var _0x35f32d={};var _0x59bead;var _0x4e9f2d;return db[_0x48e3('0x27')]['findOne']({'where':{'id':_0x5e6dde['params']['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x173d25,null))[_0x48e3('0x1f')](function(_0x401999){if(_0x401999){_0x59bead=_0x401999;_0x35f32d[_0x48e3('0x2c')]=_[_0x48e3('0x2e')](db['ChatProactiveAction'][_0x48e3('0x28')]);_0x35f32d[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0x5e6dde[_0x48e3('0x2d')]);_0x35f32d[_0x48e3('0x2f')]=_['intersection'](_0x35f32d[_0x48e3('0x2c')],_0x35f32d[_0x48e3('0x2d')]);_0x5e9b23[_0x48e3('0x32')]=_[_0x48e3('0x30')](_0x35f32d[_0x48e3('0x2c')],qs[_0x48e3('0x31')](_0x5e6dde[_0x48e3('0x2d')]['fields']));_0x5e9b23['attributes']=_0x5e9b23[_0x48e3('0x32')]['length']?_0x5e9b23[_0x48e3('0x32')]:_0x35f32d[_0x48e3('0x2c')];_0x5e9b23[_0x48e3('0x37')]=qs[_0x48e3('0x38')](_0x5e6dde[_0x48e3('0x2d')][_0x48e3('0x38')]);_0x5e9b23['where']=qs[_0x48e3('0x2f')](_['pick'](_0x5e6dde[_0x48e3('0x2d')],_0x35f32d[_0x48e3('0x2f')]));if(_0x5e6dde[_0x48e3('0x2d')]['filter']){_0x5e9b23['where']=_[_0x48e3('0x3b')](_0x5e9b23[_0x48e3('0x3e')],{'$or':_[_0x48e3('0x3c')](_0x5e9b23[_0x48e3('0x32')],function(_0x19f544){var _0x16c190={};_0x16c190[_0x19f544]={'$like':'%'+_0x5e6dde[_0x48e3('0x2d')][_0x48e3('0x3a')]+'%'};return _0x16c190;})});}_0x5e9b23=_[_0x48e3('0x3b')]({},_0x5e9b23,_0x5e6dde['options']);return _0x59bead['getProactiveActions'](_0x5e9b23);}})[_0x48e3('0x1f')](function(_0x240abd){if(_0x240abd){_0x4e9f2d=_0x240abd[_0x48e3('0x33')];if(!_0x5e6dde[_0x48e3('0x2d')][_0x48e3('0x34')](_0x48e3('0x35'))){_0x5e9b23[_0x48e3('0x36')]=qs[_0x48e3('0x36')](_0x5e6dde[_0x48e3('0x2d')][_0x48e3('0x36')]);_0x5e9b23['offset']=qs[_0x48e3('0x1b')](_0x5e6dde[_0x48e3('0x2d')][_0x48e3('0x1b')]);}return _0x59bead[_0x48e3('0xef')](_0x5e9b23);}})[_0x48e3('0x1f')](function(_0x31ccf){if(_0x31ccf){return _0x31ccf?{'count':_0x4e9f2d,'rows':_0x31ccf}:null;}})[_0x48e3('0x1f')](respondWithResult(_0x173d25,null))[_0x48e3('0x42')](handleError(_0x173d25,null));};exports[_0x48e3('0x10b')]=function(_0x5ad5b9,_0xb0676d){var _0x38fe52=_0x5ad5b9[_0x48e3('0x2d')][_0x48e3('0x10c')]==='false'?_0x48e3('0x10d'):_0x48e3('0x10e');return db['ChatWebsite'][_0x48e3('0x46')]({'attributes':['id',_0x38fe52],'where':{'id':_0x5ad5b9[_0x48e3('0x4f')]['id']}})['then'](handleEntityNotFound(_0xb0676d,null))['then'](function(_0x313d5f){if(_0x313d5f){var _0x7ba85a=_0x313d5f[_0x38fe52];var _0x383919=_0x7ba85a&&_0x7ba85a[_0x48e3('0x10f')]?_0x7ba85a[_0x48e3('0x10f')]:[];_0xb0676d['send']({'fromKey':_[_0x48e3('0x68')](_0x7ba85a[_0x48e3('0x110')])?undefined:_0x7ba85a[_0x48e3('0x110')],'count':_0x383919[_0x48e3('0x33')],'rows':_0x383919});}})['catch'](handleError(_0xb0676d,null));};exports['getOfflineMessages']=function(_0x10a6a0,_0x499d0d){var _0x14295c={'raw':![],'where':{}};var _0x2bff68={};var _0x4e0d83={'count':0x0,'rows':[]};return db[_0x48e3('0x27')]['findOne']({'where':{'id':_0x10a6a0[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x499d0d,null))[_0x48e3('0x1f')](function(_0x10ed5b){if(_0x10ed5b){_0x2bff68[_0x48e3('0x2c')]=_['keys'](db[_0x48e3('0xc0')]['rawAttributes']);_0x2bff68[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0x10a6a0[_0x48e3('0x2d')]);_0x2bff68[_0x48e3('0x2f')]=_[_0x48e3('0x30')](_0x2bff68['model'],_0x2bff68[_0x48e3('0x2d')]);_0x14295c[_0x48e3('0x32')]=_[_0x48e3('0x30')](_0x2bff68[_0x48e3('0x2c')],qs[_0x48e3('0x31')](_0x10a6a0['query']['fields']));_0x14295c[_0x48e3('0x32')]=_0x14295c['attributes']['length']?_0x14295c[_0x48e3('0x32')]:_0x2bff68[_0x48e3('0x2c')];if(!_0x10a6a0[_0x48e3('0x2d')][_0x48e3('0x34')](_0x48e3('0x35'))){_0x14295c[_0x48e3('0x36')]=qs[_0x48e3('0x36')](_0x10a6a0[_0x48e3('0x2d')][_0x48e3('0x36')]);_0x14295c[_0x48e3('0x1b')]=qs[_0x48e3('0x1b')](_0x10a6a0[_0x48e3('0x2d')][_0x48e3('0x1b')]);}_0x14295c[_0x48e3('0x37')]=qs[_0x48e3('0x38')](_0x10a6a0[_0x48e3('0x2d')][_0x48e3('0x38')]);_0x14295c[_0x48e3('0x3e')]=qs[_0x48e3('0x2f')](_[_0x48e3('0x39')](_0x10a6a0[_0x48e3('0x2d')],_0x2bff68[_0x48e3('0x2f')]));_0x14295c[_0x48e3('0x3e')][_0x48e3('0x51')]=_0x10ed5b['id'];if(_0x10a6a0[_0x48e3('0x2d')][_0x48e3('0x3a')]){_0x14295c['where']=_[_0x48e3('0x3b')](_0x14295c[_0x48e3('0x3e')],{'$or':_[_0x48e3('0x3c')](_0x14295c['attributes'],function(_0x4a8e9d){var _0x55a1c5={};_0x55a1c5[_0x4a8e9d]={'$like':'%'+_0x10a6a0[_0x48e3('0x2d')][_0x48e3('0x3a')]+'%'};return _0x55a1c5;})});}_0x14295c=_[_0x48e3('0x3b')]({},_0x14295c,_0x10a6a0['options']);return db['ChatOfflineMessage'][_0x48e3('0x1d')]({'where':_0x14295c[_0x48e3('0x3e')]})[_0x48e3('0x1f')](function(_0x18adee){_0x4e0d83[_0x48e3('0x1d')]=_0x18adee;if(_0x10a6a0[_0x48e3('0x2d')]['includeAll']){_0x14295c['include']=[{'all':!![]}];}else{_0x14295c[_0x48e3('0x40')]=[{'model':db[_0x48e3('0x77')],'as':'Contact','required':![]},{'model':db[_0x48e3('0xc6')],'as':_0x48e3('0x111'),'required':![]}];}return db['ChatOfflineMessage'][_0x48e3('0x41')](_0x14295c);})[_0x48e3('0x1f')](function(_0x3613a2){_0x4e0d83['rows']=_0x3613a2;return _0x4e0d83;});}})['then'](respondWithFilteredResult(_0x499d0d,_0x14295c))['catch'](handleError(_0x499d0d,null));};exports[_0x48e3('0x112')]=function(_0xdf740d,_0x32cef2){return db['ChatWebsite'][_0x48e3('0x46')]({'where':{'id':_0xdf740d[_0x48e3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x32cef2,null))[_0x48e3('0x1f')](function(_0x32af93){if(_0x32af93){return _0x32af93['addAgents'](_0xdf740d[_0x48e3('0x48')][_0x48e3('0x57')],_[_0x48e3('0xdb')](_0xdf740d[_0x48e3('0x48')],[_0x48e3('0x57'),'id'])||{})['spread'](function(_0x23a4c0){for(var _0x15580f=0x0;_0x15580f<_0xdf740d['body'][_0x48e3('0x57')][_0x48e3('0x33')];_0x15580f+=0x1){socket['emit'](_0x48e3('0x113'),{'UserId':Number(_0xdf740d[_0x48e3('0x48')][_0x48e3('0x57')][_0x15580f]),'ChatWebsiteId':Number(_0xdf740d['params']['id'])});}return _0x23a4c0;});}})[_0x48e3('0x1f')](respondWithResult(_0x32cef2,null))[_0x48e3('0x42')](handleError(_0x32cef2,null));};exports[_0x48e3('0x114')]=function(_0x4918b4,_0x1004fe){return db[_0x48e3('0x27')][_0x48e3('0x46')]({'where':{'id':_0x4918b4[_0x48e3('0x4f')]['id']}})[_0x48e3('0x1f')](handleEntityNotFound(_0x1004fe,null))[_0x48e3('0x1f')](function(_0x55e4d3){if(_0x55e4d3){return _0x55e4d3[_0x48e3('0x114')](_0x4918b4[_0x48e3('0x2d')][_0x48e3('0x57')])[_0x48e3('0x1f')](function(){if(_['isArray'](_0x4918b4[_0x48e3('0x2d')][_0x48e3('0x57')])){for(var _0x4d79ea=0x0;_0x4d79ea<_0x4918b4[_0x48e3('0x2d')][_0x48e3('0x57')][_0x48e3('0x33')];_0x4d79ea+=0x1){socket[_0x48e3('0x115')](_0x48e3('0x116'),{'UserId':Number(_0x4918b4[_0x48e3('0x2d')]['ids'][_0x4d79ea]),'ChatWebsiteId':Number(_0x4918b4[_0x48e3('0x4f')]['id'])});}}else{socket[_0x48e3('0x115')](_0x48e3('0x116'),{'UserId':Number(_0x4918b4[_0x48e3('0x2d')]['ids']),'ChatWebsiteId':Number(_0x4918b4[_0x48e3('0x4f')]['id'])});}});}})[_0x48e3('0x1f')](respondWithStatusCode(_0x1004fe,null))[_0x48e3('0x42')](handleError(_0x1004fe,null));};exports['getAgents']=function(_0xd51046,_0x13b970){var _0x2b3065={};var _0x649dc2={};var _0x28b484;var _0x25367b;return db[_0x48e3('0x27')]['findOne']({'where':{'id':_0xd51046['params']['id']}})['then'](handleEntityNotFound(_0x13b970,null))[_0x48e3('0x1f')](function(_0x3c3f34){if(_0x3c3f34){_0x28b484=_0x3c3f34;_0x649dc2[_0x48e3('0x2c')]=_[_0x48e3('0x2e')](db[_0x48e3('0xad')]['rawAttributes']);_0x649dc2[_0x48e3('0x2d')]=_[_0x48e3('0x2e')](_0xd51046[_0x48e3('0x2d')]);_0x649dc2[_0x48e3('0x2f')]=_['intersection'](_0x649dc2[_0x48e3('0x2c')],_0x649dc2[_0x48e3('0x2d')]);_0x2b3065[_0x48e3('0x32')]=_['intersection'](_0x649dc2[_0x48e3('0x2c')],qs['fields'](_0xd51046[_0x48e3('0x2d')][_0x48e3('0x31')]));_0x2b3065[_0x48e3('0x32')]=_0x2b3065[_0x48e3('0x32')][_0x48e3('0x33')]?_0x2b3065[_0x48e3('0x32')]:_0x649dc2[_0x48e3('0x2c')];_0x2b3065['order']=qs[_0x48e3('0x38')](_0xd51046[_0x48e3('0x2d')]['sort']);_0x2b3065[_0x48e3('0x3e')]=qs['filters'](_[_0x48e3('0x39')](_0xd51046[_0x48e3('0x2d')],_0x649dc2['filters']));if(_0xd51046[_0x48e3('0x2d')][_0x48e3('0x3a')]){_0x2b3065['where']=_[_0x48e3('0x3b')](_0x2b3065[_0x48e3('0x3e')],{'$or':_[_0x48e3('0x3c')](_0x2b3065[_0x48e3('0x32')],function(_0x2c71c6){var _0x1f0ae2={};_0x1f0ae2[_0x2c71c6]={'$like':'%'+_0xd51046[_0x48e3('0x2d')][_0x48e3('0x3a')]+'%'};return _0x1f0ae2;})});}_0x2b3065=_[_0x48e3('0x3b')]({},_0x2b3065,_0xd51046[_0x48e3('0x45')]);return _0x28b484[_0x48e3('0x117')](_0x2b3065);}})['then'](function(_0x22abd6){if(_0x22abd6){_0x25367b=_0x22abd6[_0x48e3('0x33')];if(!_0xd51046[_0x48e3('0x2d')]['hasOwnProperty']('nolimit')){_0x2b3065[_0x48e3('0x36')]=qs[_0x48e3('0x36')](_0xd51046['query'][_0x48e3('0x36')]);_0x2b3065['offset']=qs[_0x48e3('0x1b')](_0xd51046[_0x48e3('0x2d')]['offset']);}return _0x28b484[_0x48e3('0x117')](_0x2b3065);}})[_0x48e3('0x1f')](function(_0x1fb6cb){if(_0x1fb6cb){return _0x1fb6cb?{'count':_0x25367b,'rows':_0x1fb6cb}:null;}})[_0x48e3('0x1f')](respondWithResult(_0x13b970,null))['catch'](handleError(_0x13b970,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0eb7911..880cb95 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 _0xc73a=['hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit'];(function(_0x2a29d1,_0x504c11){var _0x3eec1e=function(_0x40e7e1){while(--_0x40e7e1){_0x2a29d1['push'](_0x2a29d1['shift']());}};_0x3eec1e(++_0x504c11);}(_0xc73a,0x72));var _0xac73=function(_0x5d8fa2,_0x23d173){_0x5d8fa2=_0x5d8fa2-0x0;var _0x2dee2f=_0xc73a[_0x5d8fa2];return _0x2dee2f;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xac73('0x0'))['db'][_0xac73('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xac73('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xac73('0x3')};function emitEvent(_0x1e4798){return function(_0x36d689,_0x53ef2e,_0x932e69){ChatWebsiteEvents[_0xac73('0x4')](_0x1e4798+':'+_0x36d689['id'],_0x36d689);ChatWebsiteEvents[_0xac73('0x4')](_0x1e4798,_0x36d689);_0x932e69(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xac73('0x5')](e,emitEvent(event));}}module[_0xac73('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x6c7b=['emit','hasOwnProperty','hook','events','save','remove'];(function(_0x28d6f7,_0x4dfc89){var _0x50d268=function(_0x5c4f5e){while(--_0x5c4f5e){_0x28d6f7['push'](_0x28d6f7['shift']());}};_0x50d268(++_0x4dfc89);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x56b5d1,_0x59be02){_0x56b5d1=_0x56b5d1-0x0;var _0x5bfe4a=_0x6c7b[_0x56b5d1];return _0x5bfe4a;};'use strict';var EventEmitter=require(_0xb6c7('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6c7('0x1'),'afterUpdate':'update','afterDestroy':_0xb6c7('0x2')};function emitEvent(_0x438aa8){return function(_0x35674b,_0x5857e0,_0x294dc9){ChatWebsiteEvents[_0xb6c7('0x3')](_0x438aa8+':'+_0x35674b['id'],_0x35674b);ChatWebsiteEvents[_0xb6c7('0x3')](_0x438aa8,_0x35674b);_0x294dc9(null);};}for(var e in events){if(events[_0xb6c7('0x4')](e)){var event=events[e];ChatWebsite[_0xb6c7('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b82649b..8918521 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 _0x1018=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','api','moment'];(function(_0x18dfcc,_0x1e3e5c){var _0x29d47e=function(_0x2e90e1){while(--_0x2e90e1){_0x18dfcc['push'](_0x18dfcc['shift']());}};_0x29d47e(++_0x1e3e5c);}(_0x1018,0xcd));var _0x8101=function(_0x21e30b,_0x18dfb0){_0x21e30b=_0x21e30b-0x0;var _0x525da6=_0x1018[_0x21e30b];return _0x525da6;};'use strict';var _=require(_0x8101('0x0'));var util=require(_0x8101('0x1'));var logger=require(_0x8101('0x2'))(_0x8101('0x3'));var moment=require(_0x8101('0x4'));var BPromise=require(_0x8101('0x5'));var rp=require(_0x8101('0x6'));var fs=require('fs');var path=require(_0x8101('0x7'));var rimraf=require(_0x8101('0x8'));var config=require(_0x8101('0x9'));var attributes=require(_0x8101('0xa'));module[_0x8101('0xb')]=function(_0x2a1412,_0x157a61){return _0x2a1412[_0x8101('0xc')](_0x8101('0xd'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdda=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1107ac,_0x45de13){var _0xe10cd=function(_0x5844a8){while(--_0x5844a8){_0x1107ac['push'](_0x1107ac['shift']());}};_0xe10cd(++_0x45de13);}(_0xfdda,0x171));var _0xafdd=function(_0x4e37bc,_0x8174e7){_0x4e37bc=_0x4e37bc-0x0;var _0x48a8b7=_0xfdda[_0x4e37bc];return _0x48a8b7;};'use strict';var _=require('lodash');var util=require(_0xafdd('0x0'));var logger=require(_0xafdd('0x1'))(_0xafdd('0x2'));var moment=require(_0xafdd('0x3'));var BPromise=require('bluebird');var rp=require(_0xafdd('0x4'));var fs=require('fs');var path=require(_0xafdd('0x5'));var rimraf=require(_0xafdd('0x6'));var config=require(_0xafdd('0x7'));var attributes=require(_0xafdd('0x8'));module[_0xafdd('0x9')]=function(_0x2b1142,_0x25c33f){return _0x2b1142[_0xafdd('0xa')](_0xafdd('0xb'),attributes,{'tableName':_0xafdd('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 2c83715..0732707 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 _0xb48a=['request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x3fdd08,_0x29d49){var _0x4c9e81=function(_0x43b6ee){while(--_0x43b6ee){_0x3fdd08['push'](_0x3fdd08['shift']());}};_0x4c9e81(++_0x29d49);}(_0xb48a,0x89));var _0xab48=function(_0x353d91,_0x4ef9d0){_0x353d91=_0x353d91-0x0;var _0x396155=_0xb48a[_0x353d91];return _0x396155;};'use strict';var _=require(_0xab48('0x0'));var util=require(_0xab48('0x1'));var moment=require('moment');var BPromise=require(_0xab48('0x2'));var rs=require(_0xab48('0x3'));var fs=require('fs');var Redis=require(_0xab48('0x4'));var db=require(_0xab48('0x5'))['db'];var utils=require(_0xab48('0x6'));var logger=require(_0xab48('0x7'))('rpc');var config=require(_0xab48('0x8'));var jayson=require(_0xab48('0x9'));var client=jayson[_0xab48('0xa')][_0xab48('0xb')]({'port':0x232a});config[_0xab48('0xc')]=_[_0xab48('0xd')](config[_0xab48('0xc')],{'host':_0xab48('0xe'),'port':0x18eb});var socket=require(_0xab48('0xf'))(new Redis(config['redis']));require(_0xab48('0x10'))[_0xab48('0x11')](socket);function respondWithRpcPromise(_0x14aa0b,_0x332ff9,_0x5adb86){return new BPromise(function(_0x288a04,_0x45e8c1){return client[_0xab48('0x12')](_0x14aa0b,_0x5adb86)[_0xab48('0x13')](function(_0x24f0f8){logger[_0xab48('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x332ff9,'request\x20sent');logger[_0xab48('0x15')](_0xab48('0x16'),_0x332ff9,_0xab48('0x17'),JSON[_0xab48('0x18')](_0x24f0f8));if(_0x24f0f8[_0xab48('0x19')]){if(_0x24f0f8[_0xab48('0x19')][_0xab48('0x1a')]===0x1f4){logger[_0xab48('0x19')](_0xab48('0x1b'),_0x332ff9,_0x24f0f8[_0xab48('0x19')][_0xab48('0x1c')]);return _0x45e8c1(_0x24f0f8[_0xab48('0x19')]['message']);}logger['error'](_0xab48('0x1b'),_0x332ff9,_0x24f0f8[_0xab48('0x19')][_0xab48('0x1c')]);return _0x288a04(_0x24f0f8[_0xab48('0x19')]['message']);}else{logger[_0xab48('0x14')](_0xab48('0x1b'),_0x332ff9,'request\x20sent');_0x288a04(_0x24f0f8[_0xab48('0x1d')][_0xab48('0x1c')]);}})[_0xab48('0x1e')](function(_0xc12c88){logger[_0xab48('0x19')](_0xab48('0x1b'),_0x332ff9,_0xc12c88);_0x45e8c1(_0xc12c88);});});} \ No newline at end of file +var _0x6f7c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x53e971,_0x1a6b00){var _0x85706d=function(_0x488e99){while(--_0x488e99){_0x53e971['push'](_0x53e971['shift']());}};_0x85706d(++_0x1a6b00);}(_0x6f7c,0x15a));var _0xc6f7=function(_0x325636,_0x47a944){_0x325636=_0x325636-0x0;var _0x2d4346=_0x6f7c[_0x325636];return _0x2d4346;};'use strict';var _=require('lodash');var util=require(_0xc6f7('0x0'));var moment=require(_0xc6f7('0x1'));var BPromise=require(_0xc6f7('0x2'));var rs=require(_0xc6f7('0x3'));var fs=require('fs');var Redis=require(_0xc6f7('0x4'));var db=require(_0xc6f7('0x5'))['db'];var utils=require(_0xc6f7('0x6'));var logger=require(_0xc6f7('0x7'))('rpc');var config=require(_0xc6f7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc6f7('0x9')][_0xc6f7('0xa')]({'port':0x232a});config['redis']=_[_0xc6f7('0xb')](config[_0xc6f7('0xc')],{'host':_0xc6f7('0xd'),'port':0x18eb});var socket=require(_0xc6f7('0xe'))(new Redis(config['redis']));require(_0xc6f7('0xf'))[_0xc6f7('0x10')](socket);function respondWithRpcPromise(_0x5aa009,_0x2533fd,_0x3a4a0f){return new BPromise(function(_0x4de3cc,_0x59fc2c){return client[_0xc6f7('0x11')](_0x5aa009,_0x3a4a0f)[_0xc6f7('0x12')](function(_0x46d051){logger[_0xc6f7('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2533fd,_0xc6f7('0x14'));logger[_0xc6f7('0x15')](_0xc6f7('0x16'),_0x2533fd,_0xc6f7('0x14'),JSON[_0xc6f7('0x17')](_0x46d051));if(_0x46d051['error']){if(_0x46d051[_0xc6f7('0x18')]['code']===0x1f4){logger[_0xc6f7('0x18')](_0xc6f7('0x19'),_0x2533fd,_0x46d051[_0xc6f7('0x18')][_0xc6f7('0x1a')]);return _0x59fc2c(_0x46d051[_0xc6f7('0x18')][_0xc6f7('0x1a')]);}logger[_0xc6f7('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x2533fd,_0x46d051[_0xc6f7('0x18')][_0xc6f7('0x1a')]);return _0x4de3cc(_0x46d051[_0xc6f7('0x18')][_0xc6f7('0x1a')]);}else{logger[_0xc6f7('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2533fd,_0xc6f7('0x14'));_0x4de3cc(_0x46d051[_0xc6f7('0x1b')][_0xc6f7('0x1a')]);}})[_0xc6f7('0x1c')](function(_0x1b7099){logger[_0xc6f7('0x18')](_0xc6f7('0x19'),_0x2533fd,_0x1b7099);_0x59fc2c(_0x1b7099);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index af561c0..a49be91 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 _0x70d5=['remove','update','emit','register','chatWebsite:','save'];(function(_0x21d47c,_0x2c0601){var _0x5f5850=function(_0x4fda1d){while(--_0x4fda1d){_0x21d47c['push'](_0x21d47c['shift']());}};_0x5f5850(++_0x2c0601);}(_0x70d5,0xbf));var _0x570d=function(_0xa73cb,_0x39b431){_0xa73cb=_0xa73cb-0x0;var _0x49a66d=_0x70d5[_0xa73cb];return _0x49a66d;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x570d('0x0'),_0x570d('0x1'),_0x570d('0x2')];function createListener(_0x2d373a,_0x122c2e){return function(_0x27b5d9){_0x122c2e[_0x570d('0x3')](_0x2d373a,_0x27b5d9);};}function removeListener(_0x446eac,_0x3539fb){return function(){ChatWebsiteEvents['removeListener'](_0x446eac,_0x3539fb);};}exports[_0x570d('0x4')]=function(_0x3e8bf1){for(var _0x35bac1=0x0,_0x56ae9c=events['length'];_0x35bac1<_0x56ae9c;_0x35bac1++){var _0x25a0e0=events[_0x35bac1];var _0x2edb0f=createListener(_0x570d('0x5')+_0x25a0e0,_0x3e8bf1);ChatWebsiteEvents['on'](_0x25a0e0,_0x2edb0f);}}; \ No newline at end of file +var _0xee00=['chatWebsite:','./chatWebsite.events','save','update','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee00,0x6d));var _0x0ee0=function(_0x342c6c,_0x3540ee){_0x342c6c=_0x342c6c-0x0;var _0x55c059=_0xee00[_0x342c6c];return _0x55c059;};'use strict';var ChatWebsiteEvents=require(_0x0ee0('0x0'));var events=[_0x0ee0('0x1'),'remove',_0x0ee0('0x2')];function createListener(_0x3094c7,_0x5ecd37){return function(_0x51cb22){_0x5ecd37['emit'](_0x3094c7,_0x51cb22);};}function removeListener(_0x5029e2,_0x255364){return function(){ChatWebsiteEvents[_0x0ee0('0x3')](_0x5029e2,_0x255364);};}exports['register']=function(_0x4587ec){for(var _0x15523a=0x0,_0x5cf367=events[_0x0ee0('0x4')];_0x15523a<_0x5cf367;_0x15523a++){var _0x12ab4e=events[_0x15523a];var _0x57ae4c=createListener(_0x0ee0('0x5')+_0x12ab4e,_0x4587ec);ChatWebsiteEvents['on'](_0x12ab4e,_0x57ae4c);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 87a3b65..8be97db 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 _0x87d6=['/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','single','file','addLogo','server/files/images/avatars/','format','originalname','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','addProactiveActions','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','/:id','show','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions'];(function(_0x56d49c,_0x4898c9){var _0x3e22d3=function(_0x1e0036){while(--_0x1e0036){_0x56d49c['push'](_0x56d49c['shift']());}};_0x3e22d3(++_0x4898c9);}(_0x87d6,0x1c7));var _0x687d=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x87d6[_0x1d2bbb];return _0x38082b;};'use strict';var multer=require('multer');var util=require(_0x687d('0x0'));var path=require(_0x687d('0x1'));var timeout=require(_0x687d('0x2'));var express=require('express');var router=express[_0x687d('0x3')]();var fs_extra=require(_0x687d('0x4'));var auth=require(_0x687d('0x5'));var interaction=require(_0x687d('0x6'));var config=require(_0x687d('0x7'));var controller=require(_0x687d('0x8'));router[_0x687d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x687d('0x9')](_0x687d('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x687d('0x9')](_0x687d('0xb'),auth['isAuthenticated'](),controller[_0x687d('0xc')]);router[_0x687d('0x9')]('/:id/dispositions',auth[_0x687d('0xd')](),controller[_0x687d('0xe')]);router[_0x687d('0x9')](_0x687d('0xf'),auth['isAuthenticated'](),controller[_0x687d('0x10')]);router[_0x687d('0x9')](_0x687d('0x11'),controller['getLogo']);router[_0x687d('0x9')](_0x687d('0x12'),controller[_0x687d('0x13')]);router[_0x687d('0x9')](_0x687d('0x14'),controller[_0x687d('0x15')]);router[_0x687d('0x9')]('/:id/system_avatar',controller[_0x687d('0x16')]);router[_0x687d('0x9')](_0x687d('0x17'),auth[_0x687d('0xd')](),controller[_0x687d('0x18')]);router[_0x687d('0x9')]('/:id/snippet',controller[_0x687d('0x19')]);router[_0x687d('0x9')]('/:id/applications',auth[_0x687d('0xd')](),controller['getApplications']);router[_0x687d('0x9')](_0x687d('0x1a'),auth['isAuthenticated'](),controller[_0x687d('0x1b')]);router[_0x687d('0x9')](_0x687d('0x1c'),controller[_0x687d('0x1d')]);router[_0x687d('0x9')](_0x687d('0x1e'),auth[_0x687d('0xd')](),controller[_0x687d('0x1f')]);router[_0x687d('0x9')](_0x687d('0x20'),auth[_0x687d('0xd')](),controller['getAgents']);router[_0x687d('0x21')]('/',auth[_0x687d('0xd')](),controller[_0x687d('0x22')]);router[_0x687d('0x21')]('/:id/dispositions',auth[_0x687d('0xd')](),controller[_0x687d('0x23')]);router[_0x687d('0x21')](_0x687d('0xf'),auth[_0x687d('0xd')](),controller[_0x687d('0x24')]);var upload=multer({'storage':multer[_0x687d('0x25')]({'destination':function(_0x3140e1,_0x47a86d,_0x17f908){_0x17f908(null,path[_0x687d('0x26')](config[_0x687d('0x27')],_0x687d('0x28')));},'filename':function(_0x4af678,_0x5d97fa,_0x4f88cd){_0x4f88cd(null,util['format'](_0x687d('0x29'),Date[_0x687d('0x2a')](),_0x5d97fa['originalname']));}})});router['post'](_0x687d('0x11'),upload[_0x687d('0x2b')](_0x687d('0x2c')),controller[_0x687d('0x2d')]);var upload=multer({'storage':multer[_0x687d('0x25')]({'destination':function(_0x4ee429,_0x380eb8,_0x198889){_0x198889(null,path['join'](config[_0x687d('0x27')],_0x687d('0x2e')));},'filename':function(_0x17f963,_0x5c4ca2,_0x57e405){_0x57e405(null,util[_0x687d('0x2f')](_0x687d('0x29'),Date[_0x687d('0x2a')](),_0x5c4ca2[_0x687d('0x30')]));}})});router['post'](_0x687d('0x12'),upload[_0x687d('0x2b')](_0x687d('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0x687d('0x25')]({'destination':function(_0x16e60b,_0x4bdd39,_0x5360aa){_0x5360aa(null,path['join'](config[_0x687d('0x27')],_0x687d('0x2e')));},'filename':function(_0x165e37,_0x2cf586,_0x52ee9b){_0x52ee9b(null,util[_0x687d('0x2f')](_0x687d('0x29'),Date['now'](),_0x2cf586[_0x687d('0x30')]));}})});router[_0x687d('0x21')](_0x687d('0x14'),upload[_0x687d('0x2b')](_0x687d('0x2c')),controller[_0x687d('0x31')]);var upload=multer({'storage':multer[_0x687d('0x25')]({'destination':function(_0x44becd,_0xe84e3e,_0x1744d7){_0x1744d7(null,path[_0x687d('0x26')](config[_0x687d('0x27')],_0x687d('0x2e')));},'filename':function(_0x4c7316,_0x5474f3,_0x1a671a){_0x1a671a(null,util['format'](_0x687d('0x29'),Date[_0x687d('0x2a')](),_0x5474f3[_0x687d('0x30')]));}})});router['post'](_0x687d('0x32'),upload[_0x687d('0x2b')](_0x687d('0x2c')),controller[_0x687d('0x33')]);router[_0x687d('0x21')]('/:id/notify',controller[_0x687d('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x687d('0x25')]({'destination':function(_0x2b0e87,_0x44453d,_0x51ce17){const _0x57437b=path[_0x687d('0x26')](config[_0x687d('0x27')],_0x687d('0x35'),'attachments',_0x687d('0x36'));fs_extra[_0x687d('0x37')](_0x57437b,function(){_0x51ce17(null,_0x57437b);});},'filename':function(_0x42e94f,_0x1a5854,_0x4fa1f4){const _0x3375c1=_0x1a5854[_0x687d('0x30')][_0x687d('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x166621=path[_0x687d('0x39')](_0x3375c1);const _0x2a417e=Date[_0x687d('0x2a')]()+'-'+_0x3375c1[_0x687d('0x38')](_0x166621,'')+_0x166621;_0x4fa1f4(null,_0x2a417e);}})});router[_0x687d('0x21')]('/:id/offline',offlineUploadMulter[_0x687d('0x3a')](),controller[_0x687d('0x3b')]);router[_0x687d('0x21')](_0x687d('0x17'),auth[_0x687d('0xd')](),controller[_0x687d('0x3c')]);router[_0x687d('0x21')]('/:id/applications',auth['isAuthenticated'](),controller[_0x687d('0x3d')]);router[_0x687d('0x21')]('/:id/proactive_actions',auth[_0x687d('0xd')](),controller[_0x687d('0x3e')]);router[_0x687d('0x21')](_0x687d('0x20'),auth[_0x687d('0xd')](),controller['addAgents']);router[_0x687d('0x3f')](_0x687d('0xb'),auth[_0x687d('0xd')](),controller[_0x687d('0x40')]);router[_0x687d('0x41')](_0x687d('0xb'),auth['isAuthenticated'](),controller[_0x687d('0x42')]);router[_0x687d('0x41')]('/:id/dispositions',auth[_0x687d('0xd')](),controller['removeDispositions']);router['delete'](_0x687d('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x687d('0x41')](_0x687d('0x20'),auth[_0x687d('0xd')](),controller[_0x687d('0x43')]);module[_0x687d('0x44')]=router; \ No newline at end of file +var _0x84a1=['addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','/:id/fields','/:id/users','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','single','file','addLogo','join','server/files/images/avatars/','now','addAvatar','originalname','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','extname','/:id/offline','any','offline','addInteraction'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x84a1,0x1ba));var _0x184a=function(_0x37b14e,_0x3a79bb){_0x37b14e=_0x37b14e-0x0;var _0x42d59d=_0x84a1[_0x37b14e];return _0x42d59d;};'use strict';var multer=require(_0x184a('0x0'));var util=require(_0x184a('0x1'));var path=require(_0x184a('0x2'));var timeout=require(_0x184a('0x3'));var express=require(_0x184a('0x4'));var router=express['Router']();var fs_extra=require(_0x184a('0x5'));var auth=require(_0x184a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x184a('0x7'));router['get']('/',auth[_0x184a('0x8')](),controller[_0x184a('0x9')]);router[_0x184a('0xa')](_0x184a('0xb'),auth['isAuthenticated'](),controller[_0x184a('0xc')]);router[_0x184a('0xa')](_0x184a('0xd'),auth[_0x184a('0x8')](),controller[_0x184a('0xe')]);router['get'](_0x184a('0xf'),auth[_0x184a('0x8')](),controller[_0x184a('0x10')]);router[_0x184a('0xa')](_0x184a('0x11'),auth[_0x184a('0x8')](),controller[_0x184a('0x12')]);router['get'](_0x184a('0x13'),controller['getLogo']);router[_0x184a('0xa')](_0x184a('0x14'),controller[_0x184a('0x15')]);router['get'](_0x184a('0x16'),controller[_0x184a('0x17')]);router[_0x184a('0xa')]('/:id/system_avatar',controller[_0x184a('0x18')]);router[_0x184a('0xa')](_0x184a('0x19'),auth[_0x184a('0x8')](),controller[_0x184a('0x1a')]);router[_0x184a('0xa')](_0x184a('0x1b'),controller['getSnippet']);router[_0x184a('0xa')](_0x184a('0x1c'),auth[_0x184a('0x8')](),controller['getApplications']);router[_0x184a('0xa')](_0x184a('0x1d'),auth[_0x184a('0x8')](),controller['getProactiveActions']);router[_0x184a('0xa')](_0x184a('0x1e'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0x184a('0x8')](),controller['getOfflineMessages']);router[_0x184a('0xa')](_0x184a('0x1f'),auth[_0x184a('0x8')](),controller['getAgents']);router[_0x184a('0x20')]('/',auth[_0x184a('0x8')](),controller[_0x184a('0x21')]);router[_0x184a('0x20')]('/:id/dispositions',auth[_0x184a('0x8')](),controller[_0x184a('0x22')]);router[_0x184a('0x20')](_0x184a('0x11'),auth[_0x184a('0x8')](),controller[_0x184a('0x23')]);var upload=multer({'storage':multer[_0x184a('0x24')]({'destination':function(_0x3e0af9,_0xdd54bc,_0x32e48e){_0x32e48e(null,path['join'](config[_0x184a('0x25')],_0x184a('0x26')));},'filename':function(_0x99f5b3,_0x1751e8,_0x58af80){_0x58af80(null,util[_0x184a('0x27')](_0x184a('0x28'),Date['now'](),_0x1751e8['originalname']));}})});router['post'](_0x184a('0x13'),upload[_0x184a('0x29')](_0x184a('0x2a')),controller[_0x184a('0x2b')]);var upload=multer({'storage':multer[_0x184a('0x24')]({'destination':function(_0x3f7a2c,_0x45dac2,_0x125ae7){_0x125ae7(null,path[_0x184a('0x2c')](config[_0x184a('0x25')],_0x184a('0x2d')));},'filename':function(_0x5d553b,_0x2fd7a8,_0x394f62){_0x394f62(null,util[_0x184a('0x27')](_0x184a('0x28'),Date[_0x184a('0x2e')](),_0x2fd7a8['originalname']));}})});router[_0x184a('0x20')]('/:id/avatar',upload['single'](_0x184a('0x2a')),controller[_0x184a('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5743a0,_0x467895,_0x8a56d0){_0x8a56d0(null,path[_0x184a('0x2c')](config['root'],_0x184a('0x2d')));},'filename':function(_0x3d0fee,_0x3996eb,_0x4b66b8){_0x4b66b8(null,util[_0x184a('0x27')](_0x184a('0x28'),Date[_0x184a('0x2e')](),_0x3996eb[_0x184a('0x30')]));}})});router['post']('/:id/customer_avatar',upload[_0x184a('0x29')](_0x184a('0x2a')),controller[_0x184a('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9c3fe6,_0x1f40e4,_0xf0dc83){_0xf0dc83(null,path['join'](config[_0x184a('0x25')],_0x184a('0x2d')));},'filename':function(_0x1c6d7a,_0x14f8d7,_0x549fc8){_0x549fc8(null,util[_0x184a('0x27')]('%s-%s',Date[_0x184a('0x2e')](),_0x14f8d7[_0x184a('0x30')]));}})});router[_0x184a('0x20')](_0x184a('0x32'),upload[_0x184a('0x29')](_0x184a('0x2a')),controller[_0x184a('0x33')]);router[_0x184a('0x20')](_0x184a('0x34'),controller[_0x184a('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x184a('0x24')]({'destination':function(_0x2f1fd9,_0xcdc0f,_0x188ef7){const _0x43f0c5=path[_0x184a('0x2c')](config[_0x184a('0x25')],_0x184a('0x36'),_0x184a('0x37'),_0x184a('0x38'));fs_extra['ensureDir'](_0x43f0c5,function(){_0x188ef7(null,_0x43f0c5);});},'filename':function(_0x36b758,_0x156a96,_0x4491ba){const _0x5b01e6=_0x156a96[_0x184a('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x553301=path[_0x184a('0x39')](_0x5b01e6);const _0x11047b=Date[_0x184a('0x2e')]()+'-'+_0x5b01e6['replace'](_0x553301,'')+_0x553301;_0x4491ba(null,_0x11047b);}})});router[_0x184a('0x20')](_0x184a('0x3a'),offlineUploadMulter[_0x184a('0x3b')](),controller[_0x184a('0x3c')]);router[_0x184a('0x20')](_0x184a('0x19'),auth[_0x184a('0x8')](),controller[_0x184a('0x3d')]);router[_0x184a('0x20')]('/:id/applications',auth[_0x184a('0x8')](),controller[_0x184a('0x3e')]);router[_0x184a('0x20')](_0x184a('0x1d'),auth[_0x184a('0x8')](),controller[_0x184a('0x3f')]);router[_0x184a('0x20')](_0x184a('0x1f'),auth['isAuthenticated'](),controller[_0x184a('0x40')]);router[_0x184a('0x41')](_0x184a('0xd'),auth[_0x184a('0x8')](),controller[_0x184a('0x42')]);router[_0x184a('0x43')](_0x184a('0xd'),auth[_0x184a('0x8')](),controller[_0x184a('0x44')]);router[_0x184a('0x43')](_0x184a('0xf'),auth[_0x184a('0x8')](),controller[_0x184a('0x45')]);router['delete'](_0x184a('0x11'),auth[_0x184a('0x8')](),controller[_0x184a('0x46')]);router[_0x184a('0x43')](_0x184a('0x1f'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x184a('0x47')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 05d69ca..94c1361 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2861=['Router','production','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','beaver-logger/server','../components/auth/service','../config/environment'];(function(_0x13fa45,_0x4a0b91){var _0x275a44=function(_0x69d994){while(--_0x69d994){_0x13fa45['push'](_0x13fa45['shift']());}};_0x275a44(++_0x4a0b91);}(_0x2861,0x15c));var _0x1286=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x2861[_0x30abff];return _0x4c571e;};var beaverLogger=require(_0x1286('0x0'));var express=require('express');var auth=require(_0x1286('0x1'));var config=require(_0x1286('0x2'));var router=express[_0x1286('0x3')]();var isProduction=config['env']===_0x1286('0x4')||![];function clientSideLogs(_0x5c11a7,_0x3483b7,_0x2fb5fd){var _0x5f03aa=_0x5c11a7['app']['get']('client-side-logger');if(!_0x5f03aa){throw new Error(_0x1286('0x5'));}return beaverLogger[_0x1286('0x6')]({'uri':'/client-logs','logger':_0x5f03aa,'enableCors':!isProduction})(_0x5c11a7,_0x3483b7,_0x2fb5fd);}router[_0x1286('0x7')](auth[_0x1286('0x8')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x0931=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','Router','production','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x55eccf,_0x1530aa){var _0x2bc059=function(_0x276719){while(--_0x276719){_0x55eccf['push'](_0x55eccf['shift']());}};_0x2bc059(++_0x1530aa);}(_0x0931,0xb4));var _0x1093=function(_0x185543,_0x1305c0){_0x185543=_0x185543-0x0;var _0x92ecb0=_0x0931[_0x185543];return _0x92ecb0;};var beaverLogger=require(_0x1093('0x0'));var express=require(_0x1093('0x1'));var auth=require('../components/auth/service');var config=require(_0x1093('0x2'));var router=express[_0x1093('0x3')]();var isProduction=config['env']===_0x1093('0x4')||![];function clientSideLogs(_0x1c3881,_0x24a634,_0x4f66d0){var _0x2cdd29=_0x1c3881['app']['get'](_0x1093('0x5'));if(!_0x2cdd29){throw new Error(_0x1093('0x6'));}return beaverLogger['expressEndpoint']({'uri':_0x1093('0x7'),'logger':_0x2cdd29,'enableCors':!isProduction})(_0x1c3881,_0x24a634,_0x4f66d0);}router[_0x1093('0x8')](auth[_0x1093('0x9')](),clientSideLogs);module[_0x1093('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index dc3feb5..40a2c65 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d65=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x2247fb,_0x2690c4){var _0x428383=function(_0x13945f){while(--_0x13945f){_0x2247fb['push'](_0x2247fb['shift']());}};_0x428383(++_0x2690c4);}(_0x9d65,0x1a9));var _0x59d6=function(_0x348a12,_0x497903){_0x348a12=_0x348a12-0x0;var _0x57dab5=_0x9d65[_0x348a12];return _0x57dab5;};'use strict';var Sequelize=require('sequelize');module[_0x59d6('0x0')]={'name':{'type':Sequelize[_0x59d6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x59d6('0x2')](_0x59d6('0x3'),_0x59d6('0x4'),_0x59d6('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x59d6('0x6'))},'data1':{'type':Sequelize[_0x59d6('0x1')],'comment':_0x59d6('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x59d6('0x8')},'data3':{'type':Sequelize[_0x59d6('0x1')],'comment':_0x59d6('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x59d6('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0x59d6('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x59d6('0xc')],'comment':_0x59d6('0xd')}}; \ No newline at end of file +var _0xd4d2=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x100268,_0x572d6d){var _0x378b1f=function(_0x5e414a){while(--_0x5e414a){_0x100268['push'](_0x100268['shift']());}};_0x378b1f(++_0x572d6d);}(_0xd4d2,0x9b));var _0x2d4d=function(_0x1d517a,_0x12a6f8){_0x1d517a=_0x1d517a-0x0;var _0x102e48=_0xd4d2[_0x1d517a];return _0x102e48;};'use strict';var Sequelize=require(_0x2d4d('0x0'));module[_0x2d4d('0x1')]={'name':{'type':Sequelize[_0x2d4d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2d4d('0x3')](_0x2d4d('0x4'),_0x2d4d('0x5'),_0x2d4d('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2d4d('0x3')]('Outlook365',_0x2d4d('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x2d4d('0x2')],'comment':_0x2d4d('0x8')},'data3':{'type':Sequelize[_0x2d4d('0x2')],'comment':_0x2d4d('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x2d4d('0xa')},'data5':{'type':Sequelize[_0x2d4d('0xb')],'comment':_0x2d4d('0xc')},'data6':{'type':Sequelize[_0x2d4d('0xb')],'comment':_0x2d4d('0xd')},'data7':{'type':Sequelize[_0x2d4d('0xb')],'comment':_0x2d4d('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9989a2c..93b978d 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa120=['defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','count','Content-Range','update','then','stack','name','send','padEnd','slice','index','map','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','params','service','catch','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','message','lodash','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis'];(function(_0x3a44cd,_0x3aa114){var _0x45ac5c=function(_0x2ead14){while(--_0x2ead14){_0x3a44cd['push'](_0x3a44cd['shift']());}};_0x45ac5c(++_0x3aa114);}(_0xa120,0xae));var _0x0a12=function(_0x14c179,_0x42b7b3){_0x14c179=_0x14c179-0x0;var _0x121432=_0xa120[_0x14c179];return _0x121432;};'use strict';var _=require(_0x0a12('0x0'));var Redis=require(_0x0a12('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x0a12('0x2'));var config=require('../../config/environment');var logger=require(_0x0a12('0x3'))(_0x0a12('0x4'));var db=require(_0x0a12('0x5'))['db'];var oauth=require(_0x0a12('0x6'));config[_0x0a12('0x7')]=_[_0x0a12('0x8')](config[_0x0a12('0x7')],{'host':_0x0a12('0x9'),'port':0x18eb});var socket=require(_0x0a12('0xa'))(new Redis(config[_0x0a12('0x7')]));var redis=new Redis(config[_0x0a12('0x7')]);function respondWithStatusCode(_0x391852,_0x1d7c89){_0x1d7c89=_0x1d7c89||0xcc;return function(_0x1ba19f){if(_0x1ba19f){return _0x391852[_0x0a12('0xb')](_0x1d7c89);}return _0x391852['status'](_0x1d7c89)[_0x0a12('0xc')]();};}function respondWithResult(_0x4c9851,_0x21e8de){_0x21e8de=_0x21e8de||0xc8;return function(_0x2b4f8c){if(_0x2b4f8c){return _0x4c9851[_0x0a12('0xd')](_0x21e8de)[_0x0a12('0xe')](_0x2b4f8c);}};}function respondWithFilteredResult(_0x49ca2e,_0x2b9939){return function(_0x1abd7a){if(_0x1abd7a){var _0x362824=typeof _0x2b9939[_0x0a12('0xf')]===_0x0a12('0x10')&&typeof _0x2b9939['limit']===_0x0a12('0x10');var _0x49e451=_0x1abd7a[_0x0a12('0x11')];var _0x11f85d=_0x362824?0x0:_0x2b9939[_0x0a12('0xf')];var _0x4cacdb=_0x362824?_0x1abd7a[_0x0a12('0x11')]:_0x2b9939[_0x0a12('0xf')]+_0x2b9939['limit'];var _0x4a464a;if(_0x4cacdb>=_0x49e451){_0x4cacdb=_0x49e451;_0x4a464a=0xc8;}else{_0x4a464a=0xce;}_0x49ca2e[_0x0a12('0xd')](_0x4a464a);return _0x49ca2e['set'](_0x0a12('0x12'),_0x11f85d+'-'+_0x4cacdb+'/'+_0x49e451)[_0x0a12('0xe')](_0x1abd7a);}return null;};}function saveUpdates(_0x763b10){return function(_0x37fa7b){if(_0x37fa7b){return _0x37fa7b[_0x0a12('0x13')](_0x763b10)[_0x0a12('0x14')](function(_0x82a400){return _0x82a400;});}return null;};}function removeEntity(_0x30abed){return function(_0x1ac9a0){if(_0x1ac9a0){return _0x1ac9a0['destroy']()[_0x0a12('0x14')](function(){_0x30abed[_0x0a12('0xd')](0xcc)[_0x0a12('0xc')]();});}};}function handleEntityNotFound(_0x44add6){return function(_0x741933){if(!_0x741933){_0x44add6[_0x0a12('0xb')](0x194);}return _0x741933;};}function handleError(_0x2b38f0,_0x37782d){_0x37782d=_0x37782d||0x1f4;return function(_0x461f9e){logger['error'](_0x461f9e[_0x0a12('0x15')]);if(_0x461f9e[_0x0a12('0x16')]){delete _0x461f9e['name'];}_0x2b38f0[_0x0a12('0xd')](_0x37782d)[_0x0a12('0x17')](_0x461f9e);};}function maskClientSecret(_0x149c99){return _[_0x0a12('0x18')](_0x149c99[_0x0a12('0x19')](0x0,0x3),0x14,'*');}exports[_0x0a12('0x1a')]=function(_0x241968,_0x2bc259){var _0x3fbd0e={},_0x523360={},_0x5b9b32={'count':0x0,'rows':[]};var _0x5dc72f=_[_0x0a12('0x1b')](db['CloudProvider'][_0x0a12('0x1c')],function(_0x56d459){return{'name':_0x56d459[_0x0a12('0x1d')],'type':_0x56d459['type']['key']};});_0x523360[_0x0a12('0x1e')]=_[_0x0a12('0x1b')](_0x5dc72f,_0x0a12('0x16'));_0x523360[_0x0a12('0x1f')]=_[_0x0a12('0x20')](_0x241968[_0x0a12('0x1f')]);_0x523360['filters']=_['intersection'](_0x523360[_0x0a12('0x1e')],_0x523360[_0x0a12('0x1f')]);_0x3fbd0e[_0x0a12('0x21')]=_[_0x0a12('0x22')](_0x523360[_0x0a12('0x1e')],qs[_0x0a12('0x23')](_0x241968[_0x0a12('0x1f')][_0x0a12('0x23')]));_0x3fbd0e[_0x0a12('0x21')]=_0x3fbd0e[_0x0a12('0x21')][_0x0a12('0x24')]?_0x3fbd0e[_0x0a12('0x21')]:_0x523360[_0x0a12('0x1e')];if(!_0x241968[_0x0a12('0x1f')][_0x0a12('0x25')]('nolimit')){_0x3fbd0e[_0x0a12('0x26')]=qs['limit'](_0x241968[_0x0a12('0x1f')][_0x0a12('0x26')]);_0x3fbd0e[_0x0a12('0xf')]=qs[_0x0a12('0xf')](_0x241968[_0x0a12('0x1f')][_0x0a12('0xf')]);}_0x3fbd0e[_0x0a12('0x27')]=qs['sort'](_0x241968[_0x0a12('0x1f')][_0x0a12('0x28')]);_0x3fbd0e[_0x0a12('0x29')]=qs[_0x0a12('0x2a')](_[_0x0a12('0x2b')](_0x241968[_0x0a12('0x1f')],_0x523360[_0x0a12('0x2a')]),_0x5dc72f);if(_0x241968[_0x0a12('0x1f')]['filter']){_0x3fbd0e[_0x0a12('0x29')]=_[_0x0a12('0x2c')](_0x3fbd0e[_0x0a12('0x29')],{'$or':_[_0x0a12('0x1b')](_0x5dc72f,function(_0x3cb57d){if(_0x3cb57d[_0x0a12('0x2d')]!==_0x0a12('0x2e')){var _0x12e487={};_0x12e487[_0x3cb57d['name']]={'$like':'%'+_0x241968[_0x0a12('0x1f')]['filter']+'%'};return _0x12e487;}})});}_0x3fbd0e=_[_0x0a12('0x2c')]({},_0x3fbd0e,_0x241968[_0x0a12('0x2f')]);var _0xf1ca60={'where':_0x3fbd0e[_0x0a12('0x29')]};return db[_0x0a12('0x30')][_0x0a12('0x11')](_0xf1ca60)[_0x0a12('0x14')](function(_0x5a94fc){_0x5b9b32['count']=_0x5a94fc;if(_0x241968[_0x0a12('0x1f')][_0x0a12('0x31')]){_0x3fbd0e[_0x0a12('0x32')]=[{'all':!![]}];}return db[_0x0a12('0x30')][_0x0a12('0x33')](_0x3fbd0e);})[_0x0a12('0x14')](function(_0x28f818){_0x5b9b32[_0x0a12('0x34')]=_[_0x0a12('0x1b')](_0x28f818,function(_0x2236d7){if(_0x2236d7['service']===_0x0a12('0x35')){var _0x2c7f7c=encryptor[_0x0a12('0x36')](_0x2236d7[_0x0a12('0x37')]);_0x2236d7['data3']=maskClientSecret(_0x2c7f7c);}return _0x2236d7;});return _0x5b9b32;})[_0x0a12('0x14')](respondWithFilteredResult(_0x2bc259,_0x3fbd0e))['catch'](handleError(_0x2bc259,null));};exports['show']=function(_0x1c69b2,_0x1c19f4){var _0x11b1db={'raw':!![],'where':{'id':_0x1c69b2[_0x0a12('0x38')]['id']}},_0x5e0c7c={};_0x5e0c7c[_0x0a12('0x1e')]=_[_0x0a12('0x20')](db[_0x0a12('0x30')][_0x0a12('0x1c')]);_0x5e0c7c['query']=_['keys'](_0x1c69b2['query']);_0x5e0c7c[_0x0a12('0x2a')]=_[_0x0a12('0x22')](_0x5e0c7c[_0x0a12('0x1e')],_0x5e0c7c['query']);_0x11b1db['attributes']=_[_0x0a12('0x22')](_0x5e0c7c[_0x0a12('0x1e')],qs[_0x0a12('0x23')](_0x1c69b2[_0x0a12('0x1f')][_0x0a12('0x23')]));_0x11b1db['attributes']=_0x11b1db[_0x0a12('0x21')][_0x0a12('0x24')]?_0x11b1db['attributes']:_0x5e0c7c['model'];if(_0x1c69b2[_0x0a12('0x1f')][_0x0a12('0x31')]){_0x11b1db[_0x0a12('0x32')]=[{'all':!![]}];}_0x11b1db=_['merge']({},_0x11b1db,_0x1c69b2[_0x0a12('0x2f')]);return db[_0x0a12('0x30')]['find'](_0x11b1db)[_0x0a12('0x14')](handleEntityNotFound(_0x1c19f4,null))[_0x0a12('0x14')](function(_0x29c398){if(_0x29c398[_0x0a12('0x39')]===_0x0a12('0x35')){var _0x4f8ef2=encryptor[_0x0a12('0x36')](_0x29c398['data3']);_0x29c398[_0x0a12('0x37')]=maskClientSecret(_0x4f8ef2);}return _0x29c398;})['then'](respondWithResult(_0x1c19f4,null))[_0x0a12('0x3a')](handleError(_0x1c19f4,null));};exports['create']=function(_0x1443e1,_0x565a28){if(!_0x1443e1[_0x0a12('0x3b')]['name'])throw new Error(_0x0a12('0x3c'));if(!_0x1443e1[_0x0a12('0x3b')][_0x0a12('0x39')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3cad96=db[_0x0a12('0x30')][_0x0a12('0x1c')][_0x0a12('0x39')][_0x0a12('0x3d')];if(!_0x3cad96[_0x0a12('0x3e')](_0x1443e1[_0x0a12('0x3b')][_0x0a12('0x39')]))throw new Error(_0x0a12('0x3f')+_0x3cad96[_0x0a12('0x40')](',\x20'));if(_0x1443e1['body'][_0x0a12('0x39')]===_0x0a12('0x35')&&_0x1443e1[_0x0a12('0x3b')][_0x0a12('0x37')]){_0x1443e1['body'][_0x0a12('0x37')]=encryptor[_0x0a12('0x41')](_0x1443e1['body'][_0x0a12('0x37')]);}return db[_0x0a12('0x30')]['create'](_0x1443e1['body'],{})[_0x0a12('0x14')](respondWithResult(_0x565a28,0xc9))[_0x0a12('0x3a')](handleError(_0x565a28,null));};exports['update']=function(_0x262c91,_0x217b53){if(_0x262c91[_0x0a12('0x3b')]['id']){delete _0x262c91[_0x0a12('0x3b')]['id'];}return db[_0x0a12('0x30')][_0x0a12('0x42')]({'where':{'id':_0x262c91[_0x0a12('0x38')]['id']}})['then'](handleEntityNotFound(_0x217b53,null))[_0x0a12('0x14')](function(_0xcd2d57){if(_0xcd2d57[_0x0a12('0x39')]===_0x0a12('0x35')&&_0x262c91[_0x0a12('0x3b')]['data3']){_0x262c91[_0x0a12('0x3b')][_0x0a12('0x37')]=encryptor[_0x0a12('0x41')](_0x262c91[_0x0a12('0x3b')][_0x0a12('0x37')]);}return _0xcd2d57;})['then'](saveUpdates(_0x262c91[_0x0a12('0x3b')],null))[_0x0a12('0x14')](respondWithResult(_0x217b53,null))[_0x0a12('0x3a')](handleError(_0x217b53,null));};exports[_0x0a12('0x43')]=function(_0x6ab8b7,_0x5ac1f5){return db['CloudProvider']['find']({'where':{'id':_0x6ab8b7[_0x0a12('0x38')]['id']}})[_0x0a12('0x14')](handleEntityNotFound(_0x5ac1f5,null))[_0x0a12('0x14')](removeEntity(_0x5ac1f5,null))[_0x0a12('0x3a')](handleError(_0x5ac1f5,null));};exports[_0x0a12('0x44')]=function(_0x229309,_0x3b2041){return db['CloudProvider']['findOne']({'where':{'id':_0x229309[_0x0a12('0x38')]['id']},'raw':!![]})[_0x0a12('0x14')](function(_0x27d4d8){if(!_0x27d4d8)return _0x3b2041[_0x0a12('0xb')](0x194);return{'url':oauth[_0x0a12('0x45')](_0x27d4d8,_0x229309[_0x0a12('0x46')]['id'])};})[_0x0a12('0x14')](respondWithResult(_0x3b2041,null))[_0x0a12('0x3a')](handleError(_0x3b2041,null));};exports[_0x0a12('0x47')]=function(_0x4be119,_0x53a037){var _0x35bb31=_0x4be119[_0x0a12('0x3b')];var _0x9d926d;var _0x3070e3;if(_0x35bb31[_0x0a12('0x48')])throw _0x35bb31;redis[_0x0a12('0x49')](_0x35bb31[_0x0a12('0x4a')])[_0x0a12('0x14')](function(_0x434ad6){if(!_0x434ad6)throw new Error(_0x0a12('0x4b'));_0x9d926d=JSON[_0x0a12('0x4c')](_0x434ad6);var _0xc4ce3a=Buffer[_0x0a12('0x4d')](_0x35bb31[_0x0a12('0x4a')],'base64')[_0x0a12('0x4e')](_0x0a12('0x4f'));_0x3070e3=JSON[_0x0a12('0x4c')](_0xc4ce3a);if(!oauth[_0x0a12('0x50')](_0x35bb31[_0x0a12('0x51')],_0x9d926d['oauth2Claims']))throw new Error(_0x0a12('0x52'));redis['del'](_0x35bb31[_0x0a12('0x4a')]);return oauth[_0x0a12('0x53')](_0x35bb31[_0x0a12('0x54')],_0x9d926d);})[_0x0a12('0x14')](function(_0x28e6dd){_0x9d926d['data5']=_0x28e6dd[_0x0a12('0x55')];_0x9d926d[_0x0a12('0x56')]=_0x28e6dd['refresh_token'];return db['CloudProvider'][_0x0a12('0x13')]({'data5':_0x9d926d['data5'],'data6':_0x9d926d[_0x0a12('0x56')]},{'where':{'id':_0x9d926d['id']}});})[_0x0a12('0x14')](function(){oauth[_0x0a12('0x57')](_0x9d926d);socket[_0x0a12('0x58')](_0x0a12('0x59'),{'id':_0x3070e3['id']});return;})['then'](respondWithStatusCode(_0x53a037,null))[_0x0a12('0x3a')](function(_0x55d210){if(_0x3070e3){socket[_0x0a12('0x58')]('microsoftAuthorization:error',{'id':_0x3070e3['id']});}if(!_0x9d926d){logger[_0x0a12('0x48')]('Invalid\x20authentication\x20state\x20parameter',_0x55d210);return _0x53a037[_0x0a12('0xd')](0x1f4)[_0x0a12('0x17')](_0x55d210[_0x0a12('0x5a')]);}logger[_0x0a12('0x48')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x9d926d['id'],JSON['stringify'](_0x55d210));});}; \ No newline at end of file +var _0xd459=['Content-Range','then','end','error','stack','name','send','padEnd','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','CloudProvider','includeAll','include','rows','decryptString','data3','catch','params','find','service','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','update','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','state','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','localhost','sendStatus','status','json','offset','undefined','count','limit'];(function(_0xed44ee,_0x2e967c){var _0x2b798a=function(_0x1e83e7){while(--_0x1e83e7){_0xed44ee['push'](_0xed44ee['shift']());}};_0x2b798a(++_0x2e967c);}(_0xd459,0x1c7));var _0x9d45=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xd459[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var Redis=require(_0x9d45('0x0'));var qs=require(_0x9d45('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x9d45('0x2'));var logger=require(_0x9d45('0x3'))('api');var db=require(_0x9d45('0x4'))['db'];var oauth=require(_0x9d45('0x5'));config[_0x9d45('0x6')]=_['defaults'](config[_0x9d45('0x6')],{'host':_0x9d45('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d45('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x53f2b9,_0x48ea4a){_0x48ea4a=_0x48ea4a||0xcc;return function(_0xbb6813){if(_0xbb6813){return _0x53f2b9[_0x9d45('0x8')](_0x48ea4a);}return _0x53f2b9[_0x9d45('0x9')](_0x48ea4a)['end']();};}function respondWithResult(_0xd4af7f,_0x5b6cee){_0x5b6cee=_0x5b6cee||0xc8;return function(_0x1bd8d6){if(_0x1bd8d6){return _0xd4af7f['status'](_0x5b6cee)[_0x9d45('0xa')](_0x1bd8d6);}};}function respondWithFilteredResult(_0x2de273,_0x4a4cc7){return function(_0x10c171){if(_0x10c171){var _0x30a035=typeof _0x4a4cc7[_0x9d45('0xb')]==='undefined'&&typeof _0x4a4cc7['limit']===_0x9d45('0xc');var _0x381b0c=_0x10c171['count'];var _0x3416b5=_0x30a035?0x0:_0x4a4cc7['offset'];var _0x9fe6ab=_0x30a035?_0x10c171[_0x9d45('0xd')]:_0x4a4cc7[_0x9d45('0xb')]+_0x4a4cc7[_0x9d45('0xe')];var _0x4f43fe;if(_0x9fe6ab>=_0x381b0c){_0x9fe6ab=_0x381b0c;_0x4f43fe=0xc8;}else{_0x4f43fe=0xce;}_0x2de273[_0x9d45('0x9')](_0x4f43fe);return _0x2de273['set'](_0x9d45('0xf'),_0x3416b5+'-'+_0x9fe6ab+'/'+_0x381b0c)[_0x9d45('0xa')](_0x10c171);}return null;};}function saveUpdates(_0x31cb53){return function(_0x4fb38a){if(_0x4fb38a){return _0x4fb38a['update'](_0x31cb53)[_0x9d45('0x10')](function(_0x1beaa2){return _0x1beaa2;});}return null;};}function removeEntity(_0x5d6b48){return function(_0x56c2b7){if(_0x56c2b7){return _0x56c2b7['destroy']()[_0x9d45('0x10')](function(){_0x5d6b48[_0x9d45('0x9')](0xcc)[_0x9d45('0x11')]();});}};}function handleEntityNotFound(_0x369bf7){return function(_0x2fa89c){if(!_0x2fa89c){_0x369bf7['sendStatus'](0x194);}return _0x2fa89c;};}function handleError(_0x5006c5,_0x9acd15){_0x9acd15=_0x9acd15||0x1f4;return function(_0x1f4650){logger[_0x9d45('0x12')](_0x1f4650[_0x9d45('0x13')]);if(_0x1f4650[_0x9d45('0x14')]){delete _0x1f4650[_0x9d45('0x14')];}_0x5006c5[_0x9d45('0x9')](_0x9acd15)[_0x9d45('0x15')](_0x1f4650);};}function maskClientSecret(_0x5cc9ea){return _[_0x9d45('0x16')](_0x5cc9ea['slice'](0x0,0x3),0x14,'*');}exports[_0x9d45('0x17')]=function(_0x3a6998,_0x46752d){var _0x44a2e3={},_0x52e986={},_0x5ab5fc={'count':0x0,'rows':[]};var _0x58ae5e=_[_0x9d45('0x18')](db['CloudProvider'][_0x9d45('0x19')],function(_0x4b35be){return{'name':_0x4b35be[_0x9d45('0x1a')],'type':_0x4b35be['type'][_0x9d45('0x1b')]};});_0x52e986[_0x9d45('0x1c')]=_[_0x9d45('0x18')](_0x58ae5e,_0x9d45('0x14'));_0x52e986[_0x9d45('0x1d')]=_[_0x9d45('0x1e')](_0x3a6998[_0x9d45('0x1d')]);_0x52e986[_0x9d45('0x1f')]=_[_0x9d45('0x20')](_0x52e986[_0x9d45('0x1c')],_0x52e986[_0x9d45('0x1d')]);_0x44a2e3[_0x9d45('0x21')]=_[_0x9d45('0x20')](_0x52e986['model'],qs['fields'](_0x3a6998['query'][_0x9d45('0x22')]));_0x44a2e3[_0x9d45('0x21')]=_0x44a2e3[_0x9d45('0x21')][_0x9d45('0x23')]?_0x44a2e3[_0x9d45('0x21')]:_0x52e986[_0x9d45('0x1c')];if(!_0x3a6998[_0x9d45('0x1d')][_0x9d45('0x24')](_0x9d45('0x25'))){_0x44a2e3[_0x9d45('0xe')]=qs[_0x9d45('0xe')](_0x3a6998[_0x9d45('0x1d')]['limit']);_0x44a2e3[_0x9d45('0xb')]=qs[_0x9d45('0xb')](_0x3a6998[_0x9d45('0x1d')][_0x9d45('0xb')]);}_0x44a2e3[_0x9d45('0x26')]=qs['sort'](_0x3a6998[_0x9d45('0x1d')][_0x9d45('0x27')]);_0x44a2e3[_0x9d45('0x28')]=qs[_0x9d45('0x1f')](_[_0x9d45('0x29')](_0x3a6998[_0x9d45('0x1d')],_0x52e986['filters']),_0x58ae5e);if(_0x3a6998[_0x9d45('0x1d')][_0x9d45('0x2a')]){_0x44a2e3['where']=_[_0x9d45('0x2b')](_0x44a2e3[_0x9d45('0x28')],{'$or':_[_0x9d45('0x18')](_0x58ae5e,function(_0x11fdd2){if(_0x11fdd2[_0x9d45('0x2c')]!==_0x9d45('0x2d')){var _0x157206={};_0x157206[_0x11fdd2[_0x9d45('0x14')]]={'$like':'%'+_0x3a6998['query'][_0x9d45('0x2a')]+'%'};return _0x157206;}})});}_0x44a2e3=_[_0x9d45('0x2b')]({},_0x44a2e3,_0x3a6998[_0x9d45('0x2e')]);var _0x1c3d58={'where':_0x44a2e3[_0x9d45('0x28')]};return db[_0x9d45('0x2f')][_0x9d45('0xd')](_0x1c3d58)[_0x9d45('0x10')](function(_0x5b0acb){_0x5ab5fc[_0x9d45('0xd')]=_0x5b0acb;if(_0x3a6998[_0x9d45('0x1d')][_0x9d45('0x30')]){_0x44a2e3[_0x9d45('0x31')]=[{'all':!![]}];}return db[_0x9d45('0x2f')]['findAll'](_0x44a2e3);})[_0x9d45('0x10')](function(_0x1b83a3){_0x5ab5fc[_0x9d45('0x32')]=_['map'](_0x1b83a3,function(_0x37c46e){if(_0x37c46e['service']==='MicrosoftAzure'){var _0x50d8fd=encryptor[_0x9d45('0x33')](_0x37c46e[_0x9d45('0x34')]);_0x37c46e[_0x9d45('0x34')]=maskClientSecret(_0x50d8fd);}return _0x37c46e;});return _0x5ab5fc;})['then'](respondWithFilteredResult(_0x46752d,_0x44a2e3))[_0x9d45('0x35')](handleError(_0x46752d,null));};exports['show']=function(_0x1654bf,_0x14e40c){var _0x2cbf6b={'raw':!![],'where':{'id':_0x1654bf[_0x9d45('0x36')]['id']}},_0x527da9={};_0x527da9[_0x9d45('0x1c')]=_[_0x9d45('0x1e')](db[_0x9d45('0x2f')][_0x9d45('0x19')]);_0x527da9[_0x9d45('0x1d')]=_[_0x9d45('0x1e')](_0x1654bf['query']);_0x527da9[_0x9d45('0x1f')]=_[_0x9d45('0x20')](_0x527da9[_0x9d45('0x1c')],_0x527da9[_0x9d45('0x1d')]);_0x2cbf6b[_0x9d45('0x21')]=_['intersection'](_0x527da9[_0x9d45('0x1c')],qs[_0x9d45('0x22')](_0x1654bf[_0x9d45('0x1d')][_0x9d45('0x22')]));_0x2cbf6b[_0x9d45('0x21')]=_0x2cbf6b['attributes']['length']?_0x2cbf6b[_0x9d45('0x21')]:_0x527da9[_0x9d45('0x1c')];if(_0x1654bf[_0x9d45('0x1d')][_0x9d45('0x30')]){_0x2cbf6b[_0x9d45('0x31')]=[{'all':!![]}];}_0x2cbf6b=_[_0x9d45('0x2b')]({},_0x2cbf6b,_0x1654bf[_0x9d45('0x2e')]);return db[_0x9d45('0x2f')][_0x9d45('0x37')](_0x2cbf6b)[_0x9d45('0x10')](handleEntityNotFound(_0x14e40c,null))[_0x9d45('0x10')](function(_0x5f4577){if(_0x5f4577[_0x9d45('0x38')]===_0x9d45('0x39')){var _0x43b9fe=encryptor['decryptString'](_0x5f4577['data3']);_0x5f4577['data3']=maskClientSecret(_0x43b9fe);}return _0x5f4577;})[_0x9d45('0x10')](respondWithResult(_0x14e40c,null))[_0x9d45('0x35')](handleError(_0x14e40c,null));};exports[_0x9d45('0x3a')]=function(_0x4f603d,_0x393f92){if(!_0x4f603d[_0x9d45('0x3b')][_0x9d45('0x14')])throw new Error(_0x9d45('0x3c'));if(!_0x4f603d[_0x9d45('0x3b')][_0x9d45('0x38')])throw new Error(_0x9d45('0x3d'));var _0x8f878f=db[_0x9d45('0x2f')][_0x9d45('0x19')][_0x9d45('0x38')][_0x9d45('0x3e')];if(!_0x8f878f[_0x9d45('0x3f')](_0x4f603d[_0x9d45('0x3b')][_0x9d45('0x38')]))throw new Error(_0x9d45('0x40')+_0x8f878f['join'](',\x20'));if(_0x4f603d[_0x9d45('0x3b')][_0x9d45('0x38')]===_0x9d45('0x39')&&_0x4f603d['body']['data3']){_0x4f603d['body'][_0x9d45('0x34')]=encryptor['encryptString'](_0x4f603d[_0x9d45('0x3b')][_0x9d45('0x34')]);}return db['CloudProvider']['create'](_0x4f603d[_0x9d45('0x3b')],{})['then'](respondWithResult(_0x393f92,0xc9))['catch'](handleError(_0x393f92,null));};exports[_0x9d45('0x41')]=function(_0x39d816,_0x2b0cf5){if(_0x39d816[_0x9d45('0x3b')]['id']){delete _0x39d816[_0x9d45('0x3b')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x39d816['params']['id']}})['then'](handleEntityNotFound(_0x2b0cf5,null))[_0x9d45('0x10')](function(_0x2fa93a){if(_0x2fa93a[_0x9d45('0x38')]==='MicrosoftAzure'&&_0x39d816[_0x9d45('0x3b')][_0x9d45('0x34')]){_0x39d816[_0x9d45('0x3b')][_0x9d45('0x34')]=encryptor['encryptString'](_0x39d816[_0x9d45('0x3b')][_0x9d45('0x34')]);}return _0x2fa93a;})[_0x9d45('0x10')](saveUpdates(_0x39d816[_0x9d45('0x3b')],null))[_0x9d45('0x10')](respondWithResult(_0x2b0cf5,null))[_0x9d45('0x35')](handleError(_0x2b0cf5,null));};exports[_0x9d45('0x42')]=function(_0xc34af5,_0x15f4a9){return db[_0x9d45('0x2f')][_0x9d45('0x37')]({'where':{'id':_0xc34af5[_0x9d45('0x36')]['id']}})[_0x9d45('0x10')](handleEntityNotFound(_0x15f4a9,null))['then'](removeEntity(_0x15f4a9,null))['catch'](handleError(_0x15f4a9,null));};exports['oauth2MicrosoftAuthorize']=function(_0xe4b1a9,_0x30a367){return db[_0x9d45('0x2f')][_0x9d45('0x43')]({'where':{'id':_0xe4b1a9['params']['id']},'raw':!![]})[_0x9d45('0x10')](function(_0x4b747){if(!_0x4b747)return _0x30a367['sendStatus'](0x194);return{'url':oauth[_0x9d45('0x44')](_0x4b747,_0xe4b1a9[_0x9d45('0x45')]['id'])};})[_0x9d45('0x10')](respondWithResult(_0x30a367,null))[_0x9d45('0x35')](handleError(_0x30a367,null));};exports[_0x9d45('0x46')]=function(_0xb9da1e,_0x4ff82d){var _0x5d8df9=_0xb9da1e[_0x9d45('0x3b')];var _0x5eff8c;var _0x39f3ef;if(_0x5d8df9[_0x9d45('0x12')])throw _0x5d8df9;redis[_0x9d45('0x47')](_0x5d8df9['state'])[_0x9d45('0x10')](function(_0x4ed95d){if(!_0x4ed95d)throw new Error(_0x9d45('0x48'));_0x5eff8c=JSON['parse'](_0x4ed95d);var _0x343927=Buffer['from'](_0x5d8df9[_0x9d45('0x49')],_0x9d45('0x4a'))[_0x9d45('0x4b')](_0x9d45('0x4c'));_0x39f3ef=JSON['parse'](_0x343927);if(!oauth[_0x9d45('0x4d')](_0x5d8df9['id_token'],_0x5eff8c[_0x9d45('0x4e')]))throw new Error(_0x9d45('0x4f'));redis[_0x9d45('0x50')](_0x5d8df9['state']);return oauth[_0x9d45('0x51')](_0x5d8df9[_0x9d45('0x52')],_0x5eff8c);})[_0x9d45('0x10')](function(_0x4e6bc4){_0x5eff8c[_0x9d45('0x53')]=_0x4e6bc4[_0x9d45('0x54')];_0x5eff8c[_0x9d45('0x55')]=_0x4e6bc4['refresh_token'];return db[_0x9d45('0x2f')][_0x9d45('0x41')]({'data5':_0x5eff8c['data5'],'data6':_0x5eff8c[_0x9d45('0x55')]},{'where':{'id':_0x5eff8c['id']}});})['then'](function(){oauth[_0x9d45('0x56')](_0x5eff8c);socket[_0x9d45('0x57')](_0x9d45('0x58'),{'id':_0x39f3ef['id']});return;})['then'](respondWithStatusCode(_0x4ff82d,null))[_0x9d45('0x35')](function(_0x584ef9){if(_0x39f3ef){socket[_0x9d45('0x57')](_0x9d45('0x59'),{'id':_0x39f3ef['id']});}if(!_0x5eff8c){logger[_0x9d45('0x12')](_0x9d45('0x5a'),_0x584ef9);return _0x4ff82d['status'](0x1f4)[_0x9d45('0x15')](_0x584ef9[_0x9d45('0x5b')]);}logger['error'](_0x9d45('0x5c'),_0x5eff8c['id'],JSON[_0x9d45('0x5d')](_0x584ef9));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 9047e7d..2547107 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9f1=['cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x1e2f72,_0x4ecd3d){var _0x2f00a8=function(_0xf1ee63){while(--_0xf1ee63){_0x1e2f72['push'](_0x1e2f72['shift']());}};_0x2f00a8(++_0x4ecd3d);}(_0xa9f1,0x187));var _0x1a9f=function(_0x40d72d,_0x1aaa3c){_0x40d72d=_0x40d72d-0x0;var _0x13909c=_0xa9f1[_0x40d72d];return _0x13909c;};'use strict';var _=require(_0x1a9f('0x0'));var util=require(_0x1a9f('0x1'));var logger=require('../../config/logger')(_0x1a9f('0x2'));var moment=require(_0x1a9f('0x3'));var BPromise=require(_0x1a9f('0x4'));var rp=require(_0x1a9f('0x5'));var fs=require('fs');var path=require(_0x1a9f('0x6'));var rimraf=require(_0x1a9f('0x7'));var config=require('../../config/environment');var attributes=require(_0x1a9f('0x8'));module[_0x1a9f('0x9')]=function(_0x19e7e3,_0x2412a2){return _0x19e7e3[_0x1a9f('0xa')](_0x1a9f('0xb'),attributes,{'tableName':_0x1a9f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x331a=['bluebird','path','rimraf','exports','define','CloudProvider','cloud_providers','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x331a,0x1a5));var _0xa331=function(_0x1f1fb4,_0x15a561){_0x1f1fb4=_0x1f1fb4-0x0;var _0x12fa15=_0x331a[_0x1f1fb4];return _0x12fa15;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa331('0x0'));var moment=require(_0xa331('0x1'));var BPromise=require(_0xa331('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa331('0x3'));var rimraf=require(_0xa331('0x4'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xa331('0x5')]=function(_0x26fd6e,_0x56f264){return _0x26fd6e[_0xa331('0x6')](_0xa331('0x7'),attributes,{'tableName':_0xa331('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 180b588..43bc10c 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0702=['CloudProvider','findOne','data6','decryptString','POST','{TENANT_ID}','data5','access_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','intervals','findAll','all','catch','error','exports','crypto','jsonwebtoken','moment','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','push','/.default','join','data7','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','client_id','redirect_uri','data4','response_mode','form_post','scope','prompt','key','value','oauth2Claims','replace','oauth2/','data1','set','decode','payload','iss','issuer','aud','nonce','unix','exp','resolve','then','data3'];(function(_0x3d9857,_0x7e310d){var _0x1390a5=function(_0x6facb2){while(--_0x6facb2){_0x3d9857['push'](_0x3d9857['shift']());}};_0x1390a5(++_0x7e310d);}(_0x0702,0xf5));var _0x2070=function(_0x293012,_0x54552f){_0x293012=_0x293012-0x0;var _0x3d1716=_0x0702[_0x293012];return _0x3d1716;};'use strict';var _=require('lodash');var crypto=require(_0x2070('0x0'));var jwt=require(_0x2070('0x1'));var moment=require(_0x2070('0x2'));var Redis=require('ioredis');var rp=require(_0x2070('0x3'));var util=require(_0x2070('0x4'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x2070('0x5'))(_0x2070('0x6'));var schedule=require(_0x2070('0x7'));var db=require(_0x2070('0x8'))['db'];config[_0x2070('0x9')]=_['defaults'](config[_0x2070('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x2070('0x9')]);var MICROSOFT_AUTH_URL=_0x2070('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2070('0xb'),'profile',_0x2070('0xc'),'offline_access',_0x2070('0xd'),_0x2070('0xe'),_0x2070('0xf')],'Dynamics365':['openid',_0x2070('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x2070('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x2070('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1dd70a){var _0x16f224=_[_0x2070('0x13')](AZURE_AUTH_SCOPES[_0x1dd70a[_0x2070('0x14')]]);if(_0x1dd70a['type']==='Dynamics365')_0x16f224[_0x2070('0x15')](_0x1dd70a['data7']+_0x2070('0x16'));return _0x16f224[_0x2070('0x17')]('\x20');}function getAccessTokenScope(_0x5a8d39){if(_0x5a8d39[_0x2070('0x14')]==='Outlook365')return _0x2070('0xd');if(_0x5a8d39['type']==='Dynamics365')return _0x5a8d39[_0x2070('0x18')]+_0x2070('0x16');}function generateMicrosoftAuthorizationUrl(_0x312167,_0x44084c){var _0x135e0c=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x312167[_0x2070('0x19')]);var _0x3b8f99=[_0x2070('0x1a'),_0x2070('0x1b')];var _0x2a6af1=Buffer[_0x2070('0x1c')](JSON[_0x2070('0x1d')]({'id':_0x44084c}))['toString'](_0x2070('0x1e'));var _0x37bac5=crypto[_0x2070('0x1f')](0x10)[_0x2070('0x20')](_0x2070('0x21'));var _0x3eae17=getAuthorizationScopes(_0x312167);var _0x4a24ea=[{'key':_0x2070('0x22'),'value':_0x312167['data1']},{'key':'response_type','value':encodeURIComponent(_0x3b8f99[_0x2070('0x17')]('\x20'))},{'key':_0x2070('0x23'),'value':_0x312167[_0x2070('0x24')]},{'key':_0x2070('0x25'),'value':_0x2070('0x26')},{'key':_0x2070('0x27'),'value':encodeURIComponent(_0x3eae17)},{'key':'state','value':_0x2a6af1},{'key':'nonce','value':_0x37bac5},{'key':_0x2070('0x28'),'value':'login'}];var _0x42845e=_0x135e0c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x2070('0x13')](_0x4a24ea,function(_0x1d97bb){return _0x1d97bb[_0x2070('0x29')]+'='+_0x1d97bb[_0x2070('0x2a')];})[_0x2070('0x17')]('&');_0x312167[_0x2070('0x2b')]={'issuer':_0x135e0c[_0x2070('0x2c')](_0x2070('0x2d'),''),'audience':_0x312167[_0x2070('0x2e')],'state':_0x2a6af1,'nonce':_0x37bac5};redis[_0x2070('0x2f')](_0x2a6af1,JSON[_0x2070('0x1d')](_0x312167));return _0x42845e;}function isValidIdToken(_0x208e94,_0x51bcaa){try{var _0x3977d8=jwt[_0x2070('0x30')](_0x208e94,{'complete':!![]});var _0x4238da=_0x3977d8[_0x2070('0x31')];if(_0x4238da[_0x2070('0x32')]!==_0x51bcaa[_0x2070('0x33')])return![];if(_0x4238da[_0x2070('0x34')]!==_0x51bcaa['audience'])return![];if(_0x4238da[_0x2070('0x35')]!==_0x51bcaa[_0x2070('0x35')])return![];if(moment()['isAfter'](moment[_0x2070('0x36')](_0x4238da[_0x2070('0x37')])))return![];return!![];}catch(_0x100489){throw _0x100489;}}function refreshOauth2MicrosoftAccessToken(_0xc71fa2){return Promise[_0x2070('0x38')]()[_0x2070('0x39')](function(){if(_0xc71fa2[_0x2070('0x3a')])return _0xc71fa2;return db[_0x2070('0x3b')][_0x2070('0x3c')]({'where':{'id':_0xc71fa2['id']},'raw':!![]});})[_0x2070('0x39')](function(_0x41eba4){var _0x1c9df9={'grant_type':'refresh_token','refresh_token':_0x41eba4[_0x2070('0x3d')],'scope':getAccessTokenScope(_0x41eba4),'redirect_uri':_0x41eba4[_0x2070('0x24')],'client_id':_0x41eba4[_0x2070('0x2e')],'client_secret':encryptor[_0x2070('0x3e')](_0x41eba4[_0x2070('0x3a')])};var _0x6ca8b8={'method':_0x2070('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x2070('0x2c')](_0x2070('0x40'),_0x41eba4[_0x2070('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1c9df9,'json':!![]};return rp(_0x6ca8b8);})[_0x2070('0x39')](function(_0x302f1d){_0xc71fa2[_0x2070('0x41')]=_0x302f1d[_0x2070('0x42')];_0xc71fa2['data6']=_0x302f1d['refresh_token'];return db[_0x2070('0x3b')][_0x2070('0x43')]({'data5':_0xc71fa2[_0x2070('0x41')],'data6':_0xc71fa2[_0x2070('0x3d')]},{'where':{'id':_0xc71fa2['id']}});})[_0x2070('0x39')](function(){return _0xc71fa2;})['catch'](function(_0xeef9e1){logger['error'](_0x2070('0x44'),_0xc71fa2['id'],_0xeef9e1);});}function getOauth2MicrosoftAccessToken(_0x2ad84f,_0x38dd1c){var _0x501c72={'grant_type':'authorization_code','code':_0x2ad84f,'scope':getAccessTokenScope(_0x38dd1c),'redirect_uri':_0x38dd1c[_0x2070('0x24')],'client_id':_0x38dd1c[_0x2070('0x2e')],'client_secret':encryptor[_0x2070('0x3e')](_0x38dd1c[_0x2070('0x3a')])};var _0xb3ef4d={'method':_0x2070('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x2070('0x2c')](_0x2070('0x40'),_0x38dd1c[_0x2070('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x501c72,'json':!![]};return rp(_0xb3ef4d);}function startRefreshInterval(_0x1fe55a){var _0x57d3a0=schedule['intervals'];if(_0x57d3a0[_0x1fe55a['id']])clearInterval(_0x57d3a0[_0x1fe55a['id']]);_0x57d3a0[_0x1fe55a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2070('0x45')](this,{'id':_0x1fe55a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2070('0x46')]=_0x57d3a0;}function startAllRefreshIntervals(){return db[_0x2070('0x3b')][_0x2070('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x1e8d4e){var _0x4d42b0=_0x1e8d4e[_0x2070('0x13')](function(_0x52e977){return refreshOauth2MicrosoftAccessToken(_0x52e977)['then'](function(_0x262b64){startRefreshInterval(_0x262b64);});});return Promise[_0x2070('0x48')](_0x4d42b0);})[_0x2070('0x49')](function(_0x38c1ea){var _0x56e2eb=_0x38c1ea?util['inspect'](_0x38c1ea,{'showHidden':![],'depth':null}):'';logger[_0x2070('0x4a')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x56e2eb);});}module[_0x2070('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xac8b=['CloudProvider','update','catch','error','intervals','bind','findAll','all','inspect','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','push','data7','join','Outlook365','/.default','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','redirect_uri','response_mode','scope','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','data1','set','decode','iss','issuer','aud','audience','isAfter','resolve','then','findOne','refresh_token','data6','data4','decryptString','data3','POST','data5','access_token'];(function(_0x55dd92,_0x4d0dbb){var _0x1b6f9e=function(_0x212ec7){while(--_0x212ec7){_0x55dd92['push'](_0x55dd92['shift']());}};_0x1b6f9e(++_0x4d0dbb);}(_0xac8b,0x190));var _0xbac8=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xac8b[_0x34843e];return _0x598f7f;};'use strict';var _=require(_0xbac8('0x0'));var crypto=require(_0xbac8('0x1'));var jwt=require(_0xbac8('0x2'));var moment=require(_0xbac8('0x3'));var Redis=require(_0xbac8('0x4'));var rp=require(_0xbac8('0x5'));var util=require(_0xbac8('0x6'));var encryptor=require(_0xbac8('0x7'));var config=require(_0xbac8('0x8'));var logger=require(_0xbac8('0x9'))('api');var schedule=require(_0xbac8('0xa'));var db=require(_0xbac8('0xb'))['db'];config['redis']=_[_0xbac8('0xc')](config['redis'],{'host':_0xbac8('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xbac8('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbac8('0xf'),'profile','email',_0xbac8('0x10'),_0xbac8('0x11'),_0xbac8('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xbac8('0xf'),_0xbac8('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xbac8('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xbac8('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x35b646){var _0x3e05ca=_[_0xbac8('0x15')](AZURE_AUTH_SCOPES[_0x35b646[_0xbac8('0x16')]]);if(_0x35b646[_0xbac8('0x16')]==='Dynamics365')_0x3e05ca[_0xbac8('0x17')](_0x35b646[_0xbac8('0x18')]+'/.default');return _0x3e05ca[_0xbac8('0x19')]('\x20');}function getAccessTokenScope(_0x34c37d){if(_0x34c37d['type']===_0xbac8('0x1a'))return _0xbac8('0x11');if(_0x34c37d[_0xbac8('0x16')]==='Dynamics365')return _0x34c37d['data7']+_0xbac8('0x1b');}function generateMicrosoftAuthorizationUrl(_0x362823,_0x347452){var _0x2f3847=MICROSOFT_AUTH_URL['replace'](_0xbac8('0x1c'),_0x362823[_0xbac8('0x1d')]);var _0x48ef87=['code',_0xbac8('0x1e')];var _0x45a230=Buffer[_0xbac8('0x1f')](JSON[_0xbac8('0x20')]({'id':_0x347452}))[_0xbac8('0x21')](_0xbac8('0x22'));var _0x4cd942=crypto[_0xbac8('0x23')](0x10)[_0xbac8('0x21')](_0xbac8('0x24'));var _0x52598d=getAuthorizationScopes(_0x362823);var _0x35fe3a=[{'key':_0xbac8('0x25'),'value':_0x362823['data1']},{'key':'response_type','value':encodeURIComponent(_0x48ef87[_0xbac8('0x19')]('\x20'))},{'key':_0xbac8('0x26'),'value':_0x362823['data4']},{'key':_0xbac8('0x27'),'value':'form_post'},{'key':_0xbac8('0x28'),'value':encodeURIComponent(_0x52598d)},{'key':'state','value':_0x45a230},{'key':_0xbac8('0x29'),'value':_0x4cd942},{'key':_0xbac8('0x2a'),'value':_0xbac8('0x2b')}];var _0x4631a9=_0x2f3847+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbac8('0x15')](_0x35fe3a,function(_0x1c7dd2){return _0x1c7dd2[_0xbac8('0x2c')]+'='+_0x1c7dd2[_0xbac8('0x2d')];})[_0xbac8('0x19')]('&');_0x362823[_0xbac8('0x2e')]={'issuer':_0x2f3847[_0xbac8('0x2f')](_0xbac8('0x30'),''),'audience':_0x362823[_0xbac8('0x31')],'state':_0x45a230,'nonce':_0x4cd942};redis[_0xbac8('0x32')](_0x45a230,JSON[_0xbac8('0x20')](_0x362823));return _0x4631a9;}function isValidIdToken(_0x4fa04e,_0x34ee18){try{var _0x4d4e8f=jwt[_0xbac8('0x33')](_0x4fa04e,{'complete':!![]});var _0x1bea57=_0x4d4e8f['payload'];if(_0x1bea57[_0xbac8('0x34')]!==_0x34ee18[_0xbac8('0x35')])return![];if(_0x1bea57[_0xbac8('0x36')]!==_0x34ee18[_0xbac8('0x37')])return![];if(_0x1bea57[_0xbac8('0x29')]!==_0x34ee18['nonce'])return![];if(moment()[_0xbac8('0x38')](moment['unix'](_0x1bea57['exp'])))return![];return!![];}catch(_0x4435a1){throw _0x4435a1;}}function refreshOauth2MicrosoftAccessToken(_0x116ad3){return Promise[_0xbac8('0x39')]()[_0xbac8('0x3a')](function(){if(_0x116ad3['data3'])return _0x116ad3;return db['CloudProvider'][_0xbac8('0x3b')]({'where':{'id':_0x116ad3['id']},'raw':!![]});})['then'](function(_0x20f5c1){var _0x5f8e3d={'grant_type':_0xbac8('0x3c'),'refresh_token':_0x20f5c1[_0xbac8('0x3d')],'scope':getAccessTokenScope(_0x20f5c1),'redirect_uri':_0x20f5c1[_0xbac8('0x3e')],'client_id':_0x20f5c1[_0xbac8('0x31')],'client_secret':encryptor[_0xbac8('0x3f')](_0x20f5c1[_0xbac8('0x40')])};var _0x252a7e={'method':_0xbac8('0x41'),'uri':MICROSOFT_AUTH_URL[_0xbac8('0x2f')](_0xbac8('0x1c'),_0x20f5c1[_0xbac8('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5f8e3d,'json':!![]};return rp(_0x252a7e);})['then'](function(_0x4c8d06){_0x116ad3[_0xbac8('0x42')]=_0x4c8d06[_0xbac8('0x43')];_0x116ad3[_0xbac8('0x3d')]=_0x4c8d06[_0xbac8('0x3c')];return db[_0xbac8('0x44')][_0xbac8('0x45')]({'data5':_0x116ad3[_0xbac8('0x42')],'data6':_0x116ad3[_0xbac8('0x3d')]},{'where':{'id':_0x116ad3['id']}});})[_0xbac8('0x3a')](function(){return _0x116ad3;})[_0xbac8('0x46')](function(_0x364dba){logger[_0xbac8('0x47')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x116ad3['id'],_0x364dba);});}function getOauth2MicrosoftAccessToken(_0x1d7a58,_0x168069){var _0x5ad207={'grant_type':'authorization_code','code':_0x1d7a58,'scope':getAccessTokenScope(_0x168069),'redirect_uri':_0x168069['data4'],'client_id':_0x168069['data1'],'client_secret':encryptor[_0xbac8('0x3f')](_0x168069[_0xbac8('0x40')])};var _0x363f2d={'method':_0xbac8('0x41'),'uri':MICROSOFT_AUTH_URL[_0xbac8('0x2f')](_0xbac8('0x1c'),_0x168069['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5ad207,'json':!![]};return rp(_0x363f2d);}function startRefreshInterval(_0x304938){var _0x4f850=schedule[_0xbac8('0x48')];if(_0x4f850[_0x304938['id']])clearInterval(_0x4f850[_0x304938['id']]);_0x4f850[_0x304938['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbac8('0x49')](this,{'id':_0x304938['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4f850;}function startAllRefreshIntervals(){return db[_0xbac8('0x44')][_0xbac8('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x5eeaa6){var _0x2b86f1=_0x5eeaa6[_0xbac8('0x15')](function(_0x3a5d9e){return refreshOauth2MicrosoftAccessToken(_0x3a5d9e)['then'](function(_0x1d1a80){startRefreshInterval(_0x1d1a80);});});return Promise[_0xbac8('0x4b')](_0x2b86f1);})['catch'](function(_0x3023dc){var _0x2686e5=_0x3023dc?util[_0xbac8('0x4c')](_0x3023dc,{'showHidden':![],'depth':null}):'';logger[_0xbac8('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2686e5);});}module[_0xbac8('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 742150c..ba53930 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb846=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x218360,_0x15db19){var _0x3bb157=function(_0x32bdf0){while(--_0x32bdf0){_0x218360['push'](_0x218360['shift']());}};_0x3bb157(++_0x15db19);}(_0xb846,0x1d0));var _0x6b84=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb846[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6b84('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6b84('0x1'));var rs=require(_0x6b84('0x2'));var fs=require('fs');var Redis=require(_0x6b84('0x3'));var db=require(_0x6b84('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6b84('0x5'));var config=require(_0x6b84('0x6'));var jayson=require(_0x6b84('0x7'));var client=jayson[_0x6b84('0x8')][_0x6b84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x534d8e,_0x54466a,_0x1482bd){return new BPromise(function(_0x5706dc,_0x1f0dcc){return client[_0x6b84('0xa')](_0x534d8e,_0x1482bd)['then'](function(_0x4faca2){logger['info'](_0x6b84('0xb'),_0x54466a,_0x6b84('0xc'));logger[_0x6b84('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x54466a,'request\x20sent',JSON['stringify'](_0x4faca2));if(_0x4faca2[_0x6b84('0xe')]){if(_0x4faca2[_0x6b84('0xe')][_0x6b84('0xf')]===0x1f4){logger[_0x6b84('0xe')](_0x6b84('0xb'),_0x54466a,_0x4faca2[_0x6b84('0xe')][_0x6b84('0x10')]);return _0x1f0dcc(_0x4faca2[_0x6b84('0xe')][_0x6b84('0x10')]);}logger[_0x6b84('0xe')](_0x6b84('0xb'),_0x54466a,_0x4faca2[_0x6b84('0xe')][_0x6b84('0x10')]);return _0x5706dc(_0x4faca2['error'][_0x6b84('0x10')]);}else{logger['info'](_0x6b84('0xb'),_0x54466a,_0x6b84('0xc'));_0x5706dc(_0x4faca2[_0x6b84('0x11')][_0x6b84('0x10')]);}})[_0x6b84('0x12')](function(_0x1ff8d9){logger[_0x6b84('0xe')](_0x6b84('0xb'),_0x54466a,_0x1ff8d9);_0x1f0dcc(_0x1ff8d9);});});} \ No newline at end of file +var _0xd6f9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0xcdf96f,_0xc63784){var _0xb59f45=function(_0xee7cc8){while(--_0xee7cc8){_0xcdf96f['push'](_0xcdf96f['shift']());}};_0xb59f45(++_0xc63784);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xd6f9[_0x37b3e5];return _0x207f20;};'use strict';var _=require(_0x9d6f('0x0'));var util=require(_0x9d6f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d6f('0x2'));var fs=require('fs');var Redis=require(_0x9d6f('0x3'));var db=require(_0x9d6f('0x4'))['db'];var utils=require(_0x9d6f('0x5'));var logger=require('../../config/logger')(_0x9d6f('0x6'));var config=require(_0x9d6f('0x7'));var jayson=require(_0x9d6f('0x8'));var client=jayson['client'][_0x9d6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x511811,_0x555c60,_0x2011db){return new BPromise(function(_0x523a52,_0x193661){return client[_0x9d6f('0xa')](_0x511811,_0x2011db)[_0x9d6f('0xb')](function(_0x5f7600){logger[_0x9d6f('0xc')]('CloudProvider,\x20%s,\x20%s',_0x555c60,'request\x20sent');logger['debug'](_0x9d6f('0xd'),_0x555c60,_0x9d6f('0xe'),JSON[_0x9d6f('0xf')](_0x5f7600));if(_0x5f7600[_0x9d6f('0x10')]){if(_0x5f7600[_0x9d6f('0x10')]['code']===0x1f4){logger[_0x9d6f('0x10')](_0x9d6f('0x11'),_0x555c60,_0x5f7600[_0x9d6f('0x10')][_0x9d6f('0x12')]);return _0x193661(_0x5f7600[_0x9d6f('0x10')]['message']);}logger[_0x9d6f('0x10')](_0x9d6f('0x11'),_0x555c60,_0x5f7600[_0x9d6f('0x10')][_0x9d6f('0x12')]);return _0x523a52(_0x5f7600[_0x9d6f('0x10')]['message']);}else{logger[_0x9d6f('0xc')](_0x9d6f('0x11'),_0x555c60,_0x9d6f('0xe'));_0x523a52(_0x5f7600[_0x9d6f('0x13')]['message']);}})[_0x9d6f('0x14')](function(_0x11e6ca){logger[_0x9d6f('0x10')](_0x9d6f('0x11'),_0x555c60,_0x11e6ca);_0x193661(_0x11e6ca);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 542ddff..b8389aa 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x1261,0x144));var _0x1126=function(_0x2211d4,_0x592254){_0x2211d4=_0x2211d4-0x0;var _0x565b56=_0x1261[_0x2211d4];return _0x565b56;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x3f8dfa,_0x4ca511){var _0x4fd797=function(_0x57eb4d){while(--_0x57eb4d){_0x3f8dfa['push'](_0x3f8dfa['shift']());}};_0x4fd797(++_0x4ca511);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 4a497af..38505a9 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 _0x0237=['exports','STRING'];(function(_0x4291f9,_0x3a125d){var _0x1c8d33=function(_0x9efd9e){while(--_0x9efd9e){_0x4291f9['push'](_0x4291f9['shift']());}};_0x1c8d33(++_0x3a125d);}(_0x0237,0xda));var _0x7023=function(_0x5f0738,_0x360154){_0x5f0738=_0x5f0738-0x0;var _0x3c4d3b=_0x0237[_0x5f0738];return _0x3c4d3b;};'use strict';var Sequelize=require('sequelize');module[_0x7023('0x0')]={'name':{'type':Sequelize[_0x7023('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7023('0x1')]},'companyId':{'type':Sequelize[_0x7023('0x1')]},'website':{'type':Sequelize[_0x7023('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7023('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7023('0x1')]},'postalCode':{'type':Sequelize[_0x7023('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7023('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x7023('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x7023('0x1')]},'sCountry':{'type':Sequelize[_0x7023('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1373=['STRING','name','sequelize','exports'];(function(_0x5a6983,_0x38627f){var _0x516234=function(_0x22fcdc){while(--_0x22fcdc){_0x5a6983['push'](_0x5a6983['shift']());}};_0x516234(++_0x38627f);}(_0x1373,0xa2));var _0x3137=function(_0x1cb2f0,_0x72db6e){_0x1cb2f0=_0x1cb2f0-0x0;var _0x2fba8b=_0x1373[_0x1cb2f0];return _0x2fba8b;};'use strict';var Sequelize=require(_0x3137('0x0'));module[_0x3137('0x1')]={'name':{'type':Sequelize[_0x3137('0x2')],'unique':_0x3137('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3137('0x2')]},'companyId':{'type':Sequelize[_0x3137('0x2')]},'website':{'type':Sequelize[_0x3137('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3137('0x2')]},'type':{'type':Sequelize[_0x3137('0x2')]},'street':{'type':Sequelize[_0x3137('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3137('0x2')]},'country':{'type':Sequelize[_0x3137('0x2')]},'email':{'type':Sequelize[_0x3137('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3137('0x2')]},'sStreet':{'type':Sequelize[_0x3137('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3137('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 842e200..2b1ffd8 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 _0x41ed=['limit','order','sort','where','filter','merge','options','includeAll','show','params','rawAttributes','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContact','addContacts','ids','omit','findOne','pick','map','getContacts','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x36258a,_0x547069){var _0x3210b9=function(_0x222409){while(--_0x222409){_0x36258a['push'](_0x36258a['shift']());}};_0x3210b9(++_0x547069);}(_0x41ed,0x17c));var _0xd41e=function(_0x23c473,_0x5436c8){_0x23c473=_0x23c473-0x0;var _0x4731dc=_0x41ed[_0x23c473];return _0x4731dc;};'use strict';var emlformat=require(_0xd41e('0x0'));var rimraf=require(_0xd41e('0x1'));var zipdir=require(_0xd41e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd41e('0x3'));var moment=require('moment');var BPromise=require(_0xd41e('0x4'));var Mustache=require(_0xd41e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd41e('0x6'));var ejs=require(_0xd41e('0x7'));var fs=require('fs');var fs_extra=require(_0xd41e('0x8'));var _=require(_0xd41e('0x9'));var squel=require(_0xd41e('0xa'));var crypto=require(_0xd41e('0xb'));var jsforce=require(_0xd41e('0xc'));var deskjs=require(_0xd41e('0xd'));var toCsv=require(_0xd41e('0x6'));var querystring=require(_0xd41e('0xe'));var Papa=require(_0xd41e('0xf'));var Redis=require(_0xd41e('0x10'));var authService=require(_0xd41e('0x11'));var qs=require(_0xd41e('0x12'));var as=require(_0xd41e('0x13'));var hardwareService=require(_0xd41e('0x14'));var logger=require(_0xd41e('0x15'))(_0xd41e('0x16'));var utils=require(_0xd41e('0x17'));var config=require(_0xd41e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd41e('0x19'))['db'];function respondWithStatusCode(_0x2519b6,_0x4f6062){_0x4f6062=_0x4f6062||0xcc;return function(_0x306171){if(_0x306171){return _0x2519b6['sendStatus'](_0x4f6062);}return _0x2519b6[_0xd41e('0x1a')](_0x4f6062)[_0xd41e('0x1b')]();};}function respondWithResult(_0x39b297,_0x581d69){_0x581d69=_0x581d69||0xc8;return function(_0x54ef93){if(_0x54ef93){return _0x39b297[_0xd41e('0x1a')](_0x581d69)[_0xd41e('0x1c')](_0x54ef93);}};}function respondWithFilteredResult(_0x4537da,_0x57bd04){return function(_0x1ee8b9){if(_0x1ee8b9){var _0x2da26=typeof _0x57bd04[_0xd41e('0x1d')]==='undefined'&&typeof _0x57bd04['limit']===_0xd41e('0x1e');var _0x17fd7c=_0x1ee8b9[_0xd41e('0x1f')];var _0x1f49ec=_0x2da26?0x0:_0x57bd04[_0xd41e('0x1d')];var _0x3ef970=_0x2da26?_0x1ee8b9[_0xd41e('0x1f')]:_0x57bd04[_0xd41e('0x1d')]+_0x57bd04['limit'];var _0x458b41;if(_0x3ef970>=_0x17fd7c){_0x3ef970=_0x17fd7c;_0x458b41=0xc8;}else{_0x458b41=0xce;}_0x4537da[_0xd41e('0x1a')](_0x458b41);return _0x4537da['set'](_0xd41e('0x20'),_0x1f49ec+'-'+_0x3ef970+'/'+_0x17fd7c)[_0xd41e('0x1c')](_0x1ee8b9);}return null;};}function patchUpdates(_0x12ee44){return function(_0x4aad6a){try{jsonpatch[_0xd41e('0x21')](_0x4aad6a,_0x12ee44,!![]);}catch(_0x36f818){return BPromise[_0xd41e('0x22')](_0x36f818);}return _0x4aad6a['save']();};}function saveUpdates(_0x117069,_0x4a8932){return function(_0x37059b){if(_0x37059b){return _0x37059b[_0xd41e('0x23')](_0x117069)[_0xd41e('0x24')](function(_0x55021a){return _0x55021a;});}return null;};}function removeEntity(_0x40833b,_0x43d0cb){return function(_0x31363d){if(_0x31363d){return _0x31363d[_0xd41e('0x25')]()[_0xd41e('0x24')](function(){var _0x407958=_0x31363d['get']({'plain':!![]});var _0x3766e0='Companies';return db[_0xd41e('0x26')]['destroy']({'where':{'type':_0x3766e0,'resourceId':_0x407958['id']}})[_0xd41e('0x24')](function(){return _0x31363d;});})[_0xd41e('0x24')](function(){_0x40833b['status'](0xcc)[_0xd41e('0x1b')]();});}};}function handleEntityNotFound(_0x349887,_0x36b220){return function(_0x593aab){if(!_0x593aab){_0x349887[_0xd41e('0x27')](0x194);}return _0x593aab;};}function handleError(_0x555a53,_0x3fe9ce){_0x3fe9ce=_0x3fe9ce||0x1f4;return function(_0x29c4ba){logger[_0xd41e('0x28')](_0x29c4ba[_0xd41e('0x29')]);if(_0x29c4ba[_0xd41e('0x2a')]){delete _0x29c4ba['name'];}_0x555a53[_0xd41e('0x1a')](_0x3fe9ce)['send'](_0x29c4ba);};}exports['index']=function(_0x4be6c0,_0x31516b){var _0x40e34b={},_0x3fc2a3={},_0xb5df96={'count':0x0,'rows':[]};return db[_0xd41e('0x2b')][_0xd41e('0x2c')]()[_0xd41e('0x24')](function(_0x47b18b){_0x3fc2a3[_0xd41e('0x2d')]=_['keys'](_0x47b18b);_0x3fc2a3[_0xd41e('0x2e')]=_[_0xd41e('0x2f')](_0x4be6c0[_0xd41e('0x2e')]);_0x3fc2a3[_0xd41e('0x30')]=_[_0xd41e('0x31')](_0x3fc2a3[_0xd41e('0x2d')],_0x3fc2a3[_0xd41e('0x2e')]);_0x40e34b[_0xd41e('0x32')]=_[_0xd41e('0x31')](_0x3fc2a3[_0xd41e('0x2d')],qs[_0xd41e('0x33')](_0x4be6c0[_0xd41e('0x2e')][_0xd41e('0x33')]));_0x40e34b[_0xd41e('0x32')]=_0x40e34b['attributes'][_0xd41e('0x34')]?_0x40e34b[_0xd41e('0x32')]:_0x3fc2a3['model'];if(!_0x4be6c0[_0xd41e('0x2e')][_0xd41e('0x35')](_0xd41e('0x36'))){_0x40e34b[_0xd41e('0x37')]=qs[_0xd41e('0x37')](_0x4be6c0[_0xd41e('0x2e')][_0xd41e('0x37')]);_0x40e34b[_0xd41e('0x1d')]=qs[_0xd41e('0x1d')](_0x4be6c0['query']['offset']);}_0x40e34b[_0xd41e('0x38')]=qs[_0xd41e('0x39')](_0x4be6c0[_0xd41e('0x2e')][_0xd41e('0x39')]);_0x40e34b['where']=qs[_0xd41e('0x30')](_['pick'](_0x4be6c0[_0xd41e('0x2e')],_0x3fc2a3[_0xd41e('0x30')]),_0x47b18b);if(_0x4be6c0[_0xd41e('0x2e')]['filter']){_0x40e34b[_0xd41e('0x3a')]=_['merge'](_0x40e34b[_0xd41e('0x3a')],{'$or':_['map'](_0x40e34b['attributes'],function(_0x5f4e5b){var _0x4d3ab1={};_0x4d3ab1[_0x5f4e5b]={'$like':'%'+_0x4be6c0['query'][_0xd41e('0x3b')]+'%'};return _0x4d3ab1;})});}_0x40e34b=_[_0xd41e('0x3c')]({},_0x40e34b,_0x4be6c0[_0xd41e('0x3d')]);var _0x15e815={'where':_0x40e34b[_0xd41e('0x3a')]};return db[_0xd41e('0x2b')]['count'](_0x15e815)[_0xd41e('0x24')](function(_0x28790d){_0xb5df96[_0xd41e('0x1f')]=_0x28790d;if(_0x4be6c0['query'][_0xd41e('0x3e')]){_0x40e34b['include']=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x40e34b);})[_0xd41e('0x24')](function(_0x4c2c96){_0xb5df96['rows']=_0x4c2c96;return _0xb5df96;})[_0xd41e('0x24')](respondWithFilteredResult(_0x31516b,_0x40e34b))['catch'](handleError(_0x31516b,null));})['catch'](handleError(_0x31516b,null));};exports[_0xd41e('0x3f')]=function(_0x33e785,_0x1d9f0f){var _0x128e02={'raw':![],'where':{'id':_0x33e785[_0xd41e('0x40')]['id']}},_0x2c7673={};_0x2c7673['model']=_[_0xd41e('0x2f')](db[_0xd41e('0x2b')][_0xd41e('0x41')]);_0x2c7673[_0xd41e('0x2e')]=_['keys'](_0x33e785[_0xd41e('0x2e')]);_0x2c7673['filters']=_[_0xd41e('0x31')](_0x2c7673[_0xd41e('0x2d')],_0x2c7673[_0xd41e('0x2e')]);_0x128e02[_0xd41e('0x32')]=_[_0xd41e('0x31')](_0x2c7673['model'],qs[_0xd41e('0x33')](_0x33e785[_0xd41e('0x2e')]['fields']));_0x128e02[_0xd41e('0x32')]=_0x128e02[_0xd41e('0x32')][_0xd41e('0x34')]?_0x128e02[_0xd41e('0x32')]:_0x2c7673[_0xd41e('0x2d')];if(_0x33e785[_0xd41e('0x2e')]['includeAll']){_0x128e02[_0xd41e('0x42')]=[{'all':!![]}];}_0x128e02=_[_0xd41e('0x3c')]({},_0x128e02,_0x33e785[_0xd41e('0x3d')]);return db[_0xd41e('0x2b')][_0xd41e('0x43')](_0x128e02)[_0xd41e('0x24')](handleEntityNotFound(_0x1d9f0f,null))['then'](respondWithResult(_0x1d9f0f,null))[_0xd41e('0x44')](handleError(_0x1d9f0f,null));};exports['create']=function(_0x295c49,_0x1f9b69){return db[_0xd41e('0x2b')][_0xd41e('0x45')](_0x295c49['body'],{})[_0xd41e('0x24')](function(_0x2f6931){var _0x1032cf=_0x295c49[_0xd41e('0x46')]['get']({'plain':!![]});if(!_0x1032cf)throw new Error(_0xd41e('0x47'));if(_0x1032cf[_0xd41e('0x48')]===_0xd41e('0x46')){var _0x4d4e9a=_0x2f6931[_0xd41e('0x49')]({'plain':!![]});var _0x517d33='Companies';return db[_0xd41e('0x4a')][_0xd41e('0x43')]({'where':{'name':_0x517d33,'userProfileId':_0x1032cf[_0xd41e('0x4b')]},'raw':!![]})[_0xd41e('0x24')](function(_0x5afa87){if(_0x5afa87&&_0x5afa87[_0xd41e('0x4c')]===0x0){return db[_0xd41e('0x26')][_0xd41e('0x45')]({'name':_0x4d4e9a[_0xd41e('0x2a')],'resourceId':_0x4d4e9a['id'],'type':_0x5afa87[_0xd41e('0x2a')],'sectionId':_0x5afa87['id']},{})[_0xd41e('0x24')](function(){return _0x2f6931;});}else{return _0x2f6931;}})[_0xd41e('0x44')](function(_0x2fc1ca){logger[_0xd41e('0x28')](_0xd41e('0x4d'),_0x2fc1ca);throw _0x2fc1ca;});}return _0x2f6931;})[_0xd41e('0x24')](respondWithResult(_0x1f9b69,0xc9))[_0xd41e('0x44')](handleError(_0x1f9b69,null));};exports[_0xd41e('0x23')]=function(_0x407697,_0x207fe7){if(_0x407697[_0xd41e('0x4e')]['id']){delete _0x407697[_0xd41e('0x4e')]['id'];}return db[_0xd41e('0x2b')]['find']({'where':{'id':_0x407697[_0xd41e('0x40')]['id']}})[_0xd41e('0x24')](handleEntityNotFound(_0x207fe7,null))[_0xd41e('0x24')](saveUpdates(_0x407697[_0xd41e('0x4e')],null))[_0xd41e('0x24')](respondWithResult(_0x207fe7,null))['catch'](handleError(_0x207fe7,null));};exports[_0xd41e('0x25')]=function(_0x569be2,_0x2b5cd1){return db[_0xd41e('0x2b')][_0xd41e('0x43')]({'where':{'id':_0x569be2[_0xd41e('0x40')]['id']}})[_0xd41e('0x24')](handleEntityNotFound(_0x2b5cd1,null))['then'](removeEntity(_0x2b5cd1,null))['catch'](handleError(_0x2b5cd1,null));};exports[_0xd41e('0x2c')]=function(_0x3e7120,_0x6ba33b){return db[_0xd41e('0x2b')]['describe']()[_0xd41e('0x24')](respondWithResult(_0x6ba33b,null))[_0xd41e('0x44')](handleError(_0x6ba33b,null));};exports['addContacts']=function(_0x49eb1a,_0x5abc8a,_0x36d806){return db[_0xd41e('0x4f')][_0xd41e('0x43')]({'where':{'id':_0x49eb1a['params']['id']}})['then'](handleEntityNotFound(_0x5abc8a,null))[_0xd41e('0x24')](function(_0x19dcfc){if(_0x19dcfc){return _0x19dcfc[_0xd41e('0x50')](_0x49eb1a[_0xd41e('0x4e')][_0xd41e('0x51')],_[_0xd41e('0x52')](_0x49eb1a['body'],['ids','id'])||{});}})[_0xd41e('0x24')](respondWithResult(_0x5abc8a,null))[_0xd41e('0x44')](handleError(_0x5abc8a,null));};exports['getContacts']=function(_0x51fa3d,_0x1ab64b,_0x101e8c){var _0x1fe530={};var _0x3c942c={};var _0x222163;var _0x3523b3;return db[_0xd41e('0x2b')][_0xd41e('0x53')]({'where':{'id':_0x51fa3d[_0xd41e('0x40')]['id']}})[_0xd41e('0x24')](handleEntityNotFound(_0x1ab64b,null))[_0xd41e('0x24')](function(_0x4ff08e){if(_0x4ff08e){_0x222163=_0x4ff08e;_0x3c942c[_0xd41e('0x2d')]=_[_0xd41e('0x2f')](db['CmContact']['rawAttributes']);_0x3c942c[_0xd41e('0x2e')]=_['keys'](_0x51fa3d['query']);_0x3c942c[_0xd41e('0x30')]=_[_0xd41e('0x31')](_0x3c942c[_0xd41e('0x2d')],_0x3c942c[_0xd41e('0x2e')]);_0x1fe530[_0xd41e('0x32')]=_[_0xd41e('0x31')](_0x3c942c['model'],qs['fields'](_0x51fa3d['query'][_0xd41e('0x33')]));_0x1fe530['attributes']=_0x1fe530[_0xd41e('0x32')][_0xd41e('0x34')]?_0x1fe530[_0xd41e('0x32')]:_0x3c942c[_0xd41e('0x2d')];_0x1fe530['order']=qs[_0xd41e('0x39')](_0x51fa3d[_0xd41e('0x2e')][_0xd41e('0x39')]);_0x1fe530[_0xd41e('0x3a')]=qs[_0xd41e('0x30')](_[_0xd41e('0x54')](_0x51fa3d['query'],_0x3c942c[_0xd41e('0x30')]));if(_0x51fa3d['query'][_0xd41e('0x3b')]){_0x1fe530[_0xd41e('0x3a')]=_[_0xd41e('0x3c')](_0x1fe530['where'],{'$or':_[_0xd41e('0x55')](_0x1fe530[_0xd41e('0x32')],function(_0x7f02a4){var _0x42a6d1={};_0x42a6d1[_0x7f02a4]={'$like':'%'+_0x51fa3d[_0xd41e('0x2e')][_0xd41e('0x3b')]+'%'};return _0x42a6d1;})});}_0x1fe530=_[_0xd41e('0x3c')]({},_0x1fe530,_0x51fa3d[_0xd41e('0x3d')]);return _0x222163['getContacts'](_0x1fe530);}})[_0xd41e('0x24')](function(_0x8382b3){if(_0x8382b3){_0x3523b3=_0x8382b3[_0xd41e('0x34')];if(!_0x51fa3d[_0xd41e('0x2e')][_0xd41e('0x35')](_0xd41e('0x36'))){_0x1fe530['limit']=qs[_0xd41e('0x37')](_0x51fa3d[_0xd41e('0x2e')][_0xd41e('0x37')]);_0x1fe530[_0xd41e('0x1d')]=qs[_0xd41e('0x1d')](_0x51fa3d[_0xd41e('0x2e')][_0xd41e('0x1d')]);}return _0x222163[_0xd41e('0x56')](_0x1fe530);}})[_0xd41e('0x24')](function(_0x5b35fe){if(_0x5b35fe){return _0x5b35fe?{'count':_0x3523b3,'rows':_0x5b35fe}:null;}})[_0xd41e('0x24')](respondWithResult(_0x1ab64b,null))[_0xd41e('0x44')](handleError(_0x1ab64b,null));}; \ No newline at end of file +var _0x011e=['undefined','limit','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','params','addContacts','CmContact','ids','omit','findOne','order','pick','map','options','getContacts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset'];(function(_0x59684c,_0x4f23bd){var _0x6e9beb=function(_0x316cde){while(--_0x316cde){_0x59684c['push'](_0x59684c['shift']());}};_0x6e9beb(++_0x4f23bd);}(_0x011e,0x8f));var _0xe011=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x011e[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0xe011('0x0'));var rimraf=require(_0xe011('0x1'));var zipdir=require(_0xe011('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe011('0x3'));var moment=require(_0xe011('0x4'));var BPromise=require(_0xe011('0x5'));var Mustache=require(_0xe011('0x6'));var util=require(_0xe011('0x7'));var path=require('path');var sox=require(_0xe011('0x8'));var csv=require('to-csv');var ejs=require(_0xe011('0x9'));var fs=require('fs');var fs_extra=require(_0xe011('0xa'));var _=require(_0xe011('0xb'));var squel=require(_0xe011('0xc'));var crypto=require(_0xe011('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe011('0xe'));var toCsv=require(_0xe011('0xf'));var querystring=require(_0xe011('0x10'));var Papa=require(_0xe011('0x11'));var Redis=require(_0xe011('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe011('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe011('0x14'));var logger=require(_0xe011('0x15'))(_0xe011('0x16'));var utils=require('../../config/utils');var config=require(_0xe011('0x17'));var licenseUtil=require(_0xe011('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46472e,_0x241e92){_0x241e92=_0x241e92||0xcc;return function(_0x1f8a6f){if(_0x1f8a6f){return _0x46472e[_0xe011('0x19')](_0x241e92);}return _0x46472e[_0xe011('0x1a')](_0x241e92)[_0xe011('0x1b')]();};}function respondWithResult(_0x18d8a4,_0x7b2475){_0x7b2475=_0x7b2475||0xc8;return function(_0x471f5e){if(_0x471f5e){return _0x18d8a4['status'](_0x7b2475)['json'](_0x471f5e);}};}function respondWithFilteredResult(_0x1834c3,_0x22eafb){return function(_0x16e700){if(_0x16e700){var _0x1e1a8b=typeof _0x22eafb[_0xe011('0x1c')]===_0xe011('0x1d')&&typeof _0x22eafb[_0xe011('0x1e')]===_0xe011('0x1d');var _0x34d31e=_0x16e700['count'];var _0x5a3f61=_0x1e1a8b?0x0:_0x22eafb[_0xe011('0x1c')];var _0x52a205=_0x1e1a8b?_0x16e700['count']:_0x22eafb[_0xe011('0x1c')]+_0x22eafb[_0xe011('0x1e')];var _0x2eee76;if(_0x52a205>=_0x34d31e){_0x52a205=_0x34d31e;_0x2eee76=0xc8;}else{_0x2eee76=0xce;}_0x1834c3[_0xe011('0x1a')](_0x2eee76);return _0x1834c3['set'](_0xe011('0x1f'),_0x5a3f61+'-'+_0x52a205+'/'+_0x34d31e)['json'](_0x16e700);}return null;};}function patchUpdates(_0x351cc7){return function(_0x3cbd95){try{jsonpatch['apply'](_0x3cbd95,_0x351cc7,!![]);}catch(_0x5206fa){return BPromise['reject'](_0x5206fa);}return _0x3cbd95[_0xe011('0x20')]();};}function saveUpdates(_0x166225,_0x19c2ae){return function(_0x10be34){if(_0x10be34){return _0x10be34[_0xe011('0x21')](_0x166225)[_0xe011('0x22')](function(_0x447301){return _0x447301;});}return null;};}function removeEntity(_0x403f50,_0x2924b3){return function(_0x4af8f){if(_0x4af8f){return _0x4af8f[_0xe011('0x23')]()[_0xe011('0x22')](function(){var _0xc93b96=_0x4af8f[_0xe011('0x24')]({'plain':!![]});var _0x346396=_0xe011('0x25');return db[_0xe011('0x26')][_0xe011('0x23')]({'where':{'type':_0x346396,'resourceId':_0xc93b96['id']}})[_0xe011('0x22')](function(){return _0x4af8f;});})[_0xe011('0x22')](function(){_0x403f50[_0xe011('0x1a')](0xcc)[_0xe011('0x1b')]();});}};}function handleEntityNotFound(_0x131d5e,_0x5727ca){return function(_0x533382){if(!_0x533382){_0x131d5e[_0xe011('0x19')](0x194);}return _0x533382;};}function handleError(_0x118bb0,_0x3c2034){_0x3c2034=_0x3c2034||0x1f4;return function(_0x6c0765){logger['error'](_0x6c0765[_0xe011('0x27')]);if(_0x6c0765[_0xe011('0x28')]){delete _0x6c0765[_0xe011('0x28')];}_0x118bb0[_0xe011('0x1a')](_0x3c2034)[_0xe011('0x29')](_0x6c0765);};}exports[_0xe011('0x2a')]=function(_0x41b20f,_0x553557){var _0x214662={},_0x17b731={},_0x2f13c2={'count':0x0,'rows':[]};return db[_0xe011('0x2b')][_0xe011('0x2c')]()[_0xe011('0x22')](function(_0x1f9c30){_0x17b731['model']=_[_0xe011('0x2d')](_0x1f9c30);_0x17b731[_0xe011('0x2e')]=_['keys'](_0x41b20f[_0xe011('0x2e')]);_0x17b731[_0xe011('0x2f')]=_['intersection'](_0x17b731[_0xe011('0x30')],_0x17b731['query']);_0x214662[_0xe011('0x31')]=_[_0xe011('0x32')](_0x17b731[_0xe011('0x30')],qs[_0xe011('0x33')](_0x41b20f['query'][_0xe011('0x33')]));_0x214662[_0xe011('0x31')]=_0x214662['attributes'][_0xe011('0x34')]?_0x214662[_0xe011('0x31')]:_0x17b731[_0xe011('0x30')];if(!_0x41b20f['query'][_0xe011('0x35')](_0xe011('0x36'))){_0x214662[_0xe011('0x1e')]=qs['limit'](_0x41b20f[_0xe011('0x2e')][_0xe011('0x1e')]);_0x214662[_0xe011('0x1c')]=qs[_0xe011('0x1c')](_0x41b20f['query'][_0xe011('0x1c')]);}_0x214662['order']=qs[_0xe011('0x37')](_0x41b20f[_0xe011('0x2e')][_0xe011('0x37')]);_0x214662[_0xe011('0x38')]=qs[_0xe011('0x2f')](_['pick'](_0x41b20f[_0xe011('0x2e')],_0x17b731[_0xe011('0x2f')]),_0x1f9c30);if(_0x41b20f[_0xe011('0x2e')][_0xe011('0x39')]){_0x214662[_0xe011('0x38')]=_[_0xe011('0x3a')](_0x214662[_0xe011('0x38')],{'$or':_['map'](_0x214662[_0xe011('0x31')],function(_0x5114a1){var _0x1700f3={};_0x1700f3[_0x5114a1]={'$like':'%'+_0x41b20f[_0xe011('0x2e')][_0xe011('0x39')]+'%'};return _0x1700f3;})});}_0x214662=_[_0xe011('0x3a')]({},_0x214662,_0x41b20f['options']);var _0x5f18a7={'where':_0x214662[_0xe011('0x38')]};return db[_0xe011('0x2b')]['count'](_0x5f18a7)['then'](function(_0x38e612){_0x2f13c2[_0xe011('0x3b')]=_0x38e612;if(_0x41b20f[_0xe011('0x2e')][_0xe011('0x3c')]){_0x214662[_0xe011('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0xe011('0x3e')](_0x214662);})[_0xe011('0x22')](function(_0x4f4f38){_0x2f13c2[_0xe011('0x3f')]=_0x4f4f38;return _0x2f13c2;})['then'](respondWithFilteredResult(_0x553557,_0x214662))[_0xe011('0x40')](handleError(_0x553557,null));})[_0xe011('0x40')](handleError(_0x553557,null));};exports[_0xe011('0x41')]=function(_0x4ab92b,_0x37261e){var _0x5fc099={'raw':![],'where':{'id':_0x4ab92b['params']['id']}},_0xafdbb1={};_0xafdbb1['model']=_[_0xe011('0x2d')](db[_0xe011('0x2b')][_0xe011('0x42')]);_0xafdbb1[_0xe011('0x2e')]=_[_0xe011('0x2d')](_0x4ab92b[_0xe011('0x2e')]);_0xafdbb1['filters']=_[_0xe011('0x32')](_0xafdbb1[_0xe011('0x30')],_0xafdbb1['query']);_0x5fc099[_0xe011('0x31')]=_[_0xe011('0x32')](_0xafdbb1[_0xe011('0x30')],qs[_0xe011('0x33')](_0x4ab92b[_0xe011('0x2e')]['fields']));_0x5fc099[_0xe011('0x31')]=_0x5fc099[_0xe011('0x31')]['length']?_0x5fc099[_0xe011('0x31')]:_0xafdbb1[_0xe011('0x30')];if(_0x4ab92b[_0xe011('0x2e')][_0xe011('0x3c')]){_0x5fc099['include']=[{'all':!![]}];}_0x5fc099=_[_0xe011('0x3a')]({},_0x5fc099,_0x4ab92b['options']);return db[_0xe011('0x2b')][_0xe011('0x43')](_0x5fc099)['then'](handleEntityNotFound(_0x37261e,null))[_0xe011('0x22')](respondWithResult(_0x37261e,null))[_0xe011('0x40')](handleError(_0x37261e,null));};exports[_0xe011('0x44')]=function(_0x4b13ca,_0x2cb0cd){return db['CmCompany']['create'](_0x4b13ca[_0xe011('0x45')],{})[_0xe011('0x22')](function(_0x4b71a5){var _0x1341eb=_0x4b13ca[_0xe011('0x46')]['get']({'plain':!![]});if(!_0x1341eb)throw new Error(_0xe011('0x47'));if(_0x1341eb['role']===_0xe011('0x46')){var _0x52bb01=_0x4b71a5[_0xe011('0x24')]({'plain':!![]});var _0x42a6a8=_0xe011('0x25');return db[_0xe011('0x48')][_0xe011('0x43')]({'where':{'name':_0x42a6a8,'userProfileId':_0x1341eb['userProfileId']},'raw':!![]})['then'](function(_0x35147f){if(_0x35147f&&_0x35147f[_0xe011('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x52bb01[_0xe011('0x28')],'resourceId':_0x52bb01['id'],'type':_0x35147f[_0xe011('0x28')],'sectionId':_0x35147f['id']},{})['then'](function(){return _0x4b71a5;});}else{return _0x4b71a5;}})['catch'](function(_0x1b8a89){logger[_0xe011('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b8a89);throw _0x1b8a89;});}return _0x4b71a5;})['then'](respondWithResult(_0x2cb0cd,0xc9))[_0xe011('0x40')](handleError(_0x2cb0cd,null));};exports[_0xe011('0x21')]=function(_0x1cd6cc,_0xe645b8){if(_0x1cd6cc[_0xe011('0x45')]['id']){delete _0x1cd6cc[_0xe011('0x45')]['id'];}return db[_0xe011('0x2b')][_0xe011('0x43')]({'where':{'id':_0x1cd6cc[_0xe011('0x4b')]['id']}})[_0xe011('0x22')](handleEntityNotFound(_0xe645b8,null))['then'](saveUpdates(_0x1cd6cc[_0xe011('0x45')],null))[_0xe011('0x22')](respondWithResult(_0xe645b8,null))[_0xe011('0x40')](handleError(_0xe645b8,null));};exports['destroy']=function(_0x117804,_0x46414b){return db[_0xe011('0x2b')][_0xe011('0x43')]({'where':{'id':_0x117804[_0xe011('0x4b')]['id']}})[_0xe011('0x22')](handleEntityNotFound(_0x46414b,null))[_0xe011('0x22')](removeEntity(_0x46414b,null))[_0xe011('0x40')](handleError(_0x46414b,null));};exports['describe']=function(_0x2141be,_0x4a18be){return db[_0xe011('0x2b')][_0xe011('0x2c')]()[_0xe011('0x22')](respondWithResult(_0x4a18be,null))[_0xe011('0x40')](handleError(_0x4a18be,null));};exports[_0xe011('0x4c')]=function(_0x478036,_0x5351ae,_0x559a65){return db[_0xe011('0x4d')][_0xe011('0x43')]({'where':{'id':_0x478036['params']['id']}})[_0xe011('0x22')](handleEntityNotFound(_0x5351ae,null))[_0xe011('0x22')](function(_0x35d3c0){if(_0x35d3c0){return _0x35d3c0[_0xe011('0x4c')](_0x478036[_0xe011('0x45')][_0xe011('0x4e')],_[_0xe011('0x4f')](_0x478036['body'],['ids','id'])||{});}})[_0xe011('0x22')](respondWithResult(_0x5351ae,null))[_0xe011('0x40')](handleError(_0x5351ae,null));};exports['getContacts']=function(_0x3784ca,_0x1f46cb,_0x5e9a0b){var _0x7e0b47={};var _0x3d37b5={};var _0x1d050d;var _0x38deaa;return db['CmCompany'][_0xe011('0x50')]({'where':{'id':_0x3784ca[_0xe011('0x4b')]['id']}})[_0xe011('0x22')](handleEntityNotFound(_0x1f46cb,null))[_0xe011('0x22')](function(_0x2dc36a){if(_0x2dc36a){_0x1d050d=_0x2dc36a;_0x3d37b5[_0xe011('0x30')]=_['keys'](db['CmContact'][_0xe011('0x42')]);_0x3d37b5[_0xe011('0x2e')]=_[_0xe011('0x2d')](_0x3784ca[_0xe011('0x2e')]);_0x3d37b5[_0xe011('0x2f')]=_[_0xe011('0x32')](_0x3d37b5[_0xe011('0x30')],_0x3d37b5[_0xe011('0x2e')]);_0x7e0b47[_0xe011('0x31')]=_[_0xe011('0x32')](_0x3d37b5[_0xe011('0x30')],qs[_0xe011('0x33')](_0x3784ca['query'][_0xe011('0x33')]));_0x7e0b47[_0xe011('0x31')]=_0x7e0b47[_0xe011('0x31')][_0xe011('0x34')]?_0x7e0b47[_0xe011('0x31')]:_0x3d37b5[_0xe011('0x30')];_0x7e0b47[_0xe011('0x51')]=qs['sort'](_0x3784ca[_0xe011('0x2e')][_0xe011('0x37')]);_0x7e0b47[_0xe011('0x38')]=qs[_0xe011('0x2f')](_[_0xe011('0x52')](_0x3784ca[_0xe011('0x2e')],_0x3d37b5[_0xe011('0x2f')]));if(_0x3784ca[_0xe011('0x2e')]['filter']){_0x7e0b47[_0xe011('0x38')]=_['merge'](_0x7e0b47[_0xe011('0x38')],{'$or':_[_0xe011('0x53')](_0x7e0b47[_0xe011('0x31')],function(_0x307502){var _0x233c60={};_0x233c60[_0x307502]={'$like':'%'+_0x3784ca[_0xe011('0x2e')][_0xe011('0x39')]+'%'};return _0x233c60;})});}_0x7e0b47=_[_0xe011('0x3a')]({},_0x7e0b47,_0x3784ca[_0xe011('0x54')]);return _0x1d050d[_0xe011('0x55')](_0x7e0b47);}})['then'](function(_0x1e675f){if(_0x1e675f){_0x38deaa=_0x1e675f[_0xe011('0x34')];if(!_0x3784ca[_0xe011('0x2e')]['hasOwnProperty'](_0xe011('0x36'))){_0x7e0b47[_0xe011('0x1e')]=qs[_0xe011('0x1e')](_0x3784ca['query'][_0xe011('0x1e')]);_0x7e0b47['offset']=qs[_0xe011('0x1c')](_0x3784ca[_0xe011('0x2e')]['offset']);}return _0x1d050d[_0xe011('0x55')](_0x7e0b47);}})[_0xe011('0x22')](function(_0xd11191){if(_0xd11191){return _0xd11191?{'count':_0x38deaa,'rows':_0xd11191}:null;}})[_0xe011('0x22')](respondWithResult(_0x1f46cb,null))[_0xe011('0x40')](handleError(_0x1f46cb,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ec9d755..8e6a620 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 _0x49f6=['bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x5794a7,_0x40ae05){var _0x200529=function(_0x14d89c){while(--_0x14d89c){_0x5794a7['push'](_0x5794a7['shift']());}};_0x200529(++_0x40ae05);}(_0x49f6,0x10f));var _0x649f=function(_0x57cd9d,_0x372796){_0x57cd9d=_0x57cd9d-0x0;var _0x3778c5=_0x49f6[_0x57cd9d];return _0x3778c5;};'use strict';var _=require(_0x649f('0x0'));var util=require(_0x649f('0x1'));var logger=require(_0x649f('0x2'))(_0x649f('0x3'));var moment=require(_0x649f('0x4'));var BPromise=require(_0x649f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x649f('0x6'));var rimraf=require(_0x649f('0x7'));var config=require(_0x649f('0x8'));var attributes=require(_0x649f('0x9'));module['exports']=function(_0x5acf94,_0x37035a){return _0x5acf94['define'](_0x649f('0xa'),attributes,{'tableName':_0x649f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x989a=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x4e14f2,_0x3443fd){var _0x54d490=function(_0x559743){while(--_0x559743){_0x4e14f2['push'](_0x4e14f2['shift']());}};_0x54d490(++_0x3443fd);}(_0x989a,0x9a));var _0xa989=function(_0x5bb1ef,_0x554b89){_0x5bb1ef=_0x5bb1ef-0x0;var _0x2d03f7=_0x989a[_0x5bb1ef];return _0x2d03f7;};'use strict';var _=require(_0xa989('0x0'));var util=require(_0xa989('0x1'));var logger=require(_0xa989('0x2'))(_0xa989('0x3'));var moment=require(_0xa989('0x4'));var BPromise=require(_0xa989('0x5'));var rp=require(_0xa989('0x6'));var fs=require('fs');var path=require(_0xa989('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xa989('0x8')]=function(_0x40962a,_0x4f4c95){return _0x40962a[_0xa989('0x9')](_0xa989('0xa'),attributes,{'tableName':_0xa989('0xb'),'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 c641d87..efc3378 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 _0x80b8=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmCompany,\x20%s,\x20%s','message','info','lodash'];(function(_0x538333,_0x308de1){var _0x4f92b8=function(_0x289270){while(--_0x289270){_0x538333['push'](_0x538333['shift']());}};_0x4f92b8(++_0x308de1);}(_0x80b8,0x17b));var _0x880b=function(_0x5b2625,_0x4822bf){_0x5b2625=_0x5b2625-0x0;var _0x5bcb5c=_0x80b8[_0x5b2625];return _0x5bcb5c;};'use strict';var _=require(_0x880b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x880b('0x1'));var rs=require(_0x880b('0x2'));var fs=require('fs');var Redis=require(_0x880b('0x3'));var db=require(_0x880b('0x4'))['db'];var utils=require(_0x880b('0x5'));var logger=require(_0x880b('0x6'))(_0x880b('0x7'));var config=require('../../config/environment');var jayson=require(_0x880b('0x8'));var client=jayson['client'][_0x880b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fa84e,_0xe50da3,_0x37bc9f){return new BPromise(function(_0x4bf6e4,_0x12c90d){return client[_0x880b('0xa')](_0x1fa84e,_0x37bc9f)[_0x880b('0xb')](function(_0x737651){logger['info']('CmCompany,\x20%s,\x20%s',_0xe50da3,'request\x20sent');logger['debug'](_0x880b('0xc'),_0xe50da3,_0x880b('0xd'),JSON['stringify'](_0x737651));if(_0x737651['error']){if(_0x737651[_0x880b('0xe')][_0x880b('0xf')]===0x1f4){logger[_0x880b('0xe')](_0x880b('0x10'),_0xe50da3,_0x737651['error'][_0x880b('0x11')]);return _0x12c90d(_0x737651[_0x880b('0xe')][_0x880b('0x11')]);}logger[_0x880b('0xe')]('CmCompany,\x20%s,\x20%s',_0xe50da3,_0x737651['error'][_0x880b('0x11')]);return _0x4bf6e4(_0x737651[_0x880b('0xe')][_0x880b('0x11')]);}else{logger[_0x880b('0x12')](_0x880b('0x10'),_0xe50da3,_0x880b('0xd'));_0x4bf6e4(_0x737651['result'][_0x880b('0x11')]);}})['catch'](function(_0x4587f0){logger[_0x880b('0xe')](_0x880b('0x10'),_0xe50da3,_0x4587f0);_0x12c90d(_0x4587f0);});});} \ No newline at end of file +var _0x66d4=['client','then','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1330ee,_0x2b16bf){var _0x33eea4=function(_0x5b4ad0){while(--_0x5b4ad0){_0x1330ee['push'](_0x1330ee['shift']());}};_0x33eea4(++_0x2b16bf);}(_0x66d4,0x90));var _0x466d=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0x66d4[_0x4f11cb];return _0x491488;};'use strict';var _=require(_0x466d('0x0'));var util=require(_0x466d('0x1'));var moment=require(_0x466d('0x2'));var BPromise=require(_0x466d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x466d('0x4'));var db=require(_0x466d('0x5'))['db'];var utils=require(_0x466d('0x6'));var logger=require(_0x466d('0x7'))('rpc');var config=require(_0x466d('0x8'));var jayson=require(_0x466d('0x9'));var client=jayson[_0x466d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24360b,_0x3afd79,_0x5bad1d){return new BPromise(function(_0x3b76b0,_0x4140ed){return client['request'](_0x24360b,_0x5bad1d)[_0x466d('0xb')](function(_0x6c06dd){logger['info']('CmCompany,\x20%s,\x20%s',_0x3afd79,'request\x20sent');logger[_0x466d('0xc')](_0x466d('0xd'),_0x3afd79,_0x466d('0xe'),JSON[_0x466d('0xf')](_0x6c06dd));if(_0x6c06dd['error']){if(_0x6c06dd[_0x466d('0x10')][_0x466d('0x11')]===0x1f4){logger['error'](_0x466d('0x12'),_0x3afd79,_0x6c06dd[_0x466d('0x10')][_0x466d('0x13')]);return _0x4140ed(_0x6c06dd[_0x466d('0x10')][_0x466d('0x13')]);}logger['error'](_0x466d('0x12'),_0x3afd79,_0x6c06dd[_0x466d('0x10')][_0x466d('0x13')]);return _0x3b76b0(_0x6c06dd[_0x466d('0x10')]['message']);}else{logger[_0x466d('0x14')](_0x466d('0x12'),_0x3afd79,_0x466d('0xe'));_0x3b76b0(_0x6c06dd['result'][_0x466d('0x13')]);}})[_0x466d('0x15')](function(_0x50b03){logger[_0x466d('0x10')](_0x466d('0x12'),_0x3afd79,_0x50b03);_0x4140ed(_0x50b03);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a7e434a..49b57b9 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 _0xbc48=['post','create','/:id/contacts','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','describe','/:id','isAuthenticated','show','getContacts'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xbc48,0x111));var _0x8bc4=function(_0x47b007,_0x322a07){_0x47b007=_0x47b007-0x0;var _0x35742b=_0xbc48[_0x47b007];return _0x35742b;};'use strict';var multer=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var path=require(_0x8bc4('0x2'));var timeout=require(_0x8bc4('0x3'));var express=require('express');var router=express[_0x8bc4('0x4')]();var fs_extra=require(_0x8bc4('0x5'));var auth=require(_0x8bc4('0x6'));var interaction=require(_0x8bc4('0x7'));var config=require('../../config/environment');var controller=require(_0x8bc4('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8bc4('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x8bc4('0xa')]);router['get'](_0x8bc4('0xb'),auth[_0x8bc4('0xc')](),controller[_0x8bc4('0xd')]);router[_0x8bc4('0x9')]('/:id/contacts',auth[_0x8bc4('0xc')](),controller[_0x8bc4('0xe')]);router[_0x8bc4('0xf')]('/',auth[_0x8bc4('0xc')](),controller[_0x8bc4('0x10')]);router[_0x8bc4('0xf')](_0x8bc4('0x11'),auth[_0x8bc4('0xc')](),controller[_0x8bc4('0x12')]);router[_0x8bc4('0x13')](_0x8bc4('0xb'),auth[_0x8bc4('0xc')](),controller[_0x8bc4('0x14')]);router[_0x8bc4('0x15')](_0x8bc4('0xb'),auth['isAuthenticated'](),controller[_0x8bc4('0x16')]);module[_0x8bc4('0x17')]=router; \ No newline at end of file +var _0x53ec=['describe','/:id','show','/:id/contacts','getContacts','create','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','get','/describe'];(function(_0x55f435,_0x1e9ffa){var _0x456300=function(_0x560790){while(--_0x560790){_0x55f435['push'](_0x55f435['shift']());}};_0x456300(++_0x1e9ffa);}(_0x53ec,0x192));var _0xc53e=function(_0x5c6f37,_0x53bc84){_0x5c6f37=_0x5c6f37-0x0;var _0x4ae388=_0x53ec[_0x5c6f37];return _0x4ae388;};'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 fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc53e('0x11')]);router['post']('/:id/contacts',auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0x13')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xc53e('0x14')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x15')]);module[_0xc53e('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 6447222..3835f3c 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 _0x2520=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','INTEGER'];(function(_0x4161ac,_0x799647){var _0x2140ed=function(_0x2f98c8){while(--_0x2f98c8){_0x4161ac['push'](_0x4161ac['shift']());}};_0x2140ed(++_0x799647);}(_0x2520,0x128));var _0x0252=function(_0x2adcb0,_0x2502aa){_0x2adcb0=_0x2adcb0-0x0;var _0x4233d1=_0x2520[_0x2adcb0];return _0x4233d1;};'use strict';var _=require(_0x0252('0x0'));var Sequelize=require(_0x0252('0x1'));module[_0x0252('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0252('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0252('0x3')]},'country':{'type':Sequelize[_0x0252('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0252('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x0252('0x3')]},'mobile':{'type':Sequelize[_0x0252('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0252('0x3')]},'url':{'type':Sequelize[_0x0252('0x3')]},'facebook':{'type':Sequelize[_0x0252('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0252('0x3')]},'skype':{'type':Sequelize[_0x0252('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x0252('0x3')]},'line':{'type':Sequelize[_0x0252('0x3')]},'wechat':{'type':Sequelize[_0x0252('0x3')]},'telegram':{'type':Sequelize[_0x0252('0x3')]},'UserId':{'type':Sequelize[_0x0252('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0252('0x4')](0x2)[_0x0252('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0252('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x0252('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1e64=['INTEGER','lodash','sequelize','exports','STRING','TEXT','UNSIGNED','DATE','NOW'];(function(_0x11bdd4,_0x2f0483){var _0x6fde61=function(_0x5239cf){while(--_0x5239cf){_0x11bdd4['push'](_0x11bdd4['shift']());}};_0x6fde61(++_0x2f0483);}(_0x1e64,0x184));var _0x41e6=function(_0x2518b1,_0x2d0062){_0x2518b1=_0x2518b1-0x0;var _0x336a4f=_0x1e64[_0x2518b1];return _0x336a4f;};'use strict';var _=require(_0x41e6('0x0'));var Sequelize=require(_0x41e6('0x1'));module[_0x41e6('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x41e6('0x3')]},'street':{'type':Sequelize[_0x41e6('0x3')]},'postalCode':{'type':Sequelize[_0x41e6('0x3')]},'city':{'type':Sequelize[_0x41e6('0x3')]},'country':{'type':Sequelize[_0x41e6('0x3')]},'dateOfBirth':{'type':Sequelize[_0x41e6('0x3')]},'description':{'type':Sequelize[_0x41e6('0x4')]},'phone':{'type':Sequelize[_0x41e6('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x41e6('0x3')]},'email':{'type':Sequelize[_0x41e6('0x3')]},'url':{'type':Sequelize[_0x41e6('0x3')]},'facebook':{'type':Sequelize[_0x41e6('0x3')]},'fb_data':{'type':Sequelize[_0x41e6('0x3')]},'twitter':{'type':Sequelize[_0x41e6('0x3')]},'skype':{'type':Sequelize[_0x41e6('0x3')]},'teams':{'type':Sequelize[_0x41e6('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x41e6('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x41e6('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x41e6('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x41e6('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x41e6('0x6')],'defaultValue':Sequelize[_0x41e6('0x7')]},'dialTimezone':{'type':Sequelize[_0x41e6('0x3')]},'utcOffset':{'type':Sequelize[_0x41e6('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 013f164..a5770b2 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 2841aa7..b66d573 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4805=['CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4805,0x184));var _0x5480=function(_0x2b47c8,_0x51cecb){_0x2b47c8=_0x2b47c8-0x0;var _0x15266f=_0x4805[_0x2b47c8];return _0x15266f;};'use strict';var EventEmitter=require(_0x5480('0x0'));var CmContact=require(_0x5480('0x1'))['db'][_0x5480('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x5480('0x3')](0x0);var events={'afterCreate':_0x5480('0x4'),'afterUpdate':_0x5480('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3abe98){return function(_0x48d294,_0x2a677f,_0x11cfec){CmContactEvents[_0x5480('0x6')](_0x3abe98+':'+_0x48d294['id'],_0x48d294);CmContactEvents[_0x5480('0x6')](_0x3abe98,_0x48d294);_0x11cfec(null);};}for(var e in events){if(events[_0x5480('0x7')](e)){var event=events[e];CmContact[_0x5480('0x8')](e,emitEvent(event));}}module[_0x5480('0x9')]=CmContactEvents; \ No newline at end of file +var _0x75bf=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove','emit'];(function(_0x3665b9,_0x3b5d4f){var _0x524099=function(_0x876977){while(--_0x876977){_0x3665b9['push'](_0x3665b9['shift']());}};_0x524099(++_0x3b5d4f);}(_0x75bf,0x153));var _0xf75b=function(_0x355677,_0x443963){_0x355677=_0x355677-0x0;var _0x3dc60e=_0x75bf[_0x355677];return _0x3dc60e;};'use strict';var EventEmitter=require(_0xf75b('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf75b('0x1')](0x0);var events={'afterCreate':_0xf75b('0x2'),'afterUpdate':'update','afterDestroy':_0xf75b('0x3')};function emitEvent(_0x38990b){return function(_0x1672c3,_0xed710,_0x2f0800){CmContactEvents[_0xf75b('0x4')](_0x38990b+':'+_0x1672c3['id'],_0x1672c3);CmContactEvents['emit'](_0x38990b,_0x1672c3);_0x2f0800(null);};}for(var e in events){if(events[_0xf75b('0x5')](e)){var event=events[e];CmContact[_0xf75b('0x6')](e,emitEvent(event));}}module[_0xf75b('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index dcee5b6..839d307 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6afb=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','get','onlyIfOpen','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','always','error','List\x20not\x20found','ContactId','VoiceQueueId','CampaignId','push','all','info','lodash','util','../../config/logger','api','../../config/environment','../../config/environment/shared','exports','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','models','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','findOne','isNil','dialTimezone','utcOffset','then','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','inspect','Campaign','timezones','minutes'];(function(_0x3cb570,_0x1f5937){var _0x572da6=function(_0x1834cd){while(--_0x1834cd){_0x3cb570['push'](_0x3cb570['shift']());}};_0x572da6(++_0x1f5937);}(_0x6afb,0x1f2));var _0xb6af=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x6afb[_0x589f71];return _0x5763bd;};'use strict';var _=require(_0xb6af('0x0'));var util=require(_0xb6af('0x1'));var logger=require(_0xb6af('0x2'))(_0xb6af('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('rimraf');var config=require(_0xb6af('0x4'));var shared=require(_0xb6af('0x5'));var attributes=require('./cmContact.attributes');module[_0xb6af('0x6')]=function(_0x4ecfb2,_0x82410a){return _0x4ecfb2['define'](_0xb6af('0x7'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xb6af('0x8'),'fields':[_0xb6af('0x8')]},{'name':_0xb6af('0x9'),'fields':[_0xb6af('0xa'),_0xb6af('0xb'),_0xb6af('0x8'),_0xb6af('0xc'),_0xb6af('0xd'),_0xb6af('0xe')],'type':_0xb6af('0xf')}],'timestamps':!![],'charset':_0xb6af('0x10'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x4b8bd2,_0x3d6568,_0x5ef6c5){var _0x3d54ab=_0x4ecfb2[_0xb6af('0x11')];var _0x4acdd2=_0x4b8bd2['get']({'plain':!![]});function _0x593b35(){return function(_0xe7fc1a){logger['error'](_0xb6af('0x12'),_0xb6af('0x13'),util['inspect'](_0xe7fc1a,{'showHidden':![],'depth':null}));};}function _0x1f9419(_0x339bd5,_0x353010){var _0x5166c3=_0x353010[_0xb6af('0x14')]?_0x353010['scheduledat']:moment()[_0xb6af('0x15')](_0xb6af('0x16'));return new BPromise(function(_0x1a490d,_0x351670){if(_['isNil'](_0x353010['dialTimezone'])){_0x1a490d({'ret':_0x5166c3});}else{_0x3d54ab[_0xb6af('0x17')][_0xb6af('0x18')]({'where':{'id':_0x339bd5['id']}})['then'](function(_0x9ee230){if(!_[_0xb6af('0x19')](_0x9ee230)){var _0x278ee3=_0x9ee230['dialTimezone'];if(!_[_0xb6af('0x19')](_0x278ee3)){var _0x59e1d4=shared['timezones'];var _0x4e0a64=_0x59e1d4[_0x278ee3];var _0x50b9b6=_0x59e1d4[_0x353010[_0xb6af('0x1a')]];if(!_[_0xb6af('0x19')](_0x4e0a64)&&!_[_0xb6af('0x19')](_0x50b9b6)){var _0x1e1900=_0x4e0a64[_0xb6af('0x1b')]-_0x50b9b6[_0xb6af('0x1b')];_0x5166c3=_0x353010['scheduledat']?_0x353010[_0xb6af('0x14')]:moment();var _0x188f3d=moment(_0x5166c3)['add'](_0x1e1900,'minutes');_0x1a490d({'ret':_0x188f3d[_0xb6af('0x15')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1a490d({'ret':_0x5166c3});}else _0x1a490d({'ret':_0x5166c3});}else{_0x1a490d({'ret':_0x5166c3});}});}});return 0xa;}var _0x163da8=function(_0x383157){return new BPromise(function(_0x3ea955,_0x59445b){_0x1f9419(_0x383157,_0x4acdd2)[_0xb6af('0x1c')](function(_0x71126){_0x4acdd2[_0xb6af('0x14')]=_0x71126[_0xb6af('0x1d')];_0x3d54ab[_0xb6af('0x1e')][_0xb6af('0x18')]({'where':{'phone':_0x4acdd2[_0xb6af('0x8')],'VoiceQueueId':_0x383157['id']}})[_0xb6af('0x1c')](function(_0x4215fd){if(!_[_0xb6af('0x19')](_0x4215fd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4acdd2[_0xb6af('0x8')]+_0xb6af('0x1f')+_0x383157['id']);}return _0x3d54ab['CmHopper']['create']({'phone':_0x4acdd2[_0xb6af('0x8')],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2[_0xb6af('0x20')],'priority':_0x4acdd2[_0xb6af('0x21')]?_0x4acdd2[_0xb6af('0x21')]:0x2,'scheduledat':_0x4acdd2[_0xb6af('0x14')]?_0x4acdd2['scheduledat']:moment()[_0xb6af('0x15')](_0xb6af('0x16')),'callback':_0x4acdd2[_0xb6af('0x22')]?!![]:![],'callbackuniqueid':_0x4acdd2[_0xb6af('0x22')]?_0x4acdd2[_0xb6af('0x22')]:undefined,'callbackat':_0x4acdd2[_0xb6af('0x22')]?moment()[_0xb6af('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x383157['id']});})[_0xb6af('0x23')](function(_0x3dfe98){_0x59445b(_0x3dfe98);});});});};var _0x1e3a66=function(_0x5c095e){return new BPromise(function(_0x48cf6b,_0x5e6eae){_0x1f9419(_0x5c095e,_0x4acdd2)['then'](function(_0x478a1a){_0x4acdd2[_0xb6af('0x14')]=_0x478a1a['ret'];_0x3d54ab['CmHopper']['findOne']({'where':{'phone':_0x4acdd2[_0xb6af('0x8')],'VoiceQueueId':_0x5c095e['id']}})[_0xb6af('0x1c')](function(_0x1086d8){if(!_['isNil'](_0x1086d8)){throw new Error(_0xb6af('0x24')+_0x4acdd2[_0xb6af('0x8')]+_0xb6af('0x25')+_0x5c095e['id']);}return _0x3d54ab[_0xb6af('0x26')][_0xb6af('0x18')]({'where':{'calleridnum':_0x4acdd2[_0xb6af('0x8')],'VoiceQueueId':_0x5c095e['id']}});})['then'](function(_0x48dff8){if(!_[_0xb6af('0x19')](_0x48dff8)){throw new Error(_0xb6af('0x27')+_0x4acdd2[_0xb6af('0x8')]+_0xb6af('0x28')+_0x5c095e['id']);}return _0x3d54ab[_0xb6af('0x1e')][_0xb6af('0x29')]({'phone':_0x4acdd2[_0xb6af('0x8')],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2['ListId'],'priority':_0x4acdd2['priority']?_0x4acdd2[_0xb6af('0x21')]:0x2,'scheduledat':_0x4acdd2[_0xb6af('0x14')]?_0x4acdd2['scheduledat']:moment()[_0xb6af('0x15')](_0xb6af('0x16')),'callback':_0x4acdd2[_0xb6af('0x22')]?!![]:![],'callbackuniqueid':_0x4acdd2[_0xb6af('0x22')]?_0x4acdd2[_0xb6af('0x22')]:undefined,'callbackat':_0x4acdd2[_0xb6af('0x22')]?moment()[_0xb6af('0x15')](_0xb6af('0x16')):undefined,'VoiceQueueId':_0x5c095e['id']});})[_0xb6af('0x23')](function(_0x155f62){_0x5e6eae(_0x155f62);});});});};function _0x1f81e1(){return function(_0x32e418){logger['error'](_0xb6af('0x12'),'afterCreate',util[_0xb6af('0x2a')](_0x32e418,{'showHidden':![],'depth':null}));};}function _0xf27954(_0x686f73,_0x55f8ef){var _0x5d18c3=_0x55f8ef[_0xb6af('0x14')]?_0x55f8ef[_0xb6af('0x14')]:moment()[_0xb6af('0x15')](_0xb6af('0x16'));return new BPromise(function(_0x18cc13,_0x254241){if(_['isNil'](_0x55f8ef[_0xb6af('0x1a')])){_0x18cc13({'ret':_0x5d18c3});}else{_0x3d54ab[_0xb6af('0x2b')][_0xb6af('0x18')]({'where':{'id':_0x686f73['id']}})['then'](function(_0x14d539){if(!_['isNil'](_0x14d539)){var _0x288d44=_0x14d539['dialTimezone'];if(!_[_0xb6af('0x19')](_0x288d44)){var _0x2bfa9b=shared[_0xb6af('0x2c')];var _0xb83516=_0x2bfa9b[_0x288d44];var _0x32f4f9=_0x2bfa9b[_0x55f8ef[_0xb6af('0x1a')]];if(!_[_0xb6af('0x19')](_0xb83516)&&!_['isNil'](_0x32f4f9)){var _0x1f883c=_0xb83516['utcOffset']-_0x32f4f9[_0xb6af('0x1b')];_0x5d18c3=_0x55f8ef[_0xb6af('0x14')]?_0x55f8ef[_0xb6af('0x14')]:moment();var _0x10c383=moment(_0x5d18c3)['add'](_0x1f883c,_0xb6af('0x2d'));_0x18cc13({'ret':_0x10c383[_0xb6af('0x15')](_0xb6af('0x16'))});}else _0x18cc13({'ret':_0x5d18c3});}else _0x18cc13({'ret':_0x5d18c3});}else{_0x18cc13({'ret':_0x5d18c3});}});}});return 0xa;}var _0xdd8457=function(_0x4c9b54){return new BPromise(function(_0x5db274,_0x5df1c3){_0xf27954(_0x4c9b54,_0x4acdd2)[_0xb6af('0x1c')](function(_0x211347){_0x4acdd2[_0xb6af('0x14')]=_0x211347[_0xb6af('0x1d')];_0x3d54ab[_0xb6af('0x1e')][_0xb6af('0x18')]({'where':{'phone':_0x4acdd2[_0xb6af('0x8')],'CampaignId':_0x4c9b54['id']}})[_0xb6af('0x1c')](function(_0x40934a){if(!_[_0xb6af('0x19')](_0x40934a)){throw new Error(_0xb6af('0x24')+_0x4acdd2[_0xb6af('0x8')]+_0xb6af('0x2e')+_0x4c9b54['id']);}return _0x3d54ab['CmHopper'][_0xb6af('0x29')]({'phone':_0x4acdd2['phone'],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2[_0xb6af('0x20')],'priority':_0x4acdd2[_0xb6af('0x21')]?_0x4acdd2[_0xb6af('0x21')]:0x2,'scheduledat':_0x4acdd2['scheduledat']?_0x4acdd2[_0xb6af('0x14')]:moment()[_0xb6af('0x15')](_0xb6af('0x16')),'callback':_0x4acdd2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4acdd2[_0xb6af('0x22')]?_0x4acdd2['callbackUniqueid']:undefined,'callbackat':_0x4acdd2['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4c9b54['id']});})[_0xb6af('0x23')](function(_0x2f3156){_0x5df1c3(_0x2f3156);});});});};var _0x43e8b4=function(_0x1760fe){return new BPromise(function(_0x4e34a9,_0x2817b6){_0xf27954(_0x1760fe,_0x4acdd2)[_0xb6af('0x1c')](function(_0x10163c){_0x4acdd2['scheduledat']=_0x10163c[_0xb6af('0x1d')];_0x3d54ab['CmHopper'][_0xb6af('0x18')]({'where':{'phone':_0x4acdd2['phone'],'CampaignId':_0x1760fe['id']}})['then'](function(_0x1cf2be){if(!_[_0xb6af('0x19')](_0x1cf2be)){throw new Error(_0xb6af('0x24')+_0x4acdd2[_0xb6af('0x8')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1760fe['id']);}return _0x3d54ab[_0xb6af('0x26')]['findOne']({'where':{'calleridnum':_0x4acdd2[_0xb6af('0x8')],'CampaignId':_0x1760fe['id']}});})[_0xb6af('0x1c')](function(_0x129e41){if(!_[_0xb6af('0x19')](_0x129e41)){throw new Error(_0xb6af('0x27')+_0x4acdd2[_0xb6af('0x8')]+_0xb6af('0x2f')+_0x1760fe['id']);}return _0x3d54ab[_0xb6af('0x1e')][_0xb6af('0x29')]({'phone':_0x4acdd2[_0xb6af('0x8')],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2[_0xb6af('0x20')],'priority':_0x4acdd2[_0xb6af('0x21')]?_0x4acdd2[_0xb6af('0x21')]:0x2,'scheduledat':_0x4acdd2[_0xb6af('0x14')]?_0x4acdd2[_0xb6af('0x14')]:moment()[_0xb6af('0x15')](_0xb6af('0x16')),'callback':_0x4acdd2[_0xb6af('0x22')]?!![]:![],'callbackuniqueid':_0x4acdd2[_0xb6af('0x22')]?_0x4acdd2[_0xb6af('0x22')]:undefined,'callbackat':_0x4acdd2[_0xb6af('0x22')]?moment()[_0xb6af('0x15')](_0xb6af('0x16')):undefined,'CampaignId':_0x1760fe['id']});})[_0xb6af('0x23')](function(_0x13f4f2){_0x2817b6(_0x13f4f2);});});});};if(_0x4acdd2[_0xb6af('0x20')]){_0x3d54ab['VoiceQueue'][_0xb6af('0x30')]({'where':{'type':'outbound'},'attributes':['id',_0xb6af('0x31'),_0xb6af('0x1a')],'include':[{'model':_0x3d54ab[_0xb6af('0x32')],'as':_0xb6af('0x33'),'where':{'id':_0x4acdd2[_0xb6af('0x20')]}}]})[_0xb6af('0x1c')](function(_0x3bbb0f){if(_0x3bbb0f){var _0x2374bd=[];for(var _0x34ee3c=0x0,_0xd47ad1;_0x34ee3c<_0x3bbb0f['length'];_0x34ee3c+=0x1){_0xd47ad1=_0x3bbb0f[_0x34ee3c][_0xb6af('0x34')]({'plain':!![]});switch(_0xd47ad1[_0xb6af('0x31')]){case'always':_0x1e3a66(_0xd47ad1)['catch'](_0x593b35());break;case _0xb6af('0x35'):_0x163da8(_0xd47ad1)['catch'](_0x593b35());break;default:_0xf27954(_0xd47ad1,_0x4acdd2)[_0xb6af('0x1c')](function(_0x566ff3){_0x4acdd2['scheduledat']=_0x566ff3[_0xb6af('0x1d')];_0x3d54ab['CmHopper'][_0xb6af('0x29')]({'phone':_0x4acdd2[_0xb6af('0x8')],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2[_0xb6af('0x20')],'scheduledat':_0x4acdd2['scheduledat']?_0x4acdd2[_0xb6af('0x14')]:moment()[_0xb6af('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4acdd2[_0xb6af('0x21')]?_0x4acdd2['priority']:0x2,'callback':_0x4acdd2[_0xb6af('0x22')]?!![]:![],'callbackuniqueid':_0x4acdd2['callbackUniqueid']?_0x4acdd2['callbackUniqueid']:undefined,'callbackat':_0x4acdd2[_0xb6af('0x22')]?moment()[_0xb6af('0x15')](_0xb6af('0x16')):undefined,'VoiceQueueId':_0xd47ad1['id']})[_0xb6af('0x23')](_0x593b35());});}}}})[_0xb6af('0x1c')](function(){return _0x3d54ab[_0xb6af('0x17')][_0xb6af('0x30')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x3d54ab[_0xb6af('0x32')],'as':_0xb6af('0x36'),'where':{'id':_0x4acdd2[_0xb6af('0x20')]}}]})[_0xb6af('0x1c')](function(_0x36b304){if(_0x36b304){var _0x4a449c=[];for(var _0x46cc53=0x0,_0xa4714;_0x46cc53<_0x36b304[_0xb6af('0x37')];_0x46cc53+=0x1){_0xa4714=_0x36b304[_0x46cc53][_0xb6af('0x34')]({'plain':!![]});_0x3d54ab[_0xb6af('0x38')][_0xb6af('0x29')]({'phone':_0x4acdd2[_0xb6af('0x8')],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2[_0xb6af('0x20')],'VoiceQueueId':_0xa4714['id']})['catch'](function(_0x3a99a1){logger['error'](_0xb6af('0x39'),'afterCreate',_0x3a99a1[_0xb6af('0x3a')]);});}}});})[_0xb6af('0x1c')](function(){return _0x3d54ab[_0xb6af('0x2b')][_0xb6af('0x30')]({'attributes':['id',_0xb6af('0x31'),'dialTimezone'],'include':[{'model':_0x3d54ab[_0xb6af('0x32')],'as':_0xb6af('0x33'),'where':{'id':_0x4acdd2[_0xb6af('0x20')]}}]})[_0xb6af('0x1c')](function(_0x11e650){if(_0x11e650){var _0x4c1fd0=[];for(var _0x5c9a54=0x0,_0x45fb0d;_0x5c9a54<_0x11e650['length'];_0x5c9a54+=0x1){_0x45fb0d=_0x11e650[_0x5c9a54]['get']({'plain':!![]});switch(_0x45fb0d[_0xb6af('0x31')]){case _0xb6af('0x3b'):_0x43e8b4(_0x45fb0d)[_0xb6af('0x23')](_0x1f81e1());break;case _0xb6af('0x35'):_0xdd8457(_0x45fb0d)[_0xb6af('0x23')](_0x1f81e1());break;default:_0x3d54ab[_0xb6af('0x1e')][_0xb6af('0x29')]({'phone':_0x4acdd2[_0xb6af('0x8')],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2[_0xb6af('0x20')],'scheduledat':_0x4acdd2[_0xb6af('0x14')]?_0x4acdd2['scheduledat']:moment()['format'](_0xb6af('0x16')),'priority':_0x4acdd2[_0xb6af('0x21')]?_0x4acdd2[_0xb6af('0x21')]:0x2,'callback':_0x4acdd2[_0xb6af('0x22')]?!![]:![],'callbackuniqueid':_0x4acdd2['callbackUniqueid']?_0x4acdd2['callbackUniqueid']:undefined,'callbackat':_0x4acdd2[_0xb6af('0x22')]?moment()[_0xb6af('0x15')](_0xb6af('0x16')):undefined,'CampaignId':_0x45fb0d['id']})[_0xb6af('0x23')](_0x1f81e1());}}}});})[_0xb6af('0x1c')](function(){return _0x3d54ab[_0xb6af('0x2b')]['findAll']({'attributes':['id'],'include':[{'model':_0x3d54ab['CmList'],'as':_0xb6af('0x36'),'where':{'id':_0x4acdd2[_0xb6af('0x20')]}}]})['then'](function(_0x3eb4e1){if(_0x3eb4e1){var _0x2894fd=[];for(var _0x4219bf=0x0,_0x3adbfe;_0x4219bf<_0x3eb4e1[_0xb6af('0x37')];_0x4219bf+=0x1){_0x3adbfe=_0x3eb4e1[_0x4219bf][_0xb6af('0x34')]({'plain':!![]});_0x3d54ab[_0xb6af('0x38')][_0xb6af('0x29')]({'phone':_0x4acdd2['phone'],'ContactId':_0x4acdd2['id'],'ListId':_0x4acdd2[_0xb6af('0x20')],'CampaignId':_0x3adbfe['id']})[_0xb6af('0x23')](function(_0x33063c){logger[_0xb6af('0x3c')]('cmContact,\x20%s,\x20%s',_0xb6af('0x13'),_0x33063c['message']);});}}});})[_0xb6af('0x1c')](function(){_0x5ef6c5();})[_0xb6af('0x23')](function(_0xa9581){logger['error'](_0xb6af('0x39'),_0xb6af('0x13'),_0xa9581[_0xb6af('0x3a')]);_0x5ef6c5(_0xa9581);});}else{_0x5ef6c5(new Error(_0xb6af('0x3d')));}},'afterDestroy':function(_0x37267e,_0x3fb09d,_0x5da0e3){var _0xed669e=_0x4ecfb2['models'];var _0x2a12cb=_0x37267e[_0xb6af('0x34')]({'plain':!![]});return _0xed669e[_0xb6af('0x1e')][_0xb6af('0x30')]({'raw':!![],'where':{'ListId':_0x2a12cb[_0xb6af('0x20')],'ContactId':_0x2a12cb['id']}})[_0xb6af('0x1c')](function(_0x456651){if(!_['isEmpty'](_0x456651)){var _0x1fa22f=[];for(var _0x3a5a38=0x0;_0x3a5a38<_0x456651[_0xb6af('0x37')];_0x3a5a38+=0x1){var _0x4e207d=_0xed669e[_0xb6af('0x1e')]['destroy']({'where':{'ListId':_0x456651[_0x3a5a38]['ListId'],'ContactId':_0x456651[_0x3a5a38][_0xb6af('0x3e')],'VoiceQueueId':_0x456651[_0x3a5a38][_0xb6af('0x3f')],'CampaignId':_0x456651[_0x3a5a38][_0xb6af('0x40')]}});_0x1fa22f[_0xb6af('0x41')](_0x4e207d);}return BPromise[_0xb6af('0x42')](_0x1fa22f);}})['then'](function(_0x316345){logger[_0xb6af('0x43')]('[CmContact][afterDestroy][Succesfull]',util[_0xb6af('0x2a')](_0x316345,{'showHidden':![],'depth':null}));_0x5da0e3();})[_0xb6af('0x23')](function(_0x5a0c48){logger[_0xb6af('0x3c')]('[CmContact][afterDestroy][Error]',util[_0xb6af('0x2a')](_0x5a0c48,{'showHidden':![],'depth':null}));_0x5da0e3(_0x5a0c48);});}}});}; \ No newline at end of file +var _0x741b=['Campaign','timezones','minutes','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','BlackLists','CmHopperBlack','message','onlyIfOpen','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','exports','define','cm_contacts','phone','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','isNil','dialTimezone','utcOffset','then','CmHopper','findOne','cmContact,\x20afterCreate\x20','create','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'];(function(_0x5f53ab,_0x324327){var _0x116166=function(_0x2e8e6a){while(--_0x2e8e6a){_0x5f53ab['push'](_0x5f53ab['shift']());}};_0x116166(++_0x324327);}(_0x741b,0x182));var _0xb741=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x741b[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xb741('0x0'));var util=require('util');var logger=require(_0xb741('0x1'))(_0xb741('0x2'));var moment=require(_0xb741('0x3'));var BPromise=require(_0xb741('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb741('0x5'));var rimraf=require(_0xb741('0x6'));var config=require(_0xb741('0x7'));var shared=require(_0xb741('0x8'));var attributes=require('./cmContact.attributes');module[_0xb741('0x9')]=function(_0x36d5d7,_0x5528cc){return _0x36d5d7[_0xb741('0xa')]('CmContact',attributes,{'tableName':_0xb741('0xb'),'paranoid':!![],'indexes':[{'name':_0xb741('0xc'),'fields':[_0xb741('0xc')]},{'name':'fti_cm_contacts','fields':[_0xb741('0xd'),'lastName','phone',_0xb741('0xe'),_0xb741('0xf'),_0xb741('0x10')],'type':_0xb741('0x11')}],'timestamps':!![],'charset':_0xb741('0x12'),'collate':_0xb741('0x13'),'hooks':{'afterCreate':function(_0x1537ba,_0x3644ec,_0x2ad808){var _0x31fb18=_0x36d5d7[_0xb741('0x14')];var _0x2446b6=_0x1537ba[_0xb741('0x15')]({'plain':!![]});function _0x421af5(){return function(_0x1dcce2){logger[_0xb741('0x16')](_0xb741('0x17'),_0xb741('0x18'),util[_0xb741('0x19')](_0x1dcce2,{'showHidden':![],'depth':null}));};}function _0x5b2d20(_0x2afc6a,_0x433ef1){var _0x11977a=_0x433ef1[_0xb741('0x1a')]?_0x433ef1[_0xb741('0x1a')]:moment()[_0xb741('0x1b')](_0xb741('0x1c'));return new BPromise(function(_0xb2fd36,_0x5443d3){if(_['isNil'](_0x433ef1['dialTimezone'])){_0xb2fd36({'ret':_0x11977a});}else{_0x31fb18[_0xb741('0x1d')]['findOne']({'where':{'id':_0x2afc6a['id']}})['then'](function(_0x15fb0f){if(!_[_0xb741('0x1e')](_0x15fb0f)){var _0x521aac=_0x15fb0f[_0xb741('0x1f')];if(!_[_0xb741('0x1e')](_0x521aac)){var _0x182ce0=shared['timezones'];var _0x3e0785=_0x182ce0[_0x521aac];var _0x41b525=_0x182ce0[_0x433ef1[_0xb741('0x1f')]];if(!_[_0xb741('0x1e')](_0x3e0785)&&!_[_0xb741('0x1e')](_0x41b525)){var _0x4e304f=_0x3e0785[_0xb741('0x20')]-_0x41b525[_0xb741('0x20')];_0x11977a=_0x433ef1[_0xb741('0x1a')]?_0x433ef1['scheduledat']:moment();var _0xf92c50=moment(_0x11977a)['add'](_0x4e304f,'minutes');_0xb2fd36({'ret':_0xf92c50[_0xb741('0x1b')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0xb2fd36({'ret':_0x11977a});}else _0xb2fd36({'ret':_0x11977a});}else{_0xb2fd36({'ret':_0x11977a});}});}});return 0xa;}var _0x5ba5ab=function(_0x5804e1){return new BPromise(function(_0x1dcefd,_0x44c979){_0x5b2d20(_0x5804e1,_0x2446b6)[_0xb741('0x21')](function(_0x3de85f){_0x2446b6[_0xb741('0x1a')]=_0x3de85f['ret'];_0x31fb18[_0xb741('0x22')][_0xb741('0x23')]({'where':{'phone':_0x2446b6[_0xb741('0xc')],'VoiceQueueId':_0x5804e1['id']}})[_0xb741('0x21')](function(_0x46c206){if(!_[_0xb741('0x1e')](_0x46c206)){throw new Error(_0xb741('0x24')+_0x2446b6[_0xb741('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5804e1['id']);}return _0x31fb18[_0xb741('0x22')][_0xb741('0x25')]({'phone':_0x2446b6[_0xb741('0xc')],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6[_0xb741('0x26')],'priority':_0x2446b6[_0xb741('0x27')]?_0x2446b6['priority']:0x2,'scheduledat':_0x2446b6['scheduledat']?_0x2446b6[_0xb741('0x1a')]:moment()[_0xb741('0x1b')](_0xb741('0x1c')),'callback':_0x2446b6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2446b6[_0xb741('0x28')]?_0x2446b6[_0xb741('0x28')]:undefined,'callbackat':_0x2446b6[_0xb741('0x28')]?moment()[_0xb741('0x1b')](_0xb741('0x1c')):undefined,'VoiceQueueId':_0x5804e1['id']});})[_0xb741('0x29')](function(_0x5b130f){_0x44c979(_0x5b130f);});});});};var _0x4e85e3=function(_0x2865ae){return new BPromise(function(_0x216f28,_0x1bee8e){_0x5b2d20(_0x2865ae,_0x2446b6)['then'](function(_0x21bdcb){_0x2446b6[_0xb741('0x1a')]=_0x21bdcb[_0xb741('0x2a')];_0x31fb18[_0xb741('0x22')][_0xb741('0x23')]({'where':{'phone':_0x2446b6['phone'],'VoiceQueueId':_0x2865ae['id']}})[_0xb741('0x21')](function(_0x4447e7){if(!_[_0xb741('0x1e')](_0x4447e7)){throw new Error(_0xb741('0x24')+_0x2446b6['phone']+_0xb741('0x2b')+_0x2865ae['id']);}return _0x31fb18['CmHopperFinal'][_0xb741('0x23')]({'where':{'calleridnum':_0x2446b6[_0xb741('0xc')],'VoiceQueueId':_0x2865ae['id']}});})['then'](function(_0x163e7b){if(!_[_0xb741('0x1e')](_0x163e7b)){throw new Error(_0xb741('0x2c')+_0x2446b6[_0xb741('0xc')]+_0xb741('0x2d')+_0x2865ae['id']);}return _0x31fb18[_0xb741('0x22')][_0xb741('0x25')]({'phone':_0x2446b6[_0xb741('0xc')],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6[_0xb741('0x26')],'priority':_0x2446b6['priority']?_0x2446b6[_0xb741('0x27')]:0x2,'scheduledat':_0x2446b6['scheduledat']?_0x2446b6[_0xb741('0x1a')]:moment()['format'](_0xb741('0x1c')),'callback':_0x2446b6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2446b6[_0xb741('0x28')]?_0x2446b6[_0xb741('0x28')]:undefined,'callbackat':_0x2446b6[_0xb741('0x28')]?moment()[_0xb741('0x1b')](_0xb741('0x1c')):undefined,'VoiceQueueId':_0x2865ae['id']});})[_0xb741('0x29')](function(_0x1c4ca6){_0x1bee8e(_0x1c4ca6);});});});};function _0x3efeee(){return function(_0x5393e3){logger[_0xb741('0x16')](_0xb741('0x17'),_0xb741('0x18'),util['inspect'](_0x5393e3,{'showHidden':![],'depth':null}));};}function _0x5cfc1b(_0x4d11af,_0x46c74f){var _0x286fb6=_0x46c74f[_0xb741('0x1a')]?_0x46c74f[_0xb741('0x1a')]:moment()[_0xb741('0x1b')](_0xb741('0x1c'));return new BPromise(function(_0x5eaa63,_0x5c5bd0){if(_[_0xb741('0x1e')](_0x46c74f[_0xb741('0x1f')])){_0x5eaa63({'ret':_0x286fb6});}else{_0x31fb18[_0xb741('0x2e')][_0xb741('0x23')]({'where':{'id':_0x4d11af['id']}})[_0xb741('0x21')](function(_0x4341fb){if(!_[_0xb741('0x1e')](_0x4341fb)){var _0x2f03da=_0x4341fb['dialTimezone'];if(!_[_0xb741('0x1e')](_0x2f03da)){var _0x4f3f6f=shared[_0xb741('0x2f')];var _0x106714=_0x4f3f6f[_0x2f03da];var _0x32d6df=_0x4f3f6f[_0x46c74f['dialTimezone']];if(!_[_0xb741('0x1e')](_0x106714)&&!_[_0xb741('0x1e')](_0x32d6df)){var _0x35d749=_0x106714['utcOffset']-_0x32d6df[_0xb741('0x20')];_0x286fb6=_0x46c74f[_0xb741('0x1a')]?_0x46c74f[_0xb741('0x1a')]:moment();var _0xb1793d=moment(_0x286fb6)['add'](_0x35d749,_0xb741('0x30'));_0x5eaa63({'ret':_0xb1793d[_0xb741('0x1b')](_0xb741('0x1c'))});}else _0x5eaa63({'ret':_0x286fb6});}else _0x5eaa63({'ret':_0x286fb6});}else{_0x5eaa63({'ret':_0x286fb6});}});}});return 0xa;}var _0x4f286f=function(_0xa545f4){return new BPromise(function(_0x2ce0aa,_0x87283d){_0x5cfc1b(_0xa545f4,_0x2446b6)[_0xb741('0x21')](function(_0x224fd3){_0x2446b6[_0xb741('0x1a')]=_0x224fd3['ret'];_0x31fb18[_0xb741('0x22')][_0xb741('0x23')]({'where':{'phone':_0x2446b6[_0xb741('0xc')],'CampaignId':_0xa545f4['id']}})[_0xb741('0x21')](function(_0x536ded){if(!_['isNil'](_0x536ded)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2446b6[_0xb741('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0xa545f4['id']);}return _0x31fb18[_0xb741('0x22')]['create']({'phone':_0x2446b6['phone'],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6[_0xb741('0x26')],'priority':_0x2446b6[_0xb741('0x27')]?_0x2446b6[_0xb741('0x27')]:0x2,'scheduledat':_0x2446b6[_0xb741('0x1a')]?_0x2446b6[_0xb741('0x1a')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2446b6[_0xb741('0x28')]?!![]:![],'callbackuniqueid':_0x2446b6[_0xb741('0x28')]?_0x2446b6['callbackUniqueid']:undefined,'callbackat':_0x2446b6[_0xb741('0x28')]?moment()[_0xb741('0x1b')](_0xb741('0x1c')):undefined,'CampaignId':_0xa545f4['id']});})[_0xb741('0x29')](function(_0x9c52bf){_0x87283d(_0x9c52bf);});});});};var _0x49e4db=function(_0x614a87){return new BPromise(function(_0x5ef342,_0x496c24){_0x5cfc1b(_0x614a87,_0x2446b6)[_0xb741('0x21')](function(_0x5b3569){_0x2446b6[_0xb741('0x1a')]=_0x5b3569[_0xb741('0x2a')];_0x31fb18[_0xb741('0x22')][_0xb741('0x23')]({'where':{'phone':_0x2446b6[_0xb741('0xc')],'CampaignId':_0x614a87['id']}})[_0xb741('0x21')](function(_0x334b72){if(!_[_0xb741('0x1e')](_0x334b72)){throw new Error(_0xb741('0x24')+_0x2446b6['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x614a87['id']);}return _0x31fb18[_0xb741('0x31')]['findOne']({'where':{'calleridnum':_0x2446b6[_0xb741('0xc')],'CampaignId':_0x614a87['id']}});})[_0xb741('0x21')](function(_0x3e2cb1){if(!_[_0xb741('0x1e')](_0x3e2cb1)){throw new Error(_0xb741('0x2c')+_0x2446b6[_0xb741('0xc')]+_0xb741('0x32')+_0x614a87['id']);}return _0x31fb18['CmHopper'][_0xb741('0x25')]({'phone':_0x2446b6[_0xb741('0xc')],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6[_0xb741('0x26')],'priority':_0x2446b6['priority']?_0x2446b6[_0xb741('0x27')]:0x2,'scheduledat':_0x2446b6['scheduledat']?_0x2446b6['scheduledat']:moment()[_0xb741('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2446b6[_0xb741('0x28')]?!![]:![],'callbackuniqueid':_0x2446b6[_0xb741('0x28')]?_0x2446b6['callbackUniqueid']:undefined,'callbackat':_0x2446b6[_0xb741('0x28')]?moment()[_0xb741('0x1b')](_0xb741('0x1c')):undefined,'CampaignId':_0x614a87['id']});})[_0xb741('0x29')](function(_0x57c456){_0x496c24(_0x57c456);});});});};if(_0x2446b6['ListId']){_0x31fb18[_0xb741('0x1d')][_0xb741('0x33')]({'where':{'type':_0xb741('0x34')},'attributes':['id',_0xb741('0x35'),_0xb741('0x1f')],'include':[{'model':_0x31fb18[_0xb741('0x36')],'as':_0xb741('0x37'),'where':{'id':_0x2446b6[_0xb741('0x26')]}}]})[_0xb741('0x21')](function(_0x284e13){if(_0x284e13){var _0x707e99=[];for(var _0x460748=0x0,_0x4c9705;_0x460748<_0x284e13[_0xb741('0x38')];_0x460748+=0x1){_0x4c9705=_0x284e13[_0x460748][_0xb741('0x15')]({'plain':!![]});switch(_0x4c9705['dialCheckDuplicateType']){case _0xb741('0x39'):_0x4e85e3(_0x4c9705)[_0xb741('0x29')](_0x421af5());break;case'onlyIfOpen':_0x5ba5ab(_0x4c9705)[_0xb741('0x29')](_0x421af5());break;default:_0x5cfc1b(_0x4c9705,_0x2446b6)[_0xb741('0x21')](function(_0x37111c){_0x2446b6[_0xb741('0x1a')]=_0x37111c[_0xb741('0x2a')];_0x31fb18[_0xb741('0x22')][_0xb741('0x25')]({'phone':_0x2446b6[_0xb741('0xc')],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6[_0xb741('0x26')],'scheduledat':_0x2446b6['scheduledat']?_0x2446b6['scheduledat']:moment()[_0xb741('0x1b')](_0xb741('0x1c')),'priority':_0x2446b6[_0xb741('0x27')]?_0x2446b6[_0xb741('0x27')]:0x2,'callback':_0x2446b6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2446b6[_0xb741('0x28')]?_0x2446b6[_0xb741('0x28')]:undefined,'callbackat':_0x2446b6[_0xb741('0x28')]?moment()[_0xb741('0x1b')](_0xb741('0x1c')):undefined,'VoiceQueueId':_0x4c9705['id']})[_0xb741('0x29')](_0x421af5());});}}}})['then'](function(){return _0x31fb18['VoiceQueue']['findAll']({'where':{'type':_0xb741('0x34')},'attributes':['id'],'include':[{'model':_0x31fb18[_0xb741('0x36')],'as':_0xb741('0x3a'),'where':{'id':_0x2446b6[_0xb741('0x26')]}}]})['then'](function(_0x363e10){if(_0x363e10){var _0x5ca4b2=[];for(var _0x1118e0=0x0,_0x27f67c;_0x1118e0<_0x363e10[_0xb741('0x38')];_0x1118e0+=0x1){_0x27f67c=_0x363e10[_0x1118e0][_0xb741('0x15')]({'plain':!![]});_0x31fb18[_0xb741('0x3b')][_0xb741('0x25')]({'phone':_0x2446b6['phone'],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6['ListId'],'VoiceQueueId':_0x27f67c['id']})[_0xb741('0x29')](function(_0x1136a6){logger[_0xb741('0x16')]('cmContact,\x20%s,\x20%s',_0xb741('0x18'),_0x1136a6[_0xb741('0x3c')]);});}}});})['then'](function(){return _0x31fb18[_0xb741('0x2e')][_0xb741('0x33')]({'attributes':['id',_0xb741('0x35'),_0xb741('0x1f')],'include':[{'model':_0x31fb18['CmList'],'as':_0xb741('0x37'),'where':{'id':_0x2446b6['ListId']}}]})[_0xb741('0x21')](function(_0x251181){if(_0x251181){var _0x4a5de9=[];for(var _0x1808af=0x0,_0xfdf4cb;_0x1808af<_0x251181[_0xb741('0x38')];_0x1808af+=0x1){_0xfdf4cb=_0x251181[_0x1808af]['get']({'plain':!![]});switch(_0xfdf4cb[_0xb741('0x35')]){case'always':_0x49e4db(_0xfdf4cb)[_0xb741('0x29')](_0x3efeee());break;case _0xb741('0x3d'):_0x4f286f(_0xfdf4cb)[_0xb741('0x29')](_0x3efeee());break;default:_0x31fb18[_0xb741('0x22')][_0xb741('0x25')]({'phone':_0x2446b6['phone'],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6['ListId'],'scheduledat':_0x2446b6[_0xb741('0x1a')]?_0x2446b6[_0xb741('0x1a')]:moment()[_0xb741('0x1b')](_0xb741('0x1c')),'priority':_0x2446b6['priority']?_0x2446b6['priority']:0x2,'callback':_0x2446b6[_0xb741('0x28')]?!![]:![],'callbackuniqueid':_0x2446b6['callbackUniqueid']?_0x2446b6[_0xb741('0x28')]:undefined,'callbackat':_0x2446b6[_0xb741('0x28')]?moment()[_0xb741('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xfdf4cb['id']})[_0xb741('0x29')](_0x3efeee());}}}});})['then'](function(){return _0x31fb18[_0xb741('0x2e')][_0xb741('0x33')]({'attributes':['id'],'include':[{'model':_0x31fb18['CmList'],'as':_0xb741('0x3a'),'where':{'id':_0x2446b6[_0xb741('0x26')]}}]})['then'](function(_0x321a07){if(_0x321a07){var _0x230235=[];for(var _0x4fe04c=0x0,_0x23c90a;_0x4fe04c<_0x321a07[_0xb741('0x38')];_0x4fe04c+=0x1){_0x23c90a=_0x321a07[_0x4fe04c]['get']({'plain':!![]});_0x31fb18[_0xb741('0x3b')][_0xb741('0x25')]({'phone':_0x2446b6[_0xb741('0xc')],'ContactId':_0x2446b6['id'],'ListId':_0x2446b6[_0xb741('0x26')],'CampaignId':_0x23c90a['id']})['catch'](function(_0x48525d){logger[_0xb741('0x16')](_0xb741('0x3e'),_0xb741('0x18'),_0x48525d[_0xb741('0x3c')]);});}}});})[_0xb741('0x21')](function(){_0x2ad808();})[_0xb741('0x29')](function(_0x5482bb){logger[_0xb741('0x16')](_0xb741('0x3e'),_0xb741('0x18'),_0x5482bb[_0xb741('0x3c')]);_0x2ad808(_0x5482bb);});}else{_0x2ad808(new Error(_0xb741('0x3f')));}},'afterDestroy':function(_0x5b5f56,_0x1c1769,_0x1c6212){var _0x81efce=_0x36d5d7['models'];var _0x386f8d=_0x5b5f56['get']({'plain':!![]});return _0x81efce[_0xb741('0x22')][_0xb741('0x33')]({'raw':!![],'where':{'ListId':_0x386f8d[_0xb741('0x26')],'ContactId':_0x386f8d['id']}})[_0xb741('0x21')](function(_0x5f5588){if(!_[_0xb741('0x40')](_0x5f5588)){var _0x186670=[];for(var _0x4d9678=0x0;_0x4d9678<_0x5f5588[_0xb741('0x38')];_0x4d9678+=0x1){var _0x5e77c4=_0x81efce['CmHopper'][_0xb741('0x41')]({'where':{'ListId':_0x5f5588[_0x4d9678][_0xb741('0x26')],'ContactId':_0x5f5588[_0x4d9678][_0xb741('0x42')],'VoiceQueueId':_0x5f5588[_0x4d9678][_0xb741('0x43')],'CampaignId':_0x5f5588[_0x4d9678]['CampaignId']}});_0x186670[_0xb741('0x44')](_0x5e77c4);}return BPromise['all'](_0x186670);}})['then'](function(_0x35e9b4){logger[_0xb741('0x45')](_0xb741('0x46'),util['inspect'](_0x35e9b4,{'showHidden':![],'depth':null}));_0x1c6212();})[_0xb741('0x29')](function(_0x4c5892){logger[_0xb741('0x16')](_0xb741('0x47'),util[_0xb741('0x19')](_0x4c5892,{'showHidden':![],'depth':null}));_0x1c6212(_0x4c5892);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index ab736c2..0f4de93 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x58c2f5,_0x4f9e0d){var _0x43379c=function(_0x742de5){while(--_0x742de5){_0x58c2f5['push'](_0x58c2f5['shift']());}};_0x43379c(++_0x4f9e0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index f0451be..ae498e1 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37b4=['INTEGER','STRING','PHONE','sequelize'];(function(_0x276fae,_0x1424c1){var _0x132c7e=function(_0x4bf08a){while(--_0x4bf08a){_0x276fae['push'](_0x276fae['shift']());}};_0x132c7e(++_0x1424c1);}(_0x37b4,0xef));var _0x437b=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x37b4[_0x1d6a82];return _0x5834ac;};'use strict';var Sequelize=require(_0x437b('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x437b('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x437b('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x437b('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x437b('0x3')},'OrderBy':{'type':Sequelize[_0x437b('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x437b('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x37f8=['STRING','PHONE','exports','INTEGER'];(function(_0x2b0e19,_0x413fc4){var _0x255fce=function(_0x30d9fc){while(--_0x30d9fc){_0x2b0e19['push'](_0x2b0e19['shift']());}};_0x255fce(++_0x413fc4);}(_0x37f8,0xd2));var _0x837f=function(_0x4cda25,_0x42ba34){_0x4cda25=_0x4cda25-0x0;var _0x3fba39=_0x37f8[_0x4cda25];return _0x3fba39;};'use strict';var Sequelize=require('sequelize');module[_0x837f('0x0')]={'CmContactId':{'type':Sequelize[_0x837f('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x837f('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x837f('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x837f('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 89e8a2b..8e30ba5 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8741=['params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','CmContactHasItem','include','show','keys','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x49de59,_0x5545cd){var _0x1b51a8=function(_0x27a556){while(--_0x27a556){_0x49de59['push'](_0x49de59['shift']());}};_0x1b51a8(++_0x5545cd);}(_0x8741,0x14d));var _0x1874=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8741[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1874('0x0'));var rimraf=require(_0x1874('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1874('0x2'));var rp=require(_0x1874('0x3'));var moment=require(_0x1874('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1874('0x5'));var util=require(_0x1874('0x6'));var path=require('path');var sox=require(_0x1874('0x7'));var csv=require('to-csv');var ejs=require(_0x1874('0x8'));var fs=require('fs');var fs_extra=require(_0x1874('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1874('0xa'));var jsforce=require(_0x1874('0xb'));var deskjs=require(_0x1874('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1874('0xd'));var Papa=require(_0x1874('0xe'));var Redis=require(_0x1874('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1874('0x10'));var as=require(_0x1874('0x11'));var hardwareService=require(_0x1874('0x12'));var logger=require('../../config/logger')(_0x1874('0x13'));var utils=require(_0x1874('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1874('0x15'));var db=require(_0x1874('0x16'))['db'];function respondWithStatusCode(_0x1e10dc,_0x21f2d1){_0x21f2d1=_0x21f2d1||0xcc;return function(_0x37e85d){if(_0x37e85d){return _0x1e10dc[_0x1874('0x17')](_0x21f2d1);}return _0x1e10dc[_0x1874('0x18')](_0x21f2d1)['end']();};}function respondWithResult(_0x208e4b,_0x576007){_0x576007=_0x576007||0xc8;return function(_0xd8178f){if(_0xd8178f){return _0x208e4b[_0x1874('0x18')](_0x576007)[_0x1874('0x19')](_0xd8178f);}};}function respondWithFilteredResult(_0x1828f2,_0x140e6e){return function(_0x3823bc){if(_0x3823bc){var _0x5adfea=typeof _0x140e6e[_0x1874('0x1a')]===_0x1874('0x1b')&&typeof _0x140e6e[_0x1874('0x1c')]==='undefined';var _0x418155=_0x3823bc[_0x1874('0x1d')];var _0x59e9be=_0x5adfea?0x0:_0x140e6e['offset'];var _0x50f979=_0x5adfea?_0x3823bc['count']:_0x140e6e['offset']+_0x140e6e[_0x1874('0x1c')];var _0x2b2758;if(_0x50f979>=_0x418155){_0x50f979=_0x418155;_0x2b2758=0xc8;}else{_0x2b2758=0xce;}_0x1828f2[_0x1874('0x18')](_0x2b2758);return _0x1828f2['set'](_0x1874('0x1e'),_0x59e9be+'-'+_0x50f979+'/'+_0x418155)[_0x1874('0x19')](_0x3823bc);}return null;};}function patchUpdates(_0x546f49){return function(_0x3d3fd4){try{jsonpatch[_0x1874('0x1f')](_0x3d3fd4,_0x546f49,!![]);}catch(_0x3ad373){return BPromise[_0x1874('0x20')](_0x3ad373);}return _0x3d3fd4[_0x1874('0x21')]();};}function saveUpdates(_0x39989d,_0xae1f9e){return function(_0xa3a2ee){if(_0xa3a2ee){return _0xa3a2ee[_0x1874('0x22')](_0x39989d)[_0x1874('0x23')](function(_0x2aed01){return _0x2aed01;});}return null;};}function removeEntity(_0x57dd8c,_0x570fc7){return function(_0x1262b9){if(_0x1262b9){return _0x1262b9[_0x1874('0x24')]()[_0x1874('0x23')](function(){var _0x47654d=_0x1262b9[_0x1874('0x25')]({'plain':!![]});var _0x3b82cd='CmContactHasItems';return db[_0x1874('0x26')][_0x1874('0x24')]({'where':{'type':_0x3b82cd,'resourceId':_0x47654d['id']}})[_0x1874('0x23')](function(){return _0x1262b9;});})[_0x1874('0x23')](function(){_0x57dd8c[_0x1874('0x18')](0xcc)[_0x1874('0x27')]();});}};}function handleEntityNotFound(_0x12a48d,_0x51dc4b){return function(_0x34009f){if(!_0x34009f){_0x12a48d[_0x1874('0x17')](0x194);}return _0x34009f;};}function handleError(_0x2afaa2,_0x44b71a){_0x44b71a=_0x44b71a||0x1f4;return function(_0x2dc75e){logger[_0x1874('0x28')](_0x2dc75e[_0x1874('0x29')]);if(_0x2dc75e[_0x1874('0x2a')]){delete _0x2dc75e[_0x1874('0x2a')];}_0x2afaa2[_0x1874('0x18')](_0x44b71a)[_0x1874('0x2b')](_0x2dc75e);};}exports[_0x1874('0x2c')]=function(_0xcde410,_0xbf5d3f){var _0x256063={},_0x4e5f0a={},_0x1770e9={'count':0x0,'rows':[]};var _0x49c657=_[_0x1874('0x2d')](db['CmContactHasItem'][_0x1874('0x2e')],function(_0x30f71e){return{'name':_0x30f71e[_0x1874('0x2f')],'type':_0x30f71e['type'][_0x1874('0x30')]};});_0x4e5f0a['model']=_[_0x1874('0x2d')](_0x49c657,'name');_0x4e5f0a['query']=_['keys'](_0xcde410[_0x1874('0x31')]);_0x4e5f0a[_0x1874('0x32')]=_[_0x1874('0x33')](_0x4e5f0a[_0x1874('0x34')],_0x4e5f0a[_0x1874('0x31')]);_0x256063[_0x1874('0x35')]=_['intersection'](_0x4e5f0a[_0x1874('0x34')],qs[_0x1874('0x36')](_0xcde410[_0x1874('0x31')][_0x1874('0x36')]));_0x256063[_0x1874('0x35')]=_0x256063[_0x1874('0x35')]['length']?_0x256063['attributes']:_0x4e5f0a[_0x1874('0x34')];if(!_0xcde410['query'][_0x1874('0x37')](_0x1874('0x38'))){_0x256063[_0x1874('0x1c')]=qs[_0x1874('0x1c')](_0xcde410[_0x1874('0x31')]['limit']);_0x256063[_0x1874('0x1a')]=qs[_0x1874('0x1a')](_0xcde410[_0x1874('0x31')]['offset']);}_0x256063[_0x1874('0x39')]=qs['sort'](_0xcde410[_0x1874('0x31')][_0x1874('0x3a')]);_0x256063[_0x1874('0x3b')]=qs[_0x1874('0x32')](_[_0x1874('0x3c')](_0xcde410[_0x1874('0x31')],_0x4e5f0a[_0x1874('0x32')]),_0x49c657);if(_0xcde410['query'][_0x1874('0x3d')]){_0x256063['where']=_['merge'](_0x256063[_0x1874('0x3b')],{'$or':_[_0x1874('0x2d')](_0x49c657,function(_0x56e6f5){if(_0x56e6f5[_0x1874('0x3e')]!==_0x1874('0x3f')){var _0x3bc42a={};_0x3bc42a[_0x56e6f5[_0x1874('0x2a')]]={'$like':'%'+_0xcde410[_0x1874('0x31')][_0x1874('0x3d')]+'%'};return _0x3bc42a;}})});}_0x256063=_[_0x1874('0x40')]({},_0x256063,_0xcde410['options']);var _0xc34dd3={'where':_0x256063['where']};return db[_0x1874('0x41')][_0x1874('0x1d')](_0xc34dd3)['then'](function(_0x47aefe){_0x1770e9[_0x1874('0x1d')]=_0x47aefe;if(_0xcde410['query']['includeAll']){_0x256063[_0x1874('0x42')]=[{'all':!![]}];}return db[_0x1874('0x41')]['findAll'](_0x256063);})[_0x1874('0x23')](function(_0x1d8fef){_0x1770e9['rows']=_0x1d8fef;return _0x1770e9;})[_0x1874('0x23')](respondWithFilteredResult(_0xbf5d3f,_0x256063))['catch'](handleError(_0xbf5d3f,null));};exports[_0x1874('0x43')]=function(_0x5b9ef4,_0x67ab84){var _0x17168a={'raw':!![],'where':{'id':_0x5b9ef4['params']['id']}},_0xbb97f2={};_0xbb97f2[_0x1874('0x34')]=_[_0x1874('0x44')](db['CmContactHasItem'][_0x1874('0x2e')]);_0xbb97f2[_0x1874('0x31')]=_[_0x1874('0x44')](_0x5b9ef4[_0x1874('0x31')]);_0xbb97f2['filters']=_[_0x1874('0x33')](_0xbb97f2[_0x1874('0x34')],_0xbb97f2['query']);_0x17168a[_0x1874('0x35')]=_['intersection'](_0xbb97f2['model'],qs['fields'](_0x5b9ef4[_0x1874('0x31')]['fields']));_0x17168a[_0x1874('0x35')]=_0x17168a[_0x1874('0x35')]['length']?_0x17168a[_0x1874('0x35')]:_0xbb97f2[_0x1874('0x34')];if(_0x5b9ef4['query'][_0x1874('0x45')]){_0x17168a['include']=[{'all':!![]}];}_0x17168a=_[_0x1874('0x40')]({},_0x17168a,_0x5b9ef4[_0x1874('0x46')]);return db[_0x1874('0x41')]['find'](_0x17168a)[_0x1874('0x23')](handleEntityNotFound(_0x67ab84,null))[_0x1874('0x23')](respondWithResult(_0x67ab84,null))[_0x1874('0x47')](handleError(_0x67ab84,null));};exports[_0x1874('0x48')]=function(_0x162d7b,_0x14948c){return db[_0x1874('0x41')][_0x1874('0x48')](_0x162d7b[_0x1874('0x49')],{})[_0x1874('0x23')](function(_0x15b394){var _0x1c3a48=_0x162d7b[_0x1874('0x4a')][_0x1874('0x25')]({'plain':!![]});if(!_0x1c3a48)throw new Error(_0x1874('0x4b'));if(_0x1c3a48['role']===_0x1874('0x4a')){var _0x2008e1=_0x15b394[_0x1874('0x25')]({'plain':!![]});var _0x193129=_0x1874('0x4c');return db[_0x1874('0x4d')][_0x1874('0x4e')]({'where':{'name':_0x193129,'userProfileId':_0x1c3a48[_0x1874('0x4f')]},'raw':!![]})[_0x1874('0x23')](function(_0x3dd947){if(_0x3dd947&&_0x3dd947[_0x1874('0x50')]===0x0){return db[_0x1874('0x26')]['create']({'name':_0x2008e1[_0x1874('0x2a')],'resourceId':_0x2008e1['id'],'type':_0x3dd947[_0x1874('0x2a')],'sectionId':_0x3dd947['id']},{})[_0x1874('0x23')](function(){return _0x15b394;});}else{return _0x15b394;}})[_0x1874('0x47')](function(_0x29df47){logger[_0x1874('0x28')](_0x1874('0x51'),_0x29df47);throw _0x29df47;});}return _0x15b394;})[_0x1874('0x23')](respondWithResult(_0x14948c,0xc9))[_0x1874('0x47')](handleError(_0x14948c,null));};exports['update']=function(_0x31f667,_0xb4e940){if(_0x31f667['body']['id']){delete _0x31f667['body']['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x31f667[_0x1874('0x52')]['id']}})['then'](handleEntityNotFound(_0xb4e940,null))['then'](saveUpdates(_0x31f667[_0x1874('0x49')],null))['then'](respondWithResult(_0xb4e940,null))[_0x1874('0x47')](handleError(_0xb4e940,null));};exports[_0x1874('0x24')]=function(_0x3d3ad3,_0xa0d234){return db[_0x1874('0x41')][_0x1874('0x4e')]({'where':{'id':_0x3d3ad3[_0x1874('0x52')]['id']}})[_0x1874('0x23')](handleEntityNotFound(_0xa0d234,null))[_0x1874('0x23')](removeEntity(_0xa0d234,null))[_0x1874('0x47')](handleError(_0xa0d234,null));}; \ No newline at end of file +var _0x6675=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','findAll','show','params','includeAll','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','CmContactHasItems','destroy','error','stack','name','send','index','map','CmContactHasItem','rawAttributes'];(function(_0x5e3991,_0x594bac){var _0x48df8b=function(_0x9e41a0){while(--_0x9e41a0){_0x5e3991['push'](_0x5e3991['shift']());}};_0x48df8b(++_0x594bac);}(_0x6675,0x1cc));var _0x5667=function(_0x5e7533,_0x3b6b12){_0x5e7533=_0x5e7533-0x0;var _0x1d6917=_0x6675[_0x5e7533];return _0x1d6917;};'use strict';var emlformat=require(_0x5667('0x0'));var rimraf=require(_0x5667('0x1'));var zipdir=require(_0x5667('0x2'));var jsonpatch=require(_0x5667('0x3'));var rp=require(_0x5667('0x4'));var moment=require(_0x5667('0x5'));var BPromise=require(_0x5667('0x6'));var Mustache=require(_0x5667('0x7'));var util=require(_0x5667('0x8'));var path=require('path');var sox=require(_0x5667('0x9'));var csv=require(_0x5667('0xa'));var ejs=require(_0x5667('0xb'));var fs=require('fs');var fs_extra=require(_0x5667('0xc'));var _=require(_0x5667('0xd'));var squel=require(_0x5667('0xe'));var crypto=require(_0x5667('0xf'));var jsforce=require(_0x5667('0x10'));var deskjs=require(_0x5667('0x11'));var toCsv=require(_0x5667('0xa'));var querystring=require(_0x5667('0x12'));var Papa=require('papaparse');var Redis=require(_0x5667('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5667('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5667('0x15'));var logger=require(_0x5667('0x16'))('api');var utils=require(_0x5667('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5667('0x18'));var db=require(_0x5667('0x19'))['db'];function respondWithStatusCode(_0x3915ae,_0x2c51e2){_0x2c51e2=_0x2c51e2||0xcc;return function(_0x13797e){if(_0x13797e){return _0x3915ae[_0x5667('0x1a')](_0x2c51e2);}return _0x3915ae['status'](_0x2c51e2)['end']();};}function respondWithResult(_0x54783d,_0x32998b){_0x32998b=_0x32998b||0xc8;return function(_0x253189){if(_0x253189){return _0x54783d[_0x5667('0x1b')](_0x32998b)[_0x5667('0x1c')](_0x253189);}};}function respondWithFilteredResult(_0x1026bc,_0x300531){return function(_0x589335){if(_0x589335){var _0x45b448=typeof _0x300531[_0x5667('0x1d')]==='undefined'&&typeof _0x300531[_0x5667('0x1e')]===_0x5667('0x1f');var _0x10f80c=_0x589335[_0x5667('0x20')];var _0x1d592b=_0x45b448?0x0:_0x300531[_0x5667('0x1d')];var _0x4538f4=_0x45b448?_0x589335['count']:_0x300531['offset']+_0x300531[_0x5667('0x1e')];var _0x768fbe;if(_0x4538f4>=_0x10f80c){_0x4538f4=_0x10f80c;_0x768fbe=0xc8;}else{_0x768fbe=0xce;}_0x1026bc[_0x5667('0x1b')](_0x768fbe);return _0x1026bc[_0x5667('0x21')](_0x5667('0x22'),_0x1d592b+'-'+_0x4538f4+'/'+_0x10f80c)[_0x5667('0x1c')](_0x589335);}return null;};}function patchUpdates(_0x22f5b1){return function(_0x3de606){try{jsonpatch[_0x5667('0x23')](_0x3de606,_0x22f5b1,!![]);}catch(_0x97bab9){return BPromise[_0x5667('0x24')](_0x97bab9);}return _0x3de606[_0x5667('0x25')]();};}function saveUpdates(_0x3d794d,_0x1b4de3){return function(_0x2597f3){if(_0x2597f3){return _0x2597f3[_0x5667('0x26')](_0x3d794d)[_0x5667('0x27')](function(_0x5879bb){return _0x5879bb;});}return null;};}function removeEntity(_0x5792f9,_0x4e85d2){return function(_0x1fb1a9){if(_0x1fb1a9){return _0x1fb1a9['destroy']()[_0x5667('0x27')](function(){var _0x5501a2=_0x1fb1a9['get']({'plain':!![]});var _0x437862=_0x5667('0x28');return db['UserProfileResource'][_0x5667('0x29')]({'where':{'type':_0x437862,'resourceId':_0x5501a2['id']}})['then'](function(){return _0x1fb1a9;});})[_0x5667('0x27')](function(){_0x5792f9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459403,_0x7f010b){return function(_0x2d6e9f){if(!_0x2d6e9f){_0x459403['sendStatus'](0x194);}return _0x2d6e9f;};}function handleError(_0xaef55e,_0x29b5c2){_0x29b5c2=_0x29b5c2||0x1f4;return function(_0x52c00d){logger[_0x5667('0x2a')](_0x52c00d[_0x5667('0x2b')]);if(_0x52c00d['name']){delete _0x52c00d[_0x5667('0x2c')];}_0xaef55e['status'](_0x29b5c2)[_0x5667('0x2d')](_0x52c00d);};}exports[_0x5667('0x2e')]=function(_0x312a07,_0x16d359){var _0x2a69e4={},_0x231d28={},_0x3ce907={'count':0x0,'rows':[]};var _0x3be6ae=_[_0x5667('0x2f')](db[_0x5667('0x30')][_0x5667('0x31')],function(_0x25b68e){return{'name':_0x25b68e[_0x5667('0x32')],'type':_0x25b68e['type'][_0x5667('0x33')]};});_0x231d28[_0x5667('0x34')]=_[_0x5667('0x2f')](_0x3be6ae,_0x5667('0x2c'));_0x231d28[_0x5667('0x35')]=_[_0x5667('0x36')](_0x312a07[_0x5667('0x35')]);_0x231d28[_0x5667('0x37')]=_[_0x5667('0x38')](_0x231d28[_0x5667('0x34')],_0x231d28['query']);_0x2a69e4[_0x5667('0x39')]=_['intersection'](_0x231d28[_0x5667('0x34')],qs[_0x5667('0x3a')](_0x312a07['query'][_0x5667('0x3a')]));_0x2a69e4[_0x5667('0x39')]=_0x2a69e4[_0x5667('0x39')][_0x5667('0x3b')]?_0x2a69e4[_0x5667('0x39')]:_0x231d28[_0x5667('0x34')];if(!_0x312a07['query']['hasOwnProperty'](_0x5667('0x3c'))){_0x2a69e4[_0x5667('0x1e')]=qs['limit'](_0x312a07[_0x5667('0x35')][_0x5667('0x1e')]);_0x2a69e4['offset']=qs[_0x5667('0x1d')](_0x312a07[_0x5667('0x35')][_0x5667('0x1d')]);}_0x2a69e4[_0x5667('0x3d')]=qs[_0x5667('0x3e')](_0x312a07['query'][_0x5667('0x3e')]);_0x2a69e4[_0x5667('0x3f')]=qs['filters'](_[_0x5667('0x40')](_0x312a07[_0x5667('0x35')],_0x231d28[_0x5667('0x37')]),_0x3be6ae);if(_0x312a07[_0x5667('0x35')][_0x5667('0x41')]){_0x2a69e4[_0x5667('0x3f')]=_[_0x5667('0x42')](_0x2a69e4['where'],{'$or':_[_0x5667('0x2f')](_0x3be6ae,function(_0x1d2faa){if(_0x1d2faa[_0x5667('0x43')]!=='VIRTUAL'){var _0x359349={};_0x359349[_0x1d2faa[_0x5667('0x2c')]]={'$like':'%'+_0x312a07[_0x5667('0x35')][_0x5667('0x41')]+'%'};return _0x359349;}})});}_0x2a69e4=_[_0x5667('0x42')]({},_0x2a69e4,_0x312a07[_0x5667('0x44')]);var _0x201c7e={'where':_0x2a69e4[_0x5667('0x3f')]};return db[_0x5667('0x30')]['count'](_0x201c7e)['then'](function(_0x2d4dc2){_0x3ce907[_0x5667('0x20')]=_0x2d4dc2;if(_0x312a07['query']['includeAll']){_0x2a69e4['include']=[{'all':!![]}];}return db[_0x5667('0x30')][_0x5667('0x45')](_0x2a69e4);})['then'](function(_0x1ba066){_0x3ce907['rows']=_0x1ba066;return _0x3ce907;})[_0x5667('0x27')](respondWithFilteredResult(_0x16d359,_0x2a69e4))['catch'](handleError(_0x16d359,null));};exports[_0x5667('0x46')]=function(_0x165ccc,_0x57536d){var _0x329d99={'raw':!![],'where':{'id':_0x165ccc[_0x5667('0x47')]['id']}},_0x5291bc={};_0x5291bc[_0x5667('0x34')]=_['keys'](db[_0x5667('0x30')][_0x5667('0x31')]);_0x5291bc[_0x5667('0x35')]=_[_0x5667('0x36')](_0x165ccc[_0x5667('0x35')]);_0x5291bc['filters']=_['intersection'](_0x5291bc['model'],_0x5291bc[_0x5667('0x35')]);_0x329d99[_0x5667('0x39')]=_[_0x5667('0x38')](_0x5291bc['model'],qs[_0x5667('0x3a')](_0x165ccc[_0x5667('0x35')][_0x5667('0x3a')]));_0x329d99[_0x5667('0x39')]=_0x329d99['attributes']['length']?_0x329d99['attributes']:_0x5291bc[_0x5667('0x34')];if(_0x165ccc['query'][_0x5667('0x48')]){_0x329d99[_0x5667('0x49')]=[{'all':!![]}];}_0x329d99=_[_0x5667('0x42')]({},_0x329d99,_0x165ccc[_0x5667('0x44')]);return db[_0x5667('0x30')][_0x5667('0x4a')](_0x329d99)[_0x5667('0x27')](handleEntityNotFound(_0x57536d,null))[_0x5667('0x27')](respondWithResult(_0x57536d,null))[_0x5667('0x4b')](handleError(_0x57536d,null));};exports[_0x5667('0x4c')]=function(_0x12fe7c,_0x55653d){return db[_0x5667('0x30')][_0x5667('0x4c')](_0x12fe7c[_0x5667('0x4d')],{})[_0x5667('0x27')](function(_0x5c4aaa){var _0x20378b=_0x12fe7c[_0x5667('0x4e')][_0x5667('0x4f')]({'plain':!![]});if(!_0x20378b)throw new Error(_0x5667('0x50'));if(_0x20378b['role']==='user'){var _0x5d9ea1=_0x5c4aaa[_0x5667('0x4f')]({'plain':!![]});var _0x54c07d=_0x5667('0x28');return db[_0x5667('0x51')][_0x5667('0x4a')]({'where':{'name':_0x54c07d,'userProfileId':_0x20378b['userProfileId']},'raw':!![]})['then'](function(_0x4e306c){if(_0x4e306c&&_0x4e306c[_0x5667('0x52')]===0x0){return db[_0x5667('0x53')][_0x5667('0x4c')]({'name':_0x5d9ea1[_0x5667('0x2c')],'resourceId':_0x5d9ea1['id'],'type':_0x4e306c['name'],'sectionId':_0x4e306c['id']},{})[_0x5667('0x27')](function(){return _0x5c4aaa;});}else{return _0x5c4aaa;}})['catch'](function(_0x3ddbf6){logger['error'](_0x5667('0x54'),_0x3ddbf6);throw _0x3ddbf6;});}return _0x5c4aaa;})[_0x5667('0x27')](respondWithResult(_0x55653d,0xc9))[_0x5667('0x4b')](handleError(_0x55653d,null));};exports['update']=function(_0x14dbe9,_0x1edaff){if(_0x14dbe9[_0x5667('0x4d')]['id']){delete _0x14dbe9[_0x5667('0x4d')]['id'];}return db[_0x5667('0x30')][_0x5667('0x4a')]({'where':{'id':_0x14dbe9['params']['id']}})[_0x5667('0x27')](handleEntityNotFound(_0x1edaff,null))['then'](saveUpdates(_0x14dbe9[_0x5667('0x4d')],null))[_0x5667('0x27')](respondWithResult(_0x1edaff,null))['catch'](handleError(_0x1edaff,null));};exports[_0x5667('0x29')]=function(_0xa77c82,_0x888a77){return db[_0x5667('0x30')][_0x5667('0x4a')]({'where':{'id':_0xa77c82[_0x5667('0x47')]['id']}})[_0x5667('0x27')](handleEntityNotFound(_0x888a77,null))[_0x5667('0x27')](removeEntity(_0x888a77,null))['catch'](handleError(_0x888a77,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 3ad9b68..58596a4 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a2f=['CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','request-promise','path','../../config/environment','define'];(function(_0x1912c4,_0x58daaf){var _0x498a28=function(_0x5ce073){while(--_0x5ce073){_0x1912c4['push'](_0x1912c4['shift']());}};_0x498a28(++_0x58daaf);}(_0x4a2f,0x14a));var _0xf4a2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4a2f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf4a2('0x0'));var util=require('util');var logger=require(_0xf4a2('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf4a2('0x2'));var fs=require('fs');var path=require(_0xf4a2('0x3'));var rimraf=require('rimraf');var config=require(_0xf4a2('0x4'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x40c186,_0xc3be16){return _0x40c186[_0xf4a2('0x5')](_0xf4a2('0x6'),attributes,{'tableName':_0xf4a2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9e6=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash'];(function(_0x4d16d5,_0x308d71){var _0x36ef17=function(_0x1ace49){while(--_0x1ace49){_0x4d16d5['push'](_0x4d16d5['shift']());}};_0x36ef17(++_0x308d71);}(_0xe9e6,0x178));var _0x6e9e=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0xe9e6[_0x5e2cb4];return _0x282902;};'use strict';var _=require(_0x6e9e('0x0'));var util=require(_0x6e9e('0x1'));var logger=require(_0x6e9e('0x2'))(_0x6e9e('0x3'));var moment=require('moment');var BPromise=require(_0x6e9e('0x4'));var rp=require(_0x6e9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e9e('0x6'));var config=require(_0x6e9e('0x7'));var attributes=require(_0x6e9e('0x8'));module[_0x6e9e('0x9')]=function(_0x4cb6a1,_0x536c15){return _0x4cb6a1[_0x6e9e('0xa')](_0x6e9e('0xb'),attributes,{'tableName':_0x6e9e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 8a02158..935557c 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd19e=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util'];(function(_0x5ae5e2,_0x524776){var _0x33ed88=function(_0x308361){while(--_0x308361){_0x5ae5e2['push'](_0x5ae5e2['shift']());}};_0x33ed88(++_0x524776);}(_0xd19e,0x148));var _0xed19=function(_0x569d76,_0x5d1206){_0x569d76=_0x569d76-0x0;var _0x470e61=_0xd19e[_0x569d76];return _0x470e61;};'use strict';var _=require(_0xed19('0x0'));var util=require(_0xed19('0x1'));var moment=require(_0xed19('0x2'));var BPromise=require(_0xed19('0x3'));var rs=require(_0xed19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed19('0x5'))['db'];var utils=require(_0xed19('0x6'));var logger=require('../../config/logger')(_0xed19('0x7'));var config=require(_0xed19('0x8'));var jayson=require(_0xed19('0x9'));var client=jayson[_0xed19('0xa')][_0xed19('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xacf921,_0x1f8c67,_0x4f78eb){return new BPromise(function(_0x4a170f,_0x46dc07){return client[_0xed19('0xc')](_0xacf921,_0x4f78eb)[_0xed19('0xd')](function(_0x22dba4){logger[_0xed19('0xe')](_0xed19('0xf'),_0x1f8c67,'request\x20sent');logger[_0xed19('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x1f8c67,_0xed19('0x11'),JSON[_0xed19('0x12')](_0x22dba4));if(_0x22dba4[_0xed19('0x13')]){if(_0x22dba4[_0xed19('0x13')][_0xed19('0x14')]===0x1f4){logger[_0xed19('0x13')](_0xed19('0xf'),_0x1f8c67,_0x22dba4[_0xed19('0x13')][_0xed19('0x15')]);return _0x46dc07(_0x22dba4['error'][_0xed19('0x15')]);}logger[_0xed19('0x13')](_0xed19('0xf'),_0x1f8c67,_0x22dba4[_0xed19('0x13')][_0xed19('0x15')]);return _0x4a170f(_0x22dba4[_0xed19('0x13')][_0xed19('0x15')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x1f8c67,_0xed19('0x11'));_0x4a170f(_0x22dba4['result']['message']);}})['catch'](function(_0x396772){logger['error'](_0xed19('0xf'),_0x1f8c67,_0x396772);_0x46dc07(_0x396772);});});} \ No newline at end of file +var _0x701b=['jayson/promise','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0x701b,0x124));var _0xb701=function(_0x40e680,_0x798186){_0x40e680=_0x40e680-0x0;var _0x2debea=_0x701b[_0x40e680];return _0x2debea;};'use strict';var _=require('lodash');var util=require(_0xb701('0x0'));var moment=require(_0xb701('0x1'));var BPromise=require('bluebird');var rs=require(_0xb701('0x2'));var fs=require('fs');var Redis=require(_0xb701('0x3'));var db=require(_0xb701('0x4'))['db'];var utils=require(_0xb701('0x5'));var logger=require('../../config/logger')(_0xb701('0x6'));var config=require(_0xb701('0x7'));var jayson=require(_0xb701('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba3ee,_0x4d67b3,_0x18763b){return new BPromise(function(_0x230588,_0x1d73cf){return client[_0xb701('0x9')](_0x4ba3ee,_0x18763b)[_0xb701('0xa')](function(_0x12db69){logger['info'](_0xb701('0xb'),_0x4d67b3,_0xb701('0xc'));logger['debug'](_0xb701('0xd'),_0x4d67b3,_0xb701('0xc'),JSON[_0xb701('0xe')](_0x12db69));if(_0x12db69[_0xb701('0xf')]){if(_0x12db69[_0xb701('0xf')][_0xb701('0x10')]===0x1f4){logger[_0xb701('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x4d67b3,_0x12db69[_0xb701('0xf')]['message']);return _0x1d73cf(_0x12db69[_0xb701('0xf')][_0xb701('0x11')]);}logger[_0xb701('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x4d67b3,_0x12db69['error'][_0xb701('0x11')]);return _0x230588(_0x12db69[_0xb701('0xf')][_0xb701('0x11')]);}else{logger[_0xb701('0x12')](_0xb701('0xb'),_0x4d67b3,_0xb701('0xc'));_0x230588(_0x12db69[_0xb701('0x13')][_0xb701('0x11')]);}})['catch'](function(_0x34e3a2){logger[_0xb701('0xf')](_0xb701('0xb'),_0x4d67b3,_0x34e3a2);_0x1d73cf(_0x34e3a2);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index a33a11f..b1b0147 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5fc=['isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmContactHasItem.controller','get'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0xe5fc,0x109));var _0xce5f=function(_0x1e357d,_0x16de62){_0x1e357d=_0x1e357d-0x0;var _0xb35941=_0xe5fc[_0x1e357d];return _0xb35941;};'use strict';var multer=require(_0xce5f('0x0'));var util=require('util');var path=require(_0xce5f('0x1'));var timeout=require(_0xce5f('0x2'));var express=require(_0xce5f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce5f('0x4'));var config=require('../../config/environment');var controller=require(_0xce5f('0x5'));router[_0xce5f('0x6')]('/',auth[_0xce5f('0x7')](),controller[_0xce5f('0x8')]);router[_0xce5f('0x6')](_0xce5f('0x9'),auth[_0xce5f('0x7')](),controller[_0xce5f('0xa')]);router['post']('/',auth[_0xce5f('0x7')](),controller[_0xce5f('0xb')]);router[_0xce5f('0xc')](_0xce5f('0x9'),auth[_0xce5f('0x7')](),controller[_0xce5f('0xd')]);router[_0xce5f('0xe')]('/:id',auth[_0xce5f('0x7')](),controller[_0xce5f('0xf')]);module[_0xce5f('0x10')]=router; \ No newline at end of file +var _0x4dfd=['/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index'];(function(_0x36b966,_0x474401){var _0xf1edfd=function(_0x5011dd){while(--_0x5011dd){_0x36b966['push'](_0x36b966['shift']());}};_0xf1edfd(++_0x474401);}(_0x4dfd,0x148));var _0xd4df=function(_0x8d66c3,_0x2fa3a7){_0x8d66c3=_0x8d66c3-0x0;var _0xb10481=_0x4dfd[_0x8d66c3];return _0xb10481;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd4df('0x0'));var timeout=require(_0xd4df('0x1'));var express=require(_0xd4df('0x2'));var router=express[_0xd4df('0x3')]();var fs_extra=require(_0xd4df('0x4'));var auth=require(_0xd4df('0x5'));var interaction=require(_0xd4df('0x6'));var config=require(_0xd4df('0x7'));var controller=require(_0xd4df('0x8'));router[_0xd4df('0x9')]('/',auth[_0xd4df('0xa')](),controller[_0xd4df('0xb')]);router['get'](_0xd4df('0xc'),auth[_0xd4df('0xa')](),controller[_0xd4df('0xd')]);router[_0xd4df('0xe')]('/',auth[_0xd4df('0xa')](),controller[_0xd4df('0xf')]);router[_0xd4df('0x10')]('/:id',auth[_0xd4df('0xa')](),controller[_0xd4df('0x11')]);router[_0xd4df('0x12')](_0xd4df('0xc'),auth[_0xd4df('0xa')](),controller[_0xd4df('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 0d79be3..95ad115 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 _0x5ebb=['values','setDataValue','stringify','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','name','type','select','parse'];(function(_0x314f95,_0x33f646){var _0x397feb=function(_0x34ed40){while(--_0x34ed40){_0x314f95['push'](_0x314f95['shift']());}};_0x397feb(++_0x33f646);}(_0x5ebb,0x1e5));var _0xb5eb=function(_0x39c9fc,_0x267494){_0x39c9fc=_0x39c9fc-0x0;var _0x425ea4=_0x5ebb[_0x39c9fc];return _0x425ea4;};'use strict';var Sequelize=require(_0xb5eb('0x0'));var _=require(_0xb5eb('0x1'));module[_0xb5eb('0x2')]={'name':{'type':Sequelize[_0xb5eb('0x3')],'get':function(_0x1cc877){return this[_0xb5eb('0x4')]('alias');}},'alias':{'type':Sequelize[_0xb5eb('0x5')],'allowNull':![],'set':function(_0x24c082){this['setDataValue']('alias',_0x24c082?_0x24c082:this[_0xb5eb('0x4')](_0xb5eb('0x6')));}},'type':{'type':Sequelize[_0xb5eb('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0xb5eb('0x7'))===_0xb5eb('0x8')){return JSON[_0xb5eb('0x9')](this[_0xb5eb('0x4')]('values'));}else{return this[_0xb5eb('0x4')](_0xb5eb('0xa'));}},'set':function(_0x5d7b68){if(Array['isArray'](_0x5d7b68)){this[_0xb5eb('0xb')](_0xb5eb('0xa'),JSON[_0xb5eb('0xc')](_0x5d7b68));}else{this[_0xb5eb('0xb')](_0xb5eb('0xa'),_0x5d7b68);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xb5eb('0xd')](_0xb5eb('0xe'))}}; \ No newline at end of file +var _0x048e=['ENUM','sequelize','exports','VIRTUAL','getDataValue','STRING','setDataValue','name','TEXT','long','type','select','parse','values','stringify','BOOLEAN'];(function(_0x10c34c,_0x3c7882){var _0x1f2f9d=function(_0x419c87){while(--_0x419c87){_0x10c34c['push'](_0x10c34c['shift']());}};_0x1f2f9d(++_0x3c7882);}(_0x048e,0x191));var _0xe048=function(_0xc8052d,_0xf4a4a6){_0xc8052d=_0xc8052d-0x0;var _0x2b6f49=_0x048e[_0xc8052d];return _0x2b6f49;};'use strict';var Sequelize=require(_0xe048('0x0'));var _=require('lodash');module[_0xe048('0x1')]={'name':{'type':Sequelize[_0xe048('0x2')],'get':function(_0x5b3e7e){return this[_0xe048('0x3')]('alias');}},'alias':{'type':Sequelize[_0xe048('0x4')],'allowNull':![],'set':function(_0x18323a){this[_0xe048('0x5')]('alias',_0x18323a?_0x18323a:this[_0xe048('0x3')](_0xe048('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xe048('0x7')](_0xe048('0x8')),'get':function(){if(this[_0xe048('0x3')](_0xe048('0x9'))===_0xe048('0xa')){return JSON[_0xe048('0xb')](this[_0xe048('0x3')]('values'));}else{return this[_0xe048('0x3')](_0xe048('0xc'));}},'set':function(_0x23c0ca){if(Array['isArray'](_0x23c0ca)){this[_0xe048('0x5')]('values',JSON[_0xe048('0xd')](_0x23c0ca));}else{this[_0xe048('0x5')](_0xe048('0xc'),_0x23c0ca);}}},'required':{'type':Sequelize[_0xe048('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe048('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe048('0xf')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 8c12dbe..28dd232 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 _0xf7f5=['params','rawAttributes','find','catch','update','body','destroy','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','name','send','index','CmCustomField','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show'];(function(_0x1def35,_0x147b08){var _0x3ee27f=function(_0x305502){while(--_0x305502){_0x1def35['push'](_0x1def35['shift']());}};_0x3ee27f(++_0x147b08);}(_0xf7f5,0x127));var _0x5f7f=function(_0x1229bd,_0x31c940){_0x1229bd=_0x1229bd-0x0;var _0x3a355e=_0xf7f5[_0x1229bd];return _0x3a355e;};'use strict';var emlformat=require(_0x5f7f('0x0'));var rimraf=require(_0x5f7f('0x1'));var zipdir=require(_0x5f7f('0x2'));var jsonpatch=require(_0x5f7f('0x3'));var rp=require(_0x5f7f('0x4'));var moment=require(_0x5f7f('0x5'));var BPromise=require(_0x5f7f('0x6'));var Mustache=require(_0x5f7f('0x7'));var util=require(_0x5f7f('0x8'));var path=require(_0x5f7f('0x9'));var sox=require('sox');var csv=require(_0x5f7f('0xa'));var ejs=require(_0x5f7f('0xb'));var fs=require('fs');var fs_extra=require(_0x5f7f('0xc'));var _=require(_0x5f7f('0xd'));var squel=require(_0x5f7f('0xe'));var crypto=require(_0x5f7f('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f7f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f7f('0x10'));var authService=require(_0x5f7f('0x11'));var qs=require(_0x5f7f('0x12'));var as=require(_0x5f7f('0x13'));var hardwareService=require(_0x5f7f('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5f7f('0x15'));var config=require(_0x5f7f('0x16'));var licenseUtil=require(_0x5f7f('0x17'));var db=require(_0x5f7f('0x18'))['db'];function respondWithStatusCode(_0x39c0a8,_0x360cfc){_0x360cfc=_0x360cfc||0xcc;return function(_0x30e3fa){if(_0x30e3fa){return _0x39c0a8['sendStatus'](_0x360cfc);}return _0x39c0a8[_0x5f7f('0x19')](_0x360cfc)[_0x5f7f('0x1a')]();};}function respondWithResult(_0x593b8a,_0x3bc112){_0x3bc112=_0x3bc112||0xc8;return function(_0x22e040){if(_0x22e040){return _0x593b8a[_0x5f7f('0x19')](_0x3bc112)[_0x5f7f('0x1b')](_0x22e040);}};}function respondWithFilteredResult(_0x78ffc0,_0x20f2ea){return function(_0xeeee54){if(_0xeeee54){var _0x9e4912=typeof _0x20f2ea[_0x5f7f('0x1c')]===_0x5f7f('0x1d')&&typeof _0x20f2ea[_0x5f7f('0x1e')]==='undefined';var _0x88d066=_0xeeee54[_0x5f7f('0x1f')];var _0xa5f90c=_0x9e4912?0x0:_0x20f2ea[_0x5f7f('0x1c')];var _0x53a987=_0x9e4912?_0xeeee54[_0x5f7f('0x1f')]:_0x20f2ea['offset']+_0x20f2ea[_0x5f7f('0x1e')];var _0x595a06;if(_0x53a987>=_0x88d066){_0x53a987=_0x88d066;_0x595a06=0xc8;}else{_0x595a06=0xce;}_0x78ffc0[_0x5f7f('0x19')](_0x595a06);return _0x78ffc0['set'](_0x5f7f('0x20'),_0xa5f90c+'-'+_0x53a987+'/'+_0x88d066)[_0x5f7f('0x1b')](_0xeeee54);}return null;};}function patchUpdates(_0x434109){return function(_0x3e3800){try{jsonpatch[_0x5f7f('0x21')](_0x3e3800,_0x434109,!![]);}catch(_0x31d35d){return BPromise[_0x5f7f('0x22')](_0x31d35d);}return _0x3e3800[_0x5f7f('0x23')]();};}function saveUpdates(_0x55851c,_0x2262b1){return function(_0xe05134){if(_0xe05134){return _0xe05134['update'](_0x55851c)['then'](function(_0x96df49){return _0x96df49;});}return null;};}function removeEntity(_0x5426dc,_0xb3995a){return function(_0x5ced08){if(_0x5ced08){return _0x5ced08['destroy']()[_0x5f7f('0x24')](function(){_0x5426dc[_0x5f7f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc911bc,_0xd7c6b){return function(_0x153a19){if(!_0x153a19){_0xc911bc[_0x5f7f('0x25')](0x194);}return _0x153a19;};}function handleError(_0x2561ab,_0x3f88a3){_0x3f88a3=_0x3f88a3||0x1f4;return function(_0x135f5d){logger['error'](_0x135f5d['stack']);if(_0x135f5d[_0x5f7f('0x26')]){delete _0x135f5d[_0x5f7f('0x26')];}_0x2561ab[_0x5f7f('0x19')](_0x3f88a3)[_0x5f7f('0x27')](_0x135f5d);};}exports[_0x5f7f('0x28')]=function(_0x5d0188,_0x513d7a){var _0x21b099={},_0x1c0a7e={},_0x5b3048={'count':0x0,'rows':[]};var _0x4bf1a7=_['map'](db[_0x5f7f('0x29')]['rawAttributes'],function(_0x5cce4e){return{'name':_0x5cce4e[_0x5f7f('0x2a')],'type':_0x5cce4e[_0x5f7f('0x2b')][_0x5f7f('0x2c')]};});_0x1c0a7e['model']=_[_0x5f7f('0x2d')](_[_0x5f7f('0x2e')](_0x4bf1a7,'name'),[_0x5f7f('0x26')]);_0x1c0a7e[_0x5f7f('0x2f')]=_[_0x5f7f('0x30')](_0x5d0188[_0x5f7f('0x2f')]);_0x1c0a7e[_0x5f7f('0x31')]=_[_0x5f7f('0x32')](_0x1c0a7e[_0x5f7f('0x33')],_0x1c0a7e['query']);_0x21b099[_0x5f7f('0x34')]=_['intersection'](_0x1c0a7e[_0x5f7f('0x33')],qs[_0x5f7f('0x35')](_0x5d0188['query'][_0x5f7f('0x35')]));_0x21b099[_0x5f7f('0x34')]=_0x21b099[_0x5f7f('0x34')][_0x5f7f('0x36')]?_0x21b099[_0x5f7f('0x34')]:_0x1c0a7e['model'];if(!_0x5d0188[_0x5f7f('0x2f')][_0x5f7f('0x37')]('nolimit')){_0x21b099[_0x5f7f('0x1e')]=qs[_0x5f7f('0x1e')](_0x5d0188[_0x5f7f('0x2f')][_0x5f7f('0x1e')]);_0x21b099[_0x5f7f('0x1c')]=qs['offset'](_0x5d0188[_0x5f7f('0x2f')][_0x5f7f('0x1c')]);}_0x21b099[_0x5f7f('0x38')]=qs[_0x5f7f('0x39')](_0x5d0188['query'][_0x5f7f('0x39')]);_0x21b099['where']=qs[_0x5f7f('0x31')](_[_0x5f7f('0x3a')](_0x5d0188['query'],_0x1c0a7e[_0x5f7f('0x31')]),_0x4bf1a7);if(_0x5d0188[_0x5f7f('0x2f')]['filter']){_0x21b099['where']=_[_0x5f7f('0x3b')](_0x21b099[_0x5f7f('0x3c')],{'$or':_[_0x5f7f('0x2e')](_0x4bf1a7,function(_0x146c2f){if(_0x146c2f[_0x5f7f('0x2b')]!==_0x5f7f('0x3d')){var _0x37507b={};_0x37507b[_0x146c2f[_0x5f7f('0x26')]]={'$like':'%'+_0x5d0188[_0x5f7f('0x2f')][_0x5f7f('0x3e')]+'%'};return _0x37507b;}})});}_0x21b099=_[_0x5f7f('0x3b')]({},_0x21b099,_0x5d0188[_0x5f7f('0x3f')]);var _0x233b85={'where':_0x21b099['where']};return db[_0x5f7f('0x29')][_0x5f7f('0x1f')](_0x233b85)['then'](function(_0x40de92){_0x5b3048[_0x5f7f('0x1f')]=_0x40de92;if(_0x5d0188[_0x5f7f('0x2f')][_0x5f7f('0x40')]){_0x21b099[_0x5f7f('0x41')]=[{'all':!![]}];}return db[_0x5f7f('0x29')][_0x5f7f('0x42')](_0x21b099);})[_0x5f7f('0x24')](function(_0x5d9bb9){_0x5b3048[_0x5f7f('0x43')]=_0x5d9bb9;return _0x5b3048;})[_0x5f7f('0x24')](respondWithFilteredResult(_0x513d7a,_0x21b099))['catch'](handleError(_0x513d7a,null));};exports[_0x5f7f('0x44')]=function(_0x21d75f,_0x23c35e){var _0x4a80a1={'raw':!![],'where':{'id':_0x21d75f[_0x5f7f('0x45')]['id']}},_0x2dfa9e={};_0x2dfa9e['model']=_[_0x5f7f('0x30')](db[_0x5f7f('0x29')][_0x5f7f('0x46')]);_0x2dfa9e[_0x5f7f('0x2f')]=_[_0x5f7f('0x30')](_0x21d75f[_0x5f7f('0x2f')]);_0x2dfa9e[_0x5f7f('0x31')]=_[_0x5f7f('0x32')](_0x2dfa9e['model'],_0x2dfa9e[_0x5f7f('0x2f')]);_0x4a80a1['attributes']=_['intersection'](_0x2dfa9e[_0x5f7f('0x33')],qs[_0x5f7f('0x35')](_0x21d75f[_0x5f7f('0x2f')]['fields']));_0x4a80a1[_0x5f7f('0x34')]=_0x4a80a1[_0x5f7f('0x34')][_0x5f7f('0x36')]?_0x4a80a1[_0x5f7f('0x34')]:_0x2dfa9e[_0x5f7f('0x33')];if(_0x21d75f[_0x5f7f('0x2f')]['includeAll']){_0x4a80a1[_0x5f7f('0x41')]=[{'all':!![]}];}_0x4a80a1=_[_0x5f7f('0x3b')]({},_0x4a80a1,_0x21d75f[_0x5f7f('0x3f')]);return db['CmCustomField'][_0x5f7f('0x47')](_0x4a80a1)['then'](handleEntityNotFound(_0x23c35e,null))[_0x5f7f('0x24')](respondWithResult(_0x23c35e,null))[_0x5f7f('0x48')](handleError(_0x23c35e,null));};exports[_0x5f7f('0x49')]=function(_0x122720,_0x30075c){if(_0x122720['body']['id']){delete _0x122720[_0x5f7f('0x4a')]['id'];}return db['CmCustomField'][_0x5f7f('0x47')]({'where':{'id':_0x122720['params']['id']}})['then'](handleEntityNotFound(_0x30075c,null))['then'](saveUpdates(_0x122720[_0x5f7f('0x4a')],null))[_0x5f7f('0x24')](respondWithResult(_0x30075c,null))[_0x5f7f('0x48')](handleError(_0x30075c,null));};exports[_0x5f7f('0x4b')]=function(_0xbb356d,_0x4e70d3){return db['CmCustomField'][_0x5f7f('0x47')]({'where':{'id':_0xbb356d[_0x5f7f('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e70d3,null))[_0x5f7f('0x24')](removeEntity(_0x4e70d3,null))[_0x5f7f('0x48')](handleError(_0x4e70d3,null));};exports[_0x5f7f('0x4c')]=function(_0x5b92e2,_0x303cda){var _0x3a021d;return db[_0x5f7f('0x4d')][_0x5f7f('0x4e')](function(_0x2e6896){return db[_0x5f7f('0x29')]['create'](_0x5b92e2[_0x5f7f('0x4a')],{'transaction':_0x2e6896})[_0x5f7f('0x24')](function(_0x5e1ba8){_0x3a021d=_0x5e1ba8;var _0x21de8d={'type':db['Sequelize'][_0x5f7f('0x4f')],'transaction':_0x2e6896};switch(_0x5b92e2['body']['type']){case _0x5f7f('0x50'):_0x21de8d[_0x5f7f('0x2b')]=db[_0x5f7f('0x51')][_0x5f7f('0x4f')];break;case _0x5f7f('0x52'):_0x21de8d[_0x5f7f('0x2b')]=db[_0x5f7f('0x51')][_0x5f7f('0x53')];break;case _0x5f7f('0x54'):_0x21de8d[_0x5f7f('0x2b')]=db[_0x5f7f('0x51')][_0x5f7f('0x55')];_0x21de8d[_0x5f7f('0x56')]=![];break;default:}return db[_0x5f7f('0x4d')][_0x5f7f('0x57')][_0x5f7f('0x58')](_0x5f7f('0x59'),util['format'](_0x5f7f('0x5a'),_0x3a021d['id']),_0x21de8d);})['then'](function(){return _0x3a021d;});})[_0x5f7f('0x24')](respondWithResult(_0x303cda,0xc9))[_0x5f7f('0x48')](handleError(_0x303cda,null));}; \ No newline at end of file +var _0xa6c8=['format','cf_%d','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','CmCustomField','fieldName','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','type','merge','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','body','create','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts'];(function(_0x32f5f4,_0xe88faa){var _0x47d0ce=function(_0x22540b){while(--_0x22540b){_0x32f5f4['push'](_0x32f5f4['shift']());}};_0x47d0ce(++_0xe88faa);}(_0xa6c8,0x15a));var _0x8a6c=function(_0x2f63a9,_0xdddf20){_0x2f63a9=_0x2f63a9-0x0;var _0x58c61f=_0xa6c8[_0x2f63a9];return _0x58c61f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a6c('0x0'));var zipdir=require(_0x8a6c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a6c('0x2'));var moment=require(_0x8a6c('0x3'));var BPromise=require(_0x8a6c('0x4'));var Mustache=require(_0x8a6c('0x5'));var util=require(_0x8a6c('0x6'));var path=require(_0x8a6c('0x7'));var sox=require(_0x8a6c('0x8'));var csv=require(_0x8a6c('0x9'));var ejs=require(_0x8a6c('0xa'));var fs=require('fs');var fs_extra=require(_0x8a6c('0xb'));var _=require('lodash');var squel=require(_0x8a6c('0xc'));var crypto=require(_0x8a6c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8a6c('0x9'));var querystring=require(_0x8a6c('0xe'));var Papa=require(_0x8a6c('0xf'));var Redis=require(_0x8a6c('0x10'));var authService=require(_0x8a6c('0x11'));var qs=require(_0x8a6c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a6c('0x13'));var logger=require(_0x8a6c('0x14'))(_0x8a6c('0x15'));var utils=require(_0x8a6c('0x16'));var config=require(_0x8a6c('0x17'));var licenseUtil=require(_0x8a6c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21fa77,_0x240167){_0x240167=_0x240167||0xcc;return function(_0x28012a){if(_0x28012a){return _0x21fa77[_0x8a6c('0x19')](_0x240167);}return _0x21fa77[_0x8a6c('0x1a')](_0x240167)['end']();};}function respondWithResult(_0x3a39ae,_0x160874){_0x160874=_0x160874||0xc8;return function(_0x4ea18b){if(_0x4ea18b){return _0x3a39ae['status'](_0x160874)[_0x8a6c('0x1b')](_0x4ea18b);}};}function respondWithFilteredResult(_0x4ee85d,_0x3d4b71){return function(_0x23745f){if(_0x23745f){var _0x590bfc=typeof _0x3d4b71[_0x8a6c('0x1c')]===_0x8a6c('0x1d')&&typeof _0x3d4b71['limit']==='undefined';var _0x625d6=_0x23745f['count'];var _0x428fc0=_0x590bfc?0x0:_0x3d4b71[_0x8a6c('0x1c')];var _0x39fb41=_0x590bfc?_0x23745f[_0x8a6c('0x1e')]:_0x3d4b71[_0x8a6c('0x1c')]+_0x3d4b71[_0x8a6c('0x1f')];var _0x1ad52c;if(_0x39fb41>=_0x625d6){_0x39fb41=_0x625d6;_0x1ad52c=0xc8;}else{_0x1ad52c=0xce;}_0x4ee85d[_0x8a6c('0x1a')](_0x1ad52c);return _0x4ee85d['set'](_0x8a6c('0x20'),_0x428fc0+'-'+_0x39fb41+'/'+_0x625d6)[_0x8a6c('0x1b')](_0x23745f);}return null;};}function patchUpdates(_0x45e682){return function(_0x44c89b){try{jsonpatch[_0x8a6c('0x21')](_0x44c89b,_0x45e682,!![]);}catch(_0x1987a5){return BPromise[_0x8a6c('0x22')](_0x1987a5);}return _0x44c89b['save']();};}function saveUpdates(_0x43a03a,_0x2c1e6c){return function(_0x2a73b7){if(_0x2a73b7){return _0x2a73b7[_0x8a6c('0x23')](_0x43a03a)[_0x8a6c('0x24')](function(_0x440e7b){return _0x440e7b;});}return null;};}function removeEntity(_0x3db147,_0x448c30){return function(_0x31837d){if(_0x31837d){return _0x31837d[_0x8a6c('0x25')]()[_0x8a6c('0x24')](function(){_0x3db147[_0x8a6c('0x1a')](0xcc)[_0x8a6c('0x26')]();});}};}function handleEntityNotFound(_0x418c17,_0x17ffa5){return function(_0x4f8ae1){if(!_0x4f8ae1){_0x418c17[_0x8a6c('0x19')](0x194);}return _0x4f8ae1;};}function handleError(_0x1f6925,_0x26a3af){_0x26a3af=_0x26a3af||0x1f4;return function(_0x2eec9a){logger[_0x8a6c('0x27')](_0x2eec9a[_0x8a6c('0x28')]);if(_0x2eec9a[_0x8a6c('0x29')]){delete _0x2eec9a[_0x8a6c('0x29')];}_0x1f6925[_0x8a6c('0x1a')](_0x26a3af)[_0x8a6c('0x2a')](_0x2eec9a);};}exports['index']=function(_0x3ad56f,_0x2a8571){var _0x58555f={},_0x286cf7={},_0x28e925={'count':0x0,'rows':[]};var _0x2769d3=_['map'](db[_0x8a6c('0x2b')]['rawAttributes'],function(_0x30c5bf){return{'name':_0x30c5bf[_0x8a6c('0x2c')],'type':_0x30c5bf['type']['key']};});_0x286cf7[_0x8a6c('0x2d')]=_[_0x8a6c('0x2e')](_['map'](_0x2769d3,_0x8a6c('0x29')),[_0x8a6c('0x29')]);_0x286cf7['query']=_[_0x8a6c('0x2f')](_0x3ad56f[_0x8a6c('0x30')]);_0x286cf7[_0x8a6c('0x31')]=_[_0x8a6c('0x32')](_0x286cf7[_0x8a6c('0x2d')],_0x286cf7[_0x8a6c('0x30')]);_0x58555f[_0x8a6c('0x33')]=_[_0x8a6c('0x32')](_0x286cf7[_0x8a6c('0x2d')],qs[_0x8a6c('0x34')](_0x3ad56f[_0x8a6c('0x30')][_0x8a6c('0x34')]));_0x58555f[_0x8a6c('0x33')]=_0x58555f['attributes'][_0x8a6c('0x35')]?_0x58555f[_0x8a6c('0x33')]:_0x286cf7[_0x8a6c('0x2d')];if(!_0x3ad56f[_0x8a6c('0x30')][_0x8a6c('0x36')]('nolimit')){_0x58555f[_0x8a6c('0x1f')]=qs[_0x8a6c('0x1f')](_0x3ad56f[_0x8a6c('0x30')][_0x8a6c('0x1f')]);_0x58555f['offset']=qs[_0x8a6c('0x1c')](_0x3ad56f[_0x8a6c('0x30')][_0x8a6c('0x1c')]);}_0x58555f['order']=qs['sort'](_0x3ad56f[_0x8a6c('0x30')]['sort']);_0x58555f[_0x8a6c('0x37')]=qs[_0x8a6c('0x31')](_[_0x8a6c('0x38')](_0x3ad56f[_0x8a6c('0x30')],_0x286cf7[_0x8a6c('0x31')]),_0x2769d3);if(_0x3ad56f['query'][_0x8a6c('0x39')]){_0x58555f['where']=_['merge'](_0x58555f[_0x8a6c('0x37')],{'$or':_['map'](_0x2769d3,function(_0x5ca87a){if(_0x5ca87a[_0x8a6c('0x3a')]!=='VIRTUAL'){var _0x373e24={};_0x373e24[_0x5ca87a[_0x8a6c('0x29')]]={'$like':'%'+_0x3ad56f[_0x8a6c('0x30')][_0x8a6c('0x39')]+'%'};return _0x373e24;}})});}_0x58555f=_[_0x8a6c('0x3b')]({},_0x58555f,_0x3ad56f['options']);var _0x14391a={'where':_0x58555f[_0x8a6c('0x37')]};return db['CmCustomField'][_0x8a6c('0x1e')](_0x14391a)[_0x8a6c('0x24')](function(_0x1159d9){_0x28e925['count']=_0x1159d9;if(_0x3ad56f[_0x8a6c('0x30')]['includeAll']){_0x58555f[_0x8a6c('0x3c')]=[{'all':!![]}];}return db[_0x8a6c('0x2b')][_0x8a6c('0x3d')](_0x58555f);})[_0x8a6c('0x24')](function(_0x349611){_0x28e925[_0x8a6c('0x3e')]=_0x349611;return _0x28e925;})[_0x8a6c('0x24')](respondWithFilteredResult(_0x2a8571,_0x58555f))[_0x8a6c('0x3f')](handleError(_0x2a8571,null));};exports[_0x8a6c('0x40')]=function(_0x42dd95,_0x45d02f){var _0x4d402e={'raw':!![],'where':{'id':_0x42dd95[_0x8a6c('0x41')]['id']}},_0xfc0a5b={};_0xfc0a5b[_0x8a6c('0x2d')]=_['keys'](db[_0x8a6c('0x2b')][_0x8a6c('0x42')]);_0xfc0a5b[_0x8a6c('0x30')]=_[_0x8a6c('0x2f')](_0x42dd95[_0x8a6c('0x30')]);_0xfc0a5b['filters']=_[_0x8a6c('0x32')](_0xfc0a5b[_0x8a6c('0x2d')],_0xfc0a5b[_0x8a6c('0x30')]);_0x4d402e[_0x8a6c('0x33')]=_[_0x8a6c('0x32')](_0xfc0a5b[_0x8a6c('0x2d')],qs[_0x8a6c('0x34')](_0x42dd95['query'][_0x8a6c('0x34')]));_0x4d402e[_0x8a6c('0x33')]=_0x4d402e[_0x8a6c('0x33')][_0x8a6c('0x35')]?_0x4d402e[_0x8a6c('0x33')]:_0xfc0a5b[_0x8a6c('0x2d')];if(_0x42dd95[_0x8a6c('0x30')][_0x8a6c('0x43')]){_0x4d402e[_0x8a6c('0x3c')]=[{'all':!![]}];}_0x4d402e=_['merge']({},_0x4d402e,_0x42dd95[_0x8a6c('0x44')]);return db[_0x8a6c('0x2b')][_0x8a6c('0x45')](_0x4d402e)[_0x8a6c('0x24')](handleEntityNotFound(_0x45d02f,null))[_0x8a6c('0x24')](respondWithResult(_0x45d02f,null))[_0x8a6c('0x3f')](handleError(_0x45d02f,null));};exports[_0x8a6c('0x23')]=function(_0x5e502e,_0x31f2f1){if(_0x5e502e['body']['id']){delete _0x5e502e[_0x8a6c('0x46')]['id'];}return db[_0x8a6c('0x2b')][_0x8a6c('0x45')]({'where':{'id':_0x5e502e[_0x8a6c('0x41')]['id']}})[_0x8a6c('0x24')](handleEntityNotFound(_0x31f2f1,null))[_0x8a6c('0x24')](saveUpdates(_0x5e502e['body'],null))['then'](respondWithResult(_0x31f2f1,null))[_0x8a6c('0x3f')](handleError(_0x31f2f1,null));};exports[_0x8a6c('0x25')]=function(_0x3a10fe,_0x2e5c50){return db['CmCustomField'][_0x8a6c('0x45')]({'where':{'id':_0x3a10fe[_0x8a6c('0x41')]['id']}})[_0x8a6c('0x24')](handleEntityNotFound(_0x2e5c50,null))[_0x8a6c('0x24')](removeEntity(_0x2e5c50,null))['catch'](handleError(_0x2e5c50,null));};exports[_0x8a6c('0x47')]=function(_0x581e5b,_0x9d62bf){var _0x3259e5;return db[_0x8a6c('0x48')][_0x8a6c('0x49')](function(_0x152171){return db[_0x8a6c('0x2b')][_0x8a6c('0x47')](_0x581e5b[_0x8a6c('0x46')],{'transaction':_0x152171})['then'](function(_0x554f2e){_0x3259e5=_0x554f2e;var _0x1ed41b={'type':db[_0x8a6c('0x4a')]['TEXT'],'transaction':_0x152171};switch(_0x581e5b[_0x8a6c('0x46')][_0x8a6c('0x3a')]){case _0x8a6c('0x4b'):_0x1ed41b[_0x8a6c('0x3a')]=db['Sequelize'][_0x8a6c('0x4c')];break;case'number':_0x1ed41b[_0x8a6c('0x3a')]=db[_0x8a6c('0x4a')][_0x8a6c('0x4d')];break;case _0x8a6c('0x4e'):_0x1ed41b['type']=db['Sequelize'][_0x8a6c('0x4f')];_0x1ed41b[_0x8a6c('0x50')]=![];break;default:}return db[_0x8a6c('0x48')][_0x8a6c('0x51')][_0x8a6c('0x52')](_0x8a6c('0x53'),util[_0x8a6c('0x54')](_0x8a6c('0x55'),_0x3259e5['id']),_0x1ed41b);})['then'](function(){return _0x3259e5;});})[_0x8a6c('0x24')](respondWithResult(_0x9d62bf,0xc9))['catch'](handleError(_0x9d62bf,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index a9a85d5..a37436f 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 _0xd324=['define','CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xd324,0xcf));var _0x4d32=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0xd324[_0x19aa84];return _0x536146;};'use strict';var _=require('lodash');var util=require(_0x4d32('0x0'));var logger=require(_0x4d32('0x1'))(_0x4d32('0x2'));var moment=require(_0x4d32('0x3'));var BPromise=require(_0x4d32('0x4'));var rp=require(_0x4d32('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d32('0x6'));var config=require(_0x4d32('0x7'));var attributes=require(_0x4d32('0x8'));module['exports']=function(_0x7ae524,_0x3d6ac7){return _0x7ae524[_0x4d32('0x9')](_0x4d32('0xa'),attributes,{'tableName':_0x4d32('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cc9=['path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','request-promise'];(function(_0xb43d1b,_0x3935cf){var _0x4aafca=function(_0x3b26d2){while(--_0x3b26d2){_0xb43d1b['push'](_0xb43d1b['shift']());}};_0x4aafca(++_0x3935cf);}(_0x0cc9,0x131));var _0x90cc=function(_0x5cf1a1,_0x1ab924){_0x5cf1a1=_0x5cf1a1-0x0;var _0x52cbcc=_0x0cc9[_0x5cf1a1];return _0x52cbcc;};'use strict';var _=require(_0x90cc('0x0'));var util=require(_0x90cc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x90cc('0x2'));var fs=require('fs');var path=require(_0x90cc('0x3'));var rimraf=require(_0x90cc('0x4'));var config=require(_0x90cc('0x5'));var attributes=require(_0x90cc('0x6'));module[_0x90cc('0x7')]=function(_0x42a3e6,_0x114fd7){return _0x42a3e6[_0x90cc('0x8')](_0x90cc('0x9'),attributes,{'tableName':_0x90cc('0xa'),'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 afee99e..f84a837 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 _0xb4d0=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result'];(function(_0x3540c4,_0x3680dc){var _0x9dd05d=function(_0x1d3e68){while(--_0x1d3e68){_0x3540c4['push'](_0x3540c4['shift']());}};_0x9dd05d(++_0x3680dc);}(_0xb4d0,0x1b6));var _0x0b4d=function(_0x23b36b,_0x150dce){_0x23b36b=_0x23b36b-0x0;var _0x29308a=_0xb4d0[_0x23b36b];return _0x29308a;};'use strict';var _=require(_0x0b4d('0x0'));var util=require(_0x0b4d('0x1'));var moment=require(_0x0b4d('0x2'));var BPromise=require(_0x0b4d('0x3'));var rs=require(_0x0b4d('0x4'));var fs=require('fs');var Redis=require(_0x0b4d('0x5'));var db=require(_0x0b4d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b4d('0x7'))(_0x0b4d('0x8'));var config=require('../../config/environment');var jayson=require(_0x0b4d('0x9'));var client=jayson[_0x0b4d('0xa')][_0x0b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf56d95,_0x182d5f,_0x2dce5c){return new BPromise(function(_0x538811,_0x14b589){return client[_0x0b4d('0xc')](_0xf56d95,_0x2dce5c)[_0x0b4d('0xd')](function(_0xd9421b){logger[_0x0b4d('0xe')]('CmCustomField,\x20%s,\x20%s',_0x182d5f,'request\x20sent');logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x182d5f,_0x0b4d('0xf'),JSON[_0x0b4d('0x10')](_0xd9421b));if(_0xd9421b['error']){if(_0xd9421b[_0x0b4d('0x11')][_0x0b4d('0x12')]===0x1f4){logger[_0x0b4d('0x11')](_0x0b4d('0x13'),_0x182d5f,_0xd9421b[_0x0b4d('0x11')][_0x0b4d('0x14')]);return _0x14b589(_0xd9421b[_0x0b4d('0x11')]['message']);}logger[_0x0b4d('0x11')](_0x0b4d('0x13'),_0x182d5f,_0xd9421b[_0x0b4d('0x11')]['message']);return _0x538811(_0xd9421b[_0x0b4d('0x11')]['message']);}else{logger[_0x0b4d('0xe')](_0x0b4d('0x13'),_0x182d5f,_0x0b4d('0xf'));_0x538811(_0xd9421b[_0x0b4d('0x15')]['message']);}})[_0x0b4d('0x16')](function(_0x3218bb){logger[_0x0b4d('0x11')](_0x0b4d('0x13'),_0x182d5f,_0x3218bb);_0x14b589(_0x3218bb);});});} \ No newline at end of file +var _0xffdb=['http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4aa09e,_0xdc743d){var _0x38efe6=function(_0x7ab12c){while(--_0x7ab12c){_0x4aa09e['push'](_0x4aa09e['shift']());}};_0x38efe6(++_0xdc743d);}(_0xffdb,0xb5));var _0xbffd=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xffdb[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0xbffd('0x0'));var util=require(_0xbffd('0x1'));var moment=require(_0xbffd('0x2'));var BPromise=require('bluebird');var rs=require(_0xbffd('0x3'));var fs=require('fs');var Redis=require(_0xbffd('0x4'));var db=require(_0xbffd('0x5'))['db'];var utils=require(_0xbffd('0x6'));var logger=require('../../config/logger')(_0xbffd('0x7'));var config=require(_0xbffd('0x8'));var jayson=require(_0xbffd('0x9'));var client=jayson[_0xbffd('0xa')][_0xbffd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x196219,_0x26f745,_0x554db8){return new BPromise(function(_0x12c5f5,_0x57ee75){return client[_0xbffd('0xc')](_0x196219,_0x554db8)['then'](function(_0x5bb051){logger['info'](_0xbffd('0xd'),_0x26f745,_0xbffd('0xe'));logger[_0xbffd('0xf')](_0xbffd('0x10'),_0x26f745,_0xbffd('0xe'),JSON[_0xbffd('0x11')](_0x5bb051));if(_0x5bb051[_0xbffd('0x12')]){if(_0x5bb051[_0xbffd('0x12')][_0xbffd('0x13')]===0x1f4){logger[_0xbffd('0x12')]('CmCustomField,\x20%s,\x20%s',_0x26f745,_0x5bb051[_0xbffd('0x12')]['message']);return _0x57ee75(_0x5bb051[_0xbffd('0x12')][_0xbffd('0x14')]);}logger[_0xbffd('0x12')](_0xbffd('0xd'),_0x26f745,_0x5bb051[_0xbffd('0x12')][_0xbffd('0x14')]);return _0x12c5f5(_0x5bb051['error'][_0xbffd('0x14')]);}else{logger[_0xbffd('0x15')]('CmCustomField,\x20%s,\x20%s',_0x26f745,_0xbffd('0xe'));_0x12c5f5(_0x5bb051[_0xbffd('0x16')]['message']);}})[_0xbffd('0x17')](function(_0x2f54c8){logger[_0xbffd('0x12')](_0xbffd('0xd'),_0x26f745,_0x2f54c8);_0x57ee75(_0x2f54c8);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index da3f52a..9d5d373 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 _0x4693=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','get','/:id','post','put','update','delete','destroy','multer'];(function(_0x35c572,_0x4c7d19){var _0x175fe9=function(_0x2e4821){while(--_0x2e4821){_0x35c572['push'](_0x35c572['shift']());}};_0x175fe9(++_0x4c7d19);}(_0x4693,0x18b));var _0x3469=function(_0x2c16b7,_0x213e8e){_0x2c16b7=_0x2c16b7-0x0;var _0x1c3f1e=_0x4693[_0x2c16b7];return _0x1c3f1e;};'use strict';var multer=require(_0x3469('0x0'));var util=require('util');var path=require(_0x3469('0x1'));var timeout=require(_0x3469('0x2'));var express=require(_0x3469('0x3'));var router=express[_0x3469('0x4')]();var fs_extra=require(_0x3469('0x5'));var auth=require(_0x3469('0x6'));var interaction=require(_0x3469('0x7'));var config=require(_0x3469('0x8'));var controller=require(_0x3469('0x9'));router['get']('/',auth[_0x3469('0xa')](),controller['index']);router[_0x3469('0xb')](_0x3469('0xc'),auth[_0x3469('0xa')](),controller['show']);router[_0x3469('0xd')]('/',auth[_0x3469('0xa')](),controller['create']);router[_0x3469('0xe')]('/:id',auth[_0x3469('0xa')](),controller[_0x3469('0xf')]);router[_0x3469('0x10')](_0x3469('0xc'),auth[_0x3469('0xa')](),controller[_0x3469('0x11')]);module['exports']=router; \ No newline at end of file +var _0x16cc=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','put','/:id','update','destroy','util'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0x16cc,0x120));var _0xc16c=function(_0x252f5c,_0x6cbae6){_0x252f5c=_0x252f5c-0x0;var _0x4eedeb=_0x16cc[_0x252f5c];return _0x4eedeb;};'use strict';var multer=require('multer');var util=require(_0xc16c('0x0'));var path=require(_0xc16c('0x1'));var timeout=require(_0xc16c('0x2'));var express=require(_0xc16c('0x3'));var router=express[_0xc16c('0x4')]();var fs_extra=require(_0xc16c('0x5'));var auth=require(_0xc16c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc16c('0x7'));var controller=require(_0xc16c('0x8'));router[_0xc16c('0x9')]('/',auth[_0xc16c('0xa')](),controller['index']);router[_0xc16c('0x9')]('/:id',auth[_0xc16c('0xa')](),controller[_0xc16c('0xb')]);router[_0xc16c('0xc')]('/',auth[_0xc16c('0xa')](),controller['create']);router[_0xc16c('0xd')](_0xc16c('0xe'),auth[_0xc16c('0xa')](),controller[_0xc16c('0xf')]);router['delete'](_0xc16c('0xe'),auth[_0xc16c('0xa')](),controller[_0xc16c('0x10')]);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 b0937f0..5ce27a4 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 _0x4b8c=['sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x5a3202,_0x4a9c0d){var _0xb4cf2=function(_0x169a51){while(--_0x169a51){_0x5a3202['push'](_0x5a3202['shift']());}};_0xb4cf2(++_0x4a9c0d);}(_0x4b8c,0x7d));var _0xc4b8=function(_0x30b4dc,_0x4519be){_0x30b4dc=_0x30b4dc-0x0;var _0xcd3d9e=_0x4b8c[_0x30b4dc];return _0xcd3d9e;};'use strict';var moment=require(_0xc4b8('0x0'));var Sequelize=require(_0xc4b8('0x1'));module[_0xc4b8('0x2')]={'phone':{'type':Sequelize[_0xc4b8('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xc4b8('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc4b8('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc4b8('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc4b8('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc4b8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc4b8('0x5')]},'priority':{'type':Sequelize[_0xc4b8('0x6')](0x2)[_0xc4b8('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc4b8('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc4b8('0x6')],'unique':_0xc4b8('0x8')},'ListId':{'type':Sequelize[_0xc4b8('0x6')],'unique':_0xc4b8('0x8')},'UserId':{'type':Sequelize[_0xc4b8('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xc4b8('0x6')],'unique':_0xc4b8('0x8')},'CampaignId':{'type':Sequelize[_0xc4b8('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xc4b8('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc4b8('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc4b8('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc4b8('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xc4b8('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xc4b8('0x3')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x37c0=['UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0x37c0,0xde));var _0x037c=function(_0x3d248c,_0x5ef493){_0x3d248c=_0x3d248c-0x0;var _0x556270=_0x37c0[_0x3d248c];return _0x556270;};'use strict';var moment=require(_0x037c('0x0'));var Sequelize=require(_0x037c('0x1'));module['exports']={'phone':{'type':Sequelize[_0x037c('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x037c('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x037c('0x4')],'defaultValue':moment()[_0x037c('0x5')](_0x037c('0x6'))},'countbusyretry':{'type':Sequelize[_0x037c('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x037c('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x037c('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x037c('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x037c('0x4')]},'priority':{'type':Sequelize[_0x037c('0x7')](0x2)[_0x037c('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x037c('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x037c('0x7')],'unique':_0x037c('0x9')},'ListId':{'type':Sequelize[_0x037c('0x7')],'unique':_0x037c('0x9')},'UserId':{'type':Sequelize[_0x037c('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x037c('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x037c('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x037c('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x037c('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x037c('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x037c('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x037c('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x037c('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 9129a06..31a10f7 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 _0xf725=['offset','undefined','count','limit','status','set','Content-Range','update','then','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','intersection','$and','$or','$gt','$lt','$lte','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','updatedAt','state','statedesc','campaign','membername','UserId','deletedat','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','YYYY-MM-DD\x20HH:mm:ss','user','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','getPreviewRecall','scheduledat','dialActive','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','push','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json'];(function(_0x52e67e,_0x1183b8){var _0x1f24d8=function(_0x49d6b4){while(--_0x49d6b4){_0x52e67e['push'](_0x52e67e['shift']());}};_0x1f24d8(++_0x1183b8);}(_0xf725,0x7e));var _0x5f72=function(_0x3ba272,_0x31757b){_0x3ba272=_0x3ba272-0x0;var _0x333eb7=_0xf725[_0x3ba272];return _0x333eb7;};'use strict';var moment=require(_0x5f72('0x0'));var _=require(_0x5f72('0x1'));var qs=require(_0x5f72('0x2'));var logger=require(_0x5f72('0x3'))(_0x5f72('0x4'));var shared=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];function respondWithResult(_0x172588,_0x4200ff){_0x4200ff=_0x4200ff||0xc8;return function(_0x17a5bc){if(_0x17a5bc){return _0x172588['status'](_0x4200ff)[_0x5f72('0x7')](_0x17a5bc);}};}function respondWithFilteredResult(_0x14a92d,_0x3f2ca7){return function(_0x193393){if(_0x193393){var _0x148af8=typeof _0x3f2ca7[_0x5f72('0x8')]===_0x5f72('0x9')&&typeof _0x3f2ca7['limit']==='undefined';var _0x16de9b=_0x193393[_0x5f72('0xa')];var _0x5b74cf=_0x148af8?0x0:_0x3f2ca7[_0x5f72('0x8')];var _0x4735f6=_0x148af8?_0x193393['count']:_0x3f2ca7[_0x5f72('0x8')]+_0x3f2ca7[_0x5f72('0xb')];var _0x115372;if(_0x4735f6>=_0x16de9b){_0x4735f6=_0x16de9b;_0x115372=0xc8;}else{_0x115372=0xce;}_0x14a92d[_0x5f72('0xc')](_0x115372);return _0x14a92d[_0x5f72('0xd')](_0x5f72('0xe'),_0x5b74cf+'-'+_0x4735f6+'/'+_0x16de9b)[_0x5f72('0x7')](_0x193393);}return null;};}function saveUpdates(_0x537d7d,_0x1ac591){return function(_0x3307ed){if(_0x3307ed){return _0x3307ed[_0x5f72('0xf')](_0x537d7d)[_0x5f72('0x10')](function(_0x333d9a){return _0x333d9a;});}return null;};}function handleEntityNotFound(_0x57007a,_0x43d1fd){return function(_0x4f81e9){if(!_0x4f81e9){_0x57007a['sendStatus'](0x194);}return _0x4f81e9;};}function handleError(_0x1665be,_0x5a036c){_0x5a036c=_0x5a036c||0x1f4;return function(_0x3267a){logger['error'](_0x3267a[_0x5f72('0x11')]);if(_0x3267a['name']){delete _0x3267a[_0x5f72('0x12')];}_0x1665be[_0x5f72('0xc')](_0x5a036c)['send'](_0x3267a);};}exports[_0x5f72('0x13')]=function(_0x276323,_0x1497d4){var _0x4af7d3={},_0x490d14={},_0x4b62e1={'count':0x0,'rows':[]};var _0x29c8b8=_[_0x5f72('0x14')](db[_0x5f72('0x15')][_0x5f72('0x16')],function(_0x3428a6){return{'name':_0x3428a6[_0x5f72('0x17')],'type':_0x3428a6[_0x5f72('0x18')]['key']};});_0x490d14[_0x5f72('0x19')]=_[_0x5f72('0x14')](_0x29c8b8,_0x5f72('0x12'));_0x490d14[_0x5f72('0x1a')]=_[_0x5f72('0x1b')](_0x276323[_0x5f72('0x1a')]);_0x490d14[_0x5f72('0x1c')]=_[_0x5f72('0x1d')](_0x490d14[_0x5f72('0x19')],_0x490d14[_0x5f72('0x1a')]);_0x490d14[_0x5f72('0x1c')]=_['concat'](_0x490d14[_0x5f72('0x1c')],[_0x5f72('0x1e'),_0x5f72('0x1f'),_0x5f72('0x20'),'$gte',_0x5f72('0x21'),_0x5f72('0x22'),'$ne',_0x5f72('0x23'),_0x5f72('0x24'),_0x5f72('0x25'),'$notBetween','$in',_0x5f72('0x26'),_0x5f72('0x27'),_0x5f72('0x28'),_0x5f72('0x29'),_0x5f72('0x2a'),_0x5f72('0x27'),_0x5f72('0x2b'),'$contains',_0x5f72('0x2c'),'$any']);_0x4af7d3[_0x5f72('0x2d')]=_[_0x5f72('0x1d')](_0x490d14[_0x5f72('0x19')],qs[_0x5f72('0x2e')](_0x276323[_0x5f72('0x1a')]['fields']));_0x4af7d3['attributes']=_0x4af7d3[_0x5f72('0x2d')][_0x5f72('0x2f')]?_0x4af7d3[_0x5f72('0x2d')]:_0x490d14[_0x5f72('0x19')];if(!_0x276323[_0x5f72('0x1a')][_0x5f72('0x30')](_0x5f72('0x31'))){_0x4af7d3['limit']=qs[_0x5f72('0xb')](_0x276323[_0x5f72('0x1a')][_0x5f72('0xb')]);_0x4af7d3[_0x5f72('0x8')]=qs[_0x5f72('0x8')](_0x276323['query'][_0x5f72('0x8')]);}_0x4af7d3[_0x5f72('0x32')]=qs[_0x5f72('0x33')](_0x276323[_0x5f72('0x1a')][_0x5f72('0x33')]);_0x4af7d3[_0x5f72('0x34')]=qs['filters'](_['pick'](_0x276323[_0x5f72('0x1a')],_0x490d14[_0x5f72('0x1c')]),_0x29c8b8);if(_0x276323['query'][_0x5f72('0x35')]){_0x4af7d3[_0x5f72('0x34')]=_[_0x5f72('0x36')](_0x4af7d3[_0x5f72('0x34')],{'$or':_[_0x5f72('0x14')](_0x29c8b8,function(_0x2ca2ff){if(_0x2ca2ff[_0x5f72('0x18')]!==_0x5f72('0x37')){var _0x2e6b77={};_0x2e6b77[_0x2ca2ff[_0x5f72('0x12')]]={'$like':'%'+_0x276323[_0x5f72('0x1a')][_0x5f72('0x35')]+'%'};return _0x2e6b77;}})});}_0x4af7d3=_[_0x5f72('0x36')]({},_0x4af7d3,_0x276323[_0x5f72('0x38')]);var _0x52fab3={'where':_0x4af7d3[_0x5f72('0x34')]};return db['CmHopper']['count'](_0x52fab3)[_0x5f72('0x10')](function(_0x19b4fa){_0x4b62e1[_0x5f72('0xa')]=_0x19b4fa;if(_0x276323[_0x5f72('0x1a')][_0x5f72('0x39')]){_0x4af7d3[_0x5f72('0x3a')]=[{'all':!![]}];}return db['CmHopper'][_0x5f72('0x3b')](_0x4af7d3);})[_0x5f72('0x10')](function(_0x46f4ce){_0x4b62e1[_0x5f72('0x3c')]=_0x46f4ce;return _0x4b62e1;})[_0x5f72('0x10')](respondWithFilteredResult(_0x1497d4,_0x4af7d3))[_0x5f72('0x3d')](handleError(_0x1497d4,null));};exports[_0x5f72('0x3e')]=function(_0xc742c7,_0x2ef034){var _0x2b8549={'raw':!![],'where':{'id':_0xc742c7[_0x5f72('0x3f')]['id']}},_0x39c2af={};_0x39c2af[_0x5f72('0x19')]=_[_0x5f72('0x1b')](db[_0x5f72('0x15')]['rawAttributes']);_0x39c2af['query']=_[_0x5f72('0x1b')](_0xc742c7['query']);_0x39c2af['filters']=_[_0x5f72('0x1d')](_0x39c2af[_0x5f72('0x19')],_0x39c2af['query']);_0x2b8549[_0x5f72('0x2d')]=_[_0x5f72('0x1d')](_0x39c2af['model'],qs[_0x5f72('0x2e')](_0xc742c7[_0x5f72('0x1a')][_0x5f72('0x2e')]));_0x2b8549[_0x5f72('0x2d')]=_0x2b8549['attributes']['length']?_0x2b8549[_0x5f72('0x2d')]:_0x39c2af[_0x5f72('0x19')];if(_0xc742c7[_0x5f72('0x1a')][_0x5f72('0x39')]){_0x2b8549[_0x5f72('0x3a')]=[{'all':!![]}];}_0x2b8549=_[_0x5f72('0x36')]({},_0x2b8549,_0xc742c7[_0x5f72('0x38')]);return db['CmHopper'][_0x5f72('0x40')](_0x2b8549)[_0x5f72('0x10')](handleEntityNotFound(_0x2ef034,null))[_0x5f72('0x10')](respondWithResult(_0x2ef034,null))[_0x5f72('0x3d')](handleError(_0x2ef034,null));};exports['create']=function(_0x28e912,_0x357e5e){return db[_0x5f72('0x15')][_0x5f72('0x41')](_0x28e912['body'],{})[_0x5f72('0x10')](respondWithResult(_0x357e5e,0xc9))[_0x5f72('0x3d')](handleError(_0x357e5e,null));};exports[_0x5f72('0xf')]=function(_0xd38e5,_0x537287){if(_0xd38e5[_0x5f72('0x42')]['id']){delete _0xd38e5[_0x5f72('0x42')]['id'];}return db['CmHopper'][_0x5f72('0x40')]({'where':{'id':_0xd38e5[_0x5f72('0x3f')]['id']}})['then'](handleEntityNotFound(_0x537287,null))[_0x5f72('0x10')](saveUpdates(_0xd38e5[_0x5f72('0x42')],null))[_0x5f72('0x10')](respondWithResult(_0x537287,null))['catch'](handleError(_0x537287,null));};exports[_0x5f72('0x43')]=function(_0x5efa48,_0x30a9b6){return db[_0x5f72('0x15')]['describe']()[_0x5f72('0x10')](respondWithResult(_0x30a9b6,null))[_0x5f72('0x3d')](handleError(_0x30a9b6,null));};exports[_0x5f72('0x44')]=function(_0x302fff,_0x506774){var _0x41319a;var _0xff5cb5=_0x302fff[_0x5f72('0x3f')]['id'];return db[_0x5f72('0x15')]['find']({'where':{'id':_0x302fff[_0x5f72('0x3f')]['id']}})['then'](handleEntityNotFound(_0x506774,null))[_0x5f72('0x10')](function(_0x7dd3){if(_0x7dd3){return _0x7dd3[_0x5f72('0x44')]()[_0x5f72('0x10')](function(_0x142089){return _0x142089;});}})[_0x5f72('0x10')](function(_0x28008c){_0x41319a=_0x28008c;if(_0x28008c){if(_0x28008c[_0x5f72('0x45')]||_0x28008c[_0x5f72('0x46')]){return db[_0x28008c[_0x5f72('0x45')]?'VoiceQueue':_0x5f72('0x47')][_0x5f72('0x40')]({'where':{'id':_0x28008c[_0x5f72('0x45')]?_0x28008c[_0x5f72('0x45')]:_0x28008c[_0x5f72('0x46')]},'attributes':['id','name'],'raw':!![]});}}})[_0x5f72('0x10')](function(_0x6f9638){var _0x198609={};if(_0x6f9638){_[_0x5f72('0x36')](_0x198609,_[_0x5f72('0x48')](_0x41319a['dataValues'],['createdAt',_0x5f72('0x49'),'id']));_0x198609[_0x5f72('0x4a')]=0x15;_0x198609[_0x5f72('0x4b')]='deleted';_0x198609[_0x5f72('0x4c')]=_0x6f9638[_0x5f72('0x12')];_0x198609[_0x5f72('0x4d')]=_0x302fff['user'][_0x5f72('0x12')];_0x198609[_0x5f72('0x4e')]=_0x302fff['user']['id'];_0x198609['deleted']=!![];_0x198609[_0x5f72('0x4f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x198609[_0x5f72('0x50')]=_0x41319a[_0x5f72('0x51')];_0x198609[_0x5f72('0x52')]=_0x41319a[_0x5f72('0x45')]?_0x5f72('0x53'):_0x5f72('0x54');return db[_0x5f72('0x55')]['find']({'where':{'id':_0x198609[_0x5f72('0x56')]},'attributes':['firstName',_0x5f72('0x57')]})[_0x5f72('0x10')](function(_0x48651e){if(!_[_0x5f72('0x58')](_0x506774)&&!_[_0x5f72('0x58')](_0x48651e[_0x5f72('0x59')])){_0x198609[_0x5f72('0x5a')]=_0x48651e[_0x5f72('0x59')];if(!_['isNil'](_0x48651e[_0x5f72('0x57')])){_0x198609[_0x5f72('0x5a')]+='\x20'+_0x48651e[_0x5f72('0x57')];}}})['finally'](function(){return db[_0x5f72('0x5b')][_0x5f72('0x41')](_0x198609);});}})[_0x5f72('0x10')](function(_0xb1e925){return db[_0x5f72('0x5c')][_0x5f72('0x44')]({'where':{'CmHopperId':_0xff5cb5}});})[_0x5f72('0x10')](function(){return _0x506774[_0x5f72('0xc')](0xcc)[_0x5f72('0x5d')]();})[_0x5f72('0x3d')](handleError(_0x506774,null));};exports[_0x5f72('0x5e')]=function(_0x554dcf,_0x56bfa2){var _0x2545fd=[];return db[_0x5f72('0x55')][_0x5f72('0x43')]()[_0x5f72('0x10')](function(_0xf1d356){_0x2545fd=_[_0x5f72('0x1b')](_0xf1d356);return _0x554dcf['user'][_0x5f72('0x5f')]({'where':{'type':_0x5f72('0x60'),'dialActive':!![],'dialMethod':_0x5f72('0x61')},'attributes':['id',_0x5f72('0x62'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x5f72('0x10')](function(_0x5b119c){if(_0x5b119c&&_0x5b119c[_0x5f72('0x2f')]){return db[_0x5f72('0x63')][_0x5f72('0x64')](function(_0x6b865d){var _0x58b330={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5f72('0x65')](_0x5f72('0x66'))},'VoiceQueueId':{'$in':_[_0x5f72('0x14')](_0x5b119c,'id')},'$or':[{'UserId':null},{'UserId':_0x554dcf[_0x5f72('0x67')]['id']}]};var _0x59af10={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5b119c)['filter']([_0x5f72('0x68'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x554dcf[_0x5f72('0x67')]['id']}]};var _0x1ed9b1={'$or':[_0x58b330,_0x59af10]};var _0x2a5dcb=[];if(_0x554dcf['body'][_0x5f72('0x69')]&&_0x554dcf[_0x5f72('0x42')][_0x5f72('0x69')]===_0x5f72('0x6a')){if(!_[_0x5f72('0x6b')](_0x554dcf[_0x5f72('0x42')][_0x5f72('0x6c')])){_0x1ed9b1['id']={'$in':_0x554dcf[_0x5f72('0x42')][_0x5f72('0x6c')]};}_0x2a5dcb=[[_0x5f72('0x6d'),_0x5f72('0x6e')],[_0x5f72('0x6f'),_0x5b119c[0x0][_0x5f72('0x62')]==='ASC'?_0x5f72('0x70'):_0x5f72('0x6e')],db[_0x5f72('0x63')]['literal'](_0x5f72('0x71')),['id','DESC']];}else{if(!_['isEmpty'](_0x554dcf['body']['hopperIds'])){_0x1ed9b1['id']={'$notIn':_0x554dcf['body'][_0x5f72('0x6c')]};}_0x2a5dcb=[['priority','DESC'],[_0x5f72('0x6f'),_0x5b119c[0x0][_0x5f72('0x62')]],db[_0x5f72('0x63')][_0x5f72('0x72')](_0x5f72('0x73')),['id',_0x5f72('0x6e')]];}return db[_0x5f72('0x15')][_0x5f72('0x74')]({'attributes':['id','scheduledat',_0x5f72('0x51'),_0x5f72('0x75')],'where':_0x1ed9b1,'order':_0x2a5dcb,'transaction':_0x6b865d,'lock':_0x6b865d[_0x5f72('0x76')][_0x5f72('0x77')],'include':[{'model':db[_0x5f72('0x55')],'as':_0x5f72('0x78'),'attributes':_0x2545fd,'include':[{'model':db[_0x5f72('0x79')],'as':_0x5f72('0x7a'),'attributes':['id',_0x5f72('0x12')]}]},{'model':db[_0x5f72('0x7b')],'as':_0x5f72('0x7c'),'attributes':['id',_0x5f72('0x12')]},{'model':db[_0x5f72('0x7d')],'as':_0x5f72('0x7e'),'attributes':['id',_0x5f72('0x12'),'dialActive']}]})[_0x5f72('0x10')](function(_0x34ac8f){if(_0x34ac8f){return _0x34ac8f[_0x5f72('0xf')]({'UserId':_0x554dcf['user']['id']},{'transaction':_0x6b865d});}});});}})[_0x5f72('0x10')](handleEntityNotFound(_0x56bfa2,null))['then'](respondWithResult(_0x56bfa2,null))[_0x5f72('0x3d')](handleError(_0x56bfa2,null));};exports[_0x5f72('0x7f')]=function(_0x43cfc0,_0x4281b7,_0x4ee2f6){var _0x8886b4=[];var _0x1145a1=_0x43cfc0['params']['id'];var _0x32c4e3=_0x43cfc0[_0x5f72('0x67')]['id'];return db[_0x5f72('0x55')][_0x5f72('0x43')]()[_0x5f72('0x10')](function(_0x358ecb){_0x8886b4=_[_0x5f72('0x1b')](_0x358ecb);return db[_0x5f72('0x63')]['transaction'](function(_0x71d3c6){const _0x653bd0={'id':_0x1145a1};return db[_0x5f72('0x15')][_0x5f72('0x74')]({'attributes':['id',_0x5f72('0x80'),_0x5f72('0x75')],'where':_0x653bd0,'transaction':_0x71d3c6,'lock':_0x71d3c6[_0x5f72('0x76')][_0x5f72('0x77')],'include':[{'model':db['CmContact'],'as':_0x5f72('0x78'),'attributes':_0x8886b4,'include':[{'model':db[_0x5f72('0x79')],'as':_0x5f72('0x7a'),'attributes':['id','name']}]},{'model':db[_0x5f72('0x7b')],'as':_0x5f72('0x7c'),'attributes':['id',_0x5f72('0x12')]},{'model':db['VoiceQueue'],'as':_0x5f72('0x7e'),'attributes':['id',_0x5f72('0x12'),_0x5f72('0x81')]}]})[_0x5f72('0x10')](function(_0xc929da){if(_0xc929da){return _0xc929da[_0x5f72('0xf')]({'UserId':_0x32c4e3},{'transaction':_0x71d3c6});}});});})[_0x5f72('0x10')](handleEntityNotFound(_0x4281b7,null))['then'](respondWithResult(_0x4281b7,null))['catch'](handleError(_0x4281b7,null));};exports['getOpenContacts']=function(_0x4d2539,_0x4dd4f9){return _0x4d2539[_0x5f72('0x67')]['getVoiceQueues']({'where':{'type':_0x5f72('0x60'),'dialActive':!![],'dialMethod':_0x5f72('0x61')},'attributes':['id'],'raw':!![]})[_0x5f72('0x10')](function(_0x38a654){if(_0x38a654&&_0x38a654[_0x5f72('0x2f')]){return db[_0x5f72('0x15')][_0x5f72('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5f72('0x65')](_0x5f72('0x66'))},'VoiceQueueId':{'$in':_[_0x5f72('0x14')](_0x38a654,'id')},'$or':[{'UserId':null},{'UserId':_0x4d2539[_0x5f72('0x67')]['id']}]}});}return 0x0;})['then'](function(_0x1cccd9){if(!_[_0x5f72('0x58')](_0x1cccd9)&&_[_0x5f72('0x82')](_0x1cccd9)){return _0x4dd4f9[_0x5f72('0xc')](0xc8)['json']({'contacts':_0x1cccd9});}else{logger[_0x5f72('0x83')](_0x5f72('0x84'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x4dd4f9['sendStatus'](0x194);}})[_0x5f72('0x3d')](handleError(_0x4dd4f9,null));};exports['getTimezones']=function(_0x5bde79,_0x5cd8dc){var _0x170c22=shared['timezones'];var _0x2b25e9=[];_['map'](_0x170c22,function(_0x39eaf8){_0x2b25e9[_0x5f72('0x85')]({'id':_0x39eaf8['name'],'name':_0x39eaf8[_0x5f72('0x12')],'utcOffset':_0x39eaf8['utcOffset']});});return _0x5cd8dc['status'](0xc8)[_0x5f72('0x7')]({'tz':_0x2b25e9});};exports['getTimezone']=function(_0x39e996,_0x5666eb){var _0x5b1a94=shared['timezones'];var _0x3572e3={};if(!_['isNil'](_0x5b1a94[_0x39e996['body']['id']]))_0x3572e3=_0x5b1a94[_0x39e996['body']['id']];return _0x5666eb['status'](0xc8)[_0x5f72('0x7')](_0x3572e3);}; \ No newline at end of file +var _0x23f4=['VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','findOne','recallme','LOCK','Contact','CmCompany','Queue','dialActive','getPreviewRecall','transaction','scheduledat','UPDATE','Company','CmList','List','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','api','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notILike','$overlap','$any','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filter','where'];(function(_0x378eab,_0x17f644){var _0x11a512=function(_0x33f51f){while(--_0x33f51f){_0x378eab['push'](_0x378eab['shift']());}};_0x11a512(++_0x17f644);}(_0x23f4,0x1ee));var _0x423f=function(_0x398215,_0x334573){_0x398215=_0x398215-0x0;var _0x35c5e6=_0x23f4[_0x398215];return _0x35c5e6;};'use strict';var moment=require('moment');var _=require(_0x423f('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x423f('0x1'));var shared=require(_0x423f('0x2'));var db=require(_0x423f('0x3'))['db'];function respondWithResult(_0x3503a0,_0x1ab106){_0x1ab106=_0x1ab106||0xc8;return function(_0x129dba){if(_0x129dba){return _0x3503a0[_0x423f('0x4')](_0x1ab106)[_0x423f('0x5')](_0x129dba);}};}function respondWithFilteredResult(_0x34a2d9,_0x51066b){return function(_0x260eae){if(_0x260eae){var _0x47716d=typeof _0x51066b['offset']===_0x423f('0x6')&&typeof _0x51066b[_0x423f('0x7')]===_0x423f('0x6');var _0x50301a=_0x260eae['count'];var _0x4b8a90=_0x47716d?0x0:_0x51066b[_0x423f('0x8')];var _0x481c41=_0x47716d?_0x260eae[_0x423f('0x9')]:_0x51066b[_0x423f('0x8')]+_0x51066b[_0x423f('0x7')];var _0x162c83;if(_0x481c41>=_0x50301a){_0x481c41=_0x50301a;_0x162c83=0xc8;}else{_0x162c83=0xce;}_0x34a2d9['status'](_0x162c83);return _0x34a2d9[_0x423f('0xa')](_0x423f('0xb'),_0x4b8a90+'-'+_0x481c41+'/'+_0x50301a)[_0x423f('0x5')](_0x260eae);}return null;};}function saveUpdates(_0x3d4027,_0x216360){return function(_0x5275b0){if(_0x5275b0){return _0x5275b0[_0x423f('0xc')](_0x3d4027)[_0x423f('0xd')](function(_0x2ebc8c){return _0x2ebc8c;});}return null;};}function handleEntityNotFound(_0x1c894f,_0x44e1d5){return function(_0x3b531d){if(!_0x3b531d){_0x1c894f[_0x423f('0xe')](0x194);}return _0x3b531d;};}function handleError(_0x21d804,_0x252e6c){_0x252e6c=_0x252e6c||0x1f4;return function(_0x235c86){logger[_0x423f('0xf')](_0x235c86[_0x423f('0x10')]);if(_0x235c86[_0x423f('0x11')]){delete _0x235c86[_0x423f('0x11')];}_0x21d804[_0x423f('0x4')](_0x252e6c)[_0x423f('0x12')](_0x235c86);};}exports[_0x423f('0x13')]=function(_0x34e968,_0x26b6d1){var _0x5424e6={},_0x99435f={},_0x569fd0={'count':0x0,'rows':[]};var _0x504d8b=_[_0x423f('0x14')](db['CmHopper'][_0x423f('0x15')],function(_0xd7b80e){return{'name':_0xd7b80e['fieldName'],'type':_0xd7b80e[_0x423f('0x16')][_0x423f('0x17')]};});_0x99435f['model']=_[_0x423f('0x14')](_0x504d8b,_0x423f('0x11'));_0x99435f['query']=_[_0x423f('0x18')](_0x34e968[_0x423f('0x19')]);_0x99435f['filters']=_[_0x423f('0x1a')](_0x99435f['model'],_0x99435f[_0x423f('0x19')]);_0x99435f[_0x423f('0x1b')]=_[_0x423f('0x1c')](_0x99435f[_0x423f('0x1b')],[_0x423f('0x1d'),_0x423f('0x1e'),_0x423f('0x1f'),_0x423f('0x20'),_0x423f('0x21'),_0x423f('0x22'),_0x423f('0x23'),_0x423f('0x24'),_0x423f('0x25'),_0x423f('0x26'),'$notBetween',_0x423f('0x27'),_0x423f('0x28'),_0x423f('0x29'),'$notLike','$iLike',_0x423f('0x2a'),_0x423f('0x29'),_0x423f('0x2b'),'$contains','$contained',_0x423f('0x2c')]);_0x5424e6[_0x423f('0x2d')]=_['intersection'](_0x99435f[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x34e968[_0x423f('0x19')][_0x423f('0x2f')]));_0x5424e6['attributes']=_0x5424e6[_0x423f('0x2d')][_0x423f('0x30')]?_0x5424e6[_0x423f('0x2d')]:_0x99435f[_0x423f('0x2e')];if(!_0x34e968['query'][_0x423f('0x31')](_0x423f('0x32'))){_0x5424e6[_0x423f('0x7')]=qs[_0x423f('0x7')](_0x34e968[_0x423f('0x19')][_0x423f('0x7')]);_0x5424e6[_0x423f('0x8')]=qs[_0x423f('0x8')](_0x34e968[_0x423f('0x19')][_0x423f('0x8')]);}_0x5424e6['order']=qs[_0x423f('0x33')](_0x34e968[_0x423f('0x19')][_0x423f('0x33')]);_0x5424e6['where']=qs[_0x423f('0x1b')](_['pick'](_0x34e968[_0x423f('0x19')],_0x99435f[_0x423f('0x1b')]),_0x504d8b);if(_0x34e968[_0x423f('0x19')][_0x423f('0x34')]){_0x5424e6[_0x423f('0x35')]=_['merge'](_0x5424e6['where'],{'$or':_[_0x423f('0x14')](_0x504d8b,function(_0x5a2225){if(_0x5a2225[_0x423f('0x16')]!==_0x423f('0x36')){var _0x3e4c9f={};_0x3e4c9f[_0x5a2225[_0x423f('0x11')]]={'$like':'%'+_0x34e968[_0x423f('0x19')][_0x423f('0x34')]+'%'};return _0x3e4c9f;}})});}_0x5424e6=_[_0x423f('0x37')]({},_0x5424e6,_0x34e968[_0x423f('0x38')]);var _0x3aeb17={'where':_0x5424e6[_0x423f('0x35')]};return db[_0x423f('0x39')]['count'](_0x3aeb17)['then'](function(_0x382f91){_0x569fd0[_0x423f('0x9')]=_0x382f91;if(_0x34e968[_0x423f('0x19')][_0x423f('0x3a')]){_0x5424e6[_0x423f('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x423f('0x3c')](_0x5424e6);})[_0x423f('0xd')](function(_0x2e6d28){_0x569fd0[_0x423f('0x3d')]=_0x2e6d28;return _0x569fd0;})[_0x423f('0xd')](respondWithFilteredResult(_0x26b6d1,_0x5424e6))[_0x423f('0x3e')](handleError(_0x26b6d1,null));};exports[_0x423f('0x3f')]=function(_0x1d280f,_0x3464e3){var _0x40571a={'raw':!![],'where':{'id':_0x1d280f['params']['id']}},_0x4fb566={};_0x4fb566[_0x423f('0x2e')]=_[_0x423f('0x18')](db[_0x423f('0x39')][_0x423f('0x15')]);_0x4fb566[_0x423f('0x19')]=_[_0x423f('0x18')](_0x1d280f['query']);_0x4fb566[_0x423f('0x1b')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],_0x4fb566[_0x423f('0x19')]);_0x40571a[_0x423f('0x2d')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x1d280f['query'][_0x423f('0x2f')]));_0x40571a[_0x423f('0x2d')]=_0x40571a[_0x423f('0x2d')][_0x423f('0x30')]?_0x40571a[_0x423f('0x2d')]:_0x4fb566[_0x423f('0x2e')];if(_0x1d280f[_0x423f('0x19')][_0x423f('0x3a')]){_0x40571a[_0x423f('0x3b')]=[{'all':!![]}];}_0x40571a=_['merge']({},_0x40571a,_0x1d280f[_0x423f('0x38')]);return db['CmHopper'][_0x423f('0x40')](_0x40571a)[_0x423f('0xd')](handleEntityNotFound(_0x3464e3,null))[_0x423f('0xd')](respondWithResult(_0x3464e3,null))[_0x423f('0x3e')](handleError(_0x3464e3,null));};exports[_0x423f('0x41')]=function(_0x3ad48c,_0x3087e4){return db[_0x423f('0x39')][_0x423f('0x41')](_0x3ad48c[_0x423f('0x42')],{})[_0x423f('0xd')](respondWithResult(_0x3087e4,0xc9))[_0x423f('0x3e')](handleError(_0x3087e4,null));};exports[_0x423f('0xc')]=function(_0x350e11,_0xa7708c){if(_0x350e11[_0x423f('0x42')]['id']){delete _0x350e11[_0x423f('0x42')]['id'];}return db[_0x423f('0x39')][_0x423f('0x40')]({'where':{'id':_0x350e11[_0x423f('0x43')]['id']}})['then'](handleEntityNotFound(_0xa7708c,null))[_0x423f('0xd')](saveUpdates(_0x350e11['body'],null))[_0x423f('0xd')](respondWithResult(_0xa7708c,null))[_0x423f('0x3e')](handleError(_0xa7708c,null));};exports[_0x423f('0x44')]=function(_0x37035a,_0x57f5d6){return db[_0x423f('0x39')][_0x423f('0x44')]()[_0x423f('0xd')](respondWithResult(_0x57f5d6,null))[_0x423f('0x3e')](handleError(_0x57f5d6,null));};exports[_0x423f('0x45')]=function(_0x31b88e,_0x2dcbec){var _0x489894;var _0x1e2b9f=_0x31b88e[_0x423f('0x43')]['id'];return db['CmHopper'][_0x423f('0x40')]({'where':{'id':_0x31b88e['params']['id']}})[_0x423f('0xd')](handleEntityNotFound(_0x2dcbec,null))['then'](function(_0x56e907){if(_0x56e907){return _0x56e907[_0x423f('0x45')]()[_0x423f('0xd')](function(_0x1668d4){return _0x1668d4;});}})[_0x423f('0xd')](function(_0x545476){_0x489894=_0x545476;if(_0x545476){if(_0x545476[_0x423f('0x46')]||_0x545476['CampaignId']){return db[_0x545476[_0x423f('0x46')]?_0x423f('0x47'):_0x423f('0x48')][_0x423f('0x40')]({'where':{'id':_0x545476[_0x423f('0x46')]?_0x545476[_0x423f('0x46')]:_0x545476[_0x423f('0x49')]},'attributes':['id',_0x423f('0x11')],'raw':!![]});}}})[_0x423f('0xd')](function(_0x4e3003){var _0x104fd9={};if(_0x4e3003){_[_0x423f('0x37')](_0x104fd9,_['omit'](_0x489894[_0x423f('0x4a')],['createdAt',_0x423f('0x4b'),'id']));_0x104fd9[_0x423f('0x4c')]=0x15;_0x104fd9[_0x423f('0x4d')]=_0x423f('0x4e');_0x104fd9[_0x423f('0x4f')]=_0x4e3003[_0x423f('0x11')];_0x104fd9['membername']=_0x31b88e['user'][_0x423f('0x11')];_0x104fd9[_0x423f('0x50')]=_0x31b88e[_0x423f('0x51')]['id'];_0x104fd9[_0x423f('0x4e')]=!![];_0x104fd9[_0x423f('0x52')]=moment()[_0x423f('0x53')](_0x423f('0x54'));_0x104fd9[_0x423f('0x55')]=_0x489894[_0x423f('0x56')];_0x104fd9['campaigntype']=_0x489894[_0x423f('0x46')]?_0x423f('0x57'):'ivr';return db[_0x423f('0x58')]['find']({'where':{'id':_0x104fd9[_0x423f('0x59')]},'attributes':[_0x423f('0x5a'),_0x423f('0x5b')]})['then'](function(_0x5c39e4){if(!_[_0x423f('0x5c')](_0x2dcbec)&&!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5a')])){_0x104fd9['calleridname']=_0x5c39e4[_0x423f('0x5a')];if(!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5b')])){_0x104fd9[_0x423f('0x5d')]+='\x20'+_0x5c39e4[_0x423f('0x5b')];}}})[_0x423f('0x5e')](function(){return db[_0x423f('0x5f')]['create'](_0x104fd9);});}})[_0x423f('0xd')](function(_0x588483){return db[_0x423f('0x60')][_0x423f('0x45')]({'where':{'CmHopperId':_0x1e2b9f}});})[_0x423f('0xd')](function(){return _0x2dcbec[_0x423f('0x4')](0xcc)['end']();})[_0x423f('0x3e')](handleError(_0x2dcbec,null));};exports[_0x423f('0x61')]=function(_0x4c33c7,_0x5ae8a9){var _0xfe89a9=[];return db[_0x423f('0x58')]['describe']()[_0x423f('0xd')](function(_0x1897ff){_0xfe89a9=_['keys'](_0x1897ff);return _0x4c33c7['user']['getVoiceQueues']({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':_0x423f('0x63')},'attributes':['id',_0x423f('0x64'),_0x423f('0x65')],'raw':!![]});})['then'](function(_0x4fa0ef){if(_0x4fa0ef&&_0x4fa0ef[_0x423f('0x30')]){return db[_0x423f('0x66')]['transaction'](function(_0x43b569){var _0x13ed0b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_[_0x423f('0x14')](_0x4fa0ef,'id')},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x116605={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4fa0ef)['filter']([_0x423f('0x65'),0x0])[_0x423f('0x14')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x223e8c={'$or':[_0x13ed0b,_0x116605]};var _0x3e5d47=[];if(_0x4c33c7['body'][_0x423f('0x67')]&&_0x4c33c7[_0x423f('0x42')][_0x423f('0x67')]===_0x423f('0x68')){if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')])){_0x223e8c['id']={'$in':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[['priority',_0x423f('0x6b')],[_0x423f('0x6c'),_0x4fa0ef[0x0][_0x423f('0x64')]===_0x423f('0x6b')?'DESC':_0x423f('0x6b')],db[_0x423f('0x66')][_0x423f('0x6d')](_0x423f('0x6e')),['id',_0x423f('0x6f')]];}else{if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')]['hopperIds'])){_0x223e8c['id']={'$notIn':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[[_0x423f('0x70'),_0x423f('0x6f')],['scheduledAt',_0x4fa0ef[0x0][_0x423f('0x64')]],db[_0x423f('0x66')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x423f('0x6b')]];}return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id','scheduledat',_0x423f('0x56'),_0x423f('0x72')],'where':_0x223e8c,'order':_0x3e5d47,'transaction':_0x43b569,'lock':_0x43b569[_0x423f('0x73')]['UPDATE'],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0xfe89a9,'include':[{'model':db[_0x423f('0x75')],'as':'Company','attributes':['id',_0x423f('0x11')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':_0x423f('0x76'),'attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})['then'](function(_0x29e60c){if(_0x29e60c){return _0x29e60c[_0x423f('0xc')]({'UserId':_0x4c33c7[_0x423f('0x51')]['id']},{'transaction':_0x43b569});}});});}})[_0x423f('0xd')](handleEntityNotFound(_0x5ae8a9,null))[_0x423f('0xd')](respondWithResult(_0x5ae8a9,null))[_0x423f('0x3e')](handleError(_0x5ae8a9,null));};exports[_0x423f('0x78')]=function(_0x5b9577,_0x4e1e04,_0xd9409e){var _0x320528=[];var _0xe76487=_0x5b9577[_0x423f('0x43')]['id'];var _0x3cffc3=_0x5b9577['user']['id'];return db[_0x423f('0x58')][_0x423f('0x44')]()[_0x423f('0xd')](function(_0x358ab3){_0x320528=_[_0x423f('0x18')](_0x358ab3);return db[_0x423f('0x66')][_0x423f('0x79')](function(_0x1db383){const _0x20bd00={'id':_0xe76487};return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id',_0x423f('0x7a'),_0x423f('0x72')],'where':_0x20bd00,'transaction':_0x1db383,'lock':_0x1db383['LOCK'][_0x423f('0x7b')],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0x320528,'include':[{'model':db[_0x423f('0x75')],'as':_0x423f('0x7c'),'attributes':['id','name']}]},{'model':db[_0x423f('0x7d')],'as':_0x423f('0x7e'),'attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':'Queue','attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})[_0x423f('0xd')](function(_0x3832b6){if(_0x3832b6){return _0x3832b6[_0x423f('0xc')]({'UserId':_0x3cffc3},{'transaction':_0x1db383});}});});})[_0x423f('0xd')](handleEntityNotFound(_0x4e1e04,null))[_0x423f('0xd')](respondWithResult(_0x4e1e04,null))[_0x423f('0x3e')](handleError(_0x4e1e04,null));};exports[_0x423f('0x7f')]=function(_0x22f2af,_0x3c78c7){return _0x22f2af[_0x423f('0x51')][_0x423f('0x80')]({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x423f('0xd')](function(_0x5333b7){if(_0x5333b7&&_0x5333b7['length']){return db[_0x423f('0x39')][_0x423f('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_['map'](_0x5333b7,'id')},'$or':[{'UserId':null},{'UserId':_0x22f2af[_0x423f('0x51')]['id']}]}});}return 0x0;})['then'](function(_0xf18525){if(!_[_0x423f('0x5c')](_0xf18525)&&_[_0x423f('0x81')](_0xf18525)){return _0x3c78c7[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'contacts':_0xf18525});}else{logger['error'](_0x423f('0x82'),'getOpenContacts',0x194,_0x423f('0x83'));_0x3c78c7['sendStatus'](0x194);}})[_0x423f('0x3e')](handleError(_0x3c78c7,null));};exports[_0x423f('0x84')]=function(_0x1990ec,_0x5697e8){var _0xbcf529=shared[_0x423f('0x85')];var _0x3ecfd5=[];_[_0x423f('0x14')](_0xbcf529,function(_0x5baf51){_0x3ecfd5[_0x423f('0x86')]({'id':_0x5baf51[_0x423f('0x11')],'name':_0x5baf51['name'],'utcOffset':_0x5baf51[_0x423f('0x87')]});});return _0x5697e8[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'tz':_0x3ecfd5});};exports[_0x423f('0x88')]=function(_0x36241e,_0x2bb2ba){var _0x140db1=shared[_0x423f('0x85')];var _0x2ede33={};if(!_[_0x423f('0x5c')](_0x140db1[_0x36241e['body']['id']]))_0x2ede33=_0x140db1[_0x36241e['body']['id']];return _0x2bb2ba[_0x423f('0x4')](0xc8)['json'](_0x2ede33);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index cbe466e..6795258 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 _0x5fab=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x52bd41,_0x14b4d6){var _0x79d83b=function(_0x18ab8c){while(--_0x18ab8c){_0x52bd41['push'](_0x52bd41['shift']());}};_0x79d83b(++_0x14b4d6);}(_0x5fab,0x177));var _0xb5fa=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x5fab[_0x7791d5];return _0x5ce288;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['scheduledat']},{'name':_0xb5fa('0xe'),'fields':[_0xb5fa('0xe')]},{'name':_0xb5fa('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d17=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0xb68b7a,_0x559383){var _0x5dee58=function(_0x35e9c6){while(--_0x35e9c6){_0xb68b7a['push'](_0xb68b7a['shift']());}};_0x5dee58(++_0x559383);}(_0x5d17,0x114));var _0x75d1=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x5d17[_0x11155f];return _0xd07e48;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[{'name':_0x75d1('0xc'),'fields':[_0x75d1('0xc')]},{'name':_0x75d1('0xd'),'fields':['phone']},{'name':'priority','fields':[_0x75d1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 96fce6f..0173a83 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 _0xf8ae=['getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetCmHopper','CmHopper','findAll','options','where','limit','include','map','model','attributes','ShowCmHopper','find','raw','CreateCmHopper','create','body','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','User','Agent','name','voicePause','UserId','push','all','length','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','Contact','keys','GetContactByPhone','findOne','phone'];(function(_0x28b8fa,_0x41c475){var _0x4a2960=function(_0x47321d){while(--_0x47321d){_0x28b8fa['push'](_0x28b8fa['shift']());}};_0x4a2960(++_0x41c475);}(_0xf8ae,0x168));var _0xef8a=function(_0x4a7389,_0xa99bd9){_0x4a7389=_0x4a7389-0x0;var _0x246ee8=_0xf8ae[_0x4a7389];return _0x246ee8;};'use strict';var _=require(_0xef8a('0x0'));var util=require(_0xef8a('0x1'));var moment=require('moment');var BPromise=require(_0xef8a('0x2'));var db=require(_0xef8a('0x3'))['db'];var logger=require(_0xef8a('0x4'))(_0xef8a('0x5'));var jayson=require(_0xef8a('0x6'));var client=jayson[_0xef8a('0x7')][_0xef8a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26e83e,_0xee6dcc,_0x442f58){return new BPromise(function(_0x214c9c,_0x2ac7c2){return client[_0xef8a('0x9')](_0x26e83e,_0x442f58)[_0xef8a('0xa')](function(_0x51bb3d){logger['info'](_0xef8a('0xb'),_0xee6dcc,_0xef8a('0xc'));logger[_0xef8a('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xee6dcc,_0xef8a('0xc'),JSON[_0xef8a('0xe')](_0x51bb3d));if(_0x51bb3d[_0xef8a('0xf')]){if(_0x51bb3d['error']['code']===0x1f4){logger[_0xef8a('0xf')](_0xef8a('0xb'),_0xee6dcc,_0x51bb3d[_0xef8a('0xf')][_0xef8a('0x10')]);return _0x2ac7c2(_0x51bb3d[_0xef8a('0xf')][_0xef8a('0x10')]);}logger['error'](_0xef8a('0xb'),_0xee6dcc,_0x51bb3d[_0xef8a('0xf')][_0xef8a('0x10')]);return _0x214c9c(_0x51bb3d[_0xef8a('0xf')]['message']);}else{logger[_0xef8a('0x11')](_0xef8a('0xb'),_0xee6dcc,'request\x20sent');_0x214c9c(_0x51bb3d[_0xef8a('0x12')]['message']);}})[_0xef8a('0x13')](function(_0xa8e8c2){logger[_0xef8a('0xf')](_0xef8a('0xb'),_0xee6dcc,_0xa8e8c2);_0x2ac7c2(_0xa8e8c2);});});}exports[_0xef8a('0x14')]=function(_0x2819fd){var _0x1c0d55=this;return new Promise(function(_0x2e98bf,_0x216c4e){return db[_0xef8a('0x15')][_0xef8a('0x16')]({'raw':_0x2819fd[_0xef8a('0x17')]?_0x2819fd[_0xef8a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2819fd[_0xef8a('0x17')]?_0x2819fd[_0xef8a('0x17')][_0xef8a('0x18')]||null:null,'attributes':_0x2819fd[_0xef8a('0x17')]?_0x2819fd[_0xef8a('0x17')]['attributes']||null:null,'limit':_0x2819fd[_0xef8a('0x17')]?_0x2819fd[_0xef8a('0x17')][_0xef8a('0x19')]||null:null,'include':_0x2819fd[_0xef8a('0x17')]?_0x2819fd[_0xef8a('0x17')][_0xef8a('0x1a')]?_[_0xef8a('0x1b')](_0x2819fd['options'][_0xef8a('0x1a')],function(_0x112d4a){return{'model':db[_0x112d4a['model']],'as':_0x112d4a['as'],'attributes':_0x112d4a['attributes'],'include':_0x112d4a[_0xef8a('0x1a')]?_[_0xef8a('0x1b')](_0x112d4a[_0xef8a('0x1a')],function(_0x53ee10){return{'model':db[_0x53ee10[_0xef8a('0x1c')]],'as':_0x53ee10['as'],'attributes':_0x53ee10[_0xef8a('0x1d')],'include':_0x53ee10['include']?_[_0xef8a('0x1b')](_0x53ee10[_0xef8a('0x1a')],function(_0x47d49b){return{'model':db[_0x47d49b[_0xef8a('0x1c')]],'as':_0x47d49b['as'],'attributes':_0x47d49b[_0xef8a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef8a('0xa')](function(_0x2b83a7){logger['info']('GetCmHopper',_0x2819fd);logger[_0xef8a('0xd')](_0xef8a('0x14'),_0x2819fd,JSON[_0xef8a('0xe')](_0x2b83a7));_0x2e98bf(_0x2b83a7);})[_0xef8a('0x13')](function(_0x171399){logger[_0xef8a('0xf')](_0xef8a('0x14'),_0x171399[_0xef8a('0x10')],_0x2819fd);_0x216c4e(_0x1c0d55[_0xef8a('0xf')](0x1f4,_0x171399['message']));});});};exports[_0xef8a('0x1e')]=function(_0x4f803d){var _0x325254=this;return new Promise(function(_0x5b464b,_0x3884eb){return db[_0xef8a('0x15')][_0xef8a('0x1f')]({'raw':_0x4f803d['options']?_0x4f803d[_0xef8a('0x17')][_0xef8a('0x20')]===undefined?!![]:![]:!![],'where':_0x4f803d[_0xef8a('0x17')]?_0x4f803d[_0xef8a('0x17')]['where']||null:null,'attributes':_0x4f803d['options']?_0x4f803d['options'][_0xef8a('0x1d')]||null:null,'include':_0x4f803d[_0xef8a('0x17')]?_0x4f803d[_0xef8a('0x17')][_0xef8a('0x1a')]?_['map'](_0x4f803d['options']['include'],function(_0x76b4e6){return{'model':db[_0x76b4e6[_0xef8a('0x1c')]],'as':_0x76b4e6['as'],'attributes':_0x76b4e6[_0xef8a('0x1d')],'include':_0x76b4e6['include']?_[_0xef8a('0x1b')](_0x76b4e6[_0xef8a('0x1a')],function(_0x32adcc){return{'model':db[_0x32adcc[_0xef8a('0x1c')]],'as':_0x32adcc['as'],'attributes':_0x32adcc[_0xef8a('0x1d')],'include':_0x32adcc['include']?_['map'](_0x32adcc[_0xef8a('0x1a')],function(_0x8025fc){return{'model':db[_0x8025fc[_0xef8a('0x1c')]],'as':_0x8025fc['as'],'attributes':_0x8025fc['attributes']};}):[]};}):[]};}):[]:[]})[_0xef8a('0xa')](function(_0x5d74b5){logger[_0xef8a('0x11')](_0xef8a('0x1e'),_0x4f803d);logger[_0xef8a('0xd')](_0xef8a('0x1e'),_0x4f803d,JSON[_0xef8a('0xe')](_0x5d74b5));_0x5b464b(_0x5d74b5);})[_0xef8a('0x13')](function(_0x2a10e8){logger[_0xef8a('0xf')](_0xef8a('0x1e'),_0x2a10e8[_0xef8a('0x10')],_0x4f803d);_0x3884eb(_0x325254[_0xef8a('0xf')](0x1f4,_0x2a10e8[_0xef8a('0x10')]));});});};exports[_0xef8a('0x21')]=function(_0x350cad){var _0x3bead9=this;return new Promise(function(_0x558255,_0x3aa267){return db[_0xef8a('0x15')][_0xef8a('0x22')](_0x350cad[_0xef8a('0x23')],{'raw':_0x350cad[_0xef8a('0x17')]?_0x350cad['options'][_0xef8a('0x20')]===undefined?!![]:![]:!![]})[_0xef8a('0xa')](function(_0x182758){logger[_0xef8a('0x11')](_0xef8a('0x21'),_0x350cad);logger['debug'](_0xef8a('0x21'),_0x350cad,JSON[_0xef8a('0xe')](_0x182758));_0x558255(_0x182758);})[_0xef8a('0x13')](function(_0x9e27cd){logger[_0xef8a('0xf')](_0xef8a('0x21'),_0x9e27cd[_0xef8a('0x10')],_0x350cad);_0x3aa267(_0x3bead9[_0xef8a('0xf')](0x1f4,_0x9e27cd[_0xef8a('0x10')]));});});};exports['UpdateCmHopper']=function(_0x1f082c){var _0x3d3858=this;return new Promise(function(_0x4b128c,_0x58456a){return db[_0xef8a('0x15')][_0xef8a('0x24')](_0x1f082c[_0xef8a('0x23')],{'raw':_0x1f082c['options']?_0x1f082c[_0xef8a('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f082c[_0xef8a('0x17')]?_0x1f082c[_0xef8a('0x17')][_0xef8a('0x18')]||null:null,'attributes':_0x1f082c[_0xef8a('0x17')]?_0x1f082c[_0xef8a('0x17')][_0xef8a('0x1d')]||null:null,'limit':_0x1f082c[_0xef8a('0x17')]?_0x1f082c['options'][_0xef8a('0x19')]||null:null})[_0xef8a('0xa')](function(_0xe67db8){logger['info'](_0xef8a('0x25'),_0x1f082c);logger[_0xef8a('0x11')](_0xef8a('0x26'),JSON[_0xef8a('0xe')](_0x1f082c[_0xef8a('0x17')][_0xef8a('0x18')]),_0x1f082c[_0xef8a('0x23')][_0xef8a('0x27')]);logger['debug'](_0xef8a('0x25'),_0x1f082c,JSON[_0xef8a('0xe')](_0xe67db8));_0x4b128c(_0xe67db8);})['catch'](function(_0x6a5481){logger['error'](_0xef8a('0x25'),_0x6a5481[_0xef8a('0x10')],_0x1f082c);_0x58456a(_0x3d3858[_0xef8a('0xf')](0x1f4,_0x6a5481[_0xef8a('0x10')]));});});};exports[_0xef8a('0x28')]=function(_0x4b2603){var _0x227dc7=this;return new Promise(function(_0x4e70b6,_0x1eec07){return db[_0xef8a('0x15')][_0xef8a('0x29')]({'where':_0x4b2603[_0xef8a('0x17')]?_0x4b2603['options'][_0xef8a('0x18')]||null:null})[_0xef8a('0xa')](function(_0x19c774){logger[_0xef8a('0x11')](_0xef8a('0x28'),_0x4b2603);logger['debug']('DestroyCmHopper',_0x4b2603,JSON[_0xef8a('0xe')](_0x19c774));_0x4e70b6(_0x19c774);})[_0xef8a('0x13')](function(_0x5b0ecb){logger[_0xef8a('0xf')]('DestroyCmHopper',_0x5b0ecb['message'],_0x4b2603);_0x1eec07(_0x227dc7[_0xef8a('0xf')](0x1f4,_0x5b0ecb[_0xef8a('0x10')]));});});};exports[_0xef8a('0x2a')]=function(_0x3f7870){var _0x1a6bf2=this;return new Promise(function(_0x222622,_0x3c475c){return db[_0xef8a('0x2b')][_0xef8a('0x2c')]()[_0xef8a('0xa')](function(_0x21dec5){return db[_0xef8a('0x2d')][_0xef8a('0x2e')](function(_0x267bed){return db[_0xef8a('0x15')][_0xef8a('0x16')]({'where':_0x3f7870['options']?_0x3f7870[_0xef8a('0x17')][_0xef8a('0x18')]||null:null,'attributes':_0x3f7870['options']?_0x3f7870['options']['attributes']||null:null,'limit':_0x3f7870['options']?_0x3f7870[_0xef8a('0x17')][_0xef8a('0x19')]||null:null,'order':_0x3f7870['options']?_0x3f7870['options'][_0xef8a('0x2f')]||null:null,'transaction':_0x267bed,'lock':_0x267bed[_0xef8a('0x30')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_['keys'](_0x21dec5)},{'model':db[_0xef8a('0x31')],'as':_0xef8a('0x32'),'attributes':['id',_0xef8a('0x33'),_0xef8a('0x34')]}]})[_0xef8a('0xa')](function(_0x52e35b){var _0x2561d5=[];var _0x2b7383=[];for(var _0x1f6b89=0x0;_0x1f6b89<_0x52e35b['length'];_0x1f6b89+=0x1){var _0x13c108=_0x52e35b[_0x1f6b89][_0xef8a('0x35')];if(_0x13c108===null){_0x2561d5[_0xef8a('0x36')](_0x52e35b[_0x1f6b89][_0xef8a('0x24')](_0x3f7870[_0xef8a('0x23')],{'transaction':_0x267bed}));}else if(!_0x2b7383['includes'](_0x13c108)){_0x2b7383[_0xef8a('0x36')](_0x13c108);_0x2561d5[_0xef8a('0x36')](_0x52e35b[_0x1f6b89][_0xef8a('0x24')](_0x3f7870[_0xef8a('0x23')],{'transaction':_0x267bed}));}}return BPromise[_0xef8a('0x37')](_0x2561d5);});})[_0xef8a('0xa')](function(_0x309d6a){logger[_0xef8a('0x11')](_0xef8a('0x2a'),_0x3f7870);if(_0x309d6a[_0xef8a('0x38')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x309d6a[0x0]['dataValues']['id'],_0x309d6a[0x0][_0xef8a('0x39')]['ContactId'],_0x309d6a[0x0][_0xef8a('0x39')]['active']);}logger[_0xef8a('0xd')](_0xef8a('0x2a'),_0x3f7870,JSON[_0xef8a('0xe')](_0x309d6a));_0x222622(_0x309d6a);})[_0xef8a('0x13')](function(_0x4c90f5){logger[_0xef8a('0xf')]('GetContactDialer',_0x4c90f5[_0xef8a('0x10')],_0x3f7870);_0x3c475c(_0x1a6bf2[_0xef8a('0xf')](0x1f4,_0x4c90f5['message']));});});});};exports[_0xef8a('0x3a')]=function(_0x544220){var _0x3a81b9=this;return new Promise(function(_0x459c02,_0x346d27){return db[_0xef8a('0x2d')][_0xef8a('0x2e')](function(_0x3fb187){return db[_0xef8a('0x3b')][_0xef8a('0x22')](_0x544220[_0xef8a('0x23')],{'raw':_0x544220[_0xef8a('0x17')]?_0x544220['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x3fb187})[_0xef8a('0xa')](function(){logger[_0xef8a('0x11')](_0xef8a('0x3c'),JSON['stringify'](_0x544220[_0xef8a('0x17')]['where']),_0x544220[_0xef8a('0x17')][_0xef8a('0x18')][_0xef8a('0x27')]);return db[_0xef8a('0x15')][_0xef8a('0x29')]({'where':_0x544220['options']?_0x544220['options']['where']||null:null,'transaction':_0x3fb187});});})[_0xef8a('0xa')](function(_0x559015){logger['info'](_0xef8a('0x3a'),_0x544220);logger[_0xef8a('0xd')]('MoveContactManagedDialer',_0x544220,JSON[_0xef8a('0xe')](_0x559015));_0x459c02(_0x559015);})[_0xef8a('0x13')](function(_0x2f3eb5){logger[_0xef8a('0xf')](_0xef8a('0x3a'),_0x2f3eb5[_0xef8a('0x10')],_0x544220);_0x346d27(_0x3a81b9[_0xef8a('0xf')](0x1f4,_0x2f3eb5[_0xef8a('0x10')]));});});};exports[_0xef8a('0x3d')]=function(_0xe3bb6f){var _0x2286d0=this;return new Promise(function(_0x562d87,_0x510559){return db[_0xef8a('0x15')][_0xef8a('0x16')]({'raw':_0xe3bb6f[_0xef8a('0x17')]?_0xe3bb6f[_0xef8a('0x17')][_0xef8a('0x20')]===undefined?!![]:![]:!![],'where':_0xe3bb6f['options']?_0xe3bb6f['options'][_0xef8a('0x18')]||null:null,'attributes':[[db[_0xef8a('0x2d')]['fn'](_0xef8a('0x3e'),db[_0xef8a('0x2d')]['fn']('IF',db[_0xef8a('0x2d')]['literal'](_0xef8a('0x3f')+util[_0xef8a('0x40')]('\x22%s\x22',moment()['format'](_0xef8a('0x41')))+_0xef8a('0x42')))),_0xef8a('0x43')]]})[_0xef8a('0xa')](function(_0x1c505a){logger[_0xef8a('0x11')](_0xef8a('0x3d'),_0xe3bb6f);logger['debug'](_0xef8a('0x3d'),_0xe3bb6f,JSON[_0xef8a('0xe')](_0x1c505a));_0x562d87(_0x1c505a);})[_0xef8a('0x13')](function(_0x11a81e){logger[_0xef8a('0xf')](_0xef8a('0x3d'),_0x11a81e[_0xef8a('0x10')],_0xe3bb6f);_0x510559(_0x2286d0['error'](0x1f4,_0x11a81e[_0xef8a('0x10')]));});});};exports[_0xef8a('0x44')]=function(_0x1e8a0d){var _0x2cfa65=this;return new Promise(function(_0x2b64ba,_0x29a343){return db['CmContact'][_0xef8a('0x2c')]()[_0xef8a('0xa')](function(_0x1d9b6e){return db[_0xef8a('0x2d')][_0xef8a('0x2e')](function(_0xcc7005){return db[_0xef8a('0x15')]['findAll']({'where':_0x1e8a0d[_0xef8a('0x17')]?_0x1e8a0d[_0xef8a('0x17')][_0xef8a('0x18')]||null:null,'attributes':_0x1e8a0d[_0xef8a('0x17')]?_0x1e8a0d[_0xef8a('0x17')][_0xef8a('0x1d')]||null:null,'limit':0x1,'order':_0x1e8a0d[_0xef8a('0x17')]?_0x1e8a0d[_0xef8a('0x17')][_0xef8a('0x2f')]||null:null,'group':db[_0xef8a('0x15')][_0xef8a('0x35')],'transaction':_0xcc7005,'lock':_0xcc7005[_0xef8a('0x30')][_0xef8a('0x45')],'include':_0x1e8a0d['options']?_0x1e8a0d[_0xef8a('0x17')]['include']?_[_0xef8a('0x1b')](_0x1e8a0d[_0xef8a('0x17')][_0xef8a('0x1a')],function(_0x19d72e){return{'model':db[_0x19d72e[_0xef8a('0x1c')]],'as':_0x19d72e['as'],'attributes':_0x19d72e[_0xef8a('0x1d')],'include':_0x19d72e['include']?_[_0xef8a('0x1b')](_0x19d72e[_0xef8a('0x1a')],function(_0xb8b278){return{'model':db[_0xb8b278[_0xef8a('0x1c')]],'as':_0xb8b278['as'],'attributes':_0xb8b278['attributes'],'include':_0xb8b278[_0xef8a('0x1a')]?_[_0xef8a('0x1b')](_0xb8b278[_0xef8a('0x1a')],function(_0x578d46){return{'model':db[_0x578d46[_0xef8a('0x1c')]],'as':_0x578d46['as'],'attributes':_0x578d46[_0xef8a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef8a('0xa')](function(_0x1e24ac){var _0x4ff50a=[];for(var _0x20127d=0x0;_0x20127d<_0x1e24ac['length'];_0x20127d+=0x1){_0x4ff50a['push'](_0x1e24ac[_0x20127d]['update'](_0x1e8a0d[_0xef8a('0x23')],{'transaction':_0xcc7005}));}return BPromise[_0xef8a('0x37')](_0x4ff50a);});})[_0xef8a('0xa')](function(_0x4f88bf){logger[_0xef8a('0x11')](_0xef8a('0x44'),_0x1e8a0d);logger[_0xef8a('0xd')](_0xef8a('0x44'),_0x1e8a0d,JSON[_0xef8a('0xe')](_0x4f88bf));_0x2b64ba(_0x4f88bf);})[_0xef8a('0x13')](function(_0x4e65ec){logger[_0xef8a('0xf')](_0xef8a('0x44'),_0x4e65ec[_0xef8a('0x10')],_0x1e8a0d);_0x29a343(_0x2cfa65[_0xef8a('0xf')](0x1f4,_0x4e65ec[_0xef8a('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x30e66b){var _0x1acc2c=this;return new Promise(function(_0x2b1088,_0xc90c96){db[_0xef8a('0x2b')]['describe']()[_0xef8a('0xa')](function(_0xb8dbb6){return db['CmHopper'][_0xef8a('0x16')]({'raw':_0x30e66b[_0xef8a('0x17')]?_0x30e66b['options'][_0xef8a('0x20')]===undefined?!![]:![]:!![],'where':_0x30e66b['options']?_0x30e66b[_0xef8a('0x17')][_0xef8a('0x18')]||null:null,'attributes':_0x30e66b['options']?_0x30e66b[_0xef8a('0x17')][_0xef8a('0x1d')]||null:null,'limit':_0x30e66b[_0xef8a('0x17')]?_0x30e66b[_0xef8a('0x17')][_0xef8a('0x19')]||null:null,'include':_0x30e66b[_0xef8a('0x17')]?_0x30e66b[_0xef8a('0x17')][_0xef8a('0x1a')]?_[_0xef8a('0x1b')](_0x30e66b[_0xef8a('0x17')][_0xef8a('0x1a')],function(_0x37e358){return{'model':db[_0x37e358[_0xef8a('0x1c')]],'as':_0x37e358['as'],'attributes':_0x37e358['as']===_0xef8a('0x46')?_[_0xef8a('0x47')](_0xb8dbb6):_0x37e358[_0xef8a('0x1d')],'include':_0x37e358[_0xef8a('0x1a')]?_[_0xef8a('0x1b')](_0x37e358['include'],function(_0xfeb162){return{'model':db[_0xfeb162[_0xef8a('0x1c')]],'as':_0xfeb162['as'],'attributes':_0xfeb162[_0xef8a('0x1d')],'include':_0xfeb162['include']?_[_0xef8a('0x1b')](_0xfeb162[_0xef8a('0x1a')],function(_0x2cf20a){return{'model':db[_0x2cf20a[_0xef8a('0x1c')]],'as':_0x2cf20a['as'],'attributes':_0x2cf20a[_0xef8a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef8a('0xa')](function(_0x8b19aa){logger['info']('GetCmHopper',_0x30e66b);logger[_0xef8a('0xd')](_0xef8a('0x14'),_0x30e66b,JSON['stringify'](_0x8b19aa));_0x2b1088(_0x8b19aa);})[_0xef8a('0x13')](function(_0x1e9576){logger[_0xef8a('0xf')](_0xef8a('0x14'),_0x1e9576[_0xef8a('0x10')],_0x30e66b);_0xc90c96(_0x1acc2c[_0xef8a('0xf')](0x1f4,_0x1e9576[_0xef8a('0x10')]));});});});};exports[_0xef8a('0x48')]=function(_0x30e3f6){var _0x4b29c5=this;return new Promise(function(_0x5e7949,_0x3e8589){return db[_0xef8a('0x2b')][_0xef8a('0x49')]({'raw':!![],'where':{'phone':_0x30e3f6['options'][_0xef8a('0x18')][_0xef8a('0x4a')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0xef8a('0xa')](function(_0x548cd5){logger['info'](_0xef8a('0x4b'),_0x30e3f6);logger[_0xef8a('0xd')](_0xef8a('0x4b'),_0x30e3f6,JSON[_0xef8a('0xe')](_0x548cd5));_0x5e7949(_0x548cd5);})[_0xef8a('0x13')](function(_0x3c2fd6){logger[_0xef8a('0xf')]('getContactByPhone',_0x3c2fd6['message'],_0x30e3f6);_0x3e8589(_0x4b29c5['error'](0x1f4,_0x3c2fd6[_0xef8a('0x10')]));});});};exports[_0xef8a('0x4c')]=function(_0x3b422c){var _0x430401=this;return new Promise(function(_0xc8a3c7,_0xba3d4c){return db[_0xef8a('0x2d')][_0xef8a('0x2e')](function(_0x3688ff){return db['CmHopper'][_0xef8a('0x24')](_0x3b422c[_0xef8a('0x23')],{'where':{},'transaction':_0x3688ff})[_0xef8a('0xa')](function(_0xeb5ae5){logger[_0xef8a('0x11')](_0xef8a('0x4c'),_0x3b422c);logger['debug']('ResetActiveCalls',_0x3b422c,JSON['stringify'](_0xeb5ae5));_0xc8a3c7(_0xeb5ae5);})[_0xef8a('0x13')](function(_0xc12f26){logger[_0xef8a('0xf')]('ResetActiveCalls',_0xc12f26['message'],_0x3b422c);_0xba3d4c(_0x430401[_0xef8a('0xf')](0x1f4,_0xc12f26[_0xef8a('0x10')]));});});});};exports[_0xef8a('0x4d')]=function(_0x415f07){var _0x1e4ee1=this;var _0x18a935=_0x415f07[_0xef8a('0x23')][_0xef8a('0x18')][_0xef8a('0x4e')];var _0x201ffe=_0x415f07[_0xef8a('0x23')][_0xef8a('0x18')][_0xef8a('0x4f')];var _0x3a07e1=_0x415f07[_0xef8a('0x23')][_0xef8a('0x18')][_0xef8a('0x50')];return new Promise(function(_0x44fd06,_0x20aea7){return db[_0xef8a('0x15')][_0xef8a('0x16')]({'where':{'voiceQueueId':{'$in':_0x18a935},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xef8a('0x2d')][_0xef8a('0x51')](_0xef8a('0x52')+_0x201ffe+_0xef8a('0x53')),'$gt':db[_0xef8a('0x2d')][_0xef8a('0x51')](_0xef8a('0x54'))}},'UserId':{'$in':_0x3a07e1}},'include':[{'model':db['CmContact'],'as':_0xef8a('0x46')},{'model':db[_0xef8a('0x31')],'as':_0xef8a('0x32'),'attributes':['id',_0xef8a('0x33'),_0xef8a('0x34')]},{'model':db[_0xef8a('0x55')],'as':_0xef8a('0x56')}]})['then'](function(_0x430656){if(_0x430656[_0xef8a('0x38')]>0x0){return db[_0xef8a('0x2d')][_0xef8a('0x2e')](function(_0x543d67){return db[_0xef8a('0x15')][_0xef8a('0x24')]({'recallmeNotifiedDate':db[_0xef8a('0x2d')][_0xef8a('0x51')](_0xef8a('0x54'))},{'where':{'id':{'$in':_[_0xef8a('0x1b')](_0x430656,'id')}},'transaction':_0x543d67})[_0xef8a('0xa')](function(){_0x44fd06(_0x430656);})[_0xef8a('0x13')](function(_0x19b3f4){logger['error'](_0xef8a('0x4d'),_0x19b3f4[_0xef8a('0x10')],_0x415f07);_0x20aea7(_0x1e4ee1[_0xef8a('0xf')](0x1f4,_0x19b3f4[_0xef8a('0x10')]));});})[_0xef8a('0x13')](function(_0x5bd580){logger['error'](_0xef8a('0x4d'),_0x5bd580['message'],_0x415f07);_0x20aea7(_0x1e4ee1[_0xef8a('0xf')](0x1f4,_0x5bd580[_0xef8a('0x10')]));});}else{_0x44fd06(_0x430656);}});});}; \ No newline at end of file +var _0xc819=['Agent','name','voicePause','UserId','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','options','raw','where','attributes','map','include','model','debug','catch','ShowCmHopper','body','CreateCmHopper','update','limit','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','keys'];(function(_0x48c9a9,_0x59c488){var _0xada59a=function(_0x48bc3e){while(--_0x48bc3e){_0x48c9a9['push'](_0x48c9a9['shift']());}};_0xada59a(++_0x59c488);}(_0xc819,0xcd));var _0x9c81=function(_0x1629a2,_0x177b1b){_0x1629a2=_0x1629a2-0x0;var _0x3cdcfc=_0xc819[_0x1629a2];return _0x3cdcfc;};'use strict';var _=require(_0x9c81('0x0'));var util=require(_0x9c81('0x1'));var moment=require(_0x9c81('0x2'));var BPromise=require(_0x9c81('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x9c81('0x4'))(_0x9c81('0x5'));var jayson=require(_0x9c81('0x6'));var client=jayson[_0x9c81('0x7')][_0x9c81('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x569c76,_0x3c87e0,_0x578c44){return new BPromise(function(_0x523496,_0x5bc9d4){return client[_0x9c81('0x9')](_0x569c76,_0x578c44)[_0x9c81('0xa')](function(_0x243552){logger[_0x9c81('0xb')](_0x9c81('0xc'),_0x3c87e0,_0x9c81('0xd'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x3c87e0,_0x9c81('0xd'),JSON[_0x9c81('0xe')](_0x243552));if(_0x243552[_0x9c81('0xf')]){if(_0x243552[_0x9c81('0xf')]['code']===0x1f4){logger[_0x9c81('0xf')](_0x9c81('0xc'),_0x3c87e0,_0x243552['error'][_0x9c81('0x10')]);return _0x5bc9d4(_0x243552[_0x9c81('0xf')][_0x9c81('0x10')]);}logger['error'](_0x9c81('0xc'),_0x3c87e0,_0x243552[_0x9c81('0xf')]['message']);return _0x523496(_0x243552[_0x9c81('0xf')][_0x9c81('0x10')]);}else{logger[_0x9c81('0xb')](_0x9c81('0xc'),_0x3c87e0,_0x9c81('0xd'));_0x523496(_0x243552[_0x9c81('0x11')][_0x9c81('0x10')]);}})['catch'](function(_0x1d0988){logger['error'](_0x9c81('0xc'),_0x3c87e0,_0x1d0988);_0x5bc9d4(_0x1d0988);});});}exports[_0x9c81('0x12')]=function(_0x5e4884){var _0x48b8a1=this;return new Promise(function(_0x5516b3,_0x363bc2){return db[_0x9c81('0x13')]['findAll']({'raw':_0x5e4884[_0x9c81('0x14')]?_0x5e4884[_0x9c81('0x14')][_0x9c81('0x15')]===undefined?!![]:![]:!![],'where':_0x5e4884['options']?_0x5e4884[_0x9c81('0x14')][_0x9c81('0x16')]||null:null,'attributes':_0x5e4884[_0x9c81('0x14')]?_0x5e4884[_0x9c81('0x14')][_0x9c81('0x17')]||null:null,'limit':_0x5e4884[_0x9c81('0x14')]?_0x5e4884[_0x9c81('0x14')]['limit']||null:null,'include':_0x5e4884[_0x9c81('0x14')]?_0x5e4884['options']['include']?_[_0x9c81('0x18')](_0x5e4884[_0x9c81('0x14')][_0x9c81('0x19')],function(_0x4fb195){return{'model':db[_0x4fb195[_0x9c81('0x1a')]],'as':_0x4fb195['as'],'attributes':_0x4fb195[_0x9c81('0x17')],'include':_0x4fb195[_0x9c81('0x19')]?_[_0x9c81('0x18')](_0x4fb195['include'],function(_0x83134c){return{'model':db[_0x83134c[_0x9c81('0x1a')]],'as':_0x83134c['as'],'attributes':_0x83134c[_0x9c81('0x17')],'include':_0x83134c['include']?_[_0x9c81('0x18')](_0x83134c[_0x9c81('0x19')],function(_0x26db1f){return{'model':db[_0x26db1f[_0x9c81('0x1a')]],'as':_0x26db1f['as'],'attributes':_0x26db1f[_0x9c81('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9c81('0xa')](function(_0x1d2c4){logger[_0x9c81('0xb')](_0x9c81('0x12'),_0x5e4884);logger[_0x9c81('0x1b')](_0x9c81('0x12'),_0x5e4884,JSON[_0x9c81('0xe')](_0x1d2c4));_0x5516b3(_0x1d2c4);})[_0x9c81('0x1c')](function(_0x55d7f0){logger[_0x9c81('0xf')]('GetCmHopper',_0x55d7f0['message'],_0x5e4884);_0x363bc2(_0x48b8a1[_0x9c81('0xf')](0x1f4,_0x55d7f0[_0x9c81('0x10')]));});});};exports['ShowCmHopper']=function(_0x2f3f4f){var _0x2d5541=this;return new Promise(function(_0x2ce1c4,_0x4712cd){return db[_0x9c81('0x13')]['find']({'raw':_0x2f3f4f[_0x9c81('0x14')]?_0x2f3f4f['options'][_0x9c81('0x15')]===undefined?!![]:![]:!![],'where':_0x2f3f4f[_0x9c81('0x14')]?_0x2f3f4f[_0x9c81('0x14')][_0x9c81('0x16')]||null:null,'attributes':_0x2f3f4f[_0x9c81('0x14')]?_0x2f3f4f[_0x9c81('0x14')][_0x9c81('0x17')]||null:null,'include':_0x2f3f4f['options']?_0x2f3f4f[_0x9c81('0x14')]['include']?_[_0x9c81('0x18')](_0x2f3f4f[_0x9c81('0x14')][_0x9c81('0x19')],function(_0x4ec41f){return{'model':db[_0x4ec41f[_0x9c81('0x1a')]],'as':_0x4ec41f['as'],'attributes':_0x4ec41f[_0x9c81('0x17')],'include':_0x4ec41f['include']?_[_0x9c81('0x18')](_0x4ec41f[_0x9c81('0x19')],function(_0x23a18b){return{'model':db[_0x23a18b[_0x9c81('0x1a')]],'as':_0x23a18b['as'],'attributes':_0x23a18b[_0x9c81('0x17')],'include':_0x23a18b[_0x9c81('0x19')]?_[_0x9c81('0x18')](_0x23a18b[_0x9c81('0x19')],function(_0x2aa057){return{'model':db[_0x2aa057[_0x9c81('0x1a')]],'as':_0x2aa057['as'],'attributes':_0x2aa057['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c81('0xa')](function(_0x1c13cc){logger[_0x9c81('0xb')](_0x9c81('0x1d'),_0x2f3f4f);logger[_0x9c81('0x1b')](_0x9c81('0x1d'),_0x2f3f4f,JSON[_0x9c81('0xe')](_0x1c13cc));_0x2ce1c4(_0x1c13cc);})['catch'](function(_0x552c6b){logger[_0x9c81('0xf')](_0x9c81('0x1d'),_0x552c6b[_0x9c81('0x10')],_0x2f3f4f);_0x4712cd(_0x2d5541[_0x9c81('0xf')](0x1f4,_0x552c6b['message']));});});};exports['CreateCmHopper']=function(_0x2f2d99){var _0x11797e=this;return new Promise(function(_0x4979c7,_0x44d94f){return db[_0x9c81('0x13')]['create'](_0x2f2d99[_0x9c81('0x1e')],{'raw':_0x2f2d99[_0x9c81('0x14')]?_0x2f2d99[_0x9c81('0x14')][_0x9c81('0x15')]===undefined?!![]:![]:!![]})[_0x9c81('0xa')](function(_0xd38624){logger[_0x9c81('0xb')](_0x9c81('0x1f'),_0x2f2d99);logger[_0x9c81('0x1b')]('CreateCmHopper',_0x2f2d99,JSON[_0x9c81('0xe')](_0xd38624));_0x4979c7(_0xd38624);})[_0x9c81('0x1c')](function(_0x4b92ed){logger[_0x9c81('0xf')]('CreateCmHopper',_0x4b92ed[_0x9c81('0x10')],_0x2f2d99);_0x44d94f(_0x11797e[_0x9c81('0xf')](0x1f4,_0x4b92ed[_0x9c81('0x10')]));});});};exports['UpdateCmHopper']=function(_0x212437){var _0x28c831=this;return new Promise(function(_0x2de412,_0x150a5c){return db['CmHopper'][_0x9c81('0x20')](_0x212437['body'],{'raw':_0x212437[_0x9c81('0x14')]?_0x212437[_0x9c81('0x14')][_0x9c81('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212437[_0x9c81('0x14')]?_0x212437['options'][_0x9c81('0x16')]||null:null,'attributes':_0x212437[_0x9c81('0x14')]?_0x212437[_0x9c81('0x14')]['attributes']||null:null,'limit':_0x212437[_0x9c81('0x14')]?_0x212437['options'][_0x9c81('0x21')]||null:null})[_0x9c81('0xa')](function(_0x38f0f0){logger['info'](_0x9c81('0x22'),_0x212437);logger[_0x9c81('0xb')](_0x9c81('0x23'),JSON['stringify'](_0x212437[_0x9c81('0x14')]['where']),_0x212437[_0x9c81('0x1e')][_0x9c81('0x24')]);logger['debug']('UpdateCmHopper',_0x212437,JSON['stringify'](_0x38f0f0));_0x2de412(_0x38f0f0);})[_0x9c81('0x1c')](function(_0xb8af28){logger[_0x9c81('0xf')](_0x9c81('0x22'),_0xb8af28[_0x9c81('0x10')],_0x212437);_0x150a5c(_0x28c831[_0x9c81('0xf')](0x1f4,_0xb8af28['message']));});});};exports[_0x9c81('0x25')]=function(_0x54600b){var _0x35aff1=this;return new Promise(function(_0xc36a03,_0x2937f3){return db[_0x9c81('0x13')][_0x9c81('0x26')]({'where':_0x54600b['options']?_0x54600b[_0x9c81('0x14')][_0x9c81('0x16')]||null:null})[_0x9c81('0xa')](function(_0x360e9b){logger[_0x9c81('0xb')](_0x9c81('0x25'),_0x54600b);logger[_0x9c81('0x1b')](_0x9c81('0x25'),_0x54600b,JSON[_0x9c81('0xe')](_0x360e9b));_0xc36a03(_0x360e9b);})['catch'](function(_0x5cf35e){logger['error'](_0x9c81('0x25'),_0x5cf35e[_0x9c81('0x10')],_0x54600b);_0x2937f3(_0x35aff1['error'](0x1f4,_0x5cf35e[_0x9c81('0x10')]));});});};exports[_0x9c81('0x27')]=function(_0x52883d){var _0x53a29a=this;return new Promise(function(_0xbda4bf,_0x47ead2){return db[_0x9c81('0x28')][_0x9c81('0x29')]()[_0x9c81('0xa')](function(_0x2b860a){return db[_0x9c81('0x2a')][_0x9c81('0x2b')](function(_0x35847f){return db[_0x9c81('0x13')][_0x9c81('0x2c')]({'where':_0x52883d[_0x9c81('0x14')]?_0x52883d[_0x9c81('0x14')][_0x9c81('0x16')]||null:null,'attributes':_0x52883d[_0x9c81('0x14')]?_0x52883d[_0x9c81('0x14')][_0x9c81('0x17')]||null:null,'limit':_0x52883d[_0x9c81('0x14')]?_0x52883d[_0x9c81('0x14')][_0x9c81('0x21')]||null:null,'order':_0x52883d[_0x9c81('0x14')]?_0x52883d[_0x9c81('0x14')][_0x9c81('0x2d')]||null:null,'transaction':_0x35847f,'lock':_0x35847f[_0x9c81('0x2e')][_0x9c81('0x2f')],'include':[{'model':db['CmContact'],'as':_0x9c81('0x30'),'attributes':_[_0x9c81('0x31')](_0x2b860a)},{'model':db['User'],'as':_0x9c81('0x32'),'attributes':['id',_0x9c81('0x33'),_0x9c81('0x34')]}]})[_0x9c81('0xa')](function(_0x297de4){var _0x5da89d=[];var _0x34225b=[];for(var _0x3e5e55=0x0;_0x3e5e55<_0x297de4['length'];_0x3e5e55+=0x1){var _0x5c9d4a=_0x297de4[_0x3e5e55][_0x9c81('0x35')];if(_0x5c9d4a===null){_0x5da89d[_0x9c81('0x36')](_0x297de4[_0x3e5e55][_0x9c81('0x20')](_0x52883d[_0x9c81('0x1e')],{'transaction':_0x35847f}));}else if(!_0x34225b['includes'](_0x5c9d4a)){_0x34225b[_0x9c81('0x36')](_0x5c9d4a);_0x5da89d[_0x9c81('0x36')](_0x297de4[_0x3e5e55][_0x9c81('0x20')](_0x52883d[_0x9c81('0x1e')],{'transaction':_0x35847f}));}}return BPromise[_0x9c81('0x37')](_0x5da89d);});})['then'](function(_0x28e9ea){logger[_0x9c81('0xb')](_0x9c81('0x27'),_0x52883d);if(_0x28e9ea[_0x9c81('0x38')]>0x0){logger[_0x9c81('0xb')](_0x9c81('0x39'),_0x28e9ea[0x0][_0x9c81('0x3a')]['id'],_0x28e9ea[0x0]['dataValues'][_0x9c81('0x3b')],_0x28e9ea[0x0][_0x9c81('0x3a')][_0x9c81('0x24')]);}logger['debug'](_0x9c81('0x27'),_0x52883d,JSON[_0x9c81('0xe')](_0x28e9ea));_0xbda4bf(_0x28e9ea);})[_0x9c81('0x1c')](function(_0x377798){logger['error'](_0x9c81('0x27'),_0x377798[_0x9c81('0x10')],_0x52883d);_0x47ead2(_0x53a29a['error'](0x1f4,_0x377798[_0x9c81('0x10')]));});});});};exports[_0x9c81('0x3c')]=function(_0x231bd3){var _0x479383=this;return new Promise(function(_0x4ea774,_0x3c7e9f){return db[_0x9c81('0x2a')][_0x9c81('0x2b')](function(_0x10be26){return db['CmHopperFinal'][_0x9c81('0x3d')](_0x231bd3[_0x9c81('0x1e')],{'raw':_0x231bd3[_0x9c81('0x14')]?_0x231bd3[_0x9c81('0x14')][_0x9c81('0x15')]===undefined?!![]:![]:!![],'transaction':_0x10be26})['then'](function(){logger['info'](_0x9c81('0x3e'),JSON[_0x9c81('0xe')](_0x231bd3[_0x9c81('0x14')][_0x9c81('0x16')]),_0x231bd3['options'][_0x9c81('0x16')][_0x9c81('0x24')]);return db[_0x9c81('0x13')]['destroy']({'where':_0x231bd3['options']?_0x231bd3['options']['where']||null:null,'transaction':_0x10be26});});})[_0x9c81('0xa')](function(_0x1a72e0){logger[_0x9c81('0xb')]('MoveContactManagedDialer',_0x231bd3);logger['debug'](_0x9c81('0x3c'),_0x231bd3,JSON[_0x9c81('0xe')](_0x1a72e0));_0x4ea774(_0x1a72e0);})[_0x9c81('0x1c')](function(_0x4f3f6f){logger[_0x9c81('0xf')](_0x9c81('0x3c'),_0x4f3f6f[_0x9c81('0x10')],_0x231bd3);_0x3c7e9f(_0x479383['error'](0x1f4,_0x4f3f6f[_0x9c81('0x10')]));});});};exports[_0x9c81('0x3f')]=function(_0xbd093c){var _0x547caa=this;return new Promise(function(_0x53264b,_0x2dac73){return db[_0x9c81('0x13')][_0x9c81('0x2c')]({'raw':_0xbd093c['options']?_0xbd093c[_0x9c81('0x14')][_0x9c81('0x15')]===undefined?!![]:![]:!![],'where':_0xbd093c[_0x9c81('0x14')]?_0xbd093c[_0x9c81('0x14')][_0x9c81('0x16')]||null:null,'attributes':[[db[_0x9c81('0x2a')]['fn'](_0x9c81('0x40'),db[_0x9c81('0x2a')]['fn']('IF',db[_0x9c81('0x2a')][_0x9c81('0x41')]('`scheduledat`\x20>=\x20'+util[_0x9c81('0x42')](_0x9c81('0x43'),moment()[_0x9c81('0x42')](_0x9c81('0x44')))+_0x9c81('0x45')))),'contactsRescheduled']]})[_0x9c81('0xa')](function(_0x3d61cc){logger[_0x9c81('0xb')](_0x9c81('0x3f'),_0xbd093c);logger[_0x9c81('0x1b')]('CountReScheduled',_0xbd093c,JSON[_0x9c81('0xe')](_0x3d61cc));_0x53264b(_0x3d61cc);})[_0x9c81('0x1c')](function(_0x5754a6){logger[_0x9c81('0xf')]('CountReScheduled',_0x5754a6[_0x9c81('0x10')],_0xbd093c);_0x2dac73(_0x547caa[_0x9c81('0xf')](0x1f4,_0x5754a6['message']));});});};exports['GetContactRecallMe']=function(_0x4f7bb4){var _0x32d821=this;return new Promise(function(_0x297467,_0x46361a){return db[_0x9c81('0x28')][_0x9c81('0x29')]()[_0x9c81('0xa')](function(_0x3ca844){return db[_0x9c81('0x2a')][_0x9c81('0x2b')](function(_0x4d4092){return db[_0x9c81('0x13')][_0x9c81('0x2c')]({'where':_0x4f7bb4[_0x9c81('0x14')]?_0x4f7bb4[_0x9c81('0x14')]['where']||null:null,'attributes':_0x4f7bb4['options']?_0x4f7bb4[_0x9c81('0x14')]['attributes']||null:null,'limit':0x1,'order':_0x4f7bb4[_0x9c81('0x14')]?_0x4f7bb4[_0x9c81('0x14')][_0x9c81('0x2d')]||null:null,'group':db[_0x9c81('0x13')][_0x9c81('0x35')],'transaction':_0x4d4092,'lock':_0x4d4092[_0x9c81('0x2e')][_0x9c81('0x2f')],'include':_0x4f7bb4['options']?_0x4f7bb4[_0x9c81('0x14')][_0x9c81('0x19')]?_['map'](_0x4f7bb4['options'][_0x9c81('0x19')],function(_0x51bd2a){return{'model':db[_0x51bd2a[_0x9c81('0x1a')]],'as':_0x51bd2a['as'],'attributes':_0x51bd2a[_0x9c81('0x17')],'include':_0x51bd2a[_0x9c81('0x19')]?_[_0x9c81('0x18')](_0x51bd2a[_0x9c81('0x19')],function(_0x2e07dc){return{'model':db[_0x2e07dc['model']],'as':_0x2e07dc['as'],'attributes':_0x2e07dc[_0x9c81('0x17')],'include':_0x2e07dc[_0x9c81('0x19')]?_[_0x9c81('0x18')](_0x2e07dc['include'],function(_0x3a2ed2){return{'model':db[_0x3a2ed2[_0x9c81('0x1a')]],'as':_0x3a2ed2['as'],'attributes':_0x3a2ed2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x240ba6){var _0x16cc88=[];for(var _0x3f35b3=0x0;_0x3f35b3<_0x240ba6[_0x9c81('0x38')];_0x3f35b3+=0x1){_0x16cc88['push'](_0x240ba6[_0x3f35b3]['update'](_0x4f7bb4[_0x9c81('0x1e')],{'transaction':_0x4d4092}));}return BPromise['all'](_0x16cc88);});})['then'](function(_0x820221){logger[_0x9c81('0xb')]('GetContactRecallMe',_0x4f7bb4);logger[_0x9c81('0x1b')](_0x9c81('0x46'),_0x4f7bb4,JSON['stringify'](_0x820221));_0x297467(_0x820221);})[_0x9c81('0x1c')](function(_0x2ee650){logger[_0x9c81('0xf')]('GetContactRecallMe',_0x2ee650[_0x9c81('0x10')],_0x4f7bb4);_0x46361a(_0x32d821[_0x9c81('0xf')](0x1f4,_0x2ee650[_0x9c81('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x3c9aec){var _0x5d36ad=this;return new Promise(function(_0x1ed5e8,_0x383e89){db[_0x9c81('0x28')]['describe']()[_0x9c81('0xa')](function(_0x32e7df){return db[_0x9c81('0x13')][_0x9c81('0x2c')]({'raw':_0x3c9aec[_0x9c81('0x14')]?_0x3c9aec['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c9aec[_0x9c81('0x14')]?_0x3c9aec[_0x9c81('0x14')]['where']||null:null,'attributes':_0x3c9aec[_0x9c81('0x14')]?_0x3c9aec[_0x9c81('0x14')][_0x9c81('0x17')]||null:null,'limit':_0x3c9aec[_0x9c81('0x14')]?_0x3c9aec[_0x9c81('0x14')][_0x9c81('0x21')]||null:null,'include':_0x3c9aec[_0x9c81('0x14')]?_0x3c9aec[_0x9c81('0x14')][_0x9c81('0x19')]?_[_0x9c81('0x18')](_0x3c9aec[_0x9c81('0x14')][_0x9c81('0x19')],function(_0x228a2a){return{'model':db[_0x228a2a[_0x9c81('0x1a')]],'as':_0x228a2a['as'],'attributes':_0x228a2a['as']===_0x9c81('0x30')?_[_0x9c81('0x31')](_0x32e7df):_0x228a2a[_0x9c81('0x17')],'include':_0x228a2a['include']?_[_0x9c81('0x18')](_0x228a2a[_0x9c81('0x19')],function(_0x45f114){return{'model':db[_0x45f114[_0x9c81('0x1a')]],'as':_0x45f114['as'],'attributes':_0x45f114[_0x9c81('0x17')],'include':_0x45f114[_0x9c81('0x19')]?_['map'](_0x45f114[_0x9c81('0x19')],function(_0xb95877){return{'model':db[_0xb95877[_0x9c81('0x1a')]],'as':_0xb95877['as'],'attributes':_0xb95877['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x378f56){logger['info'](_0x9c81('0x12'),_0x3c9aec);logger[_0x9c81('0x1b')](_0x9c81('0x12'),_0x3c9aec,JSON[_0x9c81('0xe')](_0x378f56));_0x1ed5e8(_0x378f56);})['catch'](function(_0x11be3b){logger[_0x9c81('0xf')](_0x9c81('0x12'),_0x11be3b[_0x9c81('0x10')],_0x3c9aec);_0x383e89(_0x5d36ad['error'](0x1f4,_0x11be3b[_0x9c81('0x10')]));});});});};exports[_0x9c81('0x47')]=function(_0x496fc6){var _0x523c23=this;return new Promise(function(_0x928a06,_0x23dc72){return db['CmContact'][_0x9c81('0x48')]({'raw':!![],'where':{'phone':_0x496fc6[_0x9c81('0x14')][_0x9c81('0x16')][_0x9c81('0x49')]},'attributes':['id','dialTimezone'],'order':[['id',_0x9c81('0x4a')]]})['then'](function(_0xea1f80){logger[_0x9c81('0xb')](_0x9c81('0x4b'),_0x496fc6);logger[_0x9c81('0x1b')](_0x9c81('0x4b'),_0x496fc6,JSON[_0x9c81('0xe')](_0xea1f80));_0x928a06(_0xea1f80);})[_0x9c81('0x1c')](function(_0x45878a){logger[_0x9c81('0xf')]('getContactByPhone',_0x45878a[_0x9c81('0x10')],_0x496fc6);_0x23dc72(_0x523c23[_0x9c81('0xf')](0x1f4,_0x45878a[_0x9c81('0x10')]));});});};exports[_0x9c81('0x4c')]=function(_0x3d8345){var _0x14be41=this;return new Promise(function(_0x281c91,_0x36c0d0){return db['sequelize']['transaction'](function(_0x3161f2){return db[_0x9c81('0x13')][_0x9c81('0x20')](_0x3d8345[_0x9c81('0x1e')],{'where':{},'transaction':_0x3161f2})[_0x9c81('0xa')](function(_0x502287){logger[_0x9c81('0xb')]('ResetActiveCalls',_0x3d8345);logger[_0x9c81('0x1b')](_0x9c81('0x4c'),_0x3d8345,JSON['stringify'](_0x502287));_0x281c91(_0x502287);})[_0x9c81('0x1c')](function(_0x3158a5){logger[_0x9c81('0xf')](_0x9c81('0x4c'),_0x3158a5['message'],_0x3d8345);_0x36c0d0(_0x14be41['error'](0x1f4,_0x3158a5[_0x9c81('0x10')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x534dc0){var _0x27fea4=this;var _0x1accf5=_0x534dc0['body'][_0x9c81('0x16')][_0x9c81('0x4d')];var _0x470cd=_0x534dc0[_0x9c81('0x1e')][_0x9c81('0x16')]['interval'];var _0x121f98=_0x534dc0[_0x9c81('0x1e')][_0x9c81('0x16')][_0x9c81('0x4e')];return new Promise(function(_0x415a32,_0x5a5dab){return db[_0x9c81('0x13')][_0x9c81('0x2c')]({'where':{'voiceQueueId':{'$in':_0x1accf5},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x9c81('0x2a')][_0x9c81('0x41')](_0x9c81('0x4f')+_0x470cd+_0x9c81('0x50')),'$gt':db[_0x9c81('0x2a')][_0x9c81('0x41')](_0x9c81('0x51'))}},'UserId':{'$in':_0x121f98}},'include':[{'model':db['CmContact'],'as':_0x9c81('0x30')},{'model':db[_0x9c81('0x52')],'as':'Agent','attributes':['id','name','voicePause']},{'model':db['CmList'],'as':_0x9c81('0x53')}]})[_0x9c81('0xa')](function(_0x2fa14e){if(_0x2fa14e[_0x9c81('0x38')]>0x0){return db[_0x9c81('0x2a')]['transaction'](function(_0x3b71d8){return db[_0x9c81('0x13')][_0x9c81('0x20')]({'recallmeNotifiedDate':db[_0x9c81('0x2a')][_0x9c81('0x41')](_0x9c81('0x51'))},{'where':{'id':{'$in':_[_0x9c81('0x18')](_0x2fa14e,'id')}},'transaction':_0x3b71d8})[_0x9c81('0xa')](function(){_0x415a32(_0x2fa14e);})[_0x9c81('0x1c')](function(_0xf760a8){logger['error'](_0x9c81('0x54'),_0xf760a8['message'],_0x534dc0);_0x5a5dab(_0x27fea4[_0x9c81('0xf')](0x1f4,_0xf760a8[_0x9c81('0x10')]));});})['catch'](function(_0x209b6b){logger['error'](_0x9c81('0x54'),_0x209b6b[_0x9c81('0x10')],_0x534dc0);_0x5a5dab(_0x27fea4['error'](0x1f4,_0x209b6b[_0x9c81('0x10')]));});}else{_0x415a32(_0x2fa14e);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 86aef57..d12ccc5 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 _0x7336=['Router','../../components/auth/service','isAuthenticated','index','get','describe','/opencontacts','getOpenContacts','/timezones','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','/timezone','getTimezone','put','update','delete','destroy','exports','express'];(function(_0x331b08,_0x2c5937){var _0x5034d9=function(_0x2c916a){while(--_0x2c916a){_0x331b08['push'](_0x331b08['shift']());}};_0x5034d9(++_0x2c5937);}(_0x7336,0x141));var _0x6733=function(_0x203b34,_0x58d49a){_0x203b34=_0x203b34-0x0;var _0xa386ed=_0x7336[_0x203b34];return _0xa386ed;};'use strict';var express=require(_0x6733('0x0'));var router=express[_0x6733('0x1')]();var auth=require(_0x6733('0x2'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0x6733('0x3')](),controller[_0x6733('0x4')]);router[_0x6733('0x5')]('/describe',auth[_0x6733('0x3')](),controller[_0x6733('0x6')]);router[_0x6733('0x5')](_0x6733('0x7'),auth[_0x6733('0x3')](),controller[_0x6733('0x8')]);router[_0x6733('0x5')](_0x6733('0x9'),auth[_0x6733('0x3')](),controller['getTimezones']);router[_0x6733('0x5')](_0x6733('0xa'),auth[_0x6733('0x3')](),controller['show']);router[_0x6733('0x5')](_0x6733('0xb'),auth[_0x6733('0x3')](),controller[_0x6733('0xc')]);router[_0x6733('0xd')]('/',auth['isAuthenticated'](),controller[_0x6733('0xe')]);router[_0x6733('0xd')](_0x6733('0xf'),auth[_0x6733('0x3')](),controller['getPreview']);router['post'](_0x6733('0x10'),auth['isAuthenticated'](),controller[_0x6733('0x11')]);router[_0x6733('0x12')](_0x6733('0xa'),auth[_0x6733('0x3')](),controller[_0x6733('0x13')]);router[_0x6733('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6733('0x15')]);module[_0x6733('0x16')]=router; \ No newline at end of file +var _0x4aff=['/timezones','/:id','getPreviewRecall','post','create','/timezone','put','delete','destroy','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts'];(function(_0x42f3a6,_0x45285c){var _0xdf3c33=function(_0x5cc2ec){while(--_0x5cc2ec){_0x42f3a6['push'](_0x42f3a6['shift']());}};_0xdf3c33(++_0x45285c);}(_0x4aff,0xe1));var _0xf4af=function(_0x166f3c,_0x5770af){_0x166f3c=_0x166f3c-0x0;var _0x58e68b=_0x4aff[_0x166f3c];return _0x58e68b;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xf4af('0x0'));var controller=require(_0xf4af('0x1'));router[_0xf4af('0x2')]('/',auth[_0xf4af('0x3')](),controller[_0xf4af('0x4')]);router['get'](_0xf4af('0x5'),auth[_0xf4af('0x3')](),controller[_0xf4af('0x6')]);router['get'](_0xf4af('0x7'),auth[_0xf4af('0x3')](),controller[_0xf4af('0x8')]);router[_0xf4af('0x2')](_0xf4af('0x9'),auth[_0xf4af('0x3')](),controller['getTimezones']);router[_0xf4af('0x2')](_0xf4af('0xa'),auth[_0xf4af('0x3')](),controller['show']);router['get']('/:id/previewrecall',auth[_0xf4af('0x3')](),controller[_0xf4af('0xb')]);router[_0xf4af('0xc')]('/',auth['isAuthenticated'](),controller[_0xf4af('0xd')]);router['post']('/preview',auth[_0xf4af('0x3')](),controller['getPreview']);router[_0xf4af('0xc')](_0xf4af('0xe'),auth['isAuthenticated'](),controller['getTimezone']);router[_0xf4af('0xf')](_0xf4af('0xa'),auth[_0xf4af('0x3')](),controller['update']);router[_0xf4af('0x10')](_0xf4af('0xa'),auth['isAuthenticated'](),controller[_0xf4af('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index a39174f..744b68c 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x299e=['exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x4f3463,_0x5a1ee7){var _0x5f0e49=function(_0x41419f){while(--_0x41419f){_0x4f3463['push'](_0x4f3463['shift']());}};_0x5f0e49(++_0x5a1ee7);}(_0x299e,0x110));var _0xe299=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x299e[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0xe299('0x0'));var Sequelize=require('sequelize');module[_0xe299('0x1')]={'CmHopperId':{'type':Sequelize[_0xe299('0x2')]},'phone':{'type':Sequelize[_0xe299('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xe299('0x4')],'defaultValue':moment()[_0xe299('0x5')](_0xe299('0x6'))},'countbusyretry':{'type':Sequelize[_0xe299('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe299('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe299('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xe299('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe299('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe299('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe299('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1683=['sequelize','exports','INTEGER','STRING','DATE','format','moment'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x1683,0x109));var _0x3168=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x1683[_0x160c73];return _0xd9302;};'use strict';var moment=require(_0x3168('0x0'));var Sequelize=require(_0x3168('0x1'));module[_0x3168('0x2')]={'CmHopperId':{'type':Sequelize[_0x3168('0x3')]},'phone':{'type':Sequelize[_0x3168('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x3168('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x3168('0x5')],'defaultValue':moment()[_0x3168('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3168('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3168('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x3168('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3168('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3168('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3168('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index abc2c49..11a038d 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['json','apply','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','error','name','map','CmHopperAdditionalPhone','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','Content-Range'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x00bb,0x1d7));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require(_0xb00b('0x3'));var rp=require('request-promise');var moment=require(_0xb00b('0x4'));var BPromise=require(_0xb00b('0x5'));var Mustache=require('mustache');var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require(_0xb00b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb00b('0x9'));var _=require(_0xb00b('0xa'));var squel=require(_0xb00b('0xb'));var crypto=require(_0xb00b('0xc'));var jsforce=require(_0xb00b('0xd'));var deskjs=require(_0xb00b('0xe'));var toCsv=require(_0xb00b('0xf'));var querystring=require(_0xb00b('0x10'));var Papa=require(_0xb00b('0x11'));var Redis=require(_0xb00b('0x12'));var authService=require(_0xb00b('0x13'));var qs=require(_0xb00b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb00b('0x15'));var logger=require('../../config/logger')(_0xb00b('0x16'));var utils=require(_0xb00b('0x17'));var config=require(_0xb00b('0x18'));var licenseUtil=require(_0xb00b('0x19'));var db=require(_0xb00b('0x1a'))['db'];function respondWithStatusCode(_0x341274,_0x38a668){_0x38a668=_0x38a668||0xcc;return function(_0x40ce3e){if(_0x40ce3e){return _0x341274[_0xb00b('0x1b')](_0x38a668);}return _0x341274[_0xb00b('0x1c')](_0x38a668)[_0xb00b('0x1d')]();};}function respondWithResult(_0xca33ae,_0x2a48e5){_0x2a48e5=_0x2a48e5||0xc8;return function(_0x319010){if(_0x319010){return _0xca33ae['status'](_0x2a48e5)['json'](_0x319010);}};}function respondWithFilteredResult(_0x46663b,_0x34302e){return function(_0x1c9056){if(_0x1c9056){var _0x22a38b=typeof _0x34302e[_0xb00b('0x1e')]===_0xb00b('0x1f')&&typeof _0x34302e['limit']===_0xb00b('0x1f');var _0x4994ca=_0x1c9056['count'];var _0x439635=_0x22a38b?0x0:_0x34302e['offset'];var _0xb5e10c=_0x22a38b?_0x1c9056['count']:_0x34302e['offset']+_0x34302e['limit'];var _0xff44e5;if(_0xb5e10c>=_0x4994ca){_0xb5e10c=_0x4994ca;_0xff44e5=0xc8;}else{_0xff44e5=0xce;}_0x46663b[_0xb00b('0x1c')](_0xff44e5);return _0x46663b['set'](_0xb00b('0x20'),_0x439635+'-'+_0xb5e10c+'/'+_0x4994ca)[_0xb00b('0x21')](_0x1c9056);}return null;};}function patchUpdates(_0x39edf0){return function(_0x159baa){try{jsonpatch[_0xb00b('0x22')](_0x159baa,_0x39edf0,!![]);}catch(_0x472314){return BPromise[_0xb00b('0x23')](_0x472314);}return _0x159baa[_0xb00b('0x24')]();};}function saveUpdates(_0x259756,_0x47fef4){return function(_0x54eddb){if(_0x54eddb){return _0x54eddb[_0xb00b('0x25')](_0x259756)[_0xb00b('0x26')](function(_0x2ed12f){return _0x2ed12f;});}return null;};}function removeEntity(_0x5551d2,_0x5da24e){return function(_0xe5c052){if(_0xe5c052){return _0xe5c052['destroy']()['then'](function(){var _0x5d059d=_0xe5c052[_0xb00b('0x27')]({'plain':!![]});var _0x5d749c=_0xb00b('0x28');return db[_0xb00b('0x29')]['destroy']({'where':{'type':_0x5d749c,'resourceId':_0x5d059d['id']}})[_0xb00b('0x26')](function(){return _0xe5c052;});})[_0xb00b('0x26')](function(){_0x5551d2[_0xb00b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27cc98,_0x3b051){return function(_0x365378){if(!_0x365378){_0x27cc98[_0xb00b('0x1b')](0x194);}return _0x365378;};}function handleError(_0x13108e,_0x52172f){_0x52172f=_0x52172f||0x1f4;return function(_0x10594e){logger[_0xb00b('0x2a')](_0x10594e['stack']);if(_0x10594e[_0xb00b('0x2b')]){delete _0x10594e['name'];}_0x13108e['status'](_0x52172f)['send'](_0x10594e);};}exports['index']=function(_0x30cfef,_0x58c54b){var _0x3ad1cd={},_0x294957={},_0x200cf4={'count':0x0,'rows':[]};var _0x3beed8=_[_0xb00b('0x2c')](db[_0xb00b('0x2d')]['rawAttributes'],function(_0x24a595){return{'name':_0x24a595[_0xb00b('0x2e')],'type':_0x24a595[_0xb00b('0x2f')][_0xb00b('0x30')]};});_0x294957['model']=_[_0xb00b('0x2c')](_0x3beed8,_0xb00b('0x2b'));_0x294957[_0xb00b('0x31')]=_[_0xb00b('0x32')](_0x30cfef['query']);_0x294957[_0xb00b('0x33')]=_[_0xb00b('0x34')](_0x294957[_0xb00b('0x35')],_0x294957[_0xb00b('0x31')]);_0x3ad1cd[_0xb00b('0x36')]=_['intersection'](_0x294957['model'],qs['fields'](_0x30cfef['query'][_0xb00b('0x37')]));_0x3ad1cd[_0xb00b('0x36')]=_0x3ad1cd[_0xb00b('0x36')][_0xb00b('0x38')]?_0x3ad1cd[_0xb00b('0x36')]:_0x294957[_0xb00b('0x35')];if(!_0x30cfef['query'][_0xb00b('0x39')]('nolimit')){_0x3ad1cd[_0xb00b('0x3a')]=qs[_0xb00b('0x3a')](_0x30cfef[_0xb00b('0x31')][_0xb00b('0x3a')]);_0x3ad1cd[_0xb00b('0x1e')]=qs[_0xb00b('0x1e')](_0x30cfef[_0xb00b('0x31')]['offset']);}_0x3ad1cd['order']=qs[_0xb00b('0x3b')](_0x30cfef[_0xb00b('0x31')][_0xb00b('0x3b')]);_0x3ad1cd[_0xb00b('0x3c')]=qs['filters'](_[_0xb00b('0x3d')](_0x30cfef['query'],_0x294957[_0xb00b('0x33')]),_0x3beed8);if(_0x30cfef[_0xb00b('0x31')][_0xb00b('0x3e')]){_0x3ad1cd[_0xb00b('0x3c')]=_[_0xb00b('0x3f')](_0x3ad1cd[_0xb00b('0x3c')],{'$or':_[_0xb00b('0x2c')](_0x3beed8,function(_0x46bc44){if(_0x46bc44[_0xb00b('0x2f')]!==_0xb00b('0x40')){var _0x3bfb04={};_0x3bfb04[_0x46bc44['name']]={'$like':'%'+_0x30cfef[_0xb00b('0x31')]['filter']+'%'};return _0x3bfb04;}})});}_0x3ad1cd=_[_0xb00b('0x3f')]({},_0x3ad1cd,_0x30cfef['options']);var _0x4f9546={'where':_0x3ad1cd[_0xb00b('0x3c')]};return db[_0xb00b('0x2d')]['count'](_0x4f9546)[_0xb00b('0x26')](function(_0x3abafa){_0x200cf4[_0xb00b('0x41')]=_0x3abafa;if(_0x30cfef[_0xb00b('0x31')][_0xb00b('0x42')]){_0x3ad1cd['include']=[{'all':!![]}];}return db[_0xb00b('0x2d')][_0xb00b('0x43')](_0x3ad1cd);})[_0xb00b('0x26')](function(_0x42e0d9){_0x200cf4[_0xb00b('0x44')]=_0x42e0d9;return _0x200cf4;})[_0xb00b('0x26')](respondWithFilteredResult(_0x58c54b,_0x3ad1cd))['catch'](handleError(_0x58c54b,null));};exports['show']=function(_0x12ba28,_0x12eb40){var _0x19a7a6={'raw':!![],'where':{'id':_0x12ba28['params']['id']}},_0x372462={};_0x372462[_0xb00b('0x35')]=_[_0xb00b('0x32')](db[_0xb00b('0x2d')]['rawAttributes']);_0x372462[_0xb00b('0x31')]=_['keys'](_0x12ba28[_0xb00b('0x31')]);_0x372462[_0xb00b('0x33')]=_['intersection'](_0x372462['model'],_0x372462[_0xb00b('0x31')]);_0x19a7a6['attributes']=_[_0xb00b('0x34')](_0x372462[_0xb00b('0x35')],qs[_0xb00b('0x37')](_0x12ba28[_0xb00b('0x31')][_0xb00b('0x37')]));_0x19a7a6[_0xb00b('0x36')]=_0x19a7a6[_0xb00b('0x36')]['length']?_0x19a7a6[_0xb00b('0x36')]:_0x372462['model'];if(_0x12ba28[_0xb00b('0x31')][_0xb00b('0x42')]){_0x19a7a6[_0xb00b('0x45')]=[{'all':!![]}];}_0x19a7a6=_[_0xb00b('0x3f')]({},_0x19a7a6,_0x12ba28[_0xb00b('0x46')]);return db['CmHopperAdditionalPhone'][_0xb00b('0x47')](_0x19a7a6)[_0xb00b('0x26')](handleEntityNotFound(_0x12eb40,null))['then'](respondWithResult(_0x12eb40,null))['catch'](handleError(_0x12eb40,null));};exports[_0xb00b('0x48')]=function(_0x5e8d88,_0x230f16){return db[_0xb00b('0x2d')][_0xb00b('0x48')](_0x5e8d88[_0xb00b('0x49')],{})['then'](function(_0x404a32){var _0x32e7a6=_0x5e8d88[_0xb00b('0x4a')][_0xb00b('0x27')]({'plain':!![]});if(!_0x32e7a6)throw new Error(_0xb00b('0x4b'));if(_0x32e7a6[_0xb00b('0x4c')]===_0xb00b('0x4a')){var _0x3fced4=_0x404a32[_0xb00b('0x27')]({'plain':!![]});var _0x4df00a=_0xb00b('0x28');return db[_0xb00b('0x4d')]['find']({'where':{'name':_0x4df00a,'userProfileId':_0x32e7a6[_0xb00b('0x4e')]},'raw':!![]})[_0xb00b('0x26')](function(_0x2026d0){if(_0x2026d0&&_0x2026d0[_0xb00b('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3fced4['name'],'resourceId':_0x3fced4['id'],'type':_0x2026d0[_0xb00b('0x2b')],'sectionId':_0x2026d0['id']},{})[_0xb00b('0x26')](function(){return _0x404a32;});}else{return _0x404a32;}})[_0xb00b('0x50')](function(_0xa3ff7f){logger[_0xb00b('0x2a')](_0xb00b('0x51'),_0xa3ff7f);throw _0xa3ff7f;});}return _0x404a32;})['then'](respondWithResult(_0x230f16,0xc9))[_0xb00b('0x50')](handleError(_0x230f16,null));};exports[_0xb00b('0x25')]=function(_0x5f2d06,_0x419e99){if(_0x5f2d06['body']['id']){delete _0x5f2d06['body']['id'];}return db[_0xb00b('0x2d')]['find']({'where':{'id':_0x5f2d06[_0xb00b('0x52')]['id']}})[_0xb00b('0x26')](handleEntityNotFound(_0x419e99,null))[_0xb00b('0x26')](saveUpdates(_0x5f2d06[_0xb00b('0x49')],null))[_0xb00b('0x26')](respondWithResult(_0x419e99,null))[_0xb00b('0x50')](handleError(_0x419e99,null));};exports[_0xb00b('0x53')]=function(_0x37f549,_0x5b303b){return db[_0xb00b('0x2d')][_0xb00b('0x47')]({'where':{'id':_0x37f549[_0xb00b('0x52')]['id']}})[_0xb00b('0x26')](handleEntityNotFound(_0x5b303b,null))[_0xb00b('0x26')](removeEntity(_0x5b303b,null))[_0xb00b('0x50')](handleError(_0x5b303b,null));}; \ No newline at end of file +var _0xe4f6=['fields','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','CmHopperAdditionalPhone','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','error','stack','send','index','map','fieldName','type','name','keys','filters','intersection','model','query','attributes'];(function(_0x9da055,_0x5c2a73){var _0x7ffba7=function(_0x5e4fc3){while(--_0x5e4fc3){_0x9da055['push'](_0x9da055['shift']());}};_0x7ffba7(++_0x5c2a73);}(_0xe4f6,0x1cc));var _0x6e4f=function(_0x251489,_0x5cebd3){_0x251489=_0x251489-0x0;var _0x54f625=_0xe4f6[_0x251489];return _0x54f625;};'use strict';var emlformat=require(_0x6e4f('0x0'));var rimraf=require(_0x6e4f('0x1'));var zipdir=require(_0x6e4f('0x2'));var jsonpatch=require(_0x6e4f('0x3'));var rp=require(_0x6e4f('0x4'));var moment=require(_0x6e4f('0x5'));var BPromise=require(_0x6e4f('0x6'));var Mustache=require(_0x6e4f('0x7'));var util=require(_0x6e4f('0x8'));var path=require(_0x6e4f('0x9'));var sox=require(_0x6e4f('0xa'));var csv=require('to-csv');var ejs=require(_0x6e4f('0xb'));var fs=require('fs');var fs_extra=require(_0x6e4f('0xc'));var _=require('lodash');var squel=require(_0x6e4f('0xd'));var crypto=require(_0x6e4f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6e4f('0xf'));var querystring=require(_0x6e4f('0x10'));var Papa=require(_0x6e4f('0x11'));var Redis=require(_0x6e4f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6e4f('0x13'));var hardwareService=require(_0x6e4f('0x14'));var logger=require(_0x6e4f('0x15'))(_0x6e4f('0x16'));var utils=require(_0x6e4f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6e4f('0x18'));var db=require(_0x6e4f('0x19'))['db'];function respondWithStatusCode(_0x4b2aaa,_0x5aeadd){_0x5aeadd=_0x5aeadd||0xcc;return function(_0xb725bb){if(_0xb725bb){return _0x4b2aaa[_0x6e4f('0x1a')](_0x5aeadd);}return _0x4b2aaa['status'](_0x5aeadd)[_0x6e4f('0x1b')]();};}function respondWithResult(_0x40d02d,_0x279262){_0x279262=_0x279262||0xc8;return function(_0x1bd2e6){if(_0x1bd2e6){return _0x40d02d[_0x6e4f('0x1c')](_0x279262)[_0x6e4f('0x1d')](_0x1bd2e6);}};}function respondWithFilteredResult(_0x220b47,_0x3b6101){return function(_0x325dc8){if(_0x325dc8){var _0x2d9ca8=typeof _0x3b6101[_0x6e4f('0x1e')]===_0x6e4f('0x1f')&&typeof _0x3b6101[_0x6e4f('0x20')]===_0x6e4f('0x1f');var _0x112b57=_0x325dc8[_0x6e4f('0x21')];var _0x3fd7b3=_0x2d9ca8?0x0:_0x3b6101[_0x6e4f('0x1e')];var _0x5d71a2=_0x2d9ca8?_0x325dc8[_0x6e4f('0x21')]:_0x3b6101[_0x6e4f('0x1e')]+_0x3b6101[_0x6e4f('0x20')];var _0x52199c;if(_0x5d71a2>=_0x112b57){_0x5d71a2=_0x112b57;_0x52199c=0xc8;}else{_0x52199c=0xce;}_0x220b47[_0x6e4f('0x1c')](_0x52199c);return _0x220b47['set'](_0x6e4f('0x22'),_0x3fd7b3+'-'+_0x5d71a2+'/'+_0x112b57)[_0x6e4f('0x1d')](_0x325dc8);}return null;};}function patchUpdates(_0xef9977){return function(_0x18cc2b){try{jsonpatch['apply'](_0x18cc2b,_0xef9977,!![]);}catch(_0x10ba06){return BPromise[_0x6e4f('0x23')](_0x10ba06);}return _0x18cc2b[_0x6e4f('0x24')]();};}function saveUpdates(_0x2f6d35,_0x35be97){return function(_0x190649){if(_0x190649){return _0x190649[_0x6e4f('0x25')](_0x2f6d35)[_0x6e4f('0x26')](function(_0x177ffa){return _0x177ffa;});}return null;};}function removeEntity(_0x5e05d8,_0x5a7ac7){return function(_0x781d39){if(_0x781d39){return _0x781d39[_0x6e4f('0x27')]()[_0x6e4f('0x26')](function(){var _0x3d0d17=_0x781d39[_0x6e4f('0x28')]({'plain':!![]});var _0x160afa=_0x6e4f('0x29');return db['UserProfileResource'][_0x6e4f('0x27')]({'where':{'type':_0x160afa,'resourceId':_0x3d0d17['id']}})['then'](function(){return _0x781d39;});})[_0x6e4f('0x26')](function(){_0x5e05d8['status'](0xcc)[_0x6e4f('0x1b')]();});}};}function handleEntityNotFound(_0x10ebe8,_0x23094f){return function(_0x37decc){if(!_0x37decc){_0x10ebe8[_0x6e4f('0x1a')](0x194);}return _0x37decc;};}function handleError(_0x2916ec,_0x13537a){_0x13537a=_0x13537a||0x1f4;return function(_0x29fb26){logger[_0x6e4f('0x2a')](_0x29fb26[_0x6e4f('0x2b')]);if(_0x29fb26['name']){delete _0x29fb26['name'];}_0x2916ec[_0x6e4f('0x1c')](_0x13537a)[_0x6e4f('0x2c')](_0x29fb26);};}exports[_0x6e4f('0x2d')]=function(_0x5c95ab,_0x30117d){var _0x10da46={},_0x40b406={},_0x4ab42a={'count':0x0,'rows':[]};var _0x31c51e=_[_0x6e4f('0x2e')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0xdad235){return{'name':_0xdad235[_0x6e4f('0x2f')],'type':_0xdad235[_0x6e4f('0x30')]['key']};});_0x40b406['model']=_[_0x6e4f('0x2e')](_0x31c51e,_0x6e4f('0x31'));_0x40b406['query']=_[_0x6e4f('0x32')](_0x5c95ab['query']);_0x40b406[_0x6e4f('0x33')]=_[_0x6e4f('0x34')](_0x40b406[_0x6e4f('0x35')],_0x40b406[_0x6e4f('0x36')]);_0x10da46[_0x6e4f('0x37')]=_[_0x6e4f('0x34')](_0x40b406[_0x6e4f('0x35')],qs[_0x6e4f('0x38')](_0x5c95ab[_0x6e4f('0x36')]['fields']));_0x10da46['attributes']=_0x10da46[_0x6e4f('0x37')]['length']?_0x10da46[_0x6e4f('0x37')]:_0x40b406[_0x6e4f('0x35')];if(!_0x5c95ab[_0x6e4f('0x36')][_0x6e4f('0x39')]('nolimit')){_0x10da46[_0x6e4f('0x20')]=qs[_0x6e4f('0x20')](_0x5c95ab['query']['limit']);_0x10da46[_0x6e4f('0x1e')]=qs[_0x6e4f('0x1e')](_0x5c95ab[_0x6e4f('0x36')][_0x6e4f('0x1e')]);}_0x10da46[_0x6e4f('0x3a')]=qs[_0x6e4f('0x3b')](_0x5c95ab[_0x6e4f('0x36')][_0x6e4f('0x3b')]);_0x10da46['where']=qs[_0x6e4f('0x33')](_[_0x6e4f('0x3c')](_0x5c95ab[_0x6e4f('0x36')],_0x40b406[_0x6e4f('0x33')]),_0x31c51e);if(_0x5c95ab[_0x6e4f('0x36')]['filter']){_0x10da46[_0x6e4f('0x3d')]=_[_0x6e4f('0x3e')](_0x10da46[_0x6e4f('0x3d')],{'$or':_[_0x6e4f('0x2e')](_0x31c51e,function(_0x15a3f1){if(_0x15a3f1['type']!==_0x6e4f('0x3f')){var _0x2444e5={};_0x2444e5[_0x15a3f1[_0x6e4f('0x31')]]={'$like':'%'+_0x5c95ab[_0x6e4f('0x36')][_0x6e4f('0x40')]+'%'};return _0x2444e5;}})});}_0x10da46=_[_0x6e4f('0x3e')]({},_0x10da46,_0x5c95ab['options']);var _0x570257={'where':_0x10da46['where']};return db[_0x6e4f('0x41')][_0x6e4f('0x21')](_0x570257)[_0x6e4f('0x26')](function(_0x3c040e){_0x4ab42a[_0x6e4f('0x21')]=_0x3c040e;if(_0x5c95ab[_0x6e4f('0x36')][_0x6e4f('0x42')]){_0x10da46[_0x6e4f('0x43')]=[{'all':!![]}];}return db[_0x6e4f('0x41')][_0x6e4f('0x44')](_0x10da46);})[_0x6e4f('0x26')](function(_0x2f1e7d){_0x4ab42a[_0x6e4f('0x45')]=_0x2f1e7d;return _0x4ab42a;})[_0x6e4f('0x26')](respondWithFilteredResult(_0x30117d,_0x10da46))['catch'](handleError(_0x30117d,null));};exports[_0x6e4f('0x46')]=function(_0x4b5c26,_0x358993){var _0x30f134={'raw':!![],'where':{'id':_0x4b5c26[_0x6e4f('0x47')]['id']}},_0x5290b7={};_0x5290b7[_0x6e4f('0x35')]=_['keys'](db[_0x6e4f('0x41')][_0x6e4f('0x48')]);_0x5290b7[_0x6e4f('0x36')]=_[_0x6e4f('0x32')](_0x4b5c26[_0x6e4f('0x36')]);_0x5290b7[_0x6e4f('0x33')]=_[_0x6e4f('0x34')](_0x5290b7[_0x6e4f('0x35')],_0x5290b7[_0x6e4f('0x36')]);_0x30f134[_0x6e4f('0x37')]=_[_0x6e4f('0x34')](_0x5290b7[_0x6e4f('0x35')],qs[_0x6e4f('0x38')](_0x4b5c26[_0x6e4f('0x36')][_0x6e4f('0x38')]));_0x30f134['attributes']=_0x30f134[_0x6e4f('0x37')]['length']?_0x30f134[_0x6e4f('0x37')]:_0x5290b7[_0x6e4f('0x35')];if(_0x4b5c26[_0x6e4f('0x36')][_0x6e4f('0x42')]){_0x30f134[_0x6e4f('0x43')]=[{'all':!![]}];}_0x30f134=_[_0x6e4f('0x3e')]({},_0x30f134,_0x4b5c26[_0x6e4f('0x49')]);return db[_0x6e4f('0x41')][_0x6e4f('0x4a')](_0x30f134)['then'](handleEntityNotFound(_0x358993,null))['then'](respondWithResult(_0x358993,null))['catch'](handleError(_0x358993,null));};exports['create']=function(_0x5700af,_0x2be064){return db[_0x6e4f('0x41')][_0x6e4f('0x4b')](_0x5700af['body'],{})['then'](function(_0x463abf){var _0x1541cb=_0x5700af[_0x6e4f('0x4c')]['get']({'plain':!![]});if(!_0x1541cb)throw new Error(_0x6e4f('0x4d'));if(_0x1541cb[_0x6e4f('0x4e')]===_0x6e4f('0x4c')){var _0x4aad8b=_0x463abf['get']({'plain':!![]});var _0xfccbb1=_0x6e4f('0x29');return db[_0x6e4f('0x4f')][_0x6e4f('0x4a')]({'where':{'name':_0xfccbb1,'userProfileId':_0x1541cb[_0x6e4f('0x50')]},'raw':!![]})[_0x6e4f('0x26')](function(_0xfc57a){if(_0xfc57a&&_0xfc57a[_0x6e4f('0x51')]===0x0){return db[_0x6e4f('0x52')][_0x6e4f('0x4b')]({'name':_0x4aad8b[_0x6e4f('0x31')],'resourceId':_0x4aad8b['id'],'type':_0xfc57a['name'],'sectionId':_0xfc57a['id']},{})[_0x6e4f('0x26')](function(){return _0x463abf;});}else{return _0x463abf;}})[_0x6e4f('0x53')](function(_0x2b1f5c){logger['error'](_0x6e4f('0x54'),_0x2b1f5c);throw _0x2b1f5c;});}return _0x463abf;})[_0x6e4f('0x26')](respondWithResult(_0x2be064,0xc9))[_0x6e4f('0x53')](handleError(_0x2be064,null));};exports['update']=function(_0x171948,_0x5395e7){if(_0x171948[_0x6e4f('0x55')]['id']){delete _0x171948[_0x6e4f('0x55')]['id'];}return db[_0x6e4f('0x41')][_0x6e4f('0x4a')]({'where':{'id':_0x171948[_0x6e4f('0x47')]['id']}})[_0x6e4f('0x26')](handleEntityNotFound(_0x5395e7,null))[_0x6e4f('0x26')](saveUpdates(_0x171948[_0x6e4f('0x55')],null))['then'](respondWithResult(_0x5395e7,null))['catch'](handleError(_0x5395e7,null));};exports['destroy']=function(_0x6ba0d3,_0xff5cc6){return db[_0x6e4f('0x41')]['find']({'where':{'id':_0x6ba0d3[_0x6e4f('0x47')]['id']}})[_0x6e4f('0x26')](handleEntityNotFound(_0xff5cc6,null))[_0x6e4f('0x26')](removeEntity(_0xff5cc6,null))['catch'](handleError(_0xff5cc6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 2b43900..b6c94b0 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4397=['cm_hopper_additional_phones','../../config/logger','api','bluebird','path','../../config/environment','exports','define','CmHopperAdditionalPhone'];(function(_0x1ea9c5,_0x35a009){var _0x3da16b=function(_0x5d7888){while(--_0x5d7888){_0x1ea9c5['push'](_0x1ea9c5['shift']());}};_0x3da16b(++_0x35a009);}(_0x4397,0x196));var _0x7439=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x4397[_0xcf4569];return _0x7fef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7439('0x0'))(_0x7439('0x1'));var moment=require('moment');var BPromise=require(_0x7439('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7439('0x3'));var rimraf=require('rimraf');var config=require(_0x7439('0x4'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x7439('0x5')]=function(_0x1bcbe2,_0x16cad1){return _0x1bcbe2[_0x7439('0x6')](_0x7439('0x7'),attributes,{'tableName':_0x7439('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc479=['request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','bluebird'];(function(_0xc83d92,_0x1193b9){var _0x22f0f9=function(_0x11420f){while(--_0x11420f){_0xc83d92['push'](_0xc83d92['shift']());}};_0x22f0f9(++_0x1193b9);}(_0xc479,0xc7));var _0x9c47=function(_0x543523,_0x355983){_0x543523=_0x543523-0x0;var _0x298e07=_0xc479[_0x543523];return _0x298e07;};'use strict';var _=require(_0x9c47('0x0'));var util=require(_0x9c47('0x1'));var logger=require(_0x9c47('0x2'))(_0x9c47('0x3'));var moment=require('moment');var BPromise=require(_0x9c47('0x4'));var rp=require(_0x9c47('0x5'));var fs=require('fs');var path=require(_0x9c47('0x6'));var rimraf=require(_0x9c47('0x7'));var config=require('../../config/environment');var attributes=require(_0x9c47('0x8'));module[_0x9c47('0x9')]=function(_0x2b63f8,_0x27fe81){return _0x2b63f8['define'](_0x9c47('0xa'),attributes,{'tableName':_0x9c47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 11b3da6..478d62b 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77de=['CmHopperAdditionalPhone','OrderBy','ASC','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','countcongestionretry','catch','SwapAdditionalPhones','ListId','duration','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','CmHopper','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','VerifyAdditionalPhones','findOne','body','ContactId','VoiceQueueId','CampaignId'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x77de,0x102));var _0xe77d=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x77de[_0x34bf97];return _0x292719;};'use strict';var _=require('lodash');var util=require(_0xe77d('0x0'));var moment=require('moment');var BPromise=require(_0xe77d('0x1'));var rs=require(_0xe77d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe77d('0x3'))['db'];var utils=require(_0xe77d('0x4'));var logger=require(_0xe77d('0x5'))(_0xe77d('0x6'));var config=require('../../config/environment');var jayson=require(_0xe77d('0x7'));var client=jayson[_0xe77d('0x8')][_0xe77d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47befe,_0x3f9dff,_0x155747){return new BPromise(function(_0xee5626,_0x22b911){return client[_0xe77d('0xa')](_0x47befe,_0x155747)[_0xe77d('0xb')](function(_0x2ebaff){logger[_0xe77d('0xc')](_0xe77d('0xd'),_0x3f9dff,'request\x20sent');logger['debug'](_0xe77d('0xe'),_0x3f9dff,'request\x20sent',JSON[_0xe77d('0xf')](_0x2ebaff));if(_0x2ebaff['error']){if(_0x2ebaff['error'][_0xe77d('0x10')]===0x1f4){logger[_0xe77d('0x11')](_0xe77d('0xd'),_0x3f9dff,_0x2ebaff[_0xe77d('0x11')][_0xe77d('0x12')]);return _0x22b911(_0x2ebaff[_0xe77d('0x11')][_0xe77d('0x12')]);}logger[_0xe77d('0x11')](_0xe77d('0xd'),_0x3f9dff,_0x2ebaff[_0xe77d('0x11')]['message']);return _0xee5626(_0x2ebaff[_0xe77d('0x11')][_0xe77d('0x12')]);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3f9dff,_0xe77d('0x13'));_0xee5626(_0x2ebaff[_0xe77d('0x14')]['message']);}})['catch'](function(_0x920e){logger[_0xe77d('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3f9dff,_0x920e);_0x22b911(_0x920e);});});}exports[_0xe77d('0x15')]=function(_0x35d9d7){var _0x20e936=this;return new Promise(function(_0x155098,_0x24e810){return db['CmHopper'][_0xe77d('0x16')]({'raw':!![],'where':{'ContactId':_0x35d9d7[_0xe77d('0x17')][_0xe77d('0x18')],'ListId':_0x35d9d7[_0xe77d('0x17')]['ListId'],'VoiceQueueId':_0x35d9d7[_0xe77d('0x17')][_0xe77d('0x19')]===undefined?null:_0x35d9d7[_0xe77d('0x17')][_0xe77d('0x19')],'CampaignId':_0x35d9d7[_0xe77d('0x17')][_0xe77d('0x1a')]===undefined?null:_0x35d9d7[_0xe77d('0x17')]['CampaignId']}})[_0xe77d('0xb')](function(_0x37b314){if(_0x37b314!=null){return db[_0xe77d('0x1b')][_0xe77d('0x16')]({'raw':!![],'where':{'CmHopperId':_0x37b314['id'],'OrderBy':{'$gt':_0x37b314[_0xe77d('0x1c')]}},'order':[[_0xe77d('0x1c'),_0xe77d('0x1d')]]})[_0xe77d('0xb')](function(_0x6abd50){var _0x2f0549=0x0;if(_0x6abd50){if(_0x6abd50['countbusyretry']+_0x6abd50['countcongestionretry']+_0x6abd50[_0xe77d('0x1e')]+_0x6abd50[_0xe77d('0x1f')]+_0x6abd50[_0xe77d('0x20')]+_0x6abd50[_0xe77d('0x21')]+_0x6abd50[_0xe77d('0x22')]+_0x6abd50[_0xe77d('0x23')]<_0x35d9d7[_0xe77d('0x24')][_0xe77d('0x25')])_0x2f0549=0x1;_0x155098({'additional':_0x2f0549});}else{return db[_0xe77d('0x1b')][_0xe77d('0x16')]({'raw':!![],'where':{'CmHopperId':_0x37b314['id']},'order':[[_0xe77d('0x1c'),_0xe77d('0x1d')]]})[_0xe77d('0xb')](function(_0x4f2a8a){var _0x242e54=0x0;if(_0x4f2a8a){if(_0x4f2a8a[_0xe77d('0x26')]+_0x4f2a8a[_0xe77d('0x27')]+_0x4f2a8a[_0xe77d('0x1e')]+_0x4f2a8a[_0xe77d('0x1f')]+_0x4f2a8a[_0xe77d('0x20')]+_0x4f2a8a[_0xe77d('0x21')]+_0x4f2a8a['countmachineretry']+_0x4f2a8a['countagentrejectretry']<_0x35d9d7['entity'][_0xe77d('0x25')])_0x242e54=0x1;_0x155098({'additional':_0x242e54});}else{_0x155098({'additional':0x0});}})['catch'](function(_0x43e03e){logger[_0xe77d('0x11')]('VerifyAdditionalPhones',_0x43e03e[_0xe77d('0x12')]);_0x24e810(_0x20e936[_0xe77d('0x11')](0x1f4,_0x43e03e['message']));});}})[_0xe77d('0x28')](function(_0x39c9e9){logger[_0xe77d('0x11')](_0xe77d('0x15'),_0x39c9e9[_0xe77d('0x12')]);_0x24e810(_0x20e936[_0xe77d('0x11')](0x1f4,_0x39c9e9[_0xe77d('0x12')]));});}else _0x155098({'additional':0x0});});});};exports[_0xe77d('0x29')]=function(_0x140576){var _0x3da712=this;return new Promise(function(_0x3d5714,_0x19fd0e){return db['CmHopper'][_0xe77d('0x16')]({'raw':!![],'where':{'ContactId':_0x140576[_0xe77d('0x17')][_0xe77d('0x18')],'ListId':_0x140576[_0xe77d('0x17')][_0xe77d('0x2a')],'VoiceQueueId':_0x140576[_0xe77d('0x17')]['VoiceQueueId']===undefined?null:_0x140576[_0xe77d('0x17')][_0xe77d('0x19')],'CampaignId':_0x140576[_0xe77d('0x17')][_0xe77d('0x1a')]===undefined?null:_0x140576[_0xe77d('0x17')][_0xe77d('0x1a')]}})[_0xe77d('0xb')](function(_0x26a44f){if(_0x26a44f!=null){return db[_0xe77d('0x1b')][_0xe77d('0x16')]({'raw':!![],'where':{'CmHopperId':_0x26a44f['id'],'OrderBy':{'$gte':_0x26a44f[_0xe77d('0x1c')]}},'order':[['OrderBy',_0xe77d('0x1d')]]})[_0xe77d('0xb')](function(_0x3ae67a){if(_0x3ae67a)return activateAdditionalPhone(_0x26a44f,_0x140576[_0xe77d('0x17')],_0x3ae67a,_0x140576[_0xe77d('0x2b')],_0x140576[_0xe77d('0x2c')])['then'](function(_0xb633e9){_0x3d5714(_0xb633e9);});else{return db['CmHopperAdditionalPhone'][_0xe77d('0x16')]({'raw':!![],'where':{'CmHopperId':_0x26a44f['id']},'order':[[_0xe77d('0x1c'),'ASC']]})['then'](function(_0x257dce){if(_0x257dce)return activateAdditionalPhone(_0x26a44f,_0x140576['body'],_0x257dce,_0x140576[_0xe77d('0x2b')],_0x140576[_0xe77d('0x2c')])[_0xe77d('0xb')](function(_0x2bf2c1){_0x3d5714(_0x2bf2c1);});else{_0x3d5714({'id':_0x26a44f['id'],'phone':''});}})[_0xe77d('0x28')](function(_0x10ab92){logger['error'](_0xe77d('0x15'),_0x10ab92[_0xe77d('0x12')]);_0x19fd0e(_0x3da712[_0xe77d('0x11')](0x1f4,_0x10ab92['message']));});}})['catch'](function(_0x4e2296){logger[_0xe77d('0x11')](_0xe77d('0x15'),_0x4e2296[_0xe77d('0x12')]);_0x19fd0e(_0x3da712['error'](0x1f4,_0x4e2296['message']));});}else _0x3d5714(0x1);});});};function activateAdditionalPhone(_0x392a0d,_0x4b4aca,_0x2b9ee1,_0x893b3b,_0x54209f){return new Promise(function(_0x62ab15,_0x349497){var _0x79f937;if(_[_0xe77d('0x2d')](_0x2b9ee1[_0xe77d('0x2e')])){_0x2b9ee1['scheduledat']=moment();}if(moment()>moment(_0x2b9ee1[_0xe77d('0x2e')])){_0x79f937=moment()['add'](_0x54209f||0x3,_0xe77d('0x2f'));}else{if(_0x2b9ee1[_0xe77d('0x1c')]==0x0){_0x79f937=moment(_0x2b9ee1[_0xe77d('0x2e')]);}else{_0x79f937=moment()['add'](_0x54209f||0x3,'minutes');}}if(_[_0xe77d('0x2d')](_0x79f937)){_0x79f937=moment()[_0xe77d('0x30')](_0x54209f||0x3,'minutes');}var _0x5f070c={'phone':_0x392a0d[_0xe77d('0x31')],'active':0x0,'OrderBy':_[_0xe77d('0x2d')](_0x392a0d['OrderBy'])?0x0:_0x392a0d[_0xe77d('0x1c')],'scheduledat':moment()[_0xe77d('0x30')](_0x893b3b||0x1,_0xe77d('0x2f')),'countbusyretry':_0x4b4aca[_0xe77d('0x26')],'countcongestionretry':_0x4b4aca[_0xe77d('0x27')],'countnoanswerretry':_0x4b4aca[_0xe77d('0x1e')],'countnosuchnumberretry':_0x4b4aca['countnosuchnumberretry'],'countdropretry':_0x4b4aca['countdropretry'],'countabandonedretry':_0x4b4aca[_0xe77d('0x21')],'countmachineretry':_0x4b4aca[_0xe77d('0x22')],'countagentrejectretry':_0x4b4aca[_0xe77d('0x23')],'createdAt':_0x4b4aca[_0xe77d('0x32')],'updatedAt':_0x4b4aca[_0xe77d('0x33')]};var _0x3dc0a5={'CmHopperId':_0x392a0d['id'],'phone':_0x2b9ee1[_0xe77d('0x31')],'active':0x0,'OrderBy':_[_0xe77d('0x2d')](_0x2b9ee1['OrderBy'])?0x0:_0x2b9ee1[_0xe77d('0x1c')],'scheduledat':_0x79f937,'countbusyretry':_0x2b9ee1[_0xe77d('0x26')],'countcongestionretry':_0x2b9ee1[_0xe77d('0x27')],'countnoanswerretry':_0x2b9ee1['countnoanswerretry'],'countnosuchnumberretry':_0x2b9ee1['countnosuchnumberretry'],'countdropretry':_0x2b9ee1['countdropretry'],'countabandonedretry':_0x2b9ee1['countabandonedretry'],'countmachineretry':_0x2b9ee1[_0xe77d('0x22')],'countagentrejectretry':_0x2b9ee1[_0xe77d('0x23')],'createdAt':_0x2b9ee1[_0xe77d('0x32')],'updatedAt':_0x2b9ee1['updatedAt']};return db['sequelize'][_0xe77d('0x34')](function(_0xe922f5){return db['CmHopperAdditionalPhone'][_0xe77d('0x35')](_0x5f070c,{'where':{'id':_0x2b9ee1['id']}},{'transaction':_0xe922f5})['then'](function(){return db['CmHopper']['update'](_0x3dc0a5,{'where':{'id':_0x392a0d['id']}},{'transaction':_0xe922f5});});})[_0xe77d('0xb')](function(_0x1a28a6){_0x62ab15({'id':_0x392a0d['id'],'phone':_0x2b9ee1[_0xe77d('0x31')]});})[_0xe77d('0x28')](function(_0x46db28){logger[_0xe77d('0x11')](_0xe77d('0x36'),_0x46db28[_0xe77d('0x12')]);_0x349497({'error':_0x46db28['message']});});});}exports[_0xe77d('0x37')]=function(_0x4acbfa){var _0x476c4e=this;return new Promise(function(_0x385f26,_0x3c766a){return db[_0xe77d('0x38')][_0xe77d('0x35')](_0x4acbfa['body']['field'],{'where':{'id':_0x4acbfa[_0xe77d('0x17')]['id']}})[_0xe77d('0xb')](function(_0x5b4321){_0x385f26(_0x5b4321);})['catch'](function(_0x3f909c){logger[_0xe77d('0x11')](_0xe77d('0x37'),_0x3f909c['message']);_0x3c766a(_0x476c4e[_0xe77d('0x11')](0x1f4,_0x3f909c['message']));});});}; \ No newline at end of file +var _0x4732=['dialGlobalMaxRetry','countnoanswerretry','countdropretry','SwapAdditionalPhones','CmHopper','duration','waitTime','scheduledat','add','minutes','countbusyretry','createdAt','updatedAt','isNil','sequelize','transaction','update','IncrementPreviewCounters','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','code','CmHopperAdditionalPhone,\x20%s,\x20%s','error','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity'];(function(_0x1d3350,_0x2766ef){var _0x2649cc=function(_0xe135d1){while(--_0xe135d1){_0x1d3350['push'](_0x1d3350['shift']());}};_0x2649cc(++_0x2766ef);}(_0x4732,0x11b));var _0x2473=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x4732[_0x216008];return _0x4d384f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2473('0x0'));var BPromise=require(_0x2473('0x1'));var rs=require(_0x2473('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2473('0x3'));var logger=require(_0x2473('0x4'))('rpc');var config=require(_0x2473('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2473('0x6')][_0x2473('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ccc10,_0x57912c,_0x513645){return new BPromise(function(_0x38b529,_0x175606){return client['request'](_0x4ccc10,_0x513645)[_0x2473('0x8')](function(_0x3ddfb2){logger[_0x2473('0x9')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x57912c,_0x2473('0xa'));logger['debug'](_0x2473('0xb'),_0x57912c,_0x2473('0xa'),JSON[_0x2473('0xc')](_0x3ddfb2));if(_0x3ddfb2['error']){if(_0x3ddfb2['error'][_0x2473('0xd')]===0x1f4){logger['error'](_0x2473('0xe'),_0x57912c,_0x3ddfb2[_0x2473('0xf')][_0x2473('0x10')]);return _0x175606(_0x3ddfb2['error'][_0x2473('0x10')]);}logger[_0x2473('0xf')](_0x2473('0xe'),_0x57912c,_0x3ddfb2[_0x2473('0xf')][_0x2473('0x10')]);return _0x38b529(_0x3ddfb2[_0x2473('0xf')][_0x2473('0x10')]);}else{logger[_0x2473('0x9')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x57912c,_0x2473('0xa'));_0x38b529(_0x3ddfb2[_0x2473('0x11')][_0x2473('0x10')]);}})[_0x2473('0x12')](function(_0x529937){logger[_0x2473('0xf')](_0x2473('0xe'),_0x57912c,_0x529937);_0x175606(_0x529937);});});}exports[_0x2473('0x13')]=function(_0x480b7b){var _0x50d476=this;return new Promise(function(_0x3b5333,_0x4e196c){return db['CmHopper'][_0x2473('0x14')]({'raw':!![],'where':{'ContactId':_0x480b7b[_0x2473('0x15')][_0x2473('0x16')],'ListId':_0x480b7b['body'][_0x2473('0x17')],'VoiceQueueId':_0x480b7b[_0x2473('0x15')][_0x2473('0x18')]===undefined?null:_0x480b7b[_0x2473('0x15')]['VoiceQueueId'],'CampaignId':_0x480b7b[_0x2473('0x15')][_0x2473('0x19')]===undefined?null:_0x480b7b[_0x2473('0x15')]['CampaignId']}})[_0x2473('0x8')](function(_0x3f93d2){if(_0x3f93d2!=null){return db[_0x2473('0x1a')][_0x2473('0x14')]({'raw':!![],'where':{'CmHopperId':_0x3f93d2['id'],'OrderBy':{'$gt':_0x3f93d2['OrderBy']}},'order':[[_0x2473('0x1b'),_0x2473('0x1c')]]})[_0x2473('0x8')](function(_0x55d4f6){var _0x352da3=0x0;if(_0x55d4f6){if(_0x55d4f6['countbusyretry']+_0x55d4f6[_0x2473('0x1d')]+_0x55d4f6['countnoanswerretry']+_0x55d4f6[_0x2473('0x1e')]+_0x55d4f6['countdropretry']+_0x55d4f6[_0x2473('0x1f')]+_0x55d4f6[_0x2473('0x20')]+_0x55d4f6[_0x2473('0x21')]<_0x480b7b[_0x2473('0x22')][_0x2473('0x23')])_0x352da3=0x1;_0x3b5333({'additional':_0x352da3});}else{return db['CmHopperAdditionalPhone'][_0x2473('0x14')]({'raw':!![],'where':{'CmHopperId':_0x3f93d2['id']},'order':[['OrderBy',_0x2473('0x1c')]]})[_0x2473('0x8')](function(_0x407c3c){var _0x15bf97=0x0;if(_0x407c3c){if(_0x407c3c['countbusyretry']+_0x407c3c['countcongestionretry']+_0x407c3c[_0x2473('0x24')]+_0x407c3c[_0x2473('0x1e')]+_0x407c3c[_0x2473('0x25')]+_0x407c3c[_0x2473('0x1f')]+_0x407c3c['countmachineretry']+_0x407c3c[_0x2473('0x21')]<_0x480b7b[_0x2473('0x22')][_0x2473('0x23')])_0x15bf97=0x1;_0x3b5333({'additional':_0x15bf97});}else{_0x3b5333({'additional':0x0});}})[_0x2473('0x12')](function(_0x5b5af0){logger[_0x2473('0xf')](_0x2473('0x13'),_0x5b5af0['message']);_0x4e196c(_0x50d476[_0x2473('0xf')](0x1f4,_0x5b5af0['message']));});}})['catch'](function(_0x5f4454){logger[_0x2473('0xf')](_0x2473('0x13'),_0x5f4454[_0x2473('0x10')]);_0x4e196c(_0x50d476[_0x2473('0xf')](0x1f4,_0x5f4454[_0x2473('0x10')]));});}else _0x3b5333({'additional':0x0});});});};exports[_0x2473('0x26')]=function(_0x3a7a98){var _0x168da2=this;return new Promise(function(_0x340e1d,_0x11eac5){return db[_0x2473('0x27')][_0x2473('0x14')]({'raw':!![],'where':{'ContactId':_0x3a7a98[_0x2473('0x15')]['ContactId'],'ListId':_0x3a7a98[_0x2473('0x15')][_0x2473('0x17')],'VoiceQueueId':_0x3a7a98[_0x2473('0x15')][_0x2473('0x18')]===undefined?null:_0x3a7a98[_0x2473('0x15')]['VoiceQueueId'],'CampaignId':_0x3a7a98['body'][_0x2473('0x19')]===undefined?null:_0x3a7a98[_0x2473('0x15')][_0x2473('0x19')]}})[_0x2473('0x8')](function(_0x2516c7){if(_0x2516c7!=null){return db[_0x2473('0x1a')][_0x2473('0x14')]({'raw':!![],'where':{'CmHopperId':_0x2516c7['id'],'OrderBy':{'$gte':_0x2516c7['OrderBy']}},'order':[['OrderBy','ASC']]})['then'](function(_0x40e96b){if(_0x40e96b)return activateAdditionalPhone(_0x2516c7,_0x3a7a98[_0x2473('0x15')],_0x40e96b,_0x3a7a98[_0x2473('0x28')],_0x3a7a98[_0x2473('0x29')])[_0x2473('0x8')](function(_0x7e29d3){_0x340e1d(_0x7e29d3);});else{return db[_0x2473('0x1a')][_0x2473('0x14')]({'raw':!![],'where':{'CmHopperId':_0x2516c7['id']},'order':[['OrderBy',_0x2473('0x1c')]]})['then'](function(_0x43c3e6){if(_0x43c3e6)return activateAdditionalPhone(_0x2516c7,_0x3a7a98[_0x2473('0x15')],_0x43c3e6,_0x3a7a98['duration'],_0x3a7a98['waitTime'])['then'](function(_0x309bac){_0x340e1d(_0x309bac);});else{_0x340e1d({'id':_0x2516c7['id'],'phone':''});}})[_0x2473('0x12')](function(_0x381d50){logger['error'](_0x2473('0x13'),_0x381d50['message']);_0x11eac5(_0x168da2[_0x2473('0xf')](0x1f4,_0x381d50[_0x2473('0x10')]));});}})[_0x2473('0x12')](function(_0x347ea0){logger[_0x2473('0xf')](_0x2473('0x13'),_0x347ea0[_0x2473('0x10')]);_0x11eac5(_0x168da2[_0x2473('0xf')](0x1f4,_0x347ea0[_0x2473('0x10')]));});}else _0x340e1d(0x1);});});};function activateAdditionalPhone(_0x290888,_0x19c20d,_0x418972,_0x182014,_0xfa8d97){return new Promise(function(_0x991acd,_0x59ba60){var _0x3cb2c0;if(_['isNil'](_0x418972[_0x2473('0x2a')])){_0x418972['scheduledat']=moment();}if(moment()>moment(_0x418972['scheduledat'])){_0x3cb2c0=moment()[_0x2473('0x2b')](_0xfa8d97||0x3,_0x2473('0x2c'));}else{if(_0x418972[_0x2473('0x1b')]==0x0){_0x3cb2c0=moment(_0x418972[_0x2473('0x2a')]);}else{_0x3cb2c0=moment()[_0x2473('0x2b')](_0xfa8d97||0x3,_0x2473('0x2c'));}}if(_['isNil'](_0x3cb2c0)){_0x3cb2c0=moment()[_0x2473('0x2b')](_0xfa8d97||0x3,'minutes');}var _0x857276={'phone':_0x290888['phone'],'active':0x0,'OrderBy':_['isNil'](_0x290888[_0x2473('0x1b')])?0x0:_0x290888[_0x2473('0x1b')],'scheduledat':moment()[_0x2473('0x2b')](_0x182014||0x1,_0x2473('0x2c')),'countbusyretry':_0x19c20d[_0x2473('0x2d')],'countcongestionretry':_0x19c20d[_0x2473('0x1d')],'countnoanswerretry':_0x19c20d[_0x2473('0x24')],'countnosuchnumberretry':_0x19c20d[_0x2473('0x1e')],'countdropretry':_0x19c20d[_0x2473('0x25')],'countabandonedretry':_0x19c20d[_0x2473('0x1f')],'countmachineretry':_0x19c20d[_0x2473('0x20')],'countagentrejectretry':_0x19c20d[_0x2473('0x21')],'createdAt':_0x19c20d[_0x2473('0x2e')],'updatedAt':_0x19c20d[_0x2473('0x2f')]};var _0x263e7f={'CmHopperId':_0x290888['id'],'phone':_0x418972['phone'],'active':0x0,'OrderBy':_[_0x2473('0x30')](_0x418972[_0x2473('0x1b')])?0x0:_0x418972[_0x2473('0x1b')],'scheduledat':_0x3cb2c0,'countbusyretry':_0x418972['countbusyretry'],'countcongestionretry':_0x418972[_0x2473('0x1d')],'countnoanswerretry':_0x418972[_0x2473('0x24')],'countnosuchnumberretry':_0x418972[_0x2473('0x1e')],'countdropretry':_0x418972[_0x2473('0x25')],'countabandonedretry':_0x418972[_0x2473('0x1f')],'countmachineretry':_0x418972['countmachineretry'],'countagentrejectretry':_0x418972['countagentrejectretry'],'createdAt':_0x418972['createdAt'],'updatedAt':_0x418972['updatedAt']};return db[_0x2473('0x31')][_0x2473('0x32')](function(_0x3991d7){return db['CmHopperAdditionalPhone'][_0x2473('0x33')](_0x857276,{'where':{'id':_0x418972['id']}},{'transaction':_0x3991d7})[_0x2473('0x8')](function(){return db[_0x2473('0x27')]['update'](_0x263e7f,{'where':{'id':_0x290888['id']}},{'transaction':_0x3991d7});});})['then'](function(_0x21b694){_0x991acd({'id':_0x290888['id'],'phone':_0x418972['phone']});})[_0x2473('0x12')](function(_0xa529cf){logger['error']('activateAdditionalPhone',_0xa529cf[_0x2473('0x10')]);_0x59ba60({'error':_0xa529cf[_0x2473('0x10')]});});});}exports[_0x2473('0x34')]=function(_0x393dca){var _0x20cafe=this;return new Promise(function(_0x368739,_0x11cb0f){return db[_0x2473('0x27')][_0x2473('0x33')](_0x393dca[_0x2473('0x15')]['field'],{'where':{'id':_0x393dca[_0x2473('0x15')]['id']}})[_0x2473('0x8')](function(_0x4f1534){_0x368739(_0x4f1534);})[_0x2473('0x12')](function(_0x28a245){logger[_0x2473('0xf')](_0x2473('0x34'),_0x28a245['message']);_0x11cb0f(_0x20cafe[_0x2473('0xf')](0x1f4,_0x28a245[_0x2473('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index f70a123..f0b6ebd 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb477=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get'];(function(_0x53e3c2,_0x90a8fd){var _0x10aa40=function(_0x535ead){while(--_0x535ead){_0x53e3c2['push'](_0x53e3c2['shift']());}};_0x10aa40(++_0x90a8fd);}(_0xb477,0x8f));var _0x7b47=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb477[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require(_0x7b47('0x0'));var path=require(_0x7b47('0x1'));var timeout=require(_0x7b47('0x2'));var express=require('express');var router=express[_0x7b47('0x3')]();var fs_extra=require(_0x7b47('0x4'));var auth=require(_0x7b47('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b47('0x6'));var controller=require(_0x7b47('0x7'));router[_0x7b47('0x8')]('/',auth[_0x7b47('0x9')](),controller[_0x7b47('0xa')]);router['get'](_0x7b47('0xb'),auth[_0x7b47('0x9')](),controller['show']);router[_0x7b47('0xc')]('/',auth[_0x7b47('0x9')](),controller[_0x7b47('0xd')]);router[_0x7b47('0xe')](_0x7b47('0xb'),auth[_0x7b47('0x9')](),controller[_0x7b47('0xf')]);router[_0x7b47('0x10')](_0x7b47('0xb'),auth[_0x7b47('0x9')](),controller[_0x7b47('0x11')]);module[_0x7b47('0x12')]=router; \ No newline at end of file +var _0xa769=['fs-extra','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','express'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa769,0xfb));var _0x9a76=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa769[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x9a76('0x0'));var util=require('util');var path=require(_0x9a76('0x1'));var timeout=require(_0x9a76('0x2'));var express=require(_0x9a76('0x3'));var router=express['Router']();var fs_extra=require(_0x9a76('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a76('0x5'));var controller=require(_0x9a76('0x6'));router['get']('/',auth[_0x9a76('0x7')](),controller[_0x9a76('0x8')]);router[_0x9a76('0x9')](_0x9a76('0xa'),auth[_0x9a76('0x7')](),controller[_0x9a76('0xb')]);router[_0x9a76('0xc')]('/',auth['isAuthenticated'](),controller[_0x9a76('0xd')]);router[_0x9a76('0xe')](_0x9a76('0xa'),auth[_0x9a76('0x7')](),controller['update']);router['delete'](_0x9a76('0xa'),auth['isAuthenticated'](),controller[_0x9a76('0xf')]);module[_0x9a76('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9a679d4..f5a749c 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 _0x6379=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x31c1a4,_0x3b6535){var _0x534593=function(_0x3ca0be){while(--_0x3ca0be){_0x31c1a4['push'](_0x31c1a4['shift']());}};_0x534593(++_0x3b6535);}(_0x6379,0x84));var _0x9637=function(_0xc372ad,_0x127805){_0xc372ad=_0xc372ad-0x0;var _0x552674=_0x6379[_0xc372ad];return _0x552674;};'use strict';var moment=require(_0x9637('0x0'));var Sequelize=require(_0x9637('0x1'));module[_0x9637('0x2')]={'phone':{'type':Sequelize[_0x9637('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9637('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x9637('0x4')],'unique':_0x9637('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x71ab=['sequelize','STRING','contactListQueue','INTEGER'];(function(_0x33adeb,_0x2a9393){var _0x579bed=function(_0x429cde){while(--_0x429cde){_0x33adeb['push'](_0x33adeb['shift']());}};_0x579bed(++_0x2a9393);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var moment=require('moment');var Sequelize=require(_0xb71a('0x0'));module['exports']={'phone':{'type':Sequelize[_0xb71a('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xb71a('0x2')},'ListId':{'type':Sequelize[_0xb71a('0x3')],'unique':_0xb71a('0x2')},'VoiceQueueId':{'type':Sequelize[_0xb71a('0x3')],'unique':_0xb71a('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ea5c6bb..2a80b2a 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 _0xc9e0=['save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','where','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x56a33d,_0x55c23b){var _0x207fa4=function(_0x2f750a){while(--_0x2f750a){_0x56a33d['push'](_0x56a33d['shift']());}};_0x207fa4(++_0x55c23b);}(_0xc9e0,0x106));var _0x0c9e=function(_0x553ef4,_0x402159){_0x553ef4=_0x553ef4-0x0;var _0x5a6c70=_0xc9e0[_0x553ef4];return _0x5a6c70;};'use strict';var emlformat=require(_0x0c9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c9e('0x1'));var jsonpatch=require(_0x0c9e('0x2'));var rp=require(_0x0c9e('0x3'));var moment=require('moment');var BPromise=require(_0x0c9e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0c9e('0x5'));var csv=require(_0x0c9e('0x6'));var ejs=require(_0x0c9e('0x7'));var fs=require('fs');var fs_extra=require(_0x0c9e('0x8'));var _=require(_0x0c9e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0c9e('0xa'));var deskjs=require(_0x0c9e('0xb'));var toCsv=require(_0x0c9e('0x6'));var querystring=require(_0x0c9e('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0c9e('0xd'));var qs=require(_0x0c9e('0xe'));var as=require(_0x0c9e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c9e('0x10'))('api');var utils=require(_0x0c9e('0x11'));var config=require(_0x0c9e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c9e('0x13'))['db'];function respondWithStatusCode(_0x522d5f,_0x5c4f17){_0x5c4f17=_0x5c4f17||0xcc;return function(_0x191adb){if(_0x191adb){return _0x522d5f[_0x0c9e('0x14')](_0x5c4f17);}return _0x522d5f[_0x0c9e('0x15')](_0x5c4f17)['end']();};}function respondWithResult(_0x39358d,_0x2d1e7c){_0x2d1e7c=_0x2d1e7c||0xc8;return function(_0x3e7bb2){if(_0x3e7bb2){return _0x39358d[_0x0c9e('0x15')](_0x2d1e7c)[_0x0c9e('0x16')](_0x3e7bb2);}};}function respondWithFilteredResult(_0x5857e9,_0x5f538c){return function(_0x14e7e1){if(_0x14e7e1){var _0x23e51a=typeof _0x5f538c['offset']===_0x0c9e('0x17')&&typeof _0x5f538c[_0x0c9e('0x18')]===_0x0c9e('0x17');var _0x2a7421=_0x14e7e1[_0x0c9e('0x19')];var _0xec452a=_0x23e51a?0x0:_0x5f538c[_0x0c9e('0x1a')];var _0xb99fc4=_0x23e51a?_0x14e7e1['count']:_0x5f538c[_0x0c9e('0x1a')]+_0x5f538c[_0x0c9e('0x18')];var _0x402d0c;if(_0xb99fc4>=_0x2a7421){_0xb99fc4=_0x2a7421;_0x402d0c=0xc8;}else{_0x402d0c=0xce;}_0x5857e9[_0x0c9e('0x15')](_0x402d0c);return _0x5857e9[_0x0c9e('0x1b')](_0x0c9e('0x1c'),_0xec452a+'-'+_0xb99fc4+'/'+_0x2a7421)[_0x0c9e('0x16')](_0x14e7e1);}return null;};}function patchUpdates(_0x410056){return function(_0x25a9e3){try{jsonpatch[_0x0c9e('0x1d')](_0x25a9e3,_0x410056,!![]);}catch(_0x2be307){return BPromise['reject'](_0x2be307);}return _0x25a9e3[_0x0c9e('0x1e')]();};}function saveUpdates(_0x537f97,_0x3d656b){return function(_0x384733){if(_0x384733){return _0x384733[_0x0c9e('0x1f')](_0x537f97)[_0x0c9e('0x20')](function(_0x4d961e){return _0x4d961e;});}return null;};}function removeEntity(_0x809662,_0x1dcead){return function(_0x515570){if(_0x515570){return _0x515570[_0x0c9e('0x21')]()[_0x0c9e('0x20')](function(){_0x809662[_0x0c9e('0x15')](0xcc)[_0x0c9e('0x22')]();});}};}function handleEntityNotFound(_0x38241a,_0x469a36){return function(_0x499189){if(!_0x499189){_0x38241a[_0x0c9e('0x14')](0x194);}return _0x499189;};}function handleError(_0x3420b2,_0x473f7b){_0x473f7b=_0x473f7b||0x1f4;return function(_0x590675){logger[_0x0c9e('0x23')](_0x590675[_0x0c9e('0x24')]);if(_0x590675['name']){delete _0x590675[_0x0c9e('0x25')];}_0x3420b2[_0x0c9e('0x15')](_0x473f7b)[_0x0c9e('0x26')](_0x590675);};}exports[_0x0c9e('0x27')]=function(_0x13c345,_0x1b2d08){var _0x423347={},_0x6485ce={},_0x438737={'count':0x0,'rows':[]};var _0x433374=_[_0x0c9e('0x28')](db[_0x0c9e('0x29')]['rawAttributes'],function(_0x487c20){return{'name':_0x487c20[_0x0c9e('0x2a')],'type':_0x487c20[_0x0c9e('0x2b')][_0x0c9e('0x2c')]};});_0x6485ce['model']=_[_0x0c9e('0x28')](_0x433374,'name');_0x6485ce[_0x0c9e('0x2d')]=_['keys'](_0x13c345['query']);_0x6485ce[_0x0c9e('0x2e')]=_[_0x0c9e('0x2f')](_0x6485ce[_0x0c9e('0x30')],_0x6485ce[_0x0c9e('0x2d')]);_0x423347[_0x0c9e('0x31')]=_[_0x0c9e('0x2f')](_0x6485ce[_0x0c9e('0x30')],qs[_0x0c9e('0x32')](_0x13c345['query']['fields']));_0x423347[_0x0c9e('0x31')]=_0x423347[_0x0c9e('0x31')][_0x0c9e('0x33')]?_0x423347[_0x0c9e('0x31')]:_0x6485ce[_0x0c9e('0x30')];if(!_0x13c345[_0x0c9e('0x2d')][_0x0c9e('0x34')](_0x0c9e('0x35'))){_0x423347[_0x0c9e('0x18')]=qs[_0x0c9e('0x18')](_0x13c345[_0x0c9e('0x2d')][_0x0c9e('0x18')]);_0x423347[_0x0c9e('0x1a')]=qs[_0x0c9e('0x1a')](_0x13c345[_0x0c9e('0x2d')][_0x0c9e('0x1a')]);}_0x423347[_0x0c9e('0x36')]=qs[_0x0c9e('0x37')](_0x13c345[_0x0c9e('0x2d')]['sort']);_0x423347['where']=qs[_0x0c9e('0x2e')](_[_0x0c9e('0x38')](_0x13c345[_0x0c9e('0x2d')],_0x6485ce[_0x0c9e('0x2e')]),_0x433374);if(_0x13c345[_0x0c9e('0x2d')]['filter']){_0x423347['where']=_['merge'](_0x423347['where'],{'$or':_[_0x0c9e('0x28')](_0x433374,function(_0x141811){if(_0x141811[_0x0c9e('0x2b')]!==_0x0c9e('0x39')){var _0x3e1389={};_0x3e1389[_0x141811[_0x0c9e('0x25')]]={'$like':'%'+_0x13c345[_0x0c9e('0x2d')][_0x0c9e('0x3a')]+'%'};return _0x3e1389;}})});}_0x423347=_[_0x0c9e('0x3b')]({},_0x423347,_0x13c345[_0x0c9e('0x3c')]);var _0x4e1097={'where':_0x423347[_0x0c9e('0x3d')]};return db[_0x0c9e('0x29')]['count'](_0x4e1097)[_0x0c9e('0x20')](function(_0x2a70ef){_0x438737[_0x0c9e('0x19')]=_0x2a70ef;if(_0x13c345[_0x0c9e('0x2d')][_0x0c9e('0x3e')]){_0x423347[_0x0c9e('0x3f')]=[{'all':!![]}];}return db[_0x0c9e('0x29')]['findAll'](_0x423347);})[_0x0c9e('0x20')](function(_0x460145){_0x438737[_0x0c9e('0x40')]=_0x460145;return _0x438737;})[_0x0c9e('0x20')](respondWithFilteredResult(_0x1b2d08,_0x423347))[_0x0c9e('0x41')](handleError(_0x1b2d08,null));};exports[_0x0c9e('0x42')]=function(_0x589167,_0x4e4b0d){var _0x1a4c78={'raw':!![],'where':{'id':_0x589167[_0x0c9e('0x43')]['id']}},_0xcb5946={};_0xcb5946[_0x0c9e('0x30')]=_[_0x0c9e('0x44')](db[_0x0c9e('0x29')][_0x0c9e('0x45')]);_0xcb5946[_0x0c9e('0x2d')]=_['keys'](_0x589167[_0x0c9e('0x2d')]);_0xcb5946[_0x0c9e('0x2e')]=_['intersection'](_0xcb5946[_0x0c9e('0x30')],_0xcb5946['query']);_0x1a4c78[_0x0c9e('0x31')]=_[_0x0c9e('0x2f')](_0xcb5946[_0x0c9e('0x30')],qs['fields'](_0x589167['query'][_0x0c9e('0x32')]));_0x1a4c78[_0x0c9e('0x31')]=_0x1a4c78[_0x0c9e('0x31')][_0x0c9e('0x33')]?_0x1a4c78[_0x0c9e('0x31')]:_0xcb5946[_0x0c9e('0x30')];if(_0x589167[_0x0c9e('0x2d')]['includeAll']){_0x1a4c78[_0x0c9e('0x3f')]=[{'all':!![]}];}_0x1a4c78=_[_0x0c9e('0x3b')]({},_0x1a4c78,_0x589167['options']);return db[_0x0c9e('0x29')][_0x0c9e('0x46')](_0x1a4c78)[_0x0c9e('0x20')](handleEntityNotFound(_0x4e4b0d,null))['then'](respondWithResult(_0x4e4b0d,null))['catch'](handleError(_0x4e4b0d,null));};exports[_0x0c9e('0x1f')]=function(_0x195da0,_0x4e4922){if(_0x195da0[_0x0c9e('0x47')]['id']){delete _0x195da0['body']['id'];}return db[_0x0c9e('0x29')][_0x0c9e('0x46')]({'where':{'id':_0x195da0['params']['id']}})[_0x0c9e('0x20')](handleEntityNotFound(_0x4e4922,null))[_0x0c9e('0x20')](saveUpdates(_0x195da0[_0x0c9e('0x47')],null))[_0x0c9e('0x20')](respondWithResult(_0x4e4922,null))[_0x0c9e('0x41')](handleError(_0x4e4922,null));};exports[_0x0c9e('0x21')]=function(_0x5ed3c8,_0x3cb4ca){return db[_0x0c9e('0x29')][_0x0c9e('0x46')]({'where':{'id':_0x5ed3c8[_0x0c9e('0x43')]['id']}})[_0x0c9e('0x20')](handleEntityNotFound(_0x3cb4ca,null))['then'](removeEntity(_0x3cb4ca,null))[_0x0c9e('0x41')](handleError(_0x3cb4ca,null));};exports[_0x0c9e('0x48')]=function(_0x52efcf,_0x5e5aa9){return db[_0x0c9e('0x29')]['describe']()['then'](respondWithResult(_0x5e5aa9,null))['catch'](handleError(_0x5e5aa9,null));}; \ No newline at end of file +var _0xdb00=['fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x127394,_0x66443b){var _0x557fd9=function(_0x3a2043){while(--_0x3a2043){_0x127394['push'](_0x127394['shift']());}};_0x557fd9(++_0x66443b);}(_0xdb00,0xd4));var _0x0db0=function(_0x1978cf,_0x106e44){_0x1978cf=_0x1978cf-0x0;var _0x7ec3f5=_0xdb00[_0x1978cf];return _0x7ec3f5;};'use strict';var emlformat=require(_0x0db0('0x0'));var rimraf=require(_0x0db0('0x1'));var zipdir=require(_0x0db0('0x2'));var jsonpatch=require(_0x0db0('0x3'));var rp=require(_0x0db0('0x4'));var moment=require(_0x0db0('0x5'));var BPromise=require(_0x0db0('0x6'));var Mustache=require(_0x0db0('0x7'));var util=require(_0x0db0('0x8'));var path=require(_0x0db0('0x9'));var sox=require(_0x0db0('0xa'));var csv=require(_0x0db0('0xb'));var ejs=require(_0x0db0('0xc'));var fs=require('fs');var fs_extra=require(_0x0db0('0xd'));var _=require(_0x0db0('0xe'));var squel=require(_0x0db0('0xf'));var crypto=require('crypto');var jsforce=require(_0x0db0('0x10'));var deskjs=require(_0x0db0('0x11'));var toCsv=require(_0x0db0('0xb'));var querystring=require(_0x0db0('0x12'));var Papa=require('papaparse');var Redis=require(_0x0db0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0db0('0x14'));var as=require(_0x0db0('0x15'));var hardwareService=require(_0x0db0('0x16'));var logger=require(_0x0db0('0x17'))(_0x0db0('0x18'));var utils=require(_0x0db0('0x19'));var config=require(_0x0db0('0x1a'));var licenseUtil=require(_0x0db0('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1292c6,_0x5788b4){_0x5788b4=_0x5788b4||0xcc;return function(_0x1a8b5c){if(_0x1a8b5c){return _0x1292c6[_0x0db0('0x1c')](_0x5788b4);}return _0x1292c6[_0x0db0('0x1d')](_0x5788b4)['end']();};}function respondWithResult(_0x409ee4,_0x1cad2a){_0x1cad2a=_0x1cad2a||0xc8;return function(_0x90c02e){if(_0x90c02e){return _0x409ee4[_0x0db0('0x1d')](_0x1cad2a)[_0x0db0('0x1e')](_0x90c02e);}};}function respondWithFilteredResult(_0x4e1bef,_0x423e4b){return function(_0x27e15d){if(_0x27e15d){var _0x158a83=typeof _0x423e4b[_0x0db0('0x1f')]==='undefined'&&typeof _0x423e4b[_0x0db0('0x20')]==='undefined';var _0x3be718=_0x27e15d[_0x0db0('0x21')];var _0xc138a8=_0x158a83?0x0:_0x423e4b['offset'];var _0x33c181=_0x158a83?_0x27e15d[_0x0db0('0x21')]:_0x423e4b[_0x0db0('0x1f')]+_0x423e4b['limit'];var _0x22aeae;if(_0x33c181>=_0x3be718){_0x33c181=_0x3be718;_0x22aeae=0xc8;}else{_0x22aeae=0xce;}_0x4e1bef['status'](_0x22aeae);return _0x4e1bef['set'](_0x0db0('0x22'),_0xc138a8+'-'+_0x33c181+'/'+_0x3be718)[_0x0db0('0x1e')](_0x27e15d);}return null;};}function patchUpdates(_0x9394bd){return function(_0x16993d){try{jsonpatch['apply'](_0x16993d,_0x9394bd,!![]);}catch(_0x7f85b3){return BPromise[_0x0db0('0x23')](_0x7f85b3);}return _0x16993d['save']();};}function saveUpdates(_0x44d63b,_0x37e292){return function(_0x5d731d){if(_0x5d731d){return _0x5d731d[_0x0db0('0x24')](_0x44d63b)[_0x0db0('0x25')](function(_0x243960){return _0x243960;});}return null;};}function removeEntity(_0x1a25e2,_0x2dfc15){return function(_0x53aa31){if(_0x53aa31){return _0x53aa31[_0x0db0('0x26')]()['then'](function(){_0x1a25e2[_0x0db0('0x1d')](0xcc)[_0x0db0('0x27')]();});}};}function handleEntityNotFound(_0x385ebf,_0x21cf38){return function(_0x335c81){if(!_0x335c81){_0x385ebf[_0x0db0('0x1c')](0x194);}return _0x335c81;};}function handleError(_0xc2a1c7,_0x173cd7){_0x173cd7=_0x173cd7||0x1f4;return function(_0x221943){logger[_0x0db0('0x28')](_0x221943[_0x0db0('0x29')]);if(_0x221943[_0x0db0('0x2a')]){delete _0x221943[_0x0db0('0x2a')];}_0xc2a1c7['status'](_0x173cd7)[_0x0db0('0x2b')](_0x221943);};}exports[_0x0db0('0x2c')]=function(_0x36aeb0,_0x37b84f){var _0x415997={},_0x34d756={},_0x3d032d={'count':0x0,'rows':[]};var _0x47a0e4=_[_0x0db0('0x2d')](db[_0x0db0('0x2e')][_0x0db0('0x2f')],function(_0x39c593){return{'name':_0x39c593[_0x0db0('0x30')],'type':_0x39c593[_0x0db0('0x31')][_0x0db0('0x32')]};});_0x34d756[_0x0db0('0x33')]=_[_0x0db0('0x2d')](_0x47a0e4,_0x0db0('0x2a'));_0x34d756[_0x0db0('0x34')]=_[_0x0db0('0x35')](_0x36aeb0[_0x0db0('0x34')]);_0x34d756[_0x0db0('0x36')]=_[_0x0db0('0x37')](_0x34d756['model'],_0x34d756['query']);_0x415997[_0x0db0('0x38')]=_[_0x0db0('0x37')](_0x34d756[_0x0db0('0x33')],qs[_0x0db0('0x39')](_0x36aeb0[_0x0db0('0x34')][_0x0db0('0x39')]));_0x415997[_0x0db0('0x38')]=_0x415997[_0x0db0('0x38')][_0x0db0('0x3a')]?_0x415997[_0x0db0('0x38')]:_0x34d756[_0x0db0('0x33')];if(!_0x36aeb0['query'][_0x0db0('0x3b')](_0x0db0('0x3c'))){_0x415997[_0x0db0('0x20')]=qs[_0x0db0('0x20')](_0x36aeb0[_0x0db0('0x34')][_0x0db0('0x20')]);_0x415997[_0x0db0('0x1f')]=qs[_0x0db0('0x1f')](_0x36aeb0['query']['offset']);}_0x415997[_0x0db0('0x3d')]=qs[_0x0db0('0x3e')](_0x36aeb0['query']['sort']);_0x415997['where']=qs[_0x0db0('0x36')](_['pick'](_0x36aeb0[_0x0db0('0x34')],_0x34d756['filters']),_0x47a0e4);if(_0x36aeb0[_0x0db0('0x34')]['filter']){_0x415997[_0x0db0('0x3f')]=_[_0x0db0('0x40')](_0x415997['where'],{'$or':_[_0x0db0('0x2d')](_0x47a0e4,function(_0x31b903){if(_0x31b903[_0x0db0('0x31')]!=='VIRTUAL'){var _0x54f638={};_0x54f638[_0x31b903[_0x0db0('0x2a')]]={'$like':'%'+_0x36aeb0[_0x0db0('0x34')]['filter']+'%'};return _0x54f638;}})});}_0x415997=_[_0x0db0('0x40')]({},_0x415997,_0x36aeb0[_0x0db0('0x41')]);var _0x11a21a={'where':_0x415997[_0x0db0('0x3f')]};return db[_0x0db0('0x2e')]['count'](_0x11a21a)[_0x0db0('0x25')](function(_0x48a240){_0x3d032d[_0x0db0('0x21')]=_0x48a240;if(_0x36aeb0[_0x0db0('0x34')][_0x0db0('0x42')]){_0x415997[_0x0db0('0x43')]=[{'all':!![]}];}return db[_0x0db0('0x2e')][_0x0db0('0x44')](_0x415997);})[_0x0db0('0x25')](function(_0x278260){_0x3d032d[_0x0db0('0x45')]=_0x278260;return _0x3d032d;})[_0x0db0('0x25')](respondWithFilteredResult(_0x37b84f,_0x415997))[_0x0db0('0x46')](handleError(_0x37b84f,null));};exports['show']=function(_0x2c62f9,_0x2055a7){var _0x305a83={'raw':!![],'where':{'id':_0x2c62f9[_0x0db0('0x47')]['id']}},_0x5e9509={};_0x5e9509[_0x0db0('0x33')]=_[_0x0db0('0x35')](db[_0x0db0('0x2e')]['rawAttributes']);_0x5e9509[_0x0db0('0x34')]=_[_0x0db0('0x35')](_0x2c62f9['query']);_0x5e9509[_0x0db0('0x36')]=_[_0x0db0('0x37')](_0x5e9509['model'],_0x5e9509[_0x0db0('0x34')]);_0x305a83[_0x0db0('0x38')]=_[_0x0db0('0x37')](_0x5e9509[_0x0db0('0x33')],qs[_0x0db0('0x39')](_0x2c62f9['query'][_0x0db0('0x39')]));_0x305a83['attributes']=_0x305a83[_0x0db0('0x38')][_0x0db0('0x3a')]?_0x305a83['attributes']:_0x5e9509[_0x0db0('0x33')];if(_0x2c62f9[_0x0db0('0x34')][_0x0db0('0x42')]){_0x305a83[_0x0db0('0x43')]=[{'all':!![]}];}_0x305a83=_[_0x0db0('0x40')]({},_0x305a83,_0x2c62f9[_0x0db0('0x41')]);return db[_0x0db0('0x2e')][_0x0db0('0x48')](_0x305a83)[_0x0db0('0x25')](handleEntityNotFound(_0x2055a7,null))['then'](respondWithResult(_0x2055a7,null))[_0x0db0('0x46')](handleError(_0x2055a7,null));};exports['update']=function(_0x506467,_0xcf4217){if(_0x506467[_0x0db0('0x49')]['id']){delete _0x506467[_0x0db0('0x49')]['id'];}return db[_0x0db0('0x2e')][_0x0db0('0x48')]({'where':{'id':_0x506467[_0x0db0('0x47')]['id']}})['then'](handleEntityNotFound(_0xcf4217,null))[_0x0db0('0x25')](saveUpdates(_0x506467['body'],null))['then'](respondWithResult(_0xcf4217,null))[_0x0db0('0x46')](handleError(_0xcf4217,null));};exports[_0x0db0('0x26')]=function(_0x31baa0,_0x199f1e){return db[_0x0db0('0x2e')][_0x0db0('0x48')]({'where':{'id':_0x31baa0[_0x0db0('0x47')]['id']}})[_0x0db0('0x25')](handleEntityNotFound(_0x199f1e,null))[_0x0db0('0x25')](removeEntity(_0x199f1e,null))[_0x0db0('0x46')](handleError(_0x199f1e,null));};exports[_0x0db0('0x4a')]=function(_0x5eeb97,_0x2cdea7){return db['CmHopperBlack'][_0x0db0('0x4a')]()[_0x0db0('0x25')](respondWithResult(_0x2cdea7,null))[_0x0db0('0x46')](handleError(_0x2cdea7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6b2e941..3c0e2d3 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 _0x49d0=['api','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x49d0,0xa3));var _0x049d=function(_0x4461ee,_0x3d4695){_0x4461ee=_0x4461ee-0x0;var _0x46a516=_0x49d0[_0x4461ee];return _0x46a516;};'use strict';var _=require('lodash');var util=require(_0x049d('0x0'));var logger=require(_0x049d('0x1'))(_0x049d('0x2'));var moment=require('moment');var BPromise=require(_0x049d('0x3'));var rp=require(_0x049d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x049d('0x5'));var config=require('../../config/environment');var attributes=require(_0x049d('0x6'));module[_0x049d('0x7')]=function(_0xbb3f91,_0x8c2b06){return _0xbb3f91[_0x049d('0x8')](_0x049d('0x9'),attributes,{'tableName':_0x049d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd430=['moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','api'];(function(_0x27d517,_0x8e5a42){var _0x2c9c65=function(_0x132259){while(--_0x132259){_0x27d517['push'](_0x27d517['shift']());}};_0x2c9c65(++_0x8e5a42);}(_0xd430,0xfc));var _0x0d43=function(_0x33ceeb,_0x58b863){_0x33ceeb=_0x33ceeb-0x0;var _0x5b6556=_0xd430[_0x33ceeb];return _0x5b6556;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0d43('0x0'));var moment=require(_0x0d43('0x1'));var BPromise=require(_0x0d43('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d43('0x3'));var rimraf=require(_0x0d43('0x4'));var config=require(_0x0d43('0x5'));var attributes=require(_0x0d43('0x6'));module[_0x0d43('0x7')]=function(_0x1da209,_0x2b4448){return _0x1da209[_0x0d43('0x8')](_0x0d43('0x9'),attributes,{'tableName':_0x0d43('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 0feb8ef..048e584 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 _0xbb68=['body','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','map','include','model','attributes','UpdateCmHopperBlack','update'];(function(_0x48d596,_0x828ed){var _0x4c0993=function(_0x1bda19){while(--_0x1bda19){_0x48d596['push'](_0x48d596['shift']());}};_0x4c0993(++_0x828ed);}(_0xbb68,0x194));var _0x8bb6=function(_0x1445ba,_0x5394e9){_0x1445ba=_0x1445ba-0x0;var _0x322277=_0xbb68[_0x1445ba];return _0x322277;};'use strict';var _=require(_0x8bb6('0x0'));var util=require(_0x8bb6('0x1'));var moment=require(_0x8bb6('0x2'));var BPromise=require(_0x8bb6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bb6('0x4'));var db=require(_0x8bb6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bb6('0x6'))(_0x8bb6('0x7'));var config=require('../../config/environment');var jayson=require(_0x8bb6('0x8'));var client=jayson[_0x8bb6('0x9')][_0x8bb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd83476,_0x5a5451,_0x23992f){return new BPromise(function(_0x3d329a,_0x50e806){return client[_0x8bb6('0xb')](_0xd83476,_0x23992f)[_0x8bb6('0xc')](function(_0xda3eda){logger[_0x8bb6('0xd')](_0x8bb6('0xe'),_0x5a5451,_0x8bb6('0xf'));logger[_0x8bb6('0x10')](_0x8bb6('0x11'),_0x5a5451,_0x8bb6('0xf'),JSON[_0x8bb6('0x12')](_0xda3eda));if(_0xda3eda[_0x8bb6('0x13')]){if(_0xda3eda[_0x8bb6('0x13')][_0x8bb6('0x14')]===0x1f4){logger[_0x8bb6('0x13')](_0x8bb6('0xe'),_0x5a5451,_0xda3eda[_0x8bb6('0x13')][_0x8bb6('0x15')]);return _0x50e806(_0xda3eda[_0x8bb6('0x13')]['message']);}logger[_0x8bb6('0x13')](_0x8bb6('0xe'),_0x5a5451,_0xda3eda['error'][_0x8bb6('0x15')]);return _0x3d329a(_0xda3eda[_0x8bb6('0x13')][_0x8bb6('0x15')]);}else{logger[_0x8bb6('0xd')](_0x8bb6('0xe'),_0x5a5451,_0x8bb6('0xf'));_0x3d329a(_0xda3eda[_0x8bb6('0x16')][_0x8bb6('0x15')]);}})[_0x8bb6('0x17')](function(_0x1686ff){logger['error'](_0x8bb6('0xe'),_0x5a5451,_0x1686ff);_0x50e806(_0x1686ff);});});}exports[_0x8bb6('0x18')]=function(_0x5a9f39){var _0x54c374=this;return new Promise(function(_0x4db284,_0x82da23){return db[_0x8bb6('0x19')][_0x8bb6('0x1a')]({'raw':_0x5a9f39[_0x8bb6('0x1b')]?_0x5a9f39['options'][_0x8bb6('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a9f39[_0x8bb6('0x1b')]?_0x5a9f39[_0x8bb6('0x1b')][_0x8bb6('0x1d')]||null:null,'attributes':_0x5a9f39[_0x8bb6('0x1b')]?_0x5a9f39['options']['attributes']||null:null,'limit':_0x5a9f39[_0x8bb6('0x1b')]?_0x5a9f39[_0x8bb6('0x1b')]['limit']||null:null,'include':_0x5a9f39[_0x8bb6('0x1b')]?_0x5a9f39[_0x8bb6('0x1b')]['include']?_[_0x8bb6('0x1e')](_0x5a9f39[_0x8bb6('0x1b')][_0x8bb6('0x1f')],function(_0x3522ae){return{'model':db[_0x3522ae[_0x8bb6('0x20')]],'as':_0x3522ae['as'],'attributes':_0x3522ae[_0x8bb6('0x21')],'include':_0x3522ae[_0x8bb6('0x1f')]?_[_0x8bb6('0x1e')](_0x3522ae[_0x8bb6('0x1f')],function(_0x1a3ab7){return{'model':db[_0x1a3ab7[_0x8bb6('0x20')]],'as':_0x1a3ab7['as'],'attributes':_0x1a3ab7[_0x8bb6('0x21')],'include':_0x1a3ab7[_0x8bb6('0x1f')]?_[_0x8bb6('0x1e')](_0x1a3ab7[_0x8bb6('0x1f')],function(_0x31f7f3){return{'model':db[_0x31f7f3[_0x8bb6('0x20')]],'as':_0x31f7f3['as'],'attributes':_0x31f7f3[_0x8bb6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8bb6('0xc')](function(_0x23cc02){logger[_0x8bb6('0xd')](_0x8bb6('0x18'),_0x5a9f39);logger[_0x8bb6('0x10')](_0x8bb6('0x18'),_0x5a9f39,JSON[_0x8bb6('0x12')](_0x23cc02));_0x4db284(_0x23cc02);})[_0x8bb6('0x17')](function(_0x24a979){logger[_0x8bb6('0x13')](_0x8bb6('0x18'),_0x24a979[_0x8bb6('0x15')],_0x5a9f39);_0x82da23(_0x54c374[_0x8bb6('0x13')](0x1f4,_0x24a979[_0x8bb6('0x15')]));});});};exports[_0x8bb6('0x22')]=function(_0x158023){var _0x55fb39=this;return new Promise(function(_0x45eadd,_0x2028f1){return db[_0x8bb6('0x19')][_0x8bb6('0x23')](_0x158023[_0x8bb6('0x24')],{'raw':_0x158023[_0x8bb6('0x1b')]?_0x158023[_0x8bb6('0x1b')][_0x8bb6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x158023['options']?_0x158023[_0x8bb6('0x1b')][_0x8bb6('0x1d')]||null:null,'attributes':_0x158023[_0x8bb6('0x1b')]?_0x158023['options'][_0x8bb6('0x21')]||null:null,'limit':_0x158023[_0x8bb6('0x1b')]?_0x158023['options'][_0x8bb6('0x25')]||null:null})[_0x8bb6('0xc')](function(_0x534f89){logger[_0x8bb6('0xd')](_0x8bb6('0x22'),_0x158023);logger['debug'](_0x8bb6('0x22'),_0x158023,JSON['stringify'](_0x534f89));_0x45eadd(_0x534f89);})[_0x8bb6('0x17')](function(_0x33e1ac){logger[_0x8bb6('0x13')]('UpdateCmHopperBlack',_0x33e1ac[_0x8bb6('0x15')],_0x158023);_0x2028f1(_0x55fb39[_0x8bb6('0x13')](0x1f4,_0x33e1ac[_0x8bb6('0x15')]));});});};exports[_0x8bb6('0x26')]=function(_0x224d22){var _0x5101e0=this;return new Promise(function(_0x4e71f8,_0x5071ce){return db[_0x8bb6('0x19')][_0x8bb6('0x27')]({'where':_0x224d22[_0x8bb6('0x1b')]?_0x224d22[_0x8bb6('0x1b')][_0x8bb6('0x1d')]||null:null})[_0x8bb6('0xc')](function(_0x2697cc){logger[_0x8bb6('0xd')](_0x8bb6('0x26'),_0x224d22);logger[_0x8bb6('0x10')](_0x8bb6('0x26'),_0x224d22,JSON[_0x8bb6('0x12')](_0x2697cc));_0x4e71f8(_0x2697cc);})['catch'](function(_0x37b23d){logger[_0x8bb6('0x13')](_0x8bb6('0x26'),_0x37b23d[_0x8bb6('0x15')],_0x224d22);_0x5071ce(_0x5101e0[_0x8bb6('0x13')](0x1f4,_0x37b23d[_0x8bb6('0x15')]));});});}; \ No newline at end of file +var _0xa8ae=['findAll','options','raw','where','limit','include','map','model','attributes','body','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa8ae,0x1e9));var _0xea8a=function(_0x2c6761,_0x39bd9f){_0x2c6761=_0x2c6761-0x0;var _0x8275b0=_0xa8ae[_0x2c6761];return _0x8275b0;};'use strict';var _=require('lodash');var util=require(_0xea8a('0x0'));var moment=require('moment');var BPromise=require(_0xea8a('0x1'));var rs=require(_0xea8a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xea8a('0x3'));var logger=require(_0xea8a('0x4'))(_0xea8a('0x5'));var config=require(_0xea8a('0x6'));var jayson=require(_0xea8a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x297928,_0x277fb8,_0x2f6ab1){return new BPromise(function(_0x14ea75,_0x247dc9){return client['request'](_0x297928,_0x2f6ab1)[_0xea8a('0x8')](function(_0xe941d4){logger[_0xea8a('0x9')](_0xea8a('0xa'),_0x277fb8,_0xea8a('0xb'));logger[_0xea8a('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x277fb8,_0xea8a('0xb'),JSON[_0xea8a('0xd')](_0xe941d4));if(_0xe941d4[_0xea8a('0xe')]){if(_0xe941d4[_0xea8a('0xe')][_0xea8a('0xf')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x277fb8,_0xe941d4[_0xea8a('0xe')]['message']);return _0x247dc9(_0xe941d4[_0xea8a('0xe')][_0xea8a('0x10')]);}logger[_0xea8a('0xe')](_0xea8a('0xa'),_0x277fb8,_0xe941d4[_0xea8a('0xe')][_0xea8a('0x10')]);return _0x14ea75(_0xe941d4[_0xea8a('0xe')][_0xea8a('0x10')]);}else{logger[_0xea8a('0x9')](_0xea8a('0xa'),_0x277fb8,'request\x20sent');_0x14ea75(_0xe941d4[_0xea8a('0x11')]['message']);}})[_0xea8a('0x12')](function(_0x5a2081){logger['error'](_0xea8a('0xa'),_0x277fb8,_0x5a2081);_0x247dc9(_0x5a2081);});});}exports[_0xea8a('0x13')]=function(_0x2fde6e){var _0x1edf29=this;return new Promise(function(_0x1c3827,_0x5df528){return db[_0xea8a('0x14')][_0xea8a('0x15')]({'raw':_0x2fde6e[_0xea8a('0x16')]?_0x2fde6e[_0xea8a('0x16')][_0xea8a('0x17')]===undefined?!![]:![]:!![],'where':_0x2fde6e[_0xea8a('0x16')]?_0x2fde6e[_0xea8a('0x16')][_0xea8a('0x18')]||null:null,'attributes':_0x2fde6e[_0xea8a('0x16')]?_0x2fde6e[_0xea8a('0x16')]['attributes']||null:null,'limit':_0x2fde6e['options']?_0x2fde6e[_0xea8a('0x16')][_0xea8a('0x19')]||null:null,'include':_0x2fde6e['options']?_0x2fde6e[_0xea8a('0x16')][_0xea8a('0x1a')]?_[_0xea8a('0x1b')](_0x2fde6e[_0xea8a('0x16')][_0xea8a('0x1a')],function(_0x1638cb){return{'model':db[_0x1638cb[_0xea8a('0x1c')]],'as':_0x1638cb['as'],'attributes':_0x1638cb['attributes'],'include':_0x1638cb['include']?_[_0xea8a('0x1b')](_0x1638cb[_0xea8a('0x1a')],function(_0x56251b){return{'model':db[_0x56251b[_0xea8a('0x1c')]],'as':_0x56251b['as'],'attributes':_0x56251b[_0xea8a('0x1d')],'include':_0x56251b[_0xea8a('0x1a')]?_['map'](_0x56251b[_0xea8a('0x1a')],function(_0x4e5c6e){return{'model':db[_0x4e5c6e[_0xea8a('0x1c')]],'as':_0x4e5c6e['as'],'attributes':_0x4e5c6e[_0xea8a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xea8a('0x8')](function(_0x247e15){logger[_0xea8a('0x9')](_0xea8a('0x13'),_0x2fde6e);logger['debug'](_0xea8a('0x13'),_0x2fde6e,JSON[_0xea8a('0xd')](_0x247e15));_0x1c3827(_0x247e15);})['catch'](function(_0x539683){logger[_0xea8a('0xe')](_0xea8a('0x13'),_0x539683['message'],_0x2fde6e);_0x5df528(_0x1edf29[_0xea8a('0xe')](0x1f4,_0x539683[_0xea8a('0x10')]));});});};exports['UpdateCmHopperBlack']=function(_0x562eab){var _0x51f0dd=this;return new Promise(function(_0x510b05,_0x37039a){return db[_0xea8a('0x14')]['update'](_0x562eab[_0xea8a('0x1e')],{'raw':_0x562eab['options']?_0x562eab[_0xea8a('0x16')][_0xea8a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x562eab['options']?_0x562eab[_0xea8a('0x16')]['where']||null:null,'attributes':_0x562eab['options']?_0x562eab[_0xea8a('0x16')][_0xea8a('0x1d')]||null:null,'limit':_0x562eab[_0xea8a('0x16')]?_0x562eab[_0xea8a('0x16')][_0xea8a('0x19')]||null:null})[_0xea8a('0x8')](function(_0x751947){logger[_0xea8a('0x9')](_0xea8a('0x1f'),_0x562eab);logger['debug']('UpdateCmHopperBlack',_0x562eab,JSON['stringify'](_0x751947));_0x510b05(_0x751947);})[_0xea8a('0x12')](function(_0x46039e){logger['error']('UpdateCmHopperBlack',_0x46039e[_0xea8a('0x10')],_0x562eab);_0x37039a(_0x51f0dd[_0xea8a('0xe')](0x1f4,_0x46039e[_0xea8a('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x55cf62){var _0x5e33f0=this;return new Promise(function(_0x4f58a0,_0x55fe35){return db['CmHopperBlack'][_0xea8a('0x20')]({'where':_0x55cf62[_0xea8a('0x16')]?_0x55cf62[_0xea8a('0x16')][_0xea8a('0x18')]||null:null})[_0xea8a('0x8')](function(_0x28451c){logger[_0xea8a('0x9')](_0xea8a('0x21'),_0x55cf62);logger['debug']('DestroyCmHopperBlack',_0x55cf62,JSON['stringify'](_0x28451c));_0x4f58a0(_0x28451c);})[_0xea8a('0x12')](function(_0x5370d6){logger[_0xea8a('0xe')](_0xea8a('0x21'),_0x5370d6[_0xea8a('0x10')],_0x55cf62);_0x55fe35(_0x5e33f0[_0xea8a('0xe')](0x1f4,_0x5370d6['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 3aede89..8c1ba8b 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 _0x7c09=['describe','put','/:id','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0x1e3b07,_0x4b4ff6){var _0x5e3fc4=function(_0x3b189d){while(--_0x3b189d){_0x1e3b07['push'](_0x1e3b07['shift']());}};_0x5e3fc4(++_0x4b4ff6);}(_0x7c09,0x102));var _0x97c0=function(_0x38d60f,_0x3c5865){_0x38d60f=_0x38d60f-0x0;var _0x253b47=_0x7c09[_0x38d60f];return _0x253b47;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0x9')]('/:id',auth[_0x97c0('0xb')](),controller['show']);router[_0x97c0('0xd')](_0x97c0('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x97c0('0xf')](_0x97c0('0xe'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x10')]);module[_0x97c0('0x11')]=router; \ No newline at end of file +var _0xd8fb=['/describe','describe','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','index'];(function(_0x53fc00,_0x5d0ebe){var _0x496db3=function(_0x181493){while(--_0x181493){_0x53fc00['push'](_0x53fc00['shift']());}};_0x496db3(++_0x5d0ebe);}(_0xd8fb,0x99));var _0xbd8f=function(_0x1008d6,_0x274460){_0x1008d6=_0x1008d6-0x0;var _0x31319a=_0xd8fb[_0x1008d6];return _0x31319a;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xb')]);router[_0xbd8f('0xc')](_0xbd8f('0xd'),auth['isAuthenticated'](),controller[_0xbd8f('0xe')]);router[_0xbd8f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0x10')]);module[_0xbd8f('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 c8dafaa..6504e19 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 _0xc91c=['getDataValue','setDataValue','followuptime','seconds','BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0xc91c,0x16d));var _0xcc91=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xc91c[_0x56daff];return _0x132c82;};'use strict';var Sequelize=require(_0xcc91('0x0'));var moment=require('moment');module[_0xcc91('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xcc91('0x2')]},'scheduledat':{'type':Sequelize[_0xcc91('0x3')]},'countbusyretry':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xcc91('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xcc91('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcc91('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xcc91('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xcc91('0x3')]},'droptime':{'type':Sequelize[_0xcc91('0x3')]},'endtime':{'type':Sequelize[_0xcc91('0x3')]},'ringtime':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xcc91('0x2')]},'campaign':{'type':Sequelize[_0xcc91('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xcc91('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcc91('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x540055){var _0x45cabc=this[_0xcc91('0x5')]('endtime');if(_0x45cabc&&_0x540055){this[_0xcc91('0x6')](_0xcc91('0x7'),moment(_0x540055)['diff'](moment(_0x45cabc),_0xcc91('0x8')));}}},'amd':{'type':Sequelize[_0xcc91('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xcc91('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xcc91('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xcc91('0x3')]},'callback':{'type':Sequelize[_0xcc91('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcc91('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xcc91('0x3')]},'deleted':{'type':Sequelize[_0xcc91('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xcc91('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcc91('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaba8=['seconds','BOOLEAN','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','followuptime','diff'];(function(_0x137ca4,_0x3866cc){var _0x3266da=function(_0x195f84){while(--_0x195f84){_0x137ca4['push'](_0x137ca4['shift']());}};_0x3266da(++_0x3866cc);}(_0xaba8,0xd3));var _0x8aba=function(_0x120802,_0x144dfd){_0x120802=_0x120802-0x0;var _0xd1e47f=_0xaba8[_0x120802];return _0xd1e47f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8aba('0x0'));module[_0x8aba('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8aba('0x2')]},'scheduledat':{'type':Sequelize[_0x8aba('0x3')]},'countbusyretry':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x8aba('0x2')]},'originatecalleridname':{'type':Sequelize[_0x8aba('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8aba('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8aba('0x3')]},'endtime':{'type':Sequelize[_0x8aba('0x3')]},'ringtime':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8aba('0x2')]},'campaign':{'type':Sequelize[_0x8aba('0x2')]},'campaigntype':{'type':Sequelize[_0x8aba('0x2')]},'membername':{'type':Sequelize[_0x8aba('0x2')]},'reason':{'type':Sequelize[_0x8aba('0x2')]},'disposition':{'type':Sequelize[_0x8aba('0x2')]},'secondDisposition':{'type':Sequelize[_0x8aba('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x8aba('0x3')],'set':function(_0x18d5b3){var _0x1b7f44=this[_0x8aba('0x5')](_0x8aba('0x6'));if(_0x1b7f44&&_0x18d5b3){this['setDataValue'](_0x8aba('0x7'),moment(_0x18d5b3)[_0x8aba('0x8')](moment(_0x1b7f44),_0x8aba('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8aba('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8aba('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x8aba('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8aba('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8aba('0x3')]},'deleted':{'type':Sequelize[_0x8aba('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8aba('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8aba('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8aba('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index a3fd650..0736f5d 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 _0xf61e=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','describe','update','body','uniqueid','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','fromQuery','ContactId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','findOne','eml-format'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xf61e,0x191));var _0xef61=function(_0xd6a629,_0x14aa0f){_0xd6a629=_0xd6a629-0x0;var _0x57b67d=_0xf61e[_0xd6a629];return _0x57b67d;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['CmHopperFinal']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')]()['then'](respondWithResult(_0x47b09d,null))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x13d0f8,_0x2904e0){if(_0x13d0f8[_0xef61('0x4a')][_0xef61('0x4b')]){delete _0x13d0f8[_0xef61('0x4a')]['uniqueid'];}return db[_0xef61('0x30')]['find']({'where':{'uniqueid':_0x13d0f8[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x2904e0,null))[_0xef61('0x28')](saveUpdates(_0x13d0f8[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x2904e0,null))[_0xef61('0x45')](handleError(_0x2904e0,null));};exports[_0xef61('0x4d')]=function(_0x1565c7,_0x264877,_0x4af2f3){return db[_0xef61('0x30')][_0xef61('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x1565c7['params']['id']},'attributes':[[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xef61('0x53')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x55')))),_0xef61('0x56')],[db['sequelize']['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db['sequelize']['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db['sequelize']['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})[_0xef61('0x28')](handleEntityNotFound(_0x264877,null))[_0xef61('0x28')](respondWithResult(_0x264877,null))[_0xef61('0x45')](handleError(_0x264877,null));};exports[_0xef61('0x5d')]=function(_0x5507ee,_0x15a8c5,_0x4b26e6){return db['CmHopperFinal'][_0xef61('0x44')]({'raw':![],'where':{'CampaignId':_0x5507ee[_0xef61('0x4c')]['id']},'attributes':[[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xef61('0x51')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5e')))),_0xef61('0x52')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db['sequelize'][_0xef61('0x50')](_0xef61('0x5f')))),'busyContacts'],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x60')))),_0xef61('0x54')],[db[_0xef61('0x4f')]['fn']('COUNT',db[_0xef61('0x4f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xef61('0x56')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db['sequelize']['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x57')))),_0xef61('0x58')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x59')))),_0xef61('0x5a')],[db[_0xef61('0x4f')]['fn'](_0xef61('0x4e'),db[_0xef61('0x4f')]['fn']('IF',db[_0xef61('0x4f')][_0xef61('0x50')](_0xef61('0x5b')))),_0xef61('0x5c')]]})['then'](handleEntityNotFound(_0x15a8c5,null))[_0xef61('0x28')](respondWithResult(_0x15a8c5,null))[_0xef61('0x45')](handleError(_0x15a8c5,null));};exports[_0xef61('0x61')]=function(_0x5ab4fe,_0x38117b,_0x346752){return db['VoiceQueue'][_0xef61('0x47')]({'where':{'id':_0x5ab4fe[_0xef61('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38117b,null))[_0xef61('0x28')](function(_0x54777a){var _0xe62ec2;if(_0x54777a){_0xe62ec2=squel[_0xef61('0x62')]()['into'](_0xef61('0x63'))['fromQuery']([_0xef61('0x64'),_0xef61('0x65'),'ContactId','ListId',_0xef61('0x66'),_0xef61('0x67'),_0xef61('0x68')],squel[_0xef61('0x69')]()[_0xef61('0x6a')]('ANY_VALUE(calleridnum)',_0xef61('0x64'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),'ContactId')[_0xef61('0x6a')]('ANY_VALUE(ListId)',_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x6e'),_0xef61('0x66'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x68'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5ab4fe['body'][_0xef61('0x73')]['toString']())['where'](_0xef61('0x74'))['where'](_0xef61('0x75'),squel['select']()['field'](_0xef61('0x64'))[_0xef61('0x6f')]('cm_hopper')[_0xef61('0x3d')]('VoiceQueueId\x20=\x20?',_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]()))[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')]('calleridnum')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x76'),_0x5ab4fe[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')]('ContactId'))[_0xef61('0x71')]();return db['sequelize'][_0xef61('0x34')](_0xe62ec2);}return[];})[_0xef61('0x28')](respondWithResult(_0x38117b,null))['catch'](handleError(_0x38117b,null));};exports[_0xef61('0x79')]=function(_0x5b86e4,_0x52f7c5,_0x465fb5){return db[_0xef61('0x7a')]['find']({'where':{'id':_0x5b86e4[_0xef61('0x4c')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x52f7c5,null))['then'](function(_0x352633){var _0x2cb8a8;if(_0x352633){_0x2cb8a8=squel['insert']()[_0xef61('0x7b')]('cm_hopper')[_0xef61('0x7c')]([_0xef61('0x64'),_0xef61('0x65'),_0xef61('0x7d'),'ListId',_0xef61('0x7e'),_0xef61('0x67'),_0xef61('0x68')],squel['select']()[_0xef61('0x6a')](_0xef61('0x7f'),'phone')['field'](_0xef61('0x6b'),_0xef61('0x65'))[_0xef61('0x6a')](_0xef61('0x6c'),_0xef61('0x7d'))[_0xef61('0x6a')](_0xef61('0x80'),_0xef61('0x6d'))[_0xef61('0x6a')](_0xef61('0x81'),_0xef61('0x7e'))[_0xef61('0x6a')](_0xef61('0x6b'),_0xef61('0x67'))[_0xef61('0x6a')](_0xef61('0x6b'),'updatedAt')[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')](_0xef61('0x82'),_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x72'),_0x5b86e4[_0xef61('0x4a')][_0xef61('0x73')][_0xef61('0x71')]())[_0xef61('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xef61('0x3d')](_0xef61('0x75'),squel['select']()[_0xef61('0x6a')](_0xef61('0x64'))[_0xef61('0x6f')](_0xef61('0x63'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id']['toString']()))[_0xef61('0x3d')](_0xef61('0x75'),squel[_0xef61('0x69')]()[_0xef61('0x6a')](_0xef61('0x83'))[_0xef61('0x6f')](_0xef61('0x70'))[_0xef61('0x3d')]('CampaignId\x20=\x20?',_0x5b86e4[_0xef61('0x4c')]['id'][_0xef61('0x71')]())[_0xef61('0x3d')](_0xef61('0x77')))[_0xef61('0x78')](_0xef61('0x7d')))[_0xef61('0x71')]();return db[_0xef61('0x4f')][_0xef61('0x34')](_0x2cb8a8);}return[];})['then'](respondWithResult(_0x52f7c5,null))[_0xef61('0x45')](handleError(_0x52f7c5,null));};exports[_0xef61('0x84')]=function(_0x22006a,_0x317c4a,_0x5d8ee9){return db['CmHopper'][_0xef61('0x85')]({'where':{'VoiceQueueId':_0x22006a[_0xef61('0x4a')][_0xef61('0x66')],'CampaignId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7e')],'ContactId':_0x22006a[_0xef61('0x4a')][_0xef61('0x7d')]}})['then'](handleEntityNotFound(_0x317c4a,null))[_0xef61('0x28')](function(_0x660c71){if(_0x660c71){return _0x660c71;}return null;})[_0xef61('0x28')](respondWithResult(_0x317c4a,null))[_0xef61('0x45')](handleError(_0x317c4a,null));}; \ No newline at end of file +var _0xdb28=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','CmHopperFinal','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','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','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','insert','into','cm_hopper','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ListId','CampaignId','ANY_VALUE(CampaignId)','state','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf'];(function(_0xfcf288,_0x42df01){var _0x5b1bcd=function(_0x101c78){while(--_0x101c78){_0xfcf288['push'](_0xfcf288['shift']());}};_0x5b1bcd(++_0x42df01);}(_0xdb28,0x106));var _0x8db2=function(_0x28c6ad,_0x59cfde){_0x28c6ad=_0x28c6ad-0x0;var _0x120b5a=_0xdb28[_0x28c6ad];return _0x120b5a;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['describe']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')]()['then'](respondWithResult(_0x2ada52,null))['catch'](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x2e46d4,_0x164020){if(_0x2e46d4['body']['uniqueid']){delete _0x2e46d4['body'][_0x8db2('0x4a')];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'uniqueid':_0x2e46d4[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x164020,null))[_0x8db2('0x24')](saveUpdates(_0x2e46d4[_0x8db2('0x4b')],null))['then'](respondWithResult(_0x164020,null))['catch'](handleError(_0x164020,null));};exports[_0x8db2('0x4c')]=function(_0x18c6ef,_0x2908e4,_0x2f0bd0){return db[_0x8db2('0x2b')][_0x8db2('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x18c6ef[_0x8db2('0x44')]['id']},'attributes':[[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x50')))),_0x8db2('0x51')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x52')))),_0x8db2('0x53')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x54')))),_0x8db2('0x55')],[db['sequelize']['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x56')))),_0x8db2('0x57')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8db2('0x58')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal'](_0x8db2('0x59')))),_0x8db2('0x5a')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x5b')))),_0x8db2('0x5c')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x5d')))),_0x8db2('0x5e')]]})['then'](handleEntityNotFound(_0x2908e4,null))[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x42')](handleError(_0x2908e4,null));};exports[_0x8db2('0x5f')]=function(_0xc27a7e,_0x349db0,_0x53b2dc){return db[_0x8db2('0x2b')][_0x8db2('0x40')]({'raw':![],'where':{'CampaignId':_0xc27a7e[_0x8db2('0x44')]['id']},'attributes':[[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x50')))),_0x8db2('0x51')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x52')))),_0x8db2('0x53')],[db[_0x8db2('0x4d')]['fn']('COUNT',db[_0x8db2('0x4d')]['fn']('IF',db['sequelize'][_0x8db2('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x8db2('0x55')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x8db2('0x57')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x60')))),_0x8db2('0x58')],[db['sequelize']['fn'](_0x8db2('0x4e'),db[_0x8db2('0x4d')]['fn']('IF',db[_0x8db2('0x4d')][_0x8db2('0x4f')](_0x8db2('0x59')))),_0x8db2('0x5a')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x8db2('0x4f')](_0x8db2('0x5b')))),_0x8db2('0x5c')],[db[_0x8db2('0x4d')]['fn'](_0x8db2('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x8db2('0x4f')](_0x8db2('0x5d')))),'answeringMachine']]})[_0x8db2('0x24')](handleEntityNotFound(_0x349db0,null))[_0x8db2('0x24')](respondWithResult(_0x349db0,null))[_0x8db2('0x42')](handleError(_0x349db0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x26523b,_0x291375,_0x2cf731){return db['VoiceQueue'][_0x8db2('0x48')]({'where':{'id':_0x26523b[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x291375,null))[_0x8db2('0x24')](function(_0x3a0946){var _0x5923b3;if(_0x3a0946){_0x5923b3=squel[_0x8db2('0x61')]()[_0x8db2('0x62')](_0x8db2('0x63'))['fromQuery'](['phone',_0x8db2('0x64'),_0x8db2('0x65'),'ListId',_0x8db2('0x66'),_0x8db2('0x67'),_0x8db2('0x68')],squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x6b'),_0x8db2('0x6c'))[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x64'))[_0x8db2('0x6a')](_0x8db2('0x6e'),_0x8db2('0x65'))['field'](_0x8db2('0x6f'),'ListId')[_0x8db2('0x6a')](_0x8db2('0x70'),'VoiceQueueId')[_0x8db2('0x6a')](_0x8db2('0x6d'),'createdAt')[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x68'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())['where']('state\x20=\x20?',_0x26523b[_0x8db2('0x4b')]['state'][_0x8db2('0x74')]())[_0x8db2('0x3b')](_0x8db2('0x75'))['where'](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')]('phone')[_0x8db2('0x71')](_0x8db2('0x63'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b['params']['id'][_0x8db2('0x74')]()))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x77'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')](_0x8db2('0x73'),_0x26523b[_0x8db2('0x44')]['id']['toString']())[_0x8db2('0x3b')](_0x8db2('0x78')))[_0x8db2('0x79')]('ContactId'))['toString']();return db['sequelize'][_0x8db2('0x30')](_0x5923b3);}return[];})[_0x8db2('0x24')](respondWithResult(_0x291375,null))[_0x8db2('0x42')](handleError(_0x291375,null));};exports[_0x8db2('0x7a')]=function(_0x2ad024,_0x313918,_0x339d09){return db[_0x8db2('0x7b')][_0x8db2('0x48')]({'where':{'id':_0x2ad024[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x313918,null))['then'](function(_0x360a06){var _0xa2e293;if(_0x360a06){_0xa2e293=squel[_0x8db2('0x61')]()[_0x8db2('0x62')]('cm_hopper')['fromQuery']([_0x8db2('0x6c'),_0x8db2('0x64'),'ContactId',_0x8db2('0x7c'),_0x8db2('0x7d'),_0x8db2('0x67'),'updatedAt'],squel['select']()['field'](_0x8db2('0x6b'),_0x8db2('0x6c'))[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x64'))['field'](_0x8db2('0x6e'),'ContactId')[_0x8db2('0x6a')](_0x8db2('0x6f'),_0x8db2('0x7c'))[_0x8db2('0x6a')](_0x8db2('0x7e'),'CampaignId')['field'](_0x8db2('0x6d'),'createdAt')[_0x8db2('0x6a')](_0x8db2('0x6d'),_0x8db2('0x68'))[_0x8db2('0x71')](_0x8db2('0x72'))[_0x8db2('0x3b')]('CampaignId\x20=\x20?',_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())[_0x8db2('0x3b')]('state\x20=\x20?',_0x2ad024[_0x8db2('0x4b')][_0x8db2('0x7f')]['toString']())[_0x8db2('0x3b')](_0x8db2('0x75'))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x6c'))[_0x8db2('0x71')](_0x8db2('0x63'))['where'](_0x8db2('0x80'),_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]()))[_0x8db2('0x3b')](_0x8db2('0x76'),squel[_0x8db2('0x69')]()[_0x8db2('0x6a')](_0x8db2('0x77'))[_0x8db2('0x71')](_0x8db2('0x72'))['where'](_0x8db2('0x80'),_0x2ad024[_0x8db2('0x44')]['id'][_0x8db2('0x74')]())[_0x8db2('0x3b')]('state\x20=\x204'))[_0x8db2('0x79')](_0x8db2('0x65')))[_0x8db2('0x74')]();return db['sequelize']['query'](_0xa2e293);}return[];})[_0x8db2('0x24')](respondWithResult(_0x313918,null))[_0x8db2('0x42')](handleError(_0x313918,null));};exports[_0x8db2('0x81')]=function(_0xc83913,_0x4f9ce4,_0xaa2661){return db[_0x8db2('0x82')][_0x8db2('0x83')]({'where':{'VoiceQueueId':_0xc83913[_0x8db2('0x4b')]['VoiceQueueId'],'CampaignId':_0xc83913[_0x8db2('0x4b')][_0x8db2('0x7d')],'ContactId':_0xc83913[_0x8db2('0x4b')]['ContactId']}})['then'](handleEntityNotFound(_0x4f9ce4,null))['then'](function(_0x1ba097){if(_0x1ba097){return _0x1ba097;}return null;})[_0x8db2('0x24')](respondWithResult(_0x4f9ce4,null))[_0x8db2('0x42')](handleError(_0x4f9ce4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 079eee8..8a26dff 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 _0x191f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x47b730,_0x1aa3fb){var _0xddcacc=function(_0x28cc30){while(--_0x28cc30){_0x47b730['push'](_0x47b730['shift']());}};_0xddcacc(++_0x1aa3fb);}(_0x191f,0x16e));var _0xf191=function(_0x58c547,_0x2c01c2){_0x58c547=_0x58c547-0x0;var _0xdb6002=_0x191f[_0x58c547];return _0xdb6002;};'use strict';var _=require(_0xf191('0x0'));var util=require(_0xf191('0x1'));var logger=require('../../config/logger')(_0xf191('0x2'));var moment=require(_0xf191('0x3'));var BPromise=require(_0xf191('0x4'));var rp=require(_0xf191('0x5'));var fs=require('fs');var path=require(_0xf191('0x6'));var rimraf=require(_0xf191('0x7'));var config=require(_0xf191('0x8'));var attributes=require(_0xf191('0x9'));module[_0xf191('0xa')]=function(_0x3a083e,_0x52eb72){return _0x3a083e[_0xf191('0xb')](_0xf191('0xc'),attributes,{'tableName':_0xf191('0xd'),'paranoid':![],'indexes':[{'name':_0xf191('0xe'),'fields':[_0xf191('0xe')]},{'name':'uniqueid','fields':[_0xf191('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6655=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper_final','calleridnum','lodash','util','../../config/logger'];(function(_0x427080,_0x51e019){var _0x4e61d6=function(_0x99138b){while(--_0x99138b){_0x427080['push'](_0x427080['shift']());}};_0x4e61d6(++_0x51e019);}(_0x6655,0x1a1));var _0x5665=function(_0x21219b,_0x215e1f){_0x21219b=_0x21219b-0x0;var _0x54b5ed=_0x6655[_0x21219b];return _0x54b5ed;};'use strict';var _=require(_0x5665('0x0'));var util=require(_0x5665('0x1'));var logger=require(_0x5665('0x2'))(_0x5665('0x3'));var moment=require(_0x5665('0x4'));var BPromise=require(_0x5665('0x5'));var rp=require(_0x5665('0x6'));var fs=require('fs');var path=require(_0x5665('0x7'));var rimraf=require(_0x5665('0x8'));var config=require(_0x5665('0x9'));var attributes=require('./cmHopperFinal.attributes');module[_0x5665('0xa')]=function(_0x1ba58a,_0x10eaa1){return _0x1ba58a[_0x5665('0xb')]('CmHopperFinal',attributes,{'tableName':_0x5665('0xc'),'paranoid':![],'indexes':[{'name':_0x5665('0xd'),'fields':['calleridnum']},{'name':'uniqueid','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 32dd7f4..5dbb830 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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x46beaf,_0x2f5b0f){var _0x241bca=function(_0x3a5b7f){while(--_0x3a5b7f){_0x46beaf['push'](_0x46beaf['shift']());}};_0x241bca(++_0x2f5b0f);}(_0x7a54,0x106));var _0x47a5=function(_0x46e25b,_0x194d93){_0x46e25b=_0x46e25b-0x0;var _0xff320e=_0x7a54[_0x46e25b];return _0xff320e;};'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')]('CmHopperFinal,\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);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4710e4,_0x587975){var _0x1f3f2d=function(_0x294354){while(--_0x294354){_0x4710e4['push'](_0x4710e4['shift']());}};_0x1f3f2d(++_0x587975);}(_0x7a54,0x106));var _0x47a5=function(_0x31dbe0,_0x5ad6b9){_0x31dbe0=_0x31dbe0-0x0;var _0x3f2ff1=_0x7a54[_0x31dbe0];return _0x3f2ff1;};'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')]('CmHopperFinal,\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);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index cbecd22..69a9621 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 _0x91a0=['../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x91a0,0x1df));var _0x091a=function(_0x2ce6ab,_0x4ef47d){_0x2ce6ab=_0x2ce6ab-0x0;var _0x197a53=_0x91a0[_0x2ce6ab];return _0x197a53;};'use strict';var multer=require(_0x091a('0x0'));var util=require('util');var path=require(_0x091a('0x1'));var timeout=require(_0x091a('0x2'));var express=require(_0x091a('0x3'));var router=express[_0x091a('0x4')]();var fs_extra=require(_0x091a('0x5'));var auth=require(_0x091a('0x6'));var interaction=require(_0x091a('0x7'));var config=require(_0x091a('0x8'));var controller=require(_0x091a('0x9'));router[_0x091a('0xa')]('/',auth['isAuthenticated'](),controller[_0x091a('0xb')]);router['get'](_0x091a('0xc'),auth[_0x091a('0xd')](),controller[_0x091a('0xe')]);router['get'](_0x091a('0xf'),auth[_0x091a('0xd')](),controller[_0x091a('0x10')]);router[_0x091a('0xa')](_0x091a('0x11'),auth['isAuthenticated'](),controller[_0x091a('0x12')]);router['get'](_0x091a('0x13'),auth[_0x091a('0xd')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x091a('0x14')](_0x091a('0x15'),auth[_0x091a('0xd')](),controller[_0x091a('0x16')]);router[_0x091a('0x14')](_0x091a('0x17'),auth[_0x091a('0xd')](),controller[_0x091a('0x18')]);router[_0x091a('0x14')](_0x091a('0x19'),auth[_0x091a('0xd')](),controller['checkContactHopper']);router[_0x091a('0x1a')](_0x091a('0xf'),auth[_0x091a('0xd')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x8107=['/checkContactHopper','checkContactHopper','/:id','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','index','isAuthenticated','describe','get','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x32b8a9,_0x59d62b){var _0x40105c=function(_0x54c048){while(--_0x54c048){_0x32b8a9['push'](_0x32b8a9['shift']());}};_0x40105c(++_0x59d62b);}(_0x8107,0x109));var _0x7810=function(_0x39157f,_0x3d8c1e){_0x39157f=_0x39157f-0x0;var _0x1ae4e2=_0x8107[_0x39157f];return _0x1ae4e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7810('0x0'));var timeout=require(_0x7810('0x1'));var express=require(_0x7810('0x2'));var router=express[_0x7810('0x3')]();var fs_extra=require(_0x7810('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7810('0x5'));var config=require(_0x7810('0x6'));var controller=require(_0x7810('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7810('0x8')]);router['get']('/describe',auth[_0x7810('0x9')](),controller[_0x7810('0xa')]);router[_0x7810('0xb')]('/:id',auth[_0x7810('0x9')](),controller[_0x7810('0xc')]);router[_0x7810('0xb')]('/voice/queue/countAttributes/:id',auth[_0x7810('0x9')](),controller[_0x7810('0xd')]);router[_0x7810('0xb')](_0x7810('0xe'),auth[_0x7810('0x9')](),controller[_0x7810('0xf')]);router['post'](_0x7810('0x10'),auth[_0x7810('0x9')](),controller[_0x7810('0x11')]);router[_0x7810('0x12')](_0x7810('0x13'),auth[_0x7810('0x9')](),controller[_0x7810('0x14')]);router['post'](_0x7810('0x15'),auth['isAuthenticated'](),controller[_0x7810('0x16')]);router['put'](_0x7810('0x17'),auth[_0x7810('0x9')](),controller[_0x7810('0x18')]);module[_0x7810('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 d2a8cf9..03ddd10 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 _0x509a=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x33bb0d,_0x11d8b9){var _0xede249=function(_0x588c8c){while(--_0x588c8c){_0x33bb0d['push'](_0x33bb0d['shift']());}};_0xede249(++_0x11d8b9);}(_0x509a,0xcb));var _0xa509=function(_0x95575,_0x1f689c){_0x95575=_0x95575-0x0;var _0x2e5703=_0x509a[_0x95575];return _0x2e5703;};'use strict';var Sequelize=require(_0xa509('0x0'));module[_0xa509('0x1')]={'state':{'type':Sequelize[_0xa509('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa509('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa509('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xa509('0x3')]},'originatecalleridname':{'type':Sequelize[_0xa509('0x3')]},'calleridnum':{'type':Sequelize[_0xa509('0x3')]},'calleridname':{'type':Sequelize[_0xa509('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa509('0x4')]},'answertime':{'type':Sequelize[_0xa509('0x4')]},'droptime':{'type':Sequelize[_0xa509('0x4')]},'endtime':{'type':Sequelize[_0xa509('0x4')]},'ringtime':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xa509('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa509('0x3')]},'reason':{'type':Sequelize[_0xa509('0x3')]},'amd':{'type':Sequelize[_0xa509('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa509('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xa509('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa509('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xa509('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa509('0x4')]},'edited':{'type':Sequelize[_0xa509('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa509('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa509('0x3')]}}; \ No newline at end of file +var _0xd9cb=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0xd9cb,0x1be));var _0xbd9c=function(_0x3c120e,_0x5094e9){_0x3c120e=_0x3c120e-0x0;var _0x21d514=_0xd9cb[_0x3c120e];return _0x21d514;};'use strict';var Sequelize=require(_0xbd9c('0x0'));module['exports']={'state':{'type':Sequelize[_0xbd9c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xbd9c('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbd9c('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xbd9c('0x2')]},'originatecalleridname':{'type':Sequelize[_0xbd9c('0x2')]},'calleridnum':{'type':Sequelize[_0xbd9c('0x2')]},'calleridname':{'type':Sequelize[_0xbd9c('0x2')]},'starttime':{'type':Sequelize[_0xbd9c('0x3')]},'responsetime':{'type':Sequelize[_0xbd9c('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xbd9c('0x3')]},'endtime':{'type':Sequelize[_0xbd9c('0x3')]},'ringtime':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbd9c('0x2')]},'campaign':{'type':Sequelize[_0xbd9c('0x2')]},'campaigntype':{'type':Sequelize[_0xbd9c('0x2')]},'membername':{'type':Sequelize[_0xbd9c('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xbd9c('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xbd9c('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbd9c('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbd9c('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbd9c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index a47a145..86655d5 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 _0x8aa7=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','length','catch','create','describe','body','uniqueid','find','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','map','CmHopperHistory','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8aa7,0xae));var _0x78aa=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x8aa7[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0x78aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78aa('0x1'));var jsonpatch=require(_0x78aa('0x2'));var rp=require(_0x78aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x78aa('0x4'));var util=require(_0x78aa('0x5'));var path=require(_0x78aa('0x6'));var sox=require(_0x78aa('0x7'));var csv=require(_0x78aa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78aa('0x9'));var _=require(_0x78aa('0xa'));var squel=require(_0x78aa('0xb'));var crypto=require(_0x78aa('0xc'));var jsforce=require(_0x78aa('0xd'));var deskjs=require(_0x78aa('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x78aa('0xf'));var Redis=require('ioredis');var authService=require(_0x78aa('0x10'));var qs=require(_0x78aa('0x11'));var as=require(_0x78aa('0x12'));var hardwareService=require(_0x78aa('0x13'));var logger=require(_0x78aa('0x14'))('api');var utils=require(_0x78aa('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x78aa('0x16'))['db'];function respondWithStatusCode(_0x4e7f3e,_0x5546f4){_0x5546f4=_0x5546f4||0xcc;return function(_0x3bfd7e){if(_0x3bfd7e){return _0x4e7f3e[_0x78aa('0x17')](_0x5546f4);}return _0x4e7f3e['status'](_0x5546f4)['end']();};}function respondWithResult(_0x4058b3,_0x32a72f){_0x32a72f=_0x32a72f||0xc8;return function(_0x584331){if(_0x584331){return _0x4058b3[_0x78aa('0x18')](_0x32a72f)[_0x78aa('0x19')](_0x584331);}};}function respondWithFilteredResult(_0x53d4c1,_0x13df03){return function(_0xfdae26){if(_0xfdae26){var _0x2acf0c=typeof _0x13df03[_0x78aa('0x1a')]===_0x78aa('0x1b')&&typeof _0x13df03[_0x78aa('0x1c')]===_0x78aa('0x1b');var _0x13957b=_0xfdae26[_0x78aa('0x1d')];var _0x3d3420=_0x2acf0c?0x0:_0x13df03['offset'];var _0x1a0931=_0x2acf0c?_0xfdae26[_0x78aa('0x1d')]:_0x13df03[_0x78aa('0x1a')]+_0x13df03[_0x78aa('0x1c')];var _0x4e9e9b;if(_0x1a0931>=_0x13957b){_0x1a0931=_0x13957b;_0x4e9e9b=0xc8;}else{_0x4e9e9b=0xce;}_0x53d4c1[_0x78aa('0x18')](_0x4e9e9b);return _0x53d4c1[_0x78aa('0x1e')](_0x78aa('0x1f'),_0x3d3420+'-'+_0x1a0931+'/'+_0x13957b)[_0x78aa('0x19')](_0xfdae26);}return null;};}function patchUpdates(_0x61f402){return function(_0x5c6740){try{jsonpatch[_0x78aa('0x20')](_0x5c6740,_0x61f402,!![]);}catch(_0x351ff2){return BPromise[_0x78aa('0x21')](_0x351ff2);}return _0x5c6740[_0x78aa('0x22')]();};}function saveUpdates(_0xd62563,_0x2dfb20){return function(_0x5b6294){if(_0x5b6294){return _0x5b6294[_0x78aa('0x23')](_0xd62563)[_0x78aa('0x24')](function(_0x3c4523){return _0x3c4523;});}return null;};}function removeEntity(_0x2e1a19,_0x387588){return function(_0x5c20ab){if(_0x5c20ab){return _0x5c20ab['destroy']()[_0x78aa('0x24')](function(){_0x2e1a19['status'](0xcc)[_0x78aa('0x25')]();});}};}function handleEntityNotFound(_0x2fb618,_0x16c32f){return function(_0x474b61){if(!_0x474b61){_0x2fb618[_0x78aa('0x17')](0x194);}return _0x474b61;};}function handleError(_0x4be7fe,_0x2fc5c6){_0x2fc5c6=_0x2fc5c6||0x1f4;return function(_0xfc5dcc){logger[_0x78aa('0x26')](_0xfc5dcc[_0x78aa('0x27')]);if(_0xfc5dcc['name']){delete _0xfc5dcc['name'];}_0x4be7fe[_0x78aa('0x18')](_0x2fc5c6)[_0x78aa('0x28')](_0xfc5dcc);};}exports[_0x78aa('0x29')]=function(_0x55641f,_0x505a99){var _0x28a7df={},_0x562da3={},_0x14ae97={'count':0x0,'rows':[]};var _0x387240=_[_0x78aa('0x2a')](db[_0x78aa('0x2b')]['rawAttributes'],function(_0x5ac6c0){return{'name':_0x5ac6c0['fieldName'],'type':_0x5ac6c0[_0x78aa('0x2c')]['key']};});_0x562da3[_0x78aa('0x2d')]=_[_0x78aa('0x2a')](_0x387240,_0x78aa('0x2e'));_0x562da3[_0x78aa('0x2f')]=_[_0x78aa('0x30')](_0x55641f[_0x78aa('0x2f')]);_0x562da3[_0x78aa('0x31')]=_[_0x78aa('0x32')](_0x562da3[_0x78aa('0x2d')],_0x562da3[_0x78aa('0x2f')]);_0x28a7df[_0x78aa('0x33')]=_['intersection'](_0x562da3[_0x78aa('0x2d')],qs[_0x78aa('0x34')](_0x55641f[_0x78aa('0x2f')][_0x78aa('0x34')]));_0x28a7df[_0x78aa('0x33')]=_0x28a7df[_0x78aa('0x33')]['length']?_0x28a7df[_0x78aa('0x33')]:_0x562da3[_0x78aa('0x2d')];if(!_0x55641f['query'][_0x78aa('0x35')](_0x78aa('0x36'))){_0x28a7df[_0x78aa('0x1c')]=qs['limit'](_0x55641f[_0x78aa('0x2f')]['limit']);_0x28a7df[_0x78aa('0x1a')]=qs[_0x78aa('0x1a')](_0x55641f[_0x78aa('0x2f')]['offset']);}_0x28a7df[_0x78aa('0x37')]=qs[_0x78aa('0x38')](_0x55641f[_0x78aa('0x2f')][_0x78aa('0x38')]);_0x28a7df[_0x78aa('0x39')]=qs['filters'](_[_0x78aa('0x3a')](_0x55641f[_0x78aa('0x2f')],_0x562da3[_0x78aa('0x31')]),_0x387240);if(_0x55641f['query'][_0x78aa('0x3b')]){_0x28a7df['where']=_[_0x78aa('0x3c')](_0x28a7df[_0x78aa('0x39')],{'$or':_[_0x78aa('0x2a')](_0x387240,function(_0x481c7e){if(_0x481c7e[_0x78aa('0x2c')]!==_0x78aa('0x3d')){var _0x5a095c={};_0x5a095c[_0x481c7e[_0x78aa('0x2e')]]={'$like':'%'+_0x55641f[_0x78aa('0x2f')][_0x78aa('0x3b')]+'%'};return _0x5a095c;}})});}_0x28a7df=_[_0x78aa('0x3c')]({},_0x28a7df,_0x55641f[_0x78aa('0x3e')]);var _0x38722f={'where':_0x28a7df[_0x78aa('0x39')]};return db[_0x78aa('0x2b')][_0x78aa('0x1d')](_0x38722f)[_0x78aa('0x24')](function(_0x223b57){_0x14ae97[_0x78aa('0x1d')]=_0x223b57;if(_0x55641f[_0x78aa('0x2f')][_0x78aa('0x3f')]){_0x28a7df[_0x78aa('0x40')]=[{'all':!![]}];}return db[_0x78aa('0x2b')][_0x78aa('0x41')](_0x28a7df);})['then'](function(_0xbb5300){_0x14ae97['rows']=_0xbb5300;return _0x14ae97;})[_0x78aa('0x24')](respondWithFilteredResult(_0x505a99,_0x28a7df))['catch'](handleError(_0x505a99,null));};exports[_0x78aa('0x42')]=function(_0x5238a3,_0x5e28c3){var _0x27b7b8={'raw':!![],'where':{'id':_0x5238a3[_0x78aa('0x43')]['id']}},_0x43ab81={};_0x43ab81['model']=_[_0x78aa('0x30')](db[_0x78aa('0x2b')][_0x78aa('0x44')]);_0x43ab81[_0x78aa('0x2f')]=_[_0x78aa('0x30')](_0x5238a3[_0x78aa('0x2f')]);_0x43ab81[_0x78aa('0x31')]=_[_0x78aa('0x32')](_0x43ab81[_0x78aa('0x2d')],_0x43ab81[_0x78aa('0x2f')]);_0x27b7b8[_0x78aa('0x33')]=_[_0x78aa('0x32')](_0x43ab81[_0x78aa('0x2d')],qs[_0x78aa('0x34')](_0x5238a3[_0x78aa('0x2f')][_0x78aa('0x34')]));_0x27b7b8[_0x78aa('0x33')]=_0x27b7b8['attributes'][_0x78aa('0x45')]?_0x27b7b8['attributes']:_0x43ab81[_0x78aa('0x2d')];if(_0x5238a3[_0x78aa('0x2f')]['includeAll']){_0x27b7b8[_0x78aa('0x40')]=[{'all':!![]}];}_0x27b7b8=_[_0x78aa('0x3c')]({},_0x27b7b8,_0x5238a3['options']);return db[_0x78aa('0x2b')]['find'](_0x27b7b8)['then'](handleEntityNotFound(_0x5e28c3,null))[_0x78aa('0x24')](respondWithResult(_0x5e28c3,null))[_0x78aa('0x46')](handleError(_0x5e28c3,null));};exports['create']=function(_0x4e8817,_0x277d98){return db['CmHopperHistory'][_0x78aa('0x47')](_0x4e8817['body'],{})[_0x78aa('0x24')](respondWithResult(_0x277d98,0xc9))[_0x78aa('0x46')](handleError(_0x277d98,null));};exports[_0x78aa('0x48')]=function(_0x147ef1,_0x3e0f47){return db['CmHopperHistory'][_0x78aa('0x48')]()[_0x78aa('0x24')](respondWithResult(_0x3e0f47,null))[_0x78aa('0x46')](handleError(_0x3e0f47,null));};exports[_0x78aa('0x23')]=function(_0x51d5f6,_0x311627){if(_0x51d5f6[_0x78aa('0x49')][_0x78aa('0x4a')]){delete _0x51d5f6[_0x78aa('0x49')]['uniqueid'];}return db[_0x78aa('0x2b')][_0x78aa('0x4b')]({'where':{'uniqueid':_0x51d5f6[_0x78aa('0x43')]['id']}})[_0x78aa('0x24')](handleEntityNotFound(_0x311627,null))[_0x78aa('0x24')](saveUpdates(_0x51d5f6[_0x78aa('0x49')],null))[_0x78aa('0x24')](respondWithResult(_0x311627,null))['catch'](handleError(_0x311627,null));}; \ No newline at end of file +var _0xb000=['index','map','CmHopperHistory','fieldName','type','key','keys','intersection','model','query','attributes','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','merge','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','update','then','sendStatus','error','stack','name'];(function(_0x2f987,_0x31a5ec){var _0x45c1d9=function(_0x5ef787){while(--_0x5ef787){_0x2f987['push'](_0x2f987['shift']());}};_0x45c1d9(++_0x31a5ec);}(_0xb000,0x107));var _0x0b00=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0xb000[_0x39872b];return _0x55fa18;};'use strict';var emlformat=require(_0x0b00('0x0'));var rimraf=require(_0x0b00('0x1'));var zipdir=require(_0x0b00('0x2'));var jsonpatch=require(_0x0b00('0x3'));var rp=require(_0x0b00('0x4'));var moment=require('moment');var BPromise=require(_0x0b00('0x5'));var Mustache=require(_0x0b00('0x6'));var util=require(_0x0b00('0x7'));var path=require(_0x0b00('0x8'));var sox=require('sox');var csv=require(_0x0b00('0x9'));var ejs=require(_0x0b00('0xa'));var fs=require('fs');var fs_extra=require(_0x0b00('0xb'));var _=require('lodash');var squel=require(_0x0b00('0xc'));var crypto=require(_0x0b00('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0b00('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0b00('0xf'));var Papa=require('papaparse');var Redis=require(_0x0b00('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0b00('0x11'));var as=require(_0x0b00('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b00('0x13'))(_0x0b00('0x14'));var utils=require(_0x0b00('0x15'));var config=require(_0x0b00('0x16'));var licenseUtil=require(_0x0b00('0x17'));var db=require(_0x0b00('0x18'))['db'];function respondWithStatusCode(_0x5bd346,_0x5a436a){_0x5a436a=_0x5a436a||0xcc;return function(_0x4d7698){if(_0x4d7698){return _0x5bd346['sendStatus'](_0x5a436a);}return _0x5bd346['status'](_0x5a436a)[_0x0b00('0x19')]();};}function respondWithResult(_0x3a75bd,_0x4fe3dc){_0x4fe3dc=_0x4fe3dc||0xc8;return function(_0x45e645){if(_0x45e645){return _0x3a75bd['status'](_0x4fe3dc)['json'](_0x45e645);}};}function respondWithFilteredResult(_0x21983f,_0x1e400b){return function(_0x649356){if(_0x649356){var _0x121d17=typeof _0x1e400b[_0x0b00('0x1a')]==='undefined'&&typeof _0x1e400b[_0x0b00('0x1b')]===_0x0b00('0x1c');var _0x49fd47=_0x649356[_0x0b00('0x1d')];var _0xa85cfd=_0x121d17?0x0:_0x1e400b[_0x0b00('0x1a')];var _0x4cafcb=_0x121d17?_0x649356[_0x0b00('0x1d')]:_0x1e400b[_0x0b00('0x1a')]+_0x1e400b[_0x0b00('0x1b')];var _0x180831;if(_0x4cafcb>=_0x49fd47){_0x4cafcb=_0x49fd47;_0x180831=0xc8;}else{_0x180831=0xce;}_0x21983f[_0x0b00('0x1e')](_0x180831);return _0x21983f[_0x0b00('0x1f')](_0x0b00('0x20'),_0xa85cfd+'-'+_0x4cafcb+'/'+_0x49fd47)[_0x0b00('0x21')](_0x649356);}return null;};}function patchUpdates(_0x5573c1){return function(_0x15157d){try{jsonpatch[_0x0b00('0x22')](_0x15157d,_0x5573c1,!![]);}catch(_0x160124){return BPromise['reject'](_0x160124);}return _0x15157d['save']();};}function saveUpdates(_0x5bf96d,_0x76d74a){return function(_0x568cd1){if(_0x568cd1){return _0x568cd1[_0x0b00('0x23')](_0x5bf96d)[_0x0b00('0x24')](function(_0x30bc09){return _0x30bc09;});}return null;};}function removeEntity(_0x5ca017,_0x46aaba){return function(_0x7541aa){if(_0x7541aa){return _0x7541aa['destroy']()[_0x0b00('0x24')](function(){_0x5ca017['status'](0xcc)[_0x0b00('0x19')]();});}};}function handleEntityNotFound(_0x8956ed,_0x2b49b6){return function(_0x54f2a2){if(!_0x54f2a2){_0x8956ed[_0x0b00('0x25')](0x194);}return _0x54f2a2;};}function handleError(_0x44a4ba,_0x1c70c7){_0x1c70c7=_0x1c70c7||0x1f4;return function(_0x139b65){logger[_0x0b00('0x26')](_0x139b65[_0x0b00('0x27')]);if(_0x139b65['name']){delete _0x139b65[_0x0b00('0x28')];}_0x44a4ba['status'](_0x1c70c7)['send'](_0x139b65);};}exports[_0x0b00('0x29')]=function(_0x52567c,_0x5a8bbc){var _0x1e4206={},_0x387e82={},_0x5e049c={'count':0x0,'rows':[]};var _0x1bbe4f=_[_0x0b00('0x2a')](db[_0x0b00('0x2b')]['rawAttributes'],function(_0x10c04a){return{'name':_0x10c04a[_0x0b00('0x2c')],'type':_0x10c04a[_0x0b00('0x2d')][_0x0b00('0x2e')]};});_0x387e82['model']=_[_0x0b00('0x2a')](_0x1bbe4f,_0x0b00('0x28'));_0x387e82['query']=_[_0x0b00('0x2f')](_0x52567c['query']);_0x387e82['filters']=_[_0x0b00('0x30')](_0x387e82[_0x0b00('0x31')],_0x387e82[_0x0b00('0x32')]);_0x1e4206[_0x0b00('0x33')]=_[_0x0b00('0x30')](_0x387e82[_0x0b00('0x31')],qs['fields'](_0x52567c[_0x0b00('0x32')]['fields']));_0x1e4206[_0x0b00('0x33')]=_0x1e4206[_0x0b00('0x33')][_0x0b00('0x34')]?_0x1e4206['attributes']:_0x387e82[_0x0b00('0x31')];if(!_0x52567c[_0x0b00('0x32')][_0x0b00('0x35')]('nolimit')){_0x1e4206['limit']=qs[_0x0b00('0x1b')](_0x52567c[_0x0b00('0x32')][_0x0b00('0x1b')]);_0x1e4206[_0x0b00('0x1a')]=qs[_0x0b00('0x1a')](_0x52567c['query']['offset']);}_0x1e4206[_0x0b00('0x36')]=qs[_0x0b00('0x37')](_0x52567c[_0x0b00('0x32')][_0x0b00('0x37')]);_0x1e4206[_0x0b00('0x38')]=qs[_0x0b00('0x39')](_['pick'](_0x52567c['query'],_0x387e82['filters']),_0x1bbe4f);if(_0x52567c[_0x0b00('0x32')][_0x0b00('0x3a')]){_0x1e4206[_0x0b00('0x38')]=_['merge'](_0x1e4206[_0x0b00('0x38')],{'$or':_['map'](_0x1bbe4f,function(_0x5a4590){if(_0x5a4590['type']!==_0x0b00('0x3b')){var _0x328940={};_0x328940[_0x5a4590['name']]={'$like':'%'+_0x52567c[_0x0b00('0x32')][_0x0b00('0x3a')]+'%'};return _0x328940;}})});}_0x1e4206=_['merge']({},_0x1e4206,_0x52567c[_0x0b00('0x3c')]);var _0x297153={'where':_0x1e4206[_0x0b00('0x38')]};return db['CmHopperHistory'][_0x0b00('0x1d')](_0x297153)['then'](function(_0x43cda6){_0x5e049c[_0x0b00('0x1d')]=_0x43cda6;if(_0x52567c[_0x0b00('0x32')]['includeAll']){_0x1e4206[_0x0b00('0x3d')]=[{'all':!![]}];}return db[_0x0b00('0x2b')][_0x0b00('0x3e')](_0x1e4206);})[_0x0b00('0x24')](function(_0x1cb36e){_0x5e049c[_0x0b00('0x3f')]=_0x1cb36e;return _0x5e049c;})[_0x0b00('0x24')](respondWithFilteredResult(_0x5a8bbc,_0x1e4206))[_0x0b00('0x40')](handleError(_0x5a8bbc,null));};exports[_0x0b00('0x41')]=function(_0x152412,_0x547aac){var _0x1a2dd3={'raw':!![],'where':{'id':_0x152412[_0x0b00('0x42')]['id']}},_0x3ac844={};_0x3ac844[_0x0b00('0x31')]=_[_0x0b00('0x2f')](db[_0x0b00('0x2b')][_0x0b00('0x43')]);_0x3ac844[_0x0b00('0x32')]=_[_0x0b00('0x2f')](_0x152412[_0x0b00('0x32')]);_0x3ac844[_0x0b00('0x39')]=_[_0x0b00('0x30')](_0x3ac844[_0x0b00('0x31')],_0x3ac844[_0x0b00('0x32')]);_0x1a2dd3[_0x0b00('0x33')]=_['intersection'](_0x3ac844['model'],qs['fields'](_0x152412[_0x0b00('0x32')][_0x0b00('0x44')]));_0x1a2dd3[_0x0b00('0x33')]=_0x1a2dd3[_0x0b00('0x33')][_0x0b00('0x34')]?_0x1a2dd3[_0x0b00('0x33')]:_0x3ac844[_0x0b00('0x31')];if(_0x152412[_0x0b00('0x32')][_0x0b00('0x45')]){_0x1a2dd3['include']=[{'all':!![]}];}_0x1a2dd3=_[_0x0b00('0x46')]({},_0x1a2dd3,_0x152412[_0x0b00('0x3c')]);return db[_0x0b00('0x2b')][_0x0b00('0x47')](_0x1a2dd3)[_0x0b00('0x24')](handleEntityNotFound(_0x547aac,null))[_0x0b00('0x24')](respondWithResult(_0x547aac,null))['catch'](handleError(_0x547aac,null));};exports[_0x0b00('0x48')]=function(_0x54e455,_0x59f9ad){return db[_0x0b00('0x2b')][_0x0b00('0x48')](_0x54e455[_0x0b00('0x49')],{})[_0x0b00('0x24')](respondWithResult(_0x59f9ad,0xc9))[_0x0b00('0x40')](handleError(_0x59f9ad,null));};exports[_0x0b00('0x4a')]=function(_0x5198ff,_0x517ee4){return db['CmHopperHistory'][_0x0b00('0x4a')]()[_0x0b00('0x24')](respondWithResult(_0x517ee4,null))[_0x0b00('0x40')](handleError(_0x517ee4,null));};exports['update']=function(_0x59a81a,_0x47050b){if(_0x59a81a[_0x0b00('0x49')][_0x0b00('0x4b')]){delete _0x59a81a[_0x0b00('0x49')]['uniqueid'];}return db[_0x0b00('0x2b')][_0x0b00('0x47')]({'where':{'uniqueid':_0x59a81a[_0x0b00('0x42')]['id']}})[_0x0b00('0x24')](handleEntityNotFound(_0x47050b,null))[_0x0b00('0x24')](saveUpdates(_0x59a81a['body'],null))['then'](respondWithResult(_0x47050b,null))[_0x0b00('0x40')](handleError(_0x47050b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7ce2392..7d951ac 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 _0xaac4=['bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','api','moment'];(function(_0x19d7a4,_0x57abd6){var _0x513a7d=function(_0x27151e){while(--_0x27151e){_0x19d7a4['push'](_0x19d7a4['shift']());}};_0x513a7d(++_0x57abd6);}(_0xaac4,0x6c));var _0x4aac=function(_0xb93836,_0x2e7941){_0xb93836=_0xb93836-0x0;var _0x2b3e5b=_0xaac4[_0xb93836];return _0x2b3e5b;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var logger=require('../../config/logger')(_0x4aac('0x2'));var moment=require(_0x4aac('0x3'));var BPromise=require(_0x4aac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4aac('0x5'));var rimraf=require(_0x4aac('0x6'));var config=require(_0x4aac('0x7'));var attributes=require(_0x4aac('0x8'));module[_0x4aac('0x9')]=function(_0x4c94f2,_0x2d795c){return _0x4c94f2[_0x4aac('0xa')](_0x4aac('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x4aac('0xc'),'fields':['endtime']},{'name':_0x4aac('0xd'),'fields':[_0x4aac('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x50a8=['request-promise','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0x2420fe,_0x358729){var _0x591f60=function(_0x398cea){while(--_0x398cea){_0x2420fe['push'](_0x2420fe['shift']());}};_0x591f60(++_0x358729);}(_0x50a8,0x193));var _0x850a=function(_0x496624,_0x16d7ab){_0x496624=_0x496624-0x0;var _0x3c4852=_0x50a8[_0x496624];return _0x3c4852;};'use strict';var _=require('lodash');var util=require(_0x850a('0x0'));var logger=require('../../config/logger')(_0x850a('0x1'));var moment=require(_0x850a('0x2'));var BPromise=require(_0x850a('0x3'));var rp=require(_0x850a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x850a('0x5'));module[_0x850a('0x6')]=function(_0x530b92,_0x31c037){return _0x530b92['define'](_0x850a('0x7'),attributes,{'tableName':_0x850a('0x8'),'paranoid':![],'indexes':[{'name':_0x850a('0x9'),'fields':['endtime']},{'name':_0x850a('0xa'),'fields':[_0x850a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 7b6d1ee..80f817b 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 _0x208d=['outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','COUNT','sequelize','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','where','`state`\x20=\x200,\x201,\x20null'];(function(_0x418aad,_0x427867){var _0x10c64a=function(_0x20ffb1){while(--_0x20ffb1){_0x418aad['push'](_0x418aad['shift']());}};_0x10c64a(++_0x427867);}(_0x208d,0xa4));var _0xd208=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x208d[_0x4defd6];return _0x4c9276;};'use strict';var _=require(_0xd208('0x0'));var util=require(_0xd208('0x1'));var moment=require(_0xd208('0x2'));var BPromise=require(_0xd208('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd208('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd208('0x5'));var logger=require(_0xd208('0x6'))(_0xd208('0x7'));var config=require(_0xd208('0x8'));var jayson=require(_0xd208('0x9'));var client=jayson['client'][_0xd208('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6aabd,_0x25008a,_0x521d9c){return new BPromise(function(_0xc03f32,_0x4477a6){return client['request'](_0x6aabd,_0x521d9c)[_0xd208('0xb')](function(_0x406cbb){logger['info'](_0xd208('0xc'),_0x25008a,_0xd208('0xd'));logger[_0xd208('0xe')](_0xd208('0xf'),_0x25008a,'request\x20sent',JSON[_0xd208('0x10')](_0x406cbb));if(_0x406cbb[_0xd208('0x11')]){if(_0x406cbb['error'][_0xd208('0x12')]===0x1f4){logger[_0xd208('0x11')](_0xd208('0xc'),_0x25008a,_0x406cbb[_0xd208('0x11')][_0xd208('0x13')]);return _0x4477a6(_0x406cbb[_0xd208('0x11')][_0xd208('0x13')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x25008a,_0x406cbb[_0xd208('0x11')][_0xd208('0x13')]);return _0xc03f32(_0x406cbb[_0xd208('0x11')][_0xd208('0x13')]);}else{logger[_0xd208('0x14')](_0xd208('0xc'),_0x25008a,'request\x20sent');_0xc03f32(_0x406cbb[_0xd208('0x15')][_0xd208('0x13')]);}})['catch'](function(_0x6ac23e){logger['error'](_0xd208('0xc'),_0x25008a,_0x6ac23e);_0x4477a6(_0x6ac23e);});});}exports[_0xd208('0x16')]=function(_0x337671){var _0x370c66=this;return new Promise(function(_0x60d7fd,_0xca0177){return db[_0xd208('0x17')][_0xd208('0x18')](_0x337671[_0xd208('0x19')],{'raw':_0x337671['options']?_0x337671[_0xd208('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xd208('0xb')](function(_0x52e142){logger[_0xd208('0x14')](_0xd208('0x16'),_0x337671);logger[_0xd208('0xe')](_0xd208('0x16'),_0x337671,JSON[_0xd208('0x10')](_0x52e142));_0x60d7fd(_0x52e142);})['catch'](function(_0x4e2928){logger[_0xd208('0x11')]('CreateCmHopperHistory',_0x4e2928[_0xd208('0x13')],_0x337671);_0xca0177(_0x370c66[_0xd208('0x11')](0x1f4,_0x4e2928[_0xd208('0x13')]));});});};exports[_0xd208('0x1b')]=function(_0x42d90c){var _0x174297=this;return new Promise(function(_0x514bb5,_0x25e538){return db[_0xd208('0x17')][_0xd208('0x1c')]({'raw':_0x42d90c[_0xd208('0x1a')]?_0x42d90c[_0xd208('0x1a')][_0xd208('0x1d')]===undefined?!![]:![]:!![],'where':_0x42d90c['options']?_0x42d90c['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xd208('0x1e'),db['sequelize']['col']('id')),'predictiveIntervalTotalCalls'],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db['sequelize']['fn']('IF',db[_0xd208('0x1f')]['literal'](_0xd208('0x20')))),_0xd208('0x21')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')](_0xd208('0x23')))),_0xd208('0x24')],[db['sequelize']['fn'](_0xd208('0x1e'),db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')]['literal'](_0xd208('0x25')))),_0xd208('0x26')],[db['sequelize']['fn']('AVG',db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xd208('0x27')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x28'),db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xd208('0x29')]]})[_0xd208('0xb')](function(_0xffe4b5){logger[_0xd208('0x14')](_0xd208('0x1b'),_0x42d90c);logger[_0xd208('0xe')](_0xd208('0x1b'),_0x42d90c,JSON[_0xd208('0x10')](_0xffe4b5));_0x514bb5(_0xffe4b5);})[_0xd208('0x2a')](function(_0x389170){logger[_0xd208('0x11')](_0xd208('0x1b'),_0x389170['message'],_0x42d90c);_0x25e538(_0x174297[_0xd208('0x11')](0x1f4,_0x389170[_0xd208('0x13')]));});});};exports[_0xd208('0x2b')]=function(_0xad319e){var _0x388128=this;return new Promise(function(_0x3b61c5,_0x2b2751){return db[_0xd208('0x17')][_0xd208('0x1c')]({'raw':_0xad319e[_0xd208('0x1a')]?_0xad319e[_0xd208('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xad319e[_0xd208('0x1a')]?_0xad319e[_0xd208('0x1a')][_0xd208('0x2c')]||null:null,'attributes':[['campaign','name'],[db[_0xd208('0x1f')]['fn']('COUNT',db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')](_0xd208('0x2d')))),_0xd208('0x2e')],[db[_0xd208('0x1f')]['fn']('COUNT',db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')](_0xd208('0x2f')))),_0xd208('0x30')],[db[_0xd208('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')](_0xd208('0x20')))),_0xd208('0x31')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db['sequelize']['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')](_0xd208('0x32')))),_0xd208('0x33')],[db['sequelize']['fn'](_0xd208('0x1e'),db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xd208('0x34')],[db[_0xd208('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd208('0x35')],[db[_0xd208('0x1f')]['fn']('COUNT',db[_0xd208('0x1f')]['fn']('IF',db['sequelize'][_0xd208('0x22')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xd208('0x36')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')](_0xd208('0x37')))),_0xd208('0x38')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0xd208('0x39')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')](_0xd208('0x3a')))),'outboundOriginateFailureCallsDay'],[db[_0xd208('0x1f')]['fn']('COUNT',db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')]['literal'](_0xd208('0x3b')))),_0xd208('0x3c')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db[_0xd208('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xd208('0x3d')))),_0xd208('0x3e')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')][_0xd208('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0xd208('0x3c')],[db[_0xd208('0x1f')]['fn']('COUNT',db[_0xd208('0x1f')]['fn']('IF',db[_0xd208('0x1f')]['literal'](_0xd208('0x3f')))),_0xd208('0x40')]],'group':[_0xd208('0x41')]})[_0xd208('0xb')](function(_0x5e777d){logger['info'](_0xd208('0x2b'),_0xad319e);logger[_0xd208('0xe')](_0xd208('0x2b'),_0xad319e,JSON['stringify'](_0x5e777d));_0x3b61c5(_0x5e777d);})[_0xd208('0x2a')](function(_0x37b034){logger[_0xd208('0x11')](_0xd208('0x2b'),_0x37b034[_0xd208('0x13')],_0xad319e);_0x2b2751(_0x388128[_0xd208('0x11')](0x1f4,_0x37b034[_0xd208('0x13')]));});});};exports[_0xd208('0x42')]=function(_0x2bedcc){var _0x1457db=this;return new Promise(function(_0xfeb66b,_0x218ade){return db[_0xd208('0x17')][_0xd208('0x1c')]({'raw':_0x2bedcc[_0xd208('0x1a')]?_0x2bedcc[_0xd208('0x1a')][_0xd208('0x1d')]===undefined?!![]:![]:!![],'where':_0x2bedcc[_0xd208('0x1a')]?_0x2bedcc[_0xd208('0x1a')][_0xd208('0x2c')]||null:null,'attributes':[[_0xd208('0x41'),_0xd208('0x43')],[db[_0xd208('0x1f')]['fn']('COUNT',db[_0xd208('0x1f')]['col']('id')),_0xd208('0x44')],[db[_0xd208('0x1f')]['fn'](_0xd208('0x1e'),db['sequelize']['fn']('IF',db[_0xd208('0x1f')]['literal'](_0xd208('0x20')))),_0xd208('0x45')]],'group':['campaign']})['then'](function(_0x1e619b){logger['info'](_0xd208('0x42'),_0x2bedcc);logger[_0xd208('0xe')]('GetCampaignHopperHistory',_0x2bedcc,JSON[_0xd208('0x10')](_0x1e619b));_0xfeb66b(_0x1e619b);})[_0xd208('0x2a')](function(_0x19cf4d){logger['error'](_0xd208('0x42'),_0x19cf4d[_0xd208('0x13')],_0x2bedcc);_0x218ade(_0x1457db[_0xd208('0x11')](0x1f4,_0x19cf4d[_0xd208('0x13')]));});});}; \ No newline at end of file +var _0x79d3=['outboundReCallsDay','GetVoiceQueueHopperHistory','name','col','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','where','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x17ab72,_0x25f422){var _0x2d4c16=function(_0x15ff03){while(--_0x15ff03){_0x17ab72['push'](_0x17ab72['shift']());}};_0x2d4c16(++_0x25f422);}(_0x79d3,0x179));var _0x379d=function(_0x19f040,_0x4b2d63){_0x19f040=_0x19f040-0x0;var _0x3ea60d=_0x79d3[_0x19f040];return _0x3ea60d;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rs=require(_0x379d('0x4'));var fs=require('fs');var Redis=require(_0x379d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x379d('0x6'));var logger=require(_0x379d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x379d('0x8'));var client=jayson[_0x379d('0x9')][_0x379d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x214194,_0x2bf985,_0x4f32c7){return new BPromise(function(_0x226765,_0x1fb281){return client[_0x379d('0xb')](_0x214194,_0x4f32c7)['then'](function(_0x59c547){logger[_0x379d('0xc')](_0x379d('0xd'),_0x2bf985,'request\x20sent');logger[_0x379d('0xe')](_0x379d('0xf'),_0x2bf985,_0x379d('0x10'),JSON[_0x379d('0x11')](_0x59c547));if(_0x59c547['error']){if(_0x59c547[_0x379d('0x12')][_0x379d('0x13')]===0x1f4){logger['error'](_0x379d('0xd'),_0x2bf985,_0x59c547[_0x379d('0x12')]['message']);return _0x1fb281(_0x59c547['error'][_0x379d('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2bf985,_0x59c547[_0x379d('0x12')]['message']);return _0x226765(_0x59c547[_0x379d('0x12')]['message']);}else{logger[_0x379d('0xc')](_0x379d('0xd'),_0x2bf985,_0x379d('0x10'));_0x226765(_0x59c547[_0x379d('0x15')][_0x379d('0x14')]);}})[_0x379d('0x16')](function(_0x18f0fb){logger[_0x379d('0x12')](_0x379d('0xd'),_0x2bf985,_0x18f0fb);_0x1fb281(_0x18f0fb);});});}exports[_0x379d('0x17')]=function(_0x58653d){var _0x4c2add=this;return new Promise(function(_0x37f319,_0xf18983){return db[_0x379d('0x18')][_0x379d('0x19')](_0x58653d[_0x379d('0x1a')],{'raw':_0x58653d[_0x379d('0x1b')]?_0x58653d['options'][_0x379d('0x1c')]===undefined?!![]:![]:!![]})[_0x379d('0x1d')](function(_0x34f791){logger[_0x379d('0xc')](_0x379d('0x17'),_0x58653d);logger[_0x379d('0xe')](_0x379d('0x17'),_0x58653d,JSON[_0x379d('0x11')](_0x34f791));_0x37f319(_0x34f791);})[_0x379d('0x16')](function(_0x139d23){logger[_0x379d('0x12')](_0x379d('0x17'),_0x139d23[_0x379d('0x14')],_0x58653d);_0xf18983(_0x4c2add[_0x379d('0x12')](0x1f4,_0x139d23[_0x379d('0x14')]));});});};exports[_0x379d('0x1e')]=function(_0x26e2b3){var _0x1471c8=this;return new Promise(function(_0x15c29c,_0x4a082b){return db[_0x379d('0x18')]['findAll']({'raw':_0x26e2b3[_0x379d('0x1b')]?_0x26e2b3[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x26e2b3[_0x379d('0x1b')]?_0x26e2b3[_0x379d('0x1b')][_0x379d('0x1f')]||null:null,'attributes':[[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x24')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x25')))),_0x379d('0x26')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x27')))),_0x379d('0x28')],[db[_0x379d('0x20')]['fn'](_0x379d('0x29'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0x379d('0x20')]['fn'](_0x379d('0x29'),db['sequelize']['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x2b')))),_0x379d('0x2c')]]})[_0x379d('0x1d')](function(_0xd6bb2d){logger['info'](_0x379d('0x1e'),_0x26e2b3);logger['debug'](_0x379d('0x1e'),_0x26e2b3,JSON[_0x379d('0x11')](_0xd6bb2d));_0x15c29c(_0xd6bb2d);})[_0x379d('0x16')](function(_0x4cc85a){logger['error'](_0x379d('0x1e'),_0x4cc85a[_0x379d('0x14')],_0x26e2b3);_0x4a082b(_0x1471c8['error'](0x1f4,_0x4cc85a[_0x379d('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4f44d7){var _0x5455e3=this;return new Promise(function(_0x408740,_0x459dce){return db[_0x379d('0x18')][_0x379d('0x2d')]({'raw':_0x4f44d7[_0x379d('0x1b')]?_0x4f44d7[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f44d7[_0x379d('0x1b')]?_0x4f44d7['options'][_0x379d('0x1f')]||null:null,'attributes':[[_0x379d('0x2e'),'name'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x2f')))),_0x379d('0x30')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')]['literal'](_0x379d('0x31')))),_0x379d('0x32')],[db['sequelize']['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x33')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x34')))),_0x379d('0x35')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x37')))),_0x379d('0x38')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x39')))),_0x379d('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x3b')))),_0x379d('0x3c')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x3d')))),_0x379d('0x3e')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x3f')))),'outboundRejectCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x379d('0x41')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x42')))),_0x379d('0x43')]],'group':['campaign']})[_0x379d('0x1d')](function(_0x4fb8fe){logger['info'](_0x379d('0x44'),_0x4f44d7);logger[_0x379d('0xe')](_0x379d('0x44'),_0x4f44d7,JSON[_0x379d('0x11')](_0x4fb8fe));_0x408740(_0x4fb8fe);})['catch'](function(_0x58da4e){logger[_0x379d('0x12')](_0x379d('0x44'),_0x58da4e[_0x379d('0x14')],_0x4f44d7);_0x459dce(_0x5455e3[_0x379d('0x12')](0x1f4,_0x58da4e[_0x379d('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x1fdb72){var _0x11a6c8=this;return new Promise(function(_0x2d07f1,_0x2120e1){return db['CmHopperHistory']['findAll']({'raw':_0x1fdb72['options']?_0x1fdb72[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fdb72[_0x379d('0x1b')]?_0x1fdb72[_0x379d('0x1b')][_0x379d('0x1f')]||null:null,'attributes':[[_0x379d('0x2e'),_0x379d('0x45')],[db['sequelize']['fn'](_0x379d('0x21'),db[_0x379d('0x20')][_0x379d('0x46')]('id')),_0x379d('0x47')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x48')]],'group':['campaign']})[_0x379d('0x1d')](function(_0x5bef33){logger[_0x379d('0xc')]('GetCampaignHopperHistory',_0x1fdb72);logger['debug'](_0x379d('0x49'),_0x1fdb72,JSON['stringify'](_0x5bef33));_0x2d07f1(_0x5bef33);})['catch'](function(_0x57587a){logger[_0x379d('0x12')](_0x379d('0x49'),_0x57587a['message'],_0x1fdb72);_0x2120e1(_0x11a6c8[_0x379d('0x12')](0x1f4,_0x57587a[_0x379d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 6d6aea5..46a4c8f 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 _0x366d=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','update','exports','path'];(function(_0x97648b,_0x425823){var _0x26b249=function(_0x421865){while(--_0x421865){_0x97648b['push'](_0x97648b['shift']());}};_0x26b249(++_0x425823);}(_0x366d,0xd1));var _0xd366=function(_0x27b0ce,_0x45c4ae){_0x27b0ce=_0x27b0ce-0x0;var _0x2fd2e6=_0x366d[_0x27b0ce];return _0x2fd2e6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd366('0x0'));var timeout=require('connect-timeout');var express=require(_0xd366('0x1'));var router=express[_0xd366('0x2')]();var fs_extra=require(_0xd366('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd366('0x4'));var config=require(_0xd366('0x5'));var controller=require('./cmHopperHistory.controller');router[_0xd366('0x6')]('/',auth[_0xd366('0x7')](),controller[_0xd366('0x8')]);router[_0xd366('0x6')]('/describe',auth[_0xd366('0x7')](),controller[_0xd366('0x9')]);router[_0xd366('0x6')](_0xd366('0xa'),auth[_0xd366('0x7')](),controller[_0xd366('0xb')]);router['post']('/',auth[_0xd366('0x7')](),controller[_0xd366('0xc')]);router['put'](_0xd366('0xa'),auth[_0xd366('0x7')](),controller[_0xd366('0xd')]);module[_0xd366('0xe')]=router; \ No newline at end of file +var _0xc59e=['express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','exports','util','path','connect-timeout'];(function(_0x51be09,_0x397cfe){var _0x4e2f77=function(_0x1a18c5){while(--_0x1a18c5){_0x51be09['push'](_0x51be09['shift']());}};_0x4e2f77(++_0x397cfe);}(_0xc59e,0xc9));var _0xec59=function(_0x300f1f,_0x598f68){_0x300f1f=_0x300f1f-0x0;var _0x430c2f=_0xc59e[_0x300f1f];return _0x430c2f;};'use strict';var multer=require('multer');var util=require(_0xec59('0x0'));var path=require(_0xec59('0x1'));var timeout=require(_0xec59('0x2'));var express=require(_0xec59('0x3'));var router=express[_0xec59('0x4')]();var fs_extra=require(_0xec59('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xec59('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xec59('0x7')]('/',auth[_0xec59('0x8')](),controller[_0xec59('0x9')]);router['get'](_0xec59('0xa'),auth['isAuthenticated'](),controller[_0xec59('0xb')]);router[_0xec59('0x7')](_0xec59('0xc'),auth[_0xec59('0x8')](),controller['show']);router[_0xec59('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xec59('0xe')](_0xec59('0xc'),auth[_0xec59('0x8')](),controller[_0xec59('0xf')]);module[_0xec59('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 4e74015..e0d5fa3 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 _0x448b=['name','sequelize','exports','STRING'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x448b,0x125));var _0xb448=function(_0x3d8519,_0x1911d3){_0x3d8519=_0x3d8519-0x0;var _0x685bca=_0x448b[_0x3d8519];return _0x685bca;};'use strict';var Sequelize=require(_0xb448('0x0'));module[_0xb448('0x1')]={'name':{'type':Sequelize[_0xb448('0x2')],'unique':_0xb448('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb448('0x2')]},'dialPrefix':{'type':Sequelize[_0xb448('0x2')]}}; \ No newline at end of file +var _0x8c79=['sequelize','STRING'];(function(_0x9ccdee,_0x406dcb){var _0x201ddc=function(_0x4af6ab){while(--_0x4af6ab){_0x9ccdee['push'](_0x9ccdee['shift']());}};_0x201ddc(++_0x406dcb);}(_0x8c79,0xa8));var _0x98c7=function(_0x444adf,_0x8bfe5){_0x444adf=_0x444adf-0x0;var _0x1f8161=_0x8c79[_0x444adf];return _0x1f8161;};'use strict';var Sequelize=require(_0x98c7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x98c7('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d885112..ca8f899 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 _0x9fde=['Lists','UserProfileResource','end','error','name','map','CmList','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','rawAttributes','catch','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','ListId','Disposition','findOne','order','options','rows','removeDispositions','ids','addContacts','CmContact','tags','push','each','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','hasOwnProperty','nolimit','raw','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','cm_contact_has_items','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','Content-type','text/csv','download','addCustomField','Sequelize','TEXT','text','INTEGER','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','sequelize','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','undefined','offset','count','limit','set','Content-Range','json','apply','reject','then','destroy','get'];(function(_0x3a2cc6,_0x68ff5a){var _0x31e852=function(_0x4d1e5a){while(--_0x4d1e5a){_0x3a2cc6['push'](_0x3a2cc6['shift']());}};_0x31e852(++_0x68ff5a);}(_0x9fde,0x73));var _0xe9fd=function(_0xffd8b0,_0x12c51f){_0xffd8b0=_0xffd8b0-0x0;var _0x301ba0=_0x9fde[_0xffd8b0];return _0x301ba0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe9fd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9fd('0x1'));var moment=require('moment');var BPromise=require(_0xe9fd('0x2'));var Mustache=require('mustache');var util=require(_0xe9fd('0x3'));var path=require(_0xe9fd('0x4'));var sox=require(_0xe9fd('0x5'));var csv=require('to-csv');var ejs=require(_0xe9fd('0x6'));var fs=require('fs');var fs_extra=require(_0xe9fd('0x7'));var _=require(_0xe9fd('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe9fd('0x9'));var deskjs=require(_0xe9fd('0xa'));var toCsv=require(_0xe9fd('0xb'));var querystring=require(_0xe9fd('0xc'));var Papa=require(_0xe9fd('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe9fd('0xe'));var as=require(_0xe9fd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9fd('0x10'));var utils=require(_0xe9fd('0x11'));var config=require(_0xe9fd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9fd('0x13'))['db'];var csv_results;config[_0xe9fd('0x14')]=_[_0xe9fd('0x15')](config[_0xe9fd('0x14')],{'host':_0xe9fd('0x16'),'port':0x18eb});var socket=require(_0xe9fd('0x17'))(new Redis(config['redis']));require(_0xe9fd('0x18'))['register'](socket);function respondWithStatusCode(_0x3acdef,_0x5e67ba){_0x5e67ba=_0x5e67ba||0xcc;return function(_0xbd327d){if(_0xbd327d){return _0x3acdef[_0xe9fd('0x19')](_0x5e67ba);}return _0x3acdef[_0xe9fd('0x1a')](_0x5e67ba)['end']();};}function respondWithResult(_0x4a069f,_0x6fa73d){_0x6fa73d=_0x6fa73d||0xc8;return function(_0x26bc0f){if(_0x26bc0f){return _0x4a069f[_0xe9fd('0x1a')](_0x6fa73d)['json'](_0x26bc0f);}};}function respondWithFilteredResult(_0x42ea65,_0x65033b){return function(_0x2d47a2){if(_0x2d47a2){var _0x169f14=typeof _0x65033b['offset']===_0xe9fd('0x1b')&&typeof _0x65033b['limit']==='undefined';var _0x5341a0=_0x2d47a2['count'];var _0x3ecb62=_0x169f14?0x0:_0x65033b[_0xe9fd('0x1c')];var _0x51dbe1=_0x169f14?_0x2d47a2[_0xe9fd('0x1d')]:_0x65033b['offset']+_0x65033b[_0xe9fd('0x1e')];var _0x2183e3;if(_0x51dbe1>=_0x5341a0){_0x51dbe1=_0x5341a0;_0x2183e3=0xc8;}else{_0x2183e3=0xce;}_0x42ea65[_0xe9fd('0x1a')](_0x2183e3);return _0x42ea65[_0xe9fd('0x1f')](_0xe9fd('0x20'),_0x3ecb62+'-'+_0x51dbe1+'/'+_0x5341a0)[_0xe9fd('0x21')](_0x2d47a2);}return null;};}function patchUpdates(_0x50b9b0){return function(_0x126b7a){try{jsonpatch[_0xe9fd('0x22')](_0x126b7a,_0x50b9b0,!![]);}catch(_0x4bf244){return BPromise[_0xe9fd('0x23')](_0x4bf244);}return _0x126b7a['save']();};}function saveUpdates(_0x240f61,_0x53c6e2){return function(_0x1324ea){if(_0x1324ea){return _0x1324ea['update'](_0x240f61)[_0xe9fd('0x24')](function(_0x239660){return _0x239660;});}return null;};}function removeEntity(_0x2457f2,_0x2eca0a){return function(_0x373a2f){if(_0x373a2f){return _0x373a2f[_0xe9fd('0x25')]()[_0xe9fd('0x24')](function(){var _0x3e2015=_0x373a2f[_0xe9fd('0x26')]({'plain':!![]});var _0x2337a8=_0xe9fd('0x27');return db[_0xe9fd('0x28')][_0xe9fd('0x25')]({'where':{'type':_0x2337a8,'resourceId':_0x3e2015['id']}})[_0xe9fd('0x24')](function(){return _0x373a2f;});})[_0xe9fd('0x24')](function(){_0x2457f2[_0xe9fd('0x1a')](0xcc)[_0xe9fd('0x29')]();});}};}function handleEntityNotFound(_0x2cae1e,_0x226243){return function(_0x2f74f1){if(!_0x2f74f1){_0x2cae1e[_0xe9fd('0x19')](0x194);}return _0x2f74f1;};}function handleError(_0x3858ab,_0x303846){_0x303846=_0x303846||0x1f4;return function(_0x121187){logger[_0xe9fd('0x2a')](_0x121187['stack']);if(_0x121187[_0xe9fd('0x2b')]){delete _0x121187['name'];}_0x3858ab[_0xe9fd('0x1a')](_0x303846)['send'](_0x121187);};}exports['index']=function(_0x14d8b0,_0x1fe664){var _0x31bba2={},_0x31e18f={},_0x9d465={'count':0x0,'rows':[]};var _0x4941f3=_[_0xe9fd('0x2c')](db[_0xe9fd('0x2d')]['rawAttributes'],function(_0x4f7a81){return{'name':_0x4f7a81[_0xe9fd('0x2e')],'type':_0x4f7a81[_0xe9fd('0x2f')][_0xe9fd('0x30')]};});_0x31e18f[_0xe9fd('0x31')]=_['map'](_0x4941f3,_0xe9fd('0x2b'));_0x31e18f[_0xe9fd('0x32')]=_[_0xe9fd('0x33')](_0x14d8b0[_0xe9fd('0x32')]);_0x31e18f[_0xe9fd('0x34')]=_[_0xe9fd('0x35')](_0x31e18f['model'],_0x31e18f[_0xe9fd('0x32')]);_0x31bba2[_0xe9fd('0x36')]=_[_0xe9fd('0x35')](_0x31e18f['model'],qs[_0xe9fd('0x37')](_0x14d8b0['query'][_0xe9fd('0x37')]));_0x31bba2['attributes']=_0x31bba2['attributes'][_0xe9fd('0x38')]?_0x31bba2[_0xe9fd('0x36')]:_0x31e18f[_0xe9fd('0x31')];if(!_0x14d8b0[_0xe9fd('0x32')]['hasOwnProperty']('nolimit')){_0x31bba2[_0xe9fd('0x1e')]=qs[_0xe9fd('0x1e')](_0x14d8b0['query']['limit']);_0x31bba2[_0xe9fd('0x1c')]=qs[_0xe9fd('0x1c')](_0x14d8b0[_0xe9fd('0x32')][_0xe9fd('0x1c')]);}_0x31bba2['order']=qs[_0xe9fd('0x39')](_0x14d8b0[_0xe9fd('0x32')][_0xe9fd('0x39')]);_0x31bba2[_0xe9fd('0x3a')]=qs[_0xe9fd('0x34')](_[_0xe9fd('0x3b')](_0x14d8b0[_0xe9fd('0x32')],_0x31e18f[_0xe9fd('0x34')]),_0x4941f3);if(_0x14d8b0['query']['filter']){_0x31bba2['where']=_[_0xe9fd('0x3c')](_0x31bba2[_0xe9fd('0x3a')],{'$or':_[_0xe9fd('0x2c')](_0x4941f3,function(_0xaa7b7c){if(_0xaa7b7c[_0xe9fd('0x2f')]!==_0xe9fd('0x3d')){var _0xa01305={};_0xa01305[_0xaa7b7c[_0xe9fd('0x2b')]]={'$like':'%'+_0x14d8b0[_0xe9fd('0x32')][_0xe9fd('0x3e')]+'%'};return _0xa01305;}})});}_0x31bba2=_[_0xe9fd('0x3c')]({},_0x31bba2,_0x14d8b0['options']);var _0x3e862a={'where':_0x31bba2[_0xe9fd('0x3a')]};return db[_0xe9fd('0x2d')][_0xe9fd('0x1d')](_0x3e862a)['then'](function(_0x5a801e){_0x9d465[_0xe9fd('0x1d')]=_0x5a801e;if(_0x14d8b0[_0xe9fd('0x32')][_0xe9fd('0x3f')]){_0x31bba2[_0xe9fd('0x40')]=[{'all':!![]}];}return db[_0xe9fd('0x2d')][_0xe9fd('0x41')](_0x31bba2);})['then'](function(_0x4c1e2b){_0x9d465['rows']=_0x4c1e2b;return _0x9d465;})['then'](respondWithFilteredResult(_0x1fe664,_0x31bba2))['catch'](handleError(_0x1fe664,null));};exports[_0xe9fd('0x42')]=function(_0x1a9872,_0x3d3897){var _0x5eb4af={'raw':![],'where':{'id':_0x1a9872[_0xe9fd('0x43')]['id']}},_0x2c57bf={};_0x2c57bf[_0xe9fd('0x31')]=_['keys'](db[_0xe9fd('0x2d')][_0xe9fd('0x44')]);_0x2c57bf[_0xe9fd('0x32')]=_[_0xe9fd('0x33')](_0x1a9872[_0xe9fd('0x32')]);_0x2c57bf[_0xe9fd('0x34')]=_[_0xe9fd('0x35')](_0x2c57bf[_0xe9fd('0x31')],_0x2c57bf['query']);_0x5eb4af['attributes']=_['intersection'](_0x2c57bf[_0xe9fd('0x31')],qs['fields'](_0x1a9872[_0xe9fd('0x32')][_0xe9fd('0x37')]));_0x5eb4af[_0xe9fd('0x36')]=_0x5eb4af[_0xe9fd('0x36')][_0xe9fd('0x38')]?_0x5eb4af['attributes']:_0x2c57bf['model'];if(_0x1a9872[_0xe9fd('0x32')][_0xe9fd('0x3f')]){_0x5eb4af[_0xe9fd('0x40')]=[{'all':!![]}];}_0x5eb4af=_[_0xe9fd('0x3c')]({},_0x5eb4af,_0x1a9872['options']);return db['CmList']['find'](_0x5eb4af)['then'](handleEntityNotFound(_0x3d3897,null))[_0xe9fd('0x24')](respondWithResult(_0x3d3897,null))[_0xe9fd('0x45')](handleError(_0x3d3897,null));};exports['create']=function(_0x2123b0,_0x4cd58a){return db['CmList']['create'](_0x2123b0['body'],{})['then'](function(_0x216c9e){var _0x40ba0e=_0x2123b0['user'][_0xe9fd('0x26')]({'plain':!![]});if(!_0x40ba0e)throw new Error(_0xe9fd('0x46'));if(_0x40ba0e[_0xe9fd('0x47')]===_0xe9fd('0x48')){var _0x3044b4=_0x216c9e[_0xe9fd('0x26')]({'plain':!![]});var _0x57a90c=_0xe9fd('0x27');return db['UserProfileSection'][_0xe9fd('0x49')]({'where':{'name':_0x57a90c,'userProfileId':_0x40ba0e[_0xe9fd('0x4a')]},'raw':!![]})[_0xe9fd('0x24')](function(_0x3c0167){if(_0x3c0167&&_0x3c0167[_0xe9fd('0x4b')]===0x0){return db[_0xe9fd('0x28')][_0xe9fd('0x4c')]({'name':_0x3044b4[_0xe9fd('0x2b')],'resourceId':_0x3044b4['id'],'type':_0x3c0167[_0xe9fd('0x2b')],'sectionId':_0x3c0167['id']},{})['then'](function(){return _0x216c9e;});}else{return _0x216c9e;}})[_0xe9fd('0x45')](function(_0x8bce12){logger[_0xe9fd('0x2a')](_0xe9fd('0x4d'),_0x8bce12);throw _0x8bce12;});}return _0x216c9e;})[_0xe9fd('0x24')](respondWithResult(_0x4cd58a,0xc9))[_0xe9fd('0x45')](handleError(_0x4cd58a,null));};exports[_0xe9fd('0x4e')]=function(_0x545183,_0xda4286){if(_0x545183[_0xe9fd('0x4f')]['id']){delete _0x545183['body']['id'];}return db['CmList'][_0xe9fd('0x49')]({'where':{'id':_0x545183[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0xda4286,null))['then'](saveUpdates(_0x545183[_0xe9fd('0x4f')],null))['then'](respondWithResult(_0xda4286,null))[_0xe9fd('0x45')](handleError(_0xda4286,null));};exports[_0xe9fd('0x25')]=function(_0x558a2a,_0x498790){return db[_0xe9fd('0x2d')][_0xe9fd('0x49')]({'where':{'id':_0x558a2a[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0x498790,null))[_0xe9fd('0x24')](removeEntity(_0x498790,null))['catch'](handleError(_0x498790,null));};exports[_0xe9fd('0x50')]=function(_0x3e8470,_0x3a278f){return db[_0xe9fd('0x2d')][_0xe9fd('0x50')]()[_0xe9fd('0x24')](respondWithResult(_0x3a278f,null))['catch'](handleError(_0x3a278f,null));};exports['addDisposition']=function(_0x1688a5,_0x2223af,_0x481193){if(_0x1688a5[_0xe9fd('0x4f')]['id']){delete _0x1688a5[_0xe9fd('0x4f')]['id'];}return db['CmList'][_0xe9fd('0x49')]({'where':{'id':_0x1688a5[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0x2223af,null))[_0xe9fd('0x24')](function(_0x1d04fc){if(_0x1d04fc){_0x1688a5[_0xe9fd('0x4f')][_0xe9fd('0x51')]=_0x1d04fc['id'];return db[_0xe9fd('0x52')]['create'](_0x1688a5['body']);}})[_0xe9fd('0x24')](respondWithResult(_0x2223af,null))[_0xe9fd('0x45')](handleError(_0x2223af,null));};exports['getDispositions']=function(_0x4c0e6b,_0x2a79d8,_0x50f38b){var _0x3c8bd5={'raw':![],'where':{}};var _0x5b9ff8={};var _0x3d856d={'count':0x0,'rows':[]};return db[_0xe9fd('0x2d')][_0xe9fd('0x53')]({'where':{'id':_0x4c0e6b[_0xe9fd('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a79d8,null))[_0xe9fd('0x24')](function(_0x35de8a){if(_0x35de8a){_0x5b9ff8[_0xe9fd('0x31')]=_[_0xe9fd('0x33')](db[_0xe9fd('0x52')][_0xe9fd('0x44')]);_0x5b9ff8[_0xe9fd('0x32')]=_['keys'](_0x4c0e6b['query']);_0x5b9ff8[_0xe9fd('0x34')]=_[_0xe9fd('0x35')](_0x5b9ff8[_0xe9fd('0x31')],_0x5b9ff8['query']);_0x3c8bd5[_0xe9fd('0x36')]=_['intersection'](_0x5b9ff8[_0xe9fd('0x31')],qs[_0xe9fd('0x37')](_0x4c0e6b[_0xe9fd('0x32')][_0xe9fd('0x37')]));_0x3c8bd5[_0xe9fd('0x36')]=_0x3c8bd5[_0xe9fd('0x36')][_0xe9fd('0x38')]?_0x3c8bd5[_0xe9fd('0x36')]:_0x5b9ff8[_0xe9fd('0x31')];if(!_0x4c0e6b['query']['hasOwnProperty']('nolimit')){_0x3c8bd5[_0xe9fd('0x1e')]=qs['limit'](_0x4c0e6b[_0xe9fd('0x32')][_0xe9fd('0x1e')]);_0x3c8bd5[_0xe9fd('0x1c')]=qs['offset'](_0x4c0e6b[_0xe9fd('0x32')][_0xe9fd('0x1c')]);}_0x3c8bd5[_0xe9fd('0x54')]=qs['sort'](_0x4c0e6b['query']['sort']);_0x3c8bd5['where']=qs[_0xe9fd('0x34')](_[_0xe9fd('0x3b')](_0x4c0e6b['query'],_0x5b9ff8[_0xe9fd('0x34')]));_0x3c8bd5['where'][_0xe9fd('0x51')]=_0x35de8a['id'];if(_0x4c0e6b[_0xe9fd('0x32')]['filter']){_0x3c8bd5[_0xe9fd('0x3a')]=_['merge'](_0x3c8bd5['where'],{'$or':_[_0xe9fd('0x2c')](_0x3c8bd5[_0xe9fd('0x36')],function(_0x42dfc8){var _0x3f4725={};_0x3f4725[_0x42dfc8]={'$like':'%'+_0x4c0e6b[_0xe9fd('0x32')][_0xe9fd('0x3e')]+'%'};return _0x3f4725;})});}_0x3c8bd5=_['merge']({},_0x3c8bd5,_0x4c0e6b[_0xe9fd('0x55')]);return db['Disposition']['count']({'where':_0x3c8bd5[_0xe9fd('0x3a')]})['then'](function(_0x4fff6b){_0x3d856d[_0xe9fd('0x1d')]=_0x4fff6b;if(_0x4c0e6b[_0xe9fd('0x32')][_0xe9fd('0x3f')]){_0x3c8bd5[_0xe9fd('0x40')]=[{'all':!![]}];}return db[_0xe9fd('0x52')][_0xe9fd('0x41')](_0x3c8bd5);})[_0xe9fd('0x24')](function(_0x25063f){_0x3d856d[_0xe9fd('0x56')]=_0x25063f;return _0x3d856d;});}})[_0xe9fd('0x24')](respondWithFilteredResult(_0x2a79d8,_0x3c8bd5))['catch'](handleError(_0x2a79d8,null));};exports[_0xe9fd('0x57')]=function(_0x1a4a05,_0x7bfd82,_0x33392d){return db['CmList'][_0xe9fd('0x49')]({'where':{'id':_0x1a4a05[_0xe9fd('0x43')]['id']}})['then'](handleEntityNotFound(_0x7bfd82,null))[_0xe9fd('0x24')](function(_0x270f2b){if(_0x270f2b){return _0x270f2b[_0xe9fd('0x57')](_0x1a4a05['query'][_0xe9fd('0x58')]);}})[_0xe9fd('0x24')](respondWithStatusCode(_0x7bfd82,null))[_0xe9fd('0x45')](handleError(_0x7bfd82,null));};exports[_0xe9fd('0x59')]=function(_0x3abea6,_0x1d2dbd,_0x31da9d){return db[_0xe9fd('0x2d')]['find']({'where':{'id':_0x3abea6['params']['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0x1d2dbd,null))[_0xe9fd('0x24')](function(_0xf2b3e3){if(_0xf2b3e3){var _0x3f2277=[];var _0x4da14c={'success':[],'errors':[]};return db[_0xe9fd('0x5a')][_0xe9fd('0x50')]()[_0xe9fd('0x24')](function(_0x9e5de){if(_0x3abea6['body'][_0xe9fd('0x5b')]&&_['isArray'](_0x3abea6[_0xe9fd('0x4f')]['tags'])){if(_0x3abea6['body']['tags'][_0xe9fd('0x38')]){_0x3abea6['body'][_0xe9fd('0x5b')]=_0x3abea6[_0xe9fd('0x4f')][_0xe9fd('0x5b')]['join'](';')+';';}else{_0x3abea6[_0xe9fd('0x4f')][_0xe9fd('0x5b')]=null;}}else{_0x3abea6[_0xe9fd('0x4f')][_0xe9fd('0x5b')]=null;}if(_0x3abea6[_0xe9fd('0x4f')]&&_['isArray'](_0x3abea6[_0xe9fd('0x4f')])){for(var _0x2c1d1e=0x0;_0x2c1d1e<_0x3abea6[_0xe9fd('0x4f')][_0xe9fd('0x38')];_0x2c1d1e+=0x1){_0x3abea6[_0xe9fd('0x4f')][_0x2c1d1e][_0xe9fd('0x51')]=_0x3abea6['params']['id'];_0x3f2277[_0xe9fd('0x5c')](_0x3abea6[_0xe9fd('0x4f')][_0x2c1d1e]);}return BPromise[_0xe9fd('0x5d')](_0x3f2277,function(_0x1d1686){return db[_0xe9fd('0x5a')]['create'](_['omit'](_0x1d1686,[_0xe9fd('0x58'),'id'])||{},{'fields':_[_0xe9fd('0x33')](_0x9e5de),'raw':!![]})[_0xe9fd('0x24')](function(_0x438327){_0x4da14c[_0xe9fd('0x5e')][_0xe9fd('0x5c')](_0x438327[_0xe9fd('0x5f')]);})['catch'](function(_0x16d87f){_0x4da14c[_0xe9fd('0x60')]['push']({'data':_0x1d1686,'error':_0x16d87f[_0xe9fd('0x61')]});});})[_0xe9fd('0x24')](function(_0x3db50b){return _0x4da14c;})['catch'](function(_0x352685){return _0x352685;});}else{_0x1d2dbd[_0xe9fd('0x1a')](0x190)[_0xe9fd('0x21')]({'message':_0xe9fd('0x62')});}});}})[_0xe9fd('0x24')](respondWithResult(_0x1d2dbd,null))[_0xe9fd('0x45')](handleError(_0x1d2dbd,null));};exports[_0xe9fd('0x63')]=function(_0x458a40,_0x10da93,_0x252d71){var _0xb60754;return db['CmList'][_0xe9fd('0x49')]({'where':{'id':_0x458a40['params']['id']},'include':[{'model':db[_0xe9fd('0x64')],'as':_0xe9fd('0x65')}]})[_0xe9fd('0x24')](handleEntityNotFound(_0x10da93,null))[_0xe9fd('0x24')](function(_0x5b6aa4){if(_0x5b6aa4){_0xb60754=_0x5b6aa4;return db['CmContact'][_0xe9fd('0x44')];}})['then'](function(_0x42bdf3){if(_0x42bdf3){var _0x3a97b9={};var _0x399d60={};_0x399d60[_0xe9fd('0x31')]=_['concat'](_['keys'](_0x42bdf3),_[_0xe9fd('0x2c')](_0xb60754[_0xe9fd('0x65')],function(_0x55335a){return util[_0xe9fd('0x66')]('cf_%d',_0x55335a['id']);}));_0x399d60[_0xe9fd('0x32')]=_['keys'](_0x458a40[_0xe9fd('0x32')]);_0x399d60[_0xe9fd('0x34')]=_['intersection'](_0x399d60[_0xe9fd('0x31')],_0x399d60[_0xe9fd('0x32')]);_0x3a97b9[_0xe9fd('0x36')]=_[_0xe9fd('0x35')](_0x399d60[_0xe9fd('0x31')],qs[_0xe9fd('0x37')](_0x458a40['query'][_0xe9fd('0x37')]));_0x3a97b9[_0xe9fd('0x36')]=_0x3a97b9[_0xe9fd('0x36')][_0xe9fd('0x38')]?_0x3a97b9[_0xe9fd('0x36')]:_0x399d60[_0xe9fd('0x31')];if(!_0x458a40[_0xe9fd('0x32')][_0xe9fd('0x67')](_0xe9fd('0x68'))){_0x3a97b9['limit']=qs[_0xe9fd('0x1e')](_0x458a40['query'][_0xe9fd('0x1e')]);_0x3a97b9[_0xe9fd('0x1c')]=qs[_0xe9fd('0x1c')](_0x458a40['query'][_0xe9fd('0x1c')]);}_0x3a97b9[_0xe9fd('0x54')]=qs[_0xe9fd('0x39')](_0x458a40['query'][_0xe9fd('0x39')]);_0x3a97b9['where']=qs[_0xe9fd('0x34')](_[_0xe9fd('0x3b')](_0x458a40[_0xe9fd('0x32')],_0x399d60['filters']));_0x3a97b9[_0xe9fd('0x69')]=!![];if(_0x458a40[_0xe9fd('0x32')][_0xe9fd('0x3e')]){_0x3a97b9[_0xe9fd('0x3a')]=_[_0xe9fd('0x3c')](_0x3a97b9[_0xe9fd('0x3a')],{'$or':_[_0xe9fd('0x2c')](_0x3a97b9['attributes'],function(_0x219afb){var _0x1409e1={};_0x1409e1[_0x219afb]={'$like':'%'+_0x458a40[_0xe9fd('0x32')][_0xe9fd('0x3e')]+'%'};return _0x1409e1;})});}_0x3a97b9=_[_0xe9fd('0x3c')]({},_0x3a97b9,_0x458a40['options']);return _0xb60754[_0xe9fd('0x63')](_0x3a97b9);}})[_0xe9fd('0x24')](respondWithResult(_0x10da93,null))[_0xe9fd('0x45')](handleError(_0x10da93,null));};exports[_0xe9fd('0x6a')]=function(_0x2696b2,_0x1c4d25,_0x3277b0){var _0x22f946;var _0x22387e;var _0xe85dfa;var _0x372f9f=_0x2696b2[_0xe9fd('0x43')]['id'];csv_results=[];return db[_0xe9fd('0x6b')]['findAll']({'attributes':['id',_0xe9fd('0x2b')],'raw':!![],'order':['OrderBy']})[_0xe9fd('0x24')](function(_0x3d4380){_0x22f946=_0x3d4380;var _0x25b6a0=_[_0xe9fd('0x33')](db['CmContact'][_0xe9fd('0x44')]);return db['CmCustomField'][_0xe9fd('0x41')]({'raw':!![],'attributes':['id',_0xe9fd('0x6c')]})[_0xe9fd('0x24')](function(_0x502f5a){_0x22387e=_0x502f5a;var _0xf003e2=squel[_0xe9fd('0x6d')]()[_0xe9fd('0x37')](_0x25b6a0)[_0xe9fd('0x6e')](_0xe9fd('0x6f'),'c')[_0xe9fd('0x3a')]('c.ListId\x20=\x20?',_0x372f9f)[_0xe9fd('0x3a')](_0xe9fd('0x70'))[_0xe9fd('0x71')]();for(var _0x2f3265=0x0;_0x2f3265<_0x22387e['length'];_0x2f3265++){_0xf003e2[_0xe9fd('0x72')](_0xe9fd('0x73')+_0x22387e[_0x2f3265]['id'],_0xe9fd('0x74')+_0x22387e[_0x2f3265][_0xe9fd('0x6c')]);}for(var _0x2f3265=0x0;_0x2f3265<_0x22f946[_0xe9fd('0x38')];_0x2f3265++){_0xf003e2[_0xe9fd('0x72')](squel[_0xe9fd('0x6d')]()[_0xe9fd('0x72')](_0xe9fd('0x75'))[_0xe9fd('0x6e')]('cm_contact_has_items')[_0xe9fd('0x3a')](_0xe9fd('0x76'),_0x22f946[_0x2f3265]['id'])['where'](_0xe9fd('0x77')),_0xe9fd('0x78')+_0x22f946[_0x2f3265][_0xe9fd('0x2b')]);_0xf003e2[_0xe9fd('0x72')](squel[_0xe9fd('0x6d')]()[_0xe9fd('0x72')]('description')[_0xe9fd('0x6e')](_0xe9fd('0x79'))[_0xe9fd('0x3a')](_0xe9fd('0x76'),_0x22f946[_0x2f3265]['id'])[_0xe9fd('0x3a')]('CmContactId\x20=\x20c.id'),_0xe9fd('0x7a')+_0x22f946[_0x2f3265][_0xe9fd('0x2b')]);}var _0x2b4535=[];_0x2b4535[_0xe9fd('0x5c')](_0xf003e2[_0xe9fd('0x7b')]());BPromise[_0xe9fd('0x5d')](_0x2b4535,handleQuery)[_0xe9fd('0x24')](function(_0x13e82d){handleQuery(_0xf003e2[_0xe9fd('0x7b')]());var _0x28ae97=csv_results[0x0];if(!_[_0xe9fd('0x7c')](_0x28ae97)){var _0x52077d=toCsv(_0x28ae97);var _0x33d18b=Date[_0xe9fd('0x7d')]();fs[_0xe9fd('0x7e')](util[_0xe9fd('0x66')](_0xe9fd('0x7f'),_0x372f9f,_0x33d18b),_0x52077d);_0x1c4d25[_0xe9fd('0x80')](_0xe9fd('0x81'),'attachment;\x20filename='+util[_0xe9fd('0x66')]('list_%d_%s.csv',_0x372f9f,_0x33d18b));_0x1c4d25[_0xe9fd('0x80')](_0xe9fd('0x82'),_0xe9fd('0x83'));return _0x1c4d25[_0xe9fd('0x84')](util[_0xe9fd('0x66')]('/tmp/list_%d_%s.csv',_0x372f9f,_0x33d18b));}else{return _0x1c4d25[_0xe9fd('0x19')](0xcc);}});});});};exports[_0xe9fd('0x85')]=function(_0x30eeb6,_0x5d08d1,_0x59d12e){var _0xc894e;delete _0x30eeb6['body']['id'];return db[_0xe9fd('0x2d')][_0xe9fd('0x53')]({'where':{'id':_0x30eeb6[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0x5d08d1,null))[_0xe9fd('0x24')](function(_0x30b263){if(_0x30b263){return db['sequelize']['transaction'](function(_0x5910de){return db[_0xe9fd('0x64')][_0xe9fd('0x4c')](_0x30eeb6[_0xe9fd('0x4f')],{'transaction':_0x5910de})[_0xe9fd('0x24')](function(_0x41117e){_0xc894e=_0x41117e;return _0x30b263['addCustomFields'](_0x41117e,{'transaction':_0x5910de});})[_0xe9fd('0x24')](function(){var _0x5bb24a={'type':db[_0xe9fd('0x86')][_0xe9fd('0x87')],'transaction':_0x5910de};switch(_0x30eeb6[_0xe9fd('0x4f')][_0xe9fd('0x2f')]){case _0xe9fd('0x88'):_0x5bb24a[_0xe9fd('0x2f')]=db['Sequelize'][_0xe9fd('0x87')];break;case'number':_0x5bb24a['type']=db['Sequelize'][_0xe9fd('0x89')];break;case'switch':_0x5bb24a[_0xe9fd('0x2f')]=db[_0xe9fd('0x86')]['BOOLEAN'];_0x5bb24a['defaultValue']=![];break;default:}return db['sequelize'][_0xe9fd('0x8a')][_0xe9fd('0x8b')](_0xe9fd('0x6f'),util[_0xe9fd('0x66')](_0xe9fd('0x8c'),_0xc894e['id']),_0x5bb24a);})['then'](function(){return _0xc894e;});});}})['then'](respondWithResult(_0x5d08d1,null))[_0xe9fd('0x45')](handleError(_0x5d08d1,null));};exports[_0xe9fd('0x8d')]=function(_0x4a76db,_0x4c1a09,_0x570666){var _0x1b70ba={};var _0x5887a8={};var _0x41d49b;var _0x3d508d;return db['CmList'][_0xe9fd('0x53')]({'where':{'id':_0x4a76db[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0x4c1a09,null))['then'](function(_0x2a6053){if(_0x2a6053){_0x41d49b=_0x2a6053;_0x5887a8[_0xe9fd('0x31')]=_[_0xe9fd('0x33')](db[_0xe9fd('0x64')][_0xe9fd('0x44')]);_0x5887a8[_0xe9fd('0x32')]=_[_0xe9fd('0x33')](_0x4a76db['query']);_0x5887a8[_0xe9fd('0x34')]=_['intersection'](_0x5887a8[_0xe9fd('0x31')],_0x5887a8['query']);_0x1b70ba[_0xe9fd('0x36')]=_[_0xe9fd('0x35')](_0x5887a8[_0xe9fd('0x31')],qs[_0xe9fd('0x37')](_0x4a76db[_0xe9fd('0x32')]['fields']));_0x1b70ba[_0xe9fd('0x36')]=_0x1b70ba[_0xe9fd('0x36')][_0xe9fd('0x38')]?_0x1b70ba[_0xe9fd('0x36')]:_0x5887a8['model'];_0x1b70ba[_0xe9fd('0x54')]=qs[_0xe9fd('0x39')](_0x4a76db[_0xe9fd('0x32')]['sort']);_0x1b70ba['where']=qs[_0xe9fd('0x34')](_['pick'](_0x4a76db[_0xe9fd('0x32')],_0x5887a8[_0xe9fd('0x34')]));_0x1b70ba[_0xe9fd('0x3a')]=_[_0xe9fd('0x3c')](_0x1b70ba[_0xe9fd('0x3a')],{'$or':[{'ListId':_0x2a6053['id']},{'ListId':null}]});if(_0x4a76db['query'][_0xe9fd('0x3e')]){_0x1b70ba[_0xe9fd('0x3a')]=_[_0xe9fd('0x3c')](_0x1b70ba[_0xe9fd('0x3a')],{'$or':_[_0xe9fd('0x2c')](_0x1b70ba['attributes'],function(_0x4e36c0){var _0xc6af82={};_0xc6af82[_0x4e36c0]={'$like':'%'+_0x4a76db['query'][_0xe9fd('0x3e')]+'%'};return _0xc6af82;})});}_0x1b70ba=_[_0xe9fd('0x3c')]({},_0x1b70ba,_0x4a76db[_0xe9fd('0x55')]);return db['CmCustomField'][_0xe9fd('0x8e')](_0x1b70ba);}})[_0xe9fd('0x24')](respondWithResult(_0x4c1a09,null))[_0xe9fd('0x45')](handleError(_0x4c1a09,null));};exports[_0xe9fd('0x8f')]=function(_0x463333,_0x408e33){return db[_0xe9fd('0x64')][_0xe9fd('0x8e')]({'where':{'ListId':null}})[_0xe9fd('0x24')](handleEntityNotFound(_0x408e33,null))[_0xe9fd('0x24')](function(_0x3685bd){return _0x3685bd;})[_0xe9fd('0x24')](respondWithResult(_0x408e33,null))[_0xe9fd('0x45')](handleError(_0x408e33,null));};exports[_0xe9fd('0x90')]=function(_0x54a01e,_0xaa027d,_0x2bb074){return db['CmList'][_0xe9fd('0x49')]({'where':{'id':_0x54a01e[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0xaa027d,null))[_0xe9fd('0x24')](function(_0x3e5a99){if(_0x3e5a99){return _0x3e5a99[_0xe9fd('0x90')](_0x54a01e[_0xe9fd('0x4f')][_0xe9fd('0x58')],_[_0xe9fd('0x91')](_0x54a01e['body'],[_0xe9fd('0x58'),'id'])||{})[_0xe9fd('0x92')](function(_0x191fc6){for(var _0x4409b3=0x0;_0x4409b3<_0x54a01e['body'][_0xe9fd('0x58')][_0xe9fd('0x38')];_0x4409b3+=0x1){socket[_0xe9fd('0x93')](_0xe9fd('0x94'),{'UserId':Number(_0x54a01e['body'][_0xe9fd('0x58')][_0x4409b3]),'CmListId':Number(_0x54a01e[_0xe9fd('0x43')]['id'])});}return _0x191fc6;});}})[_0xe9fd('0x24')](respondWithResult(_0xaa027d,null))[_0xe9fd('0x45')](handleError(_0xaa027d,null));};exports[_0xe9fd('0x95')]=function(_0x3fb20d,_0x171b81,_0x8741a5){return db['CmList'][_0xe9fd('0x49')]({'where':{'id':_0x3fb20d[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0x171b81,null))['then'](function(_0x1a79f4){if(_0x1a79f4){return _0x1a79f4[_0xe9fd('0x95')](_0x3fb20d['query'][_0xe9fd('0x58')])[_0xe9fd('0x24')](function(){if(_['isArray'](_0x3fb20d[_0xe9fd('0x32')][_0xe9fd('0x58')])){for(var _0x55ab8f=0x0;_0x55ab8f<_0x3fb20d['query'][_0xe9fd('0x58')][_0xe9fd('0x38')];_0x55ab8f+=0x1){socket[_0xe9fd('0x93')](_0xe9fd('0x96'),{'UserId':Number(_0x3fb20d['query'][_0xe9fd('0x58')][_0x55ab8f]),'CmListId':Number(_0x3fb20d[_0xe9fd('0x43')]['id'])});}}else{socket[_0xe9fd('0x93')]('userCmList:remove',{'UserId':Number(_0x3fb20d[_0xe9fd('0x32')][_0xe9fd('0x58')]),'CmListId':Number(_0x3fb20d[_0xe9fd('0x43')]['id'])});}});}})[_0xe9fd('0x24')](respondWithStatusCode(_0x171b81,null))[_0xe9fd('0x45')](handleError(_0x171b81,null));};exports['getAgents']=function(_0x1d470f,_0xa7242a,_0x849122){var _0x5c2290={};var _0x391e4f={};var _0x18b672;var _0x2fc1ac;return db[_0xe9fd('0x2d')][_0xe9fd('0x53')]({'where':{'id':_0x1d470f[_0xe9fd('0x43')]['id']}})[_0xe9fd('0x24')](handleEntityNotFound(_0xa7242a,null))[_0xe9fd('0x24')](function(_0x251ff9){if(_0x251ff9){_0x18b672=_0x251ff9;_0x391e4f[_0xe9fd('0x31')]=_[_0xe9fd('0x33')](db[_0xe9fd('0x97')][_0xe9fd('0x44')]);_0x391e4f['query']=_[_0xe9fd('0x33')](_0x1d470f['query']);_0x391e4f[_0xe9fd('0x34')]=_[_0xe9fd('0x35')](_0x391e4f[_0xe9fd('0x31')],_0x391e4f[_0xe9fd('0x32')]);_0x5c2290[_0xe9fd('0x36')]=_[_0xe9fd('0x35')](_0x391e4f[_0xe9fd('0x31')],qs[_0xe9fd('0x37')](_0x1d470f[_0xe9fd('0x32')][_0xe9fd('0x37')]));_0x5c2290[_0xe9fd('0x36')]=_0x5c2290[_0xe9fd('0x36')][_0xe9fd('0x38')]?_0x5c2290['attributes']:_0x391e4f[_0xe9fd('0x31')];_0x5c2290[_0xe9fd('0x54')]=qs['sort'](_0x1d470f[_0xe9fd('0x32')][_0xe9fd('0x39')]);_0x5c2290['where']=qs[_0xe9fd('0x34')](_[_0xe9fd('0x3b')](_0x1d470f['query'],_0x391e4f[_0xe9fd('0x34')]));if(_0x1d470f[_0xe9fd('0x32')][_0xe9fd('0x3e')]){_0x5c2290[_0xe9fd('0x3a')]=_[_0xe9fd('0x3c')](_0x5c2290[_0xe9fd('0x3a')],{'$or':_[_0xe9fd('0x2c')](_0x5c2290[_0xe9fd('0x36')],function(_0x4e5ae9){var _0x558e06={};_0x558e06[_0x4e5ae9]={'$like':'%'+_0x1d470f[_0xe9fd('0x32')]['filter']+'%'};return _0x558e06;})});}_0x5c2290=_[_0xe9fd('0x3c')]({},_0x5c2290,_0x1d470f[_0xe9fd('0x55')]);return _0x18b672['getAgents'](_0x5c2290);}})[_0xe9fd('0x24')](function(_0x368cdb){if(_0x368cdb){_0x2fc1ac=_0x368cdb[_0xe9fd('0x38')];if(!_0x1d470f[_0xe9fd('0x32')][_0xe9fd('0x67')]('nolimit')){_0x5c2290[_0xe9fd('0x1e')]=qs[_0xe9fd('0x1e')](_0x1d470f[_0xe9fd('0x32')]['limit']);_0x5c2290[_0xe9fd('0x1c')]=qs['offset'](_0x1d470f[_0xe9fd('0x32')][_0xe9fd('0x1c')]);}return _0x18b672[_0xe9fd('0x98')](_0x5c2290);}})[_0xe9fd('0x24')](function(_0x575a74){if(_0x575a74){return _0x575a74?{'count':_0x2fc1ac,'rows':_0x575a74}:null;}})['then'](respondWithResult(_0xa7242a,null))[_0xe9fd('0x45')](handleError(_0xa7242a,null));};function handleQuery(_0x2ef162){logger['info'](_0x2ef162);return db[_0xe9fd('0x99')]['query'](_0x2ef162)[_0xe9fd('0x92')](function(_0x5a8718){csv_results[_0xe9fd('0x5c')](_0x5a8718);})[_0xe9fd('0x45')](function(_0x33c6b7){logger[_0xe9fd('0x2a')](_0x33c6b7[_0xe9fd('0x61')]);});} \ No newline at end of file +var _0x52f5=['c.cf_','field','item','cm_contact_has_items','additionalPhone_','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sendStatus','sequelize','addCustomFields','Sequelize','text','TEXT','number','switch','BOOLEAN','defaultValue','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','emit','removeAgents','userCmList:remove','getAgents','User','spread','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','get','Lists','UserProfileResource','error','stack','name','index','map','CmList','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','dataValues','errors','message','concat','CustomFields','format','cf_%d','raw','getContacts','CmCustomField','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null'];(function(_0x9500e9,_0x133a97){var _0x4cdf90=function(_0x3b2df0){while(--_0x3b2df0){_0x9500e9['push'](_0x9500e9['shift']());}};_0x4cdf90(++_0x133a97);}(_0x52f5,0x1f4));var _0x552f=function(_0x502a1c,_0x592f48){_0x502a1c=_0x502a1c-0x0;var _0x269732=_0x52f5[_0x502a1c];return _0x269732;};'use strict';var emlformat=require(_0x552f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x552f('0x1'));var jsonpatch=require(_0x552f('0x2'));var rp=require('request-promise');var moment=require(_0x552f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x552f('0x4'));var util=require('util');var path=require(_0x552f('0x5'));var sox=require(_0x552f('0x6'));var csv=require(_0x552f('0x7'));var ejs=require(_0x552f('0x8'));var fs=require('fs');var fs_extra=require(_0x552f('0x9'));var _=require(_0x552f('0xa'));var squel=require(_0x552f('0xb'));var crypto=require(_0x552f('0xc'));var jsforce=require(_0x552f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x552f('0xe'));var Papa=require(_0x552f('0xf'));var Redis=require(_0x552f('0x10'));var authService=require(_0x552f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x552f('0x12'))(_0x552f('0x13'));var utils=require(_0x552f('0x14'));var config=require(_0x552f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x552f('0x16'))['db'];var csv_results;config[_0x552f('0x17')]=_[_0x552f('0x18')](config[_0x552f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x552f('0x19'))(new Redis(config['redis']));require(_0x552f('0x1a'))[_0x552f('0x1b')](socket);function respondWithStatusCode(_0x1879c6,_0x517d01){_0x517d01=_0x517d01||0xcc;return function(_0x3d0c59){if(_0x3d0c59){return _0x1879c6['sendStatus'](_0x517d01);}return _0x1879c6['status'](_0x517d01)[_0x552f('0x1c')]();};}function respondWithResult(_0x224b77,_0x3edf46){_0x3edf46=_0x3edf46||0xc8;return function(_0x859f41){if(_0x859f41){return _0x224b77[_0x552f('0x1d')](_0x3edf46)[_0x552f('0x1e')](_0x859f41);}};}function respondWithFilteredResult(_0x482d93,_0x3ce3e6){return function(_0x481c35){if(_0x481c35){var _0x412f0a=typeof _0x3ce3e6[_0x552f('0x1f')]==='undefined'&&typeof _0x3ce3e6[_0x552f('0x20')]===_0x552f('0x21');var _0x57985a=_0x481c35[_0x552f('0x22')];var _0x269b17=_0x412f0a?0x0:_0x3ce3e6[_0x552f('0x1f')];var _0x593c2b=_0x412f0a?_0x481c35[_0x552f('0x22')]:_0x3ce3e6[_0x552f('0x1f')]+_0x3ce3e6['limit'];var _0x246055;if(_0x593c2b>=_0x57985a){_0x593c2b=_0x57985a;_0x246055=0xc8;}else{_0x246055=0xce;}_0x482d93[_0x552f('0x1d')](_0x246055);return _0x482d93[_0x552f('0x23')](_0x552f('0x24'),_0x269b17+'-'+_0x593c2b+'/'+_0x57985a)[_0x552f('0x1e')](_0x481c35);}return null;};}function patchUpdates(_0x2f4587){return function(_0x460509){try{jsonpatch['apply'](_0x460509,_0x2f4587,!![]);}catch(_0x1417c0){return BPromise[_0x552f('0x25')](_0x1417c0);}return _0x460509[_0x552f('0x26')]();};}function saveUpdates(_0x323f24,_0x3816bf){return function(_0x5df21a){if(_0x5df21a){return _0x5df21a[_0x552f('0x27')](_0x323f24)['then'](function(_0x31b616){return _0x31b616;});}return null;};}function removeEntity(_0x3536e6,_0x34c17f){return function(_0x161b5e){if(_0x161b5e){return _0x161b5e[_0x552f('0x28')]()[_0x552f('0x29')](function(){var _0x3d760d=_0x161b5e[_0x552f('0x2a')]({'plain':!![]});var _0x414dcb=_0x552f('0x2b');return db[_0x552f('0x2c')]['destroy']({'where':{'type':_0x414dcb,'resourceId':_0x3d760d['id']}})[_0x552f('0x29')](function(){return _0x161b5e;});})[_0x552f('0x29')](function(){_0x3536e6[_0x552f('0x1d')](0xcc)[_0x552f('0x1c')]();});}};}function handleEntityNotFound(_0x2272da,_0x1f78be){return function(_0x1b707c){if(!_0x1b707c){_0x2272da['sendStatus'](0x194);}return _0x1b707c;};}function handleError(_0xf1f48d,_0x46cc35){_0x46cc35=_0x46cc35||0x1f4;return function(_0x2240fe){logger[_0x552f('0x2d')](_0x2240fe[_0x552f('0x2e')]);if(_0x2240fe[_0x552f('0x2f')]){delete _0x2240fe['name'];}_0xf1f48d[_0x552f('0x1d')](_0x46cc35)['send'](_0x2240fe);};}exports[_0x552f('0x30')]=function(_0x54b270,_0x1957ab){var _0x3e2856={},_0x4c57d4={},_0xfc8ee6={'count':0x0,'rows':[]};var _0x54c429=_[_0x552f('0x31')](db[_0x552f('0x32')][_0x552f('0x33')],function(_0x78b4d2){return{'name':_0x78b4d2['fieldName'],'type':_0x78b4d2[_0x552f('0x34')][_0x552f('0x35')]};});_0x4c57d4[_0x552f('0x36')]=_[_0x552f('0x31')](_0x54c429,_0x552f('0x2f'));_0x4c57d4[_0x552f('0x37')]=_[_0x552f('0x38')](_0x54b270[_0x552f('0x37')]);_0x4c57d4[_0x552f('0x39')]=_[_0x552f('0x3a')](_0x4c57d4[_0x552f('0x36')],_0x4c57d4['query']);_0x3e2856[_0x552f('0x3b')]=_[_0x552f('0x3a')](_0x4c57d4['model'],qs[_0x552f('0x3c')](_0x54b270[_0x552f('0x37')]['fields']));_0x3e2856[_0x552f('0x3b')]=_0x3e2856['attributes']['length']?_0x3e2856[_0x552f('0x3b')]:_0x4c57d4[_0x552f('0x36')];if(!_0x54b270[_0x552f('0x37')][_0x552f('0x3d')](_0x552f('0x3e'))){_0x3e2856[_0x552f('0x20')]=qs[_0x552f('0x20')](_0x54b270['query']['limit']);_0x3e2856['offset']=qs['offset'](_0x54b270['query'][_0x552f('0x1f')]);}_0x3e2856[_0x552f('0x3f')]=qs[_0x552f('0x40')](_0x54b270[_0x552f('0x37')]['sort']);_0x3e2856['where']=qs[_0x552f('0x39')](_['pick'](_0x54b270[_0x552f('0x37')],_0x4c57d4[_0x552f('0x39')]),_0x54c429);if(_0x54b270[_0x552f('0x37')][_0x552f('0x41')]){_0x3e2856[_0x552f('0x42')]=_[_0x552f('0x43')](_0x3e2856[_0x552f('0x42')],{'$or':_['map'](_0x54c429,function(_0x32bb15){if(_0x32bb15[_0x552f('0x34')]!==_0x552f('0x44')){var _0x57cc09={};_0x57cc09[_0x32bb15['name']]={'$like':'%'+_0x54b270[_0x552f('0x37')][_0x552f('0x41')]+'%'};return _0x57cc09;}})});}_0x3e2856=_['merge']({},_0x3e2856,_0x54b270[_0x552f('0x45')]);var _0x1fcb85={'where':_0x3e2856[_0x552f('0x42')]};return db[_0x552f('0x32')]['count'](_0x1fcb85)['then'](function(_0x41ee8c){_0xfc8ee6[_0x552f('0x22')]=_0x41ee8c;if(_0x54b270[_0x552f('0x37')]['includeAll']){_0x3e2856[_0x552f('0x46')]=[{'all':!![]}];}return db[_0x552f('0x32')][_0x552f('0x47')](_0x3e2856);})[_0x552f('0x29')](function(_0x18af32){_0xfc8ee6[_0x552f('0x48')]=_0x18af32;return _0xfc8ee6;})[_0x552f('0x29')](respondWithFilteredResult(_0x1957ab,_0x3e2856))[_0x552f('0x49')](handleError(_0x1957ab,null));};exports['show']=function(_0x19ff5d,_0x1a33b6){var _0x188090={'raw':![],'where':{'id':_0x19ff5d[_0x552f('0x4a')]['id']}},_0x4156ad={};_0x4156ad[_0x552f('0x36')]=_['keys'](db[_0x552f('0x32')]['rawAttributes']);_0x4156ad[_0x552f('0x37')]=_[_0x552f('0x38')](_0x19ff5d[_0x552f('0x37')]);_0x4156ad[_0x552f('0x39')]=_['intersection'](_0x4156ad[_0x552f('0x36')],_0x4156ad[_0x552f('0x37')]);_0x188090[_0x552f('0x3b')]=_[_0x552f('0x3a')](_0x4156ad[_0x552f('0x36')],qs[_0x552f('0x3c')](_0x19ff5d[_0x552f('0x37')][_0x552f('0x3c')]));_0x188090['attributes']=_0x188090['attributes'][_0x552f('0x4b')]?_0x188090[_0x552f('0x3b')]:_0x4156ad['model'];if(_0x19ff5d[_0x552f('0x37')][_0x552f('0x4c')]){_0x188090['include']=[{'all':!![]}];}_0x188090=_[_0x552f('0x43')]({},_0x188090,_0x19ff5d[_0x552f('0x45')]);return db[_0x552f('0x32')][_0x552f('0x4d')](_0x188090)[_0x552f('0x29')](handleEntityNotFound(_0x1a33b6,null))[_0x552f('0x29')](respondWithResult(_0x1a33b6,null))[_0x552f('0x49')](handleError(_0x1a33b6,null));};exports[_0x552f('0x4e')]=function(_0x2f1463,_0x231f41){return db[_0x552f('0x32')][_0x552f('0x4e')](_0x2f1463['body'],{})[_0x552f('0x29')](function(_0x146d94){var _0x4fb44a=_0x2f1463[_0x552f('0x4f')][_0x552f('0x2a')]({'plain':!![]});if(!_0x4fb44a)throw new Error(_0x552f('0x50'));if(_0x4fb44a[_0x552f('0x51')]===_0x552f('0x4f')){var _0x23a8e3=_0x146d94[_0x552f('0x2a')]({'plain':!![]});var _0x4e88c7=_0x552f('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x4e88c7,'userProfileId':_0x4fb44a[_0x552f('0x52')]},'raw':!![]})[_0x552f('0x29')](function(_0x5582b8){if(_0x5582b8&&_0x5582b8[_0x552f('0x53')]===0x0){return db[_0x552f('0x2c')][_0x552f('0x4e')]({'name':_0x23a8e3[_0x552f('0x2f')],'resourceId':_0x23a8e3['id'],'type':_0x5582b8[_0x552f('0x2f')],'sectionId':_0x5582b8['id']},{})['then'](function(){return _0x146d94;});}else{return _0x146d94;}})[_0x552f('0x49')](function(_0x4bbe9b){logger[_0x552f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bbe9b);throw _0x4bbe9b;});}return _0x146d94;})['then'](respondWithResult(_0x231f41,0xc9))[_0x552f('0x49')](handleError(_0x231f41,null));};exports[_0x552f('0x27')]=function(_0x31165d,_0x3046ac){if(_0x31165d[_0x552f('0x54')]['id']){delete _0x31165d[_0x552f('0x54')]['id'];}return db[_0x552f('0x32')]['find']({'where':{'id':_0x31165d[_0x552f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3046ac,null))['then'](saveUpdates(_0x31165d[_0x552f('0x54')],null))[_0x552f('0x29')](respondWithResult(_0x3046ac,null))['catch'](handleError(_0x3046ac,null));};exports['destroy']=function(_0x18bf65,_0x33f874){return db[_0x552f('0x32')][_0x552f('0x4d')]({'where':{'id':_0x18bf65[_0x552f('0x4a')]['id']}})[_0x552f('0x29')](handleEntityNotFound(_0x33f874,null))['then'](removeEntity(_0x33f874,null))['catch'](handleError(_0x33f874,null));};exports[_0x552f('0x55')]=function(_0x475f2c,_0x145bbf){return db[_0x552f('0x32')][_0x552f('0x55')]()[_0x552f('0x29')](respondWithResult(_0x145bbf,null))['catch'](handleError(_0x145bbf,null));};exports[_0x552f('0x56')]=function(_0x14891f,_0x4bee01,_0x3cd68e){if(_0x14891f[_0x552f('0x54')]['id']){delete _0x14891f['body']['id'];}return db[_0x552f('0x32')][_0x552f('0x4d')]({'where':{'id':_0x14891f[_0x552f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4bee01,null))['then'](function(_0x3880f9){if(_0x3880f9){_0x14891f[_0x552f('0x54')][_0x552f('0x57')]=_0x3880f9['id'];return db[_0x552f('0x58')]['create'](_0x14891f[_0x552f('0x54')]);}})[_0x552f('0x29')](respondWithResult(_0x4bee01,null))[_0x552f('0x49')](handleError(_0x4bee01,null));};exports[_0x552f('0x59')]=function(_0x56f1d9,_0xd5f1e2,_0x1461ab){var _0x42f490={'raw':![],'where':{}};var _0x30c42d={};var _0x264492={'count':0x0,'rows':[]};return db[_0x552f('0x32')][_0x552f('0x5a')]({'where':{'id':_0x56f1d9[_0x552f('0x4a')]['id']}})[_0x552f('0x29')](handleEntityNotFound(_0xd5f1e2,null))[_0x552f('0x29')](function(_0x5ab841){if(_0x5ab841){_0x30c42d[_0x552f('0x36')]=_[_0x552f('0x38')](db[_0x552f('0x58')][_0x552f('0x33')]);_0x30c42d['query']=_['keys'](_0x56f1d9['query']);_0x30c42d[_0x552f('0x39')]=_[_0x552f('0x3a')](_0x30c42d[_0x552f('0x36')],_0x30c42d[_0x552f('0x37')]);_0x42f490[_0x552f('0x3b')]=_[_0x552f('0x3a')](_0x30c42d[_0x552f('0x36')],qs[_0x552f('0x3c')](_0x56f1d9[_0x552f('0x37')]['fields']));_0x42f490[_0x552f('0x3b')]=_0x42f490[_0x552f('0x3b')][_0x552f('0x4b')]?_0x42f490[_0x552f('0x3b')]:_0x30c42d['model'];if(!_0x56f1d9[_0x552f('0x37')][_0x552f('0x3d')](_0x552f('0x3e'))){_0x42f490[_0x552f('0x20')]=qs[_0x552f('0x20')](_0x56f1d9['query'][_0x552f('0x20')]);_0x42f490[_0x552f('0x1f')]=qs[_0x552f('0x1f')](_0x56f1d9[_0x552f('0x37')]['offset']);}_0x42f490[_0x552f('0x3f')]=qs[_0x552f('0x40')](_0x56f1d9[_0x552f('0x37')][_0x552f('0x40')]);_0x42f490['where']=qs[_0x552f('0x39')](_[_0x552f('0x5b')](_0x56f1d9[_0x552f('0x37')],_0x30c42d[_0x552f('0x39')]));_0x42f490[_0x552f('0x42')][_0x552f('0x57')]=_0x5ab841['id'];if(_0x56f1d9[_0x552f('0x37')][_0x552f('0x41')]){_0x42f490[_0x552f('0x42')]=_[_0x552f('0x43')](_0x42f490[_0x552f('0x42')],{'$or':_[_0x552f('0x31')](_0x42f490[_0x552f('0x3b')],function(_0x18ed22){var _0x295caa={};_0x295caa[_0x18ed22]={'$like':'%'+_0x56f1d9[_0x552f('0x37')]['filter']+'%'};return _0x295caa;})});}_0x42f490=_[_0x552f('0x43')]({},_0x42f490,_0x56f1d9[_0x552f('0x45')]);return db['Disposition'][_0x552f('0x22')]({'where':_0x42f490[_0x552f('0x42')]})[_0x552f('0x29')](function(_0x3e6851){_0x264492['count']=_0x3e6851;if(_0x56f1d9[_0x552f('0x37')][_0x552f('0x4c')]){_0x42f490[_0x552f('0x46')]=[{'all':!![]}];}return db[_0x552f('0x58')][_0x552f('0x47')](_0x42f490);})[_0x552f('0x29')](function(_0x2d2997){_0x264492[_0x552f('0x48')]=_0x2d2997;return _0x264492;});}})[_0x552f('0x29')](respondWithFilteredResult(_0xd5f1e2,_0x42f490))[_0x552f('0x49')](handleError(_0xd5f1e2,null));};exports['removeDispositions']=function(_0x2bb2ba,_0x1e87d0,_0x1cb7c3){return db[_0x552f('0x32')][_0x552f('0x4d')]({'where':{'id':_0x2bb2ba[_0x552f('0x4a')]['id']}})[_0x552f('0x29')](handleEntityNotFound(_0x1e87d0,null))[_0x552f('0x29')](function(_0x155837){if(_0x155837){return _0x155837[_0x552f('0x5c')](_0x2bb2ba[_0x552f('0x37')][_0x552f('0x5d')]);}})[_0x552f('0x29')](respondWithStatusCode(_0x1e87d0,null))[_0x552f('0x49')](handleError(_0x1e87d0,null));};exports[_0x552f('0x5e')]=function(_0xd8cc34,_0x51a488,_0x3361b9){return db[_0x552f('0x32')][_0x552f('0x4d')]({'where':{'id':_0xd8cc34[_0x552f('0x4a')]['id']}})[_0x552f('0x29')](handleEntityNotFound(_0x51a488,null))[_0x552f('0x29')](function(_0x1143d1){if(_0x1143d1){var _0x3c2fb4=[];var _0x54ed9e={'success':[],'errors':[]};return db[_0x552f('0x5f')][_0x552f('0x55')]()[_0x552f('0x29')](function(_0x56d2c0){if(_0xd8cc34[_0x552f('0x54')]['tags']&&_[_0x552f('0x60')](_0xd8cc34[_0x552f('0x54')][_0x552f('0x61')])){if(_0xd8cc34[_0x552f('0x54')][_0x552f('0x61')][_0x552f('0x4b')]){_0xd8cc34[_0x552f('0x54')][_0x552f('0x61')]=_0xd8cc34[_0x552f('0x54')]['tags'][_0x552f('0x62')](';')+';';}else{_0xd8cc34['body'][_0x552f('0x61')]=null;}}else{_0xd8cc34[_0x552f('0x54')][_0x552f('0x61')]=null;}if(_0xd8cc34[_0x552f('0x54')]&&_[_0x552f('0x60')](_0xd8cc34[_0x552f('0x54')])){for(var _0x58bc61=0x0;_0x58bc61<_0xd8cc34[_0x552f('0x54')][_0x552f('0x4b')];_0x58bc61+=0x1){_0xd8cc34[_0x552f('0x54')][_0x58bc61][_0x552f('0x57')]=_0xd8cc34[_0x552f('0x4a')]['id'];_0x3c2fb4[_0x552f('0x63')](_0xd8cc34[_0x552f('0x54')][_0x58bc61]);}return BPromise[_0x552f('0x64')](_0x3c2fb4,function(_0x4a1122){return db[_0x552f('0x5f')][_0x552f('0x4e')](_['omit'](_0x4a1122,[_0x552f('0x5d'),'id'])||{},{'fields':_[_0x552f('0x38')](_0x56d2c0),'raw':!![]})['then'](function(_0x1911f3){_0x54ed9e['success']['push'](_0x1911f3[_0x552f('0x65')]);})[_0x552f('0x49')](function(_0xa1505){_0x54ed9e[_0x552f('0x66')][_0x552f('0x63')]({'data':_0x4a1122,'error':_0xa1505[_0x552f('0x67')]});});})[_0x552f('0x29')](function(_0x28e9e1){return _0x54ed9e;})['catch'](function(_0x299b04){return _0x299b04;});}else{_0x51a488['status'](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x51a488,null))['catch'](handleError(_0x51a488,null));};exports['getContacts']=function(_0x5e49a1,_0x4e2ca3,_0x27b6ae){var _0x506a78;return db['CmList']['find']({'where':{'id':_0x5e49a1['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x552f('0x29')](handleEntityNotFound(_0x4e2ca3,null))[_0x552f('0x29')](function(_0x1405ec){if(_0x1405ec){_0x506a78=_0x1405ec;return db['CmContact'][_0x552f('0x33')];}})['then'](function(_0x439934){if(_0x439934){var _0x424741={};var _0x1868d7={};_0x1868d7['model']=_[_0x552f('0x68')](_[_0x552f('0x38')](_0x439934),_[_0x552f('0x31')](_0x506a78[_0x552f('0x69')],function(_0x43e9e7){return util[_0x552f('0x6a')](_0x552f('0x6b'),_0x43e9e7['id']);}));_0x1868d7['query']=_[_0x552f('0x38')](_0x5e49a1[_0x552f('0x37')]);_0x1868d7[_0x552f('0x39')]=_[_0x552f('0x3a')](_0x1868d7['model'],_0x1868d7[_0x552f('0x37')]);_0x424741[_0x552f('0x3b')]=_[_0x552f('0x3a')](_0x1868d7[_0x552f('0x36')],qs[_0x552f('0x3c')](_0x5e49a1[_0x552f('0x37')][_0x552f('0x3c')]));_0x424741['attributes']=_0x424741[_0x552f('0x3b')][_0x552f('0x4b')]?_0x424741[_0x552f('0x3b')]:_0x1868d7['model'];if(!_0x5e49a1[_0x552f('0x37')][_0x552f('0x3d')](_0x552f('0x3e'))){_0x424741[_0x552f('0x20')]=qs['limit'](_0x5e49a1[_0x552f('0x37')]['limit']);_0x424741[_0x552f('0x1f')]=qs[_0x552f('0x1f')](_0x5e49a1[_0x552f('0x37')]['offset']);}_0x424741[_0x552f('0x3f')]=qs[_0x552f('0x40')](_0x5e49a1[_0x552f('0x37')][_0x552f('0x40')]);_0x424741['where']=qs[_0x552f('0x39')](_[_0x552f('0x5b')](_0x5e49a1['query'],_0x1868d7[_0x552f('0x39')]));_0x424741[_0x552f('0x6c')]=!![];if(_0x5e49a1['query']['filter']){_0x424741[_0x552f('0x42')]=_['merge'](_0x424741[_0x552f('0x42')],{'$or':_['map'](_0x424741[_0x552f('0x3b')],function(_0x4dfa79){var _0x4b51d8={};_0x4b51d8[_0x4dfa79]={'$like':'%'+_0x5e49a1[_0x552f('0x37')][_0x552f('0x41')]+'%'};return _0x4b51d8;})});}_0x424741=_[_0x552f('0x43')]({},_0x424741,_0x5e49a1[_0x552f('0x45')]);return _0x506a78[_0x552f('0x6d')](_0x424741);}})[_0x552f('0x29')](respondWithResult(_0x4e2ca3,null))[_0x552f('0x49')](handleError(_0x4e2ca3,null));};exports['getContactsCsv']=function(_0xd243ae,_0x449658,_0x387514){var _0xf4b049;var _0x3df022;var _0x3262c9;var _0x5103a6=_0xd243ae[_0x552f('0x4a')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x552f('0x29')](function(_0x3e6fa){_0xf4b049=_0x3e6fa;var _0x341efe=_['keys'](db[_0x552f('0x5f')][_0x552f('0x33')]);return db[_0x552f('0x6e')][_0x552f('0x47')]({'raw':!![],'attributes':['id',_0x552f('0x6f')]})[_0x552f('0x29')](function(_0x167b49){_0x3df022=_0x167b49;var _0x5d5419=squel['select']()[_0x552f('0x3c')](_0x341efe)[_0x552f('0x70')](_0x552f('0x71'),'c')[_0x552f('0x42')](_0x552f('0x72'),_0x5103a6)['where'](_0x552f('0x73'))['distinct']();for(var _0x4c91cd=0x0;_0x4c91cd<_0x3df022[_0x552f('0x4b')];_0x4c91cd++){_0x5d5419['field'](_0x552f('0x74')+_0x3df022[_0x4c91cd]['id'],'customField_'+_0x3df022[_0x4c91cd][_0x552f('0x6f')]);}for(var _0x4c91cd=0x0;_0x4c91cd<_0xf4b049[_0x552f('0x4b')];_0x4c91cd++){_0x5d5419[_0x552f('0x75')](squel['select']()[_0x552f('0x75')](_0x552f('0x76'))[_0x552f('0x70')](_0x552f('0x77'))[_0x552f('0x42')]('ItemTypeId\x20=\x20?',_0xf4b049[_0x4c91cd]['id'])['where']('CmContactId\x20=\x20c.id'),_0x552f('0x78')+_0xf4b049[_0x4c91cd][_0x552f('0x2f')]);_0x5d5419['field'](squel['select']()['field']('description')[_0x552f('0x70')](_0x552f('0x77'))[_0x552f('0x42')](_0x552f('0x79'),_0xf4b049[_0x4c91cd]['id'])['where'](_0x552f('0x7a')),_0x552f('0x7b')+_0xf4b049[_0x4c91cd][_0x552f('0x2f')]);}var _0x12778d=[];_0x12778d['push'](_0x5d5419['toString']());BPromise['each'](_0x12778d,handleQuery)[_0x552f('0x29')](function(_0x4e3c20){handleQuery(_0x5d5419[_0x552f('0x7c')]());var _0x75fcbd=csv_results[0x0];if(!_['isEmpty'](_0x75fcbd)){var _0x58553b=toCsv(_0x75fcbd);var _0x36f224=Date['now']();fs['writeFileSync'](util[_0x552f('0x6a')]('/tmp/list_%d_%s.csv',_0x5103a6,_0x36f224),_0x58553b);_0x449658[_0x552f('0x7d')]('Content-disposition',_0x552f('0x7e')+util[_0x552f('0x6a')](_0x552f('0x7f'),_0x5103a6,_0x36f224));_0x449658[_0x552f('0x7d')](_0x552f('0x80'),_0x552f('0x81'));return _0x449658[_0x552f('0x82')](util[_0x552f('0x6a')](_0x552f('0x83'),_0x5103a6,_0x36f224));}else{return _0x449658[_0x552f('0x84')](0xcc);}});});});};exports['addCustomField']=function(_0xfc9fac,_0x2daf7f,_0x2c881f){var _0x4c1f38;delete _0xfc9fac[_0x552f('0x54')]['id'];return db[_0x552f('0x32')][_0x552f('0x5a')]({'where':{'id':_0xfc9fac[_0x552f('0x4a')]['id']}})[_0x552f('0x29')](handleEntityNotFound(_0x2daf7f,null))[_0x552f('0x29')](function(_0x2174d9){if(_0x2174d9){return db[_0x552f('0x85')]['transaction'](function(_0x5f0fdb){return db[_0x552f('0x6e')]['create'](_0xfc9fac[_0x552f('0x54')],{'transaction':_0x5f0fdb})[_0x552f('0x29')](function(_0x394f14){_0x4c1f38=_0x394f14;return _0x2174d9[_0x552f('0x86')](_0x394f14,{'transaction':_0x5f0fdb});})[_0x552f('0x29')](function(){var _0x51312a={'type':db[_0x552f('0x87')]['TEXT'],'transaction':_0x5f0fdb};switch(_0xfc9fac['body'][_0x552f('0x34')]){case _0x552f('0x88'):_0x51312a[_0x552f('0x34')]=db[_0x552f('0x87')][_0x552f('0x89')];break;case _0x552f('0x8a'):_0x51312a[_0x552f('0x34')]=db[_0x552f('0x87')]['INTEGER'];break;case _0x552f('0x8b'):_0x51312a['type']=db[_0x552f('0x87')][_0x552f('0x8c')];_0x51312a[_0x552f('0x8d')]=![];break;default:}return db[_0x552f('0x85')]['queryInterface']['addColumn']('cm_contacts',util[_0x552f('0x6a')](_0x552f('0x8e'),_0x4c1f38['id']),_0x51312a);})[_0x552f('0x29')](function(){return _0x4c1f38;});});}})[_0x552f('0x29')](respondWithResult(_0x2daf7f,null))[_0x552f('0x49')](handleError(_0x2daf7f,null));};exports[_0x552f('0x8f')]=function(_0x27bd37,_0x12da18,_0x3c46f1){var _0x323aa1={};var _0x522416={};var _0x1854d1;var _0x4f50d5;return db[_0x552f('0x32')][_0x552f('0x5a')]({'where':{'id':_0x27bd37[_0x552f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12da18,null))[_0x552f('0x29')](function(_0x349d95){if(_0x349d95){_0x1854d1=_0x349d95;_0x522416[_0x552f('0x36')]=_[_0x552f('0x38')](db[_0x552f('0x6e')][_0x552f('0x33')]);_0x522416[_0x552f('0x37')]=_[_0x552f('0x38')](_0x27bd37[_0x552f('0x37')]);_0x522416[_0x552f('0x39')]=_[_0x552f('0x3a')](_0x522416[_0x552f('0x36')],_0x522416[_0x552f('0x37')]);_0x323aa1['attributes']=_['intersection'](_0x522416[_0x552f('0x36')],qs[_0x552f('0x3c')](_0x27bd37['query'][_0x552f('0x3c')]));_0x323aa1[_0x552f('0x3b')]=_0x323aa1[_0x552f('0x3b')][_0x552f('0x4b')]?_0x323aa1[_0x552f('0x3b')]:_0x522416['model'];_0x323aa1[_0x552f('0x3f')]=qs['sort'](_0x27bd37[_0x552f('0x37')]['sort']);_0x323aa1[_0x552f('0x42')]=qs['filters'](_[_0x552f('0x5b')](_0x27bd37[_0x552f('0x37')],_0x522416[_0x552f('0x39')]));_0x323aa1[_0x552f('0x42')]=_[_0x552f('0x43')](_0x323aa1[_0x552f('0x42')],{'$or':[{'ListId':_0x349d95['id']},{'ListId':null}]});if(_0x27bd37[_0x552f('0x37')][_0x552f('0x41')]){_0x323aa1[_0x552f('0x42')]=_[_0x552f('0x43')](_0x323aa1[_0x552f('0x42')],{'$or':_[_0x552f('0x31')](_0x323aa1[_0x552f('0x3b')],function(_0x437ca4){var _0x31ff90={};_0x31ff90[_0x437ca4]={'$like':'%'+_0x27bd37[_0x552f('0x37')]['filter']+'%'};return _0x31ff90;})});}_0x323aa1=_[_0x552f('0x43')]({},_0x323aa1,_0x27bd37[_0x552f('0x45')]);return db[_0x552f('0x6e')][_0x552f('0x90')](_0x323aa1);}})['then'](respondWithResult(_0x12da18,null))['catch'](handleError(_0x12da18,null));};exports[_0x552f('0x91')]=function(_0x5a6ee5,_0x542fb7){return db[_0x552f('0x6e')]['findAndCountAll']({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x542fb7,null))[_0x552f('0x29')](function(_0x141ba4){return _0x141ba4;})['then'](respondWithResult(_0x542fb7,null))[_0x552f('0x49')](handleError(_0x542fb7,null));};exports['addAgents']=function(_0x431ffa,_0x295cad,_0x5d2480){return db['CmList'][_0x552f('0x4d')]({'where':{'id':_0x431ffa[_0x552f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x295cad,null))[_0x552f('0x29')](function(_0x2f8e7e){if(_0x2f8e7e){return _0x2f8e7e[_0x552f('0x92')](_0x431ffa[_0x552f('0x54')][_0x552f('0x5d')],_[_0x552f('0x93')](_0x431ffa['body'],[_0x552f('0x5d'),'id'])||{})['spread'](function(_0x59beec){for(var _0x98564f=0x0;_0x98564f<_0x431ffa['body'][_0x552f('0x5d')][_0x552f('0x4b')];_0x98564f+=0x1){socket[_0x552f('0x94')]('userCmList:save',{'UserId':Number(_0x431ffa[_0x552f('0x54')][_0x552f('0x5d')][_0x98564f]),'CmListId':Number(_0x431ffa[_0x552f('0x4a')]['id'])});}return _0x59beec;});}})['then'](respondWithResult(_0x295cad,null))[_0x552f('0x49')](handleError(_0x295cad,null));};exports[_0x552f('0x95')]=function(_0xad7cd1,_0x494e82,_0x5dec9f){return db[_0x552f('0x32')][_0x552f('0x4d')]({'where':{'id':_0xad7cd1[_0x552f('0x4a')]['id']}})[_0x552f('0x29')](handleEntityNotFound(_0x494e82,null))['then'](function(_0x1fbb4d){if(_0x1fbb4d){return _0x1fbb4d[_0x552f('0x95')](_0xad7cd1[_0x552f('0x37')][_0x552f('0x5d')])[_0x552f('0x29')](function(){if(_[_0x552f('0x60')](_0xad7cd1['query'][_0x552f('0x5d')])){for(var _0x20caa5=0x0;_0x20caa5<_0xad7cd1[_0x552f('0x37')][_0x552f('0x5d')][_0x552f('0x4b')];_0x20caa5+=0x1){socket[_0x552f('0x94')]('userCmList:remove',{'UserId':Number(_0xad7cd1['query'][_0x552f('0x5d')][_0x20caa5]),'CmListId':Number(_0xad7cd1[_0x552f('0x4a')]['id'])});}}else{socket[_0x552f('0x94')](_0x552f('0x96'),{'UserId':Number(_0xad7cd1[_0x552f('0x37')]['ids']),'CmListId':Number(_0xad7cd1[_0x552f('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x494e82,null))[_0x552f('0x49')](handleError(_0x494e82,null));};exports[_0x552f('0x97')]=function(_0xad3107,_0x5e3947,_0x13d9e7){var _0x55d86f={};var _0x18ee23={};var _0xe5fbbd;var _0x40dc34;return db[_0x552f('0x32')][_0x552f('0x5a')]({'where':{'id':_0xad3107['params']['id']}})[_0x552f('0x29')](handleEntityNotFound(_0x5e3947,null))[_0x552f('0x29')](function(_0x4e7ce1){if(_0x4e7ce1){_0xe5fbbd=_0x4e7ce1;_0x18ee23['model']=_['keys'](db[_0x552f('0x98')][_0x552f('0x33')]);_0x18ee23[_0x552f('0x37')]=_['keys'](_0xad3107[_0x552f('0x37')]);_0x18ee23[_0x552f('0x39')]=_[_0x552f('0x3a')](_0x18ee23['model'],_0x18ee23['query']);_0x55d86f[_0x552f('0x3b')]=_[_0x552f('0x3a')](_0x18ee23[_0x552f('0x36')],qs[_0x552f('0x3c')](_0xad3107['query']['fields']));_0x55d86f[_0x552f('0x3b')]=_0x55d86f['attributes'][_0x552f('0x4b')]?_0x55d86f[_0x552f('0x3b')]:_0x18ee23['model'];_0x55d86f[_0x552f('0x3f')]=qs[_0x552f('0x40')](_0xad3107['query'][_0x552f('0x40')]);_0x55d86f['where']=qs[_0x552f('0x39')](_[_0x552f('0x5b')](_0xad3107[_0x552f('0x37')],_0x18ee23[_0x552f('0x39')]));if(_0xad3107[_0x552f('0x37')][_0x552f('0x41')]){_0x55d86f[_0x552f('0x42')]=_['merge'](_0x55d86f['where'],{'$or':_[_0x552f('0x31')](_0x55d86f[_0x552f('0x3b')],function(_0x134d20){var _0x4d76a5={};_0x4d76a5[_0x134d20]={'$like':'%'+_0xad3107[_0x552f('0x37')]['filter']+'%'};return _0x4d76a5;})});}_0x55d86f=_[_0x552f('0x43')]({},_0x55d86f,_0xad3107['options']);return _0xe5fbbd[_0x552f('0x97')](_0x55d86f);}})[_0x552f('0x29')](function(_0xd56418){if(_0xd56418){_0x40dc34=_0xd56418[_0x552f('0x4b')];if(!_0xad3107[_0x552f('0x37')][_0x552f('0x3d')](_0x552f('0x3e'))){_0x55d86f[_0x552f('0x20')]=qs[_0x552f('0x20')](_0xad3107['query']['limit']);_0x55d86f[_0x552f('0x1f')]=qs[_0x552f('0x1f')](_0xad3107[_0x552f('0x37')][_0x552f('0x1f')]);}return _0xe5fbbd[_0x552f('0x97')](_0x55d86f);}})[_0x552f('0x29')](function(_0x279fba){if(_0x279fba){return _0x279fba?{'count':_0x40dc34,'rows':_0x279fba}:null;}})[_0x552f('0x29')](respondWithResult(_0x5e3947,null))[_0x552f('0x49')](handleError(_0x5e3947,null));};function handleQuery(_0x4d3758){logger['info'](_0x4d3758);return db[_0x552f('0x85')][_0x552f('0x37')](_0x4d3758)[_0x552f('0x99')](function(_0x222c06){csv_results[_0x552f('0x63')](_0x222c06);})[_0x552f('0x49')](function(_0x44d0ac){logger[_0x552f('0x2d')](_0x44d0ac[_0x552f('0x67')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index a391271..7b3a57b 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0x17f3ec,_0x2890e6){_0x17f3ec=_0x17f3ec-0x0;var _0x3caa12=_0xe14b[_0x17f3ec];return _0x3caa12;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x1633e9,_0x50a939){var _0x549ace=function(_0x15a157){while(--_0x15a157){_0x1633e9['push'](_0x1633e9['shift']());}};_0x549ace(++_0x50a939);}(_0x814b,0x1a2));var _0xb814=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x814b[_0x595013];return _0x2a29e3;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 764b9d7..e745728 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 _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','../../config/logger','api'];(function(_0x76d88d,_0x48b0f2){var _0x2fa9e0=function(_0x55aac5){while(--_0x55aac5){_0x76d88d['push'](_0x76d88d['shift']());}};_0x2fa9e0(++_0x48b0f2);}(_0x1339,0x1ed));var _0x9133=function(_0x18ef8d,_0xfc4cb3){_0x18ef8d=_0x18ef8d-0x0;var _0x14b3f6=_0x1339[_0x18ef8d];return _0x14b3f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./cmList.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2750=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4ded16,_0x23fcbf){var _0x4a525a=function(_0x2c6b5e){while(--_0x2c6b5e){_0x4ded16['push'](_0x4ded16['shift']());}};_0x4a525a(++_0x23fcbf);}(_0x2750,0x13b));var _0x0275=function(_0x357973,_0x360f17){_0x357973=_0x357973-0x0;var _0x3272df=_0x2750[_0x357973];return _0x3272df;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'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 102b95a..84c5d5f 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 _0xeac4=['socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost'];(function(_0x554b96,_0xa7f28){var _0xe445a8=function(_0x1c2dfb){while(--_0x1c2dfb){_0x554b96['push'](_0x554b96['shift']());}};_0xe445a8(++_0xa7f28);}(_0xeac4,0x184));var _0x4eac=function(_0x4b48af,_0x4ad5b9){_0x4b48af=_0x4b48af-0x0;var _0x64ac44=_0xeac4[_0x4b48af];return _0x64ac44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4eac('0x0'));var BPromise=require('bluebird');var rs=require(_0x4eac('0x1'));var fs=require('fs');var Redis=require(_0x4eac('0x2'));var db=require(_0x4eac('0x3'))['db'];var utils=require(_0x4eac('0x4'));var logger=require(_0x4eac('0x5'))(_0x4eac('0x6'));var config=require('../../config/environment');var jayson=require(_0x4eac('0x7'));var client=jayson[_0x4eac('0x8')][_0x4eac('0x9')]({'port':0x232a});config[_0x4eac('0xa')]=_['defaults'](config['redis'],{'host':_0x4eac('0xb'),'port':0x18eb});var socket=require(_0x4eac('0xc'))(new Redis(config[_0x4eac('0xa')]));require('./cmList.socket')[_0x4eac('0xd')](socket);function respondWithRpcPromise(_0x3a2643,_0x7ca319,_0x1db90c){return new BPromise(function(_0x592fe8,_0x26835c){return client[_0x4eac('0xe')](_0x3a2643,_0x1db90c)[_0x4eac('0xf')](function(_0x281c58){logger[_0x4eac('0x10')](_0x4eac('0x11'),_0x7ca319,_0x4eac('0x12'));logger['debug'](_0x4eac('0x13'),_0x7ca319,'request\x20sent',JSON['stringify'](_0x281c58));if(_0x281c58[_0x4eac('0x14')]){if(_0x281c58[_0x4eac('0x14')][_0x4eac('0x15')]===0x1f4){logger[_0x4eac('0x14')](_0x4eac('0x11'),_0x7ca319,_0x281c58[_0x4eac('0x14')][_0x4eac('0x16')]);return _0x26835c(_0x281c58[_0x4eac('0x14')][_0x4eac('0x16')]);}logger['error'](_0x4eac('0x11'),_0x7ca319,_0x281c58[_0x4eac('0x14')][_0x4eac('0x16')]);return _0x592fe8(_0x281c58[_0x4eac('0x14')][_0x4eac('0x16')]);}else{logger[_0x4eac('0x10')](_0x4eac('0x11'),_0x7ca319,'request\x20sent');_0x592fe8(_0x281c58[_0x4eac('0x17')][_0x4eac('0x16')]);}})[_0x4eac('0x18')](function(_0x7edea8){logger[_0x4eac('0x14')](_0x4eac('0x11'),_0x7ca319,_0x7edea8);_0x26835c(_0x7edea8);});});} \ No newline at end of file +var _0x11a9=['result','catch','lodash','util','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3ff3eb,_0x3a311a){var _0x494495=function(_0x5b47e9){while(--_0x5b47e9){_0x3ff3eb['push'](_0x3ff3eb['shift']());}};_0x494495(++_0x3a311a);}(_0x11a9,0x1ab));var _0x911a=function(_0x5a40e6,_0x223ce8){_0x5a40e6=_0x5a40e6-0x0;var _0x28f32b=_0x11a9[_0x5a40e6];return _0x28f32b;};'use strict';var _=require(_0x911a('0x0'));var util=require(_0x911a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x911a('0x2'));var fs=require('fs');var Redis=require(_0x911a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x911a('0x4'));var jayson=require(_0x911a('0x5'));var client=jayson[_0x911a('0x6')][_0x911a('0x7')]({'port':0x232a});config[_0x911a('0x8')]=_[_0x911a('0x9')](config[_0x911a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x911a('0xa'))(new Redis(config[_0x911a('0x8')]));require(_0x911a('0xb'))[_0x911a('0xc')](socket);function respondWithRpcPromise(_0x2669f3,_0x293f5f,_0x5b3a8d){return new BPromise(function(_0x38bd54,_0x542aac){return client[_0x911a('0xd')](_0x2669f3,_0x5b3a8d)[_0x911a('0xe')](function(_0x1b427c){logger[_0x911a('0xf')](_0x911a('0x10'),_0x293f5f,_0x911a('0x11'));logger[_0x911a('0x12')](_0x911a('0x13'),_0x293f5f,_0x911a('0x11'),JSON['stringify'](_0x1b427c));if(_0x1b427c[_0x911a('0x14')]){if(_0x1b427c[_0x911a('0x14')][_0x911a('0x15')]===0x1f4){logger[_0x911a('0x14')](_0x911a('0x10'),_0x293f5f,_0x1b427c[_0x911a('0x14')][_0x911a('0x16')]);return _0x542aac(_0x1b427c[_0x911a('0x14')][_0x911a('0x16')]);}logger[_0x911a('0x14')](_0x911a('0x10'),_0x293f5f,_0x1b427c['error'][_0x911a('0x16')]);return _0x38bd54(_0x1b427c[_0x911a('0x14')][_0x911a('0x16')]);}else{logger['info'](_0x911a('0x10'),_0x293f5f,_0x911a('0x11'));_0x38bd54(_0x1b427c[_0x911a('0x17')][_0x911a('0x16')]);}})[_0x911a('0x18')](function(_0xbe9cdd){logger[_0x911a('0x14')]('CmList,\x20%s,\x20%s',_0x293f5f,_0xbe9cdd);_0x542aac(_0xbe9cdd);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 79e9109..bf82a98 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 _0xd5e5=['length','cmList:','./cmList.events','save','remove','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd5e5,0xad));var _0x5d5e=function(_0x8c78,_0x3b91c2){_0x8c78=_0x8c78-0x0;var _0x384510=_0xd5e5[_0x8c78];return _0x384510;};'use strict';var CmListEvents=require(_0x5d5e('0x0'));var events=[_0x5d5e('0x1'),_0x5d5e('0x2'),_0x5d5e('0x3')];function createListener(_0x56f806,_0x5188e6){return function(_0x28758b){_0x5188e6[_0x5d5e('0x4')](_0x56f806,_0x28758b);};}function removeListener(_0x4ff74e,_0x208e58){return function(){CmListEvents[_0x5d5e('0x5')](_0x4ff74e,_0x208e58);};}exports[_0x5d5e('0x6')]=function(_0x48192d){for(var _0xc062c1=0x0,_0x4808dd=events[_0x5d5e('0x7')];_0xc062c1<_0x4808dd;_0xc062c1++){var _0x15b33d=events[_0xc062c1];var _0x401ce3=createListener(_0x5d5e('0x8')+_0x15b33d,_0x48192d);CmListEvents['on'](_0x15b33d,_0x401ce3);}}; \ No newline at end of file +var _0x72e9=['update','emit','register','cmList:','./cmList.events','save','remove'];(function(_0x3fa5d4,_0x5eaea4){var _0x2d8f65=function(_0x268360){while(--_0x268360){_0x3fa5d4['push'](_0x3fa5d4['shift']());}};_0x2d8f65(++_0x5eaea4);}(_0x72e9,0xf9));var _0x972e=function(_0x24074e,_0x476b5c){_0x24074e=_0x24074e-0x0;var _0x181463=_0x72e9[_0x24074e];return _0x181463;};'use strict';var CmListEvents=require(_0x972e('0x0'));var events=[_0x972e('0x1'),_0x972e('0x2'),_0x972e('0x3')];function createListener(_0x1384f9,_0x4f3360){return function(_0x353789){_0x4f3360[_0x972e('0x4')](_0x1384f9,_0x353789);};}function removeListener(_0x555cbe,_0x2f2ff2){return function(){CmListEvents['removeListener'](_0x555cbe,_0x2f2ff2);};}exports[_0x972e('0x5')]=function(_0x17da9e){for(var _0x27703e=0x0,_0x1b04f6=events['length'];_0x27703e<_0x1b04f6;_0x27703e++){var _0x595371=events[_0x27703e];var _0x4f911a=createListener(_0x972e('0x6')+_0x595371,_0x17da9e);CmListEvents['on'](_0x595371,_0x4f911a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 042b91e..0250abc 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 _0x19b3=['/:id/dispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x19b3,0x194));var _0x319b=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x19b3[_0x18fb16];return _0x147b0d;};'use strict';var multer=require('multer');var util=require(_0x319b('0x0'));var path=require(_0x319b('0x1'));var timeout=require('connect-timeout');var express=require(_0x319b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x319b('0x3'));var interaction=require(_0x319b('0x4'));var config=require(_0x319b('0x5'));var controller=require(_0x319b('0x6'));router[_0x319b('0x7')]('/',auth[_0x319b('0x8')](),controller[_0x319b('0x9')]);router[_0x319b('0x7')](_0x319b('0xa'),auth['isAuthenticated'](),controller[_0x319b('0xb')]);router[_0x319b('0x7')](_0x319b('0xc'),auth['isAuthenticated'](),controller[_0x319b('0xd')]);router[_0x319b('0x7')](_0x319b('0xe'),auth[_0x319b('0x8')](),controller[_0x319b('0xf')]);router[_0x319b('0x7')](_0x319b('0x10'),auth[_0x319b('0x8')](),controller['getDispositions']);router[_0x319b('0x7')](_0x319b('0x11'),auth[_0x319b('0x8')](),controller[_0x319b('0x12')]);router['get']('/:id/contacts/csv',auth[_0x319b('0x8')](),controller[_0x319b('0x13')]);router[_0x319b('0x7')](_0x319b('0x14'),auth[_0x319b('0x8')](),controller['getCustomFields']);router[_0x319b('0x7')](_0x319b('0x15'),auth[_0x319b('0x8')](),controller[_0x319b('0x16')]);router[_0x319b('0x17')]('/',auth[_0x319b('0x8')](),controller[_0x319b('0x18')]);router[_0x319b('0x17')](_0x319b('0x10'),auth[_0x319b('0x8')](),controller[_0x319b('0x19')]);router[_0x319b('0x17')](_0x319b('0x11'),auth[_0x319b('0x8')](),controller[_0x319b('0x1a')]);router[_0x319b('0x17')](_0x319b('0x14'),auth['isAuthenticated'](),controller[_0x319b('0x1b')]);router[_0x319b('0x17')]('/:id/users',auth[_0x319b('0x8')](),controller[_0x319b('0x1c')]);router[_0x319b('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x319b('0x1e')]);router[_0x319b('0x1f')](_0x319b('0xe'),auth[_0x319b('0x8')](),controller['destroy']);router[_0x319b('0x1f')]('/:id/dispositions',auth[_0x319b('0x8')](),controller[_0x319b('0x20')]);router[_0x319b('0x1f')]('/:id/users',auth[_0x319b('0x8')](),controller[_0x319b('0x21')]);module[_0x319b('0x22')]=router; \ No newline at end of file +var _0x6aa0=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','/:id/contacts','addContacts','/:id/fields','addAgents','update','destroy','delete','removeAgents','util','path'];(function(_0x4e2148,_0x382a2c){var _0x323345=function(_0x426339){while(--_0x426339){_0x4e2148['push'](_0x4e2148['shift']());}};_0x323345(++_0x382a2c);}(_0x6aa0,0xb8));var _0x06aa=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x6aa0[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require(_0x06aa('0x0'));var path=require(_0x06aa('0x1'));var timeout=require('connect-timeout');var express=require(_0x06aa('0x2'));var router=express['Router']();var fs_extra=require(_0x06aa('0x3'));var auth=require(_0x06aa('0x4'));var interaction=require(_0x06aa('0x5'));var config=require('../../config/environment');var controller=require(_0x06aa('0x6'));router[_0x06aa('0x7')]('/',auth[_0x06aa('0x8')](),controller[_0x06aa('0x9')]);router[_0x06aa('0x7')]('/describe',auth[_0x06aa('0x8')](),controller[_0x06aa('0xa')]);router['get'](_0x06aa('0xb'),auth[_0x06aa('0x8')](),controller['getGlobalCustomFields']);router['get'](_0x06aa('0xc'),auth[_0x06aa('0x8')](),controller[_0x06aa('0xd')]);router[_0x06aa('0x7')](_0x06aa('0xe'),auth[_0x06aa('0x8')](),controller['getDispositions']);router[_0x06aa('0x7')]('/:id/contacts',auth[_0x06aa('0x8')](),controller[_0x06aa('0xf')]);router[_0x06aa('0x7')](_0x06aa('0x10'),auth[_0x06aa('0x8')](),controller[_0x06aa('0x11')]);router[_0x06aa('0x7')]('/:id/fields',auth[_0x06aa('0x8')](),controller[_0x06aa('0x12')]);router[_0x06aa('0x7')](_0x06aa('0x13'),auth[_0x06aa('0x8')](),controller[_0x06aa('0x14')]);router[_0x06aa('0x15')]('/',auth[_0x06aa('0x8')](),controller[_0x06aa('0x16')]);router[_0x06aa('0x15')]('/:id/dispositions',auth[_0x06aa('0x8')](),controller['addDisposition']);router['post'](_0x06aa('0x17'),auth[_0x06aa('0x8')](),controller[_0x06aa('0x18')]);router[_0x06aa('0x15')](_0x06aa('0x19'),auth['isAuthenticated'](),controller['addCustomField']);router[_0x06aa('0x15')](_0x06aa('0x13'),auth[_0x06aa('0x8')](),controller[_0x06aa('0x1a')]);router['put'](_0x06aa('0xc'),auth['isAuthenticated'](),controller[_0x06aa('0x1b')]);router['delete'](_0x06aa('0xc'),auth[_0x06aa('0x8')](),controller[_0x06aa('0x1c')]);router[_0x06aa('0x1d')](_0x06aa('0xe'),auth[_0x06aa('0x8')](),controller['removeDispositions']);router['delete'](_0x06aa('0x13'),auth[_0x06aa('0x8')](),controller[_0x06aa('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0dbc3fe..25d61dd 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 _0x2ec4=['field','STRING','exports','VIRTUAL','getDataValue'];(function(_0x555fef,_0x538c8e){var _0x352754=function(_0xbcd509){while(--_0xbcd509){_0x555fef['push'](_0x555fef['shift']());}};_0x352754(++_0x538c8e);}(_0x2ec4,0x115));var _0x42ec=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x2ec4[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require('sequelize');module[_0x42ec('0x0')]={'name':{'type':Sequelize[_0x42ec('0x1')],'get':function(_0x111ce9){return this[_0x42ec('0x2')](_0x42ec('0x3'));}},'field':{'type':Sequelize[_0x42ec('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x42ec('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xaa6f=['getDataValue','STRING','sequelize','exports','VIRTUAL'];(function(_0x56898b,_0x489040){var _0xffe6ec=function(_0x2054d7){while(--_0x2054d7){_0x56898b['push'](_0x56898b['shift']());}};_0xffe6ec(++_0x489040);}(_0xaa6f,0xfc));var _0xfaa6=function(_0xb95f4a,_0x28999b){_0xb95f4a=_0xb95f4a-0x0;var _0x2b65c3=_0xaa6f[_0xb95f4a];return _0x2b65c3;};'use strict';var Sequelize=require(_0xfaa6('0x0'));module[_0xfaa6('0x1')]={'name':{'type':Sequelize[_0xfaa6('0x2')],'get':function(_0x22043c){return this[_0xfaa6('0x3')]('field');}},'field':{'type':Sequelize[_0xfaa6('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xfaa6('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d547b31..34c23ad 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 _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x2119e3,_0x39e2a8){var _0x391a91=function(_0x541977){while(--_0x541977){_0x2119e3['push'](_0x2119e3['shift']());}};_0x391a91(++_0x39e2a8);}(_0x7a54,0x106));var _0x47a5=function(_0x478dac,_0x23ff18){_0x478dac=_0x478dac-0x0;var _0x32ad4e=_0x7a54[_0x478dac];return _0x32ad4e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));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 as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x315fbb,_0x1391f2){var _0x4b415f=function(_0x344b63){while(--_0x344b63){_0x315fbb['push'](_0x315fbb['shift']());}};_0x4b415f(++_0x1391f2);}(_0x7a54,0x106));var _0x47a5=function(_0xcb1eb9,_0x303c66){_0xcb1eb9=_0xcb1eb9-0x0;var _0x41c37c=_0x7a54[_0xcb1eb9];return _0x41c37c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));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 as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 7d20466..25df78f 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 _0x5205=['./condition.attributes','Condition','tools_conditions','util','api','moment','request-promise','path','../../config/environment'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x5205,0xd2));var _0x5520=function(_0x1a4bfe,_0x4b319a){_0x1a4bfe=_0x1a4bfe-0x0;var _0xc6db31=_0x5205[_0x1a4bfe];return _0xc6db31;};'use strict';var _=require('lodash');var util=require(_0x5520('0x0'));var logger=require('../../config/logger')(_0x5520('0x1'));var moment=require(_0x5520('0x2'));var BPromise=require('bluebird');var rp=require(_0x5520('0x3'));var fs=require('fs');var path=require(_0x5520('0x4'));var rimraf=require('rimraf');var config=require(_0x5520('0x5'));var attributes=require(_0x5520('0x6'));module['exports']=function(_0x3a8f4d,_0x490058){return _0x3a8f4d['define'](_0x5520('0x7'),attributes,{'tableName':_0x5520('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed9f=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','tools_conditions','lodash'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0xed9f,0x99));var _0xfed9=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0xed9f[_0x3ec333];return _0x15ccb8;};'use strict';var _=require(_0xfed9('0x0'));var util=require(_0xfed9('0x1'));var logger=require(_0xfed9('0x2'))(_0xfed9('0x3'));var moment=require(_0xfed9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfed9('0x5'));var rimraf=require(_0xfed9('0x6'));var config=require(_0xfed9('0x7'));var attributes=require('./condition.attributes');module[_0xfed9('0x8')]=function(_0x16f31e,_0x58c38c){return _0x16f31e[_0xfed9('0x9')]('Condition',attributes,{'tableName':_0xfed9('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 04fc0dd..68cedd9 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 _0x5121=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','result'];(function(_0x48baa3,_0x3cebbf){var _0x394bba=function(_0x35f85c){while(--_0x35f85c){_0x48baa3['push'](_0x48baa3['shift']());}};_0x394bba(++_0x3cebbf);}(_0x5121,0x120));var _0x1512=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x5121[_0x18d631];return _0x50d708;};'use strict';var _=require(_0x1512('0x0'));var util=require(_0x1512('0x1'));var moment=require(_0x1512('0x2'));var BPromise=require(_0x1512('0x3'));var rs=require(_0x1512('0x4'));var fs=require('fs');var Redis=require(_0x1512('0x5'));var db=require(_0x1512('0x6'))['db'];var utils=require(_0x1512('0x7'));var logger=require(_0x1512('0x8'))(_0x1512('0x9'));var config=require(_0x1512('0xa'));var jayson=require(_0x1512('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9591,_0x1b6321,_0x2a5540){return new BPromise(function(_0x592d03,_0x58c881){return client[_0x1512('0xc')](_0x2c9591,_0x2a5540)[_0x1512('0xd')](function(_0x413ba0){logger[_0x1512('0xe')]('Condition,\x20%s,\x20%s',_0x1b6321,'request\x20sent');logger[_0x1512('0xf')](_0x1512('0x10'),_0x1b6321,_0x1512('0x11'),JSON[_0x1512('0x12')](_0x413ba0));if(_0x413ba0[_0x1512('0x13')]){if(_0x413ba0['error'][_0x1512('0x14')]===0x1f4){logger[_0x1512('0x13')](_0x1512('0x15'),_0x1b6321,_0x413ba0[_0x1512('0x13')][_0x1512('0x16')]);return _0x58c881(_0x413ba0[_0x1512('0x13')]['message']);}logger[_0x1512('0x13')](_0x1512('0x15'),_0x1b6321,_0x413ba0['error'][_0x1512('0x16')]);return _0x592d03(_0x413ba0['error']['message']);}else{logger[_0x1512('0xe')](_0x1512('0x15'),_0x1b6321,_0x1512('0x11'));_0x592d03(_0x413ba0[_0x1512('0x17')][_0x1512('0x16')]);}})['catch'](function(_0x450f45){logger[_0x1512('0x13')]('Condition,\x20%s,\x20%s',_0x1b6321,_0x450f45);_0x58c881(_0x450f45);});});} \ No newline at end of file +var _0xfc1f=['rpc','../../config/environment','jayson/promise','client','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','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x7d1b89,_0x58faa5){var _0x435a5b=function(_0x358473){while(--_0x358473){_0x7d1b89['push'](_0x7d1b89['shift']());}};_0x435a5b(++_0x58faa5);}(_0xfc1f,0xb2));var _0xffc1=function(_0x4fe17c,_0x3de842){_0x4fe17c=_0x4fe17c-0x0;var _0x14f304=_0xfc1f[_0x4fe17c];return _0x14f304;};'use strict';var _=require(_0xffc1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xffc1('0x1'));var rs=require(_0xffc1('0x2'));var fs=require('fs');var Redis=require(_0xffc1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffc1('0x4'));var logger=require(_0xffc1('0x5'))(_0xffc1('0x6'));var config=require(_0xffc1('0x7'));var jayson=require(_0xffc1('0x8'));var client=jayson[_0xffc1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21e91d,_0x592900,_0xd6b5ba){return new BPromise(function(_0x42a34e,_0x1eeec6){return client[_0xffc1('0xa')](_0x21e91d,_0xd6b5ba)[_0xffc1('0xb')](function(_0x392a91){logger['info']('Condition,\x20%s,\x20%s',_0x592900,_0xffc1('0xc'));logger[_0xffc1('0xd')](_0xffc1('0xe'),_0x592900,_0xffc1('0xc'),JSON[_0xffc1('0xf')](_0x392a91));if(_0x392a91['error']){if(_0x392a91[_0xffc1('0x10')][_0xffc1('0x11')]===0x1f4){logger[_0xffc1('0x10')](_0xffc1('0x12'),_0x592900,_0x392a91[_0xffc1('0x10')][_0xffc1('0x13')]);return _0x1eeec6(_0x392a91[_0xffc1('0x10')]['message']);}logger['error'](_0xffc1('0x12'),_0x592900,_0x392a91[_0xffc1('0x10')]['message']);return _0x42a34e(_0x392a91[_0xffc1('0x10')][_0xffc1('0x13')]);}else{logger[_0xffc1('0x14')](_0xffc1('0x12'),_0x592900,_0xffc1('0xc'));_0x42a34e(_0x392a91[_0xffc1('0x15')][_0xffc1('0x13')]);}})[_0xffc1('0x16')](function(_0x167ed2){logger[_0xffc1('0x10')](_0xffc1('0x12'),_0x592900,_0x167ed2);_0x1eeec6(_0x167ed2);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 7cc5714..d612015 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 _0x3008=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','destroy','multer','util','path','connect-timeout'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x3008,0x80));var _0x8300=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x3008[_0x160248];return _0x4e589d;};'use strict';var multer=require(_0x8300('0x0'));var util=require(_0x8300('0x1'));var path=require(_0x8300('0x2'));var timeout=require(_0x8300('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8300('0x4'));var auth=require(_0x8300('0x5'));var interaction=require(_0x8300('0x6'));var config=require(_0x8300('0x7'));var controller=require('./condition.controller');router[_0x8300('0x8')](_0x8300('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8300('0x9'),auth[_0x8300('0xa')](),controller[_0x8300('0xb')]);module['exports']=router; \ No newline at end of file +var _0x9007=['multer','util','path','express','Router','fs-extra','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x43c196,_0x24079a){var _0x1640be=function(_0x4e520e){while(--_0x4e520e){_0x43c196['push'](_0x43c196['shift']());}};_0x1640be(++_0x24079a);}(_0x9007,0x14a));var _0x7900=function(_0x3e9ef3,_0x21a7e4){_0x3e9ef3=_0x3e9ef3-0x0;var _0x333748=_0x9007[_0x3e9ef3];return _0x333748;};'use strict';var multer=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var path=require(_0x7900('0x2'));var timeout=require('connect-timeout');var express=require(_0x7900('0x3'));var router=express[_0x7900('0x4')]();var fs_extra=require(_0x7900('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7900('0x6'));var controller=require(_0x7900('0x7'));router[_0x7900('0x8')](_0x7900('0x9'),auth[_0x7900('0xa')](),controller[_0x7900('0xb')]);router[_0x7900('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x7900('0xd')]);module[_0x7900('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 937ba4b..52bbcf2 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8312=['STRING','name','INTEGER','sequelize'];(function(_0x4862e3,_0x1b2223){var _0x5b4f49=function(_0xefa39){while(--_0xefa39){_0x4862e3['push'](_0x4862e3['shift']());}};_0x5b4f49(++_0x1b2223);}(_0x8312,0xe7));var _0x2831=function(_0x2c8b57,_0x3d2cfa){_0x2c8b57=_0x2c8b57-0x0;var _0xdf7876=_0x8312[_0x2c8b57];return _0xdf7876;};'use strict';var Sequelize=require(_0x2831('0x0'));module['exports']={'name':{'type':Sequelize[_0x2831('0x1')],'allowNull':![],'unique':_0x2831('0x2')},'OrderBy':{'type':Sequelize[_0x2831('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x2831('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x03a3=['INTEGER','sequelize','exports','STRING'];(function(_0x2c3a81,_0x562263){var _0x854aad=function(_0x5e89e3){while(--_0x5e89e3){_0x2c3a81['push'](_0x2c3a81['shift']());}};_0x854aad(++_0x562263);}(_0x03a3,0x91));var _0x303a=function(_0x53615b,_0xf060d5){_0x53615b=_0x53615b-0x0;var _0x6058f=_0x03a3[_0x53615b];return _0x6058f;};'use strict';var Sequelize=require(_0x303a('0x0'));module[_0x303a('0x1')]={'name':{'type':Sequelize[_0x303a('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x303a('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x303a('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 038b6fa..047d491 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','get','ContactItemTypes','UserProfileResource','destroy','end','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','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','CmContactHasItem','rimraf','zip-dir','bluebird','mustache','util','path'];(function(_0x4be535,_0x2c302c){var _0x30d55f=function(_0x5db7c4){while(--_0x5db7c4){_0x4be535['push'](_0x4be535['shift']());}};_0x30d55f(++_0x2c302c);}(_0x757a,0xde));var _0xa757=function(_0x10b249,_0x35750a){_0x10b249=_0x10b249-0x0;var _0x4220d1=_0x757a[_0x10b249];return _0x4220d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4db68e,_0x421040){_0x421040=_0x421040||0xcc;return function(_0x544b45){if(_0x544b45){return _0x4db68e['sendStatus'](_0x421040);}return _0x4db68e[_0xa757('0x15')](_0x421040)['end']();};}function respondWithResult(_0x481508,_0x32112b){_0x32112b=_0x32112b||0xc8;return function(_0x1b670e){if(_0x1b670e){return _0x481508[_0xa757('0x15')](_0x32112b)[_0xa757('0x16')](_0x1b670e);}};}function respondWithFilteredResult(_0x86abd,_0x31cfd2){return function(_0xf12b68){if(_0xf12b68){var _0x2f7947=typeof _0x31cfd2[_0xa757('0x17')]===_0xa757('0x18')&&typeof _0x31cfd2['limit']===_0xa757('0x18');var _0x44eab8=_0xf12b68[_0xa757('0x19')];var _0x4d9f58=_0x2f7947?0x0:_0x31cfd2['offset'];var _0x151c04=_0x2f7947?_0xf12b68[_0xa757('0x19')]:_0x31cfd2[_0xa757('0x17')]+_0x31cfd2[_0xa757('0x1a')];var _0x27f4ba;if(_0x151c04>=_0x44eab8){_0x151c04=_0x44eab8;_0x27f4ba=0xc8;}else{_0x27f4ba=0xce;}_0x86abd[_0xa757('0x15')](_0x27f4ba);return _0x86abd['set'](_0xa757('0x1b'),_0x4d9f58+'-'+_0x151c04+'/'+_0x44eab8)['json'](_0xf12b68);}return null;};}function patchUpdates(_0x32c2a1){return function(_0x167640){try{jsonpatch[_0xa757('0x1c')](_0x167640,_0x32c2a1,!![]);}catch(_0x2c9ec6){return BPromise['reject'](_0x2c9ec6);}return _0x167640['save']();};}function saveUpdates(_0x40ec48,_0x2159cf){return function(_0x2ba923){if(_0x2ba923){return _0x2ba923[_0xa757('0x1d')](_0x40ec48)[_0xa757('0x1e')](function(_0x40562f){return _0x40562f;});}return null;};}function removeEntity(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(_0x2bf276){return _0x2bf276['destroy']()[_0xa757('0x1e')](function(){var _0x59e9d4=_0x2bf276[_0xa757('0x1f')]({'plain':!![]});var _0x47903b=_0xa757('0x20');return db[_0xa757('0x21')][_0xa757('0x22')]({'where':{'type':_0x47903b,'resourceId':_0x59e9d4['id']}})['then'](function(){return _0x2bf276;});})[_0xa757('0x1e')](function(){_0x2ca10d[_0xa757('0x15')](0xcc)[_0xa757('0x23')]();});}};}function handleEntityNotFound(_0x3bf7f3,_0x5b4779){return function(_0x449a7d){if(!_0x449a7d){_0x3bf7f3['sendStatus'](0x194);}return _0x449a7d;};}function handleError(_0x5a5664,_0x54b75e){_0x54b75e=_0x54b75e||0x1f4;return function(_0x4f8de2){logger[_0xa757('0x24')](_0x4f8de2['stack']);if(_0x4f8de2[_0xa757('0x25')]){delete _0x4f8de2[_0xa757('0x25')];}_0x5a5664['status'](_0x54b75e)[_0xa757('0x26')](_0x4f8de2);};}exports['index']=function(_0x2c4823,_0xa6d0f6){var _0x5307c3={},_0x235e54={},_0x5ade7b={'count':0x0,'rows':[]};var _0x3a4a66=_[_0xa757('0x27')](db[_0xa757('0x28')][_0xa757('0x29')],function(_0xcc87c0){return{'name':_0xcc87c0[_0xa757('0x2a')],'type':_0xcc87c0[_0xa757('0x2b')][_0xa757('0x2c')]};});_0x235e54[_0xa757('0x2d')]=_[_0xa757('0x27')](_0x3a4a66,_0xa757('0x25'));_0x235e54[_0xa757('0x2e')]=_[_0xa757('0x2f')](_0x2c4823[_0xa757('0x2e')]);_0x235e54[_0xa757('0x30')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],_0x235e54[_0xa757('0x2e')]);_0x5307c3[_0xa757('0x32')]=_[_0xa757('0x31')](_0x235e54[_0xa757('0x2d')],qs[_0xa757('0x33')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x33')]));_0x5307c3['attributes']=_0x5307c3[_0xa757('0x32')][_0xa757('0x34')]?_0x5307c3[_0xa757('0x32')]:_0x235e54[_0xa757('0x2d')];if(!_0x2c4823[_0xa757('0x2e')]['hasOwnProperty'](_0xa757('0x35'))){_0x5307c3[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x1a')]);_0x5307c3[_0xa757('0x17')]=qs['offset'](_0x2c4823[_0xa757('0x2e')][_0xa757('0x17')]);}_0x5307c3[_0xa757('0x36')]=qs[_0xa757('0x37')](_0x2c4823[_0xa757('0x2e')][_0xa757('0x37')]);_0x5307c3[_0xa757('0x38')]=qs[_0xa757('0x30')](_[_0xa757('0x39')](_0x2c4823['query'],_0x235e54[_0xa757('0x30')]),_0x3a4a66);if(_0x2c4823[_0xa757('0x2e')][_0xa757('0x3a')]){_0x5307c3[_0xa757('0x38')]=_[_0xa757('0x3b')](_0x5307c3[_0xa757('0x38')],{'$or':_['map'](_0x3a4a66,function(_0x10d3fd){if(_0x10d3fd[_0xa757('0x2b')]!=='VIRTUAL'){var _0x5eae0b={};_0x5eae0b[_0x10d3fd[_0xa757('0x25')]]={'$like':'%'+_0x2c4823[_0xa757('0x2e')]['filter']+'%'};return _0x5eae0b;}})});}_0x5307c3=_['merge']({},_0x5307c3,_0x2c4823[_0xa757('0x3c')]);var _0x1725a2={'where':_0x5307c3[_0xa757('0x38')]};return db['ContactItemType'][_0xa757('0x19')](_0x1725a2)[_0xa757('0x1e')](function(_0x26802c){_0x5ade7b[_0xa757('0x19')]=_0x26802c;if(_0x2c4823[_0xa757('0x2e')]['includeAll']){_0x5307c3[_0xa757('0x3d')]=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x5307c3);})[_0xa757('0x1e')](function(_0x57298b){_0x5ade7b[_0xa757('0x3e')]=_0x57298b;return _0x5ade7b;})[_0xa757('0x1e')](respondWithFilteredResult(_0xa6d0f6,_0x5307c3))[_0xa757('0x3f')](handleError(_0xa6d0f6,null));};exports['show']=function(_0x5d25bb,_0x11e141){var _0x129d77={'raw':!![],'where':{'id':_0x5d25bb[_0xa757('0x40')]['id']}},_0x2b171c={};_0x2b171c[_0xa757('0x2d')]=_[_0xa757('0x2f')](db['ContactItemType'][_0xa757('0x29')]);_0x2b171c[_0xa757('0x2e')]=_['keys'](_0x5d25bb[_0xa757('0x2e')]);_0x2b171c['filters']=_[_0xa757('0x31')](_0x2b171c[_0xa757('0x2d')],_0x2b171c['query']);_0x129d77[_0xa757('0x32')]=_[_0xa757('0x31')](_0x2b171c['model'],qs[_0xa757('0x33')](_0x5d25bb[_0xa757('0x2e')][_0xa757('0x33')]));_0x129d77[_0xa757('0x32')]=_0x129d77['attributes'][_0xa757('0x34')]?_0x129d77[_0xa757('0x32')]:_0x2b171c[_0xa757('0x2d')];if(_0x5d25bb[_0xa757('0x2e')]['includeAll']){_0x129d77[_0xa757('0x3d')]=[{'all':!![]}];}_0x129d77=_['merge']({},_0x129d77,_0x5d25bb['options']);return db[_0xa757('0x28')][_0xa757('0x41')](_0x129d77)[_0xa757('0x1e')](handleEntityNotFound(_0x11e141,null))['then'](respondWithResult(_0x11e141,null))[_0xa757('0x3f')](handleError(_0x11e141,null));};exports['create']=function(_0x2ed63f,_0x151cc3){return db[_0xa757('0x28')][_0xa757('0x42')](_0x2ed63f[_0xa757('0x43')],{})[_0xa757('0x1e')](function(_0x57bf73){var _0x505cd=_0x2ed63f['user'][_0xa757('0x1f')]({'plain':!![]});if(!_0x505cd)throw new Error(_0xa757('0x44'));if(_0x505cd[_0xa757('0x45')]===_0xa757('0x46')){var _0x319988=_0x57bf73[_0xa757('0x1f')]({'plain':!![]});var _0x15bad7=_0xa757('0x20');return db[_0xa757('0x47')][_0xa757('0x41')]({'where':{'name':_0x15bad7,'userProfileId':_0x505cd[_0xa757('0x48')]},'raw':!![]})[_0xa757('0x1e')](function(_0x2367c7){if(_0x2367c7&&_0x2367c7[_0xa757('0x49')]===0x0){return db[_0xa757('0x21')][_0xa757('0x42')]({'name':_0x319988['name'],'resourceId':_0x319988['id'],'type':_0x2367c7[_0xa757('0x25')],'sectionId':_0x2367c7['id']},{})['then'](function(){return _0x57bf73;});}else{return _0x57bf73;}})[_0xa757('0x3f')](function(_0x311c25){logger[_0xa757('0x24')](_0xa757('0x4a'),_0x311c25);throw _0x311c25;});}return _0x57bf73;})['then'](respondWithResult(_0x151cc3,0xc9))[_0xa757('0x3f')](handleError(_0x151cc3,null));};exports[_0xa757('0x1d')]=function(_0x8614f9,_0x980e1){if(_0x8614f9['body']['id']){delete _0x8614f9[_0xa757('0x43')]['id'];}return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x8614f9[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x980e1,null))[_0xa757('0x1e')](saveUpdates(_0x8614f9['body'],null))['then'](respondWithResult(_0x980e1,null))['catch'](handleError(_0x980e1,null));};exports['destroy']=function(_0x1d8742,_0x9b3779){return db[_0xa757('0x28')][_0xa757('0x41')]({'where':{'id':_0x1d8742[_0xa757('0x40')]['id']}})[_0xa757('0x1e')](handleEntityNotFound(_0x9b3779,null))['then'](db[_0xa757('0x4b')][_0xa757('0x1d')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1d8742[_0xa757('0x40')]['id']}}))[_0xa757('0x1e')](removeEntity(_0x9b3779,null))['catch'](handleError(_0x9b3779,null));}; \ No newline at end of file +var _0x02ce=['role','UserProfileSection','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','ContactItemTypes','UserProfileResource','end','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','user','get'];(function(_0x4dfe8f,_0x15d58a){var _0x525088=function(_0x44c9a3){while(--_0x44c9a3){_0x4dfe8f['push'](_0x4dfe8f['shift']());}};_0x525088(++_0x15d58a);}(_0x02ce,0x1ac));var _0xe02c=function(_0x1f1fec,_0xb6d0de){_0x1f1fec=_0x1f1fec-0x0;var _0x1bb724=_0x02ce[_0x1f1fec];return _0x1bb724;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){var _0x60b65e=_0xf41d4c['get']({'plain':!![]});var _0xefd882=_0xe02c('0x2a');return db[_0xe02c('0x2b')][_0xe02c('0x29')]({'where':{'type':_0xefd882,'resourceId':_0x60b65e['id']}})[_0xe02c('0x28')](function(){return _0xf41d4c;});})[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)[_0xe02c('0x2c')]();});}};}function handleEntityNotFound(_0x55ef2a,_0x55e475){return function(_0x3790eb){if(!_0x3790eb){_0x55ef2a[_0xe02c('0x1c')](0x194);}return _0x3790eb;};}function handleError(_0x481e02,_0x18b572){_0x18b572=_0x18b572||0x1f4;return function(_0x2d1d98){logger[_0xe02c('0x2d')](_0x2d1d98[_0xe02c('0x2e')]);if(_0x2d1d98[_0xe02c('0x2f')]){delete _0x2d1d98[_0xe02c('0x2f')];}_0x481e02[_0xe02c('0x22')](_0x18b572)[_0xe02c('0x30')](_0x2d1d98);};}exports[_0xe02c('0x31')]=function(_0x288004,_0x17d5b3){var _0x5a2da0={},_0x3c3d2c={},_0x3c1858={'count':0x0,'rows':[]};var _0x22b783=_[_0xe02c('0x32')](db[_0xe02c('0x33')][_0xe02c('0x34')],function(_0x58bf16){return{'name':_0x58bf16[_0xe02c('0x35')],'type':_0x58bf16[_0xe02c('0x36')]['key']};});_0x3c3d2c[_0xe02c('0x37')]=_[_0xe02c('0x32')](_0x22b783,_0xe02c('0x2f'));_0x3c3d2c[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x288004['query']);_0x3c3d2c['filters']=_[_0xe02c('0x3a')](_0x3c3d2c[_0xe02c('0x37')],_0x3c3d2c['query']);_0x5a2da0[_0xe02c('0x3b')]=_['intersection'](_0x3c3d2c[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x288004[_0xe02c('0x38')][_0xe02c('0x3c')]));_0x5a2da0[_0xe02c('0x3b')]=_0x5a2da0['attributes'][_0xe02c('0x3d')]?_0x5a2da0['attributes']:_0x3c3d2c[_0xe02c('0x37')];if(!_0x288004[_0xe02c('0x38')][_0xe02c('0x3e')](_0xe02c('0x3f'))){_0x5a2da0[_0xe02c('0x21')]=qs[_0xe02c('0x21')](_0x288004['query'][_0xe02c('0x21')]);_0x5a2da0[_0xe02c('0x1e')]=qs['offset'](_0x288004[_0xe02c('0x38')][_0xe02c('0x1e')]);}_0x5a2da0['order']=qs[_0xe02c('0x40')](_0x288004['query'][_0xe02c('0x40')]);_0x5a2da0[_0xe02c('0x41')]=qs['filters'](_[_0xe02c('0x42')](_0x288004[_0xe02c('0x38')],_0x3c3d2c[_0xe02c('0x43')]),_0x22b783);if(_0x288004[_0xe02c('0x38')][_0xe02c('0x44')]){_0x5a2da0[_0xe02c('0x41')]=_['merge'](_0x5a2da0[_0xe02c('0x41')],{'$or':_['map'](_0x22b783,function(_0x5ae8cd){if(_0x5ae8cd[_0xe02c('0x36')]!==_0xe02c('0x45')){var _0x42fbac={};_0x42fbac[_0x5ae8cd[_0xe02c('0x2f')]]={'$like':'%'+_0x288004['query'][_0xe02c('0x44')]+'%'};return _0x42fbac;}})});}_0x5a2da0=_[_0xe02c('0x46')]({},_0x5a2da0,_0x288004[_0xe02c('0x47')]);var _0x5baef6={'where':_0x5a2da0['where']};return db[_0xe02c('0x33')][_0xe02c('0x20')](_0x5baef6)[_0xe02c('0x28')](function(_0x2313d2){_0x3c1858[_0xe02c('0x20')]=_0x2313d2;if(_0x288004[_0xe02c('0x38')][_0xe02c('0x48')]){_0x5a2da0[_0xe02c('0x49')]=[{'all':!![]}];}return db[_0xe02c('0x33')]['findAll'](_0x5a2da0);})[_0xe02c('0x28')](function(_0x5ef4a1){_0x3c1858['rows']=_0x5ef4a1;return _0x3c1858;})[_0xe02c('0x28')](respondWithFilteredResult(_0x17d5b3,_0x5a2da0))[_0xe02c('0x4a')](handleError(_0x17d5b3,null));};exports[_0xe02c('0x4b')]=function(_0x1719cf,_0x24d506){var _0x12ca0e={'raw':!![],'where':{'id':_0x1719cf[_0xe02c('0x4c')]['id']}},_0x165f4a={};_0x165f4a['model']=_['keys'](db[_0xe02c('0x33')][_0xe02c('0x34')]);_0x165f4a[_0xe02c('0x38')]=_['keys'](_0x1719cf[_0xe02c('0x38')]);_0x165f4a[_0xe02c('0x43')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],_0x165f4a[_0xe02c('0x38')]);_0x12ca0e[_0xe02c('0x3b')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x1719cf[_0xe02c('0x38')]['fields']));_0x12ca0e[_0xe02c('0x3b')]=_0x12ca0e[_0xe02c('0x3b')][_0xe02c('0x3d')]?_0x12ca0e[_0xe02c('0x3b')]:_0x165f4a[_0xe02c('0x37')];if(_0x1719cf[_0xe02c('0x38')][_0xe02c('0x48')]){_0x12ca0e[_0xe02c('0x49')]=[{'all':!![]}];}_0x12ca0e=_[_0xe02c('0x46')]({},_0x12ca0e,_0x1719cf[_0xe02c('0x47')]);return db[_0xe02c('0x33')][_0xe02c('0x4d')](_0x12ca0e)[_0xe02c('0x28')](handleEntityNotFound(_0x24d506,null))['then'](respondWithResult(_0x24d506,null))[_0xe02c('0x4a')](handleError(_0x24d506,null));};exports['create']=function(_0x15b05c,_0x324911){return db[_0xe02c('0x33')][_0xe02c('0x4e')](_0x15b05c[_0xe02c('0x4f')],{})[_0xe02c('0x28')](function(_0x160969){var _0xc2b5dd=_0x15b05c[_0xe02c('0x50')][_0xe02c('0x51')]({'plain':!![]});if(!_0xc2b5dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc2b5dd[_0xe02c('0x52')]===_0xe02c('0x50')){var _0xeb4214=_0x160969['get']({'plain':!![]});var _0xdab6cb='ContactItemTypes';return db[_0xe02c('0x53')]['find']({'where':{'name':_0xdab6cb,'userProfileId':_0xc2b5dd['userProfileId']},'raw':!![]})['then'](function(_0x55cf99){if(_0x55cf99&&_0x55cf99['autoAssociation']===0x0){return db['UserProfileResource'][_0xe02c('0x4e')]({'name':_0xeb4214[_0xe02c('0x2f')],'resourceId':_0xeb4214['id'],'type':_0x55cf99[_0xe02c('0x2f')],'sectionId':_0x55cf99['id']},{})[_0xe02c('0x28')](function(){return _0x160969;});}else{return _0x160969;}})['catch'](function(_0x274beb){logger[_0xe02c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x274beb);throw _0x274beb;});}return _0x160969;})[_0xe02c('0x28')](respondWithResult(_0x324911,0xc9))[_0xe02c('0x4a')](handleError(_0x324911,null));};exports[_0xe02c('0x27')]=function(_0x51f940,_0x57a00f){if(_0x51f940[_0xe02c('0x4f')]['id']){delete _0x51f940[_0xe02c('0x4f')]['id'];}return db[_0xe02c('0x33')]['find']({'where':{'id':_0x51f940[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57a00f,null))['then'](saveUpdates(_0x51f940[_0xe02c('0x4f')],null))[_0xe02c('0x28')](respondWithResult(_0x57a00f,null))['catch'](handleError(_0x57a00f,null));};exports[_0xe02c('0x29')]=function(_0x849eea,_0x1ead72){return db['ContactItemType'][_0xe02c('0x4d')]({'where':{'id':_0x849eea[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ead72,null))[_0xe02c('0x28')](db[_0xe02c('0x54')][_0xe02c('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x849eea[_0xe02c('0x4c')]['id']}}))[_0xe02c('0x28')](removeEntity(_0x1ead72,null))[_0xe02c('0x4a')](handleError(_0x1ead72,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index cf885a1..67c482a 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ebc=['ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','../../config/environment','exports'];(function(_0x306e4f,_0x14766f){var _0x20c211=function(_0xb6a4d1){while(--_0xb6a4d1){_0x306e4f['push'](_0x306e4f['shift']());}};_0x20c211(++_0x14766f);}(_0x2ebc,0xa4));var _0xc2eb=function(_0x524f87,_0x1d71ef){_0x524f87=_0x524f87-0x0;var _0x266c5d=_0x2ebc[_0x524f87];return _0x266c5d;};'use strict';var _=require(_0xc2eb('0x0'));var util=require(_0xc2eb('0x1'));var logger=require(_0xc2eb('0x2'))(_0xc2eb('0x3'));var moment=require(_0xc2eb('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(_0xc2eb('0x5'));var attributes=require('./contactItemType.attributes');module[_0xc2eb('0x6')]=function(_0x433d7a,_0x529361){return _0x433d7a['define'](_0xc2eb('0x7'),attributes,{'tableName':_0xc2eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a69=['request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','../../config/logger','bluebird'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x5a69,0x8c));var _0x95a6=function(_0x17ff07,_0x46a8c3){_0x17ff07=_0x17ff07-0x0;var _0x414a9f=_0x5a69[_0x17ff07];return _0x414a9f;};'use strict';var _=require(_0x95a6('0x0'));var util=require('util');var logger=require(_0x95a6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x95a6('0x2'));var rp=require(_0x95a6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95a6('0x4'));var config=require(_0x95a6('0x5'));var attributes=require(_0x95a6('0x6'));module[_0x95a6('0x7')]=function(_0x4a77db,_0x1d9baa){return _0x4a77db[_0x95a6('0x8')](_0x95a6('0x9'),attributes,{'tableName':_0x95a6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 34af0cf..8cb8cf0 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42d7=['client','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x42d7,0xa8));var _0x742d=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0x42d7[_0x4cfa2e];return _0x279b50;};'use strict';var _=require(_0x742d('0x0'));var util=require('util');var moment=require(_0x742d('0x1'));var BPromise=require(_0x742d('0x2'));var rs=require(_0x742d('0x3'));var fs=require('fs');var Redis=require(_0x742d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x742d('0x5'));var logger=require(_0x742d('0x6'))(_0x742d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x742d('0x8')][_0x742d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22a263,_0x1c7664,_0x2955a8){return new BPromise(function(_0x55b85f,_0x75e69f){return client['request'](_0x22a263,_0x2955a8)[_0x742d('0xa')](function(_0x3e78de){logger[_0x742d('0xb')](_0x742d('0xc'),_0x1c7664,_0x742d('0xd'));logger[_0x742d('0xe')](_0x742d('0xf'),_0x1c7664,'request\x20sent',JSON[_0x742d('0x10')](_0x3e78de));if(_0x3e78de[_0x742d('0x11')]){if(_0x3e78de[_0x742d('0x11')][_0x742d('0x12')]===0x1f4){logger[_0x742d('0x11')](_0x742d('0xc'),_0x1c7664,_0x3e78de[_0x742d('0x11')]['message']);return _0x75e69f(_0x3e78de[_0x742d('0x11')][_0x742d('0x13')]);}logger[_0x742d('0x11')](_0x742d('0xc'),_0x1c7664,_0x3e78de['error']['message']);return _0x55b85f(_0x3e78de[_0x742d('0x11')][_0x742d('0x13')]);}else{logger[_0x742d('0xb')]('ContactItemType,\x20%s,\x20%s',_0x1c7664,'request\x20sent');_0x55b85f(_0x3e78de[_0x742d('0x14')]['message']);}})[_0x742d('0x15')](function(_0x11a8fc){logger['error']('ContactItemType,\x20%s,\x20%s',_0x1c7664,_0x11a8fc);_0x75e69f(_0x11a8fc);});});} \ No newline at end of file +var _0xd3a2=['ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xd3a2,0x7c));var _0x2d3a=function(_0x320c77,_0x11fb98){_0x320c77=_0x320c77-0x0;var _0x190ff2=_0xd3a2[_0x320c77];return _0x190ff2;};'use strict';var _=require('lodash');var util=require(_0x2d3a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d3a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d3a('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d3a('0x3'));var config=require(_0x2d3a('0x4'));var jayson=require(_0x2d3a('0x5'));var client=jayson[_0x2d3a('0x6')][_0x2d3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48035a,_0x1d2c1c,_0x48380d){return new BPromise(function(_0x1fac6a,_0x2b8073){return client['request'](_0x48035a,_0x48380d)['then'](function(_0x564c97){logger[_0x2d3a('0x8')](_0x2d3a('0x9'),_0x1d2c1c,_0x2d3a('0xa'));logger[_0x2d3a('0xb')](_0x2d3a('0xc'),_0x1d2c1c,_0x2d3a('0xa'),JSON[_0x2d3a('0xd')](_0x564c97));if(_0x564c97[_0x2d3a('0xe')]){if(_0x564c97[_0x2d3a('0xe')][_0x2d3a('0xf')]===0x1f4){logger[_0x2d3a('0xe')](_0x2d3a('0x9'),_0x1d2c1c,_0x564c97[_0x2d3a('0xe')][_0x2d3a('0x10')]);return _0x2b8073(_0x564c97['error']['message']);}logger[_0x2d3a('0xe')](_0x2d3a('0x9'),_0x1d2c1c,_0x564c97[_0x2d3a('0xe')]['message']);return _0x1fac6a(_0x564c97['error'][_0x2d3a('0x10')]);}else{logger[_0x2d3a('0x8')](_0x2d3a('0x9'),_0x1d2c1c,_0x2d3a('0xa'));_0x1fac6a(_0x564c97[_0x2d3a('0x11')][_0x2d3a('0x10')]);}})[_0x2d3a('0x12')](function(_0x41f4d1){logger['error'](_0x2d3a('0x9'),_0x1d2c1c,_0x41f4d1);_0x2b8073(_0x41f4d1);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 3220eb7..9ee063d 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdef0=['destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','/:id','update','delete'];(function(_0x1987cf,_0x4e40b6){var _0x5f567e=function(_0x4be796){while(--_0x4be796){_0x1987cf['push'](_0x1987cf['shift']());}};_0x5f567e(++_0x4e40b6);}(_0xdef0,0x111));var _0x0def=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdef0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x0def('0x0'));var path=require(_0x0def('0x1'));var timeout=require(_0x0def('0x2'));var express=require(_0x0def('0x3'));var router=express['Router']();var fs_extra=require(_0x0def('0x4'));var auth=require(_0x0def('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0def('0x6'));var controller=require('./contactItemType.controller');router[_0x0def('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0def('0x7')]('/:id',auth[_0x0def('0x8')](),controller[_0x0def('0x9')]);router['post']('/',auth[_0x0def('0x8')](),controller[_0x0def('0xa')]);router[_0x0def('0xb')](_0x0def('0xc'),auth[_0x0def('0x8')](),controller[_0x0def('0xd')]);router[_0x0def('0xe')]('/:id',auth[_0x0def('0x8')](),controller[_0x0def('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6296=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','post','isAuthenticated','put','/:id','delete','destroy','multer','util'];(function(_0xc67faa,_0x2265a2){var _0x2a306e=function(_0x31b648){while(--_0x31b648){_0xc67faa['push'](_0xc67faa['shift']());}};_0x2a306e(++_0x2265a2);}(_0x6296,0x10c));var _0x6629=function(_0xbf30a9,_0x29e850){_0xbf30a9=_0xbf30a9-0x0;var _0x15dc4e=_0x6296[_0xbf30a9];return _0x15dc4e;};'use strict';var multer=require(_0x6629('0x0'));var util=require(_0x6629('0x1'));var path=require(_0x6629('0x2'));var timeout=require('connect-timeout');var express=require(_0x6629('0x3'));var router=express[_0x6629('0x4')]();var fs_extra=require(_0x6629('0x5'));var auth=require(_0x6629('0x6'));var interaction=require(_0x6629('0x7'));var config=require(_0x6629('0x8'));var controller=require(_0x6629('0x9'));router[_0x6629('0xa')]('/',auth['isAuthenticated'](),controller[_0x6629('0xb')]);router[_0x6629('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6629('0xc')]('/',auth[_0x6629('0xd')](),controller['create']);router[_0x6629('0xe')](_0x6629('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6629('0x10')](_0x6629('0xf'),auth[_0x6629('0xd')](),controller[_0x6629('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index d5c67a9..9272159 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 _0x0713=['STRING','name'];(function(_0xbcebff,_0x2dae1a){var _0x3f7bd5=function(_0x447993){while(--_0x447993){_0xbcebff['push'](_0xbcebff['shift']());}};_0x3f7bd5(++_0x2dae1a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x1135c0,_0x1fcc56){var _0x24fb1a=function(_0x1c020c){while(--_0x1c020c){_0x1135c0['push'](_0x1135c0['shift']());}};_0x24fb1a(++_0x1fcc56);}(_0x757a,0xde));var _0xa757=function(_0x100970,_0x1727dd){_0x100970=_0x100970-0x0;var _0x3ff8a5=_0x757a[_0x100970];return _0x3ff8a5;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index f4aaa7e..ed2e967 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 _0x50e2=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','UserProfileSection','userProfileId','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./dashboard.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','CustomDashboards','error','name','send','map','Dashboard','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x261d9e,_0x4f0942){var _0x3f8a2c=function(_0x28aaf8){while(--_0x28aaf8){_0x261d9e['push'](_0x261d9e['shift']());}};_0x3f8a2c(++_0x4f0942);}(_0x50e2,0x12e));var _0x250e=function(_0x400b6c,_0x4a6139){_0x400b6c=_0x400b6c-0x0;var _0x4c4e3e=_0x50e2[_0x400b6c];return _0x4c4e3e;};'use strict';var emlformat=require(_0x250e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x250e('0x1'));var jsonpatch=require(_0x250e('0x2'));var rp=require(_0x250e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x250e('0x4'));var util=require('util');var path=require(_0x250e('0x5'));var sox=require(_0x250e('0x6'));var csv=require(_0x250e('0x7'));var ejs=require(_0x250e('0x8'));var fs=require('fs');var fs_extra=require(_0x250e('0x9'));var _=require(_0x250e('0xa'));var squel=require(_0x250e('0xb'));var crypto=require('crypto');var jsforce=require(_0x250e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x250e('0x7'));var querystring=require(_0x250e('0xd'));var Papa=require(_0x250e('0xe'));var Redis=require(_0x250e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x250e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x250e('0x11'))(_0x250e('0x12'));var utils=require(_0x250e('0x13'));var config=require(_0x250e('0x14'));var licenseUtil=require(_0x250e('0x15'));var db=require(_0x250e('0x16'))['db'];config[_0x250e('0x17')]=_['defaults'](config[_0x250e('0x17')],{'host':_0x250e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x250e('0x17')]));require(_0x250e('0x19'))['register'](socket);function respondWithStatusCode(_0x1364b1,_0x578e3f){_0x578e3f=_0x578e3f||0xcc;return function(_0x53f2d6){if(_0x53f2d6){return _0x1364b1[_0x250e('0x1a')](_0x578e3f);}return _0x1364b1[_0x250e('0x1b')](_0x578e3f)[_0x250e('0x1c')]();};}function respondWithResult(_0x5053c0,_0x2381f7){_0x2381f7=_0x2381f7||0xc8;return function(_0x230de6){if(_0x230de6){return _0x5053c0[_0x250e('0x1b')](_0x2381f7)[_0x250e('0x1d')](_0x230de6);}};}function respondWithFilteredResult(_0x1f2927,_0x3a760d){return function(_0x52b4df){if(_0x52b4df){var _0x14edba=typeof _0x3a760d[_0x250e('0x1e')]===_0x250e('0x1f')&&typeof _0x3a760d[_0x250e('0x20')]==='undefined';var _0x3a0e0e=_0x52b4df[_0x250e('0x21')];var _0x17d9df=_0x14edba?0x0:_0x3a760d[_0x250e('0x1e')];var _0x4f59ea=_0x14edba?_0x52b4df[_0x250e('0x21')]:_0x3a760d[_0x250e('0x1e')]+_0x3a760d['limit'];var _0x5be564;if(_0x4f59ea>=_0x3a0e0e){_0x4f59ea=_0x3a0e0e;_0x5be564=0xc8;}else{_0x5be564=0xce;}_0x1f2927[_0x250e('0x1b')](_0x5be564);return _0x1f2927[_0x250e('0x22')]('Content-Range',_0x17d9df+'-'+_0x4f59ea+'/'+_0x3a0e0e)[_0x250e('0x1d')](_0x52b4df);}return null;};}function patchUpdates(_0x137aad){return function(_0x26b207){try{jsonpatch[_0x250e('0x23')](_0x26b207,_0x137aad,!![]);}catch(_0x4d7f63){return BPromise[_0x250e('0x24')](_0x4d7f63);}return _0x26b207[_0x250e('0x25')]();};}function saveUpdates(_0x1a2129,_0x409a45){return function(_0x483fa4){if(_0x483fa4){return _0x483fa4['update'](_0x1a2129)[_0x250e('0x26')](function(_0x3ed6ea){return _0x3ed6ea;});}return null;};}function removeEntity(_0x44ed12,_0x55347f){return function(_0x2d92a2){if(_0x2d92a2){return _0x2d92a2[_0x250e('0x27')]()[_0x250e('0x26')](function(){var _0x4f8242=_0x2d92a2['get']({'plain':!![]});var _0xc959c5=_0x250e('0x28');return db['UserProfileResource'][_0x250e('0x27')]({'where':{'type':_0xc959c5,'resourceId':_0x4f8242['id']}})[_0x250e('0x26')](function(){return _0x2d92a2;});})['then'](function(){_0x44ed12[_0x250e('0x1b')](0xcc)[_0x250e('0x1c')]();});}};}function handleEntityNotFound(_0x31e2e4,_0x623e05){return function(_0x3f3aa3){if(!_0x3f3aa3){_0x31e2e4['sendStatus'](0x194);}return _0x3f3aa3;};}function handleError(_0x1cee31,_0x4b338a){_0x4b338a=_0x4b338a||0x1f4;return function(_0x49a945){logger[_0x250e('0x29')](_0x49a945['stack']);if(_0x49a945[_0x250e('0x2a')]){delete _0x49a945[_0x250e('0x2a')];}_0x1cee31['status'](_0x4b338a)[_0x250e('0x2b')](_0x49a945);};}exports['index']=function(_0x51a6b7,_0x6c70be){var _0x4ff5e5={},_0x3658c1={},_0x4b593c={'count':0x0,'rows':[]};var _0xb93895=_[_0x250e('0x2c')](db[_0x250e('0x2d')][_0x250e('0x2e')],function(_0x188700){return{'name':_0x188700[_0x250e('0x2f')],'type':_0x188700['type'][_0x250e('0x30')]};});_0x3658c1[_0x250e('0x31')]=_[_0x250e('0x2c')](_0xb93895,_0x250e('0x2a'));_0x3658c1[_0x250e('0x32')]=_['keys'](_0x51a6b7[_0x250e('0x32')]);_0x3658c1[_0x250e('0x33')]=_[_0x250e('0x34')](_0x3658c1[_0x250e('0x31')],_0x3658c1[_0x250e('0x32')]);_0x4ff5e5[_0x250e('0x35')]=_[_0x250e('0x34')](_0x3658c1[_0x250e('0x31')],qs[_0x250e('0x36')](_0x51a6b7[_0x250e('0x32')]['fields']));_0x4ff5e5[_0x250e('0x35')]=_0x4ff5e5['attributes'][_0x250e('0x37')]?_0x4ff5e5[_0x250e('0x35')]:_0x3658c1[_0x250e('0x31')];if(!_0x51a6b7[_0x250e('0x32')][_0x250e('0x38')](_0x250e('0x39'))){_0x4ff5e5[_0x250e('0x20')]=qs[_0x250e('0x20')](_0x51a6b7[_0x250e('0x32')][_0x250e('0x20')]);_0x4ff5e5[_0x250e('0x1e')]=qs[_0x250e('0x1e')](_0x51a6b7['query']['offset']);}_0x4ff5e5['order']=qs[_0x250e('0x3a')](_0x51a6b7[_0x250e('0x32')][_0x250e('0x3a')]);_0x4ff5e5[_0x250e('0x3b')]=qs[_0x250e('0x33')](_['pick'](_0x51a6b7[_0x250e('0x32')],_0x3658c1[_0x250e('0x33')]),_0xb93895);if(_0x51a6b7[_0x250e('0x32')][_0x250e('0x3c')]){_0x4ff5e5['where']=_[_0x250e('0x3d')](_0x4ff5e5['where'],{'$or':_[_0x250e('0x2c')](_0xb93895,function(_0x404b01){if(_0x404b01[_0x250e('0x3e')]!=='VIRTUAL'){var _0x200d85={};_0x200d85[_0x404b01[_0x250e('0x2a')]]={'$like':'%'+_0x51a6b7[_0x250e('0x32')][_0x250e('0x3c')]+'%'};return _0x200d85;}})});}_0x4ff5e5=_[_0x250e('0x3d')]({},_0x4ff5e5,_0x51a6b7[_0x250e('0x3f')]);var _0x1cff7b={'where':_0x4ff5e5[_0x250e('0x3b')]};return db['Dashboard'][_0x250e('0x21')](_0x1cff7b)[_0x250e('0x26')](function(_0x2cc6a4){_0x4b593c[_0x250e('0x21')]=_0x2cc6a4;if(_0x51a6b7[_0x250e('0x32')][_0x250e('0x40')]){_0x4ff5e5[_0x250e('0x41')]=[{'all':!![]}];}return db[_0x250e('0x2d')][_0x250e('0x42')](_0x4ff5e5);})['then'](function(_0x287fe0){_0x4b593c['rows']=_0x287fe0;return _0x4b593c;})['then'](respondWithFilteredResult(_0x6c70be,_0x4ff5e5))[_0x250e('0x43')](handleError(_0x6c70be,null));};exports['show']=function(_0x4511d9,_0x2d0392){var _0x1f2284={'raw':![],'where':{'id':_0x4511d9['params']['id']}},_0x8585f8={};_0x8585f8[_0x250e('0x31')]=_[_0x250e('0x44')](db['Dashboard'][_0x250e('0x2e')]);_0x8585f8[_0x250e('0x32')]=_[_0x250e('0x44')](_0x4511d9[_0x250e('0x32')]);_0x8585f8['filters']=_[_0x250e('0x34')](_0x8585f8[_0x250e('0x31')],_0x8585f8[_0x250e('0x32')]);_0x1f2284['attributes']=_[_0x250e('0x34')](_0x8585f8[_0x250e('0x31')],qs[_0x250e('0x36')](_0x4511d9['query']['fields']));_0x1f2284[_0x250e('0x35')]=_0x1f2284[_0x250e('0x35')][_0x250e('0x37')]?_0x1f2284[_0x250e('0x35')]:_0x8585f8[_0x250e('0x31')];if(_0x4511d9[_0x250e('0x32')][_0x250e('0x40')]){_0x1f2284['include']=[{'all':!![]}];}_0x1f2284=_['merge']({},_0x1f2284,_0x4511d9[_0x250e('0x3f')]);return db[_0x250e('0x2d')][_0x250e('0x45')](_0x1f2284)[_0x250e('0x26')](handleEntityNotFound(_0x2d0392,null))[_0x250e('0x26')](respondWithResult(_0x2d0392,null))[_0x250e('0x43')](handleError(_0x2d0392,null));};exports['create']=function(_0x1e27a6,_0x2624f1){return db[_0x250e('0x2d')][_0x250e('0x46')](_0x1e27a6[_0x250e('0x47')],{})[_0x250e('0x26')](function(_0x5f35ce){var _0x199511=_0x1e27a6[_0x250e('0x48')][_0x250e('0x49')]({'plain':!![]});if(!_0x199511)throw new Error(_0x250e('0x4a'));if(_0x199511[_0x250e('0x4b')]===_0x250e('0x48')){var _0x1d0832=_0x5f35ce[_0x250e('0x49')]({'plain':!![]});var _0x579e4a=_0x250e('0x28');return db['UserProfileSection'][_0x250e('0x45')]({'where':{'name':_0x579e4a,'userProfileId':_0x199511['userProfileId']},'raw':!![]})['then'](function(_0x226ccb){if(_0x226ccb&&_0x226ccb[_0x250e('0x4c')]===0x0){return db[_0x250e('0x4d')]['create']({'name':_0x1d0832[_0x250e('0x2a')],'resourceId':_0x1d0832['id'],'type':_0x226ccb[_0x250e('0x2a')],'sectionId':_0x226ccb['id']},{})[_0x250e('0x26')](function(){return _0x5f35ce;});}else{return _0x5f35ce;}})[_0x250e('0x43')](function(_0x502f0c){logger['error'](_0x250e('0x4e'),_0x502f0c);throw _0x502f0c;});}return _0x5f35ce;})[_0x250e('0x26')](respondWithResult(_0x2624f1,0xc9))[_0x250e('0x43')](handleError(_0x2624f1,null));};exports[_0x250e('0x4f')]=function(_0x5b7dff,_0x5a79a1){var _0x5769bc={'where':{'id':_0x5b7dff[_0x250e('0x50')]['id']}},_0x3fb1d4={};_0x3fb1d4[_0x250e('0x31')]=_[_0x250e('0x44')](db[_0x250e('0x2d')]['rawAttributes']);_0x5769bc[_0x250e('0x35')]=_['intersection'](_0x3fb1d4['model'],qs[_0x250e('0x36')](_0x5b7dff[_0x250e('0x32')][_0x250e('0x36')]));_0x5769bc['attributes']=_0x5769bc[_0x250e('0x35')][_0x250e('0x37')]?_0x5769bc[_0x250e('0x35')]:_0x3fb1d4[_0x250e('0x31')];if(_0x5b7dff[_0x250e('0x32')][_0x250e('0x40')]){_0x5769bc[_0x250e('0x41')]=[{'all':!![]}];}_0x5769bc=_[_0x250e('0x3d')]({},_0x5769bc,_0x5b7dff[_0x250e('0x3f')]);return db[_0x250e('0x2d')][_0x250e('0x45')](_0x5769bc)['then'](handleEntityNotFound(_0x5a79a1,null))[_0x250e('0x26')](function(_0x41ebf7){if(_0x41ebf7){var _0x1002e9=_0x41ebf7[_0x250e('0x49')]({'plain':!![]});_0x1002e9=qs[_0x250e('0x51')](_0x1002e9,['id',_0x250e('0x52'),_0x250e('0x53')]);_0x5b7dff[_0x250e('0x47')]=_[_0x250e('0x51')](_0x5b7dff['body'],['id',_0x250e('0x52'),'updatedAt']);return db[_0x250e('0x2d')][_0x250e('0x46')](_['merge'](_0x1002e9,_0x5b7dff[_0x250e('0x47')]),{'include':_0x5b7dff[_0x250e('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x250e('0x26')](function(_0x702aa5){var _0x2bc610=_0x5b7dff[_0x250e('0x48')]['get']({'plain':!![]});if(!_0x2bc610)throw new Error(_0x250e('0x4a'));if(_0x2bc610[_0x250e('0x4b')]===_0x250e('0x48')){var _0x3f6aa0=_0x702aa5['get']({'plain':!![]});var _0x338685=_0x250e('0x28');return db[_0x250e('0x54')][_0x250e('0x45')]({'where':{'name':_0x338685,'userProfileId':_0x2bc610[_0x250e('0x55')]},'raw':!![]})[_0x250e('0x26')](function(_0x20f5c4){if(_0x20f5c4&&_0x20f5c4[_0x250e('0x4c')]===0x0){return db['UserProfileResource'][_0x250e('0x46')]({'name':_0x3f6aa0[_0x250e('0x2a')],'resourceId':_0x3f6aa0['id'],'type':_0x20f5c4['name'],'sectionId':_0x20f5c4['id']},{})['then'](function(){return _0x702aa5;});}else{return _0x702aa5;}})[_0x250e('0x43')](function(_0x4c07d4){logger[_0x250e('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c07d4);throw _0x4c07d4;});}return _0x702aa5;});}})[_0x250e('0x26')](respondWithResult(_0x5a79a1,0xc9))[_0x250e('0x43')](handleError(_0x5a79a1,null));};exports[_0x250e('0x56')]=function(_0x3fb68e,_0x4ece70){if(_0x3fb68e['body']['id']){delete _0x3fb68e[_0x250e('0x47')]['id'];}return db[_0x250e('0x2d')][_0x250e('0x45')]({'where':{'id':_0x3fb68e[_0x250e('0x50')]['id']}})['then'](handleEntityNotFound(_0x4ece70,null))['then'](saveUpdates(_0x3fb68e[_0x250e('0x47')],null))[_0x250e('0x26')](respondWithResult(_0x4ece70,null))['catch'](handleError(_0x4ece70,null));};exports[_0x250e('0x27')]=function(_0x520a0b,_0x5029b3){return db[_0x250e('0x2d')][_0x250e('0x45')]({'where':{'id':_0x520a0b[_0x250e('0x50')]['id']}})[_0x250e('0x26')](handleEntityNotFound(_0x5029b3,null))[_0x250e('0x26')](removeEntity(_0x5029b3,null))['catch'](handleError(_0x5029b3,null));};function widgetAttributes(_0x21fb43){try{switch(_0x21fb43['type']){case _0x250e('0x57'):return[{'name':'attrUrl','value':_0x21fb43[_0x250e('0x58')]||(_0x21fb43['attrs']&&_0x21fb43['attrs'][0x0]?_0x21fb43[_0x250e('0x59')][0x0][_0x250e('0x5a')]:undefined)||_0x250e('0x5b')}];case _0x250e('0x5c'):return[{'name':_0x250e('0x5d'),'value':_0x21fb43[_0x250e('0x5d')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x0]?_0x21fb43[_0x250e('0x59')][0x0][_0x250e('0x5a')]:undefined)||''}];case'clock':return[{'name':_0x250e('0x5e'),'value':_0x21fb43['attrHourFormat']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x0]?_0x21fb43['attrs'][0x0]['value']:undefined)||_0x250e('0x5f')},{'name':_0x250e('0x60'),'value':_0x21fb43[_0x250e('0x60')]||(_0x21fb43['attrs']&&_0x21fb43[_0x250e('0x59')][0x1]?_0x21fb43[_0x250e('0x59')][0x1][_0x250e('0x5a')]:undefined)||_0x250e('0x61')},{'name':_0x250e('0x62'),'value':_0x21fb43['attrFontSize']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x2]?_0x21fb43['attrs'][0x2][_0x250e('0x5a')]:undefined)||0xc}];case'counter':return[{'name':_0x250e('0x63'),'value':_0x21fb43[_0x250e('0x63')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x0]?_0x21fb43['attrs'][0x0]['value']:undefined)||_0x250e('0x64')},{'name':_0x250e('0x65'),'value':_0x21fb43[_0x250e('0x65')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x1]?_0x21fb43['attrs'][0x1]['value']:undefined)||[]},{'name':_0x250e('0x62'),'value':_0x21fb43[_0x250e('0x62')]||(_0x21fb43['attrs']&&_0x21fb43[_0x250e('0x59')][0x2]?_0x21fb43[_0x250e('0x59')][0x2]['value']:undefined)||0x14},{'name':_0x250e('0x66'),'value':_0x21fb43[_0x250e('0x66')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x3]?_0x21fb43['attrs'][0x3][_0x250e('0x5a')]:undefined)||_0x250e('0x67')},{'name':_0x250e('0x68'),'value':_0x21fb43[_0x250e('0x68')]||(_0x21fb43['attrs']&&_0x21fb43[_0x250e('0x59')][0x4]?_0x21fb43[_0x250e('0x59')][0x4][_0x250e('0x5a')]:undefined)||''},{'name':_0x250e('0x69'),'value':_0x21fb43[_0x250e('0x69')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x5]?_0x21fb43['attrs'][0x5][_0x250e('0x5a')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x21fb43[_0x250e('0x6a')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x6]?_0x21fb43[_0x250e('0x59')][0x6][_0x250e('0x5a')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x21fb43[_0x250e('0x6b')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43['attrs'][0x7]?_0x21fb43[_0x250e('0x59')][0x7][_0x250e('0x5a')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x21fb43['attrWhatsappAccounts']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x8]?_0x21fb43[_0x250e('0x59')][0x8][_0x250e('0x5a')]:undefined)||''},{'name':_0x250e('0x6c'),'value':_0x21fb43['attrChatWebsites']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x9]?_0x21fb43[_0x250e('0x59')][0x9][_0x250e('0x5a')]:undefined)||''}];case _0x250e('0x6d'):case _0x250e('0x6e'):return[{'name':_0x250e('0x6f'),'value':_0x21fb43[_0x250e('0x6f')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x0]?_0x21fb43[_0x250e('0x59')][0x0]['value']:undefined)||_0x250e('0x64')},{'name':'attrSerie2','value':_0x21fb43[_0x250e('0x70')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x1]?_0x21fb43['attrs'][0x1][_0x250e('0x5a')]:undefined)||null},{'name':_0x250e('0x71'),'value':_0x21fb43['attrSerie3']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x2]?_0x21fb43[_0x250e('0x59')][0x2][_0x250e('0x5a')]:undefined)||null},{'name':_0x250e('0x65'),'value':_0x21fb43[_0x250e('0x65')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x3]?_0x21fb43[_0x250e('0x59')][0x3][_0x250e('0x5a')]:undefined)||[]},{'name':_0x250e('0x66'),'value':_0x21fb43[_0x250e('0x66')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43['attrs'][0x4]?_0x21fb43[_0x250e('0x59')][0x4][_0x250e('0x5a')]:undefined)||_0x250e('0x67')},{'name':_0x250e('0x68'),'value':_0x21fb43['attrEmailAccounts']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x5]?_0x21fb43[_0x250e('0x59')][0x5][_0x250e('0x5a')]:undefined)||''},{'name':_0x250e('0x69'),'value':_0x21fb43['attrFaxAccounts']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x6]?_0x21fb43['attrs'][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x21fb43[_0x250e('0x6a')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x7]?_0x21fb43['attrs'][0x7][_0x250e('0x5a')]:undefined)||''},{'name':_0x250e('0x6b'),'value':_0x21fb43['attrOpenchannelAccounts']||(_0x21fb43['attrs']&&_0x21fb43['attrs'][0x8]?_0x21fb43[_0x250e('0x59')][0x8][_0x250e('0x5a')]:undefined)||''},{'name':_0x250e('0x72'),'value':_0x21fb43['attrWhatsappAccounts']||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x9]?_0x21fb43[_0x250e('0x59')][0x9][_0x250e('0x5a')]:undefined)||''},{'name':_0x250e('0x6c'),'value':_0x21fb43[_0x250e('0x6c')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43['attrs'][0xa]?_0x21fb43[_0x250e('0x59')][0xa][_0x250e('0x5a')]:undefined)||''}];case _0x250e('0x73'):return[{'name':_0x250e('0x74'),'type':_0x21fb43[_0x250e('0x75')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43['attrs'][0x0]?_0x21fb43[_0x250e('0x59')][0x0][_0x250e('0x3e')]:undefined)||null,'value':_0x21fb43[_0x250e('0x74')]||(_0x21fb43['attrs']&&_0x21fb43[_0x250e('0x59')][0x0]?_0x21fb43['attrs'][0x0][_0x250e('0x5a')]:undefined)||null},{'name':_0x250e('0x76'),'value':_0x21fb43[_0x250e('0x76')]||(_0x21fb43[_0x250e('0x59')]&&_0x21fb43[_0x250e('0x59')][0x1]?_0x21fb43['attrs'][0x1][_0x250e('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x207199){logger[_0x250e('0x29')]('widgetAttributes:\x20%s',JSON[_0x250e('0x77')](_0x207199));return[];}}exports[_0x250e('0x78')]=function(_0x710a8d,_0x15cac4,_0x596800){if(_0x710a8d[_0x250e('0x47')]['id']){delete _0x710a8d[_0x250e('0x47')]['id'];}return db[_0x250e('0x2d')][_0x250e('0x45')]({'where':{'id':_0x710a8d[_0x250e('0x50')]['id']}})[_0x250e('0x26')](handleEntityNotFound(_0x15cac4,null))[_0x250e('0x26')](function(_0x59e6a9){if(_0x59e6a9){_0x710a8d[_0x250e('0x47')][_0x250e('0x79')]=_0x59e6a9['id'];_0x710a8d[_0x250e('0x47')][_0x250e('0x59')]=widgetAttributes(_0x710a8d['body']);return db[_0x250e('0x7a')][_0x250e('0x46')](_0x710a8d[_0x250e('0x47')]);}})['then'](respondWithResult(_0x15cac4,null))['catch'](handleError(_0x15cac4,null));};exports[_0x250e('0x7b')]=function(_0x201759,_0x2078cf,_0x68a91e){var _0x5cb97d={};var _0x7e8f5={};var _0x120f60;var _0x419755;return db[_0x250e('0x2d')][_0x250e('0x7c')]({'where':{'id':_0x201759[_0x250e('0x50')]['id']}})['then'](handleEntityNotFound(_0x2078cf,null))[_0x250e('0x26')](function(_0x534e34){if(_0x534e34){_0x120f60=_0x534e34;_0x7e8f5['model']=_[_0x250e('0x44')](db[_0x250e('0x7a')][_0x250e('0x2e')]);_0x7e8f5['query']=_[_0x250e('0x44')](_0x201759[_0x250e('0x32')]);_0x7e8f5[_0x250e('0x33')]=_[_0x250e('0x34')](_0x7e8f5['model'],_0x7e8f5[_0x250e('0x32')]);_0x5cb97d[_0x250e('0x35')]=_[_0x250e('0x34')](_0x7e8f5[_0x250e('0x31')],qs[_0x250e('0x36')](_0x201759[_0x250e('0x32')][_0x250e('0x36')]));_0x5cb97d[_0x250e('0x35')]=_0x5cb97d['attributes'][_0x250e('0x37')]?_0x5cb97d[_0x250e('0x35')]:_0x7e8f5[_0x250e('0x31')];_0x5cb97d[_0x250e('0x7d')]=qs[_0x250e('0x3a')](_0x201759['query'][_0x250e('0x3a')]);_0x5cb97d['where']=qs['filters'](_['pick'](_0x201759[_0x250e('0x32')],_0x7e8f5['filters']));if(_0x201759['query'][_0x250e('0x3c')]){_0x5cb97d['where']=_['merge'](_0x5cb97d['where'],{'$or':_[_0x250e('0x2c')](_0x5cb97d[_0x250e('0x35')],function(_0x5dd006){var _0x1412ad={};_0x1412ad[_0x5dd006]={'$like':'%'+_0x201759[_0x250e('0x32')][_0x250e('0x3c')]+'%'};return _0x1412ad;})});}_0x5cb97d=_[_0x250e('0x3d')]({},_0x5cb97d,_0x201759[_0x250e('0x3f')]);return _0x120f60['getItems'](_0x5cb97d);}})[_0x250e('0x26')](function(_0x1b4118){if(_0x1b4118){_0x419755=_0x1b4118[_0x250e('0x37')];if(!_0x201759[_0x250e('0x32')]['hasOwnProperty'](_0x250e('0x39'))){_0x5cb97d[_0x250e('0x20')]=qs[_0x250e('0x20')](_0x201759[_0x250e('0x32')]['limit']);_0x5cb97d[_0x250e('0x1e')]=qs['offset'](_0x201759[_0x250e('0x32')][_0x250e('0x1e')]);}return _0x120f60['getItems'](_0x5cb97d);}})['then'](function(_0x4ab22e){if(_0x4ab22e){return _0x4ab22e?{'count':_0x419755,'rows':_0x4ab22e}:null;}})[_0x250e('0x26')](respondWithResult(_0x2078cf,null))['catch'](handleError(_0x2078cf,null));}; \ No newline at end of file +var _0x8d4d=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','get','CustomDashboards','UserProfileResource','end','error','name','index','map','Dashboard','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','body','user','destroy','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrVoiceQueues','attrFaxAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','getItems','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xaabde0,_0xe37c00){var _0x321a26=function(_0x50dd46){while(--_0x50dd46){_0xaabde0['push'](_0xaabde0['shift']());}};_0x321a26(++_0xe37c00);}(_0x8d4d,0x100));var _0xd8d4=function(_0x49af23,_0x37a69f){_0x49af23=_0x49af23-0x0;var _0x3f2489=_0x8d4d[_0x49af23];return _0x3f2489;};'use strict';var emlformat=require(_0xd8d4('0x0'));var rimraf=require(_0xd8d4('0x1'));var zipdir=require(_0xd8d4('0x2'));var jsonpatch=require(_0xd8d4('0x3'));var rp=require(_0xd8d4('0x4'));var moment=require(_0xd8d4('0x5'));var BPromise=require(_0xd8d4('0x6'));var Mustache=require(_0xd8d4('0x7'));var util=require(_0xd8d4('0x8'));var path=require(_0xd8d4('0x9'));var sox=require(_0xd8d4('0xa'));var csv=require(_0xd8d4('0xb'));var ejs=require(_0xd8d4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8d4('0xd'));var squel=require(_0xd8d4('0xe'));var crypto=require(_0xd8d4('0xf'));var jsforce=require(_0xd8d4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd8d4('0xb'));var querystring=require(_0xd8d4('0x11'));var Papa=require(_0xd8d4('0x12'));var Redis=require(_0xd8d4('0x13'));var authService=require(_0xd8d4('0x14'));var qs=require(_0xd8d4('0x15'));var as=require(_0xd8d4('0x16'));var hardwareService=require(_0xd8d4('0x17'));var logger=require(_0xd8d4('0x18'))(_0xd8d4('0x19'));var utils=require(_0xd8d4('0x1a'));var config=require(_0xd8d4('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8d4('0x1c'))['db'];config[_0xd8d4('0x1d')]=_[_0xd8d4('0x1e')](config['redis'],{'host':_0xd8d4('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8d4('0x1d')]));require(_0xd8d4('0x20'))['register'](socket);function respondWithStatusCode(_0xcf7b6e,_0x18c18b){_0x18c18b=_0x18c18b||0xcc;return function(_0x187e3a){if(_0x187e3a){return _0xcf7b6e[_0xd8d4('0x21')](_0x18c18b);}return _0xcf7b6e[_0xd8d4('0x22')](_0x18c18b)['end']();};}function respondWithResult(_0xb20469,_0x1aed4a){_0x1aed4a=_0x1aed4a||0xc8;return function(_0x4da63f){if(_0x4da63f){return _0xb20469['status'](_0x1aed4a)[_0xd8d4('0x23')](_0x4da63f);}};}function respondWithFilteredResult(_0x48b450,_0x5d264f){return function(_0x484c2e){if(_0x484c2e){var _0x5b761b=typeof _0x5d264f['offset']===_0xd8d4('0x24')&&typeof _0x5d264f[_0xd8d4('0x25')]===_0xd8d4('0x24');var _0x319a49=_0x484c2e['count'];var _0x2aa8ee=_0x5b761b?0x0:_0x5d264f[_0xd8d4('0x26')];var _0x242ceb=_0x5b761b?_0x484c2e[_0xd8d4('0x27')]:_0x5d264f[_0xd8d4('0x26')]+_0x5d264f[_0xd8d4('0x25')];var _0x38a7f7;if(_0x242ceb>=_0x319a49){_0x242ceb=_0x319a49;_0x38a7f7=0xc8;}else{_0x38a7f7=0xce;}_0x48b450[_0xd8d4('0x22')](_0x38a7f7);return _0x48b450[_0xd8d4('0x28')](_0xd8d4('0x29'),_0x2aa8ee+'-'+_0x242ceb+'/'+_0x319a49)[_0xd8d4('0x23')](_0x484c2e);}return null;};}function patchUpdates(_0x26cca2){return function(_0x4fcd4e){try{jsonpatch['apply'](_0x4fcd4e,_0x26cca2,!![]);}catch(_0x5340b1){return BPromise[_0xd8d4('0x2a')](_0x5340b1);}return _0x4fcd4e[_0xd8d4('0x2b')]();};}function saveUpdates(_0x49efc7,_0x226a46){return function(_0x2f8554){if(_0x2f8554){return _0x2f8554[_0xd8d4('0x2c')](_0x49efc7)[_0xd8d4('0x2d')](function(_0x4ac22b){return _0x4ac22b;});}return null;};}function removeEntity(_0xe6a3eb,_0x1db8a7){return function(_0x3f1435){if(_0x3f1435){return _0x3f1435['destroy']()[_0xd8d4('0x2d')](function(){var _0x3cd517=_0x3f1435[_0xd8d4('0x2e')]({'plain':!![]});var _0xd12b53=_0xd8d4('0x2f');return db[_0xd8d4('0x30')]['destroy']({'where':{'type':_0xd12b53,'resourceId':_0x3cd517['id']}})[_0xd8d4('0x2d')](function(){return _0x3f1435;});})[_0xd8d4('0x2d')](function(){_0xe6a3eb[_0xd8d4('0x22')](0xcc)[_0xd8d4('0x31')]();});}};}function handleEntityNotFound(_0x33799b,_0x2811d4){return function(_0x1bd5b3){if(!_0x1bd5b3){_0x33799b['sendStatus'](0x194);}return _0x1bd5b3;};}function handleError(_0x408ec3,_0x4de24c){_0x4de24c=_0x4de24c||0x1f4;return function(_0x1ca018){logger[_0xd8d4('0x32')](_0x1ca018['stack']);if(_0x1ca018[_0xd8d4('0x33')]){delete _0x1ca018[_0xd8d4('0x33')];}_0x408ec3[_0xd8d4('0x22')](_0x4de24c)['send'](_0x1ca018);};}exports[_0xd8d4('0x34')]=function(_0x55e877,_0x194f3a){var _0x4aa217={},_0x329b4f={},_0x430c2c={'count':0x0,'rows':[]};var _0x273f14=_[_0xd8d4('0x35')](db[_0xd8d4('0x36')][_0xd8d4('0x37')],function(_0x52a583){return{'name':_0x52a583[_0xd8d4('0x38')],'type':_0x52a583[_0xd8d4('0x39')]['key']};});_0x329b4f['model']=_[_0xd8d4('0x35')](_0x273f14,_0xd8d4('0x33'));_0x329b4f[_0xd8d4('0x3a')]=_['keys'](_0x55e877[_0xd8d4('0x3a')]);_0x329b4f[_0xd8d4('0x3b')]=_['intersection'](_0x329b4f['model'],_0x329b4f[_0xd8d4('0x3a')]);_0x4aa217['attributes']=_[_0xd8d4('0x3c')](_0x329b4f[_0xd8d4('0x3d')],qs['fields'](_0x55e877['query'][_0xd8d4('0x3e')]));_0x4aa217[_0xd8d4('0x3f')]=_0x4aa217['attributes']['length']?_0x4aa217[_0xd8d4('0x3f')]:_0x329b4f['model'];if(!_0x55e877['query']['hasOwnProperty']('nolimit')){_0x4aa217[_0xd8d4('0x25')]=qs[_0xd8d4('0x25')](_0x55e877[_0xd8d4('0x3a')][_0xd8d4('0x25')]);_0x4aa217['offset']=qs['offset'](_0x55e877[_0xd8d4('0x3a')][_0xd8d4('0x26')]);}_0x4aa217[_0xd8d4('0x40')]=qs['sort'](_0x55e877[_0xd8d4('0x3a')][_0xd8d4('0x41')]);_0x4aa217[_0xd8d4('0x42')]=qs[_0xd8d4('0x3b')](_['pick'](_0x55e877[_0xd8d4('0x3a')],_0x329b4f[_0xd8d4('0x3b')]),_0x273f14);if(_0x55e877[_0xd8d4('0x3a')]['filter']){_0x4aa217[_0xd8d4('0x42')]=_[_0xd8d4('0x43')](_0x4aa217[_0xd8d4('0x42')],{'$or':_[_0xd8d4('0x35')](_0x273f14,function(_0x581ce4){if(_0x581ce4[_0xd8d4('0x39')]!=='VIRTUAL'){var _0xf43a9c={};_0xf43a9c[_0x581ce4['name']]={'$like':'%'+_0x55e877['query'][_0xd8d4('0x44')]+'%'};return _0xf43a9c;}})});}_0x4aa217=_[_0xd8d4('0x43')]({},_0x4aa217,_0x55e877[_0xd8d4('0x45')]);var _0x288dc2={'where':_0x4aa217[_0xd8d4('0x42')]};return db['Dashboard'][_0xd8d4('0x27')](_0x288dc2)[_0xd8d4('0x2d')](function(_0x504b94){_0x430c2c[_0xd8d4('0x27')]=_0x504b94;if(_0x55e877[_0xd8d4('0x3a')][_0xd8d4('0x46')]){_0x4aa217[_0xd8d4('0x47')]=[{'all':!![]}];}return db[_0xd8d4('0x36')][_0xd8d4('0x48')](_0x4aa217);})[_0xd8d4('0x2d')](function(_0x2ac974){_0x430c2c[_0xd8d4('0x49')]=_0x2ac974;return _0x430c2c;})['then'](respondWithFilteredResult(_0x194f3a,_0x4aa217))[_0xd8d4('0x4a')](handleError(_0x194f3a,null));};exports[_0xd8d4('0x4b')]=function(_0x441ea0,_0x4023fa){var _0x2649f8={'raw':![],'where':{'id':_0x441ea0[_0xd8d4('0x4c')]['id']}},_0x3c11c2={};_0x3c11c2[_0xd8d4('0x3d')]=_['keys'](db[_0xd8d4('0x36')][_0xd8d4('0x37')]);_0x3c11c2[_0xd8d4('0x3a')]=_[_0xd8d4('0x4d')](_0x441ea0[_0xd8d4('0x3a')]);_0x3c11c2[_0xd8d4('0x3b')]=_[_0xd8d4('0x3c')](_0x3c11c2[_0xd8d4('0x3d')],_0x3c11c2[_0xd8d4('0x3a')]);_0x2649f8[_0xd8d4('0x3f')]=_['intersection'](_0x3c11c2[_0xd8d4('0x3d')],qs[_0xd8d4('0x3e')](_0x441ea0[_0xd8d4('0x3a')]['fields']));_0x2649f8[_0xd8d4('0x3f')]=_0x2649f8['attributes']['length']?_0x2649f8[_0xd8d4('0x3f')]:_0x3c11c2['model'];if(_0x441ea0['query'][_0xd8d4('0x46')]){_0x2649f8['include']=[{'all':!![]}];}_0x2649f8=_[_0xd8d4('0x43')]({},_0x2649f8,_0x441ea0[_0xd8d4('0x45')]);return db[_0xd8d4('0x36')][_0xd8d4('0x4e')](_0x2649f8)[_0xd8d4('0x2d')](handleEntityNotFound(_0x4023fa,null))[_0xd8d4('0x2d')](respondWithResult(_0x4023fa,null))[_0xd8d4('0x4a')](handleError(_0x4023fa,null));};exports[_0xd8d4('0x4f')]=function(_0x3217fe,_0x100ddf){return db['Dashboard'][_0xd8d4('0x4f')](_0x3217fe['body'],{})[_0xd8d4('0x2d')](function(_0x1d6768){var _0x11d0e1=_0x3217fe['user'][_0xd8d4('0x2e')]({'plain':!![]});if(!_0x11d0e1)throw new Error(_0xd8d4('0x50'));if(_0x11d0e1[_0xd8d4('0x51')]==='user'){var _0x548057=_0x1d6768[_0xd8d4('0x2e')]({'plain':!![]});var _0x51b2fc=_0xd8d4('0x2f');return db[_0xd8d4('0x52')][_0xd8d4('0x4e')]({'where':{'name':_0x51b2fc,'userProfileId':_0x11d0e1[_0xd8d4('0x53')]},'raw':!![]})[_0xd8d4('0x2d')](function(_0x554666){if(_0x554666&&_0x554666[_0xd8d4('0x54')]===0x0){return db[_0xd8d4('0x30')][_0xd8d4('0x4f')]({'name':_0x548057[_0xd8d4('0x33')],'resourceId':_0x548057['id'],'type':_0x554666['name'],'sectionId':_0x554666['id']},{})['then'](function(){return _0x1d6768;});}else{return _0x1d6768;}})[_0xd8d4('0x4a')](function(_0xf51c3b){logger[_0xd8d4('0x32')](_0xd8d4('0x55'),_0xf51c3b);throw _0xf51c3b;});}return _0x1d6768;})[_0xd8d4('0x2d')](respondWithResult(_0x100ddf,0xc9))[_0xd8d4('0x4a')](handleError(_0x100ddf,null));};exports['clone']=function(_0x3245ba,_0x1f57e1){var _0x43fe9c={'where':{'id':_0x3245ba[_0xd8d4('0x4c')]['id']}},_0x493993={};_0x493993[_0xd8d4('0x3d')]=_[_0xd8d4('0x4d')](db[_0xd8d4('0x36')][_0xd8d4('0x37')]);_0x43fe9c[_0xd8d4('0x3f')]=_[_0xd8d4('0x3c')](_0x493993[_0xd8d4('0x3d')],qs['fields'](_0x3245ba['query']['fields']));_0x43fe9c[_0xd8d4('0x3f')]=_0x43fe9c[_0xd8d4('0x3f')][_0xd8d4('0x56')]?_0x43fe9c['attributes']:_0x493993[_0xd8d4('0x3d')];if(_0x3245ba[_0xd8d4('0x3a')]['includeAll']){_0x43fe9c[_0xd8d4('0x47')]=[{'all':!![]}];}_0x43fe9c=_[_0xd8d4('0x43')]({},_0x43fe9c,_0x3245ba['options']);return db[_0xd8d4('0x36')]['find'](_0x43fe9c)['then'](handleEntityNotFound(_0x1f57e1,null))[_0xd8d4('0x2d')](function(_0x460724){if(_0x460724){var _0x115493=_0x460724[_0xd8d4('0x2e')]({'plain':!![]});_0x115493=qs[_0xd8d4('0x57')](_0x115493,['id',_0xd8d4('0x58'),_0xd8d4('0x59')]);_0x3245ba[_0xd8d4('0x5a')]=_[_0xd8d4('0x57')](_0x3245ba['body'],['id','createdAt',_0xd8d4('0x59')]);return db[_0xd8d4('0x36')][_0xd8d4('0x4f')](_['merge'](_0x115493,_0x3245ba['body']),{'include':_0x3245ba[_0xd8d4('0x3a')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x230991){var _0x1a3ada=_0x3245ba[_0xd8d4('0x5b')][_0xd8d4('0x2e')]({'plain':!![]});if(!_0x1a3ada)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a3ada[_0xd8d4('0x51')]===_0xd8d4('0x5b')){var _0xc2a45a=_0x230991[_0xd8d4('0x2e')]({'plain':!![]});var _0x460b72=_0xd8d4('0x2f');return db['UserProfileSection'][_0xd8d4('0x4e')]({'where':{'name':_0x460b72,'userProfileId':_0x1a3ada[_0xd8d4('0x53')]},'raw':!![]})['then'](function(_0x403c65){if(_0x403c65&&_0x403c65[_0xd8d4('0x54')]===0x0){return db[_0xd8d4('0x30')][_0xd8d4('0x4f')]({'name':_0xc2a45a[_0xd8d4('0x33')],'resourceId':_0xc2a45a['id'],'type':_0x403c65[_0xd8d4('0x33')],'sectionId':_0x403c65['id']},{})[_0xd8d4('0x2d')](function(){return _0x230991;});}else{return _0x230991;}})[_0xd8d4('0x4a')](function(_0x36a221){logger[_0xd8d4('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36a221);throw _0x36a221;});}return _0x230991;});}})[_0xd8d4('0x2d')](respondWithResult(_0x1f57e1,0xc9))[_0xd8d4('0x4a')](handleError(_0x1f57e1,null));};exports[_0xd8d4('0x2c')]=function(_0x21a5d6,_0x1ba274){if(_0x21a5d6[_0xd8d4('0x5a')]['id']){delete _0x21a5d6[_0xd8d4('0x5a')]['id'];}return db[_0xd8d4('0x36')][_0xd8d4('0x4e')]({'where':{'id':_0x21a5d6[_0xd8d4('0x4c')]['id']}})[_0xd8d4('0x2d')](handleEntityNotFound(_0x1ba274,null))[_0xd8d4('0x2d')](saveUpdates(_0x21a5d6[_0xd8d4('0x5a')],null))[_0xd8d4('0x2d')](respondWithResult(_0x1ba274,null))[_0xd8d4('0x4a')](handleError(_0x1ba274,null));};exports[_0xd8d4('0x5c')]=function(_0x579759,_0x55d14b){return db[_0xd8d4('0x36')][_0xd8d4('0x4e')]({'where':{'id':_0x579759[_0xd8d4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x55d14b,null))[_0xd8d4('0x2d')](removeEntity(_0x55d14b,null))['catch'](handleError(_0x55d14b,null));};function widgetAttributes(_0x36d89c){try{switch(_0x36d89c[_0xd8d4('0x39')]){case'iframe':return[{'name':_0xd8d4('0x5d'),'value':_0x36d89c['attrUrl']||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c['attrs'][0x0]?_0x36d89c[_0xd8d4('0x5e')][0x0][_0xd8d4('0x5f')]:undefined)||_0xd8d4('0x60')}];case'custom':return[{'name':_0xd8d4('0x61'),'value':_0x36d89c[_0xd8d4('0x61')]||(_0x36d89c['attrs']&&_0x36d89c['attrs'][0x0]?_0x36d89c[_0xd8d4('0x5e')][0x0][_0xd8d4('0x5f')]:undefined)||''}];case _0xd8d4('0x62'):return[{'name':_0xd8d4('0x63'),'value':_0x36d89c['attrHourFormat']||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c['attrs'][0x0]?_0x36d89c[_0xd8d4('0x5e')][0x0][_0xd8d4('0x5f')]:undefined)||_0xd8d4('0x64')},{'name':_0xd8d4('0x65'),'value':_0x36d89c[_0xd8d4('0x65')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x1]?_0x36d89c['attrs'][0x1][_0xd8d4('0x5f')]:undefined)||_0xd8d4('0x66')},{'name':_0xd8d4('0x67'),'value':_0x36d89c[_0xd8d4('0x67')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x2]?_0x36d89c[_0xd8d4('0x5e')][0x2][_0xd8d4('0x5f')]:undefined)||0xc}];case _0xd8d4('0x68'):return[{'name':_0xd8d4('0x69'),'value':_0x36d89c[_0xd8d4('0x69')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c['attrs'][0x0]?_0x36d89c[_0xd8d4('0x5e')][0x0][_0xd8d4('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x36d89c['attrVoiceQueues']||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c['attrs'][0x1]?_0x36d89c['attrs'][0x1]['value']:undefined)||[]},{'name':_0xd8d4('0x67'),'value':_0x36d89c[_0xd8d4('0x67')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x2]?_0x36d89c['attrs'][0x2]['value']:undefined)||0x14},{'name':_0xd8d4('0x6a'),'value':_0x36d89c[_0xd8d4('0x6a')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x3]?_0x36d89c[_0xd8d4('0x5e')][0x3][_0xd8d4('0x5f')]:undefined)||_0xd8d4('0x6b')},{'name':'attrEmailAccounts','value':_0x36d89c[_0xd8d4('0x6c')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x4]?_0x36d89c[_0xd8d4('0x5e')][0x4][_0xd8d4('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x36d89c['attrFaxAccounts']||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c['attrs'][0x5]?_0x36d89c[_0xd8d4('0x5e')][0x5][_0xd8d4('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x36d89c[_0xd8d4('0x6d')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x6]?_0x36d89c[_0xd8d4('0x5e')][0x6][_0xd8d4('0x5f')]:undefined)||''},{'name':_0xd8d4('0x6e'),'value':_0x36d89c[_0xd8d4('0x6e')]||(_0x36d89c['attrs']&&_0x36d89c[_0xd8d4('0x5e')][0x7]?_0x36d89c[_0xd8d4('0x5e')][0x7][_0xd8d4('0x5f')]:undefined)||''},{'name':_0xd8d4('0x6f'),'value':_0x36d89c['attrWhatsappAccounts']||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x8]?_0x36d89c[_0xd8d4('0x5e')][0x8]['value']:undefined)||''},{'name':_0xd8d4('0x70'),'value':_0x36d89c[_0xd8d4('0x70')]||(_0x36d89c['attrs']&&_0x36d89c[_0xd8d4('0x5e')][0x9]?_0x36d89c[_0xd8d4('0x5e')][0x9][_0xd8d4('0x5f')]:undefined)||''}];case _0xd8d4('0x71'):case'pie-chart':return[{'name':_0xd8d4('0x72'),'value':_0x36d89c[_0xd8d4('0x72')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x0]?_0x36d89c[_0xd8d4('0x5e')][0x0]['value']:undefined)||_0xd8d4('0x73')},{'name':_0xd8d4('0x74'),'value':_0x36d89c[_0xd8d4('0x74')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x1]?_0x36d89c['attrs'][0x1]['value']:undefined)||null},{'name':_0xd8d4('0x75'),'value':_0x36d89c[_0xd8d4('0x75')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x2]?_0x36d89c[_0xd8d4('0x5e')][0x2][_0xd8d4('0x5f')]:undefined)||null},{'name':_0xd8d4('0x76'),'value':_0x36d89c[_0xd8d4('0x76')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x3]?_0x36d89c[_0xd8d4('0x5e')][0x3][_0xd8d4('0x5f')]:undefined)||[]},{'name':_0xd8d4('0x6a'),'value':_0x36d89c[_0xd8d4('0x6a')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x4]?_0x36d89c['attrs'][0x4][_0xd8d4('0x5f')]:undefined)||'voice'},{'name':_0xd8d4('0x6c'),'value':_0x36d89c[_0xd8d4('0x6c')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x5]?_0x36d89c[_0xd8d4('0x5e')][0x5][_0xd8d4('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x36d89c[_0xd8d4('0x77')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x6]?_0x36d89c['attrs'][0x6][_0xd8d4('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x36d89c[_0xd8d4('0x6d')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x7]?_0x36d89c[_0xd8d4('0x5e')][0x7][_0xd8d4('0x5f')]:undefined)||''},{'name':_0xd8d4('0x6e'),'value':_0x36d89c[_0xd8d4('0x6e')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c['attrs'][0x8]?_0x36d89c[_0xd8d4('0x5e')][0x8][_0xd8d4('0x5f')]:undefined)||''},{'name':_0xd8d4('0x6f'),'value':_0x36d89c[_0xd8d4('0x6f')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x9]?_0x36d89c[_0xd8d4('0x5e')][0x9][_0xd8d4('0x5f')]:undefined)||''},{'name':_0xd8d4('0x70'),'value':_0x36d89c[_0xd8d4('0x70')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0xa]?_0x36d89c['attrs'][0xa][_0xd8d4('0x5f')]:undefined)||''}];case _0xd8d4('0x78'):return[{'name':_0xd8d4('0x79'),'type':_0x36d89c[_0xd8d4('0x7a')]||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c['attrs'][0x0]?_0x36d89c[_0xd8d4('0x5e')][0x0][_0xd8d4('0x39')]:undefined)||null,'value':_0x36d89c[_0xd8d4('0x79')]||(_0x36d89c['attrs']&&_0x36d89c[_0xd8d4('0x5e')][0x0]?_0x36d89c[_0xd8d4('0x5e')][0x0][_0xd8d4('0x5f')]:undefined)||null},{'name':_0xd8d4('0x7b'),'value':_0x36d89c['attrRefresh']||(_0x36d89c[_0xd8d4('0x5e')]&&_0x36d89c[_0xd8d4('0x5e')][0x1]?_0x36d89c[_0xd8d4('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x56f6cb){logger[_0xd8d4('0x32')](_0xd8d4('0x7c'),JSON[_0xd8d4('0x7d')](_0x56f6cb));return[];}}exports[_0xd8d4('0x7e')]=function(_0x2b548e,_0x5539fc,_0x4231ee){if(_0x2b548e['body']['id']){delete _0x2b548e[_0xd8d4('0x5a')]['id'];}return db[_0xd8d4('0x36')]['find']({'where':{'id':_0x2b548e[_0xd8d4('0x4c')]['id']}})[_0xd8d4('0x2d')](handleEntityNotFound(_0x5539fc,null))[_0xd8d4('0x2d')](function(_0x2d9a15){if(_0x2d9a15){_0x2b548e['body'][_0xd8d4('0x7f')]=_0x2d9a15['id'];_0x2b548e[_0xd8d4('0x5a')]['attrs']=widgetAttributes(_0x2b548e[_0xd8d4('0x5a')]);return db[_0xd8d4('0x80')][_0xd8d4('0x4f')](_0x2b548e[_0xd8d4('0x5a')]);}})[_0xd8d4('0x2d')](respondWithResult(_0x5539fc,null))['catch'](handleError(_0x5539fc,null));};exports['getItems']=function(_0x9e43ca,_0x1525bc,_0x5a98eb){var _0x431a15={};var _0x741917={};var _0x499be1;var _0x37251c;return db[_0xd8d4('0x36')][_0xd8d4('0x81')]({'where':{'id':_0x9e43ca['params']['id']}})[_0xd8d4('0x2d')](handleEntityNotFound(_0x1525bc,null))[_0xd8d4('0x2d')](function(_0x2c7482){if(_0x2c7482){_0x499be1=_0x2c7482;_0x741917[_0xd8d4('0x3d')]=_[_0xd8d4('0x4d')](db[_0xd8d4('0x80')][_0xd8d4('0x37')]);_0x741917['query']=_[_0xd8d4('0x4d')](_0x9e43ca[_0xd8d4('0x3a')]);_0x741917[_0xd8d4('0x3b')]=_[_0xd8d4('0x3c')](_0x741917['model'],_0x741917[_0xd8d4('0x3a')]);_0x431a15[_0xd8d4('0x3f')]=_[_0xd8d4('0x3c')](_0x741917['model'],qs[_0xd8d4('0x3e')](_0x9e43ca[_0xd8d4('0x3a')][_0xd8d4('0x3e')]));_0x431a15[_0xd8d4('0x3f')]=_0x431a15[_0xd8d4('0x3f')]['length']?_0x431a15[_0xd8d4('0x3f')]:_0x741917[_0xd8d4('0x3d')];_0x431a15[_0xd8d4('0x40')]=qs[_0xd8d4('0x41')](_0x9e43ca[_0xd8d4('0x3a')]['sort']);_0x431a15[_0xd8d4('0x42')]=qs['filters'](_['pick'](_0x9e43ca[_0xd8d4('0x3a')],_0x741917[_0xd8d4('0x3b')]));if(_0x9e43ca[_0xd8d4('0x3a')][_0xd8d4('0x44')]){_0x431a15[_0xd8d4('0x42')]=_[_0xd8d4('0x43')](_0x431a15[_0xd8d4('0x42')],{'$or':_[_0xd8d4('0x35')](_0x431a15[_0xd8d4('0x3f')],function(_0x453a24){var _0x28072f={};_0x28072f[_0x453a24]={'$like':'%'+_0x9e43ca[_0xd8d4('0x3a')]['filter']+'%'};return _0x28072f;})});}_0x431a15=_[_0xd8d4('0x43')]({},_0x431a15,_0x9e43ca['options']);return _0x499be1[_0xd8d4('0x82')](_0x431a15);}})[_0xd8d4('0x2d')](function(_0x2eece2){if(_0x2eece2){_0x37251c=_0x2eece2[_0xd8d4('0x56')];if(!_0x9e43ca[_0xd8d4('0x3a')]['hasOwnProperty'](_0xd8d4('0x83'))){_0x431a15['limit']=qs[_0xd8d4('0x25')](_0x9e43ca[_0xd8d4('0x3a')]['limit']);_0x431a15['offset']=qs[_0xd8d4('0x26')](_0x9e43ca[_0xd8d4('0x3a')][_0xd8d4('0x26')]);}return _0x499be1[_0xd8d4('0x82')](_0x431a15);}})[_0xd8d4('0x2d')](function(_0x5943cd){if(_0x5943cd){return _0x5943cd?{'count':_0x37251c,'rows':_0x5943cd}:null;}})[_0xd8d4('0x2d')](respondWithResult(_0x1525bc,null))[_0xd8d4('0x4a')](handleError(_0x1525bc,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 40da1c9..57f3ca9 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 _0x757b=['remove','emit','hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','save'];(function(_0x1b7704,_0x8a83cb){var _0x465686=function(_0x158bf8){while(--_0x158bf8){_0x1b7704['push'](_0x1b7704['shift']());}};_0x465686(++_0x8a83cb);}(_0x757b,0x7a));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb757('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xb757('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb757('0x2')](0x0);var events={'afterCreate':_0xb757('0x3'),'afterUpdate':'update','afterDestroy':_0xb757('0x4')};function emitEvent(_0x53dac6){return function(_0x354937,_0x582d2f,_0x2b0c2f){DashboardEvents[_0xb757('0x5')](_0x53dac6+':'+_0x354937['id'],_0x354937);DashboardEvents[_0xb757('0x5')](_0x53dac6,_0x354937);_0x2b0c2f(null);};}for(var e in events){if(events[_0xb757('0x6')](e)){var event=events[e];Dashboard[_0xb757('0x7')](e,emitEvent(event));}}module[_0xb757('0x8')]=DashboardEvents; \ No newline at end of file +var _0x188f=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x6222aa,_0x201283){var _0xb22b95=function(_0x36fb0b){while(--_0x36fb0b){_0x6222aa['push'](_0x6222aa['shift']());}};_0xb22b95(++_0x201283);}(_0x188f,0x1a5));var _0xf188=function(_0x536c4e,_0x100c4c){_0x536c4e=_0x536c4e-0x0;var _0x3b1117=_0x188f[_0x536c4e];return _0x3b1117;};'use strict';var EventEmitter=require(_0xf188('0x0'));var Dashboard=require(_0xf188('0x1'))['db'][_0xf188('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf188('0x3')](0x0);var events={'afterCreate':_0xf188('0x4'),'afterUpdate':_0xf188('0x5'),'afterDestroy':_0xf188('0x6')};function emitEvent(_0x554df6){return function(_0x5637c6,_0x204680,_0x52b670){DashboardEvents['emit'](_0x554df6+':'+_0x5637c6['id'],_0x5637c6);DashboardEvents[_0xf188('0x7')](_0x554df6,_0x5637c6);_0x52b670(null);};}for(var e in events){if(events[_0xf188('0x8')](e)){var event=events[e];Dashboard[_0xf188('0x9')](e,emitEvent(event));}}module[_0xf188('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 3c2dde8..153b745 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 _0x48d8=['path','rimraf','./dashboard.attributes','define','Dashboard','lodash','util','api','bluebird','request-promise'];(function(_0x77f10b,_0x2474b2){var _0x58f223=function(_0x4ba61f){while(--_0x4ba61f){_0x77f10b['push'](_0x77f10b['shift']());}};_0x58f223(++_0x2474b2);}(_0x48d8,0x1e5));var _0x848d=function(_0x5951da,_0x361503){_0x5951da=_0x5951da-0x0;var _0x7727f=_0x48d8[_0x5951da];return _0x7727f;};'use strict';var _=require(_0x848d('0x0'));var util=require(_0x848d('0x1'));var logger=require('../../config/logger')(_0x848d('0x2'));var moment=require('moment');var BPromise=require(_0x848d('0x3'));var rp=require(_0x848d('0x4'));var fs=require('fs');var path=require(_0x848d('0x5'));var rimraf=require(_0x848d('0x6'));var config=require('../../config/environment');var attributes=require(_0x848d('0x7'));module['exports']=function(_0x297c13,_0x1dd2c9){return _0x297c13[_0x848d('0x8')](_0x848d('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb84e=['Dashboard','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x4636d2,_0x2d3ed5){var _0x1de008=function(_0x1ffe55){while(--_0x1ffe55){_0x4636d2['push'](_0x4636d2['shift']());}};_0x1de008(++_0x2d3ed5);}(_0xb84e,0xbf));var _0xeb84=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xb84e[_0x111e94];return _0x3de107;};'use strict';var _=require('lodash');var util=require(_0xeb84('0x0'));var logger=require(_0xeb84('0x1'))(_0xeb84('0x2'));var moment=require(_0xeb84('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb84('0x4'));var rimraf=require(_0xeb84('0x5'));var config=require(_0xeb84('0x6'));var attributes=require(_0xeb84('0x7'));module[_0xeb84('0x8')]=function(_0x3c25e2,_0x5f27c1){return _0x3c25e2['define'](_0xeb84('0x9'),attributes,{'tableName':'dashboards','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 fd09107..4292497 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 _0xf36c=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5eb84e,_0x59b323){var _0x3646e2=function(_0x30c827){while(--_0x30c827){_0x5eb84e['push'](_0x5eb84e['shift']());}};_0x3646e2(++_0x59b323);}(_0xf36c,0x1b6));var _0xcf36=function(_0x17d621,_0x1cc002){_0x17d621=_0x17d621-0x0;var _0x2ccdcd=_0xf36c[_0x17d621];return _0x2ccdcd;};'use strict';var _=require(_0xcf36('0x0'));var util=require(_0xcf36('0x1'));var moment=require(_0xcf36('0x2'));var BPromise=require(_0xcf36('0x3'));var rs=require(_0xcf36('0x4'));var fs=require('fs');var Redis=require(_0xcf36('0x5'));var db=require(_0xcf36('0x6'))['db'];var utils=require(_0xcf36('0x7'));var logger=require(_0xcf36('0x8'))(_0xcf36('0x9'));var config=require(_0xcf36('0xa'));var jayson=require(_0xcf36('0xb'));var client=jayson[_0xcf36('0xc')][_0xcf36('0xd')]({'port':0x232a});config[_0xcf36('0xe')]=_['defaults'](config['redis'],{'host':_0xcf36('0xf'),'port':0x18eb});var socket=require(_0xcf36('0x10'))(new Redis(config[_0xcf36('0xe')]));require(_0xcf36('0x11'))[_0xcf36('0x12')](socket);function respondWithRpcPromise(_0x5d6ca7,_0x4d2a48,_0x4c030d){return new BPromise(function(_0x2485f8,_0x9efe78){return client[_0xcf36('0x13')](_0x5d6ca7,_0x4c030d)[_0xcf36('0x14')](function(_0x27cafa){logger['info'](_0xcf36('0x15'),_0x4d2a48,_0xcf36('0x16'));logger[_0xcf36('0x17')](_0xcf36('0x18'),_0x4d2a48,_0xcf36('0x16'),JSON[_0xcf36('0x19')](_0x27cafa));if(_0x27cafa[_0xcf36('0x1a')]){if(_0x27cafa[_0xcf36('0x1a')][_0xcf36('0x1b')]===0x1f4){logger[_0xcf36('0x1a')](_0xcf36('0x15'),_0x4d2a48,_0x27cafa['error'][_0xcf36('0x1c')]);return _0x9efe78(_0x27cafa[_0xcf36('0x1a')][_0xcf36('0x1c')]);}logger[_0xcf36('0x1a')](_0xcf36('0x15'),_0x4d2a48,_0x27cafa[_0xcf36('0x1a')]['message']);return _0x2485f8(_0x27cafa['error'][_0xcf36('0x1c')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x4d2a48,'request\x20sent');_0x2485f8(_0x27cafa['result'][_0xcf36('0x1c')]);}})['catch'](function(_0x3e07b8){logger[_0xcf36('0x1a')](_0xcf36('0x15'),_0x4d2a48,_0x3e07b8);_0x9efe78(_0x3e07b8);});});} \ No newline at end of file +var _0x41a7=['socket.io-emitter','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x41a7,0xb0));var _0x741a=function(_0x45e87e,_0x283ffd){_0x45e87e=_0x45e87e-0x0;var _0x21fccf=_0x41a7[_0x45e87e];return _0x21fccf;};'use strict';var _=require(_0x741a('0x0'));var util=require('util');var moment=require(_0x741a('0x1'));var BPromise=require(_0x741a('0x2'));var rs=require(_0x741a('0x3'));var fs=require('fs');var Redis=require(_0x741a('0x4'));var db=require(_0x741a('0x5'))['db'];var utils=require(_0x741a('0x6'));var logger=require(_0x741a('0x7'))(_0x741a('0x8'));var config=require('../../config/environment');var jayson=require(_0x741a('0x9'));var client=jayson[_0x741a('0xa')][_0x741a('0xb')]({'port':0x232a});config[_0x741a('0xc')]=_['defaults'](config[_0x741a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x741a('0xd'))(new Redis(config['redis']));require('./dashboard.socket')[_0x741a('0xe')](socket);function respondWithRpcPromise(_0x4c964c,_0x4cc2d1,_0x376cad){return new BPromise(function(_0x227a4b,_0x466f19){return client[_0x741a('0xf')](_0x4c964c,_0x376cad)['then'](function(_0x3be0f4){logger[_0x741a('0x10')](_0x741a('0x11'),_0x4cc2d1,_0x741a('0x12'));logger[_0x741a('0x13')](_0x741a('0x14'),_0x4cc2d1,_0x741a('0x12'),JSON[_0x741a('0x15')](_0x3be0f4));if(_0x3be0f4['error']){if(_0x3be0f4[_0x741a('0x16')][_0x741a('0x17')]===0x1f4){logger[_0x741a('0x16')](_0x741a('0x11'),_0x4cc2d1,_0x3be0f4['error']['message']);return _0x466f19(_0x3be0f4[_0x741a('0x16')][_0x741a('0x18')]);}logger[_0x741a('0x16')]('Dashboard,\x20%s,\x20%s',_0x4cc2d1,_0x3be0f4[_0x741a('0x16')]['message']);return _0x227a4b(_0x3be0f4[_0x741a('0x16')][_0x741a('0x18')]);}else{logger[_0x741a('0x10')]('Dashboard,\x20%s,\x20%s',_0x4cc2d1,_0x741a('0x12'));_0x227a4b(_0x3be0f4[_0x741a('0x19')][_0x741a('0x18')]);}})[_0x741a('0x1a')](function(_0x4abcba){logger[_0x741a('0x16')](_0x741a('0x11'),_0x4cc2d1,_0x4abcba);_0x466f19(_0x4abcba);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 480343a..9909e75 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 _0xd55b=['remove','update','register','length','dashboard:'];(function(_0x48b90f,_0x5bb841){var _0x1ea472=function(_0x1bb163){while(--_0x1bb163){_0x48b90f['push'](_0x48b90f['shift']());}};_0x1ea472(++_0x5bb841);}(_0xd55b,0xe1));var _0xbd55=function(_0x1601c2,_0x5d4575){_0x1601c2=_0x1601c2-0x0;var _0x5980aa=_0xd55b[_0x1601c2];return _0x5980aa;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0xbd55('0x0'),_0xbd55('0x1')];function createListener(_0x349612,_0x5770c3){return function(_0x889482){_0x5770c3['emit'](_0x349612,_0x889482);};}function removeListener(_0x604e6a,_0x107a98){return function(){DashboardEvents['removeListener'](_0x604e6a,_0x107a98);};}exports[_0xbd55('0x2')]=function(_0x26d7aa){for(var _0x5c0cf0=0x0,_0x1187c0=events[_0xbd55('0x3')];_0x5c0cf0<_0x1187c0;_0x5c0cf0++){var _0xd26ec4=events[_0x5c0cf0];var _0x4b9fb8=createListener(_0xbd55('0x4')+_0xd26ec4,_0x26d7aa);DashboardEvents['on'](_0xd26ec4,_0x4b9fb8);}}; \ No newline at end of file +var _0xbe94=['register','./dashboard.events','save','remove'];(function(_0x388e36,_0x323b8c){var _0xf8f3c1=function(_0x137260){while(--_0x137260){_0x388e36['push'](_0x388e36['shift']());}};_0xf8f3c1(++_0x323b8c);}(_0xbe94,0x155));var _0x4be9=function(_0x63e59d,_0x1696a7){_0x63e59d=_0x63e59d-0x0;var _0x5f4893=_0xbe94[_0x63e59d];return _0x5f4893;};'use strict';var DashboardEvents=require(_0x4be9('0x0'));var events=[_0x4be9('0x1'),_0x4be9('0x2'),'update'];function createListener(_0x107211,_0x5aded8){return function(_0x38c549){_0x5aded8['emit'](_0x107211,_0x38c549);};}function removeListener(_0x36f31e,_0x3fa66a){return function(){DashboardEvents['removeListener'](_0x36f31e,_0x3fa66a);};}exports[_0x4be9('0x3')]=function(_0x2011e2){for(var _0x6c6944=0x0,_0x3806d4=events['length'];_0x6c6944<_0x3806d4;_0x6c6944++){var _0x243240=events[_0x6c6944];var _0x4d5a56=createListener('dashboard:'+_0x243240,_0x2011e2);DashboardEvents['on'](_0x243240,_0x4d5a56);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 73e3edd..2a81b5d 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 _0x2737=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','clone','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x2737,0x100));var _0x7273=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2737[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x7273('0x0'));var util=require(_0x7273('0x1'));var path=require(_0x7273('0x2'));var timeout=require(_0x7273('0x3'));var express=require(_0x7273('0x4'));var router=express[_0x7273('0x5')]();var fs_extra=require(_0x7273('0x6'));var auth=require(_0x7273('0x7'));var interaction=require(_0x7273('0x8'));var config=require(_0x7273('0x9'));var controller=require(_0x7273('0xa'));router[_0x7273('0xb')]('/',auth[_0x7273('0xc')](),controller[_0x7273('0xd')]);router[_0x7273('0xb')](_0x7273('0xe'),auth[_0x7273('0xc')](),controller[_0x7273('0xf')]);router['get'](_0x7273('0x10'),auth['isAuthenticated'](),controller['getItems']);router[_0x7273('0x11')]('/',auth[_0x7273('0xc')](),controller[_0x7273('0x12')]);router[_0x7273('0x11')]('/:id/clone',auth[_0x7273('0xc')](),controller[_0x7273('0x13')]);router[_0x7273('0x11')]('/:id/items',auth[_0x7273('0xc')](),controller[_0x7273('0x14')]);router[_0x7273('0x15')](_0x7273('0xe'),auth[_0x7273('0xc')](),controller[_0x7273('0x16')]);router[_0x7273('0x17')](_0x7273('0xe'),auth[_0x7273('0xc')](),controller[_0x7273('0x18')]);module[_0x7273('0x19')]=router; \ No newline at end of file +var _0x4d9f=['create','/:id/clone','clone','addItem','/:id','update','util','path','connect-timeout','express','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','show','getItems','post'];(function(_0x36dc5d,_0x5828f8){var _0x5b9fcd=function(_0x472f59){while(--_0x472f59){_0x36dc5d['push'](_0x36dc5d['shift']());}};_0x5b9fcd(++_0x5828f8);}(_0x4d9f,0x8e));var _0xf4d9=function(_0x54a006,_0x247502){_0x54a006=_0x54a006-0x0;var _0x10897f=_0x4d9f[_0x54a006];return _0x10897f;};'use strict';var multer=require('multer');var util=require(_0xf4d9('0x0'));var path=require(_0xf4d9('0x1'));var timeout=require(_0xf4d9('0x2'));var express=require(_0xf4d9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xf4d9('0x5'));router[_0xf4d9('0x6')]('/',auth[_0xf4d9('0x7')](),controller['index']);router[_0xf4d9('0x6')]('/:id',auth[_0xf4d9('0x7')](),controller[_0xf4d9('0x8')]);router[_0xf4d9('0x6')]('/:id/items',auth[_0xf4d9('0x7')](),controller[_0xf4d9('0x9')]);router[_0xf4d9('0xa')]('/',auth[_0xf4d9('0x7')](),controller[_0xf4d9('0xb')]);router['post'](_0xf4d9('0xc'),auth[_0xf4d9('0x7')](),controller[_0xf4d9('0xd')]);router[_0xf4d9('0xa')]('/:id/items',auth[_0xf4d9('0x7')](),controller[_0xf4d9('0xe')]);router['put'](_0xf4d9('0xf'),auth[_0xf4d9('0x7')](),controller[_0xf4d9('0x10')]);router['delete']('/:id',auth[_0xf4d9('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 85780ed..15ffc10 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 _0xf61e=['TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x38875e,_0x1e3d0e){var _0xec6dc2=function(_0x31c168){while(--_0x31c168){_0x38875e['push'](_0x38875e['shift']());}};_0xec6dc2(++_0x1e3d0e);}(_0xf61e,0x191));var _0xef61=function(_0xb95aa9,_0x556cae){_0xb95aa9=_0xb95aa9-0x0;var _0x487239=_0xf61e[_0xb95aa9];return _0x487239;};'use strict';var Sequelize=require(_0xef61('0x0'));var squel=require(_0xef61('0x1'));var _=require(_0xef61('0x2'));module[_0xef61('0x3')]={'title':{'type':Sequelize[_0xef61('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xef61('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xef61('0x5')](_0xef61('0x6')),'get':function(){try{return JSON[_0xef61('0x7')](this[_0xef61('0x8')](_0xef61('0x9')));}catch(_0x45a18d){return[];}},'set':function(_0x5b00b2){try{this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify'](_0x5b00b2));}catch(_0x2242a7){this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xef61('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xef61('0xb')]},'col':{'type':Sequelize[_0xef61('0xb')]},'background':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xef61('0x4')]},'titleFontSize':{'type':Sequelize[_0xef61('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x5859d3,_0x26b667){var _0x1698f0=function(_0x15bce2){while(--_0x15bce2){_0x5859d3['push'](_0x5859d3['shift']());}};_0x1698f0(++_0x26b667);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2b90ef,_0x180832){_0x2b90ef=_0x2b90ef-0x0;var _0x2c7893=_0xc1c6[_0x2b90ef];return _0x2c7893;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index f11a837..cbce0bc 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 _0x93bb=['attrReport','reportType','attrRefresh','error','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','stack','name','send','show','model','keys','DashboardItem','query','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','params','type','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report'];(function(_0x2e937e,_0x925b29){var _0xb9cb1b=function(_0x3fea3a){while(--_0x3fea3a){_0x2e937e['push'](_0x2e937e['shift']());}};_0xb9cb1b(++_0x925b29);}(_0x93bb,0x135));var _0xb93b=function(_0x2aa25f,_0x2c9b27){_0x2aa25f=_0x2aa25f-0x0;var _0x36aedf=_0x93bb[_0x2aa25f];return _0x36aedf;};'use strict';var emlformat=require(_0xb93b('0x0'));var rimraf=require(_0xb93b('0x1'));var zipdir=require(_0xb93b('0x2'));var jsonpatch=require(_0xb93b('0x3'));var rp=require(_0xb93b('0x4'));var moment=require(_0xb93b('0x5'));var BPromise=require(_0xb93b('0x6'));var Mustache=require(_0xb93b('0x7'));var util=require(_0xb93b('0x8'));var path=require(_0xb93b('0x9'));var sox=require('sox');var csv=require(_0xb93b('0xa'));var ejs=require(_0xb93b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb93b('0xc'));var squel=require(_0xb93b('0xd'));var crypto=require('crypto');var jsforce=require(_0xb93b('0xe'));var deskjs=require(_0xb93b('0xf'));var toCsv=require(_0xb93b('0xa'));var querystring=require(_0xb93b('0x10'));var Papa=require(_0xb93b('0x11'));var Redis=require(_0xb93b('0x12'));var authService=require(_0xb93b('0x13'));var qs=require(_0xb93b('0x14'));var as=require(_0xb93b('0x15'));var hardwareService=require(_0xb93b('0x16'));var logger=require(_0xb93b('0x17'))('api');var utils=require(_0xb93b('0x18'));var config=require(_0xb93b('0x19'));var licenseUtil=require(_0xb93b('0x1a'));var db=require(_0xb93b('0x1b'))['db'];config['redis']=_[_0xb93b('0x1c')](config[_0xb93b('0x1d')],{'host':_0xb93b('0x1e'),'port':0x18eb});var socket=require(_0xb93b('0x1f'))(new Redis(config[_0xb93b('0x1d')]));require(_0xb93b('0x20'))[_0xb93b('0x21')](socket);function respondWithStatusCode(_0x58c73b,_0x1155ef){_0x1155ef=_0x1155ef||0xcc;return function(_0x435eae){if(_0x435eae){return _0x58c73b[_0xb93b('0x22')](_0x1155ef);}return _0x58c73b[_0xb93b('0x23')](_0x1155ef)[_0xb93b('0x24')]();};}function respondWithResult(_0x1debd0,_0x546585){_0x546585=_0x546585||0xc8;return function(_0x3cfc00){if(_0x3cfc00){return _0x1debd0['status'](_0x546585)[_0xb93b('0x25')](_0x3cfc00);}};}function respondWithFilteredResult(_0x1f4300,_0x17b680){return function(_0x11f85b){if(_0x11f85b){var _0x1a0eec=typeof _0x17b680[_0xb93b('0x26')]==='undefined'&&typeof _0x17b680[_0xb93b('0x27')]===_0xb93b('0x28');var _0x3567cf=_0x11f85b[_0xb93b('0x29')];var _0x1a70c7=_0x1a0eec?0x0:_0x17b680[_0xb93b('0x26')];var _0x58fd35=_0x1a0eec?_0x11f85b['count']:_0x17b680['offset']+_0x17b680['limit'];var _0x1add64;if(_0x58fd35>=_0x3567cf){_0x58fd35=_0x3567cf;_0x1add64=0xc8;}else{_0x1add64=0xce;}_0x1f4300['status'](_0x1add64);return _0x1f4300['set'](_0xb93b('0x2a'),_0x1a70c7+'-'+_0x58fd35+'/'+_0x3567cf)[_0xb93b('0x25')](_0x11f85b);}return null;};}function patchUpdates(_0x295c61){return function(_0x55427d){try{jsonpatch[_0xb93b('0x2b')](_0x55427d,_0x295c61,!![]);}catch(_0x31166b){return BPromise['reject'](_0x31166b);}return _0x55427d[_0xb93b('0x2c')]();};}function saveUpdates(_0x2c6505,_0x3c815a){return function(_0x2cb880){if(_0x2cb880){return _0x2cb880[_0xb93b('0x2d')](_0x2c6505)[_0xb93b('0x2e')](function(_0x4e4e16){return _0x4e4e16;});}return null;};}function removeEntity(_0x452483,_0x13d5ad){return function(_0x249b43){if(_0x249b43){return _0x249b43[_0xb93b('0x2f')]()['then'](function(){_0x452483[_0xb93b('0x23')](0xcc)[_0xb93b('0x24')]();});}};}function handleEntityNotFound(_0x167093,_0x41a0cd){return function(_0x339356){if(!_0x339356){_0x167093[_0xb93b('0x22')](0x194);}return _0x339356;};}function handleError(_0x40de1c,_0x4adf50){_0x4adf50=_0x4adf50||0x1f4;return function(_0xb79c23){logger['error'](_0xb79c23[_0xb93b('0x30')]);if(_0xb79c23[_0xb93b('0x31')]){delete _0xb79c23[_0xb93b('0x31')];}_0x40de1c[_0xb93b('0x23')](_0x4adf50)[_0xb93b('0x32')](_0xb79c23);};}exports[_0xb93b('0x33')]=function(_0xb2e875,_0x42ee85){var _0x3d4e3a={'raw':![],'where':{'id':_0xb2e875['params']['id']}},_0x4d8c79={};_0x4d8c79[_0xb93b('0x34')]=_[_0xb93b('0x35')](db[_0xb93b('0x36')]['rawAttributes']);_0x4d8c79['query']=_[_0xb93b('0x35')](_0xb2e875[_0xb93b('0x37')]);_0x4d8c79[_0xb93b('0x38')]=_['intersection'](_0x4d8c79['model'],_0x4d8c79[_0xb93b('0x37')]);_0x3d4e3a[_0xb93b('0x39')]=_[_0xb93b('0x3a')](_0x4d8c79[_0xb93b('0x34')],qs[_0xb93b('0x3b')](_0xb2e875[_0xb93b('0x37')][_0xb93b('0x3b')]));_0x3d4e3a['attributes']=_0x3d4e3a[_0xb93b('0x39')][_0xb93b('0x3c')]?_0x3d4e3a[_0xb93b('0x39')]:_0x4d8c79[_0xb93b('0x34')];if(_0xb2e875[_0xb93b('0x37')][_0xb93b('0x3d')]){_0x3d4e3a[_0xb93b('0x3e')]=[{'all':!![]}];}_0x3d4e3a=_['merge']({},_0x3d4e3a,_0xb2e875[_0xb93b('0x3f')]);return db[_0xb93b('0x36')][_0xb93b('0x40')](_0x3d4e3a)[_0xb93b('0x2e')](handleEntityNotFound(_0x42ee85,null))[_0xb93b('0x2e')](respondWithResult(_0x42ee85,null))[_0xb93b('0x41')](handleError(_0x42ee85,null));};exports[_0xb93b('0x2f')]=function(_0x4d08b6,_0xfbfbc5){return db[_0xb93b('0x36')][_0xb93b('0x40')]({'where':{'id':_0x4d08b6[_0xb93b('0x42')]['id']}})[_0xb93b('0x2e')](handleEntityNotFound(_0xfbfbc5,null))[_0xb93b('0x2e')](removeEntity(_0xfbfbc5,null))[_0xb93b('0x41')](handleError(_0xfbfbc5,null));};function widgetAttributes(_0x365564){try{switch(_0x365564[_0xb93b('0x43')]){case _0xb93b('0x44'):return[{'name':_0xb93b('0x45'),'value':_0x365564[_0xb93b('0x45')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x0]?_0x365564['attrs'][0x0][_0xb93b('0x47')]:undefined)||_0xb93b('0x48')}];case'custom':return[{'name':_0xb93b('0x49'),'value':_0x365564[_0xb93b('0x49')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x0]?_0x365564[_0xb93b('0x46')][0x0][_0xb93b('0x47')]:undefined)||''}];case'clock':return[{'name':_0xb93b('0x4a'),'value':_0x365564[_0xb93b('0x4a')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x0]?_0x365564['attrs'][0x0]['value']:undefined)||_0xb93b('0x4b')},{'name':_0xb93b('0x4c'),'value':_0x365564[_0xb93b('0x4c')]||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x1]?_0x365564[_0xb93b('0x46')][0x1]['value']:undefined)||_0xb93b('0x4d')},{'name':'attrFontSize','value':_0x365564[_0xb93b('0x4e')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x2]?_0x365564[_0xb93b('0x46')][0x2][_0xb93b('0x47')]:undefined)||0xc}];case _0xb93b('0x4f'):return[{'name':_0xb93b('0x50'),'value':_0x365564['attrMetric']||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x0]?_0x365564[_0xb93b('0x46')][0x0]['value']:undefined)||'total'},{'name':_0xb93b('0x51'),'value':_0x365564[_0xb93b('0x51')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x1]?_0x365564[_0xb93b('0x46')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x365564[_0xb93b('0x4e')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x2]?_0x365564['attrs'][0x2][_0xb93b('0x47')]:undefined)||0x14},{'name':_0xb93b('0x52'),'value':_0x365564['attrChannel']||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x3]?_0x365564[_0xb93b('0x46')][0x3][_0xb93b('0x47')]:undefined)||'voice'},{'name':_0xb93b('0x53'),'value':_0x365564[_0xb93b('0x53')]||(_0x365564['attrs']&&_0x365564[_0xb93b('0x46')][0x4]?_0x365564[_0xb93b('0x46')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x365564[_0xb93b('0x54')]||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x5]?_0x365564[_0xb93b('0x46')][0x5][_0xb93b('0x47')]:undefined)||''},{'name':_0xb93b('0x55'),'value':_0x365564[_0xb93b('0x55')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x6]?_0x365564['attrs'][0x6][_0xb93b('0x47')]:undefined)||''},{'name':_0xb93b('0x56'),'value':_0x365564['attrOpenchannelAccounts']||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x7]?_0x365564[_0xb93b('0x46')][0x7][_0xb93b('0x47')]:undefined)||''},{'name':_0xb93b('0x57'),'value':_0x365564[_0xb93b('0x57')]||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x8]?_0x365564['attrs'][0x8][_0xb93b('0x47')]:undefined)||''},{'name':_0xb93b('0x58'),'value':_0x365564[_0xb93b('0x58')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x9]?_0x365564[_0xb93b('0x46')][0x9][_0xb93b('0x47')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x365564[_0xb93b('0x59')]||(_0x365564['attrs']&&_0x365564['attrs'][0x0]?_0x365564['attrs'][0x0][_0xb93b('0x47')]:undefined)||_0xb93b('0x5a')},{'name':_0xb93b('0x5b'),'value':_0x365564[_0xb93b('0x5b')]||(_0x365564['attrs']&&_0x365564['attrs'][0x1]?_0x365564[_0xb93b('0x46')][0x1][_0xb93b('0x47')]:undefined)||null},{'name':_0xb93b('0x5c'),'value':_0x365564[_0xb93b('0x5c')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x2]?_0x365564['attrs'][0x2][_0xb93b('0x47')]:undefined)||null},{'name':_0xb93b('0x51'),'value':_0x365564['attrVoiceQueues']||(_0x365564['attrs']&&_0x365564['attrs'][0x3]?_0x365564[_0xb93b('0x46')][0x3][_0xb93b('0x47')]:undefined)||[]},{'name':_0xb93b('0x52'),'value':_0x365564[_0xb93b('0x52')]||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x4]?_0x365564[_0xb93b('0x46')][0x4][_0xb93b('0x47')]:undefined)||_0xb93b('0x5d')},{'name':'attrEmailAccounts','value':_0x365564[_0xb93b('0x53')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x5]?_0x365564['attrs'][0x5]['value']:undefined)||''},{'name':_0xb93b('0x54'),'value':_0x365564[_0xb93b('0x54')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x6]?_0x365564[_0xb93b('0x46')][0x6]['value']:undefined)||''},{'name':_0xb93b('0x55'),'value':_0x365564[_0xb93b('0x55')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x7]?_0x365564['attrs'][0x7][_0xb93b('0x47')]:undefined)||''},{'name':_0xb93b('0x56'),'value':_0x365564['attrOpenchannelAccounts']||(_0x365564['attrs']&&_0x365564[_0xb93b('0x46')][0x8]?_0x365564['attrs'][0x8][_0xb93b('0x47')]:undefined)||''},{'name':_0xb93b('0x57'),'value':_0x365564[_0xb93b('0x57')]||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x9]?_0x365564[_0xb93b('0x46')][0x9][_0xb93b('0x47')]:undefined)||''},{'name':_0xb93b('0x58'),'value':_0x365564[_0xb93b('0x58')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0xa]?_0x365564[_0xb93b('0x46')][0xa]['value']:undefined)||''}];case _0xb93b('0x5e'):return[{'name':_0xb93b('0x5f'),'type':_0x365564[_0xb93b('0x60')]||(_0x365564[_0xb93b('0x46')]&&_0x365564[_0xb93b('0x46')][0x0]?_0x365564[_0xb93b('0x46')][0x0][_0xb93b('0x43')]:undefined)||null,'value':_0x365564[_0xb93b('0x5f')]||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x0]?_0x365564['attrs'][0x0]['value']:undefined)||null},{'name':_0xb93b('0x61'),'value':_0x365564['attrRefresh']||(_0x365564[_0xb93b('0x46')]&&_0x365564['attrs'][0x1]?_0x365564[_0xb93b('0x46')][0x1][_0xb93b('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x30a882){logger[_0xb93b('0x62')]('widgetAttributes:\x20%s',JSON['stringify'](_0x30a882));return[];}}exports[_0xb93b('0x63')]=function(_0x1344cc,_0x37cc1a){if(_0x1344cc['body']){_0x1344cc[_0xb93b('0x64')][_0xb93b('0x46')]=widgetAttributes(_0x1344cc['body']);}return db[_0xb93b('0x36')]['create'](_0x1344cc[_0xb93b('0x64')],{})[_0xb93b('0x2e')](respondWithResult(_0x37cc1a,0xc9))['catch'](handleError(_0x37cc1a,null));};exports['update']=function(_0x3e501d,_0x5ba282){if(_0x3e501d['body']['id']){delete _0x3e501d[_0xb93b('0x64')]['id'];}_0x3e501d['body'][_0xb93b('0x46')]=widgetAttributes(_0x3e501d[_0xb93b('0x64')]);return db['DashboardItem'][_0xb93b('0x40')]({'where':{'id':_0x3e501d['params']['id']}})[_0xb93b('0x2e')](handleEntityNotFound(_0x5ba282,null))[_0xb93b('0x2e')](saveUpdates(_0x3e501d[_0xb93b('0x64')],null))['then'](respondWithResult(_0x5ba282,null))[_0xb93b('0x41')](handleError(_0x5ba282,null));}; \ No newline at end of file +var _0xdded=['register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','end','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','destroy','catch','type','iframe','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x553769,_0x253211){var _0x44fa7b=function(_0x185c03){while(--_0x185c03){_0x553769['push'](_0x553769['shift']());}};_0x44fa7b(++_0x253211);}(_0xdded,0x17a));var _0xddde=function(_0x5cae9c,_0x59a988){_0x5cae9c=_0x5cae9c-0x0;var _0x1a70cb=_0xdded[_0x5cae9c];return _0x1a70cb;};'use strict';var emlformat=require(_0xddde('0x0'));var rimraf=require(_0xddde('0x1'));var zipdir=require(_0xddde('0x2'));var jsonpatch=require(_0xddde('0x3'));var rp=require(_0xddde('0x4'));var moment=require(_0xddde('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xddde('0x6'));var util=require(_0xddde('0x7'));var path=require(_0xddde('0x8'));var sox=require(_0xddde('0x9'));var csv=require(_0xddde('0xa'));var ejs=require(_0xddde('0xb'));var fs=require('fs');var fs_extra=require(_0xddde('0xc'));var _=require(_0xddde('0xd'));var squel=require(_0xddde('0xe'));var crypto=require(_0xddde('0xf'));var jsforce=require(_0xddde('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xddde('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddde('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xddde('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xddde('0x13'))(_0xddde('0x14'));var utils=require(_0xddde('0x15'));var config=require(_0xddde('0x16'));var licenseUtil=require(_0xddde('0x17'));var db=require(_0xddde('0x18'))['db'];config[_0xddde('0x19')]=_[_0xddde('0x1a')](config['redis'],{'host':_0xddde('0x1b'),'port':0x18eb});var socket=require(_0xddde('0x1c'))(new Redis(config[_0xddde('0x19')]));require(_0xddde('0x1d'))[_0xddde('0x1e')](socket);function respondWithStatusCode(_0x31c111,_0x491be5){_0x491be5=_0x491be5||0xcc;return function(_0x20b440){if(_0x20b440){return _0x31c111[_0xddde('0x1f')](_0x491be5);}return _0x31c111[_0xddde('0x20')](_0x491be5)['end']();};}function respondWithResult(_0x5de7ce,_0xadd497){_0xadd497=_0xadd497||0xc8;return function(_0x4e98fd){if(_0x4e98fd){return _0x5de7ce[_0xddde('0x20')](_0xadd497)[_0xddde('0x21')](_0x4e98fd);}};}function respondWithFilteredResult(_0x338fa7,_0x463254){return function(_0x2f0e58){if(_0x2f0e58){var _0x55349b=typeof _0x463254[_0xddde('0x22')]===_0xddde('0x23')&&typeof _0x463254['limit']===_0xddde('0x23');var _0x1185f9=_0x2f0e58['count'];var _0x5ae808=_0x55349b?0x0:_0x463254[_0xddde('0x22')];var _0x4c34b1=_0x55349b?_0x2f0e58[_0xddde('0x24')]:_0x463254['offset']+_0x463254[_0xddde('0x25')];var _0xea045b;if(_0x4c34b1>=_0x1185f9){_0x4c34b1=_0x1185f9;_0xea045b=0xc8;}else{_0xea045b=0xce;}_0x338fa7['status'](_0xea045b);return _0x338fa7['set'](_0xddde('0x26'),_0x5ae808+'-'+_0x4c34b1+'/'+_0x1185f9)[_0xddde('0x21')](_0x2f0e58);}return null;};}function patchUpdates(_0x97bb0f){return function(_0x275f76){try{jsonpatch[_0xddde('0x27')](_0x275f76,_0x97bb0f,!![]);}catch(_0xa663e4){return BPromise[_0xddde('0x28')](_0xa663e4);}return _0x275f76['save']();};}function saveUpdates(_0x59320f,_0x3daa4a){return function(_0x261895){if(_0x261895){return _0x261895[_0xddde('0x29')](_0x59320f)[_0xddde('0x2a')](function(_0xdb57ef){return _0xdb57ef;});}return null;};}function removeEntity(_0x533332,_0x394da0){return function(_0x186ae3){if(_0x186ae3){return _0x186ae3['destroy']()['then'](function(){_0x533332[_0xddde('0x20')](0xcc)[_0xddde('0x2b')]();});}};}function handleEntityNotFound(_0x5ddf57,_0x560e28){return function(_0x45941e){if(!_0x45941e){_0x5ddf57['sendStatus'](0x194);}return _0x45941e;};}function handleError(_0x1d1c3e,_0x41d94b){_0x41d94b=_0x41d94b||0x1f4;return function(_0x2dd131){logger[_0xddde('0x2c')](_0x2dd131[_0xddde('0x2d')]);if(_0x2dd131[_0xddde('0x2e')]){delete _0x2dd131[_0xddde('0x2e')];}_0x1d1c3e[_0xddde('0x20')](_0x41d94b)[_0xddde('0x2f')](_0x2dd131);};}exports[_0xddde('0x30')]=function(_0x3a8226,_0x1ff3e2){var _0xe3d006={'raw':![],'where':{'id':_0x3a8226[_0xddde('0x31')]['id']}},_0x718921={};_0x718921[_0xddde('0x32')]=_[_0xddde('0x33')](db[_0xddde('0x34')][_0xddde('0x35')]);_0x718921[_0xddde('0x36')]=_['keys'](_0x3a8226['query']);_0x718921[_0xddde('0x37')]=_[_0xddde('0x38')](_0x718921[_0xddde('0x32')],_0x718921['query']);_0xe3d006['attributes']=_[_0xddde('0x38')](_0x718921[_0xddde('0x32')],qs[_0xddde('0x39')](_0x3a8226[_0xddde('0x36')]['fields']));_0xe3d006[_0xddde('0x3a')]=_0xe3d006['attributes'][_0xddde('0x3b')]?_0xe3d006[_0xddde('0x3a')]:_0x718921[_0xddde('0x32')];if(_0x3a8226[_0xddde('0x36')][_0xddde('0x3c')]){_0xe3d006[_0xddde('0x3d')]=[{'all':!![]}];}_0xe3d006=_[_0xddde('0x3e')]({},_0xe3d006,_0x3a8226[_0xddde('0x3f')]);return db[_0xddde('0x34')][_0xddde('0x40')](_0xe3d006)[_0xddde('0x2a')](handleEntityNotFound(_0x1ff3e2,null))[_0xddde('0x2a')](respondWithResult(_0x1ff3e2,null))['catch'](handleError(_0x1ff3e2,null));};exports[_0xddde('0x41')]=function(_0x170482,_0x4c68ab){return db['DashboardItem']['find']({'where':{'id':_0x170482[_0xddde('0x31')]['id']}})[_0xddde('0x2a')](handleEntityNotFound(_0x4c68ab,null))[_0xddde('0x2a')](removeEntity(_0x4c68ab,null))[_0xddde('0x42')](handleError(_0x4c68ab,null));};function widgetAttributes(_0x2825c6){try{switch(_0x2825c6[_0xddde('0x43')]){case _0xddde('0x44'):return[{'name':'attrUrl','value':_0x2825c6['attrUrl']||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6['attrs'][0x0]?_0x2825c6[_0xddde('0x45')][0x0][_0xddde('0x46')]:undefined)||'https://'}];case _0xddde('0x47'):return[{'name':_0xddde('0x48'),'value':_0x2825c6[_0xddde('0x48')]||(_0x2825c6['attrs']&&_0x2825c6['attrs'][0x0]?_0x2825c6[_0xddde('0x45')][0x0]['value']:undefined)||''}];case _0xddde('0x49'):return[{'name':_0xddde('0x4a'),'value':_0x2825c6[_0xddde('0x4a')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x0]?_0x2825c6[_0xddde('0x45')][0x0]['value']:undefined)||_0xddde('0x4b')},{'name':_0xddde('0x4c'),'value':_0x2825c6[_0xddde('0x4c')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x1]?_0x2825c6['attrs'][0x1][_0xddde('0x46')]:undefined)||_0xddde('0x4d')},{'name':_0xddde('0x4e'),'value':_0x2825c6[_0xddde('0x4e')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x2]?_0x2825c6[_0xddde('0x45')][0x2][_0xddde('0x46')]:undefined)||0xc}];case _0xddde('0x4f'):return[{'name':'attrMetric','value':_0x2825c6[_0xddde('0x50')]||(_0x2825c6['attrs']&&_0x2825c6[_0xddde('0x45')][0x0]?_0x2825c6[_0xddde('0x45')][0x0]['value']:undefined)||_0xddde('0x51')},{'name':_0xddde('0x52'),'value':_0x2825c6[_0xddde('0x52')]||(_0x2825c6['attrs']&&_0x2825c6['attrs'][0x1]?_0x2825c6['attrs'][0x1][_0xddde('0x46')]:undefined)||[]},{'name':_0xddde('0x4e'),'value':_0x2825c6[_0xddde('0x4e')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6['attrs'][0x2]?_0x2825c6[_0xddde('0x45')][0x2][_0xddde('0x46')]:undefined)||0x14},{'name':_0xddde('0x53'),'value':_0x2825c6['attrChannel']||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x3]?_0x2825c6[_0xddde('0x45')][0x3][_0xddde('0x46')]:undefined)||_0xddde('0x54')},{'name':'attrEmailAccounts','value':_0x2825c6[_0xddde('0x55')]||(_0x2825c6['attrs']&&_0x2825c6[_0xddde('0x45')][0x4]?_0x2825c6['attrs'][0x4][_0xddde('0x46')]:undefined)||''},{'name':_0xddde('0x56'),'value':_0x2825c6[_0xddde('0x56')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x5]?_0x2825c6[_0xddde('0x45')][0x5][_0xddde('0x46')]:undefined)||''},{'name':_0xddde('0x57'),'value':_0x2825c6['attrSmsAccounts']||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x6]?_0x2825c6[_0xddde('0x45')][0x6][_0xddde('0x46')]:undefined)||''},{'name':_0xddde('0x58'),'value':_0x2825c6[_0xddde('0x58')]||(_0x2825c6['attrs']&&_0x2825c6[_0xddde('0x45')][0x7]?_0x2825c6[_0xddde('0x45')][0x7][_0xddde('0x46')]:undefined)||''},{'name':_0xddde('0x59'),'value':_0x2825c6[_0xddde('0x59')]||(_0x2825c6['attrs']&&_0x2825c6[_0xddde('0x45')][0x8]?_0x2825c6[_0xddde('0x45')][0x8][_0xddde('0x46')]:undefined)||''},{'name':_0xddde('0x5a'),'value':_0x2825c6[_0xddde('0x5a')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x9]?_0x2825c6[_0xddde('0x45')][0x9][_0xddde('0x46')]:undefined)||''}];case _0xddde('0x5b'):case _0xddde('0x5c'):return[{'name':_0xddde('0x5d'),'value':_0x2825c6[_0xddde('0x5d')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x0]?_0x2825c6[_0xddde('0x45')][0x0][_0xddde('0x46')]:undefined)||_0xddde('0x51')},{'name':'attrSerie2','value':_0x2825c6['attrSerie2']||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x1]?_0x2825c6[_0xddde('0x45')][0x1][_0xddde('0x46')]:undefined)||null},{'name':_0xddde('0x5e'),'value':_0x2825c6['attrSerie3']||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x2]?_0x2825c6[_0xddde('0x45')][0x2][_0xddde('0x46')]:undefined)||null},{'name':_0xddde('0x52'),'value':_0x2825c6[_0xddde('0x52')]||(_0x2825c6['attrs']&&_0x2825c6[_0xddde('0x45')][0x3]?_0x2825c6[_0xddde('0x45')][0x3][_0xddde('0x46')]:undefined)||[]},{'name':'attrChannel','value':_0x2825c6[_0xddde('0x53')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6['attrs'][0x4]?_0x2825c6['attrs'][0x4]['value']:undefined)||_0xddde('0x54')},{'name':'attrEmailAccounts','value':_0x2825c6[_0xddde('0x55')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x5]?_0x2825c6[_0xddde('0x45')][0x5][_0xddde('0x46')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2825c6['attrFaxAccounts']||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x6]?_0x2825c6['attrs'][0x6][_0xddde('0x46')]:undefined)||''},{'name':_0xddde('0x57'),'value':_0x2825c6[_0xddde('0x57')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x7]?_0x2825c6[_0xddde('0x45')][0x7][_0xddde('0x46')]:undefined)||''},{'name':_0xddde('0x58'),'value':_0x2825c6[_0xddde('0x58')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6['attrs'][0x8]?_0x2825c6[_0xddde('0x45')][0x8]['value']:undefined)||''},{'name':_0xddde('0x59'),'value':_0x2825c6[_0xddde('0x59')]||(_0x2825c6['attrs']&&_0x2825c6['attrs'][0x9]?_0x2825c6['attrs'][0x9][_0xddde('0x46')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2825c6[_0xddde('0x5a')]||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0xa]?_0x2825c6['attrs'][0xa][_0xddde('0x46')]:undefined)||''}];case _0xddde('0x5f'):return[{'name':_0xddde('0x60'),'type':_0x2825c6['reportType']||(_0x2825c6[_0xddde('0x45')]&&_0x2825c6[_0xddde('0x45')][0x0]?_0x2825c6[_0xddde('0x45')][0x0][_0xddde('0x43')]:undefined)||null,'value':_0x2825c6[_0xddde('0x60')]||(_0x2825c6['attrs']&&_0x2825c6[_0xddde('0x45')][0x0]?_0x2825c6['attrs'][0x0][_0xddde('0x46')]:undefined)||null},{'name':_0xddde('0x61'),'value':_0x2825c6[_0xddde('0x61')]||(_0x2825c6['attrs']&&_0x2825c6['attrs'][0x1]?_0x2825c6[_0xddde('0x45')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xf33175){logger[_0xddde('0x2c')](_0xddde('0x62'),JSON[_0xddde('0x63')](_0xf33175));return[];}}exports[_0xddde('0x64')]=function(_0x4eb8ce,_0x29b5b1){if(_0x4eb8ce[_0xddde('0x65')]){_0x4eb8ce[_0xddde('0x65')]['attrs']=widgetAttributes(_0x4eb8ce[_0xddde('0x65')]);}return db['DashboardItem'][_0xddde('0x64')](_0x4eb8ce[_0xddde('0x65')],{})['then'](respondWithResult(_0x29b5b1,0xc9))[_0xddde('0x42')](handleError(_0x29b5b1,null));};exports[_0xddde('0x29')]=function(_0x378758,_0x54c787){if(_0x378758[_0xddde('0x65')]['id']){delete _0x378758[_0xddde('0x65')]['id'];}_0x378758[_0xddde('0x65')][_0xddde('0x45')]=widgetAttributes(_0x378758['body']);return db[_0xddde('0x34')][_0xddde('0x40')]({'where':{'id':_0x378758[_0xddde('0x31')]['id']}})['then'](handleEntityNotFound(_0x54c787,null))[_0xddde('0x2a')](saveUpdates(_0x378758['body'],null))[_0xddde('0x2a')](respondWithResult(_0x54c787,null))[_0xddde('0x42')](handleError(_0x54c787,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index d305da9..871182d 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 _0x3f72=['../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3f72,0xbd));var _0x23f7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3f72[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x23f7('0x0'))['db'][_0x23f7('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x23f7('0x2')](0x0);var events={'afterCreate':_0x23f7('0x3'),'afterUpdate':'update','afterDestroy':_0x23f7('0x4')};function emitEvent(_0x1ae505){return function(_0x142c21,_0x579f7d,_0x4e758d){DashboardItemEvents[_0x23f7('0x5')](_0x1ae505+':'+_0x142c21['id'],_0x142c21);DashboardItemEvents[_0x23f7('0x5')](_0x1ae505,_0x142c21);_0x4e758d(null);};}for(var e in events){if(events[_0x23f7('0x6')](e)){var event=events[e];DashboardItem[_0x23f7('0x7')](e,emitEvent(event));}}module[_0x23f7('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x3d40=['update','remove','emit','hasOwnProperty','hook','exports','DashboardItem'];(function(_0x262034,_0x1d61e1){var _0x4d9e4c=function(_0x5f22ac){while(--_0x5f22ac){_0x262034['push'](_0x262034['shift']());}};_0x4d9e4c(++_0x1d61e1);}(_0x3d40,0x1e9));var _0x03d4=function(_0x41df9b,_0x23049a){_0x41df9b=_0x41df9b-0x0;var _0x1e9c77=_0x3d40[_0x41df9b];return _0x1e9c77;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x03d4('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x03d4('0x1'),'afterDestroy':_0x03d4('0x2')};function emitEvent(_0x323d59){return function(_0x31bef9,_0x16f2b3,_0x456609){DashboardItemEvents[_0x03d4('0x3')](_0x323d59+':'+_0x31bef9['id'],_0x31bef9);DashboardItemEvents[_0x03d4('0x3')](_0x323d59,_0x31bef9);_0x456609(null);};}for(var e in events){if(events[_0x03d4('0x4')](e)){var event=events[e];DashboardItem[_0x03d4('0x5')](e,emitEvent(event));}}module[_0x03d4('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index e572ac7..8cee85d 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 _0x938a=['../../config/logger','api','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','lodash','util'];(function(_0x3fc763,_0xad88d0){var _0x41e07f=function(_0x474a24){while(--_0x474a24){_0x3fc763['push'](_0x3fc763['shift']());}};_0x41e07f(++_0xad88d0);}(_0x938a,0x1f2));var _0xa938=function(_0x516eed,_0x1340a9){_0x516eed=_0x516eed-0x0;var _0x5dff2c=_0x938a[_0x516eed];return _0x5dff2c;};'use strict';var _=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var logger=require(_0xa938('0x2'))(_0xa938('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa938('0x4'));var fs=require('fs');var path=require(_0xa938('0x5'));var rimraf=require(_0xa938('0x6'));var config=require('../../config/environment');var attributes=require(_0xa938('0x7'));module[_0xa938('0x8')]=function(_0x4ac3a2,_0x27efe9){return _0x4ac3a2[_0xa938('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83b1=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','lodash'];(function(_0x3e1077,_0x1c4f67){var _0x481d19=function(_0x495748){while(--_0x495748){_0x3e1077['push'](_0x3e1077['shift']());}};_0x481d19(++_0x1c4f67);}(_0x83b1,0x128));var _0x183b=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x83b1[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x183b('0x0'));var util=require(_0x183b('0x1'));var logger=require(_0x183b('0x2'))(_0x183b('0x3'));var moment=require(_0x183b('0x4'));var BPromise=require(_0x183b('0x5'));var rp=require(_0x183b('0x6'));var fs=require('fs');var path=require(_0x183b('0x7'));var rimraf=require(_0x183b('0x8'));var config=require(_0x183b('0x9'));var attributes=require('./dashboardItem.attributes');module[_0x183b('0xa')]=function(_0x1fc245,_0x17045d){return _0x1fc245['define']('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 5e1b8c5..b5d1dc7 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 _0x63e2=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x63e2,0x110));var _0x263e=function(_0x400d87,_0x430801){_0x400d87=_0x400d87-0x0;var _0x25bcc2=_0x63e2[_0x400d87];return _0x25bcc2;};'use strict';var _=require(_0x263e('0x0'));var util=require(_0x263e('0x1'));var moment=require(_0x263e('0x2'));var BPromise=require('bluebird');var rs=require(_0x263e('0x3'));var fs=require('fs');var Redis=require(_0x263e('0x4'));var db=require(_0x263e('0x5'))['db'];var utils=require(_0x263e('0x6'));var logger=require(_0x263e('0x7'))('rpc');var config=require(_0x263e('0x8'));var jayson=require(_0x263e('0x9'));var client=jayson[_0x263e('0xa')]['http']({'port':0x232a});config[_0x263e('0xb')]=_['defaults'](config['redis'],{'host':_0x263e('0xc'),'port':0x18eb});var socket=require(_0x263e('0xd'))(new Redis(config[_0x263e('0xb')]));require(_0x263e('0xe'))[_0x263e('0xf')](socket);function respondWithRpcPromise(_0x20b5a6,_0x1b8eda,_0x192d6e){return new BPromise(function(_0x3a4364,_0x240c57){return client[_0x263e('0x10')](_0x20b5a6,_0x192d6e)[_0x263e('0x11')](function(_0x692c1){logger[_0x263e('0x12')](_0x263e('0x13'),_0x1b8eda,'request\x20sent');logger[_0x263e('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x1b8eda,_0x263e('0x15'),JSON[_0x263e('0x16')](_0x692c1));if(_0x692c1[_0x263e('0x17')]){if(_0x692c1[_0x263e('0x17')][_0x263e('0x18')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x1b8eda,_0x692c1[_0x263e('0x17')][_0x263e('0x19')]);return _0x240c57(_0x692c1[_0x263e('0x17')][_0x263e('0x19')]);}logger[_0x263e('0x17')](_0x263e('0x13'),_0x1b8eda,_0x692c1[_0x263e('0x17')][_0x263e('0x19')]);return _0x3a4364(_0x692c1['error'][_0x263e('0x19')]);}else{logger[_0x263e('0x12')](_0x263e('0x13'),_0x1b8eda,_0x263e('0x15'));_0x3a4364(_0x692c1[_0x263e('0x1a')]['message']);}})[_0x263e('0x1b')](function(_0x822ac6){logger['error'](_0x263e('0x13'),_0x1b8eda,_0x822ac6);_0x240c57(_0x822ac6);});});} \ No newline at end of file +var _0x662b=['error','message','catch','DashboardItem,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x662b,0x8b));var _0xb662=function(_0x43b4d5,_0xf7dc22){_0x43b4d5=_0x43b4d5-0x0;var _0x347c2f=_0x662b[_0x43b4d5];return _0x347c2f;};'use strict';var _=require(_0xb662('0x0'));var util=require('util');var moment=require(_0xb662('0x1'));var BPromise=require(_0xb662('0x2'));var rs=require(_0xb662('0x3'));var fs=require('fs');var Redis=require(_0xb662('0x4'));var db=require(_0xb662('0x5'))['db'];var utils=require(_0xb662('0x6'));var logger=require(_0xb662('0x7'))(_0xb662('0x8'));var config=require(_0xb662('0x9'));var jayson=require(_0xb662('0xa'));var client=jayson[_0xb662('0xb')]['http']({'port':0x232a});config[_0xb662('0xc')]=_[_0xb662('0xd')](config[_0xb662('0xc')],{'host':_0xb662('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb662('0xc')]));require(_0xb662('0xf'))[_0xb662('0x10')](socket);function respondWithRpcPromise(_0x37d497,_0x308934,_0x4d9bd9){return new BPromise(function(_0x1ba896,_0x4ef2d1){return client[_0xb662('0x11')](_0x37d497,_0x4d9bd9)[_0xb662('0x12')](function(_0x3b5366){logger[_0xb662('0x13')]('DashboardItem,\x20%s,\x20%s',_0x308934,_0xb662('0x14'));logger[_0xb662('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x308934,_0xb662('0x14'),JSON[_0xb662('0x16')](_0x3b5366));if(_0x3b5366['error']){if(_0x3b5366[_0xb662('0x17')]['code']===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x308934,_0x3b5366['error'][_0xb662('0x18')]);return _0x4ef2d1(_0x3b5366['error']['message']);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x308934,_0x3b5366[_0xb662('0x17')][_0xb662('0x18')]);return _0x1ba896(_0x3b5366['error'][_0xb662('0x18')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x308934,_0xb662('0x14'));_0x1ba896(_0x3b5366['result']['message']);}})[_0xb662('0x19')](function(_0x4b1b66){logger[_0xb662('0x17')](_0xb662('0x1a'),_0x308934,_0x4b1b66);_0x4ef2d1(_0x4b1b66);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index f888dd0..c0b296b 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 _0x5f95=['update','removeListener','register','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x4fd840,_0x48a0dd){var _0x5b9ab5=function(_0x474c38){while(--_0x474c38){_0x4fd840['push'](_0x4fd840['shift']());}};_0x5b9ab5(++_0x48a0dd);}(_0x5f95,0x74));var _0x55f9=function(_0x3f719e,_0x5820d9){_0x3f719e=_0x3f719e-0x0;var _0x20fb85=_0x5f95[_0x3f719e];return _0x20fb85;};'use strict';var DashboardItemEvents=require(_0x55f9('0x0'));var events=[_0x55f9('0x1'),_0x55f9('0x2'),_0x55f9('0x3')];function createListener(_0xefabaf,_0x38bab6){return function(_0x45d392){_0x38bab6['emit'](_0xefabaf,_0x45d392);};}function removeListener(_0x293a5a,_0x5b3ea6){return function(){DashboardItemEvents[_0x55f9('0x4')](_0x293a5a,_0x5b3ea6);};}exports[_0x55f9('0x5')]=function(_0x36d188){for(var _0x1819b2=0x0,_0x4be8a8=events['length'];_0x1819b2<_0x4be8a8;_0x1819b2++){var _0x1f2735=events[_0x1819b2];var _0x94f361=createListener(_0x55f9('0x6')+_0x1f2735,_0x36d188);DashboardItemEvents['on'](_0x1f2735,_0x94f361);}}; \ No newline at end of file +var _0x6477=['removeListener','dashboardItem:','./dashboardItem.events','update','emit'];(function(_0x424556,_0x5016eb){var _0x36f8d2=function(_0x3fab0f){while(--_0x3fab0f){_0x424556['push'](_0x424556['shift']());}};_0x36f8d2(++_0x5016eb);}(_0x6477,0x8e));var _0x7647=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x6477[_0x35b7d4];return _0x4e8cee;};'use strict';var DashboardItemEvents=require(_0x7647('0x0'));var events=['save','remove',_0x7647('0x1')];function createListener(_0x34a6c9,_0x4e3ab0){return function(_0x511f75){_0x4e3ab0[_0x7647('0x2')](_0x34a6c9,_0x511f75);};}function removeListener(_0x2b8b60,_0x20c7e2){return function(){DashboardItemEvents[_0x7647('0x3')](_0x2b8b60,_0x20c7e2);};}exports['register']=function(_0x451ccd){for(var _0x5d3935=0x0,_0x51c290=events['length'];_0x5d3935<_0x51c290;_0x5d3935++){var _0x325712=events[_0x5d3935];var _0xa75d01=createListener(_0x7647('0x4')+_0x325712,_0x451ccd);DashboardItemEvents['on'](_0x325712,_0xa75d01);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index fefa390..b02c7d2 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 _0x41dd=['update','delete','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post','isAuthenticated','put'];(function(_0x53b06a,_0x42e1df){var _0x48651f=function(_0x2b82a3){while(--_0x2b82a3){_0x53b06a['push'](_0x53b06a['shift']());}};_0x48651f(++_0x42e1df);}(_0x41dd,0xe1));var _0xd41d=function(_0x5ea895,_0xf16c77){_0x5ea895=_0x5ea895-0x0;var _0x3ad6be=_0x41dd[_0x5ea895];return _0x3ad6be;};'use strict';var multer=require('multer');var util=require(_0xd41d('0x0'));var path=require('path');var timeout=require(_0xd41d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd41d('0x2'));var auth=require(_0xd41d('0x3'));var interaction=require(_0xd41d('0x4'));var config=require(_0xd41d('0x5'));var controller=require(_0xd41d('0x6'));router[_0xd41d('0x7')](_0xd41d('0x8'),auth['isAuthenticated'](),controller[_0xd41d('0x9')]);router[_0xd41d('0xa')]('/',auth[_0xd41d('0xb')](),controller['create']);router[_0xd41d('0xc')]('/:id',auth[_0xd41d('0xb')](),controller[_0xd41d('0xd')]);router[_0xd41d('0xe')](_0xd41d('0x8'),auth[_0xd41d('0xb')](),controller[_0xd41d('0xf')]);module[_0xd41d('0x10')]=router; \ No newline at end of file +var _0x8889=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','create','put','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x257dd1,_0x35ce94){var _0x41130d=function(_0x153d74){while(--_0x153d74){_0x257dd1['push'](_0x257dd1['shift']());}};_0x41130d(++_0x35ce94);}(_0x8889,0x9c));var _0x9888=function(_0x426fec,_0x16f732){_0x426fec=_0x426fec-0x0;var _0x3e6426=_0x8889[_0x426fec];return _0x3e6426;};'use strict';var multer=require(_0x9888('0x0'));var util=require(_0x9888('0x1'));var path=require('path');var timeout=require(_0x9888('0x2'));var express=require('express');var router=express[_0x9888('0x3')]();var fs_extra=require(_0x9888('0x4'));var auth=require(_0x9888('0x5'));var interaction=require(_0x9888('0x6'));var config=require(_0x9888('0x7'));var controller=require('./dashboardItem.controller');router[_0x9888('0x8')](_0x9888('0x9'),auth[_0x9888('0xa')](),controller['show']);router['post']('/',auth[_0x9888('0xa')](),controller[_0x9888('0xb')]);router[_0x9888('0xc')](_0x9888('0x9'),auth['isAuthenticated'](),controller[_0x9888('0xd')]);router[_0x9888('0xe')](_0x9888('0x9'),auth[_0x9888('0xa')](),controller['destroy']);module[_0x9888('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 2cad176..2dbd6d3 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 _0x6b76=['exports','STRING','ENUM','first','second','third'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x6b76,0x114));var _0x66b7=function(_0x3cbd63,_0x2b0b82){_0x3cbd63=_0x3cbd63-0x0;var _0x4c74ac=_0x6b76[_0x3cbd63];return _0x4c74ac;};'use strict';var Sequelize=require('sequelize');module[_0x66b7('0x0')]={'name':{'type':Sequelize[_0x66b7('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x66b7('0x2')](_0x66b7('0x3'),_0x66b7('0x4'),_0x66b7('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x66b7('0x1')]}}; \ No newline at end of file +var _0xb938=['sequelize','exports','first','second','third','STRING'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0xb938,0x1ec));var _0x8b93=function(_0x48f143,_0x194cc3){_0x48f143=_0x48f143-0x0;var _0x295ca7=_0xb938[_0x48f143];return _0x295ca7;};'use strict';var Sequelize=require(_0x8b93('0x0'));module[_0x8b93('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x8b93('0x2'),_0x8b93('0x3'),_0x8b93('0x4')),'allowNull':![],'defaultValue':_0x8b93('0x2')},'description':{'type':Sequelize[_0x8b93('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d9925bc..87a9c04 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 _0x325a=['includeAll','include','findAll','rows','catch','params','fields','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Disposition','rawAttributes','key','model','query','keys','filters','intersection','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x325a,0x1b5));var _0xa325=function(_0x5886ce,_0x512f34){_0x5886ce=_0x5886ce-0x0;var _0x1fec94=_0x325a[_0x5886ce];return _0x1fec94;};'use strict';var emlformat=require(_0xa325('0x0'));var rimraf=require(_0xa325('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa325('0x2'));var rp=require(_0xa325('0x3'));var moment=require('moment');var BPromise=require(_0xa325('0x4'));var Mustache=require(_0xa325('0x5'));var util=require(_0xa325('0x6'));var path=require(_0xa325('0x7'));var sox=require(_0xa325('0x8'));var csv=require('to-csv');var ejs=require(_0xa325('0x9'));var fs=require('fs');var fs_extra=require(_0xa325('0xa'));var _=require(_0xa325('0xb'));var squel=require(_0xa325('0xc'));var crypto=require(_0xa325('0xd'));var jsforce=require(_0xa325('0xe'));var deskjs=require(_0xa325('0xf'));var toCsv=require(_0xa325('0x10'));var querystring=require('querystring');var Papa=require(_0xa325('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa325('0x12'));var as=require(_0xa325('0x13'));var hardwareService=require(_0xa325('0x14'));var logger=require(_0xa325('0x15'))('api');var utils=require(_0xa325('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa325('0x17'));var db=require(_0xa325('0x18'))['db'];function respondWithStatusCode(_0x4da9df,_0x4d3713){_0x4d3713=_0x4d3713||0xcc;return function(_0x25b08e){if(_0x25b08e){return _0x4da9df['sendStatus'](_0x4d3713);}return _0x4da9df[_0xa325('0x19')](_0x4d3713)[_0xa325('0x1a')]();};}function respondWithResult(_0x340c04,_0x6cc286){_0x6cc286=_0x6cc286||0xc8;return function(_0x207f64){if(_0x207f64){return _0x340c04[_0xa325('0x19')](_0x6cc286)[_0xa325('0x1b')](_0x207f64);}};}function respondWithFilteredResult(_0x529676,_0x111400){return function(_0x1fd878){if(_0x1fd878){var _0xec3c75=typeof _0x111400['offset']===_0xa325('0x1c')&&typeof _0x111400[_0xa325('0x1d')]===_0xa325('0x1c');var _0x3406b7=_0x1fd878['count'];var _0x41f6a9=_0xec3c75?0x0:_0x111400[_0xa325('0x1e')];var _0x2f3228=_0xec3c75?_0x1fd878[_0xa325('0x1f')]:_0x111400[_0xa325('0x1e')]+_0x111400[_0xa325('0x1d')];var _0x35dd07;if(_0x2f3228>=_0x3406b7){_0x2f3228=_0x3406b7;_0x35dd07=0xc8;}else{_0x35dd07=0xce;}_0x529676[_0xa325('0x19')](_0x35dd07);return _0x529676[_0xa325('0x20')](_0xa325('0x21'),_0x41f6a9+'-'+_0x2f3228+'/'+_0x3406b7)[_0xa325('0x1b')](_0x1fd878);}return null;};}function patchUpdates(_0x5468c4){return function(_0x2e147e){try{jsonpatch[_0xa325('0x22')](_0x2e147e,_0x5468c4,!![]);}catch(_0x3430fb){return BPromise[_0xa325('0x23')](_0x3430fb);}return _0x2e147e[_0xa325('0x24')]();};}function saveUpdates(_0x5d935d,_0x1bdb70){return function(_0x5eacb6){if(_0x5eacb6){return _0x5eacb6['update'](_0x5d935d)[_0xa325('0x25')](function(_0x4eaee3){return _0x4eaee3;});}return null;};}function removeEntity(_0x441e40,_0x4b25bc){return function(_0x536dc2){if(_0x536dc2){return _0x536dc2['destroy']()[_0xa325('0x25')](function(){var _0x4387b0=_0x536dc2[_0xa325('0x26')]({'plain':!![]});var _0x495a25='Dispositions';return db[_0xa325('0x27')]['destroy']({'where':{'type':_0x495a25,'resourceId':_0x4387b0['id']}})[_0xa325('0x25')](function(){return _0x536dc2;});})[_0xa325('0x25')](function(){_0x441e40[_0xa325('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a0b2,_0x54e2f9){return function(_0x137423){if(!_0x137423){_0x51a0b2[_0xa325('0x28')](0x194);}return _0x137423;};}function handleError(_0x48e5d7,_0x79dc99){_0x79dc99=_0x79dc99||0x1f4;return function(_0x4e4ae8){logger[_0xa325('0x29')](_0x4e4ae8[_0xa325('0x2a')]);if(_0x4e4ae8['name']){delete _0x4e4ae8[_0xa325('0x2b')];}_0x48e5d7['status'](_0x79dc99)[_0xa325('0x2c')](_0x4e4ae8);};}exports[_0xa325('0x2d')]=function(_0x23ad6f,_0x1887e9){var _0x437dfe={},_0x3b21c4={},_0x373d56={'count':0x0,'rows':[]};var _0x2e2fba=_[_0xa325('0x2e')](db[_0xa325('0x2f')][_0xa325('0x30')],function(_0x3b5f36){return{'name':_0x3b5f36['fieldName'],'type':_0x3b5f36['type'][_0xa325('0x31')]};});_0x3b21c4[_0xa325('0x32')]=_['map'](_0x2e2fba,_0xa325('0x2b'));_0x3b21c4[_0xa325('0x33')]=_[_0xa325('0x34')](_0x23ad6f['query']);_0x3b21c4[_0xa325('0x35')]=_[_0xa325('0x36')](_0x3b21c4['model'],_0x3b21c4['query']);_0x437dfe['attributes']=_[_0xa325('0x36')](_0x3b21c4[_0xa325('0x32')],qs['fields'](_0x23ad6f[_0xa325('0x33')]['fields']));_0x437dfe['attributes']=_0x437dfe['attributes'][_0xa325('0x37')]?_0x437dfe[_0xa325('0x38')]:_0x3b21c4['model'];if(!_0x23ad6f[_0xa325('0x33')][_0xa325('0x39')](_0xa325('0x3a'))){_0x437dfe['limit']=qs[_0xa325('0x1d')](_0x23ad6f[_0xa325('0x33')][_0xa325('0x1d')]);_0x437dfe[_0xa325('0x1e')]=qs[_0xa325('0x1e')](_0x23ad6f['query'][_0xa325('0x1e')]);}_0x437dfe[_0xa325('0x3b')]=qs['sort'](_0x23ad6f[_0xa325('0x33')][_0xa325('0x3c')]);_0x437dfe[_0xa325('0x3d')]=qs[_0xa325('0x35')](_[_0xa325('0x3e')](_0x23ad6f['query'],_0x3b21c4[_0xa325('0x35')]),_0x2e2fba);if(_0x23ad6f[_0xa325('0x33')][_0xa325('0x3f')]){_0x437dfe[_0xa325('0x3d')]=_[_0xa325('0x40')](_0x437dfe[_0xa325('0x3d')],{'$or':_['map'](_0x2e2fba,function(_0x56e3f3){if(_0x56e3f3[_0xa325('0x41')]!==_0xa325('0x42')){var _0x5ac90c={};_0x5ac90c[_0x56e3f3['name']]={'$like':'%'+_0x23ad6f[_0xa325('0x33')][_0xa325('0x3f')]+'%'};return _0x5ac90c;}})});}_0x437dfe=_['merge']({},_0x437dfe,_0x23ad6f['options']);var _0x2be622={'where':_0x437dfe[_0xa325('0x3d')]};return db[_0xa325('0x2f')][_0xa325('0x1f')](_0x2be622)[_0xa325('0x25')](function(_0x31b7de){_0x373d56[_0xa325('0x1f')]=_0x31b7de;if(_0x23ad6f[_0xa325('0x33')][_0xa325('0x43')]){_0x437dfe[_0xa325('0x44')]=[{'all':!![]}];}return db[_0xa325('0x2f')][_0xa325('0x45')](_0x437dfe);})[_0xa325('0x25')](function(_0x504492){_0x373d56[_0xa325('0x46')]=_0x504492;return _0x373d56;})[_0xa325('0x25')](respondWithFilteredResult(_0x1887e9,_0x437dfe))[_0xa325('0x47')](handleError(_0x1887e9,null));};exports['show']=function(_0x1b71c0,_0x2ddc6f){var _0x4827da={'raw':!![],'where':{'id':_0x1b71c0[_0xa325('0x48')]['id']}},_0x3fb04e={};_0x3fb04e['model']=_[_0xa325('0x34')](db[_0xa325('0x2f')][_0xa325('0x30')]);_0x3fb04e[_0xa325('0x33')]=_[_0xa325('0x34')](_0x1b71c0[_0xa325('0x33')]);_0x3fb04e[_0xa325('0x35')]=_[_0xa325('0x36')](_0x3fb04e['model'],_0x3fb04e[_0xa325('0x33')]);_0x4827da[_0xa325('0x38')]=_['intersection'](_0x3fb04e[_0xa325('0x32')],qs[_0xa325('0x49')](_0x1b71c0['query'][_0xa325('0x49')]));_0x4827da[_0xa325('0x38')]=_0x4827da[_0xa325('0x38')][_0xa325('0x37')]?_0x4827da[_0xa325('0x38')]:_0x3fb04e['model'];if(_0x1b71c0[_0xa325('0x33')][_0xa325('0x43')]){_0x4827da[_0xa325('0x44')]=[{'all':!![]}];}_0x4827da=_[_0xa325('0x40')]({},_0x4827da,_0x1b71c0[_0xa325('0x4a')]);return db[_0xa325('0x2f')][_0xa325('0x4b')](_0x4827da)[_0xa325('0x25')](handleEntityNotFound(_0x2ddc6f,null))[_0xa325('0x25')](respondWithResult(_0x2ddc6f,null))[_0xa325('0x47')](handleError(_0x2ddc6f,null));};exports[_0xa325('0x4c')]=function(_0x546c5b,_0x4c2bd7){return db[_0xa325('0x2f')]['create'](_0x546c5b['body'],{})['then'](function(_0x573b90){var _0x2e434c=_0x546c5b[_0xa325('0x4d')][_0xa325('0x26')]({'plain':!![]});if(!_0x2e434c)throw new Error(_0xa325('0x4e'));if(_0x2e434c[_0xa325('0x4f')]==='user'){var _0x19d35c=_0x573b90[_0xa325('0x26')]({'plain':!![]});var _0x44e981='Dispositions';return db[_0xa325('0x50')]['find']({'where':{'name':_0x44e981,'userProfileId':_0x2e434c['userProfileId']},'raw':!![]})[_0xa325('0x25')](function(_0x2295be){if(_0x2295be&&_0x2295be[_0xa325('0x51')]===0x0){return db[_0xa325('0x27')][_0xa325('0x4c')]({'name':_0x19d35c[_0xa325('0x2b')],'resourceId':_0x19d35c['id'],'type':_0x2295be[_0xa325('0x2b')],'sectionId':_0x2295be['id']},{})['then'](function(){return _0x573b90;});}else{return _0x573b90;}})[_0xa325('0x47')](function(_0x37b303){logger[_0xa325('0x29')](_0xa325('0x52'),_0x37b303);throw _0x37b303;});}return _0x573b90;})[_0xa325('0x25')](respondWithResult(_0x4c2bd7,0xc9))[_0xa325('0x47')](handleError(_0x4c2bd7,null));};exports['update']=function(_0x2dc202,_0x4f743){if(_0x2dc202[_0xa325('0x53')]['id']){delete _0x2dc202['body']['id'];}return db[_0xa325('0x2f')][_0xa325('0x4b')]({'where':{'id':_0x2dc202[_0xa325('0x48')]['id']}})[_0xa325('0x25')](handleEntityNotFound(_0x4f743,null))['then'](saveUpdates(_0x2dc202['body'],null))[_0xa325('0x25')](respondWithResult(_0x4f743,null))['catch'](handleError(_0x4f743,null));};exports['destroy']=function(_0x109eb1,_0x4ede56){return db[_0xa325('0x2f')][_0xa325('0x4b')]({'where':{'id':_0x109eb1[_0xa325('0x48')]['id']}})[_0xa325('0x25')](handleEntityNotFound(_0x4ede56,null))[_0xa325('0x25')](removeEntity(_0x4ede56,null))['catch'](handleError(_0x4ede56,null));}; \ No newline at end of file +var _0xc569=['include','findAll','rows','show','params','rawAttributes','length','catch','create','user','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','Dispositions','UserProfileResource','sendStatus','error','index','map','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','Disposition','includeAll'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xc569,0x159));var _0x9c56=function(_0x9dc430,_0x417d97){_0x9dc430=_0x9dc430-0x0;var _0x5a940e=_0xc569[_0x9dc430];return _0x5a940e;};'use strict';var emlformat=require(_0x9c56('0x0'));var rimraf=require(_0x9c56('0x1'));var zipdir=require(_0x9c56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c56('0x3'));var moment=require(_0x9c56('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c56('0x5'));var util=require(_0x9c56('0x6'));var path=require(_0x9c56('0x7'));var sox=require('sox');var csv=require(_0x9c56('0x8'));var ejs=require(_0x9c56('0x9'));var fs=require('fs');var fs_extra=require(_0x9c56('0xa'));var _=require(_0x9c56('0xb'));var squel=require('squel');var crypto=require(_0x9c56('0xc'));var jsforce=require(_0x9c56('0xd'));var deskjs=require(_0x9c56('0xe'));var toCsv=require(_0x9c56('0x8'));var querystring=require(_0x9c56('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c56('0x10'));var as=require(_0x9c56('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c56('0x12'))('api');var utils=require(_0x9c56('0x13'));var config=require(_0x9c56('0x14'));var licenseUtil=require(_0x9c56('0x15'));var db=require(_0x9c56('0x16'))['db'];function respondWithStatusCode(_0x43b2a9,_0x137123){_0x137123=_0x137123||0xcc;return function(_0xbec6b9){if(_0xbec6b9){return _0x43b2a9['sendStatus'](_0x137123);}return _0x43b2a9[_0x9c56('0x17')](_0x137123)[_0x9c56('0x18')]();};}function respondWithResult(_0x44c0bd,_0xbeb12d){_0xbeb12d=_0xbeb12d||0xc8;return function(_0x2f441e){if(_0x2f441e){return _0x44c0bd['status'](_0xbeb12d)[_0x9c56('0x19')](_0x2f441e);}};}function respondWithFilteredResult(_0x5217c3,_0x37d40a){return function(_0x1f16ce){if(_0x1f16ce){var _0x14ace0=typeof _0x37d40a[_0x9c56('0x1a')]===_0x9c56('0x1b')&&typeof _0x37d40a[_0x9c56('0x1c')]===_0x9c56('0x1b');var _0x36975a=_0x1f16ce[_0x9c56('0x1d')];var _0x3a63c4=_0x14ace0?0x0:_0x37d40a[_0x9c56('0x1a')];var _0x2494cc=_0x14ace0?_0x1f16ce[_0x9c56('0x1d')]:_0x37d40a[_0x9c56('0x1a')]+_0x37d40a[_0x9c56('0x1c')];var _0x4c5d66;if(_0x2494cc>=_0x36975a){_0x2494cc=_0x36975a;_0x4c5d66=0xc8;}else{_0x4c5d66=0xce;}_0x5217c3[_0x9c56('0x17')](_0x4c5d66);return _0x5217c3[_0x9c56('0x1e')](_0x9c56('0x1f'),_0x3a63c4+'-'+_0x2494cc+'/'+_0x36975a)['json'](_0x1f16ce);}return null;};}function patchUpdates(_0xf074f9){return function(_0x1f55b6){try{jsonpatch[_0x9c56('0x20')](_0x1f55b6,_0xf074f9,!![]);}catch(_0x44267e){return BPromise[_0x9c56('0x21')](_0x44267e);}return _0x1f55b6[_0x9c56('0x22')]();};}function saveUpdates(_0x27066c,_0xf4e706){return function(_0x31da15){if(_0x31da15){return _0x31da15['update'](_0x27066c)[_0x9c56('0x23')](function(_0x19ed38){return _0x19ed38;});}return null;};}function removeEntity(_0x573983,_0xe25ab2){return function(_0x1969fe){if(_0x1969fe){return _0x1969fe[_0x9c56('0x24')]()[_0x9c56('0x23')](function(){var _0x2a9f5b=_0x1969fe['get']({'plain':!![]});var _0x51336b=_0x9c56('0x25');return db[_0x9c56('0x26')]['destroy']({'where':{'type':_0x51336b,'resourceId':_0x2a9f5b['id']}})[_0x9c56('0x23')](function(){return _0x1969fe;});})['then'](function(){_0x573983['status'](0xcc)[_0x9c56('0x18')]();});}};}function handleEntityNotFound(_0x42a685,_0x3a0119){return function(_0x2cb39c){if(!_0x2cb39c){_0x42a685[_0x9c56('0x27')](0x194);}return _0x2cb39c;};}function handleError(_0x3be78d,_0x4f4c27){_0x4f4c27=_0x4f4c27||0x1f4;return function(_0x14efdf){logger[_0x9c56('0x28')](_0x14efdf['stack']);if(_0x14efdf['name']){delete _0x14efdf['name'];}_0x3be78d[_0x9c56('0x17')](_0x4f4c27)['send'](_0x14efdf);};}exports[_0x9c56('0x29')]=function(_0x3f68dd,_0x7bcf70){var _0x3a4ea9={},_0x289696={},_0x4241ae={'count':0x0,'rows':[]};var _0x5bfc92=_[_0x9c56('0x2a')](db['Disposition']['rawAttributes'],function(_0x3aa0d6){return{'name':_0x3aa0d6[_0x9c56('0x2b')],'type':_0x3aa0d6[_0x9c56('0x2c')][_0x9c56('0x2d')]};});_0x289696[_0x9c56('0x2e')]=_[_0x9c56('0x2a')](_0x5bfc92,_0x9c56('0x2f'));_0x289696[_0x9c56('0x30')]=_[_0x9c56('0x31')](_0x3f68dd[_0x9c56('0x30')]);_0x289696['filters']=_[_0x9c56('0x32')](_0x289696[_0x9c56('0x2e')],_0x289696['query']);_0x3a4ea9[_0x9c56('0x33')]=_[_0x9c56('0x32')](_0x289696[_0x9c56('0x2e')],qs[_0x9c56('0x34')](_0x3f68dd[_0x9c56('0x30')]['fields']));_0x3a4ea9[_0x9c56('0x33')]=_0x3a4ea9[_0x9c56('0x33')]['length']?_0x3a4ea9['attributes']:_0x289696[_0x9c56('0x2e')];if(!_0x3f68dd[_0x9c56('0x30')][_0x9c56('0x35')]('nolimit')){_0x3a4ea9[_0x9c56('0x1c')]=qs[_0x9c56('0x1c')](_0x3f68dd[_0x9c56('0x30')][_0x9c56('0x1c')]);_0x3a4ea9['offset']=qs[_0x9c56('0x1a')](_0x3f68dd['query']['offset']);}_0x3a4ea9[_0x9c56('0x36')]=qs[_0x9c56('0x37')](_0x3f68dd[_0x9c56('0x30')][_0x9c56('0x37')]);_0x3a4ea9[_0x9c56('0x38')]=qs[_0x9c56('0x39')](_[_0x9c56('0x3a')](_0x3f68dd[_0x9c56('0x30')],_0x289696[_0x9c56('0x39')]),_0x5bfc92);if(_0x3f68dd[_0x9c56('0x30')]['filter']){_0x3a4ea9['where']=_[_0x9c56('0x3b')](_0x3a4ea9[_0x9c56('0x38')],{'$or':_['map'](_0x5bfc92,function(_0x212227){if(_0x212227[_0x9c56('0x2c')]!==_0x9c56('0x3c')){var _0x1c7945={};_0x1c7945[_0x212227[_0x9c56('0x2f')]]={'$like':'%'+_0x3f68dd[_0x9c56('0x30')][_0x9c56('0x3d')]+'%'};return _0x1c7945;}})});}_0x3a4ea9=_[_0x9c56('0x3b')]({},_0x3a4ea9,_0x3f68dd[_0x9c56('0x3e')]);var _0x2bbf2e={'where':_0x3a4ea9[_0x9c56('0x38')]};return db[_0x9c56('0x3f')][_0x9c56('0x1d')](_0x2bbf2e)[_0x9c56('0x23')](function(_0x10c659){_0x4241ae[_0x9c56('0x1d')]=_0x10c659;if(_0x3f68dd[_0x9c56('0x30')][_0x9c56('0x40')]){_0x3a4ea9[_0x9c56('0x41')]=[{'all':!![]}];}return db[_0x9c56('0x3f')][_0x9c56('0x42')](_0x3a4ea9);})[_0x9c56('0x23')](function(_0x15cc65){_0x4241ae[_0x9c56('0x43')]=_0x15cc65;return _0x4241ae;})['then'](respondWithFilteredResult(_0x7bcf70,_0x3a4ea9))['catch'](handleError(_0x7bcf70,null));};exports[_0x9c56('0x44')]=function(_0x20cd64,_0x25eeed){var _0x28bcd9={'raw':!![],'where':{'id':_0x20cd64[_0x9c56('0x45')]['id']}},_0x2e3d12={};_0x2e3d12[_0x9c56('0x2e')]=_[_0x9c56('0x31')](db['Disposition'][_0x9c56('0x46')]);_0x2e3d12[_0x9c56('0x30')]=_[_0x9c56('0x31')](_0x20cd64[_0x9c56('0x30')]);_0x2e3d12['filters']=_['intersection'](_0x2e3d12[_0x9c56('0x2e')],_0x2e3d12[_0x9c56('0x30')]);_0x28bcd9[_0x9c56('0x33')]=_[_0x9c56('0x32')](_0x2e3d12[_0x9c56('0x2e')],qs[_0x9c56('0x34')](_0x20cd64[_0x9c56('0x30')][_0x9c56('0x34')]));_0x28bcd9[_0x9c56('0x33')]=_0x28bcd9['attributes'][_0x9c56('0x47')]?_0x28bcd9[_0x9c56('0x33')]:_0x2e3d12['model'];if(_0x20cd64[_0x9c56('0x30')][_0x9c56('0x40')]){_0x28bcd9['include']=[{'all':!![]}];}_0x28bcd9=_[_0x9c56('0x3b')]({},_0x28bcd9,_0x20cd64[_0x9c56('0x3e')]);return db['Disposition']['find'](_0x28bcd9)['then'](handleEntityNotFound(_0x25eeed,null))['then'](respondWithResult(_0x25eeed,null))[_0x9c56('0x48')](handleError(_0x25eeed,null));};exports[_0x9c56('0x49')]=function(_0x1d01b5,_0x457c79){return db['Disposition'][_0x9c56('0x49')](_0x1d01b5['body'],{})['then'](function(_0x292e8f){var _0x282bc2=_0x1d01b5['user']['get']({'plain':!![]});if(!_0x282bc2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x282bc2['role']===_0x9c56('0x4a')){var _0x3ee3a9=_0x292e8f[_0x9c56('0x4b')]({'plain':!![]});var _0x5315c6='Dispositions';return db[_0x9c56('0x4c')][_0x9c56('0x4d')]({'where':{'name':_0x5315c6,'userProfileId':_0x282bc2[_0x9c56('0x4e')]},'raw':!![]})['then'](function(_0x180ec0){if(_0x180ec0&&_0x180ec0['autoAssociation']===0x0){return db[_0x9c56('0x26')][_0x9c56('0x49')]({'name':_0x3ee3a9[_0x9c56('0x2f')],'resourceId':_0x3ee3a9['id'],'type':_0x180ec0['name'],'sectionId':_0x180ec0['id']},{})['then'](function(){return _0x292e8f;});}else{return _0x292e8f;}})[_0x9c56('0x48')](function(_0x2a18af){logger['error'](_0x9c56('0x4f'),_0x2a18af);throw _0x2a18af;});}return _0x292e8f;})[_0x9c56('0x23')](respondWithResult(_0x457c79,0xc9))[_0x9c56('0x48')](handleError(_0x457c79,null));};exports[_0x9c56('0x50')]=function(_0x2a55c7,_0x116a1d){if(_0x2a55c7['body']['id']){delete _0x2a55c7[_0x9c56('0x51')]['id'];}return db[_0x9c56('0x3f')][_0x9c56('0x4d')]({'where':{'id':_0x2a55c7[_0x9c56('0x45')]['id']}})[_0x9c56('0x23')](handleEntityNotFound(_0x116a1d,null))['then'](saveUpdates(_0x2a55c7[_0x9c56('0x51')],null))[_0x9c56('0x23')](respondWithResult(_0x116a1d,null))['catch'](handleError(_0x116a1d,null));};exports[_0x9c56('0x24')]=function(_0x2b427e,_0x445811){return db[_0x9c56('0x3f')][_0x9c56('0x4d')]({'where':{'id':_0x2b427e['params']['id']}})[_0x9c56('0x23')](handleEntityNotFound(_0x445811,null))['then'](removeEntity(_0x445811,null))[_0x9c56('0x48')](handleError(_0x445811,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 9980376..9a19682 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 _0xf0cc=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x2f30ea,_0x1014b0){var _0x100a3e=function(_0xf6b163){while(--_0xf6b163){_0x2f30ea['push'](_0x2f30ea['shift']());}};_0x100a3e(++_0x1014b0);}(_0xf0cc,0xf3));var _0xcf0c=function(_0x1dbf91,_0x4b96f9){_0x1dbf91=_0x1dbf91-0x0;var _0xb5e02c=_0xf0cc[_0x1dbf91];return _0xb5e02c;};'use strict';var _=require(_0xcf0c('0x0'));var util=require(_0xcf0c('0x1'));var logger=require(_0xcf0c('0x2'))(_0xcf0c('0x3'));var moment=require('moment');var BPromise=require(_0xcf0c('0x4'));var rp=require(_0xcf0c('0x5'));var fs=require('fs');var path=require(_0xcf0c('0x6'));var rimraf=require('rimraf');var config=require(_0xcf0c('0x7'));var attributes=require(_0xcf0c('0x8'));module[_0xcf0c('0x9')]=function(_0x13221e,_0x15d820){return _0x13221e['define'](_0xcf0c('0xa'),attributes,{'tableName':_0xcf0c('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xcf0c('0xc'),'fields':['name',_0xcf0c('0xd')]},{'unique':!![],'name':_0xcf0c('0xe'),'fields':[_0xcf0c('0xf'),_0xcf0c('0x10')]},{'unique':!![],'name':_0xcf0c('0x11'),'fields':[_0xcf0c('0xf'),_0xcf0c('0x12')]},{'unique':!![],'name':_0xcf0c('0x13'),'fields':['name',_0xcf0c('0x14')]},{'unique':!![],'name':_0xcf0c('0x15'),'fields':['name',_0xcf0c('0x16')]},{'unique':!![],'name':_0xcf0c('0x17'),'fields':[_0xcf0c('0xf'),_0xcf0c('0x18')]},{'unique':!![],'name':_0xcf0c('0x19'),'fields':['name',_0xcf0c('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2944=['WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2944,0x1dc));var _0x4294=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x2944[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x4294('0x0'));var util=require(_0x4294('0x1'));var logger=require('../../config/logger')(_0x4294('0x2'));var moment=require(_0x4294('0x3'));var BPromise=require(_0x4294('0x4'));var rp=require(_0x4294('0x5'));var fs=require('fs');var path=require(_0x4294('0x6'));var rimraf=require(_0x4294('0x7'));var config=require(_0x4294('0x8'));var attributes=require('./disposition.attributes');module[_0x4294('0x9')]=function(_0x403793,_0xec40e9){return _0x403793[_0x4294('0xa')](_0x4294('0xb'),attributes,{'tableName':_0x4294('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x4294('0xd'),'fields':[_0x4294('0xe'),_0x4294('0xf')]},{'unique':!![],'name':'name_chat','fields':['name',_0x4294('0x10')]},{'unique':!![],'name':_0x4294('0x11'),'fields':[_0x4294('0xe'),_0x4294('0x12')]},{'unique':!![],'name':_0x4294('0x13'),'fields':['name',_0x4294('0x14')]},{'unique':!![],'name':'name_fax','fields':[_0x4294('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x4294('0x15'),'fields':['name',_0x4294('0x16')]},{'unique':!![],'name':_0x4294('0x17'),'fields':[_0x4294('0xe'),_0x4294('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d18143a..bc85590 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 _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x1caaa2,_0x52604a){var _0x507f17=function(_0x2034c6){while(--_0x2034c6){_0x1caaa2['push'](_0x1caaa2['shift']());}};_0x507f17(++_0x52604a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x354ce3,_0x62b505){var _0x123067=function(_0x1a5cdb){while(--_0x1a5cdb){_0x354ce3['push'](_0x354ce3['shift']());}};_0x123067(++_0x62b505);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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/disposition/index.js b/server/api/disposition/index.js index c636b39..ae6c862 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 _0xd2cc=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x54299d,_0x59899e){var _0x3c458d=function(_0x439ad2){while(--_0x439ad2){_0x54299d['push'](_0x54299d['shift']());}};_0x3c458d(++_0x59899e);}(_0xd2cc,0x154));var _0xcd2c=function(_0x28ebcd,_0x4e297e){_0x28ebcd=_0x28ebcd-0x0;var _0xfec8f5=_0xd2cc[_0x28ebcd];return _0xfec8f5;};'use strict';var multer=require(_0xcd2c('0x0'));var util=require(_0xcd2c('0x1'));var path=require(_0xcd2c('0x2'));var timeout=require(_0xcd2c('0x3'));var express=require('express');var router=express[_0xcd2c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcd2c('0x5'));var interaction=require(_0xcd2c('0x6'));var config=require(_0xcd2c('0x7'));var controller=require(_0xcd2c('0x8'));router[_0xcd2c('0x9')]('/',auth[_0xcd2c('0xa')](),controller[_0xcd2c('0xb')]);router[_0xcd2c('0x9')]('/:id',auth[_0xcd2c('0xa')](),controller['show']);router['post']('/',auth[_0xcd2c('0xa')](),controller[_0xcd2c('0xc')]);router[_0xcd2c('0xd')](_0xcd2c('0xe'),auth[_0xcd2c('0xa')](),controller[_0xcd2c('0xf')]);router[_0xcd2c('0x10')]('/:id',auth[_0xcd2c('0xa')](),controller[_0xcd2c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x55fd=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x55fd,0x95));var _0xd55f=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x55fd[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0xd55f('0x0'));var util=require(_0xd55f('0x1'));var path=require(_0xd55f('0x2'));var timeout=require('connect-timeout');var express=require(_0xd55f('0x3'));var router=express[_0xd55f('0x4')]();var fs_extra=require(_0xd55f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd55f('0x6'));var config=require(_0xd55f('0x7'));var controller=require(_0xd55f('0x8'));router[_0xd55f('0x9')]('/',auth[_0xd55f('0xa')](),controller[_0xd55f('0xb')]);router[_0xd55f('0x9')](_0xd55f('0xc'),auth[_0xd55f('0xa')](),controller[_0xd55f('0xd')]);router[_0xd55f('0xe')]('/',auth[_0xd55f('0xa')](),controller[_0xd55f('0xf')]);router[_0xd55f('0x10')](_0xd55f('0xc'),auth[_0xd55f('0xa')](),controller[_0xd55f('0x11')]);router[_0xd55f('0x12')](_0xd55f('0xc'),auth[_0xd55f('0xa')](),controller[_0xd55f('0x13')]);module[_0xd55f('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index e5e86ec..d16d7eb 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 _0x4f3b=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','ENUM','yes','STRING','localstationid','2400','4800','7200','14400','9600','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f3b,0x6a));var _0xb4f3=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x4f3b[_0x35d8af];return _0x1d08b0;};'use strict';var Sequelize=require(_0xb4f3('0x0'));module[_0xb4f3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xb4f3('0x2')](_0xb4f3('0x3'),'no'),'defaultValue':_0xb4f3('0x3')},'headerinfo':{'type':Sequelize[_0xb4f3('0x4')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xb4f3('0x4')],'unique':_0xb4f3('0x5')},'minrate':{'type':Sequelize[_0xb4f3('0x2')](_0xb4f3('0x6'),_0xb4f3('0x7'),_0xb4f3('0x8'),'9600','12000',_0xb4f3('0x9')),'defaultValue':_0xb4f3('0x7')},'maxrate':{'type':Sequelize[_0xb4f3('0x2')](_0xb4f3('0x6'),_0xb4f3('0x7'),_0xb4f3('0x8'),_0xb4f3('0xa'),_0xb4f3('0xb'),_0xb4f3('0x9')),'defaultValue':_0xb4f3('0x9')},'modem':{'type':Sequelize[_0xb4f3('0x4')],'defaultValue':_0xb4f3('0xc')},'gateway':{'type':Sequelize[_0xb4f3('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb4f3('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb4f3('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb4f3('0x2')](_0xb4f3('0xe'),_0xb4f3('0xf'),_0xb4f3('0x10'),_0xb4f3('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xb4f3('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb4f3('0x12')],'defaultValue':function(){return _0xb4f3('0x13');}},'notificationSound':{'type':Sequelize[_0xb4f3('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb4f3('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb4f3('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb4f3('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb4f3('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb4f3('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xb4f3('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xb4f3('0x14')],'defaultValue':![],'comment':_0xb4f3('0x16'),'set':function(_0x1e3cd3){if(!_0x1e3cd3)this[_0xb4f3('0x17')](_0xb4f3('0x18'),null);this[_0xb4f3('0x17')]('mandatoryDisposition',_0x1e3cd3);}}}; \ No newline at end of file +var _0x91b1=['9600','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200'];(function(_0x2a343e,_0x513981){var _0x4aec98=function(_0xdc55bf){while(--_0xdc55bf){_0x2a343e['push'](_0x2a343e['shift']());}};_0x4aec98(++_0x513981);}(_0x91b1,0x195));var _0x191b=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x91b1[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0x191b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x191b('0x1')]},'ecm':{'type':Sequelize[_0x191b('0x2')](_0x191b('0x3'),'no'),'defaultValue':_0x191b('0x3')},'headerinfo':{'type':Sequelize[_0x191b('0x1')],'defaultValue':_0x191b('0x4')},'localstationid':{'type':Sequelize[_0x191b('0x1')],'unique':_0x191b('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x191b('0x6'),_0x191b('0x7'),_0x191b('0x8'),_0x191b('0x9'),_0x191b('0xa'),_0x191b('0xb')),'defaultValue':_0x191b('0x7')},'maxrate':{'type':Sequelize[_0x191b('0x2')]('2400',_0x191b('0x7'),_0x191b('0x8'),_0x191b('0x9'),_0x191b('0xa'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x191b('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x191b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x191b('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x191b('0xd'),_0x191b('0xe'),_0x191b('0xf'),_0x191b('0x10')),'defaultValue':_0x191b('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x191b('0x11')],'defaultValue':function(){return _0x191b('0x12');}},'notificationSound':{'type':Sequelize[_0x191b('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x191b('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x191b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x191b('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x191b('0x13')],'defaultValue':![],'comment':_0x191b('0x14'),'set':function(_0x29cf96){if(!_0x29cf96)this[_0x191b('0x15')]('mandatoryDispositionPauseId',null);this[_0x191b('0x15')](_0x191b('0x16'),_0x29cf96);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 995d978..64ea57f 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 _0xe980=['updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','save','update','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','filter','options','includeAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','find','userProfileId','describe','FaxAccountId','Disposition','getDispositions','findOne','nolimit','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','include','findAll','removeAnswers','addInteraction','FaxInteraction','omit','Contact','internal','Tag','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','priority','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','modem','t38timeout','Wait','/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'];(function(_0x5da5f5,_0x98d93d){var _0x2ee442=function(_0x3e7c1b){while(--_0x3e7c1b){_0x5da5f5['push'](_0x5da5f5['shift']());}};_0x2ee442(++_0x98d93d);}(_0xe980,0xf1));var _0x0e98=function(_0x160cab,_0x32a84d){_0x160cab=_0x160cab-0x0;var _0xe69f26=_0xe980[_0x160cab];return _0xe69f26;};'use strict';var emlformat=require(_0x0e98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e98('0x1'));var jsonpatch=require(_0x0e98('0x2'));var rp=require('request-promise');var moment=require(_0x0e98('0x3'));var BPromise=require(_0x0e98('0x4'));var Mustache=require(_0x0e98('0x5'));var util=require(_0x0e98('0x6'));var path=require(_0x0e98('0x7'));var sox=require(_0x0e98('0x8'));var csv=require('to-csv');var ejs=require(_0x0e98('0x9'));var fs=require('fs');var fs_extra=require(_0x0e98('0xa'));var _=require(_0x0e98('0xb'));var squel=require('squel');var crypto=require(_0x0e98('0xc'));var jsforce=require(_0x0e98('0xd'));var deskjs=require(_0x0e98('0xe'));var toCsv=require(_0x0e98('0xf'));var querystring=require(_0x0e98('0x10'));var Papa=require(_0x0e98('0x11'));var Redis=require(_0x0e98('0x12'));var authService=require(_0x0e98('0x13'));var qs=require(_0x0e98('0x14'));var as=require(_0x0e98('0x15'));var hardwareService=require(_0x0e98('0x16'));var logger=require(_0x0e98('0x17'))(_0x0e98('0x18'));var utils=require(_0x0e98('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x0e98('0x1a')](config[_0x0e98('0x1b')],{'host':_0x0e98('0x1c'),'port':0x18eb});var socket=require(_0x0e98('0x1d'))(new Redis(config[_0x0e98('0x1b')]));require(_0x0e98('0x1e'))[_0x0e98('0x1f')](socket);var jayson=require(_0x0e98('0x20'));var client=jayson[_0x0e98('0x21')]['http']({'port':0x232c});var client9002=jayson['client'][_0x0e98('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xb3eec4,_0x12dd51,_0x10919c,_0x285545){return new BPromise(function(_0x3f6b7a,_0x4fe0b4){var _0x4085ab=_0x285545||client;return _0x4085ab[_0x0e98('0x23')](_0xb3eec4,_0x10919c)[_0x0e98('0x24')](function(_0x818c17){logger[_0x0e98('0x25')](_0x0e98('0x26'),_0x12dd51,_0x0e98('0x27'));logger[_0x0e98('0x28')](_0x0e98('0x29'),_0x12dd51,_0x0e98('0x27'),JSON[_0x0e98('0x2a')](_0x818c17));if(_0x818c17[_0x0e98('0x2b')]){if(_0x818c17[_0x0e98('0x2b')][_0x0e98('0x2c')]===0x1f4){logger[_0x0e98('0x2b')](_0x0e98('0x26'),_0x12dd51,_0x818c17['error'][_0x0e98('0x2d')]);return _0x4fe0b4(_0x818c17[_0x0e98('0x2b')]['message']);}logger[_0x0e98('0x2b')](_0x0e98('0x26'),_0x12dd51,_0x818c17[_0x0e98('0x2b')][_0x0e98('0x2d')]);return _0x3f6b7a(_0x818c17['error'][_0x0e98('0x2d')]);}else{logger[_0x0e98('0x25')](_0x0e98('0x26'),_0x12dd51,_0x0e98('0x27'));_0x3f6b7a(_0x818c17[_0x0e98('0x2e')]['message']);}})['catch'](function(_0x49ebc3){logger[_0x0e98('0x2b')](_0x0e98('0x26'),_0x12dd51,_0x49ebc3);_0x4fe0b4(_0x49ebc3);});});}function respondWithStatusCode(_0x578cf5,_0x27f173){_0x27f173=_0x27f173||0xcc;return function(_0x45e572){if(_0x45e572){return _0x578cf5[_0x0e98('0x2f')](_0x27f173);}return _0x578cf5[_0x0e98('0x30')](_0x27f173)[_0x0e98('0x31')]();};}function respondWithResult(_0x4d46ac,_0x36ad1a){_0x36ad1a=_0x36ad1a||0xc8;return function(_0x583596){if(_0x583596){return _0x4d46ac[_0x0e98('0x30')](_0x36ad1a)[_0x0e98('0x32')](_0x583596);}};}function respondWithFilteredResult(_0x347b61,_0x263675){return function(_0x3b9a42){if(_0x3b9a42){var _0x10ac38=typeof _0x263675[_0x0e98('0x33')]===_0x0e98('0x34')&&typeof _0x263675[_0x0e98('0x35')]===_0x0e98('0x34');var _0x24f0ce=_0x3b9a42[_0x0e98('0x36')];var _0x467381=_0x10ac38?0x0:_0x263675['offset'];var _0xb21983=_0x10ac38?_0x3b9a42[_0x0e98('0x36')]:_0x263675[_0x0e98('0x33')]+_0x263675[_0x0e98('0x35')];var _0x42409e;if(_0xb21983>=_0x24f0ce){_0xb21983=_0x24f0ce;_0x42409e=0xc8;}else{_0x42409e=0xce;}_0x347b61[_0x0e98('0x30')](_0x42409e);return _0x347b61['set']('Content-Range',_0x467381+'-'+_0xb21983+'/'+_0x24f0ce)[_0x0e98('0x32')](_0x3b9a42);}return null;};}function patchUpdates(_0x38e42d){return function(_0x43260c){try{jsonpatch['apply'](_0x43260c,_0x38e42d,!![]);}catch(_0x30174c){return BPromise['reject'](_0x30174c);}return _0x43260c[_0x0e98('0x37')]();};}function saveUpdates(_0x480a07,_0x2e6350){return function(_0xd11202){if(_0xd11202){return _0xd11202[_0x0e98('0x38')](_0x480a07)['then'](function(_0x2fb6d8){return _0x2fb6d8;});}return null;};}function removeEntity(_0x34d4e8,_0x262785){return function(_0x12b7af){if(_0x12b7af){return _0x12b7af[_0x0e98('0x39')]()['then'](function(){var _0x15e8f5=_0x12b7af[_0x0e98('0x3a')]({'plain':!![]});var _0x369cb2='FaxAccounts';return db['UserProfileResource'][_0x0e98('0x39')]({'where':{'type':_0x369cb2,'resourceId':_0x15e8f5['id']}})[_0x0e98('0x24')](function(){return _0x12b7af;});})[_0x0e98('0x24')](function(){_0x34d4e8[_0x0e98('0x30')](0xcc)[_0x0e98('0x31')]();});}};}function handleEntityNotFound(_0x4af7e2,_0x59273e){return function(_0x43d86a){if(!_0x43d86a){_0x4af7e2[_0x0e98('0x2f')](0x194);}return _0x43d86a;};}function handleError(_0x3cae77,_0x35aec1){_0x35aec1=_0x35aec1||0x1f4;return function(_0x1ba7d6){logger[_0x0e98('0x2b')](_0x1ba7d6[_0x0e98('0x3b')]);if(_0x1ba7d6[_0x0e98('0x3c')]){delete _0x1ba7d6[_0x0e98('0x3c')];}_0x3cae77[_0x0e98('0x30')](_0x35aec1)[_0x0e98('0x3d')](_0x1ba7d6);};}exports[_0x0e98('0x3e')]=function(_0x2759ef,_0x3d468d){var _0x372508={'include':[{'model':db[_0x0e98('0x3f')],'as':_0x0e98('0x40')}]},_0x58d0d8={},_0x5edddd={'count':0x0,'rows':[]};var _0x511953=_['map'](db[_0x0e98('0x41')][_0x0e98('0x42')],function(_0x15ef10){return{'name':_0x15ef10['fieldName'],'type':_0x15ef10[_0x0e98('0x43')][_0x0e98('0x44')]};});_0x58d0d8[_0x0e98('0x45')]=_[_0x0e98('0x46')](_0x511953,_0x0e98('0x3c'));_0x58d0d8[_0x0e98('0x47')]=_[_0x0e98('0x48')](_0x2759ef['query']);_0x58d0d8[_0x0e98('0x49')]=_[_0x0e98('0x4a')](_0x58d0d8[_0x0e98('0x45')],_0x58d0d8[_0x0e98('0x47')]);_0x372508[_0x0e98('0x4b')]=_[_0x0e98('0x4a')](_0x58d0d8[_0x0e98('0x45')],qs[_0x0e98('0x4c')](_0x2759ef[_0x0e98('0x47')][_0x0e98('0x4c')]));_0x372508['attributes']=_0x372508[_0x0e98('0x4b')][_0x0e98('0x4d')]?_0x372508[_0x0e98('0x4b')]:_0x58d0d8[_0x0e98('0x45')];if(!_0x2759ef['query'][_0x0e98('0x4e')]('nolimit')){_0x372508[_0x0e98('0x35')]=qs[_0x0e98('0x35')](_0x2759ef['query'][_0x0e98('0x35')]);_0x372508['offset']=qs['offset'](_0x2759ef[_0x0e98('0x47')][_0x0e98('0x33')]);}_0x372508['order']=qs[_0x0e98('0x4f')](_0x2759ef[_0x0e98('0x47')][_0x0e98('0x4f')]);_0x372508['where']=qs[_0x0e98('0x49')](_[_0x0e98('0x50')](_0x2759ef['query'],_0x58d0d8['filters']),_0x511953);if(_0x2759ef['query']['filter']){_0x372508[_0x0e98('0x51')]=_[_0x0e98('0x52')](_0x372508['where'],{'$or':_[_0x0e98('0x46')](_0x511953,function(_0x23aa9b){if(_0x23aa9b[_0x0e98('0x43')]!=='VIRTUAL'){var _0x17121e={};_0x17121e[_0x23aa9b[_0x0e98('0x3c')]]={'$like':'%'+_0x2759ef['query'][_0x0e98('0x53')]+'%'};return _0x17121e;}})});}_0x372508=_[_0x0e98('0x52')]({},_0x372508,_0x2759ef[_0x0e98('0x54')]);var _0x5a80c5={'where':_0x372508[_0x0e98('0x51')]};return db[_0x0e98('0x41')][_0x0e98('0x36')](_0x5a80c5)[_0x0e98('0x24')](function(_0x566550){_0x5edddd['count']=_0x566550;if(_0x2759ef[_0x0e98('0x47')][_0x0e98('0x55')]){_0x372508['include']=[{'all':!![]}];}return db[_0x0e98('0x41')]['findAll'](_0x372508);})['then'](function(_0x168388){_0x5edddd[_0x0e98('0x56')]=_0x168388;return _0x5edddd;})[_0x0e98('0x24')](respondWithFilteredResult(_0x3d468d,_0x372508))['catch'](handleError(_0x3d468d,null));};exports[_0x0e98('0x57')]=function(_0x366631,_0xd50f82){var _0x1e83db={'raw':![],'where':{'id':_0x366631[_0x0e98('0x58')]['id']},'include':[{'model':db[_0x0e98('0x3f')],'as':_0x0e98('0x40')}]},_0x2e5b80={};_0x2e5b80[_0x0e98('0x45')]=_['keys'](db['FaxAccount'][_0x0e98('0x42')]);_0x2e5b80['query']=_['keys'](_0x366631[_0x0e98('0x47')]);_0x2e5b80['filters']=_[_0x0e98('0x4a')](_0x2e5b80[_0x0e98('0x45')],_0x2e5b80[_0x0e98('0x47')]);_0x1e83db[_0x0e98('0x4b')]=_[_0x0e98('0x4a')](_0x2e5b80[_0x0e98('0x45')],qs[_0x0e98('0x4c')](_0x366631[_0x0e98('0x47')][_0x0e98('0x4c')]));_0x1e83db[_0x0e98('0x4b')]=_0x1e83db['attributes']['length']?_0x1e83db['attributes']:_0x2e5b80[_0x0e98('0x45')];if(_0x366631[_0x0e98('0x47')]['includeAll']){_0x1e83db['include']=[{'all':!![]}];}_0x1e83db=_[_0x0e98('0x52')]({},_0x1e83db,_0x366631['options']);return db[_0x0e98('0x41')]['find'](_0x1e83db)[_0x0e98('0x24')](handleEntityNotFound(_0xd50f82,null))[_0x0e98('0x24')](respondWithResult(_0xd50f82,null))[_0x0e98('0x59')](handleError(_0xd50f82,null));};exports[_0x0e98('0x5a')]=function(_0x1df2a3,_0x341418){return db[_0x0e98('0x41')]['create'](_0x1df2a3[_0x0e98('0x5b')],{})[_0x0e98('0x24')](function(_0x3a5d40){var _0x42b63f=_0x1df2a3[_0x0e98('0x5c')][_0x0e98('0x3a')]({'plain':!![]});if(!_0x42b63f)throw new Error(_0x0e98('0x5d'));if(_0x42b63f[_0x0e98('0x5e')]===_0x0e98('0x5c')){var _0x229ef2=_0x3a5d40[_0x0e98('0x3a')]({'plain':!![]});var _0x1c1e91=_0x0e98('0x5f');return db[_0x0e98('0x60')][_0x0e98('0x61')]({'where':{'name':_0x1c1e91,'userProfileId':_0x42b63f[_0x0e98('0x62')]},'raw':!![]})[_0x0e98('0x24')](function(_0x56e76f){if(_0x56e76f&&_0x56e76f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x229ef2[_0x0e98('0x3c')],'resourceId':_0x229ef2['id'],'type':_0x56e76f[_0x0e98('0x3c')],'sectionId':_0x56e76f['id']},{})[_0x0e98('0x24')](function(){return _0x3a5d40;});}else{return _0x3a5d40;}})[_0x0e98('0x59')](function(_0x229be1){logger[_0x0e98('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x229be1);throw _0x229be1;});}return _0x3a5d40;})[_0x0e98('0x24')](respondWithResult(_0x341418,0xc9))[_0x0e98('0x59')](handleError(_0x341418,null));};exports[_0x0e98('0x38')]=function(_0x17f0b3,_0x22f088){if(_0x17f0b3[_0x0e98('0x5b')]['id']){delete _0x17f0b3[_0x0e98('0x5b')]['id'];}return db[_0x0e98('0x41')][_0x0e98('0x61')]({'where':{'id':_0x17f0b3[_0x0e98('0x58')]['id']},'include':[{'model':db[_0x0e98('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x0e98('0x24')](handleEntityNotFound(_0x22f088,null))[_0x0e98('0x24')](saveUpdates(_0x17f0b3[_0x0e98('0x5b')],null))[_0x0e98('0x24')](respondWithResult(_0x22f088,null))[_0x0e98('0x59')](handleError(_0x22f088,null));};exports['destroy']=function(_0x27780b,_0x580b38){return db[_0x0e98('0x41')][_0x0e98('0x61')]({'where':{'id':_0x27780b[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x580b38,null))['then'](removeEntity(_0x580b38,null))[_0x0e98('0x59')](handleError(_0x580b38,null));};exports[_0x0e98('0x63')]=function(_0x3f8ec5,_0x1acd3f){return db[_0x0e98('0x41')][_0x0e98('0x63')]()['then'](respondWithResult(_0x1acd3f,null))['catch'](handleError(_0x1acd3f,null));};exports['addDisposition']=function(_0x38179c,_0x392c8c,_0x307798){if(_0x38179c[_0x0e98('0x5b')]['id']){delete _0x38179c[_0x0e98('0x5b')]['id'];}return db[_0x0e98('0x41')][_0x0e98('0x61')]({'where':{'id':_0x38179c[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x392c8c,null))['then'](function(_0x55ffac){if(_0x55ffac){_0x38179c[_0x0e98('0x5b')][_0x0e98('0x64')]=_0x55ffac['id'];return db[_0x0e98('0x65')]['create'](_0x38179c[_0x0e98('0x5b')]);}})[_0x0e98('0x24')](respondWithResult(_0x392c8c,null))[_0x0e98('0x59')](handleError(_0x392c8c,null));};exports[_0x0e98('0x66')]=function(_0x2eac27,_0x26ba49,_0x2c0e96){var _0x5a566f={'raw':![],'where':{}};var _0x9b9441={};var _0x34d599={'count':0x0,'rows':[]};return db[_0x0e98('0x41')][_0x0e98('0x67')]({'where':{'id':_0x2eac27[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x26ba49,null))[_0x0e98('0x24')](function(_0x453299){if(_0x453299){_0x9b9441['model']=_[_0x0e98('0x48')](db[_0x0e98('0x65')][_0x0e98('0x42')]);_0x9b9441[_0x0e98('0x47')]=_[_0x0e98('0x48')](_0x2eac27['query']);_0x9b9441[_0x0e98('0x49')]=_[_0x0e98('0x4a')](_0x9b9441[_0x0e98('0x45')],_0x9b9441[_0x0e98('0x47')]);_0x5a566f[_0x0e98('0x4b')]=_[_0x0e98('0x4a')](_0x9b9441[_0x0e98('0x45')],qs['fields'](_0x2eac27['query'][_0x0e98('0x4c')]));_0x5a566f[_0x0e98('0x4b')]=_0x5a566f[_0x0e98('0x4b')]['length']?_0x5a566f[_0x0e98('0x4b')]:_0x9b9441[_0x0e98('0x45')];if(!_0x2eac27[_0x0e98('0x47')][_0x0e98('0x4e')](_0x0e98('0x68'))){_0x5a566f[_0x0e98('0x35')]=qs[_0x0e98('0x35')](_0x2eac27[_0x0e98('0x47')][_0x0e98('0x35')]);_0x5a566f['offset']=qs['offset'](_0x2eac27['query'][_0x0e98('0x33')]);}_0x5a566f[_0x0e98('0x69')]=qs[_0x0e98('0x4f')](_0x2eac27[_0x0e98('0x47')][_0x0e98('0x4f')]);_0x5a566f[_0x0e98('0x51')]=qs['filters'](_[_0x0e98('0x50')](_0x2eac27[_0x0e98('0x47')],_0x9b9441[_0x0e98('0x49')]));_0x5a566f['where'][_0x0e98('0x64')]=_0x453299['id'];if(_0x2eac27[_0x0e98('0x47')][_0x0e98('0x53')]){_0x5a566f[_0x0e98('0x51')]=_[_0x0e98('0x52')](_0x5a566f['where'],{'$or':_[_0x0e98('0x46')](_0x5a566f['attributes'],function(_0x49b3f7){var _0x407f66={};_0x407f66[_0x49b3f7]={'$like':'%'+_0x2eac27[_0x0e98('0x47')][_0x0e98('0x53')]+'%'};return _0x407f66;})});}_0x5a566f=_[_0x0e98('0x52')]({},_0x5a566f,_0x2eac27[_0x0e98('0x54')]);return db[_0x0e98('0x65')]['count']({'where':_0x5a566f[_0x0e98('0x51')]})[_0x0e98('0x24')](function(_0x4250d0){_0x34d599[_0x0e98('0x36')]=_0x4250d0;if(_0x2eac27['query']['includeAll']){_0x5a566f['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5a566f);})[_0x0e98('0x24')](function(_0x5cc483){_0x34d599[_0x0e98('0x56')]=_0x5cc483;return _0x34d599;});}})['then'](respondWithFilteredResult(_0x26ba49,_0x5a566f))[_0x0e98('0x59')](handleError(_0x26ba49,null));};exports['removeDispositions']=function(_0x15315d,_0x5cf546,_0x4cc001){return db[_0x0e98('0x41')][_0x0e98('0x61')]({'where':{'id':_0x15315d['params']['id']}})['then'](handleEntityNotFound(_0x5cf546,null))['then'](function(_0x267dc8){if(_0x267dc8){return _0x267dc8[_0x0e98('0x6a')](_0x15315d[_0x0e98('0x47')][_0x0e98('0x6b')]);}})[_0x0e98('0x24')](respondWithStatusCode(_0x5cf546,null))['catch'](handleError(_0x5cf546,null));};exports[_0x0e98('0x6c')]=function(_0x343275,_0xeaa08,_0xb3714a){if(_0x343275[_0x0e98('0x5b')]['id']){delete _0x343275[_0x0e98('0x5b')]['id'];}return db[_0x0e98('0x41')][_0x0e98('0x61')]({'where':{'id':_0x343275['params']['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0xeaa08,null))['then'](function(_0x3cb41c){if(_0x3cb41c){_0x343275['body'][_0x0e98('0x64')]=_0x3cb41c['id'];return db['CannedAnswer'][_0x0e98('0x5a')](_0x343275['body']);}})[_0x0e98('0x24')](respondWithResult(_0xeaa08,null))[_0x0e98('0x59')](handleError(_0xeaa08,null));};exports[_0x0e98('0x6d')]=function(_0x528261,_0x53542a,_0x277c25){var _0xd61d1c={'raw':![],'where':{}};var _0x19e240={};var _0x21689c={'count':0x0,'rows':[]};return db[_0x0e98('0x41')][_0x0e98('0x67')]({'where':{'id':_0x528261[_0x0e98('0x58')]['id']}})['then'](handleEntityNotFound(_0x53542a,null))[_0x0e98('0x24')](function(_0x4627e8){if(_0x4627e8){_0x19e240[_0x0e98('0x45')]=_[_0x0e98('0x48')](db[_0x0e98('0x6e')]['rawAttributes']);_0x19e240['query']=_[_0x0e98('0x48')](_0x528261['query']);_0x19e240[_0x0e98('0x49')]=_['intersection'](_0x19e240[_0x0e98('0x45')],_0x19e240[_0x0e98('0x47')]);_0xd61d1c[_0x0e98('0x4b')]=_[_0x0e98('0x4a')](_0x19e240['model'],qs[_0x0e98('0x4c')](_0x528261[_0x0e98('0x47')]['fields']));_0xd61d1c[_0x0e98('0x4b')]=_0xd61d1c[_0x0e98('0x4b')][_0x0e98('0x4d')]?_0xd61d1c[_0x0e98('0x4b')]:_0x19e240[_0x0e98('0x45')];if(!_0x528261[_0x0e98('0x47')][_0x0e98('0x4e')](_0x0e98('0x68'))){_0xd61d1c[_0x0e98('0x35')]=qs[_0x0e98('0x35')](_0x528261[_0x0e98('0x47')][_0x0e98('0x35')]);_0xd61d1c[_0x0e98('0x33')]=qs['offset'](_0x528261[_0x0e98('0x47')][_0x0e98('0x33')]);}_0xd61d1c[_0x0e98('0x69')]=qs[_0x0e98('0x4f')](_0x528261[_0x0e98('0x47')]['sort']);_0xd61d1c[_0x0e98('0x51')]=qs[_0x0e98('0x49')](_['pick'](_0x528261[_0x0e98('0x47')],_0x19e240[_0x0e98('0x49')]));_0xd61d1c[_0x0e98('0x51')][_0x0e98('0x64')]=_0x4627e8['id'];if(_0x528261[_0x0e98('0x47')][_0x0e98('0x53')]){_0xd61d1c['where']=_[_0x0e98('0x52')](_0xd61d1c[_0x0e98('0x51')],{'$or':_[_0x0e98('0x46')](_0xd61d1c['attributes'],function(_0xb30d36){var _0x113bc7={};_0x113bc7[_0xb30d36]={'$like':'%'+_0x528261[_0x0e98('0x47')][_0x0e98('0x53')]+'%'};return _0x113bc7;})});}_0xd61d1c=_[_0x0e98('0x52')]({},_0xd61d1c,_0x528261[_0x0e98('0x54')]);return db[_0x0e98('0x6e')][_0x0e98('0x36')]({'where':_0xd61d1c[_0x0e98('0x51')]})['then'](function(_0x4b7d0b){_0x21689c[_0x0e98('0x36')]=_0x4b7d0b;if(_0x528261[_0x0e98('0x47')][_0x0e98('0x55')]){_0xd61d1c[_0x0e98('0x6f')]=[{'all':!![]}];}return db[_0x0e98('0x6e')][_0x0e98('0x70')](_0xd61d1c);})['then'](function(_0x4588d4){_0x21689c[_0x0e98('0x56')]=_0x4588d4;return _0x21689c;});}})[_0x0e98('0x24')](respondWithFilteredResult(_0x53542a,_0xd61d1c))[_0x0e98('0x59')](handleError(_0x53542a,null));};exports[_0x0e98('0x71')]=function(_0x31ea31,_0x4a030b,_0x116e81){return db[_0x0e98('0x41')]['find']({'where':{'id':_0x31ea31[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x4a030b,null))[_0x0e98('0x24')](function(_0x819e07){if(_0x819e07){return _0x819e07[_0x0e98('0x71')](_0x31ea31['query'][_0x0e98('0x6b')]);}})[_0x0e98('0x24')](respondWithStatusCode(_0x4a030b,null))[_0x0e98('0x59')](handleError(_0x4a030b,null));};exports[_0x0e98('0x72')]=function(_0x49f576,_0x1978d6,_0x5bf3ad){return db[_0x0e98('0x73')][_0x0e98('0x61')]({'where':{'id':_0x49f576[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x1978d6,null))[_0x0e98('0x24')](function(_0xe15e7e){if(_0xe15e7e){return _0xe15e7e['addInteraction'](_0x49f576[_0x0e98('0x5b')]['ids'],_[_0x0e98('0x74')](_0x49f576[_0x0e98('0x5b')],['ids','id'])||{});}})[_0x0e98('0x24')](respondWithResult(_0x1978d6,null))['catch'](handleError(_0x1978d6,null));};exports['getInteractions']=function(_0x46921d,_0x580cfd,_0x1c0807){var _0x42101c={'raw':![],'where':{}};var _0xf0667e={};var _0x580342={'count':0x0,'rows':[]};return db[_0x0e98('0x41')][_0x0e98('0x67')]({'where':{'id':_0x46921d[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x580cfd,null))[_0x0e98('0x24')](function(_0x2abe56){if(_0x2abe56){_0xf0667e[_0x0e98('0x45')]=_['keys'](db[_0x0e98('0x73')][_0x0e98('0x42')]);_0xf0667e['query']=_[_0x0e98('0x48')](_0x46921d['query']);_0xf0667e[_0x0e98('0x49')]=_['intersection'](_0xf0667e['model'],_0xf0667e['query']);_0x42101c[_0x0e98('0x4b')]=_[_0x0e98('0x4a')](_0xf0667e[_0x0e98('0x45')],qs[_0x0e98('0x4c')](_0x46921d['query'][_0x0e98('0x4c')]));_0x42101c['attributes']=_0x42101c[_0x0e98('0x4b')][_0x0e98('0x4d')]?_0x42101c[_0x0e98('0x4b')]:_0xf0667e[_0x0e98('0x45')];if(!_0x46921d['query'][_0x0e98('0x4e')](_0x0e98('0x68'))){_0x42101c[_0x0e98('0x35')]=qs[_0x0e98('0x35')](_0x46921d[_0x0e98('0x47')][_0x0e98('0x35')]);_0x42101c[_0x0e98('0x33')]=qs[_0x0e98('0x33')](_0x46921d[_0x0e98('0x47')][_0x0e98('0x33')]);}_0x42101c[_0x0e98('0x69')]=qs[_0x0e98('0x4f')](_0x46921d[_0x0e98('0x47')][_0x0e98('0x4f')]);_0x42101c['where']=qs[_0x0e98('0x49')](_['pick'](_0x46921d[_0x0e98('0x47')],_0xf0667e['filters']));_0x42101c[_0x0e98('0x51')]['FaxAccountId']=_0x2abe56['id'];if(_0x46921d['query'][_0x0e98('0x53')]){_0x42101c[_0x0e98('0x51')]=_[_0x0e98('0x52')](_0x42101c[_0x0e98('0x51')],{'$or':_['map'](_0x42101c[_0x0e98('0x4b')],function(_0x510d2e){var _0x34e02d={};_0x34e02d[_0x510d2e]={'$like':'%'+_0x46921d[_0x0e98('0x47')][_0x0e98('0x53')]+'%'};return _0x34e02d;})});}_0x42101c=_['merge']({},_0x42101c,_0x46921d['options']);return db[_0x0e98('0x73')][_0x0e98('0x36')]({'where':_0x42101c[_0x0e98('0x51')]})[_0x0e98('0x24')](function(_0x1a8303){_0x580342[_0x0e98('0x36')]=_0x1a8303;if(_0x46921d[_0x0e98('0x47')][_0x0e98('0x55')]){_0x42101c['include']=[{'model':db['CmContact'],'as':_0x0e98('0x75'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name','fullname',_0x0e98('0x76')],'required':![]},{'model':db[_0x0e98('0x77')],'as':_0x0e98('0x78'),'attributes':['id','name','color'],'where':_0x46921d[_0x0e98('0x47')][_0x0e98('0x79')]?{'id':_0x46921d[_0x0e98('0x47')]['tag']}:undefined,'required':_0x46921d[_0x0e98('0x47')][_0x0e98('0x79')]?!![]:![]}];}return db[_0x0e98('0x73')][_0x0e98('0x70')](_0x42101c);})['then'](function(_0x11caf2){_0x580342['rows']=_0x11caf2;return _0x580342;});}})[_0x0e98('0x24')](respondWithFilteredResult(_0x580cfd,_0x42101c))[_0x0e98('0x59')](handleError(_0x580cfd,null));};exports[_0x0e98('0x7a')]=function(_0x3524a2,_0x4f8c62){var _0x2f2be9=_0x3524a2[_0x0e98('0x58')]['id'];var _0x49b80e=_0x3524a2[_0x0e98('0x5b')];var _0x5b199f=0xc8;var _0x18248c=null;return db[_0x0e98('0x7b')]['transaction']({'isolationLevel':db[_0x0e98('0x7b')][_0x0e98('0x7c')][_0x0e98('0x7d')]['READ_COMMITTED']},function(_0x3e0fee){return db['FaxAccount'][_0x0e98('0x67')]({'where':{'id':_0x2f2be9},'transaction':_0x3e0fee})[_0x0e98('0x24')](function(_0x2afe66){if(_0x2afe66){return db['FaxApplication'][_0x0e98('0x39')]({'where':{'FaxAccountId':_0x2f2be9},'transaction':_0x3e0fee})[_0x0e98('0x24')](function(){var _0x36d8cc=_[_0x0e98('0x46')](_0x49b80e,function(_0x4dc499){_0x4dc499[_0x0e98('0x64')]=_0x2f2be9;return _0x4dc499;});return db[_0x0e98('0x7e')][_0x0e98('0x7f')](_0x36d8cc,{'transaction':_0x3e0fee});});}else{_0x5b199f=0x194;_0x18248c=[];}});})['then'](function(){if(_0x5b199f!==0x194){return db[_0x0e98('0x7e')][_0x0e98('0x80')]({'where':{'FaxAccountId':_0x2f2be9},'order':'priority'})[_0x0e98('0x24')](function(_0xa3d00){_0x18248c=_0xa3d00;});}})[_0x0e98('0x59')](function(_0x1b4a44){_0x5b199f=0x1f4;logger[_0x0e98('0x2b')](_0x1b4a44[_0x0e98('0x3b')]);if(_0x1b4a44['name']){delete _0x1b4a44[_0x0e98('0x3c')];}_0x18248c=_0x1b4a44;})[_0x0e98('0x81')](function(){if(_0x18248c===null){_0x4f8c62['sendStatus'](_0x5b199f);}else{if(_0x5b199f===0x1f4){_0x4f8c62['status'](_0x5b199f)[_0x0e98('0x3d')](_0x18248c);}else{_0x4f8c62[_0x0e98('0x30')](_0x5b199f)['json'](_0x18248c);}}});};exports[_0x0e98('0x82')]=function(_0x4e2692,_0x552485,_0x5e5140){var _0x40755b={};var _0x58902a={};var _0x3c9d1d;var _0x3ef54b;return db['FaxAccount'][_0x0e98('0x67')]({'where':{'id':_0x4e2692[_0x0e98('0x58')]['id']}})['then'](handleEntityNotFound(_0x552485,null))['then'](function(_0x3478a8){if(_0x3478a8){_0x3c9d1d=_0x3478a8;_0x58902a[_0x0e98('0x45')]=_[_0x0e98('0x48')](db[_0x0e98('0x7e')][_0x0e98('0x42')]);_0x58902a['query']=_[_0x0e98('0x48')](_0x4e2692[_0x0e98('0x47')]);_0x58902a[_0x0e98('0x49')]=_[_0x0e98('0x4a')](_0x58902a['model'],_0x58902a[_0x0e98('0x47')]);_0x40755b[_0x0e98('0x4b')]=_['intersection'](_0x58902a[_0x0e98('0x45')],qs[_0x0e98('0x4c')](_0x4e2692[_0x0e98('0x47')]['fields']));_0x40755b['attributes']=_0x40755b['attributes'][_0x0e98('0x4d')]?_0x40755b['attributes']:_0x58902a[_0x0e98('0x45')];_0x40755b[_0x0e98('0x69')]=qs[_0x0e98('0x4f')](_0x4e2692['query'][_0x0e98('0x4f')]);_0x40755b[_0x0e98('0x51')]=qs[_0x0e98('0x49')](_[_0x0e98('0x50')](_0x4e2692[_0x0e98('0x47')],_0x58902a[_0x0e98('0x49')]));if(_0x4e2692[_0x0e98('0x47')][_0x0e98('0x53')]){_0x40755b['where']=_[_0x0e98('0x52')](_0x40755b['where'],{'$or':_[_0x0e98('0x46')](_0x40755b[_0x0e98('0x4b')],function(_0x3065ef){var _0x3070c3={};_0x3070c3[_0x3065ef]={'$like':'%'+_0x4e2692['query'][_0x0e98('0x53')]+'%'};return _0x3070c3;})});}_0x40755b=_[_0x0e98('0x52')]({},_0x40755b,_0x4e2692['options']);return _0x3c9d1d[_0x0e98('0x82')](_0x40755b);}})[_0x0e98('0x24')](function(_0x3a72a1){if(_0x3a72a1){_0x3ef54b=_0x3a72a1['length'];if(!_0x4e2692[_0x0e98('0x47')][_0x0e98('0x4e')](_0x0e98('0x68'))){_0x40755b[_0x0e98('0x35')]=qs[_0x0e98('0x35')](_0x4e2692['query']['limit']);_0x40755b[_0x0e98('0x33')]=qs[_0x0e98('0x33')](_0x4e2692['query'][_0x0e98('0x33')]);}return _0x3c9d1d[_0x0e98('0x82')](_0x40755b);}})[_0x0e98('0x24')](function(_0x2de743){if(_0x2de743){return _0x2de743?{'count':_0x3ef54b,'rows':_0x2de743}:null;}})['then'](respondWithResult(_0x552485,null))[_0x0e98('0x59')](handleError(_0x552485,null));};function Extension(_0x44a601,_0xd6b9f0,_0x532d2a,_0x4c068d){this[_0x0e98('0x83')]=_0x0e98('0x84');this[_0x0e98('0x85')]=_0x44a601[_0x0e98('0x86')];this[_0x0e98('0x87')]=_0x4c068d;this[_0x0e98('0x43')]='system';this[_0x0e98('0x88')]=_0x0e98('0x89');this[_0x0e98('0x64')]=_0x44a601['id'];this[_0x0e98('0x8a')]=_0xd6b9f0;this['appdata']=_0x532d2a;}function createExtensionsReciveFax(_0x102fac){var _0x1aafe1=0x1;var _0x24eacb=[];_0x24eacb[_0x0e98('0x8b')](new Extension(_0x102fac,_0x1aafe1,'','Answer'));_0x1aafe1+=0x1;_0x24eacb[_0x0e98('0x8b')](new Extension(_0x102fac,_0x1aafe1,_0x0e98('0x8c'),_0x0e98('0x8d')));_0x1aafe1+=0x1;for(var _0x5e580d in _0x102fac){if(_0x102fac[_0x0e98('0x4e')](_0x5e580d)&&(_0x5e580d===_0x0e98('0x8e')||_0x5e580d===_0x0e98('0x86')||_0x5e580d===_0x0e98('0x8f')||_0x5e580d===_0x0e98('0x90')||_0x5e580d==='headerinfo'||_0x5e580d===_0x0e98('0x91')||_0x5e580d==='minrate'||_0x5e580d===_0x0e98('0x92')||_0x5e580d===_0x0e98('0x93'))){_0x24eacb[_0x0e98('0x8b')](new Extension(_0x102fac,_0x1aafe1,'FAXOPT('+_0x5e580d+')='+_0x102fac[_0x5e580d],_0x0e98('0x8d')));_0x1aafe1+=0x1;}}_0x24eacb[_0x0e98('0x8b')](new Extension(_0x102fac,_0x1aafe1,'6',_0x0e98('0x94')));_0x1aafe1+=0x1;_0x24eacb[_0x0e98('0x8b')](new Extension(_0x102fac,_0x1aafe1,_0x0e98('0x95'),_0x0e98('0x96')));_0x1aafe1=0x0;return _0x24eacb;}exports[_0x0e98('0x97')]=function(_0x14207e,_0x585ef2,_0x470d3f){var _0x36af1e;return db[_0x0e98('0x7b')][_0x0e98('0x98')](function(_0x27d33f){return db['FaxAccount'][_0x0e98('0x5a')](_0x14207e[_0x0e98('0x5b')],{'transaction':_0x27d33f})[_0x0e98('0x24')](function(_0x35c725){_0x36af1e=_0x35c725[_0x0e98('0x3a')]({'plain':!![]});return db['VoiceExtension'][_0x0e98('0x7f')](createExtensionsReciveFax(_0x36af1e),{'transaction':_0x27d33f});});})['then'](function(){return _0x36af1e;})[_0x0e98('0x24')](respondWithResult(_0x585ef2,null))['catch'](handleError(_0x585ef2,null));};exports[_0x0e98('0x99')]=function(_0x359e81,_0x2bd6f7,_0x427f58){var _0xdd1d39;return db[_0x0e98('0x7b')][_0x0e98('0x98')](function(_0x649dbd){return db[_0x0e98('0x41')][_0x0e98('0x38')](_0x359e81['body'],{'where':{'id':_0x359e81[_0x0e98('0x5b')]['id']},'transaction':_0x649dbd})[_0x0e98('0x24')](function(_0x199210){return db[_0x0e98('0x9a')][_0x0e98('0x39')]({'where':{'FaxAccountId':_0x359e81[_0x0e98('0x5b')]['id']},'transaction':_0x649dbd})['then'](function(_0x2689bf){return db['VoiceExtension'][_0x0e98('0x7f')](createExtensionsReciveFax(_['omit'](_0x359e81['body'],[_0x0e98('0x9b'),_0x0e98('0x44'),_0x0e98('0x9c'),_0x0e98('0x9d'),_0x0e98('0x9e'),_0x0e98('0x9f')])),{'transaction':_0x649dbd});});});})[_0x0e98('0x24')](function(){return db['FaxAccount'][_0x0e98('0xa0')](_0x359e81['body']['id']);})[_0x0e98('0x24')](respondWithResult(_0x2bd6f7,null))[_0x0e98('0x59')](handleError(_0x2bd6f7,null));};exports[_0x0e98('0xa1')]=function(_0x46f20f,_0x34e60d,_0x5c0148){var _0x3dab62={'raw':!![],'where':{}};var _0x4672ce={};var _0x2a27ce={'count':0x0,'rows':[]};return db[_0x0e98('0x41')][_0x0e98('0x67')]({'where':{'id':_0x46f20f[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x34e60d,null))[_0x0e98('0x24')](function(_0x47775d){if(_0x47775d){_0x4672ce['model']=_[_0x0e98('0x48')](db[_0x0e98('0xa2')]['rawAttributes']);_0x4672ce[_0x0e98('0x47')]=_[_0x0e98('0x48')](_0x46f20f['query']);_0x4672ce['filters']=_[_0x0e98('0x4a')](_0x4672ce[_0x0e98('0x45')],_0x4672ce[_0x0e98('0x47')]);_0x3dab62['attributes']=_[_0x0e98('0x4a')](_0x4672ce[_0x0e98('0x45')],qs[_0x0e98('0x4c')](_0x46f20f[_0x0e98('0x47')][_0x0e98('0x4c')]));_0x3dab62[_0x0e98('0x4b')]=_0x3dab62[_0x0e98('0x4b')][_0x0e98('0x4d')]?_0x3dab62[_0x0e98('0x4b')]:_0x4672ce[_0x0e98('0x45')];if(!_0x46f20f[_0x0e98('0x47')]['hasOwnProperty'](_0x0e98('0x68'))){_0x3dab62[_0x0e98('0x35')]=qs['limit'](_0x46f20f[_0x0e98('0x47')][_0x0e98('0x35')]);_0x3dab62[_0x0e98('0x33')]=qs['offset'](_0x46f20f[_0x0e98('0x47')][_0x0e98('0x33')]);}_0x3dab62[_0x0e98('0x69')]=qs[_0x0e98('0x4f')](_0x46f20f[_0x0e98('0x47')][_0x0e98('0x4f')]);_0x3dab62[_0x0e98('0x51')]=qs[_0x0e98('0x49')](_[_0x0e98('0x50')](_0x46f20f['query'],_0x4672ce['filters']));_0x3dab62[_0x0e98('0x51')][_0x0e98('0x64')]=_0x47775d['id'];if(_0x46f20f[_0x0e98('0x47')][_0x0e98('0x53')]){_0x3dab62[_0x0e98('0x51')]=_[_0x0e98('0x52')](_0x3dab62[_0x0e98('0x51')],{'$or':_['map'](_0x3dab62[_0x0e98('0x4b')],function(_0x43da0b){var _0x37e481={};_0x37e481[_0x43da0b]={'$like':'%'+_0x46f20f[_0x0e98('0x47')]['filter']+'%'};return _0x37e481;})});}if(_0x46f20f['query'][_0x0e98('0xa3')]){var _0x3d33de=_0x46f20f[_0x0e98('0x47')][_0x0e98('0xa3')]['split'](',');var _0x500ffb={};_0x500ffb[_0x3d33de[0x0]]={'$gte':moment(_0x3d33de[0x1])[_0x0e98('0xa4')](_0x0e98('0xa5'))};_0x3dab62[_0x0e98('0x51')]=_[_0x0e98('0x52')](_0x3dab62[_0x0e98('0x51')],_0x500ffb);}_0x3dab62=_[_0x0e98('0x52')]({},_0x3dab62,_0x46f20f[_0x0e98('0x54')]);return db[_0x0e98('0xa2')]['count']({'where':_0x3dab62[_0x0e98('0x51')]})['then'](function(_0x2dbd14){_0x2a27ce['count']=_0x2dbd14;if(_0x46f20f['query']['includeAll']){_0x3dab62[_0x0e98('0x6f')]=[{'all':!![]}];}return db['FaxMessage'][_0x0e98('0x70')](_0x3dab62);})[_0x0e98('0x24')](function(_0x5cc4b6){_0x2a27ce[_0x0e98('0x56')]=_0x5cc4b6;return _0x2a27ce;});}})[_0x0e98('0x24')](respondWithFilteredResult(_0x34e60d,_0x3dab62))[_0x0e98('0x59')](handleError(_0x34e60d,null));};exports[_0x0e98('0x3d')]=function(_0x211eba,_0x567fab,_0x1a5980){var _0x95007f,_0x2e1486={},_0x48cb55;if(_0x211eba[_0x0e98('0x5b')]['to']){_0x48cb55=_0x211eba['body']['to'][0x0];}return db[_0x0e98('0x41')][_0x0e98('0x61')]({'where':{'id':_0x211eba[_0x0e98('0x58')]['id']},'include':[{'model':db[_0x0e98('0xa6')],'as':_0x0e98('0xa7'),'include':[{'model':db[_0x0e98('0xa8')],'as':_0x0e98('0xa9'),'where':{'fax':_0x48cb55},'limit':0x1,'order':[[_0x0e98('0x9d'),_0x0e98('0xaa')]]}]}]})[_0x0e98('0x24')](handleEntityNotFound(_0x567fab,null))[_0x0e98('0x24')](function(_0x1e028b){_0x95007f=_0x1e028b;if(_0x211eba['body']['attachments']&&_0x211eba['body'][_0x0e98('0xab')][_0x0e98('0x4d')]){for(var _0x563880=0x0;_0x563880<_0x211eba[_0x0e98('0x5b')]['attachments']['length'];_0x563880+=0x1){_0x211eba[_0x0e98('0x5b')][_0x0e98('0xab')][_0x563880]={'filename':_0x211eba[_0x0e98('0x5b')][_0x0e98('0xab')][_0x563880][_0x0e98('0x3c')],'id':_0x211eba[_0x0e98('0x5b')][_0x0e98('0xab')][_0x563880]['id'],'path':path['join'](config[_0x0e98('0xac')],_0x0e98('0xad'),_0x211eba[_0x0e98('0x5b')]['attachments'][_0x563880]['basename'])};}}return respondWithRpcPromise(_0x0e98('0xae'),_0x0e98('0xae'),{'FaxAccountId':_[_0x0e98('0xaf')](_0x211eba['params']['id'])?undefined:_0x211eba[_0x0e98('0x58')]['id'],'path':_[_0x0e98('0xaf')](_0x211eba[_0x0e98('0x5b')][_0x0e98('0xab')][0x0][_0x0e98('0x7')])?undefined:_0x211eba[_0x0e98('0x5b')][_0x0e98('0xab')][0x0]['path'],'fax':_[_0x0e98('0xaf')](_0x211eba[_0x0e98('0x5b')]['to'][0x0])?undefined:_0x211eba[_0x0e98('0x5b')]['to'][0x0]},client9002);})[_0x0e98('0x24')](function(){if(_0x95007f){if(_['isNil'](_0x211eba[_0x0e98('0x5b')][_0x0e98('0xb0')])){_0x211eba[_0x0e98('0x5b')][_0x0e98('0xb0')]=util['format'](_0x0e98('0xb1'),_0x95007f['name'],_0x95007f[_0x0e98('0xb2')]);}if(_0x95007f['List']){if(_0x95007f[_0x0e98('0xa7')]['Contacts']['length']){return _0x95007f[_0x0e98('0xa7')][_0x0e98('0xa9')][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x211eba[_0x0e98('0x5b')],{'firstName':_0x211eba[_0x0e98('0x5b')]['to'][0x0],'phone':_0x211eba[_0x0e98('0x5b')]['to'][0x0],'fax':_0x211eba[_0x0e98('0x5b')]['to'][0x0],'ListId':_0x95007f[_0x0e98('0x9f')]}));}}else{throw new Error(_0x0e98('0xb3'));}}else{throw new Error(_0x0e98('0xb4'));}})[_0x0e98('0x24')](function(_0x41eec7){if(_0x41eec7){return db[_0x0e98('0x73')][_0x0e98('0x61')]({'where':{'ContactId':_0x41eec7['id'],'closed':![],'FaxAccountId':_0x95007f['id']}})[_0x0e98('0x24')](function(_0x5e2061){if(_0x5e2061){return[_0x5e2061,![]];}return db[_0x0e98('0x73')][_0x0e98('0x5a')]({'UserId':_0x211eba[_0x0e98('0x5c')]['id'],'ContactId':_0x41eec7['id'],'FaxAccountId':_0x95007f['id'],'fax':_0x211eba['body']['to'][0x0],'firstMsgDirection':_0x0e98('0xb5'),'Messages':[_[_0x0e98('0x52')](_0x211eba['body'],{'read':![],'body':_0x211eba[_0x0e98('0x5b')]['attachments'][0x0][_0x0e98('0xb6')],'FaxAccountId':_0x95007f['id'],'UserId':_0x211eba[_0x0e98('0x5c')]['id'],'ContactId':_0x41eec7['id'],'AttachmentId':_0x211eba['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x0e98('0xa2')],'as':_0x0e98('0xb7')}]})[_0x0e98('0x24')](function(_0x1d6d23){return[_0x1d6d23,!![]];});});}else{throw new Error(_0x0e98('0xb8'));}})['spread'](function(_0x97469a,_0x596f98){if(_0x596f98){return _0x97469a;}return db[_0x0e98('0xa2')]['create']({'direction':_0x0e98('0xb5'),'read':![],'body':_0x211eba[_0x0e98('0x5b')][_0x0e98('0xab')][0x0][_0x0e98('0xb6')],'FaxAccountId':_0x95007f['id'],'FaxInteractionId':_0x97469a['id'],'UserId':_0x211eba[_0x0e98('0x5c')]['id'],'ContactId':_0x97469a[_0x0e98('0xb9')],'AttachmentId':_0x211eba[_0x0e98('0x5b')]['attachments'][0x0]['id']})[_0x0e98('0x24')](function(_0x318a63){_0x97469a[_0x0e98('0xba')][_0x0e98('0xb7')]=[];_0x97469a[_0x0e98('0xba')][_0x0e98('0xb7')][_0x0e98('0x8b')](_0x318a63[_0x0e98('0xba')]);return _0x97469a;});})[_0x0e98('0x24')](function(_0x482968){respondWithRpcPromise(_0x0e98('0xbb'),_0x0e98('0xbb'),{'FaxAccountId':_[_0x0e98('0xaf')](_0x211eba[_0x0e98('0x58')]['id'])?undefined:_0x211eba['params']['id'],'path':_[_0x0e98('0xaf')](_0x211eba['body'][_0x0e98('0xab')][0x0][_0x0e98('0x7')])?undefined:_0x211eba['body']['attachments'][0x0][_0x0e98('0x7')],'fax':_['isNil'](_0x211eba['body']['to'][0x0])?undefined:_0x211eba[_0x0e98('0x5b')]['to'][0x0],'AttachmentId':_0x211eba[_0x0e98('0x5b')][_0x0e98('0xab')][0x0]['id']},client9002)['then'](function(_0x21fa19){logger[_0x0e98('0x25')](_0x0e98('0xbc'),_0x21fa19);})[_0x0e98('0x59')](function(_0x133ebd){logger[_0x0e98('0x25')](_0x0e98('0xbc'),_0x133ebd);});return _0x482968;})[_0x0e98('0x24')](respondWithResult(_0x567fab,null))['catch'](handleError(_0x567fab,null));};exports[_0x0e98('0xbd')]=function(_0x446f38,_0x10a1f9,_0x4049cd){return db['FaxAccount'][_0x0e98('0x61')]({'where':{'id':_0x446f38[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x10a1f9,null))[_0x0e98('0x24')](function(_0x4c1a64){if(_0x4c1a64){return _0x4c1a64[_0x0e98('0xbd')](_0x446f38[_0x0e98('0x5b')][_0x0e98('0x6b')],_[_0x0e98('0x74')](_0x446f38[_0x0e98('0x5b')],[_0x0e98('0x6b'),'id'])||{})[_0x0e98('0xbe')](function(_0x339a77){for(var _0xc643d7=0x0;_0xc643d7<_0x446f38[_0x0e98('0x5b')][_0x0e98('0x6b')][_0x0e98('0x4d')];_0xc643d7+=0x1){socket['emit'](_0x0e98('0xbf'),{'UserId':Number(_0x446f38[_0x0e98('0x5b')][_0x0e98('0x6b')][_0xc643d7]),'FaxAccountId':Number(_0x446f38[_0x0e98('0x58')]['id'])});}return _0x339a77;});}})[_0x0e98('0x24')](respondWithResult(_0x10a1f9,null))[_0x0e98('0x59')](handleError(_0x10a1f9,null));};exports[_0x0e98('0xc0')]=function(_0xd16fa4,_0x19875a,_0x1e3fa1){return db['FaxAccount'][_0x0e98('0x61')]({'where':{'id':_0xd16fa4[_0x0e98('0x58')]['id']}})[_0x0e98('0x24')](handleEntityNotFound(_0x19875a,null))['then'](function(_0x5bfa82){if(_0x5bfa82){return _0x5bfa82[_0x0e98('0xc0')](_0xd16fa4[_0x0e98('0x47')][_0x0e98('0x6b')])[_0x0e98('0x24')](function(){if(_[_0x0e98('0xc1')](_0xd16fa4[_0x0e98('0x47')][_0x0e98('0x6b')])){for(var _0x2ff1b4=0x0;_0x2ff1b4<_0xd16fa4['query'][_0x0e98('0x6b')][_0x0e98('0x4d')];_0x2ff1b4+=0x1){socket['emit'](_0x0e98('0xc2'),{'UserId':Number(_0xd16fa4[_0x0e98('0x47')][_0x0e98('0x6b')][_0x2ff1b4]),'FaxAccountId':Number(_0xd16fa4[_0x0e98('0x58')]['id'])});}}else{socket[_0x0e98('0xc3')](_0x0e98('0xc2'),{'UserId':Number(_0xd16fa4[_0x0e98('0x47')]['ids']),'FaxAccountId':Number(_0xd16fa4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x19875a,null))[_0x0e98('0x59')](handleError(_0x19875a,null));};exports[_0x0e98('0xc4')]=function(_0x320551,_0x1e930d,_0x54167d){var _0x5bd3e7={};var _0x2123a5={};var _0xa35f1;var _0x12b9d1;return db['FaxAccount']['findOne']({'where':{'id':_0x320551[_0x0e98('0x58')]['id']}})['then'](handleEntityNotFound(_0x1e930d,null))[_0x0e98('0x24')](function(_0x3cc8ac){if(_0x3cc8ac){_0xa35f1=_0x3cc8ac;_0x2123a5[_0x0e98('0x45')]=_[_0x0e98('0x48')](db['User'][_0x0e98('0x42')]);_0x2123a5[_0x0e98('0x47')]=_[_0x0e98('0x48')](_0x320551['query']);_0x2123a5[_0x0e98('0x49')]=_[_0x0e98('0x4a')](_0x2123a5[_0x0e98('0x45')],_0x2123a5[_0x0e98('0x47')]);_0x5bd3e7['attributes']=_[_0x0e98('0x4a')](_0x2123a5[_0x0e98('0x45')],qs[_0x0e98('0x4c')](_0x320551[_0x0e98('0x47')][_0x0e98('0x4c')]));_0x5bd3e7[_0x0e98('0x4b')]=_0x5bd3e7[_0x0e98('0x4b')]['length']?_0x5bd3e7[_0x0e98('0x4b')]:_0x2123a5[_0x0e98('0x45')];_0x5bd3e7[_0x0e98('0x69')]=qs[_0x0e98('0x4f')](_0x320551['query']['sort']);_0x5bd3e7[_0x0e98('0x51')]=qs[_0x0e98('0x49')](_[_0x0e98('0x50')](_0x320551[_0x0e98('0x47')],_0x2123a5['filters']));if(_0x320551[_0x0e98('0x47')][_0x0e98('0x53')]){_0x5bd3e7[_0x0e98('0x51')]=_['merge'](_0x5bd3e7[_0x0e98('0x51')],{'$or':_[_0x0e98('0x46')](_0x5bd3e7[_0x0e98('0x4b')],function(_0x365f8c){var _0x23655f={};_0x23655f[_0x365f8c]={'$like':'%'+_0x320551[_0x0e98('0x47')][_0x0e98('0x53')]+'%'};return _0x23655f;})});}_0x5bd3e7=_[_0x0e98('0x52')]({},_0x5bd3e7,_0x320551[_0x0e98('0x54')]);return _0xa35f1[_0x0e98('0xc4')](_0x5bd3e7);}})[_0x0e98('0x24')](function(_0x3563dd){if(_0x3563dd){_0x12b9d1=_0x3563dd[_0x0e98('0x4d')];if(!_0x320551[_0x0e98('0x47')][_0x0e98('0x4e')]('nolimit')){_0x5bd3e7[_0x0e98('0x35')]=qs[_0x0e98('0x35')](_0x320551[_0x0e98('0x47')]['limit']);_0x5bd3e7[_0x0e98('0x33')]=qs[_0x0e98('0x33')](_0x320551['query']['offset']);}return _0xa35f1['getAgents'](_0x5bd3e7);}})[_0x0e98('0x24')](function(_0x5a5bd8){if(_0x5a5bd8){return _0x5a5bd8?{'count':_0x12b9d1,'rows':_0x5a5bd8}:null;}})[_0x0e98('0x24')](respondWithResult(_0x1e930d,null))['catch'](handleError(_0x1e930d,null));}; \ No newline at end of file +var _0x1129=['split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxAccount.socket','register','jayson/promise','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','attributes','fields','length','nolimit','sort','pick','filters','where','merge','options','includeAll','include','rows','show','params','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','order','filter','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','Contact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','priority','stack','finally','getApplications','context','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','localstationid','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Set','Wait','/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','VoiceExtension','updateAccountApplications','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte'];(function(_0x63eabd,_0x2d29df){var _0x59191b=function(_0x16bc7b){while(--_0x16bc7b){_0x63eabd['push'](_0x63eabd['shift']());}};_0x59191b(++_0x2d29df);}(_0x1129,0x1a3));var _0x9112=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1129[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9112('0x1'));var jsonpatch=require(_0x9112('0x2'));var rp=require(_0x9112('0x3'));var moment=require(_0x9112('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9112('0x5'));var path=require(_0x9112('0x6'));var sox=require(_0x9112('0x7'));var csv=require(_0x9112('0x8'));var ejs=require(_0x9112('0x9'));var fs=require('fs');var fs_extra=require(_0x9112('0xa'));var _=require('lodash');var squel=require(_0x9112('0xb'));var crypto=require('crypto');var jsforce=require(_0x9112('0xc'));var deskjs=require(_0x9112('0xd'));var toCsv=require(_0x9112('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9112('0xe'));var qs=require(_0x9112('0xf'));var as=require(_0x9112('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9112('0x11'));var utils=require(_0x9112('0x12'));var config=require(_0x9112('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9112('0x14'))['db'];config[_0x9112('0x15')]=_[_0x9112('0x16')](config[_0x9112('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9112('0x17'))[_0x9112('0x18')](socket);var jayson=require(_0x9112('0x19'));var client=jayson['client'][_0x9112('0x1a')]({'port':0x232c});var client9002=jayson[_0x9112('0x1b')][_0x9112('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1ef6ea,_0x389ee9,_0x5038e9,_0x2ea8bd){return new BPromise(function(_0x51e29e,_0x58f2a1){var _0x180f2d=_0x2ea8bd||client;return _0x180f2d[_0x9112('0x1c')](_0x1ef6ea,_0x5038e9)[_0x9112('0x1d')](function(_0x11b5ff){logger[_0x9112('0x1e')](_0x9112('0x1f'),_0x389ee9,_0x9112('0x20'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x389ee9,_0x9112('0x20'),JSON['stringify'](_0x11b5ff));if(_0x11b5ff[_0x9112('0x21')]){if(_0x11b5ff[_0x9112('0x21')]['code']===0x1f4){logger[_0x9112('0x21')]('FaxAccount,\x20%s,\x20%s',_0x389ee9,_0x11b5ff[_0x9112('0x21')][_0x9112('0x22')]);return _0x58f2a1(_0x11b5ff[_0x9112('0x21')][_0x9112('0x22')]);}logger[_0x9112('0x21')](_0x9112('0x1f'),_0x389ee9,_0x11b5ff[_0x9112('0x21')][_0x9112('0x22')]);return _0x51e29e(_0x11b5ff[_0x9112('0x21')][_0x9112('0x22')]);}else{logger['info'](_0x9112('0x1f'),_0x389ee9,_0x9112('0x20'));_0x51e29e(_0x11b5ff[_0x9112('0x23')]['message']);}})[_0x9112('0x24')](function(_0x35f446){logger[_0x9112('0x21')]('FaxAccount,\x20%s,\x20%s',_0x389ee9,_0x35f446);_0x58f2a1(_0x35f446);});});}function respondWithStatusCode(_0xb144ba,_0x316cb4){_0x316cb4=_0x316cb4||0xcc;return function(_0x2501ff){if(_0x2501ff){return _0xb144ba[_0x9112('0x25')](_0x316cb4);}return _0xb144ba[_0x9112('0x26')](_0x316cb4)[_0x9112('0x27')]();};}function respondWithResult(_0x234aeb,_0x1406c7){_0x1406c7=_0x1406c7||0xc8;return function(_0x4736fe){if(_0x4736fe){return _0x234aeb[_0x9112('0x26')](_0x1406c7)[_0x9112('0x28')](_0x4736fe);}};}function respondWithFilteredResult(_0x314715,_0x8ec36c){return function(_0x461653){if(_0x461653){var _0x5028c4=typeof _0x8ec36c[_0x9112('0x29')]===_0x9112('0x2a')&&typeof _0x8ec36c[_0x9112('0x2b')]===_0x9112('0x2a');var _0xcab20c=_0x461653['count'];var _0x276492=_0x5028c4?0x0:_0x8ec36c[_0x9112('0x29')];var _0x3afc35=_0x5028c4?_0x461653[_0x9112('0x2c')]:_0x8ec36c[_0x9112('0x29')]+_0x8ec36c['limit'];var _0x48b9c2;if(_0x3afc35>=_0xcab20c){_0x3afc35=_0xcab20c;_0x48b9c2=0xc8;}else{_0x48b9c2=0xce;}_0x314715['status'](_0x48b9c2);return _0x314715[_0x9112('0x2d')](_0x9112('0x2e'),_0x276492+'-'+_0x3afc35+'/'+_0xcab20c)[_0x9112('0x28')](_0x461653);}return null;};}function patchUpdates(_0x52901e){return function(_0x571bc2){try{jsonpatch[_0x9112('0x2f')](_0x571bc2,_0x52901e,!![]);}catch(_0x271a01){return BPromise[_0x9112('0x30')](_0x271a01);}return _0x571bc2['save']();};}function saveUpdates(_0x19725a,_0x500f08){return function(_0x28e464){if(_0x28e464){return _0x28e464[_0x9112('0x31')](_0x19725a)[_0x9112('0x1d')](function(_0x5e8eeb){return _0x5e8eeb;});}return null;};}function removeEntity(_0x4f209e,_0x5a3a45){return function(_0x256da9){if(_0x256da9){return _0x256da9[_0x9112('0x32')]()[_0x9112('0x1d')](function(){var _0xd17720=_0x256da9['get']({'plain':!![]});var _0x534b95=_0x9112('0x33');return db[_0x9112('0x34')][_0x9112('0x32')]({'where':{'type':_0x534b95,'resourceId':_0xd17720['id']}})[_0x9112('0x1d')](function(){return _0x256da9;});})[_0x9112('0x1d')](function(){_0x4f209e[_0x9112('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d02ac,_0x353279){return function(_0x7e1599){if(!_0x7e1599){_0x2d02ac[_0x9112('0x25')](0x194);}return _0x7e1599;};}function handleError(_0x3b0f43,_0x4e3599){_0x4e3599=_0x4e3599||0x1f4;return function(_0x576e02){logger['error'](_0x576e02['stack']);if(_0x576e02[_0x9112('0x35')]){delete _0x576e02['name'];}_0x3b0f43[_0x9112('0x26')](_0x4e3599)[_0x9112('0x36')](_0x576e02);};}exports[_0x9112('0x37')]=function(_0x3c3a68,_0x1d8044){var _0x5a6eb0={'include':[{'model':db[_0x9112('0x38')],'as':_0x9112('0x39')}]},_0x32242b={},_0x1753ec={'count':0x0,'rows':[]};var _0x1c0972=_[_0x9112('0x3a')](db[_0x9112('0x3b')][_0x9112('0x3c')],function(_0x40bf96){return{'name':_0x40bf96['fieldName'],'type':_0x40bf96[_0x9112('0x3d')][_0x9112('0x3e')]};});_0x32242b[_0x9112('0x3f')]=_['map'](_0x1c0972,_0x9112('0x35'));_0x32242b[_0x9112('0x40')]=_['keys'](_0x3c3a68[_0x9112('0x40')]);_0x32242b['filters']=_['intersection'](_0x32242b[_0x9112('0x3f')],_0x32242b[_0x9112('0x40')]);_0x5a6eb0[_0x9112('0x41')]=_['intersection'](_0x32242b[_0x9112('0x3f')],qs[_0x9112('0x42')](_0x3c3a68[_0x9112('0x40')]['fields']));_0x5a6eb0[_0x9112('0x41')]=_0x5a6eb0['attributes'][_0x9112('0x43')]?_0x5a6eb0['attributes']:_0x32242b['model'];if(!_0x3c3a68[_0x9112('0x40')]['hasOwnProperty'](_0x9112('0x44'))){_0x5a6eb0[_0x9112('0x2b')]=qs[_0x9112('0x2b')](_0x3c3a68[_0x9112('0x40')][_0x9112('0x2b')]);_0x5a6eb0['offset']=qs[_0x9112('0x29')](_0x3c3a68[_0x9112('0x40')]['offset']);}_0x5a6eb0['order']=qs[_0x9112('0x45')](_0x3c3a68[_0x9112('0x40')]['sort']);_0x5a6eb0['where']=qs['filters'](_[_0x9112('0x46')](_0x3c3a68[_0x9112('0x40')],_0x32242b[_0x9112('0x47')]),_0x1c0972);if(_0x3c3a68[_0x9112('0x40')]['filter']){_0x5a6eb0[_0x9112('0x48')]=_[_0x9112('0x49')](_0x5a6eb0[_0x9112('0x48')],{'$or':_['map'](_0x1c0972,function(_0x3ddca9){if(_0x3ddca9[_0x9112('0x3d')]!=='VIRTUAL'){var _0x3df3b4={};_0x3df3b4[_0x3ddca9[_0x9112('0x35')]]={'$like':'%'+_0x3c3a68['query']['filter']+'%'};return _0x3df3b4;}})});}_0x5a6eb0=_[_0x9112('0x49')]({},_0x5a6eb0,_0x3c3a68[_0x9112('0x4a')]);var _0x41d171={'where':_0x5a6eb0[_0x9112('0x48')]};return db[_0x9112('0x3b')]['count'](_0x41d171)['then'](function(_0x2979d8){_0x1753ec['count']=_0x2979d8;if(_0x3c3a68[_0x9112('0x40')][_0x9112('0x4b')]){_0x5a6eb0[_0x9112('0x4c')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x5a6eb0);})[_0x9112('0x1d')](function(_0x21672e){_0x1753ec[_0x9112('0x4d')]=_0x21672e;return _0x1753ec;})[_0x9112('0x1d')](respondWithFilteredResult(_0x1d8044,_0x5a6eb0))[_0x9112('0x24')](handleError(_0x1d8044,null));};exports[_0x9112('0x4e')]=function(_0x3298e0,_0x3acd12){var _0x382cd1={'raw':![],'where':{'id':_0x3298e0[_0x9112('0x4f')]['id']},'include':[{'model':db[_0x9112('0x38')],'as':'mandatoryDispositionPause'}]},_0x172248={};_0x172248[_0x9112('0x3f')]=_[_0x9112('0x50')](db[_0x9112('0x3b')][_0x9112('0x3c')]);_0x172248[_0x9112('0x40')]=_[_0x9112('0x50')](_0x3298e0[_0x9112('0x40')]);_0x172248[_0x9112('0x47')]=_[_0x9112('0x51')](_0x172248[_0x9112('0x3f')],_0x172248['query']);_0x382cd1[_0x9112('0x41')]=_[_0x9112('0x51')](_0x172248[_0x9112('0x3f')],qs[_0x9112('0x42')](_0x3298e0[_0x9112('0x40')][_0x9112('0x42')]));_0x382cd1[_0x9112('0x41')]=_0x382cd1[_0x9112('0x41')][_0x9112('0x43')]?_0x382cd1[_0x9112('0x41')]:_0x172248[_0x9112('0x3f')];if(_0x3298e0[_0x9112('0x40')][_0x9112('0x4b')]){_0x382cd1[_0x9112('0x4c')]=[{'all':!![]}];}_0x382cd1=_[_0x9112('0x49')]({},_0x382cd1,_0x3298e0[_0x9112('0x4a')]);return db[_0x9112('0x3b')][_0x9112('0x52')](_0x382cd1)[_0x9112('0x1d')](handleEntityNotFound(_0x3acd12,null))['then'](respondWithResult(_0x3acd12,null))[_0x9112('0x24')](handleError(_0x3acd12,null));};exports[_0x9112('0x53')]=function(_0x1f71a5,_0x579550){return db[_0x9112('0x3b')][_0x9112('0x53')](_0x1f71a5[_0x9112('0x54')],{})['then'](function(_0x411f27){var _0x1b111a=_0x1f71a5[_0x9112('0x55')]['get']({'plain':!![]});if(!_0x1b111a)throw new Error(_0x9112('0x56'));if(_0x1b111a[_0x9112('0x57')]===_0x9112('0x55')){var _0x1ed10c=_0x411f27[_0x9112('0x58')]({'plain':!![]});var _0x45a02c=_0x9112('0x33');return db[_0x9112('0x59')][_0x9112('0x52')]({'where':{'name':_0x45a02c,'userProfileId':_0x1b111a[_0x9112('0x5a')]},'raw':!![]})['then'](function(_0x20bcb4){if(_0x20bcb4&&_0x20bcb4['autoAssociation']===0x0){return db[_0x9112('0x34')][_0x9112('0x53')]({'name':_0x1ed10c[_0x9112('0x35')],'resourceId':_0x1ed10c['id'],'type':_0x20bcb4[_0x9112('0x35')],'sectionId':_0x20bcb4['id']},{})[_0x9112('0x1d')](function(){return _0x411f27;});}else{return _0x411f27;}})['catch'](function(_0x1661e3){logger[_0x9112('0x21')](_0x9112('0x5b'),_0x1661e3);throw _0x1661e3;});}return _0x411f27;})['then'](respondWithResult(_0x579550,0xc9))[_0x9112('0x24')](handleError(_0x579550,null));};exports[_0x9112('0x31')]=function(_0x526949,_0x3f32be){if(_0x526949['body']['id']){delete _0x526949[_0x9112('0x54')]['id'];}return db[_0x9112('0x3b')][_0x9112('0x52')]({'where':{'id':_0x526949['params']['id']},'include':[{'model':db[_0x9112('0x38')],'as':_0x9112('0x39')}]})['then'](handleEntityNotFound(_0x3f32be,null))[_0x9112('0x1d')](saveUpdates(_0x526949[_0x9112('0x54')],null))[_0x9112('0x1d')](respondWithResult(_0x3f32be,null))[_0x9112('0x24')](handleError(_0x3f32be,null));};exports[_0x9112('0x32')]=function(_0x109492,_0x37ee83){return db[_0x9112('0x3b')][_0x9112('0x52')]({'where':{'id':_0x109492[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x37ee83,null))[_0x9112('0x1d')](removeEntity(_0x37ee83,null))[_0x9112('0x24')](handleError(_0x37ee83,null));};exports[_0x9112('0x5c')]=function(_0xfe6f45,_0x3ea97d){return db[_0x9112('0x3b')][_0x9112('0x5c')]()['then'](respondWithResult(_0x3ea97d,null))[_0x9112('0x24')](handleError(_0x3ea97d,null));};exports[_0x9112('0x5d')]=function(_0x1c645f,_0x47f0b1,_0x32357f){if(_0x1c645f[_0x9112('0x54')]['id']){delete _0x1c645f['body']['id'];}return db['FaxAccount'][_0x9112('0x52')]({'where':{'id':_0x1c645f[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x47f0b1,null))[_0x9112('0x1d')](function(_0x11e9c1){if(_0x11e9c1){_0x1c645f[_0x9112('0x54')][_0x9112('0x5e')]=_0x11e9c1['id'];return db['Disposition'][_0x9112('0x53')](_0x1c645f[_0x9112('0x54')]);}})[_0x9112('0x1d')](respondWithResult(_0x47f0b1,null))[_0x9112('0x24')](handleError(_0x47f0b1,null));};exports[_0x9112('0x5f')]=function(_0x265339,_0x3d86e6,_0x19c993){var _0x288966={'raw':![],'where':{}};var _0x11ad3c={};var _0x2942b4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x265339['params']['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x3d86e6,null))[_0x9112('0x1d')](function(_0x150d4f){if(_0x150d4f){_0x11ad3c[_0x9112('0x3f')]=_[_0x9112('0x50')](db['Disposition'][_0x9112('0x3c')]);_0x11ad3c[_0x9112('0x40')]=_['keys'](_0x265339[_0x9112('0x40')]);_0x11ad3c[_0x9112('0x47')]=_[_0x9112('0x51')](_0x11ad3c[_0x9112('0x3f')],_0x11ad3c['query']);_0x288966[_0x9112('0x41')]=_[_0x9112('0x51')](_0x11ad3c[_0x9112('0x3f')],qs[_0x9112('0x42')](_0x265339[_0x9112('0x40')][_0x9112('0x42')]));_0x288966[_0x9112('0x41')]=_0x288966[_0x9112('0x41')][_0x9112('0x43')]?_0x288966[_0x9112('0x41')]:_0x11ad3c['model'];if(!_0x265339['query']['hasOwnProperty'](_0x9112('0x44'))){_0x288966[_0x9112('0x2b')]=qs[_0x9112('0x2b')](_0x265339[_0x9112('0x40')][_0x9112('0x2b')]);_0x288966[_0x9112('0x29')]=qs['offset'](_0x265339['query'][_0x9112('0x29')]);}_0x288966[_0x9112('0x60')]=qs[_0x9112('0x45')](_0x265339[_0x9112('0x40')][_0x9112('0x45')]);_0x288966['where']=qs[_0x9112('0x47')](_[_0x9112('0x46')](_0x265339[_0x9112('0x40')],_0x11ad3c[_0x9112('0x47')]));_0x288966[_0x9112('0x48')][_0x9112('0x5e')]=_0x150d4f['id'];if(_0x265339[_0x9112('0x40')][_0x9112('0x61')]){_0x288966[_0x9112('0x48')]=_[_0x9112('0x49')](_0x288966[_0x9112('0x48')],{'$or':_['map'](_0x288966[_0x9112('0x41')],function(_0x4a4272){var _0x3add6d={};_0x3add6d[_0x4a4272]={'$like':'%'+_0x265339[_0x9112('0x40')]['filter']+'%'};return _0x3add6d;})});}_0x288966=_['merge']({},_0x288966,_0x265339[_0x9112('0x4a')]);return db[_0x9112('0x62')]['count']({'where':_0x288966[_0x9112('0x48')]})[_0x9112('0x1d')](function(_0x12fa85){_0x2942b4['count']=_0x12fa85;if(_0x265339['query']['includeAll']){_0x288966['include']=[{'all':!![]}];}return db[_0x9112('0x62')][_0x9112('0x63')](_0x288966);})[_0x9112('0x1d')](function(_0x79daa3){_0x2942b4[_0x9112('0x4d')]=_0x79daa3;return _0x2942b4;});}})[_0x9112('0x1d')](respondWithFilteredResult(_0x3d86e6,_0x288966))[_0x9112('0x24')](handleError(_0x3d86e6,null));};exports['removeDispositions']=function(_0x499151,_0x246e4c,_0x2b48ef){return db['FaxAccount']['find']({'where':{'id':_0x499151[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x246e4c,null))[_0x9112('0x1d')](function(_0x3eb48f){if(_0x3eb48f){return _0x3eb48f[_0x9112('0x64')](_0x499151[_0x9112('0x40')][_0x9112('0x65')]);}})[_0x9112('0x1d')](respondWithStatusCode(_0x246e4c,null))[_0x9112('0x24')](handleError(_0x246e4c,null));};exports[_0x9112('0x66')]=function(_0x1d7b12,_0x429294,_0x47f45d){if(_0x1d7b12['body']['id']){delete _0x1d7b12[_0x9112('0x54')]['id'];}return db[_0x9112('0x3b')]['find']({'where':{'id':_0x1d7b12[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x429294,null))['then'](function(_0x487738){if(_0x487738){_0x1d7b12[_0x9112('0x54')]['FaxAccountId']=_0x487738['id'];return db[_0x9112('0x67')][_0x9112('0x53')](_0x1d7b12[_0x9112('0x54')]);}})[_0x9112('0x1d')](respondWithResult(_0x429294,null))['catch'](handleError(_0x429294,null));};exports[_0x9112('0x68')]=function(_0x53542c,_0x3fba75,_0x50f992){var _0x406282={'raw':![],'where':{}};var _0x5518c6={};var _0x43420f={'count':0x0,'rows':[]};return db[_0x9112('0x3b')][_0x9112('0x69')]({'where':{'id':_0x53542c[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x3fba75,null))[_0x9112('0x1d')](function(_0x1e1bbb){if(_0x1e1bbb){_0x5518c6[_0x9112('0x3f')]=_[_0x9112('0x50')](db['CannedAnswer'][_0x9112('0x3c')]);_0x5518c6[_0x9112('0x40')]=_['keys'](_0x53542c[_0x9112('0x40')]);_0x5518c6[_0x9112('0x47')]=_[_0x9112('0x51')](_0x5518c6[_0x9112('0x3f')],_0x5518c6['query']);_0x406282[_0x9112('0x41')]=_[_0x9112('0x51')](_0x5518c6[_0x9112('0x3f')],qs[_0x9112('0x42')](_0x53542c[_0x9112('0x40')][_0x9112('0x42')]));_0x406282[_0x9112('0x41')]=_0x406282[_0x9112('0x41')][_0x9112('0x43')]?_0x406282[_0x9112('0x41')]:_0x5518c6[_0x9112('0x3f')];if(!_0x53542c[_0x9112('0x40')][_0x9112('0x6a')]('nolimit')){_0x406282[_0x9112('0x2b')]=qs[_0x9112('0x2b')](_0x53542c[_0x9112('0x40')]['limit']);_0x406282[_0x9112('0x29')]=qs[_0x9112('0x29')](_0x53542c['query'][_0x9112('0x29')]);}_0x406282[_0x9112('0x60')]=qs[_0x9112('0x45')](_0x53542c[_0x9112('0x40')]['sort']);_0x406282[_0x9112('0x48')]=qs[_0x9112('0x47')](_[_0x9112('0x46')](_0x53542c[_0x9112('0x40')],_0x5518c6['filters']));_0x406282['where'][_0x9112('0x5e')]=_0x1e1bbb['id'];if(_0x53542c[_0x9112('0x40')][_0x9112('0x61')]){_0x406282[_0x9112('0x48')]=_['merge'](_0x406282[_0x9112('0x48')],{'$or':_[_0x9112('0x3a')](_0x406282[_0x9112('0x41')],function(_0x3c4251){var _0x41db20={};_0x41db20[_0x3c4251]={'$like':'%'+_0x53542c[_0x9112('0x40')][_0x9112('0x61')]+'%'};return _0x41db20;})});}_0x406282=_['merge']({},_0x406282,_0x53542c[_0x9112('0x4a')]);return db[_0x9112('0x67')]['count']({'where':_0x406282[_0x9112('0x48')]})[_0x9112('0x1d')](function(_0x21b915){_0x43420f[_0x9112('0x2c')]=_0x21b915;if(_0x53542c[_0x9112('0x40')][_0x9112('0x4b')]){_0x406282[_0x9112('0x4c')]=[{'all':!![]}];}return db[_0x9112('0x67')][_0x9112('0x63')](_0x406282);})[_0x9112('0x1d')](function(_0x2fbb2d){_0x43420f['rows']=_0x2fbb2d;return _0x43420f;});}})[_0x9112('0x1d')](respondWithFilteredResult(_0x3fba75,_0x406282))[_0x9112('0x24')](handleError(_0x3fba75,null));};exports[_0x9112('0x6b')]=function(_0x4460e4,_0x21441f,_0x116842){return db['FaxAccount'][_0x9112('0x52')]({'where':{'id':_0x4460e4[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x21441f,null))[_0x9112('0x1d')](function(_0x54ac59){if(_0x54ac59){return _0x54ac59[_0x9112('0x6b')](_0x4460e4[_0x9112('0x40')][_0x9112('0x65')]);}})[_0x9112('0x1d')](respondWithStatusCode(_0x21441f,null))[_0x9112('0x24')](handleError(_0x21441f,null));};exports[_0x9112('0x6c')]=function(_0x15ee7f,_0x51d962,_0x4799a1){return db['FaxInteraction']['find']({'where':{'id':_0x15ee7f[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x51d962,null))['then'](function(_0x214610){if(_0x214610){return _0x214610['addInteraction'](_0x15ee7f[_0x9112('0x54')]['ids'],_[_0x9112('0x6d')](_0x15ee7f[_0x9112('0x54')],[_0x9112('0x65'),'id'])||{});}})[_0x9112('0x1d')](respondWithResult(_0x51d962,null))[_0x9112('0x24')](handleError(_0x51d962,null));};exports[_0x9112('0x6e')]=function(_0x566cb1,_0x5b84f7,_0x17faf0){var _0x272d35={'raw':![],'where':{}};var _0x2f45b8={};var _0x2c4dad={'count':0x0,'rows':[]};return db[_0x9112('0x3b')][_0x9112('0x69')]({'where':{'id':_0x566cb1[_0x9112('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5b84f7,null))['then'](function(_0x5ae0ce){if(_0x5ae0ce){_0x2f45b8[_0x9112('0x3f')]=_[_0x9112('0x50')](db[_0x9112('0x6f')][_0x9112('0x3c')]);_0x2f45b8[_0x9112('0x40')]=_['keys'](_0x566cb1['query']);_0x2f45b8[_0x9112('0x47')]=_[_0x9112('0x51')](_0x2f45b8[_0x9112('0x3f')],_0x2f45b8[_0x9112('0x40')]);_0x272d35[_0x9112('0x41')]=_[_0x9112('0x51')](_0x2f45b8[_0x9112('0x3f')],qs[_0x9112('0x42')](_0x566cb1[_0x9112('0x40')][_0x9112('0x42')]));_0x272d35['attributes']=_0x272d35['attributes'][_0x9112('0x43')]?_0x272d35['attributes']:_0x2f45b8[_0x9112('0x3f')];if(!_0x566cb1['query'][_0x9112('0x6a')]('nolimit')){_0x272d35[_0x9112('0x2b')]=qs[_0x9112('0x2b')](_0x566cb1[_0x9112('0x40')][_0x9112('0x2b')]);_0x272d35[_0x9112('0x29')]=qs['offset'](_0x566cb1['query'][_0x9112('0x29')]);}_0x272d35[_0x9112('0x60')]=qs['sort'](_0x566cb1[_0x9112('0x40')][_0x9112('0x45')]);_0x272d35[_0x9112('0x48')]=qs[_0x9112('0x47')](_[_0x9112('0x46')](_0x566cb1['query'],_0x2f45b8[_0x9112('0x47')]));_0x272d35[_0x9112('0x48')][_0x9112('0x5e')]=_0x5ae0ce['id'];if(_0x566cb1[_0x9112('0x40')]['filter']){_0x272d35[_0x9112('0x48')]=_['merge'](_0x272d35['where'],{'$or':_[_0x9112('0x3a')](_0x272d35[_0x9112('0x41')],function(_0x388a67){var _0x5611d7={};_0x5611d7[_0x388a67]={'$like':'%'+_0x566cb1[_0x9112('0x40')][_0x9112('0x61')]+'%'};return _0x5611d7;})});}_0x272d35=_['merge']({},_0x272d35,_0x566cb1[_0x9112('0x4a')]);return db[_0x9112('0x6f')]['count']({'where':_0x272d35[_0x9112('0x48')]})[_0x9112('0x1d')](function(_0x2d307a){_0x2c4dad[_0x9112('0x2c')]=_0x2d307a;if(_0x566cb1[_0x9112('0x40')][_0x9112('0x4b')]){_0x272d35['include']=[{'model':db['CmContact'],'as':_0x9112('0x70'),'required':![]},{'model':db[_0x9112('0x71')],'as':_0x9112('0x72'),'attributes':[_0x9112('0x35'),'fullname','internal'],'required':![]},{'model':db[_0x9112('0x73')],'as':_0x9112('0x74'),'attributes':['id',_0x9112('0x35'),_0x9112('0x75')],'where':_0x566cb1[_0x9112('0x40')][_0x9112('0x76')]?{'id':_0x566cb1[_0x9112('0x40')]['tag']}:undefined,'required':_0x566cb1[_0x9112('0x40')]['tag']?!![]:![]}];}return db[_0x9112('0x6f')][_0x9112('0x63')](_0x272d35);})[_0x9112('0x1d')](function(_0x21d2d9){_0x2c4dad[_0x9112('0x4d')]=_0x21d2d9;return _0x2c4dad;});}})['then'](respondWithFilteredResult(_0x5b84f7,_0x272d35))[_0x9112('0x24')](handleError(_0x5b84f7,null));};exports[_0x9112('0x77')]=function(_0x6ece49,_0x4c8cf0){var _0x43100f=_0x6ece49[_0x9112('0x4f')]['id'];var _0x36be79=_0x6ece49[_0x9112('0x54')];var _0xcca046=0xc8;var _0x1f5c4d=null;return db[_0x9112('0x78')][_0x9112('0x79')]({'isolationLevel':db[_0x9112('0x78')]['Transaction'][_0x9112('0x7a')]['READ_COMMITTED']},function(_0x30a71c){return db[_0x9112('0x3b')]['findOne']({'where':{'id':_0x43100f},'transaction':_0x30a71c})['then'](function(_0x57fd7d){if(_0x57fd7d){return db[_0x9112('0x7b')][_0x9112('0x32')]({'where':{'FaxAccountId':_0x43100f},'transaction':_0x30a71c})['then'](function(){var _0x3ecf3c=_[_0x9112('0x3a')](_0x36be79,function(_0x3c47b6){_0x3c47b6['FaxAccountId']=_0x43100f;return _0x3c47b6;});return db['FaxApplication'][_0x9112('0x7c')](_0x3ecf3c,{'transaction':_0x30a71c});});}else{_0xcca046=0x194;_0x1f5c4d=[];}});})[_0x9112('0x1d')](function(){if(_0xcca046!==0x194){return db[_0x9112('0x7b')]['findAndCountAll']({'where':{'FaxAccountId':_0x43100f},'order':_0x9112('0x7d')})[_0x9112('0x1d')](function(_0x5165d2){_0x1f5c4d=_0x5165d2;});}})[_0x9112('0x24')](function(_0x3470be){_0xcca046=0x1f4;logger[_0x9112('0x21')](_0x3470be[_0x9112('0x7e')]);if(_0x3470be['name']){delete _0x3470be[_0x9112('0x35')];}_0x1f5c4d=_0x3470be;})[_0x9112('0x7f')](function(){if(_0x1f5c4d===null){_0x4c8cf0[_0x9112('0x25')](_0xcca046);}else{if(_0xcca046===0x1f4){_0x4c8cf0[_0x9112('0x26')](_0xcca046)[_0x9112('0x36')](_0x1f5c4d);}else{_0x4c8cf0['status'](_0xcca046)[_0x9112('0x28')](_0x1f5c4d);}}});};exports[_0x9112('0x80')]=function(_0x3d8bdd,_0x304264,_0x317a72){var _0x26ca5a={};var _0x42b832={};var _0x536349;var _0x5ab8a7;return db[_0x9112('0x3b')]['findOne']({'where':{'id':_0x3d8bdd[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x304264,null))['then'](function(_0x30558f){if(_0x30558f){_0x536349=_0x30558f;_0x42b832['model']=_[_0x9112('0x50')](db['FaxApplication']['rawAttributes']);_0x42b832[_0x9112('0x40')]=_['keys'](_0x3d8bdd[_0x9112('0x40')]);_0x42b832['filters']=_['intersection'](_0x42b832[_0x9112('0x3f')],_0x42b832[_0x9112('0x40')]);_0x26ca5a['attributes']=_[_0x9112('0x51')](_0x42b832['model'],qs['fields'](_0x3d8bdd[_0x9112('0x40')][_0x9112('0x42')]));_0x26ca5a[_0x9112('0x41')]=_0x26ca5a['attributes']['length']?_0x26ca5a[_0x9112('0x41')]:_0x42b832[_0x9112('0x3f')];_0x26ca5a[_0x9112('0x60')]=qs[_0x9112('0x45')](_0x3d8bdd[_0x9112('0x40')][_0x9112('0x45')]);_0x26ca5a['where']=qs[_0x9112('0x47')](_[_0x9112('0x46')](_0x3d8bdd[_0x9112('0x40')],_0x42b832[_0x9112('0x47')]));if(_0x3d8bdd['query'][_0x9112('0x61')]){_0x26ca5a[_0x9112('0x48')]=_[_0x9112('0x49')](_0x26ca5a[_0x9112('0x48')],{'$or':_[_0x9112('0x3a')](_0x26ca5a['attributes'],function(_0x3af323){var _0x1bd053={};_0x1bd053[_0x3af323]={'$like':'%'+_0x3d8bdd[_0x9112('0x40')][_0x9112('0x61')]+'%'};return _0x1bd053;})});}_0x26ca5a=_[_0x9112('0x49')]({},_0x26ca5a,_0x3d8bdd['options']);return _0x536349['getApplications'](_0x26ca5a);}})[_0x9112('0x1d')](function(_0x4a6b22){if(_0x4a6b22){_0x5ab8a7=_0x4a6b22[_0x9112('0x43')];if(!_0x3d8bdd[_0x9112('0x40')][_0x9112('0x6a')]('nolimit')){_0x26ca5a[_0x9112('0x2b')]=qs['limit'](_0x3d8bdd[_0x9112('0x40')]['limit']);_0x26ca5a[_0x9112('0x29')]=qs[_0x9112('0x29')](_0x3d8bdd['query'][_0x9112('0x29')]);}return _0x536349[_0x9112('0x80')](_0x26ca5a);}})[_0x9112('0x1d')](function(_0x243b31){if(_0x243b31){return _0x243b31?{'count':_0x5ab8a7,'rows':_0x243b31}:null;}})[_0x9112('0x1d')](respondWithResult(_0x304264,null))[_0x9112('0x24')](handleError(_0x304264,null));};function Extension(_0x4d7fbd,_0x58fcb0,_0x4fdf06,_0x41cfd2){this[_0x9112('0x81')]='from-voip-provider';this[_0x9112('0x82')]=_0x4d7fbd['localstationid'];this[_0x9112('0x83')]=_0x41cfd2;this[_0x9112('0x3d')]=_0x9112('0x84');this[_0x9112('0x85')]=_0x9112('0x86');this[_0x9112('0x5e')]=_0x4d7fbd['id'];this[_0x9112('0x7d')]=_0x58fcb0;this[_0x9112('0x87')]=_0x4fdf06;}function createExtensionsReciveFax(_0x2cce87){var _0x422eb4=0x1;var _0x5a9de7=[];_0x5a9de7[_0x9112('0x88')](new Extension(_0x2cce87,_0x422eb4,'',_0x9112('0x89')));_0x422eb4+=0x1;_0x5a9de7['push'](new Extension(_0x2cce87,_0x422eb4,_0x9112('0x8a'),'Set'));_0x422eb4+=0x1;for(var _0x8d294 in _0x2cce87){if(_0x2cce87[_0x9112('0x6a')](_0x8d294)&&(_0x8d294==='ecm'||_0x8d294===_0x9112('0x8b')||_0x8d294==='gateway'||_0x8d294===_0x9112('0x8c')||_0x8d294===_0x9112('0x8d')||_0x8d294===_0x9112('0x8e')||_0x8d294===_0x9112('0x8f')||_0x8d294===_0x9112('0x90')||_0x8d294===_0x9112('0x91'))){_0x5a9de7['push'](new Extension(_0x2cce87,_0x422eb4,'FAXOPT('+_0x8d294+')='+_0x2cce87[_0x8d294],_0x9112('0x92')));_0x422eb4+=0x1;}}_0x5a9de7[_0x9112('0x88')](new Extension(_0x2cce87,_0x422eb4,'6',_0x9112('0x93')));_0x422eb4+=0x1;_0x5a9de7[_0x9112('0x88')](new Extension(_0x2cce87,_0x422eb4,_0x9112('0x94'),_0x9112('0x95')));_0x422eb4=0x0;return _0x5a9de7;}exports[_0x9112('0x96')]=function(_0x556d2a,_0x4ca5e3,_0x229dd4){var _0x7952d8;return db[_0x9112('0x78')][_0x9112('0x79')](function(_0x43008d){return db['FaxAccount'][_0x9112('0x53')](_0x556d2a['body'],{'transaction':_0x43008d})[_0x9112('0x1d')](function(_0x24d8cb){_0x7952d8=_0x24d8cb[_0x9112('0x58')]({'plain':!![]});return db[_0x9112('0x97')][_0x9112('0x7c')](createExtensionsReciveFax(_0x7952d8),{'transaction':_0x43008d});});})['then'](function(){return _0x7952d8;})[_0x9112('0x1d')](respondWithResult(_0x4ca5e3,null))[_0x9112('0x24')](handleError(_0x4ca5e3,null));};exports[_0x9112('0x98')]=function(_0xe9d9a,_0x42aae6,_0x2ef53a){var _0x26293f;return db[_0x9112('0x78')]['transaction'](function(_0x189ef8){return db['FaxAccount'][_0x9112('0x31')](_0xe9d9a[_0x9112('0x54')],{'where':{'id':_0xe9d9a[_0x9112('0x54')]['id']},'transaction':_0x189ef8})['then'](function(_0x3450a8){return db['VoiceExtension'][_0x9112('0x32')]({'where':{'FaxAccountId':_0xe9d9a[_0x9112('0x54')]['id']},'transaction':_0x189ef8})[_0x9112('0x1d')](function(_0x4abe70){return db[_0x9112('0x97')]['bulkCreate'](createExtensionsReciveFax(_[_0x9112('0x6d')](_0xe9d9a[_0x9112('0x54')],['tech',_0x9112('0x3e'),_0x9112('0x99'),_0x9112('0x9a'),'TrunkId',_0x9112('0x9b')])),{'transaction':_0x189ef8});});});})[_0x9112('0x1d')](function(){return db[_0x9112('0x3b')][_0x9112('0x9c')](_0xe9d9a[_0x9112('0x54')]['id']);})[_0x9112('0x1d')](respondWithResult(_0x42aae6,null))[_0x9112('0x24')](handleError(_0x42aae6,null));};exports[_0x9112('0x9d')]=function(_0x160cc5,_0x57243f,_0xa2765e){var _0x149877={'raw':!![],'where':{}};var _0x4a4d51={};var _0x4e2678={'count':0x0,'rows':[]};return db[_0x9112('0x3b')]['findOne']({'where':{'id':_0x160cc5[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x57243f,null))[_0x9112('0x1d')](function(_0x4438b6){if(_0x4438b6){_0x4a4d51['model']=_[_0x9112('0x50')](db[_0x9112('0x9e')][_0x9112('0x3c')]);_0x4a4d51[_0x9112('0x40')]=_[_0x9112('0x50')](_0x160cc5[_0x9112('0x40')]);_0x4a4d51[_0x9112('0x47')]=_[_0x9112('0x51')](_0x4a4d51[_0x9112('0x3f')],_0x4a4d51[_0x9112('0x40')]);_0x149877[_0x9112('0x41')]=_[_0x9112('0x51')](_0x4a4d51['model'],qs[_0x9112('0x42')](_0x160cc5[_0x9112('0x40')][_0x9112('0x42')]));_0x149877['attributes']=_0x149877[_0x9112('0x41')][_0x9112('0x43')]?_0x149877[_0x9112('0x41')]:_0x4a4d51[_0x9112('0x3f')];if(!_0x160cc5[_0x9112('0x40')][_0x9112('0x6a')]('nolimit')){_0x149877[_0x9112('0x2b')]=qs[_0x9112('0x2b')](_0x160cc5['query'][_0x9112('0x2b')]);_0x149877[_0x9112('0x29')]=qs['offset'](_0x160cc5['query']['offset']);}_0x149877[_0x9112('0x60')]=qs['sort'](_0x160cc5[_0x9112('0x40')][_0x9112('0x45')]);_0x149877[_0x9112('0x48')]=qs[_0x9112('0x47')](_[_0x9112('0x46')](_0x160cc5[_0x9112('0x40')],_0x4a4d51[_0x9112('0x47')]));_0x149877[_0x9112('0x48')][_0x9112('0x5e')]=_0x4438b6['id'];if(_0x160cc5[_0x9112('0x40')][_0x9112('0x61')]){_0x149877[_0x9112('0x48')]=_[_0x9112('0x49')](_0x149877[_0x9112('0x48')],{'$or':_[_0x9112('0x3a')](_0x149877[_0x9112('0x41')],function(_0x448030){var _0x165edf={};_0x165edf[_0x448030]={'$like':'%'+_0x160cc5[_0x9112('0x40')][_0x9112('0x61')]+'%'};return _0x165edf;})});}if(_0x160cc5['query'][_0x9112('0x9f')]){var _0x155a7b=_0x160cc5[_0x9112('0x40')][_0x9112('0x9f')][_0x9112('0xa0')](',');var _0x3b4134={};_0x3b4134[_0x155a7b[0x0]]={'$gte':moment(_0x155a7b[0x1])[_0x9112('0xa1')](_0x9112('0xa2'))};_0x149877['where']=_[_0x9112('0x49')](_0x149877['where'],_0x3b4134);}_0x149877=_[_0x9112('0x49')]({},_0x149877,_0x160cc5[_0x9112('0x4a')]);return db['FaxMessage'][_0x9112('0x2c')]({'where':_0x149877[_0x9112('0x48')]})[_0x9112('0x1d')](function(_0x5b2d5e){_0x4e2678[_0x9112('0x2c')]=_0x5b2d5e;if(_0x160cc5[_0x9112('0x40')]['includeAll']){_0x149877['include']=[{'all':!![]}];}return db[_0x9112('0x9e')]['findAll'](_0x149877);})[_0x9112('0x1d')](function(_0x397ce8){_0x4e2678[_0x9112('0x4d')]=_0x397ce8;return _0x4e2678;});}})['then'](respondWithFilteredResult(_0x57243f,_0x149877))[_0x9112('0x24')](handleError(_0x57243f,null));};exports['send']=function(_0x86a7df,_0x4a80d2,_0x42ab31){var _0x1e147d,_0x46d917={},_0x162965;if(_0x86a7df[_0x9112('0x54')]['to']){_0x162965=_0x86a7df[_0x9112('0x54')]['to'][0x0];}return db['FaxAccount'][_0x9112('0x52')]({'where':{'id':_0x86a7df['params']['id']},'include':[{'model':db['CmList'],'as':_0x9112('0xa3'),'include':[{'model':db['CmContact'],'as':_0x9112('0xa4'),'where':{'fax':_0x162965},'limit':0x1,'order':[[_0x9112('0x9a'),_0x9112('0xa5')]]}]}]})['then'](handleEntityNotFound(_0x4a80d2,null))[_0x9112('0x1d')](function(_0x4b1754){_0x1e147d=_0x4b1754;if(_0x86a7df['body']['attachments']&&_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][_0x9112('0x43')]){for(var _0x33be7f=0x0;_0x33be7f<_0x86a7df['body'][_0x9112('0xa6')][_0x9112('0x43')];_0x33be7f+=0x1){_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][_0x33be7f]={'filename':_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][_0x33be7f][_0x9112('0x35')],'id':_0x86a7df['body'][_0x9112('0xa6')][_0x33be7f]['id'],'path':path[_0x9112('0xa7')](config[_0x9112('0xa8')],_0x9112('0xa9'),_0x86a7df['body'][_0x9112('0xa6')][_0x33be7f][_0x9112('0xaa')])};}}return respondWithRpcPromise(_0x9112('0xab'),'CheckAfterSend',{'FaxAccountId':_[_0x9112('0xac')](_0x86a7df['params']['id'])?undefined:_0x86a7df[_0x9112('0x4f')]['id'],'path':_[_0x9112('0xac')](_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][0x0]['path'])?undefined:_0x86a7df[_0x9112('0x54')]['attachments'][0x0]['path'],'fax':_[_0x9112('0xac')](_0x86a7df[_0x9112('0x54')]['to'][0x0])?undefined:_0x86a7df[_0x9112('0x54')]['to'][0x0]},client9002);})[_0x9112('0x1d')](function(){if(_0x1e147d){if(_[_0x9112('0xac')](_0x86a7df[_0x9112('0x54')]['from'])){_0x86a7df[_0x9112('0x54')][_0x9112('0xad')]=util[_0x9112('0xa1')](_0x9112('0xae'),_0x1e147d[_0x9112('0x35')],_0x1e147d[_0x9112('0xaf')]);}if(_0x1e147d['List']){if(_0x1e147d[_0x9112('0xa3')]['Contacts'][_0x9112('0x43')]){return _0x1e147d[_0x9112('0xa3')]['Contacts'][0x0];}else{return db[_0x9112('0xb0')]['create'](_[_0x9112('0x16')](_0x86a7df[_0x9112('0x54')],{'firstName':_0x86a7df['body']['to'][0x0],'phone':_0x86a7df['body']['to'][0x0],'fax':_0x86a7df['body']['to'][0x0],'ListId':_0x1e147d[_0x9112('0x9b')]}));}}else{throw new Error(_0x9112('0xb1'));}}else{throw new Error(_0x9112('0xb2'));}})[_0x9112('0x1d')](function(_0x3e5d50){if(_0x3e5d50){return db['FaxInteraction'][_0x9112('0x52')]({'where':{'ContactId':_0x3e5d50['id'],'closed':![],'FaxAccountId':_0x1e147d['id']}})['then'](function(_0x69ef72){if(_0x69ef72){return[_0x69ef72,![]];}return db[_0x9112('0x6f')][_0x9112('0x53')]({'UserId':_0x86a7df['user']['id'],'ContactId':_0x3e5d50['id'],'FaxAccountId':_0x1e147d['id'],'fax':_0x86a7df[_0x9112('0x54')]['to'][0x0],'firstMsgDirection':_0x9112('0xb3'),'Messages':[_['merge'](_0x86a7df[_0x9112('0x54')],{'read':![],'body':_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][0x0]['filename'],'FaxAccountId':_0x1e147d['id'],'UserId':_0x86a7df['user']['id'],'ContactId':_0x3e5d50['id'],'AttachmentId':_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0x9112('0x9e')],'as':'Messages'}]})[_0x9112('0x1d')](function(_0x104eaa){return[_0x104eaa,!![]];});});}else{throw new Error(_0x9112('0xb4'));}})[_0x9112('0xb5')](function(_0x466921,_0x2b1494){if(_0x2b1494){return _0x466921;}return db['FaxMessage'][_0x9112('0x53')]({'direction':_0x9112('0xb3'),'read':![],'body':_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][0x0]['filename'],'FaxAccountId':_0x1e147d['id'],'FaxInteractionId':_0x466921['id'],'UserId':_0x86a7df['user']['id'],'ContactId':_0x466921['ContactId'],'AttachmentId':_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][0x0]['id']})[_0x9112('0x1d')](function(_0x309a01){_0x466921[_0x9112('0xb6')][_0x9112('0xb7')]=[];_0x466921[_0x9112('0xb6')][_0x9112('0xb7')][_0x9112('0x88')](_0x309a01[_0x9112('0xb6')]);return _0x466921;});})[_0x9112('0x1d')](function(_0x500a2a){respondWithRpcPromise(_0x9112('0xb8'),_0x9112('0xb8'),{'FaxAccountId':_[_0x9112('0xac')](_0x86a7df[_0x9112('0x4f')]['id'])?undefined:_0x86a7df['params']['id'],'path':_[_0x9112('0xac')](_0x86a7df[_0x9112('0x54')]['attachments'][0x0]['path'])?undefined:_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][0x0][_0x9112('0x6')],'fax':_[_0x9112('0xac')](_0x86a7df[_0x9112('0x54')]['to'][0x0])?undefined:_0x86a7df[_0x9112('0x54')]['to'][0x0],'AttachmentId':_0x86a7df[_0x9112('0x54')][_0x9112('0xa6')][0x0]['id']},client9002)['then'](function(_0x5109c4){logger[_0x9112('0x1e')](_0x9112('0xb9'),_0x5109c4);})['catch'](function(_0x34a980){logger[_0x9112('0x1e')]('SendFaxRpc,\x20%s',_0x34a980);});return _0x500a2a;})[_0x9112('0x1d')](respondWithResult(_0x4a80d2,null))['catch'](handleError(_0x4a80d2,null));};exports[_0x9112('0xba')]=function(_0x15213a,_0x4e632c,_0x2d1649){return db[_0x9112('0x3b')]['find']({'where':{'id':_0x15213a[_0x9112('0x4f')]['id']}})[_0x9112('0x1d')](handleEntityNotFound(_0x4e632c,null))[_0x9112('0x1d')](function(_0x43198b){if(_0x43198b){return _0x43198b[_0x9112('0xba')](_0x15213a['body']['ids'],_['omit'](_0x15213a[_0x9112('0x54')],[_0x9112('0x65'),'id'])||{})[_0x9112('0xb5')](function(_0x406557){for(var _0x246a38=0x0;_0x246a38<_0x15213a[_0x9112('0x54')][_0x9112('0x65')]['length'];_0x246a38+=0x1){socket[_0x9112('0xbb')](_0x9112('0xbc'),{'UserId':Number(_0x15213a[_0x9112('0x54')]['ids'][_0x246a38]),'FaxAccountId':Number(_0x15213a['params']['id'])});}return _0x406557;});}})['then'](respondWithResult(_0x4e632c,null))[_0x9112('0x24')](handleError(_0x4e632c,null));};exports[_0x9112('0xbd')]=function(_0x2a4680,_0x4402b8,_0x2f2881){return db[_0x9112('0x3b')][_0x9112('0x52')]({'where':{'id':_0x2a4680[_0x9112('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4402b8,null))[_0x9112('0x1d')](function(_0x5bfd6a){if(_0x5bfd6a){return _0x5bfd6a[_0x9112('0xbd')](_0x2a4680[_0x9112('0x40')][_0x9112('0x65')])[_0x9112('0x1d')](function(){if(_[_0x9112('0xbe')](_0x2a4680[_0x9112('0x40')][_0x9112('0x65')])){for(var _0x39b7e8=0x0;_0x39b7e8<_0x2a4680['query']['ids'][_0x9112('0x43')];_0x39b7e8+=0x1){socket[_0x9112('0xbb')](_0x9112('0xbf'),{'UserId':Number(_0x2a4680[_0x9112('0x40')][_0x9112('0x65')][_0x39b7e8]),'FaxAccountId':Number(_0x2a4680[_0x9112('0x4f')]['id'])});}}else{socket[_0x9112('0xbb')](_0x9112('0xbf'),{'UserId':Number(_0x2a4680['query'][_0x9112('0x65')]),'FaxAccountId':Number(_0x2a4680['params']['id'])});}});}})[_0x9112('0x1d')](respondWithStatusCode(_0x4402b8,null))[_0x9112('0x24')](handleError(_0x4402b8,null));};exports[_0x9112('0xc0')]=function(_0x15a81c,_0x8b2ce6,_0x84cf38){var _0x45bf54={};var _0x3984cf={};var _0x1a549c;var _0x4e43a0;return db['FaxAccount'][_0x9112('0x69')]({'where':{'id':_0x15a81c[_0x9112('0x4f')]['id']}})['then'](handleEntityNotFound(_0x8b2ce6,null))['then'](function(_0x32395f){if(_0x32395f){_0x1a549c=_0x32395f;_0x3984cf['model']=_[_0x9112('0x50')](db[_0x9112('0x71')][_0x9112('0x3c')]);_0x3984cf[_0x9112('0x40')]=_[_0x9112('0x50')](_0x15a81c['query']);_0x3984cf[_0x9112('0x47')]=_[_0x9112('0x51')](_0x3984cf[_0x9112('0x3f')],_0x3984cf[_0x9112('0x40')]);_0x45bf54[_0x9112('0x41')]=_[_0x9112('0x51')](_0x3984cf['model'],qs[_0x9112('0x42')](_0x15a81c[_0x9112('0x40')]['fields']));_0x45bf54['attributes']=_0x45bf54[_0x9112('0x41')][_0x9112('0x43')]?_0x45bf54[_0x9112('0x41')]:_0x3984cf['model'];_0x45bf54[_0x9112('0x60')]=qs[_0x9112('0x45')](_0x15a81c[_0x9112('0x40')][_0x9112('0x45')]);_0x45bf54[_0x9112('0x48')]=qs[_0x9112('0x47')](_[_0x9112('0x46')](_0x15a81c[_0x9112('0x40')],_0x3984cf[_0x9112('0x47')]));if(_0x15a81c['query']['filter']){_0x45bf54[_0x9112('0x48')]=_[_0x9112('0x49')](_0x45bf54[_0x9112('0x48')],{'$or':_[_0x9112('0x3a')](_0x45bf54['attributes'],function(_0x6e961a){var _0x5620ce={};_0x5620ce[_0x6e961a]={'$like':'%'+_0x15a81c[_0x9112('0x40')][_0x9112('0x61')]+'%'};return _0x5620ce;})});}_0x45bf54=_[_0x9112('0x49')]({},_0x45bf54,_0x15a81c['options']);return _0x1a549c[_0x9112('0xc0')](_0x45bf54);}})[_0x9112('0x1d')](function(_0x59669c){if(_0x59669c){_0x4e43a0=_0x59669c[_0x9112('0x43')];if(!_0x15a81c[_0x9112('0x40')][_0x9112('0x6a')]('nolimit')){_0x45bf54['limit']=qs[_0x9112('0x2b')](_0x15a81c['query'][_0x9112('0x2b')]);_0x45bf54[_0x9112('0x29')]=qs['offset'](_0x15a81c[_0x9112('0x40')]['offset']);}return _0x1a549c['getAgents'](_0x45bf54);}})['then'](function(_0x45810b){if(_0x45810b){return _0x45810b?{'count':_0x4e43a0,'rows':_0x45810b}:null;}})[_0x9112('0x1d')](respondWithResult(_0x8b2ce6,null))[_0x9112('0x24')](handleError(_0x8b2ce6,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index c72f786..2a3d5d9 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 _0x3c71=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3c71,0x98));var _0x13c7=function(_0x3d71b5,_0x5826e7){_0x3d71b5=_0x3d71b5-0x0;var _0x46efae=_0x3c71[_0x3d71b5];return _0x46efae;};'use strict';var EventEmitter=require(_0x13c7('0x0'));var FaxAccount=require(_0x13c7('0x1'))['db'][_0x13c7('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x13c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x13c7('0x4'),'afterDestroy':_0x13c7('0x5')};function emitEvent(_0x3edc9a){return function(_0x28c101,_0x19d77c,_0x2d14ed){FaxAccountEvents[_0x13c7('0x6')](_0x3edc9a+':'+_0x28c101['id'],_0x28c101);FaxAccountEvents['emit'](_0x3edc9a,_0x28c101);_0x2d14ed(null);};}for(var e in events){if(events[_0x13c7('0x7')](e)){var event=events[e];FaxAccount[_0x13c7('0x8')](e,emitEvent(event));}}module[_0x13c7('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x53d6=['hasOwnProperty','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','emit'];(function(_0x5bfb2a,_0x11f206){var _0x3ade2c=function(_0xf2e68){while(--_0xf2e68){_0x5bfb2a['push'](_0x5bfb2a['shift']());}};_0x3ade2c(++_0x11f206);}(_0x53d6,0x113));var _0x653d=function(_0x1a3634,_0x3a5fe7){_0x1a3634=_0x1a3634-0x0;var _0x2338c7=_0x53d6[_0x1a3634];return _0x2338c7;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x653d('0x0'))['db'][_0x653d('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x653d('0x2')](0x0);var events={'afterCreate':_0x653d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1002a6){return function(_0x1d87bf,_0x147f62,_0x468c9e){FaxAccountEvents[_0x653d('0x4')](_0x1002a6+':'+_0x1d87bf['id'],_0x1d87bf);FaxAccountEvents[_0x653d('0x4')](_0x1002a6,_0x1d87bf);_0x468c9e(null);};}for(var e in events){if(events[_0x653d('0x5')](e)){var event=events[e];FaxAccount[_0x653d('0x6')](e,emitEvent(event));}}module[_0x653d('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 aa71c84..e11305b 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 _0xefbb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','../../config/logger'];(function(_0xee8399,_0x3bc2f1){var _0xb385e4=function(_0x3544ea){while(--_0x3544ea){_0xee8399['push'](_0xee8399['shift']());}};_0xb385e4(++_0x3bc2f1);}(_0xefbb,0x7c));var _0xbefb=function(_0x2ad298,_0x392405){_0x2ad298=_0x2ad298-0x0;var _0x1cb22a=_0xefbb[_0x2ad298];return _0x1cb22a;};'use strict';var _=require('lodash');var util=require(_0xbefb('0x0'));var logger=require(_0xbefb('0x1'))(_0xbefb('0x2'));var moment=require(_0xbefb('0x3'));var BPromise=require(_0xbefb('0x4'));var rp=require(_0xbefb('0x5'));var fs=require('fs');var path=require(_0xbefb('0x6'));var rimraf=require(_0xbefb('0x7'));var config=require(_0xbefb('0x8'));var attributes=require(_0xbefb('0x9'));module[_0xbefb('0xa')]=function(_0x1118a5,_0x3faf9a){return _0x1118a5[_0xbefb('0xb')](_0xbefb('0xc'),attributes,{'tableName':_0xbefb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef63=['request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x27a036,_0x3c5248){var _0x452696=function(_0x1a7881){while(--_0x1a7881){_0x27a036['push'](_0x27a036['shift']());}};_0x452696(++_0x3c5248);}(_0xef63,0x14c));var _0x3ef6=function(_0x58afc4,_0x2bf44a){_0x58afc4=_0x58afc4-0x0;var _0x4f78a7=_0xef63[_0x58afc4];return _0x4f78a7;};'use strict';var _=require(_0x3ef6('0x0'));var util=require(_0x3ef6('0x1'));var logger=require(_0x3ef6('0x2'))(_0x3ef6('0x3'));var moment=require(_0x3ef6('0x4'));var BPromise=require(_0x3ef6('0x5'));var rp=require(_0x3ef6('0x6'));var fs=require('fs');var path=require(_0x3ef6('0x7'));var rimraf=require(_0x3ef6('0x8'));var config=require('../../config/environment');var attributes=require(_0x3ef6('0x9'));module[_0x3ef6('0xa')]=function(_0x10c1db,_0x528ac0){return _0x10c1db[_0x3ef6('0xb')](_0x3ef6('0xc'),attributes,{'tableName':'fax_accounts','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 fee8da7..485fee8 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 _0x7f46=['close','unmanaged','*,*,*,*','ContactId','interaction','UserId','User','name','unshift','Start','startRouting','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./faxAccount.socket','register','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','include','map','attributes','debug','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','mapKey','find','CmList','List','DESC','FaxApplication','Applications','get','account','list','applications','orderBy','priority','asc','Contacts','length','create','contact','Contact\x20not\x20found','spread','autoclose','push'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7f46,0xaf));var _0x67f4=function(_0x46fe8f,_0x1474ca){_0x46fe8f=_0x46fe8f-0x0;var _0x6ac068=_0x7f46[_0x46fe8f];return _0x6ac068;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x67f4('0x0'));var BPromise=require('bluebird');var rs=require(_0x67f4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x67f4('0x2'));var logger=require(_0x67f4('0x3'))(_0x67f4('0x4'));var config=require(_0x67f4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x67f4('0x6')][_0x67f4('0x7')]({'port':0x232c});config[_0x67f4('0x8')]=_[_0x67f4('0x9')](config[_0x67f4('0x8')],{'host':_0x67f4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67f4('0x8')]));require(_0x67f4('0xb'))[_0x67f4('0xc')](socket);function respondWithRpcPromise(_0x3f85ba,_0x552c59,_0x123612){return new BPromise(function(_0x1a5ca4,_0x599f67){return client['request'](_0x3f85ba,_0x123612)[_0x67f4('0xd')](function(_0x26598d){logger[_0x67f4('0xe')]('FaxAccount,\x20%s,\x20%s',_0x552c59,_0x67f4('0xf'));logger['debug'](_0x67f4('0x10'),_0x552c59,_0x67f4('0xf'),JSON[_0x67f4('0x11')](_0x26598d));if(_0x26598d['error']){if(_0x26598d[_0x67f4('0x12')]['code']===0x1f4){logger[_0x67f4('0x12')]('FaxAccount,\x20%s,\x20%s',_0x552c59,_0x26598d[_0x67f4('0x12')][_0x67f4('0x13')]);return _0x599f67(_0x26598d[_0x67f4('0x12')][_0x67f4('0x13')]);}logger[_0x67f4('0x12')]('FaxAccount,\x20%s,\x20%s',_0x552c59,_0x26598d[_0x67f4('0x12')]['message']);return _0x1a5ca4(_0x26598d['error'][_0x67f4('0x13')]);}else{logger[_0x67f4('0xe')](_0x67f4('0x14'),_0x552c59,_0x67f4('0xf'));_0x1a5ca4(_0x26598d[_0x67f4('0x15')]['message']);}})[_0x67f4('0x16')](function(_0x11a791){logger['error'](_0x67f4('0x14'),_0x552c59,_0x11a791);_0x599f67(_0x11a791);});});}exports[_0x67f4('0x17')]=function(_0x107a9a){var _0x450f11=this;return new Promise(function(_0x40764c,_0x555c75){return db[_0x67f4('0x18')][_0x67f4('0x19')]({'raw':_0x107a9a['options']?_0x107a9a[_0x67f4('0x1a')][_0x67f4('0x1b')]===undefined?!![]:![]:!![],'where':_0x107a9a['options']?_0x107a9a[_0x67f4('0x1a')][_0x67f4('0x1c')]||null:null,'attributes':_0x107a9a['options']?_0x107a9a[_0x67f4('0x1a')]['attributes']||null:null,'limit':_0x107a9a[_0x67f4('0x1a')]?_0x107a9a['options']['limit']||null:null,'include':_0x107a9a['options']?_0x107a9a[_0x67f4('0x1a')][_0x67f4('0x1d')]?_[_0x67f4('0x1e')](_0x107a9a[_0x67f4('0x1a')][_0x67f4('0x1d')],function(_0x540f1a){return{'model':db[_0x540f1a['model']],'as':_0x540f1a['as'],'attributes':_0x540f1a[_0x67f4('0x1f')],'include':_0x540f1a['include']?_['map'](_0x540f1a[_0x67f4('0x1d')],function(_0xa73a5c){return{'model':db[_0xa73a5c['model']],'as':_0xa73a5c['as'],'attributes':_0xa73a5c['attributes'],'include':_0xa73a5c[_0x67f4('0x1d')]?_[_0x67f4('0x1e')](_0xa73a5c[_0x67f4('0x1d')],function(_0x2dc891){return{'model':db[_0x2dc891['model']],'as':_0x2dc891['as'],'attributes':_0x2dc891[_0x67f4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x67f4('0xd')](function(_0x365bbf){logger[_0x67f4('0xe')](_0x67f4('0x17'),_0x107a9a);logger[_0x67f4('0x20')]('GetFaxAccount',_0x107a9a,JSON[_0x67f4('0x11')](_0x365bbf));_0x40764c(_0x365bbf);})[_0x67f4('0x16')](function(_0x40943f){logger['error'](_0x67f4('0x17'),_0x40943f[_0x67f4('0x13')],_0x107a9a);_0x555c75(_0x450f11[_0x67f4('0x12')](0x1f4,_0x40943f[_0x67f4('0x13')]));});});};exports[_0x67f4('0x21')]=function(_0x4bf6f9,_0x2118f7,_0x2f5e20){var _0x45a35d=this;return new Promise(function(_0x302f7f,_0x38bd89){var _0x5ac952={'body':_0x4bf6f9[_0x67f4('0x22')],'channel':_0x67f4('0x23')};var _0x3d961a=[];var _0x4b0f40=[];var _0x6fec93={};return db[_0x67f4('0x24')][_0x67f4('0x25')]()['then'](function(_0x393463){if(!_0x393463){throw new db['Sequelize'][(_0x67f4('0x26'))](_0x67f4('0x27'));}_0x3d961a=_['difference'](_[_0x67f4('0x28')](_0x393463),[_0x67f4('0x29'),_0x67f4('0x2a')]);_0x4b0f40=_['difference'](_[_0x67f4('0x28')](_0x393463),[_0x67f4('0x29'),_0x67f4('0x2a'),_0x67f4('0x2b'),_0x67f4('0x2c')]);if(_0x4bf6f9['body']['id']){delete _0x4bf6f9[_0x67f4('0x22')]['id'];}if(_[_0x67f4('0x2d')](_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x2e')])){throw new db[(_0x67f4('0x2f'))]['ValidationError'](_0x67f4('0x30'));}if(_[_0x67f4('0x2d')](_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x22')])||_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x22')]===''){throw new db[(_0x67f4('0x2f'))][(_0x67f4('0x26'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x67f4('0x2d')](_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x31')])){throw new db['Sequelize'][(_0x67f4('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b0f40);}if(!_['includes'](_0x4b0f40,_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x31')])){throw new db[(_0x67f4('0x2f'))][(_0x67f4('0x26'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b0f40);}_0x6fec93[_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x31')]]=_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x2e')];})[_0x67f4('0xd')](function(){return db[_0x67f4('0x18')][_0x67f4('0x32')]({'where':{'id':_0x4bf6f9['account']['id']},'include':[{'model':db[_0x67f4('0x33')],'as':_0x67f4('0x34'),'include':[{'model':db[_0x67f4('0x24')],'as':'Contacts','where':_0x6fec93,'limit':0x1,'order':[[_0x67f4('0x2a'),_0x67f4('0x35')]]}]},{'model':db[_0x67f4('0x36')],'as':_0x67f4('0x37')}]});})[_0x67f4('0xd')](function(_0x4a5f70){if(_0x4a5f70&&_0x4a5f70['List']){var _0x367e6a=_0x4a5f70[_0x67f4('0x38')]({'plain':!![]});_0x5ac952[_0x67f4('0x39')]=_0x367e6a;_0x5ac952['applications']=_0x367e6a[_0x67f4('0x37')];_0x5ac952[_0x67f4('0x3a')]=_0x367e6a[_0x67f4('0x34')];_0x5ac952[_0x67f4('0x3b')]=_[_0x67f4('0x3c')](_0x5ac952[_0x67f4('0x3b')],[_0x67f4('0x3d')],[_0x67f4('0x3e')]);if(_0x5ac952[_0x67f4('0x39')][_0x67f4('0x37')]){delete _0x5ac952[_0x67f4('0x39')][_0x67f4('0x37')];}if(_0x5ac952[_0x67f4('0x39')][_0x67f4('0x34')]&&_0x5ac952[_0x67f4('0x39')][_0x67f4('0x34')][_0x67f4('0x3f')][_0x67f4('0x40')]){return _0x5ac952['account'][_0x67f4('0x34')][_0x67f4('0x3f')][0x0];}var _0x742058=_[_0x67f4('0x9')](_0x4bf6f9['body'],{'firstName':_0x4bf6f9[_0x67f4('0x22')]['from'],'ListId':_0x367e6a['ListId']});_0x742058[_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x31')]]=_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x2e')];return db[_0x67f4('0x24')][_0x67f4('0x41')](_0x742058,{'fields':_0x3d961a,'raw':!![]});}})['then'](function(_0x13cad6){_0x5ac952[_0x67f4('0x42')]=_0x13cad6;if(_0x13cad6){var _0x2a07dc={'ContactId':_0x13cad6['id'],'FaxAccountId':_0x4bf6f9[_0x67f4('0x39')]['id'],'fax':_0x13cad6['fax']};return db['FaxInteraction'][_0x67f4('0x32')]({'where':{'ContactId':_0x13cad6['id'],'closed':![],'FaxAccountId':_0x4bf6f9['account']['id']}})[_0x67f4('0xd')](function(_0x172dfe){if(_0x172dfe){return[_0x172dfe,![]];}return db['FaxInteraction'][_0x67f4('0x41')](_0x2a07dc)[_0x67f4('0xd')](function(_0x5f2eb6){return[_0x5f2eb6,!![]];});});}else{throw new Error(_0x67f4('0x43'));}})[_0x67f4('0x44')](function(_0x340253,_0x2a90e8){var _0xde4edb=_0x340253[_0x67f4('0x38')]({'plain':!![]});if(_0x2a90e8){if(_0x5ac952[_0x67f4('0x39')][_0x67f4('0x45')]){_0x5ac952['applications'][_0x67f4('0x46')]({'id':0x0,'priority':_0x5ac952[_0x67f4('0x3b')][_0x67f4('0x40')]+0x1,'app':_0x67f4('0x47'),'appdata':_0x67f4('0x48'),'interval':_0x67f4('0x49')});}_0xde4edb['created']=!![];}else{_0xde4edb['created']=![];}_0x5ac952['interaction']=_0xde4edb;return db['FaxMessage'][_0x67f4('0x41')]({'body':_0x4bf6f9[_0x67f4('0x22')][_0x67f4('0x22')],'FaxAccountId':_0x4bf6f9[_0x67f4('0x39')]['id'],'FaxInteractionId':_0x340253['id'],'direction':'in','ContactId':_0x340253[_0x67f4('0x4a')],'AttachmentId':_0x4bf6f9[_0x67f4('0x22')]['AttachmentId']});})[_0x67f4('0xd')](function(_0x107fa1){_0x5ac952[_0x67f4('0x13')]=_0x107fa1;if(_0x5ac952[_0x67f4('0x4b')][_0x67f4('0x4c')]){return db[_0x67f4('0x4d')][_0x67f4('0x32')]({'attributes':['id',_0x67f4('0x4e')],'where':{'id':_0x5ac952[_0x67f4('0x4b')][_0x67f4('0x4c')]}})[_0x67f4('0xd')](function(_0x1a8a5e){if(_0x1a8a5e){_0x5ac952[_0x67f4('0x3b')][_0x67f4('0x4f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1a8a5e[_0x67f4('0x4e')]+','+(_0x5ac952[_0x67f4('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x67f4('0x50'),_0x67f4('0x51'),_0x5ac952);});}return respondWithRpcPromise(_0x67f4('0x50'),_0x67f4('0x51'),_0x5ac952);})['then'](function(_0x539d8b){_0x302f7f(_0x539d8b);})[_0x67f4('0x16')](function(_0x3f139a){_0x38bd89(_0x45a35d[_0x67f4('0x12')](0x1f4,_0x3f139a[_0x67f4('0x13')]));});});}; \ No newline at end of file +var _0x8adb=['../../config/utils','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./faxAccount.socket','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','NotifyFaxAccount','body','CmContact','ValidationError','no\x20available\x20attributes','keys','updatedAt','difference','createdAt','ListId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','account','List','Contacts','Applications','get','applications','list','priority','asc','length','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4afe34,_0xfd87b6){var _0x3d75fd=function(_0x4101c4){while(--_0x4101c4){_0x4afe34['push'](_0x4afe34['shift']());}};_0x3d75fd(++_0xfd87b6);}(_0x8adb,0xfb));var _0xb8ad=function(_0x52d676,_0x2a1345){_0x52d676=_0x52d676-0x0;var _0x4e3472=_0x8adb[_0x52d676];return _0x4e3472;};'use strict';var _=require(_0xb8ad('0x0'));var util=require(_0xb8ad('0x1'));var moment=require(_0xb8ad('0x2'));var BPromise=require(_0xb8ad('0x3'));var rs=require(_0xb8ad('0x4'));var fs=require('fs');var Redis=require(_0xb8ad('0x5'));var db=require(_0xb8ad('0x6'))['db'];var utils=require(_0xb8ad('0x7'));var logger=require('../../config/logger')(_0xb8ad('0x8'));var config=require('../../config/environment');var jayson=require(_0xb8ad('0x9'));var client=jayson[_0xb8ad('0xa')][_0xb8ad('0xb')]({'port':0x232c});config['redis']=_[_0xb8ad('0xc')](config[_0xb8ad('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8ad('0xe'))(new Redis(config[_0xb8ad('0xd')]));require(_0xb8ad('0xf'))['register'](socket);function respondWithRpcPromise(_0x3e657b,_0x152216,_0x7d1e27){return new BPromise(function(_0x55cb20,_0x193b80){return client['request'](_0x3e657b,_0x7d1e27)[_0xb8ad('0x10')](function(_0x833ba4){logger['info'](_0xb8ad('0x11'),_0x152216,_0xb8ad('0x12'));logger[_0xb8ad('0x13')](_0xb8ad('0x14'),_0x152216,'request\x20sent',JSON[_0xb8ad('0x15')](_0x833ba4));if(_0x833ba4[_0xb8ad('0x16')]){if(_0x833ba4['error'][_0xb8ad('0x17')]===0x1f4){logger[_0xb8ad('0x16')](_0xb8ad('0x11'),_0x152216,_0x833ba4[_0xb8ad('0x16')][_0xb8ad('0x18')]);return _0x193b80(_0x833ba4['error'][_0xb8ad('0x18')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x152216,_0x833ba4['error'][_0xb8ad('0x18')]);return _0x55cb20(_0x833ba4[_0xb8ad('0x16')]['message']);}else{logger[_0xb8ad('0x19')](_0xb8ad('0x11'),_0x152216,_0xb8ad('0x12'));_0x55cb20(_0x833ba4[_0xb8ad('0x1a')]['message']);}})[_0xb8ad('0x1b')](function(_0x2481e3){logger[_0xb8ad('0x16')]('FaxAccount,\x20%s,\x20%s',_0x152216,_0x2481e3);_0x193b80(_0x2481e3);});});}exports[_0xb8ad('0x1c')]=function(_0x301db2){var _0x432f6f=this;return new Promise(function(_0x28ee98,_0x1d7323){return db[_0xb8ad('0x1d')][_0xb8ad('0x1e')]({'raw':_0x301db2[_0xb8ad('0x1f')]?_0x301db2['options'][_0xb8ad('0x20')]===undefined?!![]:![]:!![],'where':_0x301db2[_0xb8ad('0x1f')]?_0x301db2[_0xb8ad('0x1f')][_0xb8ad('0x21')]||null:null,'attributes':_0x301db2[_0xb8ad('0x1f')]?_0x301db2[_0xb8ad('0x1f')][_0xb8ad('0x22')]||null:null,'limit':_0x301db2[_0xb8ad('0x1f')]?_0x301db2[_0xb8ad('0x1f')][_0xb8ad('0x23')]||null:null,'include':_0x301db2[_0xb8ad('0x1f')]?_0x301db2[_0xb8ad('0x1f')][_0xb8ad('0x24')]?_[_0xb8ad('0x25')](_0x301db2[_0xb8ad('0x1f')][_0xb8ad('0x24')],function(_0x1e47fa){return{'model':db[_0x1e47fa['model']],'as':_0x1e47fa['as'],'attributes':_0x1e47fa[_0xb8ad('0x22')],'include':_0x1e47fa[_0xb8ad('0x24')]?_['map'](_0x1e47fa[_0xb8ad('0x24')],function(_0x359239){return{'model':db[_0x359239['model']],'as':_0x359239['as'],'attributes':_0x359239[_0xb8ad('0x22')],'include':_0x359239[_0xb8ad('0x24')]?_['map'](_0x359239['include'],function(_0x34453a){return{'model':db[_0x34453a['model']],'as':_0x34453a['as'],'attributes':_0x34453a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c0a59){logger['info']('GetFaxAccount',_0x301db2);logger[_0xb8ad('0x13')](_0xb8ad('0x1c'),_0x301db2,JSON[_0xb8ad('0x15')](_0x3c0a59));_0x28ee98(_0x3c0a59);})[_0xb8ad('0x1b')](function(_0x456a5d){logger[_0xb8ad('0x16')]('GetFaxAccount',_0x456a5d[_0xb8ad('0x18')],_0x301db2);_0x1d7323(_0x432f6f[_0xb8ad('0x16')](0x1f4,_0x456a5d['message']));});});};exports[_0xb8ad('0x26')]=function(_0x5a9cdf,_0xd9a815,_0x491654){var _0x18cb28=this;return new Promise(function(_0x23feac,_0x2b7cbf){var _0x3db5d9={'body':_0x5a9cdf[_0xb8ad('0x27')],'channel':'fax'};var _0xe8e4fe=[];var _0x582840=[];var _0x10f9ff={};return db[_0xb8ad('0x28')]['describe']()[_0xb8ad('0x10')](function(_0xf5eeae){if(!_0xf5eeae){throw new db['Sequelize'][(_0xb8ad('0x29'))](_0xb8ad('0x2a'));}_0xe8e4fe=_['difference'](_[_0xb8ad('0x2b')](_0xf5eeae),['createdAt',_0xb8ad('0x2c')]);_0x582840=_[_0xb8ad('0x2d')](_['keys'](_0xf5eeae),[_0xb8ad('0x2e'),_0xb8ad('0x2c'),'CompanyId',_0xb8ad('0x2f')]);if(_0x5a9cdf[_0xb8ad('0x27')]['id']){delete _0x5a9cdf['body']['id'];}if(_[_0xb8ad('0x30')](_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x31')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb8ad('0x30')](_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x27')])||_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x27')]===''){throw new db[(_0xb8ad('0x32'))][(_0xb8ad('0x29'))](_0xb8ad('0x33'));}if(_[_0xb8ad('0x30')](_0x5a9cdf['body']['mapKey'])){throw new db[(_0xb8ad('0x32'))][(_0xb8ad('0x29'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x582840);}if(!_['includes'](_0x582840,_0x5a9cdf[_0xb8ad('0x27')]['mapKey'])){throw new db[(_0xb8ad('0x32'))][(_0xb8ad('0x29'))](_0xb8ad('0x34')+_0x582840);}_0x10f9ff[_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x35')]]=_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x31')];})[_0xb8ad('0x10')](function(){return db[_0xb8ad('0x1d')][_0xb8ad('0x36')]({'where':{'id':_0x5a9cdf[_0xb8ad('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xb8ad('0x38'),'include':[{'model':db['CmContact'],'as':_0xb8ad('0x39'),'where':_0x10f9ff,'limit':0x1,'order':[[_0xb8ad('0x2c'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0xb8ad('0x3a')}]});})[_0xb8ad('0x10')](function(_0x54892c){if(_0x54892c&&_0x54892c[_0xb8ad('0x38')]){var _0x3757e3=_0x54892c[_0xb8ad('0x3b')]({'plain':!![]});_0x3db5d9[_0xb8ad('0x37')]=_0x3757e3;_0x3db5d9[_0xb8ad('0x3c')]=_0x3757e3[_0xb8ad('0x3a')];_0x3db5d9[_0xb8ad('0x3d')]=_0x3757e3[_0xb8ad('0x38')];_0x3db5d9[_0xb8ad('0x3c')]=_['orderBy'](_0x3db5d9[_0xb8ad('0x3c')],[_0xb8ad('0x3e')],[_0xb8ad('0x3f')]);if(_0x3db5d9['account']['Applications']){delete _0x3db5d9[_0xb8ad('0x37')][_0xb8ad('0x3a')];}if(_0x3db5d9[_0xb8ad('0x37')][_0xb8ad('0x38')]&&_0x3db5d9[_0xb8ad('0x37')][_0xb8ad('0x38')][_0xb8ad('0x39')][_0xb8ad('0x40')]){return _0x3db5d9[_0xb8ad('0x37')]['List']['Contacts'][0x0];}var _0x3ebf00=_[_0xb8ad('0xc')](_0x5a9cdf[_0xb8ad('0x27')],{'firstName':_0x5a9cdf['body'][_0xb8ad('0x31')],'ListId':_0x3757e3[_0xb8ad('0x2f')]});_0x3ebf00[_0x5a9cdf['body']['mapKey']]=_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x31')];return db[_0xb8ad('0x28')][_0xb8ad('0x41')](_0x3ebf00,{'fields':_0xe8e4fe,'raw':!![]});}})[_0xb8ad('0x10')](function(_0x66a92a){_0x3db5d9[_0xb8ad('0x42')]=_0x66a92a;if(_0x66a92a){var _0x5bc92f={'ContactId':_0x66a92a['id'],'FaxAccountId':_0x5a9cdf[_0xb8ad('0x37')]['id'],'fax':_0x66a92a[_0xb8ad('0x43')]};return db['FaxInteraction'][_0xb8ad('0x36')]({'where':{'ContactId':_0x66a92a['id'],'closed':![],'FaxAccountId':_0x5a9cdf[_0xb8ad('0x37')]['id']}})[_0xb8ad('0x10')](function(_0x40192c){if(_0x40192c){return[_0x40192c,![]];}return db[_0xb8ad('0x44')][_0xb8ad('0x41')](_0x5bc92f)[_0xb8ad('0x10')](function(_0x3cd73f){return[_0x3cd73f,!![]];});});}else{throw new Error(_0xb8ad('0x45'));}})[_0xb8ad('0x46')](function(_0x4c4560,_0x43f3a8){var _0x711431=_0x4c4560['get']({'plain':!![]});if(_0x43f3a8){if(_0x3db5d9[_0xb8ad('0x37')][_0xb8ad('0x47')]){_0x3db5d9[_0xb8ad('0x3c')]['push']({'id':0x0,'priority':_0x3db5d9[_0xb8ad('0x3c')][_0xb8ad('0x40')]+0x1,'app':_0xb8ad('0x48'),'appdata':_0xb8ad('0x49'),'interval':_0xb8ad('0x4a')});}_0x711431['created']=!![];}else{_0x711431[_0xb8ad('0x4b')]=![];}_0x3db5d9[_0xb8ad('0x4c')]=_0x711431;return db[_0xb8ad('0x4d')]['create']({'body':_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x27')],'FaxAccountId':_0x5a9cdf[_0xb8ad('0x37')]['id'],'FaxInteractionId':_0x4c4560['id'],'direction':'in','ContactId':_0x4c4560[_0xb8ad('0x4e')],'AttachmentId':_0x5a9cdf[_0xb8ad('0x27')][_0xb8ad('0x4f')]});})['then'](function(_0x2f0685){_0x3db5d9[_0xb8ad('0x18')]=_0x2f0685;if(_0x3db5d9[_0xb8ad('0x4c')]['UserId']){return db[_0xb8ad('0x50')][_0xb8ad('0x36')]({'attributes':['id',_0xb8ad('0x51')],'where':{'id':_0x3db5d9[_0xb8ad('0x4c')][_0xb8ad('0x52')]}})[_0xb8ad('0x10')](function(_0x29fa7c){if(_0x29fa7c){_0x3db5d9[_0xb8ad('0x3c')][_0xb8ad('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x29fa7c[_0xb8ad('0x51')]+','+(_0x3db5d9[_0xb8ad('0x37')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xb8ad('0x54'),_0x3db5d9);});}return respondWithRpcPromise(_0xb8ad('0x55'),_0xb8ad('0x54'),_0x3db5d9);})[_0xb8ad('0x10')](function(_0x2b29af){_0x23feac(_0x2b29af);})[_0xb8ad('0x1b')](function(_0x4af754){_0x2b7cbf(_0x18cb28[_0xb8ad('0x16')](0x1f4,_0x4af754[_0xb8ad('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 50bcf80..80c2fe3 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 _0x2cfb=['save','remove','update','emit','removeListener','length'];(function(_0x254eb4,_0x61b061){var _0x4ab0bd=function(_0x26b07a){while(--_0x26b07a){_0x254eb4['push'](_0x254eb4['shift']());}};_0x4ab0bd(++_0x61b061);}(_0x2cfb,0xe4));var _0xb2cf=function(_0x5aba56,_0x17f8bb){_0x5aba56=_0x5aba56-0x0;var _0x273611=_0x2cfb[_0x5aba56];return _0x273611;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xb2cf('0x0'),_0xb2cf('0x1'),_0xb2cf('0x2')];function createListener(_0x5e5f5c,_0x1e0b12){return function(_0x5a44cd){_0x1e0b12[_0xb2cf('0x3')](_0x5e5f5c,_0x5a44cd);};}function removeListener(_0x1120dd,_0x1c8104){return function(){FaxAccountEvents[_0xb2cf('0x4')](_0x1120dd,_0x1c8104);};}exports['register']=function(_0xbba688){for(var _0x2c30ef=0x0,_0x42f8f6=events[_0xb2cf('0x5')];_0x2c30ef<_0x42f8f6;_0x2c30ef++){var _0x5488d4=events[_0x2c30ef];var _0x519497=createListener('faxAccount:'+_0x5488d4,_0xbba688);FaxAccountEvents['on'](_0x5488d4,_0x519497);}}; \ No newline at end of file +var _0xcc1a=['./faxAccount.events','save','update','register','length','faxAccount:'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xcc1a,0xa8));var _0xacc1=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0xcc1a[_0x3d8ba1];return _0x87804e;};'use strict';var FaxAccountEvents=require(_0xacc1('0x0'));var events=[_0xacc1('0x1'),'remove',_0xacc1('0x2')];function createListener(_0x258fd0,_0x419868){return function(_0x45367b){_0x419868['emit'](_0x258fd0,_0x45367b);};}function removeListener(_0x6211bb,_0x1faac0){return function(){FaxAccountEvents['removeListener'](_0x6211bb,_0x1faac0);};}exports[_0xacc1('0x3')]=function(_0x4fefdd){for(var _0x44513d=0x0,_0x5b9660=events[_0xacc1('0x4')];_0x44513d<_0x5b9660;_0x44513d++){var _0x1b3ea5=events[_0x44513d];var _0x4f2288=createListener(_0xacc1('0x5')+_0x1b3ea5,_0x4fefdd);FaxAccountEvents['on'](_0x1b3ea5,_0x4f2288);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index ce2419e..f2f04db 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x20f0cc,_0x3a7095){var _0x4c3364=function(_0x1f58c1){while(--_0x1f58c1){_0x20f0cc['push'](_0x20f0cc['shift']());}};_0x4c3364(++_0x3a7095);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x35e534,_0x1652a9){var _0x4ea57f=function(_0xd8fae){while(--_0xd8fae){_0x35e534['push'](_0x35e534['shift']());}};_0x4ea57f(++_0x1652a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 0e2af26..930d3ea 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 _0xe8c4=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x5f126c,_0x3456cc){var _0x2660de=function(_0x5e0e61){while(--_0x5e0e61){_0x5f126c['push'](_0x5f126c['shift']());}};_0x2660de(++_0x3456cc);}(_0xe8c4,0x184));var _0x4e8c=function(_0x428a71,_0x39fe15){_0x428a71=_0x428a71-0x0;var _0x4bfcae=_0xe8c4[_0x428a71];return _0x4bfcae;};'use strict';var Sequelize=require(_0x4e8c('0x0'));module[_0x4e8c('0x1')]={'priority':{'type':Sequelize[_0x4e8c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4e8c('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4e8c('0x4')]},'interval':{'type':Sequelize[_0x4e8c('0x4')],'defaultValue':_0x4e8c('0x5')}}; \ No newline at end of file +var _0x6fc6=['exports','INTEGER','STRING','sequelize'];(function(_0x5ce850,_0x28bfe5){var _0x12753a=function(_0x5eacdb){while(--_0x5eacdb){_0x5ce850['push'](_0x5ce850['shift']());}};_0x12753a(++_0x28bfe5);}(_0x6fc6,0x1cb));var _0x66fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6fc6[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x66fc('0x0'));module[_0x66fc('0x1')]={'priority':{'type':Sequelize[_0x66fc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x66fc('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x66fc('0x3')]},'interval':{'type':Sequelize[_0x66fc('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 476a113..0daaf0c 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 _0x09a4=['map','FaxApplication','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','includeAll','include','then','rows','catch','show','params','length','options','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','end','json','offset','limit','undefined','count','status','set','apply','save','update','destroy','stack','name','send','index'];(function(_0x48ffb9,_0x4365b7){var _0x5ba645=function(_0x4b2839){while(--_0x4b2839){_0x48ffb9['push'](_0x48ffb9['shift']());}};_0x5ba645(++_0x4365b7);}(_0x09a4,0x167));var _0x409a=function(_0x2f2a30,_0x11f919){_0x2f2a30=_0x2f2a30-0x0;var _0xf06abb=_0x09a4[_0x2f2a30];return _0xf06abb;};'use strict';var emlformat=require(_0x409a('0x0'));var rimraf=require(_0x409a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x409a('0x2'));var rp=require(_0x409a('0x3'));var moment=require(_0x409a('0x4'));var BPromise=require(_0x409a('0x5'));var Mustache=require('mustache');var util=require(_0x409a('0x6'));var path=require(_0x409a('0x7'));var sox=require('sox');var csv=require(_0x409a('0x8'));var ejs=require(_0x409a('0x9'));var fs=require('fs');var fs_extra=require(_0x409a('0xa'));var _=require(_0x409a('0xb'));var squel=require(_0x409a('0xc'));var crypto=require(_0x409a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x409a('0xe'));var toCsv=require(_0x409a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x409a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x409a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x409a('0x11'))(_0x409a('0x12'));var utils=require('../../config/utils');var config=require(_0x409a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x409a('0x14'))['db'];function respondWithStatusCode(_0x343752,_0x9436b1){_0x9436b1=_0x9436b1||0xcc;return function(_0x2747b3){if(_0x2747b3){return _0x343752['sendStatus'](_0x9436b1);}return _0x343752['status'](_0x9436b1)[_0x409a('0x15')]();};}function respondWithResult(_0x21fa10,_0x7aa8e5){_0x7aa8e5=_0x7aa8e5||0xc8;return function(_0x247e73){if(_0x247e73){return _0x21fa10['status'](_0x7aa8e5)[_0x409a('0x16')](_0x247e73);}};}function respondWithFilteredResult(_0x47ebcb,_0x3a8702){return function(_0x4bae9c){if(_0x4bae9c){var _0x1ef95a=typeof _0x3a8702[_0x409a('0x17')]==='undefined'&&typeof _0x3a8702[_0x409a('0x18')]===_0x409a('0x19');var _0x470403=_0x4bae9c[_0x409a('0x1a')];var _0xd76550=_0x1ef95a?0x0:_0x3a8702[_0x409a('0x17')];var _0x3b74a5=_0x1ef95a?_0x4bae9c['count']:_0x3a8702['offset']+_0x3a8702[_0x409a('0x18')];var _0x7335c9;if(_0x3b74a5>=_0x470403){_0x3b74a5=_0x470403;_0x7335c9=0xc8;}else{_0x7335c9=0xce;}_0x47ebcb[_0x409a('0x1b')](_0x7335c9);return _0x47ebcb[_0x409a('0x1c')]('Content-Range',_0xd76550+'-'+_0x3b74a5+'/'+_0x470403)[_0x409a('0x16')](_0x4bae9c);}return null;};}function patchUpdates(_0x1e742b){return function(_0x1421ac){try{jsonpatch[_0x409a('0x1d')](_0x1421ac,_0x1e742b,!![]);}catch(_0x3cfbf1){return BPromise['reject'](_0x3cfbf1);}return _0x1421ac[_0x409a('0x1e')]();};}function saveUpdates(_0x1d6cf6,_0x17a4f6){return function(_0x38fd98){if(_0x38fd98){return _0x38fd98[_0x409a('0x1f')](_0x1d6cf6)['then'](function(_0x1760b1){return _0x1760b1;});}return null;};}function removeEntity(_0x25fc09,_0x4d7a69){return function(_0xa400dc){if(_0xa400dc){return _0xa400dc[_0x409a('0x20')]()['then'](function(){_0x25fc09[_0x409a('0x1b')](0xcc)[_0x409a('0x15')]();});}};}function handleEntityNotFound(_0x1209cf,_0x250d2b){return function(_0x4cc452){if(!_0x4cc452){_0x1209cf['sendStatus'](0x194);}return _0x4cc452;};}function handleError(_0x20d18f,_0xd57f2c){_0xd57f2c=_0xd57f2c||0x1f4;return function(_0x2a4ac4){logger['error'](_0x2a4ac4[_0x409a('0x21')]);if(_0x2a4ac4[_0x409a('0x22')]){delete _0x2a4ac4[_0x409a('0x22')];}_0x20d18f[_0x409a('0x1b')](_0xd57f2c)[_0x409a('0x23')](_0x2a4ac4);};}exports[_0x409a('0x24')]=function(_0x360a46,_0x3664a1){var _0xecfd65={},_0x18d03d={},_0x2e0225={'count':0x0,'rows':[]};var _0x23fc43=_[_0x409a('0x25')](db[_0x409a('0x26')][_0x409a('0x27')],function(_0x43683){return{'name':_0x43683['fieldName'],'type':_0x43683['type'][_0x409a('0x28')]};});_0x18d03d[_0x409a('0x29')]=_[_0x409a('0x25')](_0x23fc43,_0x409a('0x22'));_0x18d03d[_0x409a('0x2a')]=_[_0x409a('0x2b')](_0x360a46[_0x409a('0x2a')]);_0x18d03d[_0x409a('0x2c')]=_[_0x409a('0x2d')](_0x18d03d[_0x409a('0x29')],_0x18d03d['query']);_0xecfd65[_0x409a('0x2e')]=_['intersection'](_0x18d03d[_0x409a('0x29')],qs[_0x409a('0x2f')](_0x360a46[_0x409a('0x2a')][_0x409a('0x2f')]));_0xecfd65[_0x409a('0x2e')]=_0xecfd65[_0x409a('0x2e')]['length']?_0xecfd65[_0x409a('0x2e')]:_0x18d03d[_0x409a('0x29')];if(!_0x360a46[_0x409a('0x2a')]['hasOwnProperty'](_0x409a('0x30'))){_0xecfd65['limit']=qs[_0x409a('0x18')](_0x360a46['query'][_0x409a('0x18')]);_0xecfd65['offset']=qs[_0x409a('0x17')](_0x360a46[_0x409a('0x2a')][_0x409a('0x17')]);}_0xecfd65[_0x409a('0x31')]=qs[_0x409a('0x32')](_0x360a46['query'][_0x409a('0x32')]);_0xecfd65[_0x409a('0x33')]=qs[_0x409a('0x2c')](_['pick'](_0x360a46['query'],_0x18d03d['filters']),_0x23fc43);if(_0x360a46[_0x409a('0x2a')][_0x409a('0x34')]){_0xecfd65[_0x409a('0x33')]=_[_0x409a('0x35')](_0xecfd65['where'],{'$or':_[_0x409a('0x25')](_0x23fc43,function(_0x57cb71){if(_0x57cb71[_0x409a('0x36')]!=='VIRTUAL'){var _0x4fa864={};_0x4fa864[_0x57cb71['name']]={'$like':'%'+_0x360a46[_0x409a('0x2a')][_0x409a('0x34')]+'%'};return _0x4fa864;}})});}_0xecfd65=_['merge']({},_0xecfd65,_0x360a46['options']);var _0x1a2faa={'where':_0xecfd65[_0x409a('0x33')]};return db['FaxApplication']['count'](_0x1a2faa)['then'](function(_0x4547b2){_0x2e0225[_0x409a('0x1a')]=_0x4547b2;if(_0x360a46[_0x409a('0x2a')][_0x409a('0x37')]){_0xecfd65[_0x409a('0x38')]=[{'all':!![]}];}return db[_0x409a('0x26')]['findAll'](_0xecfd65);})[_0x409a('0x39')](function(_0x1e8c1b){_0x2e0225[_0x409a('0x3a')]=_0x1e8c1b;return _0x2e0225;})[_0x409a('0x39')](respondWithFilteredResult(_0x3664a1,_0xecfd65))[_0x409a('0x3b')](handleError(_0x3664a1,null));};exports[_0x409a('0x3c')]=function(_0x52d80c,_0x478e49){var _0x5b71de={'raw':!![],'where':{'id':_0x52d80c[_0x409a('0x3d')]['id']}},_0x3ce8d2={};_0x3ce8d2['model']=_['keys'](db['FaxApplication']['rawAttributes']);_0x3ce8d2['query']=_[_0x409a('0x2b')](_0x52d80c[_0x409a('0x2a')]);_0x3ce8d2['filters']=_[_0x409a('0x2d')](_0x3ce8d2[_0x409a('0x29')],_0x3ce8d2['query']);_0x5b71de[_0x409a('0x2e')]=_['intersection'](_0x3ce8d2[_0x409a('0x29')],qs['fields'](_0x52d80c[_0x409a('0x2a')][_0x409a('0x2f')]));_0x5b71de['attributes']=_0x5b71de[_0x409a('0x2e')][_0x409a('0x3e')]?_0x5b71de[_0x409a('0x2e')]:_0x3ce8d2[_0x409a('0x29')];if(_0x52d80c['query'][_0x409a('0x37')]){_0x5b71de['include']=[{'all':!![]}];}_0x5b71de=_[_0x409a('0x35')]({},_0x5b71de,_0x52d80c[_0x409a('0x3f')]);return db[_0x409a('0x26')][_0x409a('0x40')](_0x5b71de)[_0x409a('0x39')](handleEntityNotFound(_0x478e49,null))[_0x409a('0x39')](respondWithResult(_0x478e49,null))[_0x409a('0x3b')](handleError(_0x478e49,null));};exports['create']=function(_0x304d50,_0x5953c4){return db[_0x409a('0x26')]['create'](_0x304d50[_0x409a('0x41')],{})['then'](respondWithResult(_0x5953c4,0xc9))[_0x409a('0x3b')](handleError(_0x5953c4,null));};exports['update']=function(_0x2ab1db,_0x489243){if(_0x2ab1db[_0x409a('0x41')]['id']){delete _0x2ab1db[_0x409a('0x41')]['id'];}return db[_0x409a('0x26')][_0x409a('0x40')]({'where':{'id':_0x2ab1db[_0x409a('0x3d')]['id']}})[_0x409a('0x39')](handleEntityNotFound(_0x489243,null))[_0x409a('0x39')](saveUpdates(_0x2ab1db[_0x409a('0x41')],null))[_0x409a('0x39')](respondWithResult(_0x489243,null))[_0x409a('0x3b')](handleError(_0x489243,null));};exports[_0x409a('0x20')]=function(_0x723c5,_0x1e3641){return db[_0x409a('0x26')][_0x409a('0x40')]({'where':{'id':_0x723c5[_0x409a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1e3641,null))[_0x409a('0x39')](removeEntity(_0x1e3641,null))[_0x409a('0x3b')](handleError(_0x1e3641,null));}; \ No newline at end of file +var _0x0505=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','send','index','map','FaxApplication','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0505,0x7f));var _0x5050=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x0505[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x5050('0x0'));var rimraf=require(_0x5050('0x1'));var zipdir=require(_0x5050('0x2'));var jsonpatch=require(_0x5050('0x3'));var rp=require(_0x5050('0x4'));var moment=require(_0x5050('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5050('0x6'));var util=require(_0x5050('0x7'));var path=require('path');var sox=require(_0x5050('0x8'));var csv=require(_0x5050('0x9'));var ejs=require(_0x5050('0xa'));var fs=require('fs');var fs_extra=require(_0x5050('0xb'));var _=require(_0x5050('0xc'));var squel=require(_0x5050('0xd'));var crypto=require(_0x5050('0xe'));var jsforce=require(_0x5050('0xf'));var deskjs=require(_0x5050('0x10'));var toCsv=require(_0x5050('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5050('0x11'));var authService=require(_0x5050('0x12'));var qs=require(_0x5050('0x13'));var as=require(_0x5050('0x14'));var hardwareService=require(_0x5050('0x15'));var logger=require('../../config/logger')(_0x5050('0x16'));var utils=require(_0x5050('0x17'));var config=require(_0x5050('0x18'));var licenseUtil=require(_0x5050('0x19'));var db=require(_0x5050('0x1a'))['db'];function respondWithStatusCode(_0x135431,_0x3903fe){_0x3903fe=_0x3903fe||0xcc;return function(_0x49c167){if(_0x49c167){return _0x135431[_0x5050('0x1b')](_0x3903fe);}return _0x135431[_0x5050('0x1c')](_0x3903fe)[_0x5050('0x1d')]();};}function respondWithResult(_0x4a9c8b,_0x48df9a){_0x48df9a=_0x48df9a||0xc8;return function(_0x4f6d0f){if(_0x4f6d0f){return _0x4a9c8b[_0x5050('0x1c')](_0x48df9a)[_0x5050('0x1e')](_0x4f6d0f);}};}function respondWithFilteredResult(_0xcd6dca,_0x61a708){return function(_0x997f09){if(_0x997f09){var _0x40d3ac=typeof _0x61a708[_0x5050('0x1f')]===_0x5050('0x20')&&typeof _0x61a708[_0x5050('0x21')]===_0x5050('0x20');var _0x4c89aa=_0x997f09['count'];var _0xa70dea=_0x40d3ac?0x0:_0x61a708[_0x5050('0x1f')];var _0x19b2fa=_0x40d3ac?_0x997f09[_0x5050('0x22')]:_0x61a708[_0x5050('0x1f')]+_0x61a708[_0x5050('0x21')];var _0x2ce422;if(_0x19b2fa>=_0x4c89aa){_0x19b2fa=_0x4c89aa;_0x2ce422=0xc8;}else{_0x2ce422=0xce;}_0xcd6dca['status'](_0x2ce422);return _0xcd6dca[_0x5050('0x23')](_0x5050('0x24'),_0xa70dea+'-'+_0x19b2fa+'/'+_0x4c89aa)[_0x5050('0x1e')](_0x997f09);}return null;};}function patchUpdates(_0x1ea510){return function(_0x6ed5c2){try{jsonpatch[_0x5050('0x25')](_0x6ed5c2,_0x1ea510,!![]);}catch(_0x273d81){return BPromise['reject'](_0x273d81);}return _0x6ed5c2['save']();};}function saveUpdates(_0x17e634,_0x2506da){return function(_0x13d68b){if(_0x13d68b){return _0x13d68b[_0x5050('0x26')](_0x17e634)['then'](function(_0x1d9c19){return _0x1d9c19;});}return null;};}function removeEntity(_0x316733,_0x454a57){return function(_0x2337b7){if(_0x2337b7){return _0x2337b7[_0x5050('0x27')]()[_0x5050('0x28')](function(){_0x316733['status'](0xcc)[_0x5050('0x1d')]();});}};}function handleEntityNotFound(_0x554473,_0x17430a){return function(_0x5e9c5e){if(!_0x5e9c5e){_0x554473[_0x5050('0x1b')](0x194);}return _0x5e9c5e;};}function handleError(_0x37feb7,_0x55925a){_0x55925a=_0x55925a||0x1f4;return function(_0x53c8f4){logger[_0x5050('0x29')](_0x53c8f4[_0x5050('0x2a')]);if(_0x53c8f4['name']){delete _0x53c8f4['name'];}_0x37feb7[_0x5050('0x1c')](_0x55925a)[_0x5050('0x2b')](_0x53c8f4);};}exports[_0x5050('0x2c')]=function(_0x36e517,_0x41e1d8){var _0x29ddef={},_0x45bead={},_0x40b955={'count':0x0,'rows':[]};var _0x29ce7f=_[_0x5050('0x2d')](db[_0x5050('0x2e')]['rawAttributes'],function(_0x4781a0){return{'name':_0x4781a0['fieldName'],'type':_0x4781a0[_0x5050('0x2f')][_0x5050('0x30')]};});_0x45bead[_0x5050('0x31')]=_[_0x5050('0x2d')](_0x29ce7f,_0x5050('0x32'));_0x45bead['query']=_[_0x5050('0x33')](_0x36e517[_0x5050('0x34')]);_0x45bead[_0x5050('0x35')]=_[_0x5050('0x36')](_0x45bead[_0x5050('0x31')],_0x45bead[_0x5050('0x34')]);_0x29ddef[_0x5050('0x37')]=_[_0x5050('0x36')](_0x45bead['model'],qs[_0x5050('0x38')](_0x36e517['query'][_0x5050('0x38')]));_0x29ddef[_0x5050('0x37')]=_0x29ddef['attributes'][_0x5050('0x39')]?_0x29ddef[_0x5050('0x37')]:_0x45bead[_0x5050('0x31')];if(!_0x36e517['query'][_0x5050('0x3a')](_0x5050('0x3b'))){_0x29ddef[_0x5050('0x21')]=qs[_0x5050('0x21')](_0x36e517[_0x5050('0x34')]['limit']);_0x29ddef[_0x5050('0x1f')]=qs['offset'](_0x36e517[_0x5050('0x34')][_0x5050('0x1f')]);}_0x29ddef[_0x5050('0x3c')]=qs[_0x5050('0x3d')](_0x36e517['query'][_0x5050('0x3d')]);_0x29ddef['where']=qs[_0x5050('0x35')](_['pick'](_0x36e517[_0x5050('0x34')],_0x45bead['filters']),_0x29ce7f);if(_0x36e517[_0x5050('0x34')][_0x5050('0x3e')]){_0x29ddef['where']=_[_0x5050('0x3f')](_0x29ddef[_0x5050('0x40')],{'$or':_[_0x5050('0x2d')](_0x29ce7f,function(_0x5ef4f3){if(_0x5ef4f3[_0x5050('0x2f')]!=='VIRTUAL'){var _0x2fe16b={};_0x2fe16b[_0x5ef4f3[_0x5050('0x32')]]={'$like':'%'+_0x36e517[_0x5050('0x34')]['filter']+'%'};return _0x2fe16b;}})});}_0x29ddef=_[_0x5050('0x3f')]({},_0x29ddef,_0x36e517[_0x5050('0x41')]);var _0x5ad491={'where':_0x29ddef['where']};return db['FaxApplication'][_0x5050('0x22')](_0x5ad491)[_0x5050('0x28')](function(_0x1d7c13){_0x40b955[_0x5050('0x22')]=_0x1d7c13;if(_0x36e517[_0x5050('0x34')][_0x5050('0x42')]){_0x29ddef[_0x5050('0x43')]=[{'all':!![]}];}return db[_0x5050('0x2e')][_0x5050('0x44')](_0x29ddef);})['then'](function(_0x41d0e2){_0x40b955[_0x5050('0x45')]=_0x41d0e2;return _0x40b955;})['then'](respondWithFilteredResult(_0x41e1d8,_0x29ddef))[_0x5050('0x46')](handleError(_0x41e1d8,null));};exports[_0x5050('0x47')]=function(_0x2354b5,_0xc7ae52){var _0x47a0e8={'raw':!![],'where':{'id':_0x2354b5[_0x5050('0x48')]['id']}},_0x47c973={};_0x47c973[_0x5050('0x31')]=_[_0x5050('0x33')](db[_0x5050('0x2e')][_0x5050('0x49')]);_0x47c973[_0x5050('0x34')]=_[_0x5050('0x33')](_0x2354b5['query']);_0x47c973[_0x5050('0x35')]=_[_0x5050('0x36')](_0x47c973[_0x5050('0x31')],_0x47c973[_0x5050('0x34')]);_0x47a0e8['attributes']=_[_0x5050('0x36')](_0x47c973[_0x5050('0x31')],qs[_0x5050('0x38')](_0x2354b5[_0x5050('0x34')][_0x5050('0x38')]));_0x47a0e8['attributes']=_0x47a0e8[_0x5050('0x37')][_0x5050('0x39')]?_0x47a0e8['attributes']:_0x47c973[_0x5050('0x31')];if(_0x2354b5[_0x5050('0x34')][_0x5050('0x42')]){_0x47a0e8[_0x5050('0x43')]=[{'all':!![]}];}_0x47a0e8=_[_0x5050('0x3f')]({},_0x47a0e8,_0x2354b5[_0x5050('0x41')]);return db[_0x5050('0x2e')]['find'](_0x47a0e8)[_0x5050('0x28')](handleEntityNotFound(_0xc7ae52,null))[_0x5050('0x28')](respondWithResult(_0xc7ae52,null))[_0x5050('0x46')](handleError(_0xc7ae52,null));};exports['create']=function(_0xe3239c,_0x37da7d){return db[_0x5050('0x2e')]['create'](_0xe3239c[_0x5050('0x4a')],{})[_0x5050('0x28')](respondWithResult(_0x37da7d,0xc9))[_0x5050('0x46')](handleError(_0x37da7d,null));};exports[_0x5050('0x26')]=function(_0x2832cd,_0x181b09){if(_0x2832cd[_0x5050('0x4a')]['id']){delete _0x2832cd[_0x5050('0x4a')]['id'];}return db[_0x5050('0x2e')]['find']({'where':{'id':_0x2832cd[_0x5050('0x48')]['id']}})[_0x5050('0x28')](handleEntityNotFound(_0x181b09,null))[_0x5050('0x28')](saveUpdates(_0x2832cd[_0x5050('0x4a')],null))[_0x5050('0x28')](respondWithResult(_0x181b09,null))[_0x5050('0x46')](handleError(_0x181b09,null));};exports[_0x5050('0x27')]=function(_0x2051b4,_0x46a3dd){return db['FaxApplication'][_0x5050('0x4b')]({'where':{'id':_0x2051b4[_0x5050('0x48')]['id']}})[_0x5050('0x28')](handleEntityNotFound(_0x46a3dd,null))[_0x5050('0x28')](removeEntity(_0x46a3dd,null))[_0x5050('0x46')](handleError(_0x46a3dd,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ff134a3..6fbc479 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 _0x0698=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x0698,0x132));var _0x8069=function(_0x56a41f,_0x14a890){_0x56a41f=_0x56a41f-0x0;var _0x111926=_0x0698[_0x56a41f];return _0x111926;};'use strict';var _=require(_0x8069('0x0'));var util=require(_0x8069('0x1'));var logger=require(_0x8069('0x2'))(_0x8069('0x3'));var moment=require(_0x8069('0x4'));var BPromise=require(_0x8069('0x5'));var rp=require(_0x8069('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8069('0x7'));var attributes=require('./faxApplication.attributes');module[_0x8069('0x8')]=function(_0xadc96e,_0x840bde){return _0xadc96e[_0x8069('0x9')](_0x8069('0xa'),attributes,{'tableName':_0x8069('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8069('0xc'),'collate':_0x8069('0xd')});}; \ No newline at end of file +var _0x649d=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','path','rimraf','./faxApplication.attributes','exports','define'];(function(_0x13cbda,_0x5a00cb){var _0x30cb25=function(_0x1c751f){while(--_0x1c751f){_0x13cbda['push'](_0x13cbda['shift']());}};_0x30cb25(++_0x5a00cb);}(_0x649d,0x1a8));var _0xd649=function(_0x53827c,_0x571297){_0x53827c=_0x53827c-0x0;var _0x35f980=_0x649d[_0x53827c];return _0x35f980;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd649('0x0'));var moment=require(_0xd649('0x1'));var BPromise=require(_0xd649('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd649('0x3'));var rimraf=require(_0xd649('0x4'));var config=require('../../config/environment');var attributes=require(_0xd649('0x5'));module[_0xd649('0x6')]=function(_0x9f6de6,_0x3b463d){return _0x9f6de6[_0xd649('0x7')](_0xd649('0x8'),attributes,{'tableName':_0xd649('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd649('0xa'),'collate':_0xd649('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e63bac7..8b0daba 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 _0x1753=['../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','update','options','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x43b87f,_0x48eb81){var _0x28391f=function(_0x41f5d0){while(--_0x41f5d0){_0x43b87f['push'](_0x43b87f['shift']());}};_0x28391f(++_0x48eb81);}(_0x1753,0x107));var _0x3175=function(_0x1db70e,_0x3b9e17){_0x1db70e=_0x1db70e-0x0;var _0x6447f=_0x1753[_0x1db70e];return _0x6447f;};'use strict';var _=require('lodash');var util=require(_0x3175('0x0'));var moment=require(_0x3175('0x1'));var BPromise=require(_0x3175('0x2'));var rs=require(_0x3175('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3175('0x4'));var logger=require(_0x3175('0x5'))(_0x3175('0x6'));var config=require(_0x3175('0x7'));var jayson=require(_0x3175('0x8'));var client=jayson[_0x3175('0x9')][_0x3175('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x298d5b,_0x2d4e46,_0x3f585f){return new BPromise(function(_0x21a729,_0x291694){return client['request'](_0x298d5b,_0x3f585f)[_0x3175('0xb')](function(_0x5ab895){logger[_0x3175('0xc')](_0x3175('0xd'),_0x2d4e46,_0x3175('0xe'));logger[_0x3175('0xf')](_0x3175('0x10'),_0x2d4e46,_0x3175('0xe'),JSON[_0x3175('0x11')](_0x5ab895));if(_0x5ab895[_0x3175('0x12')]){if(_0x5ab895['error'][_0x3175('0x13')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x2d4e46,_0x5ab895[_0x3175('0x12')][_0x3175('0x14')]);return _0x291694(_0x5ab895[_0x3175('0x12')]['message']);}logger[_0x3175('0x12')](_0x3175('0xd'),_0x2d4e46,_0x5ab895[_0x3175('0x12')][_0x3175('0x14')]);return _0x21a729(_0x5ab895[_0x3175('0x12')][_0x3175('0x14')]);}else{logger[_0x3175('0xc')](_0x3175('0xd'),_0x2d4e46,_0x3175('0xe'));_0x21a729(_0x5ab895[_0x3175('0x15')][_0x3175('0x14')]);}})[_0x3175('0x16')](function(_0xb562f){logger[_0x3175('0x12')](_0x3175('0xd'),_0x2d4e46,_0xb562f);_0x291694(_0xb562f);});});}exports[_0x3175('0x17')]=function(_0x597757){var _0x5ab123=this;return new Promise(function(_0x5a617a,_0x3d4d84){return db['FaxApplication'][_0x3175('0x18')](_0x597757['body'],{'raw':_0x597757[_0x3175('0x19')]?_0x597757[_0x3175('0x19')][_0x3175('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x597757[_0x3175('0x19')]?_0x597757[_0x3175('0x19')][_0x3175('0x1b')]||null:null,'attributes':_0x597757[_0x3175('0x19')]?_0x597757[_0x3175('0x19')][_0x3175('0x1c')]||null:null,'limit':_0x597757[_0x3175('0x19')]?_0x597757['options'][_0x3175('0x1d')]||null:null})[_0x3175('0xb')](function(_0x13c795){logger[_0x3175('0xc')]('UpdateFaxApplication',_0x597757);logger[_0x3175('0xf')](_0x3175('0x17'),_0x597757,JSON[_0x3175('0x11')](_0x13c795));_0x5a617a(_0x13c795);})[_0x3175('0x16')](function(_0x5b8ac5){logger[_0x3175('0x12')](_0x3175('0x17'),_0x5b8ac5[_0x3175('0x14')],_0x597757);_0x3d4d84(_0x5ab123[_0x3175('0x12')](0x1f4,_0x5b8ac5[_0x3175('0x14')]));});});}; \ No newline at end of file +var _0x04b6=['then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateFaxApplication','raw','options','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3a2451,_0x3c4e0d){var _0x4f6ae8=function(_0x357760){while(--_0x357760){_0x3a2451['push'](_0x3a2451['shift']());}};_0x4f6ae8(++_0x3c4e0d);}(_0x04b6,0x1e0));var _0x604b=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x04b6[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0x604b('0x0'));var util=require('util');var moment=require(_0x604b('0x1'));var BPromise=require(_0x604b('0x2'));var rs=require(_0x604b('0x3'));var fs=require('fs');var Redis=require(_0x604b('0x4'));var db=require(_0x604b('0x5'))['db'];var utils=require(_0x604b('0x6'));var logger=require(_0x604b('0x7'))(_0x604b('0x8'));var config=require(_0x604b('0x9'));var jayson=require(_0x604b('0xa'));var client=jayson['client'][_0x604b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1363f5,_0x189d04,_0x5404af){return new BPromise(function(_0x300640,_0x157309){return client[_0x604b('0xc')](_0x1363f5,_0x5404af)[_0x604b('0xd')](function(_0x1248bb){logger[_0x604b('0xe')](_0x604b('0xf'),_0x189d04,_0x604b('0x10'));logger['debug'](_0x604b('0x11'),_0x189d04,_0x604b('0x10'),JSON[_0x604b('0x12')](_0x1248bb));if(_0x1248bb['error']){if(_0x1248bb[_0x604b('0x13')][_0x604b('0x14')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x189d04,_0x1248bb[_0x604b('0x13')][_0x604b('0x15')]);return _0x157309(_0x1248bb[_0x604b('0x13')][_0x604b('0x15')]);}logger[_0x604b('0x13')]('FaxApplication,\x20%s,\x20%s',_0x189d04,_0x1248bb[_0x604b('0x13')][_0x604b('0x15')]);return _0x300640(_0x1248bb[_0x604b('0x13')][_0x604b('0x15')]);}else{logger[_0x604b('0xe')](_0x604b('0xf'),_0x189d04,_0x604b('0x10'));_0x300640(_0x1248bb['result'][_0x604b('0x15')]);}})['catch'](function(_0x19aef4){logger[_0x604b('0x13')]('FaxApplication,\x20%s,\x20%s',_0x189d04,_0x19aef4);_0x157309(_0x19aef4);});});}exports[_0x604b('0x16')]=function(_0x1c03cf){var _0x563afb=this;return new Promise(function(_0x5a149c,_0x507d6d){return db['FaxApplication']['update'](_0x1c03cf['body'],{'raw':_0x1c03cf['options']?_0x1c03cf['options'][_0x604b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c03cf['options']?_0x1c03cf[_0x604b('0x18')]['where']||null:null,'attributes':_0x1c03cf[_0x604b('0x18')]?_0x1c03cf['options'][_0x604b('0x19')]||null:null,'limit':_0x1c03cf[_0x604b('0x18')]?_0x1c03cf[_0x604b('0x18')][_0x604b('0x1a')]||null:null})[_0x604b('0xd')](function(_0x2ae6f8){logger[_0x604b('0xe')](_0x604b('0x16'),_0x1c03cf);logger[_0x604b('0x1b')](_0x604b('0x16'),_0x1c03cf,JSON['stringify'](_0x2ae6f8));_0x5a149c(_0x2ae6f8);})[_0x604b('0x1c')](function(_0x19a5e7){logger['error']('UpdateFaxApplication',_0x19a5e7[_0x604b('0x15')],_0x1c03cf);_0x507d6d(_0x563afb[_0x604b('0x13')](0x1f4,_0x19a5e7['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 2cb9f1e..78fd1df 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 _0xf7b4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0xf7b4,0x152));var _0x4f7b=function(_0x3f6fe6,_0x52243c){_0x3f6fe6=_0x3f6fe6-0x0;var _0xebbe7f=_0xf7b4[_0x3f6fe6];return _0xebbe7f;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x8')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xa'),auth['isAuthenticated'](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x34b7=['express','Router','fs-extra','../../components/auth/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','path','connect-timeout'];(function(_0x41b02d,_0x162a8a){var _0x48a625=function(_0xf50ca7){while(--_0xf50ca7){_0x41b02d['push'](_0x41b02d['shift']());}};_0x48a625(++_0x162a8a);}(_0x34b7,0x196));var _0x734b=function(_0x501035,_0x3c1742){_0x501035=_0x501035-0x0;var _0x4dd166=_0x34b7[_0x501035];return _0x4dd166;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xd')]);router[_0x734b('0xe')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0xf')]);module[_0x734b('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 8ca6436..2501549 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 _0xcd85=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0xcd85,0x6f));var _0x5cd8=function(_0x154f66,_0x116f85){_0x154f66=_0x154f66-0x0;var _0x3f947a=_0xcd85[_0x154f66];return _0x3f947a;};'use strict';var Sequelize=require(_0x5cd8('0x0'));module[_0x5cd8('0x1')]={'closed':{'type':Sequelize[_0x5cd8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5cd8('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5cd8('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x5cd8('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5cd8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5cd8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x5cd8('0x6')]('in',_0x5cd8('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0ee9=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0ee9,0x18f));var _0x90ee=function(_0x23752c,_0x111472){_0x23752c=_0x23752c-0x0;var _0x3f2742=_0x0ee9[_0x23752c];return _0x3f2742;};'use strict';var Sequelize=require(_0x90ee('0x0'));module[_0x90ee('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x90ee('0x2')]},'disposition':{'type':Sequelize[_0x90ee('0x3')]},'secondDisposition':{'type':Sequelize[_0x90ee('0x3')]},'thirdDisposition':{'type':Sequelize[_0x90ee('0x3')]},'note':{'type':Sequelize[_0x90ee('0x3')]},'read1stAt':{'type':Sequelize[_0x90ee('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x90ee('0x4')]('in',_0x90ee('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x90ee('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x90ee('0x4')]('in','out'),'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 75e34c8..79f21c2 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 _0x343c=['tmp','root','attachments','push','Attachment','createdAt','get','mkdirSync','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','download','err','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','status','json','undefined','limit','count','offset','set','update','then','destroy','end','sendStatus','name','send','index','rawAttributes','fieldName','key','getOptions','findAll','fax','query','user','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','options','FaxInteraction','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','filters','nolimit','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','toString','join','server','files'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x343c,0x147));var _0xc343=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x343c[_0x20a584];return _0x4b41a8;};'use strict';var rimraf=require(_0xc343('0x0'));var zipdir=require(_0xc343('0x1'));var moment=require(_0xc343('0x2'));var BPromise=require('bluebird');var util=require(_0xc343('0x3'));var path=require(_0xc343('0x4'));var fs=require('fs');var _=require(_0xc343('0x5'));var Redis=require('ioredis');var interaction=require(_0xc343('0x6'));var qs=require(_0xc343('0x7'));var logger=require('../../config/logger')(_0xc343('0x8'));var config=require('../../config/environment');var db=require(_0xc343('0x9'))['db'];config[_0xc343('0xa')]=_[_0xc343('0xb')](config[_0xc343('0xa')],{'host':_0xc343('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc343('0xa')]));require(_0xc343('0xd'))[_0xc343('0xe')](socket);function respondWithStatusCode(_0x20fed1,_0xd622be){_0xd622be=_0xd622be||0xcc;return function(_0x44db87){if(_0x44db87){return _0x20fed1['sendStatus'](_0xd622be);}return _0x20fed1[_0xc343('0xf')](_0xd622be)['end']();};}function respondWithResult(_0x34d5d5,_0x487277){_0x487277=_0x487277||0xc8;return function(_0x40a196){if(_0x40a196){return _0x34d5d5[_0xc343('0xf')](_0x487277)[_0xc343('0x10')](_0x40a196);}};}function respondWithFilteredResult(_0x2f5240,_0x1755e6){return function(_0x392e95){if(_0x392e95){var _0x3b62ec=typeof _0x1755e6['offset']===_0xc343('0x11')&&typeof _0x1755e6[_0xc343('0x12')]===_0xc343('0x11');var _0x5d052b=_0x392e95[_0xc343('0x13')];var _0x246e69=_0x3b62ec?0x0:_0x1755e6[_0xc343('0x14')];var _0x544bea=_0x3b62ec?_0x392e95[_0xc343('0x13')]:_0x1755e6['offset']+_0x1755e6[_0xc343('0x12')];var _0x51e980;if(_0x544bea>=_0x5d052b){_0x544bea=_0x5d052b;_0x51e980=0xc8;}else{_0x51e980=0xce;}_0x2f5240[_0xc343('0xf')](_0x51e980);return _0x2f5240[_0xc343('0x15')]('Content-Range',_0x246e69+'-'+_0x544bea+'/'+_0x5d052b)[_0xc343('0x10')](_0x392e95);}return null;};}function saveUpdates(_0x29598b){return function(_0x39a925){if(_0x39a925){return _0x39a925[_0xc343('0x16')](_0x29598b)[_0xc343('0x17')](function(_0x33c3b0){return _0x33c3b0;});}return null;};}function removeEntity(_0x50e980){return function(_0x12f9eb){if(_0x12f9eb){return _0x12f9eb[_0xc343('0x18')]()[_0xc343('0x17')](function(){_0x50e980[_0xc343('0xf')](0xcc)[_0xc343('0x19')]();});}};}function handleEntityNotFound(_0x30d6e9){return function(_0x3d088a){if(!_0x3d088a){_0x30d6e9[_0xc343('0x1a')](0x194);}return _0x3d088a;};}function handleError(_0x56fa44,_0x23e920){_0x23e920=_0x23e920||0x1f4;return function(_0x36feac){logger['error'](_0x36feac['stack']);if(_0x36feac[_0xc343('0x1b')]){delete _0x36feac[_0xc343('0x1b')];}_0x56fa44['status'](_0x23e920)[_0xc343('0x1c')](_0x36feac);};}exports[_0xc343('0x1d')]=function(_0x5c0e3c,_0x529f2a){var _0x5c8410={};var _0x3f1a23=_['map'](db['FaxInteraction'][_0xc343('0x1e')],function(_0x92ee1c){return{'name':_0x92ee1c[_0xc343('0x1f')],'type':_0x92ee1c['type'][_0xc343('0x20')]};});_0x5c8410=qs[_0xc343('0x21')](_0x3f1a23,_0x5c0e3c);return interaction[_0xc343('0x22')](_0xc343('0x23'),_0x5c0e3c[_0xc343('0x24')],_0x5c0e3c[_0xc343('0x25')],_0x5c8410,_0x3f1a23)['then'](respondWithFilteredResult(_0x529f2a,_0x5c8410))[_0xc343('0x26')](handleError(_0x529f2a,null));};exports[_0xc343('0x27')]=function(_0x27dde0,_0x334082){var _0x9d4693={'raw':![],'where':{'id':_0x27dde0[_0xc343('0x28')]['id']}},_0x54e48e={};_0x54e48e[_0xc343('0x29')]=_[_0xc343('0x2a')](db['FaxInteraction'][_0xc343('0x1e')]);_0x54e48e[_0xc343('0x24')]=_[_0xc343('0x2a')](_0x27dde0[_0xc343('0x24')]);_0x54e48e['filters']=_[_0xc343('0x2b')](_0x54e48e[_0xc343('0x29')],_0x54e48e[_0xc343('0x24')]);_0x9d4693[_0xc343('0x2c')]=_[_0xc343('0x2b')](_0x54e48e[_0xc343('0x29')],qs[_0xc343('0x2d')](_0x27dde0[_0xc343('0x24')][_0xc343('0x2d')]));_0x9d4693[_0xc343('0x2c')]=_0x9d4693[_0xc343('0x2c')][_0xc343('0x2e')]?_0x9d4693['attributes']:_0x54e48e[_0xc343('0x29')];if(_0x27dde0[_0xc343('0x24')][_0xc343('0x2f')]){_0x9d4693[_0xc343('0x30')]=[{'all':!![]}];}_0x9d4693=_[_0xc343('0x31')]({},_0x9d4693,_0x27dde0[_0xc343('0x32')]);return db[_0xc343('0x33')][_0xc343('0x34')](_0x9d4693)[_0xc343('0x17')](handleEntityNotFound(_0x334082,null))[_0xc343('0x17')](respondWithResult(_0x334082,null))['catch'](handleError(_0x334082,null));};exports[_0xc343('0x35')]=function(_0xe2b677,_0x419721){return db[_0xc343('0x33')][_0xc343('0x35')](_0xe2b677[_0xc343('0x36')],{})[_0xc343('0x17')](respondWithResult(_0x419721,0xc9))['catch'](handleError(_0x419721,null));};exports[_0xc343('0x16')]=function(_0x4d6194,_0x28c7d0){if(_0x4d6194[_0xc343('0x36')]['id']){delete _0x4d6194[_0xc343('0x36')]['id'];}return db[_0xc343('0x33')]['find']({'where':{'id':_0x4d6194['params']['id']}})[_0xc343('0x17')](handleEntityNotFound(_0x28c7d0,null))[_0xc343('0x17')](saveUpdates(_0x4d6194[_0xc343('0x36')],null))['then'](respondWithResult(_0x28c7d0,null))[_0xc343('0x26')](handleError(_0x28c7d0,null));};exports[_0xc343('0x18')]=function(_0x579a1a,_0x4c3568){return db[_0xc343('0x33')][_0xc343('0x34')]({'where':{'id':_0x579a1a[_0xc343('0x28')]['id']}})[_0xc343('0x17')](handleEntityNotFound(_0x4c3568,null))[_0xc343('0x17')](removeEntity(_0x4c3568,null))[_0xc343('0x26')](handleError(_0x4c3568,null));};exports[_0xc343('0x37')]=function(_0x468fc3,_0x4ff5c2){return db[_0xc343('0x33')]['describe']()[_0xc343('0x17')](respondWithResult(_0x4ff5c2,null))[_0xc343('0x26')](handleError(_0x4ff5c2,null));};exports[_0xc343('0x38')]=function(_0x45c030,_0x3f547c){return db[_0xc343('0x39')][_0xc343('0x34')]({'where':{'id':_0x45c030[_0xc343('0x28')]['id']}})['then'](handleEntityNotFound(_0x3f547c,null))['then'](function(_0xfe599){if(_0xfe599){return _0xfe599['addMessage'](_0x45c030[_0xc343('0x36')][_0xc343('0x3a')],_[_0xc343('0x3b')](_0x45c030[_0xc343('0x36')],[_0xc343('0x3a'),'id'])||{});}})[_0xc343('0x17')](respondWithResult(_0x3f547c,null))[_0xc343('0x26')](handleError(_0x3f547c,null));};exports[_0xc343('0x3c')]=function(_0x2d3952,_0x14a6ea){var _0x241931={'raw':![],'where':{}};var _0x54caf6={};var _0x23fd15={'count':0x0,'rows':[]};return db[_0xc343('0x33')][_0xc343('0x3d')]({'where':{'id':_0x2d3952['params']['id']}})[_0xc343('0x17')](handleEntityNotFound(_0x14a6ea,null))[_0xc343('0x17')](function(_0x40d7e6){if(_0x40d7e6){_0x54caf6[_0xc343('0x29')]=_['keys'](db[_0xc343('0x39')]['rawAttributes']);_0x54caf6[_0xc343('0x24')]=_[_0xc343('0x2a')](_0x2d3952[_0xc343('0x24')]);_0x54caf6[_0xc343('0x3e')]=_[_0xc343('0x2b')](_0x54caf6[_0xc343('0x29')],_0x54caf6[_0xc343('0x24')]);_0x241931[_0xc343('0x2c')]=_[_0xc343('0x2b')](_0x54caf6[_0xc343('0x29')],qs[_0xc343('0x2d')](_0x2d3952[_0xc343('0x24')][_0xc343('0x2d')]));_0x241931[_0xc343('0x2c')]=_0x241931[_0xc343('0x2c')]['length']?_0x241931['attributes']:_0x54caf6[_0xc343('0x29')];if(!_0x2d3952[_0xc343('0x24')]['hasOwnProperty'](_0xc343('0x3f'))){_0x241931['limit']=qs[_0xc343('0x12')](_0x2d3952[_0xc343('0x24')][_0xc343('0x12')]);_0x241931[_0xc343('0x14')]=qs[_0xc343('0x14')](_0x2d3952[_0xc343('0x24')]['offset']);}_0x241931['order']=qs[_0xc343('0x40')](_0x2d3952[_0xc343('0x24')][_0xc343('0x40')]);_0x241931[_0xc343('0x41')]=qs[_0xc343('0x3e')](_['pick'](_0x2d3952[_0xc343('0x24')],_0x54caf6[_0xc343('0x3e')]));_0x241931['where'][_0xc343('0x42')]=_0x40d7e6['id'];if(_0x2d3952[_0xc343('0x24')][_0xc343('0x43')]){_0x241931[_0xc343('0x41')]=_['merge'](_0x241931[_0xc343('0x41')],{'$or':_['map'](_0x241931[_0xc343('0x2c')],function(_0x4bbba1){var _0x337057={};_0x337057[_0x4bbba1]={'$like':'%'+_0x2d3952[_0xc343('0x24')][_0xc343('0x43')]+'%'};return _0x337057;})});}if(_0x2d3952[_0xc343('0x24')][_0xc343('0x44')]){var _0x585ae5=_0x2d3952['query'][_0xc343('0x44')][_0xc343('0x45')](',');var _0x4f54c8={};_0x4f54c8[_0x585ae5[0x0]]={'$gte':moment(_0x585ae5[0x1])[_0xc343('0x46')](_0xc343('0x47'))};_0x241931[_0xc343('0x41')]=_[_0xc343('0x31')](_0x241931['where'],_0x4f54c8);}_0x241931=_[_0xc343('0x31')]({},_0x241931,_0x2d3952[_0xc343('0x32')]);return db[_0xc343('0x39')]['count']({'where':_0x241931[_0xc343('0x41')]})[_0xc343('0x17')](function(_0x270901){_0x23fd15['count']=_0x270901;if(_0x2d3952[_0xc343('0x24')]['includeAll']){_0x241931['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x241931);})['then'](function(_0x276fd9){_0x23fd15[_0xc343('0x48')]=_0x276fd9;return _0x23fd15;});}})[_0xc343('0x17')](respondWithFilteredResult(_0x14a6ea,_0x241931))[_0xc343('0x26')](handleError(_0x14a6ea,null));};exports[_0xc343('0x49')]=function(_0x414958,_0x2df80f){return db[_0xc343('0x33')]['find']({'where':{'id':_0x414958[_0xc343('0x28')]['id']}})['then'](handleEntityNotFound(_0x2df80f,null))[_0xc343('0x17')](function(_0x5302fa){if(_0x5302fa){return _0x5302fa[_0xc343('0x4a')](_0x414958['body'][_0xc343('0x3a')],_[_0xc343('0x3b')](_0x414958[_0xc343('0x36')],[_0xc343('0x3a'),'id'])||{})[_0xc343('0x4b')](function(){return db[_0xc343('0x4c')][_0xc343('0x22')]({'attributes':['id',_0xc343('0x1b'),_0xc343('0x4d')],'where':{'id':_0x414958['body'][_0xc343('0x3a')]}});})[_0xc343('0x17')](function(_0x48baae){socket[_0xc343('0x4e')](_0xc343('0x4f'),{'id':Number(_0x414958[_0xc343('0x28')]['id']),'tags':_0x48baae||[]});return{'id':Number(_0x414958[_0xc343('0x28')]['id']),'tags':_0x48baae||[]};});}})[_0xc343('0x17')](respondWithResult(_0x2df80f,null))[_0xc343('0x26')](handleError(_0x2df80f,null));};exports['removeTags']=function(_0x578289,_0x4b56fe){return db['FaxInteraction'][_0xc343('0x34')]({'where':{'id':_0x578289[_0xc343('0x28')]['id']}})[_0xc343('0x17')](handleEntityNotFound(_0x4b56fe,null))[_0xc343('0x17')](function(_0x5c54d6){if(_0x5c54d6){return _0x5c54d6[_0xc343('0x50')](_0x578289['query'][_0xc343('0x3a')]);}})[_0xc343('0x17')](respondWithStatusCode(_0x4b56fe,null))[_0xc343('0x26')](handleError(_0x4b56fe,null));};exports['download']=function(_0x5bf861,_0x2807a6){var _0x104f0d=moment()['unix']()[_0xc343('0x51')]();var _0x4a5f79=path[_0xc343('0x52')](config['root'],_0xc343('0x53'),_0xc343('0x54'),_0xc343('0x55'));var _0x234cd=path[_0xc343('0x52')](config[_0xc343('0x56')],_0xc343('0x53'),_0xc343('0x54'),_0xc343('0x57'));var _0x45e439=path['join'](_0x4a5f79,_0x104f0d);var _0x1ff6fa=util[_0xc343('0x46')]('transcript-%d-%s.zip',_0x5bf861['params']['id'],_0x104f0d);var _0x43d6da=path[_0xc343('0x52')](_0x4a5f79,_0x1ff6fa);var _0xfdc132=[];_0xfdc132[_0xc343('0x58')]({'model':db[_0xc343('0x59')],'as':_0xc343('0x59'),'raw':!![]});var _0x4dde39=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xc343('0x36'),_0xc343('0x5a')],'include':_0xfdc132}];return db[_0xc343('0x33')]['find']({'where':{'id':_0x5bf861[_0xc343('0x28')]['id']},'include':_0x4dde39})[_0xc343('0x17')](handleEntityNotFound(_0x2807a6,null))[_0xc343('0x17')](function(_0xf5de1){if(_0xf5de1&&_0xf5de1['Messages']){var _0x4be3cc=_0xf5de1[_0xc343('0x5b')]({'plain':!![]});fs[_0xc343('0x5c')](_0x45e439);for(var _0x447649=0x0;_0x447649<_0x4be3cc[_0xc343('0x5d')][_0xc343('0x2e')];_0x447649++){var _0x404c27=_0x4be3cc[_0xc343('0x5d')][_0x447649][_0xc343('0x59')];if(_0x404c27){var _0x13422c=path[_0xc343('0x52')](_0x234cd,_0x404c27[_0xc343('0x5e')]);if(fs[_0xc343('0x5f')](_0x13422c)){fs[_0xc343('0x60')](_0x13422c)[_0xc343('0x61')](fs[_0xc343('0x62')](path['join'](_0x45e439,_0x404c27[_0xc343('0x5e')])));}}}return BPromise[_0xc343('0x63')]()[_0xc343('0x17')](function(){return new BPromise(function(_0x53d4a4,_0x52f549){zipdir(_0x45e439,{'saveTo':_0x43d6da},function(_0x1cb086,_0x183ecb){if(_0x1cb086)return _0x52f549(_0x1cb086);return _0x53d4a4(_0x183ecb);});})[_0xc343('0x17')](function(){return new BPromise(function(_0x2dc68f,_0x43f187){rimraf(_0x45e439,function(_0x16bc04){if(_0x16bc04)_0x43f187(_0x16bc04);return _0x2dc68f();});});})['then'](function(){return _0x2807a6[_0xc343('0x64')](_0x43d6da,_0x1ff6fa,function(_0x470823){if(_0x470823){console['log'](_0xc343('0x65'),_0x470823);}else{fs[_0xc343('0x66')](_0x43d6da);}});});});}else{return _0x2807a6[_0xc343('0x1a')](0xc8);}})['catch'](handleError(_0x2807a6,null));}; \ No newline at end of file +var _0xbcb0=['omit','getMessages','findOne','filters','length','hasOwnProperty','nolimit','sort','pick','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','resolve','log','err','zip-dir','moment','bluebird','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','name','send','index','map','FaxInteraction','fieldName','key','getOptions','findAll','query','user','catch','model','rawAttributes','keys','attributes','intersection','fields','include','merge','options','create','body','find','params','describe','addMessage','FaxMessage','ids'];(function(_0x211d5a,_0x18f4ea){var _0x5aec43=function(_0x549eb8){while(--_0x549eb8){_0x211d5a['push'](_0x211d5a['shift']());}};_0x5aec43(++_0x18f4ea);}(_0xbcb0,0x1c2));var _0x0bcb=function(_0x24358d,_0x26f937){_0x24358d=_0x24358d-0x0;var _0x4fac87=_0xbcb0[_0x24358d];return _0x4fac87;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x0bcb('0x0'));var moment=require(_0x0bcb('0x1'));var BPromise=require(_0x0bcb('0x2'));var util=require('util');var path=require(_0x0bcb('0x3'));var fs=require('fs');var _=require(_0x0bcb('0x4'));var Redis=require('ioredis');var interaction=require(_0x0bcb('0x5'));var qs=require(_0x0bcb('0x6'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x0bcb('0x7'))['db'];config[_0x0bcb('0x8')]=_[_0x0bcb('0x9')](config['redis'],{'host':_0x0bcb('0xa'),'port':0x18eb});var socket=require(_0x0bcb('0xb'))(new Redis(config['redis']));require(_0x0bcb('0xc'))['register'](socket);function respondWithStatusCode(_0x4b493b,_0x35d3b8){_0x35d3b8=_0x35d3b8||0xcc;return function(_0x5ba84c){if(_0x5ba84c){return _0x4b493b[_0x0bcb('0xd')](_0x35d3b8);}return _0x4b493b[_0x0bcb('0xe')](_0x35d3b8)[_0x0bcb('0xf')]();};}function respondWithResult(_0x29453e,_0x51b3fc){_0x51b3fc=_0x51b3fc||0xc8;return function(_0x3f0c6f){if(_0x3f0c6f){return _0x29453e[_0x0bcb('0xe')](_0x51b3fc)[_0x0bcb('0x10')](_0x3f0c6f);}};}function respondWithFilteredResult(_0x5a2c99,_0x94d85d){return function(_0x9c5f5c){if(_0x9c5f5c){var _0x44d38d=typeof _0x94d85d[_0x0bcb('0x11')]===_0x0bcb('0x12')&&typeof _0x94d85d[_0x0bcb('0x13')]===_0x0bcb('0x12');var _0x1f97bb=_0x9c5f5c[_0x0bcb('0x14')];var _0x53f5b2=_0x44d38d?0x0:_0x94d85d['offset'];var _0x58f1e6=_0x44d38d?_0x9c5f5c[_0x0bcb('0x14')]:_0x94d85d[_0x0bcb('0x11')]+_0x94d85d['limit'];var _0x16b6cb;if(_0x58f1e6>=_0x1f97bb){_0x58f1e6=_0x1f97bb;_0x16b6cb=0xc8;}else{_0x16b6cb=0xce;}_0x5a2c99[_0x0bcb('0xe')](_0x16b6cb);return _0x5a2c99[_0x0bcb('0x15')](_0x0bcb('0x16'),_0x53f5b2+'-'+_0x58f1e6+'/'+_0x1f97bb)[_0x0bcb('0x10')](_0x9c5f5c);}return null;};}function saveUpdates(_0x119f5a){return function(_0x94c5ac){if(_0x94c5ac){return _0x94c5ac[_0x0bcb('0x17')](_0x119f5a)[_0x0bcb('0x18')](function(_0x303d80){return _0x303d80;});}return null;};}function removeEntity(_0x59389f){return function(_0x34035e){if(_0x34035e){return _0x34035e[_0x0bcb('0x19')]()[_0x0bcb('0x18')](function(){_0x59389f[_0x0bcb('0xe')](0xcc)[_0x0bcb('0xf')]();});}};}function handleEntityNotFound(_0x1e04a1){return function(_0x215008){if(!_0x215008){_0x1e04a1[_0x0bcb('0xd')](0x194);}return _0x215008;};}function handleError(_0x4dbaa7,_0x4f0277){_0x4f0277=_0x4f0277||0x1f4;return function(_0x2789b6){logger['error'](_0x2789b6['stack']);if(_0x2789b6[_0x0bcb('0x1a')]){delete _0x2789b6[_0x0bcb('0x1a')];}_0x4dbaa7['status'](_0x4f0277)[_0x0bcb('0x1b')](_0x2789b6);};}exports[_0x0bcb('0x1c')]=function(_0x597dab,_0x31c805){var _0x37102e={};var _0x1f1d25=_[_0x0bcb('0x1d')](db[_0x0bcb('0x1e')]['rawAttributes'],function(_0x3ea2ae){return{'name':_0x3ea2ae[_0x0bcb('0x1f')],'type':_0x3ea2ae['type'][_0x0bcb('0x20')]};});_0x37102e=qs[_0x0bcb('0x21')](_0x1f1d25,_0x597dab);return interaction[_0x0bcb('0x22')]('fax',_0x597dab[_0x0bcb('0x23')],_0x597dab[_0x0bcb('0x24')],_0x37102e,_0x1f1d25)[_0x0bcb('0x18')](respondWithFilteredResult(_0x31c805,_0x37102e))[_0x0bcb('0x25')](handleError(_0x31c805,null));};exports['show']=function(_0x5a5d54,_0x40b01d){var _0x4beec4={'raw':![],'where':{'id':_0x5a5d54['params']['id']}},_0x10ac80={};_0x10ac80[_0x0bcb('0x26')]=_['keys'](db[_0x0bcb('0x1e')][_0x0bcb('0x27')]);_0x10ac80[_0x0bcb('0x23')]=_[_0x0bcb('0x28')](_0x5a5d54[_0x0bcb('0x23')]);_0x10ac80['filters']=_['intersection'](_0x10ac80['model'],_0x10ac80[_0x0bcb('0x23')]);_0x4beec4[_0x0bcb('0x29')]=_[_0x0bcb('0x2a')](_0x10ac80[_0x0bcb('0x26')],qs['fields'](_0x5a5d54[_0x0bcb('0x23')][_0x0bcb('0x2b')]));_0x4beec4['attributes']=_0x4beec4[_0x0bcb('0x29')]['length']?_0x4beec4[_0x0bcb('0x29')]:_0x10ac80[_0x0bcb('0x26')];if(_0x5a5d54[_0x0bcb('0x23')]['includeAll']){_0x4beec4[_0x0bcb('0x2c')]=[{'all':!![]}];}_0x4beec4=_[_0x0bcb('0x2d')]({},_0x4beec4,_0x5a5d54[_0x0bcb('0x2e')]);return db[_0x0bcb('0x1e')]['find'](_0x4beec4)[_0x0bcb('0x18')](handleEntityNotFound(_0x40b01d,null))[_0x0bcb('0x18')](respondWithResult(_0x40b01d,null))['catch'](handleError(_0x40b01d,null));};exports[_0x0bcb('0x2f')]=function(_0x42e2d5,_0x280790){return db[_0x0bcb('0x1e')][_0x0bcb('0x2f')](_0x42e2d5['body'],{})[_0x0bcb('0x18')](respondWithResult(_0x280790,0xc9))[_0x0bcb('0x25')](handleError(_0x280790,null));};exports[_0x0bcb('0x17')]=function(_0x13f57b,_0x3d8a47){if(_0x13f57b[_0x0bcb('0x30')]['id']){delete _0x13f57b['body']['id'];}return db[_0x0bcb('0x1e')][_0x0bcb('0x31')]({'where':{'id':_0x13f57b['params']['id']}})['then'](handleEntityNotFound(_0x3d8a47,null))[_0x0bcb('0x18')](saveUpdates(_0x13f57b[_0x0bcb('0x30')],null))['then'](respondWithResult(_0x3d8a47,null))[_0x0bcb('0x25')](handleError(_0x3d8a47,null));};exports[_0x0bcb('0x19')]=function(_0x1ce4df,_0x3365ed){return db[_0x0bcb('0x1e')][_0x0bcb('0x31')]({'where':{'id':_0x1ce4df[_0x0bcb('0x32')]['id']}})['then'](handleEntityNotFound(_0x3365ed,null))['then'](removeEntity(_0x3365ed,null))[_0x0bcb('0x25')](handleError(_0x3365ed,null));};exports[_0x0bcb('0x33')]=function(_0x1e83f6,_0x500f6e){return db[_0x0bcb('0x1e')][_0x0bcb('0x33')]()['then'](respondWithResult(_0x500f6e,null))[_0x0bcb('0x25')](handleError(_0x500f6e,null));};exports[_0x0bcb('0x34')]=function(_0xa6b366,_0x57f8b3){return db[_0x0bcb('0x35')][_0x0bcb('0x31')]({'where':{'id':_0xa6b366[_0x0bcb('0x32')]['id']}})[_0x0bcb('0x18')](handleEntityNotFound(_0x57f8b3,null))[_0x0bcb('0x18')](function(_0x382262){if(_0x382262){return _0x382262[_0x0bcb('0x34')](_0xa6b366[_0x0bcb('0x30')][_0x0bcb('0x36')],_[_0x0bcb('0x37')](_0xa6b366[_0x0bcb('0x30')],[_0x0bcb('0x36'),'id'])||{});}})[_0x0bcb('0x18')](respondWithResult(_0x57f8b3,null))[_0x0bcb('0x25')](handleError(_0x57f8b3,null));};exports[_0x0bcb('0x38')]=function(_0x730a8,_0x5ee01a){var _0x4e9508={'raw':![],'where':{}};var _0x24d94e={};var _0x9e1a64={'count':0x0,'rows':[]};return db[_0x0bcb('0x1e')][_0x0bcb('0x39')]({'where':{'id':_0x730a8[_0x0bcb('0x32')]['id']}})[_0x0bcb('0x18')](handleEntityNotFound(_0x5ee01a,null))['then'](function(_0x129fb3){if(_0x129fb3){_0x24d94e[_0x0bcb('0x26')]=_[_0x0bcb('0x28')](db['FaxMessage']['rawAttributes']);_0x24d94e['query']=_[_0x0bcb('0x28')](_0x730a8[_0x0bcb('0x23')]);_0x24d94e[_0x0bcb('0x3a')]=_['intersection'](_0x24d94e[_0x0bcb('0x26')],_0x24d94e[_0x0bcb('0x23')]);_0x4e9508['attributes']=_['intersection'](_0x24d94e['model'],qs[_0x0bcb('0x2b')](_0x730a8[_0x0bcb('0x23')]['fields']));_0x4e9508[_0x0bcb('0x29')]=_0x4e9508[_0x0bcb('0x29')][_0x0bcb('0x3b')]?_0x4e9508['attributes']:_0x24d94e[_0x0bcb('0x26')];if(!_0x730a8['query'][_0x0bcb('0x3c')](_0x0bcb('0x3d'))){_0x4e9508[_0x0bcb('0x13')]=qs[_0x0bcb('0x13')](_0x730a8[_0x0bcb('0x23')][_0x0bcb('0x13')]);_0x4e9508[_0x0bcb('0x11')]=qs['offset'](_0x730a8[_0x0bcb('0x23')][_0x0bcb('0x11')]);}_0x4e9508['order']=qs[_0x0bcb('0x3e')](_0x730a8[_0x0bcb('0x23')][_0x0bcb('0x3e')]);_0x4e9508['where']=qs[_0x0bcb('0x3a')](_[_0x0bcb('0x3f')](_0x730a8['query'],_0x24d94e['filters']));_0x4e9508[_0x0bcb('0x40')][_0x0bcb('0x41')]=_0x129fb3['id'];if(_0x730a8['query'][_0x0bcb('0x42')]){_0x4e9508[_0x0bcb('0x40')]=_[_0x0bcb('0x2d')](_0x4e9508['where'],{'$or':_[_0x0bcb('0x1d')](_0x4e9508[_0x0bcb('0x29')],function(_0x4d27e9){var _0x5d55de={};_0x5d55de[_0x4d27e9]={'$like':'%'+_0x730a8['query'][_0x0bcb('0x42')]+'%'};return _0x5d55de;})});}if(_0x730a8[_0x0bcb('0x23')][_0x0bcb('0x43')]){var _0x2e36fa=_0x730a8[_0x0bcb('0x23')][_0x0bcb('0x43')][_0x0bcb('0x44')](',');var _0x4e16b3={};_0x4e16b3[_0x2e36fa[0x0]]={'$gte':moment(_0x2e36fa[0x1])[_0x0bcb('0x45')](_0x0bcb('0x46'))};_0x4e9508[_0x0bcb('0x40')]=_[_0x0bcb('0x2d')](_0x4e9508[_0x0bcb('0x40')],_0x4e16b3);}_0x4e9508=_['merge']({},_0x4e9508,_0x730a8[_0x0bcb('0x2e')]);return db[_0x0bcb('0x35')][_0x0bcb('0x14')]({'where':_0x4e9508[_0x0bcb('0x40')]})[_0x0bcb('0x18')](function(_0xc92e75){_0x9e1a64[_0x0bcb('0x14')]=_0xc92e75;if(_0x730a8[_0x0bcb('0x23')][_0x0bcb('0x47')]){_0x4e9508[_0x0bcb('0x2c')]=[{'all':!![]}];}return db['FaxMessage'][_0x0bcb('0x22')](_0x4e9508);})[_0x0bcb('0x18')](function(_0x2dcbac){_0x9e1a64[_0x0bcb('0x48')]=_0x2dcbac;return _0x9e1a64;});}})[_0x0bcb('0x18')](respondWithFilteredResult(_0x5ee01a,_0x4e9508))[_0x0bcb('0x25')](handleError(_0x5ee01a,null));};exports[_0x0bcb('0x49')]=function(_0x1e095f,_0x49a6d3){return db[_0x0bcb('0x1e')]['find']({'where':{'id':_0x1e095f[_0x0bcb('0x32')]['id']}})[_0x0bcb('0x18')](handleEntityNotFound(_0x49a6d3,null))[_0x0bcb('0x18')](function(_0x44050e){if(_0x44050e){return _0x44050e[_0x0bcb('0x4a')](_0x1e095f['body'][_0x0bcb('0x36')],_[_0x0bcb('0x37')](_0x1e095f[_0x0bcb('0x30')],[_0x0bcb('0x36'),'id'])||{})[_0x0bcb('0x4b')](function(){return db['Tag'][_0x0bcb('0x22')]({'attributes':['id',_0x0bcb('0x1a'),_0x0bcb('0x4c')],'where':{'id':_0x1e095f[_0x0bcb('0x30')][_0x0bcb('0x36')]}});})[_0x0bcb('0x18')](function(_0x3a8a91){socket[_0x0bcb('0x4d')](_0x0bcb('0x4e'),{'id':Number(_0x1e095f[_0x0bcb('0x32')]['id']),'tags':_0x3a8a91||[]});return{'id':Number(_0x1e095f[_0x0bcb('0x32')]['id']),'tags':_0x3a8a91||[]};});}})[_0x0bcb('0x18')](respondWithResult(_0x49a6d3,null))[_0x0bcb('0x25')](handleError(_0x49a6d3,null));};exports[_0x0bcb('0x4f')]=function(_0x36595e,_0x24215a){return db['FaxInteraction'][_0x0bcb('0x31')]({'where':{'id':_0x36595e['params']['id']}})[_0x0bcb('0x18')](handleEntityNotFound(_0x24215a,null))[_0x0bcb('0x18')](function(_0xffbc98){if(_0xffbc98){return _0xffbc98[_0x0bcb('0x4f')](_0x36595e[_0x0bcb('0x23')][_0x0bcb('0x36')]);}})[_0x0bcb('0x18')](respondWithStatusCode(_0x24215a,null))[_0x0bcb('0x25')](handleError(_0x24215a,null));};exports[_0x0bcb('0x50')]=function(_0x45e5ba,_0x59f7fe){var _0x1b8bab=moment()[_0x0bcb('0x51')]()[_0x0bcb('0x52')]();var _0xb0601e=path[_0x0bcb('0x53')](config['root'],_0x0bcb('0x54'),'files',_0x0bcb('0x55'));var _0x327014=path[_0x0bcb('0x53')](config[_0x0bcb('0x56')],_0x0bcb('0x54'),_0x0bcb('0x57'),_0x0bcb('0x58'));var _0x20173c=path['join'](_0xb0601e,_0x1b8bab);var _0x251546=util[_0x0bcb('0x45')](_0x0bcb('0x59'),_0x45e5ba['params']['id'],_0x1b8bab);var _0x2811f1=path['join'](_0xb0601e,_0x251546);var _0x3e68cb=[];_0x3e68cb['push']({'model':db[_0x0bcb('0x5a')],'as':_0x0bcb('0x5a'),'raw':!![]});var _0x3e063d=[{'model':db[_0x0bcb('0x35')],'as':_0x0bcb('0x5b'),'attributes':['id',_0x0bcb('0x30'),_0x0bcb('0x5c')],'include':_0x3e68cb}];return db[_0x0bcb('0x1e')]['find']({'where':{'id':_0x45e5ba[_0x0bcb('0x32')]['id']},'include':_0x3e063d})[_0x0bcb('0x18')](handleEntityNotFound(_0x59f7fe,null))[_0x0bcb('0x18')](function(_0x5d61d3){if(_0x5d61d3&&_0x5d61d3['Messages']){var _0x545c15=_0x5d61d3[_0x0bcb('0x5d')]({'plain':!![]});fs[_0x0bcb('0x5e')](_0x20173c);for(var _0x43e1e4=0x0;_0x43e1e4<_0x545c15[_0x0bcb('0x5b')]['length'];_0x43e1e4++){var _0x9fd555=_0x545c15[_0x0bcb('0x5b')][_0x43e1e4][_0x0bcb('0x5a')];if(_0x9fd555){var _0x146da8=path[_0x0bcb('0x53')](_0x327014,_0x9fd555[_0x0bcb('0x5f')]);if(fs[_0x0bcb('0x60')](_0x146da8)){fs['createReadStream'](_0x146da8)[_0x0bcb('0x61')](fs['createWriteStream'](path[_0x0bcb('0x53')](_0x20173c,_0x9fd555['basename'])));}}}return BPromise[_0x0bcb('0x62')]()['then'](function(){return new BPromise(function(_0x46aad6,_0x4565c5){zipdir(_0x20173c,{'saveTo':_0x2811f1},function(_0x59e78c,_0x22d752){if(_0x59e78c)return _0x4565c5(_0x59e78c);return _0x46aad6(_0x22d752);});})['then'](function(){return new BPromise(function(_0x1505f3,_0x338d85){rimraf(_0x20173c,function(_0x40f2cc){if(_0x40f2cc)_0x338d85(_0x40f2cc);return _0x1505f3();});});})[_0x0bcb('0x18')](function(){return _0x59f7fe[_0x0bcb('0x50')](_0x2811f1,_0x251546,function(_0xabff6d){if(_0xabff6d){console[_0x0bcb('0x63')](_0x0bcb('0x64'),_0xabff6d);}else{fs['unlinkSync'](_0x2811f1);}});});});}else{return _0x59f7fe[_0x0bcb('0xd')](0xc8);}})[_0x0bcb('0x25')](handleError(_0x59f7fe,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f61a563..c587a13 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 _0x3950=['setMaxListeners','save','remove','then','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0x3950,0x1b0));var _0x0395=function(_0x3e226d,_0x3c23bd){_0x3e226d=_0x3e226d-0x0;var _0x40892c=_0x3950[_0x3e226d];return _0x40892c;};'use strict';var EventEmitter=require(_0x0395('0x0'));var FaxInteraction=require(_0x0395('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x0395('0x1'))['db'][_0x0395('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0395('0x3')](0x0);var events={'afterCreate':_0x0395('0x4'),'afterUpdate':'update','afterDestroy':_0x0395('0x5')};function emitEvent(_0x1d56cf){return function(_0x1f1aa9,_0x524543,_0x52b3e0){_0x1f1aa9['getUsers']({'attributes':['id'],'raw':!![]})[_0x0395('0x6')](function(_0x488c87){_0x1f1aa9['setDataValue']('Users',_0x488c87[_0x0395('0x7')](function(_0x4823ba){return{'id':_0x4823ba['id']};}));return FaxMessage[_0x0395('0x8')]({'where':{'FaxInteractionId':_0x1f1aa9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0395('0x6')](function(_0x81585){_0x1f1aa9['setDataValue'](_0x0395('0x9'),_0x81585['length']);FaxInteractionEvents['emit'](_0x1d56cf+':'+_0x1f1aa9['id'],_0x1f1aa9);FaxInteractionEvents[_0x0395('0xa')](_0x1d56cf,_0x1f1aa9);_0x52b3e0(null);})[_0x0395('0xb')](_0x52b3e0(null));};}for(var e in events){if(events[_0x0395('0xc')](e)){var event=events[e];FaxInteraction[_0x0395('0xd')](e,emitEvent(event));}}module[_0x0395('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x0999=['catch','hasOwnProperty','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x0999,0x192));var _0x9099=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x0999[_0x34232c];return _0x4d4f4e;};'use strict';var EventEmitter=require(_0x9099('0x0'));var FaxInteraction=require(_0x9099('0x1'))['db'][_0x9099('0x2')];var FaxMessage=require(_0x9099('0x1'))['db'][_0x9099('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9099('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9099('0x5')};function emitEvent(_0x2e25f3){return function(_0x559c38,_0x42413b,_0x5f5770){_0x559c38['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1d06b2){_0x559c38[_0x9099('0x6')](_0x9099('0x7'),_0x1d06b2[_0x9099('0x8')](function(_0x34d0f5){return{'id':_0x34d0f5['id']};}));return FaxMessage[_0x9099('0x9')]({'where':{'FaxInteractionId':_0x559c38['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9099('0xa')](function(_0x54cb1a){_0x559c38[_0x9099('0x6')](_0x9099('0xb'),_0x54cb1a[_0x9099('0xc')]);FaxInteractionEvents[_0x9099('0xd')](_0x2e25f3+':'+_0x559c38['id'],_0x559c38);FaxInteractionEvents[_0x9099('0xd')](_0x2e25f3,_0x559c38);_0x5f5770(null);})[_0x9099('0xe')](_0x5f5770(null));};}for(var e in events){if(events[_0x9099('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0f70ec9..47a0087 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 _0x8ff9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x24c963,_0x5f32a4){var _0x32a0eb=function(_0x3fd2eb){while(--_0x3fd2eb){_0x24c963['push'](_0x24c963['shift']());}};_0x32a0eb(++_0x5f32a4);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x35913f,_0x3d90c8){_0x35913f=_0x35913f-0x0;var _0x45c149=_0x8ff9[_0x35913f];return _0x45c149;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var logger=require(_0x98ff('0x2'))(_0x98ff('0x3'));var moment=require(_0x98ff('0x4'));var BPromise=require(_0x98ff('0x5'));var rp=require(_0x98ff('0x6'));var fs=require('fs');var path=require(_0x98ff('0x7'));var rimraf=require(_0x98ff('0x8'));var config=require(_0x98ff('0x9'));var attributes=require(_0x98ff('0xa'));module['exports']=function(_0x3c07f5,_0xcdd5f){return _0x3c07f5[_0x98ff('0xb')](_0x98ff('0xc'),attributes,{'tableName':_0x98ff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbe13f3,_0x51fbd8,_0x3a528c){if(_0xbe13f3['changed']('closed')){_0xbe13f3[_0x98ff('0xe')]=moment()[_0x98ff('0xf')](_0x98ff('0x10'));}_0x3a528c(null,_0xbe13f3);}}});}; \ No newline at end of file +var _0xe55d=['YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','rimraf','./faxInteraction.attributes','define','fax_interactions','changed','format'];(function(_0x208e9d,_0x3d35d7){var _0x482578=function(_0x144c8a){while(--_0x144c8a){_0x208e9d['push'](_0x208e9d['shift']());}};_0x482578(++_0x3d35d7);}(_0xe55d,0x15d));var _0xde55=function(_0x16ecf3,_0x3b2691){_0x16ecf3=_0x16ecf3-0x0;var _0x183edb=_0xe55d[_0x16ecf3];return _0x183edb;};'use strict';var _=require(_0xde55('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xde55('0x1'));var moment=require(_0xde55('0x2'));var BPromise=require(_0xde55('0x3'));var rp=require(_0xde55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde55('0x5'));var config=require('../../config/environment');var attributes=require(_0xde55('0x6'));module['exports']=function(_0x1ff569,_0x26bf11){return _0x1ff569[_0xde55('0x7')]('FaxInteraction',attributes,{'tableName':_0xde55('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e7db0,_0x2809f3,_0x547281){if(_0x2e7db0[_0xde55('0x9')]('closed')){_0x2e7db0['closedAt']=moment()[_0xde55('0xa')](_0xde55('0xb'));}_0x547281(null,_0x2e7db0);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 0039ade..f99d1c2 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 _0x1394=['addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','then','AddTagsToFaxInteraction','find'];(function(_0x1368e7,_0x2e7ac6){var _0x1768cf=function(_0x434768){while(--_0x434768){_0x1368e7['push'](_0x1368e7['shift']());}};_0x1768cf(++_0x2e7ac6);}(_0x1394,0xa4));var _0x4139=function(_0xb61fa6,_0x580145){_0xb61fa6=_0xb61fa6-0x0;var _0x227190=_0x1394[_0xb61fa6];return _0x227190;};'use strict';var _=require(_0x4139('0x0'));var util=require(_0x4139('0x1'));var moment=require(_0x4139('0x2'));var BPromise=require(_0x4139('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4139('0x4'));var db=require(_0x4139('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4139('0x6'))(_0x4139('0x7'));var config=require('../../config/environment');var jayson=require(_0x4139('0x8'));var client=jayson[_0x4139('0x9')][_0x4139('0xa')]({'port':0x232a});config[_0x4139('0xb')]=_[_0x4139('0xc')](config[_0x4139('0xb')],{'host':_0x4139('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4139('0xb')]));require('./faxInteraction.socket')[_0x4139('0xe')](socket);function respondWithRpcPromise(_0x27fb49,_0x49d8cd,_0x25a2e8){return new BPromise(function(_0x39acec,_0x558331){return client['request'](_0x27fb49,_0x25a2e8)['then'](function(_0x4593b0){logger[_0x4139('0xf')](_0x4139('0x10'),_0x49d8cd,'request\x20sent');logger[_0x4139('0x11')](_0x4139('0x12'),_0x49d8cd,_0x4139('0x13'),JSON[_0x4139('0x14')](_0x4593b0));if(_0x4593b0[_0x4139('0x15')]){if(_0x4593b0[_0x4139('0x15')][_0x4139('0x16')]===0x1f4){logger[_0x4139('0x15')](_0x4139('0x10'),_0x49d8cd,_0x4593b0['error'][_0x4139('0x17')]);return _0x558331(_0x4593b0[_0x4139('0x15')][_0x4139('0x17')]);}logger[_0x4139('0x15')](_0x4139('0x10'),_0x49d8cd,_0x4593b0[_0x4139('0x15')][_0x4139('0x17')]);return _0x39acec(_0x4593b0['error'][_0x4139('0x17')]);}else{logger[_0x4139('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x49d8cd,'request\x20sent');_0x39acec(_0x4593b0[_0x4139('0x18')]['message']);}})[_0x4139('0x19')](function(_0x3865ad){logger[_0x4139('0x15')](_0x4139('0x10'),_0x49d8cd,_0x3865ad);_0x558331(_0x3865ad);});});}exports[_0x4139('0x1a')]=function(_0x15a20e){var _0x36e4c7=this;return new Promise(function(_0x1b95de,_0xe04fe1){return db[_0x4139('0x1b')]['update'](_0x15a20e[_0x4139('0x1c')],{'raw':_0x15a20e['options']?_0x15a20e[_0x4139('0x1d')][_0x4139('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15a20e[_0x4139('0x1d')]?_0x15a20e[_0x4139('0x1d')][_0x4139('0x1f')]||null:null,'attributes':_0x15a20e[_0x4139('0x1d')]?_0x15a20e[_0x4139('0x1d')][_0x4139('0x20')]||null:null,'limit':_0x15a20e[_0x4139('0x1d')]?_0x15a20e[_0x4139('0x1d')]['limit']||null:null})[_0x4139('0x21')](function(_0x1fb714){logger['info'](_0x4139('0x1a'),_0x15a20e);logger[_0x4139('0x11')](_0x4139('0x1a'),_0x15a20e,JSON[_0x4139('0x14')](_0x1fb714));_0x1b95de(_0x1fb714);})[_0x4139('0x19')](function(_0x317b8c){logger['error']('UpdateFaxInteraction',_0x317b8c['message'],_0x15a20e);_0xe04fe1(_0x36e4c7['error'](0x1f4,_0x317b8c[_0x4139('0x17')]));});});};exports[_0x4139('0x22')]=function(_0x5b8179){return new Promise(function(_0x5f3262,_0x1d7ffc){return db[_0x4139('0x1b')][_0x4139('0x23')]({'where':_0x5b8179[_0x4139('0x1d')]?_0x5b8179[_0x4139('0x1d')]['where']||null:null})[_0x4139('0x21')](function(_0x2d999d){if(_0x2d999d){return _0x2d999d[_0x4139('0x24')](_0x5b8179['body'][_0x4139('0x25')],_[_0x4139('0x26')](_0x5b8179[_0x4139('0x1c')],['ids','id'])||{});}})['spread'](function(_0x33c097){logger['info'](_0x4139('0x27'),_0x5b8179);logger[_0x4139('0x11')](_0x4139('0x27'),_0x5b8179,JSON['stringify'](_0x33c097));_0x5f3262(_0x33c097);})['catch'](function(_0xf2e3b7){logger['error'](_0x4139('0x27'),_0xf2e3b7[_0x4139('0x17')],_0x5b8179);_0x1d7ffc(_this[_0x4139('0x15')](0x1f4,_0xf2e3b7[_0x4139('0x17')]));});});}; \ No newline at end of file +var _0xcb90=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','debug','find','addTags','omit','ids','AddTags','util','../../mysqldb','../../config/logger'];(function(_0x477317,_0x2b1dd2){var _0x196a38=function(_0x2f5118){while(--_0x2f5118){_0x477317['push'](_0x477317['shift']());}};_0x196a38(++_0x2b1dd2);}(_0xcb90,0x1d1));var _0x0cb9=function(_0x30b43f,_0x7a266c){_0x30b43f=_0x30b43f-0x0;var _0x1c3c48=_0xcb90[_0x30b43f];return _0x1c3c48;};'use strict';var _=require('lodash');var util=require(_0x0cb9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cb9('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cb9('0x2'))('rpc');var config=require(_0x0cb9('0x3'));var jayson=require(_0x0cb9('0x4'));var client=jayson[_0x0cb9('0x5')]['http']({'port':0x232a});config[_0x0cb9('0x6')]=_[_0x0cb9('0x7')](config[_0x0cb9('0x6')],{'host':_0x0cb9('0x8'),'port':0x18eb});var socket=require(_0x0cb9('0x9'))(new Redis(config[_0x0cb9('0x6')]));require('./faxInteraction.socket')[_0x0cb9('0xa')](socket);function respondWithRpcPromise(_0x456b4d,_0x28dc72,_0x543d30){return new BPromise(function(_0x3eba6f,_0x59136d){return client[_0x0cb9('0xb')](_0x456b4d,_0x543d30)[_0x0cb9('0xc')](function(_0x295271){logger[_0x0cb9('0xd')](_0x0cb9('0xe'),_0x28dc72,_0x0cb9('0xf'));logger['debug'](_0x0cb9('0x10'),_0x28dc72,_0x0cb9('0xf'),JSON['stringify'](_0x295271));if(_0x295271[_0x0cb9('0x11')]){if(_0x295271[_0x0cb9('0x11')][_0x0cb9('0x12')]===0x1f4){logger['error'](_0x0cb9('0xe'),_0x28dc72,_0x295271['error'][_0x0cb9('0x13')]);return _0x59136d(_0x295271['error']['message']);}logger['error'](_0x0cb9('0xe'),_0x28dc72,_0x295271[_0x0cb9('0x11')][_0x0cb9('0x13')]);return _0x3eba6f(_0x295271[_0x0cb9('0x11')]['message']);}else{logger[_0x0cb9('0xd')](_0x0cb9('0xe'),_0x28dc72,'request\x20sent');_0x3eba6f(_0x295271['result'][_0x0cb9('0x13')]);}})[_0x0cb9('0x14')](function(_0x68152e){logger[_0x0cb9('0x11')](_0x0cb9('0xe'),_0x28dc72,_0x68152e);_0x59136d(_0x68152e);});});}exports[_0x0cb9('0x15')]=function(_0x9d92b2){var _0x1cb0ca=this;return new Promise(function(_0x5aee82,_0x13861f){return db[_0x0cb9('0x16')][_0x0cb9('0x17')](_0x9d92b2[_0x0cb9('0x18')],{'raw':_0x9d92b2[_0x0cb9('0x19')]?_0x9d92b2[_0x0cb9('0x19')][_0x0cb9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9d92b2[_0x0cb9('0x19')]?_0x9d92b2[_0x0cb9('0x19')][_0x0cb9('0x1b')]||null:null,'attributes':_0x9d92b2['options']?_0x9d92b2['options'][_0x0cb9('0x1c')]||null:null,'limit':_0x9d92b2[_0x0cb9('0x19')]?_0x9d92b2['options'][_0x0cb9('0x1d')]||null:null})['then'](function(_0xdcc1bd){logger[_0x0cb9('0xd')](_0x0cb9('0x15'),_0x9d92b2);logger[_0x0cb9('0x1e')]('UpdateFaxInteraction',_0x9d92b2,JSON['stringify'](_0xdcc1bd));_0x5aee82(_0xdcc1bd);})[_0x0cb9('0x14')](function(_0x5042f4){logger[_0x0cb9('0x11')](_0x0cb9('0x15'),_0x5042f4[_0x0cb9('0x13')],_0x9d92b2);_0x13861f(_0x1cb0ca[_0x0cb9('0x11')](0x1f4,_0x5042f4[_0x0cb9('0x13')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4e0b58){return new Promise(function(_0x14b600,_0x25e282){return db[_0x0cb9('0x16')][_0x0cb9('0x1f')]({'where':_0x4e0b58[_0x0cb9('0x19')]?_0x4e0b58[_0x0cb9('0x19')][_0x0cb9('0x1b')]||null:null})[_0x0cb9('0xc')](function(_0x560b9b){if(_0x560b9b){return _0x560b9b[_0x0cb9('0x20')](_0x4e0b58['body']['ids'],_[_0x0cb9('0x21')](_0x4e0b58['body'],[_0x0cb9('0x22'),'id'])||{});}})['spread'](function(_0x156483){logger[_0x0cb9('0xd')](_0x0cb9('0x23'),_0x4e0b58);logger[_0x0cb9('0x1e')](_0x0cb9('0x23'),_0x4e0b58,JSON['stringify'](_0x156483));_0x14b600(_0x156483);})['catch'](function(_0x59e930){logger[_0x0cb9('0x11')](_0x0cb9('0x23'),_0x59e930[_0x0cb9('0x13')],_0x4e0b58);_0x25e282(_this[_0x0cb9('0x11')](0x1f4,_0x59e930[_0x0cb9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 1c85b98..4bc795f 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 _0xf89c=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0xf89c,0x142));var _0xcf89=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf89c[_0x14add3];return _0x4a174f;};'use strict';var FaxInteractionEvents=require(_0xcf89('0x0'));var events=[_0xcf89('0x1'),_0xcf89('0x2'),_0xcf89('0x3')];function createListener(_0x4e407b,_0x1daa2d){return function(_0x23f3dc){_0x1daa2d[_0xcf89('0x4')](_0x4e407b,_0x23f3dc);};}function removeListener(_0x318fe1,_0x35ac4b){return function(){FaxInteractionEvents[_0xcf89('0x5')](_0x318fe1,_0x35ac4b);};}exports[_0xcf89('0x6')]=function(_0xdc5089){for(var _0x3a3f8b=0x0,_0xbef8f7=events[_0xcf89('0x7')];_0x3a3f8b<_0xbef8f7;_0x3a3f8b++){var _0x2b65fb=events[_0x3a3f8b];var _0x515c9e=createListener(_0xcf89('0x8')+_0x2b65fb,_0xdc5089);FaxInteractionEvents['on'](_0x2b65fb,_0x515c9e);}}; \ No newline at end of file +var _0xc489=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x39e58f,_0xf91bc5){var _0x541ec7=function(_0x17028a){while(--_0x17028a){_0x39e58f['push'](_0x39e58f['shift']());}};_0x541ec7(++_0xf91bc5);}(_0xc489,0x16e));var _0x9c48=function(_0x302099,_0x583c54){_0x302099=_0x302099-0x0;var _0x1a1aa8=_0xc489[_0x302099];return _0x1a1aa8;};'use strict';var FaxInteractionEvents=require(_0x9c48('0x0'));var events=['save',_0x9c48('0x1'),_0x9c48('0x2')];function createListener(_0x55626e,_0x4ef06d){return function(_0x22315f){_0x4ef06d[_0x9c48('0x3')](_0x55626e,_0x22315f);};}function removeListener(_0x2ce57a,_0x1c8cf0){return function(){FaxInteractionEvents[_0x9c48('0x4')](_0x2ce57a,_0x1c8cf0);};}exports[_0x9c48('0x5')]=function(_0x401fe6){for(var _0x546f6d=0x0,_0x557d3a=events[_0x9c48('0x6')];_0x546f6d<_0x557d3a;_0x546f6d++){var _0x349f36=events[_0x546f6d];var _0x5f238b=createListener(_0x9c48('0x7')+_0x349f36,_0x401fe6);FaxInteractionEvents['on'](_0x349f36,_0x5f238b);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b71948e..b5d4c93 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 _0x9d73=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','faxinteraction:addtags','addTags','put','/:id','fax','update','delete','faxinteraction:destroy','destroy','removeTags','exports'];(function(_0x320f03,_0x131899){var _0x30069c=function(_0x2fa597){while(--_0x2fa597){_0x320f03['push'](_0x320f03['shift']());}};_0x30069c(++_0x131899);}(_0x9d73,0x1ef));var _0x39d7=function(_0x319ade,_0x4d315e){_0x319ade=_0x319ade-0x0;var _0x3894a5=_0x9d73[_0x319ade];return _0x3894a5;};'use strict';var multer=require(_0x39d7('0x0'));var util=require(_0x39d7('0x1'));var path=require(_0x39d7('0x2'));var timeout=require(_0x39d7('0x3'));var express=require(_0x39d7('0x4'));var router=express[_0x39d7('0x5')]();var fs_extra=require(_0x39d7('0x6'));var auth=require(_0x39d7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x39d7('0x8'));var controller=require(_0x39d7('0x9'));router['get']('/',auth[_0x39d7('0xa')](),controller[_0x39d7('0xb')]);router['get'](_0x39d7('0xc'),auth[_0x39d7('0xa')](),controller[_0x39d7('0xd')]);router[_0x39d7('0xe')]('/:id',auth[_0x39d7('0xa')](),controller['show']);router[_0x39d7('0xe')](_0x39d7('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0x39d7('0xe')](_0x39d7('0x10'),auth['isAuthenticated'](),controller[_0x39d7('0x11')]);router[_0x39d7('0x12')]('/',auth[_0x39d7('0xa')](),controller[_0x39d7('0x13')]);router[_0x39d7('0x12')](_0x39d7('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x39d7('0x14'),auth[_0x39d7('0xa')](),interaction[_0x39d7('0x15')]('fax',_0x39d7('0x16')),controller[_0x39d7('0x17')]);router[_0x39d7('0x18')](_0x39d7('0x19'),auth[_0x39d7('0xa')](),interaction[_0x39d7('0x15')](_0x39d7('0x1a'),'faxinteraction:update'),controller[_0x39d7('0x1b')]);router[_0x39d7('0x1c')](_0x39d7('0x19'),auth[_0x39d7('0xa')](),interaction[_0x39d7('0x15')]('fax',_0x39d7('0x1d')),controller[_0x39d7('0x1e')]);router[_0x39d7('0x1c')](_0x39d7('0x14'),auth[_0x39d7('0xa')](),controller[_0x39d7('0x1f')]);module[_0x39d7('0x20')]=router; \ No newline at end of file +var _0x7497=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','isAuthenticated','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','put','/:id','fax','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer'];(function(_0x59726f,_0x12ca2b){var _0x261676=function(_0x48bc57){while(--_0x48bc57){_0x59726f['push'](_0x59726f['shift']());}};_0x261676(++_0x12ca2b);}(_0x7497,0xef));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var path=require(_0x7749('0x2'));var timeout=require(_0x7749('0x3'));var express=require(_0x7749('0x4'));var router=express[_0x7749('0x5')]();var fs_extra=require(_0x7749('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7749('0x7'));var config=require(_0x7749('0x8'));var controller=require('./faxInteraction.controller');router[_0x7749('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7749('0xa'),auth['isAuthenticated'](),controller[_0x7749('0xb')]);router[_0x7749('0x9')]('/:id',auth[_0x7749('0xc')](),controller['show']);router[_0x7749('0x9')]('/:id/messages',auth[_0x7749('0xc')](),controller[_0x7749('0xd')]);router['get'](_0x7749('0xe'),auth[_0x7749('0xc')](),controller[_0x7749('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7749('0x10')](_0x7749('0x11'),auth['isAuthenticated'](),controller[_0x7749('0x12')]);router[_0x7749('0x10')](_0x7749('0x13'),auth[_0x7749('0xc')](),interaction[_0x7749('0x14')]('fax','faxinteraction:addtags'),controller['addTags']);router[_0x7749('0x15')](_0x7749('0x16'),auth[_0x7749('0xc')](),interaction[_0x7749('0x14')](_0x7749('0x17'),_0x7749('0x18')),controller[_0x7749('0x19')]);router[_0x7749('0x1a')](_0x7749('0x16'),auth[_0x7749('0xc')](),interaction[_0x7749('0x14')](_0x7749('0x17'),_0x7749('0x1b')),controller['destroy']);router[_0x7749('0x1a')](_0x7749('0x13'),auth[_0x7749('0xc')](),controller[_0x7749('0x1c')]);module[_0x7749('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6202f26..3d5630b 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 _0xd6d6=['DATE','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x262a82,_0x3b1ec0){_0x262a82=_0x262a82-0x0;var _0x4529d6=_0xd6d6[_0x262a82];return _0x4529d6;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'body':{'type':Sequelize[_0x6d6d('0x2')](_0x6d6d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6d6d('0x4')]('in',_0x6d6d('0x5')),'defaultValue':_0x6d6d('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6d6d('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6d6d('0x6')]}}; \ No newline at end of file +var _0xb28a=['BOOLEAN','DATE','exports','TEXT'];(function(_0x31d4ab,_0x1b937b){var _0x35dbf5=function(_0x3b4b0e){while(--_0x3b4b0e){_0x31d4ab['push'](_0x31d4ab['shift']());}};_0x35dbf5(++_0x1b937b);}(_0xb28a,0x166));var _0xab28=function(_0xfd7d4,_0x47da0f){_0xfd7d4=_0xfd7d4-0x0;var _0x471a59=_0xb28a[_0xfd7d4];return _0x471a59;};'use strict';var Sequelize=require('sequelize');module[_0xab28('0x0')]={'body':{'type':Sequelize[_0xab28('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xab28('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xab28('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xab28('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 7462884..78f1b79 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 _0xcd5e=['internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','fullname','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','files','attachments','join','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','stack','send','index','FaxMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','include','findAll','rows','catch','params','length','includeAll','find','update','body','describe','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','email'];(function(_0x167063,_0xa7453b){var _0x376edc=function(_0x1ab43a){while(--_0x1ab43a){_0x167063['push'](_0x167063['shift']());}};_0x376edc(++_0xa7453b);}(_0xcd5e,0x1c5));var _0xecd5=function(_0x45e9cf,_0x5580ea){_0x45e9cf=_0x45e9cf-0x0;var _0x45317c=_0xcd5e[_0x45e9cf];return _0x45317c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xecd5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xecd5('0x1'));var BPromise=require(_0xecd5('0x2'));var Mustache=require(_0xecd5('0x3'));var util=require(_0xecd5('0x4'));var path=require(_0xecd5('0x5'));var sox=require(_0xecd5('0x6'));var csv=require(_0xecd5('0x7'));var ejs=require(_0xecd5('0x8'));var fs=require('fs');var fs_extra=require(_0xecd5('0x9'));var _=require(_0xecd5('0xa'));var squel=require(_0xecd5('0xb'));var crypto=require(_0xecd5('0xc'));var jsforce=require(_0xecd5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xecd5('0xe'));var Redis=require(_0xecd5('0xf'));var authService=require(_0xecd5('0x10'));var qs=require(_0xecd5('0x11'));var as=require(_0xecd5('0x12'));var hardwareService=require(_0xecd5('0x13'));var logger=require(_0xecd5('0x14'))(_0xecd5('0x15'));var utils=require(_0xecd5('0x16'));var config=require(_0xecd5('0x17'));var licenseUtil=require(_0xecd5('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xecd5('0x19')](config[_0xecd5('0x1a')],{'host':_0xecd5('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecd5('0x1a')]));require('./faxMessage.socket')[_0xecd5('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xecd5('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xecd5('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xb64609,_0x5b1c4c,_0xe66419,_0x335264){return new BPromise(function(_0x5319e1,_0x1bac33){var _0x14e61b=_0x335264||client;return _0x14e61b[_0xecd5('0x1e')](_0xb64609,_0xe66419)[_0xecd5('0x1f')](function(_0x4d4eed){logger[_0xecd5('0x20')](_0xecd5('0x21'),_0x5b1c4c,_0xecd5('0x22'));logger[_0xecd5('0x23')](_0xecd5('0x24'),_0x5b1c4c,'request\x20sent',JSON['stringify'](_0x4d4eed));if(_0x4d4eed[_0xecd5('0x25')]){if(_0x4d4eed[_0xecd5('0x25')][_0xecd5('0x26')]===0x1f4){logger[_0xecd5('0x25')](_0xecd5('0x21'),_0x5b1c4c,_0x4d4eed['error'][_0xecd5('0x27')]);return _0x1bac33(_0x4d4eed[_0xecd5('0x25')]['message']);}logger['error'](_0xecd5('0x21'),_0x5b1c4c,_0x4d4eed[_0xecd5('0x25')][_0xecd5('0x27')]);return _0x5319e1(_0x4d4eed[_0xecd5('0x25')][_0xecd5('0x27')]);}else{logger[_0xecd5('0x20')](_0xecd5('0x21'),_0x5b1c4c,'request\x20sent');_0x5319e1(_0x4d4eed[_0xecd5('0x28')][_0xecd5('0x27')]);}})['catch'](function(_0x174718){logger[_0xecd5('0x25')](_0xecd5('0x21'),_0x5b1c4c,_0x174718);_0x1bac33(_0x174718);});});}function respondWithStatusCode(_0x3ad282,_0x2c35de){_0x2c35de=_0x2c35de||0xcc;return function(_0x20cb4b){if(_0x20cb4b){return _0x3ad282[_0xecd5('0x29')](_0x2c35de);}return _0x3ad282[_0xecd5('0x2a')](_0x2c35de)['end']();};}function respondWithResult(_0x462a70,_0x3e8f44){_0x3e8f44=_0x3e8f44||0xc8;return function(_0x5499e6){if(_0x5499e6){return _0x462a70[_0xecd5('0x2a')](_0x3e8f44)[_0xecd5('0x2b')](_0x5499e6);}};}function respondWithFilteredResult(_0x5678c0,_0x35cac3){return function(_0x25bdb4){if(_0x25bdb4){var _0x14bf46=typeof _0x35cac3[_0xecd5('0x2c')]===_0xecd5('0x2d')&&typeof _0x35cac3[_0xecd5('0x2e')]==='undefined';var _0x46c136=_0x25bdb4[_0xecd5('0x2f')];var _0x7a23c1=_0x14bf46?0x0:_0x35cac3[_0xecd5('0x2c')];var _0x42302e=_0x14bf46?_0x25bdb4['count']:_0x35cac3[_0xecd5('0x2c')]+_0x35cac3[_0xecd5('0x2e')];var _0x21468a;if(_0x42302e>=_0x46c136){_0x42302e=_0x46c136;_0x21468a=0xc8;}else{_0x21468a=0xce;}_0x5678c0['status'](_0x21468a);return _0x5678c0[_0xecd5('0x30')](_0xecd5('0x31'),_0x7a23c1+'-'+_0x42302e+'/'+_0x46c136)['json'](_0x25bdb4);}return null;};}function patchUpdates(_0x9986d4){return function(_0x7f5050){try{jsonpatch[_0xecd5('0x32')](_0x7f5050,_0x9986d4,!![]);}catch(_0x224fad){return BPromise[_0xecd5('0x33')](_0x224fad);}return _0x7f5050[_0xecd5('0x34')]();};}function saveUpdates(_0x5472d1,_0x116a54){return function(_0x18d42a){if(_0x18d42a){return _0x18d42a['update'](_0x5472d1)[_0xecd5('0x1f')](function(_0x32dca7){return _0x32dca7;});}return null;};}function removeEntity(_0x3c1593,_0x45e17f){return function(_0x5be3a1){if(_0x5be3a1){return _0x5be3a1[_0xecd5('0x35')]()[_0xecd5('0x1f')](function(){_0x3c1593[_0xecd5('0x2a')](0xcc)[_0xecd5('0x36')]();});}};}function handleEntityNotFound(_0x4a3fe9,_0x55b8cb){return function(_0x51ec73){if(!_0x51ec73){_0x4a3fe9[_0xecd5('0x29')](0x194);}return _0x51ec73;};}function handleError(_0x4481ea,_0x211008){_0x211008=_0x211008||0x1f4;return function(_0x10f670){logger['error'](_0x10f670[_0xecd5('0x37')]);if(_0x10f670['name']){delete _0x10f670['name'];}_0x4481ea['status'](_0x211008)[_0xecd5('0x38')](_0x10f670);};}exports[_0xecd5('0x39')]=function(_0x51cf6b,_0x558188){var _0xb501c5={},_0x1dff85={},_0x4bd005={'count':0x0,'rows':[]};var _0x341cdc=_['map'](db[_0xecd5('0x3a')][_0xecd5('0x3b')],function(_0x5c5998){return{'name':_0x5c5998[_0xecd5('0x3c')],'type':_0x5c5998[_0xecd5('0x3d')][_0xecd5('0x3e')]};});_0x1dff85['model']=_[_0xecd5('0x3f')](_0x341cdc,'name');_0x1dff85[_0xecd5('0x40')]=_[_0xecd5('0x41')](_0x51cf6b[_0xecd5('0x40')]);_0x1dff85[_0xecd5('0x42')]=_['intersection'](_0x1dff85[_0xecd5('0x43')],_0x1dff85[_0xecd5('0x40')]);_0xb501c5['attributes']=_[_0xecd5('0x44')](_0x1dff85[_0xecd5('0x43')],qs[_0xecd5('0x45')](_0x51cf6b[_0xecd5('0x40')][_0xecd5('0x45')]));_0xb501c5[_0xecd5('0x46')]=_0xb501c5['attributes']['length']?_0xb501c5['attributes']:_0x1dff85[_0xecd5('0x43')];if(!_0x51cf6b[_0xecd5('0x40')][_0xecd5('0x47')](_0xecd5('0x48'))){_0xb501c5[_0xecd5('0x2e')]=qs['limit'](_0x51cf6b[_0xecd5('0x40')][_0xecd5('0x2e')]);_0xb501c5[_0xecd5('0x2c')]=qs[_0xecd5('0x2c')](_0x51cf6b[_0xecd5('0x40')]['offset']);}_0xb501c5[_0xecd5('0x49')]=qs[_0xecd5('0x4a')](_0x51cf6b[_0xecd5('0x40')]['sort']);_0xb501c5[_0xecd5('0x4b')]=qs[_0xecd5('0x42')](_['pick'](_0x51cf6b[_0xecd5('0x40')],_0x1dff85[_0xecd5('0x42')]),_0x341cdc);if(_0x51cf6b[_0xecd5('0x40')][_0xecd5('0x4c')]){_0xb501c5[_0xecd5('0x4b')]=_[_0xecd5('0x4d')](_0xb501c5[_0xecd5('0x4b')],{'$or':_[_0xecd5('0x3f')](_0x341cdc,function(_0x5d81c6){if(_0x5d81c6[_0xecd5('0x3d')]!==_0xecd5('0x4e')){var _0x4896b0={};_0x4896b0[_0x5d81c6[_0xecd5('0x4f')]]={'$like':'%'+_0x51cf6b[_0xecd5('0x40')]['filter']+'%'};return _0x4896b0;}})});}_0xb501c5=_[_0xecd5('0x4d')]({},_0xb501c5,_0x51cf6b[_0xecd5('0x50')]);var _0x318f33={'where':_0xb501c5[_0xecd5('0x4b')]};return db[_0xecd5('0x3a')]['count'](_0x318f33)['then'](function(_0x26c607){_0x4bd005[_0xecd5('0x2f')]=_0x26c607;if(_0x51cf6b[_0xecd5('0x40')]['includeAll']){_0xb501c5[_0xecd5('0x51')]=[{'all':!![]}];}return db[_0xecd5('0x3a')][_0xecd5('0x52')](_0xb501c5);})[_0xecd5('0x1f')](function(_0x501406){_0x4bd005[_0xecd5('0x53')]=_0x501406;return _0x4bd005;})[_0xecd5('0x1f')](respondWithFilteredResult(_0x558188,_0xb501c5))[_0xecd5('0x54')](handleError(_0x558188,null));};exports['show']=function(_0x10c01b,_0x3edfc4){var _0x5c62f0={'raw':!![],'where':{'id':_0x10c01b[_0xecd5('0x55')]['id']}},_0x3a7f0a={};_0x3a7f0a[_0xecd5('0x43')]=_[_0xecd5('0x41')](db[_0xecd5('0x3a')][_0xecd5('0x3b')]);_0x3a7f0a[_0xecd5('0x40')]=_['keys'](_0x10c01b[_0xecd5('0x40')]);_0x3a7f0a[_0xecd5('0x42')]=_[_0xecd5('0x44')](_0x3a7f0a[_0xecd5('0x43')],_0x3a7f0a[_0xecd5('0x40')]);_0x5c62f0[_0xecd5('0x46')]=_[_0xecd5('0x44')](_0x3a7f0a[_0xecd5('0x43')],qs['fields'](_0x10c01b[_0xecd5('0x40')][_0xecd5('0x45')]));_0x5c62f0[_0xecd5('0x46')]=_0x5c62f0[_0xecd5('0x46')][_0xecd5('0x56')]?_0x5c62f0['attributes']:_0x3a7f0a[_0xecd5('0x43')];if(_0x10c01b[_0xecd5('0x40')][_0xecd5('0x57')]){_0x5c62f0[_0xecd5('0x51')]=[{'all':!![]}];}_0x5c62f0=_[_0xecd5('0x4d')]({},_0x5c62f0,_0x10c01b[_0xecd5('0x50')]);return db['FaxMessage'][_0xecd5('0x58')](_0x5c62f0)[_0xecd5('0x1f')](handleEntityNotFound(_0x3edfc4,null))['then'](respondWithResult(_0x3edfc4,null))['catch'](handleError(_0x3edfc4,null));};exports[_0xecd5('0x59')]=function(_0x291736,_0x3d90e6){if(_0x291736[_0xecd5('0x5a')]['id']){delete _0x291736[_0xecd5('0x5a')]['id'];}return db[_0xecd5('0x3a')][_0xecd5('0x58')]({'where':{'id':_0x291736[_0xecd5('0x55')]['id']}})[_0xecd5('0x1f')](handleEntityNotFound(_0x3d90e6,null))[_0xecd5('0x1f')](saveUpdates(_0x291736['body'],null))['then'](respondWithResult(_0x3d90e6,null))[_0xecd5('0x54')](handleError(_0x3d90e6,null));};exports['destroy']=function(_0x6fdfef,_0xedfb4c){return db[_0xecd5('0x3a')]['find']({'where':{'id':_0x6fdfef[_0xecd5('0x55')]['id']}})['then'](handleEntityNotFound(_0xedfb4c,null))[_0xecd5('0x1f')](removeEntity(_0xedfb4c,null))[_0xecd5('0x54')](handleError(_0xedfb4c,null));};exports['describe']=function(_0xcad778,_0x568661){return db[_0xecd5('0x3a')][_0xecd5('0x5b')]()[_0xecd5('0x1f')](respondWithResult(_0x568661,null))[_0xecd5('0x54')](handleError(_0x568661,null));};var interaction_log=require(_0xecd5('0x14'))('fax-interactions');exports[_0xecd5('0x5c')]=function(_0x21d38e,_0x379a0a,_0x21838b){var _0x18e12f={'agent':{},'channel':'fax'};if(_0x21d38e[_0xecd5('0x5a')]['id']){delete _0x21d38e['body']['id'];}_0x21d38e[_0xecd5('0x5a')]['read']=!![];_0x21d38e['body']['readAt']=moment()[_0xecd5('0x5d')](_0xecd5('0x5e'));_0x21d38e[_0xecd5('0x5a')][_0xecd5('0x5f')]=_0x21d38e[_0xecd5('0x5a')][_0xecd5('0x5f')]||_0x21d38e[_0xecd5('0x60')]['id'];_0x18e12f[_0xecd5('0x61')]['id']=_0x21d38e['body']['UserId'];return db[_0xecd5('0x3a')][_0xecd5('0x58')]({'where':{'id':_0x21d38e[_0xecd5('0x55')]['id'],'UserId':null}})[_0xecd5('0x1f')](handleEntityNotFound(_0x379a0a,null))[_0xecd5('0x1f')](saveUpdates(_0x21d38e[_0xecd5('0x5a')],null))[_0xecd5('0x1f')](function(_0x305eb2){if(_0x305eb2){_0x18e12f[_0xecd5('0x27')]=_0x305eb2[_0xecd5('0x62')]({'plain':!![]});return db[_0xecd5('0x63')][_0xecd5('0x58')]({'where':{'id':_0x305eb2[_0xecd5('0x64')]}});}return null;})[_0xecd5('0x1f')](handleEntityNotFound(_0x379a0a,null))[_0xecd5('0x1f')](function(_0x3018a4){if(_0x3018a4){return _0x3018a4[_0xecd5('0x59')]({'UserId':_0x21d38e['body'][_0xecd5('0x5f')],'read1stAt':_[_0xecd5('0x65')](_0x3018a4['read1stAt'])?moment()['format'](_0xecd5('0x5e')):undefined});}return null;})[_0xecd5('0x1f')](function(_0x10618d){if(_0x10618d){_0x18e12f[_0xecd5('0x66')]=_0x10618d['get']({'plain':!![]});interaction_log[_0xecd5('0x20')](_0xecd5('0x67'),_0x21d38e[_0xecd5('0x60')]['id'],_0x21d38e['user']['name'],_0x21d38e['user'][_0xecd5('0x68')],_0x18e12f[_0xecd5('0x66')]['id'],_0x21d38e[_0xecd5('0x5a')]?JSON[_0xecd5('0x69')](_0x21d38e['body']):_0xecd5('0x6a'));return respondWithRpcPromise(_0xecd5('0x6b'),'acceptMessage',_0x18e12f);}return null;})[_0xecd5('0x1f')](function(_0xcf4f3d){var _0x9870ba=_0xecd5('0x6c')+_0xcf4f3d[_0xecd5('0x27')][_0xecd5('0x6d')];return db[_0xecd5('0x6e')][_0xecd5('0x40')](_0x9870ba,{'type':db[_0xecd5('0x6f')][_0xecd5('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x519cd4){return _0x519cd4;});})[_0xecd5('0x1f')](function(_0xd09fd2){if(_0xd09fd2){_0x18e12f[_0xecd5('0x27')]['contact']=_0xd09fd2[0x0];if(!_0x21d38e[_0xecd5('0x5a')][_0xecd5('0x5f')])return;return db[_0xecd5('0x71')]['find']({'where':{'id':_0x21d38e['body'][_0xecd5('0x5f')],'role':_0xecd5('0x61')},'attributes':['id',_0xecd5('0x4f'),'fullname',_0xecd5('0x72'),_0xecd5('0x73')],'raw':!![]});}return null;})[_0xecd5('0x1f')](function(_0x3d4c63){if(!_0x3d4c63)return null;_0x18e12f['message']['agent']=_0x3d4c63;return _0x18e12f;})[_0xecd5('0x1f')](function(_0x2a03ed){if(_0x2a03ed){if(_0x21d38e['body'][_0xecd5('0x74')]){_0x18e12f['message'][_0xecd5('0x75')]=util['format'](_0xecd5('0x76'),_0x21d38e['user'][_0xecd5('0x4f')]);_0x18e12f[_0xecd5('0x27')][_0xecd5('0x77')]=_0x18e12f['channel'];_0x18e12f[_0xecd5('0x27')][_0xecd5('0x78')]=_0x18e12f[_0xecd5('0x77')];_0x18e12f[_0xecd5('0x27')][_0xecd5('0x79')]=_0xecd5('0x5c');return respondWithRpcPromise(_0xecd5('0x7a'),_0xecd5('0x7a'),{'event':_0xecd5('0x7b'),'message':_0x18e12f['message']},client9002)[_0xecd5('0x1f')](function(){return _0x18e12f;});}return _0x18e12f;}return null;})[_0xecd5('0x1f')](respondWithResult(_0x379a0a,null))[_0xecd5('0x54')](handleError(_0x379a0a,null));};var interaction_log=require(_0xecd5('0x14'))('fax-interactions');exports[_0xecd5('0x33')]=function(_0x196245,_0x725826,_0x1cfc78){var _0x2471a0={'agent':{},'channel':_0xecd5('0x7c')};if(_0x196245[_0xecd5('0x5a')]['id']){delete _0x196245[_0xecd5('0x5a')]['id'];}_0x196245[_0xecd5('0x5a')][_0xecd5('0x5f')]=_0x196245['body']['UserId']||_0x196245[_0xecd5('0x60')]['id'];_0x2471a0[_0xecd5('0x61')]['id']=_0x196245['body'][_0xecd5('0x5f')];return db[_0xecd5('0x3a')][_0xecd5('0x58')]({'where':{'id':_0x196245[_0xecd5('0x55')]['id'],'UserId':null}})[_0xecd5('0x1f')](handleEntityNotFound(_0x725826,null))['then'](function(_0x5478a4){if(_0x5478a4){_0x2471a0['message']=_0x5478a4[_0xecd5('0x62')]({'plain':!![]});return db[_0xecd5('0x63')][_0xecd5('0x58')]({'where':{'id':_0x5478a4[_0xecd5('0x64')]}});}return null;})[_0xecd5('0x1f')](handleEntityNotFound(_0x725826,null))[_0xecd5('0x1f')](function(_0x229151){if(_0x229151){_0x2471a0[_0xecd5('0x66')]=_0x229151[_0xecd5('0x62')]({'plain':!![]});interaction_log[_0xecd5('0x20')](_0xecd5('0x7d'),_0x196245[_0xecd5('0x60')]['id'],_0x196245[_0xecd5('0x60')]['name'],_0x196245[_0xecd5('0x60')][_0xecd5('0x68')],_0x2471a0[_0xecd5('0x66')]['id'],_0x196245[_0xecd5('0x5a')]?JSON[_0xecd5('0x69')](_0x196245[_0xecd5('0x5a')]):_0xecd5('0x6a'));return respondWithRpcPromise('RejectMessage',_0xecd5('0x7e'),_0x2471a0);}return null;})[_0xecd5('0x1f')](function(_0x3a3538){var _0x38aebe=_0xecd5('0x6c')+_0x3a3538[_0xecd5('0x27')][_0xecd5('0x6d')];return db[_0xecd5('0x6e')][_0xecd5('0x40')](_0x38aebe,{'type':db[_0xecd5('0x6f')][_0xecd5('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x150657){return _0x150657;});})[_0xecd5('0x1f')](function(_0x550150){if(_0x550150){_0x2471a0[_0xecd5('0x27')][_0xecd5('0x7f')]=_0x550150[0x0];if(!_0x196245[_0xecd5('0x5a')][_0xecd5('0x5f')])return;return db[_0xecd5('0x71')][_0xecd5('0x58')]({'where':{'id':_0x196245[_0xecd5('0x5a')][_0xecd5('0x5f')],'role':_0xecd5('0x61')},'attributes':['id',_0xecd5('0x4f'),_0xecd5('0x80'),_0xecd5('0x72'),_0xecd5('0x73')],'raw':!![]});}return null;})[_0xecd5('0x1f')](function(_0xe9a525){if(!_0xe9a525)return null;_0x2471a0[_0xecd5('0x27')][_0xecd5('0x61')]=_0xe9a525;return _0x2471a0;})['then'](function(_0x37f07c){if(_0x37f07c){_0x37f07c['message']['interface']=util[_0xecd5('0x5d')](_0xecd5('0x76'),_0x196245['user'][_0xecd5('0x4f')]);_0x37f07c[_0xecd5('0x27')][_0xecd5('0x77')]=_0x2471a0[_0xecd5('0x77')];_0x37f07c[_0xecd5('0x27')]['motionChannel']=_0x2471a0[_0xecd5('0x77')];_0x37f07c[_0xecd5('0x27')]['event']=_0xecd5('0x33');respondWithRpcPromise(_0xecd5('0x7a'),'EventManager',{'event':_0xecd5('0x81'),'message':_0x37f07c[_0xecd5('0x27')]},client9002);return _0x2471a0;}return null;})[_0xecd5('0x1f')](respondWithResult(_0x725826,null))['catch'](handleError(_0x725826,null));};exports[_0xecd5('0x82')]=function(_0x1c151c,_0x3dae47){var _0x59ebab;return db['FaxMessage'][_0xecd5('0x82')](_0x1c151c[_0xecd5('0x5a')],{})[_0xecd5('0x1f')](function(_0x28e538){_0x59ebab=_0x28e538;return db['CmContact'][_0xecd5('0x83')]({'where':{'id':_0x59ebab[_0xecd5('0x6d')]}});})[_0xecd5('0x1f')](function(_0xfd3e63){if(_[_0xecd5('0x65')](_0xfd3e63)){return;}else{_0x59ebab['fax']=_0xfd3e63['fax'];return db[_0xecd5('0x84')]['findOne']({'where':{'id':_0x59ebab[_0xecd5('0x85')]}});}})[_0xecd5('0x1f')](function(_0x5e1a6c){return respondWithRpcPromise(_0xecd5('0x86'),_0xecd5('0x86'),{'FaxAccountId':_[_0xecd5('0x65')](_0x1c151c[_0xecd5('0x5a')])?undefined:_0x1c151c[_0xecd5('0x5a')][_0xecd5('0x87')],'path':_[_0xecd5('0x65')](_0x5e1a6c)?undefined:util[_0xecd5('0x5d')](_0xecd5('0x88'),_0x5e1a6c[_0xecd5('0x89')]),'fax':_['isNil'](_0x59ebab[_0xecd5('0x7c')])?undefined:_0x59ebab['fax'],'AttachmentId':_0x59ebab['AttachmentId']},client9002);})[_0xecd5('0x1f')](respondWithResult(_0x3dae47,0xc9))['catch'](handleError(_0x3dae47,null));};exports[_0xecd5('0x8a')]=function(_0x512510,_0x3b8e38){var _0x1b420e=path['join'](config['root'],'server',_0xecd5('0x8b'),_0xecd5('0x8c'));return db['FaxMessage'][_0xecd5('0x58')]({'where':{'id':_0x512510[_0xecd5('0x55')]['id']},'include':[{'model':db[_0xecd5('0x84')],'as':_0xecd5('0x84')}]})[_0xecd5('0x1f')](handleEntityNotFound(_0x3b8e38,null))['then'](function(_0x484264){if(_0x484264){return _0x3b8e38[_0xecd5('0x8a')](path[_0xecd5('0x8d')](_0x1b420e,_0x484264[_0xecd5('0x84')][_0xecd5('0x89')]));}})['catch'](handleError(_0x3b8e38,null));}; \ No newline at end of file +var _0xcfa0=['fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','name','send','FaxMessage','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','update','body','find','describe','../../config/logger','fax-interactions','accept','fax','read','format','UserId','user','agent','FaxInteraction','YYYY-MM-DD\x20HH:mm:ss','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectmessage','create','CmContact','findOne','isNil','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','root','server','files','Attachment','download','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xcfa0,0x19b));var _0x0cfa=function(_0x248d91,_0x366668){_0x248d91=_0x248d91-0x0;var _0x316dcb=_0xcfa0[_0x248d91];return _0x316dcb;};'use strict';var emlformat=require(_0x0cfa('0x0'));var rimraf=require(_0x0cfa('0x1'));var zipdir=require(_0x0cfa('0x2'));var jsonpatch=require(_0x0cfa('0x3'));var rp=require('request-promise');var moment=require(_0x0cfa('0x4'));var BPromise=require(_0x0cfa('0x5'));var Mustache=require(_0x0cfa('0x6'));var util=require(_0x0cfa('0x7'));var path=require(_0x0cfa('0x8'));var sox=require(_0x0cfa('0x9'));var csv=require(_0x0cfa('0xa'));var ejs=require(_0x0cfa('0xb'));var fs=require('fs');var fs_extra=require(_0x0cfa('0xc'));var _=require(_0x0cfa('0xd'));var squel=require('squel');var crypto=require(_0x0cfa('0xe'));var jsforce=require(_0x0cfa('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0cfa('0xa'));var querystring=require('querystring');var Papa=require(_0x0cfa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0cfa('0x11'));var hardwareService=require(_0x0cfa('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0cfa('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cfa('0x14'))['db'];config[_0x0cfa('0x15')]=_[_0x0cfa('0x16')](config[_0x0cfa('0x15')],{'host':_0x0cfa('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0cfa('0x15')]));require(_0x0cfa('0x18'))[_0x0cfa('0x19')](socket);var jayson=require(_0x0cfa('0x1a'));var client=jayson[_0x0cfa('0x1b')][_0x0cfa('0x1c')]({'port':0x232c});var client9002=jayson[_0x0cfa('0x1b')][_0x0cfa('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x553f8b,_0x363a00,_0x3608a4,_0x100c3a){return new BPromise(function(_0x428109,_0x336232){var _0x5db9d5=_0x100c3a||client;return _0x5db9d5[_0x0cfa('0x1d')](_0x553f8b,_0x3608a4)['then'](function(_0x498016){logger['info'](_0x0cfa('0x1e'),_0x363a00,_0x0cfa('0x1f'));logger[_0x0cfa('0x20')](_0x0cfa('0x21'),_0x363a00,_0x0cfa('0x1f'),JSON['stringify'](_0x498016));if(_0x498016[_0x0cfa('0x22')]){if(_0x498016[_0x0cfa('0x22')][_0x0cfa('0x23')]===0x1f4){logger[_0x0cfa('0x22')](_0x0cfa('0x1e'),_0x363a00,_0x498016[_0x0cfa('0x22')][_0x0cfa('0x24')]);return _0x336232(_0x498016['error'][_0x0cfa('0x24')]);}logger[_0x0cfa('0x22')](_0x0cfa('0x1e'),_0x363a00,_0x498016[_0x0cfa('0x22')][_0x0cfa('0x24')]);return _0x428109(_0x498016['error'][_0x0cfa('0x24')]);}else{logger[_0x0cfa('0x25')](_0x0cfa('0x1e'),_0x363a00,'request\x20sent');_0x428109(_0x498016[_0x0cfa('0x26')][_0x0cfa('0x24')]);}})['catch'](function(_0x5df9f6){logger[_0x0cfa('0x22')](_0x0cfa('0x1e'),_0x363a00,_0x5df9f6);_0x336232(_0x5df9f6);});});}function respondWithStatusCode(_0x45ecd9,_0x48c4c0){_0x48c4c0=_0x48c4c0||0xcc;return function(_0x55e79b){if(_0x55e79b){return _0x45ecd9['sendStatus'](_0x48c4c0);}return _0x45ecd9[_0x0cfa('0x27')](_0x48c4c0)[_0x0cfa('0x28')]();};}function respondWithResult(_0x14bd95,_0x23cea7){_0x23cea7=_0x23cea7||0xc8;return function(_0x434047){if(_0x434047){return _0x14bd95[_0x0cfa('0x27')](_0x23cea7)[_0x0cfa('0x29')](_0x434047);}};}function respondWithFilteredResult(_0x4f80b3,_0x38b544){return function(_0x2ab947){if(_0x2ab947){var _0x2ca3ae=typeof _0x38b544['offset']===_0x0cfa('0x2a')&&typeof _0x38b544['limit']===_0x0cfa('0x2a');var _0x5b6fcc=_0x2ab947[_0x0cfa('0x2b')];var _0x325c16=_0x2ca3ae?0x0:_0x38b544['offset'];var _0x19891e=_0x2ca3ae?_0x2ab947[_0x0cfa('0x2b')]:_0x38b544['offset']+_0x38b544[_0x0cfa('0x2c')];var _0x2ad3de;if(_0x19891e>=_0x5b6fcc){_0x19891e=_0x5b6fcc;_0x2ad3de=0xc8;}else{_0x2ad3de=0xce;}_0x4f80b3['status'](_0x2ad3de);return _0x4f80b3[_0x0cfa('0x2d')](_0x0cfa('0x2e'),_0x325c16+'-'+_0x19891e+'/'+_0x5b6fcc)[_0x0cfa('0x29')](_0x2ab947);}return null;};}function patchUpdates(_0x2c3b72){return function(_0x1fdcce){try{jsonpatch[_0x0cfa('0x2f')](_0x1fdcce,_0x2c3b72,!![]);}catch(_0x44dc91){return BPromise[_0x0cfa('0x30')](_0x44dc91);}return _0x1fdcce['save']();};}function saveUpdates(_0x30fc7f,_0xb082cf){return function(_0x4a984d){if(_0x4a984d){return _0x4a984d['update'](_0x30fc7f)[_0x0cfa('0x31')](function(_0x183608){return _0x183608;});}return null;};}function removeEntity(_0x29187f,_0x2fbed4){return function(_0x5470cc){if(_0x5470cc){return _0x5470cc[_0x0cfa('0x32')]()[_0x0cfa('0x31')](function(){_0x29187f['status'](0xcc)[_0x0cfa('0x28')]();});}};}function handleEntityNotFound(_0x10d48e,_0x4d1d20){return function(_0x31891a){if(!_0x31891a){_0x10d48e[_0x0cfa('0x33')](0x194);}return _0x31891a;};}function handleError(_0x4965c0,_0x166631){_0x166631=_0x166631||0x1f4;return function(_0x1713a6){logger[_0x0cfa('0x22')](_0x1713a6['stack']);if(_0x1713a6[_0x0cfa('0x34')]){delete _0x1713a6[_0x0cfa('0x34')];}_0x4965c0[_0x0cfa('0x27')](_0x166631)[_0x0cfa('0x35')](_0x1713a6);};}exports['index']=function(_0x207e6b,_0x10a4a){var _0x17cf31={},_0x2f71d5={},_0x37c3a6={'count':0x0,'rows':[]};var _0x5c3ff8=_['map'](db[_0x0cfa('0x36')]['rawAttributes'],function(_0x2d8671){return{'name':_0x2d8671[_0x0cfa('0x37')],'type':_0x2d8671[_0x0cfa('0x38')]['key']};});_0x2f71d5[_0x0cfa('0x39')]=_[_0x0cfa('0x3a')](_0x5c3ff8,_0x0cfa('0x34'));_0x2f71d5[_0x0cfa('0x3b')]=_[_0x0cfa('0x3c')](_0x207e6b[_0x0cfa('0x3b')]);_0x2f71d5[_0x0cfa('0x3d')]=_[_0x0cfa('0x3e')](_0x2f71d5[_0x0cfa('0x39')],_0x2f71d5[_0x0cfa('0x3b')]);_0x17cf31[_0x0cfa('0x3f')]=_['intersection'](_0x2f71d5[_0x0cfa('0x39')],qs[_0x0cfa('0x40')](_0x207e6b[_0x0cfa('0x3b')][_0x0cfa('0x40')]));_0x17cf31[_0x0cfa('0x3f')]=_0x17cf31[_0x0cfa('0x3f')][_0x0cfa('0x41')]?_0x17cf31['attributes']:_0x2f71d5['model'];if(!_0x207e6b[_0x0cfa('0x3b')]['hasOwnProperty'](_0x0cfa('0x42'))){_0x17cf31[_0x0cfa('0x2c')]=qs[_0x0cfa('0x2c')](_0x207e6b[_0x0cfa('0x3b')][_0x0cfa('0x2c')]);_0x17cf31[_0x0cfa('0x43')]=qs[_0x0cfa('0x43')](_0x207e6b['query'][_0x0cfa('0x43')]);}_0x17cf31[_0x0cfa('0x44')]=qs[_0x0cfa('0x45')](_0x207e6b[_0x0cfa('0x3b')]['sort']);_0x17cf31['where']=qs[_0x0cfa('0x3d')](_[_0x0cfa('0x46')](_0x207e6b['query'],_0x2f71d5[_0x0cfa('0x3d')]),_0x5c3ff8);if(_0x207e6b['query'][_0x0cfa('0x47')]){_0x17cf31[_0x0cfa('0x48')]=_[_0x0cfa('0x49')](_0x17cf31[_0x0cfa('0x48')],{'$or':_[_0x0cfa('0x3a')](_0x5c3ff8,function(_0x3fb0e8){if(_0x3fb0e8[_0x0cfa('0x38')]!==_0x0cfa('0x4a')){var _0x1b21b7={};_0x1b21b7[_0x3fb0e8[_0x0cfa('0x34')]]={'$like':'%'+_0x207e6b[_0x0cfa('0x3b')]['filter']+'%'};return _0x1b21b7;}})});}_0x17cf31=_[_0x0cfa('0x49')]({},_0x17cf31,_0x207e6b['options']);var _0x4aa6dc={'where':_0x17cf31[_0x0cfa('0x48')]};return db[_0x0cfa('0x36')][_0x0cfa('0x2b')](_0x4aa6dc)[_0x0cfa('0x31')](function(_0x3404f7){_0x37c3a6['count']=_0x3404f7;if(_0x207e6b[_0x0cfa('0x3b')][_0x0cfa('0x4b')]){_0x17cf31[_0x0cfa('0x4c')]=[{'all':!![]}];}return db[_0x0cfa('0x36')]['findAll'](_0x17cf31);})[_0x0cfa('0x31')](function(_0x47d3d7){_0x37c3a6[_0x0cfa('0x4d')]=_0x47d3d7;return _0x37c3a6;})['then'](respondWithFilteredResult(_0x10a4a,_0x17cf31))[_0x0cfa('0x4e')](handleError(_0x10a4a,null));};exports[_0x0cfa('0x4f')]=function(_0x340824,_0x5a2485){var _0x357a46={'raw':!![],'where':{'id':_0x340824[_0x0cfa('0x50')]['id']}},_0x65973={};_0x65973['model']=_[_0x0cfa('0x3c')](db['FaxMessage'][_0x0cfa('0x51')]);_0x65973[_0x0cfa('0x3b')]=_[_0x0cfa('0x3c')](_0x340824[_0x0cfa('0x3b')]);_0x65973[_0x0cfa('0x3d')]=_['intersection'](_0x65973['model'],_0x65973['query']);_0x357a46[_0x0cfa('0x3f')]=_[_0x0cfa('0x3e')](_0x65973['model'],qs[_0x0cfa('0x40')](_0x340824[_0x0cfa('0x3b')][_0x0cfa('0x40')]));_0x357a46['attributes']=_0x357a46[_0x0cfa('0x3f')][_0x0cfa('0x41')]?_0x357a46[_0x0cfa('0x3f')]:_0x65973['model'];if(_0x340824['query']['includeAll']){_0x357a46[_0x0cfa('0x4c')]=[{'all':!![]}];}_0x357a46=_[_0x0cfa('0x49')]({},_0x357a46,_0x340824[_0x0cfa('0x52')]);return db[_0x0cfa('0x36')]['find'](_0x357a46)['then'](handleEntityNotFound(_0x5a2485,null))[_0x0cfa('0x31')](respondWithResult(_0x5a2485,null))[_0x0cfa('0x4e')](handleError(_0x5a2485,null));};exports[_0x0cfa('0x53')]=function(_0x3b9637,_0x3eddec){if(_0x3b9637[_0x0cfa('0x54')]['id']){delete _0x3b9637[_0x0cfa('0x54')]['id'];}return db[_0x0cfa('0x36')][_0x0cfa('0x55')]({'where':{'id':_0x3b9637[_0x0cfa('0x50')]['id']}})[_0x0cfa('0x31')](handleEntityNotFound(_0x3eddec,null))[_0x0cfa('0x31')](saveUpdates(_0x3b9637['body'],null))[_0x0cfa('0x31')](respondWithResult(_0x3eddec,null))['catch'](handleError(_0x3eddec,null));};exports[_0x0cfa('0x32')]=function(_0x13291e,_0x3d3879){return db[_0x0cfa('0x36')]['find']({'where':{'id':_0x13291e[_0x0cfa('0x50')]['id']}})[_0x0cfa('0x31')](handleEntityNotFound(_0x3d3879,null))[_0x0cfa('0x31')](removeEntity(_0x3d3879,null))['catch'](handleError(_0x3d3879,null));};exports['describe']=function(_0x15378c,_0x47a487){return db['FaxMessage'][_0x0cfa('0x56')]()[_0x0cfa('0x31')](respondWithResult(_0x47a487,null))[_0x0cfa('0x4e')](handleError(_0x47a487,null));};var interaction_log=require(_0x0cfa('0x57'))(_0x0cfa('0x58'));exports[_0x0cfa('0x59')]=function(_0x4a9b39,_0x19284b,_0x5c0169){var _0x1ba423={'agent':{},'channel':_0x0cfa('0x5a')};if(_0x4a9b39[_0x0cfa('0x54')]['id']){delete _0x4a9b39[_0x0cfa('0x54')]['id'];}_0x4a9b39[_0x0cfa('0x54')][_0x0cfa('0x5b')]=!![];_0x4a9b39[_0x0cfa('0x54')]['readAt']=moment()[_0x0cfa('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a9b39['body'][_0x0cfa('0x5d')]=_0x4a9b39[_0x0cfa('0x54')][_0x0cfa('0x5d')]||_0x4a9b39[_0x0cfa('0x5e')]['id'];_0x1ba423[_0x0cfa('0x5f')]['id']=_0x4a9b39[_0x0cfa('0x54')][_0x0cfa('0x5d')];return db[_0x0cfa('0x36')][_0x0cfa('0x55')]({'where':{'id':_0x4a9b39[_0x0cfa('0x50')]['id'],'UserId':null}})[_0x0cfa('0x31')](handleEntityNotFound(_0x19284b,null))['then'](saveUpdates(_0x4a9b39[_0x0cfa('0x54')],null))['then'](function(_0x266392){if(_0x266392){_0x1ba423[_0x0cfa('0x24')]=_0x266392['get']({'plain':!![]});return db[_0x0cfa('0x60')][_0x0cfa('0x55')]({'where':{'id':_0x266392['FaxInteractionId']}});}return null;})[_0x0cfa('0x31')](handleEntityNotFound(_0x19284b,null))['then'](function(_0x5f4fb5){if(_0x5f4fb5){return _0x5f4fb5[_0x0cfa('0x53')]({'UserId':_0x4a9b39[_0x0cfa('0x54')][_0x0cfa('0x5d')],'read1stAt':_['isNil'](_0x5f4fb5['read1stAt'])?moment()['format'](_0x0cfa('0x61')):undefined});}return null;})[_0x0cfa('0x31')](function(_0x299f73){if(_0x299f73){_0x1ba423['interaction']=_0x299f73[_0x0cfa('0x62')]({'plain':!![]});interaction_log['info'](_0x0cfa('0x63'),_0x4a9b39['user']['id'],_0x4a9b39[_0x0cfa('0x5e')][_0x0cfa('0x34')],_0x4a9b39['user'][_0x0cfa('0x64')],_0x1ba423[_0x0cfa('0x65')]['id'],_0x4a9b39[_0x0cfa('0x54')]?JSON[_0x0cfa('0x66')](_0x4a9b39['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x0cfa('0x67'),_0x1ba423);}return null;})[_0x0cfa('0x31')](function(_0x38eb3f){var _0x737ccc=_0x0cfa('0x68')+_0x38eb3f['message'][_0x0cfa('0x69')];return db[_0x0cfa('0x6a')][_0x0cfa('0x3b')](_0x737ccc,{'type':db[_0x0cfa('0x6b')]['QueryTypes'][_0x0cfa('0x6c')],'raw':!![]})[_0x0cfa('0x31')](function(_0x40b326){return _0x40b326;});})['then'](function(_0x23d867){if(_0x23d867){_0x1ba423['message'][_0x0cfa('0x6d')]=_0x23d867[0x0];if(!_0x4a9b39['body'][_0x0cfa('0x5d')])return;return db[_0x0cfa('0x6e')]['find']({'where':{'id':_0x4a9b39['body'][_0x0cfa('0x5d')],'role':_0x0cfa('0x5f')},'attributes':['id',_0x0cfa('0x34'),_0x0cfa('0x6f'),_0x0cfa('0x70'),_0x0cfa('0x71')],'raw':!![]});}return null;})[_0x0cfa('0x31')](function(_0x4b1da9){if(!_0x4b1da9)return null;_0x1ba423['message']['agent']=_0x4b1da9;return _0x1ba423;})[_0x0cfa('0x31')](function(_0x1f0d71){if(_0x1f0d71){if(_0x4a9b39['body'][_0x0cfa('0x72')]){_0x1ba423[_0x0cfa('0x24')][_0x0cfa('0x73')]=util[_0x0cfa('0x5c')](_0x0cfa('0x74'),_0x4a9b39['user'][_0x0cfa('0x34')]);_0x1ba423[_0x0cfa('0x24')]['channel']=_0x1ba423[_0x0cfa('0x75')];_0x1ba423[_0x0cfa('0x24')][_0x0cfa('0x76')]=_0x1ba423[_0x0cfa('0x75')];_0x1ba423['message'][_0x0cfa('0x77')]=_0x0cfa('0x59');return respondWithRpcPromise(_0x0cfa('0x78'),_0x0cfa('0x78'),{'event':_0x0cfa('0x79'),'message':_0x1ba423[_0x0cfa('0x24')]},client9002)['then'](function(){return _0x1ba423;});}return _0x1ba423;}return null;})[_0x0cfa('0x31')](respondWithResult(_0x19284b,null))[_0x0cfa('0x4e')](handleError(_0x19284b,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x0cfa('0x30')]=function(_0x573bc0,_0x115073,_0x5c9e9b){var _0x598825={'agent':{},'channel':_0x0cfa('0x5a')};if(_0x573bc0['body']['id']){delete _0x573bc0[_0x0cfa('0x54')]['id'];}_0x573bc0['body'][_0x0cfa('0x5d')]=_0x573bc0[_0x0cfa('0x54')][_0x0cfa('0x5d')]||_0x573bc0[_0x0cfa('0x5e')]['id'];_0x598825[_0x0cfa('0x5f')]['id']=_0x573bc0[_0x0cfa('0x54')][_0x0cfa('0x5d')];return db['FaxMessage'][_0x0cfa('0x55')]({'where':{'id':_0x573bc0['params']['id'],'UserId':null}})[_0x0cfa('0x31')](handleEntityNotFound(_0x115073,null))[_0x0cfa('0x31')](function(_0x27aaf0){if(_0x27aaf0){_0x598825[_0x0cfa('0x24')]=_0x27aaf0[_0x0cfa('0x62')]({'plain':!![]});return db[_0x0cfa('0x60')][_0x0cfa('0x55')]({'where':{'id':_0x27aaf0[_0x0cfa('0x7a')]}});}return null;})[_0x0cfa('0x31')](handleEntityNotFound(_0x115073,null))['then'](function(_0x3026c5){if(_0x3026c5){_0x598825[_0x0cfa('0x65')]=_0x3026c5[_0x0cfa('0x62')]({'plain':!![]});interaction_log['info'](_0x0cfa('0x7b'),_0x573bc0[_0x0cfa('0x5e')]['id'],_0x573bc0['user'][_0x0cfa('0x34')],_0x573bc0['user']['role'],_0x598825[_0x0cfa('0x65')]['id'],_0x573bc0['body']?JSON[_0x0cfa('0x66')](_0x573bc0['body']):_0x0cfa('0x7c'));return respondWithRpcPromise(_0x0cfa('0x7d'),'rejectMessage',_0x598825);}return null;})[_0x0cfa('0x31')](function(_0x74df3c){var _0x595ba4=_0x0cfa('0x68')+_0x74df3c[_0x0cfa('0x24')][_0x0cfa('0x69')];return db[_0x0cfa('0x6a')][_0x0cfa('0x3b')](_0x595ba4,{'type':db[_0x0cfa('0x6b')]['QueryTypes'][_0x0cfa('0x6c')],'raw':!![]})['then'](function(_0x2cdf83){return _0x2cdf83;});})[_0x0cfa('0x31')](function(_0x7ad353){if(_0x7ad353){_0x598825['message'][_0x0cfa('0x6d')]=_0x7ad353[0x0];if(!_0x573bc0[_0x0cfa('0x54')][_0x0cfa('0x5d')])return;return db[_0x0cfa('0x6e')]['find']({'where':{'id':_0x573bc0[_0x0cfa('0x54')]['UserId'],'role':_0x0cfa('0x5f')},'attributes':['id',_0x0cfa('0x34'),_0x0cfa('0x6f'),_0x0cfa('0x70'),_0x0cfa('0x71')],'raw':!![]});}return null;})['then'](function(_0x2d530e){if(!_0x2d530e)return null;_0x598825[_0x0cfa('0x24')][_0x0cfa('0x5f')]=_0x2d530e;return _0x598825;})[_0x0cfa('0x31')](function(_0x5b5ef0){if(_0x5b5ef0){_0x5b5ef0['message'][_0x0cfa('0x73')]=util[_0x0cfa('0x5c')](_0x0cfa('0x74'),_0x573bc0[_0x0cfa('0x5e')][_0x0cfa('0x34')]);_0x5b5ef0['message'][_0x0cfa('0x75')]=_0x598825['channel'];_0x5b5ef0[_0x0cfa('0x24')]['motionChannel']=_0x598825[_0x0cfa('0x75')];_0x5b5ef0[_0x0cfa('0x24')][_0x0cfa('0x77')]=_0x0cfa('0x30');respondWithRpcPromise(_0x0cfa('0x78'),'EventManager',{'event':_0x0cfa('0x7e'),'message':_0x5b5ef0[_0x0cfa('0x24')]},client9002);return _0x598825;}return null;})['then'](respondWithResult(_0x115073,null))[_0x0cfa('0x4e')](handleError(_0x115073,null));};exports[_0x0cfa('0x7f')]=function(_0x3a8ab4,_0xe5df9a){var _0x3dd338;return db[_0x0cfa('0x36')]['create'](_0x3a8ab4[_0x0cfa('0x54')],{})[_0x0cfa('0x31')](function(_0x354fef){_0x3dd338=_0x354fef;return db[_0x0cfa('0x80')][_0x0cfa('0x81')]({'where':{'id':_0x3dd338[_0x0cfa('0x69')]}});})[_0x0cfa('0x31')](function(_0x83f2bf){if(_[_0x0cfa('0x82')](_0x83f2bf)){return;}else{_0x3dd338[_0x0cfa('0x5a')]=_0x83f2bf[_0x0cfa('0x5a')];return db['Attachment'][_0x0cfa('0x81')]({'where':{'id':_0x3dd338[_0x0cfa('0x83')]}});}})[_0x0cfa('0x31')](function(_0x4c381e){return respondWithRpcPromise(_0x0cfa('0x84'),_0x0cfa('0x84'),{'FaxAccountId':_[_0x0cfa('0x82')](_0x3a8ab4[_0x0cfa('0x54')])?undefined:_0x3a8ab4['body'][_0x0cfa('0x85')],'path':_[_0x0cfa('0x82')](_0x4c381e)?undefined:util[_0x0cfa('0x5c')](_0x0cfa('0x86'),_0x4c381e['basename']),'fax':_[_0x0cfa('0x82')](_0x3dd338[_0x0cfa('0x5a')])?undefined:_0x3dd338[_0x0cfa('0x5a')],'AttachmentId':_0x3dd338[_0x0cfa('0x83')]},client9002);})['then'](respondWithResult(_0xe5df9a,0xc9))[_0x0cfa('0x4e')](handleError(_0xe5df9a,null));};exports['download']=function(_0x9f0592,_0x3a41f9){var _0x19d5bd=path['join'](config[_0x0cfa('0x87')],_0x0cfa('0x88'),_0x0cfa('0x89'),'attachments');return db[_0x0cfa('0x36')][_0x0cfa('0x55')]({'where':{'id':_0x9f0592['params']['id']},'include':[{'model':db[_0x0cfa('0x8a')],'as':_0x0cfa('0x8a')}]})[_0x0cfa('0x31')](handleEntityNotFound(_0x3a41f9,null))[_0x0cfa('0x31')](function(_0x1d792b){if(_0x1d792b){return _0x3a41f9[_0x0cfa('0x8b')](path['join'](_0x19d5bd,_0x1d792b[_0x0cfa('0x8a')][_0x0cfa('0x8c')]));}})['catch'](handleError(_0x3a41f9,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f0e081d..147cdb7 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 _0x8c8b=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x45f65d,_0x39eea2){var _0x4bb12c=function(_0x428fbd){while(--_0x428fbd){_0x45f65d['push'](_0x45f65d['shift']());}};_0x4bb12c(++_0x39eea2);}(_0x8c8b,0x106));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xb8c8('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xb8c8('0x1')](0x0);var events={'afterCreate':_0xb8c8('0x2'),'afterUpdate':_0xb8c8('0x3'),'afterDestroy':_0xb8c8('0x4')};function emitEvent(_0x4c0ddd){return function(_0x4c1ecc,_0x40094e,_0x1bc15d){FaxMessageEvents[_0xb8c8('0x5')](_0x4c0ddd+':'+_0x4c1ecc['id'],_0x4c1ecc);FaxMessageEvents[_0xb8c8('0x5')](_0x4c0ddd,_0x4c1ecc);_0x1bc15d(null);};}for(var e in events){if(events[_0xb8c8('0x6')](e)){var event=events[e];FaxMessage[_0xb8c8('0x7')](e,emitEvent(event));}}module[_0xb8c8('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x56b9=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x56b9,0x196));var _0x956b=function(_0x4fae69,_0x1d1d6b){_0x4fae69=_0x4fae69-0x0;var _0x3d2983=_0x56b9[_0x4fae69];return _0x3d2983;};'use strict';var EventEmitter=require(_0x956b('0x0'));var FaxMessage=require(_0x956b('0x1'))['db'][_0x956b('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x956b('0x3')](0x0);var events={'afterCreate':_0x956b('0x4'),'afterUpdate':_0x956b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x34200b){return function(_0x5d60cd,_0x34051d,_0x1cb24a){FaxMessageEvents[_0x956b('0x6')](_0x34200b+':'+_0x5d60cd['id'],_0x5d60cd);FaxMessageEvents['emit'](_0x34200b,_0x5d60cd);_0x1cb24a(null);};}for(var e in events){if(events[_0x956b('0x7')](e)){var event=events[e];FaxMessage[_0x956b('0x8')](e,emitEvent(event));}}module[_0x956b('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 6f103a4..8f74bed 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 _0x7ae6=['bluebird','request-promise','../../config/environment','./faxMessage.attributes','exports','FaxMessage','body','FULLTEXT','models','direction','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3664a7,_0x3f51e6){var _0x3ed15f=function(_0x55c241){while(--_0x55c241){_0x3664a7['push'](_0x3664a7['shift']());}};_0x3ed15f(++_0x3f51e6);}(_0x7ae6,0x14f));var _0x67ae=function(_0xde9e35,_0x463a3e){_0xde9e35=_0xde9e35-0x0;var _0xa9fd21=_0x7ae6[_0xde9e35];return _0xa9fd21;};'use strict';var _=require(_0x67ae('0x0'));var util=require(_0x67ae('0x1'));var logger=require(_0x67ae('0x2'))('api');var moment=require('moment');var BPromise=require(_0x67ae('0x3'));var rp=require(_0x67ae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x67ae('0x5'));var attributes=require(_0x67ae('0x6'));module[_0x67ae('0x7')]=function(_0x1f2800,_0x829f50){return _0x1f2800['define'](_0x67ae('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x67ae('0x9')],'type':_0x67ae('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5930ca,_0x438f43,_0x3edf69){var _0x13491d=_0x1f2800[_0x67ae('0xb')];var _0x3077ac=_0x5930ca['get']({'plain':!![]});if(_0x3077ac[_0x67ae('0xc')]['toLowerCase']()==='in'||_0x3077ac['direction']['toLowerCase']()==='out'&&!_0x3077ac[_0x67ae('0xd')]&&!_[_0x67ae('0xe')](_0x3077ac['UserId'])){_0x13491d[_0x67ae('0xf')][_0x67ae('0x10')]({'where':{'id':_0x3077ac[_0x67ae('0x11')]}})[_0x67ae('0x12')](function(_0x1b7357){if(_0x1b7357){_0x1b7357[_0x67ae('0x13')]({'lastMsgAt':_0x3077ac[_0x67ae('0x14')],'lastMsgDirection':_0x3077ac['direction'][_0x67ae('0x15')]()});}})[_0x67ae('0x16')](function(_0xafddc7){console[_0x67ae('0x17')](_0xafddc7);});}_0x3edf69();}},'charset':_0x67ae('0x18'),'collate':_0x67ae('0x19')});}; \ No newline at end of file +var _0x589b=['toLowerCase','out','secret','isNil','findOne','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','../../config/environment','./faxMessage.attributes','define','FaxMessage','body','FULLTEXT','models','direction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x589b,0xc2));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb589('0x0'));var logger=require(_0xb589('0x1'))(_0xb589('0x2'));var moment=require(_0xb589('0x3'));var BPromise=require('bluebird');var rp=require(_0xb589('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb589('0x5'));var attributes=require(_0xb589('0x6'));module['exports']=function(_0x1d8afb,_0x5a3754){return _0x1d8afb[_0xb589('0x7')](_0xb589('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xb589('0x9')],'type':_0xb589('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f0125,_0x477f11,_0x4997f7){var _0x4d9770=_0x1d8afb[_0xb589('0xb')];var _0x347008=_0x2f0125['get']({'plain':!![]});if(_0x347008['direction']['toLowerCase']()==='in'||_0x347008[_0xb589('0xc')][_0xb589('0xd')]()===_0xb589('0xe')&&!_0x347008[_0xb589('0xf')]&&!_[_0xb589('0x10')](_0x347008['UserId'])){_0x4d9770['FaxInteraction'][_0xb589('0x11')]({'where':{'id':_0x347008['FaxInteractionId']}})['then'](function(_0x3f2627){if(_0x3f2627){_0x3f2627[_0xb589('0x12')]({'lastMsgAt':_0x347008[_0xb589('0x13')],'lastMsgDirection':_0x347008['direction'][_0xb589('0xd')]()});}})[_0xb589('0x14')](function(_0x31711d){console[_0xb589('0x15')](_0x31711d);});}_0x4997f7();}},'charset':'utf8mb4','collate':_0xb589('0x16')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 2acf824..57c41d9 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 _0xfd28=['message','info','catch','create','body','options','then','CreateFaxMessage','UpdateFaxMessage','FaxMessage','raw','where','attributes','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x12fa22,_0x58877a){var _0x408bba=function(_0x36c675){while(--_0x36c675){_0x12fa22['push'](_0x12fa22['shift']());}};_0x408bba(++_0x58877a);}(_0xfd28,0x148));var _0x8fd2=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0xfd28[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});config[_0x8fd2('0xa')]=_['defaults'](config['redis'],{'host':_0x8fd2('0xb'),'port':0x18eb});var socket=require(_0x8fd2('0xc'))(new Redis(config[_0x8fd2('0xa')]));require('./faxMessage.socket')[_0x8fd2('0xd')](socket);function respondWithRpcPromise(_0x49ca87,_0x2842f3,_0x5aabf0){return new BPromise(function(_0x34ae5c,_0x4fdf0b){return client[_0x8fd2('0xe')](_0x49ca87,_0x5aabf0)['then'](function(_0x1b6558){logger['info'](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));logger[_0x8fd2('0x11')](_0x8fd2('0x12'),_0x2842f3,_0x8fd2('0x10'),JSON[_0x8fd2('0x13')](_0x1b6558));if(_0x1b6558[_0x8fd2('0x14')]){if(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x15')]===0x1f4){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);return _0x4fdf0b(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);}logger['error'](_0x8fd2('0xf'),_0x2842f3,_0x1b6558['error']['message']);return _0x34ae5c(_0x1b6558['error'][_0x8fd2('0x16')]);}else{logger[_0x8fd2('0x17')](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));_0x34ae5c(_0x1b6558['result'][_0x8fd2('0x16')]);}})[_0x8fd2('0x18')](function(_0x411943){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x411943);_0x4fdf0b(_0x411943);});});}exports['CreateFaxMessage']=function(_0x48ad51){var _0x3a0939=this;return new Promise(function(_0x4a2002,_0x3c03de){return db['FaxMessage'][_0x8fd2('0x19')](_0x48ad51[_0x8fd2('0x1a')],{'raw':_0x48ad51['options']?_0x48ad51[_0x8fd2('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8fd2('0x1c')](function(_0x44ee7a){logger['info'](_0x8fd2('0x1d'),_0x48ad51);logger[_0x8fd2('0x11')](_0x8fd2('0x1d'),_0x48ad51,JSON['stringify'](_0x44ee7a));_0x4a2002(_0x44ee7a);})[_0x8fd2('0x18')](function(_0x3b9e2f){logger[_0x8fd2('0x14')](_0x8fd2('0x1d'),_0x3b9e2f[_0x8fd2('0x16')],_0x48ad51);_0x3c03de(_0x3a0939[_0x8fd2('0x14')](0x1f4,_0x3b9e2f[_0x8fd2('0x16')]));});});};exports[_0x8fd2('0x1e')]=function(_0x1456b4){var _0xbc5945=this;return new Promise(function(_0x3392fb,_0x1f3237){return db[_0x8fd2('0x1f')]['update'](_0x1456b4['body'],{'raw':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1456b4['options']?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x21')]||null:null,'attributes':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x22')]||null:null,'limit':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')]['limit']||null:null})[_0x8fd2('0x1c')](function(_0x13c9b9){logger[_0x8fd2('0x17')](_0x8fd2('0x1e'),_0x1456b4);logger[_0x8fd2('0x11')](_0x8fd2('0x1e'),_0x1456b4,JSON[_0x8fd2('0x13')](_0x13c9b9));_0x3392fb(_0x13c9b9);})['catch'](function(_0x5b992a){logger['error'](_0x8fd2('0x1e'),_0x5b992a[_0x8fd2('0x16')],_0x1456b4);_0x1f3237(_0xbc5945[_0x8fd2('0x14')](0x1f4,_0x5b992a[_0x8fd2('0x16')]));});});}; \ No newline at end of file +var _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x73cf31,_0x4310b1){var _0x35aea0=function(_0x5b7cd2){while(--_0x5b7cd2){_0x73cf31['push'](_0x73cf31['shift']());}};_0x35aea0(++_0x4310b1);}(_0xeec6,0x1c2));var _0x6eec=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xeec6[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 9a05937..2af7cfd 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 _0x0516=['emit','register','length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0516,0x84));var _0x6051=function(_0xfdf7a4,_0x37da46){_0xfdf7a4=_0xfdf7a4-0x0;var _0x59ec89=_0x0516[_0xfdf7a4];return _0x59ec89;};'use strict';var FaxMessageEvents=require(_0x6051('0x0'));var events=[_0x6051('0x1'),_0x6051('0x2'),_0x6051('0x3')];function createListener(_0x3af835,_0x1e7fc5){return function(_0x6b1e1f){_0x1e7fc5[_0x6051('0x4')](_0x3af835,_0x6b1e1f);};}function removeListener(_0x4c6082,_0x3a1587){return function(){FaxMessageEvents['removeListener'](_0x4c6082,_0x3a1587);};}exports[_0x6051('0x5')]=function(_0x38b6d3){for(var _0x12d176=0x0,_0x1f4f69=events[_0x6051('0x6')];_0x12d176<_0x1f4f69;_0x12d176++){var _0x1bf447=events[_0x12d176];var _0x23bf74=createListener(_0x6051('0x7')+_0x1bf447,_0x38b6d3);FaxMessageEvents['on'](_0x1bf447,_0x23bf74);}}; \ No newline at end of file +var _0x10a3=['./faxMessage.events','save','remove','update','emit','removeListener','register','length','faxMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10a3,0x117));var _0x310a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x10a3[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require(_0x310a('0x0'));var events=[_0x310a('0x1'),_0x310a('0x2'),_0x310a('0x3')];function createListener(_0x5ad56e,_0x41ac16){return function(_0xfa0064){_0x41ac16[_0x310a('0x4')](_0x5ad56e,_0xfa0064);};}function removeListener(_0x3935f9,_0x33560d){return function(){FaxMessageEvents[_0x310a('0x5')](_0x3935f9,_0x33560d);};}exports[_0x310a('0x6')]=function(_0x1cda1f){for(var _0x1bdce4=0x0,_0x4fb14b=events[_0x310a('0x7')];_0x1bdce4<_0x4fb14b;_0x1bdce4++){var _0x2958a3=events[_0x1bdce4];var _0x87b1fa=createListener(_0x310a('0x8')+_0x2958a3,_0x1cda1f);FaxMessageEvents['on'](_0x2958a3,_0x87b1fa);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e3be742..92a22c4 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 _0x2bc6=['reject','delete','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','download','post','tracked','fax','faxmessage:create','create','put','/:id/accept','accept','/:id/reject'];(function(_0x4dc8aa,_0x5ae49c){var _0x1d7eb7=function(_0x1544f1){while(--_0x1544f1){_0x4dc8aa['push'](_0x4dc8aa['shift']());}};_0x1d7eb7(++_0x5ae49c);}(_0x2bc6,0x163));var _0x62bc=function(_0x3d6fa2,_0x3dfe73){_0x3d6fa2=_0x3d6fa2-0x0;var _0x1b6bf7=_0x2bc6[_0x3d6fa2];return _0x1b6bf7;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x62bc('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x62bc('0x4'));var controller=require(_0x62bc('0x5'));router['get']('/',auth[_0x62bc('0x6')](),controller[_0x62bc('0x7')]);router[_0x62bc('0x8')](_0x62bc('0x9'),auth[_0x62bc('0x6')](),controller[_0x62bc('0xa')]);router['get'](_0x62bc('0xb'),auth[_0x62bc('0x6')](),controller[_0x62bc('0xc')]);router[_0x62bc('0x8')]('/:id/download',auth[_0x62bc('0x6')](),controller[_0x62bc('0xd')]);router[_0x62bc('0xe')]('/',auth['isAuthenticated'](),interaction[_0x62bc('0xf')](_0x62bc('0x10'),_0x62bc('0x11')),controller[_0x62bc('0x12')]);router[_0x62bc('0x13')](_0x62bc('0xb'),auth[_0x62bc('0x6')](),controller['update']);router[_0x62bc('0x13')](_0x62bc('0x14'),auth['isAuthenticated'](),controller[_0x62bc('0x15')]);router[_0x62bc('0x13')](_0x62bc('0x16'),auth['isAuthenticated'](),controller[_0x62bc('0x17')]);router[_0x62bc('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x62bc('0x19')]);module[_0x62bc('0x1a')]=router; \ No newline at end of file +var _0xee5b=['update','/:id/accept','accept','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id'];(function(_0x5978e,_0x706ac9){var _0x204c2d=function(_0x30f224){while(--_0x30f224){_0x5978e['push'](_0x5978e['shift']());}};_0x204c2d(++_0x706ac9);}(_0xee5b,0x1f4));var _0xbee5=function(_0x84afb2,_0x3d7566){_0x84afb2=_0x84afb2-0x0;var _0x6979aa=_0xee5b[_0x84afb2];return _0x6979aa;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0x7')](_0xbee5('0xb'),auth['isAuthenticated'](),controller[_0xbee5('0xc')]);router[_0xbee5('0xd')]('/',auth[_0xbee5('0x8')](),interaction[_0xbee5('0xe')](_0xbee5('0xf'),_0xbee5('0x10')),controller[_0xbee5('0x11')]);router[_0xbee5('0x12')](_0xbee5('0x13'),auth['isAuthenticated'](),controller[_0xbee5('0x14')]);router['put'](_0xbee5('0x15'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x16')]);router['put']('/:id/reject',auth[_0xbee5('0x8')](),controller['reject']);router[_0xbee5('0x17')]('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0x18')]);module[_0xbee5('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b7e2a4d..acf4ad9 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 _0xdc37=['sequelize','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0xa6df52,_0x1b8584){var _0x5edd57=function(_0x543f11){while(--_0x543f11){_0xa6df52['push'](_0xa6df52['shift']());}};_0x5edd57(++_0x1b8584);}(_0xdc37,0x181));var _0x7dc3=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xdc37[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require(_0x7dc3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7dc3('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7dc3('0x2')]},'timeout':{'type':Sequelize[_0x7dc3('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7dc3('0x4'),_0x7dc3('0x5'),_0x7dc3('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e15=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0x7e15,0x144));var _0x57e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e15[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x57e1('0x0'));module[_0x57e1('0x1')]={'name':{'type':Sequelize[_0x57e1('0x2')],'unique':_0x57e1('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x57e1('0x2')]},'timeout':{'type':Sequelize[_0x57e1('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x57e1('0x5')](_0x57e1('0x6'),_0x57e1('0x7'),_0x57e1('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x57e1('0x4')],'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 0ba7104..be68d94 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 _0xa7ab=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','stack','index','map','FaxQueue','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','get','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','emit','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','order','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xa7ab,0x119));var _0xba7a=function(_0x39bd39,_0x14a7bd){_0x39bd39=_0x39bd39-0x0;var _0x2dd94e=_0xa7ab[_0x39bd39];return _0x2dd94e;};'use strict';var emlformat=require(_0xba7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba7a('0x1'));var jsonpatch=require(_0xba7a('0x2'));var rp=require('request-promise');var moment=require(_0xba7a('0x3'));var BPromise=require(_0xba7a('0x4'));var Mustache=require(_0xba7a('0x5'));var util=require(_0xba7a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xba7a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba7a('0x8'));var _=require(_0xba7a('0x9'));var squel=require(_0xba7a('0xa'));var crypto=require(_0xba7a('0xb'));var jsforce=require(_0xba7a('0xc'));var deskjs=require(_0xba7a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba7a('0xe'));var Papa=require(_0xba7a('0xf'));var Redis=require('ioredis');var authService=require(_0xba7a('0x10'));var qs=require(_0xba7a('0x11'));var as=require(_0xba7a('0x12'));var hardwareService=require(_0xba7a('0x13'));var logger=require(_0xba7a('0x14'))(_0xba7a('0x15'));var utils=require(_0xba7a('0x16'));var config=require(_0xba7a('0x17'));var licenseUtil=require(_0xba7a('0x18'));var db=require(_0xba7a('0x19'))['db'];config[_0xba7a('0x1a')]=_[_0xba7a('0x1b')](config[_0xba7a('0x1a')],{'host':_0xba7a('0x1c'),'port':0x18eb});var socket=require(_0xba7a('0x1d'))(new Redis(config[_0xba7a('0x1a')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x25df0a,_0xf8519){_0xf8519=_0xf8519||0xcc;return function(_0x4b11c6){if(_0x4b11c6){return _0x25df0a[_0xba7a('0x1e')](_0xf8519);}return _0x25df0a[_0xba7a('0x1f')](_0xf8519)[_0xba7a('0x20')]();};}function respondWithResult(_0xbcede0,_0x2fef1e){_0x2fef1e=_0x2fef1e||0xc8;return function(_0x1d1c0b){if(_0x1d1c0b){return _0xbcede0[_0xba7a('0x1f')](_0x2fef1e)[_0xba7a('0x21')](_0x1d1c0b);}};}function respondWithFilteredResult(_0xa218fa,_0x34ce59){return function(_0x473718){if(_0x473718){var _0x5e58ae=typeof _0x34ce59[_0xba7a('0x22')]==='undefined'&&typeof _0x34ce59[_0xba7a('0x23')]===_0xba7a('0x24');var _0x4c309d=_0x473718['count'];var _0xb2db66=_0x5e58ae?0x0:_0x34ce59['offset'];var _0x2a7bb8=_0x5e58ae?_0x473718[_0xba7a('0x25')]:_0x34ce59[_0xba7a('0x22')]+_0x34ce59[_0xba7a('0x23')];var _0x23e661;if(_0x2a7bb8>=_0x4c309d){_0x2a7bb8=_0x4c309d;_0x23e661=0xc8;}else{_0x23e661=0xce;}_0xa218fa[_0xba7a('0x1f')](_0x23e661);return _0xa218fa[_0xba7a('0x26')]('Content-Range',_0xb2db66+'-'+_0x2a7bb8+'/'+_0x4c309d)[_0xba7a('0x21')](_0x473718);}return null;};}function patchUpdates(_0x39f238){return function(_0x164fee){try{jsonpatch[_0xba7a('0x27')](_0x164fee,_0x39f238,!![]);}catch(_0x111379){return BPromise[_0xba7a('0x28')](_0x111379);}return _0x164fee[_0xba7a('0x29')]();};}function saveUpdates(_0x56029b,_0x4c9b1b){return function(_0x27e4d5){if(_0x27e4d5){return _0x27e4d5[_0xba7a('0x2a')](_0x56029b)[_0xba7a('0x2b')](function(_0x45c176){return _0x45c176;});}return null;};}function removeEntity(_0x1ca794,_0x3acfe0){return function(_0x169898){if(_0x169898){return _0x169898[_0xba7a('0x2c')]()['then'](function(){var _0x241df9=_0x169898['get']({'plain':!![]});var _0x2ef07e=_0xba7a('0x2d');return db[_0xba7a('0x2e')][_0xba7a('0x2c')]({'where':{'type':_0x2ef07e,'resourceId':_0x241df9['id']}})[_0xba7a('0x2b')](function(){return _0x169898;});})['then'](function(){_0x1ca794[_0xba7a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac110,_0x495cea){return function(_0x4022fd){if(!_0x4022fd){_0x1ac110[_0xba7a('0x1e')](0x194);}return _0x4022fd;};}function handleError(_0xe94e1f,_0x1a0540){_0x1a0540=_0x1a0540||0x1f4;return function(_0x1256dd){logger['error'](_0x1256dd[_0xba7a('0x2f')]);if(_0x1256dd['name']){delete _0x1256dd['name'];}_0xe94e1f['status'](_0x1a0540)['send'](_0x1256dd);};}exports[_0xba7a('0x30')]=function(_0x2ad8f8,_0x5aa01b){var _0x1c31c8={},_0x4aa4ed={},_0x421f6d={'count':0x0,'rows':[]};var _0x573cbe=_[_0xba7a('0x31')](db[_0xba7a('0x32')]['rawAttributes'],function(_0x3e0622){return{'name':_0x3e0622[_0xba7a('0x33')],'type':_0x3e0622[_0xba7a('0x34')][_0xba7a('0x35')]};});_0x4aa4ed['model']=_[_0xba7a('0x31')](_0x573cbe,_0xba7a('0x36'));_0x4aa4ed[_0xba7a('0x37')]=_[_0xba7a('0x38')](_0x2ad8f8[_0xba7a('0x37')]);_0x4aa4ed[_0xba7a('0x39')]=_[_0xba7a('0x3a')](_0x4aa4ed[_0xba7a('0x3b')],_0x4aa4ed[_0xba7a('0x37')]);_0x1c31c8[_0xba7a('0x3c')]=_['intersection'](_0x4aa4ed[_0xba7a('0x3b')],qs[_0xba7a('0x3d')](_0x2ad8f8[_0xba7a('0x37')][_0xba7a('0x3d')]));_0x1c31c8[_0xba7a('0x3c')]=_0x1c31c8['attributes'][_0xba7a('0x3e')]?_0x1c31c8['attributes']:_0x4aa4ed[_0xba7a('0x3b')];if(!_0x2ad8f8['query'][_0xba7a('0x3f')](_0xba7a('0x40'))){_0x1c31c8['limit']=qs[_0xba7a('0x23')](_0x2ad8f8[_0xba7a('0x37')][_0xba7a('0x23')]);_0x1c31c8[_0xba7a('0x22')]=qs['offset'](_0x2ad8f8[_0xba7a('0x37')][_0xba7a('0x22')]);}_0x1c31c8['order']=qs['sort'](_0x2ad8f8[_0xba7a('0x37')][_0xba7a('0x41')]);_0x1c31c8['where']=qs[_0xba7a('0x39')](_[_0xba7a('0x42')](_0x2ad8f8[_0xba7a('0x37')],_0x4aa4ed[_0xba7a('0x39')]),_0x573cbe);if(_0x2ad8f8[_0xba7a('0x37')]['filter']){_0x1c31c8[_0xba7a('0x43')]=_[_0xba7a('0x44')](_0x1c31c8['where'],{'$or':_[_0xba7a('0x31')](_0x573cbe,function(_0x811f55){if(_0x811f55[_0xba7a('0x34')]!==_0xba7a('0x45')){var _0x3ed0be={};_0x3ed0be[_0x811f55[_0xba7a('0x36')]]={'$like':'%'+_0x2ad8f8['query'][_0xba7a('0x46')]+'%'};return _0x3ed0be;}})});}_0x1c31c8=_[_0xba7a('0x44')]({},_0x1c31c8,_0x2ad8f8[_0xba7a('0x47')]);var _0x5855de={'where':_0x1c31c8[_0xba7a('0x43')]};return db['FaxQueue'][_0xba7a('0x25')](_0x5855de)['then'](function(_0x4038e8){_0x421f6d['count']=_0x4038e8;if(_0x2ad8f8[_0xba7a('0x37')][_0xba7a('0x48')]){_0x1c31c8['include']=[{'all':!![]}];}return db[_0xba7a('0x32')][_0xba7a('0x49')](_0x1c31c8);})[_0xba7a('0x2b')](function(_0x46dbd1){_0x421f6d[_0xba7a('0x4a')]=_0x46dbd1;return _0x421f6d;})[_0xba7a('0x2b')](respondWithFilteredResult(_0x5aa01b,_0x1c31c8))[_0xba7a('0x4b')](handleError(_0x5aa01b,null));};exports[_0xba7a('0x4c')]=function(_0x5d077b,_0x52278e){var _0x16e903={'raw':!![],'where':{'id':_0x5d077b[_0xba7a('0x4d')]['id']}},_0x2928d6={};_0x2928d6[_0xba7a('0x3b')]=_[_0xba7a('0x38')](db['FaxQueue'][_0xba7a('0x4e')]);_0x2928d6['query']=_[_0xba7a('0x38')](_0x5d077b[_0xba7a('0x37')]);_0x2928d6[_0xba7a('0x39')]=_['intersection'](_0x2928d6[_0xba7a('0x3b')],_0x2928d6[_0xba7a('0x37')]);_0x16e903[_0xba7a('0x3c')]=_[_0xba7a('0x3a')](_0x2928d6['model'],qs[_0xba7a('0x3d')](_0x5d077b[_0xba7a('0x37')]['fields']));_0x16e903[_0xba7a('0x3c')]=_0x16e903['attributes'][_0xba7a('0x3e')]?_0x16e903[_0xba7a('0x3c')]:_0x2928d6[_0xba7a('0x3b')];if(_0x5d077b[_0xba7a('0x37')][_0xba7a('0x48')]){_0x16e903[_0xba7a('0x4f')]=[{'all':!![]}];}_0x16e903=_[_0xba7a('0x44')]({},_0x16e903,_0x5d077b['options']);return db[_0xba7a('0x32')][_0xba7a('0x50')](_0x16e903)[_0xba7a('0x2b')](handleEntityNotFound(_0x52278e,null))[_0xba7a('0x2b')](respondWithResult(_0x52278e,null))['catch'](handleError(_0x52278e,null));};exports[_0xba7a('0x51')]=function(_0xba5f01,_0x41d6e6){return db[_0xba7a('0x32')]['create'](_0xba5f01['body'],{})[_0xba7a('0x2b')](function(_0x3fb828){var _0x29e547=_0xba5f01[_0xba7a('0x52')]['get']({'plain':!![]});if(!_0x29e547)throw new Error(_0xba7a('0x53'));if(_0x29e547[_0xba7a('0x54')]===_0xba7a('0x52')){var _0x5d2329=_0x3fb828['get']({'plain':!![]});var _0x4313c7=_0xba7a('0x2d');return db[_0xba7a('0x55')]['find']({'where':{'name':_0x4313c7,'userProfileId':_0x29e547['userProfileId']},'raw':!![]})['then'](function(_0xd42dfd){if(_0xd42dfd&&_0xd42dfd[_0xba7a('0x56')]===0x0){return db[_0xba7a('0x2e')][_0xba7a('0x51')]({'name':_0x5d2329[_0xba7a('0x36')],'resourceId':_0x5d2329['id'],'type':_0xd42dfd[_0xba7a('0x36')],'sectionId':_0xd42dfd['id']},{})[_0xba7a('0x2b')](function(){return _0x3fb828;});}else{return _0x3fb828;}})[_0xba7a('0x4b')](function(_0x5e3fdf){logger['error'](_0xba7a('0x57'),_0x5e3fdf);throw _0x5e3fdf;});}return _0x3fb828;})['then'](respondWithResult(_0x41d6e6,0xc9))[_0xba7a('0x4b')](handleError(_0x41d6e6,null));};exports[_0xba7a('0x2a')]=function(_0x293de1,_0x428993){if(_0x293de1[_0xba7a('0x58')]['id']){delete _0x293de1[_0xba7a('0x58')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x293de1['params']['id']}})[_0xba7a('0x2b')](handleEntityNotFound(_0x428993,null))[_0xba7a('0x2b')](saveUpdates(_0x293de1['body'],null))[_0xba7a('0x2b')](respondWithResult(_0x428993,null))[_0xba7a('0x4b')](handleError(_0x428993,null));};exports[_0xba7a('0x2c')]=function(_0x4bc3c2,_0x11d140){return db['FaxQueue']['find']({'where':{'id':_0x4bc3c2[_0xba7a('0x4d')]['id']}})[_0xba7a('0x2b')](handleEntityNotFound(_0x11d140,null))[_0xba7a('0x2b')](removeEntity(_0x11d140,null))[_0xba7a('0x4b')](handleError(_0x11d140,null));};exports[_0xba7a('0x59')]=function(_0x48706c,_0x446cec){return db[_0xba7a('0x32')]['describe']()['then'](respondWithResult(_0x446cec,null))[_0xba7a('0x4b')](handleError(_0x446cec,null));};exports['getMembers']=function(_0x366679,_0x4a0e8d,_0x511f83){var _0x5894f7={'raw':!![],'where':{}},_0x133bd0={},_0x2ec5b3;return db[_0xba7a('0x32')][_0xba7a('0x5a')]({'where':{'id':_0x366679[_0xba7a('0x4d')]['id']}})[_0xba7a('0x2b')](handleEntityNotFound(_0x4a0e8d,null))[_0xba7a('0x2b')](function(_0x3c8c43){if(_0x3c8c43){_0x2ec5b3=_0x3c8c43[_0xba7a('0x5b')]({'plain':!![]});_0x133bd0['model']=_[_0xba7a('0x38')](db[_0xba7a('0x5c')][_0xba7a('0x4e')]);_0x133bd0[_0xba7a('0x37')]=_[_0xba7a('0x38')](_0x366679[_0xba7a('0x37')]);_0x133bd0[_0xba7a('0x39')]=_['intersection'](_0x133bd0[_0xba7a('0x3b')],_0x133bd0['query']);_0x5894f7[_0xba7a('0x3c')]=_['intersection'](_0x133bd0[_0xba7a('0x3b')],qs[_0xba7a('0x3d')](_0x366679['query'][_0xba7a('0x3d')]));_0x5894f7[_0xba7a('0x3c')]=_0x5894f7[_0xba7a('0x3c')][_0xba7a('0x3e')]?_0x5894f7[_0xba7a('0x3c')]:_0x133bd0[_0xba7a('0x3b')];if(!_0x366679['query'][_0xba7a('0x3f')](_0xba7a('0x40'))){_0x5894f7[_0xba7a('0x23')]=qs[_0xba7a('0x23')](_0x366679[_0xba7a('0x37')][_0xba7a('0x23')]);_0x5894f7[_0xba7a('0x22')]=qs['offset'](_0x366679['query'][_0xba7a('0x22')]);}_0x5894f7['order']=qs[_0xba7a('0x41')](_0x366679['query'][_0xba7a('0x41')]);_0x5894f7['where']=qs['filters'](_[_0xba7a('0x42')](_0x366679[_0xba7a('0x37')],_0x133bd0[_0xba7a('0x39')]));_0x5894f7['where'][_0xba7a('0x5d')]=_0x3c8c43['id'];if(_0x366679['query'][_0xba7a('0x46')]){_0x5894f7[_0xba7a('0x43')]=_[_0xba7a('0x44')](_0x5894f7['where'],{'$or':_[_0xba7a('0x31')](_0x5894f7[_0xba7a('0x3c')],function(_0x356091){var _0x5e6d6b={};_0x5e6d6b[_0x356091]={'$like':'%'+_0x366679[_0xba7a('0x37')][_0xba7a('0x46')]+'%'};return _0x5e6d6b;})});}_0x5894f7=_['merge']({},_0x5894f7,_0x366679[_0xba7a('0x47')]);return db[_0xba7a('0x5c')]['findAll'](_0x5894f7);}})['then'](function(_0x1252cb){if(_0x1252cb){return db[_0xba7a('0x5e')][_0xba7a('0x5f')]({'where':{'id':_['map'](_0x1252cb,_0xba7a('0x60')),'role':_0xba7a('0x61')},'attributes':['id','name',_0xba7a('0x62'),_0xba7a('0x63'),_0xba7a('0x64')]});}})[_0xba7a('0x2b')](function(_0x53b729){if(_0x53b729){return{'count':_0x53b729[_0xba7a('0x25')],'rows':_[_0xba7a('0x31')](_0x53b729[_0xba7a('0x4a')],function(_0x5cd0eb){return{'membername':_0x5cd0eb[_0xba7a('0x36')],'UserId':_0x5cd0eb['id'],'queue_name':_0x2ec5b3[_0xba7a('0x36')],'FaxQueueId':_0x2ec5b3['id'],'interface':util[_0xba7a('0x65')]('%s/%s','SIP',_0x5cd0eb[_0xba7a('0x36')]),'penalty':0x0,'paused':_0x5cd0eb[_0xba7a('0x62')],'createdAt':_0x5cd0eb[_0xba7a('0x64')],'updatedAt':_0x5cd0eb[_0xba7a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a0e8d,_0x5894f7))['catch'](handleError(_0x4a0e8d,null));};exports[_0xba7a('0x66')]=function(_0x556a53,_0x15f6c9,_0x332728){var _0x430f15={};var _0xf5700c={};var _0x228c79;var _0x5d2d51;return db[_0xba7a('0x32')][_0xba7a('0x5a')]({'where':{'id':_0x556a53[_0xba7a('0x4d')]['id']}})[_0xba7a('0x2b')](handleEntityNotFound(_0x15f6c9,null))[_0xba7a('0x2b')](function(_0x3f19a8){if(_0x3f19a8){_0x228c79=_0x3f19a8;_0xf5700c[_0xba7a('0x3b')]=_[_0xba7a('0x38')](db[_0xba7a('0x67')]['rawAttributes']);_0xf5700c[_0xba7a('0x37')]=_[_0xba7a('0x38')](_0x556a53[_0xba7a('0x37')]);_0xf5700c[_0xba7a('0x39')]=_[_0xba7a('0x3a')](_0xf5700c[_0xba7a('0x3b')],_0xf5700c['query']);_0x430f15[_0xba7a('0x3c')]=_[_0xba7a('0x3a')](_0xf5700c[_0xba7a('0x3b')],qs[_0xba7a('0x3d')](_0x556a53['query'][_0xba7a('0x3d')]));_0x430f15[_0xba7a('0x3c')]=_0x430f15['attributes'][_0xba7a('0x3e')]?_0x430f15[_0xba7a('0x3c')]:_0xf5700c['model'];_0x430f15['order']=qs[_0xba7a('0x41')](_0x556a53['query'][_0xba7a('0x41')]);_0x430f15[_0xba7a('0x43')]=qs[_0xba7a('0x39')](_[_0xba7a('0x42')](_0x556a53[_0xba7a('0x37')],_0xf5700c[_0xba7a('0x39')]));if(_0x556a53[_0xba7a('0x37')][_0xba7a('0x46')]){_0x430f15[_0xba7a('0x43')]=_['merge'](_0x430f15['where'],{'$or':_[_0xba7a('0x31')](_0x430f15[_0xba7a('0x3c')],function(_0x4f6555){var _0x1d6e24={};_0x1d6e24[_0x4f6555]={'$like':'%'+_0x556a53[_0xba7a('0x37')]['filter']+'%'};return _0x1d6e24;})});}_0x430f15=_[_0xba7a('0x44')]({},_0x430f15,_0x556a53[_0xba7a('0x47')]);return _0x228c79[_0xba7a('0x66')](_0x430f15);}})[_0xba7a('0x2b')](function(_0x2da29a){if(_0x2da29a){_0x5d2d51=_0x2da29a[_0xba7a('0x3e')];if(!_0x556a53[_0xba7a('0x37')][_0xba7a('0x3f')](_0xba7a('0x40'))){_0x430f15[_0xba7a('0x23')]=qs[_0xba7a('0x23')](_0x556a53[_0xba7a('0x37')][_0xba7a('0x23')]);_0x430f15['offset']=qs[_0xba7a('0x22')](_0x556a53['query']['offset']);}return _0x228c79['getTeams'](_0x430f15);}})[_0xba7a('0x2b')](function(_0x398f2c){if(_0x398f2c){return _0x398f2c?{'count':_0x5d2d51,'rows':_0x398f2c}:null;}})[_0xba7a('0x2b')](respondWithResult(_0x15f6c9,null))[_0xba7a('0x4b')](handleError(_0x15f6c9,null));};exports[_0xba7a('0x68')]=function(_0x52938b,_0x4aa064,_0x33ddd1){var _0xf91d1f=_0x52938b[_0xba7a('0x58')][_0xba7a('0x69')];return db['Team']['findAll']({'where':{'id':_0xf91d1f},'attributes':['id'],'include':[{'model':db[_0xba7a('0x5e')],'as':_0xba7a('0x6a'),'attributes':['id',_0xba7a('0x36'),'online','voicePause',_0xba7a('0x6b')],'raw':!![]}]})[_0xba7a('0x2b')](function(_0x3cedc5){if(_0x3cedc5){var _0x346c95=_['flatMap'](_0x3cedc5,function(_0x593830){var _0x5cdf27=_0x593830['get']({'plain':!![]});return _0x5cdf27[_0xba7a('0x6a')];});return db['FaxQueue'][_0xba7a('0x50')]({'where':{'id':_0x52938b['params']['id']}})[_0xba7a('0x2b')](function(_0x545205){return db[_0xba7a('0x6c')][_0xba7a('0x6d')](function(_0x3fff70){return _0x545205[_0xba7a('0x68')](_0xf91d1f,{'transaction':_0x3fff70})[_0xba7a('0x2b')](function(){return BPromise[_0xba7a('0x6e')](_0x346c95,function(_0x25222b){return db[_0xba7a('0x5c')][_0xba7a('0x6f')]({'where':{'UserId':_0x25222b['id'],'FaxQueueId':_0x52938b[_0xba7a('0x4d')]['id']},'transaction':_0x3fff70});});})[_0xba7a('0x2b')](function(){_0x346c95[_0xba7a('0x70')](function(_0x3f87cc){socket['emit'](_0xba7a('0x71'),{'UserId':_0x3f87cc['id'],'FaxQueueId':_0x545205['id']});});});});});}})[_0xba7a('0x2b')](respondWithStatusCode(_0x4aa064,null))['catch'](handleError(_0x4aa064,null));};exports[_0xba7a('0x72')]=function(_0x259148,_0x2fd405,_0x17a8e4){return db[_0xba7a('0x67')][_0xba7a('0x49')]({'where':{'id':_0x259148[_0xba7a('0x37')][_0xba7a('0x69')]},'attributes':['id'],'include':[{'model':db[_0xba7a('0x5e')],'as':_0xba7a('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xba7a('0x2b')](handleEntityNotFound(_0x2fd405,null))[_0xba7a('0x2b')](function(_0x5ccaf7){var _0x129cf4=_['map'](_0x5ccaf7,'id');var _0x178159=[];var _0x18e151=[];var _0x284ea5=squel[_0xba7a('0x73')]();_0x284ea5[_0xba7a('0x74')](_0xba7a('0x75'))[_0xba7a('0x76')](_0xba7a('0x77'),'tq')[_0xba7a('0x78')](_0xba7a('0x79'),'ut',_0xba7a('0x7a'))[_0xba7a('0x43')](_0xba7a('0x7b'),_0x259148[_0xba7a('0x4d')]['id']);for(var _0x292b18=0x0;_0x292b18<_0x5ccaf7['length'];_0x292b18+=0x1){let _0x549460=_0x5ccaf7[_0x292b18];for(var _0x122499=0x0;_0x122499<_0x549460[_0xba7a('0x6a')][_0xba7a('0x3e')];_0x122499+=0x1){let _0x3632c9=_0x549460[_0xba7a('0x6a')][_0x122499];var _0x45d79a=_0x284ea5[_0xba7a('0x7c')]();_0x45d79a[_0xba7a('0x43')](_0xba7a('0x7d'),_0x3632c9['id']);_0x18e151['push'](db[_0xba7a('0x6c')][_0xba7a('0x37')](_0x45d79a[_0xba7a('0x7e')](),{'type':db[_0xba7a('0x6c')][_0xba7a('0x7f')][_0xba7a('0x80')]})['then'](function(_0x553809){if(_0x553809[_0xba7a('0x3e')]===0x1){return _0x3632c9['id'];}else{var _0x3fe6c2=_[_0xba7a('0x81')](_[_0xba7a('0x31')](_0x553809,'TeamId'),function(_0x35a160){return _[_0xba7a('0x82')](_0x129cf4,_0x35a160);});if(_0x3fe6c2){return _0x3632c9['id'];}}}));}}return BPromise['all'](_0x18e151)[_0xba7a('0x2b')](function(_0x2353cc){_0x178159=_(_0x178159)[_0xba7a('0x83')](_0x2353cc)[_0xba7a('0x84')]()[_0xba7a('0x85')]();return db[_0xba7a('0x32')][_0xba7a('0x50')]({'where':{'id':_0x259148[_0xba7a('0x4d')]['id']}})[_0xba7a('0x2b')](function(_0x5c8edf){return db['sequelize'][_0xba7a('0x6d')](function(_0x5cfdbc){return _0x5c8edf['removeTeams'](_0x259148[_0xba7a('0x37')][_0xba7a('0x69')],{'transaction':_0x5cfdbc})[_0xba7a('0x2b')](function(){if(!_[_0xba7a('0x86')](_0x178159)){return _0x5c8edf['removeAgents'](_0x178159,{'transaction':_0x5cfdbc});}})[_0xba7a('0x2b')](function(){_0x178159[_0xba7a('0x70')](function(_0x315deb){socket[_0xba7a('0x87')](_0xba7a('0x88'),{'UserId':_0x315deb,'FaxQueueId':_0x5c8edf['id']});});});});});});})['then'](respondWithStatusCode(_0x2fd405,null))[_0xba7a('0x4b')](handleError(_0x2fd405,null));};exports[_0xba7a('0x89')]=function(_0x1d4409,_0x19a48c,_0x358cda){return db[_0xba7a('0x32')]['find']({'where':{'id':_0x1d4409[_0xba7a('0x4d')]['id']}})[_0xba7a('0x2b')](handleEntityNotFound(_0x19a48c,null))[_0xba7a('0x2b')](function(_0x5a1388){if(_0x5a1388){return _0x5a1388[_0xba7a('0x89')](_0x1d4409['body'][_0xba7a('0x69')],_[_0xba7a('0x8a')](_0x1d4409[_0xba7a('0x58')],['ids','id'])||{})[_0xba7a('0x8b')](function(_0x244501){for(var _0x56f810=0x0;_0x56f810<_0x1d4409[_0xba7a('0x58')]['ids'][_0xba7a('0x3e')];_0x56f810+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x1d4409[_0xba7a('0x58')][_0xba7a('0x69')][_0x56f810]),'FaxQueueId':Number(_0x1d4409[_0xba7a('0x4d')]['id'])});}return _0x244501;});}})[_0xba7a('0x2b')](respondWithResult(_0x19a48c,null))[_0xba7a('0x4b')](handleError(_0x19a48c,null));};exports[_0xba7a('0x8c')]=function(_0x1e2637,_0x21a980,_0x2da96a){return db[_0xba7a('0x32')][_0xba7a('0x50')]({'where':{'id':_0x1e2637[_0xba7a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x21a980,null))[_0xba7a('0x2b')](function(_0x3c1d1e){if(_0x3c1d1e){return _0x3c1d1e['removeAgents'](_0x1e2637['query'][_0xba7a('0x69')])['then'](function(){if(_[_0xba7a('0x8d')](_0x1e2637[_0xba7a('0x37')][_0xba7a('0x69')])){for(var _0x51c886=0x0;_0x51c886<_0x1e2637[_0xba7a('0x37')][_0xba7a('0x69')][_0xba7a('0x3e')];_0x51c886+=0x1){socket[_0xba7a('0x87')]('userFaxQueue:remove',{'UserId':Number(_0x1e2637[_0xba7a('0x37')][_0xba7a('0x69')][_0x51c886]),'FaxQueueId':Number(_0x1e2637['params']['id'])});}}else{socket[_0xba7a('0x87')](_0xba7a('0x88'),{'UserId':Number(_0x1e2637[_0xba7a('0x37')][_0xba7a('0x69')]),'FaxQueueId':Number(_0x1e2637['params']['id'])});}});}})[_0xba7a('0x2b')](respondWithStatusCode(_0x21a980,null))['catch'](handleError(_0x21a980,null));};exports[_0xba7a('0x8e')]=function(_0x18877f,_0x164520,_0x4f82c1){var _0x3facb0={};var _0x5891f6={};var _0x2f5dfe;var _0x7967bc;return db[_0xba7a('0x32')][_0xba7a('0x5a')]({'where':{'id':_0x18877f[_0xba7a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x164520,null))[_0xba7a('0x2b')](function(_0x395b31){if(_0x395b31){_0x2f5dfe=_0x395b31;_0x5891f6[_0xba7a('0x3b')]=_['keys'](db['User'][_0xba7a('0x4e')]);_0x5891f6['query']=_[_0xba7a('0x38')](_0x18877f[_0xba7a('0x37')]);_0x5891f6[_0xba7a('0x39')]=_[_0xba7a('0x3a')](_0x5891f6[_0xba7a('0x3b')],_0x5891f6[_0xba7a('0x37')]);_0x3facb0[_0xba7a('0x3c')]=_['intersection'](_0x5891f6['model'],qs[_0xba7a('0x3d')](_0x18877f[_0xba7a('0x37')]['fields']));_0x3facb0[_0xba7a('0x3c')]=_0x3facb0[_0xba7a('0x3c')]['length']?_0x3facb0[_0xba7a('0x3c')]:_0x5891f6['model'];_0x3facb0[_0xba7a('0x8f')]=qs[_0xba7a('0x41')](_0x18877f[_0xba7a('0x37')][_0xba7a('0x41')]);_0x3facb0[_0xba7a('0x43')]=qs[_0xba7a('0x39')](_[_0xba7a('0x42')](_0x18877f[_0xba7a('0x37')],_0x5891f6[_0xba7a('0x39')]));if(_0x18877f['query'][_0xba7a('0x46')]){_0x3facb0['where']=_['merge'](_0x3facb0[_0xba7a('0x43')],{'$or':_['map'](_0x3facb0[_0xba7a('0x3c')],function(_0x3ac2ed){var _0x37c3d7={};_0x37c3d7[_0x3ac2ed]={'$like':'%'+_0x18877f[_0xba7a('0x37')][_0xba7a('0x46')]+'%'};return _0x37c3d7;})});}_0x3facb0=_['merge']({},_0x3facb0,_0x18877f['options']);return _0x2f5dfe['getAgents'](_0x3facb0);}})[_0xba7a('0x2b')](function(_0x3b3407){if(_0x3b3407){_0x7967bc=_0x3b3407[_0xba7a('0x3e')];if(!_0x18877f[_0xba7a('0x37')][_0xba7a('0x3f')](_0xba7a('0x40'))){_0x3facb0[_0xba7a('0x23')]=qs[_0xba7a('0x23')](_0x18877f[_0xba7a('0x37')][_0xba7a('0x23')]);_0x3facb0[_0xba7a('0x22')]=qs[_0xba7a('0x22')](_0x18877f['query'][_0xba7a('0x22')]);}return _0x2f5dfe['getAgents'](_0x3facb0);}})[_0xba7a('0x2b')](function(_0x203dcd){if(_0x203dcd){return _0x203dcd?{'count':_0x7967bc,'rows':_0x203dcd}:null;}})[_0xba7a('0x2b')](respondWithResult(_0x164520,null))['catch'](handleError(_0x164520,null));}; \ No newline at end of file +var _0x2be9=['findAndCountAll','UserId','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','merge','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userFaxQueue:save','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeTeams','addAgents','omit','removeAgents','userFaxQueue:remove','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','FaxQueues','end','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserFaxQueue','FaxQueueId','findAll'];(function(_0x5d23ee,_0x562aab){var _0x396cf3=function(_0x14385a){while(--_0x14385a){_0x5d23ee['push'](_0x5d23ee['shift']());}};_0x396cf3(++_0x562aab);}(_0x2be9,0xbf));var _0x92be=function(_0x50b651,_0x2ce0c5){_0x50b651=_0x50b651-0x0;var _0x1ec2b0=_0x2be9[_0x50b651];return _0x1ec2b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92be('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x92be('0x1'));var moment=require(_0x92be('0x2'));var BPromise=require(_0x92be('0x3'));var Mustache=require(_0x92be('0x4'));var util=require(_0x92be('0x5'));var path=require(_0x92be('0x6'));var sox=require(_0x92be('0x7'));var csv=require(_0x92be('0x8'));var ejs=require(_0x92be('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92be('0xa'));var squel=require(_0x92be('0xb'));var crypto=require(_0x92be('0xc'));var jsforce=require(_0x92be('0xd'));var deskjs=require(_0x92be('0xe'));var toCsv=require(_0x92be('0x8'));var querystring=require('querystring');var Papa=require(_0x92be('0xf'));var Redis=require(_0x92be('0x10'));var authService=require(_0x92be('0x11'));var qs=require(_0x92be('0x12'));var as=require(_0x92be('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x92be('0x14'));var utils=require(_0x92be('0x15'));var config=require(_0x92be('0x16'));var licenseUtil=require(_0x92be('0x17'));var db=require(_0x92be('0x18'))['db'];config['redis']=_[_0x92be('0x19')](config[_0x92be('0x1a')],{'host':_0x92be('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x92be('0x1a')]));require('./faxQueue.socket')[_0x92be('0x1c')](socket);function respondWithStatusCode(_0x118226,_0x39de6a){_0x39de6a=_0x39de6a||0xcc;return function(_0xea3981){if(_0xea3981){return _0x118226[_0x92be('0x1d')](_0x39de6a);}return _0x118226[_0x92be('0x1e')](_0x39de6a)['end']();};}function respondWithResult(_0xa6a97,_0x58a13f){_0x58a13f=_0x58a13f||0xc8;return function(_0x52d123){if(_0x52d123){return _0xa6a97['status'](_0x58a13f)[_0x92be('0x1f')](_0x52d123);}};}function respondWithFilteredResult(_0x4070c5,_0x4031a9){return function(_0x32e258){if(_0x32e258){var _0x24c9de=typeof _0x4031a9[_0x92be('0x20')]===_0x92be('0x21')&&typeof _0x4031a9['limit']==='undefined';var _0x4bed16=_0x32e258[_0x92be('0x22')];var _0x5c927a=_0x24c9de?0x0:_0x4031a9[_0x92be('0x20')];var _0x1d1e7b=_0x24c9de?_0x32e258[_0x92be('0x22')]:_0x4031a9['offset']+_0x4031a9[_0x92be('0x23')];var _0xf01267;if(_0x1d1e7b>=_0x4bed16){_0x1d1e7b=_0x4bed16;_0xf01267=0xc8;}else{_0xf01267=0xce;}_0x4070c5[_0x92be('0x1e')](_0xf01267);return _0x4070c5['set'](_0x92be('0x24'),_0x5c927a+'-'+_0x1d1e7b+'/'+_0x4bed16)[_0x92be('0x1f')](_0x32e258);}return null;};}function patchUpdates(_0x2225aa){return function(_0x51335c){try{jsonpatch[_0x92be('0x25')](_0x51335c,_0x2225aa,!![]);}catch(_0x4d36c3){return BPromise['reject'](_0x4d36c3);}return _0x51335c[_0x92be('0x26')]();};}function saveUpdates(_0x2ba83c,_0x572d84){return function(_0xac8816){if(_0xac8816){return _0xac8816[_0x92be('0x27')](_0x2ba83c)[_0x92be('0x28')](function(_0x25f48d){return _0x25f48d;});}return null;};}function removeEntity(_0x4870eb,_0x4716b0){return function(_0x47ab3e){if(_0x47ab3e){return _0x47ab3e[_0x92be('0x29')]()[_0x92be('0x28')](function(){var _0xd5ffd1=_0x47ab3e[_0x92be('0x2a')]({'plain':!![]});var _0x13b722=_0x92be('0x2b');return db['UserProfileResource'][_0x92be('0x29')]({'where':{'type':_0x13b722,'resourceId':_0xd5ffd1['id']}})[_0x92be('0x28')](function(){return _0x47ab3e;});})['then'](function(){_0x4870eb['status'](0xcc)[_0x92be('0x2c')]();});}};}function handleEntityNotFound(_0xe3b15a,_0x2f8567){return function(_0x3e271e){if(!_0x3e271e){_0xe3b15a[_0x92be('0x1d')](0x194);}return _0x3e271e;};}function handleError(_0x381fa4,_0x75e884){_0x75e884=_0x75e884||0x1f4;return function(_0x24b527){logger[_0x92be('0x2d')](_0x24b527[_0x92be('0x2e')]);if(_0x24b527['name']){delete _0x24b527[_0x92be('0x2f')];}_0x381fa4[_0x92be('0x1e')](_0x75e884)[_0x92be('0x30')](_0x24b527);};}exports[_0x92be('0x31')]=function(_0x362db0,_0x502316){var _0x19d7c3={},_0x466bb5={},_0x3fcec3={'count':0x0,'rows':[]};var _0x56dce5=_[_0x92be('0x32')](db[_0x92be('0x33')][_0x92be('0x34')],function(_0x46f6ca){return{'name':_0x46f6ca[_0x92be('0x35')],'type':_0x46f6ca[_0x92be('0x36')]['key']};});_0x466bb5[_0x92be('0x37')]=_[_0x92be('0x32')](_0x56dce5,'name');_0x466bb5[_0x92be('0x38')]=_[_0x92be('0x39')](_0x362db0['query']);_0x466bb5['filters']=_[_0x92be('0x3a')](_0x466bb5['model'],_0x466bb5[_0x92be('0x38')]);_0x19d7c3[_0x92be('0x3b')]=_['intersection'](_0x466bb5['model'],qs[_0x92be('0x3c')](_0x362db0[_0x92be('0x38')][_0x92be('0x3c')]));_0x19d7c3['attributes']=_0x19d7c3[_0x92be('0x3b')]['length']?_0x19d7c3[_0x92be('0x3b')]:_0x466bb5['model'];if(!_0x362db0[_0x92be('0x38')][_0x92be('0x3d')](_0x92be('0x3e'))){_0x19d7c3[_0x92be('0x23')]=qs['limit'](_0x362db0[_0x92be('0x38')]['limit']);_0x19d7c3[_0x92be('0x20')]=qs[_0x92be('0x20')](_0x362db0['query']['offset']);}_0x19d7c3[_0x92be('0x3f')]=qs[_0x92be('0x40')](_0x362db0[_0x92be('0x38')][_0x92be('0x40')]);_0x19d7c3[_0x92be('0x41')]=qs[_0x92be('0x42')](_[_0x92be('0x43')](_0x362db0['query'],_0x466bb5[_0x92be('0x42')]),_0x56dce5);if(_0x362db0[_0x92be('0x38')][_0x92be('0x44')]){_0x19d7c3[_0x92be('0x41')]=_['merge'](_0x19d7c3[_0x92be('0x41')],{'$or':_[_0x92be('0x32')](_0x56dce5,function(_0x528cf1){if(_0x528cf1['type']!==_0x92be('0x45')){var _0x3fd01c={};_0x3fd01c[_0x528cf1[_0x92be('0x2f')]]={'$like':'%'+_0x362db0[_0x92be('0x38')]['filter']+'%'};return _0x3fd01c;}})});}_0x19d7c3=_['merge']({},_0x19d7c3,_0x362db0[_0x92be('0x46')]);var _0x2b4b82={'where':_0x19d7c3[_0x92be('0x41')]};return db['FaxQueue']['count'](_0x2b4b82)[_0x92be('0x28')](function(_0x2971f5){_0x3fcec3['count']=_0x2971f5;if(_0x362db0[_0x92be('0x38')][_0x92be('0x47')]){_0x19d7c3[_0x92be('0x48')]=[{'all':!![]}];}return db[_0x92be('0x33')]['findAll'](_0x19d7c3);})[_0x92be('0x28')](function(_0x3bd42c){_0x3fcec3[_0x92be('0x49')]=_0x3bd42c;return _0x3fcec3;})['then'](respondWithFilteredResult(_0x502316,_0x19d7c3))[_0x92be('0x4a')](handleError(_0x502316,null));};exports[_0x92be('0x4b')]=function(_0x3baa6a,_0x1f8169){var _0x31bdf0={'raw':!![],'where':{'id':_0x3baa6a[_0x92be('0x4c')]['id']}},_0x523f4a={};_0x523f4a[_0x92be('0x37')]=_['keys'](db[_0x92be('0x33')]['rawAttributes']);_0x523f4a[_0x92be('0x38')]=_[_0x92be('0x39')](_0x3baa6a[_0x92be('0x38')]);_0x523f4a['filters']=_['intersection'](_0x523f4a[_0x92be('0x37')],_0x523f4a[_0x92be('0x38')]);_0x31bdf0[_0x92be('0x3b')]=_[_0x92be('0x3a')](_0x523f4a[_0x92be('0x37')],qs[_0x92be('0x3c')](_0x3baa6a[_0x92be('0x38')][_0x92be('0x3c')]));_0x31bdf0[_0x92be('0x3b')]=_0x31bdf0[_0x92be('0x3b')][_0x92be('0x4d')]?_0x31bdf0['attributes']:_0x523f4a[_0x92be('0x37')];if(_0x3baa6a[_0x92be('0x38')][_0x92be('0x47')]){_0x31bdf0['include']=[{'all':!![]}];}_0x31bdf0=_['merge']({},_0x31bdf0,_0x3baa6a['options']);return db[_0x92be('0x33')][_0x92be('0x4e')](_0x31bdf0)[_0x92be('0x28')](handleEntityNotFound(_0x1f8169,null))[_0x92be('0x28')](respondWithResult(_0x1f8169,null))['catch'](handleError(_0x1f8169,null));};exports['create']=function(_0x19e44d,_0x2539e9){return db[_0x92be('0x33')][_0x92be('0x4f')](_0x19e44d['body'],{})[_0x92be('0x28')](function(_0x2493bb){var _0x5eae55=_0x19e44d['user'][_0x92be('0x2a')]({'plain':!![]});if(!_0x5eae55)throw new Error(_0x92be('0x50'));if(_0x5eae55[_0x92be('0x51')]===_0x92be('0x52')){var _0x15fc92=_0x2493bb[_0x92be('0x2a')]({'plain':!![]});var _0x19fc22='FaxQueues';return db[_0x92be('0x53')][_0x92be('0x4e')]({'where':{'name':_0x19fc22,'userProfileId':_0x5eae55[_0x92be('0x54')]},'raw':!![]})[_0x92be('0x28')](function(_0x457500){if(_0x457500&&_0x457500['autoAssociation']===0x0){return db[_0x92be('0x55')]['create']({'name':_0x15fc92['name'],'resourceId':_0x15fc92['id'],'type':_0x457500[_0x92be('0x2f')],'sectionId':_0x457500['id']},{})[_0x92be('0x28')](function(){return _0x2493bb;});}else{return _0x2493bb;}})[_0x92be('0x4a')](function(_0x5b654f){logger[_0x92be('0x2d')](_0x92be('0x56'),_0x5b654f);throw _0x5b654f;});}return _0x2493bb;})[_0x92be('0x28')](respondWithResult(_0x2539e9,0xc9))[_0x92be('0x4a')](handleError(_0x2539e9,null));};exports[_0x92be('0x27')]=function(_0x4e2f80,_0x4bbcee){if(_0x4e2f80['body']['id']){delete _0x4e2f80[_0x92be('0x57')]['id'];}return db[_0x92be('0x33')][_0x92be('0x4e')]({'where':{'id':_0x4e2f80[_0x92be('0x4c')]['id']}})[_0x92be('0x28')](handleEntityNotFound(_0x4bbcee,null))[_0x92be('0x28')](saveUpdates(_0x4e2f80[_0x92be('0x57')],null))['then'](respondWithResult(_0x4bbcee,null))[_0x92be('0x4a')](handleError(_0x4bbcee,null));};exports['destroy']=function(_0x41fc85,_0x571d92){return db['FaxQueue'][_0x92be('0x4e')]({'where':{'id':_0x41fc85['params']['id']}})[_0x92be('0x28')](handleEntityNotFound(_0x571d92,null))[_0x92be('0x28')](removeEntity(_0x571d92,null))[_0x92be('0x4a')](handleError(_0x571d92,null));};exports[_0x92be('0x58')]=function(_0x2e0561,_0x2ccaa9){return db[_0x92be('0x33')][_0x92be('0x58')]()[_0x92be('0x28')](respondWithResult(_0x2ccaa9,null))['catch'](handleError(_0x2ccaa9,null));};exports['getMembers']=function(_0x37c0e8,_0x17f2ab,_0x1aa2bf){var _0x4b40f3={'raw':!![],'where':{}},_0x21df2c={},_0x176929;return db[_0x92be('0x33')][_0x92be('0x59')]({'where':{'id':_0x37c0e8['params']['id']}})[_0x92be('0x28')](handleEntityNotFound(_0x17f2ab,null))[_0x92be('0x28')](function(_0x2ddd65){if(_0x2ddd65){_0x176929=_0x2ddd65[_0x92be('0x2a')]({'plain':!![]});_0x21df2c[_0x92be('0x37')]=_['keys'](db[_0x92be('0x5a')][_0x92be('0x34')]);_0x21df2c[_0x92be('0x38')]=_[_0x92be('0x39')](_0x37c0e8[_0x92be('0x38')]);_0x21df2c[_0x92be('0x42')]=_[_0x92be('0x3a')](_0x21df2c[_0x92be('0x37')],_0x21df2c[_0x92be('0x38')]);_0x4b40f3[_0x92be('0x3b')]=_['intersection'](_0x21df2c[_0x92be('0x37')],qs[_0x92be('0x3c')](_0x37c0e8[_0x92be('0x38')][_0x92be('0x3c')]));_0x4b40f3[_0x92be('0x3b')]=_0x4b40f3[_0x92be('0x3b')][_0x92be('0x4d')]?_0x4b40f3[_0x92be('0x3b')]:_0x21df2c[_0x92be('0x37')];if(!_0x37c0e8['query'][_0x92be('0x3d')](_0x92be('0x3e'))){_0x4b40f3['limit']=qs['limit'](_0x37c0e8[_0x92be('0x38')][_0x92be('0x23')]);_0x4b40f3[_0x92be('0x20')]=qs[_0x92be('0x20')](_0x37c0e8[_0x92be('0x38')][_0x92be('0x20')]);}_0x4b40f3[_0x92be('0x3f')]=qs[_0x92be('0x40')](_0x37c0e8['query'][_0x92be('0x40')]);_0x4b40f3[_0x92be('0x41')]=qs[_0x92be('0x42')](_['pick'](_0x37c0e8[_0x92be('0x38')],_0x21df2c[_0x92be('0x42')]));_0x4b40f3[_0x92be('0x41')][_0x92be('0x5b')]=_0x2ddd65['id'];if(_0x37c0e8[_0x92be('0x38')][_0x92be('0x44')]){_0x4b40f3[_0x92be('0x41')]=_['merge'](_0x4b40f3['where'],{'$or':_[_0x92be('0x32')](_0x4b40f3[_0x92be('0x3b')],function(_0x541f46){var _0x50fe23={};_0x50fe23[_0x541f46]={'$like':'%'+_0x37c0e8[_0x92be('0x38')][_0x92be('0x44')]+'%'};return _0x50fe23;})});}_0x4b40f3=_['merge']({},_0x4b40f3,_0x37c0e8['options']);return db[_0x92be('0x5a')][_0x92be('0x5c')](_0x4b40f3);}})[_0x92be('0x28')](function(_0x22eec5){if(_0x22eec5){return db['User'][_0x92be('0x5d')]({'where':{'id':_[_0x92be('0x32')](_0x22eec5,_0x92be('0x5e')),'role':'agent'},'attributes':['id',_0x92be('0x2f'),_0x92be('0x5f'),_0x92be('0x60'),'createdAt']});}})['then'](function(_0x7361bf){if(_0x7361bf){return{'count':_0x7361bf[_0x92be('0x22')],'rows':_[_0x92be('0x32')](_0x7361bf[_0x92be('0x49')],function(_0x9d77d9){return{'membername':_0x9d77d9[_0x92be('0x2f')],'UserId':_0x9d77d9['id'],'queue_name':_0x176929['name'],'FaxQueueId':_0x176929['id'],'interface':util[_0x92be('0x61')](_0x92be('0x62'),_0x92be('0x63'),_0x9d77d9[_0x92be('0x2f')]),'penalty':0x0,'paused':_0x9d77d9[_0x92be('0x5f')],'createdAt':_0x9d77d9[_0x92be('0x64')],'updatedAt':_0x9d77d9[_0x92be('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x92be('0x28')](respondWithFilteredResult(_0x17f2ab,_0x4b40f3))[_0x92be('0x4a')](handleError(_0x17f2ab,null));};exports[_0x92be('0x65')]=function(_0x232ab9,_0x36627b,_0x3e261d){var _0x1da5b2={};var _0x222c9c={};var _0xa7c31e;var _0x14febd;return db[_0x92be('0x33')]['findOne']({'where':{'id':_0x232ab9[_0x92be('0x4c')]['id']}})[_0x92be('0x28')](handleEntityNotFound(_0x36627b,null))[_0x92be('0x28')](function(_0xeee393){if(_0xeee393){_0xa7c31e=_0xeee393;_0x222c9c[_0x92be('0x37')]=_[_0x92be('0x39')](db[_0x92be('0x66')][_0x92be('0x34')]);_0x222c9c[_0x92be('0x38')]=_[_0x92be('0x39')](_0x232ab9['query']);_0x222c9c[_0x92be('0x42')]=_['intersection'](_0x222c9c['model'],_0x222c9c[_0x92be('0x38')]);_0x1da5b2[_0x92be('0x3b')]=_[_0x92be('0x3a')](_0x222c9c[_0x92be('0x37')],qs[_0x92be('0x3c')](_0x232ab9[_0x92be('0x38')][_0x92be('0x3c')]));_0x1da5b2[_0x92be('0x3b')]=_0x1da5b2['attributes']['length']?_0x1da5b2[_0x92be('0x3b')]:_0x222c9c[_0x92be('0x37')];_0x1da5b2[_0x92be('0x3f')]=qs[_0x92be('0x40')](_0x232ab9[_0x92be('0x38')][_0x92be('0x40')]);_0x1da5b2[_0x92be('0x41')]=qs[_0x92be('0x42')](_['pick'](_0x232ab9['query'],_0x222c9c[_0x92be('0x42')]));if(_0x232ab9[_0x92be('0x38')][_0x92be('0x44')]){_0x1da5b2[_0x92be('0x41')]=_[_0x92be('0x67')](_0x1da5b2[_0x92be('0x41')],{'$or':_[_0x92be('0x32')](_0x1da5b2[_0x92be('0x3b')],function(_0x149c53){var _0x5b1b46={};_0x5b1b46[_0x149c53]={'$like':'%'+_0x232ab9[_0x92be('0x38')][_0x92be('0x44')]+'%'};return _0x5b1b46;})});}_0x1da5b2=_['merge']({},_0x1da5b2,_0x232ab9['options']);return _0xa7c31e[_0x92be('0x65')](_0x1da5b2);}})[_0x92be('0x28')](function(_0x2e2489){if(_0x2e2489){_0x14febd=_0x2e2489[_0x92be('0x4d')];if(!_0x232ab9[_0x92be('0x38')][_0x92be('0x3d')](_0x92be('0x3e'))){_0x1da5b2['limit']=qs[_0x92be('0x23')](_0x232ab9[_0x92be('0x38')][_0x92be('0x23')]);_0x1da5b2['offset']=qs[_0x92be('0x20')](_0x232ab9[_0x92be('0x38')]['offset']);}return _0xa7c31e[_0x92be('0x65')](_0x1da5b2);}})[_0x92be('0x28')](function(_0x1de8d5){if(_0x1de8d5){return _0x1de8d5?{'count':_0x14febd,'rows':_0x1de8d5}:null;}})[_0x92be('0x28')](respondWithResult(_0x36627b,null))[_0x92be('0x4a')](handleError(_0x36627b,null));};exports[_0x92be('0x68')]=function(_0x4a325f,_0x58f43b,_0x18c76b){var _0x1fe623=_0x4a325f[_0x92be('0x57')][_0x92be('0x69')];return db[_0x92be('0x66')][_0x92be('0x5c')]({'where':{'id':_0x1fe623},'attributes':['id'],'include':[{'model':db[_0x92be('0x6a')],'as':_0x92be('0x6b'),'attributes':['id',_0x92be('0x2f'),_0x92be('0x6c'),_0x92be('0x6d'),_0x92be('0x6e')],'raw':!![]}]})[_0x92be('0x28')](function(_0x3de554){if(_0x3de554){var _0x47b9dc=_[_0x92be('0x6f')](_0x3de554,function(_0x1f7e21){var _0x13fdbf=_0x1f7e21[_0x92be('0x2a')]({'plain':!![]});return _0x13fdbf['Agents'];});return db[_0x92be('0x33')][_0x92be('0x4e')]({'where':{'id':_0x4a325f['params']['id']}})[_0x92be('0x28')](function(_0x4b5ba9){return db['sequelize']['transaction'](function(_0x2c7337){return _0x4b5ba9['addTeams'](_0x1fe623,{'transaction':_0x2c7337})['then'](function(){return BPromise[_0x92be('0x70')](_0x47b9dc,function(_0x284114){return db['UserFaxQueue'][_0x92be('0x71')]({'where':{'UserId':_0x284114['id'],'FaxQueueId':_0x4a325f[_0x92be('0x4c')]['id']},'transaction':_0x2c7337});});})[_0x92be('0x28')](function(){_0x47b9dc[_0x92be('0x72')](function(_0x5a27b1){socket[_0x92be('0x73')](_0x92be('0x74'),{'UserId':_0x5a27b1['id'],'FaxQueueId':_0x4b5ba9['id']});});});});});}})[_0x92be('0x28')](respondWithStatusCode(_0x58f43b,null))['catch'](handleError(_0x58f43b,null));};exports['removeTeams']=function(_0x2326ad,_0x2bb53c,_0x59cfa1){return db[_0x92be('0x66')][_0x92be('0x5c')]({'where':{'id':_0x2326ad[_0x92be('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x92be('0x6a')],'as':_0x92be('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x92be('0x28')](handleEntityNotFound(_0x2bb53c,null))[_0x92be('0x28')](function(_0xaa3f6d){var _0x3b06ab=_[_0x92be('0x32')](_0xaa3f6d,'id');var _0x1f60e4=[];var _0x1deec8=[];var _0x1f53e5=squel['select']();_0x1f53e5[_0x92be('0x75')](_0x92be('0x76'))[_0x92be('0x77')](_0x92be('0x78'),'tq')['join'](_0x92be('0x79'),'ut',_0x92be('0x7a'))[_0x92be('0x41')](_0x92be('0x7b'),_0x2326ad[_0x92be('0x4c')]['id']);for(var _0x1b6b11=0x0;_0x1b6b11<_0xaa3f6d[_0x92be('0x4d')];_0x1b6b11+=0x1){let _0x14849f=_0xaa3f6d[_0x1b6b11];for(var _0x4c9d0b=0x0;_0x4c9d0b<_0x14849f[_0x92be('0x6b')][_0x92be('0x4d')];_0x4c9d0b+=0x1){let _0x4de0f9=_0x14849f[_0x92be('0x6b')][_0x4c9d0b];var _0x247143=_0x1f53e5[_0x92be('0x7c')]();_0x247143['where'](_0x92be('0x7d'),_0x4de0f9['id']);_0x1deec8['push'](db[_0x92be('0x7e')][_0x92be('0x38')](_0x247143['toString'](),{'type':db[_0x92be('0x7e')][_0x92be('0x7f')][_0x92be('0x80')]})[_0x92be('0x28')](function(_0x895187){if(_0x895187['length']===0x1){return _0x4de0f9['id'];}else{var _0x1cf1cf=_['every'](_[_0x92be('0x32')](_0x895187,_0x92be('0x81')),function(_0x43240b){return _[_0x92be('0x82')](_0x3b06ab,_0x43240b);});if(_0x1cf1cf){return _0x4de0f9['id'];}}}));}}return BPromise[_0x92be('0x83')](_0x1deec8)[_0x92be('0x28')](function(_0x454712){_0x1f60e4=_(_0x1f60e4)[_0x92be('0x84')](_0x454712)[_0x92be('0x85')]()[_0x92be('0x86')]();return db['FaxQueue'][_0x92be('0x4e')]({'where':{'id':_0x2326ad[_0x92be('0x4c')]['id']}})['then'](function(_0x4d0793){return db['sequelize'][_0x92be('0x87')](function(_0x556823){return _0x4d0793[_0x92be('0x88')](_0x2326ad[_0x92be('0x38')]['ids'],{'transaction':_0x556823})[_0x92be('0x28')](function(){if(!_['isEmpty'](_0x1f60e4)){return _0x4d0793['removeAgents'](_0x1f60e4,{'transaction':_0x556823});}})['then'](function(){_0x1f60e4[_0x92be('0x72')](function(_0x50a03b){socket[_0x92be('0x73')]('userFaxQueue:remove',{'UserId':_0x50a03b,'FaxQueueId':_0x4d0793['id']});});});});});});})[_0x92be('0x28')](respondWithStatusCode(_0x2bb53c,null))['catch'](handleError(_0x2bb53c,null));};exports[_0x92be('0x89')]=function(_0x14e213,_0x32a541,_0x389753){return db[_0x92be('0x33')][_0x92be('0x4e')]({'where':{'id':_0x14e213[_0x92be('0x4c')]['id']}})[_0x92be('0x28')](handleEntityNotFound(_0x32a541,null))[_0x92be('0x28')](function(_0x589f2a){if(_0x589f2a){return _0x589f2a[_0x92be('0x89')](_0x14e213['body'][_0x92be('0x69')],_[_0x92be('0x8a')](_0x14e213[_0x92be('0x57')],[_0x92be('0x69'),'id'])||{})['spread'](function(_0x1b3bdc){for(var _0x3d1553=0x0;_0x3d1553<_0x14e213['body']['ids'][_0x92be('0x4d')];_0x3d1553+=0x1){socket[_0x92be('0x73')](_0x92be('0x74'),{'UserId':Number(_0x14e213[_0x92be('0x57')][_0x92be('0x69')][_0x3d1553]),'FaxQueueId':Number(_0x14e213[_0x92be('0x4c')]['id'])});}return _0x1b3bdc;});}})[_0x92be('0x28')](respondWithResult(_0x32a541,null))[_0x92be('0x4a')](handleError(_0x32a541,null));};exports[_0x92be('0x8b')]=function(_0x1f5586,_0x1c3d44,_0x213f61){return db[_0x92be('0x33')][_0x92be('0x4e')]({'where':{'id':_0x1f5586[_0x92be('0x4c')]['id']}})[_0x92be('0x28')](handleEntityNotFound(_0x1c3d44,null))['then'](function(_0x2c6f47){if(_0x2c6f47){return _0x2c6f47[_0x92be('0x8b')](_0x1f5586[_0x92be('0x38')]['ids'])[_0x92be('0x28')](function(){if(_['isArray'](_0x1f5586['query'][_0x92be('0x69')])){for(var _0x372973=0x0;_0x372973<_0x1f5586[_0x92be('0x38')][_0x92be('0x69')][_0x92be('0x4d')];_0x372973+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x1f5586[_0x92be('0x38')][_0x92be('0x69')][_0x372973]),'FaxQueueId':Number(_0x1f5586[_0x92be('0x4c')]['id'])});}}else{socket['emit'](_0x92be('0x8c'),{'UserId':Number(_0x1f5586[_0x92be('0x38')][_0x92be('0x69')]),'FaxQueueId':Number(_0x1f5586[_0x92be('0x4c')]['id'])});}});}})[_0x92be('0x28')](respondWithStatusCode(_0x1c3d44,null))[_0x92be('0x4a')](handleError(_0x1c3d44,null));};exports[_0x92be('0x8d')]=function(_0x4d1d48,_0x57ea49,_0xf74999){var _0x3a8637={};var _0x43551f={};var _0x3dd3ee;var _0x2822cf;return db[_0x92be('0x33')]['findOne']({'where':{'id':_0x4d1d48[_0x92be('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57ea49,null))[_0x92be('0x28')](function(_0x43161b){if(_0x43161b){_0x3dd3ee=_0x43161b;_0x43551f[_0x92be('0x37')]=_['keys'](db['User'][_0x92be('0x34')]);_0x43551f[_0x92be('0x38')]=_[_0x92be('0x39')](_0x4d1d48['query']);_0x43551f[_0x92be('0x42')]=_[_0x92be('0x3a')](_0x43551f[_0x92be('0x37')],_0x43551f[_0x92be('0x38')]);_0x3a8637[_0x92be('0x3b')]=_[_0x92be('0x3a')](_0x43551f[_0x92be('0x37')],qs[_0x92be('0x3c')](_0x4d1d48[_0x92be('0x38')][_0x92be('0x3c')]));_0x3a8637['attributes']=_0x3a8637['attributes'][_0x92be('0x4d')]?_0x3a8637[_0x92be('0x3b')]:_0x43551f[_0x92be('0x37')];_0x3a8637[_0x92be('0x3f')]=qs[_0x92be('0x40')](_0x4d1d48[_0x92be('0x38')][_0x92be('0x40')]);_0x3a8637['where']=qs[_0x92be('0x42')](_[_0x92be('0x43')](_0x4d1d48[_0x92be('0x38')],_0x43551f['filters']));if(_0x4d1d48[_0x92be('0x38')]['filter']){_0x3a8637[_0x92be('0x41')]=_[_0x92be('0x67')](_0x3a8637[_0x92be('0x41')],{'$or':_['map'](_0x3a8637[_0x92be('0x3b')],function(_0x39822d){var _0xceae08={};_0xceae08[_0x39822d]={'$like':'%'+_0x4d1d48[_0x92be('0x38')][_0x92be('0x44')]+'%'};return _0xceae08;})});}_0x3a8637=_[_0x92be('0x67')]({},_0x3a8637,_0x4d1d48[_0x92be('0x46')]);return _0x3dd3ee[_0x92be('0x8d')](_0x3a8637);}})['then'](function(_0x53ff07){if(_0x53ff07){_0x2822cf=_0x53ff07[_0x92be('0x4d')];if(!_0x4d1d48[_0x92be('0x38')][_0x92be('0x3d')]('nolimit')){_0x3a8637[_0x92be('0x23')]=qs[_0x92be('0x23')](_0x4d1d48['query']['limit']);_0x3a8637[_0x92be('0x20')]=qs[_0x92be('0x20')](_0x4d1d48[_0x92be('0x38')][_0x92be('0x20')]);}return _0x3dd3ee[_0x92be('0x8d')](_0x3a8637);}})[_0x92be('0x28')](function(_0x4a5cc1){if(_0x4a5cc1){return _0x4a5cc1?{'count':_0x2822cf,'rows':_0x4a5cc1}:null;}})[_0x92be('0x28')](respondWithResult(_0x57ea49,null))['catch'](handleError(_0x57ea49,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f41644d..66ca0f8 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 _0x9028=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x3cee44,_0x21ec7c){var _0x27291f=function(_0x112c78){while(--_0x112c78){_0x3cee44['push'](_0x3cee44['shift']());}};_0x27291f(++_0x21ec7c);}(_0x9028,0x158));var _0x8902=function(_0x2b3d29,_0x552e02){_0x2b3d29=_0x2b3d29-0x0;var _0x1ae804=_0x9028[_0x2b3d29];return _0x1ae804;};'use strict';var EventEmitter=require(_0x8902('0x0'));var FaxQueue=require(_0x8902('0x1'))['db'][_0x8902('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8902('0x3')](0x0);var events={'afterCreate':_0x8902('0x4'),'afterUpdate':_0x8902('0x5'),'afterDestroy':_0x8902('0x6')};function emitEvent(_0x306374){return function(_0x1fd262,_0x51f894,_0x5550fb){FaxQueueEvents[_0x8902('0x7')](_0x306374+':'+_0x1fd262['id'],_0x1fd262);FaxQueueEvents[_0x8902('0x7')](_0x306374,_0x1fd262);_0x5550fb(null);};}for(var e in events){if(events[_0x8902('0x8')](e)){var event=events[e];FaxQueue[_0x8902('0x9')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x1108=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0xef5c9f,_0x155ab7){var _0x4a7ed3=function(_0x232908){while(--_0x232908){_0xef5c9f['push'](_0xef5c9f['shift']());}};_0x4a7ed3(++_0x155ab7);}(_0x1108,0x10a));var _0x8110=function(_0x5ece84,_0xc06c9f){_0x5ece84=_0x5ece84-0x0;var _0x2a12c4=_0x1108[_0x5ece84];return _0x2a12c4;};'use strict';var EventEmitter=require(_0x8110('0x0'));var FaxQueue=require(_0x8110('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8110('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8110('0x3'),'afterDestroy':_0x8110('0x4')};function emitEvent(_0x34bc24){return function(_0x5a7fec,_0x2709d3,_0x4f4311){FaxQueueEvents['emit'](_0x34bc24+':'+_0x5a7fec['id'],_0x5a7fec);FaxQueueEvents[_0x8110('0x5')](_0x34bc24,_0x5a7fec);_0x4f4311(null);};}for(var e in events){if(events[_0x8110('0x6')](e)){var event=events[e];FaxQueue[_0x8110('0x7')](e,emitEvent(event));}}module[_0x8110('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 662b480..4220538 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 _0x9aaf=['exports','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0xc61e27,_0x4fc138){var _0x795fdf=function(_0x4647a6){while(--_0x4647a6){_0xc61e27['push'](_0xc61e27['shift']());}};_0x795fdf(++_0x4fc138);}(_0x9aaf,0x87));var _0xf9aa=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0x9aaf[_0x4e0359];return _0x450f0a;};'use strict';var _=require(_0xf9aa('0x0'));var util=require(_0xf9aa('0x1'));var logger=require(_0xf9aa('0x2'))(_0xf9aa('0x3'));var moment=require(_0xf9aa('0x4'));var BPromise=require(_0xf9aa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9aa('0x6'));var rimraf=require('rimraf');var config=require(_0xf9aa('0x7'));var attributes=require('./faxQueue.attributes');module[_0xf9aa('0x8')]=function(_0x578edf,_0x297125){return _0x578edf['define'](_0xf9aa('0x9'),attributes,{'tableName':_0xf9aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88e7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','lodash','util','api','moment'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x88e7,0xbf));var _0x788e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x88e7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x788e('0x0'));var util=require(_0x788e('0x1'));var logger=require('../../config/logger')(_0x788e('0x2'));var moment=require(_0x788e('0x3'));var BPromise=require(_0x788e('0x4'));var rp=require(_0x788e('0x5'));var fs=require('fs');var path=require(_0x788e('0x6'));var rimraf=require(_0x788e('0x7'));var config=require(_0x788e('0x8'));var attributes=require('./faxQueue.attributes');module[_0x788e('0x9')]=function(_0x479e4b,_0x3d6ae2){return _0x479e4b[_0x788e('0xa')](_0x788e('0xb'),attributes,{'tableName':_0x788e('0xc'),'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 32acbc7..a49b14a 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 _0xc422=['socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','FaxQueue','options','where','attributes','include','model','map','GetFaxQueue','catch','raw','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','redis','localhost'];(function(_0x552284,_0x16d6aa){var _0x165932=function(_0x4a808a){while(--_0x4a808a){_0x552284['push'](_0x552284['shift']());}};_0x165932(++_0x16d6aa);}(_0xc422,0x15d));var _0x2c42=function(_0x1579db,_0x452932){_0x1579db=_0x1579db-0x0;var _0x1c4386=_0xc422[_0x1579db];return _0x1c4386;};'use strict';var _=require(_0x2c42('0x0'));var util=require('util');var moment=require(_0x2c42('0x1'));var BPromise=require(_0x2c42('0x2'));var rs=require(_0x2c42('0x3'));var fs=require('fs');var Redis=require(_0x2c42('0x4'));var db=require(_0x2c42('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c42('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2c42('0x7')][_0x2c42('0x8')]({'port':0x232a});config[_0x2c42('0x9')]=_['defaults'](config['redis'],{'host':_0x2c42('0xa'),'port':0x18eb});var socket=require(_0x2c42('0xb'))(new Redis(config[_0x2c42('0x9')]));require(_0x2c42('0xc'))[_0x2c42('0xd')](socket);function respondWithRpcPromise(_0x255a10,_0x43a810,_0x37f2ab){return new BPromise(function(_0x5b0a76,_0x333291){return client[_0x2c42('0xe')](_0x255a10,_0x37f2ab)[_0x2c42('0xf')](function(_0x216da9){logger[_0x2c42('0x10')]('FaxQueue,\x20%s,\x20%s',_0x43a810,_0x2c42('0x11'));logger[_0x2c42('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x43a810,_0x2c42('0x11'),JSON[_0x2c42('0x13')](_0x216da9));if(_0x216da9[_0x2c42('0x14')]){if(_0x216da9[_0x2c42('0x14')][_0x2c42('0x15')]===0x1f4){logger[_0x2c42('0x14')](_0x2c42('0x16'),_0x43a810,_0x216da9['error'][_0x2c42('0x17')]);return _0x333291(_0x216da9[_0x2c42('0x14')][_0x2c42('0x17')]);}logger[_0x2c42('0x14')](_0x2c42('0x16'),_0x43a810,_0x216da9[_0x2c42('0x14')][_0x2c42('0x17')]);return _0x5b0a76(_0x216da9[_0x2c42('0x14')][_0x2c42('0x17')]);}else{logger[_0x2c42('0x10')](_0x2c42('0x16'),_0x43a810,_0x2c42('0x11'));_0x5b0a76(_0x216da9[_0x2c42('0x18')][_0x2c42('0x17')]);}})['catch'](function(_0x2d65f9){logger['error']('FaxQueue,\x20%s,\x20%s',_0x43a810,_0x2d65f9);_0x333291(_0x2d65f9);});});}exports['GetFaxQueue']=function(_0x712947){var _0x22af6d=this;return new Promise(function(_0x5111e5,_0x3c9cb7){return db[_0x2c42('0x19')]['findAll']({'raw':_0x712947[_0x2c42('0x1a')]?_0x712947[_0x2c42('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x712947[_0x2c42('0x1a')]?_0x712947[_0x2c42('0x1a')][_0x2c42('0x1b')]||null:null,'attributes':_0x712947[_0x2c42('0x1a')]?_0x712947[_0x2c42('0x1a')][_0x2c42('0x1c')]||null:null,'limit':_0x712947['options']?_0x712947[_0x2c42('0x1a')]['limit']||null:null,'include':_0x712947['options']?_0x712947[_0x2c42('0x1a')][_0x2c42('0x1d')]?_['map'](_0x712947[_0x2c42('0x1a')][_0x2c42('0x1d')],function(_0x134268){return{'model':db[_0x134268[_0x2c42('0x1e')]],'as':_0x134268['as'],'attributes':_0x134268[_0x2c42('0x1c')],'include':_0x134268[_0x2c42('0x1d')]?_[_0x2c42('0x1f')](_0x134268[_0x2c42('0x1d')],function(_0x4d0ec3){return{'model':db[_0x4d0ec3[_0x2c42('0x1e')]],'as':_0x4d0ec3['as'],'attributes':_0x4d0ec3[_0x2c42('0x1c')],'include':_0x4d0ec3[_0x2c42('0x1d')]?_[_0x2c42('0x1f')](_0x4d0ec3[_0x2c42('0x1d')],function(_0x44ebdd){return{'model':db[_0x44ebdd[_0x2c42('0x1e')]],'as':_0x44ebdd['as'],'attributes':_0x44ebdd['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c42('0xf')](function(_0x33749a){logger[_0x2c42('0x10')](_0x2c42('0x20'),_0x712947);logger[_0x2c42('0x12')](_0x2c42('0x20'),_0x712947,JSON['stringify'](_0x33749a));_0x5111e5(_0x33749a);})[_0x2c42('0x21')](function(_0x23634f){logger[_0x2c42('0x14')](_0x2c42('0x20'),_0x23634f[_0x2c42('0x17')],_0x712947);_0x3c9cb7(_0x22af6d['error'](0x1f4,_0x23634f[_0x2c42('0x17')]));});});};exports['ShowFaxQueue']=function(_0x44221e){var _0x2ab693=this;return new Promise(function(_0x487f1e,_0xd15067){return db[_0x2c42('0x19')]['find']({'raw':_0x44221e[_0x2c42('0x1a')]?_0x44221e[_0x2c42('0x1a')][_0x2c42('0x22')]===undefined?!![]:![]:!![],'where':_0x44221e[_0x2c42('0x1a')]?_0x44221e[_0x2c42('0x1a')][_0x2c42('0x1b')]||null:null,'attributes':_0x44221e[_0x2c42('0x1a')]?_0x44221e[_0x2c42('0x1a')][_0x2c42('0x1c')]||null:null,'include':_0x44221e['options']?_0x44221e[_0x2c42('0x1a')]['include']?_[_0x2c42('0x1f')](_0x44221e[_0x2c42('0x1a')]['include'],function(_0xd008d8){return{'model':db[_0xd008d8[_0x2c42('0x1e')]],'as':_0xd008d8['as'],'attributes':_0xd008d8['attributes'],'include':_0xd008d8[_0x2c42('0x1d')]?_[_0x2c42('0x1f')](_0xd008d8[_0x2c42('0x1d')],function(_0x23d7aa){return{'model':db[_0x23d7aa[_0x2c42('0x1e')]],'as':_0x23d7aa['as'],'attributes':_0x23d7aa[_0x2c42('0x1c')],'include':_0x23d7aa['include']?_['map'](_0x23d7aa[_0x2c42('0x1d')],function(_0x2446e2){return{'model':db[_0x2446e2['model']],'as':_0x2446e2['as'],'attributes':_0x2446e2[_0x2c42('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x570767){logger[_0x2c42('0x10')](_0x2c42('0x23'),_0x44221e);logger[_0x2c42('0x12')](_0x2c42('0x23'),_0x44221e,JSON[_0x2c42('0x13')](_0x570767));_0x487f1e(_0x570767);})[_0x2c42('0x21')](function(_0x4ef32b){logger[_0x2c42('0x14')](_0x2c42('0x23'),_0x4ef32b[_0x2c42('0x17')],_0x44221e);_0xd15067(_0x2ab693[_0x2c42('0x14')](0x1f4,_0x4ef32b[_0x2c42('0x17')]));});});}; \ No newline at end of file +var _0xfc1f=['GetFaxQueue','ShowFaxQueue','FaxQueue','where','lodash','moment','bluebird','randomstring','rpc','../../config/environment','client','http','defaults','socket.io-emitter','redis','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','options','raw','include','model','map','attributes'];(function(_0xce0e8f,_0x2baa85){var _0x21e9d6=function(_0x41412e){while(--_0x41412e){_0xce0e8f['push'](_0xce0e8f['shift']());}};_0x21e9d6(++_0x2baa85);}(_0xfc1f,0x1be));var _0xffc1=function(_0x272130,_0x766a1c){_0x272130=_0x272130-0x0;var _0x1c6100=_0xfc1f[_0x272130];return _0x1c6100;};'use strict';var _=require(_0xffc1('0x0'));var util=require('util');var moment=require(_0xffc1('0x1'));var BPromise=require(_0xffc1('0x2'));var rs=require(_0xffc1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xffc1('0x4'));var config=require(_0xffc1('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xffc1('0x6')][_0xffc1('0x7')]({'port':0x232a});config['redis']=_[_0xffc1('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xffc1('0x9'))(new Redis(config[_0xffc1('0xa')]));require('./faxQueue.socket')[_0xffc1('0xb')](socket);function respondWithRpcPromise(_0x33e0f9,_0x3aae77,_0x40ff4f){return new BPromise(function(_0x5cacbd,_0x36868d){return client[_0xffc1('0xc')](_0x33e0f9,_0x40ff4f)[_0xffc1('0xd')](function(_0x3abe72){logger[_0xffc1('0xe')](_0xffc1('0xf'),_0x3aae77,_0xffc1('0x10'));logger[_0xffc1('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3aae77,_0xffc1('0x10'),JSON[_0xffc1('0x12')](_0x3abe72));if(_0x3abe72[_0xffc1('0x13')]){if(_0x3abe72[_0xffc1('0x13')][_0xffc1('0x14')]===0x1f4){logger[_0xffc1('0x13')](_0xffc1('0xf'),_0x3aae77,_0x3abe72['error'][_0xffc1('0x15')]);return _0x36868d(_0x3abe72[_0xffc1('0x13')][_0xffc1('0x15')]);}logger[_0xffc1('0x13')](_0xffc1('0xf'),_0x3aae77,_0x3abe72[_0xffc1('0x13')][_0xffc1('0x15')]);return _0x5cacbd(_0x3abe72[_0xffc1('0x13')][_0xffc1('0x15')]);}else{logger[_0xffc1('0xe')](_0xffc1('0xf'),_0x3aae77,_0xffc1('0x10'));_0x5cacbd(_0x3abe72[_0xffc1('0x16')][_0xffc1('0x15')]);}})[_0xffc1('0x17')](function(_0x598e8a){logger[_0xffc1('0x13')](_0xffc1('0xf'),_0x3aae77,_0x598e8a);_0x36868d(_0x598e8a);});});}exports['GetFaxQueue']=function(_0x11a677){var _0x1b284e=this;return new Promise(function(_0x3bff94,_0x28b69e){return db['FaxQueue']['findAll']({'raw':_0x11a677[_0xffc1('0x18')]?_0x11a677['options'][_0xffc1('0x19')]===undefined?!![]:![]:!![],'where':_0x11a677[_0xffc1('0x18')]?_0x11a677[_0xffc1('0x18')]['where']||null:null,'attributes':_0x11a677[_0xffc1('0x18')]?_0x11a677['options']['attributes']||null:null,'limit':_0x11a677['options']?_0x11a677[_0xffc1('0x18')]['limit']||null:null,'include':_0x11a677[_0xffc1('0x18')]?_0x11a677['options'][_0xffc1('0x1a')]?_['map'](_0x11a677['options'][_0xffc1('0x1a')],function(_0x51b0c2){return{'model':db[_0x51b0c2[_0xffc1('0x1b')]],'as':_0x51b0c2['as'],'attributes':_0x51b0c2['attributes'],'include':_0x51b0c2[_0xffc1('0x1a')]?_[_0xffc1('0x1c')](_0x51b0c2[_0xffc1('0x1a')],function(_0x10c436){return{'model':db[_0x10c436[_0xffc1('0x1b')]],'as':_0x10c436['as'],'attributes':_0x10c436['attributes'],'include':_0x10c436[_0xffc1('0x1a')]?_[_0xffc1('0x1c')](_0x10c436[_0xffc1('0x1a')],function(_0x354251){return{'model':db[_0x354251['model']],'as':_0x354251['as'],'attributes':_0x354251[_0xffc1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xffc1('0xd')](function(_0xcd8cbb){logger[_0xffc1('0xe')](_0xffc1('0x1e'),_0x11a677);logger[_0xffc1('0x11')](_0xffc1('0x1e'),_0x11a677,JSON[_0xffc1('0x12')](_0xcd8cbb));_0x3bff94(_0xcd8cbb);})[_0xffc1('0x17')](function(_0x396922){logger[_0xffc1('0x13')]('GetFaxQueue',_0x396922[_0xffc1('0x15')],_0x11a677);_0x28b69e(_0x1b284e['error'](0x1f4,_0x396922[_0xffc1('0x15')]));});});};exports[_0xffc1('0x1f')]=function(_0x112190){var _0x4fb3bf=this;return new Promise(function(_0x162799,_0x1af8b1){return db[_0xffc1('0x20')]['find']({'raw':_0x112190[_0xffc1('0x18')]?_0x112190[_0xffc1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x112190[_0xffc1('0x18')]?_0x112190[_0xffc1('0x18')][_0xffc1('0x21')]||null:null,'attributes':_0x112190[_0xffc1('0x18')]?_0x112190['options']['attributes']||null:null,'include':_0x112190[_0xffc1('0x18')]?_0x112190[_0xffc1('0x18')][_0xffc1('0x1a')]?_['map'](_0x112190[_0xffc1('0x18')][_0xffc1('0x1a')],function(_0x24a91e){return{'model':db[_0x24a91e[_0xffc1('0x1b')]],'as':_0x24a91e['as'],'attributes':_0x24a91e[_0xffc1('0x1d')],'include':_0x24a91e[_0xffc1('0x1a')]?_['map'](_0x24a91e[_0xffc1('0x1a')],function(_0x6e5c1){return{'model':db[_0x6e5c1[_0xffc1('0x1b')]],'as':_0x6e5c1['as'],'attributes':_0x6e5c1['attributes'],'include':_0x6e5c1['include']?_[_0xffc1('0x1c')](_0x6e5c1[_0xffc1('0x1a')],function(_0x40206a){return{'model':db[_0x40206a[_0xffc1('0x1b')]],'as':_0x40206a['as'],'attributes':_0x40206a[_0xffc1('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdaa197){logger[_0xffc1('0xe')](_0xffc1('0x1f'),_0x112190);logger[_0xffc1('0x11')](_0xffc1('0x1f'),_0x112190,JSON['stringify'](_0xdaa197));_0x162799(_0xdaa197);})[_0xffc1('0x17')](function(_0x474699){logger[_0xffc1('0x13')]('ShowFaxQueue',_0x474699['message'],_0x112190);_0x1af8b1(_0x4fb3bf[_0xffc1('0x13')](0x1f4,_0x474699['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 0d4c24b..7f6f31d 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 _0xc2b2=['register','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x2e5981,_0xe4e846){var _0x6e4fef=function(_0x252b0c){while(--_0x252b0c){_0x2e5981['push'](_0x2e5981['shift']());}};_0x6e4fef(++_0xe4e846);}(_0xc2b2,0xd3));var _0x2c2b=function(_0x3ab5bf,_0x1cac9b){_0x3ab5bf=_0x3ab5bf-0x0;var _0x47e2cf=_0xc2b2[_0x3ab5bf];return _0x47e2cf;};'use strict';var FaxQueueEvents=require(_0x2c2b('0x0'));var events=[_0x2c2b('0x1'),_0x2c2b('0x2'),_0x2c2b('0x3')];function createListener(_0x1cc827,_0x17c9b5){return function(_0xec9dfa){_0x17c9b5[_0x2c2b('0x4')](_0x1cc827,_0xec9dfa);};}function removeListener(_0x4a43ae,_0x571f65){return function(){FaxQueueEvents[_0x2c2b('0x5')](_0x4a43ae,_0x571f65);};}exports[_0x2c2b('0x6')]=function(_0x2d093b){for(var _0x92ac9d=0x0,_0x2f26d1=events['length'];_0x92ac9d<_0x2f26d1;_0x92ac9d++){var _0x25ac80=events[_0x92ac9d];var _0x965942=createListener('faxQueue:'+_0x25ac80,_0x2d093b);FaxQueueEvents['on'](_0x25ac80,_0x965942);}}; \ No newline at end of file +var _0x9eba=['removeListener','register','faxQueue:','./faxQueue.events','save','update','emit'];(function(_0x32ff3b,_0x287faa){var _0x2bc632=function(_0x545853){while(--_0x545853){_0x32ff3b['push'](_0x32ff3b['shift']());}};_0x2bc632(++_0x287faa);}(_0x9eba,0x106));var _0xa9eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9eba[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0xa9eb('0x0'));var events=[_0xa9eb('0x1'),'remove',_0xa9eb('0x2')];function createListener(_0x182cc0,_0x2eba1f){return function(_0x23d6cc){_0x2eba1f[_0xa9eb('0x3')](_0x182cc0,_0x23d6cc);};}function removeListener(_0x4aeedd,_0x132571){return function(){FaxQueueEvents[_0xa9eb('0x4')](_0x4aeedd,_0x132571);};}exports[_0xa9eb('0x5')]=function(_0x7a76ce){for(var _0x2e7050=0x0,_0x80ee39=events['length'];_0x2e7050<_0x80ee39;_0x2e7050++){var _0x92f41=events[_0x2e7050];var _0x164ae8=createListener(_0xa9eb('0x6')+_0x92f41,_0x7a76ce);FaxQueueEvents['on'](_0x92f41,_0x164ae8);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 4f901d9..645d336 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 _0x4975=['post','create','addTeams','put','update','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x4975,0x86));var _0x5497=function(_0x22c66a,_0x2b4d11){_0x22c66a=_0x22c66a-0x0;var _0x282cb6=_0x4975[_0x22c66a];return _0x282cb6;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0xa')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0xa')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller['getTeams']);router['get']('/:id/users',auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router[_0x5497('0x15')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x16')]);router[_0x5497('0x15')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller[_0x5497('0x17')]);router[_0x5497('0x15')]('/:id/users',auth[_0x5497('0xd')](),controller['addAgents']);router[_0x5497('0x18')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x19')]);router[_0x5497('0x1a')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller['destroy']);router['delete'](_0x5497('0x13'),auth[_0x5497('0xd')](),controller[_0x5497('0x1b')]);router['delete'](_0x5497('0x1c'),auth[_0x5497('0xd')](),controller[_0x5497('0x1d')]);module[_0x5497('0x1e')]=router; \ No newline at end of file +var _0x444e=['addAgents','put','update','delete','destroy','/:id/users','removeAgents','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getAgents','post'];(function(_0x3f7c6e,_0x454e70){var _0x252041=function(_0x10208c){while(--_0x10208c){_0x3f7c6e['push'](_0x3f7c6e['shift']());}};_0x252041(++_0x454e70);}(_0x444e,0xe8));var _0xe444=function(_0x4ebf98,_0x506ac4){_0x4ebf98=_0x4ebf98-0x0;var _0x180691=_0x444e[_0x4ebf98];return _0x180691;};'use strict';var multer=require(_0xe444('0x0'));var util=require('util');var path=require(_0xe444('0x1'));var timeout=require('connect-timeout');var express=require(_0xe444('0x2'));var router=express['Router']();var fs_extra=require(_0xe444('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var controller=require(_0xe444('0x6'));router[_0xe444('0x7')]('/',auth[_0xe444('0x8')](),controller[_0xe444('0x9')]);router['get'](_0xe444('0xa'),auth['isAuthenticated'](),controller[_0xe444('0xb')]);router['get'](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0xd')]);router['get']('/:id/members',auth[_0xe444('0x8')](),controller[_0xe444('0xe')]);router['get'](_0xe444('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe444('0x7')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x10')]);router['post']('/',auth[_0xe444('0x8')](),controller['create']);router['post'](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['addTeams']);router[_0xe444('0x11')]('/:id/users',auth[_0xe444('0x8')](),controller[_0xe444('0x12')]);router[_0xe444('0x13')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x14')]);router[_0xe444('0x15')](_0xe444('0xc'),auth[_0xe444('0x8')](),controller[_0xe444('0x16')]);router[_0xe444('0x15')](_0xe444('0xf'),auth[_0xe444('0x8')](),controller['removeTeams']);router[_0xe444('0x15')](_0xe444('0x17'),auth[_0xe444('0x8')](),controller[_0xe444('0x18')]);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 7404ac5..2bec386 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 _0xa0ab=['exports','STRING','DATE','moment'];(function(_0x18dd79,_0x168a0c){var _0x4f273a=function(_0x1a6a32){while(--_0x1a6a32){_0x18dd79['push'](_0x18dd79['shift']());}};_0x4f273a(++_0x168a0c);}(_0xa0ab,0x1eb));var _0xba0a=function(_0x332e43,_0x252844){_0x332e43=_0x332e43-0x0;var _0x13bee3=_0xa0ab[_0x332e43];return _0x13bee3;};'use strict';var moment=require(_0xba0a('0x0'));var Sequelize=require('sequelize');module[_0xba0a('0x1')]={'uniqueid':{'type':Sequelize[_0xba0a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xba0a('0x3')]},'leaveAt':{'type':Sequelize[_0xba0a('0x3')]},'acceptAt':{'type':Sequelize[_0xba0a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac4b=['moment','sequelize','exports','DATE','STRING'];(function(_0x2f1d2f,_0x527d85){var _0x2874cf=function(_0x3203df){while(--_0x3203df){_0x2f1d2f['push'](_0x2f1d2f['shift']());}};_0x2874cf(++_0x527d85);}(_0xac4b,0xb4));var _0xbac4=function(_0x5032c2,_0x159065){_0x5032c2=_0x5032c2-0x0;var _0x28a563=_0xac4b[_0x5032c2];return _0x28a563;};'use strict';var moment=require(_0xbac4('0x0'));var Sequelize=require(_0xbac4('0x1'));module[_0xbac4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xbac4('0x3')]},'leaveAt':{'type':Sequelize[_0xbac4('0x3')]},'acceptAt':{'type':Sequelize[_0xbac4('0x3')]},'exitAt':{'type':Sequelize[_0xbac4('0x3')]},'reason':{'type':Sequelize[_0xbac4('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0dfcb8e..db17dcb 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 _0xf6fb=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf6fb,0x111));var _0xbf6f=function(_0x48f8ad,_0xdd2ae0){_0x48f8ad=_0x48f8ad-0x0;var _0xf932f5=_0xf6fb[_0x48f8ad];return _0xf932f5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbf6f('0x0'));var jsonpatch=require(_0xbf6f('0x1'));var rp=require('request-promise');var moment=require(_0xbf6f('0x2'));var BPromise=require(_0xbf6f('0x3'));var Mustache=require('mustache');var util=require(_0xbf6f('0x4'));var path=require('path');var sox=require(_0xbf6f('0x5'));var csv=require(_0xbf6f('0x6'));var ejs=require(_0xbf6f('0x7'));var fs=require('fs');var fs_extra=require(_0xbf6f('0x8'));var _=require(_0xbf6f('0x9'));var squel=require(_0xbf6f('0xa'));var crypto=require(_0xbf6f('0xb'));var jsforce=require(_0xbf6f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbf6f('0x6'));var querystring=require(_0xbf6f('0xd'));var Papa=require(_0xbf6f('0xe'));var Redis=require(_0xbf6f('0xf'));var authService=require(_0xbf6f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf6f('0x11'));var logger=require(_0xbf6f('0x12'))(_0xbf6f('0x13'));var utils=require('../../config/utils');var config=require(_0xbf6f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf6f('0x15'))['db'];function respondWithStatusCode(_0x7b939f,_0x3a5c09){_0x3a5c09=_0x3a5c09||0xcc;return function(_0x50c054){if(_0x50c054){return _0x7b939f[_0xbf6f('0x16')](_0x3a5c09);}return _0x7b939f[_0xbf6f('0x17')](_0x3a5c09)[_0xbf6f('0x18')]();};}function respondWithResult(_0x6f8fee,_0xce557a){_0xce557a=_0xce557a||0xc8;return function(_0x1dd2f1){if(_0x1dd2f1){return _0x6f8fee['status'](_0xce557a)[_0xbf6f('0x19')](_0x1dd2f1);}};}function respondWithFilteredResult(_0x3f1c33,_0x473d32){return function(_0x40ad56){if(_0x40ad56){var _0x270ec6=typeof _0x473d32[_0xbf6f('0x1a')]===_0xbf6f('0x1b')&&typeof _0x473d32['limit']==='undefined';var _0x734fe8=_0x40ad56[_0xbf6f('0x1c')];var _0x21b485=_0x270ec6?0x0:_0x473d32['offset'];var _0x56b4da=_0x270ec6?_0x40ad56[_0xbf6f('0x1c')]:_0x473d32[_0xbf6f('0x1a')]+_0x473d32[_0xbf6f('0x1d')];var _0x22e1e9;if(_0x56b4da>=_0x734fe8){_0x56b4da=_0x734fe8;_0x22e1e9=0xc8;}else{_0x22e1e9=0xce;}_0x3f1c33[_0xbf6f('0x17')](_0x22e1e9);return _0x3f1c33['set']('Content-Range',_0x21b485+'-'+_0x56b4da+'/'+_0x734fe8)[_0xbf6f('0x19')](_0x40ad56);}return null;};}function patchUpdates(_0x5985ac){return function(_0x3bd472){try{jsonpatch[_0xbf6f('0x1e')](_0x3bd472,_0x5985ac,!![]);}catch(_0x3cc13c){return BPromise['reject'](_0x3cc13c);}return _0x3bd472[_0xbf6f('0x1f')]();};}function saveUpdates(_0x21b547,_0x3a0087){return function(_0x528bf0){if(_0x528bf0){return _0x528bf0[_0xbf6f('0x20')](_0x21b547)['then'](function(_0x2af16f){return _0x2af16f;});}return null;};}function removeEntity(_0xb9e8bc,_0xba4b6a){return function(_0x49979a){if(_0x49979a){return _0x49979a[_0xbf6f('0x21')]()[_0xbf6f('0x22')](function(){_0xb9e8bc[_0xbf6f('0x17')](0xcc)[_0xbf6f('0x18')]();});}};}function handleEntityNotFound(_0x44d47f,_0x442f60){return function(_0x59c3d6){if(!_0x59c3d6){_0x44d47f[_0xbf6f('0x16')](0x194);}return _0x59c3d6;};}function handleError(_0xf6108a,_0x4c7e8d){_0x4c7e8d=_0x4c7e8d||0x1f4;return function(_0x506302){logger['error'](_0x506302[_0xbf6f('0x23')]);if(_0x506302['name']){delete _0x506302[_0xbf6f('0x24')];}_0xf6108a[_0xbf6f('0x17')](_0x4c7e8d)[_0xbf6f('0x25')](_0x506302);};}exports[_0xbf6f('0x26')]=function(_0xb440e8,_0x237b67){var _0x1aefcc={},_0x58c120={},_0x5dd4f6={'count':0x0,'rows':[]};var _0x1b675a=_[_0xbf6f('0x27')](db['FaxQueueReport'][_0xbf6f('0x28')],function(_0x4f2430){return{'name':_0x4f2430[_0xbf6f('0x29')],'type':_0x4f2430[_0xbf6f('0x2a')][_0xbf6f('0x2b')]};});_0x58c120[_0xbf6f('0x2c')]=_[_0xbf6f('0x27')](_0x1b675a,_0xbf6f('0x24'));_0x58c120[_0xbf6f('0x2d')]=_[_0xbf6f('0x2e')](_0xb440e8[_0xbf6f('0x2d')]);_0x58c120[_0xbf6f('0x2f')]=_['intersection'](_0x58c120['model'],_0x58c120[_0xbf6f('0x2d')]);_0x1aefcc[_0xbf6f('0x30')]=_[_0xbf6f('0x31')](_0x58c120[_0xbf6f('0x2c')],qs['fields'](_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x32')]));_0x1aefcc[_0xbf6f('0x30')]=_0x1aefcc[_0xbf6f('0x30')][_0xbf6f('0x33')]?_0x1aefcc['attributes']:_0x58c120[_0xbf6f('0x2c')];if(!_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x34')]('nolimit')){_0x1aefcc[_0xbf6f('0x1d')]=qs['limit'](_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x1d')]);_0x1aefcc[_0xbf6f('0x1a')]=qs[_0xbf6f('0x1a')](_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x1a')]);}_0x1aefcc[_0xbf6f('0x35')]=qs[_0xbf6f('0x36')](_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x36')]);_0x1aefcc[_0xbf6f('0x37')]=qs[_0xbf6f('0x2f')](_['pick'](_0xb440e8[_0xbf6f('0x2d')],_0x58c120[_0xbf6f('0x2f')]),_0x1b675a);if(_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x38')]){_0x1aefcc[_0xbf6f('0x37')]=_[_0xbf6f('0x39')](_0x1aefcc[_0xbf6f('0x37')],{'$or':_['map'](_0x1b675a,function(_0x460694){if(_0x460694[_0xbf6f('0x2a')]!==_0xbf6f('0x3a')){var _0x5d5c7c={};_0x5d5c7c[_0x460694[_0xbf6f('0x24')]]={'$like':'%'+_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x38')]+'%'};return _0x5d5c7c;}})});}_0x1aefcc=_['merge']({},_0x1aefcc,_0xb440e8[_0xbf6f('0x3b')]);var _0x26da28={'where':_0x1aefcc[_0xbf6f('0x37')]};return db[_0xbf6f('0x3c')][_0xbf6f('0x1c')](_0x26da28)[_0xbf6f('0x22')](function(_0x3e409e){_0x5dd4f6[_0xbf6f('0x1c')]=_0x3e409e;if(_0xb440e8[_0xbf6f('0x2d')][_0xbf6f('0x3d')]){_0x1aefcc[_0xbf6f('0x3e')]=[{'all':!![]}];}return db[_0xbf6f('0x3c')][_0xbf6f('0x3f')](_0x1aefcc);})[_0xbf6f('0x22')](function(_0x4a7df7){_0x5dd4f6[_0xbf6f('0x40')]=_0x4a7df7;return _0x5dd4f6;})['then'](respondWithFilteredResult(_0x237b67,_0x1aefcc))[_0xbf6f('0x41')](handleError(_0x237b67,null));};exports[_0xbf6f('0x42')]=function(_0x53c523,_0x1c8ffa){var _0x5cbc5f={'raw':!![],'where':{'id':_0x53c523[_0xbf6f('0x43')]['id']}},_0x3718a3={};_0x3718a3[_0xbf6f('0x2c')]=_[_0xbf6f('0x2e')](db[_0xbf6f('0x3c')][_0xbf6f('0x28')]);_0x3718a3[_0xbf6f('0x2d')]=_[_0xbf6f('0x2e')](_0x53c523[_0xbf6f('0x2d')]);_0x3718a3[_0xbf6f('0x2f')]=_[_0xbf6f('0x31')](_0x3718a3[_0xbf6f('0x2c')],_0x3718a3[_0xbf6f('0x2d')]);_0x5cbc5f[_0xbf6f('0x30')]=_[_0xbf6f('0x31')](_0x3718a3[_0xbf6f('0x2c')],qs[_0xbf6f('0x32')](_0x53c523[_0xbf6f('0x2d')][_0xbf6f('0x32')]));_0x5cbc5f[_0xbf6f('0x30')]=_0x5cbc5f[_0xbf6f('0x30')]['length']?_0x5cbc5f[_0xbf6f('0x30')]:_0x3718a3[_0xbf6f('0x2c')];if(_0x53c523['query'][_0xbf6f('0x3d')]){_0x5cbc5f[_0xbf6f('0x3e')]=[{'all':!![]}];}_0x5cbc5f=_[_0xbf6f('0x39')]({},_0x5cbc5f,_0x53c523[_0xbf6f('0x3b')]);return db['FaxQueueReport'][_0xbf6f('0x44')](_0x5cbc5f)['then'](handleEntityNotFound(_0x1c8ffa,null))[_0xbf6f('0x22')](respondWithResult(_0x1c8ffa,null))[_0xbf6f('0x41')](handleError(_0x1c8ffa,null));};exports[_0xbf6f('0x45')]=function(_0x2e322e,_0x197664){return db['FaxQueueReport'][_0xbf6f('0x45')](_0x2e322e[_0xbf6f('0x46')],{})[_0xbf6f('0x22')](respondWithResult(_0x197664,0xc9))[_0xbf6f('0x41')](handleError(_0x197664,null));};exports['update']=function(_0x58ff77,_0x3b62e5){if(_0x58ff77[_0xbf6f('0x46')]['id']){delete _0x58ff77[_0xbf6f('0x46')]['id'];}return db[_0xbf6f('0x3c')][_0xbf6f('0x44')]({'where':{'id':_0x58ff77[_0xbf6f('0x43')]['id']}})[_0xbf6f('0x22')](handleEntityNotFound(_0x3b62e5,null))[_0xbf6f('0x22')](saveUpdates(_0x58ff77[_0xbf6f('0x46')],null))[_0xbf6f('0x22')](respondWithResult(_0x3b62e5,null))[_0xbf6f('0x41')](handleError(_0x3b62e5,null));};exports[_0xbf6f('0x21')]=function(_0x138225,_0x4a293){return db[_0xbf6f('0x3c')][_0xbf6f('0x44')]({'where':{'id':_0x138225[_0xbf6f('0x43')]['id']}})[_0xbf6f('0x22')](handleEntityNotFound(_0x4a293,null))[_0xbf6f('0x22')](removeEntity(_0x4a293,null))[_0xbf6f('0x41')](handleError(_0x4a293,null));};exports[_0xbf6f('0x47')]=function(_0xa5edf3,_0x4cfb2f){return db[_0xbf6f('0x3c')][_0xbf6f('0x47')]()['then'](respondWithResult(_0x4cfb2f,null))[_0xbf6f('0x41')](handleError(_0x4cfb2f,null));}; \ No newline at end of file +var _0x13c0=['sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','destroy','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x1e78bc,_0x31007a){var _0x2ab75b=function(_0x369400){while(--_0x369400){_0x1e78bc['push'](_0x1e78bc['shift']());}};_0x2ab75b(++_0x31007a);}(_0x13c0,0x79));var _0x013c=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x13c0[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x013c('0x0'));var rimraf=require(_0x013c('0x1'));var zipdir=require(_0x013c('0x2'));var jsonpatch=require(_0x013c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x013c('0x4'));var util=require(_0x013c('0x5'));var path=require(_0x013c('0x6'));var sox=require(_0x013c('0x7'));var csv=require(_0x013c('0x8'));var ejs=require(_0x013c('0x9'));var fs=require('fs');var fs_extra=require(_0x013c('0xa'));var _=require(_0x013c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x013c('0xc'));var toCsv=require(_0x013c('0x8'));var querystring=require('querystring');var Papa=require(_0x013c('0xd'));var Redis=require(_0x013c('0xe'));var authService=require(_0x013c('0xf'));var qs=require(_0x013c('0x10'));var as=require(_0x013c('0x11'));var hardwareService=require(_0x013c('0x12'));var logger=require(_0x013c('0x13'))(_0x013c('0x14'));var utils=require(_0x013c('0x15'));var config=require(_0x013c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce456f,_0x4631c5){_0x4631c5=_0x4631c5||0xcc;return function(_0x1ee348){if(_0x1ee348){return _0xce456f[_0x013c('0x17')](_0x4631c5);}return _0xce456f['status'](_0x4631c5)[_0x013c('0x18')]();};}function respondWithResult(_0x2313de,_0xcfe81a){_0xcfe81a=_0xcfe81a||0xc8;return function(_0x17b085){if(_0x17b085){return _0x2313de[_0x013c('0x19')](_0xcfe81a)['json'](_0x17b085);}};}function respondWithFilteredResult(_0x307f34,_0x1c2e11){return function(_0x84244){if(_0x84244){var _0x92c3ca=typeof _0x1c2e11[_0x013c('0x1a')]===_0x013c('0x1b')&&typeof _0x1c2e11[_0x013c('0x1c')]===_0x013c('0x1b');var _0x246f11=_0x84244[_0x013c('0x1d')];var _0x34d59f=_0x92c3ca?0x0:_0x1c2e11[_0x013c('0x1a')];var _0x25eb26=_0x92c3ca?_0x84244['count']:_0x1c2e11['offset']+_0x1c2e11[_0x013c('0x1c')];var _0x153b0a;if(_0x25eb26>=_0x246f11){_0x25eb26=_0x246f11;_0x153b0a=0xc8;}else{_0x153b0a=0xce;}_0x307f34['status'](_0x153b0a);return _0x307f34[_0x013c('0x1e')](_0x013c('0x1f'),_0x34d59f+'-'+_0x25eb26+'/'+_0x246f11)[_0x013c('0x20')](_0x84244);}return null;};}function patchUpdates(_0x38bac2){return function(_0xb87452){try{jsonpatch['apply'](_0xb87452,_0x38bac2,!![]);}catch(_0xb039bc){return BPromise[_0x013c('0x21')](_0xb039bc);}return _0xb87452['save']();};}function saveUpdates(_0x1df9d2,_0x82f9f1){return function(_0x53fbbd){if(_0x53fbbd){return _0x53fbbd['update'](_0x1df9d2)[_0x013c('0x22')](function(_0x1996e6){return _0x1996e6;});}return null;};}function removeEntity(_0x2509f4,_0x447c0b){return function(_0x20aff2){if(_0x20aff2){return _0x20aff2[_0x013c('0x23')]()[_0x013c('0x22')](function(){_0x2509f4[_0x013c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x468fe7,_0x187fd4){return function(_0x1952d0){if(!_0x1952d0){_0x468fe7[_0x013c('0x17')](0x194);}return _0x1952d0;};}function handleError(_0x2c7a76,_0x3cd072){_0x3cd072=_0x3cd072||0x1f4;return function(_0x584ddf){logger[_0x013c('0x24')](_0x584ddf[_0x013c('0x25')]);if(_0x584ddf[_0x013c('0x26')]){delete _0x584ddf['name'];}_0x2c7a76[_0x013c('0x19')](_0x3cd072)['send'](_0x584ddf);};}exports[_0x013c('0x27')]=function(_0x455b88,_0x5534ee){var _0x353cb7={},_0x32da8c={},_0x16cdad={'count':0x0,'rows':[]};var _0x43dc43=_[_0x013c('0x28')](db[_0x013c('0x29')][_0x013c('0x2a')],function(_0x1f0aab){return{'name':_0x1f0aab[_0x013c('0x2b')],'type':_0x1f0aab[_0x013c('0x2c')]['key']};});_0x32da8c[_0x013c('0x2d')]=_[_0x013c('0x28')](_0x43dc43,_0x013c('0x26'));_0x32da8c[_0x013c('0x2e')]=_[_0x013c('0x2f')](_0x455b88['query']);_0x32da8c[_0x013c('0x30')]=_[_0x013c('0x31')](_0x32da8c[_0x013c('0x2d')],_0x32da8c[_0x013c('0x2e')]);_0x353cb7['attributes']=_['intersection'](_0x32da8c['model'],qs[_0x013c('0x32')](_0x455b88[_0x013c('0x2e')][_0x013c('0x32')]));_0x353cb7[_0x013c('0x33')]=_0x353cb7[_0x013c('0x33')][_0x013c('0x34')]?_0x353cb7[_0x013c('0x33')]:_0x32da8c[_0x013c('0x2d')];if(!_0x455b88[_0x013c('0x2e')][_0x013c('0x35')](_0x013c('0x36'))){_0x353cb7[_0x013c('0x1c')]=qs['limit'](_0x455b88['query'][_0x013c('0x1c')]);_0x353cb7[_0x013c('0x1a')]=qs[_0x013c('0x1a')](_0x455b88[_0x013c('0x2e')]['offset']);}_0x353cb7[_0x013c('0x37')]=qs[_0x013c('0x38')](_0x455b88[_0x013c('0x2e')][_0x013c('0x38')]);_0x353cb7['where']=qs[_0x013c('0x30')](_[_0x013c('0x39')](_0x455b88['query'],_0x32da8c[_0x013c('0x30')]),_0x43dc43);if(_0x455b88['query'][_0x013c('0x3a')]){_0x353cb7[_0x013c('0x3b')]=_[_0x013c('0x3c')](_0x353cb7[_0x013c('0x3b')],{'$or':_['map'](_0x43dc43,function(_0x3f2fda){if(_0x3f2fda[_0x013c('0x2c')]!==_0x013c('0x3d')){var _0x2f6044={};_0x2f6044[_0x3f2fda[_0x013c('0x26')]]={'$like':'%'+_0x455b88[_0x013c('0x2e')][_0x013c('0x3a')]+'%'};return _0x2f6044;}})});}_0x353cb7=_[_0x013c('0x3c')]({},_0x353cb7,_0x455b88[_0x013c('0x3e')]);var _0x4bd189={'where':_0x353cb7[_0x013c('0x3b')]};return db[_0x013c('0x29')]['count'](_0x4bd189)[_0x013c('0x22')](function(_0x1cf2e5){_0x16cdad['count']=_0x1cf2e5;if(_0x455b88[_0x013c('0x2e')][_0x013c('0x3f')]){_0x353cb7[_0x013c('0x40')]=[{'all':!![]}];}return db[_0x013c('0x29')][_0x013c('0x41')](_0x353cb7);})['then'](function(_0x3d0ffd){_0x16cdad['rows']=_0x3d0ffd;return _0x16cdad;})['then'](respondWithFilteredResult(_0x5534ee,_0x353cb7))['catch'](handleError(_0x5534ee,null));};exports['show']=function(_0xc25f45,_0x3d7790){var _0x370a0b={'raw':!![],'where':{'id':_0xc25f45[_0x013c('0x42')]['id']}},_0x49db0c={};_0x49db0c[_0x013c('0x2d')]=_[_0x013c('0x2f')](db[_0x013c('0x29')][_0x013c('0x2a')]);_0x49db0c['query']=_[_0x013c('0x2f')](_0xc25f45[_0x013c('0x2e')]);_0x49db0c['filters']=_['intersection'](_0x49db0c['model'],_0x49db0c['query']);_0x370a0b[_0x013c('0x33')]=_[_0x013c('0x31')](_0x49db0c['model'],qs[_0x013c('0x32')](_0xc25f45[_0x013c('0x2e')]['fields']));_0x370a0b[_0x013c('0x33')]=_0x370a0b[_0x013c('0x33')][_0x013c('0x34')]?_0x370a0b[_0x013c('0x33')]:_0x49db0c[_0x013c('0x2d')];if(_0xc25f45[_0x013c('0x2e')][_0x013c('0x3f')]){_0x370a0b[_0x013c('0x40')]=[{'all':!![]}];}_0x370a0b=_['merge']({},_0x370a0b,_0xc25f45[_0x013c('0x3e')]);return db['FaxQueueReport'][_0x013c('0x43')](_0x370a0b)['then'](handleEntityNotFound(_0x3d7790,null))['then'](respondWithResult(_0x3d7790,null))[_0x013c('0x44')](handleError(_0x3d7790,null));};exports['create']=function(_0x21cc50,_0x35f81){return db[_0x013c('0x29')][_0x013c('0x45')](_0x21cc50['body'],{})['then'](respondWithResult(_0x35f81,0xc9))['catch'](handleError(_0x35f81,null));};exports['update']=function(_0x7f4350,_0x5daeda){if(_0x7f4350[_0x013c('0x46')]['id']){delete _0x7f4350[_0x013c('0x46')]['id'];}return db[_0x013c('0x29')][_0x013c('0x43')]({'where':{'id':_0x7f4350[_0x013c('0x42')]['id']}})[_0x013c('0x22')](handleEntityNotFound(_0x5daeda,null))[_0x013c('0x22')](saveUpdates(_0x7f4350[_0x013c('0x46')],null))[_0x013c('0x22')](respondWithResult(_0x5daeda,null))['catch'](handleError(_0x5daeda,null));};exports[_0x013c('0x23')]=function(_0x5163d8,_0x4ebad8){return db[_0x013c('0x29')]['find']({'where':{'id':_0x5163d8['params']['id']}})[_0x013c('0x22')](handleEntityNotFound(_0x4ebad8,null))[_0x013c('0x22')](removeEntity(_0x4ebad8,null))['catch'](handleError(_0x4ebad8,null));};exports[_0x013c('0x47')]=function(_0x369e6a,_0x33bbe8){return db['FaxQueueReport'][_0x013c('0x47')]()[_0x013c('0x22')](respondWithResult(_0x33bbe8,null))[_0x013c('0x44')](handleError(_0x33bbe8,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 7c59844..3b0dbd9 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x4ec008,_0x39fe21){var _0x3bf9a5=function(_0x99664c){while(--_0x99664c){_0x4ec008['push'](_0x4ec008['shift']());}};_0x3bf9a5(++_0x39fe21);}(_0x7a54,0x106));var _0x47a5=function(_0xea342b,_0x49aeed){_0xea342b=_0xea342b-0x0;var _0x55737a=_0x7a54[_0xea342b];return _0x55737a;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x2e788b,_0x44a596){var _0xd0cac5=function(_0x54fa4c){while(--_0x54fa4c){_0x2e788b['push'](_0x2e788b['shift']());}};_0xd0cac5(++_0x44a596);}(_0x1261,0x144));var _0x1126=function(_0xed01eb,_0x275edb){_0xed01eb=_0xed01eb-0x0;var _0x25b9de=_0x1261[_0xed01eb];return _0x25b9de;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7dd6c92..a6e3d29 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 _0x91a6=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','UpdateFaxQueueReport','body','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x18b703,_0x45dcdf){var _0xaa158f=function(_0x4f8a91){while(--_0x4f8a91){_0x18b703['push'](_0x18b703['shift']());}};_0xaa158f(++_0x45dcdf);}(_0x91a6,0x142));var _0x691a=function(_0x2a3f58,_0x47f168){_0x2a3f58=_0x2a3f58-0x0;var _0x50a9c1=_0x91a6[_0x2a3f58];return _0x50a9c1;};'use strict';var _=require('lodash');var util=require(_0x691a('0x0'));var moment=require('moment');var BPromise=require(_0x691a('0x1'));var rs=require(_0x691a('0x2'));var fs=require('fs');var Redis=require(_0x691a('0x3'));var db=require(_0x691a('0x4'))['db'];var utils=require(_0x691a('0x5'));var logger=require(_0x691a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x691a('0x7')][_0x691a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b5ff6,_0xa4227c,_0x45221d){return new BPromise(function(_0xb97965,_0x3e06d6){return client[_0x691a('0x9')](_0x5b5ff6,_0x45221d)[_0x691a('0xa')](function(_0xa5827){logger[_0x691a('0xb')](_0x691a('0xc'),_0xa4227c,_0x691a('0xd'));logger[_0x691a('0xe')](_0x691a('0xf'),_0xa4227c,_0x691a('0xd'),JSON[_0x691a('0x10')](_0xa5827));if(_0xa5827['error']){if(_0xa5827[_0x691a('0x11')]['code']===0x1f4){logger[_0x691a('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0xa4227c,_0xa5827[_0x691a('0x11')][_0x691a('0x12')]);return _0x3e06d6(_0xa5827['error'][_0x691a('0x12')]);}logger['error'](_0x691a('0xc'),_0xa4227c,_0xa5827[_0x691a('0x11')]['message']);return _0xb97965(_0xa5827[_0x691a('0x11')][_0x691a('0x12')]);}else{logger[_0x691a('0xb')](_0x691a('0xc'),_0xa4227c,_0x691a('0xd'));_0xb97965(_0xa5827['result'][_0x691a('0x12')]);}})[_0x691a('0x13')](function(_0x5501a6){logger[_0x691a('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0xa4227c,_0x5501a6);_0x3e06d6(_0x5501a6);});});}exports[_0x691a('0x14')]=function(_0x4adc9d){var _0x56d2bd=this;return new Promise(function(_0x4bcbac,_0x65ddc3){return db[_0x691a('0x15')][_0x691a('0x16')](_0x4adc9d['body'],{'raw':_0x4adc9d[_0x691a('0x17')]?_0x4adc9d[_0x691a('0x17')][_0x691a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x29eeae){logger['info'](_0x691a('0x14'),_0x4adc9d);logger[_0x691a('0xe')](_0x691a('0x14'),_0x4adc9d,JSON['stringify'](_0x29eeae));_0x4bcbac(_0x29eeae);})['catch'](function(_0x2d4f66){logger['error'](_0x691a('0x14'),_0x2d4f66['message'],_0x4adc9d);_0x65ddc3(_0x56d2bd[_0x691a('0x11')](0x1f4,_0x2d4f66[_0x691a('0x12')]));});});};exports[_0x691a('0x19')]=function(_0x3bdcd5){var _0x2de0a7=this;return new Promise(function(_0x4f498f,_0x3a278e){return db[_0x691a('0x15')]['update'](_0x3bdcd5[_0x691a('0x1a')],{'raw':_0x3bdcd5[_0x691a('0x17')]?_0x3bdcd5[_0x691a('0x17')][_0x691a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bdcd5[_0x691a('0x17')]?_0x3bdcd5['options'][_0x691a('0x1b')]||null:null,'attributes':_0x3bdcd5[_0x691a('0x17')]?_0x3bdcd5[_0x691a('0x17')]['attributes']||null:null,'limit':_0x3bdcd5[_0x691a('0x17')]?_0x3bdcd5[_0x691a('0x17')]['limit']||null:null})[_0x691a('0xa')](function(_0xc5ac37){logger[_0x691a('0xb')](_0x691a('0x19'),_0x3bdcd5);logger[_0x691a('0xe')](_0x691a('0x19'),_0x3bdcd5,JSON[_0x691a('0x10')](_0xc5ac37));_0x4f498f(_0xc5ac37);})[_0x691a('0x13')](function(_0x16e65e){logger['error'](_0x691a('0x19'),_0x16e65e[_0x691a('0x12')],_0x3bdcd5);_0x3a278e(_0x2de0a7[_0x691a('0x11')](0x1f4,_0x16e65e[_0x691a('0x12')]));});});}; \ No newline at end of file +var _0x0c43=['jayson/promise','client','request','then','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','UpdateFaxQueueReport','update','raw','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x146d43,_0x527a1e){var _0xd5e858=function(_0x4adfde){while(--_0x4adfde){_0x146d43['push'](_0x146d43['shift']());}};_0xd5e858(++_0x527a1e);}(_0x0c43,0x118));var _0x30c4=function(_0x14e798,_0x34721b){_0x14e798=_0x14e798-0x0;var _0x41551a=_0x0c43[_0x14e798];return _0x41551a;};'use strict';var _=require(_0x30c4('0x0'));var util=require('util');var moment=require(_0x30c4('0x1'));var BPromise=require(_0x30c4('0x2'));var rs=require(_0x30c4('0x3'));var fs=require('fs');var Redis=require(_0x30c4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x30c4('0x5'))(_0x30c4('0x6'));var config=require(_0x30c4('0x7'));var jayson=require(_0x30c4('0x8'));var client=jayson[_0x30c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1107d2,_0x47117a,_0x1424ac){return new BPromise(function(_0x5881ed,_0xa582e1){return client[_0x30c4('0xa')](_0x1107d2,_0x1424ac)[_0x30c4('0xb')](function(_0xcd388f){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x47117a,'request\x20sent');logger[_0x30c4('0xc')](_0x30c4('0xd'),_0x47117a,_0x30c4('0xe'),JSON[_0x30c4('0xf')](_0xcd388f));if(_0xcd388f[_0x30c4('0x10')]){if(_0xcd388f['error'][_0x30c4('0x11')]===0x1f4){logger[_0x30c4('0x10')](_0x30c4('0x12'),_0x47117a,_0xcd388f[_0x30c4('0x10')][_0x30c4('0x13')]);return _0xa582e1(_0xcd388f[_0x30c4('0x10')]['message']);}logger[_0x30c4('0x10')](_0x30c4('0x12'),_0x47117a,_0xcd388f[_0x30c4('0x10')][_0x30c4('0x13')]);return _0x5881ed(_0xcd388f[_0x30c4('0x10')][_0x30c4('0x13')]);}else{logger[_0x30c4('0x14')](_0x30c4('0x12'),_0x47117a,'request\x20sent');_0x5881ed(_0xcd388f[_0x30c4('0x15')][_0x30c4('0x13')]);}})[_0x30c4('0x16')](function(_0x45c405){logger[_0x30c4('0x10')](_0x30c4('0x12'),_0x47117a,_0x45c405);_0xa582e1(_0x45c405);});});}exports[_0x30c4('0x17')]=function(_0x52876e){var _0x183262=this;return new Promise(function(_0x5603ea,_0x5f5086){return db[_0x30c4('0x18')]['create'](_0x52876e[_0x30c4('0x19')],{'raw':_0x52876e['options']?_0x52876e[_0x30c4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x30c4('0xb')](function(_0x4bcc3c){logger['info'](_0x30c4('0x17'),_0x52876e);logger[_0x30c4('0xc')](_0x30c4('0x17'),_0x52876e,JSON['stringify'](_0x4bcc3c));_0x5603ea(_0x4bcc3c);})[_0x30c4('0x16')](function(_0x421c19){logger[_0x30c4('0x10')]('CreateFaxQueueReport',_0x421c19[_0x30c4('0x13')],_0x52876e);_0x5f5086(_0x183262[_0x30c4('0x10')](0x1f4,_0x421c19[_0x30c4('0x13')]));});});};exports[_0x30c4('0x1b')]=function(_0x24c9d2){var _0xf88cb6=this;return new Promise(function(_0x4dd116,_0x19cbaf){return db['FaxQueueReport'][_0x30c4('0x1c')](_0x24c9d2['body'],{'raw':_0x24c9d2[_0x30c4('0x1a')]?_0x24c9d2[_0x30c4('0x1a')][_0x30c4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24c9d2[_0x30c4('0x1a')]?_0x24c9d2[_0x30c4('0x1a')][_0x30c4('0x1e')]||null:null,'attributes':_0x24c9d2['options']?_0x24c9d2[_0x30c4('0x1a')]['attributes']||null:null,'limit':_0x24c9d2['options']?_0x24c9d2[_0x30c4('0x1a')][_0x30c4('0x1f')]||null:null})[_0x30c4('0xb')](function(_0x3b33c4){logger[_0x30c4('0x14')]('UpdateFaxQueueReport',_0x24c9d2);logger[_0x30c4('0xc')](_0x30c4('0x1b'),_0x24c9d2,JSON[_0x30c4('0xf')](_0x3b33c4));_0x4dd116(_0x3b33c4);})[_0x30c4('0x16')](function(_0x308cbc){logger[_0x30c4('0x10')](_0x30c4('0x1b'),_0x308cbc[_0x30c4('0x13')],_0x24c9d2);_0x19cbaf(_0xf88cb6[_0x30c4('0x10')](0x1f4,_0x308cbc[_0x30c4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 986d4c6..4d0ec70 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 _0xd872=['post','put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3e21c4,_0x9aac03){var _0x44b8a9=function(_0x4d758d){while(--_0x4d758d){_0x3e21c4['push'](_0x3e21c4['shift']());}};_0x44b8a9(++_0x9aac03);}(_0xd872,0x158));var _0x2d87=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd872[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2d87('0x0'));var util=require(_0x2d87('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2d87('0x2'));var router=express[_0x2d87('0x3')]();var fs_extra=require(_0x2d87('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2d87('0x5'));var config=require(_0x2d87('0x6'));var controller=require('./faxQueueReport.controller');router[_0x2d87('0x7')]('/',auth[_0x2d87('0x8')](),controller[_0x2d87('0x9')]);router[_0x2d87('0x7')](_0x2d87('0xa'),auth[_0x2d87('0x8')](),controller[_0x2d87('0xb')]);router[_0x2d87('0x7')](_0x2d87('0xc'),auth[_0x2d87('0x8')](),controller['show']);router[_0x2d87('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2d87('0xe')]('/:id',auth[_0x2d87('0x8')](),controller[_0x2d87('0xf')]);router[_0x2d87('0x10')](_0x2d87('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x485e=['fs-extra','../../components/auth/service','./faxQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x43b21d,_0x5d5677){var _0x1de400=function(_0x405b75){while(--_0x405b75){_0x43b21d['push'](_0x43b21d['shift']());}};_0x1de400(++_0x5d5677);}(_0x485e,0x1f4));var _0xe485=function(_0x39ea42,_0x3c1f50){_0x39ea42=_0x39ea42-0x0;var _0x33f5b7=_0x485e[_0x39ea42];return _0x33f5b7;};'use strict';var multer=require(_0xe485('0x0'));var util=require(_0xe485('0x1'));var path=require(_0xe485('0x2'));var timeout=require(_0xe485('0x3'));var express=require(_0xe485('0x4'));var router=express[_0xe485('0x5')]();var fs_extra=require(_0xe485('0x6'));var auth=require(_0xe485('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe485('0x8'));router[_0xe485('0x9')]('/',auth['isAuthenticated'](),controller[_0xe485('0xa')]);router[_0xe485('0x9')](_0xe485('0xb'),auth[_0xe485('0xc')](),controller['describe']);router['get'](_0xe485('0xd'),auth[_0xe485('0xc')](),controller[_0xe485('0xe')]);router[_0xe485('0xf')]('/',auth[_0xe485('0xc')](),controller[_0xe485('0x10')]);router[_0xe485('0x11')](_0xe485('0xd'),auth[_0xe485('0xc')](),controller[_0xe485('0x12')]);router[_0xe485('0x13')]('/:id',auth[_0xe485('0xc')](),controller[_0xe485('0x14')]);module[_0xe485('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 2c9f204..88a5f3d 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3db2a6,_0x6ba4ec){var _0x4ec069=function(_0x5cfa88){while(--_0x5cfa88){_0x3db2a6['push'](_0x3db2a6['shift']());}};_0x4ec069(++_0x6ba4ec);}(_0xedd9,0xfc));var _0x9edd=function(_0x43e850,_0x3dcde3){_0x43e850=_0x43e850-0x0;var _0xd4bf16=_0xedd9[_0x43e850];return _0xd4bf16;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x35cec5,_0x3c6718){_0x35cec5=_0x35cec5-0x0;var _0x53fabd=_0xb43b[_0x35cec5];return _0x53fabd;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index cfbc343..483a895 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 _0x3c02=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','then','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','nolimit','limit','order','pick','filter','VIRTUAL','where','includeAll','include','rows','catch','show','keys','fields','merge','options','create','find','params','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c02,0x120));var _0x23c0=function(_0x17f5e5,_0x5a52de){_0x17f5e5=_0x17f5e5-0x0;var _0x5b7465=_0x3c02[_0x17f5e5];return _0x5b7465;};'use strict';var emlformat=require(_0x23c0('0x0'));var rimraf=require(_0x23c0('0x1'));var zipdir=require(_0x23c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23c0('0x3'));var moment=require(_0x23c0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x23c0('0x5'));var util=require(_0x23c0('0x6'));var path=require(_0x23c0('0x7'));var sox=require('sox');var csv=require(_0x23c0('0x8'));var ejs=require(_0x23c0('0x9'));var fs=require('fs');var fs_extra=require(_0x23c0('0xa'));var _=require(_0x23c0('0xb'));var squel=require(_0x23c0('0xc'));var crypto=require(_0x23c0('0xd'));var jsforce=require(_0x23c0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x23c0('0xf'));var Papa=require(_0x23c0('0x10'));var Redis=require(_0x23c0('0x11'));var authService=require(_0x23c0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x23c0('0x13'));var hardwareService=require(_0x23c0('0x14'));var logger=require(_0x23c0('0x15'))('api');var utils=require(_0x23c0('0x16'));var config=require(_0x23c0('0x17'));var licenseUtil=require(_0x23c0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d61cc,_0x13a922){_0x13a922=_0x13a922||0xcc;return function(_0x25d66d){if(_0x25d66d){return _0x3d61cc[_0x23c0('0x19')](_0x13a922);}return _0x3d61cc[_0x23c0('0x1a')](_0x13a922)[_0x23c0('0x1b')]();};}function respondWithResult(_0x36eded,_0x385048){_0x385048=_0x385048||0xc8;return function(_0x3932e2){if(_0x3932e2){return _0x36eded[_0x23c0('0x1a')](_0x385048)[_0x23c0('0x1c')](_0x3932e2);}};}function respondWithFilteredResult(_0x3f76c8,_0x88d492){return function(_0x406da){if(_0x406da){var _0x35cb9c=typeof _0x88d492[_0x23c0('0x1d')]===_0x23c0('0x1e')&&typeof _0x88d492['limit']==='undefined';var _0x3d8262=_0x406da[_0x23c0('0x1f')];var _0xf609a2=_0x35cb9c?0x0:_0x88d492['offset'];var _0x38582b=_0x35cb9c?_0x406da[_0x23c0('0x1f')]:_0x88d492[_0x23c0('0x1d')]+_0x88d492['limit'];var _0x34bb6b;if(_0x38582b>=_0x3d8262){_0x38582b=_0x3d8262;_0x34bb6b=0xc8;}else{_0x34bb6b=0xce;}_0x3f76c8['status'](_0x34bb6b);return _0x3f76c8[_0x23c0('0x20')]('Content-Range',_0xf609a2+'-'+_0x38582b+'/'+_0x3d8262)[_0x23c0('0x1c')](_0x406da);}return null;};}function patchUpdates(_0x357754){return function(_0x59f5a5){try{jsonpatch[_0x23c0('0x21')](_0x59f5a5,_0x357754,!![]);}catch(_0xb040ba){return BPromise[_0x23c0('0x22')](_0xb040ba);}return _0x59f5a5['save']();};}function saveUpdates(_0x2feae3,_0x16de9e){return function(_0xc7073f){if(_0xc7073f){return _0xc7073f[_0x23c0('0x23')](_0x2feae3)[_0x23c0('0x24')](function(_0x8b422b){return _0x8b422b;});}return null;};}function removeEntity(_0x390785,_0x357b81){return function(_0x1147e2){if(_0x1147e2){return _0x1147e2['destroy']()[_0x23c0('0x24')](function(){_0x390785[_0x23c0('0x1a')](0xcc)[_0x23c0('0x1b')]();});}};}function handleEntityNotFound(_0x3b1a83,_0x2b0570){return function(_0xf4f1f0){if(!_0xf4f1f0){_0x3b1a83[_0x23c0('0x19')](0x194);}return _0xf4f1f0;};}function handleError(_0x1d7990,_0x49a42f){_0x49a42f=_0x49a42f||0x1f4;return function(_0x27ebb0){logger[_0x23c0('0x25')](_0x27ebb0[_0x23c0('0x26')]);if(_0x27ebb0[_0x23c0('0x27')]){delete _0x27ebb0[_0x23c0('0x27')];}_0x1d7990['status'](_0x49a42f)['send'](_0x27ebb0);};}exports[_0x23c0('0x28')]=function(_0x5f2a45,_0x246eae){var _0x4b9fb8={},_0x32836f={},_0x5c60be={'count':0x0,'rows':[]};var _0x388c78=_[_0x23c0('0x29')](db[_0x23c0('0x2a')][_0x23c0('0x2b')],function(_0x34e77d){return{'name':_0x34e77d[_0x23c0('0x2c')],'type':_0x34e77d[_0x23c0('0x2d')]['key']};});_0x32836f['model']=_['map'](_0x388c78,_0x23c0('0x27'));_0x32836f[_0x23c0('0x2e')]=_['keys'](_0x5f2a45[_0x23c0('0x2e')]);_0x32836f[_0x23c0('0x2f')]=_[_0x23c0('0x30')](_0x32836f[_0x23c0('0x31')],_0x32836f[_0x23c0('0x2e')]);_0x4b9fb8[_0x23c0('0x32')]=_[_0x23c0('0x30')](_0x32836f['model'],qs['fields'](_0x5f2a45[_0x23c0('0x2e')]['fields']));_0x4b9fb8['attributes']=_0x4b9fb8[_0x23c0('0x32')][_0x23c0('0x33')]?_0x4b9fb8[_0x23c0('0x32')]:_0x32836f[_0x23c0('0x31')];if(!_0x5f2a45[_0x23c0('0x2e')]['hasOwnProperty'](_0x23c0('0x34'))){_0x4b9fb8[_0x23c0('0x35')]=qs['limit'](_0x5f2a45[_0x23c0('0x2e')]['limit']);_0x4b9fb8[_0x23c0('0x1d')]=qs['offset'](_0x5f2a45[_0x23c0('0x2e')]['offset']);}_0x4b9fb8[_0x23c0('0x36')]=qs['sort'](_0x5f2a45[_0x23c0('0x2e')]['sort']);_0x4b9fb8['where']=qs['filters'](_[_0x23c0('0x37')](_0x5f2a45[_0x23c0('0x2e')],_0x32836f['filters']),_0x388c78);if(_0x5f2a45[_0x23c0('0x2e')][_0x23c0('0x38')]){_0x4b9fb8['where']=_['merge'](_0x4b9fb8['where'],{'$or':_[_0x23c0('0x29')](_0x388c78,function(_0x1b1158){if(_0x1b1158[_0x23c0('0x2d')]!==_0x23c0('0x39')){var _0x3ce7e1={};_0x3ce7e1[_0x1b1158[_0x23c0('0x27')]]={'$like':'%'+_0x5f2a45[_0x23c0('0x2e')][_0x23c0('0x38')]+'%'};return _0x3ce7e1;}})});}_0x4b9fb8=_['merge']({},_0x4b9fb8,_0x5f2a45['options']);var _0x4552b8={'where':_0x4b9fb8[_0x23c0('0x3a')]};return db[_0x23c0('0x2a')][_0x23c0('0x1f')](_0x4552b8)[_0x23c0('0x24')](function(_0x30618e){_0x5c60be[_0x23c0('0x1f')]=_0x30618e;if(_0x5f2a45['query'][_0x23c0('0x3b')]){_0x4b9fb8[_0x23c0('0x3c')]=[{'all':!![]}];}return db[_0x23c0('0x2a')]['findAll'](_0x4b9fb8);})[_0x23c0('0x24')](function(_0x18087c){_0x5c60be[_0x23c0('0x3d')]=_0x18087c;return _0x5c60be;})[_0x23c0('0x24')](respondWithFilteredResult(_0x246eae,_0x4b9fb8))[_0x23c0('0x3e')](handleError(_0x246eae,null));};exports[_0x23c0('0x3f')]=function(_0x55d577,_0x59ed28){var _0x57f746={'raw':!![],'where':{'id':_0x55d577['params']['id']}},_0x17894d={};_0x17894d[_0x23c0('0x31')]=_[_0x23c0('0x40')](db[_0x23c0('0x2a')][_0x23c0('0x2b')]);_0x17894d[_0x23c0('0x2e')]=_['keys'](_0x55d577[_0x23c0('0x2e')]);_0x17894d[_0x23c0('0x2f')]=_[_0x23c0('0x30')](_0x17894d[_0x23c0('0x31')],_0x17894d['query']);_0x57f746['attributes']=_['intersection'](_0x17894d[_0x23c0('0x31')],qs['fields'](_0x55d577['query'][_0x23c0('0x41')]));_0x57f746[_0x23c0('0x32')]=_0x57f746[_0x23c0('0x32')][_0x23c0('0x33')]?_0x57f746[_0x23c0('0x32')]:_0x17894d[_0x23c0('0x31')];if(_0x55d577['query']['includeAll']){_0x57f746['include']=[{'all':!![]}];}_0x57f746=_[_0x23c0('0x42')]({},_0x57f746,_0x55d577[_0x23c0('0x43')]);return db['FaxTransferReport']['find'](_0x57f746)[_0x23c0('0x24')](handleEntityNotFound(_0x59ed28,null))[_0x23c0('0x24')](respondWithResult(_0x59ed28,null))[_0x23c0('0x3e')](handleError(_0x59ed28,null));};exports['create']=function(_0x53e1b6,_0x207f1b){return db[_0x23c0('0x2a')][_0x23c0('0x44')](_0x53e1b6['body'],{})[_0x23c0('0x24')](respondWithResult(_0x207f1b,0xc9))['catch'](handleError(_0x207f1b,null));};exports[_0x23c0('0x23')]=function(_0x1f1df2,_0xe4b30f){if(_0x1f1df2['body']['id']){delete _0x1f1df2['body']['id'];}return db[_0x23c0('0x2a')][_0x23c0('0x45')]({'where':{'id':_0x1f1df2[_0x23c0('0x46')]['id']}})[_0x23c0('0x24')](handleEntityNotFound(_0xe4b30f,null))['then'](saveUpdates(_0x1f1df2[_0x23c0('0x47')],null))[_0x23c0('0x24')](respondWithResult(_0xe4b30f,null))[_0x23c0('0x3e')](handleError(_0xe4b30f,null));};exports[_0x23c0('0x48')]=function(_0x2281ae,_0x26b00f){return db['FaxTransferReport'][_0x23c0('0x45')]({'where':{'id':_0x2281ae[_0x23c0('0x46')]['id']}})[_0x23c0('0x24')](handleEntityNotFound(_0x26b00f,null))['then'](removeEntity(_0x26b00f,null))[_0x23c0('0x3e')](handleError(_0x26b00f,null));};exports[_0x23c0('0x49')]=function(_0x401d12,_0x16b6e3){return db[_0x23c0('0x2a')]['describe']()[_0x23c0('0x24')](respondWithResult(_0x16b6e3,null))[_0x23c0('0x3e')](handleError(_0x16b6e3,null));}; \ No newline at end of file +var _0x9d8c=['json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','end','name','send','FaxTransferReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x2a33ab,_0x146f98){var _0x9f9b02=function(_0x55dc8c){while(--_0x55dc8c){_0x2a33ab['push'](_0x2a33ab['shift']());}};_0x9f9b02(++_0x146f98);}(_0x9d8c,0x197));var _0xc9d8=function(_0x57b86e,_0x2680b5){_0x57b86e=_0x57b86e-0x0;var _0x546790=_0x9d8c[_0x57b86e];return _0x546790;};'use strict';var emlformat=require(_0xc9d8('0x0'));var rimraf=require(_0xc9d8('0x1'));var zipdir=require(_0xc9d8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9d8('0x3'));var moment=require('moment');var BPromise=require(_0xc9d8('0x4'));var Mustache=require(_0xc9d8('0x5'));var util=require(_0xc9d8('0x6'));var path=require(_0xc9d8('0x7'));var sox=require(_0xc9d8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9d8('0x9'));var _=require(_0xc9d8('0xa'));var squel=require(_0xc9d8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc9d8('0xc'));var toCsv=require(_0xc9d8('0xd'));var querystring=require(_0xc9d8('0xe'));var Papa=require('papaparse');var Redis=require(_0xc9d8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc9d8('0x10'));var as=require(_0xc9d8('0x11'));var hardwareService=require(_0xc9d8('0x12'));var logger=require('../../config/logger')(_0xc9d8('0x13'));var utils=require(_0xc9d8('0x14'));var config=require(_0xc9d8('0x15'));var licenseUtil=require(_0xc9d8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12a376,_0x277652){_0x277652=_0x277652||0xcc;return function(_0xb0e8f3){if(_0xb0e8f3){return _0x12a376[_0xc9d8('0x17')](_0x277652);}return _0x12a376['status'](_0x277652)['end']();};}function respondWithResult(_0x55d9a7,_0x5332c6){_0x5332c6=_0x5332c6||0xc8;return function(_0x235a22){if(_0x235a22){return _0x55d9a7[_0xc9d8('0x18')](_0x5332c6)[_0xc9d8('0x19')](_0x235a22);}};}function respondWithFilteredResult(_0x5d09ee,_0x4535c8){return function(_0x589d23){if(_0x589d23){var _0x3c457=typeof _0x4535c8[_0xc9d8('0x1a')]==='undefined'&&typeof _0x4535c8[_0xc9d8('0x1b')]===_0xc9d8('0x1c');var _0x182216=_0x589d23[_0xc9d8('0x1d')];var _0x25d220=_0x3c457?0x0:_0x4535c8[_0xc9d8('0x1a')];var _0x16df98=_0x3c457?_0x589d23[_0xc9d8('0x1d')]:_0x4535c8[_0xc9d8('0x1a')]+_0x4535c8['limit'];var _0x34ce16;if(_0x16df98>=_0x182216){_0x16df98=_0x182216;_0x34ce16=0xc8;}else{_0x34ce16=0xce;}_0x5d09ee['status'](_0x34ce16);return _0x5d09ee['set'](_0xc9d8('0x1e'),_0x25d220+'-'+_0x16df98+'/'+_0x182216)[_0xc9d8('0x19')](_0x589d23);}return null;};}function patchUpdates(_0x317d8e){return function(_0x46738b){try{jsonpatch[_0xc9d8('0x1f')](_0x46738b,_0x317d8e,!![]);}catch(_0x3ca765){return BPromise[_0xc9d8('0x20')](_0x3ca765);}return _0x46738b['save']();};}function saveUpdates(_0xaf814a,_0x225a60){return function(_0x39641d){if(_0x39641d){return _0x39641d[_0xc9d8('0x21')](_0xaf814a)[_0xc9d8('0x22')](function(_0x3bd81f){return _0x3bd81f;});}return null;};}function removeEntity(_0x499526,_0x2cbb96){return function(_0x26703c){if(_0x26703c){return _0x26703c['destroy']()[_0xc9d8('0x22')](function(){_0x499526[_0xc9d8('0x18')](0xcc)[_0xc9d8('0x23')]();});}};}function handleEntityNotFound(_0x5bf82d,_0x3368d0){return function(_0x7a1bc3){if(!_0x7a1bc3){_0x5bf82d[_0xc9d8('0x17')](0x194);}return _0x7a1bc3;};}function handleError(_0x4dd9bb,_0x2be5cd){_0x2be5cd=_0x2be5cd||0x1f4;return function(_0x41008f){logger['error'](_0x41008f['stack']);if(_0x41008f[_0xc9d8('0x24')]){delete _0x41008f[_0xc9d8('0x24')];}_0x4dd9bb[_0xc9d8('0x18')](_0x2be5cd)[_0xc9d8('0x25')](_0x41008f);};}exports['index']=function(_0x4bf538,_0x31961b){var _0x1f9718={},_0x51b61b={},_0x1c9b98={'count':0x0,'rows':[]};var _0xbe40ac=_['map'](db[_0xc9d8('0x26')][_0xc9d8('0x27')],function(_0x60aeec){return{'name':_0x60aeec['fieldName'],'type':_0x60aeec[_0xc9d8('0x28')]['key']};});_0x51b61b[_0xc9d8('0x29')]=_['map'](_0xbe40ac,_0xc9d8('0x24'));_0x51b61b[_0xc9d8('0x2a')]=_[_0xc9d8('0x2b')](_0x4bf538[_0xc9d8('0x2a')]);_0x51b61b[_0xc9d8('0x2c')]=_[_0xc9d8('0x2d')](_0x51b61b[_0xc9d8('0x29')],_0x51b61b[_0xc9d8('0x2a')]);_0x1f9718[_0xc9d8('0x2e')]=_[_0xc9d8('0x2d')](_0x51b61b[_0xc9d8('0x29')],qs[_0xc9d8('0x2f')](_0x4bf538[_0xc9d8('0x2a')]['fields']));_0x1f9718['attributes']=_0x1f9718[_0xc9d8('0x2e')][_0xc9d8('0x30')]?_0x1f9718['attributes']:_0x51b61b[_0xc9d8('0x29')];if(!_0x4bf538[_0xc9d8('0x2a')][_0xc9d8('0x31')](_0xc9d8('0x32'))){_0x1f9718[_0xc9d8('0x1b')]=qs['limit'](_0x4bf538[_0xc9d8('0x2a')][_0xc9d8('0x1b')]);_0x1f9718[_0xc9d8('0x1a')]=qs[_0xc9d8('0x1a')](_0x4bf538[_0xc9d8('0x2a')][_0xc9d8('0x1a')]);}_0x1f9718[_0xc9d8('0x33')]=qs[_0xc9d8('0x34')](_0x4bf538[_0xc9d8('0x2a')]['sort']);_0x1f9718['where']=qs[_0xc9d8('0x2c')](_[_0xc9d8('0x35')](_0x4bf538[_0xc9d8('0x2a')],_0x51b61b[_0xc9d8('0x2c')]),_0xbe40ac);if(_0x4bf538[_0xc9d8('0x2a')][_0xc9d8('0x36')]){_0x1f9718[_0xc9d8('0x37')]=_[_0xc9d8('0x38')](_0x1f9718[_0xc9d8('0x37')],{'$or':_[_0xc9d8('0x39')](_0xbe40ac,function(_0x1e8c77){if(_0x1e8c77[_0xc9d8('0x28')]!==_0xc9d8('0x3a')){var _0x54b6f2={};_0x54b6f2[_0x1e8c77[_0xc9d8('0x24')]]={'$like':'%'+_0x4bf538[_0xc9d8('0x2a')][_0xc9d8('0x36')]+'%'};return _0x54b6f2;}})});}_0x1f9718=_[_0xc9d8('0x38')]({},_0x1f9718,_0x4bf538[_0xc9d8('0x3b')]);var _0x2944b9={'where':_0x1f9718['where']};return db[_0xc9d8('0x26')][_0xc9d8('0x1d')](_0x2944b9)[_0xc9d8('0x22')](function(_0x32b2ec){_0x1c9b98[_0xc9d8('0x1d')]=_0x32b2ec;if(_0x4bf538['query'][_0xc9d8('0x3c')]){_0x1f9718['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xc9d8('0x3d')](_0x1f9718);})[_0xc9d8('0x22')](function(_0x43b078){_0x1c9b98[_0xc9d8('0x3e')]=_0x43b078;return _0x1c9b98;})['then'](respondWithFilteredResult(_0x31961b,_0x1f9718))[_0xc9d8('0x3f')](handleError(_0x31961b,null));};exports[_0xc9d8('0x40')]=function(_0x4a7dbd,_0x1f326a){var _0x32c7f6={'raw':!![],'where':{'id':_0x4a7dbd[_0xc9d8('0x41')]['id']}},_0x18e51a={};_0x18e51a['model']=_[_0xc9d8('0x2b')](db[_0xc9d8('0x26')]['rawAttributes']);_0x18e51a['query']=_[_0xc9d8('0x2b')](_0x4a7dbd[_0xc9d8('0x2a')]);_0x18e51a[_0xc9d8('0x2c')]=_['intersection'](_0x18e51a[_0xc9d8('0x29')],_0x18e51a[_0xc9d8('0x2a')]);_0x32c7f6[_0xc9d8('0x2e')]=_[_0xc9d8('0x2d')](_0x18e51a['model'],qs[_0xc9d8('0x2f')](_0x4a7dbd[_0xc9d8('0x2a')]['fields']));_0x32c7f6[_0xc9d8('0x2e')]=_0x32c7f6[_0xc9d8('0x2e')][_0xc9d8('0x30')]?_0x32c7f6[_0xc9d8('0x2e')]:_0x18e51a[_0xc9d8('0x29')];if(_0x4a7dbd[_0xc9d8('0x2a')][_0xc9d8('0x3c')]){_0x32c7f6[_0xc9d8('0x42')]=[{'all':!![]}];}_0x32c7f6=_[_0xc9d8('0x38')]({},_0x32c7f6,_0x4a7dbd[_0xc9d8('0x3b')]);return db[_0xc9d8('0x26')][_0xc9d8('0x43')](_0x32c7f6)[_0xc9d8('0x22')](handleEntityNotFound(_0x1f326a,null))[_0xc9d8('0x22')](respondWithResult(_0x1f326a,null))[_0xc9d8('0x3f')](handleError(_0x1f326a,null));};exports[_0xc9d8('0x44')]=function(_0x4c947d,_0x415b68){return db[_0xc9d8('0x26')][_0xc9d8('0x44')](_0x4c947d[_0xc9d8('0x45')],{})[_0xc9d8('0x22')](respondWithResult(_0x415b68,0xc9))[_0xc9d8('0x3f')](handleError(_0x415b68,null));};exports['update']=function(_0x9547a6,_0x3d462b){if(_0x9547a6[_0xc9d8('0x45')]['id']){delete _0x9547a6['body']['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x9547a6[_0xc9d8('0x41')]['id']}})[_0xc9d8('0x22')](handleEntityNotFound(_0x3d462b,null))[_0xc9d8('0x22')](saveUpdates(_0x9547a6[_0xc9d8('0x45')],null))[_0xc9d8('0x22')](respondWithResult(_0x3d462b,null))[_0xc9d8('0x3f')](handleError(_0x3d462b,null));};exports[_0xc9d8('0x46')]=function(_0x4e85b9,_0x384d25){return db[_0xc9d8('0x26')][_0xc9d8('0x43')]({'where':{'id':_0x4e85b9['params']['id']}})[_0xc9d8('0x22')](handleEntityNotFound(_0x384d25,null))[_0xc9d8('0x22')](removeEntity(_0x384d25,null))[_0xc9d8('0x3f')](handleError(_0x384d25,null));};exports[_0xc9d8('0x47')]=function(_0x30f711,_0x4e9db6){return db['FaxTransferReport'][_0xc9d8('0x47')]()[_0xc9d8('0x22')](respondWithResult(_0x4e9db6,null))[_0xc9d8('0x3f')](handleError(_0x4e9db6,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index c743f2c..51d9235 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 _0x754b=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x9f0f4d,_0x22786d){var _0x57420d=function(_0xe88e1f){while(--_0xe88e1f){_0x9f0f4d['push'](_0x9f0f4d['shift']());}};_0x57420d(++_0x22786d);}(_0x754b,0x1ef));var _0xb754=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x754b[_0x23e6bb];return _0x1e3b4c;};'use strict';var _=require(_0xb754('0x0'));var util=require(_0xb754('0x1'));var logger=require(_0xb754('0x2'))(_0xb754('0x3'));var moment=require(_0xb754('0x4'));var BPromise=require('bluebird');var rp=require(_0xb754('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb754('0x6'));var config=require(_0xb754('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0xb754('0x8')]=function(_0x40f0ee,_0xe2bdee){return _0x40f0ee[_0xb754('0x9')](_0xb754('0xa'),attributes,{'tableName':_0xb754('0xb'),'paranoid':![],'indexes':[{'name':_0xb754('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x33d2=['moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x31b6d2,_0x55084d){var _0x123d9f=function(_0x1056ca){while(--_0x1056ca){_0x31b6d2['push'](_0x31b6d2['shift']());}};_0x123d9f(++_0x55084d);}(_0x33d2,0x7f));var _0x233d=function(_0x53955c,_0x1400fd){_0x53955c=_0x53955c-0x0;var _0x591b50=_0x33d2[_0x53955c];return _0x591b50;};'use strict';var _=require(_0x233d('0x0'));var util=require(_0x233d('0x1'));var logger=require(_0x233d('0x2'))('api');var moment=require(_0x233d('0x3'));var BPromise=require(_0x233d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x233d('0x5'));var rimraf=require(_0x233d('0x6'));var config=require(_0x233d('0x7'));var attributes=require(_0x233d('0x8'));module[_0x233d('0x9')]=function(_0x3f311b,_0x15ba43){return _0x3f311b[_0x233d('0xa')]('FaxTransferReport',attributes,{'tableName':_0x233d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x233d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 80c8d39..50b3116 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 _0x5821=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x368139,_0x32deee){var _0x569554=function(_0x598ddd){while(--_0x598ddd){_0x368139['push'](_0x368139['shift']());}};_0x569554(++_0x32deee);}(_0x5821,0x198));var _0x1582=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5821[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x1582('0x0'));var moment=require(_0x1582('0x1'));var BPromise=require(_0x1582('0x2'));var rs=require(_0x1582('0x3'));var fs=require('fs');var Redis=require(_0x1582('0x4'));var db=require(_0x1582('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1582('0x6'));var config=require(_0x1582('0x7'));var jayson=require(_0x1582('0x8'));var client=jayson[_0x1582('0x9')][_0x1582('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37ea92,_0x203cad,_0x57e679){return new BPromise(function(_0x6323e6,_0x5638e5){return client[_0x1582('0xb')](_0x37ea92,_0x57e679)[_0x1582('0xc')](function(_0x3456f0){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x203cad,_0x1582('0xd'));logger[_0x1582('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x203cad,_0x1582('0xd'),JSON[_0x1582('0xf')](_0x3456f0));if(_0x3456f0[_0x1582('0x10')]){if(_0x3456f0['error'][_0x1582('0x11')]===0x1f4){logger['error'](_0x1582('0x12'),_0x203cad,_0x3456f0['error'][_0x1582('0x13')]);return _0x5638e5(_0x3456f0[_0x1582('0x10')][_0x1582('0x13')]);}logger[_0x1582('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x203cad,_0x3456f0[_0x1582('0x10')]['message']);return _0x6323e6(_0x3456f0[_0x1582('0x10')]['message']);}else{logger[_0x1582('0x14')](_0x1582('0x12'),_0x203cad,_0x1582('0xd'));_0x6323e6(_0x3456f0[_0x1582('0x15')][_0x1582('0x13')]);}})[_0x1582('0x16')](function(_0x45f284){logger['error'](_0x1582('0x12'),_0x203cad,_0x45f284);_0x5638e5(_0x45f284);});});} \ No newline at end of file +var _0x6415=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5a70a2,_0xf1e7f9){var _0x1c88fd=function(_0x2b36f3){while(--_0x2b36f3){_0x5a70a2['push'](_0x5a70a2['shift']());}};_0x1c88fd(++_0xf1e7f9);}(_0x6415,0x16f));var _0x5641=function(_0x3c9ee2,_0x4f1ba9){_0x3c9ee2=_0x3c9ee2-0x0;var _0x30143b=_0x6415[_0x3c9ee2];return _0x30143b;};'use strict';var _=require(_0x5641('0x0'));var util=require(_0x5641('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5641('0x2'));var fs=require('fs');var Redis=require(_0x5641('0x3'));var db=require(_0x5641('0x4'))['db'];var utils=require(_0x5641('0x5'));var logger=require(_0x5641('0x6'))(_0x5641('0x7'));var config=require('../../config/environment');var jayson=require(_0x5641('0x8'));var client=jayson[_0x5641('0x9')][_0x5641('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x269f10,_0xf3487e,_0x414d71){return new BPromise(function(_0x51497f,_0x5a4d77){return client[_0x5641('0xb')](_0x269f10,_0x414d71)[_0x5641('0xc')](function(_0x37a3e0){logger[_0x5641('0xd')](_0x5641('0xe'),_0xf3487e,_0x5641('0xf'));logger[_0x5641('0x10')](_0x5641('0x11'),_0xf3487e,_0x5641('0xf'),JSON[_0x5641('0x12')](_0x37a3e0));if(_0x37a3e0[_0x5641('0x13')]){if(_0x37a3e0[_0x5641('0x13')][_0x5641('0x14')]===0x1f4){logger[_0x5641('0x13')](_0x5641('0xe'),_0xf3487e,_0x37a3e0[_0x5641('0x13')]['message']);return _0x5a4d77(_0x37a3e0[_0x5641('0x13')][_0x5641('0x15')]);}logger[_0x5641('0x13')](_0x5641('0xe'),_0xf3487e,_0x37a3e0[_0x5641('0x13')][_0x5641('0x15')]);return _0x51497f(_0x37a3e0['error'][_0x5641('0x15')]);}else{logger['info'](_0x5641('0xe'),_0xf3487e,_0x5641('0xf'));_0x51497f(_0x37a3e0[_0x5641('0x16')][_0x5641('0x15')]);}})[_0x5641('0x17')](function(_0x44ae70){logger[_0x5641('0x13')](_0x5641('0xe'),_0xf3487e,_0x44ae70);_0x5a4d77(_0x44ae70);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 2b04ddd..30b4d9e 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 _0x90e9=['/:id','show','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x90e9,0x7f));var _0x990e=function(_0xb04673,_0x33710a){_0xb04673=_0xb04673-0x0;var _0x4f9d6f=_0x90e9[_0xb04673];return _0x4f9d6f;};'use strict';var multer=require(_0x990e('0x0'));var util=require(_0x990e('0x1'));var path=require('path');var timeout=require(_0x990e('0x2'));var express=require(_0x990e('0x3'));var router=express[_0x990e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x990e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x990e('0x6'));var controller=require(_0x990e('0x7'));router[_0x990e('0x8')]('/',auth['isAuthenticated'](),controller[_0x990e('0x9')]);router[_0x990e('0x8')](_0x990e('0xa'),auth[_0x990e('0xb')](),controller[_0x990e('0xc')]);router['get'](_0x990e('0xd'),auth[_0x990e('0xb')](),controller[_0x990e('0xe')]);router[_0x990e('0xf')]('/',auth['isAuthenticated'](),controller[_0x990e('0x10')]);router['put'](_0x990e('0xd'),auth[_0x990e('0xb')](),controller[_0x990e('0x11')]);router['delete']('/:id',auth[_0x990e('0xb')](),controller[_0x990e('0x12')]);module[_0x990e('0x13')]=router; \ No newline at end of file +var _0xdfee=['get','/describe','show','post','put','/:id','update','destroy','util','path','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index'];(function(_0x1f0ded,_0x404ba6){var _0xc14076=function(_0x45d4e2){while(--_0x45d4e2){_0x1f0ded['push'](_0x1f0ded['shift']());}};_0xc14076(++_0x404ba6);}(_0xdfee,0x90));var _0xedfe=function(_0x47d7bf,_0x71a222){_0x47d7bf=_0x47d7bf-0x0;var _0x162124=_0xdfee[_0x47d7bf];return _0x162124;};'use strict';var multer=require('multer');var util=require(_0xedfe('0x0'));var path=require(_0xedfe('0x1'));var timeout=require('connect-timeout');var express=require(_0xedfe('0x2'));var router=express[_0xedfe('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xedfe('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xedfe('0x5'));var controller=require(_0xedfe('0x6'));router['get']('/',auth[_0xedfe('0x7')](),controller[_0xedfe('0x8')]);router[_0xedfe('0x9')](_0xedfe('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xedfe('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xedfe('0xb')]);router[_0xedfe('0xc')]('/',auth[_0xedfe('0x7')](),controller['create']);router[_0xedfe('0xd')](_0xedfe('0xe'),auth[_0xedfe('0x7')](),controller[_0xedfe('0xf')]);router['delete'](_0xedfe('0xe'),auth[_0xedfe('0x7')](),controller[_0xedfe('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a2bbeeb..ed81803 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 _0xbdc3=['connect-timeout','Router','fs-extra','../../config/environment','./intDeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','put','update','exports','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbdc3,0x11b));var _0x3bdc=function(_0x4caa8c,_0x5419fd){_0x4caa8c=_0x4caa8c-0x0;var _0x113217=_0xbdc3[_0x4caa8c];return _0x113217;};'use strict';var multer=require(_0x3bdc('0x0'));var util=require(_0x3bdc('0x1'));var path=require(_0x3bdc('0x2'));var timeout=require(_0x3bdc('0x3'));var express=require('express');var router=express[_0x3bdc('0x4')]();var fs_extra=require(_0x3bdc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3bdc('0x6'));var controller=require(_0x3bdc('0x7'));router[_0x3bdc('0x8')]('/',auth['isAuthenticated'](),controller[_0x3bdc('0x9')]);router[_0x3bdc('0x8')](_0x3bdc('0xa'),auth['isAuthenticated'](),controller[_0x3bdc('0xb')]);router['get'](_0x3bdc('0xc'),auth['isAuthenticated'](),controller[_0x3bdc('0xd')]);router['get'](_0x3bdc('0xe'),auth[_0x3bdc('0xf')](),controller[_0x3bdc('0x10')]);router[_0x3bdc('0x11')]('/',auth[_0x3bdc('0xf')](),controller[_0x3bdc('0x12')]);router[_0x3bdc('0x11')](_0x3bdc('0xc'),auth[_0x3bdc('0xf')](),controller['addConfiguration']);router[_0x3bdc('0x13')](_0x3bdc('0xa'),auth[_0x3bdc('0xf')](),controller[_0x3bdc('0x14')]);router['delete'](_0x3bdc('0xa'),auth[_0x3bdc('0xf')](),controller['destroy']);module[_0x3bdc('0x15')]=router; \ No newline at end of file +var _0x54af=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x54af,0xd3));var _0xf54a=function(_0x5259ec,_0x342d4c){_0x5259ec=_0x5259ec-0x0;var _0x1658c7=_0x54af[_0x5259ec];return _0x1658c7;};'use strict';var multer=require(_0xf54a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf54a('0x1'));var express=require(_0xf54a('0x2'));var router=express[_0xf54a('0x3')]();var fs_extra=require(_0xf54a('0x4'));var auth=require(_0xf54a('0x5'));var interaction=require(_0xf54a('0x6'));var config=require(_0xf54a('0x7'));var controller=require(_0xf54a('0x8'));router[_0xf54a('0x9')]('/',auth[_0xf54a('0xa')](),controller['index']);router[_0xf54a('0x9')](_0xf54a('0xb'),auth['isAuthenticated'](),controller[_0xf54a('0xc')]);router[_0xf54a('0x9')](_0xf54a('0xd'),auth[_0xf54a('0xa')](),controller[_0xf54a('0xe')]);router[_0xf54a('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf54a('0xf')]);router[_0xf54a('0x10')]('/',auth[_0xf54a('0xa')](),controller['create']);router['post'](_0xf54a('0xd'),auth['isAuthenticated'](),controller[_0xf54a('0x11')]);router[_0xf54a('0x12')](_0xf54a('0xb'),auth[_0xf54a('0xa')](),controller['update']);router[_0xf54a('0x13')](_0xf54a('0xb'),auth[_0xf54a('0xa')](),controller[_0xf54a('0x14')]);module[_0xf54a('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 26ff400..45880db 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 _0xdd33=['exports','STRING','basic','ENUM','integrationTab'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xdd33,0x9b));var _0x3dd3=function(_0x11a0ec,_0xf2da70){_0x11a0ec=_0x11a0ec-0x0;var _0x163c0d=_0xdd33[_0x11a0ec];return _0x163c0d;};'use strict';var Sequelize=require('sequelize');module[_0x3dd3('0x0')]={'name':{'type':Sequelize[_0x3dd3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3dd3('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x3dd3('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x3dd3('0x1')]},'consumerSecret':{'type':Sequelize[_0x3dd3('0x1')]},'token':{'type':Sequelize[_0x3dd3('0x1')]},'tokenSecret':{'type':Sequelize[_0x3dd3('0x1')]},'serverUrl':{'type':Sequelize[_0x3dd3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3dd3('0x3')](_0x3dd3('0x4'),'newTab'),'defaultValue':_0x3dd3('0x4')}}; \ No newline at end of file +var _0x0d14=['basic','integrationTab','sequelize','STRING','ENUM'];(function(_0x4f5b2f,_0x3401bc){var _0x5afa5d=function(_0xd9d2bd){while(--_0xd9d2bd){_0x4f5b2f['push'](_0x4f5b2f['shift']());}};_0x5afa5d(++_0x3401bc);}(_0x0d14,0x106));var _0x40d1=function(_0x206b5c,_0x4cdeb6){_0x206b5c=_0x206b5c-0x0;var _0x574a9a=_0x0d14[_0x206b5c];return _0x574a9a;};'use strict';var Sequelize=require(_0x40d1('0x0'));module['exports']={'name':{'type':Sequelize[_0x40d1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x40d1('0x1')]},'authType':{'type':Sequelize[_0x40d1('0x2')]('basic'),'defaultValue':_0x40d1('0x3')},'password':{'type':Sequelize[_0x40d1('0x1')]},'consumerKey':{'type':Sequelize[_0x40d1('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x40d1('0x1')]},'serverUrl':{'type':Sequelize[_0x40d1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x40d1('0x2')](_0x40d1('0x4'),'newTab'),'defaultValue':_0x40d1('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 5acf4c1..fd11f23 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 _0x78ba=['base64','concat','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskAccount','fieldName','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','show','params','keys','rawAttributes','intersection','length','find','catch','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','getSubjects','channel','DeskField','Descriptions','getFields','priority','authType','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','format','application/json','basic','Basic\x20%s','%s:%s','username','password','toString'];(function(_0x1673d4,_0x31b681){var _0x481d97=function(_0x31d134){while(--_0x31d134){_0x1673d4['push'](_0x1673d4['shift']());}};_0x481d97(++_0x31b681);}(_0x78ba,0xe4));var _0xa78b=function(_0x5e9202,_0x456b45){_0x5e9202=_0x5e9202-0x0;var _0x26fd05=_0x78ba[_0x5e9202];return _0x26fd05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa78b('0x0'));var jsonpatch=require(_0xa78b('0x1'));var rp=require('request-promise');var moment=require(_0xa78b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa78b('0x3'));var path=require('path');var sox=require(_0xa78b('0x4'));var csv=require(_0xa78b('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa78b('0x6'));var _=require(_0xa78b('0x7'));var squel=require('squel');var crypto=require(_0xa78b('0x8'));var jsforce=require(_0xa78b('0x9'));var deskjs=require(_0xa78b('0xa'));var toCsv=require(_0xa78b('0x5'));var querystring=require(_0xa78b('0xb'));var Papa=require(_0xa78b('0xc'));var Redis=require(_0xa78b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa78b('0xe'));var as=require(_0xa78b('0xf'));var hardwareService=require(_0xa78b('0x10'));var logger=require('../../config/logger')(_0xa78b('0x11'));var utils=require('../../config/utils');var config=require(_0xa78b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa78b('0x13'))['db'];var integrations=require(_0xa78b('0x14'));function respondWithStatusCode(_0x9fe23c,_0x3fa33){_0x3fa33=_0x3fa33||0xcc;return function(_0x28e9f3){if(_0x28e9f3){return _0x9fe23c['sendStatus'](_0x3fa33);}return _0x9fe23c[_0xa78b('0x15')](_0x3fa33)[_0xa78b('0x16')]();};}function respondWithResult(_0xcca48a,_0x29b5f5){_0x29b5f5=_0x29b5f5||0xc8;return function(_0x17af0a){if(_0x17af0a){return _0xcca48a['status'](_0x29b5f5)[_0xa78b('0x17')](_0x17af0a);}};}function respondWithFilteredResult(_0x512f03,_0x44d20a){return function(_0x7ad8a7){if(_0x7ad8a7){var _0x97e0e5=typeof _0x44d20a[_0xa78b('0x18')]===_0xa78b('0x19')&&typeof _0x44d20a['limit']===_0xa78b('0x19');var _0x3ac5dd=_0x7ad8a7['count'];var _0x3ad5df=_0x97e0e5?0x0:_0x44d20a[_0xa78b('0x18')];var _0x111c81=_0x97e0e5?_0x7ad8a7[_0xa78b('0x1a')]:_0x44d20a[_0xa78b('0x18')]+_0x44d20a['limit'];var _0x11901d;if(_0x111c81>=_0x3ac5dd){_0x111c81=_0x3ac5dd;_0x11901d=0xc8;}else{_0x11901d=0xce;}_0x512f03['status'](_0x11901d);return _0x512f03[_0xa78b('0x1b')]('Content-Range',_0x3ad5df+'-'+_0x111c81+'/'+_0x3ac5dd)[_0xa78b('0x17')](_0x7ad8a7);}return null;};}function patchUpdates(_0x49afd1){return function(_0x1c790f){try{jsonpatch[_0xa78b('0x1c')](_0x1c790f,_0x49afd1,!![]);}catch(_0x4dd6e2){return BPromise[_0xa78b('0x1d')](_0x4dd6e2);}return _0x1c790f[_0xa78b('0x1e')]();};}function saveUpdates(_0x2d0c6f,_0x5d1215){return function(_0x1ffeaf){if(_0x1ffeaf){return _0x1ffeaf[_0xa78b('0x1f')](_0x2d0c6f)[_0xa78b('0x20')](function(_0x3e4ab1){return _0x3e4ab1;});}return null;};}function removeEntity(_0x2df392,_0x53050f){return function(_0x32198b){if(_0x32198b){return _0x32198b[_0xa78b('0x21')]()[_0xa78b('0x20')](function(){_0x2df392[_0xa78b('0x15')](0xcc)[_0xa78b('0x16')]();});}};}function handleEntityNotFound(_0x4361b7,_0x56f7eb){return function(_0x23209c){if(!_0x23209c){_0x4361b7[_0xa78b('0x22')](0x194);}return _0x23209c;};}function handleError(_0x3c7e9f,_0x1e07c6){_0x1e07c6=_0x1e07c6||0x1f4;return function(_0x293b2b){logger[_0xa78b('0x23')](_0x293b2b[_0xa78b('0x24')]);if(_0x293b2b['name']){delete _0x293b2b[_0xa78b('0x25')];}_0x3c7e9f[_0xa78b('0x15')](_0x1e07c6)[_0xa78b('0x26')](_0x293b2b);};}exports[_0xa78b('0x27')]=function(_0x2c297f,_0x1de8d3){var _0x12b40b={},_0x274c53={},_0x2c556e={'count':0x0,'rows':[]};var _0x2c8b02=_[_0xa78b('0x28')](db[_0xa78b('0x29')]['rawAttributes'],function(_0x596e09){return{'name':_0x596e09[_0xa78b('0x2a')],'type':_0x596e09[_0xa78b('0x2b')]['key']};});_0x274c53[_0xa78b('0x2c')]=_[_0xa78b('0x28')](_0x2c8b02,_0xa78b('0x25'));_0x274c53[_0xa78b('0x2d')]=_['keys'](_0x2c297f['query']);_0x274c53[_0xa78b('0x2e')]=_['intersection'](_0x274c53['model'],_0x274c53[_0xa78b('0x2d')]);_0x12b40b[_0xa78b('0x2f')]=_['intersection'](_0x274c53[_0xa78b('0x2c')],qs[_0xa78b('0x30')](_0x2c297f[_0xa78b('0x2d')][_0xa78b('0x30')]));_0x12b40b[_0xa78b('0x2f')]=_0x12b40b[_0xa78b('0x2f')]['length']?_0x12b40b[_0xa78b('0x2f')]:_0x274c53[_0xa78b('0x2c')];if(!_0x2c297f[_0xa78b('0x2d')][_0xa78b('0x31')](_0xa78b('0x32'))){_0x12b40b[_0xa78b('0x33')]=qs['limit'](_0x2c297f[_0xa78b('0x2d')]['limit']);_0x12b40b[_0xa78b('0x18')]=qs[_0xa78b('0x18')](_0x2c297f['query']['offset']);}_0x12b40b[_0xa78b('0x34')]=qs[_0xa78b('0x35')](_0x2c297f[_0xa78b('0x2d')][_0xa78b('0x35')]);_0x12b40b[_0xa78b('0x36')]=qs['filters'](_[_0xa78b('0x37')](_0x2c297f[_0xa78b('0x2d')],_0x274c53['filters']),_0x2c8b02);if(_0x2c297f[_0xa78b('0x2d')]['filter']){_0x12b40b[_0xa78b('0x36')]=_[_0xa78b('0x38')](_0x12b40b[_0xa78b('0x36')],{'$or':_['map'](_0x2c8b02,function(_0x108622){if(_0x108622['type']!=='VIRTUAL'){var _0x50d485={};_0x50d485[_0x108622['name']]={'$like':'%'+_0x2c297f[_0xa78b('0x2d')][_0xa78b('0x39')]+'%'};return _0x50d485;}})});}_0x12b40b=_[_0xa78b('0x38')]({},_0x12b40b,_0x2c297f[_0xa78b('0x3a')]);var _0x179288={'where':_0x12b40b[_0xa78b('0x36')]};return db[_0xa78b('0x29')][_0xa78b('0x1a')](_0x179288)[_0xa78b('0x20')](function(_0x53b768){_0x2c556e['count']=_0x53b768;if(_0x2c297f[_0xa78b('0x2d')][_0xa78b('0x3b')]){_0x12b40b[_0xa78b('0x3c')]=[{'all':!![]}];}return db[_0xa78b('0x29')]['findAll'](_0x12b40b);})[_0xa78b('0x20')](function(_0x2b9a2f){_0x2c556e[_0xa78b('0x3d')]=_0x2b9a2f;return _0x2c556e;})[_0xa78b('0x20')](respondWithFilteredResult(_0x1de8d3,_0x12b40b))['catch'](handleError(_0x1de8d3,null));};exports[_0xa78b('0x3e')]=function(_0x132819,_0x41675a){var _0x1af949={'raw':![],'where':{'id':_0x132819[_0xa78b('0x3f')]['id']}},_0x18e302={};_0x18e302[_0xa78b('0x2c')]=_[_0xa78b('0x40')](db[_0xa78b('0x29')][_0xa78b('0x41')]);_0x18e302[_0xa78b('0x2d')]=_[_0xa78b('0x40')](_0x132819[_0xa78b('0x2d')]);_0x18e302['filters']=_[_0xa78b('0x42')](_0x18e302[_0xa78b('0x2c')],_0x18e302[_0xa78b('0x2d')]);_0x1af949[_0xa78b('0x2f')]=_[_0xa78b('0x42')](_0x18e302['model'],qs['fields'](_0x132819[_0xa78b('0x2d')][_0xa78b('0x30')]));_0x1af949[_0xa78b('0x2f')]=_0x1af949[_0xa78b('0x2f')][_0xa78b('0x43')]?_0x1af949[_0xa78b('0x2f')]:_0x18e302['model'];if(_0x132819[_0xa78b('0x2d')][_0xa78b('0x3b')]){_0x1af949[_0xa78b('0x3c')]=[{'all':!![]}];}_0x1af949=_[_0xa78b('0x38')]({},_0x1af949,_0x132819[_0xa78b('0x3a')]);return db[_0xa78b('0x29')][_0xa78b('0x44')](_0x1af949)['then'](handleEntityNotFound(_0x41675a,null))[_0xa78b('0x20')](respondWithResult(_0x41675a,null))[_0xa78b('0x45')](handleError(_0x41675a,null));};exports[_0xa78b('0x46')]=function(_0x3325fa,_0x122614){return db['DeskAccount']['create'](_0x3325fa[_0xa78b('0x47')],{})[_0xa78b('0x20')](respondWithResult(_0x122614,0xc9))[_0xa78b('0x45')](handleError(_0x122614,null));};exports[_0xa78b('0x1f')]=function(_0x5c095f,_0x2f9cb8){if(_0x5c095f[_0xa78b('0x47')]['id']){delete _0x5c095f[_0xa78b('0x47')]['id'];}return db[_0xa78b('0x29')]['find']({'where':{'id':_0x5c095f[_0xa78b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f9cb8,null))[_0xa78b('0x20')](saveUpdates(_0x5c095f['body'],null))[_0xa78b('0x20')](respondWithResult(_0x2f9cb8,null))['catch'](handleError(_0x2f9cb8,null));};exports[_0xa78b('0x21')]=function(_0x110205,_0x450f21){return db[_0xa78b('0x29')][_0xa78b('0x44')]({'where':{'id':_0x110205[_0xa78b('0x3f')]['id']}})[_0xa78b('0x20')](handleEntityNotFound(_0x450f21,null))[_0xa78b('0x20')](removeEntity(_0x450f21,null))[_0xa78b('0x45')](handleError(_0x450f21,null));};exports[_0xa78b('0x48')]=function(_0x4ccb79,_0x148ede,_0x135f37){var _0x56adbf={};var _0x188537={};var _0x2b6243;var _0x3bce1b;return db['DeskAccount'][_0xa78b('0x49')]({'where':{'id':_0x4ccb79[_0xa78b('0x3f')]['id']}})[_0xa78b('0x20')](handleEntityNotFound(_0x148ede,null))[_0xa78b('0x20')](function(_0x317167){if(_0x317167){_0x2b6243=_0x317167;_0x188537[_0xa78b('0x2c')]=_[_0xa78b('0x40')](db[_0xa78b('0x4a')][_0xa78b('0x41')]);_0x188537[_0xa78b('0x2d')]=_[_0xa78b('0x40')](_0x4ccb79['query']);_0x188537['filters']=_[_0xa78b('0x42')](_0x188537[_0xa78b('0x2c')],_0x188537['query']);_0x56adbf[_0xa78b('0x2f')]=_[_0xa78b('0x42')](_0x188537[_0xa78b('0x2c')],qs[_0xa78b('0x30')](_0x4ccb79[_0xa78b('0x2d')]['fields']));_0x56adbf[_0xa78b('0x2f')]=_0x56adbf[_0xa78b('0x2f')][_0xa78b('0x43')]?_0x56adbf[_0xa78b('0x2f')]:_0x188537[_0xa78b('0x2c')];_0x56adbf[_0xa78b('0x34')]=qs[_0xa78b('0x35')](_0x4ccb79[_0xa78b('0x2d')]['sort']);_0x56adbf[_0xa78b('0x36')]=qs[_0xa78b('0x2e')](_[_0xa78b('0x37')](_0x4ccb79['query'],_0x188537['filters']));if(_0x4ccb79[_0xa78b('0x2d')][_0xa78b('0x39')]){_0x56adbf[_0xa78b('0x36')]=_[_0xa78b('0x38')](_0x56adbf[_0xa78b('0x36')],{'$or':_[_0xa78b('0x28')](_0x56adbf[_0xa78b('0x2f')],function(_0x4fbd96){var _0xdbf27={};_0xdbf27[_0x4fbd96]={'$like':'%'+_0x4ccb79['query']['filter']+'%'};return _0xdbf27;})});}_0x56adbf=_['merge']({},_0x56adbf,_0x4ccb79['options']);return _0x2b6243[_0xa78b('0x48')](_0x56adbf);}})[_0xa78b('0x20')](function(_0xcbf137){if(_0xcbf137){_0x3bce1b=_0xcbf137[_0xa78b('0x43')];if(!_0x4ccb79[_0xa78b('0x2d')]['hasOwnProperty'](_0xa78b('0x32'))){_0x56adbf['limit']=qs[_0xa78b('0x33')](_0x4ccb79[_0xa78b('0x2d')][_0xa78b('0x33')]);_0x56adbf[_0xa78b('0x18')]=qs[_0xa78b('0x18')](_0x4ccb79[_0xa78b('0x2d')][_0xa78b('0x18')]);}return _0x2b6243[_0xa78b('0x48')](_0x56adbf);}})[_0xa78b('0x20')](function(_0x88ec5b){if(_0x88ec5b){return _0x88ec5b?{'count':_0x3bce1b,'rows':_0x88ec5b}:null;}})[_0xa78b('0x20')](respondWithResult(_0x148ede,null))[_0xa78b('0x45')](handleError(_0x148ede,null));};exports[_0xa78b('0x4b')]=function(_0x109a52,_0x340cce,_0x1fb4fb){if(_0x109a52[_0xa78b('0x47')]['id']){delete _0x109a52['body']['id'];}return db[_0xa78b('0x29')][_0xa78b('0x49')]({'where':{'id':_0x109a52[_0xa78b('0x3f')]['id']}})[_0xa78b('0x20')](handleEntityNotFound(_0x340cce,null))['then'](function(_0x132510){if(_0x132510){_0x109a52['body']['AccountId']=_0x132510['id'];_0x109a52[_0xa78b('0x47')]['Subjects']=integrations[_0xa78b('0x4c')](_0x109a52[_0xa78b('0x47')][_0xa78b('0x4d')],_0x109a52[_0xa78b('0x47')]['type']);_0x109a52[_0xa78b('0x47')]['Descriptions']=integrations['getDescriptions'](_0x109a52[_0xa78b('0x47')][_0xa78b('0x4d')],_0x109a52[_0xa78b('0x47')]['type']);return db[_0xa78b('0x4a')][_0xa78b('0x46')](_0x109a52[_0xa78b('0x47')],{'include':[{'model':db[_0xa78b('0x4e')],'as':'Subjects'},{'model':db[_0xa78b('0x4e')],'as':_0xa78b('0x4f')}]});}return null;})[_0xa78b('0x20')](respondWithResult(_0x340cce,null))[_0xa78b('0x45')](handleError(_0x340cce,null));};exports[_0xa78b('0x50')]=function(_0x34625a,_0x2f55e9,_0x515178){var _0x104ea4=[{'name':_0xa78b('0x51'),'label':_0xa78b('0x51'),'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 _0x3b8cef='';return db[_0xa78b('0x29')][_0xa78b('0x49')]({'where':{'id':_0x34625a[_0xa78b('0x3f')]['id']},'attributes':['id','remoteUri',_0xa78b('0x52'),'username','password',_0xa78b('0x53'),_0xa78b('0x54'),_0xa78b('0x55'),_0xa78b('0x56')]})['then'](handleEntityNotFound(_0x2f55e9,null))[_0xa78b('0x20')](function(_0x112051){if(_0x112051){_0x3b8cef=_0x112051[_0xa78b('0x57')];var _0x256039=_0x3b8cef[_0xa78b('0x58')](-0x1);if(_0x256039==='/'){_0x3b8cef=_0x3b8cef[_0xa78b('0x59')](0x0,_0x3b8cef[_0xa78b('0x5a')](_0x256039));}var _0x5a6f36={'method':'GET','uri':util[_0xa78b('0x5b')]('%s/custom_fields',_0x3b8cef),'headers':{'Content-Type':_0xa78b('0x5c'),'Accept':_0xa78b('0x5c')},'json':!![]};if(_0x112051['authType']===_0xa78b('0x5d')){_0x5a6f36['headers']['Authorization']=util[_0xa78b('0x5b')](_0xa78b('0x5e'),new Buffer(util[_0xa78b('0x5b')](_0xa78b('0x5f'),_0x112051[_0xa78b('0x60')],_0x112051[_0xa78b('0x61')]))[_0xa78b('0x62')](_0xa78b('0x63')));}return rp(_0x5a6f36)[_0xa78b('0x20')](function(_0x51df3c){return _0x104ea4[_0xa78b('0x64')](_['map'](_0x51df3c[_0xa78b('0x65')][_0xa78b('0x66')],function(_0x439164){return{'id':_0x439164[_0xa78b('0x25')],'name':_0x439164[_0xa78b('0x25')],'type':_0x439164[_0xa78b('0x2b')],'active':_0x439164[_0xa78b('0x67')],'label':_0x439164['label'],'custom':!![]};}));});}})[_0xa78b('0x20')](function(_0x2eb508){return{'count':_0x2eb508[_0xa78b('0x43')],'rows':_0x2eb508};})[_0xa78b('0x20')](respondWithResult(_0x2f55e9,null))[_0xa78b('0x45')](function(_0x3fd48b){var _0x33d44f=_0x34625a['query'][_0xa78b('0x68')]?0x1f4:_0x3fd48b[_0xa78b('0x69')]||0x1f4;logger['error'](_0xa78b('0x6a'),_0xa78b('0x50'),_0x33d44f,JSON[_0xa78b('0x6b')](_0x3fd48b));delete _0x3fd48b[_0xa78b('0x25')];if(_0x33d44f===0x191){_0x33d44f=0x190;}_0x2f55e9[_0xa78b('0x15')](_0x33d44f)[_0xa78b('0x26')](_0x34625a[_0xa78b('0x2d')][_0xa78b('0x68')]?{'message':_0xa78b('0x6c'),'statusCode':_0x3fd48b['statusCode']}:_0x3fd48b);});}; \ No newline at end of file +var _0x55bf=['querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','length','find','create','body','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','lastIndexOf','application/json','basic','Authorization','format','%s:%s','password','toString','base64','concat','_embedded','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x55bf,0x132));var _0xf55b=function(_0x45c150,_0x367855){_0x45c150=_0x45c150-0x0;var _0x27ed99=_0x55bf[_0x45c150];return _0x27ed99;};'use strict';var emlformat=require(_0xf55b('0x0'));var rimraf=require(_0xf55b('0x1'));var zipdir=require(_0xf55b('0x2'));var jsonpatch=require(_0xf55b('0x3'));var rp=require(_0xf55b('0x4'));var moment=require(_0xf55b('0x5'));var BPromise=require(_0xf55b('0x6'));var Mustache=require(_0xf55b('0x7'));var util=require('util');var path=require(_0xf55b('0x8'));var sox=require(_0xf55b('0x9'));var csv=require(_0xf55b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf55b('0xb'));var _=require(_0xf55b('0xc'));var squel=require('squel');var crypto=require(_0xf55b('0xd'));var jsforce=require(_0xf55b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf55b('0xa'));var querystring=require(_0xf55b('0xf'));var Papa=require(_0xf55b('0x10'));var Redis=require(_0xf55b('0x11'));var authService=require(_0xf55b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf55b('0x13'))('api');var utils=require(_0xf55b('0x14'));var config=require(_0xf55b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf55b('0x16'));function respondWithStatusCode(_0x20eb8f,_0x3bdd46){_0x3bdd46=_0x3bdd46||0xcc;return function(_0x3f8eae){if(_0x3f8eae){return _0x20eb8f[_0xf55b('0x17')](_0x3bdd46);}return _0x20eb8f[_0xf55b('0x18')](_0x3bdd46)['end']();};}function respondWithResult(_0x2acfb1,_0x2a8164){_0x2a8164=_0x2a8164||0xc8;return function(_0x532937){if(_0x532937){return _0x2acfb1['status'](_0x2a8164)[_0xf55b('0x19')](_0x532937);}};}function respondWithFilteredResult(_0x41eb38,_0x6d9452){return function(_0x292934){if(_0x292934){var _0x40098c=typeof _0x6d9452[_0xf55b('0x1a')]===_0xf55b('0x1b')&&typeof _0x6d9452[_0xf55b('0x1c')]===_0xf55b('0x1b');var _0x2e314e=_0x292934[_0xf55b('0x1d')];var _0x2119f3=_0x40098c?0x0:_0x6d9452[_0xf55b('0x1a')];var _0x30182d=_0x40098c?_0x292934[_0xf55b('0x1d')]:_0x6d9452[_0xf55b('0x1a')]+_0x6d9452['limit'];var _0x436f72;if(_0x30182d>=_0x2e314e){_0x30182d=_0x2e314e;_0x436f72=0xc8;}else{_0x436f72=0xce;}_0x41eb38['status'](_0x436f72);return _0x41eb38['set'](_0xf55b('0x1e'),_0x2119f3+'-'+_0x30182d+'/'+_0x2e314e)[_0xf55b('0x19')](_0x292934);}return null;};}function patchUpdates(_0x523542){return function(_0x26f584){try{jsonpatch[_0xf55b('0x1f')](_0x26f584,_0x523542,!![]);}catch(_0x5d2f83){return BPromise[_0xf55b('0x20')](_0x5d2f83);}return _0x26f584[_0xf55b('0x21')]();};}function saveUpdates(_0x27641d,_0x374aa2){return function(_0x4efbad){if(_0x4efbad){return _0x4efbad[_0xf55b('0x22')](_0x27641d)[_0xf55b('0x23')](function(_0x147a6c){return _0x147a6c;});}return null;};}function removeEntity(_0x182a11,_0x10e322){return function(_0x2a5548){if(_0x2a5548){return _0x2a5548[_0xf55b('0x24')]()[_0xf55b('0x23')](function(){_0x182a11[_0xf55b('0x18')](0xcc)[_0xf55b('0x25')]();});}};}function handleEntityNotFound(_0x4a33b4,_0x204d52){return function(_0x1a6843){if(!_0x1a6843){_0x4a33b4[_0xf55b('0x17')](0x194);}return _0x1a6843;};}function handleError(_0x316b98,_0x36ffdc){_0x36ffdc=_0x36ffdc||0x1f4;return function(_0x20725e){logger[_0xf55b('0x26')](_0x20725e[_0xf55b('0x27')]);if(_0x20725e[_0xf55b('0x28')]){delete _0x20725e['name'];}_0x316b98[_0xf55b('0x18')](_0x36ffdc)[_0xf55b('0x29')](_0x20725e);};}exports[_0xf55b('0x2a')]=function(_0x3b8e9a,_0x15316b){var _0xc357be={},_0x4642a3={},_0x347241={'count':0x0,'rows':[]};var _0x4288ef=_['map'](db[_0xf55b('0x2b')][_0xf55b('0x2c')],function(_0x12d4f4){return{'name':_0x12d4f4[_0xf55b('0x2d')],'type':_0x12d4f4[_0xf55b('0x2e')][_0xf55b('0x2f')]};});_0x4642a3[_0xf55b('0x30')]=_[_0xf55b('0x31')](_0x4288ef,_0xf55b('0x28'));_0x4642a3[_0xf55b('0x32')]=_[_0xf55b('0x33')](_0x3b8e9a[_0xf55b('0x32')]);_0x4642a3[_0xf55b('0x34')]=_[_0xf55b('0x35')](_0x4642a3[_0xf55b('0x30')],_0x4642a3[_0xf55b('0x32')]);_0xc357be[_0xf55b('0x36')]=_[_0xf55b('0x35')](_0x4642a3[_0xf55b('0x30')],qs[_0xf55b('0x37')](_0x3b8e9a[_0xf55b('0x32')][_0xf55b('0x37')]));_0xc357be[_0xf55b('0x36')]=_0xc357be[_0xf55b('0x36')]['length']?_0xc357be['attributes']:_0x4642a3['model'];if(!_0x3b8e9a[_0xf55b('0x32')][_0xf55b('0x38')](_0xf55b('0x39'))){_0xc357be[_0xf55b('0x1c')]=qs[_0xf55b('0x1c')](_0x3b8e9a['query'][_0xf55b('0x1c')]);_0xc357be[_0xf55b('0x1a')]=qs['offset'](_0x3b8e9a['query']['offset']);}_0xc357be[_0xf55b('0x3a')]=qs[_0xf55b('0x3b')](_0x3b8e9a['query']['sort']);_0xc357be['where']=qs[_0xf55b('0x34')](_[_0xf55b('0x3c')](_0x3b8e9a[_0xf55b('0x32')],_0x4642a3[_0xf55b('0x34')]),_0x4288ef);if(_0x3b8e9a[_0xf55b('0x32')][_0xf55b('0x3d')]){_0xc357be['where']=_[_0xf55b('0x3e')](_0xc357be['where'],{'$or':_['map'](_0x4288ef,function(_0x3012f1){if(_0x3012f1[_0xf55b('0x2e')]!==_0xf55b('0x3f')){var _0x5ff0c1={};_0x5ff0c1[_0x3012f1[_0xf55b('0x28')]]={'$like':'%'+_0x3b8e9a[_0xf55b('0x32')]['filter']+'%'};return _0x5ff0c1;}})});}_0xc357be=_[_0xf55b('0x3e')]({},_0xc357be,_0x3b8e9a[_0xf55b('0x40')]);var _0x3f6ae7={'where':_0xc357be[_0xf55b('0x41')]};return db[_0xf55b('0x2b')][_0xf55b('0x1d')](_0x3f6ae7)['then'](function(_0x453168){_0x347241[_0xf55b('0x1d')]=_0x453168;if(_0x3b8e9a[_0xf55b('0x32')][_0xf55b('0x42')]){_0xc357be[_0xf55b('0x43')]=[{'all':!![]}];}return db['DeskAccount'][_0xf55b('0x44')](_0xc357be);})[_0xf55b('0x23')](function(_0x2c877c){_0x347241[_0xf55b('0x45')]=_0x2c877c;return _0x347241;})[_0xf55b('0x23')](respondWithFilteredResult(_0x15316b,_0xc357be))[_0xf55b('0x46')](handleError(_0x15316b,null));};exports['show']=function(_0x462782,_0x50a1e0){var _0x4bdb7d={'raw':![],'where':{'id':_0x462782[_0xf55b('0x47')]['id']}},_0x17c0a8={};_0x17c0a8['model']=_[_0xf55b('0x33')](db[_0xf55b('0x2b')]['rawAttributes']);_0x17c0a8['query']=_['keys'](_0x462782['query']);_0x17c0a8[_0xf55b('0x34')]=_[_0xf55b('0x35')](_0x17c0a8[_0xf55b('0x30')],_0x17c0a8[_0xf55b('0x32')]);_0x4bdb7d['attributes']=_[_0xf55b('0x35')](_0x17c0a8['model'],qs['fields'](_0x462782[_0xf55b('0x32')][_0xf55b('0x37')]));_0x4bdb7d['attributes']=_0x4bdb7d[_0xf55b('0x36')][_0xf55b('0x48')]?_0x4bdb7d['attributes']:_0x17c0a8['model'];if(_0x462782[_0xf55b('0x32')][_0xf55b('0x42')]){_0x4bdb7d[_0xf55b('0x43')]=[{'all':!![]}];}_0x4bdb7d=_[_0xf55b('0x3e')]({},_0x4bdb7d,_0x462782[_0xf55b('0x40')]);return db[_0xf55b('0x2b')][_0xf55b('0x49')](_0x4bdb7d)[_0xf55b('0x23')](handleEntityNotFound(_0x50a1e0,null))['then'](respondWithResult(_0x50a1e0,null))[_0xf55b('0x46')](handleError(_0x50a1e0,null));};exports[_0xf55b('0x4a')]=function(_0x3f0e33,_0x4ab816){return db[_0xf55b('0x2b')][_0xf55b('0x4a')](_0x3f0e33['body'],{})['then'](respondWithResult(_0x4ab816,0xc9))[_0xf55b('0x46')](handleError(_0x4ab816,null));};exports[_0xf55b('0x22')]=function(_0x36f677,_0x557a8e){if(_0x36f677[_0xf55b('0x4b')]['id']){delete _0x36f677[_0xf55b('0x4b')]['id'];}return db['DeskAccount'][_0xf55b('0x49')]({'where':{'id':_0x36f677[_0xf55b('0x47')]['id']}})[_0xf55b('0x23')](handleEntityNotFound(_0x557a8e,null))[_0xf55b('0x23')](saveUpdates(_0x36f677[_0xf55b('0x4b')],null))[_0xf55b('0x23')](respondWithResult(_0x557a8e,null))['catch'](handleError(_0x557a8e,null));};exports['destroy']=function(_0x4439e9,_0xf393a9){return db[_0xf55b('0x2b')][_0xf55b('0x49')]({'where':{'id':_0x4439e9[_0xf55b('0x47')]['id']}})[_0xf55b('0x23')](handleEntityNotFound(_0xf393a9,null))['then'](removeEntity(_0xf393a9,null))[_0xf55b('0x46')](handleError(_0xf393a9,null));};exports['getConfigurations']=function(_0x515898,_0x1c7ad0,_0x8d7457){var _0x102e79={};var _0x462627={};var _0x704d55;var _0x56ab8f;return db[_0xf55b('0x2b')][_0xf55b('0x4c')]({'where':{'id':_0x515898[_0xf55b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c7ad0,null))['then'](function(_0x474cc0){if(_0x474cc0){_0x704d55=_0x474cc0;_0x462627[_0xf55b('0x30')]=_['keys'](db[_0xf55b('0x4d')][_0xf55b('0x2c')]);_0x462627[_0xf55b('0x32')]=_['keys'](_0x515898[_0xf55b('0x32')]);_0x462627['filters']=_[_0xf55b('0x35')](_0x462627[_0xf55b('0x30')],_0x462627[_0xf55b('0x32')]);_0x102e79[_0xf55b('0x36')]=_[_0xf55b('0x35')](_0x462627[_0xf55b('0x30')],qs['fields'](_0x515898['query'][_0xf55b('0x37')]));_0x102e79[_0xf55b('0x36')]=_0x102e79[_0xf55b('0x36')][_0xf55b('0x48')]?_0x102e79[_0xf55b('0x36')]:_0x462627['model'];_0x102e79[_0xf55b('0x3a')]=qs['sort'](_0x515898[_0xf55b('0x32')][_0xf55b('0x3b')]);_0x102e79[_0xf55b('0x41')]=qs[_0xf55b('0x34')](_[_0xf55b('0x3c')](_0x515898[_0xf55b('0x32')],_0x462627[_0xf55b('0x34')]));if(_0x515898[_0xf55b('0x32')][_0xf55b('0x3d')]){_0x102e79['where']=_[_0xf55b('0x3e')](_0x102e79[_0xf55b('0x41')],{'$or':_[_0xf55b('0x31')](_0x102e79[_0xf55b('0x36')],function(_0xf6793a){var _0x409e0c={};_0x409e0c[_0xf6793a]={'$like':'%'+_0x515898['query'][_0xf55b('0x3d')]+'%'};return _0x409e0c;})});}_0x102e79=_[_0xf55b('0x3e')]({},_0x102e79,_0x515898[_0xf55b('0x40')]);return _0x704d55['getConfigurations'](_0x102e79);}})[_0xf55b('0x23')](function(_0x3f5402){if(_0x3f5402){_0x56ab8f=_0x3f5402[_0xf55b('0x48')];if(!_0x515898[_0xf55b('0x32')]['hasOwnProperty'](_0xf55b('0x39'))){_0x102e79[_0xf55b('0x1c')]=qs[_0xf55b('0x1c')](_0x515898['query'][_0xf55b('0x1c')]);_0x102e79[_0xf55b('0x1a')]=qs['offset'](_0x515898[_0xf55b('0x32')][_0xf55b('0x1a')]);}return _0x704d55['getConfigurations'](_0x102e79);}})['then'](function(_0x5a7e31){if(_0x5a7e31){return _0x5a7e31?{'count':_0x56ab8f,'rows':_0x5a7e31}:null;}})[_0xf55b('0x23')](respondWithResult(_0x1c7ad0,null))[_0xf55b('0x46')](handleError(_0x1c7ad0,null));};exports[_0xf55b('0x4e')]=function(_0x2f32c9,_0x3da0b2,_0x451e5e){if(_0x2f32c9[_0xf55b('0x4b')]['id']){delete _0x2f32c9['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x2f32c9[_0xf55b('0x47')]['id']}})[_0xf55b('0x23')](handleEntityNotFound(_0x3da0b2,null))[_0xf55b('0x23')](function(_0x5166a2){if(_0x5166a2){_0x2f32c9[_0xf55b('0x4b')]['AccountId']=_0x5166a2['id'];_0x2f32c9[_0xf55b('0x4b')][_0xf55b('0x4f')]=integrations[_0xf55b('0x50')](_0x2f32c9['body']['channel'],_0x2f32c9[_0xf55b('0x4b')][_0xf55b('0x2e')]);_0x2f32c9[_0xf55b('0x4b')][_0xf55b('0x51')]=integrations['getDescriptions'](_0x2f32c9[_0xf55b('0x4b')]['channel'],_0x2f32c9[_0xf55b('0x4b')][_0xf55b('0x2e')]);return db[_0xf55b('0x4d')]['create'](_0x2f32c9['body'],{'include':[{'model':db[_0xf55b('0x52')],'as':_0xf55b('0x4f')},{'model':db['DeskField'],'as':_0xf55b('0x51')}]});}return null;})[_0xf55b('0x23')](respondWithResult(_0x3da0b2,null))['catch'](handleError(_0x3da0b2,null));};exports[_0xf55b('0x53')]=function(_0x3eeead,_0x429548,_0x58f4b1){var _0x18d8ee=[{'name':_0xf55b('0x54'),'label':_0xf55b('0x54'),'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 _0x2efa5e='';return db[_0xf55b('0x2b')]['findOne']({'where':{'id':_0x3eeead[_0xf55b('0x47')]['id']},'attributes':['id',_0xf55b('0x55'),_0xf55b('0x56'),_0xf55b('0x57'),'password',_0xf55b('0x58'),_0xf55b('0x59'),'token','tokenSecret']})[_0xf55b('0x23')](handleEntityNotFound(_0x429548,null))[_0xf55b('0x23')](function(_0x41c2c1){if(_0x41c2c1){_0x2efa5e=_0x41c2c1[_0xf55b('0x55')];var _0x4538f2=_0x2efa5e['slice'](-0x1);if(_0x4538f2==='/'){_0x2efa5e=_0x2efa5e['substring'](0x0,_0x2efa5e[_0xf55b('0x5a')](_0x4538f2));}var _0x1e258c={'method':'GET','uri':util['format']('%s/custom_fields',_0x2efa5e),'headers':{'Content-Type':'application/json','Accept':_0xf55b('0x5b')},'json':!![]};if(_0x41c2c1['authType']===_0xf55b('0x5c')){_0x1e258c['headers'][_0xf55b('0x5d')]=util[_0xf55b('0x5e')]('Basic\x20%s',new Buffer(util[_0xf55b('0x5e')](_0xf55b('0x5f'),_0x41c2c1['username'],_0x41c2c1[_0xf55b('0x60')]))[_0xf55b('0x61')](_0xf55b('0x62')));}return rp(_0x1e258c)[_0xf55b('0x23')](function(_0x9629d5){return _0x18d8ee[_0xf55b('0x63')](_[_0xf55b('0x31')](_0x9629d5[_0xf55b('0x64')]['entries'],function(_0x1d9fdb){return{'id':_0x1d9fdb[_0xf55b('0x28')],'name':_0x1d9fdb[_0xf55b('0x28')],'type':_0x1d9fdb['type'],'active':_0x1d9fdb[_0xf55b('0x65')],'label':_0x1d9fdb[_0xf55b('0x66')],'custom':!![]};}));});}})['then'](function(_0x3fde12){return{'count':_0x3fde12['length'],'rows':_0x3fde12};})[_0xf55b('0x23')](respondWithResult(_0x429548,null))[_0xf55b('0x46')](function(_0x4acebb){var _0x5519ec=_0x3eeead[_0xf55b('0x32')][_0xf55b('0x67')]?0x1f4:_0x4acebb['statusCode']||0x1f4;logger['error'](_0xf55b('0x68'),'getFields',_0x5519ec,JSON[_0xf55b('0x69')](_0x4acebb));delete _0x4acebb[_0xf55b('0x28')];if(_0x5519ec===0x191){_0x5519ec=0x190;}_0x429548[_0xf55b('0x18')](_0x5519ec)[_0xf55b('0x29')](_0x3eeead[_0xf55b('0x32')][_0xf55b('0x67')]?{'message':'Wrong\x20credentials','statusCode':_0x4acebb[_0xf55b('0x6a')]}:_0x4acebb);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 1f92647..4b4c6ec 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 _0x91f9=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDeskAccount.attributes','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91f9,0x1eb));var _0x991f=function(_0x4498a2,_0x143689){_0x4498a2=_0x4498a2-0x0;var _0x411aa8=_0x91f9[_0x4498a2];return _0x411aa8;};'use strict';var _=require(_0x991f('0x0'));var util=require(_0x991f('0x1'));var logger=require(_0x991f('0x2'))(_0x991f('0x3'));var moment=require(_0x991f('0x4'));var BPromise=require(_0x991f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x991f('0x6'));var config=require(_0x991f('0x7'));var attributes=require(_0x991f('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1b89a2,_0x20744c){return _0x1b89a2[_0x991f('0x9')](_0x991f('0xa'),attributes,{'tableName':_0x991f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc8d=['define','DeskAccount','int_desk_accounts','lodash','util','moment','bluebird','path','../../config/environment','./intDeskAccount.attributes','exports'];(function(_0x44a4f4,_0x308fe4){var _0x4ba86f=function(_0x3aa230){while(--_0x3aa230){_0x44a4f4['push'](_0x44a4f4['shift']());}};_0x4ba86f(++_0x308fe4);}(_0xcc8d,0x1bb));var _0xdcc8=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0xcc8d[_0x4cd846];return _0x2f2a7d;};'use strict';var _=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdcc8('0x2'));var BPromise=require(_0xdcc8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcc8('0x4'));var rimraf=require('rimraf');var config=require(_0xdcc8('0x5'));var attributes=require(_0xdcc8('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xdcc8('0x7')]=function(_0x4f0ebc,_0x18ce6e){return _0x4f0ebc[_0xdcc8('0x8')](_0xdcc8('0x9'),attributes,{'tableName':_0xdcc8('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 fbec003..02b9961 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 _0x6c38=['../../config/logger','../../config/environment','jayson/promise','client','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','attributes','limit','include','map','model','then','GetDeskAccount','debug','ShowDeskAccount','find','where','lodash','randomstring','ioredis','../../config/utils'];(function(_0x4b6aba,_0x49ff5a){var _0x573e07=function(_0x5946e7){while(--_0x5946e7){_0x4b6aba['push'](_0x4b6aba['shift']());}};_0x573e07(++_0x49ff5a);}(_0x6c38,0x80));var _0x86c3=function(_0x6707c,_0x15fd4b){_0x6707c=_0x6707c-0x0;var _0x4c6050=_0x6c38[_0x6707c];return _0x4c6050;};'use strict';var _=require(_0x86c3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x86c3('0x1'));var fs=require('fs');var Redis=require(_0x86c3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x86c3('0x3'));var logger=require(_0x86c3('0x4'))('rpc');var config=require(_0x86c3('0x5'));var jayson=require(_0x86c3('0x6'));var client=jayson[_0x86c3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41f6d3,_0x55fd43,_0x1911ec){return new BPromise(function(_0x68d92a,_0x3067b7){return client[_0x86c3('0x8')](_0x41f6d3,_0x1911ec)['then'](function(_0x3b220c){logger[_0x86c3('0x9')](_0x86c3('0xa'),_0x55fd43,_0x86c3('0xb'));logger['debug'](_0x86c3('0xc'),_0x55fd43,_0x86c3('0xb'),JSON[_0x86c3('0xd')](_0x3b220c));if(_0x3b220c[_0x86c3('0xe')]){if(_0x3b220c['error'][_0x86c3('0xf')]===0x1f4){logger[_0x86c3('0xe')](_0x86c3('0xa'),_0x55fd43,_0x3b220c[_0x86c3('0xe')][_0x86c3('0x10')]);return _0x3067b7(_0x3b220c[_0x86c3('0xe')]['message']);}logger[_0x86c3('0xe')](_0x86c3('0xa'),_0x55fd43,_0x3b220c['error'][_0x86c3('0x10')]);return _0x68d92a(_0x3b220c[_0x86c3('0xe')]['message']);}else{logger[_0x86c3('0x9')](_0x86c3('0xa'),_0x55fd43,'request\x20sent');_0x68d92a(_0x3b220c[_0x86c3('0x11')]['message']);}})[_0x86c3('0x12')](function(_0xd9124e){logger[_0x86c3('0xe')](_0x86c3('0xa'),_0x55fd43,_0xd9124e);_0x3067b7(_0xd9124e);});});}exports['GetDeskAccount']=function(_0x223997){var _0x109618=this;return new Promise(function(_0x1df03e,_0x34b019){return db[_0x86c3('0x13')][_0x86c3('0x14')]({'raw':_0x223997[_0x86c3('0x15')]?_0x223997['options']['raw']===undefined?!![]:![]:!![],'where':_0x223997[_0x86c3('0x15')]?_0x223997[_0x86c3('0x15')]['where']||null:null,'attributes':_0x223997[_0x86c3('0x15')]?_0x223997[_0x86c3('0x15')][_0x86c3('0x16')]||null:null,'limit':_0x223997['options']?_0x223997['options'][_0x86c3('0x17')]||null:null,'include':_0x223997['options']?_0x223997[_0x86c3('0x15')][_0x86c3('0x18')]?_[_0x86c3('0x19')](_0x223997[_0x86c3('0x15')][_0x86c3('0x18')],function(_0x90a194){return{'model':db[_0x90a194[_0x86c3('0x1a')]],'as':_0x90a194['as'],'attributes':_0x90a194['attributes'],'include':_0x90a194['include']?_[_0x86c3('0x19')](_0x90a194[_0x86c3('0x18')],function(_0x111f67){return{'model':db[_0x111f67[_0x86c3('0x1a')]],'as':_0x111f67['as'],'attributes':_0x111f67[_0x86c3('0x16')],'include':_0x111f67[_0x86c3('0x18')]?_[_0x86c3('0x19')](_0x111f67[_0x86c3('0x18')],function(_0x2ebbec){return{'model':db[_0x2ebbec[_0x86c3('0x1a')]],'as':_0x2ebbec['as'],'attributes':_0x2ebbec[_0x86c3('0x16')]};}):[]};}):[]};}):[]:[]})[_0x86c3('0x1b')](function(_0x4c7540){logger[_0x86c3('0x9')](_0x86c3('0x1c'),_0x223997);logger[_0x86c3('0x1d')]('GetDeskAccount',_0x223997,JSON[_0x86c3('0xd')](_0x4c7540));_0x1df03e(_0x4c7540);})['catch'](function(_0x5d16e1){logger['error'](_0x86c3('0x1c'),_0x5d16e1['message'],_0x223997);_0x34b019(_0x109618['error'](0x1f4,_0x5d16e1[_0x86c3('0x10')]));});});};exports[_0x86c3('0x1e')]=function(_0x4d4d7e){var _0x5e9369=this;return new Promise(function(_0x32ce75,_0x452aa4){return db['DeskAccount'][_0x86c3('0x1f')]({'raw':_0x4d4d7e[_0x86c3('0x15')]?_0x4d4d7e[_0x86c3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4d4d7e[_0x86c3('0x15')]?_0x4d4d7e['options'][_0x86c3('0x20')]||null:null,'attributes':_0x4d4d7e['options']?_0x4d4d7e['options'][_0x86c3('0x16')]||null:null,'include':_0x4d4d7e[_0x86c3('0x15')]?_0x4d4d7e[_0x86c3('0x15')]['include']?_[_0x86c3('0x19')](_0x4d4d7e['options'][_0x86c3('0x18')],function(_0x394629){return{'model':db[_0x394629[_0x86c3('0x1a')]],'as':_0x394629['as'],'attributes':_0x394629[_0x86c3('0x16')],'include':_0x394629[_0x86c3('0x18')]?_[_0x86c3('0x19')](_0x394629[_0x86c3('0x18')],function(_0x10a585){return{'model':db[_0x10a585['model']],'as':_0x10a585['as'],'attributes':_0x10a585[_0x86c3('0x16')],'include':_0x10a585['include']?_[_0x86c3('0x19')](_0x10a585[_0x86c3('0x18')],function(_0x511c84){return{'model':db[_0x511c84[_0x86c3('0x1a')]],'as':_0x511c84['as'],'attributes':_0x511c84['attributes']};}):[]};}):[]};}):[]:[]})[_0x86c3('0x1b')](function(_0x34b22c){logger[_0x86c3('0x9')](_0x86c3('0x1e'),_0x4d4d7e);logger[_0x86c3('0x1d')](_0x86c3('0x1e'),_0x4d4d7e,JSON[_0x86c3('0xd')](_0x34b22c));_0x32ce75(_0x34b22c);})[_0x86c3('0x12')](function(_0xd04220){logger[_0x86c3('0xe')](_0x86c3('0x1e'),_0xd04220[_0x86c3('0x10')],_0x4d4d7e);_0x452aa4(_0x5e9369[_0x86c3('0xe')](0x1f4,_0xd04220['message']));});});}; \ No newline at end of file +var _0x3ca4=['find','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowDeskAccount','DeskAccount'];(function(_0x10eeca,_0x430d68){var _0x55a3b7=function(_0x318a6a){while(--_0x318a6a){_0x10eeca['push'](_0x10eeca['shift']());}};_0x55a3b7(++_0x430d68);}(_0x3ca4,0x158));var _0x43ca=function(_0x1d37d5,_0x3ce72d){_0x1d37d5=_0x1d37d5-0x0;var _0x5df580=_0x3ca4[_0x1d37d5];return _0x5df580;};'use strict';var _=require(_0x43ca('0x0'));var util=require(_0x43ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43ca('0x2'));var fs=require('fs');var Redis=require(_0x43ca('0x3'));var db=require(_0x43ca('0x4'))['db'];var utils=require(_0x43ca('0x5'));var logger=require(_0x43ca('0x6'))(_0x43ca('0x7'));var config=require(_0x43ca('0x8'));var jayson=require(_0x43ca('0x9'));var client=jayson[_0x43ca('0xa')][_0x43ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49465b,_0xe19e54,_0x7dd017){return new BPromise(function(_0x1a2f53,_0x56962f){return client[_0x43ca('0xc')](_0x49465b,_0x7dd017)[_0x43ca('0xd')](function(_0x2bfb36){logger[_0x43ca('0xe')]('DeskAccount,\x20%s,\x20%s',_0xe19e54,'request\x20sent');logger[_0x43ca('0xf')](_0x43ca('0x10'),_0xe19e54,_0x43ca('0x11'),JSON[_0x43ca('0x12')](_0x2bfb36));if(_0x2bfb36[_0x43ca('0x13')]){if(_0x2bfb36[_0x43ca('0x13')][_0x43ca('0x14')]===0x1f4){logger[_0x43ca('0x13')]('DeskAccount,\x20%s,\x20%s',_0xe19e54,_0x2bfb36[_0x43ca('0x13')][_0x43ca('0x15')]);return _0x56962f(_0x2bfb36[_0x43ca('0x13')][_0x43ca('0x15')]);}logger[_0x43ca('0x13')](_0x43ca('0x16'),_0xe19e54,_0x2bfb36[_0x43ca('0x13')][_0x43ca('0x15')]);return _0x1a2f53(_0x2bfb36[_0x43ca('0x13')]['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0xe19e54,_0x43ca('0x11'));_0x1a2f53(_0x2bfb36[_0x43ca('0x17')][_0x43ca('0x15')]);}})['catch'](function(_0x9be0a){logger[_0x43ca('0x13')](_0x43ca('0x16'),_0xe19e54,_0x9be0a);_0x56962f(_0x9be0a);});});}exports[_0x43ca('0x18')]=function(_0xf0bc9e){var _0x1f2178=this;return new Promise(function(_0x4a66a4,_0x25c9be){return db['DeskAccount'][_0x43ca('0x19')]({'raw':_0xf0bc9e[_0x43ca('0x1a')]?_0xf0bc9e[_0x43ca('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xf0bc9e[_0x43ca('0x1a')]?_0xf0bc9e[_0x43ca('0x1a')][_0x43ca('0x1b')]||null:null,'attributes':_0xf0bc9e[_0x43ca('0x1a')]?_0xf0bc9e[_0x43ca('0x1a')][_0x43ca('0x1c')]||null:null,'limit':_0xf0bc9e[_0x43ca('0x1a')]?_0xf0bc9e[_0x43ca('0x1a')][_0x43ca('0x1d')]||null:null,'include':_0xf0bc9e[_0x43ca('0x1a')]?_0xf0bc9e[_0x43ca('0x1a')][_0x43ca('0x1e')]?_[_0x43ca('0x1f')](_0xf0bc9e[_0x43ca('0x1a')][_0x43ca('0x1e')],function(_0x265291){return{'model':db[_0x265291[_0x43ca('0x20')]],'as':_0x265291['as'],'attributes':_0x265291[_0x43ca('0x1c')],'include':_0x265291[_0x43ca('0x1e')]?_[_0x43ca('0x1f')](_0x265291[_0x43ca('0x1e')],function(_0x5d58dc){return{'model':db[_0x5d58dc['model']],'as':_0x5d58dc['as'],'attributes':_0x5d58dc[_0x43ca('0x1c')],'include':_0x5d58dc[_0x43ca('0x1e')]?_[_0x43ca('0x1f')](_0x5d58dc['include'],function(_0x518bb3){return{'model':db[_0x518bb3[_0x43ca('0x20')]],'as':_0x518bb3['as'],'attributes':_0x518bb3[_0x43ca('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x43ca('0xd')](function(_0x132c24){logger[_0x43ca('0xe')]('GetDeskAccount',_0xf0bc9e);logger[_0x43ca('0xf')]('GetDeskAccount',_0xf0bc9e,JSON[_0x43ca('0x12')](_0x132c24));_0x4a66a4(_0x132c24);})[_0x43ca('0x21')](function(_0x1d3526){logger[_0x43ca('0x13')](_0x43ca('0x18'),_0x1d3526[_0x43ca('0x15')],_0xf0bc9e);_0x25c9be(_0x1f2178[_0x43ca('0x13')](0x1f4,_0x1d3526['message']));});});};exports[_0x43ca('0x22')]=function(_0x503e11){var _0x641b21=this;return new Promise(function(_0x22763d,_0x5da8f9){return db[_0x43ca('0x23')][_0x43ca('0x24')]({'raw':_0x503e11['options']?_0x503e11[_0x43ca('0x1a')][_0x43ca('0x25')]===undefined?!![]:![]:!![],'where':_0x503e11['options']?_0x503e11[_0x43ca('0x1a')]['where']||null:null,'attributes':_0x503e11[_0x43ca('0x1a')]?_0x503e11[_0x43ca('0x1a')][_0x43ca('0x1c')]||null:null,'include':_0x503e11[_0x43ca('0x1a')]?_0x503e11[_0x43ca('0x1a')]['include']?_['map'](_0x503e11[_0x43ca('0x1a')][_0x43ca('0x1e')],function(_0xed05fc){return{'model':db[_0xed05fc[_0x43ca('0x20')]],'as':_0xed05fc['as'],'attributes':_0xed05fc[_0x43ca('0x1c')],'include':_0xed05fc[_0x43ca('0x1e')]?_[_0x43ca('0x1f')](_0xed05fc[_0x43ca('0x1e')],function(_0x532e30){return{'model':db[_0x532e30[_0x43ca('0x20')]],'as':_0x532e30['as'],'attributes':_0x532e30[_0x43ca('0x1c')],'include':_0x532e30[_0x43ca('0x1e')]?_['map'](_0x532e30['include'],function(_0x45ffe0){return{'model':db[_0x45ffe0['model']],'as':_0x45ffe0['as'],'attributes':_0x45ffe0[_0x43ca('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x43ca('0xd')](function(_0x2c7b3f){logger[_0x43ca('0xe')](_0x43ca('0x22'),_0x503e11);logger['debug'](_0x43ca('0x22'),_0x503e11,JSON[_0x43ca('0x12')](_0x2c7b3f));_0x22763d(_0x2c7b3f);})[_0x43ca('0x21')](function(_0x42ff47){logger[_0x43ca('0x13')](_0x43ca('0x22'),_0x42ff47[_0x43ca('0x15')],_0x503e11);_0x5da8f9(_0x641b21[_0x43ca('0x13')](0x1f4,_0x42ff47[_0x43ca('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bbb48e9..c67f6e0 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5e8127,_0x380e9b){var _0x1ab2a0=function(_0x39e5bc){while(--_0x39e5bc){_0x5e8127['push'](_0x5e8127['shift']());}};_0x1ab2a0(++_0x380e9b);}(_0x3e74,0x175));var _0x43e7=function(_0xbbe750,_0x14956b){_0xbbe750=_0xbbe750-0x0;var _0xfee7b8=_0x3e74[_0xbbe750];return _0xfee7b8;};'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 fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x2a5cac,_0x148d3f){var _0x6394b1=function(_0x498c24){while(--_0x498c24){_0x2a5cac['push'](_0x2a5cac['shift']());}};_0x6394b1(++_0x148d3f);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 9221170..b72b731 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 _0x9fe1=['STRING','sequelize'];(function(_0x48810a,_0x3a26d3){var _0x647b93=function(_0x1b0387){while(--_0x1b0387){_0x48810a['push'](_0x48810a['shift']());}};_0x647b93(++_0x3a26d3);}(_0x9fe1,0xad));var _0x19fe=function(_0x53d110,_0x36f790){_0x53d110=_0x53d110-0x0;var _0x4de9ad=_0x9fe1[_0x53d110];return _0x4de9ad;};'use strict';var Sequelize=require(_0x19fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x19fe('0x1')]},'description':{'type':Sequelize[_0x19fe('0x1')]}}; \ No newline at end of file +var _0x2944=['sequelize','STRING'];(function(_0x51097c,_0x4f0ebc){var _0x528321=function(_0x561b2d){while(--_0x561b2d){_0x51097c['push'](_0x51097c['shift']());}};_0x528321(++_0x4f0ebc);}(_0x2944,0x1f0));var _0x4294=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x2944[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0x4294('0x0'));module['exports']={'name':{'type':Sequelize[_0x4294('0x1')]},'description':{'type':Sequelize[_0x4294('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 9bc1185..102d4e1 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 _0xebb1=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','DeskConfiguration','count','includeAll','include','rows','catch','rawAttributes','find','create','body','params','getFields','findOne','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','set'];(function(_0x18e911,_0x3f82ca){var _0x58bf3f=function(_0x1b6ed3){while(--_0x1b6ed3){_0x18e911['push'](_0x18e911['shift']());}};_0x58bf3f(++_0x3f82ca);}(_0xebb1,0x137));var _0x1ebb=function(_0x39caa8,_0x58af03){_0x39caa8=_0x39caa8-0x0;var _0x47a728=_0xebb1[_0x39caa8];return _0x47a728;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ebb('0x0'));var zipdir=require(_0x1ebb('0x1'));var jsonpatch=require(_0x1ebb('0x2'));var rp=require(_0x1ebb('0x3'));var moment=require(_0x1ebb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1ebb('0x5'));var util=require('util');var path=require(_0x1ebb('0x6'));var sox=require(_0x1ebb('0x7'));var csv=require(_0x1ebb('0x8'));var ejs=require(_0x1ebb('0x9'));var fs=require('fs');var fs_extra=require(_0x1ebb('0xa'));var _=require(_0x1ebb('0xb'));var squel=require('squel');var crypto=require(_0x1ebb('0xc'));var jsforce=require(_0x1ebb('0xd'));var deskjs=require(_0x1ebb('0xe'));var toCsv=require(_0x1ebb('0x8'));var querystring=require(_0x1ebb('0xf'));var Papa=require(_0x1ebb('0x10'));var Redis=require(_0x1ebb('0x11'));var authService=require(_0x1ebb('0x12'));var qs=require(_0x1ebb('0x13'));var as=require(_0x1ebb('0x14'));var hardwareService=require(_0x1ebb('0x15'));var logger=require(_0x1ebb('0x16'))('api');var utils=require(_0x1ebb('0x17'));var config=require(_0x1ebb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ebb('0x19'))['db'];function respondWithStatusCode(_0x46b62c,_0x3085bf){_0x3085bf=_0x3085bf||0xcc;return function(_0x51f6bd){if(_0x51f6bd){return _0x46b62c['sendStatus'](_0x3085bf);}return _0x46b62c[_0x1ebb('0x1a')](_0x3085bf)[_0x1ebb('0x1b')]();};}function respondWithResult(_0x5a6f72,_0x303dd4){_0x303dd4=_0x303dd4||0xc8;return function(_0x1fd04c){if(_0x1fd04c){return _0x5a6f72[_0x1ebb('0x1a')](_0x303dd4)[_0x1ebb('0x1c')](_0x1fd04c);}};}function respondWithFilteredResult(_0x4d9b93,_0x460a59){return function(_0x2443c4){if(_0x2443c4){var _0x478cfa=typeof _0x460a59[_0x1ebb('0x1d')]==='undefined'&&typeof _0x460a59[_0x1ebb('0x1e')]===_0x1ebb('0x1f');var _0x2262b4=_0x2443c4['count'];var _0x3c09c4=_0x478cfa?0x0:_0x460a59[_0x1ebb('0x1d')];var _0x555ab2=_0x478cfa?_0x2443c4['count']:_0x460a59[_0x1ebb('0x1d')]+_0x460a59[_0x1ebb('0x1e')];var _0x4afbe6;if(_0x555ab2>=_0x2262b4){_0x555ab2=_0x2262b4;_0x4afbe6=0xc8;}else{_0x4afbe6=0xce;}_0x4d9b93[_0x1ebb('0x1a')](_0x4afbe6);return _0x4d9b93[_0x1ebb('0x20')](_0x1ebb('0x21'),_0x3c09c4+'-'+_0x555ab2+'/'+_0x2262b4)[_0x1ebb('0x1c')](_0x2443c4);}return null;};}function patchUpdates(_0x838f2d){return function(_0x18cab0){try{jsonpatch[_0x1ebb('0x22')](_0x18cab0,_0x838f2d,!![]);}catch(_0x48b198){return BPromise[_0x1ebb('0x23')](_0x48b198);}return _0x18cab0[_0x1ebb('0x24')]();};}function saveUpdates(_0x5607ba,_0x3968aa){return function(_0x35c2bd){if(_0x35c2bd){return _0x35c2bd[_0x1ebb('0x25')](_0x5607ba)[_0x1ebb('0x26')](function(_0xf5c37b){return _0xf5c37b;});}return null;};}function removeEntity(_0x4d4d2c,_0x2fcf6b){return function(_0x4425c1){if(_0x4425c1){return _0x4425c1[_0x1ebb('0x27')]()['then'](function(){_0x4d4d2c[_0x1ebb('0x1a')](0xcc)[_0x1ebb('0x1b')]();});}};}function handleEntityNotFound(_0x126d16,_0x516726){return function(_0x4b5876){if(!_0x4b5876){_0x126d16[_0x1ebb('0x28')](0x194);}return _0x4b5876;};}function handleError(_0x5adceb,_0x25e818){_0x25e818=_0x25e818||0x1f4;return function(_0x5b8295){logger['error'](_0x5b8295[_0x1ebb('0x29')]);if(_0x5b8295[_0x1ebb('0x2a')]){delete _0x5b8295['name'];}_0x5adceb[_0x1ebb('0x1a')](_0x25e818)['send'](_0x5b8295);};}exports[_0x1ebb('0x2b')]=function(_0xc397f7,_0x5535bd){var _0x1592e6={},_0x15c343={},_0x68548c={'count':0x0,'rows':[]};var _0x31f20e=_[_0x1ebb('0x2c')](db['DeskConfiguration']['rawAttributes'],function(_0x4f2446){return{'name':_0x4f2446[_0x1ebb('0x2d')],'type':_0x4f2446[_0x1ebb('0x2e')][_0x1ebb('0x2f')]};});_0x15c343[_0x1ebb('0x30')]=_[_0x1ebb('0x2c')](_0x31f20e,_0x1ebb('0x2a'));_0x15c343[_0x1ebb('0x31')]=_[_0x1ebb('0x32')](_0xc397f7[_0x1ebb('0x31')]);_0x15c343[_0x1ebb('0x33')]=_[_0x1ebb('0x34')](_0x15c343[_0x1ebb('0x30')],_0x15c343[_0x1ebb('0x31')]);_0x1592e6['attributes']=_['intersection'](_0x15c343['model'],qs[_0x1ebb('0x35')](_0xc397f7[_0x1ebb('0x31')][_0x1ebb('0x35')]));_0x1592e6['attributes']=_0x1592e6[_0x1ebb('0x36')][_0x1ebb('0x37')]?_0x1592e6[_0x1ebb('0x36')]:_0x15c343['model'];if(!_0xc397f7[_0x1ebb('0x31')][_0x1ebb('0x38')](_0x1ebb('0x39'))){_0x1592e6[_0x1ebb('0x1e')]=qs[_0x1ebb('0x1e')](_0xc397f7[_0x1ebb('0x31')]['limit']);_0x1592e6['offset']=qs[_0x1ebb('0x1d')](_0xc397f7[_0x1ebb('0x31')][_0x1ebb('0x1d')]);}_0x1592e6['order']=qs[_0x1ebb('0x3a')](_0xc397f7[_0x1ebb('0x31')]['sort']);_0x1592e6[_0x1ebb('0x3b')]=qs['filters'](_[_0x1ebb('0x3c')](_0xc397f7[_0x1ebb('0x31')],_0x15c343[_0x1ebb('0x33')]),_0x31f20e);if(_0xc397f7[_0x1ebb('0x31')][_0x1ebb('0x3d')]){_0x1592e6[_0x1ebb('0x3b')]=_[_0x1ebb('0x3e')](_0x1592e6['where'],{'$or':_[_0x1ebb('0x2c')](_0x31f20e,function(_0x35d1e7){if(_0x35d1e7[_0x1ebb('0x2e')]!==_0x1ebb('0x3f')){var _0xffba81={};_0xffba81[_0x35d1e7[_0x1ebb('0x2a')]]={'$like':'%'+_0xc397f7[_0x1ebb('0x31')][_0x1ebb('0x3d')]+'%'};return _0xffba81;}})});}_0x1592e6=_[_0x1ebb('0x3e')]({},_0x1592e6,_0xc397f7[_0x1ebb('0x40')]);var _0x4456db={'where':_0x1592e6[_0x1ebb('0x3b')]};return db[_0x1ebb('0x41')][_0x1ebb('0x42')](_0x4456db)[_0x1ebb('0x26')](function(_0x32f26c){_0x68548c['count']=_0x32f26c;if(_0xc397f7[_0x1ebb('0x31')][_0x1ebb('0x43')]){_0x1592e6[_0x1ebb('0x44')]=[{'all':!![]}];}return db[_0x1ebb('0x41')]['findAll'](_0x1592e6);})[_0x1ebb('0x26')](function(_0x4d4d9){_0x68548c[_0x1ebb('0x45')]=_0x4d4d9;return _0x68548c;})['then'](respondWithFilteredResult(_0x5535bd,_0x1592e6))[_0x1ebb('0x46')](handleError(_0x5535bd,null));};exports['show']=function(_0x36461d,_0x25ebdc){var _0x759906={'raw':![],'where':{'id':_0x36461d['params']['id']}},_0x31fc16={};_0x31fc16[_0x1ebb('0x30')]=_[_0x1ebb('0x32')](db['DeskConfiguration'][_0x1ebb('0x47')]);_0x31fc16['query']=_[_0x1ebb('0x32')](_0x36461d[_0x1ebb('0x31')]);_0x31fc16[_0x1ebb('0x33')]=_[_0x1ebb('0x34')](_0x31fc16['model'],_0x31fc16['query']);_0x759906[_0x1ebb('0x36')]=_[_0x1ebb('0x34')](_0x31fc16[_0x1ebb('0x30')],qs[_0x1ebb('0x35')](_0x36461d[_0x1ebb('0x31')][_0x1ebb('0x35')]));_0x759906[_0x1ebb('0x36')]=_0x759906[_0x1ebb('0x36')][_0x1ebb('0x37')]?_0x759906[_0x1ebb('0x36')]:_0x31fc16[_0x1ebb('0x30')];if(_0x36461d[_0x1ebb('0x31')]['includeAll']){_0x759906[_0x1ebb('0x44')]=[{'all':!![]}];}_0x759906=_[_0x1ebb('0x3e')]({},_0x759906,_0x36461d[_0x1ebb('0x40')]);return db[_0x1ebb('0x41')][_0x1ebb('0x48')](_0x759906)[_0x1ebb('0x26')](handleEntityNotFound(_0x25ebdc,null))[_0x1ebb('0x26')](respondWithResult(_0x25ebdc,null))['catch'](handleError(_0x25ebdc,null));};exports[_0x1ebb('0x49')]=function(_0x2503ab,_0x4c8ac8){return db[_0x1ebb('0x41')][_0x1ebb('0x49')](_0x2503ab[_0x1ebb('0x4a')],{})['then'](respondWithResult(_0x4c8ac8,0xc9))[_0x1ebb('0x46')](handleError(_0x4c8ac8,null));};exports['update']=function(_0x49c843,_0x5d2349){if(_0x49c843[_0x1ebb('0x4a')]['id']){delete _0x49c843[_0x1ebb('0x4a')]['id'];}return db[_0x1ebb('0x41')][_0x1ebb('0x48')]({'where':{'id':_0x49c843['params']['id']}})[_0x1ebb('0x26')](handleEntityNotFound(_0x5d2349,null))['then'](saveUpdates(_0x49c843['body'],null))[_0x1ebb('0x26')](respondWithResult(_0x5d2349,null))[_0x1ebb('0x46')](handleError(_0x5d2349,null));};exports[_0x1ebb('0x27')]=function(_0x3eb4de,_0x21db05){return db['DeskConfiguration'][_0x1ebb('0x48')]({'where':{'id':_0x3eb4de[_0x1ebb('0x4b')]['id']}})[_0x1ebb('0x26')](handleEntityNotFound(_0x21db05,null))[_0x1ebb('0x26')](removeEntity(_0x21db05,null))['catch'](handleError(_0x21db05,null));};exports[_0x1ebb('0x4c')]=function(_0x30885f,_0x5e1a0e,_0x6cd99f){var _0x50a4e1={};var _0x2a20d6={};var _0x4c426e;var _0x11c78d;return db[_0x1ebb('0x41')][_0x1ebb('0x4d')]({'where':{'id':_0x30885f['params']['id']}})[_0x1ebb('0x26')](handleEntityNotFound(_0x5e1a0e,null))[_0x1ebb('0x26')](function(_0x1997bf){if(_0x1997bf){_0x4c426e=_0x1997bf;_0x2a20d6[_0x1ebb('0x30')]=_[_0x1ebb('0x32')](db[_0x1ebb('0x4e')]['rawAttributes']);_0x2a20d6[_0x1ebb('0x31')]=_[_0x1ebb('0x32')](_0x30885f[_0x1ebb('0x31')]);_0x2a20d6[_0x1ebb('0x33')]=_[_0x1ebb('0x34')](_0x2a20d6[_0x1ebb('0x30')],_0x2a20d6[_0x1ebb('0x31')]);_0x50a4e1[_0x1ebb('0x36')]=_['intersection'](_0x2a20d6[_0x1ebb('0x30')],qs[_0x1ebb('0x35')](_0x30885f['query']['fields']));_0x50a4e1[_0x1ebb('0x36')]=_0x50a4e1['attributes']['length']?_0x50a4e1['attributes']:_0x2a20d6[_0x1ebb('0x30')];_0x50a4e1[_0x1ebb('0x4f')]=qs[_0x1ebb('0x3a')](_0x30885f[_0x1ebb('0x31')]['sort']);_0x50a4e1[_0x1ebb('0x3b')]=qs[_0x1ebb('0x33')](_[_0x1ebb('0x3c')](_0x30885f[_0x1ebb('0x31')],_0x2a20d6[_0x1ebb('0x33')]));if(_0x30885f[_0x1ebb('0x31')][_0x1ebb('0x3d')]){_0x50a4e1[_0x1ebb('0x3b')]=_[_0x1ebb('0x3e')](_0x50a4e1['where'],{'$or':_[_0x1ebb('0x2c')](_0x50a4e1[_0x1ebb('0x36')],function(_0x232387){var _0x22aa1f={};_0x22aa1f[_0x232387]={'$like':'%'+_0x30885f[_0x1ebb('0x31')]['filter']+'%'};return _0x22aa1f;})});}_0x50a4e1=_[_0x1ebb('0x3e')]({},_0x50a4e1,_0x30885f[_0x1ebb('0x40')]);return _0x4c426e[_0x1ebb('0x4c')](_0x50a4e1);}})[_0x1ebb('0x26')](function(_0x380a39){if(_0x380a39){_0x11c78d=_0x380a39[_0x1ebb('0x37')];if(!_0x30885f[_0x1ebb('0x31')][_0x1ebb('0x38')](_0x1ebb('0x39'))){_0x50a4e1[_0x1ebb('0x1e')]=qs[_0x1ebb('0x1e')](_0x30885f[_0x1ebb('0x31')][_0x1ebb('0x1e')]);_0x50a4e1[_0x1ebb('0x1d')]=qs['offset'](_0x30885f[_0x1ebb('0x31')][_0x1ebb('0x1d')]);}return _0x4c426e[_0x1ebb('0x4c')](_0x50a4e1);}})[_0x1ebb('0x26')](function(_0x335741){if(_0x335741){return _0x335741?{'count':_0x11c78d,'rows':_0x335741}:null;}})[_0x1ebb('0x26')](respondWithResult(_0x5e1a0e,null))[_0x1ebb('0x46')](handleError(_0x5e1a0e,null));};exports[_0x1ebb('0x50')]=function(_0x109825,_0x4ac74b,_0x571edc){var _0x5a7a6a={};var _0x53b9d4={};var _0x53395e;var _0x45e31d;return db[_0x1ebb('0x41')]['findOne']({'where':{'id':_0x109825[_0x1ebb('0x4b')]['id']}})[_0x1ebb('0x26')](handleEntityNotFound(_0x4ac74b,null))[_0x1ebb('0x26')](function(_0x63e96){if(_0x63e96){_0x53395e=_0x63e96;_0x53b9d4[_0x1ebb('0x30')]=_[_0x1ebb('0x32')](db[_0x1ebb('0x4e')][_0x1ebb('0x47')]);_0x53b9d4[_0x1ebb('0x31')]=_[_0x1ebb('0x32')](_0x109825['query']);_0x53b9d4[_0x1ebb('0x33')]=_[_0x1ebb('0x34')](_0x53b9d4[_0x1ebb('0x30')],_0x53b9d4[_0x1ebb('0x31')]);_0x5a7a6a['attributes']=_[_0x1ebb('0x34')](_0x53b9d4[_0x1ebb('0x30')],qs['fields'](_0x109825[_0x1ebb('0x31')][_0x1ebb('0x35')]));_0x5a7a6a['attributes']=_0x5a7a6a[_0x1ebb('0x36')][_0x1ebb('0x37')]?_0x5a7a6a[_0x1ebb('0x36')]:_0x53b9d4[_0x1ebb('0x30')];_0x5a7a6a[_0x1ebb('0x4f')]=qs[_0x1ebb('0x3a')](_0x109825[_0x1ebb('0x31')][_0x1ebb('0x3a')]);_0x5a7a6a[_0x1ebb('0x3b')]=qs[_0x1ebb('0x33')](_[_0x1ebb('0x3c')](_0x109825['query'],_0x53b9d4[_0x1ebb('0x33')]));if(_0x109825[_0x1ebb('0x31')][_0x1ebb('0x3d')]){_0x5a7a6a[_0x1ebb('0x3b')]=_[_0x1ebb('0x3e')](_0x5a7a6a[_0x1ebb('0x3b')],{'$or':_[_0x1ebb('0x2c')](_0x5a7a6a[_0x1ebb('0x36')],function(_0x5aa372){var _0x37f974={};_0x37f974[_0x5aa372]={'$like':'%'+_0x109825[_0x1ebb('0x31')][_0x1ebb('0x3d')]+'%'};return _0x37f974;})});}_0x5a7a6a=_['merge']({},_0x5a7a6a,_0x109825[_0x1ebb('0x40')]);return _0x53395e[_0x1ebb('0x50')](_0x5a7a6a);}})[_0x1ebb('0x26')](function(_0x27a4da){if(_0x27a4da){_0x45e31d=_0x27a4da[_0x1ebb('0x37')];if(!_0x109825[_0x1ebb('0x31')]['hasOwnProperty'](_0x1ebb('0x39'))){_0x5a7a6a['limit']=qs['limit'](_0x109825[_0x1ebb('0x31')]['limit']);_0x5a7a6a[_0x1ebb('0x1d')]=qs['offset'](_0x109825[_0x1ebb('0x31')][_0x1ebb('0x1d')]);}return _0x53395e['getSubjects'](_0x5a7a6a);}})[_0x1ebb('0x26')](function(_0xf0a013){if(_0xf0a013){return _0xf0a013?{'count':_0x45e31d,'rows':_0xf0a013}:null;}})['then'](respondWithResult(_0x4ac74b,null))[_0x1ebb('0x46')](handleError(_0x4ac74b,null));};exports[_0x1ebb('0x51')]=function(_0x37a140,_0x105128,_0x33d7d4){var _0xca1ba7={};var _0x33f74e={};var _0x339e0a;var _0x26c740;return db[_0x1ebb('0x41')][_0x1ebb('0x4d')]({'where':{'id':_0x37a140[_0x1ebb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x105128,null))['then'](function(_0x3fa7a9){if(_0x3fa7a9){_0x339e0a=_0x3fa7a9;_0x33f74e[_0x1ebb('0x30')]=_[_0x1ebb('0x32')](db['DeskField'][_0x1ebb('0x47')]);_0x33f74e[_0x1ebb('0x31')]=_[_0x1ebb('0x32')](_0x37a140[_0x1ebb('0x31')]);_0x33f74e[_0x1ebb('0x33')]=_[_0x1ebb('0x34')](_0x33f74e[_0x1ebb('0x30')],_0x33f74e[_0x1ebb('0x31')]);_0xca1ba7[_0x1ebb('0x36')]=_[_0x1ebb('0x34')](_0x33f74e[_0x1ebb('0x30')],qs[_0x1ebb('0x35')](_0x37a140[_0x1ebb('0x31')][_0x1ebb('0x35')]));_0xca1ba7[_0x1ebb('0x36')]=_0xca1ba7[_0x1ebb('0x36')]['length']?_0xca1ba7['attributes']:_0x33f74e[_0x1ebb('0x30')];_0xca1ba7[_0x1ebb('0x4f')]=qs[_0x1ebb('0x3a')](_0x37a140[_0x1ebb('0x31')][_0x1ebb('0x3a')]);_0xca1ba7[_0x1ebb('0x3b')]=qs[_0x1ebb('0x33')](_[_0x1ebb('0x3c')](_0x37a140[_0x1ebb('0x31')],_0x33f74e[_0x1ebb('0x33')]));if(_0x37a140['query'][_0x1ebb('0x3d')]){_0xca1ba7['where']=_[_0x1ebb('0x3e')](_0xca1ba7['where'],{'$or':_['map'](_0xca1ba7[_0x1ebb('0x36')],function(_0x15e50d){var _0x14da1e={};_0x14da1e[_0x15e50d]={'$like':'%'+_0x37a140['query']['filter']+'%'};return _0x14da1e;})});}_0xca1ba7=_[_0x1ebb('0x3e')]({},_0xca1ba7,_0x37a140[_0x1ebb('0x40')]);return _0x339e0a['getDescriptions'](_0xca1ba7);}})['then'](function(_0x3bd0f3){if(_0x3bd0f3){_0x26c740=_0x3bd0f3[_0x1ebb('0x37')];if(!_0x37a140[_0x1ebb('0x31')][_0x1ebb('0x38')](_0x1ebb('0x39'))){_0xca1ba7['limit']=qs[_0x1ebb('0x1e')](_0x37a140[_0x1ebb('0x31')][_0x1ebb('0x1e')]);_0xca1ba7[_0x1ebb('0x1d')]=qs[_0x1ebb('0x1d')](_0x37a140[_0x1ebb('0x31')][_0x1ebb('0x1d')]);}return _0x339e0a['getDescriptions'](_0xca1ba7);}})[_0x1ebb('0x26')](function(_0x29b6f6){if(_0x29b6f6){return _0x29b6f6?{'count':_0x26c740,'rows':_0x29b6f6}:null;}})[_0x1ebb('0x26')](respondWithResult(_0x105128,null))[_0x1ebb('0x46')](handleError(_0x105128,null));};exports[_0x1ebb('0x52')]=function(_0x9caa7d,_0x2b4313,_0x2ebb3b){var _0x10b27a={};var _0x26ca4d={};var _0x13368a;var _0x121fa5;return db['DeskConfiguration'][_0x1ebb('0x4d')]({'where':{'id':_0x9caa7d['params']['id']}})[_0x1ebb('0x26')](handleEntityNotFound(_0x2b4313,null))[_0x1ebb('0x26')](function(_0x1f14d6){if(_0x1f14d6){_0x13368a=_0x1f14d6;_0x26ca4d[_0x1ebb('0x30')]=_[_0x1ebb('0x32')](db[_0x1ebb('0x53')][_0x1ebb('0x47')]);_0x26ca4d[_0x1ebb('0x31')]=_['keys'](_0x9caa7d['query']);_0x26ca4d[_0x1ebb('0x33')]=_['intersection'](_0x26ca4d['model'],_0x26ca4d[_0x1ebb('0x31')]);_0x10b27a[_0x1ebb('0x36')]=_[_0x1ebb('0x34')](_0x26ca4d[_0x1ebb('0x30')],qs['fields'](_0x9caa7d[_0x1ebb('0x31')]['fields']));_0x10b27a[_0x1ebb('0x36')]=_0x10b27a[_0x1ebb('0x36')]['length']?_0x10b27a[_0x1ebb('0x36')]:_0x26ca4d[_0x1ebb('0x30')];_0x10b27a['order']=qs[_0x1ebb('0x3a')](_0x9caa7d[_0x1ebb('0x31')][_0x1ebb('0x3a')]);_0x10b27a['where']=qs[_0x1ebb('0x33')](_[_0x1ebb('0x3c')](_0x9caa7d[_0x1ebb('0x31')],_0x26ca4d[_0x1ebb('0x33')]));if(_0x9caa7d[_0x1ebb('0x31')][_0x1ebb('0x3d')]){_0x10b27a[_0x1ebb('0x3b')]=_['merge'](_0x10b27a['where'],{'$or':_[_0x1ebb('0x2c')](_0x10b27a[_0x1ebb('0x36')],function(_0xe89857){var _0x5ed0cf={};_0x5ed0cf[_0xe89857]={'$like':'%'+_0x9caa7d[_0x1ebb('0x31')]['filter']+'%'};return _0x5ed0cf;})});}_0x10b27a=_[_0x1ebb('0x3e')]({},_0x10b27a,_0x9caa7d[_0x1ebb('0x40')]);return _0x13368a[_0x1ebb('0x52')](_0x10b27a);}})[_0x1ebb('0x26')](function(_0x2793dc){if(_0x2793dc){_0x121fa5=_0x2793dc[_0x1ebb('0x37')];if(!_0x9caa7d['query'][_0x1ebb('0x38')](_0x1ebb('0x39'))){_0x10b27a[_0x1ebb('0x1e')]=qs[_0x1ebb('0x1e')](_0x9caa7d[_0x1ebb('0x31')][_0x1ebb('0x1e')]);_0x10b27a['offset']=qs[_0x1ebb('0x1d')](_0x9caa7d[_0x1ebb('0x31')][_0x1ebb('0x1d')]);}return _0x13368a[_0x1ebb('0x52')](_0x10b27a);}})[_0x1ebb('0x26')](function(_0x45b393){if(_0x45b393){return _0x45b393?{'count':_0x121fa5,'rows':_0x45b393}:null;}})[_0x1ebb('0x26')](respondWithResult(_0x2b4313,null))['catch'](handleError(_0x2b4313,null));};exports[_0x1ebb('0x54')]=function(_0x1a0045,_0x3922a8,_0x4fa75a){if(_0x1a0045[_0x1ebb('0x4a')]['id']){delete _0x1a0045['body']['id'];}return db['DeskConfiguration'][_0x1ebb('0x4d')]({'where':{'id':_0x1a0045['params']['id']}})[_0x1ebb('0x26')](handleEntityNotFound(_0x3922a8,null))['then'](function(_0x1a392f){if(_0x1a392f){return _0x1a392f[_0x1ebb('0x54')](_0x1a0045[_0x1ebb('0x4a')][_0x1ebb('0x55')]||[]);}return null;})[_0x1ebb('0x26')](respondWithResult(_0x3922a8,null))[_0x1ebb('0x46')](handleError(_0x3922a8,null));}; \ No newline at end of file +var _0x117f=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields'];(function(_0x2da80e,_0x2391be){var _0x242118=function(_0x34b5b4){while(--_0x34b5b4){_0x2da80e['push'](_0x2da80e['shift']());}};_0x242118(++_0x2391be);}(_0x117f,0x16a));var _0xf117=function(_0x268de5,_0x2a4b73){_0x268de5=_0x268de5-0x0;var _0xc5fb51=_0x117f[_0x268de5];return _0xc5fb51;};'use strict';var emlformat=require(_0xf117('0x0'));var rimraf=require(_0xf117('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf117('0x2'));var rp=require(_0xf117('0x3'));var moment=require(_0xf117('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf117('0x5'));var util=require(_0xf117('0x6'));var path=require(_0xf117('0x7'));var sox=require(_0xf117('0x8'));var csv=require(_0xf117('0x9'));var ejs=require(_0xf117('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf117('0xb'));var squel=require('squel');var crypto=require(_0xf117('0xc'));var jsforce=require(_0xf117('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf117('0xe'));var Papa=require(_0xf117('0xf'));var Redis=require(_0xf117('0x10'));var authService=require(_0xf117('0x11'));var qs=require(_0xf117('0x12'));var as=require(_0xf117('0x13'));var hardwareService=require(_0xf117('0x14'));var logger=require(_0xf117('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf117('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d05a,_0x2baefb){_0x2baefb=_0x2baefb||0xcc;return function(_0x1fb3a0){if(_0x1fb3a0){return _0x27d05a[_0xf117('0x17')](_0x2baefb);}return _0x27d05a[_0xf117('0x18')](_0x2baefb)[_0xf117('0x19')]();};}function respondWithResult(_0x304ae9,_0x537de5){_0x537de5=_0x537de5||0xc8;return function(_0x18dc7d){if(_0x18dc7d){return _0x304ae9[_0xf117('0x18')](_0x537de5)[_0xf117('0x1a')](_0x18dc7d);}};}function respondWithFilteredResult(_0x407b19,_0x54a2e8){return function(_0x4170d7){if(_0x4170d7){var _0x2aec43=typeof _0x54a2e8[_0xf117('0x1b')]===_0xf117('0x1c')&&typeof _0x54a2e8[_0xf117('0x1d')]===_0xf117('0x1c');var _0x4acfba=_0x4170d7[_0xf117('0x1e')];var _0x47848d=_0x2aec43?0x0:_0x54a2e8[_0xf117('0x1b')];var _0x3a01e3=_0x2aec43?_0x4170d7['count']:_0x54a2e8[_0xf117('0x1b')]+_0x54a2e8[_0xf117('0x1d')];var _0x34eb09;if(_0x3a01e3>=_0x4acfba){_0x3a01e3=_0x4acfba;_0x34eb09=0xc8;}else{_0x34eb09=0xce;}_0x407b19[_0xf117('0x18')](_0x34eb09);return _0x407b19[_0xf117('0x1f')](_0xf117('0x20'),_0x47848d+'-'+_0x3a01e3+'/'+_0x4acfba)[_0xf117('0x1a')](_0x4170d7);}return null;};}function patchUpdates(_0x58dfe2){return function(_0x4e9183){try{jsonpatch[_0xf117('0x21')](_0x4e9183,_0x58dfe2,!![]);}catch(_0x57c31d){return BPromise[_0xf117('0x22')](_0x57c31d);}return _0x4e9183['save']();};}function saveUpdates(_0x5c6106,_0x3cae84){return function(_0x199fea){if(_0x199fea){return _0x199fea[_0xf117('0x23')](_0x5c6106)[_0xf117('0x24')](function(_0x119c1e){return _0x119c1e;});}return null;};}function removeEntity(_0x4bfd91,_0x83b169){return function(_0x3c1c3e){if(_0x3c1c3e){return _0x3c1c3e[_0xf117('0x25')]()['then'](function(){_0x4bfd91[_0xf117('0x18')](0xcc)[_0xf117('0x19')]();});}};}function handleEntityNotFound(_0x288014,_0x55475c){return function(_0x24fcc9){if(!_0x24fcc9){_0x288014[_0xf117('0x17')](0x194);}return _0x24fcc9;};}function handleError(_0x20e1fc,_0x91e04c){_0x91e04c=_0x91e04c||0x1f4;return function(_0x5424a7){logger['error'](_0x5424a7['stack']);if(_0x5424a7['name']){delete _0x5424a7[_0xf117('0x26')];}_0x20e1fc['status'](_0x91e04c)[_0xf117('0x27')](_0x5424a7);};}exports[_0xf117('0x28')]=function(_0x3a4d4e,_0x2b4774){var _0x290044={},_0x51033c={},_0x4098f9={'count':0x0,'rows':[]};var _0x208626=_[_0xf117('0x29')](db[_0xf117('0x2a')][_0xf117('0x2b')],function(_0x3c5ccf){return{'name':_0x3c5ccf[_0xf117('0x2c')],'type':_0x3c5ccf[_0xf117('0x2d')][_0xf117('0x2e')]};});_0x51033c[_0xf117('0x2f')]=_[_0xf117('0x29')](_0x208626,_0xf117('0x26'));_0x51033c[_0xf117('0x30')]=_[_0xf117('0x31')](_0x3a4d4e[_0xf117('0x30')]);_0x51033c['filters']=_['intersection'](_0x51033c[_0xf117('0x2f')],_0x51033c[_0xf117('0x30')]);_0x290044[_0xf117('0x32')]=_[_0xf117('0x33')](_0x51033c[_0xf117('0x2f')],qs[_0xf117('0x34')](_0x3a4d4e['query'][_0xf117('0x34')]));_0x290044[_0xf117('0x32')]=_0x290044[_0xf117('0x32')][_0xf117('0x35')]?_0x290044[_0xf117('0x32')]:_0x51033c[_0xf117('0x2f')];if(!_0x3a4d4e[_0xf117('0x30')][_0xf117('0x36')](_0xf117('0x37'))){_0x290044[_0xf117('0x1d')]=qs[_0xf117('0x1d')](_0x3a4d4e[_0xf117('0x30')][_0xf117('0x1d')]);_0x290044[_0xf117('0x1b')]=qs['offset'](_0x3a4d4e[_0xf117('0x30')][_0xf117('0x1b')]);}_0x290044[_0xf117('0x38')]=qs['sort'](_0x3a4d4e['query'][_0xf117('0x39')]);_0x290044[_0xf117('0x3a')]=qs[_0xf117('0x3b')](_['pick'](_0x3a4d4e['query'],_0x51033c['filters']),_0x208626);if(_0x3a4d4e[_0xf117('0x30')][_0xf117('0x3c')]){_0x290044[_0xf117('0x3a')]=_['merge'](_0x290044['where'],{'$or':_[_0xf117('0x29')](_0x208626,function(_0x1dd699){if(_0x1dd699[_0xf117('0x2d')]!==_0xf117('0x3d')){var _0x157c80={};_0x157c80[_0x1dd699['name']]={'$like':'%'+_0x3a4d4e[_0xf117('0x30')][_0xf117('0x3c')]+'%'};return _0x157c80;}})});}_0x290044=_[_0xf117('0x3e')]({},_0x290044,_0x3a4d4e[_0xf117('0x3f')]);var _0x14ab4a={'where':_0x290044[_0xf117('0x3a')]};return db[_0xf117('0x2a')]['count'](_0x14ab4a)['then'](function(_0x4e86e1){_0x4098f9[_0xf117('0x1e')]=_0x4e86e1;if(_0x3a4d4e[_0xf117('0x30')][_0xf117('0x40')]){_0x290044[_0xf117('0x41')]=[{'all':!![]}];}return db[_0xf117('0x2a')][_0xf117('0x42')](_0x290044);})[_0xf117('0x24')](function(_0x2809fb){_0x4098f9[_0xf117('0x43')]=_0x2809fb;return _0x4098f9;})[_0xf117('0x24')](respondWithFilteredResult(_0x2b4774,_0x290044))['catch'](handleError(_0x2b4774,null));};exports[_0xf117('0x44')]=function(_0x10be3d,_0xfdfeb9){var _0x5a28f9={'raw':![],'where':{'id':_0x10be3d[_0xf117('0x45')]['id']}},_0x4f46b9={};_0x4f46b9[_0xf117('0x2f')]=_[_0xf117('0x31')](db[_0xf117('0x2a')][_0xf117('0x2b')]);_0x4f46b9[_0xf117('0x30')]=_[_0xf117('0x31')](_0x10be3d[_0xf117('0x30')]);_0x4f46b9['filters']=_[_0xf117('0x33')](_0x4f46b9[_0xf117('0x2f')],_0x4f46b9[_0xf117('0x30')]);_0x5a28f9[_0xf117('0x32')]=_[_0xf117('0x33')](_0x4f46b9[_0xf117('0x2f')],qs[_0xf117('0x34')](_0x10be3d['query'][_0xf117('0x34')]));_0x5a28f9['attributes']=_0x5a28f9[_0xf117('0x32')]['length']?_0x5a28f9[_0xf117('0x32')]:_0x4f46b9[_0xf117('0x2f')];if(_0x10be3d['query'][_0xf117('0x40')]){_0x5a28f9['include']=[{'all':!![]}];}_0x5a28f9=_[_0xf117('0x3e')]({},_0x5a28f9,_0x10be3d[_0xf117('0x3f')]);return db[_0xf117('0x2a')][_0xf117('0x46')](_0x5a28f9)[_0xf117('0x24')](handleEntityNotFound(_0xfdfeb9,null))['then'](respondWithResult(_0xfdfeb9,null))[_0xf117('0x47')](handleError(_0xfdfeb9,null));};exports[_0xf117('0x48')]=function(_0xe0c864,_0x533853){return db[_0xf117('0x2a')][_0xf117('0x48')](_0xe0c864[_0xf117('0x49')],{})[_0xf117('0x24')](respondWithResult(_0x533853,0xc9))[_0xf117('0x47')](handleError(_0x533853,null));};exports[_0xf117('0x23')]=function(_0x5b78d2,_0x52edfc){if(_0x5b78d2[_0xf117('0x49')]['id']){delete _0x5b78d2['body']['id'];}return db[_0xf117('0x2a')][_0xf117('0x46')]({'where':{'id':_0x5b78d2[_0xf117('0x45')]['id']}})[_0xf117('0x24')](handleEntityNotFound(_0x52edfc,null))[_0xf117('0x24')](saveUpdates(_0x5b78d2[_0xf117('0x49')],null))[_0xf117('0x24')](respondWithResult(_0x52edfc,null))[_0xf117('0x47')](handleError(_0x52edfc,null));};exports['destroy']=function(_0xe8fa3f,_0x5dd597){return db['DeskConfiguration'][_0xf117('0x46')]({'where':{'id':_0xe8fa3f['params']['id']}})[_0xf117('0x24')](handleEntityNotFound(_0x5dd597,null))[_0xf117('0x24')](removeEntity(_0x5dd597,null))[_0xf117('0x47')](handleError(_0x5dd597,null));};exports[_0xf117('0x4a')]=function(_0xe455f9,_0x43eeaa,_0x2b8eca){var _0x499324={};var _0x5e4904={};var _0x5efae3;var _0x201f02;return db[_0xf117('0x2a')][_0xf117('0x4b')]({'where':{'id':_0xe455f9['params']['id']}})[_0xf117('0x24')](handleEntityNotFound(_0x43eeaa,null))[_0xf117('0x24')](function(_0xc14f3c){if(_0xc14f3c){_0x5efae3=_0xc14f3c;_0x5e4904[_0xf117('0x2f')]=_['keys'](db[_0xf117('0x4c')]['rawAttributes']);_0x5e4904[_0xf117('0x30')]=_[_0xf117('0x31')](_0xe455f9['query']);_0x5e4904[_0xf117('0x3b')]=_[_0xf117('0x33')](_0x5e4904[_0xf117('0x2f')],_0x5e4904['query']);_0x499324[_0xf117('0x32')]=_[_0xf117('0x33')](_0x5e4904[_0xf117('0x2f')],qs[_0xf117('0x34')](_0xe455f9[_0xf117('0x30')]['fields']));_0x499324['attributes']=_0x499324[_0xf117('0x32')]['length']?_0x499324[_0xf117('0x32')]:_0x5e4904[_0xf117('0x2f')];_0x499324[_0xf117('0x38')]=qs[_0xf117('0x39')](_0xe455f9[_0xf117('0x30')][_0xf117('0x39')]);_0x499324[_0xf117('0x3a')]=qs[_0xf117('0x3b')](_['pick'](_0xe455f9['query'],_0x5e4904[_0xf117('0x3b')]));if(_0xe455f9[_0xf117('0x30')][_0xf117('0x3c')]){_0x499324['where']=_['merge'](_0x499324[_0xf117('0x3a')],{'$or':_[_0xf117('0x29')](_0x499324[_0xf117('0x32')],function(_0x1d0c19){var _0x478a89={};_0x478a89[_0x1d0c19]={'$like':'%'+_0xe455f9[_0xf117('0x30')][_0xf117('0x3c')]+'%'};return _0x478a89;})});}_0x499324=_['merge']({},_0x499324,_0xe455f9[_0xf117('0x3f')]);return _0x5efae3[_0xf117('0x4a')](_0x499324);}})[_0xf117('0x24')](function(_0x1c3675){if(_0x1c3675){_0x201f02=_0x1c3675['length'];if(!_0xe455f9[_0xf117('0x30')][_0xf117('0x36')](_0xf117('0x37'))){_0x499324[_0xf117('0x1d')]=qs[_0xf117('0x1d')](_0xe455f9[_0xf117('0x30')][_0xf117('0x1d')]);_0x499324[_0xf117('0x1b')]=qs[_0xf117('0x1b')](_0xe455f9[_0xf117('0x30')][_0xf117('0x1b')]);}return _0x5efae3[_0xf117('0x4a')](_0x499324);}})[_0xf117('0x24')](function(_0x172514){if(_0x172514){return _0x172514?{'count':_0x201f02,'rows':_0x172514}:null;}})[_0xf117('0x24')](respondWithResult(_0x43eeaa,null))[_0xf117('0x47')](handleError(_0x43eeaa,null));};exports['getSubjects']=function(_0x19d67f,_0x52ee62,_0x37c64d){var _0x13fe43={};var _0x1ac1cb={};var _0x1bf048;var _0x477856;return db[_0xf117('0x2a')]['findOne']({'where':{'id':_0x19d67f[_0xf117('0x45')]['id']}})[_0xf117('0x24')](handleEntityNotFound(_0x52ee62,null))[_0xf117('0x24')](function(_0x12ea30){if(_0x12ea30){_0x1bf048=_0x12ea30;_0x1ac1cb['model']=_['keys'](db[_0xf117('0x4c')][_0xf117('0x2b')]);_0x1ac1cb[_0xf117('0x30')]=_[_0xf117('0x31')](_0x19d67f['query']);_0x1ac1cb[_0xf117('0x3b')]=_[_0xf117('0x33')](_0x1ac1cb['model'],_0x1ac1cb[_0xf117('0x30')]);_0x13fe43[_0xf117('0x32')]=_[_0xf117('0x33')](_0x1ac1cb[_0xf117('0x2f')],qs[_0xf117('0x34')](_0x19d67f[_0xf117('0x30')][_0xf117('0x34')]));_0x13fe43[_0xf117('0x32')]=_0x13fe43[_0xf117('0x32')][_0xf117('0x35')]?_0x13fe43[_0xf117('0x32')]:_0x1ac1cb[_0xf117('0x2f')];_0x13fe43[_0xf117('0x38')]=qs[_0xf117('0x39')](_0x19d67f['query'][_0xf117('0x39')]);_0x13fe43[_0xf117('0x3a')]=qs['filters'](_[_0xf117('0x4d')](_0x19d67f['query'],_0x1ac1cb['filters']));if(_0x19d67f[_0xf117('0x30')][_0xf117('0x3c')]){_0x13fe43[_0xf117('0x3a')]=_[_0xf117('0x3e')](_0x13fe43['where'],{'$or':_['map'](_0x13fe43[_0xf117('0x32')],function(_0x2febcd){var _0x29e8ed={};_0x29e8ed[_0x2febcd]={'$like':'%'+_0x19d67f[_0xf117('0x30')][_0xf117('0x3c')]+'%'};return _0x29e8ed;})});}_0x13fe43=_[_0xf117('0x3e')]({},_0x13fe43,_0x19d67f[_0xf117('0x3f')]);return _0x1bf048[_0xf117('0x4e')](_0x13fe43);}})[_0xf117('0x24')](function(_0x3c6c51){if(_0x3c6c51){_0x477856=_0x3c6c51[_0xf117('0x35')];if(!_0x19d67f[_0xf117('0x30')]['hasOwnProperty'](_0xf117('0x37'))){_0x13fe43[_0xf117('0x1d')]=qs[_0xf117('0x1d')](_0x19d67f[_0xf117('0x30')][_0xf117('0x1d')]);_0x13fe43[_0xf117('0x1b')]=qs[_0xf117('0x1b')](_0x19d67f[_0xf117('0x30')][_0xf117('0x1b')]);}return _0x1bf048[_0xf117('0x4e')](_0x13fe43);}})[_0xf117('0x24')](function(_0x33884e){if(_0x33884e){return _0x33884e?{'count':_0x477856,'rows':_0x33884e}:null;}})[_0xf117('0x24')](respondWithResult(_0x52ee62,null))['catch'](handleError(_0x52ee62,null));};exports['getDescriptions']=function(_0x572f95,_0x11e03b,_0xc3b60c){var _0x2d17d7={};var _0x45ad2f={};var _0x47b930;var _0x29b815;return db['DeskConfiguration'][_0xf117('0x4b')]({'where':{'id':_0x572f95[_0xf117('0x45')]['id']}})['then'](handleEntityNotFound(_0x11e03b,null))[_0xf117('0x24')](function(_0x26ef1e){if(_0x26ef1e){_0x47b930=_0x26ef1e;_0x45ad2f['model']=_['keys'](db[_0xf117('0x4c')][_0xf117('0x2b')]);_0x45ad2f['query']=_[_0xf117('0x31')](_0x572f95[_0xf117('0x30')]);_0x45ad2f[_0xf117('0x3b')]=_[_0xf117('0x33')](_0x45ad2f[_0xf117('0x2f')],_0x45ad2f[_0xf117('0x30')]);_0x2d17d7[_0xf117('0x32')]=_[_0xf117('0x33')](_0x45ad2f[_0xf117('0x2f')],qs[_0xf117('0x34')](_0x572f95[_0xf117('0x30')][_0xf117('0x34')]));_0x2d17d7[_0xf117('0x32')]=_0x2d17d7[_0xf117('0x32')][_0xf117('0x35')]?_0x2d17d7[_0xf117('0x32')]:_0x45ad2f[_0xf117('0x2f')];_0x2d17d7[_0xf117('0x38')]=qs[_0xf117('0x39')](_0x572f95[_0xf117('0x30')]['sort']);_0x2d17d7[_0xf117('0x3a')]=qs['filters'](_['pick'](_0x572f95[_0xf117('0x30')],_0x45ad2f[_0xf117('0x3b')]));if(_0x572f95[_0xf117('0x30')][_0xf117('0x3c')]){_0x2d17d7[_0xf117('0x3a')]=_[_0xf117('0x3e')](_0x2d17d7[_0xf117('0x3a')],{'$or':_[_0xf117('0x29')](_0x2d17d7[_0xf117('0x32')],function(_0x5b18a1){var _0x27e8ca={};_0x27e8ca[_0x5b18a1]={'$like':'%'+_0x572f95['query'][_0xf117('0x3c')]+'%'};return _0x27e8ca;})});}_0x2d17d7=_[_0xf117('0x3e')]({},_0x2d17d7,_0x572f95[_0xf117('0x3f')]);return _0x47b930[_0xf117('0x4f')](_0x2d17d7);}})[_0xf117('0x24')](function(_0x22af51){if(_0x22af51){_0x29b815=_0x22af51[_0xf117('0x35')];if(!_0x572f95[_0xf117('0x30')][_0xf117('0x36')]('nolimit')){_0x2d17d7[_0xf117('0x1d')]=qs['limit'](_0x572f95[_0xf117('0x30')][_0xf117('0x1d')]);_0x2d17d7['offset']=qs['offset'](_0x572f95[_0xf117('0x30')]['offset']);}return _0x47b930[_0xf117('0x4f')](_0x2d17d7);}})['then'](function(_0x5e24cc){if(_0x5e24cc){return _0x5e24cc?{'count':_0x29b815,'rows':_0x5e24cc}:null;}})[_0xf117('0x24')](respondWithResult(_0x11e03b,null))[_0xf117('0x47')](handleError(_0x11e03b,null));};exports['getTags']=function(_0x5e1307,_0x1728fd,_0x1d6038){var _0x224b78={};var _0x39396a={};var _0x34da45;var _0x10d22b;return db[_0xf117('0x2a')][_0xf117('0x4b')]({'where':{'id':_0x5e1307[_0xf117('0x45')]['id']}})[_0xf117('0x24')](handleEntityNotFound(_0x1728fd,null))[_0xf117('0x24')](function(_0x3fcd24){if(_0x3fcd24){_0x34da45=_0x3fcd24;_0x39396a[_0xf117('0x2f')]=_[_0xf117('0x31')](db[_0xf117('0x50')][_0xf117('0x2b')]);_0x39396a[_0xf117('0x30')]=_[_0xf117('0x31')](_0x5e1307['query']);_0x39396a[_0xf117('0x3b')]=_[_0xf117('0x33')](_0x39396a[_0xf117('0x2f')],_0x39396a[_0xf117('0x30')]);_0x224b78[_0xf117('0x32')]=_[_0xf117('0x33')](_0x39396a['model'],qs[_0xf117('0x34')](_0x5e1307[_0xf117('0x30')][_0xf117('0x34')]));_0x224b78[_0xf117('0x32')]=_0x224b78[_0xf117('0x32')][_0xf117('0x35')]?_0x224b78['attributes']:_0x39396a[_0xf117('0x2f')];_0x224b78[_0xf117('0x38')]=qs[_0xf117('0x39')](_0x5e1307[_0xf117('0x30')][_0xf117('0x39')]);_0x224b78[_0xf117('0x3a')]=qs[_0xf117('0x3b')](_[_0xf117('0x4d')](_0x5e1307[_0xf117('0x30')],_0x39396a[_0xf117('0x3b')]));if(_0x5e1307['query'][_0xf117('0x3c')]){_0x224b78[_0xf117('0x3a')]=_[_0xf117('0x3e')](_0x224b78[_0xf117('0x3a')],{'$or':_[_0xf117('0x29')](_0x224b78['attributes'],function(_0x773231){var _0x6ac4e1={};_0x6ac4e1[_0x773231]={'$like':'%'+_0x5e1307[_0xf117('0x30')][_0xf117('0x3c')]+'%'};return _0x6ac4e1;})});}_0x224b78=_[_0xf117('0x3e')]({},_0x224b78,_0x5e1307[_0xf117('0x3f')]);return _0x34da45['getTags'](_0x224b78);}})[_0xf117('0x24')](function(_0x26b915){if(_0x26b915){_0x10d22b=_0x26b915[_0xf117('0x35')];if(!_0x5e1307['query']['hasOwnProperty'](_0xf117('0x37'))){_0x224b78[_0xf117('0x1d')]=qs['limit'](_0x5e1307[_0xf117('0x30')][_0xf117('0x1d')]);_0x224b78[_0xf117('0x1b')]=qs[_0xf117('0x1b')](_0x5e1307[_0xf117('0x30')][_0xf117('0x1b')]);}return _0x34da45['getTags'](_0x224b78);}})[_0xf117('0x24')](function(_0x5dbc9c){if(_0x5dbc9c){return _0x5dbc9c?{'count':_0x10d22b,'rows':_0x5dbc9c}:null;}})['then'](respondWithResult(_0x1728fd,null))[_0xf117('0x47')](handleError(_0x1728fd,null));};exports[_0xf117('0x51')]=function(_0x196472,_0x5281a8,_0x1b2d57){if(_0x196472[_0xf117('0x49')]['id']){delete _0x196472[_0xf117('0x49')]['id'];}return db['DeskConfiguration'][_0xf117('0x4b')]({'where':{'id':_0x196472['params']['id']}})[_0xf117('0x24')](handleEntityNotFound(_0x5281a8,null))['then'](function(_0x202f9f){if(_0x202f9f){return _0x202f9f[_0xf117('0x51')](_0x196472[_0xf117('0x49')][_0xf117('0x52')]||[]);}return null;})[_0xf117('0x24')](respondWithResult(_0x5281a8,null))[_0xf117('0x47')](handleError(_0x5281a8,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 195f7af..525101f 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 _0xbb46=['path','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3c3947,_0x5bf385){var _0x386e83=function(_0x23cfc3){while(--_0x23cfc3){_0x3c3947['push'](_0x3c3947['shift']());}};_0x386e83(++_0x5bf385);}(_0xbb46,0x14f));var _0x6bb4=function(_0x4dbfdf,_0x32069a){_0x4dbfdf=_0x4dbfdf-0x0;var _0x5299a0=_0xbb46[_0x4dbfdf];return _0x5299a0;};'use strict';var _=require(_0x6bb4('0x0'));var util=require(_0x6bb4('0x1'));var logger=require('../../config/logger')(_0x6bb4('0x2'));var moment=require(_0x6bb4('0x3'));var BPromise=require(_0x6bb4('0x4'));var rp=require(_0x6bb4('0x5'));var fs=require('fs');var path=require(_0x6bb4('0x6'));var rimraf=require('rimraf');var config=require(_0x6bb4('0x7'));var attributes=require(_0x6bb4('0x8'));module['exports']=function(_0x95ddce,_0x5d3450){return _0x95ddce['define'](_0x6bb4('0x9'),attributes,{'tableName':_0x6bb4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb62=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x401de7,_0x2333fc){var _0x5b491c=function(_0x1966b8){while(--_0x1966b8){_0x401de7['push'](_0x401de7['shift']());}};_0x5b491c(++_0x2333fc);}(_0xbb62,0x1ec));var _0x2bb6=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xbb62[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0x2bb6('0x0'));var util=require(_0x2bb6('0x1'));var logger=require(_0x2bb6('0x2'))(_0x2bb6('0x3'));var moment=require(_0x2bb6('0x4'));var BPromise=require(_0x2bb6('0x5'));var rp=require(_0x2bb6('0x6'));var fs=require('fs');var path=require(_0x2bb6('0x7'));var rimraf=require(_0x2bb6('0x8'));var config=require(_0x2bb6('0x9'));var attributes=require(_0x2bb6('0xa'));module[_0x2bb6('0xb')]=function(_0xbc55bb,_0x19a539){return _0xbc55bb[_0x2bb6('0xc')](_0x2bb6('0xd'),attributes,{'tableName':_0x2bb6('0xe'),'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 3564d2a..866059b 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 _0x56b9=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4e7fa9,_0x29d247){var _0x401f9e=function(_0x2f6a12){while(--_0x2f6a12){_0x4e7fa9['push'](_0x4e7fa9['shift']());}};_0x401f9e(++_0x29d247);}(_0x56b9,0x196));var _0x956b=function(_0x23abe8,_0x2a1839){_0x23abe8=_0x23abe8-0x0;var _0x2f01c0=_0x56b9[_0x23abe8];return _0x2f01c0;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var moment=require(_0x956b('0x2'));var BPromise=require(_0x956b('0x3'));var rs=require(_0x956b('0x4'));var fs=require('fs');var Redis=require(_0x956b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x956b('0x6'));var logger=require('../../config/logger')(_0x956b('0x7'));var config=require(_0x956b('0x8'));var jayson=require(_0x956b('0x9'));var client=jayson['client'][_0x956b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d40b0,_0x322012,_0x2683d8){return new BPromise(function(_0x222eae,_0x299c94){return client[_0x956b('0xb')](_0x3d40b0,_0x2683d8)[_0x956b('0xc')](function(_0x5e0388){logger[_0x956b('0xd')](_0x956b('0xe'),_0x322012,'request\x20sent');logger[_0x956b('0xf')](_0x956b('0x10'),_0x322012,_0x956b('0x11'),JSON[_0x956b('0x12')](_0x5e0388));if(_0x5e0388[_0x956b('0x13')]){if(_0x5e0388['error'][_0x956b('0x14')]===0x1f4){logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);return _0x299c94(_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);}logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x5e0388[_0x956b('0x13')][_0x956b('0x15')]);return _0x222eae(_0x5e0388['error'][_0x956b('0x15')]);}else{logger[_0x956b('0xd')](_0x956b('0xe'),_0x322012,'request\x20sent');_0x222eae(_0x5e0388[_0x956b('0x16')][_0x956b('0x15')]);}})[_0x956b('0x17')](function(_0x3cc1b7){logger[_0x956b('0x13')](_0x956b('0xe'),_0x322012,_0x3cc1b7);_0x299c94(_0x3cc1b7);});});} \ No newline at end of file +var _0xdc15=['../../mysqldb','../../config/environment','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x13876a,_0x5110a5){var _0x585bea=function(_0x296bc7){while(--_0x296bc7){_0x13876a['push'](_0x13876a['shift']());}};_0x585bea(++_0x5110a5);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0xdc15[_0x2b152a];return _0x2ad4c7;};'use strict';var _=require(_0x5dc1('0x0'));var util=require('util');var moment=require(_0x5dc1('0x1'));var BPromise=require(_0x5dc1('0x2'));var rs=require(_0x5dc1('0x3'));var fs=require('fs');var Redis=require(_0x5dc1('0x4'));var db=require(_0x5dc1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5dc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5dc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ec95f,_0x22d677,_0x12abf9){return new BPromise(function(_0x1c90f6,_0x3e96c1){return client[_0x5dc1('0x8')](_0x2ec95f,_0x12abf9)[_0x5dc1('0x9')](function(_0x1f1293){logger[_0x5dc1('0xa')](_0x5dc1('0xb'),_0x22d677,'request\x20sent');logger['debug'](_0x5dc1('0xc'),_0x22d677,_0x5dc1('0xd'),JSON['stringify'](_0x1f1293));if(_0x1f1293[_0x5dc1('0xe')]){if(_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0xf')]===0x1f4){logger[_0x5dc1('0xe')](_0x5dc1('0xb'),_0x22d677,_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0x10')]);return _0x3e96c1(_0x1f1293['error'][_0x5dc1('0x10')]);}logger[_0x5dc1('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x22d677,_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0x10')]);return _0x1c90f6(_0x1f1293['error'][_0x5dc1('0x10')]);}else{logger[_0x5dc1('0xa')](_0x5dc1('0xb'),_0x22d677,'request\x20sent');_0x1c90f6(_0x1f1293[_0x5dc1('0x11')]['message']);}})['catch'](function(_0x17506b){logger[_0x5dc1('0xe')](_0x5dc1('0xb'),_0x22d677,_0x17506b);_0x3e96c1(_0x17506b);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index fa83b0a..fee2d0a 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 _0x4a14=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x50e2a9,_0x38adc2){var _0x2fb1ea=function(_0x3dc687){while(--_0x3dc687){_0x50e2a9['push'](_0x50e2a9['shift']());}};_0x2fb1ea(++_0x38adc2);}(_0x4a14,0x115));var _0x44a1=function(_0x572959,_0x57dd57){_0x572959=_0x572959-0x0;var _0x4e67b6=_0x4a14[_0x572959];return _0x4e67b6;};'use strict';var multer=require(_0x44a1('0x0'));var util=require(_0x44a1('0x1'));var path=require(_0x44a1('0x2'));var timeout=require(_0x44a1('0x3'));var express=require(_0x44a1('0x4'));var router=express[_0x44a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x44a1('0x6'));var interaction=require(_0x44a1('0x7'));var config=require(_0x44a1('0x8'));var controller=require('./intDeskField.controller');router[_0x44a1('0x9')]('/',auth[_0x44a1('0xa')](),controller[_0x44a1('0xb')]);router[_0x44a1('0x9')](_0x44a1('0xc'),auth[_0x44a1('0xa')](),controller[_0x44a1('0xd')]);router[_0x44a1('0xe')]('/',auth['isAuthenticated'](),controller[_0x44a1('0xf')]);router[_0x44a1('0x10')](_0x44a1('0xc'),auth[_0x44a1('0xa')](),controller[_0x44a1('0x11')]);router[_0x44a1('0x12')](_0x44a1('0xc'),auth[_0x44a1('0xa')](),controller[_0x44a1('0x13')]);module[_0x44a1('0x14')]=router; \ No newline at end of file +var _0xebd0=['/:id','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xebd0,0x149));var _0x0ebd=function(_0x3a5e29,_0x168841){_0x3a5e29=_0x3a5e29-0x0;var _0x5a3cf1=_0xebd0[_0x3a5e29];return _0x5a3cf1;};'use strict';var multer=require(_0x0ebd('0x0'));var util=require(_0x0ebd('0x1'));var path=require(_0x0ebd('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ebd('0x3'));var router=express[_0x0ebd('0x4')]();var fs_extra=require(_0x0ebd('0x5'));var auth=require(_0x0ebd('0x6'));var interaction=require(_0x0ebd('0x7'));var config=require(_0x0ebd('0x8'));var controller=require('./intDeskField.controller');router[_0x0ebd('0x9')]('/',auth[_0x0ebd('0xa')](),controller['index']);router[_0x0ebd('0x9')](_0x0ebd('0xb'),auth[_0x0ebd('0xa')](),controller['show']);router['post']('/',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xc')]);router['put'](_0x0ebd('0xb'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xd')]);router[_0x0ebd('0xe')](_0x0ebd('0xb'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xf')]);module[_0x0ebd('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 b919c04..12bfcb8 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 _0x7e9a=['variable','customVariable','keyValue','picklist','string','ENUM','STRING','BOOLEAN','sequelize','exports'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0x7e9a,0x1d4));var _0xa7e9=function(_0x295af1,_0x58c1b2){_0x295af1=_0x295af1-0x0;var _0x56520d=_0x7e9a[_0x295af1];return _0x56520d;};'use strict';var Sequelize=require(_0xa7e9('0x0'));module[_0xa7e9('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xa7e9('0x2'),_0xa7e9('0x3'),_0xa7e9('0x4'),_0xa7e9('0x5')),'defaultValue':_0xa7e9('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa7e9('0x7')](_0xa7e9('0x6'),'variable',_0xa7e9('0x3'))},'keyContent':{'type':Sequelize[_0xa7e9('0x8')]},'idField':{'type':Sequelize[_0xa7e9('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa7e9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa7e9('0x8')]}}; \ No newline at end of file +var _0x7ffa=['STRING','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','string'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x7ffa,0x152));var _0xa7ff=function(_0x28a683,_0x383626){_0x28a683=_0x28a683-0x0;var _0x33ad40=_0x7ffa[_0x28a683];return _0x33ad40;};'use strict';var Sequelize=require(_0xa7ff('0x0'));module[_0xa7ff('0x1')]={'type':{'type':Sequelize[_0xa7ff('0x2')]('string','variable',_0xa7ff('0x3'),_0xa7ff('0x4'),'picklist'),'defaultValue':_0xa7ff('0x5')},'content':{'type':Sequelize[_0xa7ff('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa7ff('0x2')](_0xa7ff('0x5'),'variable',_0xa7ff('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa7ff('0x6')]},'nameField':{'type':Sequelize[_0xa7ff('0x6')]},'customField':{'type':Sequelize[_0xa7ff('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa7ff('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index e26b3b4..166438f 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 _0x8c46=['attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options','include','DeskField','rows','catch','includeAll','find','create','body','params','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x2cfd35,_0x3ffb92){var _0x541803=function(_0x40f228){while(--_0x40f228){_0x2cfd35['push'](_0x2cfd35['shift']());}};_0x541803(++_0x3ffb92);}(_0x8c46,0x171));var _0x68c4=function(_0x1fb394,_0xd1497){_0x1fb394=_0x1fb394-0x0;var _0x3c35cc=_0x8c46[_0x1fb394];return _0x3c35cc;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['DeskField'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['DeskField']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));}; \ No newline at end of file +var _0x9a3d=['intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskField','fieldName','model','keys','query','filters'];(function(_0xa3777e,_0x10d51a){var _0x48d91e=function(_0x37a77a){while(--_0x37a77a){_0xa3777e['push'](_0xa3777e['shift']());}};_0x48d91e(++_0x10d51a);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x563407,_0x386966){_0x563407=_0x563407-0x0;var _0x11884=_0x9a3d[_0x563407];return _0x11884;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9a3('0x0'));var zipdir=require(_0xd9a3('0x1'));var jsonpatch=require(_0xd9a3('0x2'));var rp=require(_0xd9a3('0x3'));var moment=require(_0xd9a3('0x4'));var BPromise=require(_0xd9a3('0x5'));var Mustache=require('mustache');var util=require(_0xd9a3('0x6'));var path=require(_0xd9a3('0x7'));var sox=require(_0xd9a3('0x8'));var csv=require(_0xd9a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9a3('0xa'));var _=require(_0xd9a3('0xb'));var squel=require(_0xd9a3('0xc'));var crypto=require(_0xd9a3('0xd'));var jsforce=require(_0xd9a3('0xe'));var deskjs=require(_0xd9a3('0xf'));var toCsv=require(_0xd9a3('0x9'));var querystring=require(_0xd9a3('0x10'));var Papa=require('papaparse');var Redis=require(_0xd9a3('0x11'));var authService=require(_0xd9a3('0x12'));var qs=require(_0xd9a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9a3('0x14'));var logger=require(_0xd9a3('0x15'))('api');var utils=require(_0xd9a3('0x16'));var config=require(_0xd9a3('0x17'));var licenseUtil=require(_0xd9a3('0x18'));var db=require(_0xd9a3('0x19'))['db'];function respondWithStatusCode(_0x3af3d2,_0x2b8230){_0x2b8230=_0x2b8230||0xcc;return function(_0x334a67){if(_0x334a67){return _0x3af3d2[_0xd9a3('0x1a')](_0x2b8230);}return _0x3af3d2['status'](_0x2b8230)[_0xd9a3('0x1b')]();};}function respondWithResult(_0x26605e,_0x1b1850){_0x1b1850=_0x1b1850||0xc8;return function(_0xce0c5c){if(_0xce0c5c){return _0x26605e[_0xd9a3('0x1c')](_0x1b1850)[_0xd9a3('0x1d')](_0xce0c5c);}};}function respondWithFilteredResult(_0x246aaf,_0x521ebe){return function(_0x2f497a){if(_0x2f497a){var _0x5107ee=typeof _0x521ebe['offset']===_0xd9a3('0x1e')&&typeof _0x521ebe['limit']==='undefined';var _0xbdeb3e=_0x2f497a[_0xd9a3('0x1f')];var _0x545dd2=_0x5107ee?0x0:_0x521ebe['offset'];var _0x56b6de=_0x5107ee?_0x2f497a['count']:_0x521ebe['offset']+_0x521ebe[_0xd9a3('0x20')];var _0x5bee91;if(_0x56b6de>=_0xbdeb3e){_0x56b6de=_0xbdeb3e;_0x5bee91=0xc8;}else{_0x5bee91=0xce;}_0x246aaf[_0xd9a3('0x1c')](_0x5bee91);return _0x246aaf[_0xd9a3('0x21')]('Content-Range',_0x545dd2+'-'+_0x56b6de+'/'+_0xbdeb3e)[_0xd9a3('0x1d')](_0x2f497a);}return null;};}function patchUpdates(_0x12674f){return function(_0x7160d8){try{jsonpatch[_0xd9a3('0x22')](_0x7160d8,_0x12674f,!![]);}catch(_0x2c2611){return BPromise[_0xd9a3('0x23')](_0x2c2611);}return _0x7160d8[_0xd9a3('0x24')]();};}function saveUpdates(_0x59fee8,_0x1ba585){return function(_0x445a4c){if(_0x445a4c){return _0x445a4c[_0xd9a3('0x25')](_0x59fee8)[_0xd9a3('0x26')](function(_0x60818e){return _0x60818e;});}return null;};}function removeEntity(_0x3d562a,_0x51c6d8){return function(_0x520ae4){if(_0x520ae4){return _0x520ae4[_0xd9a3('0x27')]()[_0xd9a3('0x26')](function(){_0x3d562a[_0xd9a3('0x1c')](0xcc)[_0xd9a3('0x1b')]();});}};}function handleEntityNotFound(_0x41baff,_0xd8c161){return function(_0x3b16f3){if(!_0x3b16f3){_0x41baff['sendStatus'](0x194);}return _0x3b16f3;};}function handleError(_0x10250a,_0x31ebd5){_0x31ebd5=_0x31ebd5||0x1f4;return function(_0x1eb769){logger['error'](_0x1eb769[_0xd9a3('0x28')]);if(_0x1eb769['name']){delete _0x1eb769[_0xd9a3('0x29')];}_0x10250a[_0xd9a3('0x1c')](_0x31ebd5)[_0xd9a3('0x2a')](_0x1eb769);};}exports[_0xd9a3('0x2b')]=function(_0x12f0e6,_0x374222){var _0x1e9500={},_0x3c99f8={},_0x4f3867={'count':0x0,'rows':[]};var _0x2103eb=_[_0xd9a3('0x2c')](db[_0xd9a3('0x2d')]['rawAttributes'],function(_0x1f564d){return{'name':_0x1f564d[_0xd9a3('0x2e')],'type':_0x1f564d['type']['key']};});_0x3c99f8[_0xd9a3('0x2f')]=_[_0xd9a3('0x2c')](_0x2103eb,_0xd9a3('0x29'));_0x3c99f8['query']=_[_0xd9a3('0x30')](_0x12f0e6[_0xd9a3('0x31')]);_0x3c99f8[_0xd9a3('0x32')]=_[_0xd9a3('0x33')](_0x3c99f8[_0xd9a3('0x2f')],_0x3c99f8[_0xd9a3('0x31')]);_0x1e9500['attributes']=_[_0xd9a3('0x33')](_0x3c99f8[_0xd9a3('0x2f')],qs[_0xd9a3('0x34')](_0x12f0e6[_0xd9a3('0x31')][_0xd9a3('0x34')]));_0x1e9500[_0xd9a3('0x35')]=_0x1e9500['attributes'][_0xd9a3('0x36')]?_0x1e9500[_0xd9a3('0x35')]:_0x3c99f8['model'];if(!_0x12f0e6['query']['hasOwnProperty'](_0xd9a3('0x37'))){_0x1e9500[_0xd9a3('0x20')]=qs['limit'](_0x12f0e6['query']['limit']);_0x1e9500[_0xd9a3('0x38')]=qs[_0xd9a3('0x38')](_0x12f0e6['query'][_0xd9a3('0x38')]);}_0x1e9500[_0xd9a3('0x39')]=qs[_0xd9a3('0x3a')](_0x12f0e6[_0xd9a3('0x31')][_0xd9a3('0x3a')]);_0x1e9500[_0xd9a3('0x3b')]=qs[_0xd9a3('0x32')](_[_0xd9a3('0x3c')](_0x12f0e6[_0xd9a3('0x31')],_0x3c99f8['filters']),_0x2103eb);if(_0x12f0e6[_0xd9a3('0x31')][_0xd9a3('0x3d')]){_0x1e9500[_0xd9a3('0x3b')]=_[_0xd9a3('0x3e')](_0x1e9500[_0xd9a3('0x3b')],{'$or':_[_0xd9a3('0x2c')](_0x2103eb,function(_0x280b72){if(_0x280b72[_0xd9a3('0x3f')]!==_0xd9a3('0x40')){var _0xe0a174={};_0xe0a174[_0x280b72['name']]={'$like':'%'+_0x12f0e6['query'][_0xd9a3('0x3d')]+'%'};return _0xe0a174;}})});}_0x1e9500=_[_0xd9a3('0x3e')]({},_0x1e9500,_0x12f0e6[_0xd9a3('0x41')]);var _0x4cab7f={'where':_0x1e9500['where']};return db[_0xd9a3('0x2d')][_0xd9a3('0x1f')](_0x4cab7f)[_0xd9a3('0x26')](function(_0x9e14ad){_0x4f3867['count']=_0x9e14ad;if(_0x12f0e6['query'][_0xd9a3('0x42')]){_0x1e9500[_0xd9a3('0x43')]=[{'all':!![]}];}return db[_0xd9a3('0x2d')][_0xd9a3('0x44')](_0x1e9500);})[_0xd9a3('0x26')](function(_0x246f5e){_0x4f3867[_0xd9a3('0x45')]=_0x246f5e;return _0x4f3867;})[_0xd9a3('0x26')](respondWithFilteredResult(_0x374222,_0x1e9500))['catch'](handleError(_0x374222,null));};exports[_0xd9a3('0x46')]=function(_0x16330d,_0x459421){var _0x113a6b={'raw':!![],'where':{'id':_0x16330d[_0xd9a3('0x47')]['id']}},_0x506050={};_0x506050[_0xd9a3('0x2f')]=_[_0xd9a3('0x30')](db[_0xd9a3('0x2d')][_0xd9a3('0x48')]);_0x506050[_0xd9a3('0x31')]=_[_0xd9a3('0x30')](_0x16330d[_0xd9a3('0x31')]);_0x506050[_0xd9a3('0x32')]=_[_0xd9a3('0x33')](_0x506050[_0xd9a3('0x2f')],_0x506050[_0xd9a3('0x31')]);_0x113a6b[_0xd9a3('0x35')]=_[_0xd9a3('0x33')](_0x506050[_0xd9a3('0x2f')],qs[_0xd9a3('0x34')](_0x16330d['query'][_0xd9a3('0x34')]));_0x113a6b[_0xd9a3('0x35')]=_0x113a6b[_0xd9a3('0x35')]['length']?_0x113a6b[_0xd9a3('0x35')]:_0x506050[_0xd9a3('0x2f')];if(_0x16330d[_0xd9a3('0x31')][_0xd9a3('0x42')]){_0x113a6b[_0xd9a3('0x43')]=[{'all':!![]}];}_0x113a6b=_[_0xd9a3('0x3e')]({},_0x113a6b,_0x16330d[_0xd9a3('0x41')]);return db['DeskField']['find'](_0x113a6b)[_0xd9a3('0x26')](handleEntityNotFound(_0x459421,null))[_0xd9a3('0x26')](respondWithResult(_0x459421,null))[_0xd9a3('0x49')](handleError(_0x459421,null));};exports[_0xd9a3('0x4a')]=function(_0x292aeb,_0x20b5fd){return db[_0xd9a3('0x2d')][_0xd9a3('0x4a')](_0x292aeb[_0xd9a3('0x4b')],{})[_0xd9a3('0x26')](respondWithResult(_0x20b5fd,0xc9))['catch'](handleError(_0x20b5fd,null));};exports['update']=function(_0x250e34,_0x9d069c){if(_0x250e34[_0xd9a3('0x4b')]['id']){delete _0x250e34[_0xd9a3('0x4b')]['id'];}return db[_0xd9a3('0x2d')][_0xd9a3('0x4c')]({'where':{'id':_0x250e34['params']['id']}})[_0xd9a3('0x26')](handleEntityNotFound(_0x9d069c,null))[_0xd9a3('0x26')](saveUpdates(_0x250e34[_0xd9a3('0x4b')],null))['then'](respondWithResult(_0x9d069c,null))['catch'](handleError(_0x9d069c,null));};exports[_0xd9a3('0x27')]=function(_0x380ddb,_0x56f43d){return db[_0xd9a3('0x2d')]['find']({'where':{'id':_0x380ddb[_0xd9a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x56f43d,null))[_0xd9a3('0x26')](removeEntity(_0x56f43d,null))[_0xd9a3('0x49')](handleError(_0x56f43d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 0c3e232..d848a6c 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 _0xe5e9=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x11cce6,_0x53d7ff){var _0x196944=function(_0x511b50){while(--_0x511b50){_0x11cce6['push'](_0x11cce6['shift']());}};_0x196944(++_0x53d7ff);}(_0xe5e9,0x1c0));var _0x9e5e=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0xe5e9[_0x1385dc];return _0x2f6469;};'use strict';var _=require(_0x9e5e('0x0'));var util=require(_0x9e5e('0x1'));var logger=require(_0x9e5e('0x2'))('api');var moment=require(_0x9e5e('0x3'));var BPromise=require(_0x9e5e('0x4'));var rp=require(_0x9e5e('0x5'));var fs=require('fs');var path=require(_0x9e5e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e5e('0x7'));module[_0x9e5e('0x8')]=function(_0x4a3e7b,_0x388e80){return _0x4a3e7b[_0x9e5e('0x9')]('DeskField',attributes,{'tableName':_0x9e5e('0xa'),'paranoid':![],'indexes':[{'name':_0x9e5e('0xb'),'fields':[_0x9e5e('0xc'),_0x9e5e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c5e=['moment','bluebird','path','../../config/environment','define','DeskField','idField','FieldId','lodash','util','../../config/logger'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x5c5e,0xd9));var _0xe5c5=function(_0x52c2a3,_0x26405a){_0x52c2a3=_0x52c2a3-0x0;var _0x3314c5=_0x5c5e[_0x52c2a3];return _0x3314c5;};'use strict';var _=require(_0xe5c5('0x0'));var util=require(_0xe5c5('0x1'));var logger=require(_0xe5c5('0x2'))('api');var moment=require(_0xe5c5('0x3'));var BPromise=require(_0xe5c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5c5('0x5'));var rimraf=require('rimraf');var config=require(_0xe5c5('0x6'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0xb5755e,_0x4cb046){return _0xb5755e[_0xe5c5('0x7')](_0xe5c5('0x8'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xe5c5('0x9'),_0xe5c5('0xa')],'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 95d126e..6e3e175 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 _0x61ef=['info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x1db641,_0x493754){var _0x95677d=function(_0x38167b){while(--_0x38167b){_0x1db641['push'](_0x1db641['shift']());}};_0x95677d(++_0x493754);}(_0x61ef,0x111));var _0xf61e=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x61ef[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xf61e('0x0'));var util=require(_0xf61e('0x1'));var moment=require(_0xf61e('0x2'));var BPromise=require(_0xf61e('0x3'));var rs=require(_0xf61e('0x4'));var fs=require('fs');var Redis=require(_0xf61e('0x5'));var db=require(_0xf61e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf61e('0x7'))(_0xf61e('0x8'));var config=require(_0xf61e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf61e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf3ddd9,_0x1f70ba,_0x1cd6cf){return new BPromise(function(_0x64ab1a,_0x52c511){return client[_0xf61e('0xb')](_0xf3ddd9,_0x1cd6cf)[_0xf61e('0xc')](function(_0x118515){logger[_0xf61e('0xd')](_0xf61e('0xe'),_0x1f70ba,'request\x20sent');logger[_0xf61e('0xf')](_0xf61e('0x10'),_0x1f70ba,_0xf61e('0x11'),JSON['stringify'](_0x118515));if(_0x118515['error']){if(_0x118515['error']['code']===0x1f4){logger[_0xf61e('0x12')](_0xf61e('0xe'),_0x1f70ba,_0x118515[_0xf61e('0x12')]['message']);return _0x52c511(_0x118515['error'][_0xf61e('0x13')]);}logger[_0xf61e('0x12')](_0xf61e('0xe'),_0x1f70ba,_0x118515[_0xf61e('0x12')][_0xf61e('0x13')]);return _0x64ab1a(_0x118515[_0xf61e('0x12')]['message']);}else{logger[_0xf61e('0xd')](_0xf61e('0xe'),_0x1f70ba,_0xf61e('0x11'));_0x64ab1a(_0x118515[_0xf61e('0x14')][_0xf61e('0x13')]);}})[_0xf61e('0x15')](function(_0x5ec59d){logger[_0xf61e('0x12')](_0xf61e('0xe'),_0x1f70ba,_0x5ec59d);_0x52c511(_0x5ec59d);});});} \ No newline at end of file +var _0xbc30=['../../config/utils','../../config/logger','jayson/promise','client','http','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x4f103e,_0x284aaf){var _0x474b4d=function(_0x1448ae){while(--_0x1448ae){_0x4f103e['push'](_0x4f103e['shift']());}};_0x474b4d(++_0x284aaf);}(_0xbc30,0x19d));var _0x0bc3=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbc30[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x0bc3('0x0'));var util=require('util');var moment=require(_0x0bc3('0x1'));var BPromise=require(_0x0bc3('0x2'));var rs=require(_0x0bc3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0bc3('0x4'))['db'];var utils=require(_0x0bc3('0x5'));var logger=require(_0x0bc3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0bc3('0x7'));var client=jayson[_0x0bc3('0x8')][_0x0bc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e3d36,_0x21a34b,_0x20972f){return new BPromise(function(_0x673f43,_0x14aa95){return client['request'](_0x4e3d36,_0x20972f)['then'](function(_0x45d295){logger[_0x0bc3('0xa')](_0x0bc3('0xb'),_0x21a34b,_0x0bc3('0xc'));logger[_0x0bc3('0xd')](_0x0bc3('0xe'),_0x21a34b,_0x0bc3('0xc'),JSON['stringify'](_0x45d295));if(_0x45d295[_0x0bc3('0xf')]){if(_0x45d295[_0x0bc3('0xf')][_0x0bc3('0x10')]===0x1f4){logger[_0x0bc3('0xf')](_0x0bc3('0xb'),_0x21a34b,_0x45d295[_0x0bc3('0xf')][_0x0bc3('0x11')]);return _0x14aa95(_0x45d295[_0x0bc3('0xf')][_0x0bc3('0x11')]);}logger[_0x0bc3('0xf')](_0x0bc3('0xb'),_0x21a34b,_0x45d295['error'][_0x0bc3('0x11')]);return _0x673f43(_0x45d295['error']['message']);}else{logger[_0x0bc3('0xa')](_0x0bc3('0xb'),_0x21a34b,_0x0bc3('0xc'));_0x673f43(_0x45d295[_0x0bc3('0x12')][_0x0bc3('0x11')]);}})['catch'](function(_0x198b9b){logger[_0x0bc3('0xf')]('DeskField,\x20%s,\x20%s',_0x21a34b,_0x198b9b);_0x14aa95(_0x198b9b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index e96ee10..67a9a97 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 _0x93f3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','isAuthenticated','show','getConfigurations','/:id/fields','getFields','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x46868e,_0x5e2edc){var _0x88920f=function(_0x5830a7){while(--_0x5830a7){_0x46868e['push'](_0x46868e['shift']());}};_0x88920f(++_0x5e2edc);}(_0x93f3,0x174));var _0x393f=function(_0x756d04,_0x48e769){_0x756d04=_0x756d04-0x0;var _0x459f0b=_0x93f3[_0x756d04];return _0x459f0b;};'use strict';var multer=require(_0x393f('0x0'));var util=require(_0x393f('0x1'));var path=require(_0x393f('0x2'));var timeout=require(_0x393f('0x3'));var express=require(_0x393f('0x4'));var router=express[_0x393f('0x5')]();var fs_extra=require(_0x393f('0x6'));var auth=require(_0x393f('0x7'));var interaction=require(_0x393f('0x8'));var config=require('../../config/environment');var controller=require(_0x393f('0x9'));router[_0x393f('0xa')]('/',auth['isAuthenticated'](),controller[_0x393f('0xb')]);router[_0x393f('0xa')]('/:id',auth[_0x393f('0xc')](),controller[_0x393f('0xd')]);router[_0x393f('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x393f('0xe')]);router['get'](_0x393f('0xf'),auth[_0x393f('0xc')](),controller[_0x393f('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x393f('0x11'),auth['isAuthenticated'](),controller[_0x393f('0x12')]);router[_0x393f('0x13')](_0x393f('0x14'),auth[_0x393f('0xc')](),controller[_0x393f('0x15')]);router[_0x393f('0x16')](_0x393f('0x14'),auth['isAuthenticated'](),controller[_0x393f('0x17')]);module[_0x393f('0x18')]=router; \ No newline at end of file +var _0x1b84=['/:id/configurations','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getConfigurations','getFields','create','post'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x1b84,0xc2));var _0x41b8=function(_0x258bd8,_0x3cf0b1){_0x258bd8=_0x258bd8-0x0;var _0x2f43a4=_0x1b84[_0x258bd8];return _0x2f43a4;};'use strict';var multer=require(_0x41b8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x41b8('0x1'));var express=require(_0x41b8('0x2'));var router=express[_0x41b8('0x3')]();var fs_extra=require(_0x41b8('0x4'));var auth=require(_0x41b8('0x5'));var interaction=require(_0x41b8('0x6'));var config=require(_0x41b8('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x41b8('0x8')]('/',auth[_0x41b8('0x9')](),controller['index']);router[_0x41b8('0x8')](_0x41b8('0xa'),auth[_0x41b8('0x9')](),controller[_0x41b8('0xb')]);router[_0x41b8('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x41b8('0xc')]);router[_0x41b8('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x41b8('0xd')]);router['post']('/',auth[_0x41b8('0x9')](),controller[_0x41b8('0xe')]);router[_0x41b8('0xf')](_0x41b8('0x10'),auth[_0x41b8('0x9')](),controller['addConfiguration']);router[_0x41b8('0x11')](_0x41b8('0xa'),auth[_0x41b8('0x9')](),controller[_0x41b8('0x12')]);router['delete'](_0x41b8('0xa'),auth[_0x41b8('0x9')](),controller[_0x41b8('0x13')]);module[_0x41b8('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 65dbce2..1fcc970 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 _0x88d5=['STRING','BOOLEAN','sequelize','exports'];(function(_0xd8cc4d,_0x2a387d){var _0xe3471f=function(_0x4c0a94){while(--_0x4c0a94){_0xd8cc4d['push'](_0xd8cc4d['shift']());}};_0xe3471f(++_0x2a387d);}(_0x88d5,0x76));var _0x588d=function(_0x19db35,_0xf50aea){_0x19db35=_0x19db35-0x0;var _0x458ae3=_0x88d5[_0x19db35];return _0x458ae3;};'use strict';var Sequelize=require(_0x588d('0x0'));module[_0x588d('0x1')]={'name':{'type':Sequelize[_0x588d('0x2')]},'username':{'type':Sequelize[_0x588d('0x2')]},'password':{'type':Sequelize[_0x588d('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x588d('0x2')]},'clientId':{'type':Sequelize[_0x588d('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x588d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x588d('0x2')]},'modernAuthentication':{'type':Sequelize[_0x588d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7e02=['BOOLEAN','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7e02,0x71));var _0x27e0=function(_0x4e96a4,_0x207e09){_0x4e96a4=_0x4e96a4-0x0;var _0x1beafa=_0x7e02[_0x4e96a4];return _0x1beafa;};'use strict';var Sequelize=require(_0x27e0('0x0'));module[_0x27e0('0x1')]={'name':{'type':Sequelize[_0x27e0('0x2')]},'username':{'type':Sequelize[_0x27e0('0x2')]},'password':{'type':Sequelize[_0x27e0('0x2')]},'remoteUri':{'type':Sequelize[_0x27e0('0x2')]},'tenantId':{'type':Sequelize[_0x27e0('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x27e0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x27e0('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 02add41..2c63e9b 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 _0x75e4=['slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','LogicalName','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','push','substring','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','Label','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','json','offset','limit','undefined','count','status','set','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','create','body','find','params','getConfigurations','findOne','Dynamics365Configuration','pick','filter','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','slice','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','description','customerid','ownerid','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue'];(function(_0x35897c,_0x2c76c7){var _0x5f2299=function(_0x1753dd){while(--_0x1753dd){_0x35897c['push'](_0x35897c['shift']());}};_0x5f2299(++_0x2c76c7);}(_0x75e4,0x1cb));var _0x475e=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0x75e4[_0x5cc8b9];return _0x58892e;};'use strict';var rp=require(_0x475e('0x0'));var util=require(_0x475e('0x1'));var _=require(_0x475e('0x2'));var qs=require(_0x475e('0x3'));var logger=require(_0x475e('0x4'))(_0x475e('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x475e('0x6'));function respondWithResult(_0xd05fa8,_0x389f37){_0x389f37=_0x389f37||0xc8;return function(_0x3de8f){if(_0x3de8f){return _0xd05fa8['status'](_0x389f37)[_0x475e('0x7')](_0x3de8f);}};}function respondWithFilteredResult(_0x34fc07,_0x52dc57){return function(_0x30d3c6){if(_0x30d3c6){var _0x5b2768=typeof _0x52dc57[_0x475e('0x8')]==='undefined'&&typeof _0x52dc57[_0x475e('0x9')]===_0x475e('0xa');var _0x22f19e=_0x30d3c6['count'];var _0xc891cd=_0x5b2768?0x0:_0x52dc57['offset'];var _0x50e867=_0x5b2768?_0x30d3c6[_0x475e('0xb')]:_0x52dc57[_0x475e('0x8')]+_0x52dc57[_0x475e('0x9')];var _0x54569b;if(_0x50e867>=_0x22f19e){_0x50e867=_0x22f19e;_0x54569b=0xc8;}else{_0x54569b=0xce;}_0x34fc07[_0x475e('0xc')](_0x54569b);return _0x34fc07[_0x475e('0xd')]('Content-Range',_0xc891cd+'-'+_0x50e867+'/'+_0x22f19e)[_0x475e('0x7')](_0x30d3c6);}return null;};}function saveUpdates(_0x5684db){return function(_0x5524a0){if(_0x5524a0){return _0x5524a0[_0x475e('0xe')](_0x5684db)[_0x475e('0xf')](function(_0x498ec5){return _0x498ec5;});}return null;};}function removeEntity(_0x523abd){return function(_0x1351c4){if(_0x1351c4){return _0x1351c4[_0x475e('0x10')]()[_0x475e('0xf')](function(){_0x523abd[_0x475e('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2011ef){return function(_0x16b964){if(!_0x16b964){_0x2011ef[_0x475e('0x11')](0x194);}return _0x16b964;};}function handleError(_0x3e3ef8,_0x404dcb){_0x404dcb=_0x404dcb||0x1f4;return function(_0x381a5f){logger[_0x475e('0x12')](_0x381a5f[_0x475e('0x13')]);if(_0x381a5f[_0x475e('0x14')]){delete _0x381a5f['name'];}_0x3e3ef8[_0x475e('0xc')](_0x404dcb)['send'](_0x381a5f);};}exports[_0x475e('0x15')]=function(_0x4530d0,_0x3569f6){var _0xbf37de={},_0x2d5f76={},_0x32ca01={'count':0x0,'rows':[]};var _0x545412=_['map'](db['Dynamics365Account'][_0x475e('0x16')],function(_0x44c4f2){return{'name':_0x44c4f2[_0x475e('0x17')],'type':_0x44c4f2[_0x475e('0x18')][_0x475e('0x19')]};});_0x2d5f76[_0x475e('0x1a')]=_[_0x475e('0x1b')](_0x545412,_0x475e('0x14'));_0x2d5f76[_0x475e('0x1c')]=_[_0x475e('0x1d')](_0x4530d0[_0x475e('0x1c')]);_0x2d5f76[_0x475e('0x1e')]=_[_0x475e('0x1f')](_0x2d5f76[_0x475e('0x1a')],_0x2d5f76['query']);_0xbf37de['attributes']=_[_0x475e('0x1f')](_0x2d5f76[_0x475e('0x1a')],qs[_0x475e('0x20')](_0x4530d0[_0x475e('0x1c')][_0x475e('0x20')]));_0xbf37de[_0x475e('0x21')]=_0xbf37de['attributes'][_0x475e('0x22')]?_0xbf37de[_0x475e('0x21')]:_0x2d5f76[_0x475e('0x1a')];if(!_0x4530d0[_0x475e('0x1c')][_0x475e('0x23')](_0x475e('0x24'))){_0xbf37de['limit']=qs[_0x475e('0x9')](_0x4530d0[_0x475e('0x1c')]['limit']);_0xbf37de['offset']=qs['offset'](_0x4530d0[_0x475e('0x1c')][_0x475e('0x8')]);}_0xbf37de[_0x475e('0x25')]=qs[_0x475e('0x26')](_0x4530d0[_0x475e('0x1c')][_0x475e('0x26')]);_0xbf37de[_0x475e('0x27')]=qs[_0x475e('0x1e')](_['pick'](_0x4530d0[_0x475e('0x1c')],_0x2d5f76[_0x475e('0x1e')]),_0x545412);if(_0x4530d0[_0x475e('0x1c')]['filter']){_0xbf37de[_0x475e('0x27')]=_['merge'](_0xbf37de[_0x475e('0x27')],{'$or':_[_0x475e('0x1b')](_0x545412,function(_0x3ed638){if(_0x3ed638[_0x475e('0x18')]!==_0x475e('0x28')){var _0x3cacb1={};_0x3cacb1[_0x3ed638[_0x475e('0x14')]]={'$like':'%'+_0x4530d0['query']['filter']+'%'};return _0x3cacb1;}})});}_0xbf37de=_[_0x475e('0x29')]({},_0xbf37de,_0x4530d0[_0x475e('0x2a')]);var _0x50f271={'where':_0xbf37de[_0x475e('0x27')]};return db[_0x475e('0x2b')][_0x475e('0xb')](_0x50f271)[_0x475e('0xf')](function(_0x10b28f){_0x32ca01[_0x475e('0xb')]=_0x10b28f;if(_0x4530d0[_0x475e('0x1c')][_0x475e('0x2c')]){_0xbf37de[_0x475e('0x2d')]=[{'all':!![]}];}return db[_0x475e('0x2b')][_0x475e('0x2e')](_0xbf37de);})[_0x475e('0xf')](function(_0x58851a){_0x32ca01[_0x475e('0x2f')]=_0x58851a;return _0x32ca01;})[_0x475e('0xf')](respondWithFilteredResult(_0x3569f6,_0xbf37de))[_0x475e('0x30')](handleError(_0x3569f6,null));};exports[_0x475e('0x31')]=function(_0x5e0892,_0x27e088){var _0x30d35f={'raw':![],'where':{'id':_0x5e0892['params']['id']}},_0x34813e={};_0x34813e[_0x475e('0x1a')]=_[_0x475e('0x1d')](db[_0x475e('0x2b')]['rawAttributes']);_0x34813e[_0x475e('0x1c')]=_[_0x475e('0x1d')](_0x5e0892[_0x475e('0x1c')]);_0x34813e[_0x475e('0x1e')]=_[_0x475e('0x1f')](_0x34813e[_0x475e('0x1a')],_0x34813e[_0x475e('0x1c')]);_0x30d35f[_0x475e('0x21')]=_[_0x475e('0x1f')](_0x34813e[_0x475e('0x1a')],qs[_0x475e('0x20')](_0x5e0892['query'][_0x475e('0x20')]));_0x30d35f[_0x475e('0x21')]=_0x30d35f['attributes']['length']?_0x30d35f[_0x475e('0x21')]:_0x34813e['model'];if(_0x5e0892[_0x475e('0x1c')]['includeAll']){_0x30d35f[_0x475e('0x2d')]=[{'all':!![]}];}_0x30d35f=_[_0x475e('0x29')]({},_0x30d35f,_0x5e0892[_0x475e('0x2a')]);return db['Dynamics365Account']['find'](_0x30d35f)[_0x475e('0xf')](handleEntityNotFound(_0x27e088,null))[_0x475e('0xf')](respondWithResult(_0x27e088,null))[_0x475e('0x30')](handleError(_0x27e088,null));};exports[_0x475e('0x32')]=function(_0xd98a6c,_0x2ccd7f){return db[_0x475e('0x2b')][_0x475e('0x32')](_0xd98a6c[_0x475e('0x33')],{})[_0x475e('0xf')](respondWithResult(_0x2ccd7f,0xc9))['catch'](handleError(_0x2ccd7f,null));};exports[_0x475e('0xe')]=function(_0x4d76fe,_0x4de8f5){if(_0x4d76fe[_0x475e('0x33')]['id']){delete _0x4d76fe['body']['id'];}return db[_0x475e('0x2b')][_0x475e('0x34')]({'where':{'id':_0x4d76fe[_0x475e('0x35')]['id']}})[_0x475e('0xf')](handleEntityNotFound(_0x4de8f5,null))[_0x475e('0xf')](saveUpdates(_0x4d76fe[_0x475e('0x33')],null))[_0x475e('0xf')](respondWithResult(_0x4de8f5,null))[_0x475e('0x30')](handleError(_0x4de8f5,null));};exports[_0x475e('0x10')]=function(_0x2971ed,_0x18b606){return db[_0x475e('0x2b')][_0x475e('0x34')]({'where':{'id':_0x2971ed[_0x475e('0x35')]['id']}})[_0x475e('0xf')](handleEntityNotFound(_0x18b606,null))['then'](removeEntity(_0x18b606,null))[_0x475e('0x30')](handleError(_0x18b606,null));};exports[_0x475e('0x36')]=function(_0x37c915,_0x573e14){var _0x7b3f3b={};var _0x442cef={};var _0xb6421d;var _0x31cc27;return db[_0x475e('0x2b')][_0x475e('0x37')]({'where':{'id':_0x37c915[_0x475e('0x35')]['id']}})[_0x475e('0xf')](handleEntityNotFound(_0x573e14,null))[_0x475e('0xf')](function(_0x34890e){if(_0x34890e){_0xb6421d=_0x34890e;_0x442cef[_0x475e('0x1a')]=_[_0x475e('0x1d')](db[_0x475e('0x38')]['rawAttributes']);_0x442cef['query']=_[_0x475e('0x1d')](_0x37c915['query']);_0x442cef[_0x475e('0x1e')]=_['intersection'](_0x442cef['model'],_0x442cef[_0x475e('0x1c')]);_0x7b3f3b[_0x475e('0x21')]=_['intersection'](_0x442cef['model'],qs['fields'](_0x37c915[_0x475e('0x1c')]['fields']));_0x7b3f3b[_0x475e('0x21')]=_0x7b3f3b['attributes'][_0x475e('0x22')]?_0x7b3f3b[_0x475e('0x21')]:_0x442cef['model'];_0x7b3f3b[_0x475e('0x25')]=qs[_0x475e('0x26')](_0x37c915[_0x475e('0x1c')][_0x475e('0x26')]);_0x7b3f3b[_0x475e('0x27')]=qs[_0x475e('0x1e')](_[_0x475e('0x39')](_0x37c915[_0x475e('0x1c')],_0x442cef[_0x475e('0x1e')]));if(_0x37c915[_0x475e('0x1c')][_0x475e('0x3a')]){_0x7b3f3b[_0x475e('0x27')]=_['merge'](_0x7b3f3b[_0x475e('0x27')],{'$or':_[_0x475e('0x1b')](_0x7b3f3b[_0x475e('0x21')],function(_0x251e8a){var _0x46da23={};_0x46da23[_0x251e8a]={'$like':'%'+_0x37c915['query'][_0x475e('0x3a')]+'%'};return _0x46da23;})});}_0x7b3f3b=_[_0x475e('0x29')]({},_0x7b3f3b,_0x37c915['options']);return _0xb6421d['getConfigurations'](_0x7b3f3b);}})[_0x475e('0xf')](function(_0x5ab9fa){if(_0x5ab9fa){_0x31cc27=_0x5ab9fa['length'];if(!_0x37c915[_0x475e('0x1c')][_0x475e('0x23')]('nolimit')){_0x7b3f3b[_0x475e('0x9')]=qs['limit'](_0x37c915['query']['limit']);_0x7b3f3b[_0x475e('0x8')]=qs['offset'](_0x37c915[_0x475e('0x1c')]['offset']);}return _0xb6421d[_0x475e('0x36')](_0x7b3f3b);}})[_0x475e('0xf')](function(_0x4fb5f5){if(_0x4fb5f5){return _0x4fb5f5?{'count':_0x31cc27,'rows':_0x4fb5f5}:null;}})[_0x475e('0xf')](respondWithResult(_0x573e14,null))[_0x475e('0x30')](handleError(_0x573e14,null));};exports[_0x475e('0x3b')]=function(_0x185d84,_0x264e77){if(_0x185d84['body']['id']){delete _0x185d84[_0x475e('0x33')]['id'];}return db[_0x475e('0x2b')][_0x475e('0x37')]({'where':{'id':_0x185d84[_0x475e('0x35')]['id']}})['then'](handleEntityNotFound(_0x264e77,null))[_0x475e('0xf')](function(_0x2598bb){if(_0x2598bb){_0x185d84['body']['AccountId']=_0x2598bb['id'];_0x185d84[_0x475e('0x33')][_0x475e('0x3c')]=integrations[_0x475e('0x3d')](_0x185d84[_0x475e('0x33')][_0x475e('0x3e')],_0x185d84[_0x475e('0x33')][_0x475e('0x18')]);_0x185d84[_0x475e('0x33')][_0x475e('0x3f')]=integrations[_0x475e('0x40')](_0x185d84[_0x475e('0x33')][_0x475e('0x3e')],_0x185d84['body'][_0x475e('0x18')]);return db[_0x475e('0x38')][_0x475e('0x32')](_0x185d84[_0x475e('0x33')],{'include':[{'model':db['Dynamics365Field'],'as':_0x475e('0x3c')},{'model':db['Dynamics365Field'],'as':_0x475e('0x3f')}]});}return null;})['then'](respondWithResult(_0x264e77,null))[_0x475e('0x30')](handleError(_0x264e77,null));};function sanitizeRemoteUri(_0x5b2145){var _0x1b376f=_0x5b2145[_0x475e('0x41')](-0x1);if(_0x1b376f==='/')return _0x5b2145['substring'](0x0,_0x5b2145[_0x475e('0x42')](_0x1b376f));return _0x5b2145;}function getWebApiUrl(_0x1ca674){return util['format'](_0x475e('0x43'),_0x1ca674);}exports[_0x475e('0x44')]=function(_0x22d76c,_0x32aa3e){var _0x2dd3e0=_0x22d76c[_0x475e('0x1c')][_0x475e('0x45')];var _0x5c018f=_0x2dd3e0===_0x475e('0x46')?'Incident':_0x475e('0x47');var _0x8ee8fb='';var _0xde37ad='';var _0x30d27b='';var _0x26b423='';var _0x42743a='';var _0x5afa0e='';var _0x540147='';var _0x2fd4ff='';var _0x1e661f=[_0x475e('0x48'),_0x475e('0x49'),_0x475e('0x4a'),_0x475e('0x4b'),'caseorigincode',_0x475e('0x4c'),'phonenumber',_0x475e('0x4d'),_0x475e('0x4e'),_0x475e('0x4f')];var _0x34c970=[_0x475e('0x50'),_0x475e('0x51'),_0x475e('0x52'),'billedserviceunits',_0x475e('0x53'),_0x475e('0x54'),_0x475e('0x55'),_0x475e('0x56'),_0x475e('0x57'),_0x475e('0x58'),_0x475e('0x59'),'createdbyyominame','createdon',_0x475e('0x5a'),'createdonbehalfbyyominame',_0x475e('0x5b'),_0x475e('0x5c'),_0x475e('0x5d'),_0x475e('0x5e'),_0x475e('0x5f'),_0x475e('0x60'),_0x475e('0x61'),_0x475e('0x62'),'exchangerate',_0x475e('0x63'),_0x475e('0x64'),_0x475e('0x65'),_0x475e('0x66'),_0x475e('0x67'),_0x475e('0x68'),_0x475e('0x69'),_0x475e('0x6a'),'modifiedbyexternalpartyyominame',_0x475e('0x6b'),_0x475e('0x6c'),_0x475e('0x6d'),_0x475e('0x6e'),_0x475e('0x6f'),_0x475e('0x70'),_0x475e('0x71'),_0x475e('0x72'),_0x475e('0x73'),_0x475e('0x74'),_0x475e('0x75'),_0x475e('0x76'),_0x475e('0x77'),'parentcaseidname',_0x475e('0x78'),_0x475e('0x79'),_0x475e('0x7a'),_0x475e('0x7b'),'productserialnumber',_0x475e('0x7c'),_0x475e('0x7d'),_0x475e('0x7e'),'responsiblecontactidname',_0x475e('0x7f'),_0x475e('0x80'),'slainvokedidname',_0x475e('0x81'),_0x475e('0x82'),'statecode',_0x475e('0x83'),_0x475e('0x84'),_0x475e('0x85'),_0x475e('0x86'),_0x475e('0x87'),_0x475e('0x88'),_0x475e('0x89'),_0x475e('0x8a')];var _0x2a784=_0x1e661f[_0x475e('0x8b')](_0x34c970);return db['Dynamics365Account'][_0x475e('0x37')]({'where':{'id':_0x22d76c[_0x475e('0x35')]['id']},'attributes':['id',_0x475e('0x8c'),_0x475e('0x8d'),_0x475e('0x8e'),_0x475e('0x8f'),_0x475e('0x90'),_0x475e('0x91'),_0x475e('0x92')],'include':[{'model':db[_0x475e('0x93')],'as':_0x475e('0x93'),'attributes':['id',_0x475e('0x94'),_0x475e('0x95')]}]})[_0x475e('0xf')](handleEntityNotFound(_0x32aa3e,null))[_0x475e('0xf')](function(_0x41e50c){if(_0x41e50c){if(_0x41e50c[_0x475e('0x92')]){_0x41e50c[_0x475e('0x96')]=_0x41e50c[_0x475e('0x93')][_0x475e('0x94')];_0x2fd4ff=sanitizeRemoteUri(_0x41e50c[_0x475e('0x93')]['data7']);_0x540147=getWebApiUrl(_0x2fd4ff);return _0x41e50c;}_0x2fd4ff=sanitizeRemoteUri(_0x41e50c[_0x475e('0x8e')]);_0x540147=getWebApiUrl(_0x2fd4ff);var _0x19578d={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x41e50c[_0x475e('0x8f')]+'/oauth2/token','form':{'client_id':_0x41e50c['clientId'],'resource':_0x2fd4ff,'username':_0x41e50c[_0x475e('0x8c')],'password':_0x41e50c['password'],'grant_type':'password','client_secret':_0x41e50c[_0x475e('0x91')]},'json':!![]};return rp(_0x19578d);}})[_0x475e('0xf')](function(_0x4afd81){_0x5afa0e=_0x4afd81[_0x475e('0x96')];var _0x23896a={'method':'GET','uri':encodeURI(_0x540147+_0x475e('0x97')+_0x5c018f+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5afa0e,'If-None-Match':null,'OData-Version':_0x475e('0x98')},'json':!![]};return rp(_0x23896a);})[_0x475e('0xf')](function(_0xc0c9a2){var _0x5e6540=_0xc0c9a2['value'][0x0];var _0x5547d2=_0x5e6540[_0x475e('0x99')];var _0x50adae={'method':_0x475e('0x9a'),'uri':_0x540147+_0x475e('0x9b')+_0x5547d2+_0x475e('0x9c'),'headers':{'Authorization':_0x475e('0x9d')+_0x5afa0e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x50adae);})[_0x475e('0xf')](function(_0x3c0ea1){_0x8ee8fb=_0x3c0ea1;_0xde37ad=_0x8ee8fb[_0x475e('0x9e')];_0xde37ad=_[_0x475e('0x9f')](_0xde37ad,function(_0x26fb11){return!_0x2a784['includes'](_0x26fb11[_0x475e('0xa0')]);});var _0x18ce27=[];var _0x288d9e=[];_0xde37ad[_0x475e('0xa1')](function(_0x51178a){if(_0x51178a[_0x475e('0xa2')]){var _0x2da9e9=_0x51178a[_0x475e('0xa2')]['substring'](_0x51178a[_0x475e('0xa2')][_0x475e('0x42')]('.')+0x1);if(_0x2da9e9==='PicklistAttributeMetadata'){_0x18ce27['push'](getSelectList(_0x540147,_0x2dd3e0,_0x288d9e,_0x8ee8fb[_0x475e('0x99')],_0x51178a[_0x475e('0x99')],_0x5afa0e));}}});return Promise[_0x475e('0xa3')](_0x18ce27);})[_0x475e('0xf')](function(_0x5481f3){_0x30d27b=_0x5481f3[0x0];var _0x14acfb=[];var _0x2c8b67=[];_0xde37ad['forEach'](function(_0x306b40){if(!_[_0x475e('0xa4')](_0x306b40[_0x475e('0xa2')])){var _0x20a0cb=_0x306b40[_0x475e('0xa2')]['substring'](_0x306b40[_0x475e('0xa2')][_0x475e('0x42')]('.')+0x1);if(_0x20a0cb===_0x475e('0xa5')){_0x14acfb[_0x475e('0xa6')](getBooleanList(_0x540147,_0x2dd3e0,_0x2c8b67,_0x8ee8fb[_0x475e('0x99')],_0x306b40[_0x475e('0x99')],_0x5afa0e));}}});return Promise[_0x475e('0xa3')](_0x14acfb);})[_0x475e('0xf')](function(_0x56151e){_0x26b423=_0x56151e[0x0];var _0x54d605=[];var _0x1814e8=[];_0xde37ad[_0x475e('0xa1')](function(_0x17cd0f){if(_0x17cd0f[_0x475e('0xa2')]){var _0x84813a=_0x17cd0f[_0x475e('0xa2')][_0x475e('0xa7')](_0x17cd0f[_0x475e('0xa2')]['lastIndexOf']('.')+0x1);if(_0x84813a===_0x475e('0xa8')||_0x84813a==='DoubleAttributeMetadata'||_0x84813a===_0x475e('0xa9')||_0x84813a===_0x475e('0xaa')||_0x84813a===_0x475e('0xab')||_0x84813a===_0x475e('0xac')||_0x84813a===_0x475e('0xad')||_0x84813a===_0x475e('0xae')||_0x84813a===_0x475e('0xaf')||_0x84813a===_0x475e('0xb0')){_0x54d605[_0x475e('0xa6')](getInputList(_0x540147,_0x2dd3e0,_0x84813a,_0x1814e8,_0x8ee8fb['MetadataId'],_0x17cd0f['MetadataId'],_0x5afa0e));}}});return Promise['all'](_0x54d605);})[_0x475e('0xf')](function(_0xf00d31){_0x42743a=_0xf00d31[0x0];var _0x3e3b3c=_0x30d27b['concat'](_0x26b423)[_0x475e('0x8b')](_0x42743a);var _0x2f6871={'count':_0x3e3b3c[_0x475e('0x22')],'rows':_0x3e3b3c};return _0x2f6871;})[_0x475e('0xf')](respondWithResult(_0x32aa3e,null))[_0x475e('0x30')](function(_0x5ae8c8){var _0x1e1cb3=_0x22d76c[_0x475e('0x1c')][_0x475e('0xb1')]?0x1f4:_0x5ae8c8[_0x475e('0xb2')]||0x1f4;logger[_0x475e('0x12')](_0x5ae8c8['stack']);delete _0x5ae8c8[_0x475e('0x14')];if(_0x1e1cb3===0x191){_0x1e1cb3=0x190;}_0x32aa3e[_0x475e('0xc')](_0x1e1cb3)['send'](_0x22d76c[_0x475e('0x1c')][_0x475e('0xb1')]?{'message':_0x475e('0xb3'),'statusCode':_0x5ae8c8['statusCode']}:_0x5ae8c8);});};function getSelectList(_0x3bd98f,_0x4846c6,_0x5b88d1,_0x1dd607,_0x497e76,_0x28e565){var _0x4b0f61={'method':'GET','uri':_0x3bd98f+'EntityDefinitions('+_0x1dd607+_0x475e('0xb4')+_0x497e76+_0x475e('0xb5')+_0x475e('0xb6'),'headers':{'Authorization':_0x475e('0x9d')+_0x28e565,'If-None-Match':null,'OData-Version':_0x475e('0x98')},'json':!![]};return rp(_0x4b0f61)[_0x475e('0xf')](function(_0x4b4185){var _0x3a7b2f=[];var _0x34f3ef=_0x4b4185[_0x475e('0xb7')][_0x475e('0xb8')];_0x34f3ef[_0x475e('0xa1')](function(_0x3f2bb2){_0x3a7b2f[_0x475e('0xa6')]({'name':_0x3f2bb2['Label'][_0x475e('0xb9')]['Label'],'value':String(_0x3f2bb2[_0x475e('0xba')])});});var _0x5d0075={'id':_0x4846c6+'_'+_0x4b4185[_0x475e('0xa0')],'name':_0x4b4185[_0x475e('0xbb')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x3a7b2f};_0x5b88d1[_0x475e('0xa6')](_0x5d0075);return _0x5b88d1;});}function getBooleanList(_0x123065,_0x221ac1,_0x486dd6,_0xa3f1b1,_0x429e02,_0x1511b8){var _0x3ac719={'method':_0x475e('0x9a'),'uri':_0x123065+_0x475e('0x9b')+_0xa3f1b1+_0x475e('0xb4')+_0x429e02+_0x475e('0xbc'),'headers':{'Authorization':'Bearer\x20'+_0x1511b8,'If-None-Match':null,'OData-Version':_0x475e('0x98')},'json':!![]};return rp(_0x3ac719)['then'](function(_0x52a1b4){var _0x3c1eed=[];_0x3c1eed[_0x475e('0xa6')]({'name':_0x52a1b4[_0x475e('0xb7')][_0x475e('0xbd')][_0x475e('0xbe')][_0x475e('0xb9')]['Label'],'value':_0x475e('0xbf')},{'name':_0x52a1b4['OptionSet'][_0x475e('0xc0')][_0x475e('0xbe')][_0x475e('0xb9')][_0x475e('0xbe')],'value':_0x475e('0xc1')});var _0x533f11={'id':_0x221ac1+'_'+_0x52a1b4['LogicalName'],'name':_0x52a1b4[_0x475e('0xbb')]['UserLocalizedLabel'][_0x475e('0xbe')],'custom':![],'options':_0x3c1eed};_0x486dd6[_0x475e('0xa6')](_0x533f11);return _0x486dd6;});}function getInputList(_0x46c758,_0x451073,_0x27f308,_0x113dc0,_0x103bfc,_0x32f8f1,_0x267e49){var _0x24a312={'method':_0x475e('0x9a'),'uri':_0x46c758+'EntityDefinitions('+_0x103bfc+')/Attributes('+_0x32f8f1+_0x475e('0xc2')+_0x27f308+_0x475e('0xc3'),'headers':{'Authorization':_0x475e('0x9d')+_0x267e49,'If-None-Match':null,'OData-Version':_0x475e('0x98')},'json':!![]};return rp(_0x24a312)[_0x475e('0xf')](function(_0x568562){var _0x376568={'id':_0x451073+'_'+_0x568562[_0x475e('0xa0')],'name':_0x568562[_0x475e('0xbb')][_0x475e('0xb9')]?_0x568562[_0x475e('0xbb')][_0x475e('0xb9')][_0x475e('0xbe')]:_0x568562[_0x475e('0xa0')],'custom':![],'options':[]};_0x113dc0[_0x475e('0xa6')](_0x376568);return _0x113dc0;});} \ No newline at end of file +var _0x42d5=['$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','OptionSet','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','undefined','offset','count','set','Content-Range','update','then','destroy','end','error','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','keys','includeAll','find','create','body','getConfigurations','findOne','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','Subjects','slice','substring','lastIndexOf','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','customerid','caseorigincode','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','primarycontactidname','primarycontactidyominame','productidname','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','remoteUri','tenantId','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','clientId','password','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','stack','send','test','Wrong\x20credentials',')/Attributes('];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x42d5,0xc9));var _0x542d=function(_0xcfa260,_0x2659f9){_0xcfa260=_0xcfa260-0x0;var _0x1fb0e9=_0x42d5[_0xcfa260];return _0x1fb0e9;};'use strict';var rp=require(_0x542d('0x0'));var util=require(_0x542d('0x1'));var _=require(_0x542d('0x2'));var qs=require(_0x542d('0x3'));var logger=require(_0x542d('0x4'))(_0x542d('0x5'));var db=require(_0x542d('0x6'))['db'];var integrations=require(_0x542d('0x7'));function respondWithResult(_0x2a7009,_0x154a33){_0x154a33=_0x154a33||0xc8;return function(_0x4145ac){if(_0x4145ac){return _0x2a7009[_0x542d('0x8')](_0x154a33)['json'](_0x4145ac);}};}function respondWithFilteredResult(_0x4c37f9,_0x22d24f){return function(_0x3b99af){if(_0x3b99af){var _0x21ec94=typeof _0x22d24f['offset']===_0x542d('0x9')&&typeof _0x22d24f['limit']===_0x542d('0x9');var _0x324067=_0x3b99af['count'];var _0x126d44=_0x21ec94?0x0:_0x22d24f[_0x542d('0xa')];var _0x2678d4=_0x21ec94?_0x3b99af[_0x542d('0xb')]:_0x22d24f[_0x542d('0xa')]+_0x22d24f['limit'];var _0x4e652c;if(_0x2678d4>=_0x324067){_0x2678d4=_0x324067;_0x4e652c=0xc8;}else{_0x4e652c=0xce;}_0x4c37f9[_0x542d('0x8')](_0x4e652c);return _0x4c37f9[_0x542d('0xc')](_0x542d('0xd'),_0x126d44+'-'+_0x2678d4+'/'+_0x324067)['json'](_0x3b99af);}return null;};}function saveUpdates(_0x58b8a7){return function(_0x57cb59){if(_0x57cb59){return _0x57cb59[_0x542d('0xe')](_0x58b8a7)[_0x542d('0xf')](function(_0x469f06){return _0x469f06;});}return null;};}function removeEntity(_0x2e1183){return function(_0x463371){if(_0x463371){return _0x463371[_0x542d('0x10')]()[_0x542d('0xf')](function(){_0x2e1183['status'](0xcc)[_0x542d('0x11')]();});}};}function handleEntityNotFound(_0x188dfc){return function(_0x5c4d9e){if(!_0x5c4d9e){_0x188dfc['sendStatus'](0x194);}return _0x5c4d9e;};}function handleError(_0x521e6d,_0x46e2fc){_0x46e2fc=_0x46e2fc||0x1f4;return function(_0x47e0ca){logger[_0x542d('0x12')](_0x47e0ca['stack']);if(_0x47e0ca['name']){delete _0x47e0ca[_0x542d('0x13')];}_0x521e6d[_0x542d('0x8')](_0x46e2fc)['send'](_0x47e0ca);};}exports[_0x542d('0x14')]=function(_0x1e3d56,_0x2b5a20){var _0x3fc42a={},_0x54b80e={},_0x5757ec={'count':0x0,'rows':[]};var _0x431ca8=_[_0x542d('0x15')](db[_0x542d('0x16')][_0x542d('0x17')],function(_0x3f512b){return{'name':_0x3f512b[_0x542d('0x18')],'type':_0x3f512b[_0x542d('0x19')]['key']};});_0x54b80e['model']=_[_0x542d('0x15')](_0x431ca8,'name');_0x54b80e[_0x542d('0x1a')]=_['keys'](_0x1e3d56[_0x542d('0x1a')]);_0x54b80e[_0x542d('0x1b')]=_[_0x542d('0x1c')](_0x54b80e[_0x542d('0x1d')],_0x54b80e[_0x542d('0x1a')]);_0x3fc42a['attributes']=_['intersection'](_0x54b80e[_0x542d('0x1d')],qs[_0x542d('0x1e')](_0x1e3d56['query'][_0x542d('0x1e')]));_0x3fc42a[_0x542d('0x1f')]=_0x3fc42a[_0x542d('0x1f')][_0x542d('0x20')]?_0x3fc42a[_0x542d('0x1f')]:_0x54b80e[_0x542d('0x1d')];if(!_0x1e3d56[_0x542d('0x1a')][_0x542d('0x21')]('nolimit')){_0x3fc42a['limit']=qs[_0x542d('0x22')](_0x1e3d56[_0x542d('0x1a')]['limit']);_0x3fc42a[_0x542d('0xa')]=qs[_0x542d('0xa')](_0x1e3d56['query'][_0x542d('0xa')]);}_0x3fc42a[_0x542d('0x23')]=qs[_0x542d('0x24')](_0x1e3d56[_0x542d('0x1a')][_0x542d('0x24')]);_0x3fc42a[_0x542d('0x25')]=qs[_0x542d('0x1b')](_[_0x542d('0x26')](_0x1e3d56['query'],_0x54b80e['filters']),_0x431ca8);if(_0x1e3d56[_0x542d('0x1a')]['filter']){_0x3fc42a['where']=_[_0x542d('0x27')](_0x3fc42a[_0x542d('0x25')],{'$or':_[_0x542d('0x15')](_0x431ca8,function(_0x369bdb){if(_0x369bdb[_0x542d('0x19')]!==_0x542d('0x28')){var _0x5a775c={};_0x5a775c[_0x369bdb[_0x542d('0x13')]]={'$like':'%'+_0x1e3d56[_0x542d('0x1a')][_0x542d('0x29')]+'%'};return _0x5a775c;}})});}_0x3fc42a=_[_0x542d('0x27')]({},_0x3fc42a,_0x1e3d56[_0x542d('0x2a')]);var _0x48a8d3={'where':_0x3fc42a['where']};return db['Dynamics365Account'][_0x542d('0xb')](_0x48a8d3)[_0x542d('0xf')](function(_0x8c9aad){_0x5757ec[_0x542d('0xb')]=_0x8c9aad;if(_0x1e3d56['query']['includeAll']){_0x3fc42a['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0x542d('0x2b')](_0x3fc42a);})['then'](function(_0x5e544c){_0x5757ec[_0x542d('0x2c')]=_0x5e544c;return _0x5757ec;})[_0x542d('0xf')](respondWithFilteredResult(_0x2b5a20,_0x3fc42a))[_0x542d('0x2d')](handleError(_0x2b5a20,null));};exports['show']=function(_0x2c1801,_0x41d040){var _0x4dfc7d={'raw':![],'where':{'id':_0x2c1801[_0x542d('0x2e')]['id']}},_0x5c15a1={};_0x5c15a1[_0x542d('0x1d')]=_[_0x542d('0x2f')](db[_0x542d('0x16')][_0x542d('0x17')]);_0x5c15a1[_0x542d('0x1a')]=_[_0x542d('0x2f')](_0x2c1801[_0x542d('0x1a')]);_0x5c15a1[_0x542d('0x1b')]=_[_0x542d('0x1c')](_0x5c15a1[_0x542d('0x1d')],_0x5c15a1[_0x542d('0x1a')]);_0x4dfc7d[_0x542d('0x1f')]=_[_0x542d('0x1c')](_0x5c15a1[_0x542d('0x1d')],qs['fields'](_0x2c1801['query'][_0x542d('0x1e')]));_0x4dfc7d[_0x542d('0x1f')]=_0x4dfc7d[_0x542d('0x1f')]['length']?_0x4dfc7d[_0x542d('0x1f')]:_0x5c15a1['model'];if(_0x2c1801['query'][_0x542d('0x30')]){_0x4dfc7d['include']=[{'all':!![]}];}_0x4dfc7d=_[_0x542d('0x27')]({},_0x4dfc7d,_0x2c1801[_0x542d('0x2a')]);return db[_0x542d('0x16')][_0x542d('0x31')](_0x4dfc7d)['then'](handleEntityNotFound(_0x41d040,null))[_0x542d('0xf')](respondWithResult(_0x41d040,null))[_0x542d('0x2d')](handleError(_0x41d040,null));};exports['create']=function(_0x401bbd,_0x2c36e4){return db['Dynamics365Account'][_0x542d('0x32')](_0x401bbd[_0x542d('0x33')],{})[_0x542d('0xf')](respondWithResult(_0x2c36e4,0xc9))[_0x542d('0x2d')](handleError(_0x2c36e4,null));};exports[_0x542d('0xe')]=function(_0x510a1b,_0x1b3460){if(_0x510a1b['body']['id']){delete _0x510a1b[_0x542d('0x33')]['id'];}return db[_0x542d('0x16')][_0x542d('0x31')]({'where':{'id':_0x510a1b[_0x542d('0x2e')]['id']}})[_0x542d('0xf')](handleEntityNotFound(_0x1b3460,null))['then'](saveUpdates(_0x510a1b['body'],null))['then'](respondWithResult(_0x1b3460,null))['catch'](handleError(_0x1b3460,null));};exports[_0x542d('0x10')]=function(_0x15bd7c,_0x5397c6){return db[_0x542d('0x16')][_0x542d('0x31')]({'where':{'id':_0x15bd7c[_0x542d('0x2e')]['id']}})[_0x542d('0xf')](handleEntityNotFound(_0x5397c6,null))[_0x542d('0xf')](removeEntity(_0x5397c6,null))[_0x542d('0x2d')](handleError(_0x5397c6,null));};exports[_0x542d('0x34')]=function(_0x4965db,_0x579c16){var _0x6a2843={};var _0x467e94={};var _0x16c780;var _0x43aaae;return db['Dynamics365Account'][_0x542d('0x35')]({'where':{'id':_0x4965db[_0x542d('0x2e')]['id']}})[_0x542d('0xf')](handleEntityNotFound(_0x579c16,null))[_0x542d('0xf')](function(_0xc93abf){if(_0xc93abf){_0x16c780=_0xc93abf;_0x467e94[_0x542d('0x1d')]=_[_0x542d('0x2f')](db['Dynamics365Configuration'][_0x542d('0x17')]);_0x467e94[_0x542d('0x1a')]=_[_0x542d('0x2f')](_0x4965db[_0x542d('0x1a')]);_0x467e94['filters']=_[_0x542d('0x1c')](_0x467e94[_0x542d('0x1d')],_0x467e94[_0x542d('0x1a')]);_0x6a2843[_0x542d('0x1f')]=_[_0x542d('0x1c')](_0x467e94[_0x542d('0x1d')],qs[_0x542d('0x1e')](_0x4965db[_0x542d('0x1a')][_0x542d('0x1e')]));_0x6a2843[_0x542d('0x1f')]=_0x6a2843[_0x542d('0x1f')]['length']?_0x6a2843[_0x542d('0x1f')]:_0x467e94[_0x542d('0x1d')];_0x6a2843['order']=qs['sort'](_0x4965db['query'][_0x542d('0x24')]);_0x6a2843['where']=qs['filters'](_[_0x542d('0x26')](_0x4965db[_0x542d('0x1a')],_0x467e94[_0x542d('0x1b')]));if(_0x4965db['query'][_0x542d('0x29')]){_0x6a2843[_0x542d('0x25')]=_['merge'](_0x6a2843[_0x542d('0x25')],{'$or':_['map'](_0x6a2843['attributes'],function(_0x1aeb8c){var _0x39a21e={};_0x39a21e[_0x1aeb8c]={'$like':'%'+_0x4965db[_0x542d('0x1a')][_0x542d('0x29')]+'%'};return _0x39a21e;})});}_0x6a2843=_[_0x542d('0x27')]({},_0x6a2843,_0x4965db[_0x542d('0x2a')]);return _0x16c780['getConfigurations'](_0x6a2843);}})['then'](function(_0x18a645){if(_0x18a645){_0x43aaae=_0x18a645['length'];if(!_0x4965db[_0x542d('0x1a')]['hasOwnProperty'](_0x542d('0x36'))){_0x6a2843[_0x542d('0x22')]=qs[_0x542d('0x22')](_0x4965db[_0x542d('0x1a')][_0x542d('0x22')]);_0x6a2843[_0x542d('0xa')]=qs[_0x542d('0xa')](_0x4965db[_0x542d('0x1a')][_0x542d('0xa')]);}return _0x16c780[_0x542d('0x34')](_0x6a2843);}})['then'](function(_0x2ca615){if(_0x2ca615){return _0x2ca615?{'count':_0x43aaae,'rows':_0x2ca615}:null;}})[_0x542d('0xf')](respondWithResult(_0x579c16,null))[_0x542d('0x2d')](handleError(_0x579c16,null));};exports[_0x542d('0x37')]=function(_0x1aa220,_0x12ee27){if(_0x1aa220[_0x542d('0x33')]['id']){delete _0x1aa220[_0x542d('0x33')]['id'];}return db[_0x542d('0x16')][_0x542d('0x35')]({'where':{'id':_0x1aa220['params']['id']}})[_0x542d('0xf')](handleEntityNotFound(_0x12ee27,null))['then'](function(_0x12b35f){if(_0x12b35f){_0x1aa220[_0x542d('0x33')][_0x542d('0x38')]=_0x12b35f['id'];_0x1aa220[_0x542d('0x33')]['Subjects']=integrations[_0x542d('0x39')](_0x1aa220[_0x542d('0x33')][_0x542d('0x3a')],_0x1aa220[_0x542d('0x33')][_0x542d('0x19')]);_0x1aa220[_0x542d('0x33')][_0x542d('0x3b')]=integrations[_0x542d('0x3c')](_0x1aa220[_0x542d('0x33')]['channel'],_0x1aa220['body'][_0x542d('0x19')]);return db[_0x542d('0x3d')][_0x542d('0x32')](_0x1aa220[_0x542d('0x33')],{'include':[{'model':db[_0x542d('0x3e')],'as':_0x542d('0x3f')},{'model':db[_0x542d('0x3e')],'as':_0x542d('0x3b')}]});}return null;})[_0x542d('0xf')](respondWithResult(_0x12ee27,null))['catch'](handleError(_0x12ee27,null));};function sanitizeRemoteUri(_0x1f399f){var _0x1aefdb=_0x1f399f[_0x542d('0x40')](-0x1);if(_0x1aefdb==='/')return _0x1f399f[_0x542d('0x41')](0x0,_0x1f399f[_0x542d('0x42')](_0x1aefdb));return _0x1f399f;}function getWebApiUrl(_0x5c41a3){return util['format'](_0x542d('0x43'),_0x5c41a3);}exports['getFields']=function(_0x3ecdbf,_0x39c476){var _0x4c37ae=_0x3ecdbf[_0x542d('0x1a')][_0x542d('0x44')];var _0x2cd327=_0x4c37ae===_0x542d('0x45')?_0x542d('0x46'):_0x542d('0x47');var _0x47641d='';var _0x3d2348='';var _0x4fb4b0='';var _0x4c852c='';var _0x4850ca='';var _0x36e403='';var _0x599051='';var _0x5b5356='';var _0x20dd4b=[_0x542d('0x48'),'description',_0x542d('0x49'),'ownerid',_0x542d('0x4a'),'subject',_0x542d('0x4b'),'regardingobjectid',_0x542d('0x4c'),_0x542d('0x4d')];var _0x2ee86a=[_0x542d('0x4e'),_0x542d('0x4f'),_0x542d('0x50'),_0x542d('0x51'),_0x542d('0x52'),_0x542d('0x53'),'contractdetailidname',_0x542d('0x54'),'createdbyexternalpartyname',_0x542d('0x55'),_0x542d('0x56'),_0x542d('0x57'),_0x542d('0x58'),_0x542d('0x59'),'createdonbehalfbyyominame',_0x542d('0x5a'),_0x542d('0x5b'),_0x542d('0x5c'),_0x542d('0x5d'),_0x542d('0x5e'),_0x542d('0x5f'),_0x542d('0x60'),_0x542d('0x61'),'exchangerate','firstresponsebykpiidname',_0x542d('0x62'),_0x542d('0x63'),_0x542d('0x64'),_0x542d('0x65'),_0x542d('0x66'),_0x542d('0x67'),_0x542d('0x68'),_0x542d('0x69'),_0x542d('0x6a'),'modifiedbyyominame',_0x542d('0x6b'),_0x542d('0x6c'),'modifiedonbehalfbyyominame',_0x542d('0x6d'),_0x542d('0x6e'),_0x542d('0x6f'),'onholdtime',_0x542d('0x70'),_0x542d('0x71'),'owneridtype',_0x542d('0x72'),'parentcaseidname',_0x542d('0x73'),_0x542d('0x74'),'prioritycodename',_0x542d('0x75'),'productserialnumber','resolveby',_0x542d('0x76'),_0x542d('0x77'),'responsiblecontactidname',_0x542d('0x78'),_0x542d('0x79'),'slainvokedidname',_0x542d('0x7a'),_0x542d('0x7b'),_0x542d('0x7c'),_0x542d('0x7d'),_0x542d('0x7e'),_0x542d('0x7f'),_0x542d('0x80'),_0x542d('0x81'),_0x542d('0x82'),_0x542d('0x83'),_0x542d('0x84')];var _0x3ca4c2=_0x20dd4b['concat'](_0x2ee86a);return db['Dynamics365Account'][_0x542d('0x35')]({'where':{'id':_0x3ecdbf[_0x542d('0x2e')]['id']},'attributes':['id',_0x542d('0x85'),'password',_0x542d('0x86'),_0x542d('0x87'),'clientId','clientSecret',_0x542d('0x88')],'include':[{'model':db[_0x542d('0x89')],'as':_0x542d('0x89'),'attributes':['id',_0x542d('0x8a'),_0x542d('0x8b')]}]})[_0x542d('0xf')](handleEntityNotFound(_0x39c476,null))[_0x542d('0xf')](function(_0x20906d){if(_0x20906d){if(_0x20906d['modernAuthentication']){_0x20906d[_0x542d('0x8c')]=_0x20906d[_0x542d('0x89')][_0x542d('0x8a')];_0x5b5356=sanitizeRemoteUri(_0x20906d[_0x542d('0x89')][_0x542d('0x8b')]);_0x599051=getWebApiUrl(_0x5b5356);return _0x20906d;}_0x5b5356=sanitizeRemoteUri(_0x20906d[_0x542d('0x86')]);_0x599051=getWebApiUrl(_0x5b5356);var _0x4cce5d={'method':_0x542d('0x8d'),'uri':_0x542d('0x8e')+_0x20906d[_0x542d('0x87')]+'/oauth2/token','form':{'client_id':_0x20906d[_0x542d('0x8f')],'resource':_0x5b5356,'username':_0x20906d[_0x542d('0x85')],'password':_0x20906d[_0x542d('0x90')],'grant_type':_0x542d('0x90'),'client_secret':_0x20906d[_0x542d('0x91')]},'json':!![]};return rp(_0x4cce5d);}})['then'](function(_0x523e36){_0x36e403=_0x523e36[_0x542d('0x8c')];var _0x562945={'method':_0x542d('0x92'),'uri':encodeURI(_0x599051+_0x542d('0x93')+_0x2cd327+'\x27'),'headers':{'Authorization':_0x542d('0x94')+_0x36e403,'If-None-Match':null,'OData-Version':_0x542d('0x95')},'json':!![]};return rp(_0x562945);})[_0x542d('0xf')](function(_0x4ed03f){var _0x34ae2d=_0x4ed03f[_0x542d('0x96')][0x0];var _0x1d9af5=_0x34ae2d[_0x542d('0x97')];var _0x144d7e={'method':_0x542d('0x92'),'uri':_0x599051+_0x542d('0x98')+_0x1d9af5+_0x542d('0x99'),'headers':{'Authorization':_0x542d('0x94')+_0x36e403,'If-None-Match':null,'OData-Version':_0x542d('0x95')},'json':!![]};return rp(_0x144d7e);})[_0x542d('0xf')](function(_0x312b07){_0x47641d=_0x312b07;_0x3d2348=_0x47641d['Attributes'];_0x3d2348=_[_0x542d('0x9a')](_0x3d2348,function(_0x4388b7){return!_0x3ca4c2['includes'](_0x4388b7[_0x542d('0x9b')]);});var _0x2059e2=[];var _0x2847f7=[];_0x3d2348[_0x542d('0x9c')](function(_0x4b0334){if(_0x4b0334[_0x542d('0x9d')]){var _0x19028a=_0x4b0334[_0x542d('0x9d')][_0x542d('0x41')](_0x4b0334[_0x542d('0x9d')][_0x542d('0x42')]('.')+0x1);if(_0x19028a===_0x542d('0x9e')){_0x2059e2[_0x542d('0x9f')](getSelectList(_0x599051,_0x4c37ae,_0x2847f7,_0x47641d[_0x542d('0x97')],_0x4b0334[_0x542d('0x97')],_0x36e403));}}});return Promise[_0x542d('0xa0')](_0x2059e2);})[_0x542d('0xf')](function(_0xc21ed6){_0x4fb4b0=_0xc21ed6[0x0];var _0x18e7cd=[];var _0x1ca66c=[];_0x3d2348[_0x542d('0x9c')](function(_0x31478d){if(!_['isNil'](_0x31478d['@odata.type'])){var _0x11fcfc=_0x31478d[_0x542d('0x9d')][_0x542d('0x41')](_0x31478d[_0x542d('0x9d')][_0x542d('0x42')]('.')+0x1);if(_0x11fcfc==='BooleanAttributeMetadata'){_0x18e7cd['push'](getBooleanList(_0x599051,_0x4c37ae,_0x1ca66c,_0x47641d[_0x542d('0x97')],_0x31478d[_0x542d('0x97')],_0x36e403));}}});return Promise[_0x542d('0xa0')](_0x18e7cd);})[_0x542d('0xf')](function(_0x3e0794){_0x4c852c=_0x3e0794[0x0];var _0x8cda02=[];var _0xa0498a=[];_0x3d2348[_0x542d('0x9c')](function(_0x4af40c){if(_0x4af40c[_0x542d('0x9d')]){var _0x302bc0=_0x4af40c['@odata.type']['substring'](_0x4af40c[_0x542d('0x9d')][_0x542d('0x42')]('.')+0x1);if(_0x302bc0===_0x542d('0xa1')||_0x302bc0===_0x542d('0xa2')||_0x302bc0===_0x542d('0xa3')||_0x302bc0===_0x542d('0xa4')||_0x302bc0==='MemoAttributeMetadata'||_0x302bc0==='DateTimeAttributeMetadata'||_0x302bc0===_0x542d('0xa5')||_0x302bc0==='EntityNameAttributeMetadata'||_0x302bc0===_0x542d('0xa6')||_0x302bc0===_0x542d('0xa7')){_0x8cda02[_0x542d('0x9f')](getInputList(_0x599051,_0x4c37ae,_0x302bc0,_0xa0498a,_0x47641d['MetadataId'],_0x4af40c[_0x542d('0x97')],_0x36e403));}}});return Promise['all'](_0x8cda02);})[_0x542d('0xf')](function(_0x559e31){_0x4850ca=_0x559e31[0x0];var _0x2319b3=_0x4fb4b0['concat'](_0x4c852c)[_0x542d('0xa8')](_0x4850ca);var _0x1aea68={'count':_0x2319b3[_0x542d('0x20')],'rows':_0x2319b3};return _0x1aea68;})[_0x542d('0xf')](respondWithResult(_0x39c476,null))['catch'](function(_0x4294cc){var _0x3918e5=_0x3ecdbf[_0x542d('0x1a')]['test']?0x1f4:_0x4294cc[_0x542d('0xa9')]||0x1f4;logger[_0x542d('0x12')](_0x4294cc[_0x542d('0xaa')]);delete _0x4294cc[_0x542d('0x13')];if(_0x3918e5===0x191){_0x3918e5=0x190;}_0x39c476[_0x542d('0x8')](_0x3918e5)[_0x542d('0xab')](_0x3ecdbf[_0x542d('0x1a')][_0x542d('0xac')]?{'message':_0x542d('0xad'),'statusCode':_0x4294cc[_0x542d('0xa9')]}:_0x4294cc);});};function getSelectList(_0x9f79e,_0x4891fd,_0xe3a5fa,_0x6b04d4,_0x24dbfa,_0x2c84fd){var _0x7239c0={'method':_0x542d('0x92'),'uri':_0x9f79e+_0x542d('0x98')+_0x6b04d4+_0x542d('0xae')+_0x24dbfa+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x542d('0xaf'),'headers':{'Authorization':_0x542d('0x94')+_0x2c84fd,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x7239c0)['then'](function(_0x4cfbe5){var _0x1043b5=[];var _0x16d7ce=_0x4cfbe5['OptionSet'][_0x542d('0xb0')];_0x16d7ce[_0x542d('0x9c')](function(_0x585e8f){_0x1043b5[_0x542d('0x9f')]({'name':_0x585e8f[_0x542d('0xb1')][_0x542d('0xb2')][_0x542d('0xb1')],'value':String(_0x585e8f[_0x542d('0xb3')])});});var _0x1379d7={'id':_0x4891fd+'_'+_0x4cfbe5[_0x542d('0x9b')],'name':_0x4cfbe5['DisplayName'][_0x542d('0xb2')][_0x542d('0xb1')],'custom':![],'options':_0x1043b5};_0xe3a5fa['push'](_0x1379d7);return _0xe3a5fa;});}function getBooleanList(_0x172c15,_0x8f8090,_0xbcbafa,_0x4b7cfc,_0x4e4ea7,_0x2352be){var _0x2f6cfc={'method':_0x542d('0x92'),'uri':_0x172c15+_0x542d('0x98')+_0x4b7cfc+_0x542d('0xae')+_0x4e4ea7+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x542d('0x94')+_0x2352be,'If-None-Match':null,'OData-Version':_0x542d('0x95')},'json':!![]};return rp(_0x2f6cfc)[_0x542d('0xf')](function(_0x2fcb9d){var _0x40355e=[];_0x40355e[_0x542d('0x9f')]({'name':_0x2fcb9d[_0x542d('0xb4')][_0x542d('0xb5')][_0x542d('0xb1')][_0x542d('0xb2')][_0x542d('0xb1')],'value':_0x542d('0xb6')},{'name':_0x2fcb9d['OptionSet'][_0x542d('0xb7')][_0x542d('0xb1')][_0x542d('0xb2')][_0x542d('0xb1')],'value':_0x542d('0xb8')});var _0x3bdb8d={'id':_0x8f8090+'_'+_0x2fcb9d[_0x542d('0x9b')],'name':_0x2fcb9d[_0x542d('0xb9')][_0x542d('0xb2')]['Label'],'custom':![],'options':_0x40355e};_0xbcbafa[_0x542d('0x9f')](_0x3bdb8d);return _0xbcbafa;});}function getInputList(_0x5a452d,_0x564d4d,_0x14340e,_0x2690f1,_0xac616,_0x1dd719,_0x2a1a5d){var _0x93ee0={'method':_0x542d('0x92'),'uri':_0x5a452d+_0x542d('0x98')+_0xac616+_0x542d('0xae')+_0x1dd719+_0x542d('0xba')+_0x14340e+_0x542d('0xbb'),'headers':{'Authorization':'Bearer\x20'+_0x2a1a5d,'If-None-Match':null,'OData-Version':_0x542d('0x95')},'json':!![]};return rp(_0x93ee0)['then'](function(_0x1e8aad){var _0x27ff62={'id':_0x564d4d+'_'+_0x1e8aad[_0x542d('0x9b')],'name':_0x1e8aad['DisplayName'][_0x542d('0xb2')]?_0x1e8aad['DisplayName'][_0x542d('0xb2')][_0x542d('0xb1')]:_0x1e8aad[_0x542d('0x9b')],'custom':![],'options':[]};_0x2690f1[_0x542d('0x9f')](_0x27ff62);return _0x2690f1;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index d3e1515..4f7cef1 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x270a75,_0x48fd4b){var _0xe1c7b7=function(_0x50d43e){while(--_0x50d43e){_0x270a75['push'](_0x270a75['shift']());}};_0xe1c7b7(++_0x48fd4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1a05d0,_0x328120){var _0x48192a=function(_0x380396){while(--_0x380396){_0x1a05d0['push'](_0x1a05d0['shift']());}};_0x48192a(++_0x328120);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'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 5be5e5f..facc5d2 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 _0x8838=['error','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then','info','Dynamics365Account','find','ShowDynamics365Account','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ba335,_0x33b0fb){var _0x5dd44a=function(_0x8f0762){while(--_0x8f0762){_0x3ba335['push'](_0x3ba335['shift']());}};_0x5dd44a(++_0x33b0fb);}(_0x8838,0x12b));var _0x8883=function(_0x56a2a6,_0x303571){_0x56a2a6=_0x56a2a6-0x0;var _0x4fa8eb=_0x8838[_0x56a2a6];return _0x4fa8eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8883('0x0'));var BPromise=require(_0x8883('0x1'));var rs=require(_0x8883('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8883('0x3'))['db'];var utils=require(_0x8883('0x4'));var logger=require(_0x8883('0x5'))(_0x8883('0x6'));var config=require(_0x8883('0x7'));var jayson=require(_0x8883('0x8'));var client=jayson[_0x8883('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59818b,_0x39d33e,_0x19be30){return new BPromise(function(_0x92bb07,_0x541fb6){return client[_0x8883('0xa')](_0x59818b,_0x19be30)['then'](function(_0x1db3c1){logger['info'](_0x8883('0xb'),_0x39d33e,_0x8883('0xc'));logger[_0x8883('0xd')](_0x8883('0xe'),_0x39d33e,'request\x20sent',JSON[_0x8883('0xf')](_0x1db3c1));if(_0x1db3c1[_0x8883('0x10')]){if(_0x1db3c1[_0x8883('0x10')]['code']===0x1f4){logger['error'](_0x8883('0xb'),_0x39d33e,_0x1db3c1[_0x8883('0x10')][_0x8883('0x11')]);return _0x541fb6(_0x1db3c1[_0x8883('0x10')][_0x8883('0x11')]);}logger[_0x8883('0x10')](_0x8883('0xb'),_0x39d33e,_0x1db3c1[_0x8883('0x10')][_0x8883('0x11')]);return _0x92bb07(_0x1db3c1[_0x8883('0x10')][_0x8883('0x11')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x39d33e,_0x8883('0xc'));_0x92bb07(_0x1db3c1[_0x8883('0x12')][_0x8883('0x11')]);}})[_0x8883('0x13')](function(_0x3de77a){logger[_0x8883('0x10')](_0x8883('0xb'),_0x39d33e,_0x3de77a);_0x541fb6(_0x3de77a);});});}exports[_0x8883('0x14')]=function(_0x2f8b40){var _0x5c3819=this;return new Promise(function(_0x51f190,_0x97abcb){return db['Dynamics365Account'][_0x8883('0x15')]({'raw':_0x2f8b40['options']?_0x2f8b40[_0x8883('0x16')][_0x8883('0x17')]===undefined?!![]:![]:!![],'where':_0x2f8b40[_0x8883('0x16')]?_0x2f8b40['options'][_0x8883('0x18')]||null:null,'attributes':_0x2f8b40[_0x8883('0x16')]?_0x2f8b40[_0x8883('0x16')][_0x8883('0x19')]||null:null,'limit':_0x2f8b40['options']?_0x2f8b40[_0x8883('0x16')][_0x8883('0x1a')]||null:null,'include':_0x2f8b40[_0x8883('0x16')]?_0x2f8b40['options'][_0x8883('0x1b')]?_[_0x8883('0x1c')](_0x2f8b40[_0x8883('0x16')][_0x8883('0x1b')],function(_0x46d536){return{'model':db[_0x46d536[_0x8883('0x1d')]],'as':_0x46d536['as'],'attributes':_0x46d536[_0x8883('0x19')],'include':_0x46d536[_0x8883('0x1b')]?_[_0x8883('0x1c')](_0x46d536[_0x8883('0x1b')],function(_0x44b36e){return{'model':db[_0x44b36e['model']],'as':_0x44b36e['as'],'attributes':_0x44b36e['attributes'],'include':_0x44b36e[_0x8883('0x1b')]?_[_0x8883('0x1c')](_0x44b36e[_0x8883('0x1b')],function(_0x1978a3){return{'model':db[_0x1978a3[_0x8883('0x1d')]],'as':_0x1978a3['as'],'attributes':_0x1978a3['attributes']};}):[]};}):[]};}):[]:[]})[_0x8883('0x1e')](function(_0x435845){logger[_0x8883('0x1f')]('GetDynamics365Account',_0x2f8b40);logger[_0x8883('0xd')](_0x8883('0x14'),_0x2f8b40,JSON[_0x8883('0xf')](_0x435845));_0x51f190(_0x435845);})[_0x8883('0x13')](function(_0x3a9739){logger[_0x8883('0x10')](_0x8883('0x14'),_0x3a9739['message'],_0x2f8b40);_0x97abcb(_0x5c3819[_0x8883('0x10')](0x1f4,_0x3a9739[_0x8883('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x56a518){var _0x3cd06d=this;return new Promise(function(_0x418bd9,_0x40edea){return db[_0x8883('0x20')][_0x8883('0x21')]({'raw':_0x56a518['options']?_0x56a518[_0x8883('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x56a518['options']?_0x56a518[_0x8883('0x16')][_0x8883('0x18')]||null:null,'attributes':_0x56a518[_0x8883('0x16')]?_0x56a518[_0x8883('0x16')]['attributes']||null:null,'include':_0x56a518[_0x8883('0x16')]?_0x56a518[_0x8883('0x16')][_0x8883('0x1b')]?_[_0x8883('0x1c')](_0x56a518[_0x8883('0x16')][_0x8883('0x1b')],function(_0xcd3fd4){return{'model':db[_0xcd3fd4['model']],'as':_0xcd3fd4['as'],'attributes':_0xcd3fd4[_0x8883('0x19')],'include':_0xcd3fd4[_0x8883('0x1b')]?_[_0x8883('0x1c')](_0xcd3fd4[_0x8883('0x1b')],function(_0x9e822b){return{'model':db[_0x9e822b['model']],'as':_0x9e822b['as'],'attributes':_0x9e822b['attributes'],'include':_0x9e822b[_0x8883('0x1b')]?_[_0x8883('0x1c')](_0x9e822b[_0x8883('0x1b')],function(_0x2f306a){return{'model':db[_0x2f306a[_0x8883('0x1d')]],'as':_0x2f306a['as'],'attributes':_0x2f306a[_0x8883('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8883('0x1e')](function(_0x240723){logger[_0x8883('0x1f')](_0x8883('0x22'),_0x56a518);logger[_0x8883('0xd')](_0x8883('0x22'),_0x56a518,JSON['stringify'](_0x240723));_0x418bd9(_0x240723);})[_0x8883('0x13')](function(_0x478486){logger['error'](_0x8883('0x22'),_0x478486[_0x8883('0x11')],_0x56a518);_0x40edea(_0x3cd06d[_0x8883('0x10')](0x1f4,_0x478486[_0x8883('0x11')]));});});}; \ No newline at end of file +var _0x58ad=['http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Dynamics365Account','options','raw','where','attributes','limit','include','map','model','then','GetDynamics365Account','debug','ShowDynamics365Account','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2c23e9,_0x1b7597){var _0x3a84ec=function(_0x94d22f){while(--_0x94d22f){_0x2c23e9['push'](_0x2c23e9['shift']());}};_0x3a84ec(++_0x1b7597);}(_0x58ad,0x139));var _0xd58a=function(_0x378cd4,_0x4e9050){_0x378cd4=_0x378cd4-0x0;var _0x42bcde=_0x58ad[_0x378cd4];return _0x42bcde;};'use strict';var _=require('lodash');var util=require(_0xd58a('0x0'));var moment=require(_0xd58a('0x1'));var BPromise=require('bluebird');var rs=require(_0xd58a('0x2'));var fs=require('fs');var Redis=require(_0xd58a('0x3'));var db=require(_0xd58a('0x4'))['db'];var utils=require(_0xd58a('0x5'));var logger=require(_0xd58a('0x6'))(_0xd58a('0x7'));var config=require(_0xd58a('0x8'));var jayson=require(_0xd58a('0x9'));var client=jayson[_0xd58a('0xa')][_0xd58a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3501f7,_0x2ec99a,_0x361ea7){return new BPromise(function(_0x5f4908,_0x89f155){return client[_0xd58a('0xc')](_0x3501f7,_0x361ea7)['then'](function(_0x36be15){logger[_0xd58a('0xd')](_0xd58a('0xe'),_0x2ec99a,_0xd58a('0xf'));logger['debug'](_0xd58a('0x10'),_0x2ec99a,_0xd58a('0xf'),JSON[_0xd58a('0x11')](_0x36be15));if(_0x36be15[_0xd58a('0x12')]){if(_0x36be15[_0xd58a('0x12')][_0xd58a('0x13')]===0x1f4){logger[_0xd58a('0x12')](_0xd58a('0xe'),_0x2ec99a,_0x36be15[_0xd58a('0x12')][_0xd58a('0x14')]);return _0x89f155(_0x36be15[_0xd58a('0x12')][_0xd58a('0x14')]);}logger[_0xd58a('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x2ec99a,_0x36be15[_0xd58a('0x12')][_0xd58a('0x14')]);return _0x5f4908(_0x36be15['error'][_0xd58a('0x14')]);}else{logger[_0xd58a('0xd')](_0xd58a('0xe'),_0x2ec99a,_0xd58a('0xf'));_0x5f4908(_0x36be15[_0xd58a('0x15')]['message']);}})[_0xd58a('0x16')](function(_0x2ba9d0){logger[_0xd58a('0x12')](_0xd58a('0xe'),_0x2ec99a,_0x2ba9d0);_0x89f155(_0x2ba9d0);});});}exports['GetDynamics365Account']=function(_0x5373d2){var _0x40e624=this;return new Promise(function(_0xf4bc89,_0x1eb3fa){return db[_0xd58a('0x17')]['findAll']({'raw':_0x5373d2[_0xd58a('0x18')]?_0x5373d2['options'][_0xd58a('0x19')]===undefined?!![]:![]:!![],'where':_0x5373d2[_0xd58a('0x18')]?_0x5373d2['options'][_0xd58a('0x1a')]||null:null,'attributes':_0x5373d2[_0xd58a('0x18')]?_0x5373d2['options'][_0xd58a('0x1b')]||null:null,'limit':_0x5373d2[_0xd58a('0x18')]?_0x5373d2['options'][_0xd58a('0x1c')]||null:null,'include':_0x5373d2[_0xd58a('0x18')]?_0x5373d2['options'][_0xd58a('0x1d')]?_[_0xd58a('0x1e')](_0x5373d2['options']['include'],function(_0x2a48eb){return{'model':db[_0x2a48eb[_0xd58a('0x1f')]],'as':_0x2a48eb['as'],'attributes':_0x2a48eb[_0xd58a('0x1b')],'include':_0x2a48eb[_0xd58a('0x1d')]?_[_0xd58a('0x1e')](_0x2a48eb[_0xd58a('0x1d')],function(_0x519eea){return{'model':db[_0x519eea[_0xd58a('0x1f')]],'as':_0x519eea['as'],'attributes':_0x519eea['attributes'],'include':_0x519eea['include']?_[_0xd58a('0x1e')](_0x519eea[_0xd58a('0x1d')],function(_0xa024ce){return{'model':db[_0xa024ce[_0xd58a('0x1f')]],'as':_0xa024ce['as'],'attributes':_0xa024ce[_0xd58a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd58a('0x20')](function(_0x3c91ab){logger[_0xd58a('0xd')](_0xd58a('0x21'),_0x5373d2);logger[_0xd58a('0x22')](_0xd58a('0x21'),_0x5373d2,JSON[_0xd58a('0x11')](_0x3c91ab));_0xf4bc89(_0x3c91ab);})[_0xd58a('0x16')](function(_0x71b596){logger[_0xd58a('0x12')](_0xd58a('0x21'),_0x71b596[_0xd58a('0x14')],_0x5373d2);_0x1eb3fa(_0x40e624[_0xd58a('0x12')](0x1f4,_0x71b596[_0xd58a('0x14')]));});});};exports[_0xd58a('0x23')]=function(_0x3516b1){var _0x5aef6b=this;return new Promise(function(_0x29045e,_0xe4e6bb){return db[_0xd58a('0x17')]['find']({'raw':_0x3516b1[_0xd58a('0x18')]?_0x3516b1[_0xd58a('0x18')][_0xd58a('0x19')]===undefined?!![]:![]:!![],'where':_0x3516b1[_0xd58a('0x18')]?_0x3516b1[_0xd58a('0x18')][_0xd58a('0x1a')]||null:null,'attributes':_0x3516b1[_0xd58a('0x18')]?_0x3516b1[_0xd58a('0x18')][_0xd58a('0x1b')]||null:null,'include':_0x3516b1[_0xd58a('0x18')]?_0x3516b1[_0xd58a('0x18')][_0xd58a('0x1d')]?_[_0xd58a('0x1e')](_0x3516b1[_0xd58a('0x18')][_0xd58a('0x1d')],function(_0x38799a){return{'model':db[_0x38799a['model']],'as':_0x38799a['as'],'attributes':_0x38799a['attributes'],'include':_0x38799a[_0xd58a('0x1d')]?_[_0xd58a('0x1e')](_0x38799a[_0xd58a('0x1d')],function(_0x4462a7){return{'model':db[_0x4462a7[_0xd58a('0x1f')]],'as':_0x4462a7['as'],'attributes':_0x4462a7[_0xd58a('0x1b')],'include':_0x4462a7[_0xd58a('0x1d')]?_[_0xd58a('0x1e')](_0x4462a7[_0xd58a('0x1d')],function(_0x4925b0){return{'model':db[_0x4925b0[_0xd58a('0x1f')]],'as':_0x4925b0['as'],'attributes':_0x4925b0[_0xd58a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd58a('0x20')](function(_0x5f3b7a){logger[_0xd58a('0xd')](_0xd58a('0x23'),_0x3516b1);logger[_0xd58a('0x22')]('ShowDynamics365Account',_0x3516b1,JSON[_0xd58a('0x11')](_0x5f3b7a));_0x29045e(_0x5f3b7a);})[_0xd58a('0x16')](function(_0x152e60){logger[_0xd58a('0x12')](_0xd58a('0x23'),_0x152e60[_0xd58a('0x14')],_0x3516b1);_0xe4e6bb(_0x5aef6b[_0xd58a('0x12')](0x1f4,_0x152e60[_0xd58a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d263b1c..80f3094 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 _0x76e0=['./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','exports','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5d6bb7,_0x101286){var _0x5052b5=function(_0x3648e8){while(--_0x3648e8){_0x5d6bb7['push'](_0x5d6bb7['shift']());}};_0x5052b5(++_0x101286);}(_0x76e0,0x6e));var _0x076e=function(_0x3d4ab5,_0x55bcf8){_0x3d4ab5=_0x3d4ab5-0x0;var _0x3a79a0=_0x76e0[_0x3d4ab5];return _0x3a79a0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x076e('0x0'));var router=express['Router']();var fs_extra=require(_0x076e('0x1'));var auth=require(_0x076e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x076e('0x3'));var controller=require(_0x076e('0x4'));router[_0x076e('0x5')]('/',auth[_0x076e('0x6')](),controller[_0x076e('0x7')]);router['get']('/:id',auth[_0x076e('0x6')](),controller[_0x076e('0x8')]);router[_0x076e('0x5')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0x076e('0x6')](),controller[_0x076e('0x9')]);router[_0x076e('0x5')](_0x076e('0xa'),auth[_0x076e('0x6')](),controller[_0x076e('0xb')]);router[_0x076e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x076e('0xd')](_0x076e('0xe'),auth[_0x076e('0x6')](),controller[_0x076e('0xf')]);router[_0x076e('0x10')](_0x076e('0xe'),auth['isAuthenticated'](),controller[_0x076e('0x11')]);module[_0x076e('0x12')]=router; \ No newline at end of file +var _0xf894=['getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0xf894,0xfd));var _0x4f89=function(_0x14c0b5,_0x24a525){_0x14c0b5=_0x14c0b5-0x0;var _0x357923=_0xf894[_0x14c0b5];return _0x357923;};'use strict';var multer=require(_0x4f89('0x0'));var util=require(_0x4f89('0x1'));var path=require(_0x4f89('0x2'));var timeout=require(_0x4f89('0x3'));var express=require(_0x4f89('0x4'));var router=express[_0x4f89('0x5')]();var fs_extra=require(_0x4f89('0x6'));var auth=require(_0x4f89('0x7'));var interaction=require(_0x4f89('0x8'));var config=require(_0x4f89('0x9'));var controller=require(_0x4f89('0xa'));router[_0x4f89('0xb')]('/',auth[_0x4f89('0xc')](),controller[_0x4f89('0xd')]);router[_0x4f89('0xb')](_0x4f89('0xe'),auth[_0x4f89('0xc')](),controller[_0x4f89('0xf')]);router['get'](_0x4f89('0x10'),auth[_0x4f89('0xc')](),controller[_0x4f89('0x11')]);router[_0x4f89('0xb')](_0x4f89('0x12'),auth[_0x4f89('0xc')](),controller[_0x4f89('0x13')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x4f89('0x14')]);router[_0x4f89('0x15')]('/',auth['isAuthenticated'](),controller[_0x4f89('0x16')]);router[_0x4f89('0x17')](_0x4f89('0xe'),auth[_0x4f89('0xc')](),controller[_0x4f89('0x18')]);router[_0x4f89('0x19')](_0x4f89('0xe'),auth[_0x4f89('0xc')](),controller[_0x4f89('0x1a')]);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 e2f22fb..6703f4c 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 _0x02bc=['nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x268857,_0x58a836){var _0x21b1a2=function(_0x35b7cf){while(--_0x35b7cf){_0x268857['push'](_0x268857['shift']());}};_0x21b1a2(++_0x58a836);}(_0x02bc,0x1bb));var _0xc02b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x02bc[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xc02b('0x0'));module[_0xc02b('0x1')]={'name':{'type':Sequelize[_0xc02b('0x2')]},'description':{'type':Sequelize[_0xc02b('0x2')]},'ticketType':{'type':Sequelize[_0xc02b('0x3')](_0xc02b('0x4'),_0xc02b('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xc02b('0x3')](_0xc02b('0x6'),_0xc02b('0x7')),'defaultValue':_0xc02b('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xc02b('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xc02b('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6ac0=['incident','phonecall','nothing','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x576501,_0x1b7bdd){var _0x50358f=function(_0x521020){while(--_0x521020){_0x576501['push'](_0x576501['shift']());}};_0x50358f(++_0x1b7bdd);}(_0x6ac0,0x94));var _0x06ac=function(_0x28d332,_0x1d5219){_0x28d332=_0x28d332-0x0;var _0x333dd3=_0x6ac0[_0x28d332];return _0x333dd3;};'use strict';var Sequelize=require(_0x06ac('0x0'));module[_0x06ac('0x1')]={'name':{'type':Sequelize[_0x06ac('0x2')]},'description':{'type':Sequelize[_0x06ac('0x2')]},'ticketType':{'type':Sequelize[_0x06ac('0x3')](_0x06ac('0x4'),_0x06ac('0x5')),'defaultValue':_0x06ac('0x4')},'moduleCreate':{'type':Sequelize[_0x06ac('0x3')]('contact',_0x06ac('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x06ac('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x06ac('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index f62b354..e4f2703 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 _0xdd1d=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','sendStatus','error','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Dynamics365Configuration','includeAll','include','findAll','show','params','find','catch','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x4528cf,_0x3b1892){var _0x4bca53=function(_0x47d77b){while(--_0x47d77b){_0x4528cf['push'](_0x4528cf['shift']());}};_0x4bca53(++_0x3b1892);}(_0xdd1d,0x8f));var _0xddd1=function(_0x246194,_0x27cdd9){_0x246194=_0x246194-0x0;var _0x4fed0e=_0xdd1d[_0x246194];return _0x4fed0e;};'use strict';var emlformat=require(_0xddd1('0x0'));var rimraf=require(_0xddd1('0x1'));var zipdir=require(_0xddd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xddd1('0x3'));var Mustache=require(_0xddd1('0x4'));var util=require(_0xddd1('0x5'));var path=require(_0xddd1('0x6'));var sox=require(_0xddd1('0x7'));var csv=require(_0xddd1('0x8'));var ejs=require(_0xddd1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddd1('0xa'));var squel=require(_0xddd1('0xb'));var crypto=require(_0xddd1('0xc'));var jsforce=require(_0xddd1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xddd1('0xe'));var Papa=require(_0xddd1('0xf'));var Redis=require('ioredis');var authService=require(_0xddd1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xddd1('0x11'));var hardwareService=require(_0xddd1('0x12'));var logger=require(_0xddd1('0x13'))(_0xddd1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xddd1('0x15'));var db=require(_0xddd1('0x16'))['db'];function respondWithStatusCode(_0x5bea3b,_0x36e903){_0x36e903=_0x36e903||0xcc;return function(_0x175321){if(_0x175321){return _0x5bea3b['sendStatus'](_0x36e903);}return _0x5bea3b[_0xddd1('0x17')](_0x36e903)[_0xddd1('0x18')]();};}function respondWithResult(_0x127479,_0x5ad96d){_0x5ad96d=_0x5ad96d||0xc8;return function(_0x3a3a74){if(_0x3a3a74){return _0x127479[_0xddd1('0x17')](_0x5ad96d)[_0xddd1('0x19')](_0x3a3a74);}};}function respondWithFilteredResult(_0x508615,_0x44fc4a){return function(_0x304018){if(_0x304018){var _0x3e8d44=typeof _0x44fc4a[_0xddd1('0x1a')]===_0xddd1('0x1b')&&typeof _0x44fc4a[_0xddd1('0x1c')]===_0xddd1('0x1b');var _0x5b7dcc=_0x304018[_0xddd1('0x1d')];var _0x47615f=_0x3e8d44?0x0:_0x44fc4a[_0xddd1('0x1a')];var _0x526d6e=_0x3e8d44?_0x304018[_0xddd1('0x1d')]:_0x44fc4a[_0xddd1('0x1a')]+_0x44fc4a['limit'];var _0xb6c86b;if(_0x526d6e>=_0x5b7dcc){_0x526d6e=_0x5b7dcc;_0xb6c86b=0xc8;}else{_0xb6c86b=0xce;}_0x508615[_0xddd1('0x17')](_0xb6c86b);return _0x508615['set'](_0xddd1('0x1e'),_0x47615f+'-'+_0x526d6e+'/'+_0x5b7dcc)[_0xddd1('0x19')](_0x304018);}return null;};}function patchUpdates(_0x1c910f){return function(_0x273a79){try{jsonpatch[_0xddd1('0x1f')](_0x273a79,_0x1c910f,!![]);}catch(_0x3bf1d6){return BPromise[_0xddd1('0x20')](_0x3bf1d6);}return _0x273a79['save']();};}function saveUpdates(_0x346617,_0x178f3c){return function(_0x5cc5e4){if(_0x5cc5e4){return _0x5cc5e4[_0xddd1('0x21')](_0x346617)['then'](function(_0x567dfe){return _0x567dfe;});}return null;};}function removeEntity(_0x20f441,_0x43bb89){return function(_0x5c8e7c){if(_0x5c8e7c){return _0x5c8e7c[_0xddd1('0x22')]()[_0xddd1('0x23')](function(){_0x20f441[_0xddd1('0x17')](0xcc)[_0xddd1('0x18')]();});}};}function handleEntityNotFound(_0x1e1576,_0x17f6ce){return function(_0x2b2264){if(!_0x2b2264){_0x1e1576[_0xddd1('0x24')](0x194);}return _0x2b2264;};}function handleError(_0x1c0343,_0xff7f7a){_0xff7f7a=_0xff7f7a||0x1f4;return function(_0x1a2853){logger[_0xddd1('0x25')](_0x1a2853['stack']);if(_0x1a2853[_0xddd1('0x26')]){delete _0x1a2853[_0xddd1('0x26')];}_0x1c0343['status'](_0xff7f7a)['send'](_0x1a2853);};}exports[_0xddd1('0x27')]=function(_0x1dc639,_0x2df4be){var _0x544922={},_0x2914b8={},_0x296031={'count':0x0,'rows':[]};var _0x4d3301=_['map'](db['Dynamics365Configuration'][_0xddd1('0x28')],function(_0x568a0d){return{'name':_0x568a0d[_0xddd1('0x29')],'type':_0x568a0d[_0xddd1('0x2a')][_0xddd1('0x2b')]};});_0x2914b8['model']=_[_0xddd1('0x2c')](_0x4d3301,_0xddd1('0x26'));_0x2914b8[_0xddd1('0x2d')]=_[_0xddd1('0x2e')](_0x1dc639[_0xddd1('0x2d')]);_0x2914b8[_0xddd1('0x2f')]=_[_0xddd1('0x30')](_0x2914b8['model'],_0x2914b8[_0xddd1('0x2d')]);_0x544922[_0xddd1('0x31')]=_[_0xddd1('0x30')](_0x2914b8[_0xddd1('0x32')],qs[_0xddd1('0x33')](_0x1dc639[_0xddd1('0x2d')][_0xddd1('0x33')]));_0x544922[_0xddd1('0x31')]=_0x544922[_0xddd1('0x31')][_0xddd1('0x34')]?_0x544922['attributes']:_0x2914b8[_0xddd1('0x32')];if(!_0x1dc639[_0xddd1('0x2d')][_0xddd1('0x35')](_0xddd1('0x36'))){_0x544922['limit']=qs[_0xddd1('0x1c')](_0x1dc639['query'][_0xddd1('0x1c')]);_0x544922[_0xddd1('0x1a')]=qs[_0xddd1('0x1a')](_0x1dc639['query'][_0xddd1('0x1a')]);}_0x544922[_0xddd1('0x37')]=qs['sort'](_0x1dc639['query'][_0xddd1('0x38')]);_0x544922['where']=qs[_0xddd1('0x2f')](_[_0xddd1('0x39')](_0x1dc639[_0xddd1('0x2d')],_0x2914b8[_0xddd1('0x2f')]),_0x4d3301);if(_0x1dc639[_0xddd1('0x2d')]['filter']){_0x544922['where']=_[_0xddd1('0x3a')](_0x544922[_0xddd1('0x3b')],{'$or':_['map'](_0x4d3301,function(_0xd2f01f){if(_0xd2f01f[_0xddd1('0x2a')]!==_0xddd1('0x3c')){var _0x4c88ba={};_0x4c88ba[_0xd2f01f[_0xddd1('0x26')]]={'$like':'%'+_0x1dc639[_0xddd1('0x2d')][_0xddd1('0x3d')]+'%'};return _0x4c88ba;}})});}_0x544922=_[_0xddd1('0x3a')]({},_0x544922,_0x1dc639[_0xddd1('0x3e')]);var _0x47953e={'where':_0x544922[_0xddd1('0x3b')]};return db[_0xddd1('0x3f')][_0xddd1('0x1d')](_0x47953e)[_0xddd1('0x23')](function(_0x15d7e2){_0x296031[_0xddd1('0x1d')]=_0x15d7e2;if(_0x1dc639[_0xddd1('0x2d')][_0xddd1('0x40')]){_0x544922[_0xddd1('0x41')]=[{'all':!![]}];}return db[_0xddd1('0x3f')][_0xddd1('0x42')](_0x544922);})['then'](function(_0x23ca36){_0x296031['rows']=_0x23ca36;return _0x296031;})[_0xddd1('0x23')](respondWithFilteredResult(_0x2df4be,_0x544922))['catch'](handleError(_0x2df4be,null));};exports[_0xddd1('0x43')]=function(_0x49c6a5,_0x362b7a){var _0xbc981e={'raw':![],'where':{'id':_0x49c6a5[_0xddd1('0x44')]['id']}},_0x4ef39c={};_0x4ef39c[_0xddd1('0x32')]=_[_0xddd1('0x2e')](db[_0xddd1('0x3f')][_0xddd1('0x28')]);_0x4ef39c[_0xddd1('0x2d')]=_[_0xddd1('0x2e')](_0x49c6a5[_0xddd1('0x2d')]);_0x4ef39c[_0xddd1('0x2f')]=_[_0xddd1('0x30')](_0x4ef39c['model'],_0x4ef39c[_0xddd1('0x2d')]);_0xbc981e[_0xddd1('0x31')]=_[_0xddd1('0x30')](_0x4ef39c[_0xddd1('0x32')],qs[_0xddd1('0x33')](_0x49c6a5[_0xddd1('0x2d')][_0xddd1('0x33')]));_0xbc981e[_0xddd1('0x31')]=_0xbc981e[_0xddd1('0x31')][_0xddd1('0x34')]?_0xbc981e['attributes']:_0x4ef39c['model'];if(_0x49c6a5[_0xddd1('0x2d')][_0xddd1('0x40')]){_0xbc981e[_0xddd1('0x41')]=[{'all':!![]}];}_0xbc981e=_[_0xddd1('0x3a')]({},_0xbc981e,_0x49c6a5['options']);return db[_0xddd1('0x3f')][_0xddd1('0x45')](_0xbc981e)[_0xddd1('0x23')](handleEntityNotFound(_0x362b7a,null))[_0xddd1('0x23')](respondWithResult(_0x362b7a,null))[_0xddd1('0x46')](handleError(_0x362b7a,null));};exports[_0xddd1('0x47')]=function(_0x4c2859,_0x101cc1){return db['Dynamics365Configuration'][_0xddd1('0x47')](_0x4c2859[_0xddd1('0x48')],{})[_0xddd1('0x23')](respondWithResult(_0x101cc1,0xc9))[_0xddd1('0x46')](handleError(_0x101cc1,null));};exports[_0xddd1('0x21')]=function(_0x171e59,_0x22d53c){if(_0x171e59[_0xddd1('0x48')]['id']){delete _0x171e59[_0xddd1('0x48')]['id'];}return db['Dynamics365Configuration'][_0xddd1('0x45')]({'where':{'id':_0x171e59[_0xddd1('0x44')]['id']}})[_0xddd1('0x23')](handleEntityNotFound(_0x22d53c,null))[_0xddd1('0x23')](saveUpdates(_0x171e59['body'],null))['then'](respondWithResult(_0x22d53c,null))[_0xddd1('0x46')](handleError(_0x22d53c,null));};exports[_0xddd1('0x22')]=function(_0x470f06,_0x40a0e8){return db['Dynamics365Configuration']['find']({'where':{'id':_0x470f06[_0xddd1('0x44')]['id']}})['then'](handleEntityNotFound(_0x40a0e8,null))[_0xddd1('0x23')](removeEntity(_0x40a0e8,null))['catch'](handleError(_0x40a0e8,null));};exports[_0xddd1('0x49')]=function(_0x50621f,_0x4b58a4,_0xb02f37){var _0x11afdc={};var _0x42bf81={};var _0x510f14;var _0xc9d8ed;return db[_0xddd1('0x3f')][_0xddd1('0x4a')]({'where':{'id':_0x50621f[_0xddd1('0x44')]['id']}})[_0xddd1('0x23')](handleEntityNotFound(_0x4b58a4,null))[_0xddd1('0x23')](function(_0x26b4dc){if(_0x26b4dc){_0x510f14=_0x26b4dc;_0x42bf81[_0xddd1('0x32')]=_['keys'](db[_0xddd1('0x4b')]['rawAttributes']);_0x42bf81[_0xddd1('0x2d')]=_['keys'](_0x50621f[_0xddd1('0x2d')]);_0x42bf81['filters']=_['intersection'](_0x42bf81[_0xddd1('0x32')],_0x42bf81[_0xddd1('0x2d')]);_0x11afdc[_0xddd1('0x31')]=_[_0xddd1('0x30')](_0x42bf81[_0xddd1('0x32')],qs['fields'](_0x50621f['query']['fields']));_0x11afdc['attributes']=_0x11afdc[_0xddd1('0x31')][_0xddd1('0x34')]?_0x11afdc[_0xddd1('0x31')]:_0x42bf81['model'];_0x11afdc['order']=qs['sort'](_0x50621f['query'][_0xddd1('0x38')]);_0x11afdc[_0xddd1('0x3b')]=qs[_0xddd1('0x2f')](_[_0xddd1('0x39')](_0x50621f[_0xddd1('0x2d')],_0x42bf81['filters']));if(_0x50621f[_0xddd1('0x2d')][_0xddd1('0x3d')]){_0x11afdc[_0xddd1('0x3b')]=_[_0xddd1('0x3a')](_0x11afdc[_0xddd1('0x3b')],{'$or':_[_0xddd1('0x2c')](_0x11afdc[_0xddd1('0x31')],function(_0x126a5){var _0x122bd0={};_0x122bd0[_0x126a5]={'$like':'%'+_0x50621f[_0xddd1('0x2d')][_0xddd1('0x3d')]+'%'};return _0x122bd0;})});}_0x11afdc=_[_0xddd1('0x3a')]({},_0x11afdc,_0x50621f['options']);return _0x510f14[_0xddd1('0x49')](_0x11afdc);}})[_0xddd1('0x23')](function(_0xd17134){if(_0xd17134){_0xc9d8ed=_0xd17134['length'];if(!_0x50621f[_0xddd1('0x2d')][_0xddd1('0x35')](_0xddd1('0x36'))){_0x11afdc[_0xddd1('0x1c')]=qs['limit'](_0x50621f['query']['limit']);_0x11afdc['offset']=qs[_0xddd1('0x1a')](_0x50621f['query'][_0xddd1('0x1a')]);}return _0x510f14[_0xddd1('0x49')](_0x11afdc);}})[_0xddd1('0x23')](function(_0x498a30){if(_0x498a30){return _0x498a30?{'count':_0xc9d8ed,'rows':_0x498a30}:null;}})['then'](respondWithResult(_0x4b58a4,null))[_0xddd1('0x46')](handleError(_0x4b58a4,null));};exports[_0xddd1('0x4c')]=function(_0x3ee029,_0x2ad185,_0x448157){var _0x5a0285={};var _0x47ded2={};var _0x3c0b9e;var _0x4a87d9;return db[_0xddd1('0x3f')]['findOne']({'where':{'id':_0x3ee029['params']['id']}})[_0xddd1('0x23')](handleEntityNotFound(_0x2ad185,null))[_0xddd1('0x23')](function(_0x380176){if(_0x380176){_0x3c0b9e=_0x380176;_0x47ded2[_0xddd1('0x32')]=_[_0xddd1('0x2e')](db[_0xddd1('0x4b')][_0xddd1('0x28')]);_0x47ded2[_0xddd1('0x2d')]=_['keys'](_0x3ee029[_0xddd1('0x2d')]);_0x47ded2[_0xddd1('0x2f')]=_['intersection'](_0x47ded2[_0xddd1('0x32')],_0x47ded2[_0xddd1('0x2d')]);_0x5a0285[_0xddd1('0x31')]=_['intersection'](_0x47ded2['model'],qs[_0xddd1('0x33')](_0x3ee029['query']['fields']));_0x5a0285[_0xddd1('0x31')]=_0x5a0285[_0xddd1('0x31')][_0xddd1('0x34')]?_0x5a0285['attributes']:_0x47ded2[_0xddd1('0x32')];_0x5a0285['order']=qs['sort'](_0x3ee029['query'][_0xddd1('0x38')]);_0x5a0285[_0xddd1('0x3b')]=qs[_0xddd1('0x2f')](_[_0xddd1('0x39')](_0x3ee029[_0xddd1('0x2d')],_0x47ded2['filters']));if(_0x3ee029[_0xddd1('0x2d')][_0xddd1('0x3d')]){_0x5a0285['where']=_['merge'](_0x5a0285[_0xddd1('0x3b')],{'$or':_[_0xddd1('0x2c')](_0x5a0285['attributes'],function(_0x198d03){var _0x550b5c={};_0x550b5c[_0x198d03]={'$like':'%'+_0x3ee029[_0xddd1('0x2d')][_0xddd1('0x3d')]+'%'};return _0x550b5c;})});}_0x5a0285=_[_0xddd1('0x3a')]({},_0x5a0285,_0x3ee029[_0xddd1('0x3e')]);return _0x3c0b9e[_0xddd1('0x4c')](_0x5a0285);}})[_0xddd1('0x23')](function(_0x54c995){if(_0x54c995){_0x4a87d9=_0x54c995['length'];if(!_0x3ee029[_0xddd1('0x2d')][_0xddd1('0x35')]('nolimit')){_0x5a0285[_0xddd1('0x1c')]=qs['limit'](_0x3ee029[_0xddd1('0x2d')][_0xddd1('0x1c')]);_0x5a0285[_0xddd1('0x1a')]=qs[_0xddd1('0x1a')](_0x3ee029[_0xddd1('0x2d')][_0xddd1('0x1a')]);}return _0x3c0b9e['getSubjects'](_0x5a0285);}})[_0xddd1('0x23')](function(_0x5bde70){if(_0x5bde70){return _0x5bde70?{'count':_0x4a87d9,'rows':_0x5bde70}:null;}})[_0xddd1('0x23')](respondWithResult(_0x2ad185,null))[_0xddd1('0x46')](handleError(_0x2ad185,null));};exports[_0xddd1('0x4d')]=function(_0x2bed3f,_0x577023,_0x59b1dc){var _0x33ce15={};var _0x3dbc35={};var _0x518810;var _0x2b621f;return db['Dynamics365Configuration'][_0xddd1('0x4a')]({'where':{'id':_0x2bed3f[_0xddd1('0x44')]['id']}})[_0xddd1('0x23')](handleEntityNotFound(_0x577023,null))[_0xddd1('0x23')](function(_0x3ccc53){if(_0x3ccc53){_0x518810=_0x3ccc53;_0x3dbc35[_0xddd1('0x32')]=_[_0xddd1('0x2e')](db['Dynamics365Field'][_0xddd1('0x28')]);_0x3dbc35['query']=_[_0xddd1('0x2e')](_0x2bed3f[_0xddd1('0x2d')]);_0x3dbc35[_0xddd1('0x2f')]=_['intersection'](_0x3dbc35[_0xddd1('0x32')],_0x3dbc35[_0xddd1('0x2d')]);_0x33ce15[_0xddd1('0x31')]=_[_0xddd1('0x30')](_0x3dbc35['model'],qs[_0xddd1('0x33')](_0x2bed3f[_0xddd1('0x2d')][_0xddd1('0x33')]));_0x33ce15[_0xddd1('0x31')]=_0x33ce15[_0xddd1('0x31')]['length']?_0x33ce15[_0xddd1('0x31')]:_0x3dbc35[_0xddd1('0x32')];_0x33ce15[_0xddd1('0x37')]=qs['sort'](_0x2bed3f[_0xddd1('0x2d')][_0xddd1('0x38')]);_0x33ce15[_0xddd1('0x3b')]=qs[_0xddd1('0x2f')](_[_0xddd1('0x39')](_0x2bed3f[_0xddd1('0x2d')],_0x3dbc35[_0xddd1('0x2f')]));if(_0x2bed3f[_0xddd1('0x2d')][_0xddd1('0x3d')]){_0x33ce15['where']=_[_0xddd1('0x3a')](_0x33ce15['where'],{'$or':_[_0xddd1('0x2c')](_0x33ce15[_0xddd1('0x31')],function(_0x302ae3){var _0x5aeed2={};_0x5aeed2[_0x302ae3]={'$like':'%'+_0x2bed3f[_0xddd1('0x2d')][_0xddd1('0x3d')]+'%'};return _0x5aeed2;})});}_0x33ce15=_[_0xddd1('0x3a')]({},_0x33ce15,_0x2bed3f[_0xddd1('0x3e')]);return _0x518810[_0xddd1('0x4d')](_0x33ce15);}})['then'](function(_0x2a6d27){if(_0x2a6d27){_0x2b621f=_0x2a6d27[_0xddd1('0x34')];if(!_0x2bed3f[_0xddd1('0x2d')][_0xddd1('0x35')]('nolimit')){_0x33ce15[_0xddd1('0x1c')]=qs['limit'](_0x2bed3f[_0xddd1('0x2d')]['limit']);_0x33ce15[_0xddd1('0x1a')]=qs[_0xddd1('0x1a')](_0x2bed3f['query'][_0xddd1('0x1a')]);}return _0x518810[_0xddd1('0x4d')](_0x33ce15);}})[_0xddd1('0x23')](function(_0x5acd00){if(_0x5acd00){return _0x5acd00?{'count':_0x2b621f,'rows':_0x5acd00}:null;}})[_0xddd1('0x23')](respondWithResult(_0x577023,null))[_0xddd1('0x46')](handleError(_0x577023,null));}; \ No newline at end of file +var _0x2ca3=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','reject','save','then','end','sendStatus','stack','name','send','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','destroy','getFields','map','getSubjects','findOne','Dynamics365Field','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x25ed81,_0x4fd82f){var _0x321e46=function(_0x3f35f9){while(--_0x3f35f9){_0x25ed81['push'](_0x25ed81['shift']());}};_0x321e46(++_0x4fd82f);}(_0x2ca3,0x136));var _0x32ca=function(_0x10cc44,_0x38cc4b){_0x10cc44=_0x10cc44-0x0;var _0x4607fd=_0x2ca3[_0x10cc44];return _0x4607fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32ca('0x0'));var zipdir=require(_0x32ca('0x1'));var jsonpatch=require(_0x32ca('0x2'));var rp=require(_0x32ca('0x3'));var moment=require(_0x32ca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x32ca('0x5'));var util=require(_0x32ca('0x6'));var path=require(_0x32ca('0x7'));var sox=require(_0x32ca('0x8'));var csv=require(_0x32ca('0x9'));var ejs=require(_0x32ca('0xa'));var fs=require('fs');var fs_extra=require(_0x32ca('0xb'));var _=require(_0x32ca('0xc'));var squel=require(_0x32ca('0xd'));var crypto=require(_0x32ca('0xe'));var jsforce=require(_0x32ca('0xf'));var deskjs=require(_0x32ca('0x10'));var toCsv=require(_0x32ca('0x9'));var querystring=require(_0x32ca('0x11'));var Papa=require(_0x32ca('0x12'));var Redis=require(_0x32ca('0x13'));var authService=require(_0x32ca('0x14'));var qs=require(_0x32ca('0x15'));var as=require(_0x32ca('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ca('0x17'))(_0x32ca('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x32ca('0x19'));var db=require(_0x32ca('0x1a'))['db'];function respondWithStatusCode(_0x15682f,_0x190598){_0x190598=_0x190598||0xcc;return function(_0xf4deae){if(_0xf4deae){return _0x15682f['sendStatus'](_0x190598);}return _0x15682f[_0x32ca('0x1b')](_0x190598)['end']();};}function respondWithResult(_0xccbab3,_0x18f1c1){_0x18f1c1=_0x18f1c1||0xc8;return function(_0x78a85b){if(_0x78a85b){return _0xccbab3[_0x32ca('0x1b')](_0x18f1c1)[_0x32ca('0x1c')](_0x78a85b);}};}function respondWithFilteredResult(_0x16a2dc,_0xd842e9){return function(_0x5ad758){if(_0x5ad758){var _0xf8cbb1=typeof _0xd842e9['offset']===_0x32ca('0x1d')&&typeof _0xd842e9[_0x32ca('0x1e')]===_0x32ca('0x1d');var _0x2fae7f=_0x5ad758[_0x32ca('0x1f')];var _0x567c97=_0xf8cbb1?0x0:_0xd842e9[_0x32ca('0x20')];var _0xcaac1b=_0xf8cbb1?_0x5ad758['count']:_0xd842e9['offset']+_0xd842e9[_0x32ca('0x1e')];var _0x469427;if(_0xcaac1b>=_0x2fae7f){_0xcaac1b=_0x2fae7f;_0x469427=0xc8;}else{_0x469427=0xce;}_0x16a2dc['status'](_0x469427);return _0x16a2dc[_0x32ca('0x21')]('Content-Range',_0x567c97+'-'+_0xcaac1b+'/'+_0x2fae7f)[_0x32ca('0x1c')](_0x5ad758);}return null;};}function patchUpdates(_0x206d63){return function(_0x3c1c6d){try{jsonpatch['apply'](_0x3c1c6d,_0x206d63,!![]);}catch(_0x5bd843){return BPromise[_0x32ca('0x22')](_0x5bd843);}return _0x3c1c6d[_0x32ca('0x23')]();};}function saveUpdates(_0x1073fe,_0x5a1b0f){return function(_0x3fbe5f){if(_0x3fbe5f){return _0x3fbe5f['update'](_0x1073fe)['then'](function(_0x264e53){return _0x264e53;});}return null;};}function removeEntity(_0x230b04,_0xb1e6fe){return function(_0x14b94f){if(_0x14b94f){return _0x14b94f['destroy']()[_0x32ca('0x24')](function(){_0x230b04['status'](0xcc)[_0x32ca('0x25')]();});}};}function handleEntityNotFound(_0x28b1cf,_0x307610){return function(_0x1fb136){if(!_0x1fb136){_0x28b1cf[_0x32ca('0x26')](0x194);}return _0x1fb136;};}function handleError(_0x52be12,_0x53c6a8){_0x53c6a8=_0x53c6a8||0x1f4;return function(_0x57e6be){logger['error'](_0x57e6be[_0x32ca('0x27')]);if(_0x57e6be[_0x32ca('0x28')]){delete _0x57e6be[_0x32ca('0x28')];}_0x52be12[_0x32ca('0x1b')](_0x53c6a8)[_0x32ca('0x29')](_0x57e6be);};}exports['index']=function(_0x4060b9,_0x45feb1){var _0x35b535={},_0x325172={},_0x1f7796={'count':0x0,'rows':[]};var _0x50cbed=_['map'](db[_0x32ca('0x2a')][_0x32ca('0x2b')],function(_0x47ab86){return{'name':_0x47ab86[_0x32ca('0x2c')],'type':_0x47ab86[_0x32ca('0x2d')][_0x32ca('0x2e')]};});_0x325172[_0x32ca('0x2f')]=_['map'](_0x50cbed,'name');_0x325172['query']=_[_0x32ca('0x30')](_0x4060b9['query']);_0x325172[_0x32ca('0x31')]=_[_0x32ca('0x32')](_0x325172[_0x32ca('0x2f')],_0x325172[_0x32ca('0x33')]);_0x35b535[_0x32ca('0x34')]=_[_0x32ca('0x32')](_0x325172['model'],qs[_0x32ca('0x35')](_0x4060b9[_0x32ca('0x33')][_0x32ca('0x35')]));_0x35b535[_0x32ca('0x34')]=_0x35b535[_0x32ca('0x34')]['length']?_0x35b535['attributes']:_0x325172['model'];if(!_0x4060b9[_0x32ca('0x33')][_0x32ca('0x36')](_0x32ca('0x37'))){_0x35b535[_0x32ca('0x1e')]=qs[_0x32ca('0x1e')](_0x4060b9[_0x32ca('0x33')][_0x32ca('0x1e')]);_0x35b535[_0x32ca('0x20')]=qs[_0x32ca('0x20')](_0x4060b9[_0x32ca('0x33')][_0x32ca('0x20')]);}_0x35b535[_0x32ca('0x38')]=qs[_0x32ca('0x39')](_0x4060b9[_0x32ca('0x33')][_0x32ca('0x39')]);_0x35b535[_0x32ca('0x3a')]=qs[_0x32ca('0x31')](_[_0x32ca('0x3b')](_0x4060b9[_0x32ca('0x33')],_0x325172[_0x32ca('0x31')]),_0x50cbed);if(_0x4060b9[_0x32ca('0x33')][_0x32ca('0x3c')]){_0x35b535[_0x32ca('0x3a')]=_[_0x32ca('0x3d')](_0x35b535[_0x32ca('0x3a')],{'$or':_['map'](_0x50cbed,function(_0x1686e8){if(_0x1686e8[_0x32ca('0x2d')]!=='VIRTUAL'){var _0x34e714={};_0x34e714[_0x1686e8[_0x32ca('0x28')]]={'$like':'%'+_0x4060b9[_0x32ca('0x33')][_0x32ca('0x3c')]+'%'};return _0x34e714;}})});}_0x35b535=_[_0x32ca('0x3d')]({},_0x35b535,_0x4060b9['options']);var _0x592890={'where':_0x35b535[_0x32ca('0x3a')]};return db[_0x32ca('0x2a')][_0x32ca('0x1f')](_0x592890)['then'](function(_0x5848ad){_0x1f7796[_0x32ca('0x1f')]=_0x5848ad;if(_0x4060b9[_0x32ca('0x33')][_0x32ca('0x3e')]){_0x35b535[_0x32ca('0x3f')]=[{'all':!![]}];}return db[_0x32ca('0x2a')][_0x32ca('0x40')](_0x35b535);})[_0x32ca('0x24')](function(_0x5c7de6){_0x1f7796[_0x32ca('0x41')]=_0x5c7de6;return _0x1f7796;})['then'](respondWithFilteredResult(_0x45feb1,_0x35b535))[_0x32ca('0x42')](handleError(_0x45feb1,null));};exports['show']=function(_0x246bb7,_0x39751d){var _0x2c52fd={'raw':![],'where':{'id':_0x246bb7[_0x32ca('0x43')]['id']}},_0x191bac={};_0x191bac[_0x32ca('0x2f')]=_[_0x32ca('0x30')](db[_0x32ca('0x2a')][_0x32ca('0x2b')]);_0x191bac[_0x32ca('0x33')]=_[_0x32ca('0x30')](_0x246bb7[_0x32ca('0x33')]);_0x191bac['filters']=_[_0x32ca('0x32')](_0x191bac[_0x32ca('0x2f')],_0x191bac[_0x32ca('0x33')]);_0x2c52fd[_0x32ca('0x34')]=_['intersection'](_0x191bac[_0x32ca('0x2f')],qs[_0x32ca('0x35')](_0x246bb7[_0x32ca('0x33')][_0x32ca('0x35')]));_0x2c52fd['attributes']=_0x2c52fd[_0x32ca('0x34')][_0x32ca('0x44')]?_0x2c52fd[_0x32ca('0x34')]:_0x191bac[_0x32ca('0x2f')];if(_0x246bb7[_0x32ca('0x33')][_0x32ca('0x3e')]){_0x2c52fd[_0x32ca('0x3f')]=[{'all':!![]}];}_0x2c52fd=_[_0x32ca('0x3d')]({},_0x2c52fd,_0x246bb7[_0x32ca('0x45')]);return db[_0x32ca('0x2a')][_0x32ca('0x46')](_0x2c52fd)[_0x32ca('0x24')](handleEntityNotFound(_0x39751d,null))[_0x32ca('0x24')](respondWithResult(_0x39751d,null))[_0x32ca('0x42')](handleError(_0x39751d,null));};exports['create']=function(_0x1298c8,_0x9f8daf){return db[_0x32ca('0x2a')][_0x32ca('0x47')](_0x1298c8[_0x32ca('0x48')],{})[_0x32ca('0x24')](respondWithResult(_0x9f8daf,0xc9))[_0x32ca('0x42')](handleError(_0x9f8daf,null));};exports['update']=function(_0x27cb3c,_0x4fa297){if(_0x27cb3c[_0x32ca('0x48')]['id']){delete _0x27cb3c[_0x32ca('0x48')]['id'];}return db['Dynamics365Configuration'][_0x32ca('0x46')]({'where':{'id':_0x27cb3c['params']['id']}})[_0x32ca('0x24')](handleEntityNotFound(_0x4fa297,null))[_0x32ca('0x24')](saveUpdates(_0x27cb3c['body'],null))['then'](respondWithResult(_0x4fa297,null))[_0x32ca('0x42')](handleError(_0x4fa297,null));};exports[_0x32ca('0x49')]=function(_0x26c65a,_0x5536dc){return db[_0x32ca('0x2a')][_0x32ca('0x46')]({'where':{'id':_0x26c65a['params']['id']}})[_0x32ca('0x24')](handleEntityNotFound(_0x5536dc,null))[_0x32ca('0x24')](removeEntity(_0x5536dc,null))[_0x32ca('0x42')](handleError(_0x5536dc,null));};exports[_0x32ca('0x4a')]=function(_0x426d46,_0xc2d580,_0x2a5cde){var _0x2b8ab6={};var _0x1f2d48={};var _0xb50379;var _0xa2d493;return db[_0x32ca('0x2a')]['findOne']({'where':{'id':_0x426d46['params']['id']}})[_0x32ca('0x24')](handleEntityNotFound(_0xc2d580,null))[_0x32ca('0x24')](function(_0x5bfbc3){if(_0x5bfbc3){_0xb50379=_0x5bfbc3;_0x1f2d48['model']=_[_0x32ca('0x30')](db['Dynamics365Field'][_0x32ca('0x2b')]);_0x1f2d48[_0x32ca('0x33')]=_['keys'](_0x426d46[_0x32ca('0x33')]);_0x1f2d48[_0x32ca('0x31')]=_[_0x32ca('0x32')](_0x1f2d48[_0x32ca('0x2f')],_0x1f2d48[_0x32ca('0x33')]);_0x2b8ab6[_0x32ca('0x34')]=_[_0x32ca('0x32')](_0x1f2d48[_0x32ca('0x2f')],qs['fields'](_0x426d46[_0x32ca('0x33')][_0x32ca('0x35')]));_0x2b8ab6['attributes']=_0x2b8ab6[_0x32ca('0x34')][_0x32ca('0x44')]?_0x2b8ab6['attributes']:_0x1f2d48[_0x32ca('0x2f')];_0x2b8ab6['order']=qs[_0x32ca('0x39')](_0x426d46['query']['sort']);_0x2b8ab6[_0x32ca('0x3a')]=qs[_0x32ca('0x31')](_['pick'](_0x426d46[_0x32ca('0x33')],_0x1f2d48[_0x32ca('0x31')]));if(_0x426d46['query'][_0x32ca('0x3c')]){_0x2b8ab6[_0x32ca('0x3a')]=_[_0x32ca('0x3d')](_0x2b8ab6[_0x32ca('0x3a')],{'$or':_[_0x32ca('0x4b')](_0x2b8ab6[_0x32ca('0x34')],function(_0xb27580){var _0xd9db7f={};_0xd9db7f[_0xb27580]={'$like':'%'+_0x426d46['query']['filter']+'%'};return _0xd9db7f;})});}_0x2b8ab6=_[_0x32ca('0x3d')]({},_0x2b8ab6,_0x426d46[_0x32ca('0x45')]);return _0xb50379['getFields'](_0x2b8ab6);}})[_0x32ca('0x24')](function(_0x427aca){if(_0x427aca){_0xa2d493=_0x427aca[_0x32ca('0x44')];if(!_0x426d46['query']['hasOwnProperty'](_0x32ca('0x37'))){_0x2b8ab6[_0x32ca('0x1e')]=qs[_0x32ca('0x1e')](_0x426d46[_0x32ca('0x33')][_0x32ca('0x1e')]);_0x2b8ab6[_0x32ca('0x20')]=qs['offset'](_0x426d46[_0x32ca('0x33')][_0x32ca('0x20')]);}return _0xb50379[_0x32ca('0x4a')](_0x2b8ab6);}})['then'](function(_0x13beca){if(_0x13beca){return _0x13beca?{'count':_0xa2d493,'rows':_0x13beca}:null;}})[_0x32ca('0x24')](respondWithResult(_0xc2d580,null))[_0x32ca('0x42')](handleError(_0xc2d580,null));};exports[_0x32ca('0x4c')]=function(_0x3c96cb,_0x47d354,_0x381f1f){var _0x269fa3={};var _0x1a0fdb={};var _0x533c05;var _0x5a384f;return db[_0x32ca('0x2a')][_0x32ca('0x4d')]({'where':{'id':_0x3c96cb['params']['id']}})['then'](handleEntityNotFound(_0x47d354,null))[_0x32ca('0x24')](function(_0x45e1d1){if(_0x45e1d1){_0x533c05=_0x45e1d1;_0x1a0fdb[_0x32ca('0x2f')]=_[_0x32ca('0x30')](db[_0x32ca('0x4e')][_0x32ca('0x2b')]);_0x1a0fdb[_0x32ca('0x33')]=_[_0x32ca('0x30')](_0x3c96cb[_0x32ca('0x33')]);_0x1a0fdb[_0x32ca('0x31')]=_['intersection'](_0x1a0fdb['model'],_0x1a0fdb[_0x32ca('0x33')]);_0x269fa3[_0x32ca('0x34')]=_[_0x32ca('0x32')](_0x1a0fdb[_0x32ca('0x2f')],qs[_0x32ca('0x35')](_0x3c96cb[_0x32ca('0x33')]['fields']));_0x269fa3[_0x32ca('0x34')]=_0x269fa3[_0x32ca('0x34')]['length']?_0x269fa3[_0x32ca('0x34')]:_0x1a0fdb['model'];_0x269fa3[_0x32ca('0x38')]=qs[_0x32ca('0x39')](_0x3c96cb[_0x32ca('0x33')][_0x32ca('0x39')]);_0x269fa3[_0x32ca('0x3a')]=qs['filters'](_[_0x32ca('0x3b')](_0x3c96cb[_0x32ca('0x33')],_0x1a0fdb['filters']));if(_0x3c96cb[_0x32ca('0x33')][_0x32ca('0x3c')]){_0x269fa3[_0x32ca('0x3a')]=_[_0x32ca('0x3d')](_0x269fa3['where'],{'$or':_[_0x32ca('0x4b')](_0x269fa3[_0x32ca('0x34')],function(_0x2b0fa8){var _0x5cba9e={};_0x5cba9e[_0x2b0fa8]={'$like':'%'+_0x3c96cb[_0x32ca('0x33')][_0x32ca('0x3c')]+'%'};return _0x5cba9e;})});}_0x269fa3=_[_0x32ca('0x3d')]({},_0x269fa3,_0x3c96cb[_0x32ca('0x45')]);return _0x533c05[_0x32ca('0x4c')](_0x269fa3);}})['then'](function(_0x33e8e3){if(_0x33e8e3){_0x5a384f=_0x33e8e3[_0x32ca('0x44')];if(!_0x3c96cb[_0x32ca('0x33')][_0x32ca('0x36')](_0x32ca('0x37'))){_0x269fa3['limit']=qs[_0x32ca('0x1e')](_0x3c96cb[_0x32ca('0x33')][_0x32ca('0x1e')]);_0x269fa3['offset']=qs[_0x32ca('0x20')](_0x3c96cb[_0x32ca('0x33')][_0x32ca('0x20')]);}return _0x533c05[_0x32ca('0x4c')](_0x269fa3);}})['then'](function(_0xfd1ef1){if(_0xfd1ef1){return _0xfd1ef1?{'count':_0x5a384f,'rows':_0xfd1ef1}:null;}})['then'](respondWithResult(_0x47d354,null))[_0x32ca('0x42')](handleError(_0x47d354,null));};exports[_0x32ca('0x4f')]=function(_0xa053af,_0x448118,_0x39e30d){var _0x1457d2={};var _0x3a7103={};var _0x10a9dc;var _0x21f86c;return db[_0x32ca('0x2a')][_0x32ca('0x4d')]({'where':{'id':_0xa053af['params']['id']}})[_0x32ca('0x24')](handleEntityNotFound(_0x448118,null))[_0x32ca('0x24')](function(_0xd9620e){if(_0xd9620e){_0x10a9dc=_0xd9620e;_0x3a7103[_0x32ca('0x2f')]=_[_0x32ca('0x30')](db['Dynamics365Field'][_0x32ca('0x2b')]);_0x3a7103[_0x32ca('0x33')]=_['keys'](_0xa053af[_0x32ca('0x33')]);_0x3a7103[_0x32ca('0x31')]=_[_0x32ca('0x32')](_0x3a7103['model'],_0x3a7103[_0x32ca('0x33')]);_0x1457d2['attributes']=_['intersection'](_0x3a7103[_0x32ca('0x2f')],qs['fields'](_0xa053af[_0x32ca('0x33')][_0x32ca('0x35')]));_0x1457d2[_0x32ca('0x34')]=_0x1457d2[_0x32ca('0x34')][_0x32ca('0x44')]?_0x1457d2[_0x32ca('0x34')]:_0x3a7103['model'];_0x1457d2['order']=qs[_0x32ca('0x39')](_0xa053af[_0x32ca('0x33')]['sort']);_0x1457d2[_0x32ca('0x3a')]=qs['filters'](_[_0x32ca('0x3b')](_0xa053af[_0x32ca('0x33')],_0x3a7103[_0x32ca('0x31')]));if(_0xa053af[_0x32ca('0x33')]['filter']){_0x1457d2[_0x32ca('0x3a')]=_['merge'](_0x1457d2[_0x32ca('0x3a')],{'$or':_[_0x32ca('0x4b')](_0x1457d2['attributes'],function(_0x4a5b50){var _0x1b9fb2={};_0x1b9fb2[_0x4a5b50]={'$like':'%'+_0xa053af[_0x32ca('0x33')][_0x32ca('0x3c')]+'%'};return _0x1b9fb2;})});}_0x1457d2=_[_0x32ca('0x3d')]({},_0x1457d2,_0xa053af[_0x32ca('0x45')]);return _0x10a9dc[_0x32ca('0x4f')](_0x1457d2);}})['then'](function(_0x1b221e){if(_0x1b221e){_0x21f86c=_0x1b221e[_0x32ca('0x44')];if(!_0xa053af[_0x32ca('0x33')][_0x32ca('0x36')](_0x32ca('0x37'))){_0x1457d2[_0x32ca('0x1e')]=qs[_0x32ca('0x1e')](_0xa053af['query']['limit']);_0x1457d2[_0x32ca('0x20')]=qs[_0x32ca('0x20')](_0xa053af[_0x32ca('0x33')][_0x32ca('0x20')]);}return _0x10a9dc['getDescriptions'](_0x1457d2);}})[_0x32ca('0x24')](function(_0x355ff2){if(_0x355ff2){return _0x355ff2?{'count':_0x21f86c,'rows':_0x355ff2}:null;}})[_0x32ca('0x24')](respondWithResult(_0x448118,null))[_0x32ca('0x42')](handleError(_0x448118,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index cb44fe1..a0be065 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 _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x4b84[_0x48c615];return _0x3d9e22;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x225d53,_0x11b531){var _0x2fb289=function(_0x9e4e15){while(--_0x9e4e15){_0x225d53['push'](_0x225d53['shift']());}};_0x2fb289(++_0x11b531);}(_0x5b02,0xe9));var _0x25b0=function(_0x5f0b24,_0x5d9775){_0x5f0b24=_0x5f0b24-0x0;var _0x4e8807=_0x5b02[_0x5f0b24];return _0x4e8807;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','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 b469afb..cbc6f17 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 _0x3f28=['rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f28,0x19f));var _0x83f2=function(_0x4c0cc6,_0x12de3b){_0x4c0cc6=_0x4c0cc6-0x0;var _0x403708=_0x3f28[_0x4c0cc6];return _0x403708;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83f2('0x0'));var BPromise=require(_0x83f2('0x1'));var rs=require(_0x83f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83f2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x83f2('0x4'))(_0x83f2('0x5'));var config=require(_0x83f2('0x6'));var jayson=require(_0x83f2('0x7'));var client=jayson[_0x83f2('0x8')][_0x83f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6c197c,_0x5cb34a,_0x5d9331){return new BPromise(function(_0x404c00,_0x314a24){return client['request'](_0x6c197c,_0x5d9331)[_0x83f2('0xa')](function(_0x5b8121){logger['info'](_0x83f2('0xb'),_0x5cb34a,'request\x20sent');logger[_0x83f2('0xc')](_0x83f2('0xd'),_0x5cb34a,_0x83f2('0xe'),JSON['stringify'](_0x5b8121));if(_0x5b8121[_0x83f2('0xf')]){if(_0x5b8121[_0x83f2('0xf')][_0x83f2('0x10')]===0x1f4){logger[_0x83f2('0xf')](_0x83f2('0xb'),_0x5cb34a,_0x5b8121[_0x83f2('0xf')][_0x83f2('0x11')]);return _0x314a24(_0x5b8121['error'][_0x83f2('0x11')]);}logger[_0x83f2('0xf')](_0x83f2('0xb'),_0x5cb34a,_0x5b8121[_0x83f2('0xf')][_0x83f2('0x11')]);return _0x404c00(_0x5b8121[_0x83f2('0xf')][_0x83f2('0x11')]);}else{logger[_0x83f2('0x12')](_0x83f2('0xb'),_0x5cb34a,_0x83f2('0xe'));_0x404c00(_0x5b8121[_0x83f2('0x13')][_0x83f2('0x11')]);}})[_0x83f2('0x14')](function(_0x2ea0d7){logger[_0x83f2('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5cb34a,_0x2ea0d7);_0x314a24(_0x2ea0d7);});});} \ No newline at end of file +var _0x5fc3=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2f4de8,_0x313395){var _0x4569cb=function(_0x17572f){while(--_0x17572f){_0x2f4de8['push'](_0x2f4de8['shift']());}};_0x4569cb(++_0x313395);}(_0x5fc3,0x193));var _0x35fc=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x5fc3[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require(_0x35fc('0x2'));var BPromise=require(_0x35fc('0x3'));var rs=require(_0x35fc('0x4'));var fs=require('fs');var Redis=require(_0x35fc('0x5'));var db=require(_0x35fc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x35fc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x35fc('0x8'));var client=jayson[_0x35fc('0x9')][_0x35fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x244282,_0x5862cc,_0x814a67){return new BPromise(function(_0x3a94f5,_0x1a0e2d){return client[_0x35fc('0xb')](_0x244282,_0x814a67)[_0x35fc('0xc')](function(_0x5d70f4){logger[_0x35fc('0xd')](_0x35fc('0xe'),_0x5862cc,_0x35fc('0xf'));logger[_0x35fc('0x10')](_0x35fc('0x11'),_0x5862cc,_0x35fc('0xf'),JSON[_0x35fc('0x12')](_0x5d70f4));if(_0x5d70f4[_0x35fc('0x13')]){if(_0x5d70f4[_0x35fc('0x13')][_0x35fc('0x14')]===0x1f4){logger['error'](_0x35fc('0xe'),_0x5862cc,_0x5d70f4[_0x35fc('0x13')][_0x35fc('0x15')]);return _0x1a0e2d(_0x5d70f4[_0x35fc('0x13')]['message']);}logger[_0x35fc('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5862cc,_0x5d70f4[_0x35fc('0x13')][_0x35fc('0x15')]);return _0x3a94f5(_0x5d70f4['error'][_0x35fc('0x15')]);}else{logger['info'](_0x35fc('0xe'),_0x5862cc,_0x35fc('0xf'));_0x3a94f5(_0x5d70f4[_0x35fc('0x16')][_0x35fc('0x15')]);}})[_0x35fc('0x17')](function(_0x6b69e5){logger[_0x35fc('0x13')](_0x35fc('0xe'),_0x5862cc,_0x6b69e5);_0x1a0e2d(_0x6b69e5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index fbbb37e..47cd13e 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 _0x87c0=['put','update','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','show','post','create'];(function(_0x4a7756,_0x97b450){var _0x26b489=function(_0x1147e9){while(--_0x1147e9){_0x4a7756['push'](_0x4a7756['shift']());}};_0x26b489(++_0x97b450);}(_0x87c0,0x1ad));var _0x087c=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x87c0[_0x19dd7a];return _0x3feb6a;};'use strict';var multer=require(_0x087c('0x0'));var util=require('util');var path=require(_0x087c('0x1'));var timeout=require(_0x087c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x087c('0x3'));var auth=require(_0x087c('0x4'));var interaction=require(_0x087c('0x5'));var config=require(_0x087c('0x6'));var controller=require(_0x087c('0x7'));router[_0x087c('0x8')]('/',auth[_0x087c('0x9')](),controller['index']);router[_0x087c('0x8')]('/:id',auth[_0x087c('0x9')](),controller[_0x087c('0xa')]);router[_0x087c('0xb')]('/',auth['isAuthenticated'](),controller[_0x087c('0xc')]);router[_0x087c('0xd')]('/:id',auth[_0x087c('0x9')](),controller[_0x087c('0xe')]);router[_0x087c('0xf')]('/:id',auth[_0x087c('0x9')](),controller['destroy']);module[_0x087c('0x10')]=router; \ No newline at end of file +var _0x27e2=['express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x29e39f,_0x434de4){var _0x4529c5=function(_0x196529){while(--_0x196529){_0x29e39f['push'](_0x29e39f['shift']());}};_0x4529c5(++_0x434de4);}(_0x27e2,0x189));var _0x227e=function(_0x547383,_0x5e69ca){_0x547383=_0x547383-0x0;var _0x3a535a=_0x27e2[_0x547383];return _0x3a535a;};'use strict';var multer=require(_0x227e('0x0'));var util=require('util');var path=require(_0x227e('0x1'));var timeout=require(_0x227e('0x2'));var express=require(_0x227e('0x3'));var router=express[_0x227e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x227e('0x5'));var interaction=require(_0x227e('0x6'));var config=require('../../config/environment');var controller=require(_0x227e('0x7'));router[_0x227e('0x8')]('/',auth[_0x227e('0x9')](),controller['index']);router['get'](_0x227e('0xa'),auth[_0x227e('0x9')](),controller[_0x227e('0xb')]);router[_0x227e('0xc')]('/',auth[_0x227e('0x9')](),controller[_0x227e('0xd')]);router[_0x227e('0xe')](_0x227e('0xa'),auth[_0x227e('0x9')](),controller[_0x227e('0xf')]);router['delete'](_0x227e('0xa'),auth[_0x227e('0x9')](),controller[_0x227e('0x10')]);module[_0x227e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index a523309..334a846 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 _0x1a9d=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x3d7257,_0x33d9c8){var _0x503739=function(_0x457f2a){while(--_0x457f2a){_0x3d7257['push'](_0x3d7257['shift']());}};_0x503739(++_0x33d9c8);}(_0x1a9d,0x1f1));var _0xd1a9=function(_0x5343d7,_0x2cb5e8){_0x5343d7=_0x5343d7-0x0;var _0x1fbb24=_0x1a9d[_0x5343d7];return _0x1fbb24;};'use strict';var Sequelize=require(_0xd1a9('0x0'));module[_0xd1a9('0x1')]={'type':{'type':Sequelize[_0xd1a9('0x2')](_0xd1a9('0x3'),_0xd1a9('0x4'),_0xd1a9('0x5'),'keyValue',_0xd1a9('0x6')),'defaultValue':_0xd1a9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd1a9('0x7')]},'keyType':{'type':Sequelize[_0xd1a9('0x2')](_0xd1a9('0x3'),_0xd1a9('0x4'),_0xd1a9('0x5'))},'keyContent':{'type':Sequelize[_0xd1a9('0x7')]},'idField':{'type':Sequelize[_0xd1a9('0x7')]},'nameField':{'type':Sequelize[_0xd1a9('0x7')]},'customField':{'type':Sequelize[_0xd1a9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3fc5=['BOOLEAN','sequelize','exports','string','variable','picklist','customVariable','STRING'];(function(_0x468fa8,_0xaccf06){var _0x486ec9=function(_0x44de27){while(--_0x44de27){_0x468fa8['push'](_0x468fa8['shift']());}};_0x486ec9(++_0xaccf06);}(_0x3fc5,0x121));var _0x53fc=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3fc5[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x53fc('0x0'));module[_0x53fc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x53fc('0x2'),_0x53fc('0x3'),'customVariable','keyValue',_0x53fc('0x4')),'defaultValue':_0x53fc('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x53fc('0x2'),_0x53fc('0x3'),_0x53fc('0x5'))},'keyContent':{'type':Sequelize[_0x53fc('0x6')]},'idField':{'type':Sequelize[_0x53fc('0x6')]},'nameField':{'type':Sequelize[_0x53fc('0x6')]},'customField':{'type':Sequelize[_0x53fc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x53fc('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 05763a3..8ecfabf 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 _0x2f11=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x213b74,_0x46786a){var _0x31a624=function(_0x1d7b7e){while(--_0x1d7b7e){_0x213b74['push'](_0x213b74['shift']());}};_0x31a624(++_0x46786a);}(_0x2f11,0x16b));var _0x12f1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2f11[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x12f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12f1('0x2'));var moment=require(_0x12f1('0x3'));var BPromise=require(_0x12f1('0x4'));var Mustache=require(_0x12f1('0x5'));var util=require(_0x12f1('0x6'));var path=require('path');var sox=require(_0x12f1('0x7'));var csv=require(_0x12f1('0x8'));var ejs=require(_0x12f1('0x9'));var fs=require('fs');var fs_extra=require(_0x12f1('0xa'));var _=require(_0x12f1('0xb'));var squel=require(_0x12f1('0xc'));var crypto=require('crypto');var jsforce=require(_0x12f1('0xd'));var deskjs=require(_0x12f1('0xe'));var toCsv=require(_0x12f1('0x8'));var querystring=require(_0x12f1('0xf'));var Papa=require(_0x12f1('0x10'));var Redis=require(_0x12f1('0x11'));var authService=require(_0x12f1('0x12'));var qs=require(_0x12f1('0x13'));var as=require(_0x12f1('0x14'));var hardwareService=require(_0x12f1('0x15'));var logger=require(_0x12f1('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x12f1('0x17'));var licenseUtil=require(_0x12f1('0x18'));var db=require(_0x12f1('0x19'))['db'];function respondWithStatusCode(_0x314110,_0x7786af){_0x7786af=_0x7786af||0xcc;return function(_0x305204){if(_0x305204){return _0x314110['sendStatus'](_0x7786af);}return _0x314110[_0x12f1('0x1a')](_0x7786af)[_0x12f1('0x1b')]();};}function respondWithResult(_0x475112,_0xdf6c1a){_0xdf6c1a=_0xdf6c1a||0xc8;return function(_0x4d6e6f){if(_0x4d6e6f){return _0x475112[_0x12f1('0x1a')](_0xdf6c1a)['json'](_0x4d6e6f);}};}function respondWithFilteredResult(_0x5cbd42,_0x102079){return function(_0x516eb1){if(_0x516eb1){var _0x2c17c5=typeof _0x102079[_0x12f1('0x1c')]===_0x12f1('0x1d')&&typeof _0x102079[_0x12f1('0x1e')]===_0x12f1('0x1d');var _0x425495=_0x516eb1[_0x12f1('0x1f')];var _0x511478=_0x2c17c5?0x0:_0x102079[_0x12f1('0x1c')];var _0x525a87=_0x2c17c5?_0x516eb1[_0x12f1('0x1f')]:_0x102079[_0x12f1('0x1c')]+_0x102079[_0x12f1('0x1e')];var _0x4ee7a3;if(_0x525a87>=_0x425495){_0x525a87=_0x425495;_0x4ee7a3=0xc8;}else{_0x4ee7a3=0xce;}_0x5cbd42['status'](_0x4ee7a3);return _0x5cbd42[_0x12f1('0x20')](_0x12f1('0x21'),_0x511478+'-'+_0x525a87+'/'+_0x425495)[_0x12f1('0x22')](_0x516eb1);}return null;};}function patchUpdates(_0x271544){return function(_0x189392){try{jsonpatch[_0x12f1('0x23')](_0x189392,_0x271544,!![]);}catch(_0x7422c6){return BPromise['reject'](_0x7422c6);}return _0x189392['save']();};}function saveUpdates(_0x58cf68,_0x287f46){return function(_0x1fd1c9){if(_0x1fd1c9){return _0x1fd1c9[_0x12f1('0x24')](_0x58cf68)[_0x12f1('0x25')](function(_0x495454){return _0x495454;});}return null;};}function removeEntity(_0x3342dd,_0x742df9){return function(_0x461067){if(_0x461067){return _0x461067[_0x12f1('0x26')]()[_0x12f1('0x25')](function(){_0x3342dd[_0x12f1('0x1a')](0xcc)[_0x12f1('0x1b')]();});}};}function handleEntityNotFound(_0x4a2e42,_0x377aed){return function(_0x178c60){if(!_0x178c60){_0x4a2e42['sendStatus'](0x194);}return _0x178c60;};}function handleError(_0x778e83,_0x56201e){_0x56201e=_0x56201e||0x1f4;return function(_0x28ef5a){logger[_0x12f1('0x27')](_0x28ef5a[_0x12f1('0x28')]);if(_0x28ef5a[_0x12f1('0x29')]){delete _0x28ef5a[_0x12f1('0x29')];}_0x778e83[_0x12f1('0x1a')](_0x56201e)[_0x12f1('0x2a')](_0x28ef5a);};}exports[_0x12f1('0x2b')]=function(_0x312302,_0x141f57){var _0x1b799d={},_0x4f4d5f={},_0x1115bb={'count':0x0,'rows':[]};var _0x54bf6d=_[_0x12f1('0x2c')](db[_0x12f1('0x2d')][_0x12f1('0x2e')],function(_0x43ffdb){return{'name':_0x43ffdb[_0x12f1('0x2f')],'type':_0x43ffdb[_0x12f1('0x30')][_0x12f1('0x31')]};});_0x4f4d5f[_0x12f1('0x32')]=_[_0x12f1('0x2c')](_0x54bf6d,_0x12f1('0x29'));_0x4f4d5f[_0x12f1('0x33')]=_[_0x12f1('0x34')](_0x312302['query']);_0x4f4d5f[_0x12f1('0x35')]=_[_0x12f1('0x36')](_0x4f4d5f[_0x12f1('0x32')],_0x4f4d5f[_0x12f1('0x33')]);_0x1b799d[_0x12f1('0x37')]=_[_0x12f1('0x36')](_0x4f4d5f[_0x12f1('0x32')],qs[_0x12f1('0x38')](_0x312302[_0x12f1('0x33')][_0x12f1('0x38')]));_0x1b799d[_0x12f1('0x37')]=_0x1b799d[_0x12f1('0x37')][_0x12f1('0x39')]?_0x1b799d[_0x12f1('0x37')]:_0x4f4d5f['model'];if(!_0x312302['query'][_0x12f1('0x3a')](_0x12f1('0x3b'))){_0x1b799d[_0x12f1('0x1e')]=qs[_0x12f1('0x1e')](_0x312302[_0x12f1('0x33')][_0x12f1('0x1e')]);_0x1b799d[_0x12f1('0x1c')]=qs[_0x12f1('0x1c')](_0x312302['query']['offset']);}_0x1b799d[_0x12f1('0x3c')]=qs['sort'](_0x312302[_0x12f1('0x33')]['sort']);_0x1b799d['where']=qs[_0x12f1('0x35')](_[_0x12f1('0x3d')](_0x312302[_0x12f1('0x33')],_0x4f4d5f['filters']),_0x54bf6d);if(_0x312302['query'][_0x12f1('0x3e')]){_0x1b799d[_0x12f1('0x3f')]=_[_0x12f1('0x40')](_0x1b799d[_0x12f1('0x3f')],{'$or':_[_0x12f1('0x2c')](_0x54bf6d,function(_0x5efcf2){if(_0x5efcf2[_0x12f1('0x30')]!==_0x12f1('0x41')){var _0x19bd99={};_0x19bd99[_0x5efcf2[_0x12f1('0x29')]]={'$like':'%'+_0x312302[_0x12f1('0x33')][_0x12f1('0x3e')]+'%'};return _0x19bd99;}})});}_0x1b799d=_[_0x12f1('0x40')]({},_0x1b799d,_0x312302[_0x12f1('0x42')]);var _0x560ed7={'where':_0x1b799d['where']};return db[_0x12f1('0x2d')][_0x12f1('0x1f')](_0x560ed7)[_0x12f1('0x25')](function(_0x55c63b){_0x1115bb[_0x12f1('0x1f')]=_0x55c63b;if(_0x312302[_0x12f1('0x33')]['includeAll']){_0x1b799d[_0x12f1('0x43')]=[{'all':!![]}];}return db[_0x12f1('0x2d')][_0x12f1('0x44')](_0x1b799d);})[_0x12f1('0x25')](function(_0x477bc1){_0x1115bb[_0x12f1('0x45')]=_0x477bc1;return _0x1115bb;})[_0x12f1('0x25')](respondWithFilteredResult(_0x141f57,_0x1b799d))[_0x12f1('0x46')](handleError(_0x141f57,null));};exports[_0x12f1('0x47')]=function(_0x354aed,_0x50ceaf){var _0x49136f={'raw':!![],'where':{'id':_0x354aed[_0x12f1('0x48')]['id']}},_0x546a8a={};_0x546a8a[_0x12f1('0x32')]=_[_0x12f1('0x34')](db[_0x12f1('0x2d')][_0x12f1('0x2e')]);_0x546a8a[_0x12f1('0x33')]=_[_0x12f1('0x34')](_0x354aed['query']);_0x546a8a[_0x12f1('0x35')]=_[_0x12f1('0x36')](_0x546a8a[_0x12f1('0x32')],_0x546a8a[_0x12f1('0x33')]);_0x49136f['attributes']=_[_0x12f1('0x36')](_0x546a8a[_0x12f1('0x32')],qs[_0x12f1('0x38')](_0x354aed[_0x12f1('0x33')][_0x12f1('0x38')]));_0x49136f['attributes']=_0x49136f[_0x12f1('0x37')][_0x12f1('0x39')]?_0x49136f[_0x12f1('0x37')]:_0x546a8a[_0x12f1('0x32')];if(_0x354aed['query'][_0x12f1('0x49')]){_0x49136f[_0x12f1('0x43')]=[{'all':!![]}];}_0x49136f=_[_0x12f1('0x40')]({},_0x49136f,_0x354aed[_0x12f1('0x42')]);return db[_0x12f1('0x2d')][_0x12f1('0x4a')](_0x49136f)[_0x12f1('0x25')](handleEntityNotFound(_0x50ceaf,null))[_0x12f1('0x25')](respondWithResult(_0x50ceaf,null))[_0x12f1('0x46')](handleError(_0x50ceaf,null));};exports[_0x12f1('0x4b')]=function(_0x4184cf,_0x668c7e){return db[_0x12f1('0x2d')][_0x12f1('0x4b')](_0x4184cf[_0x12f1('0x4c')],{})[_0x12f1('0x25')](respondWithResult(_0x668c7e,0xc9))[_0x12f1('0x46')](handleError(_0x668c7e,null));};exports[_0x12f1('0x24')]=function(_0x2faf29,_0x48feca){if(_0x2faf29[_0x12f1('0x4c')]['id']){delete _0x2faf29[_0x12f1('0x4c')]['id'];}return db[_0x12f1('0x2d')][_0x12f1('0x4a')]({'where':{'id':_0x2faf29[_0x12f1('0x48')]['id']}})[_0x12f1('0x25')](handleEntityNotFound(_0x48feca,null))[_0x12f1('0x25')](saveUpdates(_0x2faf29['body'],null))['then'](respondWithResult(_0x48feca,null))[_0x12f1('0x46')](handleError(_0x48feca,null));};exports[_0x12f1('0x26')]=function(_0x534b27,_0x49a72f){return db[_0x12f1('0x2d')]['find']({'where':{'id':_0x534b27[_0x12f1('0x48')]['id']}})[_0x12f1('0x25')](handleEntityNotFound(_0x49a72f,null))[_0x12f1('0x25')](removeEntity(_0x49a72f,null))['catch'](handleError(_0x49a72f,null));}; \ No newline at end of file +var _0xfa88=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','Dynamics365Field','findAll','rows','catch','show','params','include','create','find','body'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfa88,0xd8));var _0x8fa8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfa88[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fa8('0x0'));var zipdir=require(_0x8fa8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fa8('0x2'));var moment=require(_0x8fa8('0x3'));var BPromise=require(_0x8fa8('0x4'));var Mustache=require(_0x8fa8('0x5'));var util=require(_0x8fa8('0x6'));var path=require('path');var sox=require(_0x8fa8('0x7'));var csv=require(_0x8fa8('0x8'));var ejs=require(_0x8fa8('0x9'));var fs=require('fs');var fs_extra=require(_0x8fa8('0xa'));var _=require(_0x8fa8('0xb'));var squel=require(_0x8fa8('0xc'));var crypto=require('crypto');var jsforce=require(_0x8fa8('0xd'));var deskjs=require(_0x8fa8('0xe'));var toCsv=require(_0x8fa8('0x8'));var querystring=require(_0x8fa8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8fa8('0x10'));var as=require(_0x8fa8('0x11'));var hardwareService=require(_0x8fa8('0x12'));var logger=require(_0x8fa8('0x13'))('api');var utils=require(_0x8fa8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8fa8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29271e,_0x5a9e4e){_0x5a9e4e=_0x5a9e4e||0xcc;return function(_0xe123e6){if(_0xe123e6){return _0x29271e['sendStatus'](_0x5a9e4e);}return _0x29271e[_0x8fa8('0x16')](_0x5a9e4e)[_0x8fa8('0x17')]();};}function respondWithResult(_0x40e425,_0x331e13){_0x331e13=_0x331e13||0xc8;return function(_0x1d6054){if(_0x1d6054){return _0x40e425[_0x8fa8('0x16')](_0x331e13)[_0x8fa8('0x18')](_0x1d6054);}};}function respondWithFilteredResult(_0x32fce9,_0x160723){return function(_0x11edd4){if(_0x11edd4){var _0x41886e=typeof _0x160723[_0x8fa8('0x19')]===_0x8fa8('0x1a')&&typeof _0x160723[_0x8fa8('0x1b')]===_0x8fa8('0x1a');var _0x2a5476=_0x11edd4['count'];var _0x2233c3=_0x41886e?0x0:_0x160723[_0x8fa8('0x19')];var _0x1eb489=_0x41886e?_0x11edd4[_0x8fa8('0x1c')]:_0x160723[_0x8fa8('0x19')]+_0x160723['limit'];var _0x3f7e39;if(_0x1eb489>=_0x2a5476){_0x1eb489=_0x2a5476;_0x3f7e39=0xc8;}else{_0x3f7e39=0xce;}_0x32fce9[_0x8fa8('0x16')](_0x3f7e39);return _0x32fce9[_0x8fa8('0x1d')]('Content-Range',_0x2233c3+'-'+_0x1eb489+'/'+_0x2a5476)['json'](_0x11edd4);}return null;};}function patchUpdates(_0x27ae47){return function(_0x2d1cab){try{jsonpatch[_0x8fa8('0x1e')](_0x2d1cab,_0x27ae47,!![]);}catch(_0x1b5508){return BPromise[_0x8fa8('0x1f')](_0x1b5508);}return _0x2d1cab[_0x8fa8('0x20')]();};}function saveUpdates(_0x17df70,_0x1f822d){return function(_0x6c88b7){if(_0x6c88b7){return _0x6c88b7[_0x8fa8('0x21')](_0x17df70)[_0x8fa8('0x22')](function(_0x484ec3){return _0x484ec3;});}return null;};}function removeEntity(_0x1c521d,_0x296df9){return function(_0x3d7018){if(_0x3d7018){return _0x3d7018[_0x8fa8('0x23')]()[_0x8fa8('0x22')](function(){_0x1c521d[_0x8fa8('0x16')](0xcc)[_0x8fa8('0x17')]();});}};}function handleEntityNotFound(_0x3ea853,_0x17e50e){return function(_0x2d0c41){if(!_0x2d0c41){_0x3ea853['sendStatus'](0x194);}return _0x2d0c41;};}function handleError(_0xf0575c,_0x2d1306){_0x2d1306=_0x2d1306||0x1f4;return function(_0x673fa){logger[_0x8fa8('0x24')](_0x673fa[_0x8fa8('0x25')]);if(_0x673fa[_0x8fa8('0x26')]){delete _0x673fa[_0x8fa8('0x26')];}_0xf0575c['status'](_0x2d1306)[_0x8fa8('0x27')](_0x673fa);};}exports[_0x8fa8('0x28')]=function(_0x226e2b,_0x1823df){var _0x10e32b={},_0x565137={},_0x15d902={'count':0x0,'rows':[]};var _0x57d9f6=_[_0x8fa8('0x29')](db['Dynamics365Field'][_0x8fa8('0x2a')],function(_0x44a73f){return{'name':_0x44a73f[_0x8fa8('0x2b')],'type':_0x44a73f[_0x8fa8('0x2c')][_0x8fa8('0x2d')]};});_0x565137[_0x8fa8('0x2e')]=_[_0x8fa8('0x29')](_0x57d9f6,_0x8fa8('0x26'));_0x565137[_0x8fa8('0x2f')]=_[_0x8fa8('0x30')](_0x226e2b[_0x8fa8('0x2f')]);_0x565137['filters']=_[_0x8fa8('0x31')](_0x565137['model'],_0x565137[_0x8fa8('0x2f')]);_0x10e32b['attributes']=_[_0x8fa8('0x31')](_0x565137[_0x8fa8('0x2e')],qs[_0x8fa8('0x32')](_0x226e2b[_0x8fa8('0x2f')][_0x8fa8('0x32')]));_0x10e32b[_0x8fa8('0x33')]=_0x10e32b[_0x8fa8('0x33')]['length']?_0x10e32b['attributes']:_0x565137['model'];if(!_0x226e2b['query'][_0x8fa8('0x34')](_0x8fa8('0x35'))){_0x10e32b[_0x8fa8('0x1b')]=qs[_0x8fa8('0x1b')](_0x226e2b[_0x8fa8('0x2f')]['limit']);_0x10e32b[_0x8fa8('0x19')]=qs[_0x8fa8('0x19')](_0x226e2b[_0x8fa8('0x2f')][_0x8fa8('0x19')]);}_0x10e32b['order']=qs[_0x8fa8('0x36')](_0x226e2b[_0x8fa8('0x2f')][_0x8fa8('0x36')]);_0x10e32b[_0x8fa8('0x37')]=qs[_0x8fa8('0x38')](_[_0x8fa8('0x39')](_0x226e2b[_0x8fa8('0x2f')],_0x565137[_0x8fa8('0x38')]),_0x57d9f6);if(_0x226e2b[_0x8fa8('0x2f')][_0x8fa8('0x3a')]){_0x10e32b[_0x8fa8('0x37')]=_[_0x8fa8('0x3b')](_0x10e32b[_0x8fa8('0x37')],{'$or':_[_0x8fa8('0x29')](_0x57d9f6,function(_0x269932){if(_0x269932[_0x8fa8('0x2c')]!=='VIRTUAL'){var _0x531e66={};_0x531e66[_0x269932[_0x8fa8('0x26')]]={'$like':'%'+_0x226e2b['query'][_0x8fa8('0x3a')]+'%'};return _0x531e66;}})});}_0x10e32b=_[_0x8fa8('0x3b')]({},_0x10e32b,_0x226e2b[_0x8fa8('0x3c')]);var _0x250143={'where':_0x10e32b[_0x8fa8('0x37')]};return db['Dynamics365Field'][_0x8fa8('0x1c')](_0x250143)[_0x8fa8('0x22')](function(_0x2356ad){_0x15d902[_0x8fa8('0x1c')]=_0x2356ad;if(_0x226e2b[_0x8fa8('0x2f')][_0x8fa8('0x3d')]){_0x10e32b['include']=[{'all':!![]}];}return db[_0x8fa8('0x3e')][_0x8fa8('0x3f')](_0x10e32b);})['then'](function(_0x55a15a){_0x15d902[_0x8fa8('0x40')]=_0x55a15a;return _0x15d902;})[_0x8fa8('0x22')](respondWithFilteredResult(_0x1823df,_0x10e32b))[_0x8fa8('0x41')](handleError(_0x1823df,null));};exports[_0x8fa8('0x42')]=function(_0x5b6e6c,_0x4c76d2){var _0x4253f3={'raw':!![],'where':{'id':_0x5b6e6c[_0x8fa8('0x43')]['id']}},_0x1fa3c4={};_0x1fa3c4[_0x8fa8('0x2e')]=_[_0x8fa8('0x30')](db[_0x8fa8('0x3e')]['rawAttributes']);_0x1fa3c4[_0x8fa8('0x2f')]=_[_0x8fa8('0x30')](_0x5b6e6c[_0x8fa8('0x2f')]);_0x1fa3c4[_0x8fa8('0x38')]=_[_0x8fa8('0x31')](_0x1fa3c4[_0x8fa8('0x2e')],_0x1fa3c4['query']);_0x4253f3['attributes']=_[_0x8fa8('0x31')](_0x1fa3c4['model'],qs[_0x8fa8('0x32')](_0x5b6e6c[_0x8fa8('0x2f')]['fields']));_0x4253f3['attributes']=_0x4253f3[_0x8fa8('0x33')]['length']?_0x4253f3[_0x8fa8('0x33')]:_0x1fa3c4[_0x8fa8('0x2e')];if(_0x5b6e6c['query'][_0x8fa8('0x3d')]){_0x4253f3[_0x8fa8('0x44')]=[{'all':!![]}];}_0x4253f3=_[_0x8fa8('0x3b')]({},_0x4253f3,_0x5b6e6c[_0x8fa8('0x3c')]);return db['Dynamics365Field']['find'](_0x4253f3)[_0x8fa8('0x22')](handleEntityNotFound(_0x4c76d2,null))[_0x8fa8('0x22')](respondWithResult(_0x4c76d2,null))[_0x8fa8('0x41')](handleError(_0x4c76d2,null));};exports['create']=function(_0x20fe43,_0x1230f8){return db[_0x8fa8('0x3e')][_0x8fa8('0x45')](_0x20fe43['body'],{})[_0x8fa8('0x22')](respondWithResult(_0x1230f8,0xc9))[_0x8fa8('0x41')](handleError(_0x1230f8,null));};exports[_0x8fa8('0x21')]=function(_0x4868ee,_0x2c7ea2){if(_0x4868ee['body']['id']){delete _0x4868ee['body']['id'];}return db[_0x8fa8('0x3e')][_0x8fa8('0x46')]({'where':{'id':_0x4868ee[_0x8fa8('0x43')]['id']}})[_0x8fa8('0x22')](handleEntityNotFound(_0x2c7ea2,null))[_0x8fa8('0x22')](saveUpdates(_0x4868ee[_0x8fa8('0x47')],null))[_0x8fa8('0x22')](respondWithResult(_0x2c7ea2,null))['catch'](handleError(_0x2c7ea2,null));};exports['destroy']=function(_0xceb605,_0x5eb3bd){return db[_0x8fa8('0x3e')][_0x8fa8('0x46')]({'where':{'id':_0xceb605[_0x8fa8('0x43')]['id']}})[_0x8fa8('0x22')](handleEntityNotFound(_0x5eb3bd,null))[_0x8fa8('0x22')](removeEntity(_0x5eb3bd,null))[_0x8fa8('0x41')](handleError(_0x5eb3bd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 24e2693..e6fe507 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 _0xa888=['request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','util','moment','bluebird'];(function(_0x7abc99,_0x8de35){var _0x9e88e5=function(_0x22d72b){while(--_0x22d72b){_0x7abc99['push'](_0x7abc99['shift']());}};_0x9e88e5(++_0x8de35);}(_0xa888,0x195));var _0x8a88=function(_0x46f74f,_0x252d42){_0x46f74f=_0x46f74f-0x0;var _0x5d6009=_0xa888[_0x46f74f];return _0x5d6009;};'use strict';var _=require('lodash');var util=require(_0x8a88('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8a88('0x1'));var BPromise=require(_0x8a88('0x2'));var rp=require(_0x8a88('0x3'));var fs=require('fs');var path=require(_0x8a88('0x4'));var rimraf=require(_0x8a88('0x5'));var config=require(_0x8a88('0x6'));var attributes=require(_0x8a88('0x7'));module[_0x8a88('0x8')]=function(_0x1348c4,_0x574412){return _0x1348c4['define'](_0x8a88('0x9'),attributes,{'tableName':_0x8a88('0xa'),'paranoid':![],'indexes':[{'name':_0x8a88('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2c76=['path','rimraf','../../config/environment','exports','define','int_dynamics365_fields','dynamics365_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3cd91d,_0x163516){var _0x3b4fab=function(_0x1b3319){while(--_0x1b3319){_0x3cd91d['push'](_0x3cd91d['shift']());}};_0x3b4fab(++_0x163516);}(_0x2c76,0x1f1));var _0x62c7=function(_0x30471c,_0x4b5e23){_0x30471c=_0x30471c-0x0;var _0x56f02a=_0x2c76[_0x30471c];return _0x56f02a;};'use strict';var _=require(_0x62c7('0x0'));var util=require(_0x62c7('0x1'));var logger=require(_0x62c7('0x2'))(_0x62c7('0x3'));var moment=require(_0x62c7('0x4'));var BPromise=require(_0x62c7('0x5'));var rp=require(_0x62c7('0x6'));var fs=require('fs');var path=require(_0x62c7('0x7'));var rimraf=require(_0x62c7('0x8'));var config=require(_0x62c7('0x9'));var attributes=require('./intDynamics365Field.attributes');module[_0x62c7('0xa')]=function(_0x3ea740,_0x3670c6){return _0x3ea740[_0x62c7('0xb')]('Dynamics365Field',attributes,{'tableName':_0x62c7('0xc'),'paranoid':![],'indexes':[{'name':_0x62c7('0xd'),'fields':['idField','FieldId'],'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 3a8a5cd..8c964f9 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 _0x91b8=['Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x91b8,0x1c2));var _0x891b=function(_0x1efdd2,_0x3cde86){_0x1efdd2=_0x1efdd2-0x0;var _0x110b92=_0x91b8[_0x1efdd2];return _0x110b92;};'use strict';var _=require(_0x891b('0x0'));var util=require(_0x891b('0x1'));var moment=require('moment');var BPromise=require(_0x891b('0x2'));var rs=require(_0x891b('0x3'));var fs=require('fs');var Redis=require(_0x891b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x891b('0x5'));var logger=require('../../config/logger')(_0x891b('0x6'));var config=require(_0x891b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x891b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c5295,_0x3f0e3e,_0x16cc0f){return new BPromise(function(_0x4ff86a,_0x2dd7f5){return client[_0x891b('0x9')](_0x5c5295,_0x16cc0f)[_0x891b('0xa')](function(_0x517074){logger[_0x891b('0xb')](_0x891b('0xc'),_0x3f0e3e,_0x891b('0xd'));logger[_0x891b('0xe')](_0x891b('0xf'),_0x3f0e3e,_0x891b('0xd'),JSON[_0x891b('0x10')](_0x517074));if(_0x517074[_0x891b('0x11')]){if(_0x517074[_0x891b('0x11')][_0x891b('0x12')]===0x1f4){logger[_0x891b('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x3f0e3e,_0x517074[_0x891b('0x11')][_0x891b('0x13')]);return _0x2dd7f5(_0x517074[_0x891b('0x11')]['message']);}logger[_0x891b('0x11')](_0x891b('0xc'),_0x3f0e3e,_0x517074[_0x891b('0x11')][_0x891b('0x13')]);return _0x4ff86a(_0x517074['error'][_0x891b('0x13')]);}else{logger[_0x891b('0xb')](_0x891b('0xc'),_0x3f0e3e,'request\x20sent');_0x4ff86a(_0x517074[_0x891b('0x14')][_0x891b('0x13')]);}})[_0x891b('0x15')](function(_0x25d482){logger[_0x891b('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x3f0e3e,_0x25d482);_0x2dd7f5(_0x25d482);});});} \ No newline at end of file +var _0x07f4=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x07f4,0xaf));var _0x407f=function(_0x48636f,_0x2c7650){_0x48636f=_0x48636f-0x0;var _0x7cecb4=_0x07f4[_0x48636f];return _0x7cecb4;};'use strict';var _=require(_0x407f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x407f('0x1'));var rs=require(_0x407f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x407f('0x3'))['db'];var utils=require(_0x407f('0x4'));var logger=require(_0x407f('0x5'))('rpc');var config=require(_0x407f('0x6'));var jayson=require(_0x407f('0x7'));var client=jayson[_0x407f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e7af1,_0x545ab5,_0x5a642a){return new BPromise(function(_0x4e9b54,_0x51c02d){return client[_0x407f('0x9')](_0x4e7af1,_0x5a642a)[_0x407f('0xa')](function(_0x2c069a){logger[_0x407f('0xb')](_0x407f('0xc'),_0x545ab5,_0x407f('0xd'));logger['debug'](_0x407f('0xe'),_0x545ab5,_0x407f('0xd'),JSON[_0x407f('0xf')](_0x2c069a));if(_0x2c069a[_0x407f('0x10')]){if(_0x2c069a['error'][_0x407f('0x11')]===0x1f4){logger[_0x407f('0x10')](_0x407f('0xc'),_0x545ab5,_0x2c069a['error'][_0x407f('0x12')]);return _0x51c02d(_0x2c069a['error'][_0x407f('0x12')]);}logger[_0x407f('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x545ab5,_0x2c069a[_0x407f('0x10')][_0x407f('0x12')]);return _0x4e9b54(_0x2c069a[_0x407f('0x10')]['message']);}else{logger[_0x407f('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x545ab5,'request\x20sent');_0x4e9b54(_0x2c069a[_0x407f('0x13')][_0x407f('0x12')]);}})[_0x407f('0x14')](function(_0x5a5d2d){logger['error'](_0x407f('0xc'),_0x545ab5,_0x5a5d2d);_0x51c02d(_0x5a5d2d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index de4f948..3a47510 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 _0x2114=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','index','get','/:id','isAuthenticated'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0x2114,0x19b));var _0x4211=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x2114[_0x47408e];return _0x1636bc;};'use strict';var multer=require(_0x4211('0x0'));var util=require(_0x4211('0x1'));var path=require(_0x4211('0x2'));var timeout=require(_0x4211('0x3'));var express=require(_0x4211('0x4'));var router=express[_0x4211('0x5')]();var fs_extra=require(_0x4211('0x6'));var auth=require(_0x4211('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4211('0x8'));var controller=require(_0x4211('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4211('0xa')]);router[_0x4211('0xb')](_0x4211('0xc'),auth[_0x4211('0xd')](),controller['show']);router[_0x4211('0xb')]('/:id/configurations',auth[_0x4211('0xd')](),controller[_0x4211('0xe')]);router[_0x4211('0xb')](_0x4211('0xf'),auth[_0x4211('0xd')](),controller[_0x4211('0x10')]);router[_0x4211('0x11')]('/',auth[_0x4211('0xd')](),controller[_0x4211('0x12')]);router[_0x4211('0x11')](_0x4211('0x13'),auth[_0x4211('0xd')](),controller[_0x4211('0x14')]);router[_0x4211('0x15')](_0x4211('0xc'),auth[_0x4211('0xd')](),controller['update']);router[_0x4211('0x16')](_0x4211('0xc'),auth[_0x4211('0xd')](),controller[_0x4211('0x17')]);module[_0x4211('0x18')]=router; \ No newline at end of file +var _0x449e=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x41747d,_0x258c40){var _0x1c8d85=function(_0x289406){while(--_0x289406){_0x41747d['push'](_0x41747d['shift']());}};_0x1c8d85(++_0x258c40);}(_0x449e,0x177));var _0xe449=function(_0x1186b7,_0x42f09e){_0x1186b7=_0x1186b7-0x0;var _0x1964d7=_0x449e[_0x1186b7];return _0x1964d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe449('0x0'));var timeout=require(_0xe449('0x1'));var express=require(_0xe449('0x2'));var router=express['Router']();var fs_extra=require(_0xe449('0x3'));var auth=require(_0xe449('0x4'));var interaction=require(_0xe449('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xe449('0x6')]('/',auth['isAuthenticated'](),controller[_0xe449('0x7')]);router['get'](_0xe449('0x8'),auth[_0xe449('0x9')](),controller[_0xe449('0xa')]);router[_0xe449('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe449('0x6')](_0xe449('0xb'),auth[_0xe449('0x9')](),controller[_0xe449('0xc')]);router[_0xe449('0xd')]('/',auth['isAuthenticated'](),controller[_0xe449('0xe')]);router[_0xe449('0xd')](_0xe449('0xf'),auth[_0xe449('0x9')](),controller['addConfiguration']);router[_0xe449('0x10')](_0xe449('0x8'),auth[_0xe449('0x9')](),controller[_0xe449('0x11')]);router[_0xe449('0x12')](_0xe449('0x8'),auth[_0xe449('0x9')](),controller[_0xe449('0x13')]);module[_0xe449('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index e653f09..7755f4b 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 _0xa456=['STRING','username','sequelize','exports'];(function(_0x4f54f1,_0x155da4){var _0x56d2f7=function(_0x5398fb){while(--_0x5398fb){_0x4f54f1['push'](_0x4f54f1['shift']());}};_0x56d2f7(++_0x155da4);}(_0xa456,0x142));var _0x6a45=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xa456[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'name':{'type':Sequelize[_0x6a45('0x2')]},'description':{'type':Sequelize[_0x6a45('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6a45('0x3')},'apiKey':{'type':Sequelize[_0x6a45('0x2')]},'remoteUri':{'type':Sequelize[_0x6a45('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6a45('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb78e=['username','remoteUri','sequelize','exports','STRING'];(function(_0x22b70f,_0x4c853f){var _0x100985=function(_0x18628e){while(--_0x18628e){_0x22b70f['push'](_0x22b70f['shift']());}};_0x100985(++_0x4c853f);}(_0xb78e,0x1c9));var _0xeb78=function(_0x3259a2,_0x174b02){_0x3259a2=_0x3259a2-0x0;var _0x314467=_0xb78e[_0x3259a2];return _0x314467;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb78('0x2')]},'username':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x3')},'apiKey':{'type':Sequelize[_0xeb78('0x2')]},'remoteUri':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x4')},'serverUrl':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 451b748..adb2507 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 _0x2116=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','priority','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2116,0x67));var _0x6211=function(_0x36f471,_0x196e81){_0x36f471=_0x36f471-0x0;var _0x69ffce=_0x2116[_0x36f471];return _0x69ffce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6211('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6211('0x1'));var rp=require(_0x6211('0x2'));var moment=require(_0x6211('0x3'));var BPromise=require(_0x6211('0x4'));var Mustache=require('mustache');var util=require(_0x6211('0x5'));var path=require(_0x6211('0x6'));var sox=require(_0x6211('0x7'));var csv=require(_0x6211('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6211('0x9'));var _=require('lodash');var squel=require(_0x6211('0xa'));var crypto=require(_0x6211('0xb'));var jsforce=require(_0x6211('0xc'));var deskjs=require(_0x6211('0xd'));var toCsv=require(_0x6211('0x8'));var querystring=require(_0x6211('0xe'));var Papa=require(_0x6211('0xf'));var Redis=require('ioredis');var authService=require(_0x6211('0x10'));var qs=require(_0x6211('0x11'));var as=require(_0x6211('0x12'));var hardwareService=require(_0x6211('0x13'));var logger=require(_0x6211('0x14'))(_0x6211('0x15'));var utils=require(_0x6211('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6211('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6211('0x18'));function respondWithStatusCode(_0x6661a7,_0x22963d){_0x22963d=_0x22963d||0xcc;return function(_0x4bf101){if(_0x4bf101){return _0x6661a7[_0x6211('0x19')](_0x22963d);}return _0x6661a7[_0x6211('0x1a')](_0x22963d)[_0x6211('0x1b')]();};}function respondWithResult(_0x509faa,_0x54a303){_0x54a303=_0x54a303||0xc8;return function(_0x1685eb){if(_0x1685eb){return _0x509faa[_0x6211('0x1a')](_0x54a303)[_0x6211('0x1c')](_0x1685eb);}};}function respondWithFilteredResult(_0xf69c79,_0xa23863){return function(_0x15adb6){if(_0x15adb6){var _0x16d6a3=typeof _0xa23863[_0x6211('0x1d')]==='undefined'&&typeof _0xa23863[_0x6211('0x1e')]===_0x6211('0x1f');var _0x431081=_0x15adb6[_0x6211('0x20')];var _0xecea40=_0x16d6a3?0x0:_0xa23863[_0x6211('0x1d')];var _0x460efc=_0x16d6a3?_0x15adb6['count']:_0xa23863[_0x6211('0x1d')]+_0xa23863[_0x6211('0x1e')];var _0x5af096;if(_0x460efc>=_0x431081){_0x460efc=_0x431081;_0x5af096=0xc8;}else{_0x5af096=0xce;}_0xf69c79[_0x6211('0x1a')](_0x5af096);return _0xf69c79[_0x6211('0x21')](_0x6211('0x22'),_0xecea40+'-'+_0x460efc+'/'+_0x431081)[_0x6211('0x1c')](_0x15adb6);}return null;};}function patchUpdates(_0x4d99bc){return function(_0x51a389){try{jsonpatch[_0x6211('0x23')](_0x51a389,_0x4d99bc,!![]);}catch(_0x3cc2cf){return BPromise['reject'](_0x3cc2cf);}return _0x51a389['save']();};}function saveUpdates(_0x15ca00,_0x1e6a53){return function(_0x3a39fb){if(_0x3a39fb){return _0x3a39fb[_0x6211('0x24')](_0x15ca00)['then'](function(_0x2c1c0a){return _0x2c1c0a;});}return null;};}function removeEntity(_0x311054,_0x16fb0c){return function(_0x49153f){if(_0x49153f){return _0x49153f[_0x6211('0x25')]()[_0x6211('0x26')](function(){_0x311054[_0x6211('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x532778,_0x4ebae9){return function(_0x4c0017){if(!_0x4c0017){_0x532778['sendStatus'](0x194);}return _0x4c0017;};}function handleError(_0x15a096,_0x2badd2){_0x2badd2=_0x2badd2||0x1f4;return function(_0x140496){logger[_0x6211('0x27')](_0x140496[_0x6211('0x28')]);if(_0x140496[_0x6211('0x29')]){delete _0x140496[_0x6211('0x29')];}_0x15a096[_0x6211('0x1a')](_0x2badd2)[_0x6211('0x2a')](_0x140496);};}exports[_0x6211('0x2b')]=function(_0x105721,_0x38f5f8){var _0x3564f2={},_0x26a8cc={},_0x20e576={'count':0x0,'rows':[]};var _0x424ce3=_[_0x6211('0x2c')](db['FreshdeskAccount'][_0x6211('0x2d')],function(_0x44404a){return{'name':_0x44404a[_0x6211('0x2e')],'type':_0x44404a['type']['key']};});_0x26a8cc[_0x6211('0x2f')]=_['map'](_0x424ce3,_0x6211('0x29'));_0x26a8cc[_0x6211('0x30')]=_[_0x6211('0x31')](_0x105721['query']);_0x26a8cc[_0x6211('0x32')]=_[_0x6211('0x33')](_0x26a8cc[_0x6211('0x2f')],_0x26a8cc[_0x6211('0x30')]);_0x3564f2[_0x6211('0x34')]=_['intersection'](_0x26a8cc['model'],qs[_0x6211('0x35')](_0x105721['query']['fields']));_0x3564f2['attributes']=_0x3564f2[_0x6211('0x34')][_0x6211('0x36')]?_0x3564f2[_0x6211('0x34')]:_0x26a8cc['model'];if(!_0x105721[_0x6211('0x30')]['hasOwnProperty'](_0x6211('0x37'))){_0x3564f2[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x105721['query'][_0x6211('0x1e')]);_0x3564f2[_0x6211('0x1d')]=qs[_0x6211('0x1d')](_0x105721[_0x6211('0x30')][_0x6211('0x1d')]);}_0x3564f2[_0x6211('0x38')]=qs[_0x6211('0x39')](_0x105721[_0x6211('0x30')]['sort']);_0x3564f2[_0x6211('0x3a')]=qs[_0x6211('0x32')](_[_0x6211('0x3b')](_0x105721[_0x6211('0x30')],_0x26a8cc[_0x6211('0x32')]),_0x424ce3);if(_0x105721['query'][_0x6211('0x3c')]){_0x3564f2[_0x6211('0x3a')]=_[_0x6211('0x3d')](_0x3564f2[_0x6211('0x3a')],{'$or':_['map'](_0x424ce3,function(_0x457ff9){if(_0x457ff9[_0x6211('0x3e')]!==_0x6211('0x3f')){var _0x1f3a4a={};_0x1f3a4a[_0x457ff9[_0x6211('0x29')]]={'$like':'%'+_0x105721[_0x6211('0x30')][_0x6211('0x3c')]+'%'};return _0x1f3a4a;}})});}_0x3564f2=_['merge']({},_0x3564f2,_0x105721[_0x6211('0x40')]);var _0x4ed0c5={'where':_0x3564f2[_0x6211('0x3a')]};return db[_0x6211('0x41')]['count'](_0x4ed0c5)[_0x6211('0x26')](function(_0x1b5e1c){_0x20e576['count']=_0x1b5e1c;if(_0x105721['query']['includeAll']){_0x3564f2[_0x6211('0x42')]=[{'all':!![]}];}return db[_0x6211('0x41')][_0x6211('0x43')](_0x3564f2);})['then'](function(_0x132fb7){_0x20e576[_0x6211('0x44')]=_0x132fb7;return _0x20e576;})[_0x6211('0x26')](respondWithFilteredResult(_0x38f5f8,_0x3564f2))[_0x6211('0x45')](handleError(_0x38f5f8,null));};exports[_0x6211('0x46')]=function(_0x476456,_0x28721a){var _0x371956={'raw':![],'where':{'id':_0x476456['params']['id']}},_0x4e2c14={};_0x4e2c14[_0x6211('0x2f')]=_[_0x6211('0x31')](db[_0x6211('0x41')][_0x6211('0x2d')]);_0x4e2c14[_0x6211('0x30')]=_[_0x6211('0x31')](_0x476456['query']);_0x4e2c14[_0x6211('0x32')]=_[_0x6211('0x33')](_0x4e2c14[_0x6211('0x2f')],_0x4e2c14[_0x6211('0x30')]);_0x371956[_0x6211('0x34')]=_['intersection'](_0x4e2c14[_0x6211('0x2f')],qs['fields'](_0x476456[_0x6211('0x30')]['fields']));_0x371956[_0x6211('0x34')]=_0x371956[_0x6211('0x34')]['length']?_0x371956[_0x6211('0x34')]:_0x4e2c14[_0x6211('0x2f')];if(_0x476456[_0x6211('0x30')]['includeAll']){_0x371956[_0x6211('0x42')]=[{'all':!![]}];}_0x371956=_['merge']({},_0x371956,_0x476456[_0x6211('0x40')]);return db['FreshdeskAccount'][_0x6211('0x47')](_0x371956)['then'](handleEntityNotFound(_0x28721a,null))[_0x6211('0x26')](respondWithResult(_0x28721a,null))[_0x6211('0x45')](handleError(_0x28721a,null));};exports[_0x6211('0x48')]=function(_0x2111fd,_0x27eae4){return db[_0x6211('0x41')][_0x6211('0x48')](_0x2111fd[_0x6211('0x49')],{})[_0x6211('0x26')](respondWithResult(_0x27eae4,0xc9))[_0x6211('0x45')](handleError(_0x27eae4,null));};exports['update']=function(_0x2bc4ae,_0x40c8df){if(_0x2bc4ae[_0x6211('0x49')]['id']){delete _0x2bc4ae[_0x6211('0x49')]['id'];}return db['FreshdeskAccount'][_0x6211('0x47')]({'where':{'id':_0x2bc4ae[_0x6211('0x4a')]['id']}})['then'](handleEntityNotFound(_0x40c8df,null))[_0x6211('0x26')](saveUpdates(_0x2bc4ae['body'],null))['then'](respondWithResult(_0x40c8df,null))[_0x6211('0x45')](handleError(_0x40c8df,null));};exports[_0x6211('0x25')]=function(_0x5aae45,_0xa0485a){return db[_0x6211('0x41')][_0x6211('0x47')]({'where':{'id':_0x5aae45[_0x6211('0x4a')]['id']}})[_0x6211('0x26')](handleEntityNotFound(_0xa0485a,null))['then'](removeEntity(_0xa0485a,null))[_0x6211('0x45')](handleError(_0xa0485a,null));};exports[_0x6211('0x4b')]=function(_0x1901d7,_0x4d0acd,_0x1b264a){var _0x588ab7={};var _0x21e5e2={};var _0x4a15b0;var _0x4b1d8e;return db[_0x6211('0x41')][_0x6211('0x4c')]({'where':{'id':_0x1901d7['params']['id']}})[_0x6211('0x26')](handleEntityNotFound(_0x4d0acd,null))[_0x6211('0x26')](function(_0x41c86a){if(_0x41c86a){_0x4a15b0=_0x41c86a;_0x21e5e2[_0x6211('0x2f')]=_['keys'](db[_0x6211('0x4d')][_0x6211('0x2d')]);_0x21e5e2[_0x6211('0x30')]=_[_0x6211('0x31')](_0x1901d7[_0x6211('0x30')]);_0x21e5e2[_0x6211('0x32')]=_[_0x6211('0x33')](_0x21e5e2[_0x6211('0x2f')],_0x21e5e2['query']);_0x588ab7[_0x6211('0x34')]=_[_0x6211('0x33')](_0x21e5e2['model'],qs['fields'](_0x1901d7[_0x6211('0x30')][_0x6211('0x35')]));_0x588ab7[_0x6211('0x34')]=_0x588ab7['attributes'][_0x6211('0x36')]?_0x588ab7['attributes']:_0x21e5e2[_0x6211('0x2f')];_0x588ab7[_0x6211('0x38')]=qs['sort'](_0x1901d7['query'][_0x6211('0x39')]);_0x588ab7[_0x6211('0x3a')]=qs[_0x6211('0x32')](_[_0x6211('0x3b')](_0x1901d7[_0x6211('0x30')],_0x21e5e2['filters']));if(_0x1901d7[_0x6211('0x30')][_0x6211('0x3c')]){_0x588ab7['where']=_[_0x6211('0x3d')](_0x588ab7[_0x6211('0x3a')],{'$or':_[_0x6211('0x2c')](_0x588ab7[_0x6211('0x34')],function(_0x18f08a){var _0x509302={};_0x509302[_0x18f08a]={'$like':'%'+_0x1901d7[_0x6211('0x30')][_0x6211('0x3c')]+'%'};return _0x509302;})});}_0x588ab7=_[_0x6211('0x3d')]({},_0x588ab7,_0x1901d7[_0x6211('0x40')]);return _0x4a15b0['getConfigurations'](_0x588ab7);}})[_0x6211('0x26')](function(_0x5628ac){if(_0x5628ac){_0x4b1d8e=_0x5628ac[_0x6211('0x36')];if(!_0x1901d7[_0x6211('0x30')][_0x6211('0x4e')]('nolimit')){_0x588ab7[_0x6211('0x1e')]=qs['limit'](_0x1901d7[_0x6211('0x30')][_0x6211('0x1e')]);_0x588ab7['offset']=qs[_0x6211('0x1d')](_0x1901d7['query'][_0x6211('0x1d')]);}return _0x4a15b0[_0x6211('0x4b')](_0x588ab7);}})[_0x6211('0x26')](function(_0x10d8d1){if(_0x10d8d1){return _0x10d8d1?{'count':_0x4b1d8e,'rows':_0x10d8d1}:null;}})['then'](respondWithResult(_0x4d0acd,null))[_0x6211('0x45')](handleError(_0x4d0acd,null));};exports[_0x6211('0x4f')]=function(_0x2aec5d,_0x15cb0a,_0x5453fd){if(_0x2aec5d[_0x6211('0x49')]['id']){delete _0x2aec5d[_0x6211('0x49')]['id'];}return db['FreshdeskAccount'][_0x6211('0x4c')]({'where':{'id':_0x2aec5d[_0x6211('0x4a')]['id']}})[_0x6211('0x26')](handleEntityNotFound(_0x15cb0a,null))[_0x6211('0x26')](function(_0x191f84){if(_0x191f84){_0x2aec5d[_0x6211('0x49')][_0x6211('0x50')]=_0x191f84['id'];_0x2aec5d[_0x6211('0x49')]['Subjects']=integrations[_0x6211('0x51')](_0x2aec5d[_0x6211('0x49')][_0x6211('0x52')],_0x2aec5d[_0x6211('0x49')][_0x6211('0x3e')]);_0x2aec5d[_0x6211('0x49')][_0x6211('0x53')]=integrations[_0x6211('0x54')](_0x2aec5d[_0x6211('0x49')][_0x6211('0x52')],_0x2aec5d['body']['type']);return db['FreshdeskConfiguration'][_0x6211('0x48')](_0x2aec5d['body'],{'include':[{'model':db[_0x6211('0x55')],'as':'Subjects'},{'model':db[_0x6211('0x55')],'as':_0x6211('0x53')}]});}return null;})[_0x6211('0x26')](respondWithResult(_0x15cb0a,null))['catch'](handleError(_0x15cb0a,null));};exports[_0x6211('0x56')]=function(_0x361dd3,_0x1b6f09,_0xa90873){var _0x144620='';return db[_0x6211('0x41')]['findOne']({'where':{'id':_0x361dd3[_0x6211('0x4a')]['id']},'attributes':['id','remoteUri',_0x6211('0x57')]})['then'](handleEntityNotFound(_0x1b6f09,null))[_0x6211('0x26')](function(_0x370016){if(_0x370016){_0x144620=_0x370016[_0x6211('0x58')];var _0x58e51d=_0x144620[_0x6211('0x59')](-0x1);if(_0x58e51d==='/'){_0x144620=_0x144620[_0x6211('0x5a')](0x0,_0x144620[_0x6211('0x5b')](_0x58e51d));}return rp({'method':_0x6211('0x5c'),'uri':util[_0x6211('0x5d')](_0x6211('0x5e'),_0x144620,_0x6211('0x5f')),'headers':{'Authorization':util[_0x6211('0x5d')]('Basic\x20%s',new Buffer(util[_0x6211('0x5d')](_0x6211('0x60'),_0x370016['apiKey']))[_0x6211('0x61')](_0x6211('0x62')))},'json':!![]});}})[_0x6211('0x26')](function(_0x35e822){if(_0x35e822){var _0x40fad2=[_0x6211('0x63'),_0x6211('0x64'),_0x6211('0x65'),'description',_0x6211('0x1a'),_0x6211('0x66'),_0x6211('0x67'),'source','ticket_type',_0x6211('0x67'),_0x6211('0x68')];_[_0x6211('0x69')](_0x35e822,function(_0x4d7a5b){return _0x40fad2[_0x6211('0x6a')](_0x4d7a5b[_0x6211('0x29')])||!_0x4d7a5b[_0x6211('0x6b')]&&_0x4d7a5b[_0x6211('0x3e')]!==_0x6211('0x6c')&&_0x4d7a5b['type']!==_0x6211('0x6d');});return{'count':_0x35e822[_0x6211('0x36')],'rows':_['map'](_0x35e822,function(_0x2ad122){return{'id':_0x2ad122['name'],'name':_0x2ad122[_0x6211('0x6e')],'custom':!_0x2ad122['default'],'options':_0x2ad122[_0x6211('0x6f')]?_[_0x6211('0x2c')](_0x2ad122[_0x6211('0x6f')],function(_0xa5e9a){return{'name':_[_0x6211('0x70')](_0xa5e9a),'value':_0xa5e9a};}):[]};})};}})['then'](respondWithResult(_0x1b6f09,null))[_0x6211('0x45')](function(_0x12b48b){var _0x5526b5=_0x361dd3[_0x6211('0x30')][_0x6211('0x71')]?0x1f4:_0x12b48b[_0x6211('0x72')]||0x1f4;logger[_0x6211('0x27')](_0x6211('0x73'),_0x6211('0x56'),_0x5526b5,JSON[_0x6211('0x74')](_0x12b48b));delete _0x12b48b['name'];if(_0x5526b5===0x191){_0x5526b5=0x190;}_0x1b6f09[_0x6211('0x1a')](_0x5526b5)[_0x6211('0x2a')](_0x361dd3[_0x6211('0x30')][_0x6211('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x12b48b[_0x6211('0x72')]}:_0x12b48b);});}; \ No newline at end of file +var _0xd110=['Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','options','find','create','body','params','getConfigurations','FreshdeskConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields'];(function(_0x1bf011,_0x5e23ca){var _0x47b501=function(_0x35c3e8){while(--_0x35c3e8){_0x1bf011['push'](_0x1bf011['shift']());}};_0x47b501(++_0x5e23ca);}(_0xd110,0x1e8));var _0x0d11=function(_0x5eed39,_0x9d548){_0x5eed39=_0x5eed39-0x0;var _0x2a5526=_0xd110[_0x5eed39];return _0x2a5526;};'use strict';var emlformat=require(_0x0d11('0x0'));var rimraf=require(_0x0d11('0x1'));var zipdir=require(_0x0d11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d11('0x3'));var moment=require(_0x0d11('0x4'));var BPromise=require(_0x0d11('0x5'));var Mustache=require(_0x0d11('0x6'));var util=require(_0x0d11('0x7'));var path=require(_0x0d11('0x8'));var sox=require(_0x0d11('0x9'));var csv=require(_0x0d11('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d11('0xb'));var _=require('lodash');var squel=require(_0x0d11('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d11('0xd'));var toCsv=require(_0x0d11('0xa'));var querystring=require(_0x0d11('0xe'));var Papa=require('papaparse');var Redis=require(_0x0d11('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0d11('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d11('0x11'));var logger=require(_0x0d11('0x12'))(_0x0d11('0x13'));var utils=require(_0x0d11('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0d11('0x15'));var db=require(_0x0d11('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x19f883,_0x2330ed){_0x2330ed=_0x2330ed||0xcc;return function(_0x29e0cc){if(_0x29e0cc){return _0x19f883['sendStatus'](_0x2330ed);}return _0x19f883[_0x0d11('0x17')](_0x2330ed)[_0x0d11('0x18')]();};}function respondWithResult(_0x5bea18,_0x119ce7){_0x119ce7=_0x119ce7||0xc8;return function(_0x3c88e6){if(_0x3c88e6){return _0x5bea18[_0x0d11('0x17')](_0x119ce7)[_0x0d11('0x19')](_0x3c88e6);}};}function respondWithFilteredResult(_0x2bc04b,_0x5b85a7){return function(_0x5a0de9){if(_0x5a0de9){var _0x280d81=typeof _0x5b85a7['offset']===_0x0d11('0x1a')&&typeof _0x5b85a7[_0x0d11('0x1b')]==='undefined';var _0x2556ac=_0x5a0de9['count'];var _0x2e4c05=_0x280d81?0x0:_0x5b85a7[_0x0d11('0x1c')];var _0x5e3bd3=_0x280d81?_0x5a0de9['count']:_0x5b85a7[_0x0d11('0x1c')]+_0x5b85a7[_0x0d11('0x1b')];var _0x362c14;if(_0x5e3bd3>=_0x2556ac){_0x5e3bd3=_0x2556ac;_0x362c14=0xc8;}else{_0x362c14=0xce;}_0x2bc04b[_0x0d11('0x17')](_0x362c14);return _0x2bc04b[_0x0d11('0x1d')](_0x0d11('0x1e'),_0x2e4c05+'-'+_0x5e3bd3+'/'+_0x2556ac)['json'](_0x5a0de9);}return null;};}function patchUpdates(_0x467448){return function(_0x170e45){try{jsonpatch[_0x0d11('0x1f')](_0x170e45,_0x467448,!![]);}catch(_0x32d33f){return BPromise[_0x0d11('0x20')](_0x32d33f);}return _0x170e45['save']();};}function saveUpdates(_0x38955b,_0x52e60f){return function(_0x1d94e0){if(_0x1d94e0){return _0x1d94e0[_0x0d11('0x21')](_0x38955b)[_0x0d11('0x22')](function(_0x480a4f){return _0x480a4f;});}return null;};}function removeEntity(_0x304f7f,_0xc4c278){return function(_0x4a6839){if(_0x4a6839){return _0x4a6839[_0x0d11('0x23')]()['then'](function(){_0x304f7f[_0x0d11('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52cb79,_0x1dba11){return function(_0xb83c45){if(!_0xb83c45){_0x52cb79[_0x0d11('0x24')](0x194);}return _0xb83c45;};}function handleError(_0x2138a0,_0x7be5a3){_0x7be5a3=_0x7be5a3||0x1f4;return function(_0x4cd228){logger[_0x0d11('0x25')](_0x4cd228['stack']);if(_0x4cd228[_0x0d11('0x26')]){delete _0x4cd228['name'];}_0x2138a0[_0x0d11('0x17')](_0x7be5a3)[_0x0d11('0x27')](_0x4cd228);};}exports[_0x0d11('0x28')]=function(_0x103c75,_0x206dd2){var _0x17a668={},_0x144e93={},_0x38f51d={'count':0x0,'rows':[]};var _0x25abc5=_[_0x0d11('0x29')](db[_0x0d11('0x2a')][_0x0d11('0x2b')],function(_0x47909c){return{'name':_0x47909c[_0x0d11('0x2c')],'type':_0x47909c[_0x0d11('0x2d')]['key']};});_0x144e93[_0x0d11('0x2e')]=_[_0x0d11('0x29')](_0x25abc5,_0x0d11('0x26'));_0x144e93[_0x0d11('0x2f')]=_[_0x0d11('0x30')](_0x103c75[_0x0d11('0x2f')]);_0x144e93[_0x0d11('0x31')]=_[_0x0d11('0x32')](_0x144e93[_0x0d11('0x2e')],_0x144e93[_0x0d11('0x2f')]);_0x17a668[_0x0d11('0x33')]=_['intersection'](_0x144e93[_0x0d11('0x2e')],qs[_0x0d11('0x34')](_0x103c75[_0x0d11('0x2f')][_0x0d11('0x34')]));_0x17a668[_0x0d11('0x33')]=_0x17a668[_0x0d11('0x33')][_0x0d11('0x35')]?_0x17a668[_0x0d11('0x33')]:_0x144e93[_0x0d11('0x2e')];if(!_0x103c75[_0x0d11('0x2f')][_0x0d11('0x36')]('nolimit')){_0x17a668['limit']=qs[_0x0d11('0x1b')](_0x103c75[_0x0d11('0x2f')][_0x0d11('0x1b')]);_0x17a668[_0x0d11('0x1c')]=qs['offset'](_0x103c75[_0x0d11('0x2f')][_0x0d11('0x1c')]);}_0x17a668['order']=qs[_0x0d11('0x37')](_0x103c75[_0x0d11('0x2f')][_0x0d11('0x37')]);_0x17a668[_0x0d11('0x38')]=qs[_0x0d11('0x31')](_[_0x0d11('0x39')](_0x103c75[_0x0d11('0x2f')],_0x144e93[_0x0d11('0x31')]),_0x25abc5);if(_0x103c75[_0x0d11('0x2f')][_0x0d11('0x3a')]){_0x17a668[_0x0d11('0x38')]=_[_0x0d11('0x3b')](_0x17a668[_0x0d11('0x38')],{'$or':_[_0x0d11('0x29')](_0x25abc5,function(_0x30da16){if(_0x30da16['type']!==_0x0d11('0x3c')){var _0x581bfc={};_0x581bfc[_0x30da16[_0x0d11('0x26')]]={'$like':'%'+_0x103c75[_0x0d11('0x2f')][_0x0d11('0x3a')]+'%'};return _0x581bfc;}})});}_0x17a668=_[_0x0d11('0x3b')]({},_0x17a668,_0x103c75['options']);var _0x1d5433={'where':_0x17a668[_0x0d11('0x38')]};return db[_0x0d11('0x2a')][_0x0d11('0x3d')](_0x1d5433)['then'](function(_0x37c937){_0x38f51d['count']=_0x37c937;if(_0x103c75[_0x0d11('0x2f')][_0x0d11('0x3e')]){_0x17a668[_0x0d11('0x3f')]=[{'all':!![]}];}return db[_0x0d11('0x2a')]['findAll'](_0x17a668);})[_0x0d11('0x22')](function(_0x241924){_0x38f51d[_0x0d11('0x40')]=_0x241924;return _0x38f51d;})['then'](respondWithFilteredResult(_0x206dd2,_0x17a668))[_0x0d11('0x41')](handleError(_0x206dd2,null));};exports[_0x0d11('0x42')]=function(_0x37bfc4,_0xe95462){var _0x420d4a={'raw':![],'where':{'id':_0x37bfc4['params']['id']}},_0x2d55b3={};_0x2d55b3[_0x0d11('0x2e')]=_[_0x0d11('0x30')](db[_0x0d11('0x2a')][_0x0d11('0x2b')]);_0x2d55b3[_0x0d11('0x2f')]=_[_0x0d11('0x30')](_0x37bfc4[_0x0d11('0x2f')]);_0x2d55b3[_0x0d11('0x31')]=_[_0x0d11('0x32')](_0x2d55b3[_0x0d11('0x2e')],_0x2d55b3[_0x0d11('0x2f')]);_0x420d4a['attributes']=_[_0x0d11('0x32')](_0x2d55b3['model'],qs['fields'](_0x37bfc4[_0x0d11('0x2f')]['fields']));_0x420d4a['attributes']=_0x420d4a[_0x0d11('0x33')][_0x0d11('0x35')]?_0x420d4a[_0x0d11('0x33')]:_0x2d55b3[_0x0d11('0x2e')];if(_0x37bfc4['query'][_0x0d11('0x3e')]){_0x420d4a['include']=[{'all':!![]}];}_0x420d4a=_['merge']({},_0x420d4a,_0x37bfc4[_0x0d11('0x43')]);return db[_0x0d11('0x2a')][_0x0d11('0x44')](_0x420d4a)[_0x0d11('0x22')](handleEntityNotFound(_0xe95462,null))[_0x0d11('0x22')](respondWithResult(_0xe95462,null))['catch'](handleError(_0xe95462,null));};exports[_0x0d11('0x45')]=function(_0x43e69d,_0x4aa73a){return db['FreshdeskAccount']['create'](_0x43e69d['body'],{})[_0x0d11('0x22')](respondWithResult(_0x4aa73a,0xc9))[_0x0d11('0x41')](handleError(_0x4aa73a,null));};exports[_0x0d11('0x21')]=function(_0x4dd063,_0x494403){if(_0x4dd063[_0x0d11('0x46')]['id']){delete _0x4dd063[_0x0d11('0x46')]['id'];}return db[_0x0d11('0x2a')][_0x0d11('0x44')]({'where':{'id':_0x4dd063[_0x0d11('0x47')]['id']}})['then'](handleEntityNotFound(_0x494403,null))[_0x0d11('0x22')](saveUpdates(_0x4dd063[_0x0d11('0x46')],null))[_0x0d11('0x22')](respondWithResult(_0x494403,null))[_0x0d11('0x41')](handleError(_0x494403,null));};exports[_0x0d11('0x23')]=function(_0x371564,_0x37916a){return db[_0x0d11('0x2a')][_0x0d11('0x44')]({'where':{'id':_0x371564[_0x0d11('0x47')]['id']}})[_0x0d11('0x22')](handleEntityNotFound(_0x37916a,null))[_0x0d11('0x22')](removeEntity(_0x37916a,null))[_0x0d11('0x41')](handleError(_0x37916a,null));};exports[_0x0d11('0x48')]=function(_0x371e93,_0x2bc859,_0x3a59d9){var _0x1f07f1={};var _0x17f3a0={};var _0x2927a0;var _0x5b28ce;return db[_0x0d11('0x2a')]['findOne']({'where':{'id':_0x371e93[_0x0d11('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bc859,null))['then'](function(_0x1406a2){if(_0x1406a2){_0x2927a0=_0x1406a2;_0x17f3a0[_0x0d11('0x2e')]=_[_0x0d11('0x30')](db[_0x0d11('0x49')][_0x0d11('0x2b')]);_0x17f3a0[_0x0d11('0x2f')]=_[_0x0d11('0x30')](_0x371e93[_0x0d11('0x2f')]);_0x17f3a0['filters']=_['intersection'](_0x17f3a0['model'],_0x17f3a0[_0x0d11('0x2f')]);_0x1f07f1[_0x0d11('0x33')]=_[_0x0d11('0x32')](_0x17f3a0[_0x0d11('0x2e')],qs[_0x0d11('0x34')](_0x371e93[_0x0d11('0x2f')][_0x0d11('0x34')]));_0x1f07f1['attributes']=_0x1f07f1[_0x0d11('0x33')][_0x0d11('0x35')]?_0x1f07f1[_0x0d11('0x33')]:_0x17f3a0['model'];_0x1f07f1['order']=qs[_0x0d11('0x37')](_0x371e93['query'][_0x0d11('0x37')]);_0x1f07f1[_0x0d11('0x38')]=qs[_0x0d11('0x31')](_[_0x0d11('0x39')](_0x371e93[_0x0d11('0x2f')],_0x17f3a0[_0x0d11('0x31')]));if(_0x371e93[_0x0d11('0x2f')][_0x0d11('0x3a')]){_0x1f07f1[_0x0d11('0x38')]=_[_0x0d11('0x3b')](_0x1f07f1[_0x0d11('0x38')],{'$or':_[_0x0d11('0x29')](_0x1f07f1[_0x0d11('0x33')],function(_0x1d5c84){var _0x142437={};_0x142437[_0x1d5c84]={'$like':'%'+_0x371e93[_0x0d11('0x2f')][_0x0d11('0x3a')]+'%'};return _0x142437;})});}_0x1f07f1=_[_0x0d11('0x3b')]({},_0x1f07f1,_0x371e93[_0x0d11('0x43')]);return _0x2927a0[_0x0d11('0x48')](_0x1f07f1);}})[_0x0d11('0x22')](function(_0x312745){if(_0x312745){_0x5b28ce=_0x312745[_0x0d11('0x35')];if(!_0x371e93[_0x0d11('0x2f')][_0x0d11('0x36')](_0x0d11('0x4a'))){_0x1f07f1[_0x0d11('0x1b')]=qs['limit'](_0x371e93[_0x0d11('0x2f')]['limit']);_0x1f07f1[_0x0d11('0x1c')]=qs[_0x0d11('0x1c')](_0x371e93[_0x0d11('0x2f')][_0x0d11('0x1c')]);}return _0x2927a0[_0x0d11('0x48')](_0x1f07f1);}})['then'](function(_0x17f47b){if(_0x17f47b){return _0x17f47b?{'count':_0x5b28ce,'rows':_0x17f47b}:null;}})[_0x0d11('0x22')](respondWithResult(_0x2bc859,null))[_0x0d11('0x41')](handleError(_0x2bc859,null));};exports[_0x0d11('0x4b')]=function(_0x237224,_0x32d692,_0x2a6b03){if(_0x237224[_0x0d11('0x46')]['id']){delete _0x237224[_0x0d11('0x46')]['id'];}return db['FreshdeskAccount'][_0x0d11('0x4c')]({'where':{'id':_0x237224[_0x0d11('0x47')]['id']}})[_0x0d11('0x22')](handleEntityNotFound(_0x32d692,null))[_0x0d11('0x22')](function(_0x130278){if(_0x130278){_0x237224[_0x0d11('0x46')][_0x0d11('0x4d')]=_0x130278['id'];_0x237224[_0x0d11('0x46')][_0x0d11('0x4e')]=integrations[_0x0d11('0x4f')](_0x237224[_0x0d11('0x46')][_0x0d11('0x50')],_0x237224[_0x0d11('0x46')][_0x0d11('0x2d')]);_0x237224[_0x0d11('0x46')]['Descriptions']=integrations[_0x0d11('0x51')](_0x237224[_0x0d11('0x46')][_0x0d11('0x50')],_0x237224['body']['type']);return db['FreshdeskConfiguration'][_0x0d11('0x45')](_0x237224[_0x0d11('0x46')],{'include':[{'model':db['FreshdeskField'],'as':_0x0d11('0x4e')},{'model':db['FreshdeskField'],'as':_0x0d11('0x52')}]});}return null;})[_0x0d11('0x22')](respondWithResult(_0x32d692,null))[_0x0d11('0x41')](handleError(_0x32d692,null));};exports[_0x0d11('0x53')]=function(_0x20c1fd,_0x42b607,_0x2c1405){var _0xae4f5e='';return db[_0x0d11('0x2a')][_0x0d11('0x4c')]({'where':{'id':_0x20c1fd[_0x0d11('0x47')]['id']},'attributes':['id',_0x0d11('0x54'),_0x0d11('0x55')]})['then'](handleEntityNotFound(_0x42b607,null))[_0x0d11('0x22')](function(_0x80bf7f){if(_0x80bf7f){_0xae4f5e=_0x80bf7f[_0x0d11('0x54')];var _0x64443b=_0xae4f5e[_0x0d11('0x56')](-0x1);if(_0x64443b==='/'){_0xae4f5e=_0xae4f5e[_0x0d11('0x57')](0x0,_0xae4f5e[_0x0d11('0x58')](_0x64443b));}return rp({'method':'GET','uri':util[_0x0d11('0x59')](_0x0d11('0x5a'),_0xae4f5e,_0x0d11('0x5b')),'headers':{'Authorization':util[_0x0d11('0x59')](_0x0d11('0x5c'),new Buffer(util['format'](_0x0d11('0x5d'),_0x80bf7f['apiKey']))[_0x0d11('0x5e')](_0x0d11('0x5f')))},'json':!![]});}})['then'](function(_0x2b2f61){if(_0x2b2f61){var _0x835fed=[_0x0d11('0x60'),_0x0d11('0x61'),_0x0d11('0x62'),_0x0d11('0x63'),'status',_0x0d11('0x64'),_0x0d11('0x65'),_0x0d11('0x66'),_0x0d11('0x67'),'group',_0x0d11('0x68')];_[_0x0d11('0x69')](_0x2b2f61,function(_0x3c5f72){return _0x835fed[_0x0d11('0x6a')](_0x3c5f72[_0x0d11('0x26')])||!_0x3c5f72[_0x0d11('0x6b')]&&_0x3c5f72[_0x0d11('0x2d')]!==_0x0d11('0x6c')&&_0x3c5f72[_0x0d11('0x2d')]!==_0x0d11('0x6d');});return{'count':_0x2b2f61[_0x0d11('0x35')],'rows':_[_0x0d11('0x29')](_0x2b2f61,function(_0x38e17d){return{'id':_0x38e17d[_0x0d11('0x26')],'name':_0x38e17d[_0x0d11('0x6e')],'custom':!_0x38e17d[_0x0d11('0x6b')],'options':_0x38e17d[_0x0d11('0x6f')]?_[_0x0d11('0x29')](_0x38e17d[_0x0d11('0x6f')],function(_0x5e18a8){return{'name':_[_0x0d11('0x70')](_0x5e18a8),'value':_0x5e18a8};}):[]};})};}})[_0x0d11('0x22')](respondWithResult(_0x42b607,null))[_0x0d11('0x41')](function(_0xfb2187){var _0x3f3edc=_0x20c1fd['query'][_0x0d11('0x71')]?0x1f4:_0xfb2187[_0x0d11('0x72')]||0x1f4;logger[_0x0d11('0x25')](_0x0d11('0x73'),_0x0d11('0x53'),_0x3f3edc,JSON['stringify'](_0xfb2187));delete _0xfb2187[_0x0d11('0x26')];if(_0x3f3edc===0x191){_0x3f3edc=0x190;}_0x42b607[_0x0d11('0x17')](_0x3f3edc)[_0x0d11('0x27')](_0x20c1fd[_0x0d11('0x2f')][_0x0d11('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0xfb2187[_0x0d11('0x72')]}:_0xfb2187);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 29706ab..994912f 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 _0x19a7=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x5af42a,_0x50e309){var _0xac6855=function(_0x3b7de1){while(--_0x3b7de1){_0x5af42a['push'](_0x5af42a['shift']());}};_0xac6855(++_0x50e309);}(_0x19a7,0x193));var _0x719a=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x19a7[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x719a('0x0'));var util=require(_0x719a('0x1'));var logger=require(_0x719a('0x2'))(_0x719a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x719a('0x4'));var fs=require('fs');var path=require(_0x719a('0x5'));var rimraf=require(_0x719a('0x6'));var config=require(_0x719a('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x719a('0x8'));module['exports']=function(_0xb8ef64,_0x21e341){return _0xb8ef64[_0x719a('0x9')]('FreshdeskAccount',attributes,{'tableName':_0x719a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab90=['request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment'];(function(_0x28da4d,_0x3acb9f){var _0xefeea3=function(_0x36c022){while(--_0x36c022){_0x28da4d['push'](_0x28da4d['shift']());}};_0xefeea3(++_0x3acb9f);}(_0xab90,0x64));var _0x0ab9=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xab90[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x0ab9('0x0'));var util=require(_0x0ab9('0x1'));var logger=require(_0x0ab9('0x2'))('api');var moment=require(_0x0ab9('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ab9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ab9('0x5'));var config=require(_0x0ab9('0x6'));var attributes=require(_0x0ab9('0x7'));var integrations=require(_0x0ab9('0x8'));module[_0x0ab9('0x9')]=function(_0xd3d1d6,_0x184bfa){return _0xd3d1d6[_0x0ab9('0xa')](_0x0ab9('0xb'),attributes,{'tableName':_0x0ab9('0xc'),'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 b3a94b4..fad5f09 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 _0x853b=['GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x853b,0x161));var _0xb853=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x853b[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xb853('0x0'));var util=require(_0xb853('0x1'));var moment=require(_0xb853('0x2'));var BPromise=require(_0xb853('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb853('0x4'));var db=require(_0xb853('0x5'))['db'];var utils=require(_0xb853('0x6'));var logger=require(_0xb853('0x7'))('rpc');var config=require(_0xb853('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb853('0x9')][_0xb853('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x366778,_0x25e378,_0x329281){return new BPromise(function(_0x5b4822,_0xc12761){return client[_0xb853('0xb')](_0x366778,_0x329281)[_0xb853('0xc')](function(_0x435d10){logger[_0xb853('0xd')](_0xb853('0xe'),_0x25e378,'request\x20sent');logger[_0xb853('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x25e378,'request\x20sent',JSON[_0xb853('0x10')](_0x435d10));if(_0x435d10[_0xb853('0x11')]){if(_0x435d10[_0xb853('0x11')]['code']===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x25e378,_0x435d10[_0xb853('0x11')][_0xb853('0x12')]);return _0xc12761(_0x435d10['error'][_0xb853('0x12')]);}logger[_0xb853('0x11')](_0xb853('0xe'),_0x25e378,_0x435d10[_0xb853('0x11')]['message']);return _0x5b4822(_0x435d10['error']['message']);}else{logger['info'](_0xb853('0xe'),_0x25e378,_0xb853('0x13'));_0x5b4822(_0x435d10[_0xb853('0x14')][_0xb853('0x12')]);}})[_0xb853('0x15')](function(_0x5537f2){logger[_0xb853('0x11')](_0xb853('0xe'),_0x25e378,_0x5537f2);_0xc12761(_0x5537f2);});});}exports['GetFreshdeskAccount']=function(_0x1029c3){var _0x39b148=this;return new Promise(function(_0x52c5d1,_0x1f80c4){return db[_0xb853('0x16')][_0xb853('0x17')]({'raw':_0x1029c3[_0xb853('0x18')]?_0x1029c3['options'][_0xb853('0x19')]===undefined?!![]:![]:!![],'where':_0x1029c3['options']?_0x1029c3[_0xb853('0x18')][_0xb853('0x1a')]||null:null,'attributes':_0x1029c3[_0xb853('0x18')]?_0x1029c3[_0xb853('0x18')][_0xb853('0x1b')]||null:null,'limit':_0x1029c3['options']?_0x1029c3[_0xb853('0x18')][_0xb853('0x1c')]||null:null,'include':_0x1029c3['options']?_0x1029c3[_0xb853('0x18')][_0xb853('0x1d')]?_['map'](_0x1029c3[_0xb853('0x18')][_0xb853('0x1d')],function(_0xf79c){return{'model':db[_0xf79c[_0xb853('0x1e')]],'as':_0xf79c['as'],'attributes':_0xf79c['attributes'],'include':_0xf79c[_0xb853('0x1d')]?_[_0xb853('0x1f')](_0xf79c['include'],function(_0x17b247){return{'model':db[_0x17b247['model']],'as':_0x17b247['as'],'attributes':_0x17b247['attributes'],'include':_0x17b247[_0xb853('0x1d')]?_[_0xb853('0x1f')](_0x17b247['include'],function(_0x33700e){return{'model':db[_0x33700e[_0xb853('0x1e')]],'as':_0x33700e['as'],'attributes':_0x33700e[_0xb853('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5cbf){logger[_0xb853('0xd')](_0xb853('0x20'),_0x1029c3);logger[_0xb853('0xf')](_0xb853('0x20'),_0x1029c3,JSON['stringify'](_0x4e5cbf));_0x52c5d1(_0x4e5cbf);})[_0xb853('0x15')](function(_0x242e82){logger[_0xb853('0x11')](_0xb853('0x20'),_0x242e82[_0xb853('0x12')],_0x1029c3);_0x1f80c4(_0x39b148['error'](0x1f4,_0x242e82[_0xb853('0x12')]));});});};exports[_0xb853('0x21')]=function(_0x1abeee){var _0x440f79=this;return new Promise(function(_0x40564a,_0x46ae06){return db[_0xb853('0x16')][_0xb853('0x22')]({'raw':_0x1abeee[_0xb853('0x18')]?_0x1abeee[_0xb853('0x18')][_0xb853('0x19')]===undefined?!![]:![]:!![],'where':_0x1abeee[_0xb853('0x18')]?_0x1abeee[_0xb853('0x18')][_0xb853('0x1a')]||null:null,'attributes':_0x1abeee['options']?_0x1abeee[_0xb853('0x18')][_0xb853('0x1b')]||null:null,'include':_0x1abeee[_0xb853('0x18')]?_0x1abeee['options'][_0xb853('0x1d')]?_[_0xb853('0x1f')](_0x1abeee[_0xb853('0x18')][_0xb853('0x1d')],function(_0x31177f){return{'model':db[_0x31177f['model']],'as':_0x31177f['as'],'attributes':_0x31177f['attributes'],'include':_0x31177f[_0xb853('0x1d')]?_[_0xb853('0x1f')](_0x31177f['include'],function(_0x5da736){return{'model':db[_0x5da736[_0xb853('0x1e')]],'as':_0x5da736['as'],'attributes':_0x5da736[_0xb853('0x1b')],'include':_0x5da736[_0xb853('0x1d')]?_[_0xb853('0x1f')](_0x5da736[_0xb853('0x1d')],function(_0x482a4a){return{'model':db[_0x482a4a[_0xb853('0x1e')]],'as':_0x482a4a['as'],'attributes':_0x482a4a[_0xb853('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb853('0xc')](function(_0x54fd0e){logger[_0xb853('0xd')]('ShowFreshdeskAccount',_0x1abeee);logger['debug'](_0xb853('0x21'),_0x1abeee,JSON[_0xb853('0x10')](_0x54fd0e));_0x40564a(_0x54fd0e);})[_0xb853('0x15')](function(_0x30d89f){logger[_0xb853('0x11')]('ShowFreshdeskAccount',_0x30d89f['message'],_0x1abeee);_0x46ae06(_0x440f79['error'](0x1f4,_0x30d89f[_0xb853('0x12')]));});});}; \ No newline at end of file +var _0x79ea=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x79ea,0x107));var _0xa79e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x79ea[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xa79e('0x0'));var util=require(_0xa79e('0x1'));var moment=require(_0xa79e('0x2'));var BPromise=require('bluebird');var rs=require(_0xa79e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa79e('0x4'))['db'];var utils=require(_0xa79e('0x5'));var logger=require(_0xa79e('0x6'))('rpc');var config=require(_0xa79e('0x7'));var jayson=require(_0xa79e('0x8'));var client=jayson[_0xa79e('0x9')][_0xa79e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cfaec,_0xc24c2e,_0x5d08f7){return new BPromise(function(_0x6da002,_0x38ffa0){return client[_0xa79e('0xb')](_0x4cfaec,_0x5d08f7)[_0xa79e('0xc')](function(_0x5d8446){logger[_0xa79e('0xd')](_0xa79e('0xe'),_0xc24c2e,_0xa79e('0xf'));logger[_0xa79e('0x10')](_0xa79e('0x11'),_0xc24c2e,_0xa79e('0xf'),JSON[_0xa79e('0x12')](_0x5d8446));if(_0x5d8446[_0xa79e('0x13')]){if(_0x5d8446[_0xa79e('0x13')]['code']===0x1f4){logger[_0xa79e('0x13')](_0xa79e('0xe'),_0xc24c2e,_0x5d8446[_0xa79e('0x13')]['message']);return _0x38ffa0(_0x5d8446['error'][_0xa79e('0x14')]);}logger[_0xa79e('0x13')](_0xa79e('0xe'),_0xc24c2e,_0x5d8446[_0xa79e('0x13')][_0xa79e('0x14')]);return _0x6da002(_0x5d8446[_0xa79e('0x13')][_0xa79e('0x14')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0xc24c2e,_0xa79e('0xf'));_0x6da002(_0x5d8446[_0xa79e('0x15')]['message']);}})[_0xa79e('0x16')](function(_0x23f6f1){logger[_0xa79e('0x13')](_0xa79e('0xe'),_0xc24c2e,_0x23f6f1);_0x38ffa0(_0x23f6f1);});});}exports[_0xa79e('0x17')]=function(_0x1c3174){var _0x1c5866=this;return new Promise(function(_0x5a2651,_0x525a9f){return db[_0xa79e('0x18')]['findAll']({'raw':_0x1c3174[_0xa79e('0x19')]?_0x1c3174[_0xa79e('0x19')][_0xa79e('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c3174[_0xa79e('0x19')]?_0x1c3174[_0xa79e('0x19')][_0xa79e('0x1b')]||null:null,'attributes':_0x1c3174[_0xa79e('0x19')]?_0x1c3174[_0xa79e('0x19')]['attributes']||null:null,'limit':_0x1c3174[_0xa79e('0x19')]?_0x1c3174['options'][_0xa79e('0x1c')]||null:null,'include':_0x1c3174[_0xa79e('0x19')]?_0x1c3174['options'][_0xa79e('0x1d')]?_[_0xa79e('0x1e')](_0x1c3174[_0xa79e('0x19')][_0xa79e('0x1d')],function(_0x4e55ee){return{'model':db[_0x4e55ee[_0xa79e('0x1f')]],'as':_0x4e55ee['as'],'attributes':_0x4e55ee[_0xa79e('0x20')],'include':_0x4e55ee['include']?_[_0xa79e('0x1e')](_0x4e55ee['include'],function(_0x31c0fd){return{'model':db[_0x31c0fd[_0xa79e('0x1f')]],'as':_0x31c0fd['as'],'attributes':_0x31c0fd[_0xa79e('0x20')],'include':_0x31c0fd[_0xa79e('0x1d')]?_[_0xa79e('0x1e')](_0x31c0fd['include'],function(_0x1f9e77){return{'model':db[_0x1f9e77['model']],'as':_0x1f9e77['as'],'attributes':_0x1f9e77[_0xa79e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa79e('0xc')](function(_0x27647c){logger[_0xa79e('0xd')](_0xa79e('0x17'),_0x1c3174);logger['debug']('GetFreshdeskAccount',_0x1c3174,JSON[_0xa79e('0x12')](_0x27647c));_0x5a2651(_0x27647c);})[_0xa79e('0x16')](function(_0x11ef4f){logger[_0xa79e('0x13')](_0xa79e('0x17'),_0x11ef4f[_0xa79e('0x14')],_0x1c3174);_0x525a9f(_0x1c5866[_0xa79e('0x13')](0x1f4,_0x11ef4f[_0xa79e('0x14')]));});});};exports[_0xa79e('0x21')]=function(_0x4e10d8){var _0x418135=this;return new Promise(function(_0x36a30c,_0x44aad3){return db['FreshdeskAccount'][_0xa79e('0x22')]({'raw':_0x4e10d8[_0xa79e('0x19')]?_0x4e10d8[_0xa79e('0x19')][_0xa79e('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e10d8[_0xa79e('0x19')]?_0x4e10d8[_0xa79e('0x19')][_0xa79e('0x1b')]||null:null,'attributes':_0x4e10d8[_0xa79e('0x19')]?_0x4e10d8[_0xa79e('0x19')][_0xa79e('0x20')]||null:null,'include':_0x4e10d8[_0xa79e('0x19')]?_0x4e10d8[_0xa79e('0x19')][_0xa79e('0x1d')]?_[_0xa79e('0x1e')](_0x4e10d8['options']['include'],function(_0x49b664){return{'model':db[_0x49b664[_0xa79e('0x1f')]],'as':_0x49b664['as'],'attributes':_0x49b664[_0xa79e('0x20')],'include':_0x49b664[_0xa79e('0x1d')]?_[_0xa79e('0x1e')](_0x49b664['include'],function(_0x29e1f3){return{'model':db[_0x29e1f3['model']],'as':_0x29e1f3['as'],'attributes':_0x29e1f3[_0xa79e('0x20')],'include':_0x29e1f3[_0xa79e('0x1d')]?_[_0xa79e('0x1e')](_0x29e1f3[_0xa79e('0x1d')],function(_0xccd887){return{'model':db[_0xccd887['model']],'as':_0xccd887['as'],'attributes':_0xccd887['attributes']};}):[]};}):[]};}):[]:[]})[_0xa79e('0xc')](function(_0xa4fccb){logger[_0xa79e('0xd')](_0xa79e('0x21'),_0x4e10d8);logger['debug'](_0xa79e('0x21'),_0x4e10d8,JSON[_0xa79e('0x12')](_0xa4fccb));_0x36a30c(_0xa4fccb);})[_0xa79e('0x16')](function(_0x252c34){logger['error'](_0xa79e('0x21'),_0x252c34[_0xa79e('0x14')],_0x4e10d8);_0x44aad3(_0x418135[_0xa79e('0x13')](0x1f4,_0x252c34[_0xa79e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d60d019..cf3fde6 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 _0xa1e0=['setTags','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create'];(function(_0x13a803,_0x23d741){var _0x41c50b=function(_0x5e4595){while(--_0x5e4595){_0x13a803['push'](_0x13a803['shift']());}};_0x41c50b(++_0x23d741);}(_0xa1e0,0xed));var _0x0a1e=function(_0x118564,_0x1384fb){_0x118564=_0x118564-0x0;var _0x43f57d=_0xa1e0[_0x118564];return _0x43f57d;};'use strict';var multer=require(_0x0a1e('0x0'));var util=require(_0x0a1e('0x1'));var path=require(_0x0a1e('0x2'));var timeout=require(_0x0a1e('0x3'));var express=require(_0x0a1e('0x4'));var router=express[_0x0a1e('0x5')]();var fs_extra=require(_0x0a1e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0a1e('0x7'));var config=require(_0x0a1e('0x8'));var controller=require(_0x0a1e('0x9'));router['get']('/',auth[_0x0a1e('0xa')](),controller[_0x0a1e('0xb')]);router[_0x0a1e('0xc')](_0x0a1e('0xd'),auth[_0x0a1e('0xa')](),controller[_0x0a1e('0xe')]);router[_0x0a1e('0xc')](_0x0a1e('0xf'),auth[_0x0a1e('0xa')](),controller[_0x0a1e('0x10')]);router[_0x0a1e('0xc')](_0x0a1e('0x11'),auth[_0x0a1e('0xa')](),controller[_0x0a1e('0x12')]);router[_0x0a1e('0xc')](_0x0a1e('0x13'),auth['isAuthenticated'](),controller[_0x0a1e('0x14')]);router[_0x0a1e('0xc')](_0x0a1e('0x15'),auth[_0x0a1e('0xa')](),controller['getTags']);router[_0x0a1e('0x16')]('/',auth[_0x0a1e('0xa')](),controller[_0x0a1e('0x17')]);router[_0x0a1e('0x16')]('/:id/tags',auth[_0x0a1e('0xa')](),controller[_0x0a1e('0x18')]);router['put'](_0x0a1e('0xd'),auth[_0x0a1e('0xa')](),controller[_0x0a1e('0x19')]);router[_0x0a1e('0x1a')]('/:id',auth[_0x0a1e('0xa')](),controller[_0x0a1e('0x1b')]);module[_0x0a1e('0x1c')]=router; \ No newline at end of file +var _0xca37=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create','/:id/tags','setTags','put','delete','destroy'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0xca37,0xc8));var _0x7ca3=function(_0x5697bf,_0x21f090){_0x5697bf=_0x5697bf-0x0;var _0x77db32=_0xca37[_0x5697bf];return _0x77db32;};'use strict';var multer=require('multer');var util=require(_0x7ca3('0x0'));var path=require(_0x7ca3('0x1'));var timeout=require(_0x7ca3('0x2'));var express=require(_0x7ca3('0x3'));var router=express[_0x7ca3('0x4')]();var fs_extra=require(_0x7ca3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7ca3('0x6'));var config=require(_0x7ca3('0x7'));var controller=require(_0x7ca3('0x8'));router[_0x7ca3('0x9')]('/',auth[_0x7ca3('0xa')](),controller[_0x7ca3('0xb')]);router[_0x7ca3('0x9')](_0x7ca3('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7ca3('0xd'),auth[_0x7ca3('0xa')](),controller['getFields']);router[_0x7ca3('0x9')](_0x7ca3('0xe'),auth['isAuthenticated'](),controller[_0x7ca3('0xf')]);router[_0x7ca3('0x9')]('/:id/descriptions',auth[_0x7ca3('0xa')](),controller[_0x7ca3('0x10')]);router[_0x7ca3('0x9')]('/:id/tags',auth[_0x7ca3('0xa')](),controller[_0x7ca3('0x11')]);router[_0x7ca3('0x12')]('/',auth['isAuthenticated'](),controller[_0x7ca3('0x13')]);router['post'](_0x7ca3('0x14'),auth['isAuthenticated'](),controller[_0x7ca3('0x15')]);router[_0x7ca3('0x16')](_0x7ca3('0xc'),auth[_0x7ca3('0xa')](),controller['update']);router[_0x7ca3('0x17')](_0x7ca3('0xc'),auth[_0x7ca3('0xa')](),controller[_0x7ca3('0x18')]);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 fc482f1..aa51e65 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 _0x0939=['exports','STRING','sequelize'];(function(_0x1f66d9,_0x200af0){var _0x49fc47=function(_0x2d975b){while(--_0x2d975b){_0x1f66d9['push'](_0x1f66d9['shift']());}};_0x49fc47(++_0x200af0);}(_0x0939,0x68));var _0x9093=function(_0x12ff1e,_0x25d053){_0x12ff1e=_0x12ff1e-0x0;var _0x54d598=_0x0939[_0x12ff1e];return _0x54d598;};'use strict';var Sequelize=require(_0x9093('0x0'));module[_0x9093('0x1')]={'name':{'type':Sequelize[_0x9093('0x2')]},'description':{'type':Sequelize[_0x9093('0x2')]}}; \ No newline at end of file +var _0xeaf8=['exports','STRING','sequelize'];(function(_0x1f644c,_0x23e365){var _0xe41c58=function(_0x3217bc){while(--_0x3217bc){_0x1f644c['push'](_0x1f644c['shift']());}};_0xe41c58(++_0x23e365);}(_0xeaf8,0x1cd));var _0x8eaf=function(_0x1f6c5f,_0x59e489){_0x1f6c5f=_0x1f6c5f-0x0;var _0x2e0412=_0xeaf8[_0x1f6c5f];return _0x2e0412;};'use strict';var Sequelize=require(_0x8eaf('0x0'));module[_0x8eaf('0x1')]={'name':{'type':Sequelize[_0x8eaf('0x2')]},'description':{'type':Sequelize[_0x8eaf('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d8d4564..12c2875 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 _0x5785=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','FreshdeskConfiguration','findAll','rows','show','params','keys','includeAll','include','find','catch','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5785,0x1b6));var _0x5578=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x5785[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5578('0x0'));var zipdir=require(_0x5578('0x1'));var jsonpatch=require(_0x5578('0x2'));var rp=require(_0x5578('0x3'));var moment=require(_0x5578('0x4'));var BPromise=require(_0x5578('0x5'));var Mustache=require(_0x5578('0x6'));var util=require(_0x5578('0x7'));var path=require(_0x5578('0x8'));var sox=require(_0x5578('0x9'));var csv=require(_0x5578('0xa'));var ejs=require(_0x5578('0xb'));var fs=require('fs');var fs_extra=require(_0x5578('0xc'));var _=require('lodash');var squel=require(_0x5578('0xd'));var crypto=require(_0x5578('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5578('0xf'));var toCsv=require(_0x5578('0xa'));var querystring=require(_0x5578('0x10'));var Papa=require(_0x5578('0x11'));var Redis=require(_0x5578('0x12'));var authService=require(_0x5578('0x13'));var qs=require(_0x5578('0x14'));var as=require(_0x5578('0x15'));var hardwareService=require(_0x5578('0x16'));var logger=require(_0x5578('0x17'))(_0x5578('0x18'));var utils=require(_0x5578('0x19'));var config=require(_0x5578('0x1a'));var licenseUtil=require(_0x5578('0x1b'));var db=require(_0x5578('0x1c'))['db'];function respondWithStatusCode(_0x459c10,_0x369d86){_0x369d86=_0x369d86||0xcc;return function(_0x241735){if(_0x241735){return _0x459c10[_0x5578('0x1d')](_0x369d86);}return _0x459c10[_0x5578('0x1e')](_0x369d86)[_0x5578('0x1f')]();};}function respondWithResult(_0x5d0a7b,_0x179ae5){_0x179ae5=_0x179ae5||0xc8;return function(_0x4edb05){if(_0x4edb05){return _0x5d0a7b[_0x5578('0x1e')](_0x179ae5)['json'](_0x4edb05);}};}function respondWithFilteredResult(_0x4021f2,_0x29dd1d){return function(_0x3604ca){if(_0x3604ca){var _0x190f59=typeof _0x29dd1d[_0x5578('0x20')]==='undefined'&&typeof _0x29dd1d['limit']===_0x5578('0x21');var _0xc9bce7=_0x3604ca['count'];var _0x442881=_0x190f59?0x0:_0x29dd1d[_0x5578('0x20')];var _0x1dae79=_0x190f59?_0x3604ca[_0x5578('0x22')]:_0x29dd1d['offset']+_0x29dd1d[_0x5578('0x23')];var _0x5aecfd;if(_0x1dae79>=_0xc9bce7){_0x1dae79=_0xc9bce7;_0x5aecfd=0xc8;}else{_0x5aecfd=0xce;}_0x4021f2[_0x5578('0x1e')](_0x5aecfd);return _0x4021f2[_0x5578('0x24')]('Content-Range',_0x442881+'-'+_0x1dae79+'/'+_0xc9bce7)['json'](_0x3604ca);}return null;};}function patchUpdates(_0x2f67d2){return function(_0x3b005e){try{jsonpatch[_0x5578('0x25')](_0x3b005e,_0x2f67d2,!![]);}catch(_0x599c13){return BPromise['reject'](_0x599c13);}return _0x3b005e[_0x5578('0x26')]();};}function saveUpdates(_0x15d253,_0x2d554f){return function(_0x3314db){if(_0x3314db){return _0x3314db[_0x5578('0x27')](_0x15d253)[_0x5578('0x28')](function(_0x3b46ab){return _0x3b46ab;});}return null;};}function removeEntity(_0x59718e,_0x185ffb){return function(_0x36878c){if(_0x36878c){return _0x36878c[_0x5578('0x29')]()[_0x5578('0x28')](function(){_0x59718e[_0x5578('0x1e')](0xcc)[_0x5578('0x1f')]();});}};}function handleEntityNotFound(_0x21eb03,_0x530ed7){return function(_0x133ddd){if(!_0x133ddd){_0x21eb03[_0x5578('0x1d')](0x194);}return _0x133ddd;};}function handleError(_0xf66446,_0x521f15){_0x521f15=_0x521f15||0x1f4;return function(_0x41c73e){logger[_0x5578('0x2a')](_0x41c73e[_0x5578('0x2b')]);if(_0x41c73e[_0x5578('0x2c')]){delete _0x41c73e[_0x5578('0x2c')];}_0xf66446['status'](_0x521f15)[_0x5578('0x2d')](_0x41c73e);};}exports[_0x5578('0x2e')]=function(_0x290d8d,_0x19cf65){var _0x19cfd0={},_0x196bdc={},_0x5bc525={'count':0x0,'rows':[]};var _0x4e7e02=_[_0x5578('0x2f')](db['FreshdeskConfiguration'][_0x5578('0x30')],function(_0x10abcc){return{'name':_0x10abcc[_0x5578('0x31')],'type':_0x10abcc['type'][_0x5578('0x32')]};});_0x196bdc[_0x5578('0x33')]=_[_0x5578('0x2f')](_0x4e7e02,_0x5578('0x2c'));_0x196bdc['query']=_['keys'](_0x290d8d[_0x5578('0x34')]);_0x196bdc[_0x5578('0x35')]=_[_0x5578('0x36')](_0x196bdc['model'],_0x196bdc[_0x5578('0x34')]);_0x19cfd0['attributes']=_['intersection'](_0x196bdc[_0x5578('0x33')],qs[_0x5578('0x37')](_0x290d8d['query'][_0x5578('0x37')]));_0x19cfd0['attributes']=_0x19cfd0[_0x5578('0x38')][_0x5578('0x39')]?_0x19cfd0[_0x5578('0x38')]:_0x196bdc[_0x5578('0x33')];if(!_0x290d8d[_0x5578('0x34')][_0x5578('0x3a')](_0x5578('0x3b'))){_0x19cfd0[_0x5578('0x23')]=qs['limit'](_0x290d8d[_0x5578('0x34')][_0x5578('0x23')]);_0x19cfd0[_0x5578('0x20')]=qs[_0x5578('0x20')](_0x290d8d[_0x5578('0x34')]['offset']);}_0x19cfd0[_0x5578('0x3c')]=qs[_0x5578('0x3d')](_0x290d8d['query']['sort']);_0x19cfd0['where']=qs[_0x5578('0x35')](_[_0x5578('0x3e')](_0x290d8d[_0x5578('0x34')],_0x196bdc[_0x5578('0x35')]),_0x4e7e02);if(_0x290d8d[_0x5578('0x34')][_0x5578('0x3f')]){_0x19cfd0[_0x5578('0x40')]=_[_0x5578('0x41')](_0x19cfd0[_0x5578('0x40')],{'$or':_['map'](_0x4e7e02,function(_0x48f13b){if(_0x48f13b[_0x5578('0x42')]!==_0x5578('0x43')){var _0x4fe282={};_0x4fe282[_0x48f13b[_0x5578('0x2c')]]={'$like':'%'+_0x290d8d[_0x5578('0x34')]['filter']+'%'};return _0x4fe282;}})});}_0x19cfd0=_[_0x5578('0x41')]({},_0x19cfd0,_0x290d8d[_0x5578('0x44')]);var _0x451353={'where':_0x19cfd0[_0x5578('0x40')]};return db['FreshdeskConfiguration'][_0x5578('0x22')](_0x451353)[_0x5578('0x28')](function(_0x26115a){_0x5bc525[_0x5578('0x22')]=_0x26115a;if(_0x290d8d[_0x5578('0x34')]['includeAll']){_0x19cfd0['include']=[{'all':!![]}];}return db[_0x5578('0x45')][_0x5578('0x46')](_0x19cfd0);})[_0x5578('0x28')](function(_0x2b60e6){_0x5bc525[_0x5578('0x47')]=_0x2b60e6;return _0x5bc525;})[_0x5578('0x28')](respondWithFilteredResult(_0x19cf65,_0x19cfd0))['catch'](handleError(_0x19cf65,null));};exports[_0x5578('0x48')]=function(_0x8f2d9,_0x1d1da0){var _0x302cc8={'raw':![],'where':{'id':_0x8f2d9[_0x5578('0x49')]['id']}},_0x2345f6={};_0x2345f6['model']=_[_0x5578('0x4a')](db[_0x5578('0x45')]['rawAttributes']);_0x2345f6['query']=_['keys'](_0x8f2d9['query']);_0x2345f6[_0x5578('0x35')]=_['intersection'](_0x2345f6[_0x5578('0x33')],_0x2345f6[_0x5578('0x34')]);_0x302cc8[_0x5578('0x38')]=_[_0x5578('0x36')](_0x2345f6[_0x5578('0x33')],qs[_0x5578('0x37')](_0x8f2d9[_0x5578('0x34')]['fields']));_0x302cc8[_0x5578('0x38')]=_0x302cc8['attributes'][_0x5578('0x39')]?_0x302cc8[_0x5578('0x38')]:_0x2345f6[_0x5578('0x33')];if(_0x8f2d9['query'][_0x5578('0x4b')]){_0x302cc8[_0x5578('0x4c')]=[{'all':!![]}];}_0x302cc8=_[_0x5578('0x41')]({},_0x302cc8,_0x8f2d9[_0x5578('0x44')]);return db[_0x5578('0x45')][_0x5578('0x4d')](_0x302cc8)[_0x5578('0x28')](handleEntityNotFound(_0x1d1da0,null))[_0x5578('0x28')](respondWithResult(_0x1d1da0,null))[_0x5578('0x4e')](handleError(_0x1d1da0,null));};exports[_0x5578('0x4f')]=function(_0x2e010e,_0x5068e5){return db[_0x5578('0x45')][_0x5578('0x4f')](_0x2e010e[_0x5578('0x50')],{})[_0x5578('0x28')](respondWithResult(_0x5068e5,0xc9))[_0x5578('0x4e')](handleError(_0x5068e5,null));};exports[_0x5578('0x27')]=function(_0x53eff6,_0x5f4ad6){if(_0x53eff6[_0x5578('0x50')]['id']){delete _0x53eff6[_0x5578('0x50')]['id'];}return db['FreshdeskConfiguration'][_0x5578('0x4d')]({'where':{'id':_0x53eff6['params']['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x5f4ad6,null))[_0x5578('0x28')](saveUpdates(_0x53eff6[_0x5578('0x50')],null))[_0x5578('0x28')](respondWithResult(_0x5f4ad6,null))['catch'](handleError(_0x5f4ad6,null));};exports[_0x5578('0x29')]=function(_0x5e210c,_0x2af644){return db[_0x5578('0x45')][_0x5578('0x4d')]({'where':{'id':_0x5e210c[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x2af644,null))['then'](removeEntity(_0x2af644,null))[_0x5578('0x4e')](handleError(_0x2af644,null));};exports[_0x5578('0x51')]=function(_0x248e10,_0x2b5d74,_0x143a70){var _0x5d90e0={};var _0x3a3d84={};var _0x5b9d0e;var _0x174797;return db[_0x5578('0x45')][_0x5578('0x52')]({'where':{'id':_0x248e10['params']['id']}})['then'](handleEntityNotFound(_0x2b5d74,null))[_0x5578('0x28')](function(_0x30564b){if(_0x30564b){_0x5b9d0e=_0x30564b;_0x3a3d84['model']=_[_0x5578('0x4a')](db[_0x5578('0x53')][_0x5578('0x30')]);_0x3a3d84[_0x5578('0x34')]=_[_0x5578('0x4a')](_0x248e10[_0x5578('0x34')]);_0x3a3d84[_0x5578('0x35')]=_[_0x5578('0x36')](_0x3a3d84[_0x5578('0x33')],_0x3a3d84[_0x5578('0x34')]);_0x5d90e0[_0x5578('0x38')]=_[_0x5578('0x36')](_0x3a3d84[_0x5578('0x33')],qs[_0x5578('0x37')](_0x248e10[_0x5578('0x34')][_0x5578('0x37')]));_0x5d90e0[_0x5578('0x38')]=_0x5d90e0[_0x5578('0x38')][_0x5578('0x39')]?_0x5d90e0['attributes']:_0x3a3d84['model'];_0x5d90e0['order']=qs['sort'](_0x248e10[_0x5578('0x34')][_0x5578('0x3d')]);_0x5d90e0['where']=qs[_0x5578('0x35')](_[_0x5578('0x3e')](_0x248e10[_0x5578('0x34')],_0x3a3d84[_0x5578('0x35')]));if(_0x248e10[_0x5578('0x34')]['filter']){_0x5d90e0[_0x5578('0x40')]=_[_0x5578('0x41')](_0x5d90e0[_0x5578('0x40')],{'$or':_[_0x5578('0x2f')](_0x5d90e0[_0x5578('0x38')],function(_0xf333f7){var _0x5e4aa0={};_0x5e4aa0[_0xf333f7]={'$like':'%'+_0x248e10[_0x5578('0x34')][_0x5578('0x3f')]+'%'};return _0x5e4aa0;})});}_0x5d90e0=_[_0x5578('0x41')]({},_0x5d90e0,_0x248e10[_0x5578('0x44')]);return _0x5b9d0e[_0x5578('0x51')](_0x5d90e0);}})[_0x5578('0x28')](function(_0xd501c3){if(_0xd501c3){_0x174797=_0xd501c3[_0x5578('0x39')];if(!_0x248e10[_0x5578('0x34')]['hasOwnProperty'](_0x5578('0x3b'))){_0x5d90e0['limit']=qs['limit'](_0x248e10[_0x5578('0x34')]['limit']);_0x5d90e0[_0x5578('0x20')]=qs[_0x5578('0x20')](_0x248e10[_0x5578('0x34')][_0x5578('0x20')]);}return _0x5b9d0e[_0x5578('0x51')](_0x5d90e0);}})[_0x5578('0x28')](function(_0x52239e){if(_0x52239e){return _0x52239e?{'count':_0x174797,'rows':_0x52239e}:null;}})[_0x5578('0x28')](respondWithResult(_0x2b5d74,null))[_0x5578('0x4e')](handleError(_0x2b5d74,null));};exports[_0x5578('0x54')]=function(_0x5bf8e9,_0x4006b4,_0x2e7850){var _0x494f6b={};var _0x121214={};var _0x2d8dc4;var _0x3f3e2c;return db[_0x5578('0x45')][_0x5578('0x52')]({'where':{'id':_0x5bf8e9[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x4006b4,null))[_0x5578('0x28')](function(_0x1f8d05){if(_0x1f8d05){_0x2d8dc4=_0x1f8d05;_0x121214[_0x5578('0x33')]=_[_0x5578('0x4a')](db[_0x5578('0x53')][_0x5578('0x30')]);_0x121214[_0x5578('0x34')]=_[_0x5578('0x4a')](_0x5bf8e9[_0x5578('0x34')]);_0x121214[_0x5578('0x35')]=_[_0x5578('0x36')](_0x121214['model'],_0x121214[_0x5578('0x34')]);_0x494f6b[_0x5578('0x38')]=_['intersection'](_0x121214[_0x5578('0x33')],qs[_0x5578('0x37')](_0x5bf8e9[_0x5578('0x34')][_0x5578('0x37')]));_0x494f6b[_0x5578('0x38')]=_0x494f6b[_0x5578('0x38')][_0x5578('0x39')]?_0x494f6b[_0x5578('0x38')]:_0x121214[_0x5578('0x33')];_0x494f6b[_0x5578('0x3c')]=qs[_0x5578('0x3d')](_0x5bf8e9[_0x5578('0x34')][_0x5578('0x3d')]);_0x494f6b['where']=qs[_0x5578('0x35')](_[_0x5578('0x3e')](_0x5bf8e9[_0x5578('0x34')],_0x121214[_0x5578('0x35')]));if(_0x5bf8e9[_0x5578('0x34')][_0x5578('0x3f')]){_0x494f6b[_0x5578('0x40')]=_[_0x5578('0x41')](_0x494f6b[_0x5578('0x40')],{'$or':_[_0x5578('0x2f')](_0x494f6b[_0x5578('0x38')],function(_0x444b2a){var _0x5c4845={};_0x5c4845[_0x444b2a]={'$like':'%'+_0x5bf8e9['query'][_0x5578('0x3f')]+'%'};return _0x5c4845;})});}_0x494f6b=_['merge']({},_0x494f6b,_0x5bf8e9[_0x5578('0x44')]);return _0x2d8dc4['getSubjects'](_0x494f6b);}})['then'](function(_0x1aadc9){if(_0x1aadc9){_0x3f3e2c=_0x1aadc9[_0x5578('0x39')];if(!_0x5bf8e9[_0x5578('0x34')][_0x5578('0x3a')](_0x5578('0x3b'))){_0x494f6b['limit']=qs[_0x5578('0x23')](_0x5bf8e9[_0x5578('0x34')][_0x5578('0x23')]);_0x494f6b[_0x5578('0x20')]=qs[_0x5578('0x20')](_0x5bf8e9['query'][_0x5578('0x20')]);}return _0x2d8dc4[_0x5578('0x54')](_0x494f6b);}})['then'](function(_0x1a02a5){if(_0x1a02a5){return _0x1a02a5?{'count':_0x3f3e2c,'rows':_0x1a02a5}:null;}})['then'](respondWithResult(_0x4006b4,null))[_0x5578('0x4e')](handleError(_0x4006b4,null));};exports[_0x5578('0x55')]=function(_0x24d53c,_0x259208,_0x584270){var _0x48019b={};var _0x449739={};var _0xa201f7;var _0x460fdd;return db[_0x5578('0x45')]['findOne']({'where':{'id':_0x24d53c[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x259208,null))[_0x5578('0x28')](function(_0x1384cd){if(_0x1384cd){_0xa201f7=_0x1384cd;_0x449739[_0x5578('0x33')]=_[_0x5578('0x4a')](db['FreshdeskField'][_0x5578('0x30')]);_0x449739[_0x5578('0x34')]=_[_0x5578('0x4a')](_0x24d53c[_0x5578('0x34')]);_0x449739[_0x5578('0x35')]=_[_0x5578('0x36')](_0x449739[_0x5578('0x33')],_0x449739[_0x5578('0x34')]);_0x48019b['attributes']=_['intersection'](_0x449739['model'],qs['fields'](_0x24d53c['query'][_0x5578('0x37')]));_0x48019b[_0x5578('0x38')]=_0x48019b[_0x5578('0x38')]['length']?_0x48019b[_0x5578('0x38')]:_0x449739[_0x5578('0x33')];_0x48019b['order']=qs[_0x5578('0x3d')](_0x24d53c[_0x5578('0x34')][_0x5578('0x3d')]);_0x48019b[_0x5578('0x40')]=qs['filters'](_[_0x5578('0x3e')](_0x24d53c[_0x5578('0x34')],_0x449739[_0x5578('0x35')]));if(_0x24d53c[_0x5578('0x34')]['filter']){_0x48019b[_0x5578('0x40')]=_['merge'](_0x48019b['where'],{'$or':_[_0x5578('0x2f')](_0x48019b[_0x5578('0x38')],function(_0x508a06){var _0x13e3a6={};_0x13e3a6[_0x508a06]={'$like':'%'+_0x24d53c[_0x5578('0x34')][_0x5578('0x3f')]+'%'};return _0x13e3a6;})});}_0x48019b=_[_0x5578('0x41')]({},_0x48019b,_0x24d53c[_0x5578('0x44')]);return _0xa201f7[_0x5578('0x55')](_0x48019b);}})[_0x5578('0x28')](function(_0x5cb4cd){if(_0x5cb4cd){_0x460fdd=_0x5cb4cd['length'];if(!_0x24d53c[_0x5578('0x34')][_0x5578('0x3a')](_0x5578('0x3b'))){_0x48019b[_0x5578('0x23')]=qs[_0x5578('0x23')](_0x24d53c[_0x5578('0x34')][_0x5578('0x23')]);_0x48019b[_0x5578('0x20')]=qs[_0x5578('0x20')](_0x24d53c[_0x5578('0x34')][_0x5578('0x20')]);}return _0xa201f7['getDescriptions'](_0x48019b);}})[_0x5578('0x28')](function(_0x5dfe2f){if(_0x5dfe2f){return _0x5dfe2f?{'count':_0x460fdd,'rows':_0x5dfe2f}:null;}})['then'](respondWithResult(_0x259208,null))[_0x5578('0x4e')](handleError(_0x259208,null));};exports['getTags']=function(_0x36e5df,_0x31ff60,_0x477f86){var _0x39b4f4={};var _0x1f0924={};var _0x817336;var _0x5a5783;return db[_0x5578('0x45')][_0x5578('0x52')]({'where':{'id':_0x36e5df[_0x5578('0x49')]['id']}})['then'](handleEntityNotFound(_0x31ff60,null))[_0x5578('0x28')](function(_0x81b5b9){if(_0x81b5b9){_0x817336=_0x81b5b9;_0x1f0924[_0x5578('0x33')]=_[_0x5578('0x4a')](db['Tag'][_0x5578('0x30')]);_0x1f0924[_0x5578('0x34')]=_[_0x5578('0x4a')](_0x36e5df[_0x5578('0x34')]);_0x1f0924[_0x5578('0x35')]=_[_0x5578('0x36')](_0x1f0924['model'],_0x1f0924[_0x5578('0x34')]);_0x39b4f4['attributes']=_['intersection'](_0x1f0924[_0x5578('0x33')],qs[_0x5578('0x37')](_0x36e5df[_0x5578('0x34')][_0x5578('0x37')]));_0x39b4f4[_0x5578('0x38')]=_0x39b4f4[_0x5578('0x38')][_0x5578('0x39')]?_0x39b4f4[_0x5578('0x38')]:_0x1f0924[_0x5578('0x33')];_0x39b4f4[_0x5578('0x3c')]=qs['sort'](_0x36e5df[_0x5578('0x34')]['sort']);_0x39b4f4[_0x5578('0x40')]=qs['filters'](_[_0x5578('0x3e')](_0x36e5df[_0x5578('0x34')],_0x1f0924[_0x5578('0x35')]));if(_0x36e5df['query'][_0x5578('0x3f')]){_0x39b4f4[_0x5578('0x40')]=_[_0x5578('0x41')](_0x39b4f4[_0x5578('0x40')],{'$or':_[_0x5578('0x2f')](_0x39b4f4[_0x5578('0x38')],function(_0x4284bd){var _0x3af4c7={};_0x3af4c7[_0x4284bd]={'$like':'%'+_0x36e5df[_0x5578('0x34')]['filter']+'%'};return _0x3af4c7;})});}_0x39b4f4=_[_0x5578('0x41')]({},_0x39b4f4,_0x36e5df[_0x5578('0x44')]);return _0x817336[_0x5578('0x56')](_0x39b4f4);}})[_0x5578('0x28')](function(_0x536d0b){if(_0x536d0b){_0x5a5783=_0x536d0b[_0x5578('0x39')];if(!_0x36e5df[_0x5578('0x34')]['hasOwnProperty'](_0x5578('0x3b'))){_0x39b4f4['limit']=qs['limit'](_0x36e5df[_0x5578('0x34')][_0x5578('0x23')]);_0x39b4f4['offset']=qs[_0x5578('0x20')](_0x36e5df[_0x5578('0x34')][_0x5578('0x20')]);}return _0x817336[_0x5578('0x56')](_0x39b4f4);}})[_0x5578('0x28')](function(_0x25f1eb){if(_0x25f1eb){return _0x25f1eb?{'count':_0x5a5783,'rows':_0x25f1eb}:null;}})[_0x5578('0x28')](respondWithResult(_0x31ff60,null))[_0x5578('0x4e')](handleError(_0x31ff60,null));};exports[_0x5578('0x57')]=function(_0xc70268,_0x548f09,_0xb5d68c){if(_0xc70268['body']['id']){delete _0xc70268[_0x5578('0x50')]['id'];}return db[_0x5578('0x45')][_0x5578('0x52')]({'where':{'id':_0xc70268[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x548f09,null))['then'](function(_0x3cda25){if(_0x3cda25){return _0x3cda25[_0x5578('0x57')](_0xc70268[_0x5578('0x50')][_0x5578('0x58')]||[]);}return null;})[_0x5578('0x28')](respondWithResult(_0x548f09,null))[_0x5578('0x4e')](handleError(_0x548f09,null));}; \ No newline at end of file +var _0x5f65=['model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','params','rawAttributes','length','create','body','catch','find','getFields','findOne','FreshdeskField','filter','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key'];(function(_0x1bf245,_0x3f9a86){var _0x5c9733=function(_0x4a0122){while(--_0x4a0122){_0x1bf245['push'](_0x1bf245['shift']());}};_0x5c9733(++_0x3f9a86);}(_0x5f65,0x15f));var _0x55f6=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0x5f65[_0x9cfe28];return _0x54a1d0;};'use strict';var emlformat=require(_0x55f6('0x0'));var rimraf=require(_0x55f6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55f6('0x2'));var rp=require(_0x55f6('0x3'));var moment=require(_0x55f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x55f6('0x5'));var util=require('util');var path=require(_0x55f6('0x6'));var sox=require(_0x55f6('0x7'));var csv=require(_0x55f6('0x8'));var ejs=require(_0x55f6('0x9'));var fs=require('fs');var fs_extra=require(_0x55f6('0xa'));var _=require(_0x55f6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x55f6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x55f6('0x8'));var querystring=require(_0x55f6('0xd'));var Papa=require(_0x55f6('0xe'));var Redis=require(_0x55f6('0xf'));var authService=require(_0x55f6('0x10'));var qs=require(_0x55f6('0x11'));var as=require(_0x55f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x55f6('0x13'));var utils=require(_0x55f6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x55f6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34462c,_0x3a0c0a){_0x3a0c0a=_0x3a0c0a||0xcc;return function(_0x2a7877){if(_0x2a7877){return _0x34462c[_0x55f6('0x16')](_0x3a0c0a);}return _0x34462c[_0x55f6('0x17')](_0x3a0c0a)[_0x55f6('0x18')]();};}function respondWithResult(_0x150341,_0x147a99){_0x147a99=_0x147a99||0xc8;return function(_0x1e394e){if(_0x1e394e){return _0x150341['status'](_0x147a99)['json'](_0x1e394e);}};}function respondWithFilteredResult(_0xc33cb7,_0x3a6e47){return function(_0x408a2c){if(_0x408a2c){var _0x4d021f=typeof _0x3a6e47['offset']==='undefined'&&typeof _0x3a6e47[_0x55f6('0x19')]===_0x55f6('0x1a');var _0x2a98aa=_0x408a2c[_0x55f6('0x1b')];var _0x5e6aac=_0x4d021f?0x0:_0x3a6e47[_0x55f6('0x1c')];var _0x13754b=_0x4d021f?_0x408a2c[_0x55f6('0x1b')]:_0x3a6e47[_0x55f6('0x1c')]+_0x3a6e47['limit'];var _0x535283;if(_0x13754b>=_0x2a98aa){_0x13754b=_0x2a98aa;_0x535283=0xc8;}else{_0x535283=0xce;}_0xc33cb7[_0x55f6('0x17')](_0x535283);return _0xc33cb7['set'](_0x55f6('0x1d'),_0x5e6aac+'-'+_0x13754b+'/'+_0x2a98aa)['json'](_0x408a2c);}return null;};}function patchUpdates(_0x2ed7a4){return function(_0x5c11fb){try{jsonpatch[_0x55f6('0x1e')](_0x5c11fb,_0x2ed7a4,!![]);}catch(_0x1aa60d){return BPromise['reject'](_0x1aa60d);}return _0x5c11fb['save']();};}function saveUpdates(_0x24ca31,_0x580285){return function(_0x2ab473){if(_0x2ab473){return _0x2ab473[_0x55f6('0x1f')](_0x24ca31)[_0x55f6('0x20')](function(_0x155822){return _0x155822;});}return null;};}function removeEntity(_0x441a02,_0x41b69e){return function(_0x1c8989){if(_0x1c8989){return _0x1c8989[_0x55f6('0x21')]()[_0x55f6('0x20')](function(){_0x441a02[_0x55f6('0x17')](0xcc)[_0x55f6('0x18')]();});}};}function handleEntityNotFound(_0x386417,_0x1ca3e4){return function(_0x5497ee){if(!_0x5497ee){_0x386417['sendStatus'](0x194);}return _0x5497ee;};}function handleError(_0x36b18a,_0x30e04a){_0x30e04a=_0x30e04a||0x1f4;return function(_0x5ce87a){logger[_0x55f6('0x22')](_0x5ce87a[_0x55f6('0x23')]);if(_0x5ce87a[_0x55f6('0x24')]){delete _0x5ce87a[_0x55f6('0x24')];}_0x36b18a[_0x55f6('0x17')](_0x30e04a)[_0x55f6('0x25')](_0x5ce87a);};}exports[_0x55f6('0x26')]=function(_0x5b9201,_0x133c01){var _0x1d4274={},_0x406e0b={},_0xe921b7={'count':0x0,'rows':[]};var _0x363f2e=_[_0x55f6('0x27')](db[_0x55f6('0x28')]['rawAttributes'],function(_0x11fd25){return{'name':_0x11fd25[_0x55f6('0x29')],'type':_0x11fd25[_0x55f6('0x2a')][_0x55f6('0x2b')]};});_0x406e0b[_0x55f6('0x2c')]=_[_0x55f6('0x27')](_0x363f2e,_0x55f6('0x24'));_0x406e0b[_0x55f6('0x2d')]=_[_0x55f6('0x2e')](_0x5b9201[_0x55f6('0x2d')]);_0x406e0b[_0x55f6('0x2f')]=_[_0x55f6('0x30')](_0x406e0b['model'],_0x406e0b['query']);_0x1d4274[_0x55f6('0x31')]=_[_0x55f6('0x30')](_0x406e0b[_0x55f6('0x2c')],qs[_0x55f6('0x32')](_0x5b9201[_0x55f6('0x2d')][_0x55f6('0x32')]));_0x1d4274['attributes']=_0x1d4274[_0x55f6('0x31')]['length']?_0x1d4274[_0x55f6('0x31')]:_0x406e0b[_0x55f6('0x2c')];if(!_0x5b9201[_0x55f6('0x2d')][_0x55f6('0x33')](_0x55f6('0x34'))){_0x1d4274['limit']=qs[_0x55f6('0x19')](_0x5b9201['query'][_0x55f6('0x19')]);_0x1d4274['offset']=qs['offset'](_0x5b9201[_0x55f6('0x2d')][_0x55f6('0x1c')]);}_0x1d4274[_0x55f6('0x35')]=qs[_0x55f6('0x36')](_0x5b9201[_0x55f6('0x2d')][_0x55f6('0x36')]);_0x1d4274['where']=qs[_0x55f6('0x2f')](_[_0x55f6('0x37')](_0x5b9201[_0x55f6('0x2d')],_0x406e0b[_0x55f6('0x2f')]),_0x363f2e);if(_0x5b9201['query']['filter']){_0x1d4274[_0x55f6('0x38')]=_[_0x55f6('0x39')](_0x1d4274[_0x55f6('0x38')],{'$or':_[_0x55f6('0x27')](_0x363f2e,function(_0x1221de){if(_0x1221de[_0x55f6('0x2a')]!==_0x55f6('0x3a')){var _0x14828e={};_0x14828e[_0x1221de[_0x55f6('0x24')]]={'$like':'%'+_0x5b9201[_0x55f6('0x2d')]['filter']+'%'};return _0x14828e;}})});}_0x1d4274=_[_0x55f6('0x39')]({},_0x1d4274,_0x5b9201[_0x55f6('0x3b')]);var _0xda3f70={'where':_0x1d4274[_0x55f6('0x38')]};return db[_0x55f6('0x28')][_0x55f6('0x1b')](_0xda3f70)[_0x55f6('0x20')](function(_0x3e4c3d){_0xe921b7['count']=_0x3e4c3d;if(_0x5b9201[_0x55f6('0x2d')]['includeAll']){_0x1d4274[_0x55f6('0x3c')]=[{'all':!![]}];}return db[_0x55f6('0x28')][_0x55f6('0x3d')](_0x1d4274);})[_0x55f6('0x20')](function(_0xd3bc5a){_0xe921b7[_0x55f6('0x3e')]=_0xd3bc5a;return _0xe921b7;})[_0x55f6('0x20')](respondWithFilteredResult(_0x133c01,_0x1d4274))['catch'](handleError(_0x133c01,null));};exports['show']=function(_0x4f13ef,_0x2214ef){var _0x4c982c={'raw':![],'where':{'id':_0x4f13ef[_0x55f6('0x3f')]['id']}},_0x458320={};_0x458320[_0x55f6('0x2c')]=_[_0x55f6('0x2e')](db[_0x55f6('0x28')][_0x55f6('0x40')]);_0x458320[_0x55f6('0x2d')]=_[_0x55f6('0x2e')](_0x4f13ef[_0x55f6('0x2d')]);_0x458320['filters']=_[_0x55f6('0x30')](_0x458320[_0x55f6('0x2c')],_0x458320[_0x55f6('0x2d')]);_0x4c982c['attributes']=_[_0x55f6('0x30')](_0x458320[_0x55f6('0x2c')],qs[_0x55f6('0x32')](_0x4f13ef[_0x55f6('0x2d')][_0x55f6('0x32')]));_0x4c982c[_0x55f6('0x31')]=_0x4c982c['attributes'][_0x55f6('0x41')]?_0x4c982c[_0x55f6('0x31')]:_0x458320['model'];if(_0x4f13ef[_0x55f6('0x2d')]['includeAll']){_0x4c982c[_0x55f6('0x3c')]=[{'all':!![]}];}_0x4c982c=_[_0x55f6('0x39')]({},_0x4c982c,_0x4f13ef[_0x55f6('0x3b')]);return db['FreshdeskConfiguration']['find'](_0x4c982c)[_0x55f6('0x20')](handleEntityNotFound(_0x2214ef,null))[_0x55f6('0x20')](respondWithResult(_0x2214ef,null))['catch'](handleError(_0x2214ef,null));};exports['create']=function(_0xdeee53,_0x2e5c0c){return db[_0x55f6('0x28')][_0x55f6('0x42')](_0xdeee53[_0x55f6('0x43')],{})['then'](respondWithResult(_0x2e5c0c,0xc9))[_0x55f6('0x44')](handleError(_0x2e5c0c,null));};exports[_0x55f6('0x1f')]=function(_0x33b9cb,_0x13fc5b){if(_0x33b9cb[_0x55f6('0x43')]['id']){delete _0x33b9cb[_0x55f6('0x43')]['id'];}return db['FreshdeskConfiguration'][_0x55f6('0x45')]({'where':{'id':_0x33b9cb[_0x55f6('0x3f')]['id']}})[_0x55f6('0x20')](handleEntityNotFound(_0x13fc5b,null))[_0x55f6('0x20')](saveUpdates(_0x33b9cb['body'],null))['then'](respondWithResult(_0x13fc5b,null))['catch'](handleError(_0x13fc5b,null));};exports['destroy']=function(_0x1ddce3,_0x41cc80){return db[_0x55f6('0x28')]['find']({'where':{'id':_0x1ddce3['params']['id']}})[_0x55f6('0x20')](handleEntityNotFound(_0x41cc80,null))[_0x55f6('0x20')](removeEntity(_0x41cc80,null))[_0x55f6('0x44')](handleError(_0x41cc80,null));};exports[_0x55f6('0x46')]=function(_0x12637b,_0x103e5e,_0x1855b2){var _0x2d01ce={};var _0x5a3e30={};var _0x645574;var _0x80dc6d;return db[_0x55f6('0x28')][_0x55f6('0x47')]({'where':{'id':_0x12637b[_0x55f6('0x3f')]['id']}})[_0x55f6('0x20')](handleEntityNotFound(_0x103e5e,null))[_0x55f6('0x20')](function(_0x561251){if(_0x561251){_0x645574=_0x561251;_0x5a3e30[_0x55f6('0x2c')]=_[_0x55f6('0x2e')](db[_0x55f6('0x48')][_0x55f6('0x40')]);_0x5a3e30[_0x55f6('0x2d')]=_[_0x55f6('0x2e')](_0x12637b[_0x55f6('0x2d')]);_0x5a3e30[_0x55f6('0x2f')]=_[_0x55f6('0x30')](_0x5a3e30['model'],_0x5a3e30[_0x55f6('0x2d')]);_0x2d01ce[_0x55f6('0x31')]=_[_0x55f6('0x30')](_0x5a3e30['model'],qs[_0x55f6('0x32')](_0x12637b[_0x55f6('0x2d')][_0x55f6('0x32')]));_0x2d01ce[_0x55f6('0x31')]=_0x2d01ce[_0x55f6('0x31')][_0x55f6('0x41')]?_0x2d01ce[_0x55f6('0x31')]:_0x5a3e30['model'];_0x2d01ce['order']=qs['sort'](_0x12637b[_0x55f6('0x2d')][_0x55f6('0x36')]);_0x2d01ce[_0x55f6('0x38')]=qs['filters'](_[_0x55f6('0x37')](_0x12637b[_0x55f6('0x2d')],_0x5a3e30['filters']));if(_0x12637b[_0x55f6('0x2d')][_0x55f6('0x49')]){_0x2d01ce[_0x55f6('0x38')]=_['merge'](_0x2d01ce[_0x55f6('0x38')],{'$or':_['map'](_0x2d01ce['attributes'],function(_0x176bd5){var _0x2bc66d={};_0x2bc66d[_0x176bd5]={'$like':'%'+_0x12637b['query'][_0x55f6('0x49')]+'%'};return _0x2bc66d;})});}_0x2d01ce=_[_0x55f6('0x39')]({},_0x2d01ce,_0x12637b['options']);return _0x645574[_0x55f6('0x46')](_0x2d01ce);}})[_0x55f6('0x20')](function(_0x41b646){if(_0x41b646){_0x80dc6d=_0x41b646[_0x55f6('0x41')];if(!_0x12637b[_0x55f6('0x2d')]['hasOwnProperty']('nolimit')){_0x2d01ce['limit']=qs[_0x55f6('0x19')](_0x12637b[_0x55f6('0x2d')]['limit']);_0x2d01ce['offset']=qs['offset'](_0x12637b[_0x55f6('0x2d')]['offset']);}return _0x645574[_0x55f6('0x46')](_0x2d01ce);}})['then'](function(_0x1e6b49){if(_0x1e6b49){return _0x1e6b49?{'count':_0x80dc6d,'rows':_0x1e6b49}:null;}})[_0x55f6('0x20')](respondWithResult(_0x103e5e,null))['catch'](handleError(_0x103e5e,null));};exports[_0x55f6('0x4a')]=function(_0x7eadb1,_0x4d66bf,_0x1554d6){var _0x598b8c={};var _0x28bcf1={};var _0x59bf9d;var _0x2471b4;return db[_0x55f6('0x28')][_0x55f6('0x47')]({'where':{'id':_0x7eadb1['params']['id']}})['then'](handleEntityNotFound(_0x4d66bf,null))[_0x55f6('0x20')](function(_0x337d89){if(_0x337d89){_0x59bf9d=_0x337d89;_0x28bcf1['model']=_['keys'](db[_0x55f6('0x48')][_0x55f6('0x40')]);_0x28bcf1['query']=_[_0x55f6('0x2e')](_0x7eadb1['query']);_0x28bcf1[_0x55f6('0x2f')]=_[_0x55f6('0x30')](_0x28bcf1['model'],_0x28bcf1[_0x55f6('0x2d')]);_0x598b8c[_0x55f6('0x31')]=_['intersection'](_0x28bcf1[_0x55f6('0x2c')],qs[_0x55f6('0x32')](_0x7eadb1[_0x55f6('0x2d')][_0x55f6('0x32')]));_0x598b8c['attributes']=_0x598b8c[_0x55f6('0x31')][_0x55f6('0x41')]?_0x598b8c[_0x55f6('0x31')]:_0x28bcf1[_0x55f6('0x2c')];_0x598b8c[_0x55f6('0x35')]=qs[_0x55f6('0x36')](_0x7eadb1['query']['sort']);_0x598b8c[_0x55f6('0x38')]=qs[_0x55f6('0x2f')](_[_0x55f6('0x37')](_0x7eadb1[_0x55f6('0x2d')],_0x28bcf1['filters']));if(_0x7eadb1['query'][_0x55f6('0x49')]){_0x598b8c['where']=_[_0x55f6('0x39')](_0x598b8c['where'],{'$or':_[_0x55f6('0x27')](_0x598b8c['attributes'],function(_0x461da4){var _0x45da8f={};_0x45da8f[_0x461da4]={'$like':'%'+_0x7eadb1[_0x55f6('0x2d')]['filter']+'%'};return _0x45da8f;})});}_0x598b8c=_[_0x55f6('0x39')]({},_0x598b8c,_0x7eadb1['options']);return _0x59bf9d[_0x55f6('0x4a')](_0x598b8c);}})[_0x55f6('0x20')](function(_0x47a9c8){if(_0x47a9c8){_0x2471b4=_0x47a9c8['length'];if(!_0x7eadb1['query'][_0x55f6('0x33')]('nolimit')){_0x598b8c[_0x55f6('0x19')]=qs['limit'](_0x7eadb1[_0x55f6('0x2d')][_0x55f6('0x19')]);_0x598b8c['offset']=qs[_0x55f6('0x1c')](_0x7eadb1[_0x55f6('0x2d')][_0x55f6('0x1c')]);}return _0x59bf9d[_0x55f6('0x4a')](_0x598b8c);}})['then'](function(_0x7050f3){if(_0x7050f3){return _0x7050f3?{'count':_0x2471b4,'rows':_0x7050f3}:null;}})['then'](respondWithResult(_0x4d66bf,null))['catch'](handleError(_0x4d66bf,null));};exports['getDescriptions']=function(_0x4de649,_0x2e65ae,_0x428db6){var _0xce1407={};var _0x55e00b={};var _0x4316a1;var _0x30970d;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4de649[_0x55f6('0x3f')]['id']}})[_0x55f6('0x20')](handleEntityNotFound(_0x2e65ae,null))['then'](function(_0x294b34){if(_0x294b34){_0x4316a1=_0x294b34;_0x55e00b[_0x55f6('0x2c')]=_[_0x55f6('0x2e')](db[_0x55f6('0x48')][_0x55f6('0x40')]);_0x55e00b['query']=_[_0x55f6('0x2e')](_0x4de649[_0x55f6('0x2d')]);_0x55e00b[_0x55f6('0x2f')]=_[_0x55f6('0x30')](_0x55e00b[_0x55f6('0x2c')],_0x55e00b[_0x55f6('0x2d')]);_0xce1407[_0x55f6('0x31')]=_[_0x55f6('0x30')](_0x55e00b['model'],qs[_0x55f6('0x32')](_0x4de649[_0x55f6('0x2d')][_0x55f6('0x32')]));_0xce1407['attributes']=_0xce1407['attributes'][_0x55f6('0x41')]?_0xce1407[_0x55f6('0x31')]:_0x55e00b[_0x55f6('0x2c')];_0xce1407['order']=qs[_0x55f6('0x36')](_0x4de649[_0x55f6('0x2d')]['sort']);_0xce1407[_0x55f6('0x38')]=qs[_0x55f6('0x2f')](_[_0x55f6('0x37')](_0x4de649['query'],_0x55e00b[_0x55f6('0x2f')]));if(_0x4de649[_0x55f6('0x2d')]['filter']){_0xce1407[_0x55f6('0x38')]=_['merge'](_0xce1407[_0x55f6('0x38')],{'$or':_[_0x55f6('0x27')](_0xce1407['attributes'],function(_0x48c5c4){var _0x2f106d={};_0x2f106d[_0x48c5c4]={'$like':'%'+_0x4de649[_0x55f6('0x2d')][_0x55f6('0x49')]+'%'};return _0x2f106d;})});}_0xce1407=_['merge']({},_0xce1407,_0x4de649[_0x55f6('0x3b')]);return _0x4316a1[_0x55f6('0x4b')](_0xce1407);}})[_0x55f6('0x20')](function(_0xcd8cd9){if(_0xcd8cd9){_0x30970d=_0xcd8cd9['length'];if(!_0x4de649[_0x55f6('0x2d')][_0x55f6('0x33')]('nolimit')){_0xce1407[_0x55f6('0x19')]=qs['limit'](_0x4de649[_0x55f6('0x2d')][_0x55f6('0x19')]);_0xce1407[_0x55f6('0x1c')]=qs[_0x55f6('0x1c')](_0x4de649[_0x55f6('0x2d')]['offset']);}return _0x4316a1[_0x55f6('0x4b')](_0xce1407);}})[_0x55f6('0x20')](function(_0x4c1d75){if(_0x4c1d75){return _0x4c1d75?{'count':_0x30970d,'rows':_0x4c1d75}:null;}})[_0x55f6('0x20')](respondWithResult(_0x2e65ae,null))[_0x55f6('0x44')](handleError(_0x2e65ae,null));};exports[_0x55f6('0x4c')]=function(_0x5bef88,_0x18d116,_0x1d3e94){var _0x2b305d={};var _0x256134={};var _0x2fff9d;var _0x1f75eb;return db[_0x55f6('0x28')]['findOne']({'where':{'id':_0x5bef88[_0x55f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x18d116,null))['then'](function(_0x5d6ce7){if(_0x5d6ce7){_0x2fff9d=_0x5d6ce7;_0x256134['model']=_[_0x55f6('0x2e')](db[_0x55f6('0x4d')][_0x55f6('0x40')]);_0x256134['query']=_[_0x55f6('0x2e')](_0x5bef88[_0x55f6('0x2d')]);_0x256134[_0x55f6('0x2f')]=_['intersection'](_0x256134[_0x55f6('0x2c')],_0x256134[_0x55f6('0x2d')]);_0x2b305d[_0x55f6('0x31')]=_[_0x55f6('0x30')](_0x256134[_0x55f6('0x2c')],qs[_0x55f6('0x32')](_0x5bef88['query'][_0x55f6('0x32')]));_0x2b305d[_0x55f6('0x31')]=_0x2b305d[_0x55f6('0x31')][_0x55f6('0x41')]?_0x2b305d[_0x55f6('0x31')]:_0x256134[_0x55f6('0x2c')];_0x2b305d[_0x55f6('0x35')]=qs[_0x55f6('0x36')](_0x5bef88[_0x55f6('0x2d')][_0x55f6('0x36')]);_0x2b305d[_0x55f6('0x38')]=qs['filters'](_[_0x55f6('0x37')](_0x5bef88[_0x55f6('0x2d')],_0x256134[_0x55f6('0x2f')]));if(_0x5bef88['query']['filter']){_0x2b305d[_0x55f6('0x38')]=_['merge'](_0x2b305d['where'],{'$or':_[_0x55f6('0x27')](_0x2b305d[_0x55f6('0x31')],function(_0x11e2bb){var _0x1f483e={};_0x1f483e[_0x11e2bb]={'$like':'%'+_0x5bef88['query']['filter']+'%'};return _0x1f483e;})});}_0x2b305d=_[_0x55f6('0x39')]({},_0x2b305d,_0x5bef88['options']);return _0x2fff9d[_0x55f6('0x4c')](_0x2b305d);}})['then'](function(_0x5dbdff){if(_0x5dbdff){_0x1f75eb=_0x5dbdff[_0x55f6('0x41')];if(!_0x5bef88[_0x55f6('0x2d')][_0x55f6('0x33')]('nolimit')){_0x2b305d[_0x55f6('0x19')]=qs[_0x55f6('0x19')](_0x5bef88['query'][_0x55f6('0x19')]);_0x2b305d[_0x55f6('0x1c')]=qs['offset'](_0x5bef88[_0x55f6('0x2d')][_0x55f6('0x1c')]);}return _0x2fff9d['getTags'](_0x2b305d);}})[_0x55f6('0x20')](function(_0x24edcb){if(_0x24edcb){return _0x24edcb?{'count':_0x1f75eb,'rows':_0x24edcb}:null;}})[_0x55f6('0x20')](respondWithResult(_0x18d116,null))[_0x55f6('0x44')](handleError(_0x18d116,null));};exports[_0x55f6('0x4e')]=function(_0x396d95,_0x2dc834,_0x3d46e1){if(_0x396d95['body']['id']){delete _0x396d95['body']['id'];}return db[_0x55f6('0x28')][_0x55f6('0x47')]({'where':{'id':_0x396d95[_0x55f6('0x3f')]['id']}})[_0x55f6('0x20')](handleEntityNotFound(_0x2dc834,null))[_0x55f6('0x20')](function(_0x1e7998){if(_0x1e7998){return _0x1e7998[_0x55f6('0x4e')](_0x396d95[_0x55f6('0x43')]['ids']||[]);}return null;})[_0x55f6('0x20')](respondWithResult(_0x2dc834,null))[_0x55f6('0x44')](handleError(_0x2dc834,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 3ded79f..a0360e1 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 _0x318a=['bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','api'];(function(_0x286908,_0xd91118){var _0x3bb8d2=function(_0x4dbbfa){while(--_0x4dbbfa){_0x286908['push'](_0x286908['shift']());}};_0x3bb8d2(++_0xd91118);}(_0x318a,0x1c1));var _0xa318=function(_0x46c93c,_0x59f74b){_0x46c93c=_0x46c93c-0x0;var _0x163aaa=_0x318a[_0x46c93c];return _0x163aaa;};'use strict';var _=require('lodash');var util=require(_0xa318('0x0'));var logger=require('../../config/logger')(_0xa318('0x1'));var moment=require('moment');var BPromise=require(_0xa318('0x2'));var rp=require(_0xa318('0x3'));var fs=require('fs');var path=require(_0xa318('0x4'));var rimraf=require(_0xa318('0x5'));var config=require('../../config/environment');var attributes=require(_0xa318('0x6'));module[_0xa318('0x7')]=function(_0x2a97a3,_0x534624){return _0x2a97a3[_0xa318('0x8')](_0xa318('0x9'),attributes,{'tableName':_0xa318('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2e4=['FreshdeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0xe2e4,0x16d));var _0x4e2e=function(_0x5f415d,_0x39b258){_0x5f415d=_0x5f415d-0x0;var _0x3ac7a6=_0xe2e4[_0x5f415d];return _0x3ac7a6;};'use strict';var _=require(_0x4e2e('0x0'));var util=require(_0x4e2e('0x1'));var logger=require(_0x4e2e('0x2'))(_0x4e2e('0x3'));var moment=require(_0x4e2e('0x4'));var BPromise=require(_0x4e2e('0x5'));var rp=require(_0x4e2e('0x6'));var fs=require('fs');var path=require(_0x4e2e('0x7'));var rimraf=require(_0x4e2e('0x8'));var config=require(_0x4e2e('0x9'));var attributes=require(_0x4e2e('0xa'));module[_0x4e2e('0xb')]=function(_0x59f974,_0x505eda){return _0x59f974[_0x4e2e('0xc')](_0x4e2e('0xd'),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 4f2bb16..1f603e9 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 _0x11d7=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0x11d7,0xbc));var _0x711d=function(_0x211a02,_0x3b5362){_0x211a02=_0x211a02-0x0;var _0x13d91c=_0x11d7[_0x211a02];return _0x13d91c;};'use strict';var _=require('lodash');var util=require(_0x711d('0x0'));var moment=require(_0x711d('0x1'));var BPromise=require('bluebird');var rs=require(_0x711d('0x2'));var fs=require('fs');var Redis=require(_0x711d('0x3'));var db=require(_0x711d('0x4'))['db'];var utils=require(_0x711d('0x5'));var logger=require(_0x711d('0x6'))('rpc');var config=require(_0x711d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x711d('0x8')][_0x711d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e88a9,_0x2297d8,_0x210bc0){return new BPromise(function(_0x4aa725,_0x20b858){return client[_0x711d('0xa')](_0x1e88a9,_0x210bc0)[_0x711d('0xb')](function(_0x57616e){logger[_0x711d('0xc')](_0x711d('0xd'),_0x2297d8,_0x711d('0xe'));logger[_0x711d('0xf')](_0x711d('0x10'),_0x2297d8,'request\x20sent',JSON[_0x711d('0x11')](_0x57616e));if(_0x57616e[_0x711d('0x12')]){if(_0x57616e[_0x711d('0x12')][_0x711d('0x13')]===0x1f4){logger[_0x711d('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2297d8,_0x57616e[_0x711d('0x12')][_0x711d('0x14')]);return _0x20b858(_0x57616e[_0x711d('0x12')][_0x711d('0x14')]);}logger['error'](_0x711d('0xd'),_0x2297d8,_0x57616e[_0x711d('0x12')]['message']);return _0x4aa725(_0x57616e[_0x711d('0x12')][_0x711d('0x14')]);}else{logger[_0x711d('0xc')](_0x711d('0xd'),_0x2297d8,_0x711d('0xe'));_0x4aa725(_0x57616e[_0x711d('0x15')][_0x711d('0x14')]);}})['catch'](function(_0x1b0b2e){logger['error'](_0x711d('0xd'),_0x2297d8,_0x1b0b2e);_0x20b858(_0x1b0b2e);});});} \ No newline at end of file +var _0x1570=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xd51b98,_0xbd1f5){var _0x548ce8=function(_0x437b2a){while(--_0x437b2a){_0xd51b98['push'](_0xd51b98['shift']());}};_0x548ce8(++_0xbd1f5);}(_0x1570,0x1d0));var _0x0157=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x1570[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0157('0x0'));var util=require('util');var moment=require(_0x0157('0x1'));var BPromise=require(_0x0157('0x2'));var rs=require(_0x0157('0x3'));var fs=require('fs');var Redis=require(_0x0157('0x4'));var db=require(_0x0157('0x5'))['db'];var utils=require(_0x0157('0x6'));var logger=require('../../config/logger')(_0x0157('0x7'));var config=require(_0x0157('0x8'));var jayson=require(_0x0157('0x9'));var client=jayson[_0x0157('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a72ad,_0x3870ab,_0x34a82a){return new BPromise(function(_0x1801b8,_0x496678){return client['request'](_0x3a72ad,_0x34a82a)[_0x0157('0xb')](function(_0x346e49){logger[_0x0157('0xc')](_0x0157('0xd'),_0x3870ab,_0x0157('0xe'));logger['debug'](_0x0157('0xf'),_0x3870ab,_0x0157('0xe'),JSON[_0x0157('0x10')](_0x346e49));if(_0x346e49['error']){if(_0x346e49[_0x0157('0x11')][_0x0157('0x12')]===0x1f4){logger[_0x0157('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3870ab,_0x346e49['error'][_0x0157('0x13')]);return _0x496678(_0x346e49[_0x0157('0x11')][_0x0157('0x13')]);}logger['error'](_0x0157('0xd'),_0x3870ab,_0x346e49[_0x0157('0x11')][_0x0157('0x13')]);return _0x1801b8(_0x346e49[_0x0157('0x11')][_0x0157('0x13')]);}else{logger['info'](_0x0157('0xd'),_0x3870ab,_0x0157('0xe'));_0x1801b8(_0x346e49[_0x0157('0x14')][_0x0157('0x13')]);}})['catch'](function(_0x5731bb){logger[_0x0157('0x11')](_0x0157('0xd'),_0x3870ab,_0x5731bb);_0x496678(_0x5731bb);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5d7fe65..9d363e3 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 _0xeb8c=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x1d7bbf,_0xca8bdb){var _0x298e74=function(_0xee5866){while(--_0xee5866){_0x1d7bbf['push'](_0x1d7bbf['shift']());}};_0x298e74(++_0xca8bdb);}(_0xeb8c,0xab));var _0xceb8=function(_0x21a628,_0x458ccc){_0x21a628=_0x21a628-0x0;var _0x47d1d2=_0xeb8c[_0x21a628];return _0x47d1d2;};'use strict';var multer=require(_0xceb8('0x0'));var util=require(_0xceb8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xceb8('0x2'));var router=express[_0xceb8('0x3')]();var fs_extra=require(_0xceb8('0x4'));var auth=require(_0xceb8('0x5'));var interaction=require(_0xceb8('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0xceb8('0x7')]('/',auth[_0xceb8('0x8')](),controller[_0xceb8('0x9')]);router[_0xceb8('0x7')](_0xceb8('0xa'),auth[_0xceb8('0x8')](),controller[_0xceb8('0xb')]);router[_0xceb8('0xc')]('/',auth[_0xceb8('0x8')](),controller[_0xceb8('0xd')]);router[_0xceb8('0xe')](_0xceb8('0xa'),auth[_0xceb8('0x8')](),controller['update']);router['delete']('/:id',auth[_0xceb8('0x8')](),controller[_0xceb8('0xf')]);module[_0xceb8('0x10')]=router; \ No newline at end of file +var _0xeccf=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xeccf,0x6c));var _0xfecc=function(_0x1dc05d,_0x53c88d){_0x1dc05d=_0x1dc05d-0x0;var _0x3f95bd=_0xeccf[_0x1dc05d];return _0x3f95bd;};'use strict';var multer=require(_0xfecc('0x0'));var util=require('util');var path=require(_0xfecc('0x1'));var timeout=require('connect-timeout');var express=require(_0xfecc('0x2'));var router=express[_0xfecc('0x3')]();var fs_extra=require(_0xfecc('0x4'));var auth=require(_0xfecc('0x5'));var interaction=require(_0xfecc('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0xfecc('0x7')]('/',auth[_0xfecc('0x8')](),controller[_0xfecc('0x9')]);router[_0xfecc('0x7')](_0xfecc('0xa'),auth[_0xfecc('0x8')](),controller['show']);router[_0xfecc('0xb')]('/',auth[_0xfecc('0x8')](),controller[_0xfecc('0xc')]);router[_0xfecc('0xd')](_0xfecc('0xa'),auth[_0xfecc('0x8')](),controller[_0xfecc('0xe')]);router[_0xfecc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfecc('0x10')]);module[_0xfecc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 8dd4093..7b4df94 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 _0x72d4=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72d4,0x167));var _0x472d=function(_0x3cfc21,_0x348ff8){_0x3cfc21=_0x3cfc21-0x0;var _0x37ec27=_0x72d4[_0x3cfc21];return _0x37ec27;};'use strict';var Sequelize=require(_0x472d('0x0'));module[_0x472d('0x1')]={'type':{'type':Sequelize[_0x472d('0x2')](_0x472d('0x3'),_0x472d('0x4'),_0x472d('0x5'),_0x472d('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x472d('0x7')]},'keyType':{'type':Sequelize[_0x472d('0x2')](_0x472d('0x3'),_0x472d('0x4'),_0x472d('0x5'))},'keyContent':{'type':Sequelize[_0x472d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x472d('0x7')]},'customField':{'type':Sequelize[_0x472d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x472d('0x7')]}}; \ No newline at end of file +var _0x371c=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x4794a0,_0x462129){var _0x21ccbe=function(_0x6d6a63){while(--_0x6d6a63){_0x4794a0['push'](_0x4794a0['shift']());}};_0x21ccbe(++_0x462129);}(_0x371c,0x1ba));var _0xc371=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x371c[_0x342700];return _0x53406f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc371('0x0')](_0xc371('0x1'),_0xc371('0x2'),_0xc371('0x3'),_0xc371('0x4'),'picklist'),'defaultValue':_0xc371('0x1')},'content':{'type':Sequelize[_0xc371('0x5')]},'key':{'type':Sequelize[_0xc371('0x5')]},'keyType':{'type':Sequelize[_0xc371('0x0')](_0xc371('0x1'),'variable',_0xc371('0x3'))},'keyContent':{'type':Sequelize[_0xc371('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc371('0x5')]},'customField':{'type':Sequelize[_0xc371('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc371('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 968985f..00dc78c 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 _0x4227=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','options','FreshdeskField','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','eml-format','fast-json-patch','moment'];(function(_0x35cfbb,_0x24b8a2){var _0x503a16=function(_0x71bc05){while(--_0x71bc05){_0x35cfbb['push'](_0x35cfbb['shift']());}};_0x503a16(++_0x24b8a2);}(_0x4227,0x89));var _0x7422=function(_0x18f6e0,_0x2c40e5){_0x18f6e0=_0x18f6e0-0x0;var _0xe3c761=_0x4227[_0x18f6e0];return _0xe3c761;};'use strict';var emlformat=require(_0x7422('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7422('0x1'));var rp=require('request-promise');var moment=require(_0x7422('0x2'));var BPromise=require(_0x7422('0x3'));var Mustache=require(_0x7422('0x4'));var util=require('util');var path=require(_0x7422('0x5'));var sox=require(_0x7422('0x6'));var csv=require(_0x7422('0x7'));var ejs=require(_0x7422('0x8'));var fs=require('fs');var fs_extra=require(_0x7422('0x9'));var _=require(_0x7422('0xa'));var squel=require(_0x7422('0xb'));var crypto=require(_0x7422('0xc'));var jsforce=require(_0x7422('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7422('0x7'));var querystring=require(_0x7422('0xe'));var Papa=require(_0x7422('0xf'));var Redis=require('ioredis');var authService=require(_0x7422('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7422('0x11'));var hardwareService=require(_0x7422('0x12'));var logger=require(_0x7422('0x13'))(_0x7422('0x14'));var utils=require(_0x7422('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7422('0x16'));var db=require(_0x7422('0x17'))['db'];function respondWithStatusCode(_0x575c47,_0xb06dc6){_0xb06dc6=_0xb06dc6||0xcc;return function(_0x2acd6c){if(_0x2acd6c){return _0x575c47['sendStatus'](_0xb06dc6);}return _0x575c47[_0x7422('0x18')](_0xb06dc6)[_0x7422('0x19')]();};}function respondWithResult(_0x555082,_0x4d3f91){_0x4d3f91=_0x4d3f91||0xc8;return function(_0xeafd58){if(_0xeafd58){return _0x555082['status'](_0x4d3f91)[_0x7422('0x1a')](_0xeafd58);}};}function respondWithFilteredResult(_0x788829,_0x487c93){return function(_0x149c50){if(_0x149c50){var _0x39c31c=typeof _0x487c93[_0x7422('0x1b')]===_0x7422('0x1c')&&typeof _0x487c93[_0x7422('0x1d')]===_0x7422('0x1c');var _0x4e2b60=_0x149c50[_0x7422('0x1e')];var _0xa7ff41=_0x39c31c?0x0:_0x487c93[_0x7422('0x1b')];var _0x30656d=_0x39c31c?_0x149c50['count']:_0x487c93[_0x7422('0x1b')]+_0x487c93['limit'];var _0x22a1c8;if(_0x30656d>=_0x4e2b60){_0x30656d=_0x4e2b60;_0x22a1c8=0xc8;}else{_0x22a1c8=0xce;}_0x788829[_0x7422('0x18')](_0x22a1c8);return _0x788829[_0x7422('0x1f')]('Content-Range',_0xa7ff41+'-'+_0x30656d+'/'+_0x4e2b60)[_0x7422('0x1a')](_0x149c50);}return null;};}function patchUpdates(_0xacaad1){return function(_0x368e96){try{jsonpatch[_0x7422('0x20')](_0x368e96,_0xacaad1,!![]);}catch(_0x55f98f){return BPromise['reject'](_0x55f98f);}return _0x368e96[_0x7422('0x21')]();};}function saveUpdates(_0x380ef7,_0x20c1e3){return function(_0x7d34f2){if(_0x7d34f2){return _0x7d34f2[_0x7422('0x22')](_0x380ef7)[_0x7422('0x23')](function(_0xe4f174){return _0xe4f174;});}return null;};}function removeEntity(_0x596b89,_0x24ce62){return function(_0x46b927){if(_0x46b927){return _0x46b927['destroy']()[_0x7422('0x23')](function(){_0x596b89[_0x7422('0x18')](0xcc)[_0x7422('0x19')]();});}};}function handleEntityNotFound(_0x3eeb9c,_0x5436a4){return function(_0x3f579a){if(!_0x3f579a){_0x3eeb9c[_0x7422('0x24')](0x194);}return _0x3f579a;};}function handleError(_0x3cdea0,_0x2dd10f){_0x2dd10f=_0x2dd10f||0x1f4;return function(_0x3438d1){logger['error'](_0x3438d1[_0x7422('0x25')]);if(_0x3438d1[_0x7422('0x26')]){delete _0x3438d1[_0x7422('0x26')];}_0x3cdea0[_0x7422('0x18')](_0x2dd10f)['send'](_0x3438d1);};}exports[_0x7422('0x27')]=function(_0x20f71e,_0x9b0144){var _0x702aef={},_0x59bc52={},_0x1cd623={'count':0x0,'rows':[]};var _0x41d4a1=_['map'](db['FreshdeskField'][_0x7422('0x28')],function(_0x2fb125){return{'name':_0x2fb125['fieldName'],'type':_0x2fb125[_0x7422('0x29')][_0x7422('0x2a')]};});_0x59bc52[_0x7422('0x2b')]=_[_0x7422('0x2c')](_0x41d4a1,_0x7422('0x26'));_0x59bc52[_0x7422('0x2d')]=_[_0x7422('0x2e')](_0x20f71e[_0x7422('0x2d')]);_0x59bc52[_0x7422('0x2f')]=_[_0x7422('0x30')](_0x59bc52[_0x7422('0x2b')],_0x59bc52['query']);_0x702aef[_0x7422('0x31')]=_[_0x7422('0x30')](_0x59bc52[_0x7422('0x2b')],qs[_0x7422('0x32')](_0x20f71e['query'][_0x7422('0x32')]));_0x702aef[_0x7422('0x31')]=_0x702aef[_0x7422('0x31')]['length']?_0x702aef['attributes']:_0x59bc52[_0x7422('0x2b')];if(!_0x20f71e['query'][_0x7422('0x33')]('nolimit')){_0x702aef[_0x7422('0x1d')]=qs['limit'](_0x20f71e[_0x7422('0x2d')]['limit']);_0x702aef['offset']=qs[_0x7422('0x1b')](_0x20f71e['query'][_0x7422('0x1b')]);}_0x702aef[_0x7422('0x34')]=qs[_0x7422('0x35')](_0x20f71e[_0x7422('0x2d')][_0x7422('0x35')]);_0x702aef[_0x7422('0x36')]=qs[_0x7422('0x2f')](_['pick'](_0x20f71e[_0x7422('0x2d')],_0x59bc52[_0x7422('0x2f')]),_0x41d4a1);if(_0x20f71e[_0x7422('0x2d')][_0x7422('0x37')]){_0x702aef[_0x7422('0x36')]=_['merge'](_0x702aef[_0x7422('0x36')],{'$or':_[_0x7422('0x2c')](_0x41d4a1,function(_0x5bfbf6){if(_0x5bfbf6[_0x7422('0x29')]!=='VIRTUAL'){var _0x47486b={};_0x47486b[_0x5bfbf6['name']]={'$like':'%'+_0x20f71e['query'][_0x7422('0x37')]+'%'};return _0x47486b;}})});}_0x702aef=_[_0x7422('0x38')]({},_0x702aef,_0x20f71e[_0x7422('0x39')]);var _0x57a500={'where':_0x702aef[_0x7422('0x36')]};return db[_0x7422('0x3a')]['count'](_0x57a500)[_0x7422('0x23')](function(_0x5df470){_0x1cd623[_0x7422('0x1e')]=_0x5df470;if(_0x20f71e[_0x7422('0x2d')][_0x7422('0x3b')]){_0x702aef[_0x7422('0x3c')]=[{'all':!![]}];}return db[_0x7422('0x3a')][_0x7422('0x3d')](_0x702aef);})[_0x7422('0x23')](function(_0x50b48f){_0x1cd623[_0x7422('0x3e')]=_0x50b48f;return _0x1cd623;})[_0x7422('0x23')](respondWithFilteredResult(_0x9b0144,_0x702aef))['catch'](handleError(_0x9b0144,null));};exports[_0x7422('0x3f')]=function(_0x98c659,_0x5719df){var _0xca1546={'raw':!![],'where':{'id':_0x98c659[_0x7422('0x40')]['id']}},_0x4e2cd4={};_0x4e2cd4['model']=_[_0x7422('0x2e')](db[_0x7422('0x3a')][_0x7422('0x28')]);_0x4e2cd4[_0x7422('0x2d')]=_[_0x7422('0x2e')](_0x98c659[_0x7422('0x2d')]);_0x4e2cd4[_0x7422('0x2f')]=_[_0x7422('0x30')](_0x4e2cd4[_0x7422('0x2b')],_0x4e2cd4[_0x7422('0x2d')]);_0xca1546['attributes']=_[_0x7422('0x30')](_0x4e2cd4['model'],qs['fields'](_0x98c659[_0x7422('0x2d')][_0x7422('0x32')]));_0xca1546['attributes']=_0xca1546[_0x7422('0x31')][_0x7422('0x41')]?_0xca1546[_0x7422('0x31')]:_0x4e2cd4[_0x7422('0x2b')];if(_0x98c659[_0x7422('0x2d')][_0x7422('0x3b')]){_0xca1546[_0x7422('0x3c')]=[{'all':!![]}];}_0xca1546=_['merge']({},_0xca1546,_0x98c659[_0x7422('0x39')]);return db[_0x7422('0x3a')][_0x7422('0x42')](_0xca1546)[_0x7422('0x23')](handleEntityNotFound(_0x5719df,null))['then'](respondWithResult(_0x5719df,null))[_0x7422('0x43')](handleError(_0x5719df,null));};exports[_0x7422('0x44')]=function(_0x41ce88,_0x4db98d){return db[_0x7422('0x3a')][_0x7422('0x44')](_0x41ce88['body'],{})['then'](respondWithResult(_0x4db98d,0xc9))['catch'](handleError(_0x4db98d,null));};exports[_0x7422('0x22')]=function(_0xbbc9ab,_0x5b4694){if(_0xbbc9ab[_0x7422('0x45')]['id']){delete _0xbbc9ab['body']['id'];}return db[_0x7422('0x3a')][_0x7422('0x42')]({'where':{'id':_0xbbc9ab[_0x7422('0x40')]['id']}})[_0x7422('0x23')](handleEntityNotFound(_0x5b4694,null))['then'](saveUpdates(_0xbbc9ab['body'],null))[_0x7422('0x23')](respondWithResult(_0x5b4694,null))[_0x7422('0x43')](handleError(_0x5b4694,null));};exports['destroy']=function(_0x121983,_0x2fbe91){return db['FreshdeskField'][_0x7422('0x42')]({'where':{'id':_0x121983[_0x7422('0x40')]['id']}})[_0x7422('0x23')](handleEntityNotFound(_0x2fbe91,null))[_0x7422('0x23')](removeEntity(_0x2fbe91,null))[_0x7422('0x43')](handleError(_0x2fbe91,null));}; \ No newline at end of file +var _0x1752=['name','send','index','map','type','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','FreshdeskField','includeAll','findAll','catch','show','params','fields','include','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','destroy','error','stack'];(function(_0x494da0,_0x141b30){var _0x41ef47=function(_0x668f20){while(--_0x668f20){_0x494da0['push'](_0x494da0['shift']());}};_0x41ef47(++_0x141b30);}(_0x1752,0xa5));var _0x2175=function(_0x67633d,_0x555a5c){_0x67633d=_0x67633d-0x0;var _0x46dbad=_0x1752[_0x67633d];return _0x46dbad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2175('0x0'));var zipdir=require(_0x2175('0x1'));var jsonpatch=require(_0x2175('0x2'));var rp=require(_0x2175('0x3'));var moment=require(_0x2175('0x4'));var BPromise=require(_0x2175('0x5'));var Mustache=require('mustache');var util=require(_0x2175('0x6'));var path=require(_0x2175('0x7'));var sox=require(_0x2175('0x8'));var csv=require(_0x2175('0x9'));var ejs=require(_0x2175('0xa'));var fs=require('fs');var fs_extra=require(_0x2175('0xb'));var _=require(_0x2175('0xc'));var squel=require(_0x2175('0xd'));var crypto=require(_0x2175('0xe'));var jsforce=require(_0x2175('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2175('0x9'));var querystring=require(_0x2175('0x10'));var Papa=require(_0x2175('0x11'));var Redis=require(_0x2175('0x12'));var authService=require(_0x2175('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2175('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2175('0x15'))['db'];function respondWithStatusCode(_0x5bc446,_0x43be3c){_0x43be3c=_0x43be3c||0xcc;return function(_0x393c02){if(_0x393c02){return _0x5bc446['sendStatus'](_0x43be3c);}return _0x5bc446[_0x2175('0x16')](_0x43be3c)[_0x2175('0x17')]();};}function respondWithResult(_0x45df73,_0x3bc01f){_0x3bc01f=_0x3bc01f||0xc8;return function(_0x21d4cd){if(_0x21d4cd){return _0x45df73[_0x2175('0x16')](_0x3bc01f)[_0x2175('0x18')](_0x21d4cd);}};}function respondWithFilteredResult(_0x413688,_0x5d84db){return function(_0x55b798){if(_0x55b798){var _0x371b42=typeof _0x5d84db[_0x2175('0x19')]===_0x2175('0x1a')&&typeof _0x5d84db['limit']==='undefined';var _0x588b0b=_0x55b798[_0x2175('0x1b')];var _0x377586=_0x371b42?0x0:_0x5d84db['offset'];var _0x53576c=_0x371b42?_0x55b798[_0x2175('0x1b')]:_0x5d84db[_0x2175('0x19')]+_0x5d84db[_0x2175('0x1c')];var _0x51628d;if(_0x53576c>=_0x588b0b){_0x53576c=_0x588b0b;_0x51628d=0xc8;}else{_0x51628d=0xce;}_0x413688[_0x2175('0x16')](_0x51628d);return _0x413688['set'](_0x2175('0x1d'),_0x377586+'-'+_0x53576c+'/'+_0x588b0b)['json'](_0x55b798);}return null;};}function patchUpdates(_0x37818a){return function(_0x4ec36c){try{jsonpatch['apply'](_0x4ec36c,_0x37818a,!![]);}catch(_0x5344af){return BPromise[_0x2175('0x1e')](_0x5344af);}return _0x4ec36c['save']();};}function saveUpdates(_0x28c4b8,_0x46ea57){return function(_0x2dd77b){if(_0x2dd77b){return _0x2dd77b[_0x2175('0x1f')](_0x28c4b8)[_0x2175('0x20')](function(_0x12d150){return _0x12d150;});}return null;};}function removeEntity(_0x5ac63e,_0x49d4b9){return function(_0x3d849e){if(_0x3d849e){return _0x3d849e[_0x2175('0x21')]()[_0x2175('0x20')](function(){_0x5ac63e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9c6374,_0xe252f0){return function(_0x2204cd){if(!_0x2204cd){_0x9c6374['sendStatus'](0x194);}return _0x2204cd;};}function handleError(_0x224fa3,_0x4d2120){_0x4d2120=_0x4d2120||0x1f4;return function(_0x5e696c){logger[_0x2175('0x22')](_0x5e696c[_0x2175('0x23')]);if(_0x5e696c[_0x2175('0x24')]){delete _0x5e696c[_0x2175('0x24')];}_0x224fa3[_0x2175('0x16')](_0x4d2120)[_0x2175('0x25')](_0x5e696c);};}exports[_0x2175('0x26')]=function(_0x40d8c8,_0x1b807b){var _0x1c721d={},_0x7b6edb={},_0x56dcf9={'count':0x0,'rows':[]};var _0x20fccf=_[_0x2175('0x27')](db['FreshdeskField']['rawAttributes'],function(_0x3d64ac){return{'name':_0x3d64ac['fieldName'],'type':_0x3d64ac[_0x2175('0x28')]['key']};});_0x7b6edb['model']=_['map'](_0x20fccf,_0x2175('0x24'));_0x7b6edb[_0x2175('0x29')]=_[_0x2175('0x2a')](_0x40d8c8[_0x2175('0x29')]);_0x7b6edb['filters']=_[_0x2175('0x2b')](_0x7b6edb[_0x2175('0x2c')],_0x7b6edb['query']);_0x1c721d[_0x2175('0x2d')]=_[_0x2175('0x2b')](_0x7b6edb['model'],qs['fields'](_0x40d8c8['query']['fields']));_0x1c721d[_0x2175('0x2d')]=_0x1c721d[_0x2175('0x2d')][_0x2175('0x2e')]?_0x1c721d[_0x2175('0x2d')]:_0x7b6edb[_0x2175('0x2c')];if(!_0x40d8c8[_0x2175('0x29')][_0x2175('0x2f')](_0x2175('0x30'))){_0x1c721d['limit']=qs['limit'](_0x40d8c8['query']['limit']);_0x1c721d['offset']=qs[_0x2175('0x19')](_0x40d8c8[_0x2175('0x29')]['offset']);}_0x1c721d[_0x2175('0x31')]=qs[_0x2175('0x32')](_0x40d8c8[_0x2175('0x29')][_0x2175('0x32')]);_0x1c721d[_0x2175('0x33')]=qs[_0x2175('0x34')](_['pick'](_0x40d8c8[_0x2175('0x29')],_0x7b6edb[_0x2175('0x34')]),_0x20fccf);if(_0x40d8c8[_0x2175('0x29')][_0x2175('0x35')]){_0x1c721d[_0x2175('0x33')]=_[_0x2175('0x36')](_0x1c721d[_0x2175('0x33')],{'$or':_[_0x2175('0x27')](_0x20fccf,function(_0x38c212){if(_0x38c212[_0x2175('0x28')]!==_0x2175('0x37')){var _0x4be65c={};_0x4be65c[_0x38c212[_0x2175('0x24')]]={'$like':'%'+_0x40d8c8[_0x2175('0x29')][_0x2175('0x35')]+'%'};return _0x4be65c;}})});}_0x1c721d=_['merge']({},_0x1c721d,_0x40d8c8['options']);var _0x932bb6={'where':_0x1c721d['where']};return db[_0x2175('0x38')][_0x2175('0x1b')](_0x932bb6)[_0x2175('0x20')](function(_0x4989df){_0x56dcf9['count']=_0x4989df;if(_0x40d8c8[_0x2175('0x29')][_0x2175('0x39')]){_0x1c721d['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x2175('0x3a')](_0x1c721d);})[_0x2175('0x20')](function(_0x61784d){_0x56dcf9['rows']=_0x61784d;return _0x56dcf9;})[_0x2175('0x20')](respondWithFilteredResult(_0x1b807b,_0x1c721d))[_0x2175('0x3b')](handleError(_0x1b807b,null));};exports[_0x2175('0x3c')]=function(_0x5a6679,_0x49cf7d){var _0x459cee={'raw':!![],'where':{'id':_0x5a6679[_0x2175('0x3d')]['id']}},_0x47f60d={};_0x47f60d[_0x2175('0x2c')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x47f60d[_0x2175('0x29')]=_['keys'](_0x5a6679['query']);_0x47f60d[_0x2175('0x34')]=_['intersection'](_0x47f60d[_0x2175('0x2c')],_0x47f60d[_0x2175('0x29')]);_0x459cee[_0x2175('0x2d')]=_[_0x2175('0x2b')](_0x47f60d[_0x2175('0x2c')],qs[_0x2175('0x3e')](_0x5a6679['query'][_0x2175('0x3e')]));_0x459cee[_0x2175('0x2d')]=_0x459cee[_0x2175('0x2d')][_0x2175('0x2e')]?_0x459cee[_0x2175('0x2d')]:_0x47f60d[_0x2175('0x2c')];if(_0x5a6679['query'][_0x2175('0x39')]){_0x459cee[_0x2175('0x3f')]=[{'all':!![]}];}_0x459cee=_[_0x2175('0x36')]({},_0x459cee,_0x5a6679['options']);return db[_0x2175('0x38')]['find'](_0x459cee)['then'](handleEntityNotFound(_0x49cf7d,null))[_0x2175('0x20')](respondWithResult(_0x49cf7d,null))[_0x2175('0x3b')](handleError(_0x49cf7d,null));};exports[_0x2175('0x40')]=function(_0x5ee4aa,_0x32d6eb){return db[_0x2175('0x38')][_0x2175('0x40')](_0x5ee4aa[_0x2175('0x41')],{})[_0x2175('0x20')](respondWithResult(_0x32d6eb,0xc9))['catch'](handleError(_0x32d6eb,null));};exports['update']=function(_0xdb0a97,_0xeaabe3){if(_0xdb0a97[_0x2175('0x41')]['id']){delete _0xdb0a97[_0x2175('0x41')]['id'];}return db[_0x2175('0x38')]['find']({'where':{'id':_0xdb0a97[_0x2175('0x3d')]['id']}})[_0x2175('0x20')](handleEntityNotFound(_0xeaabe3,null))[_0x2175('0x20')](saveUpdates(_0xdb0a97['body'],null))['then'](respondWithResult(_0xeaabe3,null))[_0x2175('0x3b')](handleError(_0xeaabe3,null));};exports['destroy']=function(_0x5af419,_0x5bab81){return db['FreshdeskField'][_0x2175('0x42')]({'where':{'id':_0x5af419[_0x2175('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5bab81,null))['then'](removeEntity(_0x5bab81,null))['catch'](handleError(_0x5bab81,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f7c7128..0f486fc 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 _0x672d=['int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','api','moment','bluebird','path','rimraf','./intFreshdeskField.attributes','exports','define'];(function(_0x5bced2,_0x317e86){var _0x2f5c70=function(_0x5f314a){while(--_0x5f314a){_0x5bced2['push'](_0x5bced2['shift']());}};_0x2f5c70(++_0x317e86);}(_0x672d,0x121));var _0xd672=function(_0x2e8f71,_0x252e98){_0x2e8f71=_0x2e8f71-0x0;var _0x1cb5a1=_0x672d[_0x2e8f71];return _0x1cb5a1;};'use strict';var _=require(_0xd672('0x0'));var util=require(_0xd672('0x1'));var logger=require('../../config/logger')(_0xd672('0x2'));var moment=require(_0xd672('0x3'));var BPromise=require(_0xd672('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd672('0x5'));var rimraf=require(_0xd672('0x6'));var config=require('../../config/environment');var attributes=require(_0xd672('0x7'));module[_0xd672('0x8')]=function(_0x19c699,_0x3e6eac){return _0x19c699[_0xd672('0x9')]('FreshdeskField',attributes,{'tableName':_0xd672('0xa'),'paranoid':![],'indexes':[{'name':_0xd672('0xb'),'fields':['idField',_0xd672('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc3d8=['rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2881e2,_0x341293){var _0x5c1e1f=function(_0x10ba61){while(--_0x10ba61){_0x2881e2['push'](_0x2881e2['shift']());}};_0x5c1e1f(++_0x341293);}(_0xc3d8,0x70));var _0x8c3d=function(_0x275c0f,_0xe3bbd4){_0x275c0f=_0x275c0f-0x0;var _0x131134=_0xc3d8[_0x275c0f];return _0x131134;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c3d('0x0'))(_0x8c3d('0x1'));var moment=require('moment');var BPromise=require(_0x8c3d('0x2'));var rp=require(_0x8c3d('0x3'));var fs=require('fs');var path=require(_0x8c3d('0x4'));var rimraf=require(_0x8c3d('0x5'));var config=require(_0x8c3d('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x8c3d('0x7')]=function(_0x277cb9,_0xf4fa30){return _0x277cb9[_0x8c3d('0x8')](_0x8c3d('0x9'),attributes,{'tableName':_0x8c3d('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x8c3d('0xb'),_0x8c3d('0xc')],'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 1d71724..f81b163 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 _0x2b49=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x2c8446,_0x117465){var _0x5a0684=function(_0x39953c){while(--_0x39953c){_0x2c8446['push'](_0x2c8446['shift']());}};_0x5a0684(++_0x117465);}(_0x2b49,0x156));var _0x92b4=function(_0x2a92d1,_0x4cc4bd){_0x2a92d1=_0x2a92d1-0x0;var _0x5246f0=_0x2b49[_0x2a92d1];return _0x5246f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x92b4('0x0'));var BPromise=require(_0x92b4('0x1'));var rs=require(_0x92b4('0x2'));var fs=require('fs');var Redis=require(_0x92b4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x92b4('0x4'));var logger=require('../../config/logger')(_0x92b4('0x5'));var config=require(_0x92b4('0x6'));var jayson=require(_0x92b4('0x7'));var client=jayson[_0x92b4('0x8')][_0x92b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c4bb3,_0x35a557,_0x4b2ff){return new BPromise(function(_0x3459ae,_0x33c9a9){return client[_0x92b4('0xa')](_0x3c4bb3,_0x4b2ff)[_0x92b4('0xb')](function(_0x484f59){logger[_0x92b4('0xc')](_0x92b4('0xd'),_0x35a557,_0x92b4('0xe'));logger[_0x92b4('0xf')](_0x92b4('0x10'),_0x35a557,_0x92b4('0xe'),JSON[_0x92b4('0x11')](_0x484f59));if(_0x484f59[_0x92b4('0x12')]){if(_0x484f59[_0x92b4('0x12')][_0x92b4('0x13')]===0x1f4){logger['error'](_0x92b4('0xd'),_0x35a557,_0x484f59[_0x92b4('0x12')][_0x92b4('0x14')]);return _0x33c9a9(_0x484f59[_0x92b4('0x12')]['message']);}logger[_0x92b4('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x35a557,_0x484f59[_0x92b4('0x12')][_0x92b4('0x14')]);return _0x3459ae(_0x484f59[_0x92b4('0x12')][_0x92b4('0x14')]);}else{logger[_0x92b4('0xc')](_0x92b4('0xd'),_0x35a557,_0x92b4('0xe'));_0x3459ae(_0x484f59[_0x92b4('0x15')][_0x92b4('0x14')]);}})[_0x92b4('0x16')](function(_0x38d940){logger[_0x92b4('0x12')](_0x92b4('0xd'),_0x35a557,_0x38d940);_0x33c9a9(_0x38d940);});});} \ No newline at end of file +var _0x8c63=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa46278,_0x3e128b){var _0x369c26=function(_0x2d7710){while(--_0x2d7710){_0xa46278['push'](_0xa46278['shift']());}};_0x369c26(++_0x3e128b);}(_0x8c63,0xb9));var _0x38c6=function(_0x39e566,_0x1007c9){_0x39e566=_0x39e566-0x0;var _0x172214=_0x8c63[_0x39e566];return _0x172214;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x38c6('0x0'));var BPromise=require(_0x38c6('0x1'));var rs=require(_0x38c6('0x2'));var fs=require('fs');var Redis=require(_0x38c6('0x3'));var db=require(_0x38c6('0x4'))['db'];var utils=require(_0x38c6('0x5'));var logger=require(_0x38c6('0x6'))(_0x38c6('0x7'));var config=require(_0x38c6('0x8'));var jayson=require(_0x38c6('0x9'));var client=jayson[_0x38c6('0xa')][_0x38c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2374a8,_0x5e41e9,_0x31dd1b){return new BPromise(function(_0x5ce733,_0x26ada8){return client[_0x38c6('0xc')](_0x2374a8,_0x31dd1b)[_0x38c6('0xd')](function(_0x2c8987){logger[_0x38c6('0xe')](_0x38c6('0xf'),_0x5e41e9,_0x38c6('0x10'));logger['debug'](_0x38c6('0x11'),_0x5e41e9,_0x38c6('0x10'),JSON[_0x38c6('0x12')](_0x2c8987));if(_0x2c8987[_0x38c6('0x13')]){if(_0x2c8987[_0x38c6('0x13')][_0x38c6('0x14')]===0x1f4){logger['error'](_0x38c6('0xf'),_0x5e41e9,_0x2c8987[_0x38c6('0x13')][_0x38c6('0x15')]);return _0x26ada8(_0x2c8987[_0x38c6('0x13')][_0x38c6('0x15')]);}logger[_0x38c6('0x13')](_0x38c6('0xf'),_0x5e41e9,_0x2c8987[_0x38c6('0x13')][_0x38c6('0x15')]);return _0x5ce733(_0x2c8987[_0x38c6('0x13')][_0x38c6('0x15')]);}else{logger[_0x38c6('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5e41e9,_0x38c6('0x10'));_0x5ce733(_0x2c8987['result'][_0x38c6('0x15')]);}})[_0x38c6('0x16')](function(_0x515beb){logger[_0x38c6('0x13')](_0x38c6('0xf'),_0x5e41e9,_0x515beb);_0x26ada8(_0x515beb);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index e7f1966..849fec8 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fd9=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x33ab79,_0x4f7c50){var _0x10ac00=function(_0x1caa4c){while(--_0x1caa4c){_0x33ab79['push'](_0x33ab79['shift']());}};_0x10ac00(++_0x4f7c50);}(_0x0fd9,0xa3));var _0x90fd=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x0fd9[_0x22b8a3];return _0x199a0c;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),controller[_0x90fd('0x10')]);router[_0x90fd('0xf')]('/:id/configurations',auth[_0x90fd('0x9')](),controller[_0x90fd('0x11')]);router['put'](_0x90fd('0xa'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x12')]);router['delete'](_0x90fd('0xa'),auth['isAuthenticated'](),controller[_0x90fd('0x13')]);module[_0x90fd('0x14')]=router; \ No newline at end of file +var _0xae60=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration'];(function(_0x51733,_0x87aab7){var _0x1baebd=function(_0x29fde6){while(--_0x29fde6){_0x51733['push'](_0x51733['shift']());}};_0x1baebd(++_0x87aab7);}(_0xae60,0x1c7));var _0x0ae6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xae60[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var path=require(_0x0ae6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var fs_extra=require(_0x0ae6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x0ae6('0x8')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xa')]);router[_0x0ae6('0x8')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0x8')]('/:id/configurations',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xd')]);router[_0x0ae6('0x8')](_0x0ae6('0xe'),auth['isAuthenticated'](),controller[_0x0ae6('0xf')]);router[_0x0ae6('0x10')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x11')]);router[_0x0ae6('0x10')](_0x0ae6('0x12'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x13')]);router[_0x0ae6('0x14')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x15')]);router[_0x0ae6('0x16')](_0x0ae6('0xb'),auth['isAuthenticated'](),controller[_0x0ae6('0x17')]);module[_0x0ae6('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index d755075..967f57f 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcbb=['exports','STRING','username','remoteUri','sequelize'];(function(_0x331674,_0xe1c87f){var _0x563de2=function(_0x296b38){while(--_0x296b38){_0x331674['push'](_0x331674['shift']());}};_0x563de2(++_0xe1c87f);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x5c1c24,_0x54e83d){_0x5c1c24=_0x5c1c24-0x0;var _0x40e2cd=_0xfcbb[_0x5c1c24];return _0x40e2cd;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xbfcb('0x3')},'apiKey':{'type':Sequelize[_0xbfcb('0x2')]},'remoteUri':{'type':Sequelize[_0xbfcb('0x2')],'unique':_0xbfcb('0x4')},'serverUrl':{'type':Sequelize[_0xbfcb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0598=['exports','STRING','sequelize'];(function(_0x5216e0,_0x4f8cb9){var _0x5b3f40=function(_0x30c832){while(--_0x30c832){_0x5216e0['push'](_0x5216e0['shift']());}};_0x5b3f40(++_0x4f8cb9);}(_0x0598,0x92));var _0x8059=function(_0x3efdb9,_0x598b5e){_0x3efdb9=_0x3efdb9-0x0;var _0x4465cf=_0x0598[_0x3efdb9];return _0x4465cf;};'use strict';var Sequelize=require(_0x8059('0x0'));module[_0x8059('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8059('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x8059('0x2')]},'remoteUri':{'type':Sequelize[_0x8059('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 136afb9..56c9ecf 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x012f=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','merge','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0x012f,0xc1));var _0xf012=function(_0x207b92,_0x16778b){_0x207b92=_0x207b92-0x0;var _0xa32e72=_0x012f[_0x207b92];return _0xa32e72;};'use strict';var emlformat=require(_0xf012('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf012('0x1'));var jsonpatch=require(_0xf012('0x2'));var rp=require(_0xf012('0x3'));var moment=require(_0xf012('0x4'));var BPromise=require(_0xf012('0x5'));var Mustache=require(_0xf012('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf012('0x7'));var csv=require(_0xf012('0x8'));var ejs=require(_0xf012('0x9'));var fs=require('fs');var fs_extra=require(_0xf012('0xa'));var _=require(_0xf012('0xb'));var squel=require('squel');var crypto=require(_0xf012('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf012('0xd'));var toCsv=require(_0xf012('0x8'));var querystring=require('querystring');var Papa=require(_0xf012('0xe'));var Redis=require(_0xf012('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf012('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf012('0x11'));var logger=require(_0xf012('0x12'))(_0xf012('0x13'));var utils=require('../../config/utils');var config=require(_0xf012('0x14'));var licenseUtil=require(_0xf012('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf012('0x16'));function respondWithStatusCode(_0x4223a2,_0xd6a6){_0xd6a6=_0xd6a6||0xcc;return function(_0x35dca9){if(_0x35dca9){return _0x4223a2['sendStatus'](_0xd6a6);}return _0x4223a2[_0xf012('0x17')](_0xd6a6)['end']();};}function respondWithResult(_0x53cd77,_0xa844af){_0xa844af=_0xa844af||0xc8;return function(_0x47adf0){if(_0x47adf0){return _0x53cd77[_0xf012('0x17')](_0xa844af)[_0xf012('0x18')](_0x47adf0);}};}function respondWithFilteredResult(_0x222316,_0x145199){return function(_0x2edf61){if(_0x2edf61){var _0x87c9ee=typeof _0x145199[_0xf012('0x19')]===_0xf012('0x1a')&&typeof _0x145199['limit']===_0xf012('0x1a');var _0x58d543=_0x2edf61[_0xf012('0x1b')];var _0x209acd=_0x87c9ee?0x0:_0x145199[_0xf012('0x19')];var _0x2e2364=_0x87c9ee?_0x2edf61['count']:_0x145199[_0xf012('0x19')]+_0x145199['limit'];var _0x57e34f;if(_0x2e2364>=_0x58d543){_0x2e2364=_0x58d543;_0x57e34f=0xc8;}else{_0x57e34f=0xce;}_0x222316[_0xf012('0x17')](_0x57e34f);return _0x222316[_0xf012('0x1c')](_0xf012('0x1d'),_0x209acd+'-'+_0x2e2364+'/'+_0x58d543)['json'](_0x2edf61);}return null;};}function patchUpdates(_0x468734){return function(_0x2df8bf){try{jsonpatch[_0xf012('0x1e')](_0x2df8bf,_0x468734,!![]);}catch(_0x38bd09){return BPromise[_0xf012('0x1f')](_0x38bd09);}return _0x2df8bf[_0xf012('0x20')]();};}function saveUpdates(_0xa475dd,_0x2bb7fe){return function(_0x19fafe){if(_0x19fafe){return _0x19fafe[_0xf012('0x21')](_0xa475dd)[_0xf012('0x22')](function(_0x3bab48){return _0x3bab48;});}return null;};}function removeEntity(_0x5a3307,_0x1f38a5){return function(_0x48d427){if(_0x48d427){return _0x48d427[_0xf012('0x23')]()[_0xf012('0x22')](function(){_0x5a3307['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x620a59,_0x94b71e){return function(_0x217ec1){if(!_0x217ec1){_0x620a59[_0xf012('0x24')](0x194);}return _0x217ec1;};}function handleError(_0x4e6457,_0x3a6096){_0x3a6096=_0x3a6096||0x1f4;return function(_0x4269e1){logger[_0xf012('0x25')](_0x4269e1[_0xf012('0x26')]);if(_0x4269e1[_0xf012('0x27')]){delete _0x4269e1['name'];}_0x4e6457[_0xf012('0x17')](_0x3a6096)[_0xf012('0x28')](_0x4269e1);};}exports[_0xf012('0x29')]=function(_0x48ab60,_0x3ffaf6){var _0x59e486={},_0x2aafa4={},_0x199d96={'count':0x0,'rows':[]};var _0x116d22=_[_0xf012('0x2a')](db[_0xf012('0x2b')][_0xf012('0x2c')],function(_0x8606fd){return{'name':_0x8606fd[_0xf012('0x2d')],'type':_0x8606fd[_0xf012('0x2e')][_0xf012('0x2f')]};});_0x2aafa4[_0xf012('0x30')]=_[_0xf012('0x2a')](_0x116d22,_0xf012('0x27'));_0x2aafa4[_0xf012('0x31')]=_[_0xf012('0x32')](_0x48ab60[_0xf012('0x31')]);_0x2aafa4[_0xf012('0x33')]=_['intersection'](_0x2aafa4[_0xf012('0x30')],_0x2aafa4['query']);_0x59e486[_0xf012('0x34')]=_[_0xf012('0x35')](_0x2aafa4[_0xf012('0x30')],qs[_0xf012('0x36')](_0x48ab60[_0xf012('0x31')][_0xf012('0x36')]));_0x59e486[_0xf012('0x34')]=_0x59e486[_0xf012('0x34')][_0xf012('0x37')]?_0x59e486['attributes']:_0x2aafa4[_0xf012('0x30')];if(!_0x48ab60[_0xf012('0x31')][_0xf012('0x38')]('nolimit')){_0x59e486[_0xf012('0x39')]=qs[_0xf012('0x39')](_0x48ab60[_0xf012('0x31')][_0xf012('0x39')]);_0x59e486['offset']=qs[_0xf012('0x19')](_0x48ab60['query']['offset']);}_0x59e486['order']=qs[_0xf012('0x3a')](_0x48ab60['query'][_0xf012('0x3a')]);_0x59e486[_0xf012('0x3b')]=qs[_0xf012('0x33')](_[_0xf012('0x3c')](_0x48ab60['query'],_0x2aafa4['filters']),_0x116d22);if(_0x48ab60['query'][_0xf012('0x3d')]){_0x59e486[_0xf012('0x3b')]=_['merge'](_0x59e486[_0xf012('0x3b')],{'$or':_['map'](_0x116d22,function(_0x88075d){if(_0x88075d[_0xf012('0x2e')]!==_0xf012('0x3e')){var _0x10e1c9={};_0x10e1c9[_0x88075d['name']]={'$like':'%'+_0x48ab60[_0xf012('0x31')][_0xf012('0x3d')]+'%'};return _0x10e1c9;}})});}_0x59e486=_['merge']({},_0x59e486,_0x48ab60[_0xf012('0x3f')]);var _0x46a44f={'where':_0x59e486[_0xf012('0x3b')]};return db[_0xf012('0x2b')][_0xf012('0x1b')](_0x46a44f)[_0xf012('0x22')](function(_0x393bc5){_0x199d96[_0xf012('0x1b')]=_0x393bc5;if(_0x48ab60[_0xf012('0x31')][_0xf012('0x40')]){_0x59e486['include']=[{'all':!![]}];}return db[_0xf012('0x2b')][_0xf012('0x41')](_0x59e486);})[_0xf012('0x22')](function(_0x338360){_0x199d96[_0xf012('0x42')]=_0x338360;return _0x199d96;})[_0xf012('0x22')](respondWithFilteredResult(_0x3ffaf6,_0x59e486))[_0xf012('0x43')](handleError(_0x3ffaf6,null));};exports[_0xf012('0x44')]=function(_0x12ef75,_0x263595){var _0x46d3be={'raw':![],'where':{'id':_0x12ef75[_0xf012('0x45')]['id']}},_0x2825e7={};_0x2825e7['model']=_['keys'](db[_0xf012('0x2b')]['rawAttributes']);_0x2825e7[_0xf012('0x31')]=_['keys'](_0x12ef75['query']);_0x2825e7[_0xf012('0x33')]=_[_0xf012('0x35')](_0x2825e7[_0xf012('0x30')],_0x2825e7[_0xf012('0x31')]);_0x46d3be[_0xf012('0x34')]=_['intersection'](_0x2825e7[_0xf012('0x30')],qs[_0xf012('0x36')](_0x12ef75['query']['fields']));_0x46d3be[_0xf012('0x34')]=_0x46d3be[_0xf012('0x34')][_0xf012('0x37')]?_0x46d3be[_0xf012('0x34')]:_0x2825e7[_0xf012('0x30')];if(_0x12ef75[_0xf012('0x31')]['includeAll']){_0x46d3be[_0xf012('0x46')]=[{'all':!![]}];}_0x46d3be=_['merge']({},_0x46d3be,_0x12ef75[_0xf012('0x3f')]);return db[_0xf012('0x2b')]['find'](_0x46d3be)[_0xf012('0x22')](handleEntityNotFound(_0x263595,null))[_0xf012('0x22')](respondWithResult(_0x263595,null))['catch'](handleError(_0x263595,null));};exports[_0xf012('0x47')]=function(_0xcee8d8,_0x4aaa0e){return db[_0xf012('0x2b')]['create'](_0xcee8d8[_0xf012('0x48')],{})[_0xf012('0x22')](respondWithResult(_0x4aaa0e,0xc9))[_0xf012('0x43')](handleError(_0x4aaa0e,null));};exports[_0xf012('0x21')]=function(_0x29cdb2,_0x196307){if(_0x29cdb2['body']['id']){delete _0x29cdb2[_0xf012('0x48')]['id'];}return db[_0xf012('0x2b')][_0xf012('0x49')]({'where':{'id':_0x29cdb2[_0xf012('0x45')]['id']}})['then'](handleEntityNotFound(_0x196307,null))[_0xf012('0x22')](saveUpdates(_0x29cdb2[_0xf012('0x48')],null))[_0xf012('0x22')](respondWithResult(_0x196307,null))['catch'](handleError(_0x196307,null));};exports[_0xf012('0x23')]=function(_0x49abf8,_0x100d5a){return db[_0xf012('0x2b')][_0xf012('0x49')]({'where':{'id':_0x49abf8['params']['id']}})['then'](handleEntityNotFound(_0x100d5a,null))[_0xf012('0x22')](removeEntity(_0x100d5a,null))[_0xf012('0x43')](handleError(_0x100d5a,null));};exports[_0xf012('0x4a')]=function(_0x1142ff,_0x1b77a3,_0x1b00c1){var _0xcc18c8={};var _0x54b7b3={};var _0x3924e7;var _0x314769;return db[_0xf012('0x2b')][_0xf012('0x4b')]({'where':{'id':_0x1142ff[_0xf012('0x45')]['id']}})[_0xf012('0x22')](handleEntityNotFound(_0x1b77a3,null))['then'](function(_0x585f62){if(_0x585f62){_0x3924e7=_0x585f62;_0x54b7b3[_0xf012('0x30')]=_['keys'](db[_0xf012('0x4c')]['rawAttributes']);_0x54b7b3[_0xf012('0x31')]=_[_0xf012('0x32')](_0x1142ff[_0xf012('0x31')]);_0x54b7b3[_0xf012('0x33')]=_[_0xf012('0x35')](_0x54b7b3['model'],_0x54b7b3['query']);_0xcc18c8[_0xf012('0x34')]=_['intersection'](_0x54b7b3['model'],qs[_0xf012('0x36')](_0x1142ff[_0xf012('0x31')][_0xf012('0x36')]));_0xcc18c8[_0xf012('0x34')]=_0xcc18c8[_0xf012('0x34')][_0xf012('0x37')]?_0xcc18c8[_0xf012('0x34')]:_0x54b7b3[_0xf012('0x30')];_0xcc18c8['order']=qs[_0xf012('0x3a')](_0x1142ff['query'][_0xf012('0x3a')]);_0xcc18c8[_0xf012('0x3b')]=qs['filters'](_[_0xf012('0x3c')](_0x1142ff['query'],_0x54b7b3['filters']));if(_0x1142ff[_0xf012('0x31')][_0xf012('0x3d')]){_0xcc18c8[_0xf012('0x3b')]=_['merge'](_0xcc18c8['where'],{'$or':_[_0xf012('0x2a')](_0xcc18c8[_0xf012('0x34')],function(_0x1642f0){var _0x5e4562={};_0x5e4562[_0x1642f0]={'$like':'%'+_0x1142ff[_0xf012('0x31')][_0xf012('0x3d')]+'%'};return _0x5e4562;})});}_0xcc18c8=_[_0xf012('0x4d')]({},_0xcc18c8,_0x1142ff[_0xf012('0x3f')]);return _0x3924e7[_0xf012('0x4a')](_0xcc18c8);}})[_0xf012('0x22')](function(_0x149b47){if(_0x149b47){_0x314769=_0x149b47[_0xf012('0x37')];if(!_0x1142ff[_0xf012('0x31')][_0xf012('0x38')](_0xf012('0x4e'))){_0xcc18c8['limit']=qs[_0xf012('0x39')](_0x1142ff[_0xf012('0x31')][_0xf012('0x39')]);_0xcc18c8[_0xf012('0x19')]=qs[_0xf012('0x19')](_0x1142ff[_0xf012('0x31')][_0xf012('0x19')]);}return _0x3924e7[_0xf012('0x4a')](_0xcc18c8);}})[_0xf012('0x22')](function(_0x1fd82a){if(_0x1fd82a){return _0x1fd82a?{'count':_0x314769,'rows':_0x1fd82a}:null;}})[_0xf012('0x22')](respondWithResult(_0x1b77a3,null))['catch'](handleError(_0x1b77a3,null));};exports[_0xf012('0x4f')]=function(_0x9a56,_0x3ec1c5,_0x11cbf4){if(_0x9a56[_0xf012('0x48')]['id']){delete _0x9a56['body']['id'];}return db[_0xf012('0x2b')][_0xf012('0x4b')]({'where':{'id':_0x9a56[_0xf012('0x45')]['id']}})[_0xf012('0x22')](handleEntityNotFound(_0x3ec1c5,null))[_0xf012('0x22')](function(_0x245877){if(_0x245877){_0x9a56['body'][_0xf012('0x50')]=_0x245877['id'];_0x9a56[_0xf012('0x48')]['Subjects']=integrations[_0xf012('0x51')](_0x9a56['body']['channel'],_0x9a56['body'][_0xf012('0x2e')]);_0x9a56[_0xf012('0x48')][_0xf012('0x52')]=integrations[_0xf012('0x53')](_0x9a56[_0xf012('0x48')][_0xf012('0x54')],_0x9a56[_0xf012('0x48')][_0xf012('0x2e')]);return db['FreshsalesConfiguration'][_0xf012('0x47')](_0x9a56[_0xf012('0x48')],{'include':[{'model':db[_0xf012('0x55')],'as':_0xf012('0x56')},{'model':db['FreshsalesField'],'as':_0xf012('0x52')}]});}return null;})[_0xf012('0x22')](respondWithResult(_0x3ec1c5,null))['catch'](handleError(_0x3ec1c5,null));};exports[_0xf012('0x57')]=function(_0x2b87f6,_0x312aef,_0x334c9a){var _0x4ae20a='';var _0x507e29='';return db['FreshsalesAccount'][_0xf012('0x4b')]({'where':{'id':_0x2b87f6['params']['id']},'attributes':['id',_0xf012('0x58'),_0xf012('0x59'),_0xf012('0x5a')]})[_0xf012('0x22')](handleEntityNotFound(_0x312aef,null))[_0xf012('0x22')](function(_0x45f85f){if(_0x45f85f){_0x507e29=_0x45f85f['username'];_0x4ae20a=_0x45f85f[_0xf012('0x59')];var _0x63c25e=_0x45f85f[_0xf012('0x59')][_0xf012('0x5b')](-0x1);if(_0x63c25e==='/'){_0x4ae20a=_0x4ae20a['substring'](0x0,_0x4ae20a[_0xf012('0x5c')](_0x63c25e));}return rp({'method':_0xf012('0x5d'),'uri':util[_0xf012('0x5e')](_0xf012('0x5f'),_0x4ae20a,_0xf012('0x60')),'headers':{'Authorization':'Token\x20token='+_0x45f85f[_0xf012('0x5a')]},'json':!![]});}})['then'](function(_0x3a6af7){if(_0x3a6af7){var _0x45b8a0=_0x3a6af7[_0xf012('0x61')];var _0x2640ca=![];var _0x2e0693=null;for(_0x2e0693=0x0;_0x2e0693<_0x45b8a0[_0xf012('0x37')];_0x2e0693++){if(_0x45b8a0[_0x2e0693][_0xf012('0x62')]===_0x507e29){_0x2640ca=!![];}}if(_0x2640ca){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xf012('0x22')](respondWithResult(_0x312aef,null))[_0xf012('0x43')](function(_0x4520a3){var _0x33a0f2=_0x2b87f6[_0xf012('0x31')][_0xf012('0x63')]?0x1f4:_0x4520a3[_0xf012('0x64')]||0x1f4;logger['error'](_0xf012('0x65'),'getFields',_0x33a0f2,JSON[_0xf012('0x66')](_0x4520a3));delete _0x4520a3[_0xf012('0x27')];if(_0x33a0f2===0x191){_0x33a0f2=0x190;}_0x312aef[_0xf012('0x17')](_0x33a0f2)[_0xf012('0x28')](_0x2b87f6['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x4520a3[_0xf012('0x64')]}:_0x4520a3);});}; \ No newline at end of file +var _0x1152=['slice','substring','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','stringify','test','Wrong\x20credentials','statusCode','eml-format','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','options','include','findAll','catch','show','includeAll','find','create','body','params','destroy','findOne','FreshsalesConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','FreshsalesField','Descriptions','getFields','username','remoteUri'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1152,0xdc));var _0x2115=function(_0x10b2d5,_0x5a7743){_0x10b2d5=_0x10b2d5-0x0;var _0x14b8d1=_0x1152[_0x10b2d5];return _0x14b8d1;};'use strict';var emlformat=require(_0x2115('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2115('0x3'));var path=require(_0x2115('0x4'));var sox=require(_0x2115('0x5'));var csv=require(_0x2115('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2115('0x7'));var _=require(_0x2115('0x8'));var squel=require('squel');var crypto=require(_0x2115('0x9'));var jsforce=require(_0x2115('0xa'));var deskjs=require(_0x2115('0xb'));var toCsv=require(_0x2115('0x6'));var querystring=require(_0x2115('0xc'));var Papa=require(_0x2115('0xd'));var Redis=require(_0x2115('0xe'));var authService=require(_0x2115('0xf'));var qs=require(_0x2115('0x10'));var as=require(_0x2115('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2115('0x12'))(_0x2115('0x13'));var utils=require(_0x2115('0x14'));var config=require(_0x2115('0x15'));var licenseUtil=require(_0x2115('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2115('0x17'));function respondWithStatusCode(_0x25e477,_0x3def03){_0x3def03=_0x3def03||0xcc;return function(_0x33aeb2){if(_0x33aeb2){return _0x25e477[_0x2115('0x18')](_0x3def03);}return _0x25e477[_0x2115('0x19')](_0x3def03)[_0x2115('0x1a')]();};}function respondWithResult(_0x4e7e8e,_0x53a5b4){_0x53a5b4=_0x53a5b4||0xc8;return function(_0x435f95){if(_0x435f95){return _0x4e7e8e['status'](_0x53a5b4)[_0x2115('0x1b')](_0x435f95);}};}function respondWithFilteredResult(_0x5c70c2,_0x2a3e1b){return function(_0x1621db){if(_0x1621db){var _0x3aa8cb=typeof _0x2a3e1b['offset']==='undefined'&&typeof _0x2a3e1b['limit']===_0x2115('0x1c');var _0x2f255a=_0x1621db[_0x2115('0x1d')];var _0x443370=_0x3aa8cb?0x0:_0x2a3e1b[_0x2115('0x1e')];var _0x709ecb=_0x3aa8cb?_0x1621db['count']:_0x2a3e1b['offset']+_0x2a3e1b[_0x2115('0x1f')];var _0x5ef498;if(_0x709ecb>=_0x2f255a){_0x709ecb=_0x2f255a;_0x5ef498=0xc8;}else{_0x5ef498=0xce;}_0x5c70c2['status'](_0x5ef498);return _0x5c70c2[_0x2115('0x20')](_0x2115('0x21'),_0x443370+'-'+_0x709ecb+'/'+_0x2f255a)['json'](_0x1621db);}return null;};}function patchUpdates(_0x576681){return function(_0x496acf){try{jsonpatch[_0x2115('0x22')](_0x496acf,_0x576681,!![]);}catch(_0x542976){return BPromise[_0x2115('0x23')](_0x542976);}return _0x496acf['save']();};}function saveUpdates(_0x317362,_0x398d43){return function(_0x2e8c73){if(_0x2e8c73){return _0x2e8c73[_0x2115('0x24')](_0x317362)[_0x2115('0x25')](function(_0x1280de){return _0x1280de;});}return null;};}function removeEntity(_0x1a94f9,_0x4790d4){return function(_0x2ff89d){if(_0x2ff89d){return _0x2ff89d['destroy']()['then'](function(){_0x1a94f9['status'](0xcc)[_0x2115('0x1a')]();});}};}function handleEntityNotFound(_0xa7ea1,_0x8e375c){return function(_0x1761c0){if(!_0x1761c0){_0xa7ea1[_0x2115('0x18')](0x194);}return _0x1761c0;};}function handleError(_0x3b01eb,_0x329188){_0x329188=_0x329188||0x1f4;return function(_0x5c437e){logger[_0x2115('0x26')](_0x5c437e[_0x2115('0x27')]);if(_0x5c437e[_0x2115('0x28')]){delete _0x5c437e['name'];}_0x3b01eb['status'](_0x329188)[_0x2115('0x29')](_0x5c437e);};}exports[_0x2115('0x2a')]=function(_0xd14e5b,_0x38efc4){var _0x10e5e0={},_0x3be5c7={},_0x50db06={'count':0x0,'rows':[]};var _0x269a7f=_[_0x2115('0x2b')](db[_0x2115('0x2c')][_0x2115('0x2d')],function(_0x26936e){return{'name':_0x26936e[_0x2115('0x2e')],'type':_0x26936e[_0x2115('0x2f')]['key']};});_0x3be5c7[_0x2115('0x30')]=_[_0x2115('0x2b')](_0x269a7f,_0x2115('0x28'));_0x3be5c7[_0x2115('0x31')]=_[_0x2115('0x32')](_0xd14e5b[_0x2115('0x31')]);_0x3be5c7[_0x2115('0x33')]=_['intersection'](_0x3be5c7[_0x2115('0x30')],_0x3be5c7[_0x2115('0x31')]);_0x10e5e0[_0x2115('0x34')]=_[_0x2115('0x35')](_0x3be5c7[_0x2115('0x30')],qs[_0x2115('0x36')](_0xd14e5b[_0x2115('0x31')]['fields']));_0x10e5e0[_0x2115('0x34')]=_0x10e5e0[_0x2115('0x34')][_0x2115('0x37')]?_0x10e5e0[_0x2115('0x34')]:_0x3be5c7[_0x2115('0x30')];if(!_0xd14e5b['query']['hasOwnProperty'](_0x2115('0x38'))){_0x10e5e0['limit']=qs[_0x2115('0x1f')](_0xd14e5b['query']['limit']);_0x10e5e0[_0x2115('0x1e')]=qs[_0x2115('0x1e')](_0xd14e5b[_0x2115('0x31')][_0x2115('0x1e')]);}_0x10e5e0['order']=qs[_0x2115('0x39')](_0xd14e5b[_0x2115('0x31')][_0x2115('0x39')]);_0x10e5e0[_0x2115('0x3a')]=qs[_0x2115('0x33')](_[_0x2115('0x3b')](_0xd14e5b['query'],_0x3be5c7['filters']),_0x269a7f);if(_0xd14e5b[_0x2115('0x31')][_0x2115('0x3c')]){_0x10e5e0[_0x2115('0x3a')]=_[_0x2115('0x3d')](_0x10e5e0['where'],{'$or':_[_0x2115('0x2b')](_0x269a7f,function(_0x7991ab){if(_0x7991ab['type']!=='VIRTUAL'){var _0x16b49d={};_0x16b49d[_0x7991ab[_0x2115('0x28')]]={'$like':'%'+_0xd14e5b[_0x2115('0x31')]['filter']+'%'};return _0x16b49d;}})});}_0x10e5e0=_[_0x2115('0x3d')]({},_0x10e5e0,_0xd14e5b[_0x2115('0x3e')]);var _0x5f09bc={'where':_0x10e5e0[_0x2115('0x3a')]};return db[_0x2115('0x2c')]['count'](_0x5f09bc)['then'](function(_0x2115bf){_0x50db06[_0x2115('0x1d')]=_0x2115bf;if(_0xd14e5b[_0x2115('0x31')]['includeAll']){_0x10e5e0[_0x2115('0x3f')]=[{'all':!![]}];}return db[_0x2115('0x2c')][_0x2115('0x40')](_0x10e5e0);})[_0x2115('0x25')](function(_0x136bcd){_0x50db06['rows']=_0x136bcd;return _0x50db06;})['then'](respondWithFilteredResult(_0x38efc4,_0x10e5e0))[_0x2115('0x41')](handleError(_0x38efc4,null));};exports[_0x2115('0x42')]=function(_0x340bb7,_0x4b22af){var _0x6cf14d={'raw':![],'where':{'id':_0x340bb7['params']['id']}},_0x420f55={};_0x420f55[_0x2115('0x30')]=_['keys'](db['FreshsalesAccount'][_0x2115('0x2d')]);_0x420f55[_0x2115('0x31')]=_[_0x2115('0x32')](_0x340bb7['query']);_0x420f55[_0x2115('0x33')]=_[_0x2115('0x35')](_0x420f55[_0x2115('0x30')],_0x420f55[_0x2115('0x31')]);_0x6cf14d['attributes']=_[_0x2115('0x35')](_0x420f55[_0x2115('0x30')],qs[_0x2115('0x36')](_0x340bb7[_0x2115('0x31')][_0x2115('0x36')]));_0x6cf14d[_0x2115('0x34')]=_0x6cf14d[_0x2115('0x34')][_0x2115('0x37')]?_0x6cf14d['attributes']:_0x420f55[_0x2115('0x30')];if(_0x340bb7[_0x2115('0x31')][_0x2115('0x43')]){_0x6cf14d[_0x2115('0x3f')]=[{'all':!![]}];}_0x6cf14d=_[_0x2115('0x3d')]({},_0x6cf14d,_0x340bb7[_0x2115('0x3e')]);return db['FreshsalesAccount'][_0x2115('0x44')](_0x6cf14d)[_0x2115('0x25')](handleEntityNotFound(_0x4b22af,null))['then'](respondWithResult(_0x4b22af,null))[_0x2115('0x41')](handleError(_0x4b22af,null));};exports[_0x2115('0x45')]=function(_0x431a09,_0x121273){return db[_0x2115('0x2c')][_0x2115('0x45')](_0x431a09['body'],{})[_0x2115('0x25')](respondWithResult(_0x121273,0xc9))[_0x2115('0x41')](handleError(_0x121273,null));};exports[_0x2115('0x24')]=function(_0x44e136,_0x5a3f6a){if(_0x44e136[_0x2115('0x46')]['id']){delete _0x44e136['body']['id'];}return db[_0x2115('0x2c')][_0x2115('0x44')]({'where':{'id':_0x44e136[_0x2115('0x47')]['id']}})[_0x2115('0x25')](handleEntityNotFound(_0x5a3f6a,null))['then'](saveUpdates(_0x44e136['body'],null))[_0x2115('0x25')](respondWithResult(_0x5a3f6a,null))[_0x2115('0x41')](handleError(_0x5a3f6a,null));};exports[_0x2115('0x48')]=function(_0x38cfa1,_0x24035c){return db[_0x2115('0x2c')][_0x2115('0x44')]({'where':{'id':_0x38cfa1[_0x2115('0x47')]['id']}})[_0x2115('0x25')](handleEntityNotFound(_0x24035c,null))['then'](removeEntity(_0x24035c,null))[_0x2115('0x41')](handleError(_0x24035c,null));};exports['getConfigurations']=function(_0x13ded3,_0x4c59fd,_0x384f95){var _0x2466ab={};var _0x1db9c7={};var _0x3b6397;var _0xdaa640;return db['FreshsalesAccount'][_0x2115('0x49')]({'where':{'id':_0x13ded3[_0x2115('0x47')]['id']}})[_0x2115('0x25')](handleEntityNotFound(_0x4c59fd,null))['then'](function(_0x2601a9){if(_0x2601a9){_0x3b6397=_0x2601a9;_0x1db9c7[_0x2115('0x30')]=_['keys'](db[_0x2115('0x4a')][_0x2115('0x2d')]);_0x1db9c7[_0x2115('0x31')]=_[_0x2115('0x32')](_0x13ded3['query']);_0x1db9c7['filters']=_[_0x2115('0x35')](_0x1db9c7[_0x2115('0x30')],_0x1db9c7[_0x2115('0x31')]);_0x2466ab[_0x2115('0x34')]=_[_0x2115('0x35')](_0x1db9c7[_0x2115('0x30')],qs[_0x2115('0x36')](_0x13ded3['query'][_0x2115('0x36')]));_0x2466ab[_0x2115('0x34')]=_0x2466ab[_0x2115('0x34')]['length']?_0x2466ab[_0x2115('0x34')]:_0x1db9c7[_0x2115('0x30')];_0x2466ab[_0x2115('0x4b')]=qs['sort'](_0x13ded3['query'][_0x2115('0x39')]);_0x2466ab[_0x2115('0x3a')]=qs[_0x2115('0x33')](_[_0x2115('0x3b')](_0x13ded3[_0x2115('0x31')],_0x1db9c7[_0x2115('0x33')]));if(_0x13ded3[_0x2115('0x31')][_0x2115('0x3c')]){_0x2466ab[_0x2115('0x3a')]=_[_0x2115('0x3d')](_0x2466ab['where'],{'$or':_[_0x2115('0x2b')](_0x2466ab[_0x2115('0x34')],function(_0x321c80){var _0x47074e={};_0x47074e[_0x321c80]={'$like':'%'+_0x13ded3[_0x2115('0x31')][_0x2115('0x3c')]+'%'};return _0x47074e;})});}_0x2466ab=_[_0x2115('0x3d')]({},_0x2466ab,_0x13ded3[_0x2115('0x3e')]);return _0x3b6397[_0x2115('0x4c')](_0x2466ab);}})['then'](function(_0x2953f0){if(_0x2953f0){_0xdaa640=_0x2953f0[_0x2115('0x37')];if(!_0x13ded3[_0x2115('0x31')][_0x2115('0x4d')]('nolimit')){_0x2466ab[_0x2115('0x1f')]=qs[_0x2115('0x1f')](_0x13ded3[_0x2115('0x31')]['limit']);_0x2466ab[_0x2115('0x1e')]=qs[_0x2115('0x1e')](_0x13ded3['query'][_0x2115('0x1e')]);}return _0x3b6397[_0x2115('0x4c')](_0x2466ab);}})['then'](function(_0x5ac4ee){if(_0x5ac4ee){return _0x5ac4ee?{'count':_0xdaa640,'rows':_0x5ac4ee}:null;}})[_0x2115('0x25')](respondWithResult(_0x4c59fd,null))[_0x2115('0x41')](handleError(_0x4c59fd,null));};exports[_0x2115('0x4e')]=function(_0x41a21b,_0x79af8e,_0x48205a){if(_0x41a21b[_0x2115('0x46')]['id']){delete _0x41a21b[_0x2115('0x46')]['id'];}return db[_0x2115('0x2c')][_0x2115('0x49')]({'where':{'id':_0x41a21b[_0x2115('0x47')]['id']}})[_0x2115('0x25')](handleEntityNotFound(_0x79af8e,null))[_0x2115('0x25')](function(_0xd59c15){if(_0xd59c15){_0x41a21b[_0x2115('0x46')][_0x2115('0x4f')]=_0xd59c15['id'];_0x41a21b[_0x2115('0x46')][_0x2115('0x50')]=integrations[_0x2115('0x51')](_0x41a21b[_0x2115('0x46')]['channel'],_0x41a21b[_0x2115('0x46')][_0x2115('0x2f')]);_0x41a21b['body']['Descriptions']=integrations[_0x2115('0x52')](_0x41a21b[_0x2115('0x46')][_0x2115('0x53')],_0x41a21b[_0x2115('0x46')][_0x2115('0x2f')]);return db['FreshsalesConfiguration'][_0x2115('0x45')](_0x41a21b[_0x2115('0x46')],{'include':[{'model':db['FreshsalesField'],'as':_0x2115('0x50')},{'model':db[_0x2115('0x54')],'as':_0x2115('0x55')}]});}return null;})[_0x2115('0x25')](respondWithResult(_0x79af8e,null))['catch'](handleError(_0x79af8e,null));};exports[_0x2115('0x56')]=function(_0x54cc86,_0xd328d2,_0xa832b6){var _0x271275='';var _0x1dd7db='';return db[_0x2115('0x2c')][_0x2115('0x49')]({'where':{'id':_0x54cc86[_0x2115('0x47')]['id']},'attributes':['id',_0x2115('0x57'),_0x2115('0x58'),'apiKey']})['then'](handleEntityNotFound(_0xd328d2,null))['then'](function(_0x150ede){if(_0x150ede){_0x1dd7db=_0x150ede['username'];_0x271275=_0x150ede[_0x2115('0x58')];var _0x594753=_0x150ede['remoteUri'][_0x2115('0x59')](-0x1);if(_0x594753==='/'){_0x271275=_0x271275[_0x2115('0x5a')](0x0,_0x271275[_0x2115('0x5b')](_0x594753));}return rp({'method':_0x2115('0x5c'),'uri':util[_0x2115('0x5d')]('%s%s',_0x271275,_0x2115('0x5e')),'headers':{'Authorization':_0x2115('0x5f')+_0x150ede['apiKey']},'json':!![]});}})[_0x2115('0x25')](function(_0x4edc7b){if(_0x4edc7b){var _0x1b6f71=_0x4edc7b[_0x2115('0x60')];var _0x481999=![];var _0x5ca466=null;for(_0x5ca466=0x0;_0x5ca466<_0x1b6f71['length'];_0x5ca466++){if(_0x1b6f71[_0x5ca466][_0x2115('0x61')]===_0x1dd7db){_0x481999=!![];}}if(_0x481999){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2115('0x62')});}}})[_0x2115('0x25')](respondWithResult(_0xd328d2,null))[_0x2115('0x41')](function(_0x51966c){var _0x98ccf7=_0x54cc86[_0x2115('0x31')]['test']?0x1f4:_0x51966c['statusCode']||0x1f4;logger[_0x2115('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x2115('0x56'),_0x98ccf7,JSON[_0x2115('0x63')](_0x51966c));delete _0x51966c[_0x2115('0x28')];if(_0x98ccf7===0x191){_0x98ccf7=0x190;}_0xd328d2[_0x2115('0x19')](_0x98ccf7)[_0x2115('0x29')](_0x54cc86['query'][_0x2115('0x64')]?{'message':_0x2115('0x65'),'statusCode':_0x51966c[_0x2115('0x66')]}:_0x51966c);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 94550bc..d85f55c 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd943=['int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesAccount'];(function(_0x3c617b,_0x1407c2){var _0x4e87f0=function(_0x49d904){while(--_0x49d904){_0x3c617b['push'](_0x3c617b['shift']());}};_0x4e87f0(++_0x1407c2);}(_0xd943,0x15d));var _0x3d94=function(_0x9d6ab0,_0x567458){_0x9d6ab0=_0x9d6ab0-0x0;var _0x25ac0a=_0xd943[_0x9d6ab0];return _0x25ac0a;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3d94('0x9')]=function(_0x51cf1f,_0x54e81f){return _0x51cf1f['define'](_0x3d94('0xa'),attributes,{'tableName':_0x3d94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','int_freshsales_accounts'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xc2c7,0x134));var _0x7c2c=function(_0x36c76c,_0x1ac6fc){_0x36c76c=_0x36c76c-0x0;var _0xc59b4b=_0xc2c7[_0x36c76c];return _0xc59b4b;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x7c2c('0x8'));module[_0x7c2c('0x9')]=function(_0x23c038,_0x54f027){return _0x23c038['define']('FreshsalesAccount',attributes,{'tableName':_0x7c2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index ab077da..6da6b7a 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a6b=['find','map','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','then','debug','stringify','catch','ShowFreshsalesAccount'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x53ee43,_0x2a63ec){_0x53ee43=_0x53ee43-0x0;var _0x58b2ca=_0x0a6b[_0x53ee43];return _0x58b2ca;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')]({'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x582fc2['options']?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'include':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4b0479){return{'model':db[_0x4b0479[_0xb0a6('0x19')]],'as':_0x4b0479['as'],'attributes':_0x4b0479[_0xb0a6('0x16')],'include':_0x4b0479['include']?_[_0xb0a6('0x20')](_0x4b0479[_0xb0a6('0x18')],function(_0x52e397){return{'model':db[_0x52e397['model']],'as':_0x52e397['as'],'attributes':_0x52e397[_0xb0a6('0x16')],'include':_0x52e397[_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x52e397[_0xb0a6('0x18')],function(_0x4310ae){return{'model':db[_0x4310ae[_0xb0a6('0x19')]],'as':_0x4310ae['as'],'attributes':_0x4310ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x5c280e){logger[_0xb0a6('0x8')](_0xb0a6('0x1e'),_0x582fc2);logger['debug']('ShowFreshsalesAccount',_0x582fc2,JSON['stringify'](_0x5c280e));_0x309a91(_0x5c280e);})[_0xb0a6('0x1d')](function(_0xd484f){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0xd484f[_0xb0a6('0xe')],_0x582fc2);_0x114f91(_0x131e46['error'](0x1f4,_0xd484f[_0xb0a6('0xe')]));});});}; \ No newline at end of file +var _0x2ef3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','include','model','map','attributes','ShowFreshsalesAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x46b831,_0x4713a1){var _0x310835=function(_0x9924da){while(--_0x9924da){_0x46b831['push'](_0x46b831['shift']());}};_0x310835(++_0x4713a1);}(_0x2ef3,0xba));var _0x32ef=function(_0x228580,_0xb0c97a){_0x228580=_0x228580-0x0;var _0x50d170=_0x2ef3[_0x228580];return _0x50d170;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['findAll']({'raw':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x19')]||null:null,'attributes':_0x1a9476['options']?_0x1a9476[_0x32ef('0x17')]['attributes']||null:null,'limit':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')]['limit']||null:null,'include':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x1a')]?_['map'](_0x1a9476['options'][_0x32ef('0x1a')],function(_0xb30fab){return{'model':db[_0xb30fab[_0x32ef('0x1b')]],'as':_0xb30fab['as'],'attributes':_0xb30fab['attributes'],'include':_0xb30fab['include']?_[_0x32ef('0x1c')](_0xb30fab['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1b')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1d')],'include':_0x51a412[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x51a412[_0x32ef('0x1a')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1b')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x2f52d7){logger[_0x32ef('0xc')](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x2f52d7));_0x57863c(_0x2f52d7);})['catch'](function(_0x12de1a){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x12de1a[_0x32ef('0x13')],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x12de1a[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1e')]=function(_0x31dbc3){var _0x2ac686=this;return new Promise(function(_0x1b668a,_0x1a6ed2){return db[_0x32ef('0x16')]['find']({'raw':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x19')]||null:null,'attributes':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3[_0x32ef('0x17')][_0x32ef('0x1d')]||null:null,'include':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options']['include']?_[_0x32ef('0x1c')](_0x31dbc3['options'][_0x32ef('0x1a')],function(_0x15b873){return{'model':db[_0x15b873[_0x32ef('0x1b')]],'as':_0x15b873['as'],'attributes':_0x15b873[_0x32ef('0x1d')],'include':_0x15b873[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x15b873['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1d')],'include':_0x482d3a[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1b')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x480348){logger['info'](_0x32ef('0x1e'),_0x31dbc3);logger[_0x32ef('0x1f')](_0x32ef('0x1e'),_0x31dbc3,JSON[_0x32ef('0x10')](_0x480348));_0x1b668a(_0x480348);})[_0x32ef('0x14')](function(_0x211c79){logger[_0x32ef('0x11')](_0x32ef('0x1e'),_0x211c79[_0x32ef('0x13')],_0x31dbc3);_0x1a6ed2(_0x2ac686['error'](0x1f4,_0x211c79[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 3c0c572..d1bfe83 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20b8=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create'];(function(_0x58f37c,_0x2a5942){var _0x3951a9=function(_0x158cd5){while(--_0x158cd5){_0x58f37c['push'](_0x58f37c['shift']());}};_0x3951a9(++_0x2a5942);}(_0x20b8,0xef));var _0x820b=function(_0x308672,_0x3ac5b3){_0x308672=_0x308672-0x0;var _0x376902=_0x20b8[_0x308672];return _0x376902;};'use strict';var multer=require(_0x820b('0x0'));var util=require(_0x820b('0x1'));var path=require(_0x820b('0x2'));var timeout=require(_0x820b('0x3'));var express=require(_0x820b('0x4'));var router=express['Router']();var fs_extra=require(_0x820b('0x5'));var auth=require(_0x820b('0x6'));var interaction=require(_0x820b('0x7'));var config=require('../../config/environment');var controller=require(_0x820b('0x8'));router[_0x820b('0x9')]('/',auth[_0x820b('0xa')](),controller[_0x820b('0xb')]);router[_0x820b('0x9')](_0x820b('0xc'),auth[_0x820b('0xa')](),controller[_0x820b('0xd')]);router['get']('/:id/subjects',auth[_0x820b('0xa')](),controller[_0x820b('0xe')]);router[_0x820b('0x9')](_0x820b('0xf'),auth[_0x820b('0xa')](),controller[_0x820b('0x10')]);router[_0x820b('0x9')](_0x820b('0x11'),auth[_0x820b('0xa')](),controller[_0x820b('0x12')]);router[_0x820b('0x13')]('/',auth[_0x820b('0xa')](),controller[_0x820b('0x14')]);router[_0x820b('0x15')](_0x820b('0xc'),auth[_0x820b('0xa')](),controller[_0x820b('0x16')]);router[_0x820b('0x17')](_0x820b('0xc'),auth[_0x820b('0xa')](),controller[_0x820b('0x18')]);module[_0x820b('0x19')]=router; \ No newline at end of file +var _0x32f0=['getDescriptions','getFields','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','show','/:id/subjects','/:id/descriptions'];(function(_0x2b5a3c,_0x2f12e7){var _0x569d51=function(_0x366300){while(--_0x366300){_0x2b5a3c['push'](_0x2b5a3c['shift']());}};_0x569d51(++_0x2f12e7);}(_0x32f0,0x128));var _0x032f=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0x32f0[_0x1fd675];return _0x16b554;};'use strict';var multer=require('multer');var util=require(_0x032f('0x0'));var path=require('path');var timeout=require(_0x032f('0x1'));var express=require(_0x032f('0x2'));var router=express[_0x032f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x032f('0x4'));var config=require(_0x032f('0x5'));var controller=require(_0x032f('0x6'));router[_0x032f('0x7')]('/',auth[_0x032f('0x8')](),controller['index']);router[_0x032f('0x7')]('/:id',auth[_0x032f('0x8')](),controller[_0x032f('0x9')]);router['get'](_0x032f('0xa'),auth[_0x032f('0x8')](),controller['getSubjects']);router[_0x032f('0x7')](_0x032f('0xb'),auth['isAuthenticated'](),controller[_0x032f('0xc')]);router[_0x032f('0x7')]('/:id/fields',auth[_0x032f('0x8')](),controller[_0x032f('0xd')]);router[_0x032f('0xe')]('/',auth[_0x032f('0x8')](),controller[_0x032f('0xf')]);router[_0x032f('0x10')](_0x032f('0x11'),auth[_0x032f('0x8')](),controller[_0x032f('0x12')]);router[_0x032f('0x13')](_0x032f('0x11'),auth[_0x032f('0x8')](),controller[_0x032f('0x14')]);module[_0x032f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index b557545..09338b4 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5dbd=['STRING','sequelize','exports'];(function(_0x23179d,_0x20b4c7){var _0x402977=function(_0x59c012){while(--_0x59c012){_0x23179d['push'](_0x23179d['shift']());}};_0x402977(++_0x20b4c7);}(_0x5dbd,0x17e));var _0xd5db=function(_0x1fa4b9,_0xe330ef){_0x1fa4b9=_0x1fa4b9-0x0;var _0x9b47d1=_0x5dbd[_0x1fa4b9];return _0x9b47d1;};'use strict';var Sequelize=require(_0xd5db('0x0'));module[_0xd5db('0x1')]={'name':{'type':Sequelize[_0xd5db('0x2')]},'description':{'type':Sequelize[_0xd5db('0x2')]}}; \ No newline at end of file +var _0x8003=['exports','STRING'];(function(_0x9fdd0c,_0x59b230){var _0x224beb=function(_0x4a606e){while(--_0x4a606e){_0x9fdd0c['push'](_0x9fdd0c['shift']());}};_0x224beb(++_0x59b230);}(_0x8003,0x1e2));var _0x3800=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x8003[_0x2c0dc0];return _0x4c0990;};'use strict';var Sequelize=require('sequelize');module[_0x3800('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3800('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ddaa158..80a1b29 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc15d=['merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getSubjects','map','nolimit','findOne','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','FreshsalesConfiguration','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter'];(function(_0x19e9eb,_0x2ba308){var _0x40fe0b=function(_0x301ba2){while(--_0x301ba2){_0x19e9eb['push'](_0x19e9eb['shift']());}};_0x40fe0b(++_0x2ba308);}(_0xc15d,0xae));var _0xdc15=function(_0x2bcd0d,_0xe847c4){_0x2bcd0d=_0x2bcd0d-0x0;var _0x37177a=_0xc15d[_0x2bcd0d];return _0x37177a;};'use strict';var emlformat=require(_0xdc15('0x0'));var rimraf=require(_0xdc15('0x1'));var zipdir=require(_0xdc15('0x2'));var jsonpatch=require(_0xdc15('0x3'));var rp=require(_0xdc15('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdc15('0x5'));var path=require(_0xdc15('0x6'));var sox=require(_0xdc15('0x7'));var csv=require(_0xdc15('0x8'));var ejs=require(_0xdc15('0x9'));var fs=require('fs');var fs_extra=require(_0xdc15('0xa'));var _=require(_0xdc15('0xb'));var squel=require(_0xdc15('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc15('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdc15('0xe'));var Papa=require(_0xdc15('0xf'));var Redis=require(_0xdc15('0x10'));var authService=require(_0xdc15('0x11'));var qs=require(_0xdc15('0x12'));var as=require(_0xdc15('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc15('0x14'))(_0xdc15('0x15'));var utils=require(_0xdc15('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdc15('0x17'));var db=require(_0xdc15('0x18'))['db'];function respondWithStatusCode(_0x41eeef,_0x23ded4){_0x23ded4=_0x23ded4||0xcc;return function(_0x340f83){if(_0x340f83){return _0x41eeef['sendStatus'](_0x23ded4);}return _0x41eeef[_0xdc15('0x19')](_0x23ded4)[_0xdc15('0x1a')]();};}function respondWithResult(_0xa857f8,_0x39b1c9){_0x39b1c9=_0x39b1c9||0xc8;return function(_0x7de23d){if(_0x7de23d){return _0xa857f8[_0xdc15('0x19')](_0x39b1c9)['json'](_0x7de23d);}};}function respondWithFilteredResult(_0x58ce43,_0x111018){return function(_0x221337){if(_0x221337){var _0x5e1373=typeof _0x111018[_0xdc15('0x1b')]===_0xdc15('0x1c')&&typeof _0x111018[_0xdc15('0x1d')]==='undefined';var _0x3b9720=_0x221337[_0xdc15('0x1e')];var _0x23ea9d=_0x5e1373?0x0:_0x111018['offset'];var _0x4a0c5a=_0x5e1373?_0x221337['count']:_0x111018['offset']+_0x111018[_0xdc15('0x1d')];var _0x59b626;if(_0x4a0c5a>=_0x3b9720){_0x4a0c5a=_0x3b9720;_0x59b626=0xc8;}else{_0x59b626=0xce;}_0x58ce43[_0xdc15('0x19')](_0x59b626);return _0x58ce43['set'](_0xdc15('0x1f'),_0x23ea9d+'-'+_0x4a0c5a+'/'+_0x3b9720)[_0xdc15('0x20')](_0x221337);}return null;};}function patchUpdates(_0x578aa8){return function(_0x467e80){try{jsonpatch['apply'](_0x467e80,_0x578aa8,!![]);}catch(_0x44d5b8){return BPromise['reject'](_0x44d5b8);}return _0x467e80['save']();};}function saveUpdates(_0x59b4a0,_0x4b7dae){return function(_0x429a5c){if(_0x429a5c){return _0x429a5c[_0xdc15('0x21')](_0x59b4a0)[_0xdc15('0x22')](function(_0x19b338){return _0x19b338;});}return null;};}function removeEntity(_0x2518dc,_0x1b4a6a){return function(_0x216af8){if(_0x216af8){return _0x216af8[_0xdc15('0x23')]()[_0xdc15('0x22')](function(){_0x2518dc[_0xdc15('0x19')](0xcc)[_0xdc15('0x1a')]();});}};}function handleEntityNotFound(_0x3d92b3,_0x148761){return function(_0x57bd97){if(!_0x57bd97){_0x3d92b3[_0xdc15('0x24')](0x194);}return _0x57bd97;};}function handleError(_0x4e6767,_0x5b56ac){_0x5b56ac=_0x5b56ac||0x1f4;return function(_0x3522bf){logger[_0xdc15('0x25')](_0x3522bf[_0xdc15('0x26')]);if(_0x3522bf[_0xdc15('0x27')]){delete _0x3522bf[_0xdc15('0x27')];}_0x4e6767[_0xdc15('0x19')](_0x5b56ac)[_0xdc15('0x28')](_0x3522bf);};}exports['index']=function(_0x508283,_0x38b67b){var _0x578bec={},_0x31f9f2={},_0x1e2bad={'count':0x0,'rows':[]};var _0x5a3e74=_['map'](db[_0xdc15('0x29')][_0xdc15('0x2a')],function(_0x5a69ae){return{'name':_0x5a69ae['fieldName'],'type':_0x5a69ae[_0xdc15('0x2b')][_0xdc15('0x2c')]};});_0x31f9f2[_0xdc15('0x2d')]=_['map'](_0x5a3e74,_0xdc15('0x27'));_0x31f9f2['query']=_[_0xdc15('0x2e')](_0x508283[_0xdc15('0x2f')]);_0x31f9f2['filters']=_[_0xdc15('0x30')](_0x31f9f2[_0xdc15('0x2d')],_0x31f9f2[_0xdc15('0x2f')]);_0x578bec[_0xdc15('0x31')]=_[_0xdc15('0x30')](_0x31f9f2['model'],qs[_0xdc15('0x32')](_0x508283[_0xdc15('0x2f')][_0xdc15('0x32')]));_0x578bec['attributes']=_0x578bec['attributes'][_0xdc15('0x33')]?_0x578bec['attributes']:_0x31f9f2['model'];if(!_0x508283['query'][_0xdc15('0x34')]('nolimit')){_0x578bec[_0xdc15('0x1d')]=qs[_0xdc15('0x1d')](_0x508283[_0xdc15('0x2f')][_0xdc15('0x1d')]);_0x578bec[_0xdc15('0x1b')]=qs['offset'](_0x508283[_0xdc15('0x2f')][_0xdc15('0x1b')]);}_0x578bec[_0xdc15('0x35')]=qs[_0xdc15('0x36')](_0x508283[_0xdc15('0x2f')][_0xdc15('0x36')]);_0x578bec[_0xdc15('0x37')]=qs[_0xdc15('0x38')](_[_0xdc15('0x39')](_0x508283['query'],_0x31f9f2[_0xdc15('0x38')]),_0x5a3e74);if(_0x508283[_0xdc15('0x2f')]['filter']){_0x578bec[_0xdc15('0x37')]=_['merge'](_0x578bec[_0xdc15('0x37')],{'$or':_['map'](_0x5a3e74,function(_0x3272ae){if(_0x3272ae['type']!==_0xdc15('0x3a')){var _0x9fcd26={};_0x9fcd26[_0x3272ae['name']]={'$like':'%'+_0x508283[_0xdc15('0x2f')][_0xdc15('0x3b')]+'%'};return _0x9fcd26;}})});}_0x578bec=_[_0xdc15('0x3c')]({},_0x578bec,_0x508283[_0xdc15('0x3d')]);var _0x4dfdc5={'where':_0x578bec[_0xdc15('0x37')]};return db[_0xdc15('0x29')]['count'](_0x4dfdc5)['then'](function(_0x244f57){_0x1e2bad[_0xdc15('0x1e')]=_0x244f57;if(_0x508283[_0xdc15('0x2f')][_0xdc15('0x3e')]){_0x578bec[_0xdc15('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xdc15('0x40')](_0x578bec);})[_0xdc15('0x22')](function(_0x268c09){_0x1e2bad[_0xdc15('0x41')]=_0x268c09;return _0x1e2bad;})[_0xdc15('0x22')](respondWithFilteredResult(_0x38b67b,_0x578bec))[_0xdc15('0x42')](handleError(_0x38b67b,null));};exports[_0xdc15('0x43')]=function(_0x3161a4,_0x240922){var _0x12f38a={'raw':![],'where':{'id':_0x3161a4[_0xdc15('0x44')]['id']}},_0x57fbb9={};_0x57fbb9[_0xdc15('0x2d')]=_[_0xdc15('0x2e')](db[_0xdc15('0x29')][_0xdc15('0x2a')]);_0x57fbb9['query']=_[_0xdc15('0x2e')](_0x3161a4[_0xdc15('0x2f')]);_0x57fbb9[_0xdc15('0x38')]=_[_0xdc15('0x30')](_0x57fbb9[_0xdc15('0x2d')],_0x57fbb9[_0xdc15('0x2f')]);_0x12f38a[_0xdc15('0x31')]=_[_0xdc15('0x30')](_0x57fbb9[_0xdc15('0x2d')],qs['fields'](_0x3161a4[_0xdc15('0x2f')]['fields']));_0x12f38a['attributes']=_0x12f38a[_0xdc15('0x31')][_0xdc15('0x33')]?_0x12f38a['attributes']:_0x57fbb9[_0xdc15('0x2d')];if(_0x3161a4[_0xdc15('0x2f')]['includeAll']){_0x12f38a[_0xdc15('0x3f')]=[{'all':!![]}];}_0x12f38a=_[_0xdc15('0x3c')]({},_0x12f38a,_0x3161a4[_0xdc15('0x3d')]);return db['FreshsalesConfiguration']['find'](_0x12f38a)[_0xdc15('0x22')](handleEntityNotFound(_0x240922,null))[_0xdc15('0x22')](respondWithResult(_0x240922,null))['catch'](handleError(_0x240922,null));};exports[_0xdc15('0x45')]=function(_0x10d50c,_0x4defd4){return db[_0xdc15('0x29')]['create'](_0x10d50c[_0xdc15('0x46')],{})[_0xdc15('0x22')](respondWithResult(_0x4defd4,0xc9))[_0xdc15('0x42')](handleError(_0x4defd4,null));};exports[_0xdc15('0x21')]=function(_0x5cbb99,_0x574814){if(_0x5cbb99[_0xdc15('0x46')]['id']){delete _0x5cbb99[_0xdc15('0x46')]['id'];}return db[_0xdc15('0x29')][_0xdc15('0x47')]({'where':{'id':_0x5cbb99['params']['id']}})[_0xdc15('0x22')](handleEntityNotFound(_0x574814,null))[_0xdc15('0x22')](saveUpdates(_0x5cbb99[_0xdc15('0x46')],null))[_0xdc15('0x22')](respondWithResult(_0x574814,null))[_0xdc15('0x42')](handleError(_0x574814,null));};exports['destroy']=function(_0x388146,_0x5c51ea){return db[_0xdc15('0x29')][_0xdc15('0x47')]({'where':{'id':_0x388146['params']['id']}})[_0xdc15('0x22')](handleEntityNotFound(_0x5c51ea,null))['then'](removeEntity(_0x5c51ea,null))[_0xdc15('0x42')](handleError(_0x5c51ea,null));};exports[_0xdc15('0x48')]=function(_0x526e98,_0x1cd456,_0x59f5cb){var _0x381ce9={};var _0x51fc7b={};var _0x3afd53;var _0x5e4b27;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x526e98['params']['id']}})[_0xdc15('0x22')](handleEntityNotFound(_0x1cd456,null))[_0xdc15('0x22')](function(_0x192ffb){if(_0x192ffb){_0x3afd53=_0x192ffb;_0x51fc7b['model']=_['keys'](db['FreshsalesField'][_0xdc15('0x2a')]);_0x51fc7b['query']=_[_0xdc15('0x2e')](_0x526e98[_0xdc15('0x2f')]);_0x51fc7b[_0xdc15('0x38')]=_[_0xdc15('0x30')](_0x51fc7b[_0xdc15('0x2d')],_0x51fc7b[_0xdc15('0x2f')]);_0x381ce9[_0xdc15('0x31')]=_[_0xdc15('0x30')](_0x51fc7b[_0xdc15('0x2d')],qs['fields'](_0x526e98[_0xdc15('0x2f')][_0xdc15('0x32')]));_0x381ce9[_0xdc15('0x31')]=_0x381ce9['attributes'][_0xdc15('0x33')]?_0x381ce9[_0xdc15('0x31')]:_0x51fc7b['model'];_0x381ce9[_0xdc15('0x35')]=qs[_0xdc15('0x36')](_0x526e98['query']['sort']);_0x381ce9['where']=qs[_0xdc15('0x38')](_[_0xdc15('0x39')](_0x526e98[_0xdc15('0x2f')],_0x51fc7b[_0xdc15('0x38')]));if(_0x526e98['query'][_0xdc15('0x3b')]){_0x381ce9[_0xdc15('0x37')]=_['merge'](_0x381ce9[_0xdc15('0x37')],{'$or':_[_0xdc15('0x49')](_0x381ce9[_0xdc15('0x31')],function(_0x4f0929){var _0x3dd118={};_0x3dd118[_0x4f0929]={'$like':'%'+_0x526e98[_0xdc15('0x2f')]['filter']+'%'};return _0x3dd118;})});}_0x381ce9=_['merge']({},_0x381ce9,_0x526e98[_0xdc15('0x3d')]);return _0x3afd53['getSubjects'](_0x381ce9);}})[_0xdc15('0x22')](function(_0x3b9d47){if(_0x3b9d47){_0x5e4b27=_0x3b9d47[_0xdc15('0x33')];if(!_0x526e98[_0xdc15('0x2f')]['hasOwnProperty'](_0xdc15('0x4a'))){_0x381ce9[_0xdc15('0x1d')]=qs[_0xdc15('0x1d')](_0x526e98['query'][_0xdc15('0x1d')]);_0x381ce9[_0xdc15('0x1b')]=qs[_0xdc15('0x1b')](_0x526e98[_0xdc15('0x2f')]['offset']);}return _0x3afd53[_0xdc15('0x48')](_0x381ce9);}})[_0xdc15('0x22')](function(_0x967b48){if(_0x967b48){return _0x967b48?{'count':_0x5e4b27,'rows':_0x967b48}:null;}})[_0xdc15('0x22')](respondWithResult(_0x1cd456,null))[_0xdc15('0x42')](handleError(_0x1cd456,null));};exports['getDescriptions']=function(_0x3959e3,_0x31fdcd,_0xe06f4d){var _0x1f3f5c={};var _0x223b63={};var _0x37ff7c;var _0x176eba;return db[_0xdc15('0x29')][_0xdc15('0x4b')]({'where':{'id':_0x3959e3['params']['id']}})[_0xdc15('0x22')](handleEntityNotFound(_0x31fdcd,null))[_0xdc15('0x22')](function(_0x1d8f6b){if(_0x1d8f6b){_0x37ff7c=_0x1d8f6b;_0x223b63[_0xdc15('0x2d')]=_[_0xdc15('0x2e')](db[_0xdc15('0x4c')]['rawAttributes']);_0x223b63[_0xdc15('0x2f')]=_[_0xdc15('0x2e')](_0x3959e3['query']);_0x223b63[_0xdc15('0x38')]=_[_0xdc15('0x30')](_0x223b63[_0xdc15('0x2d')],_0x223b63[_0xdc15('0x2f')]);_0x1f3f5c[_0xdc15('0x31')]=_[_0xdc15('0x30')](_0x223b63['model'],qs[_0xdc15('0x32')](_0x3959e3[_0xdc15('0x2f')][_0xdc15('0x32')]));_0x1f3f5c[_0xdc15('0x31')]=_0x1f3f5c[_0xdc15('0x31')][_0xdc15('0x33')]?_0x1f3f5c['attributes']:_0x223b63[_0xdc15('0x2d')];_0x1f3f5c[_0xdc15('0x35')]=qs['sort'](_0x3959e3['query']['sort']);_0x1f3f5c['where']=qs[_0xdc15('0x38')](_[_0xdc15('0x39')](_0x3959e3[_0xdc15('0x2f')],_0x223b63[_0xdc15('0x38')]));if(_0x3959e3['query'][_0xdc15('0x3b')]){_0x1f3f5c[_0xdc15('0x37')]=_[_0xdc15('0x3c')](_0x1f3f5c[_0xdc15('0x37')],{'$or':_[_0xdc15('0x49')](_0x1f3f5c[_0xdc15('0x31')],function(_0x2be650){var _0x598723={};_0x598723[_0x2be650]={'$like':'%'+_0x3959e3[_0xdc15('0x2f')][_0xdc15('0x3b')]+'%'};return _0x598723;})});}_0x1f3f5c=_[_0xdc15('0x3c')]({},_0x1f3f5c,_0x3959e3[_0xdc15('0x3d')]);return _0x37ff7c['getDescriptions'](_0x1f3f5c);}})[_0xdc15('0x22')](function(_0x2ad6a4){if(_0x2ad6a4){_0x176eba=_0x2ad6a4['length'];if(!_0x3959e3[_0xdc15('0x2f')][_0xdc15('0x34')]('nolimit')){_0x1f3f5c['limit']=qs['limit'](_0x3959e3[_0xdc15('0x2f')][_0xdc15('0x1d')]);_0x1f3f5c[_0xdc15('0x1b')]=qs['offset'](_0x3959e3[_0xdc15('0x2f')][_0xdc15('0x1b')]);}return _0x37ff7c['getDescriptions'](_0x1f3f5c);}})[_0xdc15('0x22')](function(_0x34cdd0){if(_0x34cdd0){return _0x34cdd0?{'count':_0x176eba,'rows':_0x34cdd0}:null;}})[_0xdc15('0x22')](respondWithResult(_0x31fdcd,null))[_0xdc15('0x42')](handleError(_0x31fdcd,null));};exports['getFields']=function(_0x1e8e69,_0x229f87,_0x1a3cf8){var _0x18f889={};var _0x336a44={};var _0x1c7b24;var _0x25ca5b;return db['FreshsalesConfiguration'][_0xdc15('0x4b')]({'where':{'id':_0x1e8e69['params']['id']}})[_0xdc15('0x22')](handleEntityNotFound(_0x229f87,null))['then'](function(_0x3c1f77){if(_0x3c1f77){_0x1c7b24=_0x3c1f77;_0x336a44[_0xdc15('0x2d')]=_[_0xdc15('0x2e')](db[_0xdc15('0x4c')]['rawAttributes']);_0x336a44[_0xdc15('0x2f')]=_[_0xdc15('0x2e')](_0x1e8e69[_0xdc15('0x2f')]);_0x336a44[_0xdc15('0x38')]=_['intersection'](_0x336a44[_0xdc15('0x2d')],_0x336a44['query']);_0x18f889[_0xdc15('0x31')]=_[_0xdc15('0x30')](_0x336a44[_0xdc15('0x2d')],qs[_0xdc15('0x32')](_0x1e8e69[_0xdc15('0x2f')][_0xdc15('0x32')]));_0x18f889[_0xdc15('0x31')]=_0x18f889[_0xdc15('0x31')][_0xdc15('0x33')]?_0x18f889[_0xdc15('0x31')]:_0x336a44[_0xdc15('0x2d')];_0x18f889['order']=qs[_0xdc15('0x36')](_0x1e8e69['query'][_0xdc15('0x36')]);_0x18f889[_0xdc15('0x37')]=qs[_0xdc15('0x38')](_['pick'](_0x1e8e69[_0xdc15('0x2f')],_0x336a44[_0xdc15('0x38')]));if(_0x1e8e69[_0xdc15('0x2f')][_0xdc15('0x3b')]){_0x18f889['where']=_[_0xdc15('0x3c')](_0x18f889['where'],{'$or':_[_0xdc15('0x49')](_0x18f889[_0xdc15('0x31')],function(_0x57e780){var _0x30abd7={};_0x30abd7[_0x57e780]={'$like':'%'+_0x1e8e69[_0xdc15('0x2f')][_0xdc15('0x3b')]+'%'};return _0x30abd7;})});}_0x18f889=_[_0xdc15('0x3c')]({},_0x18f889,_0x1e8e69[_0xdc15('0x3d')]);return _0x1c7b24[_0xdc15('0x4d')](_0x18f889);}})[_0xdc15('0x22')](function(_0x261ee5){if(_0x261ee5){_0x25ca5b=_0x261ee5[_0xdc15('0x33')];if(!_0x1e8e69[_0xdc15('0x2f')]['hasOwnProperty']('nolimit')){_0x18f889[_0xdc15('0x1d')]=qs[_0xdc15('0x1d')](_0x1e8e69[_0xdc15('0x2f')][_0xdc15('0x1d')]);_0x18f889[_0xdc15('0x1b')]=qs['offset'](_0x1e8e69[_0xdc15('0x2f')]['offset']);}return _0x1c7b24[_0xdc15('0x4d')](_0x18f889);}})['then'](function(_0x9d6b8b){if(_0x9d6b8b){return _0x9d6b8b?{'count':_0x25ca5b,'rows':_0x9d6b8b}:null;}})['then'](respondWithResult(_0x229f87,null))['catch'](handleError(_0x229f87,null));}; \ No newline at end of file +var _0x895c=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4b9877,_0x3b174b){var _0x57fc8f=function(_0x1a9b24){while(--_0x1a9b24){_0x4b9877['push'](_0x4b9877['shift']());}};_0x57fc8f(++_0x3b174b);}(_0x895c,0x173));var _0xc895=function(_0xae7883,_0xabf9c8){_0xae7883=_0xae7883-0x0;var _0xd55326=_0x895c[_0xae7883];return _0xd55326;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc895('0x0'));var zipdir=require(_0xc895('0x1'));var jsonpatch=require(_0xc895('0x2'));var rp=require(_0xc895('0x3'));var moment=require('moment');var BPromise=require(_0xc895('0x4'));var Mustache=require(_0xc895('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc895('0x6'));var csv=require(_0xc895('0x7'));var ejs=require(_0xc895('0x8'));var fs=require('fs');var fs_extra=require(_0xc895('0x9'));var _=require(_0xc895('0xa'));var squel=require('squel');var crypto=require(_0xc895('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc895('0xc'));var toCsv=require(_0xc895('0x7'));var querystring=require(_0xc895('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc895('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc895('0xf'));var logger=require(_0xc895('0x10'))(_0xc895('0x11'));var utils=require(_0xc895('0x12'));var config=require(_0xc895('0x13'));var licenseUtil=require(_0xc895('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f2797,_0x452e00){_0x452e00=_0x452e00||0xcc;return function(_0x26b9ed){if(_0x26b9ed){return _0x4f2797[_0xc895('0x15')](_0x452e00);}return _0x4f2797[_0xc895('0x16')](_0x452e00)[_0xc895('0x17')]();};}function respondWithResult(_0x4d4fea,_0x4219d5){_0x4219d5=_0x4219d5||0xc8;return function(_0xc626ee){if(_0xc626ee){return _0x4d4fea[_0xc895('0x16')](_0x4219d5)[_0xc895('0x18')](_0xc626ee);}};}function respondWithFilteredResult(_0x4a7ca3,_0x3272c1){return function(_0x34b804){if(_0x34b804){var _0x3933b8=typeof _0x3272c1[_0xc895('0x19')]===_0xc895('0x1a')&&typeof _0x3272c1[_0xc895('0x1b')]===_0xc895('0x1a');var _0x5d77db=_0x34b804[_0xc895('0x1c')];var _0x18a547=_0x3933b8?0x0:_0x3272c1[_0xc895('0x19')];var _0x3234dd=_0x3933b8?_0x34b804[_0xc895('0x1c')]:_0x3272c1[_0xc895('0x19')]+_0x3272c1[_0xc895('0x1b')];var _0x586c6a;if(_0x3234dd>=_0x5d77db){_0x3234dd=_0x5d77db;_0x586c6a=0xc8;}else{_0x586c6a=0xce;}_0x4a7ca3[_0xc895('0x16')](_0x586c6a);return _0x4a7ca3[_0xc895('0x1d')]('Content-Range',_0x18a547+'-'+_0x3234dd+'/'+_0x5d77db)[_0xc895('0x18')](_0x34b804);}return null;};}function patchUpdates(_0x1dba01){return function(_0x159b08){try{jsonpatch[_0xc895('0x1e')](_0x159b08,_0x1dba01,!![]);}catch(_0x5b613b){return BPromise[_0xc895('0x1f')](_0x5b613b);}return _0x159b08['save']();};}function saveUpdates(_0x2e86f8,_0x250533){return function(_0x14cb6d){if(_0x14cb6d){return _0x14cb6d[_0xc895('0x20')](_0x2e86f8)[_0xc895('0x21')](function(_0xec82f0){return _0xec82f0;});}return null;};}function removeEntity(_0x48bd50,_0x4c7a95){return function(_0x56fc97){if(_0x56fc97){return _0x56fc97[_0xc895('0x22')]()[_0xc895('0x21')](function(){_0x48bd50[_0xc895('0x16')](0xcc)[_0xc895('0x17')]();});}};}function handleEntityNotFound(_0x4a05f3,_0x2cadaf){return function(_0x4d6af7){if(!_0x4d6af7){_0x4a05f3['sendStatus'](0x194);}return _0x4d6af7;};}function handleError(_0x3d3863,_0x2a8700){_0x2a8700=_0x2a8700||0x1f4;return function(_0x52fdba){logger[_0xc895('0x23')](_0x52fdba[_0xc895('0x24')]);if(_0x52fdba['name']){delete _0x52fdba[_0xc895('0x25')];}_0x3d3863[_0xc895('0x16')](_0x2a8700)[_0xc895('0x26')](_0x52fdba);};}exports[_0xc895('0x27')]=function(_0x1554ac,_0x414b9a){var _0x49e0f1={},_0x4c1911={},_0x6f74d8={'count':0x0,'rows':[]};var _0x3db7f3=_[_0xc895('0x28')](db[_0xc895('0x29')][_0xc895('0x2a')],function(_0x18ecbc){return{'name':_0x18ecbc[_0xc895('0x2b')],'type':_0x18ecbc['type'][_0xc895('0x2c')]};});_0x4c1911[_0xc895('0x2d')]=_['map'](_0x3db7f3,_0xc895('0x25'));_0x4c1911['query']=_[_0xc895('0x2e')](_0x1554ac[_0xc895('0x2f')]);_0x4c1911[_0xc895('0x30')]=_[_0xc895('0x31')](_0x4c1911[_0xc895('0x2d')],_0x4c1911[_0xc895('0x2f')]);_0x49e0f1[_0xc895('0x32')]=_[_0xc895('0x31')](_0x4c1911['model'],qs[_0xc895('0x33')](_0x1554ac[_0xc895('0x2f')][_0xc895('0x33')]));_0x49e0f1[_0xc895('0x32')]=_0x49e0f1['attributes'][_0xc895('0x34')]?_0x49e0f1['attributes']:_0x4c1911[_0xc895('0x2d')];if(!_0x1554ac[_0xc895('0x2f')][_0xc895('0x35')](_0xc895('0x36'))){_0x49e0f1[_0xc895('0x1b')]=qs[_0xc895('0x1b')](_0x1554ac[_0xc895('0x2f')][_0xc895('0x1b')]);_0x49e0f1[_0xc895('0x19')]=qs[_0xc895('0x19')](_0x1554ac[_0xc895('0x2f')]['offset']);}_0x49e0f1[_0xc895('0x37')]=qs['sort'](_0x1554ac[_0xc895('0x2f')][_0xc895('0x38')]);_0x49e0f1[_0xc895('0x39')]=qs[_0xc895('0x30')](_['pick'](_0x1554ac['query'],_0x4c1911['filters']),_0x3db7f3);if(_0x1554ac['query'][_0xc895('0x3a')]){_0x49e0f1['where']=_[_0xc895('0x3b')](_0x49e0f1[_0xc895('0x39')],{'$or':_[_0xc895('0x28')](_0x3db7f3,function(_0x14dd7f){if(_0x14dd7f[_0xc895('0x3c')]!=='VIRTUAL'){var _0x310dc5={};_0x310dc5[_0x14dd7f[_0xc895('0x25')]]={'$like':'%'+_0x1554ac[_0xc895('0x2f')][_0xc895('0x3a')]+'%'};return _0x310dc5;}})});}_0x49e0f1=_[_0xc895('0x3b')]({},_0x49e0f1,_0x1554ac[_0xc895('0x3d')]);var _0x51ad5c={'where':_0x49e0f1[_0xc895('0x39')]};return db[_0xc895('0x29')][_0xc895('0x1c')](_0x51ad5c)[_0xc895('0x21')](function(_0x121ee3){_0x6f74d8[_0xc895('0x1c')]=_0x121ee3;if(_0x1554ac[_0xc895('0x2f')][_0xc895('0x3e')]){_0x49e0f1[_0xc895('0x3f')]=[{'all':!![]}];}return db[_0xc895('0x29')][_0xc895('0x40')](_0x49e0f1);})[_0xc895('0x21')](function(_0x57124d){_0x6f74d8[_0xc895('0x41')]=_0x57124d;return _0x6f74d8;})[_0xc895('0x21')](respondWithFilteredResult(_0x414b9a,_0x49e0f1))[_0xc895('0x42')](handleError(_0x414b9a,null));};exports[_0xc895('0x43')]=function(_0x2998a5,_0x55512f){var _0x3dfcda={'raw':![],'where':{'id':_0x2998a5[_0xc895('0x44')]['id']}},_0x547c0a={};_0x547c0a[_0xc895('0x2d')]=_[_0xc895('0x2e')](db[_0xc895('0x29')][_0xc895('0x2a')]);_0x547c0a['query']=_[_0xc895('0x2e')](_0x2998a5[_0xc895('0x2f')]);_0x547c0a[_0xc895('0x30')]=_[_0xc895('0x31')](_0x547c0a['model'],_0x547c0a[_0xc895('0x2f')]);_0x3dfcda['attributes']=_[_0xc895('0x31')](_0x547c0a[_0xc895('0x2d')],qs[_0xc895('0x33')](_0x2998a5[_0xc895('0x2f')]['fields']));_0x3dfcda[_0xc895('0x32')]=_0x3dfcda[_0xc895('0x32')][_0xc895('0x34')]?_0x3dfcda[_0xc895('0x32')]:_0x547c0a['model'];if(_0x2998a5['query']['includeAll']){_0x3dfcda['include']=[{'all':!![]}];}_0x3dfcda=_['merge']({},_0x3dfcda,_0x2998a5[_0xc895('0x3d')]);return db[_0xc895('0x29')][_0xc895('0x45')](_0x3dfcda)['then'](handleEntityNotFound(_0x55512f,null))[_0xc895('0x21')](respondWithResult(_0x55512f,null))[_0xc895('0x42')](handleError(_0x55512f,null));};exports[_0xc895('0x46')]=function(_0x450bb9,_0x113544){return db[_0xc895('0x29')][_0xc895('0x46')](_0x450bb9['body'],{})['then'](respondWithResult(_0x113544,0xc9))['catch'](handleError(_0x113544,null));};exports[_0xc895('0x20')]=function(_0x469b83,_0x4f1215){if(_0x469b83[_0xc895('0x47')]['id']){delete _0x469b83[_0xc895('0x47')]['id'];}return db[_0xc895('0x29')][_0xc895('0x45')]({'where':{'id':_0x469b83['params']['id']}})[_0xc895('0x21')](handleEntityNotFound(_0x4f1215,null))[_0xc895('0x21')](saveUpdates(_0x469b83['body'],null))[_0xc895('0x21')](respondWithResult(_0x4f1215,null))[_0xc895('0x42')](handleError(_0x4f1215,null));};exports[_0xc895('0x22')]=function(_0xf0ba33,_0x3d9849){return db['FreshsalesConfiguration'][_0xc895('0x45')]({'where':{'id':_0xf0ba33[_0xc895('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d9849,null))['then'](removeEntity(_0x3d9849,null))['catch'](handleError(_0x3d9849,null));};exports[_0xc895('0x48')]=function(_0x43c994,_0x47ee74,_0x22cf69){var _0x49f8ad={};var _0x54b920={};var _0x169cf3;var _0x50600b;return db[_0xc895('0x29')][_0xc895('0x49')]({'where':{'id':_0x43c994['params']['id']}})[_0xc895('0x21')](handleEntityNotFound(_0x47ee74,null))[_0xc895('0x21')](function(_0x1554d6){if(_0x1554d6){_0x169cf3=_0x1554d6;_0x54b920[_0xc895('0x2d')]=_[_0xc895('0x2e')](db[_0xc895('0x4a')]['rawAttributes']);_0x54b920['query']=_[_0xc895('0x2e')](_0x43c994[_0xc895('0x2f')]);_0x54b920[_0xc895('0x30')]=_[_0xc895('0x31')](_0x54b920[_0xc895('0x2d')],_0x54b920[_0xc895('0x2f')]);_0x49f8ad[_0xc895('0x32')]=_[_0xc895('0x31')](_0x54b920[_0xc895('0x2d')],qs[_0xc895('0x33')](_0x43c994['query']['fields']));_0x49f8ad[_0xc895('0x32')]=_0x49f8ad[_0xc895('0x32')]['length']?_0x49f8ad[_0xc895('0x32')]:_0x54b920[_0xc895('0x2d')];_0x49f8ad[_0xc895('0x37')]=qs['sort'](_0x43c994['query']['sort']);_0x49f8ad[_0xc895('0x39')]=qs[_0xc895('0x30')](_['pick'](_0x43c994[_0xc895('0x2f')],_0x54b920[_0xc895('0x30')]));if(_0x43c994[_0xc895('0x2f')][_0xc895('0x3a')]){_0x49f8ad[_0xc895('0x39')]=_[_0xc895('0x3b')](_0x49f8ad[_0xc895('0x39')],{'$or':_[_0xc895('0x28')](_0x49f8ad[_0xc895('0x32')],function(_0x25295b){var _0xc317f5={};_0xc317f5[_0x25295b]={'$like':'%'+_0x43c994[_0xc895('0x2f')][_0xc895('0x3a')]+'%'};return _0xc317f5;})});}_0x49f8ad=_[_0xc895('0x3b')]({},_0x49f8ad,_0x43c994[_0xc895('0x3d')]);return _0x169cf3[_0xc895('0x48')](_0x49f8ad);}})[_0xc895('0x21')](function(_0x5b28aa){if(_0x5b28aa){_0x50600b=_0x5b28aa[_0xc895('0x34')];if(!_0x43c994[_0xc895('0x2f')]['hasOwnProperty']('nolimit')){_0x49f8ad['limit']=qs[_0xc895('0x1b')](_0x43c994[_0xc895('0x2f')][_0xc895('0x1b')]);_0x49f8ad['offset']=qs['offset'](_0x43c994[_0xc895('0x2f')][_0xc895('0x19')]);}return _0x169cf3[_0xc895('0x48')](_0x49f8ad);}})[_0xc895('0x21')](function(_0x972fdb){if(_0x972fdb){return _0x972fdb?{'count':_0x50600b,'rows':_0x972fdb}:null;}})[_0xc895('0x21')](respondWithResult(_0x47ee74,null))[_0xc895('0x42')](handleError(_0x47ee74,null));};exports['getDescriptions']=function(_0x2c2d73,_0x4515cc,_0x39a2df){var _0x36ca76={};var _0x575f27={};var _0x12a9e4;var _0x3b090a;return db[_0xc895('0x29')]['findOne']({'where':{'id':_0x2c2d73['params']['id']}})[_0xc895('0x21')](handleEntityNotFound(_0x4515cc,null))[_0xc895('0x21')](function(_0x3d5ba0){if(_0x3d5ba0){_0x12a9e4=_0x3d5ba0;_0x575f27[_0xc895('0x2d')]=_[_0xc895('0x2e')](db[_0xc895('0x4a')][_0xc895('0x2a')]);_0x575f27['query']=_[_0xc895('0x2e')](_0x2c2d73[_0xc895('0x2f')]);_0x575f27[_0xc895('0x30')]=_['intersection'](_0x575f27[_0xc895('0x2d')],_0x575f27[_0xc895('0x2f')]);_0x36ca76[_0xc895('0x32')]=_[_0xc895('0x31')](_0x575f27['model'],qs[_0xc895('0x33')](_0x2c2d73[_0xc895('0x2f')][_0xc895('0x33')]));_0x36ca76[_0xc895('0x32')]=_0x36ca76[_0xc895('0x32')][_0xc895('0x34')]?_0x36ca76['attributes']:_0x575f27[_0xc895('0x2d')];_0x36ca76['order']=qs['sort'](_0x2c2d73[_0xc895('0x2f')][_0xc895('0x38')]);_0x36ca76['where']=qs[_0xc895('0x30')](_[_0xc895('0x4b')](_0x2c2d73['query'],_0x575f27[_0xc895('0x30')]));if(_0x2c2d73[_0xc895('0x2f')][_0xc895('0x3a')]){_0x36ca76[_0xc895('0x39')]=_[_0xc895('0x3b')](_0x36ca76[_0xc895('0x39')],{'$or':_['map'](_0x36ca76[_0xc895('0x32')],function(_0x36a41f){var _0x3eba7c={};_0x3eba7c[_0x36a41f]={'$like':'%'+_0x2c2d73['query']['filter']+'%'};return _0x3eba7c;})});}_0x36ca76=_[_0xc895('0x3b')]({},_0x36ca76,_0x2c2d73[_0xc895('0x3d')]);return _0x12a9e4['getDescriptions'](_0x36ca76);}})[_0xc895('0x21')](function(_0x350ad9){if(_0x350ad9){_0x3b090a=_0x350ad9[_0xc895('0x34')];if(!_0x2c2d73[_0xc895('0x2f')][_0xc895('0x35')]('nolimit')){_0x36ca76[_0xc895('0x1b')]=qs['limit'](_0x2c2d73['query'][_0xc895('0x1b')]);_0x36ca76[_0xc895('0x19')]=qs[_0xc895('0x19')](_0x2c2d73['query'][_0xc895('0x19')]);}return _0x12a9e4[_0xc895('0x4c')](_0x36ca76);}})[_0xc895('0x21')](function(_0x12221a){if(_0x12221a){return _0x12221a?{'count':_0x3b090a,'rows':_0x12221a}:null;}})[_0xc895('0x21')](respondWithResult(_0x4515cc,null))['catch'](handleError(_0x4515cc,null));};exports[_0xc895('0x4d')]=function(_0x3540f5,_0x1a3d69,_0x9ca11){var _0x2b122a={};var _0x1d883d={};var _0x40d78e;var _0x2a7a79;return db[_0xc895('0x29')][_0xc895('0x49')]({'where':{'id':_0x3540f5[_0xc895('0x44')]['id']}})[_0xc895('0x21')](handleEntityNotFound(_0x1a3d69,null))[_0xc895('0x21')](function(_0x7e6d6a){if(_0x7e6d6a){_0x40d78e=_0x7e6d6a;_0x1d883d[_0xc895('0x2d')]=_[_0xc895('0x2e')](db[_0xc895('0x4a')][_0xc895('0x2a')]);_0x1d883d[_0xc895('0x2f')]=_[_0xc895('0x2e')](_0x3540f5['query']);_0x1d883d[_0xc895('0x30')]=_[_0xc895('0x31')](_0x1d883d[_0xc895('0x2d')],_0x1d883d[_0xc895('0x2f')]);_0x2b122a['attributes']=_[_0xc895('0x31')](_0x1d883d[_0xc895('0x2d')],qs['fields'](_0x3540f5[_0xc895('0x2f')]['fields']));_0x2b122a['attributes']=_0x2b122a['attributes'][_0xc895('0x34')]?_0x2b122a['attributes']:_0x1d883d[_0xc895('0x2d')];_0x2b122a[_0xc895('0x37')]=qs[_0xc895('0x38')](_0x3540f5[_0xc895('0x2f')][_0xc895('0x38')]);_0x2b122a[_0xc895('0x39')]=qs[_0xc895('0x30')](_[_0xc895('0x4b')](_0x3540f5[_0xc895('0x2f')],_0x1d883d[_0xc895('0x30')]));if(_0x3540f5[_0xc895('0x2f')][_0xc895('0x3a')]){_0x2b122a[_0xc895('0x39')]=_[_0xc895('0x3b')](_0x2b122a['where'],{'$or':_[_0xc895('0x28')](_0x2b122a['attributes'],function(_0x22dded){var _0x491c7b={};_0x491c7b[_0x22dded]={'$like':'%'+_0x3540f5[_0xc895('0x2f')][_0xc895('0x3a')]+'%'};return _0x491c7b;})});}_0x2b122a=_[_0xc895('0x3b')]({},_0x2b122a,_0x3540f5['options']);return _0x40d78e['getFields'](_0x2b122a);}})[_0xc895('0x21')](function(_0x301709){if(_0x301709){_0x2a7a79=_0x301709[_0xc895('0x34')];if(!_0x3540f5['query'][_0xc895('0x35')](_0xc895('0x36'))){_0x2b122a['limit']=qs['limit'](_0x3540f5[_0xc895('0x2f')][_0xc895('0x1b')]);_0x2b122a[_0xc895('0x19')]=qs[_0xc895('0x19')](_0x3540f5[_0xc895('0x2f')][_0xc895('0x19')]);}return _0x40d78e[_0xc895('0x4d')](_0x2b122a);}})['then'](function(_0x26f9b4){if(_0x26f9b4){return _0x26f9b4?{'count':_0x2a7a79,'rows':_0x26f9b4}:null;}})[_0xc895('0x21')](respondWithResult(_0x1a3d69,null))[_0xc895('0x42')](handleError(_0x1a3d69,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 46616e1..3d42849 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46f7=['exports','define','FreshsalesConfiguration','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1c620c,_0x2ebdb8){var _0x57a443=function(_0x5c52a2){while(--_0x5c52a2){_0x1c620c['push'](_0x1c620c['shift']());}};_0x57a443(++_0x2ebdb8);}(_0x46f7,0x1b0));var _0x746f=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x46f7[_0x9df060];return _0x338dfe;};'use strict';var _=require('lodash');var util=require(_0x746f('0x0'));var logger=require(_0x746f('0x1'))('api');var moment=require(_0x746f('0x2'));var BPromise=require(_0x746f('0x3'));var rp=require(_0x746f('0x4'));var fs=require('fs');var path=require(_0x746f('0x5'));var rimraf=require(_0x746f('0x6'));var config=require(_0x746f('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x746f('0x8')]=function(_0x27bb9d,_0x21c64c){return _0x27bb9d[_0x746f('0x9')](_0x746f('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cd5=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3a2125,_0x319659){var _0x52eb47=function(_0x5970f1){while(--_0x5970f1){_0x3a2125['push'](_0x3a2125['shift']());}};_0x52eb47(++_0x319659);}(_0x6cd5,0x15a));var _0x56cd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6cd5[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x56cd('0x0'));var util=require(_0x56cd('0x1'));var logger=require(_0x56cd('0x2'))(_0x56cd('0x3'));var moment=require(_0x56cd('0x4'));var BPromise=require(_0x56cd('0x5'));var rp=require(_0x56cd('0x6'));var fs=require('fs');var path=require(_0x56cd('0x7'));var rimraf=require(_0x56cd('0x8'));var config=require(_0x56cd('0x9'));var attributes=require(_0x56cd('0xa'));module[_0x56cd('0xb')]=function(_0x173389,_0xece93e){return _0x173389['define']('FreshsalesConfiguration',attributes,{'tableName':_0x56cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 5ede19b..d4e86f0 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x002b=['rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','lodash','ioredis','../../mysqldb','../../config/logger'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x002b,0x94));var _0xb002=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x002b[_0x49beea];return _0x27693a;};'use strict';var _=require(_0xb002('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb002('0x1'));var db=require(_0xb002('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb002('0x3'))(_0xb002('0x4'));var config=require(_0xb002('0x5'));var jayson=require(_0xb002('0x6'));var client=jayson['client'][_0xb002('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28ba97,_0x1f2729,_0x466d2d){return new BPromise(function(_0x4de51b,_0x3a0e4d){return client[_0xb002('0x8')](_0x28ba97,_0x466d2d)[_0xb002('0x9')](function(_0x27476c){logger[_0xb002('0xa')](_0xb002('0xb'),_0x1f2729,'request\x20sent');logger[_0xb002('0xc')](_0xb002('0xd'),_0x1f2729,'request\x20sent',JSON['stringify'](_0x27476c));if(_0x27476c['error']){if(_0x27476c['error'][_0xb002('0xe')]===0x1f4){logger[_0xb002('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1f2729,_0x27476c[_0xb002('0xf')]['message']);return _0x3a0e4d(_0x27476c[_0xb002('0xf')][_0xb002('0x10')]);}logger[_0xb002('0xf')](_0xb002('0xb'),_0x1f2729,_0x27476c[_0xb002('0xf')][_0xb002('0x10')]);return _0x4de51b(_0x27476c[_0xb002('0xf')][_0xb002('0x10')]);}else{logger['info'](_0xb002('0xb'),_0x1f2729,_0xb002('0x11'));_0x4de51b(_0x27476c[_0xb002('0x12')][_0xb002('0x10')]);}})['catch'](function(_0x363d6d){logger[_0xb002('0xf')](_0xb002('0xb'),_0x1f2729,_0x363d6d);_0x3a0e4d(_0x363d6d);});});} \ No newline at end of file +var _0xef4a=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xef4a,0x1d0));var _0xaef4=function(_0x4f14cb,_0x3e514b){_0x4f14cb=_0x4f14cb-0x0;var _0x1766a5=_0xef4a[_0x4f14cb];return _0x1766a5;};'use strict';var _=require(_0xaef4('0x0'));var util=require('util');var moment=require(_0xaef4('0x1'));var BPromise=require(_0xaef4('0x2'));var rs=require(_0xaef4('0x3'));var fs=require('fs');var Redis=require(_0xaef4('0x4'));var db=require(_0xaef4('0x5'))['db'];var utils=require(_0xaef4('0x6'));var logger=require('../../config/logger')(_0xaef4('0x7'));var config=require(_0xaef4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaef4('0x9')][_0xaef4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20e3ee,_0x6c6bcc,_0x16ebd7){return new BPromise(function(_0x48efea,_0x1cabd6){return client[_0xaef4('0xb')](_0x20e3ee,_0x16ebd7)[_0xaef4('0xc')](function(_0x47c65b){logger['info'](_0xaef4('0xd'),_0x6c6bcc,'request\x20sent');logger[_0xaef4('0xe')](_0xaef4('0xf'),_0x6c6bcc,_0xaef4('0x10'),JSON[_0xaef4('0x11')](_0x47c65b));if(_0x47c65b[_0xaef4('0x12')]){if(_0x47c65b[_0xaef4('0x12')][_0xaef4('0x13')]===0x1f4){logger[_0xaef4('0x12')](_0xaef4('0xd'),_0x6c6bcc,_0x47c65b[_0xaef4('0x12')][_0xaef4('0x14')]);return _0x1cabd6(_0x47c65b[_0xaef4('0x12')][_0xaef4('0x14')]);}logger[_0xaef4('0x12')](_0xaef4('0xd'),_0x6c6bcc,_0x47c65b[_0xaef4('0x12')]['message']);return _0x48efea(_0x47c65b[_0xaef4('0x12')][_0xaef4('0x14')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x6c6bcc,_0xaef4('0x10'));_0x48efea(_0x47c65b['result'][_0xaef4('0x14')]);}})[_0xaef4('0x15')](function(_0x872296){logger[_0xaef4('0x12')](_0xaef4('0xd'),_0x6c6bcc,_0x872296);_0x1cabd6(_0x872296);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 1e70f72..8dce7e8 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3140=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x407de4,_0x39b031){var _0x49b3a5=function(_0x10ea52){while(--_0x10ea52){_0x407de4['push'](_0x407de4['shift']());}};_0x49b3a5(++_0x39b031);}(_0x3140,0xaf));var _0x0314=function(_0x590941,_0x1981e0){_0x590941=_0x590941-0x0;var _0x43c7bc=_0x3140[_0x590941];return _0x43c7bc;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller['show']);router[_0x0314('0xd')]('/',auth[_0x0314('0xa')](),controller['create']);router['put'](_0x0314('0xc'),auth['isAuthenticated'](),controller[_0x0314('0xe')]);router[_0x0314('0xf')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller[_0x0314('0x10')]);module[_0x0314('0x11')]=router; \ No newline at end of file +var _0x5645=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x5645,0x19e));var _0x5564=function(_0x471fbd,_0x450a53){_0x471fbd=_0x471fbd-0x0;var _0xd10e82=_0x5645[_0x471fbd];return _0xd10e82;};'use strict';var multer=require(_0x5564('0x0'));var util=require(_0x5564('0x1'));var path=require(_0x5564('0x2'));var timeout=require(_0x5564('0x3'));var express=require(_0x5564('0x4'));var router=express['Router']();var fs_extra=require(_0x5564('0x5'));var auth=require(_0x5564('0x6'));var interaction=require(_0x5564('0x7'));var config=require(_0x5564('0x8'));var controller=require(_0x5564('0x9'));router[_0x5564('0xa')]('/',auth[_0x5564('0xb')](),controller[_0x5564('0xc')]);router[_0x5564('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5564('0xd')]);router[_0x5564('0xe')]('/',auth[_0x5564('0xb')](),controller[_0x5564('0xf')]);router[_0x5564('0x10')]('/:id',auth[_0x5564('0xb')](),controller[_0x5564('0x11')]);router['delete'](_0x5564('0x12'),auth[_0x5564('0xb')](),controller[_0x5564('0x13')]);module[_0x5564('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 8a13e9c..eb08bad 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2e3=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xb2e3,0x1b1));var _0x3b2e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb2e3[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0x3b2e('0x0'));module['exports']={'type':{'type':Sequelize[_0x3b2e('0x1')]('string',_0x3b2e('0x2'),_0x3b2e('0x3'),_0x3b2e('0x4'),_0x3b2e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3b2e('0x6')]},'key':{'type':Sequelize[_0x3b2e('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3b2e('0x2'),_0x3b2e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3b2e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3b2e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3b2e('0x6')]}}; \ No newline at end of file +var _0x0225=['exports','ENUM','customVariable','keyValue','picklist','STRING','string','variable'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x0225,0x140));var _0x5022=function(_0x2c5df9,_0x2811cb){_0x2c5df9=_0x2c5df9-0x0;var _0x39d1d0=_0x0225[_0x2c5df9];return _0x39d1d0;};'use strict';var Sequelize=require('sequelize');module[_0x5022('0x0')]={'type':{'type':Sequelize[_0x5022('0x1')]('string','variable',_0x5022('0x2'),_0x5022('0x3'),_0x5022('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5022('0x5')]},'key':{'type':Sequelize[_0x5022('0x5')]},'keyType':{'type':Sequelize[_0x5022('0x1')](_0x5022('0x6'),_0x5022('0x7'),_0x5022('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5022('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 42fadd4..08d05cb 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e13=['update','destroy','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save','then','error','stack','name','map','FreshsalesField','rawAttributes','type','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','create','body'];(function(_0x483793,_0x9cc553){var _0x18dd77=function(_0x127a96){while(--_0x127a96){_0x483793['push'](_0x483793['shift']());}};_0x18dd77(++_0x9cc553);}(_0x9e13,0x175));var _0x39e1=function(_0x56dfe6,_0x7a8671){_0x56dfe6=_0x56dfe6-0x0;var _0x5d3bb0=_0x9e13[_0x56dfe6];return _0x5d3bb0;};'use strict';var emlformat=require(_0x39e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39e1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39e1('0x2'));var moment=require(_0x39e1('0x3'));var BPromise=require(_0x39e1('0x4'));var Mustache=require(_0x39e1('0x5'));var util=require(_0x39e1('0x6'));var path=require('path');var sox=require(_0x39e1('0x7'));var csv=require(_0x39e1('0x8'));var ejs=require(_0x39e1('0x9'));var fs=require('fs');var fs_extra=require(_0x39e1('0xa'));var _=require(_0x39e1('0xb'));var squel=require('squel');var crypto=require(_0x39e1('0xc'));var jsforce=require(_0x39e1('0xd'));var deskjs=require(_0x39e1('0xe'));var toCsv=require(_0x39e1('0x8'));var querystring=require(_0x39e1('0xf'));var Papa=require(_0x39e1('0x10'));var Redis=require('ioredis');var authService=require(_0x39e1('0x11'));var qs=require(_0x39e1('0x12'));var as=require(_0x39e1('0x13'));var hardwareService=require(_0x39e1('0x14'));var logger=require(_0x39e1('0x15'))(_0x39e1('0x16'));var utils=require(_0x39e1('0x17'));var config=require(_0x39e1('0x18'));var licenseUtil=require(_0x39e1('0x19'));var db=require(_0x39e1('0x1a'))['db'];function respondWithStatusCode(_0x170b4e,_0x822a68){_0x822a68=_0x822a68||0xcc;return function(_0x439084){if(_0x439084){return _0x170b4e[_0x39e1('0x1b')](_0x822a68);}return _0x170b4e['status'](_0x822a68)[_0x39e1('0x1c')]();};}function respondWithResult(_0x123deb,_0x33de07){_0x33de07=_0x33de07||0xc8;return function(_0x1d6d06){if(_0x1d6d06){return _0x123deb[_0x39e1('0x1d')](_0x33de07)[_0x39e1('0x1e')](_0x1d6d06);}};}function respondWithFilteredResult(_0x153422,_0x41e540){return function(_0x28a98c){if(_0x28a98c){var _0x27cae4=typeof _0x41e540[_0x39e1('0x1f')]===_0x39e1('0x20')&&typeof _0x41e540['limit']===_0x39e1('0x20');var _0x379711=_0x28a98c[_0x39e1('0x21')];var _0x14c083=_0x27cae4?0x0:_0x41e540[_0x39e1('0x1f')];var _0x1bc995=_0x27cae4?_0x28a98c[_0x39e1('0x21')]:_0x41e540[_0x39e1('0x1f')]+_0x41e540[_0x39e1('0x22')];var _0x29b261;if(_0x1bc995>=_0x379711){_0x1bc995=_0x379711;_0x29b261=0xc8;}else{_0x29b261=0xce;}_0x153422[_0x39e1('0x1d')](_0x29b261);return _0x153422['set']('Content-Range',_0x14c083+'-'+_0x1bc995+'/'+_0x379711)[_0x39e1('0x1e')](_0x28a98c);}return null;};}function patchUpdates(_0x9a90a2){return function(_0xbcb927){try{jsonpatch[_0x39e1('0x23')](_0xbcb927,_0x9a90a2,!![]);}catch(_0x332b39){return BPromise[_0x39e1('0x24')](_0x332b39);}return _0xbcb927[_0x39e1('0x25')]();};}function saveUpdates(_0x1c0b1e,_0x2fe765){return function(_0x15f7f5){if(_0x15f7f5){return _0x15f7f5['update'](_0x1c0b1e)['then'](function(_0x255770){return _0x255770;});}return null;};}function removeEntity(_0x38f73e,_0x5a0214){return function(_0xbeda7b){if(_0xbeda7b){return _0xbeda7b['destroy']()[_0x39e1('0x26')](function(){_0x38f73e[_0x39e1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1fdb,_0x43d488){return function(_0x51f60c){if(!_0x51f60c){_0x4a1fdb[_0x39e1('0x1b')](0x194);}return _0x51f60c;};}function handleError(_0x289bca,_0x32e497){_0x32e497=_0x32e497||0x1f4;return function(_0x8f9ead){logger[_0x39e1('0x27')](_0x8f9ead[_0x39e1('0x28')]);if(_0x8f9ead[_0x39e1('0x29')]){delete _0x8f9ead[_0x39e1('0x29')];}_0x289bca[_0x39e1('0x1d')](_0x32e497)['send'](_0x8f9ead);};}exports['index']=function(_0x37895a,_0x4cf274){var _0x3e7d99={},_0x3f28e4={},_0x442e6f={'count':0x0,'rows':[]};var _0x3dd1a4=_[_0x39e1('0x2a')](db[_0x39e1('0x2b')][_0x39e1('0x2c')],function(_0x51be8d){return{'name':_0x51be8d['fieldName'],'type':_0x51be8d[_0x39e1('0x2d')]['key']};});_0x3f28e4['model']=_[_0x39e1('0x2a')](_0x3dd1a4,_0x39e1('0x29'));_0x3f28e4['query']=_[_0x39e1('0x2e')](_0x37895a['query']);_0x3f28e4['filters']=_[_0x39e1('0x2f')](_0x3f28e4[_0x39e1('0x30')],_0x3f28e4['query']);_0x3e7d99[_0x39e1('0x31')]=_[_0x39e1('0x2f')](_0x3f28e4[_0x39e1('0x30')],qs[_0x39e1('0x32')](_0x37895a['query'][_0x39e1('0x32')]));_0x3e7d99['attributes']=_0x3e7d99['attributes'][_0x39e1('0x33')]?_0x3e7d99[_0x39e1('0x31')]:_0x3f28e4[_0x39e1('0x30')];if(!_0x37895a['query'][_0x39e1('0x34')](_0x39e1('0x35'))){_0x3e7d99['limit']=qs[_0x39e1('0x22')](_0x37895a[_0x39e1('0x36')]['limit']);_0x3e7d99[_0x39e1('0x1f')]=qs['offset'](_0x37895a['query']['offset']);}_0x3e7d99[_0x39e1('0x37')]=qs['sort'](_0x37895a[_0x39e1('0x36')][_0x39e1('0x38')]);_0x3e7d99[_0x39e1('0x39')]=qs[_0x39e1('0x3a')](_['pick'](_0x37895a[_0x39e1('0x36')],_0x3f28e4[_0x39e1('0x3a')]),_0x3dd1a4);if(_0x37895a[_0x39e1('0x36')][_0x39e1('0x3b')]){_0x3e7d99[_0x39e1('0x39')]=_[_0x39e1('0x3c')](_0x3e7d99['where'],{'$or':_[_0x39e1('0x2a')](_0x3dd1a4,function(_0x88d57d){if(_0x88d57d[_0x39e1('0x2d')]!==_0x39e1('0x3d')){var _0x1b1787={};_0x1b1787[_0x88d57d[_0x39e1('0x29')]]={'$like':'%'+_0x37895a[_0x39e1('0x36')][_0x39e1('0x3b')]+'%'};return _0x1b1787;}})});}_0x3e7d99=_[_0x39e1('0x3c')]({},_0x3e7d99,_0x37895a[_0x39e1('0x3e')]);var _0x2020c4={'where':_0x3e7d99[_0x39e1('0x39')]};return db['FreshsalesField'][_0x39e1('0x21')](_0x2020c4)['then'](function(_0x4560d3){_0x442e6f[_0x39e1('0x21')]=_0x4560d3;if(_0x37895a[_0x39e1('0x36')]['includeAll']){_0x3e7d99[_0x39e1('0x3f')]=[{'all':!![]}];}return db[_0x39e1('0x2b')][_0x39e1('0x40')](_0x3e7d99);})[_0x39e1('0x26')](function(_0x57c13a){_0x442e6f[_0x39e1('0x41')]=_0x57c13a;return _0x442e6f;})[_0x39e1('0x26')](respondWithFilteredResult(_0x4cf274,_0x3e7d99))[_0x39e1('0x42')](handleError(_0x4cf274,null));};exports[_0x39e1('0x43')]=function(_0x36d061,_0x266043){var _0x375045={'raw':!![],'where':{'id':_0x36d061[_0x39e1('0x44')]['id']}},_0x1632a8={};_0x1632a8['model']=_[_0x39e1('0x2e')](db[_0x39e1('0x2b')]['rawAttributes']);_0x1632a8[_0x39e1('0x36')]=_[_0x39e1('0x2e')](_0x36d061[_0x39e1('0x36')]);_0x1632a8['filters']=_[_0x39e1('0x2f')](_0x1632a8['model'],_0x1632a8[_0x39e1('0x36')]);_0x375045['attributes']=_[_0x39e1('0x2f')](_0x1632a8['model'],qs[_0x39e1('0x32')](_0x36d061['query']['fields']));_0x375045[_0x39e1('0x31')]=_0x375045[_0x39e1('0x31')][_0x39e1('0x33')]?_0x375045[_0x39e1('0x31')]:_0x1632a8['model'];if(_0x36d061['query']['includeAll']){_0x375045[_0x39e1('0x3f')]=[{'all':!![]}];}_0x375045=_['merge']({},_0x375045,_0x36d061['options']);return db['FreshsalesField']['find'](_0x375045)[_0x39e1('0x26')](handleEntityNotFound(_0x266043,null))[_0x39e1('0x26')](respondWithResult(_0x266043,null))[_0x39e1('0x42')](handleError(_0x266043,null));};exports[_0x39e1('0x45')]=function(_0x15564c,_0x36fe7d){return db[_0x39e1('0x2b')][_0x39e1('0x45')](_0x15564c[_0x39e1('0x46')],{})[_0x39e1('0x26')](respondWithResult(_0x36fe7d,0xc9))['catch'](handleError(_0x36fe7d,null));};exports[_0x39e1('0x47')]=function(_0x54d5af,_0x273263){if(_0x54d5af['body']['id']){delete _0x54d5af['body']['id'];}return db[_0x39e1('0x2b')]['find']({'where':{'id':_0x54d5af['params']['id']}})['then'](handleEntityNotFound(_0x273263,null))['then'](saveUpdates(_0x54d5af[_0x39e1('0x46')],null))['then'](respondWithResult(_0x273263,null))[_0x39e1('0x42')](handleError(_0x273263,null));};exports[_0x39e1('0x48')]=function(_0x1d39a1,_0x3e3484){return db[_0x39e1('0x2b')][_0x39e1('0x49')]({'where':{'id':_0x1d39a1[_0x39e1('0x44')]['id']}})[_0x39e1('0x26')](handleEntityNotFound(_0x3e3484,null))[_0x39e1('0x26')](removeEntity(_0x3e3484,null))[_0x39e1('0x42')](handleError(_0x3e3484,null));}; \ No newline at end of file +var _0xd463=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','Content-Range','apply','update','then','destroy','end','error','stack','map','FreshsalesField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util'];(function(_0x311ede,_0x2a31c8){var _0x1cb63c=function(_0x175dca){while(--_0x175dca){_0x311ede['push'](_0x311ede['shift']());}};_0x1cb63c(++_0x2a31c8);}(_0xd463,0xc6));var _0x3d46=function(_0x3e7b07,_0x19364a){_0x3e7b07=_0x3e7b07-0x0;var _0x33c396=_0xd463[_0x3e7b07];return _0x33c396;};'use strict';var emlformat=require(_0x3d46('0x0'));var rimraf=require(_0x3d46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d46('0x2'));var rp=require('request-promise');var moment=require(_0x3d46('0x3'));var BPromise=require(_0x3d46('0x4'));var Mustache=require('mustache');var util=require(_0x3d46('0x5'));var path=require(_0x3d46('0x6'));var sox=require(_0x3d46('0x7'));var csv=require(_0x3d46('0x8'));var ejs=require(_0x3d46('0x9'));var fs=require('fs');var fs_extra=require(_0x3d46('0xa'));var _=require(_0x3d46('0xb'));var squel=require(_0x3d46('0xc'));var crypto=require(_0x3d46('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3d46('0xe'));var toCsv=require(_0x3d46('0x8'));var querystring=require(_0x3d46('0xf'));var Papa=require(_0x3d46('0x10'));var Redis=require(_0x3d46('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3d46('0x12'));var as=require(_0x3d46('0x13'));var hardwareService=require(_0x3d46('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3d46('0x15'));var config=require(_0x3d46('0x16'));var licenseUtil=require(_0x3d46('0x17'));var db=require(_0x3d46('0x18'))['db'];function respondWithStatusCode(_0x421639,_0x701687){_0x701687=_0x701687||0xcc;return function(_0x4021d1){if(_0x4021d1){return _0x421639['sendStatus'](_0x701687);}return _0x421639['status'](_0x701687)['end']();};}function respondWithResult(_0xfb2550,_0x2bf2c8){_0x2bf2c8=_0x2bf2c8||0xc8;return function(_0xfc1d1a){if(_0xfc1d1a){return _0xfb2550[_0x3d46('0x19')](_0x2bf2c8)[_0x3d46('0x1a')](_0xfc1d1a);}};}function respondWithFilteredResult(_0x406cf1,_0x51021e){return function(_0x5ea546){if(_0x5ea546){var _0x371f7c=typeof _0x51021e[_0x3d46('0x1b')]==='undefined'&&typeof _0x51021e[_0x3d46('0x1c')]==='undefined';var _0x3115ab=_0x5ea546[_0x3d46('0x1d')];var _0xdaecd7=_0x371f7c?0x0:_0x51021e[_0x3d46('0x1b')];var _0x1edb49=_0x371f7c?_0x5ea546[_0x3d46('0x1d')]:_0x51021e['offset']+_0x51021e[_0x3d46('0x1c')];var _0x259624;if(_0x1edb49>=_0x3115ab){_0x1edb49=_0x3115ab;_0x259624=0xc8;}else{_0x259624=0xce;}_0x406cf1[_0x3d46('0x19')](_0x259624);return _0x406cf1['set'](_0x3d46('0x1e'),_0xdaecd7+'-'+_0x1edb49+'/'+_0x3115ab)[_0x3d46('0x1a')](_0x5ea546);}return null;};}function patchUpdates(_0x1a1328){return function(_0x262389){try{jsonpatch[_0x3d46('0x1f')](_0x262389,_0x1a1328,!![]);}catch(_0x4524b8){return BPromise['reject'](_0x4524b8);}return _0x262389['save']();};}function saveUpdates(_0x216b62,_0x48e9b1){return function(_0x274de8){if(_0x274de8){return _0x274de8[_0x3d46('0x20')](_0x216b62)[_0x3d46('0x21')](function(_0x57b8d8){return _0x57b8d8;});}return null;};}function removeEntity(_0x29e60d,_0x2dbd6b){return function(_0x474055){if(_0x474055){return _0x474055[_0x3d46('0x22')]()['then'](function(){_0x29e60d['status'](0xcc)[_0x3d46('0x23')]();});}};}function handleEntityNotFound(_0x152c00,_0x4431c5){return function(_0x1c69d7){if(!_0x1c69d7){_0x152c00['sendStatus'](0x194);}return _0x1c69d7;};}function handleError(_0x53bafd,_0x394cca){_0x394cca=_0x394cca||0x1f4;return function(_0x3e7d35){logger[_0x3d46('0x24')](_0x3e7d35[_0x3d46('0x25')]);if(_0x3e7d35['name']){delete _0x3e7d35['name'];}_0x53bafd[_0x3d46('0x19')](_0x394cca)['send'](_0x3e7d35);};}exports['index']=function(_0x4f302b,_0x466499){var _0x202158={},_0x20c64b={},_0x543603={'count':0x0,'rows':[]};var _0x36af7e=_[_0x3d46('0x26')](db[_0x3d46('0x27')][_0x3d46('0x28')],function(_0x3ee49d){return{'name':_0x3ee49d['fieldName'],'type':_0x3ee49d[_0x3d46('0x29')][_0x3d46('0x2a')]};});_0x20c64b[_0x3d46('0x2b')]=_[_0x3d46('0x26')](_0x36af7e,'name');_0x20c64b[_0x3d46('0x2c')]=_[_0x3d46('0x2d')](_0x4f302b[_0x3d46('0x2c')]);_0x20c64b[_0x3d46('0x2e')]=_[_0x3d46('0x2f')](_0x20c64b[_0x3d46('0x2b')],_0x20c64b[_0x3d46('0x2c')]);_0x202158['attributes']=_[_0x3d46('0x2f')](_0x20c64b[_0x3d46('0x2b')],qs[_0x3d46('0x30')](_0x4f302b[_0x3d46('0x2c')][_0x3d46('0x30')]));_0x202158[_0x3d46('0x31')]=_0x202158[_0x3d46('0x31')]['length']?_0x202158['attributes']:_0x20c64b[_0x3d46('0x2b')];if(!_0x4f302b['query']['hasOwnProperty'](_0x3d46('0x32'))){_0x202158[_0x3d46('0x1c')]=qs[_0x3d46('0x1c')](_0x4f302b['query']['limit']);_0x202158[_0x3d46('0x1b')]=qs['offset'](_0x4f302b['query'][_0x3d46('0x1b')]);}_0x202158['order']=qs[_0x3d46('0x33')](_0x4f302b[_0x3d46('0x2c')][_0x3d46('0x33')]);_0x202158['where']=qs[_0x3d46('0x2e')](_[_0x3d46('0x34')](_0x4f302b[_0x3d46('0x2c')],_0x20c64b[_0x3d46('0x2e')]),_0x36af7e);if(_0x4f302b[_0x3d46('0x2c')]['filter']){_0x202158[_0x3d46('0x35')]=_[_0x3d46('0x36')](_0x202158[_0x3d46('0x35')],{'$or':_['map'](_0x36af7e,function(_0x2f62cf){if(_0x2f62cf[_0x3d46('0x29')]!==_0x3d46('0x37')){var _0x3cc209={};_0x3cc209[_0x2f62cf['name']]={'$like':'%'+_0x4f302b[_0x3d46('0x2c')][_0x3d46('0x38')]+'%'};return _0x3cc209;}})});}_0x202158=_[_0x3d46('0x36')]({},_0x202158,_0x4f302b[_0x3d46('0x39')]);var _0x31dfcc={'where':_0x202158[_0x3d46('0x35')]};return db[_0x3d46('0x27')]['count'](_0x31dfcc)[_0x3d46('0x21')](function(_0x6e352){_0x543603[_0x3d46('0x1d')]=_0x6e352;if(_0x4f302b[_0x3d46('0x2c')]['includeAll']){_0x202158[_0x3d46('0x3a')]=[{'all':!![]}];}return db[_0x3d46('0x27')][_0x3d46('0x3b')](_0x202158);})['then'](function(_0x15a022){_0x543603['rows']=_0x15a022;return _0x543603;})[_0x3d46('0x21')](respondWithFilteredResult(_0x466499,_0x202158))[_0x3d46('0x3c')](handleError(_0x466499,null));};exports[_0x3d46('0x3d')]=function(_0x2b6303,_0x4a8cfc){var _0x459636={'raw':!![],'where':{'id':_0x2b6303[_0x3d46('0x3e')]['id']}},_0x704129={};_0x704129[_0x3d46('0x2b')]=_[_0x3d46('0x2d')](db['FreshsalesField'][_0x3d46('0x28')]);_0x704129[_0x3d46('0x2c')]=_[_0x3d46('0x2d')](_0x2b6303['query']);_0x704129[_0x3d46('0x2e')]=_[_0x3d46('0x2f')](_0x704129['model'],_0x704129[_0x3d46('0x2c')]);_0x459636[_0x3d46('0x31')]=_[_0x3d46('0x2f')](_0x704129[_0x3d46('0x2b')],qs['fields'](_0x2b6303['query']['fields']));_0x459636[_0x3d46('0x31')]=_0x459636[_0x3d46('0x31')][_0x3d46('0x3f')]?_0x459636[_0x3d46('0x31')]:_0x704129['model'];if(_0x2b6303[_0x3d46('0x2c')][_0x3d46('0x40')]){_0x459636['include']=[{'all':!![]}];}_0x459636=_[_0x3d46('0x36')]({},_0x459636,_0x2b6303['options']);return db['FreshsalesField'][_0x3d46('0x41')](_0x459636)[_0x3d46('0x21')](handleEntityNotFound(_0x4a8cfc,null))[_0x3d46('0x21')](respondWithResult(_0x4a8cfc,null))[_0x3d46('0x3c')](handleError(_0x4a8cfc,null));};exports['create']=function(_0x11d745,_0x1ab9f4){return db['FreshsalesField'][_0x3d46('0x42')](_0x11d745[_0x3d46('0x43')],{})[_0x3d46('0x21')](respondWithResult(_0x1ab9f4,0xc9))[_0x3d46('0x3c')](handleError(_0x1ab9f4,null));};exports[_0x3d46('0x20')]=function(_0x5e1fef,_0xf835ed){if(_0x5e1fef[_0x3d46('0x43')]['id']){delete _0x5e1fef[_0x3d46('0x43')]['id'];}return db[_0x3d46('0x27')][_0x3d46('0x41')]({'where':{'id':_0x5e1fef[_0x3d46('0x3e')]['id']}})[_0x3d46('0x21')](handleEntityNotFound(_0xf835ed,null))['then'](saveUpdates(_0x5e1fef[_0x3d46('0x43')],null))['then'](respondWithResult(_0xf835ed,null))[_0x3d46('0x3c')](handleError(_0xf835ed,null));};exports[_0x3d46('0x22')]=function(_0x28ffad,_0x179750){return db[_0x3d46('0x27')][_0x3d46('0x41')]({'where':{'id':_0x28ffad[_0x3d46('0x3e')]['id']}})['then'](handleEntityNotFound(_0x179750,null))[_0x3d46('0x21')](removeEntity(_0x179750,null))['catch'](handleError(_0x179750,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 4fe0ed5..f378d65 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6fa=['./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','api','request-promise','path','../../config/environment'];(function(_0x585bc7,_0x2331d2){var _0x1479fe=function(_0x3164a6){while(--_0x3164a6){_0x585bc7['push'](_0x585bc7['shift']());}};_0x1479fe(++_0x2331d2);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xb6fa[_0x16e57d];return _0x40239c;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xab6f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab6f('0x2'));var fs=require('fs');var path=require(_0xab6f('0x3'));var rimraf=require('rimraf');var config=require(_0xab6f('0x4'));var attributes=require(_0xab6f('0x5'));module[_0xab6f('0x6')]=function(_0x2d9d01,_0x156df7){return _0x2d9d01[_0xab6f('0x7')](_0xab6f('0x8'),attributes,{'tableName':_0xab6f('0x9'),'paranoid':![],'indexes':[{'name':_0xab6f('0xa'),'fields':[_0xab6f('0xb'),_0xab6f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa467=['path','rimraf','exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x382d04,_0x39b007){var _0x56911a=function(_0x58388d){while(--_0x58388d){_0x382d04['push'](_0x382d04['shift']());}};_0x56911a(++_0x39b007);}(_0xa467,0x143));var _0x7a46=function(_0x3d8098,_0x44f0ca){_0x3d8098=_0x3d8098-0x0;var _0x20dff6=_0xa467[_0x3d8098];return _0x20dff6;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var logger=require(_0x7a46('0x2'))(_0x7a46('0x3'));var moment=require(_0x7a46('0x4'));var BPromise=require(_0x7a46('0x5'));var rp=require(_0x7a46('0x6'));var fs=require('fs');var path=require(_0x7a46('0x7'));var rimraf=require(_0x7a46('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module[_0x7a46('0x9')]=function(_0x1940e6,_0x3bfa2c){return _0x1940e6[_0x7a46('0xa')](_0x7a46('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x7a46('0xc'),'fields':[_0x7a46('0xd'),_0x7a46('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 9dc75c6..f96ea8c 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x597a91,_0x4a740e){var _0x3387a7=function(_0x4f2685){while(--_0x4f2685){_0x597a91['push'](_0x597a91['shift']());}};_0x3387a7(++_0x4a740e);}(_0xba34,0x119));var _0x4ba3=function(_0x4ee8dc,_0x4c201f){_0x4ee8dc=_0x4ee8dc-0x0;var _0x289ee8=_0xba34[_0x4ee8dc];return _0x289ee8;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file +var _0xbd51=['FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x29e8fc,_0x193c52){_0x29e8fc=_0x29e8fc-0x0;var _0x9d8d9e=_0xbd51[_0x29e8fc];return _0x9d8d9e;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){return client['request'](_0x29abea,_0x19077c)[_0x1bd5('0x8')](function(_0x5c8e0d){logger[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x30a385,_0x1bd5('0xb'));logger[_0x1bd5('0xc')](_0x1bd5('0xd'),_0x30a385,_0x1bd5('0xb'),JSON['stringify'](_0x5c8e0d));if(_0x5c8e0d[_0x1bd5('0xe')]){if(_0x5c8e0d['error'][_0x1bd5('0xf')]===0x1f4){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0xd8418f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0x27d58f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x1bd5('0xb'));_0x27d58f(_0x5c8e0d[_0x1bd5('0x11')][_0x1bd5('0x10')]);}})[_0x1bd5('0x12')](function(_0x43ea3e){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x43ea3e);_0xd8418f(_0x43ea3e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 2a56d32..f9b130f 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x7e8472,_0x2f25bb){var _0x17f3dd=function(_0x5b1067){while(--_0x5b1067){_0x7e8472['push'](_0x7e8472['shift']());}};_0x17f3dd(++_0x2f25bb);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x241d15,_0x17d204){var _0x2b30f9=function(_0x2ad29a){while(--_0x2ad29a){_0x241d15['push'](_0x241d15['shift']());}};_0x2b30f9(++_0x17d204);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 79171c8..8f629bf 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 _0xadbb=['newTab','sequelize','STRING','username','ENUM','integrationTab'];(function(_0x490342,_0x18a4a8){var _0x54dc52=function(_0x57a94d){while(--_0x57a94d){_0x490342['push'](_0x490342['shift']());}};_0x54dc52(++_0x18a4a8);}(_0xadbb,0x97));var _0xbadb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xadbb[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xbadb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbadb('0x1')]},'username':{'type':Sequelize[_0xbadb('0x1')],'unique':_0xbadb('0x2')},'remoteUri':{'type':Sequelize[_0xbadb('0x1')]},'password':{'type':Sequelize[_0xbadb('0x1')]},'clientId':{'type':Sequelize[_0xbadb('0x1')]},'clientSecret':{'type':Sequelize[_0xbadb('0x1')]},'securityToken':{'type':Sequelize[_0xbadb('0x1')]},'serverUrl':{'type':Sequelize[_0xbadb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbadb('0x3')](_0xbadb('0x4'),_0xbadb('0x5')),'defaultValue':_0xbadb('0x4')}}; \ No newline at end of file +var _0x9648=['integrationTab','newTab','sequelize','STRING','username','ENUM'];(function(_0x323d17,_0x214e2d){var _0x25c3db=function(_0xd808dd){while(--_0xd808dd){_0x323d17['push'](_0x323d17['shift']());}};_0x25c3db(++_0x214e2d);}(_0x9648,0xa4));var _0x8964=function(_0x1454f6,_0x2b33db){_0x1454f6=_0x1454f6-0x0;var _0x255bcf=_0x9648[_0x1454f6];return _0x255bcf;};'use strict';var Sequelize=require(_0x8964('0x0'));module['exports']={'name':{'type':Sequelize[_0x8964('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8964('0x1')],'unique':_0x8964('0x2')},'remoteUri':{'type':Sequelize[_0x8964('0x1')]},'password':{'type':Sequelize[_0x8964('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8964('0x1')]},'securityToken':{'type':Sequelize[_0x8964('0x1')]},'serverUrl':{'type':Sequelize[_0x8964('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8964('0x3')](_0x8964('0x4'),_0x8964('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 243471a..9e9e8a1 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 _0x37a5=['count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','SalesforceAccount','include','findAll','rows','catch','params','includeAll','create','body','find','findOne','SalesforceConfiguration','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Task','remoteUri','username','slice','substring','lastIndexOf','Connection','clientId','clientSecret','login','securityToken','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','int','picklist','boolean','email','textarea','phone','includes','label','picklistValues','True','false','test','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined'];(function(_0x43124e,_0x35a6ac){var _0x24e712=function(_0x204e75){while(--_0x204e75){_0x43124e['push'](_0x43124e['shift']());}};_0x24e712(++_0x35a6ac);}(_0x37a5,0x1c4));var _0x537a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x37a5[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0x537a('0x0'));var rimraf=require(_0x537a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x537a('0x2'));var rp=require(_0x537a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x537a('0x4'));var util=require(_0x537a('0x5'));var path=require(_0x537a('0x6'));var sox=require(_0x537a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x537a('0x8'));var _=require(_0x537a('0x9'));var squel=require(_0x537a('0xa'));var crypto=require(_0x537a('0xb'));var jsforce=require(_0x537a('0xc'));var deskjs=require(_0x537a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x537a('0xe'));var Papa=require(_0x537a('0xf'));var Redis=require(_0x537a('0x10'));var authService=require(_0x537a('0x11'));var qs=require(_0x537a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x537a('0x13'));var logger=require(_0x537a('0x14'))(_0x537a('0x15'));var utils=require(_0x537a('0x16'));var config=require(_0x537a('0x17'));var licenseUtil=require(_0x537a('0x18'));var db=require(_0x537a('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x89ba6f,_0x2ab321){_0x2ab321=_0x2ab321||0xcc;return function(_0x5b42a2){if(_0x5b42a2){return _0x89ba6f[_0x537a('0x1a')](_0x2ab321);}return _0x89ba6f[_0x537a('0x1b')](_0x2ab321)[_0x537a('0x1c')]();};}function respondWithResult(_0x4a4705,_0x2db5db){_0x2db5db=_0x2db5db||0xc8;return function(_0x5baadb){if(_0x5baadb){return _0x4a4705[_0x537a('0x1b')](_0x2db5db)[_0x537a('0x1d')](_0x5baadb);}};}function respondWithFilteredResult(_0x23a75f,_0x127e4d){return function(_0x1058e8){if(_0x1058e8){var _0x449be2=typeof _0x127e4d['offset']==='undefined'&&typeof _0x127e4d[_0x537a('0x1e')]===_0x537a('0x1f');var _0x176295=_0x1058e8[_0x537a('0x20')];var _0x223a81=_0x449be2?0x0:_0x127e4d['offset'];var _0x110c51=_0x449be2?_0x1058e8['count']:_0x127e4d[_0x537a('0x21')]+_0x127e4d[_0x537a('0x1e')];var _0x4123a7;if(_0x110c51>=_0x176295){_0x110c51=_0x176295;_0x4123a7=0xc8;}else{_0x4123a7=0xce;}_0x23a75f[_0x537a('0x1b')](_0x4123a7);return _0x23a75f[_0x537a('0x22')]('Content-Range',_0x223a81+'-'+_0x110c51+'/'+_0x176295)[_0x537a('0x1d')](_0x1058e8);}return null;};}function patchUpdates(_0x18e7cc){return function(_0x5ddbe8){try{jsonpatch[_0x537a('0x23')](_0x5ddbe8,_0x18e7cc,!![]);}catch(_0x1a1923){return BPromise[_0x537a('0x24')](_0x1a1923);}return _0x5ddbe8['save']();};}function saveUpdates(_0x28752d,_0x32f95d){return function(_0x1ea536){if(_0x1ea536){return _0x1ea536[_0x537a('0x25')](_0x28752d)[_0x537a('0x26')](function(_0xc51be5){return _0xc51be5;});}return null;};}function removeEntity(_0x5a22f7,_0x59a051){return function(_0x5b8fa9){if(_0x5b8fa9){return _0x5b8fa9[_0x537a('0x27')]()[_0x537a('0x26')](function(){_0x5a22f7[_0x537a('0x1b')](0xcc)[_0x537a('0x1c')]();});}};}function handleEntityNotFound(_0x306a81,_0x3f47a5){return function(_0x6678f1){if(!_0x6678f1){_0x306a81[_0x537a('0x1a')](0x194);}return _0x6678f1;};}function handleError(_0x590561,_0x5355bc){_0x5355bc=_0x5355bc||0x1f4;return function(_0x191a06){logger[_0x537a('0x28')](_0x191a06[_0x537a('0x29')]);if(_0x191a06[_0x537a('0x2a')]){delete _0x191a06[_0x537a('0x2a')];}_0x590561['status'](_0x5355bc)[_0x537a('0x2b')](_0x191a06);};}exports[_0x537a('0x2c')]=function(_0x48be48,_0x27a438){var _0x3e02b6={},_0x4b18c6={},_0x3d2563={'count':0x0,'rows':[]};var _0x4963b3=_[_0x537a('0x2d')](db['SalesforceAccount']['rawAttributes'],function(_0xd2fe0e){return{'name':_0xd2fe0e[_0x537a('0x2e')],'type':_0xd2fe0e[_0x537a('0x2f')][_0x537a('0x30')]};});_0x4b18c6['model']=_[_0x537a('0x2d')](_0x4963b3,_0x537a('0x2a'));_0x4b18c6['query']=_[_0x537a('0x31')](_0x48be48[_0x537a('0x32')]);_0x4b18c6[_0x537a('0x33')]=_['intersection'](_0x4b18c6[_0x537a('0x34')],_0x4b18c6[_0x537a('0x32')]);_0x3e02b6[_0x537a('0x35')]=_[_0x537a('0x36')](_0x4b18c6[_0x537a('0x34')],qs[_0x537a('0x37')](_0x48be48['query'][_0x537a('0x37')]));_0x3e02b6['attributes']=_0x3e02b6['attributes'][_0x537a('0x38')]?_0x3e02b6[_0x537a('0x35')]:_0x4b18c6[_0x537a('0x34')];if(!_0x48be48[_0x537a('0x32')][_0x537a('0x39')](_0x537a('0x3a'))){_0x3e02b6[_0x537a('0x1e')]=qs[_0x537a('0x1e')](_0x48be48[_0x537a('0x32')]['limit']);_0x3e02b6['offset']=qs['offset'](_0x48be48[_0x537a('0x32')][_0x537a('0x21')]);}_0x3e02b6[_0x537a('0x3b')]=qs[_0x537a('0x3c')](_0x48be48[_0x537a('0x32')][_0x537a('0x3c')]);_0x3e02b6['where']=qs[_0x537a('0x33')](_[_0x537a('0x3d')](_0x48be48[_0x537a('0x32')],_0x4b18c6[_0x537a('0x33')]),_0x4963b3);if(_0x48be48[_0x537a('0x32')]['filter']){_0x3e02b6[_0x537a('0x3e')]=_[_0x537a('0x3f')](_0x3e02b6['where'],{'$or':_[_0x537a('0x2d')](_0x4963b3,function(_0x350e4f){if(_0x350e4f[_0x537a('0x2f')]!==_0x537a('0x40')){var _0x5d8f54={};_0x5d8f54[_0x350e4f[_0x537a('0x2a')]]={'$like':'%'+_0x48be48['query'][_0x537a('0x41')]+'%'};return _0x5d8f54;}})});}_0x3e02b6=_['merge']({},_0x3e02b6,_0x48be48['options']);var _0x371988={'where':_0x3e02b6[_0x537a('0x3e')]};return db[_0x537a('0x42')]['count'](_0x371988)['then'](function(_0x2ee0d1){_0x3d2563[_0x537a('0x20')]=_0x2ee0d1;if(_0x48be48[_0x537a('0x32')]['includeAll']){_0x3e02b6[_0x537a('0x43')]=[{'all':!![]}];}return db[_0x537a('0x42')][_0x537a('0x44')](_0x3e02b6);})[_0x537a('0x26')](function(_0x516ce3){_0x3d2563[_0x537a('0x45')]=_0x516ce3;return _0x3d2563;})[_0x537a('0x26')](respondWithFilteredResult(_0x27a438,_0x3e02b6))[_0x537a('0x46')](handleError(_0x27a438,null));};exports['show']=function(_0x1444d5,_0x23db8b){var _0x3000d6={'raw':![],'where':{'id':_0x1444d5[_0x537a('0x47')]['id']}},_0x585f5d={};_0x585f5d[_0x537a('0x34')]=_[_0x537a('0x31')](db[_0x537a('0x42')]['rawAttributes']);_0x585f5d[_0x537a('0x32')]=_[_0x537a('0x31')](_0x1444d5[_0x537a('0x32')]);_0x585f5d['filters']=_[_0x537a('0x36')](_0x585f5d['model'],_0x585f5d[_0x537a('0x32')]);_0x3000d6[_0x537a('0x35')]=_[_0x537a('0x36')](_0x585f5d[_0x537a('0x34')],qs[_0x537a('0x37')](_0x1444d5[_0x537a('0x32')][_0x537a('0x37')]));_0x3000d6[_0x537a('0x35')]=_0x3000d6['attributes']['length']?_0x3000d6['attributes']:_0x585f5d['model'];if(_0x1444d5[_0x537a('0x32')][_0x537a('0x48')]){_0x3000d6[_0x537a('0x43')]=[{'all':!![]}];}_0x3000d6=_[_0x537a('0x3f')]({},_0x3000d6,_0x1444d5['options']);return db[_0x537a('0x42')]['find'](_0x3000d6)[_0x537a('0x26')](handleEntityNotFound(_0x23db8b,null))[_0x537a('0x26')](respondWithResult(_0x23db8b,null))['catch'](handleError(_0x23db8b,null));};exports[_0x537a('0x49')]=function(_0x31f9a7,_0x56050e){return db['SalesforceAccount'][_0x537a('0x49')](_0x31f9a7[_0x537a('0x4a')],{})[_0x537a('0x26')](respondWithResult(_0x56050e,0xc9))[_0x537a('0x46')](handleError(_0x56050e,null));};exports['update']=function(_0x6001b9,_0x2bbe85){if(_0x6001b9[_0x537a('0x4a')]['id']){delete _0x6001b9['body']['id'];}return db[_0x537a('0x42')][_0x537a('0x4b')]({'where':{'id':_0x6001b9[_0x537a('0x47')]['id']}})[_0x537a('0x26')](handleEntityNotFound(_0x2bbe85,null))[_0x537a('0x26')](saveUpdates(_0x6001b9[_0x537a('0x4a')],null))[_0x537a('0x26')](respondWithResult(_0x2bbe85,null))[_0x537a('0x46')](handleError(_0x2bbe85,null));};exports[_0x537a('0x27')]=function(_0x578867,_0x3a4c2d){return db[_0x537a('0x42')][_0x537a('0x4b')]({'where':{'id':_0x578867[_0x537a('0x47')]['id']}})[_0x537a('0x26')](handleEntityNotFound(_0x3a4c2d,null))[_0x537a('0x26')](removeEntity(_0x3a4c2d,null))[_0x537a('0x46')](handleError(_0x3a4c2d,null));};exports['getConfigurations']=function(_0x213a7d,_0x5832b3,_0x4ba575){var _0x1bd7eb={};var _0xc2f442={};var _0x1b3167;var _0x31c7f8;return db[_0x537a('0x42')][_0x537a('0x4c')]({'where':{'id':_0x213a7d[_0x537a('0x47')]['id']}})[_0x537a('0x26')](handleEntityNotFound(_0x5832b3,null))['then'](function(_0xeca0a0){if(_0xeca0a0){_0x1b3167=_0xeca0a0;_0xc2f442[_0x537a('0x34')]=_[_0x537a('0x31')](db[_0x537a('0x4d')]['rawAttributes']);_0xc2f442[_0x537a('0x32')]=_[_0x537a('0x31')](_0x213a7d[_0x537a('0x32')]);_0xc2f442['filters']=_[_0x537a('0x36')](_0xc2f442[_0x537a('0x34')],_0xc2f442[_0x537a('0x32')]);_0x1bd7eb[_0x537a('0x35')]=_[_0x537a('0x36')](_0xc2f442[_0x537a('0x34')],qs['fields'](_0x213a7d[_0x537a('0x32')]['fields']));_0x1bd7eb[_0x537a('0x35')]=_0x1bd7eb['attributes'][_0x537a('0x38')]?_0x1bd7eb['attributes']:_0xc2f442[_0x537a('0x34')];_0x1bd7eb[_0x537a('0x3b')]=qs[_0x537a('0x3c')](_0x213a7d[_0x537a('0x32')][_0x537a('0x3c')]);_0x1bd7eb[_0x537a('0x3e')]=qs[_0x537a('0x33')](_[_0x537a('0x3d')](_0x213a7d[_0x537a('0x32')],_0xc2f442[_0x537a('0x33')]));if(_0x213a7d['query']['filter']){_0x1bd7eb[_0x537a('0x3e')]=_[_0x537a('0x3f')](_0x1bd7eb[_0x537a('0x3e')],{'$or':_[_0x537a('0x2d')](_0x1bd7eb[_0x537a('0x35')],function(_0x4277a4){var _0x35581e={};_0x35581e[_0x4277a4]={'$like':'%'+_0x213a7d[_0x537a('0x32')][_0x537a('0x41')]+'%'};return _0x35581e;})});}_0x1bd7eb=_[_0x537a('0x3f')]({},_0x1bd7eb,_0x213a7d[_0x537a('0x4e')]);return _0x1b3167[_0x537a('0x4f')](_0x1bd7eb);}})[_0x537a('0x26')](function(_0x3ef443){if(_0x3ef443){_0x31c7f8=_0x3ef443[_0x537a('0x38')];if(!_0x213a7d['query'][_0x537a('0x39')](_0x537a('0x3a'))){_0x1bd7eb[_0x537a('0x1e')]=qs[_0x537a('0x1e')](_0x213a7d[_0x537a('0x32')][_0x537a('0x1e')]);_0x1bd7eb[_0x537a('0x21')]=qs[_0x537a('0x21')](_0x213a7d[_0x537a('0x32')]['offset']);}return _0x1b3167[_0x537a('0x4f')](_0x1bd7eb);}})[_0x537a('0x26')](function(_0x6ad541){if(_0x6ad541){return _0x6ad541?{'count':_0x31c7f8,'rows':_0x6ad541}:null;}})['then'](respondWithResult(_0x5832b3,null))[_0x537a('0x46')](handleError(_0x5832b3,null));};exports[_0x537a('0x50')]=function(_0x52b8da,_0x32fc46,_0x5b1505){if(_0x52b8da[_0x537a('0x4a')]['id']){delete _0x52b8da['body']['id'];}return db[_0x537a('0x42')]['findOne']({'where':{'id':_0x52b8da[_0x537a('0x47')]['id']}})[_0x537a('0x26')](handleEntityNotFound(_0x32fc46,null))[_0x537a('0x26')](function(_0x4924c3){if(_0x4924c3){_0x52b8da['body'][_0x537a('0x51')]=_0x4924c3['id'];_0x52b8da['body'][_0x537a('0x52')]=integrations[_0x537a('0x53')](_0x52b8da['body']['channel'],_0x52b8da[_0x537a('0x4a')]['type']);_0x52b8da[_0x537a('0x4a')][_0x537a('0x54')]=integrations[_0x537a('0x55')](_0x52b8da[_0x537a('0x4a')][_0x537a('0x56')],_0x52b8da[_0x537a('0x4a')]['type']);return db[_0x537a('0x4d')]['create'](_0x52b8da[_0x537a('0x4a')],{'include':[{'model':db['SalesforceField'],'as':_0x537a('0x52')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x537a('0x26')](respondWithResult(_0x32fc46,null))[_0x537a('0x46')](handleError(_0x32fc46,null));};exports['getFields']=function(_0x2a9cd7,_0x5d366e,_0x1b6f70){var _0x6958e8;var _0x52b365='';var _0x223f91=_0x537a('0x57');return db[_0x537a('0x42')][_0x537a('0x4c')]({'where':{'id':_0x2a9cd7[_0x537a('0x47')]['id']},'attributes':['id',_0x537a('0x58'),'clientId','clientSecret',_0x537a('0x59'),'password','securityToken']})[_0x537a('0x26')](handleEntityNotFound(_0x5d366e,null))['then'](function(_0x2b3bb4){if(_0x2b3bb4){_0x52b365=_0x2b3bb4[_0x537a('0x58')];var _0x1e120d=_0x52b365[_0x537a('0x5a')](-0x1);if(_0x1e120d==='/'){_0x52b365=_0x52b365[_0x537a('0x5b')](0x0,_0x52b365[_0x537a('0x5c')](_0x1e120d));}_0x6958e8=new jsforce[(_0x537a('0x5d'))]({'oauth2':{'loginUrl':_0x52b365,'clientId':_0x2b3bb4[_0x537a('0x5e')],'clientSecret':_0x2b3bb4[_0x537a('0x5f')]}});return _0x6958e8[_0x537a('0x60')](_0x2b3bb4[_0x537a('0x59')],_0x2b3bb4['password']['concat'](_0x2b3bb4[_0x537a('0x61')]));}})[_0x537a('0x26')](function(_0x492e7c){if(_0x492e7c){if(!_['isNil'](_0x2a9cd7['query'][_0x537a('0x62')])){_0x223f91=_0x2a9cd7[_0x537a('0x32')][_0x537a('0x62')];}return _0x6958e8[_0x537a('0x63')](_0x223f91)[_0x537a('0x64')]();}})[_0x537a('0x26')](function(_0x426c5a){var _0x4380cf=[_0x537a('0x65'),_0x537a('0x66'),'IsReminderSet',_0x537a('0x67'),_0x537a('0x68'),_0x537a('0x69')];var _0xe9b8c4=['string',_0x537a('0x6a'),_0x537a('0x6b'),_0x537a('0x6c'),_0x537a('0x6d'),_0x537a('0x6e'),_0x537a('0x6f')];if(_0x426c5a){_['remove'](_0x426c5a[_0x537a('0x37')],function(_0x9505bf){return _0x4380cf[_0x537a('0x70')](_0x9505bf[_0x537a('0x2a')])||!_0xe9b8c4[_0x537a('0x70')](_0x9505bf['type']);});return{'count':_0x426c5a[_0x537a('0x37')][_0x537a('0x38')],'rows':_['map'](_0x426c5a[_0x537a('0x37')],function(_0x22b083){return{'id':_0x22b083[_0x537a('0x2a')],'name':_0x22b083[_0x537a('0x71')],'custom':_0x22b083['custom'],'options':_0x22b083['picklistValues']['length']>0x0?_[_0x537a('0x2d')](_0x22b083[_0x537a('0x72')],function(_0xb6a747){return{'name':_0xb6a747[_0x537a('0x71')],'value':_0xb6a747['value']};}):_0x22b083[_0x537a('0x2f')]=='boolean'?[{'name':_0x537a('0x73'),'value':'true'},{'name':'False','value':_0x537a('0x74')}]:[]};})};}})[_0x537a('0x26')](respondWithResult(_0x5d366e,null))[_0x537a('0x46')](function(_0xd157cc){var _0x545130=_0x2a9cd7[_0x537a('0x32')][_0x537a('0x75')]?0x1f4:_0xd157cc[_0x537a('0x76')]||0x1f4;logger[_0x537a('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x537a('0x77'),_0x545130,JSON['stringify'](_0xd157cc));delete _0xd157cc[_0x537a('0x2a')];if(_0x545130===0x191){_0x545130=0x190;}_0x5d366e[_0x537a('0x1b')](_0x545130)[_0x537a('0x2b')](_0x2a9cd7[_0x537a('0x32')][_0x537a('0x75')]?{'message':_0x537a('0x78'),'statusCode':_0xd157cc[_0x537a('0x76')]}:_0xd157cc);});}; \ No newline at end of file +var _0xe185=['sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','create','update','body','find','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','Task','clientId','username','password','securityToken','remoteUri','slice','Connection','clientSecret','login','concat','ticketType','sobject','IsRecurrence','Description','picklist','boolean','email','textarea','phone','remove','label','custom','picklistValues','True','true','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration'];(function(_0x216ac9,_0x506dff){var _0x34de4b=function(_0x2d1aab){while(--_0x2d1aab){_0x216ac9['push'](_0x216ac9['shift']());}};_0x34de4b(++_0x506dff);}(_0xe185,0xd2));var _0x5e18=function(_0x27696e,_0x1bdf97){_0x27696e=_0x27696e-0x0;var _0xb063b5=_0xe185[_0x27696e];return _0xb063b5;};'use strict';var emlformat=require(_0x5e18('0x0'));var rimraf=require(_0x5e18('0x1'));var zipdir=require(_0x5e18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e18('0x3'));var moment=require(_0x5e18('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5e18('0x5'));var util=require(_0x5e18('0x6'));var path=require(_0x5e18('0x7'));var sox=require(_0x5e18('0x8'));var csv=require(_0x5e18('0x9'));var ejs=require(_0x5e18('0xa'));var fs=require('fs');var fs_extra=require(_0x5e18('0xb'));var _=require(_0x5e18('0xc'));var squel=require('squel');var crypto=require(_0x5e18('0xd'));var jsforce=require(_0x5e18('0xe'));var deskjs=require(_0x5e18('0xf'));var toCsv=require(_0x5e18('0x9'));var querystring=require(_0x5e18('0x10'));var Papa=require(_0x5e18('0x11'));var Redis=require(_0x5e18('0x12'));var authService=require(_0x5e18('0x13'));var qs=require(_0x5e18('0x14'));var as=require(_0x5e18('0x15'));var hardwareService=require(_0x5e18('0x16'));var logger=require(_0x5e18('0x17'))(_0x5e18('0x18'));var utils=require(_0x5e18('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5e18('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5e18('0x1b'));function respondWithStatusCode(_0x5f075c,_0x2eb181){_0x2eb181=_0x2eb181||0xcc;return function(_0x224c24){if(_0x224c24){return _0x5f075c[_0x5e18('0x1c')](_0x2eb181);}return _0x5f075c[_0x5e18('0x1d')](_0x2eb181)[_0x5e18('0x1e')]();};}function respondWithResult(_0x5daae2,_0x316259){_0x316259=_0x316259||0xc8;return function(_0x36b5c2){if(_0x36b5c2){return _0x5daae2[_0x5e18('0x1d')](_0x316259)[_0x5e18('0x1f')](_0x36b5c2);}};}function respondWithFilteredResult(_0x54a41e,_0x5a01b2){return function(_0x5e3022){if(_0x5e3022){var _0x3e0e5d=typeof _0x5a01b2[_0x5e18('0x20')]==='undefined'&&typeof _0x5a01b2[_0x5e18('0x21')]===_0x5e18('0x22');var _0x328a4d=_0x5e3022[_0x5e18('0x23')];var _0x15c575=_0x3e0e5d?0x0:_0x5a01b2['offset'];var _0x1b31b8=_0x3e0e5d?_0x5e3022[_0x5e18('0x23')]:_0x5a01b2[_0x5e18('0x20')]+_0x5a01b2['limit'];var _0x4992ea;if(_0x1b31b8>=_0x328a4d){_0x1b31b8=_0x328a4d;_0x4992ea=0xc8;}else{_0x4992ea=0xce;}_0x54a41e[_0x5e18('0x1d')](_0x4992ea);return _0x54a41e[_0x5e18('0x24')]('Content-Range',_0x15c575+'-'+_0x1b31b8+'/'+_0x328a4d)[_0x5e18('0x1f')](_0x5e3022);}return null;};}function patchUpdates(_0x1806ae){return function(_0x23f320){try{jsonpatch[_0x5e18('0x25')](_0x23f320,_0x1806ae,!![]);}catch(_0x58b263){return BPromise[_0x5e18('0x26')](_0x58b263);}return _0x23f320[_0x5e18('0x27')]();};}function saveUpdates(_0xb5000e,_0x3b057c){return function(_0x359258){if(_0x359258){return _0x359258['update'](_0xb5000e)[_0x5e18('0x28')](function(_0xe50a7c){return _0xe50a7c;});}return null;};}function removeEntity(_0x37e757,_0x11118f){return function(_0x52a70a){if(_0x52a70a){return _0x52a70a[_0x5e18('0x29')]()[_0x5e18('0x28')](function(){_0x37e757[_0x5e18('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10e87f,_0x8f3394){return function(_0x5d1e09){if(!_0x5d1e09){_0x10e87f['sendStatus'](0x194);}return _0x5d1e09;};}function handleError(_0x10884d,_0x429bcd){_0x429bcd=_0x429bcd||0x1f4;return function(_0x555295){logger['error'](_0x555295[_0x5e18('0x2a')]);if(_0x555295[_0x5e18('0x2b')]){delete _0x555295[_0x5e18('0x2b')];}_0x10884d[_0x5e18('0x1d')](_0x429bcd)[_0x5e18('0x2c')](_0x555295);};}exports[_0x5e18('0x2d')]=function(_0x497099,_0x21da34){var _0x230f3f={},_0x39bfe0={},_0x11385e={'count':0x0,'rows':[]};var _0x328689=_[_0x5e18('0x2e')](db[_0x5e18('0x2f')][_0x5e18('0x30')],function(_0x5af32f){return{'name':_0x5af32f[_0x5e18('0x31')],'type':_0x5af32f[_0x5e18('0x32')][_0x5e18('0x33')]};});_0x39bfe0[_0x5e18('0x34')]=_[_0x5e18('0x2e')](_0x328689,_0x5e18('0x2b'));_0x39bfe0['query']=_[_0x5e18('0x35')](_0x497099[_0x5e18('0x36')]);_0x39bfe0[_0x5e18('0x37')]=_[_0x5e18('0x38')](_0x39bfe0[_0x5e18('0x34')],_0x39bfe0[_0x5e18('0x36')]);_0x230f3f[_0x5e18('0x39')]=_[_0x5e18('0x38')](_0x39bfe0['model'],qs[_0x5e18('0x3a')](_0x497099[_0x5e18('0x36')][_0x5e18('0x3a')]));_0x230f3f['attributes']=_0x230f3f['attributes'][_0x5e18('0x3b')]?_0x230f3f[_0x5e18('0x39')]:_0x39bfe0[_0x5e18('0x34')];if(!_0x497099[_0x5e18('0x36')][_0x5e18('0x3c')](_0x5e18('0x3d'))){_0x230f3f['limit']=qs[_0x5e18('0x21')](_0x497099[_0x5e18('0x36')][_0x5e18('0x21')]);_0x230f3f[_0x5e18('0x20')]=qs[_0x5e18('0x20')](_0x497099[_0x5e18('0x36')][_0x5e18('0x20')]);}_0x230f3f[_0x5e18('0x3e')]=qs['sort'](_0x497099['query'][_0x5e18('0x3f')]);_0x230f3f[_0x5e18('0x40')]=qs[_0x5e18('0x37')](_[_0x5e18('0x41')](_0x497099[_0x5e18('0x36')],_0x39bfe0[_0x5e18('0x37')]),_0x328689);if(_0x497099[_0x5e18('0x36')]['filter']){_0x230f3f[_0x5e18('0x40')]=_[_0x5e18('0x42')](_0x230f3f[_0x5e18('0x40')],{'$or':_[_0x5e18('0x2e')](_0x328689,function(_0x238678){if(_0x238678['type']!==_0x5e18('0x43')){var _0x2d9efc={};_0x2d9efc[_0x238678[_0x5e18('0x2b')]]={'$like':'%'+_0x497099[_0x5e18('0x36')][_0x5e18('0x44')]+'%'};return _0x2d9efc;}})});}_0x230f3f=_['merge']({},_0x230f3f,_0x497099[_0x5e18('0x45')]);var _0x3d85df={'where':_0x230f3f[_0x5e18('0x40')]};return db[_0x5e18('0x2f')][_0x5e18('0x23')](_0x3d85df)['then'](function(_0x562b62){_0x11385e[_0x5e18('0x23')]=_0x562b62;if(_0x497099[_0x5e18('0x36')][_0x5e18('0x46')]){_0x230f3f[_0x5e18('0x47')]=[{'all':!![]}];}return db[_0x5e18('0x2f')][_0x5e18('0x48')](_0x230f3f);})[_0x5e18('0x28')](function(_0x1c0301){_0x11385e['rows']=_0x1c0301;return _0x11385e;})[_0x5e18('0x28')](respondWithFilteredResult(_0x21da34,_0x230f3f))[_0x5e18('0x49')](handleError(_0x21da34,null));};exports['show']=function(_0x40363c,_0x1d19b3){var _0x4d9485={'raw':![],'where':{'id':_0x40363c[_0x5e18('0x4a')]['id']}},_0x5ea536={};_0x5ea536[_0x5e18('0x34')]=_[_0x5e18('0x35')](db[_0x5e18('0x2f')][_0x5e18('0x30')]);_0x5ea536[_0x5e18('0x36')]=_[_0x5e18('0x35')](_0x40363c[_0x5e18('0x36')]);_0x5ea536[_0x5e18('0x37')]=_['intersection'](_0x5ea536[_0x5e18('0x34')],_0x5ea536['query']);_0x4d9485['attributes']=_['intersection'](_0x5ea536['model'],qs[_0x5e18('0x3a')](_0x40363c[_0x5e18('0x36')]['fields']));_0x4d9485[_0x5e18('0x39')]=_0x4d9485['attributes'][_0x5e18('0x3b')]?_0x4d9485[_0x5e18('0x39')]:_0x5ea536[_0x5e18('0x34')];if(_0x40363c[_0x5e18('0x36')][_0x5e18('0x46')]){_0x4d9485['include']=[{'all':!![]}];}_0x4d9485=_[_0x5e18('0x42')]({},_0x4d9485,_0x40363c[_0x5e18('0x45')]);return db[_0x5e18('0x2f')]['find'](_0x4d9485)[_0x5e18('0x28')](handleEntityNotFound(_0x1d19b3,null))[_0x5e18('0x28')](respondWithResult(_0x1d19b3,null))[_0x5e18('0x49')](handleError(_0x1d19b3,null));};exports[_0x5e18('0x4b')]=function(_0x3754bb,_0x29555f){return db['SalesforceAccount'][_0x5e18('0x4b')](_0x3754bb['body'],{})[_0x5e18('0x28')](respondWithResult(_0x29555f,0xc9))[_0x5e18('0x49')](handleError(_0x29555f,null));};exports[_0x5e18('0x4c')]=function(_0xb6463c,_0x30f721){if(_0xb6463c[_0x5e18('0x4d')]['id']){delete _0xb6463c[_0x5e18('0x4d')]['id'];}return db[_0x5e18('0x2f')][_0x5e18('0x4e')]({'where':{'id':_0xb6463c[_0x5e18('0x4a')]['id']}})[_0x5e18('0x28')](handleEntityNotFound(_0x30f721,null))[_0x5e18('0x28')](saveUpdates(_0xb6463c[_0x5e18('0x4d')],null))[_0x5e18('0x28')](respondWithResult(_0x30f721,null))['catch'](handleError(_0x30f721,null));};exports['destroy']=function(_0x76eadc,_0x2b3da0){return db[_0x5e18('0x2f')][_0x5e18('0x4e')]({'where':{'id':_0x76eadc[_0x5e18('0x4a')]['id']}})[_0x5e18('0x28')](handleEntityNotFound(_0x2b3da0,null))[_0x5e18('0x28')](removeEntity(_0x2b3da0,null))[_0x5e18('0x49')](handleError(_0x2b3da0,null));};exports[_0x5e18('0x4f')]=function(_0x22c5b8,_0x5b8bbf,_0x4b585b){var _0x996358={};var _0x2c3908={};var _0x2ad064;var _0x40ae83;return db[_0x5e18('0x2f')]['findOne']({'where':{'id':_0x22c5b8[_0x5e18('0x4a')]['id']}})[_0x5e18('0x28')](handleEntityNotFound(_0x5b8bbf,null))['then'](function(_0x42cb90){if(_0x42cb90){_0x2ad064=_0x42cb90;_0x2c3908[_0x5e18('0x34')]=_[_0x5e18('0x35')](db['SalesforceConfiguration']['rawAttributes']);_0x2c3908[_0x5e18('0x36')]=_[_0x5e18('0x35')](_0x22c5b8['query']);_0x2c3908['filters']=_[_0x5e18('0x38')](_0x2c3908[_0x5e18('0x34')],_0x2c3908['query']);_0x996358[_0x5e18('0x39')]=_['intersection'](_0x2c3908[_0x5e18('0x34')],qs[_0x5e18('0x3a')](_0x22c5b8[_0x5e18('0x36')][_0x5e18('0x3a')]));_0x996358[_0x5e18('0x39')]=_0x996358[_0x5e18('0x39')][_0x5e18('0x3b')]?_0x996358[_0x5e18('0x39')]:_0x2c3908['model'];_0x996358[_0x5e18('0x3e')]=qs[_0x5e18('0x3f')](_0x22c5b8[_0x5e18('0x36')][_0x5e18('0x3f')]);_0x996358['where']=qs[_0x5e18('0x37')](_['pick'](_0x22c5b8[_0x5e18('0x36')],_0x2c3908[_0x5e18('0x37')]));if(_0x22c5b8[_0x5e18('0x36')][_0x5e18('0x44')]){_0x996358[_0x5e18('0x40')]=_['merge'](_0x996358['where'],{'$or':_['map'](_0x996358[_0x5e18('0x39')],function(_0x36cd57){var _0x21385={};_0x21385[_0x36cd57]={'$like':'%'+_0x22c5b8[_0x5e18('0x36')][_0x5e18('0x44')]+'%'};return _0x21385;})});}_0x996358=_[_0x5e18('0x42')]({},_0x996358,_0x22c5b8[_0x5e18('0x45')]);return _0x2ad064[_0x5e18('0x4f')](_0x996358);}})[_0x5e18('0x28')](function(_0x2e9a7a){if(_0x2e9a7a){_0x40ae83=_0x2e9a7a[_0x5e18('0x3b')];if(!_0x22c5b8[_0x5e18('0x36')]['hasOwnProperty']('nolimit')){_0x996358[_0x5e18('0x21')]=qs[_0x5e18('0x21')](_0x22c5b8['query'][_0x5e18('0x21')]);_0x996358[_0x5e18('0x20')]=qs['offset'](_0x22c5b8[_0x5e18('0x36')]['offset']);}return _0x2ad064[_0x5e18('0x4f')](_0x996358);}})[_0x5e18('0x28')](function(_0x121078){if(_0x121078){return _0x121078?{'count':_0x40ae83,'rows':_0x121078}:null;}})['then'](respondWithResult(_0x5b8bbf,null))[_0x5e18('0x49')](handleError(_0x5b8bbf,null));};exports[_0x5e18('0x50')]=function(_0x59ab7c,_0x379a8d,_0x49f066){if(_0x59ab7c[_0x5e18('0x4d')]['id']){delete _0x59ab7c[_0x5e18('0x4d')]['id'];}return db['SalesforceAccount'][_0x5e18('0x51')]({'where':{'id':_0x59ab7c[_0x5e18('0x4a')]['id']}})[_0x5e18('0x28')](handleEntityNotFound(_0x379a8d,null))['then'](function(_0x373b29){if(_0x373b29){_0x59ab7c[_0x5e18('0x4d')][_0x5e18('0x52')]=_0x373b29['id'];_0x59ab7c[_0x5e18('0x4d')][_0x5e18('0x53')]=integrations[_0x5e18('0x54')](_0x59ab7c['body'][_0x5e18('0x55')],_0x59ab7c[_0x5e18('0x4d')][_0x5e18('0x32')]);_0x59ab7c[_0x5e18('0x4d')][_0x5e18('0x56')]=integrations['getDescriptions'](_0x59ab7c['body'][_0x5e18('0x55')],_0x59ab7c[_0x5e18('0x4d')][_0x5e18('0x32')]);return db[_0x5e18('0x57')][_0x5e18('0x4b')](_0x59ab7c[_0x5e18('0x4d')],{'include':[{'model':db[_0x5e18('0x58')],'as':'Subjects'},{'model':db[_0x5e18('0x58')],'as':'Descriptions'}]});}return null;})[_0x5e18('0x28')](respondWithResult(_0x379a8d,null))['catch'](handleError(_0x379a8d,null));};exports['getFields']=function(_0x3e289f,_0x2b3934,_0x559e3b){var _0x1c7071;var _0x24771c='';var _0x2a40a9=_0x5e18('0x59');return db[_0x5e18('0x2f')][_0x5e18('0x51')]({'where':{'id':_0x3e289f[_0x5e18('0x4a')]['id']},'attributes':['id','remoteUri',_0x5e18('0x5a'),'clientSecret',_0x5e18('0x5b'),_0x5e18('0x5c'),_0x5e18('0x5d')]})[_0x5e18('0x28')](handleEntityNotFound(_0x2b3934,null))[_0x5e18('0x28')](function(_0x5a977a){if(_0x5a977a){_0x24771c=_0x5a977a[_0x5e18('0x5e')];var _0x11ebaf=_0x24771c[_0x5e18('0x5f')](-0x1);if(_0x11ebaf==='/'){_0x24771c=_0x24771c['substring'](0x0,_0x24771c['lastIndexOf'](_0x11ebaf));}_0x1c7071=new jsforce[(_0x5e18('0x60'))]({'oauth2':{'loginUrl':_0x24771c,'clientId':_0x5a977a['clientId'],'clientSecret':_0x5a977a[_0x5e18('0x61')]}});return _0x1c7071[_0x5e18('0x62')](_0x5a977a[_0x5e18('0x5b')],_0x5a977a[_0x5e18('0x5c')][_0x5e18('0x63')](_0x5a977a['securityToken']));}})[_0x5e18('0x28')](function(_0x2ff64c){if(_0x2ff64c){if(!_['isNil'](_0x3e289f['query'][_0x5e18('0x64')])){_0x2a40a9=_0x3e289f[_0x5e18('0x36')]['ticketType'];}return _0x1c7071[_0x5e18('0x65')](_0x2a40a9)['describe']();}})[_0x5e18('0x28')](function(_0x32bfcb){var _0x5df4d1=['OwnerId','ActivityDate','IsReminderSet',_0x5e18('0x66'),'Subject',_0x5e18('0x67')];var _0x127903=['string','int',_0x5e18('0x68'),_0x5e18('0x69'),_0x5e18('0x6a'),_0x5e18('0x6b'),_0x5e18('0x6c')];if(_0x32bfcb){_[_0x5e18('0x6d')](_0x32bfcb['fields'],function(_0x124504){return _0x5df4d1['includes'](_0x124504[_0x5e18('0x2b')])||!_0x127903['includes'](_0x124504[_0x5e18('0x32')]);});return{'count':_0x32bfcb['fields'][_0x5e18('0x3b')],'rows':_[_0x5e18('0x2e')](_0x32bfcb[_0x5e18('0x3a')],function(_0x16b695){return{'id':_0x16b695[_0x5e18('0x2b')],'name':_0x16b695[_0x5e18('0x6e')],'custom':_0x16b695[_0x5e18('0x6f')],'options':_0x16b695['picklistValues'][_0x5e18('0x3b')]>0x0?_['map'](_0x16b695[_0x5e18('0x70')],function(_0x12ad43){return{'name':_0x12ad43[_0x5e18('0x6e')],'value':_0x12ad43['value']};}):_0x16b695[_0x5e18('0x32')]==_0x5e18('0x69')?[{'name':_0x5e18('0x71'),'value':_0x5e18('0x72')},{'name':'False','value':'false'}]:[]};})};}})[_0x5e18('0x28')](respondWithResult(_0x2b3934,null))[_0x5e18('0x49')](function(_0x1c0017){var _0x1f331e=_0x3e289f[_0x5e18('0x36')]['test']?0x1f4:_0x1c0017[_0x5e18('0x73')]||0x1f4;logger['error'](_0x5e18('0x74'),_0x5e18('0x75'),_0x1f331e,JSON[_0x5e18('0x76')](_0x1c0017));delete _0x1c0017[_0x5e18('0x2b')];if(_0x1f331e===0x191){_0x1f331e=0x190;}_0x2b3934[_0x5e18('0x1d')](_0x1f331e)['send'](_0x3e289f[_0x5e18('0x36')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1c0017['statusCode']}:_0x1c0017);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index e328799..7dcac23 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 _0x1a5c=['int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0x1a5c,0x6a));var _0xc1a5=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1a5c[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xc1a5('0x0'));var util=require(_0xc1a5('0x1'));var logger=require(_0xc1a5('0x2'))(_0xc1a5('0x3'));var moment=require(_0xc1a5('0x4'));var BPromise=require(_0xc1a5('0x5'));var rp=require(_0xc1a5('0x6'));var fs=require('fs');var path=require(_0xc1a5('0x7'));var rimraf=require(_0xc1a5('0x8'));var config=require(_0xc1a5('0x9'));var attributes=require(_0xc1a5('0xa'));var integrations=require(_0xc1a5('0xb'));module[_0xc1a5('0xc')]=function(_0x20f23f,_0x153c34){return _0x20f23f['define'](_0xc1a5('0xd'),attributes,{'tableName':_0xc1a5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44af=['SalesforceAccount','int_salesforce_accounts','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x2614d1,_0x500038){var _0x8f1d0b=function(_0x1e48e9){while(--_0x1e48e9){_0x2614d1['push'](_0x2614d1['shift']());}};_0x8f1d0b(++_0x500038);}(_0x44af,0xc5));var _0xf44a=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0x44af[_0x252328];return _0xaa85b7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf44a('0x0'))(_0xf44a('0x1'));var moment=require(_0xf44a('0x2'));var BPromise=require(_0xf44a('0x3'));var rp=require(_0xf44a('0x4'));var fs=require('fs');var path=require(_0xf44a('0x5'));var rimraf=require('rimraf');var config=require(_0xf44a('0x6'));var attributes=require(_0xf44a('0x7'));var integrations=require(_0xf44a('0x8'));module[_0xf44a('0x9')]=function(_0x544388,_0x38c550){return _0x544388[_0xf44a('0xa')](_0xf44a('0xb'),attributes,{'tableName':_0xf44a('0xc'),'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 5e7500a..cd5a36c 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 _0x6926=['stringify','error','code','message','result','catch','GetSalesforceAccount','findAll','options','where','attributes','limit','include','map','model','ShowSalesforceAccount','SalesforceAccount','find','debug','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x6926,0xbd));var _0x6692=function(_0x10fe7f,_0x12b463){_0x10fe7f=_0x10fe7f-0x0;var _0xc5633b=_0x6926[_0x10fe7f];return _0xc5633b;};'use strict';var _=require(_0x6692('0x0'));var util=require(_0x6692('0x1'));var moment=require('moment');var BPromise=require(_0x6692('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6692('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6692('0x4'));var logger=require(_0x6692('0x5'))(_0x6692('0x6'));var config=require('../../config/environment');var jayson=require(_0x6692('0x7'));var client=jayson[_0x6692('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x478342,_0x3a3583,_0x177bac){return new BPromise(function(_0x3e92f7,_0x117063){return client[_0x6692('0x9')](_0x478342,_0x177bac)[_0x6692('0xa')](function(_0x58246f){logger[_0x6692('0xb')](_0x6692('0xc'),_0x3a3583,_0x6692('0xd'));logger['debug'](_0x6692('0xe'),_0x3a3583,_0x6692('0xd'),JSON[_0x6692('0xf')](_0x58246f));if(_0x58246f[_0x6692('0x10')]){if(_0x58246f[_0x6692('0x10')][_0x6692('0x11')]===0x1f4){logger[_0x6692('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x3a3583,_0x58246f[_0x6692('0x10')][_0x6692('0x12')]);return _0x117063(_0x58246f[_0x6692('0x10')][_0x6692('0x12')]);}logger[_0x6692('0x10')](_0x6692('0xc'),_0x3a3583,_0x58246f['error'][_0x6692('0x12')]);return _0x3e92f7(_0x58246f[_0x6692('0x10')]['message']);}else{logger[_0x6692('0xb')](_0x6692('0xc'),_0x3a3583,_0x6692('0xd'));_0x3e92f7(_0x58246f[_0x6692('0x13')]['message']);}})[_0x6692('0x14')](function(_0x5157be){logger[_0x6692('0x10')](_0x6692('0xc'),_0x3a3583,_0x5157be);_0x117063(_0x5157be);});});}exports[_0x6692('0x15')]=function(_0x21d8f4){var _0x2c536f=this;return new Promise(function(_0x295954,_0x37c060){return db['SalesforceAccount'][_0x6692('0x16')]({'raw':_0x21d8f4[_0x6692('0x17')]?_0x21d8f4[_0x6692('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x21d8f4[_0x6692('0x17')]?_0x21d8f4[_0x6692('0x17')][_0x6692('0x18')]||null:null,'attributes':_0x21d8f4[_0x6692('0x17')]?_0x21d8f4[_0x6692('0x17')][_0x6692('0x19')]||null:null,'limit':_0x21d8f4[_0x6692('0x17')]?_0x21d8f4[_0x6692('0x17')][_0x6692('0x1a')]||null:null,'include':_0x21d8f4[_0x6692('0x17')]?_0x21d8f4['options'][_0x6692('0x1b')]?_[_0x6692('0x1c')](_0x21d8f4['options'][_0x6692('0x1b')],function(_0x1717e5){return{'model':db[_0x1717e5[_0x6692('0x1d')]],'as':_0x1717e5['as'],'attributes':_0x1717e5['attributes'],'include':_0x1717e5['include']?_[_0x6692('0x1c')](_0x1717e5['include'],function(_0x118a60){return{'model':db[_0x118a60[_0x6692('0x1d')]],'as':_0x118a60['as'],'attributes':_0x118a60[_0x6692('0x19')],'include':_0x118a60['include']?_['map'](_0x118a60[_0x6692('0x1b')],function(_0x5afa56){return{'model':db[_0x5afa56[_0x6692('0x1d')]],'as':_0x5afa56['as'],'attributes':_0x5afa56[_0x6692('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6692('0xa')](function(_0x48bc0d){logger[_0x6692('0xb')](_0x6692('0x15'),_0x21d8f4);logger['debug'](_0x6692('0x15'),_0x21d8f4,JSON[_0x6692('0xf')](_0x48bc0d));_0x295954(_0x48bc0d);})['catch'](function(_0x1b0c14){logger[_0x6692('0x10')](_0x6692('0x15'),_0x1b0c14['message'],_0x21d8f4);_0x37c060(_0x2c536f[_0x6692('0x10')](0x1f4,_0x1b0c14['message']));});});};exports[_0x6692('0x1e')]=function(_0x851f3c){var _0x236df4=this;return new Promise(function(_0x26db08,_0xf969fd){return db[_0x6692('0x1f')][_0x6692('0x20')]({'raw':_0x851f3c['options']?_0x851f3c[_0x6692('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x851f3c[_0x6692('0x17')]?_0x851f3c[_0x6692('0x17')][_0x6692('0x18')]||null:null,'attributes':_0x851f3c[_0x6692('0x17')]?_0x851f3c['options'][_0x6692('0x19')]||null:null,'include':_0x851f3c[_0x6692('0x17')]?_0x851f3c[_0x6692('0x17')][_0x6692('0x1b')]?_[_0x6692('0x1c')](_0x851f3c[_0x6692('0x17')]['include'],function(_0x35c307){return{'model':db[_0x35c307[_0x6692('0x1d')]],'as':_0x35c307['as'],'attributes':_0x35c307[_0x6692('0x19')],'include':_0x35c307[_0x6692('0x1b')]?_['map'](_0x35c307['include'],function(_0x57ad44){return{'model':db[_0x57ad44[_0x6692('0x1d')]],'as':_0x57ad44['as'],'attributes':_0x57ad44[_0x6692('0x19')],'include':_0x57ad44[_0x6692('0x1b')]?_['map'](_0x57ad44['include'],function(_0x181740){return{'model':db[_0x181740[_0x6692('0x1d')]],'as':_0x181740['as'],'attributes':_0x181740[_0x6692('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f82a2){logger[_0x6692('0xb')](_0x6692('0x1e'),_0x851f3c);logger[_0x6692('0x21')](_0x6692('0x1e'),_0x851f3c,JSON['stringify'](_0x4f82a2));_0x26db08(_0x4f82a2);})[_0x6692('0x14')](function(_0x3f0b50){logger[_0x6692('0x10')]('ShowSalesforceAccount',_0x3f0b50[_0x6692('0x12')],_0x851f3c);_0xf969fd(_0x236df4['error'](0x1f4,_0x3f0b50[_0x6692('0x12')]));});});}; \ No newline at end of file +var _0x1b03=['SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SalesforceAccount,\x20%s,\x20%s','debug'];(function(_0xb093,_0x5403c4){var _0x516bac=function(_0x4564cb){while(--_0x4564cb){_0xb093['push'](_0xb093['shift']());}};_0x516bac(++_0x5403c4);}(_0x1b03,0x191));var _0x31b0=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1b03[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x31b0('0x0'));var util=require(_0x31b0('0x1'));var moment=require(_0x31b0('0x2'));var BPromise=require(_0x31b0('0x3'));var rs=require(_0x31b0('0x4'));var fs=require('fs');var Redis=require(_0x31b0('0x5'));var db=require(_0x31b0('0x6'))['db'];var utils=require(_0x31b0('0x7'));var logger=require(_0x31b0('0x8'))(_0x31b0('0x9'));var config=require(_0x31b0('0xa'));var jayson=require(_0x31b0('0xb'));var client=jayson[_0x31b0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x257e68,_0x4a05d6,_0x1c2689){return new BPromise(function(_0x57c4e7,_0x37f30a){return client[_0x31b0('0xd')](_0x257e68,_0x1c2689)[_0x31b0('0xe')](function(_0x5c1be2){logger['info'](_0x31b0('0xf'),_0x4a05d6,'request\x20sent');logger[_0x31b0('0x10')](_0x31b0('0x11'),_0x4a05d6,_0x31b0('0x12'),JSON[_0x31b0('0x13')](_0x5c1be2));if(_0x5c1be2[_0x31b0('0x14')]){if(_0x5c1be2[_0x31b0('0x14')][_0x31b0('0x15')]===0x1f4){logger[_0x31b0('0x14')](_0x31b0('0xf'),_0x4a05d6,_0x5c1be2[_0x31b0('0x14')][_0x31b0('0x16')]);return _0x37f30a(_0x5c1be2[_0x31b0('0x14')][_0x31b0('0x16')]);}logger['error'](_0x31b0('0xf'),_0x4a05d6,_0x5c1be2['error'][_0x31b0('0x16')]);return _0x57c4e7(_0x5c1be2['error'][_0x31b0('0x16')]);}else{logger[_0x31b0('0x17')](_0x31b0('0xf'),_0x4a05d6,_0x31b0('0x12'));_0x57c4e7(_0x5c1be2[_0x31b0('0x18')][_0x31b0('0x16')]);}})[_0x31b0('0x19')](function(_0x421d80){logger[_0x31b0('0x14')](_0x31b0('0xf'),_0x4a05d6,_0x421d80);_0x37f30a(_0x421d80);});});}exports[_0x31b0('0x1a')]=function(_0x1e2814){var _0x47ad16=this;return new Promise(function(_0x1f20fc,_0x14edcd){return db[_0x31b0('0x1b')][_0x31b0('0x1c')]({'raw':_0x1e2814['options']?_0x1e2814[_0x31b0('0x1d')][_0x31b0('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e2814[_0x31b0('0x1d')]?_0x1e2814[_0x31b0('0x1d')][_0x31b0('0x1f')]||null:null,'attributes':_0x1e2814[_0x31b0('0x1d')]?_0x1e2814['options'][_0x31b0('0x20')]||null:null,'limit':_0x1e2814[_0x31b0('0x1d')]?_0x1e2814[_0x31b0('0x1d')][_0x31b0('0x21')]||null:null,'include':_0x1e2814[_0x31b0('0x1d')]?_0x1e2814[_0x31b0('0x1d')]['include']?_[_0x31b0('0x22')](_0x1e2814[_0x31b0('0x1d')][_0x31b0('0x23')],function(_0x5a6c2d){return{'model':db[_0x5a6c2d['model']],'as':_0x5a6c2d['as'],'attributes':_0x5a6c2d[_0x31b0('0x20')],'include':_0x5a6c2d[_0x31b0('0x23')]?_['map'](_0x5a6c2d[_0x31b0('0x23')],function(_0x5b915e){return{'model':db[_0x5b915e[_0x31b0('0x24')]],'as':_0x5b915e['as'],'attributes':_0x5b915e[_0x31b0('0x20')],'include':_0x5b915e[_0x31b0('0x23')]?_[_0x31b0('0x22')](_0x5b915e['include'],function(_0x3c5340){return{'model':db[_0x3c5340[_0x31b0('0x24')]],'as':_0x3c5340['as'],'attributes':_0x3c5340[_0x31b0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x31b0('0xe')](function(_0x1c210e){logger['info'](_0x31b0('0x1a'),_0x1e2814);logger[_0x31b0('0x10')]('GetSalesforceAccount',_0x1e2814,JSON['stringify'](_0x1c210e));_0x1f20fc(_0x1c210e);})[_0x31b0('0x19')](function(_0x530681){logger[_0x31b0('0x14')](_0x31b0('0x1a'),_0x530681['message'],_0x1e2814);_0x14edcd(_0x47ad16[_0x31b0('0x14')](0x1f4,_0x530681[_0x31b0('0x16')]));});});};exports[_0x31b0('0x25')]=function(_0x124f80){var _0x191aac=this;return new Promise(function(_0x2f384a,_0x2496cc){return db['SalesforceAccount']['find']({'raw':_0x124f80['options']?_0x124f80[_0x31b0('0x1d')][_0x31b0('0x1e')]===undefined?!![]:![]:!![],'where':_0x124f80[_0x31b0('0x1d')]?_0x124f80['options']['where']||null:null,'attributes':_0x124f80[_0x31b0('0x1d')]?_0x124f80[_0x31b0('0x1d')][_0x31b0('0x20')]||null:null,'include':_0x124f80[_0x31b0('0x1d')]?_0x124f80[_0x31b0('0x1d')][_0x31b0('0x23')]?_[_0x31b0('0x22')](_0x124f80[_0x31b0('0x1d')][_0x31b0('0x23')],function(_0x307e0f){return{'model':db[_0x307e0f[_0x31b0('0x24')]],'as':_0x307e0f['as'],'attributes':_0x307e0f['attributes'],'include':_0x307e0f[_0x31b0('0x23')]?_['map'](_0x307e0f['include'],function(_0x20865a){return{'model':db[_0x20865a[_0x31b0('0x24')]],'as':_0x20865a['as'],'attributes':_0x20865a[_0x31b0('0x20')],'include':_0x20865a[_0x31b0('0x23')]?_[_0x31b0('0x22')](_0x20865a[_0x31b0('0x23')],function(_0x3f2f70){return{'model':db[_0x3f2f70['model']],'as':_0x3f2f70['as'],'attributes':_0x3f2f70[_0x31b0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x31b0('0xe')](function(_0x164697){logger[_0x31b0('0x17')](_0x31b0('0x25'),_0x124f80);logger['debug'](_0x31b0('0x25'),_0x124f80,JSON[_0x31b0('0x13')](_0x164697));_0x2f384a(_0x164697);})[_0x31b0('0x19')](function(_0xe373ec){logger[_0x31b0('0x14')](_0x31b0('0x25'),_0xe373ec[_0x31b0('0x16')],_0x124f80);_0x2496cc(_0x191aac[_0x31b0('0x14')](0x1f4,_0xe373ec[_0x31b0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index efc252e..57561a1 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xdb28,0x106));var _0x8db2=function(_0x5709a2,_0x26fbe){_0x5709a2=_0x5709a2-0x0;var _0x2f9dc2=_0xdb28[_0x5709a2];return _0x2f9dc2;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x1fd841,_0x5b6a0b){var _0x1462d0=function(_0x54a212){while(--_0x54a212){_0x1fd841['push'](_0x1fd841['shift']());}};_0x1462d0(++_0x5b6a0b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index eed9486..62c2209 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 _0xeed2=['lead','sequelize','STRING','Task','Case','contact_lead','account','ENUM','nothing','contact'];(function(_0x14eaea,_0x51be3e){var _0x353392=function(_0x46788e){while(--_0x46788e){_0x14eaea['push'](_0x14eaea['shift']());}};_0x353392(++_0x51be3e);}(_0xeed2,0xd3));var _0x2eed=function(_0x37cf36,_0x3270e3){_0x37cf36=_0x37cf36-0x0;var _0x315e19=_0xeed2[_0x37cf36];return _0x315e19;};'use strict';var Sequelize=require(_0x2eed('0x0'));module['exports']={'name':{'type':Sequelize[_0x2eed('0x1')]},'description':{'type':Sequelize[_0x2eed('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x2eed('0x2'),_0x2eed('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x2eed('0x4'),'contact','lead','account_contact_lead',_0x2eed('0x5')),'defaultValue':_0x2eed('0x4')},'moduleCreate':{'type':Sequelize[_0x2eed('0x6')](_0x2eed('0x7'),_0x2eed('0x8'),_0x2eed('0x9'),_0x2eed('0x5')),'defaultValue':_0x2eed('0x9')},'leadId':{'type':Sequelize[_0x2eed('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x2eed('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x2eed('0x1')]}}; \ No newline at end of file +var _0x98a1=['sequelize','STRING','Task','ENUM','contact_lead','lead','account_contact_lead','account','nothing','contact'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x98a1,0x10e));var _0x198a=function(_0x3c9157,_0x3e6f77){_0x3c9157=_0x3c9157-0x0;var _0x5a1a4c=_0x98a1[_0x3c9157];return _0x5a1a4c;};'use strict';var Sequelize=require(_0x198a('0x0'));module['exports']={'name':{'type':Sequelize[_0x198a('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x198a('0x2'),'Case'),'defaultValue':_0x198a('0x2')},'moduleSearch':{'type':Sequelize[_0x198a('0x3')](_0x198a('0x4'),'contact',_0x198a('0x5'),_0x198a('0x6'),_0x198a('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x198a('0x8'),_0x198a('0x9'),_0x198a('0x5'),_0x198a('0x7')),'defaultValue':_0x198a('0x5')},'leadId':{'type':Sequelize[_0x198a('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x198a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 8e0145c..9abeb9a 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 _0xb475=['fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','getFields','findOne','SalesforceField','length','getSubjects','rawAttributes','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes'];(function(_0x56321f,_0x1c41eb){var _0x5aa129=function(_0x5cab95){while(--_0x5cab95){_0x56321f['push'](_0x56321f['shift']());}};_0x5aa129(++_0x1c41eb);}(_0xb475,0xc7));var _0x5b47=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0xb475[_0x277107];return _0x1da046;};'use strict';var emlformat=require(_0x5b47('0x0'));var rimraf=require(_0x5b47('0x1'));var zipdir=require(_0x5b47('0x2'));var jsonpatch=require(_0x5b47('0x3'));var rp=require(_0x5b47('0x4'));var moment=require(_0x5b47('0x5'));var BPromise=require(_0x5b47('0x6'));var Mustache=require(_0x5b47('0x7'));var util=require(_0x5b47('0x8'));var path=require(_0x5b47('0x9'));var sox=require(_0x5b47('0xa'));var csv=require(_0x5b47('0xb'));var ejs=require(_0x5b47('0xc'));var fs=require('fs');var fs_extra=require(_0x5b47('0xd'));var _=require(_0x5b47('0xe'));var squel=require('squel');var crypto=require(_0x5b47('0xf'));var jsforce=require(_0x5b47('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b47('0x11'));var Papa=require(_0x5b47('0x12'));var Redis=require('ioredis');var authService=require(_0x5b47('0x13'));var qs=require(_0x5b47('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b47('0x15'));var logger=require('../../config/logger')(_0x5b47('0x16'));var utils=require(_0x5b47('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5b47('0x18'))['db'];function respondWithStatusCode(_0x3908ba,_0x4833f9){_0x4833f9=_0x4833f9||0xcc;return function(_0x33450d){if(_0x33450d){return _0x3908ba[_0x5b47('0x19')](_0x4833f9);}return _0x3908ba[_0x5b47('0x1a')](_0x4833f9)[_0x5b47('0x1b')]();};}function respondWithResult(_0x12c2e1,_0x380f88){_0x380f88=_0x380f88||0xc8;return function(_0xdcf946){if(_0xdcf946){return _0x12c2e1[_0x5b47('0x1a')](_0x380f88)[_0x5b47('0x1c')](_0xdcf946);}};}function respondWithFilteredResult(_0x5c716a,_0x10cf09){return function(_0x253504){if(_0x253504){var _0x1a148f=typeof _0x10cf09['offset']===_0x5b47('0x1d')&&typeof _0x10cf09[_0x5b47('0x1e')]===_0x5b47('0x1d');var _0x3f31f6=_0x253504['count'];var _0x3c5395=_0x1a148f?0x0:_0x10cf09[_0x5b47('0x1f')];var _0x48f688=_0x1a148f?_0x253504[_0x5b47('0x20')]:_0x10cf09[_0x5b47('0x1f')]+_0x10cf09[_0x5b47('0x1e')];var _0x546aad;if(_0x48f688>=_0x3f31f6){_0x48f688=_0x3f31f6;_0x546aad=0xc8;}else{_0x546aad=0xce;}_0x5c716a['status'](_0x546aad);return _0x5c716a[_0x5b47('0x21')](_0x5b47('0x22'),_0x3c5395+'-'+_0x48f688+'/'+_0x3f31f6)[_0x5b47('0x1c')](_0x253504);}return null;};}function patchUpdates(_0x53a5ee){return function(_0xec3716){try{jsonpatch[_0x5b47('0x23')](_0xec3716,_0x53a5ee,!![]);}catch(_0x55d1b0){return BPromise[_0x5b47('0x24')](_0x55d1b0);}return _0xec3716[_0x5b47('0x25')]();};}function saveUpdates(_0x2df581,_0x479315){return function(_0x25b3d8){if(_0x25b3d8){return _0x25b3d8[_0x5b47('0x26')](_0x2df581)[_0x5b47('0x27')](function(_0x2875d3){return _0x2875d3;});}return null;};}function removeEntity(_0x48b61b,_0x592b19){return function(_0x3704fe){if(_0x3704fe){return _0x3704fe[_0x5b47('0x28')]()['then'](function(){_0x48b61b[_0x5b47('0x1a')](0xcc)[_0x5b47('0x1b')]();});}};}function handleEntityNotFound(_0xec2277,_0x3f8ee1){return function(_0x17389e){if(!_0x17389e){_0xec2277[_0x5b47('0x19')](0x194);}return _0x17389e;};}function handleError(_0x8e1dca,_0x2bae52){_0x2bae52=_0x2bae52||0x1f4;return function(_0x37a881){logger['error'](_0x37a881[_0x5b47('0x29')]);if(_0x37a881[_0x5b47('0x2a')]){delete _0x37a881['name'];}_0x8e1dca[_0x5b47('0x1a')](_0x2bae52)[_0x5b47('0x2b')](_0x37a881);};}exports[_0x5b47('0x2c')]=function(_0x367221,_0x541c1){var _0xf0f501={},_0x5bedfe={},_0x51bcce={'count':0x0,'rows':[]};var _0x248a82=_[_0x5b47('0x2d')](db['SalesforceConfiguration']['rawAttributes'],function(_0x32912b){return{'name':_0x32912b[_0x5b47('0x2e')],'type':_0x32912b[_0x5b47('0x2f')][_0x5b47('0x30')]};});_0x5bedfe[_0x5b47('0x31')]=_['map'](_0x248a82,_0x5b47('0x2a'));_0x5bedfe[_0x5b47('0x32')]=_['keys'](_0x367221['query']);_0x5bedfe['filters']=_[_0x5b47('0x33')](_0x5bedfe[_0x5b47('0x31')],_0x5bedfe[_0x5b47('0x32')]);_0xf0f501[_0x5b47('0x34')]=_[_0x5b47('0x33')](_0x5bedfe[_0x5b47('0x31')],qs['fields'](_0x367221[_0x5b47('0x32')][_0x5b47('0x35')]));_0xf0f501['attributes']=_0xf0f501[_0x5b47('0x34')]['length']?_0xf0f501[_0x5b47('0x34')]:_0x5bedfe[_0x5b47('0x31')];if(!_0x367221[_0x5b47('0x32')][_0x5b47('0x36')](_0x5b47('0x37'))){_0xf0f501[_0x5b47('0x1e')]=qs['limit'](_0x367221[_0x5b47('0x32')]['limit']);_0xf0f501['offset']=qs[_0x5b47('0x1f')](_0x367221[_0x5b47('0x32')][_0x5b47('0x1f')]);}_0xf0f501[_0x5b47('0x38')]=qs[_0x5b47('0x39')](_0x367221[_0x5b47('0x32')]['sort']);_0xf0f501[_0x5b47('0x3a')]=qs[_0x5b47('0x3b')](_[_0x5b47('0x3c')](_0x367221['query'],_0x5bedfe['filters']),_0x248a82);if(_0x367221['query'][_0x5b47('0x3d')]){_0xf0f501[_0x5b47('0x3a')]=_[_0x5b47('0x3e')](_0xf0f501[_0x5b47('0x3a')],{'$or':_[_0x5b47('0x2d')](_0x248a82,function(_0x3b3c9a){if(_0x3b3c9a['type']!==_0x5b47('0x3f')){var _0x251b03={};_0x251b03[_0x3b3c9a[_0x5b47('0x2a')]]={'$like':'%'+_0x367221['query'][_0x5b47('0x3d')]+'%'};return _0x251b03;}})});}_0xf0f501=_['merge']({},_0xf0f501,_0x367221['options']);var _0x12babf={'where':_0xf0f501[_0x5b47('0x3a')]};return db[_0x5b47('0x40')][_0x5b47('0x20')](_0x12babf)[_0x5b47('0x27')](function(_0x2f8b40){_0x51bcce[_0x5b47('0x20')]=_0x2f8b40;if(_0x367221['query'][_0x5b47('0x41')]){_0xf0f501[_0x5b47('0x42')]=[{'all':!![]}];}return db[_0x5b47('0x40')][_0x5b47('0x43')](_0xf0f501);})[_0x5b47('0x27')](function(_0x141fd2){_0x51bcce[_0x5b47('0x44')]=_0x141fd2;return _0x51bcce;})[_0x5b47('0x27')](respondWithFilteredResult(_0x541c1,_0xf0f501))[_0x5b47('0x45')](handleError(_0x541c1,null));};exports[_0x5b47('0x46')]=function(_0x53d0db,_0x2f83d6){var _0xc1f82c={'raw':![],'where':{'id':_0x53d0db[_0x5b47('0x47')]['id']}},_0x1a909={};_0x1a909['model']=_[_0x5b47('0x48')](db[_0x5b47('0x40')]['rawAttributes']);_0x1a909[_0x5b47('0x32')]=_[_0x5b47('0x48')](_0x53d0db[_0x5b47('0x32')]);_0x1a909['filters']=_[_0x5b47('0x33')](_0x1a909[_0x5b47('0x31')],_0x1a909[_0x5b47('0x32')]);_0xc1f82c['attributes']=_[_0x5b47('0x33')](_0x1a909[_0x5b47('0x31')],qs[_0x5b47('0x35')](_0x53d0db['query'][_0x5b47('0x35')]));_0xc1f82c['attributes']=_0xc1f82c['attributes']['length']?_0xc1f82c[_0x5b47('0x34')]:_0x1a909[_0x5b47('0x31')];if(_0x53d0db[_0x5b47('0x32')][_0x5b47('0x41')]){_0xc1f82c[_0x5b47('0x42')]=[{'all':!![]}];}_0xc1f82c=_[_0x5b47('0x3e')]({},_0xc1f82c,_0x53d0db[_0x5b47('0x49')]);return db[_0x5b47('0x40')][_0x5b47('0x4a')](_0xc1f82c)[_0x5b47('0x27')](handleEntityNotFound(_0x2f83d6,null))['then'](respondWithResult(_0x2f83d6,null))[_0x5b47('0x45')](handleError(_0x2f83d6,null));};exports[_0x5b47('0x4b')]=function(_0x4a09df,_0x3738b1){return db['SalesforceConfiguration'][_0x5b47('0x4b')](_0x4a09df[_0x5b47('0x4c')],{})['then'](respondWithResult(_0x3738b1,0xc9))[_0x5b47('0x45')](handleError(_0x3738b1,null));};exports[_0x5b47('0x26')]=function(_0x4d32d2,_0x23cccd){if(_0x4d32d2[_0x5b47('0x4c')]['id']){delete _0x4d32d2['body']['id'];}return db[_0x5b47('0x40')][_0x5b47('0x4a')]({'where':{'id':_0x4d32d2[_0x5b47('0x47')]['id']}})[_0x5b47('0x27')](handleEntityNotFound(_0x23cccd,null))[_0x5b47('0x27')](saveUpdates(_0x4d32d2[_0x5b47('0x4c')],null))[_0x5b47('0x27')](respondWithResult(_0x23cccd,null))[_0x5b47('0x45')](handleError(_0x23cccd,null));};exports[_0x5b47('0x28')]=function(_0x19fcf1,_0x576453){return db[_0x5b47('0x40')][_0x5b47('0x4a')]({'where':{'id':_0x19fcf1[_0x5b47('0x47')]['id']}})[_0x5b47('0x27')](handleEntityNotFound(_0x576453,null))[_0x5b47('0x27')](removeEntity(_0x576453,null))[_0x5b47('0x45')](handleError(_0x576453,null));};exports[_0x5b47('0x4d')]=function(_0x3508c5,_0x28fcfd,_0x15951f){var _0x33f049={};var _0x29be7f={};var _0x3deb20;var _0x44c684;return db[_0x5b47('0x40')][_0x5b47('0x4e')]({'where':{'id':_0x3508c5[_0x5b47('0x47')]['id']}})[_0x5b47('0x27')](handleEntityNotFound(_0x28fcfd,null))[_0x5b47('0x27')](function(_0x2d4348){if(_0x2d4348){_0x3deb20=_0x2d4348;_0x29be7f[_0x5b47('0x31')]=_[_0x5b47('0x48')](db[_0x5b47('0x4f')]['rawAttributes']);_0x29be7f['query']=_[_0x5b47('0x48')](_0x3508c5[_0x5b47('0x32')]);_0x29be7f[_0x5b47('0x3b')]=_[_0x5b47('0x33')](_0x29be7f[_0x5b47('0x31')],_0x29be7f['query']);_0x33f049[_0x5b47('0x34')]=_[_0x5b47('0x33')](_0x29be7f['model'],qs[_0x5b47('0x35')](_0x3508c5[_0x5b47('0x32')]['fields']));_0x33f049['attributes']=_0x33f049['attributes'][_0x5b47('0x50')]?_0x33f049['attributes']:_0x29be7f[_0x5b47('0x31')];_0x33f049[_0x5b47('0x38')]=qs['sort'](_0x3508c5[_0x5b47('0x32')][_0x5b47('0x39')]);_0x33f049[_0x5b47('0x3a')]=qs[_0x5b47('0x3b')](_[_0x5b47('0x3c')](_0x3508c5[_0x5b47('0x32')],_0x29be7f[_0x5b47('0x3b')]));if(_0x3508c5[_0x5b47('0x32')]['filter']){_0x33f049[_0x5b47('0x3a')]=_[_0x5b47('0x3e')](_0x33f049['where'],{'$or':_[_0x5b47('0x2d')](_0x33f049[_0x5b47('0x34')],function(_0x131363){var _0x1d3fe9={};_0x1d3fe9[_0x131363]={'$like':'%'+_0x3508c5[_0x5b47('0x32')]['filter']+'%'};return _0x1d3fe9;})});}_0x33f049=_[_0x5b47('0x3e')]({},_0x33f049,_0x3508c5[_0x5b47('0x49')]);return _0x3deb20[_0x5b47('0x4d')](_0x33f049);}})[_0x5b47('0x27')](function(_0xf0b020){if(_0xf0b020){_0x44c684=_0xf0b020[_0x5b47('0x50')];if(!_0x3508c5[_0x5b47('0x32')]['hasOwnProperty'](_0x5b47('0x37'))){_0x33f049[_0x5b47('0x1e')]=qs[_0x5b47('0x1e')](_0x3508c5[_0x5b47('0x32')][_0x5b47('0x1e')]);_0x33f049[_0x5b47('0x1f')]=qs[_0x5b47('0x1f')](_0x3508c5[_0x5b47('0x32')][_0x5b47('0x1f')]);}return _0x3deb20[_0x5b47('0x4d')](_0x33f049);}})[_0x5b47('0x27')](function(_0x5d445f){if(_0x5d445f){return _0x5d445f?{'count':_0x44c684,'rows':_0x5d445f}:null;}})['then'](respondWithResult(_0x28fcfd,null))[_0x5b47('0x45')](handleError(_0x28fcfd,null));};exports[_0x5b47('0x51')]=function(_0x1d7a88,_0x472703,_0x59cf7e){var _0x46e79c={};var _0x5ee63b={};var _0x50e5ff;var _0x4d9876;return db[_0x5b47('0x40')][_0x5b47('0x4e')]({'where':{'id':_0x1d7a88[_0x5b47('0x47')]['id']}})[_0x5b47('0x27')](handleEntityNotFound(_0x472703,null))[_0x5b47('0x27')](function(_0x2a1b94){if(_0x2a1b94){_0x50e5ff=_0x2a1b94;_0x5ee63b['model']=_[_0x5b47('0x48')](db['SalesforceField'][_0x5b47('0x52')]);_0x5ee63b[_0x5b47('0x32')]=_[_0x5b47('0x48')](_0x1d7a88[_0x5b47('0x32')]);_0x5ee63b[_0x5b47('0x3b')]=_[_0x5b47('0x33')](_0x5ee63b[_0x5b47('0x31')],_0x5ee63b['query']);_0x46e79c[_0x5b47('0x34')]=_['intersection'](_0x5ee63b[_0x5b47('0x31')],qs[_0x5b47('0x35')](_0x1d7a88[_0x5b47('0x32')][_0x5b47('0x35')]));_0x46e79c['attributes']=_0x46e79c[_0x5b47('0x34')][_0x5b47('0x50')]?_0x46e79c[_0x5b47('0x34')]:_0x5ee63b[_0x5b47('0x31')];_0x46e79c['order']=qs[_0x5b47('0x39')](_0x1d7a88['query'][_0x5b47('0x39')]);_0x46e79c[_0x5b47('0x3a')]=qs['filters'](_[_0x5b47('0x3c')](_0x1d7a88['query'],_0x5ee63b[_0x5b47('0x3b')]));if(_0x1d7a88[_0x5b47('0x32')]['filter']){_0x46e79c[_0x5b47('0x3a')]=_[_0x5b47('0x3e')](_0x46e79c[_0x5b47('0x3a')],{'$or':_[_0x5b47('0x2d')](_0x46e79c['attributes'],function(_0x453666){var _0x42f7d6={};_0x42f7d6[_0x453666]={'$like':'%'+_0x1d7a88[_0x5b47('0x32')][_0x5b47('0x3d')]+'%'};return _0x42f7d6;})});}_0x46e79c=_[_0x5b47('0x3e')]({},_0x46e79c,_0x1d7a88[_0x5b47('0x49')]);return _0x50e5ff[_0x5b47('0x51')](_0x46e79c);}})[_0x5b47('0x27')](function(_0x3ed759){if(_0x3ed759){_0x4d9876=_0x3ed759[_0x5b47('0x50')];if(!_0x1d7a88[_0x5b47('0x32')][_0x5b47('0x36')](_0x5b47('0x37'))){_0x46e79c[_0x5b47('0x1e')]=qs[_0x5b47('0x1e')](_0x1d7a88[_0x5b47('0x32')][_0x5b47('0x1e')]);_0x46e79c[_0x5b47('0x1f')]=qs[_0x5b47('0x1f')](_0x1d7a88['query'][_0x5b47('0x1f')]);}return _0x50e5ff['getSubjects'](_0x46e79c);}})[_0x5b47('0x27')](function(_0x45f860){if(_0x45f860){return _0x45f860?{'count':_0x4d9876,'rows':_0x45f860}:null;}})[_0x5b47('0x27')](respondWithResult(_0x472703,null))['catch'](handleError(_0x472703,null));};exports[_0x5b47('0x53')]=function(_0x2c6cfc,_0x1f1c61,_0x17c5ec){var _0x900c85={};var _0x3822e0={};var _0x3b3680;var _0x279905;return db[_0x5b47('0x40')][_0x5b47('0x4e')]({'where':{'id':_0x2c6cfc[_0x5b47('0x47')]['id']}})[_0x5b47('0x27')](handleEntityNotFound(_0x1f1c61,null))['then'](function(_0x5dd798){if(_0x5dd798){_0x3b3680=_0x5dd798;_0x3822e0[_0x5b47('0x31')]=_['keys'](db[_0x5b47('0x4f')][_0x5b47('0x52')]);_0x3822e0['query']=_['keys'](_0x2c6cfc[_0x5b47('0x32')]);_0x3822e0[_0x5b47('0x3b')]=_[_0x5b47('0x33')](_0x3822e0['model'],_0x3822e0[_0x5b47('0x32')]);_0x900c85[_0x5b47('0x34')]=_['intersection'](_0x3822e0[_0x5b47('0x31')],qs['fields'](_0x2c6cfc['query'][_0x5b47('0x35')]));_0x900c85[_0x5b47('0x34')]=_0x900c85[_0x5b47('0x34')]['length']?_0x900c85[_0x5b47('0x34')]:_0x3822e0[_0x5b47('0x31')];_0x900c85['order']=qs[_0x5b47('0x39')](_0x2c6cfc[_0x5b47('0x32')][_0x5b47('0x39')]);_0x900c85[_0x5b47('0x3a')]=qs[_0x5b47('0x3b')](_[_0x5b47('0x3c')](_0x2c6cfc['query'],_0x3822e0['filters']));if(_0x2c6cfc['query'][_0x5b47('0x3d')]){_0x900c85[_0x5b47('0x3a')]=_[_0x5b47('0x3e')](_0x900c85[_0x5b47('0x3a')],{'$or':_[_0x5b47('0x2d')](_0x900c85[_0x5b47('0x34')],function(_0x1f2821){var _0x3301d1={};_0x3301d1[_0x1f2821]={'$like':'%'+_0x2c6cfc[_0x5b47('0x32')][_0x5b47('0x3d')]+'%'};return _0x3301d1;})});}_0x900c85=_[_0x5b47('0x3e')]({},_0x900c85,_0x2c6cfc[_0x5b47('0x49')]);return _0x3b3680[_0x5b47('0x53')](_0x900c85);}})['then'](function(_0x2b425c){if(_0x2b425c){_0x279905=_0x2b425c[_0x5b47('0x50')];if(!_0x2c6cfc[_0x5b47('0x32')]['hasOwnProperty']('nolimit')){_0x900c85['limit']=qs['limit'](_0x2c6cfc[_0x5b47('0x32')][_0x5b47('0x1e')]);_0x900c85[_0x5b47('0x1f')]=qs[_0x5b47('0x1f')](_0x2c6cfc['query'][_0x5b47('0x1f')]);}return _0x3b3680[_0x5b47('0x53')](_0x900c85);}})[_0x5b47('0x27')](function(_0x3e06bb){if(_0x3e06bb){return _0x3e06bb?{'count':_0x279905,'rows':_0x3e06bb}:null;}})[_0x5b47('0x27')](respondWithResult(_0x1f1c61,null))['catch'](handleError(_0x1f1c61,null));}; \ No newline at end of file +var _0xb5ec=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','stack','name','index','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','SalesforceConfiguration','findAll','rows','catch','show','find','body','params','getFields','findOne','keys','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x3daad5,_0x452977){var _0x1ee037=function(_0x5671aa){while(--_0x5671aa){_0x3daad5['push'](_0x3daad5['shift']());}};_0x1ee037(++_0x452977);}(_0xb5ec,0x97));var _0xcb5e=function(_0x5ae468,_0x1941c0){_0x5ae468=_0x5ae468-0x0;var _0x5d94d2=_0xb5ec[_0x5ae468];return _0x5d94d2;};'use strict';var emlformat=require(_0xcb5e('0x0'));var rimraf=require(_0xcb5e('0x1'));var zipdir=require(_0xcb5e('0x2'));var jsonpatch=require(_0xcb5e('0x3'));var rp=require('request-promise');var moment=require(_0xcb5e('0x4'));var BPromise=require(_0xcb5e('0x5'));var Mustache=require(_0xcb5e('0x6'));var util=require('util');var path=require(_0xcb5e('0x7'));var sox=require('sox');var csv=require(_0xcb5e('0x8'));var ejs=require(_0xcb5e('0x9'));var fs=require('fs');var fs_extra=require(_0xcb5e('0xa'));var _=require(_0xcb5e('0xb'));var squel=require(_0xcb5e('0xc'));var crypto=require(_0xcb5e('0xd'));var jsforce=require(_0xcb5e('0xe'));var deskjs=require(_0xcb5e('0xf'));var toCsv=require(_0xcb5e('0x8'));var querystring=require(_0xcb5e('0x10'));var Papa=require('papaparse');var Redis=require(_0xcb5e('0x11'));var authService=require(_0xcb5e('0x12'));var qs=require(_0xcb5e('0x13'));var as=require(_0xcb5e('0x14'));var hardwareService=require(_0xcb5e('0x15'));var logger=require(_0xcb5e('0x16'))(_0xcb5e('0x17'));var utils=require(_0xcb5e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcb5e('0x19'));var db=require(_0xcb5e('0x1a'))['db'];function respondWithStatusCode(_0x3ce932,_0x23cd63){_0x23cd63=_0x23cd63||0xcc;return function(_0x820e89){if(_0x820e89){return _0x3ce932[_0xcb5e('0x1b')](_0x23cd63);}return _0x3ce932['status'](_0x23cd63)[_0xcb5e('0x1c')]();};}function respondWithResult(_0x2063e8,_0x522b1b){_0x522b1b=_0x522b1b||0xc8;return function(_0x598a2b){if(_0x598a2b){return _0x2063e8[_0xcb5e('0x1d')](_0x522b1b)[_0xcb5e('0x1e')](_0x598a2b);}};}function respondWithFilteredResult(_0x18002f,_0x369c0e){return function(_0xf8d2d9){if(_0xf8d2d9){var _0x4277b2=typeof _0x369c0e[_0xcb5e('0x1f')]===_0xcb5e('0x20')&&typeof _0x369c0e[_0xcb5e('0x21')]===_0xcb5e('0x20');var _0x4f74ba=_0xf8d2d9[_0xcb5e('0x22')];var _0x5047d9=_0x4277b2?0x0:_0x369c0e['offset'];var _0x22ed81=_0x4277b2?_0xf8d2d9[_0xcb5e('0x22')]:_0x369c0e['offset']+_0x369c0e[_0xcb5e('0x21')];var _0x1e6a89;if(_0x22ed81>=_0x4f74ba){_0x22ed81=_0x4f74ba;_0x1e6a89=0xc8;}else{_0x1e6a89=0xce;}_0x18002f[_0xcb5e('0x1d')](_0x1e6a89);return _0x18002f[_0xcb5e('0x23')](_0xcb5e('0x24'),_0x5047d9+'-'+_0x22ed81+'/'+_0x4f74ba)[_0xcb5e('0x1e')](_0xf8d2d9);}return null;};}function patchUpdates(_0x434596){return function(_0x28d988){try{jsonpatch['apply'](_0x28d988,_0x434596,!![]);}catch(_0x4b2388){return BPromise['reject'](_0x4b2388);}return _0x28d988[_0xcb5e('0x25')]();};}function saveUpdates(_0x279fff,_0x1f85e5){return function(_0x247fc7){if(_0x247fc7){return _0x247fc7[_0xcb5e('0x26')](_0x279fff)['then'](function(_0x2f8a73){return _0x2f8a73;});}return null;};}function removeEntity(_0x10f4b2,_0x126416){return function(_0x22275f){if(_0x22275f){return _0x22275f[_0xcb5e('0x27')]()[_0xcb5e('0x28')](function(){_0x10f4b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de030,_0x2447c5){return function(_0x13f69b){if(!_0x13f69b){_0x2de030[_0xcb5e('0x1b')](0x194);}return _0x13f69b;};}function handleError(_0x201a18,_0x29d35b){_0x29d35b=_0x29d35b||0x1f4;return function(_0x9eeaa9){logger['error'](_0x9eeaa9[_0xcb5e('0x29')]);if(_0x9eeaa9['name']){delete _0x9eeaa9[_0xcb5e('0x2a')];}_0x201a18[_0xcb5e('0x1d')](_0x29d35b)['send'](_0x9eeaa9);};}exports[_0xcb5e('0x2b')]=function(_0x150313,_0x335ae3){var _0x2c28ff={},_0x26135a={},_0x10b9e1={'count':0x0,'rows':[]};var _0x3defc7=_['map'](db['SalesforceConfiguration'][_0xcb5e('0x2c')],function(_0x2f21e5){return{'name':_0x2f21e5[_0xcb5e('0x2d')],'type':_0x2f21e5['type'][_0xcb5e('0x2e')]};});_0x26135a['model']=_['map'](_0x3defc7,_0xcb5e('0x2a'));_0x26135a['query']=_['keys'](_0x150313[_0xcb5e('0x2f')]);_0x26135a[_0xcb5e('0x30')]=_[_0xcb5e('0x31')](_0x26135a[_0xcb5e('0x32')],_0x26135a[_0xcb5e('0x2f')]);_0x2c28ff['attributes']=_[_0xcb5e('0x31')](_0x26135a['model'],qs[_0xcb5e('0x33')](_0x150313[_0xcb5e('0x2f')]['fields']));_0x2c28ff[_0xcb5e('0x34')]=_0x2c28ff['attributes'][_0xcb5e('0x35')]?_0x2c28ff[_0xcb5e('0x34')]:_0x26135a[_0xcb5e('0x32')];if(!_0x150313[_0xcb5e('0x2f')][_0xcb5e('0x36')](_0xcb5e('0x37'))){_0x2c28ff[_0xcb5e('0x21')]=qs[_0xcb5e('0x21')](_0x150313[_0xcb5e('0x2f')][_0xcb5e('0x21')]);_0x2c28ff[_0xcb5e('0x1f')]=qs[_0xcb5e('0x1f')](_0x150313[_0xcb5e('0x2f')][_0xcb5e('0x1f')]);}_0x2c28ff[_0xcb5e('0x38')]=qs[_0xcb5e('0x39')](_0x150313[_0xcb5e('0x2f')][_0xcb5e('0x39')]);_0x2c28ff[_0xcb5e('0x3a')]=qs['filters'](_[_0xcb5e('0x3b')](_0x150313[_0xcb5e('0x2f')],_0x26135a[_0xcb5e('0x30')]),_0x3defc7);if(_0x150313[_0xcb5e('0x2f')][_0xcb5e('0x3c')]){_0x2c28ff[_0xcb5e('0x3a')]=_[_0xcb5e('0x3d')](_0x2c28ff[_0xcb5e('0x3a')],{'$or':_[_0xcb5e('0x3e')](_0x3defc7,function(_0x435f62){if(_0x435f62[_0xcb5e('0x3f')]!==_0xcb5e('0x40')){var _0x2a62d8={};_0x2a62d8[_0x435f62[_0xcb5e('0x2a')]]={'$like':'%'+_0x150313[_0xcb5e('0x2f')]['filter']+'%'};return _0x2a62d8;}})});}_0x2c28ff=_[_0xcb5e('0x3d')]({},_0x2c28ff,_0x150313[_0xcb5e('0x41')]);var _0x3eaa71={'where':_0x2c28ff[_0xcb5e('0x3a')]};return db['SalesforceConfiguration'][_0xcb5e('0x22')](_0x3eaa71)['then'](function(_0x502a8a){_0x10b9e1[_0xcb5e('0x22')]=_0x502a8a;if(_0x150313['query'][_0xcb5e('0x42')]){_0x2c28ff['include']=[{'all':!![]}];}return db[_0xcb5e('0x43')][_0xcb5e('0x44')](_0x2c28ff);})[_0xcb5e('0x28')](function(_0x2f54e){_0x10b9e1[_0xcb5e('0x45')]=_0x2f54e;return _0x10b9e1;})[_0xcb5e('0x28')](respondWithFilteredResult(_0x335ae3,_0x2c28ff))[_0xcb5e('0x46')](handleError(_0x335ae3,null));};exports[_0xcb5e('0x47')]=function(_0x50a50f,_0x21009f){var _0x29e6a4={'raw':![],'where':{'id':_0x50a50f['params']['id']}},_0xa6663b={};_0xa6663b['model']=_['keys'](db[_0xcb5e('0x43')][_0xcb5e('0x2c')]);_0xa6663b[_0xcb5e('0x2f')]=_['keys'](_0x50a50f[_0xcb5e('0x2f')]);_0xa6663b['filters']=_[_0xcb5e('0x31')](_0xa6663b[_0xcb5e('0x32')],_0xa6663b['query']);_0x29e6a4[_0xcb5e('0x34')]=_[_0xcb5e('0x31')](_0xa6663b[_0xcb5e('0x32')],qs[_0xcb5e('0x33')](_0x50a50f[_0xcb5e('0x2f')]['fields']));_0x29e6a4[_0xcb5e('0x34')]=_0x29e6a4['attributes'][_0xcb5e('0x35')]?_0x29e6a4[_0xcb5e('0x34')]:_0xa6663b['model'];if(_0x50a50f[_0xcb5e('0x2f')][_0xcb5e('0x42')]){_0x29e6a4['include']=[{'all':!![]}];}_0x29e6a4=_['merge']({},_0x29e6a4,_0x50a50f[_0xcb5e('0x41')]);return db[_0xcb5e('0x43')][_0xcb5e('0x48')](_0x29e6a4)['then'](handleEntityNotFound(_0x21009f,null))['then'](respondWithResult(_0x21009f,null))[_0xcb5e('0x46')](handleError(_0x21009f,null));};exports['create']=function(_0x538d7e,_0x1c045b){return db[_0xcb5e('0x43')]['create'](_0x538d7e['body'],{})[_0xcb5e('0x28')](respondWithResult(_0x1c045b,0xc9))[_0xcb5e('0x46')](handleError(_0x1c045b,null));};exports[_0xcb5e('0x26')]=function(_0x20c473,_0x4f9389){if(_0x20c473[_0xcb5e('0x49')]['id']){delete _0x20c473[_0xcb5e('0x49')]['id'];}return db[_0xcb5e('0x43')]['find']({'where':{'id':_0x20c473[_0xcb5e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f9389,null))[_0xcb5e('0x28')](saveUpdates(_0x20c473['body'],null))['then'](respondWithResult(_0x4f9389,null))[_0xcb5e('0x46')](handleError(_0x4f9389,null));};exports[_0xcb5e('0x27')]=function(_0x34a9c3,_0x265913){return db[_0xcb5e('0x43')][_0xcb5e('0x48')]({'where':{'id':_0x34a9c3['params']['id']}})[_0xcb5e('0x28')](handleEntityNotFound(_0x265913,null))[_0xcb5e('0x28')](removeEntity(_0x265913,null))['catch'](handleError(_0x265913,null));};exports[_0xcb5e('0x4b')]=function(_0xaa354f,_0x124f9f,_0x1adcd9){var _0x3ce945={};var _0x2a41fc={};var _0xefd644;var _0x1dce68;return db['SalesforceConfiguration'][_0xcb5e('0x4c')]({'where':{'id':_0xaa354f[_0xcb5e('0x4a')]['id']}})[_0xcb5e('0x28')](handleEntityNotFound(_0x124f9f,null))[_0xcb5e('0x28')](function(_0x248428){if(_0x248428){_0xefd644=_0x248428;_0x2a41fc[_0xcb5e('0x32')]=_[_0xcb5e('0x4d')](db[_0xcb5e('0x4e')][_0xcb5e('0x2c')]);_0x2a41fc[_0xcb5e('0x2f')]=_[_0xcb5e('0x4d')](_0xaa354f[_0xcb5e('0x2f')]);_0x2a41fc[_0xcb5e('0x30')]=_['intersection'](_0x2a41fc[_0xcb5e('0x32')],_0x2a41fc[_0xcb5e('0x2f')]);_0x3ce945[_0xcb5e('0x34')]=_[_0xcb5e('0x31')](_0x2a41fc[_0xcb5e('0x32')],qs[_0xcb5e('0x33')](_0xaa354f[_0xcb5e('0x2f')][_0xcb5e('0x33')]));_0x3ce945[_0xcb5e('0x34')]=_0x3ce945[_0xcb5e('0x34')][_0xcb5e('0x35')]?_0x3ce945[_0xcb5e('0x34')]:_0x2a41fc[_0xcb5e('0x32')];_0x3ce945[_0xcb5e('0x38')]=qs['sort'](_0xaa354f['query']['sort']);_0x3ce945[_0xcb5e('0x3a')]=qs['filters'](_[_0xcb5e('0x3b')](_0xaa354f[_0xcb5e('0x2f')],_0x2a41fc[_0xcb5e('0x30')]));if(_0xaa354f[_0xcb5e('0x2f')][_0xcb5e('0x3c')]){_0x3ce945[_0xcb5e('0x3a')]=_['merge'](_0x3ce945['where'],{'$or':_[_0xcb5e('0x3e')](_0x3ce945['attributes'],function(_0x36bee4){var _0x5e8b91={};_0x5e8b91[_0x36bee4]={'$like':'%'+_0xaa354f['query'][_0xcb5e('0x3c')]+'%'};return _0x5e8b91;})});}_0x3ce945=_[_0xcb5e('0x3d')]({},_0x3ce945,_0xaa354f[_0xcb5e('0x41')]);return _0xefd644[_0xcb5e('0x4b')](_0x3ce945);}})['then'](function(_0x5653ad){if(_0x5653ad){_0x1dce68=_0x5653ad[_0xcb5e('0x35')];if(!_0xaa354f['query'][_0xcb5e('0x36')]('nolimit')){_0x3ce945[_0xcb5e('0x21')]=qs['limit'](_0xaa354f[_0xcb5e('0x2f')][_0xcb5e('0x21')]);_0x3ce945[_0xcb5e('0x1f')]=qs[_0xcb5e('0x1f')](_0xaa354f['query'][_0xcb5e('0x1f')]);}return _0xefd644[_0xcb5e('0x4b')](_0x3ce945);}})[_0xcb5e('0x28')](function(_0xbe09a8){if(_0xbe09a8){return _0xbe09a8?{'count':_0x1dce68,'rows':_0xbe09a8}:null;}})['then'](respondWithResult(_0x124f9f,null))[_0xcb5e('0x46')](handleError(_0x124f9f,null));};exports[_0xcb5e('0x4f')]=function(_0x253a57,_0x115aab,_0x21be6f){var _0x137d63={};var _0x482308={};var _0x3a503b;var _0x44a363;return db[_0xcb5e('0x43')][_0xcb5e('0x4c')]({'where':{'id':_0x253a57[_0xcb5e('0x4a')]['id']}})[_0xcb5e('0x28')](handleEntityNotFound(_0x115aab,null))['then'](function(_0x239d9b){if(_0x239d9b){_0x3a503b=_0x239d9b;_0x482308['model']=_[_0xcb5e('0x4d')](db['SalesforceField'][_0xcb5e('0x2c')]);_0x482308[_0xcb5e('0x2f')]=_[_0xcb5e('0x4d')](_0x253a57[_0xcb5e('0x2f')]);_0x482308['filters']=_[_0xcb5e('0x31')](_0x482308[_0xcb5e('0x32')],_0x482308[_0xcb5e('0x2f')]);_0x137d63[_0xcb5e('0x34')]=_[_0xcb5e('0x31')](_0x482308[_0xcb5e('0x32')],qs['fields'](_0x253a57[_0xcb5e('0x2f')][_0xcb5e('0x33')]));_0x137d63[_0xcb5e('0x34')]=_0x137d63[_0xcb5e('0x34')]['length']?_0x137d63[_0xcb5e('0x34')]:_0x482308[_0xcb5e('0x32')];_0x137d63[_0xcb5e('0x38')]=qs[_0xcb5e('0x39')](_0x253a57[_0xcb5e('0x2f')]['sort']);_0x137d63[_0xcb5e('0x3a')]=qs[_0xcb5e('0x30')](_[_0xcb5e('0x3b')](_0x253a57[_0xcb5e('0x2f')],_0x482308[_0xcb5e('0x30')]));if(_0x253a57[_0xcb5e('0x2f')][_0xcb5e('0x3c')]){_0x137d63['where']=_[_0xcb5e('0x3d')](_0x137d63[_0xcb5e('0x3a')],{'$or':_[_0xcb5e('0x3e')](_0x137d63[_0xcb5e('0x34')],function(_0x2a8a87){var _0x2379c7={};_0x2379c7[_0x2a8a87]={'$like':'%'+_0x253a57[_0xcb5e('0x2f')][_0xcb5e('0x3c')]+'%'};return _0x2379c7;})});}_0x137d63=_[_0xcb5e('0x3d')]({},_0x137d63,_0x253a57[_0xcb5e('0x41')]);return _0x3a503b[_0xcb5e('0x4f')](_0x137d63);}})['then'](function(_0x351706){if(_0x351706){_0x44a363=_0x351706[_0xcb5e('0x35')];if(!_0x253a57[_0xcb5e('0x2f')][_0xcb5e('0x36')](_0xcb5e('0x37'))){_0x137d63[_0xcb5e('0x21')]=qs['limit'](_0x253a57[_0xcb5e('0x2f')][_0xcb5e('0x21')]);_0x137d63['offset']=qs['offset'](_0x253a57[_0xcb5e('0x2f')]['offset']);}return _0x3a503b[_0xcb5e('0x4f')](_0x137d63);}})[_0xcb5e('0x28')](function(_0x277a7d){if(_0x277a7d){return _0x277a7d?{'count':_0x44a363,'rows':_0x277a7d}:null;}})[_0xcb5e('0x28')](respondWithResult(_0x115aab,null))[_0xcb5e('0x46')](handleError(_0x115aab,null));};exports[_0xcb5e('0x50')]=function(_0x36cc12,_0x2b8730,_0x1fc331){var _0x189e9b={};var _0x5dffa0={};var _0x24a194;var _0x54ae7f;return db[_0xcb5e('0x43')][_0xcb5e('0x4c')]({'where':{'id':_0x36cc12[_0xcb5e('0x4a')]['id']}})[_0xcb5e('0x28')](handleEntityNotFound(_0x2b8730,null))['then'](function(_0x2de696){if(_0x2de696){_0x24a194=_0x2de696;_0x5dffa0['model']=_[_0xcb5e('0x4d')](db[_0xcb5e('0x4e')][_0xcb5e('0x2c')]);_0x5dffa0[_0xcb5e('0x2f')]=_[_0xcb5e('0x4d')](_0x36cc12['query']);_0x5dffa0['filters']=_['intersection'](_0x5dffa0[_0xcb5e('0x32')],_0x5dffa0[_0xcb5e('0x2f')]);_0x189e9b['attributes']=_[_0xcb5e('0x31')](_0x5dffa0[_0xcb5e('0x32')],qs[_0xcb5e('0x33')](_0x36cc12[_0xcb5e('0x2f')]['fields']));_0x189e9b[_0xcb5e('0x34')]=_0x189e9b['attributes'][_0xcb5e('0x35')]?_0x189e9b[_0xcb5e('0x34')]:_0x5dffa0[_0xcb5e('0x32')];_0x189e9b[_0xcb5e('0x38')]=qs[_0xcb5e('0x39')](_0x36cc12[_0xcb5e('0x2f')][_0xcb5e('0x39')]);_0x189e9b['where']=qs[_0xcb5e('0x30')](_[_0xcb5e('0x3b')](_0x36cc12[_0xcb5e('0x2f')],_0x5dffa0[_0xcb5e('0x30')]));if(_0x36cc12[_0xcb5e('0x2f')][_0xcb5e('0x3c')]){_0x189e9b[_0xcb5e('0x3a')]=_[_0xcb5e('0x3d')](_0x189e9b['where'],{'$or':_[_0xcb5e('0x3e')](_0x189e9b['attributes'],function(_0x5329ed){var _0x22b3d4={};_0x22b3d4[_0x5329ed]={'$like':'%'+_0x36cc12[_0xcb5e('0x2f')][_0xcb5e('0x3c')]+'%'};return _0x22b3d4;})});}_0x189e9b=_[_0xcb5e('0x3d')]({},_0x189e9b,_0x36cc12[_0xcb5e('0x41')]);return _0x24a194[_0xcb5e('0x50')](_0x189e9b);}})[_0xcb5e('0x28')](function(_0x21e800){if(_0x21e800){_0x54ae7f=_0x21e800[_0xcb5e('0x35')];if(!_0x36cc12[_0xcb5e('0x2f')]['hasOwnProperty'](_0xcb5e('0x37'))){_0x189e9b[_0xcb5e('0x21')]=qs['limit'](_0x36cc12[_0xcb5e('0x2f')][_0xcb5e('0x21')]);_0x189e9b[_0xcb5e('0x1f')]=qs[_0xcb5e('0x1f')](_0x36cc12[_0xcb5e('0x2f')][_0xcb5e('0x1f')]);}return _0x24a194[_0xcb5e('0x50')](_0x189e9b);}})['then'](function(_0x1a3081){if(_0x1a3081){return _0x1a3081?{'count':_0x54ae7f,'rows':_0x1a3081}:null;}})[_0xcb5e('0x28')](respondWithResult(_0x2b8730,null))[_0xcb5e('0x46')](handleError(_0x2b8730,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index b5570ca..4bdefc7 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 _0x29a7=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','int_salesforce_configurations','lodash'];(function(_0x4e4f15,_0xc99f54){var _0x2f0a16=function(_0x42067b){while(--_0x42067b){_0x4e4f15['push'](_0x4e4f15['shift']());}};_0x2f0a16(++_0xc99f54);}(_0x29a7,0x1e3));var _0x729a=function(_0xccdde3,_0x4786bb){_0xccdde3=_0xccdde3-0x0;var _0x3e3a29=_0x29a7[_0xccdde3];return _0x3e3a29;};'use strict';var _=require(_0x729a('0x0'));var util=require(_0x729a('0x1'));var logger=require(_0x729a('0x2'))(_0x729a('0x3'));var moment=require('moment');var BPromise=require(_0x729a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x729a('0x5'));var rimraf=require(_0x729a('0x6'));var config=require(_0x729a('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x729a('0x8')]=function(_0x4243b9,_0x4075d0){return _0x4243b9[_0x729a('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0x729a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x163c=['int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration'];(function(_0x196736,_0x1d49b9){var _0x59432a=function(_0x385a1c){while(--_0x385a1c){_0x196736['push'](_0x196736['shift']());}};_0x59432a(++_0x1d49b9);}(_0x163c,0x109));var _0xc163=function(_0x2e8a88,_0x4adf5f){_0x2e8a88=_0x2e8a88-0x0;var _0x2529c9=_0x163c[_0x2e8a88];return _0x2529c9;};'use strict';var _=require(_0xc163('0x0'));var util=require(_0xc163('0x1'));var logger=require(_0xc163('0x2'))(_0xc163('0x3'));var moment=require(_0xc163('0x4'));var BPromise=require(_0xc163('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc163('0x6'));var config=require(_0xc163('0x7'));var attributes=require(_0xc163('0x8'));module[_0xc163('0x9')]=function(_0x291507,_0x5ecb99){return _0x291507['define'](_0xc163('0xa'),attributes,{'tableName':_0xc163('0xb'),'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 8556f61..236dafa 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 _0x3872=['request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x3872,0x1c0));var _0x2387=function(_0x31ff27,_0x2d72ea){_0x31ff27=_0x31ff27-0x0;var _0x45514f=_0x3872[_0x31ff27];return _0x45514f;};'use strict';var _=require('lodash');var util=require(_0x2387('0x0'));var moment=require('moment');var BPromise=require(_0x2387('0x1'));var rs=require(_0x2387('0x2'));var fs=require('fs');var Redis=require(_0x2387('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2387('0x4'));var logger=require(_0x2387('0x5'))(_0x2387('0x6'));var config=require(_0x2387('0x7'));var jayson=require(_0x2387('0x8'));var client=jayson[_0x2387('0x9')][_0x2387('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x583288,_0x599a67,_0x4ca352){return new BPromise(function(_0x5a9aa9,_0xa1fd7f){return client[_0x2387('0xb')](_0x583288,_0x4ca352)['then'](function(_0x35a474){logger[_0x2387('0xc')](_0x2387('0xd'),_0x599a67,_0x2387('0xe'));logger[_0x2387('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x599a67,_0x2387('0xe'),JSON[_0x2387('0x10')](_0x35a474));if(_0x35a474[_0x2387('0x11')]){if(_0x35a474['error'][_0x2387('0x12')]===0x1f4){logger[_0x2387('0x11')](_0x2387('0xd'),_0x599a67,_0x35a474[_0x2387('0x11')]['message']);return _0xa1fd7f(_0x35a474['error'][_0x2387('0x13')]);}logger[_0x2387('0x11')](_0x2387('0xd'),_0x599a67,_0x35a474[_0x2387('0x11')][_0x2387('0x13')]);return _0x5a9aa9(_0x35a474[_0x2387('0x11')][_0x2387('0x13')]);}else{logger['info'](_0x2387('0xd'),_0x599a67,'request\x20sent');_0x5a9aa9(_0x35a474[_0x2387('0x14')]['message']);}})[_0x2387('0x15')](function(_0x1b84bf){logger['error'](_0x2387('0xd'),_0x599a67,_0x1b84bf);_0xa1fd7f(_0x1b84bf);});});} \ No newline at end of file +var _0x7f51=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x4cbff8,_0xe5bce2){var _0x4342be=function(_0x3b60b3){while(--_0x3b60b3){_0x4cbff8['push'](_0x4cbff8['shift']());}};_0x4342be(++_0xe5bce2);}(_0x7f51,0x6a));var _0x17f5=function(_0x161fe2,_0x59e9f6){_0x161fe2=_0x161fe2-0x0;var _0x2a20a8=_0x7f51[_0x161fe2];return _0x2a20a8;};'use strict';var _=require(_0x17f5('0x0'));var util=require(_0x17f5('0x1'));var moment=require(_0x17f5('0x2'));var BPromise=require(_0x17f5('0x3'));var rs=require(_0x17f5('0x4'));var fs=require('fs');var Redis=require(_0x17f5('0x5'));var db=require(_0x17f5('0x6'))['db'];var utils=require(_0x17f5('0x7'));var logger=require('../../config/logger')(_0x17f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x17f5('0x9'));var client=jayson['client'][_0x17f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53d024,_0x38a410,_0x359e61){return new BPromise(function(_0x5e7684,_0x5a9719){return client[_0x17f5('0xb')](_0x53d024,_0x359e61)['then'](function(_0x2bfb5d){logger[_0x17f5('0xc')](_0x17f5('0xd'),_0x38a410,'request\x20sent');logger[_0x17f5('0xe')](_0x17f5('0xf'),_0x38a410,'request\x20sent',JSON[_0x17f5('0x10')](_0x2bfb5d));if(_0x2bfb5d[_0x17f5('0x11')]){if(_0x2bfb5d[_0x17f5('0x11')]['code']===0x1f4){logger[_0x17f5('0x11')](_0x17f5('0xd'),_0x38a410,_0x2bfb5d[_0x17f5('0x11')][_0x17f5('0x12')]);return _0x5a9719(_0x2bfb5d['error'][_0x17f5('0x12')]);}logger[_0x17f5('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x38a410,_0x2bfb5d['error']['message']);return _0x5e7684(_0x2bfb5d['error'][_0x17f5('0x12')]);}else{logger[_0x17f5('0xc')](_0x17f5('0xd'),_0x38a410,_0x17f5('0x13'));_0x5e7684(_0x2bfb5d[_0x17f5('0x14')][_0x17f5('0x12')]);}})[_0x17f5('0x15')](function(_0x4f7f0b){logger[_0x17f5('0x11')](_0x17f5('0xd'),_0x38a410,_0x4f7f0b);_0x5a9719(_0x4f7f0b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 28b5eba..8030edd 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 _0x2950=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xbb78a3,_0x1431a8){var _0x13b93e=function(_0x29e03e){while(--_0x29e03e){_0xbb78a3['push'](_0xbb78a3['shift']());}};_0x13b93e(++_0x1431a8);}(_0x2950,0x1c5));var _0x0295=function(_0x55eec1,_0xfced36){_0x55eec1=_0x55eec1-0x0;var _0x5cadf7=_0x2950[_0x55eec1];return _0x5cadf7;};'use strict';var multer=require(_0x0295('0x0'));var util=require(_0x0295('0x1'));var path=require(_0x0295('0x2'));var timeout=require(_0x0295('0x3'));var express=require(_0x0295('0x4'));var router=express[_0x0295('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0295('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0295('0x7'));var controller=require(_0x0295('0x8'));router[_0x0295('0x9')]('/',auth[_0x0295('0xa')](),controller[_0x0295('0xb')]);router[_0x0295('0x9')]('/:id',auth[_0x0295('0xa')](),controller[_0x0295('0xc')]);router[_0x0295('0xd')]('/',auth[_0x0295('0xa')](),controller[_0x0295('0xe')]);router[_0x0295('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0295('0x10')]);router[_0x0295('0x11')](_0x0295('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x0295('0x13')]=router; \ No newline at end of file +var _0x0ad5=['/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0x0ad5,0x184));var _0x50ad=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0ad5[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x50ad('0x0'));var path=require(_0x50ad('0x1'));var timeout=require(_0x50ad('0x2'));var express=require(_0x50ad('0x3'));var router=express[_0x50ad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x50ad('0x5'));var interaction=require(_0x50ad('0x6'));var config=require('../../config/environment');var controller=require(_0x50ad('0x7'));router['get']('/',auth[_0x50ad('0x8')](),controller[_0x50ad('0x9')]);router[_0x50ad('0xa')](_0x50ad('0xb'),auth[_0x50ad('0x8')](),controller[_0x50ad('0xc')]);router[_0x50ad('0xd')]('/',auth[_0x50ad('0x8')](),controller[_0x50ad('0xe')]);router[_0x50ad('0xf')](_0x50ad('0xb'),auth[_0x50ad('0x8')](),controller[_0x50ad('0x10')]);router[_0x50ad('0x11')]('/:id',auth[_0x50ad('0x8')](),controller[_0x50ad('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 3982be2..3bbb45a 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 _0x0a6f=['STRING','ENUM','string','variable','customVariable','picklist'];(function(_0x44ff3a,_0x46f40d){var _0x333bc1=function(_0x1114aa){while(--_0x1114aa){_0x44ff3a['push'](_0x44ff3a['shift']());}};_0x333bc1(++_0x46f40d);}(_0x0a6f,0x103));var _0xf0a6=function(_0x3cad1a,_0x4a92c5){_0x3cad1a=_0x3cad1a-0x0;var _0x4b768d=_0x0a6f[_0x3cad1a];return _0x4b768d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf0a6('0x0')](_0xf0a6('0x1'),_0xf0a6('0x2'),_0xf0a6('0x3'),'keyValue',_0xf0a6('0x4')),'defaultValue':_0xf0a6('0x1')},'content':{'type':Sequelize[_0xf0a6('0x5')]},'key':{'type':Sequelize[_0xf0a6('0x5')]},'keyType':{'type':Sequelize[_0xf0a6('0x0')](_0xf0a6('0x1'),_0xf0a6('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xf0a6('0x5')]},'idField':{'type':Sequelize[_0xf0a6('0x5')]},'variableName':{'type':Sequelize[_0xf0a6('0x5')]}}; \ No newline at end of file +var _0x560a=['customVariable','keyValue','picklist','string','STRING','ENUM','sequelize','exports','variable'];(function(_0x4f54ac,_0x51930e){var _0x26f0d5=function(_0x2672d3){while(--_0x2672d3){_0x4f54ac['push'](_0x4f54ac['shift']());}};_0x26f0d5(++_0x51930e);}(_0x560a,0xe7));var _0xa560=function(_0x33d427,_0x47c8c2){_0x33d427=_0x33d427-0x0;var _0x383dbd=_0x560a[_0x33d427];return _0x383dbd;};'use strict';var Sequelize=require(_0xa560('0x0'));module[_0xa560('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xa560('0x2'),_0xa560('0x3'),_0xa560('0x4'),_0xa560('0x5')),'defaultValue':_0xa560('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa560('0x7')]},'keyType':{'type':Sequelize[_0xa560('0x8')](_0xa560('0x6'),_0xa560('0x2'),_0xa560('0x3'))},'keyContent':{'type':Sequelize[_0xa560('0x7')]},'idField':{'type':Sequelize[_0xa560('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9766c74..5ed564e 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 _0x9b60=['type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','create','update','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','stack','name','send','map','SalesforceField','fieldName'];(function(_0x2f454b,_0x4f0132){var _0x3077ab=function(_0x4cd985){while(--_0x4cd985){_0x2f454b['push'](_0x2f454b['shift']());}};_0x3077ab(++_0x4f0132);}(_0x9b60,0x104));var _0x09b6=function(_0xa7be52,_0x213bfb){_0xa7be52=_0xa7be52-0x0;var _0x4c52ab=_0x9b60[_0xa7be52];return _0x4c52ab;};'use strict';var emlformat=require(_0x09b6('0x0'));var rimraf=require(_0x09b6('0x1'));var zipdir=require(_0x09b6('0x2'));var jsonpatch=require(_0x09b6('0x3'));var rp=require('request-promise');var moment=require(_0x09b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09b6('0x5'));var util=require('util');var path=require(_0x09b6('0x6'));var sox=require(_0x09b6('0x7'));var csv=require(_0x09b6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09b6('0x9'));var _=require(_0x09b6('0xa'));var squel=require(_0x09b6('0xb'));var crypto=require(_0x09b6('0xc'));var jsforce=require(_0x09b6('0xd'));var deskjs=require(_0x09b6('0xe'));var toCsv=require(_0x09b6('0x8'));var querystring=require(_0x09b6('0xf'));var Papa=require(_0x09b6('0x10'));var Redis=require(_0x09b6('0x11'));var authService=require(_0x09b6('0x12'));var qs=require(_0x09b6('0x13'));var as=require(_0x09b6('0x14'));var hardwareService=require(_0x09b6('0x15'));var logger=require(_0x09b6('0x16'))('api');var utils=require(_0x09b6('0x17'));var config=require(_0x09b6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x09b6('0x19'))['db'];function respondWithStatusCode(_0x5a25aa,_0x55cdb4){_0x55cdb4=_0x55cdb4||0xcc;return function(_0x468779){if(_0x468779){return _0x5a25aa[_0x09b6('0x1a')](_0x55cdb4);}return _0x5a25aa[_0x09b6('0x1b')](_0x55cdb4)[_0x09b6('0x1c')]();};}function respondWithResult(_0x41ed00,_0xf51146){_0xf51146=_0xf51146||0xc8;return function(_0x77fd90){if(_0x77fd90){return _0x41ed00[_0x09b6('0x1b')](_0xf51146)['json'](_0x77fd90);}};}function respondWithFilteredResult(_0x394bf7,_0x1924ea){return function(_0x149939){if(_0x149939){var _0x90b401=typeof _0x1924ea[_0x09b6('0x1d')]===_0x09b6('0x1e')&&typeof _0x1924ea[_0x09b6('0x1f')]===_0x09b6('0x1e');var _0x573d05=_0x149939[_0x09b6('0x20')];var _0x57a873=_0x90b401?0x0:_0x1924ea[_0x09b6('0x1d')];var _0x277b79=_0x90b401?_0x149939['count']:_0x1924ea[_0x09b6('0x1d')]+_0x1924ea[_0x09b6('0x1f')];var _0x41a109;if(_0x277b79>=_0x573d05){_0x277b79=_0x573d05;_0x41a109=0xc8;}else{_0x41a109=0xce;}_0x394bf7[_0x09b6('0x1b')](_0x41a109);return _0x394bf7['set'](_0x09b6('0x21'),_0x57a873+'-'+_0x277b79+'/'+_0x573d05)[_0x09b6('0x22')](_0x149939);}return null;};}function patchUpdates(_0x232a78){return function(_0x3d0cb4){try{jsonpatch['apply'](_0x3d0cb4,_0x232a78,!![]);}catch(_0x19ed61){return BPromise[_0x09b6('0x23')](_0x19ed61);}return _0x3d0cb4[_0x09b6('0x24')]();};}function saveUpdates(_0x35a2bb,_0x49c1ee){return function(_0x10520e){if(_0x10520e){return _0x10520e['update'](_0x35a2bb)[_0x09b6('0x25')](function(_0x4f70cf){return _0x4f70cf;});}return null;};}function removeEntity(_0x2e2b40,_0x385b5b){return function(_0x12d612){if(_0x12d612){return _0x12d612['destroy']()[_0x09b6('0x25')](function(){_0x2e2b40[_0x09b6('0x1b')](0xcc)[_0x09b6('0x1c')]();});}};}function handleEntityNotFound(_0xb63f13,_0x4f8db8){return function(_0x55c90b){if(!_0x55c90b){_0xb63f13[_0x09b6('0x1a')](0x194);}return _0x55c90b;};}function handleError(_0x194fe7,_0x1ee30d){_0x1ee30d=_0x1ee30d||0x1f4;return function(_0x3bfe26){logger['error'](_0x3bfe26[_0x09b6('0x26')]);if(_0x3bfe26['name']){delete _0x3bfe26[_0x09b6('0x27')];}_0x194fe7[_0x09b6('0x1b')](_0x1ee30d)[_0x09b6('0x28')](_0x3bfe26);};}exports['index']=function(_0x2e542e,_0x5ee402){var _0x1b7ac7={},_0x2bc0ff={},_0x244398={'count':0x0,'rows':[]};var _0x25cfd0=_[_0x09b6('0x29')](db[_0x09b6('0x2a')]['rawAttributes'],function(_0x51348c){return{'name':_0x51348c[_0x09b6('0x2b')],'type':_0x51348c[_0x09b6('0x2c')]['key']};});_0x2bc0ff[_0x09b6('0x2d')]=_['map'](_0x25cfd0,_0x09b6('0x27'));_0x2bc0ff[_0x09b6('0x2e')]=_[_0x09b6('0x2f')](_0x2e542e[_0x09b6('0x2e')]);_0x2bc0ff[_0x09b6('0x30')]=_['intersection'](_0x2bc0ff[_0x09b6('0x2d')],_0x2bc0ff[_0x09b6('0x2e')]);_0x1b7ac7[_0x09b6('0x31')]=_[_0x09b6('0x32')](_0x2bc0ff[_0x09b6('0x2d')],qs['fields'](_0x2e542e['query']['fields']));_0x1b7ac7['attributes']=_0x1b7ac7[_0x09b6('0x31')][_0x09b6('0x33')]?_0x1b7ac7[_0x09b6('0x31')]:_0x2bc0ff[_0x09b6('0x2d')];if(!_0x2e542e[_0x09b6('0x2e')][_0x09b6('0x34')](_0x09b6('0x35'))){_0x1b7ac7[_0x09b6('0x1f')]=qs[_0x09b6('0x1f')](_0x2e542e[_0x09b6('0x2e')][_0x09b6('0x1f')]);_0x1b7ac7[_0x09b6('0x1d')]=qs[_0x09b6('0x1d')](_0x2e542e['query'][_0x09b6('0x1d')]);}_0x1b7ac7[_0x09b6('0x36')]=qs[_0x09b6('0x37')](_0x2e542e[_0x09b6('0x2e')]['sort']);_0x1b7ac7[_0x09b6('0x38')]=qs[_0x09b6('0x30')](_[_0x09b6('0x39')](_0x2e542e[_0x09b6('0x2e')],_0x2bc0ff['filters']),_0x25cfd0);if(_0x2e542e[_0x09b6('0x2e')][_0x09b6('0x3a')]){_0x1b7ac7[_0x09b6('0x38')]=_[_0x09b6('0x3b')](_0x1b7ac7[_0x09b6('0x38')],{'$or':_[_0x09b6('0x29')](_0x25cfd0,function(_0x14f789){if(_0x14f789[_0x09b6('0x2c')]!==_0x09b6('0x3c')){var _0x3a28b8={};_0x3a28b8[_0x14f789['name']]={'$like':'%'+_0x2e542e['query'][_0x09b6('0x3a')]+'%'};return _0x3a28b8;}})});}_0x1b7ac7=_[_0x09b6('0x3b')]({},_0x1b7ac7,_0x2e542e[_0x09b6('0x3d')]);var _0x39b7a4={'where':_0x1b7ac7[_0x09b6('0x38')]};return db[_0x09b6('0x2a')][_0x09b6('0x20')](_0x39b7a4)[_0x09b6('0x25')](function(_0x2a26ec){_0x244398['count']=_0x2a26ec;if(_0x2e542e[_0x09b6('0x2e')]['includeAll']){_0x1b7ac7[_0x09b6('0x3e')]=[{'all':!![]}];}return db[_0x09b6('0x2a')][_0x09b6('0x3f')](_0x1b7ac7);})[_0x09b6('0x25')](function(_0x4bff59){_0x244398[_0x09b6('0x40')]=_0x4bff59;return _0x244398;})[_0x09b6('0x25')](respondWithFilteredResult(_0x5ee402,_0x1b7ac7))[_0x09b6('0x41')](handleError(_0x5ee402,null));};exports[_0x09b6('0x42')]=function(_0x8e309e,_0x597dc9){var _0x48f73={'raw':!![],'where':{'id':_0x8e309e['params']['id']}},_0x2ea566={};_0x2ea566['model']=_[_0x09b6('0x2f')](db[_0x09b6('0x2a')][_0x09b6('0x43')]);_0x2ea566[_0x09b6('0x2e')]=_[_0x09b6('0x2f')](_0x8e309e[_0x09b6('0x2e')]);_0x2ea566[_0x09b6('0x30')]=_[_0x09b6('0x32')](_0x2ea566['model'],_0x2ea566[_0x09b6('0x2e')]);_0x48f73[_0x09b6('0x31')]=_[_0x09b6('0x32')](_0x2ea566[_0x09b6('0x2d')],qs[_0x09b6('0x44')](_0x8e309e['query'][_0x09b6('0x44')]));_0x48f73[_0x09b6('0x31')]=_0x48f73[_0x09b6('0x31')][_0x09b6('0x33')]?_0x48f73[_0x09b6('0x31')]:_0x2ea566['model'];if(_0x8e309e['query'][_0x09b6('0x45')]){_0x48f73[_0x09b6('0x3e')]=[{'all':!![]}];}_0x48f73=_[_0x09b6('0x3b')]({},_0x48f73,_0x8e309e['options']);return db[_0x09b6('0x2a')][_0x09b6('0x46')](_0x48f73)['then'](handleEntityNotFound(_0x597dc9,null))['then'](respondWithResult(_0x597dc9,null))[_0x09b6('0x41')](handleError(_0x597dc9,null));};exports[_0x09b6('0x47')]=function(_0x2bef8f,_0x26c9a2){return db['SalesforceField'][_0x09b6('0x47')](_0x2bef8f['body'],{})['then'](respondWithResult(_0x26c9a2,0xc9))['catch'](handleError(_0x26c9a2,null));};exports[_0x09b6('0x48')]=function(_0x4cc97f,_0x26c56f){if(_0x4cc97f[_0x09b6('0x49')]['id']){delete _0x4cc97f['body']['id'];}return db[_0x09b6('0x2a')][_0x09b6('0x46')]({'where':{'id':_0x4cc97f[_0x09b6('0x4a')]['id']}})[_0x09b6('0x25')](handleEntityNotFound(_0x26c56f,null))[_0x09b6('0x25')](saveUpdates(_0x4cc97f[_0x09b6('0x49')],null))[_0x09b6('0x25')](respondWithResult(_0x26c56f,null))[_0x09b6('0x41')](handleError(_0x26c56f,null));};exports[_0x09b6('0x4b')]=function(_0x391e2e,_0x467ca4){return db[_0x09b6('0x2a')][_0x09b6('0x46')]({'where':{'id':_0x391e2e[_0x09b6('0x4a')]['id']}})[_0x09b6('0x25')](handleEntityNotFound(_0x467ca4,null))[_0x09b6('0x25')](removeEntity(_0x467ca4,null))[_0x09b6('0x41')](handleError(_0x467ca4,null));}; \ No newline at end of file +var _0x2790=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','SalesforceField','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','catch','params','includeAll','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3f7f41,_0x3b3d55){var _0x1c90ce=function(_0x398343){while(--_0x398343){_0x3f7f41['push'](_0x3f7f41['shift']());}};_0x1c90ce(++_0x3b3d55);}(_0x2790,0x8d));var _0x0279=function(_0x12f5f7,_0xa58b52){_0x12f5f7=_0x12f5f7-0x0;var _0x345c1b=_0x2790[_0x12f5f7];return _0x345c1b;};'use strict';var emlformat=require(_0x0279('0x0'));var rimraf=require(_0x0279('0x1'));var zipdir=require(_0x0279('0x2'));var jsonpatch=require(_0x0279('0x3'));var rp=require(_0x0279('0x4'));var moment=require(_0x0279('0x5'));var BPromise=require(_0x0279('0x6'));var Mustache=require(_0x0279('0x7'));var util=require(_0x0279('0x8'));var path=require(_0x0279('0x9'));var sox=require(_0x0279('0xa'));var csv=require(_0x0279('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0279('0xc'));var squel=require(_0x0279('0xd'));var crypto=require('crypto');var jsforce=require(_0x0279('0xe'));var deskjs=require(_0x0279('0xf'));var toCsv=require(_0x0279('0xb'));var querystring=require(_0x0279('0x10'));var Papa=require('papaparse');var Redis=require(_0x0279('0x11'));var authService=require(_0x0279('0x12'));var qs=require(_0x0279('0x13'));var as=require(_0x0279('0x14'));var hardwareService=require(_0x0279('0x15'));var logger=require(_0x0279('0x16'))(_0x0279('0x17'));var utils=require(_0x0279('0x18'));var config=require(_0x0279('0x19'));var licenseUtil=require(_0x0279('0x1a'));var db=require(_0x0279('0x1b'))['db'];function respondWithStatusCode(_0x395c00,_0x119d77){_0x119d77=_0x119d77||0xcc;return function(_0x25a4df){if(_0x25a4df){return _0x395c00[_0x0279('0x1c')](_0x119d77);}return _0x395c00[_0x0279('0x1d')](_0x119d77)[_0x0279('0x1e')]();};}function respondWithResult(_0x3c06c7,_0x66904c){_0x66904c=_0x66904c||0xc8;return function(_0x2e350c){if(_0x2e350c){return _0x3c06c7['status'](_0x66904c)[_0x0279('0x1f')](_0x2e350c);}};}function respondWithFilteredResult(_0x13e0c4,_0x31931d){return function(_0x5aed86){if(_0x5aed86){var _0xec9dd6=typeof _0x31931d[_0x0279('0x20')]===_0x0279('0x21')&&typeof _0x31931d['limit']==='undefined';var _0x48ea89=_0x5aed86[_0x0279('0x22')];var _0x459e92=_0xec9dd6?0x0:_0x31931d[_0x0279('0x20')];var _0x2041f1=_0xec9dd6?_0x5aed86[_0x0279('0x22')]:_0x31931d[_0x0279('0x20')]+_0x31931d[_0x0279('0x23')];var _0xc004e2;if(_0x2041f1>=_0x48ea89){_0x2041f1=_0x48ea89;_0xc004e2=0xc8;}else{_0xc004e2=0xce;}_0x13e0c4[_0x0279('0x1d')](_0xc004e2);return _0x13e0c4['set'](_0x0279('0x24'),_0x459e92+'-'+_0x2041f1+'/'+_0x48ea89)['json'](_0x5aed86);}return null;};}function patchUpdates(_0x510fdf){return function(_0x3fcbc4){try{jsonpatch[_0x0279('0x25')](_0x3fcbc4,_0x510fdf,!![]);}catch(_0x4dd70b){return BPromise[_0x0279('0x26')](_0x4dd70b);}return _0x3fcbc4['save']();};}function saveUpdates(_0x4efbd7,_0x14ef78){return function(_0xa48019){if(_0xa48019){return _0xa48019[_0x0279('0x27')](_0x4efbd7)[_0x0279('0x28')](function(_0x4b8f66){return _0x4b8f66;});}return null;};}function removeEntity(_0xe031,_0x1fdad3){return function(_0xb790f8){if(_0xb790f8){return _0xb790f8[_0x0279('0x29')]()[_0x0279('0x28')](function(){_0xe031[_0x0279('0x1d')](0xcc)[_0x0279('0x1e')]();});}};}function handleEntityNotFound(_0x577fba,_0x2024ea){return function(_0x2e1029){if(!_0x2e1029){_0x577fba[_0x0279('0x1c')](0x194);}return _0x2e1029;};}function handleError(_0x5d1f90,_0x1078e8){_0x1078e8=_0x1078e8||0x1f4;return function(_0x2147d8){logger[_0x0279('0x2a')](_0x2147d8[_0x0279('0x2b')]);if(_0x2147d8['name']){delete _0x2147d8[_0x0279('0x2c')];}_0x5d1f90['status'](_0x1078e8)['send'](_0x2147d8);};}exports['index']=function(_0x1d410d,_0x3a3c09){var _0x3a2ba4={},_0x1a0171={},_0x5ee38b={'count':0x0,'rows':[]};var _0x2da5a0=_['map'](db[_0x0279('0x2d')][_0x0279('0x2e')],function(_0x1820e8){return{'name':_0x1820e8[_0x0279('0x2f')],'type':_0x1820e8[_0x0279('0x30')][_0x0279('0x31')]};});_0x1a0171[_0x0279('0x32')]=_[_0x0279('0x33')](_0x2da5a0,_0x0279('0x2c'));_0x1a0171['query']=_[_0x0279('0x34')](_0x1d410d[_0x0279('0x35')]);_0x1a0171['filters']=_[_0x0279('0x36')](_0x1a0171[_0x0279('0x32')],_0x1a0171[_0x0279('0x35')]);_0x3a2ba4['attributes']=_[_0x0279('0x36')](_0x1a0171['model'],qs[_0x0279('0x37')](_0x1d410d[_0x0279('0x35')][_0x0279('0x37')]));_0x3a2ba4[_0x0279('0x38')]=_0x3a2ba4[_0x0279('0x38')][_0x0279('0x39')]?_0x3a2ba4[_0x0279('0x38')]:_0x1a0171[_0x0279('0x32')];if(!_0x1d410d[_0x0279('0x35')][_0x0279('0x3a')]('nolimit')){_0x3a2ba4[_0x0279('0x23')]=qs[_0x0279('0x23')](_0x1d410d[_0x0279('0x35')][_0x0279('0x23')]);_0x3a2ba4[_0x0279('0x20')]=qs[_0x0279('0x20')](_0x1d410d[_0x0279('0x35')]['offset']);}_0x3a2ba4['order']=qs[_0x0279('0x3b')](_0x1d410d['query'][_0x0279('0x3b')]);_0x3a2ba4[_0x0279('0x3c')]=qs[_0x0279('0x3d')](_[_0x0279('0x3e')](_0x1d410d[_0x0279('0x35')],_0x1a0171[_0x0279('0x3d')]),_0x2da5a0);if(_0x1d410d[_0x0279('0x35')]['filter']){_0x3a2ba4[_0x0279('0x3c')]=_[_0x0279('0x3f')](_0x3a2ba4[_0x0279('0x3c')],{'$or':_[_0x0279('0x33')](_0x2da5a0,function(_0x2ddbc9){if(_0x2ddbc9['type']!==_0x0279('0x40')){var _0x4ec917={};_0x4ec917[_0x2ddbc9[_0x0279('0x2c')]]={'$like':'%'+_0x1d410d[_0x0279('0x35')][_0x0279('0x41')]+'%'};return _0x4ec917;}})});}_0x3a2ba4=_[_0x0279('0x3f')]({},_0x3a2ba4,_0x1d410d[_0x0279('0x42')]);var _0x279e84={'where':_0x3a2ba4[_0x0279('0x3c')]};return db[_0x0279('0x2d')][_0x0279('0x22')](_0x279e84)[_0x0279('0x28')](function(_0x45d9a8){_0x5ee38b['count']=_0x45d9a8;if(_0x1d410d['query']['includeAll']){_0x3a2ba4[_0x0279('0x43')]=[{'all':!![]}];}return db[_0x0279('0x2d')]['findAll'](_0x3a2ba4);})[_0x0279('0x28')](function(_0x2be40d){_0x5ee38b['rows']=_0x2be40d;return _0x5ee38b;})[_0x0279('0x28')](respondWithFilteredResult(_0x3a3c09,_0x3a2ba4))[_0x0279('0x44')](handleError(_0x3a3c09,null));};exports['show']=function(_0x192bdf,_0x1d702d){var _0x3203b8={'raw':!![],'where':{'id':_0x192bdf[_0x0279('0x45')]['id']}},_0x276fe9={};_0x276fe9[_0x0279('0x32')]=_[_0x0279('0x34')](db[_0x0279('0x2d')][_0x0279('0x2e')]);_0x276fe9[_0x0279('0x35')]=_[_0x0279('0x34')](_0x192bdf[_0x0279('0x35')]);_0x276fe9['filters']=_[_0x0279('0x36')](_0x276fe9[_0x0279('0x32')],_0x276fe9[_0x0279('0x35')]);_0x3203b8[_0x0279('0x38')]=_['intersection'](_0x276fe9[_0x0279('0x32')],qs[_0x0279('0x37')](_0x192bdf[_0x0279('0x35')][_0x0279('0x37')]));_0x3203b8[_0x0279('0x38')]=_0x3203b8['attributes'][_0x0279('0x39')]?_0x3203b8[_0x0279('0x38')]:_0x276fe9[_0x0279('0x32')];if(_0x192bdf[_0x0279('0x35')][_0x0279('0x46')]){_0x3203b8['include']=[{'all':!![]}];}_0x3203b8=_['merge']({},_0x3203b8,_0x192bdf['options']);return db[_0x0279('0x2d')]['find'](_0x3203b8)['then'](handleEntityNotFound(_0x1d702d,null))[_0x0279('0x28')](respondWithResult(_0x1d702d,null))['catch'](handleError(_0x1d702d,null));};exports['create']=function(_0x1bf657,_0x45c28d){return db[_0x0279('0x2d')]['create'](_0x1bf657[_0x0279('0x47')],{})[_0x0279('0x28')](respondWithResult(_0x45c28d,0xc9))['catch'](handleError(_0x45c28d,null));};exports[_0x0279('0x27')]=function(_0x2c6a17,_0x2c5a48){if(_0x2c6a17[_0x0279('0x47')]['id']){delete _0x2c6a17[_0x0279('0x47')]['id'];}return db[_0x0279('0x2d')][_0x0279('0x48')]({'where':{'id':_0x2c6a17['params']['id']}})[_0x0279('0x28')](handleEntityNotFound(_0x2c5a48,null))[_0x0279('0x28')](saveUpdates(_0x2c6a17[_0x0279('0x47')],null))['then'](respondWithResult(_0x2c5a48,null))['catch'](handleError(_0x2c5a48,null));};exports[_0x0279('0x29')]=function(_0xf7bf8c,_0x59b47f){return db['SalesforceField'][_0x0279('0x48')]({'where':{'id':_0xf7bf8c[_0x0279('0x45')]['id']}})[_0x0279('0x28')](handleEntityNotFound(_0x59b47f,null))[_0x0279('0x28')](removeEntity(_0x59b47f,null))[_0x0279('0x44')](handleError(_0x59b47f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 20e2ad8..0082dbf 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 _0xcd2d=['int_salesforce_fields','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','SalesforceField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd2d,0xdb));var _0xdcd2=function(_0x36a2fa,_0x3a2582){_0x36a2fa=_0x36a2fa-0x0;var _0x2cc6b2=_0xcd2d[_0x36a2fa];return _0x2cc6b2;};'use strict';var _=require(_0xdcd2('0x0'));var util=require('util');var logger=require(_0xdcd2('0x1'))(_0xdcd2('0x2'));var moment=require('moment');var BPromise=require(_0xdcd2('0x3'));var rp=require(_0xdcd2('0x4'));var fs=require('fs');var path=require(_0xdcd2('0x5'));var rimraf=require('rimraf');var config=require(_0xdcd2('0x6'));var attributes=require(_0xdcd2('0x7'));module['exports']=function(_0x2c05a7,_0x94585e){return _0x2c05a7['define'](_0xdcd2('0x8'),attributes,{'tableName':_0xdcd2('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xdcd2('0xa'),_0xdcd2('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d39=['../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2d667c,_0x17ab73){var _0x4fbcc6=function(_0x203943){while(--_0x203943){_0x2d667c['push'](_0x2d667c['shift']());}};_0x4fbcc6(++_0x17ab73);}(_0x4d39,0xb8));var _0x94d3=function(_0x108bc6,_0x584d4d){_0x108bc6=_0x108bc6-0x0;var _0x299ddf=_0x4d39[_0x108bc6];return _0x299ddf;};'use strict';var _=require(_0x94d3('0x0'));var util=require(_0x94d3('0x1'));var logger=require(_0x94d3('0x2'))(_0x94d3('0x3'));var moment=require('moment');var BPromise=require(_0x94d3('0x4'));var rp=require(_0x94d3('0x5'));var fs=require('fs');var path=require(_0x94d3('0x6'));var rimraf=require(_0x94d3('0x7'));var config=require(_0x94d3('0x8'));var attributes=require(_0x94d3('0x9'));module[_0x94d3('0xa')]=function(_0x389109,_0x2a9079){return _0x389109['define'](_0x94d3('0xb'),attributes,{'tableName':_0x94d3('0xc'),'paranoid':![],'indexes':[{'name':_0x94d3('0xd'),'fields':[_0x94d3('0xe'),_0x94d3('0xf')],'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 cb9abb6..17f58f6 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 _0xc242=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch'];(function(_0x30d256,_0x5d0e67){var _0xcc407d=function(_0x3c54ff){while(--_0x3c54ff){_0x30d256['push'](_0x30d256['shift']());}};_0xcc407d(++_0x5d0e67);}(_0xc242,0x1db));var _0x2c24=function(_0x1b59b8,_0x2eb3c4){_0x1b59b8=_0x1b59b8-0x0;var _0x2527cb=_0xc242[_0x1b59b8];return _0x2527cb;};'use strict';var _=require(_0x2c24('0x0'));var util=require(_0x2c24('0x1'));var moment=require(_0x2c24('0x2'));var BPromise=require(_0x2c24('0x3'));var rs=require(_0x2c24('0x4'));var fs=require('fs');var Redis=require(_0x2c24('0x5'));var db=require(_0x2c24('0x6'))['db'];var utils=require(_0x2c24('0x7'));var logger=require(_0x2c24('0x8'))(_0x2c24('0x9'));var config=require(_0x2c24('0xa'));var jayson=require(_0x2c24('0xb'));var client=jayson[_0x2c24('0xc')][_0x2c24('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15f43a,_0x1d7f65,_0x23b258){return new BPromise(function(_0x380551,_0x330a61){return client[_0x2c24('0xe')](_0x15f43a,_0x23b258)[_0x2c24('0xf')](function(_0x1a20f5){logger[_0x2c24('0x10')](_0x2c24('0x11'),_0x1d7f65,'request\x20sent');logger[_0x2c24('0x12')](_0x2c24('0x13'),_0x1d7f65,'request\x20sent',JSON[_0x2c24('0x14')](_0x1a20f5));if(_0x1a20f5[_0x2c24('0x15')]){if(_0x1a20f5[_0x2c24('0x15')]['code']===0x1f4){logger['error'](_0x2c24('0x11'),_0x1d7f65,_0x1a20f5[_0x2c24('0x15')]['message']);return _0x330a61(_0x1a20f5[_0x2c24('0x15')][_0x2c24('0x16')]);}logger['error'](_0x2c24('0x11'),_0x1d7f65,_0x1a20f5['error'][_0x2c24('0x16')]);return _0x380551(_0x1a20f5[_0x2c24('0x15')]['message']);}else{logger[_0x2c24('0x10')]('SalesforceField,\x20%s,\x20%s',_0x1d7f65,_0x2c24('0x17'));_0x380551(_0x1a20f5['result'][_0x2c24('0x16')]);}})[_0x2c24('0x18')](function(_0x9169a){logger[_0x2c24('0x15')](_0x2c24('0x11'),_0x1d7f65,_0x9169a);_0x330a61(_0x9169a);});});} \ No newline at end of file +var _0xb958=['SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5af048,_0x4afc3b){var _0x278664=function(_0x1e1692){while(--_0x1e1692){_0x5af048['push'](_0x5af048['shift']());}};_0x278664(++_0x4afc3b);}(_0xb958,0x1aa));var _0x8b95=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0xb958[_0x37fcda];return _0xf5ed91;};'use strict';var _=require(_0x8b95('0x0'));var util=require(_0x8b95('0x1'));var moment=require(_0x8b95('0x2'));var BPromise=require(_0x8b95('0x3'));var rs=require(_0x8b95('0x4'));var fs=require('fs');var Redis=require(_0x8b95('0x5'));var db=require(_0x8b95('0x6'))['db'];var utils=require(_0x8b95('0x7'));var logger=require(_0x8b95('0x8'))('rpc');var config=require(_0x8b95('0x9'));var jayson=require(_0x8b95('0xa'));var client=jayson[_0x8b95('0xb')][_0x8b95('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cb90c,_0x7e6cca,_0x46fc2d){return new BPromise(function(_0x5c2322,_0xbcee29){return client[_0x8b95('0xd')](_0x5cb90c,_0x46fc2d)[_0x8b95('0xe')](function(_0x584ad5){logger[_0x8b95('0xf')](_0x8b95('0x10'),_0x7e6cca,'request\x20sent');logger[_0x8b95('0x11')](_0x8b95('0x12'),_0x7e6cca,_0x8b95('0x13'),JSON[_0x8b95('0x14')](_0x584ad5));if(_0x584ad5[_0x8b95('0x15')]){if(_0x584ad5['error'][_0x8b95('0x16')]===0x1f4){logger[_0x8b95('0x15')](_0x8b95('0x10'),_0x7e6cca,_0x584ad5['error'][_0x8b95('0x17')]);return _0xbcee29(_0x584ad5[_0x8b95('0x15')][_0x8b95('0x17')]);}logger[_0x8b95('0x15')](_0x8b95('0x10'),_0x7e6cca,_0x584ad5[_0x8b95('0x15')]['message']);return _0x5c2322(_0x584ad5[_0x8b95('0x15')][_0x8b95('0x17')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x7e6cca,'request\x20sent');_0x5c2322(_0x584ad5[_0x8b95('0x18')]['message']);}})[_0x8b95('0x19')](function(_0x23da98){logger[_0x8b95('0x15')]('SalesforceField,\x20%s,\x20%s',_0x7e6cca,_0x23da98);_0xbcee29(_0x23da98);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 647dffe..f0fda36 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 _0x0fea=['./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x51bc84,_0x519320){var _0x3a953e=function(_0x568464){while(--_0x568464){_0x51bc84['push'](_0x51bc84['shift']());}};_0x3a953e(++_0x519320);}(_0x0fea,0x80));var _0xa0fe=function(_0xb5fc12,_0x52af9e){_0xb5fc12=_0xb5fc12-0x0;var _0x41063c=_0x0fea[_0xb5fc12];return _0x41063c;};'use strict';var multer=require(_0xa0fe('0x0'));var util=require(_0xa0fe('0x1'));var path=require(_0xa0fe('0x2'));var timeout=require(_0xa0fe('0x3'));var express=require(_0xa0fe('0x4'));var router=express[_0xa0fe('0x5')]();var fs_extra=require(_0xa0fe('0x6'));var auth=require(_0xa0fe('0x7'));var interaction=require(_0xa0fe('0x8'));var config=require(_0xa0fe('0x9'));var controller=require(_0xa0fe('0xa'));router['get']('/',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0xc')]);router[_0xa0fe('0xd')](_0xa0fe('0xe'),auth['isAuthenticated'](),controller[_0xa0fe('0xf')]);router[_0xa0fe('0xd')](_0xa0fe('0x10'),auth['isAuthenticated'](),controller[_0xa0fe('0x11')]);router[_0xa0fe('0xd')](_0xa0fe('0x12'),auth[_0xa0fe('0xb')](),controller['getFields']);router[_0xa0fe('0x13')]('/',auth['isAuthenticated'](),controller[_0xa0fe('0x14')]);router[_0xa0fe('0x13')](_0xa0fe('0x10'),auth[_0xa0fe('0xb')](),controller['addConfiguration']);router['put'](_0xa0fe('0xe'),auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x15')]);router['delete'](_0xa0fe('0xe'),auth[_0xa0fe('0xb')](),controller['destroy']);module[_0xa0fe('0x16')]=router; \ No newline at end of file +var _0x11dd=['post','addConfiguration','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x38accc,_0x2f419f){var _0x485e11=function(_0x2c3777){while(--_0x2c3777){_0x38accc['push'](_0x38accc['shift']());}};_0x485e11(++_0x2f419f);}(_0x11dd,0xe1));var _0xd11d=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x11dd[_0x37a79c];return _0x561d89;};'use strict';var multer=require(_0xd11d('0x0'));var util=require('util');var path=require(_0xd11d('0x1'));var timeout=require(_0xd11d('0x2'));var express=require(_0xd11d('0x3'));var router=express[_0xd11d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd11d('0x5'));var interaction=require(_0xd11d('0x6'));var config=require(_0xd11d('0x7'));var controller=require(_0xd11d('0x8'));router[_0xd11d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd11d('0xa'),auth[_0xd11d('0xb')](),controller[_0xd11d('0xc')]);router[_0xd11d('0x9')](_0xd11d('0xd'),auth[_0xd11d('0xb')](),controller[_0xd11d('0xe')]);router[_0xd11d('0x9')](_0xd11d('0xf'),auth[_0xd11d('0xb')](),controller[_0xd11d('0x10')]);router[_0xd11d('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd11d('0x11')](_0xd11d('0xd'),auth[_0xd11d('0xb')](),controller[_0xd11d('0x12')]);router[_0xd11d('0x13')](_0xd11d('0xa'),auth[_0xd11d('0xb')](),controller['update']);router[_0xd11d('0x14')](_0xd11d('0xa'),auth[_0xd11d('0xb')](),controller[_0xd11d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 175251a..d588bbf 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 _0x0e65=['exports','STRING','remoteUri','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0e65,0xdf));var _0x50e6=function(_0x4a8651,_0x3b5d98){_0x4a8651=_0x4a8651-0x0;var _0x96a8f8=_0x0e65[_0x4a8651];return _0x96a8f8;};'use strict';var Sequelize=require(_0x50e6('0x0'));module[_0x50e6('0x1')]={'name':{'type':Sequelize[_0x50e6('0x2')]},'description':{'type':Sequelize[_0x50e6('0x2')]},'username':{'type':Sequelize[_0x50e6('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x50e6('0x2')]},'remoteUri':{'type':Sequelize[_0x50e6('0x2')],'unique':_0x50e6('0x3')},'serverUrl':{'type':Sequelize[_0x50e6('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd526=['STRING','username','remoteUri','sequelize','exports'];(function(_0x1ef10f,_0x7c60e0){var _0x27700f=function(_0x50842f){while(--_0x50842f){_0x1ef10f['push'](_0x1ef10f['shift']());}};_0x27700f(++_0x7c60e0);}(_0xd526,0xc1));var _0x6d52=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd526[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x6d52('0x0'));module[_0x6d52('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d52('0x2')]},'username':{'type':Sequelize[_0x6d52('0x2')],'unique':_0x6d52('0x3')},'password':{'type':Sequelize[_0x6d52('0x2')]},'email':{'type':Sequelize[_0x6d52('0x2')]},'remoteUri':{'type':Sequelize[_0x6d52('0x2')],'unique':_0x6d52('0x4')},'serverUrl':{'type':Sequelize[_0x6d52('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 2fb96f0..1fee4c7 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 _0xe027=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','json','apply','save','then','end','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','count','includeAll','include','catch','show','keys','options','find','create','body','destroy','params','getConfigurations','order','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','delivery_plan','active','work_notes_list','priority','sys_domain_path','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','password','email','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','stack','Wrong\x20credentials','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0xe027,0xb3));var _0x7e02=function(_0x225c75,_0x5294cf){_0x225c75=_0x225c75-0x0;var _0x441704=_0xe027[_0x225c75];return _0x441704;};'use strict';var emlformat=require(_0x7e02('0x0'));var rimraf=require(_0x7e02('0x1'));var zipdir=require(_0x7e02('0x2'));var jsonpatch=require(_0x7e02('0x3'));var rp=require('request-promise');var moment=require(_0x7e02('0x4'));var BPromise=require(_0x7e02('0x5'));var Mustache=require(_0x7e02('0x6'));var util=require(_0x7e02('0x7'));var path=require(_0x7e02('0x8'));var sox=require(_0x7e02('0x9'));var csv=require(_0x7e02('0xa'));var ejs=require(_0x7e02('0xb'));var fs=require('fs');var fs_extra=require(_0x7e02('0xc'));var _=require(_0x7e02('0xd'));var squel=require(_0x7e02('0xe'));var crypto=require(_0x7e02('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7e02('0x10'));var toCsv=require(_0x7e02('0xa'));var querystring=require(_0x7e02('0x11'));var Papa=require(_0x7e02('0x12'));var Redis=require('ioredis');var authService=require(_0x7e02('0x13'));var qs=require(_0x7e02('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e02('0x15'));var logger=require(_0x7e02('0x16'))('api');var utils=require(_0x7e02('0x17'));var config=require(_0x7e02('0x18'));var licenseUtil=require(_0x7e02('0x19'));var db=require(_0x7e02('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4a3b1c,_0x13706d){_0x13706d=_0x13706d||0xcc;return function(_0x2425e4){if(_0x2425e4){return _0x4a3b1c[_0x7e02('0x1b')](_0x13706d);}return _0x4a3b1c[_0x7e02('0x1c')](_0x13706d)['end']();};}function respondWithResult(_0xcefb10,_0x1fe8c4){_0x1fe8c4=_0x1fe8c4||0xc8;return function(_0x32e889){if(_0x32e889){return _0xcefb10[_0x7e02('0x1c')](_0x1fe8c4)['json'](_0x32e889);}};}function respondWithFilteredResult(_0x29c6ce,_0x31024e){return function(_0xe3a2ac){if(_0xe3a2ac){var _0x3fdab4=typeof _0x31024e[_0x7e02('0x1d')]==='undefined'&&typeof _0x31024e[_0x7e02('0x1e')]===_0x7e02('0x1f');var _0x5e7d33=_0xe3a2ac['count'];var _0x4bc3fd=_0x3fdab4?0x0:_0x31024e['offset'];var _0x5d43c9=_0x3fdab4?_0xe3a2ac['count']:_0x31024e[_0x7e02('0x1d')]+_0x31024e['limit'];var _0x10d478;if(_0x5d43c9>=_0x5e7d33){_0x5d43c9=_0x5e7d33;_0x10d478=0xc8;}else{_0x10d478=0xce;}_0x29c6ce[_0x7e02('0x1c')](_0x10d478);return _0x29c6ce['set']('Content-Range',_0x4bc3fd+'-'+_0x5d43c9+'/'+_0x5e7d33)[_0x7e02('0x20')](_0xe3a2ac);}return null;};}function patchUpdates(_0x2a3dfd){return function(_0x10993b){try{jsonpatch[_0x7e02('0x21')](_0x10993b,_0x2a3dfd,!![]);}catch(_0x42e41c){return BPromise['reject'](_0x42e41c);}return _0x10993b[_0x7e02('0x22')]();};}function saveUpdates(_0x186baa,_0x2c4973){return function(_0x116313){if(_0x116313){return _0x116313['update'](_0x186baa)[_0x7e02('0x23')](function(_0x4a0fc1){return _0x4a0fc1;});}return null;};}function removeEntity(_0x464b32,_0x1cfd87){return function(_0x1bb822){if(_0x1bb822){return _0x1bb822['destroy']()[_0x7e02('0x23')](function(){_0x464b32['status'](0xcc)[_0x7e02('0x24')]();});}};}function handleEntityNotFound(_0x46c6b3,_0x2d7481){return function(_0x116b9b){if(!_0x116b9b){_0x46c6b3['sendStatus'](0x194);}return _0x116b9b;};}function handleError(_0x1c183c,_0x12586d){_0x12586d=_0x12586d||0x1f4;return function(_0x39d165){logger[_0x7e02('0x25')](_0x39d165['stack']);if(_0x39d165[_0x7e02('0x26')]){delete _0x39d165[_0x7e02('0x26')];}_0x1c183c[_0x7e02('0x1c')](_0x12586d)[_0x7e02('0x27')](_0x39d165);};}exports[_0x7e02('0x28')]=function(_0xa01a3f,_0x1ba893){var _0x4c1c0a={},_0x48e903={},_0xfadb10={'count':0x0,'rows':[]};var _0x2a45aa=_[_0x7e02('0x29')](db[_0x7e02('0x2a')][_0x7e02('0x2b')],function(_0x49576b){return{'name':_0x49576b[_0x7e02('0x2c')],'type':_0x49576b[_0x7e02('0x2d')]['key']};});_0x48e903['model']=_[_0x7e02('0x29')](_0x2a45aa,_0x7e02('0x26'));_0x48e903[_0x7e02('0x2e')]=_['keys'](_0xa01a3f[_0x7e02('0x2e')]);_0x48e903[_0x7e02('0x2f')]=_['intersection'](_0x48e903['model'],_0x48e903[_0x7e02('0x2e')]);_0x4c1c0a[_0x7e02('0x30')]=_[_0x7e02('0x31')](_0x48e903[_0x7e02('0x32')],qs[_0x7e02('0x33')](_0xa01a3f['query'][_0x7e02('0x33')]));_0x4c1c0a['attributes']=_0x4c1c0a[_0x7e02('0x30')][_0x7e02('0x34')]?_0x4c1c0a['attributes']:_0x48e903[_0x7e02('0x32')];if(!_0xa01a3f[_0x7e02('0x2e')][_0x7e02('0x35')](_0x7e02('0x36'))){_0x4c1c0a['limit']=qs[_0x7e02('0x1e')](_0xa01a3f[_0x7e02('0x2e')][_0x7e02('0x1e')]);_0x4c1c0a[_0x7e02('0x1d')]=qs[_0x7e02('0x1d')](_0xa01a3f[_0x7e02('0x2e')][_0x7e02('0x1d')]);}_0x4c1c0a['order']=qs[_0x7e02('0x37')](_0xa01a3f['query']['sort']);_0x4c1c0a[_0x7e02('0x38')]=qs[_0x7e02('0x2f')](_['pick'](_0xa01a3f[_0x7e02('0x2e')],_0x48e903[_0x7e02('0x2f')]),_0x2a45aa);if(_0xa01a3f[_0x7e02('0x2e')][_0x7e02('0x39')]){_0x4c1c0a[_0x7e02('0x38')]=_[_0x7e02('0x3a')](_0x4c1c0a[_0x7e02('0x38')],{'$or':_[_0x7e02('0x29')](_0x2a45aa,function(_0x314385){if(_0x314385[_0x7e02('0x2d')]!==_0x7e02('0x3b')){var _0x59cc82={};_0x59cc82[_0x314385[_0x7e02('0x26')]]={'$like':'%'+_0xa01a3f[_0x7e02('0x2e')]['filter']+'%'};return _0x59cc82;}})});}_0x4c1c0a=_[_0x7e02('0x3a')]({},_0x4c1c0a,_0xa01a3f['options']);var _0x2d4ffa={'where':_0x4c1c0a[_0x7e02('0x38')]};return db[_0x7e02('0x2a')]['count'](_0x2d4ffa)[_0x7e02('0x23')](function(_0x33d193){_0xfadb10[_0x7e02('0x3c')]=_0x33d193;if(_0xa01a3f['query'][_0x7e02('0x3d')]){_0x4c1c0a[_0x7e02('0x3e')]=[{'all':!![]}];}return db[_0x7e02('0x2a')]['findAll'](_0x4c1c0a);})[_0x7e02('0x23')](function(_0x1eb93f){_0xfadb10['rows']=_0x1eb93f;return _0xfadb10;})[_0x7e02('0x23')](respondWithFilteredResult(_0x1ba893,_0x4c1c0a))[_0x7e02('0x3f')](handleError(_0x1ba893,null));};exports[_0x7e02('0x40')]=function(_0x310132,_0x189b85){var _0xe086f5={'raw':![],'where':{'id':_0x310132['params']['id']}},_0x11fda5={};_0x11fda5[_0x7e02('0x32')]=_['keys'](db[_0x7e02('0x2a')][_0x7e02('0x2b')]);_0x11fda5[_0x7e02('0x2e')]=_[_0x7e02('0x41')](_0x310132['query']);_0x11fda5[_0x7e02('0x2f')]=_[_0x7e02('0x31')](_0x11fda5[_0x7e02('0x32')],_0x11fda5['query']);_0xe086f5[_0x7e02('0x30')]=_[_0x7e02('0x31')](_0x11fda5[_0x7e02('0x32')],qs[_0x7e02('0x33')](_0x310132[_0x7e02('0x2e')][_0x7e02('0x33')]));_0xe086f5['attributes']=_0xe086f5[_0x7e02('0x30')]['length']?_0xe086f5[_0x7e02('0x30')]:_0x11fda5['model'];if(_0x310132[_0x7e02('0x2e')][_0x7e02('0x3d')]){_0xe086f5[_0x7e02('0x3e')]=[{'all':!![]}];}_0xe086f5=_[_0x7e02('0x3a')]({},_0xe086f5,_0x310132[_0x7e02('0x42')]);return db[_0x7e02('0x2a')][_0x7e02('0x43')](_0xe086f5)[_0x7e02('0x23')](handleEntityNotFound(_0x189b85,null))['then'](respondWithResult(_0x189b85,null))[_0x7e02('0x3f')](handleError(_0x189b85,null));};exports[_0x7e02('0x44')]=function(_0x56aff5,_0x22cb98){return db[_0x7e02('0x2a')][_0x7e02('0x44')](_0x56aff5['body'],{})[_0x7e02('0x23')](respondWithResult(_0x22cb98,0xc9))[_0x7e02('0x3f')](handleError(_0x22cb98,null));};exports['update']=function(_0x1f5042,_0x176efa){if(_0x1f5042['body']['id']){delete _0x1f5042[_0x7e02('0x45')]['id'];}return db[_0x7e02('0x2a')][_0x7e02('0x43')]({'where':{'id':_0x1f5042['params']['id']}})[_0x7e02('0x23')](handleEntityNotFound(_0x176efa,null))[_0x7e02('0x23')](saveUpdates(_0x1f5042[_0x7e02('0x45')],null))[_0x7e02('0x23')](respondWithResult(_0x176efa,null))[_0x7e02('0x3f')](handleError(_0x176efa,null));};exports[_0x7e02('0x46')]=function(_0x34d4a0,_0x314c07){return db[_0x7e02('0x2a')][_0x7e02('0x43')]({'where':{'id':_0x34d4a0[_0x7e02('0x47')]['id']}})['then'](handleEntityNotFound(_0x314c07,null))['then'](removeEntity(_0x314c07,null))[_0x7e02('0x3f')](handleError(_0x314c07,null));};exports[_0x7e02('0x48')]=function(_0x292076,_0x16bed7,_0x26c343){var _0xe093ba={};var _0x4d7bec={};var _0x1b22ff;var _0x347cbc;return db[_0x7e02('0x2a')]['findOne']({'where':{'id':_0x292076[_0x7e02('0x47')]['id']}})[_0x7e02('0x23')](handleEntityNotFound(_0x16bed7,null))[_0x7e02('0x23')](function(_0x5b5699){if(_0x5b5699){_0x1b22ff=_0x5b5699;_0x4d7bec[_0x7e02('0x32')]=_[_0x7e02('0x41')](db['ServicenowConfiguration'][_0x7e02('0x2b')]);_0x4d7bec[_0x7e02('0x2e')]=_[_0x7e02('0x41')](_0x292076[_0x7e02('0x2e')]);_0x4d7bec[_0x7e02('0x2f')]=_[_0x7e02('0x31')](_0x4d7bec['model'],_0x4d7bec['query']);_0xe093ba[_0x7e02('0x30')]=_['intersection'](_0x4d7bec[_0x7e02('0x32')],qs[_0x7e02('0x33')](_0x292076[_0x7e02('0x2e')][_0x7e02('0x33')]));_0xe093ba[_0x7e02('0x30')]=_0xe093ba[_0x7e02('0x30')][_0x7e02('0x34')]?_0xe093ba[_0x7e02('0x30')]:_0x4d7bec['model'];_0xe093ba[_0x7e02('0x49')]=qs['sort'](_0x292076['query'][_0x7e02('0x37')]);_0xe093ba[_0x7e02('0x38')]=qs['filters'](_[_0x7e02('0x4a')](_0x292076['query'],_0x4d7bec[_0x7e02('0x2f')]));if(_0x292076[_0x7e02('0x2e')][_0x7e02('0x39')]){_0xe093ba[_0x7e02('0x38')]=_[_0x7e02('0x3a')](_0xe093ba[_0x7e02('0x38')],{'$or':_[_0x7e02('0x29')](_0xe093ba['attributes'],function(_0x18be1e){var _0x5e2d76={};_0x5e2d76[_0x18be1e]={'$like':'%'+_0x292076[_0x7e02('0x2e')][_0x7e02('0x39')]+'%'};return _0x5e2d76;})});}_0xe093ba=_[_0x7e02('0x3a')]({},_0xe093ba,_0x292076[_0x7e02('0x42')]);return _0x1b22ff[_0x7e02('0x48')](_0xe093ba);}})[_0x7e02('0x23')](function(_0x19e7f7){if(_0x19e7f7){_0x347cbc=_0x19e7f7['length'];if(!_0x292076[_0x7e02('0x2e')][_0x7e02('0x35')](_0x7e02('0x36'))){_0xe093ba[_0x7e02('0x1e')]=qs[_0x7e02('0x1e')](_0x292076['query'][_0x7e02('0x1e')]);_0xe093ba[_0x7e02('0x1d')]=qs[_0x7e02('0x1d')](_0x292076['query']['offset']);}return _0x1b22ff[_0x7e02('0x48')](_0xe093ba);}})[_0x7e02('0x23')](function(_0x46bcb2){if(_0x46bcb2){return _0x46bcb2?{'count':_0x347cbc,'rows':_0x46bcb2}:null;}})['then'](respondWithResult(_0x16bed7,null))['catch'](handleError(_0x16bed7,null));};exports[_0x7e02('0x4b')]=function(_0xf0e8e8,_0x1338bb,_0x3c5152){if(_0xf0e8e8[_0x7e02('0x45')]['id']){delete _0xf0e8e8['body']['id'];}return db[_0x7e02('0x2a')][_0x7e02('0x4c')]({'where':{'id':_0xf0e8e8[_0x7e02('0x47')]['id']}})[_0x7e02('0x23')](handleEntityNotFound(_0x1338bb,null))['then'](function(_0x188eac){if(_0x188eac){_0xf0e8e8[_0x7e02('0x45')][_0x7e02('0x4d')]=_0x188eac['id'];_0xf0e8e8[_0x7e02('0x45')][_0x7e02('0x4e')]=integrations[_0x7e02('0x4f')](_0xf0e8e8[_0x7e02('0x45')]['channel'],_0xf0e8e8['body'][_0x7e02('0x2d')]);_0xf0e8e8[_0x7e02('0x45')][_0x7e02('0x50')]=integrations[_0x7e02('0x51')](_0xf0e8e8['body'][_0x7e02('0x52')],_0xf0e8e8[_0x7e02('0x45')][_0x7e02('0x2d')]);return db[_0x7e02('0x53')][_0x7e02('0x44')](_0xf0e8e8[_0x7e02('0x45')],{'include':[{'model':db['ServicenowField'],'as':_0x7e02('0x4e')},{'model':db[_0x7e02('0x54')],'as':_0x7e02('0x50')}]});}return null;})[_0x7e02('0x23')](respondWithResult(_0x1338bb,null))[_0x7e02('0x3f')](handleError(_0x1338bb,null));};exports[_0x7e02('0x55')]=function(_0x3b6124,_0x1f0bf1,_0x2b8986){var _0x4365da=[_0x7e02('0x56'),_0x7e02('0x57'),_0x7e02('0x58'),_0x7e02('0x59'),_0x7e02('0x5a'),_0x7e02('0x5b'),_0x7e02('0x5c'),_0x7e02('0x5d'),_0x7e02('0x5e')];var _0x9dd3c3=['parent','made_sla','caused_by',_0x7e02('0x5f'),_0x7e02('0x60'),_0x7e02('0x61'),_0x7e02('0x62'),_0x7e02('0x57'),_0x7e02('0x63'),_0x7e02('0x64'),_0x7e02('0x65'),_0x7e02('0x66'),_0x7e02('0x67'),_0x7e02('0x68'),_0x7e02('0x69'),_0x7e02('0x6a'),_0x7e02('0x6b'),_0x7e02('0x6c'),'knowledge',_0x7e02('0x49'),_0x7e02('0x6d'),'closed_at','cmdb_ci',_0x7e02('0x6e'),'impact',_0x7e02('0x6f'),_0x7e02('0x70'),'business_service',_0x7e02('0x71'),_0x7e02('0x72'),'rfc',_0x7e02('0x73'),'expected_start',_0x7e02('0x74'),_0x7e02('0x75'),_0x7e02('0x76'),'work_end',_0x7e02('0x77'),_0x7e02('0x78'),_0x7e02('0x79'),_0x7e02('0x7a'),'subcategory','work_notes',_0x7e02('0x7b'),_0x7e02('0x5a'),_0x7e02('0x7c'),_0x7e02('0x7d'),_0x7e02('0x7e'),'assignment_group','business_stc',_0x7e02('0x7f'),_0x7e02('0x80'),_0x7e02('0x81'),_0x7e02('0x5b'),'sys_class_name','close_notes',_0x7e02('0x82'),_0x7e02('0x83'),_0x7e02('0x84'),_0x7e02('0x85'),_0x7e02('0x86'),'reopened_by',_0x7e02('0x5c'),_0x7e02('0x87'),'problem_id',_0x7e02('0x88'),_0x7e02('0x89'),_0x7e02('0x8a'),_0x7e02('0x8b'),_0x7e02('0x5d'),_0x7e02('0x8c'),_0x7e02('0x8d'),_0x7e02('0x8e'),'comments_and_work_notes',_0x7e02('0x8f'),_0x7e02('0x90'),_0x7e02('0x91'),_0x7e02('0x92'),_0x7e02('0x93'),_0x7e02('0x94'),'correlation_id',_0x7e02('0x95'),_0x7e02('0x5e')];var _0x2a16bc='';var _0x1d223b='';var _0x12bbc1=[];var _0x21cecb='';var _0x5b9dc3='';var _0x1f34d5=[];var _0x5bcd37='';var _0x42101e='';var _0x167559={};var _0x40c55='';return db['ServicenowAccount'][_0x7e02('0x4c')]({'where':{'id':_0x3b6124[_0x7e02('0x47')]['id']},'attributes':['id',_0x7e02('0x96'),_0x7e02('0x97'),_0x7e02('0x98'),'remoteUri','serverUrl']})[_0x7e02('0x23')](handleEntityNotFound(_0x1f0bf1,null))[_0x7e02('0x23')](function(_0x4229f5){if(_0x4229f5){_0x40c55=_0x4229f5['remoteUri'];var _0x2c319b=_0x40c55['slice'](-0x1);if(_0x2c319b==='/'){_0x40c55=_0x40c55[_0x7e02('0x99')](0x0,_0x40c55[_0x7e02('0x9a')](_0x2c319b));}_0x42101e=util[_0x7e02('0x9b')](_0x7e02('0x9c'),_0x40c55);_0x5bcd37=util[_0x7e02('0x9b')]('%s/api/now/table/',_0x40c55);_0x167559={'user':_0x4229f5['username'],'pass':_0x4229f5['password']};var _0x3bee24={'method':_0x7e02('0x9d'),'uri':_0x42101e+_0x7e02('0x9e'),'auth':_0x167559,'json':!![]};return rp(_0x3bee24);}})[_0x7e02('0x23')](function(_0x2a13e1){if(_0x2a13e1[_0x7e02('0x9f')]['length']>0x0){_0x2a16bc=_0x2a13e1['result'];}console[_0x7e02('0xa0')](_0x7e02('0xa1'),_0x2a16bc);_0x1f34d5=[];_0x1d223b=Object[_0x7e02('0xa2')]([],_0x2a16bc);_[_0x7e02('0xa3')](_0x1d223b,function(_0x24c972){return!_0x4365da['includes'](_0x24c972[_0x7e02('0x26')]);});_0x1d223b[_0x7e02('0xa4')](function(_0x122d5b){var _0x2eaa8e=createFieldObject(_0x5bcd37,_0x167559,_0x122d5b[_0x7e02('0xa5')],_0x122d5b[_0x7e02('0x26')],_0x122d5b[_0x7e02('0xa6')],![]);_0x1f34d5[_0x7e02('0xa7')](_0x2eaa8e);});return Promise[_0x7e02('0xa8')](_0x1f34d5);})[_0x7e02('0x23')](function(_0x479c10){_0x12bbc1=_0x479c10;_0x21cecb=Object[_0x7e02('0xa2')]([],_0x2a16bc);console[_0x7e02('0xa0')](_0x7e02('0xa9'),_0x2a16bc);_[_0x7e02('0xa3')](_0x21cecb,function(_0x18e338){return _0x9dd3c3[_0x7e02('0xaa')](_0x18e338[_0x7e02('0x26')]);});console[_0x7e02('0xa0')](_0x7e02('0xab'),_0x21cecb);_0x1f34d5=[];_0x21cecb[_0x7e02('0xa4')](function(_0x18bde0){var _0x1f1f9b=createFieldObject(_0x5bcd37,_0x167559,_0x18bde0[_0x7e02('0xa5')],_0x18bde0[_0x7e02('0x26')],_0x18bde0[_0x7e02('0xa6')],!![]);_0x1f34d5[_0x7e02('0xa7')](_0x1f1f9b);});return Promise[_0x7e02('0xa8')](_0x1f34d5);})[_0x7e02('0x23')](function(_0x18b7ac){_0x5b9dc3=_0x18b7ac;var _0x55399d=_0x12bbc1[_0x7e02('0xac')](_0x5b9dc3);return{'count':_0x55399d[_0x7e02('0x34')],'rows':_0x55399d};})[_0x7e02('0x23')](respondWithResult(_0x1f0bf1,null))[_0x7e02('0x3f')](function(_0x3fbd24){console['log']('ServiceNow\x20error:\x20'+_0x3fbd24);var _0x3ebf32=_0x3b6124[_0x7e02('0x2e')][_0x7e02('0xad')]?0x1f4:_0x3fbd24['statusCode']||0x1f4;logger[_0x7e02('0x25')](_0x3fbd24[_0x7e02('0xae')]);delete _0x3fbd24[_0x7e02('0x26')];if(_0x3ebf32===0x191){_0x3ebf32=0x190;}_0x1f0bf1[_0x7e02('0x1c')](_0x3ebf32)[_0x7e02('0x27')](_0x3b6124[_0x7e02('0x2e')][_0x7e02('0xad')]?{'message':_0x7e02('0xaf'),'statusCode':_0x3fbd24['statusCode']}:_0x3fbd24);});};function createFieldObject(_0x5a1a69,_0x5cabc0,_0x542ec9,_0x445c3f,_0x3901d4,_0x12c67c){return new Promise(function(_0x1325d0,_0x4bdeeb){var _0x227439={'id':_0x445c3f,'name':_0x3901d4,'custom':_0x12c67c};if(_0x542ec9==='boolean'){_0x227439['options']=[{'name':'True','value':_0x7e02('0xb0')},{'name':_0x7e02('0xb1'),'value':_0x7e02('0xb2')}];_0x1325d0(_0x227439);}else{var _0x1f84a3={'method':_0x7e02('0x9d'),'uri':_0x5a1a69+_0x7e02('0xb3')+_0x445c3f,'auth':_0x5cabc0,'json':!![]};return rp(_0x1f84a3)[_0x7e02('0x23')](function(_0x289257){var _0x59919b=[];if(_0x289257[_0x7e02('0x9f')][_0x7e02('0x34')]>0x0){_0x289257[_0x7e02('0x9f')][_0x7e02('0xa4')](function(_0x19932a){if(_0x19932a[_0x7e02('0xb4')]===_0x7e02('0xb2')){var _0x1784e5={'name':_0x19932a[_0x7e02('0xa6')],'value':_0x19932a['value']};_0x59919b[_0x7e02('0xa7')](_0x1784e5);}});}_0x227439[_0x7e02('0x42')]=_0x59919b;if(_0x227439[_0x7e02('0x42')][_0x7e02('0x34')]>0x0){_0x1325d0(_0x227439);}else{if(_0x12c67c==![]){_0x1325d0();}else{_0x1325d0(_0x227439);}}});}});} \ No newline at end of file +var _0xb068=['knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','calendar_stc','closed_at','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','category','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/table/','username','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','stack','test','Wrong\x20credentials','statusCode','boolean','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','findOne','ServicenowConfiguration','sort','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb068,0x1c8));var _0x8b06=function(_0x408e9a,_0x2b8004){_0x408e9a=_0x408e9a-0x0;var _0x4512d4=_0xb068[_0x408e9a];return _0x4512d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b06('0x0'));var zipdir=require(_0x8b06('0x1'));var jsonpatch=require(_0x8b06('0x2'));var rp=require('request-promise');var moment=require(_0x8b06('0x3'));var BPromise=require(_0x8b06('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8b06('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8b06('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b06('0x7'));var squel=require(_0x8b06('0x8'));var crypto=require(_0x8b06('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8b06('0xa'));var toCsv=require(_0x8b06('0xb'));var querystring=require(_0x8b06('0xc'));var Papa=require(_0x8b06('0xd'));var Redis=require(_0x8b06('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8b06('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b06('0x10'));var logger=require('../../config/logger')(_0x8b06('0x11'));var utils=require('../../config/utils');var config=require(_0x8b06('0x12'));var licenseUtil=require(_0x8b06('0x13'));var db=require(_0x8b06('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1605f0,_0x61e68){_0x61e68=_0x61e68||0xcc;return function(_0x8ab2ee){if(_0x8ab2ee){return _0x1605f0[_0x8b06('0x15')](_0x61e68);}return _0x1605f0[_0x8b06('0x16')](_0x61e68)[_0x8b06('0x17')]();};}function respondWithResult(_0x13bdbb,_0x17f12c){_0x17f12c=_0x17f12c||0xc8;return function(_0x532331){if(_0x532331){return _0x13bdbb[_0x8b06('0x16')](_0x17f12c)[_0x8b06('0x18')](_0x532331);}};}function respondWithFilteredResult(_0x24cfe5,_0x5d34e7){return function(_0x5b67a8){if(_0x5b67a8){var _0x1154ee=typeof _0x5d34e7[_0x8b06('0x19')]===_0x8b06('0x1a')&&typeof _0x5d34e7['limit']===_0x8b06('0x1a');var _0x5b18b9=_0x5b67a8['count'];var _0x12c131=_0x1154ee?0x0:_0x5d34e7[_0x8b06('0x19')];var _0x3781a6=_0x1154ee?_0x5b67a8[_0x8b06('0x1b')]:_0x5d34e7['offset']+_0x5d34e7['limit'];var _0x138ecf;if(_0x3781a6>=_0x5b18b9){_0x3781a6=_0x5b18b9;_0x138ecf=0xc8;}else{_0x138ecf=0xce;}_0x24cfe5['status'](_0x138ecf);return _0x24cfe5[_0x8b06('0x1c')](_0x8b06('0x1d'),_0x12c131+'-'+_0x3781a6+'/'+_0x5b18b9)[_0x8b06('0x18')](_0x5b67a8);}return null;};}function patchUpdates(_0x54a6b4){return function(_0x38c6e1){try{jsonpatch[_0x8b06('0x1e')](_0x38c6e1,_0x54a6b4,!![]);}catch(_0x1d8af3){return BPromise[_0x8b06('0x1f')](_0x1d8af3);}return _0x38c6e1['save']();};}function saveUpdates(_0x2ff684,_0x198695){return function(_0x3b8cbc){if(_0x3b8cbc){return _0x3b8cbc[_0x8b06('0x20')](_0x2ff684)[_0x8b06('0x21')](function(_0x4b5185){return _0x4b5185;});}return null;};}function removeEntity(_0x4a2053,_0x4fafb6){return function(_0x4ec229){if(_0x4ec229){return _0x4ec229[_0x8b06('0x22')]()[_0x8b06('0x21')](function(){_0x4a2053[_0x8b06('0x16')](0xcc)[_0x8b06('0x17')]();});}};}function handleEntityNotFound(_0x5a3002,_0x3eae93){return function(_0x182945){if(!_0x182945){_0x5a3002[_0x8b06('0x15')](0x194);}return _0x182945;};}function handleError(_0x58e4db,_0x519835){_0x519835=_0x519835||0x1f4;return function(_0x302fdd){logger[_0x8b06('0x23')](_0x302fdd['stack']);if(_0x302fdd[_0x8b06('0x24')]){delete _0x302fdd['name'];}_0x58e4db[_0x8b06('0x16')](_0x519835)['send'](_0x302fdd);};}exports[_0x8b06('0x25')]=function(_0xd064fa,_0x1a72e1){var _0x277fb7={},_0xa40238={},_0x40023c={'count':0x0,'rows':[]};var _0x224e4d=_[_0x8b06('0x26')](db[_0x8b06('0x27')][_0x8b06('0x28')],function(_0xcb4790){return{'name':_0xcb4790[_0x8b06('0x29')],'type':_0xcb4790[_0x8b06('0x2a')]['key']};});_0xa40238[_0x8b06('0x2b')]=_[_0x8b06('0x26')](_0x224e4d,_0x8b06('0x24'));_0xa40238[_0x8b06('0x2c')]=_[_0x8b06('0x2d')](_0xd064fa['query']);_0xa40238[_0x8b06('0x2e')]=_[_0x8b06('0x2f')](_0xa40238[_0x8b06('0x2b')],_0xa40238[_0x8b06('0x2c')]);_0x277fb7[_0x8b06('0x30')]=_[_0x8b06('0x2f')](_0xa40238[_0x8b06('0x2b')],qs['fields'](_0xd064fa[_0x8b06('0x2c')]['fields']));_0x277fb7[_0x8b06('0x30')]=_0x277fb7[_0x8b06('0x30')][_0x8b06('0x31')]?_0x277fb7[_0x8b06('0x30')]:_0xa40238[_0x8b06('0x2b')];if(!_0xd064fa['query']['hasOwnProperty'](_0x8b06('0x32'))){_0x277fb7[_0x8b06('0x33')]=qs[_0x8b06('0x33')](_0xd064fa[_0x8b06('0x2c')][_0x8b06('0x33')]);_0x277fb7[_0x8b06('0x19')]=qs[_0x8b06('0x19')](_0xd064fa['query']['offset']);}_0x277fb7[_0x8b06('0x34')]=qs['sort'](_0xd064fa[_0x8b06('0x2c')]['sort']);_0x277fb7[_0x8b06('0x35')]=qs[_0x8b06('0x2e')](_[_0x8b06('0x36')](_0xd064fa[_0x8b06('0x2c')],_0xa40238['filters']),_0x224e4d);if(_0xd064fa[_0x8b06('0x2c')][_0x8b06('0x37')]){_0x277fb7[_0x8b06('0x35')]=_[_0x8b06('0x38')](_0x277fb7[_0x8b06('0x35')],{'$or':_[_0x8b06('0x26')](_0x224e4d,function(_0x32739d){if(_0x32739d['type']!==_0x8b06('0x39')){var _0x24e782={};_0x24e782[_0x32739d[_0x8b06('0x24')]]={'$like':'%'+_0xd064fa[_0x8b06('0x2c')][_0x8b06('0x37')]+'%'};return _0x24e782;}})});}_0x277fb7=_[_0x8b06('0x38')]({},_0x277fb7,_0xd064fa['options']);var _0x523481={'where':_0x277fb7[_0x8b06('0x35')]};return db[_0x8b06('0x27')]['count'](_0x523481)[_0x8b06('0x21')](function(_0x433c2e){_0x40023c[_0x8b06('0x1b')]=_0x433c2e;if(_0xd064fa[_0x8b06('0x2c')]['includeAll']){_0x277fb7[_0x8b06('0x3a')]=[{'all':!![]}];}return db[_0x8b06('0x27')][_0x8b06('0x3b')](_0x277fb7);})[_0x8b06('0x21')](function(_0x551842){_0x40023c[_0x8b06('0x3c')]=_0x551842;return _0x40023c;})['then'](respondWithFilteredResult(_0x1a72e1,_0x277fb7))[_0x8b06('0x3d')](handleError(_0x1a72e1,null));};exports[_0x8b06('0x3e')]=function(_0x1558a0,_0x41df1d){var _0x27c3da={'raw':![],'where':{'id':_0x1558a0[_0x8b06('0x3f')]['id']}},_0x261698={};_0x261698['model']=_['keys'](db[_0x8b06('0x27')][_0x8b06('0x28')]);_0x261698[_0x8b06('0x2c')]=_['keys'](_0x1558a0[_0x8b06('0x2c')]);_0x261698[_0x8b06('0x2e')]=_[_0x8b06('0x2f')](_0x261698[_0x8b06('0x2b')],_0x261698[_0x8b06('0x2c')]);_0x27c3da[_0x8b06('0x30')]=_[_0x8b06('0x2f')](_0x261698[_0x8b06('0x2b')],qs[_0x8b06('0x40')](_0x1558a0['query']['fields']));_0x27c3da['attributes']=_0x27c3da[_0x8b06('0x30')][_0x8b06('0x31')]?_0x27c3da[_0x8b06('0x30')]:_0x261698['model'];if(_0x1558a0['query'][_0x8b06('0x41')]){_0x27c3da[_0x8b06('0x3a')]=[{'all':!![]}];}_0x27c3da=_[_0x8b06('0x38')]({},_0x27c3da,_0x1558a0[_0x8b06('0x42')]);return db[_0x8b06('0x27')][_0x8b06('0x43')](_0x27c3da)['then'](handleEntityNotFound(_0x41df1d,null))[_0x8b06('0x21')](respondWithResult(_0x41df1d,null))[_0x8b06('0x3d')](handleError(_0x41df1d,null));};exports['create']=function(_0x1f6896,_0x10b465){return db['ServicenowAccount'][_0x8b06('0x44')](_0x1f6896[_0x8b06('0x45')],{})[_0x8b06('0x21')](respondWithResult(_0x10b465,0xc9))['catch'](handleError(_0x10b465,null));};exports[_0x8b06('0x20')]=function(_0x3dd71d,_0x454391){if(_0x3dd71d[_0x8b06('0x45')]['id']){delete _0x3dd71d[_0x8b06('0x45')]['id'];}return db['ServicenowAccount'][_0x8b06('0x43')]({'where':{'id':_0x3dd71d[_0x8b06('0x3f')]['id']}})[_0x8b06('0x21')](handleEntityNotFound(_0x454391,null))[_0x8b06('0x21')](saveUpdates(_0x3dd71d['body'],null))['then'](respondWithResult(_0x454391,null))[_0x8b06('0x3d')](handleError(_0x454391,null));};exports[_0x8b06('0x22')]=function(_0x1a55d3,_0x2116c7){return db[_0x8b06('0x27')][_0x8b06('0x43')]({'where':{'id':_0x1a55d3[_0x8b06('0x3f')]['id']}})[_0x8b06('0x21')](handleEntityNotFound(_0x2116c7,null))['then'](removeEntity(_0x2116c7,null))[_0x8b06('0x3d')](handleError(_0x2116c7,null));};exports['getConfigurations']=function(_0x54575d,_0x1571bb,_0x3a093b){var _0x54d60c={};var _0x3d2de6={};var _0x4086f4;var _0x21a188;return db[_0x8b06('0x27')][_0x8b06('0x46')]({'where':{'id':_0x54575d['params']['id']}})[_0x8b06('0x21')](handleEntityNotFound(_0x1571bb,null))['then'](function(_0x3ec9ec){if(_0x3ec9ec){_0x4086f4=_0x3ec9ec;_0x3d2de6[_0x8b06('0x2b')]=_[_0x8b06('0x2d')](db[_0x8b06('0x47')][_0x8b06('0x28')]);_0x3d2de6['query']=_['keys'](_0x54575d['query']);_0x3d2de6[_0x8b06('0x2e')]=_['intersection'](_0x3d2de6['model'],_0x3d2de6[_0x8b06('0x2c')]);_0x54d60c['attributes']=_[_0x8b06('0x2f')](_0x3d2de6[_0x8b06('0x2b')],qs[_0x8b06('0x40')](_0x54575d[_0x8b06('0x2c')]['fields']));_0x54d60c['attributes']=_0x54d60c[_0x8b06('0x30')][_0x8b06('0x31')]?_0x54d60c[_0x8b06('0x30')]:_0x3d2de6[_0x8b06('0x2b')];_0x54d60c[_0x8b06('0x34')]=qs[_0x8b06('0x48')](_0x54575d[_0x8b06('0x2c')][_0x8b06('0x48')]);_0x54d60c[_0x8b06('0x35')]=qs[_0x8b06('0x2e')](_[_0x8b06('0x36')](_0x54575d[_0x8b06('0x2c')],_0x3d2de6[_0x8b06('0x2e')]));if(_0x54575d[_0x8b06('0x2c')][_0x8b06('0x37')]){_0x54d60c['where']=_[_0x8b06('0x38')](_0x54d60c[_0x8b06('0x35')],{'$or':_[_0x8b06('0x26')](_0x54d60c['attributes'],function(_0x4b43d9){var _0xc16005={};_0xc16005[_0x4b43d9]={'$like':'%'+_0x54575d[_0x8b06('0x2c')][_0x8b06('0x37')]+'%'};return _0xc16005;})});}_0x54d60c=_[_0x8b06('0x38')]({},_0x54d60c,_0x54575d['options']);return _0x4086f4[_0x8b06('0x49')](_0x54d60c);}})[_0x8b06('0x21')](function(_0x1dc739){if(_0x1dc739){_0x21a188=_0x1dc739[_0x8b06('0x31')];if(!_0x54575d[_0x8b06('0x2c')][_0x8b06('0x4a')]('nolimit')){_0x54d60c[_0x8b06('0x33')]=qs[_0x8b06('0x33')](_0x54575d[_0x8b06('0x2c')][_0x8b06('0x33')]);_0x54d60c['offset']=qs['offset'](_0x54575d['query'][_0x8b06('0x19')]);}return _0x4086f4[_0x8b06('0x49')](_0x54d60c);}})['then'](function(_0x4815d5){if(_0x4815d5){return _0x4815d5?{'count':_0x21a188,'rows':_0x4815d5}:null;}})[_0x8b06('0x21')](respondWithResult(_0x1571bb,null))['catch'](handleError(_0x1571bb,null));};exports[_0x8b06('0x4b')]=function(_0x3d2571,_0x3e6009,_0x563ee6){if(_0x3d2571[_0x8b06('0x45')]['id']){delete _0x3d2571[_0x8b06('0x45')]['id'];}return db[_0x8b06('0x27')][_0x8b06('0x46')]({'where':{'id':_0x3d2571[_0x8b06('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3e6009,null))[_0x8b06('0x21')](function(_0x39b600){if(_0x39b600){_0x3d2571['body'][_0x8b06('0x4c')]=_0x39b600['id'];_0x3d2571[_0x8b06('0x45')][_0x8b06('0x4d')]=integrations['getSubjects'](_0x3d2571[_0x8b06('0x45')]['channel'],_0x3d2571[_0x8b06('0x45')][_0x8b06('0x2a')]);_0x3d2571['body'][_0x8b06('0x4e')]=integrations[_0x8b06('0x4f')](_0x3d2571[_0x8b06('0x45')]['channel'],_0x3d2571[_0x8b06('0x45')][_0x8b06('0x2a')]);return db['ServicenowConfiguration']['create'](_0x3d2571[_0x8b06('0x45')],{'include':[{'model':db[_0x8b06('0x50')],'as':'Subjects'},{'model':db[_0x8b06('0x50')],'as':_0x8b06('0x4e')}]});}return null;})[_0x8b06('0x21')](respondWithResult(_0x3e6009,null))[_0x8b06('0x3d')](handleError(_0x3e6009,null));};exports[_0x8b06('0x51')]=function(_0x373142,_0x206f5c,_0x19f30f){var _0x15a9de=[_0x8b06('0x52'),_0x8b06('0x53'),_0x8b06('0x54'),_0x8b06('0x55'),_0x8b06('0x56'),_0x8b06('0x57'),_0x8b06('0x58'),_0x8b06('0x59'),'category'];var _0x5108e4=[_0x8b06('0x5a'),'made_sla',_0x8b06('0x5b'),_0x8b06('0x5c'),_0x8b06('0x5d'),_0x8b06('0x5e'),'child_incidents',_0x8b06('0x53'),_0x8b06('0x5f'),'number',_0x8b06('0x60'),_0x8b06('0x61'),_0x8b06('0x62'),_0x8b06('0x63'),_0x8b06('0x64'),_0x8b06('0x65'),'state','sys_created_by','knowledge',_0x8b06('0x34'),_0x8b06('0x66'),_0x8b06('0x67'),'cmdb_ci','delivery_plan',_0x8b06('0x68'),_0x8b06('0x69'),'work_notes_list',_0x8b06('0x6a'),_0x8b06('0x6b'),_0x8b06('0x6c'),_0x8b06('0x6d'),_0x8b06('0x6e'),'expected_start',_0x8b06('0x6f'),_0x8b06('0x70'),'group_list',_0x8b06('0x71'),_0x8b06('0x72'),'resolved_at',_0x8b06('0x73'),_0x8b06('0x74'),_0x8b06('0x55'),_0x8b06('0x75'),_0x8b06('0x76'),'close_code','correlation_display',_0x8b06('0x77'),'work_start',_0x8b06('0x78'),_0x8b06('0x79'),_0x8b06('0x7a'),_0x8b06('0x7b'),'calendar_duration',_0x8b06('0x57'),_0x8b06('0x7c'),_0x8b06('0x7d'),_0x8b06('0x7e'),_0x8b06('0x7f'),'parent_incident',_0x8b06('0x80'),_0x8b06('0x81'),_0x8b06('0x82'),'incident_state',_0x8b06('0x83'),_0x8b06('0x84'),_0x8b06('0x85'),_0x8b06('0x86'),'activity_due','assigned_to',_0x8b06('0x59'),_0x8b06('0x87'),_0x8b06('0x88'),_0x8b06('0x89'),'comments_and_work_notes',_0x8b06('0x8a'),_0x8b06('0x8b'),_0x8b06('0x8c'),_0x8b06('0x8d'),_0x8b06('0x8e'),'upon_approval',_0x8b06('0x8f'),_0x8b06('0x90'),_0x8b06('0x91')];var _0xdf26a0='';var _0xf13dce='';var _0x203779=[];var _0x4efc00='';var _0x4527b0='';var _0x2d4fb7=[];var _0x37f36d='';var _0x3c5be5='';var _0x36deb8={};var _0x2d8c7e='';return db[_0x8b06('0x27')][_0x8b06('0x46')]({'where':{'id':_0x373142['params']['id']},'attributes':['id','username',_0x8b06('0x92'),_0x8b06('0x93'),_0x8b06('0x94'),_0x8b06('0x95')]})[_0x8b06('0x21')](handleEntityNotFound(_0x206f5c,null))[_0x8b06('0x21')](function(_0x55e956){if(_0x55e956){_0x2d8c7e=_0x55e956['remoteUri'];var _0x13cac3=_0x2d8c7e[_0x8b06('0x96')](-0x1);if(_0x13cac3==='/'){_0x2d8c7e=_0x2d8c7e[_0x8b06('0x97')](0x0,_0x2d8c7e['lastIndexOf'](_0x13cac3));}_0x3c5be5=util[_0x8b06('0x98')]('%s/api/now/doc/table/schema/',_0x2d8c7e);_0x37f36d=util[_0x8b06('0x98')](_0x8b06('0x99'),_0x2d8c7e);_0x36deb8={'user':_0x55e956[_0x8b06('0x9a')],'pass':_0x55e956[_0x8b06('0x92')]};var _0x24e7ee={'method':'GET','uri':_0x3c5be5+_0x8b06('0x9b'),'auth':_0x36deb8,'json':!![]};return rp(_0x24e7ee);}})['then'](function(_0x5a41d8){if(_0x5a41d8[_0x8b06('0x9c')]['length']>0x0){_0xdf26a0=_0x5a41d8['result'];}console['log'](_0x8b06('0x9d'),_0xdf26a0);_0x2d4fb7=[];_0xf13dce=Object[_0x8b06('0x9e')]([],_0xdf26a0);_[_0x8b06('0x9f')](_0xf13dce,function(_0x3e7047){return!_0x15a9de[_0x8b06('0xa0')](_0x3e7047['name']);});_0xf13dce[_0x8b06('0xa1')](function(_0x142be6){var _0x5e1ecd=createFieldObject(_0x37f36d,_0x36deb8,_0x142be6[_0x8b06('0xa2')],_0x142be6[_0x8b06('0x24')],_0x142be6[_0x8b06('0xa3')],![]);_0x2d4fb7[_0x8b06('0xa4')](_0x5e1ecd);});return Promise['all'](_0x2d4fb7);})[_0x8b06('0x21')](function(_0x313ff7){_0x203779=_0x313ff7;_0x4efc00=Object[_0x8b06('0x9e')]([],_0xdf26a0);console[_0x8b06('0xa5')](_0x8b06('0xa6'),_0xdf26a0);_['remove'](_0x4efc00,function(_0x5f5883){return _0x5108e4['includes'](_0x5f5883[_0x8b06('0x24')]);});console['log'](_0x8b06('0xa7'),_0x4efc00);_0x2d4fb7=[];_0x4efc00[_0x8b06('0xa1')](function(_0x34a5ad){var _0x2f0c3c=createFieldObject(_0x37f36d,_0x36deb8,_0x34a5ad[_0x8b06('0xa2')],_0x34a5ad[_0x8b06('0x24')],_0x34a5ad[_0x8b06('0xa3')],!![]);_0x2d4fb7[_0x8b06('0xa4')](_0x2f0c3c);});return Promise[_0x8b06('0xa8')](_0x2d4fb7);})[_0x8b06('0x21')](function(_0x3ff2fc){_0x4527b0=_0x3ff2fc;var _0xb50af=_0x203779[_0x8b06('0xa9')](_0x4527b0);return{'count':_0xb50af[_0x8b06('0x31')],'rows':_0xb50af};})['then'](respondWithResult(_0x206f5c,null))[_0x8b06('0x3d')](function(_0x5f51e3){console[_0x8b06('0xa5')](_0x8b06('0xaa')+_0x5f51e3);var _0xc3fb43=_0x373142[_0x8b06('0x2c')]['test']?0x1f4:_0x5f51e3['statusCode']||0x1f4;logger[_0x8b06('0x23')](_0x5f51e3[_0x8b06('0xab')]);delete _0x5f51e3[_0x8b06('0x24')];if(_0xc3fb43===0x191){_0xc3fb43=0x190;}_0x206f5c[_0x8b06('0x16')](_0xc3fb43)['send'](_0x373142[_0x8b06('0x2c')][_0x8b06('0xac')]?{'message':_0x8b06('0xad'),'statusCode':_0x5f51e3[_0x8b06('0xae')]}:_0x5f51e3);});};function createFieldObject(_0x2556b6,_0x55f3dc,_0x4e2a21,_0x12156,_0xf555fe,_0x2f65d4){return new Promise(function(_0x351656,_0x2d44ae){var _0x57a6b7={'id':_0x12156,'name':_0xf555fe,'custom':_0x2f65d4};if(_0x4e2a21===_0x8b06('0xaf')){_0x57a6b7[_0x8b06('0x42')]=[{'name':_0x8b06('0xb0'),'value':'true'},{'name':_0x8b06('0xb1'),'value':'false'}];_0x351656(_0x57a6b7);}else{var _0x2c647d={'method':'GET','uri':_0x2556b6+_0x8b06('0xb2')+_0x12156,'auth':_0x55f3dc,'json':!![]};return rp(_0x2c647d)[_0x8b06('0x21')](function(_0x2d79c3){var _0x120bd7=[];if(_0x2d79c3['result'][_0x8b06('0x31')]>0x0){_0x2d79c3['result'][_0x8b06('0xa1')](function(_0x34c8e8){if(_0x34c8e8[_0x8b06('0xb3')]==='false'){var _0x14f415={'name':_0x34c8e8['label'],'value':_0x34c8e8['value']};_0x120bd7['push'](_0x14f415);}});}_0x57a6b7[_0x8b06('0x42')]=_0x120bd7;if(_0x57a6b7['options'][_0x8b06('0x31')]>0x0){_0x351656(_0x57a6b7);}else{if(_0x2f65d4==![]){_0x351656();}else{_0x351656(_0x57a6b7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 9d77207..8af184a 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 _0x4c60=['exports','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x24bb78,_0x17a064){var _0x3ed4fc=function(_0x4eba0b){while(--_0x4eba0b){_0x24bb78['push'](_0x24bb78['shift']());}};_0x3ed4fc(++_0x17a064);}(_0x4c60,0xc1));var _0x04c6=function(_0x2bafca,_0x17f400){_0x2bafca=_0x2bafca-0x0;var _0x1eccfe=_0x4c60[_0x2bafca];return _0x1eccfe;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));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(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee14=['ServicenowAccount','int_servicenow_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define'];(function(_0x42b282,_0x44d8af){var _0x14e6c4=function(_0x52cde8){while(--_0x52cde8){_0x42b282['push'](_0x42b282['shift']());}};_0x14e6c4(++_0x44d8af);}(_0xee14,0x13a));var _0x4ee1=function(_0x1238b3,_0x4591d8){_0x1238b3=_0x1238b3-0x0;var _0x9352bb=_0xee14[_0x1238b3];return _0x9352bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var BPromise=require(_0x4ee1('0x3'));var rp=require(_0x4ee1('0x4'));var fs=require('fs');var path=require(_0x4ee1('0x5'));var rimraf=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var attributes=require(_0x4ee1('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4ee1('0x9')]=function(_0x573700,_0x327c18){return _0x573700[_0x4ee1('0xa')](_0x4ee1('0xb'),attributes,{'tableName':_0x4ee1('0xc'),'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 4a505d3..236514e 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 _0x528f=['ioredis','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','model','include','map','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x528f,0xe9));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf528('0x0'));var util=require(_0xf528('0x1'));var moment=require(_0xf528('0x2'));var BPromise=require(_0xf528('0x3'));var rs=require(_0xf528('0x4'));var fs=require('fs');var Redis=require(_0xf528('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf528('0x6'));var logger=require(_0xf528('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf528('0x8')][_0xf528('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32a499,_0xd8f703,_0x25349b){return new BPromise(function(_0x4b8418,_0x4d06ad){return client[_0xf528('0xa')](_0x32a499,_0x25349b)[_0xf528('0xb')](function(_0x4508f3){logger[_0xf528('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0xd8f703,_0xf528('0xd'));logger[_0xf528('0xe')](_0xf528('0xf'),_0xd8f703,_0xf528('0xd'),JSON[_0xf528('0x10')](_0x4508f3));if(_0x4508f3[_0xf528('0x11')]){if(_0x4508f3[_0xf528('0x11')][_0xf528('0x12')]===0x1f4){logger[_0xf528('0x11')](_0xf528('0x13'),_0xd8f703,_0x4508f3[_0xf528('0x11')][_0xf528('0x14')]);return _0x4d06ad(_0x4508f3[_0xf528('0x11')][_0xf528('0x14')]);}logger[_0xf528('0x11')](_0xf528('0x13'),_0xd8f703,_0x4508f3['error'][_0xf528('0x14')]);return _0x4b8418(_0x4508f3[_0xf528('0x11')]['message']);}else{logger['info'](_0xf528('0x13'),_0xd8f703,_0xf528('0xd'));_0x4b8418(_0x4508f3['result'][_0xf528('0x14')]);}})[_0xf528('0x15')](function(_0x474c18){logger[_0xf528('0x11')](_0xf528('0x13'),_0xd8f703,_0x474c18);_0x4d06ad(_0x474c18);});});}exports[_0xf528('0x16')]=function(_0x4dd248){var _0x632ce0=this;return new Promise(function(_0x1f9ad8,_0x3ecb8d){return db[_0xf528('0x17')][_0xf528('0x18')]({'raw':_0x4dd248[_0xf528('0x19')]?_0x4dd248[_0xf528('0x19')][_0xf528('0x1a')]===undefined?!![]:![]:!![],'where':_0x4dd248[_0xf528('0x19')]?_0x4dd248[_0xf528('0x19')][_0xf528('0x1b')]||null:null,'attributes':_0x4dd248['options']?_0x4dd248['options'][_0xf528('0x1c')]||null:null,'limit':_0x4dd248[_0xf528('0x19')]?_0x4dd248[_0xf528('0x19')]['limit']||null:null,'include':_0x4dd248['options']?_0x4dd248['options']['include']?_['map'](_0x4dd248[_0xf528('0x19')]['include'],function(_0x4183d2){return{'model':db[_0x4183d2[_0xf528('0x1d')]],'as':_0x4183d2['as'],'attributes':_0x4183d2[_0xf528('0x1c')],'include':_0x4183d2[_0xf528('0x1e')]?_['map'](_0x4183d2[_0xf528('0x1e')],function(_0x16bd26){return{'model':db[_0x16bd26[_0xf528('0x1d')]],'as':_0x16bd26['as'],'attributes':_0x16bd26[_0xf528('0x1c')],'include':_0x16bd26['include']?_[_0xf528('0x1f')](_0x16bd26['include'],function(_0x3566a9){return{'model':db[_0x3566a9[_0xf528('0x1d')]],'as':_0x3566a9['as'],'attributes':_0x3566a9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1158cf){logger[_0xf528('0xc')](_0xf528('0x16'),_0x4dd248);logger[_0xf528('0xe')](_0xf528('0x16'),_0x4dd248,JSON['stringify'](_0x1158cf));_0x1f9ad8(_0x1158cf);})[_0xf528('0x15')](function(_0x91bf73){logger[_0xf528('0x11')](_0xf528('0x16'),_0x91bf73[_0xf528('0x14')],_0x4dd248);_0x3ecb8d(_0x632ce0[_0xf528('0x11')](0x1f4,_0x91bf73[_0xf528('0x14')]));});});};exports[_0xf528('0x20')]=function(_0x239b76){var _0x2ec811=this;return new Promise(function(_0xfcf545,_0x2e82df){return db[_0xf528('0x17')][_0xf528('0x21')]({'raw':_0x239b76[_0xf528('0x19')]?_0x239b76[_0xf528('0x19')][_0xf528('0x1a')]===undefined?!![]:![]:!![],'where':_0x239b76[_0xf528('0x19')]?_0x239b76['options'][_0xf528('0x1b')]||null:null,'attributes':_0x239b76[_0xf528('0x19')]?_0x239b76['options'][_0xf528('0x1c')]||null:null,'include':_0x239b76[_0xf528('0x19')]?_0x239b76['options']['include']?_[_0xf528('0x1f')](_0x239b76[_0xf528('0x19')][_0xf528('0x1e')],function(_0x651e45){return{'model':db[_0x651e45[_0xf528('0x1d')]],'as':_0x651e45['as'],'attributes':_0x651e45[_0xf528('0x1c')],'include':_0x651e45[_0xf528('0x1e')]?_[_0xf528('0x1f')](_0x651e45[_0xf528('0x1e')],function(_0x30e992){return{'model':db[_0x30e992[_0xf528('0x1d')]],'as':_0x30e992['as'],'attributes':_0x30e992['attributes'],'include':_0x30e992['include']?_[_0xf528('0x1f')](_0x30e992[_0xf528('0x1e')],function(_0x4c46d0){return{'model':db[_0x4c46d0[_0xf528('0x1d')]],'as':_0x4c46d0['as'],'attributes':_0x4c46d0[_0xf528('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf528('0xb')](function(_0x1f9043){logger[_0xf528('0xc')](_0xf528('0x20'),_0x239b76);logger['debug'](_0xf528('0x20'),_0x239b76,JSON[_0xf528('0x10')](_0x1f9043));_0xfcf545(_0x1f9043);})[_0xf528('0x15')](function(_0x5ef47d){logger[_0xf528('0x11')](_0xf528('0x20'),_0x5ef47d[_0xf528('0x14')],_0x239b76);_0x2e82df(_0x2ec811['error'](0x1f4,_0x5ef47d[_0xf528('0x14')]));});});}; \ No newline at end of file +var _0x1c99=['raw','attributes','limit','include','map','model','then','debug','GetServicenowAccount','ShowServicenowAccount','find','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','error','code','message','catch','ServicenowAccount','findAll','options'];(function(_0x204446,_0xd2e760){var _0x1e1339=function(_0x46ea70){while(--_0x46ea70){_0x204446['push'](_0x204446['shift']());}};_0x1e1339(++_0xd2e760);}(_0x1c99,0x19f));var _0x91c9=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x1c99[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x91c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x91c9('0x1'));var rs=require(_0x91c9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91c9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x91c9('0x4'))(_0x91c9('0x5'));var config=require('../../config/environment');var jayson=require(_0x91c9('0x6'));var client=jayson[_0x91c9('0x7')][_0x91c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40479b,_0x54dc4c,_0x304f5e){return new BPromise(function(_0x39d280,_0x35fb74){return client['request'](_0x40479b,_0x304f5e)['then'](function(_0x52b6b7){logger[_0x91c9('0x9')](_0x91c9('0xa'),_0x54dc4c,_0x91c9('0xb'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x54dc4c,'request\x20sent',JSON['stringify'](_0x52b6b7));if(_0x52b6b7[_0x91c9('0xc')]){if(_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xd')]===0x1f4){logger[_0x91c9('0xc')](_0x91c9('0xa'),_0x54dc4c,_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xe')]);return _0x35fb74(_0x52b6b7[_0x91c9('0xc')]['message']);}logger[_0x91c9('0xc')](_0x91c9('0xa'),_0x54dc4c,_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xe')]);return _0x39d280(_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xe')]);}else{logger[_0x91c9('0x9')]('ServicenowAccount,\x20%s,\x20%s',_0x54dc4c,_0x91c9('0xb'));_0x39d280(_0x52b6b7['result'][_0x91c9('0xe')]);}})[_0x91c9('0xf')](function(_0x528067){logger[_0x91c9('0xc')](_0x91c9('0xa'),_0x54dc4c,_0x528067);_0x35fb74(_0x528067);});});}exports['GetServicenowAccount']=function(_0x49d9e8){var _0x1afbf5=this;return new Promise(function(_0x4993d0,_0x40dd89){return db[_0x91c9('0x10')][_0x91c9('0x11')]({'raw':_0x49d9e8[_0x91c9('0x12')]?_0x49d9e8[_0x91c9('0x12')][_0x91c9('0x13')]===undefined?!![]:![]:!![],'where':_0x49d9e8[_0x91c9('0x12')]?_0x49d9e8[_0x91c9('0x12')]['where']||null:null,'attributes':_0x49d9e8[_0x91c9('0x12')]?_0x49d9e8['options'][_0x91c9('0x14')]||null:null,'limit':_0x49d9e8[_0x91c9('0x12')]?_0x49d9e8[_0x91c9('0x12')][_0x91c9('0x15')]||null:null,'include':_0x49d9e8[_0x91c9('0x12')]?_0x49d9e8[_0x91c9('0x12')][_0x91c9('0x16')]?_[_0x91c9('0x17')](_0x49d9e8[_0x91c9('0x12')][_0x91c9('0x16')],function(_0x1084ca){return{'model':db[_0x1084ca[_0x91c9('0x18')]],'as':_0x1084ca['as'],'attributes':_0x1084ca[_0x91c9('0x14')],'include':_0x1084ca[_0x91c9('0x16')]?_[_0x91c9('0x17')](_0x1084ca['include'],function(_0x181cbe){return{'model':db[_0x181cbe[_0x91c9('0x18')]],'as':_0x181cbe['as'],'attributes':_0x181cbe['attributes'],'include':_0x181cbe[_0x91c9('0x16')]?_[_0x91c9('0x17')](_0x181cbe['include'],function(_0xd96d51){return{'model':db[_0xd96d51[_0x91c9('0x18')]],'as':_0xd96d51['as'],'attributes':_0xd96d51['attributes']};}):[]};}):[]};}):[]:[]})[_0x91c9('0x19')](function(_0x4858ff){logger['info']('GetServicenowAccount',_0x49d9e8);logger[_0x91c9('0x1a')](_0x91c9('0x1b'),_0x49d9e8,JSON['stringify'](_0x4858ff));_0x4993d0(_0x4858ff);})[_0x91c9('0xf')](function(_0x580db0){logger[_0x91c9('0xc')]('GetServicenowAccount',_0x580db0['message'],_0x49d9e8);_0x40dd89(_0x1afbf5[_0x91c9('0xc')](0x1f4,_0x580db0[_0x91c9('0xe')]));});});};exports[_0x91c9('0x1c')]=function(_0x57a4f1){var _0x14295f=this;return new Promise(function(_0x2714fa,_0x1d1bfe){return db[_0x91c9('0x10')][_0x91c9('0x1d')]({'raw':_0x57a4f1['options']?_0x57a4f1[_0x91c9('0x12')][_0x91c9('0x13')]===undefined?!![]:![]:!![],'where':_0x57a4f1[_0x91c9('0x12')]?_0x57a4f1['options']['where']||null:null,'attributes':_0x57a4f1[_0x91c9('0x12')]?_0x57a4f1[_0x91c9('0x12')][_0x91c9('0x14')]||null:null,'include':_0x57a4f1[_0x91c9('0x12')]?_0x57a4f1['options'][_0x91c9('0x16')]?_[_0x91c9('0x17')](_0x57a4f1[_0x91c9('0x12')][_0x91c9('0x16')],function(_0x2c5c9d){return{'model':db[_0x2c5c9d['model']],'as':_0x2c5c9d['as'],'attributes':_0x2c5c9d[_0x91c9('0x14')],'include':_0x2c5c9d['include']?_['map'](_0x2c5c9d['include'],function(_0x3c24a2){return{'model':db[_0x3c24a2[_0x91c9('0x18')]],'as':_0x3c24a2['as'],'attributes':_0x3c24a2['attributes'],'include':_0x3c24a2['include']?_[_0x91c9('0x17')](_0x3c24a2[_0x91c9('0x16')],function(_0x53b1a1){return{'model':db[_0x53b1a1['model']],'as':_0x53b1a1['as'],'attributes':_0x53b1a1[_0x91c9('0x14')]};}):[]};}):[]};}):[]:[]})[_0x91c9('0x19')](function(_0x1ac20c){logger[_0x91c9('0x9')]('ShowServicenowAccount',_0x57a4f1);logger['debug']('ShowServicenowAccount',_0x57a4f1,JSON[_0x91c9('0x1e')](_0x1ac20c));_0x2714fa(_0x1ac20c);})[_0x91c9('0xf')](function(_0x53f7b1){logger[_0x91c9('0xc')](_0x91c9('0x1c'),_0x53f7b1[_0x91c9('0xe')],_0x57a4f1);_0x1d1bfe(_0x14295f['error'](0x1f4,_0x53f7b1[_0x91c9('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7f0cfd1..36d215b 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 _0xa356=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0xa356,0x1e7));var _0x6a35=function(_0x45de41,_0x23a8d6){_0x45de41=_0x45de41-0x0;var _0x2a79cb=_0xa356[_0x45de41];return _0x2a79cb;};'use strict';var multer=require(_0x6a35('0x0'));var util=require(_0x6a35('0x1'));var path=require('path');var timeout=require(_0x6a35('0x2'));var express=require(_0x6a35('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a35('0x4'));var interaction=require(_0x6a35('0x5'));var config=require('../../config/environment');var controller=require(_0x6a35('0x6'));router[_0x6a35('0x7')]('/',auth[_0x6a35('0x8')](),controller[_0x6a35('0x9')]);router['get'](_0x6a35('0xa'),auth[_0x6a35('0x8')](),controller[_0x6a35('0xb')]);router[_0x6a35('0x7')](_0x6a35('0xc'),auth[_0x6a35('0x8')](),controller[_0x6a35('0xd')]);router['get'](_0x6a35('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x6a35('0xf'),auth['isAuthenticated'](),controller[_0x6a35('0x10')]);router[_0x6a35('0x11')]('/',auth[_0x6a35('0x8')](),controller[_0x6a35('0x12')]);router[_0x6a35('0x13')](_0x6a35('0xa'),auth[_0x6a35('0x8')](),controller[_0x6a35('0x14')]);router[_0x6a35('0x15')](_0x6a35('0xa'),auth[_0x6a35('0x8')](),controller[_0x6a35('0x16')]);module[_0x6a35('0x17')]=router; \ No newline at end of file +var _0x1916=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','path','express','Router'];(function(_0x26659f,_0x32f426){var _0x42667f=function(_0xdc0b71){while(--_0xdc0b71){_0x26659f['push'](_0x26659f['shift']());}};_0x42667f(++_0x32f426);}(_0x1916,0x9d));var _0x6191=function(_0x1746b4,_0x2bd96e){_0x1746b4=_0x1746b4-0x0;var _0x5b7409=_0x1916[_0x1746b4];return _0x5b7409;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6191('0x0'));var timeout=require('connect-timeout');var express=require(_0x6191('0x1'));var router=express[_0x6191('0x2')]();var fs_extra=require(_0x6191('0x3'));var auth=require(_0x6191('0x4'));var interaction=require(_0x6191('0x5'));var config=require(_0x6191('0x6'));var controller=require(_0x6191('0x7'));router[_0x6191('0x8')]('/',auth['isAuthenticated'](),controller[_0x6191('0x9')]);router['get'](_0x6191('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6191('0x8')]('/:id/fields',auth[_0x6191('0xb')](),controller['getFields']);router[_0x6191('0x8')](_0x6191('0xc'),auth[_0x6191('0xb')](),controller[_0x6191('0xd')]);router[_0x6191('0x8')](_0x6191('0xe'),auth[_0x6191('0xb')](),controller[_0x6191('0xf')]);router[_0x6191('0x10')]('/',auth[_0x6191('0xb')](),controller[_0x6191('0x11')]);router['put'](_0x6191('0xa'),auth[_0x6191('0xb')](),controller[_0x6191('0x12')]);router['delete'](_0x6191('0xa'),auth[_0x6191('0xb')](),controller[_0x6191('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ce7646f..8eec731 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 _0xbda3=['sequelize','exports','STRING'];(function(_0xe4993b,_0x53eb12){var _0x4b62fe=function(_0x2842ae){while(--_0x2842ae){_0xe4993b['push'](_0xe4993b['shift']());}};_0x4b62fe(++_0x53eb12);}(_0xbda3,0x195));var _0x3bda=function(_0x5bffeb,_0x15d734){_0x5bffeb=_0x5bffeb-0x0;var _0x311437=_0xbda3[_0x5bffeb];return _0x311437;};'use strict';var Sequelize=require(_0x3bda('0x0'));module[_0x3bda('0x1')]={'name':{'type':Sequelize[_0x3bda('0x2')]},'description':{'type':Sequelize[_0x3bda('0x2')]}}; \ No newline at end of file +var _0xce99=['exports','STRING'];(function(_0x49524a,_0x4d5439){var _0x12a7b8=function(_0x290b0d){while(--_0x290b0d){_0x49524a['push'](_0x49524a['shift']());}};_0x12a7b8(++_0x4d5439);}(_0xce99,0x134));var _0x9ce9=function(_0xd28890,_0x249d9f){_0xd28890=_0xd28890-0x0;var _0x2a9284=_0xce99[_0xd28890];return _0x2a9284;};'use strict';var Sequelize=require('sequelize');module[_0x9ce9('0x0')]={'name':{'type':Sequelize[_0x9ce9('0x1')]},'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 b34cdb3..96e8a77 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 _0x83b3=['../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','include','rows','catch','params','find','body','getFields','findOne','map','merge','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0xfc572a,_0x8161b6){var _0x2d7f7b=function(_0xc25bc8){while(--_0xc25bc8){_0xfc572a['push'](_0xfc572a['shift']());}};_0x2d7f7b(++_0x8161b6);}(_0x83b3,0x17c));var _0x383b=function(_0x5c7142,_0x34a9cd){_0x5c7142=_0x5c7142-0x0;var _0x4fb181=_0x83b3[_0x5c7142];return _0x4fb181;};'use strict';var emlformat=require(_0x383b('0x0'));var rimraf=require(_0x383b('0x1'));var zipdir=require(_0x383b('0x2'));var jsonpatch=require(_0x383b('0x3'));var rp=require(_0x383b('0x4'));var moment=require(_0x383b('0x5'));var BPromise=require(_0x383b('0x6'));var Mustache=require(_0x383b('0x7'));var util=require(_0x383b('0x8'));var path=require(_0x383b('0x9'));var sox=require(_0x383b('0xa'));var csv=require('to-csv');var ejs=require(_0x383b('0xb'));var fs=require('fs');var fs_extra=require(_0x383b('0xc'));var _=require(_0x383b('0xd'));var squel=require(_0x383b('0xe'));var crypto=require(_0x383b('0xf'));var jsforce=require(_0x383b('0x10'));var deskjs=require(_0x383b('0x11'));var toCsv=require(_0x383b('0x12'));var querystring=require(_0x383b('0x13'));var Papa=require(_0x383b('0x14'));var Redis=require('ioredis');var authService=require(_0x383b('0x15'));var qs=require(_0x383b('0x16'));var as=require(_0x383b('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x383b('0x18'));var utils=require(_0x383b('0x19'));var config=require(_0x383b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x383b('0x1b'))['db'];function respondWithStatusCode(_0x3c78f7,_0x35e369){_0x35e369=_0x35e369||0xcc;return function(_0x1f0503){if(_0x1f0503){return _0x3c78f7['sendStatus'](_0x35e369);}return _0x3c78f7[_0x383b('0x1c')](_0x35e369)[_0x383b('0x1d')]();};}function respondWithResult(_0x12966b,_0x449bc9){_0x449bc9=_0x449bc9||0xc8;return function(_0xb14a81){if(_0xb14a81){return _0x12966b[_0x383b('0x1c')](_0x449bc9)['json'](_0xb14a81);}};}function respondWithFilteredResult(_0x3015d8,_0x48bceb){return function(_0x388a03){if(_0x388a03){var _0x43a40d=typeof _0x48bceb[_0x383b('0x1e')]===_0x383b('0x1f')&&typeof _0x48bceb[_0x383b('0x20')]===_0x383b('0x1f');var _0x1eb9a3=_0x388a03[_0x383b('0x21')];var _0x3eae26=_0x43a40d?0x0:_0x48bceb[_0x383b('0x1e')];var _0x123f64=_0x43a40d?_0x388a03[_0x383b('0x21')]:_0x48bceb[_0x383b('0x1e')]+_0x48bceb[_0x383b('0x20')];var _0x5b6281;if(_0x123f64>=_0x1eb9a3){_0x123f64=_0x1eb9a3;_0x5b6281=0xc8;}else{_0x5b6281=0xce;}_0x3015d8['status'](_0x5b6281);return _0x3015d8[_0x383b('0x22')](_0x383b('0x23'),_0x3eae26+'-'+_0x123f64+'/'+_0x1eb9a3)[_0x383b('0x24')](_0x388a03);}return null;};}function patchUpdates(_0x29053d){return function(_0x9bfe38){try{jsonpatch[_0x383b('0x25')](_0x9bfe38,_0x29053d,!![]);}catch(_0x23186e){return BPromise[_0x383b('0x26')](_0x23186e);}return _0x9bfe38['save']();};}function saveUpdates(_0x28f51b,_0x30b51b){return function(_0x1cb0e6){if(_0x1cb0e6){return _0x1cb0e6['update'](_0x28f51b)[_0x383b('0x27')](function(_0x55f6f2){return _0x55f6f2;});}return null;};}function removeEntity(_0x10013d,_0x288fc1){return function(_0x2497dd){if(_0x2497dd){return _0x2497dd['destroy']()['then'](function(){_0x10013d[_0x383b('0x1c')](0xcc)[_0x383b('0x1d')]();});}};}function handleEntityNotFound(_0x171af2,_0x5c2234){return function(_0x5c9fe3){if(!_0x5c9fe3){_0x171af2[_0x383b('0x28')](0x194);}return _0x5c9fe3;};}function handleError(_0x152f8d,_0x4c08bc){_0x4c08bc=_0x4c08bc||0x1f4;return function(_0x86068e){logger[_0x383b('0x29')](_0x86068e[_0x383b('0x2a')]);if(_0x86068e[_0x383b('0x2b')]){delete _0x86068e[_0x383b('0x2b')];}_0x152f8d[_0x383b('0x1c')](_0x4c08bc)[_0x383b('0x2c')](_0x86068e);};}exports[_0x383b('0x2d')]=function(_0x5a7a52,_0xdfc439){var _0x197fe4={},_0x53715c={},_0x19f1b2={'count':0x0,'rows':[]};var _0x21c7ef=_['map'](db[_0x383b('0x2e')][_0x383b('0x2f')],function(_0x36e757){return{'name':_0x36e757[_0x383b('0x30')],'type':_0x36e757[_0x383b('0x31')][_0x383b('0x32')]};});_0x53715c['model']=_['map'](_0x21c7ef,_0x383b('0x2b'));_0x53715c['query']=_[_0x383b('0x33')](_0x5a7a52[_0x383b('0x34')]);_0x53715c['filters']=_['intersection'](_0x53715c[_0x383b('0x35')],_0x53715c['query']);_0x197fe4[_0x383b('0x36')]=_[_0x383b('0x37')](_0x53715c[_0x383b('0x35')],qs[_0x383b('0x38')](_0x5a7a52['query'][_0x383b('0x38')]));_0x197fe4[_0x383b('0x36')]=_0x197fe4['attributes'][_0x383b('0x39')]?_0x197fe4[_0x383b('0x36')]:_0x53715c[_0x383b('0x35')];if(!_0x5a7a52[_0x383b('0x34')][_0x383b('0x3a')](_0x383b('0x3b'))){_0x197fe4[_0x383b('0x20')]=qs[_0x383b('0x20')](_0x5a7a52['query'][_0x383b('0x20')]);_0x197fe4['offset']=qs[_0x383b('0x1e')](_0x5a7a52[_0x383b('0x34')]['offset']);}_0x197fe4[_0x383b('0x3c')]=qs['sort'](_0x5a7a52[_0x383b('0x34')][_0x383b('0x3d')]);_0x197fe4[_0x383b('0x3e')]=qs[_0x383b('0x3f')](_[_0x383b('0x40')](_0x5a7a52[_0x383b('0x34')],_0x53715c[_0x383b('0x3f')]),_0x21c7ef);if(_0x5a7a52[_0x383b('0x34')][_0x383b('0x41')]){_0x197fe4['where']=_['merge'](_0x197fe4[_0x383b('0x3e')],{'$or':_['map'](_0x21c7ef,function(_0x6fa215){if(_0x6fa215[_0x383b('0x31')]!==_0x383b('0x42')){var _0x32cfe7={};_0x32cfe7[_0x6fa215[_0x383b('0x2b')]]={'$like':'%'+_0x5a7a52[_0x383b('0x34')]['filter']+'%'};return _0x32cfe7;}})});}_0x197fe4=_['merge']({},_0x197fe4,_0x5a7a52[_0x383b('0x43')]);var _0x3442e7={'where':_0x197fe4['where']};return db[_0x383b('0x2e')][_0x383b('0x21')](_0x3442e7)[_0x383b('0x27')](function(_0x595d84){_0x19f1b2[_0x383b('0x21')]=_0x595d84;if(_0x5a7a52[_0x383b('0x34')]['includeAll']){_0x197fe4[_0x383b('0x44')]=[{'all':!![]}];}return db[_0x383b('0x2e')]['findAll'](_0x197fe4);})[_0x383b('0x27')](function(_0x2a44fa){_0x19f1b2[_0x383b('0x45')]=_0x2a44fa;return _0x19f1b2;})[_0x383b('0x27')](respondWithFilteredResult(_0xdfc439,_0x197fe4))[_0x383b('0x46')](handleError(_0xdfc439,null));};exports['show']=function(_0x3481c1,_0x500382){var _0x1b9888={'raw':![],'where':{'id':_0x3481c1[_0x383b('0x47')]['id']}},_0x3367bd={};_0x3367bd[_0x383b('0x35')]=_[_0x383b('0x33')](db['ServicenowConfiguration'][_0x383b('0x2f')]);_0x3367bd[_0x383b('0x34')]=_['keys'](_0x3481c1[_0x383b('0x34')]);_0x3367bd[_0x383b('0x3f')]=_[_0x383b('0x37')](_0x3367bd[_0x383b('0x35')],_0x3367bd[_0x383b('0x34')]);_0x1b9888[_0x383b('0x36')]=_[_0x383b('0x37')](_0x3367bd[_0x383b('0x35')],qs['fields'](_0x3481c1[_0x383b('0x34')][_0x383b('0x38')]));_0x1b9888[_0x383b('0x36')]=_0x1b9888[_0x383b('0x36')][_0x383b('0x39')]?_0x1b9888[_0x383b('0x36')]:_0x3367bd[_0x383b('0x35')];if(_0x3481c1[_0x383b('0x34')]['includeAll']){_0x1b9888[_0x383b('0x44')]=[{'all':!![]}];}_0x1b9888=_['merge']({},_0x1b9888,_0x3481c1[_0x383b('0x43')]);return db[_0x383b('0x2e')][_0x383b('0x48')](_0x1b9888)['then'](handleEntityNotFound(_0x500382,null))['then'](respondWithResult(_0x500382,null))['catch'](handleError(_0x500382,null));};exports['create']=function(_0x56c3ff,_0x523511){return db[_0x383b('0x2e')]['create'](_0x56c3ff[_0x383b('0x49')],{})[_0x383b('0x27')](respondWithResult(_0x523511,0xc9))[_0x383b('0x46')](handleError(_0x523511,null));};exports['update']=function(_0x27bc4e,_0xe964da){if(_0x27bc4e[_0x383b('0x49')]['id']){delete _0x27bc4e[_0x383b('0x49')]['id'];}return db[_0x383b('0x2e')][_0x383b('0x48')]({'where':{'id':_0x27bc4e[_0x383b('0x47')]['id']}})[_0x383b('0x27')](handleEntityNotFound(_0xe964da,null))[_0x383b('0x27')](saveUpdates(_0x27bc4e[_0x383b('0x49')],null))[_0x383b('0x27')](respondWithResult(_0xe964da,null))[_0x383b('0x46')](handleError(_0xe964da,null));};exports['destroy']=function(_0x329212,_0x1318d4){return db[_0x383b('0x2e')][_0x383b('0x48')]({'where':{'id':_0x329212[_0x383b('0x47')]['id']}})[_0x383b('0x27')](handleEntityNotFound(_0x1318d4,null))['then'](removeEntity(_0x1318d4,null))[_0x383b('0x46')](handleError(_0x1318d4,null));};exports[_0x383b('0x4a')]=function(_0x3dacf8,_0x4bbb9a,_0x2e925c){var _0x7f948a={};var _0x452dcd={};var _0xfced95;var _0x453c9e;return db[_0x383b('0x2e')][_0x383b('0x4b')]({'where':{'id':_0x3dacf8['params']['id']}})['then'](handleEntityNotFound(_0x4bbb9a,null))[_0x383b('0x27')](function(_0x54ba44){if(_0x54ba44){_0xfced95=_0x54ba44;_0x452dcd[_0x383b('0x35')]=_['keys'](db['ServicenowField'][_0x383b('0x2f')]);_0x452dcd[_0x383b('0x34')]=_['keys'](_0x3dacf8[_0x383b('0x34')]);_0x452dcd[_0x383b('0x3f')]=_['intersection'](_0x452dcd['model'],_0x452dcd[_0x383b('0x34')]);_0x7f948a[_0x383b('0x36')]=_['intersection'](_0x452dcd[_0x383b('0x35')],qs[_0x383b('0x38')](_0x3dacf8[_0x383b('0x34')]['fields']));_0x7f948a[_0x383b('0x36')]=_0x7f948a[_0x383b('0x36')][_0x383b('0x39')]?_0x7f948a[_0x383b('0x36')]:_0x452dcd[_0x383b('0x35')];_0x7f948a[_0x383b('0x3c')]=qs[_0x383b('0x3d')](_0x3dacf8[_0x383b('0x34')][_0x383b('0x3d')]);_0x7f948a[_0x383b('0x3e')]=qs[_0x383b('0x3f')](_['pick'](_0x3dacf8['query'],_0x452dcd[_0x383b('0x3f')]));if(_0x3dacf8[_0x383b('0x34')][_0x383b('0x41')]){_0x7f948a[_0x383b('0x3e')]=_['merge'](_0x7f948a[_0x383b('0x3e')],{'$or':_[_0x383b('0x4c')](_0x7f948a[_0x383b('0x36')],function(_0x4986d3){var _0x38615b={};_0x38615b[_0x4986d3]={'$like':'%'+_0x3dacf8['query']['filter']+'%'};return _0x38615b;})});}_0x7f948a=_[_0x383b('0x4d')]({},_0x7f948a,_0x3dacf8[_0x383b('0x43')]);return _0xfced95[_0x383b('0x4a')](_0x7f948a);}})[_0x383b('0x27')](function(_0x681e84){if(_0x681e84){_0x453c9e=_0x681e84[_0x383b('0x39')];if(!_0x3dacf8[_0x383b('0x34')][_0x383b('0x3a')](_0x383b('0x3b'))){_0x7f948a['limit']=qs['limit'](_0x3dacf8[_0x383b('0x34')][_0x383b('0x20')]);_0x7f948a[_0x383b('0x1e')]=qs[_0x383b('0x1e')](_0x3dacf8[_0x383b('0x34')][_0x383b('0x1e')]);}return _0xfced95[_0x383b('0x4a')](_0x7f948a);}})[_0x383b('0x27')](function(_0x295e9e){if(_0x295e9e){return _0x295e9e?{'count':_0x453c9e,'rows':_0x295e9e}:null;}})['then'](respondWithResult(_0x4bbb9a,null))[_0x383b('0x46')](handleError(_0x4bbb9a,null));};exports[_0x383b('0x4e')]=function(_0x3ba166,_0x4efb2a,_0x2760ca){var _0x55fd26={};var _0x4fde63={};var _0x56b2ca;var _0x42f84c;return db[_0x383b('0x2e')][_0x383b('0x4b')]({'where':{'id':_0x3ba166['params']['id']}})[_0x383b('0x27')](handleEntityNotFound(_0x4efb2a,null))['then'](function(_0x425c8b){if(_0x425c8b){_0x56b2ca=_0x425c8b;_0x4fde63[_0x383b('0x35')]=_[_0x383b('0x33')](db[_0x383b('0x4f')]['rawAttributes']);_0x4fde63[_0x383b('0x34')]=_[_0x383b('0x33')](_0x3ba166[_0x383b('0x34')]);_0x4fde63['filters']=_[_0x383b('0x37')](_0x4fde63[_0x383b('0x35')],_0x4fde63[_0x383b('0x34')]);_0x55fd26[_0x383b('0x36')]=_[_0x383b('0x37')](_0x4fde63['model'],qs[_0x383b('0x38')](_0x3ba166[_0x383b('0x34')][_0x383b('0x38')]));_0x55fd26[_0x383b('0x36')]=_0x55fd26['attributes']['length']?_0x55fd26[_0x383b('0x36')]:_0x4fde63[_0x383b('0x35')];_0x55fd26[_0x383b('0x3c')]=qs[_0x383b('0x3d')](_0x3ba166[_0x383b('0x34')][_0x383b('0x3d')]);_0x55fd26[_0x383b('0x3e')]=qs[_0x383b('0x3f')](_[_0x383b('0x40')](_0x3ba166['query'],_0x4fde63[_0x383b('0x3f')]));if(_0x3ba166[_0x383b('0x34')][_0x383b('0x41')]){_0x55fd26['where']=_[_0x383b('0x4d')](_0x55fd26[_0x383b('0x3e')],{'$or':_['map'](_0x55fd26[_0x383b('0x36')],function(_0x39a00b){var _0x1fea4b={};_0x1fea4b[_0x39a00b]={'$like':'%'+_0x3ba166[_0x383b('0x34')][_0x383b('0x41')]+'%'};return _0x1fea4b;})});}_0x55fd26=_[_0x383b('0x4d')]({},_0x55fd26,_0x3ba166[_0x383b('0x43')]);return _0x56b2ca[_0x383b('0x4e')](_0x55fd26);}})[_0x383b('0x27')](function(_0x25127b){if(_0x25127b){_0x42f84c=_0x25127b['length'];if(!_0x3ba166[_0x383b('0x34')][_0x383b('0x3a')](_0x383b('0x3b'))){_0x55fd26[_0x383b('0x20')]=qs[_0x383b('0x20')](_0x3ba166[_0x383b('0x34')][_0x383b('0x20')]);_0x55fd26[_0x383b('0x1e')]=qs[_0x383b('0x1e')](_0x3ba166[_0x383b('0x34')]['offset']);}return _0x56b2ca['getSubjects'](_0x55fd26);}})[_0x383b('0x27')](function(_0xee27b5){if(_0xee27b5){return _0xee27b5?{'count':_0x42f84c,'rows':_0xee27b5}:null;}})[_0x383b('0x27')](respondWithResult(_0x4efb2a,null))[_0x383b('0x46')](handleError(_0x4efb2a,null));};exports[_0x383b('0x50')]=function(_0x3b65d,_0x5d2708,_0x1de2b6){var _0x2f34a4={};var _0x48e19b={};var _0x44b0f3;var _0xb5dc26;return db[_0x383b('0x2e')][_0x383b('0x4b')]({'where':{'id':_0x3b65d['params']['id']}})['then'](handleEntityNotFound(_0x5d2708,null))['then'](function(_0x2ea0be){if(_0x2ea0be){_0x44b0f3=_0x2ea0be;_0x48e19b[_0x383b('0x35')]=_[_0x383b('0x33')](db[_0x383b('0x4f')][_0x383b('0x2f')]);_0x48e19b[_0x383b('0x34')]=_[_0x383b('0x33')](_0x3b65d[_0x383b('0x34')]);_0x48e19b[_0x383b('0x3f')]=_[_0x383b('0x37')](_0x48e19b[_0x383b('0x35')],_0x48e19b['query']);_0x2f34a4[_0x383b('0x36')]=_['intersection'](_0x48e19b[_0x383b('0x35')],qs[_0x383b('0x38')](_0x3b65d[_0x383b('0x34')][_0x383b('0x38')]));_0x2f34a4[_0x383b('0x36')]=_0x2f34a4[_0x383b('0x36')][_0x383b('0x39')]?_0x2f34a4[_0x383b('0x36')]:_0x48e19b[_0x383b('0x35')];_0x2f34a4[_0x383b('0x3c')]=qs['sort'](_0x3b65d[_0x383b('0x34')][_0x383b('0x3d')]);_0x2f34a4[_0x383b('0x3e')]=qs[_0x383b('0x3f')](_[_0x383b('0x40')](_0x3b65d[_0x383b('0x34')],_0x48e19b[_0x383b('0x3f')]));if(_0x3b65d[_0x383b('0x34')][_0x383b('0x41')]){_0x2f34a4['where']=_[_0x383b('0x4d')](_0x2f34a4['where'],{'$or':_[_0x383b('0x4c')](_0x2f34a4[_0x383b('0x36')],function(_0x492a94){var _0x345201={};_0x345201[_0x492a94]={'$like':'%'+_0x3b65d[_0x383b('0x34')][_0x383b('0x41')]+'%'};return _0x345201;})});}_0x2f34a4=_['merge']({},_0x2f34a4,_0x3b65d['options']);return _0x44b0f3[_0x383b('0x50')](_0x2f34a4);}})[_0x383b('0x27')](function(_0x593412){if(_0x593412){_0xb5dc26=_0x593412[_0x383b('0x39')];if(!_0x3b65d[_0x383b('0x34')][_0x383b('0x3a')]('nolimit')){_0x2f34a4['limit']=qs[_0x383b('0x20')](_0x3b65d['query'][_0x383b('0x20')]);_0x2f34a4[_0x383b('0x1e')]=qs[_0x383b('0x1e')](_0x3b65d[_0x383b('0x34')]['offset']);}return _0x44b0f3['getDescriptions'](_0x2f34a4);}})['then'](function(_0x55e2b1){if(_0x55e2b1){return _0x55e2b1?{'count':_0xb5dc26,'rows':_0x55e2b1}:null;}})[_0x383b('0x27')](respondWithResult(_0x5d2708,null))['catch'](handleError(_0x5d2708,null));}; \ No newline at end of file +var _0xd56e=['create','body','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch'];(function(_0xf5e914,_0x1d561a){var _0x5b6f18=function(_0x11daea){while(--_0x11daea){_0xf5e914['push'](_0xf5e914['shift']());}};_0x5b6f18(++_0x1d561a);}(_0xd56e,0x1e8));var _0xed56=function(_0x287f9b,_0x557885){_0x287f9b=_0x287f9b-0x0;var _0x5248bb=_0xd56e[_0x287f9b];return _0x5248bb;};'use strict';var emlformat=require(_0xed56('0x0'));var rimraf=require(_0xed56('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed56('0x2'));var rp=require('request-promise');var moment=require(_0xed56('0x3'));var BPromise=require(_0xed56('0x4'));var Mustache=require(_0xed56('0x5'));var util=require(_0xed56('0x6'));var path=require(_0xed56('0x7'));var sox=require(_0xed56('0x8'));var csv=require('to-csv');var ejs=require(_0xed56('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed56('0xa'));var squel=require(_0xed56('0xb'));var crypto=require(_0xed56('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xed56('0xd'));var toCsv=require(_0xed56('0xe'));var querystring=require('querystring');var Papa=require(_0xed56('0xf'));var Redis=require(_0xed56('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed56('0x11'));var as=require(_0xed56('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed56('0x13'))('api');var utils=require(_0xed56('0x14'));var config=require(_0xed56('0x15'));var licenseUtil=require(_0xed56('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa4ef19,_0x2f8956){_0x2f8956=_0x2f8956||0xcc;return function(_0x3d36d2){if(_0x3d36d2){return _0xa4ef19[_0xed56('0x17')](_0x2f8956);}return _0xa4ef19[_0xed56('0x18')](_0x2f8956)[_0xed56('0x19')]();};}function respondWithResult(_0x552869,_0x277e15){_0x277e15=_0x277e15||0xc8;return function(_0x892c18){if(_0x892c18){return _0x552869[_0xed56('0x18')](_0x277e15)[_0xed56('0x1a')](_0x892c18);}};}function respondWithFilteredResult(_0x3bba43,_0x3165d5){return function(_0x4b8adb){if(_0x4b8adb){var _0x114dbf=typeof _0x3165d5[_0xed56('0x1b')]==='undefined'&&typeof _0x3165d5[_0xed56('0x1c')]===_0xed56('0x1d');var _0x353f22=_0x4b8adb[_0xed56('0x1e')];var _0x55dbb1=_0x114dbf?0x0:_0x3165d5[_0xed56('0x1b')];var _0x5adbb9=_0x114dbf?_0x4b8adb[_0xed56('0x1e')]:_0x3165d5[_0xed56('0x1b')]+_0x3165d5['limit'];var _0x1990d4;if(_0x5adbb9>=_0x353f22){_0x5adbb9=_0x353f22;_0x1990d4=0xc8;}else{_0x1990d4=0xce;}_0x3bba43['status'](_0x1990d4);return _0x3bba43[_0xed56('0x1f')](_0xed56('0x20'),_0x55dbb1+'-'+_0x5adbb9+'/'+_0x353f22)['json'](_0x4b8adb);}return null;};}function patchUpdates(_0x47d077){return function(_0x27de70){try{jsonpatch[_0xed56('0x21')](_0x27de70,_0x47d077,!![]);}catch(_0x35a09a){return BPromise[_0xed56('0x22')](_0x35a09a);}return _0x27de70['save']();};}function saveUpdates(_0x2ce97d,_0x8bf6){return function(_0x4364bd){if(_0x4364bd){return _0x4364bd[_0xed56('0x23')](_0x2ce97d)[_0xed56('0x24')](function(_0x274c08){return _0x274c08;});}return null;};}function removeEntity(_0x171ce4,_0x5781a6){return function(_0x2cb455){if(_0x2cb455){return _0x2cb455['destroy']()[_0xed56('0x24')](function(){_0x171ce4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x127836,_0xda2629){return function(_0x173ad6){if(!_0x173ad6){_0x127836[_0xed56('0x17')](0x194);}return _0x173ad6;};}function handleError(_0x3e3ec9,_0x20624a){_0x20624a=_0x20624a||0x1f4;return function(_0x2e5898){logger[_0xed56('0x25')](_0x2e5898[_0xed56('0x26')]);if(_0x2e5898[_0xed56('0x27')]){delete _0x2e5898[_0xed56('0x27')];}_0x3e3ec9[_0xed56('0x18')](_0x20624a)[_0xed56('0x28')](_0x2e5898);};}exports['index']=function(_0x594123,_0x25fa1f){var _0x27a158={},_0x4cdb60={},_0xa6e469={'count':0x0,'rows':[]};var _0x23718e=_[_0xed56('0x29')](db[_0xed56('0x2a')][_0xed56('0x2b')],function(_0x2602c7){return{'name':_0x2602c7['fieldName'],'type':_0x2602c7[_0xed56('0x2c')][_0xed56('0x2d')]};});_0x4cdb60[_0xed56('0x2e')]=_[_0xed56('0x29')](_0x23718e,_0xed56('0x27'));_0x4cdb60[_0xed56('0x2f')]=_['keys'](_0x594123[_0xed56('0x2f')]);_0x4cdb60[_0xed56('0x30')]=_[_0xed56('0x31')](_0x4cdb60['model'],_0x4cdb60[_0xed56('0x2f')]);_0x27a158[_0xed56('0x32')]=_[_0xed56('0x31')](_0x4cdb60[_0xed56('0x2e')],qs[_0xed56('0x33')](_0x594123['query']['fields']));_0x27a158[_0xed56('0x32')]=_0x27a158[_0xed56('0x32')][_0xed56('0x34')]?_0x27a158['attributes']:_0x4cdb60[_0xed56('0x2e')];if(!_0x594123['query'][_0xed56('0x35')](_0xed56('0x36'))){_0x27a158[_0xed56('0x1c')]=qs[_0xed56('0x1c')](_0x594123[_0xed56('0x2f')][_0xed56('0x1c')]);_0x27a158[_0xed56('0x1b')]=qs[_0xed56('0x1b')](_0x594123[_0xed56('0x2f')][_0xed56('0x1b')]);}_0x27a158[_0xed56('0x37')]=qs[_0xed56('0x38')](_0x594123['query'][_0xed56('0x38')]);_0x27a158['where']=qs[_0xed56('0x30')](_[_0xed56('0x39')](_0x594123['query'],_0x4cdb60['filters']),_0x23718e);if(_0x594123[_0xed56('0x2f')][_0xed56('0x3a')]){_0x27a158[_0xed56('0x3b')]=_[_0xed56('0x3c')](_0x27a158['where'],{'$or':_[_0xed56('0x29')](_0x23718e,function(_0xb29fc7){if(_0xb29fc7['type']!==_0xed56('0x3d')){var _0x17e90b={};_0x17e90b[_0xb29fc7['name']]={'$like':'%'+_0x594123['query'][_0xed56('0x3a')]+'%'};return _0x17e90b;}})});}_0x27a158=_[_0xed56('0x3c')]({},_0x27a158,_0x594123[_0xed56('0x3e')]);var _0x1040b5={'where':_0x27a158[_0xed56('0x3b')]};return db['ServicenowConfiguration'][_0xed56('0x1e')](_0x1040b5)[_0xed56('0x24')](function(_0xe96b38){_0xa6e469['count']=_0xe96b38;if(_0x594123[_0xed56('0x2f')][_0xed56('0x3f')]){_0x27a158[_0xed56('0x40')]=[{'all':!![]}];}return db[_0xed56('0x2a')][_0xed56('0x41')](_0x27a158);})[_0xed56('0x24')](function(_0x49e754){_0xa6e469[_0xed56('0x42')]=_0x49e754;return _0xa6e469;})[_0xed56('0x24')](respondWithFilteredResult(_0x25fa1f,_0x27a158))['catch'](handleError(_0x25fa1f,null));};exports[_0xed56('0x43')]=function(_0x2b2aad,_0x105f77){var _0x1a0995={'raw':![],'where':{'id':_0x2b2aad[_0xed56('0x44')]['id']}},_0x3f8395={};_0x3f8395[_0xed56('0x2e')]=_[_0xed56('0x45')](db[_0xed56('0x2a')][_0xed56('0x2b')]);_0x3f8395['query']=_['keys'](_0x2b2aad[_0xed56('0x2f')]);_0x3f8395[_0xed56('0x30')]=_['intersection'](_0x3f8395[_0xed56('0x2e')],_0x3f8395[_0xed56('0x2f')]);_0x1a0995[_0xed56('0x32')]=_[_0xed56('0x31')](_0x3f8395[_0xed56('0x2e')],qs[_0xed56('0x33')](_0x2b2aad[_0xed56('0x2f')]['fields']));_0x1a0995[_0xed56('0x32')]=_0x1a0995[_0xed56('0x32')][_0xed56('0x34')]?_0x1a0995[_0xed56('0x32')]:_0x3f8395[_0xed56('0x2e')];if(_0x2b2aad[_0xed56('0x2f')]['includeAll']){_0x1a0995[_0xed56('0x40')]=[{'all':!![]}];}_0x1a0995=_[_0xed56('0x3c')]({},_0x1a0995,_0x2b2aad[_0xed56('0x3e')]);return db['ServicenowConfiguration'][_0xed56('0x46')](_0x1a0995)['then'](handleEntityNotFound(_0x105f77,null))[_0xed56('0x24')](respondWithResult(_0x105f77,null))[_0xed56('0x47')](handleError(_0x105f77,null));};exports[_0xed56('0x48')]=function(_0x53f961,_0x26e76c){return db['ServicenowConfiguration'][_0xed56('0x48')](_0x53f961[_0xed56('0x49')],{})[_0xed56('0x24')](respondWithResult(_0x26e76c,0xc9))[_0xed56('0x47')](handleError(_0x26e76c,null));};exports['update']=function(_0x76f6d2,_0x22743f){if(_0x76f6d2[_0xed56('0x49')]['id']){delete _0x76f6d2[_0xed56('0x49')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x76f6d2[_0xed56('0x44')]['id']}})[_0xed56('0x24')](handleEntityNotFound(_0x22743f,null))['then'](saveUpdates(_0x76f6d2[_0xed56('0x49')],null))[_0xed56('0x24')](respondWithResult(_0x22743f,null))[_0xed56('0x47')](handleError(_0x22743f,null));};exports[_0xed56('0x4a')]=function(_0x55dc98,_0x1e7381){return db[_0xed56('0x2a')]['find']({'where':{'id':_0x55dc98[_0xed56('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e7381,null))[_0xed56('0x24')](removeEntity(_0x1e7381,null))[_0xed56('0x47')](handleError(_0x1e7381,null));};exports[_0xed56('0x4b')]=function(_0x9f8e36,_0x4cffc1,_0x541b51){var _0x12e06c={};var _0x49d366={};var _0x4282e5;var _0x30a7cf;return db[_0xed56('0x2a')][_0xed56('0x4c')]({'where':{'id':_0x9f8e36['params']['id']}})[_0xed56('0x24')](handleEntityNotFound(_0x4cffc1,null))[_0xed56('0x24')](function(_0x2ec784){if(_0x2ec784){_0x4282e5=_0x2ec784;_0x49d366[_0xed56('0x2e')]=_[_0xed56('0x45')](db[_0xed56('0x4d')]['rawAttributes']);_0x49d366[_0xed56('0x2f')]=_[_0xed56('0x45')](_0x9f8e36['query']);_0x49d366[_0xed56('0x30')]=_[_0xed56('0x31')](_0x49d366['model'],_0x49d366['query']);_0x12e06c['attributes']=_[_0xed56('0x31')](_0x49d366[_0xed56('0x2e')],qs[_0xed56('0x33')](_0x9f8e36[_0xed56('0x2f')]['fields']));_0x12e06c[_0xed56('0x32')]=_0x12e06c['attributes'][_0xed56('0x34')]?_0x12e06c[_0xed56('0x32')]:_0x49d366['model'];_0x12e06c[_0xed56('0x37')]=qs[_0xed56('0x38')](_0x9f8e36['query'][_0xed56('0x38')]);_0x12e06c[_0xed56('0x3b')]=qs['filters'](_[_0xed56('0x39')](_0x9f8e36[_0xed56('0x2f')],_0x49d366[_0xed56('0x30')]));if(_0x9f8e36[_0xed56('0x2f')][_0xed56('0x3a')]){_0x12e06c[_0xed56('0x3b')]=_[_0xed56('0x3c')](_0x12e06c['where'],{'$or':_[_0xed56('0x29')](_0x12e06c[_0xed56('0x32')],function(_0x2aa1fa){var _0x32da40={};_0x32da40[_0x2aa1fa]={'$like':'%'+_0x9f8e36[_0xed56('0x2f')][_0xed56('0x3a')]+'%'};return _0x32da40;})});}_0x12e06c=_['merge']({},_0x12e06c,_0x9f8e36[_0xed56('0x3e')]);return _0x4282e5[_0xed56('0x4b')](_0x12e06c);}})['then'](function(_0x16aec2){if(_0x16aec2){_0x30a7cf=_0x16aec2['length'];if(!_0x9f8e36[_0xed56('0x2f')]['hasOwnProperty']('nolimit')){_0x12e06c['limit']=qs[_0xed56('0x1c')](_0x9f8e36[_0xed56('0x2f')][_0xed56('0x1c')]);_0x12e06c[_0xed56('0x1b')]=qs[_0xed56('0x1b')](_0x9f8e36['query'][_0xed56('0x1b')]);}return _0x4282e5[_0xed56('0x4b')](_0x12e06c);}})[_0xed56('0x24')](function(_0x4ef34f){if(_0x4ef34f){return _0x4ef34f?{'count':_0x30a7cf,'rows':_0x4ef34f}:null;}})[_0xed56('0x24')](respondWithResult(_0x4cffc1,null))[_0xed56('0x47')](handleError(_0x4cffc1,null));};exports[_0xed56('0x4e')]=function(_0x49e1e5,_0x300b1e,_0x23ba6f){var _0x31cf15={};var _0x54f4cc={};var _0xb43e5f;var _0x5b4236;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x49e1e5[_0xed56('0x44')]['id']}})['then'](handleEntityNotFound(_0x300b1e,null))[_0xed56('0x24')](function(_0x26391b){if(_0x26391b){_0xb43e5f=_0x26391b;_0x54f4cc['model']=_[_0xed56('0x45')](db[_0xed56('0x4d')][_0xed56('0x2b')]);_0x54f4cc[_0xed56('0x2f')]=_['keys'](_0x49e1e5[_0xed56('0x2f')]);_0x54f4cc['filters']=_['intersection'](_0x54f4cc['model'],_0x54f4cc[_0xed56('0x2f')]);_0x31cf15[_0xed56('0x32')]=_[_0xed56('0x31')](_0x54f4cc[_0xed56('0x2e')],qs['fields'](_0x49e1e5['query'][_0xed56('0x33')]));_0x31cf15[_0xed56('0x32')]=_0x31cf15[_0xed56('0x32')][_0xed56('0x34')]?_0x31cf15['attributes']:_0x54f4cc[_0xed56('0x2e')];_0x31cf15[_0xed56('0x37')]=qs[_0xed56('0x38')](_0x49e1e5['query']['sort']);_0x31cf15[_0xed56('0x3b')]=qs[_0xed56('0x30')](_[_0xed56('0x39')](_0x49e1e5[_0xed56('0x2f')],_0x54f4cc[_0xed56('0x30')]));if(_0x49e1e5['query'][_0xed56('0x3a')]){_0x31cf15[_0xed56('0x3b')]=_[_0xed56('0x3c')](_0x31cf15[_0xed56('0x3b')],{'$or':_[_0xed56('0x29')](_0x31cf15[_0xed56('0x32')],function(_0x2ee472){var _0x55ea2b={};_0x55ea2b[_0x2ee472]={'$like':'%'+_0x49e1e5[_0xed56('0x2f')]['filter']+'%'};return _0x55ea2b;})});}_0x31cf15=_[_0xed56('0x3c')]({},_0x31cf15,_0x49e1e5['options']);return _0xb43e5f['getSubjects'](_0x31cf15);}})[_0xed56('0x24')](function(_0x3d97e6){if(_0x3d97e6){_0x5b4236=_0x3d97e6[_0xed56('0x34')];if(!_0x49e1e5[_0xed56('0x2f')]['hasOwnProperty'](_0xed56('0x36'))){_0x31cf15[_0xed56('0x1c')]=qs['limit'](_0x49e1e5[_0xed56('0x2f')][_0xed56('0x1c')]);_0x31cf15[_0xed56('0x1b')]=qs[_0xed56('0x1b')](_0x49e1e5['query'][_0xed56('0x1b')]);}return _0xb43e5f[_0xed56('0x4e')](_0x31cf15);}})['then'](function(_0x487119){if(_0x487119){return _0x487119?{'count':_0x5b4236,'rows':_0x487119}:null;}})[_0xed56('0x24')](respondWithResult(_0x300b1e,null))[_0xed56('0x47')](handleError(_0x300b1e,null));};exports[_0xed56('0x4f')]=function(_0x56c2d1,_0x3112d6,_0x1a9da6){var _0x23fa58={};var _0x370f82={};var _0x116d2d;var _0x487fa8;return db[_0xed56('0x2a')]['findOne']({'where':{'id':_0x56c2d1[_0xed56('0x44')]['id']}})['then'](handleEntityNotFound(_0x3112d6,null))[_0xed56('0x24')](function(_0x2d74ff){if(_0x2d74ff){_0x116d2d=_0x2d74ff;_0x370f82[_0xed56('0x2e')]=_['keys'](db[_0xed56('0x4d')][_0xed56('0x2b')]);_0x370f82[_0xed56('0x2f')]=_[_0xed56('0x45')](_0x56c2d1['query']);_0x370f82[_0xed56('0x30')]=_[_0xed56('0x31')](_0x370f82[_0xed56('0x2e')],_0x370f82[_0xed56('0x2f')]);_0x23fa58['attributes']=_[_0xed56('0x31')](_0x370f82[_0xed56('0x2e')],qs[_0xed56('0x33')](_0x56c2d1[_0xed56('0x2f')][_0xed56('0x33')]));_0x23fa58[_0xed56('0x32')]=_0x23fa58[_0xed56('0x32')][_0xed56('0x34')]?_0x23fa58['attributes']:_0x370f82['model'];_0x23fa58[_0xed56('0x37')]=qs[_0xed56('0x38')](_0x56c2d1[_0xed56('0x2f')][_0xed56('0x38')]);_0x23fa58[_0xed56('0x3b')]=qs[_0xed56('0x30')](_[_0xed56('0x39')](_0x56c2d1[_0xed56('0x2f')],_0x370f82[_0xed56('0x30')]));if(_0x56c2d1[_0xed56('0x2f')][_0xed56('0x3a')]){_0x23fa58[_0xed56('0x3b')]=_[_0xed56('0x3c')](_0x23fa58['where'],{'$or':_['map'](_0x23fa58[_0xed56('0x32')],function(_0x520049){var _0x48782d={};_0x48782d[_0x520049]={'$like':'%'+_0x56c2d1[_0xed56('0x2f')]['filter']+'%'};return _0x48782d;})});}_0x23fa58=_[_0xed56('0x3c')]({},_0x23fa58,_0x56c2d1[_0xed56('0x3e')]);return _0x116d2d['getDescriptions'](_0x23fa58);}})[_0xed56('0x24')](function(_0x1b03b4){if(_0x1b03b4){_0x487fa8=_0x1b03b4[_0xed56('0x34')];if(!_0x56c2d1[_0xed56('0x2f')]['hasOwnProperty']('nolimit')){_0x23fa58['limit']=qs[_0xed56('0x1c')](_0x56c2d1[_0xed56('0x2f')][_0xed56('0x1c')]);_0x23fa58[_0xed56('0x1b')]=qs[_0xed56('0x1b')](_0x56c2d1[_0xed56('0x2f')][_0xed56('0x1b')]);}return _0x116d2d[_0xed56('0x4f')](_0x23fa58);}})[_0xed56('0x24')](function(_0xa5acdc){if(_0xa5acdc){return _0xa5acdc?{'count':_0x487fa8,'rows':_0xa5acdc}:null;}})[_0xed56('0x24')](respondWithResult(_0x3112d6,null))[_0xed56('0x47')](handleError(_0x3112d6,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index adb4eff..46035c8 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 _0x98b7=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','path'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x98b7,0xc1));var _0x798b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x98b7[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x798b('0x0'));var util=require(_0x798b('0x1'));var logger=require(_0x798b('0x2'))(_0x798b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x798b('0x4'));var rimraf=require(_0x798b('0x5'));var config=require(_0x798b('0x6'));var attributes=require(_0x798b('0x7'));module[_0x798b('0x8')]=function(_0x4c197e,_0x2bab89){return _0x4c197e['define'](_0x798b('0x9'),attributes,{'tableName':_0x798b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x505d=['./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2dfd4b,_0x5704b5){var _0x407930=function(_0x47c9c9){while(--_0x47c9c9){_0x2dfd4b['push'](_0x2dfd4b['shift']());}};_0x407930(++_0x5704b5);}(_0x505d,0x93));var _0xd505=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x505d[_0x11ca63];return _0x41f1f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd505('0x0'))(_0xd505('0x1'));var moment=require(_0xd505('0x2'));var BPromise=require(_0xd505('0x3'));var rp=require(_0xd505('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd505('0x5'));var config=require(_0xd505('0x6'));var attributes=require(_0xd505('0x7'));module[_0xd505('0x8')]=function(_0x4ab634,_0x3a2863){return _0x4ab634['define'](_0xd505('0x9'),attributes,{'tableName':_0xd505('0xa'),'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 e2899d2..125d4bb 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 _0x457a=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x270436,_0x411792){var _0x20028a=function(_0x3fe273){while(--_0x3fe273){_0x270436['push'](_0x270436['shift']());}};_0x20028a(++_0x411792);}(_0x457a,0x167));var _0xa457=function(_0x1eb742,_0x17e6e7){_0x1eb742=_0x1eb742-0x0;var _0x20bd0c=_0x457a[_0x1eb742];return _0x20bd0c;};'use strict';var _=require(_0xa457('0x0'));var util=require(_0xa457('0x1'));var moment=require(_0xa457('0x2'));var BPromise=require('bluebird');var rs=require(_0xa457('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa457('0x4'))['db'];var utils=require(_0xa457('0x5'));var logger=require(_0xa457('0x6'))(_0xa457('0x7'));var config=require('../../config/environment');var jayson=require(_0xa457('0x8'));var client=jayson[_0xa457('0x9')][_0xa457('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13157b,_0x5759de,_0x1c36a0){return new BPromise(function(_0x1c9607,_0xf8f6bb){return client[_0xa457('0xb')](_0x13157b,_0x1c36a0)['then'](function(_0x17bd76){logger[_0xa457('0xc')](_0xa457('0xd'),_0x5759de,_0xa457('0xe'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5759de,'request\x20sent',JSON[_0xa457('0xf')](_0x17bd76));if(_0x17bd76[_0xa457('0x10')]){if(_0x17bd76['error'][_0xa457('0x11')]===0x1f4){logger[_0xa457('0x10')](_0xa457('0xd'),_0x5759de,_0x17bd76['error'][_0xa457('0x12')]);return _0xf8f6bb(_0x17bd76[_0xa457('0x10')]['message']);}logger['error'](_0xa457('0xd'),_0x5759de,_0x17bd76[_0xa457('0x10')][_0xa457('0x12')]);return _0x1c9607(_0x17bd76[_0xa457('0x10')][_0xa457('0x12')]);}else{logger['info'](_0xa457('0xd'),_0x5759de,'request\x20sent');_0x1c9607(_0x17bd76[_0xa457('0x13')][_0xa457('0x12')]);}})['catch'](function(_0x45059b){logger['error'](_0xa457('0xd'),_0x5759de,_0x45059b);_0xf8f6bb(_0x45059b);});});} \ No newline at end of file +var _0xe83e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1ee767,_0x252b8d){var _0x2b09b5=function(_0x1e1840){while(--_0x1e1840){_0x1ee767['push'](_0x1ee767['shift']());}};_0x2b09b5(++_0x252b8d);}(_0xe83e,0x7a));var _0xee83=function(_0x368bd6,_0x42dbc9){_0x368bd6=_0x368bd6-0x0;var _0x315e87=_0xe83e[_0x368bd6];return _0x315e87;};'use strict';var _=require(_0xee83('0x0'));var util=require(_0xee83('0x1'));var moment=require(_0xee83('0x2'));var BPromise=require(_0xee83('0x3'));var rs=require(_0xee83('0x4'));var fs=require('fs');var Redis=require(_0xee83('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xee83('0x6'))(_0xee83('0x7'));var config=require(_0xee83('0x8'));var jayson=require(_0xee83('0x9'));var client=jayson[_0xee83('0xa')][_0xee83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12f57c,_0x4aeb37,_0x133ae6){return new BPromise(function(_0x223bdc,_0x4098f3){return client[_0xee83('0xc')](_0x12f57c,_0x133ae6)[_0xee83('0xd')](function(_0x48857c){logger[_0xee83('0xe')](_0xee83('0xf'),_0x4aeb37,_0xee83('0x10'));logger[_0xee83('0x11')](_0xee83('0x12'),_0x4aeb37,_0xee83('0x10'),JSON[_0xee83('0x13')](_0x48857c));if(_0x48857c[_0xee83('0x14')]){if(_0x48857c[_0xee83('0x14')]['code']===0x1f4){logger['error'](_0xee83('0xf'),_0x4aeb37,_0x48857c[_0xee83('0x14')][_0xee83('0x15')]);return _0x4098f3(_0x48857c[_0xee83('0x14')][_0xee83('0x15')]);}logger[_0xee83('0x14')](_0xee83('0xf'),_0x4aeb37,_0x48857c[_0xee83('0x14')]['message']);return _0x223bdc(_0x48857c['error'][_0xee83('0x15')]);}else{logger[_0xee83('0xe')](_0xee83('0xf'),_0x4aeb37,_0xee83('0x10'));_0x223bdc(_0x48857c[_0xee83('0x16')][_0xee83('0x15')]);}})[_0xee83('0x17')](function(_0x2443dd){logger[_0xee83('0x14')](_0xee83('0xf'),_0x4aeb37,_0x2443dd);_0x4098f3(_0x2443dd);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index da7d3ed..fb878a8 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 _0x4940=['get','isAuthenticated','index','post','create','put','/:id','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intServicenowField.controller'];(function(_0x20a4ac,_0x291f74){var _0xe98534=function(_0x2df80a){while(--_0x2df80a){_0x20a4ac['push'](_0x20a4ac['shift']());}};_0xe98534(++_0x291f74);}(_0x4940,0x1ac));var _0x0494=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x4940[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require('multer');var util=require(_0x0494('0x0'));var path=require(_0x0494('0x1'));var timeout=require(_0x0494('0x2'));var express=require(_0x0494('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0494('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0494('0x5'));var controller=require(_0x0494('0x6'));router[_0x0494('0x7')]('/',auth[_0x0494('0x8')](),controller[_0x0494('0x9')]);router[_0x0494('0x7')]('/:id',auth[_0x0494('0x8')](),controller['show']);router[_0x0494('0xa')]('/',auth[_0x0494('0x8')](),controller[_0x0494('0xb')]);router[_0x0494('0xc')](_0x0494('0xd'),auth[_0x0494('0x8')](),controller['update']);router['delete'](_0x0494('0xd'),auth[_0x0494('0x8')](),controller['destroy']);module[_0x0494('0xe')]=router; \ No newline at end of file +var _0x546c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x546c,0x1c7));var _0xc546=function(_0x5085c6,_0x331a5a){_0x5085c6=_0x5085c6-0x0;var _0x572ec7=_0x546c[_0x5085c6];return _0x572ec7;};'use strict';var multer=require('multer');var util=require(_0xc546('0x0'));var path=require(_0xc546('0x1'));var timeout=require(_0xc546('0x2'));var express=require(_0xc546('0x3'));var router=express[_0xc546('0x4')]();var fs_extra=require(_0xc546('0x5'));var auth=require(_0xc546('0x6'));var interaction=require(_0xc546('0x7'));var config=require(_0xc546('0x8'));var controller=require(_0xc546('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc546('0xa')]);router['get'](_0xc546('0xb'),auth[_0xc546('0xc')](),controller[_0xc546('0xd')]);router[_0xc546('0xe')]('/',auth[_0xc546('0xc')](),controller['create']);router[_0xc546('0xf')]('/:id',auth[_0xc546('0xc')](),controller[_0xc546('0x10')]);router[_0xc546('0x11')](_0xc546('0xb'),auth[_0xc546('0xc')](),controller[_0xc546('0x12')]);module[_0xc546('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index cfb255f..77c5d6d 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 _0xe9b5=['variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','picklist','STRING'];(function(_0x21918f,_0x262644){var _0x2309aa=function(_0x543629){while(--_0x543629){_0x21918f['push'](_0x21918f['shift']());}};_0x2309aa(++_0x262644);}(_0xe9b5,0xa5));var _0x5e9b=function(_0x4261cc,_0x5f2c44){_0x4261cc=_0x4261cc-0x0;var _0x1dbc84=_0xe9b5[_0x4261cc];return _0x1dbc84;};'use strict';var Sequelize=require(_0x5e9b('0x0'));module[_0x5e9b('0x1')]={'type':{'type':Sequelize[_0x5e9b('0x2')](_0x5e9b('0x3'),'variable','customVariable','keyValue',_0x5e9b('0x4')),'defaultValue':_0x5e9b('0x3')},'content':{'type':Sequelize[_0x5e9b('0x5')]},'key':{'type':Sequelize[_0x5e9b('0x5')]},'keyType':{'type':Sequelize[_0x5e9b('0x2')](_0x5e9b('0x3'),_0x5e9b('0x6'),_0x5e9b('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5e9b('0x5')]},'nameField':{'type':Sequelize[_0x5e9b('0x5')]},'customField':{'type':Sequelize[_0x5e9b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe591=['sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN'];(function(_0x48e52d,_0x27b477){var _0x870b49=function(_0x32fdd3){while(--_0x32fdd3){_0x48e52d['push'](_0x48e52d['shift']());}};_0x870b49(++_0x27b477);}(_0xe591,0xcf));var _0x1e59=function(_0x458f02,_0x2afa3d){_0x458f02=_0x458f02-0x0;var _0x34abd3=_0xe591[_0x458f02];return _0x34abd3;};'use strict';var Sequelize=require(_0x1e59('0x0'));module[_0x1e59('0x1')]={'type':{'type':Sequelize[_0x1e59('0x2')]('string',_0x1e59('0x3'),_0x1e59('0x4'),'keyValue',_0x1e59('0x5')),'defaultValue':_0x1e59('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1e59('0x7')]},'keyType':{'type':Sequelize[_0x1e59('0x2')](_0x1e59('0x6'),_0x1e59('0x3'),_0x1e59('0x4'))},'keyContent':{'type':Sequelize[_0x1e59('0x7')]},'idField':{'type':Sequelize[_0x1e59('0x7')]},'nameField':{'type':Sequelize[_0x1e59('0x7')]},'customField':{'type':Sequelize[_0x1e59('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 11bda6c..0ba2480 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 _0x93cf=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','intersection','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','ServicenowField','rawAttributes','type','key','map','query','keys','filters','model'];(function(_0x3271c9,_0x30d66f){var _0x446bbd=function(_0x291989){while(--_0x291989){_0x3271c9['push'](_0x3271c9['shift']());}};_0x446bbd(++_0x30d66f);}(_0x93cf,0xad));var _0xf93c=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x93cf[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require(_0xf93c('0x0'));var rimraf=require(_0xf93c('0x1'));var zipdir=require(_0xf93c('0x2'));var jsonpatch=require(_0xf93c('0x3'));var rp=require(_0xf93c('0x4'));var moment=require(_0xf93c('0x5'));var BPromise=require(_0xf93c('0x6'));var Mustache=require(_0xf93c('0x7'));var util=require(_0xf93c('0x8'));var path=require('path');var sox=require(_0xf93c('0x9'));var csv=require('to-csv');var ejs=require(_0xf93c('0xa'));var fs=require('fs');var fs_extra=require(_0xf93c('0xb'));var _=require(_0xf93c('0xc'));var squel=require(_0xf93c('0xd'));var crypto=require(_0xf93c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf93c('0xf'));var querystring=require(_0xf93c('0x10'));var Papa=require('papaparse');var Redis=require(_0xf93c('0x11'));var authService=require(_0xf93c('0x12'));var qs=require(_0xf93c('0x13'));var as=require(_0xf93c('0x14'));var hardwareService=require(_0xf93c('0x15'));var logger=require(_0xf93c('0x16'))(_0xf93c('0x17'));var utils=require(_0xf93c('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8f697f,_0x49d01f){_0x49d01f=_0x49d01f||0xcc;return function(_0x560e12){if(_0x560e12){return _0x8f697f[_0xf93c('0x19')](_0x49d01f);}return _0x8f697f[_0xf93c('0x1a')](_0x49d01f)['end']();};}function respondWithResult(_0x4a9d82,_0x53d376){_0x53d376=_0x53d376||0xc8;return function(_0x1febd3){if(_0x1febd3){return _0x4a9d82[_0xf93c('0x1a')](_0x53d376)[_0xf93c('0x1b')](_0x1febd3);}};}function respondWithFilteredResult(_0x284bde,_0x483cb8){return function(_0x5a18bb){if(_0x5a18bb){var _0xb38eeb=typeof _0x483cb8[_0xf93c('0x1c')]===_0xf93c('0x1d')&&typeof _0x483cb8[_0xf93c('0x1e')]===_0xf93c('0x1d');var _0x58aa23=_0x5a18bb['count'];var _0x2cb956=_0xb38eeb?0x0:_0x483cb8[_0xf93c('0x1c')];var _0x35961a=_0xb38eeb?_0x5a18bb[_0xf93c('0x1f')]:_0x483cb8[_0xf93c('0x1c')]+_0x483cb8['limit'];var _0x1c6347;if(_0x35961a>=_0x58aa23){_0x35961a=_0x58aa23;_0x1c6347=0xc8;}else{_0x1c6347=0xce;}_0x284bde[_0xf93c('0x1a')](_0x1c6347);return _0x284bde[_0xf93c('0x20')](_0xf93c('0x21'),_0x2cb956+'-'+_0x35961a+'/'+_0x58aa23)[_0xf93c('0x1b')](_0x5a18bb);}return null;};}function patchUpdates(_0x577c07){return function(_0x259aca){try{jsonpatch[_0xf93c('0x22')](_0x259aca,_0x577c07,!![]);}catch(_0x3261a4){return BPromise[_0xf93c('0x23')](_0x3261a4);}return _0x259aca[_0xf93c('0x24')]();};}function saveUpdates(_0x3c00f9,_0x4eaa19){return function(_0x30fe28){if(_0x30fe28){return _0x30fe28['update'](_0x3c00f9)[_0xf93c('0x25')](function(_0x586269){return _0x586269;});}return null;};}function removeEntity(_0xbe7e7e,_0x3604f4){return function(_0x261beb){if(_0x261beb){return _0x261beb[_0xf93c('0x26')]()[_0xf93c('0x25')](function(){_0xbe7e7e['status'](0xcc)[_0xf93c('0x27')]();});}};}function handleEntityNotFound(_0xc8283a,_0x5e105e){return function(_0x5eaa3e){if(!_0x5eaa3e){_0xc8283a['sendStatus'](0x194);}return _0x5eaa3e;};}function handleError(_0x277852,_0x15597a){_0x15597a=_0x15597a||0x1f4;return function(_0x46a4f9){logger[_0xf93c('0x28')](_0x46a4f9[_0xf93c('0x29')]);if(_0x46a4f9[_0xf93c('0x2a')]){delete _0x46a4f9[_0xf93c('0x2a')];}_0x277852[_0xf93c('0x1a')](_0x15597a)['send'](_0x46a4f9);};}exports['index']=function(_0x2f30e,_0x552a35){var _0x6ca2d3={},_0x33c965={},_0xf4a180={'count':0x0,'rows':[]};var _0x1848c8=_['map'](db[_0xf93c('0x2b')][_0xf93c('0x2c')],function(_0x344f22){return{'name':_0x344f22['fieldName'],'type':_0x344f22[_0xf93c('0x2d')][_0xf93c('0x2e')]};});_0x33c965['model']=_[_0xf93c('0x2f')](_0x1848c8,_0xf93c('0x2a'));_0x33c965[_0xf93c('0x30')]=_[_0xf93c('0x31')](_0x2f30e['query']);_0x33c965[_0xf93c('0x32')]=_['intersection'](_0x33c965[_0xf93c('0x33')],_0x33c965[_0xf93c('0x30')]);_0x6ca2d3[_0xf93c('0x34')]=_['intersection'](_0x33c965['model'],qs[_0xf93c('0x35')](_0x2f30e['query'][_0xf93c('0x35')]));_0x6ca2d3[_0xf93c('0x34')]=_0x6ca2d3[_0xf93c('0x34')][_0xf93c('0x36')]?_0x6ca2d3['attributes']:_0x33c965['model'];if(!_0x2f30e['query'][_0xf93c('0x37')]('nolimit')){_0x6ca2d3[_0xf93c('0x1e')]=qs['limit'](_0x2f30e[_0xf93c('0x30')][_0xf93c('0x1e')]);_0x6ca2d3[_0xf93c('0x1c')]=qs[_0xf93c('0x1c')](_0x2f30e[_0xf93c('0x30')][_0xf93c('0x1c')]);}_0x6ca2d3[_0xf93c('0x38')]=qs[_0xf93c('0x39')](_0x2f30e['query']['sort']);_0x6ca2d3[_0xf93c('0x3a')]=qs[_0xf93c('0x32')](_[_0xf93c('0x3b')](_0x2f30e[_0xf93c('0x30')],_0x33c965['filters']),_0x1848c8);if(_0x2f30e[_0xf93c('0x30')][_0xf93c('0x3c')]){_0x6ca2d3[_0xf93c('0x3a')]=_[_0xf93c('0x3d')](_0x6ca2d3['where'],{'$or':_[_0xf93c('0x2f')](_0x1848c8,function(_0xc73f49){if(_0xc73f49['type']!==_0xf93c('0x3e')){var _0x2ded3e={};_0x2ded3e[_0xc73f49[_0xf93c('0x2a')]]={'$like':'%'+_0x2f30e['query'][_0xf93c('0x3c')]+'%'};return _0x2ded3e;}})});}_0x6ca2d3=_[_0xf93c('0x3d')]({},_0x6ca2d3,_0x2f30e[_0xf93c('0x3f')]);var _0x2709df={'where':_0x6ca2d3[_0xf93c('0x3a')]};return db[_0xf93c('0x2b')][_0xf93c('0x1f')](_0x2709df)[_0xf93c('0x25')](function(_0x5939ec){_0xf4a180[_0xf93c('0x1f')]=_0x5939ec;if(_0x2f30e[_0xf93c('0x30')][_0xf93c('0x40')]){_0x6ca2d3[_0xf93c('0x41')]=[{'all':!![]}];}return db['ServicenowField'][_0xf93c('0x42')](_0x6ca2d3);})[_0xf93c('0x25')](function(_0x5873a7){_0xf4a180[_0xf93c('0x43')]=_0x5873a7;return _0xf4a180;})[_0xf93c('0x25')](respondWithFilteredResult(_0x552a35,_0x6ca2d3))[_0xf93c('0x44')](handleError(_0x552a35,null));};exports['show']=function(_0xcc532c,_0x4eb346){var _0x56823e={'raw':!![],'where':{'id':_0xcc532c['params']['id']}},_0x2ed83b={};_0x2ed83b['model']=_[_0xf93c('0x31')](db[_0xf93c('0x2b')][_0xf93c('0x2c')]);_0x2ed83b[_0xf93c('0x30')]=_[_0xf93c('0x31')](_0xcc532c[_0xf93c('0x30')]);_0x2ed83b[_0xf93c('0x32')]=_[_0xf93c('0x45')](_0x2ed83b['model'],_0x2ed83b['query']);_0x56823e[_0xf93c('0x34')]=_[_0xf93c('0x45')](_0x2ed83b[_0xf93c('0x33')],qs[_0xf93c('0x35')](_0xcc532c[_0xf93c('0x30')][_0xf93c('0x35')]));_0x56823e[_0xf93c('0x34')]=_0x56823e[_0xf93c('0x34')][_0xf93c('0x36')]?_0x56823e['attributes']:_0x2ed83b[_0xf93c('0x33')];if(_0xcc532c[_0xf93c('0x30')][_0xf93c('0x40')]){_0x56823e['include']=[{'all':!![]}];}_0x56823e=_[_0xf93c('0x3d')]({},_0x56823e,_0xcc532c[_0xf93c('0x3f')]);return db[_0xf93c('0x2b')]['find'](_0x56823e)[_0xf93c('0x25')](handleEntityNotFound(_0x4eb346,null))[_0xf93c('0x25')](respondWithResult(_0x4eb346,null))[_0xf93c('0x44')](handleError(_0x4eb346,null));};exports[_0xf93c('0x46')]=function(_0x5c312f,_0x24a986){return db[_0xf93c('0x2b')]['create'](_0x5c312f[_0xf93c('0x47')],{})['then'](respondWithResult(_0x24a986,0xc9))['catch'](handleError(_0x24a986,null));};exports[_0xf93c('0x48')]=function(_0x208d98,_0x5205f5){if(_0x208d98[_0xf93c('0x47')]['id']){delete _0x208d98[_0xf93c('0x47')]['id'];}return db[_0xf93c('0x2b')][_0xf93c('0x49')]({'where':{'id':_0x208d98[_0xf93c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5205f5,null))[_0xf93c('0x25')](saveUpdates(_0x208d98[_0xf93c('0x47')],null))[_0xf93c('0x25')](respondWithResult(_0x5205f5,null))[_0xf93c('0x44')](handleError(_0x5205f5,null));};exports[_0xf93c('0x26')]=function(_0x545c0,_0x83c7c0){return db[_0xf93c('0x2b')][_0xf93c('0x49')]({'where':{'id':_0x545c0[_0xf93c('0x4a')]['id']}})[_0xf93c('0x25')](handleEntityNotFound(_0x83c7c0,null))[_0xf93c('0x25')](removeEntity(_0x83c7c0,null))[_0xf93c('0x44')](handleError(_0x83c7c0,null));}; \ No newline at end of file +var _0x0062=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','ServicenowField','findAll','show','params','includeAll','create','body','find','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x0062,0x11e));var _0x2006=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0x0062[_0x57928b];return _0x49aad6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2006('0x0'));var jsonpatch=require(_0x2006('0x1'));var rp=require(_0x2006('0x2'));var moment=require(_0x2006('0x3'));var BPromise=require(_0x2006('0x4'));var Mustache=require(_0x2006('0x5'));var util=require('util');var path=require(_0x2006('0x6'));var sox=require(_0x2006('0x7'));var csv=require('to-csv');var ejs=require(_0x2006('0x8'));var fs=require('fs');var fs_extra=require(_0x2006('0x9'));var _=require(_0x2006('0xa'));var squel=require('squel');var crypto=require(_0x2006('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2006('0xc'));var toCsv=require(_0x2006('0xd'));var querystring=require(_0x2006('0xe'));var Papa=require('papaparse');var Redis=require(_0x2006('0xf'));var authService=require(_0x2006('0x10'));var qs=require(_0x2006('0x11'));var as=require(_0x2006('0x12'));var hardwareService=require(_0x2006('0x13'));var logger=require(_0x2006('0x14'))(_0x2006('0x15'));var utils=require(_0x2006('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2006('0x17'));var db=require(_0x2006('0x18'))['db'];function respondWithStatusCode(_0x3e86fd,_0xb5939){_0xb5939=_0xb5939||0xcc;return function(_0x5440fa){if(_0x5440fa){return _0x3e86fd[_0x2006('0x19')](_0xb5939);}return _0x3e86fd[_0x2006('0x1a')](_0xb5939)['end']();};}function respondWithResult(_0x4bac89,_0x120d13){_0x120d13=_0x120d13||0xc8;return function(_0x30d35b){if(_0x30d35b){return _0x4bac89[_0x2006('0x1a')](_0x120d13)[_0x2006('0x1b')](_0x30d35b);}};}function respondWithFilteredResult(_0x37de55,_0x36f604){return function(_0x3c65b6){if(_0x3c65b6){var _0x459543=typeof _0x36f604[_0x2006('0x1c')]===_0x2006('0x1d')&&typeof _0x36f604[_0x2006('0x1e')]==='undefined';var _0x166311=_0x3c65b6['count'];var _0x12ec5=_0x459543?0x0:_0x36f604['offset'];var _0x571268=_0x459543?_0x3c65b6[_0x2006('0x1f')]:_0x36f604[_0x2006('0x1c')]+_0x36f604[_0x2006('0x1e')];var _0x585fcb;if(_0x571268>=_0x166311){_0x571268=_0x166311;_0x585fcb=0xc8;}else{_0x585fcb=0xce;}_0x37de55[_0x2006('0x1a')](_0x585fcb);return _0x37de55['set'](_0x2006('0x20'),_0x12ec5+'-'+_0x571268+'/'+_0x166311)[_0x2006('0x1b')](_0x3c65b6);}return null;};}function patchUpdates(_0x433062){return function(_0x1822d4){try{jsonpatch[_0x2006('0x21')](_0x1822d4,_0x433062,!![]);}catch(_0x4d8365){return BPromise['reject'](_0x4d8365);}return _0x1822d4[_0x2006('0x22')]();};}function saveUpdates(_0x4c9d7e,_0x53b062){return function(_0x1ece64){if(_0x1ece64){return _0x1ece64[_0x2006('0x23')](_0x4c9d7e)['then'](function(_0x3e88cc){return _0x3e88cc;});}return null;};}function removeEntity(_0x967a2f,_0x42f5f3){return function(_0x36438a){if(_0x36438a){return _0x36438a[_0x2006('0x24')]()[_0x2006('0x25')](function(){_0x967a2f[_0x2006('0x1a')](0xcc)[_0x2006('0x26')]();});}};}function handleEntityNotFound(_0x2b30ad,_0x6b4980){return function(_0x3e1ab5){if(!_0x3e1ab5){_0x2b30ad['sendStatus'](0x194);}return _0x3e1ab5;};}function handleError(_0x34837c,_0x4a6fb0){_0x4a6fb0=_0x4a6fb0||0x1f4;return function(_0x23055b){logger['error'](_0x23055b[_0x2006('0x27')]);if(_0x23055b[_0x2006('0x28')]){delete _0x23055b[_0x2006('0x28')];}_0x34837c[_0x2006('0x1a')](_0x4a6fb0)[_0x2006('0x29')](_0x23055b);};}exports[_0x2006('0x2a')]=function(_0x196680,_0x346104){var _0x56cf06={},_0x29cc69={},_0x514fbf={'count':0x0,'rows':[]};var _0x3dcb37=_[_0x2006('0x2b')](db['ServicenowField'][_0x2006('0x2c')],function(_0xe62bd0){return{'name':_0xe62bd0[_0x2006('0x2d')],'type':_0xe62bd0['type'][_0x2006('0x2e')]};});_0x29cc69[_0x2006('0x2f')]=_[_0x2006('0x2b')](_0x3dcb37,_0x2006('0x28'));_0x29cc69[_0x2006('0x30')]=_[_0x2006('0x31')](_0x196680[_0x2006('0x30')]);_0x29cc69[_0x2006('0x32')]=_['intersection'](_0x29cc69[_0x2006('0x2f')],_0x29cc69['query']);_0x56cf06[_0x2006('0x33')]=_[_0x2006('0x34')](_0x29cc69['model'],qs[_0x2006('0x35')](_0x196680[_0x2006('0x30')][_0x2006('0x35')]));_0x56cf06[_0x2006('0x33')]=_0x56cf06[_0x2006('0x33')][_0x2006('0x36')]?_0x56cf06[_0x2006('0x33')]:_0x29cc69['model'];if(!_0x196680[_0x2006('0x30')][_0x2006('0x37')](_0x2006('0x38'))){_0x56cf06['limit']=qs[_0x2006('0x1e')](_0x196680[_0x2006('0x30')][_0x2006('0x1e')]);_0x56cf06[_0x2006('0x1c')]=qs[_0x2006('0x1c')](_0x196680[_0x2006('0x30')][_0x2006('0x1c')]);}_0x56cf06[_0x2006('0x39')]=qs[_0x2006('0x3a')](_0x196680[_0x2006('0x30')]['sort']);_0x56cf06[_0x2006('0x3b')]=qs[_0x2006('0x32')](_['pick'](_0x196680[_0x2006('0x30')],_0x29cc69['filters']),_0x3dcb37);if(_0x196680[_0x2006('0x30')][_0x2006('0x3c')]){_0x56cf06[_0x2006('0x3b')]=_['merge'](_0x56cf06[_0x2006('0x3b')],{'$or':_['map'](_0x3dcb37,function(_0x1a74b4){if(_0x1a74b4[_0x2006('0x3d')]!==_0x2006('0x3e')){var _0x1c9a96={};_0x1c9a96[_0x1a74b4[_0x2006('0x28')]]={'$like':'%'+_0x196680[_0x2006('0x30')]['filter']+'%'};return _0x1c9a96;}})});}_0x56cf06=_[_0x2006('0x3f')]({},_0x56cf06,_0x196680[_0x2006('0x40')]);var _0x107cf5={'where':_0x56cf06['where']};return db['ServicenowField'][_0x2006('0x1f')](_0x107cf5)[_0x2006('0x25')](function(_0x1b7ef7){_0x514fbf[_0x2006('0x1f')]=_0x1b7ef7;if(_0x196680[_0x2006('0x30')]['includeAll']){_0x56cf06[_0x2006('0x41')]=[{'all':!![]}];}return db[_0x2006('0x42')][_0x2006('0x43')](_0x56cf06);})[_0x2006('0x25')](function(_0x5d63a6){_0x514fbf['rows']=_0x5d63a6;return _0x514fbf;})[_0x2006('0x25')](respondWithFilteredResult(_0x346104,_0x56cf06))['catch'](handleError(_0x346104,null));};exports[_0x2006('0x44')]=function(_0x3328c6,_0x10f652){var _0x512927={'raw':!![],'where':{'id':_0x3328c6[_0x2006('0x45')]['id']}},_0x5d9e7d={};_0x5d9e7d[_0x2006('0x2f')]=_['keys'](db[_0x2006('0x42')][_0x2006('0x2c')]);_0x5d9e7d[_0x2006('0x30')]=_[_0x2006('0x31')](_0x3328c6[_0x2006('0x30')]);_0x5d9e7d[_0x2006('0x32')]=_[_0x2006('0x34')](_0x5d9e7d[_0x2006('0x2f')],_0x5d9e7d[_0x2006('0x30')]);_0x512927[_0x2006('0x33')]=_['intersection'](_0x5d9e7d['model'],qs[_0x2006('0x35')](_0x3328c6[_0x2006('0x30')][_0x2006('0x35')]));_0x512927['attributes']=_0x512927[_0x2006('0x33')]['length']?_0x512927[_0x2006('0x33')]:_0x5d9e7d[_0x2006('0x2f')];if(_0x3328c6[_0x2006('0x30')][_0x2006('0x46')]){_0x512927[_0x2006('0x41')]=[{'all':!![]}];}_0x512927=_[_0x2006('0x3f')]({},_0x512927,_0x3328c6[_0x2006('0x40')]);return db['ServicenowField']['find'](_0x512927)[_0x2006('0x25')](handleEntityNotFound(_0x10f652,null))[_0x2006('0x25')](respondWithResult(_0x10f652,null))['catch'](handleError(_0x10f652,null));};exports[_0x2006('0x47')]=function(_0x951053,_0x9e36be){return db[_0x2006('0x42')][_0x2006('0x47')](_0x951053[_0x2006('0x48')],{})[_0x2006('0x25')](respondWithResult(_0x9e36be,0xc9))['catch'](handleError(_0x9e36be,null));};exports['update']=function(_0x3ec380,_0x3b2a4d){if(_0x3ec380[_0x2006('0x48')]['id']){delete _0x3ec380[_0x2006('0x48')]['id'];}return db['ServicenowField'][_0x2006('0x49')]({'where':{'id':_0x3ec380[_0x2006('0x45')]['id']}})[_0x2006('0x25')](handleEntityNotFound(_0x3b2a4d,null))['then'](saveUpdates(_0x3ec380[_0x2006('0x48')],null))[_0x2006('0x25')](respondWithResult(_0x3b2a4d,null))[_0x2006('0x4a')](handleError(_0x3b2a4d,null));};exports[_0x2006('0x24')]=function(_0x5f1891,_0x3527ff){return db[_0x2006('0x42')][_0x2006('0x49')]({'where':{'id':_0x5f1891[_0x2006('0x45')]['id']}})['then'](handleEntityNotFound(_0x3527ff,null))[_0x2006('0x25')](removeEntity(_0x3527ff,null))[_0x2006('0x4a')](handleError(_0x3527ff,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index a6543b2..ef0046b 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 _0x9c90=['./intServicenowField.attributes','define','ServicenowField','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c90,0x18d));var _0x09c9=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x9c90[_0x2e76a7];return _0x454cde;};'use strict';var _=require(_0x09c9('0x0'));var util=require(_0x09c9('0x1'));var logger=require(_0x09c9('0x2'))(_0x09c9('0x3'));var moment=require(_0x09c9('0x4'));var BPromise=require(_0x09c9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c9('0x6'));var rimraf=require(_0x09c9('0x7'));var config=require(_0x09c9('0x8'));var attributes=require(_0x09c9('0x9'));module['exports']=function(_0x515380,_0x4f0835){return _0x515380[_0x09c9('0xa')](_0x09c9('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x09c9('0xc'),_0x09c9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x48a3=['util','api','moment','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','FieldId','lodash'];(function(_0xa82688,_0x3d82f0){var _0x5c1582=function(_0x3214e2){while(--_0x3214e2){_0xa82688['push'](_0xa82688['shift']());}};_0x5c1582(++_0x3d82f0);}(_0x48a3,0x1c6));var _0x348a=function(_0x16697e,_0x112bf8){_0x16697e=_0x16697e-0x0;var _0x218ede=_0x48a3[_0x16697e];return _0x218ede;};'use strict';var _=require(_0x348a('0x0'));var util=require(_0x348a('0x1'));var logger=require('../../config/logger')(_0x348a('0x2'));var moment=require(_0x348a('0x3'));var BPromise=require('bluebird');var rp=require(_0x348a('0x4'));var fs=require('fs');var path=require(_0x348a('0x5'));var rimraf=require(_0x348a('0x6'));var config=require('../../config/environment');var attributes=require(_0x348a('0x7'));module[_0x348a('0x8')]=function(_0x5c2830,_0x588603){return _0x5c2830[_0x348a('0x9')](_0x348a('0xa'),attributes,{'tableName':_0x348a('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0x348a('0xc')],'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 cc269bf..6738324 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 _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\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(_0x1bfaff,_0x237975){var _0x23060a=function(_0x34f9fe){while(--_0x34f9fe){_0x1bfaff['push'](_0x1bfaff['shift']());}};_0x23060a(++_0x237975);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'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')]('ServicenowField,\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 _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1e9412,_0xb4aa22){var _0x320797=function(_0x5d0759){while(--_0x5d0759){_0x1e9412['push'](_0x1e9412['shift']());}};_0x320797(++_0xb4aa22);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5253aa,_0x3d6557){_0x5253aa=_0x5253aa-0x0;var _0x42b6bd=_0x9bde[_0x5253aa];return _0x42b6bd;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 987328e..0667cb2 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3b1adf,_0x1c139d){var _0x34b931=function(_0x87793d){while(--_0x87793d){_0x3b1adf['push'](_0x3b1adf['shift']());}};_0x34b931(++_0x1c139d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x30c182,_0x298cb8){var _0x472c29=function(_0x18146d){while(--_0x18146d){_0x30c182['push'](_0x30c182['shift']());}};_0x472c29(++_0x298cb8);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index fad114f..c9eadad 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 _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x379f08,_0x19cf64){var _0x36e2db=function(_0x1e5682){while(--_0x1e5682){_0x379f08['push'](_0x379f08['shift']());}};_0x36e2db(++_0x19cf64);}(_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')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3aceee,_0x4290a8){var _0x486bcb=function(_0x187d06){while(--_0x187d06){_0x3aceee['push'](_0x3aceee['shift']());}};_0x486bcb(++_0x4290a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 1b7e116..8e47fcb 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 _0x0fca=['rows','catch','show','params','intersection','includeAll','find','create','body','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','duration_hours','parent_id','parent_type','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','username','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','stringify','includes','label','endsWith','values','test','statusCode','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','SugarcrmAccount','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll'];(function(_0x3ebbcb,_0x489663){var _0x5bab8b=function(_0x5cb775){while(--_0x5cb775){_0x3ebbcb['push'](_0x3ebbcb['shift']());}};_0x5bab8b(++_0x489663);}(_0x0fca,0x185));var _0xa0fc=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0fca[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xa0fc('0x0'));var rimraf=require(_0xa0fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa0fc('0x2'));var moment=require(_0xa0fc('0x3'));var BPromise=require(_0xa0fc('0x4'));var Mustache=require('mustache');var util=require(_0xa0fc('0x5'));var path=require(_0xa0fc('0x6'));var sox=require('sox');var csv=require(_0xa0fc('0x7'));var ejs=require(_0xa0fc('0x8'));var fs=require('fs');var fs_extra=require(_0xa0fc('0x9'));var _=require(_0xa0fc('0xa'));var squel=require(_0xa0fc('0xb'));var crypto=require(_0xa0fc('0xc'));var jsforce=require(_0xa0fc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa0fc('0xe'));var Papa=require(_0xa0fc('0xf'));var Redis=require('ioredis');var authService=require(_0xa0fc('0x10'));var qs=require(_0xa0fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0fc('0x12'))(_0xa0fc('0x13'));var utils=require(_0xa0fc('0x14'));var config=require(_0xa0fc('0x15'));var licenseUtil=require(_0xa0fc('0x16'));var db=require(_0xa0fc('0x17'))['db'];var integrations=require(_0xa0fc('0x18'));function respondWithStatusCode(_0x331429,_0x29a2ca){_0x29a2ca=_0x29a2ca||0xcc;return function(_0x42793){if(_0x42793){return _0x331429[_0xa0fc('0x19')](_0x29a2ca);}return _0x331429[_0xa0fc('0x1a')](_0x29a2ca)['end']();};}function respondWithResult(_0xb55247,_0x12ab29){_0x12ab29=_0x12ab29||0xc8;return function(_0x36adb3){if(_0x36adb3){return _0xb55247[_0xa0fc('0x1a')](_0x12ab29)[_0xa0fc('0x1b')](_0x36adb3);}};}function respondWithFilteredResult(_0x154f89,_0x55f921){return function(_0x2cd3cd){if(_0x2cd3cd){var _0x17a2d1=typeof _0x55f921[_0xa0fc('0x1c')]===_0xa0fc('0x1d')&&typeof _0x55f921[_0xa0fc('0x1e')]==='undefined';var _0x511583=_0x2cd3cd[_0xa0fc('0x1f')];var _0x3cbbbb=_0x17a2d1?0x0:_0x55f921[_0xa0fc('0x1c')];var _0x2f24c8=_0x17a2d1?_0x2cd3cd[_0xa0fc('0x1f')]:_0x55f921['offset']+_0x55f921[_0xa0fc('0x1e')];var _0x511a01;if(_0x2f24c8>=_0x511583){_0x2f24c8=_0x511583;_0x511a01=0xc8;}else{_0x511a01=0xce;}_0x154f89[_0xa0fc('0x1a')](_0x511a01);return _0x154f89['set'](_0xa0fc('0x20'),_0x3cbbbb+'-'+_0x2f24c8+'/'+_0x511583)['json'](_0x2cd3cd);}return null;};}function patchUpdates(_0x1e4ca2){return function(_0xd43429){try{jsonpatch[_0xa0fc('0x21')](_0xd43429,_0x1e4ca2,!![]);}catch(_0x33d65f){return BPromise[_0xa0fc('0x22')](_0x33d65f);}return _0xd43429[_0xa0fc('0x23')]();};}function saveUpdates(_0x35b13b,_0x4185db){return function(_0x1f2eaf){if(_0x1f2eaf){return _0x1f2eaf[_0xa0fc('0x24')](_0x35b13b)[_0xa0fc('0x25')](function(_0x49aa8a){return _0x49aa8a;});}return null;};}function removeEntity(_0x59def0,_0x295bd0){return function(_0x436aba){if(_0x436aba){return _0x436aba[_0xa0fc('0x26')]()[_0xa0fc('0x25')](function(){_0x59def0['status'](0xcc)[_0xa0fc('0x27')]();});}};}function handleEntityNotFound(_0x228955,_0x30fec1){return function(_0x23a68c){if(!_0x23a68c){_0x228955[_0xa0fc('0x19')](0x194);}return _0x23a68c;};}function handleError(_0x3365e1,_0xd3c5f2){_0xd3c5f2=_0xd3c5f2||0x1f4;return function(_0x2761c7){logger[_0xa0fc('0x28')](_0x2761c7[_0xa0fc('0x29')]);if(_0x2761c7[_0xa0fc('0x2a')]){delete _0x2761c7[_0xa0fc('0x2a')];}_0x3365e1[_0xa0fc('0x1a')](_0xd3c5f2)[_0xa0fc('0x2b')](_0x2761c7);};}exports['index']=function(_0x5770f4,_0x268c75){var _0x4f8fa7={},_0x503638={},_0x420498={'count':0x0,'rows':[]};var _0x522207=_[_0xa0fc('0x2c')](db[_0xa0fc('0x2d')][_0xa0fc('0x2e')],function(_0x286ee4){return{'name':_0x286ee4['fieldName'],'type':_0x286ee4[_0xa0fc('0x2f')]['key']};});_0x503638[_0xa0fc('0x30')]=_[_0xa0fc('0x2c')](_0x522207,_0xa0fc('0x2a'));_0x503638[_0xa0fc('0x31')]=_[_0xa0fc('0x32')](_0x5770f4[_0xa0fc('0x31')]);_0x503638[_0xa0fc('0x33')]=_['intersection'](_0x503638['model'],_0x503638[_0xa0fc('0x31')]);_0x4f8fa7[_0xa0fc('0x34')]=_['intersection'](_0x503638[_0xa0fc('0x30')],qs[_0xa0fc('0x35')](_0x5770f4[_0xa0fc('0x31')]['fields']));_0x4f8fa7['attributes']=_0x4f8fa7[_0xa0fc('0x34')][_0xa0fc('0x36')]?_0x4f8fa7[_0xa0fc('0x34')]:_0x503638[_0xa0fc('0x30')];if(!_0x5770f4[_0xa0fc('0x31')][_0xa0fc('0x37')](_0xa0fc('0x38'))){_0x4f8fa7[_0xa0fc('0x1e')]=qs[_0xa0fc('0x1e')](_0x5770f4[_0xa0fc('0x31')]['limit']);_0x4f8fa7[_0xa0fc('0x1c')]=qs[_0xa0fc('0x1c')](_0x5770f4['query']['offset']);}_0x4f8fa7[_0xa0fc('0x39')]=qs[_0xa0fc('0x3a')](_0x5770f4[_0xa0fc('0x31')]['sort']);_0x4f8fa7[_0xa0fc('0x3b')]=qs[_0xa0fc('0x33')](_[_0xa0fc('0x3c')](_0x5770f4[_0xa0fc('0x31')],_0x503638['filters']),_0x522207);if(_0x5770f4[_0xa0fc('0x31')][_0xa0fc('0x3d')]){_0x4f8fa7[_0xa0fc('0x3b')]=_['merge'](_0x4f8fa7[_0xa0fc('0x3b')],{'$or':_[_0xa0fc('0x2c')](_0x522207,function(_0x111e01){if(_0x111e01[_0xa0fc('0x2f')]!==_0xa0fc('0x3e')){var _0x37e25f={};_0x37e25f[_0x111e01['name']]={'$like':'%'+_0x5770f4[_0xa0fc('0x31')][_0xa0fc('0x3d')]+'%'};return _0x37e25f;}})});}_0x4f8fa7=_[_0xa0fc('0x3f')]({},_0x4f8fa7,_0x5770f4[_0xa0fc('0x40')]);var _0x926af6={'where':_0x4f8fa7['where']};return db[_0xa0fc('0x2d')]['count'](_0x926af6)[_0xa0fc('0x25')](function(_0x1d4d8b){_0x420498[_0xa0fc('0x1f')]=_0x1d4d8b;if(_0x5770f4[_0xa0fc('0x31')]['includeAll']){_0x4f8fa7[_0xa0fc('0x41')]=[{'all':!![]}];}return db[_0xa0fc('0x2d')][_0xa0fc('0x42')](_0x4f8fa7);})['then'](function(_0x2bc432){_0x420498[_0xa0fc('0x43')]=_0x2bc432;return _0x420498;})[_0xa0fc('0x25')](respondWithFilteredResult(_0x268c75,_0x4f8fa7))[_0xa0fc('0x44')](handleError(_0x268c75,null));};exports[_0xa0fc('0x45')]=function(_0x384aa9,_0x36c011){var _0x4fa6c8={'raw':![],'where':{'id':_0x384aa9[_0xa0fc('0x46')]['id']}},_0x4efcc1={};_0x4efcc1[_0xa0fc('0x30')]=_[_0xa0fc('0x32')](db[_0xa0fc('0x2d')][_0xa0fc('0x2e')]);_0x4efcc1['query']=_[_0xa0fc('0x32')](_0x384aa9['query']);_0x4efcc1[_0xa0fc('0x33')]=_[_0xa0fc('0x47')](_0x4efcc1[_0xa0fc('0x30')],_0x4efcc1[_0xa0fc('0x31')]);_0x4fa6c8[_0xa0fc('0x34')]=_[_0xa0fc('0x47')](_0x4efcc1[_0xa0fc('0x30')],qs[_0xa0fc('0x35')](_0x384aa9[_0xa0fc('0x31')]['fields']));_0x4fa6c8[_0xa0fc('0x34')]=_0x4fa6c8[_0xa0fc('0x34')][_0xa0fc('0x36')]?_0x4fa6c8[_0xa0fc('0x34')]:_0x4efcc1[_0xa0fc('0x30')];if(_0x384aa9[_0xa0fc('0x31')][_0xa0fc('0x48')]){_0x4fa6c8['include']=[{'all':!![]}];}_0x4fa6c8=_[_0xa0fc('0x3f')]({},_0x4fa6c8,_0x384aa9[_0xa0fc('0x40')]);return db[_0xa0fc('0x2d')][_0xa0fc('0x49')](_0x4fa6c8)[_0xa0fc('0x25')](handleEntityNotFound(_0x36c011,null))['then'](respondWithResult(_0x36c011,null))[_0xa0fc('0x44')](handleError(_0x36c011,null));};exports[_0xa0fc('0x4a')]=function(_0x3f75af,_0x5be96d){return db[_0xa0fc('0x2d')][_0xa0fc('0x4a')](_0x3f75af[_0xa0fc('0x4b')],{})['then'](respondWithResult(_0x5be96d,0xc9))[_0xa0fc('0x44')](handleError(_0x5be96d,null));};exports['update']=function(_0x4e2790,_0x3fd479){if(_0x4e2790[_0xa0fc('0x4b')]['id']){delete _0x4e2790[_0xa0fc('0x4b')]['id'];}return db[_0xa0fc('0x2d')][_0xa0fc('0x49')]({'where':{'id':_0x4e2790[_0xa0fc('0x46')]['id']}})[_0xa0fc('0x25')](handleEntityNotFound(_0x3fd479,null))[_0xa0fc('0x25')](saveUpdates(_0x4e2790[_0xa0fc('0x4b')],null))[_0xa0fc('0x25')](respondWithResult(_0x3fd479,null))[_0xa0fc('0x44')](handleError(_0x3fd479,null));};exports[_0xa0fc('0x26')]=function(_0x26196e,_0x43e27d){return db[_0xa0fc('0x2d')][_0xa0fc('0x49')]({'where':{'id':_0x26196e[_0xa0fc('0x46')]['id']}})[_0xa0fc('0x25')](handleEntityNotFound(_0x43e27d,null))[_0xa0fc('0x25')](removeEntity(_0x43e27d,null))[_0xa0fc('0x44')](handleError(_0x43e27d,null));};exports[_0xa0fc('0x4c')]=function(_0x5cbbcc,_0x417632,_0xafda11){var _0x2442d0={};var _0x5e6b02={};var _0x5a1df2;var _0x483da0;return db[_0xa0fc('0x2d')]['findOne']({'where':{'id':_0x5cbbcc[_0xa0fc('0x46')]['id']}})[_0xa0fc('0x25')](handleEntityNotFound(_0x417632,null))[_0xa0fc('0x25')](function(_0x52cfb5){if(_0x52cfb5){_0x5a1df2=_0x52cfb5;_0x5e6b02['model']=_[_0xa0fc('0x32')](db['SugarcrmConfiguration']['rawAttributes']);_0x5e6b02[_0xa0fc('0x31')]=_[_0xa0fc('0x32')](_0x5cbbcc[_0xa0fc('0x31')]);_0x5e6b02[_0xa0fc('0x33')]=_[_0xa0fc('0x47')](_0x5e6b02['model'],_0x5e6b02[_0xa0fc('0x31')]);_0x2442d0['attributes']=_[_0xa0fc('0x47')](_0x5e6b02['model'],qs[_0xa0fc('0x35')](_0x5cbbcc[_0xa0fc('0x31')][_0xa0fc('0x35')]));_0x2442d0['attributes']=_0x2442d0[_0xa0fc('0x34')][_0xa0fc('0x36')]?_0x2442d0[_0xa0fc('0x34')]:_0x5e6b02[_0xa0fc('0x30')];_0x2442d0[_0xa0fc('0x39')]=qs['sort'](_0x5cbbcc[_0xa0fc('0x31')]['sort']);_0x2442d0['where']=qs[_0xa0fc('0x33')](_['pick'](_0x5cbbcc['query'],_0x5e6b02[_0xa0fc('0x33')]));if(_0x5cbbcc['query'][_0xa0fc('0x3d')]){_0x2442d0['where']=_[_0xa0fc('0x3f')](_0x2442d0[_0xa0fc('0x3b')],{'$or':_[_0xa0fc('0x2c')](_0x2442d0[_0xa0fc('0x34')],function(_0x11a145){var _0x5a6420={};_0x5a6420[_0x11a145]={'$like':'%'+_0x5cbbcc[_0xa0fc('0x31')][_0xa0fc('0x3d')]+'%'};return _0x5a6420;})});}_0x2442d0=_['merge']({},_0x2442d0,_0x5cbbcc[_0xa0fc('0x40')]);return _0x5a1df2[_0xa0fc('0x4c')](_0x2442d0);}})['then'](function(_0x4c2b37){if(_0x4c2b37){_0x483da0=_0x4c2b37[_0xa0fc('0x36')];if(!_0x5cbbcc[_0xa0fc('0x31')][_0xa0fc('0x37')](_0xa0fc('0x38'))){_0x2442d0['limit']=qs[_0xa0fc('0x1e')](_0x5cbbcc['query']['limit']);_0x2442d0['offset']=qs['offset'](_0x5cbbcc[_0xa0fc('0x31')][_0xa0fc('0x1c')]);}return _0x5a1df2[_0xa0fc('0x4c')](_0x2442d0);}})[_0xa0fc('0x25')](function(_0x50d805){if(_0x50d805){return _0x50d805?{'count':_0x483da0,'rows':_0x50d805}:null;}})['then'](respondWithResult(_0x417632,null))['catch'](handleError(_0x417632,null));};exports[_0xa0fc('0x4d')]=function(_0x26de52,_0x51b9b9,_0xb5fd42){if(_0x26de52[_0xa0fc('0x4b')]['id']){delete _0x26de52[_0xa0fc('0x4b')]['id'];}return db[_0xa0fc('0x2d')][_0xa0fc('0x4e')]({'where':{'id':_0x26de52[_0xa0fc('0x46')]['id']}})[_0xa0fc('0x25')](handleEntityNotFound(_0x51b9b9,null))[_0xa0fc('0x25')](function(_0x482838){if(_0x482838){_0x26de52[_0xa0fc('0x4b')]['AccountId']=_0x482838['id'];_0x26de52[_0xa0fc('0x4b')][_0xa0fc('0x4f')]=integrations[_0xa0fc('0x50')](_0x26de52[_0xa0fc('0x4b')][_0xa0fc('0x51')],_0x26de52[_0xa0fc('0x4b')][_0xa0fc('0x2f')]);_0x26de52[_0xa0fc('0x4b')][_0xa0fc('0x52')]=integrations[_0xa0fc('0x53')](_0x26de52[_0xa0fc('0x4b')]['channel'],_0x26de52[_0xa0fc('0x4b')][_0xa0fc('0x2f')]);return db['SugarcrmConfiguration']['create'](_0x26de52[_0xa0fc('0x4b')],{'include':[{'model':db[_0xa0fc('0x54')],'as':_0xa0fc('0x4f')},{'model':db[_0xa0fc('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x51b9b9,null))[_0xa0fc('0x44')](handleError(_0x51b9b9,null));};exports[_0xa0fc('0x55')]=function(_0x33d742,_0x90b7fe,_0x239280){var _0x345814='';var _0x4bb207=['id',_0xa0fc('0x2a'),_0xa0fc('0x56'),'created_by','description','date_start',_0xa0fc('0x57'),'duration_minutes',_0xa0fc('0x58'),_0xa0fc('0x59'),'parent_name',_0xa0fc('0x5a')];return db[_0xa0fc('0x2d')][_0xa0fc('0x4e')]({'where':{'id':_0x33d742[_0xa0fc('0x46')]['id']},'attributes':['id','username',_0xa0fc('0x5b'),_0xa0fc('0x5c')]})[_0xa0fc('0x25')](handleEntityNotFound(_0x90b7fe,null))[_0xa0fc('0x25')](function(_0x19f128){if(_0x19f128){_0x345814=_0x19f128[_0xa0fc('0x5c')];var _0x3fc556=_0x345814[_0xa0fc('0x5d')](-0x1);if(_0x3fc556==='/'){_0x345814=_0x345814[_0xa0fc('0x5e')](0x0,_0x345814[_0xa0fc('0x5f')](_0x3fc556));}return rp({'method':_0xa0fc('0x60'),'uri':util[_0xa0fc('0x61')](_0xa0fc('0x62'),_0x345814,_0xa0fc('0x63')),'json':!![],'form':{'method':_0xa0fc('0x64'),'input_type':_0xa0fc('0x65'),'response_type':_0xa0fc('0x65'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x19f128[_0xa0fc('0x66')],'password':_0x19f128[_0xa0fc('0x5b')],'encryption':'PLAIN'},'application':_0xa0fc('0x67')})}});}})[_0xa0fc('0x25')](function(_0x38714c){if(_0x38714c&&_0x38714c[_0xa0fc('0x2a')]!==_0xa0fc('0x68')&&_0x38714c['name']!=='Password\x20Expired'){return rp({'method':_0xa0fc('0x60'),'uri':util[_0xa0fc('0x61')]('%s%s',_0x345814,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa0fc('0x69'),'input_type':'JSON','response_type':_0xa0fc('0x65'),'rest_data':JSON[_0xa0fc('0x6a')]({'session':_0x38714c['id'],'module_name':'Calls'})}})[_0xa0fc('0x25')](function(_0x2b1910){if(_0x2b1910){var _0x6a78d6=_['values'](_0x2b1910['module_fields']);_['remove'](_0x6a78d6,function(_0x5c8532){return _0x4bb207[_0xa0fc('0x6b')](_0x5c8532[_0xa0fc('0x2a')]);});return{'count':_0x6a78d6['length'],'rows':_[_0xa0fc('0x2c')](_0x6a78d6,function(_0x51cc40){return{'id':_0x51cc40[_0xa0fc('0x2a')],'name':_0x51cc40[_0xa0fc('0x6c')],'custom':_[_0xa0fc('0x6d')](_0x51cc40[_0xa0fc('0x2a')],'_c')?!![]:![],'options':_0x51cc40[_0xa0fc('0x40')]?_['map'](_[_0xa0fc('0x6e')](_0x51cc40[_0xa0fc('0x40')]),function(_0x32138d){return{'name':_0x32138d['value'],'value':_0x32138d[_0xa0fc('0x2a')]};}):[]};})};}})['then'](respondWithResult(_0x90b7fe,null))[_0xa0fc('0x44')](function(_0x42cc40){var _0x34b34b=_0x33d742[_0xa0fc('0x31')][_0xa0fc('0x6f')]?0x1f4:_0x42cc40[_0xa0fc('0x70')]||0x1f4;logger[_0xa0fc('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xa0fc('0x55'),_0x34b34b,JSON[_0xa0fc('0x6a')](_0x42cc40));delete _0x42cc40['name'];if(_0x34b34b===0x191){_0x34b34b=0x190;}_0x90b7fe[_0xa0fc('0x1a')](_0x34b34b)[_0xa0fc('0x2b')](_0x33d742[_0xa0fc('0x31')][_0xa0fc('0x6f')]?{'message':_0xa0fc('0x71'),'statusCode':_0x42cc40[_0xa0fc('0x70')]}:_0x42cc40);});}else{var _0xaf8264=0x1f4;_0x90b7fe[_0xa0fc('0x1a')](_0xaf8264)[_0xa0fc('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x32e4=['getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','JSON','Calls','module_fields','remove','includes','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','end','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','SugarcrmAccount','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','getConfigurations','findOne','SugarcrmConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x32e4,0x99));var _0x432e=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x32e4[_0x3cb6dc];return _0x47ec89;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x432e('0x0'));var jsonpatch=require(_0x432e('0x1'));var rp=require(_0x432e('0x2'));var moment=require(_0x432e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x432e('0x4'));var util=require(_0x432e('0x5'));var path=require(_0x432e('0x6'));var sox=require(_0x432e('0x7'));var csv=require(_0x432e('0x8'));var ejs=require(_0x432e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x432e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x432e('0xb'));var deskjs=require(_0x432e('0xc'));var toCsv=require(_0x432e('0x8'));var querystring=require(_0x432e('0xd'));var Papa=require(_0x432e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x432e('0xf'));var as=require(_0x432e('0x10'));var hardwareService=require(_0x432e('0x11'));var logger=require(_0x432e('0x12'))(_0x432e('0x13'));var utils=require(_0x432e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x432e('0x15'));var db=require(_0x432e('0x16'))['db'];var integrations=require(_0x432e('0x17'));function respondWithStatusCode(_0x3d3d54,_0x23f5f6){_0x23f5f6=_0x23f5f6||0xcc;return function(_0x3470a7){if(_0x3470a7){return _0x3d3d54[_0x432e('0x18')](_0x23f5f6);}return _0x3d3d54['status'](_0x23f5f6)['end']();};}function respondWithResult(_0x21d3e4,_0x1e32ab){_0x1e32ab=_0x1e32ab||0xc8;return function(_0x119d7f){if(_0x119d7f){return _0x21d3e4[_0x432e('0x19')](_0x1e32ab)[_0x432e('0x1a')](_0x119d7f);}};}function respondWithFilteredResult(_0x9b7006,_0x1a25dc){return function(_0x44b144){if(_0x44b144){var _0xdc058c=typeof _0x1a25dc[_0x432e('0x1b')]==='undefined'&&typeof _0x1a25dc['limit']===_0x432e('0x1c');var _0x2c1d95=_0x44b144[_0x432e('0x1d')];var _0x6f0c7a=_0xdc058c?0x0:_0x1a25dc[_0x432e('0x1b')];var _0x1a9ca9=_0xdc058c?_0x44b144['count']:_0x1a25dc[_0x432e('0x1b')]+_0x1a25dc['limit'];var _0x45dcff;if(_0x1a9ca9>=_0x2c1d95){_0x1a9ca9=_0x2c1d95;_0x45dcff=0xc8;}else{_0x45dcff=0xce;}_0x9b7006[_0x432e('0x19')](_0x45dcff);return _0x9b7006[_0x432e('0x1e')](_0x432e('0x1f'),_0x6f0c7a+'-'+_0x1a9ca9+'/'+_0x2c1d95)[_0x432e('0x1a')](_0x44b144);}return null;};}function patchUpdates(_0xb59e09){return function(_0x2c14d1){try{jsonpatch['apply'](_0x2c14d1,_0xb59e09,!![]);}catch(_0xd07833){return BPromise[_0x432e('0x20')](_0xd07833);}return _0x2c14d1[_0x432e('0x21')]();};}function saveUpdates(_0x1789ed,_0xab64e7){return function(_0x2e0198){if(_0x2e0198){return _0x2e0198['update'](_0x1789ed)[_0x432e('0x22')](function(_0x1513fb){return _0x1513fb;});}return null;};}function removeEntity(_0x59c865,_0x57d3ef){return function(_0x28de4c){if(_0x28de4c){return _0x28de4c[_0x432e('0x23')]()[_0x432e('0x22')](function(){_0x59c865[_0x432e('0x19')](0xcc)[_0x432e('0x24')]();});}};}function handleEntityNotFound(_0x48e0bb,_0x41f3cb){return function(_0x48a2ea){if(!_0x48a2ea){_0x48e0bb[_0x432e('0x18')](0x194);}return _0x48a2ea;};}function handleError(_0x117024,_0x3893b0){_0x3893b0=_0x3893b0||0x1f4;return function(_0x454d0e){logger['error'](_0x454d0e[_0x432e('0x25')]);if(_0x454d0e[_0x432e('0x26')]){delete _0x454d0e[_0x432e('0x26')];}_0x117024[_0x432e('0x19')](_0x3893b0)[_0x432e('0x27')](_0x454d0e);};}exports[_0x432e('0x28')]=function(_0xcb8020,_0x5e6d10){var _0x464859={},_0x4d017c={},_0x17f9e9={'count':0x0,'rows':[]};var _0x5662d0=_[_0x432e('0x29')](db['SugarcrmAccount']['rawAttributes'],function(_0x3af4b4){return{'name':_0x3af4b4['fieldName'],'type':_0x3af4b4[_0x432e('0x2a')][_0x432e('0x2b')]};});_0x4d017c[_0x432e('0x2c')]=_['map'](_0x5662d0,_0x432e('0x26'));_0x4d017c[_0x432e('0x2d')]=_['keys'](_0xcb8020[_0x432e('0x2d')]);_0x4d017c[_0x432e('0x2e')]=_[_0x432e('0x2f')](_0x4d017c['model'],_0x4d017c[_0x432e('0x2d')]);_0x464859[_0x432e('0x30')]=_[_0x432e('0x2f')](_0x4d017c[_0x432e('0x2c')],qs[_0x432e('0x31')](_0xcb8020[_0x432e('0x2d')][_0x432e('0x31')]));_0x464859[_0x432e('0x30')]=_0x464859['attributes'][_0x432e('0x32')]?_0x464859['attributes']:_0x4d017c['model'];if(!_0xcb8020[_0x432e('0x2d')][_0x432e('0x33')]('nolimit')){_0x464859[_0x432e('0x34')]=qs[_0x432e('0x34')](_0xcb8020[_0x432e('0x2d')][_0x432e('0x34')]);_0x464859[_0x432e('0x1b')]=qs[_0x432e('0x1b')](_0xcb8020[_0x432e('0x2d')]['offset']);}_0x464859[_0x432e('0x35')]=qs[_0x432e('0x36')](_0xcb8020['query'][_0x432e('0x36')]);_0x464859[_0x432e('0x37')]=qs[_0x432e('0x2e')](_['pick'](_0xcb8020[_0x432e('0x2d')],_0x4d017c[_0x432e('0x2e')]),_0x5662d0);if(_0xcb8020[_0x432e('0x2d')][_0x432e('0x38')]){_0x464859[_0x432e('0x37')]=_[_0x432e('0x39')](_0x464859[_0x432e('0x37')],{'$or':_[_0x432e('0x29')](_0x5662d0,function(_0x4c9c35){if(_0x4c9c35[_0x432e('0x2a')]!==_0x432e('0x3a')){var _0x360c4f={};_0x360c4f[_0x4c9c35[_0x432e('0x26')]]={'$like':'%'+_0xcb8020[_0x432e('0x2d')][_0x432e('0x38')]+'%'};return _0x360c4f;}})});}_0x464859=_[_0x432e('0x39')]({},_0x464859,_0xcb8020[_0x432e('0x3b')]);var _0x4149dd={'where':_0x464859['where']};return db[_0x432e('0x3c')][_0x432e('0x1d')](_0x4149dd)[_0x432e('0x22')](function(_0x548229){_0x17f9e9[_0x432e('0x1d')]=_0x548229;if(_0xcb8020[_0x432e('0x2d')]['includeAll']){_0x464859[_0x432e('0x3d')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x432e('0x3e')](_0x464859);})['then'](function(_0x4a75dc){_0x17f9e9[_0x432e('0x3f')]=_0x4a75dc;return _0x17f9e9;})[_0x432e('0x22')](respondWithFilteredResult(_0x5e6d10,_0x464859))[_0x432e('0x40')](handleError(_0x5e6d10,null));};exports[_0x432e('0x41')]=function(_0x39f4b9,_0x2ecb8e){var _0x16e86d={'raw':![],'where':{'id':_0x39f4b9[_0x432e('0x42')]['id']}},_0x298918={};_0x298918[_0x432e('0x2c')]=_[_0x432e('0x43')](db[_0x432e('0x3c')][_0x432e('0x44')]);_0x298918['query']=_[_0x432e('0x43')](_0x39f4b9[_0x432e('0x2d')]);_0x298918['filters']=_[_0x432e('0x2f')](_0x298918[_0x432e('0x2c')],_0x298918['query']);_0x16e86d[_0x432e('0x30')]=_[_0x432e('0x2f')](_0x298918[_0x432e('0x2c')],qs[_0x432e('0x31')](_0x39f4b9[_0x432e('0x2d')]['fields']));_0x16e86d['attributes']=_0x16e86d[_0x432e('0x30')][_0x432e('0x32')]?_0x16e86d['attributes']:_0x298918[_0x432e('0x2c')];if(_0x39f4b9[_0x432e('0x2d')]['includeAll']){_0x16e86d[_0x432e('0x3d')]=[{'all':!![]}];}_0x16e86d=_[_0x432e('0x39')]({},_0x16e86d,_0x39f4b9[_0x432e('0x3b')]);return db[_0x432e('0x3c')]['find'](_0x16e86d)[_0x432e('0x22')](handleEntityNotFound(_0x2ecb8e,null))[_0x432e('0x22')](respondWithResult(_0x2ecb8e,null))['catch'](handleError(_0x2ecb8e,null));};exports[_0x432e('0x45')]=function(_0x4fcfa6,_0x1f98b8){return db[_0x432e('0x3c')][_0x432e('0x45')](_0x4fcfa6[_0x432e('0x46')],{})[_0x432e('0x22')](respondWithResult(_0x1f98b8,0xc9))[_0x432e('0x40')](handleError(_0x1f98b8,null));};exports['update']=function(_0x311d67,_0x48199a){if(_0x311d67[_0x432e('0x46')]['id']){delete _0x311d67[_0x432e('0x46')]['id'];}return db[_0x432e('0x3c')]['find']({'where':{'id':_0x311d67[_0x432e('0x42')]['id']}})[_0x432e('0x22')](handleEntityNotFound(_0x48199a,null))[_0x432e('0x22')](saveUpdates(_0x311d67[_0x432e('0x46')],null))['then'](respondWithResult(_0x48199a,null))[_0x432e('0x40')](handleError(_0x48199a,null));};exports[_0x432e('0x23')]=function(_0x34a491,_0x5c765d){return db[_0x432e('0x3c')]['find']({'where':{'id':_0x34a491[_0x432e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c765d,null))['then'](removeEntity(_0x5c765d,null))[_0x432e('0x40')](handleError(_0x5c765d,null));};exports[_0x432e('0x47')]=function(_0xf6b758,_0x107f11,_0x125804){var _0x25d2f5={};var _0x2672d6={};var _0x45d12e;var _0x39c00e;return db[_0x432e('0x3c')][_0x432e('0x48')]({'where':{'id':_0xf6b758[_0x432e('0x42')]['id']}})[_0x432e('0x22')](handleEntityNotFound(_0x107f11,null))['then'](function(_0x3b56a7){if(_0x3b56a7){_0x45d12e=_0x3b56a7;_0x2672d6['model']=_[_0x432e('0x43')](db[_0x432e('0x49')]['rawAttributes']);_0x2672d6[_0x432e('0x2d')]=_[_0x432e('0x43')](_0xf6b758[_0x432e('0x2d')]);_0x2672d6[_0x432e('0x2e')]=_[_0x432e('0x2f')](_0x2672d6[_0x432e('0x2c')],_0x2672d6['query']);_0x25d2f5['attributes']=_[_0x432e('0x2f')](_0x2672d6[_0x432e('0x2c')],qs['fields'](_0xf6b758[_0x432e('0x2d')][_0x432e('0x31')]));_0x25d2f5['attributes']=_0x25d2f5[_0x432e('0x30')]['length']?_0x25d2f5['attributes']:_0x2672d6['model'];_0x25d2f5[_0x432e('0x35')]=qs['sort'](_0xf6b758[_0x432e('0x2d')]['sort']);_0x25d2f5[_0x432e('0x37')]=qs[_0x432e('0x2e')](_[_0x432e('0x4a')](_0xf6b758[_0x432e('0x2d')],_0x2672d6[_0x432e('0x2e')]));if(_0xf6b758[_0x432e('0x2d')]['filter']){_0x25d2f5[_0x432e('0x37')]=_['merge'](_0x25d2f5['where'],{'$or':_['map'](_0x25d2f5[_0x432e('0x30')],function(_0x2e2e9e){var _0x233ea2={};_0x233ea2[_0x2e2e9e]={'$like':'%'+_0xf6b758[_0x432e('0x2d')][_0x432e('0x38')]+'%'};return _0x233ea2;})});}_0x25d2f5=_[_0x432e('0x39')]({},_0x25d2f5,_0xf6b758[_0x432e('0x3b')]);return _0x45d12e['getConfigurations'](_0x25d2f5);}})[_0x432e('0x22')](function(_0xdf7973){if(_0xdf7973){_0x39c00e=_0xdf7973['length'];if(!_0xf6b758[_0x432e('0x2d')][_0x432e('0x33')](_0x432e('0x4b'))){_0x25d2f5['limit']=qs[_0x432e('0x34')](_0xf6b758[_0x432e('0x2d')][_0x432e('0x34')]);_0x25d2f5[_0x432e('0x1b')]=qs[_0x432e('0x1b')](_0xf6b758[_0x432e('0x2d')][_0x432e('0x1b')]);}return _0x45d12e[_0x432e('0x47')](_0x25d2f5);}})[_0x432e('0x22')](function(_0x565016){if(_0x565016){return _0x565016?{'count':_0x39c00e,'rows':_0x565016}:null;}})['then'](respondWithResult(_0x107f11,null))['catch'](handleError(_0x107f11,null));};exports[_0x432e('0x4c')]=function(_0x4152b0,_0x1c9c5b,_0x3cdec4){if(_0x4152b0[_0x432e('0x46')]['id']){delete _0x4152b0[_0x432e('0x46')]['id'];}return db[_0x432e('0x3c')][_0x432e('0x48')]({'where':{'id':_0x4152b0[_0x432e('0x42')]['id']}})[_0x432e('0x22')](handleEntityNotFound(_0x1c9c5b,null))['then'](function(_0x11688b){if(_0x11688b){_0x4152b0[_0x432e('0x46')][_0x432e('0x4d')]=_0x11688b['id'];_0x4152b0['body'][_0x432e('0x4e')]=integrations[_0x432e('0x4f')](_0x4152b0[_0x432e('0x46')][_0x432e('0x50')],_0x4152b0['body'][_0x432e('0x2a')]);_0x4152b0[_0x432e('0x46')][_0x432e('0x51')]=integrations['getDescriptions'](_0x4152b0[_0x432e('0x46')][_0x432e('0x50')],_0x4152b0['body'][_0x432e('0x2a')]);return db[_0x432e('0x49')][_0x432e('0x45')](_0x4152b0[_0x432e('0x46')],{'include':[{'model':db[_0x432e('0x52')],'as':_0x432e('0x4e')},{'model':db['SugarcrmField'],'as':_0x432e('0x51')}]});}return null;})[_0x432e('0x22')](respondWithResult(_0x1c9c5b,null))[_0x432e('0x40')](handleError(_0x1c9c5b,null));};exports[_0x432e('0x53')]=function(_0x448f87,_0xddd28f,_0x474de7){var _0x3fb56b='';var _0x6ca30a=['id',_0x432e('0x26'),_0x432e('0x54'),_0x432e('0x55'),_0x432e('0x56'),'date_start',_0x432e('0x57'),_0x432e('0x58'),_0x432e('0x59'),'parent_type',_0x432e('0x5a'),_0x432e('0x5b')];return db['SugarcrmAccount'][_0x432e('0x48')]({'where':{'id':_0x448f87['params']['id']},'attributes':['id',_0x432e('0x5c'),_0x432e('0x5d'),_0x432e('0x5e')]})[_0x432e('0x22')](handleEntityNotFound(_0xddd28f,null))[_0x432e('0x22')](function(_0x4d1f04){if(_0x4d1f04){_0x3fb56b=_0x4d1f04['remoteUri'];var _0x1c7aa6=_0x3fb56b[_0x432e('0x5f')](-0x1);if(_0x1c7aa6==='/'){_0x3fb56b=_0x3fb56b[_0x432e('0x60')](0x0,_0x3fb56b[_0x432e('0x61')](_0x1c7aa6));}return rp({'method':_0x432e('0x62'),'uri':util[_0x432e('0x63')](_0x432e('0x64'),_0x3fb56b,_0x432e('0x65')),'json':!![],'form':{'method':_0x432e('0x66'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x432e('0x67')]({'user_auth':{'user_name':_0x4d1f04[_0x432e('0x5c')],'password':_0x4d1f04[_0x432e('0x5d')],'encryption':_0x432e('0x68')},'application':_0x432e('0x69')})}});}})[_0x432e('0x22')](function(_0x594ce6){if(_0x594ce6&&_0x594ce6['name']!=='Invalid\x20Login'&&_0x594ce6[_0x432e('0x26')]!==_0x432e('0x6a')){return rp({'method':_0x432e('0x62'),'uri':util[_0x432e('0x63')](_0x432e('0x64'),_0x3fb56b,_0x432e('0x65')),'json':!![],'form':{'method':_0x432e('0x6b'),'input_type':_0x432e('0x6c'),'response_type':_0x432e('0x6c'),'rest_data':JSON[_0x432e('0x67')]({'session':_0x594ce6['id'],'module_name':_0x432e('0x6d')})}})[_0x432e('0x22')](function(_0x4f1c56){if(_0x4f1c56){var _0x11ec0b=_['values'](_0x4f1c56[_0x432e('0x6e')]);_[_0x432e('0x6f')](_0x11ec0b,function(_0x23e280){return _0x6ca30a[_0x432e('0x70')](_0x23e280[_0x432e('0x26')]);});return{'count':_0x11ec0b[_0x432e('0x32')],'rows':_[_0x432e('0x29')](_0x11ec0b,function(_0x49df6c){return{'id':_0x49df6c[_0x432e('0x26')],'name':_0x49df6c['label'],'custom':_['endsWith'](_0x49df6c[_0x432e('0x26')],'_c')?!![]:![],'options':_0x49df6c[_0x432e('0x3b')]?_[_0x432e('0x29')](_['values'](_0x49df6c[_0x432e('0x3b')]),function(_0x33204f){return{'name':_0x33204f[_0x432e('0x71')],'value':_0x33204f[_0x432e('0x26')]};}):[]};})};}})['then'](respondWithResult(_0xddd28f,null))['catch'](function(_0x17658c){var _0x4258b5=_0x448f87[_0x432e('0x2d')][_0x432e('0x72')]?0x1f4:_0x17658c[_0x432e('0x73')]||0x1f4;logger['error'](_0x432e('0x74'),'getFields',_0x4258b5,JSON[_0x432e('0x67')](_0x17658c));delete _0x17658c['name'];if(_0x4258b5===0x191){_0x4258b5=0x190;}_0xddd28f[_0x432e('0x19')](_0x4258b5)[_0x432e('0x27')](_0x448f87[_0x432e('0x2d')][_0x432e('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x17658c[_0x432e('0x73')]}:_0x17658c);});}else{var _0x54af2e=0x1f4;_0xddd28f[_0x432e('0x19')](_0x54af2e)[_0x432e('0x27')]({'message':_0x432e('0x75'),'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 30e6239..81d2e85 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 _0x46b7=['int_sugarcrm_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x1436c5,_0x33dfc6){var _0x1791d1=function(_0x123ff3){while(--_0x123ff3){_0x1436c5['push'](_0x1436c5['shift']());}};_0x1791d1(++_0x33dfc6);}(_0x46b7,0xa9));var _0x746b=function(_0x4fc6e6,_0x5a853c){_0x4fc6e6=_0x4fc6e6-0x0;var _0x3054c2=_0x46b7[_0x4fc6e6];return _0x3054c2;};'use strict';var _=require('lodash');var util=require(_0x746b('0x0'));var logger=require(_0x746b('0x1'))(_0x746b('0x2'));var moment=require(_0x746b('0x3'));var BPromise=require('bluebird');var rp=require(_0x746b('0x4'));var fs=require('fs');var path=require(_0x746b('0x5'));var rimraf=require(_0x746b('0x6'));var config=require('../../config/environment');var attributes=require(_0x746b('0x7'));var integrations=require(_0x746b('0x8'));module[_0x746b('0x9')]=function(_0x50b09e,_0x18848f){return _0x50b09e[_0x746b('0xa')]('SugarcrmAccount',attributes,{'tableName':_0x746b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b1b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x2dc428,_0x5e8480){var _0x409e12=function(_0x5692e8){while(--_0x5692e8){_0x2dc428['push'](_0x2dc428['shift']());}};_0x409e12(++_0x5e8480);}(_0x4b1b,0x17f));var _0xb4b1=function(_0x384e54,_0x1410c6){_0x384e54=_0x384e54-0x0;var _0x31ee92=_0x4b1b[_0x384e54];return _0x31ee92;};'use strict';var _=require(_0xb4b1('0x0'));var util=require(_0xb4b1('0x1'));var logger=require(_0xb4b1('0x2'))(_0xb4b1('0x3'));var moment=require(_0xb4b1('0x4'));var BPromise=require(_0xb4b1('0x5'));var rp=require(_0xb4b1('0x6'));var fs=require('fs');var path=require(_0xb4b1('0x7'));var rimraf=require(_0xb4b1('0x8'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2b28b4,_0x7d6283){return _0x2b28b4[_0xb4b1('0x9')](_0xb4b1('0xa'),attributes,{'tableName':_0xb4b1('0xb'),'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 3bdabcd..018f75f 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 _0xcd64=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','options','where','include','map','model','attributes','GetSugarcrmAccount','SugarcrmAccount','find','raw','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x2901dc,_0x5785d7){var _0x2b5e9b=function(_0x2cb7ae){while(--_0x2cb7ae){_0x2901dc['push'](_0x2901dc['shift']());}};_0x2b5e9b(++_0x5785d7);}(_0xcd64,0x81));var _0x4cd6=function(_0x1dd9c3,_0x421121){_0x1dd9c3=_0x1dd9c3-0x0;var _0x4b2ea4=_0xcd64[_0x1dd9c3];return _0x4b2ea4;};'use strict';var _=require(_0x4cd6('0x0'));var util=require(_0x4cd6('0x1'));var moment=require('moment');var BPromise=require(_0x4cd6('0x2'));var rs=require(_0x4cd6('0x3'));var fs=require('fs');var Redis=require(_0x4cd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4cd6('0x5'));var logger=require('../../config/logger')(_0x4cd6('0x6'));var config=require(_0x4cd6('0x7'));var jayson=require(_0x4cd6('0x8'));var client=jayson[_0x4cd6('0x9')][_0x4cd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c51d7,_0x228713,_0x1d0b34){return new BPromise(function(_0xb0a948,_0x4617fd){return client[_0x4cd6('0xb')](_0x2c51d7,_0x1d0b34)[_0x4cd6('0xc')](function(_0x1497b8){logger[_0x4cd6('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x228713,_0x4cd6('0xe'));logger[_0x4cd6('0xf')](_0x4cd6('0x10'),_0x228713,_0x4cd6('0xe'),JSON[_0x4cd6('0x11')](_0x1497b8));if(_0x1497b8['error']){if(_0x1497b8[_0x4cd6('0x12')]['code']===0x1f4){logger['error'](_0x4cd6('0x13'),_0x228713,_0x1497b8[_0x4cd6('0x12')]['message']);return _0x4617fd(_0x1497b8['error'][_0x4cd6('0x14')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x228713,_0x1497b8['error'][_0x4cd6('0x14')]);return _0xb0a948(_0x1497b8[_0x4cd6('0x12')][_0x4cd6('0x14')]);}else{logger[_0x4cd6('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x228713,_0x4cd6('0xe'));_0xb0a948(_0x1497b8[_0x4cd6('0x15')][_0x4cd6('0x14')]);}})[_0x4cd6('0x16')](function(_0xb1f94f){logger[_0x4cd6('0x12')](_0x4cd6('0x13'),_0x228713,_0xb1f94f);_0x4617fd(_0xb1f94f);});});}exports['GetSugarcrmAccount']=function(_0x518540){var _0x34d6dd=this;return new Promise(function(_0x34b6be,_0x2524f9){return db['SugarcrmAccount']['findAll']({'raw':_0x518540[_0x4cd6('0x17')]?_0x518540[_0x4cd6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x518540[_0x4cd6('0x17')]?_0x518540['options'][_0x4cd6('0x18')]||null:null,'attributes':_0x518540[_0x4cd6('0x17')]?_0x518540[_0x4cd6('0x17')]['attributes']||null:null,'limit':_0x518540[_0x4cd6('0x17')]?_0x518540[_0x4cd6('0x17')]['limit']||null:null,'include':_0x518540[_0x4cd6('0x17')]?_0x518540[_0x4cd6('0x17')][_0x4cd6('0x19')]?_[_0x4cd6('0x1a')](_0x518540['options'][_0x4cd6('0x19')],function(_0x3fd9bb){return{'model':db[_0x3fd9bb[_0x4cd6('0x1b')]],'as':_0x3fd9bb['as'],'attributes':_0x3fd9bb[_0x4cd6('0x1c')],'include':_0x3fd9bb[_0x4cd6('0x19')]?_[_0x4cd6('0x1a')](_0x3fd9bb[_0x4cd6('0x19')],function(_0x613172){return{'model':db[_0x613172['model']],'as':_0x613172['as'],'attributes':_0x613172[_0x4cd6('0x1c')],'include':_0x613172[_0x4cd6('0x19')]?_['map'](_0x613172[_0x4cd6('0x19')],function(_0x522a2e){return{'model':db[_0x522a2e[_0x4cd6('0x1b')]],'as':_0x522a2e['as'],'attributes':_0x522a2e[_0x4cd6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x244a42){logger[_0x4cd6('0xd')](_0x4cd6('0x1d'),_0x518540);logger['debug'](_0x4cd6('0x1d'),_0x518540,JSON[_0x4cd6('0x11')](_0x244a42));_0x34b6be(_0x244a42);})[_0x4cd6('0x16')](function(_0x3c8589){logger['error']('GetSugarcrmAccount',_0x3c8589[_0x4cd6('0x14')],_0x518540);_0x2524f9(_0x34d6dd[_0x4cd6('0x12')](0x1f4,_0x3c8589['message']));});});};exports['ShowSugarcrmAccount']=function(_0x2c1f1d){var _0x4aca4b=this;return new Promise(function(_0x4ddc25,_0x10568f){return db[_0x4cd6('0x1e')][_0x4cd6('0x1f')]({'raw':_0x2c1f1d[_0x4cd6('0x17')]?_0x2c1f1d[_0x4cd6('0x17')][_0x4cd6('0x20')]===undefined?!![]:![]:!![],'where':_0x2c1f1d[_0x4cd6('0x17')]?_0x2c1f1d[_0x4cd6('0x17')][_0x4cd6('0x18')]||null:null,'attributes':_0x2c1f1d[_0x4cd6('0x17')]?_0x2c1f1d[_0x4cd6('0x17')][_0x4cd6('0x1c')]||null:null,'include':_0x2c1f1d[_0x4cd6('0x17')]?_0x2c1f1d[_0x4cd6('0x17')]['include']?_['map'](_0x2c1f1d[_0x4cd6('0x17')][_0x4cd6('0x19')],function(_0x333b2d){return{'model':db[_0x333b2d[_0x4cd6('0x1b')]],'as':_0x333b2d['as'],'attributes':_0x333b2d[_0x4cd6('0x1c')],'include':_0x333b2d[_0x4cd6('0x19')]?_[_0x4cd6('0x1a')](_0x333b2d[_0x4cd6('0x19')],function(_0x2a6e10){return{'model':db[_0x2a6e10[_0x4cd6('0x1b')]],'as':_0x2a6e10['as'],'attributes':_0x2a6e10[_0x4cd6('0x1c')],'include':_0x2a6e10['include']?_['map'](_0x2a6e10[_0x4cd6('0x19')],function(_0x5c0748){return{'model':db[_0x5c0748[_0x4cd6('0x1b')]],'as':_0x5c0748['as'],'attributes':_0x5c0748[_0x4cd6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4cd6('0xc')](function(_0x52291a){logger[_0x4cd6('0xd')](_0x4cd6('0x21'),_0x2c1f1d);logger[_0x4cd6('0xf')](_0x4cd6('0x21'),_0x2c1f1d,JSON[_0x4cd6('0x11')](_0x52291a));_0x4ddc25(_0x52291a);})[_0x4cd6('0x16')](function(_0x3517bf){logger['error'](_0x4cd6('0x21'),_0x3517bf[_0x4cd6('0x14')],_0x2c1f1d);_0x10568f(_0x4aca4b[_0x4cd6('0x12')](0x1f4,_0x3517bf[_0x4cd6('0x14')]));});});}; \ No newline at end of file +var _0x6c65=['request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa2ffdf,_0x442b4d){var _0x22cf0d=function(_0x648946){while(--_0x648946){_0xa2ffdf['push'](_0xa2ffdf['shift']());}};_0x22cf0d(++_0x442b4d);}(_0x6c65,0x141));var _0x56c6=function(_0x82f586,_0x382c19){_0x82f586=_0x82f586-0x0;var _0x591ec8=_0x6c65[_0x82f586];return _0x591ec8;};'use strict';var _=require('lodash');var util=require(_0x56c6('0x0'));var moment=require(_0x56c6('0x1'));var BPromise=require(_0x56c6('0x2'));var rs=require(_0x56c6('0x3'));var fs=require('fs');var Redis=require(_0x56c6('0x4'));var db=require(_0x56c6('0x5'))['db'];var utils=require(_0x56c6('0x6'));var logger=require('../../config/logger')(_0x56c6('0x7'));var config=require(_0x56c6('0x8'));var jayson=require(_0x56c6('0x9'));var client=jayson[_0x56c6('0xa')][_0x56c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48c1ec,_0x416a54,_0xb93346){return new BPromise(function(_0x28528b,_0x23aa02){return client[_0x56c6('0xc')](_0x48c1ec,_0xb93346)[_0x56c6('0xd')](function(_0x5ba829){logger[_0x56c6('0xe')](_0x56c6('0xf'),_0x416a54,_0x56c6('0x10'));logger['debug'](_0x56c6('0x11'),_0x416a54,_0x56c6('0x10'),JSON[_0x56c6('0x12')](_0x5ba829));if(_0x5ba829[_0x56c6('0x13')]){if(_0x5ba829[_0x56c6('0x13')]['code']===0x1f4){logger[_0x56c6('0x13')](_0x56c6('0xf'),_0x416a54,_0x5ba829[_0x56c6('0x13')][_0x56c6('0x14')]);return _0x23aa02(_0x5ba829[_0x56c6('0x13')][_0x56c6('0x14')]);}logger[_0x56c6('0x13')](_0x56c6('0xf'),_0x416a54,_0x5ba829['error']['message']);return _0x28528b(_0x5ba829[_0x56c6('0x13')]['message']);}else{logger[_0x56c6('0xe')](_0x56c6('0xf'),_0x416a54,_0x56c6('0x10'));_0x28528b(_0x5ba829[_0x56c6('0x15')][_0x56c6('0x14')]);}})[_0x56c6('0x16')](function(_0x5e4522){logger[_0x56c6('0x13')](_0x56c6('0xf'),_0x416a54,_0x5e4522);_0x23aa02(_0x5e4522);});});}exports[_0x56c6('0x17')]=function(_0x5587ff){var _0xe734d=this;return new Promise(function(_0x6737eb,_0x65e143){return db[_0x56c6('0x18')][_0x56c6('0x19')]({'raw':_0x5587ff[_0x56c6('0x1a')]?_0x5587ff['options'][_0x56c6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5587ff[_0x56c6('0x1a')]?_0x5587ff['options'][_0x56c6('0x1c')]||null:null,'attributes':_0x5587ff[_0x56c6('0x1a')]?_0x5587ff[_0x56c6('0x1a')][_0x56c6('0x1d')]||null:null,'limit':_0x5587ff[_0x56c6('0x1a')]?_0x5587ff[_0x56c6('0x1a')][_0x56c6('0x1e')]||null:null,'include':_0x5587ff['options']?_0x5587ff[_0x56c6('0x1a')]['include']?_['map'](_0x5587ff['options'][_0x56c6('0x1f')],function(_0x24e17e){return{'model':db[_0x24e17e[_0x56c6('0x20')]],'as':_0x24e17e['as'],'attributes':_0x24e17e[_0x56c6('0x1d')],'include':_0x24e17e[_0x56c6('0x1f')]?_[_0x56c6('0x21')](_0x24e17e[_0x56c6('0x1f')],function(_0x37d1cf){return{'model':db[_0x37d1cf[_0x56c6('0x20')]],'as':_0x37d1cf['as'],'attributes':_0x37d1cf[_0x56c6('0x1d')],'include':_0x37d1cf[_0x56c6('0x1f')]?_[_0x56c6('0x21')](_0x37d1cf['include'],function(_0x4abcbc){return{'model':db[_0x4abcbc[_0x56c6('0x20')]],'as':_0x4abcbc['as'],'attributes':_0x4abcbc[_0x56c6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x56c6('0xd')](function(_0x1b1ca5){logger[_0x56c6('0xe')](_0x56c6('0x17'),_0x5587ff);logger[_0x56c6('0x22')](_0x56c6('0x17'),_0x5587ff,JSON['stringify'](_0x1b1ca5));_0x6737eb(_0x1b1ca5);})[_0x56c6('0x16')](function(_0x318e4f){logger[_0x56c6('0x13')]('GetSugarcrmAccount',_0x318e4f[_0x56c6('0x14')],_0x5587ff);_0x65e143(_0xe734d[_0x56c6('0x13')](0x1f4,_0x318e4f['message']));});});};exports[_0x56c6('0x23')]=function(_0x1ed58e){var _0x4edfcd=this;return new Promise(function(_0x57c3ec,_0x224526){return db[_0x56c6('0x18')][_0x56c6('0x24')]({'raw':_0x1ed58e[_0x56c6('0x1a')]?_0x1ed58e['options'][_0x56c6('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ed58e[_0x56c6('0x1a')]?_0x1ed58e[_0x56c6('0x1a')][_0x56c6('0x1c')]||null:null,'attributes':_0x1ed58e[_0x56c6('0x1a')]?_0x1ed58e[_0x56c6('0x1a')]['attributes']||null:null,'include':_0x1ed58e[_0x56c6('0x1a')]?_0x1ed58e[_0x56c6('0x1a')][_0x56c6('0x1f')]?_['map'](_0x1ed58e[_0x56c6('0x1a')]['include'],function(_0x3c5ff7){return{'model':db[_0x3c5ff7[_0x56c6('0x20')]],'as':_0x3c5ff7['as'],'attributes':_0x3c5ff7[_0x56c6('0x1d')],'include':_0x3c5ff7[_0x56c6('0x1f')]?_[_0x56c6('0x21')](_0x3c5ff7[_0x56c6('0x1f')],function(_0x4b19ae){return{'model':db[_0x4b19ae[_0x56c6('0x20')]],'as':_0x4b19ae['as'],'attributes':_0x4b19ae['attributes'],'include':_0x4b19ae[_0x56c6('0x1f')]?_[_0x56c6('0x21')](_0x4b19ae[_0x56c6('0x1f')],function(_0x53314a){return{'model':db[_0x53314a[_0x56c6('0x20')]],'as':_0x53314a['as'],'attributes':_0x53314a['attributes']};}):[]};}):[]};}):[]:[]})[_0x56c6('0xd')](function(_0x2a4e16){logger[_0x56c6('0xe')]('ShowSugarcrmAccount',_0x1ed58e);logger[_0x56c6('0x22')](_0x56c6('0x23'),_0x1ed58e,JSON[_0x56c6('0x12')](_0x2a4e16));_0x57c3ec(_0x2a4e16);})[_0x56c6('0x16')](function(_0x432389){logger[_0x56c6('0x13')](_0x56c6('0x23'),_0x432389[_0x56c6('0x14')],_0x1ed58e);_0x224526(_0x4edfcd[_0x56c6('0x13')](0x1f4,_0x432389[_0x56c6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 600cb90..b4ed995 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 _0x725a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getFields','/:id/subjects','create','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x4c4e95,_0x35c614){var _0x38ad4b=function(_0x253be6){while(--_0x253be6){_0x4c4e95['push'](_0x4c4e95['shift']());}};_0x38ad4b(++_0x35c614);}(_0x725a,0x93));var _0xa725=function(_0x193dad,_0x38d83d){_0x193dad=_0x193dad-0x0;var _0x5eafa4=_0x725a[_0x193dad];return _0x5eafa4;};'use strict';var multer=require('multer');var util=require(_0xa725('0x0'));var path=require(_0xa725('0x1'));var timeout=require(_0xa725('0x2'));var express=require(_0xa725('0x3'));var router=express[_0xa725('0x4')]();var fs_extra=require(_0xa725('0x5'));var auth=require(_0xa725('0x6'));var interaction=require(_0xa725('0x7'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0xa725('0x8')]('/',auth[_0xa725('0x9')](),controller[_0xa725('0xa')]);router[_0xa725('0x8')](_0xa725('0xb'),auth[_0xa725('0x9')](),controller['show']);router[_0xa725('0x8')]('/:id/fields',auth[_0xa725('0x9')](),controller[_0xa725('0xc')]);router[_0xa725('0x8')](_0xa725('0xd'),auth[_0xa725('0x9')](),controller['getSubjects']);router[_0xa725('0x8')]('/:id/descriptions',auth[_0xa725('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xa725('0xe')]);router[_0xa725('0xf')](_0xa725('0xb'),auth[_0xa725('0x9')](),controller[_0xa725('0x10')]);router[_0xa725('0x11')]('/:id',auth[_0xa725('0x9')](),controller[_0xa725('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2cc3=['getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id/fields','/:id/subjects'];(function(_0x476914,_0x3e1d98){var _0x19e6f7=function(_0x16a2a8){while(--_0x16a2a8){_0x476914['push'](_0x476914['shift']());}};_0x19e6f7(++_0x3e1d98);}(_0x2cc3,0x1e3));var _0x32cc=function(_0x167f46,_0xb9b7df){_0x167f46=_0x167f46-0x0;var _0x15c3c6=_0x2cc3[_0x167f46];return _0x15c3c6;};'use strict';var multer=require('multer');var util=require(_0x32cc('0x0'));var path=require('path');var timeout=require(_0x32cc('0x1'));var express=require('express');var router=express[_0x32cc('0x2')]();var fs_extra=require(_0x32cc('0x3'));var auth=require(_0x32cc('0x4'));var interaction=require(_0x32cc('0x5'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x32cc('0x6')]('/',auth[_0x32cc('0x7')](),controller['index']);router['get']('/:id',auth[_0x32cc('0x7')](),controller['show']);router[_0x32cc('0x6')](_0x32cc('0x8'),auth[_0x32cc('0x7')](),controller['getFields']);router['get'](_0x32cc('0x9'),auth['isAuthenticated'](),controller[_0x32cc('0xa')]);router[_0x32cc('0x6')](_0x32cc('0xb'),auth[_0x32cc('0x7')](),controller[_0x32cc('0xc')]);router['post']('/',auth[_0x32cc('0x7')](),controller[_0x32cc('0xd')]);router[_0x32cc('0xe')](_0x32cc('0xf'),auth[_0x32cc('0x7')](),controller['update']);router[_0x32cc('0x10')](_0x32cc('0xf'),auth[_0x32cc('0x7')](),controller['destroy']);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 35538ee..9609074 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 _0xf1fa=['STRING','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf1fa,0x7f));var _0xaf1f=function(_0x43629f,_0x5b2635){_0x43629f=_0x43629f-0x0;var _0x3bfbfb=_0xf1fa[_0x43629f];return _0x3bfbfb;};'use strict';var Sequelize=require('sequelize');module[_0xaf1f('0x0')]={'name':{'type':Sequelize[_0xaf1f('0x1')]},'description':{'type':Sequelize[_0xaf1f('0x1')]}}; \ No newline at end of file +var _0x380d=['STRING','sequelize','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x380d,0xa6));var _0xd380=function(_0x44ba85,_0x478695){_0x44ba85=_0x44ba85-0x0;var _0x32545d=_0x380d[_0x44ba85];return _0x32545d;};'use strict';var Sequelize=require(_0xd380('0x0'));module[_0xd380('0x1')]={'name':{'type':Sequelize[_0xd380('0x2')]},'description':{'type':Sequelize[_0xd380('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index ebfba15..88e6342 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 _0x44e1=['fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SugarcrmConfiguration','findAll','rows','catch','show','params','keys','length','find','create','body','findOne','SugarcrmField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection'];(function(_0x40c9fd,_0xbf155c){var _0x11eb82=function(_0x31ec1a){while(--_0x31ec1a){_0x40c9fd['push'](_0x40c9fd['shift']());}};_0x11eb82(++_0xbf155c);}(_0x44e1,0xbb));var _0x144e=function(_0x1f94b0,_0x58c657){_0x1f94b0=_0x1f94b0-0x0;var _0x5cba72=_0x44e1[_0x1f94b0];return _0x5cba72;};'use strict';var emlformat=require(_0x144e('0x0'));var rimraf=require(_0x144e('0x1'));var zipdir=require(_0x144e('0x2'));var jsonpatch=require(_0x144e('0x3'));var rp=require(_0x144e('0x4'));var moment=require(_0x144e('0x5'));var BPromise=require(_0x144e('0x6'));var Mustache=require(_0x144e('0x7'));var util=require(_0x144e('0x8'));var path=require(_0x144e('0x9'));var sox=require(_0x144e('0xa'));var csv=require(_0x144e('0xb'));var ejs=require(_0x144e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x144e('0xd'));var crypto=require(_0x144e('0xe'));var jsforce=require(_0x144e('0xf'));var deskjs=require(_0x144e('0x10'));var toCsv=require(_0x144e('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x144e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x144e('0x12'));var as=require(_0x144e('0x13'));var hardwareService=require(_0x144e('0x14'));var logger=require('../../config/logger')(_0x144e('0x15'));var utils=require(_0x144e('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x144e('0x17'))['db'];function respondWithStatusCode(_0x27dd5d,_0x3234d3){_0x3234d3=_0x3234d3||0xcc;return function(_0x182569){if(_0x182569){return _0x27dd5d['sendStatus'](_0x3234d3);}return _0x27dd5d[_0x144e('0x18')](_0x3234d3)['end']();};}function respondWithResult(_0x3f0456,_0x33f150){_0x33f150=_0x33f150||0xc8;return function(_0x112cac){if(_0x112cac){return _0x3f0456['status'](_0x33f150)[_0x144e('0x19')](_0x112cac);}};}function respondWithFilteredResult(_0x23976e,_0x38b818){return function(_0x98b068){if(_0x98b068){var _0x45a681=typeof _0x38b818['offset']===_0x144e('0x1a')&&typeof _0x38b818[_0x144e('0x1b')]===_0x144e('0x1a');var _0x403e0a=_0x98b068[_0x144e('0x1c')];var _0x470081=_0x45a681?0x0:_0x38b818[_0x144e('0x1d')];var _0x5cc67c=_0x45a681?_0x98b068['count']:_0x38b818[_0x144e('0x1d')]+_0x38b818[_0x144e('0x1b')];var _0x1af721;if(_0x5cc67c>=_0x403e0a){_0x5cc67c=_0x403e0a;_0x1af721=0xc8;}else{_0x1af721=0xce;}_0x23976e[_0x144e('0x18')](_0x1af721);return _0x23976e[_0x144e('0x1e')]('Content-Range',_0x470081+'-'+_0x5cc67c+'/'+_0x403e0a)[_0x144e('0x19')](_0x98b068);}return null;};}function patchUpdates(_0x4e3f08){return function(_0x421af7){try{jsonpatch['apply'](_0x421af7,_0x4e3f08,!![]);}catch(_0x513610){return BPromise['reject'](_0x513610);}return _0x421af7['save']();};}function saveUpdates(_0x2c1d2c,_0x90dcaa){return function(_0xbb86da){if(_0xbb86da){return _0xbb86da[_0x144e('0x1f')](_0x2c1d2c)[_0x144e('0x20')](function(_0x4b0ff1){return _0x4b0ff1;});}return null;};}function removeEntity(_0x2cbc9c,_0x3dbd08){return function(_0xf18d0f){if(_0xf18d0f){return _0xf18d0f[_0x144e('0x21')]()['then'](function(){_0x2cbc9c['status'](0xcc)[_0x144e('0x22')]();});}};}function handleEntityNotFound(_0x23cf07,_0x6cadb8){return function(_0x2efc54){if(!_0x2efc54){_0x23cf07['sendStatus'](0x194);}return _0x2efc54;};}function handleError(_0x294766,_0x1ffce1){_0x1ffce1=_0x1ffce1||0x1f4;return function(_0xc9a073){logger[_0x144e('0x23')](_0xc9a073[_0x144e('0x24')]);if(_0xc9a073['name']){delete _0xc9a073[_0x144e('0x25')];}_0x294766[_0x144e('0x18')](_0x1ffce1)[_0x144e('0x26')](_0xc9a073);};}exports[_0x144e('0x27')]=function(_0x44ec8a,_0x297b57){var _0x441ff6={},_0x597068={},_0x53cb66={'count':0x0,'rows':[]};var _0x51dec5=_[_0x144e('0x28')](db['SugarcrmConfiguration'][_0x144e('0x29')],function(_0x4b7146){return{'name':_0x4b7146[_0x144e('0x2a')],'type':_0x4b7146[_0x144e('0x2b')][_0x144e('0x2c')]};});_0x597068[_0x144e('0x2d')]=_[_0x144e('0x28')](_0x51dec5,_0x144e('0x25'));_0x597068[_0x144e('0x2e')]=_['keys'](_0x44ec8a[_0x144e('0x2e')]);_0x597068[_0x144e('0x2f')]=_['intersection'](_0x597068[_0x144e('0x2d')],_0x597068[_0x144e('0x2e')]);_0x441ff6[_0x144e('0x30')]=_[_0x144e('0x31')](_0x597068[_0x144e('0x2d')],qs[_0x144e('0x32')](_0x44ec8a[_0x144e('0x2e')][_0x144e('0x32')]));_0x441ff6['attributes']=_0x441ff6[_0x144e('0x30')]['length']?_0x441ff6[_0x144e('0x30')]:_0x597068[_0x144e('0x2d')];if(!_0x44ec8a[_0x144e('0x2e')][_0x144e('0x33')]('nolimit')){_0x441ff6[_0x144e('0x1b')]=qs[_0x144e('0x1b')](_0x44ec8a[_0x144e('0x2e')][_0x144e('0x1b')]);_0x441ff6['offset']=qs[_0x144e('0x1d')](_0x44ec8a[_0x144e('0x2e')]['offset']);}_0x441ff6[_0x144e('0x34')]=qs[_0x144e('0x35')](_0x44ec8a['query']['sort']);_0x441ff6[_0x144e('0x36')]=qs[_0x144e('0x2f')](_[_0x144e('0x37')](_0x44ec8a[_0x144e('0x2e')],_0x597068[_0x144e('0x2f')]),_0x51dec5);if(_0x44ec8a[_0x144e('0x2e')][_0x144e('0x38')]){_0x441ff6[_0x144e('0x36')]=_[_0x144e('0x39')](_0x441ff6['where'],{'$or':_[_0x144e('0x28')](_0x51dec5,function(_0x1d419d){if(_0x1d419d[_0x144e('0x2b')]!==_0x144e('0x3a')){var _0x23cd67={};_0x23cd67[_0x1d419d[_0x144e('0x25')]]={'$like':'%'+_0x44ec8a[_0x144e('0x2e')][_0x144e('0x38')]+'%'};return _0x23cd67;}})});}_0x441ff6=_[_0x144e('0x39')]({},_0x441ff6,_0x44ec8a[_0x144e('0x3b')]);var _0x3650b3={'where':_0x441ff6['where']};return db['SugarcrmConfiguration'][_0x144e('0x1c')](_0x3650b3)[_0x144e('0x20')](function(_0xd10222){_0x53cb66['count']=_0xd10222;if(_0x44ec8a[_0x144e('0x2e')][_0x144e('0x3c')]){_0x441ff6[_0x144e('0x3d')]=[{'all':!![]}];}return db[_0x144e('0x3e')][_0x144e('0x3f')](_0x441ff6);})[_0x144e('0x20')](function(_0x20150a){_0x53cb66[_0x144e('0x40')]=_0x20150a;return _0x53cb66;})[_0x144e('0x20')](respondWithFilteredResult(_0x297b57,_0x441ff6))[_0x144e('0x41')](handleError(_0x297b57,null));};exports[_0x144e('0x42')]=function(_0x495bbc,_0x2dfbed){var _0x2eecef={'raw':![],'where':{'id':_0x495bbc[_0x144e('0x43')]['id']}},_0x4b7296={};_0x4b7296['model']=_[_0x144e('0x44')](db[_0x144e('0x3e')][_0x144e('0x29')]);_0x4b7296[_0x144e('0x2e')]=_[_0x144e('0x44')](_0x495bbc[_0x144e('0x2e')]);_0x4b7296[_0x144e('0x2f')]=_[_0x144e('0x31')](_0x4b7296[_0x144e('0x2d')],_0x4b7296[_0x144e('0x2e')]);_0x2eecef[_0x144e('0x30')]=_[_0x144e('0x31')](_0x4b7296[_0x144e('0x2d')],qs['fields'](_0x495bbc[_0x144e('0x2e')]['fields']));_0x2eecef[_0x144e('0x30')]=_0x2eecef[_0x144e('0x30')][_0x144e('0x45')]?_0x2eecef[_0x144e('0x30')]:_0x4b7296[_0x144e('0x2d')];if(_0x495bbc[_0x144e('0x2e')][_0x144e('0x3c')]){_0x2eecef[_0x144e('0x3d')]=[{'all':!![]}];}_0x2eecef=_[_0x144e('0x39')]({},_0x2eecef,_0x495bbc['options']);return db[_0x144e('0x3e')][_0x144e('0x46')](_0x2eecef)[_0x144e('0x20')](handleEntityNotFound(_0x2dfbed,null))[_0x144e('0x20')](respondWithResult(_0x2dfbed,null))[_0x144e('0x41')](handleError(_0x2dfbed,null));};exports[_0x144e('0x47')]=function(_0x3309b4,_0x349eb6){return db[_0x144e('0x3e')][_0x144e('0x47')](_0x3309b4['body'],{})[_0x144e('0x20')](respondWithResult(_0x349eb6,0xc9))['catch'](handleError(_0x349eb6,null));};exports[_0x144e('0x1f')]=function(_0x3e3a12,_0x1c938b){if(_0x3e3a12['body']['id']){delete _0x3e3a12[_0x144e('0x48')]['id'];}return db[_0x144e('0x3e')][_0x144e('0x46')]({'where':{'id':_0x3e3a12[_0x144e('0x43')]['id']}})[_0x144e('0x20')](handleEntityNotFound(_0x1c938b,null))['then'](saveUpdates(_0x3e3a12[_0x144e('0x48')],null))[_0x144e('0x20')](respondWithResult(_0x1c938b,null))['catch'](handleError(_0x1c938b,null));};exports[_0x144e('0x21')]=function(_0xd57d49,_0x19fe4c){return db['SugarcrmConfiguration'][_0x144e('0x46')]({'where':{'id':_0xd57d49[_0x144e('0x43')]['id']}})[_0x144e('0x20')](handleEntityNotFound(_0x19fe4c,null))[_0x144e('0x20')](removeEntity(_0x19fe4c,null))[_0x144e('0x41')](handleError(_0x19fe4c,null));};exports['getFields']=function(_0x12807c,_0x44dc78,_0x4d67dc){var _0x4254a2={};var _0x453e2c={};var _0x1cbd06;var _0x53aa57;return db['SugarcrmConfiguration'][_0x144e('0x49')]({'where':{'id':_0x12807c[_0x144e('0x43')]['id']}})[_0x144e('0x20')](handleEntityNotFound(_0x44dc78,null))['then'](function(_0x303d05){if(_0x303d05){_0x1cbd06=_0x303d05;_0x453e2c[_0x144e('0x2d')]=_[_0x144e('0x44')](db[_0x144e('0x4a')][_0x144e('0x29')]);_0x453e2c['query']=_[_0x144e('0x44')](_0x12807c[_0x144e('0x2e')]);_0x453e2c[_0x144e('0x2f')]=_[_0x144e('0x31')](_0x453e2c['model'],_0x453e2c[_0x144e('0x2e')]);_0x4254a2[_0x144e('0x30')]=_[_0x144e('0x31')](_0x453e2c['model'],qs[_0x144e('0x32')](_0x12807c['query'][_0x144e('0x32')]));_0x4254a2[_0x144e('0x30')]=_0x4254a2['attributes'][_0x144e('0x45')]?_0x4254a2[_0x144e('0x30')]:_0x453e2c[_0x144e('0x2d')];_0x4254a2[_0x144e('0x34')]=qs[_0x144e('0x35')](_0x12807c[_0x144e('0x2e')][_0x144e('0x35')]);_0x4254a2[_0x144e('0x36')]=qs[_0x144e('0x2f')](_[_0x144e('0x37')](_0x12807c[_0x144e('0x2e')],_0x453e2c['filters']));if(_0x12807c[_0x144e('0x2e')]['filter']){_0x4254a2[_0x144e('0x36')]=_[_0x144e('0x39')](_0x4254a2[_0x144e('0x36')],{'$or':_[_0x144e('0x28')](_0x4254a2['attributes'],function(_0x28b5f4){var _0x944630={};_0x944630[_0x28b5f4]={'$like':'%'+_0x12807c[_0x144e('0x2e')][_0x144e('0x38')]+'%'};return _0x944630;})});}_0x4254a2=_[_0x144e('0x39')]({},_0x4254a2,_0x12807c[_0x144e('0x3b')]);return _0x1cbd06[_0x144e('0x4b')](_0x4254a2);}})[_0x144e('0x20')](function(_0x3c1534){if(_0x3c1534){_0x53aa57=_0x3c1534[_0x144e('0x45')];if(!_0x12807c[_0x144e('0x2e')][_0x144e('0x33')](_0x144e('0x4c'))){_0x4254a2[_0x144e('0x1b')]=qs[_0x144e('0x1b')](_0x12807c[_0x144e('0x2e')][_0x144e('0x1b')]);_0x4254a2[_0x144e('0x1d')]=qs['offset'](_0x12807c[_0x144e('0x2e')]['offset']);}return _0x1cbd06['getFields'](_0x4254a2);}})[_0x144e('0x20')](function(_0x2ef043){if(_0x2ef043){return _0x2ef043?{'count':_0x53aa57,'rows':_0x2ef043}:null;}})[_0x144e('0x20')](respondWithResult(_0x44dc78,null))[_0x144e('0x41')](handleError(_0x44dc78,null));};exports[_0x144e('0x4d')]=function(_0x118fb6,_0xccd10,_0x509b83){var _0x289591={};var _0x3893c9={};var _0x101837;var _0x422841;return db['SugarcrmConfiguration'][_0x144e('0x49')]({'where':{'id':_0x118fb6[_0x144e('0x43')]['id']}})[_0x144e('0x20')](handleEntityNotFound(_0xccd10,null))[_0x144e('0x20')](function(_0x4d7004){if(_0x4d7004){_0x101837=_0x4d7004;_0x3893c9[_0x144e('0x2d')]=_[_0x144e('0x44')](db[_0x144e('0x4a')][_0x144e('0x29')]);_0x3893c9['query']=_['keys'](_0x118fb6['query']);_0x3893c9[_0x144e('0x2f')]=_[_0x144e('0x31')](_0x3893c9[_0x144e('0x2d')],_0x3893c9['query']);_0x289591['attributes']=_['intersection'](_0x3893c9['model'],qs['fields'](_0x118fb6[_0x144e('0x2e')][_0x144e('0x32')]));_0x289591[_0x144e('0x30')]=_0x289591[_0x144e('0x30')][_0x144e('0x45')]?_0x289591[_0x144e('0x30')]:_0x3893c9[_0x144e('0x2d')];_0x289591['order']=qs[_0x144e('0x35')](_0x118fb6[_0x144e('0x2e')][_0x144e('0x35')]);_0x289591[_0x144e('0x36')]=qs[_0x144e('0x2f')](_[_0x144e('0x37')](_0x118fb6['query'],_0x3893c9[_0x144e('0x2f')]));if(_0x118fb6[_0x144e('0x2e')]['filter']){_0x289591[_0x144e('0x36')]=_[_0x144e('0x39')](_0x289591[_0x144e('0x36')],{'$or':_['map'](_0x289591[_0x144e('0x30')],function(_0x1aa573){var _0x52180d={};_0x52180d[_0x1aa573]={'$like':'%'+_0x118fb6['query'][_0x144e('0x38')]+'%'};return _0x52180d;})});}_0x289591=_[_0x144e('0x39')]({},_0x289591,_0x118fb6[_0x144e('0x3b')]);return _0x101837[_0x144e('0x4d')](_0x289591);}})[_0x144e('0x20')](function(_0x36014f){if(_0x36014f){_0x422841=_0x36014f['length'];if(!_0x118fb6[_0x144e('0x2e')][_0x144e('0x33')](_0x144e('0x4c'))){_0x289591[_0x144e('0x1b')]=qs[_0x144e('0x1b')](_0x118fb6[_0x144e('0x2e')][_0x144e('0x1b')]);_0x289591[_0x144e('0x1d')]=qs['offset'](_0x118fb6[_0x144e('0x2e')][_0x144e('0x1d')]);}return _0x101837['getSubjects'](_0x289591);}})[_0x144e('0x20')](function(_0x5681eb){if(_0x5681eb){return _0x5681eb?{'count':_0x422841,'rows':_0x5681eb}:null;}})[_0x144e('0x20')](respondWithResult(_0xccd10,null))['catch'](handleError(_0xccd10,null));};exports[_0x144e('0x4e')]=function(_0x2b4afc,_0x4d7eac,_0x53dc0e){var _0x4e0edf={};var _0x5cade5={};var _0x15dff1;var _0x2c9e8d;return db[_0x144e('0x3e')][_0x144e('0x49')]({'where':{'id':_0x2b4afc[_0x144e('0x43')]['id']}})[_0x144e('0x20')](handleEntityNotFound(_0x4d7eac,null))[_0x144e('0x20')](function(_0x464232){if(_0x464232){_0x15dff1=_0x464232;_0x5cade5['model']=_['keys'](db[_0x144e('0x4a')][_0x144e('0x29')]);_0x5cade5['query']=_[_0x144e('0x44')](_0x2b4afc[_0x144e('0x2e')]);_0x5cade5[_0x144e('0x2f')]=_[_0x144e('0x31')](_0x5cade5[_0x144e('0x2d')],_0x5cade5[_0x144e('0x2e')]);_0x4e0edf[_0x144e('0x30')]=_[_0x144e('0x31')](_0x5cade5[_0x144e('0x2d')],qs[_0x144e('0x32')](_0x2b4afc[_0x144e('0x2e')]['fields']));_0x4e0edf[_0x144e('0x30')]=_0x4e0edf[_0x144e('0x30')][_0x144e('0x45')]?_0x4e0edf['attributes']:_0x5cade5[_0x144e('0x2d')];_0x4e0edf[_0x144e('0x34')]=qs[_0x144e('0x35')](_0x2b4afc[_0x144e('0x2e')][_0x144e('0x35')]);_0x4e0edf['where']=qs[_0x144e('0x2f')](_['pick'](_0x2b4afc[_0x144e('0x2e')],_0x5cade5[_0x144e('0x2f')]));if(_0x2b4afc[_0x144e('0x2e')]['filter']){_0x4e0edf[_0x144e('0x36')]=_[_0x144e('0x39')](_0x4e0edf['where'],{'$or':_[_0x144e('0x28')](_0x4e0edf[_0x144e('0x30')],function(_0x4036ae){var _0x462a15={};_0x462a15[_0x4036ae]={'$like':'%'+_0x2b4afc['query'][_0x144e('0x38')]+'%'};return _0x462a15;})});}_0x4e0edf=_[_0x144e('0x39')]({},_0x4e0edf,_0x2b4afc['options']);return _0x15dff1['getDescriptions'](_0x4e0edf);}})[_0x144e('0x20')](function(_0x4764bd){if(_0x4764bd){_0x2c9e8d=_0x4764bd[_0x144e('0x45')];if(!_0x2b4afc[_0x144e('0x2e')][_0x144e('0x33')](_0x144e('0x4c'))){_0x4e0edf[_0x144e('0x1b')]=qs[_0x144e('0x1b')](_0x2b4afc[_0x144e('0x2e')][_0x144e('0x1b')]);_0x4e0edf[_0x144e('0x1d')]=qs[_0x144e('0x1d')](_0x2b4afc[_0x144e('0x2e')][_0x144e('0x1d')]);}return _0x15dff1[_0x144e('0x4e')](_0x4e0edf);}})[_0x144e('0x20')](function(_0x11a56e){if(_0x11a56e){return _0x11a56e?{'count':_0x2c9e8d,'rows':_0x11a56e}:null;}})[_0x144e('0x20')](respondWithResult(_0x4d7eac,null))[_0x144e('0x41')](handleError(_0x4d7eac,null));}; \ No newline at end of file +var _0x34a8=['VIRTUAL','filter','options','includeAll','include','SugarcrmConfiguration','findAll','rows','catch','show','params','model','merge','find','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick'];(function(_0x1ac6f0,_0x40e0c3){var _0x3d6404=function(_0x38facc){while(--_0x38facc){_0x1ac6f0['push'](_0x1ac6f0['shift']());}};_0x3d6404(++_0x40e0c3);}(_0x34a8,0xb8));var _0x834a=function(_0x1b5a2a,_0x2a0575){_0x1b5a2a=_0x1b5a2a-0x0;var _0x1f000a=_0x34a8[_0x1b5a2a];return _0x1f000a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x834a('0x0'));var rp=require(_0x834a('0x1'));var moment=require(_0x834a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x834a('0x3'));var util=require(_0x834a('0x4'));var path=require(_0x834a('0x5'));var sox=require(_0x834a('0x6'));var csv=require(_0x834a('0x7'));var ejs=require(_0x834a('0x8'));var fs=require('fs');var fs_extra=require(_0x834a('0x9'));var _=require('lodash');var squel=require(_0x834a('0xa'));var crypto=require(_0x834a('0xb'));var jsforce=require(_0x834a('0xc'));var deskjs=require(_0x834a('0xd'));var toCsv=require(_0x834a('0x7'));var querystring=require(_0x834a('0xe'));var Papa=require(_0x834a('0xf'));var Redis=require(_0x834a('0x10'));var authService=require(_0x834a('0x11'));var qs=require(_0x834a('0x12'));var as=require(_0x834a('0x13'));var hardwareService=require(_0x834a('0x14'));var logger=require(_0x834a('0x15'))(_0x834a('0x16'));var utils=require('../../config/utils');var config=require(_0x834a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ec0ac,_0x3035b1){_0x3035b1=_0x3035b1||0xcc;return function(_0x6d1a47){if(_0x6d1a47){return _0x3ec0ac[_0x834a('0x18')](_0x3035b1);}return _0x3ec0ac[_0x834a('0x19')](_0x3035b1)[_0x834a('0x1a')]();};}function respondWithResult(_0x4d6892,_0x585a6d){_0x585a6d=_0x585a6d||0xc8;return function(_0x1a063c){if(_0x1a063c){return _0x4d6892[_0x834a('0x19')](_0x585a6d)[_0x834a('0x1b')](_0x1a063c);}};}function respondWithFilteredResult(_0x3d30c3,_0xceda07){return function(_0x20eddb){if(_0x20eddb){var _0x1dfd4b=typeof _0xceda07['offset']===_0x834a('0x1c')&&typeof _0xceda07['limit']===_0x834a('0x1c');var _0x555e94=_0x20eddb[_0x834a('0x1d')];var _0xa5c6a3=_0x1dfd4b?0x0:_0xceda07[_0x834a('0x1e')];var _0x32b7c1=_0x1dfd4b?_0x20eddb['count']:_0xceda07['offset']+_0xceda07[_0x834a('0x1f')];var _0x42013d;if(_0x32b7c1>=_0x555e94){_0x32b7c1=_0x555e94;_0x42013d=0xc8;}else{_0x42013d=0xce;}_0x3d30c3[_0x834a('0x19')](_0x42013d);return _0x3d30c3[_0x834a('0x20')]('Content-Range',_0xa5c6a3+'-'+_0x32b7c1+'/'+_0x555e94)[_0x834a('0x1b')](_0x20eddb);}return null;};}function patchUpdates(_0x25ad3c){return function(_0x2cb319){try{jsonpatch[_0x834a('0x21')](_0x2cb319,_0x25ad3c,!![]);}catch(_0x396bb3){return BPromise[_0x834a('0x22')](_0x396bb3);}return _0x2cb319['save']();};}function saveUpdates(_0x12a3bb,_0x4b26ba){return function(_0x2c9a3c){if(_0x2c9a3c){return _0x2c9a3c[_0x834a('0x23')](_0x12a3bb)['then'](function(_0x4b5c4d){return _0x4b5c4d;});}return null;};}function removeEntity(_0x4103a7,_0x4d8ed4){return function(_0x22ed20){if(_0x22ed20){return _0x22ed20[_0x834a('0x24')]()[_0x834a('0x25')](function(){_0x4103a7[_0x834a('0x19')](0xcc)[_0x834a('0x1a')]();});}};}function handleEntityNotFound(_0x5476df,_0x38c86d){return function(_0x5ea562){if(!_0x5ea562){_0x5476df[_0x834a('0x18')](0x194);}return _0x5ea562;};}function handleError(_0x59430e,_0x532371){_0x532371=_0x532371||0x1f4;return function(_0x1672bb){logger[_0x834a('0x26')](_0x1672bb[_0x834a('0x27')]);if(_0x1672bb['name']){delete _0x1672bb[_0x834a('0x28')];}_0x59430e[_0x834a('0x19')](_0x532371)[_0x834a('0x29')](_0x1672bb);};}exports[_0x834a('0x2a')]=function(_0x3aeb89,_0xb39114){var _0x5b2415={},_0x5017cd={},_0x4e4c6d={'count':0x0,'rows':[]};var _0x785677=_['map'](db['SugarcrmConfiguration'][_0x834a('0x2b')],function(_0x346131){return{'name':_0x346131[_0x834a('0x2c')],'type':_0x346131[_0x834a('0x2d')]['key']};});_0x5017cd['model']=_[_0x834a('0x2e')](_0x785677,_0x834a('0x28'));_0x5017cd[_0x834a('0x2f')]=_[_0x834a('0x30')](_0x3aeb89[_0x834a('0x2f')]);_0x5017cd[_0x834a('0x31')]=_['intersection'](_0x5017cd['model'],_0x5017cd[_0x834a('0x2f')]);_0x5b2415[_0x834a('0x32')]=_[_0x834a('0x33')](_0x5017cd['model'],qs[_0x834a('0x34')](_0x3aeb89[_0x834a('0x2f')][_0x834a('0x34')]));_0x5b2415[_0x834a('0x32')]=_0x5b2415[_0x834a('0x32')][_0x834a('0x35')]?_0x5b2415[_0x834a('0x32')]:_0x5017cd['model'];if(!_0x3aeb89[_0x834a('0x2f')]['hasOwnProperty'](_0x834a('0x36'))){_0x5b2415[_0x834a('0x1f')]=qs['limit'](_0x3aeb89['query'][_0x834a('0x1f')]);_0x5b2415[_0x834a('0x1e')]=qs['offset'](_0x3aeb89[_0x834a('0x2f')]['offset']);}_0x5b2415[_0x834a('0x37')]=qs[_0x834a('0x38')](_0x3aeb89[_0x834a('0x2f')]['sort']);_0x5b2415[_0x834a('0x39')]=qs[_0x834a('0x31')](_[_0x834a('0x3a')](_0x3aeb89[_0x834a('0x2f')],_0x5017cd[_0x834a('0x31')]),_0x785677);if(_0x3aeb89[_0x834a('0x2f')]['filter']){_0x5b2415['where']=_['merge'](_0x5b2415[_0x834a('0x39')],{'$or':_['map'](_0x785677,function(_0x1fbc82){if(_0x1fbc82[_0x834a('0x2d')]!==_0x834a('0x3b')){var _0x26dbde={};_0x26dbde[_0x1fbc82[_0x834a('0x28')]]={'$like':'%'+_0x3aeb89[_0x834a('0x2f')][_0x834a('0x3c')]+'%'};return _0x26dbde;}})});}_0x5b2415=_['merge']({},_0x5b2415,_0x3aeb89[_0x834a('0x3d')]);var _0x35e25c={'where':_0x5b2415[_0x834a('0x39')]};return db['SugarcrmConfiguration'][_0x834a('0x1d')](_0x35e25c)['then'](function(_0x4229ce){_0x4e4c6d[_0x834a('0x1d')]=_0x4229ce;if(_0x3aeb89[_0x834a('0x2f')][_0x834a('0x3e')]){_0x5b2415[_0x834a('0x3f')]=[{'all':!![]}];}return db[_0x834a('0x40')][_0x834a('0x41')](_0x5b2415);})[_0x834a('0x25')](function(_0x76942b){_0x4e4c6d[_0x834a('0x42')]=_0x76942b;return _0x4e4c6d;})['then'](respondWithFilteredResult(_0xb39114,_0x5b2415))[_0x834a('0x43')](handleError(_0xb39114,null));};exports[_0x834a('0x44')]=function(_0x1700be,_0x360d13){var _0x232ad4={'raw':![],'where':{'id':_0x1700be[_0x834a('0x45')]['id']}},_0x2ec348={};_0x2ec348['model']=_[_0x834a('0x30')](db[_0x834a('0x40')][_0x834a('0x2b')]);_0x2ec348[_0x834a('0x2f')]=_['keys'](_0x1700be[_0x834a('0x2f')]);_0x2ec348['filters']=_[_0x834a('0x33')](_0x2ec348[_0x834a('0x46')],_0x2ec348[_0x834a('0x2f')]);_0x232ad4['attributes']=_[_0x834a('0x33')](_0x2ec348[_0x834a('0x46')],qs[_0x834a('0x34')](_0x1700be[_0x834a('0x2f')][_0x834a('0x34')]));_0x232ad4[_0x834a('0x32')]=_0x232ad4['attributes'][_0x834a('0x35')]?_0x232ad4[_0x834a('0x32')]:_0x2ec348['model'];if(_0x1700be[_0x834a('0x2f')][_0x834a('0x3e')]){_0x232ad4[_0x834a('0x3f')]=[{'all':!![]}];}_0x232ad4=_[_0x834a('0x47')]({},_0x232ad4,_0x1700be[_0x834a('0x3d')]);return db[_0x834a('0x40')][_0x834a('0x48')](_0x232ad4)[_0x834a('0x25')](handleEntityNotFound(_0x360d13,null))[_0x834a('0x25')](respondWithResult(_0x360d13,null))[_0x834a('0x43')](handleError(_0x360d13,null));};exports[_0x834a('0x49')]=function(_0x4d605f,_0x5a9a36){return db[_0x834a('0x40')]['create'](_0x4d605f[_0x834a('0x4a')],{})[_0x834a('0x25')](respondWithResult(_0x5a9a36,0xc9))[_0x834a('0x43')](handleError(_0x5a9a36,null));};exports[_0x834a('0x23')]=function(_0x34c2bd,_0x42aed5){if(_0x34c2bd[_0x834a('0x4a')]['id']){delete _0x34c2bd['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x34c2bd[_0x834a('0x45')]['id']}})[_0x834a('0x25')](handleEntityNotFound(_0x42aed5,null))['then'](saveUpdates(_0x34c2bd[_0x834a('0x4a')],null))[_0x834a('0x25')](respondWithResult(_0x42aed5,null))[_0x834a('0x43')](handleError(_0x42aed5,null));};exports[_0x834a('0x24')]=function(_0x4b33d3,_0x3f4324){return db[_0x834a('0x40')]['find']({'where':{'id':_0x4b33d3[_0x834a('0x45')]['id']}})[_0x834a('0x25')](handleEntityNotFound(_0x3f4324,null))[_0x834a('0x25')](removeEntity(_0x3f4324,null))[_0x834a('0x43')](handleError(_0x3f4324,null));};exports[_0x834a('0x4b')]=function(_0x3c71dc,_0x2bd391,_0x322abc){var _0x3ee529={};var _0x5e2281={};var _0x38fa6e;var _0x1697d6;return db[_0x834a('0x40')][_0x834a('0x4c')]({'where':{'id':_0x3c71dc[_0x834a('0x45')]['id']}})[_0x834a('0x25')](handleEntityNotFound(_0x2bd391,null))[_0x834a('0x25')](function(_0x492c7a){if(_0x492c7a){_0x38fa6e=_0x492c7a;_0x5e2281['model']=_[_0x834a('0x30')](db[_0x834a('0x4d')][_0x834a('0x2b')]);_0x5e2281[_0x834a('0x2f')]=_[_0x834a('0x30')](_0x3c71dc[_0x834a('0x2f')]);_0x5e2281['filters']=_[_0x834a('0x33')](_0x5e2281[_0x834a('0x46')],_0x5e2281[_0x834a('0x2f')]);_0x3ee529[_0x834a('0x32')]=_[_0x834a('0x33')](_0x5e2281[_0x834a('0x46')],qs[_0x834a('0x34')](_0x3c71dc[_0x834a('0x2f')]['fields']));_0x3ee529[_0x834a('0x32')]=_0x3ee529[_0x834a('0x32')][_0x834a('0x35')]?_0x3ee529[_0x834a('0x32')]:_0x5e2281[_0x834a('0x46')];_0x3ee529[_0x834a('0x37')]=qs['sort'](_0x3c71dc[_0x834a('0x2f')]['sort']);_0x3ee529['where']=qs[_0x834a('0x31')](_[_0x834a('0x3a')](_0x3c71dc[_0x834a('0x2f')],_0x5e2281[_0x834a('0x31')]));if(_0x3c71dc[_0x834a('0x2f')][_0x834a('0x3c')]){_0x3ee529['where']=_[_0x834a('0x47')](_0x3ee529['where'],{'$or':_['map'](_0x3ee529[_0x834a('0x32')],function(_0x3d0248){var _0x1e27d2={};_0x1e27d2[_0x3d0248]={'$like':'%'+_0x3c71dc['query']['filter']+'%'};return _0x1e27d2;})});}_0x3ee529=_[_0x834a('0x47')]({},_0x3ee529,_0x3c71dc[_0x834a('0x3d')]);return _0x38fa6e['getFields'](_0x3ee529);}})[_0x834a('0x25')](function(_0x5dc0c0){if(_0x5dc0c0){_0x1697d6=_0x5dc0c0['length'];if(!_0x3c71dc[_0x834a('0x2f')][_0x834a('0x4e')](_0x834a('0x36'))){_0x3ee529['limit']=qs[_0x834a('0x1f')](_0x3c71dc['query'][_0x834a('0x1f')]);_0x3ee529[_0x834a('0x1e')]=qs[_0x834a('0x1e')](_0x3c71dc[_0x834a('0x2f')][_0x834a('0x1e')]);}return _0x38fa6e['getFields'](_0x3ee529);}})[_0x834a('0x25')](function(_0x2e30ee){if(_0x2e30ee){return _0x2e30ee?{'count':_0x1697d6,'rows':_0x2e30ee}:null;}})[_0x834a('0x25')](respondWithResult(_0x2bd391,null))[_0x834a('0x43')](handleError(_0x2bd391,null));};exports[_0x834a('0x4f')]=function(_0x6dc8bb,_0x5274f1,_0x50d96d){var _0x5e9454={};var _0x151453={};var _0xa897f4;var _0x3dc56d;return db['SugarcrmConfiguration'][_0x834a('0x4c')]({'where':{'id':_0x6dc8bb[_0x834a('0x45')]['id']}})[_0x834a('0x25')](handleEntityNotFound(_0x5274f1,null))[_0x834a('0x25')](function(_0x23883e){if(_0x23883e){_0xa897f4=_0x23883e;_0x151453[_0x834a('0x46')]=_[_0x834a('0x30')](db[_0x834a('0x4d')]['rawAttributes']);_0x151453[_0x834a('0x2f')]=_[_0x834a('0x30')](_0x6dc8bb[_0x834a('0x2f')]);_0x151453[_0x834a('0x31')]=_['intersection'](_0x151453[_0x834a('0x46')],_0x151453['query']);_0x5e9454['attributes']=_[_0x834a('0x33')](_0x151453['model'],qs[_0x834a('0x34')](_0x6dc8bb[_0x834a('0x2f')][_0x834a('0x34')]));_0x5e9454['attributes']=_0x5e9454[_0x834a('0x32')][_0x834a('0x35')]?_0x5e9454[_0x834a('0x32')]:_0x151453['model'];_0x5e9454[_0x834a('0x37')]=qs[_0x834a('0x38')](_0x6dc8bb['query'][_0x834a('0x38')]);_0x5e9454[_0x834a('0x39')]=qs[_0x834a('0x31')](_[_0x834a('0x3a')](_0x6dc8bb[_0x834a('0x2f')],_0x151453[_0x834a('0x31')]));if(_0x6dc8bb[_0x834a('0x2f')][_0x834a('0x3c')]){_0x5e9454[_0x834a('0x39')]=_[_0x834a('0x47')](_0x5e9454[_0x834a('0x39')],{'$or':_['map'](_0x5e9454['attributes'],function(_0x180da0){var _0x4a60b2={};_0x4a60b2[_0x180da0]={'$like':'%'+_0x6dc8bb[_0x834a('0x2f')][_0x834a('0x3c')]+'%'};return _0x4a60b2;})});}_0x5e9454=_[_0x834a('0x47')]({},_0x5e9454,_0x6dc8bb[_0x834a('0x3d')]);return _0xa897f4[_0x834a('0x4f')](_0x5e9454);}})['then'](function(_0x4d2e0e){if(_0x4d2e0e){_0x3dc56d=_0x4d2e0e['length'];if(!_0x6dc8bb[_0x834a('0x2f')][_0x834a('0x4e')]('nolimit')){_0x5e9454[_0x834a('0x1f')]=qs[_0x834a('0x1f')](_0x6dc8bb[_0x834a('0x2f')][_0x834a('0x1f')]);_0x5e9454['offset']=qs[_0x834a('0x1e')](_0x6dc8bb[_0x834a('0x2f')][_0x834a('0x1e')]);}return _0xa897f4[_0x834a('0x4f')](_0x5e9454);}})[_0x834a('0x25')](function(_0xe0e329){if(_0xe0e329){return _0xe0e329?{'count':_0x3dc56d,'rows':_0xe0e329}:null;}})[_0x834a('0x25')](respondWithResult(_0x5274f1,null))[_0x834a('0x43')](handleError(_0x5274f1,null));};exports[_0x834a('0x50')]=function(_0x226797,_0x1ec365,_0x394501){var _0x3fe158={};var _0x56b466={};var _0x44d303;var _0x536d5a;return db['SugarcrmConfiguration'][_0x834a('0x4c')]({'where':{'id':_0x226797[_0x834a('0x45')]['id']}})[_0x834a('0x25')](handleEntityNotFound(_0x1ec365,null))['then'](function(_0x42d80f){if(_0x42d80f){_0x44d303=_0x42d80f;_0x56b466[_0x834a('0x46')]=_[_0x834a('0x30')](db[_0x834a('0x4d')][_0x834a('0x2b')]);_0x56b466[_0x834a('0x2f')]=_[_0x834a('0x30')](_0x226797[_0x834a('0x2f')]);_0x56b466[_0x834a('0x31')]=_[_0x834a('0x33')](_0x56b466[_0x834a('0x46')],_0x56b466[_0x834a('0x2f')]);_0x3fe158[_0x834a('0x32')]=_[_0x834a('0x33')](_0x56b466[_0x834a('0x46')],qs[_0x834a('0x34')](_0x226797[_0x834a('0x2f')][_0x834a('0x34')]));_0x3fe158[_0x834a('0x32')]=_0x3fe158['attributes']['length']?_0x3fe158['attributes']:_0x56b466[_0x834a('0x46')];_0x3fe158[_0x834a('0x37')]=qs[_0x834a('0x38')](_0x226797[_0x834a('0x2f')][_0x834a('0x38')]);_0x3fe158['where']=qs[_0x834a('0x31')](_[_0x834a('0x3a')](_0x226797['query'],_0x56b466[_0x834a('0x31')]));if(_0x226797[_0x834a('0x2f')][_0x834a('0x3c')]){_0x3fe158[_0x834a('0x39')]=_['merge'](_0x3fe158[_0x834a('0x39')],{'$or':_['map'](_0x3fe158['attributes'],function(_0x42c227){var _0x5f24d9={};_0x5f24d9[_0x42c227]={'$like':'%'+_0x226797[_0x834a('0x2f')][_0x834a('0x3c')]+'%'};return _0x5f24d9;})});}_0x3fe158=_['merge']({},_0x3fe158,_0x226797[_0x834a('0x3d')]);return _0x44d303[_0x834a('0x50')](_0x3fe158);}})[_0x834a('0x25')](function(_0x65a5a2){if(_0x65a5a2){_0x536d5a=_0x65a5a2[_0x834a('0x35')];if(!_0x226797['query']['hasOwnProperty']('nolimit')){_0x3fe158[_0x834a('0x1f')]=qs['limit'](_0x226797[_0x834a('0x2f')][_0x834a('0x1f')]);_0x3fe158[_0x834a('0x1e')]=qs['offset'](_0x226797['query'][_0x834a('0x1e')]);}return _0x44d303[_0x834a('0x50')](_0x3fe158);}})[_0x834a('0x25')](function(_0x3ae4a6){if(_0x3ae4a6){return _0x3ae4a6?{'count':_0x536d5a,'rows':_0x3ae4a6}:null;}})[_0x834a('0x25')](respondWithResult(_0x1ec365,null))['catch'](handleError(_0x1ec365,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 372197f..f7cf305 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 _0x597a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','lodash','util'];(function(_0x1cc2eb,_0x278a5b){var _0x32c33b=function(_0x212f5c){while(--_0x212f5c){_0x1cc2eb['push'](_0x1cc2eb['shift']());}};_0x32c33b(++_0x278a5b);}(_0x597a,0xb9));var _0xa597=function(_0x289531,_0x1180e5){_0x289531=_0x289531-0x0;var _0x2e7019=_0x597a[_0x289531];return _0x2e7019;};'use strict';var _=require(_0xa597('0x0'));var util=require(_0xa597('0x1'));var logger=require(_0xa597('0x2'))('api');var moment=require(_0xa597('0x3'));var BPromise=require(_0xa597('0x4'));var rp=require(_0xa597('0x5'));var fs=require('fs');var path=require(_0xa597('0x6'));var rimraf=require(_0xa597('0x7'));var config=require('../../config/environment');var attributes=require(_0xa597('0x8'));module['exports']=function(_0x1fadd6,_0x498475){return _0x1fadd6[_0xa597('0x9')](_0xa597('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c54=['lodash','util','../../config/logger','api','moment','request-promise','path','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x15991c,_0x4aa1df){var _0x5f4184=function(_0xe31e2f){while(--_0xe31e2f){_0x15991c['push'](_0x15991c['shift']());}};_0x5f4184(++_0x4aa1df);}(_0x7c54,0x186));var _0x47c5=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0x7c54[_0xfad1a7];return _0x571012;};'use strict';var _=require(_0x47c5('0x0'));var util=require(_0x47c5('0x1'));var logger=require(_0x47c5('0x2'))(_0x47c5('0x3'));var moment=require(_0x47c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x47c5('0x5'));var fs=require('fs');var path=require(_0x47c5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x47c5('0x7'));module[_0x47c5('0x8')]=function(_0xd4593,_0x45c57c){return _0xd4593[_0x47c5('0x9')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','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 8b372ac..f6c7e35 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 _0x9ca4=['result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x307d2b,_0x3796e0){var _0xe82587=function(_0x3c9b26){while(--_0x3c9b26){_0x307d2b['push'](_0x307d2b['shift']());}};_0xe82587(++_0x3796e0);}(_0x9ca4,0x189));var _0x49ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ca4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x49ca('0x0'));var util=require('util');var moment=require(_0x49ca('0x1'));var BPromise=require('bluebird');var rs=require(_0x49ca('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49ca('0x3'))['db'];var utils=require(_0x49ca('0x4'));var logger=require(_0x49ca('0x5'))(_0x49ca('0x6'));var config=require(_0x49ca('0x7'));var jayson=require(_0x49ca('0x8'));var client=jayson[_0x49ca('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2740ed,_0x4909f8,_0x2a840a){return new BPromise(function(_0x5cbc67,_0xf94c6a){return client[_0x49ca('0xa')](_0x2740ed,_0x2a840a)[_0x49ca('0xb')](function(_0x1dee88){logger[_0x49ca('0xc')](_0x49ca('0xd'),_0x4909f8,_0x49ca('0xe'));logger[_0x49ca('0xf')](_0x49ca('0x10'),_0x4909f8,_0x49ca('0xe'),JSON[_0x49ca('0x11')](_0x1dee88));if(_0x1dee88['error']){if(_0x1dee88[_0x49ca('0x12')][_0x49ca('0x13')]===0x1f4){logger[_0x49ca('0x12')](_0x49ca('0xd'),_0x4909f8,_0x1dee88[_0x49ca('0x12')][_0x49ca('0x14')]);return _0xf94c6a(_0x1dee88['error'][_0x49ca('0x14')]);}logger[_0x49ca('0x12')](_0x49ca('0xd'),_0x4909f8,_0x1dee88[_0x49ca('0x12')][_0x49ca('0x14')]);return _0x5cbc67(_0x1dee88[_0x49ca('0x12')][_0x49ca('0x14')]);}else{logger[_0x49ca('0xc')](_0x49ca('0xd'),_0x4909f8,'request\x20sent');_0x5cbc67(_0x1dee88[_0x49ca('0x15')][_0x49ca('0x14')]);}})[_0x49ca('0x16')](function(_0x285d60){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4909f8,_0x285d60);_0xf94c6a(_0x285d60);});});} \ No newline at end of file +var _0xad3d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0xad3d,0x133));var _0xdad3=function(_0x3dd6c9,_0xd7e5bb){_0x3dd6c9=_0x3dd6c9-0x0;var _0x369ebc=_0xad3d[_0x3dd6c9];return _0x369ebc;};'use strict';var _=require('lodash');var util=require(_0xdad3('0x0'));var moment=require('moment');var BPromise=require(_0xdad3('0x1'));var rs=require(_0xdad3('0x2'));var fs=require('fs');var Redis=require(_0xdad3('0x3'));var db=require(_0xdad3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdad3('0x5'))(_0xdad3('0x6'));var config=require(_0xdad3('0x7'));var jayson=require(_0xdad3('0x8'));var client=jayson[_0xdad3('0x9')][_0xdad3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47756d,_0x274077,_0x45bddd){return new BPromise(function(_0x2a8c92,_0x3290b6){return client[_0xdad3('0xb')](_0x47756d,_0x45bddd)['then'](function(_0x4c6703){logger[_0xdad3('0xc')](_0xdad3('0xd'),_0x274077,'request\x20sent');logger[_0xdad3('0xe')](_0xdad3('0xf'),_0x274077,_0xdad3('0x10'),JSON[_0xdad3('0x11')](_0x4c6703));if(_0x4c6703[_0xdad3('0x12')]){if(_0x4c6703['error']['code']===0x1f4){logger[_0xdad3('0x12')](_0xdad3('0xd'),_0x274077,_0x4c6703[_0xdad3('0x12')][_0xdad3('0x13')]);return _0x3290b6(_0x4c6703[_0xdad3('0x12')][_0xdad3('0x13')]);}logger[_0xdad3('0x12')](_0xdad3('0xd'),_0x274077,_0x4c6703[_0xdad3('0x12')][_0xdad3('0x13')]);return _0x2a8c92(_0x4c6703[_0xdad3('0x12')]['message']);}else{logger[_0xdad3('0xc')](_0xdad3('0xd'),_0x274077,_0xdad3('0x10'));_0x2a8c92(_0x4c6703[_0xdad3('0x14')]['message']);}})[_0xdad3('0x15')](function(_0x10e99e){logger['error'](_0xdad3('0xd'),_0x274077,_0x10e99e);_0x3290b6(_0x10e99e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 59693f0..904c54a 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 _0x0a23=['isAuthenticated','index','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2dfbee,_0x3ce673){var _0x5d041e=function(_0x5d8f3e){while(--_0x5d8f3e){_0x2dfbee['push'](_0x2dfbee['shift']());}};_0x5d041e(++_0x3ce673);}(_0x0a23,0xa2));var _0x30a2=function(_0xb10de1,_0x5b0724){_0xb10de1=_0xb10de1-0x0;var _0x14d3ab=_0x0a23[_0xb10de1];return _0x14d3ab;};'use strict';var multer=require(_0x30a2('0x0'));var util=require('util');var path=require(_0x30a2('0x1'));var timeout=require(_0x30a2('0x2'));var express=require(_0x30a2('0x3'));var router=express[_0x30a2('0x4')]();var fs_extra=require(_0x30a2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x30a2('0x6'));var config=require(_0x30a2('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x30a2('0x8')](),controller[_0x30a2('0x9')]);router['get']('/:id',auth[_0x30a2('0x8')](),controller['show']);router['post']('/',auth[_0x30a2('0x8')](),controller[_0x30a2('0xa')]);router[_0x30a2('0xb')](_0x30a2('0xc'),auth['isAuthenticated'](),controller[_0x30a2('0xd')]);router[_0x30a2('0xe')](_0x30a2('0xc'),auth[_0x30a2('0x8')](),controller[_0x30a2('0xf')]);module[_0x30a2('0x10')]=router; \ No newline at end of file +var _0x1f70=['get','index','/:id','isAuthenticated','post','create','update','delete','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x2bcda0,_0x2e4ead){var _0x44a707=function(_0x2d1e4e){while(--_0x2d1e4e){_0x2bcda0['push'](_0x2bcda0['shift']());}};_0x44a707(++_0x2e4ead);}(_0x1f70,0x68));var _0x01f7=function(_0x5ab2f9,_0x21568b){_0x5ab2f9=_0x5ab2f9-0x0;var _0x9f7eb6=_0x1f70[_0x5ab2f9];return _0x9f7eb6;};'use strict';var multer=require('multer');var util=require(_0x01f7('0x0'));var path=require(_0x01f7('0x1'));var timeout=require(_0x01f7('0x2'));var express=require('express');var router=express[_0x01f7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x01f7('0x4'));var interaction=require(_0x01f7('0x5'));var config=require(_0x01f7('0x6'));var controller=require(_0x01f7('0x7'));router[_0x01f7('0x8')]('/',auth['isAuthenticated'](),controller[_0x01f7('0x9')]);router['get'](_0x01f7('0xa'),auth[_0x01f7('0xb')](),controller['show']);router[_0x01f7('0xc')]('/',auth[_0x01f7('0xb')](),controller[_0x01f7('0xd')]);router['put'](_0x01f7('0xa'),auth[_0x01f7('0xb')](),controller[_0x01f7('0xe')]);router[_0x01f7('0xf')](_0x01f7('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3f5f309..679b07e 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 _0xef28=['keyValue','picklist','STRING','BOOLEAN','sequelize','string','variable'];(function(_0x37bc39,_0x4abe0a){var _0x1c0990=function(_0x4735ad){while(--_0x4735ad){_0x37bc39['push'](_0x37bc39['shift']());}};_0x1c0990(++_0x4abe0a);}(_0xef28,0x1af));var _0x8ef2=function(_0x2e6d13,_0x52ad99){_0x2e6d13=_0x2e6d13-0x0;var _0x250283=_0xef28[_0x2e6d13];return _0x250283;};'use strict';var Sequelize=require(_0x8ef2('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x8ef2('0x1'),_0x8ef2('0x2'),'customVariable',_0x8ef2('0x3'),_0x8ef2('0x4')),'defaultValue':_0x8ef2('0x1')},'content':{'type':Sequelize[_0x8ef2('0x5')]},'key':{'type':Sequelize[_0x8ef2('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x8ef2('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x8ef2('0x5')]},'idField':{'type':Sequelize[_0x8ef2('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8ef2('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x80d9=['exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x1c5722,_0x23303d){var _0x1fdbdc=function(_0x193df3){while(--_0x193df3){_0x1c5722['push'](_0x1c5722['shift']());}};_0x1fdbdc(++_0x23303d);}(_0x80d9,0x181));var _0x980d=function(_0x42bb91,_0x41c7f2){_0x42bb91=_0x42bb91-0x0;var _0x5d02f4=_0x80d9[_0x42bb91];return _0x5d02f4;};'use strict';var Sequelize=require('sequelize');module[_0x980d('0x0')]={'type':{'type':Sequelize[_0x980d('0x1')](_0x980d('0x2'),_0x980d('0x3'),_0x980d('0x4'),'keyValue',_0x980d('0x5')),'defaultValue':_0x980d('0x2')},'content':{'type':Sequelize[_0x980d('0x6')]},'key':{'type':Sequelize[_0x980d('0x6')]},'keyType':{'type':Sequelize[_0x980d('0x1')](_0x980d('0x2'),_0x980d('0x3'),_0x980d('0x4'))},'keyContent':{'type':Sequelize[_0x980d('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x980d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x980d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 50ef3bb..d730753 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 _0xf87f=['options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','limit','count','offset','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','length','include'];(function(_0x1c704c,_0x3074c1){var _0x26d862=function(_0x1625b5){while(--_0x1625b5){_0x1c704c['push'](_0x1c704c['shift']());}};_0x26d862(++_0x3074c1);}(_0xf87f,0xe0));var _0xff87=function(_0x7e4d6a,_0x10e6b3){_0x7e4d6a=_0x7e4d6a-0x0;var _0x524077=_0xf87f[_0x7e4d6a];return _0x524077;};'use strict';var emlformat=require(_0xff87('0x0'));var rimraf=require(_0xff87('0x1'));var zipdir=require(_0xff87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff87('0x3'));var moment=require(_0xff87('0x4'));var BPromise=require(_0xff87('0x5'));var Mustache=require('mustache');var util=require(_0xff87('0x6'));var path=require(_0xff87('0x7'));var sox=require(_0xff87('0x8'));var csv=require(_0xff87('0x9'));var ejs=require(_0xff87('0xa'));var fs=require('fs');var fs_extra=require(_0xff87('0xb'));var _=require(_0xff87('0xc'));var squel=require('squel');var crypto=require(_0xff87('0xd'));var jsforce=require(_0xff87('0xe'));var deskjs=require(_0xff87('0xf'));var toCsv=require(_0xff87('0x9'));var querystring=require('querystring');var Papa=require(_0xff87('0x10'));var Redis=require(_0xff87('0x11'));var authService=require(_0xff87('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xff87('0x13'));var hardwareService=require(_0xff87('0x14'));var logger=require(_0xff87('0x15'))(_0xff87('0x16'));var utils=require(_0xff87('0x17'));var config=require(_0xff87('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x395479,_0x7c4d12){_0x7c4d12=_0x7c4d12||0xcc;return function(_0x415f9d){if(_0x415f9d){return _0x395479[_0xff87('0x19')](_0x7c4d12);}return _0x395479[_0xff87('0x1a')](_0x7c4d12)['end']();};}function respondWithResult(_0x322b8a,_0x40f269){_0x40f269=_0x40f269||0xc8;return function(_0x260927){if(_0x260927){return _0x322b8a[_0xff87('0x1a')](_0x40f269)[_0xff87('0x1b')](_0x260927);}};}function respondWithFilteredResult(_0x19a92c,_0x2de279){return function(_0x38fa42){if(_0x38fa42){var _0x46183a=typeof _0x2de279['offset']==='undefined'&&typeof _0x2de279[_0xff87('0x1c')]==='undefined';var _0x1f1cd5=_0x38fa42[_0xff87('0x1d')];var _0x3d87ca=_0x46183a?0x0:_0x2de279[_0xff87('0x1e')];var _0x53c9e3=_0x46183a?_0x38fa42[_0xff87('0x1d')]:_0x2de279[_0xff87('0x1e')]+_0x2de279[_0xff87('0x1c')];var _0x371ceb;if(_0x53c9e3>=_0x1f1cd5){_0x53c9e3=_0x1f1cd5;_0x371ceb=0xc8;}else{_0x371ceb=0xce;}_0x19a92c['status'](_0x371ceb);return _0x19a92c['set'](_0xff87('0x1f'),_0x3d87ca+'-'+_0x53c9e3+'/'+_0x1f1cd5)[_0xff87('0x1b')](_0x38fa42);}return null;};}function patchUpdates(_0x1af775){return function(_0x2fab09){try{jsonpatch[_0xff87('0x20')](_0x2fab09,_0x1af775,!![]);}catch(_0x5e6d24){return BPromise[_0xff87('0x21')](_0x5e6d24);}return _0x2fab09[_0xff87('0x22')]();};}function saveUpdates(_0x50b6bc,_0xb68ebf){return function(_0x5bda47){if(_0x5bda47){return _0x5bda47[_0xff87('0x23')](_0x50b6bc)[_0xff87('0x24')](function(_0x55e23c){return _0x55e23c;});}return null;};}function removeEntity(_0x1da121,_0x1d182d){return function(_0x1b6819){if(_0x1b6819){return _0x1b6819['destroy']()['then'](function(){_0x1da121[_0xff87('0x1a')](0xcc)[_0xff87('0x25')]();});}};}function handleEntityNotFound(_0x4cc63c,_0x121b8a){return function(_0x347102){if(!_0x347102){_0x4cc63c[_0xff87('0x19')](0x194);}return _0x347102;};}function handleError(_0x59e9a3,_0x14ace1){_0x14ace1=_0x14ace1||0x1f4;return function(_0x333785){logger[_0xff87('0x26')](_0x333785[_0xff87('0x27')]);if(_0x333785[_0xff87('0x28')]){delete _0x333785[_0xff87('0x28')];}_0x59e9a3[_0xff87('0x1a')](_0x14ace1)[_0xff87('0x29')](_0x333785);};}exports[_0xff87('0x2a')]=function(_0x13595a,_0x26bd91){var _0x1600ac={},_0x41dd75={},_0x332a9b={'count':0x0,'rows':[]};var _0x5be19f=_[_0xff87('0x2b')](db[_0xff87('0x2c')][_0xff87('0x2d')],function(_0x5dd200){return{'name':_0x5dd200[_0xff87('0x2e')],'type':_0x5dd200[_0xff87('0x2f')]['key']};});_0x41dd75[_0xff87('0x30')]=_[_0xff87('0x2b')](_0x5be19f,_0xff87('0x28'));_0x41dd75['query']=_['keys'](_0x13595a['query']);_0x41dd75[_0xff87('0x31')]=_[_0xff87('0x32')](_0x41dd75[_0xff87('0x30')],_0x41dd75[_0xff87('0x33')]);_0x1600ac[_0xff87('0x34')]=_[_0xff87('0x32')](_0x41dd75[_0xff87('0x30')],qs[_0xff87('0x35')](_0x13595a[_0xff87('0x33')][_0xff87('0x35')]));_0x1600ac[_0xff87('0x34')]=_0x1600ac['attributes']['length']?_0x1600ac[_0xff87('0x34')]:_0x41dd75[_0xff87('0x30')];if(!_0x13595a[_0xff87('0x33')]['hasOwnProperty']('nolimit')){_0x1600ac[_0xff87('0x1c')]=qs[_0xff87('0x1c')](_0x13595a[_0xff87('0x33')][_0xff87('0x1c')]);_0x1600ac[_0xff87('0x1e')]=qs[_0xff87('0x1e')](_0x13595a[_0xff87('0x33')][_0xff87('0x1e')]);}_0x1600ac[_0xff87('0x36')]=qs[_0xff87('0x37')](_0x13595a[_0xff87('0x33')][_0xff87('0x37')]);_0x1600ac[_0xff87('0x38')]=qs[_0xff87('0x31')](_[_0xff87('0x39')](_0x13595a[_0xff87('0x33')],_0x41dd75[_0xff87('0x31')]),_0x5be19f);if(_0x13595a[_0xff87('0x33')]['filter']){_0x1600ac['where']=_[_0xff87('0x3a')](_0x1600ac[_0xff87('0x38')],{'$or':_[_0xff87('0x2b')](_0x5be19f,function(_0x42b408){if(_0x42b408[_0xff87('0x2f')]!==_0xff87('0x3b')){var _0x4411b8={};_0x4411b8[_0x42b408[_0xff87('0x28')]]={'$like':'%'+_0x13595a[_0xff87('0x33')][_0xff87('0x3c')]+'%'};return _0x4411b8;}})});}_0x1600ac=_[_0xff87('0x3a')]({},_0x1600ac,_0x13595a['options']);var _0x486e68={'where':_0x1600ac[_0xff87('0x38')]};return db[_0xff87('0x2c')][_0xff87('0x1d')](_0x486e68)['then'](function(_0x3cf7f5){_0x332a9b[_0xff87('0x1d')]=_0x3cf7f5;if(_0x13595a[_0xff87('0x33')][_0xff87('0x3d')]){_0x1600ac['include']=[{'all':!![]}];}return db[_0xff87('0x2c')]['findAll'](_0x1600ac);})[_0xff87('0x24')](function(_0x370645){_0x332a9b[_0xff87('0x3e')]=_0x370645;return _0x332a9b;})[_0xff87('0x24')](respondWithFilteredResult(_0x26bd91,_0x1600ac))[_0xff87('0x3f')](handleError(_0x26bd91,null));};exports[_0xff87('0x40')]=function(_0x448198,_0x322fa9){var _0x235723={'raw':!![],'where':{'id':_0x448198[_0xff87('0x41')]['id']}},_0x134456={};_0x134456[_0xff87('0x30')]=_['keys'](db['SugarcrmField'][_0xff87('0x2d')]);_0x134456[_0xff87('0x33')]=_['keys'](_0x448198[_0xff87('0x33')]);_0x134456[_0xff87('0x31')]=_['intersection'](_0x134456[_0xff87('0x30')],_0x134456[_0xff87('0x33')]);_0x235723[_0xff87('0x34')]=_['intersection'](_0x134456['model'],qs[_0xff87('0x35')](_0x448198['query']['fields']));_0x235723['attributes']=_0x235723[_0xff87('0x34')][_0xff87('0x42')]?_0x235723[_0xff87('0x34')]:_0x134456[_0xff87('0x30')];if(_0x448198[_0xff87('0x33')][_0xff87('0x3d')]){_0x235723[_0xff87('0x43')]=[{'all':!![]}];}_0x235723=_['merge']({},_0x235723,_0x448198[_0xff87('0x44')]);return db[_0xff87('0x2c')][_0xff87('0x45')](_0x235723)[_0xff87('0x24')](handleEntityNotFound(_0x322fa9,null))[_0xff87('0x24')](respondWithResult(_0x322fa9,null))['catch'](handleError(_0x322fa9,null));};exports['create']=function(_0x3880ce,_0x5b3194){return db['SugarcrmField'][_0xff87('0x46')](_0x3880ce['body'],{})[_0xff87('0x24')](respondWithResult(_0x5b3194,0xc9))[_0xff87('0x3f')](handleError(_0x5b3194,null));};exports[_0xff87('0x23')]=function(_0x1fb8d6,_0x41b1c6){if(_0x1fb8d6[_0xff87('0x47')]['id']){delete _0x1fb8d6[_0xff87('0x47')]['id'];}return db[_0xff87('0x2c')][_0xff87('0x45')]({'where':{'id':_0x1fb8d6['params']['id']}})['then'](handleEntityNotFound(_0x41b1c6,null))[_0xff87('0x24')](saveUpdates(_0x1fb8d6[_0xff87('0x47')],null))['then'](respondWithResult(_0x41b1c6,null))[_0xff87('0x3f')](handleError(_0x41b1c6,null));};exports[_0xff87('0x48')]=function(_0x560e19,_0x4e02e1){return db[_0xff87('0x2c')][_0xff87('0x45')]({'where':{'id':_0x560e19['params']['id']}})['then'](handleEntityNotFound(_0x4e02e1,null))[_0xff87('0x24')](removeEntity(_0x4e02e1,null))[_0xff87('0x3f')](handleError(_0x4e02e1,null));}; \ No newline at end of file +var _0xb77a=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','SugarcrmField','rawAttributes','fieldName','model','map','filters','intersection','query','attributes','hasOwnProperty','order','sort','where','pick','merge','type','filter','include','findAll','show','params','keys','fields','length','includeAll','options','find','catch','create','body','eml-format','rimraf','zip-dir','bluebird','util'];(function(_0x49c2e3,_0x1655b8){var _0x3dad00=function(_0x377dcf){while(--_0x377dcf){_0x49c2e3['push'](_0x49c2e3['shift']());}};_0x3dad00(++_0x1655b8);}(_0xb77a,0x8b));var _0xab77=function(_0x480463,_0x816078){_0x480463=_0x480463-0x0;var _0x3d6934=_0xb77a[_0x480463];return _0x3d6934;};'use strict';var emlformat=require(_0xab77('0x0'));var rimraf=require(_0xab77('0x1'));var zipdir=require(_0xab77('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab77('0x3'));var Mustache=require('mustache');var util=require(_0xab77('0x4'));var path=require(_0xab77('0x5'));var sox=require(_0xab77('0x6'));var csv=require(_0xab77('0x7'));var ejs=require(_0xab77('0x8'));var fs=require('fs');var fs_extra=require(_0xab77('0x9'));var _=require(_0xab77('0xa'));var squel=require('squel');var crypto=require(_0xab77('0xb'));var jsforce=require(_0xab77('0xc'));var deskjs=require(_0xab77('0xd'));var toCsv=require(_0xab77('0x7'));var querystring=require('querystring');var Papa=require(_0xab77('0xe'));var Redis=require(_0xab77('0xf'));var authService=require(_0xab77('0x10'));var qs=require(_0xab77('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab77('0x12'));var logger=require(_0xab77('0x13'))(_0xab77('0x14'));var utils=require(_0xab77('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xab77('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fa1a6,_0x20e993){_0x20e993=_0x20e993||0xcc;return function(_0x394330){if(_0x394330){return _0x3fa1a6[_0xab77('0x17')](_0x20e993);}return _0x3fa1a6[_0xab77('0x18')](_0x20e993)[_0xab77('0x19')]();};}function respondWithResult(_0x1350b2,_0xf5f6b1){_0xf5f6b1=_0xf5f6b1||0xc8;return function(_0x3ac04d){if(_0x3ac04d){return _0x1350b2[_0xab77('0x18')](_0xf5f6b1)['json'](_0x3ac04d);}};}function respondWithFilteredResult(_0x1c41e2,_0x29fc40){return function(_0x396784){if(_0x396784){var _0xf10ca8=typeof _0x29fc40[_0xab77('0x1a')]===_0xab77('0x1b')&&typeof _0x29fc40['limit']===_0xab77('0x1b');var _0x190ec6=_0x396784[_0xab77('0x1c')];var _0x55dfe7=_0xf10ca8?0x0:_0x29fc40[_0xab77('0x1a')];var _0x2ba2be=_0xf10ca8?_0x396784[_0xab77('0x1c')]:_0x29fc40[_0xab77('0x1a')]+_0x29fc40[_0xab77('0x1d')];var _0x56e09e;if(_0x2ba2be>=_0x190ec6){_0x2ba2be=_0x190ec6;_0x56e09e=0xc8;}else{_0x56e09e=0xce;}_0x1c41e2[_0xab77('0x18')](_0x56e09e);return _0x1c41e2[_0xab77('0x1e')](_0xab77('0x1f'),_0x55dfe7+'-'+_0x2ba2be+'/'+_0x190ec6)[_0xab77('0x20')](_0x396784);}return null;};}function patchUpdates(_0x3ed9e8){return function(_0x3817da){try{jsonpatch['apply'](_0x3817da,_0x3ed9e8,!![]);}catch(_0xa40620){return BPromise[_0xab77('0x21')](_0xa40620);}return _0x3817da[_0xab77('0x22')]();};}function saveUpdates(_0x403bc1,_0x4b07a6){return function(_0x2c118e){if(_0x2c118e){return _0x2c118e[_0xab77('0x23')](_0x403bc1)[_0xab77('0x24')](function(_0x45757e){return _0x45757e;});}return null;};}function removeEntity(_0xf54c33,_0x565503){return function(_0x4da91c){if(_0x4da91c){return _0x4da91c[_0xab77('0x25')]()[_0xab77('0x24')](function(){_0xf54c33[_0xab77('0x18')](0xcc)[_0xab77('0x19')]();});}};}function handleEntityNotFound(_0x5f4824,_0x54adb7){return function(_0x4bbc7d){if(!_0x4bbc7d){_0x5f4824['sendStatus'](0x194);}return _0x4bbc7d;};}function handleError(_0x497e2f,_0xbc76ba){_0xbc76ba=_0xbc76ba||0x1f4;return function(_0x332735){logger[_0xab77('0x26')](_0x332735[_0xab77('0x27')]);if(_0x332735[_0xab77('0x28')]){delete _0x332735['name'];}_0x497e2f[_0xab77('0x18')](_0xbc76ba)[_0xab77('0x29')](_0x332735);};}exports['index']=function(_0x231c57,_0x178b70){var _0x1971dd={},_0x57e651={},_0xdfc1fb={'count':0x0,'rows':[]};var _0x330135=_['map'](db[_0xab77('0x2a')][_0xab77('0x2b')],function(_0x3b5624){return{'name':_0x3b5624[_0xab77('0x2c')],'type':_0x3b5624['type']['key']};});_0x57e651[_0xab77('0x2d')]=_[_0xab77('0x2e')](_0x330135,_0xab77('0x28'));_0x57e651['query']=_['keys'](_0x231c57['query']);_0x57e651[_0xab77('0x2f')]=_[_0xab77('0x30')](_0x57e651['model'],_0x57e651[_0xab77('0x31')]);_0x1971dd[_0xab77('0x32')]=_['intersection'](_0x57e651[_0xab77('0x2d')],qs['fields'](_0x231c57['query']['fields']));_0x1971dd[_0xab77('0x32')]=_0x1971dd[_0xab77('0x32')]['length']?_0x1971dd[_0xab77('0x32')]:_0x57e651[_0xab77('0x2d')];if(!_0x231c57[_0xab77('0x31')][_0xab77('0x33')]('nolimit')){_0x1971dd[_0xab77('0x1d')]=qs['limit'](_0x231c57['query'][_0xab77('0x1d')]);_0x1971dd['offset']=qs[_0xab77('0x1a')](_0x231c57[_0xab77('0x31')][_0xab77('0x1a')]);}_0x1971dd[_0xab77('0x34')]=qs['sort'](_0x231c57['query'][_0xab77('0x35')]);_0x1971dd[_0xab77('0x36')]=qs[_0xab77('0x2f')](_[_0xab77('0x37')](_0x231c57[_0xab77('0x31')],_0x57e651[_0xab77('0x2f')]),_0x330135);if(_0x231c57[_0xab77('0x31')]['filter']){_0x1971dd[_0xab77('0x36')]=_[_0xab77('0x38')](_0x1971dd['where'],{'$or':_[_0xab77('0x2e')](_0x330135,function(_0x16f097){if(_0x16f097[_0xab77('0x39')]!=='VIRTUAL'){var _0x5036b6={};_0x5036b6[_0x16f097[_0xab77('0x28')]]={'$like':'%'+_0x231c57[_0xab77('0x31')][_0xab77('0x3a')]+'%'};return _0x5036b6;}})});}_0x1971dd=_[_0xab77('0x38')]({},_0x1971dd,_0x231c57['options']);var _0x206b63={'where':_0x1971dd[_0xab77('0x36')]};return db[_0xab77('0x2a')][_0xab77('0x1c')](_0x206b63)[_0xab77('0x24')](function(_0x4a5b44){_0xdfc1fb[_0xab77('0x1c')]=_0x4a5b44;if(_0x231c57[_0xab77('0x31')]['includeAll']){_0x1971dd[_0xab77('0x3b')]=[{'all':!![]}];}return db[_0xab77('0x2a')][_0xab77('0x3c')](_0x1971dd);})[_0xab77('0x24')](function(_0x4151b8){_0xdfc1fb['rows']=_0x4151b8;return _0xdfc1fb;})['then'](respondWithFilteredResult(_0x178b70,_0x1971dd))['catch'](handleError(_0x178b70,null));};exports[_0xab77('0x3d')]=function(_0xa9728,_0x394721){var _0x33f29d={'raw':!![],'where':{'id':_0xa9728[_0xab77('0x3e')]['id']}},_0x39fef9={};_0x39fef9['model']=_[_0xab77('0x3f')](db[_0xab77('0x2a')][_0xab77('0x2b')]);_0x39fef9[_0xab77('0x31')]=_[_0xab77('0x3f')](_0xa9728[_0xab77('0x31')]);_0x39fef9[_0xab77('0x2f')]=_[_0xab77('0x30')](_0x39fef9['model'],_0x39fef9['query']);_0x33f29d[_0xab77('0x32')]=_[_0xab77('0x30')](_0x39fef9[_0xab77('0x2d')],qs[_0xab77('0x40')](_0xa9728['query']['fields']));_0x33f29d[_0xab77('0x32')]=_0x33f29d[_0xab77('0x32')][_0xab77('0x41')]?_0x33f29d['attributes']:_0x39fef9['model'];if(_0xa9728[_0xab77('0x31')][_0xab77('0x42')]){_0x33f29d[_0xab77('0x3b')]=[{'all':!![]}];}_0x33f29d=_[_0xab77('0x38')]({},_0x33f29d,_0xa9728[_0xab77('0x43')]);return db[_0xab77('0x2a')][_0xab77('0x44')](_0x33f29d)['then'](handleEntityNotFound(_0x394721,null))[_0xab77('0x24')](respondWithResult(_0x394721,null))[_0xab77('0x45')](handleError(_0x394721,null));};exports['create']=function(_0xd529f0,_0x5c6a33){return db[_0xab77('0x2a')][_0xab77('0x46')](_0xd529f0['body'],{})[_0xab77('0x24')](respondWithResult(_0x5c6a33,0xc9))[_0xab77('0x45')](handleError(_0x5c6a33,null));};exports[_0xab77('0x23')]=function(_0xf2e5b9,_0x2115ca){if(_0xf2e5b9[_0xab77('0x47')]['id']){delete _0xf2e5b9['body']['id'];}return db[_0xab77('0x2a')][_0xab77('0x44')]({'where':{'id':_0xf2e5b9['params']['id']}})[_0xab77('0x24')](handleEntityNotFound(_0x2115ca,null))[_0xab77('0x24')](saveUpdates(_0xf2e5b9[_0xab77('0x47')],null))[_0xab77('0x24')](respondWithResult(_0x2115ca,null))[_0xab77('0x45')](handleError(_0x2115ca,null));};exports[_0xab77('0x25')]=function(_0x2aac91,_0x272f2d){return db[_0xab77('0x2a')][_0xab77('0x44')]({'where':{'id':_0x2aac91[_0xab77('0x3e')]['id']}})[_0xab77('0x24')](handleEntityNotFound(_0x272f2d,null))['then'](removeEntity(_0x272f2d,null))[_0xab77('0x45')](handleError(_0x272f2d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index cc0e483..aa446c6 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 _0xc8aa=['define','SugarcrmField','int_sugarcrm_fields','FieldId','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x4905a0,_0x22dbe6){var _0x3e6f4d=function(_0x535a9a){while(--_0x535a9a){_0x4905a0['push'](_0x4905a0['shift']());}};_0x3e6f4d(++_0x22dbe6);}(_0xc8aa,0x64));var _0xac8a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc8aa[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xac8a('0x0'))('api');var moment=require(_0xac8a('0x1'));var BPromise=require('bluebird');var rp=require(_0xac8a('0x2'));var fs=require('fs');var path=require(_0xac8a('0x3'));var rimraf=require(_0xac8a('0x4'));var config=require(_0xac8a('0x5'));var attributes=require(_0xac8a('0x6'));module[_0xac8a('0x7')]=function(_0x321d1a,_0x297f5c){return _0x321d1a[_0xac8a('0x8')](_0xac8a('0x9'),attributes,{'tableName':_0xac8a('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xac8a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x494b=['SugarcrmField','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','define'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x494b,0x1a8));var _0xb494=function(_0x4a25e3,_0xffc2aa){_0x4a25e3=_0x4a25e3-0x0;var _0xc2ac02=_0x494b[_0x4a25e3];return _0xc2ac02;};'use strict';var _=require('lodash');var util=require(_0xb494('0x0'));var logger=require(_0xb494('0x1'))(_0xb494('0x2'));var moment=require(_0xb494('0x3'));var BPromise=require(_0xb494('0x4'));var rp=require(_0xb494('0x5'));var fs=require('fs');var path=require(_0xb494('0x6'));var rimraf=require(_0xb494('0x7'));var config=require('../../config/environment');var attributes=require(_0xb494('0x8'));module['exports']=function(_0x2688ac,_0x54d78a){return _0x2688ac[_0xb494('0x9')](_0xb494('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xb494('0xb'),'fields':[_0xb494('0xc'),_0xb494('0xd')],'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 ceaf893..32b5ed6 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 _0xb89f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xb89f,0x1a8));var _0xfb89=function(_0x16964d,_0x2a82a1){_0x16964d=_0x16964d-0x0;var _0x2441fc=_0xb89f[_0x16964d];return _0x2441fc;};'use strict';var _=require(_0xfb89('0x0'));var util=require(_0xfb89('0x1'));var moment=require(_0xfb89('0x2'));var BPromise=require(_0xfb89('0x3'));var rs=require(_0xfb89('0x4'));var fs=require('fs');var Redis=require(_0xfb89('0x5'));var db=require(_0xfb89('0x6'))['db'];var utils=require(_0xfb89('0x7'));var logger=require(_0xfb89('0x8'))(_0xfb89('0x9'));var config=require(_0xfb89('0xa'));var jayson=require(_0xfb89('0xb'));var client=jayson[_0xfb89('0xc')][_0xfb89('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xb07a9a,_0x6cd797,_0x2340bb){return new BPromise(function(_0x2169fc,_0xcd8d2){return client[_0xfb89('0xe')](_0xb07a9a,_0x2340bb)['then'](function(_0x1a6dd5){logger[_0xfb89('0xf')](_0xfb89('0x10'),_0x6cd797,_0xfb89('0x11'));logger['debug'](_0xfb89('0x12'),_0x6cd797,_0xfb89('0x11'),JSON[_0xfb89('0x13')](_0x1a6dd5));if(_0x1a6dd5[_0xfb89('0x14')]){if(_0x1a6dd5['error'][_0xfb89('0x15')]===0x1f4){logger[_0xfb89('0x14')](_0xfb89('0x10'),_0x6cd797,_0x1a6dd5['error']['message']);return _0xcd8d2(_0x1a6dd5[_0xfb89('0x14')]['message']);}logger[_0xfb89('0x14')](_0xfb89('0x10'),_0x6cd797,_0x1a6dd5[_0xfb89('0x14')][_0xfb89('0x16')]);return _0x2169fc(_0x1a6dd5[_0xfb89('0x14')][_0xfb89('0x16')]);}else{logger['info'](_0xfb89('0x10'),_0x6cd797,_0xfb89('0x11'));_0x2169fc(_0x1a6dd5[_0xfb89('0x17')][_0xfb89('0x16')]);}})[_0xfb89('0x18')](function(_0x68ba1f){logger[_0xfb89('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x6cd797,_0x68ba1f);_0xcd8d2(_0x68ba1f);});});} \ No newline at end of file +var _0xec35=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0xec35,0xd6));var _0x5ec3=function(_0x396352,_0x21ff37){_0x396352=_0x396352-0x0;var _0x317d07=_0xec35[_0x396352];return _0x317d07;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5ec3('0x0'));var rs=require(_0x5ec3('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ec3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ec3('0x3'))('rpc');var config=require(_0x5ec3('0x4'));var jayson=require(_0x5ec3('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2376e7,_0x56658e,_0x59fe80){return new BPromise(function(_0x283b97,_0x262a2c){return client['request'](_0x2376e7,_0x59fe80)[_0x5ec3('0x6')](function(_0x2a768f){logger[_0x5ec3('0x7')](_0x5ec3('0x8'),_0x56658e,_0x5ec3('0x9'));logger[_0x5ec3('0xa')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x56658e,'request\x20sent',JSON[_0x5ec3('0xb')](_0x2a768f));if(_0x2a768f[_0x5ec3('0xc')]){if(_0x2a768f['error'][_0x5ec3('0xd')]===0x1f4){logger[_0x5ec3('0xc')](_0x5ec3('0x8'),_0x56658e,_0x2a768f[_0x5ec3('0xc')][_0x5ec3('0xe')]);return _0x262a2c(_0x2a768f[_0x5ec3('0xc')][_0x5ec3('0xe')]);}logger[_0x5ec3('0xc')](_0x5ec3('0x8'),_0x56658e,_0x2a768f[_0x5ec3('0xc')]['message']);return _0x283b97(_0x2a768f[_0x5ec3('0xc')][_0x5ec3('0xe')]);}else{logger[_0x5ec3('0x7')](_0x5ec3('0x8'),_0x56658e,_0x5ec3('0x9'));_0x283b97(_0x2a768f[_0x5ec3('0xf')][_0x5ec3('0xe')]);}})[_0x5ec3('0x10')](function(_0x183abe){logger['error'](_0x5ec3('0x8'),_0x56658e,_0x183abe);_0x262a2c(_0x183abe);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index fdbb77d..6c05fc5 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 _0xc932=['exports','multer','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','update','delete'];(function(_0xa99357,_0x50ffad){var _0x111875=function(_0x4dce0c){while(--_0x4dce0c){_0xa99357['push'](_0xa99357['shift']());}};_0x111875(++_0x50ffad);}(_0xc932,0x18d));var _0x2c93=function(_0x101134,_0x1ed1d3){_0x101134=_0x101134-0x0;var _0xc47acc=_0xc932[_0x101134];return _0xc47acc;};'use strict';var multer=require(_0x2c93('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2c93('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c93('0x2'));var auth=require(_0x2c93('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x2c93('0x4')]('/',auth[_0x2c93('0x5')](),controller[_0x2c93('0x6')]);router['get'](_0x2c93('0x7'),auth[_0x2c93('0x5')](),controller[_0x2c93('0x8')]);router['get'](_0x2c93('0x9'),auth[_0x2c93('0x5')](),controller[_0x2c93('0xa')]);router[_0x2c93('0x4')](_0x2c93('0xb'),auth[_0x2c93('0x5')](),controller[_0x2c93('0xc')]);router['post']('/',auth[_0x2c93('0x5')](),controller['create']);router['post'](_0x2c93('0x9'),auth[_0x2c93('0x5')](),controller[_0x2c93('0xd')]);router[_0x2c93('0xe')](_0x2c93('0x7'),auth['isAuthenticated'](),controller[_0x2c93('0xf')]);router[_0x2c93('0x10')](_0x2c93('0x7'),auth[_0x2c93('0x5')](),controller['destroy']);module[_0x2c93('0x11')]=router; \ No newline at end of file +var _0x2a8d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy'];(function(_0x3f23c0,_0x25c0b6){var _0x35b74d=function(_0x2b13fa){while(--_0x2b13fa){_0x3f23c0['push'](_0x3f23c0['shift']());}};_0x35b74d(++_0x25c0b6);}(_0x2a8d,0x11e));var _0xd2a8=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x2a8d[_0x2a6d45];return _0x295253;};'use strict';var multer=require(_0xd2a8('0x0'));var util=require(_0xd2a8('0x1'));var path=require(_0xd2a8('0x2'));var timeout=require(_0xd2a8('0x3'));var express=require(_0xd2a8('0x4'));var router=express[_0xd2a8('0x5')]();var fs_extra=require(_0xd2a8('0x6'));var auth=require(_0xd2a8('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2a8('0x8'));router[_0xd2a8('0x9')]('/',auth[_0xd2a8('0xa')](),controller[_0xd2a8('0xb')]);router[_0xd2a8('0x9')](_0xd2a8('0xc'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0xd')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd2a8('0x9')](_0xd2a8('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xd2a8('0xf')]('/',auth[_0xd2a8('0xa')](),controller['create']);router[_0xd2a8('0xf')](_0xd2a8('0x10'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x11')]);router[_0xd2a8('0x12')](_0xd2a8('0xc'),auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x13')]);router[_0xd2a8('0x14')]('/:id',auth[_0xd2a8('0xa')](),controller[_0xd2a8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 203d82d..2ad0207 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 _0x8f6e=['STRING','exports'];(function(_0xa9d77a,_0x17674c){var _0x18c44c=function(_0x3ad1e9){while(--_0x3ad1e9){_0xa9d77a['push'](_0xa9d77a['shift']());}};_0x18c44c(++_0x17674c);}(_0x8f6e,0xa9));var _0xe8f6=function(_0x57fa5c,_0x22d1e7){_0x57fa5c=_0x57fa5c-0x0;var _0x270ebe=_0x8f6e[_0x57fa5c];return _0x270ebe;};'use strict';var Sequelize=require('sequelize');module[_0xe8f6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe8f6('0x1')]},'username':{'type':Sequelize[_0xe8f6('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe8f6('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xe8f6('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe8f6('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x13e4=['sequelize','exports','STRING'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x13e4,0xe1));var _0x413e=function(_0x3c328e,_0x133167){_0x3c328e=_0x3c328e-0x0;var _0x46b037=_0x13e4[_0x3c328e];return _0x46b037;};'use strict';var Sequelize=require(_0x413e('0x0'));module[_0x413e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x413e('0x2')]},'username':{'type':Sequelize[_0x413e('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x413e('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x413e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x413e('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x413e('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 e1e408e..4e51e7b 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 _0x9780=['pick','merge','where','VIRTUAL','filter','VtigerAccount','include','findAll','show','params','keys','length','includeAll','options','catch','create','body','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','lastIndexOf','format','GET','getchallenge','success','POST','result','describe','sessionName','reference','remove','includes','false','startsWith','picklistValues','label','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','count','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9780,0x12a));var _0x0978=function(_0x1b58b8,_0x3e1c2a){_0x1b58b8=_0x1b58b8-0x0;var _0x479502=_0x9780[_0x1b58b8];return _0x479502;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0978('0x0'));var zipdir=require(_0x0978('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0978('0x2'));var moment=require(_0x0978('0x3'));var BPromise=require(_0x0978('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0978('0x5'));var sox=require(_0x0978('0x6'));var csv=require('to-csv');var ejs=require(_0x0978('0x7'));var fs=require('fs');var fs_extra=require(_0x0978('0x8'));var _=require(_0x0978('0x9'));var squel=require(_0x0978('0xa'));var crypto=require(_0x0978('0xb'));var jsforce=require(_0x0978('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0978('0xd'));var querystring=require(_0x0978('0xe'));var Papa=require(_0x0978('0xf'));var Redis=require(_0x0978('0x10'));var authService=require(_0x0978('0x11'));var qs=require(_0x0978('0x12'));var as=require(_0x0978('0x13'));var hardwareService=require(_0x0978('0x14'));var logger=require(_0x0978('0x15'))(_0x0978('0x16'));var utils=require(_0x0978('0x17'));var config=require(_0x0978('0x18'));var licenseUtil=require(_0x0978('0x19'));var db=require(_0x0978('0x1a'))['db'];var integrations=require(_0x0978('0x1b'));function respondWithStatusCode(_0x3d9dce,_0x44311c){_0x44311c=_0x44311c||0xcc;return function(_0x5340f2){if(_0x5340f2){return _0x3d9dce['sendStatus'](_0x44311c);}return _0x3d9dce[_0x0978('0x1c')](_0x44311c)[_0x0978('0x1d')]();};}function respondWithResult(_0x3b5ea6,_0xd150a){_0xd150a=_0xd150a||0xc8;return function(_0x50c54f){if(_0x50c54f){return _0x3b5ea6[_0x0978('0x1c')](_0xd150a)[_0x0978('0x1e')](_0x50c54f);}};}function respondWithFilteredResult(_0x4f00d2,_0x16ead3){return function(_0x2f100b){if(_0x2f100b){var _0x5ded55=typeof _0x16ead3[_0x0978('0x1f')]==='undefined'&&typeof _0x16ead3[_0x0978('0x20')]==='undefined';var _0x3e6475=_0x2f100b[_0x0978('0x21')];var _0x12eede=_0x5ded55?0x0:_0x16ead3['offset'];var _0x11ba21=_0x5ded55?_0x2f100b[_0x0978('0x21')]:_0x16ead3[_0x0978('0x1f')]+_0x16ead3[_0x0978('0x20')];var _0x403a51;if(_0x11ba21>=_0x3e6475){_0x11ba21=_0x3e6475;_0x403a51=0xc8;}else{_0x403a51=0xce;}_0x4f00d2[_0x0978('0x1c')](_0x403a51);return _0x4f00d2['set']('Content-Range',_0x12eede+'-'+_0x11ba21+'/'+_0x3e6475)[_0x0978('0x1e')](_0x2f100b);}return null;};}function patchUpdates(_0x27a51d){return function(_0x4ecfa0){try{jsonpatch[_0x0978('0x22')](_0x4ecfa0,_0x27a51d,!![]);}catch(_0x453b84){return BPromise[_0x0978('0x23')](_0x453b84);}return _0x4ecfa0['save']();};}function saveUpdates(_0x413add,_0x17ab34){return function(_0x49452b){if(_0x49452b){return _0x49452b[_0x0978('0x24')](_0x413add)[_0x0978('0x25')](function(_0x56728e){return _0x56728e;});}return null;};}function removeEntity(_0x43afc4,_0x1c0622){return function(_0x14044d){if(_0x14044d){return _0x14044d[_0x0978('0x26')]()[_0x0978('0x25')](function(){_0x43afc4[_0x0978('0x1c')](0xcc)[_0x0978('0x1d')]();});}};}function handleEntityNotFound(_0x2d077f,_0x859ce5){return function(_0x423a71){if(!_0x423a71){_0x2d077f[_0x0978('0x27')](0x194);}return _0x423a71;};}function handleError(_0x724c9e,_0x3e7409){_0x3e7409=_0x3e7409||0x1f4;return function(_0x3cb3d0){logger[_0x0978('0x28')](_0x3cb3d0[_0x0978('0x29')]);if(_0x3cb3d0[_0x0978('0x2a')]){delete _0x3cb3d0[_0x0978('0x2a')];}_0x724c9e['status'](_0x3e7409)[_0x0978('0x2b')](_0x3cb3d0);};}exports[_0x0978('0x2c')]=function(_0x3bbcf1,_0x4344ee){var _0x3a097b={},_0x4cec2a={},_0x3ee350={'count':0x0,'rows':[]};var _0x54b81b=_[_0x0978('0x2d')](db['VtigerAccount'][_0x0978('0x2e')],function(_0x561fc1){return{'name':_0x561fc1['fieldName'],'type':_0x561fc1[_0x0978('0x2f')][_0x0978('0x30')]};});_0x4cec2a[_0x0978('0x31')]=_[_0x0978('0x2d')](_0x54b81b,_0x0978('0x2a'));_0x4cec2a[_0x0978('0x32')]=_['keys'](_0x3bbcf1[_0x0978('0x32')]);_0x4cec2a[_0x0978('0x33')]=_[_0x0978('0x34')](_0x4cec2a[_0x0978('0x31')],_0x4cec2a[_0x0978('0x32')]);_0x3a097b['attributes']=_[_0x0978('0x34')](_0x4cec2a['model'],qs[_0x0978('0x35')](_0x3bbcf1[_0x0978('0x32')][_0x0978('0x35')]));_0x3a097b[_0x0978('0x36')]=_0x3a097b[_0x0978('0x36')]['length']?_0x3a097b[_0x0978('0x36')]:_0x4cec2a[_0x0978('0x31')];if(!_0x3bbcf1[_0x0978('0x32')][_0x0978('0x37')](_0x0978('0x38'))){_0x3a097b['limit']=qs[_0x0978('0x20')](_0x3bbcf1[_0x0978('0x32')]['limit']);_0x3a097b[_0x0978('0x1f')]=qs['offset'](_0x3bbcf1[_0x0978('0x32')][_0x0978('0x1f')]);}_0x3a097b[_0x0978('0x39')]=qs[_0x0978('0x3a')](_0x3bbcf1[_0x0978('0x32')][_0x0978('0x3a')]);_0x3a097b['where']=qs[_0x0978('0x33')](_[_0x0978('0x3b')](_0x3bbcf1[_0x0978('0x32')],_0x4cec2a[_0x0978('0x33')]),_0x54b81b);if(_0x3bbcf1[_0x0978('0x32')]['filter']){_0x3a097b['where']=_[_0x0978('0x3c')](_0x3a097b[_0x0978('0x3d')],{'$or':_['map'](_0x54b81b,function(_0x446abb){if(_0x446abb[_0x0978('0x2f')]!==_0x0978('0x3e')){var _0x2177ff={};_0x2177ff[_0x446abb[_0x0978('0x2a')]]={'$like':'%'+_0x3bbcf1[_0x0978('0x32')][_0x0978('0x3f')]+'%'};return _0x2177ff;}})});}_0x3a097b=_[_0x0978('0x3c')]({},_0x3a097b,_0x3bbcf1['options']);var _0x53fa18={'where':_0x3a097b[_0x0978('0x3d')]};return db[_0x0978('0x40')][_0x0978('0x21')](_0x53fa18)['then'](function(_0x2694c4){_0x3ee350['count']=_0x2694c4;if(_0x3bbcf1['query']['includeAll']){_0x3a097b[_0x0978('0x41')]=[{'all':!![]}];}return db['VtigerAccount'][_0x0978('0x42')](_0x3a097b);})['then'](function(_0x21e59a){_0x3ee350['rows']=_0x21e59a;return _0x3ee350;})[_0x0978('0x25')](respondWithFilteredResult(_0x4344ee,_0x3a097b))['catch'](handleError(_0x4344ee,null));};exports[_0x0978('0x43')]=function(_0xa8c6ce,_0x1bdc82){var _0x1ef17f={'raw':![],'where':{'id':_0xa8c6ce[_0x0978('0x44')]['id']}},_0x8ecd4c={};_0x8ecd4c[_0x0978('0x31')]=_['keys'](db[_0x0978('0x40')][_0x0978('0x2e')]);_0x8ecd4c[_0x0978('0x32')]=_[_0x0978('0x45')](_0xa8c6ce[_0x0978('0x32')]);_0x8ecd4c[_0x0978('0x33')]=_['intersection'](_0x8ecd4c[_0x0978('0x31')],_0x8ecd4c[_0x0978('0x32')]);_0x1ef17f[_0x0978('0x36')]=_[_0x0978('0x34')](_0x8ecd4c[_0x0978('0x31')],qs['fields'](_0xa8c6ce[_0x0978('0x32')][_0x0978('0x35')]));_0x1ef17f[_0x0978('0x36')]=_0x1ef17f[_0x0978('0x36')][_0x0978('0x46')]?_0x1ef17f[_0x0978('0x36')]:_0x8ecd4c['model'];if(_0xa8c6ce['query'][_0x0978('0x47')]){_0x1ef17f[_0x0978('0x41')]=[{'all':!![]}];}_0x1ef17f=_[_0x0978('0x3c')]({},_0x1ef17f,_0xa8c6ce[_0x0978('0x48')]);return db['VtigerAccount']['find'](_0x1ef17f)[_0x0978('0x25')](handleEntityNotFound(_0x1bdc82,null))[_0x0978('0x25')](respondWithResult(_0x1bdc82,null))[_0x0978('0x49')](handleError(_0x1bdc82,null));};exports[_0x0978('0x4a')]=function(_0x56297e,_0x5fc2dd){return db[_0x0978('0x40')][_0x0978('0x4a')](_0x56297e[_0x0978('0x4b')],{})[_0x0978('0x25')](respondWithResult(_0x5fc2dd,0xc9))[_0x0978('0x49')](handleError(_0x5fc2dd,null));};exports[_0x0978('0x24')]=function(_0x40adea,_0x501989){if(_0x40adea[_0x0978('0x4b')]['id']){delete _0x40adea['body']['id'];}return db[_0x0978('0x40')][_0x0978('0x4c')]({'where':{'id':_0x40adea[_0x0978('0x44')]['id']}})[_0x0978('0x25')](handleEntityNotFound(_0x501989,null))[_0x0978('0x25')](saveUpdates(_0x40adea[_0x0978('0x4b')],null))[_0x0978('0x25')](respondWithResult(_0x501989,null))[_0x0978('0x49')](handleError(_0x501989,null));};exports[_0x0978('0x26')]=function(_0x4a0133,_0x5bd580){return db[_0x0978('0x40')][_0x0978('0x4c')]({'where':{'id':_0x4a0133[_0x0978('0x44')]['id']}})[_0x0978('0x25')](handleEntityNotFound(_0x5bd580,null))[_0x0978('0x25')](removeEntity(_0x5bd580,null))['catch'](handleError(_0x5bd580,null));};exports[_0x0978('0x4d')]=function(_0x3d998e,_0x468a01,_0xc78407){var _0x89da3c={};var _0x13f8d1={};var _0x4df48a;var _0x25e7f8;return db[_0x0978('0x40')][_0x0978('0x4e')]({'where':{'id':_0x3d998e[_0x0978('0x44')]['id']}})[_0x0978('0x25')](handleEntityNotFound(_0x468a01,null))[_0x0978('0x25')](function(_0x599bad){if(_0x599bad){_0x4df48a=_0x599bad;_0x13f8d1[_0x0978('0x31')]=_[_0x0978('0x45')](db[_0x0978('0x4f')][_0x0978('0x2e')]);_0x13f8d1[_0x0978('0x32')]=_[_0x0978('0x45')](_0x3d998e['query']);_0x13f8d1[_0x0978('0x33')]=_[_0x0978('0x34')](_0x13f8d1[_0x0978('0x31')],_0x13f8d1[_0x0978('0x32')]);_0x89da3c[_0x0978('0x36')]=_['intersection'](_0x13f8d1['model'],qs[_0x0978('0x35')](_0x3d998e[_0x0978('0x32')][_0x0978('0x35')]));_0x89da3c[_0x0978('0x36')]=_0x89da3c['attributes']['length']?_0x89da3c[_0x0978('0x36')]:_0x13f8d1[_0x0978('0x31')];_0x89da3c[_0x0978('0x39')]=qs[_0x0978('0x3a')](_0x3d998e[_0x0978('0x32')]['sort']);_0x89da3c[_0x0978('0x3d')]=qs[_0x0978('0x33')](_[_0x0978('0x3b')](_0x3d998e[_0x0978('0x32')],_0x13f8d1[_0x0978('0x33')]));if(_0x3d998e[_0x0978('0x32')][_0x0978('0x3f')]){_0x89da3c['where']=_[_0x0978('0x3c')](_0x89da3c[_0x0978('0x3d')],{'$or':_[_0x0978('0x2d')](_0x89da3c[_0x0978('0x36')],function(_0x220c75){var _0x500452={};_0x500452[_0x220c75]={'$like':'%'+_0x3d998e['query'][_0x0978('0x3f')]+'%'};return _0x500452;})});}_0x89da3c=_[_0x0978('0x3c')]({},_0x89da3c,_0x3d998e[_0x0978('0x48')]);return _0x4df48a['getConfigurations'](_0x89da3c);}})['then'](function(_0x53d123){if(_0x53d123){_0x25e7f8=_0x53d123[_0x0978('0x46')];if(!_0x3d998e[_0x0978('0x32')]['hasOwnProperty'](_0x0978('0x38'))){_0x89da3c[_0x0978('0x20')]=qs[_0x0978('0x20')](_0x3d998e['query']['limit']);_0x89da3c[_0x0978('0x1f')]=qs[_0x0978('0x1f')](_0x3d998e[_0x0978('0x32')]['offset']);}return _0x4df48a[_0x0978('0x4d')](_0x89da3c);}})[_0x0978('0x25')](function(_0x3ac97a){if(_0x3ac97a){return _0x3ac97a?{'count':_0x25e7f8,'rows':_0x3ac97a}:null;}})['then'](respondWithResult(_0x468a01,null))['catch'](handleError(_0x468a01,null));};exports[_0x0978('0x50')]=function(_0x32daf8,_0x5e9a76,_0x5a677c){if(_0x32daf8[_0x0978('0x4b')]['id']){delete _0x32daf8[_0x0978('0x4b')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x32daf8[_0x0978('0x44')]['id']}})[_0x0978('0x25')](handleEntityNotFound(_0x5e9a76,null))[_0x0978('0x25')](function(_0x4b8698){if(_0x4b8698){_0x32daf8['body']['AccountId']=_0x4b8698['id'];_0x32daf8[_0x0978('0x4b')][_0x0978('0x51')]=integrations[_0x0978('0x52')](_0x32daf8[_0x0978('0x4b')][_0x0978('0x53')],_0x32daf8['body']['type']);_0x32daf8['body']['Descriptions']=integrations[_0x0978('0x54')](_0x32daf8[_0x0978('0x4b')]['channel'],_0x32daf8[_0x0978('0x4b')][_0x0978('0x2f')]);return db[_0x0978('0x4f')][_0x0978('0x4a')](_0x32daf8[_0x0978('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0x0978('0x51')},{'model':db[_0x0978('0x55')],'as':_0x0978('0x56')}]});}return null;})[_0x0978('0x25')](respondWithResult(_0x5e9a76,null))[_0x0978('0x49')](handleError(_0x5e9a76,null));};var md5=require(_0x0978('0x57'));exports[_0x0978('0x58')]=function(_0xb0ab96,_0x24b094,_0x5ef515){var _0x581ed7=null;var _0x559c03=null;var _0x51d22b=null;var _0x2041f8=null;var _0x112ccc='';return db['VtigerAccount'][_0x0978('0x4e')]({'where':{'id':_0xb0ab96[_0x0978('0x44')]['id']},'attributes':['id',_0x0978('0x2a'),_0x0978('0x59'),_0x0978('0x5a'),'moduleName',_0x0978('0x5b'),_0x0978('0x5c'),_0x0978('0x5d')]})[_0x0978('0x25')](handleEntityNotFound(_0x24b094,null))[_0x0978('0x25')](function(_0xac69fd){if(_0xac69fd){_0x581ed7=_0xac69fd['username'];_0x559c03=_0xac69fd[_0x0978('0x5d')];_0x51d22b=_0xac69fd[_0x0978('0x5e')];_0x112ccc=_0xac69fd[_0x0978('0x5b')];var _0x29412a=_0x112ccc[_0x0978('0x5f')](-0x1);if(_0x29412a==='/'){_0x112ccc=_0x112ccc['substring'](0x0,_0x112ccc[_0x0978('0x60')](_0x29412a));}_0x2041f8=util[_0x0978('0x61')]('%s/webservice.php',_0x112ccc);var _0x2c3ddc={'method':_0x0978('0x62'),'uri':_0x2041f8,'qs':{'operation':_0x0978('0x63'),'username':_0xac69fd[_0x0978('0x59')]},'json':!![]};return rp(_0x2c3ddc);}})[_0x0978('0x25')](function(_0x3aa2b2){if(_0x3aa2b2[_0x0978('0x64')]){var _0x590fc4={'method':_0x0978('0x65'),'uri':_0x2041f8,'form':{'operation':'login','username':_0x581ed7,'accessKey':md5(_0x3aa2b2[_0x0978('0x66')]['token']+_0x559c03)},'json':!![]};return rp(_0x590fc4);}})['then'](function(_0x56436d){if(_0x56436d[_0x0978('0x64')]){var _0x249d9d={'method':_0x0978('0x62'),'uri':_0x2041f8,'qs':{'operation':_0x0978('0x67'),'username':_0x581ed7,'sessionName':_0x56436d['result'][_0x0978('0x68')],'elementType':_0x51d22b},'json':!![]};return rp(_0x249d9d);}})[_0x0978('0x25')](function(_0x2467c6){if(_0x2467c6[_0x0978('0x64')]){var _0x1674ef=['autogenerated',_0x0978('0x69'),'owner'];_[_0x0978('0x6a')](_0x2467c6[_0x0978('0x66')][_0x0978('0x35')],function(_0x108e02){return _0x1674ef[_0x0978('0x6b')](_0x108e02[_0x0978('0x2f')]['name']);});_[_0x0978('0x6a')](_0x2467c6[_0x0978('0x66')][_0x0978('0x35')],function(_0x26ee84){return _0x26ee84['editable']===_0x0978('0x6c');});return{'count':_0x2467c6['result'][_0x0978('0x35')][_0x0978('0x46')],'rows':_['map'](_0x2467c6[_0x0978('0x66')][_0x0978('0x35')],function(_0x55b27f){return{'id':_0x55b27f[_0x0978('0x2a')],'name':_0x55b27f['label'],'custom':_[_0x0978('0x6d')](_0x55b27f[_0x0978('0x2a')],'cf_')?!![]:![],'options':_0x55b27f[_0x0978('0x2f')][_0x0978('0x2a')]==='picklist'&&_0x55b27f[_0x0978('0x2f')]['picklistValues'][_0x0978('0x46')]>0x0?_['map'](_0x55b27f['type'][_0x0978('0x6e')],function(_0x4fa5d3){return{'name':_0x4fa5d3[_0x0978('0x6f')],'value':_0x4fa5d3[_0x0978('0x70')]};}):[]};})};}})[_0x0978('0x25')](respondWithResult(_0x24b094,null))[_0x0978('0x49')](function(_0x377efe){console[_0x0978('0x71')]('vTiger\x20error:\x20'+_0x377efe);var _0x79c2d1=_0xb0ab96[_0x0978('0x32')][_0x0978('0x72')]?0x1f4:_0x377efe[_0x0978('0x73')]||0x1f4;logger[_0x0978('0x28')](_0x0978('0x74'),'getFields',_0x79c2d1,JSON[_0x0978('0x75')](_0x377efe));delete _0x377efe['name'];if(_0x79c2d1===0x191){_0x79c2d1=0x190;}_0x24b094[_0x0978('0x1c')](_0x79c2d1)[_0x0978('0x2b')](_0xb0ab96['query'][_0x0978('0x72')]?{'message':_0x0978('0x76'),'statusCode':_0x377efe[_0x0978('0x73')]}:_0x377efe);});}; \ No newline at end of file +var _0xfb29=['squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VtigerAccount','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','include','findAll','show','params','length','includeAll','options','catch','create','body','update','find','getConfigurations','VtigerConfiguration','rawAttributes','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','%s/webservice.php','GET','success','POST','login','token','describe','result','sessionName','reference','owner','remove','includes','editable','false','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x37ae76,_0x5b10ec){var _0x588821=function(_0x1a6b39){while(--_0x1a6b39){_0x37ae76['push'](_0x37ae76['shift']());}};_0x588821(++_0x5b10ec);}(_0xfb29,0x163));var _0x9fb2=function(_0x310433,_0x5b718f){_0x310433=_0x310433-0x0;var _0xf4d994=_0xfb29[_0x310433];return _0xf4d994;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9fb2('0x0'));var jsonpatch=require(_0x9fb2('0x1'));var rp=require(_0x9fb2('0x2'));var moment=require(_0x9fb2('0x3'));var BPromise=require(_0x9fb2('0x4'));var Mustache=require('mustache');var util=require(_0x9fb2('0x5'));var path=require(_0x9fb2('0x6'));var sox=require(_0x9fb2('0x7'));var csv=require(_0x9fb2('0x8'));var ejs=require(_0x9fb2('0x9'));var fs=require('fs');var fs_extra=require(_0x9fb2('0xa'));var _=require('lodash');var squel=require(_0x9fb2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9fb2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9fb2('0xd'));var Papa=require(_0x9fb2('0xe'));var Redis=require(_0x9fb2('0xf'));var authService=require(_0x9fb2('0x10'));var qs=require(_0x9fb2('0x11'));var as=require(_0x9fb2('0x12'));var hardwareService=require(_0x9fb2('0x13'));var logger=require(_0x9fb2('0x14'))('api');var utils=require(_0x9fb2('0x15'));var config=require(_0x9fb2('0x16'));var licenseUtil=require(_0x9fb2('0x17'));var db=require(_0x9fb2('0x18'))['db'];var integrations=require(_0x9fb2('0x19'));function respondWithStatusCode(_0x3de5b7,_0x2ce62c){_0x2ce62c=_0x2ce62c||0xcc;return function(_0xcdf72b){if(_0xcdf72b){return _0x3de5b7[_0x9fb2('0x1a')](_0x2ce62c);}return _0x3de5b7['status'](_0x2ce62c)['end']();};}function respondWithResult(_0x282b89,_0x534378){_0x534378=_0x534378||0xc8;return function(_0x5a41de){if(_0x5a41de){return _0x282b89['status'](_0x534378)[_0x9fb2('0x1b')](_0x5a41de);}};}function respondWithFilteredResult(_0x1a4bf6,_0x208bab){return function(_0x4ff929){if(_0x4ff929){var _0x2adb91=typeof _0x208bab[_0x9fb2('0x1c')]===_0x9fb2('0x1d')&&typeof _0x208bab[_0x9fb2('0x1e')]==='undefined';var _0x106f61=_0x4ff929[_0x9fb2('0x1f')];var _0x1fca49=_0x2adb91?0x0:_0x208bab[_0x9fb2('0x1c')];var _0x1f38b6=_0x2adb91?_0x4ff929[_0x9fb2('0x1f')]:_0x208bab[_0x9fb2('0x1c')]+_0x208bab[_0x9fb2('0x1e')];var _0x1369ad;if(_0x1f38b6>=_0x106f61){_0x1f38b6=_0x106f61;_0x1369ad=0xc8;}else{_0x1369ad=0xce;}_0x1a4bf6[_0x9fb2('0x20')](_0x1369ad);return _0x1a4bf6[_0x9fb2('0x21')](_0x9fb2('0x22'),_0x1fca49+'-'+_0x1f38b6+'/'+_0x106f61)[_0x9fb2('0x1b')](_0x4ff929);}return null;};}function patchUpdates(_0x40ed31){return function(_0x3dbc4e){try{jsonpatch[_0x9fb2('0x23')](_0x3dbc4e,_0x40ed31,!![]);}catch(_0x248869){return BPromise['reject'](_0x248869);}return _0x3dbc4e[_0x9fb2('0x24')]();};}function saveUpdates(_0x1b11ce,_0x300ef0){return function(_0x45f8b2){if(_0x45f8b2){return _0x45f8b2['update'](_0x1b11ce)[_0x9fb2('0x25')](function(_0x3073ed){return _0x3073ed;});}return null;};}function removeEntity(_0x4520dc,_0x5ac785){return function(_0x395fb0){if(_0x395fb0){return _0x395fb0[_0x9fb2('0x26')]()[_0x9fb2('0x25')](function(){_0x4520dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a72ed,_0x5440aa){return function(_0x4f1f4a){if(!_0x4f1f4a){_0x1a72ed[_0x9fb2('0x1a')](0x194);}return _0x4f1f4a;};}function handleError(_0x4b6dd5,_0x58f883){_0x58f883=_0x58f883||0x1f4;return function(_0xaaabb1){logger[_0x9fb2('0x27')](_0xaaabb1[_0x9fb2('0x28')]);if(_0xaaabb1['name']){delete _0xaaabb1[_0x9fb2('0x29')];}_0x4b6dd5['status'](_0x58f883)[_0x9fb2('0x2a')](_0xaaabb1);};}exports[_0x9fb2('0x2b')]=function(_0x283752,_0x4e4865){var _0x3e2ce0={},_0x5ea0ff={},_0x531570={'count':0x0,'rows':[]};var _0x56f5e4=_[_0x9fb2('0x2c')](db[_0x9fb2('0x2d')]['rawAttributes'],function(_0x11202f){return{'name':_0x11202f['fieldName'],'type':_0x11202f[_0x9fb2('0x2e')][_0x9fb2('0x2f')]};});_0x5ea0ff[_0x9fb2('0x30')]=_[_0x9fb2('0x2c')](_0x56f5e4,'name');_0x5ea0ff[_0x9fb2('0x31')]=_[_0x9fb2('0x32')](_0x283752['query']);_0x5ea0ff['filters']=_[_0x9fb2('0x33')](_0x5ea0ff[_0x9fb2('0x30')],_0x5ea0ff['query']);_0x3e2ce0['attributes']=_[_0x9fb2('0x33')](_0x5ea0ff['model'],qs[_0x9fb2('0x34')](_0x283752[_0x9fb2('0x31')]['fields']));_0x3e2ce0[_0x9fb2('0x35')]=_0x3e2ce0[_0x9fb2('0x35')]['length']?_0x3e2ce0['attributes']:_0x5ea0ff[_0x9fb2('0x30')];if(!_0x283752[_0x9fb2('0x31')][_0x9fb2('0x36')](_0x9fb2('0x37'))){_0x3e2ce0[_0x9fb2('0x1e')]=qs[_0x9fb2('0x1e')](_0x283752[_0x9fb2('0x31')][_0x9fb2('0x1e')]);_0x3e2ce0[_0x9fb2('0x1c')]=qs[_0x9fb2('0x1c')](_0x283752[_0x9fb2('0x31')][_0x9fb2('0x1c')]);}_0x3e2ce0[_0x9fb2('0x38')]=qs[_0x9fb2('0x39')](_0x283752[_0x9fb2('0x31')][_0x9fb2('0x39')]);_0x3e2ce0[_0x9fb2('0x3a')]=qs[_0x9fb2('0x3b')](_['pick'](_0x283752[_0x9fb2('0x31')],_0x5ea0ff['filters']),_0x56f5e4);if(_0x283752['query'][_0x9fb2('0x3c')]){_0x3e2ce0[_0x9fb2('0x3a')]=_[_0x9fb2('0x3d')](_0x3e2ce0['where'],{'$or':_[_0x9fb2('0x2c')](_0x56f5e4,function(_0x5785a9){if(_0x5785a9[_0x9fb2('0x2e')]!=='VIRTUAL'){var _0x9fb710={};_0x9fb710[_0x5785a9['name']]={'$like':'%'+_0x283752['query'][_0x9fb2('0x3c')]+'%'};return _0x9fb710;}})});}_0x3e2ce0=_[_0x9fb2('0x3d')]({},_0x3e2ce0,_0x283752['options']);var _0x2d56ca={'where':_0x3e2ce0[_0x9fb2('0x3a')]};return db[_0x9fb2('0x2d')]['count'](_0x2d56ca)[_0x9fb2('0x25')](function(_0x372c56){_0x531570[_0x9fb2('0x1f')]=_0x372c56;if(_0x283752[_0x9fb2('0x31')]['includeAll']){_0x3e2ce0[_0x9fb2('0x3e')]=[{'all':!![]}];}return db[_0x9fb2('0x2d')][_0x9fb2('0x3f')](_0x3e2ce0);})['then'](function(_0x30d02f){_0x531570['rows']=_0x30d02f;return _0x531570;})[_0x9fb2('0x25')](respondWithFilteredResult(_0x4e4865,_0x3e2ce0))['catch'](handleError(_0x4e4865,null));};exports[_0x9fb2('0x40')]=function(_0x56c146,_0x27d9e6){var _0x41a933={'raw':![],'where':{'id':_0x56c146[_0x9fb2('0x41')]['id']}},_0x28e2d4={};_0x28e2d4[_0x9fb2('0x30')]=_['keys'](db[_0x9fb2('0x2d')]['rawAttributes']);_0x28e2d4[_0x9fb2('0x31')]=_['keys'](_0x56c146['query']);_0x28e2d4[_0x9fb2('0x3b')]=_[_0x9fb2('0x33')](_0x28e2d4[_0x9fb2('0x30')],_0x28e2d4[_0x9fb2('0x31')]);_0x41a933[_0x9fb2('0x35')]=_[_0x9fb2('0x33')](_0x28e2d4[_0x9fb2('0x30')],qs[_0x9fb2('0x34')](_0x56c146[_0x9fb2('0x31')][_0x9fb2('0x34')]));_0x41a933[_0x9fb2('0x35')]=_0x41a933[_0x9fb2('0x35')][_0x9fb2('0x42')]?_0x41a933['attributes']:_0x28e2d4[_0x9fb2('0x30')];if(_0x56c146['query'][_0x9fb2('0x43')]){_0x41a933['include']=[{'all':!![]}];}_0x41a933=_['merge']({},_0x41a933,_0x56c146[_0x9fb2('0x44')]);return db[_0x9fb2('0x2d')]['find'](_0x41a933)['then'](handleEntityNotFound(_0x27d9e6,null))[_0x9fb2('0x25')](respondWithResult(_0x27d9e6,null))[_0x9fb2('0x45')](handleError(_0x27d9e6,null));};exports['create']=function(_0x168001,_0x415d22){return db['VtigerAccount'][_0x9fb2('0x46')](_0x168001[_0x9fb2('0x47')],{})['then'](respondWithResult(_0x415d22,0xc9))['catch'](handleError(_0x415d22,null));};exports[_0x9fb2('0x48')]=function(_0x5f4611,_0x5cd6d3){if(_0x5f4611[_0x9fb2('0x47')]['id']){delete _0x5f4611['body']['id'];}return db[_0x9fb2('0x2d')][_0x9fb2('0x49')]({'where':{'id':_0x5f4611[_0x9fb2('0x41')]['id']}})[_0x9fb2('0x25')](handleEntityNotFound(_0x5cd6d3,null))[_0x9fb2('0x25')](saveUpdates(_0x5f4611[_0x9fb2('0x47')],null))[_0x9fb2('0x25')](respondWithResult(_0x5cd6d3,null))['catch'](handleError(_0x5cd6d3,null));};exports[_0x9fb2('0x26')]=function(_0x1e6cb1,_0x1df449){return db[_0x9fb2('0x2d')][_0x9fb2('0x49')]({'where':{'id':_0x1e6cb1[_0x9fb2('0x41')]['id']}})[_0x9fb2('0x25')](handleEntityNotFound(_0x1df449,null))[_0x9fb2('0x25')](removeEntity(_0x1df449,null))[_0x9fb2('0x45')](handleError(_0x1df449,null));};exports[_0x9fb2('0x4a')]=function(_0x3b0634,_0x1c4d6c,_0x1dbfee){var _0x40ccef={};var _0x2487ef={};var _0x3e0b21;var _0x1a94a4;return db[_0x9fb2('0x2d')]['findOne']({'where':{'id':_0x3b0634[_0x9fb2('0x41')]['id']}})[_0x9fb2('0x25')](handleEntityNotFound(_0x1c4d6c,null))['then'](function(_0x4fd715){if(_0x4fd715){_0x3e0b21=_0x4fd715;_0x2487ef[_0x9fb2('0x30')]=_[_0x9fb2('0x32')](db[_0x9fb2('0x4b')][_0x9fb2('0x4c')]);_0x2487ef[_0x9fb2('0x31')]=_[_0x9fb2('0x32')](_0x3b0634['query']);_0x2487ef[_0x9fb2('0x3b')]=_[_0x9fb2('0x33')](_0x2487ef[_0x9fb2('0x30')],_0x2487ef['query']);_0x40ccef[_0x9fb2('0x35')]=_[_0x9fb2('0x33')](_0x2487ef[_0x9fb2('0x30')],qs[_0x9fb2('0x34')](_0x3b0634[_0x9fb2('0x31')][_0x9fb2('0x34')]));_0x40ccef[_0x9fb2('0x35')]=_0x40ccef[_0x9fb2('0x35')][_0x9fb2('0x42')]?_0x40ccef['attributes']:_0x2487ef['model'];_0x40ccef[_0x9fb2('0x38')]=qs['sort'](_0x3b0634[_0x9fb2('0x31')][_0x9fb2('0x39')]);_0x40ccef['where']=qs[_0x9fb2('0x3b')](_['pick'](_0x3b0634[_0x9fb2('0x31')],_0x2487ef[_0x9fb2('0x3b')]));if(_0x3b0634[_0x9fb2('0x31')][_0x9fb2('0x3c')]){_0x40ccef[_0x9fb2('0x3a')]=_[_0x9fb2('0x3d')](_0x40ccef[_0x9fb2('0x3a')],{'$or':_[_0x9fb2('0x2c')](_0x40ccef[_0x9fb2('0x35')],function(_0x40916e){var _0x137617={};_0x137617[_0x40916e]={'$like':'%'+_0x3b0634[_0x9fb2('0x31')]['filter']+'%'};return _0x137617;})});}_0x40ccef=_[_0x9fb2('0x3d')]({},_0x40ccef,_0x3b0634[_0x9fb2('0x44')]);return _0x3e0b21[_0x9fb2('0x4a')](_0x40ccef);}})['then'](function(_0x9016c9){if(_0x9016c9){_0x1a94a4=_0x9016c9[_0x9fb2('0x42')];if(!_0x3b0634[_0x9fb2('0x31')][_0x9fb2('0x36')](_0x9fb2('0x37'))){_0x40ccef['limit']=qs['limit'](_0x3b0634[_0x9fb2('0x31')][_0x9fb2('0x1e')]);_0x40ccef[_0x9fb2('0x1c')]=qs[_0x9fb2('0x1c')](_0x3b0634[_0x9fb2('0x31')]['offset']);}return _0x3e0b21[_0x9fb2('0x4a')](_0x40ccef);}})[_0x9fb2('0x25')](function(_0x74664a){if(_0x74664a){return _0x74664a?{'count':_0x1a94a4,'rows':_0x74664a}:null;}})[_0x9fb2('0x25')](respondWithResult(_0x1c4d6c,null))[_0x9fb2('0x45')](handleError(_0x1c4d6c,null));};exports[_0x9fb2('0x4d')]=function(_0x23622a,_0x5a47cc,_0x44d084){if(_0x23622a[_0x9fb2('0x47')]['id']){delete _0x23622a[_0x9fb2('0x47')]['id'];}return db[_0x9fb2('0x2d')][_0x9fb2('0x4e')]({'where':{'id':_0x23622a['params']['id']}})[_0x9fb2('0x25')](handleEntityNotFound(_0x5a47cc,null))[_0x9fb2('0x25')](function(_0x5d5fb8){if(_0x5d5fb8){_0x23622a['body'][_0x9fb2('0x4f')]=_0x5d5fb8['id'];_0x23622a[_0x9fb2('0x47')][_0x9fb2('0x50')]=integrations[_0x9fb2('0x51')](_0x23622a[_0x9fb2('0x47')]['channel'],_0x23622a[_0x9fb2('0x47')][_0x9fb2('0x2e')]);_0x23622a[_0x9fb2('0x47')][_0x9fb2('0x52')]=integrations[_0x9fb2('0x53')](_0x23622a[_0x9fb2('0x47')][_0x9fb2('0x54')],_0x23622a[_0x9fb2('0x47')][_0x9fb2('0x2e')]);return db[_0x9fb2('0x4b')][_0x9fb2('0x46')](_0x23622a['body'],{'include':[{'model':db[_0x9fb2('0x55')],'as':_0x9fb2('0x50')},{'model':db['VtigerField'],'as':_0x9fb2('0x52')}]});}return null;})['then'](respondWithResult(_0x5a47cc,null))[_0x9fb2('0x45')](handleError(_0x5a47cc,null));};var md5=require(_0x9fb2('0x56'));exports[_0x9fb2('0x57')]=function(_0x17a2a9,_0x5218e4,_0x46a18c){var _0x45a93b=null;var _0x4c6806=null;var _0x52cad3=null;var _0x1829a2=null;var _0x13fa69='';return db[_0x9fb2('0x2d')][_0x9fb2('0x4e')]({'where':{'id':_0x17a2a9[_0x9fb2('0x41')]['id']},'attributes':['id','name',_0x9fb2('0x58'),_0x9fb2('0x59'),'moduleName',_0x9fb2('0x5a'),_0x9fb2('0x5b'),'accessKey']})[_0x9fb2('0x25')](handleEntityNotFound(_0x5218e4,null))[_0x9fb2('0x25')](function(_0x155fc1){if(_0x155fc1){_0x45a93b=_0x155fc1['username'];_0x4c6806=_0x155fc1[_0x9fb2('0x5c')];_0x52cad3=_0x155fc1[_0x9fb2('0x5d')];_0x13fa69=_0x155fc1['remoteUri'];var _0x36b181=_0x13fa69[_0x9fb2('0x5e')](-0x1);if(_0x36b181==='/'){_0x13fa69=_0x13fa69[_0x9fb2('0x5f')](0x0,_0x13fa69[_0x9fb2('0x60')](_0x36b181));}_0x1829a2=util['format'](_0x9fb2('0x61'),_0x13fa69);var _0x1aced6={'method':_0x9fb2('0x62'),'uri':_0x1829a2,'qs':{'operation':'getchallenge','username':_0x155fc1[_0x9fb2('0x58')]},'json':!![]};return rp(_0x1aced6);}})['then'](function(_0x3e9e83){if(_0x3e9e83[_0x9fb2('0x63')]){var _0x4025b1={'method':_0x9fb2('0x64'),'uri':_0x1829a2,'form':{'operation':_0x9fb2('0x65'),'username':_0x45a93b,'accessKey':md5(_0x3e9e83['result'][_0x9fb2('0x66')]+_0x4c6806)},'json':!![]};return rp(_0x4025b1);}})['then'](function(_0x2fbbd8){if(_0x2fbbd8['success']){var _0x3f9083={'method':'GET','uri':_0x1829a2,'qs':{'operation':_0x9fb2('0x67'),'username':_0x45a93b,'sessionName':_0x2fbbd8[_0x9fb2('0x68')][_0x9fb2('0x69')],'elementType':_0x52cad3},'json':!![]};return rp(_0x3f9083);}})[_0x9fb2('0x25')](function(_0x3769d0){if(_0x3769d0['success']){var _0xd7ec5a=['autogenerated',_0x9fb2('0x6a'),_0x9fb2('0x6b')];_[_0x9fb2('0x6c')](_0x3769d0[_0x9fb2('0x68')][_0x9fb2('0x34')],function(_0x17d639){return _0xd7ec5a[_0x9fb2('0x6d')](_0x17d639[_0x9fb2('0x2e')][_0x9fb2('0x29')]);});_['remove'](_0x3769d0[_0x9fb2('0x68')]['fields'],function(_0x36e5df){return _0x36e5df[_0x9fb2('0x6e')]===_0x9fb2('0x6f');});return{'count':_0x3769d0[_0x9fb2('0x68')][_0x9fb2('0x34')][_0x9fb2('0x42')],'rows':_[_0x9fb2('0x2c')](_0x3769d0['result'][_0x9fb2('0x34')],function(_0x1d7733){return{'id':_0x1d7733[_0x9fb2('0x29')],'name':_0x1d7733[_0x9fb2('0x70')],'custom':_['startsWith'](_0x1d7733['name'],_0x9fb2('0x71'))?!![]:![],'options':_0x1d7733[_0x9fb2('0x2e')][_0x9fb2('0x29')]==='picklist'&&_0x1d7733[_0x9fb2('0x2e')][_0x9fb2('0x72')][_0x9fb2('0x42')]>0x0?_[_0x9fb2('0x2c')](_0x1d7733[_0x9fb2('0x2e')][_0x9fb2('0x72')],function(_0x16c460){return{'name':_0x16c460[_0x9fb2('0x70')],'value':_0x16c460[_0x9fb2('0x73')]};}):[]};})};}})[_0x9fb2('0x25')](respondWithResult(_0x5218e4,null))[_0x9fb2('0x45')](function(_0x5d4f13){console[_0x9fb2('0x74')](_0x9fb2('0x75')+_0x5d4f13);var _0x25e5ec=_0x17a2a9['query'][_0x9fb2('0x76')]?0x1f4:_0x5d4f13[_0x9fb2('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9fb2('0x57'),_0x25e5ec,JSON[_0x9fb2('0x78')](_0x5d4f13));delete _0x5d4f13[_0x9fb2('0x29')];if(_0x25e5ec===0x191){_0x25e5ec=0x190;}_0x5218e4[_0x9fb2('0x20')](_0x25e5ec)['send'](_0x17a2a9['query']['test']?{'message':_0x9fb2('0x79'),'statusCode':_0x5d4f13[_0x9fb2('0x77')]}:_0x5d4f13);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 02e1b06..9e3d653 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 _0x5086=['define','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0x5086,0x10a));var _0x6508=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x5086[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x6508('0x0'));var util=require('util');var logger=require(_0x6508('0x1'))(_0x6508('0x2'));var moment=require(_0x6508('0x3'));var BPromise=require(_0x6508('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6508('0x5'));var rimraf=require(_0x6508('0x6'));var config=require('../../config/environment');var attributes=require(_0x6508('0x7'));var integrations=require(_0x6508('0x8'));module[_0x6508('0x9')]=function(_0x535503,_0x8147a8){return _0x535503[_0x6508('0xa')]('VtigerAccount',attributes,{'tableName':_0x6508('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4796=['../../config/environment','../../components/integrations/configuration','exports','define','lodash','util','moment','request-promise','path'];(function(_0x31bf9f,_0x5393d7){var _0x13867c=function(_0x1f9c4d){while(--_0x1f9c4d){_0x31bf9f['push'](_0x31bf9f['shift']());}};_0x13867c(++_0x5393d7);}(_0x4796,0x70));var _0x6479=function(_0x4f05ee,_0x762ea8){_0x4f05ee=_0x4f05ee-0x0;var _0x33bd77=_0x4796[_0x4f05ee];return _0x33bd77;};'use strict';var _=require(_0x6479('0x0'));var util=require(_0x6479('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6479('0x2'));var BPromise=require('bluebird');var rp=require(_0x6479('0x3'));var fs=require('fs');var path=require(_0x6479('0x4'));var rimraf=require('rimraf');var config=require(_0x6479('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x6479('0x6'));module[_0x6479('0x7')]=function(_0x61e0fc,_0x1b7b93){return _0x61e0fc[_0x6479('0x8')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','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 f72c55b..1b4d005 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 _0x0abf=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowVtigerAccount','then','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x56849f,_0x102427){var _0x27022d=function(_0x52ac53){while(--_0x52ac53){_0x56849f['push'](_0x56849f['shift']());}};_0x27022d(++_0x102427);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')]({'raw':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x19')]===undefined?!![]:![]:!![],'where':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1a')]||null:null,'attributes':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')]['attributes']||null:null,'limit':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1b')]||null:null,'include':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1c')],function(_0x18bb37){return{'model':db[_0x18bb37[_0xf0ab('0x1e')]],'as':_0x18bb37['as'],'attributes':_0x18bb37['attributes'],'include':_0x18bb37['include']?_['map'](_0x18bb37[_0xf0ab('0x1c')],function(_0x4f0caf){return{'model':db[_0x4f0caf[_0xf0ab('0x1e')]],'as':_0x4f0caf['as'],'attributes':_0x4f0caf[_0xf0ab('0x1f')],'include':_0x4f0caf['include']?_[_0xf0ab('0x1d')](_0x4f0caf[_0xf0ab('0x1c')],function(_0x10bf5f){return{'model':db[_0x10bf5f[_0xf0ab('0x1e')]],'as':_0x10bf5f['as'],'attributes':_0x10bf5f[_0xf0ab('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d0da7){logger['info']('GetVtigerAccount',_0x1803f0);logger[_0xf0ab('0x20')](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x2d0da7));_0x776619(_0x2d0da7);})[_0xf0ab('0x14')](function(_0x43476c){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x43476c[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x43476c[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x21')]=function(_0x199753){var _0x58cbe1=this;return new Promise(function(_0x1e1ffb,_0x35973a){return db['VtigerAccount']['find']({'raw':_0x199753[_0xf0ab('0x18')]?_0x199753[_0xf0ab('0x18')][_0xf0ab('0x19')]===undefined?!![]:![]:!![],'where':_0x199753['options']?_0x199753['options'][_0xf0ab('0x1a')]||null:null,'attributes':_0x199753['options']?_0x199753[_0xf0ab('0x18')]['attributes']||null:null,'include':_0x199753[_0xf0ab('0x18')]?_0x199753[_0xf0ab('0x18')]['include']?_['map'](_0x199753[_0xf0ab('0x18')][_0xf0ab('0x1c')],function(_0x2a3fac){return{'model':db[_0x2a3fac[_0xf0ab('0x1e')]],'as':_0x2a3fac['as'],'attributes':_0x2a3fac[_0xf0ab('0x1f')],'include':_0x2a3fac[_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x2a3fac[_0xf0ab('0x1c')],function(_0x2a2f5d){return{'model':db[_0x2a2f5d[_0xf0ab('0x1e')]],'as':_0x2a2f5d['as'],'attributes':_0x2a2f5d[_0xf0ab('0x1f')],'include':_0x2a2f5d[_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x2a2f5d[_0xf0ab('0x1c')],function(_0x5d8443){return{'model':db[_0x5d8443[_0xf0ab('0x1e')]],'as':_0x5d8443['as'],'attributes':_0x5d8443[_0xf0ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf0ab('0x22')](function(_0x5c9192){logger[_0xf0ab('0xb')](_0xf0ab('0x21'),_0x199753);logger[_0xf0ab('0x20')]('ShowVtigerAccount',_0x199753,JSON[_0xf0ab('0xe')](_0x5c9192));_0x1e1ffb(_0x5c9192);})['catch'](function(_0xda3971){logger['error'](_0xf0ab('0x21'),_0xda3971[_0xf0ab('0x11')],_0x199753);_0x35973a(_0x58cbe1[_0xf0ab('0xf')](0x1f4,_0xda3971[_0xf0ab('0x11')]));});});}; \ No newline at end of file +var _0xea28=['code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','ShowVtigerAccount','find','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4a423e,_0x59ba7b){var _0x4ad91f=function(_0x55e261){while(--_0x55e261){_0x4a423e['push'](_0x4a423e['shift']());}};_0x4ad91f(++_0x59ba7b);}(_0xea28,0x13a));var _0x8ea2=function(_0x26fc9e,_0x139a19){_0x26fc9e=_0x26fc9e-0x0;var _0x2b83b9=_0xea28[_0x26fc9e];return _0x2b83b9;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}exports[_0x8ea2('0x17')]=function(_0x1b64cf){var _0x174ef2=this;return new Promise(function(_0x467045,_0x2a0329){return db[_0x8ea2('0x18')][_0x8ea2('0x19')]({'raw':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf[_0x8ea2('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1b64cf['options']?_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1b')]||null:null,'attributes':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf['options'][_0x8ea2('0x1c')]||null:null,'limit':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf['options'][_0x8ea2('0x1d')]||null:null,'include':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1e')]?_[_0x8ea2('0x1f')](_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1e')],function(_0x1e4cc9){return{'model':db[_0x1e4cc9[_0x8ea2('0x20')]],'as':_0x1e4cc9['as'],'attributes':_0x1e4cc9['attributes'],'include':_0x1e4cc9[_0x8ea2('0x1e')]?_['map'](_0x1e4cc9[_0x8ea2('0x1e')],function(_0x42bec8){return{'model':db[_0x42bec8[_0x8ea2('0x20')]],'as':_0x42bec8['as'],'attributes':_0x42bec8['attributes'],'include':_0x42bec8['include']?_[_0x8ea2('0x1f')](_0x42bec8['include'],function(_0x200a49){return{'model':db[_0x200a49['model']],'as':_0x200a49['as'],'attributes':_0x200a49[_0x8ea2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8ea2('0xd')](function(_0x21c526){logger[_0x8ea2('0xe')]('GetVtigerAccount',_0x1b64cf);logger['debug'](_0x8ea2('0x17'),_0x1b64cf,JSON['stringify'](_0x21c526));_0x467045(_0x21c526);})[_0x8ea2('0x16')](function(_0x287078){logger[_0x8ea2('0x12')](_0x8ea2('0x17'),_0x287078[_0x8ea2('0x14')],_0x1b64cf);_0x2a0329(_0x174ef2[_0x8ea2('0x12')](0x1f4,_0x287078[_0x8ea2('0x14')]));});});};exports[_0x8ea2('0x21')]=function(_0x19e868){var _0x9c5fac=this;return new Promise(function(_0x56d914,_0x5b7ff9){return db[_0x8ea2('0x18')][_0x8ea2('0x22')]({'raw':_0x19e868['options']?_0x19e868['options'][_0x8ea2('0x23')]===undefined?!![]:![]:!![],'where':_0x19e868['options']?_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1b')]||null:null,'attributes':_0x19e868['options']?_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1c')]||null:null,'include':_0x19e868[_0x8ea2('0x1a')]?_0x19e868['options']['include']?_['map'](_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1e')],function(_0x3fc785){return{'model':db[_0x3fc785['model']],'as':_0x3fc785['as'],'attributes':_0x3fc785[_0x8ea2('0x1c')],'include':_0x3fc785[_0x8ea2('0x1e')]?_[_0x8ea2('0x1f')](_0x3fc785[_0x8ea2('0x1e')],function(_0x253031){return{'model':db[_0x253031[_0x8ea2('0x20')]],'as':_0x253031['as'],'attributes':_0x253031[_0x8ea2('0x1c')],'include':_0x253031[_0x8ea2('0x1e')]?_['map'](_0x253031[_0x8ea2('0x1e')],function(_0x29e3f5){return{'model':db[_0x29e3f5[_0x8ea2('0x20')]],'as':_0x29e3f5['as'],'attributes':_0x29e3f5[_0x8ea2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a1f14){logger['info'](_0x8ea2('0x21'),_0x19e868);logger[_0x8ea2('0x24')](_0x8ea2('0x21'),_0x19e868,JSON[_0x8ea2('0x11')](_0x2a1f14));_0x56d914(_0x2a1f14);})['catch'](function(_0x2bed24){logger['error']('ShowVtigerAccount',_0x2bed24[_0x8ea2('0x14')],_0x19e868);_0x5b7ff9(_0x9c5fac['error'](0x1f4,_0x2bed24[_0x8ea2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index fa8aa08..f3029a9 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 _0x7ee3=['post','create','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x460bf7,_0x3a1011){var _0x5e14b5=function(_0x323cad){while(--_0x323cad){_0x460bf7['push'](_0x460bf7['shift']());}};_0x5e14b5(++_0x3a1011);}(_0x7ee3,0xe2));var _0x37ee=function(_0x4c6c46,_0x4d5b50){_0x4c6c46=_0x4c6c46-0x0;var _0x4eca5e=_0x7ee3[_0x4c6c46];return _0x4eca5e;};'use strict';var multer=require('multer');var util=require(_0x37ee('0x0'));var path=require(_0x37ee('0x1'));var timeout=require('connect-timeout');var express=require(_0x37ee('0x2'));var router=express[_0x37ee('0x3')]();var fs_extra=require(_0x37ee('0x4'));var auth=require(_0x37ee('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x37ee('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x37ee('0x7')]('/',auth[_0x37ee('0x8')](),controller['index']);router[_0x37ee('0x7')](_0x37ee('0x9'),auth['isAuthenticated'](),controller[_0x37ee('0xa')]);router[_0x37ee('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x37ee('0x7')](_0x37ee('0xb'),auth[_0x37ee('0x8')](),controller['getSubjects']);router[_0x37ee('0x7')](_0x37ee('0xc'),auth[_0x37ee('0x8')](),controller[_0x37ee('0xd')]);router[_0x37ee('0xe')]('/',auth[_0x37ee('0x8')](),controller[_0x37ee('0xf')]);router[_0x37ee('0x10')](_0x37ee('0x9'),auth[_0x37ee('0x8')](),controller[_0x37ee('0x11')]);router[_0x37ee('0x12')]('/:id',auth[_0x37ee('0x8')](),controller['destroy']);module[_0x37ee('0x13')]=router; \ No newline at end of file +var _0x586a=['./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56869a,_0x41030e){var _0x300326=function(_0x19cdad){while(--_0x19cdad){_0x56869a['push'](_0x56869a['shift']());}};_0x300326(++_0x41030e);}(_0x586a,0xe2));var _0xa586=function(_0x138c09,_0xabf92f){_0x138c09=_0x138c09-0x0;var _0x1eba57=_0x586a[_0x138c09];return _0x1eba57;};'use strict';var multer=require(_0xa586('0x0'));var util=require(_0xa586('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa586('0x2'));var router=express[_0xa586('0x3')]();var fs_extra=require(_0xa586('0x4'));var auth=require(_0xa586('0x5'));var interaction=require(_0xa586('0x6'));var config=require(_0xa586('0x7'));var controller=require(_0xa586('0x8'));router[_0xa586('0x9')]('/',auth[_0xa586('0xa')](),controller[_0xa586('0xb')]);router[_0xa586('0x9')](_0xa586('0xc'),auth['isAuthenticated'](),controller[_0xa586('0xd')]);router['get']('/:id/fields',auth[_0xa586('0xa')](),controller[_0xa586('0xe')]);router[_0xa586('0x9')](_0xa586('0xf'),auth[_0xa586('0xa')](),controller[_0xa586('0x10')]);router['get'](_0xa586('0x11'),auth[_0xa586('0xa')](),controller[_0xa586('0x12')]);router[_0xa586('0x13')]('/',auth[_0xa586('0xa')](),controller[_0xa586('0x14')]);router[_0xa586('0x15')](_0xa586('0xc'),auth[_0xa586('0xa')](),controller[_0xa586('0x16')]);router[_0xa586('0x17')]('/:id',auth[_0xa586('0xa')](),controller[_0xa586('0x18')]);module[_0xa586('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8bc3f2c..7e7c406 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 _0x043e=['exports','STRING'];(function(_0x458656,_0x4292d8){var _0x24e475=function(_0x15f497){while(--_0x15f497){_0x458656['push'](_0x458656['shift']());}};_0x24e475(++_0x4292d8);}(_0x043e,0xf0));var _0xe043=function(_0x51780c,_0x42ec4d){_0x51780c=_0x51780c-0x0;var _0x3443d3=_0x043e[_0x51780c];return _0x3443d3;};'use strict';var Sequelize=require('sequelize');module[_0xe043('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe043('0x1')]}}; \ No newline at end of file +var _0x1c41=['STRING','exports'];(function(_0x4ba057,_0xb4157){var _0x56ade0=function(_0xf2cad1){while(--_0xf2cad1){_0x4ba057['push'](_0x4ba057['shift']());}};_0x56ade0(++_0xb4157);}(_0x1c41,0xa5));var _0x11c4=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x1c41[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require('sequelize');module[_0x11c4('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x11c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 7fb3c69..587b04f 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 _0x62ed=['offset','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','rows','catch','params','options','find','create','body','getFields','findOne','order','hasOwnProperty','getSubjects','VtigerField','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','limit','count','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x62ed,0x18e));var _0xd62e=function(_0x33ca3a,_0x577770){_0x33ca3a=_0x33ca3a-0x0;var _0x5263a9=_0x62ed[_0x33ca3a];return _0x5263a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd62e('0x0'));var zipdir=require(_0xd62e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd62e('0x2'));var moment=require(_0xd62e('0x3'));var BPromise=require(_0xd62e('0x4'));var Mustache=require(_0xd62e('0x5'));var util=require(_0xd62e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd62e('0x7'));var ejs=require(_0xd62e('0x8'));var fs=require('fs');var fs_extra=require(_0xd62e('0x9'));var _=require(_0xd62e('0xa'));var squel=require(_0xd62e('0xb'));var crypto=require(_0xd62e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd62e('0xd'));var toCsv=require(_0xd62e('0x7'));var querystring=require(_0xd62e('0xe'));var Papa=require('papaparse');var Redis=require(_0xd62e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd62e('0x10'));var as=require(_0xd62e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd62e('0x12'))(_0xd62e('0x13'));var utils=require('../../config/utils');var config=require(_0xd62e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd62e('0x15'))['db'];function respondWithStatusCode(_0x369fd4,_0x4c4b0d){_0x4c4b0d=_0x4c4b0d||0xcc;return function(_0x6a6125){if(_0x6a6125){return _0x369fd4['sendStatus'](_0x4c4b0d);}return _0x369fd4[_0xd62e('0x16')](_0x4c4b0d)[_0xd62e('0x17')]();};}function respondWithResult(_0x5bf8fd,_0x4b3d23){_0x4b3d23=_0x4b3d23||0xc8;return function(_0x185b89){if(_0x185b89){return _0x5bf8fd['status'](_0x4b3d23)['json'](_0x185b89);}};}function respondWithFilteredResult(_0x435067,_0xc3f675){return function(_0x26ba16){if(_0x26ba16){var _0x4c7eb9=typeof _0xc3f675['offset']==='undefined'&&typeof _0xc3f675[_0xd62e('0x18')]==='undefined';var _0x182321=_0x26ba16[_0xd62e('0x19')];var _0x237915=_0x4c7eb9?0x0:_0xc3f675['offset'];var _0x4bdb58=_0x4c7eb9?_0x26ba16[_0xd62e('0x19')]:_0xc3f675['offset']+_0xc3f675[_0xd62e('0x18')];var _0x288f16;if(_0x4bdb58>=_0x182321){_0x4bdb58=_0x182321;_0x288f16=0xc8;}else{_0x288f16=0xce;}_0x435067[_0xd62e('0x16')](_0x288f16);return _0x435067['set'](_0xd62e('0x1a'),_0x237915+'-'+_0x4bdb58+'/'+_0x182321)[_0xd62e('0x1b')](_0x26ba16);}return null;};}function patchUpdates(_0x98fdf6){return function(_0x3de276){try{jsonpatch[_0xd62e('0x1c')](_0x3de276,_0x98fdf6,!![]);}catch(_0x3332c8){return BPromise[_0xd62e('0x1d')](_0x3332c8);}return _0x3de276['save']();};}function saveUpdates(_0x4e836b,_0x165c98){return function(_0x346654){if(_0x346654){return _0x346654['update'](_0x4e836b)[_0xd62e('0x1e')](function(_0x1a80f7){return _0x1a80f7;});}return null;};}function removeEntity(_0x3f7952,_0x11385d){return function(_0x9a4f9e){if(_0x9a4f9e){return _0x9a4f9e[_0xd62e('0x1f')]()[_0xd62e('0x1e')](function(){_0x3f7952['status'](0xcc)[_0xd62e('0x17')]();});}};}function handleEntityNotFound(_0x271a73,_0x29cb1e){return function(_0xe41e15){if(!_0xe41e15){_0x271a73[_0xd62e('0x20')](0x194);}return _0xe41e15;};}function handleError(_0x6e6f33,_0x6e6d48){_0x6e6d48=_0x6e6d48||0x1f4;return function(_0x381a51){logger[_0xd62e('0x21')](_0x381a51[_0xd62e('0x22')]);if(_0x381a51[_0xd62e('0x23')]){delete _0x381a51['name'];}_0x6e6f33[_0xd62e('0x16')](_0x6e6d48)[_0xd62e('0x24')](_0x381a51);};}exports[_0xd62e('0x25')]=function(_0x564bc1,_0x2ffb0c){var _0x5886b1={},_0x5c52d6={},_0x54a5d7={'count':0x0,'rows':[]};var _0x2eb6a4=_[_0xd62e('0x26')](db[_0xd62e('0x27')][_0xd62e('0x28')],function(_0xb20e42){return{'name':_0xb20e42[_0xd62e('0x29')],'type':_0xb20e42[_0xd62e('0x2a')][_0xd62e('0x2b')]};});_0x5c52d6['model']=_[_0xd62e('0x26')](_0x2eb6a4,_0xd62e('0x23'));_0x5c52d6[_0xd62e('0x2c')]=_[_0xd62e('0x2d')](_0x564bc1[_0xd62e('0x2c')]);_0x5c52d6['filters']=_[_0xd62e('0x2e')](_0x5c52d6['model'],_0x5c52d6[_0xd62e('0x2c')]);_0x5886b1['attributes']=_[_0xd62e('0x2e')](_0x5c52d6[_0xd62e('0x2f')],qs[_0xd62e('0x30')](_0x564bc1['query']['fields']));_0x5886b1[_0xd62e('0x31')]=_0x5886b1[_0xd62e('0x31')][_0xd62e('0x32')]?_0x5886b1[_0xd62e('0x31')]:_0x5c52d6['model'];if(!_0x564bc1[_0xd62e('0x2c')]['hasOwnProperty'](_0xd62e('0x33'))){_0x5886b1[_0xd62e('0x18')]=qs[_0xd62e('0x18')](_0x564bc1[_0xd62e('0x2c')]['limit']);_0x5886b1[_0xd62e('0x34')]=qs[_0xd62e('0x34')](_0x564bc1[_0xd62e('0x2c')]['offset']);}_0x5886b1['order']=qs[_0xd62e('0x35')](_0x564bc1[_0xd62e('0x2c')][_0xd62e('0x35')]);_0x5886b1[_0xd62e('0x36')]=qs['filters'](_[_0xd62e('0x37')](_0x564bc1[_0xd62e('0x2c')],_0x5c52d6[_0xd62e('0x38')]),_0x2eb6a4);if(_0x564bc1['query'][_0xd62e('0x39')]){_0x5886b1[_0xd62e('0x36')]=_[_0xd62e('0x3a')](_0x5886b1['where'],{'$or':_['map'](_0x2eb6a4,function(_0x1053cf){if(_0x1053cf[_0xd62e('0x2a')]!==_0xd62e('0x3b')){var _0x224a02={};_0x224a02[_0x1053cf[_0xd62e('0x23')]]={'$like':'%'+_0x564bc1['query'][_0xd62e('0x39')]+'%'};return _0x224a02;}})});}_0x5886b1=_['merge']({},_0x5886b1,_0x564bc1['options']);var _0x1138db={'where':_0x5886b1[_0xd62e('0x36')]};return db[_0xd62e('0x27')]['count'](_0x1138db)[_0xd62e('0x1e')](function(_0x6e719c){_0x54a5d7[_0xd62e('0x19')]=_0x6e719c;if(_0x564bc1['query'][_0xd62e('0x3c')]){_0x5886b1['include']=[{'all':!![]}];}return db[_0xd62e('0x27')]['findAll'](_0x5886b1);})[_0xd62e('0x1e')](function(_0x32d1c1){_0x54a5d7[_0xd62e('0x3d')]=_0x32d1c1;return _0x54a5d7;})['then'](respondWithFilteredResult(_0x2ffb0c,_0x5886b1))[_0xd62e('0x3e')](handleError(_0x2ffb0c,null));};exports['show']=function(_0x51aefb,_0x29dd4a){var _0x4ce8b6={'raw':![],'where':{'id':_0x51aefb[_0xd62e('0x3f')]['id']}},_0xb9c502={};_0xb9c502[_0xd62e('0x2f')]=_[_0xd62e('0x2d')](db[_0xd62e('0x27')][_0xd62e('0x28')]);_0xb9c502[_0xd62e('0x2c')]=_[_0xd62e('0x2d')](_0x51aefb[_0xd62e('0x2c')]);_0xb9c502[_0xd62e('0x38')]=_[_0xd62e('0x2e')](_0xb9c502[_0xd62e('0x2f')],_0xb9c502['query']);_0x4ce8b6[_0xd62e('0x31')]=_[_0xd62e('0x2e')](_0xb9c502[_0xd62e('0x2f')],qs['fields'](_0x51aefb['query']['fields']));_0x4ce8b6['attributes']=_0x4ce8b6[_0xd62e('0x31')][_0xd62e('0x32')]?_0x4ce8b6[_0xd62e('0x31')]:_0xb9c502[_0xd62e('0x2f')];if(_0x51aefb[_0xd62e('0x2c')][_0xd62e('0x3c')]){_0x4ce8b6['include']=[{'all':!![]}];}_0x4ce8b6=_['merge']({},_0x4ce8b6,_0x51aefb[_0xd62e('0x40')]);return db[_0xd62e('0x27')][_0xd62e('0x41')](_0x4ce8b6)[_0xd62e('0x1e')](handleEntityNotFound(_0x29dd4a,null))[_0xd62e('0x1e')](respondWithResult(_0x29dd4a,null))[_0xd62e('0x3e')](handleError(_0x29dd4a,null));};exports[_0xd62e('0x42')]=function(_0x5e57bc,_0x59bee3){return db[_0xd62e('0x27')][_0xd62e('0x42')](_0x5e57bc[_0xd62e('0x43')],{})[_0xd62e('0x1e')](respondWithResult(_0x59bee3,0xc9))['catch'](handleError(_0x59bee3,null));};exports['update']=function(_0x10919d,_0x2bfe30){if(_0x10919d['body']['id']){delete _0x10919d[_0xd62e('0x43')]['id'];}return db['VtigerConfiguration'][_0xd62e('0x41')]({'where':{'id':_0x10919d[_0xd62e('0x3f')]['id']}})[_0xd62e('0x1e')](handleEntityNotFound(_0x2bfe30,null))[_0xd62e('0x1e')](saveUpdates(_0x10919d[_0xd62e('0x43')],null))[_0xd62e('0x1e')](respondWithResult(_0x2bfe30,null))[_0xd62e('0x3e')](handleError(_0x2bfe30,null));};exports[_0xd62e('0x1f')]=function(_0x341757,_0x8cc6e1){return db['VtigerConfiguration'][_0xd62e('0x41')]({'where':{'id':_0x341757[_0xd62e('0x3f')]['id']}})[_0xd62e('0x1e')](handleEntityNotFound(_0x8cc6e1,null))['then'](removeEntity(_0x8cc6e1,null))[_0xd62e('0x3e')](handleError(_0x8cc6e1,null));};exports[_0xd62e('0x44')]=function(_0x1ea856,_0x31933e,_0x4c8288){var _0x4b0ee9={};var _0x5ab1cc={};var _0x2cf74c;var _0x188368;return db[_0xd62e('0x27')][_0xd62e('0x45')]({'where':{'id':_0x1ea856['params']['id']}})[_0xd62e('0x1e')](handleEntityNotFound(_0x31933e,null))[_0xd62e('0x1e')](function(_0x4e61ba){if(_0x4e61ba){_0x2cf74c=_0x4e61ba;_0x5ab1cc[_0xd62e('0x2f')]=_[_0xd62e('0x2d')](db['VtigerField'][_0xd62e('0x28')]);_0x5ab1cc['query']=_[_0xd62e('0x2d')](_0x1ea856[_0xd62e('0x2c')]);_0x5ab1cc[_0xd62e('0x38')]=_[_0xd62e('0x2e')](_0x5ab1cc[_0xd62e('0x2f')],_0x5ab1cc[_0xd62e('0x2c')]);_0x4b0ee9[_0xd62e('0x31')]=_['intersection'](_0x5ab1cc[_0xd62e('0x2f')],qs['fields'](_0x1ea856['query'][_0xd62e('0x30')]));_0x4b0ee9[_0xd62e('0x31')]=_0x4b0ee9[_0xd62e('0x31')][_0xd62e('0x32')]?_0x4b0ee9['attributes']:_0x5ab1cc[_0xd62e('0x2f')];_0x4b0ee9[_0xd62e('0x46')]=qs[_0xd62e('0x35')](_0x1ea856[_0xd62e('0x2c')][_0xd62e('0x35')]);_0x4b0ee9[_0xd62e('0x36')]=qs[_0xd62e('0x38')](_[_0xd62e('0x37')](_0x1ea856['query'],_0x5ab1cc['filters']));if(_0x1ea856[_0xd62e('0x2c')][_0xd62e('0x39')]){_0x4b0ee9[_0xd62e('0x36')]=_[_0xd62e('0x3a')](_0x4b0ee9['where'],{'$or':_[_0xd62e('0x26')](_0x4b0ee9[_0xd62e('0x31')],function(_0xf92505){var _0x428e59={};_0x428e59[_0xf92505]={'$like':'%'+_0x1ea856[_0xd62e('0x2c')][_0xd62e('0x39')]+'%'};return _0x428e59;})});}_0x4b0ee9=_[_0xd62e('0x3a')]({},_0x4b0ee9,_0x1ea856[_0xd62e('0x40')]);return _0x2cf74c[_0xd62e('0x44')](_0x4b0ee9);}})[_0xd62e('0x1e')](function(_0x4d5da7){if(_0x4d5da7){_0x188368=_0x4d5da7[_0xd62e('0x32')];if(!_0x1ea856[_0xd62e('0x2c')][_0xd62e('0x47')](_0xd62e('0x33'))){_0x4b0ee9['limit']=qs[_0xd62e('0x18')](_0x1ea856['query'][_0xd62e('0x18')]);_0x4b0ee9[_0xd62e('0x34')]=qs['offset'](_0x1ea856[_0xd62e('0x2c')]['offset']);}return _0x2cf74c['getFields'](_0x4b0ee9);}})['then'](function(_0x1c5ba8){if(_0x1c5ba8){return _0x1c5ba8?{'count':_0x188368,'rows':_0x1c5ba8}:null;}})[_0xd62e('0x1e')](respondWithResult(_0x31933e,null))[_0xd62e('0x3e')](handleError(_0x31933e,null));};exports[_0xd62e('0x48')]=function(_0x1bd192,_0x5aef21,_0x20f9f8){var _0x43bc31={};var _0x16407d={};var _0x586873;var _0x129779;return db[_0xd62e('0x27')][_0xd62e('0x45')]({'where':{'id':_0x1bd192[_0xd62e('0x3f')]['id']}})[_0xd62e('0x1e')](handleEntityNotFound(_0x5aef21,null))[_0xd62e('0x1e')](function(_0x234be8){if(_0x234be8){_0x586873=_0x234be8;_0x16407d[_0xd62e('0x2f')]=_[_0xd62e('0x2d')](db[_0xd62e('0x49')][_0xd62e('0x28')]);_0x16407d[_0xd62e('0x2c')]=_[_0xd62e('0x2d')](_0x1bd192[_0xd62e('0x2c')]);_0x16407d[_0xd62e('0x38')]=_[_0xd62e('0x2e')](_0x16407d[_0xd62e('0x2f')],_0x16407d['query']);_0x43bc31[_0xd62e('0x31')]=_['intersection'](_0x16407d[_0xd62e('0x2f')],qs[_0xd62e('0x30')](_0x1bd192[_0xd62e('0x2c')][_0xd62e('0x30')]));_0x43bc31[_0xd62e('0x31')]=_0x43bc31['attributes'][_0xd62e('0x32')]?_0x43bc31['attributes']:_0x16407d[_0xd62e('0x2f')];_0x43bc31[_0xd62e('0x46')]=qs[_0xd62e('0x35')](_0x1bd192['query']['sort']);_0x43bc31[_0xd62e('0x36')]=qs[_0xd62e('0x38')](_[_0xd62e('0x37')](_0x1bd192['query'],_0x16407d[_0xd62e('0x38')]));if(_0x1bd192[_0xd62e('0x2c')]['filter']){_0x43bc31[_0xd62e('0x36')]=_[_0xd62e('0x3a')](_0x43bc31[_0xd62e('0x36')],{'$or':_[_0xd62e('0x26')](_0x43bc31['attributes'],function(_0x1e0182){var _0x21a185={};_0x21a185[_0x1e0182]={'$like':'%'+_0x1bd192[_0xd62e('0x2c')]['filter']+'%'};return _0x21a185;})});}_0x43bc31=_[_0xd62e('0x3a')]({},_0x43bc31,_0x1bd192[_0xd62e('0x40')]);return _0x586873[_0xd62e('0x48')](_0x43bc31);}})[_0xd62e('0x1e')](function(_0x2b40af){if(_0x2b40af){_0x129779=_0x2b40af[_0xd62e('0x32')];if(!_0x1bd192[_0xd62e('0x2c')][_0xd62e('0x47')](_0xd62e('0x33'))){_0x43bc31['limit']=qs['limit'](_0x1bd192[_0xd62e('0x2c')][_0xd62e('0x18')]);_0x43bc31[_0xd62e('0x34')]=qs['offset'](_0x1bd192[_0xd62e('0x2c')][_0xd62e('0x34')]);}return _0x586873[_0xd62e('0x48')](_0x43bc31);}})['then'](function(_0x7f566e){if(_0x7f566e){return _0x7f566e?{'count':_0x129779,'rows':_0x7f566e}:null;}})['then'](respondWithResult(_0x5aef21,null))[_0xd62e('0x3e')](handleError(_0x5aef21,null));};exports['getDescriptions']=function(_0x26c735,_0x28089c,_0x32cf62){var _0x5c64d4={};var _0x14de07={};var _0x43f58a;var _0x49738a;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x26c735[_0xd62e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x28089c,null))[_0xd62e('0x1e')](function(_0x10fe42){if(_0x10fe42){_0x43f58a=_0x10fe42;_0x14de07[_0xd62e('0x2f')]=_[_0xd62e('0x2d')](db[_0xd62e('0x49')][_0xd62e('0x28')]);_0x14de07['query']=_[_0xd62e('0x2d')](_0x26c735[_0xd62e('0x2c')]);_0x14de07[_0xd62e('0x38')]=_[_0xd62e('0x2e')](_0x14de07[_0xd62e('0x2f')],_0x14de07[_0xd62e('0x2c')]);_0x5c64d4[_0xd62e('0x31')]=_[_0xd62e('0x2e')](_0x14de07[_0xd62e('0x2f')],qs[_0xd62e('0x30')](_0x26c735['query'][_0xd62e('0x30')]));_0x5c64d4['attributes']=_0x5c64d4[_0xd62e('0x31')]['length']?_0x5c64d4[_0xd62e('0x31')]:_0x14de07['model'];_0x5c64d4[_0xd62e('0x46')]=qs[_0xd62e('0x35')](_0x26c735[_0xd62e('0x2c')][_0xd62e('0x35')]);_0x5c64d4[_0xd62e('0x36')]=qs[_0xd62e('0x38')](_['pick'](_0x26c735[_0xd62e('0x2c')],_0x14de07[_0xd62e('0x38')]));if(_0x26c735[_0xd62e('0x2c')][_0xd62e('0x39')]){_0x5c64d4[_0xd62e('0x36')]=_['merge'](_0x5c64d4[_0xd62e('0x36')],{'$or':_[_0xd62e('0x26')](_0x5c64d4[_0xd62e('0x31')],function(_0x350f70){var _0x13c6f2={};_0x13c6f2[_0x350f70]={'$like':'%'+_0x26c735[_0xd62e('0x2c')][_0xd62e('0x39')]+'%'};return _0x13c6f2;})});}_0x5c64d4=_['merge']({},_0x5c64d4,_0x26c735[_0xd62e('0x40')]);return _0x43f58a[_0xd62e('0x4a')](_0x5c64d4);}})[_0xd62e('0x1e')](function(_0x2712d7){if(_0x2712d7){_0x49738a=_0x2712d7[_0xd62e('0x32')];if(!_0x26c735[_0xd62e('0x2c')][_0xd62e('0x47')](_0xd62e('0x33'))){_0x5c64d4[_0xd62e('0x18')]=qs['limit'](_0x26c735[_0xd62e('0x2c')][_0xd62e('0x18')]);_0x5c64d4[_0xd62e('0x34')]=qs[_0xd62e('0x34')](_0x26c735[_0xd62e('0x2c')]['offset']);}return _0x43f58a['getDescriptions'](_0x5c64d4);}})['then'](function(_0x4dd823){if(_0x4dd823){return _0x4dd823?{'count':_0x49738a,'rows':_0x4dd823}:null;}})[_0xd62e('0x1e')](respondWithResult(_0x28089c,null))[_0xd62e('0x3e')](handleError(_0x28089c,null));}; \ No newline at end of file +var _0xe3e5=['name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','length','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','intersection','fields','options','find','create','body','destroy','getFields','findOne','order','hasOwnProperty','nolimit','getSubjects','VtigerField','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','end','stack'];(function(_0x3ff271,_0x33d4f7){var _0x2a3a7e=function(_0xf986eb){while(--_0xf986eb){_0x3ff271['push'](_0x3ff271['shift']());}};_0x2a3a7e(++_0x33d4f7);}(_0xe3e5,0x77));var _0x5e3e=function(_0x410dc5,_0x537871){_0x410dc5=_0x410dc5-0x0;var _0x659202=_0xe3e5[_0x410dc5];return _0x659202;};'use strict';var emlformat=require(_0x5e3e('0x0'));var rimraf=require(_0x5e3e('0x1'));var zipdir=require(_0x5e3e('0x2'));var jsonpatch=require(_0x5e3e('0x3'));var rp=require(_0x5e3e('0x4'));var moment=require(_0x5e3e('0x5'));var BPromise=require(_0x5e3e('0x6'));var Mustache=require(_0x5e3e('0x7'));var util=require(_0x5e3e('0x8'));var path=require(_0x5e3e('0x9'));var sox=require(_0x5e3e('0xa'));var csv=require(_0x5e3e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e3e('0xc'));var jsforce=require(_0x5e3e('0xd'));var deskjs=require(_0x5e3e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e3e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5e3e('0x10'));var hardwareService=require(_0x5e3e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5e3e('0x12'));var config=require(_0x5e3e('0x13'));var licenseUtil=require(_0x5e3e('0x14'));var db=require(_0x5e3e('0x15'))['db'];function respondWithStatusCode(_0x47cde6,_0x5b3a99){_0x5b3a99=_0x5b3a99||0xcc;return function(_0x5cbe49){if(_0x5cbe49){return _0x47cde6[_0x5e3e('0x16')](_0x5b3a99);}return _0x47cde6[_0x5e3e('0x17')](_0x5b3a99)['end']();};}function respondWithResult(_0x2b7f5,_0x59a931){_0x59a931=_0x59a931||0xc8;return function(_0x360954){if(_0x360954){return _0x2b7f5['status'](_0x59a931)[_0x5e3e('0x18')](_0x360954);}};}function respondWithFilteredResult(_0x1cdaff,_0x2f04f3){return function(_0x5d44a8){if(_0x5d44a8){var _0x306641=typeof _0x2f04f3[_0x5e3e('0x19')]===_0x5e3e('0x1a')&&typeof _0x2f04f3['limit']===_0x5e3e('0x1a');var _0x378f9c=_0x5d44a8[_0x5e3e('0x1b')];var _0x14ac67=_0x306641?0x0:_0x2f04f3[_0x5e3e('0x19')];var _0x12cf69=_0x306641?_0x5d44a8[_0x5e3e('0x1b')]:_0x2f04f3['offset']+_0x2f04f3[_0x5e3e('0x1c')];var _0x285857;if(_0x12cf69>=_0x378f9c){_0x12cf69=_0x378f9c;_0x285857=0xc8;}else{_0x285857=0xce;}_0x1cdaff[_0x5e3e('0x17')](_0x285857);return _0x1cdaff[_0x5e3e('0x1d')]('Content-Range',_0x14ac67+'-'+_0x12cf69+'/'+_0x378f9c)['json'](_0x5d44a8);}return null;};}function patchUpdates(_0x171251){return function(_0x2e7d50){try{jsonpatch[_0x5e3e('0x1e')](_0x2e7d50,_0x171251,!![]);}catch(_0x28690a){return BPromise[_0x5e3e('0x1f')](_0x28690a);}return _0x2e7d50[_0x5e3e('0x20')]();};}function saveUpdates(_0x347106,_0x2e88e6){return function(_0x4327e4){if(_0x4327e4){return _0x4327e4[_0x5e3e('0x21')](_0x347106)[_0x5e3e('0x22')](function(_0x5ec43f){return _0x5ec43f;});}return null;};}function removeEntity(_0x4433a4,_0x1ecde4){return function(_0x1256f7){if(_0x1256f7){return _0x1256f7['destroy']()[_0x5e3e('0x22')](function(){_0x4433a4['status'](0xcc)[_0x5e3e('0x23')]();});}};}function handleEntityNotFound(_0x250930,_0x3f4f0c){return function(_0x3633a8){if(!_0x3633a8){_0x250930[_0x5e3e('0x16')](0x194);}return _0x3633a8;};}function handleError(_0x48633c,_0x39c0d7){_0x39c0d7=_0x39c0d7||0x1f4;return function(_0x3d9b64){logger['error'](_0x3d9b64[_0x5e3e('0x24')]);if(_0x3d9b64[_0x5e3e('0x25')]){delete _0x3d9b64[_0x5e3e('0x25')];}_0x48633c[_0x5e3e('0x17')](_0x39c0d7)[_0x5e3e('0x26')](_0x3d9b64);};}exports['index']=function(_0x1f3b25,_0x416a00){var _0x46f262={},_0x5b0937={},_0x5a92a8={'count':0x0,'rows':[]};var _0x4286c3=_[_0x5e3e('0x27')](db[_0x5e3e('0x28')][_0x5e3e('0x29')],function(_0xb785d1){return{'name':_0xb785d1[_0x5e3e('0x2a')],'type':_0xb785d1[_0x5e3e('0x2b')][_0x5e3e('0x2c')]};});_0x5b0937[_0x5e3e('0x2d')]=_[_0x5e3e('0x27')](_0x4286c3,_0x5e3e('0x25'));_0x5b0937[_0x5e3e('0x2e')]=_['keys'](_0x1f3b25[_0x5e3e('0x2e')]);_0x5b0937[_0x5e3e('0x2f')]=_['intersection'](_0x5b0937['model'],_0x5b0937[_0x5e3e('0x2e')]);_0x46f262[_0x5e3e('0x30')]=_['intersection'](_0x5b0937['model'],qs['fields'](_0x1f3b25['query']['fields']));_0x46f262[_0x5e3e('0x30')]=_0x46f262[_0x5e3e('0x30')][_0x5e3e('0x31')]?_0x46f262[_0x5e3e('0x30')]:_0x5b0937[_0x5e3e('0x2d')];if(!_0x1f3b25['query']['hasOwnProperty']('nolimit')){_0x46f262[_0x5e3e('0x1c')]=qs[_0x5e3e('0x1c')](_0x1f3b25['query'][_0x5e3e('0x1c')]);_0x46f262[_0x5e3e('0x19')]=qs[_0x5e3e('0x19')](_0x1f3b25[_0x5e3e('0x2e')][_0x5e3e('0x19')]);}_0x46f262['order']=qs[_0x5e3e('0x32')](_0x1f3b25[_0x5e3e('0x2e')][_0x5e3e('0x32')]);_0x46f262[_0x5e3e('0x33')]=qs[_0x5e3e('0x2f')](_['pick'](_0x1f3b25[_0x5e3e('0x2e')],_0x5b0937[_0x5e3e('0x2f')]),_0x4286c3);if(_0x1f3b25['query'][_0x5e3e('0x34')]){_0x46f262['where']=_[_0x5e3e('0x35')](_0x46f262[_0x5e3e('0x33')],{'$or':_[_0x5e3e('0x27')](_0x4286c3,function(_0x2729ce){if(_0x2729ce['type']!==_0x5e3e('0x36')){var _0x3ad055={};_0x3ad055[_0x2729ce[_0x5e3e('0x25')]]={'$like':'%'+_0x1f3b25[_0x5e3e('0x2e')][_0x5e3e('0x34')]+'%'};return _0x3ad055;}})});}_0x46f262=_[_0x5e3e('0x35')]({},_0x46f262,_0x1f3b25['options']);var _0x386c72={'where':_0x46f262[_0x5e3e('0x33')]};return db[_0x5e3e('0x28')][_0x5e3e('0x1b')](_0x386c72)['then'](function(_0x290abf){_0x5a92a8[_0x5e3e('0x1b')]=_0x290abf;if(_0x1f3b25[_0x5e3e('0x2e')][_0x5e3e('0x37')]){_0x46f262[_0x5e3e('0x38')]=[{'all':!![]}];}return db[_0x5e3e('0x28')][_0x5e3e('0x39')](_0x46f262);})[_0x5e3e('0x22')](function(_0x537ece){_0x5a92a8['rows']=_0x537ece;return _0x5a92a8;})[_0x5e3e('0x22')](respondWithFilteredResult(_0x416a00,_0x46f262))[_0x5e3e('0x3a')](handleError(_0x416a00,null));};exports[_0x5e3e('0x3b')]=function(_0x4c89c7,_0x4b5e80){var _0x3ee570={'raw':![],'where':{'id':_0x4c89c7[_0x5e3e('0x3c')]['id']}},_0x17dc73={};_0x17dc73[_0x5e3e('0x2d')]=_[_0x5e3e('0x3d')](db[_0x5e3e('0x28')][_0x5e3e('0x29')]);_0x17dc73[_0x5e3e('0x2e')]=_[_0x5e3e('0x3d')](_0x4c89c7[_0x5e3e('0x2e')]);_0x17dc73[_0x5e3e('0x2f')]=_['intersection'](_0x17dc73[_0x5e3e('0x2d')],_0x17dc73[_0x5e3e('0x2e')]);_0x3ee570[_0x5e3e('0x30')]=_[_0x5e3e('0x3e')](_0x17dc73[_0x5e3e('0x2d')],qs[_0x5e3e('0x3f')](_0x4c89c7['query'][_0x5e3e('0x3f')]));_0x3ee570[_0x5e3e('0x30')]=_0x3ee570['attributes'][_0x5e3e('0x31')]?_0x3ee570[_0x5e3e('0x30')]:_0x17dc73[_0x5e3e('0x2d')];if(_0x4c89c7[_0x5e3e('0x2e')][_0x5e3e('0x37')]){_0x3ee570[_0x5e3e('0x38')]=[{'all':!![]}];}_0x3ee570=_['merge']({},_0x3ee570,_0x4c89c7[_0x5e3e('0x40')]);return db[_0x5e3e('0x28')][_0x5e3e('0x41')](_0x3ee570)['then'](handleEntityNotFound(_0x4b5e80,null))[_0x5e3e('0x22')](respondWithResult(_0x4b5e80,null))[_0x5e3e('0x3a')](handleError(_0x4b5e80,null));};exports['create']=function(_0x3cdfd4,_0x23f521){return db['VtigerConfiguration'][_0x5e3e('0x42')](_0x3cdfd4['body'],{})[_0x5e3e('0x22')](respondWithResult(_0x23f521,0xc9))[_0x5e3e('0x3a')](handleError(_0x23f521,null));};exports[_0x5e3e('0x21')]=function(_0x532142,_0x3b67e2){if(_0x532142['body']['id']){delete _0x532142[_0x5e3e('0x43')]['id'];}return db[_0x5e3e('0x28')]['find']({'where':{'id':_0x532142['params']['id']}})[_0x5e3e('0x22')](handleEntityNotFound(_0x3b67e2,null))[_0x5e3e('0x22')](saveUpdates(_0x532142['body'],null))['then'](respondWithResult(_0x3b67e2,null))[_0x5e3e('0x3a')](handleError(_0x3b67e2,null));};exports[_0x5e3e('0x44')]=function(_0x1772ed,_0x22a2b0){return db[_0x5e3e('0x28')][_0x5e3e('0x41')]({'where':{'id':_0x1772ed[_0x5e3e('0x3c')]['id']}})[_0x5e3e('0x22')](handleEntityNotFound(_0x22a2b0,null))[_0x5e3e('0x22')](removeEntity(_0x22a2b0,null))[_0x5e3e('0x3a')](handleError(_0x22a2b0,null));};exports[_0x5e3e('0x45')]=function(_0x22d262,_0x106048,_0x2a43ed){var _0x17fca2={};var _0x192907={};var _0x4c4c1c;var _0x468006;return db[_0x5e3e('0x28')][_0x5e3e('0x46')]({'where':{'id':_0x22d262[_0x5e3e('0x3c')]['id']}})[_0x5e3e('0x22')](handleEntityNotFound(_0x106048,null))['then'](function(_0x346017){if(_0x346017){_0x4c4c1c=_0x346017;_0x192907[_0x5e3e('0x2d')]=_[_0x5e3e('0x3d')](db['VtigerField'][_0x5e3e('0x29')]);_0x192907[_0x5e3e('0x2e')]=_['keys'](_0x22d262[_0x5e3e('0x2e')]);_0x192907[_0x5e3e('0x2f')]=_[_0x5e3e('0x3e')](_0x192907[_0x5e3e('0x2d')],_0x192907[_0x5e3e('0x2e')]);_0x17fca2[_0x5e3e('0x30')]=_[_0x5e3e('0x3e')](_0x192907[_0x5e3e('0x2d')],qs[_0x5e3e('0x3f')](_0x22d262[_0x5e3e('0x2e')][_0x5e3e('0x3f')]));_0x17fca2[_0x5e3e('0x30')]=_0x17fca2[_0x5e3e('0x30')][_0x5e3e('0x31')]?_0x17fca2[_0x5e3e('0x30')]:_0x192907[_0x5e3e('0x2d')];_0x17fca2[_0x5e3e('0x47')]=qs[_0x5e3e('0x32')](_0x22d262[_0x5e3e('0x2e')]['sort']);_0x17fca2[_0x5e3e('0x33')]=qs[_0x5e3e('0x2f')](_['pick'](_0x22d262[_0x5e3e('0x2e')],_0x192907[_0x5e3e('0x2f')]));if(_0x22d262[_0x5e3e('0x2e')]['filter']){_0x17fca2[_0x5e3e('0x33')]=_[_0x5e3e('0x35')](_0x17fca2[_0x5e3e('0x33')],{'$or':_['map'](_0x17fca2[_0x5e3e('0x30')],function(_0x55a4ae){var _0x443fbc={};_0x443fbc[_0x55a4ae]={'$like':'%'+_0x22d262[_0x5e3e('0x2e')][_0x5e3e('0x34')]+'%'};return _0x443fbc;})});}_0x17fca2=_['merge']({},_0x17fca2,_0x22d262[_0x5e3e('0x40')]);return _0x4c4c1c[_0x5e3e('0x45')](_0x17fca2);}})[_0x5e3e('0x22')](function(_0x308090){if(_0x308090){_0x468006=_0x308090[_0x5e3e('0x31')];if(!_0x22d262['query'][_0x5e3e('0x48')](_0x5e3e('0x49'))){_0x17fca2[_0x5e3e('0x1c')]=qs[_0x5e3e('0x1c')](_0x22d262[_0x5e3e('0x2e')][_0x5e3e('0x1c')]);_0x17fca2['offset']=qs[_0x5e3e('0x19')](_0x22d262['query']['offset']);}return _0x4c4c1c['getFields'](_0x17fca2);}})[_0x5e3e('0x22')](function(_0x1a30da){if(_0x1a30da){return _0x1a30da?{'count':_0x468006,'rows':_0x1a30da}:null;}})[_0x5e3e('0x22')](respondWithResult(_0x106048,null))['catch'](handleError(_0x106048,null));};exports[_0x5e3e('0x4a')]=function(_0x1ecfca,_0x46ab66,_0x51ab23){var _0x2c46dd={};var _0x2a8115={};var _0x4448c6;var _0x324044;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x1ecfca[_0x5e3e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x46ab66,null))['then'](function(_0x427491){if(_0x427491){_0x4448c6=_0x427491;_0x2a8115[_0x5e3e('0x2d')]=_[_0x5e3e('0x3d')](db[_0x5e3e('0x4b')]['rawAttributes']);_0x2a8115[_0x5e3e('0x2e')]=_[_0x5e3e('0x3d')](_0x1ecfca[_0x5e3e('0x2e')]);_0x2a8115[_0x5e3e('0x2f')]=_[_0x5e3e('0x3e')](_0x2a8115[_0x5e3e('0x2d')],_0x2a8115[_0x5e3e('0x2e')]);_0x2c46dd[_0x5e3e('0x30')]=_[_0x5e3e('0x3e')](_0x2a8115[_0x5e3e('0x2d')],qs[_0x5e3e('0x3f')](_0x1ecfca[_0x5e3e('0x2e')][_0x5e3e('0x3f')]));_0x2c46dd[_0x5e3e('0x30')]=_0x2c46dd['attributes'][_0x5e3e('0x31')]?_0x2c46dd[_0x5e3e('0x30')]:_0x2a8115[_0x5e3e('0x2d')];_0x2c46dd['order']=qs[_0x5e3e('0x32')](_0x1ecfca['query'][_0x5e3e('0x32')]);_0x2c46dd['where']=qs[_0x5e3e('0x2f')](_[_0x5e3e('0x4c')](_0x1ecfca['query'],_0x2a8115[_0x5e3e('0x2f')]));if(_0x1ecfca[_0x5e3e('0x2e')]['filter']){_0x2c46dd['where']=_[_0x5e3e('0x35')](_0x2c46dd['where'],{'$or':_['map'](_0x2c46dd[_0x5e3e('0x30')],function(_0x4656a2){var _0x5dfdc3={};_0x5dfdc3[_0x4656a2]={'$like':'%'+_0x1ecfca[_0x5e3e('0x2e')]['filter']+'%'};return _0x5dfdc3;})});}_0x2c46dd=_['merge']({},_0x2c46dd,_0x1ecfca[_0x5e3e('0x40')]);return _0x4448c6[_0x5e3e('0x4a')](_0x2c46dd);}})['then'](function(_0x492ccb){if(_0x492ccb){_0x324044=_0x492ccb[_0x5e3e('0x31')];if(!_0x1ecfca['query'][_0x5e3e('0x48')](_0x5e3e('0x49'))){_0x2c46dd[_0x5e3e('0x1c')]=qs[_0x5e3e('0x1c')](_0x1ecfca[_0x5e3e('0x2e')][_0x5e3e('0x1c')]);_0x2c46dd['offset']=qs[_0x5e3e('0x19')](_0x1ecfca[_0x5e3e('0x2e')][_0x5e3e('0x19')]);}return _0x4448c6[_0x5e3e('0x4a')](_0x2c46dd);}})[_0x5e3e('0x22')](function(_0x3dd2c9){if(_0x3dd2c9){return _0x3dd2c9?{'count':_0x324044,'rows':_0x3dd2c9}:null;}})[_0x5e3e('0x22')](respondWithResult(_0x46ab66,null))[_0x5e3e('0x3a')](handleError(_0x46ab66,null));};exports['getDescriptions']=function(_0x1ee6a5,_0x4e104e,_0x41e3f7){var _0x445a56={};var _0x551831={};var _0x1ff8dd;var _0x1cfe21;return db[_0x5e3e('0x28')][_0x5e3e('0x46')]({'where':{'id':_0x1ee6a5[_0x5e3e('0x3c')]['id']}})[_0x5e3e('0x22')](handleEntityNotFound(_0x4e104e,null))[_0x5e3e('0x22')](function(_0x1e0c96){if(_0x1e0c96){_0x1ff8dd=_0x1e0c96;_0x551831[_0x5e3e('0x2d')]=_['keys'](db[_0x5e3e('0x4b')][_0x5e3e('0x29')]);_0x551831['query']=_[_0x5e3e('0x3d')](_0x1ee6a5['query']);_0x551831[_0x5e3e('0x2f')]=_[_0x5e3e('0x3e')](_0x551831[_0x5e3e('0x2d')],_0x551831['query']);_0x445a56[_0x5e3e('0x30')]=_[_0x5e3e('0x3e')](_0x551831[_0x5e3e('0x2d')],qs[_0x5e3e('0x3f')](_0x1ee6a5[_0x5e3e('0x2e')][_0x5e3e('0x3f')]));_0x445a56[_0x5e3e('0x30')]=_0x445a56[_0x5e3e('0x30')][_0x5e3e('0x31')]?_0x445a56[_0x5e3e('0x30')]:_0x551831[_0x5e3e('0x2d')];_0x445a56[_0x5e3e('0x47')]=qs[_0x5e3e('0x32')](_0x1ee6a5[_0x5e3e('0x2e')][_0x5e3e('0x32')]);_0x445a56[_0x5e3e('0x33')]=qs['filters'](_['pick'](_0x1ee6a5[_0x5e3e('0x2e')],_0x551831['filters']));if(_0x1ee6a5[_0x5e3e('0x2e')][_0x5e3e('0x34')]){_0x445a56[_0x5e3e('0x33')]=_[_0x5e3e('0x35')](_0x445a56[_0x5e3e('0x33')],{'$or':_[_0x5e3e('0x27')](_0x445a56[_0x5e3e('0x30')],function(_0x3490d2){var _0x50391d={};_0x50391d[_0x3490d2]={'$like':'%'+_0x1ee6a5[_0x5e3e('0x2e')][_0x5e3e('0x34')]+'%'};return _0x50391d;})});}_0x445a56=_[_0x5e3e('0x35')]({},_0x445a56,_0x1ee6a5[_0x5e3e('0x40')]);return _0x1ff8dd[_0x5e3e('0x4d')](_0x445a56);}})[_0x5e3e('0x22')](function(_0x5b36d0){if(_0x5b36d0){_0x1cfe21=_0x5b36d0['length'];if(!_0x1ee6a5[_0x5e3e('0x2e')][_0x5e3e('0x48')](_0x5e3e('0x49'))){_0x445a56[_0x5e3e('0x1c')]=qs['limit'](_0x1ee6a5['query'][_0x5e3e('0x1c')]);_0x445a56[_0x5e3e('0x19')]=qs[_0x5e3e('0x19')](_0x1ee6a5[_0x5e3e('0x2e')][_0x5e3e('0x19')]);}return _0x1ff8dd[_0x5e3e('0x4d')](_0x445a56);}})[_0x5e3e('0x22')](function(_0x5554fb){if(_0x5554fb){return _0x5554fb?{'count':_0x1cfe21,'rows':_0x5554fb}:null;}})[_0x5e3e('0x22')](respondWithResult(_0x4e104e,null))[_0x5e3e('0x3a')](handleError(_0x4e104e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 7d9996a..270f180 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 _0x20ee=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x20ee,0x131));var _0xe20e=function(_0x144cfd,_0x5ae840){_0x144cfd=_0x144cfd-0x0;var _0x4871b5=_0x20ee[_0x144cfd];return _0x4871b5;};'use strict';var _=require('lodash');var util=require(_0xe20e('0x0'));var logger=require(_0xe20e('0x1'))(_0xe20e('0x2'));var moment=require(_0xe20e('0x3'));var BPromise=require(_0xe20e('0x4'));var rp=require(_0xe20e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe20e('0x6'));var attributes=require(_0xe20e('0x7'));module[_0xe20e('0x8')]=function(_0xd22e0,_0x3e51b3){return _0xd22e0[_0xe20e('0x9')](_0xe20e('0xa'),attributes,{'tableName':_0xe20e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x157f=['define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','bluebird','path','../../config/environment','./intVtigerConfiguration.attributes','exports'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x157f,0x163));var _0xf157=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x157f[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xf157('0x0'));var logger=require(_0xf157('0x1'))(_0xf157('0x2'));var moment=require('moment');var BPromise=require(_0xf157('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf157('0x4'));var rimraf=require('rimraf');var config=require(_0xf157('0x5'));var attributes=require(_0xf157('0x6'));module[_0xf157('0x7')]=function(_0x3eb915,_0x5485fb){return _0x3eb915[_0xf157('0x8')](_0xf157('0x9'),attributes,{'tableName':_0xf157('0xa'),'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 fa61fdd..37bebc3 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 _0x608c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','info','VtigerConfiguration,\x20%s,\x20%s','lodash'];(function(_0x5b463d,_0x1dc66c){var _0x43796c=function(_0x2f47bd){while(--_0x2f47bd){_0x5b463d['push'](_0x5b463d['shift']());}};_0x43796c(++_0x1dc66c);}(_0x608c,0x6d));var _0xc608=function(_0x3fad0b,_0x3fa941){_0x3fad0b=_0x3fad0b-0x0;var _0x4d3047=_0x608c[_0x3fad0b];return _0x4d3047;};'use strict';var _=require(_0xc608('0x0'));var util=require(_0xc608('0x1'));var moment=require(_0xc608('0x2'));var BPromise=require(_0xc608('0x3'));var rs=require(_0xc608('0x4'));var fs=require('fs');var Redis=require(_0xc608('0x5'));var db=require(_0xc608('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc608('0x7'))('rpc');var config=require(_0xc608('0x8'));var jayson=require(_0xc608('0x9'));var client=jayson[_0xc608('0xa')][_0xc608('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x236fc3,_0x170209,_0x20d3ce){return new BPromise(function(_0x1ea9b8,_0x1c8ff9){return client[_0xc608('0xc')](_0x236fc3,_0x20d3ce)[_0xc608('0xd')](function(_0x3a4a7e){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x170209,_0xc608('0xe'));logger[_0xc608('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x170209,_0xc608('0xe'),JSON[_0xc608('0x10')](_0x3a4a7e));if(_0x3a4a7e[_0xc608('0x11')]){if(_0x3a4a7e[_0xc608('0x11')][_0xc608('0x12')]===0x1f4){logger[_0xc608('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x170209,_0x3a4a7e[_0xc608('0x11')][_0xc608('0x13')]);return _0x1c8ff9(_0x3a4a7e[_0xc608('0x11')][_0xc608('0x13')]);}logger[_0xc608('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x170209,_0x3a4a7e['error'][_0xc608('0x13')]);return _0x1ea9b8(_0x3a4a7e['error'][_0xc608('0x13')]);}else{logger[_0xc608('0x14')](_0xc608('0x15'),_0x170209,_0xc608('0xe'));_0x1ea9b8(_0x3a4a7e['result'][_0xc608('0x13')]);}})['catch'](function(_0x46f5d6){logger[_0xc608('0x11')](_0xc608('0x15'),_0x170209,_0x46f5d6);_0x1c8ff9(_0x46f5d6);});});} \ No newline at end of file +var _0x0ed3=['bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x0ed3,0xf4));var _0x30ed=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0ed3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x30ed('0x0'));var util=require(_0x30ed('0x1'));var moment=require(_0x30ed('0x2'));var BPromise=require(_0x30ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30ed('0x4'));var db=require(_0x30ed('0x5'))['db'];var utils=require(_0x30ed('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x30ed('0x7'));var client=jayson[_0x30ed('0x8')][_0x30ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a64a4,_0x407ae8,_0x4b2555){return new BPromise(function(_0x5c5d1b,_0x4b8309){return client['request'](_0x1a64a4,_0x4b2555)[_0x30ed('0xa')](function(_0x5e6fba){logger['info'](_0x30ed('0xb'),_0x407ae8,_0x30ed('0xc'));logger['debug'](_0x30ed('0xd'),_0x407ae8,_0x30ed('0xc'),JSON[_0x30ed('0xe')](_0x5e6fba));if(_0x5e6fba[_0x30ed('0xf')]){if(_0x5e6fba[_0x30ed('0xf')]['code']===0x1f4){logger['error'](_0x30ed('0xb'),_0x407ae8,_0x5e6fba['error'][_0x30ed('0x10')]);return _0x4b8309(_0x5e6fba[_0x30ed('0xf')]['message']);}logger[_0x30ed('0xf')](_0x30ed('0xb'),_0x407ae8,_0x5e6fba[_0x30ed('0xf')]['message']);return _0x5c5d1b(_0x5e6fba[_0x30ed('0xf')][_0x30ed('0x10')]);}else{logger[_0x30ed('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x407ae8,_0x30ed('0xc'));_0x5c5d1b(_0x5e6fba['result'][_0x30ed('0x10')]);}})[_0x30ed('0x12')](function(_0x128da9){logger['error'](_0x30ed('0xb'),_0x407ae8,_0x128da9);_0x4b8309(_0x128da9);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2eaf9e9..a6261a9 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 _0x20bd=['Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x4d6ac0,_0x201628){var _0x5296c4=function(_0x3d0b3d){while(--_0x3d0b3d){_0x4d6ac0['push'](_0x4d6ac0['shift']());}};_0x5296c4(++_0x201628);}(_0x20bd,0xa8));var _0xd20b=function(_0x24c2c5,_0x41cd1e){_0x24c2c5=_0x24c2c5-0x0;var _0x5b9cee=_0x20bd[_0x24c2c5];return _0x5b9cee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd20b('0x0'));var timeout=require(_0xd20b('0x1'));var express=require(_0xd20b('0x2'));var router=express[_0xd20b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd20b('0x4'));var interaction=require(_0xd20b('0x5'));var config=require('../../config/environment');var controller=require(_0xd20b('0x6'));router[_0xd20b('0x7')]('/',auth[_0xd20b('0x8')](),controller[_0xd20b('0x9')]);router[_0xd20b('0x7')](_0xd20b('0xa'),auth[_0xd20b('0x8')](),controller[_0xd20b('0xb')]);router[_0xd20b('0xc')]('/',auth['isAuthenticated'](),controller[_0xd20b('0xd')]);router[_0xd20b('0xe')]('/:id',auth[_0xd20b('0x8')](),controller[_0xd20b('0xf')]);router[_0xd20b('0x10')]('/:id',auth[_0xd20b('0x8')](),controller[_0xd20b('0x11')]);module[_0xd20b('0x12')]=router; \ No newline at end of file +var _0xd576=['./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x1a8c0c,_0x18ee77){var _0x2d46b6=function(_0xd79726){while(--_0xd79726){_0x1a8c0c['push'](_0x1a8c0c['shift']());}};_0x2d46b6(++_0x18ee77);}(_0xd576,0x15d));var _0x6d57=function(_0xe74f67,_0xc6b862){_0xe74f67=_0xe74f67-0x0;var _0x2362aa=_0xd576[_0xe74f67];return _0x2362aa;};'use strict';var multer=require(_0x6d57('0x0'));var util=require(_0x6d57('0x1'));var path=require(_0x6d57('0x2'));var timeout=require(_0x6d57('0x3'));var express=require(_0x6d57('0x4'));var router=express[_0x6d57('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d57('0x6'));var config=require(_0x6d57('0x7'));var controller=require(_0x6d57('0x8'));router[_0x6d57('0x9')]('/',auth[_0x6d57('0xa')](),controller[_0x6d57('0xb')]);router[_0x6d57('0x9')](_0x6d57('0xc'),auth[_0x6d57('0xa')](),controller[_0x6d57('0xd')]);router['post']('/',auth[_0x6d57('0xa')](),controller[_0x6d57('0xe')]);router['put'](_0x6d57('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6d57('0xf')](_0x6d57('0xc'),auth[_0x6d57('0xa')](),controller['destroy']);module[_0x6d57('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 4b96f14..4b70c2e 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 _0x51bc=['picklist','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x3905a0,_0x3364e3){var _0x55e2bd=function(_0x51983c){while(--_0x51983c){_0x3905a0['push'](_0x3905a0['shift']());}};_0x55e2bd(++_0x3364e3);}(_0x51bc,0x1d9));var _0xc51b=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x51bc[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require(_0xc51b('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xc51b('0x1'),_0xc51b('0x2'),'customVariable','keyValue',_0xc51b('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc51b('0x4')]},'keyType':{'type':Sequelize[_0xc51b('0x5')](_0xc51b('0x1'),_0xc51b('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc51b('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc51b('0x4')]},'customField':{'type':Sequelize[_0xc51b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc51b('0x4')]}}; \ No newline at end of file +var _0xeb83=['keyValue','picklist','STRING','customVariable','ENUM','string','variable'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xeb83,0x13f));var _0x3eb8=function(_0x435cc0,_0x2e33f6){_0x435cc0=_0x435cc0-0x0;var _0x2c6436=_0xeb83[_0x435cc0];return _0x2c6436;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3eb8('0x0')](_0x3eb8('0x1'),_0x3eb8('0x2'),'customVariable',_0x3eb8('0x3'),_0x3eb8('0x4')),'defaultValue':_0x3eb8('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3eb8('0x5')]},'keyType':{'type':Sequelize[_0x3eb8('0x0')](_0x3eb8('0x1'),'variable',_0x3eb8('0x6'))},'keyContent':{'type':Sequelize[_0x3eb8('0x5')]},'idField':{'type':Sequelize[_0x3eb8('0x5')]},'nameField':{'type':Sequelize[_0x3eb8('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index bad4bfc..f54c960 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 _0xa381=['rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filters','merge','where','filter','options','VtigerField','includeAll','include'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa381,0xdd));var _0x1a38=function(_0x5a335d,_0x148b8c){_0x5a335d=_0x5a335d-0x0;var _0x235b68=_0xa381[_0x5a335d];return _0x235b68;};'use strict';var emlformat=require(_0x1a38('0x0'));var rimraf=require(_0x1a38('0x1'));var zipdir=require(_0x1a38('0x2'));var jsonpatch=require(_0x1a38('0x3'));var rp=require(_0x1a38('0x4'));var moment=require(_0x1a38('0x5'));var BPromise=require(_0x1a38('0x6'));var Mustache=require(_0x1a38('0x7'));var util=require('util');var path=require(_0x1a38('0x8'));var sox=require(_0x1a38('0x9'));var csv=require(_0x1a38('0xa'));var ejs=require(_0x1a38('0xb'));var fs=require('fs');var fs_extra=require(_0x1a38('0xc'));var _=require(_0x1a38('0xd'));var squel=require(_0x1a38('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1a38('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1a38('0x10'));var Papa=require(_0x1a38('0x11'));var Redis=require('ioredis');var authService=require(_0x1a38('0x12'));var qs=require(_0x1a38('0x13'));var as=require(_0x1a38('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a38('0x15'))(_0x1a38('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a38('0x17'));var db=require(_0x1a38('0x18'))['db'];function respondWithStatusCode(_0x51bc18,_0x341479){_0x341479=_0x341479||0xcc;return function(_0x178627){if(_0x178627){return _0x51bc18[_0x1a38('0x19')](_0x341479);}return _0x51bc18['status'](_0x341479)[_0x1a38('0x1a')]();};}function respondWithResult(_0x37fbcc,_0x3784b6){_0x3784b6=_0x3784b6||0xc8;return function(_0x2c6087){if(_0x2c6087){return _0x37fbcc[_0x1a38('0x1b')](_0x3784b6)[_0x1a38('0x1c')](_0x2c6087);}};}function respondWithFilteredResult(_0x104b32,_0x254127){return function(_0xbfd4d5){if(_0xbfd4d5){var _0x1c19aa=typeof _0x254127['offset']===_0x1a38('0x1d')&&typeof _0x254127[_0x1a38('0x1e')]===_0x1a38('0x1d');var _0x8fe8cb=_0xbfd4d5[_0x1a38('0x1f')];var _0x4041b9=_0x1c19aa?0x0:_0x254127[_0x1a38('0x20')];var _0x50f465=_0x1c19aa?_0xbfd4d5[_0x1a38('0x1f')]:_0x254127[_0x1a38('0x20')]+_0x254127[_0x1a38('0x1e')];var _0x2bcffc;if(_0x50f465>=_0x8fe8cb){_0x50f465=_0x8fe8cb;_0x2bcffc=0xc8;}else{_0x2bcffc=0xce;}_0x104b32[_0x1a38('0x1b')](_0x2bcffc);return _0x104b32['set'](_0x1a38('0x21'),_0x4041b9+'-'+_0x50f465+'/'+_0x8fe8cb)[_0x1a38('0x1c')](_0xbfd4d5);}return null;};}function patchUpdates(_0x57db38){return function(_0x2bca9a){try{jsonpatch['apply'](_0x2bca9a,_0x57db38,!![]);}catch(_0x480983){return BPromise['reject'](_0x480983);}return _0x2bca9a[_0x1a38('0x22')]();};}function saveUpdates(_0xab9ece,_0x34cffc){return function(_0x15d0fc){if(_0x15d0fc){return _0x15d0fc[_0x1a38('0x23')](_0xab9ece)[_0x1a38('0x24')](function(_0x2851bd){return _0x2851bd;});}return null;};}function removeEntity(_0x2bb4ef,_0x4646ad){return function(_0x8bd3eb){if(_0x8bd3eb){return _0x8bd3eb[_0x1a38('0x25')]()[_0x1a38('0x24')](function(){_0x2bb4ef[_0x1a38('0x1b')](0xcc)[_0x1a38('0x1a')]();});}};}function handleEntityNotFound(_0xf572c7,_0x35ebbc){return function(_0x1a1a20){if(!_0x1a1a20){_0xf572c7[_0x1a38('0x19')](0x194);}return _0x1a1a20;};}function handleError(_0x5033a0,_0x415ced){_0x415ced=_0x415ced||0x1f4;return function(_0x31e75c){logger['error'](_0x31e75c[_0x1a38('0x26')]);if(_0x31e75c[_0x1a38('0x27')]){delete _0x31e75c[_0x1a38('0x27')];}_0x5033a0['status'](_0x415ced)[_0x1a38('0x28')](_0x31e75c);};}exports['index']=function(_0x551c4b,_0x284476){var _0x435ebb={},_0xba5f28={},_0x4dba4e={'count':0x0,'rows':[]};var _0x36a8bc=_[_0x1a38('0x29')](db['VtigerField'][_0x1a38('0x2a')],function(_0x139ece){return{'name':_0x139ece[_0x1a38('0x2b')],'type':_0x139ece['type'][_0x1a38('0x2c')]};});_0xba5f28[_0x1a38('0x2d')]=_[_0x1a38('0x29')](_0x36a8bc,'name');_0xba5f28[_0x1a38('0x2e')]=_['keys'](_0x551c4b['query']);_0xba5f28['filters']=_['intersection'](_0xba5f28['model'],_0xba5f28[_0x1a38('0x2e')]);_0x435ebb[_0x1a38('0x2f')]=_[_0x1a38('0x30')](_0xba5f28[_0x1a38('0x2d')],qs[_0x1a38('0x31')](_0x551c4b[_0x1a38('0x2e')][_0x1a38('0x31')]));_0x435ebb[_0x1a38('0x2f')]=_0x435ebb[_0x1a38('0x2f')][_0x1a38('0x32')]?_0x435ebb['attributes']:_0xba5f28[_0x1a38('0x2d')];if(!_0x551c4b[_0x1a38('0x2e')][_0x1a38('0x33')](_0x1a38('0x34'))){_0x435ebb['limit']=qs['limit'](_0x551c4b[_0x1a38('0x2e')][_0x1a38('0x1e')]);_0x435ebb[_0x1a38('0x20')]=qs[_0x1a38('0x20')](_0x551c4b[_0x1a38('0x2e')][_0x1a38('0x20')]);}_0x435ebb[_0x1a38('0x35')]=qs['sort'](_0x551c4b[_0x1a38('0x2e')]['sort']);_0x435ebb['where']=qs['filters'](_[_0x1a38('0x36')](_0x551c4b['query'],_0xba5f28[_0x1a38('0x37')]),_0x36a8bc);if(_0x551c4b[_0x1a38('0x2e')]['filter']){_0x435ebb['where']=_[_0x1a38('0x38')](_0x435ebb[_0x1a38('0x39')],{'$or':_[_0x1a38('0x29')](_0x36a8bc,function(_0x1d3602){if(_0x1d3602['type']!=='VIRTUAL'){var _0x4b731e={};_0x4b731e[_0x1d3602[_0x1a38('0x27')]]={'$like':'%'+_0x551c4b[_0x1a38('0x2e')][_0x1a38('0x3a')]+'%'};return _0x4b731e;}})});}_0x435ebb=_['merge']({},_0x435ebb,_0x551c4b[_0x1a38('0x3b')]);var _0x4dfe73={'where':_0x435ebb[_0x1a38('0x39')]};return db[_0x1a38('0x3c')][_0x1a38('0x1f')](_0x4dfe73)[_0x1a38('0x24')](function(_0x55a91a){_0x4dba4e['count']=_0x55a91a;if(_0x551c4b[_0x1a38('0x2e')][_0x1a38('0x3d')]){_0x435ebb[_0x1a38('0x3e')]=[{'all':!![]}];}return db[_0x1a38('0x3c')]['findAll'](_0x435ebb);})['then'](function(_0x4ad4e5){_0x4dba4e[_0x1a38('0x3f')]=_0x4ad4e5;return _0x4dba4e;})['then'](respondWithFilteredResult(_0x284476,_0x435ebb))[_0x1a38('0x40')](handleError(_0x284476,null));};exports[_0x1a38('0x41')]=function(_0xb9e7b7,_0x123e07){var _0x425103={'raw':!![],'where':{'id':_0xb9e7b7['params']['id']}},_0x1116e1={};_0x1116e1[_0x1a38('0x2d')]=_[_0x1a38('0x42')](db[_0x1a38('0x3c')][_0x1a38('0x2a')]);_0x1116e1['query']=_[_0x1a38('0x42')](_0xb9e7b7[_0x1a38('0x2e')]);_0x1116e1[_0x1a38('0x37')]=_[_0x1a38('0x30')](_0x1116e1[_0x1a38('0x2d')],_0x1116e1[_0x1a38('0x2e')]);_0x425103[_0x1a38('0x2f')]=_[_0x1a38('0x30')](_0x1116e1[_0x1a38('0x2d')],qs['fields'](_0xb9e7b7[_0x1a38('0x2e')][_0x1a38('0x31')]));_0x425103[_0x1a38('0x2f')]=_0x425103[_0x1a38('0x2f')][_0x1a38('0x32')]?_0x425103[_0x1a38('0x2f')]:_0x1116e1[_0x1a38('0x2d')];if(_0xb9e7b7['query'][_0x1a38('0x3d')]){_0x425103[_0x1a38('0x3e')]=[{'all':!![]}];}_0x425103=_[_0x1a38('0x38')]({},_0x425103,_0xb9e7b7[_0x1a38('0x3b')]);return db[_0x1a38('0x3c')][_0x1a38('0x43')](_0x425103)[_0x1a38('0x24')](handleEntityNotFound(_0x123e07,null))['then'](respondWithResult(_0x123e07,null))[_0x1a38('0x40')](handleError(_0x123e07,null));};exports[_0x1a38('0x44')]=function(_0xa313ed,_0xdf641a){return db[_0x1a38('0x3c')][_0x1a38('0x44')](_0xa313ed[_0x1a38('0x45')],{})[_0x1a38('0x24')](respondWithResult(_0xdf641a,0xc9))['catch'](handleError(_0xdf641a,null));};exports[_0x1a38('0x23')]=function(_0x20bf0a,_0x3397f7){if(_0x20bf0a[_0x1a38('0x45')]['id']){delete _0x20bf0a[_0x1a38('0x45')]['id'];}return db['VtigerField'][_0x1a38('0x43')]({'where':{'id':_0x20bf0a[_0x1a38('0x46')]['id']}})[_0x1a38('0x24')](handleEntityNotFound(_0x3397f7,null))[_0x1a38('0x24')](saveUpdates(_0x20bf0a[_0x1a38('0x45')],null))[_0x1a38('0x24')](respondWithResult(_0x3397f7,null))[_0x1a38('0x40')](handleError(_0x3397f7,null));};exports['destroy']=function(_0x38756c,_0x42283f){return db[_0x1a38('0x3c')]['find']({'where':{'id':_0x38756c[_0x1a38('0x46')]['id']}})[_0x1a38('0x24')](handleEntityNotFound(_0x42283f,null))[_0x1a38('0x24')](removeEntity(_0x42283f,null))[_0x1a38('0x40')](handleError(_0x42283f,null));}; \ No newline at end of file +var _0x13d2=['VtigerField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','rawAttributes','length','includeAll','options','find','create','body','params','eml-format','rimraf','request-promise','bluebird','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map'];(function(_0x34c212,_0x193e10){var _0x364c89=function(_0x5dc05b){while(--_0x5dc05b){_0x34c212['push'](_0x34c212['shift']());}};_0x364c89(++_0x193e10);}(_0x13d2,0x66));var _0x213d=function(_0x55b99c,_0x5104a1){_0x55b99c=_0x55b99c-0x0;var _0xedf637=_0x13d2[_0x55b99c];return _0xedf637;};'use strict';var emlformat=require(_0x213d('0x0'));var rimraf=require(_0x213d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x213d('0x2'));var moment=require('moment');var BPromise=require(_0x213d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x213d('0x4'));var sox=require(_0x213d('0x5'));var csv=require(_0x213d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x213d('0x7'));var squel=require('squel');var crypto=require(_0x213d('0x8'));var jsforce=require(_0x213d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x213d('0x6'));var querystring=require('querystring');var Papa=require(_0x213d('0xa'));var Redis=require(_0x213d('0xb'));var authService=require(_0x213d('0xc'));var qs=require(_0x213d('0xd'));var as=require(_0x213d('0xe'));var hardwareService=require(_0x213d('0xf'));var logger=require(_0x213d('0x10'))(_0x213d('0x11'));var utils=require(_0x213d('0x12'));var config=require(_0x213d('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44e5a3,_0x18d3a6){_0x18d3a6=_0x18d3a6||0xcc;return function(_0x278cb1){if(_0x278cb1){return _0x44e5a3['sendStatus'](_0x18d3a6);}return _0x44e5a3[_0x213d('0x14')](_0x18d3a6)[_0x213d('0x15')]();};}function respondWithResult(_0x8d9059,_0x328edd){_0x328edd=_0x328edd||0xc8;return function(_0x12e84e){if(_0x12e84e){return _0x8d9059['status'](_0x328edd)['json'](_0x12e84e);}};}function respondWithFilteredResult(_0x37e0a9,_0x54fabd){return function(_0x4fd081){if(_0x4fd081){var _0x25bde5=typeof _0x54fabd[_0x213d('0x16')]===_0x213d('0x17')&&typeof _0x54fabd['limit']==='undefined';var _0x228a5d=_0x4fd081[_0x213d('0x18')];var _0x44ff92=_0x25bde5?0x0:_0x54fabd[_0x213d('0x16')];var _0x3c74ad=_0x25bde5?_0x4fd081['count']:_0x54fabd['offset']+_0x54fabd[_0x213d('0x19')];var _0x310be9;if(_0x3c74ad>=_0x228a5d){_0x3c74ad=_0x228a5d;_0x310be9=0xc8;}else{_0x310be9=0xce;}_0x37e0a9[_0x213d('0x14')](_0x310be9);return _0x37e0a9[_0x213d('0x1a')](_0x213d('0x1b'),_0x44ff92+'-'+_0x3c74ad+'/'+_0x228a5d)[_0x213d('0x1c')](_0x4fd081);}return null;};}function patchUpdates(_0x17db09){return function(_0x5d176e){try{jsonpatch[_0x213d('0x1d')](_0x5d176e,_0x17db09,!![]);}catch(_0xec9ce9){return BPromise[_0x213d('0x1e')](_0xec9ce9);}return _0x5d176e[_0x213d('0x1f')]();};}function saveUpdates(_0x5a59e6,_0x3c78af){return function(_0x3a5607){if(_0x3a5607){return _0x3a5607[_0x213d('0x20')](_0x5a59e6)[_0x213d('0x21')](function(_0x1e11e1){return _0x1e11e1;});}return null;};}function removeEntity(_0x31e41e,_0x2120d6){return function(_0x29e198){if(_0x29e198){return _0x29e198[_0x213d('0x22')]()[_0x213d('0x21')](function(){_0x31e41e[_0x213d('0x14')](0xcc)[_0x213d('0x15')]();});}};}function handleEntityNotFound(_0x41ddd7,_0x18e32d){return function(_0x34699b){if(!_0x34699b){_0x41ddd7[_0x213d('0x23')](0x194);}return _0x34699b;};}function handleError(_0x15e5cf,_0x46e1ca){_0x46e1ca=_0x46e1ca||0x1f4;return function(_0x2ca70b){logger['error'](_0x2ca70b['stack']);if(_0x2ca70b[_0x213d('0x24')]){delete _0x2ca70b[_0x213d('0x24')];}_0x15e5cf['status'](_0x46e1ca)[_0x213d('0x25')](_0x2ca70b);};}exports[_0x213d('0x26')]=function(_0xcee169,_0xb077bd){var _0x444053={},_0x52ef6f={},_0x5a9b35={'count':0x0,'rows':[]};var _0x33ead2=_[_0x213d('0x27')](db[_0x213d('0x28')]['rawAttributes'],function(_0x37a9bc){return{'name':_0x37a9bc[_0x213d('0x29')],'type':_0x37a9bc[_0x213d('0x2a')]['key']};});_0x52ef6f[_0x213d('0x2b')]=_[_0x213d('0x27')](_0x33ead2,_0x213d('0x24'));_0x52ef6f[_0x213d('0x2c')]=_[_0x213d('0x2d')](_0xcee169['query']);_0x52ef6f[_0x213d('0x2e')]=_[_0x213d('0x2f')](_0x52ef6f['model'],_0x52ef6f['query']);_0x444053[_0x213d('0x30')]=_[_0x213d('0x2f')](_0x52ef6f['model'],qs['fields'](_0xcee169[_0x213d('0x2c')][_0x213d('0x31')]));_0x444053[_0x213d('0x30')]=_0x444053[_0x213d('0x30')]['length']?_0x444053['attributes']:_0x52ef6f[_0x213d('0x2b')];if(!_0xcee169[_0x213d('0x2c')][_0x213d('0x32')](_0x213d('0x33'))){_0x444053[_0x213d('0x19')]=qs[_0x213d('0x19')](_0xcee169[_0x213d('0x2c')]['limit']);_0x444053[_0x213d('0x16')]=qs[_0x213d('0x16')](_0xcee169[_0x213d('0x2c')][_0x213d('0x16')]);}_0x444053[_0x213d('0x34')]=qs[_0x213d('0x35')](_0xcee169[_0x213d('0x2c')]['sort']);_0x444053[_0x213d('0x36')]=qs[_0x213d('0x2e')](_[_0x213d('0x37')](_0xcee169[_0x213d('0x2c')],_0x52ef6f[_0x213d('0x2e')]),_0x33ead2);if(_0xcee169[_0x213d('0x2c')][_0x213d('0x38')]){_0x444053[_0x213d('0x36')]=_['merge'](_0x444053[_0x213d('0x36')],{'$or':_['map'](_0x33ead2,function(_0x41e90d){if(_0x41e90d[_0x213d('0x2a')]!==_0x213d('0x39')){var _0x2af52a={};_0x2af52a[_0x41e90d['name']]={'$like':'%'+_0xcee169[_0x213d('0x2c')][_0x213d('0x38')]+'%'};return _0x2af52a;}})});}_0x444053=_[_0x213d('0x3a')]({},_0x444053,_0xcee169['options']);var _0x4d353d={'where':_0x444053[_0x213d('0x36')]};return db[_0x213d('0x28')][_0x213d('0x18')](_0x4d353d)[_0x213d('0x21')](function(_0x4d5569){_0x5a9b35[_0x213d('0x18')]=_0x4d5569;if(_0xcee169[_0x213d('0x2c')]['includeAll']){_0x444053[_0x213d('0x3b')]=[{'all':!![]}];}return db[_0x213d('0x28')][_0x213d('0x3c')](_0x444053);})[_0x213d('0x21')](function(_0x18175c){_0x5a9b35[_0x213d('0x3d')]=_0x18175c;return _0x5a9b35;})['then'](respondWithFilteredResult(_0xb077bd,_0x444053))[_0x213d('0x3e')](handleError(_0xb077bd,null));};exports['show']=function(_0x141943,_0x2354f0){var _0x2cc568={'raw':!![],'where':{'id':_0x141943['params']['id']}},_0x45b300={};_0x45b300[_0x213d('0x2b')]=_[_0x213d('0x2d')](db[_0x213d('0x28')][_0x213d('0x3f')]);_0x45b300[_0x213d('0x2c')]=_[_0x213d('0x2d')](_0x141943[_0x213d('0x2c')]);_0x45b300[_0x213d('0x2e')]=_[_0x213d('0x2f')](_0x45b300[_0x213d('0x2b')],_0x45b300[_0x213d('0x2c')]);_0x2cc568['attributes']=_['intersection'](_0x45b300[_0x213d('0x2b')],qs[_0x213d('0x31')](_0x141943[_0x213d('0x2c')]['fields']));_0x2cc568[_0x213d('0x30')]=_0x2cc568[_0x213d('0x30')][_0x213d('0x40')]?_0x2cc568[_0x213d('0x30')]:_0x45b300['model'];if(_0x141943[_0x213d('0x2c')][_0x213d('0x41')]){_0x2cc568['include']=[{'all':!![]}];}_0x2cc568=_[_0x213d('0x3a')]({},_0x2cc568,_0x141943[_0x213d('0x42')]);return db[_0x213d('0x28')][_0x213d('0x43')](_0x2cc568)[_0x213d('0x21')](handleEntityNotFound(_0x2354f0,null))[_0x213d('0x21')](respondWithResult(_0x2354f0,null))[_0x213d('0x3e')](handleError(_0x2354f0,null));};exports[_0x213d('0x44')]=function(_0x2c04d4,_0x4149bd){return db['VtigerField'][_0x213d('0x44')](_0x2c04d4[_0x213d('0x45')],{})[_0x213d('0x21')](respondWithResult(_0x4149bd,0xc9))[_0x213d('0x3e')](handleError(_0x4149bd,null));};exports['update']=function(_0x2e5d6a,_0x4a95ea){if(_0x2e5d6a['body']['id']){delete _0x2e5d6a[_0x213d('0x45')]['id'];}return db['VtigerField'][_0x213d('0x43')]({'where':{'id':_0x2e5d6a[_0x213d('0x46')]['id']}})[_0x213d('0x21')](handleEntityNotFound(_0x4a95ea,null))[_0x213d('0x21')](saveUpdates(_0x2e5d6a[_0x213d('0x45')],null))[_0x213d('0x21')](respondWithResult(_0x4a95ea,null))['catch'](handleError(_0x4a95ea,null));};exports[_0x213d('0x22')]=function(_0x116acb,_0x4acdbc){return db['VtigerField'][_0x213d('0x43')]({'where':{'id':_0x116acb[_0x213d('0x46')]['id']}})[_0x213d('0x21')](handleEntityNotFound(_0x4acdbc,null))[_0x213d('0x21')](removeEntity(_0x4acdbc,null))['catch'](handleError(_0x4acdbc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 9a64e66..eadfbb2 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 _0xa4c6=['../../config/environment','./intVtigerField.attributes','exports','VtigerField','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5ea28b,_0x545bc9){var _0x29930d=function(_0x308e14){while(--_0x308e14){_0x5ea28b['push'](_0x5ea28b['shift']());}};_0x29930d(++_0x545bc9);}(_0xa4c6,0x132));var _0x6a4c=function(_0x348ee1,_0x428a23){_0x348ee1=_0x348ee1-0x0;var _0x11ff1a=_0xa4c6[_0x348ee1];return _0x11ff1a;};'use strict';var _=require(_0x6a4c('0x0'));var util=require(_0x6a4c('0x1'));var logger=require(_0x6a4c('0x2'))(_0x6a4c('0x3'));var moment=require(_0x6a4c('0x4'));var BPromise=require(_0x6a4c('0x5'));var rp=require(_0x6a4c('0x6'));var fs=require('fs');var path=require(_0x6a4c('0x7'));var rimraf=require(_0x6a4c('0x8'));var config=require(_0x6a4c('0x9'));var attributes=require(_0x6a4c('0xa'));module[_0x6a4c('0xb')]=function(_0x454c3e,_0x4694f3){return _0x454c3e['define'](_0x6a4c('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x6a4c('0xd'),_0x6a4c('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadec=['api','bluebird','request-promise','rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','util','../../config/logger'];(function(_0x4db4f9,_0x1d3281){var _0x4709d3=function(_0x25176f){while(--_0x25176f){_0x4db4f9['push'](_0x4db4f9['shift']());}};_0x4709d3(++_0x1d3281);}(_0xadec,0x14e));var _0xcade=function(_0x12fe83,_0x11801f){_0x12fe83=_0x12fe83-0x0;var _0x55437e=_0xadec[_0x12fe83];return _0x55437e;};'use strict';var _=require('lodash');var util=require(_0xcade('0x0'));var logger=require(_0xcade('0x1'))(_0xcade('0x2'));var moment=require('moment');var BPromise=require(_0xcade('0x3'));var rp=require(_0xcade('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcade('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xcade('0x6')]=function(_0x41bd38,_0x42c39a){return _0x41bd38[_0xcade('0x7')](_0xcade('0x8'),attributes,{'tableName':_0xcade('0x9'),'paranoid':![],'indexes':[{'name':_0xcade('0xa'),'fields':[_0xcade('0xb'),'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 d773160..605b52c 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 _0x45eb=['request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x45eb,0x126));var _0xb45e=function(_0x764dad,_0x23088e){_0x764dad=_0x764dad-0x0;var _0x4e5ab0=_0x45eb[_0x764dad];return _0x4e5ab0;};'use strict';var _=require(_0xb45e('0x0'));var util=require(_0xb45e('0x1'));var moment=require('moment');var BPromise=require(_0xb45e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb45e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb45e('0x4'));var logger=require('../../config/logger')(_0xb45e('0x5'));var config=require(_0xb45e('0x6'));var jayson=require(_0xb45e('0x7'));var client=jayson[_0xb45e('0x8')][_0xb45e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55fda1,_0xea3e5,_0x30c10c){return new BPromise(function(_0x55cf2d,_0x1a7c0c){return client[_0xb45e('0xa')](_0x55fda1,_0x30c10c)[_0xb45e('0xb')](function(_0x160a1e){logger[_0xb45e('0xc')](_0xb45e('0xd'),_0xea3e5,_0xb45e('0xe'));logger[_0xb45e('0xf')](_0xb45e('0x10'),_0xea3e5,'request\x20sent',JSON[_0xb45e('0x11')](_0x160a1e));if(_0x160a1e[_0xb45e('0x12')]){if(_0x160a1e[_0xb45e('0x12')][_0xb45e('0x13')]===0x1f4){logger['error'](_0xb45e('0xd'),_0xea3e5,_0x160a1e['error']['message']);return _0x1a7c0c(_0x160a1e[_0xb45e('0x12')][_0xb45e('0x14')]);}logger[_0xb45e('0x12')](_0xb45e('0xd'),_0xea3e5,_0x160a1e[_0xb45e('0x12')][_0xb45e('0x14')]);return _0x55cf2d(_0x160a1e[_0xb45e('0x12')][_0xb45e('0x14')]);}else{logger['info'](_0xb45e('0xd'),_0xea3e5,_0xb45e('0xe'));_0x55cf2d(_0x160a1e['result'][_0xb45e('0x14')]);}})[_0xb45e('0x15')](function(_0x1b3901){logger[_0xb45e('0x12')](_0xb45e('0xd'),_0xea3e5,_0x1b3901);_0x1a7c0c(_0x1b3901);});});} \ No newline at end of file +var _0x3dfa=['then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VtigerField,\x20%s,\x20%s','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x1c9d86,_0x25d647){var _0x26254b=function(_0x578c8c){while(--_0x578c8c){_0x1c9d86['push'](_0x1c9d86['shift']());}};_0x26254b(++_0x25d647);}(_0x3dfa,0x114));var _0xa3df=function(_0x6300b9,_0x505f70){_0x6300b9=_0x6300b9-0x0;var _0x43658f=_0x3dfa[_0x6300b9];return _0x43658f;};'use strict';var _=require(_0xa3df('0x0'));var util=require(_0xa3df('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3df('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3df('0x3'))['db'];var utils=require(_0xa3df('0x4'));var logger=require(_0xa3df('0x5'))(_0xa3df('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa3df('0x7')][_0xa3df('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b1622,_0x1b9ae5,_0x2575c8){return new BPromise(function(_0x281781,_0x556f86){return client[_0xa3df('0x9')](_0x1b1622,_0x2575c8)[_0xa3df('0xa')](function(_0x2a02a2){logger[_0xa3df('0xb')]('VtigerField,\x20%s,\x20%s',_0x1b9ae5,_0xa3df('0xc'));logger[_0xa3df('0xd')](_0xa3df('0xe'),_0x1b9ae5,_0xa3df('0xc'),JSON[_0xa3df('0xf')](_0x2a02a2));if(_0x2a02a2[_0xa3df('0x10')]){if(_0x2a02a2['error'][_0xa3df('0x11')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x1b9ae5,_0x2a02a2['error'][_0xa3df('0x12')]);return _0x556f86(_0x2a02a2[_0xa3df('0x10')][_0xa3df('0x12')]);}logger[_0xa3df('0x10')]('VtigerField,\x20%s,\x20%s',_0x1b9ae5,_0x2a02a2[_0xa3df('0x10')]['message']);return _0x281781(_0x2a02a2[_0xa3df('0x10')][_0xa3df('0x12')]);}else{logger[_0xa3df('0xb')]('VtigerField,\x20%s,\x20%s',_0x1b9ae5,'request\x20sent');_0x281781(_0x2a02a2[_0xa3df('0x13')]['message']);}})[_0xa3df('0x14')](function(_0x83baee){logger[_0xa3df('0x10')](_0xa3df('0x15'),_0x1b9ae5,_0x83baee);_0x556f86(_0x83baee);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 22c88c2..fb54dae 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 _0x39f2=['post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x39f2,0x129));var _0x239f=function(_0x1b4075,_0x321878){_0x1b4075=_0x1b4075-0x0;var _0x3d0f32=_0x39f2[_0x1b4075];return _0x3d0f32;};'use strict';var multer=require(_0x239f('0x0'));var util=require(_0x239f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x239f('0x2'));var router=express[_0x239f('0x3')]();var fs_extra=require(_0x239f('0x4'));var auth=require(_0x239f('0x5'));var interaction=require(_0x239f('0x6'));var config=require(_0x239f('0x7'));var controller=require(_0x239f('0x8'));router[_0x239f('0x9')]('/',auth[_0x239f('0xa')](),controller['index']);router['get'](_0x239f('0xb'),auth[_0x239f('0xa')](),controller[_0x239f('0xc')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x239f('0xd')]);router[_0x239f('0x9')](_0x239f('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x239f('0xf')]('/',auth[_0x239f('0xa')](),controller[_0x239f('0x10')]);router[_0x239f('0xf')](_0x239f('0x11'),auth['isAuthenticated'](),controller[_0x239f('0x12')]);router[_0x239f('0x13')](_0x239f('0xb'),auth[_0x239f('0xa')](),controller[_0x239f('0x14')]);router[_0x239f('0x15')](_0x239f('0xb'),auth[_0x239f('0xa')](),controller[_0x239f('0x16')]);module[_0x239f('0x17')]=router; \ No newline at end of file +var _0x9aed=['get','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','path','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated'];(function(_0x2af160,_0x765b1){var _0x439d67=function(_0x4d26af){while(--_0x4d26af){_0x2af160['push'](_0x2af160['shift']());}};_0x439d67(++_0x765b1);}(_0x9aed,0x9c));var _0xd9ae=function(_0x2b0989,_0x5422a9){_0x2b0989=_0x2b0989-0x0;var _0x133450=_0x9aed[_0x2b0989];return _0x133450;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd9ae('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd9ae('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd9ae('0x2'));var config=require(_0xd9ae('0x3'));var controller=require(_0xd9ae('0x4'));router['get']('/',auth[_0xd9ae('0x5')](),controller['index']);router[_0xd9ae('0x6')](_0xd9ae('0x7'),auth[_0xd9ae('0x5')](),controller[_0xd9ae('0x8')]);router[_0xd9ae('0x6')]('/:id/configurations',auth[_0xd9ae('0x5')](),controller[_0xd9ae('0x9')]);router[_0xd9ae('0x6')](_0xd9ae('0xa'),auth[_0xd9ae('0x5')](),controller['getFields']);router[_0xd9ae('0xb')]('/',auth[_0xd9ae('0x5')](),controller[_0xd9ae('0xc')]);router[_0xd9ae('0xb')]('/:id/configurations',auth[_0xd9ae('0x5')](),controller[_0xd9ae('0xd')]);router[_0xd9ae('0xe')]('/:id',auth[_0xd9ae('0x5')](),controller[_0xd9ae('0xf')]);router[_0xd9ae('0x10')]('/:id',auth[_0xd9ae('0x5')](),controller['destroy']);module[_0xd9ae('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 6b31b21..3ecd554 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 _0x0eeb=['exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','sequelize'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0eeb[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xb0ee('0x0'));module[_0xb0ee('0x1')]={'name':{'type':Sequelize[_0xb0ee('0x2')]},'description':{'type':Sequelize[_0xb0ee('0x2')]},'username':{'type':Sequelize[_0xb0ee('0x2')],'unique':_0xb0ee('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb0ee('0x2')],'unique':_0xb0ee('0x4')},'authType':{'type':Sequelize[_0xb0ee('0x5')](_0xb0ee('0x6'),_0xb0ee('0x7')),'defaultValue':_0xb0ee('0x6')},'serverUrl':{'type':Sequelize[_0xb0ee('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb0ee('0x8'),'newTab'),'defaultValue':_0xb0ee('0x8')}}; \ No newline at end of file +var _0x8b52=['ENUM','password','token','newTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x165690,_0x2aab72){var _0x9eea67=function(_0x1f3346){while(--_0x1f3346){_0x165690['push'](_0x165690['shift']());}};_0x9eea67(++_0x2aab72);}(_0x8b52,0x151));var _0x28b5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8b52[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x28b5('0x0'));module[_0x28b5('0x1')]={'name':{'type':Sequelize[_0x28b5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x28b5('0x2')],'unique':_0x28b5('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x28b5('0x2')]},'remoteUri':{'type':Sequelize[_0x28b5('0x2')],'unique':_0x28b5('0x4')},'authType':{'type':Sequelize[_0x28b5('0x5')](_0x28b5('0x6'),_0x28b5('0x7')),'defaultValue':_0x28b5('0x6')},'serverUrl':{'type':Sequelize[_0x28b5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x28b5('0x5')]('integrationTab',_0x28b5('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 de7b6c4..15ae4b5 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 _0xab40=['../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','error','name','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','findOne','ZendeskConfiguration','order','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0xf219b,_0x1ad38e){var _0x4db27e=function(_0x482647){while(--_0x482647){_0xf219b['push'](_0xf219b['shift']());}};_0x4db27e(++_0x1ad38e);}(_0xab40,0xcd));var _0x0ab4=function(_0x409aca,_0x304ddb){_0x409aca=_0x409aca-0x0;var _0x138445=_0xab40[_0x409aca];return _0x138445;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0ab4('0x15'));function respondWithStatusCode(_0x45e6fd,_0x1e7555){_0x1e7555=_0x1e7555||0xcc;return function(_0x1e2b56){if(_0x1e2b56){return _0x45e6fd[_0x0ab4('0x16')](_0x1e7555);}return _0x45e6fd[_0x0ab4('0x17')](_0x1e7555)[_0x0ab4('0x18')]();};}function respondWithResult(_0x2cc644,_0x3cb1df){_0x3cb1df=_0x3cb1df||0xc8;return function(_0x2033c8){if(_0x2033c8){return _0x2cc644[_0x0ab4('0x17')](_0x3cb1df)[_0x0ab4('0x19')](_0x2033c8);}};}function respondWithFilteredResult(_0x293e20,_0x45fad1){return function(_0x2a83a8){if(_0x2a83a8){var _0x2403db=typeof _0x45fad1[_0x0ab4('0x1a')]===_0x0ab4('0x1b')&&typeof _0x45fad1['limit']==='undefined';var _0x49634f=_0x2a83a8[_0x0ab4('0x1c')];var _0x30d5df=_0x2403db?0x0:_0x45fad1[_0x0ab4('0x1a')];var _0x53723c=_0x2403db?_0x2a83a8[_0x0ab4('0x1c')]:_0x45fad1[_0x0ab4('0x1a')]+_0x45fad1[_0x0ab4('0x1d')];var _0x31ee29;if(_0x53723c>=_0x49634f){_0x53723c=_0x49634f;_0x31ee29=0xc8;}else{_0x31ee29=0xce;}_0x293e20['status'](_0x31ee29);return _0x293e20['set'](_0x0ab4('0x1e'),_0x30d5df+'-'+_0x53723c+'/'+_0x49634f)['json'](_0x2a83a8);}return null;};}function patchUpdates(_0x2b0e29){return function(_0x30abff){try{jsonpatch['apply'](_0x30abff,_0x2b0e29,!![]);}catch(_0xacd68e){return BPromise[_0x0ab4('0x1f')](_0xacd68e);}return _0x30abff[_0x0ab4('0x20')]();};}function saveUpdates(_0x1d5c14,_0x12d06d){return function(_0x52d7d3){if(_0x52d7d3){return _0x52d7d3['update'](_0x1d5c14)[_0x0ab4('0x21')](function(_0x14087f){return _0x14087f;});}return null;};}function removeEntity(_0x392afe,_0x13c882){return function(_0x4e4b80){if(_0x4e4b80){return _0x4e4b80[_0x0ab4('0x22')]()[_0x0ab4('0x21')](function(){_0x392afe[_0x0ab4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5caf,_0x176ff1){return function(_0x1c132c){if(!_0x1c132c){_0x4c5caf[_0x0ab4('0x16')](0x194);}return _0x1c132c;};}function handleError(_0x4ae515,_0x519b23){_0x519b23=_0x519b23||0x1f4;return function(_0x49c72d){logger[_0x0ab4('0x23')](_0x49c72d['stack']);if(_0x49c72d[_0x0ab4('0x24')]){delete _0x49c72d[_0x0ab4('0x24')];}_0x4ae515['status'](_0x519b23)['send'](_0x49c72d);};}exports['index']=function(_0x3d38a4,_0x183bac){var _0x1cfdad={},_0x3f61cb={},_0x25385e={'count':0x0,'rows':[]};var _0x588e0d=_['map'](db['ZendeskAccount'][_0x0ab4('0x25')],function(_0x2b66d5){return{'name':_0x2b66d5[_0x0ab4('0x26')],'type':_0x2b66d5[_0x0ab4('0x27')][_0x0ab4('0x28')]};});_0x3f61cb['model']=_['map'](_0x588e0d,_0x0ab4('0x24'));_0x3f61cb[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x3d38a4['query']);_0x3f61cb['filters']=_[_0x0ab4('0x2b')](_0x3f61cb['model'],_0x3f61cb[_0x0ab4('0x29')]);_0x1cfdad[_0x0ab4('0x2c')]=_[_0x0ab4('0x2b')](_0x3f61cb[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0x3d38a4[_0x0ab4('0x29')]['fields']));_0x1cfdad[_0x0ab4('0x2c')]=_0x1cfdad[_0x0ab4('0x2c')][_0x0ab4('0x2f')]?_0x1cfdad[_0x0ab4('0x2c')]:_0x3f61cb['model'];if(!_0x3d38a4['query'][_0x0ab4('0x30')](_0x0ab4('0x31'))){_0x1cfdad[_0x0ab4('0x1d')]=qs['limit'](_0x3d38a4['query']['limit']);_0x1cfdad[_0x0ab4('0x1a')]=qs[_0x0ab4('0x1a')](_0x3d38a4[_0x0ab4('0x29')]['offset']);}_0x1cfdad['order']=qs['sort'](_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0x1cfdad[_0x0ab4('0x33')]=qs[_0x0ab4('0x34')](_[_0x0ab4('0x35')](_0x3d38a4[_0x0ab4('0x29')],_0x3f61cb[_0x0ab4('0x34')]),_0x588e0d);if(_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x36')]){_0x1cfdad[_0x0ab4('0x33')]=_['merge'](_0x1cfdad[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x588e0d,function(_0xb6bc6a){if(_0xb6bc6a[_0x0ab4('0x27')]!==_0x0ab4('0x38')){var _0x34c74f={};_0x34c74f[_0xb6bc6a[_0x0ab4('0x24')]]={'$like':'%'+_0x3d38a4[_0x0ab4('0x29')][_0x0ab4('0x36')]+'%'};return _0x34c74f;}})});}_0x1cfdad=_[_0x0ab4('0x39')]({},_0x1cfdad,_0x3d38a4[_0x0ab4('0x3a')]);var _0x1974ce={'where':_0x1cfdad['where']};return db[_0x0ab4('0x3b')][_0x0ab4('0x1c')](_0x1974ce)[_0x0ab4('0x21')](function(_0x3acb8d){_0x25385e['count']=_0x3acb8d;if(_0x3d38a4[_0x0ab4('0x29')]['includeAll']){_0x1cfdad[_0x0ab4('0x3c')]=[{'all':!![]}];}return db[_0x0ab4('0x3b')][_0x0ab4('0x3d')](_0x1cfdad);})[_0x0ab4('0x21')](function(_0xd2293){_0x25385e[_0x0ab4('0x3e')]=_0xd2293;return _0x25385e;})['then'](respondWithFilteredResult(_0x183bac,_0x1cfdad))[_0x0ab4('0x3f')](handleError(_0x183bac,null));};exports[_0x0ab4('0x40')]=function(_0xe3df73,_0x48029f){var _0x395e0b={'raw':![],'where':{'id':_0xe3df73[_0x0ab4('0x41')]['id']}},_0xeac8ad={};_0xeac8ad[_0x0ab4('0x2d')]=_[_0x0ab4('0x2a')](db['ZendeskAccount']['rawAttributes']);_0xeac8ad['query']=_[_0x0ab4('0x2a')](_0xe3df73[_0x0ab4('0x29')]);_0xeac8ad['filters']=_[_0x0ab4('0x2b')](_0xeac8ad['model'],_0xeac8ad[_0x0ab4('0x29')]);_0x395e0b['attributes']=_[_0x0ab4('0x2b')](_0xeac8ad[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0xe3df73[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x395e0b[_0x0ab4('0x2c')]=_0x395e0b['attributes'][_0x0ab4('0x2f')]?_0x395e0b[_0x0ab4('0x2c')]:_0xeac8ad[_0x0ab4('0x2d')];if(_0xe3df73[_0x0ab4('0x29')][_0x0ab4('0x42')]){_0x395e0b[_0x0ab4('0x3c')]=[{'all':!![]}];}_0x395e0b=_['merge']({},_0x395e0b,_0xe3df73[_0x0ab4('0x3a')]);return db['ZendeskAccount'][_0x0ab4('0x43')](_0x395e0b)[_0x0ab4('0x21')](handleEntityNotFound(_0x48029f,null))[_0x0ab4('0x21')](respondWithResult(_0x48029f,null))['catch'](handleError(_0x48029f,null));};exports[_0x0ab4('0x44')]=function(_0x1fcc3b,_0x1ce096){return db[_0x0ab4('0x3b')][_0x0ab4('0x44')](_0x1fcc3b[_0x0ab4('0x45')],{})['then'](respondWithResult(_0x1ce096,0xc9))[_0x0ab4('0x3f')](handleError(_0x1ce096,null));};exports[_0x0ab4('0x46')]=function(_0x302894,_0x2801ff){if(_0x302894[_0x0ab4('0x45')]['id']){delete _0x302894[_0x0ab4('0x45')]['id'];}return db[_0x0ab4('0x3b')][_0x0ab4('0x43')]({'where':{'id':_0x302894[_0x0ab4('0x41')]['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0x2801ff,null))[_0x0ab4('0x21')](saveUpdates(_0x302894[_0x0ab4('0x45')],null))[_0x0ab4('0x21')](respondWithResult(_0x2801ff,null))['catch'](handleError(_0x2801ff,null));};exports[_0x0ab4('0x22')]=function(_0x354bc,_0x5800cc){return db[_0x0ab4('0x3b')]['find']({'where':{'id':_0x354bc['params']['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0x5800cc,null))[_0x0ab4('0x21')](removeEntity(_0x5800cc,null))[_0x0ab4('0x3f')](handleError(_0x5800cc,null));};exports['getConfigurations']=function(_0x12a2df,_0xb3bd1e,_0xeddaa1){var _0xaed2d={};var _0x30ba95={};var _0x3f20de;var _0x1eea3b;return db['ZendeskAccount'][_0x0ab4('0x47')]({'where':{'id':_0x12a2df['params']['id']}})[_0x0ab4('0x21')](handleEntityNotFound(_0xb3bd1e,null))['then'](function(_0x2597f2){if(_0x2597f2){_0x3f20de=_0x2597f2;_0x30ba95['model']=_['keys'](db[_0x0ab4('0x48')][_0x0ab4('0x25')]);_0x30ba95[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x12a2df['query']);_0x30ba95[_0x0ab4('0x34')]=_[_0x0ab4('0x2b')](_0x30ba95[_0x0ab4('0x2d')],_0x30ba95[_0x0ab4('0x29')]);_0xaed2d[_0x0ab4('0x2c')]=_[_0x0ab4('0x2b')](_0x30ba95[_0x0ab4('0x2d')],qs[_0x0ab4('0x2e')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0xaed2d[_0x0ab4('0x2c')]=_0xaed2d[_0x0ab4('0x2c')][_0x0ab4('0x2f')]?_0xaed2d[_0x0ab4('0x2c')]:_0x30ba95[_0x0ab4('0x2d')];_0xaed2d[_0x0ab4('0x49')]=qs[_0x0ab4('0x32')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0xaed2d['where']=qs[_0x0ab4('0x34')](_[_0x0ab4('0x35')](_0x12a2df[_0x0ab4('0x29')],_0x30ba95[_0x0ab4('0x34')]));if(_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x36')]){_0xaed2d[_0x0ab4('0x33')]=_[_0x0ab4('0x39')](_0xaed2d['where'],{'$or':_[_0x0ab4('0x37')](_0xaed2d[_0x0ab4('0x2c')],function(_0x54ea92){var _0x48191f={};_0x48191f[_0x54ea92]={'$like':'%'+_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x36')]+'%'};return _0x48191f;})});}_0xaed2d=_['merge']({},_0xaed2d,_0x12a2df['options']);return _0x3f20de[_0x0ab4('0x4a')](_0xaed2d);}})['then'](function(_0x597d26){if(_0x597d26){_0x1eea3b=_0x597d26[_0x0ab4('0x2f')];if(!_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x30')](_0x0ab4('0x31'))){_0xaed2d[_0x0ab4('0x1d')]=qs[_0x0ab4('0x1d')](_0x12a2df[_0x0ab4('0x29')]['limit']);_0xaed2d[_0x0ab4('0x1a')]=qs[_0x0ab4('0x1a')](_0x12a2df[_0x0ab4('0x29')][_0x0ab4('0x1a')]);}return _0x3f20de[_0x0ab4('0x4a')](_0xaed2d);}})[_0x0ab4('0x21')](function(_0x4f1847){if(_0x4f1847){return _0x4f1847?{'count':_0x1eea3b,'rows':_0x4f1847}:null;}})[_0x0ab4('0x21')](respondWithResult(_0xb3bd1e,null))[_0x0ab4('0x3f')](handleError(_0xb3bd1e,null));};exports['addConfiguration']=function(_0x66364c,_0x5b41af,_0x410198){if(_0x66364c['body']['id']){delete _0x66364c[_0x0ab4('0x45')]['id'];}return db[_0x0ab4('0x3b')][_0x0ab4('0x47')]({'where':{'id':_0x66364c[_0x0ab4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b41af,null))['then'](function(_0x10dd5b){if(_0x10dd5b){_0x66364c[_0x0ab4('0x45')]['AccountId']=_0x10dd5b['id'];_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4b')]=integrations[_0x0ab4('0x4c')](_0x66364c['body'][_0x0ab4('0x4d')],_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x27')]);_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4e')]=integrations[_0x0ab4('0x4f')](_0x66364c[_0x0ab4('0x45')][_0x0ab4('0x4d')],_0x66364c['body']['type']);return db[_0x0ab4('0x48')][_0x0ab4('0x44')](_0x66364c[_0x0ab4('0x45')],{'include':[{'model':db[_0x0ab4('0x50')],'as':'Subjects'},{'model':db[_0x0ab4('0x50')],'as':'Descriptions'}]});}return null;})[_0x0ab4('0x21')](respondWithResult(_0x5b41af,null))[_0x0ab4('0x3f')](handleError(_0x5b41af,null));};exports[_0x0ab4('0x51')]=function(_0x3e5f11,_0x340129,_0x41b65f){var _0x46a008='';return db[_0x0ab4('0x3b')][_0x0ab4('0x47')]({'where':{'id':_0x3e5f11['params']['id']},'attributes':['id',_0x0ab4('0x52'),'password',_0x0ab4('0x53'),_0x0ab4('0x54'),_0x0ab4('0x55')]})[_0x0ab4('0x21')](handleEntityNotFound(_0x340129,null))[_0x0ab4('0x21')](function(_0x32282c){if(_0x32282c){_0x46a008=_0x32282c[_0x0ab4('0x55')];var _0xa3a87c=_0x46a008[_0x0ab4('0x56')](-0x1);if(_0xa3a87c==='/'){_0x46a008=_0x46a008['substring'](0x0,_0x46a008[_0x0ab4('0x57')](_0xa3a87c));}var _0x9b1a87={'method':'GET','uri':util[_0x0ab4('0x58')](_0x0ab4('0x59'),_0x46a008,_0x0ab4('0x5a')),'json':!![]};switch(_0x32282c['authType']){case _0x0ab4('0x5b'):_0x9b1a87[_0x0ab4('0x5c')]={'Authorization':util[_0x0ab4('0x58')](_0x0ab4('0x5d'),new Buffer(util['format']('%s:%s',_0x32282c[_0x0ab4('0x52')],_0x32282c[_0x0ab4('0x5b')]))[_0x0ab4('0x5e')](_0x0ab4('0x5f')))};break;case'token':_0x9b1a87[_0x0ab4('0x5c')]={'Authorization':util[_0x0ab4('0x58')](_0x0ab4('0x5d'),new Buffer(util['format']('%s/token:%s',_0x32282c[_0x0ab4('0x52')],_0x32282c[_0x0ab4('0x53')]))[_0x0ab4('0x5e')](_0x0ab4('0x5f')))};break;default:throw new db[(_0x0ab4('0x60'))][(_0x0ab4('0x61'))](_0x0ab4('0x62'));}return rp(_0x9b1a87);}})['then'](function(_0xe18f04){if(_0xe18f04){var _0x57ed73=['subject',_0x0ab4('0x63'),'group',_0x0ab4('0x64')];_[_0x0ab4('0x65')](_0xe18f04[_0x0ab4('0x5a')],function(_0x368573){return _0x57ed73[_0x0ab4('0x66')](_0x368573['type']);});return{'count':_0xe18f04['ticket_fields'][_0x0ab4('0x2f')],'rows':_[_0x0ab4('0x37')](_0xe18f04['ticket_fields'],function(_0x550cc5){return{'id':_0x550cc5['id'],'name':_0x550cc5[_0x0ab4('0x67')]>0x7?_0x550cc5[_0x0ab4('0x68')]:_0x550cc5['type'],'custom':_0x550cc5[_0x0ab4('0x67')]>0x7?!![]:![],'options':_0x550cc5[_0x0ab4('0x69')]?_0x550cc5[_0x0ab4('0x69')]:_0x550cc5['custom_field_options']?_0x550cc5[_0x0ab4('0x6a')]:[]};})};}})[_0x0ab4('0x21')](respondWithResult(_0x340129,null))[_0x0ab4('0x3f')](function(_0x1be1b9){var _0x4f745e=_0x3e5f11[_0x0ab4('0x29')][_0x0ab4('0x6b')]?0x1f4:_0x1be1b9[_0x0ab4('0x6c')]||0x1f4;logger[_0x0ab4('0x23')](_0x0ab4('0x6d'),_0x0ab4('0x51'),_0x4f745e,JSON[_0x0ab4('0x6e')](_0x1be1b9));delete _0x1be1b9[_0x0ab4('0x24')];if(_0x4f745e===0x191){_0x4f745e=0x190;}_0x340129[_0x0ab4('0x17')](_0x4f745e)[_0x0ab4('0x6f')](_0x3e5f11['query'][_0x0ab4('0x6b')]?{'message':_0x0ab4('0x70'),'statusCode':_0x1be1b9[_0x0ab4('0x6c')]}:_0x1be1b9);});}; \ No newline at end of file +var _0x57f8=['fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','channel','Descriptions','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','includes','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','end','error','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x57f8,0x198));var _0x857f=function(_0x3bea4,_0x56a1a5){_0x3bea4=_0x3bea4-0x0;var _0xf8e956=_0x57f8[_0x3bea4];return _0xf8e956;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e1eda,_0x2d5e26){_0x2d5e26=_0x2d5e26||0xcc;return function(_0x373333){if(_0x373333){return _0x2e1eda[_0x857f('0x1b')](_0x2d5e26);}return _0x2e1eda[_0x857f('0x1c')](_0x2d5e26)['end']();};}function respondWithResult(_0x4bc590,_0x3b09d9){_0x3b09d9=_0x3b09d9||0xc8;return function(_0x5f27b2){if(_0x5f27b2){return _0x4bc590[_0x857f('0x1c')](_0x3b09d9)['json'](_0x5f27b2);}};}function respondWithFilteredResult(_0x1d47bf,_0x134a4f){return function(_0x5c3a69){if(_0x5c3a69){var _0x27e8f1=typeof _0x134a4f[_0x857f('0x1d')]===_0x857f('0x1e')&&typeof _0x134a4f[_0x857f('0x1f')]===_0x857f('0x1e');var _0x38a3c2=_0x5c3a69[_0x857f('0x20')];var _0x429e23=_0x27e8f1?0x0:_0x134a4f[_0x857f('0x1d')];var _0x38a242=_0x27e8f1?_0x5c3a69[_0x857f('0x20')]:_0x134a4f['offset']+_0x134a4f[_0x857f('0x1f')];var _0x1e8fd4;if(_0x38a242>=_0x38a3c2){_0x38a242=_0x38a3c2;_0x1e8fd4=0xc8;}else{_0x1e8fd4=0xce;}_0x1d47bf['status'](_0x1e8fd4);return _0x1d47bf[_0x857f('0x21')](_0x857f('0x22'),_0x429e23+'-'+_0x38a242+'/'+_0x38a3c2)[_0x857f('0x23')](_0x5c3a69);}return null;};}function patchUpdates(_0x484035){return function(_0x57fa8b){try{jsonpatch[_0x857f('0x24')](_0x57fa8b,_0x484035,!![]);}catch(_0x8f278){return BPromise[_0x857f('0x25')](_0x8f278);}return _0x57fa8b['save']();};}function saveUpdates(_0x118237,_0x17a98e){return function(_0xdf8ac3){if(_0xdf8ac3){return _0xdf8ac3['update'](_0x118237)[_0x857f('0x26')](function(_0x14a8ce){return _0x14a8ce;});}return null;};}function removeEntity(_0x50bfb7,_0x3bc543){return function(_0x1a651f){if(_0x1a651f){return _0x1a651f[_0x857f('0x27')]()[_0x857f('0x26')](function(){_0x50bfb7[_0x857f('0x1c')](0xcc)[_0x857f('0x28')]();});}};}function handleEntityNotFound(_0x233a68,_0x2a89ba){return function(_0x181a9e){if(!_0x181a9e){_0x233a68[_0x857f('0x1b')](0x194);}return _0x181a9e;};}function handleError(_0x72f0aa,_0x4782ab){_0x4782ab=_0x4782ab||0x1f4;return function(_0x250731){logger[_0x857f('0x29')](_0x250731['stack']);if(_0x250731[_0x857f('0x2a')]){delete _0x250731[_0x857f('0x2a')];}_0x72f0aa[_0x857f('0x1c')](_0x4782ab)[_0x857f('0x2b')](_0x250731);};}exports['index']=function(_0x40c306,_0x57ceaa){var _0x1b405a={},_0x234048={},_0x45a37f={'count':0x0,'rows':[]};var _0x2ab814=_[_0x857f('0x2c')](db[_0x857f('0x2d')][_0x857f('0x2e')],function(_0xe79241){return{'name':_0xe79241[_0x857f('0x2f')],'type':_0xe79241[_0x857f('0x30')][_0x857f('0x31')]};});_0x234048[_0x857f('0x32')]=_[_0x857f('0x2c')](_0x2ab814,'name');_0x234048[_0x857f('0x33')]=_[_0x857f('0x34')](_0x40c306['query']);_0x234048[_0x857f('0x35')]=_[_0x857f('0x36')](_0x234048['model'],_0x234048[_0x857f('0x33')]);_0x1b405a[_0x857f('0x37')]=_['intersection'](_0x234048[_0x857f('0x32')],qs[_0x857f('0x38')](_0x40c306[_0x857f('0x33')][_0x857f('0x38')]));_0x1b405a['attributes']=_0x1b405a['attributes'][_0x857f('0x39')]?_0x1b405a[_0x857f('0x37')]:_0x234048['model'];if(!_0x40c306[_0x857f('0x33')]['hasOwnProperty'](_0x857f('0x3a'))){_0x1b405a[_0x857f('0x1f')]=qs[_0x857f('0x1f')](_0x40c306[_0x857f('0x33')][_0x857f('0x1f')]);_0x1b405a['offset']=qs['offset'](_0x40c306[_0x857f('0x33')]['offset']);}_0x1b405a[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x40c306[_0x857f('0x33')]['sort']);_0x1b405a[_0x857f('0x3d')]=qs[_0x857f('0x35')](_[_0x857f('0x3e')](_0x40c306[_0x857f('0x33')],_0x234048[_0x857f('0x35')]),_0x2ab814);if(_0x40c306[_0x857f('0x33')][_0x857f('0x3f')]){_0x1b405a['where']=_[_0x857f('0x40')](_0x1b405a[_0x857f('0x3d')],{'$or':_[_0x857f('0x2c')](_0x2ab814,function(_0x28ffe4){if(_0x28ffe4[_0x857f('0x30')]!==_0x857f('0x41')){var _0x447f28={};_0x447f28[_0x28ffe4['name']]={'$like':'%'+_0x40c306[_0x857f('0x33')][_0x857f('0x3f')]+'%'};return _0x447f28;}})});}_0x1b405a=_[_0x857f('0x40')]({},_0x1b405a,_0x40c306[_0x857f('0x42')]);var _0x196c95={'where':_0x1b405a[_0x857f('0x3d')]};return db['ZendeskAccount'][_0x857f('0x20')](_0x196c95)[_0x857f('0x26')](function(_0x167e9d){_0x45a37f[_0x857f('0x20')]=_0x167e9d;if(_0x40c306[_0x857f('0x33')][_0x857f('0x43')]){_0x1b405a[_0x857f('0x44')]=[{'all':!![]}];}return db[_0x857f('0x2d')]['findAll'](_0x1b405a);})[_0x857f('0x26')](function(_0x223095){_0x45a37f[_0x857f('0x45')]=_0x223095;return _0x45a37f;})[_0x857f('0x26')](respondWithFilteredResult(_0x57ceaa,_0x1b405a))[_0x857f('0x46')](handleError(_0x57ceaa,null));};exports[_0x857f('0x47')]=function(_0x374b9f,_0x42d922){var _0xb4d7c2={'raw':![],'where':{'id':_0x374b9f[_0x857f('0x48')]['id']}},_0x3e2079={};_0x3e2079[_0x857f('0x32')]=_[_0x857f('0x34')](db[_0x857f('0x2d')]['rawAttributes']);_0x3e2079[_0x857f('0x33')]=_['keys'](_0x374b9f[_0x857f('0x33')]);_0x3e2079[_0x857f('0x35')]=_[_0x857f('0x36')](_0x3e2079[_0x857f('0x32')],_0x3e2079[_0x857f('0x33')]);_0xb4d7c2[_0x857f('0x37')]=_[_0x857f('0x36')](_0x3e2079[_0x857f('0x32')],qs[_0x857f('0x38')](_0x374b9f[_0x857f('0x33')][_0x857f('0x38')]));_0xb4d7c2['attributes']=_0xb4d7c2['attributes'][_0x857f('0x39')]?_0xb4d7c2['attributes']:_0x3e2079[_0x857f('0x32')];if(_0x374b9f['query'][_0x857f('0x43')]){_0xb4d7c2[_0x857f('0x44')]=[{'all':!![]}];}_0xb4d7c2=_[_0x857f('0x40')]({},_0xb4d7c2,_0x374b9f[_0x857f('0x42')]);return db[_0x857f('0x2d')][_0x857f('0x49')](_0xb4d7c2)[_0x857f('0x26')](handleEntityNotFound(_0x42d922,null))[_0x857f('0x26')](respondWithResult(_0x42d922,null))['catch'](handleError(_0x42d922,null));};exports[_0x857f('0x4a')]=function(_0x3b431d,_0x3806d4){return db[_0x857f('0x2d')]['create'](_0x3b431d[_0x857f('0x4b')],{})[_0x857f('0x26')](respondWithResult(_0x3806d4,0xc9))[_0x857f('0x46')](handleError(_0x3806d4,null));};exports[_0x857f('0x4c')]=function(_0x67563,_0x53baae){if(_0x67563[_0x857f('0x4b')]['id']){delete _0x67563[_0x857f('0x4b')]['id'];}return db['ZendeskAccount'][_0x857f('0x49')]({'where':{'id':_0x67563[_0x857f('0x48')]['id']}})['then'](handleEntityNotFound(_0x53baae,null))[_0x857f('0x26')](saveUpdates(_0x67563['body'],null))[_0x857f('0x26')](respondWithResult(_0x53baae,null))[_0x857f('0x46')](handleError(_0x53baae,null));};exports[_0x857f('0x27')]=function(_0x2008d5,_0x58bf27){return db[_0x857f('0x2d')][_0x857f('0x49')]({'where':{'id':_0x2008d5[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x58bf27,null))[_0x857f('0x26')](removeEntity(_0x58bf27,null))['catch'](handleError(_0x58bf27,null));};exports[_0x857f('0x4d')]=function(_0x13ef75,_0x9d8273,_0x2670e6){var _0x3e24a5={};var _0x9edee5={};var _0x12712a;var _0x59164a;return db[_0x857f('0x2d')][_0x857f('0x4e')]({'where':{'id':_0x13ef75[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x9d8273,null))[_0x857f('0x26')](function(_0x153e4e){if(_0x153e4e){_0x12712a=_0x153e4e;_0x9edee5['model']=_[_0x857f('0x34')](db[_0x857f('0x4f')][_0x857f('0x2e')]);_0x9edee5[_0x857f('0x33')]=_[_0x857f('0x34')](_0x13ef75[_0x857f('0x33')]);_0x9edee5[_0x857f('0x35')]=_[_0x857f('0x36')](_0x9edee5['model'],_0x9edee5['query']);_0x3e24a5[_0x857f('0x37')]=_[_0x857f('0x36')](_0x9edee5[_0x857f('0x32')],qs[_0x857f('0x38')](_0x13ef75[_0x857f('0x33')][_0x857f('0x38')]));_0x3e24a5['attributes']=_0x3e24a5[_0x857f('0x37')][_0x857f('0x39')]?_0x3e24a5['attributes']:_0x9edee5[_0x857f('0x32')];_0x3e24a5['order']=qs[_0x857f('0x3c')](_0x13ef75[_0x857f('0x33')]['sort']);_0x3e24a5[_0x857f('0x3d')]=qs[_0x857f('0x35')](_[_0x857f('0x3e')](_0x13ef75[_0x857f('0x33')],_0x9edee5[_0x857f('0x35')]));if(_0x13ef75[_0x857f('0x33')][_0x857f('0x3f')]){_0x3e24a5[_0x857f('0x3d')]=_['merge'](_0x3e24a5[_0x857f('0x3d')],{'$or':_[_0x857f('0x2c')](_0x3e24a5[_0x857f('0x37')],function(_0x7cc7f7){var _0x3c612f={};_0x3c612f[_0x7cc7f7]={'$like':'%'+_0x13ef75[_0x857f('0x33')][_0x857f('0x3f')]+'%'};return _0x3c612f;})});}_0x3e24a5=_[_0x857f('0x40')]({},_0x3e24a5,_0x13ef75[_0x857f('0x42')]);return _0x12712a[_0x857f('0x4d')](_0x3e24a5);}})[_0x857f('0x26')](function(_0x5631fb){if(_0x5631fb){_0x59164a=_0x5631fb[_0x857f('0x39')];if(!_0x13ef75[_0x857f('0x33')][_0x857f('0x50')](_0x857f('0x3a'))){_0x3e24a5['limit']=qs[_0x857f('0x1f')](_0x13ef75['query'][_0x857f('0x1f')]);_0x3e24a5[_0x857f('0x1d')]=qs[_0x857f('0x1d')](_0x13ef75[_0x857f('0x33')]['offset']);}return _0x12712a['getConfigurations'](_0x3e24a5);}})[_0x857f('0x26')](function(_0x3ee981){if(_0x3ee981){return _0x3ee981?{'count':_0x59164a,'rows':_0x3ee981}:null;}})[_0x857f('0x26')](respondWithResult(_0x9d8273,null))['catch'](handleError(_0x9d8273,null));};exports[_0x857f('0x51')]=function(_0x5e42bc,_0x5b505,_0x1d6c1c){if(_0x5e42bc[_0x857f('0x4b')]['id']){delete _0x5e42bc['body']['id'];}return db['ZendeskAccount'][_0x857f('0x4e')]({'where':{'id':_0x5e42bc[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x5b505,null))[_0x857f('0x26')](function(_0x41f9d8){if(_0x41f9d8){_0x5e42bc[_0x857f('0x4b')][_0x857f('0x52')]=_0x41f9d8['id'];_0x5e42bc[_0x857f('0x4b')]['Subjects']=integrations['getSubjects'](_0x5e42bc[_0x857f('0x4b')][_0x857f('0x53')],_0x5e42bc[_0x857f('0x4b')][_0x857f('0x30')]);_0x5e42bc[_0x857f('0x4b')][_0x857f('0x54')]=integrations['getDescriptions'](_0x5e42bc[_0x857f('0x4b')][_0x857f('0x53')],_0x5e42bc[_0x857f('0x4b')][_0x857f('0x30')]);return db[_0x857f('0x4f')][_0x857f('0x4a')](_0x5e42bc[_0x857f('0x4b')],{'include':[{'model':db[_0x857f('0x55')],'as':_0x857f('0x56')},{'model':db[_0x857f('0x55')],'as':'Descriptions'}]});}return null;})[_0x857f('0x26')](respondWithResult(_0x5b505,null))['catch'](handleError(_0x5b505,null));};exports['getFields']=function(_0x35cd3e,_0x48e588,_0x5e5fd9){var _0x2e2cf3='';return db['ZendeskAccount'][_0x857f('0x4e')]({'where':{'id':_0x35cd3e['params']['id']},'attributes':['id',_0x857f('0x57'),_0x857f('0x58'),_0x857f('0x59'),_0x857f('0x5a'),'remoteUri']})[_0x857f('0x26')](handleEntityNotFound(_0x48e588,null))[_0x857f('0x26')](function(_0x3100aa){if(_0x3100aa){_0x2e2cf3=_0x3100aa[_0x857f('0x5b')];var _0x387aaa=_0x2e2cf3[_0x857f('0x5c')](-0x1);if(_0x387aaa==='/'){_0x2e2cf3=_0x2e2cf3[_0x857f('0x5d')](0x0,_0x2e2cf3['lastIndexOf'](_0x387aaa));}var _0x54e75d={'method':_0x857f('0x5e'),'uri':util[_0x857f('0x5f')](_0x857f('0x60'),_0x2e2cf3,_0x857f('0x61')),'json':!![]};switch(_0x3100aa[_0x857f('0x5a')]){case _0x857f('0x58'):_0x54e75d['headers']={'Authorization':util[_0x857f('0x5f')](_0x857f('0x62'),new Buffer(util[_0x857f('0x5f')]('%s:%s',_0x3100aa['username'],_0x3100aa[_0x857f('0x58')]))['toString']('base64'))};break;case _0x857f('0x59'):_0x54e75d[_0x857f('0x63')]={'Authorization':util['format'](_0x857f('0x62'),new Buffer(util[_0x857f('0x5f')]('%s/token:%s',_0x3100aa[_0x857f('0x57')],_0x3100aa[_0x857f('0x59')]))[_0x857f('0x64')](_0x857f('0x65')))};break;default:throw new db[(_0x857f('0x66'))][(_0x857f('0x67'))](_0x857f('0x68'));}return rp(_0x54e75d);}})[_0x857f('0x26')](function(_0x415fd3){if(_0x415fd3){var _0x465857=[_0x857f('0x69'),_0x857f('0x6a'),'group','assignee'];_['remove'](_0x415fd3[_0x857f('0x61')],function(_0x310b18){return _0x465857[_0x857f('0x6b')](_0x310b18[_0x857f('0x30')]);});return{'count':_0x415fd3[_0x857f('0x61')][_0x857f('0x39')],'rows':_[_0x857f('0x2c')](_0x415fd3['ticket_fields'],function(_0x40077e){return{'id':_0x40077e['id'],'name':_0x40077e['position']>0x7?_0x40077e[_0x857f('0x6c')]:_0x40077e['type'],'custom':_0x40077e['position']>0x7?!![]:![],'options':_0x40077e[_0x857f('0x6d')]?_0x40077e['system_field_options']:_0x40077e[_0x857f('0x6e')]?_0x40077e[_0x857f('0x6e')]:[]};})};}})[_0x857f('0x26')](respondWithResult(_0x48e588,null))['catch'](function(_0x45be3d){var _0x19456f=_0x35cd3e[_0x857f('0x33')][_0x857f('0x6f')]?0x1f4:_0x45be3d[_0x857f('0x70')]||0x1f4;logger[_0x857f('0x29')](_0x857f('0x71'),_0x857f('0x72'),_0x19456f,JSON[_0x857f('0x73')](_0x45be3d));delete _0x45be3d['name'];if(_0x19456f===0x191){_0x19456f=0x190;}_0x48e588[_0x857f('0x1c')](_0x19456f)[_0x857f('0x2b')](_0x35cd3e[_0x857f('0x33')][_0x857f('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x45be3d[_0x857f('0x70')]}:_0x45be3d);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index f171ef0..6b70826 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 _0x9f37=['int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x58c7ab,_0x38a623){var _0x5623f8=function(_0x64da82){while(--_0x64da82){_0x58c7ab['push'](_0x58c7ab['shift']());}};_0x5623f8(++_0x38a623);}(_0x9f37,0x91));var _0x79f3=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x9f37[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0x79f3('0x0'));var logger=require(_0x79f3('0x1'))(_0x79f3('0x2'));var moment=require(_0x79f3('0x3'));var BPromise=require(_0x79f3('0x4'));var rp=require(_0x79f3('0x5'));var fs=require('fs');var path=require(_0x79f3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79f3('0x7'));var integrations=require(_0x79f3('0x8'));module[_0x79f3('0x9')]=function(_0x44aaab,_0x195ac3){return _0x44aaab[_0x79f3('0xa')]('ZendeskAccount',attributes,{'tableName':_0x79f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8630=['exports','int_zendesk_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0xc06a96,_0x28ea82){var _0x280487=function(_0x117497){while(--_0x117497){_0xc06a96['push'](_0xc06a96['shift']());}};_0x280487(++_0x28ea82);}(_0x8630,0xb6));var _0x0863=function(_0x559b31,_0x34d0a4){_0x559b31=_0x559b31-0x0;var _0x487d27=_0x8630[_0x559b31];return _0x487d27;};'use strict';var _=require(_0x0863('0x0'));var util=require(_0x0863('0x1'));var logger=require(_0x0863('0x2'))(_0x0863('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0863('0x4'));var fs=require('fs');var path=require(_0x0863('0x5'));var rimraf=require(_0x0863('0x6'));var config=require(_0x0863('0x7'));var attributes=require(_0x0863('0x8'));var integrations=require(_0x0863('0x9'));module[_0x0863('0xa')]=function(_0x2845dc,_0x58fe0a){return _0x2845dc['define']('ZendeskAccount',attributes,{'tableName':_0x0863('0xb'),'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 7690606..f93377e 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 _0x0324=['GetZendeskAccount','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ZendeskAccount','findAll','options','where','map','model','attributes','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0324,0x90));var _0x4032=function(_0x14d8f5,_0x4978a4){_0x14d8f5=_0x14d8f5-0x0;var _0x627a11=_0x0324[_0x14d8f5];return _0x627a11;};'use strict';var _=require('lodash');var util=require(_0x4032('0x0'));var moment=require(_0x4032('0x1'));var BPromise=require(_0x4032('0x2'));var rs=require(_0x4032('0x3'));var fs=require('fs');var Redis=require(_0x4032('0x4'));var db=require(_0x4032('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4032('0x6'))(_0x4032('0x7'));var config=require(_0x4032('0x8'));var jayson=require(_0x4032('0x9'));var client=jayson[_0x4032('0xa')][_0x4032('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aa15d,_0x1adf42,_0x599965){return new BPromise(function(_0x523421,_0x500cdb){return client[_0x4032('0xc')](_0x4aa15d,_0x599965)[_0x4032('0xd')](function(_0x558e2c){logger[_0x4032('0xe')](_0x4032('0xf'),_0x1adf42,_0x4032('0x10'));logger[_0x4032('0x11')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1adf42,_0x4032('0x10'),JSON[_0x4032('0x12')](_0x558e2c));if(_0x558e2c['error']){if(_0x558e2c['error']['code']===0x1f4){logger[_0x4032('0x13')](_0x4032('0xf'),_0x1adf42,_0x558e2c[_0x4032('0x13')][_0x4032('0x14')]);return _0x500cdb(_0x558e2c[_0x4032('0x13')][_0x4032('0x14')]);}logger[_0x4032('0x13')](_0x4032('0xf'),_0x1adf42,_0x558e2c[_0x4032('0x13')][_0x4032('0x14')]);return _0x523421(_0x558e2c['error']['message']);}else{logger[_0x4032('0xe')](_0x4032('0xf'),_0x1adf42,_0x4032('0x10'));_0x523421(_0x558e2c[_0x4032('0x15')][_0x4032('0x14')]);}})[_0x4032('0x16')](function(_0x5bfb88){logger[_0x4032('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x1adf42,_0x5bfb88);_0x500cdb(_0x5bfb88);});});}exports['GetZendeskAccount']=function(_0x3b2036){var _0x2f5c4d=this;return new Promise(function(_0x7bcb48,_0xd029e6){return db[_0x4032('0x17')][_0x4032('0x18')]({'raw':_0x3b2036['options']?_0x3b2036[_0x4032('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3b2036['options']?_0x3b2036[_0x4032('0x19')][_0x4032('0x1a')]||null:null,'attributes':_0x3b2036[_0x4032('0x19')]?_0x3b2036[_0x4032('0x19')]['attributes']||null:null,'limit':_0x3b2036[_0x4032('0x19')]?_0x3b2036[_0x4032('0x19')]['limit']||null:null,'include':_0x3b2036[_0x4032('0x19')]?_0x3b2036[_0x4032('0x19')]['include']?_[_0x4032('0x1b')](_0x3b2036[_0x4032('0x19')]['include'],function(_0x15b3c9){return{'model':db[_0x15b3c9[_0x4032('0x1c')]],'as':_0x15b3c9['as'],'attributes':_0x15b3c9[_0x4032('0x1d')],'include':_0x15b3c9[_0x4032('0x1e')]?_[_0x4032('0x1b')](_0x15b3c9['include'],function(_0x5a3bb5){return{'model':db[_0x5a3bb5['model']],'as':_0x5a3bb5['as'],'attributes':_0x5a3bb5[_0x4032('0x1d')],'include':_0x5a3bb5[_0x4032('0x1e')]?_['map'](_0x5a3bb5['include'],function(_0x119648){return{'model':db[_0x119648[_0x4032('0x1c')]],'as':_0x119648['as'],'attributes':_0x119648[_0x4032('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4032('0xd')](function(_0x5a40a0){logger[_0x4032('0xe')](_0x4032('0x1f'),_0x3b2036);logger[_0x4032('0x11')](_0x4032('0x1f'),_0x3b2036,JSON[_0x4032('0x12')](_0x5a40a0));_0x7bcb48(_0x5a40a0);})['catch'](function(_0x1f1cca){logger[_0x4032('0x13')](_0x4032('0x1f'),_0x1f1cca[_0x4032('0x14')],_0x3b2036);_0xd029e6(_0x2f5c4d[_0x4032('0x13')](0x1f4,_0x1f1cca[_0x4032('0x14')]));});});};exports[_0x4032('0x20')]=function(_0x10c75a){var _0x38d817=this;return new Promise(function(_0x1b5abd,_0x2f3fae){return db[_0x4032('0x17')][_0x4032('0x21')]({'raw':_0x10c75a['options']?_0x10c75a[_0x4032('0x19')][_0x4032('0x22')]===undefined?!![]:![]:!![],'where':_0x10c75a[_0x4032('0x19')]?_0x10c75a['options']['where']||null:null,'attributes':_0x10c75a[_0x4032('0x19')]?_0x10c75a[_0x4032('0x19')][_0x4032('0x1d')]||null:null,'include':_0x10c75a[_0x4032('0x19')]?_0x10c75a[_0x4032('0x19')][_0x4032('0x1e')]?_[_0x4032('0x1b')](_0x10c75a[_0x4032('0x19')][_0x4032('0x1e')],function(_0x69fafa){return{'model':db[_0x69fafa[_0x4032('0x1c')]],'as':_0x69fafa['as'],'attributes':_0x69fafa[_0x4032('0x1d')],'include':_0x69fafa[_0x4032('0x1e')]?_[_0x4032('0x1b')](_0x69fafa[_0x4032('0x1e')],function(_0x119533){return{'model':db[_0x119533['model']],'as':_0x119533['as'],'attributes':_0x119533['attributes'],'include':_0x119533[_0x4032('0x1e')]?_[_0x4032('0x1b')](_0x119533[_0x4032('0x1e')],function(_0x30cb19){return{'model':db[_0x30cb19[_0x4032('0x1c')]],'as':_0x30cb19['as'],'attributes':_0x30cb19[_0x4032('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4032('0xd')](function(_0x5c12d1){logger['info'](_0x4032('0x20'),_0x10c75a);logger[_0x4032('0x11')](_0x4032('0x20'),_0x10c75a,JSON[_0x4032('0x12')](_0x5c12d1));_0x1b5abd(_0x5c12d1);})[_0x4032('0x16')](function(_0x427e28){logger[_0x4032('0x13')](_0x4032('0x20'),_0x427e28['message'],_0x10c75a);_0x2f3fae(_0x38d817[_0x4032('0x13')](0x1f4,_0x427e28[_0x4032('0x14')]));});});}; \ No newline at end of file +var _0xc3cd=['info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetZendeskAccount','ZendeskAccount','options','raw','where','limit','include','map','attributes','model','then','stringify','catch','ShowZendeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x457bfc,_0x6292dd){var _0x294c16=function(_0x13a7df){while(--_0x13a7df){_0x457bfc['push'](_0x457bfc['shift']());}};_0x294c16(++_0x6292dd);}(_0xc3cd,0x1c7));var _0xdc3c=function(_0x4a0a4c,_0x74a4f9){_0x4a0a4c=_0x4a0a4c-0x0;var _0x1a945c=_0xc3cd[_0x4a0a4c];return _0x1a945c;};'use strict';var _=require('lodash');var util=require(_0xdc3c('0x0'));var moment=require(_0xdc3c('0x1'));var BPromise=require(_0xdc3c('0x2'));var rs=require(_0xdc3c('0x3'));var fs=require('fs');var Redis=require(_0xdc3c('0x4'));var db=require(_0xdc3c('0x5'))['db'];var utils=require(_0xdc3c('0x6'));var logger=require('../../config/logger')(_0xdc3c('0x7'));var config=require(_0xdc3c('0x8'));var jayson=require(_0xdc3c('0x9'));var client=jayson[_0xdc3c('0xa')][_0xdc3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59d4a1,_0x53c157,_0x3e0a04){return new BPromise(function(_0x2d1a89,_0x102836){return client[_0xdc3c('0xc')](_0x59d4a1,_0x3e0a04)['then'](function(_0x12f86a){logger[_0xdc3c('0xd')](_0xdc3c('0xe'),_0x53c157,_0xdc3c('0xf'));logger[_0xdc3c('0x10')](_0xdc3c('0x11'),_0x53c157,_0xdc3c('0xf'),JSON['stringify'](_0x12f86a));if(_0x12f86a[_0xdc3c('0x12')]){if(_0x12f86a[_0xdc3c('0x12')][_0xdc3c('0x13')]===0x1f4){logger[_0xdc3c('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x53c157,_0x12f86a[_0xdc3c('0x12')][_0xdc3c('0x14')]);return _0x102836(_0x12f86a[_0xdc3c('0x12')][_0xdc3c('0x14')]);}logger[_0xdc3c('0x12')](_0xdc3c('0xe'),_0x53c157,_0x12f86a['error'][_0xdc3c('0x14')]);return _0x2d1a89(_0x12f86a[_0xdc3c('0x12')][_0xdc3c('0x14')]);}else{logger[_0xdc3c('0xd')](_0xdc3c('0xe'),_0x53c157,_0xdc3c('0xf'));_0x2d1a89(_0x12f86a[_0xdc3c('0x15')]['message']);}})['catch'](function(_0x572111){logger[_0xdc3c('0x12')](_0xdc3c('0xe'),_0x53c157,_0x572111);_0x102836(_0x572111);});});}exports[_0xdc3c('0x16')]=function(_0x45074f){var _0x53f008=this;return new Promise(function(_0x1dd1aa,_0x4235e3){return db[_0xdc3c('0x17')]['findAll']({'raw':_0x45074f[_0xdc3c('0x18')]?_0x45074f[_0xdc3c('0x18')][_0xdc3c('0x19')]===undefined?!![]:![]:!![],'where':_0x45074f[_0xdc3c('0x18')]?_0x45074f['options'][_0xdc3c('0x1a')]||null:null,'attributes':_0x45074f[_0xdc3c('0x18')]?_0x45074f['options']['attributes']||null:null,'limit':_0x45074f[_0xdc3c('0x18')]?_0x45074f[_0xdc3c('0x18')][_0xdc3c('0x1b')]||null:null,'include':_0x45074f[_0xdc3c('0x18')]?_0x45074f['options'][_0xdc3c('0x1c')]?_[_0xdc3c('0x1d')](_0x45074f['options'][_0xdc3c('0x1c')],function(_0x9522d3){return{'model':db[_0x9522d3['model']],'as':_0x9522d3['as'],'attributes':_0x9522d3[_0xdc3c('0x1e')],'include':_0x9522d3[_0xdc3c('0x1c')]?_[_0xdc3c('0x1d')](_0x9522d3['include'],function(_0x4cf8b7){return{'model':db[_0x4cf8b7[_0xdc3c('0x1f')]],'as':_0x4cf8b7['as'],'attributes':_0x4cf8b7['attributes'],'include':_0x4cf8b7[_0xdc3c('0x1c')]?_['map'](_0x4cf8b7[_0xdc3c('0x1c')],function(_0xcccbf6){return{'model':db[_0xcccbf6['model']],'as':_0xcccbf6['as'],'attributes':_0xcccbf6['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc3c('0x20')](function(_0x43b3e3){logger[_0xdc3c('0xd')](_0xdc3c('0x16'),_0x45074f);logger[_0xdc3c('0x10')](_0xdc3c('0x16'),_0x45074f,JSON[_0xdc3c('0x21')](_0x43b3e3));_0x1dd1aa(_0x43b3e3);})[_0xdc3c('0x22')](function(_0x49a229){logger[_0xdc3c('0x12')](_0xdc3c('0x16'),_0x49a229[_0xdc3c('0x14')],_0x45074f);_0x4235e3(_0x53f008['error'](0x1f4,_0x49a229[_0xdc3c('0x14')]));});});};exports[_0xdc3c('0x23')]=function(_0x65db40){var _0x31870a=this;return new Promise(function(_0x2786f9,_0x4ac0e5){return db[_0xdc3c('0x17')]['find']({'raw':_0x65db40[_0xdc3c('0x18')]?_0x65db40['options'][_0xdc3c('0x19')]===undefined?!![]:![]:!![],'where':_0x65db40[_0xdc3c('0x18')]?_0x65db40[_0xdc3c('0x18')][_0xdc3c('0x1a')]||null:null,'attributes':_0x65db40[_0xdc3c('0x18')]?_0x65db40[_0xdc3c('0x18')][_0xdc3c('0x1e')]||null:null,'include':_0x65db40[_0xdc3c('0x18')]?_0x65db40[_0xdc3c('0x18')][_0xdc3c('0x1c')]?_[_0xdc3c('0x1d')](_0x65db40['options'][_0xdc3c('0x1c')],function(_0x2d5df2){return{'model':db[_0x2d5df2['model']],'as':_0x2d5df2['as'],'attributes':_0x2d5df2['attributes'],'include':_0x2d5df2[_0xdc3c('0x1c')]?_[_0xdc3c('0x1d')](_0x2d5df2[_0xdc3c('0x1c')],function(_0x31a931){return{'model':db[_0x31a931[_0xdc3c('0x1f')]],'as':_0x31a931['as'],'attributes':_0x31a931[_0xdc3c('0x1e')],'include':_0x31a931[_0xdc3c('0x1c')]?_[_0xdc3c('0x1d')](_0x31a931[_0xdc3c('0x1c')],function(_0x21fb31){return{'model':db[_0x21fb31[_0xdc3c('0x1f')]],'as':_0x21fb31['as'],'attributes':_0x21fb31['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc3c('0x20')](function(_0x1ed142){logger['info']('ShowZendeskAccount',_0x65db40);logger['debug'](_0xdc3c('0x23'),_0x65db40,JSON['stringify'](_0x1ed142));_0x2786f9(_0x1ed142);})['catch'](function(_0x29a8b3){logger[_0xdc3c('0x12')]('ShowZendeskAccount',_0x29a8b3['message'],_0x65db40);_0x4ac0e5(_0x31870a[_0xdc3c('0x12')](0x1f4,_0x29a8b3[_0xdc3c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2526ff3..3f77396 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 _0xb10b=['getFields','/:id/subjects','/:id/descriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields'];(function(_0x6f9549,_0x4de03b){var _0x3374ac=function(_0x7b95ac){while(--_0x7b95ac){_0x6f9549['push'](_0x6f9549['shift']());}};_0x3374ac(++_0x4de03b);}(_0xb10b,0x12a));var _0xbb10=function(_0x2826d9,_0x28f60f){_0x2826d9=_0x2826d9-0x0;var _0x96122b=_0xb10b[_0x2826d9];return _0x96122b;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getDescriptions']);router[_0xbb10('0x9')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x12')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x12')]('/:id/tags',auth[_0xbb10('0xb')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x15')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x19')]);module['exports']=router; \ No newline at end of file +var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3d2580,_0x5bcf59){_0x3d2580=_0x3d2580-0x0;var _0x1bed34=_0xbdb7[_0x3d2580];return _0x1bed34;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 184519e..84aab86 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 _0x5be5=['exports','STRING','sequelize'];(function(_0xf8b0b7,_0x353c58){var _0x39cc21=function(_0x560727){while(--_0x560727){_0xf8b0b7['push'](_0xf8b0b7['shift']());}};_0x39cc21(++_0x353c58);}(_0x5be5,0x14c));var _0x55be=function(_0x439614,_0x4a3f3d){_0x439614=_0x439614-0x0;var _0x4a7560=_0x5be5[_0x439614];return _0x4a7560;};'use strict';var Sequelize=require(_0x55be('0x0'));module[_0x55be('0x1')]={'name':{'type':Sequelize[_0x55be('0x2')]},'description':{'type':Sequelize[_0x55be('0x2')]}}; \ No newline at end of file +var _0x2811=['sequelize','exports','STRING'];(function(_0x135b81,_0x39db4b){var _0x5d8a8e=function(_0x3a7614){while(--_0x3a7614){_0x135b81['push'](_0x135b81['shift']());}};_0x5d8a8e(++_0x39db4b);}(_0x2811,0x120));var _0x1281=function(_0x27a709,_0x1adf5e){_0x27a709=_0x27a709-0x0;var _0x45918b=_0x2811[_0x27a709];return _0x45918b;};'use strict';var Sequelize=require(_0x1281('0x0'));module[_0x1281('0x1')]={'name':{'type':Sequelize[_0x1281('0x2')]},'description':{'type':Sequelize[_0x1281('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b5fc97b..4663d68 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 _0xa6e9=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','getFields','ZendeskField','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','query','filters','intersection','model','attributes'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xa6e9,0x1e2));var _0x9a6e=function(_0x29d1d0,_0x417dba){_0x29d1d0=_0x29d1d0-0x0;var _0x94dc9b=_0xa6e9[_0x29d1d0];return _0x94dc9b;};'use strict';var emlformat=require(_0x9a6e('0x0'));var rimraf=require(_0x9a6e('0x1'));var zipdir=require(_0x9a6e('0x2'));var jsonpatch=require(_0x9a6e('0x3'));var rp=require(_0x9a6e('0x4'));var moment=require(_0x9a6e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9a6e('0x6'));var util=require(_0x9a6e('0x7'));var path=require(_0x9a6e('0x8'));var sox=require(_0x9a6e('0x9'));var csv=require(_0x9a6e('0xa'));var ejs=require(_0x9a6e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a6e('0xc'));var squel=require(_0x9a6e('0xd'));var crypto=require('crypto');var jsforce=require(_0x9a6e('0xe'));var deskjs=require(_0x9a6e('0xf'));var toCsv=require(_0x9a6e('0xa'));var querystring=require('querystring');var Papa=require(_0x9a6e('0x10'));var Redis=require(_0x9a6e('0x11'));var authService=require(_0x9a6e('0x12'));var qs=require(_0x9a6e('0x13'));var as=require(_0x9a6e('0x14'));var hardwareService=require(_0x9a6e('0x15'));var logger=require(_0x9a6e('0x16'))(_0x9a6e('0x17'));var utils=require(_0x9a6e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9a6e('0x19'));var db=require(_0x9a6e('0x1a'))['db'];function respondWithStatusCode(_0xb6ecb,_0x18f143){_0x18f143=_0x18f143||0xcc;return function(_0x19bbfc){if(_0x19bbfc){return _0xb6ecb[_0x9a6e('0x1b')](_0x18f143);}return _0xb6ecb['status'](_0x18f143)[_0x9a6e('0x1c')]();};}function respondWithResult(_0x4c0a95,_0x1143b3){_0x1143b3=_0x1143b3||0xc8;return function(_0x1b403c){if(_0x1b403c){return _0x4c0a95[_0x9a6e('0x1d')](_0x1143b3)[_0x9a6e('0x1e')](_0x1b403c);}};}function respondWithFilteredResult(_0x3c62e7,_0x55155e){return function(_0x3e77be){if(_0x3e77be){var _0x48cafe=typeof _0x55155e['offset']===_0x9a6e('0x1f')&&typeof _0x55155e[_0x9a6e('0x20')]==='undefined';var _0x2b9356=_0x3e77be[_0x9a6e('0x21')];var _0x5de5cf=_0x48cafe?0x0:_0x55155e[_0x9a6e('0x22')];var _0x3493d4=_0x48cafe?_0x3e77be[_0x9a6e('0x21')]:_0x55155e[_0x9a6e('0x22')]+_0x55155e[_0x9a6e('0x20')];var _0x43793d;if(_0x3493d4>=_0x2b9356){_0x3493d4=_0x2b9356;_0x43793d=0xc8;}else{_0x43793d=0xce;}_0x3c62e7[_0x9a6e('0x1d')](_0x43793d);return _0x3c62e7[_0x9a6e('0x23')](_0x9a6e('0x24'),_0x5de5cf+'-'+_0x3493d4+'/'+_0x2b9356)[_0x9a6e('0x1e')](_0x3e77be);}return null;};}function patchUpdates(_0x53f03e){return function(_0x3b2b80){try{jsonpatch[_0x9a6e('0x25')](_0x3b2b80,_0x53f03e,!![]);}catch(_0x436277){return BPromise[_0x9a6e('0x26')](_0x436277);}return _0x3b2b80[_0x9a6e('0x27')]();};}function saveUpdates(_0xe4c858,_0x37da73){return function(_0x3f854e){if(_0x3f854e){return _0x3f854e[_0x9a6e('0x28')](_0xe4c858)[_0x9a6e('0x29')](function(_0x489902){return _0x489902;});}return null;};}function removeEntity(_0xc808ad,_0x4d00d5){return function(_0x5e6b35){if(_0x5e6b35){return _0x5e6b35[_0x9a6e('0x2a')]()[_0x9a6e('0x29')](function(){_0xc808ad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4adacd,_0x3eed57){return function(_0x5578b0){if(!_0x5578b0){_0x4adacd[_0x9a6e('0x1b')](0x194);}return _0x5578b0;};}function handleError(_0x4d0856,_0x3a2969){_0x3a2969=_0x3a2969||0x1f4;return function(_0x5a9fda){logger[_0x9a6e('0x2b')](_0x5a9fda[_0x9a6e('0x2c')]);if(_0x5a9fda[_0x9a6e('0x2d')]){delete _0x5a9fda[_0x9a6e('0x2d')];}_0x4d0856['status'](_0x3a2969)[_0x9a6e('0x2e')](_0x5a9fda);};}exports[_0x9a6e('0x2f')]=function(_0xdcc28,_0x51d3bf){var _0x2a6e3d={},_0xd6d721={},_0x203aeb={'count':0x0,'rows':[]};var _0x3a7b2f=_[_0x9a6e('0x30')](db[_0x9a6e('0x31')][_0x9a6e('0x32')],function(_0x22a541){return{'name':_0x22a541[_0x9a6e('0x33')],'type':_0x22a541['type'][_0x9a6e('0x34')]};});_0xd6d721['model']=_['map'](_0x3a7b2f,_0x9a6e('0x2d'));_0xd6d721[_0x9a6e('0x35')]=_['keys'](_0xdcc28[_0x9a6e('0x35')]);_0xd6d721[_0x9a6e('0x36')]=_[_0x9a6e('0x37')](_0xd6d721[_0x9a6e('0x38')],_0xd6d721[_0x9a6e('0x35')]);_0x2a6e3d[_0x9a6e('0x39')]=_[_0x9a6e('0x37')](_0xd6d721[_0x9a6e('0x38')],qs[_0x9a6e('0x3a')](_0xdcc28[_0x9a6e('0x35')]['fields']));_0x2a6e3d[_0x9a6e('0x39')]=_0x2a6e3d['attributes'][_0x9a6e('0x3b')]?_0x2a6e3d['attributes']:_0xd6d721[_0x9a6e('0x38')];if(!_0xdcc28[_0x9a6e('0x35')][_0x9a6e('0x3c')]('nolimit')){_0x2a6e3d[_0x9a6e('0x20')]=qs[_0x9a6e('0x20')](_0xdcc28[_0x9a6e('0x35')][_0x9a6e('0x20')]);_0x2a6e3d['offset']=qs[_0x9a6e('0x22')](_0xdcc28['query'][_0x9a6e('0x22')]);}_0x2a6e3d[_0x9a6e('0x3d')]=qs[_0x9a6e('0x3e')](_0xdcc28[_0x9a6e('0x35')][_0x9a6e('0x3e')]);_0x2a6e3d[_0x9a6e('0x3f')]=qs[_0x9a6e('0x36')](_[_0x9a6e('0x40')](_0xdcc28[_0x9a6e('0x35')],_0xd6d721[_0x9a6e('0x36')]),_0x3a7b2f);if(_0xdcc28[_0x9a6e('0x35')][_0x9a6e('0x41')]){_0x2a6e3d[_0x9a6e('0x3f')]=_[_0x9a6e('0x42')](_0x2a6e3d[_0x9a6e('0x3f')],{'$or':_[_0x9a6e('0x30')](_0x3a7b2f,function(_0xe7804f){if(_0xe7804f[_0x9a6e('0x43')]!==_0x9a6e('0x44')){var _0x17dfe4={};_0x17dfe4[_0xe7804f[_0x9a6e('0x2d')]]={'$like':'%'+_0xdcc28[_0x9a6e('0x35')]['filter']+'%'};return _0x17dfe4;}})});}_0x2a6e3d=_[_0x9a6e('0x42')]({},_0x2a6e3d,_0xdcc28[_0x9a6e('0x45')]);var _0x2025a6={'where':_0x2a6e3d['where']};return db['ZendeskConfiguration'][_0x9a6e('0x21')](_0x2025a6)[_0x9a6e('0x29')](function(_0x14c766){_0x203aeb[_0x9a6e('0x21')]=_0x14c766;if(_0xdcc28['query'][_0x9a6e('0x46')]){_0x2a6e3d['include']=[{'all':!![]}];}return db[_0x9a6e('0x31')][_0x9a6e('0x47')](_0x2a6e3d);})[_0x9a6e('0x29')](function(_0x2838cf){_0x203aeb[_0x9a6e('0x48')]=_0x2838cf;return _0x203aeb;})[_0x9a6e('0x29')](respondWithFilteredResult(_0x51d3bf,_0x2a6e3d))[_0x9a6e('0x49')](handleError(_0x51d3bf,null));};exports[_0x9a6e('0x4a')]=function(_0x120344,_0x24915c){var _0x45b546={'raw':![],'where':{'id':_0x120344['params']['id']}},_0x84554f={};_0x84554f[_0x9a6e('0x38')]=_[_0x9a6e('0x4b')](db[_0x9a6e('0x31')][_0x9a6e('0x32')]);_0x84554f['query']=_[_0x9a6e('0x4b')](_0x120344[_0x9a6e('0x35')]);_0x84554f[_0x9a6e('0x36')]=_[_0x9a6e('0x37')](_0x84554f[_0x9a6e('0x38')],_0x84554f[_0x9a6e('0x35')]);_0x45b546[_0x9a6e('0x39')]=_[_0x9a6e('0x37')](_0x84554f[_0x9a6e('0x38')],qs['fields'](_0x120344['query'][_0x9a6e('0x3a')]));_0x45b546[_0x9a6e('0x39')]=_0x45b546[_0x9a6e('0x39')][_0x9a6e('0x3b')]?_0x45b546[_0x9a6e('0x39')]:_0x84554f[_0x9a6e('0x38')];if(_0x120344[_0x9a6e('0x35')][_0x9a6e('0x46')]){_0x45b546[_0x9a6e('0x4c')]=[{'all':!![]}];}_0x45b546=_[_0x9a6e('0x42')]({},_0x45b546,_0x120344[_0x9a6e('0x45')]);return db[_0x9a6e('0x31')][_0x9a6e('0x4d')](_0x45b546)[_0x9a6e('0x29')](handleEntityNotFound(_0x24915c,null))[_0x9a6e('0x29')](respondWithResult(_0x24915c,null))[_0x9a6e('0x49')](handleError(_0x24915c,null));};exports[_0x9a6e('0x4e')]=function(_0x44244e,_0x186f2a){return db[_0x9a6e('0x31')][_0x9a6e('0x4e')](_0x44244e['body'],{})['then'](respondWithResult(_0x186f2a,0xc9))[_0x9a6e('0x49')](handleError(_0x186f2a,null));};exports['update']=function(_0x194eec,_0x5bdcc7){if(_0x194eec[_0x9a6e('0x4f')]['id']){delete _0x194eec['body']['id'];}return db[_0x9a6e('0x31')][_0x9a6e('0x4d')]({'where':{'id':_0x194eec[_0x9a6e('0x50')]['id']}})[_0x9a6e('0x29')](handleEntityNotFound(_0x5bdcc7,null))[_0x9a6e('0x29')](saveUpdates(_0x194eec['body'],null))[_0x9a6e('0x29')](respondWithResult(_0x5bdcc7,null))[_0x9a6e('0x49')](handleError(_0x5bdcc7,null));};exports[_0x9a6e('0x2a')]=function(_0x1b0587,_0xd9987b){return db['ZendeskConfiguration'][_0x9a6e('0x4d')]({'where':{'id':_0x1b0587[_0x9a6e('0x50')]['id']}})[_0x9a6e('0x29')](handleEntityNotFound(_0xd9987b,null))[_0x9a6e('0x29')](removeEntity(_0xd9987b,null))[_0x9a6e('0x49')](handleError(_0xd9987b,null));};exports[_0x9a6e('0x51')]=function(_0x5e6ab6,_0x340e11,_0x5dea60){var _0x56499b={};var _0xe1853d={};var _0xc56810;var _0x226a40;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5e6ab6[_0x9a6e('0x50')]['id']}})[_0x9a6e('0x29')](handleEntityNotFound(_0x340e11,null))[_0x9a6e('0x29')](function(_0x3acab0){if(_0x3acab0){_0xc56810=_0x3acab0;_0xe1853d[_0x9a6e('0x38')]=_[_0x9a6e('0x4b')](db[_0x9a6e('0x52')]['rawAttributes']);_0xe1853d[_0x9a6e('0x35')]=_[_0x9a6e('0x4b')](_0x5e6ab6['query']);_0xe1853d[_0x9a6e('0x36')]=_['intersection'](_0xe1853d[_0x9a6e('0x38')],_0xe1853d[_0x9a6e('0x35')]);_0x56499b[_0x9a6e('0x39')]=_[_0x9a6e('0x37')](_0xe1853d[_0x9a6e('0x38')],qs[_0x9a6e('0x3a')](_0x5e6ab6[_0x9a6e('0x35')]['fields']));_0x56499b['attributes']=_0x56499b[_0x9a6e('0x39')][_0x9a6e('0x3b')]?_0x56499b['attributes']:_0xe1853d[_0x9a6e('0x38')];_0x56499b['order']=qs[_0x9a6e('0x3e')](_0x5e6ab6['query']['sort']);_0x56499b['where']=qs['filters'](_[_0x9a6e('0x40')](_0x5e6ab6[_0x9a6e('0x35')],_0xe1853d[_0x9a6e('0x36')]));if(_0x5e6ab6['query'][_0x9a6e('0x41')]){_0x56499b['where']=_['merge'](_0x56499b[_0x9a6e('0x3f')],{'$or':_[_0x9a6e('0x30')](_0x56499b[_0x9a6e('0x39')],function(_0x48a225){var _0x169255={};_0x169255[_0x48a225]={'$like':'%'+_0x5e6ab6[_0x9a6e('0x35')]['filter']+'%'};return _0x169255;})});}_0x56499b=_[_0x9a6e('0x42')]({},_0x56499b,_0x5e6ab6[_0x9a6e('0x45')]);return _0xc56810[_0x9a6e('0x51')](_0x56499b);}})[_0x9a6e('0x29')](function(_0x56a122){if(_0x56a122){_0x226a40=_0x56a122[_0x9a6e('0x3b')];if(!_0x5e6ab6[_0x9a6e('0x35')][_0x9a6e('0x3c')](_0x9a6e('0x53'))){_0x56499b['limit']=qs[_0x9a6e('0x20')](_0x5e6ab6[_0x9a6e('0x35')][_0x9a6e('0x20')]);_0x56499b[_0x9a6e('0x22')]=qs[_0x9a6e('0x22')](_0x5e6ab6['query']['offset']);}return _0xc56810[_0x9a6e('0x51')](_0x56499b);}})[_0x9a6e('0x29')](function(_0x57c518){if(_0x57c518){return _0x57c518?{'count':_0x226a40,'rows':_0x57c518}:null;}})[_0x9a6e('0x29')](respondWithResult(_0x340e11,null))['catch'](handleError(_0x340e11,null));};exports[_0x9a6e('0x54')]=function(_0x1dbadc,_0x4c1edd,_0x9a684){var _0x1a23bb={};var _0x4d3698={};var _0x5afab0;var _0x2fee5c;return db['ZendeskConfiguration'][_0x9a6e('0x55')]({'where':{'id':_0x1dbadc[_0x9a6e('0x50')]['id']}})['then'](handleEntityNotFound(_0x4c1edd,null))[_0x9a6e('0x29')](function(_0x1efa08){if(_0x1efa08){_0x5afab0=_0x1efa08;_0x4d3698['model']=_[_0x9a6e('0x4b')](db[_0x9a6e('0x52')][_0x9a6e('0x32')]);_0x4d3698[_0x9a6e('0x35')]=_['keys'](_0x1dbadc['query']);_0x4d3698[_0x9a6e('0x36')]=_[_0x9a6e('0x37')](_0x4d3698[_0x9a6e('0x38')],_0x4d3698[_0x9a6e('0x35')]);_0x1a23bb[_0x9a6e('0x39')]=_[_0x9a6e('0x37')](_0x4d3698[_0x9a6e('0x38')],qs[_0x9a6e('0x3a')](_0x1dbadc[_0x9a6e('0x35')][_0x9a6e('0x3a')]));_0x1a23bb[_0x9a6e('0x39')]=_0x1a23bb[_0x9a6e('0x39')][_0x9a6e('0x3b')]?_0x1a23bb[_0x9a6e('0x39')]:_0x4d3698[_0x9a6e('0x38')];_0x1a23bb[_0x9a6e('0x3d')]=qs[_0x9a6e('0x3e')](_0x1dbadc[_0x9a6e('0x35')][_0x9a6e('0x3e')]);_0x1a23bb[_0x9a6e('0x3f')]=qs['filters'](_[_0x9a6e('0x40')](_0x1dbadc[_0x9a6e('0x35')],_0x4d3698[_0x9a6e('0x36')]));if(_0x1dbadc[_0x9a6e('0x35')][_0x9a6e('0x41')]){_0x1a23bb[_0x9a6e('0x3f')]=_[_0x9a6e('0x42')](_0x1a23bb[_0x9a6e('0x3f')],{'$or':_[_0x9a6e('0x30')](_0x1a23bb[_0x9a6e('0x39')],function(_0x34b97d){var _0x53f812={};_0x53f812[_0x34b97d]={'$like':'%'+_0x1dbadc[_0x9a6e('0x35')][_0x9a6e('0x41')]+'%'};return _0x53f812;})});}_0x1a23bb=_[_0x9a6e('0x42')]({},_0x1a23bb,_0x1dbadc['options']);return _0x5afab0[_0x9a6e('0x54')](_0x1a23bb);}})[_0x9a6e('0x29')](function(_0x2def32){if(_0x2def32){_0x2fee5c=_0x2def32[_0x9a6e('0x3b')];if(!_0x1dbadc[_0x9a6e('0x35')]['hasOwnProperty'](_0x9a6e('0x53'))){_0x1a23bb[_0x9a6e('0x20')]=qs['limit'](_0x1dbadc[_0x9a6e('0x35')]['limit']);_0x1a23bb[_0x9a6e('0x22')]=qs[_0x9a6e('0x22')](_0x1dbadc[_0x9a6e('0x35')][_0x9a6e('0x22')]);}return _0x5afab0['getSubjects'](_0x1a23bb);}})[_0x9a6e('0x29')](function(_0xf43065){if(_0xf43065){return _0xf43065?{'count':_0x2fee5c,'rows':_0xf43065}:null;}})[_0x9a6e('0x29')](respondWithResult(_0x4c1edd,null))['catch'](handleError(_0x4c1edd,null));};exports[_0x9a6e('0x56')]=function(_0x494508,_0x5563a5,_0x182dec){var _0x192342={};var _0x38d1db={};var _0x2ddf0b;var _0x4708c4;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x494508['params']['id']}})[_0x9a6e('0x29')](handleEntityNotFound(_0x5563a5,null))['then'](function(_0x403c84){if(_0x403c84){_0x2ddf0b=_0x403c84;_0x38d1db[_0x9a6e('0x38')]=_[_0x9a6e('0x4b')](db['ZendeskField']['rawAttributes']);_0x38d1db[_0x9a6e('0x35')]=_[_0x9a6e('0x4b')](_0x494508[_0x9a6e('0x35')]);_0x38d1db[_0x9a6e('0x36')]=_['intersection'](_0x38d1db[_0x9a6e('0x38')],_0x38d1db['query']);_0x192342['attributes']=_[_0x9a6e('0x37')](_0x38d1db['model'],qs[_0x9a6e('0x3a')](_0x494508[_0x9a6e('0x35')][_0x9a6e('0x3a')]));_0x192342[_0x9a6e('0x39')]=_0x192342[_0x9a6e('0x39')][_0x9a6e('0x3b')]?_0x192342[_0x9a6e('0x39')]:_0x38d1db[_0x9a6e('0x38')];_0x192342[_0x9a6e('0x3d')]=qs[_0x9a6e('0x3e')](_0x494508[_0x9a6e('0x35')][_0x9a6e('0x3e')]);_0x192342[_0x9a6e('0x3f')]=qs['filters'](_[_0x9a6e('0x40')](_0x494508[_0x9a6e('0x35')],_0x38d1db[_0x9a6e('0x36')]));if(_0x494508[_0x9a6e('0x35')][_0x9a6e('0x41')]){_0x192342[_0x9a6e('0x3f')]=_[_0x9a6e('0x42')](_0x192342[_0x9a6e('0x3f')],{'$or':_[_0x9a6e('0x30')](_0x192342['attributes'],function(_0x244f6a){var _0x378e06={};_0x378e06[_0x244f6a]={'$like':'%'+_0x494508[_0x9a6e('0x35')][_0x9a6e('0x41')]+'%'};return _0x378e06;})});}_0x192342=_[_0x9a6e('0x42')]({},_0x192342,_0x494508['options']);return _0x2ddf0b[_0x9a6e('0x56')](_0x192342);}})[_0x9a6e('0x29')](function(_0x17f956){if(_0x17f956){_0x4708c4=_0x17f956[_0x9a6e('0x3b')];if(!_0x494508['query']['hasOwnProperty']('nolimit')){_0x192342[_0x9a6e('0x20')]=qs['limit'](_0x494508[_0x9a6e('0x35')][_0x9a6e('0x20')]);_0x192342[_0x9a6e('0x22')]=qs[_0x9a6e('0x22')](_0x494508[_0x9a6e('0x35')][_0x9a6e('0x22')]);}return _0x2ddf0b[_0x9a6e('0x56')](_0x192342);}})[_0x9a6e('0x29')](function(_0x24de4a){if(_0x24de4a){return _0x24de4a?{'count':_0x4708c4,'rows':_0x24de4a}:null;}})[_0x9a6e('0x29')](respondWithResult(_0x5563a5,null))[_0x9a6e('0x49')](handleError(_0x5563a5,null));};exports[_0x9a6e('0x57')]=function(_0x2b7b5f,_0x43910a,_0x300863){var _0x5f1e90={};var _0x58f750={};var _0x532908;var _0x405c83;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2b7b5f[_0x9a6e('0x50')]['id']}})[_0x9a6e('0x29')](handleEntityNotFound(_0x43910a,null))['then'](function(_0x1ff519){if(_0x1ff519){_0x532908=_0x1ff519;_0x58f750['model']=_[_0x9a6e('0x4b')](db[_0x9a6e('0x58')][_0x9a6e('0x32')]);_0x58f750[_0x9a6e('0x35')]=_[_0x9a6e('0x4b')](_0x2b7b5f[_0x9a6e('0x35')]);_0x58f750[_0x9a6e('0x36')]=_[_0x9a6e('0x37')](_0x58f750[_0x9a6e('0x38')],_0x58f750[_0x9a6e('0x35')]);_0x5f1e90[_0x9a6e('0x39')]=_[_0x9a6e('0x37')](_0x58f750[_0x9a6e('0x38')],qs['fields'](_0x2b7b5f[_0x9a6e('0x35')][_0x9a6e('0x3a')]));_0x5f1e90[_0x9a6e('0x39')]=_0x5f1e90[_0x9a6e('0x39')]['length']?_0x5f1e90[_0x9a6e('0x39')]:_0x58f750[_0x9a6e('0x38')];_0x5f1e90['order']=qs[_0x9a6e('0x3e')](_0x2b7b5f['query']['sort']);_0x5f1e90[_0x9a6e('0x3f')]=qs[_0x9a6e('0x36')](_[_0x9a6e('0x40')](_0x2b7b5f[_0x9a6e('0x35')],_0x58f750['filters']));if(_0x2b7b5f[_0x9a6e('0x35')]['filter']){_0x5f1e90[_0x9a6e('0x3f')]=_['merge'](_0x5f1e90[_0x9a6e('0x3f')],{'$or':_[_0x9a6e('0x30')](_0x5f1e90[_0x9a6e('0x39')],function(_0x289efe){var _0x24fe1c={};_0x24fe1c[_0x289efe]={'$like':'%'+_0x2b7b5f[_0x9a6e('0x35')][_0x9a6e('0x41')]+'%'};return _0x24fe1c;})});}_0x5f1e90=_['merge']({},_0x5f1e90,_0x2b7b5f[_0x9a6e('0x45')]);return _0x532908[_0x9a6e('0x57')](_0x5f1e90);}})[_0x9a6e('0x29')](function(_0x143765){if(_0x143765){_0x405c83=_0x143765[_0x9a6e('0x3b')];if(!_0x2b7b5f['query'][_0x9a6e('0x3c')](_0x9a6e('0x53'))){_0x5f1e90[_0x9a6e('0x20')]=qs['limit'](_0x2b7b5f[_0x9a6e('0x35')][_0x9a6e('0x20')]);_0x5f1e90[_0x9a6e('0x22')]=qs['offset'](_0x2b7b5f['query'][_0x9a6e('0x22')]);}return _0x532908[_0x9a6e('0x57')](_0x5f1e90);}})['then'](function(_0x1a5ade){if(_0x1a5ade){return _0x1a5ade?{'count':_0x405c83,'rows':_0x1a5ade}:null;}})[_0x9a6e('0x29')](respondWithResult(_0x43910a,null))[_0x9a6e('0x49')](handleError(_0x43910a,null));};exports['setTags']=function(_0x591a69,_0x4603de,_0x3ae821){if(_0x591a69[_0x9a6e('0x4f')]['id']){delete _0x591a69[_0x9a6e('0x4f')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x591a69['params']['id']}})[_0x9a6e('0x29')](handleEntityNotFound(_0x4603de,null))[_0x9a6e('0x29')](function(_0x33cd3a){if(_0x33cd3a){return _0x33cd3a['setTags'](_0x591a69['body'][_0x9a6e('0x59')]||[]);}return null;})[_0x9a6e('0x29')](respondWithResult(_0x4603de,null))['catch'](handleError(_0x4603de,null));}; \ No newline at end of file +var _0x91a0=['keys','options','catch','create','body','update','find','getFields','findOne','ZendeskField','order','sort','getSubjects','getDescriptions','pick','Tag','getTags','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','where','filter','merge','includeAll','findAll','rows','show','params'];(function(_0x1602db,_0x3f9684){var _0x3d7dc5=function(_0x539f8d){while(--_0x539f8d){_0x1602db['push'](_0x1602db['shift']());}};_0x3d7dc5(++_0x3f9684);}(_0x91a0,0x173));var _0x091a=function(_0x12fcbd,_0x884804){_0x12fcbd=_0x12fcbd-0x0;var _0x28ec2a=_0x91a0[_0x12fcbd];return _0x28ec2a;};'use strict';var emlformat=require(_0x091a('0x0'));var rimraf=require(_0x091a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x091a('0x2'));var moment=require(_0x091a('0x3'));var BPromise=require(_0x091a('0x4'));var Mustache=require(_0x091a('0x5'));var util=require(_0x091a('0x6'));var path=require(_0x091a('0x7'));var sox=require(_0x091a('0x8'));var csv=require(_0x091a('0x9'));var ejs=require(_0x091a('0xa'));var fs=require('fs');var fs_extra=require(_0x091a('0xb'));var _=require('lodash');var squel=require(_0x091a('0xc'));var crypto=require(_0x091a('0xd'));var jsforce=require(_0x091a('0xe'));var deskjs=require(_0x091a('0xf'));var toCsv=require(_0x091a('0x9'));var querystring=require(_0x091a('0x10'));var Papa=require(_0x091a('0x11'));var Redis=require(_0x091a('0x12'));var authService=require(_0x091a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x091a('0x14'));var hardwareService=require(_0x091a('0x15'));var logger=require(_0x091a('0x16'))(_0x091a('0x17'));var utils=require(_0x091a('0x18'));var config=require(_0x091a('0x19'));var licenseUtil=require(_0x091a('0x1a'));var db=require(_0x091a('0x1b'))['db'];function respondWithStatusCode(_0x1478b9,_0x1a0699){_0x1a0699=_0x1a0699||0xcc;return function(_0x47b4da){if(_0x47b4da){return _0x1478b9[_0x091a('0x1c')](_0x1a0699);}return _0x1478b9[_0x091a('0x1d')](_0x1a0699)['end']();};}function respondWithResult(_0x29e4f3,_0x47ebb7){_0x47ebb7=_0x47ebb7||0xc8;return function(_0x1aae77){if(_0x1aae77){return _0x29e4f3[_0x091a('0x1d')](_0x47ebb7)[_0x091a('0x1e')](_0x1aae77);}};}function respondWithFilteredResult(_0x20cbb4,_0x379dc1){return function(_0x10ebfc){if(_0x10ebfc){var _0x5660fd=typeof _0x379dc1[_0x091a('0x1f')]===_0x091a('0x20')&&typeof _0x379dc1[_0x091a('0x21')]===_0x091a('0x20');var _0x10bfa8=_0x10ebfc[_0x091a('0x22')];var _0x2eb354=_0x5660fd?0x0:_0x379dc1[_0x091a('0x1f')];var _0x229e17=_0x5660fd?_0x10ebfc[_0x091a('0x22')]:_0x379dc1[_0x091a('0x1f')]+_0x379dc1[_0x091a('0x21')];var _0x3f3497;if(_0x229e17>=_0x10bfa8){_0x229e17=_0x10bfa8;_0x3f3497=0xc8;}else{_0x3f3497=0xce;}_0x20cbb4[_0x091a('0x1d')](_0x3f3497);return _0x20cbb4[_0x091a('0x23')](_0x091a('0x24'),_0x2eb354+'-'+_0x229e17+'/'+_0x10bfa8)['json'](_0x10ebfc);}return null;};}function patchUpdates(_0x339c18){return function(_0x4b2f09){try{jsonpatch[_0x091a('0x25')](_0x4b2f09,_0x339c18,!![]);}catch(_0x4f2c68){return BPromise[_0x091a('0x26')](_0x4f2c68);}return _0x4b2f09[_0x091a('0x27')]();};}function saveUpdates(_0x7eb9cd,_0x33f03c){return function(_0x184181){if(_0x184181){return _0x184181['update'](_0x7eb9cd)[_0x091a('0x28')](function(_0x540c48){return _0x540c48;});}return null;};}function removeEntity(_0x8a20e2,_0x309dee){return function(_0x4fadd4){if(_0x4fadd4){return _0x4fadd4[_0x091a('0x29')]()[_0x091a('0x28')](function(){_0x8a20e2[_0x091a('0x1d')](0xcc)[_0x091a('0x2a')]();});}};}function handleEntityNotFound(_0x5954a8,_0x1d1125){return function(_0x200b69){if(!_0x200b69){_0x5954a8[_0x091a('0x1c')](0x194);}return _0x200b69;};}function handleError(_0x4b75d1,_0x2d7e5d){_0x2d7e5d=_0x2d7e5d||0x1f4;return function(_0x13a5b5){logger['error'](_0x13a5b5[_0x091a('0x2b')]);if(_0x13a5b5[_0x091a('0x2c')]){delete _0x13a5b5['name'];}_0x4b75d1[_0x091a('0x1d')](_0x2d7e5d)['send'](_0x13a5b5);};}exports[_0x091a('0x2d')]=function(_0x366be5,_0x361db1){var _0x4c4948={},_0x531774={},_0x10a9be={'count':0x0,'rows':[]};var _0x593862=_[_0x091a('0x2e')](db[_0x091a('0x2f')][_0x091a('0x30')],function(_0x4ea1d7){return{'name':_0x4ea1d7[_0x091a('0x31')],'type':_0x4ea1d7[_0x091a('0x32')][_0x091a('0x33')]};});_0x531774['model']=_['map'](_0x593862,_0x091a('0x2c'));_0x531774[_0x091a('0x34')]=_['keys'](_0x366be5['query']);_0x531774[_0x091a('0x35')]=_[_0x091a('0x36')](_0x531774['model'],_0x531774[_0x091a('0x34')]);_0x4c4948[_0x091a('0x37')]=_[_0x091a('0x36')](_0x531774[_0x091a('0x38')],qs[_0x091a('0x39')](_0x366be5[_0x091a('0x34')]['fields']));_0x4c4948[_0x091a('0x37')]=_0x4c4948['attributes'][_0x091a('0x3a')]?_0x4c4948['attributes']:_0x531774[_0x091a('0x38')];if(!_0x366be5[_0x091a('0x34')][_0x091a('0x3b')](_0x091a('0x3c'))){_0x4c4948[_0x091a('0x21')]=qs['limit'](_0x366be5[_0x091a('0x34')]['limit']);_0x4c4948[_0x091a('0x1f')]=qs[_0x091a('0x1f')](_0x366be5[_0x091a('0x34')][_0x091a('0x1f')]);}_0x4c4948['order']=qs['sort'](_0x366be5['query']['sort']);_0x4c4948[_0x091a('0x3d')]=qs[_0x091a('0x35')](_['pick'](_0x366be5[_0x091a('0x34')],_0x531774[_0x091a('0x35')]),_0x593862);if(_0x366be5[_0x091a('0x34')][_0x091a('0x3e')]){_0x4c4948[_0x091a('0x3d')]=_[_0x091a('0x3f')](_0x4c4948[_0x091a('0x3d')],{'$or':_['map'](_0x593862,function(_0x4e3064){if(_0x4e3064[_0x091a('0x32')]!=='VIRTUAL'){var _0x3cbb08={};_0x3cbb08[_0x4e3064[_0x091a('0x2c')]]={'$like':'%'+_0x366be5[_0x091a('0x34')][_0x091a('0x3e')]+'%'};return _0x3cbb08;}})});}_0x4c4948=_[_0x091a('0x3f')]({},_0x4c4948,_0x366be5['options']);var _0x4eba8a={'where':_0x4c4948['where']};return db['ZendeskConfiguration']['count'](_0x4eba8a)['then'](function(_0x8ab879){_0x10a9be[_0x091a('0x22')]=_0x8ab879;if(_0x366be5[_0x091a('0x34')][_0x091a('0x40')]){_0x4c4948['include']=[{'all':!![]}];}return db[_0x091a('0x2f')][_0x091a('0x41')](_0x4c4948);})[_0x091a('0x28')](function(_0x4c42c0){_0x10a9be[_0x091a('0x42')]=_0x4c42c0;return _0x10a9be;})[_0x091a('0x28')](respondWithFilteredResult(_0x361db1,_0x4c4948))['catch'](handleError(_0x361db1,null));};exports[_0x091a('0x43')]=function(_0x1655cf,_0x431be7){var _0x31f1b8={'raw':![],'where':{'id':_0x1655cf[_0x091a('0x44')]['id']}},_0x3447cf={};_0x3447cf[_0x091a('0x38')]=_[_0x091a('0x45')](db[_0x091a('0x2f')][_0x091a('0x30')]);_0x3447cf[_0x091a('0x34')]=_['keys'](_0x1655cf['query']);_0x3447cf[_0x091a('0x35')]=_[_0x091a('0x36')](_0x3447cf[_0x091a('0x38')],_0x3447cf[_0x091a('0x34')]);_0x31f1b8[_0x091a('0x37')]=_[_0x091a('0x36')](_0x3447cf[_0x091a('0x38')],qs[_0x091a('0x39')](_0x1655cf[_0x091a('0x34')][_0x091a('0x39')]));_0x31f1b8[_0x091a('0x37')]=_0x31f1b8[_0x091a('0x37')]['length']?_0x31f1b8['attributes']:_0x3447cf[_0x091a('0x38')];if(_0x1655cf[_0x091a('0x34')][_0x091a('0x40')]){_0x31f1b8['include']=[{'all':!![]}];}_0x31f1b8=_[_0x091a('0x3f')]({},_0x31f1b8,_0x1655cf[_0x091a('0x46')]);return db[_0x091a('0x2f')]['find'](_0x31f1b8)[_0x091a('0x28')](handleEntityNotFound(_0x431be7,null))['then'](respondWithResult(_0x431be7,null))[_0x091a('0x47')](handleError(_0x431be7,null));};exports[_0x091a('0x48')]=function(_0x55e2ee,_0x5b6cbd){return db['ZendeskConfiguration'][_0x091a('0x48')](_0x55e2ee[_0x091a('0x49')],{})[_0x091a('0x28')](respondWithResult(_0x5b6cbd,0xc9))['catch'](handleError(_0x5b6cbd,null));};exports[_0x091a('0x4a')]=function(_0xce0c0a,_0x59167a){if(_0xce0c0a[_0x091a('0x49')]['id']){delete _0xce0c0a[_0x091a('0x49')]['id'];}return db[_0x091a('0x2f')][_0x091a('0x4b')]({'where':{'id':_0xce0c0a[_0x091a('0x44')]['id']}})[_0x091a('0x28')](handleEntityNotFound(_0x59167a,null))[_0x091a('0x28')](saveUpdates(_0xce0c0a[_0x091a('0x49')],null))[_0x091a('0x28')](respondWithResult(_0x59167a,null))[_0x091a('0x47')](handleError(_0x59167a,null));};exports[_0x091a('0x29')]=function(_0x4e1dfc,_0x5c8798){return db['ZendeskConfiguration'][_0x091a('0x4b')]({'where':{'id':_0x4e1dfc[_0x091a('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c8798,null))[_0x091a('0x28')](removeEntity(_0x5c8798,null))[_0x091a('0x47')](handleError(_0x5c8798,null));};exports[_0x091a('0x4c')]=function(_0x276611,_0x503cfc,_0x59d975){var _0x27f100={};var _0x15c771={};var _0x3800d5;var _0x1a29e2;return db[_0x091a('0x2f')][_0x091a('0x4d')]({'where':{'id':_0x276611[_0x091a('0x44')]['id']}})[_0x091a('0x28')](handleEntityNotFound(_0x503cfc,null))[_0x091a('0x28')](function(_0x14aae6){if(_0x14aae6){_0x3800d5=_0x14aae6;_0x15c771[_0x091a('0x38')]=_[_0x091a('0x45')](db[_0x091a('0x4e')]['rawAttributes']);_0x15c771[_0x091a('0x34')]=_[_0x091a('0x45')](_0x276611[_0x091a('0x34')]);_0x15c771[_0x091a('0x35')]=_['intersection'](_0x15c771['model'],_0x15c771[_0x091a('0x34')]);_0x27f100[_0x091a('0x37')]=_[_0x091a('0x36')](_0x15c771[_0x091a('0x38')],qs[_0x091a('0x39')](_0x276611[_0x091a('0x34')]['fields']));_0x27f100[_0x091a('0x37')]=_0x27f100[_0x091a('0x37')][_0x091a('0x3a')]?_0x27f100[_0x091a('0x37')]:_0x15c771[_0x091a('0x38')];_0x27f100[_0x091a('0x4f')]=qs['sort'](_0x276611['query'][_0x091a('0x50')]);_0x27f100[_0x091a('0x3d')]=qs[_0x091a('0x35')](_['pick'](_0x276611[_0x091a('0x34')],_0x15c771[_0x091a('0x35')]));if(_0x276611[_0x091a('0x34')][_0x091a('0x3e')]){_0x27f100[_0x091a('0x3d')]=_[_0x091a('0x3f')](_0x27f100[_0x091a('0x3d')],{'$or':_[_0x091a('0x2e')](_0x27f100[_0x091a('0x37')],function(_0xba9194){var _0x511936={};_0x511936[_0xba9194]={'$like':'%'+_0x276611[_0x091a('0x34')][_0x091a('0x3e')]+'%'};return _0x511936;})});}_0x27f100=_[_0x091a('0x3f')]({},_0x27f100,_0x276611[_0x091a('0x46')]);return _0x3800d5[_0x091a('0x4c')](_0x27f100);}})[_0x091a('0x28')](function(_0x747ab6){if(_0x747ab6){_0x1a29e2=_0x747ab6[_0x091a('0x3a')];if(!_0x276611['query'][_0x091a('0x3b')]('nolimit')){_0x27f100[_0x091a('0x21')]=qs[_0x091a('0x21')](_0x276611['query']['limit']);_0x27f100[_0x091a('0x1f')]=qs['offset'](_0x276611[_0x091a('0x34')][_0x091a('0x1f')]);}return _0x3800d5['getFields'](_0x27f100);}})['then'](function(_0x2c8440){if(_0x2c8440){return _0x2c8440?{'count':_0x1a29e2,'rows':_0x2c8440}:null;}})[_0x091a('0x28')](respondWithResult(_0x503cfc,null))[_0x091a('0x47')](handleError(_0x503cfc,null));};exports[_0x091a('0x51')]=function(_0x4ce90a,_0x16c1e7,_0xa1ca73){var _0x4a9334={};var _0x17457b={};var _0x194847;var _0x1152c7;return db[_0x091a('0x2f')][_0x091a('0x4d')]({'where':{'id':_0x4ce90a[_0x091a('0x44')]['id']}})[_0x091a('0x28')](handleEntityNotFound(_0x16c1e7,null))[_0x091a('0x28')](function(_0x4ff66c){if(_0x4ff66c){_0x194847=_0x4ff66c;_0x17457b[_0x091a('0x38')]=_[_0x091a('0x45')](db['ZendeskField'][_0x091a('0x30')]);_0x17457b[_0x091a('0x34')]=_[_0x091a('0x45')](_0x4ce90a['query']);_0x17457b['filters']=_['intersection'](_0x17457b['model'],_0x17457b['query']);_0x4a9334['attributes']=_[_0x091a('0x36')](_0x17457b[_0x091a('0x38')],qs[_0x091a('0x39')](_0x4ce90a[_0x091a('0x34')]['fields']));_0x4a9334['attributes']=_0x4a9334[_0x091a('0x37')][_0x091a('0x3a')]?_0x4a9334[_0x091a('0x37')]:_0x17457b[_0x091a('0x38')];_0x4a9334[_0x091a('0x4f')]=qs[_0x091a('0x50')](_0x4ce90a['query'][_0x091a('0x50')]);_0x4a9334[_0x091a('0x3d')]=qs[_0x091a('0x35')](_['pick'](_0x4ce90a['query'],_0x17457b[_0x091a('0x35')]));if(_0x4ce90a['query']['filter']){_0x4a9334[_0x091a('0x3d')]=_[_0x091a('0x3f')](_0x4a9334['where'],{'$or':_['map'](_0x4a9334[_0x091a('0x37')],function(_0x56eb26){var _0x10a2e4={};_0x10a2e4[_0x56eb26]={'$like':'%'+_0x4ce90a[_0x091a('0x34')]['filter']+'%'};return _0x10a2e4;})});}_0x4a9334=_['merge']({},_0x4a9334,_0x4ce90a[_0x091a('0x46')]);return _0x194847[_0x091a('0x51')](_0x4a9334);}})[_0x091a('0x28')](function(_0x3d3d26){if(_0x3d3d26){_0x1152c7=_0x3d3d26[_0x091a('0x3a')];if(!_0x4ce90a[_0x091a('0x34')][_0x091a('0x3b')](_0x091a('0x3c'))){_0x4a9334['limit']=qs['limit'](_0x4ce90a['query'][_0x091a('0x21')]);_0x4a9334[_0x091a('0x1f')]=qs['offset'](_0x4ce90a[_0x091a('0x34')]['offset']);}return _0x194847['getSubjects'](_0x4a9334);}})[_0x091a('0x28')](function(_0x1fcb78){if(_0x1fcb78){return _0x1fcb78?{'count':_0x1152c7,'rows':_0x1fcb78}:null;}})[_0x091a('0x28')](respondWithResult(_0x16c1e7,null))[_0x091a('0x47')](handleError(_0x16c1e7,null));};exports[_0x091a('0x52')]=function(_0x29bddb,_0x178e06,_0x3f5b9b){var _0x4105a9={};var _0x40c3cc={};var _0x326c9b;var _0x396246;return db['ZendeskConfiguration'][_0x091a('0x4d')]({'where':{'id':_0x29bddb[_0x091a('0x44')]['id']}})['then'](handleEntityNotFound(_0x178e06,null))[_0x091a('0x28')](function(_0x1b13f8){if(_0x1b13f8){_0x326c9b=_0x1b13f8;_0x40c3cc[_0x091a('0x38')]=_[_0x091a('0x45')](db[_0x091a('0x4e')]['rawAttributes']);_0x40c3cc[_0x091a('0x34')]=_[_0x091a('0x45')](_0x29bddb[_0x091a('0x34')]);_0x40c3cc[_0x091a('0x35')]=_['intersection'](_0x40c3cc[_0x091a('0x38')],_0x40c3cc['query']);_0x4105a9['attributes']=_[_0x091a('0x36')](_0x40c3cc[_0x091a('0x38')],qs[_0x091a('0x39')](_0x29bddb[_0x091a('0x34')][_0x091a('0x39')]));_0x4105a9['attributes']=_0x4105a9['attributes'][_0x091a('0x3a')]?_0x4105a9[_0x091a('0x37')]:_0x40c3cc[_0x091a('0x38')];_0x4105a9[_0x091a('0x4f')]=qs[_0x091a('0x50')](_0x29bddb['query'][_0x091a('0x50')]);_0x4105a9['where']=qs['filters'](_[_0x091a('0x53')](_0x29bddb[_0x091a('0x34')],_0x40c3cc[_0x091a('0x35')]));if(_0x29bddb['query'][_0x091a('0x3e')]){_0x4105a9[_0x091a('0x3d')]=_['merge'](_0x4105a9[_0x091a('0x3d')],{'$or':_[_0x091a('0x2e')](_0x4105a9['attributes'],function(_0xc5c01c){var _0x2d3137={};_0x2d3137[_0xc5c01c]={'$like':'%'+_0x29bddb['query'][_0x091a('0x3e')]+'%'};return _0x2d3137;})});}_0x4105a9=_[_0x091a('0x3f')]({},_0x4105a9,_0x29bddb[_0x091a('0x46')]);return _0x326c9b[_0x091a('0x52')](_0x4105a9);}})[_0x091a('0x28')](function(_0x322df5){if(_0x322df5){_0x396246=_0x322df5['length'];if(!_0x29bddb[_0x091a('0x34')]['hasOwnProperty'](_0x091a('0x3c'))){_0x4105a9[_0x091a('0x21')]=qs['limit'](_0x29bddb['query'][_0x091a('0x21')]);_0x4105a9[_0x091a('0x1f')]=qs[_0x091a('0x1f')](_0x29bddb['query'][_0x091a('0x1f')]);}return _0x326c9b['getDescriptions'](_0x4105a9);}})[_0x091a('0x28')](function(_0x31f408){if(_0x31f408){return _0x31f408?{'count':_0x396246,'rows':_0x31f408}:null;}})[_0x091a('0x28')](respondWithResult(_0x178e06,null))[_0x091a('0x47')](handleError(_0x178e06,null));};exports['getTags']=function(_0x45dbff,_0x3ff5a1,_0x2bb8b9){var _0x38f186={};var _0x43b30b={};var _0x4a77e3;var _0x4f22a0;return db[_0x091a('0x2f')][_0x091a('0x4d')]({'where':{'id':_0x45dbff[_0x091a('0x44')]['id']}})[_0x091a('0x28')](handleEntityNotFound(_0x3ff5a1,null))['then'](function(_0x56e958){if(_0x56e958){_0x4a77e3=_0x56e958;_0x43b30b[_0x091a('0x38')]=_[_0x091a('0x45')](db[_0x091a('0x54')][_0x091a('0x30')]);_0x43b30b[_0x091a('0x34')]=_[_0x091a('0x45')](_0x45dbff[_0x091a('0x34')]);_0x43b30b[_0x091a('0x35')]=_['intersection'](_0x43b30b[_0x091a('0x38')],_0x43b30b[_0x091a('0x34')]);_0x38f186[_0x091a('0x37')]=_[_0x091a('0x36')](_0x43b30b['model'],qs[_0x091a('0x39')](_0x45dbff[_0x091a('0x34')][_0x091a('0x39')]));_0x38f186[_0x091a('0x37')]=_0x38f186[_0x091a('0x37')][_0x091a('0x3a')]?_0x38f186['attributes']:_0x43b30b[_0x091a('0x38')];_0x38f186[_0x091a('0x4f')]=qs['sort'](_0x45dbff[_0x091a('0x34')][_0x091a('0x50')]);_0x38f186[_0x091a('0x3d')]=qs[_0x091a('0x35')](_[_0x091a('0x53')](_0x45dbff['query'],_0x43b30b['filters']));if(_0x45dbff[_0x091a('0x34')]['filter']){_0x38f186[_0x091a('0x3d')]=_[_0x091a('0x3f')](_0x38f186['where'],{'$or':_[_0x091a('0x2e')](_0x38f186[_0x091a('0x37')],function(_0x58228d){var _0x54a913={};_0x54a913[_0x58228d]={'$like':'%'+_0x45dbff[_0x091a('0x34')][_0x091a('0x3e')]+'%'};return _0x54a913;})});}_0x38f186=_['merge']({},_0x38f186,_0x45dbff[_0x091a('0x46')]);return _0x4a77e3[_0x091a('0x55')](_0x38f186);}})[_0x091a('0x28')](function(_0x6c7462){if(_0x6c7462){_0x4f22a0=_0x6c7462[_0x091a('0x3a')];if(!_0x45dbff['query']['hasOwnProperty'](_0x091a('0x3c'))){_0x38f186[_0x091a('0x21')]=qs[_0x091a('0x21')](_0x45dbff[_0x091a('0x34')]['limit']);_0x38f186['offset']=qs[_0x091a('0x1f')](_0x45dbff['query'][_0x091a('0x1f')]);}return _0x4a77e3['getTags'](_0x38f186);}})['then'](function(_0xe199b0){if(_0xe199b0){return _0xe199b0?{'count':_0x4f22a0,'rows':_0xe199b0}:null;}})[_0x091a('0x28')](respondWithResult(_0x3ff5a1,null))[_0x091a('0x47')](handleError(_0x3ff5a1,null));};exports['setTags']=function(_0x2eb310,_0x18d237,_0x17a9b3){if(_0x2eb310['body']['id']){delete _0x2eb310[_0x091a('0x49')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2eb310[_0x091a('0x44')]['id']}})['then'](handleEntityNotFound(_0x18d237,null))[_0x091a('0x28')](function(_0x218b2b){if(_0x218b2b){return _0x218b2b[_0x091a('0x56')](_0x2eb310[_0x091a('0x49')][_0x091a('0x57')]||[]);}return null;})['then'](respondWithResult(_0x18d237,null))[_0x091a('0x47')](handleError(_0x18d237,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 7c8fef5..f8f12bd 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 _0xefda=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x512daf,_0xa44da6){var _0x19247d=function(_0x21cdc1){while(--_0x21cdc1){_0x512daf['push'](_0x512daf['shift']());}};_0x19247d(++_0xa44da6);}(_0xefda,0x96));var _0xaefd=function(_0x3de098,_0xc18acf){_0x3de098=_0x3de098-0x0;var _0xaecd70=_0xefda[_0x3de098];return _0xaecd70;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x282b=['moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0xe6d063,_0x47ae75){var _0x15d836=function(_0x469a5d){while(--_0x469a5d){_0xe6d063['push'](_0xe6d063['shift']());}};_0x15d836(++_0x47ae75);}(_0x282b,0xec));var _0xb282=function(_0x1761f5,_0x75bdff){_0x1761f5=_0x1761f5-0x0;var _0x4c3c43=_0x282b[_0x1761f5];return _0x4c3c43;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var logger=require(_0xb282('0x2'))(_0xb282('0x3'));var moment=require(_0xb282('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb282('0x5'));var rimraf=require('rimraf');var config=require(_0xb282('0x6'));var attributes=require(_0xb282('0x7'));module[_0xb282('0x8')]=function(_0x1dd19b,_0x3cad41){return _0x1dd19b[_0xb282('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','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 77c5765..fab4fc6 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 _0xacec=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message'];(function(_0x4eafa5,_0x2779a4){var _0x300d7e=function(_0x2b416e){while(--_0x2b416e){_0x4eafa5['push'](_0x4eafa5['shift']());}};_0x300d7e(++_0x2779a4);}(_0xacec,0x8e));var _0xcace=function(_0x6ae66b,_0x3ba914){_0x6ae66b=_0x6ae66b-0x0;var _0x465cef=_0xacec[_0x6ae66b];return _0x465cef;};'use strict';var _=require(_0xcace('0x0'));var util=require(_0xcace('0x1'));var moment=require('moment');var BPromise=require(_0xcace('0x2'));var rs=require(_0xcace('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcace('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcace('0x5'))(_0xcace('0x6'));var config=require('../../config/environment');var jayson=require(_0xcace('0x7'));var client=jayson[_0xcace('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3178de,_0x15df22,_0x2ad784){return new BPromise(function(_0x2a94ac,_0x51f988){return client[_0xcace('0x9')](_0x3178de,_0x2ad784)['then'](function(_0x55edf9){logger[_0xcace('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x15df22,_0xcace('0xb'));logger[_0xcace('0xc')](_0xcace('0xd'),_0x15df22,_0xcace('0xb'),JSON['stringify'](_0x55edf9));if(_0x55edf9['error']){if(_0x55edf9[_0xcace('0xe')][_0xcace('0xf')]===0x1f4){logger['error'](_0xcace('0x10'),_0x15df22,_0x55edf9[_0xcace('0xe')][_0xcace('0x11')]);return _0x51f988(_0x55edf9['error']['message']);}logger['error'](_0xcace('0x10'),_0x15df22,_0x55edf9['error'][_0xcace('0x11')]);return _0x2a94ac(_0x55edf9[_0xcace('0xe')][_0xcace('0x11')]);}else{logger['info'](_0xcace('0x10'),_0x15df22,'request\x20sent');_0x2a94ac(_0x55edf9[_0xcace('0x12')][_0xcace('0x11')]);}})[_0xcace('0x13')](function(_0x257fe4){logger[_0xcace('0xe')](_0xcace('0x10'),_0x15df22,_0x257fe4);_0x51f988(_0x257fe4);});});} \ No newline at end of file +var _0x61e8=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4dce1f,_0x15c866){var _0x54e416=function(_0x1051c1){while(--_0x1051c1){_0x4dce1f['push'](_0x4dce1f['shift']());}};_0x54e416(++_0x15c866);}(_0x61e8,0x198));var _0x861e=function(_0x47e110,_0x5560e8){_0x47e110=_0x47e110-0x0;var _0x5b14f1=_0x61e8[_0x47e110];return _0x5b14f1;};'use strict';var _=require(_0x861e('0x0'));var util=require(_0x861e('0x1'));var moment=require(_0x861e('0x2'));var BPromise=require(_0x861e('0x3'));var rs=require(_0x861e('0x4'));var fs=require('fs');var Redis=require(_0x861e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x861e('0x6'));var logger=require('../../config/logger')(_0x861e('0x7'));var config=require(_0x861e('0x8'));var jayson=require(_0x861e('0x9'));var client=jayson[_0x861e('0xa')][_0x861e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44a0a0,_0x3a5a21,_0x13921f){return new BPromise(function(_0x193c83,_0x56a57c){return client[_0x861e('0xc')](_0x44a0a0,_0x13921f)[_0x861e('0xd')](function(_0xdf703f){logger[_0x861e('0xe')](_0x861e('0xf'),_0x3a5a21,_0x861e('0x10'));logger[_0x861e('0x11')](_0x861e('0x12'),_0x3a5a21,_0x861e('0x10'),JSON['stringify'](_0xdf703f));if(_0xdf703f['error']){if(_0xdf703f[_0x861e('0x13')][_0x861e('0x14')]===0x1f4){logger[_0x861e('0x13')](_0x861e('0xf'),_0x3a5a21,_0xdf703f[_0x861e('0x13')][_0x861e('0x15')]);return _0x56a57c(_0xdf703f['error'][_0x861e('0x15')]);}logger[_0x861e('0x13')](_0x861e('0xf'),_0x3a5a21,_0xdf703f[_0x861e('0x13')][_0x861e('0x15')]);return _0x193c83(_0xdf703f[_0x861e('0x13')][_0x861e('0x15')]);}else{logger[_0x861e('0xe')](_0x861e('0xf'),_0x3a5a21,'request\x20sent');_0x193c83(_0xdf703f['result'][_0x861e('0x15')]);}})[_0x861e('0x16')](function(_0x3a833c){logger[_0x861e('0x13')](_0x861e('0xf'),_0x3a5a21,_0x3a833c);_0x56a57c(_0x3a833c);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 982f371..4e1d8ae 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 _0x19f0=['/:id','show','post','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x5319af,_0x2cbb27){var _0x34e834=function(_0x28390c){while(--_0x28390c){_0x5319af['push'](_0x5319af['shift']());}};_0x34e834(++_0x2cbb27);}(_0x19f0,0x127));var _0x019f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x19f0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x019f('0x0'));var path=require('path');var timeout=require(_0x019f('0x1'));var express=require(_0x019f('0x2'));var router=express[_0x019f('0x3')]();var fs_extra=require(_0x019f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x019f('0x5'));var config=require(_0x019f('0x6'));var controller=require(_0x019f('0x7'));router[_0x019f('0x8')]('/',auth[_0x019f('0x9')](),controller[_0x019f('0xa')]);router[_0x019f('0x8')](_0x019f('0xb'),auth[_0x019f('0x9')](),controller[_0x019f('0xc')]);router[_0x019f('0xd')]('/',auth[_0x019f('0x9')](),controller['create']);router[_0x019f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x019f('0xf')]);router['delete'](_0x019f('0xb'),auth['isAuthenticated'](),controller[_0x019f('0x10')]);module[_0x019f('0x11')]=router; \ No newline at end of file +var _0x5e3c=['get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5e3c,0x170));var _0xc5e3=function(_0x5d5b6d,_0x42d8cd){_0x5d5b6d=_0x5d5b6d-0x0;var _0x30bdcc=_0x5e3c[_0x5d5b6d];return _0x30bdcc;};'use strict';var multer=require(_0xc5e3('0x0'));var util=require(_0xc5e3('0x1'));var path=require('path');var timeout=require(_0xc5e3('0x2'));var express=require(_0xc5e3('0x3'));var router=express[_0xc5e3('0x4')]();var fs_extra=require(_0xc5e3('0x5'));var auth=require(_0xc5e3('0x6'));var interaction=require(_0xc5e3('0x7'));var config=require(_0xc5e3('0x8'));var controller=require(_0xc5e3('0x9'));router[_0xc5e3('0xa')]('/',auth['isAuthenticated'](),controller[_0xc5e3('0xb')]);router[_0xc5e3('0xa')](_0xc5e3('0xc'),auth[_0xc5e3('0xd')](),controller[_0xc5e3('0xe')]);router[_0xc5e3('0xf')]('/',auth[_0xc5e3('0xd')](),controller[_0xc5e3('0x10')]);router[_0xc5e3('0x11')](_0xc5e3('0xc'),auth[_0xc5e3('0xd')](),controller['update']);router[_0xc5e3('0x12')](_0xc5e3('0xc'),auth[_0xc5e3('0xd')](),controller[_0xc5e3('0x13')]);module[_0xc5e3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 41f2006..6ff288e 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 _0x28c0=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist'];(function(_0xf2d39c,_0x155a15){var _0x3b2a1f=function(_0x4a7221){while(--_0x4a7221){_0xf2d39c['push'](_0xf2d39c['shift']());}};_0x3b2a1f(++_0x155a15);}(_0x28c0,0x108));var _0x028c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x28c0[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x028c('0x0'));module[_0x028c('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x028c('0x2'),_0x028c('0x3'),_0x028c('0x4'),_0x028c('0x5')),'defaultValue':_0x028c('0x6')},'content':{'type':Sequelize[_0x028c('0x7')]},'key':{'type':Sequelize[_0x028c('0x7')]},'keyType':{'type':Sequelize[_0x028c('0x8')](_0x028c('0x6'),_0x028c('0x2'),_0x028c('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x028c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x028c('0x7')]}}; \ No newline at end of file +var _0xe060=['keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x274a0e,_0x4c0713){var _0x50f593=function(_0x36aa5f){while(--_0x36aa5f){_0x274a0e['push'](_0x274a0e['shift']());}};_0x50f593(++_0x4c0713);}(_0xe060,0x199));var _0x0e06=function(_0x495feb,_0x528207){_0x495feb=_0x495feb-0x0;var _0x149947=_0xe060[_0x495feb];return _0x149947;};'use strict';var Sequelize=require(_0x0e06('0x0'));module[_0x0e06('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0e06('0x2'),_0x0e06('0x3'),_0x0e06('0x4'),_0x0e06('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0e06('0x6')]},'key':{'type':Sequelize[_0x0e06('0x6')]},'keyType':{'type':Sequelize[_0x0e06('0x7')](_0x0e06('0x2'),'variable',_0x0e06('0x4'))},'keyContent':{'type':Sequelize[_0x0e06('0x6')]},'idField':{'type':Sequelize[_0x0e06('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0e06('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0e06('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index cbc7418..dbfa615 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 _0xc92c=['rawAttributes','find','create','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','ZendeskField','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc92c,0x176));var _0xcc92=function(_0x2f58e6,_0x5caedd){_0x2f58e6=_0x2f58e6-0x0;var _0x5c8d1a=_0xc92c[_0x2f58e6];return _0x5c8d1a;};'use strict';var emlformat=require(_0xcc92('0x0'));var rimraf=require(_0xcc92('0x1'));var zipdir=require(_0xcc92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc92('0x3'));var moment=require(_0xcc92('0x4'));var BPromise=require(_0xcc92('0x5'));var Mustache=require(_0xcc92('0x6'));var util=require(_0xcc92('0x7'));var path=require(_0xcc92('0x8'));var sox=require(_0xcc92('0x9'));var csv=require(_0xcc92('0xa'));var ejs=require(_0xcc92('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc92('0xc'));var squel=require('squel');var crypto=require(_0xcc92('0xd'));var jsforce=require(_0xcc92('0xe'));var deskjs=require(_0xcc92('0xf'));var toCsv=require(_0xcc92('0xa'));var querystring=require(_0xcc92('0x10'));var Papa=require(_0xcc92('0x11'));var Redis=require(_0xcc92('0x12'));var authService=require(_0xcc92('0x13'));var qs=require(_0xcc92('0x14'));var as=require(_0xcc92('0x15'));var hardwareService=require(_0xcc92('0x16'));var logger=require(_0xcc92('0x17'))(_0xcc92('0x18'));var utils=require('../../config/utils');var config=require(_0xcc92('0x19'));var licenseUtil=require(_0xcc92('0x1a'));var db=require(_0xcc92('0x1b'))['db'];function respondWithStatusCode(_0x392351,_0x43e86d){_0x43e86d=_0x43e86d||0xcc;return function(_0x32c348){if(_0x32c348){return _0x392351[_0xcc92('0x1c')](_0x43e86d);}return _0x392351[_0xcc92('0x1d')](_0x43e86d)[_0xcc92('0x1e')]();};}function respondWithResult(_0x417fdc,_0x227f7e){_0x227f7e=_0x227f7e||0xc8;return function(_0x127c05){if(_0x127c05){return _0x417fdc[_0xcc92('0x1d')](_0x227f7e)[_0xcc92('0x1f')](_0x127c05);}};}function respondWithFilteredResult(_0x44a86a,_0x874e6f){return function(_0x117878){if(_0x117878){var _0x2f77ca=typeof _0x874e6f[_0xcc92('0x20')]===_0xcc92('0x21')&&typeof _0x874e6f[_0xcc92('0x22')]===_0xcc92('0x21');var _0x516e1e=_0x117878['count'];var _0x1543a5=_0x2f77ca?0x0:_0x874e6f[_0xcc92('0x20')];var _0x627417=_0x2f77ca?_0x117878[_0xcc92('0x23')]:_0x874e6f[_0xcc92('0x20')]+_0x874e6f[_0xcc92('0x22')];var _0x2fed7f;if(_0x627417>=_0x516e1e){_0x627417=_0x516e1e;_0x2fed7f=0xc8;}else{_0x2fed7f=0xce;}_0x44a86a[_0xcc92('0x1d')](_0x2fed7f);return _0x44a86a['set']('Content-Range',_0x1543a5+'-'+_0x627417+'/'+_0x516e1e)[_0xcc92('0x1f')](_0x117878);}return null;};}function patchUpdates(_0x2f9cf3){return function(_0x55c575){try{jsonpatch['apply'](_0x55c575,_0x2f9cf3,!![]);}catch(_0x27729a){return BPromise[_0xcc92('0x24')](_0x27729a);}return _0x55c575[_0xcc92('0x25')]();};}function saveUpdates(_0x4ec95c,_0xc43edf){return function(_0x585417){if(_0x585417){return _0x585417[_0xcc92('0x26')](_0x4ec95c)[_0xcc92('0x27')](function(_0x239bc5){return _0x239bc5;});}return null;};}function removeEntity(_0x1684b4,_0x297940){return function(_0x316368){if(_0x316368){return _0x316368[_0xcc92('0x28')]()[_0xcc92('0x27')](function(){_0x1684b4[_0xcc92('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a403f,_0x2285c9){return function(_0xcc9ae8){if(!_0xcc9ae8){_0x5a403f[_0xcc92('0x1c')](0x194);}return _0xcc9ae8;};}function handleError(_0x5dcb24,_0x4a5875){_0x4a5875=_0x4a5875||0x1f4;return function(_0x10705d){logger[_0xcc92('0x29')](_0x10705d[_0xcc92('0x2a')]);if(_0x10705d[_0xcc92('0x2b')]){delete _0x10705d['name'];}_0x5dcb24[_0xcc92('0x1d')](_0x4a5875)['send'](_0x10705d);};}exports['index']=function(_0x35cdab,_0x58d159){var _0x2b1eb9={},_0x553bc7={},_0x3ab2f3={'count':0x0,'rows':[]};var _0x4835cd=_['map'](db[_0xcc92('0x2c')]['rawAttributes'],function(_0x450f22){return{'name':_0x450f22[_0xcc92('0x2d')],'type':_0x450f22[_0xcc92('0x2e')][_0xcc92('0x2f')]};});_0x553bc7['model']=_['map'](_0x4835cd,_0xcc92('0x2b'));_0x553bc7[_0xcc92('0x30')]=_[_0xcc92('0x31')](_0x35cdab[_0xcc92('0x30')]);_0x553bc7[_0xcc92('0x32')]=_[_0xcc92('0x33')](_0x553bc7[_0xcc92('0x34')],_0x553bc7['query']);_0x2b1eb9[_0xcc92('0x35')]=_[_0xcc92('0x33')](_0x553bc7[_0xcc92('0x34')],qs[_0xcc92('0x36')](_0x35cdab[_0xcc92('0x30')]['fields']));_0x2b1eb9['attributes']=_0x2b1eb9[_0xcc92('0x35')]['length']?_0x2b1eb9[_0xcc92('0x35')]:_0x553bc7['model'];if(!_0x35cdab[_0xcc92('0x30')]['hasOwnProperty'](_0xcc92('0x37'))){_0x2b1eb9[_0xcc92('0x22')]=qs[_0xcc92('0x22')](_0x35cdab[_0xcc92('0x30')][_0xcc92('0x22')]);_0x2b1eb9[_0xcc92('0x20')]=qs[_0xcc92('0x20')](_0x35cdab[_0xcc92('0x30')][_0xcc92('0x20')]);}_0x2b1eb9[_0xcc92('0x38')]=qs[_0xcc92('0x39')](_0x35cdab['query'][_0xcc92('0x39')]);_0x2b1eb9[_0xcc92('0x3a')]=qs[_0xcc92('0x32')](_['pick'](_0x35cdab[_0xcc92('0x30')],_0x553bc7[_0xcc92('0x32')]),_0x4835cd);if(_0x35cdab[_0xcc92('0x30')][_0xcc92('0x3b')]){_0x2b1eb9[_0xcc92('0x3a')]=_['merge'](_0x2b1eb9[_0xcc92('0x3a')],{'$or':_[_0xcc92('0x3c')](_0x4835cd,function(_0x549438){if(_0x549438[_0xcc92('0x2e')]!==_0xcc92('0x3d')){var _0x3412c2={};_0x3412c2[_0x549438['name']]={'$like':'%'+_0x35cdab['query'][_0xcc92('0x3b')]+'%'};return _0x3412c2;}})});}_0x2b1eb9=_[_0xcc92('0x3e')]({},_0x2b1eb9,_0x35cdab[_0xcc92('0x3f')]);var _0x58856d={'where':_0x2b1eb9[_0xcc92('0x3a')]};return db[_0xcc92('0x2c')][_0xcc92('0x23')](_0x58856d)[_0xcc92('0x27')](function(_0x4e4906){_0x3ab2f3['count']=_0x4e4906;if(_0x35cdab[_0xcc92('0x30')][_0xcc92('0x40')]){_0x2b1eb9['include']=[{'all':!![]}];}return db[_0xcc92('0x2c')][_0xcc92('0x41')](_0x2b1eb9);})[_0xcc92('0x27')](function(_0x189b29){_0x3ab2f3[_0xcc92('0x42')]=_0x189b29;return _0x3ab2f3;})[_0xcc92('0x27')](respondWithFilteredResult(_0x58d159,_0x2b1eb9))[_0xcc92('0x43')](handleError(_0x58d159,null));};exports[_0xcc92('0x44')]=function(_0x4a9953,_0xbfa5ac){var _0x5ea41e={'raw':!![],'where':{'id':_0x4a9953[_0xcc92('0x45')]['id']}},_0x7f9c5={};_0x7f9c5[_0xcc92('0x34')]=_[_0xcc92('0x31')](db['ZendeskField'][_0xcc92('0x46')]);_0x7f9c5['query']=_[_0xcc92('0x31')](_0x4a9953['query']);_0x7f9c5[_0xcc92('0x32')]=_[_0xcc92('0x33')](_0x7f9c5[_0xcc92('0x34')],_0x7f9c5[_0xcc92('0x30')]);_0x5ea41e[_0xcc92('0x35')]=_['intersection'](_0x7f9c5[_0xcc92('0x34')],qs[_0xcc92('0x36')](_0x4a9953[_0xcc92('0x30')][_0xcc92('0x36')]));_0x5ea41e[_0xcc92('0x35')]=_0x5ea41e[_0xcc92('0x35')]['length']?_0x5ea41e[_0xcc92('0x35')]:_0x7f9c5[_0xcc92('0x34')];if(_0x4a9953[_0xcc92('0x30')]['includeAll']){_0x5ea41e['include']=[{'all':!![]}];}_0x5ea41e=_[_0xcc92('0x3e')]({},_0x5ea41e,_0x4a9953['options']);return db['ZendeskField'][_0xcc92('0x47')](_0x5ea41e)[_0xcc92('0x27')](handleEntityNotFound(_0xbfa5ac,null))[_0xcc92('0x27')](respondWithResult(_0xbfa5ac,null))[_0xcc92('0x43')](handleError(_0xbfa5ac,null));};exports['create']=function(_0x3f5a68,_0x3fd616){return db[_0xcc92('0x2c')][_0xcc92('0x48')](_0x3f5a68[_0xcc92('0x49')],{})[_0xcc92('0x27')](respondWithResult(_0x3fd616,0xc9))[_0xcc92('0x43')](handleError(_0x3fd616,null));};exports[_0xcc92('0x26')]=function(_0x4864dd,_0x3c52ac){if(_0x4864dd[_0xcc92('0x49')]['id']){delete _0x4864dd['body']['id'];}return db[_0xcc92('0x2c')][_0xcc92('0x47')]({'where':{'id':_0x4864dd[_0xcc92('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c52ac,null))[_0xcc92('0x27')](saveUpdates(_0x4864dd[_0xcc92('0x49')],null))[_0xcc92('0x27')](respondWithResult(_0x3c52ac,null))[_0xcc92('0x43')](handleError(_0x3c52ac,null));};exports[_0xcc92('0x28')]=function(_0x28be6f,_0x51048e){return db[_0xcc92('0x2c')][_0xcc92('0x47')]({'where':{'id':_0x28be6f[_0xcc92('0x45')]['id']}})['then'](handleEntityNotFound(_0x51048e,null))['then'](removeEntity(_0x51048e,null))['catch'](handleError(_0x51048e,null));}; \ No newline at end of file +var _0x2bdb=['json','offset','limit','undefined','count','set','save','then','destroy','end','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','create','update','body','find','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x2bdb,0x105));var _0xb2bd=function(_0x4a2016,_0x42c337){_0x4a2016=_0x4a2016-0x0;var _0x386ffa=_0x2bdb[_0x4a2016];return _0x386ffa;};'use strict';var emlformat=require(_0xb2bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2bd('0x2'));var moment=require(_0xb2bd('0x3'));var BPromise=require(_0xb2bd('0x4'));var Mustache=require('mustache');var util=require(_0xb2bd('0x5'));var path=require(_0xb2bd('0x6'));var sox=require(_0xb2bd('0x7'));var csv=require(_0xb2bd('0x8'));var ejs=require(_0xb2bd('0x9'));var fs=require('fs');var fs_extra=require(_0xb2bd('0xa'));var _=require(_0xb2bd('0xb'));var squel=require('squel');var crypto=require(_0xb2bd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb2bd('0xd'));var toCsv=require(_0xb2bd('0x8'));var querystring=require(_0xb2bd('0xe'));var Papa=require(_0xb2bd('0xf'));var Redis=require(_0xb2bd('0x10'));var authService=require(_0xb2bd('0x11'));var qs=require(_0xb2bd('0x12'));var as=require(_0xb2bd('0x13'));var hardwareService=require(_0xb2bd('0x14'));var logger=require('../../config/logger')(_0xb2bd('0x15'));var utils=require(_0xb2bd('0x16'));var config=require(_0xb2bd('0x17'));var licenseUtil=require(_0xb2bd('0x18'));var db=require(_0xb2bd('0x19'))['db'];function respondWithStatusCode(_0x35f174,_0x6d2212){_0x6d2212=_0x6d2212||0xcc;return function(_0x452cd6){if(_0x452cd6){return _0x35f174['sendStatus'](_0x6d2212);}return _0x35f174[_0xb2bd('0x1a')](_0x6d2212)['end']();};}function respondWithResult(_0x2da8e6,_0x2adda1){_0x2adda1=_0x2adda1||0xc8;return function(_0x17e238){if(_0x17e238){return _0x2da8e6[_0xb2bd('0x1a')](_0x2adda1)[_0xb2bd('0x1b')](_0x17e238);}};}function respondWithFilteredResult(_0x47d679,_0x23c440){return function(_0x315ecc){if(_0x315ecc){var _0x2091d2=typeof _0x23c440[_0xb2bd('0x1c')]==='undefined'&&typeof _0x23c440[_0xb2bd('0x1d')]===_0xb2bd('0x1e');var _0x5b632d=_0x315ecc[_0xb2bd('0x1f')];var _0x380089=_0x2091d2?0x0:_0x23c440[_0xb2bd('0x1c')];var _0x315815=_0x2091d2?_0x315ecc['count']:_0x23c440[_0xb2bd('0x1c')]+_0x23c440[_0xb2bd('0x1d')];var _0x58b3b9;if(_0x315815>=_0x5b632d){_0x315815=_0x5b632d;_0x58b3b9=0xc8;}else{_0x58b3b9=0xce;}_0x47d679[_0xb2bd('0x1a')](_0x58b3b9);return _0x47d679[_0xb2bd('0x20')]('Content-Range',_0x380089+'-'+_0x315815+'/'+_0x5b632d)['json'](_0x315ecc);}return null;};}function patchUpdates(_0x51c595){return function(_0x31a69f){try{jsonpatch['apply'](_0x31a69f,_0x51c595,!![]);}catch(_0x33dfdc){return BPromise['reject'](_0x33dfdc);}return _0x31a69f[_0xb2bd('0x21')]();};}function saveUpdates(_0x25b331,_0x505c35){return function(_0x246f71){if(_0x246f71){return _0x246f71['update'](_0x25b331)[_0xb2bd('0x22')](function(_0x24e202){return _0x24e202;});}return null;};}function removeEntity(_0x2d281c,_0x7517de){return function(_0x5665ae){if(_0x5665ae){return _0x5665ae[_0xb2bd('0x23')]()[_0xb2bd('0x22')](function(){_0x2d281c[_0xb2bd('0x1a')](0xcc)[_0xb2bd('0x24')]();});}};}function handleEntityNotFound(_0x42109f,_0x284da5){return function(_0x5fd563){if(!_0x5fd563){_0x42109f['sendStatus'](0x194);}return _0x5fd563;};}function handleError(_0x2d0bf3,_0x18859a){_0x18859a=_0x18859a||0x1f4;return function(_0xdba731){logger[_0xb2bd('0x25')](_0xdba731[_0xb2bd('0x26')]);if(_0xdba731[_0xb2bd('0x27')]){delete _0xdba731[_0xb2bd('0x27')];}_0x2d0bf3['status'](_0x18859a)[_0xb2bd('0x28')](_0xdba731);};}exports['index']=function(_0x3917e5,_0x5a7a7c){var _0xbfae89={},_0x41ba8f={},_0x65211d={'count':0x0,'rows':[]};var _0x5628c3=_[_0xb2bd('0x29')](db[_0xb2bd('0x2a')][_0xb2bd('0x2b')],function(_0x4633e1){return{'name':_0x4633e1[_0xb2bd('0x2c')],'type':_0x4633e1[_0xb2bd('0x2d')]['key']};});_0x41ba8f['model']=_[_0xb2bd('0x29')](_0x5628c3,'name');_0x41ba8f[_0xb2bd('0x2e')]=_[_0xb2bd('0x2f')](_0x3917e5[_0xb2bd('0x2e')]);_0x41ba8f['filters']=_[_0xb2bd('0x30')](_0x41ba8f[_0xb2bd('0x31')],_0x41ba8f[_0xb2bd('0x2e')]);_0xbfae89[_0xb2bd('0x32')]=_[_0xb2bd('0x30')](_0x41ba8f[_0xb2bd('0x31')],qs[_0xb2bd('0x33')](_0x3917e5[_0xb2bd('0x2e')][_0xb2bd('0x33')]));_0xbfae89[_0xb2bd('0x32')]=_0xbfae89['attributes'][_0xb2bd('0x34')]?_0xbfae89[_0xb2bd('0x32')]:_0x41ba8f[_0xb2bd('0x31')];if(!_0x3917e5[_0xb2bd('0x2e')]['hasOwnProperty'](_0xb2bd('0x35'))){_0xbfae89[_0xb2bd('0x1d')]=qs[_0xb2bd('0x1d')](_0x3917e5[_0xb2bd('0x2e')][_0xb2bd('0x1d')]);_0xbfae89['offset']=qs['offset'](_0x3917e5[_0xb2bd('0x2e')][_0xb2bd('0x1c')]);}_0xbfae89[_0xb2bd('0x36')]=qs[_0xb2bd('0x37')](_0x3917e5[_0xb2bd('0x2e')]['sort']);_0xbfae89[_0xb2bd('0x38')]=qs[_0xb2bd('0x39')](_[_0xb2bd('0x3a')](_0x3917e5[_0xb2bd('0x2e')],_0x41ba8f[_0xb2bd('0x39')]),_0x5628c3);if(_0x3917e5[_0xb2bd('0x2e')][_0xb2bd('0x3b')]){_0xbfae89[_0xb2bd('0x38')]=_[_0xb2bd('0x3c')](_0xbfae89[_0xb2bd('0x38')],{'$or':_[_0xb2bd('0x29')](_0x5628c3,function(_0x6ac71c){if(_0x6ac71c[_0xb2bd('0x2d')]!=='VIRTUAL'){var _0x7bc3b8={};_0x7bc3b8[_0x6ac71c[_0xb2bd('0x27')]]={'$like':'%'+_0x3917e5[_0xb2bd('0x2e')][_0xb2bd('0x3b')]+'%'};return _0x7bc3b8;}})});}_0xbfae89=_[_0xb2bd('0x3c')]({},_0xbfae89,_0x3917e5[_0xb2bd('0x3d')]);var _0x342296={'where':_0xbfae89[_0xb2bd('0x38')]};return db['ZendeskField']['count'](_0x342296)[_0xb2bd('0x22')](function(_0x13c541){_0x65211d['count']=_0x13c541;if(_0x3917e5[_0xb2bd('0x2e')][_0xb2bd('0x3e')]){_0xbfae89[_0xb2bd('0x3f')]=[{'all':!![]}];}return db[_0xb2bd('0x2a')]['findAll'](_0xbfae89);})[_0xb2bd('0x22')](function(_0x1a5a4f){_0x65211d[_0xb2bd('0x40')]=_0x1a5a4f;return _0x65211d;})['then'](respondWithFilteredResult(_0x5a7a7c,_0xbfae89))[_0xb2bd('0x41')](handleError(_0x5a7a7c,null));};exports[_0xb2bd('0x42')]=function(_0x514e37,_0xbbfd15){var _0x5c316f={'raw':!![],'where':{'id':_0x514e37[_0xb2bd('0x43')]['id']}},_0x285599={};_0x285599['model']=_[_0xb2bd('0x2f')](db[_0xb2bd('0x2a')][_0xb2bd('0x2b')]);_0x285599[_0xb2bd('0x2e')]=_[_0xb2bd('0x2f')](_0x514e37['query']);_0x285599[_0xb2bd('0x39')]=_[_0xb2bd('0x30')](_0x285599[_0xb2bd('0x31')],_0x285599[_0xb2bd('0x2e')]);_0x5c316f[_0xb2bd('0x32')]=_[_0xb2bd('0x30')](_0x285599[_0xb2bd('0x31')],qs[_0xb2bd('0x33')](_0x514e37[_0xb2bd('0x2e')][_0xb2bd('0x33')]));_0x5c316f['attributes']=_0x5c316f[_0xb2bd('0x32')][_0xb2bd('0x34')]?_0x5c316f[_0xb2bd('0x32')]:_0x285599[_0xb2bd('0x31')];if(_0x514e37[_0xb2bd('0x2e')]['includeAll']){_0x5c316f[_0xb2bd('0x3f')]=[{'all':!![]}];}_0x5c316f=_[_0xb2bd('0x3c')]({},_0x5c316f,_0x514e37['options']);return db[_0xb2bd('0x2a')]['find'](_0x5c316f)[_0xb2bd('0x22')](handleEntityNotFound(_0xbbfd15,null))[_0xb2bd('0x22')](respondWithResult(_0xbbfd15,null))[_0xb2bd('0x41')](handleError(_0xbbfd15,null));};exports[_0xb2bd('0x44')]=function(_0x3d4b20,_0x4a35f4){return db[_0xb2bd('0x2a')][_0xb2bd('0x44')](_0x3d4b20['body'],{})[_0xb2bd('0x22')](respondWithResult(_0x4a35f4,0xc9))['catch'](handleError(_0x4a35f4,null));};exports[_0xb2bd('0x45')]=function(_0x4021cb,_0x311ab8){if(_0x4021cb[_0xb2bd('0x46')]['id']){delete _0x4021cb[_0xb2bd('0x46')]['id'];}return db[_0xb2bd('0x2a')][_0xb2bd('0x47')]({'where':{'id':_0x4021cb[_0xb2bd('0x43')]['id']}})[_0xb2bd('0x22')](handleEntityNotFound(_0x311ab8,null))[_0xb2bd('0x22')](saveUpdates(_0x4021cb[_0xb2bd('0x46')],null))[_0xb2bd('0x22')](respondWithResult(_0x311ab8,null))[_0xb2bd('0x41')](handleError(_0x311ab8,null));};exports[_0xb2bd('0x23')]=function(_0x448f29,_0x5037d4){return db['ZendeskField'][_0xb2bd('0x47')]({'where':{'id':_0x448f29['params']['id']}})[_0xb2bd('0x22')](handleEntityNotFound(_0x5037d4,null))['then'](removeEntity(_0x5037d4,null))[_0xb2bd('0x41')](handleError(_0x5037d4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5dde56f..aa0247e 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 _0x3c79=['idField','FieldId','util','../../config/logger','bluebird','rimraf','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x28ca7d,_0x23d2f6){var _0x1552b4=function(_0x9cb9e9){while(--_0x9cb9e9){_0x28ca7d['push'](_0x28ca7d['shift']());}};_0x1552b4(++_0x23d2f6);}(_0x3c79,0xf4));var _0x93c7=function(_0x54cb07,_0x5ece35){_0x54cb07=_0x54cb07-0x0;var _0x10335f=_0x3c79[_0x54cb07];return _0x10335f;};'use strict';var _=require('lodash');var util=require(_0x93c7('0x0'));var logger=require(_0x93c7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x93c7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x93c7('0x3'));var config=require('../../config/environment');var attributes=require(_0x93c7('0x4'));module[_0x93c7('0x5')]=function(_0x2a852b,_0x461dfb){return _0x2a852b['define'](_0x93c7('0x6'),attributes,{'tableName':_0x93c7('0x7'),'paranoid':![],'indexes':[{'name':_0x93c7('0x8'),'fields':[_0x93c7('0x9'),_0x93c7('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbc1=['int_zendesk_fields','zendesk_unique_index','idField','lodash','util','api','moment','request-promise','../../config/environment','./intZendeskField.attributes','exports','ZendeskField'];(function(_0xfc088a,_0x18a3a3){var _0xf7c13b=function(_0x1f5c8e){while(--_0x1f5c8e){_0xfc088a['push'](_0xfc088a['shift']());}};_0xf7c13b(++_0x18a3a3);}(_0xfbc1,0x18f));var _0x1fbc=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0xfbc1[_0x5eef05];return _0x56d4b8;};'use strict';var _=require(_0x1fbc('0x0'));var util=require(_0x1fbc('0x1'));var logger=require('../../config/logger')(_0x1fbc('0x2'));var moment=require(_0x1fbc('0x3'));var BPromise=require('bluebird');var rp=require(_0x1fbc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1fbc('0x5'));var attributes=require(_0x1fbc('0x6'));module[_0x1fbc('0x7')]=function(_0x227221,_0x42803c){return _0x227221['define'](_0x1fbc('0x8'),attributes,{'tableName':_0x1fbc('0x9'),'paranoid':![],'indexes':[{'name':_0x1fbc('0xa'),'fields':[_0x1fbc('0xb'),'FieldId'],'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 aafd570..ad2080f 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 _0xfcce=['ZendeskField,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcce,0x1a6));var _0xefcc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcce[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xefcc('0x0'));var util=require(_0xefcc('0x1'));var moment=require(_0xefcc('0x2'));var BPromise=require('bluebird');var rs=require(_0xefcc('0x3'));var fs=require('fs');var Redis=require(_0xefcc('0x4'));var db=require(_0xefcc('0x5'))['db'];var utils=require(_0xefcc('0x6'));var logger=require(_0xefcc('0x7'))(_0xefcc('0x8'));var config=require('../../config/environment');var jayson=require(_0xefcc('0x9'));var client=jayson['client'][_0xefcc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4391db,_0x5cc60f,_0x577a9c){return new BPromise(function(_0x26e5c8,_0x5b87c0){return client[_0xefcc('0xb')](_0x4391db,_0x577a9c)[_0xefcc('0xc')](function(_0x434d1a){logger[_0xefcc('0xd')]('ZendeskField,\x20%s,\x20%s',_0x5cc60f,_0xefcc('0xe'));logger[_0xefcc('0xf')](_0xefcc('0x10'),_0x5cc60f,_0xefcc('0xe'),JSON[_0xefcc('0x11')](_0x434d1a));if(_0x434d1a['error']){if(_0x434d1a[_0xefcc('0x12')]['code']===0x1f4){logger[_0xefcc('0x12')](_0xefcc('0x13'),_0x5cc60f,_0x434d1a[_0xefcc('0x12')]['message']);return _0x5b87c0(_0x434d1a[_0xefcc('0x12')][_0xefcc('0x14')]);}logger[_0xefcc('0x12')](_0xefcc('0x13'),_0x5cc60f,_0x434d1a[_0xefcc('0x12')]['message']);return _0x26e5c8(_0x434d1a[_0xefcc('0x12')][_0xefcc('0x14')]);}else{logger['info'](_0xefcc('0x13'),_0x5cc60f,_0xefcc('0xe'));_0x26e5c8(_0x434d1a['result']['message']);}})['catch'](function(_0x5d8052){logger['error']('ZendeskField,\x20%s,\x20%s',_0x5cc60f,_0x5d8052);_0x5b87c0(_0x5d8052);});});} \ No newline at end of file +var _0x3bab=['../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x142734,_0x263682){var _0x3e3d89=function(_0x4b758d){while(--_0x4b758d){_0x142734['push'](_0x142734['shift']());}};_0x3e3d89(++_0x263682);}(_0x3bab,0xb8));var _0xb3ba=function(_0x412b2d,_0x2f86d6){_0x412b2d=_0x412b2d-0x0;var _0x477fd2=_0x3bab[_0x412b2d];return _0x477fd2;};'use strict';var _=require(_0xb3ba('0x0'));var util=require(_0xb3ba('0x1'));var moment=require(_0xb3ba('0x2'));var BPromise=require(_0xb3ba('0x3'));var rs=require(_0xb3ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb3ba('0x5'));var logger=require(_0xb3ba('0x6'))(_0xb3ba('0x7'));var config=require(_0xb3ba('0x8'));var jayson=require(_0xb3ba('0x9'));var client=jayson[_0xb3ba('0xa')][_0xb3ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53b0ee,_0x13e8f3,_0x599dd7){return new BPromise(function(_0x5d83f9,_0x2c82d3){return client[_0xb3ba('0xc')](_0x53b0ee,_0x599dd7)[_0xb3ba('0xd')](function(_0x4b121c){logger['info'](_0xb3ba('0xe'),_0x13e8f3,_0xb3ba('0xf'));logger[_0xb3ba('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x13e8f3,_0xb3ba('0xf'),JSON[_0xb3ba('0x11')](_0x4b121c));if(_0x4b121c[_0xb3ba('0x12')]){if(_0x4b121c[_0xb3ba('0x12')][_0xb3ba('0x13')]===0x1f4){logger[_0xb3ba('0x12')](_0xb3ba('0xe'),_0x13e8f3,_0x4b121c['error'][_0xb3ba('0x14')]);return _0x2c82d3(_0x4b121c[_0xb3ba('0x12')][_0xb3ba('0x14')]);}logger['error'](_0xb3ba('0xe'),_0x13e8f3,_0x4b121c[_0xb3ba('0x12')][_0xb3ba('0x14')]);return _0x5d83f9(_0x4b121c[_0xb3ba('0x12')][_0xb3ba('0x14')]);}else{logger[_0xb3ba('0x15')]('ZendeskField,\x20%s,\x20%s',_0x13e8f3,_0xb3ba('0xf'));_0x5d83f9(_0x4b121c[_0xb3ba('0x16')]['message']);}})[_0xb3ba('0x17')](function(_0x238f1f){logger[_0xb3ba('0x12')]('ZendeskField,\x20%s,\x20%s',_0x13e8f3,_0x238f1f);_0x2c82d3(_0x238f1f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f84e3eb..00cbfcb 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 _0xaa6a=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','addConfiguration'];(function(_0x42a24b,_0xd836ea){var _0x25a79b=function(_0x524129){while(--_0x524129){_0x42a24b['push'](_0x42a24b['shift']());}};_0x25a79b(++_0xd836ea);}(_0xaa6a,0x1bb));var _0xaaa6=function(_0x262db4,_0xb21ae8){_0x262db4=_0x262db4-0x0;var _0x627bfa=_0xaa6a[_0x262db4];return _0x627bfa;};'use strict';var multer=require(_0xaaa6('0x0'));var util=require(_0xaaa6('0x1'));var path=require(_0xaaa6('0x2'));var timeout=require(_0xaaa6('0x3'));var express=require(_0xaaa6('0x4'));var router=express[_0xaaa6('0x5')]();var fs_extra=require(_0xaaa6('0x6'));var auth=require(_0xaaa6('0x7'));var interaction=require(_0xaaa6('0x8'));var config=require('../../config/environment');var controller=require(_0xaaa6('0x9'));router[_0xaaa6('0xa')]('/',auth[_0xaaa6('0xb')](),controller['index']);router[_0xaaa6('0xa')](_0xaaa6('0xc'),auth[_0xaaa6('0xb')](),controller['show']);router[_0xaaa6('0xa')](_0xaaa6('0xd'),auth[_0xaaa6('0xb')](),controller[_0xaaa6('0xe')]);router[_0xaaa6('0xa')]('/:id/fields',auth[_0xaaa6('0xb')](),controller[_0xaaa6('0xf')]);router['post']('/',auth[_0xaaa6('0xb')](),controller['create']);router['post'](_0xaaa6('0xd'),auth[_0xaaa6('0xb')](),controller[_0xaaa6('0x10')]);router[_0xaaa6('0x11')]('/:id',auth[_0xaaa6('0xb')](),controller['update']);router[_0xaaa6('0x12')]('/:id',auth[_0xaaa6('0xb')](),controller[_0xaaa6('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc0e7=['getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','/:id','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoAccount.controller','get','index','show','/:id/configurations'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0xc0e7,0x1d9));var _0x7c0e=function(_0x38507f,_0x18fe01){_0x38507f=_0x38507f-0x0;var _0x558fa9=_0xc0e7[_0x38507f];return _0x558fa9;};'use strict';var multer=require(_0x7c0e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7c0e('0x1'));var express=require(_0x7c0e('0x2'));var router=express[_0x7c0e('0x3')]();var fs_extra=require(_0x7c0e('0x4'));var auth=require(_0x7c0e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7c0e('0x6'));router[_0x7c0e('0x7')]('/',auth['isAuthenticated'](),controller[_0x7c0e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7c0e('0x9')]);router[_0x7c0e('0x7')](_0x7c0e('0xa'),auth['isAuthenticated'](),controller[_0x7c0e('0xb')]);router['get'](_0x7c0e('0xc'),auth[_0x7c0e('0xd')](),controller[_0x7c0e('0xe')]);router[_0x7c0e('0xf')]('/',auth[_0x7c0e('0xd')](),controller[_0x7c0e('0x10')]);router['post'](_0x7c0e('0xa'),auth[_0x7c0e('0xd')](),controller[_0x7c0e('0x11')]);router[_0x7c0e('0x12')](_0x7c0e('0x13'),auth[_0x7c0e('0xd')](),controller[_0x7c0e('0x14')]);router['delete'](_0x7c0e('0x13'),auth[_0x7c0e('0xd')](),controller['destroy']);module[_0x7c0e('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 7e485eb..9b524ce 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 _0x34e8=['sequelize','exports','STRING'];(function(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_0x34e8,0x12c));var _0x834e=function(_0x534111,_0x22fc2a){_0x534111=_0x534111-0x0;var _0x5ec58f=_0x34e8[_0x534111];return _0x5ec58f;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file +var _0xa75b=['sequelize','STRING'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xa75b,0x170));var _0xba75=function(_0x500d9e,_0x4e2810){_0x500d9e=_0x500d9e-0x0;var _0x18401f=_0xa75b[_0x500d9e];return _0x18401f;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba75('0x1')]},'host':{'type':Sequelize[_0xba75('0x1')]},'zone':{'type':Sequelize[_0xba75('0x1')]},'clientId':{'type':Sequelize[_0xba75('0x1')]},'clientSecret':{'type':Sequelize[_0xba75('0x1')]},'serverUrl':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xba75('0x1')]},'refreshToken':{'type':Sequelize[_0xba75('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 34dc0e6..9d7b7ed 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 _0x1db3=['end','stack','send','index','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','ZohoConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientId','clientSecret','code','zoho.eu','com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Description','WhoId','Call_Result','Call_Type','system_mandatory','push','display_label','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x5b7425,_0x5e46cb){var _0x5c9003=function(_0x5132a6){while(--_0x5132a6){_0x5b7425['push'](_0x5b7425['shift']());}};_0x5c9003(++_0x5e46cb);}(_0x1db3,0x159));var _0x31db=function(_0x37d3ff,_0x4df7be){_0x37d3ff=_0x37d3ff-0x0;var _0x2ed547=_0x1db3[_0x37d3ff];return _0x2ed547;};'use strict';var emlformat=require(_0x31db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31db('0x1'));var jsonpatch=require(_0x31db('0x2'));var rp=require('request-promise');var moment=require(_0x31db('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31db('0x4'));var path=require('path');var sox=require(_0x31db('0x5'));var csv=require(_0x31db('0x6'));var ejs=require(_0x31db('0x7'));var fs=require('fs');var fs_extra=require(_0x31db('0x8'));var _=require(_0x31db('0x9'));var squel=require(_0x31db('0xa'));var crypto=require(_0x31db('0xb'));var jsforce=require(_0x31db('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x31db('0x6'));var querystring=require(_0x31db('0xd'));var Papa=require('papaparse');var Redis=require(_0x31db('0xe'));var authService=require(_0x31db('0xf'));var qs=require(_0x31db('0x10'));var as=require(_0x31db('0x11'));var hardwareService=require(_0x31db('0x12'));var logger=require(_0x31db('0x13'))(_0x31db('0x14'));var utils=require('../../config/utils');var config=require(_0x31db('0x15'));var licenseUtil=require(_0x31db('0x16'));var db=require(_0x31db('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xe5f203,_0x4c7128){_0x4c7128=_0x4c7128||0xcc;return function(_0x49f78e){if(_0x49f78e){return _0xe5f203[_0x31db('0x18')](_0x4c7128);}return _0xe5f203['status'](_0x4c7128)['end']();};}function respondWithResult(_0x23ef45,_0xae271e){_0xae271e=_0xae271e||0xc8;return function(_0x1f4416){if(_0x1f4416){return _0x23ef45[_0x31db('0x19')](_0xae271e)['json'](_0x1f4416);}};}function respondWithFilteredResult(_0x19c296,_0x1cce7f){return function(_0x2cf593){if(_0x2cf593){var _0x1c1db9=typeof _0x1cce7f[_0x31db('0x1a')]===_0x31db('0x1b')&&typeof _0x1cce7f[_0x31db('0x1c')]===_0x31db('0x1b');var _0x31543a=_0x2cf593[_0x31db('0x1d')];var _0xc44d0f=_0x1c1db9?0x0:_0x1cce7f[_0x31db('0x1a')];var _0x55b5fb=_0x1c1db9?_0x2cf593[_0x31db('0x1d')]:_0x1cce7f['offset']+_0x1cce7f['limit'];var _0x5ca8c5;if(_0x55b5fb>=_0x31543a){_0x55b5fb=_0x31543a;_0x5ca8c5=0xc8;}else{_0x5ca8c5=0xce;}_0x19c296['status'](_0x5ca8c5);return _0x19c296[_0x31db('0x1e')](_0x31db('0x1f'),_0xc44d0f+'-'+_0x55b5fb+'/'+_0x31543a)[_0x31db('0x20')](_0x2cf593);}return null;};}function patchUpdates(_0xb1fed){return function(_0x2495ef){try{jsonpatch[_0x31db('0x21')](_0x2495ef,_0xb1fed,!![]);}catch(_0xbbc19a){return BPromise[_0x31db('0x22')](_0xbbc19a);}return _0x2495ef[_0x31db('0x23')]();};}function saveUpdates(_0x1978c2,_0x1ee6b9){return function(_0xd475b4){if(_0xd475b4){return _0xd475b4[_0x31db('0x24')](_0x1978c2)[_0x31db('0x25')](function(_0x2083aa){return _0x2083aa;});}return null;};}function removeEntity(_0x475d57,_0x2321ed){return function(_0x4cab2a){if(_0x4cab2a){return _0x4cab2a[_0x31db('0x26')]()[_0x31db('0x25')](function(){_0x475d57[_0x31db('0x19')](0xcc)[_0x31db('0x27')]();});}};}function handleEntityNotFound(_0x54fe82,_0x33a030){return function(_0x5cb2a6){if(!_0x5cb2a6){_0x54fe82[_0x31db('0x18')](0x194);}return _0x5cb2a6;};}function handleError(_0x5dfdb6,_0x33f7c9){_0x33f7c9=_0x33f7c9||0x1f4;return function(_0x667f04){logger['error'](_0x667f04[_0x31db('0x28')]);if(_0x667f04['name']){delete _0x667f04['name'];}_0x5dfdb6[_0x31db('0x19')](_0x33f7c9)[_0x31db('0x29')](_0x667f04);};}exports[_0x31db('0x2a')]=function(_0x4ddd95,_0x18e4f4){var _0x27828c={},_0x2f1b71={},_0x3e4347={'count':0x0,'rows':[]};var _0x55d350=_[_0x31db('0x2b')](db['ZohoAccount'][_0x31db('0x2c')],function(_0x32c395){return{'name':_0x32c395['fieldName'],'type':_0x32c395[_0x31db('0x2d')][_0x31db('0x2e')]};});_0x2f1b71['model']=_[_0x31db('0x2b')](_0x55d350,_0x31db('0x2f'));_0x2f1b71[_0x31db('0x30')]=_[_0x31db('0x31')](_0x4ddd95[_0x31db('0x30')]);_0x2f1b71[_0x31db('0x32')]=_[_0x31db('0x33')](_0x2f1b71[_0x31db('0x34')],_0x2f1b71['query']);_0x27828c[_0x31db('0x35')]=_[_0x31db('0x33')](_0x2f1b71[_0x31db('0x34')],qs[_0x31db('0x36')](_0x4ddd95[_0x31db('0x30')]['fields']));_0x27828c['attributes']=_0x27828c['attributes'][_0x31db('0x37')]?_0x27828c[_0x31db('0x35')]:_0x2f1b71['model'];if(!_0x4ddd95[_0x31db('0x30')]['hasOwnProperty']('nolimit')){_0x27828c[_0x31db('0x1c')]=qs[_0x31db('0x1c')](_0x4ddd95['query'][_0x31db('0x1c')]);_0x27828c[_0x31db('0x1a')]=qs[_0x31db('0x1a')](_0x4ddd95[_0x31db('0x30')][_0x31db('0x1a')]);}_0x27828c[_0x31db('0x38')]=qs[_0x31db('0x39')](_0x4ddd95[_0x31db('0x30')][_0x31db('0x39')]);_0x27828c[_0x31db('0x3a')]=qs[_0x31db('0x32')](_[_0x31db('0x3b')](_0x4ddd95[_0x31db('0x30')],_0x2f1b71[_0x31db('0x32')]),_0x55d350);if(_0x4ddd95['query'][_0x31db('0x3c')]){_0x27828c[_0x31db('0x3a')]=_[_0x31db('0x3d')](_0x27828c['where'],{'$or':_[_0x31db('0x2b')](_0x55d350,function(_0x3303f9){if(_0x3303f9[_0x31db('0x2d')]!==_0x31db('0x3e')){var _0x325d10={};_0x325d10[_0x3303f9[_0x31db('0x2f')]]={'$like':'%'+_0x4ddd95['query'][_0x31db('0x3c')]+'%'};return _0x325d10;}})});}_0x27828c=_[_0x31db('0x3d')]({},_0x27828c,_0x4ddd95[_0x31db('0x3f')]);var _0x1b4a85={'where':_0x27828c[_0x31db('0x3a')]};return db[_0x31db('0x40')][_0x31db('0x1d')](_0x1b4a85)[_0x31db('0x25')](function(_0x47a936){_0x3e4347[_0x31db('0x1d')]=_0x47a936;if(_0x4ddd95[_0x31db('0x30')]['includeAll']){_0x27828c[_0x31db('0x41')]=[{'all':!![]}];}return db['ZohoAccount'][_0x31db('0x42')](_0x27828c);})[_0x31db('0x25')](function(_0x3e56e7){_0x3e4347[_0x31db('0x43')]=_0x3e56e7;return _0x3e4347;})[_0x31db('0x25')](respondWithFilteredResult(_0x18e4f4,_0x27828c))[_0x31db('0x44')](handleError(_0x18e4f4,null));};exports[_0x31db('0x45')]=function(_0x18e242,_0x2cad07){var _0x17b360={'raw':![],'where':{'id':_0x18e242[_0x31db('0x46')]['id']}},_0x3d6e56={};_0x3d6e56[_0x31db('0x34')]=_[_0x31db('0x31')](db[_0x31db('0x40')][_0x31db('0x2c')]);_0x3d6e56[_0x31db('0x30')]=_[_0x31db('0x31')](_0x18e242[_0x31db('0x30')]);_0x3d6e56['filters']=_['intersection'](_0x3d6e56[_0x31db('0x34')],_0x3d6e56['query']);_0x17b360[_0x31db('0x35')]=_['intersection'](_0x3d6e56[_0x31db('0x34')],qs[_0x31db('0x36')](_0x18e242[_0x31db('0x30')][_0x31db('0x36')]));_0x17b360[_0x31db('0x35')]=_0x17b360[_0x31db('0x35')]['length']?_0x17b360[_0x31db('0x35')]:_0x3d6e56[_0x31db('0x34')];if(_0x18e242[_0x31db('0x30')]['includeAll']){_0x17b360[_0x31db('0x41')]=[{'all':!![]}];}_0x17b360=_[_0x31db('0x3d')]({},_0x17b360,_0x18e242['options']);return db['ZohoAccount']['find'](_0x17b360)['then'](handleEntityNotFound(_0x2cad07,null))[_0x31db('0x25')](respondWithResult(_0x2cad07,null))[_0x31db('0x44')](handleError(_0x2cad07,null));};exports[_0x31db('0x47')]=function(_0x282be2,_0x11d870){return db['ZohoAccount'][_0x31db('0x47')](_0x282be2[_0x31db('0x48')],{})[_0x31db('0x25')](respondWithResult(_0x11d870,0xc9))[_0x31db('0x44')](handleError(_0x11d870,null));};exports[_0x31db('0x24')]=function(_0x4e92fe,_0x553043){if(_0x4e92fe['body']['id']){delete _0x4e92fe[_0x31db('0x48')]['id'];}return db[_0x31db('0x40')]['find']({'where':{'id':_0x4e92fe[_0x31db('0x46')]['id']}})[_0x31db('0x25')](handleEntityNotFound(_0x553043,null))[_0x31db('0x25')](saveUpdates(_0x4e92fe[_0x31db('0x48')],null))[_0x31db('0x25')](respondWithResult(_0x553043,null))[_0x31db('0x44')](handleError(_0x553043,null));};exports[_0x31db('0x26')]=function(_0x48d706,_0x12e417){return db[_0x31db('0x40')][_0x31db('0x49')]({'where':{'id':_0x48d706[_0x31db('0x46')]['id']}})['then'](handleEntityNotFound(_0x12e417,null))['then'](removeEntity(_0x12e417,null))[_0x31db('0x44')](handleError(_0x12e417,null));};exports[_0x31db('0x4a')]=function(_0x53499c,_0x26c28c,_0x3cd9c6){var _0x24c13f={};var _0x2d396d={};var _0x345ba5;var _0x475480;return db[_0x31db('0x40')]['findOne']({'where':{'id':_0x53499c[_0x31db('0x46')]['id']}})[_0x31db('0x25')](handleEntityNotFound(_0x26c28c,null))['then'](function(_0x418691){if(_0x418691){_0x345ba5=_0x418691;_0x2d396d[_0x31db('0x34')]=_[_0x31db('0x31')](db[_0x31db('0x4b')]['rawAttributes']);_0x2d396d[_0x31db('0x30')]=_[_0x31db('0x31')](_0x53499c[_0x31db('0x30')]);_0x2d396d[_0x31db('0x32')]=_['intersection'](_0x2d396d[_0x31db('0x34')],_0x2d396d[_0x31db('0x30')]);_0x24c13f[_0x31db('0x35')]=_[_0x31db('0x33')](_0x2d396d[_0x31db('0x34')],qs[_0x31db('0x36')](_0x53499c['query']['fields']));_0x24c13f[_0x31db('0x35')]=_0x24c13f[_0x31db('0x35')][_0x31db('0x37')]?_0x24c13f['attributes']:_0x2d396d[_0x31db('0x34')];_0x24c13f[_0x31db('0x38')]=qs[_0x31db('0x39')](_0x53499c[_0x31db('0x30')][_0x31db('0x39')]);_0x24c13f['where']=qs[_0x31db('0x32')](_[_0x31db('0x3b')](_0x53499c[_0x31db('0x30')],_0x2d396d['filters']));if(_0x53499c['query']['filter']){_0x24c13f[_0x31db('0x3a')]=_[_0x31db('0x3d')](_0x24c13f['where'],{'$or':_['map'](_0x24c13f[_0x31db('0x35')],function(_0x5f2e48){var _0x1bdae7={};_0x1bdae7[_0x5f2e48]={'$like':'%'+_0x53499c['query'][_0x31db('0x3c')]+'%'};return _0x1bdae7;})});}_0x24c13f=_['merge']({},_0x24c13f,_0x53499c[_0x31db('0x3f')]);return _0x345ba5['getConfigurations'](_0x24c13f);}})[_0x31db('0x25')](function(_0x5a58e4){if(_0x5a58e4){_0x475480=_0x5a58e4[_0x31db('0x37')];if(!_0x53499c[_0x31db('0x30')]['hasOwnProperty']('nolimit')){_0x24c13f['limit']=qs[_0x31db('0x1c')](_0x53499c['query'][_0x31db('0x1c')]);_0x24c13f[_0x31db('0x1a')]=qs['offset'](_0x53499c['query'][_0x31db('0x1a')]);}return _0x345ba5['getConfigurations'](_0x24c13f);}})[_0x31db('0x25')](function(_0x55de47){if(_0x55de47){return _0x55de47?{'count':_0x475480,'rows':_0x55de47}:null;}})[_0x31db('0x25')](respondWithResult(_0x26c28c,null))['catch'](handleError(_0x26c28c,null));};exports[_0x31db('0x4c')]=function(_0xca8893,_0x29c788,_0x36eaf8){if(_0xca8893[_0x31db('0x48')]['id']){delete _0xca8893['body']['id'];}return db[_0x31db('0x40')][_0x31db('0x4d')]({'where':{'id':_0xca8893[_0x31db('0x46')]['id']}})['then'](handleEntityNotFound(_0x29c788,null))[_0x31db('0x25')](function(_0x494d11){if(_0x494d11){_0xca8893[_0x31db('0x48')][_0x31db('0x4e')]=_0x494d11['id'];_0xca8893[_0x31db('0x48')][_0x31db('0x4f')]=integrations[_0x31db('0x50')](_0xca8893['body'][_0x31db('0x51')],_0xca8893[_0x31db('0x48')][_0x31db('0x2d')]);_0xca8893[_0x31db('0x48')]['Descriptions']=integrations[_0x31db('0x52')](_0xca8893['body']['channel'],_0xca8893[_0x31db('0x48')][_0x31db('0x2d')]);return db[_0x31db('0x4b')]['create'](_0xca8893[_0x31db('0x48')],{'include':[{'model':db[_0x31db('0x53')],'as':_0x31db('0x4f')},{'model':db[_0x31db('0x53')],'as':_0x31db('0x54')}]});}return null;})[_0x31db('0x25')](respondWithResult(_0x29c788,null))['catch'](handleError(_0x29c788,null));};function getAccessToken(_0x10e592){return new Promise(function(_0xa95256,_0x3d3a1f){var _0x3fef76;switch(_0x10e592['zone']){case'US':_0x3fef76=_0x31db('0x55');break;case'AU':_0x3fef76=_0x31db('0x56');break;case'EU':_0x3fef76=_0x31db('0x57');break;case'IN':_0x3fef76='https://accounts.zoho.in';break;case'CN':_0x3fef76=_0x31db('0x58');break;default:_0x3fef76='https://accounts.zoho.eu';break;}var _0xa8a2f3={'method':_0x31db('0x59'),'uri':_0x3fef76+'/oauth/v2/token','qs':{'refresh_token':_0x10e592[_0x31db('0x5a')],'client_id':_0x10e592['clientId'],'client_secret':_0x10e592['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0xa8a2f3)[_0x31db('0x25')](function(_0x5d94f5){if(_0x5d94f5[_0x31db('0x5b')]){_0xa95256(_0x5d94f5['access_token']);}else{_0x3d3a1f(_0x31db('0x5c'));}})[_0x31db('0x44')](function(_0x112b3c){_0x3d3a1f(_0x112b3c);});});}exports[_0x31db('0x5d')]=function(_0x4c87a0,_0x19ed22,_0x366c66){var _0x56cabc,_0x530660,_0x387d91,_0x4222bd,_0x1f95e7;return db[_0x31db('0x40')][_0x31db('0x4d')]({'where':{'id':_0x4c87a0['params']['id']},'attributes':['id',_0x31db('0x5e'),_0x31db('0x5f'),_0x31db('0x60'),_0x31db('0x61'),'serverUrl',_0x31db('0x62'),_0x31db('0x5a')]})['then'](handleEntityNotFound(_0x19ed22,null))[_0x31db('0x25')](function(_0x49a585){_0x1f95e7=_0x49a585;_0x56cabc=_0x1f95e7[_0x31db('0x5e')];_0x530660=_0x56cabc===_0x31db('0x63')?'eu':_0x31db('0x64');_0x387d91=_0x1f95e7[_0x31db('0x65')];var _0x216c38=_0x387d91['slice'](-0x1);if(_0x216c38==='/'||_0x216c38==='\x5c'||_0x216c38===':'){_0x387d91=_0x387d91[_0x31db('0x66')](0x0,_0x387d91[_0x31db('0x67')](_0x216c38));}if(!_0x1f95e7['refreshToken']){throw new Error(_0x31db('0x68'));}return getAccessToken(_0x1f95e7);})[_0x31db('0x25')](function(_0x596ae7){if(_0x596ae7){return rp({'method':_0x31db('0x69'),'uri':util[_0x31db('0x6a')](_0x31db('0x6b'),_0x530660),'qs':{'module':_0x31db('0x6c')},'headers':{'Authorization':_0x31db('0x6d')+_0x596ae7},'json':!![]});}})[_0x31db('0x25')](function(_0x216271){if(_0x216271){if(_0x216271['response']&&_0x216271[_0x31db('0x6e')][_0x31db('0x6f')]){throw new Error(_0x216271[_0x31db('0x6e')][_0x31db('0x6f')][_0x31db('0x70')]);}var _0x3c70f0=[];var _0x5949e9=[];var _0xcf6fef=[_0x31db('0x71'),'Subject',_0x31db('0x72'),_0x31db('0x73'),'Call_Duration',_0x31db('0x74'),'Call_Start_Time',_0x31db('0x75')];_0x5949e9=_['remove'](_0x216271['fields'],function(_0xf5446d){return _0xcf6fef['includes'](_0xf5446d['api_name']);});for(var _0x1c6127=0x0;_0x1c6127<_0x5949e9[_0x31db('0x37')];_0x1c6127++){if(_0x5949e9[_0x1c6127][_0x31db('0x76')]===![]){_0x3c70f0[_0x31db('0x77')]({'id':_0x5949e9[_0x1c6127]['id'],'name':_0x5949e9[_0x1c6127][_0x31db('0x78')],'custom':_0x5949e9[_0x1c6127]['custom_field'],'options':_0x5949e9[_0x1c6127][_0x31db('0x79')]==='picklist'&&_0x5949e9[_0x1c6127]['pick_list_values'][_0x31db('0x37')]>-0x1?_[_0x31db('0x2b')](_0x5949e9[_0x1c6127][_0x31db('0x7a')],function(_0x5b833f){return{'name':_0x5b833f,'value':_0x5b833f};}):[]});}}return{'count':_0x3c70f0[_0x31db('0x37')],'rows':_0x3c70f0};}else{return{'count':0x0,'rows':[]};}})[_0x31db('0x25')](respondWithResult(_0x19ed22,null))[_0x31db('0x44')](function(_0x31429a){var _0x574b3f=_0x4c87a0[_0x31db('0x30')][_0x31db('0x7b')]?0x1f4:_0x31429a[_0x31db('0x7c')]||0x1f4;logger[_0x31db('0x6f')](_0x31db('0x7d'),'getFields',_0x574b3f,JSON[_0x31db('0x7e')](_0x31429a));delete _0x31429a[_0x31db('0x2f')];if(_0x574b3f===0x191){_0x574b3f=0x190;}_0x19ed22['status'](_0x574b3f)[_0x31db('0x29')](_0x4c87a0[_0x31db('0x30')]['test']?{'message':_0x31db('0x7f'),'statusCode':_0x31429a[_0x31db('0x7c')]}:_0x31429a);});}; \ No newline at end of file +var _0x956b=['send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','ZohoAccount','includeAll','findAll','catch','show','params','include','find','create','body','getConfigurations','ZohoConfiguration','filter','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','end','error','name'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x956b,0xe2));var _0xb956=function(_0xa804c,_0x21a85b){_0xa804c=_0xa804c-0x0;var _0x158afd=_0x956b[_0xa804c];return _0x158afd;};'use strict';var emlformat=require(_0xb956('0x0'));var rimraf=require(_0xb956('0x1'));var zipdir=require(_0xb956('0x2'));var jsonpatch=require(_0xb956('0x3'));var rp=require(_0xb956('0x4'));var moment=require(_0xb956('0x5'));var BPromise=require(_0xb956('0x6'));var Mustache=require('mustache');var util=require(_0xb956('0x7'));var path=require(_0xb956('0x8'));var sox=require('sox');var csv=require(_0xb956('0x9'));var ejs=require(_0xb956('0xa'));var fs=require('fs');var fs_extra=require(_0xb956('0xb'));var _=require(_0xb956('0xc'));var squel=require(_0xb956('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb956('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb956('0xf'));var Redis=require('ioredis');var authService=require(_0xb956('0x10'));var qs=require(_0xb956('0x11'));var as=require(_0xb956('0x12'));var hardwareService=require(_0xb956('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb956('0x14'));var config=require(_0xb956('0x15'));var licenseUtil=require(_0xb956('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb956('0x17'));function respondWithStatusCode(_0x1c19f1,_0x29012c){_0x29012c=_0x29012c||0xcc;return function(_0x5bda7e){if(_0x5bda7e){return _0x1c19f1[_0xb956('0x18')](_0x29012c);}return _0x1c19f1[_0xb956('0x19')](_0x29012c)['end']();};}function respondWithResult(_0x15d3be,_0x3bc8ac){_0x3bc8ac=_0x3bc8ac||0xc8;return function(_0x55b48e){if(_0x55b48e){return _0x15d3be[_0xb956('0x19')](_0x3bc8ac)[_0xb956('0x1a')](_0x55b48e);}};}function respondWithFilteredResult(_0x17fc87,_0x337670){return function(_0x4d9172){if(_0x4d9172){var _0x4e8576=typeof _0x337670[_0xb956('0x1b')]===_0xb956('0x1c')&&typeof _0x337670['limit']===_0xb956('0x1c');var _0x4a82f8=_0x4d9172[_0xb956('0x1d')];var _0x1c823c=_0x4e8576?0x0:_0x337670[_0xb956('0x1b')];var _0x546385=_0x4e8576?_0x4d9172[_0xb956('0x1d')]:_0x337670['offset']+_0x337670[_0xb956('0x1e')];var _0x2ee9f5;if(_0x546385>=_0x4a82f8){_0x546385=_0x4a82f8;_0x2ee9f5=0xc8;}else{_0x2ee9f5=0xce;}_0x17fc87[_0xb956('0x19')](_0x2ee9f5);return _0x17fc87[_0xb956('0x1f')]('Content-Range',_0x1c823c+'-'+_0x546385+'/'+_0x4a82f8)[_0xb956('0x1a')](_0x4d9172);}return null;};}function patchUpdates(_0x7bc50d){return function(_0x581384){try{jsonpatch[_0xb956('0x20')](_0x581384,_0x7bc50d,!![]);}catch(_0x318c2c){return BPromise[_0xb956('0x21')](_0x318c2c);}return _0x581384[_0xb956('0x22')]();};}function saveUpdates(_0x2db251,_0x1e9563){return function(_0x49ba40){if(_0x49ba40){return _0x49ba40[_0xb956('0x23')](_0x2db251)[_0xb956('0x24')](function(_0x348485){return _0x348485;});}return null;};}function removeEntity(_0x3614a7,_0x356501){return function(_0x38e860){if(_0x38e860){return _0x38e860['destroy']()[_0xb956('0x24')](function(){_0x3614a7[_0xb956('0x19')](0xcc)[_0xb956('0x25')]();});}};}function handleEntityNotFound(_0x449dba,_0x3eaa54){return function(_0x3b0783){if(!_0x3b0783){_0x449dba['sendStatus'](0x194);}return _0x3b0783;};}function handleError(_0x438f09,_0xaf5c89){_0xaf5c89=_0xaf5c89||0x1f4;return function(_0x1202b3){logger[_0xb956('0x26')](_0x1202b3['stack']);if(_0x1202b3[_0xb956('0x27')]){delete _0x1202b3[_0xb956('0x27')];}_0x438f09[_0xb956('0x19')](_0xaf5c89)[_0xb956('0x28')](_0x1202b3);};}exports[_0xb956('0x29')]=function(_0x367329,_0x3d387b){var _0x1be6e9={},_0x1cb50f={},_0x296c8f={'count':0x0,'rows':[]};var _0x395ab1=_['map'](db['ZohoAccount'][_0xb956('0x2a')],function(_0x306382){return{'name':_0x306382[_0xb956('0x2b')],'type':_0x306382['type'][_0xb956('0x2c')]};});_0x1cb50f[_0xb956('0x2d')]=_[_0xb956('0x2e')](_0x395ab1,_0xb956('0x27'));_0x1cb50f[_0xb956('0x2f')]=_[_0xb956('0x30')](_0x367329[_0xb956('0x2f')]);_0x1cb50f[_0xb956('0x31')]=_[_0xb956('0x32')](_0x1cb50f[_0xb956('0x2d')],_0x1cb50f[_0xb956('0x2f')]);_0x1be6e9['attributes']=_[_0xb956('0x32')](_0x1cb50f[_0xb956('0x2d')],qs[_0xb956('0x33')](_0x367329[_0xb956('0x2f')][_0xb956('0x33')]));_0x1be6e9[_0xb956('0x34')]=_0x1be6e9[_0xb956('0x34')][_0xb956('0x35')]?_0x1be6e9[_0xb956('0x34')]:_0x1cb50f['model'];if(!_0x367329['query'][_0xb956('0x36')](_0xb956('0x37'))){_0x1be6e9['limit']=qs[_0xb956('0x1e')](_0x367329[_0xb956('0x2f')][_0xb956('0x1e')]);_0x1be6e9['offset']=qs[_0xb956('0x1b')](_0x367329['query']['offset']);}_0x1be6e9[_0xb956('0x38')]=qs[_0xb956('0x39')](_0x367329[_0xb956('0x2f')][_0xb956('0x39')]);_0x1be6e9[_0xb956('0x3a')]=qs[_0xb956('0x31')](_[_0xb956('0x3b')](_0x367329[_0xb956('0x2f')],_0x1cb50f['filters']),_0x395ab1);if(_0x367329[_0xb956('0x2f')]['filter']){_0x1be6e9['where']=_['merge'](_0x1be6e9[_0xb956('0x3a')],{'$or':_[_0xb956('0x2e')](_0x395ab1,function(_0x44835f){if(_0x44835f[_0xb956('0x3c')]!==_0xb956('0x3d')){var _0x2613cd={};_0x2613cd[_0x44835f[_0xb956('0x27')]]={'$like':'%'+_0x367329[_0xb956('0x2f')]['filter']+'%'};return _0x2613cd;}})});}_0x1be6e9=_[_0xb956('0x3e')]({},_0x1be6e9,_0x367329[_0xb956('0x3f')]);var _0x4a5143={'where':_0x1be6e9[_0xb956('0x3a')]};return db[_0xb956('0x40')][_0xb956('0x1d')](_0x4a5143)[_0xb956('0x24')](function(_0x55b32f){_0x296c8f[_0xb956('0x1d')]=_0x55b32f;if(_0x367329['query'][_0xb956('0x41')]){_0x1be6e9['include']=[{'all':!![]}];}return db[_0xb956('0x40')][_0xb956('0x42')](_0x1be6e9);})['then'](function(_0x4af00d){_0x296c8f['rows']=_0x4af00d;return _0x296c8f;})[_0xb956('0x24')](respondWithFilteredResult(_0x3d387b,_0x1be6e9))[_0xb956('0x43')](handleError(_0x3d387b,null));};exports[_0xb956('0x44')]=function(_0x729d86,_0x9fb157){var _0xc00121={'raw':![],'where':{'id':_0x729d86[_0xb956('0x45')]['id']}},_0x3cf2e8={};_0x3cf2e8[_0xb956('0x2d')]=_[_0xb956('0x30')](db[_0xb956('0x40')][_0xb956('0x2a')]);_0x3cf2e8[_0xb956('0x2f')]=_[_0xb956('0x30')](_0x729d86[_0xb956('0x2f')]);_0x3cf2e8[_0xb956('0x31')]=_[_0xb956('0x32')](_0x3cf2e8[_0xb956('0x2d')],_0x3cf2e8[_0xb956('0x2f')]);_0xc00121[_0xb956('0x34')]=_[_0xb956('0x32')](_0x3cf2e8['model'],qs[_0xb956('0x33')](_0x729d86[_0xb956('0x2f')][_0xb956('0x33')]));_0xc00121[_0xb956('0x34')]=_0xc00121[_0xb956('0x34')][_0xb956('0x35')]?_0xc00121['attributes']:_0x3cf2e8[_0xb956('0x2d')];if(_0x729d86['query'][_0xb956('0x41')]){_0xc00121[_0xb956('0x46')]=[{'all':!![]}];}_0xc00121=_[_0xb956('0x3e')]({},_0xc00121,_0x729d86[_0xb956('0x3f')]);return db['ZohoAccount'][_0xb956('0x47')](_0xc00121)[_0xb956('0x24')](handleEntityNotFound(_0x9fb157,null))[_0xb956('0x24')](respondWithResult(_0x9fb157,null))['catch'](handleError(_0x9fb157,null));};exports[_0xb956('0x48')]=function(_0x3641e0,_0x39097b){return db[_0xb956('0x40')][_0xb956('0x48')](_0x3641e0[_0xb956('0x49')],{})[_0xb956('0x24')](respondWithResult(_0x39097b,0xc9))[_0xb956('0x43')](handleError(_0x39097b,null));};exports[_0xb956('0x23')]=function(_0x17be38,_0x3e72ed){if(_0x17be38[_0xb956('0x49')]['id']){delete _0x17be38[_0xb956('0x49')]['id'];}return db[_0xb956('0x40')][_0xb956('0x47')]({'where':{'id':_0x17be38['params']['id']}})[_0xb956('0x24')](handleEntityNotFound(_0x3e72ed,null))['then'](saveUpdates(_0x17be38[_0xb956('0x49')],null))[_0xb956('0x24')](respondWithResult(_0x3e72ed,null))['catch'](handleError(_0x3e72ed,null));};exports['destroy']=function(_0x210e86,_0x370a6d){return db[_0xb956('0x40')][_0xb956('0x47')]({'where':{'id':_0x210e86[_0xb956('0x45')]['id']}})[_0xb956('0x24')](handleEntityNotFound(_0x370a6d,null))[_0xb956('0x24')](removeEntity(_0x370a6d,null))[_0xb956('0x43')](handleError(_0x370a6d,null));};exports[_0xb956('0x4a')]=function(_0x5ceaf5,_0x4ebf7d,_0x121a3e){var _0xb8a287={};var _0x423d27={};var _0x5f43c7;var _0x1cfbde;return db[_0xb956('0x40')]['findOne']({'where':{'id':_0x5ceaf5[_0xb956('0x45')]['id']}})[_0xb956('0x24')](handleEntityNotFound(_0x4ebf7d,null))['then'](function(_0x57d36){if(_0x57d36){_0x5f43c7=_0x57d36;_0x423d27[_0xb956('0x2d')]=_[_0xb956('0x30')](db[_0xb956('0x4b')][_0xb956('0x2a')]);_0x423d27[_0xb956('0x2f')]=_['keys'](_0x5ceaf5['query']);_0x423d27[_0xb956('0x31')]=_[_0xb956('0x32')](_0x423d27[_0xb956('0x2d')],_0x423d27[_0xb956('0x2f')]);_0xb8a287[_0xb956('0x34')]=_[_0xb956('0x32')](_0x423d27['model'],qs[_0xb956('0x33')](_0x5ceaf5[_0xb956('0x2f')][_0xb956('0x33')]));_0xb8a287[_0xb956('0x34')]=_0xb8a287['attributes'][_0xb956('0x35')]?_0xb8a287[_0xb956('0x34')]:_0x423d27[_0xb956('0x2d')];_0xb8a287[_0xb956('0x38')]=qs['sort'](_0x5ceaf5[_0xb956('0x2f')]['sort']);_0xb8a287[_0xb956('0x3a')]=qs[_0xb956('0x31')](_[_0xb956('0x3b')](_0x5ceaf5[_0xb956('0x2f')],_0x423d27[_0xb956('0x31')]));if(_0x5ceaf5[_0xb956('0x2f')][_0xb956('0x4c')]){_0xb8a287['where']=_[_0xb956('0x3e')](_0xb8a287[_0xb956('0x3a')],{'$or':_['map'](_0xb8a287[_0xb956('0x34')],function(_0x53e620){var _0xf77656={};_0xf77656[_0x53e620]={'$like':'%'+_0x5ceaf5[_0xb956('0x2f')][_0xb956('0x4c')]+'%'};return _0xf77656;})});}_0xb8a287=_[_0xb956('0x3e')]({},_0xb8a287,_0x5ceaf5[_0xb956('0x3f')]);return _0x5f43c7['getConfigurations'](_0xb8a287);}})[_0xb956('0x24')](function(_0x2082ec){if(_0x2082ec){_0x1cfbde=_0x2082ec[_0xb956('0x35')];if(!_0x5ceaf5[_0xb956('0x2f')][_0xb956('0x36')](_0xb956('0x37'))){_0xb8a287['limit']=qs[_0xb956('0x1e')](_0x5ceaf5[_0xb956('0x2f')][_0xb956('0x1e')]);_0xb8a287[_0xb956('0x1b')]=qs['offset'](_0x5ceaf5[_0xb956('0x2f')][_0xb956('0x1b')]);}return _0x5f43c7[_0xb956('0x4a')](_0xb8a287);}})[_0xb956('0x24')](function(_0x56a049){if(_0x56a049){return _0x56a049?{'count':_0x1cfbde,'rows':_0x56a049}:null;}})[_0xb956('0x24')](respondWithResult(_0x4ebf7d,null))[_0xb956('0x43')](handleError(_0x4ebf7d,null));};exports[_0xb956('0x4d')]=function(_0x25c7cd,_0x10f300,_0x196595){if(_0x25c7cd[_0xb956('0x49')]['id']){delete _0x25c7cd[_0xb956('0x49')]['id'];}return db[_0xb956('0x40')][_0xb956('0x4e')]({'where':{'id':_0x25c7cd[_0xb956('0x45')]['id']}})[_0xb956('0x24')](handleEntityNotFound(_0x10f300,null))[_0xb956('0x24')](function(_0x210ef7){if(_0x210ef7){_0x25c7cd[_0xb956('0x49')][_0xb956('0x4f')]=_0x210ef7['id'];_0x25c7cd[_0xb956('0x49')][_0xb956('0x50')]=integrations[_0xb956('0x51')](_0x25c7cd[_0xb956('0x49')][_0xb956('0x52')],_0x25c7cd[_0xb956('0x49')][_0xb956('0x3c')]);_0x25c7cd[_0xb956('0x49')][_0xb956('0x53')]=integrations['getDescriptions'](_0x25c7cd[_0xb956('0x49')][_0xb956('0x52')],_0x25c7cd[_0xb956('0x49')][_0xb956('0x3c')]);return db[_0xb956('0x4b')]['create'](_0x25c7cd[_0xb956('0x49')],{'include':[{'model':db[_0xb956('0x54')],'as':_0xb956('0x50')},{'model':db[_0xb956('0x54')],'as':_0xb956('0x53')}]});}return null;})[_0xb956('0x24')](respondWithResult(_0x10f300,null))[_0xb956('0x43')](handleError(_0x10f300,null));};function getAccessToken(_0x21b38e){return new Promise(function(_0x4de571,_0x271ec1){var _0xda0714;switch(_0x21b38e[_0xb956('0x55')]){case'US':_0xda0714=_0xb956('0x56');break;case'AU':_0xda0714=_0xb956('0x57');break;case'EU':_0xda0714=_0xb956('0x58');break;case'IN':_0xda0714=_0xb956('0x59');break;case'CN':_0xda0714=_0xb956('0x5a');break;default:_0xda0714=_0xb956('0x58');break;}var _0x192a18={'method':_0xb956('0x5b'),'uri':_0xda0714+_0xb956('0x5c'),'qs':{'refresh_token':_0x21b38e[_0xb956('0x5d')],'client_id':_0x21b38e['clientId'],'client_secret':_0x21b38e[_0xb956('0x5e')],'grant_type':_0xb956('0x5f')},'json':!![]};return rp(_0x192a18)[_0xb956('0x24')](function(_0x3cf2d0){if(_0x3cf2d0['access_token']){_0x4de571(_0x3cf2d0[_0xb956('0x60')]);}else{_0x271ec1(_0xb956('0x61'));}})[_0xb956('0x43')](function(_0x1f6c27){_0x271ec1(_0x1f6c27);});});}exports[_0xb956('0x62')]=function(_0xd26287,_0x59d8b4,_0x3508b0){var _0x4c8313,_0x45cfba,_0x4c0750,_0x3f18be,_0x3aa68c;return db[_0xb956('0x40')][_0xb956('0x4e')]({'where':{'id':_0xd26287[_0xb956('0x45')]['id']},'attributes':['id',_0xb956('0x63'),_0xb956('0x55'),_0xb956('0x64'),_0xb956('0x5e'),_0xb956('0x65'),_0xb956('0x66'),_0xb956('0x5d')]})['then'](handleEntityNotFound(_0x59d8b4,null))[_0xb956('0x24')](function(_0x521b79){_0x3aa68c=_0x521b79;_0x4c8313=_0x3aa68c[_0xb956('0x63')];_0x45cfba=_0x4c8313===_0xb956('0x67')?'eu':_0xb956('0x68');_0x4c0750=_0x3aa68c[_0xb956('0x65')];var _0x1c5989=_0x4c0750[_0xb956('0x69')](-0x1);if(_0x1c5989==='/'||_0x1c5989==='\x5c'||_0x1c5989===':'){_0x4c0750=_0x4c0750[_0xb956('0x6a')](0x0,_0x4c0750['lastIndexOf'](_0x1c5989));}if(!_0x3aa68c[_0xb956('0x5d')]){throw new Error(_0xb956('0x6b'));}return getAccessToken(_0x3aa68c);})[_0xb956('0x24')](function(_0x207775){if(_0x207775){return rp({'method':'GET','uri':util[_0xb956('0x6c')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x45cfba),'qs':{'module':_0xb956('0x6d')},'headers':{'Authorization':_0xb956('0x6e')+_0x207775},'json':!![]});}})[_0xb956('0x24')](function(_0x59b63a){if(_0x59b63a){if(_0x59b63a['response']&&_0x59b63a[_0xb956('0x6f')][_0xb956('0x26')]){throw new Error(_0x59b63a[_0xb956('0x6f')][_0xb956('0x26')]['message']);}var _0x3ff8bb=[];var _0xba80a9=[];var _0x1516ce=['Owner',_0xb956('0x70'),_0xb956('0x71'),_0xb956('0x72'),_0xb956('0x73'),_0xb956('0x74'),_0xb956('0x75'),_0xb956('0x76')];_0xba80a9=_[_0xb956('0x77')](_0x59b63a[_0xb956('0x33')],function(_0x39080a){return _0x1516ce[_0xb956('0x78')](_0x39080a[_0xb956('0x79')]);});for(var _0x350c69=0x0;_0x350c69<_0xba80a9['length'];_0x350c69++){if(_0xba80a9[_0x350c69][_0xb956('0x7a')]===![]){_0x3ff8bb[_0xb956('0x7b')]({'id':_0xba80a9[_0x350c69]['id'],'name':_0xba80a9[_0x350c69][_0xb956('0x7c')],'custom':_0xba80a9[_0x350c69][_0xb956('0x7d')],'options':_0xba80a9[_0x350c69][_0xb956('0x7e')]===_0xb956('0x7f')&&_0xba80a9[_0x350c69][_0xb956('0x80')][_0xb956('0x35')]>-0x1?_[_0xb956('0x2e')](_0xba80a9[_0x350c69][_0xb956('0x80')],function(_0x2b1945){return{'name':_0x2b1945,'value':_0x2b1945};}):[]});}}return{'count':_0x3ff8bb['length'],'rows':_0x3ff8bb};}else{return{'count':0x0,'rows':[]};}})[_0xb956('0x24')](respondWithResult(_0x59d8b4,null))['catch'](function(_0x423d2d){var _0x73099e=_0xd26287[_0xb956('0x2f')][_0xb956('0x81')]?0x1f4:_0x423d2d[_0xb956('0x82')]||0x1f4;logger[_0xb956('0x26')](_0xb956('0x83'),_0xb956('0x62'),_0x73099e,JSON[_0xb956('0x84')](_0x423d2d));delete _0x423d2d[_0xb956('0x27')];if(_0x73099e===0x191){_0x73099e=0x190;}_0x59d8b4[_0xb956('0x19')](_0x73099e)['send'](_0xd26287[_0xb956('0x2f')][_0xb956('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x423d2d[_0xb956('0x82')]}:_0x423d2d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index ee65dac..aa2c427 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 _0x6d3b=['https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','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','inspect','serverUrl','host','slice','lastIndexOf','POST','authorization_code','info','catch','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientSecret','code','substring','https://accounts.zoho.com'];(function(_0x3bc3d9,_0x2d8ea6){var _0x724506=function(_0x28a960){while(--_0x28a960){_0x3bc3d9['push'](_0x3bc3d9['shift']());}};_0x724506(++_0x2d8ea6);}(_0x6d3b,0x136));var _0xb6d3=function(_0x54543b,_0x59d299){_0x54543b=_0x54543b-0x0;var _0x57702=_0x6d3b[_0x54543b];return _0x57702;};'use strict';var _=require(_0xb6d3('0x0'));var util=require(_0xb6d3('0x1'));var logger=require(_0xb6d3('0x2'))('api');var moment=require(_0xb6d3('0x3'));var BPromise=require('bluebird');var rp=require(_0xb6d3('0x4'));var fs=require('fs');var path=require(_0xb6d3('0x5'));var rimraf=require(_0xb6d3('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6d3('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xb6d3('0x8')]=function(_0x305b23,_0x766128){return _0x305b23[_0xb6d3('0x9')](_0xb6d3('0xa'),attributes,{'tableName':_0xb6d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3a427b,_0x37fca1,_0x199842){if(_0x3a427b[_0xb6d3('0xc')](_0xb6d3('0xd'))||_0x3a427b['changed']('serverUrl')||_0x3a427b['changed']('clientId')||_0x3a427b['changed'](_0xb6d3('0xe'))||_0x3a427b[_0xb6d3('0xc')](_0xb6d3('0xf'))||_0x3a427b[_0xb6d3('0xc')]('host')){var _0x53d172,_0x382a7e;_0x53d172=_0x3a427b['serverUrl'];var _0x32491e=_0x53d172['slice'](-0x1);if(_0x32491e==='/'||_0x32491e==='\x5c'||_0x32491e===':'){_0x53d172=_0x53d172[_0xb6d3('0x10')](0x0,_0x53d172['lastIndexOf'](_0x32491e));}switch(_0x3a427b[_0xb6d3('0xd')]){case'US':_0x382a7e=_0xb6d3('0x11');break;case'AU':_0x382a7e='https://accounts.zoho.com.au';break;case'IN':_0x382a7e=_0xb6d3('0x12');break;case'CN':_0x382a7e='https://accounts.zoho.com.cn';break;default:_0x382a7e=_0xb6d3('0x13');break;}var _0x1514c3={'method':'POST','uri':_0x382a7e+_0xb6d3('0x14'),'form':{'grant_type':'authorization_code','client_id':_0x3a427b[_0xb6d3('0x15')],'client_secret':_0x3a427b['clientSecret'],'redirect_uri':_0x3a427b['serverUrl'],'code':_0x3a427b[_0xb6d3('0xf')]},'headers':{'Content-Type':_0xb6d3('0x16')}};return rp(_0x1514c3)[_0xb6d3('0x17')](function(_0x2e3d87){var _0x3145b7=JSON[_0xb6d3('0x18')](_0x2e3d87);if(_0x3145b7[_0xb6d3('0x19')]){_0x3a427b[_0xb6d3('0x1a')]=_0x3145b7['refresh_token'];logger['info'](util[_0xb6d3('0x1b')](_0xb6d3('0x1c'),_0x3a427b[_0xb6d3('0x1d')],_0x3a427b['id']));}else{logger[_0xb6d3('0x1e')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3a427b[_0xb6d3('0x1d')],_0x3a427b['id']),util['inspect'](_0x3145b7,{'showHidden':![],'depth':null}));}return _0x199842(null,_0x37fca1);})['catch'](function(_0x5b356b){logger[_0xb6d3('0x1e')](util[_0xb6d3('0x1b')](_0xb6d3('0x1f'),_0x3a427b[_0xb6d3('0x1d')],_0x3a427b['id']),util[_0xb6d3('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x199842(_0x5b356b);});}else{return _0x199842(null,_0x37fca1);}},'beforeUpdate':function(_0x59f22c,_0x3212d6,_0x173a10){if(_0x59f22c[_0xb6d3('0xc')](_0xb6d3('0xd'))||_0x59f22c[_0xb6d3('0xc')](_0xb6d3('0x21'))||_0x59f22c[_0xb6d3('0xc')](_0xb6d3('0x15'))||_0x59f22c[_0xb6d3('0xc')](_0xb6d3('0xe'))||_0x59f22c[_0xb6d3('0xc')](_0xb6d3('0xf'))||_0x59f22c[_0xb6d3('0xc')](_0xb6d3('0x22'))){var _0x4efd15,_0x17cbeb;_0x4efd15=_0x59f22c[_0xb6d3('0x21')];var _0xc496ac=_0x4efd15[_0xb6d3('0x23')](-0x1);if(_0xc496ac==='/'||_0xc496ac==='\x5c'||_0xc496ac===':'){_0x4efd15=_0x4efd15['substring'](0x0,_0x4efd15[_0xb6d3('0x24')](_0xc496ac));}switch(_0x59f22c[_0xb6d3('0xd')]){case'US':_0x17cbeb=_0xb6d3('0x11');break;case'AU':_0x17cbeb='https://accounts.zoho.com.au';break;case'IN':_0x17cbeb='https://accounts.zoho.in';break;case'CN':_0x17cbeb='https://accounts.zoho.com.cn';break;default:_0x17cbeb=_0xb6d3('0x13');break;}var _0x22e826={'method':_0xb6d3('0x25'),'uri':_0x17cbeb+'/oauth/v2/token','form':{'grant_type':_0xb6d3('0x26'),'client_id':_0x59f22c['clientId'],'client_secret':_0x59f22c[_0xb6d3('0xe')],'redirect_uri':_0x59f22c[_0xb6d3('0x21')],'code':_0x59f22c[_0xb6d3('0xf')]},'headers':{'Content-Type':_0xb6d3('0x16')}};return rp(_0x22e826)[_0xb6d3('0x17')](function(_0x3411ab){var _0x2e6a98=JSON['parse'](_0x3411ab);if(_0x2e6a98['refresh_token']){_0x59f22c[_0xb6d3('0x1a')]=_0x2e6a98[_0xb6d3('0x19')];logger[_0xb6d3('0x27')](util[_0xb6d3('0x1b')](_0xb6d3('0x1c'),_0x59f22c[_0xb6d3('0x1d')],_0x59f22c['id']));}else{logger[_0xb6d3('0x1e')](util[_0xb6d3('0x1b')](_0xb6d3('0x1f'),_0x59f22c[_0xb6d3('0x1d')],_0x59f22c['id']),util[_0xb6d3('0x20')](_0x2e6a98,{'showHidden':![],'depth':null}));}return _0x173a10(null,_0x3212d6);})[_0xb6d3('0x28')](function(_0x31cb0c){logger[_0xb6d3('0x1e')](util[_0xb6d3('0x1b')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x59f22c[_0xb6d3('0x1d')],_0x59f22c['id']),util[_0xb6d3('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x173a10(_0x31cb0c);});}else{return _0x173a10(null,_0x3212d6);}}}});}; \ No newline at end of file +var _0xa82d=['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','catch','error','refresh_token','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','serverUrl','application/x-www-form-urlencoded','then','parse','refreshToken','info','format'];(function(_0x4a8312,_0x1dd2e5){var _0x3fd016=function(_0x27cff0){while(--_0x27cff0){_0x4a8312['push'](_0x4a8312['shift']());}};_0x3fd016(++_0x1dd2e5);}(_0xa82d,0xde));var _0xda82=function(_0x5c6b47,_0x42d63a){_0x5c6b47=_0x5c6b47-0x0;var _0x47e5ff=_0xa82d[_0x5c6b47];return _0x47e5ff;};'use strict';var _=require(_0xda82('0x0'));var util=require(_0xda82('0x1'));var logger=require(_0xda82('0x2'))(_0xda82('0x3'));var moment=require(_0xda82('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xda82('0x5'));var rimraf=require(_0xda82('0x6'));var config=require(_0xda82('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xda82('0x8')]=function(_0x489f39,_0x25d495){return _0x489f39[_0xda82('0x9')](_0xda82('0xa'),attributes,{'tableName':_0xda82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x436991,_0x4d2bca,_0x2323ca){if(_0x436991[_0xda82('0xc')](_0xda82('0xd'))||_0x436991[_0xda82('0xc')]('serverUrl')||_0x436991[_0xda82('0xc')](_0xda82('0xe'))||_0x436991[_0xda82('0xc')](_0xda82('0xf'))||_0x436991[_0xda82('0xc')](_0xda82('0x10'))||_0x436991['changed'](_0xda82('0x11'))){var _0xfc0f8f,_0x72c95f;_0xfc0f8f=_0x436991['serverUrl'];var _0x2f5617=_0xfc0f8f[_0xda82('0x12')](-0x1);if(_0x2f5617==='/'||_0x2f5617==='\x5c'||_0x2f5617===':'){_0xfc0f8f=_0xfc0f8f[_0xda82('0x13')](0x0,_0xfc0f8f[_0xda82('0x14')](_0x2f5617));}switch(_0x436991[_0xda82('0xd')]){case'US':_0x72c95f=_0xda82('0x15');break;case'AU':_0x72c95f=_0xda82('0x16');break;case'IN':_0x72c95f=_0xda82('0x17');break;case'CN':_0x72c95f=_0xda82('0x18');break;default:_0x72c95f=_0xda82('0x19');break;}var _0x1b32b9={'method':_0xda82('0x1a'),'uri':_0x72c95f+_0xda82('0x1b'),'form':{'grant_type':_0xda82('0x1c'),'client_id':_0x436991[_0xda82('0xe')],'client_secret':_0x436991[_0xda82('0xf')],'redirect_uri':_0x436991[_0xda82('0x1d')],'code':_0x436991[_0xda82('0x10')]},'headers':{'Content-Type':_0xda82('0x1e')}};return rp(_0x1b32b9)[_0xda82('0x1f')](function(_0x4689f0){var _0x27444e=JSON[_0xda82('0x20')](_0x4689f0);if(_0x27444e['refresh_token']){_0x436991[_0xda82('0x21')]=_0x27444e['refresh_token'];logger[_0xda82('0x22')](util[_0xda82('0x23')](_0xda82('0x24'),_0x436991[_0xda82('0x25')],_0x436991['id']));}else{logger['error'](util[_0xda82('0x23')](_0xda82('0x26'),_0x436991[_0xda82('0x25')],_0x436991['id']),util[_0xda82('0x27')](_0x27444e,{'showHidden':![],'depth':null}));}return _0x2323ca(null,_0x4d2bca);})[_0xda82('0x28')](function(_0x5e9ca1){logger[_0xda82('0x29')](util[_0xda82('0x23')](_0xda82('0x26'),_0x436991['name'],_0x436991['id']),util[_0xda82('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x2323ca(_0x5e9ca1);});}else{return _0x2323ca(null,_0x4d2bca);}},'beforeUpdate':function(_0x71ed60,_0x5823d1,_0x32b7db){if(_0x71ed60[_0xda82('0xc')]('zone')||_0x71ed60[_0xda82('0xc')](_0xda82('0x1d'))||_0x71ed60[_0xda82('0xc')](_0xda82('0xe'))||_0x71ed60['changed'](_0xda82('0xf'))||_0x71ed60[_0xda82('0xc')](_0xda82('0x10'))||_0x71ed60[_0xda82('0xc')]('host')){var _0xfa4d23,_0x16c863;_0xfa4d23=_0x71ed60[_0xda82('0x1d')];var _0x224d72=_0xfa4d23[_0xda82('0x12')](-0x1);if(_0x224d72==='/'||_0x224d72==='\x5c'||_0x224d72===':'){_0xfa4d23=_0xfa4d23[_0xda82('0x13')](0x0,_0xfa4d23['lastIndexOf'](_0x224d72));}switch(_0x71ed60[_0xda82('0xd')]){case'US':_0x16c863=_0xda82('0x15');break;case'AU':_0x16c863=_0xda82('0x16');break;case'IN':_0x16c863=_0xda82('0x17');break;case'CN':_0x16c863='https://accounts.zoho.com.cn';break;default:_0x16c863=_0xda82('0x19');break;}var _0x229285={'method':_0xda82('0x1a'),'uri':_0x16c863+'/oauth/v2/token','form':{'grant_type':_0xda82('0x1c'),'client_id':_0x71ed60[_0xda82('0xe')],'client_secret':_0x71ed60['clientSecret'],'redirect_uri':_0x71ed60[_0xda82('0x1d')],'code':_0x71ed60[_0xda82('0x10')]},'headers':{'Content-Type':_0xda82('0x1e')}};return rp(_0x229285)['then'](function(_0x6adf82){var _0x227be8=JSON[_0xda82('0x20')](_0x6adf82);if(_0x227be8[_0xda82('0x2a')]){_0x71ed60[_0xda82('0x21')]=_0x227be8[_0xda82('0x2a')];logger[_0xda82('0x22')](util[_0xda82('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x71ed60['name'],_0x71ed60['id']));}else{logger[_0xda82('0x29')](util['format'](_0xda82('0x26'),_0x71ed60[_0xda82('0x25')],_0x71ed60['id']),util['inspect'](_0x227be8,{'showHidden':![],'depth':null}));}return _0x32b7db(null,_0x5823d1);})[_0xda82('0x28')](function(_0x484afb){logger[_0xda82('0x29')](util[_0xda82('0x23')](_0xda82('0x26'),_0x71ed60[_0xda82('0x25')],_0x71ed60['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x32b7db(_0x484afb);});}else{return _0x32b7db(null,_0x5823d1);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index b4c9655..3ab2a7a 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 _0x88c7=['info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','include','map','model','ShowZohoAccount','find','raw','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x88c7,0x6f));var _0x788c=function(_0x3ba3b7,_0x4f6f07){_0x3ba3b7=_0x3ba3b7-0x0;var _0xf68e5d=_0x88c7[_0x3ba3b7];return _0xf68e5d;};'use strict';var _=require(_0x788c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x788c('0x1'));var rs=require(_0x788c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x788c('0x3'));var logger=require(_0x788c('0x4'))('rpc');var config=require(_0x788c('0x5'));var jayson=require(_0x788c('0x6'));var client=jayson['client'][_0x788c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ed470,_0x54808d,_0x5dde40){return new BPromise(function(_0xe8843b,_0x27abaf){return client[_0x788c('0x8')](_0x2ed470,_0x5dde40)[_0x788c('0x9')](function(_0x43f746){logger['info'](_0x788c('0xa'),_0x54808d,_0x788c('0xb'));logger[_0x788c('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x54808d,_0x788c('0xb'),JSON[_0x788c('0xd')](_0x43f746));if(_0x43f746[_0x788c('0xe')]){if(_0x43f746[_0x788c('0xe')][_0x788c('0xf')]===0x1f4){logger[_0x788c('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x54808d,_0x43f746[_0x788c('0xe')]['message']);return _0x27abaf(_0x43f746[_0x788c('0xe')]['message']);}logger[_0x788c('0xe')](_0x788c('0xa'),_0x54808d,_0x43f746[_0x788c('0xe')][_0x788c('0x10')]);return _0xe8843b(_0x43f746[_0x788c('0xe')][_0x788c('0x10')]);}else{logger[_0x788c('0x11')](_0x788c('0xa'),_0x54808d,_0x788c('0xb'));_0xe8843b(_0x43f746[_0x788c('0x12')][_0x788c('0x10')]);}})[_0x788c('0x13')](function(_0x2c57c3){logger['error'](_0x788c('0xa'),_0x54808d,_0x2c57c3);_0x27abaf(_0x2c57c3);});});}exports[_0x788c('0x14')]=function(_0x2812db){var _0x2988df=this;return new Promise(function(_0x3f16a4,_0x8125){return db[_0x788c('0x15')][_0x788c('0x16')]({'raw':_0x2812db[_0x788c('0x17')]?_0x2812db[_0x788c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2812db[_0x788c('0x17')]?_0x2812db[_0x788c('0x17')][_0x788c('0x18')]||null:null,'attributes':_0x2812db[_0x788c('0x17')]?_0x2812db[_0x788c('0x17')][_0x788c('0x19')]||null:null,'limit':_0x2812db[_0x788c('0x17')]?_0x2812db[_0x788c('0x17')]['limit']||null:null,'include':_0x2812db[_0x788c('0x17')]?_0x2812db[_0x788c('0x17')][_0x788c('0x1a')]?_[_0x788c('0x1b')](_0x2812db[_0x788c('0x17')][_0x788c('0x1a')],function(_0x14deb4){return{'model':db[_0x14deb4[_0x788c('0x1c')]],'as':_0x14deb4['as'],'attributes':_0x14deb4['attributes'],'include':_0x14deb4[_0x788c('0x1a')]?_[_0x788c('0x1b')](_0x14deb4['include'],function(_0x14e2f1){return{'model':db[_0x14e2f1[_0x788c('0x1c')]],'as':_0x14e2f1['as'],'attributes':_0x14e2f1[_0x788c('0x19')],'include':_0x14e2f1['include']?_[_0x788c('0x1b')](_0x14e2f1[_0x788c('0x1a')],function(_0x28fa56){return{'model':db[_0x28fa56[_0x788c('0x1c')]],'as':_0x28fa56['as'],'attributes':_0x28fa56[_0x788c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x788c('0x9')](function(_0x271218){logger[_0x788c('0x11')](_0x788c('0x14'),_0x2812db);logger['debug'](_0x788c('0x14'),_0x2812db,JSON[_0x788c('0xd')](_0x271218));_0x3f16a4(_0x271218);})[_0x788c('0x13')](function(_0x18b271){logger[_0x788c('0xe')](_0x788c('0x14'),_0x18b271[_0x788c('0x10')],_0x2812db);_0x8125(_0x2988df[_0x788c('0xe')](0x1f4,_0x18b271[_0x788c('0x10')]));});});};exports[_0x788c('0x1d')]=function(_0x4d41ac){var _0xedb12e=this;return new Promise(function(_0x4e9b20,_0x2b9bbb){return db[_0x788c('0x15')][_0x788c('0x1e')]({'raw':_0x4d41ac[_0x788c('0x17')]?_0x4d41ac[_0x788c('0x17')][_0x788c('0x1f')]===undefined?!![]:![]:!![],'where':_0x4d41ac['options']?_0x4d41ac[_0x788c('0x17')]['where']||null:null,'attributes':_0x4d41ac[_0x788c('0x17')]?_0x4d41ac['options'][_0x788c('0x19')]||null:null,'include':_0x4d41ac['options']?_0x4d41ac[_0x788c('0x17')]['include']?_['map'](_0x4d41ac[_0x788c('0x17')][_0x788c('0x1a')],function(_0x4eced2){return{'model':db[_0x4eced2[_0x788c('0x1c')]],'as':_0x4eced2['as'],'attributes':_0x4eced2[_0x788c('0x19')],'include':_0x4eced2['include']?_[_0x788c('0x1b')](_0x4eced2['include'],function(_0x581e7e){return{'model':db[_0x581e7e[_0x788c('0x1c')]],'as':_0x581e7e['as'],'attributes':_0x581e7e[_0x788c('0x19')],'include':_0x581e7e[_0x788c('0x1a')]?_['map'](_0x581e7e['include'],function(_0x468557){return{'model':db[_0x468557[_0x788c('0x1c')]],'as':_0x468557['as'],'attributes':_0x468557['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5040f0){logger[_0x788c('0x11')]('ShowZohoAccount',_0x4d41ac);logger[_0x788c('0xc')](_0x788c('0x1d'),_0x4d41ac,JSON[_0x788c('0xd')](_0x5040f0));_0x4e9b20(_0x5040f0);})[_0x788c('0x13')](function(_0x9a0da7){logger[_0x788c('0xe')]('ShowZohoAccount',_0x9a0da7[_0x788c('0x10')],_0x4d41ac);_0x2b9bbb(_0xedb12e[_0x788c('0xe')](0x1f4,_0x9a0da7[_0x788c('0x10')]));});});}; \ No newline at end of file +var _0xa76e=['info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','attributes','limit','include','map','model','ShowZohoAccount','find','where','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x4373c4,_0x126d71){var _0x26fbac=function(_0x465d74){while(--_0x465d74){_0x4373c4['push'](_0x4373c4['shift']());}};_0x26fbac(++_0x126d71);}(_0xa76e,0xfe));var _0xea76=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xa76e[_0x5c6299];return _0x23b564;};'use strict';var _=require('lodash');var util=require(_0xea76('0x0'));var moment=require(_0xea76('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea76('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea76('0x3'));var logger=require(_0xea76('0x4'))(_0xea76('0x5'));var config=require('../../config/environment');var jayson=require(_0xea76('0x6'));var client=jayson['client'][_0xea76('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ee974,_0x45ac1b,_0x1735ff){return new BPromise(function(_0x5eb746,_0x55aae7){return client[_0xea76('0x8')](_0x4ee974,_0x1735ff)[_0xea76('0x9')](function(_0x1c6723){logger[_0xea76('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x45ac1b,_0xea76('0xb'));logger[_0xea76('0xc')](_0xea76('0xd'),_0x45ac1b,'request\x20sent',JSON[_0xea76('0xe')](_0x1c6723));if(_0x1c6723[_0xea76('0xf')]){if(_0x1c6723[_0xea76('0xf')][_0xea76('0x10')]===0x1f4){logger[_0xea76('0xf')](_0xea76('0x11'),_0x45ac1b,_0x1c6723[_0xea76('0xf')][_0xea76('0x12')]);return _0x55aae7(_0x1c6723[_0xea76('0xf')][_0xea76('0x12')]);}logger[_0xea76('0xf')](_0xea76('0x11'),_0x45ac1b,_0x1c6723[_0xea76('0xf')][_0xea76('0x12')]);return _0x5eb746(_0x1c6723[_0xea76('0xf')]['message']);}else{logger[_0xea76('0xa')](_0xea76('0x11'),_0x45ac1b,_0xea76('0xb'));_0x5eb746(_0x1c6723[_0xea76('0x13')][_0xea76('0x12')]);}})[_0xea76('0x14')](function(_0x3b47fa){logger[_0xea76('0xf')](_0xea76('0x11'),_0x45ac1b,_0x3b47fa);_0x55aae7(_0x3b47fa);});});}exports[_0xea76('0x15')]=function(_0x210e27){var _0x1efdfa=this;return new Promise(function(_0x5ecdd1,_0x49bc4a){return db[_0xea76('0x16')]['findAll']({'raw':_0x210e27[_0xea76('0x17')]?_0x210e27[_0xea76('0x17')][_0xea76('0x18')]===undefined?!![]:![]:!![],'where':_0x210e27['options']?_0x210e27['options']['where']||null:null,'attributes':_0x210e27[_0xea76('0x17')]?_0x210e27[_0xea76('0x17')][_0xea76('0x19')]||null:null,'limit':_0x210e27[_0xea76('0x17')]?_0x210e27['options'][_0xea76('0x1a')]||null:null,'include':_0x210e27['options']?_0x210e27[_0xea76('0x17')][_0xea76('0x1b')]?_[_0xea76('0x1c')](_0x210e27[_0xea76('0x17')][_0xea76('0x1b')],function(_0x337a78){return{'model':db[_0x337a78[_0xea76('0x1d')]],'as':_0x337a78['as'],'attributes':_0x337a78[_0xea76('0x19')],'include':_0x337a78[_0xea76('0x1b')]?_[_0xea76('0x1c')](_0x337a78[_0xea76('0x1b')],function(_0x1729a2){return{'model':db[_0x1729a2[_0xea76('0x1d')]],'as':_0x1729a2['as'],'attributes':_0x1729a2[_0xea76('0x19')],'include':_0x1729a2[_0xea76('0x1b')]?_[_0xea76('0x1c')](_0x1729a2['include'],function(_0x163dc7){return{'model':db[_0x163dc7['model']],'as':_0x163dc7['as'],'attributes':_0x163dc7['attributes']};}):[]};}):[]};}):[]:[]})[_0xea76('0x9')](function(_0x8a66ac){logger[_0xea76('0xa')](_0xea76('0x15'),_0x210e27);logger[_0xea76('0xc')](_0xea76('0x15'),_0x210e27,JSON[_0xea76('0xe')](_0x8a66ac));_0x5ecdd1(_0x8a66ac);})['catch'](function(_0x5c7960){logger[_0xea76('0xf')](_0xea76('0x15'),_0x5c7960[_0xea76('0x12')],_0x210e27);_0x49bc4a(_0x1efdfa[_0xea76('0xf')](0x1f4,_0x5c7960[_0xea76('0x12')]));});});};exports[_0xea76('0x1e')]=function(_0x12c18f){var _0xbbef85=this;return new Promise(function(_0x203447,_0x2dccd7){return db[_0xea76('0x16')][_0xea76('0x1f')]({'raw':_0x12c18f[_0xea76('0x17')]?_0x12c18f[_0xea76('0x17')][_0xea76('0x18')]===undefined?!![]:![]:!![],'where':_0x12c18f['options']?_0x12c18f[_0xea76('0x17')][_0xea76('0x20')]||null:null,'attributes':_0x12c18f[_0xea76('0x17')]?_0x12c18f['options'][_0xea76('0x19')]||null:null,'include':_0x12c18f[_0xea76('0x17')]?_0x12c18f[_0xea76('0x17')][_0xea76('0x1b')]?_['map'](_0x12c18f[_0xea76('0x17')]['include'],function(_0x5aab4f){return{'model':db[_0x5aab4f[_0xea76('0x1d')]],'as':_0x5aab4f['as'],'attributes':_0x5aab4f['attributes'],'include':_0x5aab4f['include']?_[_0xea76('0x1c')](_0x5aab4f[_0xea76('0x1b')],function(_0x424bbb){return{'model':db[_0x424bbb[_0xea76('0x1d')]],'as':_0x424bbb['as'],'attributes':_0x424bbb[_0xea76('0x19')],'include':_0x424bbb['include']?_[_0xea76('0x1c')](_0x424bbb['include'],function(_0xd9e306){return{'model':db[_0xd9e306[_0xea76('0x1d')]],'as':_0xd9e306['as'],'attributes':_0xd9e306[_0xea76('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x112f1d){logger['info']('ShowZohoAccount',_0x12c18f);logger[_0xea76('0xc')](_0xea76('0x1e'),_0x12c18f,JSON[_0xea76('0xe')](_0x112f1d));_0x203447(_0x112f1d);})[_0xea76('0x14')](function(_0x125322){logger[_0xea76('0xf')](_0xea76('0x1e'),_0x125322[_0xea76('0x12')],_0x12c18f);_0x2dccd7(_0xbbef85[_0xea76('0xf')](0x1f4,_0x125322[_0xea76('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 5ff0ef9..ce85e96 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 _0x1981=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create'];(function(_0x59d9b2,_0x3710cc){var _0x4e0966=function(_0x5ee264){while(--_0x5ee264){_0x59d9b2['push'](_0x59d9b2['shift']());}};_0x4e0966(++_0x3710cc);}(_0x1981,0xdc));var _0x1198=function(_0x9f79f1,_0xcfdcd9){_0x9f79f1=_0x9f79f1-0x0;var _0x4da7c8=_0x1981[_0x9f79f1];return _0x4da7c8;};'use strict';var multer=require(_0x1198('0x0'));var util=require(_0x1198('0x1'));var path=require(_0x1198('0x2'));var timeout=require(_0x1198('0x3'));var express=require(_0x1198('0x4'));var router=express[_0x1198('0x5')]();var fs_extra=require(_0x1198('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1198('0x7'));var controller=require(_0x1198('0x8'));router[_0x1198('0x9')]('/',auth[_0x1198('0xa')](),controller[_0x1198('0xb')]);router[_0x1198('0x9')](_0x1198('0xc'),auth[_0x1198('0xa')](),controller[_0x1198('0xd')]);router['get'](_0x1198('0xe'),auth[_0x1198('0xa')](),controller[_0x1198('0xf')]);router[_0x1198('0x9')](_0x1198('0x10'),auth[_0x1198('0xa')](),controller[_0x1198('0x11')]);router['get']('/:id/descriptions',auth[_0x1198('0xa')](),controller['getDescriptions']);router[_0x1198('0x12')]('/',auth[_0x1198('0xa')](),controller[_0x1198('0x13')]);router[_0x1198('0x14')](_0x1198('0xc'),auth[_0x1198('0xa')](),controller[_0x1198('0x15')]);router[_0x1198('0x16')](_0x1198('0xc'),auth[_0x1198('0xa')](),controller['destroy']);module[_0x1198('0x17')]=router; \ No newline at end of file +var _0x104c=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x1b0a9d,_0x45a72a){var _0x719225=function(_0x5038d9){while(--_0x5038d9){_0x1b0a9d['push'](_0x1b0a9d['shift']());}};_0x719225(++_0x45a72a);}(_0x104c,0x137));var _0xc104=function(_0x3b6aaf,_0x4aef36){_0x3b6aaf=_0x3b6aaf-0x0;var _0x295fa9=_0x104c[_0x3b6aaf];return _0x295fa9;};'use strict';var multer=require(_0xc104('0x0'));var util=require(_0xc104('0x1'));var path=require(_0xc104('0x2'));var timeout=require('connect-timeout');var express=require(_0xc104('0x3'));var router=express[_0xc104('0x4')]();var fs_extra=require(_0xc104('0x5'));var auth=require(_0xc104('0x6'));var interaction=require(_0xc104('0x7'));var config=require(_0xc104('0x8'));var controller=require(_0xc104('0x9'));router[_0xc104('0xa')]('/',auth[_0xc104('0xb')](),controller[_0xc104('0xc')]);router[_0xc104('0xa')](_0xc104('0xd'),auth[_0xc104('0xb')](),controller[_0xc104('0xe')]);router[_0xc104('0xa')](_0xc104('0xf'),auth[_0xc104('0xb')](),controller['getFields']);router[_0xc104('0xa')](_0xc104('0x10'),auth[_0xc104('0xb')](),controller[_0xc104('0x11')]);router[_0xc104('0xa')](_0xc104('0x12'),auth[_0xc104('0xb')](),controller['getDescriptions']);router[_0xc104('0x13')]('/',auth[_0xc104('0xb')](),controller[_0xc104('0x14')]);router[_0xc104('0x15')](_0xc104('0xd'),auth['isAuthenticated'](),controller[_0xc104('0x16')]);router['delete'](_0xc104('0xd'),auth[_0xc104('0xb')](),controller[_0xc104('0x17')]);module[_0xc104('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f348576..2ab2044 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 _0x1d24=['exports','STRING','contact','nothing','lead','contact_lead','sequelize'];(function(_0x4048c3,_0x139b09){var _0x2278d2=function(_0x60d117){while(--_0x60d117){_0x4048c3['push'](_0x4048c3['shift']());}};_0x2278d2(++_0x139b09);}(_0x1d24,0xa7));var _0x41d2=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0x1d24[_0x488ca1];return _0x4dd0a4;};'use strict';var Sequelize=require(_0x41d2('0x0'));module[_0x41d2('0x1')]={'name':{'type':Sequelize[_0x41d2('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x41d2('0x3'),_0x41d2('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0x41d2('0x5')),'defaultValue':_0x41d2('0x6')},'description':{'type':Sequelize[_0x41d2('0x2')]}}; \ No newline at end of file +var _0xcef3=['sequelize','exports','contact','nothing','lead','ENUM','contact_lead','STRING'];(function(_0x454876,_0x580571){var _0x1084e6=function(_0x31af3a){while(--_0x31af3a){_0x454876['push'](_0x454876['shift']());}};_0x1084e6(++_0x580571);}(_0xcef3,0x88));var _0x3cef=function(_0x4bb93d,_0x1cda9a){_0x4bb93d=_0x4bb93d-0x0;var _0x106b4f=_0xcef3[_0x4bb93d];return _0x106b4f;};'use strict';var Sequelize=require(_0x3cef('0x0'));module[_0x3cef('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x3cef('0x2'),_0x3cef('0x3')),'defaultValue':_0x3cef('0x4')},'moduleSearch':{'type':Sequelize[_0x3cef('0x5')](_0x3cef('0x6'),_0x3cef('0x2'),'lead'),'defaultValue':_0x3cef('0x6')},'description':{'type':Sequelize[_0x3cef('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 70e0176..9ce2950 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 _0x8cb5=['body','params','pick','getFields','hasOwnProperty','getSubjects','findOne','ZohoField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','reject','then','destroy','end','error','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','include','find','create'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8cb5,0x1ef));var _0x58cb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8cb5[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x58cb('0x0'));var rimraf=require(_0x58cb('0x1'));var zipdir=require(_0x58cb('0x2'));var jsonpatch=require(_0x58cb('0x3'));var rp=require(_0x58cb('0x4'));var moment=require(_0x58cb('0x5'));var BPromise=require(_0x58cb('0x6'));var Mustache=require(_0x58cb('0x7'));var util=require(_0x58cb('0x8'));var path=require(_0x58cb('0x9'));var sox=require(_0x58cb('0xa'));var csv=require('to-csv');var ejs=require(_0x58cb('0xb'));var fs=require('fs');var fs_extra=require(_0x58cb('0xc'));var _=require('lodash');var squel=require(_0x58cb('0xd'));var crypto=require(_0x58cb('0xe'));var jsforce=require(_0x58cb('0xf'));var deskjs=require(_0x58cb('0x10'));var toCsv=require(_0x58cb('0x11'));var querystring=require(_0x58cb('0x12'));var Papa=require(_0x58cb('0x13'));var Redis=require(_0x58cb('0x14'));var authService=require(_0x58cb('0x15'));var qs=require(_0x58cb('0x16'));var as=require(_0x58cb('0x17'));var hardwareService=require(_0x58cb('0x18'));var logger=require(_0x58cb('0x19'))(_0x58cb('0x1a'));var utils=require(_0x58cb('0x1b'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x58cb('0x1c'))['db'];function respondWithStatusCode(_0x17b28a,_0x32dd0a){_0x32dd0a=_0x32dd0a||0xcc;return function(_0x4478aa){if(_0x4478aa){return _0x17b28a[_0x58cb('0x1d')](_0x32dd0a);}return _0x17b28a[_0x58cb('0x1e')](_0x32dd0a)['end']();};}function respondWithResult(_0x1588d7,_0x281512){_0x281512=_0x281512||0xc8;return function(_0x44df5e){if(_0x44df5e){return _0x1588d7[_0x58cb('0x1e')](_0x281512)[_0x58cb('0x1f')](_0x44df5e);}};}function respondWithFilteredResult(_0x255f95,_0x1ef368){return function(_0x27f01b){if(_0x27f01b){var _0x2035b9=typeof _0x1ef368[_0x58cb('0x20')]==='undefined'&&typeof _0x1ef368[_0x58cb('0x21')]==='undefined';var _0x41c16c=_0x27f01b[_0x58cb('0x22')];var _0x11a864=_0x2035b9?0x0:_0x1ef368[_0x58cb('0x20')];var _0xc8942b=_0x2035b9?_0x27f01b['count']:_0x1ef368[_0x58cb('0x20')]+_0x1ef368[_0x58cb('0x21')];var _0x5b7a04;if(_0xc8942b>=_0x41c16c){_0xc8942b=_0x41c16c;_0x5b7a04=0xc8;}else{_0x5b7a04=0xce;}_0x255f95[_0x58cb('0x1e')](_0x5b7a04);return _0x255f95[_0x58cb('0x23')]('Content-Range',_0x11a864+'-'+_0xc8942b+'/'+_0x41c16c)['json'](_0x27f01b);}return null;};}function patchUpdates(_0x2ea004){return function(_0x3adf96){try{jsonpatch[_0x58cb('0x24')](_0x3adf96,_0x2ea004,!![]);}catch(_0x5c78ba){return BPromise[_0x58cb('0x25')](_0x5c78ba);}return _0x3adf96['save']();};}function saveUpdates(_0x1d8db8,_0x1f2b31){return function(_0x29c1a1){if(_0x29c1a1){return _0x29c1a1['update'](_0x1d8db8)[_0x58cb('0x26')](function(_0x16770e){return _0x16770e;});}return null;};}function removeEntity(_0xacc6f3,_0x1de680){return function(_0x4dd99a){if(_0x4dd99a){return _0x4dd99a[_0x58cb('0x27')]()[_0x58cb('0x26')](function(){_0xacc6f3[_0x58cb('0x1e')](0xcc)[_0x58cb('0x28')]();});}};}function handleEntityNotFound(_0x362c60,_0x53185f){return function(_0x64215b){if(!_0x64215b){_0x362c60[_0x58cb('0x1d')](0x194);}return _0x64215b;};}function handleError(_0x1bda0f,_0xfb5f44){_0xfb5f44=_0xfb5f44||0x1f4;return function(_0x348015){logger[_0x58cb('0x29')](_0x348015['stack']);if(_0x348015[_0x58cb('0x2a')]){delete _0x348015[_0x58cb('0x2a')];}_0x1bda0f[_0x58cb('0x1e')](_0xfb5f44)[_0x58cb('0x2b')](_0x348015);};}exports['index']=function(_0x4fc185,_0x1f79ff){var _0x8cb372={},_0x4bde8b={},_0x58ce2b={'count':0x0,'rows':[]};var _0x22a2a1=_[_0x58cb('0x2c')](db[_0x58cb('0x2d')][_0x58cb('0x2e')],function(_0x5ea8c3){return{'name':_0x5ea8c3[_0x58cb('0x2f')],'type':_0x5ea8c3[_0x58cb('0x30')]['key']};});_0x4bde8b[_0x58cb('0x31')]=_[_0x58cb('0x2c')](_0x22a2a1,'name');_0x4bde8b['query']=_[_0x58cb('0x32')](_0x4fc185['query']);_0x4bde8b[_0x58cb('0x33')]=_[_0x58cb('0x34')](_0x4bde8b[_0x58cb('0x31')],_0x4bde8b[_0x58cb('0x35')]);_0x8cb372[_0x58cb('0x36')]=_[_0x58cb('0x34')](_0x4bde8b['model'],qs[_0x58cb('0x37')](_0x4fc185[_0x58cb('0x35')][_0x58cb('0x37')]));_0x8cb372['attributes']=_0x8cb372[_0x58cb('0x36')][_0x58cb('0x38')]?_0x8cb372[_0x58cb('0x36')]:_0x4bde8b['model'];if(!_0x4fc185[_0x58cb('0x35')]['hasOwnProperty'](_0x58cb('0x39'))){_0x8cb372['limit']=qs[_0x58cb('0x21')](_0x4fc185[_0x58cb('0x35')][_0x58cb('0x21')]);_0x8cb372[_0x58cb('0x20')]=qs[_0x58cb('0x20')](_0x4fc185[_0x58cb('0x35')][_0x58cb('0x20')]);}_0x8cb372[_0x58cb('0x3a')]=qs[_0x58cb('0x3b')](_0x4fc185[_0x58cb('0x35')]['sort']);_0x8cb372[_0x58cb('0x3c')]=qs[_0x58cb('0x33')](_['pick'](_0x4fc185['query'],_0x4bde8b[_0x58cb('0x33')]),_0x22a2a1);if(_0x4fc185[_0x58cb('0x35')]['filter']){_0x8cb372[_0x58cb('0x3c')]=_[_0x58cb('0x3d')](_0x8cb372[_0x58cb('0x3c')],{'$or':_[_0x58cb('0x2c')](_0x22a2a1,function(_0x3c1cbc){if(_0x3c1cbc['type']!==_0x58cb('0x3e')){var _0x249454={};_0x249454[_0x3c1cbc[_0x58cb('0x2a')]]={'$like':'%'+_0x4fc185[_0x58cb('0x35')][_0x58cb('0x3f')]+'%'};return _0x249454;}})});}_0x8cb372=_[_0x58cb('0x3d')]({},_0x8cb372,_0x4fc185[_0x58cb('0x40')]);var _0x19d4b1={'where':_0x8cb372[_0x58cb('0x3c')]};return db[_0x58cb('0x2d')][_0x58cb('0x22')](_0x19d4b1)[_0x58cb('0x26')](function(_0x379d5a){_0x58ce2b[_0x58cb('0x22')]=_0x379d5a;if(_0x4fc185[_0x58cb('0x35')][_0x58cb('0x41')]){_0x8cb372['include']=[{'all':!![]}];}return db[_0x58cb('0x2d')]['findAll'](_0x8cb372);})['then'](function(_0x38a645){_0x58ce2b[_0x58cb('0x42')]=_0x38a645;return _0x58ce2b;})[_0x58cb('0x26')](respondWithFilteredResult(_0x1f79ff,_0x8cb372))[_0x58cb('0x43')](handleError(_0x1f79ff,null));};exports[_0x58cb('0x44')]=function(_0x3f1fe6,_0x464ecb){var _0xfba843={'raw':![],'where':{'id':_0x3f1fe6['params']['id']}},_0x59b7c7={};_0x59b7c7['model']=_['keys'](db[_0x58cb('0x2d')][_0x58cb('0x2e')]);_0x59b7c7['query']=_['keys'](_0x3f1fe6[_0x58cb('0x35')]);_0x59b7c7['filters']=_[_0x58cb('0x34')](_0x59b7c7['model'],_0x59b7c7[_0x58cb('0x35')]);_0xfba843['attributes']=_[_0x58cb('0x34')](_0x59b7c7['model'],qs[_0x58cb('0x37')](_0x3f1fe6['query'][_0x58cb('0x37')]));_0xfba843[_0x58cb('0x36')]=_0xfba843[_0x58cb('0x36')]['length']?_0xfba843['attributes']:_0x59b7c7['model'];if(_0x3f1fe6[_0x58cb('0x35')][_0x58cb('0x41')]){_0xfba843[_0x58cb('0x45')]=[{'all':!![]}];}_0xfba843=_[_0x58cb('0x3d')]({},_0xfba843,_0x3f1fe6['options']);return db[_0x58cb('0x2d')][_0x58cb('0x46')](_0xfba843)['then'](handleEntityNotFound(_0x464ecb,null))['then'](respondWithResult(_0x464ecb,null))[_0x58cb('0x43')](handleError(_0x464ecb,null));};exports[_0x58cb('0x47')]=function(_0x56d412,_0x4afb1a){return db[_0x58cb('0x2d')][_0x58cb('0x47')](_0x56d412['body'],{})[_0x58cb('0x26')](respondWithResult(_0x4afb1a,0xc9))['catch'](handleError(_0x4afb1a,null));};exports['update']=function(_0x1b044c,_0x167c06){if(_0x1b044c[_0x58cb('0x48')]['id']){delete _0x1b044c['body']['id'];}return db[_0x58cb('0x2d')][_0x58cb('0x46')]({'where':{'id':_0x1b044c[_0x58cb('0x49')]['id']}})[_0x58cb('0x26')](handleEntityNotFound(_0x167c06,null))['then'](saveUpdates(_0x1b044c[_0x58cb('0x48')],null))[_0x58cb('0x26')](respondWithResult(_0x167c06,null))[_0x58cb('0x43')](handleError(_0x167c06,null));};exports['destroy']=function(_0x4ff769,_0x15fc92){return db[_0x58cb('0x2d')][_0x58cb('0x46')]({'where':{'id':_0x4ff769[_0x58cb('0x49')]['id']}})[_0x58cb('0x26')](handleEntityNotFound(_0x15fc92,null))[_0x58cb('0x26')](removeEntity(_0x15fc92,null))[_0x58cb('0x43')](handleError(_0x15fc92,null));};exports['getFields']=function(_0xb363a2,_0x20bac0,_0x4e06bc){var _0x2804a2={};var _0x485832={};var _0x17bb4f;var _0x53466d;return db[_0x58cb('0x2d')]['findOne']({'where':{'id':_0xb363a2['params']['id']}})[_0x58cb('0x26')](handleEntityNotFound(_0x20bac0,null))[_0x58cb('0x26')](function(_0x4498a1){if(_0x4498a1){_0x17bb4f=_0x4498a1;_0x485832[_0x58cb('0x31')]=_[_0x58cb('0x32')](db['ZohoField'][_0x58cb('0x2e')]);_0x485832[_0x58cb('0x35')]=_[_0x58cb('0x32')](_0xb363a2[_0x58cb('0x35')]);_0x485832[_0x58cb('0x33')]=_[_0x58cb('0x34')](_0x485832[_0x58cb('0x31')],_0x485832[_0x58cb('0x35')]);_0x2804a2[_0x58cb('0x36')]=_[_0x58cb('0x34')](_0x485832['model'],qs[_0x58cb('0x37')](_0xb363a2[_0x58cb('0x35')][_0x58cb('0x37')]));_0x2804a2[_0x58cb('0x36')]=_0x2804a2[_0x58cb('0x36')][_0x58cb('0x38')]?_0x2804a2['attributes']:_0x485832[_0x58cb('0x31')];_0x2804a2[_0x58cb('0x3a')]=qs['sort'](_0xb363a2[_0x58cb('0x35')][_0x58cb('0x3b')]);_0x2804a2[_0x58cb('0x3c')]=qs[_0x58cb('0x33')](_[_0x58cb('0x4a')](_0xb363a2[_0x58cb('0x35')],_0x485832[_0x58cb('0x33')]));if(_0xb363a2[_0x58cb('0x35')][_0x58cb('0x3f')]){_0x2804a2[_0x58cb('0x3c')]=_[_0x58cb('0x3d')](_0x2804a2['where'],{'$or':_[_0x58cb('0x2c')](_0x2804a2['attributes'],function(_0x144b79){var _0x33ead5={};_0x33ead5[_0x144b79]={'$like':'%'+_0xb363a2[_0x58cb('0x35')][_0x58cb('0x3f')]+'%'};return _0x33ead5;})});}_0x2804a2=_[_0x58cb('0x3d')]({},_0x2804a2,_0xb363a2[_0x58cb('0x40')]);return _0x17bb4f[_0x58cb('0x4b')](_0x2804a2);}})[_0x58cb('0x26')](function(_0x5a4eb9){if(_0x5a4eb9){_0x53466d=_0x5a4eb9[_0x58cb('0x38')];if(!_0xb363a2[_0x58cb('0x35')][_0x58cb('0x4c')](_0x58cb('0x39'))){_0x2804a2[_0x58cb('0x21')]=qs['limit'](_0xb363a2[_0x58cb('0x35')][_0x58cb('0x21')]);_0x2804a2[_0x58cb('0x20')]=qs['offset'](_0xb363a2['query'][_0x58cb('0x20')]);}return _0x17bb4f[_0x58cb('0x4b')](_0x2804a2);}})[_0x58cb('0x26')](function(_0x248d2e){if(_0x248d2e){return _0x248d2e?{'count':_0x53466d,'rows':_0x248d2e}:null;}})[_0x58cb('0x26')](respondWithResult(_0x20bac0,null))[_0x58cb('0x43')](handleError(_0x20bac0,null));};exports[_0x58cb('0x4d')]=function(_0x25db41,_0x4e67a1,_0x1d4d82){var _0xfd499={};var _0x14e2ae={};var _0x2c6a19;var _0x5b9e47;return db['ZohoConfiguration'][_0x58cb('0x4e')]({'where':{'id':_0x25db41[_0x58cb('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e67a1,null))['then'](function(_0x1cd250){if(_0x1cd250){_0x2c6a19=_0x1cd250;_0x14e2ae[_0x58cb('0x31')]=_['keys'](db[_0x58cb('0x4f')][_0x58cb('0x2e')]);_0x14e2ae[_0x58cb('0x35')]=_[_0x58cb('0x32')](_0x25db41[_0x58cb('0x35')]);_0x14e2ae['filters']=_['intersection'](_0x14e2ae[_0x58cb('0x31')],_0x14e2ae[_0x58cb('0x35')]);_0xfd499['attributes']=_[_0x58cb('0x34')](_0x14e2ae['model'],qs[_0x58cb('0x37')](_0x25db41[_0x58cb('0x35')][_0x58cb('0x37')]));_0xfd499['attributes']=_0xfd499[_0x58cb('0x36')][_0x58cb('0x38')]?_0xfd499[_0x58cb('0x36')]:_0x14e2ae['model'];_0xfd499[_0x58cb('0x3a')]=qs[_0x58cb('0x3b')](_0x25db41[_0x58cb('0x35')][_0x58cb('0x3b')]);_0xfd499[_0x58cb('0x3c')]=qs[_0x58cb('0x33')](_[_0x58cb('0x4a')](_0x25db41[_0x58cb('0x35')],_0x14e2ae[_0x58cb('0x33')]));if(_0x25db41[_0x58cb('0x35')]['filter']){_0xfd499['where']=_['merge'](_0xfd499[_0x58cb('0x3c')],{'$or':_[_0x58cb('0x2c')](_0xfd499[_0x58cb('0x36')],function(_0x18295e){var _0x20a34f={};_0x20a34f[_0x18295e]={'$like':'%'+_0x25db41['query'][_0x58cb('0x3f')]+'%'};return _0x20a34f;})});}_0xfd499=_['merge']({},_0xfd499,_0x25db41['options']);return _0x2c6a19[_0x58cb('0x4d')](_0xfd499);}})[_0x58cb('0x26')](function(_0x26bd45){if(_0x26bd45){_0x5b9e47=_0x26bd45[_0x58cb('0x38')];if(!_0x25db41[_0x58cb('0x35')][_0x58cb('0x4c')](_0x58cb('0x39'))){_0xfd499[_0x58cb('0x21')]=qs['limit'](_0x25db41[_0x58cb('0x35')][_0x58cb('0x21')]);_0xfd499[_0x58cb('0x20')]=qs[_0x58cb('0x20')](_0x25db41[_0x58cb('0x35')]['offset']);}return _0x2c6a19[_0x58cb('0x4d')](_0xfd499);}})[_0x58cb('0x26')](function(_0x1a0cc3){if(_0x1a0cc3){return _0x1a0cc3?{'count':_0x5b9e47,'rows':_0x1a0cc3}:null;}})['then'](respondWithResult(_0x4e67a1,null))['catch'](handleError(_0x4e67a1,null));};exports[_0x58cb('0x50')]=function(_0xf421f8,_0x2c5f01,_0x3c0b96){var _0x11502b={};var _0xa34f19={};var _0x2a83df;var _0x203b94;return db[_0x58cb('0x2d')][_0x58cb('0x4e')]({'where':{'id':_0xf421f8[_0x58cb('0x49')]['id']}})[_0x58cb('0x26')](handleEntityNotFound(_0x2c5f01,null))['then'](function(_0x566b79){if(_0x566b79){_0x2a83df=_0x566b79;_0xa34f19['model']=_[_0x58cb('0x32')](db[_0x58cb('0x4f')][_0x58cb('0x2e')]);_0xa34f19[_0x58cb('0x35')]=_[_0x58cb('0x32')](_0xf421f8['query']);_0xa34f19['filters']=_[_0x58cb('0x34')](_0xa34f19[_0x58cb('0x31')],_0xa34f19[_0x58cb('0x35')]);_0x11502b[_0x58cb('0x36')]=_[_0x58cb('0x34')](_0xa34f19[_0x58cb('0x31')],qs['fields'](_0xf421f8['query'][_0x58cb('0x37')]));_0x11502b[_0x58cb('0x36')]=_0x11502b[_0x58cb('0x36')]['length']?_0x11502b[_0x58cb('0x36')]:_0xa34f19[_0x58cb('0x31')];_0x11502b['order']=qs[_0x58cb('0x3b')](_0xf421f8[_0x58cb('0x35')][_0x58cb('0x3b')]);_0x11502b[_0x58cb('0x3c')]=qs['filters'](_['pick'](_0xf421f8['query'],_0xa34f19[_0x58cb('0x33')]));if(_0xf421f8[_0x58cb('0x35')][_0x58cb('0x3f')]){_0x11502b[_0x58cb('0x3c')]=_[_0x58cb('0x3d')](_0x11502b[_0x58cb('0x3c')],{'$or':_['map'](_0x11502b[_0x58cb('0x36')],function(_0x2cf6da){var _0x940d0b={};_0x940d0b[_0x2cf6da]={'$like':'%'+_0xf421f8[_0x58cb('0x35')]['filter']+'%'};return _0x940d0b;})});}_0x11502b=_[_0x58cb('0x3d')]({},_0x11502b,_0xf421f8[_0x58cb('0x40')]);return _0x2a83df['getDescriptions'](_0x11502b);}})['then'](function(_0x344b56){if(_0x344b56){_0x203b94=_0x344b56['length'];if(!_0xf421f8[_0x58cb('0x35')][_0x58cb('0x4c')](_0x58cb('0x39'))){_0x11502b[_0x58cb('0x21')]=qs[_0x58cb('0x21')](_0xf421f8[_0x58cb('0x35')]['limit']);_0x11502b[_0x58cb('0x20')]=qs[_0x58cb('0x20')](_0xf421f8[_0x58cb('0x35')][_0x58cb('0x20')]);}return _0x2a83df['getDescriptions'](_0x11502b);}})[_0x58cb('0x26')](function(_0x3652be){if(_0x3652be){return _0x3652be?{'count':_0x203b94,'rows':_0x3652be}:null;}})['then'](respondWithResult(_0x2c5f01,null))['catch'](handleError(_0x2c5f01,null));}; \ No newline at end of file +var _0xca15=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length'];(function(_0x449e8c,_0x4c7b1e){var _0x10cc7f=function(_0x23f503){while(--_0x23f503){_0x449e8c['push'](_0x449e8c['shift']());}};_0x10cc7f(++_0x4c7b1e);}(_0xca15,0xc6));var _0x5ca1=function(_0x550151,_0x49d953){_0x550151=_0x550151-0x0;var _0x1ba3cb=_0xca15[_0x550151];return _0x1ba3cb;};'use strict';var emlformat=require(_0x5ca1('0x0'));var rimraf=require(_0x5ca1('0x1'));var zipdir=require(_0x5ca1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ca1('0x3'));var BPromise=require(_0x5ca1('0x4'));var Mustache=require(_0x5ca1('0x5'));var util=require(_0x5ca1('0x6'));var path=require(_0x5ca1('0x7'));var sox=require(_0x5ca1('0x8'));var csv=require(_0x5ca1('0x9'));var ejs=require(_0x5ca1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5ca1('0xb'));var crypto=require(_0x5ca1('0xc'));var jsforce=require(_0x5ca1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5ca1('0x9'));var querystring=require(_0x5ca1('0xe'));var Papa=require(_0x5ca1('0xf'));var Redis=require(_0x5ca1('0x10'));var authService=require(_0x5ca1('0x11'));var qs=require(_0x5ca1('0x12'));var as=require(_0x5ca1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ca1('0x14'))(_0x5ca1('0x15'));var utils=require(_0x5ca1('0x16'));var config=require(_0x5ca1('0x17'));var licenseUtil=require(_0x5ca1('0x18'));var db=require(_0x5ca1('0x19'))['db'];function respondWithStatusCode(_0x1a6481,_0xaf4d7b){_0xaf4d7b=_0xaf4d7b||0xcc;return function(_0x59d2a9){if(_0x59d2a9){return _0x1a6481[_0x5ca1('0x1a')](_0xaf4d7b);}return _0x1a6481[_0x5ca1('0x1b')](_0xaf4d7b)[_0x5ca1('0x1c')]();};}function respondWithResult(_0x20b26f,_0x40c264){_0x40c264=_0x40c264||0xc8;return function(_0x120078){if(_0x120078){return _0x20b26f[_0x5ca1('0x1b')](_0x40c264)[_0x5ca1('0x1d')](_0x120078);}};}function respondWithFilteredResult(_0x5947d8,_0x49b408){return function(_0xc7b987){if(_0xc7b987){var _0x1bd93c=typeof _0x49b408[_0x5ca1('0x1e')]===_0x5ca1('0x1f')&&typeof _0x49b408[_0x5ca1('0x20')]===_0x5ca1('0x1f');var _0x35acf4=_0xc7b987[_0x5ca1('0x21')];var _0x1bcbe5=_0x1bd93c?0x0:_0x49b408[_0x5ca1('0x1e')];var _0x1771aa=_0x1bd93c?_0xc7b987['count']:_0x49b408[_0x5ca1('0x1e')]+_0x49b408[_0x5ca1('0x20')];var _0x4ed89a;if(_0x1771aa>=_0x35acf4){_0x1771aa=_0x35acf4;_0x4ed89a=0xc8;}else{_0x4ed89a=0xce;}_0x5947d8[_0x5ca1('0x1b')](_0x4ed89a);return _0x5947d8[_0x5ca1('0x22')](_0x5ca1('0x23'),_0x1bcbe5+'-'+_0x1771aa+'/'+_0x35acf4)[_0x5ca1('0x1d')](_0xc7b987);}return null;};}function patchUpdates(_0x3bdea8){return function(_0x2f26df){try{jsonpatch[_0x5ca1('0x24')](_0x2f26df,_0x3bdea8,!![]);}catch(_0x5658a7){return BPromise[_0x5ca1('0x25')](_0x5658a7);}return _0x2f26df[_0x5ca1('0x26')]();};}function saveUpdates(_0x49c7aa,_0x392785){return function(_0x2fcdbe){if(_0x2fcdbe){return _0x2fcdbe['update'](_0x49c7aa)[_0x5ca1('0x27')](function(_0x3cdc0b){return _0x3cdc0b;});}return null;};}function removeEntity(_0x5bcf12,_0x35d906){return function(_0x18a94e){if(_0x18a94e){return _0x18a94e[_0x5ca1('0x28')]()[_0x5ca1('0x27')](function(){_0x5bcf12[_0x5ca1('0x1b')](0xcc)[_0x5ca1('0x1c')]();});}};}function handleEntityNotFound(_0x1f48e1,_0xcb64a0){return function(_0x3e9140){if(!_0x3e9140){_0x1f48e1[_0x5ca1('0x1a')](0x194);}return _0x3e9140;};}function handleError(_0x312829,_0x1101d8){_0x1101d8=_0x1101d8||0x1f4;return function(_0x2fd325){logger[_0x5ca1('0x29')](_0x2fd325[_0x5ca1('0x2a')]);if(_0x2fd325['name']){delete _0x2fd325[_0x5ca1('0x2b')];}_0x312829['status'](_0x1101d8)[_0x5ca1('0x2c')](_0x2fd325);};}exports[_0x5ca1('0x2d')]=function(_0x5cf241,_0x3ba5ae){var _0x566f27={},_0x289d78={},_0x11d988={'count':0x0,'rows':[]};var _0x3cc8f0=_[_0x5ca1('0x2e')](db['ZohoConfiguration']['rawAttributes'],function(_0x357386){return{'name':_0x357386[_0x5ca1('0x2f')],'type':_0x357386[_0x5ca1('0x30')][_0x5ca1('0x31')]};});_0x289d78[_0x5ca1('0x32')]=_[_0x5ca1('0x2e')](_0x3cc8f0,_0x5ca1('0x2b'));_0x289d78[_0x5ca1('0x33')]=_[_0x5ca1('0x34')](_0x5cf241[_0x5ca1('0x33')]);_0x289d78['filters']=_[_0x5ca1('0x35')](_0x289d78[_0x5ca1('0x32')],_0x289d78[_0x5ca1('0x33')]);_0x566f27[_0x5ca1('0x36')]=_['intersection'](_0x289d78[_0x5ca1('0x32')],qs[_0x5ca1('0x37')](_0x5cf241[_0x5ca1('0x33')]['fields']));_0x566f27[_0x5ca1('0x36')]=_0x566f27[_0x5ca1('0x36')][_0x5ca1('0x38')]?_0x566f27[_0x5ca1('0x36')]:_0x289d78['model'];if(!_0x5cf241[_0x5ca1('0x33')][_0x5ca1('0x39')](_0x5ca1('0x3a'))){_0x566f27[_0x5ca1('0x20')]=qs['limit'](_0x5cf241[_0x5ca1('0x33')][_0x5ca1('0x20')]);_0x566f27[_0x5ca1('0x1e')]=qs[_0x5ca1('0x1e')](_0x5cf241[_0x5ca1('0x33')][_0x5ca1('0x1e')]);}_0x566f27[_0x5ca1('0x3b')]=qs[_0x5ca1('0x3c')](_0x5cf241[_0x5ca1('0x33')]['sort']);_0x566f27[_0x5ca1('0x3d')]=qs[_0x5ca1('0x3e')](_[_0x5ca1('0x3f')](_0x5cf241[_0x5ca1('0x33')],_0x289d78[_0x5ca1('0x3e')]),_0x3cc8f0);if(_0x5cf241[_0x5ca1('0x33')][_0x5ca1('0x40')]){_0x566f27[_0x5ca1('0x3d')]=_['merge'](_0x566f27[_0x5ca1('0x3d')],{'$or':_['map'](_0x3cc8f0,function(_0x57da79){if(_0x57da79[_0x5ca1('0x30')]!==_0x5ca1('0x41')){var _0x56882e={};_0x56882e[_0x57da79[_0x5ca1('0x2b')]]={'$like':'%'+_0x5cf241[_0x5ca1('0x33')][_0x5ca1('0x40')]+'%'};return _0x56882e;}})});}_0x566f27=_[_0x5ca1('0x42')]({},_0x566f27,_0x5cf241[_0x5ca1('0x43')]);var _0x4cc665={'where':_0x566f27[_0x5ca1('0x3d')]};return db[_0x5ca1('0x44')][_0x5ca1('0x21')](_0x4cc665)[_0x5ca1('0x27')](function(_0x4637e4){_0x11d988[_0x5ca1('0x21')]=_0x4637e4;if(_0x5cf241[_0x5ca1('0x33')][_0x5ca1('0x45')]){_0x566f27[_0x5ca1('0x46')]=[{'all':!![]}];}return db[_0x5ca1('0x44')][_0x5ca1('0x47')](_0x566f27);})[_0x5ca1('0x27')](function(_0x399561){_0x11d988[_0x5ca1('0x48')]=_0x399561;return _0x11d988;})[_0x5ca1('0x27')](respondWithFilteredResult(_0x3ba5ae,_0x566f27))[_0x5ca1('0x49')](handleError(_0x3ba5ae,null));};exports[_0x5ca1('0x4a')]=function(_0x553e1b,_0x23056e){var _0x11a263={'raw':![],'where':{'id':_0x553e1b[_0x5ca1('0x4b')]['id']}},_0x105e5e={};_0x105e5e['model']=_['keys'](db[_0x5ca1('0x44')][_0x5ca1('0x4c')]);_0x105e5e[_0x5ca1('0x33')]=_[_0x5ca1('0x34')](_0x553e1b[_0x5ca1('0x33')]);_0x105e5e[_0x5ca1('0x3e')]=_[_0x5ca1('0x35')](_0x105e5e[_0x5ca1('0x32')],_0x105e5e['query']);_0x11a263[_0x5ca1('0x36')]=_[_0x5ca1('0x35')](_0x105e5e[_0x5ca1('0x32')],qs[_0x5ca1('0x37')](_0x553e1b[_0x5ca1('0x33')][_0x5ca1('0x37')]));_0x11a263[_0x5ca1('0x36')]=_0x11a263[_0x5ca1('0x36')][_0x5ca1('0x38')]?_0x11a263['attributes']:_0x105e5e['model'];if(_0x553e1b[_0x5ca1('0x33')][_0x5ca1('0x45')]){_0x11a263[_0x5ca1('0x46')]=[{'all':!![]}];}_0x11a263=_[_0x5ca1('0x42')]({},_0x11a263,_0x553e1b['options']);return db[_0x5ca1('0x44')][_0x5ca1('0x4d')](_0x11a263)[_0x5ca1('0x27')](handleEntityNotFound(_0x23056e,null))['then'](respondWithResult(_0x23056e,null))[_0x5ca1('0x49')](handleError(_0x23056e,null));};exports[_0x5ca1('0x4e')]=function(_0x57a14e,_0x525ee8){return db[_0x5ca1('0x44')][_0x5ca1('0x4e')](_0x57a14e[_0x5ca1('0x4f')],{})['then'](respondWithResult(_0x525ee8,0xc9))[_0x5ca1('0x49')](handleError(_0x525ee8,null));};exports['update']=function(_0x409b92,_0x14a6c9){if(_0x409b92[_0x5ca1('0x4f')]['id']){delete _0x409b92['body']['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x409b92[_0x5ca1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x14a6c9,null))[_0x5ca1('0x27')](saveUpdates(_0x409b92[_0x5ca1('0x4f')],null))['then'](respondWithResult(_0x14a6c9,null))['catch'](handleError(_0x14a6c9,null));};exports['destroy']=function(_0x319d51,_0x1c45e5){return db[_0x5ca1('0x44')][_0x5ca1('0x4d')]({'where':{'id':_0x319d51[_0x5ca1('0x4b')]['id']}})[_0x5ca1('0x27')](handleEntityNotFound(_0x1c45e5,null))[_0x5ca1('0x27')](removeEntity(_0x1c45e5,null))['catch'](handleError(_0x1c45e5,null));};exports[_0x5ca1('0x50')]=function(_0x203dae,_0x158973,_0x53ae1f){var _0x2487c5={};var _0x6bfb6a={};var _0xe6d08d;var _0x5c27f2;return db[_0x5ca1('0x44')][_0x5ca1('0x51')]({'where':{'id':_0x203dae[_0x5ca1('0x4b')]['id']}})[_0x5ca1('0x27')](handleEntityNotFound(_0x158973,null))[_0x5ca1('0x27')](function(_0x32fbac){if(_0x32fbac){_0xe6d08d=_0x32fbac;_0x6bfb6a[_0x5ca1('0x32')]=_[_0x5ca1('0x34')](db[_0x5ca1('0x52')][_0x5ca1('0x4c')]);_0x6bfb6a[_0x5ca1('0x33')]=_['keys'](_0x203dae['query']);_0x6bfb6a[_0x5ca1('0x3e')]=_['intersection'](_0x6bfb6a['model'],_0x6bfb6a[_0x5ca1('0x33')]);_0x2487c5['attributes']=_[_0x5ca1('0x35')](_0x6bfb6a['model'],qs[_0x5ca1('0x37')](_0x203dae[_0x5ca1('0x33')]['fields']));_0x2487c5[_0x5ca1('0x36')]=_0x2487c5[_0x5ca1('0x36')][_0x5ca1('0x38')]?_0x2487c5[_0x5ca1('0x36')]:_0x6bfb6a[_0x5ca1('0x32')];_0x2487c5[_0x5ca1('0x3b')]=qs['sort'](_0x203dae[_0x5ca1('0x33')][_0x5ca1('0x3c')]);_0x2487c5[_0x5ca1('0x3d')]=qs[_0x5ca1('0x3e')](_[_0x5ca1('0x3f')](_0x203dae[_0x5ca1('0x33')],_0x6bfb6a[_0x5ca1('0x3e')]));if(_0x203dae[_0x5ca1('0x33')][_0x5ca1('0x40')]){_0x2487c5[_0x5ca1('0x3d')]=_[_0x5ca1('0x42')](_0x2487c5['where'],{'$or':_['map'](_0x2487c5[_0x5ca1('0x36')],function(_0x4ea55f){var _0x4bbfb0={};_0x4bbfb0[_0x4ea55f]={'$like':'%'+_0x203dae[_0x5ca1('0x33')][_0x5ca1('0x40')]+'%'};return _0x4bbfb0;})});}_0x2487c5=_['merge']({},_0x2487c5,_0x203dae[_0x5ca1('0x43')]);return _0xe6d08d[_0x5ca1('0x50')](_0x2487c5);}})['then'](function(_0x501961){if(_0x501961){_0x5c27f2=_0x501961[_0x5ca1('0x38')];if(!_0x203dae['query'][_0x5ca1('0x39')](_0x5ca1('0x3a'))){_0x2487c5[_0x5ca1('0x20')]=qs[_0x5ca1('0x20')](_0x203dae[_0x5ca1('0x33')]['limit']);_0x2487c5[_0x5ca1('0x1e')]=qs[_0x5ca1('0x1e')](_0x203dae[_0x5ca1('0x33')][_0x5ca1('0x1e')]);}return _0xe6d08d[_0x5ca1('0x50')](_0x2487c5);}})['then'](function(_0x1efdd0){if(_0x1efdd0){return _0x1efdd0?{'count':_0x5c27f2,'rows':_0x1efdd0}:null;}})['then'](respondWithResult(_0x158973,null))[_0x5ca1('0x49')](handleError(_0x158973,null));};exports[_0x5ca1('0x53')]=function(_0x493891,_0xdef7f7,_0x51b090){var _0x1e653a={};var _0x2f812c={};var _0x5591bd;var _0x2624eb;return db[_0x5ca1('0x44')]['findOne']({'where':{'id':_0x493891[_0x5ca1('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdef7f7,null))[_0x5ca1('0x27')](function(_0x31da6d){if(_0x31da6d){_0x5591bd=_0x31da6d;_0x2f812c[_0x5ca1('0x32')]=_[_0x5ca1('0x34')](db['ZohoField']['rawAttributes']);_0x2f812c['query']=_['keys'](_0x493891[_0x5ca1('0x33')]);_0x2f812c[_0x5ca1('0x3e')]=_['intersection'](_0x2f812c['model'],_0x2f812c[_0x5ca1('0x33')]);_0x1e653a[_0x5ca1('0x36')]=_[_0x5ca1('0x35')](_0x2f812c['model'],qs['fields'](_0x493891['query'][_0x5ca1('0x37')]));_0x1e653a[_0x5ca1('0x36')]=_0x1e653a[_0x5ca1('0x36')][_0x5ca1('0x38')]?_0x1e653a[_0x5ca1('0x36')]:_0x2f812c['model'];_0x1e653a[_0x5ca1('0x3b')]=qs['sort'](_0x493891[_0x5ca1('0x33')][_0x5ca1('0x3c')]);_0x1e653a[_0x5ca1('0x3d')]=qs[_0x5ca1('0x3e')](_[_0x5ca1('0x3f')](_0x493891['query'],_0x2f812c[_0x5ca1('0x3e')]));if(_0x493891['query']['filter']){_0x1e653a['where']=_[_0x5ca1('0x42')](_0x1e653a[_0x5ca1('0x3d')],{'$or':_[_0x5ca1('0x2e')](_0x1e653a[_0x5ca1('0x36')],function(_0x5835cf){var _0x29b0d8={};_0x29b0d8[_0x5835cf]={'$like':'%'+_0x493891[_0x5ca1('0x33')][_0x5ca1('0x40')]+'%'};return _0x29b0d8;})});}_0x1e653a=_[_0x5ca1('0x42')]({},_0x1e653a,_0x493891['options']);return _0x5591bd['getSubjects'](_0x1e653a);}})[_0x5ca1('0x27')](function(_0x1a2df1){if(_0x1a2df1){_0x2624eb=_0x1a2df1[_0x5ca1('0x38')];if(!_0x493891[_0x5ca1('0x33')][_0x5ca1('0x39')](_0x5ca1('0x3a'))){_0x1e653a[_0x5ca1('0x20')]=qs[_0x5ca1('0x20')](_0x493891[_0x5ca1('0x33')][_0x5ca1('0x20')]);_0x1e653a[_0x5ca1('0x1e')]=qs[_0x5ca1('0x1e')](_0x493891[_0x5ca1('0x33')][_0x5ca1('0x1e')]);}return _0x5591bd[_0x5ca1('0x53')](_0x1e653a);}})['then'](function(_0x1e6c6a){if(_0x1e6c6a){return _0x1e6c6a?{'count':_0x2624eb,'rows':_0x1e6c6a}:null;}})[_0x5ca1('0x27')](respondWithResult(_0xdef7f7,null))[_0x5ca1('0x49')](handleError(_0xdef7f7,null));};exports[_0x5ca1('0x54')]=function(_0xb5d826,_0x3169f8,_0x4541f3){var _0x2380b9={};var _0x2e3b37={};var _0x85a4ae;var _0x3c982a;return db[_0x5ca1('0x44')][_0x5ca1('0x51')]({'where':{'id':_0xb5d826[_0x5ca1('0x4b')]['id']}})[_0x5ca1('0x27')](handleEntityNotFound(_0x3169f8,null))[_0x5ca1('0x27')](function(_0x276933){if(_0x276933){_0x85a4ae=_0x276933;_0x2e3b37[_0x5ca1('0x32')]=_[_0x5ca1('0x34')](db[_0x5ca1('0x52')]['rawAttributes']);_0x2e3b37[_0x5ca1('0x33')]=_[_0x5ca1('0x34')](_0xb5d826[_0x5ca1('0x33')]);_0x2e3b37[_0x5ca1('0x3e')]=_[_0x5ca1('0x35')](_0x2e3b37['model'],_0x2e3b37[_0x5ca1('0x33')]);_0x2380b9[_0x5ca1('0x36')]=_[_0x5ca1('0x35')](_0x2e3b37[_0x5ca1('0x32')],qs['fields'](_0xb5d826['query'][_0x5ca1('0x37')]));_0x2380b9[_0x5ca1('0x36')]=_0x2380b9['attributes']['length']?_0x2380b9['attributes']:_0x2e3b37['model'];_0x2380b9[_0x5ca1('0x3b')]=qs[_0x5ca1('0x3c')](_0xb5d826[_0x5ca1('0x33')][_0x5ca1('0x3c')]);_0x2380b9[_0x5ca1('0x3d')]=qs[_0x5ca1('0x3e')](_[_0x5ca1('0x3f')](_0xb5d826['query'],_0x2e3b37[_0x5ca1('0x3e')]));if(_0xb5d826[_0x5ca1('0x33')][_0x5ca1('0x40')]){_0x2380b9['where']=_['merge'](_0x2380b9[_0x5ca1('0x3d')],{'$or':_[_0x5ca1('0x2e')](_0x2380b9[_0x5ca1('0x36')],function(_0x21de84){var _0x1a3762={};_0x1a3762[_0x21de84]={'$like':'%'+_0xb5d826[_0x5ca1('0x33')]['filter']+'%'};return _0x1a3762;})});}_0x2380b9=_['merge']({},_0x2380b9,_0xb5d826[_0x5ca1('0x43')]);return _0x85a4ae[_0x5ca1('0x54')](_0x2380b9);}})[_0x5ca1('0x27')](function(_0x155d5a){if(_0x155d5a){_0x3c982a=_0x155d5a[_0x5ca1('0x38')];if(!_0xb5d826['query']['hasOwnProperty'](_0x5ca1('0x3a'))){_0x2380b9[_0x5ca1('0x20')]=qs[_0x5ca1('0x20')](_0xb5d826[_0x5ca1('0x33')]['limit']);_0x2380b9['offset']=qs[_0x5ca1('0x1e')](_0xb5d826[_0x5ca1('0x33')][_0x5ca1('0x1e')]);}return _0x85a4ae[_0x5ca1('0x54')](_0x2380b9);}})[_0x5ca1('0x27')](function(_0x21c2dd){if(_0x21c2dd){return _0x21c2dd?{'count':_0x3c982a,'rows':_0x21c2dd}:null;}})[_0x5ca1('0x27')](respondWithResult(_0x3169f8,null))['catch'](handleError(_0x3169f8,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 3618913..0e74537 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 _0xe9bc=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9bc,0x1f2));var _0xce9b=function(_0x1ea153,_0x1e5d49){_0x1ea153=_0x1ea153-0x0;var _0x1fc872=_0xe9bc[_0x1ea153];return _0x1fc872;};'use strict';var _=require(_0xce9b('0x0'));var util=require(_0xce9b('0x1'));var logger=require(_0xce9b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xce9b('0x3'));var rp=require(_0xce9b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce9b('0x5'));var config=require(_0xce9b('0x6'));var attributes=require(_0xce9b('0x7'));module[_0xce9b('0x8')]=function(_0x4f87b6,_0x27586b){return _0x4f87b6[_0xce9b('0x9')](_0xce9b('0xa'),attributes,{'tableName':_0xce9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ca9=['bluebird','request-promise','../../config/environment','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x5ca9,0x7f));var _0x95ca=function(_0x260517,_0x37649c){_0x260517=_0x260517-0x0;var _0x406d27=_0x5ca9[_0x260517];return _0x406d27;};'use strict';var _=require(_0x95ca('0x0'));var util=require(_0x95ca('0x1'));var logger=require(_0x95ca('0x2'))(_0x95ca('0x3'));var moment=require(_0x95ca('0x4'));var BPromise=require(_0x95ca('0x5'));var rp=require(_0x95ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x95ca('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x95ca('0x8')]=function(_0x4d3c76,_0x2fdcca){return _0x4d3c76[_0x95ca('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x95ca('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 1372441..6341d0a 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 _0x4cf1=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x34c7ec,_0xc8c896){var _0x402fd8=function(_0x5e1328){while(--_0x5e1328){_0x34c7ec['push'](_0x34c7ec['shift']());}};_0x402fd8(++_0xc8c896);}(_0x4cf1,0xb8));var _0x14cf=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x4cf1[_0x479509];return _0x382da8;};'use strict';var _=require(_0x14cf('0x0'));var util=require('util');var moment=require(_0x14cf('0x1'));var BPromise=require(_0x14cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14cf('0x3'));var db=require(_0x14cf('0x4'))['db'];var utils=require(_0x14cf('0x5'));var logger=require(_0x14cf('0x6'))(_0x14cf('0x7'));var config=require(_0x14cf('0x8'));var jayson=require(_0x14cf('0x9'));var client=jayson[_0x14cf('0xa')][_0x14cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d47d3,_0xe9717,_0x9eabe8){return new BPromise(function(_0x59e19a,_0x293a){return client[_0x14cf('0xc')](_0x3d47d3,_0x9eabe8)[_0x14cf('0xd')](function(_0xb85ba9){logger[_0x14cf('0xe')](_0x14cf('0xf'),_0xe9717,_0x14cf('0x10'));logger[_0x14cf('0x11')](_0x14cf('0x12'),_0xe9717,_0x14cf('0x10'),JSON[_0x14cf('0x13')](_0xb85ba9));if(_0xb85ba9['error']){if(_0xb85ba9[_0x14cf('0x14')][_0x14cf('0x15')]===0x1f4){logger['error'](_0x14cf('0xf'),_0xe9717,_0xb85ba9[_0x14cf('0x14')][_0x14cf('0x16')]);return _0x293a(_0xb85ba9[_0x14cf('0x14')][_0x14cf('0x16')]);}logger[_0x14cf('0x14')](_0x14cf('0xf'),_0xe9717,_0xb85ba9['error']['message']);return _0x59e19a(_0xb85ba9[_0x14cf('0x14')]['message']);}else{logger[_0x14cf('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0xe9717,_0x14cf('0x10'));_0x59e19a(_0xb85ba9['result'][_0x14cf('0x16')]);}})['catch'](function(_0x43b74b){logger[_0x14cf('0x14')](_0x14cf('0xf'),_0xe9717,_0x43b74b);_0x293a(_0x43b74b);});});} \ No newline at end of file +var _0xe2b7=['then','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x3a05ef,_0x24e452){var _0x1ab302=function(_0x3b919d){while(--_0x3b919d){_0x3a05ef['push'](_0x3a05ef['shift']());}};_0x1ab302(++_0x24e452);}(_0xe2b7,0x90));var _0x7e2b=function(_0x2b1400,_0x2ad092){_0x2b1400=_0x2b1400-0x0;var _0x4e2c20=_0xe2b7[_0x2b1400];return _0x4e2c20;};'use strict';var _=require(_0x7e2b('0x0'));var util=require('util');var moment=require(_0x7e2b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e2b('0x2'));var fs=require('fs');var Redis=require(_0x7e2b('0x3'));var db=require(_0x7e2b('0x4'))['db'];var utils=require(_0x7e2b('0x5'));var logger=require(_0x7e2b('0x6'))(_0x7e2b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e2b('0x8')][_0x7e2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x460512,_0x16c700,_0x4dfcaf){return new BPromise(function(_0x3a8bae,_0x6961a7){return client['request'](_0x460512,_0x4dfcaf)[_0x7e2b('0xa')](function(_0x25b720){logger['info'](_0x7e2b('0xb'),_0x16c700,'request\x20sent');logger[_0x7e2b('0xc')](_0x7e2b('0xd'),_0x16c700,'request\x20sent',JSON[_0x7e2b('0xe')](_0x25b720));if(_0x25b720[_0x7e2b('0xf')]){if(_0x25b720[_0x7e2b('0xf')][_0x7e2b('0x10')]===0x1f4){logger[_0x7e2b('0xf')](_0x7e2b('0xb'),_0x16c700,_0x25b720['error'][_0x7e2b('0x11')]);return _0x6961a7(_0x25b720[_0x7e2b('0xf')][_0x7e2b('0x11')]);}logger[_0x7e2b('0xf')](_0x7e2b('0xb'),_0x16c700,_0x25b720[_0x7e2b('0xf')][_0x7e2b('0x11')]);return _0x3a8bae(_0x25b720[_0x7e2b('0xf')]['message']);}else{logger[_0x7e2b('0x12')](_0x7e2b('0xb'),_0x16c700,_0x7e2b('0x13'));_0x3a8bae(_0x25b720[_0x7e2b('0x14')][_0x7e2b('0x11')]);}})[_0x7e2b('0x15')](function(_0x3e69f9){logger[_0x7e2b('0xf')](_0x7e2b('0xb'),_0x16c700,_0x3e69f9);_0x6961a7(_0x3e69f9);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 178cdcf..7a10836 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 _0x4ced=['get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x4ced,0x7d));var _0xd4ce=function(_0x8fca1d,_0x30415b){_0x8fca1d=_0x8fca1d-0x0;var _0x37e0fd=_0x4ced[_0x8fca1d];return _0x37e0fd;};'use strict';var multer=require(_0xd4ce('0x0'));var util=require(_0xd4ce('0x1'));var path=require('path');var timeout=require(_0xd4ce('0x2'));var express=require(_0xd4ce('0x3'));var router=express['Router']();var fs_extra=require(_0xd4ce('0x4'));var auth=require(_0xd4ce('0x5'));var interaction=require(_0xd4ce('0x6'));var config=require('../../config/environment');var controller=require(_0xd4ce('0x7'));router[_0xd4ce('0x8')]('/',auth['isAuthenticated'](),controller[_0xd4ce('0x9')]);router[_0xd4ce('0x8')](_0xd4ce('0xa'),auth[_0xd4ce('0xb')](),controller[_0xd4ce('0xc')]);router['post']('/',auth[_0xd4ce('0xb')](),controller[_0xd4ce('0xd')]);router[_0xd4ce('0xe')]('/:id',auth[_0xd4ce('0xb')](),controller[_0xd4ce('0xf')]);router[_0xd4ce('0x10')](_0xd4ce('0xa'),auth['isAuthenticated'](),controller[_0xd4ce('0x11')]);module[_0xd4ce('0x12')]=router; \ No newline at end of file +var _0xb910=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','show','post','isAuthenticated','put','update','delete','/:id','destroy','exports'];(function(_0x363d84,_0x1f7d1e){var _0xf8648a=function(_0x40ead0){while(--_0x40ead0){_0x363d84['push'](_0x363d84['shift']());}};_0xf8648a(++_0x1f7d1e);}(_0xb910,0x130));var _0x0b91=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb910[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var path=require(_0x0b91('0x2'));var timeout=require(_0x0b91('0x3'));var express=require('express');var router=express[_0x0b91('0x4')]();var fs_extra=require(_0x0b91('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0b91('0x6'));var config=require(_0x0b91('0x7'));var controller=require(_0x0b91('0x8'));router[_0x0b91('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0b91('0xa')]);router[_0x0b91('0xb')]('/',auth[_0x0b91('0xc')](),controller['create']);router[_0x0b91('0xd')]('/:id',auth[_0x0b91('0xc')](),controller[_0x0b91('0xe')]);router[_0x0b91('0xf')](_0x0b91('0x10'),auth[_0x0b91('0xc')](),controller[_0x0b91('0x11')]);module[_0x0b91('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index db06707..c068a44 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 _0x9d4b=['ENUM','string','variable','customVariable','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d4b,0x131));var _0xb9d4=function(_0x2c908c,_0x5e9d33){_0x2c908c=_0x2c908c-0x0;var _0x5a5060=_0x9d4b[_0x2c908c];return _0x5a5060;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb9d4('0x0')](_0xb9d4('0x1'),_0xb9d4('0x2'),_0xb9d4('0x3'),'keyValue','picklist'),'defaultValue':_0xb9d4('0x1')},'content':{'type':Sequelize[_0xb9d4('0x4')]},'key':{'type':Sequelize[_0xb9d4('0x4')]},'keyType':{'type':Sequelize[_0xb9d4('0x0')](_0xb9d4('0x1'),_0xb9d4('0x2'),_0xb9d4('0x3'))},'keyContent':{'type':Sequelize[_0xb9d4('0x4')]},'idField':{'type':Sequelize[_0xb9d4('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb9d4('0x4')]}}; \ No newline at end of file +var _0x3749=['variable','customVariable','sequelize','exports','ENUM','keyValue','STRING','string'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0x3749,0x15a));var _0x9374=function(_0x1a9f27,_0x1f8a6f){_0x1a9f27=_0x1a9f27-0x0;var _0x142e50=_0x3749[_0x1a9f27];return _0x142e50;};'use strict';var Sequelize=require(_0x9374('0x0'));module[_0x9374('0x1')]={'type':{'type':Sequelize[_0x9374('0x2')]('string','variable','customVariable',_0x9374('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x9374('0x4')]},'key':{'type':Sequelize[_0x9374('0x4')]},'keyType':{'type':Sequelize[_0x9374('0x2')](_0x9374('0x5'),_0x9374('0x6'),_0x9374('0x7'))},'keyContent':{'type':Sequelize[_0x9374('0x4')]},'idField':{'type':Sequelize[_0x9374('0x4')]},'nameField':{'type':Sequelize[_0x9374('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9374('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index fc6d212..d08462e 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 _0x1250=['apply','update','then','destroy','sendStatus','error','name','send','index','ZohoField','rawAttributes','fieldName','type','map','keys','query','intersection','model','attributes','fields','length','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','count','limit'];(function(_0x40c689,_0x18c6fe){var _0x2b80f8=function(_0x309cac){while(--_0x309cac){_0x40c689['push'](_0x40c689['shift']());}};_0x2b80f8(++_0x18c6fe);}(_0x1250,0x6c));var _0x0125=function(_0x56e6e4,_0x18dc9b){_0x56e6e4=_0x56e6e4-0x0;var _0x1bdb3e=_0x1250[_0x56e6e4];return _0x1bdb3e;};'use strict';var emlformat=require(_0x0125('0x0'));var rimraf=require(_0x0125('0x1'));var zipdir=require(_0x0125('0x2'));var jsonpatch=require(_0x0125('0x3'));var rp=require(_0x0125('0x4'));var moment=require(_0x0125('0x5'));var BPromise=require(_0x0125('0x6'));var Mustache=require(_0x0125('0x7'));var util=require(_0x0125('0x8'));var path=require(_0x0125('0x9'));var sox=require(_0x0125('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0125('0xb'));var _=require(_0x0125('0xc'));var squel=require(_0x0125('0xd'));var crypto=require(_0x0125('0xe'));var jsforce=require(_0x0125('0xf'));var deskjs=require(_0x0125('0x10'));var toCsv=require(_0x0125('0x11'));var querystring=require('querystring');var Papa=require(_0x0125('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0125('0x13'));var as=require(_0x0125('0x14'));var hardwareService=require(_0x0125('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0125('0x16'));var config=require(_0x0125('0x17'));var licenseUtil=require(_0x0125('0x18'));var db=require(_0x0125('0x19'))['db'];function respondWithStatusCode(_0x20f88b,_0x1d2d7a){_0x1d2d7a=_0x1d2d7a||0xcc;return function(_0x4c1ad9){if(_0x4c1ad9){return _0x20f88b['sendStatus'](_0x1d2d7a);}return _0x20f88b[_0x0125('0x1a')](_0x1d2d7a)[_0x0125('0x1b')]();};}function respondWithResult(_0x57e8ee,_0x4de9c6){_0x4de9c6=_0x4de9c6||0xc8;return function(_0x5199eb){if(_0x5199eb){return _0x57e8ee[_0x0125('0x1a')](_0x4de9c6)[_0x0125('0x1c')](_0x5199eb);}};}function respondWithFilteredResult(_0x597cd8,_0x4ea03d){return function(_0x58e5ff){if(_0x58e5ff){var _0x55bce2=typeof _0x4ea03d[_0x0125('0x1d')]==='undefined'&&typeof _0x4ea03d['limit']==='undefined';var _0x1b48d2=_0x58e5ff[_0x0125('0x1e')];var _0x213136=_0x55bce2?0x0:_0x4ea03d[_0x0125('0x1d')];var _0x3bb3a7=_0x55bce2?_0x58e5ff[_0x0125('0x1e')]:_0x4ea03d[_0x0125('0x1d')]+_0x4ea03d[_0x0125('0x1f')];var _0x8d0069;if(_0x3bb3a7>=_0x1b48d2){_0x3bb3a7=_0x1b48d2;_0x8d0069=0xc8;}else{_0x8d0069=0xce;}_0x597cd8['status'](_0x8d0069);return _0x597cd8['set']('Content-Range',_0x213136+'-'+_0x3bb3a7+'/'+_0x1b48d2)[_0x0125('0x1c')](_0x58e5ff);}return null;};}function patchUpdates(_0x3a2867){return function(_0x1fb9a6){try{jsonpatch[_0x0125('0x20')](_0x1fb9a6,_0x3a2867,!![]);}catch(_0x10e4e5){return BPromise['reject'](_0x10e4e5);}return _0x1fb9a6['save']();};}function saveUpdates(_0x21cd3c,_0x205e4e){return function(_0x40cabc){if(_0x40cabc){return _0x40cabc[_0x0125('0x21')](_0x21cd3c)[_0x0125('0x22')](function(_0x193a27){return _0x193a27;});}return null;};}function removeEntity(_0x2789b9,_0x243d5d){return function(_0x534913){if(_0x534913){return _0x534913[_0x0125('0x23')]()[_0x0125('0x22')](function(){_0x2789b9[_0x0125('0x1a')](0xcc)[_0x0125('0x1b')]();});}};}function handleEntityNotFound(_0x22ea5d,_0x45171e){return function(_0x53a6ad){if(!_0x53a6ad){_0x22ea5d[_0x0125('0x24')](0x194);}return _0x53a6ad;};}function handleError(_0xae7989,_0x15a6bb){_0x15a6bb=_0x15a6bb||0x1f4;return function(_0x13b67b){logger[_0x0125('0x25')](_0x13b67b['stack']);if(_0x13b67b[_0x0125('0x26')]){delete _0x13b67b[_0x0125('0x26')];}_0xae7989[_0x0125('0x1a')](_0x15a6bb)[_0x0125('0x27')](_0x13b67b);};}exports[_0x0125('0x28')]=function(_0x4b9419,_0x31f78c){var _0x4e6427={},_0x2346dc={},_0xe5804e={'count':0x0,'rows':[]};var _0x1708d8=_['map'](db[_0x0125('0x29')][_0x0125('0x2a')],function(_0xe6d788){return{'name':_0xe6d788[_0x0125('0x2b')],'type':_0xe6d788[_0x0125('0x2c')]['key']};});_0x2346dc['model']=_[_0x0125('0x2d')](_0x1708d8,'name');_0x2346dc['query']=_[_0x0125('0x2e')](_0x4b9419[_0x0125('0x2f')]);_0x2346dc['filters']=_[_0x0125('0x30')](_0x2346dc[_0x0125('0x31')],_0x2346dc[_0x0125('0x2f')]);_0x4e6427[_0x0125('0x32')]=_[_0x0125('0x30')](_0x2346dc['model'],qs[_0x0125('0x33')](_0x4b9419['query'][_0x0125('0x33')]));_0x4e6427['attributes']=_0x4e6427['attributes'][_0x0125('0x34')]?_0x4e6427['attributes']:_0x2346dc[_0x0125('0x31')];if(!_0x4b9419[_0x0125('0x2f')]['hasOwnProperty']('nolimit')){_0x4e6427[_0x0125('0x1f')]=qs['limit'](_0x4b9419['query'][_0x0125('0x1f')]);_0x4e6427[_0x0125('0x1d')]=qs[_0x0125('0x1d')](_0x4b9419['query'][_0x0125('0x1d')]);}_0x4e6427[_0x0125('0x35')]=qs[_0x0125('0x36')](_0x4b9419[_0x0125('0x2f')][_0x0125('0x36')]);_0x4e6427[_0x0125('0x37')]=qs[_0x0125('0x38')](_['pick'](_0x4b9419[_0x0125('0x2f')],_0x2346dc[_0x0125('0x38')]),_0x1708d8);if(_0x4b9419[_0x0125('0x2f')][_0x0125('0x39')]){_0x4e6427['where']=_[_0x0125('0x3a')](_0x4e6427[_0x0125('0x37')],{'$or':_[_0x0125('0x2d')](_0x1708d8,function(_0x1cf5b8){if(_0x1cf5b8[_0x0125('0x2c')]!=='VIRTUAL'){var _0x47742e={};_0x47742e[_0x1cf5b8['name']]={'$like':'%'+_0x4b9419[_0x0125('0x2f')][_0x0125('0x39')]+'%'};return _0x47742e;}})});}_0x4e6427=_[_0x0125('0x3a')]({},_0x4e6427,_0x4b9419[_0x0125('0x3b')]);var _0x205265={'where':_0x4e6427['where']};return db[_0x0125('0x29')][_0x0125('0x1e')](_0x205265)['then'](function(_0x5bec52){_0xe5804e[_0x0125('0x1e')]=_0x5bec52;if(_0x4b9419[_0x0125('0x2f')][_0x0125('0x3c')]){_0x4e6427[_0x0125('0x3d')]=[{'all':!![]}];}return db[_0x0125('0x29')][_0x0125('0x3e')](_0x4e6427);})[_0x0125('0x22')](function(_0x5e5788){_0xe5804e[_0x0125('0x3f')]=_0x5e5788;return _0xe5804e;})[_0x0125('0x22')](respondWithFilteredResult(_0x31f78c,_0x4e6427))[_0x0125('0x40')](handleError(_0x31f78c,null));};exports[_0x0125('0x41')]=function(_0x55b0db,_0x494e26){var _0x1b57a8={'raw':!![],'where':{'id':_0x55b0db['params']['id']}},_0x12950e={};_0x12950e['model']=_[_0x0125('0x2e')](db['ZohoField']['rawAttributes']);_0x12950e[_0x0125('0x2f')]=_[_0x0125('0x2e')](_0x55b0db[_0x0125('0x2f')]);_0x12950e[_0x0125('0x38')]=_[_0x0125('0x30')](_0x12950e[_0x0125('0x31')],_0x12950e['query']);_0x1b57a8['attributes']=_['intersection'](_0x12950e[_0x0125('0x31')],qs['fields'](_0x55b0db[_0x0125('0x2f')]['fields']));_0x1b57a8[_0x0125('0x32')]=_0x1b57a8[_0x0125('0x32')][_0x0125('0x34')]?_0x1b57a8['attributes']:_0x12950e['model'];if(_0x55b0db[_0x0125('0x2f')][_0x0125('0x3c')]){_0x1b57a8[_0x0125('0x3d')]=[{'all':!![]}];}_0x1b57a8=_['merge']({},_0x1b57a8,_0x55b0db[_0x0125('0x3b')]);return db[_0x0125('0x29')][_0x0125('0x42')](_0x1b57a8)[_0x0125('0x22')](handleEntityNotFound(_0x494e26,null))[_0x0125('0x22')](respondWithResult(_0x494e26,null))[_0x0125('0x40')](handleError(_0x494e26,null));};exports[_0x0125('0x43')]=function(_0x84797f,_0x117034){return db[_0x0125('0x29')][_0x0125('0x43')](_0x84797f[_0x0125('0x44')],{})[_0x0125('0x22')](respondWithResult(_0x117034,0xc9))['catch'](handleError(_0x117034,null));};exports['update']=function(_0x5af8db,_0x5e06cc){if(_0x5af8db[_0x0125('0x44')]['id']){delete _0x5af8db[_0x0125('0x44')]['id'];}return db[_0x0125('0x29')][_0x0125('0x42')]({'where':{'id':_0x5af8db[_0x0125('0x45')]['id']}})[_0x0125('0x22')](handleEntityNotFound(_0x5e06cc,null))['then'](saveUpdates(_0x5af8db[_0x0125('0x44')],null))[_0x0125('0x22')](respondWithResult(_0x5e06cc,null))[_0x0125('0x40')](handleError(_0x5e06cc,null));};exports[_0x0125('0x23')]=function(_0x19ed65,_0x19d5c2){return db['ZohoField'][_0x0125('0x42')]({'where':{'id':_0x19ed65[_0x0125('0x45')]['id']}})[_0x0125('0x22')](handleEntityNotFound(_0x19d5c2,null))[_0x0125('0x22')](removeEntity(_0x19d5c2,null))[_0x0125('0x40')](handleError(_0x19d5c2,null));}; \ No newline at end of file +var _0x6799=['catch','show','params','length','options','create','body','find','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','map','ZohoField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x3d064a,_0x12cf18){var _0x5b2a83=function(_0x241866){while(--_0x241866){_0x3d064a['push'](_0x3d064a['shift']());}};_0x5b2a83(++_0x12cf18);}(_0x6799,0x91));var _0x9679=function(_0x5af3d0,_0x2e9ff9){_0x5af3d0=_0x5af3d0-0x0;var _0x2a5cb8=_0x6799[_0x5af3d0];return _0x2a5cb8;};'use strict';var emlformat=require(_0x9679('0x0'));var rimraf=require(_0x9679('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9679('0x2'));var rp=require('request-promise');var moment=require(_0x9679('0x3'));var BPromise=require(_0x9679('0x4'));var Mustache=require(_0x9679('0x5'));var util=require(_0x9679('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9679('0x7'));var ejs=require(_0x9679('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9679('0x9'));var squel=require(_0x9679('0xa'));var crypto=require('crypto');var jsforce=require(_0x9679('0xb'));var deskjs=require(_0x9679('0xc'));var toCsv=require(_0x9679('0x7'));var querystring=require(_0x9679('0xd'));var Papa=require('papaparse');var Redis=require(_0x9679('0xe'));var authService=require(_0x9679('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9679('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9679('0x11'));var db=require(_0x9679('0x12'))['db'];function respondWithStatusCode(_0x9724fe,_0x379bd4){_0x379bd4=_0x379bd4||0xcc;return function(_0x502036){if(_0x502036){return _0x9724fe['sendStatus'](_0x379bd4);}return _0x9724fe[_0x9679('0x13')](_0x379bd4)[_0x9679('0x14')]();};}function respondWithResult(_0x5c99a7,_0x313878){_0x313878=_0x313878||0xc8;return function(_0x4841a9){if(_0x4841a9){return _0x5c99a7['status'](_0x313878)['json'](_0x4841a9);}};}function respondWithFilteredResult(_0x357269,_0x38ecfe){return function(_0x1adac8){if(_0x1adac8){var _0xb91487=typeof _0x38ecfe['offset']===_0x9679('0x15')&&typeof _0x38ecfe[_0x9679('0x16')]===_0x9679('0x15');var _0x202183=_0x1adac8[_0x9679('0x17')];var _0x285098=_0xb91487?0x0:_0x38ecfe[_0x9679('0x18')];var _0x371b46=_0xb91487?_0x1adac8[_0x9679('0x17')]:_0x38ecfe['offset']+_0x38ecfe[_0x9679('0x16')];var _0x15056a;if(_0x371b46>=_0x202183){_0x371b46=_0x202183;_0x15056a=0xc8;}else{_0x15056a=0xce;}_0x357269[_0x9679('0x13')](_0x15056a);return _0x357269[_0x9679('0x19')](_0x9679('0x1a'),_0x285098+'-'+_0x371b46+'/'+_0x202183)[_0x9679('0x1b')](_0x1adac8);}return null;};}function patchUpdates(_0x1d6927){return function(_0x1e1d05){try{jsonpatch[_0x9679('0x1c')](_0x1e1d05,_0x1d6927,!![]);}catch(_0x4c7d00){return BPromise['reject'](_0x4c7d00);}return _0x1e1d05[_0x9679('0x1d')]();};}function saveUpdates(_0x111fb3,_0x569a56){return function(_0x1d9176){if(_0x1d9176){return _0x1d9176[_0x9679('0x1e')](_0x111fb3)[_0x9679('0x1f')](function(_0x3cb96d){return _0x3cb96d;});}return null;};}function removeEntity(_0x5049f9,_0x1e3dc1){return function(_0x26be85){if(_0x26be85){return _0x26be85['destroy']()[_0x9679('0x1f')](function(){_0x5049f9['status'](0xcc)[_0x9679('0x14')]();});}};}function handleEntityNotFound(_0x4a9427,_0xba0473){return function(_0x248f72){if(!_0x248f72){_0x4a9427[_0x9679('0x20')](0x194);}return _0x248f72;};}function handleError(_0x3be629,_0x2b19fa){_0x2b19fa=_0x2b19fa||0x1f4;return function(_0x2b427d){logger[_0x9679('0x21')](_0x2b427d[_0x9679('0x22')]);if(_0x2b427d[_0x9679('0x23')]){delete _0x2b427d[_0x9679('0x23')];}_0x3be629[_0x9679('0x13')](_0x2b19fa)[_0x9679('0x24')](_0x2b427d);};}exports['index']=function(_0x58762e,_0x57831e){var _0x55717c={},_0x2f823e={},_0x1baf91={'count':0x0,'rows':[]};var _0x30899e=_[_0x9679('0x25')](db[_0x9679('0x26')]['rawAttributes'],function(_0xa1b99a){return{'name':_0xa1b99a[_0x9679('0x27')],'type':_0xa1b99a['type'][_0x9679('0x28')]};});_0x2f823e[_0x9679('0x29')]=_['map'](_0x30899e,'name');_0x2f823e[_0x9679('0x2a')]=_[_0x9679('0x2b')](_0x58762e['query']);_0x2f823e[_0x9679('0x2c')]=_[_0x9679('0x2d')](_0x2f823e[_0x9679('0x29')],_0x2f823e['query']);_0x55717c[_0x9679('0x2e')]=_[_0x9679('0x2d')](_0x2f823e['model'],qs[_0x9679('0x2f')](_0x58762e[_0x9679('0x2a')][_0x9679('0x2f')]));_0x55717c[_0x9679('0x2e')]=_0x55717c[_0x9679('0x2e')]['length']?_0x55717c['attributes']:_0x2f823e['model'];if(!_0x58762e[_0x9679('0x2a')][_0x9679('0x30')](_0x9679('0x31'))){_0x55717c[_0x9679('0x16')]=qs[_0x9679('0x16')](_0x58762e[_0x9679('0x2a')]['limit']);_0x55717c[_0x9679('0x18')]=qs[_0x9679('0x18')](_0x58762e['query'][_0x9679('0x18')]);}_0x55717c[_0x9679('0x32')]=qs[_0x9679('0x33')](_0x58762e[_0x9679('0x2a')][_0x9679('0x33')]);_0x55717c[_0x9679('0x34')]=qs[_0x9679('0x2c')](_[_0x9679('0x35')](_0x58762e[_0x9679('0x2a')],_0x2f823e[_0x9679('0x2c')]),_0x30899e);if(_0x58762e[_0x9679('0x2a')][_0x9679('0x36')]){_0x55717c[_0x9679('0x34')]=_[_0x9679('0x37')](_0x55717c[_0x9679('0x34')],{'$or':_[_0x9679('0x25')](_0x30899e,function(_0x31c20c){if(_0x31c20c['type']!==_0x9679('0x38')){var _0xb01b50={};_0xb01b50[_0x31c20c[_0x9679('0x23')]]={'$like':'%'+_0x58762e[_0x9679('0x2a')]['filter']+'%'};return _0xb01b50;}})});}_0x55717c=_[_0x9679('0x37')]({},_0x55717c,_0x58762e['options']);var _0x5db741={'where':_0x55717c[_0x9679('0x34')]};return db[_0x9679('0x26')]['count'](_0x5db741)[_0x9679('0x1f')](function(_0x510edd){_0x1baf91[_0x9679('0x17')]=_0x510edd;if(_0x58762e[_0x9679('0x2a')][_0x9679('0x39')]){_0x55717c[_0x9679('0x3a')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x55717c);})[_0x9679('0x1f')](function(_0x2942fd){_0x1baf91['rows']=_0x2942fd;return _0x1baf91;})['then'](respondWithFilteredResult(_0x57831e,_0x55717c))[_0x9679('0x3b')](handleError(_0x57831e,null));};exports[_0x9679('0x3c')]=function(_0x33412c,_0x316b38){var _0x16a453={'raw':!![],'where':{'id':_0x33412c[_0x9679('0x3d')]['id']}},_0x411cb2={};_0x411cb2[_0x9679('0x29')]=_[_0x9679('0x2b')](db[_0x9679('0x26')]['rawAttributes']);_0x411cb2[_0x9679('0x2a')]=_['keys'](_0x33412c[_0x9679('0x2a')]);_0x411cb2['filters']=_[_0x9679('0x2d')](_0x411cb2[_0x9679('0x29')],_0x411cb2[_0x9679('0x2a')]);_0x16a453[_0x9679('0x2e')]=_[_0x9679('0x2d')](_0x411cb2[_0x9679('0x29')],qs[_0x9679('0x2f')](_0x33412c[_0x9679('0x2a')]['fields']));_0x16a453[_0x9679('0x2e')]=_0x16a453['attributes'][_0x9679('0x3e')]?_0x16a453['attributes']:_0x411cb2[_0x9679('0x29')];if(_0x33412c[_0x9679('0x2a')][_0x9679('0x39')]){_0x16a453[_0x9679('0x3a')]=[{'all':!![]}];}_0x16a453=_['merge']({},_0x16a453,_0x33412c[_0x9679('0x3f')]);return db[_0x9679('0x26')]['find'](_0x16a453)[_0x9679('0x1f')](handleEntityNotFound(_0x316b38,null))[_0x9679('0x1f')](respondWithResult(_0x316b38,null))[_0x9679('0x3b')](handleError(_0x316b38,null));};exports['create']=function(_0x353b5a,_0x4cfb90){return db[_0x9679('0x26')][_0x9679('0x40')](_0x353b5a[_0x9679('0x41')],{})['then'](respondWithResult(_0x4cfb90,0xc9))[_0x9679('0x3b')](handleError(_0x4cfb90,null));};exports[_0x9679('0x1e')]=function(_0x19787a,_0x2539bb){if(_0x19787a[_0x9679('0x41')]['id']){delete _0x19787a['body']['id'];}return db['ZohoField'][_0x9679('0x42')]({'where':{'id':_0x19787a['params']['id']}})['then'](handleEntityNotFound(_0x2539bb,null))[_0x9679('0x1f')](saveUpdates(_0x19787a[_0x9679('0x41')],null))[_0x9679('0x1f')](respondWithResult(_0x2539bb,null))[_0x9679('0x3b')](handleError(_0x2539bb,null));};exports[_0x9679('0x43')]=function(_0xd4ebc0,_0x2d6eef){return db[_0x9679('0x26')][_0x9679('0x42')]({'where':{'id':_0xd4ebc0[_0x9679('0x3d')]['id']}})[_0x9679('0x1f')](handleEntityNotFound(_0x2d6eef,null))[_0x9679('0x1f')](removeEntity(_0x2d6eef,null))[_0x9679('0x3b')](handleError(_0x2d6eef,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 64cd6c7..d03bdfd 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 _0x5430=['bluebird','rimraf','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x261a54,_0x15cb7a){var _0x3968e4=function(_0x1b07c4){while(--_0x1b07c4){_0x261a54['push'](_0x261a54['shift']());}};_0x3968e4(++_0x15cb7a);}(_0x5430,0x10c));var _0x0543=function(_0x5110fe,_0x558df7){_0x5110fe=_0x5110fe-0x0;var _0x3e48f9=_0x5430[_0x5110fe];return _0x3e48f9;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x0543('0x7')]=function(_0x45b909,_0x9754ba){return _0x45b909[_0x0543('0x8')](_0x0543('0x9'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0543('0xa'),'fields':[_0x0543('0xb'),_0x0543('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['moment','bluebird','request-promise','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x4f656f,_0x4721cd){var _0x4aa9f0=function(_0x1e974f){while(--_0x1e974f){_0x4f656f['push'](_0x4f656f['shift']());}};_0x4aa9f0(++_0x4721cd);}(_0x82c4,0x1ca));var _0x482c=function(_0x4ffbb0,_0x5b28ea){_0x4ffbb0=_0x4ffbb0-0x0;var _0xd29dd8=_0x82c4[_0x4ffbb0];return _0xd29dd8;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[{'name':_0x482c('0xc'),'fields':[_0x482c('0xd'),'FieldId'],'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 1457721..a500b0e 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 _0x6f3c=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','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','message','info'];(function(_0x476434,_0x1b57c8){var _0x1a14a5=function(_0xa16fd8){while(--_0xa16fd8){_0x476434['push'](_0x476434['shift']());}};_0x1a14a5(++_0x1b57c8);}(_0x6f3c,0x1b6));var _0xc6f3=function(_0x157fd6,_0x347e85){_0x157fd6=_0x157fd6-0x0;var _0xf11d05=_0x6f3c[_0x157fd6];return _0xf11d05;};'use strict';var _=require(_0xc6f3('0x0'));var util=require('util');var moment=require(_0xc6f3('0x1'));var BPromise=require(_0xc6f3('0x2'));var rs=require(_0xc6f3('0x3'));var fs=require('fs');var Redis=require(_0xc6f3('0x4'));var db=require(_0xc6f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6f3('0x6'))(_0xc6f3('0x7'));var config=require(_0xc6f3('0x8'));var jayson=require(_0xc6f3('0x9'));var client=jayson[_0xc6f3('0xa')][_0xc6f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14ad0c,_0x1c2bb8,_0x1e4f06){return new BPromise(function(_0x2647b5,_0x2d7d7e){return client[_0xc6f3('0xc')](_0x14ad0c,_0x1e4f06)[_0xc6f3('0xd')](function(_0x338c37){logger['info'](_0xc6f3('0xe'),_0x1c2bb8,_0xc6f3('0xf'));logger[_0xc6f3('0x10')](_0xc6f3('0x11'),_0x1c2bb8,_0xc6f3('0xf'),JSON[_0xc6f3('0x12')](_0x338c37));if(_0x338c37[_0xc6f3('0x13')]){if(_0x338c37[_0xc6f3('0x13')]['code']===0x1f4){logger['error'](_0xc6f3('0xe'),_0x1c2bb8,_0x338c37[_0xc6f3('0x13')][_0xc6f3('0x14')]);return _0x2d7d7e(_0x338c37[_0xc6f3('0x13')]['message']);}logger[_0xc6f3('0x13')](_0xc6f3('0xe'),_0x1c2bb8,_0x338c37['error'][_0xc6f3('0x14')]);return _0x2647b5(_0x338c37[_0xc6f3('0x13')][_0xc6f3('0x14')]);}else{logger[_0xc6f3('0x15')](_0xc6f3('0xe'),_0x1c2bb8,'request\x20sent');_0x2647b5(_0x338c37['result'][_0xc6f3('0x14')]);}})[_0xc6f3('0x16')](function(_0x27c85b){logger[_0xc6f3('0x13')](_0xc6f3('0xe'),_0x1c2bb8,_0x27c85b);_0x2d7d7e(_0x27c85b);});});} \ No newline at end of file +var _0x05ac=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x459da2,_0x3f93e6){var _0x7f0e46=function(_0x5755cc){while(--_0x5755cc){_0x459da2['push'](_0x459da2['shift']());}};_0x7f0e46(++_0x3f93e6);}(_0x05ac,0x1a5));var _0xc05a=function(_0x41f174,_0x5f4123){_0x41f174=_0x41f174-0x0;var _0x23803f=_0x05ac[_0x41f174];return _0x23803f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc05a('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc05a('0x1'))(_0xc05a('0x2'));var config=require(_0xc05a('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xc05a('0x4')][_0xc05a('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x363ca5,_0xf6223b,_0x5ec052){return new BPromise(function(_0x5c36a0,_0x41e4a4){return client[_0xc05a('0x6')](_0x363ca5,_0x5ec052)[_0xc05a('0x7')](function(_0x2a5860){logger[_0xc05a('0x8')](_0xc05a('0x9'),_0xf6223b,_0xc05a('0xa'));logger[_0xc05a('0xb')](_0xc05a('0xc'),_0xf6223b,'request\x20sent',JSON[_0xc05a('0xd')](_0x2a5860));if(_0x2a5860[_0xc05a('0xe')]){if(_0x2a5860[_0xc05a('0xe')][_0xc05a('0xf')]===0x1f4){logger[_0xc05a('0xe')](_0xc05a('0x9'),_0xf6223b,_0x2a5860['error'][_0xc05a('0x10')]);return _0x41e4a4(_0x2a5860[_0xc05a('0xe')][_0xc05a('0x10')]);}logger[_0xc05a('0xe')](_0xc05a('0x9'),_0xf6223b,_0x2a5860[_0xc05a('0xe')][_0xc05a('0x10')]);return _0x5c36a0(_0x2a5860[_0xc05a('0xe')]['message']);}else{logger['info'](_0xc05a('0x9'),_0xf6223b,_0xc05a('0xa'));_0x5c36a0(_0x2a5860['result'][_0xc05a('0x10')]);}})[_0xc05a('0x11')](function(_0x15e1fc){logger['error'](_0xc05a('0x9'),_0xf6223b,_0x15e1fc);_0x41e4a4(_0x15e1fc);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8956149..ec41212 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x27066c,_0x5d9a62){var _0x41828a=function(_0x4db0b1){while(--_0x4db0b1){_0x27066c['push'](_0x27066c['shift']());}};_0x41828a(++_0x5d9a62);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x15d66d,_0x99094c){var _0x3e9020=function(_0x42986b){while(--_0x42986b){_0x15d66d['push'](_0x15d66d['shift']());}};_0x3e9020(++_0x99094c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e42c517..f5f29b9 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 _0xefe2=['sequelize','exports','unique_name_and_version','STRING','INTEGER','BOOLEAN','state'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0xefe2,0xd9));var _0x2efe=function(_0x32fd9c,_0x52271b){_0x32fd9c=_0x32fd9c-0x0;var _0x4cbc5f=_0xefe2[_0x32fd9c];return _0x4cbc5f;};'use strict';var Sequelize=require(_0x2efe('0x0'));module[_0x2efe('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2efe('0x2')},'version':{'type':Sequelize[_0x2efe('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x2efe('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x2efe('0x3')]},'path':{'type':Sequelize[_0x2efe('0x3')]},'type':{'type':Sequelize[_0x2efe('0x3')]},'size':{'type':Sequelize[_0x2efe('0x4')]},'active':{'type':Sequelize[_0x2efe('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x2efe('0x3')]},'state':{'type':Sequelize[_0x2efe('0x3')],'unique':_0x2efe('0x6')},'description':{'type':Sequelize[_0x2efe('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2efe('0x3')]},'link':{'type':Sequelize[_0x2efe('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x81d5=['INTEGER','BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x64a51,_0x1c61b7){var _0x1eba45=function(_0x230cf8){while(--_0x230cf8){_0x64a51['push'](_0x64a51['shift']());}};_0x1eba45(++_0x1c61b7);}(_0x81d5,0x1ab));var _0x581d=function(_0xf2b9b9,_0x468bf4){_0xf2b9b9=_0xf2b9b9-0x0;var _0x13779d=_0x81d5[_0xf2b9b9];return _0x13779d;};'use strict';var Sequelize=require(_0x581d('0x0'));module[_0x581d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x581d('0x2')},'version':{'type':Sequelize[_0x581d('0x3')],'allowNull':![],'unique':_0x581d('0x2')},'main':{'type':Sequelize[_0x581d('0x3')],'defaultValue':_0x581d('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x581d('0x3')]},'size':{'type':Sequelize[_0x581d('0x5')]},'active':{'type':Sequelize[_0x581d('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x581d('0x3')]},'state':{'type':Sequelize[_0x581d('0x3')],'unique':_0x581d('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x581d('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index be44c04..5910b7d 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 _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x2542,0x169));var _0x2254=function(_0x363cb7,_0x2fd116){_0x363cb7=_0x363cb7-0x0;var _0x176128=_0x2542[_0x363cb7];return _0x176128;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['Integration'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x3940e9,_0x867363){var _0x1e5081=function(_0x1a7407){while(--_0x1a7407){_0x3940e9['push'](_0x3940e9['shift']());}};_0x1e5081(++_0x867363);}(_0xfcf0,0x138));var _0x0fcf=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0xfcf0[_0x406e46];return _0x4a3742;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index e5394d9..f8dbf8c 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 _0xc8a9=['bluebird','rimraf','../../config/environment','./integration.attributes','exports','define','lodash','api'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xc8a9,0xce));var _0x9c8a=function(_0x2ef26e,_0x9738ab){_0x2ef26e=_0x2ef26e-0x0;var _0x53d231=_0xc8a9[_0x2ef26e];return _0x53d231;};'use strict';var _=require(_0x9c8a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c8a('0x1'));var moment=require('moment');var BPromise=require(_0x9c8a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c8a('0x3'));var config=require(_0x9c8a('0x4'));var attributes=require(_0x9c8a('0x5'));module[_0x9c8a('0x6')]=function(_0x1799e2,_0x3a343f){return _0x1799e2[_0x9c8a('0x7')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d7b=['path','rimraf','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api','request-promise'];(function(_0x57a53b,_0x11494e){var _0x29e81c=function(_0x24c522){while(--_0x24c522){_0x57a53b['push'](_0x57a53b['shift']());}};_0x29e81c(++_0x11494e);}(_0x6d7b,0xc1));var _0xb6d7=function(_0x4b33ff,_0x34193c){_0x4b33ff=_0x4b33ff-0x0;var _0x24c2f7=_0x6d7b[_0x4b33ff];return _0x24c2f7;};'use strict';var _=require(_0xb6d7('0x0'));var util=require(_0xb6d7('0x1'));var logger=require(_0xb6d7('0x2'))(_0xb6d7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb6d7('0x4'));var fs=require('fs');var path=require(_0xb6d7('0x5'));var rimraf=require(_0xb6d7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6d7('0x7'));module[_0xb6d7('0x8')]=function(_0xc5e9ba,_0x4a75a1){return _0xc5e9ba[_0xb6d7('0x9')](_0xb6d7('0xa'),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 5807d20..737bbe9 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 _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0xd75d67,_0x3274bb){var _0x8d7d3a=function(_0x153f30){while(--_0x153f30){_0xd75d67['push'](_0xd75d67['shift']());}};_0x8d7d3a(++_0x3274bb);}(_0xd943,0x15d));var _0x3d94=function(_0x4d7079,_0x581acd){_0x4d7079=_0x4d7079-0x0;var _0x4f90c3=_0xd943[_0x4d7079];return _0x4f90c3;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file +var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0xf1e5da,_0x3ecd47){var _0x331120=function(_0x30894f){while(--_0x30894f){_0xf1e5da['push'](_0xf1e5da['shift']());}};_0x331120(++_0x3ecd47);}(_0x1a85,0x178));var _0x51a8=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x1a85[_0x2a8c21];return _0x5f3061;};'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});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Integration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 64a8fd2..6301868 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 _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xd943,0x15d));var _0x3d94=function(_0x544494,_0x185520){_0x544494=_0x544494-0x0;var _0x2aa146=_0xd943[_0x544494];return _0x2aa146;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file +var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x2db2da,_0x36aba0){var _0x9d5c25=function(_0x321577){while(--_0x321577){_0x2db2da['push'](_0x2db2da['shift']());}};_0x9d5c25(++_0x36aba0);}(_0xef0f,0x168));var _0xfef0=function(_0x35ef49,_0x39ff7e){_0x35ef49=_0x35ef49-0x0;var _0x33b503=_0xef0f[_0x35ef49];return _0x33b503;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 57083b5..56f0d8e 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 _0xa7c9=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED'];(function(_0x5d3116,_0x36439f){var _0x1f21a3=function(_0x59508d){while(--_0x59508d){_0x5d3116['push'](_0x5d3116['shift']());}};_0x1f21a3(++_0x36439f);}(_0xa7c9,0x108));var _0x9a7c=function(_0x2c2d92,_0x59fa1b){_0x2c2d92=_0x2c2d92-0x0;var _0x2ce0fd=_0xa7c9[_0x2c2d92];return _0x2ce0fd;};'use strict';var Sequelize=require(_0x9a7c('0x0'));module[_0x9a7c('0x1')]={'integration':{'type':Sequelize[_0x9a7c('0x2')]},'eventChannel':{'type':Sequelize[_0x9a7c('0x2')]},'exitStatus':{'type':Sequelize[_0x9a7c('0x2')]},'ticketId':{'type':Sequelize[_0x9a7c('0x2')]},'integrationId':{'type':Sequelize[_0x9a7c('0x3')]},'contacts':{'type':Sequelize[_0x9a7c('0x2')]},'uniqueid':{'type':Sequelize[_0x9a7c('0x2')]},'calleridnum':{'type':Sequelize[_0x9a7c('0x2')]},'calleridname':{'type':Sequelize[_0x9a7c('0x2')]},'queue':{'type':Sequelize[_0x9a7c('0x2')]},'interface':{'type':Sequelize[_0x9a7c('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9a7c('0x4')]},'holdtime':{'type':Sequelize[_0x9a7c('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9a7c('0x4')]},'talktime':{'type':Sequelize[_0x9a7c('0x3')]},'agentacw':{'type':Sequelize[_0x9a7c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9a7c('0x3')]},'reason':{'type':Sequelize[_0x9a7c('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x9a7c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9a7c('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x9a7c('0x2')]},'channel':{'type':Sequelize[_0x9a7c('0x2')]},'channelstate':{'type':Sequelize[_0x9a7c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9a7c('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9a7c('0x2')]},'language':{'type':Sequelize[_0x9a7c('0x2')]},'accountcode':{'type':Sequelize[_0x9a7c('0x2')]},'context':{'type':Sequelize[_0x9a7c('0x2')]},'exten':{'type':Sequelize[_0x9a7c('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9a7c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9a7c('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9a7c('0x2')]},'destcalleridname':{'type':Sequelize[_0x9a7c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x9a7c('0x2')]},'destlanguage':{'type':Sequelize[_0x9a7c('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9a7c('0x2')]},'destexten':{'type':Sequelize[_0x9a7c('0x2')]},'destpriority':{'type':Sequelize[_0x9a7c('0x2')]},'destuniqueid':{'type':Sequelize[_0x9a7c('0x2')]},'messageId':{'type':Sequelize[_0x9a7c('0x2')]},'inReplyTo':{'type':Sequelize[_0x9a7c('0x2')]},'subject':{'type':Sequelize[_0x9a7c('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9a7c('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x9a7c('0x6')]},'html':{'type':Sequelize[_0x9a7c('0x6')]},'text':{'type':Sequelize[_0x9a7c('0x6')]},'status':{'type':Sequelize[_0x9a7c('0x7')](_0x9a7c('0x8'),_0x9a7c('0x9'),'RECEIVED',_0x9a7c('0xa'))},'url':{'type':Sequelize[_0x9a7c('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x9a7c('0x2')]},'projectId':{'type':Sequelize[_0x9a7c('0x3')]}}; \ No newline at end of file +var _0x67be=['BOOLEAN','TEXT','exports','STRING','INTEGER','DATE'];(function(_0x2b31a8,_0x28b862){var _0x1175a5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x2b31a8['push'](_0x2b31a8['shift']());}};_0x1175a5(++_0x28b862);}(_0x67be,0x80));var _0xe67b=function(_0x9b790,_0x14e089){_0x9b790=_0x9b790-0x0;var _0x1c6789=_0x67be[_0x9b790];return _0x1c6789;};'use strict';var Sequelize=require('sequelize');module[_0xe67b('0x0')]={'integration':{'type':Sequelize[_0xe67b('0x1')]},'eventChannel':{'type':Sequelize[_0xe67b('0x1')]},'exitStatus':{'type':Sequelize[_0xe67b('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xe67b('0x2')]},'contacts':{'type':Sequelize[_0xe67b('0x1')]},'uniqueid':{'type':Sequelize[_0xe67b('0x1')]},'calleridnum':{'type':Sequelize[_0xe67b('0x1')]},'calleridname':{'type':Sequelize[_0xe67b('0x1')]},'queue':{'type':Sequelize[_0xe67b('0x1')]},'interface':{'type':Sequelize[_0xe67b('0x1')]},'membername':{'type':Sequelize[_0xe67b('0x1')]},'agentcalledAt':{'type':Sequelize[_0xe67b('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe67b('0x3')]},'holdtime':{'type':Sequelize[_0xe67b('0x2')]},'agentcomplete':{'type':Sequelize[_0xe67b('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xe67b('0x3')]},'talktime':{'type':Sequelize[_0xe67b('0x2')]},'agentacw':{'type':Sequelize[_0xe67b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe67b('0x2')]},'reason':{'type':Sequelize[_0xe67b('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xe67b('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xe67b('0x3')]},'agentdump':{'type':Sequelize[_0xe67b('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe67b('0x3')]},'lastevent':{'type':Sequelize[_0xe67b('0x1')]},'channel':{'type':Sequelize[_0xe67b('0x1')]},'channelstate':{'type':Sequelize[_0xe67b('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xe67b('0x1')]},'connectedlinename':{'type':Sequelize[_0xe67b('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe67b('0x1')]},'context':{'type':Sequelize[_0xe67b('0x1')]},'exten':{'type':Sequelize[_0xe67b('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xe67b('0x1')]},'destchannelstate':{'type':Sequelize[_0xe67b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe67b('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe67b('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe67b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xe67b('0x1')]},'destlanguage':{'type':Sequelize[_0xe67b('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xe67b('0x1')]},'messageId':{'type':Sequelize[_0xe67b('0x1')]},'inReplyTo':{'type':Sequelize[_0xe67b('0x1')]},'subject':{'type':Sequelize[_0xe67b('0x1')]},'from':{'type':Sequelize[_0xe67b('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe67b('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xe67b('0x5')]},'text':{'type':Sequelize[_0xe67b('0x5')]},'status':{'type':Sequelize['ENUM']('SENT','SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0xe67b('0x1')]},'app':{'type':Sequelize[_0xe67b('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xe67b('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 28e8caf..f4c5241 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 _0x2ffb=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','IntegrationReport','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','error','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x1c6769,_0x1905b4){var _0x5904c2=function(_0x734f6b){while(--_0x734f6b){_0x1c6769['push'](_0x1c6769['shift']());}};_0x5904c2(++_0x1905b4);}(_0x2ffb,0x1d9));var _0xb2ff=function(_0x31490c,_0x3a51c6){_0x31490c=_0x31490c-0x0;var _0x4c7410=_0x2ffb[_0x31490c];return _0x4c7410;};'use strict';var emlformat=require(_0xb2ff('0x0'));var rimraf=require(_0xb2ff('0x1'));var zipdir=require(_0xb2ff('0x2'));var jsonpatch=require(_0xb2ff('0x3'));var rp=require(_0xb2ff('0x4'));var moment=require('moment');var BPromise=require(_0xb2ff('0x5'));var Mustache=require(_0xb2ff('0x6'));var util=require(_0xb2ff('0x7'));var path=require('path');var sox=require(_0xb2ff('0x8'));var csv=require(_0xb2ff('0x9'));var ejs=require(_0xb2ff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2ff('0xb'));var squel=require(_0xb2ff('0xc'));var crypto=require(_0xb2ff('0xd'));var jsforce=require(_0xb2ff('0xe'));var deskjs=require(_0xb2ff('0xf'));var toCsv=require(_0xb2ff('0x9'));var querystring=require(_0xb2ff('0x10'));var Papa=require(_0xb2ff('0x11'));var Redis=require(_0xb2ff('0x12'));var authService=require(_0xb2ff('0x13'));var qs=require(_0xb2ff('0x14'));var as=require(_0xb2ff('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2ff('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb2ff('0x17'));var db=require(_0xb2ff('0x18'))['db'];function respondWithStatusCode(_0x5a7553,_0x199d55){_0x199d55=_0x199d55||0xcc;return function(_0x21068b){if(_0x21068b){return _0x5a7553[_0xb2ff('0x19')](_0x199d55);}return _0x5a7553[_0xb2ff('0x1a')](_0x199d55)[_0xb2ff('0x1b')]();};}function respondWithResult(_0x159fe0,_0x56b953){_0x56b953=_0x56b953||0xc8;return function(_0x4f7d25){if(_0x4f7d25){return _0x159fe0[_0xb2ff('0x1a')](_0x56b953)['json'](_0x4f7d25);}};}function respondWithFilteredResult(_0x3d7aa3,_0x46b5ad){return function(_0x23fb85){if(_0x23fb85){var _0x33607f=typeof _0x46b5ad[_0xb2ff('0x1c')]===_0xb2ff('0x1d')&&typeof _0x46b5ad[_0xb2ff('0x1e')]==='undefined';var _0x42553d=_0x23fb85[_0xb2ff('0x1f')];var _0x3e55ac=_0x33607f?0x0:_0x46b5ad['offset'];var _0x405ca7=_0x33607f?_0x23fb85[_0xb2ff('0x1f')]:_0x46b5ad[_0xb2ff('0x1c')]+_0x46b5ad[_0xb2ff('0x1e')];var _0x1190db;if(_0x405ca7>=_0x42553d){_0x405ca7=_0x42553d;_0x1190db=0xc8;}else{_0x1190db=0xce;}_0x3d7aa3['status'](_0x1190db);return _0x3d7aa3[_0xb2ff('0x20')](_0xb2ff('0x21'),_0x3e55ac+'-'+_0x405ca7+'/'+_0x42553d)[_0xb2ff('0x22')](_0x23fb85);}return null;};}function patchUpdates(_0x360ec8){return function(_0x44f5d7){try{jsonpatch['apply'](_0x44f5d7,_0x360ec8,!![]);}catch(_0x2fa240){return BPromise['reject'](_0x2fa240);}return _0x44f5d7[_0xb2ff('0x23')]();};}function saveUpdates(_0x1cda8f,_0x54a543){return function(_0xde8295){if(_0xde8295){return _0xde8295[_0xb2ff('0x24')](_0x1cda8f)[_0xb2ff('0x25')](function(_0x3e1ec5){return _0x3e1ec5;});}return null;};}function removeEntity(_0x766e26,_0x2ac3bf){return function(_0x4fa83e){if(_0x4fa83e){return _0x4fa83e['destroy']()[_0xb2ff('0x25')](function(){_0x766e26[_0xb2ff('0x1a')](0xcc)[_0xb2ff('0x1b')]();});}};}function handleEntityNotFound(_0x25fdb7,_0x5163db){return function(_0x472a4b){if(!_0x472a4b){_0x25fdb7[_0xb2ff('0x19')](0x194);}return _0x472a4b;};}function handleError(_0x568eff,_0x203048){_0x203048=_0x203048||0x1f4;return function(_0x18b406){logger[_0xb2ff('0x26')](_0x18b406['stack']);if(_0x18b406[_0xb2ff('0x27')]){delete _0x18b406[_0xb2ff('0x27')];}_0x568eff[_0xb2ff('0x1a')](_0x203048)[_0xb2ff('0x28')](_0x18b406);};}exports[_0xb2ff('0x29')]=function(_0x47892a,_0x556595){var _0x152e26={},_0xb0b073={},_0x352508={'count':0x0,'rows':[]};var _0x49a918=_[_0xb2ff('0x2a')](db['IntegrationReport']['rawAttributes'],function(_0x3eb154){return{'name':_0x3eb154[_0xb2ff('0x2b')],'type':_0x3eb154['type'][_0xb2ff('0x2c')]};});_0xb0b073[_0xb2ff('0x2d')]=_[_0xb2ff('0x2a')](_0x49a918,_0xb2ff('0x27'));_0xb0b073[_0xb2ff('0x2e')]=_['keys'](_0x47892a[_0xb2ff('0x2e')]);_0xb0b073[_0xb2ff('0x2f')]=_[_0xb2ff('0x30')](_0xb0b073[_0xb2ff('0x2d')],_0xb0b073[_0xb2ff('0x2e')]);_0x152e26[_0xb2ff('0x31')]=_[_0xb2ff('0x30')](_0xb0b073[_0xb2ff('0x2d')],qs[_0xb2ff('0x32')](_0x47892a[_0xb2ff('0x2e')]['fields']));_0x152e26[_0xb2ff('0x31')]=_0x152e26[_0xb2ff('0x31')][_0xb2ff('0x33')]?_0x152e26[_0xb2ff('0x31')]:_0xb0b073[_0xb2ff('0x2d')];if(!_0x47892a[_0xb2ff('0x2e')][_0xb2ff('0x34')](_0xb2ff('0x35'))){_0x152e26['limit']=qs['limit'](_0x47892a[_0xb2ff('0x2e')][_0xb2ff('0x1e')]);_0x152e26[_0xb2ff('0x1c')]=qs[_0xb2ff('0x1c')](_0x47892a[_0xb2ff('0x2e')][_0xb2ff('0x1c')]);}_0x152e26[_0xb2ff('0x36')]=qs[_0xb2ff('0x37')](_0x47892a['query'][_0xb2ff('0x37')]);_0x152e26[_0xb2ff('0x38')]=qs[_0xb2ff('0x2f')](_[_0xb2ff('0x39')](_0x47892a[_0xb2ff('0x2e')],_0xb0b073[_0xb2ff('0x2f')]),_0x49a918);if(_0x47892a[_0xb2ff('0x2e')][_0xb2ff('0x3a')]){_0x152e26[_0xb2ff('0x38')]=_[_0xb2ff('0x3b')](_0x152e26[_0xb2ff('0x38')],{'$or':_[_0xb2ff('0x2a')](_0x49a918,function(_0x69103e){if(_0x69103e[_0xb2ff('0x3c')]!==_0xb2ff('0x3d')){var _0x19fa07={};_0x19fa07[_0x69103e[_0xb2ff('0x27')]]={'$like':'%'+_0x47892a[_0xb2ff('0x2e')][_0xb2ff('0x3a')]+'%'};return _0x19fa07;}})});}_0x152e26=_[_0xb2ff('0x3b')]({},_0x152e26,_0x47892a[_0xb2ff('0x3e')]);var _0x3e8670={'where':_0x152e26[_0xb2ff('0x38')]};return db['IntegrationReport']['count'](_0x3e8670)[_0xb2ff('0x25')](function(_0x6276f0){_0x352508[_0xb2ff('0x1f')]=_0x6276f0;if(_0x47892a[_0xb2ff('0x2e')][_0xb2ff('0x3f')]){_0x152e26[_0xb2ff('0x40')]=[{'all':!![]}];}return db['IntegrationReport'][_0xb2ff('0x41')](_0x152e26);})[_0xb2ff('0x25')](function(_0x3e01ea){_0x352508['rows']=_0x3e01ea;return _0x352508;})[_0xb2ff('0x25')](respondWithFilteredResult(_0x556595,_0x152e26))[_0xb2ff('0x42')](handleError(_0x556595,null));};exports['show']=function(_0x4099cf,_0x2f759d){var _0x2f9d74={'raw':![],'where':{'id':_0x4099cf[_0xb2ff('0x43')]['id']}},_0xd62695={};_0xd62695[_0xb2ff('0x2d')]=_['keys'](db[_0xb2ff('0x44')][_0xb2ff('0x45')]);_0xd62695[_0xb2ff('0x2e')]=_['keys'](_0x4099cf[_0xb2ff('0x2e')]);_0xd62695[_0xb2ff('0x2f')]=_[_0xb2ff('0x30')](_0xd62695['model'],_0xd62695[_0xb2ff('0x2e')]);_0x2f9d74['attributes']=_[_0xb2ff('0x30')](_0xd62695[_0xb2ff('0x2d')],qs['fields'](_0x4099cf['query'][_0xb2ff('0x32')]));_0x2f9d74['attributes']=_0x2f9d74[_0xb2ff('0x31')][_0xb2ff('0x33')]?_0x2f9d74[_0xb2ff('0x31')]:_0xd62695[_0xb2ff('0x2d')];if(_0x4099cf[_0xb2ff('0x2e')][_0xb2ff('0x3f')]){_0x2f9d74[_0xb2ff('0x40')]=[{'all':!![]}];}_0x2f9d74=_[_0xb2ff('0x3b')]({},_0x2f9d74,_0x4099cf[_0xb2ff('0x3e')]);return db['IntegrationReport'][_0xb2ff('0x46')](_0x2f9d74)['then'](handleEntityNotFound(_0x2f759d,null))[_0xb2ff('0x25')](respondWithResult(_0x2f759d,null))['catch'](handleError(_0x2f759d,null));};exports[_0xb2ff('0x47')]=function(_0x9686c1,_0x2a6d5b){return db['IntegrationReport'][_0xb2ff('0x47')](_0x9686c1[_0xb2ff('0x48')],{})[_0xb2ff('0x25')](respondWithResult(_0x2a6d5b,0xc9))[_0xb2ff('0x42')](handleError(_0x2a6d5b,null));};exports['update']=function(_0x54aaf4,_0x31107d){if(_0x54aaf4[_0xb2ff('0x48')]['id']){delete _0x54aaf4[_0xb2ff('0x48')]['id'];}return db[_0xb2ff('0x44')][_0xb2ff('0x46')]({'where':{'id':_0x54aaf4[_0xb2ff('0x43')]['id']}})[_0xb2ff('0x25')](handleEntityNotFound(_0x31107d,null))[_0xb2ff('0x25')](saveUpdates(_0x54aaf4[_0xb2ff('0x48')],null))[_0xb2ff('0x25')](respondWithResult(_0x31107d,null))[_0xb2ff('0x42')](handleError(_0x31107d,null));};exports[_0xb2ff('0x49')]=function(_0x1b43b3,_0xdc037){return db[_0xb2ff('0x44')][_0xb2ff('0x46')]({'where':{'id':_0x1b43b3['params']['id']}})['then'](handleEntityNotFound(_0xdc037,null))[_0xb2ff('0x25')](removeEntity(_0xdc037,null))[_0xb2ff('0x42')](handleError(_0xdc037,null));};exports[_0xb2ff('0x4a')]=function(_0x1c9573,_0x448195){return db['IntegrationReport'][_0xb2ff('0x4a')]()['then'](respondWithResult(_0x448195,null))[_0xb2ff('0x42')](handleError(_0x448195,null));}; \ No newline at end of file +var _0x3f89=['describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','key','keys','query','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','IntegrationReport','findAll','rows','catch','params','intersection','fields','find','create','body'];(function(_0xa5e746,_0x36767d){var _0x207ea6=function(_0x485cf3){while(--_0x485cf3){_0xa5e746['push'](_0xa5e746['shift']());}};_0x207ea6(++_0x36767d);}(_0x3f89,0x97));var _0x93f8=function(_0x165f34,_0xd8983b){_0x165f34=_0x165f34-0x0;var _0x1fc514=_0x3f89[_0x165f34];return _0x1fc514;};'use strict';var emlformat=require(_0x93f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93f8('0x2'));var moment=require(_0x93f8('0x3'));var BPromise=require(_0x93f8('0x4'));var Mustache=require(_0x93f8('0x5'));var util=require(_0x93f8('0x6'));var path=require(_0x93f8('0x7'));var sox=require(_0x93f8('0x8'));var csv=require('to-csv');var ejs=require(_0x93f8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93f8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x93f8('0xb'));var deskjs=require(_0x93f8('0xc'));var toCsv=require(_0x93f8('0xd'));var querystring=require(_0x93f8('0xe'));var Papa=require(_0x93f8('0xf'));var Redis=require(_0x93f8('0x10'));var authService=require(_0x93f8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x93f8('0x12'));var hardwareService=require(_0x93f8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x93f8('0x14'));var config=require(_0x93f8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x93f8('0x16'))['db'];function respondWithStatusCode(_0x41d16e,_0x2d42c6){_0x2d42c6=_0x2d42c6||0xcc;return function(_0x143540){if(_0x143540){return _0x41d16e[_0x93f8('0x17')](_0x2d42c6);}return _0x41d16e[_0x93f8('0x18')](_0x2d42c6)[_0x93f8('0x19')]();};}function respondWithResult(_0x20f793,_0x5ab4b5){_0x5ab4b5=_0x5ab4b5||0xc8;return function(_0x5c078c){if(_0x5c078c){return _0x20f793[_0x93f8('0x18')](_0x5ab4b5)[_0x93f8('0x1a')](_0x5c078c);}};}function respondWithFilteredResult(_0x1e250e,_0x44a2e6){return function(_0x4df79d){if(_0x4df79d){var _0x4de717=typeof _0x44a2e6[_0x93f8('0x1b')]===_0x93f8('0x1c')&&typeof _0x44a2e6[_0x93f8('0x1d')]==='undefined';var _0x3542df=_0x4df79d[_0x93f8('0x1e')];var _0x82097d=_0x4de717?0x0:_0x44a2e6['offset'];var _0xc83424=_0x4de717?_0x4df79d['count']:_0x44a2e6[_0x93f8('0x1b')]+_0x44a2e6[_0x93f8('0x1d')];var _0x246b58;if(_0xc83424>=_0x3542df){_0xc83424=_0x3542df;_0x246b58=0xc8;}else{_0x246b58=0xce;}_0x1e250e[_0x93f8('0x18')](_0x246b58);return _0x1e250e[_0x93f8('0x1f')](_0x93f8('0x20'),_0x82097d+'-'+_0xc83424+'/'+_0x3542df)[_0x93f8('0x1a')](_0x4df79d);}return null;};}function patchUpdates(_0x5aa4c1){return function(_0x211fed){try{jsonpatch[_0x93f8('0x21')](_0x211fed,_0x5aa4c1,!![]);}catch(_0x3cb10a){return BPromise[_0x93f8('0x22')](_0x3cb10a);}return _0x211fed[_0x93f8('0x23')]();};}function saveUpdates(_0x3ed6a3,_0x5be926){return function(_0x335728){if(_0x335728){return _0x335728[_0x93f8('0x24')](_0x3ed6a3)[_0x93f8('0x25')](function(_0x1d1e2e){return _0x1d1e2e;});}return null;};}function removeEntity(_0x4c888e,_0x20ed68){return function(_0x433a23){if(_0x433a23){return _0x433a23[_0x93f8('0x26')]()[_0x93f8('0x25')](function(){_0x4c888e[_0x93f8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6eb7fe,_0x12ecbd){return function(_0x925479){if(!_0x925479){_0x6eb7fe[_0x93f8('0x17')](0x194);}return _0x925479;};}function handleError(_0x48115e,_0x1f7417){_0x1f7417=_0x1f7417||0x1f4;return function(_0x4503db){logger[_0x93f8('0x27')](_0x4503db['stack']);if(_0x4503db[_0x93f8('0x28')]){delete _0x4503db[_0x93f8('0x28')];}_0x48115e[_0x93f8('0x18')](_0x1f7417)[_0x93f8('0x29')](_0x4503db);};}exports['index']=function(_0x5b654e,_0x38633c){var _0x134e97={},_0x4b3766={},_0x5f48ef={'count':0x0,'rows':[]};var _0x594339=_[_0x93f8('0x2a')](db['IntegrationReport'][_0x93f8('0x2b')],function(_0x4335cc){return{'name':_0x4335cc[_0x93f8('0x2c')],'type':_0x4335cc['type'][_0x93f8('0x2d')]};});_0x4b3766['model']=_[_0x93f8('0x2a')](_0x594339,_0x93f8('0x28'));_0x4b3766['query']=_[_0x93f8('0x2e')](_0x5b654e[_0x93f8('0x2f')]);_0x4b3766[_0x93f8('0x30')]=_['intersection'](_0x4b3766[_0x93f8('0x31')],_0x4b3766['query']);_0x134e97[_0x93f8('0x32')]=_['intersection'](_0x4b3766[_0x93f8('0x31')],qs['fields'](_0x5b654e[_0x93f8('0x2f')]['fields']));_0x134e97[_0x93f8('0x32')]=_0x134e97[_0x93f8('0x32')][_0x93f8('0x33')]?_0x134e97[_0x93f8('0x32')]:_0x4b3766[_0x93f8('0x31')];if(!_0x5b654e['query'][_0x93f8('0x34')](_0x93f8('0x35'))){_0x134e97[_0x93f8('0x1d')]=qs[_0x93f8('0x1d')](_0x5b654e[_0x93f8('0x2f')][_0x93f8('0x1d')]);_0x134e97[_0x93f8('0x1b')]=qs[_0x93f8('0x1b')](_0x5b654e[_0x93f8('0x2f')][_0x93f8('0x1b')]);}_0x134e97[_0x93f8('0x36')]=qs[_0x93f8('0x37')](_0x5b654e[_0x93f8('0x2f')][_0x93f8('0x37')]);_0x134e97[_0x93f8('0x38')]=qs['filters'](_[_0x93f8('0x39')](_0x5b654e[_0x93f8('0x2f')],_0x4b3766[_0x93f8('0x30')]),_0x594339);if(_0x5b654e[_0x93f8('0x2f')][_0x93f8('0x3a')]){_0x134e97[_0x93f8('0x38')]=_[_0x93f8('0x3b')](_0x134e97['where'],{'$or':_[_0x93f8('0x2a')](_0x594339,function(_0xf98b95){if(_0xf98b95[_0x93f8('0x3c')]!==_0x93f8('0x3d')){var _0x4df35c={};_0x4df35c[_0xf98b95[_0x93f8('0x28')]]={'$like':'%'+_0x5b654e[_0x93f8('0x2f')][_0x93f8('0x3a')]+'%'};return _0x4df35c;}})});}_0x134e97=_[_0x93f8('0x3b')]({},_0x134e97,_0x5b654e['options']);var _0xc603b3={'where':_0x134e97[_0x93f8('0x38')]};return db['IntegrationReport'][_0x93f8('0x1e')](_0xc603b3)[_0x93f8('0x25')](function(_0x5a490b){_0x5f48ef[_0x93f8('0x1e')]=_0x5a490b;if(_0x5b654e['query'][_0x93f8('0x3e')]){_0x134e97[_0x93f8('0x3f')]=[{'all':!![]}];}return db[_0x93f8('0x40')][_0x93f8('0x41')](_0x134e97);})[_0x93f8('0x25')](function(_0x26b66d){_0x5f48ef[_0x93f8('0x42')]=_0x26b66d;return _0x5f48ef;})[_0x93f8('0x25')](respondWithFilteredResult(_0x38633c,_0x134e97))[_0x93f8('0x43')](handleError(_0x38633c,null));};exports['show']=function(_0x15d083,_0x479bad){var _0x27018c={'raw':![],'where':{'id':_0x15d083[_0x93f8('0x44')]['id']}},_0x87ffc4={};_0x87ffc4['model']=_[_0x93f8('0x2e')](db[_0x93f8('0x40')][_0x93f8('0x2b')]);_0x87ffc4['query']=_[_0x93f8('0x2e')](_0x15d083[_0x93f8('0x2f')]);_0x87ffc4[_0x93f8('0x30')]=_[_0x93f8('0x45')](_0x87ffc4[_0x93f8('0x31')],_0x87ffc4[_0x93f8('0x2f')]);_0x27018c[_0x93f8('0x32')]=_[_0x93f8('0x45')](_0x87ffc4[_0x93f8('0x31')],qs[_0x93f8('0x46')](_0x15d083[_0x93f8('0x2f')][_0x93f8('0x46')]));_0x27018c[_0x93f8('0x32')]=_0x27018c[_0x93f8('0x32')][_0x93f8('0x33')]?_0x27018c['attributes']:_0x87ffc4['model'];if(_0x15d083['query'][_0x93f8('0x3e')]){_0x27018c['include']=[{'all':!![]}];}_0x27018c=_[_0x93f8('0x3b')]({},_0x27018c,_0x15d083['options']);return db[_0x93f8('0x40')][_0x93f8('0x47')](_0x27018c)['then'](handleEntityNotFound(_0x479bad,null))[_0x93f8('0x25')](respondWithResult(_0x479bad,null))[_0x93f8('0x43')](handleError(_0x479bad,null));};exports[_0x93f8('0x48')]=function(_0x55fcb4,_0x16d57e){return db[_0x93f8('0x40')][_0x93f8('0x48')](_0x55fcb4[_0x93f8('0x49')],{})['then'](respondWithResult(_0x16d57e,0xc9))['catch'](handleError(_0x16d57e,null));};exports['update']=function(_0x38f083,_0x20bce7){if(_0x38f083['body']['id']){delete _0x38f083[_0x93f8('0x49')]['id'];}return db[_0x93f8('0x40')][_0x93f8('0x47')]({'where':{'id':_0x38f083[_0x93f8('0x44')]['id']}})[_0x93f8('0x25')](handleEntityNotFound(_0x20bce7,null))['then'](saveUpdates(_0x38f083[_0x93f8('0x49')],null))[_0x93f8('0x25')](respondWithResult(_0x20bce7,null))[_0x93f8('0x43')](handleError(_0x20bce7,null));};exports[_0x93f8('0x26')]=function(_0x60d059,_0x169f12){return db[_0x93f8('0x40')]['find']({'where':{'id':_0x60d059['params']['id']}})['then'](handleEntityNotFound(_0x169f12,null))[_0x93f8('0x25')](removeEntity(_0x169f12,null))[_0x93f8('0x43')](handleError(_0x169f12,null));};exports[_0x93f8('0x4a')]=function(_0x487c31,_0x5ef274){return db[_0x93f8('0x40')]['describe']()[_0x93f8('0x25')](respondWithResult(_0x5ef274,null))[_0x93f8('0x43')](handleError(_0x5ef274,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index d7cd5bb..a1b42d7 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 _0x5337=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash'];(function(_0x1cc294,_0x5d677d){var _0x9af5f=function(_0x55a876){while(--_0x55a876){_0x1cc294['push'](_0x1cc294['shift']());}};_0x9af5f(++_0x5d677d);}(_0x5337,0x133));var _0x7533=function(_0x483f0,_0x329df8){_0x483f0=_0x483f0-0x0;var _0x59a8eb=_0x5337[_0x483f0];return _0x59a8eb;};'use strict';var _=require(_0x7533('0x0'));var util=require(_0x7533('0x1'));var logger=require(_0x7533('0x2'))(_0x7533('0x3'));var moment=require(_0x7533('0x4'));var BPromise=require(_0x7533('0x5'));var rp=require(_0x7533('0x6'));var fs=require('fs');var path=require(_0x7533('0x7'));var rimraf=require(_0x7533('0x8'));var config=require(_0x7533('0x9'));var attributes=require(_0x7533('0xa'));module['exports']=function(_0x1895b3,_0x389fa1){return _0x1895b3[_0x7533('0xb')](_0x7533('0xc'),attributes,{'tableName':_0x7533('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc02f=['exports','report_integration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes'];(function(_0x1ee1cd,_0x588d14){var _0x4b433c=function(_0x1f8ffa){while(--_0x1f8ffa){_0x1ee1cd['push'](_0x1ee1cd['shift']());}};_0x4b433c(++_0x588d14);}(_0xc02f,0x18e));var _0xfc02=function(_0x41c1e8,_0x453db3){_0x41c1e8=_0x41c1e8-0x0;var _0x1f85e3=_0xc02f[_0x41c1e8];return _0x1f85e3;};'use strict';var _=require(_0xfc02('0x0'));var util=require(_0xfc02('0x1'));var logger=require(_0xfc02('0x2'))('api');var moment=require(_0xfc02('0x3'));var BPromise=require(_0xfc02('0x4'));var rp=require(_0xfc02('0x5'));var fs=require('fs');var path=require(_0xfc02('0x6'));var rimraf=require('rimraf');var config=require(_0xfc02('0x7'));var attributes=require(_0xfc02('0x8'));module[_0xfc02('0x9')]=function(_0x1d5a2a,_0xad411a){return _0x1d5a2a['define']('IntegrationReport',attributes,{'tableName':_0xfc02('0xa'),'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 3fc7eb1..e77c1a4 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0xd4ec0c,_0x2afcd2){var _0x580218=function(_0x3b1cd4){while(--_0x3b1cd4){_0xd4ec0c['push'](_0xd4ec0c['shift']());}};_0x580218(++_0x2afcd2);}(_0x524e,0x15e));var _0xe524=function(_0x10ff12,_0x2fbbad){_0x10ff12=_0x10ff12-0x0;var _0x201964=_0x524e[_0x10ff12];return _0x201964;};'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});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3d0de,_0x114bb5){var _0x2c5813=function(_0x40fe75){while(--_0x40fe75){_0x3d0de['push'](_0x3d0de['shift']());}};_0x2c5813(++_0x114bb5);}(_0x1261,0x144));var _0x1126=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x1261[_0x3f3bad];return _0x4f0801;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 0952921..afe3d2a 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 _0xe861=['Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','/:id','isAuthenticated','show','create','post','/:id/sub_intervals','addInterval','addIntervals','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4d64d0,_0x11d5bb){var _0x246aa2=function(_0x2df979){while(--_0x2df979){_0x4d64d0['push'](_0x4d64d0['shift']());}};_0x246aa2(++_0x11d5bb);}(_0xe861,0xb3));var _0x1e86=function(_0x27b672,_0x4ebc8b){_0x27b672=_0x27b672-0x0;var _0x582a8a=_0xe861[_0x27b672];return _0x582a8a;};'use strict';var multer=require(_0x1e86('0x0'));var util=require(_0x1e86('0x1'));var path=require(_0x1e86('0x2'));var timeout=require(_0x1e86('0x3'));var express=require(_0x1e86('0x4'));var router=express[_0x1e86('0x5')]();var fs_extra=require(_0x1e86('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1e86('0x7'));var config=require(_0x1e86('0x8'));var controller=require(_0x1e86('0x9'));router[_0x1e86('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e86('0xa')](_0x1e86('0xb'),auth[_0x1e86('0xc')](),controller[_0x1e86('0xd')]);router[_0x1e86('0xa')]('/:id/sub_intervals',auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth[_0x1e86('0xc')](),controller[_0x1e86('0xe')]);router[_0x1e86('0xf')](_0x1e86('0x10'),auth['isAuthenticated'](),controller[_0x1e86('0x11')]);router[_0x1e86('0xf')]('/:id/sub_intervals/create_many',auth[_0x1e86('0xc')](),controller[_0x1e86('0x12')]);router[_0x1e86('0x13')](_0x1e86('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1e86('0x14')]('/:id',auth[_0x1e86('0xc')](),controller[_0x1e86('0x15')]);module[_0x1e86('0x16')]=router; \ No newline at end of file +var _0xb5ec=['addIntervals','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','create','addInterval'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb5ec,0x97));var _0xcb5e=function(_0x37798d,_0x411d70){_0x37798d=_0x37798d-0x0;var _0x2f5aae=_0xb5ec[_0x37798d];return _0x2f5aae;};'use strict';var multer=require(_0xcb5e('0x0'));var util=require(_0xcb5e('0x1'));var path=require(_0xcb5e('0x2'));var timeout=require(_0xcb5e('0x3'));var express=require('express');var router=express[_0xcb5e('0x4')]();var fs_extra=require(_0xcb5e('0x5'));var auth=require(_0xcb5e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcb5e('0x7'));var controller=require('./interval.controller');router[_0xcb5e('0x8')]('/',auth[_0xcb5e('0x9')](),controller[_0xcb5e('0xa')]);router[_0xcb5e('0x8')](_0xcb5e('0xb'),auth[_0xcb5e('0x9')](),controller[_0xcb5e('0xc')]);router[_0xcb5e('0x8')](_0xcb5e('0xd'),auth[_0xcb5e('0x9')](),controller['getIntervals']);router[_0xcb5e('0xe')]('/',auth[_0xcb5e('0x9')](),controller[_0xcb5e('0xf')]);router[_0xcb5e('0xe')](_0xcb5e('0xd'),auth[_0xcb5e('0x9')](),controller[_0xcb5e('0x10')]);router[_0xcb5e('0xe')]('/:id/sub_intervals/create_many',auth[_0xcb5e('0x9')](),controller[_0xcb5e('0x11')]);router[_0xcb5e('0x12')](_0xcb5e('0xb'),auth[_0xcb5e('0x9')](),controller[_0xcb5e('0x13')]);router['delete'](_0xcb5e('0xb'),auth[_0xcb5e('0x9')](),controller['destroy']);module[_0xcb5e('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 873514d..3416633 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 _0x3ff4=['STRING','sequelize','exports'];(function(_0x2a4a61,_0x410a1c){var _0x3ad0ec=function(_0x1cbb26){while(--_0x1cbb26){_0x2a4a61['push'](_0x2a4a61['shift']());}};_0x3ad0ec(++_0x410a1c);}(_0x3ff4,0x88));var _0x43ff=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3ff4[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x43ff('0x0'));module[_0x43ff('0x1')]={'name':{'type':Sequelize[_0x43ff('0x2')]},'description':{'type':Sequelize[_0x43ff('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xb2d9=['sequelize','exports','STRING'];(function(_0x564f89,_0x4846c8){var _0x5053cd=function(_0x43dcd2){while(--_0x43dcd2){_0x564f89['push'](_0x564f89['shift']());}};_0x5053cd(++_0x4846c8);}(_0xb2d9,0x16e));var _0x9b2d=function(_0x154da7,_0x155e5d){_0x154da7=_0x154da7-0x0;var _0x3c9dbf=_0xb2d9[_0x154da7];return _0x3c9dbf;};'use strict';var Sequelize=require(_0x9b2d('0x0'));module[_0x9b2d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9b2d('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 890f94b..fe1b625 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 _0xb363=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','get','Intervals','error','stack','name','send','index','map','Interval','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','order','addIntervals','findOne','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5a2d89,_0x49f559){var _0x495f90=function(_0x15a1f5){while(--_0x15a1f5){_0x5a2d89['push'](_0x5a2d89['shift']());}};_0x495f90(++_0x49f559);}(_0xb363,0x1c0));var _0x3b36=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xb363[_0x166d93];return _0xba708;};'use strict';var emlformat=require(_0x3b36('0x0'));var rimraf=require(_0x3b36('0x1'));var zipdir=require(_0x3b36('0x2'));var jsonpatch=require(_0x3b36('0x3'));var rp=require(_0x3b36('0x4'));var moment=require(_0x3b36('0x5'));var BPromise=require(_0x3b36('0x6'));var Mustache=require(_0x3b36('0x7'));var util=require('util');var path=require(_0x3b36('0x8'));var sox=require('sox');var csv=require(_0x3b36('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b36('0xa'));var _=require(_0x3b36('0xb'));var squel=require('squel');var crypto=require(_0x3b36('0xc'));var jsforce=require(_0x3b36('0xd'));var deskjs=require(_0x3b36('0xe'));var toCsv=require(_0x3b36('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3b36('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b36('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b36('0x11'));var logger=require(_0x3b36('0x12'))(_0x3b36('0x13'));var utils=require(_0x3b36('0x14'));var config=require(_0x3b36('0x15'));var licenseUtil=require(_0x3b36('0x16'));var db=require(_0x3b36('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x8f4aa3,_0x119db2){_0x119db2=_0x119db2||0xcc;return function(_0x5d7b6e){if(_0x5d7b6e){return _0x8f4aa3[_0x3b36('0x18')](_0x119db2);}return _0x8f4aa3[_0x3b36('0x19')](_0x119db2)[_0x3b36('0x1a')]();};}function respondWithResult(_0x219069,_0x3a2d69){_0x3a2d69=_0x3a2d69||0xc8;return function(_0x19ffbf){if(_0x19ffbf){return _0x219069[_0x3b36('0x19')](_0x3a2d69)['json'](_0x19ffbf);}};}function respondWithFilteredResult(_0x3752b4,_0xa62063){return function(_0x51ddbb){if(_0x51ddbb){var _0x4fe603=typeof _0xa62063[_0x3b36('0x1b')]===_0x3b36('0x1c')&&typeof _0xa62063['limit']===_0x3b36('0x1c');var _0x4eb97f=_0x51ddbb[_0x3b36('0x1d')];var _0xdb438c=_0x4fe603?0x0:_0xa62063[_0x3b36('0x1b')];var _0x343894=_0x4fe603?_0x51ddbb[_0x3b36('0x1d')]:_0xa62063[_0x3b36('0x1b')]+_0xa62063['limit'];var _0x1de09b;if(_0x343894>=_0x4eb97f){_0x343894=_0x4eb97f;_0x1de09b=0xc8;}else{_0x1de09b=0xce;}_0x3752b4['status'](_0x1de09b);return _0x3752b4[_0x3b36('0x1e')](_0x3b36('0x1f'),_0xdb438c+'-'+_0x343894+'/'+_0x4eb97f)[_0x3b36('0x20')](_0x51ddbb);}return null;};}function patchUpdates(_0xe7343a){return function(_0xbe5000){try{jsonpatch['apply'](_0xbe5000,_0xe7343a,!![]);}catch(_0x42e6fb){return BPromise[_0x3b36('0x21')](_0x42e6fb);}return _0xbe5000[_0x3b36('0x22')]();};}function saveUpdates(_0x3d159b,_0x2f614c){return function(_0x35fbee){if(_0x35fbee){return _0x35fbee[_0x3b36('0x23')](_0x3d159b)[_0x3b36('0x24')](function(_0x1cd7b3){return _0x1cd7b3;});}return null;};}function removeEntity(_0x258780,_0x397c59){return function(_0x567017){if(_0x567017){return _0x567017[_0x3b36('0x25')]()[_0x3b36('0x24')](function(){var _0x2cd3d5=_0x567017[_0x3b36('0x26')]({'plain':!![]});var _0x381ec6=_0x3b36('0x27');return db['UserProfileResource'][_0x3b36('0x25')]({'where':{'type':_0x381ec6,'resourceId':_0x2cd3d5['id']}})[_0x3b36('0x24')](function(){return _0x567017;});})[_0x3b36('0x24')](function(){_0x258780[_0x3b36('0x19')](0xcc)[_0x3b36('0x1a')]();});}};}function handleEntityNotFound(_0x419c12,_0x5b1cfd){return function(_0x294995){if(!_0x294995){_0x419c12[_0x3b36('0x18')](0x194);}return _0x294995;};}function handleError(_0x5bb4ee,_0x1ff3b5){_0x1ff3b5=_0x1ff3b5||0x1f4;return function(_0x4059ed){logger[_0x3b36('0x28')](_0x4059ed[_0x3b36('0x29')]);if(_0x4059ed[_0x3b36('0x2a')]){delete _0x4059ed[_0x3b36('0x2a')];}_0x5bb4ee[_0x3b36('0x19')](_0x1ff3b5)[_0x3b36('0x2b')](_0x4059ed);};}exports[_0x3b36('0x2c')]=function(_0x35d000,_0x2dc5e1){var _0x5480d3={},_0x11b520={},_0x1606b7={'count':0x0,'rows':[]};var _0x23cf15=_[_0x3b36('0x2d')](db[_0x3b36('0x2e')]['rawAttributes'],function(_0x945a6d){return{'name':_0x945a6d[_0x3b36('0x2f')],'type':_0x945a6d[_0x3b36('0x30')][_0x3b36('0x31')]};});_0x11b520[_0x3b36('0x32')]=_[_0x3b36('0x2d')](_0x23cf15,_0x3b36('0x2a'));_0x11b520[_0x3b36('0x33')]=_[_0x3b36('0x34')](_0x35d000['query']);_0x11b520['filters']=_[_0x3b36('0x35')](_0x11b520[_0x3b36('0x32')],_0x11b520[_0x3b36('0x33')]);_0x5480d3[_0x3b36('0x36')]=_[_0x3b36('0x35')](_0x11b520[_0x3b36('0x32')],qs[_0x3b36('0x37')](_0x35d000[_0x3b36('0x33')]['fields']));_0x5480d3[_0x3b36('0x36')]=_0x5480d3['attributes']['length']?_0x5480d3[_0x3b36('0x36')]:_0x11b520[_0x3b36('0x32')];if(!_0x35d000[_0x3b36('0x33')][_0x3b36('0x38')](_0x3b36('0x39'))){_0x5480d3[_0x3b36('0x3a')]=qs[_0x3b36('0x3a')](_0x35d000['query'][_0x3b36('0x3a')]);_0x5480d3['offset']=qs['offset'](_0x35d000[_0x3b36('0x33')][_0x3b36('0x1b')]);}_0x5480d3['order']=qs['sort'](_0x35d000[_0x3b36('0x33')][_0x3b36('0x3b')]);_0x5480d3[_0x3b36('0x3c')]=qs[_0x3b36('0x3d')](_[_0x3b36('0x3e')](_0x35d000['query'],_0x11b520[_0x3b36('0x3d')]),_0x23cf15);if(_0x35d000[_0x3b36('0x33')][_0x3b36('0x3f')]){_0x5480d3[_0x3b36('0x3c')]=_[_0x3b36('0x40')](_0x5480d3[_0x3b36('0x3c')],{'$or':_['map'](_0x23cf15,function(_0xf0f172){if(_0xf0f172[_0x3b36('0x30')]!==_0x3b36('0x41')){var _0x2d35cd={};_0x2d35cd[_0xf0f172[_0x3b36('0x2a')]]={'$like':'%'+_0x35d000[_0x3b36('0x33')]['filter']+'%'};return _0x2d35cd;}})});}_0x5480d3=_['merge']({},_0x5480d3,_0x35d000[_0x3b36('0x42')]);var _0x1988ad={'where':_0x5480d3[_0x3b36('0x3c')]};return db['Interval']['count'](_0x1988ad)[_0x3b36('0x24')](function(_0x3c5949){_0x1606b7[_0x3b36('0x1d')]=_0x3c5949;if(_0x35d000['query'][_0x3b36('0x43')]){_0x5480d3['include']=[{'all':!![]}];}return db['Interval'][_0x3b36('0x44')](_0x5480d3);})[_0x3b36('0x24')](function(_0x22a119){_0x1606b7[_0x3b36('0x45')]=_0x22a119;return _0x1606b7;})[_0x3b36('0x24')](respondWithFilteredResult(_0x2dc5e1,_0x5480d3))[_0x3b36('0x46')](handleError(_0x2dc5e1,null));};exports[_0x3b36('0x47')]=function(_0x6366d6,_0x4f91f6){var _0xd4cf99={'raw':!![],'where':{'id':_0x6366d6[_0x3b36('0x48')]['id']}},_0x11bdc2={};_0x11bdc2[_0x3b36('0x32')]=_[_0x3b36('0x34')](db[_0x3b36('0x2e')][_0x3b36('0x49')]);_0x11bdc2[_0x3b36('0x33')]=_[_0x3b36('0x34')](_0x6366d6[_0x3b36('0x33')]);_0x11bdc2[_0x3b36('0x3d')]=_['intersection'](_0x11bdc2['model'],_0x11bdc2['query']);_0xd4cf99[_0x3b36('0x36')]=_[_0x3b36('0x35')](_0x11bdc2[_0x3b36('0x32')],qs[_0x3b36('0x37')](_0x6366d6[_0x3b36('0x33')][_0x3b36('0x37')]));_0xd4cf99['attributes']=_0xd4cf99[_0x3b36('0x36')][_0x3b36('0x4a')]?_0xd4cf99['attributes']:_0x11bdc2[_0x3b36('0x32')];if(_0x6366d6[_0x3b36('0x33')][_0x3b36('0x43')]){_0xd4cf99[_0x3b36('0x4b')]=[{'all':!![]}];}_0xd4cf99=_['merge']({},_0xd4cf99,_0x6366d6[_0x3b36('0x42')]);return db[_0x3b36('0x2e')]['find'](_0xd4cf99)['then'](handleEntityNotFound(_0x4f91f6,null))['then'](respondWithResult(_0x4f91f6,null))['catch'](handleError(_0x4f91f6,null));};exports[_0x3b36('0x4c')]=function(_0xcb5bf0,_0x56ea10){return db[_0x3b36('0x2e')][_0x3b36('0x4c')](_0xcb5bf0[_0x3b36('0x4d')],{})['then'](function(_0x152564){var _0x1f1273=_0xcb5bf0['user']['get']({'plain':!![]});if(!_0x1f1273)throw new Error(_0x3b36('0x4e'));if(_0x1f1273['role']===_0x3b36('0x4f')){var _0x997bef=_0x152564[_0x3b36('0x26')]({'plain':!![]});var _0x72cad9='Intervals';return db['UserProfileSection'][_0x3b36('0x50')]({'where':{'name':_0x72cad9,'userProfileId':_0x1f1273[_0x3b36('0x51')]},'raw':!![]})[_0x3b36('0x24')](function(_0x9a30bd){if(_0x9a30bd&&_0x9a30bd[_0x3b36('0x52')]===0x0){return db[_0x3b36('0x53')][_0x3b36('0x4c')]({'name':_0x997bef[_0x3b36('0x2a')],'resourceId':_0x997bef['id'],'type':_0x9a30bd[_0x3b36('0x2a')],'sectionId':_0x9a30bd['id']},{})[_0x3b36('0x24')](function(){return _0x152564;});}else{return _0x152564;}})['catch'](function(_0x1566ac){logger[_0x3b36('0x28')](_0x3b36('0x54'),_0x1566ac);throw _0x1566ac;});}return _0x152564;})[_0x3b36('0x24')](respondWithResult(_0x56ea10,0xc9))[_0x3b36('0x46')](handleError(_0x56ea10,null));};exports['update']=function(_0x3df9eb,_0x2e5fcc){if(_0x3df9eb[_0x3b36('0x4d')]['id']){delete _0x3df9eb['body']['id'];}return db['Interval'][_0x3b36('0x50')]({'where':{'id':_0x3df9eb[_0x3b36('0x48')]['id']}})[_0x3b36('0x24')](handleEntityNotFound(_0x2e5fcc,null))[_0x3b36('0x24')](saveUpdates(_0x3df9eb[_0x3b36('0x4d')],null))[_0x3b36('0x24')](respondWithResult(_0x2e5fcc,null))['catch'](handleError(_0x2e5fcc,null));};exports[_0x3b36('0x25')]=function(_0x4d8fb2,_0x7dd5f5){return db[_0x3b36('0x2e')][_0x3b36('0x50')]({'where':{'id':_0x4d8fb2[_0x3b36('0x48')]['id']}})[_0x3b36('0x24')](handleEntityNotFound(_0x7dd5f5,null))['then'](removeEntity(_0x7dd5f5,null))[_0x3b36('0x46')](handleError(_0x7dd5f5,null));};exports[_0x3b36('0x55')]=function(_0x2f0d32,_0x45ce81,_0x16b242){if(_0x2f0d32[_0x3b36('0x4d')]['id']){delete _0x2f0d32[_0x3b36('0x4d')]['id'];}return db[_0x3b36('0x2e')]['find']({'where':{'id':_0x2f0d32[_0x3b36('0x48')]['id']}})[_0x3b36('0x24')](handleEntityNotFound(_0x45ce81,null))[_0x3b36('0x24')](function(_0xef2300){if(_0xef2300){_0x2f0d32[_0x3b36('0x4d')]['IntervalId']=_0xef2300['id'];return db[_0x3b36('0x2e')][_0x3b36('0x4c')](_0x2f0d32[_0x3b36('0x4d')]);}})[_0x3b36('0x24')](respondWithResult(_0x45ce81,null))['catch'](handleError(_0x45ce81,null));};exports[_0x3b36('0x56')]=function(_0x10c4ca,_0x21fc68,_0x1cb170){var _0x35f2dd={};var _0x501064={};var _0x1f71e7;var _0x5b6c26;return db[_0x3b36('0x2e')]['findOne']({'where':{'id':_0x10c4ca['params']['id']}})[_0x3b36('0x24')](handleEntityNotFound(_0x21fc68,null))[_0x3b36('0x24')](function(_0x4c7840){if(_0x4c7840){_0x1f71e7=_0x4c7840;_0x501064[_0x3b36('0x32')]=_[_0x3b36('0x34')](db[_0x3b36('0x2e')][_0x3b36('0x49')]);_0x501064['query']=_[_0x3b36('0x34')](_0x10c4ca[_0x3b36('0x33')]);_0x501064[_0x3b36('0x3d')]=_[_0x3b36('0x35')](_0x501064[_0x3b36('0x32')],_0x501064[_0x3b36('0x33')]);_0x35f2dd[_0x3b36('0x36')]=_[_0x3b36('0x35')](_0x501064['model'],qs[_0x3b36('0x37')](_0x10c4ca[_0x3b36('0x33')][_0x3b36('0x37')]));_0x35f2dd[_0x3b36('0x36')]=_0x35f2dd[_0x3b36('0x36')]['length']?_0x35f2dd[_0x3b36('0x36')]:_0x501064['model'];_0x35f2dd[_0x3b36('0x57')]=qs[_0x3b36('0x3b')](_0x10c4ca[_0x3b36('0x33')]['sort']);_0x35f2dd['where']=qs[_0x3b36('0x3d')](_['pick'](_0x10c4ca[_0x3b36('0x33')],_0x501064[_0x3b36('0x3d')]));if(_0x10c4ca[_0x3b36('0x33')][_0x3b36('0x3f')]){_0x35f2dd[_0x3b36('0x3c')]=_[_0x3b36('0x40')](_0x35f2dd[_0x3b36('0x3c')],{'$or':_[_0x3b36('0x2d')](_0x35f2dd[_0x3b36('0x36')],function(_0x4c8d4f){var _0x2efbde={};_0x2efbde[_0x4c8d4f]={'$like':'%'+_0x10c4ca['query'][_0x3b36('0x3f')]+'%'};return _0x2efbde;})});}_0x35f2dd=_[_0x3b36('0x40')]({},_0x35f2dd,_0x10c4ca['options']);return _0x1f71e7[_0x3b36('0x56')](_0x35f2dd);}})[_0x3b36('0x24')](function(_0x26f136){if(_0x26f136){_0x5b6c26=_0x26f136['length'];if(!_0x10c4ca[_0x3b36('0x33')]['hasOwnProperty'](_0x3b36('0x39'))){_0x35f2dd[_0x3b36('0x3a')]=qs[_0x3b36('0x3a')](_0x10c4ca['query'][_0x3b36('0x3a')]);_0x35f2dd['offset']=qs[_0x3b36('0x1b')](_0x10c4ca[_0x3b36('0x33')][_0x3b36('0x1b')]);}return _0x1f71e7['getIntervals'](_0x35f2dd);}})[_0x3b36('0x24')](function(_0x827f16){if(_0x827f16){return _0x827f16?{'count':_0x5b6c26,'rows':_0x827f16}:null;}})[_0x3b36('0x24')](respondWithResult(_0x21fc68,null))['catch'](handleError(_0x21fc68,null));};exports[_0x3b36('0x58')]=function(_0x180409,_0x430f12,_0x512971){return db[_0x3b36('0x2e')][_0x3b36('0x59')]({'where':{'id':_0x180409['params']['id']}})['then'](handleEntityNotFound(_0x430f12,null))[_0x3b36('0x24')](function(_0x4a870a){if(_0x4a870a){return db[_0x3b36('0x5a')][_0x3b36('0x5b')](function(_0x5045aa){return db[_0x3b36('0x2e')][_0x3b36('0x25')]({'where':{'IntervalId':_0x180409[_0x3b36('0x48')]['id']},'transaction':_0x5045aa})['then'](function(_0x44b848){var _0x3113a2=_[_0x3b36('0x2d')](_0x180409[_0x3b36('0x4d')],function(_0x4df88a){delete _0x4df88a['id'];_0x4df88a[_0x3b36('0x5c')]=_0x180409[_0x3b36('0x48')]['id'];return _0x4df88a;});return db[_0x3b36('0x2e')][_0x3b36('0x5d')](_0x3113a2,{'transaction':_0x5045aa});});})['then'](function(){return db[_0x3b36('0x2e')][_0x3b36('0x44')]({'where':{'IntervalId':_0x180409[_0x3b36('0x48')]['id']}});});}})['then'](respondWithResult(_0x430f12,null))['catch'](handleError(_0x430f12,null));}; \ No newline at end of file +var _0xe603=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','name','index','map','Interval','fieldName','type','key','model','query','keys'];(function(_0x28f0b9,_0x3c3242){var _0x5d7796=function(_0x73cb41){while(--_0x73cb41){_0x28f0b9['push'](_0x28f0b9['shift']());}};_0x5d7796(++_0x3c3242);}(_0xe603,0x19e));var _0x3e60=function(_0x1871e0,_0x31e930){_0x1871e0=_0x1871e0-0x0;var _0x3d1795=_0xe603[_0x1871e0];return _0x3d1795;};'use strict';var emlformat=require(_0x3e60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e60('0x1'));var jsonpatch=require(_0x3e60('0x2'));var rp=require('request-promise');var moment=require(_0x3e60('0x3'));var BPromise=require(_0x3e60('0x4'));var Mustache=require(_0x3e60('0x5'));var util=require(_0x3e60('0x6'));var path=require(_0x3e60('0x7'));var sox=require(_0x3e60('0x8'));var csv=require(_0x3e60('0x9'));var ejs=require(_0x3e60('0xa'));var fs=require('fs');var fs_extra=require(_0x3e60('0xb'));var _=require(_0x3e60('0xc'));var squel=require(_0x3e60('0xd'));var crypto=require(_0x3e60('0xe'));var jsforce=require(_0x3e60('0xf'));var deskjs=require(_0x3e60('0x10'));var toCsv=require(_0x3e60('0x9'));var querystring=require(_0x3e60('0x11'));var Papa=require('papaparse');var Redis=require(_0x3e60('0x12'));var authService=require(_0x3e60('0x13'));var qs=require(_0x3e60('0x14'));var as=require(_0x3e60('0x15'));var hardwareService=require(_0x3e60('0x16'));var logger=require(_0x3e60('0x17'))(_0x3e60('0x18'));var utils=require('../../config/utils');var config=require(_0x3e60('0x19'));var licenseUtil=require(_0x3e60('0x1a'));var db=require('../../mysqldb')['db'];var extensions=require(_0x3e60('0x1b'));function respondWithStatusCode(_0x8904de,_0x41afeb){_0x41afeb=_0x41afeb||0xcc;return function(_0x4ad680){if(_0x4ad680){return _0x8904de[_0x3e60('0x1c')](_0x41afeb);}return _0x8904de[_0x3e60('0x1d')](_0x41afeb)[_0x3e60('0x1e')]();};}function respondWithResult(_0x578672,_0x332efd){_0x332efd=_0x332efd||0xc8;return function(_0x3f56b3){if(_0x3f56b3){return _0x578672[_0x3e60('0x1d')](_0x332efd)[_0x3e60('0x1f')](_0x3f56b3);}};}function respondWithFilteredResult(_0x21cf26,_0x133bd5){return function(_0x59a34d){if(_0x59a34d){var _0x4fb279=typeof _0x133bd5[_0x3e60('0x20')]===_0x3e60('0x21')&&typeof _0x133bd5[_0x3e60('0x22')]===_0x3e60('0x21');var _0x30dd55=_0x59a34d['count'];var _0xdc6840=_0x4fb279?0x0:_0x133bd5[_0x3e60('0x20')];var _0x302814=_0x4fb279?_0x59a34d[_0x3e60('0x23')]:_0x133bd5['offset']+_0x133bd5[_0x3e60('0x22')];var _0x4f763e;if(_0x302814>=_0x30dd55){_0x302814=_0x30dd55;_0x4f763e=0xc8;}else{_0x4f763e=0xce;}_0x21cf26[_0x3e60('0x1d')](_0x4f763e);return _0x21cf26['set'](_0x3e60('0x24'),_0xdc6840+'-'+_0x302814+'/'+_0x30dd55)[_0x3e60('0x1f')](_0x59a34d);}return null;};}function patchUpdates(_0x506c12){return function(_0x2a9c46){try{jsonpatch[_0x3e60('0x25')](_0x2a9c46,_0x506c12,!![]);}catch(_0x210f50){return BPromise[_0x3e60('0x26')](_0x210f50);}return _0x2a9c46[_0x3e60('0x27')]();};}function saveUpdates(_0x1903ea,_0x214c6d){return function(_0x1f5371){if(_0x1f5371){return _0x1f5371[_0x3e60('0x28')](_0x1903ea)[_0x3e60('0x29')](function(_0x1c34a0){return _0x1c34a0;});}return null;};}function removeEntity(_0x43aa37,_0x29014e){return function(_0x574eff){if(_0x574eff){return _0x574eff[_0x3e60('0x2a')]()[_0x3e60('0x29')](function(){var _0x2a2d25=_0x574eff[_0x3e60('0x2b')]({'plain':!![]});var _0xb734b1=_0x3e60('0x2c');return db[_0x3e60('0x2d')][_0x3e60('0x2a')]({'where':{'type':_0xb734b1,'resourceId':_0x2a2d25['id']}})['then'](function(){return _0x574eff;});})[_0x3e60('0x29')](function(){_0x43aa37[_0x3e60('0x1d')](0xcc)[_0x3e60('0x1e')]();});}};}function handleEntityNotFound(_0x4cc67a,_0x16eb2c){return function(_0x2b5e09){if(!_0x2b5e09){_0x4cc67a[_0x3e60('0x1c')](0x194);}return _0x2b5e09;};}function handleError(_0x1044fe,_0x343cac){_0x343cac=_0x343cac||0x1f4;return function(_0x53acd5){logger['error'](_0x53acd5['stack']);if(_0x53acd5[_0x3e60('0x2e')]){delete _0x53acd5[_0x3e60('0x2e')];}_0x1044fe[_0x3e60('0x1d')](_0x343cac)['send'](_0x53acd5);};}exports[_0x3e60('0x2f')]=function(_0x48b8b3,_0x30e8bf){var _0x3b3686={},_0x1c92d4={},_0x46d817={'count':0x0,'rows':[]};var _0x2c4eda=_[_0x3e60('0x30')](db[_0x3e60('0x31')]['rawAttributes'],function(_0x431691){return{'name':_0x431691[_0x3e60('0x32')],'type':_0x431691[_0x3e60('0x33')][_0x3e60('0x34')]};});_0x1c92d4[_0x3e60('0x35')]=_[_0x3e60('0x30')](_0x2c4eda,'name');_0x1c92d4[_0x3e60('0x36')]=_[_0x3e60('0x37')](_0x48b8b3[_0x3e60('0x36')]);_0x1c92d4['filters']=_['intersection'](_0x1c92d4['model'],_0x1c92d4['query']);_0x3b3686[_0x3e60('0x38')]=_['intersection'](_0x1c92d4[_0x3e60('0x35')],qs[_0x3e60('0x39')](_0x48b8b3['query']['fields']));_0x3b3686[_0x3e60('0x38')]=_0x3b3686['attributes'][_0x3e60('0x3a')]?_0x3b3686[_0x3e60('0x38')]:_0x1c92d4[_0x3e60('0x35')];if(!_0x48b8b3['query'][_0x3e60('0x3b')](_0x3e60('0x3c'))){_0x3b3686[_0x3e60('0x22')]=qs[_0x3e60('0x22')](_0x48b8b3['query'][_0x3e60('0x22')]);_0x3b3686['offset']=qs[_0x3e60('0x20')](_0x48b8b3[_0x3e60('0x36')][_0x3e60('0x20')]);}_0x3b3686['order']=qs[_0x3e60('0x3d')](_0x48b8b3[_0x3e60('0x36')]['sort']);_0x3b3686[_0x3e60('0x3e')]=qs[_0x3e60('0x3f')](_[_0x3e60('0x40')](_0x48b8b3['query'],_0x1c92d4['filters']),_0x2c4eda);if(_0x48b8b3[_0x3e60('0x36')][_0x3e60('0x41')]){_0x3b3686[_0x3e60('0x3e')]=_['merge'](_0x3b3686[_0x3e60('0x3e')],{'$or':_[_0x3e60('0x30')](_0x2c4eda,function(_0xc27439){if(_0xc27439[_0x3e60('0x33')]!==_0x3e60('0x42')){var _0x17f44d={};_0x17f44d[_0xc27439[_0x3e60('0x2e')]]={'$like':'%'+_0x48b8b3[_0x3e60('0x36')][_0x3e60('0x41')]+'%'};return _0x17f44d;}})});}_0x3b3686=_[_0x3e60('0x43')]({},_0x3b3686,_0x48b8b3['options']);var _0x2371aa={'where':_0x3b3686[_0x3e60('0x3e')]};return db[_0x3e60('0x31')][_0x3e60('0x23')](_0x2371aa)['then'](function(_0x2c25db){_0x46d817[_0x3e60('0x23')]=_0x2c25db;if(_0x48b8b3[_0x3e60('0x36')][_0x3e60('0x44')]){_0x3b3686[_0x3e60('0x45')]=[{'all':!![]}];}return db[_0x3e60('0x31')][_0x3e60('0x46')](_0x3b3686);})['then'](function(_0x3ab2cb){_0x46d817['rows']=_0x3ab2cb;return _0x46d817;})[_0x3e60('0x29')](respondWithFilteredResult(_0x30e8bf,_0x3b3686))[_0x3e60('0x47')](handleError(_0x30e8bf,null));};exports[_0x3e60('0x48')]=function(_0x4f6412,_0xf7a936){var _0x42530d={'raw':!![],'where':{'id':_0x4f6412[_0x3e60('0x49')]['id']}},_0x3b20f6={};_0x3b20f6[_0x3e60('0x35')]=_[_0x3e60('0x37')](db[_0x3e60('0x31')][_0x3e60('0x4a')]);_0x3b20f6[_0x3e60('0x36')]=_[_0x3e60('0x37')](_0x4f6412[_0x3e60('0x36')]);_0x3b20f6[_0x3e60('0x3f')]=_['intersection'](_0x3b20f6[_0x3e60('0x35')],_0x3b20f6[_0x3e60('0x36')]);_0x42530d['attributes']=_[_0x3e60('0x4b')](_0x3b20f6[_0x3e60('0x35')],qs[_0x3e60('0x39')](_0x4f6412[_0x3e60('0x36')]['fields']));_0x42530d[_0x3e60('0x38')]=_0x42530d['attributes']['length']?_0x42530d[_0x3e60('0x38')]:_0x3b20f6[_0x3e60('0x35')];if(_0x4f6412[_0x3e60('0x36')]['includeAll']){_0x42530d[_0x3e60('0x45')]=[{'all':!![]}];}_0x42530d=_['merge']({},_0x42530d,_0x4f6412[_0x3e60('0x4c')]);return db['Interval'][_0x3e60('0x4d')](_0x42530d)[_0x3e60('0x29')](handleEntityNotFound(_0xf7a936,null))[_0x3e60('0x29')](respondWithResult(_0xf7a936,null))['catch'](handleError(_0xf7a936,null));};exports[_0x3e60('0x4e')]=function(_0x132de7,_0x3507bb){return db[_0x3e60('0x31')][_0x3e60('0x4e')](_0x132de7[_0x3e60('0x4f')],{})['then'](function(_0x41ee3c){var _0x306e29=_0x132de7['user'][_0x3e60('0x2b')]({'plain':!![]});if(!_0x306e29)throw new Error(_0x3e60('0x50'));if(_0x306e29[_0x3e60('0x51')]==='user'){var _0x1d131a=_0x41ee3c['get']({'plain':!![]});var _0x3771d4=_0x3e60('0x2c');return db['UserProfileSection'][_0x3e60('0x4d')]({'where':{'name':_0x3771d4,'userProfileId':_0x306e29[_0x3e60('0x52')]},'raw':!![]})[_0x3e60('0x29')](function(_0x3df2e5){if(_0x3df2e5&&_0x3df2e5['autoAssociation']===0x0){return db[_0x3e60('0x2d')][_0x3e60('0x4e')]({'name':_0x1d131a[_0x3e60('0x2e')],'resourceId':_0x1d131a['id'],'type':_0x3df2e5[_0x3e60('0x2e')],'sectionId':_0x3df2e5['id']},{})['then'](function(){return _0x41ee3c;});}else{return _0x41ee3c;}})[_0x3e60('0x47')](function(_0x528f74){logger[_0x3e60('0x53')](_0x3e60('0x54'),_0x528f74);throw _0x528f74;});}return _0x41ee3c;})[_0x3e60('0x29')](respondWithResult(_0x3507bb,0xc9))[_0x3e60('0x47')](handleError(_0x3507bb,null));};exports[_0x3e60('0x28')]=function(_0xb19a99,_0x3b84b6){if(_0xb19a99[_0x3e60('0x4f')]['id']){delete _0xb19a99[_0x3e60('0x4f')]['id'];}return db[_0x3e60('0x31')][_0x3e60('0x4d')]({'where':{'id':_0xb19a99[_0x3e60('0x49')]['id']}})[_0x3e60('0x29')](handleEntityNotFound(_0x3b84b6,null))[_0x3e60('0x29')](saveUpdates(_0xb19a99[_0x3e60('0x4f')],null))[_0x3e60('0x29')](respondWithResult(_0x3b84b6,null))[_0x3e60('0x47')](handleError(_0x3b84b6,null));};exports[_0x3e60('0x2a')]=function(_0x41f624,_0x241836){return db[_0x3e60('0x31')][_0x3e60('0x4d')]({'where':{'id':_0x41f624[_0x3e60('0x49')]['id']}})['then'](handleEntityNotFound(_0x241836,null))['then'](removeEntity(_0x241836,null))[_0x3e60('0x47')](handleError(_0x241836,null));};exports[_0x3e60('0x55')]=function(_0x121266,_0x38aa22,_0x536d7d){if(_0x121266[_0x3e60('0x4f')]['id']){delete _0x121266[_0x3e60('0x4f')]['id'];}return db[_0x3e60('0x31')][_0x3e60('0x4d')]({'where':{'id':_0x121266[_0x3e60('0x49')]['id']}})[_0x3e60('0x29')](handleEntityNotFound(_0x38aa22,null))[_0x3e60('0x29')](function(_0x34f97a){if(_0x34f97a){_0x121266[_0x3e60('0x4f')][_0x3e60('0x56')]=_0x34f97a['id'];return db[_0x3e60('0x31')][_0x3e60('0x4e')](_0x121266[_0x3e60('0x4f')]);}})[_0x3e60('0x29')](respondWithResult(_0x38aa22,null))[_0x3e60('0x47')](handleError(_0x38aa22,null));};exports[_0x3e60('0x57')]=function(_0x5cddb8,_0x245d88,_0x37d3f0){var _0x23f00d={};var _0x4da339={};var _0x14da8d;var _0x2a5dd8;return db['Interval'][_0x3e60('0x58')]({'where':{'id':_0x5cddb8[_0x3e60('0x49')]['id']}})[_0x3e60('0x29')](handleEntityNotFound(_0x245d88,null))[_0x3e60('0x29')](function(_0x2da8e0){if(_0x2da8e0){_0x14da8d=_0x2da8e0;_0x4da339[_0x3e60('0x35')]=_[_0x3e60('0x37')](db[_0x3e60('0x31')][_0x3e60('0x4a')]);_0x4da339[_0x3e60('0x36')]=_[_0x3e60('0x37')](_0x5cddb8[_0x3e60('0x36')]);_0x4da339[_0x3e60('0x3f')]=_[_0x3e60('0x4b')](_0x4da339['model'],_0x4da339[_0x3e60('0x36')]);_0x23f00d[_0x3e60('0x38')]=_['intersection'](_0x4da339[_0x3e60('0x35')],qs[_0x3e60('0x39')](_0x5cddb8['query'][_0x3e60('0x39')]));_0x23f00d[_0x3e60('0x38')]=_0x23f00d[_0x3e60('0x38')][_0x3e60('0x3a')]?_0x23f00d[_0x3e60('0x38')]:_0x4da339[_0x3e60('0x35')];_0x23f00d[_0x3e60('0x59')]=qs[_0x3e60('0x3d')](_0x5cddb8[_0x3e60('0x36')][_0x3e60('0x3d')]);_0x23f00d[_0x3e60('0x3e')]=qs[_0x3e60('0x3f')](_[_0x3e60('0x40')](_0x5cddb8['query'],_0x4da339[_0x3e60('0x3f')]));if(_0x5cddb8[_0x3e60('0x36')]['filter']){_0x23f00d['where']=_[_0x3e60('0x43')](_0x23f00d[_0x3e60('0x3e')],{'$or':_[_0x3e60('0x30')](_0x23f00d[_0x3e60('0x38')],function(_0x2cd1c8){var _0x37018c={};_0x37018c[_0x2cd1c8]={'$like':'%'+_0x5cddb8[_0x3e60('0x36')][_0x3e60('0x41')]+'%'};return _0x37018c;})});}_0x23f00d=_[_0x3e60('0x43')]({},_0x23f00d,_0x5cddb8[_0x3e60('0x4c')]);return _0x14da8d['getIntervals'](_0x23f00d);}})[_0x3e60('0x29')](function(_0x2d92a9){if(_0x2d92a9){_0x2a5dd8=_0x2d92a9['length'];if(!_0x5cddb8[_0x3e60('0x36')][_0x3e60('0x3b')](_0x3e60('0x3c'))){_0x23f00d['limit']=qs[_0x3e60('0x22')](_0x5cddb8[_0x3e60('0x36')][_0x3e60('0x22')]);_0x23f00d[_0x3e60('0x20')]=qs[_0x3e60('0x20')](_0x5cddb8[_0x3e60('0x36')][_0x3e60('0x20')]);}return _0x14da8d[_0x3e60('0x57')](_0x23f00d);}})[_0x3e60('0x29')](function(_0x9f4b82){if(_0x9f4b82){return _0x9f4b82?{'count':_0x2a5dd8,'rows':_0x9f4b82}:null;}})[_0x3e60('0x29')](respondWithResult(_0x245d88,null))[_0x3e60('0x47')](handleError(_0x245d88,null));};exports[_0x3e60('0x5a')]=function(_0x4fdca2,_0x2e68b1,_0x597356){return db[_0x3e60('0x31')][_0x3e60('0x58')]({'where':{'id':_0x4fdca2[_0x3e60('0x49')]['id']}})[_0x3e60('0x29')](handleEntityNotFound(_0x2e68b1,null))[_0x3e60('0x29')](function(_0x28dd22){if(_0x28dd22){return db[_0x3e60('0x5b')][_0x3e60('0x5c')](function(_0x30ccc4){return db[_0x3e60('0x31')][_0x3e60('0x2a')]({'where':{'IntervalId':_0x4fdca2[_0x3e60('0x49')]['id']},'transaction':_0x30ccc4})[_0x3e60('0x29')](function(_0x56f29d){var _0x87e2a5=_[_0x3e60('0x30')](_0x4fdca2[_0x3e60('0x4f')],function(_0x32171f){delete _0x32171f['id'];_0x32171f[_0x3e60('0x56')]=_0x4fdca2['params']['id'];return _0x32171f;});return db[_0x3e60('0x31')][_0x3e60('0x5d')](_0x87e2a5,{'transaction':_0x30ccc4});});})[_0x3e60('0x29')](function(){return db[_0x3e60('0x31')][_0x3e60('0x46')]({'where':{'IntervalId':_0x4fdca2[_0x3e60('0x49')]['id']}});});}})[_0x3e60('0x29')](respondWithResult(_0x2e68b1,null))[_0x3e60('0x47')](handleError(_0x2e68b1,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index b1399ef..16ddf8f 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 _0x6e43=['lodash','util','moment','bluebird','request-promise','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','rewrite'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0x6e43,0x172));var _0x36e4=function(_0x5ab3b8,_0x149832){_0x5ab3b8=_0x5ab3b8-0x0;var _0x6e8714=_0x6e43[_0x5ab3b8];return _0x6e8714;};'use strict';var _=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x36e4('0x2'));var BPromise=require(_0x36e4('0x3'));var rp=require(_0x36e4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36e4('0x5'));var attributes=require(_0x36e4('0x6'));var extensions=require(_0x36e4('0x7'));module['exports']=function(_0x4ec588,_0x8393c5){return _0x4ec588[_0x36e4('0x8')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xbbc46b,_0x2eaf6d){extensions[_0x36e4('0x9')](_0x4ec588,_0xbbc46b);},'afterBulkCreate':function(_0x256803,_0x1bc998,_0x2cf7fd){_0x2cf7fd();extensions['rewrite'](_0x4ec588,_0x256803[0x0]);},'afterUpdate':function(_0x42ea72,_0x4c398a){extensions['rewrite'](_0x4ec588,_0x42ea72);},'afterDestroy':function(_0x1d2e6b,_0x9a0a86){extensions['rewrite'](_0x4ec588,_0x1d2e6b);}}});}; \ No newline at end of file +var _0xc401=['path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','api','moment','bluebird'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xc401,0x1ea));var _0x1c40=function(_0x312e3b,_0x3afd66){_0x312e3b=_0x312e3b-0x0;var _0x28a470=_0xc401[_0x312e3b];return _0x28a470;};'use strict';var _=require(_0x1c40('0x0'));var util=require(_0x1c40('0x1'));var logger=require('../../config/logger')(_0x1c40('0x2'));var moment=require(_0x1c40('0x3'));var BPromise=require(_0x1c40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c40('0x5'));var rimraf=require(_0x1c40('0x6'));var config=require(_0x1c40('0x7'));var attributes=require(_0x1c40('0x8'));var extensions=require(_0x1c40('0x9'));module[_0x1c40('0xa')]=function(_0x1c0267,_0x5eaff7){return _0x1c0267[_0x1c40('0xb')](_0x1c40('0xc'),attributes,{'tableName':_0x1c40('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x536040,_0x34cf6c){extensions[_0x1c40('0xe')](_0x1c0267,_0x536040);},'afterBulkCreate':function(_0x35de7f,_0x2b7dac,_0x54adb2){_0x54adb2();extensions[_0x1c40('0xe')](_0x1c0267,_0x35de7f[0x0]);},'afterUpdate':function(_0xb770bb,_0x1b63f3){extensions[_0x1c40('0xe')](_0x1c0267,_0xb770bb);},'afterDestroy':function(_0x1c76cb,_0xc732b5){extensions[_0x1c40('0xe')](_0x1c0267,_0x1c76cb);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index fd6d088..4f31408 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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['GetInterval']=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')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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['GetInterval']=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')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 7283357..0af17c6 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x5650b4,_0x2723ba){var _0x297a62=function(_0x4ceedf){while(--_0x4ceedf){_0x5650b4['push'](_0x5650b4['shift']());}};_0x297a62(++_0x2723ba);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1b40e9,_0x3fc3a5){_0x1b40e9=_0x1b40e9-0x0;var _0x445d47=_0x5f2f[_0x1b40e9];return _0x445d47;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f597fd7..c704aaf 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 _0x2625=['api','support','3eAmWpBVP0','MOTGUI','summary','Report','description','Bug','fields','email','customfield_11501','oldToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','utf8','end','statusCode','json','parse','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body','headers','socket','remoteAddress','connection','bluebird','https','../../config/logger'];(function(_0x38894d,_0x1883d8){var _0x5614fe=function(_0x181989){while(--_0x181989){_0x38894d['push'](_0x38894d['shift']());}};_0x5614fe(++_0x1883d8);}(_0x2625,0x99));var _0x5262=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x2625[_0x4d8ed9];return _0x1e2140;};'use strict';var BPromise=require(_0x5262('0x0'));var https=require(_0x5262('0x1'));var logger=require(_0x5262('0x2'))(_0x5262('0x3'));var USERNAME=_0x5262('0x4');var PASSWORD=_0x5262('0x5');function openIssue(_0x4fc981,_0xb25823){var _0x18c97d={'fields':{'project':{'key':_0x4fc981['key']||_0x5262('0x6')},'summary':(_0x4fc981[_0x5262('0x7')]||_0x5262('0x8'))+'\x20from\x20'+_0x4fc981['ip'],'description':_0x4fc981[_0x5262('0x9')]||JSON['stringify'](_0x4fc981),'issuetype':{'name':_0x4fc981['issuetype']||_0x5262('0xa')}}};_0x18c97d[_0x5262('0xb')]['customfield_11500']=_0x4fc981[_0x5262('0xc')];_0x18c97d[_0x5262('0xb')][_0x5262('0xd')]=_0x4fc981[_0x5262('0xe')];_0x18c97d[_0x5262('0xb')]['customfield_11502']=_0x4fc981['newToken'];_0x18c97d['fields'][_0x5262('0xf')]=_0x4fc981[_0x5262('0x10')];_0x18c97d[_0x5262('0xb')][_0x5262('0x11')]=_0x4fc981[_0x5262('0x12')];_0x18c97d[_0x5262('0xb')]['customfield_10102']=_0x4fc981['ip'];var _0xe0205b={'host':_0x5262('0x13'),'port':0x1bb,'path':_0x5262('0x14'),'method':_0x5262('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x5262('0x16'),'Authorization':_0x5262('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x5262('0x18'))}};var _0x25adf9=JSON['stringify'](_0x18c97d);var _0x35e486=https['request'](_0xe0205b,function(_0x3b5096){_0x3b5096['setEncoding'](_0x5262('0x19'));var _0x6e610d='';_0x3b5096['on']('data',function(_0x364b50){_0x6e610d+=_0x364b50;});_0x3b5096['on'](_0x5262('0x1a'),function(){if(_0xb25823){return _0xb25823['status'](_0x3b5096[_0x5262('0x1b')])[_0x5262('0x1c')](JSON[_0x5262('0x1d')](_0x6e610d));}});});_0x35e486['on']('error',function(_0x3e58db){if(_0xb25823){return _0xb25823[_0x5262('0x1e')](0x1f4)['json']({'errors':[{'message':_0x5262('0x1f'),'type':'api.jira'}]});}});_0x35e486['write'](_0x25adf9);_0x35e486[_0x5262('0x1a')]();}exports[_0x5262('0x20')]=openIssue;exports[_0x5262('0x21')]=function(_0x100826,_0x33f219){_0x100826[_0x5262('0x22')]['ip']=_0x100826[_0x5262('0x23')]['x-forwarded-for']||_0x100826['connection']['remoteAddress']||_0x100826[_0x5262('0x24')][_0x5262('0x25')]||_0x100826[_0x5262('0x26')][_0x5262('0x24')][_0x5262('0x25')];return openIssue(_0x100826['body'],_0x33f219);}; \ No newline at end of file +var _0xcafe=['email','customfield_11501','oldToken','newToken','customfield_11503','customfield_11504','reason','customfield_10102','/rest/api/2/issue','toString','request','setEncoding','utf8','data','end','status','json','parse','error','api.jira','write','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xcafe,0x9d));var _0xecaf=function(_0xc02aa5,_0x1c36bc){_0xc02aa5=_0xc02aa5-0x0;var _0x31f6a2=_0xcafe[_0xc02aa5];return _0x31f6a2;};'use strict';var BPromise=require(_0xecaf('0x0'));var https=require(_0xecaf('0x1'));var logger=require(_0xecaf('0x2'))(_0xecaf('0x3'));var USERNAME=_0xecaf('0x4');var PASSWORD=_0xecaf('0x5');function openIssue(_0x317e9d,_0x2be93e){var _0x244f84={'fields':{'project':{'key':_0x317e9d['key']||_0xecaf('0x6')},'summary':(_0x317e9d[_0xecaf('0x7')]||'Report')+_0xecaf('0x8')+_0x317e9d['ip'],'description':_0x317e9d[_0xecaf('0x9')]||JSON[_0xecaf('0xa')](_0x317e9d),'issuetype':{'name':_0x317e9d[_0xecaf('0xb')]||_0xecaf('0xc')}}};_0x244f84[_0xecaf('0xd')][_0xecaf('0xe')]=_0x317e9d[_0xecaf('0xf')];_0x244f84[_0xecaf('0xd')][_0xecaf('0x10')]=_0x317e9d[_0xecaf('0x11')];_0x244f84[_0xecaf('0xd')]['customfield_11502']=_0x317e9d[_0xecaf('0x12')];_0x244f84[_0xecaf('0xd')][_0xecaf('0x13')]=_0x317e9d['name'];_0x244f84[_0xecaf('0xd')][_0xecaf('0x14')]=_0x317e9d[_0xecaf('0x15')];_0x244f84[_0xecaf('0xd')][_0xecaf('0x16')]=_0x317e9d['ip'];var _0x3a087f={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xecaf('0x17'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xecaf('0x18')]('base64')}};var _0x361cb1=JSON['stringify'](_0x244f84);var _0x1900f2=https[_0xecaf('0x19')](_0x3a087f,function(_0x1d755){_0x1d755[_0xecaf('0x1a')](_0xecaf('0x1b'));var _0x403844='';_0x1d755['on'](_0xecaf('0x1c'),function(_0x127905){_0x403844+=_0x127905;});_0x1d755['on'](_0xecaf('0x1d'),function(){if(_0x2be93e){return _0x2be93e[_0xecaf('0x1e')](_0x1d755['statusCode'])[_0xecaf('0x1f')](JSON[_0xecaf('0x20')](_0x403844));}});});_0x1900f2['on'](_0xecaf('0x21'),function(_0x5e9b4e){if(_0x2be93e){return _0x2be93e[_0xecaf('0x1e')](0x1f4)[_0xecaf('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xecaf('0x22')}]});}});_0x1900f2[_0xecaf('0x23')](_0x361cb1);_0x1900f2['end']();}exports[_0xecaf('0x24')]=openIssue;exports['send']=function(_0x30fb13,_0x73fee4){_0x30fb13['body']['ip']=_0x30fb13[_0xecaf('0x25')][_0xecaf('0x26')]||_0x30fb13[_0xecaf('0x27')][_0xecaf('0x28')]||_0x30fb13['socket'][_0xecaf('0x28')]||_0x30fb13[_0xecaf('0x27')][_0xecaf('0x29')]['remoteAddress'];return openIssue(_0x30fb13[_0xecaf('0x2a')],_0x73fee4);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 3cea3c9..b38bd76 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 _0x4483=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x4483,0x1a3));var _0x3448=function(_0x569a16,_0x1b1998){_0x569a16=_0x569a16-0x0;var _0xdf68d2=_0x4483[_0x569a16];return _0xdf68d2;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0xf')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x11')](_0x3448('0x12'),auth[_0x3448('0xa')](),controller[_0x3448('0x13')]);router[_0x3448('0x14')](_0x3448('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x3448('0x15')]=router; \ No newline at end of file +var _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c76,0x184));var _0x66c7=function(_0x479461,_0x148d02){_0x479461=_0x479461-0x0;var _0x3c6585=_0x6c76[_0x479461];return _0x3c6585;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 0564ed1..708c7f9 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7a54,0x106));var _0x47a5=function(_0x523731,_0x4804b9){_0x523731=_0x523731-0x0;var _0x5108f0=_0x7a54[_0x523731];return _0x5108f0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7a54,0x106));var _0x47a5=function(_0x271188,_0x5a01cd){_0x271188=_0x271188-0x0;var _0xf4b453=_0x7a54[_0x271188];return _0xf4b453;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 08f4902..29aeba3 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 _0x42b0=['update','destroy','then','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','save'];(function(_0x5a6b65,_0x3f3fd2){var _0x487d38=function(_0x17708f){while(--_0x17708f){_0x5a6b65['push'](_0x5a6b65['shift']());}};_0x487d38(++_0x3f3fd2);}(_0x42b0,0xbc));var _0x042b=function(_0x3d4882,_0x230d03){_0x3d4882=_0x3d4882-0x0;var _0x2fe197=_0x42b0[_0x3d4882];return _0x2fe197;};'use strict';var emlformat=require(_0x042b('0x0'));var rimraf=require(_0x042b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x042b('0x2'));var rp=require('request-promise');var moment=require(_0x042b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x042b('0x4'));var path=require(_0x042b('0x5'));var sox=require(_0x042b('0x6'));var csv=require(_0x042b('0x7'));var ejs=require(_0x042b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x042b('0x9'));var crypto=require(_0x042b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x042b('0x7'));var querystring=require('querystring');var Papa=require(_0x042b('0xb'));var Redis=require('ioredis');var authService=require(_0x042b('0xc'));var qs=require(_0x042b('0xd'));var as=require(_0x042b('0xe'));var hardwareService=require(_0x042b('0xf'));var logger=require(_0x042b('0x10'))(_0x042b('0x11'));var utils=require(_0x042b('0x12'));var config=require(_0x042b('0x13'));var licenseUtil=require(_0x042b('0x14'));var db=require(_0x042b('0x15'))['db'];function respondWithStatusCode(_0x2c0a6f,_0x35414e){_0x35414e=_0x35414e||0xcc;return function(_0x950ed9){if(_0x950ed9){return _0x2c0a6f['sendStatus'](_0x35414e);}return _0x2c0a6f[_0x042b('0x16')](_0x35414e)['end']();};}function respondWithResult(_0x1e5626,_0x5681bd){_0x5681bd=_0x5681bd||0xc8;return function(_0x31c22e){if(_0x31c22e){return _0x1e5626[_0x042b('0x16')](_0x5681bd)[_0x042b('0x17')](_0x31c22e);}};}function respondWithFilteredResult(_0xf9f4f3,_0x30c86f){return function(_0x183225){if(_0x183225){var _0x4dc4a6=typeof _0x30c86f[_0x042b('0x18')]===_0x042b('0x19')&&typeof _0x30c86f[_0x042b('0x1a')]===_0x042b('0x19');var _0x1e4eee=_0x183225['count'];var _0x2e2cb6=_0x4dc4a6?0x0:_0x30c86f[_0x042b('0x18')];var _0x4b5c25=_0x4dc4a6?_0x183225['count']:_0x30c86f[_0x042b('0x18')]+_0x30c86f[_0x042b('0x1a')];var _0x561d06;if(_0x4b5c25>=_0x1e4eee){_0x4b5c25=_0x1e4eee;_0x561d06=0xc8;}else{_0x561d06=0xce;}_0xf9f4f3[_0x042b('0x16')](_0x561d06);return _0xf9f4f3[_0x042b('0x1b')]('Content-Range',_0x2e2cb6+'-'+_0x4b5c25+'/'+_0x1e4eee)['json'](_0x183225);}return null;};}function patchUpdates(_0x5e6d8a){return function(_0x4eec67){try{jsonpatch[_0x042b('0x1c')](_0x4eec67,_0x5e6d8a,!![]);}catch(_0x23c915){return BPromise[_0x042b('0x1d')](_0x23c915);}return _0x4eec67[_0x042b('0x1e')]();};}function saveUpdates(_0x336c40,_0x50be84){return function(_0x36fabf){if(_0x36fabf){return _0x36fabf[_0x042b('0x1f')](_0x336c40)['then'](function(_0x5bc416){return _0x5bc416;});}return null;};}function removeEntity(_0x434d21,_0x59af51){return function(_0x558889){if(_0x558889){return _0x558889[_0x042b('0x20')]()[_0x042b('0x21')](function(){_0x434d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3204fc,_0x2f6e67){return function(_0x3c5491){if(!_0x3c5491){_0x3204fc['sendStatus'](0x194);}return _0x3c5491;};}function handleError(_0xda0462,_0x45d2c6){_0x45d2c6=_0x45d2c6||0x1f4;return function(_0x1b1250){logger['error'](_0x1b1250[_0x042b('0x22')]);if(_0x1b1250[_0x042b('0x23')]){delete _0x1b1250['name'];}_0xda0462[_0x042b('0x16')](_0x45d2c6)[_0x042b('0x24')](_0x1b1250);};}exports[_0x042b('0x25')]=function(_0x39596c,_0x52e467){var _0x5b5fe7={},_0x572d6a={},_0x5c0c41={'count':0x0,'rows':[]};var _0x34bb9e=_['map'](db[_0x042b('0x26')][_0x042b('0x27')],function(_0xddc276){return{'name':_0xddc276[_0x042b('0x28')],'type':_0xddc276[_0x042b('0x29')][_0x042b('0x2a')]};});_0x572d6a[_0x042b('0x2b')]=_[_0x042b('0x2c')](_0x34bb9e,_0x042b('0x23'));_0x572d6a[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x39596c[_0x042b('0x2d')]);_0x572d6a[_0x042b('0x2f')]=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],_0x572d6a[_0x042b('0x2d')]);_0x5b5fe7['attributes']=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],qs[_0x042b('0x31')](_0x39596c[_0x042b('0x2d')][_0x042b('0x31')]));_0x5b5fe7[_0x042b('0x32')]=_0x5b5fe7['attributes'][_0x042b('0x33')]?_0x5b5fe7[_0x042b('0x32')]:_0x572d6a['model'];if(!_0x39596c[_0x042b('0x2d')][_0x042b('0x34')](_0x042b('0x35'))){_0x5b5fe7[_0x042b('0x1a')]=qs['limit'](_0x39596c[_0x042b('0x2d')][_0x042b('0x1a')]);_0x5b5fe7[_0x042b('0x18')]=qs[_0x042b('0x18')](_0x39596c[_0x042b('0x2d')]['offset']);}_0x5b5fe7[_0x042b('0x36')]=qs[_0x042b('0x37')](_0x39596c[_0x042b('0x2d')]['sort']);_0x5b5fe7[_0x042b('0x38')]=qs['filters'](_[_0x042b('0x39')](_0x39596c[_0x042b('0x2d')],_0x572d6a['filters']),_0x34bb9e);if(_0x39596c[_0x042b('0x2d')][_0x042b('0x3a')]){_0x5b5fe7['where']=_['merge'](_0x5b5fe7[_0x042b('0x38')],{'$or':_[_0x042b('0x2c')](_0x34bb9e,function(_0x4aa81d){if(_0x4aa81d[_0x042b('0x29')]!==_0x042b('0x3b')){var _0x1f38c2={};_0x1f38c2[_0x4aa81d['name']]={'$like':'%'+_0x39596c['query'][_0x042b('0x3a')]+'%'};return _0x1f38c2;}})});}_0x5b5fe7=_[_0x042b('0x3c')]({},_0x5b5fe7,_0x39596c[_0x042b('0x3d')]);var _0x296b35={'where':_0x5b5fe7['where']};return db['JscriptyAnswerReport'][_0x042b('0x3e')](_0x296b35)['then'](function(_0x220653){_0x5c0c41['count']=_0x220653;if(_0x39596c[_0x042b('0x2d')]['includeAll']){_0x5b5fe7[_0x042b('0x3f')]=[{'all':!![]}];}return db[_0x042b('0x26')]['findAll'](_0x5b5fe7);})[_0x042b('0x21')](function(_0x5471fa){_0x5c0c41[_0x042b('0x40')]=_0x5471fa;return _0x5c0c41;})['then'](respondWithFilteredResult(_0x52e467,_0x5b5fe7))[_0x042b('0x41')](handleError(_0x52e467,null));};exports[_0x042b('0x42')]=function(_0x1a9245,_0x4ee3a4){var _0x527f49={'raw':!![],'where':{'id':_0x1a9245[_0x042b('0x43')]['id']}},_0x1fb824={};_0x1fb824[_0x042b('0x2b')]=_[_0x042b('0x2e')](db[_0x042b('0x26')][_0x042b('0x27')]);_0x1fb824[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x1a9245[_0x042b('0x2d')]);_0x1fb824[_0x042b('0x2f')]=_['intersection'](_0x1fb824[_0x042b('0x2b')],_0x1fb824[_0x042b('0x2d')]);_0x527f49[_0x042b('0x32')]=_[_0x042b('0x30')](_0x1fb824['model'],qs['fields'](_0x1a9245[_0x042b('0x2d')]['fields']));_0x527f49[_0x042b('0x32')]=_0x527f49[_0x042b('0x32')][_0x042b('0x33')]?_0x527f49['attributes']:_0x1fb824[_0x042b('0x2b')];if(_0x1a9245[_0x042b('0x2d')][_0x042b('0x44')]){_0x527f49[_0x042b('0x3f')]=[{'all':!![]}];}_0x527f49=_[_0x042b('0x3c')]({},_0x527f49,_0x1a9245[_0x042b('0x3d')]);return db[_0x042b('0x26')]['find'](_0x527f49)[_0x042b('0x21')](handleEntityNotFound(_0x4ee3a4,null))['then'](respondWithResult(_0x4ee3a4,null))[_0x042b('0x41')](handleError(_0x4ee3a4,null));};exports[_0x042b('0x45')]=function(_0x533862,_0x37488a){return db[_0x042b('0x26')][_0x042b('0x45')](_0x533862[_0x042b('0x46')],{})[_0x042b('0x21')](respondWithResult(_0x37488a,0xc9))[_0x042b('0x41')](handleError(_0x37488a,null));};exports[_0x042b('0x1f')]=function(_0x476eda,_0x48fe3e){if(_0x476eda[_0x042b('0x46')]['id']){delete _0x476eda[_0x042b('0x46')]['id'];}return db[_0x042b('0x26')][_0x042b('0x47')]({'where':{'id':_0x476eda[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x48fe3e,null))['then'](saveUpdates(_0x476eda['body'],null))[_0x042b('0x21')](respondWithResult(_0x48fe3e,null))[_0x042b('0x41')](handleError(_0x48fe3e,null));};exports[_0x042b('0x20')]=function(_0x396da4,_0x261c87){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x396da4[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x261c87,null))['then'](removeEntity(_0x261c87,null))[_0x042b('0x41')](handleError(_0x261c87,null));};exports['describe']=function(_0x15e46f,_0x170056){return db[_0x042b('0x26')][_0x042b('0x48')]()['then'](respondWithResult(_0x170056,null))[_0x042b('0x41')](handleError(_0x170056,null));}; \ No newline at end of file +var _0x9f02=['count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','catch','show','params','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','undefined'];(function(_0x54a49a,_0x4fab2e){var _0x1e8db8=function(_0x41b1f1){while(--_0x41b1f1){_0x54a49a['push'](_0x54a49a['shift']());}};_0x1e8db8(++_0x4fab2e);}(_0x9f02,0x68));var _0x29f0=function(_0x5d677b,_0x3d2a51){_0x5d677b=_0x5d677b-0x0;var _0x2816b4=_0x9f02[_0x5d677b];return _0x2816b4;};'use strict';var emlformat=require(_0x29f0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x29f0('0x1'));var moment=require(_0x29f0('0x2'));var BPromise=require(_0x29f0('0x3'));var Mustache=require(_0x29f0('0x4'));var util=require(_0x29f0('0x5'));var path=require('path');var sox=require(_0x29f0('0x6'));var csv=require('to-csv');var ejs=require(_0x29f0('0x7'));var fs=require('fs');var fs_extra=require(_0x29f0('0x8'));var _=require(_0x29f0('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x29f0('0xa'));var toCsv=require('to-csv');var querystring=require(_0x29f0('0xb'));var Papa=require(_0x29f0('0xc'));var Redis=require(_0x29f0('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x29f0('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x29f0('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x29f0('0x10'))['db'];function respondWithStatusCode(_0x4faa1a,_0xdc7a5d){_0xdc7a5d=_0xdc7a5d||0xcc;return function(_0x3fe285){if(_0x3fe285){return _0x4faa1a[_0x29f0('0x11')](_0xdc7a5d);}return _0x4faa1a[_0x29f0('0x12')](_0xdc7a5d)['end']();};}function respondWithResult(_0x4071f6,_0x2db422){_0x2db422=_0x2db422||0xc8;return function(_0x5ee106){if(_0x5ee106){return _0x4071f6[_0x29f0('0x12')](_0x2db422)['json'](_0x5ee106);}};}function respondWithFilteredResult(_0x31bc0f,_0x495bc8){return function(_0x3d45ae){if(_0x3d45ae){var _0x37e3ab=typeof _0x495bc8['offset']==='undefined'&&typeof _0x495bc8['limit']===_0x29f0('0x13');var _0x3817ee=_0x3d45ae[_0x29f0('0x14')];var _0x528f6f=_0x37e3ab?0x0:_0x495bc8[_0x29f0('0x15')];var _0x3416c1=_0x37e3ab?_0x3d45ae[_0x29f0('0x14')]:_0x495bc8[_0x29f0('0x15')]+_0x495bc8[_0x29f0('0x16')];var _0x5a8b67;if(_0x3416c1>=_0x3817ee){_0x3416c1=_0x3817ee;_0x5a8b67=0xc8;}else{_0x5a8b67=0xce;}_0x31bc0f[_0x29f0('0x12')](_0x5a8b67);return _0x31bc0f[_0x29f0('0x17')](_0x29f0('0x18'),_0x528f6f+'-'+_0x3416c1+'/'+_0x3817ee)['json'](_0x3d45ae);}return null;};}function patchUpdates(_0x2fd36b){return function(_0x4f2fa1){try{jsonpatch[_0x29f0('0x19')](_0x4f2fa1,_0x2fd36b,!![]);}catch(_0x2cb73f){return BPromise[_0x29f0('0x1a')](_0x2cb73f);}return _0x4f2fa1['save']();};}function saveUpdates(_0x419e12,_0x45a7ae){return function(_0x23e691){if(_0x23e691){return _0x23e691[_0x29f0('0x1b')](_0x419e12)[_0x29f0('0x1c')](function(_0x5ef0c7){return _0x5ef0c7;});}return null;};}function removeEntity(_0x3c0e47,_0x3a726a){return function(_0x35c663){if(_0x35c663){return _0x35c663[_0x29f0('0x1d')]()[_0x29f0('0x1c')](function(){_0x3c0e47[_0x29f0('0x12')](0xcc)[_0x29f0('0x1e')]();});}};}function handleEntityNotFound(_0x3ee1ab,_0x12ccdd){return function(_0x2012c3){if(!_0x2012c3){_0x3ee1ab[_0x29f0('0x11')](0x194);}return _0x2012c3;};}function handleError(_0x51043d,_0x1c8d74){_0x1c8d74=_0x1c8d74||0x1f4;return function(_0x4e2153){logger['error'](_0x4e2153['stack']);if(_0x4e2153[_0x29f0('0x1f')]){delete _0x4e2153[_0x29f0('0x1f')];}_0x51043d['status'](_0x1c8d74)[_0x29f0('0x20')](_0x4e2153);};}exports[_0x29f0('0x21')]=function(_0x115996,_0x4fcd9b){var _0x56f7ec={},_0x1ac3ff={},_0x3dc23b={'count':0x0,'rows':[]};var _0x4187d7=_[_0x29f0('0x22')](db[_0x29f0('0x23')]['rawAttributes'],function(_0x2927e7){return{'name':_0x2927e7[_0x29f0('0x24')],'type':_0x2927e7[_0x29f0('0x25')][_0x29f0('0x26')]};});_0x1ac3ff[_0x29f0('0x27')]=_[_0x29f0('0x22')](_0x4187d7,_0x29f0('0x1f'));_0x1ac3ff['query']=_[_0x29f0('0x28')](_0x115996[_0x29f0('0x29')]);_0x1ac3ff['filters']=_[_0x29f0('0x2a')](_0x1ac3ff[_0x29f0('0x27')],_0x1ac3ff['query']);_0x56f7ec['attributes']=_[_0x29f0('0x2a')](_0x1ac3ff['model'],qs[_0x29f0('0x2b')](_0x115996['query'][_0x29f0('0x2b')]));_0x56f7ec[_0x29f0('0x2c')]=_0x56f7ec['attributes'][_0x29f0('0x2d')]?_0x56f7ec['attributes']:_0x1ac3ff[_0x29f0('0x27')];if(!_0x115996[_0x29f0('0x29')][_0x29f0('0x2e')](_0x29f0('0x2f'))){_0x56f7ec['limit']=qs[_0x29f0('0x16')](_0x115996['query'][_0x29f0('0x16')]);_0x56f7ec[_0x29f0('0x15')]=qs[_0x29f0('0x15')](_0x115996[_0x29f0('0x29')][_0x29f0('0x15')]);}_0x56f7ec[_0x29f0('0x30')]=qs[_0x29f0('0x31')](_0x115996['query'][_0x29f0('0x31')]);_0x56f7ec[_0x29f0('0x32')]=qs[_0x29f0('0x33')](_['pick'](_0x115996[_0x29f0('0x29')],_0x1ac3ff[_0x29f0('0x33')]),_0x4187d7);if(_0x115996['query'][_0x29f0('0x34')]){_0x56f7ec[_0x29f0('0x32')]=_[_0x29f0('0x35')](_0x56f7ec[_0x29f0('0x32')],{'$or':_['map'](_0x4187d7,function(_0x343b54){if(_0x343b54[_0x29f0('0x25')]!=='VIRTUAL'){var _0x51101d={};_0x51101d[_0x343b54[_0x29f0('0x1f')]]={'$like':'%'+_0x115996[_0x29f0('0x29')][_0x29f0('0x34')]+'%'};return _0x51101d;}})});}_0x56f7ec=_[_0x29f0('0x35')]({},_0x56f7ec,_0x115996[_0x29f0('0x36')]);var _0x348d39={'where':_0x56f7ec[_0x29f0('0x32')]};return db[_0x29f0('0x23')][_0x29f0('0x14')](_0x348d39)[_0x29f0('0x1c')](function(_0x4a975a){_0x3dc23b['count']=_0x4a975a;if(_0x115996[_0x29f0('0x29')][_0x29f0('0x37')]){_0x56f7ec['include']=[{'all':!![]}];}return db[_0x29f0('0x23')]['findAll'](_0x56f7ec);})[_0x29f0('0x1c')](function(_0x582784){_0x3dc23b['rows']=_0x582784;return _0x3dc23b;})[_0x29f0('0x1c')](respondWithFilteredResult(_0x4fcd9b,_0x56f7ec))[_0x29f0('0x38')](handleError(_0x4fcd9b,null));};exports[_0x29f0('0x39')]=function(_0x42caa5,_0x53837e){var _0x15bd61={'raw':!![],'where':{'id':_0x42caa5[_0x29f0('0x3a')]['id']}},_0x243784={};_0x243784[_0x29f0('0x27')]=_['keys'](db[_0x29f0('0x23')]['rawAttributes']);_0x243784[_0x29f0('0x29')]=_[_0x29f0('0x28')](_0x42caa5[_0x29f0('0x29')]);_0x243784['filters']=_[_0x29f0('0x2a')](_0x243784[_0x29f0('0x27')],_0x243784['query']);_0x15bd61[_0x29f0('0x2c')]=_[_0x29f0('0x2a')](_0x243784[_0x29f0('0x27')],qs[_0x29f0('0x2b')](_0x42caa5[_0x29f0('0x29')][_0x29f0('0x2b')]));_0x15bd61[_0x29f0('0x2c')]=_0x15bd61[_0x29f0('0x2c')][_0x29f0('0x2d')]?_0x15bd61[_0x29f0('0x2c')]:_0x243784[_0x29f0('0x27')];if(_0x42caa5[_0x29f0('0x29')][_0x29f0('0x37')]){_0x15bd61['include']=[{'all':!![]}];}_0x15bd61=_[_0x29f0('0x35')]({},_0x15bd61,_0x42caa5[_0x29f0('0x36')]);return db[_0x29f0('0x23')]['find'](_0x15bd61)['then'](handleEntityNotFound(_0x53837e,null))[_0x29f0('0x1c')](respondWithResult(_0x53837e,null))[_0x29f0('0x38')](handleError(_0x53837e,null));};exports['create']=function(_0x1f8d49,_0x3191f6){return db['JscriptyAnswerReport']['create'](_0x1f8d49[_0x29f0('0x3b')],{})['then'](respondWithResult(_0x3191f6,0xc9))['catch'](handleError(_0x3191f6,null));};exports[_0x29f0('0x1b')]=function(_0x1f4a53,_0x1c7fd1){if(_0x1f4a53['body']['id']){delete _0x1f4a53[_0x29f0('0x3b')]['id'];}return db[_0x29f0('0x23')][_0x29f0('0x3c')]({'where':{'id':_0x1f4a53[_0x29f0('0x3a')]['id']}})[_0x29f0('0x1c')](handleEntityNotFound(_0x1c7fd1,null))[_0x29f0('0x1c')](saveUpdates(_0x1f4a53[_0x29f0('0x3b')],null))['then'](respondWithResult(_0x1c7fd1,null))[_0x29f0('0x38')](handleError(_0x1c7fd1,null));};exports[_0x29f0('0x1d')]=function(_0xbb0557,_0x2c746e){return db[_0x29f0('0x23')]['find']({'where':{'id':_0xbb0557['params']['id']}})[_0x29f0('0x1c')](handleEntityNotFound(_0x2c746e,null))[_0x29f0('0x1c')](removeEntity(_0x2c746e,null))[_0x29f0('0x38')](handleError(_0x2c746e,null));};exports[_0x29f0('0x3d')]=function(_0x48354c,_0x1ccecb){return db['JscriptyAnswerReport'][_0x29f0('0x3d')]()['then'](respondWithResult(_0x1ccecb,null))['catch'](handleError(_0x1ccecb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 122fe90..e1f026d 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 _0xeac7=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport'];(function(_0x26c9d8,_0xa64f04){var _0xdebacf=function(_0x11c6f9){while(--_0x11c6f9){_0x26c9d8['push'](_0x26c9d8['shift']());}};_0xdebacf(++_0xa64f04);}(_0xeac7,0x78));var _0x7eac=function(_0x453eb3,_0x29f009){_0x453eb3=_0x453eb3-0x0;var _0x257ca7=_0xeac7[_0x453eb3];return _0x257ca7;};'use strict';var _=require('lodash');var util=require(_0x7eac('0x0'));var logger=require(_0x7eac('0x1'))('api');var moment=require(_0x7eac('0x2'));var BPromise=require(_0x7eac('0x3'));var rp=require(_0x7eac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7eac('0x5'));var config=require(_0x7eac('0x6'));var attributes=require(_0x7eac('0x7'));module[_0x7eac('0x8')]=function(_0x53a099,_0x4fbcbf){return _0x53a099['define'](_0x7eac('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8d8=['report_jscripty_answers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x1b6871,_0x57f017){var _0x390b7=function(_0x5427e0){while(--_0x5427e0){_0x1b6871['push'](_0x1b6871['shift']());}};_0x390b7(++_0x57f017);}(_0xb8d8,0x199));var _0x8b8d=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb8d8[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x8b8d('0x0'));var util=require(_0x8b8d('0x1'));var logger=require(_0x8b8d('0x2'))('api');var moment=require(_0x8b8d('0x3'));var BPromise=require(_0x8b8d('0x4'));var rp=require(_0x8b8d('0x5'));var fs=require('fs');var path=require(_0x8b8d('0x6'));var rimraf=require(_0x8b8d('0x7'));var config=require(_0x8b8d('0x8'));var attributes=require(_0x8b8d('0x9'));module[_0x8b8d('0xa')]=function(_0x25f5d4,_0x3830ce){return _0x25f5d4['define']('JscriptyAnswerReport',attributes,{'tableName':_0x8b8d('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 30b6eae..4909117 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 _0x7f70=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','code','error','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x3d2be7,_0x4da8ce){var _0x782ad6=function(_0x4fe359){while(--_0x4fe359){_0x3d2be7['push'](_0x3d2be7['shift']());}};_0x782ad6(++_0x4da8ce);}(_0x7f70,0xb3));var _0x07f7=function(_0x5beb98,_0x560c65){_0x5beb98=_0x5beb98-0x0;var _0xb537b4=_0x7f70[_0x5beb98];return _0xb537b4;};'use strict';var _=require(_0x07f7('0x0'));var util=require('util');var moment=require(_0x07f7('0x1'));var BPromise=require(_0x07f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07f7('0x3'));var db=require(_0x07f7('0x4'))['db'];var utils=require(_0x07f7('0x5'));var logger=require(_0x07f7('0x6'))(_0x07f7('0x7'));var config=require(_0x07f7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x07f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f05dd,_0x3c6916,_0x1c8876){return new BPromise(function(_0xd356e8,_0x668959){return client['request'](_0x4f05dd,_0x1c8876)[_0x07f7('0xa')](function(_0x5275f3){logger[_0x07f7('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3c6916,_0x07f7('0xc'));logger[_0x07f7('0xd')](_0x07f7('0xe'),_0x3c6916,_0x07f7('0xc'),JSON[_0x07f7('0xf')](_0x5275f3));if(_0x5275f3['error']){if(_0x5275f3['error'][_0x07f7('0x10')]===0x1f4){logger[_0x07f7('0x11')](_0x07f7('0x12'),_0x3c6916,_0x5275f3[_0x07f7('0x11')][_0x07f7('0x13')]);return _0x668959(_0x5275f3[_0x07f7('0x11')][_0x07f7('0x13')]);}logger[_0x07f7('0x11')](_0x07f7('0x12'),_0x3c6916,_0x5275f3[_0x07f7('0x11')][_0x07f7('0x13')]);return _0xd356e8(_0x5275f3[_0x07f7('0x11')][_0x07f7('0x13')]);}else{logger[_0x07f7('0xb')](_0x07f7('0x12'),_0x3c6916,_0x07f7('0xc'));_0xd356e8(_0x5275f3[_0x07f7('0x14')][_0x07f7('0x13')]);}})[_0x07f7('0x15')](function(_0x4657f5){logger[_0x07f7('0x11')](_0x07f7('0x12'),_0x3c6916,_0x4657f5);_0x668959(_0x4657f5);});});} \ No newline at end of file +var _0x021a=['message','result','moment','randomstring','../../mysqldb','../../config/environment','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31aa84,_0x3bcc8b){var _0x2d9e3e=function(_0x4783da){while(--_0x4783da){_0x31aa84['push'](_0x31aa84['shift']());}};_0x2d9e3e(++_0x3bcc8b);}(_0x021a,0x1b2));var _0xa021=function(_0x1fb9d2,_0x57a208){_0x1fb9d2=_0x1fb9d2-0x0;var _0x4a8916=_0x021a[_0x1fb9d2];return _0x4a8916;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa021('0x0'));var BPromise=require('bluebird');var rs=require(_0xa021('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa021('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa021('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa021('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x1ed1e5,_0x18fe1c,_0x45a6dd){return new BPromise(function(_0x787b19,_0x26c1be){return client[_0xa021('0x5')](_0x1ed1e5,_0x45a6dd)['then'](function(_0x1e25d6){logger[_0xa021('0x6')](_0xa021('0x7'),_0x18fe1c,_0xa021('0x8'));logger[_0xa021('0x9')](_0xa021('0xa'),_0x18fe1c,_0xa021('0x8'),JSON[_0xa021('0xb')](_0x1e25d6));if(_0x1e25d6[_0xa021('0xc')]){if(_0x1e25d6[_0xa021('0xc')][_0xa021('0xd')]===0x1f4){logger[_0xa021('0xc')](_0xa021('0x7'),_0x18fe1c,_0x1e25d6['error'][_0xa021('0xe')]);return _0x26c1be(_0x1e25d6[_0xa021('0xc')][_0xa021('0xe')]);}logger[_0xa021('0xc')](_0xa021('0x7'),_0x18fe1c,_0x1e25d6['error'][_0xa021('0xe')]);return _0x787b19(_0x1e25d6[_0xa021('0xc')]['message']);}else{logger[_0xa021('0x6')](_0xa021('0x7'),_0x18fe1c,'request\x20sent');_0x787b19(_0x1e25d6[_0xa021('0xf')][_0xa021('0xe')]);}})['catch'](function(_0x10ed47){logger[_0xa021('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x18fe1c,_0x10ed47);_0x26c1be(_0x10ed47);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index d02abc3..d260b1b 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 _0x4ef8=['clone','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone'];(function(_0x643bbd,_0x328517){var _0x64da78=function(_0x559199){while(--_0x559199){_0x643bbd['push'](_0x643bbd['shift']());}};_0x64da78(++_0x328517);}(_0x4ef8,0x155));var _0x84ef=function(_0x42b8cb,_0x21a5bf){_0x42b8cb=_0x42b8cb-0x0;var _0x563990=_0x4ef8[_0x42b8cb];return _0x563990;};'use strict';var multer=require(_0x84ef('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x84ef('0x1'));var express=require(_0x84ef('0x2'));var router=express[_0x84ef('0x3')]();var fs_extra=require(_0x84ef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x84ef('0x5'));var config=require(_0x84ef('0x6'));var controller=require(_0x84ef('0x7'));router[_0x84ef('0x8')]('/',auth[_0x84ef('0x9')](),controller[_0x84ef('0xa')]);router[_0x84ef('0x8')](_0x84ef('0xb'),auth['isAuthenticated'](),controller[_0x84ef('0xc')]);router[_0x84ef('0x8')](_0x84ef('0xd'),auth[_0x84ef('0x9')](),controller[_0x84ef('0xe')]);router[_0x84ef('0x8')](_0x84ef('0xf'),auth[_0x84ef('0x9')](),controller[_0x84ef('0x10')]);router[_0x84ef('0x8')](_0x84ef('0x11'),auth[_0x84ef('0x9')](),timeout(_0x84ef('0x12')),controller[_0x84ef('0x13')]);router[_0x84ef('0x14')]('/',auth[_0x84ef('0x9')](),controller[_0x84ef('0x15')]);router[_0x84ef('0x14')](_0x84ef('0x16'),auth[_0x84ef('0x9')](),controller[_0x84ef('0x17')]);router['put']('/:id',auth[_0x84ef('0x9')](),controller[_0x84ef('0x18')]);router[_0x84ef('0x19')](_0x84ef('0xb'),auth[_0x84ef('0x9')](),controller[_0x84ef('0x1a')]);module[_0x84ef('0x1b')]=router; \ No newline at end of file +var _0xcd71=['/:id/summary','30s','getSummary','create','post','clone','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','show','/:id/sessions','getSessions','isAuthenticated','getAnswers'];(function(_0x570b19,_0xe4cb1f){var _0x44c8ce=function(_0x2a93e8){while(--_0x2a93e8){_0x570b19['push'](_0x570b19['shift']());}};_0x44c8ce(++_0xe4cb1f);}(_0xcd71,0x168));var _0x1cd7=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0xcd71[_0x5aa1e2];return _0x399098;};'use strict';var multer=require(_0x1cd7('0x0'));var util=require(_0x1cd7('0x1'));var path=require(_0x1cd7('0x2'));var timeout=require(_0x1cd7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cd7('0x4'));var interaction=require(_0x1cd7('0x5'));var config=require(_0x1cd7('0x6'));var controller=require(_0x1cd7('0x7'));router[_0x1cd7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1cd7('0x8')](_0x1cd7('0x9'),auth['isAuthenticated'](),controller[_0x1cd7('0xa')]);router[_0x1cd7('0x8')](_0x1cd7('0xb'),auth['isAuthenticated'](),controller[_0x1cd7('0xc')]);router[_0x1cd7('0x8')]('/:id/answers',auth[_0x1cd7('0xd')](),controller[_0x1cd7('0xe')]);router[_0x1cd7('0x8')](_0x1cd7('0xf'),auth['isAuthenticated'](),timeout(_0x1cd7('0x10')),controller[_0x1cd7('0x11')]);router['post']('/',auth[_0x1cd7('0xd')](),controller[_0x1cd7('0x12')]);router[_0x1cd7('0x13')]('/:id/clone',auth[_0x1cd7('0xd')](),controller[_0x1cd7('0x14')]);router[_0x1cd7('0x15')]('/:id',auth[_0x1cd7('0xd')](),controller[_0x1cd7('0x16')]);router['delete']('/:id',auth[_0x1cd7('0xd')](),controller[_0x1cd7('0x17')]);module[_0x1cd7('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index d76cb94..c44c877 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 _0x7a46=['getDataValue','description','BOOLEAN','lodash','util','exports','STRING','name','long','isObjectLike','setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x452852,_0x414ea1){var _0x365b90=function(_0x25de5c){while(--_0x25de5c){_0x452852['push'](_0x452852['shift']());}};_0x365b90(++_0x414ea1);}(_0x7a46,0x161));var _0x67a4=function(_0xa4b344,_0x52a6fb){_0xa4b344=_0xa4b344-0x0;var _0x3df243=_0x7a46[_0xa4b344];return _0x3df243;};'use strict';var Sequelize=require('sequelize');var _=require(_0x67a4('0x0'));var util=require(_0x67a4('0x1'));module[_0x67a4('0x2')]={'name':{'type':Sequelize[_0x67a4('0x3')],'unique':_0x67a4('0x4')},'description':{'type':Sequelize[_0x67a4('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x67a4('0x5')),'set':function(_0x2e0bd3){if(_[_0x67a4('0x6')](_0x2e0bd3)){this[_0x67a4('0x7')](_0x67a4('0x8'),JSON['stringify'](_0x2e0bd3));}else if(_[_0x67a4('0x9')](_0x2e0bd3)){this[_0x67a4('0x7')](_0x67a4('0x8'),_0x2e0bd3);}else{this[_0x67a4('0x7')](_0x67a4('0x8'),util['format'](_0x67a4('0xa'),this[_0x67a4('0xb')](_0x67a4('0x4'))||'',this[_0x67a4('0xb')](_0x67a4('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x67a4('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x67a4('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x6eca=['description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x57fae6,_0x4a28ed){var _0x50e6b2=function(_0xa3d92){while(--_0xa3d92){_0x57fae6['push'](_0x57fae6['shift']());}};_0x50e6b2(++_0x4a28ed);}(_0x6eca,0xb2));var _0xa6ec=function(_0x1bd4a5,_0x7e771e){_0x1bd4a5=_0x1bd4a5-0x0;var _0x2741a9=_0x6eca[_0x1bd4a5];return _0x2741a9;};'use strict';var Sequelize=require(_0xa6ec('0x0'));var _=require('lodash');var util=require(_0xa6ec('0x1'));module[_0xa6ec('0x2')]={'name':{'type':Sequelize[_0xa6ec('0x3')],'unique':_0xa6ec('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa6ec('0x5')](_0xa6ec('0x6')),'set':function(_0x509de5){if(_['isObjectLike'](_0x509de5)){this[_0xa6ec('0x7')](_0xa6ec('0x8'),JSON[_0xa6ec('0x9')](_0x509de5));}else if(_[_0xa6ec('0xa')](_0x509de5)){this[_0xa6ec('0x7')](_0xa6ec('0x8'),_0x509de5);}else{this['setDataValue'](_0xa6ec('0x8'),util[_0xa6ec('0xb')](_0xa6ec('0xc'),this[_0xa6ec('0xd')](_0xa6ec('0x4'))||'',this[_0xa6ec('0xd')](_0xa6ec('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa6ec('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index a823902..e1f6113 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 _0x2785=['offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','UserProfileResource','error','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','findAll','catch','show','params','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','userProfileId','autoAssociation','clone','updatedAt','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getSessions','findOne','JscriptySessionReport','ProjectId','rows','getAnswers','JscriptyAnswerReport','pick','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2785,0x1be));var _0x5278=function(_0x219daf,_0x36b307){_0x219daf=_0x219daf-0x0;var _0x4c2e61=_0x2785[_0x219daf];return _0x4c2e61;};'use strict';var emlformat=require(_0x5278('0x0'));var rimraf=require(_0x5278('0x1'));var zipdir=require(_0x5278('0x2'));var jsonpatch=require(_0x5278('0x3'));var rp=require(_0x5278('0x4'));var moment=require('moment');var BPromise=require(_0x5278('0x5'));var Mustache=require(_0x5278('0x6'));var util=require(_0x5278('0x7'));var path=require(_0x5278('0x8'));var sox=require(_0x5278('0x9'));var csv=require(_0x5278('0xa'));var ejs=require(_0x5278('0xb'));var fs=require('fs');var fs_extra=require(_0x5278('0xc'));var _=require(_0x5278('0xd'));var squel=require('squel');var crypto=require(_0x5278('0xe'));var jsforce=require(_0x5278('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5278('0xa'));var querystring=require(_0x5278('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5278('0x11'));var qs=require(_0x5278('0x12'));var as=require(_0x5278('0x13'));var hardwareService=require(_0x5278('0x14'));var logger=require(_0x5278('0x15'))(_0x5278('0x16'));var utils=require(_0x5278('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5278('0x18'));var db=require(_0x5278('0x19'))['db'];function respondWithStatusCode(_0x168a38,_0x123ee8){_0x123ee8=_0x123ee8||0xcc;return function(_0x401fc4){if(_0x401fc4){return _0x168a38[_0x5278('0x1a')](_0x123ee8);}return _0x168a38[_0x5278('0x1b')](_0x123ee8)[_0x5278('0x1c')]();};}function respondWithResult(_0x3dda1e,_0x570c66){_0x570c66=_0x570c66||0xc8;return function(_0x43c537){if(_0x43c537){return _0x3dda1e['status'](_0x570c66)[_0x5278('0x1d')](_0x43c537);}};}function respondWithFilteredResult(_0x30bdc7,_0x2489e9){return function(_0x3c3bad){if(_0x3c3bad){var _0x32c8f3=typeof _0x2489e9[_0x5278('0x1e')]==='undefined'&&typeof _0x2489e9['limit']===_0x5278('0x1f');var _0x26465e=_0x3c3bad[_0x5278('0x20')];var _0x5749cd=_0x32c8f3?0x0:_0x2489e9['offset'];var _0x5d0eb9=_0x32c8f3?_0x3c3bad['count']:_0x2489e9['offset']+_0x2489e9[_0x5278('0x21')];var _0x172c49;if(_0x5d0eb9>=_0x26465e){_0x5d0eb9=_0x26465e;_0x172c49=0xc8;}else{_0x172c49=0xce;}_0x30bdc7[_0x5278('0x1b')](_0x172c49);return _0x30bdc7[_0x5278('0x22')](_0x5278('0x23'),_0x5749cd+'-'+_0x5d0eb9+'/'+_0x26465e)[_0x5278('0x1d')](_0x3c3bad);}return null;};}function patchUpdates(_0x11a993){return function(_0x2ed8b1){try{jsonpatch[_0x5278('0x24')](_0x2ed8b1,_0x11a993,!![]);}catch(_0x2bfb7d){return BPromise[_0x5278('0x25')](_0x2bfb7d);}return _0x2ed8b1['save']();};}function saveUpdates(_0x316daf,_0x51c765){return function(_0x290968){if(_0x290968){return _0x290968[_0x5278('0x26')](_0x316daf)['then'](function(_0x97095a){return _0x97095a;});}return null;};}function removeEntity(_0x35eabc,_0x3a4a9b){return function(_0x498f22){if(_0x498f22){return _0x498f22['destroy']()[_0x5278('0x27')](function(){var _0x509aac=_0x498f22['get']({'plain':!![]});var _0x110491='Projects';return db[_0x5278('0x28')]['destroy']({'where':{'type':_0x110491,'resourceId':_0x509aac['id']}})[_0x5278('0x27')](function(){return _0x498f22;});})[_0x5278('0x27')](function(){_0x35eabc[_0x5278('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a438c,_0x17092b){return function(_0x242bbd){if(!_0x242bbd){_0x6a438c[_0x5278('0x1a')](0x194);}return _0x242bbd;};}function handleError(_0x4399da,_0x1da662){_0x1da662=_0x1da662||0x1f4;return function(_0x31bd0e){logger[_0x5278('0x29')](_0x31bd0e['stack']);if(_0x31bd0e['name']){delete _0x31bd0e['name'];}_0x4399da[_0x5278('0x1b')](_0x1da662)['send'](_0x31bd0e);};}exports['index']=function(_0x11f109,_0x16f8b0){var _0x4df62a={},_0x700d10={},_0x1bb83b={'count':0x0,'rows':[]};var _0x43d243=_[_0x5278('0x2a')](db[_0x5278('0x2b')][_0x5278('0x2c')],function(_0x369c55){return{'name':_0x369c55[_0x5278('0x2d')],'type':_0x369c55[_0x5278('0x2e')][_0x5278('0x2f')]};});_0x700d10[_0x5278('0x30')]=_['map'](_0x43d243,'name');_0x700d10[_0x5278('0x31')]=_[_0x5278('0x32')](_0x11f109[_0x5278('0x31')]);_0x700d10[_0x5278('0x33')]=_[_0x5278('0x34')](_0x700d10['model'],_0x700d10[_0x5278('0x31')]);_0x4df62a['attributes']=_[_0x5278('0x34')](_0x700d10[_0x5278('0x30')],qs[_0x5278('0x35')](_0x11f109[_0x5278('0x31')][_0x5278('0x35')]));_0x4df62a[_0x5278('0x36')]=_0x4df62a[_0x5278('0x36')][_0x5278('0x37')]?_0x4df62a[_0x5278('0x36')]:_0x700d10[_0x5278('0x30')];if(!_0x11f109[_0x5278('0x31')][_0x5278('0x38')](_0x5278('0x39'))){_0x4df62a['limit']=qs[_0x5278('0x21')](_0x11f109[_0x5278('0x31')][_0x5278('0x21')]);_0x4df62a[_0x5278('0x1e')]=qs[_0x5278('0x1e')](_0x11f109[_0x5278('0x31')][_0x5278('0x1e')]);}_0x4df62a[_0x5278('0x3a')]=qs[_0x5278('0x3b')](_0x11f109[_0x5278('0x31')]['sort']);_0x4df62a[_0x5278('0x3c')]=qs[_0x5278('0x33')](_['pick'](_0x11f109[_0x5278('0x31')],_0x700d10[_0x5278('0x33')]),_0x43d243);if(_0x11f109[_0x5278('0x31')][_0x5278('0x3d')]){_0x4df62a[_0x5278('0x3c')]=_[_0x5278('0x3e')](_0x4df62a[_0x5278('0x3c')],{'$or':_[_0x5278('0x2a')](_0x43d243,function(_0x3e0bce){if(_0x3e0bce[_0x5278('0x2e')]!==_0x5278('0x3f')){var _0x34e9e2={};_0x34e9e2[_0x3e0bce[_0x5278('0x40')]]={'$like':'%'+_0x11f109[_0x5278('0x31')]['filter']+'%'};return _0x34e9e2;}})});}_0x4df62a=_[_0x5278('0x3e')]({},_0x4df62a,_0x11f109[_0x5278('0x41')]);var _0x563067={'where':_0x4df62a[_0x5278('0x3c')]};return db[_0x5278('0x2b')][_0x5278('0x20')](_0x563067)[_0x5278('0x27')](function(_0x51ee24){_0x1bb83b[_0x5278('0x20')]=_0x51ee24;if(_0x11f109['query']['includeAll']){_0x4df62a['include']=[{'all':!![]}];}return db[_0x5278('0x2b')][_0x5278('0x42')](_0x4df62a);})['then'](function(_0x4844b0){_0x1bb83b['rows']=_0x4844b0;return _0x1bb83b;})[_0x5278('0x27')](respondWithFilteredResult(_0x16f8b0,_0x4df62a))[_0x5278('0x43')](handleError(_0x16f8b0,null));};exports[_0x5278('0x44')]=function(_0x166be2,_0x515e30){var _0x2c6853={'raw':![],'where':{'id':_0x166be2[_0x5278('0x45')]['id']}},_0x1fbaf7={};_0x1fbaf7[_0x5278('0x30')]=_['keys'](db['JscriptyProject'][_0x5278('0x2c')]);_0x1fbaf7[_0x5278('0x31')]=_[_0x5278('0x32')](_0x166be2[_0x5278('0x31')]);_0x1fbaf7[_0x5278('0x33')]=_[_0x5278('0x34')](_0x1fbaf7[_0x5278('0x30')],_0x1fbaf7[_0x5278('0x31')]);_0x2c6853['attributes']=_[_0x5278('0x34')](_0x1fbaf7['model'],qs[_0x5278('0x35')](_0x166be2[_0x5278('0x31')]['fields']));_0x2c6853[_0x5278('0x36')]=_0x2c6853[_0x5278('0x36')]['length']?_0x2c6853[_0x5278('0x36')]:_0x1fbaf7[_0x5278('0x30')];if(_0x166be2['query'][_0x5278('0x46')]){_0x2c6853[_0x5278('0x47')]=[{'all':!![]}];}_0x2c6853=_[_0x5278('0x3e')]({},_0x2c6853,_0x166be2['options']);return db[_0x5278('0x2b')][_0x5278('0x48')](_0x2c6853)[_0x5278('0x27')](handleEntityNotFound(_0x515e30,null))[_0x5278('0x27')](respondWithResult(_0x515e30,null))[_0x5278('0x43')](handleError(_0x515e30,null));};exports[_0x5278('0x49')]=function(_0x46972d,_0x114dde){return db['JscriptyProject'][_0x5278('0x49')](_0x46972d[_0x5278('0x4a')],{})[_0x5278('0x27')](function(_0xa48412){var _0x2b7abe=_0x46972d[_0x5278('0x4b')][_0x5278('0x4c')]({'plain':!![]});if(!_0x2b7abe)throw new Error(_0x5278('0x4d'));if(_0x2b7abe['role']===_0x5278('0x4b')){var _0x36f308=_0xa48412[_0x5278('0x4c')]({'plain':!![]});var _0x5dba67=_0x5278('0x4e');return db[_0x5278('0x4f')][_0x5278('0x48')]({'where':{'name':_0x5dba67,'userProfileId':_0x2b7abe[_0x5278('0x50')]},'raw':!![]})['then'](function(_0x54cffe){if(_0x54cffe&&_0x54cffe[_0x5278('0x51')]===0x0){return db[_0x5278('0x28')][_0x5278('0x49')]({'name':_0x36f308[_0x5278('0x40')],'resourceId':_0x36f308['id'],'type':_0x54cffe[_0x5278('0x40')],'sectionId':_0x54cffe['id']},{})[_0x5278('0x27')](function(){return _0xa48412;});}else{return _0xa48412;}})['catch'](function(_0x1cf646){logger[_0x5278('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cf646);throw _0x1cf646;});}return _0xa48412;})['then'](respondWithResult(_0x114dde,0xc9))['catch'](handleError(_0x114dde,null));};exports[_0x5278('0x52')]=function(_0x31eefe,_0x259422){var _0x34fc7c={'where':{'id':_0x31eefe[_0x5278('0x45')]['id']}},_0x245e2c={};_0x245e2c['model']=_[_0x5278('0x32')](db[_0x5278('0x2b')][_0x5278('0x2c')]);_0x34fc7c[_0x5278('0x36')]=_['intersection'](_0x245e2c[_0x5278('0x30')],qs[_0x5278('0x35')](_0x31eefe[_0x5278('0x31')][_0x5278('0x35')]));_0x34fc7c[_0x5278('0x36')]=_0x34fc7c[_0x5278('0x36')][_0x5278('0x37')]?_0x34fc7c[_0x5278('0x36')]:_0x245e2c[_0x5278('0x30')];if(_0x31eefe[_0x5278('0x31')][_0x5278('0x46')]){_0x34fc7c[_0x5278('0x47')]=[{'all':!![]}];}_0x34fc7c=_['merge']({},_0x34fc7c,_0x31eefe['options']);return db['JscriptyProject'][_0x5278('0x48')](_0x34fc7c)[_0x5278('0x27')](handleEntityNotFound(_0x259422,null))[_0x5278('0x27')](function(_0x1ae552){if(_0x1ae552){var _0x137c0c=_0x1ae552[_0x5278('0x4c')]({'plain':!![]});_0x137c0c=qs['omit'](_0x137c0c,['id','createdAt',_0x5278('0x53')]);_0x31eefe['body']=_['omit'](_0x31eefe[_0x5278('0x4a')],['id',_0x5278('0x54'),_0x5278('0x53')]);return db[_0x5278('0x2b')][_0x5278('0x49')](_[_0x5278('0x3e')](_0x137c0c,_0x31eefe[_0x5278('0x4a')]),{'include':_0x31eefe[_0x5278('0x31')][_0x5278('0x46')]?[{'all':!![]}]:undefined})[_0x5278('0x27')](function(_0x295af4){var _0x8eb03f=_0x31eefe['user']['get']({'plain':!![]});if(!_0x8eb03f)throw new Error(_0x5278('0x4d'));if(_0x8eb03f['role']===_0x5278('0x4b')){var _0x2bee1b=_0x295af4[_0x5278('0x4c')]({'plain':!![]});var _0x3f225d=_0x5278('0x4e');return db['UserProfileSection'][_0x5278('0x48')]({'where':{'name':_0x3f225d,'userProfileId':_0x8eb03f['userProfileId']},'raw':!![]})[_0x5278('0x27')](function(_0x1533a9){if(_0x1533a9&&_0x1533a9[_0x5278('0x51')]===0x0){return db[_0x5278('0x28')][_0x5278('0x49')]({'name':_0x2bee1b['name'],'resourceId':_0x2bee1b['id'],'type':_0x1533a9[_0x5278('0x40')],'sectionId':_0x1533a9['id']},{})[_0x5278('0x27')](function(){return _0x295af4;});}else{return _0x295af4;}})[_0x5278('0x43')](function(_0x14bd8d){logger[_0x5278('0x29')](_0x5278('0x55'),_0x14bd8d);throw _0x14bd8d;});}return _0x295af4;});}})[_0x5278('0x27')](respondWithResult(_0x259422,0xc9))['catch'](handleError(_0x259422,null));};exports[_0x5278('0x26')]=function(_0x15f1f1,_0x1ae0e2){if(_0x15f1f1['body']['id']){delete _0x15f1f1[_0x5278('0x4a')]['id'];}return db[_0x5278('0x2b')][_0x5278('0x48')]({'where':{'id':_0x15f1f1[_0x5278('0x45')]['id']}})[_0x5278('0x27')](handleEntityNotFound(_0x1ae0e2,null))[_0x5278('0x27')](saveUpdates(_0x15f1f1[_0x5278('0x4a')],null))[_0x5278('0x27')](respondWithResult(_0x1ae0e2,null))[_0x5278('0x43')](handleError(_0x1ae0e2,null));};exports[_0x5278('0x56')]=function(_0x26bb81,_0x26925f){return db[_0x5278('0x2b')]['find']({'where':{'id':_0x26bb81[_0x5278('0x45')]['id']}})['then'](handleEntityNotFound(_0x26925f,null))[_0x5278('0x27')](removeEntity(_0x26925f,null))[_0x5278('0x43')](handleError(_0x26925f,null));};exports[_0x5278('0x57')]=function(_0x210cbb,_0x216b9e,_0x37a6de){var _0x42dc05={'raw':!![],'where':{}};var _0x1d1e5b={};var _0x446e46={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5278('0x58')]({'where':{'id':_0x210cbb[_0x5278('0x45')]['id']}})[_0x5278('0x27')](handleEntityNotFound(_0x216b9e,null))[_0x5278('0x27')](function(_0x1f20c9){if(_0x1f20c9){_0x1d1e5b['model']=_[_0x5278('0x32')](db[_0x5278('0x59')][_0x5278('0x2c')]);_0x1d1e5b[_0x5278('0x31')]=_[_0x5278('0x32')](_0x210cbb['query']);_0x1d1e5b[_0x5278('0x33')]=_[_0x5278('0x34')](_0x1d1e5b[_0x5278('0x30')],_0x1d1e5b['query']);_0x42dc05[_0x5278('0x36')]=_['intersection'](_0x1d1e5b['model'],qs[_0x5278('0x35')](_0x210cbb[_0x5278('0x31')][_0x5278('0x35')]));_0x42dc05[_0x5278('0x36')]=_0x42dc05['attributes'][_0x5278('0x37')]?_0x42dc05[_0x5278('0x36')]:_0x1d1e5b[_0x5278('0x30')];if(!_0x210cbb[_0x5278('0x31')]['hasOwnProperty'](_0x5278('0x39'))){_0x42dc05[_0x5278('0x21')]=qs[_0x5278('0x21')](_0x210cbb[_0x5278('0x31')]['limit']);_0x42dc05[_0x5278('0x1e')]=qs['offset'](_0x210cbb[_0x5278('0x31')][_0x5278('0x1e')]);}_0x42dc05['order']=qs[_0x5278('0x3b')](_0x210cbb[_0x5278('0x31')]['sort']);_0x42dc05['where']=qs[_0x5278('0x33')](_['pick'](_0x210cbb[_0x5278('0x31')],_0x1d1e5b[_0x5278('0x33')]));_0x42dc05[_0x5278('0x3c')][_0x5278('0x5a')]=_0x1f20c9['id'];if(_0x210cbb[_0x5278('0x31')][_0x5278('0x3d')]){_0x42dc05[_0x5278('0x3c')]=_[_0x5278('0x3e')](_0x42dc05[_0x5278('0x3c')],{'$or':_['map'](_0x42dc05[_0x5278('0x36')],function(_0x2c59a5){var _0x5870b5={};_0x5870b5[_0x2c59a5]={'$like':'%'+_0x210cbb[_0x5278('0x31')][_0x5278('0x3d')]+'%'};return _0x5870b5;})});}_0x42dc05=_[_0x5278('0x3e')]({},_0x42dc05,_0x210cbb[_0x5278('0x41')]);return db[_0x5278('0x59')][_0x5278('0x20')]({'where':_0x42dc05['where']})[_0x5278('0x27')](function(_0x2d4287){_0x446e46[_0x5278('0x20')]=_0x2d4287;if(_0x210cbb[_0x5278('0x31')][_0x5278('0x46')]){_0x42dc05[_0x5278('0x47')]=[{'all':!![]}];}return db[_0x5278('0x59')]['findAll'](_0x42dc05);})[_0x5278('0x27')](function(_0x4ce653){_0x446e46[_0x5278('0x5b')]=_0x4ce653;return _0x446e46;});}})[_0x5278('0x27')](respondWithFilteredResult(_0x216b9e,_0x42dc05))[_0x5278('0x43')](handleError(_0x216b9e,null));};exports[_0x5278('0x5c')]=function(_0x2c020e,_0x33c14b,_0x458ce5){var _0x517e82={'raw':!![],'where':{}};var _0x5dc829={};var _0x5a6de3={'count':0x0,'rows':[]};return db[_0x5278('0x2b')][_0x5278('0x58')]({'where':{'id':_0x2c020e[_0x5278('0x45')]['id']}})[_0x5278('0x27')](handleEntityNotFound(_0x33c14b,null))['then'](function(_0x528309){if(_0x528309){_0x5dc829[_0x5278('0x30')]=_[_0x5278('0x32')](db[_0x5278('0x5d')][_0x5278('0x2c')]);_0x5dc829[_0x5278('0x31')]=_[_0x5278('0x32')](_0x2c020e['query']);_0x5dc829[_0x5278('0x33')]=_['intersection'](_0x5dc829[_0x5278('0x30')],_0x5dc829['query']);_0x517e82[_0x5278('0x36')]=_[_0x5278('0x34')](_0x5dc829[_0x5278('0x30')],qs['fields'](_0x2c020e[_0x5278('0x31')][_0x5278('0x35')]));_0x517e82[_0x5278('0x36')]=_0x517e82[_0x5278('0x36')][_0x5278('0x37')]?_0x517e82['attributes']:_0x5dc829['model'];if(!_0x2c020e[_0x5278('0x31')][_0x5278('0x38')](_0x5278('0x39'))){_0x517e82[_0x5278('0x21')]=qs['limit'](_0x2c020e['query']['limit']);_0x517e82['offset']=qs[_0x5278('0x1e')](_0x2c020e[_0x5278('0x31')][_0x5278('0x1e')]);}_0x517e82['order']=qs['sort'](_0x2c020e['query']['sort']);_0x517e82[_0x5278('0x3c')]=qs[_0x5278('0x33')](_[_0x5278('0x5e')](_0x2c020e[_0x5278('0x31')],_0x5dc829['filters']));_0x517e82[_0x5278('0x3c')][_0x5278('0x5a')]=_0x528309['id'];if(_0x2c020e['query'][_0x5278('0x3d')]){_0x517e82[_0x5278('0x3c')]=_[_0x5278('0x3e')](_0x517e82[_0x5278('0x3c')],{'$or':_[_0x5278('0x2a')](_0x517e82[_0x5278('0x36')],function(_0x12913e){var _0x3e6c03={};_0x3e6c03[_0x12913e]={'$like':'%'+_0x2c020e[_0x5278('0x31')][_0x5278('0x3d')]+'%'};return _0x3e6c03;})});}_0x517e82=_['merge']({},_0x517e82,_0x2c020e['options']);return db[_0x5278('0x5d')][_0x5278('0x20')]({'where':_0x517e82[_0x5278('0x3c')]})[_0x5278('0x27')](function(_0x4c05d6){_0x5a6de3[_0x5278('0x20')]=_0x4c05d6;if(_0x2c020e[_0x5278('0x31')][_0x5278('0x46')]){_0x517e82[_0x5278('0x47')]=[{'all':!![]}];}return db[_0x5278('0x5d')][_0x5278('0x42')](_0x517e82);})[_0x5278('0x27')](function(_0x462a87){_0x5a6de3['rows']=_0x462a87;return _0x5a6de3;});}})[_0x5278('0x27')](respondWithFilteredResult(_0x33c14b,_0x517e82))[_0x5278('0x43')](handleError(_0x33c14b,null));};function char(_0x4e50ec){return _0x5278('0x5f')===typeof _0x4e50ec?String[_0x5278('0x60')]['apply'](null,arguments):_0x4e50ec;}function needsEncapsulation(_0x4315c5){return!!_0x4315c5&&(_0x4315c5['toString']()[_0x5278('0x61')](char(0xd))>=0x0||_0x4315c5[_0x5278('0x62')]()['indexOf'](char(0xa))>=0x0||_0x4315c5[_0x5278('0x62')]()[_0x5278('0x61')](char(0x2c))>=0x0||_0x4315c5[_0x5278('0x62')]()[_0x5278('0x61')](char(0x22))>=0x0);}function encapsulate(_0x1408fa){var _0x5dbacd=char(0x22),_0x2e3c0e='\x5c'+char(0x22),_0x242422=_0x1408fa[_0x5278('0x62')]()[_0x5278('0x63')](new RegExp(_0x5dbacd,'g'),_0x2e3c0e);return _0x5dbacd+_0x242422+_0x5dbacd;}exports[_0x5278('0x64')]=function(_0x35d82d,_0x22a45c,_0x3e6f5a){var _0x5477ca,_0x50f412;var _0x2d1a4b={'where':{'ProjectId':_0x35d82d[_0x5278('0x45')]['id']}};if(_0x35d82d[_0x5278('0x31')][_0x5278('0x65')]){_0x2d1a4b[_0x5278('0x3c')]['starttime']=JSON['parse'](_0x35d82d[_0x5278('0x31')][_0x5278('0x65')]);}return db[_0x5278('0x59')][_0x5278('0x42')](_0x2d1a4b)[_0x5278('0x27')](handleEntityNotFound(_0x22a45c,null))[_0x5278('0x27')](function(_0x51d2b0){if(_0x51d2b0){_0x5477ca=_0x51d2b0;return db[_0x5278('0x66')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x5477ca,'id')},'ProjectId':_0x35d82d[_0x5278('0x45')]['id']},'order':_0x5278('0x67')});}})[_0x5278('0x27')](handleEntityNotFound(_0x22a45c,null))[_0x5278('0x27')](function(_0x26b10a){if(_0x26b10a){_0x50f412=_0x26b10a;var _0x6aafff={};for(var _0x4c0211=0x0,_0x315de5=_0x50f412[_0x5278('0x37')];_0x4c0211<_0x315de5;_0x4c0211++){if(!_0x6aafff[_0x5278('0x38')](_0x50f412[_0x4c0211][_0x5278('0x68')])){_0x6aafff[_0x50f412[_0x4c0211][_0x5278('0x68')]]=needsEncapsulation(_0x50f412[_0x4c0211]['question'])?encapsulate(_0x50f412[_0x4c0211][_0x5278('0x69')]):_0x50f412[_0x4c0211][_0x5278('0x69')];}}var _0x11aaec=[],_0x19c8ec={};for(var _0x2e17c1=0x0,_0x48520=_0x5477ca[_0x5278('0x37')];_0x2e17c1<_0x48520;_0x2e17c1++){_0x19c8ec={'ProjectId':_0x35d82d['params']['id'],'SessionId':_0x5477ca[_0x2e17c1]['id'],'StartTime':moment(_0x5477ca[_0x2e17c1][_0x5278('0x6a')])['format'](_0x5278('0x6b'))};for(var _0x31e633=0x0,_0x538b38=_0x50f412['length'];_0x31e633<_0x538b38;_0x31e633++){if(_0x50f412[_0x31e633][_0x5278('0x6c')]==_0x5477ca[_0x2e17c1]['id']&&_0x6aafff[_0x5278('0x38')](_0x50f412[_0x31e633]['questionId'])){_0x19c8ec[_0x6aafff[_0x50f412[_0x31e633][_0x5278('0x68')]]]=_0x50f412[_0x31e633][_0x5278('0x6d')];}}for(var _0x50d625 in _0x6aafff){if(!_0x19c8ec[_0x5278('0x38')](_0x6aafff[_0x50d625])){_0x19c8ec[_0x6aafff[_0x50d625]]=null;}}_0x11aaec['push'](_0x19c8ec);}return _0x11aaec;}})[_0x5278('0x27')](function(_0xbe6db){if(!_[_0x5278('0x6e')](_0xbe6db)){var _0x53d701=toCsv(_0xbe6db);var _0x552c4a=Date[_0x5278('0x6f')]();fs[_0x5278('0x70')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x35d82d[_0x5278('0x45')]['id'],_0x552c4a),_0x53d701);_0x22a45c[_0x5278('0x71')]('Content-disposition',_0x5278('0x72')+util['format'](_0x5278('0x73'),_0x35d82d[_0x5278('0x45')]['id'],_0x552c4a));_0x22a45c[_0x5278('0x71')]('Content-type',_0x5278('0x74'));return _0x22a45c['download'](util[_0x5278('0x75')](_0x5278('0x76'),_0x35d82d[_0x5278('0x45')]['id'],_0x552c4a));}else{return _0x22a45c[_0x5278('0x1a')](0xcc);}})[_0x5278('0x43')](handleError(_0x22a45c,null));}; \ No newline at end of file +var _0xa0a3=['JscriptyQuestionReport','-createdAt','questionId','question','SessionId','answer','isEmpty','now','format','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getSessions','JscriptySessionReport','nolimit','order','ProjectId','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime'];(function(_0x3325f3,_0x1a7c46){var _0x5af307=function(_0x338bbe){while(--_0x338bbe){_0x3325f3['push'](_0x3325f3['shift']());}};_0x5af307(++_0x1a7c46);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x5e977f,_0x4b32bf){_0x5e977f=_0x5e977f-0x0;var _0x5c11dd=_0xa0a3[_0x5e977f];return _0x5c11dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a0a('0x0'));var zipdir=require(_0x3a0a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a0a('0x2'));var moment=require(_0x3a0a('0x3'));var BPromise=require(_0x3a0a('0x4'));var Mustache=require(_0x3a0a('0x5'));var util=require(_0x3a0a('0x6'));var path=require(_0x3a0a('0x7'));var sox=require(_0x3a0a('0x8'));var csv=require(_0x3a0a('0x9'));var ejs=require(_0x3a0a('0xa'));var fs=require('fs');var fs_extra=require(_0x3a0a('0xb'));var _=require(_0x3a0a('0xc'));var squel=require(_0x3a0a('0xd'));var crypto=require(_0x3a0a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3a0a('0x9'));var querystring=require(_0x3a0a('0xf'));var Papa=require(_0x3a0a('0x10'));var Redis=require(_0x3a0a('0x11'));var authService=require(_0x3a0a('0x12'));var qs=require(_0x3a0a('0x13'));var as=require(_0x3a0a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a0a('0x15'));var utils=require(_0x3a0a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3a0a('0x17'))['db'];function respondWithStatusCode(_0x1db53c,_0x52cb58){_0x52cb58=_0x52cb58||0xcc;return function(_0x2243d2){if(_0x2243d2){return _0x1db53c[_0x3a0a('0x18')](_0x52cb58);}return _0x1db53c[_0x3a0a('0x19')](_0x52cb58)[_0x3a0a('0x1a')]();};}function respondWithResult(_0x977120,_0x303dc7){_0x303dc7=_0x303dc7||0xc8;return function(_0x350d58){if(_0x350d58){return _0x977120[_0x3a0a('0x19')](_0x303dc7)[_0x3a0a('0x1b')](_0x350d58);}};}function respondWithFilteredResult(_0x21e0f7,_0x11eeee){return function(_0x22a60e){if(_0x22a60e){var _0x52f629=typeof _0x11eeee[_0x3a0a('0x1c')]==='undefined'&&typeof _0x11eeee[_0x3a0a('0x1d')]==='undefined';var _0x2f5e77=_0x22a60e[_0x3a0a('0x1e')];var _0x36582f=_0x52f629?0x0:_0x11eeee['offset'];var _0x104679=_0x52f629?_0x22a60e[_0x3a0a('0x1e')]:_0x11eeee['offset']+_0x11eeee[_0x3a0a('0x1d')];var _0x26f7bb;if(_0x104679>=_0x2f5e77){_0x104679=_0x2f5e77;_0x26f7bb=0xc8;}else{_0x26f7bb=0xce;}_0x21e0f7[_0x3a0a('0x19')](_0x26f7bb);return _0x21e0f7[_0x3a0a('0x1f')](_0x3a0a('0x20'),_0x36582f+'-'+_0x104679+'/'+_0x2f5e77)[_0x3a0a('0x1b')](_0x22a60e);}return null;};}function patchUpdates(_0x3e99f9){return function(_0x231541){try{jsonpatch[_0x3a0a('0x21')](_0x231541,_0x3e99f9,!![]);}catch(_0x430509){return BPromise['reject'](_0x430509);}return _0x231541['save']();};}function saveUpdates(_0x483039,_0x33560b){return function(_0x6681b2){if(_0x6681b2){return _0x6681b2[_0x3a0a('0x22')](_0x483039)[_0x3a0a('0x23')](function(_0x1468a9){return _0x1468a9;});}return null;};}function removeEntity(_0x49d60d,_0x280022){return function(_0x1d2eac){if(_0x1d2eac){return _0x1d2eac[_0x3a0a('0x24')]()['then'](function(){var _0x3a5955=_0x1d2eac[_0x3a0a('0x25')]({'plain':!![]});var _0x496348='Projects';return db[_0x3a0a('0x26')][_0x3a0a('0x24')]({'where':{'type':_0x496348,'resourceId':_0x3a5955['id']}})[_0x3a0a('0x23')](function(){return _0x1d2eac;});})['then'](function(){_0x49d60d[_0x3a0a('0x19')](0xcc)[_0x3a0a('0x1a')]();});}};}function handleEntityNotFound(_0x130ca6,_0x188027){return function(_0x122e65){if(!_0x122e65){_0x130ca6['sendStatus'](0x194);}return _0x122e65;};}function handleError(_0x4a5481,_0x453040){_0x453040=_0x453040||0x1f4;return function(_0x3d01d8){logger['error'](_0x3d01d8['stack']);if(_0x3d01d8[_0x3a0a('0x27')]){delete _0x3d01d8[_0x3a0a('0x27')];}_0x4a5481[_0x3a0a('0x19')](_0x453040)[_0x3a0a('0x28')](_0x3d01d8);};}exports['index']=function(_0x5d7760,_0x38aaa0){var _0x23dd57={},_0x177181={},_0x4c99f9={'count':0x0,'rows':[]};var _0x1418b6=_[_0x3a0a('0x29')](db[_0x3a0a('0x2a')][_0x3a0a('0x2b')],function(_0x10b09f){return{'name':_0x10b09f[_0x3a0a('0x2c')],'type':_0x10b09f[_0x3a0a('0x2d')][_0x3a0a('0x2e')]};});_0x177181[_0x3a0a('0x2f')]=_['map'](_0x1418b6,_0x3a0a('0x27'));_0x177181[_0x3a0a('0x30')]=_[_0x3a0a('0x31')](_0x5d7760[_0x3a0a('0x30')]);_0x177181[_0x3a0a('0x32')]=_['intersection'](_0x177181[_0x3a0a('0x2f')],_0x177181[_0x3a0a('0x30')]);_0x23dd57[_0x3a0a('0x33')]=_[_0x3a0a('0x34')](_0x177181[_0x3a0a('0x2f')],qs[_0x3a0a('0x35')](_0x5d7760['query'][_0x3a0a('0x35')]));_0x23dd57[_0x3a0a('0x33')]=_0x23dd57[_0x3a0a('0x33')][_0x3a0a('0x36')]?_0x23dd57[_0x3a0a('0x33')]:_0x177181[_0x3a0a('0x2f')];if(!_0x5d7760[_0x3a0a('0x30')][_0x3a0a('0x37')]('nolimit')){_0x23dd57[_0x3a0a('0x1d')]=qs[_0x3a0a('0x1d')](_0x5d7760[_0x3a0a('0x30')][_0x3a0a('0x1d')]);_0x23dd57[_0x3a0a('0x1c')]=qs[_0x3a0a('0x1c')](_0x5d7760[_0x3a0a('0x30')][_0x3a0a('0x1c')]);}_0x23dd57['order']=qs[_0x3a0a('0x38')](_0x5d7760[_0x3a0a('0x30')][_0x3a0a('0x38')]);_0x23dd57[_0x3a0a('0x39')]=qs[_0x3a0a('0x32')](_[_0x3a0a('0x3a')](_0x5d7760[_0x3a0a('0x30')],_0x177181[_0x3a0a('0x32')]),_0x1418b6);if(_0x5d7760[_0x3a0a('0x30')]['filter']){_0x23dd57[_0x3a0a('0x39')]=_['merge'](_0x23dd57[_0x3a0a('0x39')],{'$or':_[_0x3a0a('0x29')](_0x1418b6,function(_0x17b5b3){if(_0x17b5b3[_0x3a0a('0x2d')]!=='VIRTUAL'){var _0x425c95={};_0x425c95[_0x17b5b3['name']]={'$like':'%'+_0x5d7760[_0x3a0a('0x30')][_0x3a0a('0x3b')]+'%'};return _0x425c95;}})});}_0x23dd57=_[_0x3a0a('0x3c')]({},_0x23dd57,_0x5d7760[_0x3a0a('0x3d')]);var _0x4d32f8={'where':_0x23dd57[_0x3a0a('0x39')]};return db['JscriptyProject']['count'](_0x4d32f8)[_0x3a0a('0x23')](function(_0x4f9b60){_0x4c99f9['count']=_0x4f9b60;if(_0x5d7760[_0x3a0a('0x30')][_0x3a0a('0x3e')]){_0x23dd57['include']=[{'all':!![]}];}return db[_0x3a0a('0x2a')][_0x3a0a('0x3f')](_0x23dd57);})[_0x3a0a('0x23')](function(_0xd16d0){_0x4c99f9[_0x3a0a('0x40')]=_0xd16d0;return _0x4c99f9;})['then'](respondWithFilteredResult(_0x38aaa0,_0x23dd57))[_0x3a0a('0x41')](handleError(_0x38aaa0,null));};exports[_0x3a0a('0x42')]=function(_0x2b4a6b,_0x34ea81){var _0x45e170={'raw':![],'where':{'id':_0x2b4a6b[_0x3a0a('0x43')]['id']}},_0x34e633={};_0x34e633[_0x3a0a('0x2f')]=_['keys'](db['JscriptyProject'][_0x3a0a('0x2b')]);_0x34e633[_0x3a0a('0x30')]=_[_0x3a0a('0x31')](_0x2b4a6b['query']);_0x34e633[_0x3a0a('0x32')]=_[_0x3a0a('0x34')](_0x34e633[_0x3a0a('0x2f')],_0x34e633[_0x3a0a('0x30')]);_0x45e170['attributes']=_[_0x3a0a('0x34')](_0x34e633['model'],qs[_0x3a0a('0x35')](_0x2b4a6b['query'][_0x3a0a('0x35')]));_0x45e170['attributes']=_0x45e170[_0x3a0a('0x33')][_0x3a0a('0x36')]?_0x45e170['attributes']:_0x34e633['model'];if(_0x2b4a6b[_0x3a0a('0x30')][_0x3a0a('0x3e')]){_0x45e170[_0x3a0a('0x44')]=[{'all':!![]}];}_0x45e170=_[_0x3a0a('0x3c')]({},_0x45e170,_0x2b4a6b[_0x3a0a('0x3d')]);return db[_0x3a0a('0x2a')]['find'](_0x45e170)['then'](handleEntityNotFound(_0x34ea81,null))[_0x3a0a('0x23')](respondWithResult(_0x34ea81,null))[_0x3a0a('0x41')](handleError(_0x34ea81,null));};exports['create']=function(_0x48aa92,_0x1ef695){return db['JscriptyProject'][_0x3a0a('0x45')](_0x48aa92[_0x3a0a('0x46')],{})[_0x3a0a('0x23')](function(_0x34677a){var _0x385f83=_0x48aa92[_0x3a0a('0x47')]['get']({'plain':!![]});if(!_0x385f83)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x385f83[_0x3a0a('0x48')]===_0x3a0a('0x47')){var _0x201dca=_0x34677a[_0x3a0a('0x25')]({'plain':!![]});var _0x26f46c='Projects';return db[_0x3a0a('0x49')][_0x3a0a('0x4a')]({'where':{'name':_0x26f46c,'userProfileId':_0x385f83['userProfileId']},'raw':!![]})['then'](function(_0x37d62d){if(_0x37d62d&&_0x37d62d[_0x3a0a('0x4b')]===0x0){return db[_0x3a0a('0x26')][_0x3a0a('0x45')]({'name':_0x201dca[_0x3a0a('0x27')],'resourceId':_0x201dca['id'],'type':_0x37d62d[_0x3a0a('0x27')],'sectionId':_0x37d62d['id']},{})[_0x3a0a('0x23')](function(){return _0x34677a;});}else{return _0x34677a;}})['catch'](function(_0x2905b7){logger[_0x3a0a('0x4c')](_0x3a0a('0x4d'),_0x2905b7);throw _0x2905b7;});}return _0x34677a;})[_0x3a0a('0x23')](respondWithResult(_0x1ef695,0xc9))[_0x3a0a('0x41')](handleError(_0x1ef695,null));};exports[_0x3a0a('0x4e')]=function(_0x93e846,_0x2ebdec){var _0x2cc478={'where':{'id':_0x93e846[_0x3a0a('0x43')]['id']}},_0x3fe96a={};_0x3fe96a[_0x3a0a('0x2f')]=_[_0x3a0a('0x31')](db['JscriptyProject'][_0x3a0a('0x2b')]);_0x2cc478[_0x3a0a('0x33')]=_[_0x3a0a('0x34')](_0x3fe96a['model'],qs['fields'](_0x93e846[_0x3a0a('0x30')][_0x3a0a('0x35')]));_0x2cc478[_0x3a0a('0x33')]=_0x2cc478['attributes']['length']?_0x2cc478[_0x3a0a('0x33')]:_0x3fe96a[_0x3a0a('0x2f')];if(_0x93e846[_0x3a0a('0x30')]['includeAll']){_0x2cc478[_0x3a0a('0x44')]=[{'all':!![]}];}_0x2cc478=_[_0x3a0a('0x3c')]({},_0x2cc478,_0x93e846[_0x3a0a('0x3d')]);return db[_0x3a0a('0x2a')][_0x3a0a('0x4a')](_0x2cc478)['then'](handleEntityNotFound(_0x2ebdec,null))[_0x3a0a('0x23')](function(_0x5d3081){if(_0x5d3081){var _0x40df97=_0x5d3081[_0x3a0a('0x25')]({'plain':!![]});_0x40df97=qs[_0x3a0a('0x4f')](_0x40df97,['id',_0x3a0a('0x50'),'updatedAt']);_0x93e846[_0x3a0a('0x46')]=_['omit'](_0x93e846[_0x3a0a('0x46')],['id',_0x3a0a('0x50'),_0x3a0a('0x51')]);return db[_0x3a0a('0x2a')][_0x3a0a('0x45')](_[_0x3a0a('0x3c')](_0x40df97,_0x93e846[_0x3a0a('0x46')]),{'include':_0x93e846[_0x3a0a('0x30')][_0x3a0a('0x3e')]?[{'all':!![]}]:undefined})[_0x3a0a('0x23')](function(_0x25a7c8){var _0x8e7485=_0x93e846[_0x3a0a('0x47')][_0x3a0a('0x25')]({'plain':!![]});if(!_0x8e7485)throw new Error(_0x3a0a('0x52'));if(_0x8e7485[_0x3a0a('0x48')]===_0x3a0a('0x47')){var _0x3c8166=_0x25a7c8[_0x3a0a('0x25')]({'plain':!![]});var _0x182ba6='Projects';return db[_0x3a0a('0x49')][_0x3a0a('0x4a')]({'where':{'name':_0x182ba6,'userProfileId':_0x8e7485[_0x3a0a('0x53')]},'raw':!![]})[_0x3a0a('0x23')](function(_0x2c807a){if(_0x2c807a&&_0x2c807a[_0x3a0a('0x4b')]===0x0){return db[_0x3a0a('0x26')][_0x3a0a('0x45')]({'name':_0x3c8166[_0x3a0a('0x27')],'resourceId':_0x3c8166['id'],'type':_0x2c807a[_0x3a0a('0x27')],'sectionId':_0x2c807a['id']},{})[_0x3a0a('0x23')](function(){return _0x25a7c8;});}else{return _0x25a7c8;}})[_0x3a0a('0x41')](function(_0x1a3227){logger[_0x3a0a('0x4c')](_0x3a0a('0x4d'),_0x1a3227);throw _0x1a3227;});}return _0x25a7c8;});}})['then'](respondWithResult(_0x2ebdec,0xc9))['catch'](handleError(_0x2ebdec,null));};exports['update']=function(_0x21b82c,_0x4ba52b){if(_0x21b82c[_0x3a0a('0x46')]['id']){delete _0x21b82c['body']['id'];}return db[_0x3a0a('0x2a')]['find']({'where':{'id':_0x21b82c[_0x3a0a('0x43')]['id']}})[_0x3a0a('0x23')](handleEntityNotFound(_0x4ba52b,null))['then'](saveUpdates(_0x21b82c[_0x3a0a('0x46')],null))['then'](respondWithResult(_0x4ba52b,null))[_0x3a0a('0x41')](handleError(_0x4ba52b,null));};exports[_0x3a0a('0x24')]=function(_0x2474ff,_0x2b0507){return db[_0x3a0a('0x2a')][_0x3a0a('0x4a')]({'where':{'id':_0x2474ff['params']['id']}})[_0x3a0a('0x23')](handleEntityNotFound(_0x2b0507,null))[_0x3a0a('0x23')](removeEntity(_0x2b0507,null))[_0x3a0a('0x41')](handleError(_0x2b0507,null));};exports[_0x3a0a('0x54')]=function(_0x476e45,_0x34f09a,_0x23836c){var _0x5404a9={'raw':!![],'where':{}};var _0x53f68e={};var _0x183e88={'count':0x0,'rows':[]};return db[_0x3a0a('0x2a')]['findOne']({'where':{'id':_0x476e45[_0x3a0a('0x43')]['id']}})[_0x3a0a('0x23')](handleEntityNotFound(_0x34f09a,null))['then'](function(_0x535379){if(_0x535379){_0x53f68e['model']=_[_0x3a0a('0x31')](db[_0x3a0a('0x55')]['rawAttributes']);_0x53f68e[_0x3a0a('0x30')]=_['keys'](_0x476e45[_0x3a0a('0x30')]);_0x53f68e[_0x3a0a('0x32')]=_[_0x3a0a('0x34')](_0x53f68e[_0x3a0a('0x2f')],_0x53f68e[_0x3a0a('0x30')]);_0x5404a9[_0x3a0a('0x33')]=_[_0x3a0a('0x34')](_0x53f68e[_0x3a0a('0x2f')],qs['fields'](_0x476e45['query']['fields']));_0x5404a9[_0x3a0a('0x33')]=_0x5404a9[_0x3a0a('0x33')]['length']?_0x5404a9[_0x3a0a('0x33')]:_0x53f68e[_0x3a0a('0x2f')];if(!_0x476e45[_0x3a0a('0x30')][_0x3a0a('0x37')](_0x3a0a('0x56'))){_0x5404a9['limit']=qs[_0x3a0a('0x1d')](_0x476e45[_0x3a0a('0x30')][_0x3a0a('0x1d')]);_0x5404a9[_0x3a0a('0x1c')]=qs['offset'](_0x476e45[_0x3a0a('0x30')][_0x3a0a('0x1c')]);}_0x5404a9[_0x3a0a('0x57')]=qs[_0x3a0a('0x38')](_0x476e45['query'][_0x3a0a('0x38')]);_0x5404a9[_0x3a0a('0x39')]=qs[_0x3a0a('0x32')](_[_0x3a0a('0x3a')](_0x476e45[_0x3a0a('0x30')],_0x53f68e['filters']));_0x5404a9[_0x3a0a('0x39')][_0x3a0a('0x58')]=_0x535379['id'];if(_0x476e45[_0x3a0a('0x30')][_0x3a0a('0x3b')]){_0x5404a9[_0x3a0a('0x39')]=_['merge'](_0x5404a9[_0x3a0a('0x39')],{'$or':_[_0x3a0a('0x29')](_0x5404a9['attributes'],function(_0x3872a3){var _0x27187b={};_0x27187b[_0x3872a3]={'$like':'%'+_0x476e45[_0x3a0a('0x30')]['filter']+'%'};return _0x27187b;})});}_0x5404a9=_[_0x3a0a('0x3c')]({},_0x5404a9,_0x476e45[_0x3a0a('0x3d')]);return db['JscriptySessionReport'][_0x3a0a('0x1e')]({'where':_0x5404a9[_0x3a0a('0x39')]})['then'](function(_0x226331){_0x183e88[_0x3a0a('0x1e')]=_0x226331;if(_0x476e45[_0x3a0a('0x30')]['includeAll']){_0x5404a9['include']=[{'all':!![]}];}return db[_0x3a0a('0x55')][_0x3a0a('0x3f')](_0x5404a9);})[_0x3a0a('0x23')](function(_0xfa7c6a){_0x183e88[_0x3a0a('0x40')]=_0xfa7c6a;return _0x183e88;});}})[_0x3a0a('0x23')](respondWithFilteredResult(_0x34f09a,_0x5404a9))[_0x3a0a('0x41')](handleError(_0x34f09a,null));};exports['getAnswers']=function(_0x37521a,_0x27315d,_0x426ae5){var _0x4a9744={'raw':!![],'where':{}};var _0x26b9a2={};var _0x489e7f={'count':0x0,'rows':[]};return db[_0x3a0a('0x2a')][_0x3a0a('0x59')]({'where':{'id':_0x37521a[_0x3a0a('0x43')]['id']}})[_0x3a0a('0x23')](handleEntityNotFound(_0x27315d,null))['then'](function(_0x479733){if(_0x479733){_0x26b9a2['model']=_['keys'](db['JscriptyAnswerReport'][_0x3a0a('0x2b')]);_0x26b9a2[_0x3a0a('0x30')]=_[_0x3a0a('0x31')](_0x37521a[_0x3a0a('0x30')]);_0x26b9a2[_0x3a0a('0x32')]=_['intersection'](_0x26b9a2[_0x3a0a('0x2f')],_0x26b9a2[_0x3a0a('0x30')]);_0x4a9744[_0x3a0a('0x33')]=_[_0x3a0a('0x34')](_0x26b9a2[_0x3a0a('0x2f')],qs[_0x3a0a('0x35')](_0x37521a[_0x3a0a('0x30')][_0x3a0a('0x35')]));_0x4a9744[_0x3a0a('0x33')]=_0x4a9744[_0x3a0a('0x33')][_0x3a0a('0x36')]?_0x4a9744[_0x3a0a('0x33')]:_0x26b9a2[_0x3a0a('0x2f')];if(!_0x37521a[_0x3a0a('0x30')][_0x3a0a('0x37')](_0x3a0a('0x56'))){_0x4a9744[_0x3a0a('0x1d')]=qs[_0x3a0a('0x1d')](_0x37521a['query'][_0x3a0a('0x1d')]);_0x4a9744['offset']=qs[_0x3a0a('0x1c')](_0x37521a[_0x3a0a('0x30')]['offset']);}_0x4a9744[_0x3a0a('0x57')]=qs[_0x3a0a('0x38')](_0x37521a[_0x3a0a('0x30')][_0x3a0a('0x38')]);_0x4a9744[_0x3a0a('0x39')]=qs['filters'](_[_0x3a0a('0x3a')](_0x37521a[_0x3a0a('0x30')],_0x26b9a2[_0x3a0a('0x32')]));_0x4a9744[_0x3a0a('0x39')][_0x3a0a('0x58')]=_0x479733['id'];if(_0x37521a['query'][_0x3a0a('0x3b')]){_0x4a9744['where']=_[_0x3a0a('0x3c')](_0x4a9744[_0x3a0a('0x39')],{'$or':_['map'](_0x4a9744[_0x3a0a('0x33')],function(_0x5beab5){var _0x46f2d0={};_0x46f2d0[_0x5beab5]={'$like':'%'+_0x37521a[_0x3a0a('0x30')][_0x3a0a('0x3b')]+'%'};return _0x46f2d0;})});}_0x4a9744=_[_0x3a0a('0x3c')]({},_0x4a9744,_0x37521a[_0x3a0a('0x3d')]);return db[_0x3a0a('0x5a')][_0x3a0a('0x1e')]({'where':_0x4a9744[_0x3a0a('0x39')]})[_0x3a0a('0x23')](function(_0x55f6af){_0x489e7f[_0x3a0a('0x1e')]=_0x55f6af;if(_0x37521a[_0x3a0a('0x30')]['includeAll']){_0x4a9744['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x3a0a('0x3f')](_0x4a9744);})['then'](function(_0x2f1415){_0x489e7f['rows']=_0x2f1415;return _0x489e7f;});}})[_0x3a0a('0x23')](respondWithFilteredResult(_0x27315d,_0x4a9744))['catch'](handleError(_0x27315d,null));};function char(_0x3d6b41){return _0x3a0a('0x5b')===typeof _0x3d6b41?String[_0x3a0a('0x5c')][_0x3a0a('0x21')](null,arguments):_0x3d6b41;}function needsEncapsulation(_0x2f6c41){return!!_0x2f6c41&&(_0x2f6c41[_0x3a0a('0x5d')]()[_0x3a0a('0x5e')](char(0xd))>=0x0||_0x2f6c41[_0x3a0a('0x5d')]()[_0x3a0a('0x5e')](char(0xa))>=0x0||_0x2f6c41[_0x3a0a('0x5d')]()['indexOf'](char(0x2c))>=0x0||_0x2f6c41[_0x3a0a('0x5d')]()[_0x3a0a('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x3e94ec){var _0xc9fecd=char(0x22),_0x5b0819='\x5c'+char(0x22),_0x4955a=_0x3e94ec['toString']()[_0x3a0a('0x5f')](new RegExp(_0xc9fecd,'g'),_0x5b0819);return _0xc9fecd+_0x4955a+_0xc9fecd;}exports[_0x3a0a('0x60')]=function(_0x53cf90,_0x213cd6,_0x31cf8e){var _0x52ad38,_0x4155d3;var _0x483930={'where':{'ProjectId':_0x53cf90[_0x3a0a('0x43')]['id']}};if(_0x53cf90[_0x3a0a('0x30')]['startTime']){_0x483930[_0x3a0a('0x39')][_0x3a0a('0x61')]=JSON[_0x3a0a('0x62')](_0x53cf90['query'][_0x3a0a('0x63')]);}return db[_0x3a0a('0x55')][_0x3a0a('0x3f')](_0x483930)['then'](handleEntityNotFound(_0x213cd6,null))[_0x3a0a('0x23')](function(_0x2309ba){if(_0x2309ba){_0x52ad38=_0x2309ba;return db[_0x3a0a('0x64')][_0x3a0a('0x3f')]({'where':{'SessionId':{'$in':_[_0x3a0a('0x29')](_0x52ad38,'id')},'ProjectId':_0x53cf90[_0x3a0a('0x43')]['id']},'order':_0x3a0a('0x65')});}})[_0x3a0a('0x23')](handleEntityNotFound(_0x213cd6,null))['then'](function(_0x579656){if(_0x579656){_0x4155d3=_0x579656;var _0x2deef6={};for(var _0x68d787=0x0,_0x932f9=_0x4155d3[_0x3a0a('0x36')];_0x68d787<_0x932f9;_0x68d787++){if(!_0x2deef6[_0x3a0a('0x37')](_0x4155d3[_0x68d787][_0x3a0a('0x66')])){_0x2deef6[_0x4155d3[_0x68d787][_0x3a0a('0x66')]]=needsEncapsulation(_0x4155d3[_0x68d787][_0x3a0a('0x67')])?encapsulate(_0x4155d3[_0x68d787][_0x3a0a('0x67')]):_0x4155d3[_0x68d787][_0x3a0a('0x67')];}}var _0x7da6a0=[],_0x2bc924={};for(var _0x31ae21=0x0,_0x2475d4=_0x52ad38[_0x3a0a('0x36')];_0x31ae21<_0x2475d4;_0x31ae21++){_0x2bc924={'ProjectId':_0x53cf90[_0x3a0a('0x43')]['id'],'SessionId':_0x52ad38[_0x31ae21]['id'],'StartTime':moment(_0x52ad38[_0x31ae21][_0x3a0a('0x61')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2bdd7a=0x0,_0x440093=_0x4155d3['length'];_0x2bdd7a<_0x440093;_0x2bdd7a++){if(_0x4155d3[_0x2bdd7a][_0x3a0a('0x68')]==_0x52ad38[_0x31ae21]['id']&&_0x2deef6[_0x3a0a('0x37')](_0x4155d3[_0x2bdd7a][_0x3a0a('0x66')])){_0x2bc924[_0x2deef6[_0x4155d3[_0x2bdd7a]['questionId']]]=_0x4155d3[_0x2bdd7a][_0x3a0a('0x69')];}}for(var _0x1bd9c6 in _0x2deef6){if(!_0x2bc924[_0x3a0a('0x37')](_0x2deef6[_0x1bd9c6])){_0x2bc924[_0x2deef6[_0x1bd9c6]]=null;}}_0x7da6a0['push'](_0x2bc924);}return _0x7da6a0;}})[_0x3a0a('0x23')](function(_0x4a2b06){if(!_[_0x3a0a('0x6a')](_0x4a2b06)){var _0x48d7a5=toCsv(_0x4a2b06);var _0x349832=Date[_0x3a0a('0x6b')]();fs['writeFileSync'](util[_0x3a0a('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x53cf90[_0x3a0a('0x43')]['id'],_0x349832),_0x48d7a5);_0x213cd6[_0x3a0a('0x6d')](_0x3a0a('0x6e'),_0x3a0a('0x6f')+util[_0x3a0a('0x6c')](_0x3a0a('0x70'),_0x53cf90[_0x3a0a('0x43')]['id'],_0x349832));_0x213cd6[_0x3a0a('0x6d')](_0x3a0a('0x71'),_0x3a0a('0x72'));return _0x213cd6['download'](util[_0x3a0a('0x6c')](_0x3a0a('0x73'),_0x53cf90[_0x3a0a('0x43')]['id'],_0x349832));}else{return _0x213cd6['sendStatus'](0xcc);}})[_0x3a0a('0x41')](handleError(_0x213cd6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 1e3909a..cdd69e4 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 _0x7f42=['bluebird','path','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0x7f42,0x1dd));var _0x27f4=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7f42[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var logger=require(_0x27f4('0x1'))(_0x27f4('0x2'));var moment=require('moment');var BPromise=require(_0x27f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27f4('0x4'));var rimraf=require('rimraf');var config=require(_0x27f4('0x5'));var attributes=require('./jscriptyProject.attributes');module[_0x27f4('0x6')]=function(_0x5c9286,_0x256ac9){return _0x5c9286[_0x27f4('0x7')](_0x27f4('0x8'),attributes,{'tableName':_0x27f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c29=['define','JscriptyProject','jscripty_projects','../../config/logger','moment','bluebird','request-promise','../../config/environment','./jscriptyProject.attributes','exports'];(function(_0x336092,_0x22c0e1){var _0x57c708=function(_0x2cd18b){while(--_0x2cd18b){_0x336092['push'](_0x336092['shift']());}};_0x57c708(++_0x22c0e1);}(_0x0c29,0xb7));var _0x90c2=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x0c29[_0x151381];return _0x2afab6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90c2('0x0'))('api');var moment=require(_0x90c2('0x1'));var BPromise=require(_0x90c2('0x2'));var rp=require(_0x90c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x90c2('0x4'));var attributes=require(_0x90c2('0x5'));module[_0x90c2('0x6')]=function(_0x1aa5a4,_0xfbe17b){return _0x1aa5a4[_0x90c2('0x7')](_0x90c2('0x8'),attributes,{'tableName':_0x90c2('0x9'),'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 df5f58b..271469f 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 _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xc85fbd,_0x21d671){var _0x64f2d9=function(_0x4eb22d){while(--_0x4eb22d){_0xc85fbd['push'](_0xc85fbd['shift']());}};_0x64f2d9(++_0x21d671);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5257a8,_0x291137){_0x5257a8=_0x5257a8-0x0;var _0x4e8e7b=_0xf4eb[_0x5257a8];return _0x4e8e7b;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x560f7d,_0x144cdb){var _0x5a2e36=function(_0x1f72cd){while(--_0x1f72cd){_0x560f7d['push'](_0x560f7d['shift']());}};_0x5a2e36(++_0x144cdb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 7b63c9c..5749337 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 _0x09aa=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','update','delete'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x09aa,0x120));var _0xa09a=function(_0x11f8c9,_0x2cc97e){_0x11f8c9=_0x11f8c9-0x0;var _0x30a656=_0x09aa[_0x11f8c9];return _0x30a656;};'use strict';var multer=require(_0xa09a('0x0'));var util=require('util');var path=require(_0xa09a('0x1'));var timeout=require('connect-timeout');var express=require(_0xa09a('0x2'));var router=express[_0xa09a('0x3')]();var fs_extra=require(_0xa09a('0x4'));var auth=require(_0xa09a('0x5'));var interaction=require(_0xa09a('0x6'));var config=require(_0xa09a('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xa09a('0x8')]('/',auth[_0xa09a('0x9')](),controller[_0xa09a('0xa')]);router[_0xa09a('0x8')](_0xa09a('0xb'),auth[_0xa09a('0x9')](),controller[_0xa09a('0xc')]);router[_0xa09a('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa09a('0xd')]('/',auth[_0xa09a('0x9')](),controller[_0xa09a('0xe')]);router[_0xa09a('0xf')]('/:id',auth[_0xa09a('0x9')](),controller[_0xa09a('0x10')]);router[_0xa09a('0x11')]('/:id',auth[_0xa09a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb1f1=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','destroy','exports','path','express','Router'];(function(_0x5afe55,_0x5c6c81){var _0x2708bb=function(_0x6bf8af){while(--_0x6bf8af){_0x5afe55['push'](_0x5afe55['shift']());}};_0x2708bb(++_0x5c6c81);}(_0xb1f1,0x153));var _0x1b1f=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xb1f1[_0x33032e];return _0x13316b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1b1f('0x0'));var timeout=require('connect-timeout');var express=require(_0x1b1f('0x1'));var router=express[_0x1b1f('0x2')]();var fs_extra=require(_0x1b1f('0x3'));var auth=require(_0x1b1f('0x4'));var interaction=require(_0x1b1f('0x5'));var config=require('../../config/environment');var controller=require(_0x1b1f('0x6'));router[_0x1b1f('0x7')]('/',auth[_0x1b1f('0x8')](),controller[_0x1b1f('0x9')]);router[_0x1b1f('0x7')](_0x1b1f('0xa'),auth['isAuthenticated'](),controller[_0x1b1f('0xb')]);router['get'](_0x1b1f('0xc'),auth[_0x1b1f('0x8')](),controller[_0x1b1f('0xd')]);router['post']('/',auth[_0x1b1f('0x8')](),controller['create']);router['put']('/:id',auth[_0x1b1f('0x8')](),controller[_0x1b1f('0xe')]);router[_0x1b1f('0xf')](_0x1b1f('0xc'),auth[_0x1b1f('0x8')](),controller[_0x1b1f('0x10')]);module[_0x1b1f('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9fab2ab..1381492 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7a54,0x106));var _0x47a5=function(_0x40c29a,_0x182914){_0x40c29a=_0x40c29a-0x0;var _0x58f4a9=_0x7a54[_0x40c29a];return _0x58f4a9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x8850f,_0x30d619){_0x8850f=_0x8850f-0x0;var _0x52c5cc=_0x7a54[_0x8850f];return _0x52c5cc;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 0a28f40..a2937f6 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 _0x5f0c=['intersection','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','then','include','findAll','rows','catch','show','rawAttributes','length','includeAll','merge','create','body','update','find','params','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','stack','name','send','index','map','JscriptyQuestionReport','type','key','model','query','keys'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x5f0c,0x1d1));var _0xc5f0=function(_0x2e2440,_0x37851a){_0x2e2440=_0x2e2440-0x0;var _0x12f216=_0x5f0c[_0x2e2440];return _0x12f216;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5f0('0x0'));var zipdir=require(_0xc5f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5f0('0x2'));var moment=require(_0xc5f0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc5f0('0x4'));var util=require(_0xc5f0('0x5'));var path=require(_0xc5f0('0x6'));var sox=require(_0xc5f0('0x7'));var csv=require('to-csv');var ejs=require(_0xc5f0('0x8'));var fs=require('fs');var fs_extra=require(_0xc5f0('0x9'));var _=require(_0xc5f0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5f0('0xb'));var toCsv=require(_0xc5f0('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc5f0('0xd'));var authService=require(_0xc5f0('0xe'));var qs=require(_0xc5f0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5f0('0x10'))(_0xc5f0('0x11'));var utils=require(_0xc5f0('0x12'));var config=require(_0xc5f0('0x13'));var licenseUtil=require(_0xc5f0('0x14'));var db=require(_0xc5f0('0x15'))['db'];function respondWithStatusCode(_0xe08ebf,_0x32f76d){_0x32f76d=_0x32f76d||0xcc;return function(_0x38e2ed){if(_0x38e2ed){return _0xe08ebf[_0xc5f0('0x16')](_0x32f76d);}return _0xe08ebf[_0xc5f0('0x17')](_0x32f76d)[_0xc5f0('0x18')]();};}function respondWithResult(_0x17cb4d,_0x141009){_0x141009=_0x141009||0xc8;return function(_0x2cb7fd){if(_0x2cb7fd){return _0x17cb4d[_0xc5f0('0x17')](_0x141009)[_0xc5f0('0x19')](_0x2cb7fd);}};}function respondWithFilteredResult(_0x2a49d4,_0x521156){return function(_0x1bd487){if(_0x1bd487){var _0x1c39ca=typeof _0x521156[_0xc5f0('0x1a')]==='undefined'&&typeof _0x521156[_0xc5f0('0x1b')]===_0xc5f0('0x1c');var _0x3c4fab=_0x1bd487['count'];var _0x17720b=_0x1c39ca?0x0:_0x521156[_0xc5f0('0x1a')];var _0x1a4a9b=_0x1c39ca?_0x1bd487[_0xc5f0('0x1d')]:_0x521156['offset']+_0x521156['limit'];var _0x284992;if(_0x1a4a9b>=_0x3c4fab){_0x1a4a9b=_0x3c4fab;_0x284992=0xc8;}else{_0x284992=0xce;}_0x2a49d4[_0xc5f0('0x17')](_0x284992);return _0x2a49d4[_0xc5f0('0x1e')]('Content-Range',_0x17720b+'-'+_0x1a4a9b+'/'+_0x3c4fab)['json'](_0x1bd487);}return null;};}function patchUpdates(_0x46ca3f){return function(_0x504ac8){try{jsonpatch[_0xc5f0('0x1f')](_0x504ac8,_0x46ca3f,!![]);}catch(_0x32c537){return BPromise[_0xc5f0('0x20')](_0x32c537);}return _0x504ac8[_0xc5f0('0x21')]();};}function saveUpdates(_0x129f89,_0x19d146){return function(_0x41d10e){if(_0x41d10e){return _0x41d10e['update'](_0x129f89)['then'](function(_0x228c8b){return _0x228c8b;});}return null;};}function removeEntity(_0x3e50fd,_0x2b7423){return function(_0x1ad04d){if(_0x1ad04d){return _0x1ad04d[_0xc5f0('0x22')]()['then'](function(){_0x3e50fd[_0xc5f0('0x17')](0xcc)[_0xc5f0('0x18')]();});}};}function handleEntityNotFound(_0x2ddee3,_0x96e4b4){return function(_0x52fbde){if(!_0x52fbde){_0x2ddee3[_0xc5f0('0x16')](0x194);}return _0x52fbde;};}function handleError(_0x1b55a3,_0x11eb7f){_0x11eb7f=_0x11eb7f||0x1f4;return function(_0x599ee2){logger['error'](_0x599ee2[_0xc5f0('0x23')]);if(_0x599ee2['name']){delete _0x599ee2[_0xc5f0('0x24')];}_0x1b55a3[_0xc5f0('0x17')](_0x11eb7f)[_0xc5f0('0x25')](_0x599ee2);};}exports[_0xc5f0('0x26')]=function(_0x2bd819,_0x23450f){var _0x28f387={},_0x7ef90a={},_0x33087c={'count':0x0,'rows':[]};var _0x5a0aa4=_[_0xc5f0('0x27')](db[_0xc5f0('0x28')]['rawAttributes'],function(_0x5b8f5e){return{'name':_0x5b8f5e['fieldName'],'type':_0x5b8f5e[_0xc5f0('0x29')][_0xc5f0('0x2a')]};});_0x7ef90a[_0xc5f0('0x2b')]=_['map'](_0x5a0aa4,'name');_0x7ef90a[_0xc5f0('0x2c')]=_[_0xc5f0('0x2d')](_0x2bd819[_0xc5f0('0x2c')]);_0x7ef90a['filters']=_[_0xc5f0('0x2e')](_0x7ef90a[_0xc5f0('0x2b')],_0x7ef90a[_0xc5f0('0x2c')]);_0x28f387['attributes']=_[_0xc5f0('0x2e')](_0x7ef90a[_0xc5f0('0x2b')],qs[_0xc5f0('0x2f')](_0x2bd819['query']['fields']));_0x28f387[_0xc5f0('0x30')]=_0x28f387[_0xc5f0('0x30')]['length']?_0x28f387['attributes']:_0x7ef90a[_0xc5f0('0x2b')];if(!_0x2bd819[_0xc5f0('0x2c')][_0xc5f0('0x31')]('nolimit')){_0x28f387[_0xc5f0('0x1b')]=qs[_0xc5f0('0x1b')](_0x2bd819[_0xc5f0('0x2c')][_0xc5f0('0x1b')]);_0x28f387['offset']=qs[_0xc5f0('0x1a')](_0x2bd819[_0xc5f0('0x2c')][_0xc5f0('0x1a')]);}_0x28f387['order']=qs[_0xc5f0('0x32')](_0x2bd819['query'][_0xc5f0('0x32')]);_0x28f387[_0xc5f0('0x33')]=qs[_0xc5f0('0x34')](_[_0xc5f0('0x35')](_0x2bd819['query'],_0x7ef90a[_0xc5f0('0x34')]),_0x5a0aa4);if(_0x2bd819[_0xc5f0('0x2c')][_0xc5f0('0x36')]){_0x28f387[_0xc5f0('0x33')]=_['merge'](_0x28f387[_0xc5f0('0x33')],{'$or':_[_0xc5f0('0x27')](_0x5a0aa4,function(_0x1968a6){if(_0x1968a6[_0xc5f0('0x29')]!==_0xc5f0('0x37')){var _0x41f279={};_0x41f279[_0x1968a6[_0xc5f0('0x24')]]={'$like':'%'+_0x2bd819['query']['filter']+'%'};return _0x41f279;}})});}_0x28f387=_['merge']({},_0x28f387,_0x2bd819[_0xc5f0('0x38')]);var _0x4c5642={'where':_0x28f387[_0xc5f0('0x33')]};return db[_0xc5f0('0x28')][_0xc5f0('0x1d')](_0x4c5642)[_0xc5f0('0x39')](function(_0x3df558){_0x33087c[_0xc5f0('0x1d')]=_0x3df558;if(_0x2bd819[_0xc5f0('0x2c')]['includeAll']){_0x28f387[_0xc5f0('0x3a')]=[{'all':!![]}];}return db[_0xc5f0('0x28')][_0xc5f0('0x3b')](_0x28f387);})[_0xc5f0('0x39')](function(_0x38f7cc){_0x33087c[_0xc5f0('0x3c')]=_0x38f7cc;return _0x33087c;})[_0xc5f0('0x39')](respondWithFilteredResult(_0x23450f,_0x28f387))[_0xc5f0('0x3d')](handleError(_0x23450f,null));};exports[_0xc5f0('0x3e')]=function(_0x262a9d,_0x575f1e){var _0x170a76={'raw':!![],'where':{'id':_0x262a9d['params']['id']}},_0x234093={};_0x234093[_0xc5f0('0x2b')]=_[_0xc5f0('0x2d')](db[_0xc5f0('0x28')][_0xc5f0('0x3f')]);_0x234093[_0xc5f0('0x2c')]=_[_0xc5f0('0x2d')](_0x262a9d[_0xc5f0('0x2c')]);_0x234093[_0xc5f0('0x34')]=_[_0xc5f0('0x2e')](_0x234093[_0xc5f0('0x2b')],_0x234093['query']);_0x170a76['attributes']=_[_0xc5f0('0x2e')](_0x234093['model'],qs['fields'](_0x262a9d[_0xc5f0('0x2c')][_0xc5f0('0x2f')]));_0x170a76[_0xc5f0('0x30')]=_0x170a76[_0xc5f0('0x30')][_0xc5f0('0x40')]?_0x170a76[_0xc5f0('0x30')]:_0x234093[_0xc5f0('0x2b')];if(_0x262a9d['query'][_0xc5f0('0x41')]){_0x170a76['include']=[{'all':!![]}];}_0x170a76=_[_0xc5f0('0x42')]({},_0x170a76,_0x262a9d['options']);return db[_0xc5f0('0x28')]['find'](_0x170a76)[_0xc5f0('0x39')](handleEntityNotFound(_0x575f1e,null))[_0xc5f0('0x39')](respondWithResult(_0x575f1e,null))[_0xc5f0('0x3d')](handleError(_0x575f1e,null));};exports[_0xc5f0('0x43')]=function(_0x45b483,_0x2fee4b){return db[_0xc5f0('0x28')]['create'](_0x45b483[_0xc5f0('0x44')],{})[_0xc5f0('0x39')](respondWithResult(_0x2fee4b,0xc9))[_0xc5f0('0x3d')](handleError(_0x2fee4b,null));};exports[_0xc5f0('0x45')]=function(_0x22c35f,_0x1acbaf){if(_0x22c35f[_0xc5f0('0x44')]['id']){delete _0x22c35f['body']['id'];}return db[_0xc5f0('0x28')][_0xc5f0('0x46')]({'where':{'id':_0x22c35f['params']['id']}})[_0xc5f0('0x39')](handleEntityNotFound(_0x1acbaf,null))['then'](saveUpdates(_0x22c35f[_0xc5f0('0x44')],null))[_0xc5f0('0x39')](respondWithResult(_0x1acbaf,null))['catch'](handleError(_0x1acbaf,null));};exports[_0xc5f0('0x22')]=function(_0xb53da5,_0x246d4c){return db['JscriptyQuestionReport']['find']({'where':{'id':_0xb53da5[_0xc5f0('0x47')]['id']}})[_0xc5f0('0x39')](handleEntityNotFound(_0x246d4c,null))[_0xc5f0('0x39')](removeEntity(_0x246d4c,null))['catch'](handleError(_0x246d4c,null));};exports['describe']=function(_0x1884c5,_0x39a2e7){return db[_0xc5f0('0x28')][_0xc5f0('0x48')]()[_0xc5f0('0x39')](respondWithResult(_0x39a2e7,null))['catch'](handleError(_0x39a2e7,null));}; \ No newline at end of file +var _0x9a02=['length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params'];(function(_0x4d528c,_0x6f82fa){var _0x344a78=function(_0x31ef72){while(--_0x31ef72){_0x4d528c['push'](_0x4d528c['shift']());}};_0x344a78(++_0x6f82fa);}(_0x9a02,0x139));var _0x29a0=function(_0x1b851d,_0x24ed05){_0x1b851d=_0x1b851d-0x0;var _0x3e4a39=_0x9a02[_0x1b851d];return _0x3e4a39;};'use strict';var emlformat=require(_0x29a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29a0('0x1'));var jsonpatch=require(_0x29a0('0x2'));var rp=require(_0x29a0('0x3'));var moment=require(_0x29a0('0x4'));var BPromise=require(_0x29a0('0x5'));var Mustache=require(_0x29a0('0x6'));var util=require(_0x29a0('0x7'));var path=require(_0x29a0('0x8'));var sox=require(_0x29a0('0x9'));var csv=require(_0x29a0('0xa'));var ejs=require(_0x29a0('0xb'));var fs=require('fs');var fs_extra=require(_0x29a0('0xc'));var _=require(_0x29a0('0xd'));var squel=require(_0x29a0('0xe'));var crypto=require(_0x29a0('0xf'));var jsforce=require(_0x29a0('0x10'));var deskjs=require(_0x29a0('0x11'));var toCsv=require(_0x29a0('0xa'));var querystring=require(_0x29a0('0x12'));var Papa=require('papaparse');var Redis=require(_0x29a0('0x13'));var authService=require(_0x29a0('0x14'));var qs=require(_0x29a0('0x15'));var as=require(_0x29a0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x29a0('0x17'));var utils=require(_0x29a0('0x18'));var config=require(_0x29a0('0x19'));var licenseUtil=require(_0x29a0('0x1a'));var db=require(_0x29a0('0x1b'))['db'];function respondWithStatusCode(_0x301592,_0x2263e3){_0x2263e3=_0x2263e3||0xcc;return function(_0x4dd727){if(_0x4dd727){return _0x301592[_0x29a0('0x1c')](_0x2263e3);}return _0x301592[_0x29a0('0x1d')](_0x2263e3)[_0x29a0('0x1e')]();};}function respondWithResult(_0x31cecd,_0x1888ad){_0x1888ad=_0x1888ad||0xc8;return function(_0x442b84){if(_0x442b84){return _0x31cecd['status'](_0x1888ad)['json'](_0x442b84);}};}function respondWithFilteredResult(_0x4d7cba,_0x29c5f8){return function(_0x135a1a){if(_0x135a1a){var _0x1a8a9c=typeof _0x29c5f8[_0x29a0('0x1f')]===_0x29a0('0x20')&&typeof _0x29c5f8[_0x29a0('0x21')]===_0x29a0('0x20');var _0x4a063c=_0x135a1a['count'];var _0x11c8d7=_0x1a8a9c?0x0:_0x29c5f8[_0x29a0('0x1f')];var _0x447e74=_0x1a8a9c?_0x135a1a[_0x29a0('0x22')]:_0x29c5f8['offset']+_0x29c5f8['limit'];var _0x3f95ea;if(_0x447e74>=_0x4a063c){_0x447e74=_0x4a063c;_0x3f95ea=0xc8;}else{_0x3f95ea=0xce;}_0x4d7cba[_0x29a0('0x1d')](_0x3f95ea);return _0x4d7cba[_0x29a0('0x23')](_0x29a0('0x24'),_0x11c8d7+'-'+_0x447e74+'/'+_0x4a063c)[_0x29a0('0x25')](_0x135a1a);}return null;};}function patchUpdates(_0x3b11b8){return function(_0x4b6af){try{jsonpatch[_0x29a0('0x26')](_0x4b6af,_0x3b11b8,!![]);}catch(_0x2b8d79){return BPromise['reject'](_0x2b8d79);}return _0x4b6af[_0x29a0('0x27')]();};}function saveUpdates(_0x321b2b,_0x13c40b){return function(_0x1b6084){if(_0x1b6084){return _0x1b6084['update'](_0x321b2b)[_0x29a0('0x28')](function(_0x12606f){return _0x12606f;});}return null;};}function removeEntity(_0x431f3e,_0x6ea2b0){return function(_0x2d3c38){if(_0x2d3c38){return _0x2d3c38[_0x29a0('0x29')]()[_0x29a0('0x28')](function(){_0x431f3e[_0x29a0('0x1d')](0xcc)[_0x29a0('0x1e')]();});}};}function handleEntityNotFound(_0x582d6b,_0x3368a1){return function(_0x38d1e9){if(!_0x38d1e9){_0x582d6b[_0x29a0('0x1c')](0x194);}return _0x38d1e9;};}function handleError(_0x33ffbf,_0x2903c8){_0x2903c8=_0x2903c8||0x1f4;return function(_0x1565bf){logger[_0x29a0('0x2a')](_0x1565bf['stack']);if(_0x1565bf[_0x29a0('0x2b')]){delete _0x1565bf['name'];}_0x33ffbf[_0x29a0('0x1d')](_0x2903c8)[_0x29a0('0x2c')](_0x1565bf);};}exports[_0x29a0('0x2d')]=function(_0x15ec39,_0x347357){var _0x1c029c={},_0x5698b6={},_0x55503e={'count':0x0,'rows':[]};var _0x3d5a0a=_['map'](db[_0x29a0('0x2e')][_0x29a0('0x2f')],function(_0xc295be){return{'name':_0xc295be[_0x29a0('0x30')],'type':_0xc295be[_0x29a0('0x31')][_0x29a0('0x32')]};});_0x5698b6[_0x29a0('0x33')]=_[_0x29a0('0x34')](_0x3d5a0a,_0x29a0('0x2b'));_0x5698b6[_0x29a0('0x35')]=_[_0x29a0('0x36')](_0x15ec39[_0x29a0('0x35')]);_0x5698b6[_0x29a0('0x37')]=_[_0x29a0('0x38')](_0x5698b6[_0x29a0('0x33')],_0x5698b6[_0x29a0('0x35')]);_0x1c029c[_0x29a0('0x39')]=_[_0x29a0('0x38')](_0x5698b6[_0x29a0('0x33')],qs[_0x29a0('0x3a')](_0x15ec39[_0x29a0('0x35')][_0x29a0('0x3a')]));_0x1c029c[_0x29a0('0x39')]=_0x1c029c[_0x29a0('0x39')]['length']?_0x1c029c[_0x29a0('0x39')]:_0x5698b6[_0x29a0('0x33')];if(!_0x15ec39[_0x29a0('0x35')][_0x29a0('0x3b')]('nolimit')){_0x1c029c[_0x29a0('0x21')]=qs[_0x29a0('0x21')](_0x15ec39[_0x29a0('0x35')][_0x29a0('0x21')]);_0x1c029c['offset']=qs[_0x29a0('0x1f')](_0x15ec39[_0x29a0('0x35')][_0x29a0('0x1f')]);}_0x1c029c['order']=qs[_0x29a0('0x3c')](_0x15ec39[_0x29a0('0x35')][_0x29a0('0x3c')]);_0x1c029c[_0x29a0('0x3d')]=qs[_0x29a0('0x37')](_[_0x29a0('0x3e')](_0x15ec39['query'],_0x5698b6[_0x29a0('0x37')]),_0x3d5a0a);if(_0x15ec39[_0x29a0('0x35')][_0x29a0('0x3f')]){_0x1c029c['where']=_[_0x29a0('0x40')](_0x1c029c[_0x29a0('0x3d')],{'$or':_[_0x29a0('0x34')](_0x3d5a0a,function(_0x446322){if(_0x446322[_0x29a0('0x31')]!==_0x29a0('0x41')){var _0x2ce339={};_0x2ce339[_0x446322[_0x29a0('0x2b')]]={'$like':'%'+_0x15ec39[_0x29a0('0x35')]['filter']+'%'};return _0x2ce339;}})});}_0x1c029c=_[_0x29a0('0x40')]({},_0x1c029c,_0x15ec39[_0x29a0('0x42')]);var _0x11984f={'where':_0x1c029c[_0x29a0('0x3d')]};return db[_0x29a0('0x2e')][_0x29a0('0x22')](_0x11984f)['then'](function(_0x44c881){_0x55503e[_0x29a0('0x22')]=_0x44c881;if(_0x15ec39['query']['includeAll']){_0x1c029c[_0x29a0('0x43')]=[{'all':!![]}];}return db[_0x29a0('0x2e')]['findAll'](_0x1c029c);})[_0x29a0('0x28')](function(_0x37779a){_0x55503e[_0x29a0('0x44')]=_0x37779a;return _0x55503e;})[_0x29a0('0x28')](respondWithFilteredResult(_0x347357,_0x1c029c))[_0x29a0('0x45')](handleError(_0x347357,null));};exports[_0x29a0('0x46')]=function(_0x27fec5,_0x4df18f){var _0x32e546={'raw':!![],'where':{'id':_0x27fec5[_0x29a0('0x47')]['id']}},_0x218e47={};_0x218e47[_0x29a0('0x33')]=_[_0x29a0('0x36')](db[_0x29a0('0x2e')]['rawAttributes']);_0x218e47[_0x29a0('0x35')]=_[_0x29a0('0x36')](_0x27fec5['query']);_0x218e47[_0x29a0('0x37')]=_[_0x29a0('0x38')](_0x218e47[_0x29a0('0x33')],_0x218e47['query']);_0x32e546[_0x29a0('0x39')]=_[_0x29a0('0x38')](_0x218e47['model'],qs[_0x29a0('0x3a')](_0x27fec5[_0x29a0('0x35')][_0x29a0('0x3a')]));_0x32e546['attributes']=_0x32e546['attributes'][_0x29a0('0x48')]?_0x32e546[_0x29a0('0x39')]:_0x218e47['model'];if(_0x27fec5[_0x29a0('0x35')]['includeAll']){_0x32e546['include']=[{'all':!![]}];}_0x32e546=_[_0x29a0('0x40')]({},_0x32e546,_0x27fec5[_0x29a0('0x42')]);return db[_0x29a0('0x2e')][_0x29a0('0x49')](_0x32e546)['then'](handleEntityNotFound(_0x4df18f,null))[_0x29a0('0x28')](respondWithResult(_0x4df18f,null))[_0x29a0('0x45')](handleError(_0x4df18f,null));};exports[_0x29a0('0x4a')]=function(_0x1378cb,_0x4c28db){return db[_0x29a0('0x2e')][_0x29a0('0x4a')](_0x1378cb[_0x29a0('0x4b')],{})[_0x29a0('0x28')](respondWithResult(_0x4c28db,0xc9))[_0x29a0('0x45')](handleError(_0x4c28db,null));};exports['update']=function(_0x1d4bb0,_0x4f2eb0){if(_0x1d4bb0[_0x29a0('0x4b')]['id']){delete _0x1d4bb0['body']['id'];}return db[_0x29a0('0x2e')][_0x29a0('0x49')]({'where':{'id':_0x1d4bb0['params']['id']}})[_0x29a0('0x28')](handleEntityNotFound(_0x4f2eb0,null))[_0x29a0('0x28')](saveUpdates(_0x1d4bb0[_0x29a0('0x4b')],null))['then'](respondWithResult(_0x4f2eb0,null))[_0x29a0('0x45')](handleError(_0x4f2eb0,null));};exports[_0x29a0('0x29')]=function(_0x595f8b,_0x10ba47){return db[_0x29a0('0x2e')][_0x29a0('0x49')]({'where':{'id':_0x595f8b[_0x29a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x10ba47,null))[_0x29a0('0x28')](removeEntity(_0x10ba47,null))[_0x29a0('0x45')](handleError(_0x10ba47,null));};exports['describe']=function(_0x307976,_0x5bfeb2){return db[_0x29a0('0x2e')][_0x29a0('0x4c')]()[_0x29a0('0x28')](respondWithResult(_0x5bfeb2,null))['catch'](handleError(_0x5bfeb2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index ca2df4e..d3011ca 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 _0xdc42=['exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x59c8f7,_0x5016ed){var _0x10e4f8=function(_0x5b6224){while(--_0x5b6224){_0x59c8f7['push'](_0x59c8f7['shift']());}};_0x10e4f8(++_0x5016ed);}(_0xdc42,0x19c));var _0x2dc4=function(_0x4b088c,_0x30220b){_0x4b088c=_0x4b088c-0x0;var _0x49fe77=_0xdc42[_0x4b088c];return _0x49fe77;};'use strict';var _=require('lodash');var util=require(_0x2dc4('0x0'));var logger=require(_0x2dc4('0x1'))(_0x2dc4('0x2'));var moment=require(_0x2dc4('0x3'));var BPromise=require(_0x2dc4('0x4'));var rp=require(_0x2dc4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2dc4('0x6'));var attributes=require(_0x2dc4('0x7'));module[_0x2dc4('0x8')]=function(_0x20ecc2,_0x27ffc5){return _0x20ecc2[_0x2dc4('0x9')](_0x2dc4('0xa'),attributes,{'tableName':_0x2dc4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1576=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x1576,0x19e));var _0x6157=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x1576[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0x6157('0x0'));var util=require(_0x6157('0x1'));var logger=require(_0x6157('0x2'))(_0x6157('0x3'));var moment=require(_0x6157('0x4'));var BPromise=require('bluebird');var rp=require(_0x6157('0x5'));var fs=require('fs');var path=require(_0x6157('0x6'));var rimraf=require(_0x6157('0x7'));var config=require(_0x6157('0x8'));var attributes=require(_0x6157('0x9'));module['exports']=function(_0x57338b,_0x49ca3f){return _0x57338b[_0x6157('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x6157('0xb'),'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 481284f..d1faf05 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 _0x5e4f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','debug','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch'];(function(_0x280bec,_0x3278b1){var _0x4c5ec7=function(_0x12683e){while(--_0x12683e){_0x280bec['push'](_0x280bec['shift']());}};_0x4c5ec7(++_0x3278b1);}(_0x5e4f,0x11e));var _0xf5e4=function(_0x59752f,_0x13f23b){_0x59752f=_0x59752f-0x0;var _0x2faac1=_0x5e4f[_0x59752f];return _0x2faac1;};'use strict';var _=require(_0xf5e4('0x0'));var util=require(_0xf5e4('0x1'));var moment=require(_0xf5e4('0x2'));var BPromise=require(_0xf5e4('0x3'));var rs=require(_0xf5e4('0x4'));var fs=require('fs');var Redis=require(_0xf5e4('0x5'));var db=require(_0xf5e4('0x6'))['db'];var utils=require(_0xf5e4('0x7'));var logger=require(_0xf5e4('0x8'))(_0xf5e4('0x9'));var config=require('../../config/environment');var jayson=require(_0xf5e4('0xa'));var client=jayson['client'][_0xf5e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2df17a,_0xfa1e87,_0x203733){return new BPromise(function(_0x235037,_0xc28369){return client['request'](_0x2df17a,_0x203733)[_0xf5e4('0xc')](function(_0x599df0){logger[_0xf5e4('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xfa1e87,'request\x20sent');logger[_0xf5e4('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0xfa1e87,_0xf5e4('0xf'),JSON[_0xf5e4('0x10')](_0x599df0));if(_0x599df0[_0xf5e4('0x11')]){if(_0x599df0[_0xf5e4('0x11')][_0xf5e4('0x12')]===0x1f4){logger[_0xf5e4('0x11')](_0xf5e4('0x13'),_0xfa1e87,_0x599df0[_0xf5e4('0x11')][_0xf5e4('0x14')]);return _0xc28369(_0x599df0[_0xf5e4('0x11')][_0xf5e4('0x14')]);}logger['error'](_0xf5e4('0x13'),_0xfa1e87,_0x599df0[_0xf5e4('0x11')]['message']);return _0x235037(_0x599df0[_0xf5e4('0x11')][_0xf5e4('0x14')]);}else{logger[_0xf5e4('0xd')](_0xf5e4('0x13'),_0xfa1e87,_0xf5e4('0xf'));_0x235037(_0x599df0['result'][_0xf5e4('0x14')]);}})[_0xf5e4('0x15')](function(_0x5db450){logger[_0xf5e4('0x11')](_0xf5e4('0x13'),_0xfa1e87,_0x5db450);_0xc28369(_0x5db450);});});} \ No newline at end of file +var _0x6423=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x46a635,_0x3cf6f0){var _0xff72f1=function(_0x3ac57b){while(--_0x3ac57b){_0x46a635['push'](_0x46a635['shift']());}};_0xff72f1(++_0x3cf6f0);}(_0x6423,0x19f));var _0x3642=function(_0x2eb3a3,_0x4040bf){_0x2eb3a3=_0x2eb3a3-0x0;var _0x475ba7=_0x6423[_0x2eb3a3];return _0x475ba7;};'use strict';var _=require(_0x3642('0x0'));var util=require(_0x3642('0x1'));var moment=require(_0x3642('0x2'));var BPromise=require(_0x3642('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3642('0x4'));var db=require(_0x3642('0x5'))['db'];var utils=require(_0x3642('0x6'));var logger=require(_0x3642('0x7'))(_0x3642('0x8'));var config=require(_0x3642('0x9'));var jayson=require(_0x3642('0xa'));var client=jayson[_0x3642('0xb')][_0x3642('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x482851,_0x6bd98e,_0x28b1df){return new BPromise(function(_0x38bf5a,_0x8a8483){return client[_0x3642('0xd')](_0x482851,_0x28b1df)[_0x3642('0xe')](function(_0x2132ee){logger[_0x3642('0xf')](_0x3642('0x10'),_0x6bd98e,_0x3642('0x11'));logger[_0x3642('0x12')](_0x3642('0x13'),_0x6bd98e,_0x3642('0x11'),JSON[_0x3642('0x14')](_0x2132ee));if(_0x2132ee[_0x3642('0x15')]){if(_0x2132ee[_0x3642('0x15')][_0x3642('0x16')]===0x1f4){logger[_0x3642('0x15')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x6bd98e,_0x2132ee[_0x3642('0x15')]['message']);return _0x8a8483(_0x2132ee[_0x3642('0x15')]['message']);}logger[_0x3642('0x15')](_0x3642('0x10'),_0x6bd98e,_0x2132ee[_0x3642('0x15')][_0x3642('0x17')]);return _0x38bf5a(_0x2132ee[_0x3642('0x15')][_0x3642('0x17')]);}else{logger[_0x3642('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x6bd98e,_0x3642('0x11'));_0x38bf5a(_0x2132ee[_0x3642('0x18')][_0x3642('0x17')]);}})[_0x3642('0x19')](function(_0x3d8cca){logger[_0x3642('0x15')](_0x3642('0x10'),_0x6bd98e,_0x3d8cca);_0x8a8483(_0x3d8cca);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 999c0c8..5127ffe 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 _0x3cd7=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','isAuthenticated','show','/:id/questions','getQuestions','post','put','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cd7,0x81));var _0x73cd=function(_0x5ea9cd,_0x5e6c56){_0x5ea9cd=_0x5ea9cd-0x0;var _0x54d46a=_0x3cd7[_0x5ea9cd];return _0x54d46a;};'use strict';var multer=require('multer');var util=require(_0x73cd('0x0'));var path=require(_0x73cd('0x1'));var timeout=require(_0x73cd('0x2'));var express=require(_0x73cd('0x3'));var router=express['Router']();var fs_extra=require(_0x73cd('0x4'));var auth=require(_0x73cd('0x5'));var interaction=require(_0x73cd('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x73cd('0x7')](_0x73cd('0x8'),auth['isAuthenticated'](),controller[_0x73cd('0x9')]);router[_0x73cd('0x7')]('/:id',auth[_0x73cd('0xa')](),controller[_0x73cd('0xb')]);router[_0x73cd('0x7')](_0x73cd('0xc'),auth['isAuthenticated'](),controller[_0x73cd('0xd')]);router[_0x73cd('0xe')]('/',auth[_0x73cd('0xa')](),controller['create']);router[_0x73cd('0xf')](_0x73cd('0x10'),auth['isAuthenticated'](),controller[_0x73cd('0x11')]);router[_0x73cd('0x12')](_0x73cd('0x10'),auth[_0x73cd('0xa')](),controller[_0x73cd('0x13')]);module[_0x73cd('0x14')]=router; \ No newline at end of file +var _0x9846=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','post','create','put','delete'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x9846,0x120));var _0x6984=function(_0x158a19,_0x3c9b98){_0x158a19=_0x158a19-0x0;var _0x211080=_0x9846[_0x158a19];return _0x211080;};'use strict';var multer=require(_0x6984('0x0'));var util=require(_0x6984('0x1'));var path=require(_0x6984('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6984('0x3')]();var fs_extra=require(_0x6984('0x4'));var auth=require(_0x6984('0x5'));var interaction=require(_0x6984('0x6'));var config=require(_0x6984('0x7'));var controller=require(_0x6984('0x8'));router[_0x6984('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6984('0x9')](_0x6984('0xa'),auth[_0x6984('0xb')](),controller[_0x6984('0xc')]);router['get'](_0x6984('0xd'),auth[_0x6984('0xb')](),controller[_0x6984('0xe')]);router['get'](_0x6984('0xf'),auth[_0x6984('0xb')](),controller['getQuestions']);router[_0x6984('0x10')]('/',auth['isAuthenticated'](),controller[_0x6984('0x11')]);router[_0x6984('0x12')](_0x6984('0xd'),auth[_0x6984('0xb')](),controller['update']);router[_0x6984('0x13')]('/:id',auth[_0x6984('0xb')](),controller[_0x6984('0x14')]);module[_0x6984('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index f0574f0..0e6434e 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 _0x9065=['sequelize','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING'];(function(_0x1391b4,_0xd18208){var _0x43e850=function(_0x2d3540){while(--_0x2d3540){_0x1391b4['push'](_0x1391b4['shift']());}};_0x43e850(++_0xd18208);}(_0x9065,0x1d5));var _0x5906=function(_0x296152,_0x1eddf3){_0x296152=_0x296152-0x0;var _0x576f82=_0x9065[_0x296152];return _0x576f82;};'use strict';var moment=require('moment');var Sequelize=require(_0x5906('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x27b114){this[_0x5906('0x1')](_0x5906('0x2'),_0x27b114);this[_0x5906('0x1')](_0x5906('0x3'),moment()['format'](_0x5906('0x4')));}},'endtime':{'type':Sequelize[_0x5906('0x5')]},'membername':{'type':Sequelize[_0x5906('0x6')]},'projectname':{'type':Sequelize[_0x5906('0x6')]},'queue':{'type':Sequelize[_0x5906('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5906('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4549=['STRING','moment','sequelize','exports','DATE','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4549,0x14e));var _0x9454=function(_0x184259,_0x23d6bf){_0x184259=_0x184259-0x0;var _0x1c0227=_0x4549[_0x184259];return _0x1c0227;};'use strict';var moment=require(_0x9454('0x0'));var Sequelize=require(_0x9454('0x1'));module[_0x9454('0x2')]={'starttime':{'type':Sequelize[_0x9454('0x3')],'set':function(_0x3b5709){this['setDataValue'](_0x9454('0x4'),_0x3b5709);this[_0x9454('0x5')](_0x9454('0x6'),moment()['format'](_0x9454('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x9454('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9454('0x8')]},'calleridname':{'type':Sequelize[_0x9454('0x8')]},'calleridnum':{'type':Sequelize[_0x9454('0x8')]},'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 f039d16..38be1ed 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 _0xbaa3=['Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','JscriptySessionReport','includeAll','findAll','rows','catch','include','find','create','body','params','describe','getQuestions','JscriptyQuestionReport','SessionId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0xb1b665,_0x5de333){var _0x22521a=function(_0x462cb9){while(--_0x462cb9){_0xb1b665['push'](_0xb1b665['shift']());}};_0x22521a(++_0x5de333);}(_0xbaa3,0x123));var _0x3baa=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0xbaa3[_0x5b5cde];return _0x364ad2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3baa('0x0'));var zipdir=require(_0x3baa('0x1'));var jsonpatch=require(_0x3baa('0x2'));var rp=require(_0x3baa('0x3'));var moment=require(_0x3baa('0x4'));var BPromise=require(_0x3baa('0x5'));var Mustache=require(_0x3baa('0x6'));var util=require(_0x3baa('0x7'));var path=require(_0x3baa('0x8'));var sox=require('sox');var csv=require(_0x3baa('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3baa('0xa'));var squel=require(_0x3baa('0xb'));var crypto=require('crypto');var jsforce=require(_0x3baa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3baa('0x9'));var querystring=require(_0x3baa('0xd'));var Papa=require(_0x3baa('0xe'));var Redis=require(_0x3baa('0xf'));var authService=require(_0x3baa('0x10'));var qs=require(_0x3baa('0x11'));var as=require(_0x3baa('0x12'));var hardwareService=require(_0x3baa('0x13'));var logger=require(_0x3baa('0x14'))(_0x3baa('0x15'));var utils=require(_0x3baa('0x16'));var config=require(_0x3baa('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3baa('0x18'))['db'];function respondWithStatusCode(_0x14d8dd,_0x1fdeb1){_0x1fdeb1=_0x1fdeb1||0xcc;return function(_0x1d3c30){if(_0x1d3c30){return _0x14d8dd[_0x3baa('0x19')](_0x1fdeb1);}return _0x14d8dd[_0x3baa('0x1a')](_0x1fdeb1)[_0x3baa('0x1b')]();};}function respondWithResult(_0x36e843,_0x279530){_0x279530=_0x279530||0xc8;return function(_0x5e8901){if(_0x5e8901){return _0x36e843[_0x3baa('0x1a')](_0x279530)['json'](_0x5e8901);}};}function respondWithFilteredResult(_0x42b9dd,_0x243adb){return function(_0x4c95c0){if(_0x4c95c0){var _0x92cd5b=typeof _0x243adb[_0x3baa('0x1c')]===_0x3baa('0x1d')&&typeof _0x243adb[_0x3baa('0x1e')]===_0x3baa('0x1d');var _0x3985ed=_0x4c95c0[_0x3baa('0x1f')];var _0xeee8e8=_0x92cd5b?0x0:_0x243adb[_0x3baa('0x1c')];var _0x5ac500=_0x92cd5b?_0x4c95c0[_0x3baa('0x1f')]:_0x243adb[_0x3baa('0x1c')]+_0x243adb['limit'];var _0x47f706;if(_0x5ac500>=_0x3985ed){_0x5ac500=_0x3985ed;_0x47f706=0xc8;}else{_0x47f706=0xce;}_0x42b9dd['status'](_0x47f706);return _0x42b9dd[_0x3baa('0x20')](_0x3baa('0x21'),_0xeee8e8+'-'+_0x5ac500+'/'+_0x3985ed)[_0x3baa('0x22')](_0x4c95c0);}return null;};}function patchUpdates(_0x421d47){return function(_0x544f0a){try{jsonpatch[_0x3baa('0x23')](_0x544f0a,_0x421d47,!![]);}catch(_0x587d58){return BPromise['reject'](_0x587d58);}return _0x544f0a['save']();};}function saveUpdates(_0x515f64,_0x3f5d77){return function(_0x57aca2){if(_0x57aca2){return _0x57aca2[_0x3baa('0x24')](_0x515f64)[_0x3baa('0x25')](function(_0xdeebcd){return _0xdeebcd;});}return null;};}function removeEntity(_0x3fb3b8,_0x1f35b9){return function(_0x5a8d32){if(_0x5a8d32){return _0x5a8d32[_0x3baa('0x26')]()['then'](function(){_0x3fb3b8[_0x3baa('0x1a')](0xcc)[_0x3baa('0x1b')]();});}};}function handleEntityNotFound(_0x1e068a,_0x2fc5cc){return function(_0x3cce7e){if(!_0x3cce7e){_0x1e068a[_0x3baa('0x19')](0x194);}return _0x3cce7e;};}function handleError(_0x24e9e,_0x267e80){_0x267e80=_0x267e80||0x1f4;return function(_0x2cb566){logger[_0x3baa('0x27')](_0x2cb566[_0x3baa('0x28')]);if(_0x2cb566[_0x3baa('0x29')]){delete _0x2cb566['name'];}_0x24e9e[_0x3baa('0x1a')](_0x267e80)[_0x3baa('0x2a')](_0x2cb566);};}exports[_0x3baa('0x2b')]=function(_0x3bfc59,_0x1bfd02){var _0x1d486a={},_0x4527a9={},_0x41f532={'count':0x0,'rows':[]};var _0x104c5a=_[_0x3baa('0x2c')](db['JscriptySessionReport'][_0x3baa('0x2d')],function(_0x2c4f6f){return{'name':_0x2c4f6f[_0x3baa('0x2e')],'type':_0x2c4f6f['type'][_0x3baa('0x2f')]};});_0x4527a9['model']=_[_0x3baa('0x2c')](_0x104c5a,'name');_0x4527a9[_0x3baa('0x30')]=_[_0x3baa('0x31')](_0x3bfc59[_0x3baa('0x30')]);_0x4527a9[_0x3baa('0x32')]=_[_0x3baa('0x33')](_0x4527a9[_0x3baa('0x34')],_0x4527a9[_0x3baa('0x30')]);_0x1d486a[_0x3baa('0x35')]=_[_0x3baa('0x33')](_0x4527a9[_0x3baa('0x34')],qs['fields'](_0x3bfc59[_0x3baa('0x30')][_0x3baa('0x36')]));_0x1d486a[_0x3baa('0x35')]=_0x1d486a[_0x3baa('0x35')][_0x3baa('0x37')]?_0x1d486a[_0x3baa('0x35')]:_0x4527a9[_0x3baa('0x34')];if(!_0x3bfc59[_0x3baa('0x30')][_0x3baa('0x38')](_0x3baa('0x39'))){_0x1d486a[_0x3baa('0x1e')]=qs[_0x3baa('0x1e')](_0x3bfc59['query'][_0x3baa('0x1e')]);_0x1d486a[_0x3baa('0x1c')]=qs[_0x3baa('0x1c')](_0x3bfc59[_0x3baa('0x30')][_0x3baa('0x1c')]);}_0x1d486a[_0x3baa('0x3a')]=qs[_0x3baa('0x3b')](_0x3bfc59[_0x3baa('0x30')]['sort']);_0x1d486a['where']=qs[_0x3baa('0x32')](_[_0x3baa('0x3c')](_0x3bfc59[_0x3baa('0x30')],_0x4527a9[_0x3baa('0x32')]),_0x104c5a);if(_0x3bfc59[_0x3baa('0x30')][_0x3baa('0x3d')]){_0x1d486a['where']=_[_0x3baa('0x3e')](_0x1d486a[_0x3baa('0x3f')],{'$or':_[_0x3baa('0x2c')](_0x104c5a,function(_0x1043fe){if(_0x1043fe[_0x3baa('0x40')]!==_0x3baa('0x41')){var _0x50ac9a={};_0x50ac9a[_0x1043fe[_0x3baa('0x29')]]={'$like':'%'+_0x3bfc59[_0x3baa('0x30')][_0x3baa('0x3d')]+'%'};return _0x50ac9a;}})});}_0x1d486a=_[_0x3baa('0x3e')]({},_0x1d486a,_0x3bfc59[_0x3baa('0x42')]);var _0x835624={'where':_0x1d486a[_0x3baa('0x3f')]};return db[_0x3baa('0x43')][_0x3baa('0x1f')](_0x835624)[_0x3baa('0x25')](function(_0x221d07){_0x41f532[_0x3baa('0x1f')]=_0x221d07;if(_0x3bfc59[_0x3baa('0x30')][_0x3baa('0x44')]){_0x1d486a['include']=[{'all':!![]}];}return db[_0x3baa('0x43')][_0x3baa('0x45')](_0x1d486a);})[_0x3baa('0x25')](function(_0x52e3a5){_0x41f532[_0x3baa('0x46')]=_0x52e3a5;return _0x41f532;})['then'](respondWithFilteredResult(_0x1bfd02,_0x1d486a))[_0x3baa('0x47')](handleError(_0x1bfd02,null));};exports['show']=function(_0x33147f,_0x3beeeb){var _0xc59a8c={'raw':!![],'where':{'id':_0x33147f['params']['id']}},_0x54ce51={};_0x54ce51[_0x3baa('0x34')]=_[_0x3baa('0x31')](db['JscriptySessionReport'][_0x3baa('0x2d')]);_0x54ce51[_0x3baa('0x30')]=_[_0x3baa('0x31')](_0x33147f['query']);_0x54ce51['filters']=_[_0x3baa('0x33')](_0x54ce51[_0x3baa('0x34')],_0x54ce51['query']);_0xc59a8c[_0x3baa('0x35')]=_[_0x3baa('0x33')](_0x54ce51[_0x3baa('0x34')],qs[_0x3baa('0x36')](_0x33147f[_0x3baa('0x30')][_0x3baa('0x36')]));_0xc59a8c[_0x3baa('0x35')]=_0xc59a8c[_0x3baa('0x35')][_0x3baa('0x37')]?_0xc59a8c['attributes']:_0x54ce51[_0x3baa('0x34')];if(_0x33147f[_0x3baa('0x30')][_0x3baa('0x44')]){_0xc59a8c[_0x3baa('0x48')]=[{'all':!![]}];}_0xc59a8c=_[_0x3baa('0x3e')]({},_0xc59a8c,_0x33147f[_0x3baa('0x42')]);return db[_0x3baa('0x43')][_0x3baa('0x49')](_0xc59a8c)[_0x3baa('0x25')](handleEntityNotFound(_0x3beeeb,null))[_0x3baa('0x25')](respondWithResult(_0x3beeeb,null))[_0x3baa('0x47')](handleError(_0x3beeeb,null));};exports['create']=function(_0x296ab5,_0x4fd3b4){return db['JscriptySessionReport'][_0x3baa('0x4a')](_0x296ab5[_0x3baa('0x4b')],{})[_0x3baa('0x25')](respondWithResult(_0x4fd3b4,0xc9))[_0x3baa('0x47')](handleError(_0x4fd3b4,null));};exports['update']=function(_0x2eaa43,_0x19fe94){if(_0x2eaa43[_0x3baa('0x4b')]['id']){delete _0x2eaa43[_0x3baa('0x4b')]['id'];}return db[_0x3baa('0x43')][_0x3baa('0x49')]({'where':{'id':_0x2eaa43[_0x3baa('0x4c')]['id']}})[_0x3baa('0x25')](handleEntityNotFound(_0x19fe94,null))['then'](saveUpdates(_0x2eaa43[_0x3baa('0x4b')],null))['then'](respondWithResult(_0x19fe94,null))[_0x3baa('0x47')](handleError(_0x19fe94,null));};exports[_0x3baa('0x26')]=function(_0x528f40,_0x2065c2){return db[_0x3baa('0x43')]['find']({'where':{'id':_0x528f40[_0x3baa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2065c2,null))[_0x3baa('0x25')](removeEntity(_0x2065c2,null))['catch'](handleError(_0x2065c2,null));};exports[_0x3baa('0x4d')]=function(_0x11c261,_0x1c0639){return db[_0x3baa('0x43')]['describe']()[_0x3baa('0x25')](respondWithResult(_0x1c0639,null))[_0x3baa('0x47')](handleError(_0x1c0639,null));};exports[_0x3baa('0x4e')]=function(_0x5dcbb0,_0x3ac011,_0xbd5019){var _0x451190={'raw':!![],'where':{}};var _0x4518bd={};var _0x269997={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x5dcbb0[_0x3baa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ac011,null))[_0x3baa('0x25')](function(_0x13727e){if(_0x13727e){_0x4518bd['model']=_[_0x3baa('0x31')](db[_0x3baa('0x4f')][_0x3baa('0x2d')]);_0x4518bd['query']=_['keys'](_0x5dcbb0[_0x3baa('0x30')]);_0x4518bd[_0x3baa('0x32')]=_[_0x3baa('0x33')](_0x4518bd[_0x3baa('0x34')],_0x4518bd[_0x3baa('0x30')]);_0x451190['attributes']=_[_0x3baa('0x33')](_0x4518bd[_0x3baa('0x34')],qs[_0x3baa('0x36')](_0x5dcbb0[_0x3baa('0x30')][_0x3baa('0x36')]));_0x451190[_0x3baa('0x35')]=_0x451190['attributes'][_0x3baa('0x37')]?_0x451190[_0x3baa('0x35')]:_0x4518bd[_0x3baa('0x34')];if(!_0x5dcbb0['query'][_0x3baa('0x38')](_0x3baa('0x39'))){_0x451190['limit']=qs['limit'](_0x5dcbb0[_0x3baa('0x30')][_0x3baa('0x1e')]);_0x451190[_0x3baa('0x1c')]=qs[_0x3baa('0x1c')](_0x5dcbb0[_0x3baa('0x30')][_0x3baa('0x1c')]);}_0x451190[_0x3baa('0x3a')]=qs['sort'](_0x5dcbb0['query'][_0x3baa('0x3b')]);_0x451190[_0x3baa('0x3f')]=qs[_0x3baa('0x32')](_['pick'](_0x5dcbb0[_0x3baa('0x30')],_0x4518bd[_0x3baa('0x32')]));_0x451190[_0x3baa('0x3f')][_0x3baa('0x50')]=_0x13727e['id'];if(_0x5dcbb0[_0x3baa('0x30')][_0x3baa('0x3d')]){_0x451190[_0x3baa('0x3f')]=_['merge'](_0x451190[_0x3baa('0x3f')],{'$or':_[_0x3baa('0x2c')](_0x451190[_0x3baa('0x35')],function(_0x2496f0){var _0x46c508={};_0x46c508[_0x2496f0]={'$like':'%'+_0x5dcbb0[_0x3baa('0x30')][_0x3baa('0x3d')]+'%'};return _0x46c508;})});}_0x451190=_[_0x3baa('0x3e')]({},_0x451190,_0x5dcbb0[_0x3baa('0x42')]);return db[_0x3baa('0x4f')]['count']({'where':_0x451190[_0x3baa('0x3f')]})['then'](function(_0x34ddff){_0x269997[_0x3baa('0x1f')]=_0x34ddff;if(_0x5dcbb0['query'][_0x3baa('0x44')]){_0x451190[_0x3baa('0x48')]=[{'all':!![]}];}return db[_0x3baa('0x4f')]['findAll'](_0x451190);})[_0x3baa('0x25')](function(_0x244adf){_0x269997['rows']=_0x244adf;return _0x269997;});}})[_0x3baa('0x25')](respondWithFilteredResult(_0x3ac011,_0x451190))['catch'](handleError(_0x3ac011,null));}; \ No newline at end of file +var _0x863b=['fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','catch','show','params','JscriptySessionReport','keys','length','merge','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rows','rimraf','zip-dir'];(function(_0x5504fc,_0x2e161c){var _0xbad34c=function(_0x1f62de){while(--_0x1f62de){_0x5504fc['push'](_0x5504fc['shift']());}};_0xbad34c(++_0x2e161c);}(_0x863b,0x184));var _0xb863=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x863b[_0x11946c];return _0x383935;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb863('0x0'));var zipdir=require(_0xb863('0x1'));var jsonpatch=require(_0xb863('0x2'));var rp=require('request-promise');var moment=require(_0xb863('0x3'));var BPromise=require(_0xb863('0x4'));var Mustache=require('mustache');var util=require(_0xb863('0x5'));var path=require(_0xb863('0x6'));var sox=require(_0xb863('0x7'));var csv=require(_0xb863('0x8'));var ejs=require(_0xb863('0x9'));var fs=require('fs');var fs_extra=require(_0xb863('0xa'));var _=require(_0xb863('0xb'));var squel=require(_0xb863('0xc'));var crypto=require(_0xb863('0xd'));var jsforce=require(_0xb863('0xe'));var deskjs=require(_0xb863('0xf'));var toCsv=require(_0xb863('0x8'));var querystring=require(_0xb863('0x10'));var Papa=require(_0xb863('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb863('0x12'));var as=require(_0xb863('0x13'));var hardwareService=require(_0xb863('0x14'));var logger=require(_0xb863('0x15'))('api');var utils=require(_0xb863('0x16'));var config=require(_0xb863('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d4f94,_0x52d601){_0x52d601=_0x52d601||0xcc;return function(_0x4f19ea){if(_0x4f19ea){return _0x4d4f94[_0xb863('0x18')](_0x52d601);}return _0x4d4f94[_0xb863('0x19')](_0x52d601)[_0xb863('0x1a')]();};}function respondWithResult(_0x4a8423,_0x5b89af){_0x5b89af=_0x5b89af||0xc8;return function(_0x5b8255){if(_0x5b8255){return _0x4a8423[_0xb863('0x19')](_0x5b89af)[_0xb863('0x1b')](_0x5b8255);}};}function respondWithFilteredResult(_0xe16bb9,_0xfd3b44){return function(_0x166c77){if(_0x166c77){var _0xba331d=typeof _0xfd3b44[_0xb863('0x1c')]===_0xb863('0x1d')&&typeof _0xfd3b44[_0xb863('0x1e')]===_0xb863('0x1d');var _0x1622bd=_0x166c77[_0xb863('0x1f')];var _0xfbeb60=_0xba331d?0x0:_0xfd3b44[_0xb863('0x1c')];var _0x1e860d=_0xba331d?_0x166c77['count']:_0xfd3b44[_0xb863('0x1c')]+_0xfd3b44[_0xb863('0x1e')];var _0x1db236;if(_0x1e860d>=_0x1622bd){_0x1e860d=_0x1622bd;_0x1db236=0xc8;}else{_0x1db236=0xce;}_0xe16bb9[_0xb863('0x19')](_0x1db236);return _0xe16bb9[_0xb863('0x20')]('Content-Range',_0xfbeb60+'-'+_0x1e860d+'/'+_0x1622bd)[_0xb863('0x1b')](_0x166c77);}return null;};}function patchUpdates(_0x1566bb){return function(_0x40d493){try{jsonpatch[_0xb863('0x21')](_0x40d493,_0x1566bb,!![]);}catch(_0x268b67){return BPromise[_0xb863('0x22')](_0x268b67);}return _0x40d493['save']();};}function saveUpdates(_0x2603dc,_0x175c5e){return function(_0x128247){if(_0x128247){return _0x128247[_0xb863('0x23')](_0x2603dc)['then'](function(_0x56dafa){return _0x56dafa;});}return null;};}function removeEntity(_0x3c3ec3,_0x4e1822){return function(_0x5abcea){if(_0x5abcea){return _0x5abcea[_0xb863('0x24')]()[_0xb863('0x25')](function(){_0x3c3ec3[_0xb863('0x19')](0xcc)[_0xb863('0x1a')]();});}};}function handleEntityNotFound(_0xf5bbcb,_0x47dbbe){return function(_0x5d0134){if(!_0x5d0134){_0xf5bbcb[_0xb863('0x18')](0x194);}return _0x5d0134;};}function handleError(_0x3d8265,_0xe7561b){_0xe7561b=_0xe7561b||0x1f4;return function(_0x46c1e1){logger[_0xb863('0x26')](_0x46c1e1[_0xb863('0x27')]);if(_0x46c1e1[_0xb863('0x28')]){delete _0x46c1e1['name'];}_0x3d8265['status'](_0xe7561b)[_0xb863('0x29')](_0x46c1e1);};}exports[_0xb863('0x2a')]=function(_0x201e3d,_0x172079){var _0x31eda1={},_0x4cd1a2={},_0xb17283={'count':0x0,'rows':[]};var _0x2f2ef5=_[_0xb863('0x2b')](db['JscriptySessionReport'][_0xb863('0x2c')],function(_0x5ddca3){return{'name':_0x5ddca3['fieldName'],'type':_0x5ddca3['type'][_0xb863('0x2d')]};});_0x4cd1a2[_0xb863('0x2e')]=_[_0xb863('0x2b')](_0x2f2ef5,_0xb863('0x28'));_0x4cd1a2[_0xb863('0x2f')]=_['keys'](_0x201e3d[_0xb863('0x2f')]);_0x4cd1a2['filters']=_[_0xb863('0x30')](_0x4cd1a2[_0xb863('0x2e')],_0x4cd1a2[_0xb863('0x2f')]);_0x31eda1[_0xb863('0x31')]=_[_0xb863('0x30')](_0x4cd1a2[_0xb863('0x2e')],qs[_0xb863('0x32')](_0x201e3d[_0xb863('0x2f')][_0xb863('0x32')]));_0x31eda1[_0xb863('0x31')]=_0x31eda1['attributes']['length']?_0x31eda1[_0xb863('0x31')]:_0x4cd1a2[_0xb863('0x2e')];if(!_0x201e3d['query'][_0xb863('0x33')](_0xb863('0x34'))){_0x31eda1[_0xb863('0x1e')]=qs['limit'](_0x201e3d['query'][_0xb863('0x1e')]);_0x31eda1[_0xb863('0x1c')]=qs[_0xb863('0x1c')](_0x201e3d['query']['offset']);}_0x31eda1[_0xb863('0x35')]=qs['sort'](_0x201e3d[_0xb863('0x2f')][_0xb863('0x36')]);_0x31eda1[_0xb863('0x37')]=qs[_0xb863('0x38')](_[_0xb863('0x39')](_0x201e3d[_0xb863('0x2f')],_0x4cd1a2['filters']),_0x2f2ef5);if(_0x201e3d[_0xb863('0x2f')]['filter']){_0x31eda1[_0xb863('0x37')]=_['merge'](_0x31eda1['where'],{'$or':_[_0xb863('0x2b')](_0x2f2ef5,function(_0x6e1c1d){if(_0x6e1c1d['type']!=='VIRTUAL'){var _0x1729e9={};_0x1729e9[_0x6e1c1d[_0xb863('0x28')]]={'$like':'%'+_0x201e3d[_0xb863('0x2f')][_0xb863('0x3a')]+'%'};return _0x1729e9;}})});}_0x31eda1=_['merge']({},_0x31eda1,_0x201e3d[_0xb863('0x3b')]);var _0x16d7b5={'where':_0x31eda1[_0xb863('0x37')]};return db['JscriptySessionReport'][_0xb863('0x1f')](_0x16d7b5)['then'](function(_0x25ee77){_0xb17283[_0xb863('0x1f')]=_0x25ee77;if(_0x201e3d[_0xb863('0x2f')][_0xb863('0x3c')]){_0x31eda1[_0xb863('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xb863('0x3e')](_0x31eda1);})[_0xb863('0x25')](function(_0xec8c84){_0xb17283['rows']=_0xec8c84;return _0xb17283;})[_0xb863('0x25')](respondWithFilteredResult(_0x172079,_0x31eda1))[_0xb863('0x3f')](handleError(_0x172079,null));};exports[_0xb863('0x40')]=function(_0x3e7b44,_0xb22d39){var _0xae62b9={'raw':!![],'where':{'id':_0x3e7b44[_0xb863('0x41')]['id']}},_0x561e01={};_0x561e01[_0xb863('0x2e')]=_['keys'](db[_0xb863('0x42')][_0xb863('0x2c')]);_0x561e01[_0xb863('0x2f')]=_[_0xb863('0x43')](_0x3e7b44[_0xb863('0x2f')]);_0x561e01[_0xb863('0x38')]=_[_0xb863('0x30')](_0x561e01[_0xb863('0x2e')],_0x561e01[_0xb863('0x2f')]);_0xae62b9['attributes']=_['intersection'](_0x561e01[_0xb863('0x2e')],qs[_0xb863('0x32')](_0x3e7b44['query'][_0xb863('0x32')]));_0xae62b9['attributes']=_0xae62b9[_0xb863('0x31')][_0xb863('0x44')]?_0xae62b9[_0xb863('0x31')]:_0x561e01['model'];if(_0x3e7b44[_0xb863('0x2f')][_0xb863('0x3c')]){_0xae62b9[_0xb863('0x3d')]=[{'all':!![]}];}_0xae62b9=_[_0xb863('0x45')]({},_0xae62b9,_0x3e7b44[_0xb863('0x3b')]);return db[_0xb863('0x42')][_0xb863('0x46')](_0xae62b9)[_0xb863('0x25')](handleEntityNotFound(_0xb22d39,null))[_0xb863('0x25')](respondWithResult(_0xb22d39,null))[_0xb863('0x3f')](handleError(_0xb22d39,null));};exports[_0xb863('0x47')]=function(_0x540cf9,_0xc619fd){return db[_0xb863('0x42')][_0xb863('0x47')](_0x540cf9[_0xb863('0x48')],{})['then'](respondWithResult(_0xc619fd,0xc9))[_0xb863('0x3f')](handleError(_0xc619fd,null));};exports[_0xb863('0x23')]=function(_0xca0d62,_0x104172){if(_0xca0d62[_0xb863('0x48')]['id']){delete _0xca0d62[_0xb863('0x48')]['id'];}return db[_0xb863('0x42')][_0xb863('0x46')]({'where':{'id':_0xca0d62[_0xb863('0x41')]['id']}})[_0xb863('0x25')](handleEntityNotFound(_0x104172,null))[_0xb863('0x25')](saveUpdates(_0xca0d62[_0xb863('0x48')],null))['then'](respondWithResult(_0x104172,null))[_0xb863('0x3f')](handleError(_0x104172,null));};exports['destroy']=function(_0x4332af,_0x496bb5){return db[_0xb863('0x42')][_0xb863('0x46')]({'where':{'id':_0x4332af[_0xb863('0x41')]['id']}})[_0xb863('0x25')](handleEntityNotFound(_0x496bb5,null))['then'](removeEntity(_0x496bb5,null))['catch'](handleError(_0x496bb5,null));};exports[_0xb863('0x49')]=function(_0x108138,_0xbda0cf){return db[_0xb863('0x42')][_0xb863('0x49')]()[_0xb863('0x25')](respondWithResult(_0xbda0cf,null))[_0xb863('0x3f')](handleError(_0xbda0cf,null));};exports[_0xb863('0x4a')]=function(_0x3419bb,_0x42d581,_0x1c7f89){var _0xcd5cf9={'raw':!![],'where':{}};var _0x29e86f={};var _0x401f29={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xb863('0x4b')]({'where':{'id':_0x3419bb[_0xb863('0x41')]['id']}})[_0xb863('0x25')](handleEntityNotFound(_0x42d581,null))[_0xb863('0x25')](function(_0x18d6fc){if(_0x18d6fc){_0x29e86f[_0xb863('0x2e')]=_[_0xb863('0x43')](db[_0xb863('0x4c')][_0xb863('0x2c')]);_0x29e86f[_0xb863('0x2f')]=_[_0xb863('0x43')](_0x3419bb[_0xb863('0x2f')]);_0x29e86f[_0xb863('0x38')]=_[_0xb863('0x30')](_0x29e86f[_0xb863('0x2e')],_0x29e86f[_0xb863('0x2f')]);_0xcd5cf9['attributes']=_[_0xb863('0x30')](_0x29e86f[_0xb863('0x2e')],qs[_0xb863('0x32')](_0x3419bb[_0xb863('0x2f')][_0xb863('0x32')]));_0xcd5cf9['attributes']=_0xcd5cf9[_0xb863('0x31')]['length']?_0xcd5cf9[_0xb863('0x31')]:_0x29e86f[_0xb863('0x2e')];if(!_0x3419bb[_0xb863('0x2f')][_0xb863('0x33')](_0xb863('0x34'))){_0xcd5cf9[_0xb863('0x1e')]=qs['limit'](_0x3419bb[_0xb863('0x2f')][_0xb863('0x1e')]);_0xcd5cf9[_0xb863('0x1c')]=qs[_0xb863('0x1c')](_0x3419bb['query'][_0xb863('0x1c')]);}_0xcd5cf9[_0xb863('0x35')]=qs['sort'](_0x3419bb[_0xb863('0x2f')][_0xb863('0x36')]);_0xcd5cf9['where']=qs[_0xb863('0x38')](_[_0xb863('0x39')](_0x3419bb[_0xb863('0x2f')],_0x29e86f[_0xb863('0x38')]));_0xcd5cf9[_0xb863('0x37')]['SessionId']=_0x18d6fc['id'];if(_0x3419bb[_0xb863('0x2f')][_0xb863('0x3a')]){_0xcd5cf9['where']=_[_0xb863('0x45')](_0xcd5cf9[_0xb863('0x37')],{'$or':_[_0xb863('0x2b')](_0xcd5cf9[_0xb863('0x31')],function(_0x404e05){var _0x5a9f4a={};_0x5a9f4a[_0x404e05]={'$like':'%'+_0x3419bb[_0xb863('0x2f')][_0xb863('0x3a')]+'%'};return _0x5a9f4a;})});}_0xcd5cf9=_[_0xb863('0x45')]({},_0xcd5cf9,_0x3419bb[_0xb863('0x3b')]);return db['JscriptyQuestionReport'][_0xb863('0x1f')]({'where':_0xcd5cf9['where']})['then'](function(_0x5ad144){_0x401f29[_0xb863('0x1f')]=_0x5ad144;if(_0x3419bb['query'][_0xb863('0x3c')]){_0xcd5cf9[_0xb863('0x3d')]=[{'all':!![]}];}return db[_0xb863('0x4c')]['findAll'](_0xcd5cf9);})[_0xb863('0x25')](function(_0x210647){_0x401f29[_0xb863('0x4d')]=_0x210647;return _0x401f29;});}})[_0xb863('0x25')](respondWithFilteredResult(_0x42d581,_0xcd5cf9))[_0xb863('0x3f')](handleError(_0x42d581,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 41510cc..03b1963 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 _0xed1c=['exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','request-promise','path','rimraf','./jscriptySessionReport.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xed1c,0xe4));var _0xced1=function(_0x355af1,_0xc731cb){_0x355af1=_0x355af1-0x0;var _0xd92ce=_0xed1c[_0x355af1];return _0xd92ce;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x193685,_0x2802b5){var _0x159aaa=function(_0x3789cb){while(--_0x3789cb){_0x193685['push'](_0x193685['shift']());}};_0x159aaa(++_0x2802b5);}(_0x687b,0x14a));var _0xb687=function(_0x1c9863,_0xe952b2){_0x1c9863=_0x1c9863-0x0;var _0x104660=_0x687b[_0x1c9863];return _0x104660;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'report_jscripty_sessions','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 10505ca..9ec7ace 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 _0x1967=['then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\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(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x1967,0x173));var _0x7196=function(_0x2adba5,_0x2a747f){_0x2adba5=_0x2adba5-0x0;var _0x1f8cb7=_0x1967[_0x2adba5];return _0x1f8cb7;};'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 +var _0x0a6b=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','randomstring'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x4d9c72,_0x44de9e){_0x4d9c72=_0x4d9c72-0x0;var _0x3be3b9=_0x0a6b[_0x4d9c72];return _0x3be3b9;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('JscriptySessionReport,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 96d58fb..4db38cf 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 _0x1ac8=['put','/:id','update','/download_log_file','isAuthenticated','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0x165ed7,_0x28468a){var _0x569ddb=function(_0x41019c){while(--_0x41019c){_0x165ed7['push'](_0x165ed7['shift']());}};_0x569ddb(++_0x28468a);}(_0x1ac8,0x16d));var _0x81ac=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1ac8[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x81ac('0x0'));var util=require(_0x81ac('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x81ac('0x2'));var router=express[_0x81ac('0x3')]();var fs_extra=require(_0x81ac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x81ac('0x5'));var config=require(_0x81ac('0x6'));var controller=require(_0x81ac('0x7'));router[_0x81ac('0x8')]('/',controller[_0x81ac('0x9')]);router[_0x81ac('0xa')](_0x81ac('0xb'),auth['isAuthenticated'](),controller[_0x81ac('0xc')]);router[_0x81ac('0x8')](_0x81ac('0xd'),auth[_0x81ac('0xe')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file +var _0xd3f2=['get','index','put','isAuthenticated','/download_log_file','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x486487,_0x5462a0){var _0x366014=function(_0x2e0158){while(--_0x2e0158){_0x486487['push'](_0x486487['shift']());}};_0x366014(++_0x5462a0);}(_0xd3f2,0x102));var _0x2d3f=function(_0x11a05f,_0x38a6af){_0x11a05f=_0x11a05f-0x0;var _0xdfea63=_0xd3f2[_0x11a05f];return _0xdfea63;};'use strict';var multer=require(_0x2d3f('0x0'));var util=require(_0x2d3f('0x1'));var path=require(_0x2d3f('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d3f('0x3'));var router=express['Router']();var fs_extra=require(_0x2d3f('0x4'));var auth=require(_0x2d3f('0x5'));var interaction=require(_0x2d3f('0x6'));var config=require(_0x2d3f('0x7'));var controller=require('./license.controller');router[_0x2d3f('0x8')]('/',controller[_0x2d3f('0x9')]);router[_0x2d3f('0xa')]('/:id',auth[_0x2d3f('0xb')](),controller['update']);router[_0x2d3f('0x8')](_0x2d3f('0xc'),auth[_0x2d3f('0xb')](),controller['downloadLogFile']);module[_0x2d3f('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b528f30..e284aa8 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 _0xb5d3=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x3a9967,_0x2dbf76){var _0xcb5b48=function(_0x89cb54){while(--_0x89cb54){_0x3a9967['push'](_0x3a9967['shift']());}};_0xcb5b48(++_0x2dbf76);}(_0xb5d3,0x16f));var _0x3b5d=function(_0x589eb4,_0xaa2019){_0x589eb4=_0x589eb4-0x0;var _0xf50816=_0xb5d3[_0x589eb4];return _0xf50816;};'use strict';var Sequelize=require(_0x3b5d('0x0'));module[_0x3b5d('0x1')]={'license':{'type':Sequelize[_0x3b5d('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x3b5d('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x3b5d('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3d66=['INTEGER','sequelize','STRING'];(function(_0xec9b1,_0x5c8c6c){var _0x5eda85=function(_0x297ce8){while(--_0x297ce8){_0xec9b1['push'](_0xec9b1['shift']());}};_0x5eda85(++_0x5c8c6c);}(_0x3d66,0x6a));var _0x63d6=function(_0xa45c87,_0x783585){_0xa45c87=_0xa45c87-0x0;var _0x28579f=_0x3d66[_0xa45c87];return _0x28579f;};'use strict';var Sequelize=require(_0x63d6('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x63d6('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x63d6('0x2')],'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 7bb4c00..e374207 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 _0x56c6=['model','attributes','fields','merge','getLicense','catch','body','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','then','destroy','end','error','stack','name','send','index','keys','query','filters','intersection'];(function(_0x3e6f8c,_0x5152cd){var _0x19d848=function(_0x340f9e){while(--_0x340f9e){_0x3e6f8c['push'](_0x3e6f8c['shift']());}};_0x19d848(++_0x5152cd);}(_0x56c6,0xa5));var _0x656c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x56c6[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x656c('0x0'));var rimraf=require(_0x656c('0x1'));var zipdir=require(_0x656c('0x2'));var jsonpatch=require(_0x656c('0x3'));var rp=require(_0x656c('0x4'));var moment=require(_0x656c('0x5'));var BPromise=require(_0x656c('0x6'));var Mustache=require(_0x656c('0x7'));var util=require('util');var path=require(_0x656c('0x8'));var sox=require(_0x656c('0x9'));var csv=require(_0x656c('0xa'));var ejs=require(_0x656c('0xb'));var fs=require('fs');var fs_extra=require(_0x656c('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x656c('0xd'));var jsforce=require(_0x656c('0xe'));var deskjs=require(_0x656c('0xf'));var toCsv=require(_0x656c('0xa'));var querystring=require(_0x656c('0x10'));var Papa=require(_0x656c('0x11'));var Redis=require(_0x656c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x656c('0x13'));var hardwareService=require(_0x656c('0x14'));var logger=require(_0x656c('0x15'))(_0x656c('0x16'));var utils=require('../../config/utils');var config=require(_0x656c('0x17'));var licenseUtil=require(_0x656c('0x18'));var db=require(_0x656c('0x19'))['db'];function respondWithStatusCode(_0x10441f,_0x42b2f3){_0x42b2f3=_0x42b2f3||0xcc;return function(_0x53a891){if(_0x53a891){return _0x10441f[_0x656c('0x1a')](_0x42b2f3);}return _0x10441f[_0x656c('0x1b')](_0x42b2f3)['end']();};}function respondWithResult(_0x1ed512,_0x5e0e71){_0x5e0e71=_0x5e0e71||0xc8;return function(_0x51a514){if(_0x51a514){return _0x1ed512['status'](_0x5e0e71)[_0x656c('0x1c')](_0x51a514);}};}function respondWithFilteredResult(_0x4aeee7,_0xa29662){return function(_0x733713){if(_0x733713){var _0x5cecec=typeof _0xa29662[_0x656c('0x1d')]==='undefined'&&typeof _0xa29662[_0x656c('0x1e')]===_0x656c('0x1f');var _0x21a35e=_0x733713[_0x656c('0x20')];var _0x2fb2cc=_0x5cecec?0x0:_0xa29662[_0x656c('0x1d')];var _0x44f04a=_0x5cecec?_0x733713[_0x656c('0x20')]:_0xa29662[_0x656c('0x1d')]+_0xa29662[_0x656c('0x1e')];var _0x497427;if(_0x44f04a>=_0x21a35e){_0x44f04a=_0x21a35e;_0x497427=0xc8;}else{_0x497427=0xce;}_0x4aeee7[_0x656c('0x1b')](_0x497427);return _0x4aeee7[_0x656c('0x21')]('Content-Range',_0x2fb2cc+'-'+_0x44f04a+'/'+_0x21a35e)['json'](_0x733713);}return null;};}function patchUpdates(_0x2416b8){return function(_0x3a60ac){try{jsonpatch['apply'](_0x3a60ac,_0x2416b8,!![]);}catch(_0x2d3947){return BPromise[_0x656c('0x22')](_0x2d3947);}return _0x3a60ac[_0x656c('0x23')]();};}function saveUpdates(_0x473513,_0x420f41){return function(_0x4459dc){if(_0x4459dc){return _0x4459dc['update'](_0x473513)[_0x656c('0x24')](function(_0x241a51){return _0x241a51;});}return null;};}function removeEntity(_0x21a612,_0x24cd59){return function(_0x469da5){if(_0x469da5){return _0x469da5[_0x656c('0x25')]()[_0x656c('0x24')](function(){_0x21a612['status'](0xcc)[_0x656c('0x26')]();});}};}function handleEntityNotFound(_0x5d98b6,_0x5127f4){return function(_0x423ba9){if(!_0x423ba9){_0x5d98b6[_0x656c('0x1a')](0x194);}return _0x423ba9;};}function handleError(_0x5d5c19,_0x521e2c){_0x521e2c=_0x521e2c||0x1f4;return function(_0x396144){logger[_0x656c('0x27')](_0x396144[_0x656c('0x28')]);if(_0x396144[_0x656c('0x29')]){delete _0x396144[_0x656c('0x29')];}_0x5d5c19[_0x656c('0x1b')](_0x521e2c)[_0x656c('0x2a')](_0x396144);};}var utilLicense=require(_0x656c('0x18'));exports[_0x656c('0x2b')]=function(_0x3260a9,_0x2141b6){var _0x37907a={'raw':!![],'where':{'id':0x1}},_0x49af65={};_0x49af65['model']=_[_0x656c('0x2c')](db['License']['rawAttributes']);_0x49af65[_0x656c('0x2d')]=_[_0x656c('0x2c')](_0x3260a9['query']);_0x49af65[_0x656c('0x2e')]=_[_0x656c('0x2f')](_0x49af65[_0x656c('0x30')],_0x49af65[_0x656c('0x2d')]);_0x37907a[_0x656c('0x31')]=_['intersection'](_0x49af65[_0x656c('0x30')],qs[_0x656c('0x32')](_0x3260a9[_0x656c('0x2d')]['fields']));_0x37907a[_0x656c('0x31')]=_0x37907a['attributes']['length']?_0x37907a[_0x656c('0x31')]:_0x49af65[_0x656c('0x30')];_0x37907a=_[_0x656c('0x33')]({},_0x37907a,_0x3260a9['options']);return utilLicense[_0x656c('0x34')](_0x37907a)[_0x656c('0x24')](respondWithResult(_0x2141b6,null))[_0x656c('0x35')](handleError(_0x2141b6,null));};exports['update']=function(_0x223a00,_0x24bfbc){if(_0x223a00[_0x656c('0x36')]['id']){delete _0x223a00['body']['id'];}return db['License'][_0x656c('0x37')]({'where':{'id':_0x223a00[_0x656c('0x38')]['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x24bfbc,null))[_0x656c('0x24')](function(_0x4fda6f){var _0x401389=_0x4fda6f[_0x656c('0x39')]({'plain':!![]});return utilLicense[_0x656c('0x3a')](_0x401389,_0x223a00[_0x656c('0x36')][_0x656c('0x3b')]);})['then'](function(_0x484974){if(!_0x484974[_0x656c('0x3c')]){return saveUpdates(_0x223a00[_0x656c('0x36')],null);}return _0x484974;})['then'](respondWithResult(_0x24bfbc,null))[_0x656c('0x35')](handleError(_0x24bfbc,null));};exports[_0x656c('0x3d')]=function(_0x21b07c,_0x24b21d){var _0x3247fa=_0x656c('0x3e');var _0x2fe291=path[_0x656c('0x3f')](_0x656c('0x40'),'log',_0x656c('0x41'),_0x3247fa);_0x24b21d['setHeader'](_0x656c('0x42'),_0x656c('0x43')+_0x3247fa);_0x24b21d[_0x656c('0x21')](_0x656c('0x44'),_0x656c('0x45'));_0x24b21d[_0x656c('0x46')](_0x2fe291);}; \ No newline at end of file +var _0x3923=['reject','destroy','error','stack','name','send','index','model','License','rawAttributes','keys','query','filters','attributes','intersection','fields','length','merge','options','getLicense','catch','body','find','params','then','get','demo','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','set','Content-Type','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply'];(function(_0x757c14,_0x23b0f4){var _0x57596a=function(_0x1b9507){while(--_0x1b9507){_0x757c14['push'](_0x757c14['shift']());}};_0x57596a(++_0x23b0f4);}(_0x3923,0x107));var _0x3392=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3923[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x3392('0x0'));var rimraf=require(_0x3392('0x1'));var zipdir=require(_0x3392('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3392('0x3'));var moment=require('moment');var BPromise=require(_0x3392('0x4'));var Mustache=require(_0x3392('0x5'));var util=require(_0x3392('0x6'));var path=require(_0x3392('0x7'));var sox=require(_0x3392('0x8'));var csv=require(_0x3392('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3392('0xa'));var squel=require(_0x3392('0xb'));var crypto=require(_0x3392('0xc'));var jsforce=require(_0x3392('0xd'));var deskjs=require(_0x3392('0xe'));var toCsv=require(_0x3392('0x9'));var querystring=require(_0x3392('0xf'));var Papa=require(_0x3392('0x10'));var Redis=require(_0x3392('0x11'));var authService=require(_0x3392('0x12'));var qs=require(_0x3392('0x13'));var as=require(_0x3392('0x14'));var hardwareService=require(_0x3392('0x15'));var logger=require(_0x3392('0x16'))(_0x3392('0x17'));var utils=require(_0x3392('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3392('0x19'));var db=require(_0x3392('0x1a'))['db'];function respondWithStatusCode(_0x2ea4b4,_0x3d95d7){_0x3d95d7=_0x3d95d7||0xcc;return function(_0x5d4664){if(_0x5d4664){return _0x2ea4b4[_0x3392('0x1b')](_0x3d95d7);}return _0x2ea4b4['status'](_0x3d95d7)[_0x3392('0x1c')]();};}function respondWithResult(_0x25c2c7,_0x7177bb){_0x7177bb=_0x7177bb||0xc8;return function(_0x5a61c0){if(_0x5a61c0){return _0x25c2c7[_0x3392('0x1d')](_0x7177bb)[_0x3392('0x1e')](_0x5a61c0);}};}function respondWithFilteredResult(_0x32aa77,_0x2a81ff){return function(_0x331aed){if(_0x331aed){var _0x55895a=typeof _0x2a81ff[_0x3392('0x1f')]==='undefined'&&typeof _0x2a81ff[_0x3392('0x20')]===_0x3392('0x21');var _0x1beeaa=_0x331aed[_0x3392('0x22')];var _0x2a358f=_0x55895a?0x0:_0x2a81ff[_0x3392('0x1f')];var _0x13bcb3=_0x55895a?_0x331aed[_0x3392('0x22')]:_0x2a81ff['offset']+_0x2a81ff[_0x3392('0x20')];var _0x50183b;if(_0x13bcb3>=_0x1beeaa){_0x13bcb3=_0x1beeaa;_0x50183b=0xc8;}else{_0x50183b=0xce;}_0x32aa77[_0x3392('0x1d')](_0x50183b);return _0x32aa77['set'](_0x3392('0x23'),_0x2a358f+'-'+_0x13bcb3+'/'+_0x1beeaa)[_0x3392('0x1e')](_0x331aed);}return null;};}function patchUpdates(_0x5cab65){return function(_0x42e13a){try{jsonpatch[_0x3392('0x24')](_0x42e13a,_0x5cab65,!![]);}catch(_0x25a97c){return BPromise[_0x3392('0x25')](_0x25a97c);}return _0x42e13a['save']();};}function saveUpdates(_0x2e6237,_0x4fb939){return function(_0x2be69c){if(_0x2be69c){return _0x2be69c['update'](_0x2e6237)['then'](function(_0x465045){return _0x465045;});}return null;};}function removeEntity(_0x6e920,_0x1aed68){return function(_0x3435b8){if(_0x3435b8){return _0x3435b8[_0x3392('0x26')]()['then'](function(){_0x6e920['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e0ac9,_0xe0eaa8){return function(_0x387137){if(!_0x387137){_0x1e0ac9[_0x3392('0x1b')](0x194);}return _0x387137;};}function handleError(_0x385b03,_0x3a3160){_0x3a3160=_0x3a3160||0x1f4;return function(_0x3eda49){logger[_0x3392('0x27')](_0x3eda49[_0x3392('0x28')]);if(_0x3eda49['name']){delete _0x3eda49[_0x3392('0x29')];}_0x385b03[_0x3392('0x1d')](_0x3a3160)[_0x3392('0x2a')](_0x3eda49);};}var utilLicense=require('../../config/license/util');exports[_0x3392('0x2b')]=function(_0x23aedb,_0x205d20){var _0x12a234={'raw':!![],'where':{'id':0x1}},_0x2a2bd8={};_0x2a2bd8[_0x3392('0x2c')]=_['keys'](db[_0x3392('0x2d')][_0x3392('0x2e')]);_0x2a2bd8['query']=_[_0x3392('0x2f')](_0x23aedb[_0x3392('0x30')]);_0x2a2bd8[_0x3392('0x31')]=_['intersection'](_0x2a2bd8[_0x3392('0x2c')],_0x2a2bd8[_0x3392('0x30')]);_0x12a234[_0x3392('0x32')]=_[_0x3392('0x33')](_0x2a2bd8['model'],qs[_0x3392('0x34')](_0x23aedb[_0x3392('0x30')][_0x3392('0x34')]));_0x12a234[_0x3392('0x32')]=_0x12a234['attributes'][_0x3392('0x35')]?_0x12a234[_0x3392('0x32')]:_0x2a2bd8[_0x3392('0x2c')];_0x12a234=_[_0x3392('0x36')]({},_0x12a234,_0x23aedb[_0x3392('0x37')]);return utilLicense[_0x3392('0x38')](_0x12a234)['then'](respondWithResult(_0x205d20,null))[_0x3392('0x39')](handleError(_0x205d20,null));};exports['update']=function(_0x275b81,_0x3576e0){if(_0x275b81[_0x3392('0x3a')]['id']){delete _0x275b81[_0x3392('0x3a')]['id'];}return db['License'][_0x3392('0x3b')]({'where':{'id':_0x275b81[_0x3392('0x3c')]['id']}})[_0x3392('0x3d')](handleEntityNotFound(_0x3576e0,null))[_0x3392('0x3d')](function(_0x29745d){var _0x1e2c29=_0x29745d[_0x3392('0x3e')]({'plain':!![]});return utilLicense['checkLicense'](_0x1e2c29,_0x275b81[_0x3392('0x3a')]['key']);})[_0x3392('0x3d')](function(_0x1926eb){if(!_0x1926eb[_0x3392('0x3f')]){return saveUpdates(_0x275b81[_0x3392('0x3a')],null);}return _0x1926eb;})[_0x3392('0x3d')](respondWithResult(_0x3576e0,null))[_0x3392('0x39')](handleError(_0x3576e0,null));};exports[_0x3392('0x40')]=function(_0x553d9d,_0x1f5e6d){var _0x46cdfb=_0x3392('0x41');var _0x5605ca=path[_0x3392('0x42')](_0x3392('0x43'),_0x3392('0x44'),_0x3392('0x45'),_0x46cdfb);_0x1f5e6d['setHeader'](_0x3392('0x46'),_0x3392('0x47')+_0x46cdfb);_0x1f5e6d[_0x3392('0x48')](_0x3392('0x49'),'text/plain');_0x1f5e6d[_0x3392('0x4a')](_0x5605ca);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 6f93ab6..19a3149 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 _0x57a8=['define','License','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x3e83f1,_0x1b09ae){var _0x28cd96=function(_0x2ffc3e){while(--_0x2ffc3e){_0x3e83f1['push'](_0x3e83f1['shift']());}};_0x28cd96(++_0x1b09ae);}(_0x57a8,0x122));var _0x857a=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0x57a8[_0x54d49e];return _0x4af0f1;};'use strict';var _=require(_0x857a('0x0'));var util=require(_0x857a('0x1'));var logger=require(_0x857a('0x2'))(_0x857a('0x3'));var moment=require(_0x857a('0x4'));var BPromise=require('bluebird');var rp=require(_0x857a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x857a('0x6'));var config=require(_0x857a('0x7'));var attributes=require(_0x857a('0x8'));module[_0x857a('0x9')]=function(_0x2c6fdf,_0x6c62d0){return _0x2c6fdf[_0x857a('0xa')](_0x857a('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14a=['rimraf','exports','define','License','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x344179,_0xb1c8a7){var _0x38fb32=function(_0x601710){while(--_0x601710){_0x344179['push'](_0x344179['shift']());}};_0x38fb32(++_0xb1c8a7);}(_0xe14a,0x1c7));var _0xae14=function(_0x13563d,_0x40cfd1){_0x13563d=_0x13563d-0x0;var _0x2ced93=_0xe14a[_0x13563d];return _0x2ced93;};'use strict';var _=require(_0xae14('0x0'));var util=require(_0xae14('0x1'));var logger=require(_0xae14('0x2'))(_0xae14('0x3'));var moment=require(_0xae14('0x4'));var BPromise=require(_0xae14('0x5'));var rp=require(_0xae14('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae14('0x7'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0xae14('0x8')]=function(_0x482a47,_0x47571f){return _0x482a47[_0xae14('0x9')](_0xae14('0xa'),attributes,{'tableName':'license','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 aff8098..d15ef99 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 _0x19c9=['client','request','then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1f25e4,_0x3b5df6){var _0xcd07e5=function(_0x225b31){while(--_0x225b31){_0x1f25e4['push'](_0x1f25e4['shift']());}};_0xcd07e5(++_0x3b5df6);}(_0x19c9,0x1aa));var _0x919c=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x19c9[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x919c('0x0'));var util=require(_0x919c('0x1'));var moment=require(_0x919c('0x2'));var BPromise=require('bluebird');var rs=require(_0x919c('0x3'));var fs=require('fs');var Redis=require(_0x919c('0x4'));var db=require(_0x919c('0x5'))['db'];var utils=require(_0x919c('0x6'));var logger=require(_0x919c('0x7'))(_0x919c('0x8'));var config=require(_0x919c('0x9'));var jayson=require(_0x919c('0xa'));var client=jayson[_0x919c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c8603,_0x358f8b,_0x68e5b2){return new BPromise(function(_0x4a8841,_0x340f17){return client[_0x919c('0xc')](_0x5c8603,_0x68e5b2)[_0x919c('0xd')](function(_0x3d7f1d){logger['info'](_0x919c('0xe'),_0x358f8b,_0x919c('0xf'));logger['debug'](_0x919c('0x10'),_0x358f8b,_0x919c('0xf'),JSON['stringify'](_0x3d7f1d));if(_0x3d7f1d[_0x919c('0x11')]){if(_0x3d7f1d[_0x919c('0x11')][_0x919c('0x12')]===0x1f4){logger[_0x919c('0x11')]('License,\x20%s,\x20%s',_0x358f8b,_0x3d7f1d[_0x919c('0x11')][_0x919c('0x13')]);return _0x340f17(_0x3d7f1d[_0x919c('0x11')]['message']);}logger[_0x919c('0x11')]('License,\x20%s,\x20%s',_0x358f8b,_0x3d7f1d[_0x919c('0x11')][_0x919c('0x13')]);return _0x4a8841(_0x3d7f1d[_0x919c('0x11')][_0x919c('0x13')]);}else{logger[_0x919c('0x14')](_0x919c('0xe'),_0x358f8b,_0x919c('0xf'));_0x4a8841(_0x3d7f1d[_0x919c('0x15')][_0x919c('0x13')]);}})[_0x919c('0x16')](function(_0x22ef7e){logger[_0x919c('0x11')](_0x919c('0xe'),_0x358f8b,_0x22ef7e);_0x340f17(_0x22ef7e);});});} \ No newline at end of file +var _0x6919=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then'];(function(_0x309eb5,_0x36c7cf){var _0x1fa11e=function(_0x3e1106){while(--_0x3e1106){_0x309eb5['push'](_0x309eb5['shift']());}};_0x1fa11e(++_0x36c7cf);}(_0x6919,0x199));var _0x9691=function(_0x19688b,_0x5cae76){_0x19688b=_0x19688b-0x0;var _0x196944=_0x6919[_0x19688b];return _0x196944;};'use strict';var _=require('lodash');var util=require(_0x9691('0x0'));var moment=require(_0x9691('0x1'));var BPromise=require(_0x9691('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9691('0x3'));var db=require(_0x9691('0x4'))['db'];var utils=require(_0x9691('0x5'));var logger=require(_0x9691('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9691('0x7'));var client=jayson[_0x9691('0x8')][_0x9691('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e724c,_0x45848b,_0xecbf17){return new BPromise(function(_0x1f568d,_0x220712){return client['request'](_0x5e724c,_0xecbf17)[_0x9691('0xa')](function(_0x3dbc16){logger['info'](_0x9691('0xb'),_0x45848b,_0x9691('0xc'));logger[_0x9691('0xd')](_0x9691('0xe'),_0x45848b,_0x9691('0xc'),JSON[_0x9691('0xf')](_0x3dbc16));if(_0x3dbc16['error']){if(_0x3dbc16[_0x9691('0x10')][_0x9691('0x11')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x45848b,_0x3dbc16[_0x9691('0x10')][_0x9691('0x12')]);return _0x220712(_0x3dbc16['error'][_0x9691('0x12')]);}logger['error']('License,\x20%s,\x20%s',_0x45848b,_0x3dbc16[_0x9691('0x10')][_0x9691('0x12')]);return _0x1f568d(_0x3dbc16[_0x9691('0x10')][_0x9691('0x12')]);}else{logger['info']('License,\x20%s,\x20%s',_0x45848b,_0x9691('0xc'));_0x1f568d(_0x3dbc16[_0x9691('0x13')][_0x9691('0x12')]);}})[_0x9691('0x14')](function(_0x1e83b6){logger[_0x9691('0x10')](_0x9691('0xb'),_0x45848b,_0x1e83b6);_0x220712(_0x1e83b6);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7f18a38..3327213 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 _0xddff=['addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create'];(function(_0x14e736,_0x46e240){var _0x5edd44=function(_0x1ba00f){while(--_0x1ba00f){_0x14e736['push'](_0x14e736['shift']());}};_0x5edd44(++_0x46e240);}(_0xddff,0x6f));var _0xfddf=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xddff[_0xdeefbd];return _0x4ff63f;};'use strict';var multer=require(_0xfddf('0x0'));var util=require(_0xfddf('0x1'));var path=require(_0xfddf('0x2'));var timeout=require('connect-timeout');var express=require(_0xfddf('0x3'));var router=express[_0xfddf('0x4')]();var fs_extra=require(_0xfddf('0x5'));var auth=require(_0xfddf('0x6'));var interaction=require(_0xfddf('0x7'));var config=require(_0xfddf('0x8'));var controller=require(_0xfddf('0x9'));router[_0xfddf('0xa')]('/',auth[_0xfddf('0xb')](),controller[_0xfddf('0xc')]);router[_0xfddf('0xa')]('/describe',auth[_0xfddf('0xb')](),controller[_0xfddf('0xd')]);router[_0xfddf('0xa')](_0xfddf('0xe'),auth[_0xfddf('0xb')](),controller[_0xfddf('0xf')]);router[_0xfddf('0xa')](_0xfddf('0x10'),auth['isAuthenticated'](),controller[_0xfddf('0x11')]);router[_0xfddf('0xa')]('/:id/canned_answers',auth[_0xfddf('0xb')](),controller[_0xfddf('0x12')]);router[_0xfddf('0xa')](_0xfddf('0x13'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x14')]);router[_0xfddf('0xa')](_0xfddf('0x15'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x16')]);router[_0xfddf('0xa')](_0xfddf('0x17'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x18')]);router[_0xfddf('0xa')](_0xfddf('0x19'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x1a')]);router['get']('/:id/messages',auth[_0xfddf('0xb')](),controller['getMessages']);router[_0xfddf('0xa')](_0xfddf('0x1b'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x1c')]);router[_0xfddf('0xa')](_0xfddf('0x1d'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x1e')]);router[_0xfddf('0x1f')](_0xfddf('0x10'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x20')]);router['post'](_0xfddf('0x21'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x22')]);router[_0xfddf('0x1f')]('/',auth['isAuthenticated'](),controller[_0xfddf('0x23')]);router[_0xfddf('0x1f')](_0xfddf('0x13'),auth[_0xfddf('0xb')](),controller['addImap']);router[_0xfddf('0x1f')]('/:id/out_servers',auth[_0xfddf('0xb')](),controller[_0xfddf('0x24')]);router[_0xfddf('0x1f')](_0xfddf('0x17'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x25')]);router['post']('/:id/applications',auth[_0xfddf('0xb')](),controller[_0xfddf('0x26')]);router['post'](_0xfddf('0x27'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x28')]);router[_0xfddf('0x1f')](_0xfddf('0x1d'),auth['isAuthenticated'](),controller[_0xfddf('0x29')]);router[_0xfddf('0x2a')](_0xfddf('0xe'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x2b')]);router[_0xfddf('0x2c')](_0xfddf('0x10'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x2d')]);router[_0xfddf('0x2c')](_0xfddf('0x21'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x2e')]);router['delete'](_0xfddf('0x13'),auth[_0xfddf('0xb')](),controller[_0xfddf('0x2f')]);router[_0xfddf('0x2c')](_0xfddf('0x15'),auth[_0xfddf('0xb')](),controller['removeSmtp']);router[_0xfddf('0x2c')]('/:id',auth['isAuthenticated'](),controller[_0xfddf('0x30')]);router[_0xfddf('0x2c')](_0xfddf('0x1d'),auth[_0xfddf('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xb30f=['get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addSmtp','addInteraction','/:id/applications','send','put','/:id','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller'];(function(_0x2b33c4,_0xc0d12){var _0x4c8039=function(_0x4d9da5){while(--_0x4d9da5){_0x2b33c4['push'](_0x2b33c4['shift']());}};_0x4c8039(++_0xc0d12);}(_0xb30f,0x7f));var _0xfb30=function(_0xea87b0,_0x3a26a9){_0xea87b0=_0xea87b0-0x0;var _0x52bced=_0xb30f[_0xea87b0];return _0x52bced;};'use strict';var multer=require(_0xfb30('0x0'));var util=require(_0xfb30('0x1'));var path=require(_0xfb30('0x2'));var timeout=require(_0xfb30('0x3'));var express=require(_0xfb30('0x4'));var router=express[_0xfb30('0x5')]();var fs_extra=require(_0xfb30('0x6'));var auth=require(_0xfb30('0x7'));var interaction=require(_0xfb30('0x8'));var config=require(_0xfb30('0x9'));var controller=require(_0xfb30('0xa'));router[_0xfb30('0xb')]('/',auth[_0xfb30('0xc')](),controller[_0xfb30('0xd')]);router['get'](_0xfb30('0xe'),auth['isAuthenticated'](),controller[_0xfb30('0xf')]);router[_0xfb30('0xb')]('/:id',auth[_0xfb30('0xc')](),controller[_0xfb30('0x10')]);router[_0xfb30('0xb')](_0xfb30('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xfb30('0xb')](_0xfb30('0x12'),auth[_0xfb30('0xc')](),controller['getAnswers']);router['get'](_0xfb30('0x13'),auth[_0xfb30('0xc')](),controller['getImap']);router['get'](_0xfb30('0x14'),auth[_0xfb30('0xc')](),controller[_0xfb30('0x15')]);router[_0xfb30('0xb')](_0xfb30('0x16'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xfb30('0xb')]('/:id/applications',auth[_0xfb30('0xc')](),controller[_0xfb30('0x17')]);router[_0xfb30('0xb')](_0xfb30('0x18'),auth['isAuthenticated'](),controller[_0xfb30('0x19')]);router[_0xfb30('0xb')](_0xfb30('0x1a'),auth[_0xfb30('0xc')](),controller[_0xfb30('0x1b')]);router[_0xfb30('0xb')](_0xfb30('0x1c'),auth['isAuthenticated'](),controller[_0xfb30('0x1d')]);router[_0xfb30('0x1e')]('/:id/dispositions',auth[_0xfb30('0xc')](),controller[_0xfb30('0x1f')]);router[_0xfb30('0x1e')]('/:id/canned_answers',auth[_0xfb30('0xc')](),controller[_0xfb30('0x20')]);router[_0xfb30('0x1e')]('/',auth['isAuthenticated'](),controller[_0xfb30('0x21')]);router[_0xfb30('0x1e')]('/:id/in_servers',auth['isAuthenticated'](),controller['addImap']);router['post'](_0xfb30('0x14'),auth[_0xfb30('0xc')](),controller[_0xfb30('0x22')]);router['post'](_0xfb30('0x16'),auth['isAuthenticated'](),controller[_0xfb30('0x23')]);router['post'](_0xfb30('0x24'),auth['isAuthenticated'](),controller['addApplications']);router[_0xfb30('0x1e')]('/:id/send',auth['isAuthenticated'](),controller[_0xfb30('0x25')]);router['post']('/:id/users',auth[_0xfb30('0xc')](),controller['addAgents']);router[_0xfb30('0x26')](_0xfb30('0x27'),auth[_0xfb30('0xc')](),controller[_0xfb30('0x28')]);router[_0xfb30('0x29')](_0xfb30('0x11'),auth[_0xfb30('0xc')](),controller[_0xfb30('0x2a')]);router[_0xfb30('0x29')](_0xfb30('0x12'),auth['isAuthenticated'](),controller[_0xfb30('0x2b')]);router['delete'](_0xfb30('0x13'),auth[_0xfb30('0xc')](),controller['removeImap']);router['delete'](_0xfb30('0x14'),auth['isAuthenticated'](),controller[_0xfb30('0x2c')]);router[_0xfb30('0x29')](_0xfb30('0x27'),auth[_0xfb30('0xc')](),controller[_0xfb30('0x2d')]);router[_0xfb30('0x29')](_0xfb30('0x1c'),auth[_0xfb30('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 5ec57bd..e66300c 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 _0xc837=['getDataValue','provider','sequelize','STRING','TEXT','BOOLEAN','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','hotmail','yahoo','outlook365'];(function(_0x48ae1d,_0x5ddeaa){var _0x47c247=function(_0x21ee6a){while(--_0x21ee6a){_0x48ae1d['push'](_0x48ae1d['shift']());}};_0x47c247(++_0x5ddeaa);}(_0xc837,0x79));var _0x7c83=function(_0x1a936f,_0x507b51){_0x1a936f=_0x1a936f-0x0;var _0x44d2e5=_0xc837[_0x1a936f];return _0x44d2e5;};'use strict';var Sequelize=require(_0x7c83('0x0'));module['exports']={'description':{'type':Sequelize[_0x7c83('0x1')]},'name':{'type':Sequelize[_0x7c83('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7c83('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x7c83('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x7c83('0x2')]},'markAsUnread':{'type':Sequelize[_0x7c83('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7c83('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x7c83('0x4')](0x2)[_0x7c83('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7c83('0x2')],'defaultValue':function(){return _0x7c83('0x6');}},'notificationSound':{'type':Sequelize[_0x7c83('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7c83('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7c83('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7c83('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c83('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7c83('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x7c83('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7c83('0x8'),'set':function(_0x3b2834){if(!_0x3b2834)this[_0x7c83('0x9')](_0x7c83('0xa'),null);this[_0x7c83('0x9')](_0x7c83('0xb'),_0x3b2834);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x7c83('0xc'),_0x7c83('0xd'),_0x7c83('0xe')),'defaultValue':null,'get':function(){if(!this[_0x7c83('0xf')]('provider'))return'custom';return this['getDataValue'](_0x7c83('0x10'));},'set':function(_0x68382e){if(_0x68382e==='custom')_0x68382e=null;return this['setDataValue']('provider',_0x68382e);}}}; \ No newline at end of file +var _0x76d8=['BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','TEXT'];(function(_0x44e69e,_0x256b3d){var _0x59db3b=function(_0x3ccaef){while(--_0x3ccaef){_0x44e69e['push'](_0x44e69e['shift']());}};_0x59db3b(++_0x256b3d);}(_0x76d8,0xe6));var _0x876d=function(_0x21fc81,_0x19c0af){_0x21fc81=_0x21fc81-0x0;var _0x57f889=_0x76d8[_0x21fc81];return _0x57f889;};'use strict';var Sequelize=require(_0x876d('0x0'));module[_0x876d('0x1')]={'description':{'type':Sequelize[_0x876d('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x876d('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x876d('0x3')]},'markAsUnread':{'type':Sequelize[_0x876d('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x876d('0x5')},'fontSize':{'type':Sequelize[_0x876d('0x6')](0x2)[_0x876d('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x876d('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x876d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x876d('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x876d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x876d('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x876d('0x4')],'defaultValue':![],'comment':_0x876d('0x9'),'set':function(_0x8a685f){if(!_0x8a685f)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x876d('0xa')](_0x876d('0xb'),_0x8a685f);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x876d('0xc'),_0x876d('0xd'),_0x876d('0xe')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return'custom';return this[_0x876d('0xf')](_0x876d('0x10'));},'set':function(_0x1b7f61){if(_0x1b7f61===_0x876d('0x11'))_0x1b7f61=null;return this['setDataValue'](_0x876d('0x10'),_0x1b7f61);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index df352ed..bded7f6 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 _0xd842=['include','findAll','show','params','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','ListId','isNil','active','description','role','UserProfileSection','userProfileId','autoAssociation','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','stack','finally','send','getApplications','MailMessage','$gte','split','format','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','subject','attach','out','messageId','YYYY-MM-DD\x20HH:mm:ss','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','addAgents','spread','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','destroy','get','MailAccounts','UserProfileResource','name','gmail','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x197a3a,_0x2591ba){var _0x5072d3=function(_0x551a6a){while(--_0x551a6a){_0x197a3a['push'](_0x197a3a['shift']());}};_0x5072d3(++_0x2591ba);}(_0xd842,0x1e9));var _0x2d84=function(_0x32effc,_0x844a12){_0x32effc=_0x32effc-0x0;var _0x58e2e8=_0xd842[_0x32effc];return _0x58e2e8;};'use strict';var moment=require(_0x2d84('0x0'));var BPromise=require(_0x2d84('0x1'));var util=require(_0x2d84('0x2'));var path=require(_0x2d84('0x3'));var _=require(_0x2d84('0x4'));var juice=require(_0x2d84('0x5'));var Redis=require('ioredis');var qs=require(_0x2d84('0x6'));var logger=require(_0x2d84('0x7'))(_0x2d84('0x8'));var config=require(_0x2d84('0x9'));var db=require('../../mysqldb')['db'];config[_0x2d84('0xa')]=_[_0x2d84('0xb')](config[_0x2d84('0xa')],{'host':_0x2d84('0xc'),'port':0x18eb});var socket=require(_0x2d84('0xd'))(new Redis(config[_0x2d84('0xa')]));require('./mailAccount.socket')[_0x2d84('0xe')](socket);var jayson=require(_0x2d84('0xf'));var client=jayson['client'][_0x2d84('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x4079aa,_0x5d8dad,_0x448c3a,_0x19e343){return new BPromise(function(_0x334236,_0x1103cf){var _0x4f9f2a=_0x19e343||client;return _0x4f9f2a['request'](_0x4079aa,_0x448c3a)[_0x2d84('0x11')](function(_0xf09d31){logger[_0x2d84('0x12')](_0x2d84('0x13'),_0x5d8dad,_0x2d84('0x14'));logger[_0x2d84('0x15')](_0x2d84('0x16'),_0x5d8dad,_0x2d84('0x14'),JSON[_0x2d84('0x17')](_0xf09d31));if(_0xf09d31['error']){if(_0xf09d31[_0x2d84('0x18')][_0x2d84('0x19')]===0x1f4){logger[_0x2d84('0x18')](_0x2d84('0x13'),_0x5d8dad,_0xf09d31['error']['message']);return _0x1103cf(_0xf09d31[_0x2d84('0x18')]['message']);}logger[_0x2d84('0x18')]('MailAccount,\x20%s,\x20%s',_0x5d8dad,_0xf09d31[_0x2d84('0x18')][_0x2d84('0x1a')]);return _0x334236(_0xf09d31['error'][_0x2d84('0x1a')]);}else{logger['info'](_0x2d84('0x13'),_0x5d8dad,_0x2d84('0x14'));_0x334236(_0xf09d31[_0x2d84('0x1b')][_0x2d84('0x1a')]);}})[_0x2d84('0x1c')](function(_0x410623){logger[_0x2d84('0x18')]('MailAccount,\x20%s,\x20%s',_0x5d8dad,_0x410623);_0x1103cf(_0x410623);});});}function respondWithStatusCode(_0x40fb0f,_0x438ddc){_0x438ddc=_0x438ddc||0xcc;return function(_0x133090){if(_0x133090){return _0x40fb0f[_0x2d84('0x1d')](_0x438ddc);}return _0x40fb0f['status'](_0x438ddc)[_0x2d84('0x1e')]();};}function respondWithResult(_0x545c39,_0x3dda31){_0x3dda31=_0x3dda31||0xc8;return function(_0x241fde){if(_0x241fde){return _0x545c39[_0x2d84('0x1f')](_0x3dda31)[_0x2d84('0x20')](_0x241fde);}};}function respondWithFilteredResult(_0x36519f,_0x1642fe){return function(_0x24df19){if(_0x24df19){var _0x5f2392=typeof _0x1642fe[_0x2d84('0x21')]===_0x2d84('0x22')&&typeof _0x1642fe['limit']===_0x2d84('0x22');var _0x1fa34f=_0x24df19[_0x2d84('0x23')];var _0x201c20=_0x5f2392?0x0:_0x1642fe[_0x2d84('0x21')];var _0x560981=_0x5f2392?_0x24df19[_0x2d84('0x23')]:_0x1642fe['offset']+_0x1642fe[_0x2d84('0x24')];var _0x4cd9bd;if(_0x560981>=_0x1fa34f){_0x560981=_0x1fa34f;_0x4cd9bd=0xc8;}else{_0x4cd9bd=0xce;}_0x36519f[_0x2d84('0x1f')](_0x4cd9bd);return _0x36519f[_0x2d84('0x25')]('Content-Range',_0x201c20+'-'+_0x560981+'/'+_0x1fa34f)['json'](_0x24df19);}return null;};}function saveUpdates(_0x507410){return function(_0x1f42d){if(_0x1f42d){return _0x1f42d['update'](_0x507410)[_0x2d84('0x11')](function(_0x37b698){return _0x37b698;});}return null;};}function removeEntity(_0x2e60e4){return function(_0x48d65c){if(_0x48d65c){return _0x48d65c[_0x2d84('0x26')]()[_0x2d84('0x11')](function(){var _0x3d4aca=_0x48d65c[_0x2d84('0x27')]({'plain':!![]});var _0x134b71=_0x2d84('0x28');return db[_0x2d84('0x29')]['destroy']({'where':{'type':_0x134b71,'resourceId':_0x3d4aca['id']}})[_0x2d84('0x11')](function(){return _0x48d65c;});})[_0x2d84('0x11')](function(){_0x2e60e4[_0x2d84('0x1f')](0xcc)[_0x2d84('0x1e')]();});}};}function handleEntityNotFound(_0x52f6e9){return function(_0x5b7f8){if(!_0x5b7f8){_0x52f6e9['sendStatus'](0x194);}return _0x5b7f8;};}function handleError(_0x169f05,_0x2738b1){_0x2738b1=_0x2738b1||0x1f4;return function(_0x1e5601){logger[_0x2d84('0x18')](_0x1e5601['stack']);if(_0x1e5601[_0x2d84('0x2a')]){delete _0x1e5601[_0x2d84('0x2a')];}_0x169f05['status'](_0x2738b1)['send'](_0x1e5601);};}function getImapHost(_0x158943){switch(_0x158943){case _0x2d84('0x2b'):return _0x2d84('0x2c');case'yahoo':return'imap.mail.yahoo.com';case _0x2d84('0x2d'):return _0x2d84('0x2e');case'outlook365':return _0x2d84('0x2f');}throw new Error(_0x2d84('0x30'),_0x158943);}function getSmtpHost(_0x36f23e){switch(_0x36f23e){case _0x2d84('0x2b'):return _0x2d84('0x31');case'yahoo':return _0x2d84('0x32');case'hotmail':return'smtp-mail.outlook.com';case _0x2d84('0x33'):return _0x2d84('0x34');}throw new Error(_0x2d84('0x30'),_0x36f23e);}function getAuthenticationOptions(_0x184a68,_0x1710bb){var _0x41d2cb={};var _0x599f7d={};if(_0x184a68){_0x41d2cb[_0x2d84('0x35')]=_0x599f7d['user']=_0x1710bb[_0x2d84('0x36')];_0x41d2cb[_0x2d84('0x37')]=_0x599f7d['pass']=_0x1710bb[_0x2d84('0x37')];if(_0x1710bb[_0x2d84('0x38')]){_0x41d2cb[_0x2d84('0x38')]=_0x599f7d[_0x2d84('0x38')]=!![];_0x41d2cb[_0x2d84('0x39')]=_0x599f7d['CloudProviderId']=_0x1710bb['CloudProviderId'];_0x41d2cb['password']=_0x599f7d['pass']=null;}else{_0x41d2cb['CloudProviderId']=_0x599f7d[_0x2d84('0x39')]=null;}_0x41d2cb[_0x2d84('0x3a')]=getImapHost(_0x184a68);_0x41d2cb[_0x2d84('0x3b')]=0x3e1;_0x599f7d[_0x2d84('0x3a')]=getSmtpHost(_0x184a68);_0x599f7d[_0x2d84('0x3b')]=0x24b;_0x599f7d[_0x2d84('0x3c')]=![];_0x41d2cb[_0x2d84('0x3d')]=_0x599f7d[_0x2d84('0x3d')]=null;}else{if(_0x1710bb[_0x2d84('0x3e')]){_0x41d2cb['user']=_0x599f7d['user']=_0x1710bb[_0x2d84('0x36')];_0x41d2cb[_0x2d84('0x37')]=_0x599f7d[_0x2d84('0x3f')]=_0x1710bb[_0x2d84('0x37')];}else{_0x41d2cb[_0x2d84('0x3e')]=_0x599f7d[_0x2d84('0x3e')]=![];_0x41d2cb['user']=_0x599f7d[_0x2d84('0x35')]=null;_0x41d2cb[_0x2d84('0x37')]=_0x599f7d[_0x2d84('0x3f')]=null;}_0x41d2cb[_0x2d84('0x3a')]=_0x1710bb[_0x2d84('0x40')][_0x2d84('0x3a')];_0x41d2cb['port']=_0x1710bb['Imap'][_0x2d84('0x3b')];_0x599f7d[_0x2d84('0x3a')]=_0x1710bb[_0x2d84('0x41')][_0x2d84('0x3a')];_0x599f7d[_0x2d84('0x3b')]=_0x1710bb['Smtp'][_0x2d84('0x3b')];}return{'Imap':_0x41d2cb,'Smtp':_0x599f7d};}exports[_0x2d84('0x42')]=function(_0x142adb,_0x1159ef){var _0xc7addb={'include':[{'model':db[_0x2d84('0x43')],'as':_0x2d84('0x40')},{'model':db[_0x2d84('0x44')],'as':_0x2d84('0x41')},{'model':db[_0x2d84('0x45')],'as':_0x2d84('0x46')}]},_0x493692={},_0x403e36={'count':0x0,'rows':[]};var _0x2e3ca9=_[_0x2d84('0x47')](db[_0x2d84('0x48')][_0x2d84('0x49')],function(_0x4ffc5d){return{'name':_0x4ffc5d[_0x2d84('0x4a')],'type':_0x4ffc5d[_0x2d84('0x4b')][_0x2d84('0x4c')]};});_0x493692['model']=_[_0x2d84('0x47')](_0x2e3ca9,'name');_0x493692[_0x2d84('0x4d')]=_[_0x2d84('0x4e')](_0x142adb['query']);_0x493692['filters']=_[_0x2d84('0x4f')](_0x493692['model'],_0x493692[_0x2d84('0x4d')]);_0xc7addb[_0x2d84('0x50')]=_[_0x2d84('0x4f')](_0x493692[_0x2d84('0x51')],qs['fields'](_0x142adb[_0x2d84('0x4d')][_0x2d84('0x52')]));_0xc7addb[_0x2d84('0x50')]=_0xc7addb[_0x2d84('0x50')][_0x2d84('0x53')]?_0xc7addb[_0x2d84('0x50')]:_0x493692[_0x2d84('0x51')];if(!_0x142adb['query'][_0x2d84('0x54')](_0x2d84('0x55'))){_0xc7addb['limit']=qs['limit'](_0x142adb[_0x2d84('0x4d')][_0x2d84('0x24')]);_0xc7addb['offset']=qs[_0x2d84('0x21')](_0x142adb[_0x2d84('0x4d')][_0x2d84('0x21')]);}_0xc7addb[_0x2d84('0x56')]=qs['sort'](_0x142adb[_0x2d84('0x4d')][_0x2d84('0x57')]);_0xc7addb[_0x2d84('0x58')]=qs[_0x2d84('0x59')](_[_0x2d84('0x5a')](_0x142adb[_0x2d84('0x4d')],_0x493692['filters']),_0x2e3ca9);if(_0x142adb[_0x2d84('0x4d')]['filter']){_0xc7addb['where']=_[_0x2d84('0x5b')](_0xc7addb[_0x2d84('0x58')],{'$or':_[_0x2d84('0x47')](_0x2e3ca9,function(_0x2dedcc){if(_0x2dedcc[_0x2d84('0x4b')]!==_0x2d84('0x5c')){var _0x34cafe={};_0x34cafe[_0x2dedcc[_0x2d84('0x2a')]]={'$like':'%'+_0x142adb[_0x2d84('0x4d')][_0x2d84('0x5d')]+'%'};return _0x34cafe;}})});}_0xc7addb=_['merge']({},_0xc7addb,_0x142adb[_0x2d84('0x5e')]);var _0x2c1787={'where':_0xc7addb[_0x2d84('0x58')]};return db[_0x2d84('0x48')]['count'](_0x2c1787)[_0x2d84('0x11')](function(_0x372550){_0x403e36[_0x2d84('0x23')]=_0x372550;if(_0x142adb['query'][_0x2d84('0x5f')]){_0xc7addb[_0x2d84('0x60')]=[{'all':!![]}];}return db[_0x2d84('0x48')][_0x2d84('0x61')](_0xc7addb);})[_0x2d84('0x11')](function(_0x3adcc0){_0x403e36['rows']=_0x3adcc0;return _0x403e36;})[_0x2d84('0x11')](respondWithFilteredResult(_0x1159ef,_0xc7addb))[_0x2d84('0x1c')](handleError(_0x1159ef,null));};exports[_0x2d84('0x62')]=function(_0x2504b1,_0x435432){var _0x4bb26e={'raw':![],'where':{'id':_0x2504b1[_0x2d84('0x63')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x2d84('0x40')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x2d84('0x45')],'as':_0x2d84('0x46')}]},_0x59b793={};_0x59b793[_0x2d84('0x51')]=_[_0x2d84('0x4e')](db['MailAccount'][_0x2d84('0x49')]);_0x59b793['query']=_['keys'](_0x2504b1[_0x2d84('0x4d')]);_0x59b793[_0x2d84('0x59')]=_['intersection'](_0x59b793[_0x2d84('0x51')],_0x59b793[_0x2d84('0x4d')]);_0x4bb26e[_0x2d84('0x50')]=_[_0x2d84('0x4f')](_0x59b793[_0x2d84('0x51')],qs[_0x2d84('0x52')](_0x2504b1[_0x2d84('0x4d')][_0x2d84('0x52')]));_0x4bb26e[_0x2d84('0x50')]=_0x4bb26e[_0x2d84('0x50')]['length']?_0x4bb26e['attributes']:_0x59b793[_0x2d84('0x51')];if(_0x2504b1[_0x2d84('0x4d')][_0x2d84('0x5f')]){_0x4bb26e[_0x2d84('0x60')]=[{'all':!![]}];}_0x4bb26e=_['merge']({},_0x4bb26e,_0x2504b1[_0x2d84('0x5e')]);return db[_0x2d84('0x48')][_0x2d84('0x64')](_0x4bb26e)['then'](handleEntityNotFound(_0x435432,null))[_0x2d84('0x11')](respondWithResult(_0x435432,null))[_0x2d84('0x1c')](handleError(_0x435432,null));};exports[_0x2d84('0x65')]=function(_0x1d6cb2,_0x7f7743){if(_0x1d6cb2[_0x2d84('0x66')]['id']){delete _0x1d6cb2[_0x2d84('0x66')]['id'];}var _0x42e5f6=_0x1d6cb2['body'][_0x2d84('0x67')]===_0x2d84('0x68')?null:_0x1d6cb2['body'][_0x2d84('0x67')];var _0x578ee1=_0x1d6cb2[_0x2d84('0x66')][_0x2d84('0x40')]||{};var _0x41572e=_0x1d6cb2[_0x2d84('0x66')][_0x2d84('0x41')]||{};if(_0x42e5f6){_0x578ee1['host']=getImapHost(_0x42e5f6);_0x578ee1[_0x2d84('0x3b')]=0x3e1;_0x41572e['host']=getSmtpHost(_0x42e5f6);_0x41572e[_0x2d84('0x3b')]=0x24b;_0x41572e[_0x2d84('0x3c')]=![];}if(_0x41572e[_0x2d84('0x38')]){_0x41572e['secure']=![];}else{_0x41572e[_0x2d84('0x39')]=null;}if(!_0x578ee1[_0x2d84('0x38')])_0x578ee1[_0x2d84('0x39')]=null;_0x1d6cb2[_0x2d84('0x66')]['Imap']=_0x578ee1;_0x1d6cb2[_0x2d84('0x66')][_0x2d84('0x41')]=_0x41572e;return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x1d6cb2['params']['id']},'include':[{'model':db[_0x2d84('0x43')],'as':_0x2d84('0x40')},{'model':db['MailServerOut'],'as':_0x2d84('0x41')},{'model':db[_0x2d84('0x45')],'as':_0x2d84('0x46')}]})[_0x2d84('0x11')](handleEntityNotFound(_0x7f7743,null))[_0x2d84('0x11')](function(_0x5c1775){if(!_0x5c1775)throw new Error(_0x2d84('0x69'));if(_0x5c1775[_0x2d84('0x3d')])delete _0x1d6cb2[_0x2d84('0x66')][_0x2d84('0x40')];return _0x5c1775;})['then'](saveUpdates(_0x1d6cb2[_0x2d84('0x66')],null))[_0x2d84('0x11')](function(_0xfacacc){if(!_0x1d6cb2['body']['Imap'])return _0xfacacc;return db[_0x2d84('0x43')][_0x2d84('0x65')](_0x1d6cb2['body']['Imap'],{'where':{'MailAccountId':_0xfacacc['id']}})[_0x2d84('0x11')](function(){return _0xfacacc;});})['then'](function(_0x287c4b){if(!_0x1d6cb2[_0x2d84('0x66')]['Smtp'])return _0x287c4b;return db['MailServerOut'][_0x2d84('0x65')](_0x1d6cb2[_0x2d84('0x66')]['Smtp'],{'where':{'MailAccountId':_0x287c4b['id']}})[_0x2d84('0x11')](function(){return _0x287c4b;});})[_0x2d84('0x11')](respondWithResult(_0x7f7743,null))[_0x2d84('0x1c')](handleError(_0x7f7743,null));};exports[_0x2d84('0x6a')]=function(_0x21b55f,_0x38c4ba){return db['MailAccount'][_0x2d84('0x6a')]()[_0x2d84('0x11')](respondWithResult(_0x38c4ba,null))[_0x2d84('0x1c')](handleError(_0x38c4ba,null));};exports[_0x2d84('0x6b')]=function(_0x33ae68,_0x2d16d3){if(_0x33ae68[_0x2d84('0x66')]['id']){delete _0x33ae68['body']['id'];}return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x33ae68[_0x2d84('0x63')]['id']}})['then'](handleEntityNotFound(_0x2d16d3,null))[_0x2d84('0x11')](function(_0x12d7f9){if(_0x12d7f9){_0x33ae68[_0x2d84('0x66')][_0x2d84('0x6c')]=_0x12d7f9['id'];return db[_0x2d84('0x6d')][_0x2d84('0x6e')](_0x33ae68[_0x2d84('0x66')]);}})[_0x2d84('0x11')](respondWithResult(_0x2d16d3,null))[_0x2d84('0x1c')](handleError(_0x2d16d3,null));};exports[_0x2d84('0x6f')]=function(_0x14d01d,_0x51408b){var _0xe89137={'raw':![],'where':{}};var _0x4cf22d={};var _0x2256fd={'count':0x0,'rows':[]};return db[_0x2d84('0x48')][_0x2d84('0x70')]({'where':{'id':_0x14d01d[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x51408b,null))[_0x2d84('0x11')](function(_0xc18617){if(_0xc18617){_0x4cf22d[_0x2d84('0x51')]=_['keys'](db[_0x2d84('0x6d')][_0x2d84('0x49')]);_0x4cf22d[_0x2d84('0x4d')]=_[_0x2d84('0x4e')](_0x14d01d[_0x2d84('0x4d')]);_0x4cf22d[_0x2d84('0x59')]=_['intersection'](_0x4cf22d[_0x2d84('0x51')],_0x4cf22d[_0x2d84('0x4d')]);_0xe89137['attributes']=_[_0x2d84('0x4f')](_0x4cf22d[_0x2d84('0x51')],qs[_0x2d84('0x52')](_0x14d01d['query'][_0x2d84('0x52')]));_0xe89137[_0x2d84('0x50')]=_0xe89137[_0x2d84('0x50')]['length']?_0xe89137['attributes']:_0x4cf22d[_0x2d84('0x51')];if(!_0x14d01d[_0x2d84('0x4d')][_0x2d84('0x54')]('nolimit')){_0xe89137['limit']=qs[_0x2d84('0x24')](_0x14d01d[_0x2d84('0x4d')][_0x2d84('0x24')]);_0xe89137['offset']=qs[_0x2d84('0x21')](_0x14d01d[_0x2d84('0x4d')][_0x2d84('0x21')]);}_0xe89137[_0x2d84('0x56')]=qs[_0x2d84('0x57')](_0x14d01d[_0x2d84('0x4d')]['sort']);_0xe89137[_0x2d84('0x58')]=qs[_0x2d84('0x59')](_[_0x2d84('0x5a')](_0x14d01d[_0x2d84('0x4d')],_0x4cf22d[_0x2d84('0x59')]));_0xe89137[_0x2d84('0x58')][_0x2d84('0x6c')]=_0xc18617['id'];if(_0x14d01d[_0x2d84('0x4d')]['filter']){_0xe89137[_0x2d84('0x58')]=_[_0x2d84('0x5b')](_0xe89137['where'],{'$or':_['map'](_0xe89137[_0x2d84('0x50')],function(_0x38fc12){var _0x799dcf={};_0x799dcf[_0x38fc12]={'$like':'%'+_0x14d01d[_0x2d84('0x4d')][_0x2d84('0x5d')]+'%'};return _0x799dcf;})});}_0xe89137=_['merge']({},_0xe89137,_0x14d01d['options']);return db[_0x2d84('0x6d')][_0x2d84('0x23')]({'where':_0xe89137[_0x2d84('0x58')]})[_0x2d84('0x11')](function(_0x627e92){_0x2256fd[_0x2d84('0x23')]=_0x627e92;if(_0x14d01d[_0x2d84('0x4d')]['includeAll']){_0xe89137[_0x2d84('0x60')]=[{'all':!![]}];}return db[_0x2d84('0x6d')][_0x2d84('0x61')](_0xe89137);})[_0x2d84('0x11')](function(_0x1e2c87){_0x2256fd[_0x2d84('0x71')]=_0x1e2c87;return _0x2256fd;});}})[_0x2d84('0x11')](respondWithFilteredResult(_0x51408b,_0xe89137))[_0x2d84('0x1c')](handleError(_0x51408b,null));};exports[_0x2d84('0x72')]=function(_0x19f7b8,_0x13c60e){return db[_0x2d84('0x48')]['find']({'where':{'id':_0x19f7b8[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x13c60e,null))[_0x2d84('0x11')](function(_0x57fdd6){if(_0x57fdd6){return _0x57fdd6[_0x2d84('0x72')](_0x19f7b8['query'][_0x2d84('0x73')]);}})[_0x2d84('0x11')](respondWithStatusCode(_0x13c60e,null))[_0x2d84('0x1c')](handleError(_0x13c60e,null));};exports['addAnswer']=function(_0x8b3308,_0x4d43e1){if(_0x8b3308[_0x2d84('0x66')]['id']){delete _0x8b3308[_0x2d84('0x66')]['id'];}return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x8b3308[_0x2d84('0x63')]['id']}})['then'](handleEntityNotFound(_0x4d43e1,null))[_0x2d84('0x11')](function(_0x4793ab){if(_0x4793ab){_0x8b3308[_0x2d84('0x66')]['MailAccountId']=_0x4793ab['id'];return db[_0x2d84('0x74')][_0x2d84('0x6e')](_0x8b3308['body']);}})[_0x2d84('0x11')](respondWithResult(_0x4d43e1,null))[_0x2d84('0x1c')](handleError(_0x4d43e1,null));};exports[_0x2d84('0x75')]=function(_0x4fe5e9,_0x5ae6fa){var _0x97e5c5={'raw':![],'where':{}};var _0x409658={};var _0x568625={'count':0x0,'rows':[]};return db[_0x2d84('0x48')]['findOne']({'where':{'id':_0x4fe5e9[_0x2d84('0x63')]['id']}})['then'](handleEntityNotFound(_0x5ae6fa,null))[_0x2d84('0x11')](function(_0x79fc35){if(_0x79fc35){_0x409658['model']=_[_0x2d84('0x4e')](db[_0x2d84('0x74')][_0x2d84('0x49')]);_0x409658['query']=_[_0x2d84('0x4e')](_0x4fe5e9['query']);_0x409658[_0x2d84('0x59')]=_['intersection'](_0x409658['model'],_0x409658[_0x2d84('0x4d')]);_0x97e5c5['attributes']=_[_0x2d84('0x4f')](_0x409658[_0x2d84('0x51')],qs[_0x2d84('0x52')](_0x4fe5e9[_0x2d84('0x4d')][_0x2d84('0x52')]));_0x97e5c5[_0x2d84('0x50')]=_0x97e5c5[_0x2d84('0x50')][_0x2d84('0x53')]?_0x97e5c5['attributes']:_0x409658[_0x2d84('0x51')];if(!_0x4fe5e9[_0x2d84('0x4d')][_0x2d84('0x54')](_0x2d84('0x55'))){_0x97e5c5[_0x2d84('0x24')]=qs[_0x2d84('0x24')](_0x4fe5e9['query'][_0x2d84('0x24')]);_0x97e5c5['offset']=qs[_0x2d84('0x21')](_0x4fe5e9[_0x2d84('0x4d')][_0x2d84('0x21')]);}_0x97e5c5['order']=qs[_0x2d84('0x57')](_0x4fe5e9['query'][_0x2d84('0x57')]);_0x97e5c5[_0x2d84('0x58')]=qs[_0x2d84('0x59')](_['pick'](_0x4fe5e9['query'],_0x409658['filters']));_0x97e5c5[_0x2d84('0x58')][_0x2d84('0x6c')]=_0x79fc35['id'];if(_0x4fe5e9['query'][_0x2d84('0x5d')]){_0x97e5c5[_0x2d84('0x58')]=_[_0x2d84('0x5b')](_0x97e5c5['where'],{'$or':_[_0x2d84('0x47')](_0x97e5c5[_0x2d84('0x50')],function(_0x345e1f){var _0x2bcd7b={};_0x2bcd7b[_0x345e1f]={'$like':'%'+_0x4fe5e9[_0x2d84('0x4d')]['filter']+'%'};return _0x2bcd7b;})});}_0x97e5c5=_['merge']({},_0x97e5c5,_0x4fe5e9[_0x2d84('0x5e')]);return db[_0x2d84('0x74')][_0x2d84('0x23')]({'where':_0x97e5c5[_0x2d84('0x58')]})['then'](function(_0x4c8a7a){_0x568625[_0x2d84('0x23')]=_0x4c8a7a;if(_0x4fe5e9['query'][_0x2d84('0x5f')]){_0x97e5c5[_0x2d84('0x60')]=[{'all':!![]}];}return db[_0x2d84('0x74')][_0x2d84('0x61')](_0x97e5c5);})[_0x2d84('0x11')](function(_0x3d068e){_0x568625['rows']=_0x3d068e;return _0x568625;});}})['then'](respondWithFilteredResult(_0x5ae6fa,_0x97e5c5))[_0x2d84('0x1c')](handleError(_0x5ae6fa,null));};exports['removeAnswers']=function(_0x5ddfab,_0x44490a){return db[_0x2d84('0x48')]['find']({'where':{'id':_0x5ddfab['params']['id']}})['then'](handleEntityNotFound(_0x44490a,null))[_0x2d84('0x11')](function(_0x35e28d){if(_0x35e28d){return _0x35e28d[_0x2d84('0x76')](_0x5ddfab[_0x2d84('0x4d')]['ids']);}})['then'](respondWithStatusCode(_0x44490a,null))[_0x2d84('0x1c')](handleError(_0x44490a,null));};exports[_0x2d84('0x6e')]=function(_0x5206fa,_0x392b80){var _0x2404a4={'name':_0x5206fa[_0x2d84('0x66')][_0x2d84('0x2a')],'key':_0x5206fa[_0x2d84('0x66')]['key'],'provider':_0x5206fa[_0x2d84('0x66')][_0x2d84('0x67')]===_0x2d84('0x68')?null:_0x5206fa[_0x2d84('0x66')][_0x2d84('0x67')],'email':_0x5206fa[_0x2d84('0x66')]['email'],'ListId':_0x5206fa[_0x2d84('0x66')][_0x2d84('0x77')],'active':!_[_0x2d84('0x78')](_0x5206fa[_0x2d84('0x66')]['active'])?_0x5206fa[_0x2d84('0x66')][_0x2d84('0x79')]:!![],'description':_0x5206fa[_0x2d84('0x66')][_0x2d84('0x7a')]||null};var _0x55bfbb=getAuthenticationOptions(_0x2404a4[_0x2d84('0x67')],_0x5206fa[_0x2d84('0x66')]);_0x2404a4[_0x2d84('0x40')]=_0x55bfbb[_0x2d84('0x40')];_0x2404a4[_0x2d84('0x41')]=_0x55bfbb[_0x2d84('0x41')];return db['MailAccount']['create'](_0x2404a4,{'include':[{'model':db['MailServerOut'],'as':_0x2d84('0x41')},{'model':db[_0x2d84('0x43')],'as':_0x2d84('0x40')}]})[_0x2d84('0x11')](function(_0x26401d){var _0x4ac34a=_0x5206fa[_0x2d84('0x35')]['get']({'plain':!![]});if(!_0x4ac34a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ac34a[_0x2d84('0x7b')]==='user'){var _0x2cb95a=_0x26401d[_0x2d84('0x27')]({'plain':!![]});return db[_0x2d84('0x7c')]['find']({'where':{'name':_0x2d84('0x28'),'userProfileId':_0x4ac34a[_0x2d84('0x7d')]},'raw':!![]})[_0x2d84('0x11')](function(_0x3d1fba){if(_0x3d1fba&&_0x3d1fba[_0x2d84('0x7e')]===0x0){return db[_0x2d84('0x29')][_0x2d84('0x6e')]({'name':_0x2cb95a[_0x2d84('0x2a')],'resourceId':_0x2cb95a['id'],'type':_0x3d1fba[_0x2d84('0x2a')],'sectionId':_0x3d1fba['id']},{})['then'](function(){return _0x26401d;});}else{return _0x26401d;}})['catch'](function(_0x3a89e9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a89e9);throw _0x3a89e9;});}return _0x26401d;})[_0x2d84('0x11')](respondWithResult(_0x392b80,0xc9))[_0x2d84('0x1c')](handleError(_0x392b80,null));};exports['getImap']=function(_0x556934,_0xaa03cc){return db[_0x2d84('0x48')][_0x2d84('0x70')]({'where':{'id':_0x556934[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0xaa03cc,null))['then'](function(_0x1ab494){if(_0x1ab494){return _0x1ab494['getImap']();}return null;})[_0x2d84('0x11')](respondWithResult(_0xaa03cc,null))[_0x2d84('0x1c')](handleError(_0xaa03cc,null));};exports[_0x2d84('0x7f')]=function(_0x1e9c5d,_0x30da8f){if(_0x1e9c5d[_0x2d84('0x66')]['id']){delete _0x1e9c5d[_0x2d84('0x66')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1e9c5d[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x30da8f,null))[_0x2d84('0x11')](function(_0x3f82bb){if(_0x3f82bb){_0x1e9c5d[_0x2d84('0x66')][_0x2d84('0x6c')]=_0x3f82bb['id'];return db[_0x2d84('0x43')]['create'](_0x1e9c5d[_0x2d84('0x66')]);}})['then'](respondWithResult(_0x30da8f,null))[_0x2d84('0x1c')](handleError(_0x30da8f,null));};exports[_0x2d84('0x80')]=function(_0x184995,_0x1b36e6){return db[_0x2d84('0x48')]['findOne']({'where':{'id':_0x184995[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x1b36e6,null))[_0x2d84('0x11')](function(_0x508ee5){if(_0x508ee5){return _0x508ee5[_0x2d84('0x81')](null);}return null;})[_0x2d84('0x11')](respondWithStatusCode(_0x1b36e6,null))[_0x2d84('0x1c')](handleError(_0x1b36e6,null));};exports[_0x2d84('0x82')]=function(_0x5f5a58,_0x4288b2){return db[_0x2d84('0x48')][_0x2d84('0x70')]({'where':{'id':_0x5f5a58['params']['id']}})['then'](handleEntityNotFound(_0x4288b2,null))['then'](function(_0x3ca838){if(_0x3ca838){return _0x3ca838[_0x2d84('0x82')]();}return null;})[_0x2d84('0x11')](respondWithResult(_0x4288b2,null))[_0x2d84('0x1c')](handleError(_0x4288b2,null));};exports[_0x2d84('0x83')]=function(_0x407f66,_0x533cef){if(_0x407f66[_0x2d84('0x66')]['id']){delete _0x407f66[_0x2d84('0x66')]['id'];}return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x407f66[_0x2d84('0x63')]['id']}})['then'](handleEntityNotFound(_0x533cef,null))[_0x2d84('0x11')](function(_0x46610d){if(_0x46610d){_0x407f66[_0x2d84('0x66')]['MailAccountId']=_0x46610d['id'];return db[_0x2d84('0x44')]['create'](_0x407f66[_0x2d84('0x66')]);}})[_0x2d84('0x11')](respondWithResult(_0x533cef,null))[_0x2d84('0x1c')](handleError(_0x533cef,null));};exports[_0x2d84('0x84')]=function(_0x148480,_0x45671f){return db['MailAccount'][_0x2d84('0x70')]({'where':{'id':_0x148480[_0x2d84('0x63')]['id']}})['then'](handleEntityNotFound(_0x45671f,null))[_0x2d84('0x11')](function(_0x97f456){if(_0x97f456){return _0x97f456[_0x2d84('0x85')](null);}return null;})[_0x2d84('0x11')](respondWithStatusCode(_0x45671f,null))[_0x2d84('0x1c')](handleError(_0x45671f,null));};exports[_0x2d84('0x86')]=function(_0x4cc0ad,_0x735d9a){return db[_0x2d84('0x87')]['find']({'where':{'id':_0x4cc0ad[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x735d9a,null))[_0x2d84('0x11')](function(_0x54bbb6){if(_0x54bbb6){return _0x54bbb6[_0x2d84('0x86')](_0x4cc0ad['body'][_0x2d84('0x73')],_[_0x2d84('0x88')](_0x4cc0ad[_0x2d84('0x66')],[_0x2d84('0x73'),'id'])||{});}})['then'](respondWithResult(_0x735d9a,null))['catch'](handleError(_0x735d9a,null));};exports[_0x2d84('0x89')]=function(_0x22803b,_0x16ad1f){var _0xab1b={'raw':![],'where':{}};var _0x33f78b={};var _0x2f89be={'count':0x0,'rows':[]};return db[_0x2d84('0x48')][_0x2d84('0x70')]({'where':{'id':_0x22803b[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x16ad1f,null))[_0x2d84('0x11')](function(_0x3718ae){if(_0x3718ae){_0x33f78b[_0x2d84('0x51')]=_[_0x2d84('0x4e')](db[_0x2d84('0x87')][_0x2d84('0x49')]);_0x33f78b['query']=_[_0x2d84('0x4e')](_0x22803b[_0x2d84('0x4d')]);_0x33f78b['filters']=_[_0x2d84('0x4f')](_0x33f78b[_0x2d84('0x51')],_0x33f78b[_0x2d84('0x4d')]);_0xab1b[_0x2d84('0x50')]=_[_0x2d84('0x4f')](_0x33f78b[_0x2d84('0x51')],qs[_0x2d84('0x52')](_0x22803b[_0x2d84('0x4d')]['fields']));_0xab1b[_0x2d84('0x50')]=_0xab1b[_0x2d84('0x50')][_0x2d84('0x53')]?_0xab1b['attributes']:_0x33f78b['model'];if(!_0x22803b['query'][_0x2d84('0x54')]('nolimit')){_0xab1b[_0x2d84('0x24')]=qs['limit'](_0x22803b[_0x2d84('0x4d')][_0x2d84('0x24')]);_0xab1b['offset']=qs[_0x2d84('0x21')](_0x22803b['query'][_0x2d84('0x21')]);}_0xab1b[_0x2d84('0x56')]=qs[_0x2d84('0x57')](_0x22803b[_0x2d84('0x4d')][_0x2d84('0x57')]);_0xab1b['where']=qs['filters'](_[_0x2d84('0x5a')](_0x22803b[_0x2d84('0x4d')],_0x33f78b['filters']));_0xab1b['where'][_0x2d84('0x6c')]=_0x3718ae['id'];if(_0x22803b[_0x2d84('0x4d')]['filter']){_0xab1b[_0x2d84('0x58')]=_[_0x2d84('0x5b')](_0xab1b[_0x2d84('0x58')],{'$or':_['map'](_0xab1b[_0x2d84('0x50')],function(_0x543d82){var _0x131547={};_0x131547[_0x543d82]={'$like':'%'+_0x22803b[_0x2d84('0x4d')][_0x2d84('0x5d')]+'%'};return _0x131547;})});}_0xab1b=_[_0x2d84('0x5b')]({},_0xab1b,_0x22803b[_0x2d84('0x5e')]);return db[_0x2d84('0x87')]['count']({'where':_0xab1b[_0x2d84('0x58')]})[_0x2d84('0x11')](function(_0x4607d7){_0x2f89be[_0x2d84('0x23')]=_0x4607d7;if(_0x22803b[_0x2d84('0x4d')][_0x2d84('0x5f')]){_0xab1b[_0x2d84('0x60')]=[{'model':db[_0x2d84('0x8a')],'as':_0x2d84('0x8b'),'required':![]},{'model':db[_0x2d84('0x8c')],'as':'Owner','attributes':[_0x2d84('0x2a'),_0x2d84('0x8d'),_0x2d84('0x8e')],'required':![]},{'model':db['Tag'],'as':_0x2d84('0x8f'),'attributes':['id',_0x2d84('0x2a'),_0x2d84('0x90')],'where':_0x22803b['query'][_0x2d84('0x91')]?{'id':_0x22803b[_0x2d84('0x4d')][_0x2d84('0x91')]}:undefined,'required':_0x22803b[_0x2d84('0x4d')]['tag']?!![]:![]}];}return db[_0x2d84('0x87')][_0x2d84('0x61')](_0xab1b);})[_0x2d84('0x11')](function(_0x12f7b5){_0x2f89be[_0x2d84('0x71')]=_0x12f7b5;return _0x2f89be;});}})['then'](respondWithFilteredResult(_0x16ad1f,_0xab1b))['catch'](handleError(_0x16ad1f,null));};exports[_0x2d84('0x92')]=function addApplications(_0xa63727,_0x4da18c){var _0x581498=_0xa63727[_0x2d84('0x63')]['id'];var _0x33aa7f=_0xa63727['body'];var _0xe8660c=0xc8;var _0x5e5e8f=null;return db[_0x2d84('0x93')]['transaction']({'isolationLevel':db['sequelize'][_0x2d84('0x94')][_0x2d84('0x95')][_0x2d84('0x96')]},function(_0x215c8a){return db[_0x2d84('0x48')]['findOne']({'where':{'id':_0x581498},'transaction':_0x215c8a})['then'](function(_0x1b4fba){if(_0x1b4fba){return db[_0x2d84('0x97')][_0x2d84('0x26')]({'where':{'MailAccountId':_0x581498},'transaction':_0x215c8a})[_0x2d84('0x11')](function(){var _0x1b0f7f=_[_0x2d84('0x47')](_0x33aa7f,function(_0x11832f){_0x11832f[_0x2d84('0x6c')]=_0x581498;return _0x11832f;});return db[_0x2d84('0x97')][_0x2d84('0x98')](_0x1b0f7f,{'transaction':_0x215c8a});});}else{_0xe8660c=0x194;_0x5e5e8f=[];}});})[_0x2d84('0x11')](function(){if(_0xe8660c!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x581498},'order':_0x2d84('0x99')})['then'](function(_0xe2448f){_0x5e5e8f=_0xe2448f;});}})[_0x2d84('0x1c')](function(_0x54475b){_0xe8660c=0x1f4;logger[_0x2d84('0x18')](_0x54475b[_0x2d84('0x9a')]);if(_0x54475b['name']){delete _0x54475b[_0x2d84('0x2a')];}_0x5e5e8f=_0x54475b;})[_0x2d84('0x9b')](function(){if(_0x5e5e8f===null){_0x4da18c[_0x2d84('0x1d')](_0xe8660c);}else{if(_0xe8660c===0x1f4){_0x4da18c[_0x2d84('0x1f')](_0xe8660c)[_0x2d84('0x9c')](_0x5e5e8f);}else{_0x4da18c[_0x2d84('0x1f')](_0xe8660c)[_0x2d84('0x20')](_0x5e5e8f);}}});};exports[_0x2d84('0x9d')]=function(_0x4e5f91,_0x10506e){var _0xaa5cb5={};var _0x3fac74={};var _0x3e3cf0;var _0x3aea96;return db[_0x2d84('0x48')][_0x2d84('0x70')]({'where':{'id':_0x4e5f91[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x10506e,null))['then'](function(_0x10da3c){if(_0x10da3c){_0x3e3cf0=_0x10da3c;_0x3fac74[_0x2d84('0x51')]=_[_0x2d84('0x4e')](db['MailApplication'][_0x2d84('0x49')]);_0x3fac74['query']=_[_0x2d84('0x4e')](_0x4e5f91[_0x2d84('0x4d')]);_0x3fac74[_0x2d84('0x59')]=_['intersection'](_0x3fac74[_0x2d84('0x51')],_0x3fac74[_0x2d84('0x4d')]);_0xaa5cb5[_0x2d84('0x50')]=_[_0x2d84('0x4f')](_0x3fac74[_0x2d84('0x51')],qs[_0x2d84('0x52')](_0x4e5f91[_0x2d84('0x4d')]['fields']));_0xaa5cb5[_0x2d84('0x50')]=_0xaa5cb5[_0x2d84('0x50')][_0x2d84('0x53')]?_0xaa5cb5[_0x2d84('0x50')]:_0x3fac74['model'];_0xaa5cb5['order']=qs[_0x2d84('0x57')](_0x4e5f91['query'][_0x2d84('0x57')]);_0xaa5cb5[_0x2d84('0x58')]=qs[_0x2d84('0x59')](_['pick'](_0x4e5f91[_0x2d84('0x4d')],_0x3fac74['filters']));if(_0x4e5f91[_0x2d84('0x4d')][_0x2d84('0x5d')]){_0xaa5cb5[_0x2d84('0x58')]=_[_0x2d84('0x5b')](_0xaa5cb5['where'],{'$or':_[_0x2d84('0x47')](_0xaa5cb5['attributes'],function(_0x38889c){var _0x219de4={};_0x219de4[_0x38889c]={'$like':'%'+_0x4e5f91[_0x2d84('0x4d')][_0x2d84('0x5d')]+'%'};return _0x219de4;})});}_0xaa5cb5=_[_0x2d84('0x5b')]({},_0xaa5cb5,_0x4e5f91['options']);return _0x3e3cf0[_0x2d84('0x9d')](_0xaa5cb5);}})[_0x2d84('0x11')](function(_0x245018){if(_0x245018){_0x3aea96=_0x245018[_0x2d84('0x53')];if(!_0x4e5f91[_0x2d84('0x4d')][_0x2d84('0x54')](_0x2d84('0x55'))){_0xaa5cb5['limit']=qs[_0x2d84('0x24')](_0x4e5f91['query'][_0x2d84('0x24')]);_0xaa5cb5[_0x2d84('0x21')]=qs['offset'](_0x4e5f91[_0x2d84('0x4d')][_0x2d84('0x21')]);}return _0x3e3cf0[_0x2d84('0x9d')](_0xaa5cb5);}})[_0x2d84('0x11')](function(_0x203c67){if(_0x203c67){return _0x203c67?{'count':_0x3aea96,'rows':_0x203c67}:null;}})['then'](respondWithResult(_0x10506e,null))['catch'](handleError(_0x10506e,null));};exports['getMessages']=function(_0xdf42e8,_0x1d387e){var _0x224328={'raw':!![],'where':{}};var _0x570485={};var _0x50d8e1={'count':0x0,'rows':[]};return db[_0x2d84('0x48')][_0x2d84('0x70')]({'where':{'id':_0xdf42e8['params']['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x1d387e,null))[_0x2d84('0x11')](function(_0x5f5db9){if(_0x5f5db9){_0x570485[_0x2d84('0x51')]=_[_0x2d84('0x4e')](db[_0x2d84('0x9e')]['rawAttributes']);_0x570485[_0x2d84('0x4d')]=_[_0x2d84('0x4e')](_0xdf42e8[_0x2d84('0x4d')]);_0x570485['filters']=_[_0x2d84('0x4f')](_0x570485[_0x2d84('0x51')],_0x570485[_0x2d84('0x4d')]);_0x224328[_0x2d84('0x50')]=_[_0x2d84('0x4f')](_0x570485['model'],qs[_0x2d84('0x52')](_0xdf42e8[_0x2d84('0x4d')][_0x2d84('0x52')]));_0x224328[_0x2d84('0x50')]=_0x224328[_0x2d84('0x50')][_0x2d84('0x53')]?_0x224328[_0x2d84('0x50')]:_0x570485[_0x2d84('0x51')];if(!_0xdf42e8[_0x2d84('0x4d')]['hasOwnProperty']('nolimit')){_0x224328[_0x2d84('0x24')]=qs[_0x2d84('0x24')](_0xdf42e8['query'][_0x2d84('0x24')]);_0x224328[_0x2d84('0x21')]=qs['offset'](_0xdf42e8[_0x2d84('0x4d')][_0x2d84('0x21')]);}_0x224328['order']=qs['sort'](_0xdf42e8[_0x2d84('0x4d')][_0x2d84('0x57')]);_0x224328[_0x2d84('0x58')]=qs['filters'](_[_0x2d84('0x5a')](_0xdf42e8[_0x2d84('0x4d')],_0x570485['filters']));_0x224328[_0x2d84('0x58')][_0x2d84('0x6c')]=_0x5f5db9['id'];if(_0xdf42e8[_0x2d84('0x4d')][_0x2d84('0x5d')]){_0x224328[_0x2d84('0x58')]=_[_0x2d84('0x5b')](_0x224328[_0x2d84('0x58')],{'$or':_[_0x2d84('0x47')](_0x224328[_0x2d84('0x50')],function(_0x5b220a){var _0x29b791={};_0x29b791[_0x5b220a]={'$like':'%'+_0xdf42e8[_0x2d84('0x4d')][_0x2d84('0x5d')]+'%'};return _0x29b791;})});}if(_0xdf42e8['query']['$gte']){var _0x1bd714=_0xdf42e8[_0x2d84('0x4d')][_0x2d84('0x9f')][_0x2d84('0xa0')](',');var _0x5774d3={};_0x5774d3[_0x1bd714[0x0]]={'$gte':moment(_0x1bd714[0x1])[_0x2d84('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x224328['where']=_[_0x2d84('0x5b')](_0x224328[_0x2d84('0x58')],_0x5774d3);}_0x224328=_[_0x2d84('0x5b')]({},_0x224328,_0xdf42e8['options']);return db[_0x2d84('0x9e')][_0x2d84('0x23')]({'where':_0x224328['where']})[_0x2d84('0x11')](function(_0x525072){_0x50d8e1[_0x2d84('0x23')]=_0x525072;if(_0xdf42e8[_0x2d84('0x4d')][_0x2d84('0x5f')]){_0x224328['include']=[{'all':!![]}];}return db[_0x2d84('0x9e')][_0x2d84('0x61')](_0x224328);})[_0x2d84('0x11')](function(_0x1e01c4){if(_0xdf42e8[_0x2d84('0x4d')]['inlineCss']==='true'){for(var _0x40493c=0x0;_0x40493c<_0x1e01c4[_0x2d84('0x53')];_0x40493c++){_0x1e01c4[_0x40493c]['body']=juice(_0x1e01c4[_0x40493c]['body']);}}_0x50d8e1['rows']=_0x1e01c4;return _0x50d8e1;});}})[_0x2d84('0x11')](respondWithFilteredResult(_0x1d387e,_0x224328))[_0x2d84('0x1c')](handleError(_0x1d387e,null));};exports[_0x2d84('0x9c')]=function(_0xc93773,_0x3be42c){var _0x3d7f1c,_0x189f69={},_0xfd51f2;if(_0xc93773[_0x2d84('0x66')]['to']){_0xfd51f2=_0xc93773[_0x2d84('0x66')]['to'][_0x2d84('0xa0')](',')[0x0];}return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0xc93773[_0x2d84('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0x2d84('0xa2'),'include':[{'model':db['CmContact'],'as':_0x2d84('0xa3'),'where':{'email':_0xfd51f2},'limit':0x1,'order':[['updatedAt',_0x2d84('0xa4')]]}]},{'model':db['MailServerOut'],'as':_0x2d84('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x2d84('0xa5'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3be42c,null))[_0x2d84('0x11')](function(_0x33a693){if(!_0x33a693)return;_0x3d7f1c=_0x33a693;if(!_0x33a693['Smtp'])throw new Error(_0x2d84('0xa6'));if(_[_0x2d84('0x78')](_0xc93773[_0x2d84('0x66')][_0x2d84('0xa7')])){_0xc93773[_0x2d84('0x66')][_0x2d84('0xa7')]=util[_0x2d84('0xa1')](_0x2d84('0xa8'),_0x33a693[_0x2d84('0x2a')],_0x33a693[_0x2d84('0xa9')]||_0x33a693[_0x2d84('0x41')]['user']);}if(_0xc93773[_0x2d84('0x66')][_0x2d84('0xaa')]&&_0xc93773[_0x2d84('0x66')][_0x2d84('0xaa')][_0x2d84('0x53')]){for(var _0x1d3b2d=0x0;_0x1d3b2d<_0xc93773[_0x2d84('0x66')][_0x2d84('0xaa')][_0x2d84('0x53')];_0x1d3b2d+=0x1){_0xc93773[_0x2d84('0x66')][_0x2d84('0xaa')][_0x1d3b2d]={'filename':_0xc93773['body'][_0x2d84('0xaa')][_0x1d3b2d][_0x2d84('0x2a')],'path':path[_0x2d84('0xab')](config[_0x2d84('0xac')],_0x2d84('0xad'),_0xc93773[_0x2d84('0x66')]['attachments'][_0x1d3b2d][_0x2d84('0xae')])};}}var _0x16f98e=_0x33a693[_0x2d84('0xaf')]();return respondWithRpcPromise(_0x2d84('0xb0'),_0x2d84('0xb1'),{'account':_0x16f98e,'message':_0xc93773['body']});})[_0x2d84('0x11')](function(_0x1d0975){if(!_0x1d0975)return;_0x189f69=_0x1d0975;if(!_0x3d7f1c[_0x2d84('0xa2')])throw new Error(_0x2d84('0xb2'));if(_0x3d7f1c[_0x2d84('0xa2')][_0x2d84('0xa3')][_0x2d84('0x53')])return _0x3d7f1c['List'][_0x2d84('0xa3')][0x0];return db['CmContact'][_0x2d84('0x6e')](_[_0x2d84('0xb')](_0xc93773[_0x2d84('0x66')],{'firstName':_0xc93773[_0x2d84('0x66')]['to'],'email':_0xc93773[_0x2d84('0x66')]['to'],'phone':_0xc93773[_0x2d84('0x66')]['to'],'ListId':_0x3d7f1c[_0x2d84('0x77')]}));})[_0x2d84('0x11')](function(_0x39fe4c){if(!_0x39fe4c)return;var _0x4bd6c8={'UserId':_0xc93773[_0x2d84('0x35')]['id'],'ContactId':_0x39fe4c['id'],'MailAccountId':_0x3d7f1c['id'],'inReplyTo':_0x189f69['messageId'],'to':_0xc93773[_0x2d84('0x66')][_0x2d84('0xa7')],'cc':_0xc93773[_0x2d84('0x66')]['cc'],'subject':_0xc93773['body'][_0x2d84('0xb3')],'attach':_0xc93773['body'][_0x2d84('0xb4')],'firstMsgDirection':_0x2d84('0xb5'),'lastMsgAt':moment()[_0x2d84('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x2d84('0xb5'),'Messages':[_[_0x2d84('0x5b')](_0xc93773[_0x2d84('0x66')],{'messageId':_0x189f69[_0x2d84('0xb6')],'sentAt':moment()[_0x2d84('0xa1')](_0x2d84('0xb7')),'read':!![],'MailAccountId':_0x3d7f1c['id'],'UserId':_0xc93773[_0x2d84('0x35')]['id'],'ContactId':_0x39fe4c['id']})]};if(_0xc93773[_0x2d84('0x66')]['Interaction']){_0x4bd6c8=_[_0x2d84('0x5b')](_0x4bd6c8,_0xc93773[_0x2d84('0x66')]['Interaction']);}return db['MailInteraction']['create'](_0x4bd6c8,{'include':[{'model':db[_0x2d84('0x9e')],'as':_0x2d84('0xb8')}]});})['then'](respondWithResult(_0x3be42c,null))[_0x2d84('0x1c')](handleError(_0x3be42c,null));};exports['verifySmtp']=function(_0x548f4a,_0x2de210){return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x548f4a[_0x2d84('0x63')]['id']},'include':[{'model':db[_0x2d84('0x44')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2d84('0xa5')],'as':_0x2d84('0xa5'),'raw':!![]}]}]})[_0x2d84('0x11')](handleEntityNotFound(_0x2de210,null))[_0x2d84('0x11')](function(_0x536316){if(!_0x536316[_0x2d84('0x41')])return;var _0x1e3c11=_0x536316[_0x2d84('0xaf')]();return respondWithRpcPromise(_0x2d84('0xb9'),_0x2d84('0xba'),{'account':_0x1e3c11});})['then'](respondWithResult(_0x2de210,null))[_0x2d84('0x1c')](handleError(_0x2de210,null));};exports[_0x2d84('0x26')]=function(_0x1b5b63,_0x365c08){return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x1b5b63[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x365c08,null))['then'](function(_0x491cf7){if(_0x491cf7&&_0x491cf7['service']){throw new db[(_0x2d84('0xbb'))][(_0x2d84('0xbc'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x491cf7;})[_0x2d84('0x11')](removeEntity(_0x365c08,null))[_0x2d84('0x1c')](handleError(_0x365c08,null));};exports['addAgents']=function(_0x290a8e,_0x352bd5){return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x290a8e[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x352bd5,null))[_0x2d84('0x11')](function(_0xe09560){if(_0xe09560){return _0xe09560[_0x2d84('0xbd')](_0x290a8e[_0x2d84('0x66')][_0x2d84('0x73')],_['omit'](_0x290a8e['body'],[_0x2d84('0x73'),'id'])||{})[_0x2d84('0xbe')](function(_0x473f4e){for(var _0x5ce217=0x0;_0x5ce217<_0x290a8e['body'][_0x2d84('0x73')]['length'];_0x5ce217+=0x1){socket['emit'](_0x2d84('0xbf'),{'UserId':Number(_0x290a8e[_0x2d84('0x66')][_0x2d84('0x73')][_0x5ce217]),'MailAccountId':Number(_0x290a8e['params']['id'])});}return _0x473f4e;});}})[_0x2d84('0x11')](respondWithResult(_0x352bd5,null))[_0x2d84('0x1c')](handleError(_0x352bd5,null));};exports[_0x2d84('0xc0')]=function(_0x204bae,_0x324077){return db[_0x2d84('0x48')][_0x2d84('0x64')]({'where':{'id':_0x204bae[_0x2d84('0x63')]['id']}})['then'](handleEntityNotFound(_0x324077,null))[_0x2d84('0x11')](function(_0x3f593a){if(_0x3f593a){return _0x3f593a[_0x2d84('0xc0')](_0x204bae[_0x2d84('0x4d')][_0x2d84('0x73')])['then'](function(){if(_['isArray'](_0x204bae[_0x2d84('0x4d')][_0x2d84('0x73')])){for(var _0x438680=0x0;_0x438680<_0x204bae['query'][_0x2d84('0x73')][_0x2d84('0x53')];_0x438680+=0x1){socket['emit'](_0x2d84('0xc1'),{'UserId':Number(_0x204bae[_0x2d84('0x4d')]['ids'][_0x438680]),'MailAccountId':Number(_0x204bae[_0x2d84('0x63')]['id'])});}}else{socket['emit'](_0x2d84('0xc1'),{'UserId':Number(_0x204bae[_0x2d84('0x4d')][_0x2d84('0x73')]),'MailAccountId':Number(_0x204bae['params']['id'])});}});}})[_0x2d84('0x11')](respondWithStatusCode(_0x324077,null))['catch'](handleError(_0x324077,null));};exports[_0x2d84('0xc2')]=function(_0x57878c,_0x5e2a56){var _0x2c84c0={};var _0x27acc5={};var _0x1c4bc1;var _0x223e74;return db[_0x2d84('0x48')]['findOne']({'where':{'id':_0x57878c[_0x2d84('0x63')]['id']}})[_0x2d84('0x11')](handleEntityNotFound(_0x5e2a56,null))[_0x2d84('0x11')](function(_0x294d18){if(_0x294d18){_0x1c4bc1=_0x294d18;_0x27acc5[_0x2d84('0x51')]=_['keys'](db[_0x2d84('0x8c')][_0x2d84('0x49')]);_0x27acc5['query']=_['keys'](_0x57878c[_0x2d84('0x4d')]);_0x27acc5[_0x2d84('0x59')]=_[_0x2d84('0x4f')](_0x27acc5['model'],_0x27acc5['query']);_0x2c84c0[_0x2d84('0x50')]=_[_0x2d84('0x4f')](_0x27acc5[_0x2d84('0x51')],qs[_0x2d84('0x52')](_0x57878c[_0x2d84('0x4d')]['fields']));_0x2c84c0['attributes']=_0x2c84c0[_0x2d84('0x50')][_0x2d84('0x53')]?_0x2c84c0[_0x2d84('0x50')]:_0x27acc5[_0x2d84('0x51')];_0x2c84c0[_0x2d84('0x56')]=qs[_0x2d84('0x57')](_0x57878c[_0x2d84('0x4d')][_0x2d84('0x57')]);_0x2c84c0['where']=qs[_0x2d84('0x59')](_['pick'](_0x57878c[_0x2d84('0x4d')],_0x27acc5[_0x2d84('0x59')]));if(_0x57878c[_0x2d84('0x4d')][_0x2d84('0x5d')]){_0x2c84c0['where']=_[_0x2d84('0x5b')](_0x2c84c0[_0x2d84('0x58')],{'$or':_[_0x2d84('0x47')](_0x2c84c0[_0x2d84('0x50')],function(_0x53369c){var _0x391f37={};_0x391f37[_0x53369c]={'$like':'%'+_0x57878c[_0x2d84('0x4d')][_0x2d84('0x5d')]+'%'};return _0x391f37;})});}_0x2c84c0=_[_0x2d84('0x5b')]({},_0x2c84c0,_0x57878c[_0x2d84('0x5e')]);return _0x1c4bc1[_0x2d84('0xc2')](_0x2c84c0);}})[_0x2d84('0x11')](function(_0x8229e0){if(_0x8229e0){_0x223e74=_0x8229e0['length'];if(!_0x57878c[_0x2d84('0x4d')][_0x2d84('0x54')](_0x2d84('0x55'))){_0x2c84c0['limit']=qs[_0x2d84('0x24')](_0x57878c[_0x2d84('0x4d')][_0x2d84('0x24')]);_0x2c84c0[_0x2d84('0x21')]=qs[_0x2d84('0x21')](_0x57878c[_0x2d84('0x4d')]['offset']);}return _0x1c4bc1[_0x2d84('0xc2')](_0x2c84c0);}})[_0x2d84('0x11')](function(_0x4e410f){if(_0x4e410f){return _0x4e410f?{'count':_0x223e74,'rows':_0x4e410f}:null;}})[_0x2d84('0x11')](respondWithResult(_0x5e2a56,null))[_0x2d84('0x1c')](handleError(_0x5e2a56,null));}; \ No newline at end of file +var _0x7b31=['json','offset','undefined','count','limit','Content-Range','update','get','MailAccounts','destroy','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','Unknown\x20email\x20service\x20provider','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','user','Imap','Smtp','index','MailServerIn','mandatoryDispositionPause','map','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','MailAccount','includeAll','include','findAll','rows','show','params','MailServerOut','rawAttributes','find','body','provider','custom','Pause','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','getDispositions','options','ids','addAnswer','CannedAnswer','findOne','removeAnswers','create','email','ListId','isNil','active','description','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','transaction','sequelize','Transaction','MailApplication','findAndCountAll','stack','finally','getApplications','nolimit','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','CmContact','Contacts','updatedAt','CloudProvider','from','%s\x20<%s>','attachments','join','root','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','emit','userMailAccount:save','removeAgents','getAgents','User','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','MailAccount,\x20%s,\x20%s','catch','sendStatus','status','end'];(function(_0x485905,_0x32c6e2){var _0x4479fc=function(_0x545c06){while(--_0x545c06){_0x485905['push'](_0x485905['shift']());}};_0x4479fc(++_0x32c6e2);}(_0x7b31,0x161));var _0x17b3=function(_0x18b5bb,_0x268fb9){_0x18b5bb=_0x18b5bb-0x0;var _0x5aef1e=_0x7b31[_0x18b5bb];return _0x5aef1e;};'use strict';var moment=require('moment');var BPromise=require(_0x17b3('0x0'));var util=require(_0x17b3('0x1'));var path=require(_0x17b3('0x2'));var _=require('lodash');var juice=require(_0x17b3('0x3'));var Redis=require(_0x17b3('0x4'));var qs=require(_0x17b3('0x5'));var logger=require(_0x17b3('0x6'))(_0x17b3('0x7'));var config=require(_0x17b3('0x8'));var db=require(_0x17b3('0x9'))['db'];config['redis']=_[_0x17b3('0xa')](config[_0x17b3('0xb')],{'host':_0x17b3('0xc'),'port':0x18eb});var socket=require(_0x17b3('0xd'))(new Redis(config[_0x17b3('0xb')]));require(_0x17b3('0xe'))['register'](socket);var jayson=require(_0x17b3('0xf'));var client=jayson[_0x17b3('0x10')][_0x17b3('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x11eff1,_0x4ad94a,_0x3ff5ee,_0x22676e){return new BPromise(function(_0x58b42a,_0x9bf611){var _0x32c5b4=_0x22676e||client;return _0x32c5b4['request'](_0x11eff1,_0x3ff5ee)[_0x17b3('0x12')](function(_0x3a89c9){logger[_0x17b3('0x13')]('MailAccount,\x20%s,\x20%s',_0x4ad94a,_0x17b3('0x14'));logger[_0x17b3('0x15')](_0x17b3('0x16'),_0x4ad94a,_0x17b3('0x14'),JSON['stringify'](_0x3a89c9));if(_0x3a89c9[_0x17b3('0x17')]){if(_0x3a89c9['error'][_0x17b3('0x18')]===0x1f4){logger[_0x17b3('0x17')]('MailAccount,\x20%s,\x20%s',_0x4ad94a,_0x3a89c9[_0x17b3('0x17')][_0x17b3('0x19')]);return _0x9bf611(_0x3a89c9[_0x17b3('0x17')][_0x17b3('0x19')]);}logger[_0x17b3('0x17')]('MailAccount,\x20%s,\x20%s',_0x4ad94a,_0x3a89c9[_0x17b3('0x17')][_0x17b3('0x19')]);return _0x58b42a(_0x3a89c9['error'][_0x17b3('0x19')]);}else{logger[_0x17b3('0x13')](_0x17b3('0x1a'),_0x4ad94a,_0x17b3('0x14'));_0x58b42a(_0x3a89c9['result'][_0x17b3('0x19')]);}})[_0x17b3('0x1b')](function(_0x14395c){logger['error'](_0x17b3('0x1a'),_0x4ad94a,_0x14395c);_0x9bf611(_0x14395c);});});}function respondWithStatusCode(_0x5df58e,_0x4c1577){_0x4c1577=_0x4c1577||0xcc;return function(_0x3d717f){if(_0x3d717f){return _0x5df58e[_0x17b3('0x1c')](_0x4c1577);}return _0x5df58e[_0x17b3('0x1d')](_0x4c1577)[_0x17b3('0x1e')]();};}function respondWithResult(_0x2ec36f,_0x433c99){_0x433c99=_0x433c99||0xc8;return function(_0x19fa0d){if(_0x19fa0d){return _0x2ec36f[_0x17b3('0x1d')](_0x433c99)[_0x17b3('0x1f')](_0x19fa0d);}};}function respondWithFilteredResult(_0x55f90e,_0x1a000f){return function(_0x3e16c1){if(_0x3e16c1){var _0xdf5eef=typeof _0x1a000f[_0x17b3('0x20')]==='undefined'&&typeof _0x1a000f['limit']===_0x17b3('0x21');var _0x95855f=_0x3e16c1[_0x17b3('0x22')];var _0x45ad50=_0xdf5eef?0x0:_0x1a000f[_0x17b3('0x20')];var _0xfe5fdd=_0xdf5eef?_0x3e16c1[_0x17b3('0x22')]:_0x1a000f['offset']+_0x1a000f[_0x17b3('0x23')];var _0x482c76;if(_0xfe5fdd>=_0x95855f){_0xfe5fdd=_0x95855f;_0x482c76=0xc8;}else{_0x482c76=0xce;}_0x55f90e['status'](_0x482c76);return _0x55f90e['set'](_0x17b3('0x24'),_0x45ad50+'-'+_0xfe5fdd+'/'+_0x95855f)[_0x17b3('0x1f')](_0x3e16c1);}return null;};}function saveUpdates(_0x44afa9){return function(_0x863f90){if(_0x863f90){return _0x863f90[_0x17b3('0x25')](_0x44afa9)[_0x17b3('0x12')](function(_0x3c12ac){return _0x3c12ac;});}return null;};}function removeEntity(_0x4c2840){return function(_0xf04011){if(_0xf04011){return _0xf04011['destroy']()['then'](function(){var _0x7f2a52=_0xf04011[_0x17b3('0x26')]({'plain':!![]});var _0x481a5c=_0x17b3('0x27');return db['UserProfileResource'][_0x17b3('0x28')]({'where':{'type':_0x481a5c,'resourceId':_0x7f2a52['id']}})[_0x17b3('0x12')](function(){return _0xf04011;});})[_0x17b3('0x12')](function(){_0x4c2840[_0x17b3('0x1d')](0xcc)[_0x17b3('0x1e')]();});}};}function handleEntityNotFound(_0x335e9f){return function(_0xbfe4e3){if(!_0xbfe4e3){_0x335e9f[_0x17b3('0x1c')](0x194);}return _0xbfe4e3;};}function handleError(_0x43c1d6,_0x324bbc){_0x324bbc=_0x324bbc||0x1f4;return function(_0x4b976f){logger[_0x17b3('0x17')](_0x4b976f['stack']);if(_0x4b976f[_0x17b3('0x29')]){delete _0x4b976f[_0x17b3('0x29')];}_0x43c1d6[_0x17b3('0x1d')](_0x324bbc)[_0x17b3('0x2a')](_0x4b976f);};}function getImapHost(_0x265007){switch(_0x265007){case'gmail':return _0x17b3('0x2b');case _0x17b3('0x2c'):return _0x17b3('0x2d');case _0x17b3('0x2e'):return _0x17b3('0x2f');case _0x17b3('0x30'):return _0x17b3('0x31');}throw new Error('Unknown\x20email\x20service\x20provider',_0x265007);}function getSmtpHost(_0x38a88c){switch(_0x38a88c){case'gmail':return _0x17b3('0x32');case _0x17b3('0x2c'):return _0x17b3('0x33');case _0x17b3('0x2e'):return _0x17b3('0x34');case _0x17b3('0x30'):return'smtp.office365.com';}throw new Error(_0x17b3('0x35'),_0x38a88c);}function getAuthenticationOptions(_0x53c5f8,_0x3b00b2){var _0x47c80e={};var _0x3dbb92={};if(_0x53c5f8){_0x47c80e['user']=_0x3dbb92['user']=_0x3b00b2[_0x17b3('0x36')];_0x47c80e[_0x17b3('0x37')]=_0x3dbb92[_0x17b3('0x38')]=_0x3b00b2[_0x17b3('0x37')];if(_0x3b00b2[_0x17b3('0x39')]){_0x47c80e['modernAuthentication']=_0x3dbb92['modernAuthentication']=!![];_0x47c80e[_0x17b3('0x3a')]=_0x3dbb92[_0x17b3('0x3a')]=_0x3b00b2[_0x17b3('0x3a')];_0x47c80e[_0x17b3('0x37')]=_0x3dbb92['pass']=null;}else{_0x47c80e[_0x17b3('0x3a')]=_0x3dbb92[_0x17b3('0x3a')]=null;}_0x47c80e[_0x17b3('0x3b')]=getImapHost(_0x53c5f8);_0x47c80e[_0x17b3('0x3c')]=0x3e1;_0x3dbb92[_0x17b3('0x3b')]=getSmtpHost(_0x53c5f8);_0x3dbb92['port']=0x24b;_0x3dbb92[_0x17b3('0x3d')]=![];_0x47c80e[_0x17b3('0x3e')]=_0x3dbb92[_0x17b3('0x3e')]=null;}else{if(_0x3b00b2[_0x17b3('0x3f')]){_0x47c80e['user']=_0x3dbb92['user']=_0x3b00b2[_0x17b3('0x36')];_0x47c80e['password']=_0x3dbb92[_0x17b3('0x38')]=_0x3b00b2[_0x17b3('0x37')];}else{_0x47c80e['authentication']=_0x3dbb92[_0x17b3('0x3f')]=![];_0x47c80e[_0x17b3('0x40')]=_0x3dbb92[_0x17b3('0x40')]=null;_0x47c80e['password']=_0x3dbb92[_0x17b3('0x38')]=null;}_0x47c80e['host']=_0x3b00b2[_0x17b3('0x41')][_0x17b3('0x3b')];_0x47c80e[_0x17b3('0x3c')]=_0x3b00b2['Imap'][_0x17b3('0x3c')];_0x3dbb92[_0x17b3('0x3b')]=_0x3b00b2[_0x17b3('0x42')][_0x17b3('0x3b')];_0x3dbb92[_0x17b3('0x3c')]=_0x3b00b2[_0x17b3('0x42')][_0x17b3('0x3c')];}return{'Imap':_0x47c80e,'Smtp':_0x3dbb92};}exports[_0x17b3('0x43')]=function(_0x1170a9,_0x125eb5){var _0x277679={'include':[{'model':db[_0x17b3('0x44')],'as':_0x17b3('0x41')},{'model':db['MailServerOut'],'as':_0x17b3('0x42')},{'model':db['Pause'],'as':_0x17b3('0x45')}]},_0x2be806={},_0x28040d={'count':0x0,'rows':[]};var _0x427a13=_[_0x17b3('0x46')](db['MailAccount']['rawAttributes'],function(_0x191e75){return{'name':_0x191e75[_0x17b3('0x47')],'type':_0x191e75[_0x17b3('0x48')][_0x17b3('0x49')]};});_0x2be806['model']=_[_0x17b3('0x46')](_0x427a13,_0x17b3('0x29'));_0x2be806[_0x17b3('0x4a')]=_[_0x17b3('0x4b')](_0x1170a9[_0x17b3('0x4a')]);_0x2be806['filters']=_[_0x17b3('0x4c')](_0x2be806['model'],_0x2be806[_0x17b3('0x4a')]);_0x277679[_0x17b3('0x4d')]=_[_0x17b3('0x4c')](_0x2be806[_0x17b3('0x4e')],qs[_0x17b3('0x4f')](_0x1170a9[_0x17b3('0x4a')][_0x17b3('0x4f')]));_0x277679['attributes']=_0x277679[_0x17b3('0x4d')][_0x17b3('0x50')]?_0x277679[_0x17b3('0x4d')]:_0x2be806[_0x17b3('0x4e')];if(!_0x1170a9[_0x17b3('0x4a')][_0x17b3('0x51')]('nolimit')){_0x277679['limit']=qs[_0x17b3('0x23')](_0x1170a9[_0x17b3('0x4a')][_0x17b3('0x23')]);_0x277679[_0x17b3('0x20')]=qs[_0x17b3('0x20')](_0x1170a9[_0x17b3('0x4a')][_0x17b3('0x20')]);}_0x277679[_0x17b3('0x52')]=qs[_0x17b3('0x53')](_0x1170a9[_0x17b3('0x4a')][_0x17b3('0x53')]);_0x277679[_0x17b3('0x54')]=qs[_0x17b3('0x55')](_[_0x17b3('0x56')](_0x1170a9[_0x17b3('0x4a')],_0x2be806['filters']),_0x427a13);if(_0x1170a9['query'][_0x17b3('0x57')]){_0x277679[_0x17b3('0x54')]=_[_0x17b3('0x58')](_0x277679['where'],{'$or':_['map'](_0x427a13,function(_0x3f6fd9){if(_0x3f6fd9[_0x17b3('0x48')]!==_0x17b3('0x59')){var _0x24aae0={};_0x24aae0[_0x3f6fd9['name']]={'$like':'%'+_0x1170a9['query'][_0x17b3('0x57')]+'%'};return _0x24aae0;}})});}_0x277679=_[_0x17b3('0x58')]({},_0x277679,_0x1170a9['options']);var _0x9fbb47={'where':_0x277679[_0x17b3('0x54')]};return db[_0x17b3('0x5a')][_0x17b3('0x22')](_0x9fbb47)['then'](function(_0xfd666){_0x28040d['count']=_0xfd666;if(_0x1170a9['query'][_0x17b3('0x5b')]){_0x277679[_0x17b3('0x5c')]=[{'all':!![]}];}return db['MailAccount'][_0x17b3('0x5d')](_0x277679);})[_0x17b3('0x12')](function(_0x445abb){_0x28040d[_0x17b3('0x5e')]=_0x445abb;return _0x28040d;})[_0x17b3('0x12')](respondWithFilteredResult(_0x125eb5,_0x277679))[_0x17b3('0x1b')](handleError(_0x125eb5,null));};exports[_0x17b3('0x5f')]=function(_0x4862b2,_0x438125){var _0x1e24c5={'raw':![],'where':{'id':_0x4862b2[_0x17b3('0x60')]['id']},'include':[{'model':db[_0x17b3('0x44')],'as':_0x17b3('0x41')},{'model':db[_0x17b3('0x61')],'as':_0x17b3('0x42')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x469471={};_0x469471['model']=_[_0x17b3('0x4b')](db[_0x17b3('0x5a')][_0x17b3('0x62')]);_0x469471[_0x17b3('0x4a')]=_[_0x17b3('0x4b')](_0x4862b2[_0x17b3('0x4a')]);_0x469471[_0x17b3('0x55')]=_[_0x17b3('0x4c')](_0x469471[_0x17b3('0x4e')],_0x469471[_0x17b3('0x4a')]);_0x1e24c5['attributes']=_[_0x17b3('0x4c')](_0x469471[_0x17b3('0x4e')],qs[_0x17b3('0x4f')](_0x4862b2[_0x17b3('0x4a')]['fields']));_0x1e24c5[_0x17b3('0x4d')]=_0x1e24c5[_0x17b3('0x4d')]['length']?_0x1e24c5[_0x17b3('0x4d')]:_0x469471[_0x17b3('0x4e')];if(_0x4862b2[_0x17b3('0x4a')][_0x17b3('0x5b')]){_0x1e24c5[_0x17b3('0x5c')]=[{'all':!![]}];}_0x1e24c5=_[_0x17b3('0x58')]({},_0x1e24c5,_0x4862b2['options']);return db[_0x17b3('0x5a')][_0x17b3('0x63')](_0x1e24c5)[_0x17b3('0x12')](handleEntityNotFound(_0x438125,null))[_0x17b3('0x12')](respondWithResult(_0x438125,null))['catch'](handleError(_0x438125,null));};exports['update']=function(_0x3b049d,_0x1d177a){if(_0x3b049d[_0x17b3('0x64')]['id']){delete _0x3b049d['body']['id'];}var _0x18e98a=_0x3b049d['body'][_0x17b3('0x65')]===_0x17b3('0x66')?null:_0x3b049d[_0x17b3('0x64')]['provider'];var _0x56920c=_0x3b049d['body']['Imap']||{};var _0x388e56=_0x3b049d[_0x17b3('0x64')][_0x17b3('0x42')]||{};if(_0x18e98a){_0x56920c[_0x17b3('0x3b')]=getImapHost(_0x18e98a);_0x56920c['port']=0x3e1;_0x388e56['host']=getSmtpHost(_0x18e98a);_0x388e56[_0x17b3('0x3c')]=0x24b;_0x388e56[_0x17b3('0x3d')]=![];}if(_0x388e56[_0x17b3('0x39')]){_0x388e56[_0x17b3('0x3d')]=![];}else{_0x388e56['CloudProviderId']=null;}if(!_0x56920c[_0x17b3('0x39')])_0x56920c['CloudProviderId']=null;_0x3b049d[_0x17b3('0x64')]['Imap']=_0x56920c;_0x3b049d[_0x17b3('0x64')][_0x17b3('0x42')]=_0x388e56;return db[_0x17b3('0x5a')][_0x17b3('0x63')]({'where':{'id':_0x3b049d['params']['id']},'include':[{'model':db[_0x17b3('0x44')],'as':'Imap'},{'model':db[_0x17b3('0x61')],'as':_0x17b3('0x42')},{'model':db[_0x17b3('0x67')],'as':_0x17b3('0x45')}]})[_0x17b3('0x12')](handleEntityNotFound(_0x1d177a,null))[_0x17b3('0x12')](function(_0x74b1c8){if(!_0x74b1c8)throw new Error(_0x17b3('0x68'));if(_0x74b1c8[_0x17b3('0x3e')])delete _0x3b049d[_0x17b3('0x64')]['Imap'];return _0x74b1c8;})[_0x17b3('0x12')](saveUpdates(_0x3b049d[_0x17b3('0x64')],null))[_0x17b3('0x12')](function(_0x6b974b){if(!_0x3b049d[_0x17b3('0x64')][_0x17b3('0x41')])return _0x6b974b;return db[_0x17b3('0x44')][_0x17b3('0x25')](_0x3b049d['body'][_0x17b3('0x41')],{'where':{'MailAccountId':_0x6b974b['id']}})[_0x17b3('0x12')](function(){return _0x6b974b;});})['then'](function(_0x56ae44){if(!_0x3b049d[_0x17b3('0x64')][_0x17b3('0x42')])return _0x56ae44;return db[_0x17b3('0x61')]['update'](_0x3b049d['body']['Smtp'],{'where':{'MailAccountId':_0x56ae44['id']}})[_0x17b3('0x12')](function(){return _0x56ae44;});})[_0x17b3('0x12')](respondWithResult(_0x1d177a,null))[_0x17b3('0x1b')](handleError(_0x1d177a,null));};exports[_0x17b3('0x69')]=function(_0x97ada1,_0x3d8c17){return db[_0x17b3('0x5a')]['describe']()[_0x17b3('0x12')](respondWithResult(_0x3d8c17,null))[_0x17b3('0x1b')](handleError(_0x3d8c17,null));};exports['addDisposition']=function(_0x2ec74d,_0x2d0da8){if(_0x2ec74d[_0x17b3('0x64')]['id']){delete _0x2ec74d['body']['id'];}return db[_0x17b3('0x5a')][_0x17b3('0x63')]({'where':{'id':_0x2ec74d['params']['id']}})['then'](handleEntityNotFound(_0x2d0da8,null))[_0x17b3('0x12')](function(_0x8ae293){if(_0x8ae293){_0x2ec74d[_0x17b3('0x64')][_0x17b3('0x6a')]=_0x8ae293['id'];return db[_0x17b3('0x6b')]['create'](_0x2ec74d[_0x17b3('0x64')]);}})[_0x17b3('0x12')](respondWithResult(_0x2d0da8,null))[_0x17b3('0x1b')](handleError(_0x2d0da8,null));};exports[_0x17b3('0x6c')]=function(_0x54ee36,_0x2f95d6){var _0x301b40={'raw':![],'where':{}};var _0x1f0890={};var _0x2b284f={'count':0x0,'rows':[]};return db[_0x17b3('0x5a')]['findOne']({'where':{'id':_0x54ee36[_0x17b3('0x60')]['id']}})['then'](handleEntityNotFound(_0x2f95d6,null))[_0x17b3('0x12')](function(_0x5bfe7b){if(_0x5bfe7b){_0x1f0890['model']=_[_0x17b3('0x4b')](db[_0x17b3('0x6b')][_0x17b3('0x62')]);_0x1f0890[_0x17b3('0x4a')]=_['keys'](_0x54ee36[_0x17b3('0x4a')]);_0x1f0890['filters']=_[_0x17b3('0x4c')](_0x1f0890[_0x17b3('0x4e')],_0x1f0890[_0x17b3('0x4a')]);_0x301b40[_0x17b3('0x4d')]=_['intersection'](_0x1f0890[_0x17b3('0x4e')],qs[_0x17b3('0x4f')](_0x54ee36[_0x17b3('0x4a')]['fields']));_0x301b40[_0x17b3('0x4d')]=_0x301b40[_0x17b3('0x4d')][_0x17b3('0x50')]?_0x301b40[_0x17b3('0x4d')]:_0x1f0890[_0x17b3('0x4e')];if(!_0x54ee36[_0x17b3('0x4a')]['hasOwnProperty']('nolimit')){_0x301b40['limit']=qs[_0x17b3('0x23')](_0x54ee36[_0x17b3('0x4a')][_0x17b3('0x23')]);_0x301b40[_0x17b3('0x20')]=qs[_0x17b3('0x20')](_0x54ee36[_0x17b3('0x4a')]['offset']);}_0x301b40[_0x17b3('0x52')]=qs[_0x17b3('0x53')](_0x54ee36[_0x17b3('0x4a')][_0x17b3('0x53')]);_0x301b40[_0x17b3('0x54')]=qs[_0x17b3('0x55')](_[_0x17b3('0x56')](_0x54ee36[_0x17b3('0x4a')],_0x1f0890['filters']));_0x301b40[_0x17b3('0x54')][_0x17b3('0x6a')]=_0x5bfe7b['id'];if(_0x54ee36[_0x17b3('0x4a')][_0x17b3('0x57')]){_0x301b40[_0x17b3('0x54')]=_[_0x17b3('0x58')](_0x301b40['where'],{'$or':_[_0x17b3('0x46')](_0x301b40[_0x17b3('0x4d')],function(_0xeac7dc){var _0x56fd58={};_0x56fd58[_0xeac7dc]={'$like':'%'+_0x54ee36[_0x17b3('0x4a')]['filter']+'%'};return _0x56fd58;})});}_0x301b40=_[_0x17b3('0x58')]({},_0x301b40,_0x54ee36[_0x17b3('0x6d')]);return db[_0x17b3('0x6b')][_0x17b3('0x22')]({'where':_0x301b40[_0x17b3('0x54')]})[_0x17b3('0x12')](function(_0x27b636){_0x2b284f['count']=_0x27b636;if(_0x54ee36[_0x17b3('0x4a')]['includeAll']){_0x301b40[_0x17b3('0x5c')]=[{'all':!![]}];}return db[_0x17b3('0x6b')][_0x17b3('0x5d')](_0x301b40);})[_0x17b3('0x12')](function(_0x3ddee9){_0x2b284f['rows']=_0x3ddee9;return _0x2b284f;});}})['then'](respondWithFilteredResult(_0x2f95d6,_0x301b40))[_0x17b3('0x1b')](handleError(_0x2f95d6,null));};exports['removeDispositions']=function(_0x167574,_0xf26ce8){return db[_0x17b3('0x5a')][_0x17b3('0x63')]({'where':{'id':_0x167574[_0x17b3('0x60')]['id']}})['then'](handleEntityNotFound(_0xf26ce8,null))[_0x17b3('0x12')](function(_0x4cd713){if(_0x4cd713){return _0x4cd713['removeDispositions'](_0x167574[_0x17b3('0x4a')][_0x17b3('0x6e')]);}})['then'](respondWithStatusCode(_0xf26ce8,null))[_0x17b3('0x1b')](handleError(_0xf26ce8,null));};exports[_0x17b3('0x6f')]=function(_0xe1b02c,_0x300544){if(_0xe1b02c[_0x17b3('0x64')]['id']){delete _0xe1b02c[_0x17b3('0x64')]['id'];}return db[_0x17b3('0x5a')][_0x17b3('0x63')]({'where':{'id':_0xe1b02c[_0x17b3('0x60')]['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x300544,null))['then'](function(_0x1fa75c){if(_0x1fa75c){_0xe1b02c[_0x17b3('0x64')][_0x17b3('0x6a')]=_0x1fa75c['id'];return db[_0x17b3('0x70')]['create'](_0xe1b02c[_0x17b3('0x64')]);}})[_0x17b3('0x12')](respondWithResult(_0x300544,null))[_0x17b3('0x1b')](handleError(_0x300544,null));};exports['getAnswers']=function(_0x2f8085,_0x3570ef){var _0x3f4a63={'raw':![],'where':{}};var _0x27b95f={};var _0x5945da={'count':0x0,'rows':[]};return db[_0x17b3('0x5a')][_0x17b3('0x71')]({'where':{'id':_0x2f8085['params']['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x3570ef,null))[_0x17b3('0x12')](function(_0x47166c){if(_0x47166c){_0x27b95f[_0x17b3('0x4e')]=_['keys'](db[_0x17b3('0x70')]['rawAttributes']);_0x27b95f[_0x17b3('0x4a')]=_[_0x17b3('0x4b')](_0x2f8085[_0x17b3('0x4a')]);_0x27b95f[_0x17b3('0x55')]=_[_0x17b3('0x4c')](_0x27b95f[_0x17b3('0x4e')],_0x27b95f[_0x17b3('0x4a')]);_0x3f4a63['attributes']=_[_0x17b3('0x4c')](_0x27b95f['model'],qs['fields'](_0x2f8085[_0x17b3('0x4a')]['fields']));_0x3f4a63[_0x17b3('0x4d')]=_0x3f4a63['attributes'][_0x17b3('0x50')]?_0x3f4a63[_0x17b3('0x4d')]:_0x27b95f[_0x17b3('0x4e')];if(!_0x2f8085['query'][_0x17b3('0x51')]('nolimit')){_0x3f4a63[_0x17b3('0x23')]=qs[_0x17b3('0x23')](_0x2f8085[_0x17b3('0x4a')][_0x17b3('0x23')]);_0x3f4a63['offset']=qs[_0x17b3('0x20')](_0x2f8085[_0x17b3('0x4a')]['offset']);}_0x3f4a63[_0x17b3('0x52')]=qs[_0x17b3('0x53')](_0x2f8085['query'][_0x17b3('0x53')]);_0x3f4a63['where']=qs[_0x17b3('0x55')](_['pick'](_0x2f8085[_0x17b3('0x4a')],_0x27b95f[_0x17b3('0x55')]));_0x3f4a63[_0x17b3('0x54')][_0x17b3('0x6a')]=_0x47166c['id'];if(_0x2f8085[_0x17b3('0x4a')]['filter']){_0x3f4a63['where']=_[_0x17b3('0x58')](_0x3f4a63[_0x17b3('0x54')],{'$or':_[_0x17b3('0x46')](_0x3f4a63[_0x17b3('0x4d')],function(_0x259275){var _0x26f058={};_0x26f058[_0x259275]={'$like':'%'+_0x2f8085[_0x17b3('0x4a')]['filter']+'%'};return _0x26f058;})});}_0x3f4a63=_[_0x17b3('0x58')]({},_0x3f4a63,_0x2f8085[_0x17b3('0x6d')]);return db[_0x17b3('0x70')]['count']({'where':_0x3f4a63[_0x17b3('0x54')]})[_0x17b3('0x12')](function(_0x41b298){_0x5945da['count']=_0x41b298;if(_0x2f8085['query'][_0x17b3('0x5b')]){_0x3f4a63[_0x17b3('0x5c')]=[{'all':!![]}];}return db[_0x17b3('0x70')]['findAll'](_0x3f4a63);})['then'](function(_0x130bed){_0x5945da['rows']=_0x130bed;return _0x5945da;});}})[_0x17b3('0x12')](respondWithFilteredResult(_0x3570ef,_0x3f4a63))['catch'](handleError(_0x3570ef,null));};exports[_0x17b3('0x72')]=function(_0x595124,_0x29985f){return db[_0x17b3('0x5a')][_0x17b3('0x63')]({'where':{'id':_0x595124['params']['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x29985f,null))[_0x17b3('0x12')](function(_0x55b44f){if(_0x55b44f){return _0x55b44f[_0x17b3('0x72')](_0x595124[_0x17b3('0x4a')][_0x17b3('0x6e')]);}})['then'](respondWithStatusCode(_0x29985f,null))[_0x17b3('0x1b')](handleError(_0x29985f,null));};exports[_0x17b3('0x73')]=function(_0x29befc,_0x14291a){var _0x5845cc={'name':_0x29befc[_0x17b3('0x64')][_0x17b3('0x29')],'key':_0x29befc[_0x17b3('0x64')][_0x17b3('0x49')],'provider':_0x29befc[_0x17b3('0x64')][_0x17b3('0x65')]===_0x17b3('0x66')?null:_0x29befc[_0x17b3('0x64')]['provider'],'email':_0x29befc['body'][_0x17b3('0x74')],'ListId':_0x29befc[_0x17b3('0x64')][_0x17b3('0x75')],'active':!_[_0x17b3('0x76')](_0x29befc[_0x17b3('0x64')][_0x17b3('0x77')])?_0x29befc[_0x17b3('0x64')][_0x17b3('0x77')]:!![],'description':_0x29befc[_0x17b3('0x64')][_0x17b3('0x78')]||null};var _0x2a6cf5=getAuthenticationOptions(_0x5845cc[_0x17b3('0x65')],_0x29befc['body']);_0x5845cc[_0x17b3('0x41')]=_0x2a6cf5[_0x17b3('0x41')];_0x5845cc[_0x17b3('0x42')]=_0x2a6cf5[_0x17b3('0x42')];return db[_0x17b3('0x5a')][_0x17b3('0x73')](_0x5845cc,{'include':[{'model':db[_0x17b3('0x61')],'as':_0x17b3('0x42')},{'model':db['MailServerIn'],'as':_0x17b3('0x41')}]})[_0x17b3('0x12')](function(_0x2a1429){var _0x2e6a92=_0x29befc[_0x17b3('0x40')][_0x17b3('0x26')]({'plain':!![]});if(!_0x2e6a92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e6a92[_0x17b3('0x79')]===_0x17b3('0x40')){var _0x4e7822=_0x2a1429[_0x17b3('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x17b3('0x27'),'userProfileId':_0x2e6a92['userProfileId']},'raw':!![]})['then'](function(_0x4eac0d){if(_0x4eac0d&&_0x4eac0d[_0x17b3('0x7a')]===0x0){return db[_0x17b3('0x7b')][_0x17b3('0x73')]({'name':_0x4e7822[_0x17b3('0x29')],'resourceId':_0x4e7822['id'],'type':_0x4eac0d[_0x17b3('0x29')],'sectionId':_0x4eac0d['id']},{})['then'](function(){return _0x2a1429;});}else{return _0x2a1429;}})['catch'](function(_0x42eb94){logger[_0x17b3('0x17')](_0x17b3('0x7c'),_0x42eb94);throw _0x42eb94;});}return _0x2a1429;})['then'](respondWithResult(_0x14291a,0xc9))[_0x17b3('0x1b')](handleError(_0x14291a,null));};exports[_0x17b3('0x7d')]=function(_0x55ce0,_0x772ed){return db[_0x17b3('0x5a')][_0x17b3('0x71')]({'where':{'id':_0x55ce0[_0x17b3('0x60')]['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x772ed,null))[_0x17b3('0x12')](function(_0x24040e){if(_0x24040e){return _0x24040e[_0x17b3('0x7d')]();}return null;})[_0x17b3('0x12')](respondWithResult(_0x772ed,null))['catch'](handleError(_0x772ed,null));};exports[_0x17b3('0x7e')]=function(_0xe91138,_0x227cc9){if(_0xe91138[_0x17b3('0x64')]['id']){delete _0xe91138[_0x17b3('0x64')]['id'];}return db[_0x17b3('0x5a')][_0x17b3('0x63')]({'where':{'id':_0xe91138['params']['id']}})['then'](handleEntityNotFound(_0x227cc9,null))[_0x17b3('0x12')](function(_0x1a363a){if(_0x1a363a){_0xe91138[_0x17b3('0x64')]['MailAccountId']=_0x1a363a['id'];return db[_0x17b3('0x44')][_0x17b3('0x73')](_0xe91138[_0x17b3('0x64')]);}})[_0x17b3('0x12')](respondWithResult(_0x227cc9,null))[_0x17b3('0x1b')](handleError(_0x227cc9,null));};exports[_0x17b3('0x7f')]=function(_0x2d9473,_0x4fc256){return db[_0x17b3('0x5a')][_0x17b3('0x71')]({'where':{'id':_0x2d9473[_0x17b3('0x60')]['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x4fc256,null))[_0x17b3('0x12')](function(_0x450965){if(_0x450965){return _0x450965[_0x17b3('0x80')](null);}return null;})['then'](respondWithStatusCode(_0x4fc256,null))['catch'](handleError(_0x4fc256,null));};exports[_0x17b3('0x81')]=function(_0x44d10a,_0x2bad9b){return db[_0x17b3('0x5a')][_0x17b3('0x71')]({'where':{'id':_0x44d10a['params']['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x2bad9b,null))['then'](function(_0x1dab25){if(_0x1dab25){return _0x1dab25[_0x17b3('0x81')]();}return null;})['then'](respondWithResult(_0x2bad9b,null))['catch'](handleError(_0x2bad9b,null));};exports[_0x17b3('0x82')]=function(_0x372fd3,_0x225762){if(_0x372fd3[_0x17b3('0x64')]['id']){delete _0x372fd3[_0x17b3('0x64')]['id'];}return db['MailAccount'][_0x17b3('0x63')]({'where':{'id':_0x372fd3[_0x17b3('0x60')]['id']}})['then'](handleEntityNotFound(_0x225762,null))[_0x17b3('0x12')](function(_0x25d95a){if(_0x25d95a){_0x372fd3[_0x17b3('0x64')][_0x17b3('0x6a')]=_0x25d95a['id'];return db['MailServerOut'][_0x17b3('0x73')](_0x372fd3['body']);}})[_0x17b3('0x12')](respondWithResult(_0x225762,null))['catch'](handleError(_0x225762,null));};exports[_0x17b3('0x83')]=function(_0xd20897,_0x4d0489){return db['MailAccount'][_0x17b3('0x71')]({'where':{'id':_0xd20897[_0x17b3('0x60')]['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x4d0489,null))[_0x17b3('0x12')](function(_0xb79f55){if(_0xb79f55){return _0xb79f55[_0x17b3('0x84')](null);}return null;})[_0x17b3('0x12')](respondWithStatusCode(_0x4d0489,null))[_0x17b3('0x1b')](handleError(_0x4d0489,null));};exports[_0x17b3('0x85')]=function(_0x27c080,_0x1ad647){return db[_0x17b3('0x86')][_0x17b3('0x63')]({'where':{'id':_0x27c080['params']['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x1ad647,null))['then'](function(_0x4adee3){if(_0x4adee3){return _0x4adee3[_0x17b3('0x85')](_0x27c080[_0x17b3('0x64')][_0x17b3('0x6e')],_[_0x17b3('0x87')](_0x27c080[_0x17b3('0x64')],[_0x17b3('0x6e'),'id'])||{});}})[_0x17b3('0x12')](respondWithResult(_0x1ad647,null))[_0x17b3('0x1b')](handleError(_0x1ad647,null));};exports[_0x17b3('0x88')]=function(_0x5a938f,_0x4305ab){var _0x5b2f20={'raw':![],'where':{}};var _0x1f95d6={};var _0xef869b={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5a938f['params']['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x4305ab,null))['then'](function(_0xf3e1f9){if(_0xf3e1f9){_0x1f95d6[_0x17b3('0x4e')]=_[_0x17b3('0x4b')](db[_0x17b3('0x86')][_0x17b3('0x62')]);_0x1f95d6[_0x17b3('0x4a')]=_[_0x17b3('0x4b')](_0x5a938f[_0x17b3('0x4a')]);_0x1f95d6[_0x17b3('0x55')]=_[_0x17b3('0x4c')](_0x1f95d6[_0x17b3('0x4e')],_0x1f95d6[_0x17b3('0x4a')]);_0x5b2f20[_0x17b3('0x4d')]=_[_0x17b3('0x4c')](_0x1f95d6['model'],qs[_0x17b3('0x4f')](_0x5a938f['query'][_0x17b3('0x4f')]));_0x5b2f20[_0x17b3('0x4d')]=_0x5b2f20[_0x17b3('0x4d')][_0x17b3('0x50')]?_0x5b2f20[_0x17b3('0x4d')]:_0x1f95d6[_0x17b3('0x4e')];if(!_0x5a938f[_0x17b3('0x4a')][_0x17b3('0x51')]('nolimit')){_0x5b2f20[_0x17b3('0x23')]=qs['limit'](_0x5a938f['query'][_0x17b3('0x23')]);_0x5b2f20['offset']=qs[_0x17b3('0x20')](_0x5a938f['query']['offset']);}_0x5b2f20[_0x17b3('0x52')]=qs[_0x17b3('0x53')](_0x5a938f['query'][_0x17b3('0x53')]);_0x5b2f20['where']=qs[_0x17b3('0x55')](_[_0x17b3('0x56')](_0x5a938f['query'],_0x1f95d6[_0x17b3('0x55')]));_0x5b2f20['where'][_0x17b3('0x6a')]=_0xf3e1f9['id'];if(_0x5a938f[_0x17b3('0x4a')][_0x17b3('0x57')]){_0x5b2f20[_0x17b3('0x54')]=_[_0x17b3('0x58')](_0x5b2f20[_0x17b3('0x54')],{'$or':_['map'](_0x5b2f20[_0x17b3('0x4d')],function(_0x4fee7a){var _0x48b39e={};_0x48b39e[_0x4fee7a]={'$like':'%'+_0x5a938f[_0x17b3('0x4a')]['filter']+'%'};return _0x48b39e;})});}_0x5b2f20=_['merge']({},_0x5b2f20,_0x5a938f[_0x17b3('0x6d')]);return db['MailInteraction'][_0x17b3('0x22')]({'where':_0x5b2f20['where']})['then'](function(_0x36b2b8){_0xef869b[_0x17b3('0x22')]=_0x36b2b8;if(_0x5a938f[_0x17b3('0x4a')]['includeAll']){_0x5b2f20[_0x17b3('0x5c')]=[{'model':db['CmContact'],'as':_0x17b3('0x89'),'required':![]},{'model':db['User'],'as':_0x17b3('0x8a'),'attributes':[_0x17b3('0x29'),_0x17b3('0x8b'),_0x17b3('0x8c')],'required':![]},{'model':db[_0x17b3('0x8d')],'as':_0x17b3('0x8e'),'attributes':['id',_0x17b3('0x29'),_0x17b3('0x8f')],'where':_0x5a938f[_0x17b3('0x4a')][_0x17b3('0x90')]?{'id':_0x5a938f['query'][_0x17b3('0x90')]}:undefined,'required':_0x5a938f[_0x17b3('0x4a')][_0x17b3('0x90')]?!![]:![]}];}return db[_0x17b3('0x86')]['findAll'](_0x5b2f20);})[_0x17b3('0x12')](function(_0x164421){_0xef869b[_0x17b3('0x5e')]=_0x164421;return _0xef869b;});}})[_0x17b3('0x12')](respondWithFilteredResult(_0x4305ab,_0x5b2f20))['catch'](handleError(_0x4305ab,null));};exports['addApplications']=function addApplications(_0x1c6d83,_0xafce04){var _0x21e827=_0x1c6d83[_0x17b3('0x60')]['id'];var _0x438f74=_0x1c6d83[_0x17b3('0x64')];var _0x461ffe=0xc8;var _0x42ed46=null;return db['sequelize'][_0x17b3('0x91')]({'isolationLevel':db[_0x17b3('0x92')][_0x17b3('0x93')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x186980){return db[_0x17b3('0x5a')][_0x17b3('0x71')]({'where':{'id':_0x21e827},'transaction':_0x186980})[_0x17b3('0x12')](function(_0x45d0ab){if(_0x45d0ab){return db['MailApplication'][_0x17b3('0x28')]({'where':{'MailAccountId':_0x21e827},'transaction':_0x186980})['then'](function(){var _0x24b5ae=_[_0x17b3('0x46')](_0x438f74,function(_0x551372){_0x551372['MailAccountId']=_0x21e827;return _0x551372;});return db['MailApplication']['bulkCreate'](_0x24b5ae,{'transaction':_0x186980});});}else{_0x461ffe=0x194;_0x42ed46=[];}});})[_0x17b3('0x12')](function(){if(_0x461ffe!==0x194){return db[_0x17b3('0x94')][_0x17b3('0x95')]({'where':{'MailAccountId':_0x21e827},'order':'priority'})['then'](function(_0x1706cb){_0x42ed46=_0x1706cb;});}})[_0x17b3('0x1b')](function(_0x51f945){_0x461ffe=0x1f4;logger[_0x17b3('0x17')](_0x51f945[_0x17b3('0x96')]);if(_0x51f945[_0x17b3('0x29')]){delete _0x51f945[_0x17b3('0x29')];}_0x42ed46=_0x51f945;})[_0x17b3('0x97')](function(){if(_0x42ed46===null){_0xafce04[_0x17b3('0x1c')](_0x461ffe);}else{if(_0x461ffe===0x1f4){_0xafce04[_0x17b3('0x1d')](_0x461ffe)[_0x17b3('0x2a')](_0x42ed46);}else{_0xafce04['status'](_0x461ffe)[_0x17b3('0x1f')](_0x42ed46);}}});};exports[_0x17b3('0x98')]=function(_0x43c4e1,_0x45617f){var _0x425ea5={};var _0x42151c={};var _0x3b15a2;var _0x434474;return db[_0x17b3('0x5a')][_0x17b3('0x71')]({'where':{'id':_0x43c4e1[_0x17b3('0x60')]['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x45617f,null))['then'](function(_0x584c69){if(_0x584c69){_0x3b15a2=_0x584c69;_0x42151c['model']=_['keys'](db[_0x17b3('0x94')][_0x17b3('0x62')]);_0x42151c[_0x17b3('0x4a')]=_[_0x17b3('0x4b')](_0x43c4e1[_0x17b3('0x4a')]);_0x42151c[_0x17b3('0x55')]=_[_0x17b3('0x4c')](_0x42151c[_0x17b3('0x4e')],_0x42151c[_0x17b3('0x4a')]);_0x425ea5[_0x17b3('0x4d')]=_['intersection'](_0x42151c[_0x17b3('0x4e')],qs[_0x17b3('0x4f')](_0x43c4e1[_0x17b3('0x4a')][_0x17b3('0x4f')]));_0x425ea5[_0x17b3('0x4d')]=_0x425ea5[_0x17b3('0x4d')][_0x17b3('0x50')]?_0x425ea5[_0x17b3('0x4d')]:_0x42151c['model'];_0x425ea5[_0x17b3('0x52')]=qs['sort'](_0x43c4e1[_0x17b3('0x4a')][_0x17b3('0x53')]);_0x425ea5[_0x17b3('0x54')]=qs[_0x17b3('0x55')](_['pick'](_0x43c4e1[_0x17b3('0x4a')],_0x42151c[_0x17b3('0x55')]));if(_0x43c4e1[_0x17b3('0x4a')][_0x17b3('0x57')]){_0x425ea5[_0x17b3('0x54')]=_[_0x17b3('0x58')](_0x425ea5[_0x17b3('0x54')],{'$or':_[_0x17b3('0x46')](_0x425ea5[_0x17b3('0x4d')],function(_0x5358d0){var _0x19107b={};_0x19107b[_0x5358d0]={'$like':'%'+_0x43c4e1['query'][_0x17b3('0x57')]+'%'};return _0x19107b;})});}_0x425ea5=_[_0x17b3('0x58')]({},_0x425ea5,_0x43c4e1[_0x17b3('0x6d')]);return _0x3b15a2[_0x17b3('0x98')](_0x425ea5);}})['then'](function(_0x515274){if(_0x515274){_0x434474=_0x515274[_0x17b3('0x50')];if(!_0x43c4e1[_0x17b3('0x4a')][_0x17b3('0x51')](_0x17b3('0x99'))){_0x425ea5[_0x17b3('0x23')]=qs['limit'](_0x43c4e1[_0x17b3('0x4a')]['limit']);_0x425ea5[_0x17b3('0x20')]=qs[_0x17b3('0x20')](_0x43c4e1[_0x17b3('0x4a')][_0x17b3('0x20')]);}return _0x3b15a2[_0x17b3('0x98')](_0x425ea5);}})[_0x17b3('0x12')](function(_0x34b792){if(_0x34b792){return _0x34b792?{'count':_0x434474,'rows':_0x34b792}:null;}})[_0x17b3('0x12')](respondWithResult(_0x45617f,null))[_0x17b3('0x1b')](handleError(_0x45617f,null));};exports[_0x17b3('0x9a')]=function(_0x2ff2c4,_0x501dbc){var _0x4155b9={'raw':!![],'where':{}};var _0x23a995={};var _0x159d58={'count':0x0,'rows':[]};return db['MailAccount'][_0x17b3('0x71')]({'where':{'id':_0x2ff2c4[_0x17b3('0x60')]['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x501dbc,null))['then'](function(_0x1a92c8){if(_0x1a92c8){_0x23a995[_0x17b3('0x4e')]=_[_0x17b3('0x4b')](db['MailMessage'][_0x17b3('0x62')]);_0x23a995[_0x17b3('0x4a')]=_[_0x17b3('0x4b')](_0x2ff2c4[_0x17b3('0x4a')]);_0x23a995[_0x17b3('0x55')]=_[_0x17b3('0x4c')](_0x23a995[_0x17b3('0x4e')],_0x23a995[_0x17b3('0x4a')]);_0x4155b9[_0x17b3('0x4d')]=_[_0x17b3('0x4c')](_0x23a995[_0x17b3('0x4e')],qs[_0x17b3('0x4f')](_0x2ff2c4[_0x17b3('0x4a')]['fields']));_0x4155b9[_0x17b3('0x4d')]=_0x4155b9['attributes'][_0x17b3('0x50')]?_0x4155b9[_0x17b3('0x4d')]:_0x23a995[_0x17b3('0x4e')];if(!_0x2ff2c4[_0x17b3('0x4a')][_0x17b3('0x51')]('nolimit')){_0x4155b9[_0x17b3('0x23')]=qs[_0x17b3('0x23')](_0x2ff2c4['query']['limit']);_0x4155b9['offset']=qs['offset'](_0x2ff2c4[_0x17b3('0x4a')][_0x17b3('0x20')]);}_0x4155b9[_0x17b3('0x52')]=qs[_0x17b3('0x53')](_0x2ff2c4['query']['sort']);_0x4155b9[_0x17b3('0x54')]=qs['filters'](_[_0x17b3('0x56')](_0x2ff2c4[_0x17b3('0x4a')],_0x23a995[_0x17b3('0x55')]));_0x4155b9['where'][_0x17b3('0x6a')]=_0x1a92c8['id'];if(_0x2ff2c4[_0x17b3('0x4a')][_0x17b3('0x57')]){_0x4155b9['where']=_[_0x17b3('0x58')](_0x4155b9[_0x17b3('0x54')],{'$or':_[_0x17b3('0x46')](_0x4155b9['attributes'],function(_0x265889){var _0x2db374={};_0x2db374[_0x265889]={'$like':'%'+_0x2ff2c4['query'][_0x17b3('0x57')]+'%'};return _0x2db374;})});}if(_0x2ff2c4[_0x17b3('0x4a')][_0x17b3('0x9b')]){var _0x1c49b0=_0x2ff2c4['query'][_0x17b3('0x9b')]['split'](',');var _0x47ae92={};_0x47ae92[_0x1c49b0[0x0]]={'$gte':moment(_0x1c49b0[0x1])[_0x17b3('0x9c')](_0x17b3('0x9d'))};_0x4155b9[_0x17b3('0x54')]=_['merge'](_0x4155b9['where'],_0x47ae92);}_0x4155b9=_[_0x17b3('0x58')]({},_0x4155b9,_0x2ff2c4[_0x17b3('0x6d')]);return db[_0x17b3('0x9e')]['count']({'where':_0x4155b9[_0x17b3('0x54')]})['then'](function(_0x1459ed){_0x159d58[_0x17b3('0x22')]=_0x1459ed;if(_0x2ff2c4[_0x17b3('0x4a')][_0x17b3('0x5b')]){_0x4155b9[_0x17b3('0x5c')]=[{'all':!![]}];}return db[_0x17b3('0x9e')]['findAll'](_0x4155b9);})['then'](function(_0x141a2f){if(_0x2ff2c4[_0x17b3('0x4a')][_0x17b3('0x9f')]===_0x17b3('0xa0')){for(var _0x1ee21a=0x0;_0x1ee21a<_0x141a2f[_0x17b3('0x50')];_0x1ee21a++){_0x141a2f[_0x1ee21a]['body']=juice(_0x141a2f[_0x1ee21a][_0x17b3('0x64')]);}}_0x159d58[_0x17b3('0x5e')]=_0x141a2f;return _0x159d58;});}})[_0x17b3('0x12')](respondWithFilteredResult(_0x501dbc,_0x4155b9))['catch'](handleError(_0x501dbc,null));};exports[_0x17b3('0x2a')]=function(_0x44c4b2,_0x59e7cb){var _0x18a106,_0x3d3b42={},_0xf8e781;if(_0x44c4b2[_0x17b3('0x64')]['to']){_0xf8e781=_0x44c4b2[_0x17b3('0x64')]['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x44c4b2['params']['id']},'include':[{'model':db[_0x17b3('0xa1')],'as':_0x17b3('0xa2'),'include':[{'model':db[_0x17b3('0xa3')],'as':_0x17b3('0xa4'),'where':{'email':_0xf8e781},'limit':0x1,'order':[[_0x17b3('0xa5'),'DESC']]}]},{'model':db[_0x17b3('0x61')],'as':_0x17b3('0x42'),'raw':!![],'include':[{'model':db[_0x17b3('0xa6')],'as':_0x17b3('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x59e7cb,null))[_0x17b3('0x12')](function(_0x4ee244){if(!_0x4ee244)return;_0x18a106=_0x4ee244;if(!_0x4ee244[_0x17b3('0x42')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x44c4b2['body'][_0x17b3('0xa7')])){_0x44c4b2[_0x17b3('0x64')]['from']=util[_0x17b3('0x9c')](_0x17b3('0xa8'),_0x4ee244[_0x17b3('0x29')],_0x4ee244[_0x17b3('0x74')]||_0x4ee244[_0x17b3('0x42')][_0x17b3('0x40')]);}if(_0x44c4b2[_0x17b3('0x64')][_0x17b3('0xa9')]&&_0x44c4b2[_0x17b3('0x64')][_0x17b3('0xa9')]['length']){for(var _0x3e8e7c=0x0;_0x3e8e7c<_0x44c4b2[_0x17b3('0x64')][_0x17b3('0xa9')][_0x17b3('0x50')];_0x3e8e7c+=0x1){_0x44c4b2[_0x17b3('0x64')][_0x17b3('0xa9')][_0x3e8e7c]={'filename':_0x44c4b2[_0x17b3('0x64')]['attachments'][_0x3e8e7c][_0x17b3('0x29')],'path':path[_0x17b3('0xaa')](config[_0x17b3('0xab')],'server/files/attachments',_0x44c4b2[_0x17b3('0x64')]['attachments'][_0x3e8e7c][_0x17b3('0xac')])};}}var _0x505487=_0x4ee244[_0x17b3('0xad')]();return respondWithRpcPromise(_0x17b3('0xae'),_0x17b3('0xaf'),{'account':_0x505487,'message':_0x44c4b2[_0x17b3('0x64')]});})[_0x17b3('0x12')](function(_0x5669ca){if(!_0x5669ca)return;_0x3d3b42=_0x5669ca;if(!_0x18a106['List'])throw new Error(_0x17b3('0xb0'));if(_0x18a106[_0x17b3('0xa2')]['Contacts']['length'])return _0x18a106[_0x17b3('0xa2')][_0x17b3('0xa4')][0x0];return db[_0x17b3('0xa3')][_0x17b3('0x73')](_[_0x17b3('0xa')](_0x44c4b2[_0x17b3('0x64')],{'firstName':_0x44c4b2['body']['to'],'email':_0x44c4b2[_0x17b3('0x64')]['to'],'phone':_0x44c4b2[_0x17b3('0x64')]['to'],'ListId':_0x18a106[_0x17b3('0x75')]}));})[_0x17b3('0x12')](function(_0x151b4b){if(!_0x151b4b)return;var _0x357802={'UserId':_0x44c4b2[_0x17b3('0x40')]['id'],'ContactId':_0x151b4b['id'],'MailAccountId':_0x18a106['id'],'inReplyTo':_0x3d3b42[_0x17b3('0xb1')],'to':_0x44c4b2[_0x17b3('0x64')]['from'],'cc':_0x44c4b2['body']['cc'],'subject':_0x44c4b2[_0x17b3('0x64')][_0x17b3('0xb2')],'attach':_0x44c4b2['body'][_0x17b3('0xb3')],'firstMsgDirection':_0x17b3('0xb4'),'lastMsgAt':moment()['format'](_0x17b3('0x9d')),'lastMsgDirection':_0x17b3('0xb4'),'Messages':[_['merge'](_0x44c4b2[_0x17b3('0x64')],{'messageId':_0x3d3b42[_0x17b3('0xb1')],'sentAt':moment()[_0x17b3('0x9c')](_0x17b3('0x9d')),'read':!![],'MailAccountId':_0x18a106['id'],'UserId':_0x44c4b2[_0x17b3('0x40')]['id'],'ContactId':_0x151b4b['id']})]};if(_0x44c4b2[_0x17b3('0x64')]['Interaction']){_0x357802=_['merge'](_0x357802,_0x44c4b2[_0x17b3('0x64')]['Interaction']);}return db['MailInteraction'][_0x17b3('0x73')](_0x357802,{'include':[{'model':db['MailMessage'],'as':_0x17b3('0xb5')}]});})[_0x17b3('0x12')](respondWithResult(_0x59e7cb,null))[_0x17b3('0x1b')](handleError(_0x59e7cb,null));};exports[_0x17b3('0xb6')]=function(_0xe93223,_0x25139f){return db[_0x17b3('0x5a')]['find']({'where':{'id':_0xe93223[_0x17b3('0x60')]['id']},'include':[{'model':db[_0x17b3('0x61')],'as':_0x17b3('0x42'),'raw':!![],'include':[{'model':db[_0x17b3('0xa6')],'as':_0x17b3('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x25139f,null))[_0x17b3('0x12')](function(_0x557a4e){if(!_0x557a4e[_0x17b3('0x42')])return;var _0x47e5a2=_0x557a4e['getSmtpOptions']();return respondWithRpcPromise(_0x17b3('0xb7'),_0x17b3('0xb6'),{'account':_0x47e5a2});})['then'](respondWithResult(_0x25139f,null))[_0x17b3('0x1b')](handleError(_0x25139f,null));};exports[_0x17b3('0x28')]=function(_0x4b19db,_0x50bbaf){return db['MailAccount'][_0x17b3('0x63')]({'where':{'id':_0x4b19db['params']['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x50bbaf,null))[_0x17b3('0x12')](function(_0x388980){if(_0x388980&&_0x388980[_0x17b3('0x3e')]){throw new db[(_0x17b3('0xb8'))][(_0x17b3('0xb9'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x388980;})['then'](removeEntity(_0x50bbaf,null))[_0x17b3('0x1b')](handleError(_0x50bbaf,null));};exports[_0x17b3('0xba')]=function(_0x117dbf,_0x8f6f78){return db['MailAccount'][_0x17b3('0x63')]({'where':{'id':_0x117dbf['params']['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x8f6f78,null))[_0x17b3('0x12')](function(_0x567d28){if(_0x567d28){return _0x567d28[_0x17b3('0xba')](_0x117dbf['body'][_0x17b3('0x6e')],_[_0x17b3('0x87')](_0x117dbf[_0x17b3('0x64')],[_0x17b3('0x6e'),'id'])||{})['spread'](function(_0x4b3e6b){for(var _0x2565f4=0x0;_0x2565f4<_0x117dbf[_0x17b3('0x64')]['ids']['length'];_0x2565f4+=0x1){socket[_0x17b3('0xbb')](_0x17b3('0xbc'),{'UserId':Number(_0x117dbf[_0x17b3('0x64')][_0x17b3('0x6e')][_0x2565f4]),'MailAccountId':Number(_0x117dbf[_0x17b3('0x60')]['id'])});}return _0x4b3e6b;});}})[_0x17b3('0x12')](respondWithResult(_0x8f6f78,null))['catch'](handleError(_0x8f6f78,null));};exports[_0x17b3('0xbd')]=function(_0x30c0a9,_0x50b6d7){return db[_0x17b3('0x5a')][_0x17b3('0x63')]({'where':{'id':_0x30c0a9['params']['id']}})['then'](handleEntityNotFound(_0x50b6d7,null))[_0x17b3('0x12')](function(_0x434d94){if(_0x434d94){return _0x434d94[_0x17b3('0xbd')](_0x30c0a9['query']['ids'])[_0x17b3('0x12')](function(){if(_['isArray'](_0x30c0a9['query'][_0x17b3('0x6e')])){for(var _0xbe445e=0x0;_0xbe445e<_0x30c0a9['query'][_0x17b3('0x6e')]['length'];_0xbe445e+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x30c0a9[_0x17b3('0x4a')][_0x17b3('0x6e')][_0xbe445e]),'MailAccountId':Number(_0x30c0a9[_0x17b3('0x60')]['id'])});}}else{socket[_0x17b3('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x30c0a9[_0x17b3('0x4a')]['ids']),'MailAccountId':Number(_0x30c0a9[_0x17b3('0x60')]['id'])});}});}})[_0x17b3('0x12')](respondWithStatusCode(_0x50b6d7,null))[_0x17b3('0x1b')](handleError(_0x50b6d7,null));};exports[_0x17b3('0xbe')]=function(_0x46b43a,_0x1492d0){var _0x494e19={};var _0x5df975={};var _0x409949;var _0x1d56d9;return db['MailAccount']['findOne']({'where':{'id':_0x46b43a[_0x17b3('0x60')]['id']}})[_0x17b3('0x12')](handleEntityNotFound(_0x1492d0,null))[_0x17b3('0x12')](function(_0x444af1){if(_0x444af1){_0x409949=_0x444af1;_0x5df975[_0x17b3('0x4e')]=_[_0x17b3('0x4b')](db[_0x17b3('0xbf')][_0x17b3('0x62')]);_0x5df975[_0x17b3('0x4a')]=_[_0x17b3('0x4b')](_0x46b43a[_0x17b3('0x4a')]);_0x5df975[_0x17b3('0x55')]=_[_0x17b3('0x4c')](_0x5df975['model'],_0x5df975['query']);_0x494e19[_0x17b3('0x4d')]=_['intersection'](_0x5df975[_0x17b3('0x4e')],qs[_0x17b3('0x4f')](_0x46b43a[_0x17b3('0x4a')][_0x17b3('0x4f')]));_0x494e19[_0x17b3('0x4d')]=_0x494e19[_0x17b3('0x4d')][_0x17b3('0x50')]?_0x494e19[_0x17b3('0x4d')]:_0x5df975[_0x17b3('0x4e')];_0x494e19[_0x17b3('0x52')]=qs[_0x17b3('0x53')](_0x46b43a['query'][_0x17b3('0x53')]);_0x494e19[_0x17b3('0x54')]=qs[_0x17b3('0x55')](_['pick'](_0x46b43a[_0x17b3('0x4a')],_0x5df975[_0x17b3('0x55')]));if(_0x46b43a['query'][_0x17b3('0x57')]){_0x494e19[_0x17b3('0x54')]=_[_0x17b3('0x58')](_0x494e19['where'],{'$or':_[_0x17b3('0x46')](_0x494e19[_0x17b3('0x4d')],function(_0x263bf7){var _0x16fd05={};_0x16fd05[_0x263bf7]={'$like':'%'+_0x46b43a[_0x17b3('0x4a')][_0x17b3('0x57')]+'%'};return _0x16fd05;})});}_0x494e19=_['merge']({},_0x494e19,_0x46b43a[_0x17b3('0x6d')]);return _0x409949[_0x17b3('0xbe')](_0x494e19);}})[_0x17b3('0x12')](function(_0x5be79d){if(_0x5be79d){_0x1d56d9=_0x5be79d[_0x17b3('0x50')];if(!_0x46b43a[_0x17b3('0x4a')][_0x17b3('0x51')](_0x17b3('0x99'))){_0x494e19['limit']=qs[_0x17b3('0x23')](_0x46b43a[_0x17b3('0x4a')][_0x17b3('0x23')]);_0x494e19['offset']=qs[_0x17b3('0x20')](_0x46b43a[_0x17b3('0x4a')][_0x17b3('0x20')]);}return _0x409949[_0x17b3('0xbe')](_0x494e19);}})[_0x17b3('0x12')](function(_0x89127b){if(_0x89127b){return _0x89127b?{'count':_0x1d56d9,'rows':_0x89127b}:null;}})['then'](respondWithResult(_0x1492d0,null))[_0x17b3('0x1b')](handleError(_0x1492d0,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 8b38096..56caf01 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 _0x0183=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x0183,0x1e1));var _0x3018=function(_0x54b9c6,_0x2c697e){_0x54b9c6=_0x54b9c6-0x0;var _0x251824=_0x0183[_0x54b9c6];return _0x251824;};'use strict';var EventEmitter=require(_0x3018('0x0'));var MailAccount=require(_0x3018('0x1'))['db'][_0x3018('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3018('0x3')](0x0);var events={'afterCreate':_0x3018('0x4'),'afterUpdate':_0x3018('0x5'),'afterDestroy':_0x3018('0x6')};function emitEvent(_0x301c3c){return function(_0x111ef1,_0x3e9962,_0x81657){MailAccountEvents['emit'](_0x301c3c+':'+_0x111ef1['id'],_0x111ef1);MailAccountEvents[_0x3018('0x7')](_0x301c3c,_0x111ef1);_0x81657(null);};}for(var e in events){if(events[_0x3018('0x8')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x3018('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x6c14=['../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3a7f63,_0x2d59c5){var _0xff1a38=function(_0x1f02cd){while(--_0x1f02cd){_0x3a7f63['push'](_0x3a7f63['shift']());}};_0xff1a38(++_0x2d59c5);}(_0x6c14,0xd1));var _0x46c1=function(_0x3f9b23,_0x785ca6){_0x3f9b23=_0x3f9b23-0x0;var _0x55dc12=_0x6c14[_0x3f9b23];return _0x55dc12;};'use strict';var EventEmitter=require(_0x46c1('0x0'));var MailAccount=require(_0x46c1('0x1'))['db'][_0x46c1('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x46c1('0x3')](0x0);var events={'afterCreate':_0x46c1('0x4'),'afterUpdate':'update','afterDestroy':_0x46c1('0x5')};function emitEvent(_0x1aa112){return function(_0x311234,_0x5b4a69,_0x2a884e){MailAccountEvents[_0x46c1('0x6')](_0x1aa112+':'+_0x311234['id'],_0x311234);MailAccountEvents[_0x46c1('0x6')](_0x1aa112,_0x311234);_0x2a884e(null);};}for(var e in events){if(events[_0x46c1('0x7')](e)){var event=events[e];MailAccount[_0x46c1('0x8')](e,emitEvent(event));}}module[_0x46c1('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 920c3b8..14968a4 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 _0x631a=['OAuth2','user','pass','./mailAccount.attributes','exports','MailAccount','provider','service','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x631a,0x1e3));var _0xa631=function(_0x424de5,_0x20fcd6){_0x424de5=_0x424de5-0x0;var _0x4a923d=_0x631a[_0x424de5];return _0x4a923d;};'use strict';var attributes=require(_0xa631('0x0'));module[_0xa631('0x1')]=function(_0x126c39){return _0x126c39['define'](_0xa631('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5db26a=this;var _0x1dc5dd={'id':_0x5db26a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5db26a[_0xa631('0x3')]!=='custom'){_0x1dc5dd[_0xa631('0x4')]=_0x5db26a[_0xa631('0x3')];}else{_0x1dc5dd[_0xa631('0x5')]=_0x5db26a[_0xa631('0x6')][_0xa631('0x5')];_0x1dc5dd[_0xa631('0x7')]=_0x5db26a['Smtp'][_0xa631('0x7')];_0x1dc5dd[_0xa631('0x8')]=_0x5db26a[_0xa631('0x6')][_0xa631('0x8')];}if(_0x5db26a[_0xa631('0x6')]['authentication']){if(_0x5db26a[_0xa631('0x6')][_0xa631('0x9')]){if(!_0x5db26a[_0xa631('0x6')][_0xa631('0xa')])throw new Error(_0xa631('0xb'));_0x1dc5dd[_0xa631('0xc')]={'type':_0xa631('0xd'),'user':_0x5db26a['Smtp']['user'],'accessToken':_0x5db26a['Smtp'][_0xa631('0xa')]['data5']};}else{_0x1dc5dd['auth']={'user':_0x5db26a[_0xa631('0x6')][_0xa631('0xe')],'pass':_0x5db26a[_0xa631('0x6')][_0xa631('0xf')]};}}return _0x1dc5dd;}}});}; \ No newline at end of file +var _0x8892=['host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','./mailAccount.attributes','exports','define','MailAccount','provider','custom'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x8892,0xf9));var _0x2889=function(_0x284af1,_0x36829c){_0x284af1=_0x284af1-0x0;var _0x5daa4c=_0x8892[_0x284af1];return _0x5daa4c;};'use strict';var attributes=require(_0x2889('0x0'));module[_0x2889('0x1')]=function(_0xd62aee){return _0xd62aee[_0x2889('0x2')](_0x2889('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x39ab44=this;var _0x108809={'id':_0x39ab44['id'],'tls':{'rejectUnauthorized':![]}};if(_0x39ab44[_0x2889('0x4')]!==_0x2889('0x5')){_0x108809['service']=_0x39ab44[_0x2889('0x4')];}else{_0x108809[_0x2889('0x6')]=_0x39ab44[_0x2889('0x7')][_0x2889('0x6')];_0x108809[_0x2889('0x8')]=_0x39ab44[_0x2889('0x7')]['port'];_0x108809[_0x2889('0x9')]=_0x39ab44[_0x2889('0x7')]['secure'];}if(_0x39ab44[_0x2889('0x7')][_0x2889('0xa')]){if(_0x39ab44[_0x2889('0x7')][_0x2889('0xb')]){if(!_0x39ab44[_0x2889('0x7')]['CloudProvider'])throw new Error(_0x2889('0xc'));_0x108809['auth']={'type':_0x2889('0xd'),'user':_0x39ab44[_0x2889('0x7')][_0x2889('0xe')],'accessToken':_0x39ab44['Smtp']['CloudProvider'][_0x2889('0xf')]};}else{_0x108809[_0x2889('0x10')]={'user':_0x39ab44[_0x2889('0x7')][_0x2889('0xe')],'pass':_0x39ab44['Smtp']['pass']};}}return _0x108809;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 41e463d..41a39fb 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 _0x5f66=['../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','include','map','model','attributes','stringify','find','smtp','smtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','CloudProvider','get','omit','getSmtpOptions','list','applications','orderBy','priority','autoclose','push','close','defaults','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','YYYY-MM-DD\x20HH:mm:ss','interaction','MailMessage','create','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','name','unshift','agent','*,*,*,*','startRouting','Start','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var BPromise=require('bluebird');var rs=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var db=require(_0x65f6('0x3'))['db'];var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x6'));var client=jayson['client'][_0x65f6('0x7')]({'port':0x232c});config[_0x65f6('0x8')]=_['defaults'](config['redis'],{'host':_0x65f6('0x9'),'port':0x18eb});var socket=require(_0x65f6('0xa'))(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0xb'))[_0x65f6('0xc')](socket);function respondWithRpcPromise(_0x14f4c7,_0x48d85c,_0x5123ee){return new BPromise(function(_0x18fea1,_0x2f6d5b){return client[_0x65f6('0xd')](_0x14f4c7,_0x5123ee)[_0x65f6('0xe')](function(_0x50d26d){logger[_0x65f6('0xf')]('MailAccount,\x20%s,\x20%s',_0x48d85c,'request\x20sent');logger[_0x65f6('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x48d85c,_0x65f6('0x11'),JSON['stringify'](_0x50d26d));if(_0x50d26d[_0x65f6('0x12')]){if(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x13')]===0x1f4){logger[_0x65f6('0x12')](_0x65f6('0x14'),_0x48d85c,_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);return _0x2f6d5b(_0x50d26d[_0x65f6('0x12')][_0x65f6('0x15')]);}logger[_0x65f6('0x12')]('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x50d26d[_0x65f6('0x12')]['message']);return _0x18fea1(_0x50d26d['error'][_0x65f6('0x15')]);}else{logger[_0x65f6('0xf')](_0x65f6('0x14'),_0x48d85c,_0x65f6('0x11'));_0x18fea1(_0x50d26d[_0x65f6('0x16')][_0x65f6('0x15')]);}})[_0x65f6('0x17')](function(_0x18380e){logger['error']('MailAccount,\x20%s,\x20%s',_0x48d85c,_0x18380e);_0x2f6d5b(_0x18380e);});});}exports[_0x65f6('0x18')]=function(_0x5b4055){var _0x4c81f3=this;return new Promise(function(_0x5c5b91,_0x365159){return db[_0x65f6('0x19')]['findAll']({'raw':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b4055[_0x65f6('0x1a')]?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1c')]||null:null,'attributes':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')]['attributes']||null:null,'limit':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1d')]||null:null,'include':_0x5b4055['options']?_0x5b4055[_0x65f6('0x1a')][_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x5b4055[_0x65f6('0x1a')]['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x20')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x21')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x20')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes'],'include':_0x29abdb[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x29abdb['include'],function(_0x325cb4){return{'model':db[_0x325cb4[_0x65f6('0x20')]],'as':_0x325cb4['as'],'attributes':_0x325cb4[_0x65f6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac04b){logger['info'](_0x65f6('0x18'),_0x5b4055);logger[_0x65f6('0x10')](_0x65f6('0x18'),_0x5b4055,JSON[_0x65f6('0x22')](_0x4ac04b));_0x5c5b91(_0x4ac04b);})[_0x65f6('0x17')](function(_0x14a387){logger[_0x65f6('0x12')]('GetMailAccount',_0x14a387['message'],_0x5b4055);_0x365159(_0x4c81f3[_0x65f6('0x12')](0x1f4,_0x14a387[_0x65f6('0x15')]));});});};exports['ShowMailAccount']=function(_0x4e50c0){var _0x10b368=this;return new Promise(function(_0x1ce43c,_0x11fe3b){return db[_0x65f6('0x19')][_0x65f6('0x23')]({'raw':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0['options'][_0x65f6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')]['where']||null:null,'attributes':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x21')]||null:null,'include':_0x4e50c0[_0x65f6('0x1a')]?_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')]?_['map'](_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x1e')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x20')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1e')]?_['map'](_0x4f3e22[_0x65f6('0x1e')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x21')],'include':_0x24f7fd[_0x65f6('0x1e')]?_[_0x65f6('0x1f')](_0x24f7fd['include'],function(_0x582c7e){return{'model':db[_0x582c7e[_0x65f6('0x20')]],'as':_0x582c7e['as'],'attributes':_0x582c7e['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xe')](function(_0x4e6653){if(_0x4e50c0[_0x65f6('0x1a')][_0x65f6('0x24')]===!![])_0x4e6653['setDataValue'](_0x65f6('0x25'),_0x4e6653['getSmtpOptions']());logger['info'](_0x65f6('0x26'),_0x4e50c0);logger[_0x65f6('0x10')](_0x65f6('0x26'),_0x4e50c0,JSON[_0x65f6('0x22')](_0x4e6653));_0x1ce43c(_0x4e6653);})[_0x65f6('0x17')](function(_0x28845a){logger[_0x65f6('0x12')](_0x65f6('0x26'),_0x28845a['message'],_0x4e50c0);_0x11fe3b(_0x10b368[_0x65f6('0x12')](0x1f4,_0x28845a['message']));});});};exports[_0x65f6('0x27')]=function(_0xa4394a){var _0x4ba7db=this;return new Promise(function(_0x2ea7f7,_0x5ef5c2){var _0x32148f={'body':_0xa4394a[_0x65f6('0x28')],'channel':_0x65f6('0x29')};var _0x3fb1c6=_[_0x65f6('0x2a')](_[_0x65f6('0x2b')](db[_0x65f6('0x2c')][_0x65f6('0x2d')]),[_0x65f6('0x2e'),'updatedAt',_0x65f6('0x2f'),_0x65f6('0x30')]);var _0x377ae5=![];if(_0xa4394a[_0x65f6('0x28')]['id']){delete _0xa4394a[_0x65f6('0x28')]['id'];}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x65f6('0x33')));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')])||_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')]===''){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x65f6('0x31')](_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fb1c6));}if(!_[_0x65f6('0x35')](_0x3fb1c6,_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')])){return _0x5ef5c2(_0x4ba7db['error'](0x1f4,_0x65f6('0x36')+_0x3fb1c6));}var _0x3386a2={};_0x3386a2[_0xa4394a[_0x65f6('0x28')][_0x65f6('0x34')]]=_0xa4394a['body'][_0x65f6('0x32')];return db['MailAccount'][_0x65f6('0x23')]({'where':{'id':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0x65f6('0x38'),'include':[{'model':db['CmContact'],'as':_0x65f6('0x39'),'where':_0x3386a2,'limit':0x1,'order':[[_0x65f6('0x3a'),_0x65f6('0x3b')]]}]},{'model':db[_0x65f6('0x3c')],'as':_0x65f6('0x3d')},{'model':db[_0x65f6('0x3e')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x65f6('0x3f')}]}]})[_0x65f6('0xe')](function(_0x3b647a){if(_0x3b647a&&_0x3b647a[_0x65f6('0x38')]){var _0x3b907c=_0x3b647a[_0x65f6('0x40')]({'plain':!![]});_0x32148f[_0x65f6('0x37')]=_[_0x65f6('0x41')](_0x3b907c,[_0x65f6('0x3d'),'List']);_0x32148f[_0x65f6('0x37')][_0x65f6('0x25')]=_0x3b647a[_0x65f6('0x42')]();_0x32148f['applications']=_0x3b907c[_0x65f6('0x3d')];_0x32148f[_0x65f6('0x43')]=_0x3b907c['List'];_0x32148f[_0x65f6('0x44')]=_[_0x65f6('0x45')](_0x32148f['applications'],[_0x65f6('0x46')],['asc']);if(_0x32148f[_0x65f6('0x37')]&&_0x32148f[_0x65f6('0x37')][_0x65f6('0x47')]){_0x32148f['applications'][_0x65f6('0x48')]({'id':0x0,'priority':_0x32148f[_0x65f6('0x44')]['length']+0x1,'app':_0x65f6('0x49'),'appdata':_0x65f6('0x47'),'interval':'*,*,*,*'});}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x3d')];}if(_0x32148f[_0x65f6('0x37')][_0x65f6('0x38')]){delete _0x32148f[_0x65f6('0x37')][_0x65f6('0x38')];}if(_0x3b907c['List']['Contacts']['length']){return _0x3b907c[_0x65f6('0x38')][_0x65f6('0x39')][0x0];}var _0x111a8a=_[_0x65f6('0x4a')](_0xa4394a['body'],{'firstName':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')],'ListId':_0x3b907c[_0x65f6('0x30')]});_0x111a8a[_0xa4394a['body'][_0x65f6('0x34')]]=_0xa4394a[_0x65f6('0x28')][_0x65f6('0x32')];return db['CmContact']['create'](_0x111a8a);}else{throw new Error(_0x65f6('0x4b'));}})[_0x65f6('0xe')](function(_0x4125cb){_0x32148f[_0x65f6('0x4c')]=_0x4125cb;if(_0x4125cb){if(!_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]){_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')]=rs[_0x65f6('0x4e')]()+'\x20'+_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')];}var _0x5ba9c6={'ContactId':_0x4125cb['id'],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a[_0x65f6('0x28')]['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x50')],'lastMsgAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x65f6('0x52')][_0x65f6('0x23')]({'where':{'closed':![],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':_0x65f6('0x53'),'attributes':[_0x65f6('0x4d')],'where':{'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x54')]}}]})[_0x65f6('0xe')](function(_0x5e4759){if(_0x5e4759){return[_0x5e4759,![]];}return db['MailInteraction']['create'](_0x5ba9c6)[_0x65f6('0xe')](function(_0x367d95){return[_0x367d95,!![]];});});}else{throw new Error(_0x65f6('0x55'));}})[_0x65f6('0x56')](function(_0xab6f0,_0x304cf9){if(_0xab6f0){_0x377ae5=_0x304cf9;if(!_0x304cf9){return _0xab6f0['update']({'inReplyTo':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['messageId'],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x32')],'cc':_0xa4394a['body'][_0x65f6('0x15')]['cc'],'subject':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x4f')],'attach':_0xab6f0[_0x65f6('0x50')]?_0xab6f0[_0x65f6('0x50')]:_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'substatus':null,'substatusAt':moment()[_0x65f6('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x65f6('0x57')),'lastMsgDirection':'in'});}else{return _0xab6f0;}}})[_0x65f6('0xe')](function(_0x4a9524){_0x32148f[_0x65f6('0x58')]=_0x4a9524['get']({'plain':!![]});_0x32148f[_0x65f6('0x58')]['created']=_0x377ae5;return db[_0x65f6('0x59')][_0x65f6('0x5a')]({'body':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x28')],'MailAccountId':_0xa4394a[_0x65f6('0x37')]['id'],'MailInteractionId':_0x4a9524['id'],'direction':'in','ContactId':_0x32148f[_0x65f6('0x4c')]['id'],'messageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4d')],'from':_0xa4394a['body']['message'][_0x65f6('0x32')],'to':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['to'],'cc':_0xa4394a['body']['message']['cc'],'subject':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x4f')],'attach':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x50')],'Attachments':_0xa4394a['body']['message'][_0x65f6('0x5b')],'originTo':_0xa4394a[_0x65f6('0x28')]['message'][_0x65f6('0x5c')],'originCc':_0xa4394a['body'][_0x65f6('0x15')][_0x65f6('0x5d')],'bcc':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')]['bcc'],'ChatWebsiteId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x5e')]||null,'originChannel':_0xa4394a['body']['message'][_0x65f6('0x5f')]||'Email','ChatOfflineMessageId':_0xa4394a[_0x65f6('0x28')][_0x65f6('0x15')][_0x65f6('0x60')]||null},{'include':[{'model':db[_0x65f6('0x61')],'as':'Attachments'}]});})['then'](function(_0x56f7f1){_0x32148f[_0x65f6('0x15')]=_0x56f7f1;if(_0x32148f[_0x65f6('0x58')][_0x65f6('0x62')]){return db['User'][_0x65f6('0x23')]({'attributes':['id',_0x65f6('0x63')],'where':{'id':_0x32148f[_0x65f6('0x58')]['UserId']}})[_0x65f6('0xe')](function(_0x15809e){if(_0x15809e){_0x32148f['applications'][_0x65f6('0x64')]({'id':0x0,'priority':0x0,'app':_0x65f6('0x65'),'appdata':_0x15809e['name']+','+(_0x32148f[_0x65f6('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0x65f6('0x66')});}return respondWithRpcPromise('Start',_0x65f6('0x67'),_0x32148f);});}return respondWithRpcPromise(_0x65f6('0x68'),'startRouting',_0x32148f);})[_0x65f6('0xe')](function(_0x442e25){_0x2ea7f7(_0x442e25);})[_0x65f6('0x17')](function(_0x299b85){_0x5ef5c2(_0x4ba7db[_0x65f6('0x12')](0x1f4,_0x299b85[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0xc2c7=['defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x5693a8,_0x28ed77){var _0x34162c=function(_0x344aed){while(--_0x344aed){_0x5693a8['push'](_0x5693a8['shift']());}};_0x34162c(++_0x28ed77);}(_0xc2c7,0x134));var _0x7c2c=function(_0x417e5f,_0x404120){_0x417e5f=_0x417e5f-0x0;var _0x3a02f9=_0xc2c7[_0x417e5f];return _0x3a02f9;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ea2980a..f8e000e 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 _0x5b64=['length','./mailAccount.events','save','update','emit','register'];(function(_0x4fd7e2,_0x3c844f){var _0xa5aa37=function(_0xd44a08){while(--_0xd44a08){_0x4fd7e2['push'](_0x4fd7e2['shift']());}};_0xa5aa37(++_0x3c844f);}(_0x5b64,0x16f));var _0x45b6=function(_0x49b462,_0x882abe){_0x49b462=_0x49b462-0x0;var _0x1080f8=_0x5b64[_0x49b462];return _0x1080f8;};'use strict';var MailAccountEvents=require(_0x45b6('0x0'));var events=[_0x45b6('0x1'),'remove',_0x45b6('0x2')];function createListener(_0x5b3ac8,_0x289f35){return function(_0x7ac7c5){_0x289f35[_0x45b6('0x3')](_0x5b3ac8,_0x7ac7c5);};}function removeListener(_0x15541f,_0x335494){return function(){MailAccountEvents['removeListener'](_0x15541f,_0x335494);};}exports[_0x45b6('0x4')]=function(_0x1cd374){for(var _0x2dee88=0x0,_0xcfa4c7=events[_0x45b6('0x5')];_0x2dee88<_0xcfa4c7;_0x2dee88++){var _0x57bb0f=events[_0x2dee88];var _0x36dd26=createListener('mailAccount:'+_0x57bb0f,_0x1cd374);MailAccountEvents['on'](_0x57bb0f,_0x36dd26);}}; \ No newline at end of file +var _0x3bf3=['save','remove','update','emit','register','mailAccount:'];(function(_0x1c31a9,_0x35c105){var _0x14187a=function(_0x481c81){while(--_0x481c81){_0x1c31a9['push'](_0x1c31a9['shift']());}};_0x14187a(++_0x35c105);}(_0x3bf3,0x168));var _0x33bf=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x3bf3[_0xdd2bfa];return _0x55397e;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x33bf('0x0'),_0x33bf('0x1'),_0x33bf('0x2')];function createListener(_0x50281,_0x279da7){return function(_0x2702f7){_0x279da7[_0x33bf('0x3')](_0x50281,_0x2702f7);};}function removeListener(_0x105ef2,_0x10502b){return function(){MailAccountEvents['removeListener'](_0x105ef2,_0x10502b);};}exports[_0x33bf('0x4')]=function(_0x5e456e){for(var _0x278bcc=0x0,_0x1d4fc4=events['length'];_0x278bcc<_0x1d4fc4;_0x278bcc++){var _0x54d2e5=events[_0x278bcc];var _0x86a69f=createListener(_0x33bf('0x5')+_0x54d2e5,_0x5e456e);MailAccountEvents['on'](_0x54d2e5,_0x86a69f);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index f2d0bfc..5a9fb42 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 _0x6e7d=['isAuthenticated','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0x2d6a49,_0x2355db){var _0xdf7d6e=function(_0x234ab9){while(--_0x234ab9){_0x2d6a49['push'](_0x2d6a49['shift']());}};_0xdf7d6e(++_0x2355db);}(_0x6e7d,0x9f));var _0xd6e7=function(_0x38c8ec,_0x48a464){_0x38c8ec=_0x38c8ec-0x0;var _0x39aafd=_0x6e7d[_0x38c8ec];return _0x39aafd;};'use strict';var multer=require(_0xd6e7('0x0'));var util=require(_0xd6e7('0x1'));var path=require(_0xd6e7('0x2'));var timeout=require(_0xd6e7('0x3'));var express=require(_0xd6e7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd6e7('0x5'));var interaction=require(_0xd6e7('0x6'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xd6e7('0x7')](_0xd6e7('0x8'),auth[_0xd6e7('0x9')](),controller['show']);router[_0xd6e7('0xa')](_0xd6e7('0x8'),auth[_0xd6e7('0x9')](),controller[_0xd6e7('0xb')]);router[_0xd6e7('0xc')]('/:id',auth[_0xd6e7('0x9')](),controller[_0xd6e7('0xd')]);module['exports']=router; \ No newline at end of file +var _0xbcd3=['connect-timeout','express','Router','/:id','isAuthenticated','show','put','delete','destroy','exports','multer','path'];(function(_0x4e3a6f,_0x10ac32){var _0x14c3e1=function(_0x35b7ed){while(--_0x35b7ed){_0x4e3a6f['push'](_0x4e3a6f['shift']());}};_0x14c3e1(++_0x10ac32);}(_0xbcd3,0x1d2));var _0x3bcd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbcd3[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x3bcd('0x0'));var util=require('util');var path=require(_0x3bcd('0x1'));var timeout=require(_0x3bcd('0x2'));var express=require(_0x3bcd('0x3'));var router=express[_0x3bcd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailApplication.controller');router['get'](_0x3bcd('0x5'),auth[_0x3bcd('0x6')](),controller[_0x3bcd('0x7')]);router[_0x3bcd('0x8')]('/:id',auth[_0x3bcd('0x6')](),controller['update']);router[_0x3bcd('0x9')](_0x3bcd('0x5'),auth['isAuthenticated'](),controller[_0x3bcd('0xa')]);module[_0x3bcd('0xb')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 009dfb4..67eaa72 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 _0xecc9=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x5be85d,_0x39f346){var _0x4afa25=function(_0x22971c){while(--_0x22971c){_0x5be85d['push'](_0x5be85d['shift']());}};_0x4afa25(++_0x39f346);}(_0xecc9,0x180));var _0x9ecc=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xecc9[_0x148c09];return _0x18e613;};'use strict';var Sequelize=require('sequelize');module[_0x9ecc('0x0')]={'priority':{'type':Sequelize[_0x9ecc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9ecc('0x2')],'allowNull':![],'defaultValue':_0x9ecc('0x3')},'appdata':{'type':Sequelize[_0x9ecc('0x4')]()},'description':{'type':Sequelize[_0x9ecc('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9ecc('0x5')}}; \ No newline at end of file +var _0x7f8d=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0xcf098d,_0x1b9e69){var _0x99daff=function(_0x3aedcc){while(--_0x3aedcc){_0xcf098d['push'](_0xcf098d['shift']());}};_0x99daff(++_0x1b9e69);}(_0x7f8d,0x17d));var _0xd7f8=function(_0x162c52,_0x5d77fb){_0x162c52=_0x162c52-0x0;var _0x16c3b8=_0x7f8d[_0x162c52];return _0x16c3b8;};'use strict';var Sequelize=require(_0xd7f8('0x0'));module[_0xd7f8('0x1')]={'priority':{'type':Sequelize[_0xd7f8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd7f8('0x3')],'allowNull':![],'defaultValue':_0xd7f8('0x4')},'appdata':{'type':Sequelize[_0xd7f8('0x5')]()},'description':{'type':Sequelize[_0xd7f8('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 524844a..5bd4b3d 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 _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0xe706,0xa3));var _0x6e70=function(_0xc25389,_0x4d62c4){_0xc25389=_0xc25389-0x0;var _0x4c5850=_0xe706[_0xc25389];return _0x4c5850;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x46a0cb,_0x30a26a){var _0x4729a1=function(_0x269531){while(--_0x269531){_0x46a0cb['push'](_0x46a0cb['shift']());}};_0x4729a1(++_0x30a26a);}(_0xda3f,0xec));var _0xfda3=function(_0x1ced83,_0x58d6ed){_0x1ced83=_0x1ced83-0x0;var _0x44393b=_0xda3f[_0x1ced83];return _0x44393b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 0e06912..20d874e 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 _0x1df6=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','./mailApplication.attributes','exports','define','MailApplication'];(function(_0x160f70,_0x20ea10){var _0x1fbf40=function(_0x48c3ea){while(--_0x48c3ea){_0x160f70['push'](_0x160f70['shift']());}};_0x1fbf40(++_0x20ea10);}(_0x1df6,0x1af));var _0x61df=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1df6[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x61df('0x0'));var util=require(_0x61df('0x1'));var logger=require('../../config/logger')(_0x61df('0x2'));var moment=require(_0x61df('0x3'));var BPromise=require(_0x61df('0x4'));var rp=require(_0x61df('0x5'));var fs=require('fs');var path=require(_0x61df('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x61df('0x7'));module[_0x61df('0x8')]=function(_0x3bc67b,_0x19787b){return _0x3bc67b[_0x61df('0x9')](_0x61df('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61df('0xb'),'collate':_0x61df('0xc')});}; \ No newline at end of file +var _0xabb3=['bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x4f5f4f,_0x165370){var _0x18fd34=function(_0x55a8b3){while(--_0x55a8b3){_0x4f5f4f['push'](_0x4f5f4f['shift']());}};_0x18fd34(++_0x165370);}(_0xabb3,0xb0));var _0x3abb=function(_0x585b87,_0x2e59e2){_0x585b87=_0x585b87-0x0;var _0x4c3107=_0xabb3[_0x585b87];return _0x4c3107;};'use strict';var _=require(_0x3abb('0x0'));var util=require(_0x3abb('0x1'));var logger=require(_0x3abb('0x2'))(_0x3abb('0x3'));var moment=require('moment');var BPromise=require(_0x3abb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3abb('0x5'));var rimraf=require(_0x3abb('0x6'));var config=require(_0x3abb('0x7'));var attributes=require(_0x3abb('0x8'));module[_0x3abb('0x9')]=function(_0x43b418,_0x2bf6c9){return _0x43b418[_0x3abb('0xa')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3abb('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 9b2724d..24b0c5c 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 _0x3d89=['client','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateMailApplication','update','body','options','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x3d89,0x88));var _0x93d8=function(_0x145675,_0x5b8247){_0x145675=_0x145675-0x0;var _0x5a59b2=_0x3d89[_0x145675];return _0x5a59b2;};'use strict';var _=require(_0x93d8('0x0'));var util=require(_0x93d8('0x1'));var moment=require(_0x93d8('0x2'));var BPromise=require(_0x93d8('0x3'));var rs=require(_0x93d8('0x4'));var fs=require('fs');var Redis=require(_0x93d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x93d8('0x6'))('rpc');var config=require(_0x93d8('0x7'));var jayson=require(_0x93d8('0x8'));var client=jayson[_0x93d8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f37bb,_0x5b414d,_0xb00110){return new BPromise(function(_0x2afbfd,_0xe3c668){return client[_0x93d8('0xa')](_0x1f37bb,_0xb00110)[_0x93d8('0xb')](function(_0x3fd733){logger[_0x93d8('0xc')](_0x93d8('0xd'),_0x5b414d,'request\x20sent');logger[_0x93d8('0xe')](_0x93d8('0xf'),_0x5b414d,_0x93d8('0x10'),JSON['stringify'](_0x3fd733));if(_0x3fd733[_0x93d8('0x11')]){if(_0x3fd733[_0x93d8('0x11')][_0x93d8('0x12')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x5b414d,_0x3fd733[_0x93d8('0x11')][_0x93d8('0x13')]);return _0xe3c668(_0x3fd733['error']['message']);}logger[_0x93d8('0x11')](_0x93d8('0xd'),_0x5b414d,_0x3fd733['error']['message']);return _0x2afbfd(_0x3fd733[_0x93d8('0x11')][_0x93d8('0x13')]);}else{logger['info'](_0x93d8('0xd'),_0x5b414d,_0x93d8('0x10'));_0x2afbfd(_0x3fd733[_0x93d8('0x14')][_0x93d8('0x13')]);}})[_0x93d8('0x15')](function(_0x496df2){logger[_0x93d8('0x11')](_0x93d8('0xd'),_0x5b414d,_0x496df2);_0xe3c668(_0x496df2);});});}exports[_0x93d8('0x16')]=function(_0x3abba1){var _0x569745=this;return new Promise(function(_0x207b42,_0x219429){return db['MailApplication'][_0x93d8('0x17')](_0x3abba1[_0x93d8('0x18')],{'raw':_0x3abba1[_0x93d8('0x19')]?_0x3abba1[_0x93d8('0x19')][_0x93d8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3abba1[_0x93d8('0x19')]?_0x3abba1[_0x93d8('0x19')][_0x93d8('0x1b')]||null:null,'attributes':_0x3abba1[_0x93d8('0x19')]?_0x3abba1[_0x93d8('0x19')][_0x93d8('0x1c')]||null:null,'limit':_0x3abba1[_0x93d8('0x19')]?_0x3abba1[_0x93d8('0x19')]['limit']||null:null})[_0x93d8('0xb')](function(_0x47addf){logger[_0x93d8('0xc')](_0x93d8('0x16'),_0x3abba1);logger[_0x93d8('0xe')](_0x93d8('0x16'),_0x3abba1,JSON['stringify'](_0x47addf));_0x207b42(_0x47addf);})['catch'](function(_0x57cbfa){logger[_0x93d8('0x11')](_0x93d8('0x16'),_0x57cbfa[_0x93d8('0x13')],_0x3abba1);_0x219429(_0x569745[_0x93d8('0x11')](0x1f4,_0x57cbfa[_0x93d8('0x13')]));});});}; \ No newline at end of file +var _0xa88b=['body','options','raw','attributes','limit','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0xa88b,0x133));var _0xba88=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0xa88b[_0x246115];return _0x385878;};'use strict';var _=require(_0xba88('0x0'));var util=require(_0xba88('0x1'));var moment=require(_0xba88('0x2'));var BPromise=require(_0xba88('0x3'));var rs=require(_0xba88('0x4'));var fs=require('fs');var Redis=require(_0xba88('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xba88('0x6'));var logger=require('../../config/logger')(_0xba88('0x7'));var config=require(_0xba88('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xba88('0x9')][_0xba88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11304d,_0x4dd928,_0x3a8f00){return new BPromise(function(_0x2d86de,_0x1aeedc){return client['request'](_0x11304d,_0x3a8f00)['then'](function(_0x4208c2){logger[_0xba88('0xb')]('MailApplication,\x20%s,\x20%s',_0x4dd928,_0xba88('0xc'));logger[_0xba88('0xd')](_0xba88('0xe'),_0x4dd928,_0xba88('0xc'),JSON['stringify'](_0x4208c2));if(_0x4208c2[_0xba88('0xf')]){if(_0x4208c2['error'][_0xba88('0x10')]===0x1f4){logger[_0xba88('0xf')](_0xba88('0x11'),_0x4dd928,_0x4208c2[_0xba88('0xf')][_0xba88('0x12')]);return _0x1aeedc(_0x4208c2['error'][_0xba88('0x12')]);}logger['error'](_0xba88('0x11'),_0x4dd928,_0x4208c2['error'][_0xba88('0x12')]);return _0x2d86de(_0x4208c2['error'][_0xba88('0x12')]);}else{logger[_0xba88('0xb')](_0xba88('0x11'),_0x4dd928,_0xba88('0xc'));_0x2d86de(_0x4208c2[_0xba88('0x13')][_0xba88('0x12')]);}})[_0xba88('0x14')](function(_0x23305a){logger['error']('MailApplication,\x20%s,\x20%s',_0x4dd928,_0x23305a);_0x1aeedc(_0x23305a);});});}exports[_0xba88('0x15')]=function(_0x37377b){var _0x4dd8e1=this;return new Promise(function(_0x1611c4,_0x333ce2){return db['MailApplication'][_0xba88('0x16')](_0x37377b[_0xba88('0x17')],{'raw':_0x37377b[_0xba88('0x18')]?_0x37377b[_0xba88('0x18')][_0xba88('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37377b[_0xba88('0x18')]?_0x37377b[_0xba88('0x18')]['where']||null:null,'attributes':_0x37377b[_0xba88('0x18')]?_0x37377b[_0xba88('0x18')][_0xba88('0x1a')]||null:null,'limit':_0x37377b[_0xba88('0x18')]?_0x37377b['options'][_0xba88('0x1b')]||null:null})[_0xba88('0x1c')](function(_0x2a1146){logger[_0xba88('0xb')](_0xba88('0x15'),_0x37377b);logger[_0xba88('0xd')]('UpdateMailApplication',_0x37377b,JSON[_0xba88('0x1d')](_0x2a1146));_0x1611c4(_0x2a1146);})[_0xba88('0x14')](function(_0x57ca50){logger[_0xba88('0xf')]('UpdateMailApplication',_0x57ca50['message'],_0x37377b);_0x333ce2(_0x4dd8e1['error'](0x1f4,_0x57ca50['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index f935901..662735d 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 _0x181d=['../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id/messages','getMessages','/:id/download','create','addMessage','post','/:id/tags','tracked','mail','put','/:id','mailinteraction:update','update','destroy','delete','exports','Router'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x181d,0x8f));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0xd181('0x0')]();var auth=require(_0xd181('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0xd181('0x2'));router[_0xd181('0x3')]('/',auth[_0xd181('0x4')](),controller[_0xd181('0x5')]);router[_0xd181('0x3')](_0xd181('0x6'),auth[_0xd181('0x4')](),controller[_0xd181('0x7')]);router[_0xd181('0x3')]('/:id',auth[_0xd181('0x4')](),controller['show']);router[_0xd181('0x3')](_0xd181('0x8'),auth[_0xd181('0x4')](),controller[_0xd181('0x9')]);router['get'](_0xd181('0xa'),auth[_0xd181('0x4')](),controller['download']);router['post']('/',auth[_0xd181('0x4')](),controller[_0xd181('0xb')]);router['post'](_0xd181('0x8'),auth[_0xd181('0x4')](),controller[_0xd181('0xc')]);router[_0xd181('0xd')](_0xd181('0xe'),auth['isAuthenticated'](),interaction[_0xd181('0xf')](_0xd181('0x10'),'mailinteraction:addtags'),controller['addTags']);router[_0xd181('0x11')](_0xd181('0x12'),auth[_0xd181('0x4')](),interaction[_0xd181('0xf')](_0xd181('0x10'),_0xd181('0x13')),controller[_0xd181('0x14')]);router['delete'](_0xd181('0x12'),auth[_0xd181('0x4')](),interaction[_0xd181('0xf')](_0xd181('0x10'),'mailinteraction:destroy'),controller[_0xd181('0x15')]);router[_0xd181('0x16')](_0xd181('0xe'),auth[_0xd181('0x4')](),controller['removeTags']);module[_0xd181('0x17')]=router; \ No newline at end of file +var _0xda73=['index','get','/describe','describe','/:id/messages','/:id/download','create','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','/:id','destroy','delete','removeTags','exports','express','../../components/interaction/service','isAuthenticated'];(function(_0x491f41,_0x4f2d53){var _0x48bc1f=function(_0x344b2f){while(--_0x344b2f){_0x491f41['push'](_0x491f41['shift']());}};_0x48bc1f(++_0x4f2d53);}(_0xda73,0x105));var _0x3da7=function(_0x18f583,_0x4b8c0d){_0x18f583=_0x18f583-0x0;var _0x3da7d2=_0xda73[_0x18f583];return _0x3da7d2;};'use strict';var express=require(_0x3da7('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3da7('0x1'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x3da7('0x2')](),controller[_0x3da7('0x3')]);router[_0x3da7('0x4')](_0x3da7('0x5'),auth[_0x3da7('0x2')](),controller[_0x3da7('0x6')]);router[_0x3da7('0x4')]('/:id',auth[_0x3da7('0x2')](),controller['show']);router[_0x3da7('0x4')](_0x3da7('0x7'),auth['isAuthenticated'](),controller['getMessages']);router[_0x3da7('0x4')](_0x3da7('0x8'),auth[_0x3da7('0x2')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x3da7('0x9')]);router[_0x3da7('0xa')](_0x3da7('0x7'),auth['isAuthenticated'](),controller['addMessage']);router[_0x3da7('0xa')](_0x3da7('0xb'),auth[_0x3da7('0x2')](),interaction[_0x3da7('0xc')](_0x3da7('0xd'),_0x3da7('0xe')),controller[_0x3da7('0xf')]);router[_0x3da7('0x10')](_0x3da7('0x11'),auth[_0x3da7('0x2')](),interaction[_0x3da7('0xc')](_0x3da7('0xd'),'mailinteraction:update'),controller['update']);router['delete'](_0x3da7('0x11'),auth[_0x3da7('0x2')](),interaction[_0x3da7('0xc')]('mail','mailinteraction:destroy'),controller[_0x3da7('0x12')]);router[_0x3da7('0x13')]('/:id/tags',auth[_0x3da7('0x2')](),controller[_0x3da7('0x14')]);module[_0x3da7('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a7835ae..51f2737 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 _0x33be=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x33be,0x119));var _0xe33b=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x33be[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xe33b('0x0'));var iconv=require('iconv');module[_0xe33b('0x1')]={'closed':{'type':Sequelize[_0xe33b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe33b('0x3')]},'disposition':{'type':Sequelize[_0xe33b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe33b('0x4')]},'note':{'type':Sequelize[_0xe33b('0x4')]},'inReplyTo':{'type':Sequelize[_0xe33b('0x4')](0x1fe)},'to':{'type':Sequelize[_0xe33b('0x4')]},'cc':{'type':Sequelize[_0xe33b('0x5')](_0xe33b('0x6'))},'subject':{'type':Sequelize[_0xe33b('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe33b('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xe33b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe33b('0x7')]('in',_0xe33b('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe33b('0x7')]('in',_0xe33b('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9992=['iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out','sequelize'];(function(_0x21b2c2,_0x487ac9){var _0x2c9d67=function(_0x201d7c){while(--_0x201d7c){_0x21b2c2['push'](_0x21b2c2['shift']());}};_0x2c9d67(++_0x487ac9);}(_0x9992,0x135));var _0x2999=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x9992[_0x349148];return _0x2f2b0f;};'use strict';var Sequelize=require(_0x2999('0x0'));var iconv=require(_0x2999('0x1'));module[_0x2999('0x2')]={'closed':{'type':Sequelize[_0x2999('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2999('0x4')]},'secondDisposition':{'type':Sequelize[_0x2999('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2999('0x4')]},'note':{'type':Sequelize[_0x2999('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x2999('0x5')](_0x2999('0x6'))},'subject':{'type':Sequelize[_0x2999('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2999('0x7')]},'substatus':{'type':Sequelize[_0x2999('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x2999('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x2999('0x8')]('in',_0x2999('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2999('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2999('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 18d15a0..fd5913d 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 _0xa359=['catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','options','MailInteraction','find','body','update','params','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','nolimit','order','where','pick','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','true','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','files','tmp','join','root','server','attachments','push','Attachments','Messages','from','bcc','subject','createdAt','sort','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','getOptions','findAll','mail','query','user'];(function(_0x46a2b8,_0x54369e){var _0x17f4d5=function(_0x627506){while(--_0x627506){_0x46a2b8['push'](_0x46a2b8['shift']());}};_0x17f4d5(++_0x54369e);}(_0xa359,0x19e));var _0x9a35=function(_0x3ee696,_0x4ccb7d){_0x3ee696=_0x3ee696-0x0;var _0x47d022=_0xa359[_0x3ee696];return _0x47d022;};'use strict';var emlformat=require(_0x9a35('0x0'));var rimraf=require(_0x9a35('0x1'));var zipdir=require(_0x9a35('0x2'));var moment=require(_0x9a35('0x3'));var BPromise=require(_0x9a35('0x4'));var util=require(_0x9a35('0x5'));var path=require(_0x9a35('0x6'));var fs=require('fs');var _=require(_0x9a35('0x7'));var juice=require(_0x9a35('0x8'));var Redis=require(_0x9a35('0x9'));var interaction=require(_0x9a35('0xa'));var qs=require(_0x9a35('0xb'));var logger=require(_0x9a35('0xc'))(_0x9a35('0xd'));var config=require('../../config/environment');var db=require(_0x9a35('0xe'))['db'];var htmlEntities=require('html-entities');config[_0x9a35('0xf')]=_['defaults'](config[_0x9a35('0xf')],{'host':_0x9a35('0x10'),'port':0x18eb});var socket=require(_0x9a35('0x11'))(new Redis(config[_0x9a35('0xf')]));require(_0x9a35('0x12'))[_0x9a35('0x13')](socket);function respondWithStatusCode(_0x3b0617,_0x10cb3b){_0x10cb3b=_0x10cb3b||0xcc;return function(_0x2ed870){if(_0x2ed870){return _0x3b0617['sendStatus'](_0x10cb3b);}return _0x3b0617[_0x9a35('0x14')](_0x10cb3b)[_0x9a35('0x15')]();};}function respondWithResult(_0x5595ea,_0x361a12){_0x361a12=_0x361a12||0xc8;return function(_0xe84b94){if(_0xe84b94){return _0x5595ea[_0x9a35('0x14')](_0x361a12)[_0x9a35('0x16')](_0xe84b94);}};}function respondWithFilteredResult(_0x2ea619,_0x14d785){return function(_0x2ea160){if(_0x2ea160){var _0x251df4=typeof _0x14d785[_0x9a35('0x17')]===_0x9a35('0x18')&&typeof _0x14d785[_0x9a35('0x19')]===_0x9a35('0x18');var _0x2abbe7=_0x2ea160[_0x9a35('0x1a')];var _0x102541=_0x251df4?0x0:_0x14d785[_0x9a35('0x17')];var _0xf217f6=_0x251df4?_0x2ea160[_0x9a35('0x1a')]:_0x14d785[_0x9a35('0x17')]+_0x14d785['limit'];var _0x41d4ed;if(_0xf217f6>=_0x2abbe7){_0xf217f6=_0x2abbe7;_0x41d4ed=0xc8;}else{_0x41d4ed=0xce;}_0x2ea619[_0x9a35('0x14')](_0x41d4ed);return _0x2ea619[_0x9a35('0x1b')](_0x9a35('0x1c'),_0x102541+'-'+_0xf217f6+'/'+_0x2abbe7)[_0x9a35('0x16')](_0x2ea160);}return null;};}function saveUpdates(_0x1dbc5e){return function(_0x490d6){if(_0x490d6){return _0x490d6['update'](_0x1dbc5e)[_0x9a35('0x1d')](function(_0x3ec557){return _0x3ec557;});}return null;};}function removeEntity(_0x48c56b){return function(_0x3882b9){if(_0x3882b9){return _0x3882b9[_0x9a35('0x1e')]()[_0x9a35('0x1d')](function(){_0x48c56b[_0x9a35('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3835){return function(_0x4a8329){if(!_0x4a8329){_0x3b3835[_0x9a35('0x1f')](0x194);}return _0x4a8329;};}function handleError(_0x1d855e,_0x3efc24){_0x3efc24=_0x3efc24||0x1f4;return function(_0x1b3652){logger[_0x9a35('0x20')](_0x1b3652[_0x9a35('0x21')]);if(_0x1b3652['name']){delete _0x1b3652[_0x9a35('0x22')];}_0x1d855e['status'](_0x3efc24)[_0x9a35('0x23')](_0x1b3652);};}exports[_0x9a35('0x24')]=function(_0x546fd4,_0x271f69){var _0x38fabc={};var _0x4bfdb6=_[_0x9a35('0x25')](db['MailInteraction'][_0x9a35('0x26')],function(_0x230c7c){return{'name':_0x230c7c[_0x9a35('0x27')],'type':_0x230c7c['type'][_0x9a35('0x28')]};});_0x38fabc=qs[_0x9a35('0x29')](_0x4bfdb6,_0x546fd4);return interaction[_0x9a35('0x2a')](_0x9a35('0x2b'),_0x546fd4[_0x9a35('0x2c')],_0x546fd4[_0x9a35('0x2d')],_0x38fabc,_0x4bfdb6)[_0x9a35('0x1d')](respondWithFilteredResult(_0x271f69,_0x38fabc))[_0x9a35('0x2e')](handleError(_0x271f69,null));};exports[_0x9a35('0x2f')]=function(_0x2fe8fb,_0xe34c76){var _0x1fc2e1={'raw':![],'where':{'id':_0x2fe8fb['params']['id']}},_0x17be16={};_0x17be16[_0x9a35('0x30')]=_['keys'](db['MailInteraction'][_0x9a35('0x26')]);_0x17be16[_0x9a35('0x2c')]=_[_0x9a35('0x31')](_0x2fe8fb['query']);_0x17be16[_0x9a35('0x32')]=_[_0x9a35('0x33')](_0x17be16[_0x9a35('0x30')],_0x17be16[_0x9a35('0x2c')]);_0x1fc2e1[_0x9a35('0x34')]=_[_0x9a35('0x33')](_0x17be16[_0x9a35('0x30')],qs[_0x9a35('0x35')](_0x2fe8fb['query']['fields']));_0x1fc2e1[_0x9a35('0x34')]=_0x1fc2e1[_0x9a35('0x34')][_0x9a35('0x36')]?_0x1fc2e1[_0x9a35('0x34')]:_0x17be16[_0x9a35('0x30')];if(_0x2fe8fb[_0x9a35('0x2c')][_0x9a35('0x37')]){_0x1fc2e1['include']=[{'all':!![]}];}_0x1fc2e1=_['merge']({},_0x1fc2e1,_0x2fe8fb[_0x9a35('0x38')]);return db[_0x9a35('0x39')][_0x9a35('0x3a')](_0x1fc2e1)['then'](handleEntityNotFound(_0xe34c76,null))[_0x9a35('0x1d')](respondWithResult(_0xe34c76,null))[_0x9a35('0x2e')](handleError(_0xe34c76,null));};exports['create']=function(_0x4f0e1f,_0x5b11fc){return db[_0x9a35('0x39')]['create'](_0x4f0e1f[_0x9a35('0x3b')],{})[_0x9a35('0x1d')](respondWithResult(_0x5b11fc,0xc9))[_0x9a35('0x2e')](handleError(_0x5b11fc,null));};exports[_0x9a35('0x3c')]=function(_0x531eda,_0x4c3d8a){if(_0x531eda[_0x9a35('0x3b')]['id']){delete _0x531eda[_0x9a35('0x3b')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x531eda[_0x9a35('0x3d')]['id']}})[_0x9a35('0x1d')](handleEntityNotFound(_0x4c3d8a,null))[_0x9a35('0x1d')](saveUpdates(_0x531eda['body'],null))[_0x9a35('0x1d')](respondWithResult(_0x4c3d8a,null))[_0x9a35('0x2e')](handleError(_0x4c3d8a,null));};exports[_0x9a35('0x1e')]=function(_0x177464,_0x42d10a){return db[_0x9a35('0x39')]['find']({'where':{'id':_0x177464[_0x9a35('0x3d')]['id']}})[_0x9a35('0x1d')](handleEntityNotFound(_0x42d10a,null))[_0x9a35('0x1d')](removeEntity(_0x42d10a,null))[_0x9a35('0x2e')](handleError(_0x42d10a,null));};exports[_0x9a35('0x3e')]=function(_0x52e51e,_0x42abf7){return db['MailInteraction'][_0x9a35('0x3e')]()[_0x9a35('0x1d')](respondWithResult(_0x42abf7,null))[_0x9a35('0x2e')](handleError(_0x42abf7,null));};exports[_0x9a35('0x3f')]=function(_0x4f737b,_0xc64850){return db[_0x9a35('0x40')][_0x9a35('0x3a')]({'where':{'id':_0x4f737b[_0x9a35('0x3d')]['id']}})[_0x9a35('0x1d')](handleEntityNotFound(_0xc64850,null))[_0x9a35('0x1d')](function(_0x3ebfab){if(_0x3ebfab){return _0x3ebfab[_0x9a35('0x3f')](_0x4f737b[_0x9a35('0x3b')]['ids'],_[_0x9a35('0x41')](_0x4f737b[_0x9a35('0x3b')],[_0x9a35('0x42'),'id'])||{});}})[_0x9a35('0x1d')](respondWithResult(_0xc64850,null))['catch'](handleError(_0xc64850,null));};exports[_0x9a35('0x43')]=function(_0x2e9f90,_0x1be750){var _0x4a8d88={'raw':![],'where':{}};var _0x4f8e62={};var _0x2bd2ec={'count':0x0,'rows':[]};return db[_0x9a35('0x39')][_0x9a35('0x44')]({'where':{'id':_0x2e9f90[_0x9a35('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1be750,null))[_0x9a35('0x1d')](function(_0x267d85){if(_0x267d85){_0x4f8e62[_0x9a35('0x30')]=_[_0x9a35('0x31')](db['MailMessage']['rawAttributes']);_0x4f8e62['query']=_['keys'](_0x2e9f90[_0x9a35('0x2c')]);_0x4f8e62[_0x9a35('0x32')]=_['intersection'](_0x4f8e62['model'],_0x4f8e62[_0x9a35('0x2c')]);_0x4a8d88['attributes']=_[_0x9a35('0x33')](_0x4f8e62[_0x9a35('0x30')],qs[_0x9a35('0x35')](_0x2e9f90[_0x9a35('0x2c')][_0x9a35('0x35')]));_0x4a8d88['attributes']=_0x4a8d88[_0x9a35('0x34')][_0x9a35('0x36')]?_0x4a8d88[_0x9a35('0x34')]:_0x4f8e62[_0x9a35('0x30')];if(!_0x2e9f90[_0x9a35('0x2c')]['hasOwnProperty'](_0x9a35('0x45'))){_0x4a8d88[_0x9a35('0x19')]=qs['limit'](_0x2e9f90[_0x9a35('0x2c')]['limit']);_0x4a8d88[_0x9a35('0x17')]=qs[_0x9a35('0x17')](_0x2e9f90['query'][_0x9a35('0x17')]);}_0x4a8d88[_0x9a35('0x46')]=qs['sort'](_0x2e9f90[_0x9a35('0x2c')]['sort']);_0x4a8d88[_0x9a35('0x47')]=qs['filters'](_[_0x9a35('0x48')](_0x2e9f90['query'],_0x4f8e62[_0x9a35('0x32')]));_0x4a8d88[_0x9a35('0x47')]['MailInteractionId']=_0x267d85['id'];if(_0x2e9f90[_0x9a35('0x2c')][_0x9a35('0x49')]){_0x4a8d88[_0x9a35('0x47')]=_[_0x9a35('0x4a')](_0x4a8d88[_0x9a35('0x47')],{'$or':_[_0x9a35('0x25')](_0x4a8d88[_0x9a35('0x34')],function(_0x4fa536){var _0x159609={};_0x159609[_0x4fa536]={'$like':'%'+_0x2e9f90[_0x9a35('0x2c')][_0x9a35('0x49')]+'%'};return _0x159609;})});}if(_0x2e9f90[_0x9a35('0x2c')][_0x9a35('0x4b')]){var _0xa872c5=_0x2e9f90[_0x9a35('0x2c')][_0x9a35('0x4b')]['split'](',');var _0x3ac0b0={};_0x3ac0b0[_0xa872c5[0x0]]={'$gte':moment(_0xa872c5[0x1])[_0x9a35('0x4c')](_0x9a35('0x4d'))};_0x4a8d88['where']=_[_0x9a35('0x4a')](_0x4a8d88[_0x9a35('0x47')],_0x3ac0b0);}_0x4a8d88=_[_0x9a35('0x4a')]({},_0x4a8d88,_0x2e9f90['options']);return db[_0x9a35('0x40')][_0x9a35('0x1a')]({'where':_0x4a8d88[_0x9a35('0x47')]})['then'](function(_0x1de1eb){_0x2bd2ec[_0x9a35('0x1a')]=_0x1de1eb;if(_0x2e9f90[_0x9a35('0x2c')]['includeAll']){_0x4a8d88[_0x9a35('0x4e')]=[{'all':!![]}];}return db[_0x9a35('0x40')][_0x9a35('0x2a')](_0x4a8d88);})[_0x9a35('0x1d')](function(_0x19b517){if(_0x2e9f90['query'][_0x9a35('0x4f')]===_0x9a35('0x50')){for(var _0x296f13=0x0;_0x296f13<_0x19b517['length'];_0x296f13++){_0x19b517[_0x296f13]['body']=juice(_0x19b517[_0x296f13][_0x9a35('0x3b')]);}}_0x2bd2ec['rows']=_0x19b517;return _0x2bd2ec;});}})[_0x9a35('0x1d')](respondWithFilteredResult(_0x1be750,_0x4a8d88))[_0x9a35('0x2e')](handleError(_0x1be750,null));};exports['addTags']=function(_0x5c8173,_0x3a9829){return db[_0x9a35('0x39')][_0x9a35('0x3a')]({'where':{'id':_0x5c8173[_0x9a35('0x3d')]['id']}})[_0x9a35('0x1d')](handleEntityNotFound(_0x3a9829,null))[_0x9a35('0x1d')](function(_0xd9bc03){if(_0xd9bc03){return _0xd9bc03['setTags'](_0x5c8173[_0x9a35('0x3b')][_0x9a35('0x42')],_[_0x9a35('0x41')](_0x5c8173[_0x9a35('0x3b')],['ids','id'])||{})['spread'](function(){return db[_0x9a35('0x51')]['findAll']({'attributes':['id',_0x9a35('0x22'),_0x9a35('0x52')],'where':{'id':_0x5c8173[_0x9a35('0x3b')][_0x9a35('0x42')]}});})[_0x9a35('0x1d')](function(_0x40b87b){socket[_0x9a35('0x53')](_0x9a35('0x54'),{'id':Number(_0x5c8173[_0x9a35('0x3d')]['id']),'tags':_0x40b87b||[]});return{'id':Number(_0x5c8173['params']['id']),'tags':_0x40b87b||[]};});}})[_0x9a35('0x1d')](respondWithResult(_0x3a9829,null))[_0x9a35('0x2e')](handleError(_0x3a9829,null));};exports[_0x9a35('0x55')]=function(_0x6a3d33,_0x2beee0){return db[_0x9a35('0x39')]['find']({'where':{'id':_0x6a3d33['params']['id']}})['then'](handleEntityNotFound(_0x2beee0,null))[_0x9a35('0x1d')](function(_0x56f197){if(_0x56f197){return _0x56f197[_0x9a35('0x55')](_0x6a3d33[_0x9a35('0x2c')][_0x9a35('0x42')]);}})[_0x9a35('0x1d')](respondWithStatusCode(_0x2beee0,null))[_0x9a35('0x2e')](handleError(_0x2beee0,null));};exports[_0x9a35('0x56')]=function(_0x55e40b,_0x600bac){var _0x203576=moment()[_0x9a35('0x57')]()['toString']();var _0xf1d940=path['join'](config['root'],'server',_0x9a35('0x58'),_0x9a35('0x59'));var _0x4bf0b7=path[_0x9a35('0x5a')](config[_0x9a35('0x5b')],_0x9a35('0x5c'),_0x9a35('0x58'),_0x9a35('0x5d'));var _0x40cb87=path[_0x9a35('0x5a')](_0xf1d940,_0x203576);var _0x20549f=util[_0x9a35('0x4c')]('transcript-%d-%s.zip',_0x55e40b[_0x9a35('0x3d')]['id'],_0x203576);var _0x54af82=path[_0x9a35('0x5a')](_0xf1d940,_0x20549f);var _0x52c9c2=[];if(_0x55e40b[_0x9a35('0x2c')][_0x9a35('0x5d')]){_0x52c9c2[_0x9a35('0x5e')]({'model':db['Attachment'],'as':_0x9a35('0x5f'),'raw':!![]});}var _0x486462=[{'model':db['MailMessage'],'as':_0x9a35('0x60'),'attributes':['id',_0x9a35('0x3b'),_0x9a35('0x61'),'to','cc',_0x9a35('0x62'),_0x9a35('0x63'),_0x9a35('0x64')],'where':{'secret':![]},'order':qs[_0x9a35('0x65')]('id'),'include':_0x52c9c2}];return db[_0x9a35('0x39')][_0x9a35('0x3a')]({'where':{'id':_0x55e40b['params']['id']},'include':_0x486462})[_0x9a35('0x1d')](handleEntityNotFound(_0x600bac,null))[_0x9a35('0x1d')](function(_0x339bce){if(_0x339bce&&_0x339bce[_0x9a35('0x60')]){var _0x47d173=_0x339bce[_0x9a35('0x66')]({'plain':!![]});fs[_0x9a35('0x67')](_0x40cb87);return BPromise[_0x9a35('0x68')](_0x47d173['Messages'],function(_0x36b1ef,_0x434171){var _0x3b754a={'from':_0x36b1ef[_0x9a35('0x61')],'to':_0x36b1ef['to']||'missing.recipient@your.company.com','subject':_0x36b1ef['subject'],'html':htmlEntities[_0x9a35('0x69')](_0x36b1ef[_0x9a35('0x3b')]),'headers':{'Date':moment(_0x36b1ef['createdAt'])['format'](_0x9a35('0x6a'))},'attachments':[]};if(_0x36b1ef['cc']){_0x3b754a['headers']['Cc']=_0x36b1ef['cc'];}if(_0x36b1ef[_0x9a35('0x62')]){_0x3b754a[_0x9a35('0x6b')][_0x9a35('0x6c')]=_0x36b1ef['bcc'];}return new BPromise(function(_0x2e5f9f,_0x5058a0){if(_0x36b1ef['Attachments']){for(var _0x5247c4=0x0;_0x5247c4<_0x36b1ef[_0x9a35('0x5f')]['length'];_0x5247c4++){var _0x13ee9c=_0x36b1ef[_0x9a35('0x5f')][_0x5247c4];var _0x9eab5f=path[_0x9a35('0x5a')](_0x4bf0b7,_0x13ee9c[_0x9a35('0x6d')]);if(fs[_0x9a35('0x6e')](_0x9eab5f)){_0x3b754a[_0x9a35('0x5d')][_0x9a35('0x5e')]({'name':_0x13ee9c[_0x9a35('0x22')],'contentType':_0x13ee9c['type'],'data':fs[_0x9a35('0x6f')](_0x9eab5f)});}}}emlformat['build'](_0x3b754a,function(_0x475d4f,_0x56e685){if(_0x475d4f)return _0x5058a0(_0x475d4f);fs[_0x9a35('0x70')](path[_0x9a35('0x5a')](_0x40cb87,util['format'](_0x9a35('0x71'),_0x434171)),_0x56e685);return _0x2e5f9f(_0x56e685);});});})[_0x9a35('0x1d')](function(){return new BPromise(function(_0x3c9873,_0x58bc39){zipdir(_0x40cb87,{'saveTo':_0x54af82},function(_0x35fa6c,_0x377220){if(_0x35fa6c)return _0x58bc39(_0x35fa6c);return _0x3c9873(_0x377220);});})[_0x9a35('0x1d')](function(){return new BPromise(function(_0x4c9432,_0x396d36){rimraf(_0x40cb87,function(_0x52fd0a){if(_0x52fd0a)_0x396d36(_0x52fd0a);return _0x4c9432();});});})['then'](function(){return _0x600bac['download'](_0x54af82,_0x20549f,function(_0x4ba901){if(!_0x4ba901)fs[_0x9a35('0x72')](_0x54af82);});});});}else{return _0x600bac[_0x9a35('0x1f')](0xc8);}})[_0x9a35('0x2e')](handleError(_0x600bac,null));}; \ No newline at end of file +var _0xb1b6=['rawAttributes','filters','attributes','intersection','fields','length','merge','options','find','create','body','addMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','pick','MailInteractionId','map','filter','$gte','split','format','count','includeAll','findAll','inlineCss','true','addTags','setTags','spread','emit','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachments','MailMessage','Messages','from','bcc','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','headers','Bcc','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','set','update','destroy','sendStatus','error','stack','name','send','MailInteraction','fieldName','type','key','getOptions','mail','query','user','then','catch','show','params','model','keys'];(function(_0x1c5c48,_0x4176f6){var _0x5b32af=function(_0x5452f4){while(--_0x5452f4){_0x1c5c48['push'](_0x1c5c48['shift']());}};_0x5b32af(++_0x4176f6);}(_0xb1b6,0x18a));var _0x6b1b=function(_0x391e47,_0x2e1373){_0x391e47=_0x391e47-0x0;var _0x5bc280=_0xb1b6[_0x391e47];return _0x5bc280;};'use strict';var emlformat=require(_0x6b1b('0x0'));var rimraf=require(_0x6b1b('0x1'));var zipdir=require(_0x6b1b('0x2'));var moment=require('moment');var BPromise=require(_0x6b1b('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x6b1b('0x4'));var juice=require(_0x6b1b('0x5'));var Redis=require(_0x6b1b('0x6'));var interaction=require(_0x6b1b('0x7'));var qs=require(_0x6b1b('0x8'));var logger=require('../../config/logger')(_0x6b1b('0x9'));var config=require('../../config/environment');var db=require(_0x6b1b('0xa'))['db'];var htmlEntities=require(_0x6b1b('0xb'));config['redis']=_[_0x6b1b('0xc')](config[_0x6b1b('0xd')],{'host':_0x6b1b('0xe'),'port':0x18eb});var socket=require(_0x6b1b('0xf'))(new Redis(config[_0x6b1b('0xd')]));require(_0x6b1b('0x10'))[_0x6b1b('0x11')](socket);function respondWithStatusCode(_0x2d452c,_0x380df6){_0x380df6=_0x380df6||0xcc;return function(_0x34000c){if(_0x34000c){return _0x2d452c['sendStatus'](_0x380df6);}return _0x2d452c[_0x6b1b('0x12')](_0x380df6)[_0x6b1b('0x13')]();};}function respondWithResult(_0x56ad72,_0x3da5f3){_0x3da5f3=_0x3da5f3||0xc8;return function(_0x49be0f){if(_0x49be0f){return _0x56ad72['status'](_0x3da5f3)[_0x6b1b('0x14')](_0x49be0f);}};}function respondWithFilteredResult(_0x521db1,_0x9338a3){return function(_0x3bd608){if(_0x3bd608){var _0x4a12f7=typeof _0x9338a3[_0x6b1b('0x15')]===_0x6b1b('0x16')&&typeof _0x9338a3[_0x6b1b('0x17')]===_0x6b1b('0x16');var _0x40897a=_0x3bd608['count'];var _0x3e2b11=_0x4a12f7?0x0:_0x9338a3[_0x6b1b('0x15')];var _0x26b697=_0x4a12f7?_0x3bd608['count']:_0x9338a3[_0x6b1b('0x15')]+_0x9338a3[_0x6b1b('0x17')];var _0x1d3173;if(_0x26b697>=_0x40897a){_0x26b697=_0x40897a;_0x1d3173=0xc8;}else{_0x1d3173=0xce;}_0x521db1['status'](_0x1d3173);return _0x521db1[_0x6b1b('0x18')]('Content-Range',_0x3e2b11+'-'+_0x26b697+'/'+_0x40897a)[_0x6b1b('0x14')](_0x3bd608);}return null;};}function saveUpdates(_0x51a24b){return function(_0x4eeef9){if(_0x4eeef9){return _0x4eeef9[_0x6b1b('0x19')](_0x51a24b)['then'](function(_0x4e0f4d){return _0x4e0f4d;});}return null;};}function removeEntity(_0x4831aa){return function(_0x161b0a){if(_0x161b0a){return _0x161b0a[_0x6b1b('0x1a')]()['then'](function(){_0x4831aa['status'](0xcc)[_0x6b1b('0x13')]();});}};}function handleEntityNotFound(_0x3c3b63){return function(_0x3a44ab){if(!_0x3a44ab){_0x3c3b63[_0x6b1b('0x1b')](0x194);}return _0x3a44ab;};}function handleError(_0x856aa6,_0x3203a2){_0x3203a2=_0x3203a2||0x1f4;return function(_0x116845){logger[_0x6b1b('0x1c')](_0x116845[_0x6b1b('0x1d')]);if(_0x116845[_0x6b1b('0x1e')]){delete _0x116845[_0x6b1b('0x1e')];}_0x856aa6['status'](_0x3203a2)[_0x6b1b('0x1f')](_0x116845);};}exports['index']=function(_0x456039,_0x1de2fd){var _0x158b48={};var _0x4a6b44=_['map'](db[_0x6b1b('0x20')]['rawAttributes'],function(_0x2c8db6){return{'name':_0x2c8db6[_0x6b1b('0x21')],'type':_0x2c8db6[_0x6b1b('0x22')][_0x6b1b('0x23')]};});_0x158b48=qs[_0x6b1b('0x24')](_0x4a6b44,_0x456039);return interaction['findAll'](_0x6b1b('0x25'),_0x456039[_0x6b1b('0x26')],_0x456039[_0x6b1b('0x27')],_0x158b48,_0x4a6b44)[_0x6b1b('0x28')](respondWithFilteredResult(_0x1de2fd,_0x158b48))[_0x6b1b('0x29')](handleError(_0x1de2fd,null));};exports[_0x6b1b('0x2a')]=function(_0x16373b,_0x31496f){var _0x17ef82={'raw':![],'where':{'id':_0x16373b[_0x6b1b('0x2b')]['id']}},_0x404fd4={};_0x404fd4[_0x6b1b('0x2c')]=_[_0x6b1b('0x2d')](db['MailInteraction'][_0x6b1b('0x2e')]);_0x404fd4[_0x6b1b('0x26')]=_[_0x6b1b('0x2d')](_0x16373b[_0x6b1b('0x26')]);_0x404fd4[_0x6b1b('0x2f')]=_['intersection'](_0x404fd4[_0x6b1b('0x2c')],_0x404fd4[_0x6b1b('0x26')]);_0x17ef82[_0x6b1b('0x30')]=_[_0x6b1b('0x31')](_0x404fd4[_0x6b1b('0x2c')],qs[_0x6b1b('0x32')](_0x16373b[_0x6b1b('0x26')][_0x6b1b('0x32')]));_0x17ef82[_0x6b1b('0x30')]=_0x17ef82[_0x6b1b('0x30')][_0x6b1b('0x33')]?_0x17ef82['attributes']:_0x404fd4[_0x6b1b('0x2c')];if(_0x16373b['query']['includeAll']){_0x17ef82['include']=[{'all':!![]}];}_0x17ef82=_[_0x6b1b('0x34')]({},_0x17ef82,_0x16373b[_0x6b1b('0x35')]);return db['MailInteraction'][_0x6b1b('0x36')](_0x17ef82)[_0x6b1b('0x28')](handleEntityNotFound(_0x31496f,null))['then'](respondWithResult(_0x31496f,null))[_0x6b1b('0x29')](handleError(_0x31496f,null));};exports[_0x6b1b('0x37')]=function(_0x844435,_0x3cbc5a){return db[_0x6b1b('0x20')][_0x6b1b('0x37')](_0x844435[_0x6b1b('0x38')],{})[_0x6b1b('0x28')](respondWithResult(_0x3cbc5a,0xc9))[_0x6b1b('0x29')](handleError(_0x3cbc5a,null));};exports['update']=function(_0x3fcb10,_0x3ce1d2){if(_0x3fcb10[_0x6b1b('0x38')]['id']){delete _0x3fcb10[_0x6b1b('0x38')]['id'];}return db[_0x6b1b('0x20')]['find']({'where':{'id':_0x3fcb10[_0x6b1b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3ce1d2,null))['then'](saveUpdates(_0x3fcb10[_0x6b1b('0x38')],null))[_0x6b1b('0x28')](respondWithResult(_0x3ce1d2,null))[_0x6b1b('0x29')](handleError(_0x3ce1d2,null));};exports[_0x6b1b('0x1a')]=function(_0x11d2a9,_0x262aa3){return db[_0x6b1b('0x20')][_0x6b1b('0x36')]({'where':{'id':_0x11d2a9[_0x6b1b('0x2b')]['id']}})[_0x6b1b('0x28')](handleEntityNotFound(_0x262aa3,null))[_0x6b1b('0x28')](removeEntity(_0x262aa3,null))['catch'](handleError(_0x262aa3,null));};exports['describe']=function(_0x2f1380,_0x3bbde3){return db['MailInteraction']['describe']()['then'](respondWithResult(_0x3bbde3,null))[_0x6b1b('0x29')](handleError(_0x3bbde3,null));};exports[_0x6b1b('0x39')]=function(_0x290613,_0x6d9e78){return db['MailMessage'][_0x6b1b('0x36')]({'where':{'id':_0x290613[_0x6b1b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x6d9e78,null))[_0x6b1b('0x28')](function(_0x5daf26){if(_0x5daf26){return _0x5daf26[_0x6b1b('0x39')](_0x290613[_0x6b1b('0x38')][_0x6b1b('0x3a')],_[_0x6b1b('0x3b')](_0x290613['body'],[_0x6b1b('0x3a'),'id'])||{});}})[_0x6b1b('0x28')](respondWithResult(_0x6d9e78,null))[_0x6b1b('0x29')](handleError(_0x6d9e78,null));};exports[_0x6b1b('0x3c')]=function(_0x4132a1,_0x413d50){var _0x4037a6={'raw':![],'where':{}};var _0xc75906={};var _0x449db7={'count':0x0,'rows':[]};return db[_0x6b1b('0x20')][_0x6b1b('0x3d')]({'where':{'id':_0x4132a1[_0x6b1b('0x2b')]['id']}})[_0x6b1b('0x28')](handleEntityNotFound(_0x413d50,null))[_0x6b1b('0x28')](function(_0x12da18){if(_0x12da18){_0xc75906[_0x6b1b('0x2c')]=_['keys'](db['MailMessage']['rawAttributes']);_0xc75906[_0x6b1b('0x26')]=_[_0x6b1b('0x2d')](_0x4132a1[_0x6b1b('0x26')]);_0xc75906[_0x6b1b('0x2f')]=_[_0x6b1b('0x31')](_0xc75906[_0x6b1b('0x2c')],_0xc75906[_0x6b1b('0x26')]);_0x4037a6[_0x6b1b('0x30')]=_[_0x6b1b('0x31')](_0xc75906[_0x6b1b('0x2c')],qs[_0x6b1b('0x32')](_0x4132a1[_0x6b1b('0x26')]['fields']));_0x4037a6[_0x6b1b('0x30')]=_0x4037a6['attributes'][_0x6b1b('0x33')]?_0x4037a6[_0x6b1b('0x30')]:_0xc75906[_0x6b1b('0x2c')];if(!_0x4132a1[_0x6b1b('0x26')]['hasOwnProperty'](_0x6b1b('0x3e'))){_0x4037a6[_0x6b1b('0x17')]=qs[_0x6b1b('0x17')](_0x4132a1[_0x6b1b('0x26')][_0x6b1b('0x17')]);_0x4037a6[_0x6b1b('0x15')]=qs[_0x6b1b('0x15')](_0x4132a1[_0x6b1b('0x26')][_0x6b1b('0x15')]);}_0x4037a6[_0x6b1b('0x3f')]=qs[_0x6b1b('0x40')](_0x4132a1[_0x6b1b('0x26')]['sort']);_0x4037a6[_0x6b1b('0x41')]=qs[_0x6b1b('0x2f')](_[_0x6b1b('0x42')](_0x4132a1[_0x6b1b('0x26')],_0xc75906[_0x6b1b('0x2f')]));_0x4037a6[_0x6b1b('0x41')][_0x6b1b('0x43')]=_0x12da18['id'];if(_0x4132a1['query']['filter']){_0x4037a6[_0x6b1b('0x41')]=_['merge'](_0x4037a6[_0x6b1b('0x41')],{'$or':_[_0x6b1b('0x44')](_0x4037a6[_0x6b1b('0x30')],function(_0x4bb3f0){var _0xf69616={};_0xf69616[_0x4bb3f0]={'$like':'%'+_0x4132a1[_0x6b1b('0x26')][_0x6b1b('0x45')]+'%'};return _0xf69616;})});}if(_0x4132a1[_0x6b1b('0x26')][_0x6b1b('0x46')]){var _0xfa119f=_0x4132a1[_0x6b1b('0x26')]['$gte'][_0x6b1b('0x47')](',');var _0x3afe3d={};_0x3afe3d[_0xfa119f[0x0]]={'$gte':moment(_0xfa119f[0x1])[_0x6b1b('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4037a6[_0x6b1b('0x41')]=_[_0x6b1b('0x34')](_0x4037a6['where'],_0x3afe3d);}_0x4037a6=_[_0x6b1b('0x34')]({},_0x4037a6,_0x4132a1['options']);return db['MailMessage']['count']({'where':_0x4037a6['where']})[_0x6b1b('0x28')](function(_0x1d9b0c){_0x449db7[_0x6b1b('0x49')]=_0x1d9b0c;if(_0x4132a1[_0x6b1b('0x26')][_0x6b1b('0x4a')]){_0x4037a6['include']=[{'all':!![]}];}return db['MailMessage'][_0x6b1b('0x4b')](_0x4037a6);})[_0x6b1b('0x28')](function(_0x166667){if(_0x4132a1['query'][_0x6b1b('0x4c')]===_0x6b1b('0x4d')){for(var _0x288d01=0x0;_0x288d01<_0x166667[_0x6b1b('0x33')];_0x288d01++){_0x166667[_0x288d01][_0x6b1b('0x38')]=juice(_0x166667[_0x288d01][_0x6b1b('0x38')]);}}_0x449db7['rows']=_0x166667;return _0x449db7;});}})[_0x6b1b('0x28')](respondWithFilteredResult(_0x413d50,_0x4037a6))[_0x6b1b('0x29')](handleError(_0x413d50,null));};exports[_0x6b1b('0x4e')]=function(_0x2b0cc7,_0x273837){return db[_0x6b1b('0x20')][_0x6b1b('0x36')]({'where':{'id':_0x2b0cc7['params']['id']}})[_0x6b1b('0x28')](handleEntityNotFound(_0x273837,null))[_0x6b1b('0x28')](function(_0xb9996c){if(_0xb9996c){return _0xb9996c[_0x6b1b('0x4f')](_0x2b0cc7['body']['ids'],_[_0x6b1b('0x3b')](_0x2b0cc7[_0x6b1b('0x38')],[_0x6b1b('0x3a'),'id'])||{})[_0x6b1b('0x50')](function(){return db['Tag'][_0x6b1b('0x4b')]({'attributes':['id',_0x6b1b('0x1e'),'color'],'where':{'id':_0x2b0cc7[_0x6b1b('0x38')][_0x6b1b('0x3a')]}});})[_0x6b1b('0x28')](function(_0x3e832f){socket[_0x6b1b('0x51')]('mailInteractionTags:save',{'id':Number(_0x2b0cc7[_0x6b1b('0x2b')]['id']),'tags':_0x3e832f||[]});return{'id':Number(_0x2b0cc7['params']['id']),'tags':_0x3e832f||[]};});}})[_0x6b1b('0x28')](respondWithResult(_0x273837,null))[_0x6b1b('0x29')](handleError(_0x273837,null));};exports[_0x6b1b('0x52')]=function(_0x43e4e0,_0x22f897){return db[_0x6b1b('0x20')][_0x6b1b('0x36')]({'where':{'id':_0x43e4e0['params']['id']}})[_0x6b1b('0x28')](handleEntityNotFound(_0x22f897,null))[_0x6b1b('0x28')](function(_0x5c4677){if(_0x5c4677){return _0x5c4677[_0x6b1b('0x52')](_0x43e4e0['query'][_0x6b1b('0x3a')]);}})[_0x6b1b('0x28')](respondWithStatusCode(_0x22f897,null))[_0x6b1b('0x29')](handleError(_0x22f897,null));};exports[_0x6b1b('0x53')]=function(_0x522852,_0x435442){var _0x4617df=moment()[_0x6b1b('0x54')]()[_0x6b1b('0x55')]();var _0x53c0c8=path[_0x6b1b('0x56')](config[_0x6b1b('0x57')],'server',_0x6b1b('0x58'),_0x6b1b('0x59'));var _0x13fa42=path[_0x6b1b('0x56')](config[_0x6b1b('0x57')],_0x6b1b('0x5a'),_0x6b1b('0x58'),_0x6b1b('0x5b'));var _0x1f1506=path['join'](_0x53c0c8,_0x4617df);var _0x380d7d=util[_0x6b1b('0x48')](_0x6b1b('0x5c'),_0x522852[_0x6b1b('0x2b')]['id'],_0x4617df);var _0xa2be65=path[_0x6b1b('0x56')](_0x53c0c8,_0x380d7d);var _0x135642=[];if(_0x522852[_0x6b1b('0x26')]['attachments']){_0x135642['push']({'model':db['Attachment'],'as':_0x6b1b('0x5d'),'raw':!![]});}var _0x52e2ba=[{'model':db[_0x6b1b('0x5e')],'as':_0x6b1b('0x5f'),'attributes':['id','body',_0x6b1b('0x60'),'to','cc',_0x6b1b('0x61'),'subject',_0x6b1b('0x62')],'where':{'secret':![]},'order':qs[_0x6b1b('0x40')]('id'),'include':_0x135642}];return db[_0x6b1b('0x20')][_0x6b1b('0x36')]({'where':{'id':_0x522852[_0x6b1b('0x2b')]['id']},'include':_0x52e2ba})[_0x6b1b('0x28')](handleEntityNotFound(_0x435442,null))[_0x6b1b('0x28')](function(_0x406dc3){if(_0x406dc3&&_0x406dc3[_0x6b1b('0x5f')]){var _0x21444c=_0x406dc3[_0x6b1b('0x63')]({'plain':!![]});fs[_0x6b1b('0x64')](_0x1f1506);return BPromise[_0x6b1b('0x65')](_0x21444c[_0x6b1b('0x5f')],function(_0x4bd038,_0x5ea79a){var _0x27e439={'from':_0x4bd038[_0x6b1b('0x60')],'to':_0x4bd038['to']||_0x6b1b('0x66'),'subject':_0x4bd038['subject'],'html':htmlEntities[_0x6b1b('0x67')](_0x4bd038[_0x6b1b('0x38')]),'headers':{'Date':moment(_0x4bd038[_0x6b1b('0x62')])[_0x6b1b('0x48')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4bd038['cc']){_0x27e439[_0x6b1b('0x68')]['Cc']=_0x4bd038['cc'];}if(_0x4bd038[_0x6b1b('0x61')]){_0x27e439[_0x6b1b('0x68')][_0x6b1b('0x69')]=_0x4bd038[_0x6b1b('0x61')];}return new BPromise(function(_0x3161ba,_0x59f58b){if(_0x4bd038[_0x6b1b('0x5d')]){for(var _0x3d115c=0x0;_0x3d115c<_0x4bd038[_0x6b1b('0x5d')][_0x6b1b('0x33')];_0x3d115c++){var _0x4a70b3=_0x4bd038['Attachments'][_0x3d115c];var _0x32b2bf=path[_0x6b1b('0x56')](_0x13fa42,_0x4a70b3['basename']);if(fs['existsSync'](_0x32b2bf)){_0x27e439[_0x6b1b('0x5b')]['push']({'name':_0x4a70b3[_0x6b1b('0x1e')],'contentType':_0x4a70b3['type'],'data':fs[_0x6b1b('0x6a')](_0x32b2bf)});}}}emlformat[_0x6b1b('0x6b')](_0x27e439,function(_0x55049c,_0x4b2aba){if(_0x55049c)return _0x59f58b(_0x55049c);fs['writeFileSync'](path['join'](_0x1f1506,util[_0x6b1b('0x48')](_0x6b1b('0x6c'),_0x5ea79a)),_0x4b2aba);return _0x3161ba(_0x4b2aba);});});})[_0x6b1b('0x28')](function(){return new BPromise(function(_0x56b7a3,_0x5a12d8){zipdir(_0x1f1506,{'saveTo':_0xa2be65},function(_0x6d48de,_0x161ad6){if(_0x6d48de)return _0x5a12d8(_0x6d48de);return _0x56b7a3(_0x161ad6);});})[_0x6b1b('0x28')](function(){return new BPromise(function(_0x25dd15,_0x299db2){rimraf(_0x1f1506,function(_0x16f74d){if(_0x16f74d)_0x299db2(_0x16f74d);return _0x25dd15();});});})[_0x6b1b('0x28')](function(){return _0x435442[_0x6b1b('0x53')](_0xa2be65,_0x380d7d,function(_0x524f6d){if(!_0x524f6d)fs[_0x6b1b('0x6d')](_0xa2be65);});});});}else{return _0x435442[_0x6b1b('0x1b')](0xc8);}})[_0x6b1b('0x29')](handleError(_0x435442,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c8228d4..4b9a90b 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 _0xd88b=['MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction'];(function(_0x141885,_0x250927){var _0x104882=function(_0x4d91ef){while(--_0x4d91ef){_0x141885['push'](_0x141885['shift']());}};_0x104882(++_0x250927);}(_0xd88b,0x140));var _0xbd88=function(_0x9c7115,_0x5704cb){_0x9c7115=_0x9c7115-0x0;var _0x3a199b=_0xd88b[_0x9c7115];return _0x3a199b;};'use strict';var EventEmitter=require(_0xbd88('0x0'));var MailInteraction=require(_0xbd88('0x1'))['db'][_0xbd88('0x2')];var MailMessage=require(_0xbd88('0x1'))['db'][_0xbd88('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbd88('0x4')](0x0);var events={'afterCreate':_0xbd88('0x5'),'afterUpdate':_0xbd88('0x6'),'afterDestroy':_0xbd88('0x7')};function emitEvent(_0x18c9af){return function(_0x59e923,_0x563a32,_0x5804a0){_0x59e923[_0xbd88('0x8')]({'attributes':['id'],'raw':!![]})[_0xbd88('0x9')](function(_0x2b3981){_0x59e923[_0xbd88('0xa')](_0xbd88('0xb'),_0x2b3981[_0xbd88('0xc')](function(_0x38ebf1){return{'id':_0x38ebf1['id']};}));return MailMessage[_0xbd88('0xd')]({'where':{'MailInteractionId':_0x59e923['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd88('0x9')](function(_0x44bf3d){_0x59e923['setDataValue']('unreadMessages',_0x44bf3d[_0xbd88('0xe')]);MailInteractionEvents[_0xbd88('0xf')](_0x18c9af+':'+_0x59e923['id'],_0x59e923);MailInteractionEvents[_0xbd88('0xf')](_0x18c9af,_0x59e923);_0x5804a0(null);})[_0xbd88('0x10')](_0x5804a0(null));};}for(var e in events){if(events[_0xbd88('0x11')](e)){var event=events[e];MailInteraction[_0xbd88('0x12')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xbe95=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','getUsers','then','setDataValue','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x34c9b3,_0x347a5c){var _0x36ff0e=function(_0x272bc1){while(--_0x272bc1){_0x34c9b3['push'](_0x34c9b3['shift']());}};_0x36ff0e(++_0x347a5c);}(_0xbe95,0x10d));var _0x5be9=function(_0x35f634,_0x3ad2e7){_0x35f634=_0x35f634-0x0;var _0x38fb4e=_0xbe95[_0x35f634];return _0x38fb4e;};'use strict';var EventEmitter=require(_0x5be9('0x0'));var MailInteraction=require(_0x5be9('0x1'))['db'][_0x5be9('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x5be9('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x5be9('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b0301){return function(_0x198cc8,_0x27d1c9,_0x4ae284){_0x198cc8[_0x5be9('0x5')]({'attributes':['id'],'raw':!![]})[_0x5be9('0x6')](function(_0x4ff3fb){_0x198cc8[_0x5be9('0x7')]('Users',_0x4ff3fb[_0x5be9('0x8')](function(_0x58223c){return{'id':_0x58223c['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x198cc8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5be9('0x6')](function(_0x56bf79){_0x198cc8['setDataValue'](_0x5be9('0x9'),_0x56bf79['length']);MailInteractionEvents['emit'](_0x1b0301+':'+_0x198cc8['id'],_0x198cc8);MailInteractionEvents[_0x5be9('0xa')](_0x1b0301,_0x198cc8);_0x4ae284(null);})[_0x5be9('0xb')](_0x4ae284(null));};}for(var e in events){if(events[_0x5be9('0xc')](e)){var event=events[e];MailInteraction[_0x5be9('0xd')](e,emitEvent(event));}}module[_0x5be9('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8ad2047..34704a4 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 _0x2e69=['lodash','api','moment','request-promise','path','./mailInteraction.attributes','exports','mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0xc08e88,_0x4038de){var _0x2d3c58=function(_0x47f4e0){while(--_0x47f4e0){_0xc08e88['push'](_0xc08e88['shift']());}};_0x2d3c58(++_0x4038de);}(_0x2e69,0xa1));var _0x92e6=function(_0x1f78bc,_0x46275b){_0x1f78bc=_0x1f78bc-0x0;var _0x3e55b8=_0x2e69[_0x1f78bc];return _0x3e55b8;};'use strict';var _=require(_0x92e6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x92e6('0x1'));var moment=require(_0x92e6('0x2'));var BPromise=require('bluebird');var rp=require(_0x92e6('0x3'));var fs=require('fs');var path=require(_0x92e6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x92e6('0x5'));module[_0x92e6('0x6')]=function(_0x132eeb,_0x133ff1){return _0x132eeb['define']('MailInteraction',attributes,{'tableName':_0x92e6('0x7'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf75c41,_0x2464fb,_0x2ade25){if(_0xf75c41[_0x92e6('0x8')]){_0xf75c41[_0x92e6('0x9')]=moment()[_0x92e6('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xf75c41['closed']){_0xf75c41['closedAt']=moment()[_0x92e6('0xa')](_0x92e6('0xb'));}_0x2ade25(null,_0x2464fb);},'beforeUpdate':function(_0x3678b0,_0x6ecab6,_0x3305cd){if(_0x3678b0[_0x92e6('0xc')](_0x92e6('0x8'))){_0x3678b0['substatusAt']=_0x3678b0[_0x92e6('0x8')]?moment()[_0x92e6('0xa')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3678b0[_0x92e6('0xc')](_0x92e6('0xd'))){_0x3678b0[_0x92e6('0xe')]=moment()[_0x92e6('0xa')](_0x92e6('0xb'));_0x3678b0[_0x92e6('0x8')]=null;_0x3678b0[_0x92e6('0x9')]=null;}_0x3305cd(null,_0x3678b0);},'afterUpdate':function(_0x2b4ce3,_0x463c97,_0x6241d6){var _0x15155e=_0x132eeb[_0x92e6('0xf')];var _0x8e4ccd=_0x2b4ce3[_0x92e6('0x10')]({'plain':!![]});if(_0x8e4ccd[_0x92e6('0xd')]){return _0x15155e[_0x92e6('0x11')][_0x92e6('0x12')]({'read':!![]},{'where':{'MailInteractionId':_0x8e4ccd['id']}})[_0x92e6('0x13')](function(){_0x6241d6();})[_0x92e6('0x14')](function(_0x4915b8){_0x6241d6(_0x4915b8);});}else{_0x6241d6();}}},'charset':_0x92e6('0x15'),'collate':_0x92e6('0x16')});}; \ No newline at end of file +var _0x263b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch'];(function(_0x36784d,_0x59fd7a){var _0x40257a=function(_0x15d859){while(--_0x15d859){_0x36784d['push'](_0x36784d['shift']());}};_0x40257a(++_0x59fd7a);}(_0x263b,0x74));var _0xb263=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x263b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb263('0x0'));var util=require(_0xb263('0x1'));var logger=require(_0xb263('0x2'))(_0xb263('0x3'));var moment=require(_0xb263('0x4'));var BPromise=require(_0xb263('0x5'));var rp=require(_0xb263('0x6'));var fs=require('fs');var path=require(_0xb263('0x7'));var rimraf=require(_0xb263('0x8'));var config=require(_0xb263('0x9'));var attributes=require(_0xb263('0xa'));module['exports']=function(_0x446edc,_0x472b92){return _0x446edc[_0xb263('0xb')]('MailInteraction',attributes,{'tableName':_0xb263('0xc'),'paranoid':![],'indexes':[{'name':_0xb263('0xd'),'fields':[_0xb263('0xe'),'to'],'type':_0xb263('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x351ad2,_0x42a8b5,_0x41cb5a){if(_0x351ad2[_0xb263('0x10')]){_0x351ad2[_0xb263('0x11')]=moment()[_0xb263('0x12')](_0xb263('0x13'));}if(_0x351ad2[_0xb263('0x14')]){_0x351ad2[_0xb263('0x15')]=moment()['format'](_0xb263('0x13'));}_0x41cb5a(null,_0x42a8b5);},'beforeUpdate':function(_0x3c4e99,_0xfd1a88,_0x332a04){if(_0x3c4e99[_0xb263('0x16')](_0xb263('0x10'))){_0x3c4e99[_0xb263('0x11')]=_0x3c4e99[_0xb263('0x10')]?moment()['format'](_0xb263('0x13')):null;}if(_0x3c4e99['changed'](_0xb263('0x14'))){_0x3c4e99[_0xb263('0x15')]=moment()[_0xb263('0x12')](_0xb263('0x13'));_0x3c4e99[_0xb263('0x10')]=null;_0x3c4e99[_0xb263('0x11')]=null;}_0x332a04(null,_0x3c4e99);},'afterUpdate':function(_0x37dc2e,_0x2b7c44,_0x287acb){var _0x30f8fe=_0x446edc[_0xb263('0x17')];var _0x3d2271=_0x37dc2e[_0xb263('0x18')]({'plain':!![]});if(_0x3d2271[_0xb263('0x14')]){return _0x30f8fe[_0xb263('0x19')][_0xb263('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x3d2271['id']}})[_0xb263('0x1b')](function(){_0x287acb();})[_0xb263('0x1c')](function(_0x8a6d97){_0x287acb(_0x8a6d97);});}else{_0x287acb();}}},'charset':'utf8mb4','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 b3508ca..e8fdb74 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 _0x0eb2=['./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','attributes','info','MailInteraction','where','addTags','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','redis','localhost','socket.io-emitter'];(function(_0x1c947f,_0x347428){var _0x2618da=function(_0x23a0ed){while(--_0x23a0ed){_0x1c947f['push'](_0x1c947f['shift']());}};_0x2618da(++_0x347428);}(_0x0eb2,0x11c));var _0x20eb=function(_0x2e9482,_0x3e1142){_0x2e9482=_0x2e9482-0x0;var _0x100060=_0x0eb2[_0x2e9482];return _0x100060;};'use strict';var _=require(_0x20eb('0x0'));var util=require('util');var moment=require(_0x20eb('0x1'));var BPromise=require(_0x20eb('0x2'));var rs=require(_0x20eb('0x3'));var fs=require('fs');var Redis=require(_0x20eb('0x4'));var db=require(_0x20eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x20eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x20eb('0x7')][_0x20eb('0x8')]({'port':0x232a});config[_0x20eb('0x9')]=_['defaults'](config[_0x20eb('0x9')],{'host':_0x20eb('0xa'),'port':0x18eb});var socket=require(_0x20eb('0xb'))(new Redis(config[_0x20eb('0x9')]));require(_0x20eb('0xc'))[_0x20eb('0xd')](socket);function respondWithRpcPromise(_0x2c704d,_0x178e1a,_0x354645){return new BPromise(function(_0x3e6330,_0x198a58){return client[_0x20eb('0xe')](_0x2c704d,_0x354645)[_0x20eb('0xf')](function(_0x304536){logger['info'](_0x20eb('0x10'),_0x178e1a,'request\x20sent');logger[_0x20eb('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x178e1a,_0x20eb('0x12'),JSON[_0x20eb('0x13')](_0x304536));if(_0x304536[_0x20eb('0x14')]){if(_0x304536[_0x20eb('0x14')][_0x20eb('0x15')]===0x1f4){logger[_0x20eb('0x14')](_0x20eb('0x10'),_0x178e1a,_0x304536[_0x20eb('0x14')][_0x20eb('0x16')]);return _0x198a58(_0x304536[_0x20eb('0x14')][_0x20eb('0x16')]);}logger[_0x20eb('0x14')](_0x20eb('0x10'),_0x178e1a,_0x304536[_0x20eb('0x14')][_0x20eb('0x16')]);return _0x3e6330(_0x304536['error'][_0x20eb('0x16')]);}else{logger['info'](_0x20eb('0x10'),_0x178e1a,_0x20eb('0x12'));_0x3e6330(_0x304536[_0x20eb('0x17')][_0x20eb('0x16')]);}})[_0x20eb('0x18')](function(_0x934bbc){logger[_0x20eb('0x14')]('MailInteraction,\x20%s,\x20%s',_0x178e1a,_0x934bbc);_0x198a58(_0x934bbc);});});}exports[_0x20eb('0x19')]=function(_0x3c16f2){var _0x50c857=this;return new Promise(function(_0x3763b8,_0x3eb2be){return db['MailInteraction'][_0x20eb('0x1a')](_0x3c16f2[_0x20eb('0x1b')],{'raw':_0x3c16f2[_0x20eb('0x1c')]?_0x3c16f2['options'][_0x20eb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c16f2[_0x20eb('0x1c')]?_0x3c16f2[_0x20eb('0x1c')]['where']||null:null,'attributes':_0x3c16f2[_0x20eb('0x1c')]?_0x3c16f2[_0x20eb('0x1c')][_0x20eb('0x1e')]||null:null,'limit':_0x3c16f2['options']?_0x3c16f2[_0x20eb('0x1c')]['limit']||null:null})[_0x20eb('0xf')](function(_0x363ece){logger[_0x20eb('0x1f')](_0x20eb('0x19'),_0x3c16f2);logger[_0x20eb('0x11')](_0x20eb('0x19'),_0x3c16f2,JSON[_0x20eb('0x13')](_0x363ece));_0x3763b8(_0x363ece);})[_0x20eb('0x18')](function(_0x4256ca){logger['error'](_0x20eb('0x19'),_0x4256ca[_0x20eb('0x16')],_0x3c16f2);_0x3eb2be(_0x50c857[_0x20eb('0x14')](0x1f4,_0x4256ca['message']));});});};exports['AddTagsToMailInteraction']=function(_0x5ef0b0){return new Promise(function(_0x55f1e8,_0x42455f){return db[_0x20eb('0x20')]['find']({'where':_0x5ef0b0[_0x20eb('0x1c')]?_0x5ef0b0['options'][_0x20eb('0x21')]||null:null})['then'](function(_0x5161d4){if(_0x5161d4){return _0x5161d4[_0x20eb('0x22')](_0x5ef0b0[_0x20eb('0x1b')]['ids'],_['omit'](_0x5ef0b0[_0x20eb('0x1b')],[_0x20eb('0x23'),'id'])||{});}})['spread'](function(_0x1ba89e){logger[_0x20eb('0x1f')]('AddTags',_0x5ef0b0);logger[_0x20eb('0x11')](_0x20eb('0x24'),_0x5ef0b0,JSON['stringify'](_0x1ba89e));_0x55f1e8(_0x1ba89e);})[_0x20eb('0x18')](function(_0x48ae21){logger[_0x20eb('0x14')](_0x20eb('0x24'),_0x48ae21[_0x20eb('0x16')],_0x5ef0b0);_0x42455f(_this['error'](0x1f4,_0x48ae21[_0x20eb('0x16')]));});});}; \ No newline at end of file +var _0x0852=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','MailInteraction','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','find','addTags','ids','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./mailInteraction.socket','request','then','info'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0852,0x108));var _0x2085=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x0852[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x2085('0x0'));var util=require('util');var moment=require(_0x2085('0x1'));var BPromise=require(_0x2085('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2085('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2085('0x4'));var logger=require(_0x2085('0x5'))(_0x2085('0x6'));var config=require('../../config/environment');var jayson=require(_0x2085('0x7'));var client=jayson['client'][_0x2085('0x8')]({'port':0x232a});config[_0x2085('0x9')]=_[_0x2085('0xa')](config[_0x2085('0x9')],{'host':_0x2085('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2085('0x9')]));require(_0x2085('0xc'))['register'](socket);function respondWithRpcPromise(_0x11c676,_0x202b56,_0x24ba6a){return new BPromise(function(_0xe39911,_0x26d187){return client[_0x2085('0xd')](_0x11c676,_0x24ba6a)[_0x2085('0xe')](function(_0x939848){logger[_0x2085('0xf')]('MailInteraction,\x20%s,\x20%s',_0x202b56,'request\x20sent');logger[_0x2085('0x10')](_0x2085('0x11'),_0x202b56,'request\x20sent',JSON[_0x2085('0x12')](_0x939848));if(_0x939848[_0x2085('0x13')]){if(_0x939848[_0x2085('0x13')][_0x2085('0x14')]===0x1f4){logger[_0x2085('0x13')](_0x2085('0x15'),_0x202b56,_0x939848[_0x2085('0x13')][_0x2085('0x16')]);return _0x26d187(_0x939848[_0x2085('0x13')][_0x2085('0x16')]);}logger[_0x2085('0x13')](_0x2085('0x15'),_0x202b56,_0x939848[_0x2085('0x13')][_0x2085('0x16')]);return _0xe39911(_0x939848['error'][_0x2085('0x16')]);}else{logger[_0x2085('0xf')]('MailInteraction,\x20%s,\x20%s',_0x202b56,_0x2085('0x17'));_0xe39911(_0x939848[_0x2085('0x18')][_0x2085('0x16')]);}})[_0x2085('0x19')](function(_0x287976){logger[_0x2085('0x13')](_0x2085('0x15'),_0x202b56,_0x287976);_0x26d187(_0x287976);});});}exports['UpdateMailInteraction']=function(_0x3f585c){var _0x4faa53=this;return new Promise(function(_0x1fad14,_0x3f8544){return db[_0x2085('0x1a')][_0x2085('0x1b')](_0x3f585c[_0x2085('0x1c')],{'raw':_0x3f585c[_0x2085('0x1d')]?_0x3f585c[_0x2085('0x1d')][_0x2085('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f585c[_0x2085('0x1d')]?_0x3f585c['options'][_0x2085('0x1f')]||null:null,'attributes':_0x3f585c['options']?_0x3f585c[_0x2085('0x1d')][_0x2085('0x20')]||null:null,'limit':_0x3f585c['options']?_0x3f585c['options'][_0x2085('0x21')]||null:null})[_0x2085('0xe')](function(_0x37d84d){logger[_0x2085('0xf')]('UpdateMailInteraction',_0x3f585c);logger[_0x2085('0x10')](_0x2085('0x22'),_0x3f585c,JSON[_0x2085('0x12')](_0x37d84d));_0x1fad14(_0x37d84d);})[_0x2085('0x19')](function(_0x2cdee1){logger[_0x2085('0x13')](_0x2085('0x22'),_0x2cdee1[_0x2085('0x16')],_0x3f585c);_0x3f8544(_0x4faa53[_0x2085('0x13')](0x1f4,_0x2cdee1['message']));});});};exports['AddTagsToMailInteraction']=function(_0x4224a6){return new Promise(function(_0x2d18f3,_0x18aadd){return db[_0x2085('0x1a')][_0x2085('0x23')]({'where':_0x4224a6['options']?_0x4224a6[_0x2085('0x1d')]['where']||null:null})['then'](function(_0x2f4467){if(_0x2f4467){return _0x2f4467[_0x2085('0x24')](_0x4224a6['body'][_0x2085('0x25')],_['omit'](_0x4224a6[_0x2085('0x1c')],[_0x2085('0x25'),'id'])||{});}})[_0x2085('0x26')](function(_0x545592){logger['info']('AddTags',_0x4224a6);logger[_0x2085('0x10')](_0x2085('0x27'),_0x4224a6,JSON[_0x2085('0x12')](_0x545592));_0x2d18f3(_0x545592);})[_0x2085('0x19')](function(_0xeb8d19){logger[_0x2085('0x13')](_0x2085('0x27'),_0xeb8d19[_0x2085('0x16')],_0x4224a6);_0x18aadd(_this[_0x2085('0x13')](0x1f4,_0xeb8d19['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b47050a..92078ed 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 _0x7779=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7779,0x84));var _0x9777=function(_0x52469e,_0x3579c2){_0x52469e=_0x52469e-0x0;var _0x2e6692=_0x7779[_0x52469e];return _0x2e6692;};'use strict';var MailInteractionEvents=require(_0x9777('0x0'));var events=['save','remove',_0x9777('0x1')];function createListener(_0x244ab7,_0x101db1){return function(_0x4bf3e2){_0x101db1[_0x9777('0x2')](_0x244ab7,_0x4bf3e2);};}function removeListener(_0x3d57bb,_0x45b035){return function(){MailInteractionEvents[_0x9777('0x3')](_0x3d57bb,_0x45b035);};}exports[_0x9777('0x4')]=function(_0x4b387c){for(var _0x11a953=0x0,_0x2e16ad=events[_0x9777('0x5')];_0x11a953<_0x2e16ad;_0x11a953++){var _0x48284a=events[_0x11a953];var _0x85b680=createListener(_0x9777('0x6')+_0x48284a,_0x4b387c);MailInteractionEvents['on'](_0x48284a,_0x85b680);}}; \ No newline at end of file +var _0x5adb=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5adb,0x1d6));var _0xb5ad=function(_0x40f355,_0x27fac0){_0x40f355=_0x40f355-0x0;var _0x1ebb62=_0x5adb[_0x40f355];return _0x1ebb62;};'use strict';var MailInteractionEvents=require(_0xb5ad('0x0'));var events=['save',_0xb5ad('0x1'),_0xb5ad('0x2')];function createListener(_0x4e5d83,_0x25b8ba){return function(_0x55a394){_0x25b8ba[_0xb5ad('0x3')](_0x4e5d83,_0x55a394);};}function removeListener(_0x37869e,_0x280dae){return function(){MailInteractionEvents[_0xb5ad('0x4')](_0x37869e,_0x280dae);};}exports[_0xb5ad('0x5')]=function(_0x410155){for(var _0x17c4ee=0x0,_0x3ef641=events[_0xb5ad('0x6')];_0x17c4ee<_0x3ef641;_0x17c4ee++){var _0x74a3c1=events[_0x17c4ee];var _0x28a5f6=createListener(_0xb5ad('0x7')+_0x74a3c1,_0x410155);MailInteractionEvents['on'](_0x74a3c1,_0x28a5f6);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index e626124..38284eb 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 _0x6183=['/:id','update','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','show','download','post','mail','mailmessage:create','create','put'];(function(_0x437808,_0x5d54e4){var _0x3752ac=function(_0x366aeb){while(--_0x366aeb){_0x437808['push'](_0x437808['shift']());}};_0x3752ac(++_0x5d54e4);}(_0x6183,0x1e2));var _0x3618=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x6183[_0x308374];return _0x1f71e0;};'use strict';var multer=require(_0x3618('0x0'));var util=require(_0x3618('0x1'));var path=require(_0x3618('0x2'));var timeout=require(_0x3618('0x3'));var express=require(_0x3618('0x4'));var router=express[_0x3618('0x5')]();var fs_extra=require(_0x3618('0x6'));var auth=require(_0x3618('0x7'));var interaction=require(_0x3618('0x8'));var config=require(_0x3618('0x9'));var controller=require(_0x3618('0xa'));router[_0x3618('0xb')]('/',auth[_0x3618('0xc')](),controller[_0x3618('0xd')]);router['get'](_0x3618('0xe'),auth[_0x3618('0xc')](),controller['describe']);router[_0x3618('0xb')]('/:id',auth[_0x3618('0xc')](),controller[_0x3618('0xf')]);router[_0x3618('0xb')]('/:id/download',auth[_0x3618('0xc')](),controller[_0x3618('0x10')]);router[_0x3618('0x11')]('/',auth[_0x3618('0xc')](),interaction['tracked'](_0x3618('0x12'),_0x3618('0x13')),controller[_0x3618('0x14')]);router[_0x3618('0x15')](_0x3618('0x16'),auth['isAuthenticated'](),controller[_0x3618('0x17')]);router[_0x3618('0x15')]('/:id/accept',auth[_0x3618('0xc')](),controller[_0x3618('0x18')]);router['put'](_0x3618('0x19'),auth['isAuthenticated'](),controller[_0x3618('0x1a')]);router[_0x3618('0x1b')](_0x3618('0x16'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xac7f=['reject','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','isAuthenticated','/:id','/:id/download','post','tracked','mail','mailmessage:create','put','update','/:id/accept'];(function(_0x541528,_0x332d15){var _0x1fcbce=function(_0x37bdb9){while(--_0x37bdb9){_0x541528['push'](_0x541528['shift']());}};_0x1fcbce(++_0x332d15);}(_0xac7f,0x1e2));var _0xfac7=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xac7f[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0xfac7('0x0'));var util=require('util');var path=require(_0xfac7('0x1'));var timeout=require(_0xfac7('0x2'));var express=require(_0xfac7('0x3'));var router=express['Router']();var fs_extra=require(_0xfac7('0x4'));var auth=require(_0xfac7('0x5'));var interaction=require(_0xfac7('0x6'));var config=require(_0xfac7('0x7'));var controller=require(_0xfac7('0x8'));router[_0xfac7('0x9')]('/',auth['isAuthenticated'](),controller[_0xfac7('0xa')]);router['get'](_0xfac7('0xb'),auth[_0xfac7('0xc')](),controller['describe']);router[_0xfac7('0x9')](_0xfac7('0xd'),auth[_0xfac7('0xc')](),controller['show']);router[_0xfac7('0x9')](_0xfac7('0xe'),auth['isAuthenticated'](),controller['download']);router[_0xfac7('0xf')]('/',auth[_0xfac7('0xc')](),interaction[_0xfac7('0x10')](_0xfac7('0x11'),_0xfac7('0x12')),controller['create']);router[_0xfac7('0x13')](_0xfac7('0xd'),auth[_0xfac7('0xc')](),controller[_0xfac7('0x14')]);router[_0xfac7('0x13')](_0xfac7('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xfac7('0x13')]('/:id/reject',auth[_0xfac7('0xc')](),controller[_0xfac7('0x16')]);router['delete'](_0xfac7('0xd'),auth[_0xfac7('0xc')](),controller['destroy']);module[_0xfac7('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index f715e28..a12c00f 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 _0x9e61=['out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','ENUM'];(function(_0x113f14,_0x13dfbf){var _0x6f133=function(_0x51236c){while(--_0x51236c){_0x113f14['push'](_0x113f14['shift']());}};_0x6f133(++_0x13dfbf);}(_0x9e61,0x149));var _0x19e6=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x9e61[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0x19e6('0x0'));var _=require(_0x19e6('0x1'));module[_0x19e6('0x2')]={'body':{'type':Sequelize[_0x19e6('0x3')](_0x19e6('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x19e6('0x3')](_0x19e6('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x19e6('0x6')]('in',_0x19e6('0x7')),'defaultValue':_0x19e6('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x19e6('0x8')]},'to':{'type':Sequelize[_0x19e6('0x3')](_0x19e6('0x4'))},'cc':{'type':Sequelize[_0x19e6('0x3')](_0x19e6('0x4'))},'bcc':{'type':Sequelize[_0x19e6('0x3')](_0x19e6('0x4'))},'subject':{'type':Sequelize[_0x19e6('0x3')]},'sentAt':{'type':Sequelize[_0x19e6('0x9')]},'attach':{'type':Sequelize[_0x19e6('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x19e6('0xb')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x19e6('0x9')]},'originTo':{'type':Sequelize[_0x19e6('0x3')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x19e6('0x6')](_0x19e6('0xc'),_0x19e6('0xd')),'defaultValue':_0x19e6('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0xc4ef=['exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash'];(function(_0x4ab2b1,_0x31940e){var _0x50b9bc=function(_0x1f7bbc){while(--_0x1f7bbc){_0x4ab2b1['push'](_0x4ab2b1['shift']());}};_0x50b9bc(++_0x31940e);}(_0xc4ef,0x186));var _0xfc4e=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0xc4ef[_0x5ad0d7];return _0xd83bd;};'use strict';var Sequelize=require(_0xfc4e('0x0'));var _=require(_0xfc4e('0x1'));module[_0xfc4e('0x2')]={'body':{'type':Sequelize[_0xfc4e('0x3')](_0xfc4e('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xfc4e('0x5'))},'read':{'type':Sequelize[_0xfc4e('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfc4e('0x7')]('in',_0xfc4e('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xfc4e('0x9')](0x1fe)},'from':{'type':Sequelize[_0xfc4e('0x9')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0xfc4e('0x3')](_0xfc4e('0x4'))},'bcc':{'type':Sequelize[_0xfc4e('0x3')](_0xfc4e('0x4'))},'subject':{'type':Sequelize[_0xfc4e('0x3')]},'sentAt':{'type':Sequelize[_0xfc4e('0xa')]},'attach':{'type':Sequelize[_0xfc4e('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xfc4e('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xfc4e('0x3')]('long')},'originCc':{'type':Sequelize['TEXT'](_0xfc4e('0x4'))},'originChannel':{'type':Sequelize[_0xfc4e('0x7')](_0xfc4e('0xc'),_0xfc4e('0xd')),'defaultValue':_0xfc4e('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index d937e8e..9148f91 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 _0x5395=['sort','where','pick','map','VIRTUAL','filter','MailMessage','includeAll','include','findAll','rows','params','fields','merge','options','body','find','describe','create','direction','out','split','MailAccount','findOne','CmList','List','Contacts','updatedAt','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','format','UserId','user','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','Sequelize','QueryTypes','SIP/%s','download','unix','toString','server','tmp','files','message-%s.eml','from','Attachment','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','register','jayson/promise','client','http','request','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','request\x20sent','catch','status','json','limit','undefined','count','offset','set','update','then','destroy','end','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length'];(function(_0x5cabc4,_0x5b9839){var _0x38f1d6=function(_0x15865a){while(--_0x15865a){_0x5cabc4['push'](_0x5cabc4['shift']());}};_0x38f1d6(++_0x5b9839);}(_0x5395,0x10e));var _0x5539=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5395[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x5539('0x0'));var moment=require(_0x5539('0x1'));var BPromise=require(_0x5539('0x2'));var util=require(_0x5539('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x5539('0x4'));var Redis=require(_0x5539('0x5'));var htmlToText=require(_0x5539('0x6'));var qs=require(_0x5539('0x7'));var logger=require(_0x5539('0x8'))(_0x5539('0x9'));var interaction_log=require(_0x5539('0x8'))(_0x5539('0xa'));var config=require(_0x5539('0xb'));var db=require(_0x5539('0xc'))['db'];config[_0x5539('0xd')]=_[_0x5539('0xe')](config[_0x5539('0xd')],{'host':_0x5539('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5539('0xd')]));var htmlEntities=require(_0x5539('0x10'));require('./mailMessage.socket')[_0x5539('0x11')](socket);var jayson=require(_0x5539('0x12'));var client=jayson[_0x5539('0x13')][_0x5539('0x14')]({'port':0x232c});var client9003=jayson[_0x5539('0x13')][_0x5539('0x14')]({'port':0x232b});var client9002=jayson[_0x5539('0x13')][_0x5539('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x22535a,_0x39fbc4,_0x28731c,_0x2c6239){return new BPromise(function(_0x117517,_0x10856f){var _0x29a487=_0x2c6239||client;return _0x29a487[_0x5539('0x15')](_0x22535a,_0x28731c)['then'](function(_0x322ea5){logger[_0x5539('0x16')]('MailMessage,\x20%s,\x20%s',_0x39fbc4,'request\x20sent');logger[_0x5539('0x17')](_0x5539('0x18'),_0x39fbc4,'request\x20sent',JSON[_0x5539('0x19')](_0x322ea5));if(_0x322ea5[_0x5539('0x1a')]){if(_0x322ea5[_0x5539('0x1a')][_0x5539('0x1b')]===0x1f4){logger['error'](_0x5539('0x1c'),_0x39fbc4,_0x322ea5[_0x5539('0x1a')][_0x5539('0x1d')]);return _0x10856f(_0x322ea5[_0x5539('0x1a')][_0x5539('0x1d')]);}logger[_0x5539('0x1a')](_0x5539('0x1c'),_0x39fbc4,_0x322ea5[_0x5539('0x1a')]['message']);return _0x117517(_0x322ea5[_0x5539('0x1a')][_0x5539('0x1d')]);}else{logger[_0x5539('0x16')](_0x5539('0x1c'),_0x39fbc4,_0x5539('0x1e'));_0x117517(_0x322ea5['result']['message']);}})[_0x5539('0x1f')](function(_0x2eab7f){logger[_0x5539('0x1a')](_0x5539('0x1c'),_0x39fbc4,_0x2eab7f);_0x10856f(_0x2eab7f);});});}function respondWithResult(_0xabe2c4,_0x190312){_0x190312=_0x190312||0xc8;return function(_0x5d6ab3){if(_0x5d6ab3){return _0xabe2c4[_0x5539('0x20')](_0x190312)[_0x5539('0x21')](_0x5d6ab3);}};}function respondWithFilteredResult(_0x2ea5e3,_0x245bae){return function(_0x50a9ee){if(_0x50a9ee){var _0xb04980=typeof _0x245bae['offset']==='undefined'&&typeof _0x245bae[_0x5539('0x22')]===_0x5539('0x23');var _0xfe5be=_0x50a9ee[_0x5539('0x24')];var _0x1043b1=_0xb04980?0x0:_0x245bae[_0x5539('0x25')];var _0x43d322=_0xb04980?_0x50a9ee['count']:_0x245bae[_0x5539('0x25')]+_0x245bae[_0x5539('0x22')];var _0x5b7b47;if(_0x43d322>=_0xfe5be){_0x43d322=_0xfe5be;_0x5b7b47=0xc8;}else{_0x5b7b47=0xce;}_0x2ea5e3[_0x5539('0x20')](_0x5b7b47);return _0x2ea5e3[_0x5539('0x26')]('Content-Range',_0x1043b1+'-'+_0x43d322+'/'+_0xfe5be)[_0x5539('0x21')](_0x50a9ee);}return null;};}function saveUpdates(_0x10b500){return function(_0x364dbf){if(_0x364dbf){return _0x364dbf[_0x5539('0x27')](_0x10b500)[_0x5539('0x28')](function(_0x368f36){return _0x368f36;});}return null;};}function removeEntity(_0x22d51){return function(_0x2765f7){if(_0x2765f7){return _0x2765f7[_0x5539('0x29')]()[_0x5539('0x28')](function(){_0x22d51[_0x5539('0x20')](0xcc)[_0x5539('0x2a')]();});}};}function handleEntityNotFound(_0x4510f9){return function(_0x4bab50){if(!_0x4bab50){_0x4510f9[_0x5539('0x2b')](0x194);}return _0x4bab50;};}function handleError(_0x14f6f2,_0x3dbbc9){_0x3dbbc9=_0x3dbbc9||0x1f4;return function(_0x11c480){logger[_0x5539('0x1a')](_0x11c480['stack']);if(_0x11c480['name']){delete _0x11c480[_0x5539('0x2c')];}_0x14f6f2[_0x5539('0x20')](_0x3dbbc9)[_0x5539('0x2d')](_0x11c480);};}exports[_0x5539('0x2e')]=function(_0x33f464,_0x1398f9){var _0x2d747f={},_0x1d1d5b={},_0x5016c3={'count':0x0,'rows':[]};var _0x50c591=_['map'](db['MailMessage'][_0x5539('0x2f')],function(_0x18d2ff){return{'name':_0x18d2ff[_0x5539('0x30')],'type':_0x18d2ff[_0x5539('0x31')][_0x5539('0x32')]};});_0x1d1d5b[_0x5539('0x33')]=_['map'](_0x50c591,'name');_0x1d1d5b[_0x5539('0x34')]=_[_0x5539('0x35')](_0x33f464['query']);_0x1d1d5b[_0x5539('0x36')]=_[_0x5539('0x37')](_0x1d1d5b[_0x5539('0x33')],_0x1d1d5b[_0x5539('0x34')]);_0x2d747f[_0x5539('0x38')]=_[_0x5539('0x37')](_0x1d1d5b[_0x5539('0x33')],qs['fields'](_0x33f464[_0x5539('0x34')]['fields']));_0x2d747f[_0x5539('0x38')]=_0x2d747f[_0x5539('0x38')][_0x5539('0x39')]?_0x2d747f[_0x5539('0x38')]:_0x1d1d5b[_0x5539('0x33')];if(!_0x33f464[_0x5539('0x34')]['hasOwnProperty']('nolimit')){_0x2d747f[_0x5539('0x22')]=qs[_0x5539('0x22')](_0x33f464[_0x5539('0x34')]['limit']);_0x2d747f['offset']=qs[_0x5539('0x25')](_0x33f464[_0x5539('0x34')][_0x5539('0x25')]);}_0x2d747f['order']=qs['sort'](_0x33f464[_0x5539('0x34')][_0x5539('0x3a')]);_0x2d747f[_0x5539('0x3b')]=qs['filters'](_[_0x5539('0x3c')](_0x33f464[_0x5539('0x34')],_0x1d1d5b[_0x5539('0x36')]),_0x50c591);if(_0x33f464[_0x5539('0x34')]['filter']){_0x2d747f[_0x5539('0x3b')]=_['merge'](_0x2d747f[_0x5539('0x3b')],{'$or':_[_0x5539('0x3d')](_0x50c591,function(_0x3560a9){if(_0x3560a9[_0x5539('0x31')]!==_0x5539('0x3e')){var _0x2df2e6={};_0x2df2e6[_0x3560a9['name']]={'$like':'%'+_0x33f464[_0x5539('0x34')][_0x5539('0x3f')]+'%'};return _0x2df2e6;}})});}_0x2d747f=_['merge']({},_0x2d747f,_0x33f464['options']);var _0x75c234={'where':_0x2d747f['where']};return db[_0x5539('0x40')]['count'](_0x75c234)[_0x5539('0x28')](function(_0xe2b2b7){_0x5016c3[_0x5539('0x24')]=_0xe2b2b7;if(_0x33f464[_0x5539('0x34')][_0x5539('0x41')]){_0x2d747f[_0x5539('0x42')]=[{'all':!![]}];}return db['MailMessage'][_0x5539('0x43')](_0x2d747f);})['then'](function(_0xd4356a){_0x5016c3[_0x5539('0x44')]=_0xd4356a;return _0x5016c3;})[_0x5539('0x28')](respondWithFilteredResult(_0x1398f9,_0x2d747f))[_0x5539('0x1f')](handleError(_0x1398f9,null));};exports['show']=function(_0x18369c,_0x5a3df7){var _0x5d159a={'raw':!![],'where':{'id':_0x18369c[_0x5539('0x45')]['id']}},_0x1c80ee={};_0x1c80ee['model']=_[_0x5539('0x35')](db[_0x5539('0x40')][_0x5539('0x2f')]);_0x1c80ee['query']=_[_0x5539('0x35')](_0x18369c[_0x5539('0x34')]);_0x1c80ee[_0x5539('0x36')]=_['intersection'](_0x1c80ee[_0x5539('0x33')],_0x1c80ee[_0x5539('0x34')]);_0x5d159a[_0x5539('0x38')]=_[_0x5539('0x37')](_0x1c80ee[_0x5539('0x33')],qs[_0x5539('0x46')](_0x18369c[_0x5539('0x34')]['fields']));_0x5d159a[_0x5539('0x38')]=_0x5d159a['attributes'][_0x5539('0x39')]?_0x5d159a[_0x5539('0x38')]:_0x1c80ee['model'];if(_0x18369c[_0x5539('0x34')][_0x5539('0x41')]){_0x5d159a[_0x5539('0x42')]=[{'all':!![]}];}_0x5d159a=_[_0x5539('0x47')]({},_0x5d159a,_0x18369c[_0x5539('0x48')]);return db[_0x5539('0x40')]['find'](_0x5d159a)[_0x5539('0x28')](handleEntityNotFound(_0x5a3df7,null))[_0x5539('0x28')](respondWithResult(_0x5a3df7,null))['catch'](handleError(_0x5a3df7,null));};exports[_0x5539('0x27')]=function(_0x1c38ef,_0x32c871){if(_0x1c38ef['body']['id']){delete _0x1c38ef[_0x5539('0x49')]['id'];}return db[_0x5539('0x40')][_0x5539('0x4a')]({'where':{'id':_0x1c38ef['params']['id']}})[_0x5539('0x28')](handleEntityNotFound(_0x32c871,null))[_0x5539('0x28')](saveUpdates(_0x1c38ef[_0x5539('0x49')],null))[_0x5539('0x28')](respondWithResult(_0x32c871,null))[_0x5539('0x1f')](handleError(_0x32c871,null));};exports[_0x5539('0x29')]=function(_0xd16ec0,_0xe6a922){return db[_0x5539('0x40')]['find']({'where':{'id':_0xd16ec0[_0x5539('0x45')]['id']}})[_0x5539('0x28')](handleEntityNotFound(_0xe6a922,null))[_0x5539('0x28')](removeEntity(_0xe6a922,null))[_0x5539('0x1f')](handleError(_0xe6a922,null));};exports[_0x5539('0x4b')]=function(_0x424b8e,_0x41ec19){return db['MailMessage'][_0x5539('0x4b')]()[_0x5539('0x28')](respondWithResult(_0x41ec19,null))[_0x5539('0x1f')](handleError(_0x41ec19,null));};exports['create']=function(_0x4ad260,_0x430369){return db[_0x5539('0x40')][_0x5539('0x4c')](_0x4ad260[_0x5539('0x49')])[_0x5539('0x28')](function(_0x391890){if(_0x391890){if(_0x391890[_0x5539('0x4d')]===_0x5539('0x4e')&&!_0x391890['secret']){var _0x13699e,_0xc0806d,_0x5a3c6a;if(_0x4ad260[_0x5539('0x49')]['to']){_0xc0806d=_0x4ad260[_0x5539('0x49')]['to'][_0x5539('0x4f')](',')[0x0];}return db[_0x5539('0x50')][_0x5539('0x51')]({'where':{'id':_0x391890['MailAccountId']},'include':[{'model':db[_0x5539('0x52')],'as':_0x5539('0x53'),'include':[{'model':db['CmContact'],'as':_0x5539('0x54'),'where':{'email':_0xc0806d},'limit':0x1,'order':[[_0x5539('0x55'),'DESC']]}]},{'model':db[_0x5539('0x56')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5539('0x57')],'as':_0x5539('0x57'),'raw':!![]}]}]})['then'](function(_0x344c65){_0x13699e=_0x344c65;if(!_0x13699e||!_0x13699e[_0x5539('0x58')])return;var _0xc0aba3=_0x13699e[_0x5539('0x59')]();if(_0x4ad260[_0x5539('0x49')][_0x5539('0x5a')]&&_0x4ad260['body'][_0x5539('0x5a')][_0x5539('0x39')]){for(var _0x11ff5a=0x0;_0x11ff5a<_0x4ad260[_0x5539('0x49')]['attachments'][_0x5539('0x39')];_0x11ff5a+=0x1){_0x4ad260['body']['attachments'][_0x11ff5a]={'filename':_0x4ad260[_0x5539('0x49')][_0x5539('0x5a')][_0x11ff5a][_0x5539('0x2c')],'path':path[_0x5539('0x5b')](config[_0x5539('0x5c')],_0x5539('0x5d'),_0x4ad260[_0x5539('0x49')][_0x5539('0x5a')][_0x11ff5a]['basename'])};}}_0x5a3c6a={'account':_0xc0aba3,'message':_0x4ad260[_0x5539('0x49')]};return;})[_0x5539('0x28')](function(){if(_0x13699e[_0x5539('0x53')]){if(_0x13699e['List'][_0x5539('0x54')][_0x5539('0x39')]){return _0x13699e[_0x5539('0x53')][_0x5539('0x54')][0x0];}else{return db['CmContact'][_0x5539('0x4c')](_[_0x5539('0xe')](_0x4ad260[_0x5539('0x49')],{'firstName':_0x4ad260[_0x5539('0x49')]['to'],'email':_0x4ad260[_0x5539('0x49')]['to'],'phone':_0x4ad260[_0x5539('0x49')]['to'],'ListId':_0x13699e[_0x5539('0x5e')]}));}}else{throw new Error(_0x5539('0x5f'));}})[_0x5539('0x28')](function(){if(_0x5a3c6a){return respondWithRpcPromise(_0x5539('0x60'),_0x5539('0x61'),_0x5a3c6a,client9003)['then'](function(_0x506e77){return _0x391890['update']({'read':!![],'messageId':_0x506e77[_0x5539('0x62')],'sentAt':moment()['format'](_0x5539('0x63'))});})[_0x5539('0x1f')](function(_0x5ab7cd){logger['error']('%s',JSON['stringify'](_0x5ab7cd));return _0x391890;});}return _0x391890;});}return _0x391890;}})[_0x5539('0x28')](respondWithResult(_0x430369,0xc9))[_0x5539('0x1f')](handleError(_0x430369,null));};exports['accept']=function(_0x8d2260,_0x4d7cc6){var _0x450042={'agent':{},'channel':_0x5539('0x64')};if(_0x8d2260[_0x5539('0x49')]['id']){delete _0x8d2260[_0x5539('0x49')]['id'];}_0x8d2260['body'][_0x5539('0x65')]=!![];_0x8d2260['body'][_0x5539('0x66')]=moment()[_0x5539('0x67')](_0x5539('0x63'));_0x8d2260[_0x5539('0x49')][_0x5539('0x68')]=_0x8d2260[_0x5539('0x49')][_0x5539('0x68')]||_0x8d2260[_0x5539('0x69')]['id'];_0x450042['agent']['id']=_0x8d2260[_0x5539('0x49')]['UserId'];return db[_0x5539('0x40')][_0x5539('0x4a')]({'where':{'id':_0x8d2260[_0x5539('0x45')]['id'],'UserId':null}})[_0x5539('0x28')](handleEntityNotFound(_0x4d7cc6,null))[_0x5539('0x28')](saveUpdates(_0x8d2260[_0x5539('0x49')],null))['then'](function(_0x1e793f){if(_0x1e793f){_0x450042[_0x5539('0x1d')]=_0x1e793f[_0x5539('0x6a')]({'plain':!![]});return db[_0x5539('0x6b')][_0x5539('0x4a')]({'where':{'id':_0x1e793f[_0x5539('0x6c')]}});}return null;})[_0x5539('0x28')](handleEntityNotFound(_0x4d7cc6,null))[_0x5539('0x28')](function(_0x4e4c90){if(_0x4e4c90){return _0x4e4c90['update']({'UserId':_0x8d2260[_0x5539('0x49')][_0x5539('0x68')],'read1stAt':_[_0x5539('0x6d')](_0x4e4c90[_0x5539('0x6e')])?moment()[_0x5539('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x69589d){if(_0x69589d){_0x450042[_0x5539('0x6f')]=_0x69589d[_0x5539('0x6a')]({'plain':!![]});interaction_log['info'](_0x5539('0x70'),_0x8d2260[_0x5539('0x69')]['id'],_0x8d2260[_0x5539('0x69')][_0x5539('0x2c')],_0x8d2260[_0x5539('0x69')][_0x5539('0x71')],_0x450042['interaction']['id'],_0x8d2260[_0x5539('0x49')]?JSON[_0x5539('0x19')](_0x8d2260['body']):'null');return respondWithRpcPromise(_0x5539('0x72'),_0x5539('0x73'),_0x450042);}return null;})[_0x5539('0x28')](function(_0x258769){var _0x82464e=_0x5539('0x74')+_0x258769[_0x5539('0x1d')][_0x5539('0x75')];return db[_0x5539('0x76')]['query'](_0x82464e,{'type':db['Sequelize']['QueryTypes'][_0x5539('0x77')],'raw':!![]})[_0x5539('0x28')](function(_0x2e3061){return _0x2e3061;});})[_0x5539('0x28')](function(_0x45c8bb){if(_0x45c8bb){_0x450042[_0x5539('0x1d')][_0x5539('0x78')]=_0x45c8bb[0x0];if(!_0x8d2260[_0x5539('0x49')]['UserId'])return;return db[_0x5539('0x79')][_0x5539('0x4a')]({'where':{'id':_0x8d2260[_0x5539('0x49')][_0x5539('0x68')],'role':_0x5539('0x7a')},'attributes':['id',_0x5539('0x2c'),_0x5539('0x7b'),_0x5539('0x7c'),_0x5539('0x7d')],'raw':!![]});}return null;})[_0x5539('0x28')](function(_0xcdcf54){if(!_0xcdcf54)return null;_0x450042[_0x5539('0x1d')][_0x5539('0x7a')]=_0xcdcf54;return _0x450042;})[_0x5539('0x28')](function(_0x465ef9){if(_0x465ef9){if(_0x8d2260[_0x5539('0x49')][_0x5539('0x7e')]){_0x450042['message'][_0x5539('0x7f')]=util[_0x5539('0x67')]('SIP/%s',_0x8d2260[_0x5539('0x69')]['name']);_0x450042[_0x5539('0x1d')][_0x5539('0x80')]=_0x450042['channel'];_0x450042[_0x5539('0x1d')][_0x5539('0x81')]=_0x450042[_0x5539('0x80')];_0x450042[_0x5539('0x1d')][_0x5539('0x82')]=_0x5539('0x83');_0x450042[_0x5539('0x1d')]['body']=htmlToText[_0x5539('0x84')](_0x450042['message'][_0x5539('0x49')]);return respondWithRpcPromise(_0x5539('0x85'),_0x5539('0x85'),{'event':_0x5539('0x86'),'message':_0x450042[_0x5539('0x1d')]},client9002)[_0x5539('0x28')](function(){return _0x450042;});}return _0x450042;}return null;})[_0x5539('0x28')](respondWithResult(_0x4d7cc6,null))['catch'](handleError(_0x4d7cc6,null));};exports[_0x5539('0x87')]=function(_0x4edbfc,_0x1b1f6a){var _0x4bd79b={'agent':{},'channel':'mail'};if(_0x4edbfc[_0x5539('0x49')]['id']){delete _0x4edbfc[_0x5539('0x49')]['id'];}_0x4edbfc['body'][_0x5539('0x68')]=_0x4edbfc[_0x5539('0x49')][_0x5539('0x68')]||_0x4edbfc[_0x5539('0x69')]['id'];_0x4bd79b[_0x5539('0x7a')]['id']=_0x4edbfc[_0x5539('0x49')][_0x5539('0x68')];return db['MailMessage'][_0x5539('0x4a')]({'where':{'id':_0x4edbfc[_0x5539('0x45')]['id'],'UserId':null}})[_0x5539('0x28')](handleEntityNotFound(_0x1b1f6a,null))[_0x5539('0x28')](function(_0x44c776){if(_0x44c776){_0x4bd79b[_0x5539('0x1d')]=_0x44c776[_0x5539('0x6a')]({'plain':!![]});return db[_0x5539('0x6b')][_0x5539('0x4a')]({'where':{'id':_0x44c776[_0x5539('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x1b1f6a,null))['then'](function(_0x45894a){if(_0x45894a){_0x4bd79b[_0x5539('0x6f')]=_0x45894a['get']({'plain':!![]});interaction_log[_0x5539('0x16')](_0x5539('0x88'),_0x4edbfc[_0x5539('0x69')]['id'],_0x4edbfc[_0x5539('0x69')][_0x5539('0x2c')],_0x4edbfc[_0x5539('0x69')]['role'],_0x4bd79b[_0x5539('0x6f')]['id'],_0x4edbfc['body']?JSON[_0x5539('0x19')](_0x4edbfc[_0x5539('0x49')]):_0x5539('0x89'));return respondWithRpcPromise(_0x5539('0x8a'),'rejectMessage',_0x4bd79b);}return null;})[_0x5539('0x28')](function(_0xceadd1){var _0x257294='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xceadd1[_0x5539('0x1d')][_0x5539('0x75')];return db[_0x5539('0x76')]['query'](_0x257294,{'type':db[_0x5539('0x8b')][_0x5539('0x8c')][_0x5539('0x77')],'raw':!![]})[_0x5539('0x28')](function(_0x18fe8c){return _0x18fe8c;});})[_0x5539('0x28')](function(_0x39c24b){if(_0x39c24b){_0x4bd79b[_0x5539('0x1d')][_0x5539('0x78')]=_0x39c24b[0x0];if(!_0x4edbfc[_0x5539('0x49')][_0x5539('0x68')])return;return db[_0x5539('0x79')][_0x5539('0x4a')]({'where':{'id':_0x4edbfc[_0x5539('0x49')][_0x5539('0x68')],'role':'agent'},'attributes':['id',_0x5539('0x2c'),_0x5539('0x7b'),_0x5539('0x7c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3d6e87){if(!_0x3d6e87)return null;_0x4bd79b['message'][_0x5539('0x7a')]=_0x3d6e87;return _0x4bd79b;})[_0x5539('0x28')](function(_0x469ec6){if(_0x469ec6){_0x469ec6['message'][_0x5539('0x7f')]=util[_0x5539('0x67')](_0x5539('0x8d'),_0x4edbfc[_0x5539('0x69')][_0x5539('0x2c')]);_0x469ec6['message']['channel']=_0x4bd79b[_0x5539('0x80')];_0x469ec6[_0x5539('0x1d')][_0x5539('0x81')]=_0x4bd79b[_0x5539('0x80')];_0x469ec6['message']['event']=_0x5539('0x87');_0x469ec6[_0x5539('0x1d')][_0x5539('0x49')]=htmlToText[_0x5539('0x84')](_0x4bd79b[_0x5539('0x1d')]['body']);respondWithRpcPromise(_0x5539('0x85'),'EventManager',{'event':'rejectmessage','message':_0x469ec6['message']},client9002);return _0x4bd79b;}return null;})[_0x5539('0x28')](respondWithResult(_0x1b1f6a,null))[_0x5539('0x1f')](handleError(_0x1b1f6a,null));};exports[_0x5539('0x8e')]=function(_0x3f6f24,_0x242966){var _0x2074da=moment()[_0x5539('0x8f')]()[_0x5539('0x90')]();var _0x4d90b5=path[_0x5539('0x5b')](config[_0x5539('0x5c')],_0x5539('0x91'),'files',_0x5539('0x92'));var _0x51d6b8=path[_0x5539('0x5b')](config[_0x5539('0x5c')],'server',_0x5539('0x93'),_0x5539('0x5a'));var _0x1b92a6=util[_0x5539('0x67')](_0x5539('0x94'),_0x2074da);return db[_0x5539('0x40')][_0x5539('0x4a')]({'where':{'id':_0x3f6f24['params']['id']},'attributes':['id',_0x5539('0x49'),_0x5539('0x95'),'to','cc','bcc','subject','createdAt'],'include':_0x3f6f24['query'][_0x5539('0x5a')]?[{'model':db[_0x5539('0x96')],'as':'Attachments'}]:undefined})[_0x5539('0x28')](handleEntityNotFound(_0x242966,null))[_0x5539('0x28')](function(_0x28b4b9){if(_0x28b4b9){var _0x3c9874=_0x28b4b9;var _0x459763={'from':_0x3c9874['from'],'to':_0x3c9874['to'],'subject':_0x3c9874[_0x5539('0x97')],'html':htmlEntities[_0x5539('0x98')](_0x3c9874['body']),'headers':{'Date':moment(_0x3c9874[_0x5539('0x99')])[_0x5539('0x67')](_0x5539('0x9a'))},'attachments':[]};if(_0x28b4b9['cc']){_0x459763[_0x5539('0x9b')]['Cc']=_0x28b4b9['cc'];}if(_0x28b4b9[_0x5539('0x9c')]){_0x459763[_0x5539('0x9b')]['Bcc']=_0x28b4b9[_0x5539('0x9c')];}return new BPromise(function(_0x220028,_0x56a243){if(_0x28b4b9['Attachments']){for(var _0x3b0c33=0x0;_0x3b0c33<_0x28b4b9[_0x5539('0x9d')][_0x5539('0x39')];_0x3b0c33++){var _0x21c965=_0x28b4b9[_0x5539('0x9d')][_0x3b0c33];var _0x3e5e12=path['join'](_0x51d6b8,_0x21c965['basename']);if(fs[_0x5539('0x9e')](_0x3e5e12)){_0x459763[_0x5539('0x5a')][_0x5539('0x9f')]({'name':_0x21c965[_0x5539('0x2c')],'contentType':_0x21c965[_0x5539('0x31')],'data':fs[_0x5539('0xa0')](_0x3e5e12)});}}}emlformat[_0x5539('0xa1')](_0x459763,function(_0x285720,_0x1d9079){if(_0x285720)return _0x56a243(_0x285720);fs[_0x5539('0xa2')](path[_0x5539('0x5b')](_0x4d90b5,_0x1b92a6),_0x1d9079);return _0x220028(_0x1d9079);});});}})[_0x5539('0x28')](function(_0x52ff77){if(_0x52ff77){return _0x242966[_0x5539('0x8e')](path[_0x5539('0x5b')](_0x4d90b5,_0x1b92a6),_0x1b92a6,function(_0x498271){if(!_0x498271)fs[_0x5539('0xa3')](path[_0x5539('0x5b')](_0x4d90b5,_0x1b92a6));});}})[_0x5539('0x1f')](handleError(_0x242966,null));}; \ No newline at end of file +var _0xffe3=['socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','offset','undefined','count','limit','Content-Range','update','destroy','stack','name','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','filter','includeAll','findAll','rows','show','params','length','include','options','find','body','describe','create','out','secret','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','reject','RejectMessage','rejectMessage','ContactId','fromString','download','toString','server','tmp','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','Bcc','readFileSync','build','unlinkSync','moment','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','redis'];(function(_0x4a74e8,_0xb3cafa){var _0xba9564=function(_0x280eab){while(--_0x280eab){_0x4a74e8['push'](_0x4a74e8['shift']());}};_0xba9564(++_0xb3cafa);}(_0xffe3,0x1ab));var _0x3ffe=function(_0x151b08,_0x259eea){_0x151b08=_0x151b08-0x0;var _0x1562b4=_0xffe3[_0x151b08];return _0x1562b4;};'use strict';var emlformat=require('eml-format');var moment=require(_0x3ffe('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x3ffe('0x1'));var fs=require('fs');var _=require(_0x3ffe('0x2'));var Redis=require('ioredis');var htmlToText=require(_0x3ffe('0x3'));var qs=require(_0x3ffe('0x4'));var logger=require('../../config/logger')('api');var interaction_log=require(_0x3ffe('0x5'))(_0x3ffe('0x6'));var config=require(_0x3ffe('0x7'));var db=require(_0x3ffe('0x8'))['db'];config['redis']=_[_0x3ffe('0x9')](config[_0x3ffe('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ffe('0xb'))(new Redis(config[_0x3ffe('0xa')]));var htmlEntities=require(_0x3ffe('0xc'));require(_0x3ffe('0xd'))['register'](socket);var jayson=require(_0x3ffe('0xe'));var client=jayson[_0x3ffe('0xf')][_0x3ffe('0x10')]({'port':0x232c});var client9003=jayson[_0x3ffe('0xf')]['http']({'port':0x232b});var client9002=jayson[_0x3ffe('0xf')][_0x3ffe('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x2df04f,_0x4163e1,_0x20cc5b,_0x498264){return new BPromise(function(_0x38169b,_0x1fdbcc){var _0xf592b3=_0x498264||client;return _0xf592b3[_0x3ffe('0x11')](_0x2df04f,_0x20cc5b)[_0x3ffe('0x12')](function(_0x7b08f7){logger[_0x3ffe('0x13')](_0x3ffe('0x14'),_0x4163e1,'request\x20sent');logger['debug'](_0x3ffe('0x15'),_0x4163e1,_0x3ffe('0x16'),JSON['stringify'](_0x7b08f7));if(_0x7b08f7[_0x3ffe('0x17')]){if(_0x7b08f7[_0x3ffe('0x17')][_0x3ffe('0x18')]===0x1f4){logger[_0x3ffe('0x17')]('MailMessage,\x20%s,\x20%s',_0x4163e1,_0x7b08f7[_0x3ffe('0x17')][_0x3ffe('0x19')]);return _0x1fdbcc(_0x7b08f7[_0x3ffe('0x17')][_0x3ffe('0x19')]);}logger[_0x3ffe('0x17')](_0x3ffe('0x14'),_0x4163e1,_0x7b08f7['error'][_0x3ffe('0x19')]);return _0x38169b(_0x7b08f7[_0x3ffe('0x17')]['message']);}else{logger['info'](_0x3ffe('0x14'),_0x4163e1,_0x3ffe('0x16'));_0x38169b(_0x7b08f7[_0x3ffe('0x1a')][_0x3ffe('0x19')]);}})[_0x3ffe('0x1b')](function(_0x1e6958){logger[_0x3ffe('0x17')](_0x3ffe('0x14'),_0x4163e1,_0x1e6958);_0x1fdbcc(_0x1e6958);});});}function respondWithResult(_0x39d523,_0x555f01){_0x555f01=_0x555f01||0xc8;return function(_0x28dcef){if(_0x28dcef){return _0x39d523[_0x3ffe('0x1c')](_0x555f01)[_0x3ffe('0x1d')](_0x28dcef);}};}function respondWithFilteredResult(_0x3d5ca2,_0x15101e){return function(_0x30d569){if(_0x30d569){var _0x1622df=typeof _0x15101e[_0x3ffe('0x1e')]===_0x3ffe('0x1f')&&typeof _0x15101e['limit']==='undefined';var _0x18850d=_0x30d569['count'];var _0x3b0c11=_0x1622df?0x0:_0x15101e[_0x3ffe('0x1e')];var _0x4ccbb5=_0x1622df?_0x30d569[_0x3ffe('0x20')]:_0x15101e[_0x3ffe('0x1e')]+_0x15101e[_0x3ffe('0x21')];var _0x2f7967;if(_0x4ccbb5>=_0x18850d){_0x4ccbb5=_0x18850d;_0x2f7967=0xc8;}else{_0x2f7967=0xce;}_0x3d5ca2[_0x3ffe('0x1c')](_0x2f7967);return _0x3d5ca2['set'](_0x3ffe('0x22'),_0x3b0c11+'-'+_0x4ccbb5+'/'+_0x18850d)[_0x3ffe('0x1d')](_0x30d569);}return null;};}function saveUpdates(_0x4a076f){return function(_0x2e924b){if(_0x2e924b){return _0x2e924b[_0x3ffe('0x23')](_0x4a076f)['then'](function(_0x24da4b){return _0x24da4b;});}return null;};}function removeEntity(_0x4e97aa){return function(_0x3a60c1){if(_0x3a60c1){return _0x3a60c1[_0x3ffe('0x24')]()[_0x3ffe('0x12')](function(){_0x4e97aa[_0x3ffe('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4046ac){return function(_0xc916c3){if(!_0xc916c3){_0x4046ac['sendStatus'](0x194);}return _0xc916c3;};}function handleError(_0x334935,_0x33a6b1){_0x33a6b1=_0x33a6b1||0x1f4;return function(_0x5b736c){logger[_0x3ffe('0x17')](_0x5b736c[_0x3ffe('0x25')]);if(_0x5b736c[_0x3ffe('0x26')]){delete _0x5b736c[_0x3ffe('0x26')];}_0x334935[_0x3ffe('0x1c')](_0x33a6b1)['send'](_0x5b736c);};}exports['index']=function(_0x57bd35,_0x91263b){var _0x1d04f5={},_0x33ac3a={},_0x3195a1={'count':0x0,'rows':[]};var _0x482f5a=_[_0x3ffe('0x27')](db[_0x3ffe('0x28')][_0x3ffe('0x29')],function(_0x4cc468){return{'name':_0x4cc468[_0x3ffe('0x2a')],'type':_0x4cc468[_0x3ffe('0x2b')]['key']};});_0x33ac3a[_0x3ffe('0x2c')]=_[_0x3ffe('0x27')](_0x482f5a,_0x3ffe('0x26'));_0x33ac3a[_0x3ffe('0x2d')]=_[_0x3ffe('0x2e')](_0x57bd35[_0x3ffe('0x2d')]);_0x33ac3a[_0x3ffe('0x2f')]=_[_0x3ffe('0x30')](_0x33ac3a[_0x3ffe('0x2c')],_0x33ac3a[_0x3ffe('0x2d')]);_0x1d04f5[_0x3ffe('0x31')]=_['intersection'](_0x33ac3a[_0x3ffe('0x2c')],qs[_0x3ffe('0x32')](_0x57bd35[_0x3ffe('0x2d')][_0x3ffe('0x32')]));_0x1d04f5['attributes']=_0x1d04f5[_0x3ffe('0x31')]['length']?_0x1d04f5[_0x3ffe('0x31')]:_0x33ac3a[_0x3ffe('0x2c')];if(!_0x57bd35[_0x3ffe('0x2d')][_0x3ffe('0x33')](_0x3ffe('0x34'))){_0x1d04f5[_0x3ffe('0x21')]=qs[_0x3ffe('0x21')](_0x57bd35[_0x3ffe('0x2d')][_0x3ffe('0x21')]);_0x1d04f5['offset']=qs[_0x3ffe('0x1e')](_0x57bd35['query'][_0x3ffe('0x1e')]);}_0x1d04f5[_0x3ffe('0x35')]=qs[_0x3ffe('0x36')](_0x57bd35[_0x3ffe('0x2d')][_0x3ffe('0x36')]);_0x1d04f5['where']=qs['filters'](_[_0x3ffe('0x37')](_0x57bd35[_0x3ffe('0x2d')],_0x33ac3a[_0x3ffe('0x2f')]),_0x482f5a);if(_0x57bd35[_0x3ffe('0x2d')]['filter']){_0x1d04f5[_0x3ffe('0x38')]=_['merge'](_0x1d04f5[_0x3ffe('0x38')],{'$or':_['map'](_0x482f5a,function(_0x26b583){if(_0x26b583['type']!=='VIRTUAL'){var _0x2d3c55={};_0x2d3c55[_0x26b583[_0x3ffe('0x26')]]={'$like':'%'+_0x57bd35[_0x3ffe('0x2d')][_0x3ffe('0x39')]+'%'};return _0x2d3c55;}})});}_0x1d04f5=_['merge']({},_0x1d04f5,_0x57bd35['options']);var _0x3c03e6={'where':_0x1d04f5[_0x3ffe('0x38')]};return db[_0x3ffe('0x28')][_0x3ffe('0x20')](_0x3c03e6)[_0x3ffe('0x12')](function(_0x20a75f){_0x3195a1['count']=_0x20a75f;if(_0x57bd35[_0x3ffe('0x2d')][_0x3ffe('0x3a')]){_0x1d04f5['include']=[{'all':!![]}];}return db[_0x3ffe('0x28')][_0x3ffe('0x3b')](_0x1d04f5);})[_0x3ffe('0x12')](function(_0x3e0880){_0x3195a1[_0x3ffe('0x3c')]=_0x3e0880;return _0x3195a1;})[_0x3ffe('0x12')](respondWithFilteredResult(_0x91263b,_0x1d04f5))['catch'](handleError(_0x91263b,null));};exports[_0x3ffe('0x3d')]=function(_0x3ec69f,_0x4b818d){var _0x8f70d={'raw':!![],'where':{'id':_0x3ec69f[_0x3ffe('0x3e')]['id']}},_0x30bfbe={};_0x30bfbe[_0x3ffe('0x2c')]=_['keys'](db[_0x3ffe('0x28')][_0x3ffe('0x29')]);_0x30bfbe[_0x3ffe('0x2d')]=_[_0x3ffe('0x2e')](_0x3ec69f[_0x3ffe('0x2d')]);_0x30bfbe['filters']=_[_0x3ffe('0x30')](_0x30bfbe['model'],_0x30bfbe[_0x3ffe('0x2d')]);_0x8f70d[_0x3ffe('0x31')]=_[_0x3ffe('0x30')](_0x30bfbe[_0x3ffe('0x2c')],qs[_0x3ffe('0x32')](_0x3ec69f[_0x3ffe('0x2d')][_0x3ffe('0x32')]));_0x8f70d[_0x3ffe('0x31')]=_0x8f70d[_0x3ffe('0x31')][_0x3ffe('0x3f')]?_0x8f70d['attributes']:_0x30bfbe[_0x3ffe('0x2c')];if(_0x3ec69f[_0x3ffe('0x2d')][_0x3ffe('0x3a')]){_0x8f70d[_0x3ffe('0x40')]=[{'all':!![]}];}_0x8f70d=_['merge']({},_0x8f70d,_0x3ec69f[_0x3ffe('0x41')]);return db['MailMessage'][_0x3ffe('0x42')](_0x8f70d)[_0x3ffe('0x12')](handleEntityNotFound(_0x4b818d,null))[_0x3ffe('0x12')](respondWithResult(_0x4b818d,null))[_0x3ffe('0x1b')](handleError(_0x4b818d,null));};exports[_0x3ffe('0x23')]=function(_0x2ff10a,_0x352186){if(_0x2ff10a[_0x3ffe('0x43')]['id']){delete _0x2ff10a[_0x3ffe('0x43')]['id'];}return db[_0x3ffe('0x28')]['find']({'where':{'id':_0x2ff10a[_0x3ffe('0x3e')]['id']}})[_0x3ffe('0x12')](handleEntityNotFound(_0x352186,null))[_0x3ffe('0x12')](saveUpdates(_0x2ff10a[_0x3ffe('0x43')],null))[_0x3ffe('0x12')](respondWithResult(_0x352186,null))[_0x3ffe('0x1b')](handleError(_0x352186,null));};exports['destroy']=function(_0x4aedcb,_0x213cb1){return db['MailMessage']['find']({'where':{'id':_0x4aedcb['params']['id']}})[_0x3ffe('0x12')](handleEntityNotFound(_0x213cb1,null))[_0x3ffe('0x12')](removeEntity(_0x213cb1,null))[_0x3ffe('0x1b')](handleError(_0x213cb1,null));};exports[_0x3ffe('0x44')]=function(_0x22f0f3,_0x1d4d72){return db[_0x3ffe('0x28')][_0x3ffe('0x44')]()['then'](respondWithResult(_0x1d4d72,null))[_0x3ffe('0x1b')](handleError(_0x1d4d72,null));};exports[_0x3ffe('0x45')]=function(_0x2bab3e,_0x8e4c98){return db[_0x3ffe('0x28')]['create'](_0x2bab3e['body'])['then'](function(_0x2bfed7){if(_0x2bfed7){if(_0x2bfed7['direction']===_0x3ffe('0x46')&&!_0x2bfed7[_0x3ffe('0x47')]){var _0x1187e5,_0x4a3cee,_0x1203ff;if(_0x2bab3e['body']['to']){_0x4a3cee=_0x2bab3e[_0x3ffe('0x43')]['to']['split'](',')[0x0];}return db[_0x3ffe('0x48')]['findOne']({'where':{'id':_0x2bfed7[_0x3ffe('0x49')]},'include':[{'model':db[_0x3ffe('0x4a')],'as':_0x3ffe('0x4b'),'include':[{'model':db[_0x3ffe('0x4c')],'as':_0x3ffe('0x4d'),'where':{'email':_0x4a3cee},'limit':0x1,'order':[[_0x3ffe('0x4e'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x3ffe('0x4f'),'raw':!![],'include':[{'model':db[_0x3ffe('0x50')],'as':_0x3ffe('0x50'),'raw':!![]}]}]})[_0x3ffe('0x12')](function(_0x11f043){_0x1187e5=_0x11f043;if(!_0x1187e5||!_0x1187e5[_0x3ffe('0x4f')])return;var _0x70a319=_0x1187e5[_0x3ffe('0x51')]();if(_0x2bab3e['body'][_0x3ffe('0x52')]&&_0x2bab3e['body'][_0x3ffe('0x52')][_0x3ffe('0x3f')]){for(var _0x4bb6f9=0x0;_0x4bb6f9<_0x2bab3e[_0x3ffe('0x43')]['attachments'][_0x3ffe('0x3f')];_0x4bb6f9+=0x1){_0x2bab3e[_0x3ffe('0x43')][_0x3ffe('0x52')][_0x4bb6f9]={'filename':_0x2bab3e[_0x3ffe('0x43')][_0x3ffe('0x52')][_0x4bb6f9][_0x3ffe('0x26')],'path':path[_0x3ffe('0x53')](config[_0x3ffe('0x54')],_0x3ffe('0x55'),_0x2bab3e[_0x3ffe('0x43')]['attachments'][_0x4bb6f9][_0x3ffe('0x56')])};}}_0x1203ff={'account':_0x70a319,'message':_0x2bab3e[_0x3ffe('0x43')]};return;})[_0x3ffe('0x12')](function(){if(_0x1187e5[_0x3ffe('0x4b')]){if(_0x1187e5[_0x3ffe('0x4b')]['Contacts']['length']){return _0x1187e5[_0x3ffe('0x4b')][_0x3ffe('0x4d')][0x0];}else{return db['CmContact']['create'](_[_0x3ffe('0x9')](_0x2bab3e[_0x3ffe('0x43')],{'firstName':_0x2bab3e[_0x3ffe('0x43')]['to'],'email':_0x2bab3e[_0x3ffe('0x43')]['to'],'phone':_0x2bab3e[_0x3ffe('0x43')]['to'],'ListId':_0x1187e5['ListId']}));}}else{throw new Error(_0x3ffe('0x57'));}})[_0x3ffe('0x12')](function(){if(_0x1203ff){return respondWithRpcPromise(_0x3ffe('0x58'),_0x3ffe('0x59'),_0x1203ff,client9003)['then'](function(_0x4d1e05){return _0x2bfed7['update']({'read':!![],'messageId':_0x4d1e05[_0x3ffe('0x5a')],'sentAt':moment()[_0x3ffe('0x5b')](_0x3ffe('0x5c'))});})['catch'](function(_0x4cddb2){logger[_0x3ffe('0x17')]('%s',JSON[_0x3ffe('0x5d')](_0x4cddb2));return _0x2bfed7;});}return _0x2bfed7;});}return _0x2bfed7;}})[_0x3ffe('0x12')](respondWithResult(_0x8e4c98,0xc9))[_0x3ffe('0x1b')](handleError(_0x8e4c98,null));};exports[_0x3ffe('0x5e')]=function(_0x34d326,_0x48405b){var _0x37e28c={'agent':{},'channel':'mail'};if(_0x34d326['body']['id']){delete _0x34d326['body']['id'];}_0x34d326[_0x3ffe('0x43')]['read']=!![];_0x34d326['body']['readAt']=moment()[_0x3ffe('0x5b')](_0x3ffe('0x5c'));_0x34d326['body'][_0x3ffe('0x5f')]=_0x34d326['body'][_0x3ffe('0x5f')]||_0x34d326['user']['id'];_0x37e28c['agent']['id']=_0x34d326[_0x3ffe('0x43')]['UserId'];return db[_0x3ffe('0x28')][_0x3ffe('0x42')]({'where':{'id':_0x34d326[_0x3ffe('0x3e')]['id'],'UserId':null}})[_0x3ffe('0x12')](handleEntityNotFound(_0x48405b,null))[_0x3ffe('0x12')](saveUpdates(_0x34d326[_0x3ffe('0x43')],null))[_0x3ffe('0x12')](function(_0x12250c){if(_0x12250c){_0x37e28c[_0x3ffe('0x19')]=_0x12250c[_0x3ffe('0x60')]({'plain':!![]});return db[_0x3ffe('0x61')][_0x3ffe('0x42')]({'where':{'id':_0x12250c[_0x3ffe('0x62')]}});}return null;})[_0x3ffe('0x12')](handleEntityNotFound(_0x48405b,null))['then'](function(_0x9846e3){if(_0x9846e3){return _0x9846e3[_0x3ffe('0x23')]({'UserId':_0x34d326[_0x3ffe('0x43')][_0x3ffe('0x5f')],'read1stAt':_['isNil'](_0x9846e3[_0x3ffe('0x63')])?moment()['format'](_0x3ffe('0x5c')):undefined});}return null;})['then'](function(_0x4a1fda){if(_0x4a1fda){_0x37e28c[_0x3ffe('0x64')]=_0x4a1fda[_0x3ffe('0x60')]({'plain':!![]});interaction_log[_0x3ffe('0x13')](_0x3ffe('0x65'),_0x34d326[_0x3ffe('0x66')]['id'],_0x34d326[_0x3ffe('0x66')][_0x3ffe('0x26')],_0x34d326[_0x3ffe('0x66')][_0x3ffe('0x67')],_0x37e28c[_0x3ffe('0x64')]['id'],_0x34d326[_0x3ffe('0x43')]?JSON['stringify'](_0x34d326[_0x3ffe('0x43')]):_0x3ffe('0x68'));return respondWithRpcPromise(_0x3ffe('0x69'),_0x3ffe('0x6a'),_0x37e28c);}return null;})[_0x3ffe('0x12')](function(_0x5086af){var _0xc89bbb=_0x3ffe('0x6b')+_0x5086af['message']['ContactId'];return db[_0x3ffe('0x6c')][_0x3ffe('0x2d')](_0xc89bbb,{'type':db[_0x3ffe('0x6d')][_0x3ffe('0x6e')]['SELECT'],'raw':!![]})[_0x3ffe('0x12')](function(_0x5ee8a6){return _0x5ee8a6;});})[_0x3ffe('0x12')](function(_0x12acf7){if(_0x12acf7){_0x37e28c[_0x3ffe('0x19')][_0x3ffe('0x6f')]=_0x12acf7[0x0];if(!_0x34d326[_0x3ffe('0x43')][_0x3ffe('0x5f')])return;return db[_0x3ffe('0x70')][_0x3ffe('0x42')]({'where':{'id':_0x34d326[_0x3ffe('0x43')][_0x3ffe('0x5f')],'role':_0x3ffe('0x71')},'attributes':['id',_0x3ffe('0x26'),_0x3ffe('0x72'),_0x3ffe('0x73'),_0x3ffe('0x74')],'raw':!![]});}return null;})[_0x3ffe('0x12')](function(_0x3010df){if(!_0x3010df)return null;_0x37e28c[_0x3ffe('0x19')]['agent']=_0x3010df;return _0x37e28c;})[_0x3ffe('0x12')](function(_0x2fcfef){if(_0x2fcfef){if(_0x34d326[_0x3ffe('0x43')][_0x3ffe('0x75')]){_0x37e28c[_0x3ffe('0x19')][_0x3ffe('0x76')]=util['format'](_0x3ffe('0x77'),_0x34d326[_0x3ffe('0x66')][_0x3ffe('0x26')]);_0x37e28c[_0x3ffe('0x19')]['channel']=_0x37e28c['channel'];_0x37e28c[_0x3ffe('0x19')]['motionChannel']=_0x37e28c[_0x3ffe('0x78')];_0x37e28c[_0x3ffe('0x19')][_0x3ffe('0x79')]=_0x3ffe('0x5e');_0x37e28c[_0x3ffe('0x19')]['body']=htmlToText['fromString'](_0x37e28c[_0x3ffe('0x19')][_0x3ffe('0x43')]);return respondWithRpcPromise(_0x3ffe('0x7a'),_0x3ffe('0x7a'),{'event':'acceptmessage','message':_0x37e28c[_0x3ffe('0x19')]},client9002)['then'](function(){return _0x37e28c;});}return _0x37e28c;}return null;})[_0x3ffe('0x12')](respondWithResult(_0x48405b,null))[_0x3ffe('0x1b')](handleError(_0x48405b,null));};exports[_0x3ffe('0x7b')]=function(_0x235ea6,_0x5b61fb){var _0x3613bf={'agent':{},'channel':'mail'};if(_0x235ea6['body']['id']){delete _0x235ea6[_0x3ffe('0x43')]['id'];}_0x235ea6['body']['UserId']=_0x235ea6[_0x3ffe('0x43')][_0x3ffe('0x5f')]||_0x235ea6['user']['id'];_0x3613bf[_0x3ffe('0x71')]['id']=_0x235ea6[_0x3ffe('0x43')][_0x3ffe('0x5f')];return db[_0x3ffe('0x28')][_0x3ffe('0x42')]({'where':{'id':_0x235ea6[_0x3ffe('0x3e')]['id'],'UserId':null}})[_0x3ffe('0x12')](handleEntityNotFound(_0x5b61fb,null))[_0x3ffe('0x12')](function(_0x3bb9d9){if(_0x3bb9d9){_0x3613bf[_0x3ffe('0x19')]=_0x3bb9d9['get']({'plain':!![]});return db[_0x3ffe('0x61')][_0x3ffe('0x42')]({'where':{'id':_0x3bb9d9[_0x3ffe('0x62')]}});}return null;})[_0x3ffe('0x12')](handleEntityNotFound(_0x5b61fb,null))[_0x3ffe('0x12')](function(_0x5d33fa){if(_0x5d33fa){_0x3613bf[_0x3ffe('0x64')]=_0x5d33fa[_0x3ffe('0x60')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x235ea6[_0x3ffe('0x66')]['id'],_0x235ea6[_0x3ffe('0x66')][_0x3ffe('0x26')],_0x235ea6[_0x3ffe('0x66')][_0x3ffe('0x67')],_0x3613bf[_0x3ffe('0x64')]['id'],_0x235ea6[_0x3ffe('0x43')]?JSON[_0x3ffe('0x5d')](_0x235ea6[_0x3ffe('0x43')]):_0x3ffe('0x68'));return respondWithRpcPromise(_0x3ffe('0x7c'),_0x3ffe('0x7d'),_0x3613bf);}return null;})[_0x3ffe('0x12')](function(_0x12d936){var _0x4ba718=_0x3ffe('0x6b')+_0x12d936[_0x3ffe('0x19')][_0x3ffe('0x7e')];return db['sequelize'][_0x3ffe('0x2d')](_0x4ba718,{'type':db[_0x3ffe('0x6d')][_0x3ffe('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0xf72df1){return _0xf72df1;});})['then'](function(_0x5bdd97){if(_0x5bdd97){_0x3613bf[_0x3ffe('0x19')]['contact']=_0x5bdd97[0x0];if(!_0x235ea6[_0x3ffe('0x43')]['UserId'])return;return db[_0x3ffe('0x70')][_0x3ffe('0x42')]({'where':{'id':_0x235ea6[_0x3ffe('0x43')][_0x3ffe('0x5f')],'role':_0x3ffe('0x71')},'attributes':['id',_0x3ffe('0x26'),_0x3ffe('0x72'),'email','internal'],'raw':!![]});}return null;})[_0x3ffe('0x12')](function(_0x16432b){if(!_0x16432b)return null;_0x3613bf[_0x3ffe('0x19')][_0x3ffe('0x71')]=_0x16432b;return _0x3613bf;})['then'](function(_0x1a3635){if(_0x1a3635){_0x1a3635[_0x3ffe('0x19')][_0x3ffe('0x76')]=util[_0x3ffe('0x5b')](_0x3ffe('0x77'),_0x235ea6[_0x3ffe('0x66')][_0x3ffe('0x26')]);_0x1a3635[_0x3ffe('0x19')][_0x3ffe('0x78')]=_0x3613bf['channel'];_0x1a3635[_0x3ffe('0x19')]['motionChannel']=_0x3613bf[_0x3ffe('0x78')];_0x1a3635[_0x3ffe('0x19')][_0x3ffe('0x79')]=_0x3ffe('0x7b');_0x1a3635[_0x3ffe('0x19')]['body']=htmlToText[_0x3ffe('0x7f')](_0x3613bf[_0x3ffe('0x19')][_0x3ffe('0x43')]);respondWithRpcPromise(_0x3ffe('0x7a'),_0x3ffe('0x7a'),{'event':'rejectmessage','message':_0x1a3635['message']},client9002);return _0x3613bf;}return null;})[_0x3ffe('0x12')](respondWithResult(_0x5b61fb,null))[_0x3ffe('0x1b')](handleError(_0x5b61fb,null));};exports[_0x3ffe('0x80')]=function(_0x51e14b,_0x1d623f){var _0x3280ba=moment()['unix']()[_0x3ffe('0x81')]();var _0x5e4a01=path[_0x3ffe('0x53')](config[_0x3ffe('0x54')],_0x3ffe('0x82'),'files',_0x3ffe('0x83'));var _0x4f8fe7=path[_0x3ffe('0x53')](config[_0x3ffe('0x54')],_0x3ffe('0x82'),_0x3ffe('0x84'),_0x3ffe('0x52'));var _0x55a665=util[_0x3ffe('0x5b')](_0x3ffe('0x85'),_0x3280ba);return db[_0x3ffe('0x28')][_0x3ffe('0x42')]({'where':{'id':_0x51e14b[_0x3ffe('0x3e')]['id']},'attributes':['id',_0x3ffe('0x43'),_0x3ffe('0x86'),'to','cc',_0x3ffe('0x87'),_0x3ffe('0x88'),_0x3ffe('0x89')],'include':_0x51e14b[_0x3ffe('0x2d')]['attachments']?[{'model':db[_0x3ffe('0x8a')],'as':_0x3ffe('0x8b')}]:undefined})[_0x3ffe('0x12')](handleEntityNotFound(_0x1d623f,null))[_0x3ffe('0x12')](function(_0x3e4969){if(_0x3e4969){var _0xf12df5=_0x3e4969;var _0x483bf8={'from':_0xf12df5[_0x3ffe('0x86')],'to':_0xf12df5['to'],'subject':_0xf12df5['subject'],'html':htmlEntities[_0x3ffe('0x8c')](_0xf12df5['body']),'headers':{'Date':moment(_0xf12df5[_0x3ffe('0x89')])[_0x3ffe('0x5b')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3e4969['cc']){_0x483bf8[_0x3ffe('0x8d')]['Cc']=_0x3e4969['cc'];}if(_0x3e4969[_0x3ffe('0x87')]){_0x483bf8[_0x3ffe('0x8d')][_0x3ffe('0x8e')]=_0x3e4969['bcc'];}return new BPromise(function(_0x3ed438,_0x32acf2){if(_0x3e4969[_0x3ffe('0x8b')]){for(var _0x189ff9=0x0;_0x189ff9<_0x3e4969[_0x3ffe('0x8b')][_0x3ffe('0x3f')];_0x189ff9++){var _0x4c4a58=_0x3e4969[_0x3ffe('0x8b')][_0x189ff9];var _0x4eacba=path[_0x3ffe('0x53')](_0x4f8fe7,_0x4c4a58['basename']);if(fs['existsSync'](_0x4eacba)){_0x483bf8[_0x3ffe('0x52')]['push']({'name':_0x4c4a58[_0x3ffe('0x26')],'contentType':_0x4c4a58['type'],'data':fs[_0x3ffe('0x8f')](_0x4eacba)});}}}emlformat[_0x3ffe('0x90')](_0x483bf8,function(_0x3c6a84,_0x57773b){if(_0x3c6a84)return _0x32acf2(_0x3c6a84);fs['writeFileSync'](path[_0x3ffe('0x53')](_0x5e4a01,_0x55a665),_0x57773b);return _0x3ed438(_0x57773b);});});}})[_0x3ffe('0x12')](function(_0x346bf1){if(_0x346bf1){return _0x1d623f[_0x3ffe('0x80')](path[_0x3ffe('0x53')](_0x5e4a01,_0x55a665),_0x55a665,function(_0x4570d9){if(!_0x4570d9)fs[_0x3ffe('0x91')](path[_0x3ffe('0x53')](_0x5e4a01,_0x55a665));});}})['catch'](handleError(_0x1d623f,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 45d4158..df51e00 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 _0x44ba=['events','MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44ba,0xc8));var _0xa44b=function(_0x1fb6ff,_0x474709){_0x1fb6ff=_0x1fb6ff-0x0;var _0x339f61=_0x44ba[_0x1fb6ff];return _0x339f61;};'use strict';var EventEmitter=require(_0xa44b('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xa44b('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xa44b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa44b('0x3'),'afterDestroy':_0xa44b('0x4')};function emitEvent(_0x3ceca6){return function(_0x39c658,_0x5eee9b,_0xab3316){MailMessageEvents[_0xa44b('0x5')](_0x3ceca6+':'+_0x39c658['id'],_0x39c658);MailMessageEvents[_0xa44b('0x5')](_0x3ceca6,_0x39c658);_0xab3316(null);};}for(var e in events){if(events[_0xa44b('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xa44b('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xa353=['update','emit','hook','events','../../mysqldb','save'];(function(_0x422d8a,_0x1d5e72){var _0x27dd24=function(_0x7a9075){while(--_0x7a9075){_0x422d8a['push'](_0x422d8a['shift']());}};_0x27dd24(++_0x1d5e72);}(_0xa353,0x1a1));var _0x3a35=function(_0x12d3f1,_0x489cd5){_0x12d3f1=_0x12d3f1-0x0;var _0x2f1991=_0xa353[_0x12d3f1];return _0x2f1991;};'use strict';var EventEmitter=require(_0x3a35('0x0'));var MailMessage=require(_0x3a35('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3a35('0x2'),'afterUpdate':_0x3a35('0x3'),'afterDestroy':'remove'};function emitEvent(_0x562e24){return function(_0x23c087,_0x11548e,_0x69c3ab){MailMessageEvents[_0x3a35('0x4')](_0x562e24+':'+_0x23c087['id'],_0x23c087);MailMessageEvents[_0x3a35('0x4')](_0x562e24,_0x23c087);_0x69c3ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x3a35('0x5')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 4457b9d..a34d890 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 _0x20e5=['body','fromString','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','plainBody','FULLTEXT'];(function(_0x5cd50b,_0x1f5bd4){var _0x25f5db=function(_0x2a88ea){while(--_0x2a88ea){_0x5cd50b['push'](_0x5cd50b['shift']());}};_0x25f5db(++_0x1f5bd4);}(_0x20e5,0x190));var _0x520e=function(_0xf4601d,_0x4bb96b){_0xf4601d=_0xf4601d-0x0;var _0x2f240f=_0x20e5[_0xf4601d];return _0x2f240f;};'use strict';var _=require(_0x520e('0x0'));var util=require(_0x520e('0x1'));var logger=require(_0x520e('0x2'))(_0x520e('0x3'));var moment=require(_0x520e('0x4'));var BPromise=require(_0x520e('0x5'));var rp=require(_0x520e('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x520e('0x7'));var rimraf=require('rimraf');var config=require(_0x520e('0x8'));var attributes=require(_0x520e('0x9'));module['exports']=function(_0x4d7184,_0xb34ce3){return _0x4d7184[_0x520e('0xa')](_0x520e('0xb'),attributes,{'tableName':_0x520e('0xc'),'paranoid':![],'indexes':[{'name':_0x520e('0xd'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x520e('0xe'),'subject'],'type':_0x520e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x48d240,_0x303fd7,_0x3d9572){if(_0x48d240[_0x520e('0x10')]){_0x48d240[_0x520e('0xe')]=htmlToText[_0x520e('0x11')](_0x48d240['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d9572(null,_0x303fd7);},'afterCreate':function(_0x21f379,_0x320afc,_0x2641a5){var _0x216e89=_0x4d7184[_0x520e('0x12')];var _0x767418=_0x21f379[_0x520e('0x13')]({'plain':!![]});if(_0x767418[_0x520e('0x14')][_0x520e('0x15')]()==='in'||_0x767418[_0x520e('0x14')][_0x520e('0x15')]()===_0x520e('0x16')&&!_0x767418['secret']&&!_[_0x520e('0x17')](_0x767418[_0x520e('0x18')])){_0x216e89[_0x520e('0x19')][_0x520e('0x1a')]({'where':{'id':_0x767418[_0x520e('0x1b')]}})[_0x520e('0x1c')](function(_0xb2d3af){if(_0xb2d3af){_0xb2d3af[_0x520e('0x1d')]({'lastMsgAt':_0x767418[_0x520e('0x1e')],'lastMsgDirection':_0x767418[_0x520e('0x14')][_0x520e('0x15')]()});}})['catch'](function(_0x50a029){console[_0x520e('0x1f')](_0x50a029);});}_0x2641a5();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0317=['../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','html-to-text','path'];(function(_0x23e9bb,_0x4160fe){var _0x39d313=function(_0x3f68af){while(--_0x3f68af){_0x23e9bb['push'](_0x23e9bb['shift']());}};_0x39d313(++_0x4160fe);}(_0x0317,0x1c7));var _0x7031=function(_0x306268,_0x50005e){_0x306268=_0x306268-0x0;var _0x5065c1=_0x0317[_0x306268];return _0x5065c1;};'use strict';var _=require('lodash');var util=require(_0x7031('0x0'));var logger=require(_0x7031('0x1'))(_0x7031('0x2'));var moment=require(_0x7031('0x3'));var BPromise=require(_0x7031('0x4'));var rp=require('request-promise');var htmlToText=require(_0x7031('0x5'));var fs=require('fs');var path=require(_0x7031('0x6'));var rimraf=require('rimraf');var config=require(_0x7031('0x7'));var attributes=require('./mailMessage.attributes');module[_0x7031('0x8')]=function(_0x57bb48,_0x57fd57){return _0x57bb48[_0x7031('0x9')](_0x7031('0xa'),attributes,{'tableName':_0x7031('0xb'),'paranoid':![],'indexes':[{'name':_0x7031('0xc'),'fields':[_0x7031('0xc')]},{'name':_0x7031('0xd'),'fields':[_0x7031('0xe'),_0x7031('0xf')],'type':_0x7031('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x472a22,_0x3f018e,_0x219392){if(_0x472a22['body']){_0x472a22[_0x7031('0xe')]=htmlToText[_0x7031('0x11')](_0x472a22['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x219392(null,_0x3f018e);},'afterCreate':function(_0x176a10,_0x59e847,_0xfa2b55){var _0x97657d=_0x57bb48[_0x7031('0x12')];var _0x5ccbb8=_0x176a10[_0x7031('0x13')]({'plain':!![]});if(_0x5ccbb8[_0x7031('0x14')][_0x7031('0x15')]()==='in'||_0x5ccbb8[_0x7031('0x14')][_0x7031('0x15')]()===_0x7031('0x16')&&!_0x5ccbb8[_0x7031('0x17')]&&!_['isNil'](_0x5ccbb8[_0x7031('0x18')])){_0x97657d[_0x7031('0x19')][_0x7031('0x1a')]({'where':{'id':_0x5ccbb8['MailInteractionId']}})[_0x7031('0x1b')](function(_0x5048ea){if(_0x5048ea){_0x5048ea[_0x7031('0x1c')]({'lastMsgAt':_0x5ccbb8[_0x7031('0x1d')],'lastMsgDirection':_0x5ccbb8[_0x7031('0x14')]['toLowerCase']()});}})[_0x7031('0x1e')](function(_0x29a327){console[_0x7031('0x1f')](_0x29a327);});}_0xfa2b55();}},'charset':'utf8mb4','collate':_0x7031('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 45dc2be..151c958 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 _0x4991=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','info','result','MailMessage','create','body','options','raw','CreateMailMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1fad3f,_0x2cc381){var _0x522a12=function(_0x44edf7){while(--_0x44edf7){_0x1fad3f['push'](_0x1fad3f['shift']());}};_0x522a12(++_0x2cc381);}(_0x4991,0xf7));var _0x1499=function(_0x1a4c3a,_0x1d323a){_0x1a4c3a=_0x1a4c3a-0x0;var _0x4173b6=_0x4991[_0x1a4c3a];return _0x4173b6;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});config[_0x1499('0xb')]=_[_0x1499('0xc')](config[_0x1499('0xb')],{'host':_0x1499('0xd'),'port':0x18eb});var socket=require(_0x1499('0xe'))(new Redis(config[_0x1499('0xb')]));require(_0x1499('0xf'))['register'](socket);function respondWithRpcPromise(_0x16e8ad,_0x36a053,_0x575251){return new BPromise(function(_0x2a4816,_0x352180){return client['request'](_0x16e8ad,_0x575251)[_0x1499('0x10')](function(_0x2867b1){logger['info']('MailMessage,\x20%s,\x20%s',_0x36a053,'request\x20sent');logger[_0x1499('0x11')](_0x1499('0x12'),_0x36a053,_0x1499('0x13'),JSON[_0x1499('0x14')](_0x2867b1));if(_0x2867b1[_0x1499('0x15')]){if(_0x2867b1['error']['code']===0x1f4){logger[_0x1499('0x15')]('MailMessage,\x20%s,\x20%s',_0x36a053,_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);return _0x352180(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}logger['error'](_0x1499('0x17'),_0x36a053,_0x2867b1[_0x1499('0x15')]['message']);return _0x2a4816(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}else{logger[_0x1499('0x18')](_0x1499('0x17'),_0x36a053,_0x1499('0x13'));_0x2a4816(_0x2867b1[_0x1499('0x19')]['message']);}})['catch'](function(_0x5bcb5f){logger[_0x1499('0x15')](_0x1499('0x17'),_0x36a053,_0x5bcb5f);_0x352180(_0x5bcb5f);});});}exports['CreateMailMessage']=function(_0x351da9){var _0x3c13a1=this;return new Promise(function(_0x28dff3,_0x18e4a6){return db[_0x1499('0x1a')][_0x1499('0x1b')](_0x351da9[_0x1499('0x1c')],{'raw':_0x351da9[_0x1499('0x1d')]?_0x351da9[_0x1499('0x1d')][_0x1499('0x1e')]===undefined?!![]:![]:!![]})[_0x1499('0x10')](function(_0x836081){logger[_0x1499('0x18')](_0x1499('0x1f'),_0x351da9);logger[_0x1499('0x11')](_0x1499('0x1f'),_0x351da9,JSON[_0x1499('0x14')](_0x836081));_0x28dff3(_0x836081);})['catch'](function(_0x258e9c){logger[_0x1499('0x15')](_0x1499('0x1f'),_0x258e9c[_0x1499('0x16')],_0x351da9);_0x18e4a6(_0x3c13a1[_0x1499('0x15')](0x1f4,_0x258e9c[_0x1499('0x16')]));});});}; \ No newline at end of file +var _0x0598=['CreateMailMessage','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','MailMessage','create','body','raw'];(function(_0x4fa916,_0x3ec36a){var _0x576439=function(_0x5692e0){while(--_0x5692e0){_0x4fa916['push'](_0x4fa916['shift']());}};_0x576439(++_0x3ec36a);}(_0x0598,0x92));var _0x8059=function(_0x21051b,_0x560e51){_0x21051b=_0x21051b-0x0;var _0x3f2a45=_0x0598[_0x21051b];return _0x3f2a45;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});config['redis']=_[_0x8059('0x7')](config[_0x8059('0x8')],{'host':_0x8059('0x9'),'port':0x18eb});var socket=require(_0x8059('0xa'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x8059('0xb')](socket);function respondWithRpcPromise(_0x1bf5fd,_0x336f85,_0x5097d6){return new BPromise(function(_0x283b63,_0x52a60d){return client['request'](_0x1bf5fd,_0x5097d6)[_0x8059('0xc')](function(_0x4109a9){logger['info']('MailMessage,\x20%s,\x20%s',_0x336f85,'request\x20sent');logger[_0x8059('0xd')](_0x8059('0xe'),_0x336f85,_0x8059('0xf'),JSON[_0x8059('0x10')](_0x4109a9));if(_0x4109a9[_0x8059('0x11')]){if(_0x4109a9['error'][_0x8059('0x12')]===0x1f4){logger['error'](_0x8059('0x13'),_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x52a60d(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x283b63(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}else{logger[_0x8059('0x15')](_0x8059('0x13'),_0x336f85,'request\x20sent');_0x283b63(_0x4109a9[_0x8059('0x16')][_0x8059('0x14')]);}})[_0x8059('0x17')](function(_0x1c4566){logger['error'](_0x8059('0x13'),_0x336f85,_0x1c4566);_0x52a60d(_0x1c4566);});});}exports['CreateMailMessage']=function(_0x113f42){var _0x493825=this;return new Promise(function(_0x1857c1,_0x56d794){return db[_0x8059('0x18')][_0x8059('0x19')](_0x113f42[_0x8059('0x1a')],{'raw':_0x113f42['options']?_0x113f42['options'][_0x8059('0x1b')]===undefined?!![]:![]:!![]})[_0x8059('0xc')](function(_0x32aeda){logger[_0x8059('0x15')]('CreateMailMessage',_0x113f42);logger[_0x8059('0xd')](_0x8059('0x1c'),_0x113f42,JSON[_0x8059('0x10')](_0x32aeda));_0x1857c1(_0x32aeda);})['catch'](function(_0xe9a72d){logger[_0x8059('0x11')](_0x8059('0x1c'),_0xe9a72d[_0x8059('0x14')],_0x113f42);_0x56d794(_0x493825['error'](0x1f4,_0xe9a72d[_0x8059('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 0c5909c..cc8f9e0 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 _0x43f7=['length','mailMessage:','./mailMessage.events','save','remove','emit','register'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x43f7,0x8e));var _0x743f=function(_0x54839c,_0x235a6d){_0x54839c=_0x54839c-0x0;var _0x507423=_0x43f7[_0x54839c];return _0x507423;};'use strict';var MailMessageEvents=require(_0x743f('0x0'));var events=[_0x743f('0x1'),_0x743f('0x2'),'update'];function createListener(_0x5244d9,_0x49d980){return function(_0x3b5e45){_0x49d980[_0x743f('0x3')](_0x5244d9,_0x3b5e45);};}function removeListener(_0x18839e,_0x5ee956){return function(){MailMessageEvents['removeListener'](_0x18839e,_0x5ee956);};}exports[_0x743f('0x4')]=function(_0x2b9a1f){for(var _0x448a03=0x0,_0x4ff159=events[_0x743f('0x5')];_0x448a03<_0x4ff159;_0x448a03++){var _0x62b4f9=events[_0x448a03];var _0x528da9=createListener(_0x743f('0x6')+_0x62b4f9,_0x2b9a1f);MailMessageEvents['on'](_0x62b4f9,_0x528da9);}}; \ No newline at end of file +var _0x945c=['length','mailMessage:','./mailMessage.events','save','update','register'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x945c,0x9e));var _0xc945=function(_0x1e0fbc,_0x23a9b4){_0x1e0fbc=_0x1e0fbc-0x0;var _0x7e15f=_0x945c[_0x1e0fbc];return _0x7e15f;};'use strict';var MailMessageEvents=require(_0xc945('0x0'));var events=[_0xc945('0x1'),'remove',_0xc945('0x2')];function createListener(_0x5167d9,_0x3369bd){return function(_0x3725c6){_0x3369bd['emit'](_0x5167d9,_0x3725c6);};}function removeListener(_0x55af92,_0x5a3758){return function(){MailMessageEvents['removeListener'](_0x55af92,_0x5a3758);};}exports[_0xc945('0x3')]=function(_0x4cd6c8){for(var _0x1a531e=0x0,_0x3df59f=events[_0xc945('0x4')];_0x1a531e<_0x3df59f;_0x1a531e++){var _0x505bfc=events[_0x1a531e];var _0x5ab635=createListener(_0xc945('0x5')+_0x505bfc,_0x4cd6c8);MailMessageEvents['on'](_0x505bfc,_0x5ab635);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 951faac..b741dc9 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 _0xe51e=['../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','path','Router','fs-extra','../../components/auth/service'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xe51e,0x184));var _0xee51=function(_0x468d5e,_0x2a6d51){_0x468d5e=_0x468d5e-0x0;var _0x187d66=_0xe51e[_0x468d5e];return _0x187d66;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee51('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee51('0x1')]();var fs_extra=require(_0xee51('0x2'));var auth=require(_0xee51('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xee51('0x4'));var controller=require(_0xee51('0x5'));router[_0xee51('0x6')]('/',auth[_0xee51('0x7')](),controller[_0xee51('0x8')]);router[_0xee51('0x6')](_0xee51('0x9'),auth[_0xee51('0x7')](),controller[_0xee51('0xa')]);router[_0xee51('0x6')](_0xee51('0xb'),auth[_0xee51('0x7')](),controller['show']);router[_0xee51('0x6')](_0xee51('0xc'),auth[_0xee51('0x7')](),controller[_0xee51('0xd')]);router['get'](_0xee51('0xe'),auth['isAuthenticated'](),controller[_0xee51('0xf')]);router[_0xee51('0x6')]('/:id/users',auth[_0xee51('0x7')](),controller[_0xee51('0x10')]);router[_0xee51('0x11')]('/',auth[_0xee51('0x7')](),controller[_0xee51('0x12')]);router['post'](_0xee51('0xe'),auth['isAuthenticated'](),controller[_0xee51('0x13')]);router[_0xee51('0x11')](_0xee51('0x14'),auth[_0xee51('0x7')](),controller[_0xee51('0x15')]);router[_0xee51('0x16')](_0xee51('0xb'),auth[_0xee51('0x7')](),controller['update']);router[_0xee51('0x17')](_0xee51('0xb'),auth['isAuthenticated'](),controller[_0xee51('0x18')]);router[_0xee51('0x17')]('/:id/teams',auth[_0xee51('0x7')](),controller[_0xee51('0x19')]);router[_0xee51('0x17')](_0xee51('0x14'),auth[_0xee51('0x7')](),controller[_0xee51('0x1a')]);module[_0xee51('0x1b')]=router; \ No newline at end of file +var _0xd65e=['/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','removeTeams','delete','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x16bf78,_0x1e99d9){var _0x5a7a4b=function(_0x16b206){while(--_0x16b206){_0x16bf78['push'](_0x16bf78['shift']());}};_0x5a7a4b(++_0x1e99d9);}(_0xd65e,0x1ed));var _0xed65=function(_0x9ce402,_0x419d11){_0x9ce402=_0x9ce402-0x0;var _0x44416f=_0xd65e[_0x9ce402];return _0x44416f;};'use strict';var multer=require('multer');var util=require(_0xed65('0x0'));var path=require(_0xed65('0x1'));var timeout=require('connect-timeout');var express=require(_0xed65('0x2'));var router=express[_0xed65('0x3')]();var fs_extra=require(_0xed65('0x4'));var auth=require(_0xed65('0x5'));var interaction=require(_0xed65('0x6'));var config=require(_0xed65('0x7'));var controller=require(_0xed65('0x8'));router[_0xed65('0x9')]('/',auth[_0xed65('0xa')](),controller[_0xed65('0xb')]);router[_0xed65('0x9')](_0xed65('0xc'),auth[_0xed65('0xa')](),controller[_0xed65('0xd')]);router['get'](_0xed65('0xe'),auth['isAuthenticated'](),controller[_0xed65('0xf')]);router[_0xed65('0x9')](_0xed65('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0xed65('0x9')](_0xed65('0x11'),auth[_0xed65('0xa')](),controller[_0xed65('0x12')]);router[_0xed65('0x9')](_0xed65('0x13'),auth[_0xed65('0xa')](),controller[_0xed65('0x14')]);router[_0xed65('0x15')]('/',auth[_0xed65('0xa')](),controller['create']);router['post'](_0xed65('0x11'),auth[_0xed65('0xa')](),controller[_0xed65('0x16')]);router[_0xed65('0x15')](_0xed65('0x13'),auth[_0xed65('0xa')](),controller[_0xed65('0x17')]);router[_0xed65('0x18')](_0xed65('0xe'),auth[_0xed65('0xa')](),controller[_0xed65('0x19')]);router['delete'](_0xed65('0xe'),auth[_0xed65('0xa')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xed65('0xa')](),controller[_0xed65('0x1a')]);router[_0xed65('0x1b')](_0xed65('0x13'),auth[_0xed65('0xa')](),controller[_0xed65('0x1c')]);module[_0xed65('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index efa9494..06a2af5 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 _0x4806=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x5eb204,_0x1b9418){var _0x3df8e4=function(_0x41f4bd){while(--_0x41f4bd){_0x5eb204['push'](_0x5eb204['shift']());}};_0x3df8e4(++_0x1b9418);}(_0x4806,0x150));var _0x6480=function(_0x21c0ee,_0x2c5455){_0x21c0ee=_0x21c0ee-0x0;var _0x2f311f=_0x4806[_0x21c0ee];return _0x2f311f;};'use strict';var Sequelize=require(_0x6480('0x0'));module['exports']={'name':{'type':Sequelize[_0x6480('0x1')],'unique':_0x6480('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6480('0x1')]},'timeout':{'type':Sequelize[_0x6480('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6480('0x4')](_0x6480('0x5'),_0x6480('0x6'),_0x6480('0x7'))}}; \ No newline at end of file +var _0xc8d0=['beepall','roundrobin','name','INTEGER','ENUM','rrmemory'];(function(_0x46cd97,_0x1d7f12){var _0x4eeb8a=function(_0x46d6bf){while(--_0x46d6bf){_0x46cd97['push'](_0x46cd97['shift']());}};_0x4eeb8a(++_0x1d7f12);}(_0xc8d0,0xe0));var _0x0c8d=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0xc8d0[_0x1b70e3];return _0x1452ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0c8d('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0c8d('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0c8d('0x2')](_0x0c8d('0x3'),_0x0c8d('0x4'),_0x0c8d('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index b808750..8553643 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 _0x6b24=['autoAssociation','find','describe','findOne','UserMailQueue','hasOwnProperty','pick','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','interface','flatMap','transaction','each','forEach','emit','userMailQueue:save','removeTeams','findAll','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','MailQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','type','filter','merge','options','MailQueue','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x508ee0,_0x51dac2){var _0xcdb765=function(_0x1d6b8e){while(--_0x1d6b8e){_0x508ee0['push'](_0x508ee0['shift']());}};_0xcdb765(++_0x51dac2);}(_0x6b24,0x1ce));var _0x46b2=function(_0x488814,_0x3fec59){_0x488814=_0x488814-0x0;var _0x58138b=_0x6b24[_0x488814];return _0x58138b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46b2('0x0'));var zipdir=require(_0x46b2('0x1'));var jsonpatch=require(_0x46b2('0x2'));var rp=require(_0x46b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46b2('0x4'));var path=require('path');var sox=require(_0x46b2('0x5'));var csv=require('to-csv');var ejs=require(_0x46b2('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46b2('0x7'));var crypto=require(_0x46b2('0x8'));var jsforce=require(_0x46b2('0x9'));var deskjs=require(_0x46b2('0xa'));var toCsv=require(_0x46b2('0xb'));var querystring=require(_0x46b2('0xc'));var Papa=require(_0x46b2('0xd'));var Redis=require(_0x46b2('0xe'));var authService=require(_0x46b2('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46b2('0x10'));var logger=require(_0x46b2('0x11'))(_0x46b2('0x12'));var utils=require('../../config/utils');var config=require(_0x46b2('0x13'));var licenseUtil=require(_0x46b2('0x14'));var db=require(_0x46b2('0x15'))['db'];config['redis']=_[_0x46b2('0x16')](config[_0x46b2('0x17')],{'host':_0x46b2('0x18'),'port':0x18eb});var socket=require(_0x46b2('0x19'))(new Redis(config[_0x46b2('0x17')]));require(_0x46b2('0x1a'))[_0x46b2('0x1b')](socket);function respondWithStatusCode(_0x228261,_0xc70994){_0xc70994=_0xc70994||0xcc;return function(_0x192cbf){if(_0x192cbf){return _0x228261['sendStatus'](_0xc70994);}return _0x228261[_0x46b2('0x1c')](_0xc70994)[_0x46b2('0x1d')]();};}function respondWithResult(_0x49479c,_0x179bd9){_0x179bd9=_0x179bd9||0xc8;return function(_0xd9554a){if(_0xd9554a){return _0x49479c[_0x46b2('0x1c')](_0x179bd9)[_0x46b2('0x1e')](_0xd9554a);}};}function respondWithFilteredResult(_0x373c49,_0x1497d6){return function(_0x226ab5){if(_0x226ab5){var _0x5bd251=typeof _0x1497d6[_0x46b2('0x1f')]==='undefined'&&typeof _0x1497d6[_0x46b2('0x20')]===_0x46b2('0x21');var _0x9b4723=_0x226ab5['count'];var _0x285171=_0x5bd251?0x0:_0x1497d6[_0x46b2('0x1f')];var _0x473aad=_0x5bd251?_0x226ab5[_0x46b2('0x22')]:_0x1497d6[_0x46b2('0x1f')]+_0x1497d6[_0x46b2('0x20')];var _0x3a0ea5;if(_0x473aad>=_0x9b4723){_0x473aad=_0x9b4723;_0x3a0ea5=0xc8;}else{_0x3a0ea5=0xce;}_0x373c49[_0x46b2('0x1c')](_0x3a0ea5);return _0x373c49[_0x46b2('0x23')](_0x46b2('0x24'),_0x285171+'-'+_0x473aad+'/'+_0x9b4723)[_0x46b2('0x1e')](_0x226ab5);}return null;};}function patchUpdates(_0x1b5fbe){return function(_0x451985){try{jsonpatch[_0x46b2('0x25')](_0x451985,_0x1b5fbe,!![]);}catch(_0x1caa77){return BPromise['reject'](_0x1caa77);}return _0x451985[_0x46b2('0x26')]();};}function saveUpdates(_0x4c2983,_0x5ae029){return function(_0x2d4ebb){if(_0x2d4ebb){return _0x2d4ebb[_0x46b2('0x27')](_0x4c2983)[_0x46b2('0x28')](function(_0x134526){return _0x134526;});}return null;};}function removeEntity(_0x16f646,_0x58069e){return function(_0x95d2cf){if(_0x95d2cf){return _0x95d2cf[_0x46b2('0x29')]()['then'](function(){var _0x3c5997=_0x95d2cf['get']({'plain':!![]});var _0x23ce7d=_0x46b2('0x2a');return db[_0x46b2('0x2b')][_0x46b2('0x29')]({'where':{'type':_0x23ce7d,'resourceId':_0x3c5997['id']}})[_0x46b2('0x28')](function(){return _0x95d2cf;});})[_0x46b2('0x28')](function(){_0x16f646[_0x46b2('0x1c')](0xcc)[_0x46b2('0x1d')]();});}};}function handleEntityNotFound(_0x429496,_0x20ccb2){return function(_0x5421d9){if(!_0x5421d9){_0x429496['sendStatus'](0x194);}return _0x5421d9;};}function handleError(_0x4dcee5,_0x2c619b){_0x2c619b=_0x2c619b||0x1f4;return function(_0x34d03b){logger[_0x46b2('0x2c')](_0x34d03b['stack']);if(_0x34d03b[_0x46b2('0x2d')]){delete _0x34d03b[_0x46b2('0x2d')];}_0x4dcee5['status'](_0x2c619b)[_0x46b2('0x2e')](_0x34d03b);};}exports[_0x46b2('0x2f')]=function(_0x11de37,_0x3fc156){var _0x1a2a6d={},_0x3341df={},_0x36a746={'count':0x0,'rows':[]};var _0x15eabd=_[_0x46b2('0x30')](db['MailQueue'][_0x46b2('0x31')],function(_0x457223){return{'name':_0x457223[_0x46b2('0x32')],'type':_0x457223['type'][_0x46b2('0x33')]};});_0x3341df[_0x46b2('0x34')]=_[_0x46b2('0x30')](_0x15eabd,_0x46b2('0x2d'));_0x3341df['query']=_[_0x46b2('0x35')](_0x11de37['query']);_0x3341df[_0x46b2('0x36')]=_[_0x46b2('0x37')](_0x3341df[_0x46b2('0x34')],_0x3341df[_0x46b2('0x38')]);_0x1a2a6d[_0x46b2('0x39')]=_[_0x46b2('0x37')](_0x3341df[_0x46b2('0x34')],qs['fields'](_0x11de37[_0x46b2('0x38')][_0x46b2('0x3a')]));_0x1a2a6d[_0x46b2('0x39')]=_0x1a2a6d[_0x46b2('0x39')][_0x46b2('0x3b')]?_0x1a2a6d[_0x46b2('0x39')]:_0x3341df[_0x46b2('0x34')];if(!_0x11de37['query']['hasOwnProperty']('nolimit')){_0x1a2a6d[_0x46b2('0x20')]=qs[_0x46b2('0x20')](_0x11de37['query'][_0x46b2('0x20')]);_0x1a2a6d['offset']=qs['offset'](_0x11de37[_0x46b2('0x38')][_0x46b2('0x1f')]);}_0x1a2a6d[_0x46b2('0x3c')]=qs[_0x46b2('0x3d')](_0x11de37['query'][_0x46b2('0x3d')]);_0x1a2a6d['where']=qs['filters'](_['pick'](_0x11de37[_0x46b2('0x38')],_0x3341df[_0x46b2('0x36')]),_0x15eabd);if(_0x11de37[_0x46b2('0x38')]['filter']){_0x1a2a6d[_0x46b2('0x3e')]=_['merge'](_0x1a2a6d[_0x46b2('0x3e')],{'$or':_[_0x46b2('0x30')](_0x15eabd,function(_0x506e75){if(_0x506e75[_0x46b2('0x3f')]!=='VIRTUAL'){var _0x49466a={};_0x49466a[_0x506e75[_0x46b2('0x2d')]]={'$like':'%'+_0x11de37['query'][_0x46b2('0x40')]+'%'};return _0x49466a;}})});}_0x1a2a6d=_[_0x46b2('0x41')]({},_0x1a2a6d,_0x11de37[_0x46b2('0x42')]);var _0x3c15b1={'where':_0x1a2a6d['where']};return db[_0x46b2('0x43')][_0x46b2('0x22')](_0x3c15b1)[_0x46b2('0x28')](function(_0x4fdfeb){_0x36a746['count']=_0x4fdfeb;if(_0x11de37[_0x46b2('0x38')][_0x46b2('0x44')]){_0x1a2a6d[_0x46b2('0x45')]=[{'all':!![]}];}return db[_0x46b2('0x43')]['findAll'](_0x1a2a6d);})['then'](function(_0xd405c2){_0x36a746[_0x46b2('0x46')]=_0xd405c2;return _0x36a746;})[_0x46b2('0x28')](respondWithFilteredResult(_0x3fc156,_0x1a2a6d))[_0x46b2('0x47')](handleError(_0x3fc156,null));};exports[_0x46b2('0x48')]=function(_0x3bdd15,_0x50d663){var _0x5172f4={'raw':!![],'where':{'id':_0x3bdd15[_0x46b2('0x49')]['id']}},_0x39a45c={};_0x39a45c[_0x46b2('0x34')]=_[_0x46b2('0x35')](db['MailQueue'][_0x46b2('0x31')]);_0x39a45c[_0x46b2('0x38')]=_[_0x46b2('0x35')](_0x3bdd15[_0x46b2('0x38')]);_0x39a45c['filters']=_[_0x46b2('0x37')](_0x39a45c[_0x46b2('0x34')],_0x39a45c[_0x46b2('0x38')]);_0x5172f4[_0x46b2('0x39')]=_[_0x46b2('0x37')](_0x39a45c[_0x46b2('0x34')],qs[_0x46b2('0x3a')](_0x3bdd15['query'][_0x46b2('0x3a')]));_0x5172f4[_0x46b2('0x39')]=_0x5172f4['attributes'][_0x46b2('0x3b')]?_0x5172f4['attributes']:_0x39a45c[_0x46b2('0x34')];if(_0x3bdd15['query'][_0x46b2('0x44')]){_0x5172f4[_0x46b2('0x45')]=[{'all':!![]}];}_0x5172f4=_['merge']({},_0x5172f4,_0x3bdd15[_0x46b2('0x42')]);return db[_0x46b2('0x43')]['find'](_0x5172f4)['then'](handleEntityNotFound(_0x50d663,null))[_0x46b2('0x28')](respondWithResult(_0x50d663,null))['catch'](handleError(_0x50d663,null));};exports[_0x46b2('0x4a')]=function(_0x5c836f,_0xb2cf36){return db[_0x46b2('0x43')][_0x46b2('0x4a')](_0x5c836f[_0x46b2('0x4b')],{})[_0x46b2('0x28')](function(_0x251c28){var _0x3a17cf=_0x5c836f[_0x46b2('0x4c')][_0x46b2('0x4d')]({'plain':!![]});if(!_0x3a17cf)throw new Error(_0x46b2('0x4e'));if(_0x3a17cf[_0x46b2('0x4f')]===_0x46b2('0x4c')){var _0x4ee758=_0x251c28[_0x46b2('0x4d')]({'plain':!![]});var _0x11b05f='MailQueues';return db[_0x46b2('0x50')]['find']({'where':{'name':_0x11b05f,'userProfileId':_0x3a17cf[_0x46b2('0x51')]},'raw':!![]})[_0x46b2('0x28')](function(_0x3d6189){if(_0x3d6189&&_0x3d6189[_0x46b2('0x52')]===0x0){return db[_0x46b2('0x2b')][_0x46b2('0x4a')]({'name':_0x4ee758[_0x46b2('0x2d')],'resourceId':_0x4ee758['id'],'type':_0x3d6189[_0x46b2('0x2d')],'sectionId':_0x3d6189['id']},{})[_0x46b2('0x28')](function(){return _0x251c28;});}else{return _0x251c28;}})[_0x46b2('0x47')](function(_0x4a010e){logger[_0x46b2('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a010e);throw _0x4a010e;});}return _0x251c28;})['then'](respondWithResult(_0xb2cf36,0xc9))[_0x46b2('0x47')](handleError(_0xb2cf36,null));};exports[_0x46b2('0x27')]=function(_0x510719,_0x421efc){if(_0x510719[_0x46b2('0x4b')]['id']){delete _0x510719[_0x46b2('0x4b')]['id'];}return db[_0x46b2('0x43')][_0x46b2('0x53')]({'where':{'id':_0x510719[_0x46b2('0x49')]['id']}})[_0x46b2('0x28')](handleEntityNotFound(_0x421efc,null))[_0x46b2('0x28')](saveUpdates(_0x510719[_0x46b2('0x4b')],null))['then'](respondWithResult(_0x421efc,null))[_0x46b2('0x47')](handleError(_0x421efc,null));};exports[_0x46b2('0x29')]=function(_0x322723,_0xe1d839){return db[_0x46b2('0x43')][_0x46b2('0x53')]({'where':{'id':_0x322723['params']['id']}})[_0x46b2('0x28')](handleEntityNotFound(_0xe1d839,null))[_0x46b2('0x28')](removeEntity(_0xe1d839,null))['catch'](handleError(_0xe1d839,null));};exports[_0x46b2('0x54')]=function(_0x39929c,_0x53378e){return db['MailQueue'][_0x46b2('0x54')]()[_0x46b2('0x28')](respondWithResult(_0x53378e,null))[_0x46b2('0x47')](handleError(_0x53378e,null));};exports['getMembers']=function(_0x52203a,_0x320b75,_0xfd511f){var _0x84131f={'raw':!![],'where':{}},_0x5da641={},_0x307840;return db[_0x46b2('0x43')][_0x46b2('0x55')]({'where':{'id':_0x52203a[_0x46b2('0x49')]['id']}})[_0x46b2('0x28')](handleEntityNotFound(_0x320b75,null))[_0x46b2('0x28')](function(_0x49d2d7){if(_0x49d2d7){_0x307840=_0x49d2d7['get']({'plain':!![]});_0x5da641[_0x46b2('0x34')]=_['keys'](db[_0x46b2('0x56')][_0x46b2('0x31')]);_0x5da641[_0x46b2('0x38')]=_[_0x46b2('0x35')](_0x52203a[_0x46b2('0x38')]);_0x5da641[_0x46b2('0x36')]=_[_0x46b2('0x37')](_0x5da641[_0x46b2('0x34')],_0x5da641[_0x46b2('0x38')]);_0x84131f[_0x46b2('0x39')]=_[_0x46b2('0x37')](_0x5da641['model'],qs[_0x46b2('0x3a')](_0x52203a[_0x46b2('0x38')][_0x46b2('0x3a')]));_0x84131f['attributes']=_0x84131f['attributes'][_0x46b2('0x3b')]?_0x84131f[_0x46b2('0x39')]:_0x5da641['model'];if(!_0x52203a[_0x46b2('0x38')][_0x46b2('0x57')]('nolimit')){_0x84131f[_0x46b2('0x20')]=qs['limit'](_0x52203a[_0x46b2('0x38')][_0x46b2('0x20')]);_0x84131f[_0x46b2('0x1f')]=qs[_0x46b2('0x1f')](_0x52203a[_0x46b2('0x38')][_0x46b2('0x1f')]);}_0x84131f['order']=qs[_0x46b2('0x3d')](_0x52203a[_0x46b2('0x38')][_0x46b2('0x3d')]);_0x84131f[_0x46b2('0x3e')]=qs[_0x46b2('0x36')](_[_0x46b2('0x58')](_0x52203a[_0x46b2('0x38')],_0x5da641[_0x46b2('0x36')]));_0x84131f['where'][_0x46b2('0x59')]=_0x49d2d7['id'];if(_0x52203a['query']['filter']){_0x84131f['where']=_[_0x46b2('0x41')](_0x84131f[_0x46b2('0x3e')],{'$or':_[_0x46b2('0x30')](_0x84131f['attributes'],function(_0x2f2ee7){var _0x6962c1={};_0x6962c1[_0x2f2ee7]={'$like':'%'+_0x52203a['query'][_0x46b2('0x40')]+'%'};return _0x6962c1;})});}_0x84131f=_[_0x46b2('0x41')]({},_0x84131f,_0x52203a[_0x46b2('0x42')]);return db['UserMailQueue']['findAll'](_0x84131f);}})['then'](function(_0x569221){if(_0x569221){return db[_0x46b2('0x5a')]['findAndCountAll']({'where':{'id':_[_0x46b2('0x30')](_0x569221,_0x46b2('0x5b')),'role':_0x46b2('0x5c')},'attributes':['id','name',_0x46b2('0x5d'),_0x46b2('0x5e'),_0x46b2('0x5f')]});}})[_0x46b2('0x28')](function(_0x50a97b){if(_0x50a97b){return{'count':_0x50a97b['count'],'rows':_[_0x46b2('0x30')](_0x50a97b[_0x46b2('0x46')],function(_0x5a701e){return{'membername':_0x5a701e[_0x46b2('0x2d')],'UserId':_0x5a701e['id'],'queue_name':_0x307840[_0x46b2('0x2d')],'MailQueueId':_0x307840['id'],'interface':util['format'](_0x46b2('0x60'),'SIP',_0x5a701e['name']),'penalty':0x0,'paused':_0x5a701e[_0x46b2('0x5d')],'createdAt':_0x5a701e[_0x46b2('0x5f')],'updatedAt':_0x5a701e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x46b2('0x28')](respondWithFilteredResult(_0x320b75,_0x84131f))[_0x46b2('0x47')](handleError(_0x320b75,null));};exports[_0x46b2('0x61')]=function(_0x2f3c30,_0x16e2c4,_0x221d36){var _0x15bc51={};var _0x2bab08={};var _0x156692;var _0xc391de;return db[_0x46b2('0x43')][_0x46b2('0x55')]({'where':{'id':_0x2f3c30['params']['id']}})[_0x46b2('0x28')](handleEntityNotFound(_0x16e2c4,null))[_0x46b2('0x28')](function(_0x4b7c07){if(_0x4b7c07){_0x156692=_0x4b7c07;_0x2bab08[_0x46b2('0x34')]=_[_0x46b2('0x35')](db[_0x46b2('0x62')][_0x46b2('0x31')]);_0x2bab08[_0x46b2('0x38')]=_[_0x46b2('0x35')](_0x2f3c30['query']);_0x2bab08[_0x46b2('0x36')]=_[_0x46b2('0x37')](_0x2bab08[_0x46b2('0x34')],_0x2bab08[_0x46b2('0x38')]);_0x15bc51['attributes']=_[_0x46b2('0x37')](_0x2bab08['model'],qs[_0x46b2('0x3a')](_0x2f3c30[_0x46b2('0x38')]['fields']));_0x15bc51[_0x46b2('0x39')]=_0x15bc51['attributes']['length']?_0x15bc51[_0x46b2('0x39')]:_0x2bab08[_0x46b2('0x34')];_0x15bc51['order']=qs[_0x46b2('0x3d')](_0x2f3c30[_0x46b2('0x38')]['sort']);_0x15bc51[_0x46b2('0x3e')]=qs[_0x46b2('0x36')](_['pick'](_0x2f3c30[_0x46b2('0x38')],_0x2bab08[_0x46b2('0x36')]));if(_0x2f3c30[_0x46b2('0x38')][_0x46b2('0x40')]){_0x15bc51[_0x46b2('0x3e')]=_[_0x46b2('0x41')](_0x15bc51[_0x46b2('0x3e')],{'$or':_[_0x46b2('0x30')](_0x15bc51[_0x46b2('0x39')],function(_0x5105b6){var _0x1a25cd={};_0x1a25cd[_0x5105b6]={'$like':'%'+_0x2f3c30[_0x46b2('0x38')][_0x46b2('0x40')]+'%'};return _0x1a25cd;})});}_0x15bc51=_['merge']({},_0x15bc51,_0x2f3c30[_0x46b2('0x42')]);return _0x156692['getTeams'](_0x15bc51);}})['then'](function(_0x12e89f){if(_0x12e89f){_0xc391de=_0x12e89f[_0x46b2('0x3b')];if(!_0x2f3c30[_0x46b2('0x38')][_0x46b2('0x57')](_0x46b2('0x63'))){_0x15bc51[_0x46b2('0x20')]=qs[_0x46b2('0x20')](_0x2f3c30[_0x46b2('0x38')][_0x46b2('0x20')]);_0x15bc51[_0x46b2('0x1f')]=qs[_0x46b2('0x1f')](_0x2f3c30[_0x46b2('0x38')][_0x46b2('0x1f')]);}return _0x156692[_0x46b2('0x61')](_0x15bc51);}})[_0x46b2('0x28')](function(_0x1b8b39){if(_0x1b8b39){return _0x1b8b39?{'count':_0xc391de,'rows':_0x1b8b39}:null;}})[_0x46b2('0x28')](respondWithResult(_0x16e2c4,null))[_0x46b2('0x47')](handleError(_0x16e2c4,null));};exports[_0x46b2('0x64')]=function(_0x556f43,_0x360112,_0xb6df84){var _0x59fa1c=_0x556f43[_0x46b2('0x4b')][_0x46b2('0x65')];return db['Team']['findAll']({'where':{'id':_0x59fa1c},'attributes':['id'],'include':[{'model':db[_0x46b2('0x5a')],'as':_0x46b2('0x66'),'attributes':['id',_0x46b2('0x2d'),'online',_0x46b2('0x67'),_0x46b2('0x68')],'raw':!![]}]})[_0x46b2('0x28')](function(_0x1cd762){if(_0x1cd762){var _0x4e066d=_[_0x46b2('0x69')](_0x1cd762,function(_0x4a47f1){var _0x5d7c6b=_0x4a47f1[_0x46b2('0x4d')]({'plain':!![]});return _0x5d7c6b['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x556f43['params']['id']}})['then'](function(_0x378d0c){return db['sequelize'][_0x46b2('0x6a')](function(_0x4fe1b0){return _0x378d0c[_0x46b2('0x64')](_0x59fa1c,{'transaction':_0x4fe1b0})['then'](function(){return BPromise[_0x46b2('0x6b')](_0x4e066d,function(_0x17ea16){return db[_0x46b2('0x56')]['findOrCreate']({'where':{'UserId':_0x17ea16['id'],'MailQueueId':_0x556f43['params']['id']},'transaction':_0x4fe1b0});});})[_0x46b2('0x28')](function(){_0x4e066d[_0x46b2('0x6c')](function(_0xdedc56){socket[_0x46b2('0x6d')](_0x46b2('0x6e'),{'UserId':_0xdedc56['id'],'MailQueueId':_0x378d0c['id']});});});});});}})[_0x46b2('0x28')](respondWithStatusCode(_0x360112,null))[_0x46b2('0x47')](handleError(_0x360112,null));};exports[_0x46b2('0x6f')]=function(_0x195941,_0x1dd4d1,_0x11b643){return db[_0x46b2('0x62')][_0x46b2('0x70')]({'where':{'id':_0x195941[_0x46b2('0x38')][_0x46b2('0x65')]},'attributes':['id'],'include':[{'model':db[_0x46b2('0x5a')],'as':_0x46b2('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1dd4d1,null))[_0x46b2('0x28')](function(_0xbc9357){var _0x258f5f=_[_0x46b2('0x30')](_0xbc9357,'id');var _0x4d82b4=[];var _0x1ca18d=[];var _0x1c84e4=squel['select']();_0x1c84e4['field'](_0x46b2('0x71'))[_0x46b2('0x72')](_0x46b2('0x73'),'tq')[_0x46b2('0x74')]('user_has_teams','ut',_0x46b2('0x75'))[_0x46b2('0x3e')](_0x46b2('0x76'),_0x195941[_0x46b2('0x49')]['id']);for(var _0x3693b4=0x0;_0x3693b4<_0xbc9357[_0x46b2('0x3b')];_0x3693b4+=0x1){let _0x172573=_0xbc9357[_0x3693b4];for(var _0x431221=0x0;_0x431221<_0x172573[_0x46b2('0x66')][_0x46b2('0x3b')];_0x431221+=0x1){let _0x36513c=_0x172573['Agents'][_0x431221];var _0x351954=_0x1c84e4[_0x46b2('0x77')]();_0x351954[_0x46b2('0x3e')]('ut.UserId\x20=\x20?',_0x36513c['id']);_0x1ca18d['push'](db[_0x46b2('0x78')][_0x46b2('0x38')](_0x351954[_0x46b2('0x79')](),{'type':db['sequelize'][_0x46b2('0x7a')][_0x46b2('0x7b')]})[_0x46b2('0x28')](function(_0x5576de){if(_0x5576de['length']===0x1){return _0x36513c['id'];}else{var _0x121531=_['every'](_[_0x46b2('0x30')](_0x5576de,_0x46b2('0x7c')),function(_0x5903e0){return _['includes'](_0x258f5f,_0x5903e0);});if(_0x121531){return _0x36513c['id'];}}}));}}return BPromise[_0x46b2('0x7d')](_0x1ca18d)[_0x46b2('0x28')](function(_0x7ad53){_0x4d82b4=_(_0x4d82b4)[_0x46b2('0x7e')](_0x7ad53)['compact']()[_0x46b2('0x7f')]();return db[_0x46b2('0x43')][_0x46b2('0x53')]({'where':{'id':_0x195941['params']['id']}})[_0x46b2('0x28')](function(_0x52b35a){return db[_0x46b2('0x78')][_0x46b2('0x6a')](function(_0x3a0887){return _0x52b35a[_0x46b2('0x6f')](_0x195941[_0x46b2('0x38')][_0x46b2('0x65')],{'transaction':_0x3a0887})[_0x46b2('0x28')](function(){if(!_[_0x46b2('0x80')](_0x4d82b4)){return _0x52b35a[_0x46b2('0x81')](_0x4d82b4,{'transaction':_0x3a0887});}})[_0x46b2('0x28')](function(){_0x4d82b4['forEach'](function(_0x46ce1e){socket[_0x46b2('0x6d')](_0x46b2('0x82'),{'UserId':_0x46ce1e,'MailQueueId':_0x52b35a['id']});});});});});});})[_0x46b2('0x28')](respondWithStatusCode(_0x1dd4d1,null))[_0x46b2('0x47')](handleError(_0x1dd4d1,null));};exports[_0x46b2('0x83')]=function(_0x37c5a6,_0x141038,_0x46941b){return db[_0x46b2('0x43')][_0x46b2('0x53')]({'where':{'id':_0x37c5a6['params']['id']}})[_0x46b2('0x28')](handleEntityNotFound(_0x141038,null))[_0x46b2('0x28')](function(_0x4b01c0){if(_0x4b01c0){return _0x4b01c0[_0x46b2('0x83')](_0x37c5a6['body'][_0x46b2('0x65')],_[_0x46b2('0x84')](_0x37c5a6[_0x46b2('0x4b')],[_0x46b2('0x65'),'id'])||{})[_0x46b2('0x85')](function(_0x309cbb){for(var _0x4ef0b2=0x0;_0x4ef0b2<_0x37c5a6['body'][_0x46b2('0x65')][_0x46b2('0x3b')];_0x4ef0b2+=0x1){socket[_0x46b2('0x6d')](_0x46b2('0x6e'),{'UserId':Number(_0x37c5a6[_0x46b2('0x4b')]['ids'][_0x4ef0b2]),'MailQueueId':Number(_0x37c5a6[_0x46b2('0x49')]['id'])});}return _0x309cbb;});}})[_0x46b2('0x28')](respondWithResult(_0x141038,null))[_0x46b2('0x47')](handleError(_0x141038,null));};exports[_0x46b2('0x81')]=function(_0x49f3ed,_0x50a588,_0x4c5321){return db[_0x46b2('0x43')][_0x46b2('0x53')]({'where':{'id':_0x49f3ed['params']['id']}})[_0x46b2('0x28')](handleEntityNotFound(_0x50a588,null))[_0x46b2('0x28')](function(_0x599451){if(_0x599451){return _0x599451['removeAgents'](_0x49f3ed[_0x46b2('0x38')][_0x46b2('0x65')])[_0x46b2('0x28')](function(){if(_[_0x46b2('0x86')](_0x49f3ed[_0x46b2('0x38')]['ids'])){for(var _0x1a28c5=0x0;_0x1a28c5<_0x49f3ed['query'][_0x46b2('0x65')][_0x46b2('0x3b')];_0x1a28c5+=0x1){socket[_0x46b2('0x6d')](_0x46b2('0x82'),{'UserId':Number(_0x49f3ed[_0x46b2('0x38')]['ids'][_0x1a28c5]),'MailQueueId':Number(_0x49f3ed[_0x46b2('0x49')]['id'])});}}else{socket[_0x46b2('0x6d')](_0x46b2('0x82'),{'UserId':Number(_0x49f3ed[_0x46b2('0x38')][_0x46b2('0x65')]),'MailQueueId':Number(_0x49f3ed[_0x46b2('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x50a588,null))[_0x46b2('0x47')](handleError(_0x50a588,null));};exports[_0x46b2('0x87')]=function(_0xb63a8f,_0x3900a5,_0x22adbf){var _0x5d4200={};var _0x4ebdc1={};var _0x57eb8e;var _0x328bfe;return db[_0x46b2('0x43')][_0x46b2('0x55')]({'where':{'id':_0xb63a8f[_0x46b2('0x49')]['id']}})[_0x46b2('0x28')](handleEntityNotFound(_0x3900a5,null))[_0x46b2('0x28')](function(_0x45ae7b){if(_0x45ae7b){_0x57eb8e=_0x45ae7b;_0x4ebdc1['model']=_[_0x46b2('0x35')](db[_0x46b2('0x5a')][_0x46b2('0x31')]);_0x4ebdc1[_0x46b2('0x38')]=_[_0x46b2('0x35')](_0xb63a8f['query']);_0x4ebdc1[_0x46b2('0x36')]=_[_0x46b2('0x37')](_0x4ebdc1[_0x46b2('0x34')],_0x4ebdc1[_0x46b2('0x38')]);_0x5d4200[_0x46b2('0x39')]=_['intersection'](_0x4ebdc1['model'],qs['fields'](_0xb63a8f[_0x46b2('0x38')]['fields']));_0x5d4200[_0x46b2('0x39')]=_0x5d4200[_0x46b2('0x39')]['length']?_0x5d4200['attributes']:_0x4ebdc1[_0x46b2('0x34')];_0x5d4200['order']=qs[_0x46b2('0x3d')](_0xb63a8f['query'][_0x46b2('0x3d')]);_0x5d4200[_0x46b2('0x3e')]=qs[_0x46b2('0x36')](_['pick'](_0xb63a8f[_0x46b2('0x38')],_0x4ebdc1['filters']));if(_0xb63a8f[_0x46b2('0x38')][_0x46b2('0x40')]){_0x5d4200[_0x46b2('0x3e')]=_[_0x46b2('0x41')](_0x5d4200[_0x46b2('0x3e')],{'$or':_['map'](_0x5d4200['attributes'],function(_0x20ff70){var _0x2a4f1a={};_0x2a4f1a[_0x20ff70]={'$like':'%'+_0xb63a8f[_0x46b2('0x38')][_0x46b2('0x40')]+'%'};return _0x2a4f1a;})});}_0x5d4200=_[_0x46b2('0x41')]({},_0x5d4200,_0xb63a8f['options']);return _0x57eb8e[_0x46b2('0x87')](_0x5d4200);}})['then'](function(_0x9d089a){if(_0x9d089a){_0x328bfe=_0x9d089a[_0x46b2('0x3b')];if(!_0xb63a8f[_0x46b2('0x38')][_0x46b2('0x57')](_0x46b2('0x63'))){_0x5d4200[_0x46b2('0x20')]=qs[_0x46b2('0x20')](_0xb63a8f[_0x46b2('0x38')]['limit']);_0x5d4200[_0x46b2('0x1f')]=qs['offset'](_0xb63a8f[_0x46b2('0x38')]['offset']);}return _0x57eb8e[_0x46b2('0x87')](_0x5d4200);}})['then'](function(_0x2cf272){if(_0x2cf272){return _0x2cf272?{'count':_0x328bfe,'rows':_0x2cf272}:null;}})[_0x46b2('0x28')](respondWithResult(_0x3900a5,null))[_0x46b2('0x47')](handleError(_0x3900a5,null));}; \ No newline at end of file +var _0xa81e=['flatMap','sequelize','transaction','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','includes','all','union','compact','value','removeAgents','forEach','addAgents','spread','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','get','MailQueues','destroy','then','error','send','index','map','MailQueue','fieldName','key','model','name','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','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','update','describe','getMembers','UserMailQueue','MailQueueId','options','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa81e,0x13c));var _0xea81=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa81e[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require(_0xea81('0x0'));var rimraf=require(_0xea81('0x1'));var zipdir=require(_0xea81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea81('0x3'));var moment=require(_0xea81('0x4'));var BPromise=require(_0xea81('0x5'));var Mustache=require(_0xea81('0x6'));var util=require(_0xea81('0x7'));var path=require(_0xea81('0x8'));var sox=require(_0xea81('0x9'));var csv=require(_0xea81('0xa'));var ejs=require(_0xea81('0xb'));var fs=require('fs');var fs_extra=require(_0xea81('0xc'));var _=require('lodash');var squel=require(_0xea81('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xea81('0xe'));var toCsv=require(_0xea81('0xa'));var querystring=require(_0xea81('0xf'));var Papa=require('papaparse');var Redis=require(_0xea81('0x10'));var authService=require(_0xea81('0x11'));var qs=require(_0xea81('0x12'));var as=require(_0xea81('0x13'));var hardwareService=require(_0xea81('0x14'));var logger=require(_0xea81('0x15'))('api');var utils=require(_0xea81('0x16'));var config=require(_0xea81('0x17'));var licenseUtil=require(_0xea81('0x18'));var db=require('../../mysqldb')['db'];config[_0xea81('0x19')]=_[_0xea81('0x1a')](config[_0xea81('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xea81('0x1b'))(new Redis(config['redis']));require(_0xea81('0x1c'))[_0xea81('0x1d')](socket);function respondWithStatusCode(_0x56c2c0,_0xadd0b9){_0xadd0b9=_0xadd0b9||0xcc;return function(_0x25fb42){if(_0x25fb42){return _0x56c2c0[_0xea81('0x1e')](_0xadd0b9);}return _0x56c2c0['status'](_0xadd0b9)[_0xea81('0x1f')]();};}function respondWithResult(_0x392a25,_0x558b8f){_0x558b8f=_0x558b8f||0xc8;return function(_0x931398){if(_0x931398){return _0x392a25[_0xea81('0x20')](_0x558b8f)[_0xea81('0x21')](_0x931398);}};}function respondWithFilteredResult(_0x1e5b38,_0x31f94f){return function(_0x5d8a34){if(_0x5d8a34){var _0x100655=typeof _0x31f94f[_0xea81('0x22')]===_0xea81('0x23')&&typeof _0x31f94f[_0xea81('0x24')]==='undefined';var _0x4c5594=_0x5d8a34[_0xea81('0x25')];var _0x23ac51=_0x100655?0x0:_0x31f94f[_0xea81('0x22')];var _0x3946de=_0x100655?_0x5d8a34['count']:_0x31f94f[_0xea81('0x22')]+_0x31f94f[_0xea81('0x24')];var _0xd72ca5;if(_0x3946de>=_0x4c5594){_0x3946de=_0x4c5594;_0xd72ca5=0xc8;}else{_0xd72ca5=0xce;}_0x1e5b38[_0xea81('0x20')](_0xd72ca5);return _0x1e5b38['set']('Content-Range',_0x23ac51+'-'+_0x3946de+'/'+_0x4c5594)[_0xea81('0x21')](_0x5d8a34);}return null;};}function patchUpdates(_0x52b3d5){return function(_0x1c9ba9){try{jsonpatch[_0xea81('0x26')](_0x1c9ba9,_0x52b3d5,!![]);}catch(_0x1a3c61){return BPromise[_0xea81('0x27')](_0x1a3c61);}return _0x1c9ba9[_0xea81('0x28')]();};}function saveUpdates(_0x3d6d9b,_0x1312ef){return function(_0x144f50){if(_0x144f50){return _0x144f50['update'](_0x3d6d9b)['then'](function(_0x1c5015){return _0x1c5015;});}return null;};}function removeEntity(_0x257973,_0x4c0e6){return function(_0x2b1e20){if(_0x2b1e20){return _0x2b1e20['destroy']()['then'](function(){var _0x157293=_0x2b1e20[_0xea81('0x29')]({'plain':!![]});var _0x27e152=_0xea81('0x2a');return db['UserProfileResource'][_0xea81('0x2b')]({'where':{'type':_0x27e152,'resourceId':_0x157293['id']}})[_0xea81('0x2c')](function(){return _0x2b1e20;});})[_0xea81('0x2c')](function(){_0x257973[_0xea81('0x20')](0xcc)[_0xea81('0x1f')]();});}};}function handleEntityNotFound(_0x4219ce,_0x9cb1a3){return function(_0x50ade8){if(!_0x50ade8){_0x4219ce['sendStatus'](0x194);}return _0x50ade8;};}function handleError(_0xdc05ca,_0x4e2f66){_0x4e2f66=_0x4e2f66||0x1f4;return function(_0x3544de){logger[_0xea81('0x2d')](_0x3544de['stack']);if(_0x3544de['name']){delete _0x3544de['name'];}_0xdc05ca[_0xea81('0x20')](_0x4e2f66)[_0xea81('0x2e')](_0x3544de);};}exports[_0xea81('0x2f')]=function(_0x1f6ee7,_0x5c8123){var _0x54ac0e={},_0x1299cb={},_0x183d49={'count':0x0,'rows':[]};var _0x44a111=_[_0xea81('0x30')](db[_0xea81('0x31')]['rawAttributes'],function(_0x3660eb){return{'name':_0x3660eb[_0xea81('0x32')],'type':_0x3660eb['type'][_0xea81('0x33')]};});_0x1299cb[_0xea81('0x34')]=_[_0xea81('0x30')](_0x44a111,_0xea81('0x35'));_0x1299cb[_0xea81('0x36')]=_['keys'](_0x1f6ee7['query']);_0x1299cb[_0xea81('0x37')]=_['intersection'](_0x1299cb[_0xea81('0x34')],_0x1299cb['query']);_0x54ac0e[_0xea81('0x38')]=_[_0xea81('0x39')](_0x1299cb[_0xea81('0x34')],qs['fields'](_0x1f6ee7['query'][_0xea81('0x3a')]));_0x54ac0e[_0xea81('0x38')]=_0x54ac0e['attributes'][_0xea81('0x3b')]?_0x54ac0e[_0xea81('0x38')]:_0x1299cb[_0xea81('0x34')];if(!_0x1f6ee7[_0xea81('0x36')]['hasOwnProperty'](_0xea81('0x3c'))){_0x54ac0e[_0xea81('0x24')]=qs['limit'](_0x1f6ee7['query'][_0xea81('0x24')]);_0x54ac0e['offset']=qs[_0xea81('0x22')](_0x1f6ee7[_0xea81('0x36')][_0xea81('0x22')]);}_0x54ac0e[_0xea81('0x3d')]=qs['sort'](_0x1f6ee7['query'][_0xea81('0x3e')]);_0x54ac0e[_0xea81('0x3f')]=qs[_0xea81('0x37')](_[_0xea81('0x40')](_0x1f6ee7[_0xea81('0x36')],_0x1299cb[_0xea81('0x37')]),_0x44a111);if(_0x1f6ee7[_0xea81('0x36')][_0xea81('0x41')]){_0x54ac0e['where']=_[_0xea81('0x42')](_0x54ac0e[_0xea81('0x3f')],{'$or':_[_0xea81('0x30')](_0x44a111,function(_0x869b7a){if(_0x869b7a[_0xea81('0x43')]!==_0xea81('0x44')){var _0xce2dbe={};_0xce2dbe[_0x869b7a[_0xea81('0x35')]]={'$like':'%'+_0x1f6ee7[_0xea81('0x36')][_0xea81('0x41')]+'%'};return _0xce2dbe;}})});}_0x54ac0e=_['merge']({},_0x54ac0e,_0x1f6ee7['options']);var _0x1ddc71={'where':_0x54ac0e[_0xea81('0x3f')]};return db[_0xea81('0x31')][_0xea81('0x25')](_0x1ddc71)[_0xea81('0x2c')](function(_0x2f0321){_0x183d49['count']=_0x2f0321;if(_0x1f6ee7[_0xea81('0x36')][_0xea81('0x45')]){_0x54ac0e[_0xea81('0x46')]=[{'all':!![]}];}return db[_0xea81('0x31')][_0xea81('0x47')](_0x54ac0e);})[_0xea81('0x2c')](function(_0xaf3f42){_0x183d49[_0xea81('0x48')]=_0xaf3f42;return _0x183d49;})[_0xea81('0x2c')](respondWithFilteredResult(_0x5c8123,_0x54ac0e))[_0xea81('0x49')](handleError(_0x5c8123,null));};exports[_0xea81('0x4a')]=function(_0x2ce06c,_0x332c89){var _0x1eb413={'raw':!![],'where':{'id':_0x2ce06c[_0xea81('0x4b')]['id']}},_0x5bb03b={};_0x5bb03b[_0xea81('0x34')]=_['keys'](db[_0xea81('0x31')][_0xea81('0x4c')]);_0x5bb03b[_0xea81('0x36')]=_[_0xea81('0x4d')](_0x2ce06c['query']);_0x5bb03b[_0xea81('0x37')]=_[_0xea81('0x39')](_0x5bb03b[_0xea81('0x34')],_0x5bb03b[_0xea81('0x36')]);_0x1eb413[_0xea81('0x38')]=_[_0xea81('0x39')](_0x5bb03b[_0xea81('0x34')],qs['fields'](_0x2ce06c['query'][_0xea81('0x3a')]));_0x1eb413[_0xea81('0x38')]=_0x1eb413[_0xea81('0x38')][_0xea81('0x3b')]?_0x1eb413[_0xea81('0x38')]:_0x5bb03b[_0xea81('0x34')];if(_0x2ce06c[_0xea81('0x36')][_0xea81('0x45')]){_0x1eb413[_0xea81('0x46')]=[{'all':!![]}];}_0x1eb413=_[_0xea81('0x42')]({},_0x1eb413,_0x2ce06c['options']);return db[_0xea81('0x31')][_0xea81('0x4e')](_0x1eb413)['then'](handleEntityNotFound(_0x332c89,null))['then'](respondWithResult(_0x332c89,null))['catch'](handleError(_0x332c89,null));};exports[_0xea81('0x4f')]=function(_0x246966,_0x3e913b){return db[_0xea81('0x31')]['create'](_0x246966[_0xea81('0x50')],{})[_0xea81('0x2c')](function(_0x4b482c){var _0x52ab64=_0x246966[_0xea81('0x51')][_0xea81('0x29')]({'plain':!![]});if(!_0x52ab64)throw new Error(_0xea81('0x52'));if(_0x52ab64[_0xea81('0x53')]==='user'){var _0x46c6ad=_0x4b482c['get']({'plain':!![]});var _0x4690e1='MailQueues';return db[_0xea81('0x54')]['find']({'where':{'name':_0x4690e1,'userProfileId':_0x52ab64[_0xea81('0x55')]},'raw':!![]})[_0xea81('0x2c')](function(_0x164596){if(_0x164596&&_0x164596[_0xea81('0x56')]===0x0){return db[_0xea81('0x57')]['create']({'name':_0x46c6ad['name'],'resourceId':_0x46c6ad['id'],'type':_0x164596[_0xea81('0x35')],'sectionId':_0x164596['id']},{})[_0xea81('0x2c')](function(){return _0x4b482c;});}else{return _0x4b482c;}})[_0xea81('0x49')](function(_0x3f6a48){logger[_0xea81('0x2d')](_0xea81('0x58'),_0x3f6a48);throw _0x3f6a48;});}return _0x4b482c;})[_0xea81('0x2c')](respondWithResult(_0x3e913b,0xc9))[_0xea81('0x49')](handleError(_0x3e913b,null));};exports[_0xea81('0x59')]=function(_0x5a6810,_0x1caa83){if(_0x5a6810[_0xea81('0x50')]['id']){delete _0x5a6810[_0xea81('0x50')]['id'];}return db[_0xea81('0x31')][_0xea81('0x4e')]({'where':{'id':_0x5a6810[_0xea81('0x4b')]['id']}})[_0xea81('0x2c')](handleEntityNotFound(_0x1caa83,null))['then'](saveUpdates(_0x5a6810[_0xea81('0x50')],null))[_0xea81('0x2c')](respondWithResult(_0x1caa83,null))[_0xea81('0x49')](handleError(_0x1caa83,null));};exports[_0xea81('0x2b')]=function(_0x741b8b,_0x8f1dfb){return db[_0xea81('0x31')][_0xea81('0x4e')]({'where':{'id':_0x741b8b[_0xea81('0x4b')]['id']}})[_0xea81('0x2c')](handleEntityNotFound(_0x8f1dfb,null))['then'](removeEntity(_0x8f1dfb,null))['catch'](handleError(_0x8f1dfb,null));};exports[_0xea81('0x5a')]=function(_0x20d7f9,_0x1ae0c2){return db[_0xea81('0x31')][_0xea81('0x5a')]()['then'](respondWithResult(_0x1ae0c2,null))[_0xea81('0x49')](handleError(_0x1ae0c2,null));};exports[_0xea81('0x5b')]=function(_0x3d6a17,_0x5e73ed,_0x20d44f){var _0x46d2f5={'raw':!![],'where':{}},_0x440869={},_0x2f34c3;return db['MailQueue']['findOne']({'where':{'id':_0x3d6a17[_0xea81('0x4b')]['id']}})[_0xea81('0x2c')](handleEntityNotFound(_0x5e73ed,null))[_0xea81('0x2c')](function(_0x3a62fe){if(_0x3a62fe){_0x2f34c3=_0x3a62fe['get']({'plain':!![]});_0x440869[_0xea81('0x34')]=_[_0xea81('0x4d')](db[_0xea81('0x5c')][_0xea81('0x4c')]);_0x440869[_0xea81('0x36')]=_[_0xea81('0x4d')](_0x3d6a17[_0xea81('0x36')]);_0x440869['filters']=_[_0xea81('0x39')](_0x440869[_0xea81('0x34')],_0x440869[_0xea81('0x36')]);_0x46d2f5[_0xea81('0x38')]=_['intersection'](_0x440869['model'],qs['fields'](_0x3d6a17[_0xea81('0x36')][_0xea81('0x3a')]));_0x46d2f5[_0xea81('0x38')]=_0x46d2f5['attributes']['length']?_0x46d2f5[_0xea81('0x38')]:_0x440869[_0xea81('0x34')];if(!_0x3d6a17['query']['hasOwnProperty']('nolimit')){_0x46d2f5[_0xea81('0x24')]=qs['limit'](_0x3d6a17[_0xea81('0x36')][_0xea81('0x24')]);_0x46d2f5[_0xea81('0x22')]=qs[_0xea81('0x22')](_0x3d6a17[_0xea81('0x36')][_0xea81('0x22')]);}_0x46d2f5[_0xea81('0x3d')]=qs[_0xea81('0x3e')](_0x3d6a17[_0xea81('0x36')]['sort']);_0x46d2f5[_0xea81('0x3f')]=qs[_0xea81('0x37')](_[_0xea81('0x40')](_0x3d6a17[_0xea81('0x36')],_0x440869[_0xea81('0x37')]));_0x46d2f5[_0xea81('0x3f')][_0xea81('0x5d')]=_0x3a62fe['id'];if(_0x3d6a17[_0xea81('0x36')][_0xea81('0x41')]){_0x46d2f5[_0xea81('0x3f')]=_['merge'](_0x46d2f5['where'],{'$or':_['map'](_0x46d2f5['attributes'],function(_0x319c7f){var _0x4693d6={};_0x4693d6[_0x319c7f]={'$like':'%'+_0x3d6a17[_0xea81('0x36')][_0xea81('0x41')]+'%'};return _0x4693d6;})});}_0x46d2f5=_[_0xea81('0x42')]({},_0x46d2f5,_0x3d6a17[_0xea81('0x5e')]);return db[_0xea81('0x5c')]['findAll'](_0x46d2f5);}})['then'](function(_0x4b3567){if(_0x4b3567){return db[_0xea81('0x5f')][_0xea81('0x60')]({'where':{'id':_[_0xea81('0x30')](_0x4b3567,'UserId'),'role':_0xea81('0x61')},'attributes':['id',_0xea81('0x35'),_0xea81('0x62'),_0xea81('0x63'),_0xea81('0x64')]});}})[_0xea81('0x2c')](function(_0x5df0d5){if(_0x5df0d5){return{'count':_0x5df0d5[_0xea81('0x25')],'rows':_[_0xea81('0x30')](_0x5df0d5[_0xea81('0x48')],function(_0x36b6aa){return{'membername':_0x36b6aa['name'],'UserId':_0x36b6aa['id'],'queue_name':_0x2f34c3[_0xea81('0x35')],'MailQueueId':_0x2f34c3['id'],'interface':util[_0xea81('0x65')](_0xea81('0x66'),_0xea81('0x67'),_0x36b6aa[_0xea81('0x35')]),'penalty':0x0,'paused':_0x36b6aa[_0xea81('0x62')],'createdAt':_0x36b6aa['createdAt'],'updatedAt':_0x36b6aa[_0xea81('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xea81('0x2c')](respondWithFilteredResult(_0x5e73ed,_0x46d2f5))[_0xea81('0x49')](handleError(_0x5e73ed,null));};exports[_0xea81('0x68')]=function(_0x84069d,_0x29a24b,_0x5604e3){var _0x2fab9d={};var _0xf8dbf={};var _0x471051;var _0x26e842;return db[_0xea81('0x31')][_0xea81('0x69')]({'where':{'id':_0x84069d[_0xea81('0x4b')]['id']}})[_0xea81('0x2c')](handleEntityNotFound(_0x29a24b,null))[_0xea81('0x2c')](function(_0x59d6d9){if(_0x59d6d9){_0x471051=_0x59d6d9;_0xf8dbf[_0xea81('0x34')]=_[_0xea81('0x4d')](db[_0xea81('0x6a')][_0xea81('0x4c')]);_0xf8dbf[_0xea81('0x36')]=_[_0xea81('0x4d')](_0x84069d[_0xea81('0x36')]);_0xf8dbf['filters']=_[_0xea81('0x39')](_0xf8dbf[_0xea81('0x34')],_0xf8dbf[_0xea81('0x36')]);_0x2fab9d[_0xea81('0x38')]=_[_0xea81('0x39')](_0xf8dbf[_0xea81('0x34')],qs['fields'](_0x84069d[_0xea81('0x36')][_0xea81('0x3a')]));_0x2fab9d['attributes']=_0x2fab9d[_0xea81('0x38')][_0xea81('0x3b')]?_0x2fab9d[_0xea81('0x38')]:_0xf8dbf['model'];_0x2fab9d['order']=qs[_0xea81('0x3e')](_0x84069d[_0xea81('0x36')][_0xea81('0x3e')]);_0x2fab9d[_0xea81('0x3f')]=qs[_0xea81('0x37')](_['pick'](_0x84069d[_0xea81('0x36')],_0xf8dbf[_0xea81('0x37')]));if(_0x84069d['query'][_0xea81('0x41')]){_0x2fab9d[_0xea81('0x3f')]=_[_0xea81('0x42')](_0x2fab9d[_0xea81('0x3f')],{'$or':_['map'](_0x2fab9d['attributes'],function(_0x4f85e6){var _0x41562b={};_0x41562b[_0x4f85e6]={'$like':'%'+_0x84069d[_0xea81('0x36')]['filter']+'%'};return _0x41562b;})});}_0x2fab9d=_['merge']({},_0x2fab9d,_0x84069d[_0xea81('0x5e')]);return _0x471051['getTeams'](_0x2fab9d);}})[_0xea81('0x2c')](function(_0x1d3e0a){if(_0x1d3e0a){_0x26e842=_0x1d3e0a[_0xea81('0x3b')];if(!_0x84069d[_0xea81('0x36')][_0xea81('0x6b')](_0xea81('0x3c'))){_0x2fab9d['limit']=qs['limit'](_0x84069d['query'][_0xea81('0x24')]);_0x2fab9d[_0xea81('0x22')]=qs[_0xea81('0x22')](_0x84069d[_0xea81('0x36')][_0xea81('0x22')]);}return _0x471051[_0xea81('0x68')](_0x2fab9d);}})[_0xea81('0x2c')](function(_0xab4132){if(_0xab4132){return _0xab4132?{'count':_0x26e842,'rows':_0xab4132}:null;}})['then'](respondWithResult(_0x29a24b,null))['catch'](handleError(_0x29a24b,null));};exports[_0xea81('0x6c')]=function(_0x3bace7,_0x5377e3,_0x8e6a6e){var _0x3836ba=_0x3bace7[_0xea81('0x50')][_0xea81('0x6d')];return db['Team'][_0xea81('0x47')]({'where':{'id':_0x3836ba},'attributes':['id'],'include':[{'model':db[_0xea81('0x5f')],'as':_0xea81('0x6e'),'attributes':['id',_0xea81('0x35'),_0xea81('0x6f'),_0xea81('0x70'),'interface'],'raw':!![]}]})[_0xea81('0x2c')](function(_0x3ed765){if(_0x3ed765){var _0x276084=_[_0xea81('0x71')](_0x3ed765,function(_0x96bc3c){var _0x241e2e=_0x96bc3c[_0xea81('0x29')]({'plain':!![]});return _0x241e2e[_0xea81('0x6e')];});return db[_0xea81('0x31')][_0xea81('0x4e')]({'where':{'id':_0x3bace7[_0xea81('0x4b')]['id']}})[_0xea81('0x2c')](function(_0x390421){return db[_0xea81('0x72')][_0xea81('0x73')](function(_0x5c7d10){return _0x390421[_0xea81('0x6c')](_0x3836ba,{'transaction':_0x5c7d10})[_0xea81('0x2c')](function(){return BPromise['each'](_0x276084,function(_0x4c0f8b){return db['UserMailQueue'][_0xea81('0x74')]({'where':{'UserId':_0x4c0f8b['id'],'MailQueueId':_0x3bace7['params']['id']},'transaction':_0x5c7d10});});})[_0xea81('0x2c')](function(){_0x276084['forEach'](function(_0x1cc0a4){socket[_0xea81('0x75')](_0xea81('0x76'),{'UserId':_0x1cc0a4['id'],'MailQueueId':_0x390421['id']});});});});});}})[_0xea81('0x2c')](respondWithStatusCode(_0x5377e3,null))[_0xea81('0x49')](handleError(_0x5377e3,null));};exports[_0xea81('0x77')]=function(_0x2b29d2,_0x8526db,_0x4067ea){return db['Team'][_0xea81('0x47')]({'where':{'id':_0x2b29d2[_0xea81('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xea81('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xea81('0x2c')](handleEntityNotFound(_0x8526db,null))[_0xea81('0x2c')](function(_0x24d7e4){var _0x17b659=_['map'](_0x24d7e4,'id');var _0x2822b7=[];var _0xffd0fd=[];var _0x18209d=squel[_0xea81('0x78')]();_0x18209d[_0xea81('0x79')]('tq.TeamId')[_0xea81('0x7a')](_0xea81('0x7b'),'tq')[_0xea81('0x7c')](_0xea81('0x7d'),'ut',_0xea81('0x7e'))[_0xea81('0x3f')](_0xea81('0x7f'),_0x2b29d2[_0xea81('0x4b')]['id']);for(var _0x388610=0x0;_0x388610<_0x24d7e4[_0xea81('0x3b')];_0x388610+=0x1){let _0x3010e8=_0x24d7e4[_0x388610];for(var _0x5e2146=0x0;_0x5e2146<_0x3010e8['Agents']['length'];_0x5e2146+=0x1){let _0x29021d=_0x3010e8[_0xea81('0x6e')][_0x5e2146];var _0x246faf=_0x18209d[_0xea81('0x80')]();_0x246faf[_0xea81('0x3f')](_0xea81('0x81'),_0x29021d['id']);_0xffd0fd[_0xea81('0x82')](db[_0xea81('0x72')][_0xea81('0x36')](_0x246faf['toString'](),{'type':db[_0xea81('0x72')][_0xea81('0x83')]['SELECT']})['then'](function(_0x2b168b){if(_0x2b168b['length']===0x1){return _0x29021d['id'];}else{var _0x37b619=_['every'](_[_0xea81('0x30')](_0x2b168b,'TeamId'),function(_0x2c1f2d){return _[_0xea81('0x84')](_0x17b659,_0x2c1f2d);});if(_0x37b619){return _0x29021d['id'];}}}));}}return BPromise[_0xea81('0x85')](_0xffd0fd)['then'](function(_0x2eff0f){_0x2822b7=_(_0x2822b7)[_0xea81('0x86')](_0x2eff0f)[_0xea81('0x87')]()[_0xea81('0x88')]();return db[_0xea81('0x31')][_0xea81('0x4e')]({'where':{'id':_0x2b29d2[_0xea81('0x4b')]['id']}})[_0xea81('0x2c')](function(_0x5725b2){return db['sequelize'][_0xea81('0x73')](function(_0x74e5f0){return _0x5725b2[_0xea81('0x77')](_0x2b29d2[_0xea81('0x36')][_0xea81('0x6d')],{'transaction':_0x74e5f0})[_0xea81('0x2c')](function(){if(!_['isEmpty'](_0x2822b7)){return _0x5725b2[_0xea81('0x89')](_0x2822b7,{'transaction':_0x74e5f0});}})['then'](function(){_0x2822b7[_0xea81('0x8a')](function(_0x3f10ba){socket[_0xea81('0x75')]('userMailQueue:remove',{'UserId':_0x3f10ba,'MailQueueId':_0x5725b2['id']});});});});});});})['then'](respondWithStatusCode(_0x8526db,null))[_0xea81('0x49')](handleError(_0x8526db,null));};exports['addAgents']=function(_0x1014d5,_0x3eb622,_0x292cd5){return db[_0xea81('0x31')][_0xea81('0x4e')]({'where':{'id':_0x1014d5[_0xea81('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3eb622,null))[_0xea81('0x2c')](function(_0x41e5a7){if(_0x41e5a7){return _0x41e5a7[_0xea81('0x8b')](_0x1014d5['body'][_0xea81('0x6d')],_['omit'](_0x1014d5[_0xea81('0x50')],[_0xea81('0x6d'),'id'])||{})[_0xea81('0x8c')](function(_0x4d8bb7){for(var _0x5c8264=0x0;_0x5c8264<_0x1014d5['body']['ids']['length'];_0x5c8264+=0x1){socket[_0xea81('0x75')]('userMailQueue:save',{'UserId':Number(_0x1014d5['body'][_0xea81('0x6d')][_0x5c8264]),'MailQueueId':Number(_0x1014d5[_0xea81('0x4b')]['id'])});}return _0x4d8bb7;});}})[_0xea81('0x2c')](respondWithResult(_0x3eb622,null))[_0xea81('0x49')](handleError(_0x3eb622,null));};exports[_0xea81('0x89')]=function(_0x370c7b,_0x2d8b34,_0x12a347){return db['MailQueue'][_0xea81('0x4e')]({'where':{'id':_0x370c7b[_0xea81('0x4b')]['id']}})[_0xea81('0x2c')](handleEntityNotFound(_0x2d8b34,null))[_0xea81('0x2c')](function(_0x46e755){if(_0x46e755){return _0x46e755[_0xea81('0x89')](_0x370c7b[_0xea81('0x36')][_0xea81('0x6d')])['then'](function(){if(_['isArray'](_0x370c7b['query'][_0xea81('0x6d')])){for(var _0x476de4=0x0;_0x476de4<_0x370c7b[_0xea81('0x36')][_0xea81('0x6d')]['length'];_0x476de4+=0x1){socket[_0xea81('0x75')]('userMailQueue:remove',{'UserId':Number(_0x370c7b[_0xea81('0x36')][_0xea81('0x6d')][_0x476de4]),'MailQueueId':Number(_0x370c7b['params']['id'])});}}else{socket[_0xea81('0x75')](_0xea81('0x8d'),{'UserId':Number(_0x370c7b[_0xea81('0x36')][_0xea81('0x6d')]),'MailQueueId':Number(_0x370c7b[_0xea81('0x4b')]['id'])});}});}})[_0xea81('0x2c')](respondWithStatusCode(_0x2d8b34,null))[_0xea81('0x49')](handleError(_0x2d8b34,null));};exports[_0xea81('0x8e')]=function(_0x4a3a37,_0x59fda0,_0x44a049){var _0x3cae11={};var _0x5aa4fd={};var _0x20b62d;var _0x3c8cf6;return db[_0xea81('0x31')][_0xea81('0x69')]({'where':{'id':_0x4a3a37['params']['id']}})[_0xea81('0x2c')](handleEntityNotFound(_0x59fda0,null))[_0xea81('0x2c')](function(_0x4219df){if(_0x4219df){_0x20b62d=_0x4219df;_0x5aa4fd[_0xea81('0x34')]=_[_0xea81('0x4d')](db[_0xea81('0x5f')]['rawAttributes']);_0x5aa4fd[_0xea81('0x36')]=_[_0xea81('0x4d')](_0x4a3a37[_0xea81('0x36')]);_0x5aa4fd[_0xea81('0x37')]=_[_0xea81('0x39')](_0x5aa4fd[_0xea81('0x34')],_0x5aa4fd['query']);_0x3cae11[_0xea81('0x38')]=_['intersection'](_0x5aa4fd[_0xea81('0x34')],qs[_0xea81('0x3a')](_0x4a3a37[_0xea81('0x36')][_0xea81('0x3a')]));_0x3cae11[_0xea81('0x38')]=_0x3cae11[_0xea81('0x38')][_0xea81('0x3b')]?_0x3cae11[_0xea81('0x38')]:_0x5aa4fd[_0xea81('0x34')];_0x3cae11['order']=qs['sort'](_0x4a3a37[_0xea81('0x36')][_0xea81('0x3e')]);_0x3cae11[_0xea81('0x3f')]=qs[_0xea81('0x37')](_[_0xea81('0x40')](_0x4a3a37[_0xea81('0x36')],_0x5aa4fd[_0xea81('0x37')]));if(_0x4a3a37[_0xea81('0x36')][_0xea81('0x41')]){_0x3cae11[_0xea81('0x3f')]=_['merge'](_0x3cae11['where'],{'$or':_['map'](_0x3cae11[_0xea81('0x38')],function(_0xb5bdf7){var _0x5a469c={};_0x5a469c[_0xb5bdf7]={'$like':'%'+_0x4a3a37['query'][_0xea81('0x41')]+'%'};return _0x5a469c;})});}_0x3cae11=_[_0xea81('0x42')]({},_0x3cae11,_0x4a3a37[_0xea81('0x5e')]);return _0x20b62d[_0xea81('0x8e')](_0x3cae11);}})[_0xea81('0x2c')](function(_0x57d622){if(_0x57d622){_0x3c8cf6=_0x57d622['length'];if(!_0x4a3a37[_0xea81('0x36')][_0xea81('0x6b')](_0xea81('0x3c'))){_0x3cae11['limit']=qs[_0xea81('0x24')](_0x4a3a37[_0xea81('0x36')]['limit']);_0x3cae11['offset']=qs[_0xea81('0x22')](_0x4a3a37[_0xea81('0x36')]['offset']);}return _0x20b62d[_0xea81('0x8e')](_0x3cae11);}})[_0xea81('0x2c')](function(_0x5efb46){if(_0x5efb46){return _0x5efb46?{'count':_0x3c8cf6,'rows':_0x5efb46}:null;}})[_0xea81('0x2c')](respondWithResult(_0x59fda0,null))[_0xea81('0x49')](handleError(_0x59fda0,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 74b9848..f705f4c 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 _0xa038=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x19a9a5,_0x2bf8b2){var _0x5306fe=function(_0x20f9e1){while(--_0x20f9e1){_0x19a9a5['push'](_0x19a9a5['shift']());}};_0x5306fe(++_0x2bf8b2);}(_0xa038,0x154));var _0x8a03=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa038[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0x8a03('0x0'));var MailQueue=require(_0x8a03('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8a03('0x2')](0x0);var events={'afterCreate':_0x8a03('0x3'),'afterUpdate':_0x8a03('0x4'),'afterDestroy':_0x8a03('0x5')};function emitEvent(_0xc91709){return function(_0x3cc5ab,_0x1e4299,_0x337d75){MailQueueEvents[_0x8a03('0x6')](_0xc91709+':'+_0x3cc5ab['id'],_0x3cc5ab);MailQueueEvents[_0x8a03('0x6')](_0xc91709,_0x3cc5ab);_0x337d75(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x8a03('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x0ad9=['../../mysqldb','save','update','emit','hasOwnProperty','exports','events'];(function(_0x7fdd52,_0x2f4498){var _0x369401=function(_0x42de5d){while(--_0x42de5d){_0x7fdd52['push'](_0x7fdd52['shift']());}};_0x369401(++_0x2f4498);}(_0x0ad9,0x172));var _0x90ad=function(_0x507ded,_0x470ab9){_0x507ded=_0x507ded-0x0;var _0x55d109=_0x0ad9[_0x507ded];return _0x55d109;};'use strict';var EventEmitter=require(_0x90ad('0x0'));var MailQueue=require(_0x90ad('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90ad('0x2'),'afterUpdate':_0x90ad('0x3'),'afterDestroy':'remove'};function emitEvent(_0x952c71){return function(_0x2ae734,_0x42034f,_0x2629f1){MailQueueEvents[_0x90ad('0x4')](_0x952c71+':'+_0x2ae734['id'],_0x2ae734);MailQueueEvents[_0x90ad('0x4')](_0x952c71,_0x2ae734);_0x2629f1(null);};}for(var e in events){if(events[_0x90ad('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x90ad('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 63e9ee1..adce271 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 _0x6789=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x3841f6,_0x45de43){var _0x6d18d1=function(_0x306195){while(--_0x306195){_0x3841f6['push'](_0x3841f6['shift']());}};_0x6d18d1(++_0x45de43);}(_0x6789,0xcb));var _0x9678=function(_0xa7b837,_0x16cac5){_0xa7b837=_0xa7b837-0x0;var _0x3190a0=_0x6789[_0xa7b837];return _0x3190a0;};'use strict';var _=require(_0x9678('0x0'));var util=require(_0x9678('0x1'));var logger=require(_0x9678('0x2'))(_0x9678('0x3'));var moment=require('moment');var BPromise=require(_0x9678('0x4'));var rp=require(_0x9678('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9678('0x6'));var attributes=require(_0x9678('0x7'));module[_0x9678('0x8')]=function(_0x337aa0,_0x24b541){return _0x337aa0[_0x9678('0x9')](_0x9678('0xa'),attributes,{'tableName':_0x9678('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd60=['rimraf','../../config/environment','define','MailQueue','mail_queues','lodash','../../config/logger','api','moment','path'];(function(_0x58c9b1,_0x1b00b4){var _0x57da21=function(_0x58bbde){while(--_0x58bbde){_0x58c9b1['push'](_0x58c9b1['shift']());}};_0x57da21(++_0x1b00b4);}(_0xbd60,0xa5));var _0x0bd6=function(_0x102287,_0x1c82dc){_0x102287=_0x102287-0x0;var _0x43d29e=_0xbd60[_0x102287];return _0x43d29e;};'use strict';var _=require(_0x0bd6('0x0'));var util=require('util');var logger=require(_0x0bd6('0x1'))(_0x0bd6('0x2'));var moment=require(_0x0bd6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bd6('0x4'));var rimraf=require(_0x0bd6('0x5'));var config=require(_0x0bd6('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x3a23a7,_0x38e0a5){return _0x3a23a7[_0x0bd6('0x7')](_0x0bd6('0x8'),attributes,{'tableName':_0x0bd6('0x9'),'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 2d13649..c51c350 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 _0xd086=['localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','raw','options','where','limit','include','map','model','attributes','ShowMailQueue','MailQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd086,0x1df));var _0x6d08=function(_0x225be2,_0x14a6f9){_0x225be2=_0x225be2-0x0;var _0x1b4544=_0xd086[_0x225be2];return _0x1b4544;};'use strict';var _=require('lodash');var util=require(_0x6d08('0x0'));var moment=require(_0x6d08('0x1'));var BPromise=require(_0x6d08('0x2'));var rs=require(_0x6d08('0x3'));var fs=require('fs');var Redis=require(_0x6d08('0x4'));var db=require(_0x6d08('0x5'))['db'];var utils=require(_0x6d08('0x6'));var logger=require(_0x6d08('0x7'))(_0x6d08('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d08('0x9')][_0x6d08('0xa')]({'port':0x232a});config[_0x6d08('0xb')]=_[_0x6d08('0xc')](config[_0x6d08('0xb')],{'host':_0x6d08('0xd'),'port':0x18eb});var socket=require(_0x6d08('0xe'))(new Redis(config['redis']));require(_0x6d08('0xf'))[_0x6d08('0x10')](socket);function respondWithRpcPromise(_0x1aa01e,_0x428f26,_0x48de85){return new BPromise(function(_0x408222,_0xecd0ba){return client[_0x6d08('0x11')](_0x1aa01e,_0x48de85)[_0x6d08('0x12')](function(_0x12978a){logger[_0x6d08('0x13')]('MailQueue,\x20%s,\x20%s',_0x428f26,_0x6d08('0x14'));logger[_0x6d08('0x15')](_0x6d08('0x16'),_0x428f26,_0x6d08('0x14'),JSON[_0x6d08('0x17')](_0x12978a));if(_0x12978a[_0x6d08('0x18')]){if(_0x12978a[_0x6d08('0x18')]['code']===0x1f4){logger[_0x6d08('0x18')](_0x6d08('0x19'),_0x428f26,_0x12978a[_0x6d08('0x18')][_0x6d08('0x1a')]);return _0xecd0ba(_0x12978a[_0x6d08('0x18')][_0x6d08('0x1a')]);}logger[_0x6d08('0x18')]('MailQueue,\x20%s,\x20%s',_0x428f26,_0x12978a['error'][_0x6d08('0x1a')]);return _0x408222(_0x12978a[_0x6d08('0x18')][_0x6d08('0x1a')]);}else{logger[_0x6d08('0x13')](_0x6d08('0x19'),_0x428f26,_0x6d08('0x14'));_0x408222(_0x12978a[_0x6d08('0x1b')]['message']);}})[_0x6d08('0x1c')](function(_0x44ff3c){logger['error']('MailQueue,\x20%s,\x20%s',_0x428f26,_0x44ff3c);_0xecd0ba(_0x44ff3c);});});}exports[_0x6d08('0x1d')]=function(_0x5eadaf){var _0x19c6ef=this;return new Promise(function(_0x3f85c4,_0x169cbe){return db['MailQueue']['findAll']({'raw':_0x5eadaf['options']?_0x5eadaf['options'][_0x6d08('0x1e')]===undefined?!![]:![]:!![],'where':_0x5eadaf[_0x6d08('0x1f')]?_0x5eadaf['options'][_0x6d08('0x20')]||null:null,'attributes':_0x5eadaf['options']?_0x5eadaf['options']['attributes']||null:null,'limit':_0x5eadaf[_0x6d08('0x1f')]?_0x5eadaf[_0x6d08('0x1f')][_0x6d08('0x21')]||null:null,'include':_0x5eadaf['options']?_0x5eadaf[_0x6d08('0x1f')][_0x6d08('0x22')]?_[_0x6d08('0x23')](_0x5eadaf[_0x6d08('0x1f')]['include'],function(_0x543a2d){return{'model':db[_0x543a2d[_0x6d08('0x24')]],'as':_0x543a2d['as'],'attributes':_0x543a2d[_0x6d08('0x25')],'include':_0x543a2d['include']?_[_0x6d08('0x23')](_0x543a2d[_0x6d08('0x22')],function(_0x175c79){return{'model':db[_0x175c79[_0x6d08('0x24')]],'as':_0x175c79['as'],'attributes':_0x175c79['attributes'],'include':_0x175c79['include']?_[_0x6d08('0x23')](_0x175c79[_0x6d08('0x22')],function(_0x5ef8f1){return{'model':db[_0x5ef8f1[_0x6d08('0x24')]],'as':_0x5ef8f1['as'],'attributes':_0x5ef8f1[_0x6d08('0x25')]};}):[]};}):[]};}):[]:[]})[_0x6d08('0x12')](function(_0x220b9d){logger['info'](_0x6d08('0x1d'),_0x5eadaf);logger['debug'](_0x6d08('0x1d'),_0x5eadaf,JSON[_0x6d08('0x17')](_0x220b9d));_0x3f85c4(_0x220b9d);})[_0x6d08('0x1c')](function(_0xeda125){logger['error'](_0x6d08('0x1d'),_0xeda125['message'],_0x5eadaf);_0x169cbe(_0x19c6ef[_0x6d08('0x18')](0x1f4,_0xeda125[_0x6d08('0x1a')]));});});};exports[_0x6d08('0x26')]=function(_0x5bda7f){var _0x45788c=this;return new Promise(function(_0x5149ac,_0x9e59ff){return db[_0x6d08('0x27')][_0x6d08('0x28')]({'raw':_0x5bda7f['options']?_0x5bda7f['options'][_0x6d08('0x1e')]===undefined?!![]:![]:!![],'where':_0x5bda7f['options']?_0x5bda7f[_0x6d08('0x1f')]['where']||null:null,'attributes':_0x5bda7f[_0x6d08('0x1f')]?_0x5bda7f[_0x6d08('0x1f')][_0x6d08('0x25')]||null:null,'include':_0x5bda7f['options']?_0x5bda7f[_0x6d08('0x1f')]['include']?_[_0x6d08('0x23')](_0x5bda7f[_0x6d08('0x1f')]['include'],function(_0x1833ca){return{'model':db[_0x1833ca[_0x6d08('0x24')]],'as':_0x1833ca['as'],'attributes':_0x1833ca['attributes'],'include':_0x1833ca['include']?_[_0x6d08('0x23')](_0x1833ca[_0x6d08('0x22')],function(_0x5a6411){return{'model':db[_0x5a6411[_0x6d08('0x24')]],'as':_0x5a6411['as'],'attributes':_0x5a6411['attributes'],'include':_0x5a6411[_0x6d08('0x22')]?_[_0x6d08('0x23')](_0x5a6411[_0x6d08('0x22')],function(_0x23218c){return{'model':db[_0x23218c[_0x6d08('0x24')]],'as':_0x23218c['as'],'attributes':_0x23218c[_0x6d08('0x25')]};}):[]};}):[]};}):[]:[]})[_0x6d08('0x12')](function(_0x18e3ed){logger[_0x6d08('0x13')]('ShowMailQueue',_0x5bda7f);logger[_0x6d08('0x15')](_0x6d08('0x26'),_0x5bda7f,JSON['stringify'](_0x18e3ed));_0x5149ac(_0x18e3ed);})[_0x6d08('0x1c')](function(_0x27a9ff){logger[_0x6d08('0x18')](_0x6d08('0x26'),_0x27a9ff['message'],_0x5bda7f);_0x9e59ff(_0x45788c[_0x6d08('0x18')](0x1f4,_0x27a9ff['message']));});});}; \ No newline at end of file +var _0xe62f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','catch','ShowMailQueue','stringify','lodash','util','moment'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0xe62f,0xc5));var _0xfe62=function(_0x444667,_0x14b3d9){_0x444667=_0x444667-0x0;var _0x1c9714=_0xe62f[_0x444667];return _0x1c9714;};'use strict';var _=require(_0xfe62('0x0'));var util=require(_0xfe62('0x1'));var moment=require(_0xfe62('0x2'));var BPromise=require(_0xfe62('0x3'));var rs=require(_0xfe62('0x4'));var fs=require('fs');var Redis=require(_0xfe62('0x5'));var db=require(_0xfe62('0x6'))['db'];var utils=require(_0xfe62('0x7'));var logger=require(_0xfe62('0x8'))(_0xfe62('0x9'));var config=require('../../config/environment');var jayson=require(_0xfe62('0xa'));var client=jayson['client'][_0xfe62('0xb')]({'port':0x232a});config[_0xfe62('0xc')]=_[_0xfe62('0xd')](config['redis'],{'host':_0xfe62('0xe'),'port':0x18eb});var socket=require(_0xfe62('0xf'))(new Redis(config['redis']));require(_0xfe62('0x10'))['register'](socket);function respondWithRpcPromise(_0x5b4d91,_0x2a5a90,_0x455a81){return new BPromise(function(_0x5bf8b1,_0x4313d6){return client[_0xfe62('0x11')](_0x5b4d91,_0x455a81)[_0xfe62('0x12')](function(_0x2cf1ca){logger[_0xfe62('0x13')](_0xfe62('0x14'),_0x2a5a90,_0xfe62('0x15'));logger[_0xfe62('0x16')](_0xfe62('0x17'),_0x2a5a90,_0xfe62('0x15'),JSON['stringify'](_0x2cf1ca));if(_0x2cf1ca[_0xfe62('0x18')]){if(_0x2cf1ca[_0xfe62('0x18')][_0xfe62('0x19')]===0x1f4){logger['error'](_0xfe62('0x14'),_0x2a5a90,_0x2cf1ca[_0xfe62('0x18')][_0xfe62('0x1a')]);return _0x4313d6(_0x2cf1ca[_0xfe62('0x18')][_0xfe62('0x1a')]);}logger[_0xfe62('0x18')]('MailQueue,\x20%s,\x20%s',_0x2a5a90,_0x2cf1ca[_0xfe62('0x18')]['message']);return _0x5bf8b1(_0x2cf1ca[_0xfe62('0x18')][_0xfe62('0x1a')]);}else{logger['info'](_0xfe62('0x14'),_0x2a5a90,_0xfe62('0x15'));_0x5bf8b1(_0x2cf1ca['result'][_0xfe62('0x1a')]);}})['catch'](function(_0x45e925){logger[_0xfe62('0x18')](_0xfe62('0x14'),_0x2a5a90,_0x45e925);_0x4313d6(_0x45e925);});});}exports[_0xfe62('0x1b')]=function(_0x833073){var _0x31b70c=this;return new Promise(function(_0x5eede0,_0x42eba1){return db[_0xfe62('0x1c')]['findAll']({'raw':_0x833073[_0xfe62('0x1d')]?_0x833073[_0xfe62('0x1d')][_0xfe62('0x1e')]===undefined?!![]:![]:!![],'where':_0x833073[_0xfe62('0x1d')]?_0x833073['options'][_0xfe62('0x1f')]||null:null,'attributes':_0x833073['options']?_0x833073[_0xfe62('0x1d')][_0xfe62('0x20')]||null:null,'limit':_0x833073[_0xfe62('0x1d')]?_0x833073[_0xfe62('0x1d')][_0xfe62('0x21')]||null:null,'include':_0x833073[_0xfe62('0x1d')]?_0x833073[_0xfe62('0x1d')][_0xfe62('0x22')]?_[_0xfe62('0x23')](_0x833073[_0xfe62('0x1d')][_0xfe62('0x22')],function(_0x30f64a){return{'model':db[_0x30f64a[_0xfe62('0x24')]],'as':_0x30f64a['as'],'attributes':_0x30f64a[_0xfe62('0x20')],'include':_0x30f64a['include']?_[_0xfe62('0x23')](_0x30f64a['include'],function(_0x570176){return{'model':db[_0x570176[_0xfe62('0x24')]],'as':_0x570176['as'],'attributes':_0x570176[_0xfe62('0x20')],'include':_0x570176['include']?_['map'](_0x570176[_0xfe62('0x22')],function(_0x3cea64){return{'model':db[_0x3cea64[_0xfe62('0x24')]],'as':_0x3cea64['as'],'attributes':_0x3cea64[_0xfe62('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfe62('0x12')](function(_0x575999){logger[_0xfe62('0x13')]('GetMailQueue',_0x833073);logger[_0xfe62('0x16')](_0xfe62('0x1b'),_0x833073,JSON['stringify'](_0x575999));_0x5eede0(_0x575999);})[_0xfe62('0x25')](function(_0x565077){logger[_0xfe62('0x18')]('GetMailQueue',_0x565077[_0xfe62('0x1a')],_0x833073);_0x42eba1(_0x31b70c['error'](0x1f4,_0x565077['message']));});});};exports[_0xfe62('0x26')]=function(_0x1c17e4){var _0x4f85f1=this;return new Promise(function(_0x202506,_0x4cdaab){return db[_0xfe62('0x1c')]['find']({'raw':_0x1c17e4[_0xfe62('0x1d')]?_0x1c17e4[_0xfe62('0x1d')][_0xfe62('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c17e4['options']?_0x1c17e4['options'][_0xfe62('0x1f')]||null:null,'attributes':_0x1c17e4['options']?_0x1c17e4['options'][_0xfe62('0x20')]||null:null,'include':_0x1c17e4[_0xfe62('0x1d')]?_0x1c17e4[_0xfe62('0x1d')][_0xfe62('0x22')]?_[_0xfe62('0x23')](_0x1c17e4[_0xfe62('0x1d')]['include'],function(_0x5bdb39){return{'model':db[_0x5bdb39[_0xfe62('0x24')]],'as':_0x5bdb39['as'],'attributes':_0x5bdb39[_0xfe62('0x20')],'include':_0x5bdb39['include']?_[_0xfe62('0x23')](_0x5bdb39[_0xfe62('0x22')],function(_0x233426){return{'model':db[_0x233426['model']],'as':_0x233426['as'],'attributes':_0x233426[_0xfe62('0x20')],'include':_0x233426['include']?_['map'](_0x233426['include'],function(_0xe62a9){return{'model':db[_0xe62a9[_0xfe62('0x24')]],'as':_0xe62a9['as'],'attributes':_0xe62a9[_0xfe62('0x20')]};}):[]};}):[]};}):[]:[]})[_0xfe62('0x12')](function(_0x27dd5f){logger[_0xfe62('0x13')]('ShowMailQueue',_0x1c17e4);logger[_0xfe62('0x16')](_0xfe62('0x26'),_0x1c17e4,JSON[_0xfe62('0x27')](_0x27dd5f));_0x202506(_0x27dd5f);})[_0xfe62('0x25')](function(_0x1563fb){logger['error'](_0xfe62('0x26'),_0x1563fb[_0xfe62('0x1a')],_0x1c17e4);_0x4cdaab(_0x4f85f1['error'](0x1f4,_0x1563fb[_0xfe62('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index eba3ee4..57b3c66 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 _0x1d3a=['./mailQueue.events','save','remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1d3a,0xa2));var _0xa1d3=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x1d3a[_0x2555d0];return _0x3bb486;};'use strict';var MailQueueEvents=require(_0xa1d3('0x0'));var events=[_0xa1d3('0x1'),_0xa1d3('0x2'),_0xa1d3('0x3')];function createListener(_0x3efed9,_0x2fc509){return function(_0x890797){_0x2fc509[_0xa1d3('0x4')](_0x3efed9,_0x890797);};}function removeListener(_0x3de76b,_0x34f7f1){return function(){MailQueueEvents[_0xa1d3('0x5')](_0x3de76b,_0x34f7f1);};}exports[_0xa1d3('0x6')]=function(_0x56b2b2){for(var _0x4cc9d0=0x0,_0x29195b=events[_0xa1d3('0x7')];_0x4cc9d0<_0x29195b;_0x4cc9d0++){var _0x59ac6c=events[_0x4cc9d0];var _0x534c61=createListener(_0xa1d3('0x8')+_0x59ac6c,_0x56b2b2);MailQueueEvents['on'](_0x59ac6c,_0x534c61);}}; \ No newline at end of file +var _0x57fa=['mailQueue:','./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x3ed1c1,_0x45fe0a){var _0x11797d=function(_0x26bad3){while(--_0x26bad3){_0x3ed1c1['push'](_0x3ed1c1['shift']());}};_0x11797d(++_0x45fe0a);}(_0x57fa,0x127));var _0xa57f=function(_0x335567,_0x455619){_0x335567=_0x335567-0x0;var _0x247037=_0x57fa[_0x335567];return _0x247037;};'use strict';var MailQueueEvents=require(_0xa57f('0x0'));var events=[_0xa57f('0x1'),'remove',_0xa57f('0x2')];function createListener(_0x511b96,_0x63a9f8){return function(_0x1f162e){_0x63a9f8[_0xa57f('0x3')](_0x511b96,_0x1f162e);};}function removeListener(_0x7163e2,_0x21e413){return function(){MailQueueEvents[_0xa57f('0x4')](_0x7163e2,_0x21e413);};}exports[_0xa57f('0x5')]=function(_0x5316bc){for(var _0x4ded33=0x0,_0x3d84e9=events['length'];_0x4ded33<_0x3d84e9;_0x4ded33++){var _0x438665=events[_0x4ded33];var _0x871646=createListener(_0xa57f('0x6')+_0x438665,_0x5316bc);MailQueueEvents['on'](_0x438665,_0x871646);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a3acc45..ccdbf01 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 _0x48a6=['../../components/interaction/service','get','index','/describe','describe','/:id','post','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x48a6,0xfc));var _0x648a=function(_0x353c53,_0x2102c0){_0x353c53=_0x353c53-0x0;var _0x2c55da=_0x48a6[_0x353c53];return _0x2c55da;};'use strict';var multer=require(_0x648a('0x0'));var util=require(_0x648a('0x1'));var path=require(_0x648a('0x2'));var timeout=require(_0x648a('0x3'));var express=require(_0x648a('0x4'));var router=express[_0x648a('0x5')]();var fs_extra=require(_0x648a('0x6'));var auth=require(_0x648a('0x7'));var interaction=require(_0x648a('0x8'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x648a('0x9')]('/',auth['isAuthenticated'](),controller[_0x648a('0xa')]);router[_0x648a('0x9')](_0x648a('0xb'),auth['isAuthenticated'](),controller[_0x648a('0xc')]);router[_0x648a('0x9')](_0x648a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x648a('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x648a('0xf')](_0x648a('0xd'),auth[_0x648a('0x10')](),controller[_0x648a('0x11')]);router['delete']('/:id',auth[_0x648a('0x10')](),controller[_0x648a('0x12')]);module[_0x648a('0x13')]=router; \ No newline at end of file +var _0x2ade=['post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x2ade,0x69));var _0xe2ad=function(_0x23faef,_0x3800f7){_0x23faef=_0x23faef-0x0;var _0x32ebff=_0x2ade[_0x23faef];return _0x32ebff;};'use strict';var multer=require(_0xe2ad('0x0'));var util=require(_0xe2ad('0x1'));var path=require(_0xe2ad('0x2'));var timeout=require(_0xe2ad('0x3'));var express=require(_0xe2ad('0x4'));var router=express[_0xe2ad('0x5')]();var fs_extra=require(_0xe2ad('0x6'));var auth=require(_0xe2ad('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe2ad('0x8'));var controller=require('./mailQueueReport.controller');router[_0xe2ad('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2ad('0xa')]);router['get'](_0xe2ad('0xb'),auth[_0xe2ad('0xc')](),controller[_0xe2ad('0xd')]);router[_0xe2ad('0x9')](_0xe2ad('0xe'),auth[_0xe2ad('0xc')](),controller['show']);router[_0xe2ad('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe2ad('0x10')](_0xe2ad('0xe'),auth['isAuthenticated'](),controller[_0xe2ad('0x11')]);router[_0xe2ad('0x12')](_0xe2ad('0xe'),auth['isAuthenticated'](),controller[_0xe2ad('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 528433a..7a03c28 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 _0x7301=['STRING','DATE','sequelize'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x7301,0x6e));var _0x1730=function(_0xdcd57b,_0x50fd24){_0xdcd57b=_0xdcd57b-0x0;var _0x4f6c17=_0x7301[_0xdcd57b];return _0x4f6c17;};'use strict';var moment=require('moment');var Sequelize=require(_0x1730('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1730('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1730('0x1')]},'joinAt':{'type':Sequelize[_0x1730('0x2')]},'leaveAt':{'type':Sequelize[_0x1730('0x2')]},'acceptAt':{'type':Sequelize[_0x1730('0x2')]},'exitAt':{'type':Sequelize[_0x1730('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0609=['STRING','DATE','sequelize'];(function(_0x33a8e5,_0x928308){var _0x1b76c8=function(_0x132e58){while(--_0x132e58){_0x33a8e5['push'](_0x33a8e5['shift']());}};_0x1b76c8(++_0x928308);}(_0x0609,0x1f1));var _0x9060=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0609[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x9060('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9060('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9060('0x1')]},'joinAt':{'type':Sequelize[_0x9060('0x2')]},'leaveAt':{'type':Sequelize[_0x9060('0x2')]},'acceptAt':{'type':Sequelize[_0x9060('0x2')]},'exitAt':{'type':Sequelize[_0x9060('0x2')]},'reason':{'type':Sequelize[_0x9060('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 615ac99..d935d1a 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 _0x1623=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','MailQueueReport','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1623,0xab));var _0x3162=function(_0x45f43f,_0x22dbca){_0x45f43f=_0x45f43f-0x0;var _0x4dbc68=_0x1623[_0x45f43f];return _0x4dbc68;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['MailQueueReport'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':!![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};exports[_0x3162('0x49')]=function(_0x554a03,_0x48b81d){return db['MailQueueReport'][_0x3162('0x49')]()[_0x3162('0x24')](respondWithResult(_0x48b81d,null))[_0x3162('0x42')](handleError(_0x48b81d,null));}; \ No newline at end of file +var _0xa456=['where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','undefined','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0xa456,0x142));var _0x6a45=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xa456[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0x6a45('0x0'));var rimraf=require(_0x6a45('0x1'));var zipdir=require(_0x6a45('0x2'));var jsonpatch=require(_0x6a45('0x3'));var rp=require('request-promise');var moment=require(_0x6a45('0x4'));var BPromise=require(_0x6a45('0x5'));var Mustache=require(_0x6a45('0x6'));var util=require('util');var path=require(_0x6a45('0x7'));var sox=require(_0x6a45('0x8'));var csv=require(_0x6a45('0x9'));var ejs=require(_0x6a45('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');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 as=require(_0x6a45('0x14'));var hardwareService=require(_0x6a45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6a45('0x16'));var config=require(_0x6a45('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x511b92,_0x1aa4b4){_0x1aa4b4=_0x1aa4b4||0xcc;return function(_0x25a8b9){if(_0x25a8b9){return _0x511b92[_0x6a45('0x18')](_0x1aa4b4);}return _0x511b92[_0x6a45('0x19')](_0x1aa4b4)[_0x6a45('0x1a')]();};}function respondWithResult(_0x5a9f29,_0x563c3b){_0x563c3b=_0x563c3b||0xc8;return function(_0x3a5d94){if(_0x3a5d94){return _0x5a9f29[_0x6a45('0x19')](_0x563c3b)['json'](_0x3a5d94);}};}function respondWithFilteredResult(_0x2c20db,_0x171176){return function(_0x3fab82){if(_0x3fab82){var _0x13adc0=typeof _0x171176['offset']==='undefined'&&typeof _0x171176['limit']===_0x6a45('0x1b');var _0x391f81=_0x3fab82[_0x6a45('0x1c')];var _0x52a055=_0x13adc0?0x0:_0x171176[_0x6a45('0x1d')];var _0x102981=_0x13adc0?_0x3fab82[_0x6a45('0x1c')]:_0x171176['offset']+_0x171176['limit'];var _0x573453;if(_0x102981>=_0x391f81){_0x102981=_0x391f81;_0x573453=0xc8;}else{_0x573453=0xce;}_0x2c20db[_0x6a45('0x19')](_0x573453);return _0x2c20db[_0x6a45('0x1e')]('Content-Range',_0x52a055+'-'+_0x102981+'/'+_0x391f81)[_0x6a45('0x1f')](_0x3fab82);}return null;};}function patchUpdates(_0x1be485){return function(_0x4f7000){try{jsonpatch[_0x6a45('0x20')](_0x4f7000,_0x1be485,!![]);}catch(_0xdf10c6){return BPromise[_0x6a45('0x21')](_0xdf10c6);}return _0x4f7000[_0x6a45('0x22')]();};}function saveUpdates(_0x15ad0e,_0x487666){return function(_0x5d990e){if(_0x5d990e){return _0x5d990e[_0x6a45('0x23')](_0x15ad0e)[_0x6a45('0x24')](function(_0x11290c){return _0x11290c;});}return null;};}function removeEntity(_0x22373c,_0x25a380){return function(_0x3ad898){if(_0x3ad898){return _0x3ad898[_0x6a45('0x25')]()[_0x6a45('0x24')](function(){_0x22373c[_0x6a45('0x19')](0xcc)[_0x6a45('0x1a')]();});}};}function handleEntityNotFound(_0x1310d7,_0x46587a){return function(_0x5cd761){if(!_0x5cd761){_0x1310d7[_0x6a45('0x18')](0x194);}return _0x5cd761;};}function handleError(_0x5a0389,_0x1b83fa){_0x1b83fa=_0x1b83fa||0x1f4;return function(_0x25467d){logger[_0x6a45('0x26')](_0x25467d[_0x6a45('0x27')]);if(_0x25467d[_0x6a45('0x28')]){delete _0x25467d['name'];}_0x5a0389[_0x6a45('0x19')](_0x1b83fa)[_0x6a45('0x29')](_0x25467d);};}exports[_0x6a45('0x2a')]=function(_0x1ccff0,_0x8265d9){var _0x227b6f={},_0x3fac9b={},_0x313c13={'count':0x0,'rows':[]};var _0x54286d=_[_0x6a45('0x2b')](db[_0x6a45('0x2c')][_0x6a45('0x2d')],function(_0x201369){return{'name':_0x201369[_0x6a45('0x2e')],'type':_0x201369['type'][_0x6a45('0x2f')]};});_0x3fac9b[_0x6a45('0x30')]=_[_0x6a45('0x2b')](_0x54286d,_0x6a45('0x28'));_0x3fac9b['query']=_['keys'](_0x1ccff0[_0x6a45('0x31')]);_0x3fac9b['filters']=_[_0x6a45('0x32')](_0x3fac9b['model'],_0x3fac9b[_0x6a45('0x31')]);_0x227b6f[_0x6a45('0x33')]=_[_0x6a45('0x32')](_0x3fac9b[_0x6a45('0x30')],qs[_0x6a45('0x34')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x34')]));_0x227b6f[_0x6a45('0x33')]=_0x227b6f[_0x6a45('0x33')][_0x6a45('0x35')]?_0x227b6f[_0x6a45('0x33')]:_0x3fac9b[_0x6a45('0x30')];if(!_0x1ccff0[_0x6a45('0x31')]['hasOwnProperty'](_0x6a45('0x36'))){_0x227b6f['limit']=qs[_0x6a45('0x37')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x37')]);_0x227b6f[_0x6a45('0x1d')]=qs[_0x6a45('0x1d')](_0x1ccff0[_0x6a45('0x31')]['offset']);}_0x227b6f[_0x6a45('0x38')]=qs[_0x6a45('0x39')](_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x39')]);_0x227b6f[_0x6a45('0x3a')]=qs[_0x6a45('0x3b')](_['pick'](_0x1ccff0[_0x6a45('0x31')],_0x3fac9b[_0x6a45('0x3b')]),_0x54286d);if(_0x1ccff0['query'][_0x6a45('0x3c')]){_0x227b6f[_0x6a45('0x3a')]=_[_0x6a45('0x3d')](_0x227b6f[_0x6a45('0x3a')],{'$or':_[_0x6a45('0x2b')](_0x54286d,function(_0x50ebe0){if(_0x50ebe0[_0x6a45('0x3e')]!==_0x6a45('0x3f')){var _0x205afd={};_0x205afd[_0x50ebe0[_0x6a45('0x28')]]={'$like':'%'+_0x1ccff0[_0x6a45('0x31')][_0x6a45('0x3c')]+'%'};return _0x205afd;}})});}_0x227b6f=_[_0x6a45('0x3d')]({},_0x227b6f,_0x1ccff0['options']);var _0x1c941a={'where':_0x227b6f['where']};return db[_0x6a45('0x2c')][_0x6a45('0x1c')](_0x1c941a)[_0x6a45('0x24')](function(_0x2715dc){_0x313c13['count']=_0x2715dc;if(_0x1ccff0['query'][_0x6a45('0x40')]){_0x227b6f[_0x6a45('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6a45('0x42')](_0x227b6f);})[_0x6a45('0x24')](function(_0x3bd926){_0x313c13[_0x6a45('0x43')]=_0x3bd926;return _0x313c13;})['then'](respondWithFilteredResult(_0x8265d9,_0x227b6f))['catch'](handleError(_0x8265d9,null));};exports['show']=function(_0x5b9798,_0xe90201){var _0xb5d191={'raw':!![],'where':{'id':_0x5b9798[_0x6a45('0x44')]['id']}},_0x328d9f={};_0x328d9f[_0x6a45('0x30')]=_[_0x6a45('0x45')](db[_0x6a45('0x2c')][_0x6a45('0x2d')]);_0x328d9f['query']=_[_0x6a45('0x45')](_0x5b9798['query']);_0x328d9f['filters']=_[_0x6a45('0x32')](_0x328d9f[_0x6a45('0x30')],_0x328d9f['query']);_0xb5d191[_0x6a45('0x33')]=_['intersection'](_0x328d9f[_0x6a45('0x30')],qs[_0x6a45('0x34')](_0x5b9798[_0x6a45('0x31')][_0x6a45('0x34')]));_0xb5d191['attributes']=_0xb5d191[_0x6a45('0x33')][_0x6a45('0x35')]?_0xb5d191[_0x6a45('0x33')]:_0x328d9f[_0x6a45('0x30')];if(_0x5b9798[_0x6a45('0x31')]['includeAll']){_0xb5d191[_0x6a45('0x41')]=[{'all':!![]}];}_0xb5d191=_['merge']({},_0xb5d191,_0x5b9798[_0x6a45('0x46')]);return db[_0x6a45('0x2c')]['find'](_0xb5d191)[_0x6a45('0x24')](handleEntityNotFound(_0xe90201,null))[_0x6a45('0x24')](respondWithResult(_0xe90201,null))[_0x6a45('0x47')](handleError(_0xe90201,null));};exports[_0x6a45('0x48')]=function(_0x524296,_0x34bbb7){return db['MailQueueReport'][_0x6a45('0x48')](_0x524296['body'],{})[_0x6a45('0x24')](respondWithResult(_0x34bbb7,0xc9))[_0x6a45('0x47')](handleError(_0x34bbb7,null));};exports[_0x6a45('0x23')]=function(_0x2bf8d3,_0x5d9f52){if(_0x2bf8d3[_0x6a45('0x49')]['id']){delete _0x2bf8d3[_0x6a45('0x49')]['id'];}return db[_0x6a45('0x2c')][_0x6a45('0x4a')]({'where':{'id':_0x2bf8d3[_0x6a45('0x44')]['id']}})[_0x6a45('0x24')](handleEntityNotFound(_0x5d9f52,null))[_0x6a45('0x24')](saveUpdates(_0x2bf8d3[_0x6a45('0x49')],null))[_0x6a45('0x24')](respondWithResult(_0x5d9f52,null))[_0x6a45('0x47')](handleError(_0x5d9f52,null));};exports['destroy']=function(_0x3ea4a7,_0x8877c7){return db[_0x6a45('0x2c')][_0x6a45('0x4a')]({'where':{'id':_0x3ea4a7['params']['id']}})[_0x6a45('0x24')](handleEntityNotFound(_0x8877c7,null))[_0x6a45('0x24')](removeEntity(_0x8877c7,null))[_0x6a45('0x47')](handleError(_0x8877c7,null));};exports['describe']=function(_0x4e7967,_0x5a17b8){return db[_0x6a45('0x2c')][_0x6a45('0x4b')]()[_0x6a45('0x24')](respondWithResult(_0x5a17b8,null))[_0x6a45('0x47')](handleError(_0x5a17b8,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index a3cda4f..01448e6 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 _0xc1fd=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x2875e1,_0x5ca8ea){var _0xfd53=function(_0x54a2ac){while(--_0x54a2ac){_0x2875e1['push'](_0x2875e1['shift']());}};_0xfd53(++_0x5ca8ea);}(_0xc1fd,0x8f));var _0xdc1f=function(_0x562e5e,_0x5211a0){_0x562e5e=_0x562e5e-0x0;var _0x25f23b=_0xc1fd[_0x562e5e];return _0x25f23b;};'use strict';var _=require(_0xdc1f('0x0'));var util=require(_0xdc1f('0x1'));var logger=require('../../config/logger')(_0xdc1f('0x2'));var moment=require(_0xdc1f('0x3'));var BPromise=require(_0xdc1f('0x4'));var rp=require(_0xdc1f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc1f('0x6'));var config=require(_0xdc1f('0x7'));var attributes=require(_0xdc1f('0x8'));module[_0xdc1f('0x9')]=function(_0x2ae91f,_0x17c2b3){return _0x2ae91f[_0xdc1f('0xa')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdc1f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe254=['exports','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','./mailQueueReport.attributes'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xe254,0xa8));var _0x4e25=function(_0x4030c8,_0x556291){_0x4030c8=_0x4030c8-0x0;var _0x525675=_0xe254[_0x4030c8];return _0x525675;};'use strict';var _=require(_0x4e25('0x0'));var util=require(_0x4e25('0x1'));var logger=require(_0x4e25('0x2'))(_0x4e25('0x3'));var moment=require('moment');var BPromise=require(_0x4e25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e25('0x5'));var rimraf=require(_0x4e25('0x6'));var config=require('../../config/environment');var attributes=require(_0x4e25('0x7'));module[_0x4e25('0x8')]=function(_0xea5a01,_0x34634a){return _0xea5a01['define'](_0x4e25('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x4e25('0xa'),'fields':[_0x4e25('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 51f1372..28d1835 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x5a31ad,_0x30d5ec){var _0x460f7b=function(_0x500771){while(--_0x500771){_0x5a31ad['push'](_0x5a31ad['shift']());}};_0x460f7b(++_0x30d5ec);}(_0x2ef3,0xba));var _0x32ef=function(_0x3990bb,_0x31ab67){_0x3990bb=_0x3990bb-0x0;var _0x3b50f8=_0x2ef3[_0x3990bb];return _0x3b50f8;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x4ad231,_0x314a68){var _0x4d76b4=function(_0x2457ee){while(--_0x2457ee){_0x4ad231['push'](_0x4ad231['shift']());}};_0x4d76b4(++_0x314a68);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 31e7442..f6ad6f2 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x15ea90,_0x21f1c5){var _0x10dfe3=function(_0xf9d42e){while(--_0xf9d42e){_0x15ea90['push'](_0x15ea90['shift']());}};_0x10dfe3(++_0x21f1c5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 290d97a..8b31eca 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 _0xa9c9=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x479c65,_0x217f0c){var _0x33f3e5=function(_0x1ff1d8){while(--_0x1ff1d8){_0x479c65['push'](_0x479c65['shift']());}};_0x33f3e5(++_0x217f0c);}(_0xa9c9,0xd8));var _0x9a9c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xa9c9[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require('sequelize');module[_0x9a9c('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9a9c('0x1')]},'authentication':{'type':Sequelize[_0x9a9c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9a9c('0x1')]},'password':{'type':Sequelize[_0x9a9c('0x1')]},'port':{'type':Sequelize[_0x9a9c('0x3')]},'tls':{'type':Sequelize[_0x9a9c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9a9c('0x1')],'defaultValue':_0x9a9c('0x4')},'connTimeout':{'type':Sequelize[_0x9a9c('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x9a9c('0x1')]},'modernAuthentication':{'type':Sequelize[_0x9a9c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x43c5=['BOOLEAN','INBOX','INTEGER','sequelize','exports','STRING'];(function(_0xcad126,_0xae2538){var _0x2d08a7=function(_0x3054e6){while(--_0x3054e6){_0xcad126['push'](_0xcad126['shift']());}};_0x2d08a7(++_0xae2538);}(_0x43c5,0x19b));var _0x543c=function(_0x4633ce,_0x1de251){_0x4633ce=_0x4633ce-0x0;var _0x364042=_0x43c5[_0x4633ce];return _0x364042;};'use strict';var Sequelize=require(_0x543c('0x0'));module[_0x543c('0x1')]={'description':{'type':Sequelize[_0x543c('0x2')]},'host':{'type':Sequelize[_0x543c('0x2')]},'authentication':{'type':Sequelize[_0x543c('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x543c('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x543c('0x2')],'defaultValue':_0x543c('0x4')},'connTimeout':{'type':Sequelize[_0x543c('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x543c('0x2')]},'modernAuthentication':{'type':Sequelize[_0x543c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index cb159bf..adb509d 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 _0x0dd9=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','define','MailServerIn'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0dd9,0x134));var _0x90dd=function(_0x136c38,_0x354835){_0x136c38=_0x136c38-0x0;var _0x568399=_0x0dd9[_0x136c38];return _0x568399;};'use strict';var _=require('lodash');var util=require(_0x90dd('0x0'));var logger=require(_0x90dd('0x1'))(_0x90dd('0x2'));var moment=require(_0x90dd('0x3'));var BPromise=require(_0x90dd('0x4'));var rp=require(_0x90dd('0x5'));var fs=require('fs');var path=require(_0x90dd('0x6'));var rimraf=require(_0x90dd('0x7'));var config=require('../../config/environment');var attributes=require(_0x90dd('0x8'));module['exports']=function(_0x173d98,_0x240972){return _0x173d98[_0x90dd('0x9')](_0x90dd('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7b0=['moment','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','define','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x2dc6a5,_0x35180d){var _0x46a3f2=function(_0xc25426){while(--_0xc25426){_0x2dc6a5['push'](_0x2dc6a5['shift']());}};_0x46a3f2(++_0x35180d);}(_0xf7b0,0x140));var _0x0f7b=function(_0x21631f,_0x3717e2){_0x21631f=_0x21631f-0x0;var _0x581bba=_0xf7b0[_0x21631f];return _0x581bba;};'use strict';var _=require(_0x0f7b('0x0'));var util=require(_0x0f7b('0x1'));var logger=require(_0x0f7b('0x2'))(_0x0f7b('0x3'));var moment=require(_0x0f7b('0x4'));var BPromise=require(_0x0f7b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f7b('0x6'));var rimraf=require(_0x0f7b('0x7'));var config=require(_0x0f7b('0x8'));var attributes=require(_0x0f7b('0x9'));module['exports']=function(_0x407271,_0xf7125a){return _0x407271[_0x0f7b('0xa')]('MailServerIn',attributes,{'tableName':_0x0f7b('0xb'),'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 4fb4d58..c772c60 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 _0xff93=['request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','code','error','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','model','map','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xa1f5c4,_0x247496){var _0x3f2f74=function(_0x3dae53){while(--_0x3dae53){_0xa1f5c4['push'](_0xa1f5c4['shift']());}};_0x3f2f74(++_0x247496);}(_0xff93,0x1f3));var _0x3ff9=function(_0x373d85,_0x8e6311){_0x373d85=_0x373d85-0x0;var _0x1b314b=_0xff93[_0x373d85];return _0x1b314b;};'use strict';var _=require('lodash');var util=require(_0x3ff9('0x0'));var moment=require(_0x3ff9('0x1'));var BPromise=require('bluebird');var rs=require(_0x3ff9('0x2'));var fs=require('fs');var Redis=require(_0x3ff9('0x3'));var db=require(_0x3ff9('0x4'))['db'];var utils=require(_0x3ff9('0x5'));var logger=require(_0x3ff9('0x6'))(_0x3ff9('0x7'));var config=require(_0x3ff9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ff9('0x9')][_0x3ff9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f6e9f,_0x3f7a77,_0x20886f){return new BPromise(function(_0x586fb5,_0x3db180){return client[_0x3ff9('0xb')](_0x1f6e9f,_0x20886f)[_0x3ff9('0xc')](function(_0x437541){logger[_0x3ff9('0xd')]('MailServerIn,\x20%s,\x20%s',_0x3f7a77,_0x3ff9('0xe'));logger[_0x3ff9('0xf')](_0x3ff9('0x10'),_0x3f7a77,_0x3ff9('0xe'),JSON[_0x3ff9('0x11')](_0x437541));if(_0x437541['error']){if(_0x437541['error'][_0x3ff9('0x12')]===0x1f4){logger[_0x3ff9('0x13')](_0x3ff9('0x14'),_0x3f7a77,_0x437541[_0x3ff9('0x13')][_0x3ff9('0x15')]);return _0x3db180(_0x437541['error'][_0x3ff9('0x15')]);}logger['error'](_0x3ff9('0x14'),_0x3f7a77,_0x437541[_0x3ff9('0x13')][_0x3ff9('0x15')]);return _0x586fb5(_0x437541[_0x3ff9('0x13')][_0x3ff9('0x15')]);}else{logger[_0x3ff9('0xd')](_0x3ff9('0x14'),_0x3f7a77,_0x3ff9('0xe'));_0x586fb5(_0x437541[_0x3ff9('0x16')]['message']);}})[_0x3ff9('0x17')](function(_0x4e0739){logger[_0x3ff9('0x13')](_0x3ff9('0x14'),_0x3f7a77,_0x4e0739);_0x3db180(_0x4e0739);});});}exports[_0x3ff9('0x18')]=function(_0x44dd81){var _0x2eddc9=this;return new Promise(function(_0x34f253,_0x538b7f){return db[_0x3ff9('0x19')]['findAll']({'raw':_0x44dd81[_0x3ff9('0x1a')]?_0x44dd81[_0x3ff9('0x1a')][_0x3ff9('0x1b')]===undefined?!![]:![]:!![],'where':_0x44dd81[_0x3ff9('0x1a')]?_0x44dd81[_0x3ff9('0x1a')][_0x3ff9('0x1c')]||null:null,'attributes':_0x44dd81[_0x3ff9('0x1a')]?_0x44dd81[_0x3ff9('0x1a')][_0x3ff9('0x1d')]||null:null,'limit':_0x44dd81['options']?_0x44dd81['options'][_0x3ff9('0x1e')]||null:null,'include':_0x44dd81[_0x3ff9('0x1a')]?_0x44dd81['options']['include']?_['map'](_0x44dd81[_0x3ff9('0x1a')][_0x3ff9('0x1f')],function(_0x2a3bd0){return{'model':db[_0x2a3bd0[_0x3ff9('0x20')]],'as':_0x2a3bd0['as'],'attributes':_0x2a3bd0['attributes'],'include':_0x2a3bd0['include']?_[_0x3ff9('0x21')](_0x2a3bd0['include'],function(_0x1ed082){return{'model':db[_0x1ed082[_0x3ff9('0x20')]],'as':_0x1ed082['as'],'attributes':_0x1ed082[_0x3ff9('0x1d')],'include':_0x1ed082[_0x3ff9('0x1f')]?_[_0x3ff9('0x21')](_0x1ed082[_0x3ff9('0x1f')],function(_0x254fba){return{'model':db[_0x254fba['model']],'as':_0x254fba['as'],'attributes':_0x254fba[_0x3ff9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3ff9('0xc')](function(_0x450aba){logger[_0x3ff9('0xd')]('GetMailServerIn',_0x44dd81);logger[_0x3ff9('0xf')](_0x3ff9('0x18'),_0x44dd81,JSON[_0x3ff9('0x11')](_0x450aba));_0x34f253(_0x450aba);})[_0x3ff9('0x17')](function(_0x30682a){logger['error'](_0x3ff9('0x18'),_0x30682a[_0x3ff9('0x15')],_0x44dd81);_0x538b7f(_0x2eddc9[_0x3ff9('0x13')](0x1f4,_0x30682a['message']));});});}; \ No newline at end of file +var _0x1db3=['findAll','options','where','attributes','limit','include','map','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailServerIn','MailServerIn'];(function(_0x1e7739,_0x4943e9){var _0x3db84b=function(_0x443975){while(--_0x443975){_0x1e7739['push'](_0x1e7739['shift']());}};_0x3db84b(++_0x4943e9);}(_0x1db3,0x1e5));var _0x31db=function(_0x2b3072,_0x57275a){_0x2b3072=_0x2b3072-0x0;var _0xc217e4=_0x1db3[_0x2b3072];return _0xc217e4;};'use strict';var _=require('lodash');var util=require(_0x31db('0x0'));var moment=require(_0x31db('0x1'));var BPromise=require(_0x31db('0x2'));var rs=require(_0x31db('0x3'));var fs=require('fs');var Redis=require(_0x31db('0x4'));var db=require(_0x31db('0x5'))['db'];var utils=require(_0x31db('0x6'));var logger=require(_0x31db('0x7'))(_0x31db('0x8'));var config=require(_0x31db('0x9'));var jayson=require(_0x31db('0xa'));var client=jayson[_0x31db('0xb')][_0x31db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x156381,_0xa4f685,_0x44e204){return new BPromise(function(_0x3a431e,_0x3881c8){return client[_0x31db('0xd')](_0x156381,_0x44e204)['then'](function(_0x19d1a9){logger[_0x31db('0xe')](_0x31db('0xf'),_0xa4f685,_0x31db('0x10'));logger[_0x31db('0x11')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xa4f685,_0x31db('0x10'),JSON[_0x31db('0x12')](_0x19d1a9));if(_0x19d1a9[_0x31db('0x13')]){if(_0x19d1a9['error'][_0x31db('0x14')]===0x1f4){logger[_0x31db('0x13')](_0x31db('0xf'),_0xa4f685,_0x19d1a9[_0x31db('0x13')][_0x31db('0x15')]);return _0x3881c8(_0x19d1a9[_0x31db('0x13')]['message']);}logger['error'](_0x31db('0xf'),_0xa4f685,_0x19d1a9['error'][_0x31db('0x15')]);return _0x3a431e(_0x19d1a9[_0x31db('0x13')][_0x31db('0x15')]);}else{logger[_0x31db('0xe')](_0x31db('0xf'),_0xa4f685,'request\x20sent');_0x3a431e(_0x19d1a9['result']['message']);}})[_0x31db('0x16')](function(_0x22aa89){logger[_0x31db('0x13')](_0x31db('0xf'),_0xa4f685,_0x22aa89);_0x3881c8(_0x22aa89);});});}exports[_0x31db('0x17')]=function(_0x1d3218){var _0x9f2780=this;return new Promise(function(_0x3df86e,_0x2d9dd7){return db[_0x31db('0x18')][_0x31db('0x19')]({'raw':_0x1d3218['options']?_0x1d3218[_0x31db('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1d3218['options']?_0x1d3218[_0x31db('0x1a')][_0x31db('0x1b')]||null:null,'attributes':_0x1d3218[_0x31db('0x1a')]?_0x1d3218[_0x31db('0x1a')][_0x31db('0x1c')]||null:null,'limit':_0x1d3218[_0x31db('0x1a')]?_0x1d3218[_0x31db('0x1a')][_0x31db('0x1d')]||null:null,'include':_0x1d3218[_0x31db('0x1a')]?_0x1d3218[_0x31db('0x1a')][_0x31db('0x1e')]?_[_0x31db('0x1f')](_0x1d3218['options'][_0x31db('0x1e')],function(_0x335cc9){return{'model':db[_0x335cc9[_0x31db('0x20')]],'as':_0x335cc9['as'],'attributes':_0x335cc9['attributes'],'include':_0x335cc9[_0x31db('0x1e')]?_['map'](_0x335cc9['include'],function(_0x2ea3a6){return{'model':db[_0x2ea3a6[_0x31db('0x20')]],'as':_0x2ea3a6['as'],'attributes':_0x2ea3a6['attributes'],'include':_0x2ea3a6['include']?_['map'](_0x2ea3a6[_0x31db('0x1e')],function(_0x48668b){return{'model':db[_0x48668b[_0x31db('0x20')]],'as':_0x48668b['as'],'attributes':_0x48668b[_0x31db('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x31db('0x21')](function(_0x3effc4){logger[_0x31db('0xe')](_0x31db('0x17'),_0x1d3218);logger[_0x31db('0x11')](_0x31db('0x17'),_0x1d3218,JSON[_0x31db('0x12')](_0x3effc4));_0x3df86e(_0x3effc4);})['catch'](function(_0x1a1124){logger[_0x31db('0x13')]('GetMailServerIn',_0x1a1124['message'],_0x1d3218);_0x2d9dd7(_0x9f2780[_0x31db('0x13')](0x1f4,_0x1a1124['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index face5ad..743295d 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x3c3106,_0x13f019){_0x3c3106=_0x3c3106-0x0;var _0x258fcb=_0x7a54[_0x3c3106];return _0x258fcb;};'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 fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index abaff06..76b6956 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 _0xb10b=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0xb10b,0x12a));var _0xbb10=function(_0x408753,_0x5176e1){_0x408753=_0x408753-0x0;var _0x1ba6f1=_0xb10b[_0x408753];return _0x1ba6f1;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize[_0xbb10('0x1')]},'user':{'type':Sequelize[_0xbb10('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x2')]},'secure':{'type':Sequelize[_0xbb10('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xbb10('0x1')]},'authentication':{'type':Sequelize[_0xbb10('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xbb10('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6e6c=['exports','STRING','BOOLEAN','sequelize'];(function(_0x358b1a,_0x3598ed){var _0x421afc=function(_0x50859a){while(--_0x50859a){_0x358b1a['push'](_0x358b1a['shift']());}};_0x421afc(++_0x3598ed);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc6e6('0x2')]},'user':{'type':Sequelize[_0xc6e6('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xc6e6('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index bd706f5..1dfd5ed 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 _0xcaa9=['stack','name','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','filters','intersection','fields','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error'];(function(_0xbb2b8b,_0x325cbe){var _0x65d0d3=function(_0x4444d2){while(--_0x4444d2){_0xbb2b8b['push'](_0xbb2b8b['shift']());}};_0x65d0d3(++_0x325cbe);}(_0xcaa9,0x193));var _0x9caa=function(_0x54d7de,_0x5cbf8c){_0x54d7de=_0x54d7de-0x0;var _0x59aa3c=_0xcaa9[_0x54d7de];return _0x59aa3c;};'use strict';var emlformat=require(_0x9caa('0x0'));var rimraf=require(_0x9caa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9caa('0x2'));var rp=require(_0x9caa('0x3'));var moment=require('moment');var BPromise=require(_0x9caa('0x4'));var Mustache=require(_0x9caa('0x5'));var util=require(_0x9caa('0x6'));var path=require(_0x9caa('0x7'));var sox=require(_0x9caa('0x8'));var csv=require('to-csv');var ejs=require(_0x9caa('0x9'));var fs=require('fs');var fs_extra=require(_0x9caa('0xa'));var _=require(_0x9caa('0xb'));var squel=require('squel');var crypto=require(_0x9caa('0xc'));var jsforce=require(_0x9caa('0xd'));var deskjs=require(_0x9caa('0xe'));var toCsv=require(_0x9caa('0xf'));var querystring=require('querystring');var Papa=require(_0x9caa('0x10'));var Redis=require(_0x9caa('0x11'));var authService=require(_0x9caa('0x12'));var qs=require(_0x9caa('0x13'));var as=require(_0x9caa('0x14'));var hardwareService=require(_0x9caa('0x15'));var logger=require(_0x9caa('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x9caa('0x17'));var licenseUtil=require(_0x9caa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c352f,_0x51796d){_0x51796d=_0x51796d||0xcc;return function(_0x2a18be){if(_0x2a18be){return _0x5c352f[_0x9caa('0x19')](_0x51796d);}return _0x5c352f['status'](_0x51796d)[_0x9caa('0x1a')]();};}function respondWithResult(_0x3efe1b,_0x2502c0){_0x2502c0=_0x2502c0||0xc8;return function(_0xc58de6){if(_0xc58de6){return _0x3efe1b[_0x9caa('0x1b')](_0x2502c0)['json'](_0xc58de6);}};}function respondWithFilteredResult(_0x7a161a,_0x499e9a){return function(_0x391154){if(_0x391154){var _0x3c0949=typeof _0x499e9a[_0x9caa('0x1c')]===_0x9caa('0x1d')&&typeof _0x499e9a[_0x9caa('0x1e')]===_0x9caa('0x1d');var _0x2081a7=_0x391154['count'];var _0x37f158=_0x3c0949?0x0:_0x499e9a[_0x9caa('0x1c')];var _0x2c6223=_0x3c0949?_0x391154[_0x9caa('0x1f')]:_0x499e9a[_0x9caa('0x1c')]+_0x499e9a['limit'];var _0xd82738;if(_0x2c6223>=_0x2081a7){_0x2c6223=_0x2081a7;_0xd82738=0xc8;}else{_0xd82738=0xce;}_0x7a161a[_0x9caa('0x1b')](_0xd82738);return _0x7a161a[_0x9caa('0x20')](_0x9caa('0x21'),_0x37f158+'-'+_0x2c6223+'/'+_0x2081a7)[_0x9caa('0x22')](_0x391154);}return null;};}function patchUpdates(_0x31a48b){return function(_0x26c71b){try{jsonpatch['apply'](_0x26c71b,_0x31a48b,!![]);}catch(_0x3cd996){return BPromise[_0x9caa('0x23')](_0x3cd996);}return _0x26c71b[_0x9caa('0x24')]();};}function saveUpdates(_0x59ff0d,_0x424389){return function(_0x401028){if(_0x401028){return _0x401028[_0x9caa('0x25')](_0x59ff0d)[_0x9caa('0x26')](function(_0x1350ee){return _0x1350ee;});}return null;};}function removeEntity(_0x493413,_0x2acf47){return function(_0x4be7f0){if(_0x4be7f0){return _0x4be7f0[_0x9caa('0x27')]()['then'](function(){_0x493413[_0x9caa('0x1b')](0xcc)[_0x9caa('0x1a')]();});}};}function handleEntityNotFound(_0x2ca627,_0x298f73){return function(_0x58bad8){if(!_0x58bad8){_0x2ca627[_0x9caa('0x19')](0x194);}return _0x58bad8;};}function handleError(_0x5c8de9,_0x487096){_0x487096=_0x487096||0x1f4;return function(_0x5ea5ac){logger[_0x9caa('0x28')](_0x5ea5ac[_0x9caa('0x29')]);if(_0x5ea5ac[_0x9caa('0x2a')]){delete _0x5ea5ac[_0x9caa('0x2a')];}_0x5c8de9['status'](_0x487096)['send'](_0x5ea5ac);};}exports['index']=function(_0xd13604,_0x3205bc){var _0x381cfc={},_0x5210aa={},_0x7ac6af={'count':0x0,'rows':[]};var _0x27c5f7=_[_0x9caa('0x2b')](db[_0x9caa('0x2c')][_0x9caa('0x2d')],function(_0x18f49a){return{'name':_0x18f49a[_0x9caa('0x2e')],'type':_0x18f49a[_0x9caa('0x2f')][_0x9caa('0x30')]};});_0x5210aa[_0x9caa('0x31')]=_[_0x9caa('0x2b')](_0x27c5f7,_0x9caa('0x2a'));_0x5210aa[_0x9caa('0x32')]=_[_0x9caa('0x33')](_0xd13604[_0x9caa('0x32')]);_0x5210aa['filters']=_['intersection'](_0x5210aa[_0x9caa('0x31')],_0x5210aa['query']);_0x381cfc[_0x9caa('0x34')]=_['intersection'](_0x5210aa[_0x9caa('0x31')],qs['fields'](_0xd13604[_0x9caa('0x32')]['fields']));_0x381cfc[_0x9caa('0x34')]=_0x381cfc[_0x9caa('0x34')][_0x9caa('0x35')]?_0x381cfc[_0x9caa('0x34')]:_0x5210aa['model'];if(!_0xd13604['query'][_0x9caa('0x36')](_0x9caa('0x37'))){_0x381cfc['limit']=qs[_0x9caa('0x1e')](_0xd13604[_0x9caa('0x32')][_0x9caa('0x1e')]);_0x381cfc[_0x9caa('0x1c')]=qs[_0x9caa('0x1c')](_0xd13604[_0x9caa('0x32')][_0x9caa('0x1c')]);}_0x381cfc[_0x9caa('0x38')]=qs['sort'](_0xd13604[_0x9caa('0x32')][_0x9caa('0x39')]);_0x381cfc[_0x9caa('0x3a')]=qs['filters'](_['pick'](_0xd13604['query'],_0x5210aa['filters']),_0x27c5f7);if(_0xd13604[_0x9caa('0x32')]['filter']){_0x381cfc[_0x9caa('0x3a')]=_['merge'](_0x381cfc[_0x9caa('0x3a')],{'$or':_['map'](_0x27c5f7,function(_0x5ed340){if(_0x5ed340[_0x9caa('0x2f')]!==_0x9caa('0x3b')){var _0x4d697a={};_0x4d697a[_0x5ed340[_0x9caa('0x2a')]]={'$like':'%'+_0xd13604['query']['filter']+'%'};return _0x4d697a;}})});}_0x381cfc=_[_0x9caa('0x3c')]({},_0x381cfc,_0xd13604[_0x9caa('0x3d')]);var _0x2cf700={'where':_0x381cfc[_0x9caa('0x3a')]};return db[_0x9caa('0x2c')]['count'](_0x2cf700)[_0x9caa('0x26')](function(_0x305a61){_0x7ac6af[_0x9caa('0x1f')]=_0x305a61;if(_0xd13604['query'][_0x9caa('0x3e')]){_0x381cfc[_0x9caa('0x3f')]=[{'all':!![]}];}return db[_0x9caa('0x2c')]['findAll'](_0x381cfc);})[_0x9caa('0x26')](function(_0x530b42){_0x7ac6af[_0x9caa('0x40')]=_0x530b42;return _0x7ac6af;})[_0x9caa('0x26')](respondWithFilteredResult(_0x3205bc,_0x381cfc))[_0x9caa('0x41')](handleError(_0x3205bc,null));};exports[_0x9caa('0x42')]=function(_0x2b5cfe,_0x49d538){var _0x427610={'raw':!![],'where':{'id':_0x2b5cfe['params']['id']}},_0x24d6ba={};_0x24d6ba[_0x9caa('0x31')]=_['keys'](db[_0x9caa('0x2c')]['rawAttributes']);_0x24d6ba[_0x9caa('0x32')]=_['keys'](_0x2b5cfe[_0x9caa('0x32')]);_0x24d6ba[_0x9caa('0x43')]=_[_0x9caa('0x44')](_0x24d6ba[_0x9caa('0x31')],_0x24d6ba['query']);_0x427610[_0x9caa('0x34')]=_[_0x9caa('0x44')](_0x24d6ba['model'],qs[_0x9caa('0x45')](_0x2b5cfe['query'][_0x9caa('0x45')]));_0x427610['attributes']=_0x427610['attributes'][_0x9caa('0x35')]?_0x427610[_0x9caa('0x34')]:_0x24d6ba[_0x9caa('0x31')];if(_0x2b5cfe[_0x9caa('0x32')][_0x9caa('0x3e')]){_0x427610[_0x9caa('0x3f')]=[{'all':!![]}];}_0x427610=_['merge']({},_0x427610,_0x2b5cfe[_0x9caa('0x3d')]);return db['MailServerOut']['find'](_0x427610)[_0x9caa('0x26')](handleEntityNotFound(_0x49d538,null))[_0x9caa('0x26')](respondWithResult(_0x49d538,null))[_0x9caa('0x41')](handleError(_0x49d538,null));};exports[_0x9caa('0x46')]=function(_0x300162,_0x919514){return db['MailServerOut'][_0x9caa('0x46')](_0x300162[_0x9caa('0x47')],{})[_0x9caa('0x26')](respondWithResult(_0x919514,0xc9))[_0x9caa('0x41')](handleError(_0x919514,null));};exports[_0x9caa('0x25')]=function(_0x4afbd7,_0x4d4118){if(_0x4afbd7['body']['id']){delete _0x4afbd7[_0x9caa('0x47')]['id'];}return db['MailServerOut'][_0x9caa('0x48')]({'where':{'id':_0x4afbd7['params']['id']}})['then'](handleEntityNotFound(_0x4d4118,null))['then'](saveUpdates(_0x4afbd7['body'],null))['then'](respondWithResult(_0x4d4118,null))[_0x9caa('0x41')](handleError(_0x4d4118,null));};exports[_0x9caa('0x27')]=function(_0x13fe74,_0x177e9c){return db[_0x9caa('0x2c')][_0x9caa('0x48')]({'where':{'id':_0x13fe74[_0x9caa('0x49')]['id']}})[_0x9caa('0x26')](handleEntityNotFound(_0x177e9c,null))[_0x9caa('0x26')](removeEntity(_0x177e9c,null))[_0x9caa('0x41')](handleError(_0x177e9c,null));}; \ No newline at end of file +var _0x3412=['end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','options','MailServerOut','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','eml-format','fast-json-patch','moment','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x3412,0xb9));var _0x2341=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x3412[_0x10004e];return _0x5af990;};'use strict';var emlformat=require(_0x2341('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2341('0x1'));var rp=require('request-promise');var moment=require(_0x2341('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2341('0x3'));var path=require(_0x2341('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2341('0x5'));var _=require(_0x2341('0x6'));var squel=require(_0x2341('0x7'));var crypto=require(_0x2341('0x8'));var jsforce=require(_0x2341('0x9'));var deskjs=require(_0x2341('0xa'));var toCsv=require(_0x2341('0xb'));var querystring=require(_0x2341('0xc'));var Papa=require(_0x2341('0xd'));var Redis=require(_0x2341('0xe'));var authService=require(_0x2341('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2341('0x10'));var hardwareService=require(_0x2341('0x11'));var logger=require(_0x2341('0x12'))(_0x2341('0x13'));var utils=require('../../config/utils');var config=require(_0x2341('0x14'));var licenseUtil=require(_0x2341('0x15'));var db=require(_0x2341('0x16'))['db'];function respondWithStatusCode(_0x3737d5,_0x4e25f0){_0x4e25f0=_0x4e25f0||0xcc;return function(_0xd24a1c){if(_0xd24a1c){return _0x3737d5[_0x2341('0x17')](_0x4e25f0);}return _0x3737d5[_0x2341('0x18')](_0x4e25f0)[_0x2341('0x19')]();};}function respondWithResult(_0x29867,_0x31782b){_0x31782b=_0x31782b||0xc8;return function(_0x4d9c8c){if(_0x4d9c8c){return _0x29867[_0x2341('0x18')](_0x31782b)['json'](_0x4d9c8c);}};}function respondWithFilteredResult(_0x56f679,_0x12d464){return function(_0x24848a){if(_0x24848a){var _0x118bc1=typeof _0x12d464[_0x2341('0x1a')]===_0x2341('0x1b')&&typeof _0x12d464['limit']===_0x2341('0x1b');var _0x2e463b=_0x24848a[_0x2341('0x1c')];var _0x5784d8=_0x118bc1?0x0:_0x12d464[_0x2341('0x1a')];var _0x3f258a=_0x118bc1?_0x24848a['count']:_0x12d464['offset']+_0x12d464[_0x2341('0x1d')];var _0x2c1b07;if(_0x3f258a>=_0x2e463b){_0x3f258a=_0x2e463b;_0x2c1b07=0xc8;}else{_0x2c1b07=0xce;}_0x56f679[_0x2341('0x18')](_0x2c1b07);return _0x56f679[_0x2341('0x1e')](_0x2341('0x1f'),_0x5784d8+'-'+_0x3f258a+'/'+_0x2e463b)['json'](_0x24848a);}return null;};}function patchUpdates(_0x3d249d){return function(_0x5ad753){try{jsonpatch[_0x2341('0x20')](_0x5ad753,_0x3d249d,!![]);}catch(_0xa92015){return BPromise[_0x2341('0x21')](_0xa92015);}return _0x5ad753[_0x2341('0x22')]();};}function saveUpdates(_0xbe8d08,_0x195cf2){return function(_0x394c6a){if(_0x394c6a){return _0x394c6a['update'](_0xbe8d08)[_0x2341('0x23')](function(_0x2b9bd9){return _0x2b9bd9;});}return null;};}function removeEntity(_0x225f63,_0x1ccc66){return function(_0x2d0ac3){if(_0x2d0ac3){return _0x2d0ac3[_0x2341('0x24')]()[_0x2341('0x23')](function(){_0x225f63[_0x2341('0x18')](0xcc)[_0x2341('0x19')]();});}};}function handleEntityNotFound(_0x4435d9,_0x2fae71){return function(_0x588b8a){if(!_0x588b8a){_0x4435d9[_0x2341('0x17')](0x194);}return _0x588b8a;};}function handleError(_0x5ecd80,_0x1f3db8){_0x1f3db8=_0x1f3db8||0x1f4;return function(_0x5c71b7){logger['error'](_0x5c71b7['stack']);if(_0x5c71b7[_0x2341('0x25')]){delete _0x5c71b7['name'];}_0x5ecd80['status'](_0x1f3db8)['send'](_0x5c71b7);};}exports[_0x2341('0x26')]=function(_0x14778c,_0x232071){var _0x282709={},_0x3c7ee1={},_0x435096={'count':0x0,'rows':[]};var _0x37496f=_[_0x2341('0x27')](db['MailServerOut'][_0x2341('0x28')],function(_0x2d2ebe){return{'name':_0x2d2ebe[_0x2341('0x29')],'type':_0x2d2ebe[_0x2341('0x2a')]['key']};});_0x3c7ee1[_0x2341('0x2b')]=_[_0x2341('0x27')](_0x37496f,_0x2341('0x25'));_0x3c7ee1[_0x2341('0x2c')]=_[_0x2341('0x2d')](_0x14778c[_0x2341('0x2c')]);_0x3c7ee1[_0x2341('0x2e')]=_[_0x2341('0x2f')](_0x3c7ee1[_0x2341('0x2b')],_0x3c7ee1[_0x2341('0x2c')]);_0x282709['attributes']=_['intersection'](_0x3c7ee1[_0x2341('0x2b')],qs[_0x2341('0x30')](_0x14778c[_0x2341('0x2c')]['fields']));_0x282709[_0x2341('0x31')]=_0x282709[_0x2341('0x31')][_0x2341('0x32')]?_0x282709[_0x2341('0x31')]:_0x3c7ee1[_0x2341('0x2b')];if(!_0x14778c[_0x2341('0x2c')][_0x2341('0x33')](_0x2341('0x34'))){_0x282709[_0x2341('0x1d')]=qs[_0x2341('0x1d')](_0x14778c['query']['limit']);_0x282709[_0x2341('0x1a')]=qs[_0x2341('0x1a')](_0x14778c[_0x2341('0x2c')][_0x2341('0x1a')]);}_0x282709[_0x2341('0x35')]=qs['sort'](_0x14778c['query']['sort']);_0x282709[_0x2341('0x36')]=qs[_0x2341('0x2e')](_['pick'](_0x14778c['query'],_0x3c7ee1[_0x2341('0x2e')]),_0x37496f);if(_0x14778c[_0x2341('0x2c')][_0x2341('0x37')]){_0x282709[_0x2341('0x36')]=_[_0x2341('0x38')](_0x282709[_0x2341('0x36')],{'$or':_[_0x2341('0x27')](_0x37496f,function(_0x4e39f9){if(_0x4e39f9[_0x2341('0x2a')]!=='VIRTUAL'){var _0xf41cb3={};_0xf41cb3[_0x4e39f9['name']]={'$like':'%'+_0x14778c[_0x2341('0x2c')][_0x2341('0x37')]+'%'};return _0xf41cb3;}})});}_0x282709=_[_0x2341('0x38')]({},_0x282709,_0x14778c[_0x2341('0x39')]);var _0x4d6c5c={'where':_0x282709[_0x2341('0x36')]};return db[_0x2341('0x3a')][_0x2341('0x1c')](_0x4d6c5c)[_0x2341('0x23')](function(_0x5d87b6){_0x435096['count']=_0x5d87b6;if(_0x14778c[_0x2341('0x2c')][_0x2341('0x3b')]){_0x282709[_0x2341('0x3c')]=[{'all':!![]}];}return db['MailServerOut'][_0x2341('0x3d')](_0x282709);})[_0x2341('0x23')](function(_0x5aae72){_0x435096[_0x2341('0x3e')]=_0x5aae72;return _0x435096;})[_0x2341('0x23')](respondWithFilteredResult(_0x232071,_0x282709))[_0x2341('0x3f')](handleError(_0x232071,null));};exports[_0x2341('0x40')]=function(_0x13ae86,_0x261d06){var _0x5ed9bf={'raw':!![],'where':{'id':_0x13ae86['params']['id']}},_0x3e639d={};_0x3e639d[_0x2341('0x2b')]=_[_0x2341('0x2d')](db[_0x2341('0x3a')][_0x2341('0x28')]);_0x3e639d['query']=_[_0x2341('0x2d')](_0x13ae86[_0x2341('0x2c')]);_0x3e639d['filters']=_['intersection'](_0x3e639d[_0x2341('0x2b')],_0x3e639d[_0x2341('0x2c')]);_0x5ed9bf[_0x2341('0x31')]=_['intersection'](_0x3e639d[_0x2341('0x2b')],qs[_0x2341('0x30')](_0x13ae86[_0x2341('0x2c')][_0x2341('0x30')]));_0x5ed9bf['attributes']=_0x5ed9bf['attributes'][_0x2341('0x32')]?_0x5ed9bf[_0x2341('0x31')]:_0x3e639d['model'];if(_0x13ae86[_0x2341('0x2c')][_0x2341('0x3b')]){_0x5ed9bf[_0x2341('0x3c')]=[{'all':!![]}];}_0x5ed9bf=_[_0x2341('0x38')]({},_0x5ed9bf,_0x13ae86[_0x2341('0x39')]);return db[_0x2341('0x3a')][_0x2341('0x41')](_0x5ed9bf)['then'](handleEntityNotFound(_0x261d06,null))[_0x2341('0x23')](respondWithResult(_0x261d06,null))[_0x2341('0x3f')](handleError(_0x261d06,null));};exports[_0x2341('0x42')]=function(_0x10a7e1,_0x1c3bf8){return db['MailServerOut']['create'](_0x10a7e1[_0x2341('0x43')],{})[_0x2341('0x23')](respondWithResult(_0x1c3bf8,0xc9))[_0x2341('0x3f')](handleError(_0x1c3bf8,null));};exports[_0x2341('0x44')]=function(_0x3ed13f,_0x5b7a85){if(_0x3ed13f[_0x2341('0x43')]['id']){delete _0x3ed13f[_0x2341('0x43')]['id'];}return db[_0x2341('0x3a')]['find']({'where':{'id':_0x3ed13f[_0x2341('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b7a85,null))[_0x2341('0x23')](saveUpdates(_0x3ed13f[_0x2341('0x43')],null))[_0x2341('0x23')](respondWithResult(_0x5b7a85,null))[_0x2341('0x3f')](handleError(_0x5b7a85,null));};exports[_0x2341('0x24')]=function(_0x111b39,_0x2f89a4){return db['MailServerOut'][_0x2341('0x41')]({'where':{'id':_0x111b39['params']['id']}})[_0x2341('0x23')](handleEntityNotFound(_0x2f89a4,null))['then'](removeEntity(_0x2f89a4,null))[_0x2341('0x3f')](handleError(_0x2f89a4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index a745ed1..11c1503 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 _0xba33=['mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x57a65e,_0x33a406){var _0x3cfaf8=function(_0x5095cd){while(--_0x5095cd){_0x57a65e['push'](_0x57a65e['shift']());}};_0x3cfaf8(++_0x33a406);}(_0xba33,0xa9));var _0x3ba3=function(_0x209c25,_0x443c14){_0x209c25=_0x209c25-0x0;var _0x2f864a=_0xba33[_0x209c25];return _0x2f864a;};'use strict';var _=require(_0x3ba3('0x0'));var util=require(_0x3ba3('0x1'));var logger=require(_0x3ba3('0x2'))(_0x3ba3('0x3'));var moment=require(_0x3ba3('0x4'));var BPromise=require('bluebird');var rp=require(_0x3ba3('0x5'));var fs=require('fs');var path=require(_0x3ba3('0x6'));var rimraf=require(_0x3ba3('0x7'));var config=require(_0x3ba3('0x8'));var attributes=require('./mailServerOut.attributes');module[_0x3ba3('0x9')]=function(_0x281b0d,_0x3d888d){return _0x281b0d[_0x3ba3('0xa')]('MailServerOut',attributes,{'tableName':_0x3ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa095=['exports','define','mail_servers_out','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x36efde,_0x47fe88){var _0x36a9b8=function(_0x55f796){while(--_0x55f796){_0x36efde['push'](_0x36efde['shift']());}};_0x36a9b8(++_0x47fe88);}(_0xa095,0xfd));var _0x5a09=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xa095[_0x4914e2];return _0x2dcd07;};'use strict';var _=require(_0x5a09('0x0'));var util=require(_0x5a09('0x1'));var logger=require(_0x5a09('0x2'))(_0x5a09('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a09('0x4'));var rimraf=require(_0x5a09('0x5'));var config=require(_0x5a09('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x5a09('0x7')]=function(_0x23586d,_0x4b0e3a){return _0x23586d[_0x5a09('0x8')]('MailServerOut',attributes,{'tableName':_0x5a09('0x9'),'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 c10a705..1a6f281 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0xc5dec1,_0x5afab1){var _0x132dae=function(_0x631ca3){while(--_0x631ca3){_0xc5dec1['push'](_0xc5dec1['shift']());}};_0x132dae(++_0x5afab1);}(_0x1261,0x144));var _0x1126=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0x1261[_0x401d67];return _0x25076b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x41cd34,_0x32cd0c){var _0x1273e8=function(_0x34f4f6){while(--_0x34f4f6){_0x41cd34['push'](_0x41cd34['shift']());}};_0x1273e8(++_0x32cd0c);}(_0xadb5,0xad));var _0x5adb=function(_0x58d317,_0x14c950){_0x58d317=_0x58d317-0x0;var _0x3e4a25=_0xadb5[_0x58d317];return _0x3e4a25;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 2d66545..c0e8073 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 _0xfea5=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','util','express','fs-extra'];(function(_0x501b20,_0x32ed28){var _0x36d125=function(_0x2b517a){while(--_0x2b517a){_0x501b20['push'](_0x501b20['shift']());}};_0x36d125(++_0x32ed28);}(_0xfea5,0x107));var _0x5fea=function(_0x25004e,_0xc0c2ea){_0x25004e=_0x25004e-0x0;var _0x2d5396=_0xfea5[_0x25004e];return _0x2d5396;};'use strict';var multer=require('multer');var util=require(_0x5fea('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5fea('0x1'));var router=express['Router']();var fs_extra=require(_0x5fea('0x2'));var auth=require(_0x5fea('0x3'));var interaction=require(_0x5fea('0x4'));var config=require(_0x5fea('0x5'));var controller=require('./mailSubstatus.controller');router[_0x5fea('0x6')]('/',auth[_0x5fea('0x7')](),controller[_0x5fea('0x8')]);router[_0x5fea('0x6')](_0x5fea('0x9'),auth[_0x5fea('0x7')](),controller[_0x5fea('0xa')]);router['get'](_0x5fea('0xb'),auth['isAuthenticated'](),controller[_0x5fea('0xc')]);router[_0x5fea('0xd')]('/',auth[_0x5fea('0x7')](),controller[_0x5fea('0xe')]);router['put'](_0x5fea('0xb'),auth['isAuthenticated'](),controller[_0x5fea('0xf')]);router[_0x5fea('0x10')](_0x5fea('0xb'),auth[_0x5fea('0x7')](),controller[_0x5fea('0x11')]);module[_0x5fea('0x12')]=router; \ No newline at end of file +var _0x6d77=['../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5d8a70,_0x596898){var _0x23242b=function(_0x3297cd){while(--_0x3297cd){_0x5d8a70['push'](_0x5d8a70['shift']());}};_0x23242b(++_0x596898);}(_0x6d77,0x1e0));var _0x76d7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6d77[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x76d7('0x0'));var util=require('util');var path=require(_0x76d7('0x1'));var timeout=require(_0x76d7('0x2'));var express=require(_0x76d7('0x3'));var router=express['Router']();var fs_extra=require(_0x76d7('0x4'));var auth=require(_0x76d7('0x5'));var interaction=require(_0x76d7('0x6'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x76d7('0x7')]('/',auth['isAuthenticated'](),controller[_0x76d7('0x8')]);router[_0x76d7('0x7')](_0x76d7('0x9'),auth[_0x76d7('0xa')](),controller[_0x76d7('0xb')]);router[_0x76d7('0x7')](_0x76d7('0xc'),auth[_0x76d7('0xa')](),controller[_0x76d7('0xd')]);router[_0x76d7('0xe')]('/',auth[_0x76d7('0xa')](),controller['create']);router[_0x76d7('0xf')](_0x76d7('0xc'),auth[_0x76d7('0xa')](),controller['update']);router['delete']('/:id',auth[_0x76d7('0xa')](),controller[_0x76d7('0x10')]);module[_0x76d7('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 8b8ccc6..0069905 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 _0x31af=['sequelize','exports','STRING'];(function(_0x6fc37a,_0x44c1e0){var _0x50fba8=function(_0x444c94){while(--_0x444c94){_0x6fc37a['push'](_0x6fc37a['shift']());}};_0x50fba8(++_0x44c1e0);}(_0x31af,0xde));var _0xf31a=function(_0x3a2714,_0x46a277){_0x3a2714=_0x3a2714-0x0;var _0x4b7b7b=_0x31af[_0x3a2714];return _0x4b7b7b;};'use strict';var Sequelize=require(_0xf31a('0x0'));module[_0xf31a('0x1')]={'name':{'type':Sequelize[_0xf31a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0618=['name','STRING','sequelize','exports'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x0618,0x1c6));var _0x8061=function(_0x44f0a1,_0x457d11){_0x44f0a1=_0x44f0a1-0x0;var _0x4af42e=_0x0618[_0x44f0a1];return _0x4af42e;};'use strict';var Sequelize=require(_0x8061('0x0'));module[_0x8061('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8061('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8061('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index e99e580..01cc7fd 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 _0x4515=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','save','update','then','destroy','sendStatus','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','rows','catch','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xcae655,_0x237427){var _0x3d6112=function(_0x208ae4){while(--_0x208ae4){_0xcae655['push'](_0xcae655['shift']());}};_0x3d6112(++_0x237427);}(_0x4515,0x7a));var _0x5451=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4515[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5451('0x0'));var zipdir=require(_0x5451('0x1'));var jsonpatch=require(_0x5451('0x2'));var rp=require(_0x5451('0x3'));var moment=require(_0x5451('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5451('0x5'));var util=require(_0x5451('0x6'));var path=require(_0x5451('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5451('0x8'));var fs=require('fs');var fs_extra=require(_0x5451('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5451('0xa'));var jsforce=require(_0x5451('0xb'));var deskjs=require(_0x5451('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5451('0xd'));var Papa=require(_0x5451('0xe'));var Redis=require(_0x5451('0xf'));var authService=require(_0x5451('0x10'));var qs=require(_0x5451('0x11'));var as=require(_0x5451('0x12'));var hardwareService=require(_0x5451('0x13'));var logger=require(_0x5451('0x14'))(_0x5451('0x15'));var utils=require(_0x5451('0x16'));var config=require(_0x5451('0x17'));var licenseUtil=require(_0x5451('0x18'));var db=require(_0x5451('0x19'))['db'];function respondWithStatusCode(_0x380823,_0x1fd88c){_0x1fd88c=_0x1fd88c||0xcc;return function(_0x5e4fbe){if(_0x5e4fbe){return _0x380823['sendStatus'](_0x1fd88c);}return _0x380823[_0x5451('0x1a')](_0x1fd88c)[_0x5451('0x1b')]();};}function respondWithResult(_0x1a8079,_0x20c281){_0x20c281=_0x20c281||0xc8;return function(_0x75bb85){if(_0x75bb85){return _0x1a8079[_0x5451('0x1a')](_0x20c281)[_0x5451('0x1c')](_0x75bb85);}};}function respondWithFilteredResult(_0x8753cb,_0x20abb3){return function(_0x2d0192){if(_0x2d0192){var _0x45a915=typeof _0x20abb3[_0x5451('0x1d')]===_0x5451('0x1e')&&typeof _0x20abb3[_0x5451('0x1f')]===_0x5451('0x1e');var _0x50cb76=_0x2d0192[_0x5451('0x20')];var _0x3d2a47=_0x45a915?0x0:_0x20abb3[_0x5451('0x1d')];var _0x4a7389=_0x45a915?_0x2d0192[_0x5451('0x20')]:_0x20abb3[_0x5451('0x1d')]+_0x20abb3[_0x5451('0x1f')];var _0x444302;if(_0x4a7389>=_0x50cb76){_0x4a7389=_0x50cb76;_0x444302=0xc8;}else{_0x444302=0xce;}_0x8753cb[_0x5451('0x1a')](_0x444302);return _0x8753cb['set']('Content-Range',_0x3d2a47+'-'+_0x4a7389+'/'+_0x50cb76)[_0x5451('0x1c')](_0x2d0192);}return null;};}function patchUpdates(_0x414ab6){return function(_0x3b24b0){try{jsonpatch['apply'](_0x3b24b0,_0x414ab6,!![]);}catch(_0x164116){return BPromise['reject'](_0x164116);}return _0x3b24b0[_0x5451('0x21')]();};}function saveUpdates(_0x233993,_0x1aaa56){return function(_0x23ee72){if(_0x23ee72){return _0x23ee72[_0x5451('0x22')](_0x233993)[_0x5451('0x23')](function(_0x94fe4){return _0x94fe4;});}return null;};}function removeEntity(_0x401753,_0x53cede){return function(_0x2cd294){if(_0x2cd294){return _0x2cd294[_0x5451('0x24')]()[_0x5451('0x23')](function(){_0x401753[_0x5451('0x1a')](0xcc)[_0x5451('0x1b')]();});}};}function handleEntityNotFound(_0x1c4c2c,_0x10340c){return function(_0x3511a7){if(!_0x3511a7){_0x1c4c2c[_0x5451('0x25')](0x194);}return _0x3511a7;};}function handleError(_0x120474,_0x55a20a){_0x55a20a=_0x55a20a||0x1f4;return function(_0x3404de){logger['error'](_0x3404de[_0x5451('0x26')]);if(_0x3404de[_0x5451('0x27')]){delete _0x3404de[_0x5451('0x27')];}_0x120474['status'](_0x55a20a)[_0x5451('0x28')](_0x3404de);};}exports[_0x5451('0x29')]=function(_0x3f1250,_0x3ee2d2){var _0x156f47={},_0x2678eb={},_0x40c284={'count':0x0,'rows':[]};var _0x3c55bc=_[_0x5451('0x2a')](db[_0x5451('0x2b')][_0x5451('0x2c')],function(_0x36ca57){return{'name':_0x36ca57[_0x5451('0x2d')],'type':_0x36ca57['type']['key']};});_0x2678eb[_0x5451('0x2e')]=_[_0x5451('0x2a')](_0x3c55bc,_0x5451('0x27'));_0x2678eb[_0x5451('0x2f')]=_[_0x5451('0x30')](_0x3f1250[_0x5451('0x2f')]);_0x2678eb['filters']=_[_0x5451('0x31')](_0x2678eb['model'],_0x2678eb[_0x5451('0x2f')]);_0x156f47[_0x5451('0x32')]=_['intersection'](_0x2678eb[_0x5451('0x2e')],qs['fields'](_0x3f1250[_0x5451('0x2f')][_0x5451('0x33')]));_0x156f47['attributes']=_0x156f47[_0x5451('0x32')][_0x5451('0x34')]?_0x156f47[_0x5451('0x32')]:_0x2678eb[_0x5451('0x2e')];if(!_0x3f1250[_0x5451('0x2f')][_0x5451('0x35')](_0x5451('0x36'))){_0x156f47[_0x5451('0x1f')]=qs[_0x5451('0x1f')](_0x3f1250[_0x5451('0x2f')][_0x5451('0x1f')]);_0x156f47[_0x5451('0x1d')]=qs[_0x5451('0x1d')](_0x3f1250[_0x5451('0x2f')][_0x5451('0x1d')]);}_0x156f47[_0x5451('0x37')]=qs['sort'](_0x3f1250['query'][_0x5451('0x38')]);_0x156f47[_0x5451('0x39')]=qs[_0x5451('0x3a')](_[_0x5451('0x3b')](_0x3f1250[_0x5451('0x2f')],_0x2678eb[_0x5451('0x3a')]),_0x3c55bc);if(_0x3f1250[_0x5451('0x2f')]['filter']){_0x156f47[_0x5451('0x39')]=_[_0x5451('0x3c')](_0x156f47[_0x5451('0x39')],{'$or':_['map'](_0x3c55bc,function(_0x2f9cb4){if(_0x2f9cb4[_0x5451('0x3d')]!=='VIRTUAL'){var _0x5bd3e8={};_0x5bd3e8[_0x2f9cb4['name']]={'$like':'%'+_0x3f1250[_0x5451('0x2f')][_0x5451('0x3e')]+'%'};return _0x5bd3e8;}})});}_0x156f47=_['merge']({},_0x156f47,_0x3f1250[_0x5451('0x3f')]);var _0x55cb5d={'where':_0x156f47[_0x5451('0x39')]};return db[_0x5451('0x2b')][_0x5451('0x20')](_0x55cb5d)[_0x5451('0x23')](function(_0x578e65){_0x40c284[_0x5451('0x20')]=_0x578e65;if(_0x3f1250[_0x5451('0x2f')][_0x5451('0x40')]){_0x156f47[_0x5451('0x41')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x156f47);})['then'](function(_0x23b181){_0x40c284[_0x5451('0x42')]=_0x23b181;return _0x40c284;})[_0x5451('0x23')](respondWithFilteredResult(_0x3ee2d2,_0x156f47))[_0x5451('0x43')](handleError(_0x3ee2d2,null));};exports['show']=function(_0x157bd7,_0x307c4a){var _0x3115b4={'raw':!![],'where':{'id':_0x157bd7['params']['id']}},_0xfd8b6f={};_0xfd8b6f[_0x5451('0x2e')]=_['keys'](db[_0x5451('0x2b')][_0x5451('0x2c')]);_0xfd8b6f[_0x5451('0x2f')]=_[_0x5451('0x30')](_0x157bd7[_0x5451('0x2f')]);_0xfd8b6f['filters']=_[_0x5451('0x31')](_0xfd8b6f['model'],_0xfd8b6f[_0x5451('0x2f')]);_0x3115b4['attributes']=_[_0x5451('0x31')](_0xfd8b6f[_0x5451('0x2e')],qs[_0x5451('0x33')](_0x157bd7[_0x5451('0x2f')]['fields']));_0x3115b4[_0x5451('0x32')]=_0x3115b4[_0x5451('0x32')][_0x5451('0x34')]?_0x3115b4['attributes']:_0xfd8b6f[_0x5451('0x2e')];if(_0x157bd7[_0x5451('0x2f')][_0x5451('0x40')]){_0x3115b4[_0x5451('0x41')]=[{'all':!![]}];}_0x3115b4=_[_0x5451('0x3c')]({},_0x3115b4,_0x157bd7[_0x5451('0x3f')]);return db['MailSubstatus']['find'](_0x3115b4)[_0x5451('0x23')](handleEntityNotFound(_0x307c4a,null))['then'](respondWithResult(_0x307c4a,null))[_0x5451('0x43')](handleError(_0x307c4a,null));};exports['create']=function(_0x35320b,_0x567116){return db[_0x5451('0x2b')][_0x5451('0x44')](_0x35320b[_0x5451('0x45')],{})['then'](respondWithResult(_0x567116,0xc9))[_0x5451('0x43')](handleError(_0x567116,null));};exports['update']=function(_0x15230e,_0x1eb9a7){if(_0x15230e[_0x5451('0x45')]['id']){delete _0x15230e[_0x5451('0x45')]['id'];}return db[_0x5451('0x2b')][_0x5451('0x46')]({'where':{'id':_0x15230e[_0x5451('0x47')]['id']}})[_0x5451('0x23')](handleEntityNotFound(_0x1eb9a7,null))[_0x5451('0x23')](saveUpdates(_0x15230e[_0x5451('0x45')],null))['then'](respondWithResult(_0x1eb9a7,null))[_0x5451('0x43')](handleError(_0x1eb9a7,null));};exports[_0x5451('0x24')]=function(_0x47d418,_0x3b63af){return db[_0x5451('0x2b')]['find']({'where':{'id':_0x47d418[_0x5451('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b63af,null))['then'](removeEntity(_0x3b63af,null))['catch'](handleError(_0x3b63af,null));};exports[_0x5451('0x48')]=function(_0x188adc,_0x2855fe){return db[_0x5451('0x2b')]['describe']()['then'](respondWithResult(_0x2855fe,null))[_0x5451('0x43')](handleError(_0x2855fe,null));}; \ No newline at end of file +var _0x9b91=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','MailSubstatus','rows','catch','show','params','find','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x39a50f,_0x559bd0){var _0x3243d1=function(_0x44ccd6){while(--_0x44ccd6){_0x39a50f['push'](_0x39a50f['shift']());}};_0x3243d1(++_0x559bd0);}(_0x9b91,0xbe));var _0x19b9=function(_0x5d10c2,_0x4b0a49){_0x5d10c2=_0x5d10c2-0x0;var _0x57c7c4=_0x9b91[_0x5d10c2];return _0x57c7c4;};'use strict';var emlformat=require(_0x19b9('0x0'));var rimraf=require(_0x19b9('0x1'));var zipdir=require(_0x19b9('0x2'));var jsonpatch=require(_0x19b9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x19b9('0x4'));var Mustache=require(_0x19b9('0x5'));var util=require('util');var path=require(_0x19b9('0x6'));var sox=require('sox');var csv=require(_0x19b9('0x7'));var ejs=require(_0x19b9('0x8'));var fs=require('fs');var fs_extra=require(_0x19b9('0x9'));var _=require(_0x19b9('0xa'));var squel=require(_0x19b9('0xb'));var crypto=require(_0x19b9('0xc'));var jsforce=require(_0x19b9('0xd'));var deskjs=require(_0x19b9('0xe'));var toCsv=require(_0x19b9('0x7'));var querystring=require(_0x19b9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x19b9('0x10'));var qs=require(_0x19b9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19b9('0x12'));var logger=require(_0x19b9('0x13'))('api');var utils=require(_0x19b9('0x14'));var config=require(_0x19b9('0x15'));var licenseUtil=require(_0x19b9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bad2b,_0x55a967){_0x55a967=_0x55a967||0xcc;return function(_0x26f591){if(_0x26f591){return _0x2bad2b[_0x19b9('0x17')](_0x55a967);}return _0x2bad2b[_0x19b9('0x18')](_0x55a967)[_0x19b9('0x19')]();};}function respondWithResult(_0x110403,_0x1d6957){_0x1d6957=_0x1d6957||0xc8;return function(_0x3a0e07){if(_0x3a0e07){return _0x110403[_0x19b9('0x18')](_0x1d6957)[_0x19b9('0x1a')](_0x3a0e07);}};}function respondWithFilteredResult(_0x251110,_0x49e0e9){return function(_0x17ec82){if(_0x17ec82){var _0x2d86bc=typeof _0x49e0e9[_0x19b9('0x1b')]===_0x19b9('0x1c')&&typeof _0x49e0e9[_0x19b9('0x1d')]===_0x19b9('0x1c');var _0x63c343=_0x17ec82[_0x19b9('0x1e')];var _0x1b4adc=_0x2d86bc?0x0:_0x49e0e9[_0x19b9('0x1b')];var _0x16d41c=_0x2d86bc?_0x17ec82[_0x19b9('0x1e')]:_0x49e0e9[_0x19b9('0x1b')]+_0x49e0e9[_0x19b9('0x1d')];var _0x4b9bb3;if(_0x16d41c>=_0x63c343){_0x16d41c=_0x63c343;_0x4b9bb3=0xc8;}else{_0x4b9bb3=0xce;}_0x251110[_0x19b9('0x18')](_0x4b9bb3);return _0x251110[_0x19b9('0x1f')](_0x19b9('0x20'),_0x1b4adc+'-'+_0x16d41c+'/'+_0x63c343)[_0x19b9('0x1a')](_0x17ec82);}return null;};}function patchUpdates(_0x57d745){return function(_0x45b718){try{jsonpatch[_0x19b9('0x21')](_0x45b718,_0x57d745,!![]);}catch(_0xb34525){return BPromise[_0x19b9('0x22')](_0xb34525);}return _0x45b718[_0x19b9('0x23')]();};}function saveUpdates(_0x58c5a5,_0x2b39e4){return function(_0x36e801){if(_0x36e801){return _0x36e801[_0x19b9('0x24')](_0x58c5a5)[_0x19b9('0x25')](function(_0x5a7381){return _0x5a7381;});}return null;};}function removeEntity(_0x3580ee,_0xb9d56){return function(_0x24e213){if(_0x24e213){return _0x24e213[_0x19b9('0x26')]()[_0x19b9('0x25')](function(){_0x3580ee['status'](0xcc)[_0x19b9('0x19')]();});}};}function handleEntityNotFound(_0x1074e9,_0x42093b){return function(_0x241025){if(!_0x241025){_0x1074e9[_0x19b9('0x17')](0x194);}return _0x241025;};}function handleError(_0x5325b9,_0x397192){_0x397192=_0x397192||0x1f4;return function(_0x4c01b6){logger[_0x19b9('0x27')](_0x4c01b6[_0x19b9('0x28')]);if(_0x4c01b6['name']){delete _0x4c01b6[_0x19b9('0x29')];}_0x5325b9[_0x19b9('0x18')](_0x397192)[_0x19b9('0x2a')](_0x4c01b6);};}exports[_0x19b9('0x2b')]=function(_0x4a904d,_0x8843f2){var _0x526b3f={},_0x368252={},_0x2c63ca={'count':0x0,'rows':[]};var _0x34c809=_[_0x19b9('0x2c')](db['MailSubstatus'][_0x19b9('0x2d')],function(_0x4b2191){return{'name':_0x4b2191[_0x19b9('0x2e')],'type':_0x4b2191[_0x19b9('0x2f')][_0x19b9('0x30')]};});_0x368252[_0x19b9('0x31')]=_['map'](_0x34c809,'name');_0x368252[_0x19b9('0x32')]=_[_0x19b9('0x33')](_0x4a904d[_0x19b9('0x32')]);_0x368252['filters']=_['intersection'](_0x368252[_0x19b9('0x31')],_0x368252[_0x19b9('0x32')]);_0x526b3f[_0x19b9('0x34')]=_[_0x19b9('0x35')](_0x368252[_0x19b9('0x31')],qs[_0x19b9('0x36')](_0x4a904d[_0x19b9('0x32')]['fields']));_0x526b3f[_0x19b9('0x34')]=_0x526b3f[_0x19b9('0x34')][_0x19b9('0x37')]?_0x526b3f[_0x19b9('0x34')]:_0x368252['model'];if(!_0x4a904d[_0x19b9('0x32')]['hasOwnProperty'](_0x19b9('0x38'))){_0x526b3f[_0x19b9('0x1d')]=qs[_0x19b9('0x1d')](_0x4a904d['query'][_0x19b9('0x1d')]);_0x526b3f[_0x19b9('0x1b')]=qs['offset'](_0x4a904d[_0x19b9('0x32')][_0x19b9('0x1b')]);}_0x526b3f['order']=qs[_0x19b9('0x39')](_0x4a904d[_0x19b9('0x32')][_0x19b9('0x39')]);_0x526b3f['where']=qs['filters'](_[_0x19b9('0x3a')](_0x4a904d['query'],_0x368252[_0x19b9('0x3b')]),_0x34c809);if(_0x4a904d[_0x19b9('0x32')][_0x19b9('0x3c')]){_0x526b3f[_0x19b9('0x3d')]=_[_0x19b9('0x3e')](_0x526b3f[_0x19b9('0x3d')],{'$or':_[_0x19b9('0x2c')](_0x34c809,function(_0x20bf71){if(_0x20bf71[_0x19b9('0x2f')]!==_0x19b9('0x3f')){var _0x481408={};_0x481408[_0x20bf71['name']]={'$like':'%'+_0x4a904d[_0x19b9('0x32')][_0x19b9('0x3c')]+'%'};return _0x481408;}})});}_0x526b3f=_['merge']({},_0x526b3f,_0x4a904d[_0x19b9('0x40')]);var _0x204784={'where':_0x526b3f[_0x19b9('0x3d')]};return db['MailSubstatus'][_0x19b9('0x1e')](_0x204784)[_0x19b9('0x25')](function(_0x4ac3e5){_0x2c63ca['count']=_0x4ac3e5;if(_0x4a904d['query'][_0x19b9('0x41')]){_0x526b3f[_0x19b9('0x42')]=[{'all':!![]}];}return db[_0x19b9('0x43')]['findAll'](_0x526b3f);})[_0x19b9('0x25')](function(_0x161804){_0x2c63ca[_0x19b9('0x44')]=_0x161804;return _0x2c63ca;})[_0x19b9('0x25')](respondWithFilteredResult(_0x8843f2,_0x526b3f))[_0x19b9('0x45')](handleError(_0x8843f2,null));};exports[_0x19b9('0x46')]=function(_0x5e6ab9,_0x16d2b0){var _0x466320={'raw':!![],'where':{'id':_0x5e6ab9[_0x19b9('0x47')]['id']}},_0x194e11={};_0x194e11[_0x19b9('0x31')]=_[_0x19b9('0x33')](db[_0x19b9('0x43')][_0x19b9('0x2d')]);_0x194e11[_0x19b9('0x32')]=_[_0x19b9('0x33')](_0x5e6ab9[_0x19b9('0x32')]);_0x194e11[_0x19b9('0x3b')]=_['intersection'](_0x194e11[_0x19b9('0x31')],_0x194e11[_0x19b9('0x32')]);_0x466320[_0x19b9('0x34')]=_[_0x19b9('0x35')](_0x194e11[_0x19b9('0x31')],qs[_0x19b9('0x36')](_0x5e6ab9[_0x19b9('0x32')][_0x19b9('0x36')]));_0x466320[_0x19b9('0x34')]=_0x466320[_0x19b9('0x34')][_0x19b9('0x37')]?_0x466320[_0x19b9('0x34')]:_0x194e11[_0x19b9('0x31')];if(_0x5e6ab9[_0x19b9('0x32')][_0x19b9('0x41')]){_0x466320[_0x19b9('0x42')]=[{'all':!![]}];}_0x466320=_[_0x19b9('0x3e')]({},_0x466320,_0x5e6ab9[_0x19b9('0x40')]);return db[_0x19b9('0x43')][_0x19b9('0x48')](_0x466320)[_0x19b9('0x25')](handleEntityNotFound(_0x16d2b0,null))[_0x19b9('0x25')](respondWithResult(_0x16d2b0,null))[_0x19b9('0x45')](handleError(_0x16d2b0,null));};exports['create']=function(_0x263b72,_0x390ceb){return db[_0x19b9('0x43')]['create'](_0x263b72['body'],{})[_0x19b9('0x25')](respondWithResult(_0x390ceb,0xc9))[_0x19b9('0x45')](handleError(_0x390ceb,null));};exports[_0x19b9('0x24')]=function(_0x21d24d,_0x21f51d){if(_0x21d24d[_0x19b9('0x49')]['id']){delete _0x21d24d[_0x19b9('0x49')]['id'];}return db['MailSubstatus'][_0x19b9('0x48')]({'where':{'id':_0x21d24d[_0x19b9('0x47')]['id']}})[_0x19b9('0x25')](handleEntityNotFound(_0x21f51d,null))[_0x19b9('0x25')](saveUpdates(_0x21d24d['body'],null))[_0x19b9('0x25')](respondWithResult(_0x21f51d,null))[_0x19b9('0x45')](handleError(_0x21f51d,null));};exports[_0x19b9('0x26')]=function(_0x115a8e,_0x5293b4){return db['MailSubstatus'][_0x19b9('0x48')]({'where':{'id':_0x115a8e[_0x19b9('0x47')]['id']}})[_0x19b9('0x25')](handleEntityNotFound(_0x5293b4,null))[_0x19b9('0x25')](removeEntity(_0x5293b4,null))[_0x19b9('0x45')](handleError(_0x5293b4,null));};exports['describe']=function(_0xf4e7d3,_0xbfeec0){return db[_0x19b9('0x43')]['describe']()[_0x19b9('0x25')](respondWithResult(_0xbfeec0,null))[_0x19b9('0x45')](handleError(_0xbfeec0,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index c1e3329..6860cda 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa08b=['hook','exports','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x5a70ea,_0x395ff7){var _0x3fa1eb=function(_0x52a5c5){while(--_0x52a5c5){_0x5a70ea['push'](_0x5a70ea['shift']());}};_0x3fa1eb(++_0x395ff7);}(_0xa08b,0x14c));var _0xba08=function(_0x33d68b,_0x521331){_0x33d68b=_0x33d68b-0x0;var _0x41ff94=_0xa08b[_0x33d68b];return _0x41ff94;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xba08('0x0')](0x0);var events={'afterUpdate':_0xba08('0x1')};function emitEvent(_0x35af4f){return function(_0x5b1b15,_0x136286,_0x3174ba){MailSubstatusEvents[_0xba08('0x2')](_0x35af4f+':'+_0x5b1b15['id'],_0x5b1b15);MailSubstatusEvents[_0xba08('0x2')](_0x35af4f,_0x5b1b15);_0x3174ba(null);};}for(var e in events){if(events[_0xba08('0x3')](e)){var event=events[e];MailSubstatus[_0xba08('0x4')](e,emitEvent(event));}}module[_0xba08('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0x4c8e=['hasOwnProperty','hook','events','MailSubstatus','setMaxListeners','emit'];(function(_0x5e9c85,_0x461674){var _0xcbdcf7=function(_0x2680d9){while(--_0x2680d9){_0x5e9c85['push'](_0x5e9c85['shift']());}};_0xcbdcf7(++_0x461674);}(_0x4c8e,0x140));var _0xe4c8=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x4c8e[_0x20e7e3];return _0x14b9de;};'use strict';var EventEmitter=require(_0xe4c8('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xe4c8('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe4c8('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x2d2a29){return function(_0x50ba67,_0x41049f,_0x59f3ab){MailSubstatusEvents[_0xe4c8('0x3')](_0x2d2a29+':'+_0x50ba67['id'],_0x50ba67);MailSubstatusEvents['emit'](_0x2d2a29,_0x50ba67);_0x59f3ab(null);};}for(var e in events){if(events[_0xe4c8('0x4')](e)){var event=events[e];MailSubstatus[_0xe4c8('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d3a4e36..00ed996 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 _0x57ae=['models','MailSubstatus','mail_substatuses','update','name','mailSubstatus','_previousDataValues','catch','./mailSubstatus.attributes'];(function(_0x1231ea,_0x7686d5){var _0x16be35=function(_0x55cf55){while(--_0x55cf55){_0x1231ea['push'](_0x1231ea['shift']());}};_0x16be35(++_0x7686d5);}(_0x57ae,0xa1));var _0xe57a=function(_0x328421,_0x5cbb0e){_0x328421=_0x328421-0x0;var _0x527972=_0x57ae[_0x328421];return _0x527972;};'use strict';var attributes=require(_0xe57a('0x0'));module['exports']=function(_0x2fc43c){var _0x290450=_0x2fc43c[_0xe57a('0x1')];return _0x2fc43c['define'](_0xe57a('0x2'),attributes,{'tableName':_0xe57a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x45a0bc,_0xf48de5,_0x43ef3b){return _0x290450['Condition'][_0xe57a('0x4')]({'value':_0x45a0bc[_0xe57a('0x5')]},{'where':{'field':_0xe57a('0x6'),'value':_0x45a0bc[_0xe57a('0x7')][_0xe57a('0x5')]}})['then'](function(){_0x43ef3b();})[_0xe57a('0x8')](function(_0x947889){_0x43ef3b(_0x947889);});}}});}; \ No newline at end of file +var _0xcdd9=['MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define'];(function(_0x796994,_0x4875af){var _0x34e23f=function(_0x580c91){while(--_0x580c91){_0x796994['push'](_0x796994['shift']());}};_0x34e23f(++_0x4875af);}(_0xcdd9,0x19c));var _0x9cdd=function(_0x10010f,_0x458f9b){_0x10010f=_0x10010f-0x0;var _0x49ced0=_0xcdd9[_0x10010f];return _0x49ced0;};'use strict';var attributes=require(_0x9cdd('0x0'));module[_0x9cdd('0x1')]=function(_0x2216dc){var _0xc7fc0d=_0x2216dc[_0x9cdd('0x2')];return _0x2216dc[_0x9cdd('0x3')](_0x9cdd('0x4'),attributes,{'tableName':_0x9cdd('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5bef4e,_0x523a6d,_0x4c9b18){return _0xc7fc0d[_0x9cdd('0x6')][_0x9cdd('0x7')]({'value':_0x5bef4e[_0x9cdd('0x8')]},{'where':{'field':_0x9cdd('0x9'),'value':_0x5bef4e[_0x9cdd('0xa')][_0x9cdd('0x8')]}})[_0x9cdd('0xb')](function(){_0x4c9b18();})[_0x9cdd('0xc')](function(_0x1ecdd3){_0x4c9b18(_0x1ecdd3);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 2018b31..8af87b6 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 _0x8c23=['../../config/environment','jayson/promise','client','http','then','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailSubstatus,\x20%s,\x20%s','message','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2826cf,_0x11d891){var _0x11e957=function(_0x160879){while(--_0x160879){_0x2826cf['push'](_0x2826cf['shift']());}};_0x11e957(++_0x11d891);}(_0x8c23,0x141));var _0x38c2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8c23[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x38c2('0x0'));var util=require(_0x38c2('0x1'));var moment=require(_0x38c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x38c2('0x3'));var fs=require('fs');var Redis=require(_0x38c2('0x4'));var db=require(_0x38c2('0x5'))['db'];var utils=require(_0x38c2('0x6'));var logger=require(_0x38c2('0x7'))(_0x38c2('0x8'));var config=require(_0x38c2('0x9'));var jayson=require(_0x38c2('0xa'));var client=jayson[_0x38c2('0xb')][_0x38c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x329d80,_0x53d9be,_0x311574){return new BPromise(function(_0x31d1f7,_0x15a006){return client['request'](_0x329d80,_0x311574)[_0x38c2('0xd')](function(_0x15ddfc){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x53d9be,'request\x20sent');logger[_0x38c2('0xe')](_0x38c2('0xf'),_0x53d9be,_0x38c2('0x10'),JSON[_0x38c2('0x11')](_0x15ddfc));if(_0x15ddfc[_0x38c2('0x12')]){if(_0x15ddfc[_0x38c2('0x12')]['code']===0x1f4){logger['error'](_0x38c2('0x13'),_0x53d9be,_0x15ddfc['error']['message']);return _0x15a006(_0x15ddfc['error'][_0x38c2('0x14')]);}logger[_0x38c2('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x53d9be,_0x15ddfc[_0x38c2('0x12')][_0x38c2('0x14')]);return _0x31d1f7(_0x15ddfc[_0x38c2('0x12')][_0x38c2('0x14')]);}else{logger[_0x38c2('0x15')](_0x38c2('0x13'),_0x53d9be,'request\x20sent');_0x31d1f7(_0x15ddfc['result']['message']);}})['catch'](function(_0x4709a3){logger['error'](_0x38c2('0x13'),_0x53d9be,_0x4709a3);_0x15a006(_0x4709a3);});});} \ No newline at end of file +var _0x4b6b=['result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4b6b,0x1b2));var _0xb4b6=function(_0x5ea905,_0x4c32ec){_0x5ea905=_0x5ea905-0x0;var _0x4a7b41=_0x4b6b[_0x5ea905];return _0x4a7b41;};'use strict';var _=require('lodash');var util=require(_0xb4b6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb4b6('0x1'));var fs=require('fs');var Redis=require(_0xb4b6('0x2'));var db=require(_0xb4b6('0x3'))['db'];var utils=require(_0xb4b6('0x4'));var logger=require('../../config/logger')(_0xb4b6('0x5'));var config=require('../../config/environment');var jayson=require(_0xb4b6('0x6'));var client=jayson[_0xb4b6('0x7')][_0xb4b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c5b7c,_0x3d562b,_0x48b0de){return new BPromise(function(_0x477cb8,_0x6aac6b){return client['request'](_0x4c5b7c,_0x48b0de)[_0xb4b6('0x9')](function(_0x268f40){logger['info'](_0xb4b6('0xa'),_0x3d562b,'request\x20sent');logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x3d562b,_0xb4b6('0xb'),JSON[_0xb4b6('0xc')](_0x268f40));if(_0x268f40['error']){if(_0x268f40[_0xb4b6('0xd')]['code']===0x1f4){logger[_0xb4b6('0xd')](_0xb4b6('0xa'),_0x3d562b,_0x268f40[_0xb4b6('0xd')][_0xb4b6('0xe')]);return _0x6aac6b(_0x268f40['error'][_0xb4b6('0xe')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x3d562b,_0x268f40[_0xb4b6('0xd')][_0xb4b6('0xe')]);return _0x477cb8(_0x268f40[_0xb4b6('0xd')][_0xb4b6('0xe')]);}else{logger[_0xb4b6('0xf')](_0xb4b6('0xa'),_0x3d562b,'request\x20sent');_0x477cb8(_0x268f40[_0xb4b6('0x10')][_0xb4b6('0xe')]);}})[_0xb4b6('0x11')](function(_0x479990){logger[_0xb4b6('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x3d562b,_0x479990);_0x6aac6b(_0x479990);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 65309b2..0111aad 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 _0x737a=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','delete','destroy','exports'];(function(_0x331015,_0x22ef37){var _0x40f12e=function(_0xa6390d){while(--_0xa6390d){_0x331015['push'](_0x331015['shift']());}};_0x40f12e(++_0x22ef37);}(_0x737a,0x1db));var _0xa737=function(_0x150580,_0x6c7cb6){_0x150580=_0x150580-0x0;var _0x18cbc6=_0x737a[_0x150580];return _0x18cbc6;};'use strict';var multer=require(_0xa737('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa737('0x1'));var express=require('express');var router=express[_0xa737('0x2')]();var fs_extra=require(_0xa737('0x3'));var auth=require(_0xa737('0x4'));var interaction=require(_0xa737('0x5'));var config=require('../../config/environment');var controller=require(_0xa737('0x6'));router[_0xa737('0x7')]('/',auth[_0xa737('0x8')](),controller[_0xa737('0x9')]);router[_0xa737('0x7')](_0xa737('0xa'),auth[_0xa737('0x8')](),controller[_0xa737('0xb')]);router[_0xa737('0x7')]('/:id',auth[_0xa737('0x8')](),controller[_0xa737('0xc')]);router[_0xa737('0xd')]('/',auth[_0xa737('0x8')](),controller[_0xa737('0xe')]);router['put'](_0xa737('0xf'),auth[_0xa737('0x8')](),controller['update']);router[_0xa737('0x10')](_0xa737('0xf'),auth[_0xa737('0x8')](),controller[_0xa737('0x11')]);module[_0xa737('0x12')]=router; \ No newline at end of file +var _0x459b=['connect-timeout','express','Router','fs-extra','isAuthenticated','get','/describe','describe','post','put','/:id','update','delete','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x459b,0x10d));var _0xb459=function(_0x96db86,_0x4cb91e){_0x96db86=_0x96db86-0x0;var _0x3b223b=_0x459b[_0x96db86];return _0x3b223b;};'use strict';var multer=require(_0xb459('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb459('0x1'));var express=require(_0xb459('0x2'));var router=express[_0xb459('0x3')]();var fs_extra=require(_0xb459('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0xb459('0x5')](),controller['index']);router[_0xb459('0x6')](_0xb459('0x7'),auth[_0xb459('0x5')](),controller[_0xb459('0x8')]);router['get']('/:id',auth[_0xb459('0x5')](),controller['show']);router[_0xb459('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb459('0xa')](_0xb459('0xb'),auth['isAuthenticated'](),controller[_0xb459('0xc')]);router[_0xb459('0xd')](_0xb459('0xb'),auth[_0xb459('0x5')](),controller['destroy']);module[_0xb459('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 0609c7b..b6bca32 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0x9bde,0xe1));var _0xe9bd=function(_0xfe8472,_0x37b19b){_0xfe8472=_0xfe8472-0x0;var _0x2b8460=_0x9bde[_0xfe8472];return _0x2b8460;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xb43b,0x1b2));var _0xbb43=function(_0x53c91b,_0xdd8a5){_0x53c91b=_0x53c91b-0x0;var _0x2ea89d=_0xb43b[_0x53c91b];return _0x2ea89d;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index eae3120..286b6ee 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 _0x2446=['error','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','includeAll','include','MailTransferReport','findAll','rows','catch','params','options','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus'];(function(_0x1953f5,_0x2bc2dd){var _0x101d23=function(_0x5877c3){while(--_0x5877c3){_0x1953f5['push'](_0x1953f5['shift']());}};_0x101d23(++_0x2bc2dd);}(_0x2446,0xbb));var _0x6244=function(_0x46be54,_0x274cf3){_0x46be54=_0x46be54-0x0;var _0x6ba1bc=_0x2446[_0x46be54];return _0x6ba1bc;};'use strict';var emlformat=require(_0x6244('0x0'));var rimraf=require(_0x6244('0x1'));var zipdir=require(_0x6244('0x2'));var jsonpatch=require(_0x6244('0x3'));var rp=require('request-promise');var moment=require(_0x6244('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6244('0x5'));var util=require('util');var path=require(_0x6244('0x6'));var sox=require('sox');var csv=require(_0x6244('0x7'));var ejs=require(_0x6244('0x8'));var fs=require('fs');var fs_extra=require(_0x6244('0x9'));var _=require(_0x6244('0xa'));var squel=require(_0x6244('0xb'));var crypto=require(_0x6244('0xc'));var jsforce=require(_0x6244('0xd'));var deskjs=require(_0x6244('0xe'));var toCsv=require(_0x6244('0x7'));var querystring=require(_0x6244('0xf'));var Papa=require('papaparse');var Redis=require(_0x6244('0x10'));var authService=require(_0x6244('0x11'));var qs=require(_0x6244('0x12'));var as=require(_0x6244('0x13'));var hardwareService=require(_0x6244('0x14'));var logger=require(_0x6244('0x15'))(_0x6244('0x16'));var utils=require(_0x6244('0x17'));var config=require(_0x6244('0x18'));var licenseUtil=require(_0x6244('0x19'));var db=require(_0x6244('0x1a'))['db'];function respondWithStatusCode(_0x4c8003,_0x593e2b){_0x593e2b=_0x593e2b||0xcc;return function(_0x545528){if(_0x545528){return _0x4c8003['sendStatus'](_0x593e2b);}return _0x4c8003[_0x6244('0x1b')](_0x593e2b)[_0x6244('0x1c')]();};}function respondWithResult(_0x53cf50,_0x34d0ad){_0x34d0ad=_0x34d0ad||0xc8;return function(_0x4bbf45){if(_0x4bbf45){return _0x53cf50[_0x6244('0x1b')](_0x34d0ad)[_0x6244('0x1d')](_0x4bbf45);}};}function respondWithFilteredResult(_0x4e7071,_0x1009e8){return function(_0x275a9a){if(_0x275a9a){var _0x29516c=typeof _0x1009e8[_0x6244('0x1e')]===_0x6244('0x1f')&&typeof _0x1009e8[_0x6244('0x20')]===_0x6244('0x1f');var _0x5058cd=_0x275a9a[_0x6244('0x21')];var _0x2d352e=_0x29516c?0x0:_0x1009e8[_0x6244('0x1e')];var _0x2d3af2=_0x29516c?_0x275a9a[_0x6244('0x21')]:_0x1009e8[_0x6244('0x1e')]+_0x1009e8[_0x6244('0x20')];var _0x4cacb6;if(_0x2d3af2>=_0x5058cd){_0x2d3af2=_0x5058cd;_0x4cacb6=0xc8;}else{_0x4cacb6=0xce;}_0x4e7071[_0x6244('0x1b')](_0x4cacb6);return _0x4e7071[_0x6244('0x22')](_0x6244('0x23'),_0x2d352e+'-'+_0x2d3af2+'/'+_0x5058cd)['json'](_0x275a9a);}return null;};}function patchUpdates(_0x26fe0b){return function(_0x2b68e0){try{jsonpatch['apply'](_0x2b68e0,_0x26fe0b,!![]);}catch(_0x193d04){return BPromise[_0x6244('0x24')](_0x193d04);}return _0x2b68e0[_0x6244('0x25')]();};}function saveUpdates(_0x7ba3cb,_0x3a7f1d){return function(_0x5e98f6){if(_0x5e98f6){return _0x5e98f6[_0x6244('0x26')](_0x7ba3cb)[_0x6244('0x27')](function(_0x12f236){return _0x12f236;});}return null;};}function removeEntity(_0x249cfe,_0x378240){return function(_0x344979){if(_0x344979){return _0x344979['destroy']()[_0x6244('0x27')](function(){_0x249cfe[_0x6244('0x1b')](0xcc)[_0x6244('0x1c')]();});}};}function handleEntityNotFound(_0x279dd0,_0x360d2f){return function(_0x5b2f1d){if(!_0x5b2f1d){_0x279dd0[_0x6244('0x28')](0x194);}return _0x5b2f1d;};}function handleError(_0x4e6625,_0x9fc57a){_0x9fc57a=_0x9fc57a||0x1f4;return function(_0x217aca){logger[_0x6244('0x29')](_0x217aca['stack']);if(_0x217aca[_0x6244('0x2a')]){delete _0x217aca[_0x6244('0x2a')];}_0x4e6625['status'](_0x9fc57a)[_0x6244('0x2b')](_0x217aca);};}exports['index']=function(_0x3c8051,_0x3c76ba){var _0x3d415e={},_0x5bcb7e={},_0x392dc6={'count':0x0,'rows':[]};var _0x3b5b3b=_[_0x6244('0x2c')](db['MailTransferReport'][_0x6244('0x2d')],function(_0x5a0840){return{'name':_0x5a0840[_0x6244('0x2e')],'type':_0x5a0840[_0x6244('0x2f')][_0x6244('0x30')]};});_0x5bcb7e['model']=_[_0x6244('0x2c')](_0x3b5b3b,_0x6244('0x2a'));_0x5bcb7e['query']=_[_0x6244('0x31')](_0x3c8051[_0x6244('0x32')]);_0x5bcb7e[_0x6244('0x33')]=_[_0x6244('0x34')](_0x5bcb7e[_0x6244('0x35')],_0x5bcb7e['query']);_0x3d415e[_0x6244('0x36')]=_[_0x6244('0x34')](_0x5bcb7e['model'],qs[_0x6244('0x37')](_0x3c8051[_0x6244('0x32')][_0x6244('0x37')]));_0x3d415e[_0x6244('0x36')]=_0x3d415e['attributes'][_0x6244('0x38')]?_0x3d415e[_0x6244('0x36')]:_0x5bcb7e[_0x6244('0x35')];if(!_0x3c8051[_0x6244('0x32')][_0x6244('0x39')]('nolimit')){_0x3d415e[_0x6244('0x20')]=qs['limit'](_0x3c8051['query'][_0x6244('0x20')]);_0x3d415e[_0x6244('0x1e')]=qs[_0x6244('0x1e')](_0x3c8051['query'][_0x6244('0x1e')]);}_0x3d415e[_0x6244('0x3a')]=qs[_0x6244('0x3b')](_0x3c8051[_0x6244('0x32')][_0x6244('0x3b')]);_0x3d415e[_0x6244('0x3c')]=qs['filters'](_['pick'](_0x3c8051[_0x6244('0x32')],_0x5bcb7e[_0x6244('0x33')]),_0x3b5b3b);if(_0x3c8051['query']['filter']){_0x3d415e[_0x6244('0x3c')]=_['merge'](_0x3d415e['where'],{'$or':_[_0x6244('0x2c')](_0x3b5b3b,function(_0x12b2e4){if(_0x12b2e4[_0x6244('0x2f')]!==_0x6244('0x3d')){var _0xd65158={};_0xd65158[_0x12b2e4[_0x6244('0x2a')]]={'$like':'%'+_0x3c8051[_0x6244('0x32')]['filter']+'%'};return _0xd65158;}})});}_0x3d415e=_[_0x6244('0x3e')]({},_0x3d415e,_0x3c8051['options']);var _0x1be98b={'where':_0x3d415e[_0x6244('0x3c')]};return db['MailTransferReport'][_0x6244('0x21')](_0x1be98b)[_0x6244('0x27')](function(_0x31b213){_0x392dc6[_0x6244('0x21')]=_0x31b213;if(_0x3c8051[_0x6244('0x32')][_0x6244('0x3f')]){_0x3d415e[_0x6244('0x40')]=[{'all':!![]}];}return db[_0x6244('0x41')][_0x6244('0x42')](_0x3d415e);})[_0x6244('0x27')](function(_0x279ceb){_0x392dc6[_0x6244('0x43')]=_0x279ceb;return _0x392dc6;})[_0x6244('0x27')](respondWithFilteredResult(_0x3c76ba,_0x3d415e))[_0x6244('0x44')](handleError(_0x3c76ba,null));};exports['show']=function(_0x165d5f,_0x330d5){var _0xf29dcc={'raw':!![],'where':{'id':_0x165d5f[_0x6244('0x45')]['id']}},_0x2673fd={};_0x2673fd['model']=_[_0x6244('0x31')](db[_0x6244('0x41')][_0x6244('0x2d')]);_0x2673fd[_0x6244('0x32')]=_[_0x6244('0x31')](_0x165d5f['query']);_0x2673fd[_0x6244('0x33')]=_[_0x6244('0x34')](_0x2673fd[_0x6244('0x35')],_0x2673fd['query']);_0xf29dcc[_0x6244('0x36')]=_[_0x6244('0x34')](_0x2673fd[_0x6244('0x35')],qs[_0x6244('0x37')](_0x165d5f[_0x6244('0x32')]['fields']));_0xf29dcc[_0x6244('0x36')]=_0xf29dcc[_0x6244('0x36')][_0x6244('0x38')]?_0xf29dcc[_0x6244('0x36')]:_0x2673fd[_0x6244('0x35')];if(_0x165d5f[_0x6244('0x32')]['includeAll']){_0xf29dcc['include']=[{'all':!![]}];}_0xf29dcc=_[_0x6244('0x3e')]({},_0xf29dcc,_0x165d5f[_0x6244('0x46')]);return db[_0x6244('0x41')]['find'](_0xf29dcc)[_0x6244('0x27')](handleEntityNotFound(_0x330d5,null))[_0x6244('0x27')](respondWithResult(_0x330d5,null))[_0x6244('0x44')](handleError(_0x330d5,null));};exports[_0x6244('0x47')]=function(_0x486a0d,_0x1f10de){return db[_0x6244('0x41')][_0x6244('0x47')](_0x486a0d['body'],{})[_0x6244('0x27')](respondWithResult(_0x1f10de,0xc9))['catch'](handleError(_0x1f10de,null));};exports[_0x6244('0x26')]=function(_0x271a1c,_0x2d988c){if(_0x271a1c[_0x6244('0x48')]['id']){delete _0x271a1c[_0x6244('0x48')]['id'];}return db['MailTransferReport'][_0x6244('0x49')]({'where':{'id':_0x271a1c['params']['id']}})['then'](handleEntityNotFound(_0x2d988c,null))[_0x6244('0x27')](saveUpdates(_0x271a1c['body'],null))[_0x6244('0x27')](respondWithResult(_0x2d988c,null))[_0x6244('0x44')](handleError(_0x2d988c,null));};exports[_0x6244('0x4a')]=function(_0x33db6e,_0x32b5da){return db['MailTransferReport'][_0x6244('0x49')]({'where':{'id':_0x33db6e[_0x6244('0x45')]['id']}})[_0x6244('0x27')](handleEntityNotFound(_0x32b5da,null))['then'](removeEntity(_0x32b5da,null))[_0x6244('0x44')](handleError(_0x32b5da,null));};exports[_0x6244('0x4b')]=function(_0x3421dd,_0x450c9b){return db['MailTransferReport'][_0x6244('0x4b')]()[_0x6244('0x27')](respondWithResult(_0x450c9b,null))[_0x6244('0x44')](handleError(_0x450c9b,null));}; \ No newline at end of file +var _0xe325=['reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','MailTransferReport','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply'];(function(_0x40b040,_0x47a284){var _0x2cffe1=function(_0x2207c1){while(--_0x2207c1){_0x40b040['push'](_0x40b040['shift']());}};_0x2cffe1(++_0x47a284);}(_0xe325,0x110));var _0x5e32=function(_0x211576,_0xcc41af){_0x211576=_0x211576-0x0;var _0x3ce235=_0xe325[_0x211576];return _0x3ce235;};'use strict';var emlformat=require(_0x5e32('0x0'));var rimraf=require(_0x5e32('0x1'));var zipdir=require(_0x5e32('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5e32('0x3'));var BPromise=require(_0x5e32('0x4'));var Mustache=require(_0x5e32('0x5'));var util=require(_0x5e32('0x6'));var path=require(_0x5e32('0x7'));var sox=require(_0x5e32('0x8'));var csv=require(_0x5e32('0x9'));var ejs=require(_0x5e32('0xa'));var fs=require('fs');var fs_extra=require(_0x5e32('0xb'));var _=require(_0x5e32('0xc'));var squel=require('squel');var crypto=require(_0x5e32('0xd'));var jsforce=require(_0x5e32('0xe'));var deskjs=require(_0x5e32('0xf'));var toCsv=require(_0x5e32('0x9'));var querystring=require('querystring');var Papa=require(_0x5e32('0x10'));var Redis=require(_0x5e32('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e32('0x12'));var as=require(_0x5e32('0x13'));var hardwareService=require(_0x5e32('0x14'));var logger=require(_0x5e32('0x15'))(_0x5e32('0x16'));var utils=require(_0x5e32('0x17'));var config=require(_0x5e32('0x18'));var licenseUtil=require(_0x5e32('0x19'));var db=require(_0x5e32('0x1a'))['db'];function respondWithStatusCode(_0x5b22dc,_0x1bb764){_0x1bb764=_0x1bb764||0xcc;return function(_0x3eea1f){if(_0x3eea1f){return _0x5b22dc[_0x5e32('0x1b')](_0x1bb764);}return _0x5b22dc[_0x5e32('0x1c')](_0x1bb764)['end']();};}function respondWithResult(_0x7de6f2,_0x14bd9d){_0x14bd9d=_0x14bd9d||0xc8;return function(_0xb355c9){if(_0xb355c9){return _0x7de6f2['status'](_0x14bd9d)[_0x5e32('0x1d')](_0xb355c9);}};}function respondWithFilteredResult(_0x5b4c46,_0x530607){return function(_0x593f70){if(_0x593f70){var _0x345276=typeof _0x530607[_0x5e32('0x1e')]===_0x5e32('0x1f')&&typeof _0x530607[_0x5e32('0x20')]===_0x5e32('0x1f');var _0x1da646=_0x593f70['count'];var _0x384c9a=_0x345276?0x0:_0x530607[_0x5e32('0x1e')];var _0x565b5e=_0x345276?_0x593f70[_0x5e32('0x21')]:_0x530607[_0x5e32('0x1e')]+_0x530607[_0x5e32('0x20')];var _0xd546e2;if(_0x565b5e>=_0x1da646){_0x565b5e=_0x1da646;_0xd546e2=0xc8;}else{_0xd546e2=0xce;}_0x5b4c46[_0x5e32('0x1c')](_0xd546e2);return _0x5b4c46[_0x5e32('0x22')]('Content-Range',_0x384c9a+'-'+_0x565b5e+'/'+_0x1da646)[_0x5e32('0x1d')](_0x593f70);}return null;};}function patchUpdates(_0x1bf7e8){return function(_0x568432){try{jsonpatch[_0x5e32('0x23')](_0x568432,_0x1bf7e8,!![]);}catch(_0x50c118){return BPromise[_0x5e32('0x24')](_0x50c118);}return _0x568432[_0x5e32('0x25')]();};}function saveUpdates(_0xc3f50e,_0x4e67cd){return function(_0x1187a7){if(_0x1187a7){return _0x1187a7[_0x5e32('0x26')](_0xc3f50e)[_0x5e32('0x27')](function(_0xeff5ee){return _0xeff5ee;});}return null;};}function removeEntity(_0x544896,_0x3ea565){return function(_0x5923a8){if(_0x5923a8){return _0x5923a8[_0x5e32('0x28')]()['then'](function(){_0x544896[_0x5e32('0x1c')](0xcc)[_0x5e32('0x29')]();});}};}function handleEntityNotFound(_0xafe68c,_0x45e49b){return function(_0x19f16c){if(!_0x19f16c){_0xafe68c[_0x5e32('0x1b')](0x194);}return _0x19f16c;};}function handleError(_0x23813d,_0x1890cb){_0x1890cb=_0x1890cb||0x1f4;return function(_0x5ae6cf){logger[_0x5e32('0x2a')](_0x5ae6cf[_0x5e32('0x2b')]);if(_0x5ae6cf['name']){delete _0x5ae6cf[_0x5e32('0x2c')];}_0x23813d[_0x5e32('0x1c')](_0x1890cb)['send'](_0x5ae6cf);};}exports[_0x5e32('0x2d')]=function(_0x3c03b2,_0x541399){var _0x1d7d01={},_0x522826={},_0x3f32ac={'count':0x0,'rows':[]};var _0x28e058=_[_0x5e32('0x2e')](db['MailTransferReport'][_0x5e32('0x2f')],function(_0x5880c6){return{'name':_0x5880c6[_0x5e32('0x30')],'type':_0x5880c6[_0x5e32('0x31')]['key']};});_0x522826[_0x5e32('0x32')]=_[_0x5e32('0x2e')](_0x28e058,'name');_0x522826[_0x5e32('0x33')]=_[_0x5e32('0x34')](_0x3c03b2['query']);_0x522826['filters']=_[_0x5e32('0x35')](_0x522826[_0x5e32('0x32')],_0x522826[_0x5e32('0x33')]);_0x1d7d01[_0x5e32('0x36')]=_[_0x5e32('0x35')](_0x522826['model'],qs[_0x5e32('0x37')](_0x3c03b2['query'][_0x5e32('0x37')]));_0x1d7d01[_0x5e32('0x36')]=_0x1d7d01[_0x5e32('0x36')][_0x5e32('0x38')]?_0x1d7d01[_0x5e32('0x36')]:_0x522826[_0x5e32('0x32')];if(!_0x3c03b2[_0x5e32('0x33')][_0x5e32('0x39')](_0x5e32('0x3a'))){_0x1d7d01[_0x5e32('0x20')]=qs[_0x5e32('0x20')](_0x3c03b2[_0x5e32('0x33')][_0x5e32('0x20')]);_0x1d7d01[_0x5e32('0x1e')]=qs[_0x5e32('0x1e')](_0x3c03b2[_0x5e32('0x33')][_0x5e32('0x1e')]);}_0x1d7d01[_0x5e32('0x3b')]=qs['sort'](_0x3c03b2[_0x5e32('0x33')][_0x5e32('0x3c')]);_0x1d7d01[_0x5e32('0x3d')]=qs[_0x5e32('0x3e')](_[_0x5e32('0x3f')](_0x3c03b2[_0x5e32('0x33')],_0x522826['filters']),_0x28e058);if(_0x3c03b2[_0x5e32('0x33')]['filter']){_0x1d7d01[_0x5e32('0x3d')]=_[_0x5e32('0x40')](_0x1d7d01[_0x5e32('0x3d')],{'$or':_[_0x5e32('0x2e')](_0x28e058,function(_0x238e12){if(_0x238e12['type']!==_0x5e32('0x41')){var _0x2d982f={};_0x2d982f[_0x238e12[_0x5e32('0x2c')]]={'$like':'%'+_0x3c03b2[_0x5e32('0x33')]['filter']+'%'};return _0x2d982f;}})});}_0x1d7d01=_['merge']({},_0x1d7d01,_0x3c03b2[_0x5e32('0x42')]);var _0x2d990c={'where':_0x1d7d01[_0x5e32('0x3d')]};return db[_0x5e32('0x43')][_0x5e32('0x21')](_0x2d990c)[_0x5e32('0x27')](function(_0xa9e9d3){_0x3f32ac['count']=_0xa9e9d3;if(_0x3c03b2['query'][_0x5e32('0x44')]){_0x1d7d01[_0x5e32('0x45')]=[{'all':!![]}];}return db[_0x5e32('0x43')]['findAll'](_0x1d7d01);})[_0x5e32('0x27')](function(_0xd731fb){_0x3f32ac[_0x5e32('0x46')]=_0xd731fb;return _0x3f32ac;})['then'](respondWithFilteredResult(_0x541399,_0x1d7d01))[_0x5e32('0x47')](handleError(_0x541399,null));};exports['show']=function(_0x43e6e3,_0x9708b8){var _0x2e7907={'raw':!![],'where':{'id':_0x43e6e3[_0x5e32('0x48')]['id']}},_0x42362e={};_0x42362e[_0x5e32('0x32')]=_['keys'](db[_0x5e32('0x43')]['rawAttributes']);_0x42362e[_0x5e32('0x33')]=_[_0x5e32('0x34')](_0x43e6e3[_0x5e32('0x33')]);_0x42362e[_0x5e32('0x3e')]=_[_0x5e32('0x35')](_0x42362e['model'],_0x42362e[_0x5e32('0x33')]);_0x2e7907[_0x5e32('0x36')]=_[_0x5e32('0x35')](_0x42362e[_0x5e32('0x32')],qs[_0x5e32('0x37')](_0x43e6e3[_0x5e32('0x33')][_0x5e32('0x37')]));_0x2e7907[_0x5e32('0x36')]=_0x2e7907[_0x5e32('0x36')][_0x5e32('0x38')]?_0x2e7907[_0x5e32('0x36')]:_0x42362e['model'];if(_0x43e6e3[_0x5e32('0x33')][_0x5e32('0x44')]){_0x2e7907[_0x5e32('0x45')]=[{'all':!![]}];}_0x2e7907=_[_0x5e32('0x40')]({},_0x2e7907,_0x43e6e3[_0x5e32('0x42')]);return db[_0x5e32('0x43')][_0x5e32('0x49')](_0x2e7907)[_0x5e32('0x27')](handleEntityNotFound(_0x9708b8,null))['then'](respondWithResult(_0x9708b8,null))['catch'](handleError(_0x9708b8,null));};exports[_0x5e32('0x4a')]=function(_0x35476a,_0x305a37){return db['MailTransferReport'][_0x5e32('0x4a')](_0x35476a[_0x5e32('0x4b')],{})[_0x5e32('0x27')](respondWithResult(_0x305a37,0xc9))[_0x5e32('0x47')](handleError(_0x305a37,null));};exports[_0x5e32('0x26')]=function(_0x5cf657,_0xfe4f6){if(_0x5cf657[_0x5e32('0x4b')]['id']){delete _0x5cf657[_0x5e32('0x4b')]['id'];}return db[_0x5e32('0x43')]['find']({'where':{'id':_0x5cf657[_0x5e32('0x48')]['id']}})[_0x5e32('0x27')](handleEntityNotFound(_0xfe4f6,null))[_0x5e32('0x27')](saveUpdates(_0x5cf657[_0x5e32('0x4b')],null))[_0x5e32('0x27')](respondWithResult(_0xfe4f6,null))[_0x5e32('0x47')](handleError(_0xfe4f6,null));};exports[_0x5e32('0x28')]=function(_0xb0de3c,_0x45fdea){return db[_0x5e32('0x43')][_0x5e32('0x49')]({'where':{'id':_0xb0de3c['params']['id']}})[_0x5e32('0x27')](handleEntityNotFound(_0x45fdea,null))[_0x5e32('0x27')](removeEntity(_0x45fdea,null))[_0x5e32('0x47')](handleError(_0x45fdea,null));};exports[_0x5e32('0x4c')]=function(_0x21fdca,_0x3cf4f1){return db[_0x5e32('0x43')][_0x5e32('0x4c')]()[_0x5e32('0x27')](respondWithResult(_0x3cf4f1,null))['catch'](handleError(_0x3cf4f1,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1b0f58e..6422c7a 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 _0xe011=['moment','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x532a08,_0x1079ab){var _0xd9c5ee=function(_0x1ce50c){while(--_0x1ce50c){_0x532a08['push'](_0x532a08['shift']());}};_0xd9c5ee(++_0x1079ab);}(_0xe011,0x14c));var _0x1e01=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0xe011[_0x558e45];return _0x3e9075;};'use strict';var _=require(_0x1e01('0x0'));var util=require(_0x1e01('0x1'));var logger=require(_0x1e01('0x2'))(_0x1e01('0x3'));var moment=require(_0x1e01('0x4'));var BPromise=require('bluebird');var rp=require(_0x1e01('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e01('0x6'));var config=require(_0x1e01('0x7'));var attributes=require(_0x1e01('0x8'));module[_0x1e01('0x9')]=function(_0x30be4b,_0x46114b){return _0x30be4b[_0x1e01('0xa')](_0x1e01('0xb'),attributes,{'tableName':_0x1e01('0xc'),'paranoid':![],'indexes':[{'name':_0x1e01('0xd'),'fields':[_0x1e01('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe0c3=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3e0c('0x0'));var util=require('util');var logger=require(_0x3e0c('0x1'))(_0x3e0c('0x2'));var moment=require(_0x3e0c('0x3'));var BPromise=require(_0x3e0c('0x4'));var rp=require(_0x3e0c('0x5'));var fs=require('fs');var path=require(_0x3e0c('0x6'));var rimraf=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var attributes=require(_0x3e0c('0x9'));module['exports']=function(_0x530ebf,_0x163adf){return _0x530ebf[_0x3e0c('0xa')](_0x3e0c('0xb'),attributes,{'tableName':_0x3e0c('0xc'),'paranoid':![],'indexes':[{'name':_0x3e0c('0xd'),'fields':[_0x3e0c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 16f981c..b7c323e 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 _0x3fb9=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x4144b5,_0x5144fc){var _0x28c9a8=function(_0x43c68d){while(--_0x43c68d){_0x4144b5['push'](_0x4144b5['shift']());}};_0x28c9a8(++_0x5144fc);}(_0x3fb9,0xb3));var _0x93fb=function(_0x25f182,_0x19131c){_0x25f182=_0x25f182-0x0;var _0x2c06b1=_0x3fb9[_0x25f182];return _0x2c06b1;};'use strict';var _=require(_0x93fb('0x0'));var util=require(_0x93fb('0x1'));var moment=require(_0x93fb('0x2'));var BPromise=require(_0x93fb('0x3'));var rs=require(_0x93fb('0x4'));var fs=require('fs');var Redis=require(_0x93fb('0x5'));var db=require(_0x93fb('0x6'))['db'];var utils=require(_0x93fb('0x7'));var logger=require(_0x93fb('0x8'))('rpc');var config=require(_0x93fb('0x9'));var jayson=require(_0x93fb('0xa'));var client=jayson['client'][_0x93fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e14c7,_0x109977,_0x7905b3){return new BPromise(function(_0x7a37fd,_0x436a4c){return client[_0x93fb('0xc')](_0x4e14c7,_0x7905b3)[_0x93fb('0xd')](function(_0x2c9f25){logger['info'](_0x93fb('0xe'),_0x109977,_0x93fb('0xf'));logger[_0x93fb('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x109977,'request\x20sent',JSON['stringify'](_0x2c9f25));if(_0x2c9f25['error']){if(_0x2c9f25[_0x93fb('0x11')][_0x93fb('0x12')]===0x1f4){logger[_0x93fb('0x11')](_0x93fb('0xe'),_0x109977,_0x2c9f25[_0x93fb('0x11')][_0x93fb('0x13')]);return _0x436a4c(_0x2c9f25[_0x93fb('0x11')][_0x93fb('0x13')]);}logger[_0x93fb('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x109977,_0x2c9f25[_0x93fb('0x11')][_0x93fb('0x13')]);return _0x7a37fd(_0x2c9f25[_0x93fb('0x11')][_0x93fb('0x13')]);}else{logger[_0x93fb('0x14')](_0x93fb('0xe'),_0x109977,_0x93fb('0xf'));_0x7a37fd(_0x2c9f25[_0x93fb('0x15')][_0x93fb('0x13')]);}})['catch'](function(_0x4c6365){logger[_0x93fb('0x11')](_0x93fb('0xe'),_0x109977,_0x4c6365);_0x436a4c(_0x4c6365);});});} \ No newline at end of file +var _0x0c5e=['error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0c5e,0x1be));var _0xe0c5=function(_0x2ab350,_0x32859f){_0x2ab350=_0x2ab350-0x0;var _0x4acac=_0x0c5e[_0x2ab350];return _0x4acac;};'use strict';var _=require(_0xe0c5('0x0'));var util=require(_0xe0c5('0x1'));var moment=require('moment');var BPromise=require(_0xe0c5('0x2'));var rs=require(_0xe0c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0c5('0x4'))['db'];var utils=require(_0xe0c5('0x5'));var logger=require(_0xe0c5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe0c5('0x7'));var client=jayson['client'][_0xe0c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2270b3,_0x261e49,_0x19aa86){return new BPromise(function(_0x363cb4,_0x4bd34f){return client[_0xe0c5('0x9')](_0x2270b3,_0x19aa86)['then'](function(_0x989915){logger['info'](_0xe0c5('0xa'),_0x261e49,_0xe0c5('0xb'));logger[_0xe0c5('0xc')](_0xe0c5('0xd'),_0x261e49,'request\x20sent',JSON['stringify'](_0x989915));if(_0x989915[_0xe0c5('0xe')]){if(_0x989915['error'][_0xe0c5('0xf')]===0x1f4){logger['error'](_0xe0c5('0xa'),_0x261e49,_0x989915[_0xe0c5('0xe')]['message']);return _0x4bd34f(_0x989915['error'][_0xe0c5('0x10')]);}logger[_0xe0c5('0xe')](_0xe0c5('0xa'),_0x261e49,_0x989915['error'][_0xe0c5('0x10')]);return _0x363cb4(_0x989915[_0xe0c5('0xe')][_0xe0c5('0x10')]);}else{logger[_0xe0c5('0x11')](_0xe0c5('0xa'),_0x261e49,'request\x20sent');_0x363cb4(_0x989915[_0xe0c5('0x12')][_0xe0c5('0x10')]);}})[_0xe0c5('0x13')](function(_0x18df57){logger[_0xe0c5('0xe')](_0xe0c5('0xa'),_0x261e49,_0x18df57);_0x4bd34f(_0x18df57);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 91f6d2d..25b6b8a 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 _0xbffa=['../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xbffa,0x79));var _0xabff=function(_0x1988f4,_0x4aad14){_0x1988f4=_0x1988f4-0x0;var _0x5d5a75=_0xbffa[_0x1988f4];return _0x5d5a75;};'use strict';var multer=require('multer');var util=require(_0xabff('0x0'));var path=require('path');var timeout=require(_0xabff('0x1'));var express=require(_0xabff('0x2'));var router=express['Router']();var fs_extra=require(_0xabff('0x3'));var auth=require(_0xabff('0x4'));var interaction=require(_0xabff('0x5'));var config=require(_0xabff('0x6'));var controller=require(_0xabff('0x7'));router[_0xabff('0x8')]('/',auth[_0xabff('0x9')](),controller[_0xabff('0xa')]);router[_0xabff('0x8')](_0xabff('0xb'),auth[_0xabff('0x9')](),controller[_0xabff('0xc')]);router[_0xabff('0x8')](_0xabff('0xd'),auth[_0xabff('0x9')](),controller[_0xabff('0xe')]);router[_0xabff('0xf')]('/',auth['isAuthenticated'](),controller[_0xabff('0x10')]);router[_0xabff('0x11')](_0xabff('0xd'),auth[_0xabff('0x9')](),controller['update']);router[_0xabff('0x12')](_0xabff('0xd'),auth[_0xabff('0x9')](),controller[_0xabff('0x13')]);module[_0xabff('0x14')]=router; \ No newline at end of file +var _0xe969=['./memberReport.controller','isAuthenticated','get','describe','/:id','show','post','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe969,0x1d6));var _0x9e96=function(_0x3c6516,_0x1a0763){_0x3c6516=_0x3c6516-0x0;var _0x35da56=_0xe969[_0x3c6516];return _0x35da56;};'use strict';var multer=require(_0x9e96('0x0'));var util=require('util');var path=require(_0x9e96('0x1'));var timeout=require('connect-timeout');var express=require(_0x9e96('0x2'));var router=express[_0x9e96('0x3')]();var fs_extra=require(_0x9e96('0x4'));var auth=require(_0x9e96('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e96('0x6'));router['get']('/',auth[_0x9e96('0x7')](),controller['index']);router[_0x9e96('0x8')]('/describe',auth[_0x9e96('0x7')](),controller[_0x9e96('0x9')]);router['get'](_0x9e96('0xa'),auth[_0x9e96('0x7')](),controller[_0x9e96('0xb')]);router[_0x9e96('0xc')]('/',auth[_0x9e96('0x7')](),controller['create']);router[_0x9e96('0xd')](_0x9e96('0xa'),auth[_0x9e96('0x7')](),controller[_0x9e96('0xe')]);router[_0x9e96('0xf')](_0x9e96('0xa'),auth[_0x9e96('0x7')](),controller['destroy']);module[_0x9e96('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a3321b9..c06154b 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 _0xb544=['DATE','getDataValue','diff','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x404eb5,_0x24325d){var _0x309463=function(_0x3ebf0b){while(--_0x3ebf0b){_0x404eb5['push'](_0x404eb5['shift']());}};_0x309463(++_0x24325d);}(_0xb544,0x171));var _0x4b54=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xb544[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x4b54('0x0'));var moment=require(_0x4b54('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4b54('0x2')]},'interface':{'type':Sequelize[_0x4b54('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x4b54('0x3'),'comment':_0x4b54('0x4')},'duration':{'type':Sequelize[_0x4b54('0x5')]},'enterAt':{'type':Sequelize[_0x4b54('0x6')]},'exitAt':{'type':Sequelize[_0x4b54('0x6')],'set':function(_0x7f6ecc){var _0x5452ea=moment(_0x7f6ecc);var _0x3d9b2c=moment(this[_0x4b54('0x7')]('enterAt'));var _0x393713=_0x5452ea[_0x4b54('0x8')](_0x3d9b2c,'seconds');this['setDataValue'](_0x4b54('0x9'),_0x7f6ecc);this['setDataValue'](_0x4b54('0xa'),_0x393713>=0x0?_0x393713:null);}},'data1':{'type':Sequelize[_0x4b54('0x2')],'comment':_0x4b54('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x4b54('0xc')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x4b54('0x2')],'comment':_0x4b54('0xd')},'data5':{'type':Sequelize[_0x4b54('0x2')],'comment':_0x4b54('0xe')},'role':{'type':Sequelize[_0x4b54('0x2')]},'internal':{'type':Sequelize[_0x4b54('0x5')]},'uniqueid':{'type':Sequelize[_0x4b54('0x2')]}}; \ No newline at end of file +var _0x7665=['sequelize','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x7665,0xd0));var _0x5766=function(_0x2036ee,_0x394b72){_0x2036ee=_0x2036ee-0x0;var _0x537743=_0x7665[_0x2036ee];return _0x537743;};'use strict';var Sequelize=require(_0x5766('0x0'));var moment=require('moment');module[_0x5766('0x1')]={'channel':{'type':Sequelize[_0x5766('0x2')]},'membername':{'type':Sequelize[_0x5766('0x2')]},'interface':{'type':Sequelize[_0x5766('0x2')]},'type':{'type':Sequelize[_0x5766('0x2')],'defaultValue':_0x5766('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x5766('0x4')]},'enterAt':{'type':Sequelize[_0x5766('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x19ef34){var _0x1f94b7=moment(_0x19ef34);var _0x24db71=moment(this[_0x5766('0x6')](_0x5766('0x7')));var _0x6dec16=_0x1f94b7['diff'](_0x24db71,_0x5766('0x8'));this[_0x5766('0x9')](_0x5766('0xa'),_0x19ef34);this[_0x5766('0x9')](_0x5766('0xb'),_0x6dec16>=0x0?_0x6dec16:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x5766('0xc')},'data2':{'type':Sequelize[_0x5766('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x5766('0xd')},'data4':{'type':Sequelize[_0x5766('0x2')],'comment':_0x5766('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x5766('0xf')},'role':{'type':Sequelize[_0x5766('0x2')]},'internal':{'type':Sequelize[_0x5766('0x4')]},'uniqueid':{'type':Sequelize[_0x5766('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 41c018f..b04d61e 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x160ce2,_0x3801ae){var _0x568bc4=function(_0xfee4b2){while(--_0xfee4b2){_0x160ce2['push'](_0x160ce2['shift']());}};_0x568bc4(++_0x3801ae);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x2feb01,_0x366704){var _0x259392=function(_0x247a6a){while(--_0x247a6a){_0x2feb01['push'](_0x2feb01['shift']());}};_0x259392(++_0x366704);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 549606a..9a4aeb3 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 _0x27ea=['define','report_member','membername','interface','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x27ea,0xc7));var _0xa27e=function(_0x5e65f2,_0x396da2){_0x5e65f2=_0x5e65f2-0x0;var _0x3c7202=_0x27ea[_0x5e65f2];return _0x3c7202;};'use strict';var _=require(_0xa27e('0x0'));var util=require('util');var logger=require(_0xa27e('0x1'))(_0xa27e('0x2'));var moment=require('moment');var BPromise=require(_0xa27e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa27e('0x4'));var rimraf=require(_0xa27e('0x5'));var config=require(_0xa27e('0x6'));var attributes=require(_0xa27e('0x7'));module[_0xa27e('0x8')]=function(_0x40d37b,_0x3560f9){return _0x40d37b[_0xa27e('0x9')]('MemberReport',attributes,{'tableName':_0xa27e('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xa27e('0xb'),_0xa27e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3714=['path','rimraf','../../config/environment','exports','define','report_member','membername_interface','membername','interface','lodash','util','api','moment','bluebird'];(function(_0x40d078,_0x210a77){var _0x46fc81=function(_0x3673da){while(--_0x3673da){_0x40d078['push'](_0x40d078['shift']());}};_0x46fc81(++_0x210a77);}(_0x3714,0x95));var _0x4371=function(_0x572ddd,_0x415804){_0x572ddd=_0x572ddd-0x0;var _0x1bae27=_0x3714[_0x572ddd];return _0x1bae27;};'use strict';var _=require(_0x4371('0x0'));var util=require(_0x4371('0x1'));var logger=require('../../config/logger')(_0x4371('0x2'));var moment=require(_0x4371('0x3'));var BPromise=require(_0x4371('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4371('0x5'));var rimraf=require(_0x4371('0x6'));var config=require(_0x4371('0x7'));var attributes=require('./memberReport.attributes');module[_0x4371('0x8')]=function(_0x5650a7,_0x349031){return _0x5650a7[_0x4371('0x9')]('MemberReport',attributes,{'tableName':_0x4371('0xa'),'paranoid':![],'indexes':[{'name':_0x4371('0xb'),'fields':[_0x4371('0xc'),_0x4371('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index f243b54..879ac85 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 _0x46e1=['where','include','model','attributes','map','CreateMemberReport','MemberReport','then','stringify','update','body','limit','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','findAll','options','raw'];(function(_0x2bf680,_0x4cdf22){var _0x49ff94=function(_0x13d27f){while(--_0x13d27f){_0x2bf680['push'](_0x2bf680['shift']());}};_0x49ff94(++_0x4cdf22);}(_0x46e1,0x155));var _0x146e=function(_0xf6766d,_0x42a470){_0xf6766d=_0xf6766d-0x0;var _0xf26f94=_0x46e1[_0xf6766d];return _0xf26f94;};'use strict';var _=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var moment=require(_0x146e('0x2'));var BPromise=require(_0x146e('0x3'));var rs=require(_0x146e('0x4'));var fs=require('fs');var Redis=require(_0x146e('0x5'));var db=require(_0x146e('0x6'))['db'];var utils=require(_0x146e('0x7'));var logger=require(_0x146e('0x8'))(_0x146e('0x9'));var config=require('../../config/environment');var jayson=require(_0x146e('0xa'));var client=jayson[_0x146e('0xb')][_0x146e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x228fe7,_0x70ce4,_0x35e40e){return new BPromise(function(_0x1c1398,_0x5f33c0){return client[_0x146e('0xd')](_0x228fe7,_0x35e40e)['then'](function(_0x36f843){logger[_0x146e('0xe')](_0x146e('0xf'),_0x70ce4,_0x146e('0x10'));logger[_0x146e('0x11')](_0x146e('0x12'),_0x70ce4,'request\x20sent',JSON['stringify'](_0x36f843));if(_0x36f843[_0x146e('0x13')]){if(_0x36f843[_0x146e('0x13')][_0x146e('0x14')]===0x1f4){logger[_0x146e('0x13')](_0x146e('0xf'),_0x70ce4,_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);return _0x5f33c0(_0x36f843[_0x146e('0x13')]['message']);}logger['error'](_0x146e('0xf'),_0x70ce4,_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);return _0x1c1398(_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);}else{logger[_0x146e('0xe')](_0x146e('0xf'),_0x70ce4,_0x146e('0x10'));_0x1c1398(_0x36f843[_0x146e('0x16')][_0x146e('0x15')]);}})[_0x146e('0x17')](function(_0x55fddc){logger[_0x146e('0x13')](_0x146e('0xf'),_0x70ce4,_0x55fddc);_0x5f33c0(_0x55fddc);});});}exports[_0x146e('0x18')]=function(_0x88e062){var _0x2286f6=this;return new Promise(function(_0x431a60,_0x256db5){return db['MemberReport'][_0x146e('0x19')]({'raw':_0x88e062['options']?_0x88e062[_0x146e('0x1a')][_0x146e('0x1b')]===undefined?!![]:![]:!![],'where':_0x88e062[_0x146e('0x1a')]?_0x88e062['options'][_0x146e('0x1c')]||null:null,'attributes':_0x88e062['options']?_0x88e062[_0x146e('0x1a')]['attributes']||null:null,'limit':_0x88e062[_0x146e('0x1a')]?_0x88e062[_0x146e('0x1a')]['limit']||null:null,'include':_0x88e062['options']?_0x88e062['options']['include']?_['map'](_0x88e062['options'][_0x146e('0x1d')],function(_0x504016){return{'model':db[_0x504016[_0x146e('0x1e')]],'as':_0x504016['as'],'attributes':_0x504016[_0x146e('0x1f')],'include':_0x504016[_0x146e('0x1d')]?_[_0x146e('0x20')](_0x504016[_0x146e('0x1d')],function(_0xed7b99){return{'model':db[_0xed7b99[_0x146e('0x1e')]],'as':_0xed7b99['as'],'attributes':_0xed7b99['attributes'],'include':_0xed7b99[_0x146e('0x1d')]?_['map'](_0xed7b99[_0x146e('0x1d')],function(_0x4afb82){return{'model':db[_0x4afb82['model']],'as':_0x4afb82['as'],'attributes':_0x4afb82[_0x146e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x402faf){logger[_0x146e('0xe')](_0x146e('0x18'),_0x88e062);logger[_0x146e('0x11')](_0x146e('0x18'),_0x88e062,JSON['stringify'](_0x402faf));_0x431a60(_0x402faf);})[_0x146e('0x17')](function(_0x46cf9a){logger[_0x146e('0x13')](_0x146e('0x18'),_0x46cf9a[_0x146e('0x15')],_0x88e062);_0x256db5(_0x2286f6[_0x146e('0x13')](0x1f4,_0x46cf9a[_0x146e('0x15')]));});});};exports[_0x146e('0x21')]=function(_0x502324){var _0x500120=this;return new Promise(function(_0x37c5d8,_0x5f0c5c){return db[_0x146e('0x22')]['create'](_0x502324['body'],{'raw':_0x502324[_0x146e('0x1a')]?_0x502324[_0x146e('0x1a')][_0x146e('0x1b')]===undefined?!![]:![]:!![]})[_0x146e('0x23')](function(_0x1d4b9f){logger[_0x146e('0xe')]('CreateMemberReport',_0x502324);logger[_0x146e('0x11')]('CreateMemberReport',_0x502324,JSON[_0x146e('0x24')](_0x1d4b9f));_0x37c5d8(_0x1d4b9f);})['catch'](function(_0x14b5c2){logger[_0x146e('0x13')](_0x146e('0x21'),_0x14b5c2['message'],_0x502324);_0x5f0c5c(_0x500120[_0x146e('0x13')](0x1f4,_0x14b5c2[_0x146e('0x15')]));});});};exports['UpdateMemberReport']=function(_0x781123){var _0x3271e1=this;return new Promise(function(_0x2f438d,_0x10e007){return db[_0x146e('0x22')][_0x146e('0x25')](_0x781123[_0x146e('0x26')],{'raw':_0x781123['options']?_0x781123['options'][_0x146e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x781123[_0x146e('0x1a')]?_0x781123[_0x146e('0x1a')][_0x146e('0x1c')]||null:null,'attributes':_0x781123[_0x146e('0x1a')]?_0x781123[_0x146e('0x1a')]['attributes']||null:null,'limit':_0x781123[_0x146e('0x1a')]?_0x781123['options'][_0x146e('0x27')]||null:null})[_0x146e('0x23')](function(_0x14fd1a){logger[_0x146e('0xe')](_0x146e('0x28'),_0x781123);logger[_0x146e('0x11')]('UpdateMemberReport',_0x781123,JSON['stringify'](_0x14fd1a));_0x2f438d(_0x14fd1a);})['catch'](function(_0x574daf){logger[_0x146e('0x13')](_0x146e('0x28'),_0x574daf[_0x146e('0x15')],_0x781123);_0x10e007(_0x3271e1[_0x146e('0x13')](0x1f4,_0x574daf[_0x146e('0x15')]));});});}; \ No newline at end of file +var _0x002d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','info','CreateMemberReport','create','body','update','UpdateMemberReport','lodash','util','moment'];(function(_0xcf2293,_0x217776){var _0x12c606=function(_0x57af26){while(--_0x57af26){_0xcf2293['push'](_0xcf2293['shift']());}};_0x12c606(++_0x217776);}(_0x002d,0xca));var _0xd002=function(_0x2fb3cb,_0x22e8dc){_0x2fb3cb=_0x2fb3cb-0x0;var _0x3ba725=_0x002d[_0x2fb3cb];return _0x3ba725;};'use strict';var _=require(_0xd002('0x0'));var util=require(_0xd002('0x1'));var moment=require(_0xd002('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd002('0x3'));var db=require(_0xd002('0x4'))['db'];var utils=require(_0xd002('0x5'));var logger=require(_0xd002('0x6'))(_0xd002('0x7'));var config=require(_0xd002('0x8'));var jayson=require(_0xd002('0x9'));var client=jayson[_0xd002('0xa')][_0xd002('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3711b0,_0x24766e,_0x45d45f){return new BPromise(function(_0x18df0a,_0x166980){return client[_0xd002('0xc')](_0x3711b0,_0x45d45f)[_0xd002('0xd')](function(_0x3bc57b){logger['info']('MemberReport,\x20%s,\x20%s',_0x24766e,_0xd002('0xe'));logger[_0xd002('0xf')](_0xd002('0x10'),_0x24766e,'request\x20sent',JSON[_0xd002('0x11')](_0x3bc57b));if(_0x3bc57b[_0xd002('0x12')]){if(_0x3bc57b[_0xd002('0x12')][_0xd002('0x13')]===0x1f4){logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);return _0x166980(_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);}logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x3bc57b[_0xd002('0x12')][_0xd002('0x15')]);return _0x18df0a(_0x3bc57b['error']['message']);}else{logger['info'](_0xd002('0x14'),_0x24766e,'request\x20sent');_0x18df0a(_0x3bc57b[_0xd002('0x16')][_0xd002('0x15')]);}})[_0xd002('0x17')](function(_0x282c43){logger[_0xd002('0x12')](_0xd002('0x14'),_0x24766e,_0x282c43);_0x166980(_0x282c43);});});}exports[_0xd002('0x18')]=function(_0x5e1f31){var _0x83090d=this;return new Promise(function(_0x4708f6,_0x3d1a5f){return db[_0xd002('0x19')][_0xd002('0x1a')]({'raw':_0x5e1f31['options']?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1d')]||null:null,'attributes':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31['options']['attributes']||null:null,'limit':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1e')]||null:null,'include':_0x5e1f31[_0xd002('0x1b')]?_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1f')]?_[_0xd002('0x20')](_0x5e1f31[_0xd002('0x1b')][_0xd002('0x1f')],function(_0x15ccfb){return{'model':db[_0x15ccfb[_0xd002('0x21')]],'as':_0x15ccfb['as'],'attributes':_0x15ccfb[_0xd002('0x22')],'include':_0x15ccfb['include']?_[_0xd002('0x20')](_0x15ccfb[_0xd002('0x1f')],function(_0x55e3be){return{'model':db[_0x55e3be[_0xd002('0x21')]],'as':_0x55e3be['as'],'attributes':_0x55e3be[_0xd002('0x22')],'include':_0x55e3be[_0xd002('0x1f')]?_['map'](_0x55e3be[_0xd002('0x1f')],function(_0x4f58fa){return{'model':db[_0x4f58fa['model']],'as':_0x4f58fa['as'],'attributes':_0x4f58fa['attributes']};}):[]};}):[]};}):[]:[]})[_0xd002('0xd')](function(_0x45745c){logger[_0xd002('0x23')](_0xd002('0x18'),_0x5e1f31);logger[_0xd002('0xf')](_0xd002('0x18'),_0x5e1f31,JSON[_0xd002('0x11')](_0x45745c));_0x4708f6(_0x45745c);})[_0xd002('0x17')](function(_0x9999ea){logger[_0xd002('0x12')]('GetMemberReport',_0x9999ea[_0xd002('0x15')],_0x5e1f31);_0x3d1a5f(_0x83090d[_0xd002('0x12')](0x1f4,_0x9999ea[_0xd002('0x15')]));});});};exports[_0xd002('0x24')]=function(_0x4d863e){var _0x2445bb=this;return new Promise(function(_0x568d90,_0x41ebcc){return db['MemberReport'][_0xd002('0x25')](_0x4d863e[_0xd002('0x26')],{'raw':_0x4d863e[_0xd002('0x1b')]?_0x4d863e[_0xd002('0x1b')][_0xd002('0x1c')]===undefined?!![]:![]:!![]})[_0xd002('0xd')](function(_0x160d12){logger[_0xd002('0x23')]('CreateMemberReport',_0x4d863e);logger[_0xd002('0xf')](_0xd002('0x24'),_0x4d863e,JSON[_0xd002('0x11')](_0x160d12));_0x568d90(_0x160d12);})[_0xd002('0x17')](function(_0xfb27b4){logger[_0xd002('0x12')]('CreateMemberReport',_0xfb27b4['message'],_0x4d863e);_0x41ebcc(_0x2445bb['error'](0x1f4,_0xfb27b4[_0xd002('0x15')]));});});};exports['UpdateMemberReport']=function(_0x66504){var _0x115090=this;return new Promise(function(_0x2a85c0,_0x1c324e){return db[_0xd002('0x19')][_0xd002('0x27')](_0x66504[_0xd002('0x26')],{'raw':_0x66504[_0xd002('0x1b')]?_0x66504['options'][_0xd002('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66504[_0xd002('0x1b')]?_0x66504['options']['where']||null:null,'attributes':_0x66504[_0xd002('0x1b')]?_0x66504[_0xd002('0x1b')][_0xd002('0x22')]||null:null,'limit':_0x66504[_0xd002('0x1b')]?_0x66504['options'][_0xd002('0x1e')]||null:null})['then'](function(_0x16d23d){logger[_0xd002('0x23')](_0xd002('0x28'),_0x66504);logger[_0xd002('0xf')](_0xd002('0x28'),_0x66504,JSON['stringify'](_0x16d23d));_0x2a85c0(_0x16d23d);})[_0xd002('0x17')](function(_0x7a9e84){logger[_0xd002('0x12')](_0xd002('0x28'),_0x7a9e84[_0xd002('0x15')],_0x66504);_0x1c324e(_0x115090[_0xd002('0x12')](0x1f4,_0x7a9e84[_0xd002('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index fbc0a69..e060390 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 _0xf577=['./migration.controller','index','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x58c654,_0x56f774){var _0x1b1164=function(_0x4ed7db){while(--_0x4ed7db){_0x58c654['push'](_0x58c654['shift']());}};_0x1b1164(++_0x56f774);}(_0xf577,0x8f));var _0x7f57=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xf577[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0x7f57('0x0'));var util=require('util');var path=require(_0x7f57('0x1'));var timeout=require(_0x7f57('0x2'));var express=require('express');var router=express[_0x7f57('0x3')]();var fs_extra=require(_0x7f57('0x4'));var auth=require(_0x7f57('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f57('0x6'));var controller=require(_0x7f57('0x7'));router['get']('/',controller[_0x7f57('0x8')]);module[_0x7f57('0x9')]=router; \ No newline at end of file +var _0xea2f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','./migration.controller','get','index','exports','multer'];(function(_0x30b3a6,_0x39f616){var _0x3b23be=function(_0x27b872){while(--_0x27b872){_0x30b3a6['push'](_0x30b3a6['shift']());}};_0x3b23be(++_0x39f616);}(_0xea2f,0x6d));var _0xfea2=function(_0x2a3890,_0x4c556d){_0x2a3890=_0x2a3890-0x0;var _0x2be2a7=_0xea2f[_0x2a3890];return _0x2be2a7;};'use strict';var multer=require(_0xfea2('0x0'));var util=require('util');var path=require(_0xfea2('0x1'));var timeout=require(_0xfea2('0x2'));var express=require('express');var router=express[_0xfea2('0x3')]();var fs_extra=require(_0xfea2('0x4'));var auth=require(_0xfea2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfea2('0x6'));router[_0xfea2('0x7')]('/',controller[_0xfea2('0x8')]);module[_0xfea2('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 51059c7..13faac4 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 _0xfa07=['sequelize','exports','version'];(function(_0x589f05,_0x1c5a16){var _0x3a11b4=function(_0x1ec7fb){while(--_0x1ec7fb){_0x589f05['push'](_0x589f05['shift']());}};_0x3a11b4(++_0x1c5a16);}(_0xfa07,0x17d));var _0x7fa0=function(_0x1b9f44,_0x389651){_0x1b9f44=_0x1b9f44-0x0;var _0x431217=_0xfa07[_0x1b9f44];return _0x431217;};'use strict';var Sequelize=require(_0x7fa0('0x0'));module[_0x7fa0('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x7fa0('0x2')}}; \ No newline at end of file +var _0x5b7a=['sequelize','version'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x5b7a,0x8c));var _0xa5b7=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x5b7a[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0xa5b7('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xa5b7('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0133ca5..b4d49e2 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 _0x3cd8=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','index','Migration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x3cd8,0x150));var _0x83cd=function(_0x392be3,_0xf1d603){_0x392be3=_0x392be3-0x0;var _0x1453b2=_0x3cd8[_0x392be3];return _0x1453b2;};'use strict';var emlformat=require(_0x83cd('0x0'));var rimraf=require(_0x83cd('0x1'));var zipdir=require(_0x83cd('0x2'));var jsonpatch=require(_0x83cd('0x3'));var rp=require(_0x83cd('0x4'));var moment=require(_0x83cd('0x5'));var BPromise=require(_0x83cd('0x6'));var Mustache=require(_0x83cd('0x7'));var util=require('util');var path=require(_0x83cd('0x8'));var sox=require(_0x83cd('0x9'));var csv=require(_0x83cd('0xa'));var ejs=require(_0x83cd('0xb'));var fs=require('fs');var fs_extra=require(_0x83cd('0xc'));var _=require(_0x83cd('0xd'));var squel=require(_0x83cd('0xe'));var crypto=require(_0x83cd('0xf'));var jsforce=require(_0x83cd('0x10'));var deskjs=require(_0x83cd('0x11'));var toCsv=require(_0x83cd('0xa'));var querystring=require(_0x83cd('0x12'));var Papa=require(_0x83cd('0x13'));var Redis=require(_0x83cd('0x14'));var authService=require(_0x83cd('0x15'));var qs=require(_0x83cd('0x16'));var as=require(_0x83cd('0x17'));var hardwareService=require(_0x83cd('0x18'));var logger=require(_0x83cd('0x19'))(_0x83cd('0x1a'));var utils=require('../../config/utils');var config=require(_0x83cd('0x1b'));var licenseUtil=require(_0x83cd('0x1c'));var db=require(_0x83cd('0x1d'))['db'];function respondWithStatusCode(_0x44ab88,_0x3e2fd6){_0x3e2fd6=_0x3e2fd6||0xcc;return function(_0x1d4114){if(_0x1d4114){return _0x44ab88[_0x83cd('0x1e')](_0x3e2fd6);}return _0x44ab88[_0x83cd('0x1f')](_0x3e2fd6)['end']();};}function respondWithResult(_0x53e70f,_0x6c51e2){_0x6c51e2=_0x6c51e2||0xc8;return function(_0x2d330d){if(_0x2d330d){return _0x53e70f[_0x83cd('0x1f')](_0x6c51e2)[_0x83cd('0x20')](_0x2d330d);}};}function respondWithFilteredResult(_0x385166,_0x501688){return function(_0x4df635){if(_0x4df635){var _0x268f58=typeof _0x501688[_0x83cd('0x21')]===_0x83cd('0x22')&&typeof _0x501688[_0x83cd('0x23')]===_0x83cd('0x22');var _0x3d6303=_0x4df635[_0x83cd('0x24')];var _0x1e136e=_0x268f58?0x0:_0x501688['offset'];var _0x1df488=_0x268f58?_0x4df635['count']:_0x501688[_0x83cd('0x21')]+_0x501688[_0x83cd('0x23')];var _0x23d9e4;if(_0x1df488>=_0x3d6303){_0x1df488=_0x3d6303;_0x23d9e4=0xc8;}else{_0x23d9e4=0xce;}_0x385166['status'](_0x23d9e4);return _0x385166['set'](_0x83cd('0x25'),_0x1e136e+'-'+_0x1df488+'/'+_0x3d6303)['json'](_0x4df635);}return null;};}function patchUpdates(_0x2748ba){return function(_0x6bb0f4){try{jsonpatch['apply'](_0x6bb0f4,_0x2748ba,!![]);}catch(_0x327f7e){return BPromise[_0x83cd('0x26')](_0x327f7e);}return _0x6bb0f4[_0x83cd('0x27')]();};}function saveUpdates(_0x648d88,_0x7a81d7){return function(_0x3f6c85){if(_0x3f6c85){return _0x3f6c85[_0x83cd('0x28')](_0x648d88)[_0x83cd('0x29')](function(_0x507f7e){return _0x507f7e;});}return null;};}function removeEntity(_0x55821c,_0x10c4ef){return function(_0x56c424){if(_0x56c424){return _0x56c424[_0x83cd('0x2a')]()[_0x83cd('0x29')](function(){_0x55821c[_0x83cd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c29e,_0x33bb16){return function(_0x3558fa){if(!_0x3558fa){_0x30c29e[_0x83cd('0x1e')](0x194);}return _0x3558fa;};}function handleError(_0x124ce0,_0x1c4fed){_0x1c4fed=_0x1c4fed||0x1f4;return function(_0x14ab2e){logger[_0x83cd('0x2b')](_0x14ab2e['stack']);if(_0x14ab2e[_0x83cd('0x2c')]){delete _0x14ab2e[_0x83cd('0x2c')];}_0x124ce0[_0x83cd('0x1f')](_0x1c4fed)[_0x83cd('0x2d')](_0x14ab2e);};}exports[_0x83cd('0x2e')]=function(_0x9dbb16,_0x317546){var _0x1df0ef={},_0x3eb69c={},_0x1edfd3={'count':0x0,'rows':[]};var _0x2f415e=_['map'](db[_0x83cd('0x2f')][_0x83cd('0x30')],function(_0x51bdf3){return{'name':_0x51bdf3[_0x83cd('0x31')],'type':_0x51bdf3[_0x83cd('0x32')]['key']};});_0x3eb69c['model']=_['map'](_0x2f415e,_0x83cd('0x2c'));_0x3eb69c[_0x83cd('0x33')]=_['keys'](_0x9dbb16[_0x83cd('0x33')]);_0x3eb69c[_0x83cd('0x34')]=_[_0x83cd('0x35')](_0x3eb69c[_0x83cd('0x36')],_0x3eb69c[_0x83cd('0x33')]);_0x1df0ef[_0x83cd('0x37')]=_[_0x83cd('0x35')](_0x3eb69c[_0x83cd('0x36')],qs[_0x83cd('0x38')](_0x9dbb16[_0x83cd('0x33')][_0x83cd('0x38')]));_0x1df0ef['attributes']=_0x1df0ef[_0x83cd('0x37')][_0x83cd('0x39')]?_0x1df0ef[_0x83cd('0x37')]:_0x3eb69c[_0x83cd('0x36')];if(!_0x9dbb16['query']['hasOwnProperty']('nolimit')){_0x1df0ef[_0x83cd('0x23')]=qs['limit'](_0x9dbb16['query']['limit']);_0x1df0ef[_0x83cd('0x21')]=qs[_0x83cd('0x21')](_0x9dbb16[_0x83cd('0x33')][_0x83cd('0x21')]);}_0x1df0ef[_0x83cd('0x3a')]=qs[_0x83cd('0x3b')](_0x9dbb16['query'][_0x83cd('0x3b')]);_0x1df0ef[_0x83cd('0x3c')]=qs[_0x83cd('0x34')](_['pick'](_0x9dbb16[_0x83cd('0x33')],_0x3eb69c[_0x83cd('0x34')]),_0x2f415e);if(_0x9dbb16[_0x83cd('0x33')]['filter']){_0x1df0ef['where']=_[_0x83cd('0x3d')](_0x1df0ef[_0x83cd('0x3c')],{'$or':_['map'](_0x2f415e,function(_0xac795e){if(_0xac795e[_0x83cd('0x32')]!==_0x83cd('0x3e')){var _0x1edaaf={};_0x1edaaf[_0xac795e[_0x83cd('0x2c')]]={'$like':'%'+_0x9dbb16['query'][_0x83cd('0x3f')]+'%'};return _0x1edaaf;}})});}_0x1df0ef=_['merge']({},_0x1df0ef,_0x9dbb16[_0x83cd('0x40')]);var _0x807acd={'where':_0x1df0ef[_0x83cd('0x3c')]};return db[_0x83cd('0x2f')]['count'](_0x807acd)[_0x83cd('0x29')](function(_0x10e14a){_0x1edfd3['count']=_0x10e14a;if(_0x9dbb16[_0x83cd('0x33')][_0x83cd('0x41')]){_0x1df0ef['include']=[{'all':!![]}];}return db['Migration'][_0x83cd('0x42')](_0x1df0ef);})[_0x83cd('0x29')](function(_0x330f63){_0x1edfd3['rows']=_0x330f63;return _0x1edfd3;})[_0x83cd('0x29')](respondWithFilteredResult(_0x317546,_0x1df0ef))[_0x83cd('0x43')](handleError(_0x317546,null));}; \ No newline at end of file +var _0xfad1=['name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Migration','includeAll','include','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack'];(function(_0x36a9ef,_0x4b3cbb){var _0x217ebb=function(_0x169ed2){while(--_0x169ed2){_0x36a9ef['push'](_0x36a9ef['shift']());}};_0x217ebb(++_0x4b3cbb);}(_0xfad1,0xb0));var _0x1fad=function(_0x3716ea,_0x4daf04){_0x3716ea=_0x3716ea-0x0;var _0x490e29=_0xfad1[_0x3716ea];return _0x490e29;};'use strict';var emlformat=require(_0x1fad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fad('0x1'));var jsonpatch=require(_0x1fad('0x2'));var rp=require(_0x1fad('0x3'));var moment=require('moment');var BPromise=require(_0x1fad('0x4'));var Mustache=require(_0x1fad('0x5'));var util=require(_0x1fad('0x6'));var path=require(_0x1fad('0x7'));var sox=require(_0x1fad('0x8'));var csv=require(_0x1fad('0x9'));var ejs=require(_0x1fad('0xa'));var fs=require('fs');var fs_extra=require(_0x1fad('0xb'));var _=require(_0x1fad('0xc'));var squel=require(_0x1fad('0xd'));var crypto=require(_0x1fad('0xe'));var jsforce=require(_0x1fad('0xf'));var deskjs=require(_0x1fad('0x10'));var toCsv=require(_0x1fad('0x9'));var querystring=require(_0x1fad('0x11'));var Papa=require(_0x1fad('0x12'));var Redis=require('ioredis');var authService=require(_0x1fad('0x13'));var qs=require(_0x1fad('0x14'));var as=require(_0x1fad('0x15'));var hardwareService=require(_0x1fad('0x16'));var logger=require(_0x1fad('0x17'))(_0x1fad('0x18'));var utils=require(_0x1fad('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1fad('0x1a'));var db=require(_0x1fad('0x1b'))['db'];function respondWithStatusCode(_0x3493f1,_0x57cfdc){_0x57cfdc=_0x57cfdc||0xcc;return function(_0x2e6d4f){if(_0x2e6d4f){return _0x3493f1['sendStatus'](_0x57cfdc);}return _0x3493f1[_0x1fad('0x1c')](_0x57cfdc)[_0x1fad('0x1d')]();};}function respondWithResult(_0x34c6cd,_0x470eb5){_0x470eb5=_0x470eb5||0xc8;return function(_0x9c182e){if(_0x9c182e){return _0x34c6cd['status'](_0x470eb5)[_0x1fad('0x1e')](_0x9c182e);}};}function respondWithFilteredResult(_0x4ac05d,_0x1074d1){return function(_0x2f37b7){if(_0x2f37b7){var _0x4dee4c=typeof _0x1074d1[_0x1fad('0x1f')]===_0x1fad('0x20')&&typeof _0x1074d1[_0x1fad('0x21')]==='undefined';var _0x539f0a=_0x2f37b7[_0x1fad('0x22')];var _0x2cf9de=_0x4dee4c?0x0:_0x1074d1[_0x1fad('0x1f')];var _0x3811b3=_0x4dee4c?_0x2f37b7['count']:_0x1074d1[_0x1fad('0x1f')]+_0x1074d1[_0x1fad('0x21')];var _0x35fc9e;if(_0x3811b3>=_0x539f0a){_0x3811b3=_0x539f0a;_0x35fc9e=0xc8;}else{_0x35fc9e=0xce;}_0x4ac05d['status'](_0x35fc9e);return _0x4ac05d['set'](_0x1fad('0x23'),_0x2cf9de+'-'+_0x3811b3+'/'+_0x539f0a)[_0x1fad('0x1e')](_0x2f37b7);}return null;};}function patchUpdates(_0xdbf9cf){return function(_0x4cb15b){try{jsonpatch[_0x1fad('0x24')](_0x4cb15b,_0xdbf9cf,!![]);}catch(_0x890db2){return BPromise[_0x1fad('0x25')](_0x890db2);}return _0x4cb15b[_0x1fad('0x26')]();};}function saveUpdates(_0x259743,_0x146daf){return function(_0xc1fb15){if(_0xc1fb15){return _0xc1fb15[_0x1fad('0x27')](_0x259743)[_0x1fad('0x28')](function(_0x14368b){return _0x14368b;});}return null;};}function removeEntity(_0x5af1b3,_0x3d03d6){return function(_0x254eda){if(_0x254eda){return _0x254eda[_0x1fad('0x29')]()['then'](function(){_0x5af1b3['status'](0xcc)[_0x1fad('0x1d')]();});}};}function handleEntityNotFound(_0x2c71ec,_0x33aee1){return function(_0x263f7b){if(!_0x263f7b){_0x2c71ec['sendStatus'](0x194);}return _0x263f7b;};}function handleError(_0x19d9e8,_0x526183){_0x526183=_0x526183||0x1f4;return function(_0x482f85){logger['error'](_0x482f85[_0x1fad('0x2a')]);if(_0x482f85[_0x1fad('0x2b')]){delete _0x482f85[_0x1fad('0x2b')];}_0x19d9e8[_0x1fad('0x1c')](_0x526183)[_0x1fad('0x2c')](_0x482f85);};}exports[_0x1fad('0x2d')]=function(_0x3c8bb4,_0x333f0b){var _0x3f7bf8={},_0x1ea90f={},_0x4fdb67={'count':0x0,'rows':[]};var _0xf08bce=_[_0x1fad('0x2e')](db['Migration'][_0x1fad('0x2f')],function(_0x1a94af){return{'name':_0x1a94af[_0x1fad('0x30')],'type':_0x1a94af[_0x1fad('0x31')][_0x1fad('0x32')]};});_0x1ea90f[_0x1fad('0x33')]=_['map'](_0xf08bce,_0x1fad('0x2b'));_0x1ea90f[_0x1fad('0x34')]=_[_0x1fad('0x35')](_0x3c8bb4[_0x1fad('0x34')]);_0x1ea90f[_0x1fad('0x36')]=_[_0x1fad('0x37')](_0x1ea90f[_0x1fad('0x33')],_0x1ea90f[_0x1fad('0x34')]);_0x3f7bf8[_0x1fad('0x38')]=_['intersection'](_0x1ea90f[_0x1fad('0x33')],qs[_0x1fad('0x39')](_0x3c8bb4[_0x1fad('0x34')][_0x1fad('0x39')]));_0x3f7bf8[_0x1fad('0x38')]=_0x3f7bf8[_0x1fad('0x38')][_0x1fad('0x3a')]?_0x3f7bf8[_0x1fad('0x38')]:_0x1ea90f[_0x1fad('0x33')];if(!_0x3c8bb4[_0x1fad('0x34')][_0x1fad('0x3b')](_0x1fad('0x3c'))){_0x3f7bf8[_0x1fad('0x21')]=qs['limit'](_0x3c8bb4['query'][_0x1fad('0x21')]);_0x3f7bf8[_0x1fad('0x1f')]=qs[_0x1fad('0x1f')](_0x3c8bb4[_0x1fad('0x34')][_0x1fad('0x1f')]);}_0x3f7bf8[_0x1fad('0x3d')]=qs[_0x1fad('0x3e')](_0x3c8bb4['query']['sort']);_0x3f7bf8[_0x1fad('0x3f')]=qs['filters'](_[_0x1fad('0x40')](_0x3c8bb4[_0x1fad('0x34')],_0x1ea90f[_0x1fad('0x36')]),_0xf08bce);if(_0x3c8bb4['query']['filter']){_0x3f7bf8['where']=_['merge'](_0x3f7bf8['where'],{'$or':_['map'](_0xf08bce,function(_0x53368d){if(_0x53368d[_0x1fad('0x31')]!=='VIRTUAL'){var _0x44fac7={};_0x44fac7[_0x53368d[_0x1fad('0x2b')]]={'$like':'%'+_0x3c8bb4[_0x1fad('0x34')][_0x1fad('0x41')]+'%'};return _0x44fac7;}})});}_0x3f7bf8=_[_0x1fad('0x42')]({},_0x3f7bf8,_0x3c8bb4[_0x1fad('0x43')]);var _0x4a35eb={'where':_0x3f7bf8[_0x1fad('0x3f')]};return db[_0x1fad('0x44')][_0x1fad('0x22')](_0x4a35eb)[_0x1fad('0x28')](function(_0x2f7123){_0x4fdb67[_0x1fad('0x22')]=_0x2f7123;if(_0x3c8bb4[_0x1fad('0x34')][_0x1fad('0x45')]){_0x3f7bf8[_0x1fad('0x46')]=[{'all':!![]}];}return db[_0x1fad('0x44')][_0x1fad('0x47')](_0x3f7bf8);})['then'](function(_0x2b94b1){_0x4fdb67[_0x1fad('0x48')]=_0x2b94b1;return _0x4fdb67;})[_0x1fad('0x28')](respondWithFilteredResult(_0x333f0b,_0x3f7bf8))['catch'](handleError(_0x333f0b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 4e3f172..22bee03 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 _0x8a52=['rimraf','../../config/environment','./migration.attributes','exports','Migration','util','../../config/logger','api','moment','bluebird','path'];(function(_0x17d389,_0x2f85bf){var _0x28a0c4=function(_0x16d20d){while(--_0x16d20d){_0x17d389['push'](_0x17d389['shift']());}};_0x28a0c4(++_0x2f85bf);}(_0x8a52,0x14f));var _0x28a5=function(_0x117157,_0x2068be){_0x117157=_0x117157-0x0;var _0x32e9eb=_0x8a52[_0x117157];return _0x32e9eb;};'use strict';var _=require('lodash');var util=require(_0x28a5('0x0'));var logger=require(_0x28a5('0x1'))(_0x28a5('0x2'));var moment=require(_0x28a5('0x3'));var BPromise=require(_0x28a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28a5('0x5'));var rimraf=require(_0x28a5('0x6'));var config=require(_0x28a5('0x7'));var attributes=require(_0x28a5('0x8'));module[_0x28a5('0x9')]=function(_0x4f101e,_0xe142f8){return _0x4f101e['define'](_0x28a5('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc27a=['path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xc27a,0x96));var _0xac27=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0xc27a[_0x2e913b];return _0x173899;};'use strict';var _=require(_0xac27('0x0'));var util=require(_0xac27('0x1'));var logger=require(_0xac27('0x2'))(_0xac27('0x3'));var moment=require(_0xac27('0x4'));var BPromise=require('bluebird');var rp=require(_0xac27('0x5'));var fs=require('fs');var path=require(_0xac27('0x6'));var rimraf=require(_0xac27('0x7'));var config=require(_0xac27('0x8'));var attributes=require(_0xac27('0x9'));module[_0xac27('0xa')]=function(_0x40d1dd,_0x5bfa63){return _0x40d1dd[_0xac27('0xb')]('Migration',attributes,{'tableName':_0xac27('0xc'),'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 9c2e54f..5e620d6 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 _0x34ab=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result'];(function(_0x32a884,_0x183853){var _0x242f9b=function(_0x556c63){while(--_0x556c63){_0x32a884['push'](_0x32a884['shift']());}};_0x242f9b(++_0x183853);}(_0x34ab,0x169));var _0xb34a=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x34ab[_0x454018];return _0x24697d;};'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')]('Migration,\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')]('Migration,\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 +var _0xffda=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2fbf3d,_0x1b1b8a){var _0x18f0c1=function(_0x4aa677){while(--_0x4aa677){_0x2fbf3d['push'](_0x2fbf3d['shift']());}};_0x18f0c1(++_0x1b1b8a);}(_0xffda,0x73));var _0xaffd=function(_0x39eff1,_0x372d5e){_0x39eff1=_0x39eff1-0x0;var _0x2fdb5a=_0xffda[_0x39eff1];return _0x2fdb5a;};'use strict';var _=require(_0xaffd('0x0'));var util=require(_0xaffd('0x1'));var moment=require(_0xaffd('0x2'));var BPromise=require(_0xaffd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaffd('0x4'));var db=require(_0xaffd('0x5'))['db'];var utils=require(_0xaffd('0x6'));var logger=require('../../config/logger')(_0xaffd('0x7'));var config=require('../../config/environment');var jayson=require(_0xaffd('0x8'));var client=jayson[_0xaffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca99e,_0x39b2e5,_0x12865c){return new BPromise(function(_0x3647e1,_0x514b76){return client[_0xaffd('0xa')](_0x4ca99e,_0x12865c)[_0xaffd('0xb')](function(_0x505908){logger['info'](_0xaffd('0xc'),_0x39b2e5,_0xaffd('0xd'));logger[_0xaffd('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x39b2e5,_0xaffd('0xd'),JSON[_0xaffd('0xf')](_0x505908));if(_0x505908['error']){if(_0x505908[_0xaffd('0x10')][_0xaffd('0x11')]===0x1f4){logger[_0xaffd('0x10')](_0xaffd('0xc'),_0x39b2e5,_0x505908[_0xaffd('0x10')]['message']);return _0x514b76(_0x505908[_0xaffd('0x10')]['message']);}logger['error'](_0xaffd('0xc'),_0x39b2e5,_0x505908[_0xaffd('0x10')][_0xaffd('0x12')]);return _0x3647e1(_0x505908['error'][_0xaffd('0x12')]);}else{logger[_0xaffd('0x13')](_0xaffd('0xc'),_0x39b2e5,_0xaffd('0xd'));_0x3647e1(_0x505908[_0xaffd('0x14')][_0xaffd('0x12')]);}})[_0xaffd('0x15')](function(_0x3ddf0c){logger['error'](_0xaffd('0xc'),_0x39b2e5,_0x3ddf0c);_0x514b76(_0x3ddf0c);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 5a25f38..eef6be0 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 _0x6d11=['util','path','express','fs-extra','../../components/auth/service','./network.controller','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','multer'];(function(_0x285bc6,_0x33deb7){var _0x43cd18=function(_0x2eb053){while(--_0x2eb053){_0x285bc6['push'](_0x285bc6['shift']());}};_0x43cd18(++_0x33deb7);}(_0x6d11,0xbf));var _0x16d1=function(_0x29991c,_0x537b62){_0x29991c=_0x29991c-0x0;var _0x38e9ce=_0x6d11[_0x29991c];return _0x38e9ce;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['update']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);module[_0x16d1('0xf')]=router; \ No newline at end of file +var _0x804d=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x55beb6,_0x4acb83){var _0x307e84=function(_0x31ca93){while(--_0x31ca93){_0x55beb6['push'](_0x55beb6['shift']());}};_0x307e84(++_0x4acb83);}(_0x804d,0x116));var _0xd804=function(_0x58f8d3,_0x2bae22){_0x58f8d3=_0x58f8d3-0x0;var _0x5ea4b7=_0x804d[_0x58f8d3];return _0x5ea4b7;};'use strict';var multer=require(_0xd804('0x0'));var util=require(_0xd804('0x1'));var path=require(_0xd804('0x2'));var timeout=require(_0xd804('0x3'));var express=require(_0xd804('0x4'));var router=express[_0xd804('0x5')]();var fs_extra=require(_0xd804('0x6'));var auth=require(_0xd804('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd804('0x8'));var controller=require(_0xd804('0x9'));router[_0xd804('0xa')]('/',auth[_0xd804('0xb')](),controller[_0xd804('0xc')]);router[_0xd804('0xa')](_0xd804('0xd'),auth[_0xd804('0xb')](),controller[_0xd804('0xe')]);router[_0xd804('0xf')]('/',auth[_0xd804('0xb')](),controller[_0xd804('0x10')]);router['put'](_0xd804('0xd'),auth[_0xd804('0xb')](),controller[_0xd804('0x11')]);router[_0xd804('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd804('0x13')]);module[_0xd804('0x14')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index b3e659c..ec4866a 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 _0x683a=['STRING','sequelize','exports','ENUM','externip','stun','turn'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x683a,0x112));var _0xa683=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x683a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa683('0x0'));module[_0xa683('0x1')]={'type':{'type':Sequelize[_0xa683('0x2')]('localnet',_0xa683('0x3'),_0xa683('0x4'),_0xa683('0x5'))},'value':{'type':Sequelize[_0xa683('0x6')]},'username':{'type':Sequelize[_0xa683('0x6')]},'password':{'type':Sequelize[_0xa683('0x6')]}}; \ No newline at end of file +var _0xa58d=['externip','STRING','sequelize','exports','ENUM','localnet'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa58d,0x1d6));var _0xda58=function(_0x4b45a1,_0x3c35f9){_0x4b45a1=_0x4b45a1-0x0;var _0x1af025=_0xa58d[_0x4b45a1];return _0x1af025;};'use strict';var Sequelize=require(_0xda58('0x0'));module[_0xda58('0x1')]={'type':{'type':Sequelize[_0xda58('0x2')](_0xda58('0x3'),_0xda58('0x4'),'stun','turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xda58('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index eb4dc7d..4e1963c 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 _0xf321=['info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','set','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','Network','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','toUpperCase','join','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','writeFileSync','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','STUN','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','util','path','lodash','../../config/logger','api','../../config/environment','../../mysqldb','client','http','request','then'];(function(_0x5ba502,_0x202082){var _0x446851=function(_0x24eada){while(--_0x24eada){_0x5ba502['push'](_0x5ba502['shift']());}};_0x446851(++_0x202082);}(_0xf321,0x14d));var _0x1f32=function(_0x14db1b,_0x5d54c5){_0x14db1b=_0x14db1b-0x0;var _0x145b5b=_0xf321[_0x14db1b];return _0x145b5b;};'use strict';var util=require(_0x1f32('0x0'));var path=require(_0x1f32('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1f32('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x1f32('0x3'))(_0x1f32('0x4'));var config=require(_0x1f32('0x5'));var db=require(_0x1f32('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1f32('0x7')][_0x1f32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a3292,_0x29b46e,_0x592dd2,_0x578a98){return new Promise(function(_0x313c0f,_0x1f6ec0){var _0x1a3830=_0x578a98||client;return _0x1a3830[_0x1f32('0x9')](_0x4a3292,_0x592dd2)[_0x1f32('0xa')](function(_0x517b72){logger[_0x1f32('0xb')](_0x1f32('0xc'),_0x29b46e,_0x1f32('0xd'));logger[_0x1f32('0xe')](_0x1f32('0xf'),_0x29b46e,_0x1f32('0xd'),JSON[_0x1f32('0x10')](_0x517b72));if(_0x517b72[_0x1f32('0x11')]){if(_0x517b72[_0x1f32('0x11')][_0x1f32('0x12')]===0x1f4){logger['error'](_0x1f32('0xc'),_0x29b46e,_0x517b72[_0x1f32('0x11')][_0x1f32('0x13')]);return _0x1f6ec0(_0x517b72[_0x1f32('0x11')][_0x1f32('0x13')]);}logger[_0x1f32('0x11')](_0x1f32('0xc'),_0x29b46e,_0x517b72[_0x1f32('0x11')]['message']);return _0x313c0f(_0x517b72['error'][_0x1f32('0x13')]);}else{logger[_0x1f32('0xb')](_0x1f32('0xc'),_0x29b46e,_0x1f32('0xd'));_0x313c0f(_0x517b72[_0x1f32('0x14')]['message']);}})['catch'](function(_0x304923){logger[_0x1f32('0x11')](_0x1f32('0xc'),_0x29b46e,_0x304923);_0x1f6ec0(_0x304923);});});}function respondWithResult(_0x5430b4,_0x2391a9){_0x2391a9=_0x2391a9||0xc8;return function(_0x8d5e84){if(_0x8d5e84){return _0x5430b4[_0x1f32('0x15')](_0x2391a9)[_0x1f32('0x16')](_0x8d5e84);}};}function respondWithFilteredResult(_0xa69663,_0x34e1c2){return function(_0x3e6baa){if(_0x3e6baa){var _0x543a91=typeof _0x34e1c2[_0x1f32('0x17')]===_0x1f32('0x18')&&typeof _0x34e1c2[_0x1f32('0x19')]===_0x1f32('0x18');var _0x5b783d=_0x3e6baa[_0x1f32('0x1a')];var _0x14fb77=_0x543a91?0x0:_0x34e1c2['offset'];var _0x302dcd=_0x543a91?_0x3e6baa[_0x1f32('0x1a')]:_0x34e1c2[_0x1f32('0x17')]+_0x34e1c2['limit'];var _0x42bc5d;if(_0x302dcd>=_0x5b783d){_0x302dcd=_0x5b783d;_0x42bc5d=0xc8;}else{_0x42bc5d=0xce;}_0xa69663[_0x1f32('0x15')](_0x42bc5d);return _0xa69663[_0x1f32('0x1b')]('Content-Range',_0x14fb77+'-'+_0x302dcd+'/'+_0x5b783d)[_0x1f32('0x16')](_0x3e6baa);}return null;};}function saveUpdates(_0x5d25a3){return function(_0x1367c8){if(_0x1367c8){return _0x1367c8[_0x1f32('0x1c')](_0x5d25a3)['then'](function(_0x847843){return _0x847843;});}return null;};}function removeEntity(_0x609c50){return function(_0xe3bb7c){if(_0xe3bb7c){return _0xe3bb7c[_0x1f32('0x1d')]()[_0x1f32('0xa')](function(){_0x609c50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cde0d){return function(_0x282823){if(!_0x282823){_0x5cde0d['sendStatus'](0x194);}return _0x282823;};}function handleError(_0x106341,_0x1460d0){_0x1460d0=_0x1460d0||0x1f4;return function(_0x36a44e){logger['error'](_0x36a44e[_0x1f32('0x1e')]);if(_0x36a44e['name']){delete _0x36a44e[_0x1f32('0x1f')];}_0x106341[_0x1f32('0x15')](_0x1460d0)['send'](_0x36a44e);};}exports[_0x1f32('0x20')]=function(_0x19aad2,_0x5973ad){var _0xcec353={},_0x4a7ced={},_0x309c91={'count':0x0,'rows':[]};var _0x175387=_[_0x1f32('0x21')](db['Network'][_0x1f32('0x22')],function(_0x1f7b8c){return{'name':_0x1f7b8c[_0x1f32('0x23')],'type':_0x1f7b8c[_0x1f32('0x24')][_0x1f32('0x25')]};});_0x4a7ced[_0x1f32('0x26')]=_[_0x1f32('0x21')](_0x175387,_0x1f32('0x1f'));_0x4a7ced['query']=_[_0x1f32('0x27')](_0x19aad2[_0x1f32('0x28')]);_0x4a7ced[_0x1f32('0x29')]=_[_0x1f32('0x2a')](_0x4a7ced['model'],_0x4a7ced[_0x1f32('0x28')]);_0xcec353[_0x1f32('0x2b')]=_[_0x1f32('0x2a')](_0x4a7ced[_0x1f32('0x26')],qs['fields'](_0x19aad2[_0x1f32('0x28')]['fields']));_0xcec353['attributes']=_0xcec353[_0x1f32('0x2b')][_0x1f32('0x2c')]?_0xcec353['attributes']:_0x4a7ced[_0x1f32('0x26')];if(!_0x19aad2[_0x1f32('0x28')][_0x1f32('0x2d')](_0x1f32('0x2e'))){_0xcec353[_0x1f32('0x19')]=qs['limit'](_0x19aad2[_0x1f32('0x28')][_0x1f32('0x19')]);_0xcec353['offset']=qs[_0x1f32('0x17')](_0x19aad2[_0x1f32('0x28')]['offset']);}_0xcec353[_0x1f32('0x2f')]=qs['sort'](_0x19aad2[_0x1f32('0x28')]['sort']);_0xcec353[_0x1f32('0x30')]=qs[_0x1f32('0x29')](_[_0x1f32('0x31')](_0x19aad2[_0x1f32('0x28')],_0x4a7ced['filters']),_0x175387);if(_0x19aad2[_0x1f32('0x28')]['filter']){_0xcec353['where']=_[_0x1f32('0x32')](_0xcec353['where'],{'$or':_['map'](_0x175387,function(_0x3492ce){if(_0x3492ce[_0x1f32('0x24')]!==_0x1f32('0x33')){var _0x10d275={};_0x10d275[_0x3492ce['name']]={'$like':'%'+_0x19aad2[_0x1f32('0x28')][_0x1f32('0x34')]+'%'};return _0x10d275;}})});}_0xcec353=_['merge']({},_0xcec353,_0x19aad2[_0x1f32('0x35')]);var _0x453a76={'where':_0xcec353[_0x1f32('0x30')]};return db[_0x1f32('0x36')][_0x1f32('0x1a')](_0x453a76)['then'](function(_0x41431a){_0x309c91[_0x1f32('0x1a')]=_0x41431a;if(_0x19aad2[_0x1f32('0x28')][_0x1f32('0x37')]){_0xcec353['include']=[{'all':!![]}];}return db[_0x1f32('0x36')][_0x1f32('0x38')](_0xcec353);})[_0x1f32('0xa')](function(_0x40f2d2){_0x309c91[_0x1f32('0x39')]=_0x40f2d2;return _0x309c91;})['then'](respondWithFilteredResult(_0x5973ad,_0xcec353))[_0x1f32('0x3a')](handleError(_0x5973ad,null));};exports[_0x1f32('0x3b')]=function(_0x43bf43,_0x85b6e0){var _0x9c0ab9={'raw':!![],'where':{'id':_0x43bf43[_0x1f32('0x3c')]['id']}},_0x1dd535={};_0x1dd535['model']=_[_0x1f32('0x27')](db[_0x1f32('0x36')][_0x1f32('0x22')]);_0x1dd535[_0x1f32('0x28')]=_['keys'](_0x43bf43[_0x1f32('0x28')]);_0x1dd535[_0x1f32('0x29')]=_['intersection'](_0x1dd535['model'],_0x1dd535[_0x1f32('0x28')]);_0x9c0ab9[_0x1f32('0x2b')]=_[_0x1f32('0x2a')](_0x1dd535[_0x1f32('0x26')],qs['fields'](_0x43bf43[_0x1f32('0x28')][_0x1f32('0x3d')]));_0x9c0ab9[_0x1f32('0x2b')]=_0x9c0ab9[_0x1f32('0x2b')][_0x1f32('0x2c')]?_0x9c0ab9[_0x1f32('0x2b')]:_0x1dd535[_0x1f32('0x26')];if(_0x43bf43['query']['includeAll']){_0x9c0ab9[_0x1f32('0x3e')]=[{'all':!![]}];}_0x9c0ab9=_['merge']({},_0x9c0ab9,_0x43bf43[_0x1f32('0x35')]);return db[_0x1f32('0x36')][_0x1f32('0x3f')](_0x9c0ab9)[_0x1f32('0xa')](handleEntityNotFound(_0x85b6e0,null))[_0x1f32('0xa')](respondWithResult(_0x85b6e0,null))[_0x1f32('0x3a')](handleError(_0x85b6e0,null));};exports[_0x1f32('0x40')]=function(_0x4cec24,_0x17be23){var _0x19d75e;return db['Network']['create'](_0x4cec24[_0x1f32('0x41')],{'raw':!![]})[_0x1f32('0xa')](function(_0x51addd){_0x19d75e=_0x51addd;return db[_0x1f32('0x36')]['findAll']({'where':{'type':_0x4cec24[_0x1f32('0x41')][_0x1f32('0x24')]},'raw':!![]});})[_0x1f32('0xa')](function(_0x5deb57){if(_0x19d75e[_0x1f32('0x24')][_0x1f32('0x42')]()=='STUN'){var _0x312936=fs['readFileSync'](path[_0x1f32('0x43')](config['root'],_0x1f32('0x44')),_0x1f32('0x45'));var _0x83a6f4=ejs[_0x1f32('0x46')](_0x312936,{'networks':_0x5deb57||[]});fs['writeFileSync'](_0x1f32('0x47'),_0x83a6f4);return respondWithRpcPromise(_0x1f32('0x48'),_0x1f32('0x40'),{'module':_0x1f32('0x49')});}else if(_0x19d75e[_0x1f32('0x24')][_0x1f32('0x42')]()==_0x1f32('0x4a')){var _0x1ef107=fs[_0x1f32('0x4b')](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],_0x1f32('0x4d')),_0x1f32('0x45'));var _0x54a8e2=ejs[_0x1f32('0x46')](_0x1ef107,{'networks':_0x5deb57||[]});fs[_0x1f32('0x4e')]('/etc/asterisk/turn_xcally.conf',_0x54a8e2);return respondWithRpcPromise('Reload',_0x1f32('0x40'),{'module':_0x1f32('0x49')});}else{var _0x5eae91=fs[_0x1f32('0x4b')](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],_0x1f32('0x4f')),'utf8');var _0x154f03=ejs[_0x1f32('0x46')](_0x5eae91,{'networks':_0x5deb57||[]});fs[_0x1f32('0x4e')](util[_0x1f32('0x50')]('/etc/asterisk/sip_xcally_%s.conf',_0x4cec24['body'][_0x1f32('0x24')][_0x1f32('0x51')]()),_0x154f03);return respondWithRpcPromise(_0x1f32('0x48'),'create',{'module':_0x1f32('0x52')});}})[_0x1f32('0xa')](function(){return _0x19d75e;})['then'](respondWithResult(_0x17be23,0xc9))[_0x1f32('0x3a')](handleError(_0x17be23,null));};exports['update']=function(_0x63a228,_0x21c12d){var _0x4b8511;return db['Network'][_0x1f32('0x3f')]({'where':{'id':_0x63a228['params']['id']}})[_0x1f32('0xa')](handleEntityNotFound(_0x21c12d,null))[_0x1f32('0xa')](saveUpdates(_0x63a228[_0x1f32('0x41')],null))[_0x1f32('0xa')](function(_0x1cb345){if(_0x1cb345){_0x4b8511=_0x1cb345;return db['Network']['findAll']({'where':{'type':_0x4b8511[_0x1f32('0x24')]},'raw':!![]});}return null;})[_0x1f32('0xa')](function(_0x53eef4){if(_0x4b8511[_0x1f32('0x24')][_0x1f32('0x42')]()==_0x1f32('0x53')){var _0x1b89cf=fs[_0x1f32('0x4b')](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x6e767d=ejs['render'](_0x1b89cf,{'networks':_0x53eef4||[]});fs[_0x1f32('0x4e')](_0x1f32('0x47'),_0x6e767d);return respondWithRpcPromise(_0x1f32('0x48'),_0x1f32('0x1c'),{'module':_0x1f32('0x49')});}else if(_0x4b8511['type']['toUpperCase']()==_0x1f32('0x4a')){var _0x3413ed=fs['readFileSync'](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],_0x1f32('0x4d')),'utf8');var _0x40a1cb=ejs[_0x1f32('0x46')](_0x3413ed,{'networks':_0x53eef4||[]});fs[_0x1f32('0x4e')](_0x1f32('0x54'),_0x40a1cb);return respondWithRpcPromise(_0x1f32('0x48'),_0x1f32('0x1c'),{'module':_0x1f32('0x49')});}else{var _0x48fae6=fs[_0x1f32('0x4b')](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],'server/files/templates/network.ejs'),'utf8');var _0xe610d4=ejs[_0x1f32('0x46')](_0x48fae6,{'networks':_0x53eef4||[]});fs[_0x1f32('0x4e')](util[_0x1f32('0x50')](_0x1f32('0x55'),_0x63a228[_0x1f32('0x41')][_0x1f32('0x24')][_0x1f32('0x51')]()),_0xe610d4);return respondWithRpcPromise(_0x1f32('0x48'),_0x1f32('0x1c'),{'module':_0x1f32('0x52')});}})[_0x1f32('0xa')](function(_0x7f9d3f){if(_0x7f9d3f){return _0x4b8511;}return null;})['then'](respondWithResult(_0x21c12d,null))[_0x1f32('0x3a')](handleError(_0x21c12d,null));};exports[_0x1f32('0x1d')]=function(_0x4105fb,_0x43c534){var _0x466f95;return db['Network'][_0x1f32('0x3f')]({'where':{'id':_0x4105fb[_0x1f32('0x3c')]['id']}})[_0x1f32('0xa')](function(_0x3cfb3f){_0x466f95=_0x3cfb3f;return _0x3cfb3f;})[_0x1f32('0xa')](handleEntityNotFound(_0x43c534,null))['then'](removeEntity(_0x43c534,null))[_0x1f32('0xa')](function(){if(_0x466f95){return db[_0x1f32('0x36')][_0x1f32('0x38')]({'where':{'type':_0x466f95[_0x1f32('0x24')]},'raw':!![]});}})['then'](function(_0x2058eb){if(_0x466f95[_0x1f32('0x24')][_0x1f32('0x42')]()==_0x1f32('0x53')){var _0x49b5b7=fs[_0x1f32('0x4b')](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],_0x1f32('0x44')),_0x1f32('0x45'));var _0x1a3a62=ejs[_0x1f32('0x46')](_0x49b5b7,{'networks':_0x2058eb||[]});fs[_0x1f32('0x4e')](_0x1f32('0x47'),_0x1a3a62);return respondWithRpcPromise(_0x1f32('0x48'),_0x1f32('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x466f95[_0x1f32('0x24')][_0x1f32('0x42')]()=='TURN'){var _0x2617a8=fs[_0x1f32('0x4b')](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],_0x1f32('0x4d')),_0x1f32('0x45'));var _0xb28d4d=ejs[_0x1f32('0x46')](_0x2617a8,{'networks':_0x2058eb||[]});fs[_0x1f32('0x4e')](_0x1f32('0x54'),_0xb28d4d);return respondWithRpcPromise(_0x1f32('0x48'),_0x1f32('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x1e0cc2=fs[_0x1f32('0x4b')](path[_0x1f32('0x43')](config[_0x1f32('0x4c')],_0x1f32('0x4f')),_0x1f32('0x45'));var _0x125cfe=ejs[_0x1f32('0x46')](_0x1e0cc2,{'networks':_0x2058eb||[]});fs[_0x1f32('0x4e')](util[_0x1f32('0x50')](_0x1f32('0x55'),_0x466f95[_0x1f32('0x24')][_0x1f32('0x51')]()),_0x125cfe);return respondWithRpcPromise('Reload',_0x1f32('0x1d'),{'module':_0x1f32('0x52')});}})[_0x1f32('0x3a')](handleError(_0x43c534,null));}; \ No newline at end of file +var _0xe3a5=['filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','keys','includeAll','find','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','writeFileSync','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','utf8','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','params','/etc/asterisk/stun_xcally.conf','Reload','toLowerCase','path','lodash','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','Network,\x20%s,\x20%s','message','info','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xe3a5,0xc6));var _0x5e3a=function(_0x4a4fb1,_0x5a6edd){_0x4a4fb1=_0x4a4fb1-0x0;var _0x20161b=_0xe3a5[_0x4a4fb1];return _0x20161b;};'use strict';var util=require('util');var path=require(_0x5e3a('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5e3a('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x5e3a('0x2'))('api');var config=require(_0x5e3a('0x3'));var db=require(_0x5e3a('0x4'))['db'];var jayson=require(_0x5e3a('0x5'));var client=jayson['client'][_0x5e3a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3b0176,_0x1d02f9,_0x20d4d1,_0x464c23){return new Promise(function(_0xff77df,_0x557457){var _0x50f55f=_0x464c23||client;return _0x50f55f[_0x5e3a('0x7')](_0x3b0176,_0x20d4d1)[_0x5e3a('0x8')](function(_0x392af6){logger['info']('Network,\x20%s,\x20%s',_0x1d02f9,_0x5e3a('0x9'));logger[_0x5e3a('0xa')]('Network,\x20%s,\x20%s,\x20%s',_0x1d02f9,_0x5e3a('0x9'),JSON[_0x5e3a('0xb')](_0x392af6));if(_0x392af6[_0x5e3a('0xc')]){if(_0x392af6[_0x5e3a('0xc')]['code']===0x1f4){logger[_0x5e3a('0xc')](_0x5e3a('0xd'),_0x1d02f9,_0x392af6['error'][_0x5e3a('0xe')]);return _0x557457(_0x392af6[_0x5e3a('0xc')][_0x5e3a('0xe')]);}logger[_0x5e3a('0xc')]('Network,\x20%s,\x20%s',_0x1d02f9,_0x392af6[_0x5e3a('0xc')][_0x5e3a('0xe')]);return _0xff77df(_0x392af6[_0x5e3a('0xc')]['message']);}else{logger[_0x5e3a('0xf')]('Network,\x20%s,\x20%s',_0x1d02f9,_0x5e3a('0x9'));_0xff77df(_0x392af6['result'][_0x5e3a('0xe')]);}})[_0x5e3a('0x10')](function(_0x5ef099){logger[_0x5e3a('0xc')]('Network,\x20%s,\x20%s',_0x1d02f9,_0x5ef099);_0x557457(_0x5ef099);});});}function respondWithResult(_0x2deb69,_0x2a4dd2){_0x2a4dd2=_0x2a4dd2||0xc8;return function(_0x5d829b){if(_0x5d829b){return _0x2deb69[_0x5e3a('0x11')](_0x2a4dd2)[_0x5e3a('0x12')](_0x5d829b);}};}function respondWithFilteredResult(_0x582eab,_0x64cf3f){return function(_0x45c4fe){if(_0x45c4fe){var _0x12e8f0=typeof _0x64cf3f[_0x5e3a('0x13')]===_0x5e3a('0x14')&&typeof _0x64cf3f['limit']===_0x5e3a('0x14');var _0x983c23=_0x45c4fe[_0x5e3a('0x15')];var _0x1cd7dd=_0x12e8f0?0x0:_0x64cf3f[_0x5e3a('0x13')];var _0xf8b328=_0x12e8f0?_0x45c4fe[_0x5e3a('0x15')]:_0x64cf3f[_0x5e3a('0x13')]+_0x64cf3f[_0x5e3a('0x16')];var _0x5747d8;if(_0xf8b328>=_0x983c23){_0xf8b328=_0x983c23;_0x5747d8=0xc8;}else{_0x5747d8=0xce;}_0x582eab[_0x5e3a('0x11')](_0x5747d8);return _0x582eab[_0x5e3a('0x17')](_0x5e3a('0x18'),_0x1cd7dd+'-'+_0xf8b328+'/'+_0x983c23)['json'](_0x45c4fe);}return null;};}function saveUpdates(_0x17b653){return function(_0x352bb4){if(_0x352bb4){return _0x352bb4[_0x5e3a('0x19')](_0x17b653)[_0x5e3a('0x8')](function(_0x34a3a5){return _0x34a3a5;});}return null;};}function removeEntity(_0x31f6a){return function(_0x488918){if(_0x488918){return _0x488918[_0x5e3a('0x1a')]()[_0x5e3a('0x8')](function(){_0x31f6a[_0x5e3a('0x11')](0xcc)[_0x5e3a('0x1b')]();});}};}function handleEntityNotFound(_0x5119ce){return function(_0x5ae483){if(!_0x5ae483){_0x5119ce[_0x5e3a('0x1c')](0x194);}return _0x5ae483;};}function handleError(_0x43a5df,_0x441e0b){_0x441e0b=_0x441e0b||0x1f4;return function(_0xf48071){logger['error'](_0xf48071[_0x5e3a('0x1d')]);if(_0xf48071[_0x5e3a('0x1e')]){delete _0xf48071['name'];}_0x43a5df[_0x5e3a('0x11')](_0x441e0b)[_0x5e3a('0x1f')](_0xf48071);};}exports[_0x5e3a('0x20')]=function(_0x34685c,_0x335fff){var _0x32ce9c={},_0x3ef7e9={},_0x5a90cc={'count':0x0,'rows':[]};var _0x57536d=_[_0x5e3a('0x21')](db[_0x5e3a('0x22')][_0x5e3a('0x23')],function(_0x1772d1){return{'name':_0x1772d1[_0x5e3a('0x24')],'type':_0x1772d1[_0x5e3a('0x25')][_0x5e3a('0x26')]};});_0x3ef7e9['model']=_[_0x5e3a('0x21')](_0x57536d,_0x5e3a('0x1e'));_0x3ef7e9[_0x5e3a('0x27')]=_['keys'](_0x34685c[_0x5e3a('0x27')]);_0x3ef7e9['filters']=_[_0x5e3a('0x28')](_0x3ef7e9[_0x5e3a('0x29')],_0x3ef7e9[_0x5e3a('0x27')]);_0x32ce9c[_0x5e3a('0x2a')]=_[_0x5e3a('0x28')](_0x3ef7e9['model'],qs[_0x5e3a('0x2b')](_0x34685c[_0x5e3a('0x27')]['fields']));_0x32ce9c[_0x5e3a('0x2a')]=_0x32ce9c['attributes']['length']?_0x32ce9c['attributes']:_0x3ef7e9[_0x5e3a('0x29')];if(!_0x34685c['query'][_0x5e3a('0x2c')](_0x5e3a('0x2d'))){_0x32ce9c[_0x5e3a('0x16')]=qs['limit'](_0x34685c[_0x5e3a('0x27')][_0x5e3a('0x16')]);_0x32ce9c[_0x5e3a('0x13')]=qs['offset'](_0x34685c[_0x5e3a('0x27')][_0x5e3a('0x13')]);}_0x32ce9c[_0x5e3a('0x2e')]=qs[_0x5e3a('0x2f')](_0x34685c[_0x5e3a('0x27')]['sort']);_0x32ce9c['where']=qs[_0x5e3a('0x30')](_['pick'](_0x34685c[_0x5e3a('0x27')],_0x3ef7e9[_0x5e3a('0x30')]),_0x57536d);if(_0x34685c[_0x5e3a('0x27')][_0x5e3a('0x31')]){_0x32ce9c[_0x5e3a('0x32')]=_[_0x5e3a('0x33')](_0x32ce9c[_0x5e3a('0x32')],{'$or':_[_0x5e3a('0x21')](_0x57536d,function(_0x1f746f){if(_0x1f746f['type']!==_0x5e3a('0x34')){var _0x490011={};_0x490011[_0x1f746f['name']]={'$like':'%'+_0x34685c['query'][_0x5e3a('0x31')]+'%'};return _0x490011;}})});}_0x32ce9c=_[_0x5e3a('0x33')]({},_0x32ce9c,_0x34685c[_0x5e3a('0x35')]);var _0x1e522a={'where':_0x32ce9c[_0x5e3a('0x32')]};return db[_0x5e3a('0x22')]['count'](_0x1e522a)[_0x5e3a('0x8')](function(_0x578ad6){_0x5a90cc[_0x5e3a('0x15')]=_0x578ad6;if(_0x34685c['query']['includeAll']){_0x32ce9c[_0x5e3a('0x36')]=[{'all':!![]}];}return db[_0x5e3a('0x22')][_0x5e3a('0x37')](_0x32ce9c);})[_0x5e3a('0x8')](function(_0x47c3ac){_0x5a90cc[_0x5e3a('0x38')]=_0x47c3ac;return _0x5a90cc;})['then'](respondWithFilteredResult(_0x335fff,_0x32ce9c))[_0x5e3a('0x10')](handleError(_0x335fff,null));};exports['show']=function(_0x1f4b61,_0x165e87){var _0xdd53e2={'raw':!![],'where':{'id':_0x1f4b61['params']['id']}},_0x7d6853={};_0x7d6853['model']=_['keys'](db['Network'][_0x5e3a('0x23')]);_0x7d6853['query']=_[_0x5e3a('0x39')](_0x1f4b61['query']);_0x7d6853[_0x5e3a('0x30')]=_['intersection'](_0x7d6853['model'],_0x7d6853['query']);_0xdd53e2['attributes']=_[_0x5e3a('0x28')](_0x7d6853[_0x5e3a('0x29')],qs[_0x5e3a('0x2b')](_0x1f4b61[_0x5e3a('0x27')][_0x5e3a('0x2b')]));_0xdd53e2['attributes']=_0xdd53e2[_0x5e3a('0x2a')]['length']?_0xdd53e2[_0x5e3a('0x2a')]:_0x7d6853[_0x5e3a('0x29')];if(_0x1f4b61[_0x5e3a('0x27')][_0x5e3a('0x3a')]){_0xdd53e2[_0x5e3a('0x36')]=[{'all':!![]}];}_0xdd53e2=_[_0x5e3a('0x33')]({},_0xdd53e2,_0x1f4b61['options']);return db[_0x5e3a('0x22')][_0x5e3a('0x3b')](_0xdd53e2)['then'](handleEntityNotFound(_0x165e87,null))[_0x5e3a('0x8')](respondWithResult(_0x165e87,null))[_0x5e3a('0x10')](handleError(_0x165e87,null));};exports[_0x5e3a('0x3c')]=function(_0x372b36,_0x4d467b){var _0x360a38;return db[_0x5e3a('0x22')]['create'](_0x372b36[_0x5e3a('0x3d')],{'raw':!![]})[_0x5e3a('0x8')](function(_0x36b060){_0x360a38=_0x36b060;return db[_0x5e3a('0x22')]['findAll']({'where':{'type':_0x372b36['body']['type']},'raw':!![]});})['then'](function(_0x2c6878){if(_0x360a38[_0x5e3a('0x25')]['toUpperCase']()==_0x5e3a('0x3e')){var _0x4a2c61=fs[_0x5e3a('0x3f')](path[_0x5e3a('0x40')](config[_0x5e3a('0x41')],_0x5e3a('0x42')),'utf8');var _0x1b3772=ejs['render'](_0x4a2c61,{'networks':_0x2c6878||[]});fs[_0x5e3a('0x43')]('/etc/asterisk/stun_xcally.conf',_0x1b3772);return respondWithRpcPromise('Reload',_0x5e3a('0x3c'),{'module':_0x5e3a('0x44')});}else if(_0x360a38['type'][_0x5e3a('0x45')]()==_0x5e3a('0x46')){var _0x9587a8=fs[_0x5e3a('0x3f')](path[_0x5e3a('0x40')](config[_0x5e3a('0x41')],_0x5e3a('0x47')),_0x5e3a('0x48'));var _0x2098d6=ejs[_0x5e3a('0x49')](_0x9587a8,{'networks':_0x2c6878||[]});fs['writeFileSync'](_0x5e3a('0x4a'),_0x2098d6);return respondWithRpcPromise('Reload',_0x5e3a('0x3c'),{'module':_0x5e3a('0x44')});}else{var _0x7df294=fs[_0x5e3a('0x3f')](path[_0x5e3a('0x40')](config['root'],_0x5e3a('0x4b')),_0x5e3a('0x48'));var _0x49b573=ejs[_0x5e3a('0x49')](_0x7df294,{'networks':_0x2c6878||[]});fs[_0x5e3a('0x43')](util[_0x5e3a('0x4c')](_0x5e3a('0x4d'),_0x372b36[_0x5e3a('0x3d')][_0x5e3a('0x25')]['toLowerCase']()),_0x49b573);return respondWithRpcPromise('Reload',_0x5e3a('0x3c'),{'module':'chan_sip.so'});}})['then'](function(){return _0x360a38;})[_0x5e3a('0x8')](respondWithResult(_0x4d467b,0xc9))[_0x5e3a('0x10')](handleError(_0x4d467b,null));};exports[_0x5e3a('0x19')]=function(_0x5636e8,_0x18629b){var _0x2a09dd;return db[_0x5e3a('0x22')][_0x5e3a('0x3b')]({'where':{'id':_0x5636e8[_0x5e3a('0x4e')]['id']}})[_0x5e3a('0x8')](handleEntityNotFound(_0x18629b,null))[_0x5e3a('0x8')](saveUpdates(_0x5636e8['body'],null))[_0x5e3a('0x8')](function(_0x496dfe){if(_0x496dfe){_0x2a09dd=_0x496dfe;return db[_0x5e3a('0x22')][_0x5e3a('0x37')]({'where':{'type':_0x2a09dd[_0x5e3a('0x25')]},'raw':!![]});}return null;})[_0x5e3a('0x8')](function(_0x420dee){if(_0x2a09dd[_0x5e3a('0x25')][_0x5e3a('0x45')]()=='STUN'){var _0x5eede1=fs[_0x5e3a('0x3f')](path[_0x5e3a('0x40')](config[_0x5e3a('0x41')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x122f56=ejs[_0x5e3a('0x49')](_0x5eede1,{'networks':_0x420dee||[]});fs[_0x5e3a('0x43')](_0x5e3a('0x4f'),_0x122f56);return respondWithRpcPromise(_0x5e3a('0x50'),_0x5e3a('0x19'),{'module':_0x5e3a('0x44')});}else if(_0x2a09dd[_0x5e3a('0x25')][_0x5e3a('0x45')]()==_0x5e3a('0x46')){var _0x5351f2=fs[_0x5e3a('0x3f')](path[_0x5e3a('0x40')](config['root'],_0x5e3a('0x47')),_0x5e3a('0x48'));var _0xc0cadd=ejs[_0x5e3a('0x49')](_0x5351f2,{'networks':_0x420dee||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xc0cadd);return respondWithRpcPromise(_0x5e3a('0x50'),_0x5e3a('0x19'),{'module':_0x5e3a('0x44')});}else{var _0xa7a9ff=fs[_0x5e3a('0x3f')](path['join'](config[_0x5e3a('0x41')],_0x5e3a('0x4b')),_0x5e3a('0x48'));var _0xba138c=ejs['render'](_0xa7a9ff,{'networks':_0x420dee||[]});fs['writeFileSync'](util[_0x5e3a('0x4c')](_0x5e3a('0x4d'),_0x5636e8[_0x5e3a('0x3d')][_0x5e3a('0x25')][_0x5e3a('0x51')]()),_0xba138c);return respondWithRpcPromise(_0x5e3a('0x50'),_0x5e3a('0x19'),{'module':'chan_sip.so'});}})[_0x5e3a('0x8')](function(_0x2a82e1){if(_0x2a82e1){return _0x2a09dd;}return null;})[_0x5e3a('0x8')](respondWithResult(_0x18629b,null))[_0x5e3a('0x10')](handleError(_0x18629b,null));};exports[_0x5e3a('0x1a')]=function(_0x56b8f6,_0x3e943b){var _0x5385b4;return db[_0x5e3a('0x22')]['find']({'where':{'id':_0x56b8f6[_0x5e3a('0x4e')]['id']}})['then'](function(_0x371f9c){_0x5385b4=_0x371f9c;return _0x371f9c;})[_0x5e3a('0x8')](handleEntityNotFound(_0x3e943b,null))[_0x5e3a('0x8')](removeEntity(_0x3e943b,null))[_0x5e3a('0x8')](function(){if(_0x5385b4){return db[_0x5e3a('0x22')]['findAll']({'where':{'type':_0x5385b4[_0x5e3a('0x25')]},'raw':!![]});}})['then'](function(_0x2e4134){if(_0x5385b4['type'][_0x5e3a('0x45')]()=='STUN'){var _0x2d7bb6=fs[_0x5e3a('0x3f')](path[_0x5e3a('0x40')](config[_0x5e3a('0x41')],_0x5e3a('0x42')),_0x5e3a('0x48'));var _0x388989=ejs[_0x5e3a('0x49')](_0x2d7bb6,{'networks':_0x2e4134||[]});fs[_0x5e3a('0x43')](_0x5e3a('0x4f'),_0x388989);return respondWithRpcPromise(_0x5e3a('0x50'),_0x5e3a('0x1a'),{'module':'res_stun_monitor.so'});}else if(_0x5385b4[_0x5e3a('0x25')][_0x5e3a('0x45')]()=='TURN'){var _0x429f49=fs['readFileSync'](path['join'](config[_0x5e3a('0x41')],_0x5e3a('0x47')),_0x5e3a('0x48'));var _0x294d60=ejs['render'](_0x429f49,{'networks':_0x2e4134||[]});fs[_0x5e3a('0x43')](_0x5e3a('0x4a'),_0x294d60);return respondWithRpcPromise(_0x5e3a('0x50'),'destroy',{'module':_0x5e3a('0x44')});}else{var _0x146610=fs['readFileSync'](path[_0x5e3a('0x40')](config[_0x5e3a('0x41')],'server/files/templates/network.ejs'),_0x5e3a('0x48'));var _0x904968=ejs[_0x5e3a('0x49')](_0x146610,{'networks':_0x2e4134||[]});fs[_0x5e3a('0x43')](util[_0x5e3a('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x5385b4[_0x5e3a('0x25')][_0x5e3a('0x51')]()),_0x904968);return respondWithRpcPromise('Reload',_0x5e3a('0x1a'),{'module':'chan_sip.so'});}})[_0x5e3a('0x10')](handleError(_0x3e943b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 0af07c4..83416d1 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 _0xd139=['rimraf','../../config/environment','./network.attributes','Network','lodash','util','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd139,0x14e));var _0x9d13=function(_0x12fd15,_0x59601a){_0x12fd15=_0x12fd15-0x0;var _0x43d2aa=_0xd139[_0x12fd15];return _0x43d2aa;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d13('0x2'));var BPromise=require(_0x9d13('0x3'));var rp=require(_0x9d13('0x4'));var fs=require('fs');var path=require(_0x9d13('0x5'));var rimraf=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var attributes=require(_0x9d13('0x8'));module['exports']=function(_0x4c8e60,_0x2918eb){return _0x4c8e60['define'](_0x9d13('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9434=['api','moment','bluebird','path','rimraf','./network.attributes','exports','network','lodash','util','../../config/logger'];(function(_0x4586ff,_0x1873a5){var _0x2211b2=function(_0x1e51de){while(--_0x1e51de){_0x4586ff['push'](_0x4586ff['shift']());}};_0x2211b2(++_0x1873a5);}(_0x9434,0x168));var _0x4943=function(_0x795b66,_0x7a630a){_0x795b66=_0x795b66-0x0;var _0x92b560=_0x9434[_0x795b66];return _0x92b560;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var logger=require(_0x4943('0x2'))(_0x4943('0x3'));var moment=require(_0x4943('0x4'));var BPromise=require(_0x4943('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4943('0x6'));var rimraf=require(_0x4943('0x7'));var config=require('../../config/environment');var attributes=require(_0x4943('0x8'));module[_0x4943('0x9')]=function(_0x4f930e,_0x394d9d){return _0x4f930e['define']('Network',attributes,{'tableName':_0x4943('0xa'),'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 f1b3069..8ae6c98 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x592f01,_0x12d206){var _0x11ee13=function(_0x34e5e5){while(--_0x34e5e5){_0x592f01['push'](_0x592f01['shift']());}};_0x11ee13(++_0x12d206);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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']('Network,\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);});});} \ No newline at end of file +var _0x7a54=['info','Network,\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(_0xf41b55,_0x9fcd62){_0xf41b55=_0xf41b55-0x0;var _0x5251bd=_0x7a54[_0xf41b55];return _0x5251bd;};'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')]('Network,\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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 017debc..ac2ed9c 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 _0xc49b=['getApplications','/:id/users','getAgents','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','notify','addApplications','addAgents','/:id/send','put','removeDispositions','removeAnswers','delete','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','getAnswers','/:id/applications'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc49b,0x7e));var _0xbc49=function(_0x358e06,_0x11975c){_0x358e06=_0x358e06-0x0;var _0x567433=_0xc49b[_0x358e06];return _0x567433;};'use strict';var multer=require(_0xbc49('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbc49('0x1'));var express=require(_0xbc49('0x2'));var router=express[_0xbc49('0x3')]();var fs_extra=require(_0xbc49('0x4'));var auth=require(_0xbc49('0x5'));var interaction=require(_0xbc49('0x6'));var config=require(_0xbc49('0x7'));var controller=require(_0xbc49('0x8'));router[_0xbc49('0x9')]('/',auth[_0xbc49('0xa')](),controller[_0xbc49('0xb')]);router[_0xbc49('0x9')](_0xbc49('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xbc49('0x9')](_0xbc49('0xd'),auth[_0xbc49('0xa')](),controller[_0xbc49('0xe')]);router[_0xbc49('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xbc49('0xf')]);router[_0xbc49('0x9')]('/:id/canned_answers',auth[_0xbc49('0xa')](),controller[_0xbc49('0x10')]);router[_0xbc49('0x9')](_0xbc49('0x11'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x12')]);router[_0xbc49('0x9')]('/:id/interactions',auth[_0xbc49('0xa')](),controller['getInteractions']);router['get'](_0xbc49('0x13'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x14')]);router['post']('/',auth[_0xbc49('0xa')](),controller['create']);router['post'](_0xbc49('0x15'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x16')]);router[_0xbc49('0x17')](_0xbc49('0x18'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x19')]);router['post']('/:id/notify',controller[_0xbc49('0x1a')]);router[_0xbc49('0x17')](_0xbc49('0x11'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x1b')]);router[_0xbc49('0x17')](_0xbc49('0x13'),auth['isAuthenticated'](),controller[_0xbc49('0x1c')]);router[_0xbc49('0x17')](_0xbc49('0x1d'),auth['isAuthenticated'](),controller['send']);router[_0xbc49('0x1e')](_0xbc49('0xd'),auth[_0xbc49('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xbc49('0x15'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x1f')]);router['delete'](_0xbc49('0x18'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x20')]);router[_0xbc49('0x21')](_0xbc49('0x13'),auth[_0xbc49('0xa')](),controller[_0xbc49('0x22')]);module[_0xbc49('0x23')]=router; \ No newline at end of file +var _0x4387=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express'];(function(_0x16d0c5,_0x3a6355){var _0x1f17f7=function(_0x3936dc){while(--_0x3936dc){_0x16d0c5['push'](_0x16d0c5['shift']());}};_0x1f17f7(++_0x3a6355);}(_0x4387,0xf3));var _0x7438=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4387[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7438('0x0'));var timeout=require(_0x7438('0x1'));var express=require(_0x7438('0x2'));var router=express[_0x7438('0x3')]();var fs_extra=require(_0x7438('0x4'));var auth=require(_0x7438('0x5'));var interaction=require(_0x7438('0x6'));var config=require(_0x7438('0x7'));var controller=require(_0x7438('0x8'));router[_0x7438('0x9')]('/',auth[_0x7438('0xa')](),controller[_0x7438('0xb')]);router[_0x7438('0x9')](_0x7438('0xc'),auth[_0x7438('0xa')](),controller[_0x7438('0xd')]);router[_0x7438('0x9')](_0x7438('0xe'),auth[_0x7438('0xa')](),controller[_0x7438('0xf')]);router[_0x7438('0x9')](_0x7438('0x10'),auth[_0x7438('0xa')](),controller[_0x7438('0x11')]);router['get']('/:id/canned_answers',auth[_0x7438('0xa')](),controller['getAnswers']);router[_0x7438('0x9')](_0x7438('0x12'),auth[_0x7438('0xa')](),controller[_0x7438('0x13')]);router[_0x7438('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7438('0x14')]);router['get'](_0x7438('0x15'),auth[_0x7438('0xa')](),controller[_0x7438('0x16')]);router['post']('/',auth[_0x7438('0xa')](),controller[_0x7438('0x17')]);router[_0x7438('0x18')](_0x7438('0x10'),auth['isAuthenticated'](),controller[_0x7438('0x19')]);router[_0x7438('0x18')](_0x7438('0x1a'),auth[_0x7438('0xa')](),controller[_0x7438('0x1b')]);router[_0x7438('0x18')](_0x7438('0x1c'),controller[_0x7438('0x1d')]);router[_0x7438('0x18')]('/:id/applications',auth[_0x7438('0xa')](),controller[_0x7438('0x1e')]);router[_0x7438('0x18')](_0x7438('0x15'),auth[_0x7438('0xa')](),controller[_0x7438('0x1f')]);router[_0x7438('0x18')](_0x7438('0x20'),auth[_0x7438('0xa')](),controller[_0x7438('0x21')]);router[_0x7438('0x22')]('/:id',auth[_0x7438('0xa')](),controller[_0x7438('0x23')]);router['delete']('/:id',auth[_0x7438('0xa')](),controller[_0x7438('0x24')]);router[_0x7438('0x25')](_0x7438('0x10'),auth['isAuthenticated'](),controller[_0x7438('0x26')]);router[_0x7438('0x25')](_0x7438('0x1a'),auth['isAuthenticated'](),controller[_0x7438('0x27')]);router[_0x7438('0x25')]('/:id/users',auth['isAuthenticated'](),controller[_0x7438('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index c693094..84cfaa6 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 _0x0eb9=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name'];(function(_0x13762f,_0x1a08c4){var _0x16a1c7=function(_0x5b5ab2){while(--_0x5b5ab2){_0x13762f['push'](_0x13762f['shift']());}};_0x16a1c7(++_0x1a08c4);}(_0x0eb9,0x11a));var _0x90eb=function(_0x4b6847,_0x50c4d6){_0x4b6847=_0x4b6847-0x0;var _0x562863=_0x0eb9[_0x4b6847];return _0x562863;};'use strict';var Sequelize=require(_0x90eb('0x0'));var rs=require('randomstring');module[_0x90eb('0x1')]={'name':{'type':Sequelize[_0x90eb('0x2')],'unique':_0x90eb('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x90eb('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x90eb('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x90eb('0x4');}},'notificationSound':{'type':Sequelize[_0x90eb('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x90eb('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x90eb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x90eb('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x90eb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x90eb('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x90eb('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x90eb('0x5')],'defaultValue':![],'comment':_0x90eb('0x8'),'set':function(_0x49be35){if(!_0x49be35)this[_0x90eb('0x9')](_0x90eb('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x49be35);}}}; \ No newline at end of file +var _0x1503=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x34a087,_0x4bd68e){var _0x5c15d7=function(_0x152823){while(--_0x152823){_0x34a087['push'](_0x34a087['shift']());}};_0x5c15d7(++_0x4bd68e);}(_0x1503,0x8d));var _0x3150=function(_0x4b1e6d,_0x30049c){_0x4b1e6d=_0x4b1e6d-0x0;var _0x21ee48=_0x1503[_0x4b1e6d];return _0x21ee48;};'use strict';var Sequelize=require(_0x3150('0x0'));var rs=require(_0x3150('0x1'));module[_0x3150('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3150('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3150('0x4')]},'token':{'type':Sequelize[_0x3150('0x4')],'defaultValue':function(){return rs[_0x3150('0x5')]();}},'replyUri':{'type':Sequelize[_0x3150('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3150('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3150('0x6')],'defaultValue':function(){return _0x3150('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3150('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3150('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3150('0x4')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3150('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3150('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3150('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3150('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x3150('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3150('0xb'),'set':function(_0x5a1d2f){if(!_0x5a1d2f)this[_0x3150('0xc')](_0x3150('0xd'),null);this[_0x3150('0xc')](_0x3150('0xe'),_0x5a1d2f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index eb41527..017699d 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 _0x9b9b=['findOne','Disposition','OpenchannelAccountId','removeDispositions','ids','getAnswers','CannedAnswer','findAll','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','updatedAt','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','Contacts','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','get','OpenchannelAccounts','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9b9b,0x114));var _0xb9b9=function(_0x416cea,_0x7d4ee0){_0x416cea=_0x416cea-0x0;var _0x43fdd4=_0x9b9b[_0x416cea];return _0x43fdd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9b9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb9b9('0x1'));var moment=require(_0xb9b9('0x2'));var BPromise=require(_0xb9b9('0x3'));var Mustache=require(_0xb9b9('0x4'));var util=require(_0xb9b9('0x5'));var path=require(_0xb9b9('0x6'));var sox=require(_0xb9b9('0x7'));var csv=require(_0xb9b9('0x8'));var ejs=require(_0xb9b9('0x9'));var fs=require('fs');var fs_extra=require(_0xb9b9('0xa'));var _=require(_0xb9b9('0xb'));var squel=require(_0xb9b9('0xc'));var crypto=require(_0xb9b9('0xd'));var jsforce=require(_0xb9b9('0xe'));var deskjs=require(_0xb9b9('0xf'));var toCsv=require(_0xb9b9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb9b9('0x10'));var authService=require(_0xb9b9('0x11'));var qs=require(_0xb9b9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9b9('0x13'));var logger=require(_0xb9b9('0x14'))(_0xb9b9('0x15'));var utils=require('../../config/utils');var config=require(_0xb9b9('0x16'));var licenseUtil=require(_0xb9b9('0x17'));var db=require(_0xb9b9('0x18'))['db'];config[_0xb9b9('0x19')]=_[_0xb9b9('0x1a')](config[_0xb9b9('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9b9('0x19')]));require('./openchannelAccount.socket')[_0xb9b9('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb9b9('0x1c')][_0xb9b9('0x1d')]({'port':0x232c});var client9002=jayson[_0xb9b9('0x1c')][_0xb9b9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x177ad9,_0x3fd09c,_0x42a55f,_0x2b2e3d){return new BPromise(function(_0x4ae8e6,_0x29689a){var _0x48d9ae=_0x2b2e3d||client;return _0x48d9ae[_0xb9b9('0x1e')](_0x177ad9,_0x42a55f)[_0xb9b9('0x1f')](function(_0x3a2fed){logger[_0xb9b9('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x3fd09c,_0xb9b9('0x21'));logger[_0xb9b9('0x22')](_0xb9b9('0x23'),_0x3fd09c,_0xb9b9('0x21'),JSON[_0xb9b9('0x24')](_0x3a2fed));if(_0x3a2fed[_0xb9b9('0x25')]){if(_0x3a2fed[_0xb9b9('0x25')][_0xb9b9('0x26')]===0x1f4){logger[_0xb9b9('0x25')](_0xb9b9('0x27'),_0x3fd09c,_0x3a2fed[_0xb9b9('0x25')][_0xb9b9('0x28')]);return _0x29689a(_0x3a2fed[_0xb9b9('0x25')]['message']);}logger[_0xb9b9('0x25')](_0xb9b9('0x27'),_0x3fd09c,_0x3a2fed[_0xb9b9('0x25')]['message']);return _0x4ae8e6(_0x3a2fed[_0xb9b9('0x25')][_0xb9b9('0x28')]);}else{logger['info'](_0xb9b9('0x27'),_0x3fd09c,_0xb9b9('0x21'));_0x4ae8e6(_0x3a2fed[_0xb9b9('0x29')][_0xb9b9('0x28')]);}})[_0xb9b9('0x2a')](function(_0x5299fb){logger['error'](_0xb9b9('0x27'),_0x3fd09c,_0x5299fb);_0x29689a(_0x5299fb);});});}function respondWithStatusCode(_0x426f2c,_0x48014a){_0x48014a=_0x48014a||0xcc;return function(_0x30ac24){if(_0x30ac24){return _0x426f2c[_0xb9b9('0x2b')](_0x48014a);}return _0x426f2c[_0xb9b9('0x2c')](_0x48014a)[_0xb9b9('0x2d')]();};}function respondWithResult(_0x125f6c,_0x54bf18){_0x54bf18=_0x54bf18||0xc8;return function(_0x388042){if(_0x388042){return _0x125f6c['status'](_0x54bf18)[_0xb9b9('0x2e')](_0x388042);}};}function respondWithFilteredResult(_0xe28f3c,_0x4f47da){return function(_0x1b53e1){if(_0x1b53e1){var _0x31b509=typeof _0x4f47da[_0xb9b9('0x2f')]==='undefined'&&typeof _0x4f47da[_0xb9b9('0x30')]===_0xb9b9('0x31');var _0x2e1d12=_0x1b53e1[_0xb9b9('0x32')];var _0x4f002a=_0x31b509?0x0:_0x4f47da[_0xb9b9('0x2f')];var _0xdbc1f1=_0x31b509?_0x1b53e1['count']:_0x4f47da[_0xb9b9('0x2f')]+_0x4f47da[_0xb9b9('0x30')];var _0x247e8d;if(_0xdbc1f1>=_0x2e1d12){_0xdbc1f1=_0x2e1d12;_0x247e8d=0xc8;}else{_0x247e8d=0xce;}_0xe28f3c[_0xb9b9('0x2c')](_0x247e8d);return _0xe28f3c['set'](_0xb9b9('0x33'),_0x4f002a+'-'+_0xdbc1f1+'/'+_0x2e1d12)[_0xb9b9('0x2e')](_0x1b53e1);}return null;};}function patchUpdates(_0x28e2da){return function(_0x2f68c5){try{jsonpatch['apply'](_0x2f68c5,_0x28e2da,!![]);}catch(_0x2b8069){return BPromise[_0xb9b9('0x34')](_0x2b8069);}return _0x2f68c5['save']();};}function saveUpdates(_0x126fe2,_0x12679d){return function(_0x34d942){if(_0x34d942){return _0x34d942[_0xb9b9('0x35')](_0x126fe2)[_0xb9b9('0x1f')](function(_0x17f3c3){return _0x17f3c3;});}return null;};}function removeEntity(_0x5e10c9,_0x2c5d2d){return function(_0x237c44){if(_0x237c44){return _0x237c44['destroy']()[_0xb9b9('0x1f')](function(){var _0x3bbfa1=_0x237c44[_0xb9b9('0x36')]({'plain':!![]});var _0x5837c0=_0xb9b9('0x37');return db['UserProfileResource'][_0xb9b9('0x38')]({'where':{'type':_0x5837c0,'resourceId':_0x3bbfa1['id']}})['then'](function(){return _0x237c44;});})[_0xb9b9('0x1f')](function(){_0x5e10c9[_0xb9b9('0x2c')](0xcc)[_0xb9b9('0x2d')]();});}};}function handleEntityNotFound(_0x1f1faf,_0x3dd3fe){return function(_0x76f4d4){if(!_0x76f4d4){_0x1f1faf[_0xb9b9('0x2b')](0x194);}return _0x76f4d4;};}function handleError(_0x4960e1,_0x57396a){_0x57396a=_0x57396a||0x1f4;return function(_0xb54d68){logger[_0xb9b9('0x25')](_0xb54d68[_0xb9b9('0x39')]);if(_0xb54d68['name']){delete _0xb54d68[_0xb9b9('0x3a')];}_0x4960e1['status'](_0x57396a)[_0xb9b9('0x3b')](_0xb54d68);};}exports[_0xb9b9('0x3c')]=function(_0xc07d78,_0x21c1e4){var _0x46abe7={'include':[{'model':db[_0xb9b9('0x3d')],'as':_0xb9b9('0x3e')}]},_0x1d3a53={},_0x15baa2={'count':0x0,'rows':[]};var _0x40058c=_['map'](db[_0xb9b9('0x3f')][_0xb9b9('0x40')],function(_0x382131){return{'name':_0x382131[_0xb9b9('0x41')],'type':_0x382131[_0xb9b9('0x42')][_0xb9b9('0x43')]};});_0x1d3a53[_0xb9b9('0x44')]=_[_0xb9b9('0x45')](_0x40058c,_0xb9b9('0x3a'));_0x1d3a53[_0xb9b9('0x46')]=_['keys'](_0xc07d78[_0xb9b9('0x46')]);_0x1d3a53[_0xb9b9('0x47')]=_[_0xb9b9('0x48')](_0x1d3a53[_0xb9b9('0x44')],_0x1d3a53['query']);_0x46abe7[_0xb9b9('0x49')]=_['intersection'](_0x1d3a53['model'],qs[_0xb9b9('0x4a')](_0xc07d78[_0xb9b9('0x46')]['fields']));_0x46abe7['attributes']=_0x46abe7[_0xb9b9('0x49')][_0xb9b9('0x4b')]?_0x46abe7[_0xb9b9('0x49')]:_0x1d3a53[_0xb9b9('0x44')];if(!_0xc07d78['query'][_0xb9b9('0x4c')](_0xb9b9('0x4d'))){_0x46abe7[_0xb9b9('0x30')]=qs['limit'](_0xc07d78['query'][_0xb9b9('0x30')]);_0x46abe7['offset']=qs[_0xb9b9('0x2f')](_0xc07d78[_0xb9b9('0x46')][_0xb9b9('0x2f')]);}_0x46abe7[_0xb9b9('0x4e')]=qs['sort'](_0xc07d78[_0xb9b9('0x46')][_0xb9b9('0x4f')]);_0x46abe7[_0xb9b9('0x50')]=qs[_0xb9b9('0x47')](_[_0xb9b9('0x51')](_0xc07d78[_0xb9b9('0x46')],_0x1d3a53[_0xb9b9('0x47')]),_0x40058c);if(_0xc07d78[_0xb9b9('0x46')][_0xb9b9('0x52')]){_0x46abe7[_0xb9b9('0x50')]=_[_0xb9b9('0x53')](_0x46abe7[_0xb9b9('0x50')],{'$or':_['map'](_0x40058c,function(_0x18a671){if(_0x18a671['type']!==_0xb9b9('0x54')){var _0x3d5e02={};_0x3d5e02[_0x18a671[_0xb9b9('0x3a')]]={'$like':'%'+_0xc07d78[_0xb9b9('0x46')]['filter']+'%'};return _0x3d5e02;}})});}_0x46abe7=_[_0xb9b9('0x53')]({},_0x46abe7,_0xc07d78['options']);var _0x2b3e22={'where':_0x46abe7[_0xb9b9('0x50')]};return db[_0xb9b9('0x3f')][_0xb9b9('0x32')](_0x2b3e22)[_0xb9b9('0x1f')](function(_0x1564af){_0x15baa2[_0xb9b9('0x32')]=_0x1564af;if(_0xc07d78[_0xb9b9('0x46')][_0xb9b9('0x55')]){_0x46abe7[_0xb9b9('0x56')]=[{'all':!![]}];}return db[_0xb9b9('0x3f')]['findAll'](_0x46abe7);})['then'](function(_0x4da7d8){_0x15baa2[_0xb9b9('0x57')]=_0x4da7d8;return _0x15baa2;})['then'](respondWithFilteredResult(_0x21c1e4,_0x46abe7))[_0xb9b9('0x2a')](handleError(_0x21c1e4,null));};exports[_0xb9b9('0x58')]=function(_0x3a9d1b,_0xd4de4b){var _0x4b2b9a={'raw':![],'where':{'id':_0x3a9d1b[_0xb9b9('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xb9b9('0x3e')}]},_0x39c444={};_0x39c444[_0xb9b9('0x44')]=_['keys'](db['OpenchannelAccount'][_0xb9b9('0x40')]);_0x39c444[_0xb9b9('0x46')]=_[_0xb9b9('0x5a')](_0x3a9d1b['query']);_0x39c444[_0xb9b9('0x47')]=_[_0xb9b9('0x48')](_0x39c444['model'],_0x39c444[_0xb9b9('0x46')]);_0x4b2b9a[_0xb9b9('0x49')]=_[_0xb9b9('0x48')](_0x39c444[_0xb9b9('0x44')],qs['fields'](_0x3a9d1b[_0xb9b9('0x46')][_0xb9b9('0x4a')]));_0x4b2b9a[_0xb9b9('0x49')]=_0x4b2b9a['attributes'][_0xb9b9('0x4b')]?_0x4b2b9a[_0xb9b9('0x49')]:_0x39c444[_0xb9b9('0x44')];if(_0x3a9d1b[_0xb9b9('0x46')][_0xb9b9('0x55')]){_0x4b2b9a['include']=[{'all':!![]}];}_0x4b2b9a=_['merge']({},_0x4b2b9a,_0x3a9d1b[_0xb9b9('0x5b')]);return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')](_0x4b2b9a)[_0xb9b9('0x1f')](handleEntityNotFound(_0xd4de4b,null))[_0xb9b9('0x1f')](respondWithResult(_0xd4de4b,null))['catch'](handleError(_0xd4de4b,null));};exports[_0xb9b9('0x5d')]=function(_0x30e19e,_0x184f9b){return db[_0xb9b9('0x3f')][_0xb9b9('0x5d')](_0x30e19e['body'],{})[_0xb9b9('0x1f')](function(_0x2da6ad){var _0x1a34b6=_0x30e19e[_0xb9b9('0x5e')]['get']({'plain':!![]});if(!_0x1a34b6)throw new Error(_0xb9b9('0x5f'));if(_0x1a34b6['role']===_0xb9b9('0x5e')){var _0x51a5b0=_0x2da6ad[_0xb9b9('0x36')]({'plain':!![]});var _0x386f85=_0xb9b9('0x37');return db[_0xb9b9('0x60')][_0xb9b9('0x5c')]({'where':{'name':_0x386f85,'userProfileId':_0x1a34b6[_0xb9b9('0x61')]},'raw':!![]})[_0xb9b9('0x1f')](function(_0x13add3){if(_0x13add3&&_0x13add3['autoAssociation']===0x0){return db[_0xb9b9('0x62')][_0xb9b9('0x5d')]({'name':_0x51a5b0[_0xb9b9('0x3a')],'resourceId':_0x51a5b0['id'],'type':_0x13add3['name'],'sectionId':_0x13add3['id']},{})[_0xb9b9('0x1f')](function(){return _0x2da6ad;});}else{return _0x2da6ad;}})[_0xb9b9('0x2a')](function(_0x412a7b){logger[_0xb9b9('0x25')](_0xb9b9('0x63'),_0x412a7b);throw _0x412a7b;});}return _0x2da6ad;})[_0xb9b9('0x1f')](respondWithResult(_0x184f9b,0xc9))['catch'](handleError(_0x184f9b,null));};exports[_0xb9b9('0x35')]=function(_0x30d113,_0x32e3d1){if(_0x30d113[_0xb9b9('0x64')]['id']){delete _0x30d113[_0xb9b9('0x64')]['id'];}return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0x30d113[_0xb9b9('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xb9b9('0x3e')}]})[_0xb9b9('0x1f')](handleEntityNotFound(_0x32e3d1,null))[_0xb9b9('0x1f')](saveUpdates(_0x30d113['body'],null))[_0xb9b9('0x1f')](respondWithResult(_0x32e3d1,null))[_0xb9b9('0x2a')](handleError(_0x32e3d1,null));};exports['destroy']=function(_0x156bf3,_0x35c05b){return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0x156bf3[_0xb9b9('0x59')]['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x35c05b,null))['then'](removeEntity(_0x35c05b,null))[_0xb9b9('0x2a')](handleError(_0x35c05b,null));};exports[_0xb9b9('0x65')]=function(_0xff2dc0,_0x21ed42){return db[_0xb9b9('0x3f')]['describe']()['then'](respondWithResult(_0x21ed42,null))[_0xb9b9('0x2a')](handleError(_0x21ed42,null));};exports[_0xb9b9('0x66')]=function(_0x171ebc,_0x53159a,_0x30cf13){if(_0x171ebc['body']['id']){delete _0x171ebc[_0xb9b9('0x64')]['id'];}return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0x171ebc[_0xb9b9('0x59')]['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x53159a,null))[_0xb9b9('0x1f')](function(_0x2fbc92){if(_0x2fbc92){_0x171ebc['body']['OpenchannelAccountId']=_0x2fbc92['id'];return db['Disposition']['create'](_0x171ebc['body']);}})[_0xb9b9('0x1f')](respondWithResult(_0x53159a,null))[_0xb9b9('0x2a')](handleError(_0x53159a,null));};exports[_0xb9b9('0x67')]=function(_0xa940e2,_0x318da6,_0x529b44){var _0x34c088={'raw':![],'where':{}};var _0x4c88f0={};var _0x457a3a={'count':0x0,'rows':[]};return db[_0xb9b9('0x3f')][_0xb9b9('0x68')]({'where':{'id':_0xa940e2[_0xb9b9('0x59')]['id']}})['then'](handleEntityNotFound(_0x318da6,null))['then'](function(_0x1039e9){if(_0x1039e9){_0x4c88f0[_0xb9b9('0x44')]=_[_0xb9b9('0x5a')](db[_0xb9b9('0x69')][_0xb9b9('0x40')]);_0x4c88f0['query']=_['keys'](_0xa940e2[_0xb9b9('0x46')]);_0x4c88f0[_0xb9b9('0x47')]=_[_0xb9b9('0x48')](_0x4c88f0[_0xb9b9('0x44')],_0x4c88f0[_0xb9b9('0x46')]);_0x34c088['attributes']=_[_0xb9b9('0x48')](_0x4c88f0[_0xb9b9('0x44')],qs[_0xb9b9('0x4a')](_0xa940e2[_0xb9b9('0x46')][_0xb9b9('0x4a')]));_0x34c088['attributes']=_0x34c088['attributes'][_0xb9b9('0x4b')]?_0x34c088[_0xb9b9('0x49')]:_0x4c88f0[_0xb9b9('0x44')];if(!_0xa940e2[_0xb9b9('0x46')]['hasOwnProperty'](_0xb9b9('0x4d'))){_0x34c088[_0xb9b9('0x30')]=qs[_0xb9b9('0x30')](_0xa940e2[_0xb9b9('0x46')]['limit']);_0x34c088[_0xb9b9('0x2f')]=qs[_0xb9b9('0x2f')](_0xa940e2['query'][_0xb9b9('0x2f')]);}_0x34c088[_0xb9b9('0x4e')]=qs['sort'](_0xa940e2[_0xb9b9('0x46')]['sort']);_0x34c088[_0xb9b9('0x50')]=qs['filters'](_['pick'](_0xa940e2[_0xb9b9('0x46')],_0x4c88f0[_0xb9b9('0x47')]));_0x34c088[_0xb9b9('0x50')][_0xb9b9('0x6a')]=_0x1039e9['id'];if(_0xa940e2[_0xb9b9('0x46')][_0xb9b9('0x52')]){_0x34c088[_0xb9b9('0x50')]=_[_0xb9b9('0x53')](_0x34c088[_0xb9b9('0x50')],{'$or':_['map'](_0x34c088[_0xb9b9('0x49')],function(_0x551497){var _0x478b6d={};_0x478b6d[_0x551497]={'$like':'%'+_0xa940e2['query'][_0xb9b9('0x52')]+'%'};return _0x478b6d;})});}_0x34c088=_['merge']({},_0x34c088,_0xa940e2['options']);return db[_0xb9b9('0x69')]['count']({'where':_0x34c088[_0xb9b9('0x50')]})[_0xb9b9('0x1f')](function(_0x2a03f7){_0x457a3a['count']=_0x2a03f7;if(_0xa940e2[_0xb9b9('0x46')]['includeAll']){_0x34c088[_0xb9b9('0x56')]=[{'all':!![]}];}return db[_0xb9b9('0x69')]['findAll'](_0x34c088);})[_0xb9b9('0x1f')](function(_0x4d123c){_0x457a3a[_0xb9b9('0x57')]=_0x4d123c;return _0x457a3a;});}})[_0xb9b9('0x1f')](respondWithFilteredResult(_0x318da6,_0x34c088))[_0xb9b9('0x2a')](handleError(_0x318da6,null));};exports['removeDispositions']=function(_0x355074,_0x34737a,_0x34c424){return db['OpenchannelAccount'][_0xb9b9('0x5c')]({'where':{'id':_0x355074[_0xb9b9('0x59')]['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x34737a,null))[_0xb9b9('0x1f')](function(_0x5b6500){if(_0x5b6500){return _0x5b6500[_0xb9b9('0x6b')](_0x355074[_0xb9b9('0x46')][_0xb9b9('0x6c')]);}})[_0xb9b9('0x1f')](respondWithStatusCode(_0x34737a,null))[_0xb9b9('0x2a')](handleError(_0x34737a,null));};exports['addAnswer']=function(_0x498798,_0x23db94,_0x144494){if(_0x498798[_0xb9b9('0x64')]['id']){delete _0x498798[_0xb9b9('0x64')]['id'];}return db['OpenchannelAccount'][_0xb9b9('0x5c')]({'where':{'id':_0x498798['params']['id']}})['then'](handleEntityNotFound(_0x23db94,null))[_0xb9b9('0x1f')](function(_0x32a022){if(_0x32a022){_0x498798['body']['OpenchannelAccountId']=_0x32a022['id'];return db['CannedAnswer']['create'](_0x498798[_0xb9b9('0x64')]);}})[_0xb9b9('0x1f')](respondWithResult(_0x23db94,null))['catch'](handleError(_0x23db94,null));};exports[_0xb9b9('0x6d')]=function(_0x5921ee,_0x13fa22,_0x20b334){var _0xa84c14={'raw':![],'where':{}};var _0x2c118f={};var _0x1a44d4={'count':0x0,'rows':[]};return db[_0xb9b9('0x3f')][_0xb9b9('0x68')]({'where':{'id':_0x5921ee[_0xb9b9('0x59')]['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x13fa22,null))[_0xb9b9('0x1f')](function(_0x404299){if(_0x404299){_0x2c118f[_0xb9b9('0x44')]=_[_0xb9b9('0x5a')](db[_0xb9b9('0x6e')][_0xb9b9('0x40')]);_0x2c118f[_0xb9b9('0x46')]=_[_0xb9b9('0x5a')](_0x5921ee[_0xb9b9('0x46')]);_0x2c118f[_0xb9b9('0x47')]=_[_0xb9b9('0x48')](_0x2c118f[_0xb9b9('0x44')],_0x2c118f[_0xb9b9('0x46')]);_0xa84c14[_0xb9b9('0x49')]=_[_0xb9b9('0x48')](_0x2c118f[_0xb9b9('0x44')],qs['fields'](_0x5921ee[_0xb9b9('0x46')][_0xb9b9('0x4a')]));_0xa84c14[_0xb9b9('0x49')]=_0xa84c14[_0xb9b9('0x49')][_0xb9b9('0x4b')]?_0xa84c14[_0xb9b9('0x49')]:_0x2c118f[_0xb9b9('0x44')];if(!_0x5921ee[_0xb9b9('0x46')]['hasOwnProperty']('nolimit')){_0xa84c14[_0xb9b9('0x30')]=qs[_0xb9b9('0x30')](_0x5921ee[_0xb9b9('0x46')][_0xb9b9('0x30')]);_0xa84c14[_0xb9b9('0x2f')]=qs['offset'](_0x5921ee[_0xb9b9('0x46')]['offset']);}_0xa84c14['order']=qs['sort'](_0x5921ee[_0xb9b9('0x46')][_0xb9b9('0x4f')]);_0xa84c14[_0xb9b9('0x50')]=qs[_0xb9b9('0x47')](_[_0xb9b9('0x51')](_0x5921ee[_0xb9b9('0x46')],_0x2c118f['filters']));_0xa84c14['where']['OpenchannelAccountId']=_0x404299['id'];if(_0x5921ee[_0xb9b9('0x46')][_0xb9b9('0x52')]){_0xa84c14[_0xb9b9('0x50')]=_['merge'](_0xa84c14[_0xb9b9('0x50')],{'$or':_[_0xb9b9('0x45')](_0xa84c14[_0xb9b9('0x49')],function(_0x2f4229){var _0x2c4622={};_0x2c4622[_0x2f4229]={'$like':'%'+_0x5921ee[_0xb9b9('0x46')]['filter']+'%'};return _0x2c4622;})});}_0xa84c14=_[_0xb9b9('0x53')]({},_0xa84c14,_0x5921ee[_0xb9b9('0x5b')]);return db[_0xb9b9('0x6e')][_0xb9b9('0x32')]({'where':_0xa84c14['where']})['then'](function(_0x5412f7){_0x1a44d4[_0xb9b9('0x32')]=_0x5412f7;if(_0x5921ee['query'][_0xb9b9('0x55')]){_0xa84c14['include']=[{'all':!![]}];}return db[_0xb9b9('0x6e')][_0xb9b9('0x6f')](_0xa84c14);})[_0xb9b9('0x1f')](function(_0x27816c){_0x1a44d4[_0xb9b9('0x57')]=_0x27816c;return _0x1a44d4;});}})['then'](respondWithFilteredResult(_0x13fa22,_0xa84c14))[_0xb9b9('0x2a')](handleError(_0x13fa22,null));};exports[_0xb9b9('0x70')]=function(_0x4a4e91,_0x3a2aca,_0x35ad96){return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0x4a4e91['params']['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x3a2aca,null))['then'](function(_0xffbeab){if(_0xffbeab){return _0xffbeab['removeAnswers'](_0x4a4e91['query'][_0xb9b9('0x6c')]);}})[_0xb9b9('0x1f')](respondWithStatusCode(_0x3a2aca,null))[_0xb9b9('0x2a')](handleError(_0x3a2aca,null));};exports[_0xb9b9('0x71')]=function(_0xbb31d,_0xa977af,_0xf2cdbd){var _0xf82b46={'body':_0xbb31d['body'],'channel':_0xb9b9('0x72')};var _0x50028f=[];var _0x4feb3b=[];var _0x9f662e={};var _0x323360=![];return db[_0xb9b9('0x73')]['describe']()[_0xb9b9('0x1f')](function(_0x52b809){if(!_0x52b809){throw new db[(_0xb9b9('0x74'))][(_0xb9b9('0x75'))](_0xb9b9('0x76'));}_0x50028f=_[_0xb9b9('0x77')](_[_0xb9b9('0x5a')](_0x52b809),['createdAt','updatedAt']);_0x4feb3b=_[_0xb9b9('0x77')](_[_0xb9b9('0x5a')](_0x52b809),[_0xb9b9('0x78'),'updatedAt',_0xb9b9('0x79'),_0xb9b9('0x7a')]);if(_0xbb31d[_0xb9b9('0x64')]['id']){delete _0xbb31d[_0xb9b9('0x64')]['id'];}if(_[_0xb9b9('0x7b')](_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x7c')])){throw new db[(_0xb9b9('0x74'))][(_0xb9b9('0x75'))](_0xb9b9('0x7d'));}if(_['isNil'](_0xbb31d[_0xb9b9('0x64')]['body'])||_0xbb31d['body'][_0xb9b9('0x64')]===''){throw new db[(_0xb9b9('0x74'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb9b9('0x7b')](_0xbb31d['body'][_0xb9b9('0x7e')])){throw new db[(_0xb9b9('0x74'))][(_0xb9b9('0x75'))](_0xb9b9('0x7f')+_0x4feb3b);}if(!_[_0xb9b9('0x80')](_0x4feb3b,_0xbb31d['body'][_0xb9b9('0x7e')])){throw new db[(_0xb9b9('0x74'))][(_0xb9b9('0x75'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4feb3b);}_0x9f662e[_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x7e')]]=_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x7c')];})[_0xb9b9('0x1f')](function(){return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0xbb31d[_0xb9b9('0x59')]['id']},'include':[{'model':db[_0xb9b9('0x81')],'as':_0xb9b9('0x82'),'include':[{'model':db[_0xb9b9('0x73')],'as':'Contacts','where':_0x9f662e,'limit':0x1,'order':[[_0xb9b9('0x83'),_0xb9b9('0x84')]]}]},{'model':db[_0xb9b9('0x85')],'as':'Applications'}]});})[_0xb9b9('0x1f')](handleEntityNotFound(_0xa977af,null))[_0xb9b9('0x1f')](function(_0x5242e4){if(_0x5242e4&&_0x5242e4[_0xb9b9('0x82')]){_0xf82b46[_0xb9b9('0x86')]=_0x5242e4;_0xf82b46[_0xb9b9('0x87')]=_0x5242e4[_0xb9b9('0x88')];_0xf82b46[_0xb9b9('0x89')]=_0x5242e4['List'];_0xf82b46['applications']=_[_0xb9b9('0x8a')](_0xf82b46[_0xb9b9('0x87')],[_0xb9b9('0x8b')],[_0xb9b9('0x8c')]);if(_0xf82b46[_0xb9b9('0x86')]['Applications']){delete _0xf82b46[_0xb9b9('0x86')]['Applications'];}if(_0xf82b46[_0xb9b9('0x86')]['List']&&_0xf82b46[_0xb9b9('0x86')][_0xb9b9('0x82')][_0xb9b9('0x8d')][_0xb9b9('0x4b')]){return _0xf82b46['account'][_0xb9b9('0x82')][_0xb9b9('0x8d')][0x0];}var _0x30560b=_[_0xb9b9('0x1a')](_0xbb31d[_0xb9b9('0x64')],{'firstName':_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x7c')],'ListId':_0x5242e4[_0xb9b9('0x7a')]});_0x30560b[_0xbb31d[_0xb9b9('0x64')]['mapKey']]=_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x7c')];return db[_0xb9b9('0x73')]['create'](_0x30560b,{'fields':_0x50028f,'raw':!![]});}})[_0xb9b9('0x1f')](handleEntityNotFound(_0xa977af,null))[_0xb9b9('0x1f')](function(_0x5bd38a){_0xf82b46[_0xb9b9('0x8e')]=_0x5bd38a;if(_0x5bd38a){var _0x20b8ac={'ContactId':_0x5bd38a['id'],'OpenchannelAccountId':_0xbb31d[_0xb9b9('0x59')]['id'],'from':(_0x5bd38a[_0xb9b9('0x8f')]||'')+'\x20'+(_0x5bd38a[_0xb9b9('0x90')]||'')};var _0x27a1aa={'OpenchannelAccountId':_0xbb31d[_0xb9b9('0x59')]['id'],'closed':![]};if(_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x91')]){_0x27a1aa['threadId']=_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x91')];return db['OpenchannelInteraction']['find']({'where':_0x27a1aa})[_0xb9b9('0x1f')](function(_0x448c62){if(_0x448c62){return[_0x448c62,![]];}_0x20b8ac[_0xb9b9('0x91')]=_0xbb31d[_0xb9b9('0x64')]['threadId'];_0x20b8ac[_0xb9b9('0x92')]=_0xbb31d[_0xb9b9('0x64')]['externalUrl'];return db[_0xb9b9('0x93')][_0xb9b9('0x5d')](_0x20b8ac)['then'](function(_0x10fa0e){return[_0x10fa0e,!![]];});});}else{_0x27a1aa[_0xb9b9('0x91')]=null;}_0x27a1aa[_0xb9b9('0x94')]=_0x5bd38a['id'];return db['OpenchannelInteraction']['find']({'where':_0x27a1aa})[_0xb9b9('0x1f')](function(_0x263723){if(_0x263723){return[_0x263723,![]];}return db[_0xb9b9('0x93')]['create'](_0x20b8ac)[_0xb9b9('0x1f')](function(_0x93ec7b){return[_0x93ec7b,!![]];});});}})[_0xb9b9('0x95')](function(_0x298d84,_0x1f287d){if(_0x298d84){_0x323360=_0x1f287d;if(!_0x1f287d){var _0x213a44={'from':(_0xf82b46[_0xb9b9('0x8e')][_0xb9b9('0x8f')]||'')+'\x20'+(_0xf82b46['contact'][_0xb9b9('0x90')]||'')};if(_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x91')]&&_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x96')]&&_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x91')]!=_0xbb31d['body'][_0xb9b9('0x96')]){_0x213a44['threadId']=_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x96')];}return _0x298d84[_0xb9b9('0x35')](_0x213a44);}else{return _0x298d84;}}})[_0xb9b9('0x1f')](function(_0x52f6bd){_0xf82b46[_0xb9b9('0x97')]=_0x52f6bd[_0xb9b9('0x36')]({'plain':!![]});_0xf82b46[_0xb9b9('0x97')]['created']=_0x323360;if(_0xf82b46[_0xb9b9('0x97')][_0xb9b9('0x98')]){if(_0xf82b46['account'][_0xb9b9('0x99')]){_0xf82b46[_0xb9b9('0x87')][_0xb9b9('0x9a')]({'id':0x0,'priority':_0xf82b46['applications'][_0xb9b9('0x4b')]+0x1,'app':'close','appdata':_0xb9b9('0x9b'),'interval':_0xb9b9('0x9c')});}}return db[_0xb9b9('0x9d')][_0xb9b9('0x5d')]({'body':_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x64')],'OpenchannelAccountId':_0xbb31d[_0xb9b9('0x59')]['id'],'OpenchannelInteractionId':_0x52f6bd['id'],'direction':'in','ContactId':_0xf82b46[_0xb9b9('0x8e')]['id'],'AttachmentId':_0xbb31d[_0xb9b9('0x64')][_0xb9b9('0x9e')]});})['then'](function(_0x530460){_0xf82b46[_0xb9b9('0x28')]=_0x530460;if(_0xf82b46['interaction'][_0xb9b9('0x9f')]){return db[_0xb9b9('0xa0')][_0xb9b9('0x5c')]({'attributes':['id',_0xb9b9('0x3a')],'where':{'id':_0xf82b46[_0xb9b9('0x97')][_0xb9b9('0x9f')]}})[_0xb9b9('0x1f')](function(_0x1dddb8){if(_0x1dddb8){_0xf82b46[_0xb9b9('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb9b9('0xa1'),'appdata':_0x1dddb8['name']+','+(_0xf82b46['account'][_0xb9b9('0xa2')]||0xa),'interval':'*,*,*,*'});_0xf82b46['forcedOwnership']=![];}return respondWithRpcPromise('Start','startRouting',_0xf82b46);});}return respondWithRpcPromise(_0xb9b9('0xa3'),_0xb9b9('0xa4'),_0xf82b46);})['then'](function(_0xc1ac00){respondWithRpcPromise(_0xb9b9('0xa5'),_0xb9b9('0xa5'),{'event':_0xb9b9('0x71'),'message':_0xc1ac00},client9002);return _0xc1ac00;})[_0xb9b9('0x1f')](respondWithResult(_0xa977af,null))[_0xb9b9('0x2a')](handleError(_0xa977af,null));};exports[_0xb9b9('0xa6')]=function(_0x2767cb,_0x59989f){var _0x23a8a9=_0x2767cb[_0xb9b9('0x59')]['id'];var _0x478f72=_0x2767cb['body'];var _0xc85164=0xc8;var _0x150653=null;return db[_0xb9b9('0xa7')][_0xb9b9('0xa8')]({'isolationLevel':db[_0xb9b9('0xa7')]['Transaction'][_0xb9b9('0xa9')]['READ_COMMITTED']},function(_0xe5c63f){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x23a8a9},'transaction':_0xe5c63f})[_0xb9b9('0x1f')](function(_0x2d2b63){if(_0x2d2b63){return db[_0xb9b9('0x85')][_0xb9b9('0x38')]({'where':{'OpenchannelAccountId':_0x23a8a9},'transaction':_0xe5c63f})[_0xb9b9('0x1f')](function(){var _0x1717f1=_[_0xb9b9('0x45')](_0x478f72,function(_0x38237d){_0x38237d[_0xb9b9('0x6a')]=_0x23a8a9;return _0x38237d;});return db['OpenchannelApplication'][_0xb9b9('0xaa')](_0x1717f1,{'transaction':_0xe5c63f});});}else{_0xc85164=0x194;_0x150653=[];}});})['then'](function(){if(_0xc85164!==0x194){return db[_0xb9b9('0x85')][_0xb9b9('0xab')]({'where':{'OpenchannelAccountId':_0x23a8a9},'order':_0xb9b9('0x8b')})[_0xb9b9('0x1f')](function(_0x1390fd){_0x150653=_0x1390fd;});}})[_0xb9b9('0x2a')](function(_0x532436){_0xc85164=0x1f4;logger[_0xb9b9('0x25')](_0x532436[_0xb9b9('0x39')]);if(_0x532436[_0xb9b9('0x3a')]){delete _0x532436[_0xb9b9('0x3a')];}_0x150653=_0x532436;})[_0xb9b9('0xac')](function(){if(_0x150653===null){_0x59989f[_0xb9b9('0x2b')](_0xc85164);}else{if(_0xc85164===0x1f4){_0x59989f[_0xb9b9('0x2c')](_0xc85164)[_0xb9b9('0x3b')](_0x150653);}else{_0x59989f[_0xb9b9('0x2c')](_0xc85164)[_0xb9b9('0x2e')](_0x150653);}}});};exports[_0xb9b9('0xad')]=function(_0x5d041e,_0x5e581d,_0x4e5713){var _0xd72bb2={};var _0x257bb6={};var _0x400c0f;var _0x1a89f9;return db[_0xb9b9('0x3f')][_0xb9b9('0x68')]({'where':{'id':_0x5d041e[_0xb9b9('0x59')]['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x5e581d,null))[_0xb9b9('0x1f')](function(_0x483112){if(_0x483112){_0x400c0f=_0x483112;_0x257bb6[_0xb9b9('0x44')]=_[_0xb9b9('0x5a')](db[_0xb9b9('0x85')][_0xb9b9('0x40')]);_0x257bb6[_0xb9b9('0x46')]=_[_0xb9b9('0x5a')](_0x5d041e[_0xb9b9('0x46')]);_0x257bb6[_0xb9b9('0x47')]=_[_0xb9b9('0x48')](_0x257bb6[_0xb9b9('0x44')],_0x257bb6[_0xb9b9('0x46')]);_0xd72bb2[_0xb9b9('0x49')]=_[_0xb9b9('0x48')](_0x257bb6[_0xb9b9('0x44')],qs[_0xb9b9('0x4a')](_0x5d041e[_0xb9b9('0x46')]['fields']));_0xd72bb2[_0xb9b9('0x49')]=_0xd72bb2[_0xb9b9('0x49')][_0xb9b9('0x4b')]?_0xd72bb2['attributes']:_0x257bb6['model'];_0xd72bb2[_0xb9b9('0x4e')]=qs['sort'](_0x5d041e[_0xb9b9('0x46')]['sort']);_0xd72bb2[_0xb9b9('0x50')]=qs[_0xb9b9('0x47')](_[_0xb9b9('0x51')](_0x5d041e[_0xb9b9('0x46')],_0x257bb6[_0xb9b9('0x47')]));if(_0x5d041e[_0xb9b9('0x46')][_0xb9b9('0x52')]){_0xd72bb2[_0xb9b9('0x50')]=_[_0xb9b9('0x53')](_0xd72bb2[_0xb9b9('0x50')],{'$or':_[_0xb9b9('0x45')](_0xd72bb2[_0xb9b9('0x49')],function(_0x221542){var _0x596b55={};_0x596b55[_0x221542]={'$like':'%'+_0x5d041e[_0xb9b9('0x46')][_0xb9b9('0x52')]+'%'};return _0x596b55;})});}_0xd72bb2=_[_0xb9b9('0x53')]({},_0xd72bb2,_0x5d041e[_0xb9b9('0x5b')]);return _0x400c0f[_0xb9b9('0xad')](_0xd72bb2);}})[_0xb9b9('0x1f')](function(_0x1a1f2a){if(_0x1a1f2a){_0x1a89f9=_0x1a1f2a[_0xb9b9('0x4b')];if(!_0x5d041e[_0xb9b9('0x46')]['hasOwnProperty'](_0xb9b9('0x4d'))){_0xd72bb2['limit']=qs[_0xb9b9('0x30')](_0x5d041e[_0xb9b9('0x46')][_0xb9b9('0x30')]);_0xd72bb2[_0xb9b9('0x2f')]=qs[_0xb9b9('0x2f')](_0x5d041e[_0xb9b9('0x46')][_0xb9b9('0x2f')]);}return _0x400c0f[_0xb9b9('0xad')](_0xd72bb2);}})['then'](function(_0x136b1b){if(_0x136b1b){return _0x136b1b?{'count':_0x1a89f9,'rows':_0x136b1b}:null;}})['then'](respondWithResult(_0x5e581d,null))[_0xb9b9('0x2a')](handleError(_0x5e581d,null));};exports[_0xb9b9('0xae')]=function(_0x54e9c5,_0x5c9d74,_0x1d68b5){var _0xd30b39={'raw':![],'where':{}};var _0x2f016f={};var _0x1e7b3e={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x54e9c5[_0xb9b9('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c9d74,null))['then'](function(_0x455e81){if(_0x455e81){_0x2f016f[_0xb9b9('0x44')]=_[_0xb9b9('0x5a')](db[_0xb9b9('0x93')][_0xb9b9('0x40')]);_0x2f016f['query']=_[_0xb9b9('0x5a')](_0x54e9c5[_0xb9b9('0x46')]);_0x2f016f['filters']=_[_0xb9b9('0x48')](_0x2f016f['model'],_0x2f016f[_0xb9b9('0x46')]);_0xd30b39[_0xb9b9('0x49')]=_[_0xb9b9('0x48')](_0x2f016f[_0xb9b9('0x44')],qs['fields'](_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0x4a')]));_0xd30b39[_0xb9b9('0x49')]=_0xd30b39[_0xb9b9('0x49')]['length']?_0xd30b39['attributes']:_0x2f016f['model'];if(!_0x54e9c5[_0xb9b9('0x46')]['hasOwnProperty']('nolimit')){_0xd30b39[_0xb9b9('0x30')]=qs['limit'](_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0x30')]);_0xd30b39[_0xb9b9('0x2f')]=qs[_0xb9b9('0x2f')](_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0x2f')]);}_0xd30b39['order']=qs[_0xb9b9('0x4f')](_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0x4f')]);_0xd30b39[_0xb9b9('0x50')]=qs[_0xb9b9('0x47')](_[_0xb9b9('0x51')](_0x54e9c5[_0xb9b9('0x46')],_0x2f016f[_0xb9b9('0x47')]));_0xd30b39[_0xb9b9('0x50')][_0xb9b9('0x6a')]=_0x455e81['id'];if(_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0x52')]){_0xd30b39[_0xb9b9('0x50')]=_[_0xb9b9('0x53')](_0xd30b39[_0xb9b9('0x50')],{'$or':_[_0xb9b9('0x45')](_0xd30b39[_0xb9b9('0x49')],function(_0x242735){var _0x48d297={};_0x48d297[_0x242735]={'$like':'%'+_0x54e9c5['query'][_0xb9b9('0x52')]+'%'};return _0x48d297;})});}_0xd30b39=_[_0xb9b9('0x53')]({},_0xd30b39,_0x54e9c5['options']);return db['OpenchannelInteraction'][_0xb9b9('0x32')]({'where':_0xd30b39[_0xb9b9('0x50')]})[_0xb9b9('0x1f')](function(_0x1d2b2a){_0x1e7b3e[_0xb9b9('0x32')]=_0x1d2b2a;if(_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0x55')]){_0xd30b39[_0xb9b9('0x56')]=[{'model':db[_0xb9b9('0x73')],'as':_0xb9b9('0xaf'),'required':![]},{'model':db[_0xb9b9('0xa0')],'as':_0xb9b9('0xb0'),'attributes':[_0xb9b9('0x3a'),_0xb9b9('0xb1'),'internal'],'required':![]},{'model':db[_0xb9b9('0xb2')],'as':'Tags','attributes':['id',_0xb9b9('0x3a'),'color'],'where':_0x54e9c5[_0xb9b9('0x46')]['tag']?{'id':_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0xb3')]}:undefined,'required':_0x54e9c5[_0xb9b9('0x46')][_0xb9b9('0xb3')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0xd30b39);})[_0xb9b9('0x1f')](function(_0x18cae2){_0x1e7b3e[_0xb9b9('0x57')]=_0x18cae2;return _0x1e7b3e;});}})[_0xb9b9('0x1f')](respondWithFilteredResult(_0x5c9d74,_0xd30b39))[_0xb9b9('0x2a')](handleError(_0x5c9d74,null));};exports[_0xb9b9('0xb4')]=function(_0x5de7d8,_0x130c45,_0x257b32){return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0x5de7d8['params']['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x130c45,null))[_0xb9b9('0x1f')](function(_0x2d4084){if(_0x2d4084){return _0x2d4084[_0xb9b9('0xb4')](_0x5de7d8[_0xb9b9('0x64')]['ids'],_['omit'](_0x5de7d8['body'],[_0xb9b9('0x6c'),'id'])||{})[_0xb9b9('0x95')](function(_0x488cfd){for(var _0x5a80d0=0x0;_0x5a80d0<_0x5de7d8[_0xb9b9('0x64')][_0xb9b9('0x6c')][_0xb9b9('0x4b')];_0x5a80d0+=0x1){socket[_0xb9b9('0xb5')](_0xb9b9('0xb6'),{'UserId':Number(_0x5de7d8[_0xb9b9('0x64')]['ids'][_0x5a80d0]),'OpenchannelAccountId':Number(_0x5de7d8['params']['id'])});}return _0x488cfd;});}})[_0xb9b9('0x1f')](respondWithResult(_0x130c45,null))[_0xb9b9('0x2a')](handleError(_0x130c45,null));};exports[_0xb9b9('0xb7')]=function(_0x5780bf,_0x2b3f28,_0x582f16){return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0x5780bf[_0xb9b9('0x59')]['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x2b3f28,null))[_0xb9b9('0x1f')](function(_0x555e5c){if(_0x555e5c){return _0x555e5c[_0xb9b9('0xb7')](_0x5780bf['query'][_0xb9b9('0x6c')])[_0xb9b9('0x1f')](function(){if(_[_0xb9b9('0xb8')](_0x5780bf[_0xb9b9('0x46')][_0xb9b9('0x6c')])){for(var _0x26f3f1=0x0;_0x26f3f1<_0x5780bf[_0xb9b9('0x46')][_0xb9b9('0x6c')][_0xb9b9('0x4b')];_0x26f3f1+=0x1){socket[_0xb9b9('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5780bf[_0xb9b9('0x46')][_0xb9b9('0x6c')][_0x26f3f1]),'OpenchannelAccountId':Number(_0x5780bf[_0xb9b9('0x59')]['id'])});}}else{socket['emit'](_0xb9b9('0xb9'),{'UserId':Number(_0x5780bf[_0xb9b9('0x46')]['ids']),'OpenchannelAccountId':Number(_0x5780bf[_0xb9b9('0x59')]['id'])});}});}})[_0xb9b9('0x1f')](respondWithStatusCode(_0x2b3f28,null))[_0xb9b9('0x2a')](handleError(_0x2b3f28,null));};exports[_0xb9b9('0xba')]=function(_0x41a5c2,_0x11bc75,_0x177d41){var _0x5391a5={};var _0x53acda={};var _0x52a23a;var _0x2ea63a;return db[_0xb9b9('0x3f')][_0xb9b9('0x68')]({'where':{'id':_0x41a5c2['params']['id']}})['then'](handleEntityNotFound(_0x11bc75,null))[_0xb9b9('0x1f')](function(_0x20f4c8){if(_0x20f4c8){_0x52a23a=_0x20f4c8;_0x53acda[_0xb9b9('0x44')]=_[_0xb9b9('0x5a')](db['User'][_0xb9b9('0x40')]);_0x53acda[_0xb9b9('0x46')]=_[_0xb9b9('0x5a')](_0x41a5c2[_0xb9b9('0x46')]);_0x53acda[_0xb9b9('0x47')]=_['intersection'](_0x53acda[_0xb9b9('0x44')],_0x53acda[_0xb9b9('0x46')]);_0x5391a5[_0xb9b9('0x49')]=_[_0xb9b9('0x48')](_0x53acda[_0xb9b9('0x44')],qs['fields'](_0x41a5c2[_0xb9b9('0x46')][_0xb9b9('0x4a')]));_0x5391a5[_0xb9b9('0x49')]=_0x5391a5[_0xb9b9('0x49')]['length']?_0x5391a5[_0xb9b9('0x49')]:_0x53acda[_0xb9b9('0x44')];_0x5391a5['order']=qs[_0xb9b9('0x4f')](_0x41a5c2[_0xb9b9('0x46')][_0xb9b9('0x4f')]);_0x5391a5['where']=qs[_0xb9b9('0x47')](_[_0xb9b9('0x51')](_0x41a5c2[_0xb9b9('0x46')],_0x53acda[_0xb9b9('0x47')]));if(_0x41a5c2[_0xb9b9('0x46')][_0xb9b9('0x52')]){_0x5391a5[_0xb9b9('0x50')]=_['merge'](_0x5391a5['where'],{'$or':_[_0xb9b9('0x45')](_0x5391a5[_0xb9b9('0x49')],function(_0x55f5a6){var _0x5b259b={};_0x5b259b[_0x55f5a6]={'$like':'%'+_0x41a5c2[_0xb9b9('0x46')][_0xb9b9('0x52')]+'%'};return _0x5b259b;})});}_0x5391a5=_[_0xb9b9('0x53')]({},_0x5391a5,_0x41a5c2[_0xb9b9('0x5b')]);return _0x52a23a[_0xb9b9('0xba')](_0x5391a5);}})[_0xb9b9('0x1f')](function(_0x3d92a3){if(_0x3d92a3){_0x2ea63a=_0x3d92a3[_0xb9b9('0x4b')];if(!_0x41a5c2[_0xb9b9('0x46')]['hasOwnProperty'](_0xb9b9('0x4d'))){_0x5391a5['limit']=qs[_0xb9b9('0x30')](_0x41a5c2[_0xb9b9('0x46')]['limit']);_0x5391a5['offset']=qs[_0xb9b9('0x2f')](_0x41a5c2[_0xb9b9('0x46')][_0xb9b9('0x2f')]);}return _0x52a23a['getAgents'](_0x5391a5);}})[_0xb9b9('0x1f')](function(_0x3f10f8){if(_0x3f10f8){return _0x3f10f8?{'count':_0x2ea63a,'rows':_0x3f10f8}:null;}})[_0xb9b9('0x1f')](respondWithResult(_0x11bc75,null))[_0xb9b9('0x2a')](handleError(_0x11bc75,null));};exports[_0xb9b9('0x3b')]=function(_0x4391b2,_0x336089,_0x5d3b14){var _0x3295b0,_0x292c84,_0x4d6d8e;if(_[_0xb9b9('0x7b')](_0x4391b2['body'][_0xb9b9('0x64')])||_0x4391b2[_0xb9b9('0x64')]['body']===''){throw new db[(_0xb9b9('0x74'))][(_0xb9b9('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb9b9('0x7b')](_0x4391b2[_0xb9b9('0x64')]['to'])){}_0x3295b0=_0x4391b2['body']['to'];return db[_0xb9b9('0x3f')][_0xb9b9('0x68')]({'where':{'id':_0x4391b2['params']['id']}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x336089,null))[_0xb9b9('0x1f')](function(_0xe36346){if(_0xe36346){return db[_0xb9b9('0x3f')][_0xb9b9('0x5c')]({'where':{'id':_0xe36346['id']},'include':[{'model':db[_0xb9b9('0x81')],'as':_0xb9b9('0x82'),'include':[{'model':db[_0xb9b9('0x73')],'as':_0xb9b9('0x8d'),'where':{[_0xe36346[_0xb9b9('0x7e')]]:_0x3295b0},'limit':0x1,'order':[[_0xb9b9('0x83'),_0xb9b9('0x84')]]}]}]})['then'](handleEntityNotFound(_0x336089,null))[_0xb9b9('0x1f')](function(_0x42263a){if(_0x42263a&&_0x42263a[_0xb9b9('0x82')]){_0x292c84=_0x42263a['get']({'plain':!![]});if(_0x292c84[_0xb9b9('0x82')]&&_0x292c84[_0xb9b9('0x82')][_0xb9b9('0x8d')][_0xb9b9('0x4b')]){return _0x292c84[_0xb9b9('0x82')][_0xb9b9('0x8d')][0x0];}return db[_0xb9b9('0x73')][_0xb9b9('0x5d')](_[_0xb9b9('0x1a')](_0x4391b2[_0xb9b9('0x64')],{'firstName':_0x3295b0,[_0x42263a['mapKey']]:_0x3295b0,'phone':_0x3295b0,'ListId':_0x292c84[_0xb9b9('0x7a')]}));}})[_0xb9b9('0x1f')](handleEntityNotFound(_0x336089,null))[_0xb9b9('0x1f')](function(_0x31435c){if(_0x31435c){_0x4d6d8e=_0x31435c;return db[_0xb9b9('0x93')]['find']({'where':{'ContactId':_0x4d6d8e['id'],'closed':![],'OpenchannelAccountId':_0x292c84['id']}})[_0xb9b9('0x1f')](function(_0x45a672){if(_0x45a672){return[_0x45a672,![]];}return db[_0xb9b9('0x93')][_0xb9b9('0x5d')]({'UserId':_0x4391b2[_0xb9b9('0x5e')]['id'],'ContactId':_0x4d6d8e['id'],'OpenchannelAccountId':_0x292c84['id'],'lastMsgDirection':_0xb9b9('0xbb'),'firstMsgDirection':_0xb9b9('0xbb'),'Messages':[_['merge'](_0x4391b2[_0xb9b9('0x64')],{'read':![],'body':_0x4391b2['body'][_0xb9b9('0x64')],'OpenchannelAccountId':_0x292c84['id'],'UserId':_0x4391b2[_0xb9b9('0x5e')]['id'],'ContactId':_0x4d6d8e['id']})]},{'include':[{'model':db[_0xb9b9('0x9d')],'as':_0xb9b9('0xbc')}]})['then'](function(_0x180bd0){return[_0x180bd0,!![]];});});}})[_0xb9b9('0x95')](function(_0x2b80b9,_0x1e6bd6){if(_0x1e6bd6){return _0x2b80b9;}return db['OpenchannelMessage']['create'](_[_0xb9b9('0x53')](_0x4391b2[_0xb9b9('0x64')],{'read':![],'body':_0x4391b2['body']['body'],'OpenchannelAccountId':_0x292c84['id'],'OpenchannelInteractionId':_0x2b80b9['id'],'UserId':_0x4391b2[_0xb9b9('0x5e')]['id'],'ContactId':_0x4d6d8e['id']}))[_0xb9b9('0x1f')](function(_0x212a50){_0x2b80b9[_0xb9b9('0xbd')][_0xb9b9('0xbc')]=[];_0x2b80b9[_0xb9b9('0xbd')]['Messages'][_0xb9b9('0x9a')](_0x212a50[_0xb9b9('0xbd')]);return _0x2b80b9;});});}})[_0xb9b9('0x1f')](respondWithResult(_0x336089,null))[_0xb9b9('0x2a')](handleError(_0x336089,null));}; \ No newline at end of file +var _0xe630=['index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','Pause','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','filter','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','OpenchannelApplication','Applications','List','applications','list','orderBy','priority','asc','account','Contacts','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','autoclose','close','OpenchannelMessage','AttachmentId','UserId','User','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','stack','json','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','OpenchannelAccounts','UserProfileResource','name','send'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xe630,0x149));var _0x0e63=function(_0x2cf50a,_0x36d487){_0x2cf50a=_0x2cf50a-0x0;var _0x4dd5ce=_0xe630[_0x2cf50a];return _0x4dd5ce;};'use strict';var emlformat=require(_0x0e63('0x0'));var rimraf=require(_0x0e63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e63('0x2'));var rp=require(_0x0e63('0x3'));var moment=require(_0x0e63('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e63('0x5'));var util=require(_0x0e63('0x6'));var path=require(_0x0e63('0x7'));var sox=require('sox');var csv=require(_0x0e63('0x8'));var ejs=require(_0x0e63('0x9'));var fs=require('fs');var fs_extra=require(_0x0e63('0xa'));var _=require(_0x0e63('0xb'));var squel=require(_0x0e63('0xc'));var crypto=require('crypto');var jsforce=require(_0x0e63('0xd'));var deskjs=require(_0x0e63('0xe'));var toCsv=require(_0x0e63('0x8'));var querystring=require(_0x0e63('0xf'));var Papa=require(_0x0e63('0x10'));var Redis=require(_0x0e63('0x11'));var authService=require(_0x0e63('0x12'));var qs=require(_0x0e63('0x13'));var as=require(_0x0e63('0x14'));var hardwareService=require(_0x0e63('0x15'));var logger=require(_0x0e63('0x16'))('api');var utils=require(_0x0e63('0x17'));var config=require(_0x0e63('0x18'));var licenseUtil=require(_0x0e63('0x19'));var db=require(_0x0e63('0x1a'))['db'];config[_0x0e63('0x1b')]=_[_0x0e63('0x1c')](config[_0x0e63('0x1b')],{'host':_0x0e63('0x1d'),'port':0x18eb});var socket=require(_0x0e63('0x1e'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x0e63('0x1f')](socket);var jayson=require(_0x0e63('0x20'));var client=jayson[_0x0e63('0x21')][_0x0e63('0x22')]({'port':0x232c});var client9002=jayson[_0x0e63('0x21')][_0x0e63('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x47f3e2,_0x5d1f1e,_0x5d8660,_0x503f34){return new BPromise(function(_0x37f6e4,_0x174524){var _0x5c22ad=_0x503f34||client;return _0x5c22ad['request'](_0x47f3e2,_0x5d8660)['then'](function(_0x16107b){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5d1f1e,_0x0e63('0x23'));logger['debug'](_0x0e63('0x24'),_0x5d1f1e,_0x0e63('0x23'),JSON['stringify'](_0x16107b));if(_0x16107b['error']){if(_0x16107b[_0x0e63('0x25')][_0x0e63('0x26')]===0x1f4){logger[_0x0e63('0x25')](_0x0e63('0x27'),_0x5d1f1e,_0x16107b[_0x0e63('0x25')][_0x0e63('0x28')]);return _0x174524(_0x16107b['error'][_0x0e63('0x28')]);}logger[_0x0e63('0x25')](_0x0e63('0x27'),_0x5d1f1e,_0x16107b[_0x0e63('0x25')][_0x0e63('0x28')]);return _0x37f6e4(_0x16107b['error']['message']);}else{logger[_0x0e63('0x29')](_0x0e63('0x27'),_0x5d1f1e,_0x0e63('0x23'));_0x37f6e4(_0x16107b[_0x0e63('0x2a')][_0x0e63('0x28')]);}})['catch'](function(_0x22bdce){logger[_0x0e63('0x25')](_0x0e63('0x27'),_0x5d1f1e,_0x22bdce);_0x174524(_0x22bdce);});});}function respondWithStatusCode(_0xaa0600,_0x2f95bf){_0x2f95bf=_0x2f95bf||0xcc;return function(_0x1dc52c){if(_0x1dc52c){return _0xaa0600[_0x0e63('0x2b')](_0x2f95bf);}return _0xaa0600[_0x0e63('0x2c')](_0x2f95bf)[_0x0e63('0x2d')]();};}function respondWithResult(_0x3b9fb6,_0x46c864){_0x46c864=_0x46c864||0xc8;return function(_0x4f7ac0){if(_0x4f7ac0){return _0x3b9fb6['status'](_0x46c864)['json'](_0x4f7ac0);}};}function respondWithFilteredResult(_0x66a314,_0x3961bd){return function(_0x370dd7){if(_0x370dd7){var _0x188326=typeof _0x3961bd[_0x0e63('0x2e')]===_0x0e63('0x2f')&&typeof _0x3961bd[_0x0e63('0x30')]===_0x0e63('0x2f');var _0x2ef997=_0x370dd7[_0x0e63('0x31')];var _0x1069c7=_0x188326?0x0:_0x3961bd[_0x0e63('0x2e')];var _0x435990=_0x188326?_0x370dd7[_0x0e63('0x31')]:_0x3961bd[_0x0e63('0x2e')]+_0x3961bd[_0x0e63('0x30')];var _0x33953c;if(_0x435990>=_0x2ef997){_0x435990=_0x2ef997;_0x33953c=0xc8;}else{_0x33953c=0xce;}_0x66a314['status'](_0x33953c);return _0x66a314[_0x0e63('0x32')](_0x0e63('0x33'),_0x1069c7+'-'+_0x435990+'/'+_0x2ef997)['json'](_0x370dd7);}return null;};}function patchUpdates(_0x3f0a8a){return function(_0x1a2bb9){try{jsonpatch[_0x0e63('0x34')](_0x1a2bb9,_0x3f0a8a,!![]);}catch(_0xede47b){return BPromise['reject'](_0xede47b);}return _0x1a2bb9[_0x0e63('0x35')]();};}function saveUpdates(_0x28c5f1,_0x445e14){return function(_0x4d1e0b){if(_0x4d1e0b){return _0x4d1e0b[_0x0e63('0x36')](_0x28c5f1)[_0x0e63('0x37')](function(_0x5cff20){return _0x5cff20;});}return null;};}function removeEntity(_0x42c3d2,_0x258bd0){return function(_0x2b620e){if(_0x2b620e){return _0x2b620e[_0x0e63('0x38')]()[_0x0e63('0x37')](function(){var _0x144b40=_0x2b620e['get']({'plain':!![]});var _0x36c466=_0x0e63('0x39');return db[_0x0e63('0x3a')][_0x0e63('0x38')]({'where':{'type':_0x36c466,'resourceId':_0x144b40['id']}})[_0x0e63('0x37')](function(){return _0x2b620e;});})[_0x0e63('0x37')](function(){_0x42c3d2['status'](0xcc)[_0x0e63('0x2d')]();});}};}function handleEntityNotFound(_0x4a8bdb,_0x2741a4){return function(_0x1ae634){if(!_0x1ae634){_0x4a8bdb[_0x0e63('0x2b')](0x194);}return _0x1ae634;};}function handleError(_0x2e8cc6,_0x39e06e){_0x39e06e=_0x39e06e||0x1f4;return function(_0x53d96b){logger['error'](_0x53d96b['stack']);if(_0x53d96b[_0x0e63('0x3b')]){delete _0x53d96b[_0x0e63('0x3b')];}_0x2e8cc6[_0x0e63('0x2c')](_0x39e06e)[_0x0e63('0x3c')](_0x53d96b);};}exports[_0x0e63('0x3d')]=function(_0x4b02aa,_0x51cc1d){var _0x15102e={'include':[{'model':db['Pause'],'as':_0x0e63('0x3e')}]},_0x5eed7e={},_0x26e386={'count':0x0,'rows':[]};var _0x4813df=_['map'](db[_0x0e63('0x3f')][_0x0e63('0x40')],function(_0x41bf5e){return{'name':_0x41bf5e[_0x0e63('0x41')],'type':_0x41bf5e[_0x0e63('0x42')][_0x0e63('0x43')]};});_0x5eed7e[_0x0e63('0x44')]=_[_0x0e63('0x45')](_0x4813df,_0x0e63('0x3b'));_0x5eed7e['query']=_['keys'](_0x4b02aa[_0x0e63('0x46')]);_0x5eed7e['filters']=_[_0x0e63('0x47')](_0x5eed7e[_0x0e63('0x44')],_0x5eed7e[_0x0e63('0x46')]);_0x15102e[_0x0e63('0x48')]=_['intersection'](_0x5eed7e[_0x0e63('0x44')],qs[_0x0e63('0x49')](_0x4b02aa[_0x0e63('0x46')][_0x0e63('0x49')]));_0x15102e[_0x0e63('0x48')]=_0x15102e[_0x0e63('0x48')][_0x0e63('0x4a')]?_0x15102e[_0x0e63('0x48')]:_0x5eed7e[_0x0e63('0x44')];if(!_0x4b02aa[_0x0e63('0x46')]['hasOwnProperty'](_0x0e63('0x4b'))){_0x15102e[_0x0e63('0x30')]=qs[_0x0e63('0x30')](_0x4b02aa[_0x0e63('0x46')]['limit']);_0x15102e[_0x0e63('0x2e')]=qs[_0x0e63('0x2e')](_0x4b02aa[_0x0e63('0x46')]['offset']);}_0x15102e[_0x0e63('0x4c')]=qs[_0x0e63('0x4d')](_0x4b02aa[_0x0e63('0x46')]['sort']);_0x15102e[_0x0e63('0x4e')]=qs[_0x0e63('0x4f')](_[_0x0e63('0x50')](_0x4b02aa[_0x0e63('0x46')],_0x5eed7e['filters']),_0x4813df);if(_0x4b02aa[_0x0e63('0x46')]['filter']){_0x15102e[_0x0e63('0x4e')]=_[_0x0e63('0x51')](_0x15102e[_0x0e63('0x4e')],{'$or':_[_0x0e63('0x45')](_0x4813df,function(_0x121d11){if(_0x121d11[_0x0e63('0x42')]!==_0x0e63('0x52')){var _0x1f36a1={};_0x1f36a1[_0x121d11['name']]={'$like':'%'+_0x4b02aa['query']['filter']+'%'};return _0x1f36a1;}})});}_0x15102e=_[_0x0e63('0x51')]({},_0x15102e,_0x4b02aa[_0x0e63('0x53')]);var _0xe3f5b7={'where':_0x15102e['where']};return db[_0x0e63('0x3f')][_0x0e63('0x31')](_0xe3f5b7)[_0x0e63('0x37')](function(_0x1a4b84){_0x26e386['count']=_0x1a4b84;if(_0x4b02aa['query'][_0x0e63('0x54')]){_0x15102e[_0x0e63('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x0e63('0x56')](_0x15102e);})[_0x0e63('0x37')](function(_0x3f8dca){_0x26e386['rows']=_0x3f8dca;return _0x26e386;})[_0x0e63('0x37')](respondWithFilteredResult(_0x51cc1d,_0x15102e))[_0x0e63('0x57')](handleError(_0x51cc1d,null));};exports[_0x0e63('0x58')]=function(_0x54b482,_0x2c1d61){var _0x36f102={'raw':![],'where':{'id':_0x54b482[_0x0e63('0x59')]['id']},'include':[{'model':db[_0x0e63('0x5a')],'as':_0x0e63('0x3e')}]},_0x452d76={};_0x452d76[_0x0e63('0x44')]=_[_0x0e63('0x5b')](db[_0x0e63('0x3f')][_0x0e63('0x40')]);_0x452d76['query']=_[_0x0e63('0x5b')](_0x54b482[_0x0e63('0x46')]);_0x452d76[_0x0e63('0x4f')]=_[_0x0e63('0x47')](_0x452d76[_0x0e63('0x44')],_0x452d76[_0x0e63('0x46')]);_0x36f102[_0x0e63('0x48')]=_[_0x0e63('0x47')](_0x452d76['model'],qs[_0x0e63('0x49')](_0x54b482[_0x0e63('0x46')][_0x0e63('0x49')]));_0x36f102[_0x0e63('0x48')]=_0x36f102[_0x0e63('0x48')][_0x0e63('0x4a')]?_0x36f102[_0x0e63('0x48')]:_0x452d76[_0x0e63('0x44')];if(_0x54b482[_0x0e63('0x46')][_0x0e63('0x54')]){_0x36f102[_0x0e63('0x55')]=[{'all':!![]}];}_0x36f102=_[_0x0e63('0x51')]({},_0x36f102,_0x54b482[_0x0e63('0x53')]);return db['OpenchannelAccount'][_0x0e63('0x5c')](_0x36f102)[_0x0e63('0x37')](handleEntityNotFound(_0x2c1d61,null))['then'](respondWithResult(_0x2c1d61,null))[_0x0e63('0x57')](handleError(_0x2c1d61,null));};exports[_0x0e63('0x5d')]=function(_0x4e8528,_0x4aa41f){return db[_0x0e63('0x3f')][_0x0e63('0x5d')](_0x4e8528[_0x0e63('0x5e')],{})[_0x0e63('0x37')](function(_0x5fe558){var _0x274e2c=_0x4e8528[_0x0e63('0x5f')][_0x0e63('0x60')]({'plain':!![]});if(!_0x274e2c)throw new Error(_0x0e63('0x61'));if(_0x274e2c[_0x0e63('0x62')]===_0x0e63('0x5f')){var _0xacffbe=_0x5fe558[_0x0e63('0x60')]({'plain':!![]});var _0x453be1=_0x0e63('0x39');return db[_0x0e63('0x63')][_0x0e63('0x5c')]({'where':{'name':_0x453be1,'userProfileId':_0x274e2c[_0x0e63('0x64')]},'raw':!![]})[_0x0e63('0x37')](function(_0x1d3d88){if(_0x1d3d88&&_0x1d3d88[_0x0e63('0x65')]===0x0){return db[_0x0e63('0x3a')][_0x0e63('0x5d')]({'name':_0xacffbe[_0x0e63('0x3b')],'resourceId':_0xacffbe['id'],'type':_0x1d3d88[_0x0e63('0x3b')],'sectionId':_0x1d3d88['id']},{})['then'](function(){return _0x5fe558;});}else{return _0x5fe558;}})[_0x0e63('0x57')](function(_0x50af93){logger[_0x0e63('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50af93);throw _0x50af93;});}return _0x5fe558;})['then'](respondWithResult(_0x4aa41f,0xc9))[_0x0e63('0x57')](handleError(_0x4aa41f,null));};exports[_0x0e63('0x36')]=function(_0x25565d,_0x5596ba){if(_0x25565d[_0x0e63('0x5e')]['id']){delete _0x25565d[_0x0e63('0x5e')]['id'];}return db[_0x0e63('0x3f')]['find']({'where':{'id':_0x25565d[_0x0e63('0x59')]['id']},'include':[{'model':db[_0x0e63('0x5a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5596ba,null))[_0x0e63('0x37')](saveUpdates(_0x25565d['body'],null))[_0x0e63('0x37')](respondWithResult(_0x5596ba,null))['catch'](handleError(_0x5596ba,null));};exports[_0x0e63('0x38')]=function(_0xae1f1c,_0x3f7211){return db[_0x0e63('0x3f')][_0x0e63('0x5c')]({'where':{'id':_0xae1f1c['params']['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x3f7211,null))[_0x0e63('0x37')](removeEntity(_0x3f7211,null))[_0x0e63('0x57')](handleError(_0x3f7211,null));};exports['describe']=function(_0x34b12a,_0xd31899){return db[_0x0e63('0x3f')][_0x0e63('0x66')]()['then'](respondWithResult(_0xd31899,null))[_0x0e63('0x57')](handleError(_0xd31899,null));};exports[_0x0e63('0x67')]=function(_0x987d07,_0x48bf51,_0x28c5de){if(_0x987d07['body']['id']){delete _0x987d07['body']['id'];}return db[_0x0e63('0x3f')][_0x0e63('0x5c')]({'where':{'id':_0x987d07[_0x0e63('0x59')]['id']}})['then'](handleEntityNotFound(_0x48bf51,null))['then'](function(_0x3204ca){if(_0x3204ca){_0x987d07[_0x0e63('0x5e')][_0x0e63('0x68')]=_0x3204ca['id'];return db[_0x0e63('0x69')][_0x0e63('0x5d')](_0x987d07[_0x0e63('0x5e')]);}})['then'](respondWithResult(_0x48bf51,null))['catch'](handleError(_0x48bf51,null));};exports[_0x0e63('0x6a')]=function(_0x478ec8,_0x36bb8b,_0x4e537e){var _0x4c6a2e={'raw':![],'where':{}};var _0x5ae0c1={};var _0x4b1b77={'count':0x0,'rows':[]};return db[_0x0e63('0x3f')][_0x0e63('0x6b')]({'where':{'id':_0x478ec8[_0x0e63('0x59')]['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x36bb8b,null))[_0x0e63('0x37')](function(_0x343be1){if(_0x343be1){_0x5ae0c1[_0x0e63('0x44')]=_[_0x0e63('0x5b')](db[_0x0e63('0x69')]['rawAttributes']);_0x5ae0c1[_0x0e63('0x46')]=_[_0x0e63('0x5b')](_0x478ec8[_0x0e63('0x46')]);_0x5ae0c1[_0x0e63('0x4f')]=_[_0x0e63('0x47')](_0x5ae0c1[_0x0e63('0x44')],_0x5ae0c1[_0x0e63('0x46')]);_0x4c6a2e['attributes']=_[_0x0e63('0x47')](_0x5ae0c1[_0x0e63('0x44')],qs[_0x0e63('0x49')](_0x478ec8['query'][_0x0e63('0x49')]));_0x4c6a2e[_0x0e63('0x48')]=_0x4c6a2e['attributes'][_0x0e63('0x4a')]?_0x4c6a2e[_0x0e63('0x48')]:_0x5ae0c1[_0x0e63('0x44')];if(!_0x478ec8[_0x0e63('0x46')]['hasOwnProperty'](_0x0e63('0x4b'))){_0x4c6a2e[_0x0e63('0x30')]=qs['limit'](_0x478ec8[_0x0e63('0x46')][_0x0e63('0x30')]);_0x4c6a2e[_0x0e63('0x2e')]=qs['offset'](_0x478ec8[_0x0e63('0x46')][_0x0e63('0x2e')]);}_0x4c6a2e['order']=qs[_0x0e63('0x4d')](_0x478ec8['query']['sort']);_0x4c6a2e['where']=qs['filters'](_['pick'](_0x478ec8[_0x0e63('0x46')],_0x5ae0c1[_0x0e63('0x4f')]));_0x4c6a2e[_0x0e63('0x4e')][_0x0e63('0x68')]=_0x343be1['id'];if(_0x478ec8[_0x0e63('0x46')][_0x0e63('0x6c')]){_0x4c6a2e['where']=_[_0x0e63('0x51')](_0x4c6a2e['where'],{'$or':_[_0x0e63('0x45')](_0x4c6a2e[_0x0e63('0x48')],function(_0x1ca441){var _0x4957ba={};_0x4957ba[_0x1ca441]={'$like':'%'+_0x478ec8[_0x0e63('0x46')]['filter']+'%'};return _0x4957ba;})});}_0x4c6a2e=_[_0x0e63('0x51')]({},_0x4c6a2e,_0x478ec8[_0x0e63('0x53')]);return db[_0x0e63('0x69')]['count']({'where':_0x4c6a2e[_0x0e63('0x4e')]})['then'](function(_0x5021fa){_0x4b1b77[_0x0e63('0x31')]=_0x5021fa;if(_0x478ec8[_0x0e63('0x46')]['includeAll']){_0x4c6a2e['include']=[{'all':!![]}];}return db[_0x0e63('0x69')][_0x0e63('0x56')](_0x4c6a2e);})[_0x0e63('0x37')](function(_0x5230be){_0x4b1b77[_0x0e63('0x6d')]=_0x5230be;return _0x4b1b77;});}})[_0x0e63('0x37')](respondWithFilteredResult(_0x36bb8b,_0x4c6a2e))[_0x0e63('0x57')](handleError(_0x36bb8b,null));};exports['removeDispositions']=function(_0x825b2b,_0x5b612c,_0x1b70db){return db[_0x0e63('0x3f')][_0x0e63('0x5c')]({'where':{'id':_0x825b2b[_0x0e63('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b612c,null))[_0x0e63('0x37')](function(_0x7b2288){if(_0x7b2288){return _0x7b2288[_0x0e63('0x6e')](_0x825b2b[_0x0e63('0x46')][_0x0e63('0x6f')]);}})[_0x0e63('0x37')](respondWithStatusCode(_0x5b612c,null))['catch'](handleError(_0x5b612c,null));};exports[_0x0e63('0x70')]=function(_0x2ca6a8,_0x5157a9,_0x2470d8){if(_0x2ca6a8['body']['id']){delete _0x2ca6a8[_0x0e63('0x5e')]['id'];}return db[_0x0e63('0x3f')]['find']({'where':{'id':_0x2ca6a8[_0x0e63('0x59')]['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x5157a9,null))[_0x0e63('0x37')](function(_0x460c97){if(_0x460c97){_0x2ca6a8[_0x0e63('0x5e')][_0x0e63('0x68')]=_0x460c97['id'];return db[_0x0e63('0x71')]['create'](_0x2ca6a8[_0x0e63('0x5e')]);}})[_0x0e63('0x37')](respondWithResult(_0x5157a9,null))[_0x0e63('0x57')](handleError(_0x5157a9,null));};exports[_0x0e63('0x72')]=function(_0x225c91,_0xf2ef08,_0x242d5c){var _0x10c4b2={'raw':![],'where':{}};var _0x5af863={};var _0x168c2f={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x225c91['params']['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0xf2ef08,null))[_0x0e63('0x37')](function(_0x5cde00){if(_0x5cde00){_0x5af863[_0x0e63('0x44')]=_[_0x0e63('0x5b')](db[_0x0e63('0x71')][_0x0e63('0x40')]);_0x5af863['query']=_[_0x0e63('0x5b')](_0x225c91[_0x0e63('0x46')]);_0x5af863['filters']=_[_0x0e63('0x47')](_0x5af863[_0x0e63('0x44')],_0x5af863[_0x0e63('0x46')]);_0x10c4b2[_0x0e63('0x48')]=_[_0x0e63('0x47')](_0x5af863['model'],qs[_0x0e63('0x49')](_0x225c91[_0x0e63('0x46')][_0x0e63('0x49')]));_0x10c4b2[_0x0e63('0x48')]=_0x10c4b2[_0x0e63('0x48')][_0x0e63('0x4a')]?_0x10c4b2[_0x0e63('0x48')]:_0x5af863['model'];if(!_0x225c91['query'][_0x0e63('0x73')](_0x0e63('0x4b'))){_0x10c4b2[_0x0e63('0x30')]=qs[_0x0e63('0x30')](_0x225c91[_0x0e63('0x46')][_0x0e63('0x30')]);_0x10c4b2[_0x0e63('0x2e')]=qs[_0x0e63('0x2e')](_0x225c91[_0x0e63('0x46')][_0x0e63('0x2e')]);}_0x10c4b2[_0x0e63('0x4c')]=qs[_0x0e63('0x4d')](_0x225c91[_0x0e63('0x46')][_0x0e63('0x4d')]);_0x10c4b2['where']=qs['filters'](_[_0x0e63('0x50')](_0x225c91[_0x0e63('0x46')],_0x5af863[_0x0e63('0x4f')]));_0x10c4b2[_0x0e63('0x4e')]['OpenchannelAccountId']=_0x5cde00['id'];if(_0x225c91[_0x0e63('0x46')][_0x0e63('0x6c')]){_0x10c4b2[_0x0e63('0x4e')]=_[_0x0e63('0x51')](_0x10c4b2[_0x0e63('0x4e')],{'$or':_[_0x0e63('0x45')](_0x10c4b2[_0x0e63('0x48')],function(_0x2d3dc9){var _0x415f45={};_0x415f45[_0x2d3dc9]={'$like':'%'+_0x225c91['query'][_0x0e63('0x6c')]+'%'};return _0x415f45;})});}_0x10c4b2=_['merge']({},_0x10c4b2,_0x225c91[_0x0e63('0x53')]);return db[_0x0e63('0x71')][_0x0e63('0x31')]({'where':_0x10c4b2[_0x0e63('0x4e')]})['then'](function(_0x474c5e){_0x168c2f[_0x0e63('0x31')]=_0x474c5e;if(_0x225c91[_0x0e63('0x46')][_0x0e63('0x54')]){_0x10c4b2[_0x0e63('0x55')]=[{'all':!![]}];}return db[_0x0e63('0x71')][_0x0e63('0x56')](_0x10c4b2);})[_0x0e63('0x37')](function(_0x2161bd){_0x168c2f[_0x0e63('0x6d')]=_0x2161bd;return _0x168c2f;});}})['then'](respondWithFilteredResult(_0xf2ef08,_0x10c4b2))['catch'](handleError(_0xf2ef08,null));};exports[_0x0e63('0x74')]=function(_0x36be15,_0x57e765,_0x3659d2){return db[_0x0e63('0x3f')][_0x0e63('0x5c')]({'where':{'id':_0x36be15[_0x0e63('0x59')]['id']}})['then'](handleEntityNotFound(_0x57e765,null))[_0x0e63('0x37')](function(_0x4d9ac0){if(_0x4d9ac0){return _0x4d9ac0[_0x0e63('0x74')](_0x36be15[_0x0e63('0x46')]['ids']);}})[_0x0e63('0x37')](respondWithStatusCode(_0x57e765,null))[_0x0e63('0x57')](handleError(_0x57e765,null));};exports['notify']=function(_0x59fb15,_0x3c1422,_0x25cd12){var _0x10cbb2={'body':_0x59fb15['body'],'channel':_0x0e63('0x75')};var _0x2d0712=[];var _0xd06343=[];var _0x4f1bca={};var _0x1ac27a=![];return db['CmContact'][_0x0e63('0x66')]()[_0x0e63('0x37')](function(_0x50a298){if(!_0x50a298){throw new db[(_0x0e63('0x76'))][(_0x0e63('0x77'))](_0x0e63('0x78'));}_0x2d0712=_['difference'](_['keys'](_0x50a298),['createdAt',_0x0e63('0x79')]);_0xd06343=_[_0x0e63('0x7a')](_[_0x0e63('0x5b')](_0x50a298),[_0x0e63('0x7b'),'updatedAt',_0x0e63('0x7c'),_0x0e63('0x7d')]);if(_0x59fb15[_0x0e63('0x5e')]['id']){delete _0x59fb15[_0x0e63('0x5e')]['id'];}if(_[_0x0e63('0x7e')](_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x7f')])){throw new db[(_0x0e63('0x76'))][(_0x0e63('0x77'))]('from\x20is\x20mandatory');}if(_[_0x0e63('0x7e')](_0x59fb15[_0x0e63('0x5e')]['body'])||_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x5e')]===''){throw new db[(_0x0e63('0x76'))]['ValidationError'](_0x0e63('0x80'));}if(_[_0x0e63('0x7e')](_0x59fb15['body'][_0x0e63('0x81')])){throw new db[(_0x0e63('0x76'))][(_0x0e63('0x77'))](_0x0e63('0x82')+_0xd06343);}if(!_[_0x0e63('0x83')](_0xd06343,_0x59fb15[_0x0e63('0x5e')]['mapKey'])){throw new db[(_0x0e63('0x76'))][(_0x0e63('0x77'))](_0x0e63('0x84')+_0xd06343);}_0x4f1bca[_0x59fb15['body'][_0x0e63('0x81')]]=_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x7f')];})[_0x0e63('0x37')](function(){return db[_0x0e63('0x3f')][_0x0e63('0x5c')]({'where':{'id':_0x59fb15[_0x0e63('0x59')]['id']},'include':[{'model':db[_0x0e63('0x85')],'as':'List','include':[{'model':db[_0x0e63('0x86')],'as':'Contacts','where':_0x4f1bca,'limit':0x1,'order':[[_0x0e63('0x79'),_0x0e63('0x87')]]}]},{'model':db[_0x0e63('0x88')],'as':_0x0e63('0x89')}]});})[_0x0e63('0x37')](handleEntityNotFound(_0x3c1422,null))['then'](function(_0x413b7a){if(_0x413b7a&&_0x413b7a[_0x0e63('0x8a')]){_0x10cbb2['account']=_0x413b7a;_0x10cbb2[_0x0e63('0x8b')]=_0x413b7a[_0x0e63('0x89')];_0x10cbb2[_0x0e63('0x8c')]=_0x413b7a[_0x0e63('0x8a')];_0x10cbb2[_0x0e63('0x8b')]=_[_0x0e63('0x8d')](_0x10cbb2[_0x0e63('0x8b')],[_0x0e63('0x8e')],[_0x0e63('0x8f')]);if(_0x10cbb2[_0x0e63('0x90')]['Applications']){delete _0x10cbb2['account'][_0x0e63('0x89')];}if(_0x10cbb2['account'][_0x0e63('0x8a')]&&_0x10cbb2[_0x0e63('0x90')][_0x0e63('0x8a')]['Contacts'][_0x0e63('0x4a')]){return _0x10cbb2[_0x0e63('0x90')]['List'][_0x0e63('0x91')][0x0];}var _0xf7fadf=_[_0x0e63('0x1c')](_0x59fb15[_0x0e63('0x5e')],{'firstName':_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x7f')],'ListId':_0x413b7a[_0x0e63('0x7d')]});_0xf7fadf[_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x81')]]=_0x59fb15['body'][_0x0e63('0x7f')];return db['CmContact']['create'](_0xf7fadf,{'fields':_0x2d0712,'raw':!![]});}})[_0x0e63('0x37')](handleEntityNotFound(_0x3c1422,null))[_0x0e63('0x37')](function(_0x5f41b9){_0x10cbb2[_0x0e63('0x92')]=_0x5f41b9;if(_0x5f41b9){var _0x58a8c2={'ContactId':_0x5f41b9['id'],'OpenchannelAccountId':_0x59fb15[_0x0e63('0x59')]['id'],'from':(_0x5f41b9['firstName']||'')+'\x20'+(_0x5f41b9[_0x0e63('0x93')]||'')};var _0x3221b1={'OpenchannelAccountId':_0x59fb15[_0x0e63('0x59')]['id'],'closed':![]};if(_0x59fb15['body']['threadId']){_0x3221b1[_0x0e63('0x94')]=_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x94')];return db[_0x0e63('0x95')]['find']({'where':_0x3221b1})[_0x0e63('0x37')](function(_0x36ee74){if(_0x36ee74){return[_0x36ee74,![]];}_0x58a8c2['threadId']=_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x94')];_0x58a8c2[_0x0e63('0x96')]=_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x96')];return db['OpenchannelInteraction'][_0x0e63('0x5d')](_0x58a8c2)[_0x0e63('0x37')](function(_0x43a593){return[_0x43a593,!![]];});});}else{_0x3221b1['threadId']=null;}_0x3221b1[_0x0e63('0x97')]=_0x5f41b9['id'];return db[_0x0e63('0x95')][_0x0e63('0x5c')]({'where':_0x3221b1})[_0x0e63('0x37')](function(_0x2c228d){if(_0x2c228d){return[_0x2c228d,![]];}return db[_0x0e63('0x95')]['create'](_0x58a8c2)[_0x0e63('0x37')](function(_0x513a62){return[_0x513a62,!![]];});});}})[_0x0e63('0x98')](function(_0x425a4d,_0x1435ec){if(_0x425a4d){_0x1ac27a=_0x1435ec;if(!_0x1435ec){var _0x5481e4={'from':(_0x10cbb2[_0x0e63('0x92')]['firstName']||'')+'\x20'+(_0x10cbb2[_0x0e63('0x92')][_0x0e63('0x93')]||'')};if(_0x59fb15[_0x0e63('0x5e')]['threadId']&&_0x59fb15[_0x0e63('0x5e')]['messageId']&&_0x59fb15[_0x0e63('0x5e')]['threadId']!=_0x59fb15['body'][_0x0e63('0x99')]){_0x5481e4[_0x0e63('0x94')]=_0x59fb15[_0x0e63('0x5e')][_0x0e63('0x99')];}return _0x425a4d['update'](_0x5481e4);}else{return _0x425a4d;}}})['then'](function(_0x28668e){_0x10cbb2[_0x0e63('0x9a')]=_0x28668e[_0x0e63('0x60')]({'plain':!![]});_0x10cbb2[_0x0e63('0x9a')]['created']=_0x1ac27a;if(_0x10cbb2['interaction']['created']){if(_0x10cbb2[_0x0e63('0x90')][_0x0e63('0x9b')]){_0x10cbb2[_0x0e63('0x8b')]['push']({'id':0x0,'priority':_0x10cbb2[_0x0e63('0x8b')][_0x0e63('0x4a')]+0x1,'app':_0x0e63('0x9c'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x0e63('0x9d')][_0x0e63('0x5d')]({'body':_0x59fb15[_0x0e63('0x5e')]['body'],'OpenchannelAccountId':_0x59fb15[_0x0e63('0x59')]['id'],'OpenchannelInteractionId':_0x28668e['id'],'direction':'in','ContactId':_0x10cbb2[_0x0e63('0x92')]['id'],'AttachmentId':_0x59fb15['body'][_0x0e63('0x9e')]});})[_0x0e63('0x37')](function(_0x27e711){_0x10cbb2['message']=_0x27e711;if(_0x10cbb2[_0x0e63('0x9a')][_0x0e63('0x9f')]){return db[_0x0e63('0xa0')][_0x0e63('0x5c')]({'attributes':['id','name'],'where':{'id':_0x10cbb2[_0x0e63('0x9a')][_0x0e63('0x9f')]}})[_0x0e63('0x37')](function(_0x5cf54e){if(_0x5cf54e){_0x10cbb2['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x0e63('0xa1'),'appdata':_0x5cf54e[_0x0e63('0x3b')]+','+(_0x10cbb2[_0x0e63('0x90')]['waitForTheAssignedAgent']||0xa),'interval':_0x0e63('0xa2')});_0x10cbb2[_0x0e63('0xa3')]=![];}return respondWithRpcPromise(_0x0e63('0xa4'),_0x0e63('0xa5'),_0x10cbb2);});}return respondWithRpcPromise(_0x0e63('0xa4'),_0x0e63('0xa5'),_0x10cbb2);})[_0x0e63('0x37')](function(_0xd74c9){respondWithRpcPromise(_0x0e63('0xa6'),_0x0e63('0xa6'),{'event':_0x0e63('0xa7'),'message':_0xd74c9},client9002);return _0xd74c9;})[_0x0e63('0x37')](respondWithResult(_0x3c1422,null))[_0x0e63('0x57')](handleError(_0x3c1422,null));};exports[_0x0e63('0xa8')]=function(_0xca6e22,_0x2cd46f){var _0xec58b=_0xca6e22['params']['id'];var _0x49bf6e=_0xca6e22[_0x0e63('0x5e')];var _0x45393e=0xc8;var _0x38384d=null;return db[_0x0e63('0xa9')][_0x0e63('0xaa')]({'isolationLevel':db[_0x0e63('0xa9')]['Transaction'][_0x0e63('0xab')][_0x0e63('0xac')]},function(_0x3593f3){return db['OpenchannelAccount'][_0x0e63('0x6b')]({'where':{'id':_0xec58b},'transaction':_0x3593f3})[_0x0e63('0x37')](function(_0x4520bf){if(_0x4520bf){return db[_0x0e63('0x88')]['destroy']({'where':{'OpenchannelAccountId':_0xec58b},'transaction':_0x3593f3})[_0x0e63('0x37')](function(){var _0x719f5f=_[_0x0e63('0x45')](_0x49bf6e,function(_0x2c5b09){_0x2c5b09[_0x0e63('0x68')]=_0xec58b;return _0x2c5b09;});return db[_0x0e63('0x88')][_0x0e63('0xad')](_0x719f5f,{'transaction':_0x3593f3});});}else{_0x45393e=0x194;_0x38384d=[];}});})['then'](function(){if(_0x45393e!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0xec58b},'order':_0x0e63('0x8e')})[_0x0e63('0x37')](function(_0x2c6a03){_0x38384d=_0x2c6a03;});}})['catch'](function(_0x28396e){_0x45393e=0x1f4;logger[_0x0e63('0x25')](_0x28396e[_0x0e63('0xae')]);if(_0x28396e[_0x0e63('0x3b')]){delete _0x28396e[_0x0e63('0x3b')];}_0x38384d=_0x28396e;})['finally'](function(){if(_0x38384d===null){_0x2cd46f['sendStatus'](_0x45393e);}else{if(_0x45393e===0x1f4){_0x2cd46f[_0x0e63('0x2c')](_0x45393e)[_0x0e63('0x3c')](_0x38384d);}else{_0x2cd46f[_0x0e63('0x2c')](_0x45393e)[_0x0e63('0xaf')](_0x38384d);}}});};exports[_0x0e63('0xb0')]=function(_0x3c354d,_0x5507cc,_0x517af4){var _0x47d320={};var _0x5df613={};var _0x27ea47;var _0x38236;return db[_0x0e63('0x3f')][_0x0e63('0x6b')]({'where':{'id':_0x3c354d[_0x0e63('0x59')]['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x5507cc,null))[_0x0e63('0x37')](function(_0xb8b3a9){if(_0xb8b3a9){_0x27ea47=_0xb8b3a9;_0x5df613['model']=_[_0x0e63('0x5b')](db[_0x0e63('0x88')][_0x0e63('0x40')]);_0x5df613[_0x0e63('0x46')]=_['keys'](_0x3c354d[_0x0e63('0x46')]);_0x5df613[_0x0e63('0x4f')]=_[_0x0e63('0x47')](_0x5df613[_0x0e63('0x44')],_0x5df613[_0x0e63('0x46')]);_0x47d320[_0x0e63('0x48')]=_[_0x0e63('0x47')](_0x5df613[_0x0e63('0x44')],qs[_0x0e63('0x49')](_0x3c354d['query']['fields']));_0x47d320[_0x0e63('0x48')]=_0x47d320[_0x0e63('0x48')]['length']?_0x47d320[_0x0e63('0x48')]:_0x5df613[_0x0e63('0x44')];_0x47d320[_0x0e63('0x4c')]=qs[_0x0e63('0x4d')](_0x3c354d['query'][_0x0e63('0x4d')]);_0x47d320['where']=qs[_0x0e63('0x4f')](_[_0x0e63('0x50')](_0x3c354d['query'],_0x5df613[_0x0e63('0x4f')]));if(_0x3c354d['query']['filter']){_0x47d320[_0x0e63('0x4e')]=_[_0x0e63('0x51')](_0x47d320['where'],{'$or':_[_0x0e63('0x45')](_0x47d320[_0x0e63('0x48')],function(_0xb6cc19){var _0x5f443c={};_0x5f443c[_0xb6cc19]={'$like':'%'+_0x3c354d[_0x0e63('0x46')][_0x0e63('0x6c')]+'%'};return _0x5f443c;})});}_0x47d320=_['merge']({},_0x47d320,_0x3c354d[_0x0e63('0x53')]);return _0x27ea47[_0x0e63('0xb0')](_0x47d320);}})[_0x0e63('0x37')](function(_0x360c48){if(_0x360c48){_0x38236=_0x360c48[_0x0e63('0x4a')];if(!_0x3c354d['query']['hasOwnProperty'](_0x0e63('0x4b'))){_0x47d320[_0x0e63('0x30')]=qs[_0x0e63('0x30')](_0x3c354d[_0x0e63('0x46')][_0x0e63('0x30')]);_0x47d320[_0x0e63('0x2e')]=qs[_0x0e63('0x2e')](_0x3c354d['query'][_0x0e63('0x2e')]);}return _0x27ea47[_0x0e63('0xb0')](_0x47d320);}})['then'](function(_0x537c8b){if(_0x537c8b){return _0x537c8b?{'count':_0x38236,'rows':_0x537c8b}:null;}})[_0x0e63('0x37')](respondWithResult(_0x5507cc,null))['catch'](handleError(_0x5507cc,null));};exports[_0x0e63('0xb1')]=function(_0x37b3ce,_0x485f31,_0x33068f){var _0x5257d7={'raw':![],'where':{}};var _0x42aade={};var _0x1c8ee1={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x0e63('0x6b')]({'where':{'id':_0x37b3ce['params']['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x485f31,null))[_0x0e63('0x37')](function(_0x2a7b79){if(_0x2a7b79){_0x42aade[_0x0e63('0x44')]=_[_0x0e63('0x5b')](db[_0x0e63('0x95')][_0x0e63('0x40')]);_0x42aade[_0x0e63('0x46')]=_['keys'](_0x37b3ce[_0x0e63('0x46')]);_0x42aade['filters']=_['intersection'](_0x42aade[_0x0e63('0x44')],_0x42aade['query']);_0x5257d7[_0x0e63('0x48')]=_['intersection'](_0x42aade[_0x0e63('0x44')],qs[_0x0e63('0x49')](_0x37b3ce[_0x0e63('0x46')][_0x0e63('0x49')]));_0x5257d7[_0x0e63('0x48')]=_0x5257d7['attributes'][_0x0e63('0x4a')]?_0x5257d7[_0x0e63('0x48')]:_0x42aade[_0x0e63('0x44')];if(!_0x37b3ce[_0x0e63('0x46')]['hasOwnProperty'](_0x0e63('0x4b'))){_0x5257d7[_0x0e63('0x30')]=qs[_0x0e63('0x30')](_0x37b3ce[_0x0e63('0x46')][_0x0e63('0x30')]);_0x5257d7[_0x0e63('0x2e')]=qs[_0x0e63('0x2e')](_0x37b3ce[_0x0e63('0x46')][_0x0e63('0x2e')]);}_0x5257d7['order']=qs[_0x0e63('0x4d')](_0x37b3ce['query'][_0x0e63('0x4d')]);_0x5257d7[_0x0e63('0x4e')]=qs[_0x0e63('0x4f')](_[_0x0e63('0x50')](_0x37b3ce['query'],_0x42aade[_0x0e63('0x4f')]));_0x5257d7[_0x0e63('0x4e')]['OpenchannelAccountId']=_0x2a7b79['id'];if(_0x37b3ce[_0x0e63('0x46')]['filter']){_0x5257d7[_0x0e63('0x4e')]=_[_0x0e63('0x51')](_0x5257d7[_0x0e63('0x4e')],{'$or':_[_0x0e63('0x45')](_0x5257d7[_0x0e63('0x48')],function(_0x5f0cda){var _0x415767={};_0x415767[_0x5f0cda]={'$like':'%'+_0x37b3ce['query']['filter']+'%'};return _0x415767;})});}_0x5257d7=_[_0x0e63('0x51')]({},_0x5257d7,_0x37b3ce[_0x0e63('0x53')]);return db['OpenchannelInteraction'][_0x0e63('0x31')]({'where':_0x5257d7[_0x0e63('0x4e')]})[_0x0e63('0x37')](function(_0x30bdea){_0x1c8ee1[_0x0e63('0x31')]=_0x30bdea;if(_0x37b3ce[_0x0e63('0x46')][_0x0e63('0x54')]){_0x5257d7[_0x0e63('0x55')]=[{'model':db['CmContact'],'as':_0x0e63('0xb2'),'required':![]},{'model':db[_0x0e63('0xa0')],'as':'Owner','attributes':[_0x0e63('0x3b'),_0x0e63('0xb3'),_0x0e63('0xb4')],'required':![]},{'model':db['Tag'],'as':_0x0e63('0xb5'),'attributes':['id','name',_0x0e63('0xb6')],'where':_0x37b3ce[_0x0e63('0x46')][_0x0e63('0xb7')]?{'id':_0x37b3ce[_0x0e63('0x46')][_0x0e63('0xb7')]}:undefined,'required':_0x37b3ce[_0x0e63('0x46')][_0x0e63('0xb7')]?!![]:![]}];}return db[_0x0e63('0x95')][_0x0e63('0x56')](_0x5257d7);})['then'](function(_0x2733bc){_0x1c8ee1[_0x0e63('0x6d')]=_0x2733bc;return _0x1c8ee1;});}})[_0x0e63('0x37')](respondWithFilteredResult(_0x485f31,_0x5257d7))[_0x0e63('0x57')](handleError(_0x485f31,null));};exports[_0x0e63('0xb8')]=function(_0x15b25f,_0x4d9d3f,_0x6f4a1e){return db[_0x0e63('0x3f')][_0x0e63('0x5c')]({'where':{'id':_0x15b25f[_0x0e63('0x59')]['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x4d9d3f,null))[_0x0e63('0x37')](function(_0x669225){if(_0x669225){return _0x669225[_0x0e63('0xb8')](_0x15b25f[_0x0e63('0x5e')][_0x0e63('0x6f')],_['omit'](_0x15b25f['body'],['ids','id'])||{})[_0x0e63('0x98')](function(_0x50378c){for(var _0x1c2d50=0x0;_0x1c2d50<_0x15b25f[_0x0e63('0x5e')][_0x0e63('0x6f')][_0x0e63('0x4a')];_0x1c2d50+=0x1){socket[_0x0e63('0xb9')](_0x0e63('0xba'),{'UserId':Number(_0x15b25f[_0x0e63('0x5e')][_0x0e63('0x6f')][_0x1c2d50]),'OpenchannelAccountId':Number(_0x15b25f[_0x0e63('0x59')]['id'])});}return _0x50378c;});}})['then'](respondWithResult(_0x4d9d3f,null))[_0x0e63('0x57')](handleError(_0x4d9d3f,null));};exports[_0x0e63('0xbb')]=function(_0x337490,_0x513ce8,_0x327047){return db['OpenchannelAccount'][_0x0e63('0x5c')]({'where':{'id':_0x337490[_0x0e63('0x59')]['id']}})['then'](handleEntityNotFound(_0x513ce8,null))[_0x0e63('0x37')](function(_0x14d3c){if(_0x14d3c){return _0x14d3c['removeAgents'](_0x337490['query'][_0x0e63('0x6f')])[_0x0e63('0x37')](function(){if(_[_0x0e63('0xbc')](_0x337490[_0x0e63('0x46')]['ids'])){for(var _0x45b987=0x0;_0x45b987<_0x337490[_0x0e63('0x46')][_0x0e63('0x6f')][_0x0e63('0x4a')];_0x45b987+=0x1){socket[_0x0e63('0xb9')](_0x0e63('0xbd'),{'UserId':Number(_0x337490['query']['ids'][_0x45b987]),'OpenchannelAccountId':Number(_0x337490[_0x0e63('0x59')]['id'])});}}else{socket[_0x0e63('0xb9')](_0x0e63('0xbd'),{'UserId':Number(_0x337490[_0x0e63('0x46')][_0x0e63('0x6f')]),'OpenchannelAccountId':Number(_0x337490[_0x0e63('0x59')]['id'])});}});}})[_0x0e63('0x37')](respondWithStatusCode(_0x513ce8,null))['catch'](handleError(_0x513ce8,null));};exports['getAgents']=function(_0x3d568c,_0x25a96c,_0x29987c){var _0x4ac3c7={};var _0x32d38d={};var _0x40f22e;var _0x20a197;return db['OpenchannelAccount'][_0x0e63('0x6b')]({'where':{'id':_0x3d568c[_0x0e63('0x59')]['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x25a96c,null))[_0x0e63('0x37')](function(_0x5a23b1){if(_0x5a23b1){_0x40f22e=_0x5a23b1;_0x32d38d[_0x0e63('0x44')]=_[_0x0e63('0x5b')](db[_0x0e63('0xa0')][_0x0e63('0x40')]);_0x32d38d[_0x0e63('0x46')]=_['keys'](_0x3d568c[_0x0e63('0x46')]);_0x32d38d[_0x0e63('0x4f')]=_['intersection'](_0x32d38d[_0x0e63('0x44')],_0x32d38d[_0x0e63('0x46')]);_0x4ac3c7['attributes']=_[_0x0e63('0x47')](_0x32d38d[_0x0e63('0x44')],qs[_0x0e63('0x49')](_0x3d568c[_0x0e63('0x46')][_0x0e63('0x49')]));_0x4ac3c7[_0x0e63('0x48')]=_0x4ac3c7[_0x0e63('0x48')][_0x0e63('0x4a')]?_0x4ac3c7['attributes']:_0x32d38d[_0x0e63('0x44')];_0x4ac3c7['order']=qs[_0x0e63('0x4d')](_0x3d568c[_0x0e63('0x46')]['sort']);_0x4ac3c7[_0x0e63('0x4e')]=qs[_0x0e63('0x4f')](_['pick'](_0x3d568c['query'],_0x32d38d['filters']));if(_0x3d568c[_0x0e63('0x46')][_0x0e63('0x6c')]){_0x4ac3c7[_0x0e63('0x4e')]=_['merge'](_0x4ac3c7[_0x0e63('0x4e')],{'$or':_[_0x0e63('0x45')](_0x4ac3c7['attributes'],function(_0x43ef6d){var _0xa8f256={};_0xa8f256[_0x43ef6d]={'$like':'%'+_0x3d568c[_0x0e63('0x46')][_0x0e63('0x6c')]+'%'};return _0xa8f256;})});}_0x4ac3c7=_[_0x0e63('0x51')]({},_0x4ac3c7,_0x3d568c[_0x0e63('0x53')]);return _0x40f22e['getAgents'](_0x4ac3c7);}})[_0x0e63('0x37')](function(_0x38932c){if(_0x38932c){_0x20a197=_0x38932c[_0x0e63('0x4a')];if(!_0x3d568c[_0x0e63('0x46')][_0x0e63('0x73')](_0x0e63('0x4b'))){_0x4ac3c7[_0x0e63('0x30')]=qs[_0x0e63('0x30')](_0x3d568c[_0x0e63('0x46')][_0x0e63('0x30')]);_0x4ac3c7[_0x0e63('0x2e')]=qs[_0x0e63('0x2e')](_0x3d568c[_0x0e63('0x46')][_0x0e63('0x2e')]);}return _0x40f22e[_0x0e63('0xbe')](_0x4ac3c7);}})[_0x0e63('0x37')](function(_0x1a7196){if(_0x1a7196){return _0x1a7196?{'count':_0x20a197,'rows':_0x1a7196}:null;}})['then'](respondWithResult(_0x25a96c,null))['catch'](handleError(_0x25a96c,null));};exports['send']=function(_0x3d2bf8,_0x3da2d5,_0x1e27d1){var _0x476bb2,_0x2f1089,_0x13813f;if(_['isNil'](_0x3d2bf8[_0x0e63('0x5e')][_0x0e63('0x5e')])||_0x3d2bf8[_0x0e63('0x5e')][_0x0e63('0x5e')]===''){throw new db[(_0x0e63('0x76'))][(_0x0e63('0x77'))](_0x0e63('0x80'));}if(_[_0x0e63('0x7e')](_0x3d2bf8['body']['to'])){}_0x476bb2=_0x3d2bf8[_0x0e63('0x5e')]['to'];return db['OpenchannelAccount'][_0x0e63('0x6b')]({'where':{'id':_0x3d2bf8[_0x0e63('0x59')]['id']}})[_0x0e63('0x37')](handleEntityNotFound(_0x3da2d5,null))[_0x0e63('0x37')](function(_0x3ba234){if(_0x3ba234){return db[_0x0e63('0x3f')][_0x0e63('0x5c')]({'where':{'id':_0x3ba234['id']},'include':[{'model':db['CmList'],'as':_0x0e63('0x8a'),'include':[{'model':db['CmContact'],'as':_0x0e63('0x91'),'where':{[_0x3ba234['mapKey']]:_0x476bb2},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x0e63('0x37')](handleEntityNotFound(_0x3da2d5,null))['then'](function(_0xbc4e3e){if(_0xbc4e3e&&_0xbc4e3e[_0x0e63('0x8a')]){_0x2f1089=_0xbc4e3e[_0x0e63('0x60')]({'plain':!![]});if(_0x2f1089[_0x0e63('0x8a')]&&_0x2f1089[_0x0e63('0x8a')][_0x0e63('0x91')][_0x0e63('0x4a')]){return _0x2f1089['List']['Contacts'][0x0];}return db[_0x0e63('0x86')]['create'](_[_0x0e63('0x1c')](_0x3d2bf8[_0x0e63('0x5e')],{'firstName':_0x476bb2,[_0xbc4e3e[_0x0e63('0x81')]]:_0x476bb2,'phone':_0x476bb2,'ListId':_0x2f1089[_0x0e63('0x7d')]}));}})[_0x0e63('0x37')](handleEntityNotFound(_0x3da2d5,null))[_0x0e63('0x37')](function(_0x560692){if(_0x560692){_0x13813f=_0x560692;return db[_0x0e63('0x95')]['find']({'where':{'ContactId':_0x13813f['id'],'closed':![],'OpenchannelAccountId':_0x2f1089['id']}})[_0x0e63('0x37')](function(_0x1d5992){if(_0x1d5992){return[_0x1d5992,![]];}return db['OpenchannelInteraction'][_0x0e63('0x5d')]({'UserId':_0x3d2bf8[_0x0e63('0x5f')]['id'],'ContactId':_0x13813f['id'],'OpenchannelAccountId':_0x2f1089['id'],'lastMsgDirection':_0x0e63('0xbf'),'firstMsgDirection':_0x0e63('0xbf'),'Messages':[_[_0x0e63('0x51')](_0x3d2bf8[_0x0e63('0x5e')],{'read':![],'body':_0x3d2bf8[_0x0e63('0x5e')][_0x0e63('0x5e')],'OpenchannelAccountId':_0x2f1089['id'],'UserId':_0x3d2bf8[_0x0e63('0x5f')]['id'],'ContactId':_0x13813f['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x0e63('0xc0')}]})[_0x0e63('0x37')](function(_0x4f7d14){return[_0x4f7d14,!![]];});});}})[_0x0e63('0x98')](function(_0xd5275a,_0x36f83f){if(_0x36f83f){return _0xd5275a;}return db[_0x0e63('0x9d')]['create'](_[_0x0e63('0x51')](_0x3d2bf8[_0x0e63('0x5e')],{'read':![],'body':_0x3d2bf8[_0x0e63('0x5e')][_0x0e63('0x5e')],'OpenchannelAccountId':_0x2f1089['id'],'OpenchannelInteractionId':_0xd5275a['id'],'UserId':_0x3d2bf8[_0x0e63('0x5f')]['id'],'ContactId':_0x13813f['id']}))[_0x0e63('0x37')](function(_0x32117a){_0xd5275a[_0x0e63('0xc1')][_0x0e63('0xc0')]=[];_0xd5275a[_0x0e63('0xc1')]['Messages'][_0x0e63('0xc2')](_0x32117a[_0x0e63('0xc1')]);return _0xd5275a;});});}})[_0x0e63('0x37')](respondWithResult(_0x3da2d5,null))[_0x0e63('0x57')](handleError(_0x3da2d5,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 05258b8..ec6040e 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 _0x6f7a=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x363a45,_0x243331){_0x363a45=_0x363a45-0x0;var _0x226aa2=_0x6f7a[_0x363a45];return _0x226aa2;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var OpenchannelAccount=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];OpenchannelAccount[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x702d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x2dbc55,_0x405df5){var _0xeabc2e=function(_0x311e1e){while(--_0x311e1e){_0x2dbc55['push'](_0x2dbc55['shift']());}};_0xeabc2e(++_0x405df5);}(_0x702d,0x147));var _0xd702=function(_0x551eca,_0x38e823){_0x551eca=_0x551eca-0x0;var _0x2e1462=_0x702d[_0x551eca];return _0x2e1462;};'use strict';var EventEmitter=require(_0xd702('0x0'));var OpenchannelAccount=require(_0xd702('0x1'))['db'][_0xd702('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd702('0x3')](0x0);var events={'afterCreate':_0xd702('0x4'),'afterUpdate':'update','afterDestroy':_0xd702('0x5')};function emitEvent(_0xebbd7c){return function(_0x27b260,_0x1c5a32,_0x481ee0){OpenchannelAccountEvents[_0xd702('0x6')](_0xebbd7c+':'+_0x27b260['id'],_0x27b260);OpenchannelAccountEvents['emit'](_0xebbd7c,_0x27b260);_0x481ee0(null);};}for(var e in events){if(events[_0xd702('0x7')](e)){var event=events[e];OpenchannelAccount[_0xd702('0x8')](e,emitEvent(event));}}module[_0xd702('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 48cea91..4ded5ad 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 _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x493de1,_0x5e6082){var _0x1aa68f=function(_0x184fa2){while(--_0x184fa2){_0x493de1['push'](_0x493de1['shift']());}};_0x1aa68f(++_0x5e6082);}(_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':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3b45ff,_0x42474f){var _0x433568=function(_0x2db66d){while(--_0x2db66d){_0x3b45ff['push'](_0x3b45ff['shift']());}};_0x433568(++_0x42474f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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':'openchannel_accounts','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 6fbb944..105a98a 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 _0x3c81=['bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x82868c,_0x27c921){var _0x2437bf=function(_0x2e5bd6){while(--_0x2e5bd6){_0x82868c['push'](_0x82868c['shift']());}};_0x2437bf(++_0x27c921);}(_0x3c81,0x102));var _0x13c8=function(_0x196b92,_0x41d057){_0x196b92=_0x196b92-0x0;var _0x1ebaba=_0x3c81[_0x196b92];return _0x1ebaba;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});config[_0x13c8('0x9')]=_[_0x13c8('0xa')](config['redis'],{'host':_0x13c8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13c8('0x9')]));require(_0x13c8('0xc'))[_0x13c8('0xd')](socket);function respondWithRpcPromise(_0x30b4d6,_0xaa58b6,_0x13c717){return new BPromise(function(_0x29074d,_0x2ce95a){return client[_0x13c8('0xe')](_0x30b4d6,_0x13c717)[_0x13c8('0xf')](function(_0x3ca0a6){logger[_0x13c8('0x10')](_0x13c8('0x11'),_0xaa58b6,_0x13c8('0x12'));logger['debug'](_0x13c8('0x13'),_0xaa58b6,_0x13c8('0x12'),JSON[_0x13c8('0x14')](_0x3ca0a6));if(_0x3ca0a6[_0x13c8('0x15')]){if(_0x3ca0a6['error'][_0x13c8('0x16')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0xaa58b6,_0x3ca0a6['error'][_0x13c8('0x17')]);return _0x2ce95a(_0x3ca0a6['error'][_0x13c8('0x17')]);}logger[_0x13c8('0x15')](_0x13c8('0x11'),_0xaa58b6,_0x3ca0a6[_0x13c8('0x15')]['message']);return _0x29074d(_0x3ca0a6[_0x13c8('0x15')][_0x13c8('0x17')]);}else{logger[_0x13c8('0x10')](_0x13c8('0x11'),_0xaa58b6,_0x13c8('0x12'));_0x29074d(_0x3ca0a6[_0x13c8('0x18')][_0x13c8('0x17')]);}})[_0x13c8('0x19')](function(_0x34fbc0){logger[_0x13c8('0x15')](_0x13c8('0x11'),_0xaa58b6,_0x34fbc0);_0x2ce95a(_0x34fbc0);});});} \ No newline at end of file +var _0x4058=['request','then','debug','code','error','message','OpenchannelAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket'];(function(_0x6541ca,_0x136b06){var _0x34074f=function(_0x2f0623){while(--_0x2f0623){_0x6541ca['push'](_0x6541ca['shift']());}};_0x34074f(++_0x136b06);}(_0x4058,0x129));var _0x8405=function(_0x81f0fc,_0x2c5785){_0x81f0fc=_0x81f0fc-0x0;var _0xd4667d=_0x4058[_0x81f0fc];return _0xd4667d;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var moment=require(_0x8405('0x2'));var BPromise=require(_0x8405('0x3'));var rs=require(_0x8405('0x4'));var fs=require('fs');var Redis=require(_0x8405('0x5'));var db=require(_0x8405('0x6'))['db'];var utils=require(_0x8405('0x7'));var logger=require(_0x8405('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8405('0x9')][_0x8405('0xa')]({'port':0x232a});config[_0x8405('0xb')]=_[_0x8405('0xc')](config[_0x8405('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8405('0xd'))(new Redis(config[_0x8405('0xb')]));require(_0x8405('0xe'))['register'](socket);function respondWithRpcPromise(_0x30705f,_0x5e132b,_0x6979fd){return new BPromise(function(_0xb442,_0x50344e){return client[_0x8405('0xf')](_0x30705f,_0x6979fd)[_0x8405('0x10')](function(_0x5b94d5){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5e132b,'request\x20sent');logger[_0x8405('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5e132b,'request\x20sent',JSON['stringify'](_0x5b94d5));if(_0x5b94d5['error']){if(_0x5b94d5['error'][_0x8405('0x12')]===0x1f4){logger[_0x8405('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0x50344e(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}logger['error'](_0x8405('0x15'),_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0xb442(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}else{logger[_0x8405('0x16')](_0x8405('0x15'),_0x5e132b,_0x8405('0x17'));_0xb442(_0x5b94d5[_0x8405('0x18')][_0x8405('0x14')]);}})[_0x8405('0x19')](function(_0x21376d){logger[_0x8405('0x13')](_0x8405('0x15'),_0x5e132b,_0x21376d);_0x50344e(_0x21376d);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 6aa794c..5cdd696 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 _0x2e31=['./openchannelAccount.events','save','remove','removeListener','openchannelAccount:'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x2e31,0x145));var _0x12e3=function(_0x393734,_0x413a8d){_0x393734=_0x393734-0x0;var _0xa795e0=_0x2e31[_0x393734];return _0xa795e0;};'use strict';var OpenchannelAccountEvents=require(_0x12e3('0x0'));var events=[_0x12e3('0x1'),_0x12e3('0x2'),'update'];function createListener(_0x152c5f,_0x217ada){return function(_0x503380){_0x217ada['emit'](_0x152c5f,_0x503380);};}function removeListener(_0x146b6b,_0x3d2ac0){return function(){OpenchannelAccountEvents[_0x12e3('0x3')](_0x146b6b,_0x3d2ac0);};}exports['register']=function(_0x3173f9){for(var _0x16ed6b=0x0,_0x5aefcf=events['length'];_0x16ed6b<_0x5aefcf;_0x16ed6b++){var _0x37f287=events[_0x16ed6b];var _0x403cc5=createListener(_0x12e3('0x4')+_0x37f287,_0x3173f9);OpenchannelAccountEvents['on'](_0x37f287,_0x403cc5);}}; \ No newline at end of file +var _0x876b=['emit','removeListener','register','openchannelAccount:','remove','update'];(function(_0x574bd5,_0x2ecbec){var _0x59a165=function(_0x2cd3ac){while(--_0x2cd3ac){_0x574bd5['push'](_0x574bd5['shift']());}};_0x59a165(++_0x2ecbec);}(_0x876b,0x1ba));var _0xb876=function(_0x1faf07,_0x461ef7){_0x1faf07=_0x1faf07-0x0;var _0xca25d=_0x876b[_0x1faf07];return _0xca25d;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xb876('0x0'),_0xb876('0x1')];function createListener(_0x5c6895,_0x569fc2){return function(_0x34a150){_0x569fc2[_0xb876('0x2')](_0x5c6895,_0x34a150);};}function removeListener(_0x4e24d3,_0x23429e){return function(){OpenchannelAccountEvents[_0xb876('0x3')](_0x4e24d3,_0x23429e);};}exports[_0xb876('0x4')]=function(_0x5e1da8){for(var _0x275125=0x0,_0x4353cf=events['length'];_0x275125<_0x4353cf;_0x275125++){var _0x309bfd=events[_0x275125];var _0xcbf343=createListener(_0xb876('0x5')+_0x309bfd,_0x5e1da8);OpenchannelAccountEvents['on'](_0x309bfd,_0xcbf343);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 839728e..bbdb264 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 _0x3400=['isAuthenticated','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x3400,0x96));var _0x0340=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x3400[_0x311909];return _0x8d3163;};'use strict';var multer=require(_0x0340('0x0'));var util=require(_0x0340('0x1'));var path=require(_0x0340('0x2'));var timeout=require(_0x0340('0x3'));var express=require(_0x0340('0x4'));var router=express[_0x0340('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0340('0x6'));var interaction=require(_0x0340('0x7'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0340('0x8')](_0x0340('0x9'),auth[_0x0340('0xa')](),controller[_0x0340('0xb')]);router[_0x0340('0xc')]('/',auth[_0x0340('0xa')](),controller['create']);router[_0x0340('0xd')](_0x0340('0x9'),auth[_0x0340('0xa')](),controller[_0x0340('0xe')]);router[_0x0340('0xf')](_0x0340('0x9'),auth[_0x0340('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6beb=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x6beb,0x101));var _0xb6be=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6beb[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xb6be('0x0'));var util=require('util');var path=require(_0xb6be('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb6be('0x2')]();var fs_extra=require(_0xb6be('0x3'));var auth=require(_0xb6be('0x4'));var interaction=require(_0xb6be('0x5'));var config=require(_0xb6be('0x6'));var controller=require(_0xb6be('0x7'));router[_0xb6be('0x8')]('/',auth[_0xb6be('0x9')](),controller[_0xb6be('0xa')]);router[_0xb6be('0x8')](_0xb6be('0xb'),auth['isAuthenticated'](),controller[_0xb6be('0xc')]);router[_0xb6be('0xd')]('/',auth[_0xb6be('0x9')](),controller[_0xb6be('0xe')]);router[_0xb6be('0xf')](_0xb6be('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xb6be('0x10')](_0xb6be('0xb'),auth[_0xb6be('0x9')](),controller[_0xb6be('0x11')]);module[_0xb6be('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 28bea5b..109b31e 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 _0xdb0e=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xdb0e,0x92));var _0xedb0=function(_0x1f5303,_0x354414){_0x1f5303=_0x1f5303-0x0;var _0x84ef1a=_0xdb0e[_0x1f5303];return _0x84ef1a;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xedb0('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xedb0('0x1')],'allowNull':![],'defaultValue':_0xedb0('0x2')},'appdata':{'type':Sequelize[_0xedb0('0x3')]()},'description':{'type':Sequelize[_0xedb0('0x1')]},'interval':{'type':Sequelize[_0xedb0('0x1')],'defaultValue':_0xedb0('0x4')}}; \ No newline at end of file +var _0xbdcc=['TEXT','STRING','sequelize','exports','INTEGER','noop'];(function(_0x2f9138,_0x493638){var _0x21e94e=function(_0x384e6d){while(--_0x384e6d){_0x2f9138['push'](_0x2f9138['shift']());}};_0x21e94e(++_0x493638);}(_0xbdcc,0x68));var _0xcbdc=function(_0x399dd1,_0x4719aa){_0x399dd1=_0x399dd1-0x0;var _0x3d88c8=_0xbdcc[_0x399dd1];return _0x3d88c8;};'use strict';var Sequelize=require(_0xcbdc('0x0'));module[_0xcbdc('0x1')]={'priority':{'type':Sequelize[_0xcbdc('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcbdc('0x3')},'appdata':{'type':Sequelize[_0xcbdc('0x4')]()},'description':{'type':Sequelize[_0xcbdc('0x5')]},'interval':{'type':Sequelize[_0xcbdc('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 7822034..e0f0692 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 _0xfe3c=['index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','OpenchannelApplication','findAll','rows','catch','keys','includeAll','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x268166,_0x49bca3){var _0x2ccfc1=function(_0x535acc){while(--_0x535acc){_0x268166['push'](_0x268166['shift']());}};_0x2ccfc1(++_0x49bca3);}(_0xfe3c,0x66));var _0xcfe3=function(_0xb2ecb9,_0x2646d0){_0xb2ecb9=_0xb2ecb9-0x0;var _0x381737=_0xfe3c[_0xb2ecb9];return _0x381737;};'use strict';var emlformat=require(_0xcfe3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfe3('0x1'));var jsonpatch=require(_0xcfe3('0x2'));var rp=require(_0xcfe3('0x3'));var moment=require('moment');var BPromise=require(_0xcfe3('0x4'));var Mustache=require(_0xcfe3('0x5'));var util=require('util');var path=require(_0xcfe3('0x6'));var sox=require(_0xcfe3('0x7'));var csv=require('to-csv');var ejs=require(_0xcfe3('0x8'));var fs=require('fs');var fs_extra=require(_0xcfe3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcfe3('0xa'));var deskjs=require(_0xcfe3('0xb'));var toCsv=require(_0xcfe3('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcfe3('0xd'));var hardwareService=require(_0xcfe3('0xe'));var logger=require(_0xcfe3('0xf'))(_0xcfe3('0x10'));var utils=require(_0xcfe3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xcfe3('0x12'));var db=require(_0xcfe3('0x13'))['db'];function respondWithStatusCode(_0x49063e,_0xba8add){_0xba8add=_0xba8add||0xcc;return function(_0x53efe8){if(_0x53efe8){return _0x49063e[_0xcfe3('0x14')](_0xba8add);}return _0x49063e[_0xcfe3('0x15')](_0xba8add)[_0xcfe3('0x16')]();};}function respondWithResult(_0x3140f6,_0x4e346b){_0x4e346b=_0x4e346b||0xc8;return function(_0x4efac7){if(_0x4efac7){return _0x3140f6[_0xcfe3('0x15')](_0x4e346b)[_0xcfe3('0x17')](_0x4efac7);}};}function respondWithFilteredResult(_0x31c54c,_0x474b05){return function(_0x2d1adc){if(_0x2d1adc){var _0x342a8c=typeof _0x474b05[_0xcfe3('0x18')]===_0xcfe3('0x19')&&typeof _0x474b05['limit']===_0xcfe3('0x19');var _0x4b1693=_0x2d1adc[_0xcfe3('0x1a')];var _0x4c59ff=_0x342a8c?0x0:_0x474b05[_0xcfe3('0x18')];var _0x568835=_0x342a8c?_0x2d1adc[_0xcfe3('0x1a')]:_0x474b05[_0xcfe3('0x18')]+_0x474b05[_0xcfe3('0x1b')];var _0x16f9c8;if(_0x568835>=_0x4b1693){_0x568835=_0x4b1693;_0x16f9c8=0xc8;}else{_0x16f9c8=0xce;}_0x31c54c[_0xcfe3('0x15')](_0x16f9c8);return _0x31c54c[_0xcfe3('0x1c')]('Content-Range',_0x4c59ff+'-'+_0x568835+'/'+_0x4b1693)['json'](_0x2d1adc);}return null;};}function patchUpdates(_0x51fca5){return function(_0x4046ff){try{jsonpatch['apply'](_0x4046ff,_0x51fca5,!![]);}catch(_0xfaac7e){return BPromise[_0xcfe3('0x1d')](_0xfaac7e);}return _0x4046ff[_0xcfe3('0x1e')]();};}function saveUpdates(_0x428439,_0x8a2a52){return function(_0x205651){if(_0x205651){return _0x205651[_0xcfe3('0x1f')](_0x428439)[_0xcfe3('0x20')](function(_0x549412){return _0x549412;});}return null;};}function removeEntity(_0x4b0fc1,_0x23d82b){return function(_0xe3732b){if(_0xe3732b){return _0xe3732b[_0xcfe3('0x21')]()[_0xcfe3('0x20')](function(){_0x4b0fc1[_0xcfe3('0x15')](0xcc)[_0xcfe3('0x16')]();});}};}function handleEntityNotFound(_0x525681,_0x2c16cb){return function(_0x5eda92){if(!_0x5eda92){_0x525681[_0xcfe3('0x14')](0x194);}return _0x5eda92;};}function handleError(_0x525912,_0x27e320){_0x27e320=_0x27e320||0x1f4;return function(_0x3ca955){logger[_0xcfe3('0x22')](_0x3ca955[_0xcfe3('0x23')]);if(_0x3ca955[_0xcfe3('0x24')]){delete _0x3ca955[_0xcfe3('0x24')];}_0x525912['status'](_0x27e320)[_0xcfe3('0x25')](_0x3ca955);};}exports[_0xcfe3('0x26')]=function(_0x1f5ea8,_0x4ab081){var _0x1c788b={},_0xd4036={},_0x20b89c={'count':0x0,'rows':[]};var _0x49e5f8=_['map'](db['OpenchannelApplication'][_0xcfe3('0x27')],function(_0x360458){return{'name':_0x360458[_0xcfe3('0x28')],'type':_0x360458[_0xcfe3('0x29')][_0xcfe3('0x2a')]};});_0xd4036[_0xcfe3('0x2b')]=_['map'](_0x49e5f8,_0xcfe3('0x24'));_0xd4036[_0xcfe3('0x2c')]=_['keys'](_0x1f5ea8[_0xcfe3('0x2c')]);_0xd4036[_0xcfe3('0x2d')]=_[_0xcfe3('0x2e')](_0xd4036[_0xcfe3('0x2b')],_0xd4036['query']);_0x1c788b[_0xcfe3('0x2f')]=_[_0xcfe3('0x2e')](_0xd4036['model'],qs[_0xcfe3('0x30')](_0x1f5ea8[_0xcfe3('0x2c')][_0xcfe3('0x30')]));_0x1c788b[_0xcfe3('0x2f')]=_0x1c788b[_0xcfe3('0x2f')][_0xcfe3('0x31')]?_0x1c788b[_0xcfe3('0x2f')]:_0xd4036[_0xcfe3('0x2b')];if(!_0x1f5ea8[_0xcfe3('0x2c')][_0xcfe3('0x32')](_0xcfe3('0x33'))){_0x1c788b[_0xcfe3('0x1b')]=qs[_0xcfe3('0x1b')](_0x1f5ea8[_0xcfe3('0x2c')][_0xcfe3('0x1b')]);_0x1c788b[_0xcfe3('0x18')]=qs[_0xcfe3('0x18')](_0x1f5ea8[_0xcfe3('0x2c')][_0xcfe3('0x18')]);}_0x1c788b[_0xcfe3('0x34')]=qs[_0xcfe3('0x35')](_0x1f5ea8[_0xcfe3('0x2c')]['sort']);_0x1c788b[_0xcfe3('0x36')]=qs[_0xcfe3('0x2d')](_[_0xcfe3('0x37')](_0x1f5ea8[_0xcfe3('0x2c')],_0xd4036[_0xcfe3('0x2d')]),_0x49e5f8);if(_0x1f5ea8['query']['filter']){_0x1c788b[_0xcfe3('0x36')]=_[_0xcfe3('0x38')](_0x1c788b[_0xcfe3('0x36')],{'$or':_['map'](_0x49e5f8,function(_0x1f47c0){if(_0x1f47c0[_0xcfe3('0x29')]!==_0xcfe3('0x39')){var _0x344807={};_0x344807[_0x1f47c0[_0xcfe3('0x24')]]={'$like':'%'+_0x1f5ea8[_0xcfe3('0x2c')][_0xcfe3('0x3a')]+'%'};return _0x344807;}})});}_0x1c788b=_[_0xcfe3('0x38')]({},_0x1c788b,_0x1f5ea8['options']);var _0x5f5df3={'where':_0x1c788b[_0xcfe3('0x36')]};return db['OpenchannelApplication'][_0xcfe3('0x1a')](_0x5f5df3)[_0xcfe3('0x20')](function(_0x3474d5){_0x20b89c[_0xcfe3('0x1a')]=_0x3474d5;if(_0x1f5ea8[_0xcfe3('0x2c')]['includeAll']){_0x1c788b[_0xcfe3('0x3b')]=[{'all':!![]}];}return db[_0xcfe3('0x3c')][_0xcfe3('0x3d')](_0x1c788b);})['then'](function(_0x4edeac){_0x20b89c[_0xcfe3('0x3e')]=_0x4edeac;return _0x20b89c;})['then'](respondWithFilteredResult(_0x4ab081,_0x1c788b))[_0xcfe3('0x3f')](handleError(_0x4ab081,null));};exports['show']=function(_0x187b2c,_0x1223af){var _0x151725={'raw':!![],'where':{'id':_0x187b2c['params']['id']}},_0x17c89e={};_0x17c89e[_0xcfe3('0x2b')]=_[_0xcfe3('0x40')](db[_0xcfe3('0x3c')][_0xcfe3('0x27')]);_0x17c89e['query']=_[_0xcfe3('0x40')](_0x187b2c[_0xcfe3('0x2c')]);_0x17c89e[_0xcfe3('0x2d')]=_['intersection'](_0x17c89e['model'],_0x17c89e['query']);_0x151725[_0xcfe3('0x2f')]=_[_0xcfe3('0x2e')](_0x17c89e[_0xcfe3('0x2b')],qs[_0xcfe3('0x30')](_0x187b2c['query'][_0xcfe3('0x30')]));_0x151725['attributes']=_0x151725[_0xcfe3('0x2f')]['length']?_0x151725['attributes']:_0x17c89e[_0xcfe3('0x2b')];if(_0x187b2c[_0xcfe3('0x2c')][_0xcfe3('0x41')]){_0x151725[_0xcfe3('0x3b')]=[{'all':!![]}];}_0x151725=_[_0xcfe3('0x38')]({},_0x151725,_0x187b2c['options']);return db[_0xcfe3('0x3c')][_0xcfe3('0x42')](_0x151725)[_0xcfe3('0x20')](handleEntityNotFound(_0x1223af,null))[_0xcfe3('0x20')](respondWithResult(_0x1223af,null))['catch'](handleError(_0x1223af,null));};exports[_0xcfe3('0x43')]=function(_0x37ee0e,_0x8e8507){return db[_0xcfe3('0x3c')][_0xcfe3('0x43')](_0x37ee0e[_0xcfe3('0x44')],{})[_0xcfe3('0x20')](respondWithResult(_0x8e8507,0xc9))['catch'](handleError(_0x8e8507,null));};exports[_0xcfe3('0x1f')]=function(_0x20b62b,_0x3e9fbc){if(_0x20b62b[_0xcfe3('0x44')]['id']){delete _0x20b62b[_0xcfe3('0x44')]['id'];}return db[_0xcfe3('0x3c')]['find']({'where':{'id':_0x20b62b['params']['id']}})['then'](handleEntityNotFound(_0x3e9fbc,null))[_0xcfe3('0x20')](saveUpdates(_0x20b62b[_0xcfe3('0x44')],null))[_0xcfe3('0x20')](respondWithResult(_0x3e9fbc,null))['catch'](handleError(_0x3e9fbc,null));};exports[_0xcfe3('0x21')]=function(_0x207e4c,_0x5b448a){return db['OpenchannelApplication'][_0xcfe3('0x42')]({'where':{'id':_0x207e4c[_0xcfe3('0x45')]['id']}})[_0xcfe3('0x20')](handleEntityNotFound(_0x5b448a,null))[_0xcfe3('0x20')](removeEntity(_0x5b448a,null))[_0xcfe3('0x3f')](handleError(_0x5b448a,null));}; \ No newline at end of file +var _0xce2e=['model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','OpenchannelApplication','rows','params','keys','rawAttributes','find','catch','create','body','eml-format','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','save','update','then','destroy','error','name','index'];(function(_0x2a0429,_0x61233b){var _0x227b95=function(_0x5b9fb5){while(--_0x5b9fb5){_0x2a0429['push'](_0x2a0429['shift']());}};_0x227b95(++_0x61233b);}(_0xce2e,0x1db));var _0xece2=function(_0x585dd8,_0x26f3a7){_0x585dd8=_0x585dd8-0x0;var _0x3447e5=_0xce2e[_0x585dd8];return _0x3447e5;};'use strict';var emlformat=require(_0xece2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xece2('0x1'));var moment=require(_0xece2('0x2'));var BPromise=require(_0xece2('0x3'));var Mustache=require('mustache');var util=require(_0xece2('0x4'));var path=require('path');var sox=require(_0xece2('0x5'));var csv=require(_0xece2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xece2('0x7'));var squel=require(_0xece2('0x8'));var crypto=require(_0xece2('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xece2('0xa'));var toCsv=require(_0xece2('0x6'));var querystring=require(_0xece2('0xb'));var Papa=require(_0xece2('0xc'));var Redis=require(_0xece2('0xd'));var authService=require(_0xece2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xece2('0xf'));var hardwareService=require(_0xece2('0x10'));var logger=require('../../config/logger')(_0xece2('0x11'));var utils=require('../../config/utils');var config=require(_0xece2('0x12'));var licenseUtil=require(_0xece2('0x13'));var db=require(_0xece2('0x14'))['db'];function respondWithStatusCode(_0x269957,_0x1d372a){_0x1d372a=_0x1d372a||0xcc;return function(_0x31cd91){if(_0x31cd91){return _0x269957[_0xece2('0x15')](_0x1d372a);}return _0x269957[_0xece2('0x16')](_0x1d372a)[_0xece2('0x17')]();};}function respondWithResult(_0xce80f9,_0x4e682a){_0x4e682a=_0x4e682a||0xc8;return function(_0x5a9a21){if(_0x5a9a21){return _0xce80f9[_0xece2('0x16')](_0x4e682a)[_0xece2('0x18')](_0x5a9a21);}};}function respondWithFilteredResult(_0xde3029,_0x46b3e5){return function(_0x505e53){if(_0x505e53){var _0x3df165=typeof _0x46b3e5[_0xece2('0x19')]==='undefined'&&typeof _0x46b3e5[_0xece2('0x1a')]===_0xece2('0x1b');var _0x58c3a1=_0x505e53['count'];var _0x5d62a=_0x3df165?0x0:_0x46b3e5[_0xece2('0x19')];var _0x29059e=_0x3df165?_0x505e53['count']:_0x46b3e5['offset']+_0x46b3e5[_0xece2('0x1a')];var _0xf6f5cd;if(_0x29059e>=_0x58c3a1){_0x29059e=_0x58c3a1;_0xf6f5cd=0xc8;}else{_0xf6f5cd=0xce;}_0xde3029[_0xece2('0x16')](_0xf6f5cd);return _0xde3029[_0xece2('0x1c')](_0xece2('0x1d'),_0x5d62a+'-'+_0x29059e+'/'+_0x58c3a1)['json'](_0x505e53);}return null;};}function patchUpdates(_0x2b877c){return function(_0x21d012){try{jsonpatch['apply'](_0x21d012,_0x2b877c,!![]);}catch(_0x264334){return BPromise['reject'](_0x264334);}return _0x21d012[_0xece2('0x1e')]();};}function saveUpdates(_0x4c0397,_0x4a7a43){return function(_0x2673d3){if(_0x2673d3){return _0x2673d3[_0xece2('0x1f')](_0x4c0397)[_0xece2('0x20')](function(_0x1fa8a1){return _0x1fa8a1;});}return null;};}function removeEntity(_0x43b0a3,_0xa4b07c){return function(_0x14c432){if(_0x14c432){return _0x14c432[_0xece2('0x21')]()[_0xece2('0x20')](function(){_0x43b0a3[_0xece2('0x16')](0xcc)[_0xece2('0x17')]();});}};}function handleEntityNotFound(_0x54533c,_0x59ebca){return function(_0x49dcea){if(!_0x49dcea){_0x54533c['sendStatus'](0x194);}return _0x49dcea;};}function handleError(_0x4ea02d,_0x13b0be){_0x13b0be=_0x13b0be||0x1f4;return function(_0x117e0e){logger[_0xece2('0x22')](_0x117e0e['stack']);if(_0x117e0e[_0xece2('0x23')]){delete _0x117e0e['name'];}_0x4ea02d[_0xece2('0x16')](_0x13b0be)['send'](_0x117e0e);};}exports[_0xece2('0x24')]=function(_0x9ad466,_0x24e7e1){var _0x56bd04={},_0x33f346={},_0x53d117={'count':0x0,'rows':[]};var _0x3147be=_['map'](db['OpenchannelApplication']['rawAttributes'],function(_0x4d1f04){return{'name':_0x4d1f04['fieldName'],'type':_0x4d1f04['type']['key']};});_0x33f346[_0xece2('0x25')]=_['map'](_0x3147be,_0xece2('0x23'));_0x33f346['query']=_['keys'](_0x9ad466[_0xece2('0x26')]);_0x33f346[_0xece2('0x27')]=_[_0xece2('0x28')](_0x33f346['model'],_0x33f346[_0xece2('0x26')]);_0x56bd04['attributes']=_[_0xece2('0x28')](_0x33f346[_0xece2('0x25')],qs[_0xece2('0x29')](_0x9ad466[_0xece2('0x26')][_0xece2('0x29')]));_0x56bd04[_0xece2('0x2a')]=_0x56bd04[_0xece2('0x2a')][_0xece2('0x2b')]?_0x56bd04[_0xece2('0x2a')]:_0x33f346[_0xece2('0x25')];if(!_0x9ad466[_0xece2('0x26')][_0xece2('0x2c')](_0xece2('0x2d'))){_0x56bd04['limit']=qs[_0xece2('0x1a')](_0x9ad466['query']['limit']);_0x56bd04[_0xece2('0x19')]=qs[_0xece2('0x19')](_0x9ad466[_0xece2('0x26')]['offset']);}_0x56bd04[_0xece2('0x2e')]=qs[_0xece2('0x2f')](_0x9ad466[_0xece2('0x26')][_0xece2('0x2f')]);_0x56bd04[_0xece2('0x30')]=qs[_0xece2('0x27')](_[_0xece2('0x31')](_0x9ad466[_0xece2('0x26')],_0x33f346['filters']),_0x3147be);if(_0x9ad466[_0xece2('0x26')][_0xece2('0x32')]){_0x56bd04[_0xece2('0x30')]=_['merge'](_0x56bd04[_0xece2('0x30')],{'$or':_['map'](_0x3147be,function(_0x449bd2){if(_0x449bd2['type']!=='VIRTUAL'){var _0x5130b5={};_0x5130b5[_0x449bd2[_0xece2('0x23')]]={'$like':'%'+_0x9ad466['query'][_0xece2('0x32')]+'%'};return _0x5130b5;}})});}_0x56bd04=_[_0xece2('0x33')]({},_0x56bd04,_0x9ad466[_0xece2('0x34')]);var _0x24c927={'where':_0x56bd04[_0xece2('0x30')]};return db['OpenchannelApplication'][_0xece2('0x35')](_0x24c927)['then'](function(_0x319376){_0x53d117[_0xece2('0x35')]=_0x319376;if(_0x9ad466[_0xece2('0x26')][_0xece2('0x36')]){_0x56bd04['include']=[{'all':!![]}];}return db[_0xece2('0x37')]['findAll'](_0x56bd04);})[_0xece2('0x20')](function(_0x2f73fd){_0x53d117[_0xece2('0x38')]=_0x2f73fd;return _0x53d117;})[_0xece2('0x20')](respondWithFilteredResult(_0x24e7e1,_0x56bd04))['catch'](handleError(_0x24e7e1,null));};exports['show']=function(_0x5cb4fa,_0x5ea517){var _0x4de988={'raw':!![],'where':{'id':_0x5cb4fa[_0xece2('0x39')]['id']}},_0x2dd35e={};_0x2dd35e[_0xece2('0x25')]=_[_0xece2('0x3a')](db['OpenchannelApplication'][_0xece2('0x3b')]);_0x2dd35e[_0xece2('0x26')]=_[_0xece2('0x3a')](_0x5cb4fa[_0xece2('0x26')]);_0x2dd35e['filters']=_[_0xece2('0x28')](_0x2dd35e[_0xece2('0x25')],_0x2dd35e[_0xece2('0x26')]);_0x4de988[_0xece2('0x2a')]=_[_0xece2('0x28')](_0x2dd35e[_0xece2('0x25')],qs[_0xece2('0x29')](_0x5cb4fa[_0xece2('0x26')]['fields']));_0x4de988[_0xece2('0x2a')]=_0x4de988[_0xece2('0x2a')][_0xece2('0x2b')]?_0x4de988[_0xece2('0x2a')]:_0x2dd35e[_0xece2('0x25')];if(_0x5cb4fa[_0xece2('0x26')][_0xece2('0x36')]){_0x4de988['include']=[{'all':!![]}];}_0x4de988=_[_0xece2('0x33')]({},_0x4de988,_0x5cb4fa[_0xece2('0x34')]);return db[_0xece2('0x37')][_0xece2('0x3c')](_0x4de988)[_0xece2('0x20')](handleEntityNotFound(_0x5ea517,null))[_0xece2('0x20')](respondWithResult(_0x5ea517,null))[_0xece2('0x3d')](handleError(_0x5ea517,null));};exports[_0xece2('0x3e')]=function(_0x15f20f,_0x3e97b6){return db[_0xece2('0x37')][_0xece2('0x3e')](_0x15f20f[_0xece2('0x3f')],{})[_0xece2('0x20')](respondWithResult(_0x3e97b6,0xc9))['catch'](handleError(_0x3e97b6,null));};exports[_0xece2('0x1f')]=function(_0x445409,_0x31b60a){if(_0x445409['body']['id']){delete _0x445409['body']['id'];}return db[_0xece2('0x37')][_0xece2('0x3c')]({'where':{'id':_0x445409['params']['id']}})[_0xece2('0x20')](handleEntityNotFound(_0x31b60a,null))[_0xece2('0x20')](saveUpdates(_0x445409['body'],null))['then'](respondWithResult(_0x31b60a,null))[_0xece2('0x3d')](handleError(_0x31b60a,null));};exports['destroy']=function(_0x442941,_0x55fc83){return db[_0xece2('0x37')][_0xece2('0x3c')]({'where':{'id':_0x442941[_0xece2('0x39')]['id']}})['then'](handleEntityNotFound(_0x55fc83,null))[_0xece2('0x20')](removeEntity(_0x55fc83,null))['catch'](handleError(_0x55fc83,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a36e4f1..1454725 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 _0xe545=['define','OpenchannelApplication','utf8mb4','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe545,0xcf));var _0x5e54=function(_0x103706,_0x537487){_0x103706=_0x103706-0x0;var _0x356716=_0xe545[_0x103706];return _0x356716;};'use strict';var _=require(_0x5e54('0x0'));var util=require(_0x5e54('0x1'));var logger=require(_0x5e54('0x2'))(_0x5e54('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e54('0x4'));var rimraf=require(_0x5e54('0x5'));var config=require(_0x5e54('0x6'));var attributes=require(_0x5e54('0x7'));module[_0x5e54('0x8')]=function(_0x3aa568,_0x3d73a3){return _0x3aa568[_0x5e54('0x9')](_0x5e54('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5e54('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf160=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x35db9d,_0x2ad7d7){var _0x1f6d09=function(_0x3b803b){while(--_0x3b803b){_0x35db9d['push'](_0x35db9d['shift']());}};_0x1f6d09(++_0x2ad7d7);}(_0xf160,0x161));var _0x0f16=function(_0x4dbbc1,_0x5db2ff){_0x4dbbc1=_0x4dbbc1-0x0;var _0x184837=_0xf160[_0x4dbbc1];return _0x184837;};'use strict';var _=require(_0x0f16('0x0'));var util=require(_0x0f16('0x1'));var logger=require(_0x0f16('0x2'))(_0x0f16('0x3'));var moment=require(_0x0f16('0x4'));var BPromise=require(_0x0f16('0x5'));var rp=require(_0x0f16('0x6'));var fs=require('fs');var path=require(_0x0f16('0x7'));var rimraf=require(_0x0f16('0x8'));var config=require(_0x0f16('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0x0f16('0xa')]=function(_0x1aa7e4,_0x38afa5){return _0x1aa7e4[_0x0f16('0xb')](_0x0f16('0xc'),attributes,{'tableName':_0x0f16('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0f16('0xe'),'collate':_0x0f16('0xf')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index eec350c..d08228a 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 _0xdaf7=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','then','debug','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x46483c,_0x35c6dc){var _0x281360=function(_0x54daf3){while(--_0x54daf3){_0x46483c['push'](_0x46483c['shift']());}};_0x281360(++_0x35c6dc);}(_0xdaf7,0x1f0));var _0x7daf=function(_0x2f826c,_0x290166){_0x2f826c=_0x2f826c-0x0;var _0x546e07=_0xdaf7[_0x2f826c];return _0x546e07;};'use strict';var _=require(_0x7daf('0x0'));var util=require('util');var moment=require(_0x7daf('0x1'));var BPromise=require(_0x7daf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7daf('0x3'));var db=require(_0x7daf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7daf('0x5'))(_0x7daf('0x6'));var config=require(_0x7daf('0x7'));var jayson=require(_0x7daf('0x8'));var client=jayson[_0x7daf('0x9')][_0x7daf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e7844,_0x15fea3,_0x27f1bd){return new BPromise(function(_0x4d2e6f,_0x2f5569){return client[_0x7daf('0xb')](_0x2e7844,_0x27f1bd)['then'](function(_0x121fdb){logger[_0x7daf('0xc')](_0x7daf('0xd'),_0x15fea3,'request\x20sent');logger['debug'](_0x7daf('0xe'),_0x15fea3,_0x7daf('0xf'),JSON['stringify'](_0x121fdb));if(_0x121fdb[_0x7daf('0x10')]){if(_0x121fdb[_0x7daf('0x10')]['code']===0x1f4){logger[_0x7daf('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x15fea3,_0x121fdb['error'][_0x7daf('0x11')]);return _0x2f5569(_0x121fdb[_0x7daf('0x10')][_0x7daf('0x11')]);}logger[_0x7daf('0x10')](_0x7daf('0xd'),_0x15fea3,_0x121fdb['error'][_0x7daf('0x11')]);return _0x4d2e6f(_0x121fdb[_0x7daf('0x10')][_0x7daf('0x11')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x15fea3,_0x7daf('0xf'));_0x4d2e6f(_0x121fdb['result'][_0x7daf('0x11')]);}})[_0x7daf('0x12')](function(_0x298e80){logger[_0x7daf('0x10')](_0x7daf('0xd'),_0x15fea3,_0x298e80);_0x2f5569(_0x298e80);});});}exports[_0x7daf('0x13')]=function(_0x219608){var _0x1e8261=this;return new Promise(function(_0x25cce6,_0x248a58){return db[_0x7daf('0x14')][_0x7daf('0x15')](_0x219608[_0x7daf('0x16')],{'raw':_0x219608[_0x7daf('0x17')]?_0x219608['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x219608['options']?_0x219608['options'][_0x7daf('0x18')]||null:null,'attributes':_0x219608['options']?_0x219608[_0x7daf('0x17')][_0x7daf('0x19')]||null:null,'limit':_0x219608[_0x7daf('0x17')]?_0x219608[_0x7daf('0x17')][_0x7daf('0x1a')]||null:null})[_0x7daf('0x1b')](function(_0x197dcd){logger[_0x7daf('0xc')](_0x7daf('0x13'),_0x219608);logger[_0x7daf('0x1c')](_0x7daf('0x13'),_0x219608,JSON[_0x7daf('0x1d')](_0x197dcd));_0x25cce6(_0x197dcd);})[_0x7daf('0x12')](function(_0x1e0d5b){logger[_0x7daf('0x10')](_0x7daf('0x13'),_0x1e0d5b['message'],_0x219608);_0x248a58(_0x1e8261[_0x7daf('0x10')](0x1f4,_0x1e0d5b['message']));});});}; \ No newline at end of file +var _0xda06=['options','raw','where','attributes','limit','UpdateOpenchannelApplication','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','error','code','message','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','result','catch','update','body'];(function(_0x54da3f,_0x3c3eb){var _0x2c9624=function(_0x2d7ade){while(--_0x2d7ade){_0x54da3f['push'](_0x54da3f['shift']());}};_0x2c9624(++_0x3c3eb);}(_0xda06,0x18e));var _0x6da0=function(_0x128d75,_0x7ef83c){_0x128d75=_0x128d75-0x0;var _0x2034e3=_0xda06[_0x128d75];return _0x2034e3;};'use strict';var _=require('lodash');var util=require(_0x6da0('0x0'));var moment=require(_0x6da0('0x1'));var BPromise=require(_0x6da0('0x2'));var rs=require(_0x6da0('0x3'));var fs=require('fs');var Redis=require(_0x6da0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6da0('0x5'))(_0x6da0('0x6'));var config=require(_0x6da0('0x7'));var jayson=require(_0x6da0('0x8'));var client=jayson[_0x6da0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cbf8c,_0x30d74d,_0x5b18eb){return new BPromise(function(_0x208ce2,_0x5e9e40){return client['request'](_0x1cbf8c,_0x5b18eb)[_0x6da0('0xa')](function(_0x1601f1){logger[_0x6da0('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x30d74d,'request\x20sent');logger[_0x6da0('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x30d74d,'request\x20sent',JSON['stringify'](_0x1601f1));if(_0x1601f1[_0x6da0('0xd')]){if(_0x1601f1[_0x6da0('0xd')][_0x6da0('0xe')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x30d74d,_0x1601f1[_0x6da0('0xd')][_0x6da0('0xf')]);return _0x5e9e40(_0x1601f1['error'][_0x6da0('0xf')]);}logger[_0x6da0('0xd')](_0x6da0('0x10'),_0x30d74d,_0x1601f1[_0x6da0('0xd')]['message']);return _0x208ce2(_0x1601f1[_0x6da0('0xd')]['message']);}else{logger[_0x6da0('0xb')](_0x6da0('0x10'),_0x30d74d,_0x6da0('0x11'));_0x208ce2(_0x1601f1[_0x6da0('0x12')][_0x6da0('0xf')]);}})[_0x6da0('0x13')](function(_0x21e57e){logger[_0x6da0('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x30d74d,_0x21e57e);_0x5e9e40(_0x21e57e);});});}exports['UpdateOpenchannelApplication']=function(_0x504786){var _0x5d560a=this;return new Promise(function(_0x1c0ae0,_0x27f217){return db['OpenchannelApplication'][_0x6da0('0x14')](_0x504786[_0x6da0('0x15')],{'raw':_0x504786[_0x6da0('0x16')]?_0x504786[_0x6da0('0x16')][_0x6da0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x504786[_0x6da0('0x16')]?_0x504786[_0x6da0('0x16')][_0x6da0('0x18')]||null:null,'attributes':_0x504786[_0x6da0('0x16')]?_0x504786['options'][_0x6da0('0x19')]||null:null,'limit':_0x504786[_0x6da0('0x16')]?_0x504786[_0x6da0('0x16')][_0x6da0('0x1a')]||null:null})['then'](function(_0x51e129){logger[_0x6da0('0xb')](_0x6da0('0x1b'),_0x504786);logger[_0x6da0('0xc')](_0x6da0('0x1b'),_0x504786,JSON['stringify'](_0x51e129));_0x1c0ae0(_0x51e129);})[_0x6da0('0x13')](function(_0x53e439){logger[_0x6da0('0xd')](_0x6da0('0x1b'),_0x53e439['message'],_0x504786);_0x27f217(_0x5d560a[_0x6da0('0xd')](0x1f4,_0x53e439[_0x6da0('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index d3bd55a..43263c9 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 _0xfe0e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x13e401,_0x365cc2){var _0x3b0468=function(_0x171693){while(--_0x171693){_0x13e401['push'](_0x13e401['shift']());}};_0x3b0468(++_0x365cc2);}(_0xfe0e,0x1e8));var _0xefe0=function(_0xe2794,_0x42caa5){_0xe2794=_0xe2794-0x0;var _0x578b5e=_0xfe0e[_0xe2794];return _0x578b5e;};'use strict';var multer=require(_0xefe0('0x0'));var util=require(_0xefe0('0x1'));var path=require(_0xefe0('0x2'));var timeout=require(_0xefe0('0x3'));var express=require(_0xefe0('0x4'));var router=express[_0xefe0('0x5')]();var fs_extra=require(_0xefe0('0x6'));var auth=require(_0xefe0('0x7'));var interaction=require(_0xefe0('0x8'));var config=require(_0xefe0('0x9'));var controller=require('./openchannelInteraction.controller');router[_0xefe0('0xa')]('/',auth[_0xefe0('0xb')](),controller[_0xefe0('0xc')]);router[_0xefe0('0xa')](_0xefe0('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xefe0('0xa')](_0xefe0('0xe'),auth[_0xefe0('0xb')](),controller['show']);router[_0xefe0('0xa')](_0xefe0('0xf'),auth[_0xefe0('0xb')](),controller['getMessages']);router[_0xefe0('0xa')](_0xefe0('0x10'),auth[_0xefe0('0xb')](),controller[_0xefe0('0x11')]);router[_0xefe0('0x12')]('/',auth[_0xefe0('0xb')](),controller[_0xefe0('0x13')]);router[_0xefe0('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0xefe0('0x14')]);router[_0xefe0('0x12')](_0xefe0('0x15'),auth[_0xefe0('0xb')](),interaction[_0xefe0('0x16')](_0xefe0('0x17'),_0xefe0('0x18')),controller[_0xefe0('0x19')]);router['put']('/:id',auth[_0xefe0('0xb')](),interaction[_0xefe0('0x16')](_0xefe0('0x17'),_0xefe0('0x1a')),controller[_0xefe0('0x1b')]);router[_0xefe0('0x1c')](_0xefe0('0xe'),auth[_0xefe0('0xb')](),interaction[_0xefe0('0x16')](_0xefe0('0x17'),_0xefe0('0x1d')),controller[_0xefe0('0x1e')]);router[_0xefe0('0x1c')]('/:id/tags',auth['isAuthenticated'](),controller[_0xefe0('0x1f')]);module[_0xefe0('0x20')]=router; \ No newline at end of file +var _0x9a3f=['/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','/:id','openchannelinteraction:update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','isAuthenticated','describe'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9a3f,0x9a));var _0xf9a3=function(_0x333b9a,_0x14ce97){_0x333b9a=_0x333b9a-0x0;var _0x18670e=_0x9a3f[_0x333b9a];return _0x18670e;};'use strict';var multer=require(_0xf9a3('0x0'));var util=require('util');var path=require(_0xf9a3('0x1'));var timeout=require(_0xf9a3('0x2'));var express=require(_0xf9a3('0x3'));var router=express[_0xf9a3('0x4')]();var fs_extra=require(_0xf9a3('0x5'));var auth=require(_0xf9a3('0x6'));var interaction=require(_0xf9a3('0x7'));var config=require(_0xf9a3('0x8'));var controller=require(_0xf9a3('0x9'));router[_0xf9a3('0xa')]('/',auth['isAuthenticated'](),controller[_0xf9a3('0xb')]);router[_0xf9a3('0xa')]('/describe',auth[_0xf9a3('0xc')](),controller[_0xf9a3('0xd')]);router[_0xf9a3('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf9a3('0xa')](_0xf9a3('0xe'),auth['isAuthenticated'](),controller[_0xf9a3('0xf')]);router[_0xf9a3('0xa')](_0xf9a3('0x10'),auth[_0xf9a3('0xc')](),controller['download']);router[_0xf9a3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf9a3('0x11')](_0xf9a3('0xe'),auth[_0xf9a3('0xc')](),controller[_0xf9a3('0x12')]);router[_0xf9a3('0x11')](_0xf9a3('0x13'),auth[_0xf9a3('0xc')](),interaction[_0xf9a3('0x14')](_0xf9a3('0x15'),_0xf9a3('0x16')),controller['addTags']);router['put'](_0xf9a3('0x17'),auth['isAuthenticated'](),interaction[_0xf9a3('0x14')](_0xf9a3('0x15'),_0xf9a3('0x18')),controller['update']);router[_0xf9a3('0x19')](_0xf9a3('0x17'),auth[_0xf9a3('0xc')](),interaction[_0xf9a3('0x14')](_0xf9a3('0x15'),'openchannelinteraction:destroy'),controller[_0xf9a3('0x1a')]);router[_0xf9a3('0x19')](_0xf9a3('0x13'),auth[_0xf9a3('0xc')](),controller['removeTags']);module[_0xf9a3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index ce14b39..fb6104a 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 _0xcee0=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xcee0,0x1e1));var _0x0cee=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0xcee0[_0x45c262];return _0x4f2ba6;};'use strict';var Sequelize=require(_0x0cee('0x0'));module[_0x0cee('0x1')]={'closed':{'type':Sequelize[_0x0cee('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0cee('0x3')]},'disposition':{'type':Sequelize[_0x0cee('0x4')]},'secondDisposition':{'type':Sequelize[_0x0cee('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0cee('0x4')]},'note':{'type':Sequelize[_0x0cee('0x4')]},'read1stAt':{'type':Sequelize[_0x0cee('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x0cee('0x4')]},'lastMsgAt':{'type':Sequelize[_0x0cee('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0cee('0x5')]('in',_0x0cee('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x0cee('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0cee('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x0cee('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x9ef8=['DATE','STRING','ENUM','out','BOOLEAN','sequelize','exports'];(function(_0x587eb7,_0x475975){var _0x5b9da7=function(_0x4230c4){while(--_0x4230c4){_0x587eb7['push'](_0x587eb7['shift']());}};_0x5b9da7(++_0x475975);}(_0x9ef8,0x17f));var _0x89ef=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x9ef8[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0x89ef('0x0'));module[_0x89ef('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x89ef('0x2')]},'disposition':{'type':Sequelize[_0x89ef('0x3')]},'secondDisposition':{'type':Sequelize[_0x89ef('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x89ef('0x3')]},'read1stAt':{'type':Sequelize[_0x89ef('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x89ef('0x4')]('in',_0x89ef('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x89ef('0x4')]('in',_0x89ef('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x89ef('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x89ef('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index e0a20dd..36e9ba8 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 _0xf012=['pipe','createWriteStream','basename','out','renderFile','views','.pdf','Unable\x20to\x20delete\x20zip\x20file','zip-dir','util','path','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','update','then','error','stack','send','map','OpenchannelInteraction','fieldName','key','findAll','query','user','catch','show','type','from','params','model','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','keys','hasOwnProperty','nolimit','limit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','name','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','format','User','fullname','push','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','get','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','threadId','Public','Private','existsSync'];(function(_0x1eda18,_0x2ec45d){var _0x4f6b41=function(_0x5f3cbe){while(--_0x5f3cbe){_0x1eda18['push'](_0x1eda18['shift']());}};_0x4f6b41(++_0x2ec45d);}(_0xf012,0x84));var _0x2f01=function(_0x40634d,_0x2b64da){_0x40634d=_0x40634d-0x0;var _0x51f357=_0xf012[_0x40634d];return _0x51f357;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x2f01('0x0'));var moment=require('moment');var util=require(_0x2f01('0x1'));var path=require(_0x2f01('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x2f01('0x3'));var qs=require(_0x2f01('0x4'));var pdf=require(_0x2f01('0x5'));var logger=require(_0x2f01('0x6'))(_0x2f01('0x7'));var config=require(_0x2f01('0x8'));var db=require(_0x2f01('0x9'))['db'];config[_0x2f01('0xa')]=_[_0x2f01('0xb')](config['redis'],{'host':_0x2f01('0xc'),'port':0x18eb});var socket=require(_0x2f01('0xd'))(new Redis(config[_0x2f01('0xa')]));require(_0x2f01('0xe'))[_0x2f01('0xf')](socket);function respondWithStatusCode(_0x1d20fe,_0x73f093){_0x73f093=_0x73f093||0xcc;return function(_0x5a1b1b){if(_0x5a1b1b){return _0x1d20fe[_0x2f01('0x10')](_0x73f093);}return _0x1d20fe['status'](_0x73f093)[_0x2f01('0x11')]();};}function respondWithResult(_0x20bdf7,_0x149925){_0x149925=_0x149925||0xc8;return function(_0x134f4b){if(_0x134f4b){return _0x20bdf7[_0x2f01('0x12')](_0x149925)['json'](_0x134f4b);}};}function respondWithFilteredResult(_0x44d3f6,_0x4e4f8d){return function(_0x3639dd){if(_0x3639dd){var _0x1146dc=typeof _0x4e4f8d[_0x2f01('0x13')]==='undefined'&&typeof _0x4e4f8d['limit']===_0x2f01('0x14');var _0x26f08a=_0x3639dd['count'];var _0x398911=_0x1146dc?0x0:_0x4e4f8d['offset'];var _0x2f4e4e=_0x1146dc?_0x3639dd[_0x2f01('0x15')]:_0x4e4f8d[_0x2f01('0x13')]+_0x4e4f8d['limit'];var _0x4db2d9;if(_0x2f4e4e>=_0x26f08a){_0x2f4e4e=_0x26f08a;_0x4db2d9=0xc8;}else{_0x4db2d9=0xce;}_0x44d3f6[_0x2f01('0x12')](_0x4db2d9);return _0x44d3f6[_0x2f01('0x16')](_0x2f01('0x17'),_0x398911+'-'+_0x2f4e4e+'/'+_0x26f08a)[_0x2f01('0x18')](_0x3639dd);}return null;};}function saveUpdates(_0x47166f){return function(_0x8f7849){if(_0x8f7849){return _0x8f7849[_0x2f01('0x19')](_0x47166f)[_0x2f01('0x1a')](function(_0x2bafc7){return _0x2bafc7;});}return null;};}function removeEntity(_0xfd9842){return function(_0x35e436){if(_0x35e436){return _0x35e436['destroy']()[_0x2f01('0x1a')](function(){_0xfd9842[_0x2f01('0x12')](0xcc)[_0x2f01('0x11')]();});}};}function handleEntityNotFound(_0x3d3eca){return function(_0x5a9ddf){if(!_0x5a9ddf){_0x3d3eca[_0x2f01('0x10')](0x194);}return _0x5a9ddf;};}function handleError(_0x3eb8f6,_0x3293fb){_0x3293fb=_0x3293fb||0x1f4;return function(_0x386a70){logger[_0x2f01('0x1b')](_0x386a70[_0x2f01('0x1c')]);if(_0x386a70['name']){delete _0x386a70['name'];}_0x3eb8f6['status'](_0x3293fb)[_0x2f01('0x1d')](_0x386a70);};}exports['index']=function(_0x22650a,_0x355b13){var _0x5ba961={};var _0x18c78b=_[_0x2f01('0x1e')](db[_0x2f01('0x1f')]['rawAttributes'],function(_0x583643){return{'name':_0x583643[_0x2f01('0x20')],'type':_0x583643['type'][_0x2f01('0x21')]};});_0x5ba961=qs['getOptions'](_0x18c78b,_0x22650a);return interaction[_0x2f01('0x22')]('openchannel',_0x22650a[_0x2f01('0x23')],_0x22650a[_0x2f01('0x24')],_0x5ba961,_0x18c78b)['then'](respondWithFilteredResult(_0x355b13,_0x5ba961))[_0x2f01('0x25')](handleError(_0x355b13,null));};exports[_0x2f01('0x26')]=function(_0x50a233,_0x227d45){var _0x4317ab={};if(_0x50a233[_0x2f01('0x23')][_0x2f01('0x27')]&&_0x50a233['query'][_0x2f01('0x27')]===_0x2f01('0x28')){_0x4317ab[_0x2f01('0x28')]=_0x50a233[_0x2f01('0x29')]['id'];}else{_0x4317ab['id']=_0x50a233['params']['id'];}var _0x1d60e9={'raw':![],'where':_0x4317ab},_0x6afe38={};_0x6afe38[_0x2f01('0x2a')]=_['keys'](db['OpenchannelInteraction'][_0x2f01('0x2b')]);_0x6afe38[_0x2f01('0x23')]=_['keys'](_0x50a233[_0x2f01('0x23')]);_0x6afe38[_0x2f01('0x2c')]=_[_0x2f01('0x2d')](_0x6afe38[_0x2f01('0x2a')],_0x6afe38[_0x2f01('0x23')]);_0x1d60e9[_0x2f01('0x2e')]=_[_0x2f01('0x2d')](_0x6afe38[_0x2f01('0x2a')],qs['fields'](_0x50a233[_0x2f01('0x23')][_0x2f01('0x2f')]));_0x1d60e9[_0x2f01('0x2e')]=_0x1d60e9['attributes'][_0x2f01('0x30')]?_0x1d60e9[_0x2f01('0x2e')]:_0x6afe38[_0x2f01('0x2a')];if(_0x50a233['query'][_0x2f01('0x31')]){_0x1d60e9[_0x2f01('0x32')]=[{'all':!![]}];}_0x1d60e9=_[_0x2f01('0x33')]({},_0x1d60e9,_0x50a233[_0x2f01('0x34')]);return db[_0x2f01('0x1f')][_0x2f01('0x35')](_0x1d60e9)[_0x2f01('0x1a')](handleEntityNotFound(_0x227d45,null))[_0x2f01('0x1a')](respondWithResult(_0x227d45,null))['catch'](handleError(_0x227d45,null));};exports[_0x2f01('0x36')]=function(_0x74b5cf,_0x59804b){return db[_0x2f01('0x1f')][_0x2f01('0x36')](_0x74b5cf[_0x2f01('0x37')],{})[_0x2f01('0x1a')](respondWithResult(_0x59804b,0xc9))[_0x2f01('0x25')](handleError(_0x59804b,null));};exports[_0x2f01('0x19')]=function(_0x13a1fe,_0x4e5a7e){if(_0x13a1fe[_0x2f01('0x37')]['id']){delete _0x13a1fe[_0x2f01('0x37')]['id'];}return db['OpenchannelInteraction'][_0x2f01('0x35')]({'where':{'id':_0x13a1fe[_0x2f01('0x29')]['id']}})[_0x2f01('0x1a')](handleEntityNotFound(_0x4e5a7e,null))[_0x2f01('0x1a')](saveUpdates(_0x13a1fe[_0x2f01('0x37')],null))[_0x2f01('0x1a')](respondWithResult(_0x4e5a7e,null))[_0x2f01('0x25')](handleError(_0x4e5a7e,null));};exports['destroy']=function(_0x575677,_0x35580c){return db['OpenchannelInteraction'][_0x2f01('0x35')]({'where':{'id':_0x575677[_0x2f01('0x29')]['id']}})['then'](handleEntityNotFound(_0x35580c,null))[_0x2f01('0x1a')](removeEntity(_0x35580c,null))[_0x2f01('0x25')](handleError(_0x35580c,null));};exports[_0x2f01('0x38')]=function(_0x49ed14,_0x2a306b){return db[_0x2f01('0x1f')][_0x2f01('0x38')]()['then'](respondWithResult(_0x2a306b,null))[_0x2f01('0x25')](handleError(_0x2a306b,null));};exports[_0x2f01('0x39')]=function(_0x13faa9,_0x82fdf1){return db[_0x2f01('0x3a')]['find']({'where':{'id':_0x13faa9[_0x2f01('0x29')]['id']}})['then'](handleEntityNotFound(_0x82fdf1,null))[_0x2f01('0x1a')](function(_0x489d48){if(_0x489d48){return _0x489d48[_0x2f01('0x39')](_0x13faa9[_0x2f01('0x37')][_0x2f01('0x3b')],_[_0x2f01('0x3c')](_0x13faa9[_0x2f01('0x37')],[_0x2f01('0x3b'),'id'])||{});}})[_0x2f01('0x1a')](respondWithResult(_0x82fdf1,null))[_0x2f01('0x25')](handleError(_0x82fdf1,null));};exports['getMessages']=function(_0x2d7fb1,_0x1cea4b){var _0x5e24cb={'raw':![],'where':{}};var _0x52fd50={};var _0x1bf3c9={'count':0x0,'rows':[]};return db[_0x2f01('0x1f')]['findOne']({'where':{'id':_0x2d7fb1[_0x2f01('0x29')]['id']}})['then'](handleEntityNotFound(_0x1cea4b,null))[_0x2f01('0x1a')](function(_0x738a2a){if(_0x738a2a){_0x52fd50[_0x2f01('0x2a')]=_[_0x2f01('0x3d')](db[_0x2f01('0x3a')][_0x2f01('0x2b')]);_0x52fd50[_0x2f01('0x23')]=_[_0x2f01('0x3d')](_0x2d7fb1[_0x2f01('0x23')]);_0x52fd50[_0x2f01('0x2c')]=_['intersection'](_0x52fd50[_0x2f01('0x2a')],_0x52fd50['query']);_0x5e24cb[_0x2f01('0x2e')]=_[_0x2f01('0x2d')](_0x52fd50['model'],qs['fields'](_0x2d7fb1[_0x2f01('0x23')][_0x2f01('0x2f')]));_0x5e24cb[_0x2f01('0x2e')]=_0x5e24cb[_0x2f01('0x2e')]['length']?_0x5e24cb[_0x2f01('0x2e')]:_0x52fd50['model'];if(!_0x2d7fb1[_0x2f01('0x23')][_0x2f01('0x3e')](_0x2f01('0x3f'))){_0x5e24cb[_0x2f01('0x40')]=qs[_0x2f01('0x40')](_0x2d7fb1['query'][_0x2f01('0x40')]);_0x5e24cb[_0x2f01('0x13')]=qs['offset'](_0x2d7fb1['query'][_0x2f01('0x13')]);}_0x5e24cb[_0x2f01('0x41')]=qs['sort'](_0x2d7fb1['query'][_0x2f01('0x42')]);_0x5e24cb[_0x2f01('0x43')]=qs['filters'](_['pick'](_0x2d7fb1[_0x2f01('0x23')],_0x52fd50[_0x2f01('0x2c')]));_0x5e24cb[_0x2f01('0x43')][_0x2f01('0x44')]=_0x738a2a['id'];if(_0x2d7fb1[_0x2f01('0x23')][_0x2f01('0x45')]){_0x5e24cb[_0x2f01('0x43')]=_[_0x2f01('0x33')](_0x5e24cb['where'],{'$or':_[_0x2f01('0x1e')](_0x5e24cb['attributes'],function(_0x529f63){var _0x16531f={};_0x16531f[_0x529f63]={'$like':'%'+_0x2d7fb1[_0x2f01('0x23')]['filter']+'%'};return _0x16531f;})});}if(_0x2d7fb1[_0x2f01('0x23')][_0x2f01('0x46')]){var _0x137174=_0x2d7fb1[_0x2f01('0x23')][_0x2f01('0x46')][_0x2f01('0x47')](',');var _0x1d6c75={};_0x1d6c75[_0x137174[0x0]]={'$gte':moment(_0x137174[0x1])['format'](_0x2f01('0x48'))};_0x5e24cb[_0x2f01('0x43')]=_[_0x2f01('0x33')](_0x5e24cb[_0x2f01('0x43')],_0x1d6c75);}_0x5e24cb=_['merge']({},_0x5e24cb,_0x2d7fb1['options']);return db['OpenchannelMessage']['count']({'where':_0x5e24cb[_0x2f01('0x43')]})[_0x2f01('0x1a')](function(_0x48f1bf){_0x1bf3c9['count']=_0x48f1bf;if(_0x2d7fb1[_0x2f01('0x23')][_0x2f01('0x31')]){_0x5e24cb[_0x2f01('0x32')]=[{'all':!![]}];}return db[_0x2f01('0x3a')][_0x2f01('0x22')](_0x5e24cb);})[_0x2f01('0x1a')](function(_0x18bfd6){_0x1bf3c9[_0x2f01('0x49')]=_0x18bfd6;return _0x1bf3c9;});}})[_0x2f01('0x1a')](respondWithFilteredResult(_0x1cea4b,_0x5e24cb))[_0x2f01('0x25')](handleError(_0x1cea4b,null));};exports[_0x2f01('0x4a')]=function(_0x51ec45,_0x524d2f){return db[_0x2f01('0x1f')][_0x2f01('0x35')]({'where':{'id':_0x51ec45[_0x2f01('0x29')]['id']}})[_0x2f01('0x1a')](handleEntityNotFound(_0x524d2f,null))['then'](function(_0x11c36d){if(_0x11c36d){return _0x11c36d[_0x2f01('0x4b')](_0x51ec45[_0x2f01('0x37')][_0x2f01('0x3b')],_[_0x2f01('0x3c')](_0x51ec45[_0x2f01('0x37')],['ids','id'])||{})[_0x2f01('0x4c')](function(){return db[_0x2f01('0x4d')]['findAll']({'attributes':['id',_0x2f01('0x4e'),'color'],'where':{'id':_0x51ec45['body']['ids']}});})[_0x2f01('0x1a')](function(_0x1647eb){socket[_0x2f01('0x4f')](_0x2f01('0x50'),{'id':Number(_0x51ec45['params']['id']),'tags':_0x1647eb||[]});return{'id':Number(_0x51ec45[_0x2f01('0x29')]['id']),'tags':_0x1647eb||[]};});}})[_0x2f01('0x1a')](respondWithResult(_0x524d2f,null))[_0x2f01('0x25')](handleError(_0x524d2f,null));};exports[_0x2f01('0x51')]=function(_0x1b25a7,_0x504da3){return db['OpenchannelInteraction']['find']({'where':{'id':_0x1b25a7[_0x2f01('0x29')]['id']}})['then'](handleEntityNotFound(_0x504da3,null))['then'](function(_0x48fe14){if(_0x48fe14){return _0x48fe14[_0x2f01('0x51')](_0x1b25a7[_0x2f01('0x23')]['ids']);}})[_0x2f01('0x1a')](respondWithStatusCode(_0x504da3,null))['catch'](handleError(_0x504da3,null));};exports[_0x2f01('0x52')]=function(_0x24ecd2,_0xdcca00){var _0x305507=moment()[_0x2f01('0x53')]()[_0x2f01('0x54')]();var _0x274c13=path[_0x2f01('0x55')](config[_0x2f01('0x56')],_0x2f01('0x57'),'files','tmp');var _0x5ad4ba=path[_0x2f01('0x55')](config[_0x2f01('0x56')],_0x2f01('0x57'),_0x2f01('0x58'),_0x2f01('0x59'));var _0x71fd85=path['join'](_0x274c13,_0x305507);var _0x49de7b=util[_0x2f01('0x5a')]('transcript-%d-%s.zip',_0x24ecd2[_0x2f01('0x29')]['id'],_0x305507);var _0x5f55ab=path['join'](_0x274c13,_0x49de7b);var _0x9ed01=[];_0x9ed01['push']({'model':db[_0x2f01('0x5b')],'as':'User','attributes':['id',_0x2f01('0x5c')],'raw':!![]});_0x9ed01[_0x2f01('0x5d')]({'model':db[_0x2f01('0x5e')],'as':_0x2f01('0x5f'),'attributes':['id',_0x2f01('0x60'),_0x2f01('0x61')],'raw':!![]});if(_0x24ecd2[_0x2f01('0x23')][_0x2f01('0x59')]){_0x9ed01[_0x2f01('0x5d')]({'model':db[_0x2f01('0x62')],'as':'Attachment','raw':!![]});}var _0x3ad3ab=[{'model':db[_0x2f01('0x3a')],'as':_0x2f01('0x63'),'attributes':['id',_0x2f01('0x37'),_0x2f01('0x64'),_0x2f01('0x65'),_0x2f01('0x66'),_0x2f01('0x67')],'include':_0x9ed01}];_0x3ad3ab[_0x2f01('0x5d')]({'model':db['OpenchannelAccount'],'as':_0x2f01('0x68'),'attributes':['id',_0x2f01('0x4e')]});_0x3ad3ab[_0x2f01('0x5d')]({'model':db['User'],'as':'Owner','attributes':['id',_0x2f01('0x5c')]});return db[_0x2f01('0x1f')]['find']({'where':{'id':_0x24ecd2[_0x2f01('0x29')]['id']},'include':_0x3ad3ab})[_0x2f01('0x1a')](handleEntityNotFound(_0xdcca00,null))[_0x2f01('0x1a')](function(_0x26230c){if(_0x26230c){var _0x5ba866=_0x26230c[_0x2f01('0x69')]({'plain':!![]});fs[_0x2f01('0x6a')](_0x71fd85);var _0x84000f={'channel':_0x2f01('0x6b'),'account':_0x5ba866[_0x2f01('0x68')][_0x2f01('0x4e')],'agent':_0x5ba866['Owner']?_0x5ba866[_0x2f01('0x6c')][_0x2f01('0x5c')]:_0x2f01('0x6d'),'createdAt':moment(_0x5ba866[_0x2f01('0x64')])[_0x2f01('0x5a')](_0x2f01('0x48'))['toString'](),'closedAt':_0x5ba866[_0x2f01('0x6e')]?moment(_0x5ba866[_0x2f01('0x6f')])[_0x2f01('0x5a')](_0x2f01('0x48'))['toString']():'','disposition':_0x5ba866['disposition'],'visibility':_0x5ba866[_0x2f01('0x70')]?_0x2f01('0x71'):_0x2f01('0x72'),'messages':_(_0x5ba866[_0x2f01('0x63')])['filter']({'secret':![]})[_0x2f01('0x1e')](function(_0xea6987){if(_0xea6987[_0x2f01('0x62')]){var _0x44a51d=path[_0x2f01('0x55')](_0x5ad4ba,_0xea6987[_0x2f01('0x62')]['basename']);if(fs[_0x2f01('0x73')](_0x44a51d)){fs['createReadStream'](_0x44a51d)[_0x2f01('0x74')](fs[_0x2f01('0x75')](path[_0x2f01('0x55')](_0x71fd85,_0xea6987['Attachment']['basename'])));}}return{'date':moment(_0xea6987[_0x2f01('0x64')])[_0x2f01('0x5a')](_0x2f01('0x48'))['toString'](),'sender':_0xea6987['direction']==='out'?_0xea6987[_0x2f01('0x5b')]?_0xea6987['User'][_0x2f01('0x5c')]:'System':_0xea6987['Contact'][_0x2f01('0x60')]+(_0xea6987[_0x2f01('0x5f')][_0x2f01('0x61')]?'\x20'+_0xea6987[_0x2f01('0x5f')][_0x2f01('0x61')]:''),'body':_0xea6987[_0x2f01('0x62')]?_0xea6987[_0x2f01('0x62')][_0x2f01('0x76')]:_0xea6987[_0x2f01('0x37')],'direction':_0xea6987[_0x2f01('0x65')]===_0x2f01('0x77')?'A':'C','secret':_0xea6987[_0x2f01('0x66')],'read':_0xea6987[_0x2f01('0x67')],'attachment':_0xea6987[_0x2f01('0x62')]};})['value']()};return ejs[_0x2f01('0x78')](path[_0x2f01('0x55')](config[_0x2f01('0x56')],_0x2f01('0x57'),_0x2f01('0x79'),'downloadInteraction.ejs'),{'interaction':_0x84000f})['then'](function(_0x1ae1b6){var _0x440124=path[_0x2f01('0x55')](_0x71fd85,'transcript-'+_0x5ba866['id']+'-'+_0x305507+_0x2f01('0x7a'));var _0x4b88a6={'path':_0x440124,'channel':'Openchannel','interactionId':_0x5ba866['id']};return pdf['createPdfFromHTML'](_0x1ae1b6,_0x4b88a6);})['then'](function(){return new Promise(function(_0x24112b,_0x1bd9e0){zipdir(_0x71fd85,{'saveTo':_0x5f55ab},function(_0x53e441,_0xb21f64){if(_0x53e441)return _0x1bd9e0(_0x53e441);return _0x24112b(_0xb21f64);});})['then'](function(){return new Promise(function(_0x3aec25,_0x1e2d48){rimraf(_0x71fd85,function(_0x167c77){if(_0x167c77)_0x1e2d48(_0x167c77);return _0x3aec25();});});})[_0x2f01('0x1a')](function(){return _0xdcca00['download'](_0x5f55ab,_0x49de7b,function(_0x5803a4){if(_0x5803a4){logger[_0x2f01('0x1b')](_0x2f01('0x7b'),_0x5803a4);}else{fs['unlinkSync'](_0x5f55ab);}});});});}else{return _0xdcca00[_0x2f01('0x10')](0xc8);}})[_0x2f01('0x25')](handleError(_0xdcca00,null));}; \ No newline at end of file +var _0xc4b0=['error','name','send','index','map','fieldName','type','key','getOptions','findAll','openchannel','query','catch','show','params','keys','OpenchannelInteraction','rawAttributes','filters','intersection','model','fields','attributes','length','options','find','create','body','destroy','describe','addMessage','omit','getMessages','OpenchannelMessage','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','merge','includeAll','include','addTags','setTags','ids','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','files','tmp','join','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','read','Account','mkdirSync','Openchannel','Owner','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','createWriteStream','direction','System','out','secret','value','root','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus'];(function(_0x2520ae,_0x308b9b){var _0x28a6c1=function(_0x54874c){while(--_0x54874c){_0x2520ae['push'](_0x2520ae['shift']());}};_0x28a6c1(++_0x308b9b);}(_0xc4b0,0x15f));var _0x0c4b=function(_0x4c2537,_0x20afdf){_0x4c2537=_0x4c2537-0x0;var _0x94fb5c=_0xc4b0[_0x4c2537];return _0x94fb5c;};'use strict';var rimraf=require(_0x0c4b('0x0'));var zipdir=require(_0x0c4b('0x1'));var moment=require(_0x0c4b('0x2'));var util=require(_0x0c4b('0x3'));var path=require(_0x0c4b('0x4'));var ejs=require(_0x0c4b('0x5'));var fs=require('fs');var _=require(_0x0c4b('0x6'));var Redis=require(_0x0c4b('0x7'));var interaction=require(_0x0c4b('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x0c4b('0x9'));var logger=require(_0x0c4b('0xa'))(_0x0c4b('0xb'));var config=require(_0x0c4b('0xc'));var db=require(_0x0c4b('0xd'))['db'];config[_0x0c4b('0xe')]=_[_0x0c4b('0xf')](config[_0x0c4b('0xe')],{'host':_0x0c4b('0x10'),'port':0x18eb});var socket=require(_0x0c4b('0x11'))(new Redis(config[_0x0c4b('0xe')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3f7119,_0x2644a){_0x2644a=_0x2644a||0xcc;return function(_0x188e81){if(_0x188e81){return _0x3f7119['sendStatus'](_0x2644a);}return _0x3f7119[_0x0c4b('0x12')](_0x2644a)[_0x0c4b('0x13')]();};}function respondWithResult(_0x372722,_0x481e6f){_0x481e6f=_0x481e6f||0xc8;return function(_0xa5a82){if(_0xa5a82){return _0x372722['status'](_0x481e6f)[_0x0c4b('0x14')](_0xa5a82);}};}function respondWithFilteredResult(_0x688c57,_0x17fd7){return function(_0x359b61){if(_0x359b61){var _0x4ffec3=typeof _0x17fd7[_0x0c4b('0x15')]===_0x0c4b('0x16')&&typeof _0x17fd7[_0x0c4b('0x17')]===_0x0c4b('0x16');var _0x4d0108=_0x359b61[_0x0c4b('0x18')];var _0x29ff89=_0x4ffec3?0x0:_0x17fd7[_0x0c4b('0x15')];var _0x4cb510=_0x4ffec3?_0x359b61[_0x0c4b('0x18')]:_0x17fd7[_0x0c4b('0x15')]+_0x17fd7['limit'];var _0x2fcc4c;if(_0x4cb510>=_0x4d0108){_0x4cb510=_0x4d0108;_0x2fcc4c=0xc8;}else{_0x2fcc4c=0xce;}_0x688c57[_0x0c4b('0x12')](_0x2fcc4c);return _0x688c57[_0x0c4b('0x19')](_0x0c4b('0x1a'),_0x29ff89+'-'+_0x4cb510+'/'+_0x4d0108)[_0x0c4b('0x14')](_0x359b61);}return null;};}function saveUpdates(_0x1180c2){return function(_0x298397){if(_0x298397){return _0x298397[_0x0c4b('0x1b')](_0x1180c2)[_0x0c4b('0x1c')](function(_0x1c9937){return _0x1c9937;});}return null;};}function removeEntity(_0x209e0a){return function(_0x4fc070){if(_0x4fc070){return _0x4fc070['destroy']()[_0x0c4b('0x1c')](function(){_0x209e0a[_0x0c4b('0x12')](0xcc)[_0x0c4b('0x13')]();});}};}function handleEntityNotFound(_0x4b0ee6){return function(_0x11215e){if(!_0x11215e){_0x4b0ee6[_0x0c4b('0x1d')](0x194);}return _0x11215e;};}function handleError(_0x2295ed,_0xf5dd3f){_0xf5dd3f=_0xf5dd3f||0x1f4;return function(_0x2dc3b3){logger[_0x0c4b('0x1e')](_0x2dc3b3['stack']);if(_0x2dc3b3[_0x0c4b('0x1f')]){delete _0x2dc3b3['name'];}_0x2295ed[_0x0c4b('0x12')](_0xf5dd3f)[_0x0c4b('0x20')](_0x2dc3b3);};}exports[_0x0c4b('0x21')]=function(_0x4aa5b5,_0x4d952a){var _0x34bd28={};var _0x1c1ec9=_[_0x0c4b('0x22')](db['OpenchannelInteraction']['rawAttributes'],function(_0x272ff7){return{'name':_0x272ff7[_0x0c4b('0x23')],'type':_0x272ff7[_0x0c4b('0x24')][_0x0c4b('0x25')]};});_0x34bd28=qs[_0x0c4b('0x26')](_0x1c1ec9,_0x4aa5b5);return interaction[_0x0c4b('0x27')](_0x0c4b('0x28'),_0x4aa5b5[_0x0c4b('0x29')],_0x4aa5b5['user'],_0x34bd28,_0x1c1ec9)[_0x0c4b('0x1c')](respondWithFilteredResult(_0x4d952a,_0x34bd28))[_0x0c4b('0x2a')](handleError(_0x4d952a,null));};exports[_0x0c4b('0x2b')]=function(_0x4c0373,_0x2d6a7e){var _0x143785={};if(_0x4c0373[_0x0c4b('0x29')]['type']&&_0x4c0373[_0x0c4b('0x29')][_0x0c4b('0x24')]==='from'){_0x143785['from']=_0x4c0373['params']['id'];}else{_0x143785['id']=_0x4c0373[_0x0c4b('0x2c')]['id'];}var _0x5d8177={'raw':![],'where':_0x143785},_0x3ae408={};_0x3ae408['model']=_[_0x0c4b('0x2d')](db[_0x0c4b('0x2e')][_0x0c4b('0x2f')]);_0x3ae408[_0x0c4b('0x29')]=_['keys'](_0x4c0373[_0x0c4b('0x29')]);_0x3ae408[_0x0c4b('0x30')]=_[_0x0c4b('0x31')](_0x3ae408['model'],_0x3ae408[_0x0c4b('0x29')]);_0x5d8177['attributes']=_['intersection'](_0x3ae408[_0x0c4b('0x32')],qs[_0x0c4b('0x33')](_0x4c0373[_0x0c4b('0x29')]['fields']));_0x5d8177[_0x0c4b('0x34')]=_0x5d8177[_0x0c4b('0x34')][_0x0c4b('0x35')]?_0x5d8177[_0x0c4b('0x34')]:_0x3ae408['model'];if(_0x4c0373['query']['includeAll']){_0x5d8177['include']=[{'all':!![]}];}_0x5d8177=_['merge']({},_0x5d8177,_0x4c0373[_0x0c4b('0x36')]);return db['OpenchannelInteraction'][_0x0c4b('0x37')](_0x5d8177)[_0x0c4b('0x1c')](handleEntityNotFound(_0x2d6a7e,null))[_0x0c4b('0x1c')](respondWithResult(_0x2d6a7e,null))[_0x0c4b('0x2a')](handleError(_0x2d6a7e,null));};exports['create']=function(_0x6a2b1,_0x3f0ae9){return db[_0x0c4b('0x2e')][_0x0c4b('0x38')](_0x6a2b1[_0x0c4b('0x39')],{})[_0x0c4b('0x1c')](respondWithResult(_0x3f0ae9,0xc9))[_0x0c4b('0x2a')](handleError(_0x3f0ae9,null));};exports['update']=function(_0x2fd795,_0x128fd4){if(_0x2fd795['body']['id']){delete _0x2fd795[_0x0c4b('0x39')]['id'];}return db['OpenchannelInteraction'][_0x0c4b('0x37')]({'where':{'id':_0x2fd795[_0x0c4b('0x2c')]['id']}})[_0x0c4b('0x1c')](handleEntityNotFound(_0x128fd4,null))[_0x0c4b('0x1c')](saveUpdates(_0x2fd795['body'],null))[_0x0c4b('0x1c')](respondWithResult(_0x128fd4,null))[_0x0c4b('0x2a')](handleError(_0x128fd4,null));};exports[_0x0c4b('0x3a')]=function(_0x5211e1,_0x3212f4){return db[_0x0c4b('0x2e')][_0x0c4b('0x37')]({'where':{'id':_0x5211e1[_0x0c4b('0x2c')]['id']}})[_0x0c4b('0x1c')](handleEntityNotFound(_0x3212f4,null))[_0x0c4b('0x1c')](removeEntity(_0x3212f4,null))[_0x0c4b('0x2a')](handleError(_0x3212f4,null));};exports['describe']=function(_0xfc4e7b,_0x895b06){return db[_0x0c4b('0x2e')][_0x0c4b('0x3b')]()[_0x0c4b('0x1c')](respondWithResult(_0x895b06,null))['catch'](handleError(_0x895b06,null));};exports['addMessage']=function(_0x3efa0a,_0x31bb85){return db['OpenchannelMessage'][_0x0c4b('0x37')]({'where':{'id':_0x3efa0a[_0x0c4b('0x2c')]['id']}})[_0x0c4b('0x1c')](handleEntityNotFound(_0x31bb85,null))[_0x0c4b('0x1c')](function(_0x2d29d7){if(_0x2d29d7){return _0x2d29d7[_0x0c4b('0x3c')](_0x3efa0a['body']['ids'],_[_0x0c4b('0x3d')](_0x3efa0a['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x31bb85,null))['catch'](handleError(_0x31bb85,null));};exports[_0x0c4b('0x3e')]=function(_0x4abf25,_0x296c25){var _0x4183dc={'raw':![],'where':{}};var _0x4dc79b={};var _0xc48648={'count':0x0,'rows':[]};return db[_0x0c4b('0x2e')]['findOne']({'where':{'id':_0x4abf25[_0x0c4b('0x2c')]['id']}})[_0x0c4b('0x1c')](handleEntityNotFound(_0x296c25,null))['then'](function(_0x4c5ded){if(_0x4c5ded){_0x4dc79b[_0x0c4b('0x32')]=_[_0x0c4b('0x2d')](db[_0x0c4b('0x3f')][_0x0c4b('0x2f')]);_0x4dc79b['query']=_[_0x0c4b('0x2d')](_0x4abf25[_0x0c4b('0x29')]);_0x4dc79b[_0x0c4b('0x30')]=_['intersection'](_0x4dc79b[_0x0c4b('0x32')],_0x4dc79b[_0x0c4b('0x29')]);_0x4183dc['attributes']=_[_0x0c4b('0x31')](_0x4dc79b[_0x0c4b('0x32')],qs[_0x0c4b('0x33')](_0x4abf25[_0x0c4b('0x29')][_0x0c4b('0x33')]));_0x4183dc[_0x0c4b('0x34')]=_0x4183dc['attributes'][_0x0c4b('0x35')]?_0x4183dc[_0x0c4b('0x34')]:_0x4dc79b[_0x0c4b('0x32')];if(!_0x4abf25['query']['hasOwnProperty'](_0x0c4b('0x40'))){_0x4183dc[_0x0c4b('0x17')]=qs[_0x0c4b('0x17')](_0x4abf25[_0x0c4b('0x29')][_0x0c4b('0x17')]);_0x4183dc['offset']=qs[_0x0c4b('0x15')](_0x4abf25['query'][_0x0c4b('0x15')]);}_0x4183dc[_0x0c4b('0x41')]=qs['sort'](_0x4abf25[_0x0c4b('0x29')][_0x0c4b('0x42')]);_0x4183dc[_0x0c4b('0x43')]=qs[_0x0c4b('0x30')](_[_0x0c4b('0x44')](_0x4abf25[_0x0c4b('0x29')],_0x4dc79b[_0x0c4b('0x30')]));_0x4183dc[_0x0c4b('0x43')][_0x0c4b('0x45')]=_0x4c5ded['id'];if(_0x4abf25['query']['filter']){_0x4183dc[_0x0c4b('0x43')]=_['merge'](_0x4183dc[_0x0c4b('0x43')],{'$or':_[_0x0c4b('0x22')](_0x4183dc[_0x0c4b('0x34')],function(_0xded229){var _0x2290ae={};_0x2290ae[_0xded229]={'$like':'%'+_0x4abf25[_0x0c4b('0x29')][_0x0c4b('0x46')]+'%'};return _0x2290ae;})});}if(_0x4abf25['query']['$gte']){var _0x236b3e=_0x4abf25[_0x0c4b('0x29')][_0x0c4b('0x47')]['split'](',');var _0x8ce3c0={};_0x8ce3c0[_0x236b3e[0x0]]={'$gte':moment(_0x236b3e[0x1])[_0x0c4b('0x48')](_0x0c4b('0x49'))};_0x4183dc['where']=_[_0x0c4b('0x4a')](_0x4183dc[_0x0c4b('0x43')],_0x8ce3c0);}_0x4183dc=_[_0x0c4b('0x4a')]({},_0x4183dc,_0x4abf25['options']);return db[_0x0c4b('0x3f')][_0x0c4b('0x18')]({'where':_0x4183dc[_0x0c4b('0x43')]})[_0x0c4b('0x1c')](function(_0x513500){_0xc48648[_0x0c4b('0x18')]=_0x513500;if(_0x4abf25[_0x0c4b('0x29')][_0x0c4b('0x4b')]){_0x4183dc[_0x0c4b('0x4c')]=[{'all':!![]}];}return db[_0x0c4b('0x3f')][_0x0c4b('0x27')](_0x4183dc);})[_0x0c4b('0x1c')](function(_0x4c7903){_0xc48648['rows']=_0x4c7903;return _0xc48648;});}})[_0x0c4b('0x1c')](respondWithFilteredResult(_0x296c25,_0x4183dc))[_0x0c4b('0x2a')](handleError(_0x296c25,null));};exports[_0x0c4b('0x4d')]=function(_0x3c2d0e,_0x306c1c){return db[_0x0c4b('0x2e')][_0x0c4b('0x37')]({'where':{'id':_0x3c2d0e[_0x0c4b('0x2c')]['id']}})['then'](handleEntityNotFound(_0x306c1c,null))[_0x0c4b('0x1c')](function(_0x36f23f){if(_0x36f23f){return _0x36f23f[_0x0c4b('0x4e')](_0x3c2d0e[_0x0c4b('0x39')][_0x0c4b('0x4f')],_[_0x0c4b('0x3d')](_0x3c2d0e[_0x0c4b('0x39')],[_0x0c4b('0x4f'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0c4b('0x1f'),_0x0c4b('0x50')],'where':{'id':_0x3c2d0e[_0x0c4b('0x39')]['ids']}});})[_0x0c4b('0x1c')](function(_0x304ca4){socket[_0x0c4b('0x51')](_0x0c4b('0x52'),{'id':Number(_0x3c2d0e['params']['id']),'tags':_0x304ca4||[]});return{'id':Number(_0x3c2d0e['params']['id']),'tags':_0x304ca4||[]};});}})[_0x0c4b('0x1c')](respondWithResult(_0x306c1c,null))[_0x0c4b('0x2a')](handleError(_0x306c1c,null));};exports[_0x0c4b('0x53')]=function(_0x5c4415,_0x52373d){return db[_0x0c4b('0x2e')]['find']({'where':{'id':_0x5c4415[_0x0c4b('0x2c')]['id']}})[_0x0c4b('0x1c')](handleEntityNotFound(_0x52373d,null))[_0x0c4b('0x1c')](function(_0x23e6d5){if(_0x23e6d5){return _0x23e6d5['removeTags'](_0x5c4415['query'][_0x0c4b('0x4f')]);}})[_0x0c4b('0x1c')](respondWithStatusCode(_0x52373d,null))[_0x0c4b('0x2a')](handleError(_0x52373d,null));};exports[_0x0c4b('0x54')]=function(_0x45c0d7,_0x59fd2b){var _0x45b972=moment()[_0x0c4b('0x55')]()[_0x0c4b('0x56')]();var _0x15f76e=path['join'](config['root'],'server',_0x0c4b('0x57'),_0x0c4b('0x58'));var _0x3e72fd=path[_0x0c4b('0x59')](config['root'],_0x0c4b('0x5a'),_0x0c4b('0x57'),_0x0c4b('0x5b'));var _0x249b23=path[_0x0c4b('0x59')](_0x15f76e,_0x45b972);var _0x55738a=util[_0x0c4b('0x48')](_0x0c4b('0x5c'),_0x45c0d7[_0x0c4b('0x2c')]['id'],_0x45b972);var _0x4d9280=path[_0x0c4b('0x59')](_0x15f76e,_0x55738a);var _0x26e040=[];_0x26e040[_0x0c4b('0x5d')]({'model':db[_0x0c4b('0x5e')],'as':_0x0c4b('0x5e'),'attributes':['id',_0x0c4b('0x5f')],'raw':!![]});_0x26e040[_0x0c4b('0x5d')]({'model':db[_0x0c4b('0x60')],'as':_0x0c4b('0x61'),'attributes':['id',_0x0c4b('0x62'),_0x0c4b('0x63')],'raw':!![]});if(_0x45c0d7[_0x0c4b('0x29')][_0x0c4b('0x5b')]){_0x26e040[_0x0c4b('0x5d')]({'model':db[_0x0c4b('0x64')],'as':_0x0c4b('0x64'),'raw':!![]});}var _0x5b3b15=[{'model':db[_0x0c4b('0x3f')],'as':_0x0c4b('0x65'),'attributes':['id',_0x0c4b('0x39'),_0x0c4b('0x66'),'direction','secret',_0x0c4b('0x67')],'include':_0x26e040}];_0x5b3b15['push']({'model':db['OpenchannelAccount'],'as':_0x0c4b('0x68'),'attributes':['id',_0x0c4b('0x1f')]});_0x5b3b15[_0x0c4b('0x5d')]({'model':db[_0x0c4b('0x5e')],'as':'Owner','attributes':['id','fullname']});return db[_0x0c4b('0x2e')][_0x0c4b('0x37')]({'where':{'id':_0x45c0d7['params']['id']},'include':_0x5b3b15})[_0x0c4b('0x1c')](handleEntityNotFound(_0x59fd2b,null))['then'](function(_0x49d2af){if(_0x49d2af){var _0x5dd903=_0x49d2af['get']({'plain':!![]});fs[_0x0c4b('0x69')](_0x249b23);var _0x51f0f1={'channel':_0x0c4b('0x6a'),'account':_0x5dd903[_0x0c4b('0x68')][_0x0c4b('0x1f')],'agent':_0x5dd903[_0x0c4b('0x6b')]?_0x5dd903[_0x0c4b('0x6b')][_0x0c4b('0x5f')]:'N.A.','createdAt':moment(_0x5dd903[_0x0c4b('0x66')])['format'](_0x0c4b('0x49'))[_0x0c4b('0x56')](),'closedAt':_0x5dd903[_0x0c4b('0x6c')]?moment(_0x5dd903[_0x0c4b('0x6d')])[_0x0c4b('0x48')](_0x0c4b('0x49'))[_0x0c4b('0x56')]():'','disposition':_0x5dd903[_0x0c4b('0x6e')],'visibility':_0x5dd903[_0x0c4b('0x6f')]?'Public':_0x0c4b('0x70'),'messages':_(_0x5dd903[_0x0c4b('0x65')])[_0x0c4b('0x46')]({'secret':![]})[_0x0c4b('0x22')](function(_0x13066d){if(_0x13066d['Attachment']){var _0x3f6cba=path['join'](_0x3e72fd,_0x13066d[_0x0c4b('0x64')][_0x0c4b('0x71')]);if(fs[_0x0c4b('0x72')](_0x3f6cba)){fs[_0x0c4b('0x73')](_0x3f6cba)['pipe'](fs[_0x0c4b('0x74')](path[_0x0c4b('0x59')](_0x249b23,_0x13066d[_0x0c4b('0x64')][_0x0c4b('0x71')])));}}return{'date':moment(_0x13066d[_0x0c4b('0x66')])[_0x0c4b('0x48')](_0x0c4b('0x49'))[_0x0c4b('0x56')](),'sender':_0x13066d[_0x0c4b('0x75')]==='out'?_0x13066d['User']?_0x13066d[_0x0c4b('0x5e')][_0x0c4b('0x5f')]:_0x0c4b('0x76'):_0x13066d[_0x0c4b('0x61')][_0x0c4b('0x62')]+(_0x13066d[_0x0c4b('0x61')][_0x0c4b('0x63')]?'\x20'+_0x13066d[_0x0c4b('0x61')]['lastName']:''),'body':_0x13066d[_0x0c4b('0x64')]?_0x13066d[_0x0c4b('0x64')][_0x0c4b('0x71')]:_0x13066d[_0x0c4b('0x39')],'direction':_0x13066d[_0x0c4b('0x75')]===_0x0c4b('0x77')?'A':'C','secret':_0x13066d[_0x0c4b('0x78')],'read':_0x13066d[_0x0c4b('0x67')],'attachment':_0x13066d[_0x0c4b('0x64')]};})[_0x0c4b('0x79')]()};return ejs['renderFile'](path['join'](config[_0x0c4b('0x7a')],_0x0c4b('0x5a'),'views','downloadInteraction.ejs'),{'interaction':_0x51f0f1})[_0x0c4b('0x1c')](function(_0x45f6d8){var _0x4c2419=path[_0x0c4b('0x59')](_0x249b23,_0x0c4b('0x7b')+_0x5dd903['id']+'-'+_0x45b972+_0x0c4b('0x7c'));var _0x259c59={'path':_0x4c2419,'channel':_0x0c4b('0x6a'),'interactionId':_0x5dd903['id']};return pdf[_0x0c4b('0x7d')](_0x45f6d8,_0x259c59);})[_0x0c4b('0x1c')](function(){return new Promise(function(_0x5c35a0,_0x558b42){zipdir(_0x249b23,{'saveTo':_0x4d9280},function(_0x5ba8db,_0x38b5b1){if(_0x5ba8db)return _0x558b42(_0x5ba8db);return _0x5c35a0(_0x38b5b1);});})[_0x0c4b('0x1c')](function(){return new Promise(function(_0x35e686,_0x90ea66){rimraf(_0x249b23,function(_0x1f1566){if(_0x1f1566)_0x90ea66(_0x1f1566);return _0x35e686();});});})[_0x0c4b('0x1c')](function(){return _0x59fd2b[_0x0c4b('0x54')](_0x4d9280,_0x55738a,function(_0x4fc410){if(_0x4fc410){logger[_0x0c4b('0x1e')]('Unable\x20to\x20delete\x20zip\x20file',_0x4fc410);}else{fs[_0x0c4b('0x7e')](_0x4d9280);}});});});}else{return _0x59fd2b[_0x0c4b('0x1d')](0xc8);}})['catch'](handleError(_0x59fd2b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 284d1ce..0c00de2 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 _0x3e86=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','getUsers','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e86,0xdb));var _0x63e8=function(_0x4ce00e,_0x2da722){_0x4ce00e=_0x4ce00e-0x0;var _0x36935e=_0x3e86[_0x4ce00e];return _0x36935e;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x63e8('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x63e8('0x0'))['db'][_0x63e8('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x63e8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f0f11){return function(_0x34a77f,_0x20deeb,_0x4e7baa){_0x34a77f[_0x63e8('0x3')]({'attributes':['id'],'raw':!![]})[_0x63e8('0x4')](function(_0xe59677){_0x34a77f[_0x63e8('0x5')](_0x63e8('0x6'),_0xe59677[_0x63e8('0x7')](function(_0x542480){return{'id':_0x542480['id']};}));return OpenchannelMessage[_0x63e8('0x8')]({'where':{'OpenchannelInteractionId':_0x34a77f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x342c04){_0x34a77f[_0x63e8('0x5')](_0x63e8('0x9'),_0x342c04[_0x63e8('0xa')]);OpenchannelInteractionEvents[_0x63e8('0xb')](_0x2f0f11+':'+_0x34a77f['id'],_0x34a77f);OpenchannelInteractionEvents['emit'](_0x2f0f11,_0x34a77f);_0x4e7baa(null);})[_0x63e8('0xc')](_0x4e7baa(null));};}for(var e in events){if(events[_0x63e8('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x63e8('0xe')](e,emitEvent(event));}}module[_0x63e8('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x8777=['then','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x1276f5,_0x5153e2){var _0x14d765=function(_0x1c943a){while(--_0x1c943a){_0x1276f5['push'](_0x1276f5['shift']());}};_0x14d765(++_0x5153e2);}(_0x8777,0xe9));var _0x7877=function(_0x55d504,_0x539ccd){_0x55d504=_0x55d504-0x0;var _0x38841c=_0x8777[_0x55d504];return _0x38841c;};'use strict';var EventEmitter=require(_0x7877('0x0'));var OpenchannelInteraction=require(_0x7877('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x7877('0x1'))['db'][_0x7877('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7877('0x3')](0x0);var events={'afterCreate':_0x7877('0x4'),'afterUpdate':_0x7877('0x5'),'afterDestroy':_0x7877('0x6')};function emitEvent(_0x49ff78){return function(_0x41d807,_0x240016,_0x4b3931){_0x41d807['getUsers']({'attributes':['id'],'raw':!![]})[_0x7877('0x7')](function(_0x544da4){_0x41d807['setDataValue']('Users',_0x544da4['map'](function(_0x4516da){return{'id':_0x4516da['id']};}));return OpenchannelMessage[_0x7877('0x8')]({'where':{'OpenchannelInteractionId':_0x41d807['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7877('0x7')](function(_0x4f6e55){_0x41d807['setDataValue']('unreadMessages',_0x4f6e55[_0x7877('0x9')]);OpenchannelInteractionEvents[_0x7877('0xa')](_0x49ff78+':'+_0x41d807['id'],_0x41d807);OpenchannelInteractionEvents[_0x7877('0xa')](_0x49ff78,_0x41d807);_0x4b3931(null);})[_0x7877('0xb')](_0x4b3931(null));};}for(var e in events){if(events[_0x7877('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x7877('0xd')](e,emitEvent(event));}}module[_0x7877('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 5c0c28a..89c873c 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 _0xff39=['rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x402eff,_0x2525f2){var _0x2eb371=function(_0x15e9b3){while(--_0x15e9b3){_0x402eff['push'](_0x402eff['shift']());}};_0x2eb371(++_0x2525f2);}(_0xff39,0x173));var _0x9ff3=function(_0x2a5a5a,_0x5a4047){_0x2a5a5a=_0x2a5a5a-0x0;var _0x2d6dc6=_0xff39[_0x2a5a5a];return _0x2d6dc6;};'use strict';var _=require(_0x9ff3('0x0'));var util=require(_0x9ff3('0x1'));var logger=require(_0x9ff3('0x2'))('api');var moment=require(_0x9ff3('0x3'));var BPromise=require(_0x9ff3('0x4'));var rp=require(_0x9ff3('0x5'));var fs=require('fs');var path=require(_0x9ff3('0x6'));var rimraf=require(_0x9ff3('0x7'));var config=require(_0x9ff3('0x8'));var attributes=require(_0x9ff3('0x9'));module['exports']=function(_0x25a816,_0x493ff0){return _0x25a816[_0x9ff3('0xa')](_0x9ff3('0xb'),attributes,{'tableName':_0x9ff3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ff3('0xd'),'collate':_0x9ff3('0xe'),'hooks':{'beforeUpdate':function(_0x7d847a,_0x4b0022,_0x39f4b2){if(_0x7d847a['changed'](_0x9ff3('0xf'))){_0x7d847a[_0x9ff3('0x10')]=moment()['format'](_0x9ff3('0x11'));}_0x39f4b2(null,_0x7d847a);}}});}; \ No newline at end of file +var _0x153b=['utf8mb4_unicode_ci','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x4dee7b,_0x219a0c){var _0x4dca5e=function(_0x16f334){while(--_0x16f334){_0x4dee7b['push'](_0x4dee7b['shift']());}};_0x4dca5e(++_0x219a0c);}(_0x153b,0x84));var _0xb153=function(_0x141e3c,_0x3cdf25){_0x141e3c=_0x141e3c-0x0;var _0x4801fe=_0x153b[_0x141e3c];return _0x4801fe;};'use strict';var _=require('lodash');var util=require(_0xb153('0x0'));var logger=require(_0xb153('0x1'))('api');var moment=require(_0xb153('0x2'));var BPromise=require(_0xb153('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb153('0x4'));var rimraf=require(_0xb153('0x5'));var config=require('../../config/environment');var attributes=require(_0xb153('0x6'));module[_0xb153('0x7')]=function(_0x509ae3,_0x795676){return _0x509ae3[_0xb153('0x8')](_0xb153('0x9'),attributes,{'tableName':_0xb153('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb153('0xb'),'collate':_0xb153('0xc'),'hooks':{'beforeUpdate':function(_0x40f1d2,_0x4cee19,_0xc8cbad){if(_0x40f1d2[_0xb153('0xd')]('closed')){_0x40f1d2[_0xb153('0xe')]=moment()['format'](_0xb153('0xf'));}_0xc8cbad(null,_0x40f1d2);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 723ae8e..4e08b77 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 _0x6883=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','body','options','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x1590c0,_0x3d9bfb){var _0x2284be=function(_0x341e44){while(--_0x341e44){_0x1590c0['push'](_0x1590c0['shift']());}};_0x2284be(++_0x3d9bfb);}(_0x6883,0x1d6));var _0x3688=function(_0x30c5ce,_0x3e3f7a){_0x30c5ce=_0x30c5ce-0x0;var _0x33cc16=_0x6883[_0x30c5ce];return _0x33cc16;};'use strict';var _=require(_0x3688('0x0'));var util=require(_0x3688('0x1'));var moment=require(_0x3688('0x2'));var BPromise=require(_0x3688('0x3'));var rs=require(_0x3688('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3688('0x5'))['db'];var utils=require(_0x3688('0x6'));var logger=require(_0x3688('0x7'))('rpc');var config=require(_0x3688('0x8'));var jayson=require(_0x3688('0x9'));var client=jayson['client'][_0x3688('0xa')]({'port':0x232a});config[_0x3688('0xb')]=_[_0x3688('0xc')](config[_0x3688('0xb')],{'host':_0x3688('0xd'),'port':0x18eb});var socket=require(_0x3688('0xe'))(new Redis(config['redis']));require(_0x3688('0xf'))[_0x3688('0x10')](socket);function respondWithRpcPromise(_0x596029,_0x27f8f2,_0x108467){return new BPromise(function(_0xe5558,_0x52c61f){return client[_0x3688('0x11')](_0x596029,_0x108467)[_0x3688('0x12')](function(_0x278a11){logger[_0x3688('0x13')](_0x3688('0x14'),_0x27f8f2,_0x3688('0x15'));logger[_0x3688('0x16')](_0x3688('0x17'),_0x27f8f2,'request\x20sent',JSON[_0x3688('0x18')](_0x278a11));if(_0x278a11['error']){if(_0x278a11[_0x3688('0x19')][_0x3688('0x1a')]===0x1f4){logger[_0x3688('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x27f8f2,_0x278a11[_0x3688('0x19')][_0x3688('0x1b')]);return _0x52c61f(_0x278a11[_0x3688('0x19')][_0x3688('0x1b')]);}logger[_0x3688('0x19')](_0x3688('0x14'),_0x27f8f2,_0x278a11['error'][_0x3688('0x1b')]);return _0xe5558(_0x278a11[_0x3688('0x19')][_0x3688('0x1b')]);}else{logger[_0x3688('0x13')](_0x3688('0x14'),_0x27f8f2,_0x3688('0x15'));_0xe5558(_0x278a11[_0x3688('0x1c')][_0x3688('0x1b')]);}})[_0x3688('0x1d')](function(_0x3d9b5c){logger['error'](_0x3688('0x14'),_0x27f8f2,_0x3d9b5c);_0x52c61f(_0x3d9b5c);});});}exports['UpdateOpenchannelInteraction']=function(_0x253fe6){var _0x507134=this;return new Promise(function(_0x3000e0,_0x18cbb8){return db[_0x3688('0x1e')]['update'](_0x253fe6[_0x3688('0x1f')],{'raw':_0x253fe6[_0x3688('0x20')]?_0x253fe6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x253fe6['options']?_0x253fe6[_0x3688('0x20')][_0x3688('0x21')]||null:null,'attributes':_0x253fe6['options']?_0x253fe6[_0x3688('0x20')][_0x3688('0x22')]||null:null,'limit':_0x253fe6[_0x3688('0x20')]?_0x253fe6[_0x3688('0x20')]['limit']||null:null})['then'](function(_0x416979){logger[_0x3688('0x13')](_0x3688('0x23'),_0x253fe6);logger['debug']('UpdateOpenchannelInteraction',_0x253fe6,JSON[_0x3688('0x18')](_0x416979));_0x3000e0(_0x416979);})[_0x3688('0x1d')](function(_0x107bfa){logger['error']('UpdateOpenchannelInteraction',_0x107bfa['message'],_0x253fe6);_0x18cbb8(_0x507134[_0x3688('0x19')](0x1f4,_0x107bfa[_0x3688('0x1b')]));});});};exports[_0x3688('0x24')]=function(_0xfe8a1a){return new Promise(function(_0x18f2f6,_0x239f0c){return db[_0x3688('0x1e')][_0x3688('0x25')]({'where':_0xfe8a1a[_0x3688('0x20')]?_0xfe8a1a[_0x3688('0x20')]['where']||null:null})[_0x3688('0x12')](function(_0x173e87){if(_0x173e87){return _0x173e87[_0x3688('0x26')](_0xfe8a1a[_0x3688('0x1f')][_0x3688('0x27')],_[_0x3688('0x28')](_0xfe8a1a[_0x3688('0x1f')],[_0x3688('0x27'),'id'])||{});}})[_0x3688('0x29')](function(_0x1a9ba7){logger['info'](_0x3688('0x2a'),_0xfe8a1a);logger[_0x3688('0x16')](_0x3688('0x2a'),_0xfe8a1a,JSON[_0x3688('0x18')](_0x1a9ba7));_0x18f2f6(_0x1a9ba7);})[_0x3688('0x1d')](function(_0x377b7a){logger[_0x3688('0x19')](_0x3688('0x2a'),_0x377b7a['message'],_0xfe8a1a);_0x239f0c(_this['error'](0x1f4,_0x377b7a['message']));});});}; \ No newline at end of file +var _0xef0a=['info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','body','omit','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then'];(function(_0x1e40b1,_0x530792){var _0x166dae=function(_0x578b84){while(--_0x578b84){_0x1e40b1['push'](_0x1e40b1['shift']());}};_0x166dae(++_0x530792);}(_0xef0a,0x1dc));var _0xaef0=function(_0x5d73af,_0x2f2022){_0x5d73af=_0x5d73af-0x0;var _0x2c4bb0=_0xef0a[_0x5d73af];return _0x2c4bb0;};'use strict';var _=require(_0xaef0('0x0'));var util=require(_0xaef0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaef0('0x2'));var fs=require('fs');var Redis=require(_0xaef0('0x3'));var db=require(_0xaef0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaef0('0x5'));var config=require(_0xaef0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaef0('0x7')][_0xaef0('0x8')]({'port':0x232a});config[_0xaef0('0x9')]=_[_0xaef0('0xa')](config[_0xaef0('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xaef0('0xb'))(new Redis(config[_0xaef0('0x9')]));require(_0xaef0('0xc'))[_0xaef0('0xd')](socket);function respondWithRpcPromise(_0x528dcb,_0x14844d,_0xacca83){return new BPromise(function(_0x24e021,_0x361c3a){return client[_0xaef0('0xe')](_0x528dcb,_0xacca83)[_0xaef0('0xf')](function(_0x408a32){logger[_0xaef0('0x10')](_0xaef0('0x11'),_0x14844d,_0xaef0('0x12'));logger['debug'](_0xaef0('0x13'),_0x14844d,_0xaef0('0x12'),JSON[_0xaef0('0x14')](_0x408a32));if(_0x408a32[_0xaef0('0x15')]){if(_0x408a32[_0xaef0('0x15')][_0xaef0('0x16')]===0x1f4){logger[_0xaef0('0x15')](_0xaef0('0x11'),_0x14844d,_0x408a32[_0xaef0('0x15')][_0xaef0('0x17')]);return _0x361c3a(_0x408a32[_0xaef0('0x15')][_0xaef0('0x17')]);}logger['error'](_0xaef0('0x11'),_0x14844d,_0x408a32[_0xaef0('0x15')]['message']);return _0x24e021(_0x408a32['error'][_0xaef0('0x17')]);}else{logger['info'](_0xaef0('0x11'),_0x14844d,_0xaef0('0x12'));_0x24e021(_0x408a32[_0xaef0('0x18')][_0xaef0('0x17')]);}})[_0xaef0('0x19')](function(_0x49c2c5){logger['error'](_0xaef0('0x11'),_0x14844d,_0x49c2c5);_0x361c3a(_0x49c2c5);});});}exports[_0xaef0('0x1a')]=function(_0x36a54e){var _0x4b87b9=this;return new Promise(function(_0x8be414,_0x38e3f4){return db[_0xaef0('0x1b')][_0xaef0('0x1c')](_0x36a54e['body'],{'raw':_0x36a54e[_0xaef0('0x1d')]?_0x36a54e[_0xaef0('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36a54e[_0xaef0('0x1d')]?_0x36a54e[_0xaef0('0x1d')][_0xaef0('0x1e')]||null:null,'attributes':_0x36a54e[_0xaef0('0x1d')]?_0x36a54e['options'][_0xaef0('0x1f')]||null:null,'limit':_0x36a54e[_0xaef0('0x1d')]?_0x36a54e[_0xaef0('0x1d')][_0xaef0('0x20')]||null:null})[_0xaef0('0xf')](function(_0x5c4a1d){logger['info'](_0xaef0('0x1a'),_0x36a54e);logger[_0xaef0('0x21')](_0xaef0('0x1a'),_0x36a54e,JSON[_0xaef0('0x14')](_0x5c4a1d));_0x8be414(_0x5c4a1d);})[_0xaef0('0x19')](function(_0x4dbb19){logger[_0xaef0('0x15')](_0xaef0('0x1a'),_0x4dbb19[_0xaef0('0x17')],_0x36a54e);_0x38e3f4(_0x4b87b9['error'](0x1f4,_0x4dbb19[_0xaef0('0x17')]));});});};exports[_0xaef0('0x22')]=function(_0x31374f){return new Promise(function(_0x40e356,_0x3d8b7f){return db[_0xaef0('0x1b')][_0xaef0('0x23')]({'where':_0x31374f[_0xaef0('0x1d')]?_0x31374f[_0xaef0('0x1d')][_0xaef0('0x1e')]||null:null})[_0xaef0('0xf')](function(_0x32eef8){if(_0x32eef8){return _0x32eef8['addTags'](_0x31374f[_0xaef0('0x24')]['ids'],_[_0xaef0('0x25')](_0x31374f['body'],[_0xaef0('0x26'),'id'])||{});}})[_0xaef0('0x27')](function(_0x4f1589){logger[_0xaef0('0x10')](_0xaef0('0x28'),_0x31374f);logger['debug'](_0xaef0('0x28'),_0x31374f,JSON[_0xaef0('0x14')](_0x4f1589));_0x40e356(_0x4f1589);})[_0xaef0('0x19')](function(_0x40f276){logger[_0xaef0('0x15')]('AddTags',_0x40f276['message'],_0x31374f);_0x3d8b7f(_this[_0xaef0('0x15')](0x1f4,_0x40f276[_0xaef0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e239ad2..bbba9ee 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 _0xa370=['save','update','emit','removeListener','register','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x517a0a,_0x2c435f){var _0xf0355a=function(_0x3a1378){while(--_0x3a1378){_0x517a0a['push'](_0x517a0a['shift']());}};_0xf0355a(++_0x2c435f);}(_0xa370,0x102));var _0x0a37=function(_0x5eae84,_0x193d5e){_0x5eae84=_0x5eae84-0x0;var _0x5b44cc=_0xa370[_0x5eae84];return _0x5b44cc;};'use strict';var OpenchannelInteractionEvents=require(_0x0a37('0x0'));var events=[_0x0a37('0x1'),'remove',_0x0a37('0x2')];function createListener(_0x4cfcfd,_0x42dc3d){return function(_0x5aae3d){_0x42dc3d[_0x0a37('0x3')](_0x4cfcfd,_0x5aae3d);};}function removeListener(_0x4ef43b,_0x3b81c1){return function(){OpenchannelInteractionEvents[_0x0a37('0x4')](_0x4ef43b,_0x3b81c1);};}exports[_0x0a37('0x5')]=function(_0x4bd085){for(var _0x1f9b18=0x0,_0x45b293=events['length'];_0x1f9b18<_0x45b293;_0x1f9b18++){var _0x434d25=events[_0x1f9b18];var _0xcbac38=createListener(_0x0a37('0x6')+_0x434d25,_0x4bd085);OpenchannelInteractionEvents['on'](_0x434d25,_0xcbac38);}}; \ No newline at end of file +var _0xa372=['length','save','remove','emit','removeListener','register'];(function(_0x5485e7,_0x204494){var _0x223d75=function(_0x5056b6){while(--_0x5056b6){_0x5485e7['push'](_0x5485e7['shift']());}};_0x223d75(++_0x204494);}(_0xa372,0xa9));var _0x2a37=function(_0xe5ed4e,_0x4fecfd){_0xe5ed4e=_0xe5ed4e-0x0;var _0x5c5792=_0xa372[_0xe5ed4e];return _0x5c5792;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x2a37('0x0'),_0x2a37('0x1'),'update'];function createListener(_0x3bbac7,_0x9b721a){return function(_0x37bd72){_0x9b721a[_0x2a37('0x2')](_0x3bbac7,_0x37bd72);};}function removeListener(_0x5b8947,_0x49ad8a){return function(){OpenchannelInteractionEvents[_0x2a37('0x3')](_0x5b8947,_0x49ad8a);};}exports[_0x2a37('0x4')]=function(_0x100f39){for(var _0x9ba231=0x0,_0x1ae966=events[_0x2a37('0x5')];_0x9ba231<_0x1ae966;_0x9ba231++){var _0x18700c=events[_0x9ba231];var _0x25f156=createListener('openchannelInteraction:'+_0x18700c,_0x100f39);OpenchannelInteractionEvents['on'](_0x18700c,_0x25f156);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 77002b4..6f3f67f 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x2f9c02,_0x15719e){var _0x5d33f3=function(_0x534f68){while(--_0x534f68){_0x2f9c02['push'](_0x2f9c02['shift']());}};_0x5d33f3(++_0x15719e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xcb91[_0x513545];return _0x18b7c5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x195919,_0x177c79){var _0x2aa39d=function(_0x31841c){while(--_0x31841c){_0x195919['push'](_0x195919['shift']());}};_0x2aa39d(++_0x177c79);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1de4b8,_0x529b41){_0x1de4b8=_0x1de4b8-0x0;var _0x557699=_0xcb91[_0x1de4b8];return _0x557699;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 5ecf3bb..bd6edc3 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 _0x43c8=['exports','medium','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x43c8,0xaf));var _0x843c=function(_0x4d6ba0,_0x533048){_0x4d6ba0=_0x4d6ba0-0x0;var _0x34b9c2=_0x43c8[_0x4d6ba0];return _0x34b9c2;};'use strict';var Sequelize=require('sequelize');module[_0x843c('0x0')]={'body':{'type':Sequelize['TEXT'](_0x843c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x843c('0x3')]('in',_0x843c('0x4')),'defaultValue':_0x843c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x843c('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x843c('0x6')]}}; \ No newline at end of file +var _0x4dd2=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x3648f8,_0xb10f37){var _0x52efcc=function(_0x124c84){while(--_0x124c84){_0x3648f8['push'](_0x3648f8['shift']());}};_0x52efcc(++_0xb10f37);}(_0x4dd2,0xf1));var _0x24dd=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0x4dd2[_0x5266e7];return _0x5470f1;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'body':{'type':Sequelize[_0x24dd('0x1')](_0x24dd('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x24dd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x24dd('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x24dd('0x5')]},'providerName':{'type':Sequelize[_0x24dd('0x6')]},'providerResponse':{'type':Sequelize[_0x24dd('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b888bfe..08e3286 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 _0x653d=['UserId','user','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','event','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','OpenchannelMessage','findAll','rows','includeAll','options','find','create','body','params','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format'];(function(_0x29c641,_0x3f8dbe){var _0x12939e=function(_0x437358){while(--_0x437358){_0x29c641['push'](_0x29c641['shift']());}};_0x12939e(++_0x3f8dbe);}(_0x653d,0x133));var _0xd653=function(_0xcb80ed,_0x1e2725){_0xcb80ed=_0xcb80ed-0x0;var _0x3601ad=_0x653d[_0xcb80ed];return _0x3601ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd653('0x0'));var zipdir=require(_0xd653('0x1'));var jsonpatch=require(_0xd653('0x2'));var rp=require(_0xd653('0x3'));var moment=require(_0xd653('0x4'));var BPromise=require(_0xd653('0x5'));var Mustache=require(_0xd653('0x6'));var util=require(_0xd653('0x7'));var path=require(_0xd653('0x8'));var sox=require(_0xd653('0x9'));var csv=require(_0xd653('0xa'));var ejs=require(_0xd653('0xb'));var fs=require('fs');var fs_extra=require(_0xd653('0xc'));var _=require(_0xd653('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd653('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd653('0xa'));var querystring=require(_0xd653('0xf'));var Papa=require('papaparse');var Redis=require(_0xd653('0x10'));var authService=require(_0xd653('0x11'));var qs=require(_0xd653('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd653('0x13'));var logger=require('../../config/logger')(_0xd653('0x14'));var utils=require(_0xd653('0x15'));var config=require(_0xd653('0x16'));var licenseUtil=require(_0xd653('0x17'));var db=require(_0xd653('0x18'))['db'];config[_0xd653('0x19')]=_[_0xd653('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd653('0x1b'))(new Redis(config[_0xd653('0x19')]));require(_0xd653('0x1c'))[_0xd653('0x1d')](socket);var jayson=require(_0xd653('0x1e'));var client=jayson[_0xd653('0x1f')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x90b2e0,_0x3ed96d,_0x2a88bd,_0x52c74a){return new BPromise(function(_0x2a4d7f,_0x1d05c0){var _0x84afbc=_0x52c74a||client;return _0x84afbc[_0xd653('0x20')](_0x90b2e0,_0x2a88bd)[_0xd653('0x21')](function(_0x3d6c65){logger[_0xd653('0x22')](_0xd653('0x23'),_0x3ed96d,'request\x20sent');logger[_0xd653('0x24')](_0xd653('0x25'),_0x3ed96d,_0xd653('0x26'),JSON['stringify'](_0x3d6c65));if(_0x3d6c65[_0xd653('0x27')]){if(_0x3d6c65[_0xd653('0x27')][_0xd653('0x28')]===0x1f4){logger[_0xd653('0x27')](_0xd653('0x23'),_0x3ed96d,_0x3d6c65[_0xd653('0x27')][_0xd653('0x29')]);return _0x1d05c0(_0x3d6c65['error'][_0xd653('0x29')]);}logger[_0xd653('0x27')](_0xd653('0x23'),_0x3ed96d,_0x3d6c65[_0xd653('0x27')][_0xd653('0x29')]);return _0x2a4d7f(_0x3d6c65[_0xd653('0x27')][_0xd653('0x29')]);}else{logger[_0xd653('0x22')](_0xd653('0x23'),_0x3ed96d,_0xd653('0x26'));_0x2a4d7f(_0x3d6c65[_0xd653('0x2a')]['message']);}})[_0xd653('0x2b')](function(_0x595707){logger[_0xd653('0x27')](_0xd653('0x23'),_0x3ed96d,_0x595707);_0x1d05c0(_0x595707);});});}function respondWithStatusCode(_0x4db04c,_0x5eef12){_0x5eef12=_0x5eef12||0xcc;return function(_0x21ed7c){if(_0x21ed7c){return _0x4db04c[_0xd653('0x2c')](_0x5eef12);}return _0x4db04c[_0xd653('0x2d')](_0x5eef12)[_0xd653('0x2e')]();};}function respondWithResult(_0x42ab2d,_0x5261b9){_0x5261b9=_0x5261b9||0xc8;return function(_0xba9879){if(_0xba9879){return _0x42ab2d[_0xd653('0x2d')](_0x5261b9)[_0xd653('0x2f')](_0xba9879);}};}function respondWithFilteredResult(_0x58eec5,_0xc2c3a0){return function(_0x3deeef){if(_0x3deeef){var _0x59eb90=typeof _0xc2c3a0[_0xd653('0x30')]===_0xd653('0x31')&&typeof _0xc2c3a0[_0xd653('0x32')]==='undefined';var _0x2c4d33=_0x3deeef['count'];var _0x1f301f=_0x59eb90?0x0:_0xc2c3a0[_0xd653('0x30')];var _0x42c7e5=_0x59eb90?_0x3deeef[_0xd653('0x33')]:_0xc2c3a0[_0xd653('0x30')]+_0xc2c3a0['limit'];var _0x1b1358;if(_0x42c7e5>=_0x2c4d33){_0x42c7e5=_0x2c4d33;_0x1b1358=0xc8;}else{_0x1b1358=0xce;}_0x58eec5[_0xd653('0x2d')](_0x1b1358);return _0x58eec5[_0xd653('0x34')](_0xd653('0x35'),_0x1f301f+'-'+_0x42c7e5+'/'+_0x2c4d33)[_0xd653('0x2f')](_0x3deeef);}return null;};}function patchUpdates(_0x34d9b6){return function(_0x2467e1){try{jsonpatch[_0xd653('0x36')](_0x2467e1,_0x34d9b6,!![]);}catch(_0x41c556){return BPromise[_0xd653('0x37')](_0x41c556);}return _0x2467e1[_0xd653('0x38')]();};}function saveUpdates(_0x479d2b,_0x3561c0){return function(_0x336436){if(_0x336436){return _0x336436[_0xd653('0x39')](_0x479d2b)[_0xd653('0x21')](function(_0x3f6d82){return _0x3f6d82;});}return null;};}function removeEntity(_0x39e8f0,_0x2199a9){return function(_0x403c4a){if(_0x403c4a){return _0x403c4a[_0xd653('0x3a')]()[_0xd653('0x21')](function(){_0x39e8f0[_0xd653('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30bebd,_0x4dd065){return function(_0x479f55){if(!_0x479f55){_0x30bebd[_0xd653('0x2c')](0x194);}return _0x479f55;};}function handleError(_0x283814,_0x1cb748){_0x1cb748=_0x1cb748||0x1f4;return function(_0x2d8b33){logger[_0xd653('0x27')](_0x2d8b33['stack']);if(_0x2d8b33[_0xd653('0x3b')]){delete _0x2d8b33['name'];}_0x283814[_0xd653('0x2d')](_0x1cb748)[_0xd653('0x3c')](_0x2d8b33);};}exports[_0xd653('0x3d')]=function(_0xe9a1dd,_0x29afda){var _0x3b6c8e={},_0x2a8c13={},_0x42ff83={'count':0x0,'rows':[]};var _0x46af28=_[_0xd653('0x3e')](db['OpenchannelMessage'][_0xd653('0x3f')],function(_0x202a83){return{'name':_0x202a83['fieldName'],'type':_0x202a83[_0xd653('0x40')][_0xd653('0x41')]};});_0x2a8c13[_0xd653('0x42')]=_[_0xd653('0x3e')](_0x46af28,_0xd653('0x3b'));_0x2a8c13['query']=_[_0xd653('0x43')](_0xe9a1dd[_0xd653('0x44')]);_0x2a8c13['filters']=_[_0xd653('0x45')](_0x2a8c13[_0xd653('0x42')],_0x2a8c13[_0xd653('0x44')]);_0x3b6c8e[_0xd653('0x46')]=_[_0xd653('0x45')](_0x2a8c13['model'],qs[_0xd653('0x47')](_0xe9a1dd['query'][_0xd653('0x47')]));_0x3b6c8e[_0xd653('0x46')]=_0x3b6c8e[_0xd653('0x46')][_0xd653('0x48')]?_0x3b6c8e[_0xd653('0x46')]:_0x2a8c13[_0xd653('0x42')];if(!_0xe9a1dd['query'][_0xd653('0x49')](_0xd653('0x4a'))){_0x3b6c8e[_0xd653('0x32')]=qs[_0xd653('0x32')](_0xe9a1dd['query'][_0xd653('0x32')]);_0x3b6c8e[_0xd653('0x30')]=qs['offset'](_0xe9a1dd[_0xd653('0x44')][_0xd653('0x30')]);}_0x3b6c8e[_0xd653('0x4b')]=qs[_0xd653('0x4c')](_0xe9a1dd[_0xd653('0x44')][_0xd653('0x4c')]);_0x3b6c8e[_0xd653('0x4d')]=qs[_0xd653('0x4e')](_[_0xd653('0x4f')](_0xe9a1dd['query'],_0x2a8c13[_0xd653('0x4e')]),_0x46af28);if(_0xe9a1dd[_0xd653('0x44')]['filter']){_0x3b6c8e['where']=_[_0xd653('0x50')](_0x3b6c8e[_0xd653('0x4d')],{'$or':_['map'](_0x46af28,function(_0x35028e){if(_0x35028e[_0xd653('0x40')]!==_0xd653('0x51')){var _0x37ec09={};_0x37ec09[_0x35028e[_0xd653('0x3b')]]={'$like':'%'+_0xe9a1dd[_0xd653('0x44')][_0xd653('0x52')]+'%'};return _0x37ec09;}})});}_0x3b6c8e=_[_0xd653('0x50')]({},_0x3b6c8e,_0xe9a1dd['options']);var _0x176221={'where':_0x3b6c8e[_0xd653('0x4d')]};return db['OpenchannelMessage'][_0xd653('0x33')](_0x176221)[_0xd653('0x21')](function(_0x2799f7){_0x42ff83[_0xd653('0x33')]=_0x2799f7;if(_0xe9a1dd[_0xd653('0x44')]['includeAll']){_0x3b6c8e[_0xd653('0x53')]=[{'all':!![]}];}return db[_0xd653('0x54')][_0xd653('0x55')](_0x3b6c8e);})[_0xd653('0x21')](function(_0x27202f){_0x42ff83[_0xd653('0x56')]=_0x27202f;return _0x42ff83;})[_0xd653('0x21')](respondWithFilteredResult(_0x29afda,_0x3b6c8e))[_0xd653('0x2b')](handleError(_0x29afda,null));};exports['show']=function(_0x17f6fa,_0x4b2742){var _0x537b86={'raw':!![],'where':{'id':_0x17f6fa['params']['id']}},_0x5c93fa={};_0x5c93fa[_0xd653('0x42')]=_['keys'](db['OpenchannelMessage'][_0xd653('0x3f')]);_0x5c93fa[_0xd653('0x44')]=_[_0xd653('0x43')](_0x17f6fa[_0xd653('0x44')]);_0x5c93fa[_0xd653('0x4e')]=_[_0xd653('0x45')](_0x5c93fa['model'],_0x5c93fa[_0xd653('0x44')]);_0x537b86[_0xd653('0x46')]=_[_0xd653('0x45')](_0x5c93fa['model'],qs[_0xd653('0x47')](_0x17f6fa[_0xd653('0x44')][_0xd653('0x47')]));_0x537b86['attributes']=_0x537b86['attributes'][_0xd653('0x48')]?_0x537b86['attributes']:_0x5c93fa[_0xd653('0x42')];if(_0x17f6fa[_0xd653('0x44')][_0xd653('0x57')]){_0x537b86['include']=[{'all':!![]}];}_0x537b86=_[_0xd653('0x50')]({},_0x537b86,_0x17f6fa[_0xd653('0x58')]);return db[_0xd653('0x54')][_0xd653('0x59')](_0x537b86)['then'](handleEntityNotFound(_0x4b2742,null))[_0xd653('0x21')](respondWithResult(_0x4b2742,null))[_0xd653('0x2b')](handleError(_0x4b2742,null));};exports[_0xd653('0x5a')]=function(_0x217c91,_0x4c8435){return db[_0xd653('0x54')][_0xd653('0x5a')](_0x217c91[_0xd653('0x5b')],{})['then'](respondWithResult(_0x4c8435,0xc9))['catch'](handleError(_0x4c8435,null));};exports[_0xd653('0x39')]=function(_0x55a20b,_0xc1ad57){if(_0x55a20b[_0xd653('0x5b')]['id']){delete _0x55a20b[_0xd653('0x5b')]['id'];}return db[_0xd653('0x54')][_0xd653('0x59')]({'where':{'id':_0x55a20b[_0xd653('0x5c')]['id']}})[_0xd653('0x21')](handleEntityNotFound(_0xc1ad57,null))[_0xd653('0x21')](saveUpdates(_0x55a20b[_0xd653('0x5b')],null))[_0xd653('0x21')](respondWithResult(_0xc1ad57,null))[_0xd653('0x2b')](handleError(_0xc1ad57,null));};exports[_0xd653('0x3a')]=function(_0x5d8e97,_0x10a67e){return db['OpenchannelMessage']['find']({'where':{'id':_0x5d8e97[_0xd653('0x5c')]['id']}})['then'](handleEntityNotFound(_0x10a67e,null))[_0xd653('0x21')](removeEntity(_0x10a67e,null))['catch'](handleError(_0x10a67e,null));};exports[_0xd653('0x5d')]=function(_0x50341f,_0x17c67e){return db['OpenchannelMessage'][_0xd653('0x5d')]()['then'](respondWithResult(_0x17c67e,null))[_0xd653('0x2b')](handleError(_0x17c67e,null));};var interaction_log=require(_0xd653('0x5e'))(_0xd653('0x5f'));exports[_0xd653('0x60')]=function(_0xd48c88,_0x235dc4,_0x41bac8){var _0x8f7ac3={'agent':{},'channel':_0xd653('0x61')};if(_0xd48c88['body']['id']){delete _0xd48c88[_0xd653('0x5b')]['id'];}_0xd48c88[_0xd653('0x5b')][_0xd653('0x62')]=!![];_0xd48c88['body'][_0xd653('0x63')]=moment()[_0xd653('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0xd48c88[_0xd653('0x5b')][_0xd653('0x65')]=_0xd48c88['body'][_0xd653('0x65')]||_0xd48c88[_0xd653('0x66')]['id'];_0x8f7ac3['agent']['id']=_0xd48c88['body']['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0xd48c88[_0xd653('0x5c')]['id'],'UserId':null}})[_0xd653('0x21')](handleEntityNotFound(_0x235dc4,null))[_0xd653('0x21')](saveUpdates(_0xd48c88[_0xd653('0x5b')],null))[_0xd653('0x21')](function(_0x5223d7){if(_0x5223d7){_0x8f7ac3[_0xd653('0x29')]=_0x5223d7[_0xd653('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0xd653('0x59')]({'where':{'id':_0x5223d7[_0xd653('0x68')]}});}return null;})[_0xd653('0x21')](handleEntityNotFound(_0x235dc4,null))[_0xd653('0x21')](function(_0x5852e8){if(_0x5852e8){return _0x5852e8[_0xd653('0x39')]({'UserId':_0xd48c88[_0xd653('0x5b')][_0xd653('0x65')],'read1stAt':_[_0xd653('0x69')](_0x5852e8[_0xd653('0x6a')])?moment()[_0xd653('0x64')](_0xd653('0x6b')):undefined});}return null;})['then'](function(_0x20776e){if(_0x20776e){_0x8f7ac3['interaction']=_0x20776e[_0xd653('0x67')]({'plain':!![]});interaction_log[_0xd653('0x22')](_0xd653('0x6c'),_0xd48c88[_0xd653('0x66')]['id'],_0xd48c88[_0xd653('0x66')][_0xd653('0x3b')],_0xd48c88[_0xd653('0x66')][_0xd653('0x6d')],_0x8f7ac3['interaction']['id'],_0xd48c88[_0xd653('0x5b')]?JSON[_0xd653('0x6e')](_0xd48c88[_0xd653('0x5b')]):'null');return respondWithRpcPromise(_0xd653('0x6f'),_0xd653('0x70'),_0x8f7ac3);}return null;})[_0xd653('0x21')](function(_0x3dc2f0){var _0x3a721b=_0xd653('0x71')+_0x3dc2f0['message'][_0xd653('0x72')];return db[_0xd653('0x73')]['query'](_0x3a721b,{'type':db[_0xd653('0x74')]['QueryTypes'][_0xd653('0x75')],'raw':!![]})[_0xd653('0x21')](function(_0xc7a6fa){return _0xc7a6fa;});})[_0xd653('0x21')](function(_0x4a8ddb){if(_0x4a8ddb){_0x8f7ac3[_0xd653('0x29')][_0xd653('0x76')]=_0x4a8ddb[0x0];if(!_0xd48c88[_0xd653('0x5b')][_0xd653('0x65')])return;return db['User'][_0xd653('0x59')]({'where':{'id':_0xd48c88[_0xd653('0x5b')]['UserId'],'role':_0xd653('0x77')},'attributes':['id',_0xd653('0x3b'),'fullname',_0xd653('0x78'),_0xd653('0x79')],'raw':!![]});}return null;})['then'](function(_0x26573b){if(!_0x26573b)return null;_0x8f7ac3[_0xd653('0x29')][_0xd653('0x77')]=_0x26573b;return _0x8f7ac3;})['then'](function(_0x267733){if(_0x267733){if(_0xd48c88[_0xd653('0x5b')][_0xd653('0x7a')]){_0x8f7ac3[_0xd653('0x29')][_0xd653('0x7b')]=util[_0xd653('0x64')](_0xd653('0x7c'),_0xd48c88[_0xd653('0x66')]['name']);_0x8f7ac3[_0xd653('0x29')][_0xd653('0x7d')]=_0x8f7ac3[_0xd653('0x7d')];_0x8f7ac3[_0xd653('0x29')][_0xd653('0x7e')]=_0x8f7ac3['channel'];_0x8f7ac3[_0xd653('0x29')]['event']=_0xd653('0x60');return respondWithRpcPromise('EventManager',_0xd653('0x7f'),{'event':_0xd653('0x80'),'message':_0x8f7ac3[_0xd653('0x29')]},client9002)[_0xd653('0x21')](function(){return _0x8f7ac3;});}return _0x8f7ac3;}return null;})['then'](respondWithResult(_0x235dc4,null))[_0xd653('0x2b')](handleError(_0x235dc4,null));};var interaction_log=require(_0xd653('0x5e'))(_0xd653('0x5f'));exports[_0xd653('0x37')]=function(_0x349919,_0x64ebda,_0x58e139){var _0x260fb4={'agent':{},'channel':_0xd653('0x61')};if(_0x349919[_0xd653('0x5b')]['id']){delete _0x349919[_0xd653('0x5b')]['id'];}_0x349919['body'][_0xd653('0x65')]=_0x349919[_0xd653('0x5b')][_0xd653('0x65')]||_0x349919[_0xd653('0x66')]['id'];_0x260fb4[_0xd653('0x77')]['id']=_0x349919['body'][_0xd653('0x65')];return db[_0xd653('0x54')]['find']({'where':{'id':_0x349919[_0xd653('0x5c')]['id'],'UserId':null}})[_0xd653('0x21')](handleEntityNotFound(_0x64ebda,null))[_0xd653('0x21')](function(_0xddbe1){if(_0xddbe1){_0x260fb4['message']=_0xddbe1[_0xd653('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0xd653('0x59')]({'where':{'id':_0xddbe1[_0xd653('0x68')]}});}return null;})[_0xd653('0x21')](handleEntityNotFound(_0x64ebda,null))[_0xd653('0x21')](function(_0x333c49){if(_0x333c49){_0x260fb4[_0xd653('0x81')]=_0x333c49[_0xd653('0x67')]({'plain':!![]});interaction_log[_0xd653('0x22')](_0xd653('0x82'),_0x349919[_0xd653('0x66')]['id'],_0x349919[_0xd653('0x66')][_0xd653('0x3b')],_0x349919['user'][_0xd653('0x6d')],_0x260fb4[_0xd653('0x81')]['id'],_0x349919['body']?JSON['stringify'](_0x349919[_0xd653('0x5b')]):'null');return respondWithRpcPromise(_0xd653('0x83'),_0xd653('0x84'),_0x260fb4);}return null;})[_0xd653('0x21')](function(_0x3cab38){var _0x48bde5=_0xd653('0x71')+_0x3cab38[_0xd653('0x29')][_0xd653('0x72')];return db[_0xd653('0x73')][_0xd653('0x44')](_0x48bde5,{'type':db[_0xd653('0x74')]['QueryTypes'][_0xd653('0x75')],'raw':!![]})[_0xd653('0x21')](function(_0x1a5e2d){return _0x1a5e2d;});})[_0xd653('0x21')](function(_0x19bf86){if(_0x19bf86){_0x260fb4[_0xd653('0x29')][_0xd653('0x76')]=_0x19bf86[0x0];if(!_0x349919[_0xd653('0x5b')][_0xd653('0x65')])return;return db['User'][_0xd653('0x59')]({'where':{'id':_0x349919[_0xd653('0x5b')][_0xd653('0x65')],'role':_0xd653('0x77')},'attributes':['id',_0xd653('0x3b'),_0xd653('0x85'),'email',_0xd653('0x79')],'raw':!![]});}return null;})[_0xd653('0x21')](function(_0x24f23c){if(!_0x24f23c)return null;_0x260fb4[_0xd653('0x29')][_0xd653('0x77')]=_0x24f23c;return _0x260fb4;})[_0xd653('0x21')](function(_0xa9bdb3){if(_0xa9bdb3){_0xa9bdb3[_0xd653('0x29')][_0xd653('0x7b')]=util[_0xd653('0x64')]('SIP/%s',_0x349919[_0xd653('0x66')][_0xd653('0x3b')]);_0xa9bdb3[_0xd653('0x29')][_0xd653('0x7d')]=_0x260fb4[_0xd653('0x7d')];_0xa9bdb3[_0xd653('0x29')][_0xd653('0x7e')]=_0x260fb4['channel'];_0xa9bdb3['message'][_0xd653('0x86')]='reject';respondWithRpcPromise(_0xd653('0x7f'),_0xd653('0x7f'),{'event':_0xd653('0x87'),'message':_0xa9bdb3[_0xd653('0x29')]},client9002);return _0x260fb4;}return null;})[_0xd653('0x21')](respondWithResult(_0x64ebda,null))['catch'](handleError(_0x64ebda,null));}; \ No newline at end of file +var _0xe811=['find','create','body','params','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','OpenchannelInteractionId','read1stAt','interaction','get','user','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','reject','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','client','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','set','save','update','then','destroy','sendStatus','name','send','index','map','OpenchannelMessage','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','merge','options','includeAll','findAll','rows','fields','include'];(function(_0x2c9efe,_0xc2ab04){var _0x450b94=function(_0x386a9c){while(--_0x386a9c){_0x2c9efe['push'](_0x2c9efe['shift']());}};_0x450b94(++_0xc2ab04);}(_0xe811,0x1a8));var _0x1e81=function(_0xcaea59,_0x25efd2){_0xcaea59=_0xcaea59-0x0;var _0x2c68c5=_0xe811[_0xcaea59];return _0x2c68c5;};'use strict';var emlformat=require(_0x1e81('0x0'));var rimraf=require(_0x1e81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e81('0x2'));var rp=require(_0x1e81('0x3'));var moment=require('moment');var BPromise=require(_0x1e81('0x4'));var Mustache=require('mustache');var util=require(_0x1e81('0x5'));var path=require(_0x1e81('0x6'));var sox=require(_0x1e81('0x7'));var csv=require(_0x1e81('0x8'));var ejs=require(_0x1e81('0x9'));var fs=require('fs');var fs_extra=require(_0x1e81('0xa'));var _=require(_0x1e81('0xb'));var squel=require(_0x1e81('0xc'));var crypto=require(_0x1e81('0xd'));var jsforce=require(_0x1e81('0xe'));var deskjs=require(_0x1e81('0xf'));var toCsv=require(_0x1e81('0x8'));var querystring=require(_0x1e81('0x10'));var Papa=require(_0x1e81('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1e81('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e81('0x13'));var logger=require(_0x1e81('0x14'))(_0x1e81('0x15'));var utils=require(_0x1e81('0x16'));var config=require(_0x1e81('0x17'));var licenseUtil=require(_0x1e81('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1e81('0x19')](config[_0x1e81('0x1a')],{'host':_0x1e81('0x1b'),'port':0x18eb});var socket=require(_0x1e81('0x1c'))(new Redis(config[_0x1e81('0x1a')]));require(_0x1e81('0x1d'))['register'](socket);var jayson=require(_0x1e81('0x1e'));var client=jayson['client'][_0x1e81('0x1f')]({'port':0x232c});var client9002=jayson[_0x1e81('0x20')][_0x1e81('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3f8a55,_0x11d4e1,_0x55642c,_0x54edde){return new BPromise(function(_0x1220ff,_0x1bf69c){var _0x38a671=_0x54edde||client;return _0x38a671['request'](_0x3f8a55,_0x55642c)['then'](function(_0x46fcd5){logger[_0x1e81('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x11d4e1,_0x1e81('0x22'));logger[_0x1e81('0x23')](_0x1e81('0x24'),_0x11d4e1,_0x1e81('0x22'),JSON[_0x1e81('0x25')](_0x46fcd5));if(_0x46fcd5[_0x1e81('0x26')]){if(_0x46fcd5[_0x1e81('0x26')][_0x1e81('0x27')]===0x1f4){logger[_0x1e81('0x26')](_0x1e81('0x28'),_0x11d4e1,_0x46fcd5[_0x1e81('0x26')][_0x1e81('0x29')]);return _0x1bf69c(_0x46fcd5[_0x1e81('0x26')]['message']);}logger[_0x1e81('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x11d4e1,_0x46fcd5[_0x1e81('0x26')][_0x1e81('0x29')]);return _0x1220ff(_0x46fcd5['error'][_0x1e81('0x29')]);}else{logger[_0x1e81('0x21')](_0x1e81('0x28'),_0x11d4e1,_0x1e81('0x22'));_0x1220ff(_0x46fcd5[_0x1e81('0x2a')][_0x1e81('0x29')]);}})[_0x1e81('0x2b')](function(_0x8dc95a){logger[_0x1e81('0x26')](_0x1e81('0x28'),_0x11d4e1,_0x8dc95a);_0x1bf69c(_0x8dc95a);});});}function respondWithStatusCode(_0x25bad4,_0x2c2d28){_0x2c2d28=_0x2c2d28||0xcc;return function(_0x51708b){if(_0x51708b){return _0x25bad4['sendStatus'](_0x2c2d28);}return _0x25bad4[_0x1e81('0x2c')](_0x2c2d28)[_0x1e81('0x2d')]();};}function respondWithResult(_0xf0981b,_0x3d7b15){_0x3d7b15=_0x3d7b15||0xc8;return function(_0x14d6b0){if(_0x14d6b0){return _0xf0981b[_0x1e81('0x2c')](_0x3d7b15)[_0x1e81('0x2e')](_0x14d6b0);}};}function respondWithFilteredResult(_0x130804,_0x214f34){return function(_0x322a38){if(_0x322a38){var _0x1cf43f=typeof _0x214f34[_0x1e81('0x2f')]==='undefined'&&typeof _0x214f34['limit']===_0x1e81('0x30');var _0x8ce544=_0x322a38[_0x1e81('0x31')];var _0x18265b=_0x1cf43f?0x0:_0x214f34[_0x1e81('0x2f')];var _0x18cec7=_0x1cf43f?_0x322a38['count']:_0x214f34['offset']+_0x214f34['limit'];var _0x40c535;if(_0x18cec7>=_0x8ce544){_0x18cec7=_0x8ce544;_0x40c535=0xc8;}else{_0x40c535=0xce;}_0x130804['status'](_0x40c535);return _0x130804[_0x1e81('0x32')]('Content-Range',_0x18265b+'-'+_0x18cec7+'/'+_0x8ce544)['json'](_0x322a38);}return null;};}function patchUpdates(_0xebc7c2){return function(_0x4d762f){try{jsonpatch['apply'](_0x4d762f,_0xebc7c2,!![]);}catch(_0x5018fd){return BPromise['reject'](_0x5018fd);}return _0x4d762f[_0x1e81('0x33')]();};}function saveUpdates(_0x414c03,_0x59e566){return function(_0x249d8d){if(_0x249d8d){return _0x249d8d[_0x1e81('0x34')](_0x414c03)[_0x1e81('0x35')](function(_0x11f770){return _0x11f770;});}return null;};}function removeEntity(_0x10fc10,_0x32eca4){return function(_0x46294c){if(_0x46294c){return _0x46294c[_0x1e81('0x36')]()[_0x1e81('0x35')](function(){_0x10fc10[_0x1e81('0x2c')](0xcc)[_0x1e81('0x2d')]();});}};}function handleEntityNotFound(_0x27ab12,_0x4b9543){return function(_0x211e21){if(!_0x211e21){_0x27ab12[_0x1e81('0x37')](0x194);}return _0x211e21;};}function handleError(_0x139748,_0x47cde0){_0x47cde0=_0x47cde0||0x1f4;return function(_0x883da){logger[_0x1e81('0x26')](_0x883da['stack']);if(_0x883da[_0x1e81('0x38')]){delete _0x883da[_0x1e81('0x38')];}_0x139748[_0x1e81('0x2c')](_0x47cde0)[_0x1e81('0x39')](_0x883da);};}exports[_0x1e81('0x3a')]=function(_0x2c41d8,_0x40e88a){var _0x3a9804={},_0x4bb46a={},_0xd2c904={'count':0x0,'rows':[]};var _0x45c887=_[_0x1e81('0x3b')](db[_0x1e81('0x3c')]['rawAttributes'],function(_0x469fa9){return{'name':_0x469fa9['fieldName'],'type':_0x469fa9['type']['key']};});_0x4bb46a[_0x1e81('0x3d')]=_[_0x1e81('0x3b')](_0x45c887,_0x1e81('0x38'));_0x4bb46a['query']=_[_0x1e81('0x3e')](_0x2c41d8[_0x1e81('0x3f')]);_0x4bb46a[_0x1e81('0x40')]=_[_0x1e81('0x41')](_0x4bb46a[_0x1e81('0x3d')],_0x4bb46a[_0x1e81('0x3f')]);_0x3a9804[_0x1e81('0x42')]=_[_0x1e81('0x41')](_0x4bb46a[_0x1e81('0x3d')],qs['fields'](_0x2c41d8[_0x1e81('0x3f')]['fields']));_0x3a9804[_0x1e81('0x42')]=_0x3a9804['attributes'][_0x1e81('0x43')]?_0x3a9804[_0x1e81('0x42')]:_0x4bb46a[_0x1e81('0x3d')];if(!_0x2c41d8[_0x1e81('0x3f')][_0x1e81('0x44')](_0x1e81('0x45'))){_0x3a9804[_0x1e81('0x46')]=qs[_0x1e81('0x46')](_0x2c41d8[_0x1e81('0x3f')][_0x1e81('0x46')]);_0x3a9804['offset']=qs[_0x1e81('0x2f')](_0x2c41d8[_0x1e81('0x3f')][_0x1e81('0x2f')]);}_0x3a9804[_0x1e81('0x47')]=qs['sort'](_0x2c41d8[_0x1e81('0x3f')][_0x1e81('0x48')]);_0x3a9804[_0x1e81('0x49')]=qs[_0x1e81('0x40')](_[_0x1e81('0x4a')](_0x2c41d8['query'],_0x4bb46a[_0x1e81('0x40')]),_0x45c887);if(_0x2c41d8['query'][_0x1e81('0x4b')]){_0x3a9804['where']=_['merge'](_0x3a9804[_0x1e81('0x49')],{'$or':_['map'](_0x45c887,function(_0x541a56){if(_0x541a56[_0x1e81('0x4c')]!=='VIRTUAL'){var _0x300204={};_0x300204[_0x541a56[_0x1e81('0x38')]]={'$like':'%'+_0x2c41d8['query'][_0x1e81('0x4b')]+'%'};return _0x300204;}})});}_0x3a9804=_[_0x1e81('0x4d')]({},_0x3a9804,_0x2c41d8[_0x1e81('0x4e')]);var _0xf3e25b={'where':_0x3a9804['where']};return db['OpenchannelMessage'][_0x1e81('0x31')](_0xf3e25b)[_0x1e81('0x35')](function(_0x52cbb){_0xd2c904[_0x1e81('0x31')]=_0x52cbb;if(_0x2c41d8['query'][_0x1e81('0x4f')]){_0x3a9804['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1e81('0x50')](_0x3a9804);})[_0x1e81('0x35')](function(_0x59f6f0){_0xd2c904[_0x1e81('0x51')]=_0x59f6f0;return _0xd2c904;})['then'](respondWithFilteredResult(_0x40e88a,_0x3a9804))[_0x1e81('0x2b')](handleError(_0x40e88a,null));};exports['show']=function(_0x28ea8a,_0x335840){var _0x283fc4={'raw':!![],'where':{'id':_0x28ea8a['params']['id']}},_0x18c38b={};_0x18c38b[_0x1e81('0x3d')]=_['keys'](db[_0x1e81('0x3c')]['rawAttributes']);_0x18c38b[_0x1e81('0x3f')]=_[_0x1e81('0x3e')](_0x28ea8a[_0x1e81('0x3f')]);_0x18c38b[_0x1e81('0x40')]=_[_0x1e81('0x41')](_0x18c38b[_0x1e81('0x3d')],_0x18c38b['query']);_0x283fc4[_0x1e81('0x42')]=_['intersection'](_0x18c38b[_0x1e81('0x3d')],qs[_0x1e81('0x52')](_0x28ea8a[_0x1e81('0x3f')][_0x1e81('0x52')]));_0x283fc4[_0x1e81('0x42')]=_0x283fc4[_0x1e81('0x42')][_0x1e81('0x43')]?_0x283fc4[_0x1e81('0x42')]:_0x18c38b[_0x1e81('0x3d')];if(_0x28ea8a[_0x1e81('0x3f')][_0x1e81('0x4f')]){_0x283fc4[_0x1e81('0x53')]=[{'all':!![]}];}_0x283fc4=_['merge']({},_0x283fc4,_0x28ea8a[_0x1e81('0x4e')]);return db[_0x1e81('0x3c')][_0x1e81('0x54')](_0x283fc4)['then'](handleEntityNotFound(_0x335840,null))['then'](respondWithResult(_0x335840,null))[_0x1e81('0x2b')](handleError(_0x335840,null));};exports[_0x1e81('0x55')]=function(_0x8b746a,_0x1ba971){return db[_0x1e81('0x3c')][_0x1e81('0x55')](_0x8b746a['body'],{})[_0x1e81('0x35')](respondWithResult(_0x1ba971,0xc9))[_0x1e81('0x2b')](handleError(_0x1ba971,null));};exports['update']=function(_0x1ac5b2,_0x1fe500){if(_0x1ac5b2[_0x1e81('0x56')]['id']){delete _0x1ac5b2[_0x1e81('0x56')]['id'];}return db[_0x1e81('0x3c')][_0x1e81('0x54')]({'where':{'id':_0x1ac5b2[_0x1e81('0x57')]['id']}})[_0x1e81('0x35')](handleEntityNotFound(_0x1fe500,null))[_0x1e81('0x35')](saveUpdates(_0x1ac5b2[_0x1e81('0x56')],null))[_0x1e81('0x35')](respondWithResult(_0x1fe500,null))[_0x1e81('0x2b')](handleError(_0x1fe500,null));};exports[_0x1e81('0x36')]=function(_0x14523e,_0x3523e2){return db[_0x1e81('0x3c')]['find']({'where':{'id':_0x14523e[_0x1e81('0x57')]['id']}})[_0x1e81('0x35')](handleEntityNotFound(_0x3523e2,null))[_0x1e81('0x35')](removeEntity(_0x3523e2,null))[_0x1e81('0x2b')](handleError(_0x3523e2,null));};exports[_0x1e81('0x58')]=function(_0x549e97,_0x1b42ce){return db[_0x1e81('0x3c')][_0x1e81('0x58')]()[_0x1e81('0x35')](respondWithResult(_0x1b42ce,null))['catch'](handleError(_0x1b42ce,null));};var interaction_log=require(_0x1e81('0x14'))('openchannel-interactions');exports[_0x1e81('0x59')]=function(_0x5e4f72,_0x20a2a3,_0x4abf05){var _0x32cae4={'agent':{},'channel':_0x1e81('0x5a')};if(_0x5e4f72[_0x1e81('0x56')]['id']){delete _0x5e4f72['body']['id'];}_0x5e4f72[_0x1e81('0x56')][_0x1e81('0x5b')]=!![];_0x5e4f72[_0x1e81('0x56')][_0x1e81('0x5c')]=moment()[_0x1e81('0x5d')](_0x1e81('0x5e'));_0x5e4f72[_0x1e81('0x56')][_0x1e81('0x5f')]=_0x5e4f72[_0x1e81('0x56')][_0x1e81('0x5f')]||_0x5e4f72['user']['id'];_0x32cae4['agent']['id']=_0x5e4f72[_0x1e81('0x56')][_0x1e81('0x5f')];return db[_0x1e81('0x3c')]['find']({'where':{'id':_0x5e4f72[_0x1e81('0x57')]['id'],'UserId':null}})[_0x1e81('0x35')](handleEntityNotFound(_0x20a2a3,null))[_0x1e81('0x35')](saveUpdates(_0x5e4f72[_0x1e81('0x56')],null))[_0x1e81('0x35')](function(_0x17b618){if(_0x17b618){_0x32cae4['message']=_0x17b618['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x1e81('0x54')]({'where':{'id':_0x17b618[_0x1e81('0x60')]}});}return null;})[_0x1e81('0x35')](handleEntityNotFound(_0x20a2a3,null))[_0x1e81('0x35')](function(_0x42bf6f){if(_0x42bf6f){return _0x42bf6f[_0x1e81('0x34')]({'UserId':_0x5e4f72['body'][_0x1e81('0x5f')],'read1stAt':_['isNil'](_0x42bf6f[_0x1e81('0x61')])?moment()['format'](_0x1e81('0x5e')):undefined});}return null;})['then'](function(_0x13fda5){if(_0x13fda5){_0x32cae4[_0x1e81('0x62')]=_0x13fda5[_0x1e81('0x63')]({'plain':!![]});interaction_log[_0x1e81('0x21')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e4f72[_0x1e81('0x64')]['id'],_0x5e4f72[_0x1e81('0x64')][_0x1e81('0x38')],_0x5e4f72['user']['role'],_0x32cae4[_0x1e81('0x62')]['id'],_0x5e4f72[_0x1e81('0x56')]?JSON[_0x1e81('0x25')](_0x5e4f72[_0x1e81('0x56')]):'null');return respondWithRpcPromise(_0x1e81('0x65'),'acceptMessage',_0x32cae4);}return null;})[_0x1e81('0x35')](function(_0x336066){var _0x37a2cd=_0x1e81('0x66')+_0x336066[_0x1e81('0x29')][_0x1e81('0x67')];return db[_0x1e81('0x68')][_0x1e81('0x3f')](_0x37a2cd,{'type':db[_0x1e81('0x69')][_0x1e81('0x6a')][_0x1e81('0x6b')],'raw':!![]})['then'](function(_0x4a6464){return _0x4a6464;});})['then'](function(_0x2d7dcc){if(_0x2d7dcc){_0x32cae4['message'][_0x1e81('0x6c')]=_0x2d7dcc[0x0];if(!_0x5e4f72[_0x1e81('0x56')][_0x1e81('0x5f')])return;return db['User'][_0x1e81('0x54')]({'where':{'id':_0x5e4f72[_0x1e81('0x56')]['UserId'],'role':_0x1e81('0x6d')},'attributes':['id',_0x1e81('0x38'),_0x1e81('0x6e'),_0x1e81('0x6f'),_0x1e81('0x70')],'raw':!![]});}return null;})['then'](function(_0x186303){if(!_0x186303)return null;_0x32cae4[_0x1e81('0x29')]['agent']=_0x186303;return _0x32cae4;})['then'](function(_0x1a43a5){if(_0x1a43a5){if(_0x5e4f72[_0x1e81('0x56')]['manual']){_0x32cae4[_0x1e81('0x29')][_0x1e81('0x71')]=util[_0x1e81('0x5d')](_0x1e81('0x72'),_0x5e4f72[_0x1e81('0x64')][_0x1e81('0x38')]);_0x32cae4[_0x1e81('0x29')][_0x1e81('0x73')]=_0x32cae4['channel'];_0x32cae4['message'][_0x1e81('0x74')]=_0x32cae4[_0x1e81('0x73')];_0x32cae4[_0x1e81('0x29')][_0x1e81('0x75')]=_0x1e81('0x59');return respondWithRpcPromise(_0x1e81('0x76'),_0x1e81('0x76'),{'event':_0x1e81('0x77'),'message':_0x32cae4[_0x1e81('0x29')]},client9002)[_0x1e81('0x35')](function(){return _0x32cae4;});}return _0x32cae4;}return null;})[_0x1e81('0x35')](respondWithResult(_0x20a2a3,null))[_0x1e81('0x2b')](handleError(_0x20a2a3,null));};var interaction_log=require('../../config/logger')(_0x1e81('0x78'));exports['reject']=function(_0x54fae2,_0x3201f4,_0x76cd7f){var _0x34f0dc={'agent':{},'channel':_0x1e81('0x5a')};if(_0x54fae2[_0x1e81('0x56')]['id']){delete _0x54fae2[_0x1e81('0x56')]['id'];}_0x54fae2[_0x1e81('0x56')]['UserId']=_0x54fae2[_0x1e81('0x56')][_0x1e81('0x5f')]||_0x54fae2[_0x1e81('0x64')]['id'];_0x34f0dc[_0x1e81('0x6d')]['id']=_0x54fae2[_0x1e81('0x56')][_0x1e81('0x5f')];return db[_0x1e81('0x3c')]['find']({'where':{'id':_0x54fae2[_0x1e81('0x57')]['id'],'UserId':null}})[_0x1e81('0x35')](handleEntityNotFound(_0x3201f4,null))[_0x1e81('0x35')](function(_0x3db63c){if(_0x3db63c){_0x34f0dc[_0x1e81('0x29')]=_0x3db63c['get']({'plain':!![]});return db[_0x1e81('0x79')][_0x1e81('0x54')]({'where':{'id':_0x3db63c[_0x1e81('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x3201f4,null))[_0x1e81('0x35')](function(_0x751271){if(_0x751271){_0x34f0dc[_0x1e81('0x62')]=_0x751271[_0x1e81('0x63')]({'plain':!![]});interaction_log[_0x1e81('0x21')](_0x1e81('0x7a'),_0x54fae2[_0x1e81('0x64')]['id'],_0x54fae2['user'][_0x1e81('0x38')],_0x54fae2[_0x1e81('0x64')]['role'],_0x34f0dc[_0x1e81('0x62')]['id'],_0x54fae2[_0x1e81('0x56')]?JSON[_0x1e81('0x25')](_0x54fae2[_0x1e81('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0x1e81('0x7b'),_0x34f0dc);}return null;})[_0x1e81('0x35')](function(_0xded5c8){var _0x2046d6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xded5c8[_0x1e81('0x29')][_0x1e81('0x67')];return db[_0x1e81('0x68')]['query'](_0x2046d6,{'type':db['Sequelize']['QueryTypes'][_0x1e81('0x6b')],'raw':!![]})[_0x1e81('0x35')](function(_0x457f56){return _0x457f56;});})[_0x1e81('0x35')](function(_0x2377be){if(_0x2377be){_0x34f0dc[_0x1e81('0x29')][_0x1e81('0x6c')]=_0x2377be[0x0];if(!_0x54fae2[_0x1e81('0x56')]['UserId'])return;return db[_0x1e81('0x7c')][_0x1e81('0x54')]({'where':{'id':_0x54fae2[_0x1e81('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x1e81('0x38'),'fullname',_0x1e81('0x6f'),'internal'],'raw':!![]});}return null;})['then'](function(_0xd474c7){if(!_0xd474c7)return null;_0x34f0dc[_0x1e81('0x29')]['agent']=_0xd474c7;return _0x34f0dc;})[_0x1e81('0x35')](function(_0x359e28){if(_0x359e28){_0x359e28['message']['interface']=util[_0x1e81('0x5d')](_0x1e81('0x72'),_0x54fae2[_0x1e81('0x64')][_0x1e81('0x38')]);_0x359e28[_0x1e81('0x29')][_0x1e81('0x73')]=_0x34f0dc[_0x1e81('0x73')];_0x359e28[_0x1e81('0x29')][_0x1e81('0x74')]=_0x34f0dc['channel'];_0x359e28[_0x1e81('0x29')][_0x1e81('0x75')]=_0x1e81('0x7d');respondWithRpcPromise(_0x1e81('0x76'),_0x1e81('0x76'),{'event':_0x1e81('0x7e'),'message':_0x359e28[_0x1e81('0x29')]},client9002);return _0x34f0dc;}return null;})[_0x1e81('0x35')](respondWithResult(_0x3201f4,null))[_0x1e81('0x2b')](handleError(_0x3201f4,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 4d1bd85..cf6c5f0 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 _0x41d5=['setMaxListeners','save','update','emit','hook','../../mysqldb'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x41d5,0xef));var _0x541d=function(_0xb533a6,_0xec087b){_0xb533a6=_0xb533a6-0x0;var _0x33a487=_0x41d5[_0xb533a6];return _0x33a487;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x541d('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x541d('0x1')](0x0);var events={'afterCreate':_0x541d('0x2'),'afterUpdate':_0x541d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x296be1){return function(_0x3770f2,_0x2f26d5,_0x3b55cd){OpenchannelMessageEvents[_0x541d('0x4')](_0x296be1+':'+_0x3770f2['id'],_0x3770f2);OpenchannelMessageEvents[_0x541d('0x4')](_0x296be1,_0x3770f2);_0x3b55cd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x541d('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xdf5c=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x315bb7,_0x344f3d){var _0x1f8e69=function(_0xf4ffaa){while(--_0xf4ffaa){_0x315bb7['push'](_0x315bb7['shift']());}};_0x1f8e69(++_0x344f3d);}(_0xdf5c,0x1b6));var _0xcdf5=function(_0x2d42dc,_0x483e9a){_0x2d42dc=_0x2d42dc-0x0;var _0x35ef17=_0xdf5c[_0x2d42dc];return _0x35ef17;};'use strict';var EventEmitter=require(_0xcdf5('0x0'));var OpenchannelMessage=require(_0xcdf5('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xcdf5('0x2')](0x0);var events={'afterCreate':_0xcdf5('0x3'),'afterUpdate':'update','afterDestroy':_0xcdf5('0x4')};function emitEvent(_0x2dfa35){return function(_0x1e6dda,_0xc4bf1a,_0x504f2c){OpenchannelMessageEvents[_0xcdf5('0x5')](_0x2dfa35+':'+_0x1e6dda['id'],_0x1e6dda);OpenchannelMessageEvents[_0xcdf5('0x5')](_0x2dfa35,_0x1e6dda);_0x504f2c(null);};}for(var e in events){if(events[_0xcdf5('0x6')](e)){var event=events[e];OpenchannelMessage[_0xcdf5('0x7')](e,emitEvent(event));}}module[_0xcdf5('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 87fdc62..a72dfe1 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 _0x3efa=['CmContact','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','POST','info','format','threadId','catch','error','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions'];(function(_0xd6e6a6,_0x10096b){var _0x4bb481=function(_0x32e094){while(--_0x32e094){_0xd6e6a6['push'](_0xd6e6a6['shift']());}};_0x4bb481(++_0x10096b);}(_0x3efa,0xe3));var _0xa3ef=function(_0x164dd3,_0xf6e7b4){_0x164dd3=_0x164dd3-0x0;var _0x21d35a=_0x3efa[_0x164dd3];return _0x21d35a;};'use strict';var _=require(_0xa3ef('0x0'));var util=require(_0xa3ef('0x1'));var logger=require(_0xa3ef('0x2'))(_0xa3ef('0x3'));var moment=require(_0xa3ef('0x4'));var BPromise=require(_0xa3ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3ef('0x6'));var rimraf=require(_0xa3ef('0x7'));var config=require(_0xa3ef('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0xa3ef('0x9')]=function(_0x37688e,_0x143731){return _0x37688e[_0xa3ef('0xa')]('OpenchannelMessage',attributes,{'tableName':_0xa3ef('0xb'),'paranoid':![],'indexes':[{'name':_0xa3ef('0xc'),'fields':[_0xa3ef('0xd')],'type':_0xa3ef('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1027c9,_0x372e76,_0x2a1ee6){var _0x4e1885=_0x37688e[_0xa3ef('0xf')];var _0x215799=_0x1027c9[_0xa3ef('0x10')]({'plain':!![]});if(_0x215799[_0xa3ef('0x11')][_0xa3ef('0x12')]()==='in'||_0x215799[_0xa3ef('0x11')]['toLowerCase']()===_0xa3ef('0x13')&&!_0x215799[_0xa3ef('0x14')]&&!_[_0xa3ef('0x15')](_0x215799[_0xa3ef('0x16')])){_0x4e1885[_0xa3ef('0x17')][_0xa3ef('0x18')]({'where':{'id':_0x215799['OpenchannelInteractionId']}})[_0xa3ef('0x19')](function(_0x2d4bea){if(_0x2d4bea){_0x2d4bea[_0xa3ef('0x1a')]({'lastMsgAt':_0x215799[_0xa3ef('0x1b')],'lastMsgDirection':_0x215799['direction']['toLowerCase']()});}})['catch'](function(_0x11713c){console['error'](_0x11713c);});}if(_0x215799['direction']===_0xa3ef('0x13')&&!_0x215799[_0xa3ef('0x14')]){var _0x50fd13;_0x4e1885['CmContact'][_0xa3ef('0x1c')]()[_0xa3ef('0x19')](function(_0x3842e9){return _0x4e1885[_0xa3ef('0x1d')][_0xa3ef('0x1e')]({'where':{'id':_0x215799[_0xa3ef('0x1f')]},'include':[{'model':_0x4e1885[_0xa3ef('0x17')],'as':_0xa3ef('0x20'),'where':{'id':_0x215799['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x4e1885[_0xa3ef('0x21')],'as':_0xa3ef('0x22'),'attributes':_[_0xa3ef('0x23')](_0x3842e9)}]}]});})[_0xa3ef('0x19')](function(_0x4d2a5b){_0x50fd13=_0x4d2a5b[_0xa3ef('0x10')]({'plain':!![]});if(_0x50fd13&&_0x50fd13[_0xa3ef('0x24')]){logger['info'](_0xa3ef('0x25'),_0xa3ef('0x26'),util['format'](_0xa3ef('0x27'),_0x215799['id'],_0x50fd13[_0xa3ef('0x24')]));if(_0x50fd13['Interactions']&&_0x50fd13[_0xa3ef('0x20')][_0xa3ef('0x28')]){_0x215799[_0xa3ef('0x29')]=_[_0xa3ef('0x2a')](_0x50fd13[_0xa3ef('0x20')][0x0],_0xa3ef('0x22'));_0x215799[_0xa3ef('0x22')]=_0x50fd13[_0xa3ef('0x20')][0x0]['Contact'];}var _0x372e76={'method':'POST','uri':encodeURI(_0x50fd13[_0xa3ef('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x372e76[_0xa3ef('0x2b')]){case'GET':_0x372e76['qs']=_0x215799;break;case _0xa3ef('0x2c'):_0x372e76[_0xa3ef('0xd')]=_0x215799;break;}return rp(_0x372e76)[_0xa3ef('0x19')](function(_0xc4f7db){logger[_0xa3ef('0x2d')](_0xa3ef('0x25'),_0xa3ef('0x26'),util[_0xa3ef('0x2e')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x215799['id'],_0x50fd13[_0xa3ef('0x24')]));if(_0xc4f7db[_0xa3ef('0xd')][_0xa3ef('0x2f')]&&_0xc4f7db[_0xa3ef('0xd')]['threadId']!=_0x215799[_0xa3ef('0x29')]['threadId']){return _0x4e1885[_0xa3ef('0x17')]['update']({'threadId':_0xc4f7db[_0xa3ef('0xd')][_0xa3ef('0x2f')]},{'where':{'id':_0x215799[_0xa3ef('0x29')]['id']}});}else{return;}})[_0xa3ef('0x19')](function(){return _0x1027c9['update']({'read':!![]});})[_0xa3ef('0x30')](function(_0x316ca3){logger[_0xa3ef('0x31')](_0xa3ef('0x25'),'afterCreate',util['inspect'](_0x316ca3,{'showHidden':![],'depth':null}));_0x2a1ee6();});}else{_0x2a1ee6();}})[_0xa3ef('0x32')](function(){_0x2a1ee6();});}else{_0x2a1ee6();}}},'charset':_0xa3ef('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0fe9=['utf8mb4','utf8mb4_unicode_ci','util','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','body','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally'];(function(_0x5178a0,_0x1c5596){var _0xfe7604=function(_0x170499){while(--_0x170499){_0x5178a0['push'](_0x5178a0['shift']());}};_0xfe7604(++_0x1c5596);}(_0x0fe9,0x95));var _0x90fe=function(_0x4e0fc6,_0x558c82){_0x4e0fc6=_0x4e0fc6-0x0;var _0x2afc49=_0x0fe9[_0x4e0fc6];return _0x2afc49;};'use strict';var _=require('lodash');var util=require(_0x90fe('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x90fe('0x1'));var BPromise=require('bluebird');var rp=require(_0x90fe('0x2'));var fs=require('fs');var path=require(_0x90fe('0x3'));var rimraf=require(_0x90fe('0x4'));var config=require(_0x90fe('0x5'));var attributes=require(_0x90fe('0x6'));module[_0x90fe('0x7')]=function(_0x12c685,_0x53e6df){return _0x12c685[_0x90fe('0x8')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x90fe('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7f830b,_0x4855b3,_0x4525b2){var _0xb8284b=_0x12c685[_0x90fe('0xa')];var _0x1ae402=_0x7f830b[_0x90fe('0xb')]({'plain':!![]});if(_0x1ae402[_0x90fe('0xc')][_0x90fe('0xd')]()==='in'||_0x1ae402[_0x90fe('0xc')][_0x90fe('0xd')]()==='out'&&!_0x1ae402[_0x90fe('0xe')]&&!_[_0x90fe('0xf')](_0x1ae402[_0x90fe('0x10')])){_0xb8284b[_0x90fe('0x11')][_0x90fe('0x12')]({'where':{'id':_0x1ae402[_0x90fe('0x13')]}})[_0x90fe('0x14')](function(_0x3763e8){if(_0x3763e8){_0x3763e8[_0x90fe('0x15')]({'lastMsgAt':_0x1ae402[_0x90fe('0x16')],'lastMsgDirection':_0x1ae402[_0x90fe('0xc')][_0x90fe('0xd')]()});}})[_0x90fe('0x17')](function(_0x523348){console[_0x90fe('0x18')](_0x523348);});}if(_0x1ae402['direction']===_0x90fe('0x19')&&!_0x1ae402[_0x90fe('0xe')]){var _0x3d7d34;_0xb8284b[_0x90fe('0x1a')][_0x90fe('0x1b')]()['then'](function(_0x2be6cb){return _0xb8284b['OpenchannelAccount'][_0x90fe('0x1c')]({'where':{'id':_0x1ae402[_0x90fe('0x1d')]},'include':[{'model':_0xb8284b[_0x90fe('0x11')],'as':_0x90fe('0x1e'),'where':{'id':_0x1ae402['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xb8284b[_0x90fe('0x1a')],'as':_0x90fe('0x1f'),'attributes':_[_0x90fe('0x20')](_0x2be6cb)}]}]});})[_0x90fe('0x14')](function(_0x18cd53){_0x3d7d34=_0x18cd53[_0x90fe('0xb')]({'plain':!![]});if(_0x3d7d34&&_0x3d7d34[_0x90fe('0x21')]){logger[_0x90fe('0x22')](_0x90fe('0x23'),_0x90fe('0x24'),util[_0x90fe('0x25')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x1ae402['id'],_0x3d7d34[_0x90fe('0x21')]));if(_0x3d7d34['Interactions']&&_0x3d7d34[_0x90fe('0x1e')]['length']){_0x1ae402[_0x90fe('0x26')]=_[_0x90fe('0x27')](_0x3d7d34[_0x90fe('0x1e')][0x0],'Contact');_0x1ae402[_0x90fe('0x1f')]=_0x3d7d34[_0x90fe('0x1e')][0x0][_0x90fe('0x1f')];}var _0x4855b3={'method':_0x90fe('0x28'),'uri':encodeURI(_0x3d7d34[_0x90fe('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4855b3[_0x90fe('0x29')]){case _0x90fe('0x2a'):_0x4855b3['qs']=_0x1ae402;break;case _0x90fe('0x28'):_0x4855b3['body']=_0x1ae402;break;}return rp(_0x4855b3)[_0x90fe('0x14')](function(_0x1514e0){logger[_0x90fe('0x22')](_0x90fe('0x23'),'afterCreate',util['format'](_0x90fe('0x2b'),_0x1ae402['id'],_0x3d7d34[_0x90fe('0x21')]));if(_0x1514e0[_0x90fe('0x9')]['threadId']&&_0x1514e0['body'][_0x90fe('0x2c')]!=_0x1ae402[_0x90fe('0x26')][_0x90fe('0x2c')]){return _0xb8284b['OpenchannelInteraction'][_0x90fe('0x15')]({'threadId':_0x1514e0['body']['threadId']},{'where':{'id':_0x1ae402[_0x90fe('0x26')]['id']}});}else{return;}})['then'](function(){return _0x7f830b['update']({'read':!![]});})['catch'](function(_0x16de51){logger[_0x90fe('0x18')](_0x90fe('0x23'),_0x90fe('0x24'),util[_0x90fe('0x2d')](_0x16de51,{'showHidden':![],'depth':null}));_0x4525b2();});}else{_0x4525b2();}})[_0x90fe('0x2e')](function(){_0x4525b2();});}else{_0x4525b2();}}},'charset':_0x90fe('0x2f'),'collate':_0x90fe('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 3805213..e059a11 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x289404,_0x231d75){var _0x3ef371=function(_0xea0443){while(--_0xea0443){_0x289404['push'](_0x289404['shift']());}};_0x3ef371(++_0x231d75);}(_0x2ef3,0xba));var _0x32ef=function(_0x4f7ddc,_0x2e5337){_0x4f7ddc=_0x4f7ddc-0x0;var _0x45c3ba=_0x2ef3[_0x4f7ddc];return _0x45c3ba;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56aee6,_0x3064cd){var _0x370785=function(_0x2587ff){while(--_0x2587ff){_0x56aee6['push'](_0x56aee6['shift']());}};_0x370785(++_0x3064cd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d901c,_0x558f63){_0x1d901c=_0x1d901c-0x0;var _0x4cc8a5=_0x5f2f[_0x1d901c];return _0x4cc8a5;};'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});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index fd12afa..9cb0ec8 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 _0x2539=['openchannelMessage:','save','removeListener','register','length'];(function(_0x76faa4,_0x4a8b9c){var _0x5cab58=function(_0x159033){while(--_0x159033){_0x76faa4['push'](_0x76faa4['shift']());}};_0x5cab58(++_0x4a8b9c);}(_0x2539,0x1e6));var _0x9253=function(_0x162178,_0x5604d7){_0x162178=_0x162178-0x0;var _0x2af0e0=_0x2539[_0x162178];return _0x2af0e0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x9253('0x0'),'remove','update'];function createListener(_0x5c7761,_0x59bec3){return function(_0x16e533){_0x59bec3['emit'](_0x5c7761,_0x16e533);};}function removeListener(_0x4ea17d,_0x3874e5){return function(){OpenchannelMessageEvents[_0x9253('0x1')](_0x4ea17d,_0x3874e5);};}exports[_0x9253('0x2')]=function(_0xe6e39b){for(var _0x48f983=0x0,_0x3f37b4=events[_0x9253('0x3')];_0x48f983<_0x3f37b4;_0x48f983++){var _0xfcd9d4=events[_0x48f983];var _0x56ebc2=createListener(_0x9253('0x4')+_0xfcd9d4,_0xe6e39b);OpenchannelMessageEvents['on'](_0xfcd9d4,_0x56ebc2);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./openchannelMessage.events','save','emit'];(function(_0x426484,_0x1dcee1){var _0x55d1fb=function(_0x3fc187){while(--_0x3fc187){_0x426484['push'](_0x426484['shift']());}};_0x55d1fb(++_0x1dcee1);}(_0xe14b,0x93));var _0xbe14=function(_0x18eaba,_0x237f85){_0x18eaba=_0x18eaba-0x0;var _0x3727c5=_0xe14b[_0x18eaba];return _0x3727c5;};'use strict';var OpenchannelMessageEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){OpenchannelMessageEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('openchannelMessage:'+_0x196fca,_0x1fe204);OpenchannelMessageEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index cdff74d..217df9a 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 _0xe47a=['getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getMembers','/:id/teams'];(function(_0x4b0ade,_0x4d772c){var _0x42521b=function(_0x58ad94){while(--_0x58ad94){_0x4b0ade['push'](_0x4b0ade['shift']());}};_0x42521b(++_0x4d772c);}(_0xe47a,0x187));var _0xae47=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xe47a[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0xae47('0x0'));var util=require(_0xae47('0x1'));var path=require(_0xae47('0x2'));var timeout=require(_0xae47('0x3'));var express=require(_0xae47('0x4'));var router=express[_0xae47('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xae47('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae47('0x7'));var controller=require('./openchannelQueue.controller');router[_0xae47('0x8')]('/',auth[_0xae47('0x9')](),controller[_0xae47('0xa')]);router[_0xae47('0x8')]('/describe',auth[_0xae47('0x9')](),controller['describe']);router[_0xae47('0x8')](_0xae47('0xb'),auth[_0xae47('0x9')](),controller[_0xae47('0xc')]);router[_0xae47('0x8')]('/:id/members',auth[_0xae47('0x9')](),controller[_0xae47('0xd')]);router[_0xae47('0x8')](_0xae47('0xe'),auth[_0xae47('0x9')](),controller[_0xae47('0xf')]);router[_0xae47('0x8')](_0xae47('0x10'),auth[_0xae47('0x9')](),controller[_0xae47('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xae47('0x12')]);router[_0xae47('0x13')](_0xae47('0xe'),auth[_0xae47('0x9')](),controller[_0xae47('0x14')]);router['post'](_0xae47('0x10'),auth[_0xae47('0x9')](),controller[_0xae47('0x15')]);router[_0xae47('0x16')](_0xae47('0xb'),auth[_0xae47('0x9')](),controller[_0xae47('0x17')]);router[_0xae47('0x18')]('/:id',auth[_0xae47('0x9')](),controller[_0xae47('0x19')]);router[_0xae47('0x18')](_0xae47('0xe'),auth['isAuthenticated'](),controller[_0xae47('0x1a')]);router['delete'](_0xae47('0x10'),auth[_0xae47('0x9')](),controller[_0xae47('0x1b')]);module[_0xae47('0x1c')]=router; \ No newline at end of file +var _0x3e94=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','index','/describe','isAuthenticated','get','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0xdf6837,_0x440887){var _0x254cfa=function(_0x3bcbc2){while(--_0x3bcbc2){_0xdf6837['push'](_0xdf6837['shift']());}};_0x254cfa(++_0x440887);}(_0x3e94,0x1c0));var _0x43e9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3e94[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var path=require(_0x43e9('0x2'));var timeout=require(_0x43e9('0x3'));var express=require(_0x43e9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e9('0x5'));var interaction=require(_0x43e9('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x43e9('0x7')]);router['get'](_0x43e9('0x8'),auth[_0x43e9('0x9')](),controller['describe']);router[_0x43e9('0xa')](_0x43e9('0xb'),auth[_0x43e9('0x9')](),controller[_0x43e9('0xc')]);router['get']('/:id/members',auth[_0x43e9('0x9')](),controller['getMembers']);router[_0x43e9('0xa')](_0x43e9('0xd'),auth[_0x43e9('0x9')](),controller[_0x43e9('0xe')]);router[_0x43e9('0xa')](_0x43e9('0xf'),auth['isAuthenticated'](),controller[_0x43e9('0x10')]);router[_0x43e9('0x11')]('/',auth[_0x43e9('0x9')](),controller['create']);router[_0x43e9('0x11')](_0x43e9('0xd'),auth[_0x43e9('0x9')](),controller['addTeams']);router['post'](_0x43e9('0xf'),auth['isAuthenticated'](),controller[_0x43e9('0x12')]);router[_0x43e9('0x13')](_0x43e9('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x43e9('0xb'),auth[_0x43e9('0x9')](),controller[_0x43e9('0x14')]);router[_0x43e9('0x15')](_0x43e9('0xd'),auth[_0x43e9('0x9')](),controller[_0x43e9('0x16')]);router[_0x43e9('0x15')]('/:id/users',auth[_0x43e9('0x9')](),controller[_0x43e9('0x17')]);module[_0x43e9('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 0b21450..fde3d8a 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 _0xc64c=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xc64c,0x17e));var _0xcc64=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xc64c[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require('sequelize');module[_0xcc64('0x0')]={'name':{'type':Sequelize[_0xcc64('0x1')],'unique':_0xcc64('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xcc64('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcc64('0x4')](_0xcc64('0x5'),_0xcc64('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x8e00=['roundrobin','sequelize','exports','name','rrmemory','beepall'];(function(_0x1c7de1,_0x194d70){var _0x40fbef=function(_0x552937){while(--_0x552937){_0x1c7de1['push'](_0x1c7de1['shift']());}};_0x40fbef(++_0x194d70);}(_0x8e00,0xa9));var _0x08e0=function(_0x3e8dac,_0x5aa4cb){_0x3e8dac=_0x3e8dac-0x0;var _0x2b8531=_0x8e00[_0x3e8dac];return _0x2b8531;};'use strict';var Sequelize=require(_0x08e0('0x0'));module[_0x08e0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x08e0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x08e0('0x3'),_0x08e0('0x4'),_0x08e0('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 1d3f9bf..ab6c541 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 _0xd7d5=['removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserOpenchannelQueue','sort','pick','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd7d5,0xac));var _0x5d7d=function(_0x41d249,_0x56e407){_0x41d249=_0x41d249-0x0;var _0x432ec3=_0xd7d5[_0x41d249];return _0x432ec3;};'use strict';var emlformat=require(_0x5d7d('0x0'));var rimraf=require(_0x5d7d('0x1'));var zipdir=require(_0x5d7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d7d('0x3'));var moment=require(_0x5d7d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5d7d('0x5'));var util=require('util');var path=require(_0x5d7d('0x6'));var sox=require(_0x5d7d('0x7'));var csv=require(_0x5d7d('0x8'));var ejs=require(_0x5d7d('0x9'));var fs=require('fs');var fs_extra=require(_0x5d7d('0xa'));var _=require('lodash');var squel=require(_0x5d7d('0xb'));var crypto=require(_0x5d7d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5d7d('0xd'));var toCsv=require(_0x5d7d('0x8'));var querystring=require(_0x5d7d('0xe'));var Papa=require(_0x5d7d('0xf'));var Redis=require(_0x5d7d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5d7d('0x11'));var as=require(_0x5d7d('0x12'));var hardwareService=require(_0x5d7d('0x13'));var logger=require(_0x5d7d('0x14'))(_0x5d7d('0x15'));var utils=require(_0x5d7d('0x16'));var config=require(_0x5d7d('0x17'));var licenseUtil=require(_0x5d7d('0x18'));var db=require(_0x5d7d('0x19'))['db'];config[_0x5d7d('0x1a')]=_[_0x5d7d('0x1b')](config[_0x5d7d('0x1a')],{'host':_0x5d7d('0x1c'),'port':0x18eb});var socket=require(_0x5d7d('0x1d'))(new Redis(config['redis']));require(_0x5d7d('0x1e'))['register'](socket);function respondWithStatusCode(_0x596e99,_0x105fe4){_0x105fe4=_0x105fe4||0xcc;return function(_0x20c926){if(_0x20c926){return _0x596e99[_0x5d7d('0x1f')](_0x105fe4);}return _0x596e99[_0x5d7d('0x20')](_0x105fe4)['end']();};}function respondWithResult(_0x39fcb0,_0x10b1cf){_0x10b1cf=_0x10b1cf||0xc8;return function(_0x4c8592){if(_0x4c8592){return _0x39fcb0['status'](_0x10b1cf)[_0x5d7d('0x21')](_0x4c8592);}};}function respondWithFilteredResult(_0xb69a66,_0x1a637c){return function(_0x1fe84c){if(_0x1fe84c){var _0x5b131d=typeof _0x1a637c[_0x5d7d('0x22')]==='undefined'&&typeof _0x1a637c[_0x5d7d('0x23')]==='undefined';var _0x2dfa78=_0x1fe84c[_0x5d7d('0x24')];var _0x2eaff5=_0x5b131d?0x0:_0x1a637c['offset'];var _0x38e360=_0x5b131d?_0x1fe84c[_0x5d7d('0x24')]:_0x1a637c[_0x5d7d('0x22')]+_0x1a637c['limit'];var _0x46ba35;if(_0x38e360>=_0x2dfa78){_0x38e360=_0x2dfa78;_0x46ba35=0xc8;}else{_0x46ba35=0xce;}_0xb69a66[_0x5d7d('0x20')](_0x46ba35);return _0xb69a66[_0x5d7d('0x25')](_0x5d7d('0x26'),_0x2eaff5+'-'+_0x38e360+'/'+_0x2dfa78)[_0x5d7d('0x21')](_0x1fe84c);}return null;};}function patchUpdates(_0x5057b0){return function(_0x50fe71){try{jsonpatch[_0x5d7d('0x27')](_0x50fe71,_0x5057b0,!![]);}catch(_0x2953b6){return BPromise[_0x5d7d('0x28')](_0x2953b6);}return _0x50fe71[_0x5d7d('0x29')]();};}function saveUpdates(_0x33f32f,_0x47f475){return function(_0x99554f){if(_0x99554f){return _0x99554f['update'](_0x33f32f)[_0x5d7d('0x2a')](function(_0x155e54){return _0x155e54;});}return null;};}function removeEntity(_0x427689,_0x5301df){return function(_0x33746d){if(_0x33746d){return _0x33746d[_0x5d7d('0x2b')]()[_0x5d7d('0x2a')](function(){var _0x5c04c1=_0x33746d[_0x5d7d('0x2c')]({'plain':!![]});var _0x8491b=_0x5d7d('0x2d');return db[_0x5d7d('0x2e')][_0x5d7d('0x2b')]({'where':{'type':_0x8491b,'resourceId':_0x5c04c1['id']}})[_0x5d7d('0x2a')](function(){return _0x33746d;});})['then'](function(){_0x427689[_0x5d7d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x68d91d,_0x3fd405){return function(_0xb7d0a0){if(!_0xb7d0a0){_0x68d91d[_0x5d7d('0x1f')](0x194);}return _0xb7d0a0;};}function handleError(_0x49ee9a,_0x2fb10d){_0x2fb10d=_0x2fb10d||0x1f4;return function(_0x37a981){logger[_0x5d7d('0x2f')](_0x37a981['stack']);if(_0x37a981[_0x5d7d('0x30')]){delete _0x37a981[_0x5d7d('0x30')];}_0x49ee9a[_0x5d7d('0x20')](_0x2fb10d)[_0x5d7d('0x31')](_0x37a981);};}exports[_0x5d7d('0x32')]=function(_0x4f8a0f,_0xbe8924){var _0x3142c9={},_0x453918={},_0x236613={'count':0x0,'rows':[]};var _0x21a5ce=_[_0x5d7d('0x33')](db[_0x5d7d('0x34')]['rawAttributes'],function(_0x2c2f88){return{'name':_0x2c2f88[_0x5d7d('0x35')],'type':_0x2c2f88[_0x5d7d('0x36')]['key']};});_0x453918[_0x5d7d('0x37')]=_[_0x5d7d('0x33')](_0x21a5ce,_0x5d7d('0x30'));_0x453918['query']=_['keys'](_0x4f8a0f[_0x5d7d('0x38')]);_0x453918['filters']=_[_0x5d7d('0x39')](_0x453918[_0x5d7d('0x37')],_0x453918['query']);_0x3142c9[_0x5d7d('0x3a')]=_['intersection'](_0x453918['model'],qs[_0x5d7d('0x3b')](_0x4f8a0f['query']['fields']));_0x3142c9[_0x5d7d('0x3a')]=_0x3142c9[_0x5d7d('0x3a')][_0x5d7d('0x3c')]?_0x3142c9[_0x5d7d('0x3a')]:_0x453918[_0x5d7d('0x37')];if(!_0x4f8a0f['query'][_0x5d7d('0x3d')](_0x5d7d('0x3e'))){_0x3142c9[_0x5d7d('0x23')]=qs['limit'](_0x4f8a0f['query']['limit']);_0x3142c9['offset']=qs['offset'](_0x4f8a0f['query']['offset']);}_0x3142c9[_0x5d7d('0x3f')]=qs['sort'](_0x4f8a0f[_0x5d7d('0x38')]['sort']);_0x3142c9[_0x5d7d('0x40')]=qs[_0x5d7d('0x41')](_['pick'](_0x4f8a0f[_0x5d7d('0x38')],_0x453918[_0x5d7d('0x41')]),_0x21a5ce);if(_0x4f8a0f[_0x5d7d('0x38')]['filter']){_0x3142c9[_0x5d7d('0x40')]=_[_0x5d7d('0x42')](_0x3142c9[_0x5d7d('0x40')],{'$or':_[_0x5d7d('0x33')](_0x21a5ce,function(_0x40fac2){if(_0x40fac2['type']!==_0x5d7d('0x43')){var _0x1682e1={};_0x1682e1[_0x40fac2[_0x5d7d('0x30')]]={'$like':'%'+_0x4f8a0f[_0x5d7d('0x38')][_0x5d7d('0x44')]+'%'};return _0x1682e1;}})});}_0x3142c9=_[_0x5d7d('0x42')]({},_0x3142c9,_0x4f8a0f[_0x5d7d('0x45')]);var _0x39f850={'where':_0x3142c9['where']};return db['OpenchannelQueue'][_0x5d7d('0x24')](_0x39f850)[_0x5d7d('0x2a')](function(_0x4f5de2){_0x236613[_0x5d7d('0x24')]=_0x4f5de2;if(_0x4f8a0f['query'][_0x5d7d('0x46')]){_0x3142c9[_0x5d7d('0x47')]=[{'all':!![]}];}return db[_0x5d7d('0x34')][_0x5d7d('0x48')](_0x3142c9);})['then'](function(_0x1d0c49){_0x236613[_0x5d7d('0x49')]=_0x1d0c49;return _0x236613;})[_0x5d7d('0x2a')](respondWithFilteredResult(_0xbe8924,_0x3142c9))[_0x5d7d('0x4a')](handleError(_0xbe8924,null));};exports[_0x5d7d('0x4b')]=function(_0x46119c,_0x5aca8e){var _0x3acaad={'raw':!![],'where':{'id':_0x46119c[_0x5d7d('0x4c')]['id']}},_0x24b6a4={};_0x24b6a4[_0x5d7d('0x37')]=_[_0x5d7d('0x4d')](db[_0x5d7d('0x34')][_0x5d7d('0x4e')]);_0x24b6a4[_0x5d7d('0x38')]=_[_0x5d7d('0x4d')](_0x46119c[_0x5d7d('0x38')]);_0x24b6a4[_0x5d7d('0x41')]=_[_0x5d7d('0x39')](_0x24b6a4['model'],_0x24b6a4[_0x5d7d('0x38')]);_0x3acaad[_0x5d7d('0x3a')]=_[_0x5d7d('0x39')](_0x24b6a4[_0x5d7d('0x37')],qs[_0x5d7d('0x3b')](_0x46119c[_0x5d7d('0x38')][_0x5d7d('0x3b')]));_0x3acaad[_0x5d7d('0x3a')]=_0x3acaad['attributes'][_0x5d7d('0x3c')]?_0x3acaad[_0x5d7d('0x3a')]:_0x24b6a4[_0x5d7d('0x37')];if(_0x46119c['query'][_0x5d7d('0x46')]){_0x3acaad[_0x5d7d('0x47')]=[{'all':!![]}];}_0x3acaad=_['merge']({},_0x3acaad,_0x46119c['options']);return db[_0x5d7d('0x34')][_0x5d7d('0x4f')](_0x3acaad)[_0x5d7d('0x2a')](handleEntityNotFound(_0x5aca8e,null))[_0x5d7d('0x2a')](respondWithResult(_0x5aca8e,null))[_0x5d7d('0x4a')](handleError(_0x5aca8e,null));};exports[_0x5d7d('0x50')]=function(_0x206c7d,_0x22db1a){return db[_0x5d7d('0x34')][_0x5d7d('0x50')](_0x206c7d[_0x5d7d('0x51')],{})['then'](function(_0x3a37e9){var _0xb4a7e1=_0x206c7d[_0x5d7d('0x52')][_0x5d7d('0x2c')]({'plain':!![]});if(!_0xb4a7e1)throw new Error(_0x5d7d('0x53'));if(_0xb4a7e1[_0x5d7d('0x54')]==='user'){var _0xe4ad0=_0x3a37e9[_0x5d7d('0x2c')]({'plain':!![]});var _0x681b91=_0x5d7d('0x2d');return db[_0x5d7d('0x55')]['find']({'where':{'name':_0x681b91,'userProfileId':_0xb4a7e1[_0x5d7d('0x56')]},'raw':!![]})[_0x5d7d('0x2a')](function(_0xb11b8c){if(_0xb11b8c&&_0xb11b8c['autoAssociation']===0x0){return db['UserProfileResource'][_0x5d7d('0x50')]({'name':_0xe4ad0[_0x5d7d('0x30')],'resourceId':_0xe4ad0['id'],'type':_0xb11b8c[_0x5d7d('0x30')],'sectionId':_0xb11b8c['id']},{})['then'](function(){return _0x3a37e9;});}else{return _0x3a37e9;}})[_0x5d7d('0x4a')](function(_0x4829d){logger['error'](_0x5d7d('0x57'),_0x4829d);throw _0x4829d;});}return _0x3a37e9;})[_0x5d7d('0x2a')](respondWithResult(_0x22db1a,0xc9))[_0x5d7d('0x4a')](handleError(_0x22db1a,null));};exports[_0x5d7d('0x58')]=function(_0x152a1a,_0xac21f0){if(_0x152a1a['body']['id']){delete _0x152a1a[_0x5d7d('0x51')]['id'];}return db[_0x5d7d('0x34')][_0x5d7d('0x4f')]({'where':{'id':_0x152a1a[_0x5d7d('0x4c')]['id']}})[_0x5d7d('0x2a')](handleEntityNotFound(_0xac21f0,null))[_0x5d7d('0x2a')](saveUpdates(_0x152a1a[_0x5d7d('0x51')],null))['then'](respondWithResult(_0xac21f0,null))[_0x5d7d('0x4a')](handleError(_0xac21f0,null));};exports[_0x5d7d('0x2b')]=function(_0x5be9dd,_0x1aa72a){return db[_0x5d7d('0x34')]['find']({'where':{'id':_0x5be9dd[_0x5d7d('0x4c')]['id']}})[_0x5d7d('0x2a')](handleEntityNotFound(_0x1aa72a,null))['then'](removeEntity(_0x1aa72a,null))[_0x5d7d('0x4a')](handleError(_0x1aa72a,null));};exports[_0x5d7d('0x59')]=function(_0x4e907b,_0x53119a){return db['OpenchannelQueue'][_0x5d7d('0x59')]()['then'](respondWithResult(_0x53119a,null))[_0x5d7d('0x4a')](handleError(_0x53119a,null));};exports['getMembers']=function(_0x5b60e8,_0x19dba4,_0x398576){var _0x51555f={'raw':!![],'where':{}},_0x52d1e4={},_0xbca8ec;return db[_0x5d7d('0x34')][_0x5d7d('0x5a')]({'where':{'id':_0x5b60e8['params']['id']}})['then'](handleEntityNotFound(_0x19dba4,null))[_0x5d7d('0x2a')](function(_0x8f3781){if(_0x8f3781){_0xbca8ec=_0x8f3781[_0x5d7d('0x2c')]({'plain':!![]});_0x52d1e4[_0x5d7d('0x37')]=_[_0x5d7d('0x4d')](db[_0x5d7d('0x5b')][_0x5d7d('0x4e')]);_0x52d1e4[_0x5d7d('0x38')]=_[_0x5d7d('0x4d')](_0x5b60e8[_0x5d7d('0x38')]);_0x52d1e4['filters']=_[_0x5d7d('0x39')](_0x52d1e4['model'],_0x52d1e4[_0x5d7d('0x38')]);_0x51555f[_0x5d7d('0x3a')]=_[_0x5d7d('0x39')](_0x52d1e4[_0x5d7d('0x37')],qs['fields'](_0x5b60e8['query'][_0x5d7d('0x3b')]));_0x51555f[_0x5d7d('0x3a')]=_0x51555f[_0x5d7d('0x3a')][_0x5d7d('0x3c')]?_0x51555f[_0x5d7d('0x3a')]:_0x52d1e4['model'];if(!_0x5b60e8[_0x5d7d('0x38')]['hasOwnProperty']('nolimit')){_0x51555f[_0x5d7d('0x23')]=qs['limit'](_0x5b60e8[_0x5d7d('0x38')][_0x5d7d('0x23')]);_0x51555f[_0x5d7d('0x22')]=qs[_0x5d7d('0x22')](_0x5b60e8[_0x5d7d('0x38')][_0x5d7d('0x22')]);}_0x51555f[_0x5d7d('0x3f')]=qs[_0x5d7d('0x5c')](_0x5b60e8[_0x5d7d('0x38')][_0x5d7d('0x5c')]);_0x51555f['where']=qs['filters'](_[_0x5d7d('0x5d')](_0x5b60e8[_0x5d7d('0x38')],_0x52d1e4[_0x5d7d('0x41')]));_0x51555f[_0x5d7d('0x40')][_0x5d7d('0x5e')]=_0x8f3781['id'];if(_0x5b60e8[_0x5d7d('0x38')][_0x5d7d('0x44')]){_0x51555f[_0x5d7d('0x40')]=_[_0x5d7d('0x42')](_0x51555f['where'],{'$or':_['map'](_0x51555f['attributes'],function(_0x5aa29b){var _0x1c33e3={};_0x1c33e3[_0x5aa29b]={'$like':'%'+_0x5b60e8['query'][_0x5d7d('0x44')]+'%'};return _0x1c33e3;})});}_0x51555f=_[_0x5d7d('0x42')]({},_0x51555f,_0x5b60e8['options']);return db[_0x5d7d('0x5b')]['findAll'](_0x51555f);}})[_0x5d7d('0x2a')](function(_0xf006){if(_0xf006){return db[_0x5d7d('0x5f')][_0x5d7d('0x60')]({'where':{'id':_[_0x5d7d('0x33')](_0xf006,_0x5d7d('0x61')),'role':_0x5d7d('0x62')},'attributes':['id',_0x5d7d('0x30'),_0x5d7d('0x63'),_0x5d7d('0x64'),_0x5d7d('0x65')]});}})[_0x5d7d('0x2a')](function(_0x56f419){if(_0x56f419){return{'count':_0x56f419[_0x5d7d('0x24')],'rows':_[_0x5d7d('0x33')](_0x56f419['rows'],function(_0x64ae3){return{'membername':_0x64ae3['name'],'UserId':_0x64ae3['id'],'queue_name':_0xbca8ec[_0x5d7d('0x30')],'OpenchannelQueueId':_0xbca8ec['id'],'interface':util[_0x5d7d('0x66')](_0x5d7d('0x67'),_0x5d7d('0x68'),_0x64ae3[_0x5d7d('0x30')]),'penalty':0x0,'paused':_0x64ae3['openchannelPause'],'createdAt':_0x64ae3[_0x5d7d('0x65')],'updatedAt':_0x64ae3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5d7d('0x2a')](respondWithFilteredResult(_0x19dba4,_0x51555f))[_0x5d7d('0x4a')](handleError(_0x19dba4,null));};exports[_0x5d7d('0x69')]=function(_0x3d330c,_0x3563e0,_0x2f2936){var _0x3c8e4c={};var _0x4681ca={};var _0x586389;var _0x455845;return db[_0x5d7d('0x34')]['findOne']({'where':{'id':_0x3d330c[_0x5d7d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3563e0,null))[_0x5d7d('0x2a')](function(_0x550cbb){if(_0x550cbb){_0x586389=_0x550cbb;_0x4681ca[_0x5d7d('0x37')]=_[_0x5d7d('0x4d')](db[_0x5d7d('0x6a')]['rawAttributes']);_0x4681ca['query']=_[_0x5d7d('0x4d')](_0x3d330c[_0x5d7d('0x38')]);_0x4681ca['filters']=_[_0x5d7d('0x39')](_0x4681ca[_0x5d7d('0x37')],_0x4681ca[_0x5d7d('0x38')]);_0x3c8e4c[_0x5d7d('0x3a')]=_[_0x5d7d('0x39')](_0x4681ca[_0x5d7d('0x37')],qs[_0x5d7d('0x3b')](_0x3d330c[_0x5d7d('0x38')]['fields']));_0x3c8e4c['attributes']=_0x3c8e4c[_0x5d7d('0x3a')][_0x5d7d('0x3c')]?_0x3c8e4c[_0x5d7d('0x3a')]:_0x4681ca[_0x5d7d('0x37')];_0x3c8e4c[_0x5d7d('0x3f')]=qs['sort'](_0x3d330c[_0x5d7d('0x38')][_0x5d7d('0x5c')]);_0x3c8e4c[_0x5d7d('0x40')]=qs['filters'](_[_0x5d7d('0x5d')](_0x3d330c['query'],_0x4681ca[_0x5d7d('0x41')]));if(_0x3d330c[_0x5d7d('0x38')][_0x5d7d('0x44')]){_0x3c8e4c['where']=_[_0x5d7d('0x42')](_0x3c8e4c['where'],{'$or':_['map'](_0x3c8e4c[_0x5d7d('0x3a')],function(_0x1b8061){var _0x1ccb72={};_0x1ccb72[_0x1b8061]={'$like':'%'+_0x3d330c['query'][_0x5d7d('0x44')]+'%'};return _0x1ccb72;})});}_0x3c8e4c=_[_0x5d7d('0x42')]({},_0x3c8e4c,_0x3d330c[_0x5d7d('0x45')]);return _0x586389[_0x5d7d('0x69')](_0x3c8e4c);}})['then'](function(_0x2a404e){if(_0x2a404e){_0x455845=_0x2a404e[_0x5d7d('0x3c')];if(!_0x3d330c[_0x5d7d('0x38')][_0x5d7d('0x3d')](_0x5d7d('0x3e'))){_0x3c8e4c['limit']=qs[_0x5d7d('0x23')](_0x3d330c['query']['limit']);_0x3c8e4c['offset']=qs[_0x5d7d('0x22')](_0x3d330c[_0x5d7d('0x38')]['offset']);}return _0x586389[_0x5d7d('0x69')](_0x3c8e4c);}})['then'](function(_0x3fd906){if(_0x3fd906){return _0x3fd906?{'count':_0x455845,'rows':_0x3fd906}:null;}})[_0x5d7d('0x2a')](respondWithResult(_0x3563e0,null))['catch'](handleError(_0x3563e0,null));};exports['addTeams']=function(_0x4856b0,_0x16e8e4,_0x41744c){var _0x2cd61e=_0x4856b0['body'][_0x5d7d('0x6b')];return db['Team'][_0x5d7d('0x48')]({'where':{'id':_0x2cd61e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5d7d('0x6c'),'attributes':['id',_0x5d7d('0x30'),'online',_0x5d7d('0x6d'),_0x5d7d('0x6e')],'raw':!![]}]})['then'](function(_0x21ad5a){if(_0x21ad5a){var _0x3a2b72=_[_0x5d7d('0x6f')](_0x21ad5a,function(_0x42cb00){var _0x3196f2=_0x42cb00[_0x5d7d('0x2c')]({'plain':!![]});return _0x3196f2[_0x5d7d('0x6c')];});return db[_0x5d7d('0x34')][_0x5d7d('0x4f')]({'where':{'id':_0x4856b0[_0x5d7d('0x4c')]['id']}})['then'](function(_0x1dcb1e){return db[_0x5d7d('0x70')][_0x5d7d('0x71')](function(_0x2185f3){return _0x1dcb1e[_0x5d7d('0x72')](_0x2cd61e,{'transaction':_0x2185f3})[_0x5d7d('0x2a')](function(){return BPromise[_0x5d7d('0x73')](_0x3a2b72,function(_0x4859dd){return db[_0x5d7d('0x5b')][_0x5d7d('0x74')]({'where':{'UserId':_0x4859dd['id'],'OpenchannelQueueId':_0x4856b0[_0x5d7d('0x4c')]['id']},'transaction':_0x2185f3});});})[_0x5d7d('0x2a')](function(){_0x3a2b72['forEach'](function(_0x4757de){socket[_0x5d7d('0x75')]('userOpenchannelQueue:save',{'UserId':_0x4757de['id'],'OpenchannelQueueId':_0x1dcb1e['id']});});});});});}})['then'](respondWithStatusCode(_0x16e8e4,null))[_0x5d7d('0x4a')](handleError(_0x16e8e4,null));};exports[_0x5d7d('0x76')]=function(_0x1aaf2a,_0x4bc89f,_0x2ee3a1){return db['Team']['findAll']({'where':{'id':_0x1aaf2a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x5d7d('0x5f')],'as':_0x5d7d('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x5d7d('0x2a')](handleEntityNotFound(_0x4bc89f,null))['then'](function(_0x480559){var _0xbe0761=_['map'](_0x480559,'id');var _0x413ce2=[];var _0x565a94=[];var _0xcb9907=squel[_0x5d7d('0x77')]();_0xcb9907[_0x5d7d('0x78')](_0x5d7d('0x79'))[_0x5d7d('0x7a')](_0x5d7d('0x7b'),'tq')[_0x5d7d('0x7c')]('user_has_teams','ut',_0x5d7d('0x7d'))[_0x5d7d('0x40')](_0x5d7d('0x7e'),_0x1aaf2a['params']['id']);for(var _0x277773=0x0;_0x277773<_0x480559[_0x5d7d('0x3c')];_0x277773+=0x1){let _0x360329=_0x480559[_0x277773];for(var _0x131dc6=0x0;_0x131dc6<_0x360329[_0x5d7d('0x6c')][_0x5d7d('0x3c')];_0x131dc6+=0x1){let _0x415c05=_0x360329[_0x5d7d('0x6c')][_0x131dc6];var _0x5dde50=_0xcb9907[_0x5d7d('0x7f')]();_0x5dde50['where']('ut.UserId\x20=\x20?',_0x415c05['id']);_0x565a94[_0x5d7d('0x80')](db['sequelize']['query'](_0x5dde50['toString'](),{'type':db['sequelize'][_0x5d7d('0x81')][_0x5d7d('0x82')]})['then'](function(_0x99d466){if(_0x99d466['length']===0x1){return _0x415c05['id'];}else{var _0x1b6cf2=_['every'](_[_0x5d7d('0x33')](_0x99d466,_0x5d7d('0x83')),function(_0x557553){return _[_0x5d7d('0x84')](_0xbe0761,_0x557553);});if(_0x1b6cf2){return _0x415c05['id'];}}}));}}return BPromise['all'](_0x565a94)[_0x5d7d('0x2a')](function(_0x145f8d){_0x413ce2=_(_0x413ce2)[_0x5d7d('0x85')](_0x145f8d)[_0x5d7d('0x86')]()[_0x5d7d('0x87')]();return db[_0x5d7d('0x34')][_0x5d7d('0x4f')]({'where':{'id':_0x1aaf2a[_0x5d7d('0x4c')]['id']}})[_0x5d7d('0x2a')](function(_0x3e7cc0){return db[_0x5d7d('0x70')][_0x5d7d('0x71')](function(_0x46bf0d){return _0x3e7cc0['removeTeams'](_0x1aaf2a[_0x5d7d('0x38')][_0x5d7d('0x6b')],{'transaction':_0x46bf0d})[_0x5d7d('0x2a')](function(){if(!_[_0x5d7d('0x88')](_0x413ce2)){return _0x3e7cc0[_0x5d7d('0x89')](_0x413ce2,{'transaction':_0x46bf0d});}})[_0x5d7d('0x2a')](function(){_0x413ce2[_0x5d7d('0x8a')](function(_0x202b36){socket[_0x5d7d('0x75')]('userOpenchannelQueue:remove',{'UserId':_0x202b36,'OpenchannelQueueId':_0x3e7cc0['id']});});});});});});})[_0x5d7d('0x2a')](respondWithStatusCode(_0x4bc89f,null))['catch'](handleError(_0x4bc89f,null));};exports[_0x5d7d('0x8b')]=function(_0x240d78,_0x4b334a,_0xac6e3b){return db[_0x5d7d('0x34')][_0x5d7d('0x4f')]({'where':{'id':_0x240d78[_0x5d7d('0x4c')]['id']}})[_0x5d7d('0x2a')](handleEntityNotFound(_0x4b334a,null))[_0x5d7d('0x2a')](function(_0x840d54){if(_0x840d54){return _0x840d54[_0x5d7d('0x8b')](_0x240d78[_0x5d7d('0x51')][_0x5d7d('0x6b')],_[_0x5d7d('0x8c')](_0x240d78['body'],['ids','id'])||{})[_0x5d7d('0x8d')](function(_0x3e6fe8){for(var _0x176c28=0x0;_0x176c28<_0x240d78[_0x5d7d('0x51')]['ids'][_0x5d7d('0x3c')];_0x176c28+=0x1){socket[_0x5d7d('0x75')]('userOpenchannelQueue:save',{'UserId':Number(_0x240d78[_0x5d7d('0x51')][_0x5d7d('0x6b')][_0x176c28]),'OpenchannelQueueId':Number(_0x240d78['params']['id'])});}return _0x3e6fe8;});}})['then'](respondWithResult(_0x4b334a,null))[_0x5d7d('0x4a')](handleError(_0x4b334a,null));};exports[_0x5d7d('0x89')]=function(_0x194398,_0x1f04ad,_0x5ca153){return db[_0x5d7d('0x34')][_0x5d7d('0x4f')]({'where':{'id':_0x194398[_0x5d7d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1f04ad,null))[_0x5d7d('0x2a')](function(_0x2a9f35){if(_0x2a9f35){return _0x2a9f35[_0x5d7d('0x89')](_0x194398[_0x5d7d('0x38')][_0x5d7d('0x6b')])[_0x5d7d('0x2a')](function(){if(_[_0x5d7d('0x8e')](_0x194398[_0x5d7d('0x38')][_0x5d7d('0x6b')])){for(var _0x4a7dfe=0x0;_0x4a7dfe<_0x194398[_0x5d7d('0x38')][_0x5d7d('0x6b')][_0x5d7d('0x3c')];_0x4a7dfe+=0x1){socket['emit'](_0x5d7d('0x8f'),{'UserId':Number(_0x194398[_0x5d7d('0x38')]['ids'][_0x4a7dfe]),'OpenchannelQueueId':Number(_0x194398['params']['id'])});}}else{socket[_0x5d7d('0x75')](_0x5d7d('0x8f'),{'UserId':Number(_0x194398['query'][_0x5d7d('0x6b')]),'OpenchannelQueueId':Number(_0x194398[_0x5d7d('0x4c')]['id'])});}});}})[_0x5d7d('0x2a')](respondWithStatusCode(_0x1f04ad,null))[_0x5d7d('0x4a')](handleError(_0x1f04ad,null));};exports['getAgents']=function(_0x5bb804,_0x41ee07,_0x156fe4){var _0x37d64b={};var _0x3fd73f={};var _0x38acc1;var _0x331cd2;return db[_0x5d7d('0x34')]['findOne']({'where':{'id':_0x5bb804['params']['id']}})['then'](handleEntityNotFound(_0x41ee07,null))['then'](function(_0x339217){if(_0x339217){_0x38acc1=_0x339217;_0x3fd73f['model']=_[_0x5d7d('0x4d')](db[_0x5d7d('0x5f')][_0x5d7d('0x4e')]);_0x3fd73f[_0x5d7d('0x38')]=_['keys'](_0x5bb804['query']);_0x3fd73f[_0x5d7d('0x41')]=_['intersection'](_0x3fd73f['model'],_0x3fd73f[_0x5d7d('0x38')]);_0x37d64b[_0x5d7d('0x3a')]=_[_0x5d7d('0x39')](_0x3fd73f[_0x5d7d('0x37')],qs[_0x5d7d('0x3b')](_0x5bb804['query'][_0x5d7d('0x3b')]));_0x37d64b[_0x5d7d('0x3a')]=_0x37d64b[_0x5d7d('0x3a')]['length']?_0x37d64b[_0x5d7d('0x3a')]:_0x3fd73f[_0x5d7d('0x37')];_0x37d64b[_0x5d7d('0x3f')]=qs[_0x5d7d('0x5c')](_0x5bb804['query'][_0x5d7d('0x5c')]);_0x37d64b[_0x5d7d('0x40')]=qs[_0x5d7d('0x41')](_[_0x5d7d('0x5d')](_0x5bb804[_0x5d7d('0x38')],_0x3fd73f[_0x5d7d('0x41')]));if(_0x5bb804[_0x5d7d('0x38')][_0x5d7d('0x44')]){_0x37d64b[_0x5d7d('0x40')]=_['merge'](_0x37d64b[_0x5d7d('0x40')],{'$or':_['map'](_0x37d64b[_0x5d7d('0x3a')],function(_0x43e6b9){var _0x4fd074={};_0x4fd074[_0x43e6b9]={'$like':'%'+_0x5bb804['query']['filter']+'%'};return _0x4fd074;})});}_0x37d64b=_[_0x5d7d('0x42')]({},_0x37d64b,_0x5bb804[_0x5d7d('0x45')]);return _0x38acc1[_0x5d7d('0x90')](_0x37d64b);}})[_0x5d7d('0x2a')](function(_0x27b4ec){if(_0x27b4ec){_0x331cd2=_0x27b4ec[_0x5d7d('0x3c')];if(!_0x5bb804[_0x5d7d('0x38')][_0x5d7d('0x3d')](_0x5d7d('0x3e'))){_0x37d64b[_0x5d7d('0x23')]=qs[_0x5d7d('0x23')](_0x5bb804[_0x5d7d('0x38')][_0x5d7d('0x23')]);_0x37d64b[_0x5d7d('0x22')]=qs[_0x5d7d('0x22')](_0x5bb804[_0x5d7d('0x38')][_0x5d7d('0x22')]);}return _0x38acc1['getAgents'](_0x37d64b);}})['then'](function(_0x42fb6b){if(_0x42fb6b){return _0x42fb6b?{'count':_0x331cd2,'rows':_0x42fb6b}:null;}})[_0x5d7d('0x2a')](respondWithResult(_0x41ee07,null))[_0x5d7d('0x4a')](handleError(_0x41ee07,null));}; \ No newline at end of file +var _0x20b1=['merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','get','UserProfileResource','destroy','then','end','stack','name','send','index','map','OpenchannelQueue','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x284240,_0x555b56){var _0x390667=function(_0x409454){while(--_0x409454){_0x284240['push'](_0x284240['shift']());}};_0x390667(++_0x555b56);}(_0x20b1,0x153));var _0x120b=function(_0x3220dd,_0x23f637){_0x3220dd=_0x3220dd-0x0;var _0x16526c=_0x20b1[_0x3220dd];return _0x16526c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x120b('0x0'));var jsonpatch=require(_0x120b('0x1'));var rp=require(_0x120b('0x2'));var moment=require(_0x120b('0x3'));var BPromise=require(_0x120b('0x4'));var Mustache=require(_0x120b('0x5'));var util=require(_0x120b('0x6'));var path=require(_0x120b('0x7'));var sox=require(_0x120b('0x8'));var csv=require(_0x120b('0x9'));var ejs=require(_0x120b('0xa'));var fs=require('fs');var fs_extra=require(_0x120b('0xb'));var _=require(_0x120b('0xc'));var squel=require(_0x120b('0xd'));var crypto=require(_0x120b('0xe'));var jsforce=require(_0x120b('0xf'));var deskjs=require(_0x120b('0x10'));var toCsv=require(_0x120b('0x9'));var querystring=require(_0x120b('0x11'));var Papa=require(_0x120b('0x12'));var Redis=require(_0x120b('0x13'));var authService=require(_0x120b('0x14'));var qs=require(_0x120b('0x15'));var as=require(_0x120b('0x16'));var hardwareService=require(_0x120b('0x17'));var logger=require(_0x120b('0x18'))(_0x120b('0x19'));var utils=require(_0x120b('0x1a'));var config=require(_0x120b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x120b('0x1c')]=_[_0x120b('0x1d')](config[_0x120b('0x1c')],{'host':_0x120b('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x120b('0x1c')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4b89fe,_0x5704c3){_0x5704c3=_0x5704c3||0xcc;return function(_0x5c3441){if(_0x5c3441){return _0x4b89fe[_0x120b('0x1f')](_0x5704c3);}return _0x4b89fe[_0x120b('0x20')](_0x5704c3)['end']();};}function respondWithResult(_0x395d0f,_0x3b6b12){_0x3b6b12=_0x3b6b12||0xc8;return function(_0x798717){if(_0x798717){return _0x395d0f[_0x120b('0x20')](_0x3b6b12)[_0x120b('0x21')](_0x798717);}};}function respondWithFilteredResult(_0x4f744b,_0x2103f6){return function(_0x270592){if(_0x270592){var _0x1dff24=typeof _0x2103f6['offset']==='undefined'&&typeof _0x2103f6[_0x120b('0x22')]===_0x120b('0x23');var _0x1ea84c=_0x270592[_0x120b('0x24')];var _0xfc389a=_0x1dff24?0x0:_0x2103f6[_0x120b('0x25')];var _0x11824c=_0x1dff24?_0x270592[_0x120b('0x24')]:_0x2103f6[_0x120b('0x25')]+_0x2103f6[_0x120b('0x22')];var _0xcdbd06;if(_0x11824c>=_0x1ea84c){_0x11824c=_0x1ea84c;_0xcdbd06=0xc8;}else{_0xcdbd06=0xce;}_0x4f744b[_0x120b('0x20')](_0xcdbd06);return _0x4f744b[_0x120b('0x26')]('Content-Range',_0xfc389a+'-'+_0x11824c+'/'+_0x1ea84c)['json'](_0x270592);}return null;};}function patchUpdates(_0x2ad370){return function(_0x3e4ac6){try{jsonpatch[_0x120b('0x27')](_0x3e4ac6,_0x2ad370,!![]);}catch(_0x2d855c){return BPromise[_0x120b('0x28')](_0x2d855c);}return _0x3e4ac6[_0x120b('0x29')]();};}function saveUpdates(_0x268ce1,_0x3953e1){return function(_0x90909f){if(_0x90909f){return _0x90909f['update'](_0x268ce1)['then'](function(_0x3d9e20){return _0x3d9e20;});}return null;};}function removeEntity(_0x9b301b,_0x22da80){return function(_0xc25375){if(_0xc25375){return _0xc25375['destroy']()['then'](function(){var _0x334af1=_0xc25375[_0x120b('0x2a')]({'plain':!![]});var _0x58293e='OpenchannelQueues';return db[_0x120b('0x2b')][_0x120b('0x2c')]({'where':{'type':_0x58293e,'resourceId':_0x334af1['id']}})[_0x120b('0x2d')](function(){return _0xc25375;});})[_0x120b('0x2d')](function(){_0x9b301b['status'](0xcc)[_0x120b('0x2e')]();});}};}function handleEntityNotFound(_0x234226,_0x3312db){return function(_0x1c6c3e){if(!_0x1c6c3e){_0x234226[_0x120b('0x1f')](0x194);}return _0x1c6c3e;};}function handleError(_0xaf3e04,_0x53e510){_0x53e510=_0x53e510||0x1f4;return function(_0x2c78d1){logger['error'](_0x2c78d1[_0x120b('0x2f')]);if(_0x2c78d1[_0x120b('0x30')]){delete _0x2c78d1[_0x120b('0x30')];}_0xaf3e04[_0x120b('0x20')](_0x53e510)[_0x120b('0x31')](_0x2c78d1);};}exports[_0x120b('0x32')]=function(_0x5cb701,_0x4fdf89){var _0x39046a={},_0x572772={},_0x591e08={'count':0x0,'rows':[]};var _0x4d3dce=_[_0x120b('0x33')](db[_0x120b('0x34')]['rawAttributes'],function(_0x22bb58){return{'name':_0x22bb58['fieldName'],'type':_0x22bb58[_0x120b('0x35')]['key']};});_0x572772[_0x120b('0x36')]=_[_0x120b('0x33')](_0x4d3dce,'name');_0x572772['query']=_[_0x120b('0x37')](_0x5cb701[_0x120b('0x38')]);_0x572772[_0x120b('0x39')]=_[_0x120b('0x3a')](_0x572772[_0x120b('0x36')],_0x572772[_0x120b('0x38')]);_0x39046a['attributes']=_[_0x120b('0x3a')](_0x572772['model'],qs[_0x120b('0x3b')](_0x5cb701[_0x120b('0x38')][_0x120b('0x3b')]));_0x39046a[_0x120b('0x3c')]=_0x39046a[_0x120b('0x3c')][_0x120b('0x3d')]?_0x39046a[_0x120b('0x3c')]:_0x572772['model'];if(!_0x5cb701[_0x120b('0x38')][_0x120b('0x3e')](_0x120b('0x3f'))){_0x39046a[_0x120b('0x22')]=qs[_0x120b('0x22')](_0x5cb701[_0x120b('0x38')][_0x120b('0x22')]);_0x39046a['offset']=qs[_0x120b('0x25')](_0x5cb701[_0x120b('0x38')]['offset']);}_0x39046a[_0x120b('0x40')]=qs[_0x120b('0x41')](_0x5cb701['query'][_0x120b('0x41')]);_0x39046a[_0x120b('0x42')]=qs['filters'](_[_0x120b('0x43')](_0x5cb701[_0x120b('0x38')],_0x572772[_0x120b('0x39')]),_0x4d3dce);if(_0x5cb701[_0x120b('0x38')][_0x120b('0x44')]){_0x39046a[_0x120b('0x42')]=_[_0x120b('0x45')](_0x39046a['where'],{'$or':_[_0x120b('0x33')](_0x4d3dce,function(_0x2d9440){if(_0x2d9440[_0x120b('0x35')]!==_0x120b('0x46')){var _0x5547c6={};_0x5547c6[_0x2d9440['name']]={'$like':'%'+_0x5cb701['query']['filter']+'%'};return _0x5547c6;}})});}_0x39046a=_['merge']({},_0x39046a,_0x5cb701[_0x120b('0x47')]);var _0x688c3d={'where':_0x39046a[_0x120b('0x42')]};return db['OpenchannelQueue']['count'](_0x688c3d)[_0x120b('0x2d')](function(_0x186bea){_0x591e08['count']=_0x186bea;if(_0x5cb701[_0x120b('0x38')][_0x120b('0x48')]){_0x39046a['include']=[{'all':!![]}];}return db[_0x120b('0x34')][_0x120b('0x49')](_0x39046a);})[_0x120b('0x2d')](function(_0x18d594){_0x591e08[_0x120b('0x4a')]=_0x18d594;return _0x591e08;})[_0x120b('0x2d')](respondWithFilteredResult(_0x4fdf89,_0x39046a))[_0x120b('0x4b')](handleError(_0x4fdf89,null));};exports['show']=function(_0x361366,_0x196ba9){var _0x3d9fa1={'raw':!![],'where':{'id':_0x361366[_0x120b('0x4c')]['id']}},_0x5501fb={};_0x5501fb['model']=_[_0x120b('0x37')](db[_0x120b('0x34')][_0x120b('0x4d')]);_0x5501fb[_0x120b('0x38')]=_['keys'](_0x361366[_0x120b('0x38')]);_0x5501fb[_0x120b('0x39')]=_['intersection'](_0x5501fb['model'],_0x5501fb[_0x120b('0x38')]);_0x3d9fa1['attributes']=_[_0x120b('0x3a')](_0x5501fb['model'],qs[_0x120b('0x3b')](_0x361366[_0x120b('0x38')]['fields']));_0x3d9fa1[_0x120b('0x3c')]=_0x3d9fa1[_0x120b('0x3c')]['length']?_0x3d9fa1[_0x120b('0x3c')]:_0x5501fb['model'];if(_0x361366[_0x120b('0x38')][_0x120b('0x48')]){_0x3d9fa1[_0x120b('0x4e')]=[{'all':!![]}];}_0x3d9fa1=_[_0x120b('0x45')]({},_0x3d9fa1,_0x361366[_0x120b('0x47')]);return db[_0x120b('0x34')][_0x120b('0x4f')](_0x3d9fa1)[_0x120b('0x2d')](handleEntityNotFound(_0x196ba9,null))[_0x120b('0x2d')](respondWithResult(_0x196ba9,null))[_0x120b('0x4b')](handleError(_0x196ba9,null));};exports['create']=function(_0x1637ba,_0x136a3d){return db['OpenchannelQueue'][_0x120b('0x50')](_0x1637ba[_0x120b('0x51')],{})[_0x120b('0x2d')](function(_0x2a67df){var _0x2e161f=_0x1637ba[_0x120b('0x52')][_0x120b('0x2a')]({'plain':!![]});if(!_0x2e161f)throw new Error(_0x120b('0x53'));if(_0x2e161f['role']===_0x120b('0x52')){var _0x199ef2=_0x2a67df['get']({'plain':!![]});var _0x1f2595='OpenchannelQueues';return db[_0x120b('0x54')]['find']({'where':{'name':_0x1f2595,'userProfileId':_0x2e161f[_0x120b('0x55')]},'raw':!![]})['then'](function(_0x20d6da){if(_0x20d6da&&_0x20d6da[_0x120b('0x56')]===0x0){return db[_0x120b('0x2b')][_0x120b('0x50')]({'name':_0x199ef2[_0x120b('0x30')],'resourceId':_0x199ef2['id'],'type':_0x20d6da[_0x120b('0x30')],'sectionId':_0x20d6da['id']},{})[_0x120b('0x2d')](function(){return _0x2a67df;});}else{return _0x2a67df;}})['catch'](function(_0xe0139d){logger['error'](_0x120b('0x57'),_0xe0139d);throw _0xe0139d;});}return _0x2a67df;})[_0x120b('0x2d')](respondWithResult(_0x136a3d,0xc9))['catch'](handleError(_0x136a3d,null));};exports['update']=function(_0x3c615b,_0x587faf){if(_0x3c615b[_0x120b('0x51')]['id']){delete _0x3c615b[_0x120b('0x51')]['id'];}return db[_0x120b('0x34')][_0x120b('0x4f')]({'where':{'id':_0x3c615b['params']['id']}})[_0x120b('0x2d')](handleEntityNotFound(_0x587faf,null))['then'](saveUpdates(_0x3c615b[_0x120b('0x51')],null))[_0x120b('0x2d')](respondWithResult(_0x587faf,null))[_0x120b('0x4b')](handleError(_0x587faf,null));};exports[_0x120b('0x2c')]=function(_0x1cb3a3,_0x182929){return db['OpenchannelQueue'][_0x120b('0x4f')]({'where':{'id':_0x1cb3a3[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](handleEntityNotFound(_0x182929,null))[_0x120b('0x2d')](removeEntity(_0x182929,null))[_0x120b('0x4b')](handleError(_0x182929,null));};exports[_0x120b('0x58')]=function(_0x23401e,_0x4d2678){return db[_0x120b('0x34')][_0x120b('0x58')]()['then'](respondWithResult(_0x4d2678,null))[_0x120b('0x4b')](handleError(_0x4d2678,null));};exports['getMembers']=function(_0x2f5fc9,_0x4c5ac2,_0xf9b927){var _0x130a4d={'raw':!![],'where':{}},_0x98b182={},_0x44af3f;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x2f5fc9[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](handleEntityNotFound(_0x4c5ac2,null))[_0x120b('0x2d')](function(_0x3af023){if(_0x3af023){_0x44af3f=_0x3af023[_0x120b('0x2a')]({'plain':!![]});_0x98b182['model']=_[_0x120b('0x37')](db['UserOpenchannelQueue']['rawAttributes']);_0x98b182[_0x120b('0x38')]=_[_0x120b('0x37')](_0x2f5fc9[_0x120b('0x38')]);_0x98b182[_0x120b('0x39')]=_[_0x120b('0x3a')](_0x98b182['model'],_0x98b182['query']);_0x130a4d[_0x120b('0x3c')]=_[_0x120b('0x3a')](_0x98b182[_0x120b('0x36')],qs[_0x120b('0x3b')](_0x2f5fc9[_0x120b('0x38')][_0x120b('0x3b')]));_0x130a4d[_0x120b('0x3c')]=_0x130a4d[_0x120b('0x3c')][_0x120b('0x3d')]?_0x130a4d[_0x120b('0x3c')]:_0x98b182[_0x120b('0x36')];if(!_0x2f5fc9['query'][_0x120b('0x3e')](_0x120b('0x3f'))){_0x130a4d['limit']=qs['limit'](_0x2f5fc9[_0x120b('0x38')]['limit']);_0x130a4d['offset']=qs[_0x120b('0x25')](_0x2f5fc9['query'][_0x120b('0x25')]);}_0x130a4d[_0x120b('0x40')]=qs[_0x120b('0x41')](_0x2f5fc9[_0x120b('0x38')][_0x120b('0x41')]);_0x130a4d[_0x120b('0x42')]=qs[_0x120b('0x39')](_[_0x120b('0x43')](_0x2f5fc9[_0x120b('0x38')],_0x98b182[_0x120b('0x39')]));_0x130a4d['where']['OpenchannelQueueId']=_0x3af023['id'];if(_0x2f5fc9[_0x120b('0x38')]['filter']){_0x130a4d[_0x120b('0x42')]=_[_0x120b('0x45')](_0x130a4d[_0x120b('0x42')],{'$or':_[_0x120b('0x33')](_0x130a4d[_0x120b('0x3c')],function(_0x58335){var _0xf8828={};_0xf8828[_0x58335]={'$like':'%'+_0x2f5fc9[_0x120b('0x38')][_0x120b('0x44')]+'%'};return _0xf8828;})});}_0x130a4d=_[_0x120b('0x45')]({},_0x130a4d,_0x2f5fc9[_0x120b('0x47')]);return db[_0x120b('0x59')][_0x120b('0x49')](_0x130a4d);}})[_0x120b('0x2d')](function(_0x147337){if(_0x147337){return db[_0x120b('0x5a')][_0x120b('0x5b')]({'where':{'id':_[_0x120b('0x33')](_0x147337,_0x120b('0x5c')),'role':_0x120b('0x5d')},'attributes':['id',_0x120b('0x30'),_0x120b('0x5e'),_0x120b('0x5f'),_0x120b('0x60')]});}})[_0x120b('0x2d')](function(_0x3e1126){if(_0x3e1126){return{'count':_0x3e1126[_0x120b('0x24')],'rows':_[_0x120b('0x33')](_0x3e1126['rows'],function(_0x4a7f67){return{'membername':_0x4a7f67[_0x120b('0x30')],'UserId':_0x4a7f67['id'],'queue_name':_0x44af3f[_0x120b('0x30')],'OpenchannelQueueId':_0x44af3f['id'],'interface':util['format'](_0x120b('0x61'),_0x120b('0x62'),_0x4a7f67[_0x120b('0x30')]),'penalty':0x0,'paused':_0x4a7f67[_0x120b('0x5e')],'createdAt':_0x4a7f67['createdAt'],'updatedAt':_0x4a7f67[_0x120b('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x120b('0x2d')](respondWithFilteredResult(_0x4c5ac2,_0x130a4d))['catch'](handleError(_0x4c5ac2,null));};exports[_0x120b('0x63')]=function(_0x4352ee,_0x29b2aa,_0x529859){var _0x5b5d38={};var _0x2fb59c={};var _0x7582b8;var _0x2e1595;return db[_0x120b('0x34')][_0x120b('0x64')]({'where':{'id':_0x4352ee[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](handleEntityNotFound(_0x29b2aa,null))['then'](function(_0x3ee50b){if(_0x3ee50b){_0x7582b8=_0x3ee50b;_0x2fb59c[_0x120b('0x36')]=_[_0x120b('0x37')](db[_0x120b('0x65')]['rawAttributes']);_0x2fb59c['query']=_[_0x120b('0x37')](_0x4352ee[_0x120b('0x38')]);_0x2fb59c[_0x120b('0x39')]=_[_0x120b('0x3a')](_0x2fb59c[_0x120b('0x36')],_0x2fb59c[_0x120b('0x38')]);_0x5b5d38['attributes']=_['intersection'](_0x2fb59c['model'],qs['fields'](_0x4352ee[_0x120b('0x38')][_0x120b('0x3b')]));_0x5b5d38[_0x120b('0x3c')]=_0x5b5d38[_0x120b('0x3c')][_0x120b('0x3d')]?_0x5b5d38[_0x120b('0x3c')]:_0x2fb59c['model'];_0x5b5d38[_0x120b('0x40')]=qs[_0x120b('0x41')](_0x4352ee[_0x120b('0x38')][_0x120b('0x41')]);_0x5b5d38[_0x120b('0x42')]=qs[_0x120b('0x39')](_['pick'](_0x4352ee[_0x120b('0x38')],_0x2fb59c['filters']));if(_0x4352ee['query'][_0x120b('0x44')]){_0x5b5d38[_0x120b('0x42')]=_[_0x120b('0x45')](_0x5b5d38['where'],{'$or':_[_0x120b('0x33')](_0x5b5d38['attributes'],function(_0x4c7c2d){var _0x1b5eb1={};_0x1b5eb1[_0x4c7c2d]={'$like':'%'+_0x4352ee[_0x120b('0x38')][_0x120b('0x44')]+'%'};return _0x1b5eb1;})});}_0x5b5d38=_['merge']({},_0x5b5d38,_0x4352ee['options']);return _0x7582b8['getTeams'](_0x5b5d38);}})['then'](function(_0x1019cb){if(_0x1019cb){_0x2e1595=_0x1019cb['length'];if(!_0x4352ee[_0x120b('0x38')][_0x120b('0x3e')]('nolimit')){_0x5b5d38[_0x120b('0x22')]=qs[_0x120b('0x22')](_0x4352ee[_0x120b('0x38')][_0x120b('0x22')]);_0x5b5d38['offset']=qs['offset'](_0x4352ee['query'][_0x120b('0x25')]);}return _0x7582b8[_0x120b('0x63')](_0x5b5d38);}})[_0x120b('0x2d')](function(_0x16dc89){if(_0x16dc89){return _0x16dc89?{'count':_0x2e1595,'rows':_0x16dc89}:null;}})['then'](respondWithResult(_0x29b2aa,null))['catch'](handleError(_0x29b2aa,null));};exports[_0x120b('0x66')]=function(_0x12a426,_0x48db7b,_0x78b936){var _0x4b6850=_0x12a426['body'][_0x120b('0x67')];return db[_0x120b('0x65')][_0x120b('0x49')]({'where':{'id':_0x4b6850},'attributes':['id'],'include':[{'model':db['User'],'as':_0x120b('0x68'),'attributes':['id',_0x120b('0x30'),'online',_0x120b('0x69'),'interface'],'raw':!![]}]})[_0x120b('0x2d')](function(_0x102c36){if(_0x102c36){var _0x9d585c=_[_0x120b('0x6a')](_0x102c36,function(_0x558a59){var _0x38ed40=_0x558a59['get']({'plain':!![]});return _0x38ed40['Agents'];});return db['OpenchannelQueue'][_0x120b('0x4f')]({'where':{'id':_0x12a426[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](function(_0x46b592){return db[_0x120b('0x6b')][_0x120b('0x6c')](function(_0x430f94){return _0x46b592['addTeams'](_0x4b6850,{'transaction':_0x430f94})[_0x120b('0x2d')](function(){return BPromise[_0x120b('0x6d')](_0x9d585c,function(_0x25b4f0){return db[_0x120b('0x59')]['findOrCreate']({'where':{'UserId':_0x25b4f0['id'],'OpenchannelQueueId':_0x12a426[_0x120b('0x4c')]['id']},'transaction':_0x430f94});});})[_0x120b('0x2d')](function(){_0x9d585c['forEach'](function(_0x3bfaa5){socket[_0x120b('0x6e')](_0x120b('0x6f'),{'UserId':_0x3bfaa5['id'],'OpenchannelQueueId':_0x46b592['id']});});});});});}})[_0x120b('0x2d')](respondWithStatusCode(_0x48db7b,null))[_0x120b('0x4b')](handleError(_0x48db7b,null));};exports[_0x120b('0x70')]=function(_0x2794e3,_0x42d4ca,_0x2e9f3c){return db[_0x120b('0x65')][_0x120b('0x49')]({'where':{'id':_0x2794e3[_0x120b('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x120b('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x42d4ca,null))['then'](function(_0x3e8358){var _0x4a035b=_[_0x120b('0x33')](_0x3e8358,'id');var _0x53a72c=[];var _0x56cf0c=[];var _0x590711=squel[_0x120b('0x71')]();_0x590711[_0x120b('0x72')](_0x120b('0x73'))[_0x120b('0x74')]('team_has_openchannel_queues','tq')['join'](_0x120b('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x120b('0x42')](_0x120b('0x76'),_0x2794e3[_0x120b('0x4c')]['id']);for(var _0x422812=0x0;_0x422812<_0x3e8358[_0x120b('0x3d')];_0x422812+=0x1){let _0x49d109=_0x3e8358[_0x422812];for(var _0x8f684c=0x0;_0x8f684c<_0x49d109[_0x120b('0x68')][_0x120b('0x3d')];_0x8f684c+=0x1){let _0x510bf7=_0x49d109[_0x120b('0x68')][_0x8f684c];var _0x378c33=_0x590711['clone']();_0x378c33[_0x120b('0x42')](_0x120b('0x77'),_0x510bf7['id']);_0x56cf0c['push'](db[_0x120b('0x6b')][_0x120b('0x38')](_0x378c33[_0x120b('0x78')](),{'type':db[_0x120b('0x6b')][_0x120b('0x79')][_0x120b('0x7a')]})['then'](function(_0x57db36){if(_0x57db36['length']===0x1){return _0x510bf7['id'];}else{var _0x3e1ac0=_['every'](_['map'](_0x57db36,_0x120b('0x7b')),function(_0x57ae1e){return _[_0x120b('0x7c')](_0x4a035b,_0x57ae1e);});if(_0x3e1ac0){return _0x510bf7['id'];}}}));}}return BPromise[_0x120b('0x7d')](_0x56cf0c)[_0x120b('0x2d')](function(_0x2286a1){_0x53a72c=_(_0x53a72c)[_0x120b('0x7e')](_0x2286a1)[_0x120b('0x7f')]()[_0x120b('0x80')]();return db[_0x120b('0x34')][_0x120b('0x4f')]({'where':{'id':_0x2794e3[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](function(_0x24a590){return db[_0x120b('0x6b')][_0x120b('0x6c')](function(_0x2cf95c){return _0x24a590[_0x120b('0x70')](_0x2794e3[_0x120b('0x38')]['ids'],{'transaction':_0x2cf95c})[_0x120b('0x2d')](function(){if(!_['isEmpty'](_0x53a72c)){return _0x24a590[_0x120b('0x81')](_0x53a72c,{'transaction':_0x2cf95c});}})[_0x120b('0x2d')](function(){_0x53a72c['forEach'](function(_0x4473c5){socket[_0x120b('0x6e')](_0x120b('0x82'),{'UserId':_0x4473c5,'OpenchannelQueueId':_0x24a590['id']});});});});});});})[_0x120b('0x2d')](respondWithStatusCode(_0x42d4ca,null))[_0x120b('0x4b')](handleError(_0x42d4ca,null));};exports[_0x120b('0x83')]=function(_0x10a8de,_0x2a2bfe,_0x31e2eb){return db[_0x120b('0x34')][_0x120b('0x4f')]({'where':{'id':_0x10a8de[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](handleEntityNotFound(_0x2a2bfe,null))[_0x120b('0x2d')](function(_0x134fb5){if(_0x134fb5){return _0x134fb5[_0x120b('0x83')](_0x10a8de[_0x120b('0x51')]['ids'],_[_0x120b('0x84')](_0x10a8de[_0x120b('0x51')],['ids','id'])||{})[_0x120b('0x85')](function(_0x4e8295){for(var _0x5f2382=0x0;_0x5f2382<_0x10a8de[_0x120b('0x51')][_0x120b('0x67')]['length'];_0x5f2382+=0x1){socket[_0x120b('0x6e')]('userOpenchannelQueue:save',{'UserId':Number(_0x10a8de['body']['ids'][_0x5f2382]),'OpenchannelQueueId':Number(_0x10a8de['params']['id'])});}return _0x4e8295;});}})[_0x120b('0x2d')](respondWithResult(_0x2a2bfe,null))[_0x120b('0x4b')](handleError(_0x2a2bfe,null));};exports['removeAgents']=function(_0x4852dd,_0x3c3a0a,_0x1bd208){return db['OpenchannelQueue']['find']({'where':{'id':_0x4852dd[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](handleEntityNotFound(_0x3c3a0a,null))['then'](function(_0x1f06f9){if(_0x1f06f9){return _0x1f06f9['removeAgents'](_0x4852dd[_0x120b('0x38')][_0x120b('0x67')])[_0x120b('0x2d')](function(){if(_[_0x120b('0x86')](_0x4852dd[_0x120b('0x38')]['ids'])){for(var _0x3888b6=0x0;_0x3888b6<_0x4852dd['query']['ids'][_0x120b('0x3d')];_0x3888b6+=0x1){socket[_0x120b('0x6e')](_0x120b('0x82'),{'UserId':Number(_0x4852dd[_0x120b('0x38')]['ids'][_0x3888b6]),'OpenchannelQueueId':Number(_0x4852dd[_0x120b('0x4c')]['id'])});}}else{socket[_0x120b('0x6e')](_0x120b('0x82'),{'UserId':Number(_0x4852dd[_0x120b('0x38')][_0x120b('0x67')]),'OpenchannelQueueId':Number(_0x4852dd[_0x120b('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c3a0a,null))[_0x120b('0x4b')](handleError(_0x3c3a0a,null));};exports[_0x120b('0x87')]=function(_0x44ce23,_0x330ac0,_0x4f15d8){var _0x2564cc={};var _0xa3ab51={};var _0xb2fcb9;var _0x1a520a;return db[_0x120b('0x34')][_0x120b('0x64')]({'where':{'id':_0x44ce23[_0x120b('0x4c')]['id']}})[_0x120b('0x2d')](handleEntityNotFound(_0x330ac0,null))['then'](function(_0x448e86){if(_0x448e86){_0xb2fcb9=_0x448e86;_0xa3ab51[_0x120b('0x36')]=_[_0x120b('0x37')](db['User'][_0x120b('0x4d')]);_0xa3ab51[_0x120b('0x38')]=_[_0x120b('0x37')](_0x44ce23[_0x120b('0x38')]);_0xa3ab51[_0x120b('0x39')]=_[_0x120b('0x3a')](_0xa3ab51[_0x120b('0x36')],_0xa3ab51[_0x120b('0x38')]);_0x2564cc[_0x120b('0x3c')]=_[_0x120b('0x3a')](_0xa3ab51[_0x120b('0x36')],qs[_0x120b('0x3b')](_0x44ce23[_0x120b('0x38')]['fields']));_0x2564cc[_0x120b('0x3c')]=_0x2564cc['attributes'][_0x120b('0x3d')]?_0x2564cc[_0x120b('0x3c')]:_0xa3ab51[_0x120b('0x36')];_0x2564cc['order']=qs[_0x120b('0x41')](_0x44ce23['query'][_0x120b('0x41')]);_0x2564cc['where']=qs[_0x120b('0x39')](_[_0x120b('0x43')](_0x44ce23['query'],_0xa3ab51[_0x120b('0x39')]));if(_0x44ce23[_0x120b('0x38')][_0x120b('0x44')]){_0x2564cc['where']=_[_0x120b('0x45')](_0x2564cc[_0x120b('0x42')],{'$or':_[_0x120b('0x33')](_0x2564cc[_0x120b('0x3c')],function(_0x3b29a9){var _0x56b299={};_0x56b299[_0x3b29a9]={'$like':'%'+_0x44ce23[_0x120b('0x38')][_0x120b('0x44')]+'%'};return _0x56b299;})});}_0x2564cc=_[_0x120b('0x45')]({},_0x2564cc,_0x44ce23[_0x120b('0x47')]);return _0xb2fcb9['getAgents'](_0x2564cc);}})[_0x120b('0x2d')](function(_0x5d6cf6){if(_0x5d6cf6){_0x1a520a=_0x5d6cf6[_0x120b('0x3d')];if(!_0x44ce23['query'][_0x120b('0x3e')](_0x120b('0x3f'))){_0x2564cc[_0x120b('0x22')]=qs[_0x120b('0x22')](_0x44ce23[_0x120b('0x38')][_0x120b('0x22')]);_0x2564cc['offset']=qs[_0x120b('0x25')](_0x44ce23[_0x120b('0x38')][_0x120b('0x25')]);}return _0xb2fcb9['getAgents'](_0x2564cc);}})[_0x120b('0x2d')](function(_0x4a7dfa){if(_0x4a7dfa){return _0x4a7dfa?{'count':_0x1a520a,'rows':_0x4a7dfa}:null;}})[_0x120b('0x2d')](respondWithResult(_0x330ac0,null))[_0x120b('0x4b')](handleError(_0x330ac0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6fb14f4..b148328 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 _0x7f0b=['hook','exports','events','OpenchannelQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7f0b,0xa4));var _0xb7f0=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x7f0b[_0x817d9b];return _0x2752e1;};'use strict';var EventEmitter=require(_0xb7f0('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xb7f0('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb7f0('0x2'),'afterUpdate':_0xb7f0('0x3'),'afterDestroy':_0xb7f0('0x4')};function emitEvent(_0x8ff09c){return function(_0x5bb9c7,_0x1ceee7,_0x2a83dd){OpenchannelQueueEvents['emit'](_0x8ff09c+':'+_0x5bb9c7['id'],_0x5bb9c7);OpenchannelQueueEvents[_0xb7f0('0x5')](_0x8ff09c,_0x5bb9c7);_0x2a83dd(null);};}for(var e in events){if(events[_0xb7f0('0x6')](e)){var event=events[e];OpenchannelQueue[_0xb7f0('0x7')](e,emitEvent(event));}}module[_0xb7f0('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe723=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','save'];(function(_0x44b0de,_0x213afa){var _0x21da2a=function(_0x264f30){while(--_0x264f30){_0x44b0de['push'](_0x44b0de['shift']());}};_0x21da2a(++_0x213afa);}(_0xe723,0x16d));var _0x3e72=function(_0x2aae30,_0x4d834d){_0x2aae30=_0x2aae30-0x0;var _0x1ea85b=_0xe723[_0x2aae30];return _0x1ea85b;};'use strict';var EventEmitter=require(_0x3e72('0x0'));var OpenchannelQueue=require(_0x3e72('0x1'))['db'][_0x3e72('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e72('0x3'),'afterUpdate':_0x3e72('0x4'),'afterDestroy':_0x3e72('0x5')};function emitEvent(_0xec5f5e){return function(_0x2bfe94,_0x4a766d,_0x4e095){OpenchannelQueueEvents[_0x3e72('0x6')](_0xec5f5e+':'+_0x2bfe94['id'],_0x2bfe94);OpenchannelQueueEvents[_0x3e72('0x6')](_0xec5f5e,_0x2bfe94);_0x4e095(null);};}for(var e in events){if(events[_0x3e72('0x7')](e)){var event=events[e];OpenchannelQueue[_0x3e72('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 09095db..9247855 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 _0x13a0=['define','OpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xc170c2,_0x234145){var _0x91cd13=function(_0x1076d7){while(--_0x1076d7){_0xc170c2['push'](_0xc170c2['shift']());}};_0x91cd13(++_0x234145);}(_0x13a0,0x10a));var _0x013a=function(_0x4f485f,_0x1db0f7){_0x4f485f=_0x4f485f-0x0;var _0x1e998e=_0x13a0[_0x4f485f];return _0x1e998e;};'use strict';var _=require(_0x013a('0x0'));var util=require('util');var logger=require(_0x013a('0x1'))(_0x013a('0x2'));var moment=require('moment');var BPromise=require(_0x013a('0x3'));var rp=require(_0x013a('0x4'));var fs=require('fs');var path=require(_0x013a('0x5'));var rimraf=require(_0x013a('0x6'));var config=require(_0x013a('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x013a('0x8')]=function(_0xfed40d,_0x279f27){return _0xfed40d[_0x013a('0x9')](_0x013a('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37f3=['moment','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','../../config/logger','api'];(function(_0x13740b,_0x3473c8){var _0x187311=function(_0x82a295){while(--_0x82a295){_0x13740b['push'](_0x13740b['shift']());}};_0x187311(++_0x3473c8);}(_0x37f3,0x1ec));var _0x337f=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x37f3[_0x1a37e3];return _0x4db78a;};'use strict';var _=require(_0x337f('0x0'));var util=require('util');var logger=require(_0x337f('0x1'))(_0x337f('0x2'));var moment=require(_0x337f('0x3'));var BPromise=require('bluebird');var rp=require(_0x337f('0x4'));var fs=require('fs');var path=require(_0x337f('0x5'));var rimraf=require(_0x337f('0x6'));var config=require('../../config/environment');var attributes=require(_0x337f('0x7'));module[_0x337f('0x8')]=function(_0xb80046,_0x4a532a){return _0xb80046[_0x337f('0x9')](_0x337f('0xa'),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 be0b026..4d674ac 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 _0x3a0a=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','OpenchannelQueue','raw','options','where','attributes','limit','include','model','map','then','GetOpenchannelQueue','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0x419b0e,_0x1ebb21){var _0x3d11e9=function(_0x364958){while(--_0x364958){_0x419b0e['push'](_0x419b0e['shift']());}};_0x3d11e9(++_0x1ebb21);}(_0x3a0a,0x1cf));var _0xa3a0=function(_0x3a4a22,_0x217aff){_0x3a4a22=_0x3a4a22-0x0;var _0xec204=_0x3a0a[_0x3a4a22];return _0xec204;};'use strict';var _=require(_0xa3a0('0x0'));var util=require(_0xa3a0('0x1'));var moment=require(_0xa3a0('0x2'));var BPromise=require(_0xa3a0('0x3'));var rs=require(_0xa3a0('0x4'));var fs=require('fs');var Redis=require(_0xa3a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3a0('0x6'));var logger=require('../../config/logger')(_0xa3a0('0x7'));var config=require(_0xa3a0('0x8'));var jayson=require(_0xa3a0('0x9'));var client=jayson['client'][_0xa3a0('0xa')]({'port':0x232a});config['redis']=_[_0xa3a0('0xb')](config[_0xa3a0('0xc')],{'host':_0xa3a0('0xd'),'port':0x18eb});var socket=require(_0xa3a0('0xe'))(new Redis(config[_0xa3a0('0xc')]));require(_0xa3a0('0xf'))['register'](socket);function respondWithRpcPromise(_0x4e9458,_0x1b4806,_0x42f7ff){return new BPromise(function(_0x4f5c37,_0x5c0ee0){return client[_0xa3a0('0x10')](_0x4e9458,_0x42f7ff)['then'](function(_0x10bb44){logger[_0xa3a0('0x11')](_0xa3a0('0x12'),_0x1b4806,_0xa3a0('0x13'));logger[_0xa3a0('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1b4806,'request\x20sent',JSON[_0xa3a0('0x15')](_0x10bb44));if(_0x10bb44['error']){if(_0x10bb44[_0xa3a0('0x16')]['code']===0x1f4){logger[_0xa3a0('0x16')](_0xa3a0('0x12'),_0x1b4806,_0x10bb44['error'][_0xa3a0('0x17')]);return _0x5c0ee0(_0x10bb44[_0xa3a0('0x16')][_0xa3a0('0x17')]);}logger[_0xa3a0('0x16')](_0xa3a0('0x12'),_0x1b4806,_0x10bb44['error'][_0xa3a0('0x17')]);return _0x4f5c37(_0x10bb44[_0xa3a0('0x16')][_0xa3a0('0x17')]);}else{logger[_0xa3a0('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x1b4806,_0xa3a0('0x13'));_0x4f5c37(_0x10bb44[_0xa3a0('0x18')][_0xa3a0('0x17')]);}})[_0xa3a0('0x19')](function(_0x35e847){logger[_0xa3a0('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1b4806,_0x35e847);_0x5c0ee0(_0x35e847);});});}exports['GetOpenchannelQueue']=function(_0x20a6a2){var _0x89b3e4=this;return new Promise(function(_0x4182c1,_0x49d575){return db[_0xa3a0('0x1a')]['findAll']({'raw':_0x20a6a2['options']?_0x20a6a2['options'][_0xa3a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x20a6a2[_0xa3a0('0x1c')]?_0x20a6a2[_0xa3a0('0x1c')][_0xa3a0('0x1d')]||null:null,'attributes':_0x20a6a2[_0xa3a0('0x1c')]?_0x20a6a2['options'][_0xa3a0('0x1e')]||null:null,'limit':_0x20a6a2[_0xa3a0('0x1c')]?_0x20a6a2[_0xa3a0('0x1c')][_0xa3a0('0x1f')]||null:null,'include':_0x20a6a2[_0xa3a0('0x1c')]?_0x20a6a2[_0xa3a0('0x1c')][_0xa3a0('0x20')]?_['map'](_0x20a6a2[_0xa3a0('0x1c')][_0xa3a0('0x20')],function(_0x4c9fd5){return{'model':db[_0x4c9fd5[_0xa3a0('0x21')]],'as':_0x4c9fd5['as'],'attributes':_0x4c9fd5[_0xa3a0('0x1e')],'include':_0x4c9fd5['include']?_[_0xa3a0('0x22')](_0x4c9fd5[_0xa3a0('0x20')],function(_0x1f86d0){return{'model':db[_0x1f86d0[_0xa3a0('0x21')]],'as':_0x1f86d0['as'],'attributes':_0x1f86d0[_0xa3a0('0x1e')],'include':_0x1f86d0[_0xa3a0('0x20')]?_['map'](_0x1f86d0[_0xa3a0('0x20')],function(_0x2c2b7a){return{'model':db[_0x2c2b7a[_0xa3a0('0x21')]],'as':_0x2c2b7a['as'],'attributes':_0x2c2b7a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa3a0('0x23')](function(_0x26d931){logger['info']('GetOpenchannelQueue',_0x20a6a2);logger[_0xa3a0('0x14')](_0xa3a0('0x24'),_0x20a6a2,JSON[_0xa3a0('0x15')](_0x26d931));_0x4182c1(_0x26d931);})[_0xa3a0('0x19')](function(_0xc69f3e){logger[_0xa3a0('0x16')](_0xa3a0('0x24'),_0xc69f3e['message'],_0x20a6a2);_0x49d575(_0x89b3e4[_0xa3a0('0x16')](0x1f4,_0xc69f3e[_0xa3a0('0x17')]));});});};exports[_0xa3a0('0x25')]=function(_0x1327da){var _0x48c129=this;return new Promise(function(_0x58b889,_0x5cc516){return db[_0xa3a0('0x1a')][_0xa3a0('0x26')]({'raw':_0x1327da[_0xa3a0('0x1c')]?_0x1327da[_0xa3a0('0x1c')][_0xa3a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x1327da['options']?_0x1327da[_0xa3a0('0x1c')][_0xa3a0('0x1d')]||null:null,'attributes':_0x1327da[_0xa3a0('0x1c')]?_0x1327da[_0xa3a0('0x1c')][_0xa3a0('0x1e')]||null:null,'include':_0x1327da[_0xa3a0('0x1c')]?_0x1327da[_0xa3a0('0x1c')][_0xa3a0('0x20')]?_[_0xa3a0('0x22')](_0x1327da['options']['include'],function(_0x204023){return{'model':db[_0x204023[_0xa3a0('0x21')]],'as':_0x204023['as'],'attributes':_0x204023['attributes'],'include':_0x204023[_0xa3a0('0x20')]?_[_0xa3a0('0x22')](_0x204023[_0xa3a0('0x20')],function(_0x3332f2){return{'model':db[_0x3332f2['model']],'as':_0x3332f2['as'],'attributes':_0x3332f2[_0xa3a0('0x1e')],'include':_0x3332f2[_0xa3a0('0x20')]?_['map'](_0x3332f2['include'],function(_0x572c4d){return{'model':db[_0x572c4d[_0xa3a0('0x21')]],'as':_0x572c4d['as'],'attributes':_0x572c4d[_0xa3a0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa3a0('0x23')](function(_0x5a33f7){logger[_0xa3a0('0x11')](_0xa3a0('0x25'),_0x1327da);logger['debug'](_0xa3a0('0x25'),_0x1327da,JSON[_0xa3a0('0x15')](_0x5a33f7));_0x58b889(_0x5a33f7);})[_0xa3a0('0x19')](function(_0x148146){logger['error'](_0xa3a0('0x25'),_0x148146['message'],_0x1327da);_0x5cc516(_0x48c129[_0xa3a0('0x16')](0x1f4,_0x148146[_0xa3a0('0x17')]));});});}; \ No newline at end of file +var _0x7b2e=['where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetOpenchannelQueue','OpenchannelQueue','options','raw'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x7b2e,0x1d1));var _0xe7b2=function(_0x263016,_0x2277ef){_0x263016=_0x263016-0x0;var _0x3b1c47=_0x7b2e[_0x263016];return _0x3b1c47;};'use strict';var _=require(_0xe7b2('0x0'));var util=require(_0xe7b2('0x1'));var moment=require(_0xe7b2('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7b2('0x3'));var fs=require('fs');var Redis=require(_0xe7b2('0x4'));var db=require(_0xe7b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7b2('0x6'))(_0xe7b2('0x7'));var config=require(_0xe7b2('0x8'));var jayson=require(_0xe7b2('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe7b2('0xa')]=_['defaults'](config[_0xe7b2('0xa')],{'host':_0xe7b2('0xb'),'port':0x18eb});var socket=require(_0xe7b2('0xc'))(new Redis(config[_0xe7b2('0xa')]));require(_0xe7b2('0xd'))['register'](socket);function respondWithRpcPromise(_0x52b9db,_0x2d12b9,_0x4f4684){return new BPromise(function(_0x4a8c2c,_0x4fbdef){return client[_0xe7b2('0xe')](_0x52b9db,_0x4f4684)[_0xe7b2('0xf')](function(_0x32d638){logger['info'](_0xe7b2('0x10'),_0x2d12b9,'request\x20sent');logger[_0xe7b2('0x11')](_0xe7b2('0x12'),_0x2d12b9,_0xe7b2('0x13'),JSON[_0xe7b2('0x14')](_0x32d638));if(_0x32d638[_0xe7b2('0x15')]){if(_0x32d638[_0xe7b2('0x15')][_0xe7b2('0x16')]===0x1f4){logger[_0xe7b2('0x15')](_0xe7b2('0x10'),_0x2d12b9,_0x32d638[_0xe7b2('0x15')][_0xe7b2('0x17')]);return _0x4fbdef(_0x32d638[_0xe7b2('0x15')]['message']);}logger[_0xe7b2('0x15')](_0xe7b2('0x10'),_0x2d12b9,_0x32d638[_0xe7b2('0x15')]['message']);return _0x4a8c2c(_0x32d638[_0xe7b2('0x15')][_0xe7b2('0x17')]);}else{logger[_0xe7b2('0x18')](_0xe7b2('0x10'),_0x2d12b9,_0xe7b2('0x13'));_0x4a8c2c(_0x32d638['result'][_0xe7b2('0x17')]);}})['catch'](function(_0x1f2a9b){logger[_0xe7b2('0x15')](_0xe7b2('0x10'),_0x2d12b9,_0x1f2a9b);_0x4fbdef(_0x1f2a9b);});});}exports[_0xe7b2('0x19')]=function(_0x3f46b9){var _0x58d866=this;return new Promise(function(_0x5c9329,_0x4812a0){return db[_0xe7b2('0x1a')]['findAll']({'raw':_0x3f46b9[_0xe7b2('0x1b')]?_0x3f46b9[_0xe7b2('0x1b')][_0xe7b2('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f46b9[_0xe7b2('0x1b')]?_0x3f46b9[_0xe7b2('0x1b')][_0xe7b2('0x1d')]||null:null,'attributes':_0x3f46b9['options']?_0x3f46b9[_0xe7b2('0x1b')][_0xe7b2('0x1e')]||null:null,'limit':_0x3f46b9[_0xe7b2('0x1b')]?_0x3f46b9[_0xe7b2('0x1b')][_0xe7b2('0x1f')]||null:null,'include':_0x3f46b9['options']?_0x3f46b9[_0xe7b2('0x1b')][_0xe7b2('0x20')]?_[_0xe7b2('0x21')](_0x3f46b9[_0xe7b2('0x1b')][_0xe7b2('0x20')],function(_0x1f3596){return{'model':db[_0x1f3596[_0xe7b2('0x22')]],'as':_0x1f3596['as'],'attributes':_0x1f3596[_0xe7b2('0x1e')],'include':_0x1f3596[_0xe7b2('0x20')]?_[_0xe7b2('0x21')](_0x1f3596['include'],function(_0x3cebd2){return{'model':db[_0x3cebd2[_0xe7b2('0x22')]],'as':_0x3cebd2['as'],'attributes':_0x3cebd2[_0xe7b2('0x1e')],'include':_0x3cebd2[_0xe7b2('0x20')]?_[_0xe7b2('0x21')](_0x3cebd2['include'],function(_0x1c55c9){return{'model':db[_0x1c55c9[_0xe7b2('0x22')]],'as':_0x1c55c9['as'],'attributes':_0x1c55c9[_0xe7b2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ebfc8){logger[_0xe7b2('0x18')](_0xe7b2('0x19'),_0x3f46b9);logger[_0xe7b2('0x11')](_0xe7b2('0x19'),_0x3f46b9,JSON[_0xe7b2('0x14')](_0x2ebfc8));_0x5c9329(_0x2ebfc8);})['catch'](function(_0x585620){logger[_0xe7b2('0x15')]('GetOpenchannelQueue',_0x585620[_0xe7b2('0x17')],_0x3f46b9);_0x4812a0(_0x58d866[_0xe7b2('0x15')](0x1f4,_0x585620[_0xe7b2('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x5ce0bd){var _0x114d56=this;return new Promise(function(_0x23e43c,_0x1a7984){return db[_0xe7b2('0x1a')][_0xe7b2('0x23')]({'raw':_0x5ce0bd['options']?_0x5ce0bd[_0xe7b2('0x1b')][_0xe7b2('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ce0bd[_0xe7b2('0x1b')]?_0x5ce0bd['options']['where']||null:null,'attributes':_0x5ce0bd['options']?_0x5ce0bd[_0xe7b2('0x1b')]['attributes']||null:null,'include':_0x5ce0bd[_0xe7b2('0x1b')]?_0x5ce0bd[_0xe7b2('0x1b')][_0xe7b2('0x20')]?_[_0xe7b2('0x21')](_0x5ce0bd[_0xe7b2('0x1b')]['include'],function(_0x5fcc51){return{'model':db[_0x5fcc51[_0xe7b2('0x22')]],'as':_0x5fcc51['as'],'attributes':_0x5fcc51['attributes'],'include':_0x5fcc51['include']?_[_0xe7b2('0x21')](_0x5fcc51[_0xe7b2('0x20')],function(_0x2009c1){return{'model':db[_0x2009c1[_0xe7b2('0x22')]],'as':_0x2009c1['as'],'attributes':_0x2009c1[_0xe7b2('0x1e')],'include':_0x2009c1[_0xe7b2('0x20')]?_[_0xe7b2('0x21')](_0x2009c1['include'],function(_0x20da28){return{'model':db[_0x20da28[_0xe7b2('0x22')]],'as':_0x20da28['as'],'attributes':_0x20da28[_0xe7b2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe7b2('0xf')](function(_0x42cd8c){logger[_0xe7b2('0x18')](_0xe7b2('0x24'),_0x5ce0bd);logger[_0xe7b2('0x11')](_0xe7b2('0x24'),_0x5ce0bd,JSON[_0xe7b2('0x14')](_0x42cd8c));_0x23e43c(_0x42cd8c);})[_0xe7b2('0x25')](function(_0x245b3b){logger['error'](_0xe7b2('0x24'),_0x245b3b['message'],_0x5ce0bd);_0x1a7984(_0x114d56[_0xe7b2('0x15')](0x1f4,_0x245b3b[_0xe7b2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index cdbba7b..e867f10 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 _0x1e4f=['length','openchannelQueue:','./openchannelQueue.events','remove','emit','removeListener'];(function(_0x2188c8,_0x31b201){var _0x2c65fa=function(_0x5d7c4a){while(--_0x5d7c4a){_0x2188c8['push'](_0x2188c8['shift']());}};_0x2c65fa(++_0x31b201);}(_0x1e4f,0x1a0));var _0xf1e4=function(_0xdd57d2,_0x437799){_0xdd57d2=_0xdd57d2-0x0;var _0x426d85=_0x1e4f[_0xdd57d2];return _0x426d85;};'use strict';var OpenchannelQueueEvents=require(_0xf1e4('0x0'));var events=['save',_0xf1e4('0x1'),'update'];function createListener(_0x2852e8,_0x2a8058){return function(_0x4da414){_0x2a8058[_0xf1e4('0x2')](_0x2852e8,_0x4da414);};}function removeListener(_0x2c8f99,_0x54f8d1){return function(){OpenchannelQueueEvents[_0xf1e4('0x3')](_0x2c8f99,_0x54f8d1);};}exports['register']=function(_0x56c559){for(var _0x25770a=0x0,_0x1a04f3=events[_0xf1e4('0x4')];_0x25770a<_0x1a04f3;_0x25770a++){var _0x57c187=events[_0x25770a];var _0x2ea095=createListener(_0xf1e4('0x5')+_0x57c187,_0x56c559);OpenchannelQueueEvents['on'](_0x57c187,_0x2ea095);}}; \ No newline at end of file +var _0x97ea=['emit','removeListener','register','length','remove','update'];(function(_0x780d4a,_0x117bee){var _0x397825=function(_0x4c9b09){while(--_0x4c9b09){_0x780d4a['push'](_0x780d4a['shift']());}};_0x397825(++_0x117bee);}(_0x97ea,0x8e));var _0xa97e=function(_0x1e1229,_0x1a58e6){_0x1e1229=_0x1e1229-0x0;var _0x3b615d=_0x97ea[_0x1e1229];return _0x3b615d;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xa97e('0x0'),_0xa97e('0x1')];function createListener(_0x356f75,_0x13c997){return function(_0x121aa4){_0x13c997[_0xa97e('0x2')](_0x356f75,_0x121aa4);};}function removeListener(_0x26b2de,_0x5ce7dc){return function(){OpenchannelQueueEvents[_0xa97e('0x3')](_0x26b2de,_0x5ce7dc);};}exports[_0xa97e('0x4')]=function(_0xaef7e6){for(var _0x3b97fe=0x0,_0x6fc869=events[_0xa97e('0x5')];_0x3b97fe<_0x6fc869;_0x3b97fe++){var _0x3aaa53=events[_0x3b97fe];var _0x8e20a4=createListener('openchannelQueue:'+_0x3aaa53,_0xaef7e6);OpenchannelQueueEvents['on'](_0x3aaa53,_0x8e20a4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index d657423..cd56d64 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 _0x6542=['./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1516dd,_0x18e74c){var _0x417a99=function(_0x4bb4f0){while(--_0x4bb4f0){_0x1516dd['push'](_0x1516dd['shift']());}};_0x417a99(++_0x18e74c);}(_0x6542,0x65));var _0x2654=function(_0x459141,_0x448119){_0x459141=_0x459141-0x0;var _0x59121c=_0x6542[_0x459141];return _0x59121c;};'use strict';var multer=require(_0x2654('0x0'));var util=require(_0x2654('0x1'));var path=require('path');var timeout=require(_0x2654('0x2'));var express=require(_0x2654('0x3'));var router=express[_0x2654('0x4')]();var fs_extra=require(_0x2654('0x5'));var auth=require(_0x2654('0x6'));var interaction=require(_0x2654('0x7'));var config=require(_0x2654('0x8'));var controller=require(_0x2654('0x9'));router['get']('/',auth[_0x2654('0xa')](),controller[_0x2654('0xb')]);router[_0x2654('0xc')](_0x2654('0xd'),auth[_0x2654('0xa')](),controller[_0x2654('0xe')]);router[_0x2654('0xc')](_0x2654('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2654('0x10')]('/',auth[_0x2654('0xa')](),controller[_0x2654('0x11')]);router[_0x2654('0x12')](_0x2654('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x2654('0x13')](_0x2654('0xf'),auth['isAuthenticated'](),controller[_0x2654('0x14')]);module[_0x2654('0x15')]=router; \ No newline at end of file +var _0x5c26=['Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','util','express'];(function(_0x856968,_0x1b13cc){var _0x4383c9=function(_0xa8796c){while(--_0xa8796c){_0x856968['push'](_0x856968['shift']());}};_0x4383c9(++_0x1b13cc);}(_0x5c26,0xb1));var _0x65c2=function(_0x52652c,_0x49dcbf){_0x52652c=_0x52652c-0x0;var _0x5e4d43=_0x5c26[_0x52652c];return _0x5e4d43;};'use strict';var multer=require(_0x65c2('0x0'));var util=require(_0x65c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x65c2('0x2'));var router=express[_0x65c2('0x3')]();var fs_extra=require(_0x65c2('0x4'));var auth=require(_0x65c2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65c2('0x6'));var controller=require(_0x65c2('0x7'));router[_0x65c2('0x8')]('/',auth[_0x65c2('0x9')](),controller[_0x65c2('0xa')]);router[_0x65c2('0x8')](_0x65c2('0xb'),auth[_0x65c2('0x9')](),controller[_0x65c2('0xc')]);router[_0x65c2('0x8')](_0x65c2('0xd'),auth[_0x65c2('0x9')](),controller[_0x65c2('0xe')]);router[_0x65c2('0xf')]('/',auth[_0x65c2('0x9')](),controller[_0x65c2('0x10')]);router[_0x65c2('0x11')](_0x65c2('0xd'),auth['isAuthenticated'](),controller[_0x65c2('0x12')]);router['delete'](_0x65c2('0xd'),auth[_0x65c2('0x9')](),controller[_0x65c2('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3ffdd22..cbaa378 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 _0xeff9=['sequelize','exports','STRING','DATE','moment'];(function(_0xca1585,_0x219dfb){var _0x117736=function(_0x386c85){while(--_0x386c85){_0xca1585['push'](_0xca1585['shift']());}};_0x117736(++_0x219dfb);}(_0xeff9,0x1c6));var _0x9eff=function(_0x412b25,_0x39b11b){_0x412b25=_0x412b25-0x0;var _0x20cd7d=_0xeff9[_0x412b25];return _0x20cd7d;};'use strict';var moment=require(_0x9eff('0x0'));var Sequelize=require(_0x9eff('0x1'));module[_0x9eff('0x2')]={'uniqueid':{'type':Sequelize[_0x9eff('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9eff('0x3')]},'joinAt':{'type':Sequelize[_0x9eff('0x4')]},'leaveAt':{'type':Sequelize[_0x9eff('0x4')]},'acceptAt':{'type':Sequelize[_0x9eff('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9eff('0x3')]}}; \ No newline at end of file +var _0xc480=['sequelize','STRING','DATE','moment'];(function(_0x13f4e5,_0x4bba4e){var _0x52caff=function(_0x24360c){while(--_0x24360c){_0x13f4e5['push'](_0x13f4e5['shift']());}};_0x52caff(++_0x4bba4e);}(_0xc480,0xcf));var _0x0c48=function(_0x220e87,_0x1863aa){_0x220e87=_0x220e87-0x0;var _0x5d5a96=_0xc480[_0x220e87];return _0x5d5a96;};'use strict';var moment=require(_0x0c48('0x0'));var Sequelize=require(_0x0c48('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0c48('0x2')]},'joinAt':{'type':Sequelize[_0x0c48('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0c48('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6527a7f..f4a47ad 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 _0x75a8=['find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','OpenchannelQueueReport','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','catch','merge'];(function(_0x54c516,_0x420575){var _0x2583c0=function(_0x4171e4){while(--_0x4171e4){_0x54c516['push'](_0x54c516['shift']());}};_0x2583c0(++_0x420575);}(_0x75a8,0x16d));var _0x875a=function(_0x504c6b,_0x47f567){_0x504c6b=_0x504c6b-0x0;var _0x3b07b9=_0x75a8[_0x504c6b];return _0x3b07b9;};'use strict';var emlformat=require(_0x875a('0x0'));var rimraf=require(_0x875a('0x1'));var zipdir=require(_0x875a('0x2'));var jsonpatch=require(_0x875a('0x3'));var rp=require('request-promise');var moment=require(_0x875a('0x4'));var BPromise=require(_0x875a('0x5'));var Mustache=require(_0x875a('0x6'));var util=require(_0x875a('0x7'));var path=require(_0x875a('0x8'));var sox=require(_0x875a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x875a('0xa'));var _=require(_0x875a('0xb'));var squel=require(_0x875a('0xc'));var crypto=require(_0x875a('0xd'));var jsforce=require(_0x875a('0xe'));var deskjs=require(_0x875a('0xf'));var toCsv=require(_0x875a('0x10'));var querystring=require(_0x875a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x875a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x875a('0x13'));var hardwareService=require(_0x875a('0x14'));var logger=require(_0x875a('0x15'))(_0x875a('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x875a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121663,_0x3196b5){_0x3196b5=_0x3196b5||0xcc;return function(_0x1a0217){if(_0x1a0217){return _0x121663[_0x875a('0x18')](_0x3196b5);}return _0x121663[_0x875a('0x19')](_0x3196b5)[_0x875a('0x1a')]();};}function respondWithResult(_0x5ee87b,_0x5e4efc){_0x5e4efc=_0x5e4efc||0xc8;return function(_0x4667ac){if(_0x4667ac){return _0x5ee87b[_0x875a('0x19')](_0x5e4efc)[_0x875a('0x1b')](_0x4667ac);}};}function respondWithFilteredResult(_0x4e4f0c,_0x145d15){return function(_0x74aeeb){if(_0x74aeeb){var _0x25e0f7=typeof _0x145d15[_0x875a('0x1c')]===_0x875a('0x1d')&&typeof _0x145d15[_0x875a('0x1e')]===_0x875a('0x1d');var _0x112f68=_0x74aeeb[_0x875a('0x1f')];var _0x4d7a43=_0x25e0f7?0x0:_0x145d15[_0x875a('0x1c')];var _0x1cd0e8=_0x25e0f7?_0x74aeeb[_0x875a('0x1f')]:_0x145d15[_0x875a('0x1c')]+_0x145d15['limit'];var _0x24e49c;if(_0x1cd0e8>=_0x112f68){_0x1cd0e8=_0x112f68;_0x24e49c=0xc8;}else{_0x24e49c=0xce;}_0x4e4f0c[_0x875a('0x19')](_0x24e49c);return _0x4e4f0c['set'](_0x875a('0x20'),_0x4d7a43+'-'+_0x1cd0e8+'/'+_0x112f68)[_0x875a('0x1b')](_0x74aeeb);}return null;};}function patchUpdates(_0x1cdc86){return function(_0x319856){try{jsonpatch[_0x875a('0x21')](_0x319856,_0x1cdc86,!![]);}catch(_0x53952e){return BPromise['reject'](_0x53952e);}return _0x319856[_0x875a('0x22')]();};}function saveUpdates(_0x5e973a,_0x27c71c){return function(_0x526dfb){if(_0x526dfb){return _0x526dfb[_0x875a('0x23')](_0x5e973a)[_0x875a('0x24')](function(_0x401e9d){return _0x401e9d;});}return null;};}function removeEntity(_0x583431,_0x15c028){return function(_0x49f43d){if(_0x49f43d){return _0x49f43d[_0x875a('0x25')]()[_0x875a('0x24')](function(){_0x583431[_0x875a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39bc9d,_0x533eb1){return function(_0x163c44){if(!_0x163c44){_0x39bc9d[_0x875a('0x18')](0x194);}return _0x163c44;};}function handleError(_0x151391,_0x3327cd){_0x3327cd=_0x3327cd||0x1f4;return function(_0x1f92fc){logger[_0x875a('0x26')](_0x1f92fc[_0x875a('0x27')]);if(_0x1f92fc[_0x875a('0x28')]){delete _0x1f92fc[_0x875a('0x28')];}_0x151391[_0x875a('0x19')](_0x3327cd)[_0x875a('0x29')](_0x1f92fc);};}exports['index']=function(_0x2d0dd0,_0x2ada13){var _0x360b9d={},_0xfd179c={},_0x165e4b={'count':0x0,'rows':[]};var _0x474622=_['map'](db[_0x875a('0x2a')]['rawAttributes'],function(_0x57bd2c){return{'name':_0x57bd2c['fieldName'],'type':_0x57bd2c['type'][_0x875a('0x2b')]};});_0xfd179c[_0x875a('0x2c')]=_[_0x875a('0x2d')](_0x474622,'name');_0xfd179c[_0x875a('0x2e')]=_[_0x875a('0x2f')](_0x2d0dd0[_0x875a('0x2e')]);_0xfd179c[_0x875a('0x30')]=_['intersection'](_0xfd179c[_0x875a('0x2c')],_0xfd179c[_0x875a('0x2e')]);_0x360b9d[_0x875a('0x31')]=_[_0x875a('0x32')](_0xfd179c[_0x875a('0x2c')],qs['fields'](_0x2d0dd0[_0x875a('0x2e')][_0x875a('0x33')]));_0x360b9d[_0x875a('0x31')]=_0x360b9d[_0x875a('0x31')][_0x875a('0x34')]?_0x360b9d[_0x875a('0x31')]:_0xfd179c[_0x875a('0x2c')];if(!_0x2d0dd0['query']['hasOwnProperty'](_0x875a('0x35'))){_0x360b9d[_0x875a('0x1e')]=qs[_0x875a('0x1e')](_0x2d0dd0['query'][_0x875a('0x1e')]);_0x360b9d['offset']=qs['offset'](_0x2d0dd0[_0x875a('0x2e')][_0x875a('0x1c')]);}_0x360b9d[_0x875a('0x36')]=qs[_0x875a('0x37')](_0x2d0dd0['query'][_0x875a('0x37')]);_0x360b9d[_0x875a('0x38')]=qs[_0x875a('0x30')](_[_0x875a('0x39')](_0x2d0dd0['query'],_0xfd179c['filters']),_0x474622);if(_0x2d0dd0[_0x875a('0x2e')][_0x875a('0x3a')]){_0x360b9d[_0x875a('0x38')]=_['merge'](_0x360b9d[_0x875a('0x38')],{'$or':_[_0x875a('0x2d')](_0x474622,function(_0x4c6978){if(_0x4c6978[_0x875a('0x3b')]!==_0x875a('0x3c')){var _0x135b5b={};_0x135b5b[_0x4c6978['name']]={'$like':'%'+_0x2d0dd0[_0x875a('0x2e')][_0x875a('0x3a')]+'%'};return _0x135b5b;}})});}_0x360b9d=_['merge']({},_0x360b9d,_0x2d0dd0[_0x875a('0x3d')]);var _0x5a1490={'where':_0x360b9d[_0x875a('0x38')]};return db[_0x875a('0x2a')][_0x875a('0x1f')](_0x5a1490)[_0x875a('0x24')](function(_0x16cabf){_0x165e4b[_0x875a('0x1f')]=_0x16cabf;if(_0x2d0dd0[_0x875a('0x2e')][_0x875a('0x3e')]){_0x360b9d[_0x875a('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x875a('0x40')](_0x360b9d);})['then'](function(_0x5cfa21){_0x165e4b['rows']=_0x5cfa21;return _0x165e4b;})[_0x875a('0x24')](respondWithFilteredResult(_0x2ada13,_0x360b9d))[_0x875a('0x41')](handleError(_0x2ada13,null));};exports['show']=function(_0x214501,_0x3c93ac){var _0x440c67={'raw':!![],'where':{'id':_0x214501['params']['id']}},_0x238c98={};_0x238c98[_0x875a('0x2c')]=_[_0x875a('0x2f')](db[_0x875a('0x2a')]['rawAttributes']);_0x238c98[_0x875a('0x2e')]=_[_0x875a('0x2f')](_0x214501[_0x875a('0x2e')]);_0x238c98[_0x875a('0x30')]=_['intersection'](_0x238c98[_0x875a('0x2c')],_0x238c98[_0x875a('0x2e')]);_0x440c67[_0x875a('0x31')]=_[_0x875a('0x32')](_0x238c98['model'],qs[_0x875a('0x33')](_0x214501['query'][_0x875a('0x33')]));_0x440c67[_0x875a('0x31')]=_0x440c67[_0x875a('0x31')][_0x875a('0x34')]?_0x440c67[_0x875a('0x31')]:_0x238c98['model'];if(_0x214501['query']['includeAll']){_0x440c67[_0x875a('0x3f')]=[{'all':!![]}];}_0x440c67=_[_0x875a('0x42')]({},_0x440c67,_0x214501['options']);return db[_0x875a('0x2a')][_0x875a('0x43')](_0x440c67)[_0x875a('0x24')](handleEntityNotFound(_0x3c93ac,null))[_0x875a('0x24')](respondWithResult(_0x3c93ac,null))[_0x875a('0x41')](handleError(_0x3c93ac,null));};exports['create']=function(_0xd7de8e,_0x555729){return db[_0x875a('0x2a')][_0x875a('0x44')](_0xd7de8e[_0x875a('0x45')],{})['then'](respondWithResult(_0x555729,0xc9))[_0x875a('0x41')](handleError(_0x555729,null));};exports[_0x875a('0x23')]=function(_0x1b0b71,_0x1afd09){if(_0x1b0b71[_0x875a('0x45')]['id']){delete _0x1b0b71['body']['id'];}return db[_0x875a('0x2a')][_0x875a('0x43')]({'where':{'id':_0x1b0b71['params']['id']}})[_0x875a('0x24')](handleEntityNotFound(_0x1afd09,null))[_0x875a('0x24')](saveUpdates(_0x1b0b71['body'],null))[_0x875a('0x24')](respondWithResult(_0x1afd09,null))[_0x875a('0x41')](handleError(_0x1afd09,null));};exports[_0x875a('0x25')]=function(_0x33a7d8,_0x5ec5e8){return db[_0x875a('0x2a')][_0x875a('0x43')]({'where':{'id':_0x33a7d8[_0x875a('0x46')]['id']}})[_0x875a('0x24')](handleEntityNotFound(_0x5ec5e8,null))['then'](removeEntity(_0x5ec5e8,null))[_0x875a('0x41')](handleError(_0x5ec5e8,null));};exports[_0x875a('0x47')]=function(_0x57db7c,_0x78b8f2){return db[_0x875a('0x2a')][_0x875a('0x47')]()[_0x875a('0x24')](respondWithResult(_0x78b8f2,null))[_0x875a('0x41')](handleError(_0x78b8f2,null));}; \ No newline at end of file +var _0x7800=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','filters','filter','where','merge','options','OpenchannelQueueReport','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3bf4d5,_0x366a37){var _0x48fdea=function(_0x665bbe){while(--_0x665bbe){_0x3bf4d5['push'](_0x3bf4d5['shift']());}};_0x48fdea(++_0x366a37);}(_0x7800,0x1ea));var _0x0780=function(_0x372def,_0x49b0f9){_0x372def=_0x372def-0x0;var _0x5b9c36=_0x7800[_0x372def];return _0x5b9c36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0780('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0780('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0780('0x2'));var Mustache=require(_0x0780('0x3'));var util=require(_0x0780('0x4'));var path=require(_0x0780('0x5'));var sox=require(_0x0780('0x6'));var csv=require(_0x0780('0x7'));var ejs=require(_0x0780('0x8'));var fs=require('fs');var fs_extra=require(_0x0780('0x9'));var _=require(_0x0780('0xa'));var squel=require(_0x0780('0xb'));var crypto=require(_0x0780('0xc'));var jsforce=require(_0x0780('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0780('0xe'));var Redis=require(_0x0780('0xf'));var authService=require(_0x0780('0x10'));var qs=require(_0x0780('0x11'));var as=require(_0x0780('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0780('0x13'))(_0x0780('0x14'));var utils=require(_0x0780('0x15'));var config=require(_0x0780('0x16'));var licenseUtil=require(_0x0780('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x272e0c,_0x4bd8ea){_0x4bd8ea=_0x4bd8ea||0xcc;return function(_0x875a92){if(_0x875a92){return _0x272e0c[_0x0780('0x18')](_0x4bd8ea);}return _0x272e0c[_0x0780('0x19')](_0x4bd8ea)['end']();};}function respondWithResult(_0x6d92ce,_0x24b524){_0x24b524=_0x24b524||0xc8;return function(_0x45eb34){if(_0x45eb34){return _0x6d92ce[_0x0780('0x19')](_0x24b524)[_0x0780('0x1a')](_0x45eb34);}};}function respondWithFilteredResult(_0x5460f7,_0x4ea9c4){return function(_0x1bd1ac){if(_0x1bd1ac){var _0x179ba8=typeof _0x4ea9c4[_0x0780('0x1b')]===_0x0780('0x1c')&&typeof _0x4ea9c4[_0x0780('0x1d')]===_0x0780('0x1c');var _0x34887b=_0x1bd1ac[_0x0780('0x1e')];var _0x506e5e=_0x179ba8?0x0:_0x4ea9c4[_0x0780('0x1b')];var _0x124129=_0x179ba8?_0x1bd1ac[_0x0780('0x1e')]:_0x4ea9c4[_0x0780('0x1b')]+_0x4ea9c4[_0x0780('0x1d')];var _0x45ddbc;if(_0x124129>=_0x34887b){_0x124129=_0x34887b;_0x45ddbc=0xc8;}else{_0x45ddbc=0xce;}_0x5460f7[_0x0780('0x19')](_0x45ddbc);return _0x5460f7['set'](_0x0780('0x1f'),_0x506e5e+'-'+_0x124129+'/'+_0x34887b)[_0x0780('0x1a')](_0x1bd1ac);}return null;};}function patchUpdates(_0x5ec7dd){return function(_0x48573a){try{jsonpatch[_0x0780('0x20')](_0x48573a,_0x5ec7dd,!![]);}catch(_0xb767fd){return BPromise[_0x0780('0x21')](_0xb767fd);}return _0x48573a[_0x0780('0x22')]();};}function saveUpdates(_0x3e7730,_0x3227f2){return function(_0x55b954){if(_0x55b954){return _0x55b954[_0x0780('0x23')](_0x3e7730)[_0x0780('0x24')](function(_0xa57b7c){return _0xa57b7c;});}return null;};}function removeEntity(_0x393b59,_0x456a0e){return function(_0x364e74){if(_0x364e74){return _0x364e74['destroy']()[_0x0780('0x24')](function(){_0x393b59[_0x0780('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4543d2,_0x5b787c){return function(_0x1aaffe){if(!_0x1aaffe){_0x4543d2[_0x0780('0x18')](0x194);}return _0x1aaffe;};}function handleError(_0x3bf184,_0x235d17){_0x235d17=_0x235d17||0x1f4;return function(_0x28777a){logger[_0x0780('0x25')](_0x28777a[_0x0780('0x26')]);if(_0x28777a[_0x0780('0x27')]){delete _0x28777a[_0x0780('0x27')];}_0x3bf184[_0x0780('0x19')](_0x235d17)['send'](_0x28777a);};}exports[_0x0780('0x28')]=function(_0x5dd57b,_0x3a88d7){var _0x21cd5d={},_0x55ab89={},_0x267efc={'count':0x0,'rows':[]};var _0x2a33e0=_[_0x0780('0x29')](db['OpenchannelQueueReport'][_0x0780('0x2a')],function(_0x57c31a){return{'name':_0x57c31a[_0x0780('0x2b')],'type':_0x57c31a[_0x0780('0x2c')]['key']};});_0x55ab89[_0x0780('0x2d')]=_[_0x0780('0x29')](_0x2a33e0,_0x0780('0x27'));_0x55ab89['query']=_[_0x0780('0x2e')](_0x5dd57b[_0x0780('0x2f')]);_0x55ab89['filters']=_[_0x0780('0x30')](_0x55ab89[_0x0780('0x2d')],_0x55ab89['query']);_0x21cd5d['attributes']=_[_0x0780('0x30')](_0x55ab89[_0x0780('0x2d')],qs['fields'](_0x5dd57b['query']['fields']));_0x21cd5d[_0x0780('0x31')]=_0x21cd5d[_0x0780('0x31')][_0x0780('0x32')]?_0x21cd5d['attributes']:_0x55ab89[_0x0780('0x2d')];if(!_0x5dd57b[_0x0780('0x2f')][_0x0780('0x33')]('nolimit')){_0x21cd5d[_0x0780('0x1d')]=qs[_0x0780('0x1d')](_0x5dd57b[_0x0780('0x2f')]['limit']);_0x21cd5d['offset']=qs[_0x0780('0x1b')](_0x5dd57b[_0x0780('0x2f')][_0x0780('0x1b')]);}_0x21cd5d[_0x0780('0x34')]=qs[_0x0780('0x35')](_0x5dd57b[_0x0780('0x2f')][_0x0780('0x35')]);_0x21cd5d['where']=qs[_0x0780('0x36')](_['pick'](_0x5dd57b['query'],_0x55ab89['filters']),_0x2a33e0);if(_0x5dd57b['query'][_0x0780('0x37')]){_0x21cd5d[_0x0780('0x38')]=_[_0x0780('0x39')](_0x21cd5d[_0x0780('0x38')],{'$or':_['map'](_0x2a33e0,function(_0x279bcc){if(_0x279bcc[_0x0780('0x2c')]!=='VIRTUAL'){var _0x127044={};_0x127044[_0x279bcc[_0x0780('0x27')]]={'$like':'%'+_0x5dd57b['query'][_0x0780('0x37')]+'%'};return _0x127044;}})});}_0x21cd5d=_[_0x0780('0x39')]({},_0x21cd5d,_0x5dd57b[_0x0780('0x3a')]);var _0x244b11={'where':_0x21cd5d[_0x0780('0x38')]};return db[_0x0780('0x3b')]['count'](_0x244b11)['then'](function(_0x16262d){_0x267efc[_0x0780('0x1e')]=_0x16262d;if(_0x5dd57b[_0x0780('0x2f')][_0x0780('0x3c')]){_0x21cd5d['include']=[{'all':!![]}];}return db[_0x0780('0x3b')][_0x0780('0x3d')](_0x21cd5d);})['then'](function(_0x102b90){_0x267efc[_0x0780('0x3e')]=_0x102b90;return _0x267efc;})[_0x0780('0x24')](respondWithFilteredResult(_0x3a88d7,_0x21cd5d))[_0x0780('0x3f')](handleError(_0x3a88d7,null));};exports[_0x0780('0x40')]=function(_0x4ef853,_0x5d86a0){var _0x4df61f={'raw':!![],'where':{'id':_0x4ef853[_0x0780('0x41')]['id']}},_0x200eb7={};_0x200eb7[_0x0780('0x2d')]=_[_0x0780('0x2e')](db[_0x0780('0x3b')][_0x0780('0x2a')]);_0x200eb7[_0x0780('0x2f')]=_[_0x0780('0x2e')](_0x4ef853[_0x0780('0x2f')]);_0x200eb7[_0x0780('0x36')]=_['intersection'](_0x200eb7[_0x0780('0x2d')],_0x200eb7[_0x0780('0x2f')]);_0x4df61f['attributes']=_['intersection'](_0x200eb7[_0x0780('0x2d')],qs[_0x0780('0x42')](_0x4ef853[_0x0780('0x2f')][_0x0780('0x42')]));_0x4df61f['attributes']=_0x4df61f[_0x0780('0x31')][_0x0780('0x32')]?_0x4df61f[_0x0780('0x31')]:_0x200eb7[_0x0780('0x2d')];if(_0x4ef853[_0x0780('0x2f')][_0x0780('0x3c')]){_0x4df61f[_0x0780('0x43')]=[{'all':!![]}];}_0x4df61f=_[_0x0780('0x39')]({},_0x4df61f,_0x4ef853[_0x0780('0x3a')]);return db[_0x0780('0x3b')][_0x0780('0x44')](_0x4df61f)['then'](handleEntityNotFound(_0x5d86a0,null))[_0x0780('0x24')](respondWithResult(_0x5d86a0,null))[_0x0780('0x3f')](handleError(_0x5d86a0,null));};exports[_0x0780('0x45')]=function(_0x327875,_0x4e4d9b){return db['OpenchannelQueueReport'][_0x0780('0x45')](_0x327875['body'],{})[_0x0780('0x24')](respondWithResult(_0x4e4d9b,0xc9))[_0x0780('0x3f')](handleError(_0x4e4d9b,null));};exports[_0x0780('0x23')]=function(_0x500bf0,_0x33df6e){if(_0x500bf0[_0x0780('0x46')]['id']){delete _0x500bf0[_0x0780('0x46')]['id'];}return db[_0x0780('0x3b')]['find']({'where':{'id':_0x500bf0[_0x0780('0x41')]['id']}})[_0x0780('0x24')](handleEntityNotFound(_0x33df6e,null))[_0x0780('0x24')](saveUpdates(_0x500bf0[_0x0780('0x46')],null))[_0x0780('0x24')](respondWithResult(_0x33df6e,null))['catch'](handleError(_0x33df6e,null));};exports['destroy']=function(_0x24b477,_0xb85e0c){return db[_0x0780('0x3b')][_0x0780('0x44')]({'where':{'id':_0x24b477[_0x0780('0x41')]['id']}})['then'](handleEntityNotFound(_0xb85e0c,null))[_0x0780('0x24')](removeEntity(_0xb85e0c,null))[_0x0780('0x3f')](handleError(_0xb85e0c,null));};exports[_0x0780('0x47')]=function(_0xb1685,_0x5b49eb){return db[_0x0780('0x3b')][_0x0780('0x47')]()[_0x0780('0x24')](respondWithResult(_0x5b49eb,null))[_0x0780('0x3f')](handleError(_0x5b49eb,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 37c37a0..fe85491 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x121506,_0x494111){var _0x2050d5=function(_0x68a4c5){while(--_0x68a4c5){_0x121506['push'](_0x121506['shift']());}};_0x2050d5(++_0x494111);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x2ef3,0xba));var _0x32ef=function(_0x424435,_0x47fbf8){_0x424435=_0x424435-0x0;var _0x57831f=_0x2ef3[_0x424435];return _0x57831f;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('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 a029e2e..22c4086 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 _0x34b7=['create','body','options','raw','then','UpdateOpenchannelQueueReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport'];(function(_0x2c4a0f,_0x399ad2){var _0x46eb4d=function(_0x5d4da3){while(--_0x5d4da3){_0x2c4a0f['push'](_0x2c4a0f['shift']());}};_0x46eb4d(++_0x399ad2);}(_0x34b7,0x196));var _0x734b=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x34b7[_0x1034ca];return _0x1a023a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')](_0x5edbe9[_0x734b('0x18')],{'raw':_0x5edbe9[_0x734b('0x19')]?_0x5edbe9[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![]})[_0x734b('0x1b')](function(_0x67eed){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x67eed));_0x56a95c(_0x67eed);})['catch'](function(_0x1e4dcc){logger[_0x734b('0xf')]('CreateOpenchannelQueueReport',_0x1e4dcc[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1e4dcc[_0x734b('0x12')]));});});};exports[_0x734b('0x1c')]=function(_0x46d432){var _0x26d118=this;return new Promise(function(_0x26eccf,_0x104fff){return db[_0x734b('0x16')][_0x734b('0x1d')](_0x46d432[_0x734b('0x18')],{'raw':_0x46d432[_0x734b('0x19')]?_0x46d432[_0x734b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46d432['options']?_0x46d432[_0x734b('0x19')][_0x734b('0x1e')]||null:null,'attributes':_0x46d432['options']?_0x46d432[_0x734b('0x19')][_0x734b('0x1f')]||null:null,'limit':_0x46d432[_0x734b('0x19')]?_0x46d432[_0x734b('0x19')][_0x734b('0x20')]||null:null})[_0x734b('0x1b')](function(_0x3ba39c){logger['info'](_0x734b('0x1c'),_0x46d432);logger[_0x734b('0xc')](_0x734b('0x1c'),_0x46d432,JSON[_0x734b('0xe')](_0x3ba39c));_0x26eccf(_0x3ba39c);})[_0x734b('0x14')](function(_0x427c36){logger[_0x734b('0xf')](_0x734b('0x1c'),_0x427c36[_0x734b('0x12')],_0x46d432);_0x104fff(_0x26d118[_0x734b('0xf')](0x1f4,_0x427c36['message']));});});}; \ No newline at end of file +var _0x0e56=['OpenchannelQueueReport','update','raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','body','options'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x0e56,0xf5));var _0x60e5=function(_0x11280c,_0x4e8f92){_0x11280c=_0x11280c-0x0;var _0x5999ac=_0x0e56[_0x11280c];return _0x5999ac;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var moment=require('moment');var BPromise=require(_0x60e5('0x2'));var rs=require(_0x60e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60e5('0x4'))['db'];var utils=require(_0x60e5('0x5'));var logger=require(_0x60e5('0x6'))(_0x60e5('0x7'));var config=require(_0x60e5('0x8'));var jayson=require(_0x60e5('0x9'));var client=jayson[_0x60e5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b44b9,_0x5513f2,_0x31765c){return new BPromise(function(_0x3083a0,_0x59389e){return client[_0x60e5('0xb')](_0x1b44b9,_0x31765c)[_0x60e5('0xc')](function(_0x46d531){logger[_0x60e5('0xd')](_0x60e5('0xe'),_0x5513f2,_0x60e5('0xf'));logger[_0x60e5('0x10')](_0x60e5('0x11'),_0x5513f2,_0x60e5('0xf'),JSON[_0x60e5('0x12')](_0x46d531));if(_0x46d531[_0x60e5('0x13')]){if(_0x46d531[_0x60e5('0x13')][_0x60e5('0x14')]===0x1f4){logger[_0x60e5('0x13')](_0x60e5('0xe'),_0x5513f2,_0x46d531[_0x60e5('0x13')]['message']);return _0x59389e(_0x46d531[_0x60e5('0x13')]['message']);}logger['error'](_0x60e5('0xe'),_0x5513f2,_0x46d531[_0x60e5('0x13')]['message']);return _0x3083a0(_0x46d531[_0x60e5('0x13')][_0x60e5('0x15')]);}else{logger[_0x60e5('0xd')](_0x60e5('0xe'),_0x5513f2,'request\x20sent');_0x3083a0(_0x46d531[_0x60e5('0x16')][_0x60e5('0x15')]);}})[_0x60e5('0x17')](function(_0x1ed08d){logger[_0x60e5('0x13')](_0x60e5('0xe'),_0x5513f2,_0x1ed08d);_0x59389e(_0x1ed08d);});});}exports[_0x60e5('0x18')]=function(_0x12aee7){var _0x3060b6=this;return new Promise(function(_0x51688a,_0x599dc4){return db['OpenchannelQueueReport']['create'](_0x12aee7[_0x60e5('0x19')],{'raw':_0x12aee7[_0x60e5('0x1a')]?_0x12aee7[_0x60e5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x60e5('0xc')](function(_0x68c78){logger[_0x60e5('0xd')](_0x60e5('0x18'),_0x12aee7);logger[_0x60e5('0x10')](_0x60e5('0x18'),_0x12aee7,JSON[_0x60e5('0x12')](_0x68c78));_0x51688a(_0x68c78);})[_0x60e5('0x17')](function(_0x443665){logger[_0x60e5('0x13')](_0x60e5('0x18'),_0x443665['message'],_0x12aee7);_0x599dc4(_0x3060b6['error'](0x1f4,_0x443665[_0x60e5('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x5a2b4d){var _0x2c692d=this;return new Promise(function(_0x58e43b,_0x200da3){return db[_0x60e5('0x1b')][_0x60e5('0x1c')](_0x5a2b4d[_0x60e5('0x19')],{'raw':_0x5a2b4d[_0x60e5('0x1a')]?_0x5a2b4d['options'][_0x60e5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a2b4d['options']?_0x5a2b4d[_0x60e5('0x1a')][_0x60e5('0x1e')]||null:null,'attributes':_0x5a2b4d[_0x60e5('0x1a')]?_0x5a2b4d['options'][_0x60e5('0x1f')]||null:null,'limit':_0x5a2b4d[_0x60e5('0x1a')]?_0x5a2b4d['options'][_0x60e5('0x20')]||null:null})[_0x60e5('0xc')](function(_0x46ebed){logger['info'](_0x60e5('0x21'),_0x5a2b4d);logger[_0x60e5('0x10')](_0x60e5('0x21'),_0x5a2b4d,JSON[_0x60e5('0x12')](_0x46ebed));_0x58e43b(_0x46ebed);})[_0x60e5('0x17')](function(_0x40ce94){logger[_0x60e5('0x13')](_0x60e5('0x21'),_0x40ce94[_0x60e5('0x15')],_0x5a2b4d);_0x200da3(_0x2c692d[_0x60e5('0x13')](0x1f4,_0x40ce94[_0x60e5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0f5bfdd..5aac2c9 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 _0x7bfb=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer'];(function(_0x21f827,_0x3b0548){var _0x12763e=function(_0x3335ec){while(--_0x3335ec){_0x21f827['push'](_0x21f827['shift']());}};_0x12763e(++_0x3b0548);}(_0x7bfb,0xa7));var _0xb7bf=function(_0x190145,_0x434ef1){_0x190145=_0x190145-0x0;var _0x540a75=_0x7bfb[_0x190145];return _0x540a75;};'use strict';var multer=require(_0xb7bf('0x0'));var util=require(_0xb7bf('0x1'));var path=require(_0xb7bf('0x2'));var timeout=require(_0xb7bf('0x3'));var express=require(_0xb7bf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb7bf('0x5'));var interaction=require(_0xb7bf('0x6'));var config=require(_0xb7bf('0x7'));var controller=require(_0xb7bf('0x8'));router[_0xb7bf('0x9')]('/',auth[_0xb7bf('0xa')](),controller[_0xb7bf('0xb')]);router[_0xb7bf('0x9')](_0xb7bf('0xc'),auth['isAuthenticated'](),controller[_0xb7bf('0xd')]);router[_0xb7bf('0x9')](_0xb7bf('0xe'),auth[_0xb7bf('0xa')](),controller[_0xb7bf('0xf')]);router[_0xb7bf('0x10')]('/',auth[_0xb7bf('0xa')](),controller[_0xb7bf('0x11')]);router[_0xb7bf('0x12')](_0xb7bf('0xe'),auth[_0xb7bf('0xa')](),controller[_0xb7bf('0x13')]);router[_0xb7bf('0x14')]('/:id',auth[_0xb7bf('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x78cf=['/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x78cf,0xdc));var _0xf78c=function(_0x367b9e,_0x297344){_0x367b9e=_0x367b9e-0x0;var _0x35da40=_0x78cf[_0x367b9e];return _0x35da40;};'use strict';var multer=require(_0xf78c('0x0'));var util=require(_0xf78c('0x1'));var path=require('path');var timeout=require(_0xf78c('0x2'));var express=require(_0xf78c('0x3'));var router=express[_0xf78c('0x4')]();var fs_extra=require(_0xf78c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf78c('0x6'));var config=require(_0xf78c('0x7'));var controller=require(_0xf78c('0x8'));router[_0xf78c('0x9')]('/',auth['isAuthenticated'](),controller[_0xf78c('0xa')]);router['get'](_0xf78c('0xb'),auth[_0xf78c('0xc')](),controller[_0xf78c('0xd')]);router[_0xf78c('0x9')](_0xf78c('0xe'),auth[_0xf78c('0xc')](),controller['show']);router[_0xf78c('0xf')]('/',auth[_0xf78c('0xc')](),controller[_0xf78c('0x10')]);router[_0xf78c('0x11')](_0xf78c('0xe'),auth[_0xf78c('0xc')](),controller[_0xf78c('0x12')]);router[_0xf78c('0x13')](_0xf78c('0xe'),auth[_0xf78c('0xc')](),controller[_0xf78c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 7127999..9163862 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xb43b,0x1b2));var _0xbb43=function(_0x45fccc,_0x7df5e9){_0x45fccc=_0x45fccc-0x0;var _0x43b4f7=_0xb43b[_0x45fccc];return _0x43b4f7;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xb43b,0x1b2));var _0xbb43=function(_0x57fa17,_0x31219d){_0x57fa17=_0x57fa17-0x0;var _0x18be1a=_0xb43b[_0x57fa17];return _0x18be1a;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 75b68fe..6266b1f 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 _0xc435=['sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','order'];(function(_0x27ef38,_0x57ca34){var _0x483525=function(_0x48ce1c){while(--_0x48ce1c){_0x27ef38['push'](_0x27ef38['shift']());}};_0x483525(++_0x57ca34);}(_0xc435,0xfe));var _0x5c43=function(_0xdeeae0,_0x3af457){_0xdeeae0=_0xdeeae0-0x0;var _0x4bc0bb=_0xc435[_0xdeeae0];return _0x4bc0bb;};'use strict';var emlformat=require(_0x5c43('0x0'));var rimraf=require(_0x5c43('0x1'));var zipdir=require(_0x5c43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c43('0x3'));var moment=require(_0x5c43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5c43('0x5'));var util=require('util');var path=require(_0x5c43('0x6'));var sox=require('sox');var csv=require(_0x5c43('0x7'));var ejs=require(_0x5c43('0x8'));var fs=require('fs');var fs_extra=require(_0x5c43('0x9'));var _=require(_0x5c43('0xa'));var squel=require(_0x5c43('0xb'));var crypto=require('crypto');var jsforce=require(_0x5c43('0xc'));var deskjs=require(_0x5c43('0xd'));var toCsv=require(_0x5c43('0x7'));var querystring=require(_0x5c43('0xe'));var Papa=require(_0x5c43('0xf'));var Redis=require(_0x5c43('0x10'));var authService=require(_0x5c43('0x11'));var qs=require(_0x5c43('0x12'));var as=require(_0x5c43('0x13'));var hardwareService=require(_0x5c43('0x14'));var logger=require(_0x5c43('0x15'))(_0x5c43('0x16'));var utils=require(_0x5c43('0x17'));var config=require(_0x5c43('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c43('0x19'))['db'];function respondWithStatusCode(_0x9f6de0,_0x160282){_0x160282=_0x160282||0xcc;return function(_0x166a1f){if(_0x166a1f){return _0x9f6de0['sendStatus'](_0x160282);}return _0x9f6de0[_0x5c43('0x1a')](_0x160282)[_0x5c43('0x1b')]();};}function respondWithResult(_0x1cab89,_0x5dd1b5){_0x5dd1b5=_0x5dd1b5||0xc8;return function(_0x1395ab){if(_0x1395ab){return _0x1cab89['status'](_0x5dd1b5)['json'](_0x1395ab);}};}function respondWithFilteredResult(_0x46929b,_0x5651ae){return function(_0x1fae4f){if(_0x1fae4f){var _0x53cd83=typeof _0x5651ae[_0x5c43('0x1c')]===_0x5c43('0x1d')&&typeof _0x5651ae[_0x5c43('0x1e')]==='undefined';var _0xe4510c=_0x1fae4f[_0x5c43('0x1f')];var _0x1e49f2=_0x53cd83?0x0:_0x5651ae[_0x5c43('0x1c')];var _0x5ab4c7=_0x53cd83?_0x1fae4f[_0x5c43('0x1f')]:_0x5651ae[_0x5c43('0x1c')]+_0x5651ae['limit'];var _0x397d66;if(_0x5ab4c7>=_0xe4510c){_0x5ab4c7=_0xe4510c;_0x397d66=0xc8;}else{_0x397d66=0xce;}_0x46929b[_0x5c43('0x1a')](_0x397d66);return _0x46929b[_0x5c43('0x20')]('Content-Range',_0x1e49f2+'-'+_0x5ab4c7+'/'+_0xe4510c)[_0x5c43('0x21')](_0x1fae4f);}return null;};}function patchUpdates(_0x3f8e24){return function(_0x54a2b8){try{jsonpatch[_0x5c43('0x22')](_0x54a2b8,_0x3f8e24,!![]);}catch(_0x34955e){return BPromise[_0x5c43('0x23')](_0x34955e);}return _0x54a2b8[_0x5c43('0x24')]();};}function saveUpdates(_0x51a4d5,_0x5ad960){return function(_0x3e2f83){if(_0x3e2f83){return _0x3e2f83[_0x5c43('0x25')](_0x51a4d5)[_0x5c43('0x26')](function(_0x4809db){return _0x4809db;});}return null;};}function removeEntity(_0x5492de,_0x23c25d){return function(_0x5916d2){if(_0x5916d2){return _0x5916d2[_0x5c43('0x27')]()[_0x5c43('0x26')](function(){_0x5492de[_0x5c43('0x1a')](0xcc)[_0x5c43('0x1b')]();});}};}function handleEntityNotFound(_0x58a636,_0x46d0f8){return function(_0x304de5){if(!_0x304de5){_0x58a636[_0x5c43('0x28')](0x194);}return _0x304de5;};}function handleError(_0x3b9e79,_0x4b9708){_0x4b9708=_0x4b9708||0x1f4;return function(_0x3cca6f){logger[_0x5c43('0x29')](_0x3cca6f[_0x5c43('0x2a')]);if(_0x3cca6f[_0x5c43('0x2b')]){delete _0x3cca6f[_0x5c43('0x2b')];}_0x3b9e79[_0x5c43('0x1a')](_0x4b9708)[_0x5c43('0x2c')](_0x3cca6f);};}exports['index']=function(_0x30df3d,_0x2fcc0b){var _0x2219e6={},_0x15e3c9={},_0x2458e4={'count':0x0,'rows':[]};var _0x403ae8=_[_0x5c43('0x2d')](db[_0x5c43('0x2e')][_0x5c43('0x2f')],function(_0x2d7ea2){return{'name':_0x2d7ea2[_0x5c43('0x30')],'type':_0x2d7ea2['type'][_0x5c43('0x31')]};});_0x15e3c9[_0x5c43('0x32')]=_[_0x5c43('0x2d')](_0x403ae8,_0x5c43('0x2b'));_0x15e3c9[_0x5c43('0x33')]=_['keys'](_0x30df3d[_0x5c43('0x33')]);_0x15e3c9[_0x5c43('0x34')]=_[_0x5c43('0x35')](_0x15e3c9['model'],_0x15e3c9[_0x5c43('0x33')]);_0x2219e6['attributes']=_[_0x5c43('0x35')](_0x15e3c9[_0x5c43('0x32')],qs[_0x5c43('0x36')](_0x30df3d['query']['fields']));_0x2219e6[_0x5c43('0x37')]=_0x2219e6[_0x5c43('0x37')]['length']?_0x2219e6[_0x5c43('0x37')]:_0x15e3c9[_0x5c43('0x32')];if(!_0x30df3d[_0x5c43('0x33')]['hasOwnProperty'](_0x5c43('0x38'))){_0x2219e6[_0x5c43('0x1e')]=qs[_0x5c43('0x1e')](_0x30df3d[_0x5c43('0x33')]['limit']);_0x2219e6[_0x5c43('0x1c')]=qs[_0x5c43('0x1c')](_0x30df3d[_0x5c43('0x33')][_0x5c43('0x1c')]);}_0x2219e6[_0x5c43('0x39')]=qs[_0x5c43('0x3a')](_0x30df3d[_0x5c43('0x33')][_0x5c43('0x3a')]);_0x2219e6[_0x5c43('0x3b')]=qs['filters'](_['pick'](_0x30df3d[_0x5c43('0x33')],_0x15e3c9[_0x5c43('0x34')]),_0x403ae8);if(_0x30df3d[_0x5c43('0x33')][_0x5c43('0x3c')]){_0x2219e6[_0x5c43('0x3b')]=_['merge'](_0x2219e6[_0x5c43('0x3b')],{'$or':_['map'](_0x403ae8,function(_0x11c013){if(_0x11c013[_0x5c43('0x3d')]!==_0x5c43('0x3e')){var _0x431e00={};_0x431e00[_0x11c013['name']]={'$like':'%'+_0x30df3d['query'][_0x5c43('0x3c')]+'%'};return _0x431e00;}})});}_0x2219e6=_[_0x5c43('0x3f')]({},_0x2219e6,_0x30df3d[_0x5c43('0x40')]);var _0x44d9fa={'where':_0x2219e6[_0x5c43('0x3b')]};return db['OpenchannelTransferReport'][_0x5c43('0x1f')](_0x44d9fa)['then'](function(_0x2abf7f){_0x2458e4[_0x5c43('0x1f')]=_0x2abf7f;if(_0x30df3d[_0x5c43('0x33')][_0x5c43('0x41')]){_0x2219e6['include']=[{'all':!![]}];}return db[_0x5c43('0x2e')][_0x5c43('0x42')](_0x2219e6);})['then'](function(_0x2342a0){_0x2458e4[_0x5c43('0x43')]=_0x2342a0;return _0x2458e4;})[_0x5c43('0x26')](respondWithFilteredResult(_0x2fcc0b,_0x2219e6))[_0x5c43('0x44')](handleError(_0x2fcc0b,null));};exports[_0x5c43('0x45')]=function(_0x5d402c,_0x404fec){var _0xe3faad={'raw':!![],'where':{'id':_0x5d402c[_0x5c43('0x46')]['id']}},_0x6ee17b={};_0x6ee17b[_0x5c43('0x32')]=_[_0x5c43('0x47')](db[_0x5c43('0x2e')][_0x5c43('0x2f')]);_0x6ee17b['query']=_[_0x5c43('0x47')](_0x5d402c[_0x5c43('0x33')]);_0x6ee17b[_0x5c43('0x34')]=_[_0x5c43('0x35')](_0x6ee17b[_0x5c43('0x32')],_0x6ee17b[_0x5c43('0x33')]);_0xe3faad['attributes']=_[_0x5c43('0x35')](_0x6ee17b[_0x5c43('0x32')],qs['fields'](_0x5d402c['query']['fields']));_0xe3faad['attributes']=_0xe3faad['attributes'][_0x5c43('0x48')]?_0xe3faad[_0x5c43('0x37')]:_0x6ee17b[_0x5c43('0x32')];if(_0x5d402c[_0x5c43('0x33')][_0x5c43('0x41')]){_0xe3faad[_0x5c43('0x49')]=[{'all':!![]}];}_0xe3faad=_['merge']({},_0xe3faad,_0x5d402c[_0x5c43('0x40')]);return db[_0x5c43('0x2e')][_0x5c43('0x4a')](_0xe3faad)[_0x5c43('0x26')](handleEntityNotFound(_0x404fec,null))[_0x5c43('0x26')](respondWithResult(_0x404fec,null))['catch'](handleError(_0x404fec,null));};exports[_0x5c43('0x4b')]=function(_0x3a4443,_0x97d77d){return db[_0x5c43('0x2e')][_0x5c43('0x4b')](_0x3a4443[_0x5c43('0x4c')],{})[_0x5c43('0x26')](respondWithResult(_0x97d77d,0xc9))[_0x5c43('0x44')](handleError(_0x97d77d,null));};exports[_0x5c43('0x25')]=function(_0x55b26f,_0x1cf97c){if(_0x55b26f[_0x5c43('0x4c')]['id']){delete _0x55b26f[_0x5c43('0x4c')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x55b26f['params']['id']}})[_0x5c43('0x26')](handleEntityNotFound(_0x1cf97c,null))[_0x5c43('0x26')](saveUpdates(_0x55b26f[_0x5c43('0x4c')],null))['then'](respondWithResult(_0x1cf97c,null))['catch'](handleError(_0x1cf97c,null));};exports[_0x5c43('0x27')]=function(_0x3f11b5,_0x15472a){return db[_0x5c43('0x2e')][_0x5c43('0x4a')]({'where':{'id':_0x3f11b5[_0x5c43('0x46')]['id']}})['then'](handleEntityNotFound(_0x15472a,null))['then'](removeEntity(_0x15472a,null))[_0x5c43('0x44')](handleError(_0x15472a,null));};exports['describe']=function(_0x3295bc,_0x2e812e){return db[_0x5c43('0x2e')][_0x5c43('0x4d')]()[_0x5c43('0x26')](respondWithResult(_0x2e812e,null))['catch'](handleError(_0x2e812e,null));}; \ No newline at end of file +var _0x0faf=['util','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','reject','update','then','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','findAll','rows','catch','show','includeAll','include','create','body','find','params','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x2fcc61,_0x1498b8){var _0x3a2e3d=function(_0x26b05f){while(--_0x26b05f){_0x2fcc61['push'](_0x2fcc61['shift']());}};_0x3a2e3d(++_0x1498b8);}(_0x0faf,0x8b));var _0xf0fa=function(_0x170bba,_0x2be92f){_0x170bba=_0x170bba-0x0;var _0xa7c249=_0x0faf[_0x170bba];return _0xa7c249;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0fa('0x0'));var jsonpatch=require(_0xf0fa('0x1'));var rp=require(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0fa('0x4'));var util=require(_0xf0fa('0x5'));var path=require('path');var sox=require(_0xf0fa('0x6'));var csv=require('to-csv');var ejs=require(_0xf0fa('0x7'));var fs=require('fs');var fs_extra=require(_0xf0fa('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf0fa('0x9'));var jsforce=require(_0xf0fa('0xa'));var deskjs=require(_0xf0fa('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf0fa('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf0fa('0xd'));var qs=require(_0xf0fa('0xe'));var as=require(_0xf0fa('0xf'));var hardwareService=require(_0xf0fa('0x10'));var logger=require(_0xf0fa('0x11'))(_0xf0fa('0x12'));var utils=require(_0xf0fa('0x13'));var config=require(_0xf0fa('0x14'));var licenseUtil=require(_0xf0fa('0x15'));var db=require(_0xf0fa('0x16'))['db'];function respondWithStatusCode(_0x561def,_0x20cb85){_0x20cb85=_0x20cb85||0xcc;return function(_0xbc09d5){if(_0xbc09d5){return _0x561def[_0xf0fa('0x17')](_0x20cb85);}return _0x561def[_0xf0fa('0x18')](_0x20cb85)[_0xf0fa('0x19')]();};}function respondWithResult(_0x13dee4,_0x3b35b3){_0x3b35b3=_0x3b35b3||0xc8;return function(_0x18ef44){if(_0x18ef44){return _0x13dee4[_0xf0fa('0x18')](_0x3b35b3)[_0xf0fa('0x1a')](_0x18ef44);}};}function respondWithFilteredResult(_0x164141,_0x2eb7bc){return function(_0x689a39){if(_0x689a39){var _0x500410=typeof _0x2eb7bc[_0xf0fa('0x1b')]==='undefined'&&typeof _0x2eb7bc['limit']==='undefined';var _0x66649b=_0x689a39['count'];var _0x36e122=_0x500410?0x0:_0x2eb7bc[_0xf0fa('0x1b')];var _0x2d5382=_0x500410?_0x689a39[_0xf0fa('0x1c')]:_0x2eb7bc['offset']+_0x2eb7bc['limit'];var _0xc76462;if(_0x2d5382>=_0x66649b){_0x2d5382=_0x66649b;_0xc76462=0xc8;}else{_0xc76462=0xce;}_0x164141['status'](_0xc76462);return _0x164141[_0xf0fa('0x1d')](_0xf0fa('0x1e'),_0x36e122+'-'+_0x2d5382+'/'+_0x66649b)[_0xf0fa('0x1a')](_0x689a39);}return null;};}function patchUpdates(_0x2e0ad2){return function(_0x17d0ad){try{jsonpatch['apply'](_0x17d0ad,_0x2e0ad2,!![]);}catch(_0x570671){return BPromise[_0xf0fa('0x1f')](_0x570671);}return _0x17d0ad['save']();};}function saveUpdates(_0x517541,_0x973547){return function(_0x5b1b87){if(_0x5b1b87){return _0x5b1b87[_0xf0fa('0x20')](_0x517541)[_0xf0fa('0x21')](function(_0x482099){return _0x482099;});}return null;};}function removeEntity(_0x328f0f,_0x3376c1){return function(_0x46658e){if(_0x46658e){return _0x46658e['destroy']()['then'](function(){_0x328f0f[_0xf0fa('0x18')](0xcc)[_0xf0fa('0x19')]();});}};}function handleEntityNotFound(_0x566edb,_0x422ff0){return function(_0xd6e972){if(!_0xd6e972){_0x566edb['sendStatus'](0x194);}return _0xd6e972;};}function handleError(_0x2d09c3,_0x5cf9e5){_0x5cf9e5=_0x5cf9e5||0x1f4;return function(_0x2837da){logger[_0xf0fa('0x22')](_0x2837da[_0xf0fa('0x23')]);if(_0x2837da[_0xf0fa('0x24')]){delete _0x2837da[_0xf0fa('0x24')];}_0x2d09c3[_0xf0fa('0x18')](_0x5cf9e5)[_0xf0fa('0x25')](_0x2837da);};}exports[_0xf0fa('0x26')]=function(_0x4594d8,_0x4a9099){var _0x1e2461={},_0x495d9d={},_0x1b2bd9={'count':0x0,'rows':[]};var _0x54ca68=_[_0xf0fa('0x27')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x2a25b9){return{'name':_0x2a25b9[_0xf0fa('0x28')],'type':_0x2a25b9[_0xf0fa('0x29')]['key']};});_0x495d9d['model']=_[_0xf0fa('0x27')](_0x54ca68,_0xf0fa('0x24'));_0x495d9d[_0xf0fa('0x2a')]=_[_0xf0fa('0x2b')](_0x4594d8['query']);_0x495d9d[_0xf0fa('0x2c')]=_[_0xf0fa('0x2d')](_0x495d9d[_0xf0fa('0x2e')],_0x495d9d[_0xf0fa('0x2a')]);_0x1e2461[_0xf0fa('0x2f')]=_[_0xf0fa('0x2d')](_0x495d9d[_0xf0fa('0x2e')],qs[_0xf0fa('0x30')](_0x4594d8[_0xf0fa('0x2a')][_0xf0fa('0x30')]));_0x1e2461[_0xf0fa('0x2f')]=_0x1e2461[_0xf0fa('0x2f')][_0xf0fa('0x31')]?_0x1e2461[_0xf0fa('0x2f')]:_0x495d9d[_0xf0fa('0x2e')];if(!_0x4594d8[_0xf0fa('0x2a')][_0xf0fa('0x32')](_0xf0fa('0x33'))){_0x1e2461[_0xf0fa('0x34')]=qs['limit'](_0x4594d8['query'][_0xf0fa('0x34')]);_0x1e2461['offset']=qs[_0xf0fa('0x1b')](_0x4594d8[_0xf0fa('0x2a')][_0xf0fa('0x1b')]);}_0x1e2461[_0xf0fa('0x35')]=qs[_0xf0fa('0x36')](_0x4594d8[_0xf0fa('0x2a')][_0xf0fa('0x36')]);_0x1e2461[_0xf0fa('0x37')]=qs[_0xf0fa('0x2c')](_[_0xf0fa('0x38')](_0x4594d8[_0xf0fa('0x2a')],_0x495d9d[_0xf0fa('0x2c')]),_0x54ca68);if(_0x4594d8['query'][_0xf0fa('0x39')]){_0x1e2461[_0xf0fa('0x37')]=_[_0xf0fa('0x3a')](_0x1e2461[_0xf0fa('0x37')],{'$or':_[_0xf0fa('0x27')](_0x54ca68,function(_0x1e0837){if(_0x1e0837[_0xf0fa('0x29')]!==_0xf0fa('0x3b')){var _0x343076={};_0x343076[_0x1e0837[_0xf0fa('0x24')]]={'$like':'%'+_0x4594d8[_0xf0fa('0x2a')][_0xf0fa('0x39')]+'%'};return _0x343076;}})});}_0x1e2461=_['merge']({},_0x1e2461,_0x4594d8[_0xf0fa('0x3c')]);var _0x44fb9a={'where':_0x1e2461['where']};return db[_0xf0fa('0x3d')][_0xf0fa('0x1c')](_0x44fb9a)[_0xf0fa('0x21')](function(_0xb9aeb0){_0x1b2bd9['count']=_0xb9aeb0;if(_0x4594d8[_0xf0fa('0x2a')]['includeAll']){_0x1e2461['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xf0fa('0x3e')](_0x1e2461);})[_0xf0fa('0x21')](function(_0x3190be){_0x1b2bd9[_0xf0fa('0x3f')]=_0x3190be;return _0x1b2bd9;})[_0xf0fa('0x21')](respondWithFilteredResult(_0x4a9099,_0x1e2461))[_0xf0fa('0x40')](handleError(_0x4a9099,null));};exports[_0xf0fa('0x41')]=function(_0x5522b5,_0x25c61f){var _0x29203d={'raw':!![],'where':{'id':_0x5522b5['params']['id']}},_0x1bf118={};_0x1bf118['model']=_[_0xf0fa('0x2b')](db[_0xf0fa('0x3d')]['rawAttributes']);_0x1bf118['query']=_[_0xf0fa('0x2b')](_0x5522b5[_0xf0fa('0x2a')]);_0x1bf118['filters']=_[_0xf0fa('0x2d')](_0x1bf118['model'],_0x1bf118[_0xf0fa('0x2a')]);_0x29203d[_0xf0fa('0x2f')]=_['intersection'](_0x1bf118[_0xf0fa('0x2e')],qs[_0xf0fa('0x30')](_0x5522b5[_0xf0fa('0x2a')][_0xf0fa('0x30')]));_0x29203d[_0xf0fa('0x2f')]=_0x29203d['attributes'][_0xf0fa('0x31')]?_0x29203d[_0xf0fa('0x2f')]:_0x1bf118[_0xf0fa('0x2e')];if(_0x5522b5[_0xf0fa('0x2a')][_0xf0fa('0x42')]){_0x29203d[_0xf0fa('0x43')]=[{'all':!![]}];}_0x29203d=_[_0xf0fa('0x3a')]({},_0x29203d,_0x5522b5[_0xf0fa('0x3c')]);return db[_0xf0fa('0x3d')]['find'](_0x29203d)[_0xf0fa('0x21')](handleEntityNotFound(_0x25c61f,null))[_0xf0fa('0x21')](respondWithResult(_0x25c61f,null))['catch'](handleError(_0x25c61f,null));};exports['create']=function(_0x5989b9,_0x5b53a1){return db[_0xf0fa('0x3d')][_0xf0fa('0x44')](_0x5989b9['body'],{})[_0xf0fa('0x21')](respondWithResult(_0x5b53a1,0xc9))[_0xf0fa('0x40')](handleError(_0x5b53a1,null));};exports[_0xf0fa('0x20')]=function(_0x3e9591,_0x581454){if(_0x3e9591[_0xf0fa('0x45')]['id']){delete _0x3e9591[_0xf0fa('0x45')]['id'];}return db[_0xf0fa('0x3d')][_0xf0fa('0x46')]({'where':{'id':_0x3e9591[_0xf0fa('0x47')]['id']}})[_0xf0fa('0x21')](handleEntityNotFound(_0x581454,null))[_0xf0fa('0x21')](saveUpdates(_0x3e9591[_0xf0fa('0x45')],null))['then'](respondWithResult(_0x581454,null))[_0xf0fa('0x40')](handleError(_0x581454,null));};exports['destroy']=function(_0x253137,_0x47381d){return db[_0xf0fa('0x3d')]['find']({'where':{'id':_0x253137[_0xf0fa('0x47')]['id']}})[_0xf0fa('0x21')](handleEntityNotFound(_0x47381d,null))['then'](removeEntity(_0x47381d,null))[_0xf0fa('0x40')](handleError(_0x47381d,null));};exports['describe']=function(_0x599a73,_0x411b88){return db[_0xf0fa('0x3d')]['describe']()[_0xf0fa('0x21')](respondWithResult(_0x411b88,null))[_0xf0fa('0x40')](handleError(_0x411b88,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d4bdcd1..9ced121 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 _0x2784=['./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','../../config/logger','moment','bluebird','request-promise'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x2784,0xcb));var _0x4278=function(_0x4be06c,_0x229f25){_0x4be06c=_0x4be06c-0x0;var _0x2a0fb6=_0x2784[_0x4be06c];return _0x2a0fb6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4278('0x0'))('api');var moment=require(_0x4278('0x1'));var BPromise=require(_0x4278('0x2'));var rp=require(_0x4278('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4278('0x4'));module['exports']=function(_0x10db22,_0x163e15){return _0x10db22[_0x4278('0x5')](_0x4278('0x6'),attributes,{'tableName':_0x4278('0x7'),'paranoid':![],'indexes':[{'name':_0x4278('0x8'),'fields':[_0x4278('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc966=['report_openchannel_transfer','uniqueid','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','OpenchannelTransferReport'];(function(_0x461ddb,_0x1703ce){var _0x45dbfa=function(_0x1c89a9){while(--_0x1c89a9){_0x461ddb['push'](_0x461ddb['shift']());}};_0x45dbfa(++_0x1703ce);}(_0xc966,0x178));var _0x6c96=function(_0x4ccb4d,_0x2b7e8b){_0x4ccb4d=_0x4ccb4d-0x0;var _0x542af8=_0xc966[_0x4ccb4d];return _0x542af8;};'use strict';var _=require('lodash');var util=require(_0x6c96('0x0'));var logger=require('../../config/logger')(_0x6c96('0x1'));var moment=require(_0x6c96('0x2'));var BPromise=require('bluebird');var rp=require(_0x6c96('0x3'));var fs=require('fs');var path=require(_0x6c96('0x4'));var rimraf=require(_0x6c96('0x5'));var config=require(_0x6c96('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x6c96('0x7')]=function(_0x427776,_0x1d1e1){return _0x427776['define'](_0x6c96('0x8'),attributes,{'tableName':_0x6c96('0x9'),'paranoid':![],'indexes':[{'name':_0x6c96('0xa'),'fields':[_0x6c96('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index e77c5ec..3d09a07 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 _0x72a2=['info','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x2cbf43,_0x3ed416){var _0x2d256f=function(_0xb8f9f8){while(--_0xb8f9f8){_0x2cbf43['push'](_0x2cbf43['shift']());}};_0x2d256f(++_0x3ed416);}(_0x72a2,0x161));var _0x272a=function(_0x2a68fd,_0xbbab05){_0x2a68fd=_0x2a68fd-0x0;var _0x5c9d2f=_0x72a2[_0x2a68fd];return _0x5c9d2f;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var moment=require(_0x272a('0x1'));var BPromise=require(_0x272a('0x2'));var rs=require(_0x272a('0x3'));var fs=require('fs');var Redis=require(_0x272a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x272a('0x5'));var logger=require('../../config/logger')(_0x272a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x272a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43d188,_0x220b90,_0x283070){return new BPromise(function(_0x54dbfb,_0x484f88){return client[_0x272a('0x8')](_0x43d188,_0x283070)['then'](function(_0x830fb6){logger['info'](_0x272a('0x9'),_0x220b90,_0x272a('0xa'));logger[_0x272a('0xb')](_0x272a('0xc'),_0x220b90,'request\x20sent',JSON['stringify'](_0x830fb6));if(_0x830fb6[_0x272a('0xd')]){if(_0x830fb6[_0x272a('0xd')]['code']===0x1f4){logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x484f88(_0x830fb6[_0x272a('0xd')]['message']);}logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x54dbfb(_0x830fb6['error'][_0x272a('0xe')]);}else{logger[_0x272a('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x220b90,'request\x20sent');_0x54dbfb(_0x830fb6['result']['message']);}})['catch'](function(_0x567955){logger[_0x272a('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x220b90,_0x567955);_0x484f88(_0x567955);});});} \ No newline at end of file +var _0x4074=['jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4074,0xf0));var _0x4407=function(_0x516f00,_0x1dd085){_0x516f00=_0x516f00-0x0;var _0x1fe059=_0x4074[_0x516f00];return _0x1fe059;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var moment=require(_0x4407('0x2'));var BPromise=require('bluebird');var rs=require(_0x4407('0x3'));var fs=require('fs');var Redis=require(_0x4407('0x4'));var db=require(_0x4407('0x5'))['db'];var utils=require(_0x4407('0x6'));var logger=require(_0x4407('0x7'))(_0x4407('0x8'));var config=require(_0x4407('0x9'));var jayson=require(_0x4407('0xa'));var client=jayson[_0x4407('0xb')][_0x4407('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4933cf,_0x988538,_0x5f0699){return new BPromise(function(_0x414f0a,_0x3c1aee){return client[_0x4407('0xd')](_0x4933cf,_0x5f0699)['then'](function(_0x5e70a5){logger['info'](_0x4407('0xe'),_0x988538,_0x4407('0xf'));logger[_0x4407('0x10')](_0x4407('0x11'),_0x988538,_0x4407('0xf'),JSON[_0x4407('0x12')](_0x5e70a5));if(_0x5e70a5[_0x4407('0x13')]){if(_0x5e70a5[_0x4407('0x13')][_0x4407('0x14')]===0x1f4){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x5e70a5['error'][_0x4407('0x15')]);return _0x3c1aee(_0x5e70a5[_0x4407('0x13')]['message']);}logger[_0x4407('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x988538,_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);return _0x414f0a(_0x5e70a5[_0x4407('0x13')][_0x4407('0x15')]);}else{logger[_0x4407('0x16')](_0x4407('0xe'),_0x988538,_0x4407('0xf'));_0x414f0a(_0x5e70a5[_0x4407('0x17')]['message']);}})[_0x4407('0x18')](function(_0x65b20b){logger[_0x4407('0x13')](_0x4407('0xe'),_0x988538,_0x65b20b);_0x3c1aee(_0x65b20b);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 78d1242..9c7f003 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 _0x7373=['../../components/interaction/service','../../config/environment','./pause.controller','get','/:id','show','post','isAuthenticated','create','put','update','destroy','multer','util','path','connect-timeout','fs-extra'];(function(_0x39c21f,_0x5b2f70){var _0x45a244=function(_0x21ee53){while(--_0x21ee53){_0x39c21f['push'](_0x39c21f['shift']());}};_0x45a244(++_0x5b2f70);}(_0x7373,0x182));var _0x3737=function(_0x66f647,_0x4d5140){_0x66f647=_0x66f647-0x0;var _0xd1c9fd=_0x7373[_0x66f647];return _0xd1c9fd;};'use strict';var multer=require(_0x3737('0x0'));var util=require(_0x3737('0x1'));var path=require(_0x3737('0x2'));var timeout=require(_0x3737('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3737('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3737('0x5'));var config=require(_0x3737('0x6'));var controller=require(_0x3737('0x7'));router[_0x3737('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3737('0x8')](_0x3737('0x9'),auth['isAuthenticated'](),controller[_0x3737('0xa')]);router[_0x3737('0xb')]('/',auth[_0x3737('0xc')](),controller[_0x3737('0xd')]);router[_0x3737('0xe')](_0x3737('0x9'),auth[_0x3737('0xc')](),controller[_0x3737('0xf')]);router['delete']('/:id',auth[_0x3737('0xc')](),controller[_0x3737('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3c9c=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','/:id','isAuthenticated','show','post','put','update','delete','exports','util'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0x3c9c,0x131));var _0xc3c9=function(_0x3b5233,_0x2fb4c9){_0x3b5233=_0x3b5233-0x0;var _0x39cda9=_0x3c9c[_0x3b5233];return _0x39cda9;};'use strict';var multer=require('multer');var util=require(_0xc3c9('0x0'));var path=require(_0xc3c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xc3c9('0x2'));var router=express[_0xc3c9('0x3')]();var fs_extra=require(_0xc3c9('0x4'));var auth=require(_0xc3c9('0x5'));var interaction=require(_0xc3c9('0x6'));var config=require(_0xc3c9('0x7'));var controller=require(_0xc3c9('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc3c9('0x9')](_0xc3c9('0xa'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0xc')]);router[_0xc3c9('0xd')]('/',auth[_0xc3c9('0xb')](),controller['create']);router[_0xc3c9('0xe')]('/:id',auth[_0xc3c9('0xb')](),controller[_0xc3c9('0xf')]);router[_0xc3c9('0x10')](_0xc3c9('0xa'),auth[_0xc3c9('0xb')](),controller['destroy']);module[_0xc3c9('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 4ed87ec..49db12b 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 _0xfda1=['name','STRING','sequelize','exports'];(function(_0x1fd574,_0x481ace){var _0x49917b=function(_0x35a3ca){while(--_0x35a3ca){_0x1fd574['push'](_0x1fd574['shift']());}};_0x49917b(++_0x481ace);}(_0xfda1,0x1d6));var _0x1fda=function(_0x2a6732,_0xab0429){_0x2a6732=_0x2a6732-0x0;var _0x16698c=_0xfda1[_0x2a6732];return _0x16698c;};'use strict';var Sequelize=require(_0x1fda('0x0'));module[_0x1fda('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1fda('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1fda('0x3')]}}; \ No newline at end of file +var _0x7bfe=['name','exports','STRING'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x7bfe,0x1e1));var _0xe7bf=function(_0x141a36,_0x19e9d9){_0x141a36=_0x141a36-0x0;var _0x3d283e=_0x7bfe[_0x141a36];return _0x3d283e;};'use strict';var Sequelize=require('sequelize');module[_0xe7bf('0x0')]={'name':{'type':Sequelize[_0xe7bf('0x1')],'unique':_0xe7bf('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6dd6302..9c87380 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 _0xf31b=['merge','includeAll','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','Pauses','then','error','name','send','index','map','Pause','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','filter'];(function(_0x43f9d8,_0x4f5a7a){var _0x4c0720=function(_0xbfef72){while(--_0xbfef72){_0x43f9d8['push'](_0x43f9d8['shift']());}};_0x4c0720(++_0x4f5a7a);}(_0xf31b,0xaa));var _0xbf31=function(_0x1a9698,_0x20ca45){_0x1a9698=_0x1a9698-0x0;var _0x441e0c=_0xf31b[_0x1a9698];return _0x441e0c;};'use strict';var emlformat=require(_0xbf31('0x0'));var rimraf=require(_0xbf31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf31('0x2'));var rp=require(_0xbf31('0x3'));var moment=require(_0xbf31('0x4'));var BPromise=require(_0xbf31('0x5'));var Mustache=require(_0xbf31('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbf31('0x7'));var csv=require(_0xbf31('0x8'));var ejs=require(_0xbf31('0x9'));var fs=require('fs');var fs_extra=require(_0xbf31('0xa'));var _=require(_0xbf31('0xb'));var squel=require(_0xbf31('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbf31('0xd'));var toCsv=require(_0xbf31('0x8'));var querystring=require(_0xbf31('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbf31('0xf'));var qs=require(_0xbf31('0x10'));var as=require(_0xbf31('0x11'));var hardwareService=require(_0xbf31('0x12'));var logger=require(_0xbf31('0x13'))(_0xbf31('0x14'));var utils=require(_0xbf31('0x15'));var config=require(_0xbf31('0x16'));var licenseUtil=require(_0xbf31('0x17'));var db=require(_0xbf31('0x18'))['db'];function respondWithStatusCode(_0x31ac53,_0x46f686){_0x46f686=_0x46f686||0xcc;return function(_0x564c6a){if(_0x564c6a){return _0x31ac53[_0xbf31('0x19')](_0x46f686);}return _0x31ac53[_0xbf31('0x1a')](_0x46f686)['end']();};}function respondWithResult(_0x53c128,_0x190ea4){_0x190ea4=_0x190ea4||0xc8;return function(_0xc6715){if(_0xc6715){return _0x53c128[_0xbf31('0x1a')](_0x190ea4)[_0xbf31('0x1b')](_0xc6715);}};}function respondWithFilteredResult(_0x4a4d45,_0x4bd1a3){return function(_0x436eda){if(_0x436eda){var _0x24c46d=typeof _0x4bd1a3['offset']===_0xbf31('0x1c')&&typeof _0x4bd1a3['limit']===_0xbf31('0x1c');var _0x38eaec=_0x436eda['count'];var _0x993e7e=_0x24c46d?0x0:_0x4bd1a3['offset'];var _0x239793=_0x24c46d?_0x436eda[_0xbf31('0x1d')]:_0x4bd1a3[_0xbf31('0x1e')]+_0x4bd1a3[_0xbf31('0x1f')];var _0x536de3;if(_0x239793>=_0x38eaec){_0x239793=_0x38eaec;_0x536de3=0xc8;}else{_0x536de3=0xce;}_0x4a4d45['status'](_0x536de3);return _0x4a4d45[_0xbf31('0x20')](_0xbf31('0x21'),_0x993e7e+'-'+_0x239793+'/'+_0x38eaec)[_0xbf31('0x1b')](_0x436eda);}return null;};}function patchUpdates(_0x145d12){return function(_0x19d33b){try{jsonpatch['apply'](_0x19d33b,_0x145d12,!![]);}catch(_0x3a5b6c){return BPromise[_0xbf31('0x22')](_0x3a5b6c);}return _0x19d33b[_0xbf31('0x23')]();};}function saveUpdates(_0x21f216,_0xd71d95){return function(_0x4d3642){if(_0x4d3642){return _0x4d3642[_0xbf31('0x24')](_0x21f216)['then'](function(_0x1e691a){return _0x1e691a;});}return null;};}function removeEntity(_0x2df4b0,_0x5186ce){return function(_0x1748c0){if(_0x1748c0){return _0x1748c0[_0xbf31('0x25')]()['then'](function(){var _0x43ebaf=_0x1748c0[_0xbf31('0x26')]({'plain':!![]});var _0x4de8e7=_0xbf31('0x27');return db['UserProfileResource'][_0xbf31('0x25')]({'where':{'type':_0x4de8e7,'resourceId':_0x43ebaf['id']}})[_0xbf31('0x28')](function(){return _0x1748c0;});})[_0xbf31('0x28')](function(){_0x2df4b0[_0xbf31('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bfb02,_0x38a237){return function(_0x31bcbe){if(!_0x31bcbe){_0x3bfb02['sendStatus'](0x194);}return _0x31bcbe;};}function handleError(_0x3c64a2,_0x3a9143){_0x3a9143=_0x3a9143||0x1f4;return function(_0x5e83d1){logger[_0xbf31('0x29')](_0x5e83d1['stack']);if(_0x5e83d1['name']){delete _0x5e83d1[_0xbf31('0x2a')];}_0x3c64a2['status'](_0x3a9143)[_0xbf31('0x2b')](_0x5e83d1);};}exports[_0xbf31('0x2c')]=function(_0xebd8b5,_0x16df50){var _0x229045={},_0x38edf2={},_0x29bb0a={'count':0x0,'rows':[]};var _0x4bfca4=_[_0xbf31('0x2d')](db[_0xbf31('0x2e')]['rawAttributes'],function(_0x1c2452){return{'name':_0x1c2452[_0xbf31('0x2f')],'type':_0x1c2452[_0xbf31('0x30')]['key']};});_0x38edf2['model']=_[_0xbf31('0x2d')](_0x4bfca4,_0xbf31('0x2a'));_0x38edf2[_0xbf31('0x31')]=_[_0xbf31('0x32')](_0xebd8b5[_0xbf31('0x31')]);_0x38edf2['filters']=_[_0xbf31('0x33')](_0x38edf2[_0xbf31('0x34')],_0x38edf2['query']);_0x229045[_0xbf31('0x35')]=_[_0xbf31('0x33')](_0x38edf2[_0xbf31('0x34')],qs[_0xbf31('0x36')](_0xebd8b5['query']['fields']));_0x229045['attributes']=_0x229045['attributes']['length']?_0x229045['attributes']:_0x38edf2[_0xbf31('0x34')];if(!_0xebd8b5[_0xbf31('0x31')][_0xbf31('0x37')]('nolimit')){_0x229045[_0xbf31('0x1f')]=qs['limit'](_0xebd8b5[_0xbf31('0x31')][_0xbf31('0x1f')]);_0x229045['offset']=qs['offset'](_0xebd8b5[_0xbf31('0x31')][_0xbf31('0x1e')]);}_0x229045[_0xbf31('0x38')]=qs[_0xbf31('0x39')](_0xebd8b5[_0xbf31('0x31')][_0xbf31('0x39')]);_0x229045[_0xbf31('0x3a')]=qs[_0xbf31('0x3b')](_['pick'](_0xebd8b5[_0xbf31('0x31')],_0x38edf2[_0xbf31('0x3b')]),_0x4bfca4);if(_0xebd8b5[_0xbf31('0x31')][_0xbf31('0x3c')]){_0x229045[_0xbf31('0x3a')]=_[_0xbf31('0x3d')](_0x229045[_0xbf31('0x3a')],{'$or':_['map'](_0x4bfca4,function(_0x124a42){if(_0x124a42[_0xbf31('0x30')]!=='VIRTUAL'){var _0x1b3724={};_0x1b3724[_0x124a42[_0xbf31('0x2a')]]={'$like':'%'+_0xebd8b5[_0xbf31('0x31')][_0xbf31('0x3c')]+'%'};return _0x1b3724;}})});}_0x229045=_[_0xbf31('0x3d')]({},_0x229045,_0xebd8b5['options']);var _0x134060={'where':_0x229045[_0xbf31('0x3a')]};return db[_0xbf31('0x2e')][_0xbf31('0x1d')](_0x134060)[_0xbf31('0x28')](function(_0x59540a){_0x29bb0a[_0xbf31('0x1d')]=_0x59540a;if(_0xebd8b5[_0xbf31('0x31')][_0xbf31('0x3e')]){_0x229045['include']=[{'all':!![]}];}return db['Pause'][_0xbf31('0x3f')](_0x229045);})[_0xbf31('0x28')](function(_0xd556f7){_0x29bb0a[_0xbf31('0x40')]=_0xd556f7;return _0x29bb0a;})['then'](respondWithFilteredResult(_0x16df50,_0x229045))[_0xbf31('0x41')](handleError(_0x16df50,null));};exports[_0xbf31('0x42')]=function(_0x84b1ae,_0x199adc){var _0x461e26={'raw':!![],'where':{'id':_0x84b1ae[_0xbf31('0x43')]['id']}},_0x417770={};_0x417770[_0xbf31('0x34')]=_[_0xbf31('0x32')](db[_0xbf31('0x2e')][_0xbf31('0x44')]);_0x417770[_0xbf31('0x31')]=_[_0xbf31('0x32')](_0x84b1ae[_0xbf31('0x31')]);_0x417770[_0xbf31('0x3b')]=_[_0xbf31('0x33')](_0x417770['model'],_0x417770[_0xbf31('0x31')]);_0x461e26[_0xbf31('0x35')]=_[_0xbf31('0x33')](_0x417770[_0xbf31('0x34')],qs[_0xbf31('0x36')](_0x84b1ae[_0xbf31('0x31')][_0xbf31('0x36')]));_0x461e26[_0xbf31('0x35')]=_0x461e26[_0xbf31('0x35')][_0xbf31('0x45')]?_0x461e26[_0xbf31('0x35')]:_0x417770[_0xbf31('0x34')];if(_0x84b1ae[_0xbf31('0x31')]['includeAll']){_0x461e26['include']=[{'all':!![]}];}_0x461e26=_[_0xbf31('0x3d')]({},_0x461e26,_0x84b1ae['options']);return db[_0xbf31('0x2e')][_0xbf31('0x46')](_0x461e26)[_0xbf31('0x28')](handleEntityNotFound(_0x199adc,null))['then'](respondWithResult(_0x199adc,null))[_0xbf31('0x41')](handleError(_0x199adc,null));};exports[_0xbf31('0x47')]=function(_0x276971,_0x24aa99){return db[_0xbf31('0x2e')]['create'](_0x276971[_0xbf31('0x48')],{})[_0xbf31('0x28')](function(_0x9046fe){var _0x4c4e95=_0x276971[_0xbf31('0x49')][_0xbf31('0x26')]({'plain':!![]});if(!_0x4c4e95)throw new Error(_0xbf31('0x4a'));if(_0x4c4e95[_0xbf31('0x4b')]==='user'){var _0x3bf124=_0x9046fe[_0xbf31('0x26')]({'plain':!![]});var _0x3d4f6b=_0xbf31('0x27');return db['UserProfileSection'][_0xbf31('0x46')]({'where':{'name':_0x3d4f6b,'userProfileId':_0x4c4e95['userProfileId']},'raw':!![]})[_0xbf31('0x28')](function(_0x47dcde){if(_0x47dcde&&_0x47dcde[_0xbf31('0x4c')]===0x0){return db['UserProfileResource'][_0xbf31('0x47')]({'name':_0x3bf124[_0xbf31('0x2a')],'resourceId':_0x3bf124['id'],'type':_0x47dcde[_0xbf31('0x2a')],'sectionId':_0x47dcde['id']},{})[_0xbf31('0x28')](function(){return _0x9046fe;});}else{return _0x9046fe;}})['catch'](function(_0x2dc8e8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dc8e8);throw _0x2dc8e8;});}return _0x9046fe;})[_0xbf31('0x28')](respondWithResult(_0x24aa99,0xc9))[_0xbf31('0x41')](handleError(_0x24aa99,null));};exports['update']=function(_0x95f0b,_0xb283b){if(_0x95f0b[_0xbf31('0x48')]['id']){delete _0x95f0b[_0xbf31('0x48')]['id'];}return db[_0xbf31('0x2e')][_0xbf31('0x46')]({'where':{'id':_0x95f0b[_0xbf31('0x43')]['id']}})['then'](handleEntityNotFound(_0xb283b,null))[_0xbf31('0x28')](saveUpdates(_0x95f0b[_0xbf31('0x48')],null))[_0xbf31('0x28')](respondWithResult(_0xb283b,null))[_0xbf31('0x41')](handleError(_0xb283b,null));};exports['destroy']=function(_0x5e4cb3,_0xe3c2bc){return db[_0xbf31('0x2e')][_0xbf31('0x46')]({'where':{'id':_0x5e4cb3[_0xbf31('0x43')]['id']}})[_0xbf31('0x28')](handleEntityNotFound(_0xe3c2bc,null))[_0xbf31('0x28')](removeEntity(_0xe3c2bc,null))[_0xbf31('0x41')](handleError(_0xe3c2bc,null));}; \ No newline at end of file +var _0x98bc=['fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','create','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Pause','rawAttributes'];(function(_0x239193,_0x1585ef){var _0x4f51c3=function(_0x8eba2c){while(--_0x8eba2c){_0x239193['push'](_0x239193['shift']());}};_0x4f51c3(++_0x1585ef);}(_0x98bc,0x174));var _0xc98b=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x98bc[_0x1f9f37];return _0x21c080;};'use strict';var emlformat=require(_0xc98b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc98b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc98b('0x2'));var moment=require(_0xc98b('0x3'));var BPromise=require(_0xc98b('0x4'));var Mustache=require('mustache');var util=require(_0xc98b('0x5'));var path=require(_0xc98b('0x6'));var sox=require(_0xc98b('0x7'));var csv=require(_0xc98b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc98b('0x9'));var _=require(_0xc98b('0xa'));var squel=require(_0xc98b('0xb'));var crypto=require(_0xc98b('0xc'));var jsforce=require(_0xc98b('0xd'));var deskjs=require(_0xc98b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc98b('0xf'));var Papa=require('papaparse');var Redis=require(_0xc98b('0x10'));var authService=require(_0xc98b('0x11'));var qs=require(_0xc98b('0x12'));var as=require(_0xc98b('0x13'));var hardwareService=require(_0xc98b('0x14'));var logger=require('../../config/logger')(_0xc98b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc98b('0x16'))['db'];function respondWithStatusCode(_0x11ef4a,_0x4cdb60){_0x4cdb60=_0x4cdb60||0xcc;return function(_0x3f037e){if(_0x3f037e){return _0x11ef4a[_0xc98b('0x17')](_0x4cdb60);}return _0x11ef4a[_0xc98b('0x18')](_0x4cdb60)[_0xc98b('0x19')]();};}function respondWithResult(_0xe22626,_0x2cf624){_0x2cf624=_0x2cf624||0xc8;return function(_0x46a74b){if(_0x46a74b){return _0xe22626[_0xc98b('0x18')](_0x2cf624)[_0xc98b('0x1a')](_0x46a74b);}};}function respondWithFilteredResult(_0xba26de,_0x180d54){return function(_0x35eac9){if(_0x35eac9){var _0x184d74=typeof _0x180d54[_0xc98b('0x1b')]==='undefined'&&typeof _0x180d54[_0xc98b('0x1c')]===_0xc98b('0x1d');var _0x42f767=_0x35eac9[_0xc98b('0x1e')];var _0x226e54=_0x184d74?0x0:_0x180d54['offset'];var _0x5acac6=_0x184d74?_0x35eac9['count']:_0x180d54[_0xc98b('0x1b')]+_0x180d54[_0xc98b('0x1c')];var _0x43fb22;if(_0x5acac6>=_0x42f767){_0x5acac6=_0x42f767;_0x43fb22=0xc8;}else{_0x43fb22=0xce;}_0xba26de[_0xc98b('0x18')](_0x43fb22);return _0xba26de[_0xc98b('0x1f')]('Content-Range',_0x226e54+'-'+_0x5acac6+'/'+_0x42f767)[_0xc98b('0x1a')](_0x35eac9);}return null;};}function patchUpdates(_0x4fca86){return function(_0x184aac){try{jsonpatch[_0xc98b('0x20')](_0x184aac,_0x4fca86,!![]);}catch(_0x1b6101){return BPromise[_0xc98b('0x21')](_0x1b6101);}return _0x184aac[_0xc98b('0x22')]();};}function saveUpdates(_0x25d08f,_0x2217ef){return function(_0x4f0e35){if(_0x4f0e35){return _0x4f0e35[_0xc98b('0x23')](_0x25d08f)[_0xc98b('0x24')](function(_0x2bc897){return _0x2bc897;});}return null;};}function removeEntity(_0x3aee18,_0x55dfda){return function(_0x14b93c){if(_0x14b93c){return _0x14b93c['destroy']()[_0xc98b('0x24')](function(){var _0x150c3e=_0x14b93c[_0xc98b('0x25')]({'plain':!![]});var _0x4147fc='Pauses';return db[_0xc98b('0x26')][_0xc98b('0x27')]({'where':{'type':_0x4147fc,'resourceId':_0x150c3e['id']}})[_0xc98b('0x24')](function(){return _0x14b93c;});})[_0xc98b('0x24')](function(){_0x3aee18[_0xc98b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ef71,_0x30421a){return function(_0x366c10){if(!_0x366c10){_0x12ef71['sendStatus'](0x194);}return _0x366c10;};}function handleError(_0x260030,_0x5b8f0d){_0x5b8f0d=_0x5b8f0d||0x1f4;return function(_0x23c8f2){logger[_0xc98b('0x28')](_0x23c8f2[_0xc98b('0x29')]);if(_0x23c8f2[_0xc98b('0x2a')]){delete _0x23c8f2[_0xc98b('0x2a')];}_0x260030['status'](_0x5b8f0d)[_0xc98b('0x2b')](_0x23c8f2);};}exports[_0xc98b('0x2c')]=function(_0x2df708,_0x55597e){var _0x4446b4={},_0x169df6={},_0x533952={'count':0x0,'rows':[]};var _0x1f86a=_[_0xc98b('0x2d')](db[_0xc98b('0x2e')][_0xc98b('0x2f')],function(_0x526dd8){return{'name':_0x526dd8[_0xc98b('0x30')],'type':_0x526dd8[_0xc98b('0x31')][_0xc98b('0x32')]};});_0x169df6[_0xc98b('0x33')]=_[_0xc98b('0x2d')](_0x1f86a,_0xc98b('0x2a'));_0x169df6['query']=_[_0xc98b('0x34')](_0x2df708['query']);_0x169df6[_0xc98b('0x35')]=_['intersection'](_0x169df6[_0xc98b('0x33')],_0x169df6[_0xc98b('0x36')]);_0x4446b4[_0xc98b('0x37')]=_[_0xc98b('0x38')](_0x169df6[_0xc98b('0x33')],qs[_0xc98b('0x39')](_0x2df708[_0xc98b('0x36')]['fields']));_0x4446b4[_0xc98b('0x37')]=_0x4446b4[_0xc98b('0x37')]['length']?_0x4446b4[_0xc98b('0x37')]:_0x169df6['model'];if(!_0x2df708[_0xc98b('0x36')][_0xc98b('0x3a')](_0xc98b('0x3b'))){_0x4446b4[_0xc98b('0x1c')]=qs[_0xc98b('0x1c')](_0x2df708['query']['limit']);_0x4446b4[_0xc98b('0x1b')]=qs['offset'](_0x2df708[_0xc98b('0x36')][_0xc98b('0x1b')]);}_0x4446b4[_0xc98b('0x3c')]=qs[_0xc98b('0x3d')](_0x2df708['query']['sort']);_0x4446b4['where']=qs[_0xc98b('0x35')](_[_0xc98b('0x3e')](_0x2df708[_0xc98b('0x36')],_0x169df6[_0xc98b('0x35')]),_0x1f86a);if(_0x2df708[_0xc98b('0x36')][_0xc98b('0x3f')]){_0x4446b4[_0xc98b('0x40')]=_[_0xc98b('0x41')](_0x4446b4[_0xc98b('0x40')],{'$or':_[_0xc98b('0x2d')](_0x1f86a,function(_0x372285){if(_0x372285[_0xc98b('0x31')]!==_0xc98b('0x42')){var _0x412fff={};_0x412fff[_0x372285['name']]={'$like':'%'+_0x2df708[_0xc98b('0x36')]['filter']+'%'};return _0x412fff;}})});}_0x4446b4=_['merge']({},_0x4446b4,_0x2df708[_0xc98b('0x43')]);var _0xb9f3d2={'where':_0x4446b4['where']};return db[_0xc98b('0x2e')]['count'](_0xb9f3d2)['then'](function(_0x22ee2a){_0x533952[_0xc98b('0x1e')]=_0x22ee2a;if(_0x2df708['query'][_0xc98b('0x44')]){_0x4446b4[_0xc98b('0x45')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x4446b4);})[_0xc98b('0x24')](function(_0x21dfe7){_0x533952[_0xc98b('0x46')]=_0x21dfe7;return _0x533952;})[_0xc98b('0x24')](respondWithFilteredResult(_0x55597e,_0x4446b4))[_0xc98b('0x47')](handleError(_0x55597e,null));};exports[_0xc98b('0x48')]=function(_0x5db1be,_0x27b6e9){var _0x4197c7={'raw':!![],'where':{'id':_0x5db1be[_0xc98b('0x49')]['id']}},_0x36d12b={};_0x36d12b[_0xc98b('0x33')]=_[_0xc98b('0x34')](db[_0xc98b('0x2e')][_0xc98b('0x2f')]);_0x36d12b[_0xc98b('0x36')]=_[_0xc98b('0x34')](_0x5db1be[_0xc98b('0x36')]);_0x36d12b[_0xc98b('0x35')]=_[_0xc98b('0x38')](_0x36d12b['model'],_0x36d12b[_0xc98b('0x36')]);_0x4197c7[_0xc98b('0x37')]=_['intersection'](_0x36d12b[_0xc98b('0x33')],qs[_0xc98b('0x39')](_0x5db1be[_0xc98b('0x36')][_0xc98b('0x39')]));_0x4197c7[_0xc98b('0x37')]=_0x4197c7[_0xc98b('0x37')]['length']?_0x4197c7['attributes']:_0x36d12b['model'];if(_0x5db1be[_0xc98b('0x36')][_0xc98b('0x44')]){_0x4197c7[_0xc98b('0x45')]=[{'all':!![]}];}_0x4197c7=_[_0xc98b('0x41')]({},_0x4197c7,_0x5db1be[_0xc98b('0x43')]);return db[_0xc98b('0x2e')][_0xc98b('0x4a')](_0x4197c7)[_0xc98b('0x24')](handleEntityNotFound(_0x27b6e9,null))[_0xc98b('0x24')](respondWithResult(_0x27b6e9,null))[_0xc98b('0x47')](handleError(_0x27b6e9,null));};exports['create']=function(_0x1eaa4b,_0x2422ac){return db[_0xc98b('0x2e')]['create'](_0x1eaa4b[_0xc98b('0x4b')],{})[_0xc98b('0x24')](function(_0x7c5f8){var _0x48ab56=_0x1eaa4b[_0xc98b('0x4c')][_0xc98b('0x25')]({'plain':!![]});if(!_0x48ab56)throw new Error(_0xc98b('0x4d'));if(_0x48ab56[_0xc98b('0x4e')]===_0xc98b('0x4c')){var _0x54dfe7=_0x7c5f8[_0xc98b('0x25')]({'plain':!![]});var _0x1d3746=_0xc98b('0x4f');return db[_0xc98b('0x50')]['find']({'where':{'name':_0x1d3746,'userProfileId':_0x48ab56[_0xc98b('0x51')]},'raw':!![]})[_0xc98b('0x24')](function(_0x207996){if(_0x207996&&_0x207996[_0xc98b('0x52')]===0x0){return db[_0xc98b('0x26')][_0xc98b('0x53')]({'name':_0x54dfe7[_0xc98b('0x2a')],'resourceId':_0x54dfe7['id'],'type':_0x207996[_0xc98b('0x2a')],'sectionId':_0x207996['id']},{})[_0xc98b('0x24')](function(){return _0x7c5f8;});}else{return _0x7c5f8;}})[_0xc98b('0x47')](function(_0x3b8fca){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b8fca);throw _0x3b8fca;});}return _0x7c5f8;})[_0xc98b('0x24')](respondWithResult(_0x2422ac,0xc9))[_0xc98b('0x47')](handleError(_0x2422ac,null));};exports[_0xc98b('0x23')]=function(_0x3c1c43,_0x35d60e){if(_0x3c1c43['body']['id']){delete _0x3c1c43[_0xc98b('0x4b')]['id'];}return db[_0xc98b('0x2e')][_0xc98b('0x4a')]({'where':{'id':_0x3c1c43['params']['id']}})[_0xc98b('0x24')](handleEntityNotFound(_0x35d60e,null))[_0xc98b('0x24')](saveUpdates(_0x3c1c43['body'],null))[_0xc98b('0x24')](respondWithResult(_0x35d60e,null))[_0xc98b('0x47')](handleError(_0x35d60e,null));};exports[_0xc98b('0x27')]=function(_0x2b5adc,_0x4420b6){return db[_0xc98b('0x2e')][_0xc98b('0x4a')]({'where':{'id':_0x2b5adc[_0xc98b('0x49')]['id']}})[_0xc98b('0x24')](handleEntityNotFound(_0x4420b6,null))[_0xc98b('0x24')](removeEntity(_0x4420b6,null))[_0xc98b('0x47')](handleError(_0x4420b6,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 03317a5..b1c8ed1 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 _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0xb18d8a,_0x435bc2){var _0x44f46c=function(_0x76d20d){while(--_0x76d20d){_0xb18d8a['push'](_0xb18d8a['shift']());}};_0x44f46c(++_0x435bc2);}(_0x814b,0x1a2));var _0xb814=function(_0x457c96,_0x13785c){_0x457c96=_0x457c96-0x0;var _0x4e5ebc=_0x814b[_0x457c96];return _0x4e5ebc;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x1eb874,_0x3e4ce1){var _0x16e059=function(_0x29f412){while(--_0x29f412){_0x1eb874['push'](_0x1eb874['shift']());}};_0x16e059(++_0x3e4ce1);}(_0x326f,0xd1));var _0xf326=function(_0x10f3f2,_0x34056b){_0x10f3f2=_0x10f3f2-0x0;var _0x32cd87=_0x326f[_0x10f3f2];return _0x32cd87;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'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 4b84fde..21198a4 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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x15e650,_0x1c47b6){var _0x4d9855=function(_0x55e47a){while(--_0x55e47a){_0x15e650['push'](_0x15e650['shift']());}};_0x4d9855(++_0x1c47b6);}(_0xb10b,0x12a));var _0xbb10=function(_0x12a201,_0x30aaba){_0x12a201=_0x12a201-0x0;var _0x52a4d2=_0xb10b[_0x12a201];return _0x52a4d2;};'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')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x3a0b18,_0x41443b){var _0x177d94=function(_0x166302){while(--_0x166302){_0x3a0b18['push'](_0x3a0b18['shift']());}};_0x177d94(++_0x41443b);}(_0xb10b,0x12a));var _0xbb10=function(_0x2fe15c,_0x48713a){_0x2fe15c=_0x2fe15c-0x0;var _0x26ec58=_0xb10b[_0x2fe15c];return _0x26ec58;};'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')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 973997c..5567a1f 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 _0x9c44=['index','get','/webhook','webhookGet','/:id','show','download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./plugin.controller','isAuthenticated'];(function(_0xe1809b,_0x1cd0b7){var _0x1bf93c=function(_0x6d6ae5){while(--_0x6d6ae5){_0xe1809b['push'](_0xe1809b['shift']());}};_0x1bf93c(++_0x1cd0b7);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),controller[_0x49c4('0xb')]);router['get'](_0x49c4('0xc'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router[_0x49c4('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x49c4('0xe')]);var upload=multer({'storage':multer[_0x49c4('0xf')]({'destination':function(_0x58cad7,_0xb611a1,_0x459d09){_0x459d09(null,path['join'](config['root'],_0x49c4('0x10')));},'filename':function(_0x6d1b08,_0x5487cd,_0x7df3a9){_0x5487cd[_0x49c4('0x11')]=_0x5487cd['originalname'][_0x49c4('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7df3a9(null,util[_0x49c4('0x13')](_0x49c4('0x14'),path[_0x49c4('0x15')](_0x5487cd[_0x49c4('0x11')],path[_0x49c4('0x16')](_0x5487cd[_0x49c4('0x11')])),Date[_0x49c4('0x17')](),path['extname'](_0x5487cd[_0x49c4('0x11')])));}})});router[_0x49c4('0x18')]('/',upload[_0x49c4('0x19')](_0x49c4('0x1a')),controller[_0x49c4('0x1b')]);router['post'](_0x49c4('0xa'),controller[_0x49c4('0x1c')]);router['put']('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x1d')]);router[_0x49c4('0x1e')]('/:id',auth[_0x49c4('0x7')](),controller['delete']);module[_0x49c4('0x1f')]=router; \ No newline at end of file +var _0x4ea3=['%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','root','server/files/plugins','originalname','replace','format'];(function(_0x592787,_0x4547d1){var _0x33e45c=function(_0x51e271){while(--_0x51e271){_0x592787['push'](_0x592787['shift']());}};_0x33e45c(++_0x4547d1);}(_0x4ea3,0x70));var _0x34ea=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4ea3[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34ea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x34ea('0x6'));router[_0x34ea('0x7')]('/',auth[_0x34ea('0x8')](),controller[_0x34ea('0x9')]);router[_0x34ea('0x7')](_0x34ea('0xa'),controller[_0x34ea('0xb')]);router['get'](_0x34ea('0xc'),auth[_0x34ea('0x8')](),controller[_0x34ea('0xd')]);router['get'](_0x34ea('0xe'),auth[_0x34ea('0x8')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bd8b6,_0x346287,_0x167667){_0x167667(null,path['join'](config[_0x34ea('0xf')],_0x34ea('0x10')));},'filename':function(_0x10135f,_0x233b11,_0x60725f){_0x233b11[_0x34ea('0x11')]=_0x233b11[_0x34ea('0x11')][_0x34ea('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x60725f(null,util[_0x34ea('0x13')](_0x34ea('0x14'),path[_0x34ea('0x15')](_0x233b11['originalname'],path[_0x34ea('0x16')](_0x233b11[_0x34ea('0x11')])),Date[_0x34ea('0x17')](),path[_0x34ea('0x16')](_0x233b11[_0x34ea('0x11')])));}})});router['post']('/',upload[_0x34ea('0x18')](_0x34ea('0x19')),controller[_0x34ea('0x1a')]);router[_0x34ea('0x1b')]('/webhook',controller[_0x34ea('0x1c')]);router[_0x34ea('0x1d')](_0x34ea('0xc'),auth['isAuthenticated'](),controller[_0x34ea('0x1e')]);router[_0x34ea('0x1f')](_0x34ea('0xc'),auth[_0x34ea('0x8')](),controller['delete']);module[_0x34ea('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index f2b4860..82141a9 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 _0xc99a=['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','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xc99a,0x156));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xac99('0x0')]},'type':{'type':Sequelize[_0xac99('0x1')](_0xac99('0x2'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xac99('0x3')]},'path':{'type':Sequelize[_0xac99('0x0')],'comment':_0xac99('0x4')},'active':{'type':Sequelize[_0xac99('0x5')],'defaultValue':0x0,'comment':_0xac99('0x6')},'sidebar':{'type':Sequelize[_0xac99('0x1')](_0xac99('0x7'),_0xac99('0x8'),_0xac99('0x9'),_0xac99('0xa')),'defaultValue':'always','comment':_0xac99('0xb')},'icon':{'type':Sequelize[_0xac99('0x0')]},'adminUrl':{'type':Sequelize[_0xac99('0x0')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xac99('0x0')]},'scriptPath':{'type':Sequelize[_0xac99('0x0')]}}; \ No newline at end of file +var _0x1d75=['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.','sequelize','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1d75,0x118));var _0x51d7=function(_0x1fa04f,_0x5a792f){_0x1fa04f=_0x1fa04f-0x0;var _0x2bd31c=_0x1d75[_0x1fa04f];return _0x2bd31c;};'use strict';var Sequelize=require(_0x51d7('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x51d7('0x1')](_0x51d7('0x2'),'script')},'description':{'type':Sequelize[_0x51d7('0x3')]},'version':{'type':Sequelize[_0x51d7('0x3')]},'path':{'type':Sequelize[_0x51d7('0x4')],'comment':_0x51d7('0x5')},'active':{'type':Sequelize[_0x51d7('0x6')],'defaultValue':0x0,'comment':_0x51d7('0x7')},'sidebar':{'type':Sequelize[_0x51d7('0x1')](_0x51d7('0x8'),_0x51d7('0x9'),_0x51d7('0xa'),_0x51d7('0xb')),'defaultValue':_0x51d7('0xa'),'comment':_0x51d7('0xc')},'icon':{'type':Sequelize[_0x51d7('0x4')]},'adminUrl':{'type':Sequelize[_0x51d7('0x4')]},'agentUrl':{'type':Sequelize[_0x51d7('0x4')]},'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 1deec46..07dc53a 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 _0xb0be=['Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','download','format','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','root','server/files/plugins','dirname','node_modules/**/*','basename','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','html','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','delete','webhookGet','resolve','\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','method','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','destroy','then','get','Plugins','UserProfileResource','stack','name','send','index'];(function(_0x5d951c,_0x22a120){var _0x4d2053=function(_0x1f1f8a){while(--_0x1f1f8a){_0x5d951c['push'](_0x5d951c['shift']());}};_0x4d2053(++_0x22a120);}(_0xb0be,0x1d8));var _0xeb0b=function(_0x211de6,_0x3fd557){_0x211de6=_0x211de6-0x0;var _0x102863=_0xb0be[_0x211de6];return _0x102863;};'use strict';var emlformat=require(_0xeb0b('0x0'));var rimraf=require(_0xeb0b('0x1'));var zipdir=require(_0xeb0b('0x2'));var jsonpatch=require(_0xeb0b('0x3'));var rp=require(_0xeb0b('0x4'));var moment=require('moment');var BPromise=require(_0xeb0b('0x5'));var Mustache=require(_0xeb0b('0x6'));var util=require(_0xeb0b('0x7'));var path=require(_0xeb0b('0x8'));var sox=require(_0xeb0b('0x9'));var csv=require(_0xeb0b('0xa'));var ejs=require(_0xeb0b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb0b('0xc'));var crypto=require('crypto');var jsforce=require(_0xeb0b('0xd'));var deskjs=require(_0xeb0b('0xe'));var toCsv=require(_0xeb0b('0xa'));var querystring=require(_0xeb0b('0xf'));var Papa=require('papaparse');var extract=require(_0xeb0b('0x10'));var rimraf=require('rimraf');var archiver=require(_0xeb0b('0x11'));var Redis=require(_0xeb0b('0x12'));var authService=require(_0xeb0b('0x13'));var qs=require(_0xeb0b('0x14'));var as=require(_0xeb0b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb0b('0x16'));var utils=require(_0xeb0b('0x17'));var config=require(_0xeb0b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xeb0b('0x19')]=_[_0xeb0b('0x1a')](config[_0xeb0b('0x19')],{'host':_0xeb0b('0x1b'),'port':0x18eb});var socket=require(_0xeb0b('0x1c'))(new Redis(config[_0xeb0b('0x19')]));require(_0xeb0b('0x1d'))[_0xeb0b('0x1e')](socket);function respondWithStatusCode(_0x477ce0,_0x543eeb){_0x543eeb=_0x543eeb||0xcc;return function(_0x27576f){if(_0x27576f){return _0x477ce0[_0xeb0b('0x1f')](_0x543eeb);}return _0x477ce0[_0xeb0b('0x20')](_0x543eeb)[_0xeb0b('0x21')]();};}function respondWithResult(_0x44c26b,_0x24f0b1){_0x24f0b1=_0x24f0b1||0xc8;return function(_0x5bae80){if(_0x5bae80){return _0x44c26b['status'](_0x24f0b1)[_0xeb0b('0x22')](_0x5bae80);}};}function respondWithFilteredResult(_0x5ed648,_0x454630){return function(_0x19bd3a){if(_0x19bd3a){var _0x6236a2=typeof _0x454630[_0xeb0b('0x23')]===_0xeb0b('0x24')&&typeof _0x454630[_0xeb0b('0x25')]===_0xeb0b('0x24');var _0x16b745=_0x19bd3a[_0xeb0b('0x26')];var _0x326f52=_0x6236a2?0x0:_0x454630['offset'];var _0x5531cc=_0x6236a2?_0x19bd3a['count']:_0x454630[_0xeb0b('0x23')]+_0x454630[_0xeb0b('0x25')];var _0x44c513;if(_0x5531cc>=_0x16b745){_0x5531cc=_0x16b745;_0x44c513=0xc8;}else{_0x44c513=0xce;}_0x5ed648[_0xeb0b('0x20')](_0x44c513);return _0x5ed648[_0xeb0b('0x27')]('Content-Range',_0x326f52+'-'+_0x5531cc+'/'+_0x16b745)[_0xeb0b('0x22')](_0x19bd3a);}return null;};}function patchUpdates(_0x4f438c){return function(_0x1b0609){try{jsonpatch['apply'](_0x1b0609,_0x4f438c,!![]);}catch(_0x55aa58){return BPromise[_0xeb0b('0x28')](_0x55aa58);}return _0x1b0609['save']();};}function saveUpdates(_0x51f7a8,_0x5c4e36){return function(_0x27cf39){if(_0x27cf39){return _0x27cf39['update'](_0x51f7a8)['then'](function(_0x13dae1){return _0x13dae1;});}return null;};}function removeEntity(_0x55e47d,_0x231a93){return function(_0x566a93){if(_0x566a93){return _0x566a93[_0xeb0b('0x29')]()[_0xeb0b('0x2a')](function(){var _0x1ae55c=_0x566a93[_0xeb0b('0x2b')]({'plain':!![]});var _0x3393bc=_0xeb0b('0x2c');return db[_0xeb0b('0x2d')][_0xeb0b('0x29')]({'where':{'type':_0x3393bc,'resourceId':_0x1ae55c['id']}})[_0xeb0b('0x2a')](function(){return _0x566a93;});})['then'](function(){_0x55e47d[_0xeb0b('0x20')](0xcc)[_0xeb0b('0x21')]();});}};}function handleEntityNotFound(_0x4fb9e0,_0xd798ed){return function(_0x3a7dce){if(!_0x3a7dce){_0x4fb9e0[_0xeb0b('0x1f')](0x194);}return _0x3a7dce;};}function handleError(_0x368618,_0x22b6b4){_0x22b6b4=_0x22b6b4||0x1f4;return function(_0x34d568){logger['error'](_0x34d568[_0xeb0b('0x2e')]);if(_0x34d568[_0xeb0b('0x2f')]){delete _0x34d568[_0xeb0b('0x2f')];}_0x368618[_0xeb0b('0x20')](_0x22b6b4)[_0xeb0b('0x30')](_0x34d568);};}exports[_0xeb0b('0x31')]=function(_0x516528,_0x4f2c47){var _0x3de304={},_0x12669b={},_0x2587fc={'count':0x0,'rows':[]};var _0x3e1337=_['map'](db[_0xeb0b('0x32')][_0xeb0b('0x33')],function(_0x340d31){return{'name':_0x340d31[_0xeb0b('0x34')],'type':_0x340d31[_0xeb0b('0x35')][_0xeb0b('0x36')]};});_0x12669b[_0xeb0b('0x37')]=_[_0xeb0b('0x38')](_0x3e1337,_0xeb0b('0x2f'));_0x12669b[_0xeb0b('0x39')]=_[_0xeb0b('0x3a')](_0x516528[_0xeb0b('0x39')]);_0x12669b[_0xeb0b('0x3b')]=_[_0xeb0b('0x3c')](_0x12669b[_0xeb0b('0x37')],_0x12669b[_0xeb0b('0x39')]);_0x3de304[_0xeb0b('0x3d')]=_[_0xeb0b('0x3c')](_0x12669b[_0xeb0b('0x37')],qs[_0xeb0b('0x3e')](_0x516528[_0xeb0b('0x39')][_0xeb0b('0x3e')]));_0x3de304[_0xeb0b('0x3d')]=_0x3de304['attributes'][_0xeb0b('0x3f')]?_0x3de304[_0xeb0b('0x3d')]:_0x12669b[_0xeb0b('0x37')];if(!_0x516528[_0xeb0b('0x39')][_0xeb0b('0x40')](_0xeb0b('0x41'))){_0x3de304['limit']=qs[_0xeb0b('0x25')](_0x516528['query'][_0xeb0b('0x25')]);_0x3de304[_0xeb0b('0x23')]=qs[_0xeb0b('0x23')](_0x516528[_0xeb0b('0x39')][_0xeb0b('0x23')]);}_0x3de304[_0xeb0b('0x42')]=qs[_0xeb0b('0x43')](_0x516528['query'][_0xeb0b('0x43')]);_0x3de304[_0xeb0b('0x44')]=qs[_0xeb0b('0x3b')](_[_0xeb0b('0x45')](_0x516528['query'],_0x12669b['filters']),_0x3e1337);if(_0x516528[_0xeb0b('0x39')][_0xeb0b('0x46')]){_0x3de304[_0xeb0b('0x44')]=_[_0xeb0b('0x47')](_0x3de304[_0xeb0b('0x44')],{'$or':_[_0xeb0b('0x38')](_0x3e1337,function(_0x34b927){if(_0x34b927['type']!==_0xeb0b('0x48')){var _0x438bff={};_0x438bff[_0x34b927['name']]={'$like':'%'+_0x516528[_0xeb0b('0x39')]['filter']+'%'};return _0x438bff;}})});}_0x3de304=_[_0xeb0b('0x47')]({},_0x3de304,_0x516528[_0xeb0b('0x49')]);var _0x36ac2a={'where':_0x3de304['where']};return db[_0xeb0b('0x32')][_0xeb0b('0x26')](_0x36ac2a)[_0xeb0b('0x2a')](function(_0x3ac9c4){_0x2587fc['count']=_0x3ac9c4;if(_0x516528[_0xeb0b('0x39')][_0xeb0b('0x4a')]){_0x3de304['include']=[{'all':!![]}];}return db[_0xeb0b('0x32')]['findAll'](_0x3de304);})[_0xeb0b('0x2a')](function(_0x43f5aa){_0x2587fc[_0xeb0b('0x4b')]=_0x43f5aa;return _0x2587fc;})[_0xeb0b('0x2a')](respondWithFilteredResult(_0x4f2c47,_0x3de304))[_0xeb0b('0x4c')](handleError(_0x4f2c47,null));};exports[_0xeb0b('0x4d')]=function(_0x4ca57e,_0x5de025){var _0x17ba25={'raw':!![],'where':{'id':_0x4ca57e[_0xeb0b('0x4e')]['id']}},_0x1ebdb2={};_0x1ebdb2['model']=_[_0xeb0b('0x3a')](db[_0xeb0b('0x32')][_0xeb0b('0x33')]);_0x1ebdb2[_0xeb0b('0x39')]=_['keys'](_0x4ca57e[_0xeb0b('0x39')]);_0x1ebdb2[_0xeb0b('0x3b')]=_['intersection'](_0x1ebdb2[_0xeb0b('0x37')],_0x1ebdb2[_0xeb0b('0x39')]);_0x17ba25[_0xeb0b('0x3d')]=_[_0xeb0b('0x3c')](_0x1ebdb2[_0xeb0b('0x37')],qs['fields'](_0x4ca57e[_0xeb0b('0x39')][_0xeb0b('0x3e')]));_0x17ba25[_0xeb0b('0x3d')]=_0x17ba25['attributes']['length']?_0x17ba25[_0xeb0b('0x3d')]:_0x1ebdb2['model'];if(_0x4ca57e['query'][_0xeb0b('0x4a')]){_0x17ba25[_0xeb0b('0x4f')]=[{'all':!![]}];}_0x17ba25=_[_0xeb0b('0x47')]({},_0x17ba25,_0x4ca57e[_0xeb0b('0x49')]);return db[_0xeb0b('0x32')][_0xeb0b('0x50')](_0x17ba25)[_0xeb0b('0x2a')](handleEntityNotFound(_0x5de025,null))['then'](respondWithResult(_0x5de025,null))['catch'](handleError(_0x5de025,null));};exports[_0xeb0b('0x51')]=function(_0x179962,_0x599997,_0x2f59b0){return db['Plugin']['find']({'where':{'id':_0x179962['params']['id']},'attributes':['name','path'],'raw':!![]})[_0xeb0b('0x2a')](handleEntityNotFound(_0x599997,null))[_0xeb0b('0x2a')](function(_0x4018dd){if(_0x4018dd){var _0x5dccc2=path['join'](config['root'],'server/files/plugins',util[_0xeb0b('0x52')]('%s.zip',path['basename'](_0x4018dd[_0xeb0b('0x8')])));var _0x58b340=fs[_0xeb0b('0x53')](_0x5dccc2);var _0x1e2343=archiver(_0xeb0b('0x54'),{'zlib':{'level':0x9}});_0x1e2343['on'](_0xeb0b('0x55'),function(_0x4e58eb){if(_0x4e58eb[_0xeb0b('0x56')]===_0xeb0b('0x57')){logger[_0xeb0b('0x58')](_0x4e58eb);}else{throw new db[(_0xeb0b('0x59'))][(_0xeb0b('0x5a'))](_0xeb0b('0x5b'));}});_0x1e2343['on']('error',function(_0x16589c){throw new db[(_0xeb0b('0x59'))][(_0xeb0b('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x1e2343[_0xeb0b('0x5c')](_0x58b340);_0x1e2343[_0xeb0b('0x5d')]('**/*',{'cwd':path[_0xeb0b('0x5e')](config[_0xeb0b('0x5f')],_0xeb0b('0x60'),path[_0xeb0b('0x61')](_0x4018dd[_0xeb0b('0x8')])),'ignore':[path[_0xeb0b('0x5e')](path['basename'](_0x4018dd[_0xeb0b('0x8')]),_0xeb0b('0x62')),path[_0xeb0b('0x5e')](path[_0xeb0b('0x63')](_0x4018dd[_0xeb0b('0x8')]),'attachments/**/*')],'nodir':!![]})[_0xeb0b('0x64')]();_0x58b340['on'](_0xeb0b('0x65'),function(){if(!fs[_0xeb0b('0x66')](_0x5dccc2)){throw new db['Sequelize'][(_0xeb0b('0x5a'))](_0xeb0b('0x67'));}return _0x599997[_0xeb0b('0x51')](_0x5dccc2,util['format']('%s.zip',path[_0xeb0b('0x63')](_0x4018dd[_0xeb0b('0x8')])),function(_0x45e559){if(_0x45e559){throw new db[(_0xeb0b('0x59'))][(_0xeb0b('0x5a'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xeb0b('0x68')](_0x5dccc2);logger[_0xeb0b('0x69')]('Download\x20completed');logger[_0xeb0b('0x69')](_0xeb0b('0x6a'));});});}return null;})[_0xeb0b('0x4c')](handleError(_0x599997,null));};exports[_0xeb0b('0x6b')]=function(_0x186743,_0x473810,_0x1df2a3){var _0x27c8cc=path[_0xeb0b('0x63')](_0x186743[_0xeb0b('0x6c')][_0xeb0b('0x6d')],path[_0xeb0b('0x6e')](_0x186743[_0xeb0b('0x6c')][_0xeb0b('0x6d')]));var _0x5f3ccf=path[_0xeb0b('0x5e')](config[_0xeb0b('0x5f')],_0xeb0b('0x60'),_0x186743[_0xeb0b('0x6c')][_0xeb0b('0x6d')]);var _0x16aaf0=path[_0xeb0b('0x5e')](config[_0xeb0b('0x5f')],'server/files/plugins',_0x27c8cc);logger['info'](_0xeb0b('0x6f'),_0x5f3ccf);logger[_0xeb0b('0x69')](_0xeb0b('0x70'),_0x16aaf0);try{fs[_0xeb0b('0x71')](_0x5f3ccf,parseInt(_0xeb0b('0x72'),0x8));extract(_0x5f3ccf,{'dir':_0x16aaf0},function(_0x427054){if(_0x427054){logger[_0xeb0b('0x58')](_0x427054);handleError(_0x427054,!![]);};var _0x19ded0=fs[_0xeb0b('0x73')](_0x16aaf0);if(_0x19ded0['length']>0x1){removeReferences(_0x5f3ccf,_0x16aaf0);logger[_0xeb0b('0x58')](_0xeb0b('0x74'));return _0x1df2a3(new Error(_0xeb0b('0x74')));}var _0x183dc6=fs[_0xeb0b('0x75')](path[_0xeb0b('0x5e')](_0x16aaf0,_0x19ded0[0x0]));if(_0x183dc6[_0xeb0b('0x76')]()){removeReferences(_0x5f3ccf,_0x16aaf0);logger[_0xeb0b('0x58')](_0xeb0b('0x74'));return _0x1df2a3(new Error(_0xeb0b('0x74')));}if(_0x183dc6[_0xeb0b('0x77')]()){var _0x4725bc=fs[_0xeb0b('0x73')](path[_0xeb0b('0x5e')](_0x16aaf0,_0x19ded0[0x0]));if(_0x4725bc['length']===0x0){removeReferences(_0x5f3ccf,_0x16aaf0);logger[_0xeb0b('0x58')]('Invalid\x20plugin\x20structure');return _0x1df2a3(new Error(_0xeb0b('0x74')));}var _0x40e220=_0x4725bc[_0xeb0b('0x78')](function(_0x332acc){return _0x332acc==='manifest.json';});if(!_0x40e220){return _0x1df2a3(new Error(_0xeb0b('0x79')));}var _0x121368=fs['readFileSync'](path['join'](_0x16aaf0,_0x19ded0[0x0],_0xeb0b('0x7a')));var _0x16b95e=JSON[_0xeb0b('0x7b')](_0x121368);if('undefined'==typeof _0x16b95e['name']){return _0x1df2a3(new Error(_0xeb0b('0x7c')));}if(_0xeb0b('0x24')==typeof _0x16b95e['type']){return _0x1df2a3(new Error(_0xeb0b('0x7d')));}if(_0xeb0b('0x24')==typeof _0x16b95e[_0xeb0b('0x7e')]){return _0x1df2a3(new Error(_0xeb0b('0x7f')));}if(_0xeb0b('0x24')==typeof _0x16b95e['parameters']){return _0x1df2a3(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x16b95e[_0xeb0b('0x35')]==='html'){if(_0xeb0b('0x24')==typeof _0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x81')]){return _0x1df2a3(new Error(_0xeb0b('0x82')));}if('undefined'==typeof _0x16b95e[_0xeb0b('0x80')]['views']['admin']&&_0xeb0b('0x24')==typeof _0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x81')][_0xeb0b('0x83')]){return _0x1df2a3(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x16b95e[_0xeb0b('0x35')]==='script'){if(_0xeb0b('0x24')==typeof _0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x84')]){return _0x1df2a3(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x16b95e['parameters'][_0xeb0b('0x85')]){return _0x1df2a3(new Error(_0xeb0b('0x86')));}}else{return _0x1df2a3(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x30d504=_0x16b95e[_0xeb0b('0x2f')];var _0x41cf83=_0x16b95e[_0xeb0b('0x87')];var _0x47ca8d=_0x16b95e['type'];var _0x51beda=_0x16b95e[_0xeb0b('0x88')]?_0x16b95e['sidebar']:_0xeb0b('0x89');var _0x4348cb=_0x16b95e[_0xeb0b('0x8a')]?_0x16b95e['icon']:_0xeb0b('0x8b');var _0x462381='';var _0x57d123='';var _0xd185b='';var _0x5d9b4b='';var _0x5e02dd=_0x16b95e[_0xeb0b('0x7e')];if(_0x47ca8d===_0xeb0b('0x8c')){if(_0xeb0b('0x24')!=typeof _0x16b95e['parameters'][_0xeb0b('0x81')][_0xeb0b('0x8d')]){var _0x2ffb91=_0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xeb0b('0x8e')](_0x2ffb91)){_0x462381=path[_0xeb0b('0x5e')](_0xeb0b('0x8f'),_0x27c8cc,_0x19ded0[0x0],_0x2ffb91);}else{_0x462381=_0x2ffb91;}}else{logger[_0xeb0b('0x69')](_0xeb0b('0x90'));}if(_0xeb0b('0x24')!=typeof _0x16b95e[_0xeb0b('0x80')]['views']['agent']){var _0xfb95d2=_0x16b95e[_0xeb0b('0x80')]['views'][_0xeb0b('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xeb0b('0x8e')](_0xfb95d2)){_0x57d123=path[_0xeb0b('0x5e')](_0xeb0b('0x8f'),_0x27c8cc,_0x19ded0[0x0],_0xfb95d2);}else{_0x57d123=_0xfb95d2;}}else{logger[_0xeb0b('0x69')](_0xeb0b('0x91'));}}else if(_0x47ca8d==='script'){_0xd185b=_0x16b95e['parameters']['scriptName'];_0x5d9b4b=_0x16b95e[_0xeb0b('0x80')]['scriptPath'];if(_0xeb0b('0x24')!=typeof _0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x81')]){if(_0xeb0b('0x24')!=typeof _0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x81')][_0xeb0b('0x8d')]){var _0x2ffb91=_0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x81')][_0xeb0b('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xeb0b('0x8e')](_0x2ffb91)){_0x462381=path[_0xeb0b('0x5e')]('plugins',_0x27c8cc,_0x19ded0[0x0],_0x2ffb91);}else{_0x462381=_0x2ffb91;}}if(_0xeb0b('0x24')!=typeof _0x16b95e[_0xeb0b('0x80')][_0xeb0b('0x81')][_0xeb0b('0x83')]){var _0xfb95d2=_0x16b95e[_0xeb0b('0x80')]['views'][_0xeb0b('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xeb0b('0x8e')](_0xfb95d2)){_0x57d123=path[_0xeb0b('0x5e')](_0xeb0b('0x8f'),_0x27c8cc,_0x19ded0[0x0],_0xfb95d2);}else{_0x57d123=_0xfb95d2;}}}}var _0x324053={'name':_0x30d504,'description':_0x41cf83,'path':path[_0xeb0b('0x5e')](_0x27c8cc,_0x19ded0[0x0]),'type':_0x47ca8d,'sidebar':_0x51beda,'icon':_0x4348cb,'adminUrl':_0x462381,'agentUrl':_0x57d123,'scriptName':_0xd185b,'scriptPath':_0x5d9b4b,'version':_0x5e02dd};removeReferences(_0x5f3ccf,null);return db['Plugin'][_0xeb0b('0x92')](_0x324053)[_0xeb0b('0x2a')](function(_0x15c19a){var _0x2a39ca={'role':_0x186743[_0xeb0b('0x93')][_0xeb0b('0x94')],'userProfileId':_0x186743[_0xeb0b('0x93')][_0xeb0b('0x95')]};if(!_0x2a39ca)throw new Error(_0xeb0b('0x96'));if(_0x2a39ca['role']===_0xeb0b('0x97')){var _0x2bca33=_0x15c19a[_0xeb0b('0x2b')]({'plain':!![]});return db[_0xeb0b('0x98')][_0xeb0b('0x50')]({'where':{'name':_0xeb0b('0x2c'),'userProfileId':_0x2a39ca['userProfileId']},'raw':!![]})[_0xeb0b('0x2a')](function(_0x30f600){if(_0x30f600&&_0x30f600[_0xeb0b('0x99')]===0x0){return db['UserProfileResource'][_0xeb0b('0x92')]({'name':_0x2bca33[_0xeb0b('0x2f')],'resourceId':_0x2bca33['id'],'type':_0x30f600[_0xeb0b('0x2f')],'sectionId':_0x30f600['id']},{})[_0xeb0b('0x2a')](function(){return _0x15c19a;});}else{return _0x15c19a;}})['catch'](function(_0xab7b9){logger[_0xeb0b('0x58')](_0xeb0b('0x9a'),_0xab7b9);throw _0xab7b9;});}return _0x15c19a;})[_0xeb0b('0x2a')](respondWithResult(_0x473810,null))[_0xeb0b('0x4c')](handleError(_0x473810,null));}});}catch(_0x401467){_0x473810[_0xeb0b('0x20')](0x1f4)[_0xeb0b('0x30')](_0x401467);}};function removeReferences(_0x35763e,_0x1e8e86){try{if(_0x35763e){fs[_0xeb0b('0x68')](_0x35763e);logger[_0xeb0b('0x69')](_0xeb0b('0x9b'));}if(_0x1e8e86){rimraf(_0x1e8e86,function(){});logger[_0xeb0b('0x69')]('Extracted\x20folder\x20removed');}}catch(_0x172dc3){logger[_0xeb0b('0x58')](_0x172dc3);}}exports[_0xeb0b('0x9c')]=function(_0x5ccb78,_0x598d71,_0x4c4fd9){return db['Plugin'][_0xeb0b('0x50')]({'where':{'id':_0x5ccb78[_0xeb0b('0x4e')]['id']}})[_0xeb0b('0x2a')](handleEntityNotFound(_0x598d71,null))['then'](saveUpdates(_0x5ccb78[_0xeb0b('0x93')],null))['then'](respondWithResult(_0x598d71,null))[_0xeb0b('0x4c')](handleError(_0x598d71,null));};exports[_0xeb0b('0x9d')]=function(_0x398b0a,_0x4b5419,_0x4bff97){return db[_0xeb0b('0x32')][_0xeb0b('0x50')]({'where':{'id':_0x398b0a[_0xeb0b('0x4e')]['id']}})[_0xeb0b('0x2a')](function(_0x336761){if(_0x336761){return _0x336761[_0xeb0b('0x29')]();}})[_0xeb0b('0x2a')](function(_0xc4659c){rimraf(path['join'](config['root'],_0xeb0b('0x60'),path['dirname'](_0xc4659c[_0xeb0b('0x8')])),function(){});return _0xc4659c;})['then'](handleEntityNotFound(_0x4b5419,null))[_0xeb0b('0x2a')](respondWithStatusCode(_0x4b5419,null))[_0xeb0b('0x4c')](handleError(_0x4b5419,null));};exports[_0xeb0b('0x9e')]=function(_0x219ed6,_0x2c540a,_0x200b1){return BPromise[_0xeb0b('0x9f')]()['then'](function(){if(!_0x219ed6['query']['path']){throw new Error(_0xeb0b('0xa0'));}if(!_0x219ed6['query'][_0xeb0b('0xa1')]){throw new Error(_0xeb0b('0xa2'));}var _0x4707cd=_0x219ed6['query']['hostname']?_0x219ed6['query'][_0xeb0b('0xa3')]+':'+_0x219ed6[_0xeb0b('0x39')][_0xeb0b('0xa1')]:_0xeb0b('0xa4')+_0x219ed6[_0xeb0b('0x39')][_0xeb0b('0xa1')];var _0x4d9670=_0x219ed6['query']['json']?_0x219ed6[_0xeb0b('0x39')][_0xeb0b('0x22')]:!![];var _0x2ffe9f=_0x219ed6['query']['encoding']?_0x219ed6[_0xeb0b('0x39')][_0xeb0b('0xa5')]:null;var _0x1fb072={'method':_0x219ed6['method'],'uri':util['format'](_0xeb0b('0xa6'),_0x4707cd,_0x219ed6[_0xeb0b('0x39')]['path']),'json':_0x4d9670,'resolveWithFullResponse':!![],'encoding':_0x2ffe9f,'qs':_0x219ed6[_0xeb0b('0x39')]};if(_0x219ed6[_0xeb0b('0xa7')]){_0x1fb072[_0xeb0b('0xa7')]=_0x219ed6['headers'];if(_0x1fb072[_0xeb0b('0xa7')][_0xeb0b('0xa8')]){delete _0x1fb072[_0xeb0b('0xa7')]['content-length'];}}if(_0x1fb072['headers'][_0xeb0b('0xa9')]){delete _0x1fb072[_0xeb0b('0xa7')][_0xeb0b('0xa9')];}return rp(_0x1fb072);})['then'](function(_0x590a74){if(_0x590a74){_0x2c540a[_0xeb0b('0x27')](_0x590a74[_0xeb0b('0xa7')]);logger[_0xeb0b('0x69')](_0x590a74[_0xeb0b('0x93')]);if(_[_0xeb0b('0xaa')](_0x219ed6['query']['path'],'download')&&_0x590a74[_0xeb0b('0xab')]==0x1f4){return _0x2c540a[_0xeb0b('0x1f')](_0x590a74[_0xeb0b('0xab')]);}else{return _0x2c540a[_0xeb0b('0x20')](_0x590a74[_0xeb0b('0xab')])[_0xeb0b('0x30')](_0x590a74['body']);}}else{return _0x2c540a[_0xeb0b('0x1f')](0xc8);}})[_0xeb0b('0x4c')](handleError(_0x2c540a,null));};exports[_0xeb0b('0xac')]=function(_0x5e54db,_0x1e9245,_0x5b7d63){return BPromise[_0xeb0b('0x9f')]()[_0xeb0b('0x2a')](function(){if(!_0x5e54db[_0xeb0b('0x39')][_0xeb0b('0x8')]){throw new Error(_0xeb0b('0xa0'));}if(!_0x5e54db[_0xeb0b('0x39')][_0xeb0b('0xa1')]){throw new Error(_0xeb0b('0xa2'));}var _0x5b05bd=_0x5e54db['query'][_0xeb0b('0xa3')]?_0x5e54db[_0xeb0b('0x39')][_0xeb0b('0xa3')]+':'+_0x5e54db[_0xeb0b('0x39')][_0xeb0b('0xa1')]:_0xeb0b('0xa4')+_0x5e54db['query'][_0xeb0b('0xa1')];var _0x42e89f=_0x5e54db[_0xeb0b('0x39')][_0xeb0b('0x22')]?_0x5e54db[_0xeb0b('0x39')][_0xeb0b('0x22')]:!![];var _0x4e2abc=_0x5e54db['query'][_0xeb0b('0xa5')]?_0x5e54db[_0xeb0b('0x39')]['encoding']:null;var _0x233736={'method':_0x5e54db[_0xeb0b('0xad')],'uri':util[_0xeb0b('0x52')](_0xeb0b('0xa6'),_0x5b05bd,_0x5e54db[_0xeb0b('0x39')][_0xeb0b('0x8')]),'json':_0x42e89f,'resolveWithFullResponse':!![],'encoding':_0x4e2abc,'body':_0x5e54db[_0xeb0b('0x93')]};if(_0x5e54db[_0xeb0b('0xa7')]){_0x233736['headers']=_0x5e54db[_0xeb0b('0xa7')];if(_0x233736[_0xeb0b('0xa7')][_0xeb0b('0xa8')]){delete _0x233736[_0xeb0b('0xa7')][_0xeb0b('0xa8')];}}if(_0x233736[_0xeb0b('0xa7')][_0xeb0b('0xa9')]){delete _0x233736['headers'][_0xeb0b('0xa9')];}return rp(_0x233736);})[_0xeb0b('0x2a')](function(_0x331b4e){if(_0x331b4e){_0x1e9245[_0xeb0b('0x27')](_0x331b4e[_0xeb0b('0xa7')]);logger[_0xeb0b('0x69')](_0x331b4e[_0xeb0b('0x93')]);return _0x1e9245[_0xeb0b('0x20')](_0x331b4e[_0xeb0b('0xab')])[_0xeb0b('0x30')](_0x331b4e['body']);}else{return _0x1e9245['sendStatus'](0xc8);}})[_0xeb0b('0x4c')](handleError(_0x1e9245,null));}; \ No newline at end of file +var _0xecc3=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','sort','where','filters','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','download','join','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','dirname','basename','attachments/**/*','existsSync','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','extname','filename','server/files/plugins','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','parameters','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','body','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','archiver','ioredis'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xecc3,0x13c));var _0x3ecc=function(_0x511cc6,_0x12f08f){_0x511cc6=_0x511cc6-0x0;var _0x326955=_0xecc3[_0x511cc6];return _0x326955;};'use strict';var emlformat=require(_0x3ecc('0x0'));var rimraf=require(_0x3ecc('0x1'));var zipdir=require(_0x3ecc('0x2'));var jsonpatch=require(_0x3ecc('0x3'));var rp=require(_0x3ecc('0x4'));var moment=require(_0x3ecc('0x5'));var BPromise=require(_0x3ecc('0x6'));var Mustache=require(_0x3ecc('0x7'));var util=require(_0x3ecc('0x8'));var path=require(_0x3ecc('0x9'));var sox=require(_0x3ecc('0xa'));var csv=require(_0x3ecc('0xb'));var ejs=require(_0x3ecc('0xc'));var fs=require('fs');var fs_extra=require(_0x3ecc('0xd'));var _=require(_0x3ecc('0xe'));var squel=require(_0x3ecc('0xf'));var crypto=require(_0x3ecc('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3ecc('0x11'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0x3ecc('0x1'));var archiver=require(_0x3ecc('0x12'));var Redis=require(_0x3ecc('0x13'));var authService=require(_0x3ecc('0x14'));var qs=require(_0x3ecc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ecc('0x16'));var logger=require(_0x3ecc('0x17'))(_0x3ecc('0x18'));var utils=require(_0x3ecc('0x19'));var config=require(_0x3ecc('0x1a'));var licenseUtil=require(_0x3ecc('0x1b'));var db=require(_0x3ecc('0x1c'))['db'];config[_0x3ecc('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3ecc('0x1e'))(new Redis(config[_0x3ecc('0x1d')]));require(_0x3ecc('0x1f'))[_0x3ecc('0x20')](socket);function respondWithStatusCode(_0x354f7e,_0x5cb784){_0x5cb784=_0x5cb784||0xcc;return function(_0x2525b5){if(_0x2525b5){return _0x354f7e[_0x3ecc('0x21')](_0x5cb784);}return _0x354f7e[_0x3ecc('0x22')](_0x5cb784)[_0x3ecc('0x23')]();};}function respondWithResult(_0x77297f,_0x450023){_0x450023=_0x450023||0xc8;return function(_0x114e96){if(_0x114e96){return _0x77297f['status'](_0x450023)[_0x3ecc('0x24')](_0x114e96);}};}function respondWithFilteredResult(_0x5c6b7b,_0x26c3f0){return function(_0x32d4b4){if(_0x32d4b4){var _0x4d8c9e=typeof _0x26c3f0[_0x3ecc('0x25')]===_0x3ecc('0x26')&&typeof _0x26c3f0['limit']===_0x3ecc('0x26');var _0x9d39c7=_0x32d4b4[_0x3ecc('0x27')];var _0x4afd10=_0x4d8c9e?0x0:_0x26c3f0[_0x3ecc('0x25')];var _0x2f0b1a=_0x4d8c9e?_0x32d4b4['count']:_0x26c3f0[_0x3ecc('0x25')]+_0x26c3f0['limit'];var _0x5edc86;if(_0x2f0b1a>=_0x9d39c7){_0x2f0b1a=_0x9d39c7;_0x5edc86=0xc8;}else{_0x5edc86=0xce;}_0x5c6b7b[_0x3ecc('0x22')](_0x5edc86);return _0x5c6b7b[_0x3ecc('0x28')](_0x3ecc('0x29'),_0x4afd10+'-'+_0x2f0b1a+'/'+_0x9d39c7)['json'](_0x32d4b4);}return null;};}function patchUpdates(_0x2298e9){return function(_0x194675){try{jsonpatch[_0x3ecc('0x2a')](_0x194675,_0x2298e9,!![]);}catch(_0xf52fb9){return BPromise[_0x3ecc('0x2b')](_0xf52fb9);}return _0x194675['save']();};}function saveUpdates(_0x4bba72,_0x81c276){return function(_0x495c02){if(_0x495c02){return _0x495c02[_0x3ecc('0x2c')](_0x4bba72)['then'](function(_0x10ab1b){return _0x10ab1b;});}return null;};}function removeEntity(_0x22e015,_0x16e217){return function(_0x9da96){if(_0x9da96){return _0x9da96[_0x3ecc('0x2d')]()[_0x3ecc('0x2e')](function(){var _0x145f02=_0x9da96[_0x3ecc('0x2f')]({'plain':!![]});var _0x574f71='Plugins';return db[_0x3ecc('0x30')][_0x3ecc('0x2d')]({'where':{'type':_0x574f71,'resourceId':_0x145f02['id']}})[_0x3ecc('0x2e')](function(){return _0x9da96;});})[_0x3ecc('0x2e')](function(){_0x22e015[_0x3ecc('0x22')](0xcc)[_0x3ecc('0x23')]();});}};}function handleEntityNotFound(_0x13de04,_0x4380ef){return function(_0x28b0e5){if(!_0x28b0e5){_0x13de04['sendStatus'](0x194);}return _0x28b0e5;};}function handleError(_0x11f5f2,_0x20951c){_0x20951c=_0x20951c||0x1f4;return function(_0x4b70ac){logger[_0x3ecc('0x31')](_0x4b70ac[_0x3ecc('0x32')]);if(_0x4b70ac['name']){delete _0x4b70ac[_0x3ecc('0x33')];}_0x11f5f2[_0x3ecc('0x22')](_0x20951c)[_0x3ecc('0x34')](_0x4b70ac);};}exports[_0x3ecc('0x35')]=function(_0x63a015,_0x41f54c){var _0x5f4f6d={},_0x204a22={},_0x1a89c4={'count':0x0,'rows':[]};var _0x493fd5=_[_0x3ecc('0x36')](db[_0x3ecc('0x37')][_0x3ecc('0x38')],function(_0x1cc00a){return{'name':_0x1cc00a['fieldName'],'type':_0x1cc00a[_0x3ecc('0x39')]['key']};});_0x204a22[_0x3ecc('0x3a')]=_[_0x3ecc('0x36')](_0x493fd5,_0x3ecc('0x33'));_0x204a22[_0x3ecc('0x3b')]=_[_0x3ecc('0x3c')](_0x63a015['query']);_0x204a22['filters']=_[_0x3ecc('0x3d')](_0x204a22[_0x3ecc('0x3a')],_0x204a22[_0x3ecc('0x3b')]);_0x5f4f6d[_0x3ecc('0x3e')]=_[_0x3ecc('0x3d')](_0x204a22[_0x3ecc('0x3a')],qs[_0x3ecc('0x3f')](_0x63a015[_0x3ecc('0x3b')]['fields']));_0x5f4f6d[_0x3ecc('0x3e')]=_0x5f4f6d[_0x3ecc('0x3e')][_0x3ecc('0x40')]?_0x5f4f6d[_0x3ecc('0x3e')]:_0x204a22['model'];if(!_0x63a015[_0x3ecc('0x3b')]['hasOwnProperty'](_0x3ecc('0x41'))){_0x5f4f6d[_0x3ecc('0x42')]=qs['limit'](_0x63a015['query'][_0x3ecc('0x42')]);_0x5f4f6d[_0x3ecc('0x25')]=qs[_0x3ecc('0x25')](_0x63a015['query']['offset']);}_0x5f4f6d['order']=qs[_0x3ecc('0x43')](_0x63a015[_0x3ecc('0x3b')][_0x3ecc('0x43')]);_0x5f4f6d[_0x3ecc('0x44')]=qs[_0x3ecc('0x45')](_['pick'](_0x63a015[_0x3ecc('0x3b')],_0x204a22['filters']),_0x493fd5);if(_0x63a015['query'][_0x3ecc('0x46')]){_0x5f4f6d[_0x3ecc('0x44')]=_['merge'](_0x5f4f6d['where'],{'$or':_['map'](_0x493fd5,function(_0x12df98){if(_0x12df98[_0x3ecc('0x39')]!==_0x3ecc('0x47')){var _0x2b6d4e={};_0x2b6d4e[_0x12df98['name']]={'$like':'%'+_0x63a015['query'][_0x3ecc('0x46')]+'%'};return _0x2b6d4e;}})});}_0x5f4f6d=_[_0x3ecc('0x48')]({},_0x5f4f6d,_0x63a015[_0x3ecc('0x49')]);var _0x4690fe={'where':_0x5f4f6d['where']};return db[_0x3ecc('0x37')][_0x3ecc('0x27')](_0x4690fe)['then'](function(_0x2309f5){_0x1a89c4[_0x3ecc('0x27')]=_0x2309f5;if(_0x63a015[_0x3ecc('0x3b')]['includeAll']){_0x5f4f6d['include']=[{'all':!![]}];}return db[_0x3ecc('0x37')][_0x3ecc('0x4a')](_0x5f4f6d);})['then'](function(_0x5ac8bd){_0x1a89c4[_0x3ecc('0x4b')]=_0x5ac8bd;return _0x1a89c4;})[_0x3ecc('0x2e')](respondWithFilteredResult(_0x41f54c,_0x5f4f6d))[_0x3ecc('0x4c')](handleError(_0x41f54c,null));};exports[_0x3ecc('0x4d')]=function(_0x124e9a,_0x4a6232){var _0x5710d5={'raw':!![],'where':{'id':_0x124e9a[_0x3ecc('0x4e')]['id']}},_0x23fffe={};_0x23fffe[_0x3ecc('0x3a')]=_[_0x3ecc('0x3c')](db['Plugin'][_0x3ecc('0x38')]);_0x23fffe[_0x3ecc('0x3b')]=_['keys'](_0x124e9a[_0x3ecc('0x3b')]);_0x23fffe['filters']=_[_0x3ecc('0x3d')](_0x23fffe[_0x3ecc('0x3a')],_0x23fffe[_0x3ecc('0x3b')]);_0x5710d5['attributes']=_['intersection'](_0x23fffe[_0x3ecc('0x3a')],qs['fields'](_0x124e9a[_0x3ecc('0x3b')]['fields']));_0x5710d5[_0x3ecc('0x3e')]=_0x5710d5['attributes']['length']?_0x5710d5['attributes']:_0x23fffe[_0x3ecc('0x3a')];if(_0x124e9a['query'][_0x3ecc('0x4f')]){_0x5710d5[_0x3ecc('0x50')]=[{'all':!![]}];}_0x5710d5=_[_0x3ecc('0x48')]({},_0x5710d5,_0x124e9a[_0x3ecc('0x49')]);return db['Plugin'][_0x3ecc('0x51')](_0x5710d5)[_0x3ecc('0x2e')](handleEntityNotFound(_0x4a6232,null))[_0x3ecc('0x2e')](respondWithResult(_0x4a6232,null))['catch'](handleError(_0x4a6232,null));};exports[_0x3ecc('0x52')]=function(_0x11bc81,_0x2cf2a4,_0x2bbf98){return db['Plugin']['find']({'where':{'id':_0x11bc81[_0x3ecc('0x4e')]['id']},'attributes':['name',_0x3ecc('0x9')],'raw':!![]})[_0x3ecc('0x2e')](handleEntityNotFound(_0x2cf2a4,null))[_0x3ecc('0x2e')](function(_0x44b995){if(_0x44b995){var _0x3efde0=path[_0x3ecc('0x53')](config['root'],'server/files/plugins',util['format'](_0x3ecc('0x54'),path['basename'](_0x44b995['path'])));var _0x16f61f=fs[_0x3ecc('0x55')](_0x3efde0);var _0x23f38d=archiver(_0x3ecc('0x56'),{'zlib':{'level':0x9}});_0x23f38d['on'](_0x3ecc('0x57'),function(_0x313a5f){if(_0x313a5f[_0x3ecc('0x58')]===_0x3ecc('0x59')){logger[_0x3ecc('0x31')](_0x313a5f);}else{throw new db[(_0x3ecc('0x5a'))][(_0x3ecc('0x5b'))](_0x3ecc('0x5c'));}});_0x23f38d['on']('error',function(_0xd90126){throw new db['Sequelize'][(_0x3ecc('0x5b'))](_0x3ecc('0x5c'));});_0x23f38d[_0x3ecc('0x5d')](_0x16f61f);_0x23f38d[_0x3ecc('0x5e')](_0x3ecc('0x5f'),{'cwd':path['join'](config[_0x3ecc('0x60')],'server/files/plugins',path[_0x3ecc('0x61')](_0x44b995[_0x3ecc('0x9')])),'ignore':[path[_0x3ecc('0x53')](path[_0x3ecc('0x62')](_0x44b995['path']),'node_modules/**/*'),path[_0x3ecc('0x53')](path[_0x3ecc('0x62')](_0x44b995[_0x3ecc('0x9')]),_0x3ecc('0x63'))],'nodir':!![]})['finalize']();_0x16f61f['on']('close',function(){if(!fs[_0x3ecc('0x64')](_0x3efde0)){throw new db[(_0x3ecc('0x5a'))]['Error']('Plugin\x20not\x20found');}return _0x2cf2a4[_0x3ecc('0x52')](_0x3efde0,util[_0x3ecc('0x65')]('%s.zip',path['basename'](_0x44b995[_0x3ecc('0x9')])),function(_0x48f3a4){if(_0x48f3a4){throw new db[(_0x3ecc('0x5a'))]['Error'](_0x3ecc('0x66'));}fs[_0x3ecc('0x67')](_0x3efde0);logger[_0x3ecc('0x68')](_0x3ecc('0x69'));logger[_0x3ecc('0x68')](_0x3ecc('0x6a'));});});}return null;})[_0x3ecc('0x4c')](handleError(_0x2cf2a4,null));};exports['upload']=function(_0x370b0d,_0x8e0172,_0x30e1d0){var _0x519ed6=path[_0x3ecc('0x62')](_0x370b0d[_0x3ecc('0x6b')]['filename'],path[_0x3ecc('0x6c')](_0x370b0d[_0x3ecc('0x6b')][_0x3ecc('0x6d')]));var _0x5d2f7e=path[_0x3ecc('0x53')](config[_0x3ecc('0x60')],_0x3ecc('0x6e'),_0x370b0d[_0x3ecc('0x6b')][_0x3ecc('0x6d')]);var _0xa24814=path['join'](config['root'],_0x3ecc('0x6e'),_0x519ed6);logger[_0x3ecc('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x5d2f7e);logger[_0x3ecc('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0xa24814);try{fs[_0x3ecc('0x6f')](_0x5d2f7e,parseInt(_0x3ecc('0x70'),0x8));extract(_0x5d2f7e,{'dir':_0xa24814},function(_0xb2f7a9){if(_0xb2f7a9){logger[_0x3ecc('0x31')](_0xb2f7a9);handleError(_0xb2f7a9,!![]);};var _0x360f3f=fs['readdirSync'](_0xa24814);if(_0x360f3f[_0x3ecc('0x40')]>0x1){removeReferences(_0x5d2f7e,_0xa24814);logger[_0x3ecc('0x31')](_0x3ecc('0x71'));return _0x30e1d0(new Error(_0x3ecc('0x71')));}var _0x5e9493=fs[_0x3ecc('0x72')](path['join'](_0xa24814,_0x360f3f[0x0]));if(_0x5e9493['isFile']()){removeReferences(_0x5d2f7e,_0xa24814);logger['error'](_0x3ecc('0x71'));return _0x30e1d0(new Error(_0x3ecc('0x71')));}if(_0x5e9493['isDirectory']()){var _0x293dab=fs[_0x3ecc('0x73')](path['join'](_0xa24814,_0x360f3f[0x0]));if(_0x293dab[_0x3ecc('0x40')]===0x0){removeReferences(_0x5d2f7e,_0xa24814);logger[_0x3ecc('0x31')]('Invalid\x20plugin\x20structure');return _0x30e1d0(new Error(_0x3ecc('0x71')));}var _0x5dec07=_0x293dab['some'](function(_0x4e1677){return _0x4e1677===_0x3ecc('0x74');});if(!_0x5dec07){return _0x30e1d0(new Error(_0x3ecc('0x75')));}var _0x4f2fa8=fs[_0x3ecc('0x76')](path[_0x3ecc('0x53')](_0xa24814,_0x360f3f[0x0],_0x3ecc('0x74')));var _0x1914c6=JSON['parse'](_0x4f2fa8);if(_0x3ecc('0x26')==typeof _0x1914c6[_0x3ecc('0x33')]){return _0x30e1d0(new Error(_0x3ecc('0x77')));}if(_0x3ecc('0x26')==typeof _0x1914c6[_0x3ecc('0x39')]){return _0x30e1d0(new Error(_0x3ecc('0x78')));}if('undefined'==typeof _0x1914c6[_0x3ecc('0x79')]){return _0x30e1d0(new Error(_0x3ecc('0x7a')));}if(_0x3ecc('0x26')==typeof _0x1914c6['parameters']){return _0x30e1d0(new Error(_0x3ecc('0x7b')));}if(_0x1914c6[_0x3ecc('0x39')]===_0x3ecc('0x7c')){if(_0x3ecc('0x26')==typeof _0x1914c6['parameters'][_0x3ecc('0x7d')]){return _0x30e1d0(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x3ecc('0x26')==typeof _0x1914c6['parameters'][_0x3ecc('0x7d')]['admin']&&'undefined'==typeof _0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x7d')][_0x3ecc('0x7f')]){return _0x30e1d0(new Error(_0x3ecc('0x80')));}}else if(_0x1914c6[_0x3ecc('0x39')]===_0x3ecc('0x81')){if(_0x3ecc('0x26')==typeof _0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x82')]){return _0x30e1d0(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x3ecc('0x26')==typeof _0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x83')]){return _0x30e1d0(new Error(_0x3ecc('0x84')));}}else{return _0x30e1d0(new Error(_0x3ecc('0x85')));}var _0xd4e8d0=_0x1914c6[_0x3ecc('0x33')];var _0x36434f=_0x1914c6[_0x3ecc('0x86')];var _0x22ff8d=_0x1914c6[_0x3ecc('0x39')];var _0x30ec67=_0x1914c6[_0x3ecc('0x87')]?_0x1914c6[_0x3ecc('0x87')]:_0x3ecc('0x88');var _0x291ede=_0x1914c6['icon']?_0x1914c6['icon']:'icon-apps';var _0x2c1611='';var _0x5c3358='';var _0xf960a2='';var _0x3b271c='';var _0x1fcc8d=_0x1914c6[_0x3ecc('0x79')];if(_0x22ff8d===_0x3ecc('0x7c')){if(_0x3ecc('0x26')!=typeof _0x1914c6['parameters']['views'][_0x3ecc('0x89')]){var _0x178e36=_0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x3ecc('0x8a')](_0x178e36)){_0x2c1611=path[_0x3ecc('0x53')](_0x3ecc('0x8b'),_0x519ed6,_0x360f3f[0x0],_0x178e36);}else{_0x2c1611=_0x178e36;}}else{logger[_0x3ecc('0x68')](_0x3ecc('0x8c'));}if(_0x3ecc('0x26')!=typeof _0x1914c6[_0x3ecc('0x7e')]['views'][_0x3ecc('0x7f')]){var _0x567789=_0x1914c6[_0x3ecc('0x7e')]['views'][_0x3ecc('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x3ecc('0x8a')](_0x567789)){_0x5c3358=path[_0x3ecc('0x53')](_0x3ecc('0x8b'),_0x519ed6,_0x360f3f[0x0],_0x567789);}else{_0x5c3358=_0x567789;}}else{logger[_0x3ecc('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x22ff8d===_0x3ecc('0x81')){_0xf960a2=_0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x82')];_0x3b271c=_0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x83')];if('undefined'!=typeof _0x1914c6['parameters'][_0x3ecc('0x7d')]){if(_0x3ecc('0x26')!=typeof _0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x7d')][_0x3ecc('0x89')]){var _0x178e36=_0x1914c6['parameters'][_0x3ecc('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x3ecc('0x8a')](_0x178e36)){_0x2c1611=path[_0x3ecc('0x53')](_0x3ecc('0x8b'),_0x519ed6,_0x360f3f[0x0],_0x178e36);}else{_0x2c1611=_0x178e36;}}if(_0x3ecc('0x26')!=typeof _0x1914c6[_0x3ecc('0x7e')][_0x3ecc('0x7d')][_0x3ecc('0x7f')]){var _0x567789=_0x1914c6[_0x3ecc('0x7e')]['views'][_0x3ecc('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x3ecc('0x8a')](_0x567789)){_0x5c3358=path['join'](_0x3ecc('0x8b'),_0x519ed6,_0x360f3f[0x0],_0x567789);}else{_0x5c3358=_0x567789;}}}}var _0x4042a2={'name':_0xd4e8d0,'description':_0x36434f,'path':path[_0x3ecc('0x53')](_0x519ed6,_0x360f3f[0x0]),'type':_0x22ff8d,'sidebar':_0x30ec67,'icon':_0x291ede,'adminUrl':_0x2c1611,'agentUrl':_0x5c3358,'scriptName':_0xf960a2,'scriptPath':_0x3b271c,'version':_0x1fcc8d};removeReferences(_0x5d2f7e,null);return db['Plugin']['create'](_0x4042a2)[_0x3ecc('0x2e')](function(_0x42765b){var _0x104a25={'role':_0x370b0d[_0x3ecc('0x8d')][_0x3ecc('0x8e')],'userProfileId':_0x370b0d[_0x3ecc('0x8d')][_0x3ecc('0x8f')]};if(!_0x104a25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x104a25['role']===_0x3ecc('0x90')){var _0xff69e6=_0x42765b['get']({'plain':!![]});return db[_0x3ecc('0x91')][_0x3ecc('0x51')]({'where':{'name':_0x3ecc('0x92'),'userProfileId':_0x104a25[_0x3ecc('0x8f')]},'raw':!![]})['then'](function(_0x4f8b39){if(_0x4f8b39&&_0x4f8b39[_0x3ecc('0x93')]===0x0){return db[_0x3ecc('0x30')][_0x3ecc('0x94')]({'name':_0xff69e6[_0x3ecc('0x33')],'resourceId':_0xff69e6['id'],'type':_0x4f8b39[_0x3ecc('0x33')],'sectionId':_0x4f8b39['id']},{})[_0x3ecc('0x2e')](function(){return _0x42765b;});}else{return _0x42765b;}})[_0x3ecc('0x4c')](function(_0x408268){logger[_0x3ecc('0x31')](_0x3ecc('0x95'),_0x408268);throw _0x408268;});}return _0x42765b;})[_0x3ecc('0x2e')](respondWithResult(_0x8e0172,null))['catch'](handleError(_0x8e0172,null));}});}catch(_0x226a45){_0x8e0172[_0x3ecc('0x22')](0x1f4)[_0x3ecc('0x34')](_0x226a45);}};function removeReferences(_0x26b505,_0x102ec1){try{if(_0x26b505){fs[_0x3ecc('0x67')](_0x26b505);logger[_0x3ecc('0x68')](_0x3ecc('0x96'));}if(_0x102ec1){rimraf(_0x102ec1,function(){});logger[_0x3ecc('0x68')](_0x3ecc('0x97'));}}catch(_0x484efe){logger[_0x3ecc('0x31')](_0x484efe);}}exports['update']=function(_0x3d2921,_0x1f33ea,_0x39e3d6){return db[_0x3ecc('0x37')][_0x3ecc('0x51')]({'where':{'id':_0x3d2921[_0x3ecc('0x4e')]['id']}})[_0x3ecc('0x2e')](handleEntityNotFound(_0x1f33ea,null))['then'](saveUpdates(_0x3d2921['body'],null))[_0x3ecc('0x2e')](respondWithResult(_0x1f33ea,null))['catch'](handleError(_0x1f33ea,null));};exports[_0x3ecc('0x98')]=function(_0xdfd01a,_0x404a92,_0x49884b){return db['Plugin'][_0x3ecc('0x51')]({'where':{'id':_0xdfd01a[_0x3ecc('0x4e')]['id']}})[_0x3ecc('0x2e')](function(_0x59dd07){if(_0x59dd07){return _0x59dd07[_0x3ecc('0x2d')]();}})[_0x3ecc('0x2e')](function(_0x1bccaf){rimraf(path[_0x3ecc('0x53')](config[_0x3ecc('0x60')],'server/files/plugins',path[_0x3ecc('0x61')](_0x1bccaf[_0x3ecc('0x9')])),function(){});return _0x1bccaf;})[_0x3ecc('0x2e')](handleEntityNotFound(_0x404a92,null))[_0x3ecc('0x2e')](respondWithStatusCode(_0x404a92,null))[_0x3ecc('0x4c')](handleError(_0x404a92,null));};exports['webhookGet']=function(_0x3edb6a,_0x977d4,_0x5e85c6){return BPromise[_0x3ecc('0x99')]()['then'](function(){if(!_0x3edb6a['query']['path']){throw new Error(_0x3ecc('0x9a'));}if(!_0x3edb6a[_0x3ecc('0x3b')][_0x3ecc('0x9b')]){throw new Error(_0x3ecc('0x9c'));}var _0x1aafb0=_0x3edb6a['query'][_0x3ecc('0x9d')]?_0x3edb6a['query']['hostname']+':'+_0x3edb6a[_0x3ecc('0x3b')][_0x3ecc('0x9b')]:_0x3ecc('0x9e')+_0x3edb6a['query'][_0x3ecc('0x9b')];var _0x5dc6a2=_0x3edb6a[_0x3ecc('0x3b')][_0x3ecc('0x24')]?_0x3edb6a[_0x3ecc('0x3b')][_0x3ecc('0x24')]:!![];var _0x85a60b=_0x3edb6a['query'][_0x3ecc('0x9f')]?_0x3edb6a[_0x3ecc('0x3b')]['encoding']:null;var _0x5811d0={'method':_0x3edb6a[_0x3ecc('0xa0')],'uri':util[_0x3ecc('0x65')](_0x3ecc('0xa1'),_0x1aafb0,_0x3edb6a[_0x3ecc('0x3b')]['path']),'json':_0x5dc6a2,'resolveWithFullResponse':!![],'encoding':_0x85a60b,'qs':_0x3edb6a[_0x3ecc('0x3b')]};if(_0x3edb6a[_0x3ecc('0xa2')]){_0x5811d0[_0x3ecc('0xa2')]=_0x3edb6a[_0x3ecc('0xa2')];if(_0x5811d0[_0x3ecc('0xa2')]['content-length']){delete _0x5811d0['headers'][_0x3ecc('0xa3')];}}if(_0x5811d0[_0x3ecc('0xa2')][_0x3ecc('0xa4')]){delete _0x5811d0[_0x3ecc('0xa2')]['content-type'];}return rp(_0x5811d0);})[_0x3ecc('0x2e')](function(_0x1d8b2c){if(_0x1d8b2c){_0x977d4['set'](_0x1d8b2c[_0x3ecc('0xa2')]);logger[_0x3ecc('0x68')](_0x1d8b2c['body']);if(_[_0x3ecc('0xa5')](_0x3edb6a['query'][_0x3ecc('0x9')],_0x3ecc('0x52'))&&_0x1d8b2c[_0x3ecc('0xa6')]==0x1f4){return _0x977d4[_0x3ecc('0x21')](_0x1d8b2c[_0x3ecc('0xa6')]);}else{return _0x977d4['status'](_0x1d8b2c[_0x3ecc('0xa6')])[_0x3ecc('0x34')](_0x1d8b2c[_0x3ecc('0x8d')]);}}else{return _0x977d4[_0x3ecc('0x21')](0xc8);}})['catch'](handleError(_0x977d4,null));};exports[_0x3ecc('0xa7')]=function(_0x2b3e35,_0x118bc1,_0x13766f){return BPromise[_0x3ecc('0x99')]()[_0x3ecc('0x2e')](function(){if(!_0x2b3e35[_0x3ecc('0x3b')][_0x3ecc('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2b3e35[_0x3ecc('0x3b')][_0x3ecc('0x9b')]){throw new Error(_0x3ecc('0x9c'));}var _0xe061ca=_0x2b3e35[_0x3ecc('0x3b')]['hostname']?_0x2b3e35['query']['hostname']+':'+_0x2b3e35['query'][_0x3ecc('0x9b')]:_0x3ecc('0x9e')+_0x2b3e35[_0x3ecc('0x3b')][_0x3ecc('0x9b')];var _0x14b59d=_0x2b3e35[_0x3ecc('0x3b')]['json']?_0x2b3e35['query']['json']:!![];var _0x481a72=_0x2b3e35[_0x3ecc('0x3b')][_0x3ecc('0x9f')]?_0x2b3e35[_0x3ecc('0x3b')]['encoding']:null;var _0x141fe3={'method':_0x2b3e35['method'],'uri':util[_0x3ecc('0x65')](_0x3ecc('0xa1'),_0xe061ca,_0x2b3e35[_0x3ecc('0x3b')]['path']),'json':_0x14b59d,'resolveWithFullResponse':!![],'encoding':_0x481a72,'body':_0x2b3e35['body']};if(_0x2b3e35['headers']){_0x141fe3[_0x3ecc('0xa2')]=_0x2b3e35[_0x3ecc('0xa2')];if(_0x141fe3['headers']['content-length']){delete _0x141fe3['headers'][_0x3ecc('0xa3')];}}if(_0x141fe3[_0x3ecc('0xa2')]['content-type']){delete _0x141fe3[_0x3ecc('0xa2')][_0x3ecc('0xa4')];}return rp(_0x141fe3);})[_0x3ecc('0x2e')](function(_0x5cd524){if(_0x5cd524){_0x118bc1[_0x3ecc('0x28')](_0x5cd524[_0x3ecc('0xa2')]);logger[_0x3ecc('0x68')](_0x5cd524[_0x3ecc('0x8d')]);return _0x118bc1[_0x3ecc('0x22')](_0x5cd524['statusCode'])[_0x3ecc('0x34')](_0x5cd524['body']);}else{return _0x118bc1[_0x3ecc('0x21')](0xc8);}})[_0x3ecc('0x4c')](handleError(_0x118bc1,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 588a4a3..90e7b37 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 _0x30bc=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Plugin','save'];(function(_0x41d96d,_0x35eefb){var _0x2954c4=function(_0x17bf3e){while(--_0x17bf3e){_0x41d96d['push'](_0x41d96d['shift']());}};_0x2954c4(++_0x35eefb);}(_0x30bc,0x149));var _0xc30b=function(_0x39fd7e,_0x17607d){_0x39fd7e=_0x39fd7e-0x0;var _0x1d5746=_0x30bc[_0x39fd7e];return _0x1d5746;};'use strict';var EventEmitter=require(_0xc30b('0x0'));var Plugin=require(_0xc30b('0x1'))['db'][_0xc30b('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc30b('0x3'),'afterUpdate':_0xc30b('0x4'),'afterDestroy':_0xc30b('0x5')};function emitEvent(_0x357709){return function(_0x27c814,_0x2419e3,_0xa238d0){PluginEvents[_0xc30b('0x6')](_0x357709+':'+_0x27c814['id'],_0x27c814);PluginEvents[_0xc30b('0x6')](_0x357709,_0x27c814);_0xa238d0(null);};}for(var e in events){if(events[_0xc30b('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xc30b('0x8')]=PluginEvents; \ No newline at end of file +var _0x27a8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Plugin'];(function(_0x2e57b0,_0x424049){var _0x34ed3a=function(_0x41824c){while(--_0x41824c){_0x2e57b0['push'](_0x2e57b0['shift']());}};_0x34ed3a(++_0x424049);}(_0x27a8,0x170));var _0x827a=function(_0x50926d,_0x2c6072){_0x50926d=_0x50926d-0x0;var _0x434351=_0x27a8[_0x50926d];return _0x434351;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x827a('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x827a('0x1')](0x0);var events={'afterCreate':_0x827a('0x2'),'afterUpdate':_0x827a('0x3'),'afterDestroy':_0x827a('0x4')};function emitEvent(_0x300907){return function(_0x18cf5e,_0x215b35,_0x2b3486){PluginEvents[_0x827a('0x5')](_0x300907+':'+_0x18cf5e['id'],_0x18cf5e);PluginEvents[_0x827a('0x5')](_0x300907,_0x18cf5e);_0x2b3486(null);};}for(var e in events){if(events[_0x827a('0x6')](e)){var event=events[e];Plugin[_0x827a('0x7')](e,emitEvent(event));}}module[_0x827a('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 6da6c95..aba179a 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 _0xa408=['define','Plugin','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x1bebff,_0x22ded9){var _0x16cf52=function(_0x295e5d){while(--_0x295e5d){_0x1bebff['push'](_0x1bebff['shift']());}};_0x16cf52(++_0x22ded9);}(_0xa408,0x1d0));var _0x8a40=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0xa408[_0x334f9a];return _0x2b219d;};'use strict';var _=require(_0x8a40('0x0'));var util=require(_0x8a40('0x1'));var logger=require(_0x8a40('0x2'))(_0x8a40('0x3'));var moment=require(_0x8a40('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a40('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a40('0x6'));var config=require(_0x8a40('0x7'));var attributes=require(_0x8a40('0x8'));module['exports']=function(_0x29cd17,_0x2832cf){return _0x29cd17[_0x8a40('0x9')](_0x8a40('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed2c=['define','Plugin','plugins','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x59d4e,_0x51402e){var _0x371f3a=function(_0x1f1352){while(--_0x1f1352){_0x59d4e['push'](_0x59d4e['shift']());}};_0x371f3a(++_0x51402e);}(_0xed2c,0x19b));var _0xced2=function(_0xc5bb7f,_0x336c16){_0xc5bb7f=_0xc5bb7f-0x0;var _0x5ed8f7=_0xed2c[_0xc5bb7f];return _0x5ed8f7;};'use strict';var _=require(_0xced2('0x0'));var util=require(_0xced2('0x1'));var logger=require(_0xced2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xced2('0x3'));var rp=require(_0xced2('0x4'));var fs=require('fs');var path=require(_0xced2('0x5'));var rimraf=require(_0xced2('0x6'));var config=require(_0xced2('0x7'));var attributes=require(_0xced2('0x8'));module['exports']=function(_0x2137cb,_0x241bc0){return _0x2137cb[_0xced2('0x9')](_0xced2('0xa'),attributes,{'tableName':_0xced2('0xb'),'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 87c1b35..817ea34 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 _0x5ba7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','Plugin','create','body','options','raw','CreatePlugin','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2f97d5,_0x285487){var _0x256716=function(_0x3a7726){while(--_0x3a7726){_0x2f97d5['push'](_0x2f97d5['shift']());}};_0x256716(++_0x285487);}(_0x5ba7,0x1b5));var _0x75ba=function(_0x3b5263,_0x373177){_0x3b5263=_0x3b5263-0x0;var _0x3bf89d=_0x5ba7[_0x3b5263];return _0x3bf89d;};'use strict';var _=require(_0x75ba('0x0'));var util=require(_0x75ba('0x1'));var moment=require(_0x75ba('0x2'));var BPromise=require(_0x75ba('0x3'));var rs=require(_0x75ba('0x4'));var fs=require('fs');var Redis=require(_0x75ba('0x5'));var db=require(_0x75ba('0x6'))['db'];var utils=require(_0x75ba('0x7'));var logger=require(_0x75ba('0x8'))(_0x75ba('0x9'));var config=require(_0x75ba('0xa'));var jayson=require(_0x75ba('0xb'));var client=jayson[_0x75ba('0xc')][_0x75ba('0xd')]({'port':0x232a});config[_0x75ba('0xe')]=_['defaults'](config[_0x75ba('0xe')],{'host':_0x75ba('0xf'),'port':0x18eb});var socket=require(_0x75ba('0x10'))(new Redis(config[_0x75ba('0xe')]));require(_0x75ba('0x11'))['register'](socket);function respondWithRpcPromise(_0x46965c,_0xbaf087,_0x2a529d){return new BPromise(function(_0x9b621d,_0x92bd4a){return client[_0x75ba('0x12')](_0x46965c,_0x2a529d)[_0x75ba('0x13')](function(_0x9033d6){logger[_0x75ba('0x14')](_0x75ba('0x15'),_0xbaf087,'request\x20sent');logger[_0x75ba('0x16')](_0x75ba('0x17'),_0xbaf087,'request\x20sent',JSON['stringify'](_0x9033d6));if(_0x9033d6[_0x75ba('0x18')]){if(_0x9033d6[_0x75ba('0x18')][_0x75ba('0x19')]===0x1f4){logger['error'](_0x75ba('0x15'),_0xbaf087,_0x9033d6[_0x75ba('0x18')][_0x75ba('0x1a')]);return _0x92bd4a(_0x9033d6['error'][_0x75ba('0x1a')]);}logger[_0x75ba('0x18')]('Plugin,\x20%s,\x20%s',_0xbaf087,_0x9033d6[_0x75ba('0x18')][_0x75ba('0x1a')]);return _0x9b621d(_0x9033d6[_0x75ba('0x18')][_0x75ba('0x1a')]);}else{logger[_0x75ba('0x14')](_0x75ba('0x15'),_0xbaf087,_0x75ba('0x1b'));_0x9b621d(_0x9033d6[_0x75ba('0x1c')][_0x75ba('0x1a')]);}})[_0x75ba('0x1d')](function(_0x39ae3a){logger['error'](_0x75ba('0x15'),_0xbaf087,_0x39ae3a);_0x92bd4a(_0x39ae3a);});});}exports['CreatePlugin']=function(_0x4a40a0){var _0x50c6fe=this;return new Promise(function(_0x35970c,_0x38ef25){return db[_0x75ba('0x1e')][_0x75ba('0x1f')](_0x4a40a0[_0x75ba('0x20')],{'raw':_0x4a40a0[_0x75ba('0x21')]?_0x4a40a0['options'][_0x75ba('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x332cea){logger[_0x75ba('0x14')](_0x75ba('0x23'),_0x4a40a0);logger['debug'](_0x75ba('0x23'),_0x4a40a0,JSON[_0x75ba('0x24')](_0x332cea));_0x35970c(_0x332cea);})[_0x75ba('0x1d')](function(_0x7362ba){logger[_0x75ba('0x18')](_0x75ba('0x23'),_0x7362ba[_0x75ba('0x1a')],_0x4a40a0);_0x38ef25(_0x50c6fe[_0x75ba('0x18')](0x1f4,_0x7362ba[_0x75ba('0x1a')]));});});}; \ No newline at end of file +var _0x61d7=['debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw'];(function(_0x387ea3,_0x21fd7e){var _0x5aa402=function(_0x574cf7){while(--_0x574cf7){_0x387ea3['push'](_0x387ea3['shift']());}};_0x5aa402(++_0x21fd7e);}(_0x61d7,0x119));var _0x761d=function(_0x19bd2e,_0x17f0d9){_0x19bd2e=_0x19bd2e-0x0;var _0x803c05=_0x61d7[_0x19bd2e];return _0x803c05;};'use strict';var _=require(_0x761d('0x0'));var util=require(_0x761d('0x1'));var moment=require(_0x761d('0x2'));var BPromise=require(_0x761d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x761d('0x4'));var db=require(_0x761d('0x5'))['db'];var utils=require(_0x761d('0x6'));var logger=require(_0x761d('0x7'))(_0x761d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x761d('0x9')][_0x761d('0xa')]({'port':0x232a});config[_0x761d('0xb')]=_[_0x761d('0xc')](config[_0x761d('0xb')],{'host':_0x761d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x761d('0xb')]));require(_0x761d('0xe'))[_0x761d('0xf')](socket);function respondWithRpcPromise(_0x3a054b,_0x5d6d83,_0x51bdf0){return new BPromise(function(_0x46a2a2,_0xdece69){return client[_0x761d('0x10')](_0x3a054b,_0x51bdf0)[_0x761d('0x11')](function(_0x4ec2e9){logger[_0x761d('0x12')](_0x761d('0x13'),_0x5d6d83,_0x761d('0x14'));logger['debug'](_0x761d('0x15'),_0x5d6d83,'request\x20sent',JSON[_0x761d('0x16')](_0x4ec2e9));if(_0x4ec2e9[_0x761d('0x17')]){if(_0x4ec2e9[_0x761d('0x17')][_0x761d('0x18')]===0x1f4){logger[_0x761d('0x17')](_0x761d('0x13'),_0x5d6d83,_0x4ec2e9[_0x761d('0x17')]['message']);return _0xdece69(_0x4ec2e9[_0x761d('0x17')][_0x761d('0x19')]);}logger[_0x761d('0x17')](_0x761d('0x13'),_0x5d6d83,_0x4ec2e9['error'][_0x761d('0x19')]);return _0x46a2a2(_0x4ec2e9['error'][_0x761d('0x19')]);}else{logger[_0x761d('0x12')](_0x761d('0x13'),_0x5d6d83,_0x761d('0x14'));_0x46a2a2(_0x4ec2e9[_0x761d('0x1a')][_0x761d('0x19')]);}})[_0x761d('0x1b')](function(_0x5d6abf){logger['error'](_0x761d('0x13'),_0x5d6d83,_0x5d6abf);_0xdece69(_0x5d6abf);});});}exports[_0x761d('0x1c')]=function(_0x8546d1){var _0x52cb1c=this;return new Promise(function(_0x57ca5d,_0x1ba3e8){return db[_0x761d('0x1d')][_0x761d('0x1e')](_0x8546d1[_0x761d('0x1f')],{'raw':_0x8546d1[_0x761d('0x20')]?_0x8546d1['options'][_0x761d('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x4f0c8c){logger[_0x761d('0x12')](_0x761d('0x1c'),_0x8546d1);logger[_0x761d('0x22')](_0x761d('0x1c'),_0x8546d1,JSON[_0x761d('0x16')](_0x4f0c8c));_0x57ca5d(_0x4f0c8c);})[_0x761d('0x1b')](function(_0x1214d7){logger[_0x761d('0x17')](_0x761d('0x1c'),_0x1214d7[_0x761d('0x19')],_0x8546d1);_0x1ba3e8(_0x52cb1c[_0x761d('0x17')](0x1f4,_0x1214d7[_0x761d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 9e36dd6..077bfe1 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 _0x712f=['./plugin.events','save','remove','emit','removeListener','register','plugin:'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x712f,0x196));var _0xf712=function(_0x438218,_0x4f1aa0){_0x438218=_0x438218-0x0;var _0x5587f6=_0x712f[_0x438218];return _0x5587f6;};'use strict';var PluginEvents=require(_0xf712('0x0'));var events=[_0xf712('0x1'),_0xf712('0x2'),'update'];function createListener(_0x42f210,_0x53ddd6){return function(_0x214f15){_0x53ddd6[_0xf712('0x3')](_0x42f210,_0x214f15);};}function removeListener(_0x2d0c5d,_0xe2c09b){return function(){PluginEvents[_0xf712('0x4')](_0x2d0c5d,_0xe2c09b);};}exports[_0xf712('0x5')]=function(_0x152652){for(var _0x31c790=0x0,_0x3776ce=events['length'];_0x31c790<_0x3776ce;_0x31c790++){var _0x2926f8=events[_0x31c790];var _0xeabfee=createListener(_0xf712('0x6')+_0x2926f8,_0x152652);PluginEvents['on'](_0x2926f8,_0xeabfee);}}; \ No newline at end of file +var _0xf3be=['register','length','plugin:','./plugin.events','save','remove','update'];(function(_0x204c0a,_0x3daf68){var _0x5f7498=function(_0x5f2fbc){while(--_0x5f2fbc){_0x204c0a['push'](_0x204c0a['shift']());}};_0x5f7498(++_0x3daf68);}(_0xf3be,0x1ed));var _0xef3b=function(_0xac2026,_0x6428e0){_0xac2026=_0xac2026-0x0;var _0x15e1d2=_0xf3be[_0xac2026];return _0x15e1d2;};'use strict';var PluginEvents=require(_0xef3b('0x0'));var events=[_0xef3b('0x1'),_0xef3b('0x2'),_0xef3b('0x3')];function createListener(_0x2aaab0,_0x5f4f78){return function(_0x4a23a3){_0x5f4f78['emit'](_0x2aaab0,_0x4a23a3);};}function removeListener(_0x5494b5,_0x30adb2){return function(){PluginEvents['removeListener'](_0x5494b5,_0x30adb2);};}exports[_0xef3b('0x4')]=function(_0x5dedb8){for(var _0x53d9cd=0x0,_0x43f06d=events[_0xef3b('0x5')];_0x53d9cd<_0x43f06d;_0x53d9cd++){var _0x1b3abe=events[_0x53d9cd];var _0x382f00=createListener(_0xef3b('0x6')+_0x1b3abe,_0x5dedb8);PluginEvents['on'](_0x1b3abe,_0x382f00);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 51621d3..0cc87d0 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 _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x243869,_0x18bf48){var _0x1173f1=function(_0x5795d5){while(--_0x5795d5){_0x243869['push'](_0x243869['shift']());}};_0x1173f1(++_0x18bf48);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x4a29f1,_0x23e312){var _0xe71461=function(_0x552bff){while(--_0x552bff){_0x4a29f1['push'](_0x4a29f1['shift']());}};_0xe71461(++_0x23e312);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index ac85988..57f0802 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 _0x984b=['reject','express','motion2','catch','show','describe','params','create','body','script','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','destroy','delete','Unknown\x20id','api','path','child_process','status','json','error','stack','name','send','npm\x20install','info','index','list','then'];(function(_0x48c9ae,_0xdedb5b){var _0x2ea996=function(_0x52e04b){while(--_0x52e04b){_0x48c9ae['push'](_0x48c9ae['shift']());}};_0x2ea996(++_0xdedb5b);}(_0x984b,0xee));var _0xb984=function(_0x369b7b,_0x3fb6f4){_0x369b7b=_0x369b7b-0x0;var _0x3b6f6e=_0x984b[_0x369b7b];return _0x3b6f6e;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xb984('0x0'));var path=require(_0xb984('0x1'));var exec=require(_0xb984('0x2'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x8384b0,_0x340f2c){return function(_0x4d8f6a){if(!_0x4d8f6a){_0x8384b0['sendStatus'](0x194);;}return _0x4d8f6a;};}function respondWithResult(_0x2cca53,_0x46c541){_0x46c541=_0x46c541||0xc8;return function(_0x5a605a){if(_0x5a605a){return _0x2cca53[_0xb984('0x3')](_0x46c541)[_0xb984('0x4')](_0x5a605a);}return null;};}function handleError(_0x4d72b7,_0x37fd36){_0x37fd36=_0x37fd36||0x1f4;return function(_0x4e6b9a){logger[_0xb984('0x5')](_0x4e6b9a[_0xb984('0x6')]);if(_0x4e6b9a[_0xb984('0x7')]){delete _0x4e6b9a[_0xb984('0x7')];}_0x4d72b7[_0xb984('0x3')](_0x37fd36)[_0xb984('0x8')](_0x4e6b9a);};}function execChildProcess(){return new BPromise(function(_0x11525c,_0xfca315){exec(_0xb984('0x9'),function(_0x3c3e8a,_0x1f107f,_0x39e612){logger['info'](_0x1f107f);logger[_0xb984('0xa')](_0x39e612);if(_0x3c3e8a){logger['error'](_0x3c3e8a);return _0xfca315(_0x3c3e8a);}return _0x11525c(_0x1f107f);});});}exports[_0xb984('0xb')]=function(_0x2dba22,_0x594a5e){return pm2[_0xb984('0xc')]()[_0xb984('0xd')](function(_0x564d24){if(_0x564d24){var _0x203dba=_[_0xb984('0xe')](_0x564d24,function(_0x549791){return _0x549791[_0xb984('0x7')]===_0xb984('0xf')||_0x549791['name']===_0xb984('0x10');});return{'rows':_0x203dba,'count':_0x203dba['length']};}return null;})[_0xb984('0xd')](respondWithResult(_0x594a5e,null))[_0xb984('0x11')](handleError(_0x594a5e,null));};exports[_0xb984('0x12')]=function(_0x3f7cff,_0x59dcb7){return pm2[_0xb984('0x13')](_0x3f7cff[_0xb984('0x14')]['id'])[_0xb984('0xd')](respondWithResult(_0x59dcb7,null))[_0xb984('0xd')](handleEntityNotFound(_0x59dcb7,null))[_0xb984('0x11')](handleError(_0x59dcb7,null));};exports[_0xb984('0x15')]=function(_0x5c2e25,_0x2492f4){if(_0x5c2e25[_0xb984('0x16')][_0xb984('0x7')]&&_0x5c2e25[_0xb984('0x16')][_0xb984('0x17')]){var _0xcf9365=path['join'](__dirname,_0xb984('0x18'),_0x5c2e25[_0xb984('0x16')]['script']);var _0x44b570=process[_0xb984('0x19')]();process[_0xb984('0x1a')](path[_0xb984('0x1b')](_0xcf9365));return execChildProcess()[_0xb984('0xd')](function(_0x286033){process[_0xb984('0x1a')](_0x44b570);return pm2['start']({'name':_0x5c2e25[_0xb984('0x16')][_0xb984('0x7')],'script':_0xcf9365});})[_0xb984('0xd')](function(_0x5d4d38){pm2[_0xb984('0x1c')]();return _0x5d4d38[0x0];})[_0xb984('0xd')](respondWithResult(_0x2492f4,0xc9))[_0xb984('0x11')](handleError(_0x2492f4,null));}else{return _0x2492f4[_0xb984('0x3')](0x1f4)[_0xb984('0x8')]({'message':_0xb984('0x1d')});}};exports[_0xb984('0x1e')]=function(_0x4b3da0,_0x5d93d9){if(_0x4b3da0[_0xb984('0x16')]['id']){delete _0x4b3da0[_0xb984('0x16')]['id'];}var _0x3e254b={'online':_0xb984('0x1f'),'stopped':'stop'};if(_0x3e254b[_0xb984('0x20')](_0x4b3da0[_0xb984('0x16')][_0xb984('0x3')])){return pm2[_0x3e254b[_0x4b3da0['body'][_0xb984('0x3')]]](_0x4b3da0[_0xb984('0x14')]['id'])[_0xb984('0xd')](respondWithResult(_0x5d93d9,0xc8))[_0xb984('0x11')](handleError(_0x5d93d9,null));}else{return _0x5d93d9['status'](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0xb984('0x21')]=function(_0x23ecf6,_0x58a98c){if(_0x23ecf6[_0xb984('0x16')]['id']){delete _0x23ecf6[_0xb984('0x16')]['id'];}if(_0x23ecf6[_0xb984('0x14')]['id']){return pm2[_0xb984('0x22')](_0x23ecf6['params']['id'])['then'](function(_0x315f70){pm2[_0xb984('0x1c')]();return _0x315f70[0x0];})[_0xb984('0xd')](respondWithResult(_0x58a98c,null))[_0xb984('0x11')](handleError(_0x58a98c,null));}else{return _0x58a98c['status'](0x1f4)[_0xb984('0x8')]({'message':_0xb984('0x23')});}}; \ No newline at end of file +var _0xb58b=['Unknown\x20status','destroy','params','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','child_process','exec','sendStatus','status','json','error','stack','name','npm\x20install','info','list','then','reject','motion2','length','describe','catch','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x536691,_0x511fb3){var _0xd37702=function(_0x6ae782){while(--_0x6ae782){_0x536691['push'](_0x536691['shift']());}};_0xd37702(++_0x511fb3);}(_0xb58b,0x1f1));var _0xbb58=function(_0x59124a,_0x9c3ec6){_0x59124a=_0x59124a-0x0;var _0xe72d8c=_0xb58b[_0x59124a];return _0xe72d8c;};'use strict';var _=require('lodash');var pm2=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var path=require('path');var exec=require(_0xbb58('0x3'))[_0xbb58('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x226363,_0x546510){return function(_0x2edb10){if(!_0x2edb10){_0x226363[_0xbb58('0x5')](0x194);;}return _0x2edb10;};}function respondWithResult(_0x33fe85,_0x5cf8b1){_0x5cf8b1=_0x5cf8b1||0xc8;return function(_0x27cbda){if(_0x27cbda){return _0x33fe85[_0xbb58('0x6')](_0x5cf8b1)[_0xbb58('0x7')](_0x27cbda);}return null;};}function handleError(_0x5d7fe8,_0xd94f1){_0xd94f1=_0xd94f1||0x1f4;return function(_0x3e3144){logger[_0xbb58('0x8')](_0x3e3144[_0xbb58('0x9')]);if(_0x3e3144[_0xbb58('0xa')]){delete _0x3e3144[_0xbb58('0xa')];}_0x5d7fe8[_0xbb58('0x6')](_0xd94f1)['send'](_0x3e3144);};}function execChildProcess(){return new BPromise(function(_0x80ab3a,_0x5c3bf7){exec(_0xbb58('0xb'),function(_0x440392,_0x26d8e6,_0x19d185){logger['info'](_0x26d8e6);logger[_0xbb58('0xc')](_0x19d185);if(_0x440392){logger[_0xbb58('0x8')](_0x440392);return _0x5c3bf7(_0x440392);}return _0x80ab3a(_0x26d8e6);});});}exports['index']=function(_0x132511,_0xdc68b9){return pm2[_0xbb58('0xd')]()[_0xbb58('0xe')](function(_0x19ceda){if(_0x19ceda){var _0x58245f=_[_0xbb58('0xf')](_0x19ceda,function(_0x23fd15){return _0x23fd15['name']==='express'||_0x23fd15[_0xbb58('0xa')]===_0xbb58('0x10');});return{'rows':_0x58245f,'count':_0x58245f[_0xbb58('0x11')]};}return null;})['then'](respondWithResult(_0xdc68b9,null))['catch'](handleError(_0xdc68b9,null));};exports['show']=function(_0x55156e,_0x28637b){return pm2[_0xbb58('0x12')](_0x55156e['params']['id'])[_0xbb58('0xe')](respondWithResult(_0x28637b,null))['then'](handleEntityNotFound(_0x28637b,null))[_0xbb58('0x13')](handleError(_0x28637b,null));};exports[_0xbb58('0x14')]=function(_0x3c33d9,_0xb8f982){if(_0x3c33d9[_0xbb58('0x15')][_0xbb58('0xa')]&&_0x3c33d9[_0xbb58('0x15')]['script']){var _0x84f34=path[_0xbb58('0x16')](__dirname,_0xbb58('0x17'),_0x3c33d9[_0xbb58('0x15')][_0xbb58('0x18')]);var _0x5d4a91=process[_0xbb58('0x19')]();process[_0xbb58('0x1a')](path[_0xbb58('0x1b')](_0x84f34));return execChildProcess()['then'](function(_0x27806d){process['chdir'](_0x5d4a91);return pm2[_0xbb58('0x1c')]({'name':_0x3c33d9[_0xbb58('0x15')][_0xbb58('0xa')],'script':_0x84f34});})[_0xbb58('0xe')](function(_0x2d111c){pm2[_0xbb58('0x1d')]();return _0x2d111c[0x0];})[_0xbb58('0xe')](respondWithResult(_0xb8f982,0xc9))[_0xbb58('0x13')](handleError(_0xb8f982,null));}else{return _0xb8f982['status'](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x1f')});}};exports[_0xbb58('0x20')]=function(_0x129094,_0x8e9ed9){if(_0x129094[_0xbb58('0x15')]['id']){delete _0x129094[_0xbb58('0x15')]['id'];}var _0x2ce7c3={'online':_0xbb58('0x21'),'stopped':_0xbb58('0x22')};if(_0x2ce7c3[_0xbb58('0x23')](_0x129094[_0xbb58('0x15')][_0xbb58('0x6')])){return pm2[_0x2ce7c3[_0x129094[_0xbb58('0x15')][_0xbb58('0x6')]]](_0x129094['params']['id'])[_0xbb58('0xe')](respondWithResult(_0x8e9ed9,0xc8))[_0xbb58('0x13')](handleError(_0x8e9ed9,null));}else{return _0x8e9ed9[_0xbb58('0x6')](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x24')});}};exports[_0xbb58('0x25')]=function(_0x1ba526,_0x643e0e){if(_0x1ba526[_0xbb58('0x15')]['id']){delete _0x1ba526['body']['id'];}if(_0x1ba526[_0xbb58('0x26')]['id']){return pm2[_0xbb58('0x27')](_0x1ba526[_0xbb58('0x26')]['id'])[_0xbb58('0xe')](function(_0xdbbe7b){pm2[_0xbb58('0x1d')]();return _0xdbbe7b[0x0];})[_0xbb58('0xe')](respondWithResult(_0x643e0e,null))[_0xbb58('0x13')](handleError(_0x643e0e,null));}else{return _0x643e0e[_0xbb58('0x6')](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 43b1df8..cdc424a 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cc6=['isAuthenticated','getAgents','get','/queues','getQueues','exports','express','../../components/auth/service','./realtime.controller','/agents'];(function(_0x4c239c,_0x27bb92){var _0x1c8e3b=function(_0xc41b2){while(--_0xc41b2){_0x4c239c['push'](_0x4c239c['shift']());}};_0x1c8e3b(++_0x27bb92);}(_0x5cc6,0x6a));var _0x65cc=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x5cc6[_0x5c9307];return _0x373e29;};'use strict';var express=require(_0x65cc('0x0'));var router=express['Router']();var auth=require(_0x65cc('0x1'));var controller=require(_0x65cc('0x2'));router['get'](_0x65cc('0x3'),auth[_0x65cc('0x4')](),controller[_0x65cc('0x5')]);router[_0x65cc('0x6')](_0x65cc('0x7'),auth[_0x65cc('0x4')](),controller[_0x65cc('0x8')]);module[_0x65cc('0x9')]=router; \ No newline at end of file +var _0x4e35=['./realtime.controller','get','isAuthenticated','getAgents','/queues','exports','express'];(function(_0x170b20,_0x49fc52){var _0xbe0395=function(_0x410eea){while(--_0x410eea){_0x170b20['push'](_0x170b20['shift']());}};_0xbe0395(++_0x49fc52);}(_0x4e35,0xf4));var _0x54e3=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0x4e35[_0x379799];return _0x46e431;};'use strict';var express=require(_0x54e3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x54e3('0x1'));router[_0x54e3('0x2')]('/agents',auth[_0x54e3('0x3')](),controller[_0x54e3('0x4')]);router[_0x54e3('0x2')](_0x54e3('0x5'),auth['isAuthenticated'](),controller['getQueues']);module[_0x54e3('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index d337940..5979414 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a28=['rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','type','key','getOptions','sequelize','literal','FIELD(id,','forEach','merge','where','user','role','userProfileId','Agents','agent','assign','UserProfile','getResources','findAndCountAll','getAgentStatus','Status','sortAgentsByStatus','getQueues','Queue','all','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','name','send','request','Queues','then','error','format','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','voice','outbound','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','pick','filter','queue','length','some','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','voiceStatus','online','User','startCase','Pause','findAll','QueueId','push','getChannels','includes','toLowerCase','getAgents','globalQueueFilter','query','globalStatusFilter','pauseTypeFilter','pause','*pause','channel','sort','globalStatus','validateSortParameter','join','order','getRealtimeAgents'];(function(_0x3b9cce,_0x567f2b){var _0x1ba8fd=function(_0x737441){while(--_0x737441){_0x3b9cce['push'](_0x3b9cce['shift']());}};_0x1ba8fd(++_0x567f2b);}(_0x3a28,0x9b));var _0x83a2=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x3a28[_0x1035c1];return _0x308d67;};'use strict';var util=require(_0x83a2('0x0'));var _=require(_0x83a2('0x1'));var jayson=require(_0x83a2('0x2'));var rta=require(_0x83a2('0x3'));var qs=require(_0x83a2('0x4'));var utils=require(_0x83a2('0x5'));var logger=require(_0x83a2('0x6'))(_0x83a2('0x7'));var db=require(_0x83a2('0x8'))['db'];var amiClient=jayson[_0x83a2('0x9')][_0x83a2('0xa')]({'port':0x232a});var routingClient=jayson[_0x83a2('0x9')]['http']({'port':0x232c});function respondWithFilteredResult(_0x1fb7c3,_0x40aef4){return function(_0x576989){if(_0x576989){var _0x35f57b=typeof _0x40aef4[_0x83a2('0xb')]===_0x83a2('0xc')&&typeof _0x40aef4[_0x83a2('0xd')]===_0x83a2('0xc');var _0xe434ee=_0x576989[_0x83a2('0xe')];var _0x1727bb=_0x35f57b?0x0:_0x40aef4[_0x83a2('0xb')];var _0x297983=_0x35f57b?_0x576989[_0x83a2('0xe')]:_0x40aef4['offset']+_0x40aef4[_0x83a2('0xd')];var _0x25def3;if(_0x297983>=_0xe434ee){_0x297983=_0xe434ee;_0x25def3=0xc8;}else{_0x25def3=0xce;}_0x1fb7c3[_0x83a2('0xf')](_0x25def3);return _0x1fb7c3[_0x83a2('0x10')](_0x83a2('0x11'),_0x1727bb+'-'+_0x297983+'/'+_0xe434ee)[_0x83a2('0x12')](_0x576989);}return null;};}function handleError(_0x56df0b,_0x50e5d6){_0x50e5d6=_0x50e5d6||0x1f4;return function(_0x1640fb){logger['error'](_0x1640fb['stack']);if(_0x1640fb[_0x83a2('0x13')]){delete _0x1640fb['name'];}_0x56df0b[_0x83a2('0xf')](_0x50e5d6)[_0x83a2('0x14')](_0x1640fb);};}function getRealtimeQueues(_0x5a282d,_0x3e7b8e){return new Promise(function(_0x2a82d2,_0xd71db4){var _0x52ac99=_0x3e7b8e==='voice'?amiClient:routingClient;return _0x52ac99[_0x83a2('0x15')](_['startCase'](_0x3e7b8e)+_0x83a2('0x16'),_0x5a282d)[_0x83a2('0x17')](function(_0x2de7e0){if(_0x2de7e0[_0x83a2('0x18')])throw new Error(util[_0x83a2('0x19')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x3e7b8e));return _0x2a82d2(_0x2de7e0[_0x83a2('0x1a')]);})[_0x83a2('0x1b')](function(_0x2b55e2){_0xd71db4(_0x2b55e2);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x392ca1,_0x138997){return amiClient[_0x83a2('0x15')](_0x83a2('0x1c'),{})[_0x83a2('0x17')](function(_0x1a10cb){if(_0x1a10cb[_0x83a2('0x18')])throw new Error(_0x83a2('0x1d'));return _0x392ca1(_0x1a10cb[_0x83a2('0x1a')]);})['catch'](function(_0x2d72e3){_0x138997(_0x2d72e3);});});}function initializeQueues(_0x2cf15e,_0x30d974,_0x593e28,_0x468ae0){var _0x38146d=[_0x83a2('0x1e'),_0x83a2('0x1f'),_0x83a2('0x20'),_0x83a2('0x21'),_0x83a2('0x22')];if(_0x593e28===_0x83a2('0x23')&&_0x468ae0===_0x83a2('0x24')){_0x38146d['push'](_0x83a2('0x25'),_0x83a2('0x26'),_0x83a2('0x27'),_0x83a2('0x28'),_0x83a2('0x29'),_0x83a2('0x2a'),'startPredictive',_0x83a2('0x2b'),_0x83a2('0x2c'),_0x83a2('0x2d'),_0x83a2('0x2e'),_0x83a2('0x2f'),'dialPredictiveInterval',_0x83a2('0x30'),_0x83a2('0x31'),'predictiveIntervalAvailable',_0x83a2('0x32'),'predictiveIntervalAnsweredCalls',_0x83a2('0x33'),_0x83a2('0x34'),_0x83a2('0x35'),_0x83a2('0x36'));}return _0x2cf15e[_0x83a2('0x37')](function(_0x1ac92d){var _0x2e6ee6=_0x1ac92d[_0x83a2('0x38')]({'plain':!![]});_0x2e6ee6[_0x83a2('0x39')]=[];_0x2e6ee6[_0x83a2('0x22')]=0x0;_0x2e6ee6[_0x83a2('0x3a')]=0x0;_0x2e6ee6[_0x83a2('0x1e')]=0x0;_0x2e6ee6[_0x83a2('0x1f')]=0x0;_0x2e6ee6['waiting']=0x0;if(_0x593e28===_0x83a2('0x23')){_0x2e6ee6[_0x83a2('0x21')]=0x0;_0x2e6ee6[_0x83a2('0x3b')]=0x0;if(_0x468ae0===_0x83a2('0x24')){_0x2e6ee6[_0x83a2('0x25')]=0x0;_0x2e6ee6[_0x83a2('0x26')]=0x0;}}var _0x261f4e=_['find'](_0x30d974,['id',_0x2e6ee6['id']]);if(_0x261f4e)_['merge'](_0x2e6ee6,_[_0x83a2('0x3c')](_0x261f4e,_0x38146d));return _0x2e6ee6;});}function updateAgentVoiceStatus(_0x547594,_0x4b2cb0,_0x4a407e){var _0x45d772=_[_0x83a2('0x3d')](_0x4a407e,[_0x83a2('0x3e'),_0x4b2cb0[_0x83a2('0x13')]]);if(_0x45d772[_0x83a2('0x3f')]===0x0)return _0x547594[_0x83a2('0x3b')]=!![];if(_[_0x83a2('0x40')](_0x45d772,[_0x83a2('0x41'),_0x547594[_0x83a2('0x42')][_0x83a2('0x43')]()]))return _0x547594[_0x83a2('0x21')]=!![];if(!_0x547594['talking'])return _0x547594[_0x83a2('0x3b')]=!![];}function getVoiceQueueAgents(_0x391a15,_0x408acc,_0x37709e,_0x218d51){var _0x8e0370=_[_0x83a2('0x44')](_0x408acc,['id',_0x391a15['id']]);if(!_0x8e0370)return _0x391a15;return _0x8e0370[_0x83a2('0x45')]({'raw':!![]})[_0x83a2('0x17')](function(_0x59057c){for(var _0x16e47a=0x0;_0x16e47a<_0x59057c['length'];_0x16e47a++){var _0x4be710=_[_0x83a2('0x44')](_0x37709e,['id',_0x59057c[_0x16e47a][_0x83a2('0x46')]]);if(!_0x4be710){_0x4be710={'id':_0x59057c[_0x16e47a][_0x83a2('0x46')],'name':_0x59057c[_0x16e47a]['UserId'],'accountcode':'','online':![]};}var _0x28d024={'id':_0x4be710['id'],'name':_0x4be710[_0x83a2('0x13')],'internal':_0x4be710[_0x83a2('0x47')],'online':Boolean(_0x4be710['online']),'paused':Boolean(_0x59057c[_0x16e47a]['paused'])};if(_0x4be710[_0x83a2('0x48')]===_0x83a2('0x21'))updateAgentVoiceStatus(_0x28d024,_0x391a15,_0x218d51);if(_0x28d024[_0x83a2('0x49')])_0x391a15[_0x83a2('0x3a')]++;if(_0x28d024[_0x83a2('0x3b')])_0x391a15[_0x83a2('0x3b')]++;if(_0x28d024[_0x83a2('0x22')]&&!_0x28d024[_0x83a2('0x3b')]&&!_0x28d024[_0x83a2('0x21')])_0x391a15[_0x83a2('0x22')]++;_0x391a15[_0x83a2('0x39')]['push'](_0x28d024);}return _0x391a15;});}function getQueueAgents(_0x116e39,_0x44a16b,_0x47b462){var _0x459a98=_0x83a2('0x4a')+_[_0x83a2('0x4b')](_0x47b462)+'Queue';var _0x22123b=_0x47b462+_0x83a2('0x4c');return db[_0x459a98][_0x83a2('0x4d')]({'where':{[_[_0x83a2('0x4b')](_0x47b462)+_0x83a2('0x4e')]:_0x116e39['id']},'raw':!![]})['then'](function(_0x47cbe9){for(var _0x40e076=0x0;_0x40e076<_0x47cbe9[_0x83a2('0x3f')];_0x40e076++){var _0x2c588f=_[_0x83a2('0x44')](_0x44a16b,['id',_0x47cbe9[_0x40e076][_0x83a2('0x46')]]);if(!_0x2c588f){_0x2c588f={'id':_0x47cbe9[_0x40e076][_0x83a2('0x46')],'name':_0x47cbe9[_0x40e076][_0x83a2('0x46')],'online':![],['pauseField']:![]};}var _0x2cfee6={'id':_0x2c588f['id'],'name':_0x2c588f[_0x83a2('0x13')],'online':Boolean(_0x2c588f[_0x83a2('0x49')]),'paused':Boolean(_0x2c588f[_0x22123b])};if(_0x2cfee6[_0x83a2('0x49')])_0x116e39[_0x83a2('0x3a')]++;_0x116e39[_0x83a2('0x39')][_0x83a2('0x4f')](_0x2cfee6);}return _0x116e39;});}function validateChannel(_0x2a513f){var _0x2ebf4e=utils[_0x83a2('0x50')]();if(!_[_0x83a2('0x51')](_0x2ebf4e,_0x2a513f[_0x83a2('0x52')]()))throw new Error('Invalid\x20channel');return _0x2a513f[_0x83a2('0x52')]();}exports[_0x83a2('0x53')]=function(_0x1a8892,_0x5e2534){var _0x588bf4={'count':0x0,'rows':[]};var _0x4f0108={};var _0x1b5d1d;var _0x5a9e5d;var _0x28aeb1;var _0x5c765b;var _0x42dfa1=utils['getChannels']();var _0x3f325d=_0x1a8892['query'][_0x83a2('0x54')];var _0x1c8224=_0x1a8892[_0x83a2('0x55')][_0x83a2('0x56')];var _0xb15882=_0x1a8892[_0x83a2('0x55')][_0x83a2('0x57')];var _0x607742=_0x1c8224===_0x83a2('0x58')||_0x1c8224===_0x83a2('0x59')?!![]:![];var _0x461ca3=[];var _0x3bbacf;Promise['resolve']()[_0x83a2('0x17')](function(){if(_0x1a8892[_0x83a2('0x55')][_0x83a2('0x5a')]){_0x1b5d1d=validateChannel(_0x1a8892['query']['channel']);}if(!_0x1a8892['query'][_0x83a2('0x5b')]||!_0x1a8892[_0x83a2('0x55')][_0x83a2('0x5b')][_0x83a2('0x51')](_0x83a2('0x5c'))){_0x1a8892[_0x83a2('0x55')]['sort']=rta[_0x83a2('0x5d')](_0x1a8892[_0x83a2('0x55')][_0x83a2('0x5b')]);return;}var _0x29697d=rta['getUpdatedSortOptions'](_0x1a8892[_0x83a2('0x55')][_0x83a2('0x5b')]);_0x1a8892[_0x83a2('0x55')]['sort']=_0x29697d['fields'][_0x83a2('0x5e')](',');_0x5a9e5d=_0x29697d[_0x83a2('0x5f')];})[_0x83a2('0x17')](function(){if(!_0x3f325d){return[];}return rta['getAgentIdsByQueues'](_0x3f325d,_0x1b5d1d);})[_0x83a2('0x17')](function(_0x2d289c){_0x461ca3=_0x2d289c;return rta[_0x83a2('0x60')]();})['then'](function(_0x86d936){_0x5c765b=_0x86d936[_0x83a2('0x61')];if((!_0x1c8224||_0x607742)&&!_0x5a9e5d){return _0x461ca3;}if(_0x5a9e5d&&!_0x1c8224){return rta[_0x83a2('0x62')](_0x5c765b,_0x461ca3,_0x5a9e5d);}else{return rta[_0x83a2('0x63')](_0x5c765b,_0x461ca3,_0x1c8224);}})[_0x83a2('0x17')](function(_0x1ed12c){_0x461ca3=_0x1ed12c;var _0x7d8c6=![];if(_0x461ca3[_0x83a2('0x3f')]===0x0){if(_0x3f325d||_0x1c8224){_0x7d8c6=!![];}if(_0x607742){_0x7d8c6=![];}}if(_0x7d8c6){return _0x588bf4;}var _0x3776d8=_['map'](db[_0x83a2('0x4a')][_0x83a2('0x64')],function(_0x4317d1){return{'name':_0x4317d1[_0x83a2('0x65')],'type':_0x4317d1[_0x83a2('0x66')][_0x83a2('0x67')]};});_0x1a8892[_0x83a2('0x55')]['role']='agent';_0x1a8892[_0x83a2('0x55')][_0x83a2('0x49')]=!![];_0x4f0108=qs[_0x83a2('0x68')](_0x3776d8,_0x1a8892);_0x4f0108['raw']=!![];var _0x21f5bb=[];if(_0x461ca3[_0x83a2('0x3f')]>0x0){_0x21f5bb[_0x83a2('0x4f')]({'id':{'$in':_0x461ca3}});if(_0x5a9e5d&&!_0x1c8224){_0x3bbacf=[db[_0x83a2('0x69')][_0x83a2('0x6a')](_0x83a2('0x6b')+_0x461ca3+')')];_0x4f0108['order']=_0x3bbacf;}}if(_0x607742){_0x42dfa1[_0x83a2('0x6c')](function(_0x998568){var _0x5e5b16=!![];if(_0x1c8224===_0x83a2('0x59')&&_0x1b5d1d!==_0x998568){_0x5e5b16=![];}_0x21f5bb[_0x83a2('0x4f')]({[_0x998568+'Pause']:_0x5e5b16});});if(_0xb15882){_0x21f5bb[_0x83a2('0x4f')]({'pauseType':_0xb15882});}}else if(_0x1c8224){_0x42dfa1[_0x83a2('0x6c')](function(_0x5ac2a8){_0x21f5bb[_0x83a2('0x4f')]({[_0x5ac2a8+_0x83a2('0x4c')]:![]});});}_0x4f0108['where']=_[_0x83a2('0x6d')](_0x4f0108[_0x83a2('0x6e')],{'$and':_0x21f5bb});if(_0x1a8892[_0x83a2('0x6f')][_0x83a2('0x70')]===_0x83a2('0x6f')){var _0xbb5118={'params':{'id':_0x1a8892['user'][_0x83a2('0x71')]},'query':{'section':_0x83a2('0x72'),'role':_0x83a2('0x73'),'online':!![],'raw':!![],'ids':_0x461ca3,'customSorting':_0x3bbacf}};if(_0x607742){_0xbb5118[_0x83a2('0x55')]['extraQueryConditions']=_0x21f5bb;}_0xbb5118['query']=Object[_0x83a2('0x74')](_0xbb5118[_0x83a2('0x55')],_0x1a8892['query']);delete _0xbb5118['query']['id'];return db[_0x83a2('0x75')][_0x83a2('0x76')](_0xbb5118);}return db[_0x83a2('0x4a')][_0x83a2('0x77')](_0x4f0108);})[_0x83a2('0x17')](function(_0x9d7ec6){_0x588bf4[_0x83a2('0xe')]=_0x9d7ec6[_0x83a2('0xe')];_0x28aeb1=_0x9d7ec6[_0x83a2('0x61')];return _0x28aeb1[_0x83a2('0x37')](function(_0x2d01d0){var _0x33c197=_[_0x83a2('0x44')](_0x5c765b,['id',_0x2d01d0['id']]);if(_0x33c197){var _0x2c41cb=rta['filterAgentAttributes'](_0x33c197);_[_0x83a2('0x6d')](_0x2d01d0,_0x2c41cb);}_0x2d01d0[_0x83a2('0x5c')]=rta[_0x83a2('0x78')](_0x2d01d0);if(_0x2d01d0[_0x83a2('0x5c')][_0x83a2('0x51')]('pause')){_0x42dfa1[_0x83a2('0x6c')](function(_0x2020d2){if(_0x2d01d0[_0x2020d2+_0x83a2('0x4c')]){_0x2d01d0[_0x2020d2+_0x83a2('0x79')]='pause';}});}return _0x2d01d0;});})[_0x83a2('0x17')](function(_0x5a3439){if(!_0x5a9e5d||_0x3bbacf){return _0x5a3439;}return rta[_0x83a2('0x7a')](_0x5a3439,_0x5a9e5d);})[_0x83a2('0x17')](function(_0x5eb36d){_0x588bf4[_0x83a2('0x61')]=_0x5eb36d;return _0x588bf4;})[_0x83a2('0x17')](respondWithFilteredResult(_0x5e2534,_0x4f0108))[_0x83a2('0x1b')](handleError(_0x5e2534,null));};exports[_0x83a2('0x7b')]=function(_0x8cae40,_0x6a9704){var _0x298781={'count':0x0,'rows':[]},_0x1db4ba={},_0x6a371e,_0x15d2b4,_0x36e61b,_0x42c40f,_0x724e79;Promise['resolve']()[_0x83a2('0x17')](function(){if(_0x8cae40[_0x83a2('0x55')][_0x83a2('0x5a')])_0x6a371e=validateChannel(_0x8cae40[_0x83a2('0x55')][_0x83a2('0x5a')]);var _0x522f92=_[_0x83a2('0x4b')](_0x6a371e)+_0x83a2('0x7c');var _0x2b551d=_[_0x83a2('0x37')](db[_0x522f92][_0x83a2('0x64')],function(_0x23acfe){return{'name':_0x23acfe[_0x83a2('0x65')],'type':_0x23acfe[_0x83a2('0x66')]['key']};});_0x1db4ba=qs[_0x83a2('0x68')](_0x2b551d,_0x8cae40);if(_0x8cae40[_0x83a2('0x6f')][_0x83a2('0x70')]==='user'){var _0x4591d1={'params':{'id':_0x8cae40[_0x83a2('0x6f')][_0x83a2('0x71')]},'query':{'section':_0x6a371e==='voice'&&_0x8cae40[_0x83a2('0x55')][_0x83a2('0x66')]===_0x83a2('0x24')?'QueueCampaigns':_[_0x83a2('0x4b')](_0x6a371e)+'Queues','type':_0x8cae40[_0x83a2('0x55')][_0x83a2('0x66')],'nolimit':!![],'sort':_0x83a2('0x13'),'filter':_0x8cae40[_0x83a2('0x55')][_0x83a2('0x3d')]}};return db['UserProfile'][_0x83a2('0x76')](_0x4591d1);}return db[_0x522f92][_0x83a2('0x77')](_0x1db4ba);})[_0x83a2('0x17')](function(_0x278c19){_0x298781[_0x83a2('0xe')]=_0x278c19[_0x83a2('0xe')];_0x15d2b4=_0x278c19['rows'];return getRealtimeQueues(_0x8cae40,_0x6a371e);})['then'](function(_0x7b6ee6){_0x42c40f=_0x7b6ee6[_0x83a2('0x61')];return rta[_0x83a2('0x60')]();})[_0x83a2('0x17')](function(_0x4ef872){_0x36e61b=_0x4ef872[_0x83a2('0x61')];if(_0x6a371e!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x83a2('0x17')](function(_0x515408){_0x724e79=_0x515408?_0x515408['rows']:[];return initializeQueues(_0x15d2b4,_0x42c40f,_0x6a371e,_0x8cae40[_0x83a2('0x55')]['type']);})[_0x83a2('0x17')](function(_0x49b4a6){var _0x561948=_0x49b4a6[_0x83a2('0x37')](function(_0x4be614){if(_0x6a371e===_0x83a2('0x23'))return getVoiceQueueAgents(_0x4be614,_0x15d2b4,_0x36e61b,_0x724e79);else return getQueueAgents(_0x4be614,_0x36e61b,_0x6a371e);});return Promise[_0x83a2('0x7d')](_0x561948);})['then'](function(_0x46aaa0){_0x298781[_0x83a2('0x61')]=_0x46aaa0;return _0x298781;})[_0x83a2('0x17')](respondWithFilteredResult(_0x6a9704,_0x1db4ba))[_0x83a2('0x1b')](handleError(_0x6a9704,null));}; \ No newline at end of file +var _0xafb9=['Status','getQueues','resolve','Queue','fieldName','type','QueueCampaigns','util','lodash','jayson/promise','../../components/realtime/agents','../../config/utils','../../config/logger','api','../../mysqldb','client','http','limit','offset','count','status','json','error','stack','name','send','voice','request','startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','busy','find','merge','pick','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','voiceStatus','online','findAll','QueueId','getChannels','includes','toLowerCase','getAgents','globalQueueFilter','query','pauseTypeFilter','pause','*pause','channel','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','order','getRealtimeAgents','rows','map','User','rawAttributes','key','role','agent','getOptions','raw','sequelize','forEach','where','user','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','getAgentStatus','Pause'];(function(_0xa7909c,_0x99066d){var _0x34153e=function(_0x558322){while(--_0x558322){_0xa7909c['push'](_0xa7909c['shift']());}};_0x34153e(++_0x99066d);}(_0xafb9,0x7d));var _0x9afb=function(_0x2924b8,_0x228080){_0x2924b8=_0x2924b8-0x0;var _0x574eb4=_0xafb9[_0x2924b8];return _0x574eb4;};'use strict';var util=require(_0x9afb('0x0'));var _=require(_0x9afb('0x1'));var jayson=require(_0x9afb('0x2'));var rta=require(_0x9afb('0x3'));var qs=require('../../components/parsers/qs');var utils=require(_0x9afb('0x4'));var logger=require(_0x9afb('0x5'))(_0x9afb('0x6'));var db=require(_0x9afb('0x7'))['db'];var amiClient=jayson[_0x9afb('0x8')][_0x9afb('0x9')]({'port':0x232a});var routingClient=jayson[_0x9afb('0x8')][_0x9afb('0x9')]({'port':0x232c});function respondWithFilteredResult(_0x38ee83,_0x1a396e){return function(_0x153d95){if(_0x153d95){var _0x53e045=typeof _0x1a396e['offset']==='undefined'&&typeof _0x1a396e[_0x9afb('0xa')]==='undefined';var _0xfaf3a1=_0x153d95['count'];var _0x3bffd8=_0x53e045?0x0:_0x1a396e[_0x9afb('0xb')];var _0x2dc9d2=_0x53e045?_0x153d95[_0x9afb('0xc')]:_0x1a396e[_0x9afb('0xb')]+_0x1a396e['limit'];var _0x2c0aca;if(_0x2dc9d2>=_0xfaf3a1){_0x2dc9d2=_0xfaf3a1;_0x2c0aca=0xc8;}else{_0x2c0aca=0xce;}_0x38ee83[_0x9afb('0xd')](_0x2c0aca);return _0x38ee83['set']('Content-Range',_0x3bffd8+'-'+_0x2dc9d2+'/'+_0xfaf3a1)[_0x9afb('0xe')](_0x153d95);}return null;};}function handleError(_0x3463ef,_0x35f8b5){_0x35f8b5=_0x35f8b5||0x1f4;return function(_0x3c14dd){logger[_0x9afb('0xf')](_0x3c14dd[_0x9afb('0x10')]);if(_0x3c14dd[_0x9afb('0x11')]){delete _0x3c14dd[_0x9afb('0x11')];}_0x3463ef['status'](_0x35f8b5)[_0x9afb('0x12')](_0x3c14dd);};}function getRealtimeQueues(_0x4d58ac,_0x180b66){return new Promise(function(_0x30c485,_0x19f26a){var _0x1ab05d=_0x180b66===_0x9afb('0x13')?amiClient:routingClient;return _0x1ab05d[_0x9afb('0x14')](_[_0x9afb('0x15')](_0x180b66)+_0x9afb('0x16'),_0x4d58ac)[_0x9afb('0x17')](function(_0x3cb6e1){if(_0x3cb6e1[_0x9afb('0xf')])throw new Error(util[_0x9afb('0x18')](_0x9afb('0x19'),_0x180b66));return _0x30c485(_0x3cb6e1[_0x9afb('0x1a')]);})[_0x9afb('0x1b')](function(_0x14ec2a){_0x19f26a(_0x14ec2a);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x15c69a,_0x56b8e3){return amiClient[_0x9afb('0x14')](_0x9afb('0x1c'),{})['then'](function(_0x22a859){if(_0x22a859[_0x9afb('0xf')])throw new Error(_0x9afb('0x1d'));return _0x15c69a(_0x22a859[_0x9afb('0x1a')]);})[_0x9afb('0x1b')](function(_0x1ec2df){_0x56b8e3(_0x1ec2df);});});}function initializeQueues(_0x523bcb,_0x544032,_0x2f11b0,_0x21d471){var _0x3ff032=[_0x9afb('0x1e'),'available',_0x9afb('0x1f'),_0x9afb('0x20'),_0x9afb('0x21')];if(_0x2f11b0===_0x9afb('0x13')&&_0x21d471===_0x9afb('0x22')){_0x3ff032[_0x9afb('0x23')](_0x9afb('0x24'),_0x9afb('0x25'),_0x9afb('0x26'),_0x9afb('0x27'),'dialMethod',_0x9afb('0x28'),_0x9afb('0x29'),_0x9afb('0x2a'),_0x9afb('0x2b'),_0x9afb('0x2c'),_0x9afb('0x2d'),_0x9afb('0x2e'),_0x9afb('0x2f'),_0x9afb('0x30'),_0x9afb('0x31'),_0x9afb('0x32'),_0x9afb('0x33'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x9afb('0x34'),_0x9afb('0x35'),_0x9afb('0x36'));}return _0x523bcb['map'](function(_0x255a59){var _0xd73522=_0x255a59[_0x9afb('0x37')]({'plain':!![]});_0xd73522[_0x9afb('0x38')]=[];_0xd73522['paused']=0x0;_0xd73522[_0x9afb('0x39')]=0x0;_0xd73522['loggedIn']=0x0;_0xd73522['available']=0x0;_0xd73522['waiting']=0x0;if(_0x2f11b0===_0x9afb('0x13')){_0xd73522[_0x9afb('0x20')]=0x0;_0xd73522[_0x9afb('0x3a')]=0x0;if(_0x21d471===_0x9afb('0x22')){_0xd73522['pTalking']=0x0;_0xd73522['originated']=0x0;}}var _0x5e9a6f=_[_0x9afb('0x3b')](_0x544032,['id',_0xd73522['id']]);if(_0x5e9a6f)_[_0x9afb('0x3c')](_0xd73522,_[_0x9afb('0x3d')](_0x5e9a6f,_0x3ff032));return _0xd73522;});}function updateAgentVoiceStatus(_0x239821,_0x97fdca,_0x45c9bc){var _0x218f21=_['filter'](_0x45c9bc,[_0x9afb('0x3e'),_0x97fdca[_0x9afb('0x11')]]);if(_0x218f21[_0x9afb('0x3f')]===0x0)return _0x239821[_0x9afb('0x3a')]=!![];if(_[_0x9afb('0x40')](_0x218f21,[_0x9afb('0x41'),_0x239821[_0x9afb('0x42')][_0x9afb('0x43')]()]))return _0x239821[_0x9afb('0x20')]=!![];if(!_0x239821[_0x9afb('0x20')])return _0x239821[_0x9afb('0x3a')]=!![];}function getVoiceQueueAgents(_0x55ef3d,_0x53811b,_0x5bbd31,_0x345c58){var _0x336318=_[_0x9afb('0x3b')](_0x53811b,['id',_0x55ef3d['id']]);if(!_0x336318)return _0x55ef3d;return _0x336318[_0x9afb('0x44')]({'raw':!![]})['then'](function(_0x2dd8fc){for(var _0x16f9b3=0x0;_0x16f9b3<_0x2dd8fc[_0x9afb('0x3f')];_0x16f9b3++){var _0x39c866=_[_0x9afb('0x3b')](_0x5bbd31,['id',_0x2dd8fc[_0x16f9b3]['UserId']]);if(!_0x39c866){_0x39c866={'id':_0x2dd8fc[_0x16f9b3][_0x9afb('0x45')],'name':_0x2dd8fc[_0x16f9b3][_0x9afb('0x45')],'accountcode':'','online':![]};}var _0x4ef773={'id':_0x39c866['id'],'name':_0x39c866[_0x9afb('0x11')],'internal':_0x39c866['accountcode'],'online':Boolean(_0x39c866['online']),'paused':Boolean(_0x2dd8fc[_0x16f9b3][_0x9afb('0x21')])};if(_0x39c866[_0x9afb('0x46')]===_0x9afb('0x20'))updateAgentVoiceStatus(_0x4ef773,_0x55ef3d,_0x345c58);if(_0x4ef773[_0x9afb('0x47')])_0x55ef3d[_0x9afb('0x39')]++;if(_0x4ef773['busy'])_0x55ef3d[_0x9afb('0x3a')]++;if(_0x4ef773[_0x9afb('0x21')]&&!_0x4ef773[_0x9afb('0x3a')]&&!_0x4ef773['talking'])_0x55ef3d[_0x9afb('0x21')]++;_0x55ef3d[_0x9afb('0x38')][_0x9afb('0x23')](_0x4ef773);}return _0x55ef3d;});}function getQueueAgents(_0x33e001,_0x59af73,_0x3e818e){var _0x92150d='User'+_['startCase'](_0x3e818e)+'Queue';var _0x2a0e00=_0x3e818e+'Pause';return db[_0x92150d][_0x9afb('0x48')]({'where':{[_['startCase'](_0x3e818e)+_0x9afb('0x49')]:_0x33e001['id']},'raw':!![]})[_0x9afb('0x17')](function(_0x44e12e){for(var _0x453e13=0x0;_0x453e13<_0x44e12e['length'];_0x453e13++){var _0x2ebcb8=_['find'](_0x59af73,['id',_0x44e12e[_0x453e13][_0x9afb('0x45')]]);if(!_0x2ebcb8){_0x2ebcb8={'id':_0x44e12e[_0x453e13][_0x9afb('0x45')],'name':_0x44e12e[_0x453e13][_0x9afb('0x45')],'online':![],['pauseField']:![]};}var _0x1cfa6f={'id':_0x2ebcb8['id'],'name':_0x2ebcb8[_0x9afb('0x11')],'online':Boolean(_0x2ebcb8[_0x9afb('0x47')]),'paused':Boolean(_0x2ebcb8[_0x2a0e00])};if(_0x1cfa6f[_0x9afb('0x47')])_0x33e001[_0x9afb('0x39')]++;_0x33e001[_0x9afb('0x38')][_0x9afb('0x23')](_0x1cfa6f);}return _0x33e001;});}function validateChannel(_0x463f4e){var _0x1f788f=utils[_0x9afb('0x4a')]();if(!_[_0x9afb('0x4b')](_0x1f788f,_0x463f4e['toLowerCase']()))throw new Error('Invalid\x20channel');return _0x463f4e[_0x9afb('0x4c')]();}exports[_0x9afb('0x4d')]=function(_0x1ecccd,_0x2571b0){var _0x3dae56={'count':0x0,'rows':[]};var _0x405665={};var _0x1f64ba;var _0x947374;var _0x332134;var _0x3a8dcb;var _0x2c1dfc=utils['getChannels']();var _0x245ed9=_0x1ecccd['query'][_0x9afb('0x4e')];var _0xec6d06=_0x1ecccd[_0x9afb('0x4f')]['globalStatusFilter'];var _0x4e0a23=_0x1ecccd['query'][_0x9afb('0x50')];var _0x2378b1=_0xec6d06===_0x9afb('0x51')||_0xec6d06===_0x9afb('0x52')?!![]:![];var _0x51eb7b=[];var _0x1b7e83;Promise['resolve']()['then'](function(){if(_0x1ecccd['query'][_0x9afb('0x53')]){_0x1f64ba=validateChannel(_0x1ecccd[_0x9afb('0x4f')]['channel']);}if(!_0x1ecccd[_0x9afb('0x4f')][_0x9afb('0x54')]||!_0x1ecccd[_0x9afb('0x4f')][_0x9afb('0x54')][_0x9afb('0x4b')](_0x9afb('0x55'))){_0x1ecccd['query']['sort']=rta[_0x9afb('0x56')](_0x1ecccd['query']['sort']);return;}var _0x526c23=rta[_0x9afb('0x57')](_0x1ecccd[_0x9afb('0x4f')][_0x9afb('0x54')]);_0x1ecccd[_0x9afb('0x4f')][_0x9afb('0x54')]=_0x526c23['fields']['join'](',');_0x947374=_0x526c23[_0x9afb('0x58')];})[_0x9afb('0x17')](function(){if(!_0x245ed9){return[];}return rta['getAgentIdsByQueues'](_0x245ed9,_0x1f64ba);})[_0x9afb('0x17')](function(_0xbfe203){_0x51eb7b=_0xbfe203;return rta[_0x9afb('0x59')]();})[_0x9afb('0x17')](function(_0x7ac72c){_0x3a8dcb=_0x7ac72c[_0x9afb('0x5a')];if((!_0xec6d06||_0x2378b1)&&!_0x947374){return _0x51eb7b;}if(_0x947374&&!_0xec6d06){return rta['getSortedAgentsIdsByStatus'](_0x3a8dcb,_0x51eb7b,_0x947374);}else{return rta['getAgentIdsByStatus'](_0x3a8dcb,_0x51eb7b,_0xec6d06);}})[_0x9afb('0x17')](function(_0x30946b){_0x51eb7b=_0x30946b;var _0x4abb2e=![];if(_0x51eb7b[_0x9afb('0x3f')]===0x0){if(_0x245ed9||_0xec6d06){_0x4abb2e=!![];}if(_0x2378b1){_0x4abb2e=![];}}if(_0x4abb2e){return _0x3dae56;}var _0x3c3761=_[_0x9afb('0x5b')](db[_0x9afb('0x5c')][_0x9afb('0x5d')],function(_0x486b57){return{'name':_0x486b57['fieldName'],'type':_0x486b57['type'][_0x9afb('0x5e')]};});_0x1ecccd['query'][_0x9afb('0x5f')]=_0x9afb('0x60');_0x1ecccd[_0x9afb('0x4f')][_0x9afb('0x47')]=!![];_0x405665=qs[_0x9afb('0x61')](_0x3c3761,_0x1ecccd);_0x405665[_0x9afb('0x62')]=!![];var _0x1283ba=[];if(_0x51eb7b[_0x9afb('0x3f')]>0x0){_0x1283ba[_0x9afb('0x23')]({'id':{'$in':_0x51eb7b}});if(_0x947374&&!_0xec6d06){_0x1b7e83=[db[_0x9afb('0x63')]['literal']('FIELD(id,'+_0x51eb7b+')')];_0x405665[_0x9afb('0x58')]=_0x1b7e83;}}if(_0x2378b1){_0x2c1dfc[_0x9afb('0x64')](function(_0x536e50){var _0x148f99=!![];if(_0xec6d06==='*pause'&&_0x1f64ba!==_0x536e50){_0x148f99=![];}_0x1283ba[_0x9afb('0x23')]({[_0x536e50+'Pause']:_0x148f99});});if(_0x4e0a23){_0x1283ba['push']({'pauseType':_0x4e0a23});}}else if(_0xec6d06){_0x2c1dfc[_0x9afb('0x64')](function(_0x272db3){_0x1283ba[_0x9afb('0x23')]({[_0x272db3+'Pause']:![]});});}_0x405665[_0x9afb('0x65')]=_[_0x9afb('0x3c')](_0x405665[_0x9afb('0x65')],{'$and':_0x1283ba});if(_0x1ecccd[_0x9afb('0x66')][_0x9afb('0x5f')]===_0x9afb('0x66')){var _0x5129d3={'params':{'id':_0x1ecccd[_0x9afb('0x66')]['userProfileId']},'query':{'section':_0x9afb('0x67'),'role':_0x9afb('0x60'),'online':!![],'raw':!![],'ids':_0x51eb7b,'customSorting':_0x1b7e83}};if(_0x2378b1){_0x5129d3['query'][_0x9afb('0x68')]=_0x1283ba;}_0x5129d3[_0x9afb('0x4f')]=Object[_0x9afb('0x69')](_0x5129d3[_0x9afb('0x4f')],_0x1ecccd[_0x9afb('0x4f')]);delete _0x5129d3[_0x9afb('0x4f')]['id'];return db[_0x9afb('0x6a')][_0x9afb('0x6b')](_0x5129d3);}return db['User'][_0x9afb('0x6c')](_0x405665);})[_0x9afb('0x17')](function(_0x596682){_0x3dae56[_0x9afb('0xc')]=_0x596682['count'];_0x332134=_0x596682[_0x9afb('0x5a')];return _0x332134[_0x9afb('0x5b')](function(_0x4abf28){var _0xddf486=_[_0x9afb('0x3b')](_0x3a8dcb,['id',_0x4abf28['id']]);if(_0xddf486){var _0x1f3dc8=rta['filterAgentAttributes'](_0xddf486);_[_0x9afb('0x3c')](_0x4abf28,_0x1f3dc8);}_0x4abf28[_0x9afb('0x55')]=rta[_0x9afb('0x6d')](_0x4abf28);if(_0x4abf28['globalStatus'][_0x9afb('0x4b')](_0x9afb('0x51'))){_0x2c1dfc[_0x9afb('0x64')](function(_0x3d31b8){if(_0x4abf28[_0x3d31b8+_0x9afb('0x6e')]){_0x4abf28[_0x3d31b8+_0x9afb('0x6f')]=_0x9afb('0x51');}});}return _0x4abf28;});})[_0x9afb('0x17')](function(_0x366d6f){if(!_0x947374||_0x1b7e83){return _0x366d6f;}return rta['sortAgentsByStatus'](_0x366d6f,_0x947374);})[_0x9afb('0x17')](function(_0xb7f660){_0x3dae56[_0x9afb('0x5a')]=_0xb7f660;return _0x3dae56;})['then'](respondWithFilteredResult(_0x2571b0,_0x405665))[_0x9afb('0x1b')](handleError(_0x2571b0,null));};exports[_0x9afb('0x70')]=function(_0xe684ef,_0x468743){var _0x4bfb35={'count':0x0,'rows':[]},_0x4505f0={},_0x42dc3a,_0x464111,_0x452d79,_0x45f863,_0x35d54a;Promise[_0x9afb('0x71')]()[_0x9afb('0x17')](function(){if(_0xe684ef[_0x9afb('0x4f')][_0x9afb('0x53')])_0x42dc3a=validateChannel(_0xe684ef[_0x9afb('0x4f')][_0x9afb('0x53')]);var _0x17b0e0=_['startCase'](_0x42dc3a)+_0x9afb('0x72');var _0x1d8c18=_[_0x9afb('0x5b')](db[_0x17b0e0][_0x9afb('0x5d')],function(_0x1868d3){return{'name':_0x1868d3[_0x9afb('0x73')],'type':_0x1868d3[_0x9afb('0x74')][_0x9afb('0x5e')]};});_0x4505f0=qs['getOptions'](_0x1d8c18,_0xe684ef);if(_0xe684ef[_0x9afb('0x66')][_0x9afb('0x5f')]===_0x9afb('0x66')){var _0x2e6e59={'params':{'id':_0xe684ef['user']['userProfileId']},'query':{'section':_0x42dc3a===_0x9afb('0x13')&&_0xe684ef[_0x9afb('0x4f')][_0x9afb('0x74')]===_0x9afb('0x22')?_0x9afb('0x75'):_['startCase'](_0x42dc3a)+_0x9afb('0x16'),'type':_0xe684ef[_0x9afb('0x4f')][_0x9afb('0x74')],'nolimit':!![],'sort':_0x9afb('0x11'),'filter':_0xe684ef[_0x9afb('0x4f')]['filter']}};return db[_0x9afb('0x6a')][_0x9afb('0x6b')](_0x2e6e59);}return db[_0x17b0e0][_0x9afb('0x6c')](_0x4505f0);})[_0x9afb('0x17')](function(_0x5e1531){_0x4bfb35[_0x9afb('0xc')]=_0x5e1531[_0x9afb('0xc')];_0x464111=_0x5e1531[_0x9afb('0x5a')];return getRealtimeQueues(_0xe684ef,_0x42dc3a);})[_0x9afb('0x17')](function(_0x14e88f){_0x45f863=_0x14e88f['rows'];return rta[_0x9afb('0x59')]();})['then'](function(_0x5991b9){_0x452d79=_0x5991b9[_0x9afb('0x5a')];if(_0x42dc3a!=_0x9afb('0x13'))return;return getRealtimeVoiceQueueChannels();})[_0x9afb('0x17')](function(_0x3534){_0x35d54a=_0x3534?_0x3534[_0x9afb('0x5a')]:[];return initializeQueues(_0x464111,_0x45f863,_0x42dc3a,_0xe684ef['query'][_0x9afb('0x74')]);})[_0x9afb('0x17')](function(_0x47dc24){var _0x39c538=_0x47dc24[_0x9afb('0x5b')](function(_0x138e83){if(_0x42dc3a===_0x9afb('0x13'))return getVoiceQueueAgents(_0x138e83,_0x464111,_0x452d79,_0x35d54a);else return getQueueAgents(_0x138e83,_0x452d79,_0x42dc3a);});return Promise['all'](_0x39c538);})[_0x9afb('0x17')](function(_0x3bfa9d){_0x4bfb35['rows']=_0x3bfa9d;return _0x4bfb35;})[_0x9afb('0x17')](respondWithFilteredResult(_0x468743,_0x4505f0))[_0x9afb('0x1b')](handleError(_0x468743,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 92484de..a1cc898 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x52e914,_0xf1315c){var _0x22b982=function(_0x248523){while(--_0x248523){_0x52e914['push'](_0x52e914['shift']());}};_0x22b982(++_0xf1315c);}(_0xe706,0xa3));var _0x6e70=function(_0x121195,_0x2cd8b8){_0x121195=_0x121195-0x0;var _0x363aea=_0xe706[_0x121195];return _0x363aea;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x544f37,_0x2de288){var _0x40b8f4=function(_0x502227){while(--_0x502227){_0x544f37['push'](_0x544f37['shift']());}};_0x40b8f4(++_0x2de288);}(_0x70e0,0x17b));var _0x070e=function(_0x1066ce,_0x10a8e1){_0x1066ce=_0x1066ce-0x0;var _0x2c7432=_0x70e0[_0x1066ce];return _0x2c7432;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 7c09aa3..46cc124 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 _0xed5c=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xed5c,0x81));var _0xced5=function(_0x2781fa,_0x3197e1){_0x2781fa=_0x2781fa-0x0;var _0x911f32=_0xed5c[_0x2781fa];return _0x911f32;};'use strict';var Sequelize=require(_0xced5('0x0'));module[_0xced5('0x1')]={'state':{'type':Sequelize[_0xced5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xced5('0x3')]},'scheduledat':{'type':Sequelize[_0xced5('0x4')]},'uniqueid':{'type':Sequelize[_0xced5('0x3')]},'starttime':{'type':Sequelize[_0xced5('0x4')]},'responsetime':{'type':Sequelize[_0xced5('0x4')]},'ringtime':{'type':Sequelize[_0xced5('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xced5('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xced5('0x3')]}}; \ No newline at end of file +var _0xed1c=['DATE','INTEGER','STRING','sequelize','exports'];(function(_0x1b9c54,_0x387f9d){var _0x426a25=function(_0x3c10dc){while(--_0x3c10dc){_0x1b9c54['push'](_0x1b9c54['shift']());}};_0x426a25(++_0x387f9d);}(_0xed1c,0xe4));var _0xced1=function(_0x669b35,_0x4d8403){_0x669b35=_0x669b35-0x0;var _0x34b763=_0xed1c[_0x669b35];return _0x34b763;};'use strict';var Sequelize=require(_0xced1('0x0'));module[_0xced1('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xced1('0x2')]},'responsetime':{'type':Sequelize[_0xced1('0x2')]},'ringtime':{'type':Sequelize[_0xced1('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xced1('0x4')]},'membername':{'type':Sequelize[_0xced1('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 899f962..e43233c 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 _0xdd77=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview'];(function(_0x4aa6cb,_0x4b3912){var _0x300640=function(_0x29c0b7){while(--_0x29c0b7){_0x4aa6cb['push'](_0x4aa6cb['shift']());}};_0x300640(++_0x4b3912);}(_0xdd77,0x144));var _0x7dd7=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xdd77[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x7dd7('0x0'));var util=require(_0x7dd7('0x1'));var logger=require(_0x7dd7('0x2'))(_0x7dd7('0x3'));var moment=require(_0x7dd7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7dd7('0x5'));var rimraf=require(_0x7dd7('0x6'));var config=require(_0x7dd7('0x7'));var attributes=require(_0x7dd7('0x8'));module[_0x7dd7('0x9')]=function(_0x54291f,_0x214fa2){return _0x54291f[_0x7dd7('0xa')](_0x7dd7('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26c0=['api','moment','path','rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x352b36,_0x4bad0a){var _0x4a443c=function(_0x3b9e24){while(--_0x3b9e24){_0x352b36['push'](_0x352b36['shift']());}};_0x4a443c(++_0x4bad0a);}(_0x26c0,0x1c1));var _0x026c=function(_0x115309,_0x3605f5){_0x115309=_0x115309-0x0;var _0x241e2b=_0x26c0[_0x115309];return _0x241e2b;};'use strict';var _=require(_0x026c('0x0'));var util=require(_0x026c('0x1'));var logger=require('../../config/logger')(_0x026c('0x2'));var moment=require(_0x026c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x026c('0x4'));var rimraf=require(_0x026c('0x5'));var config=require(_0x026c('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x026c('0x7')]=function(_0x194fa6,_0x1d494e){return _0x194fa6[_0x026c('0x8')](_0x026c('0x9'),attributes,{'tableName':_0x026c('0xa'),'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 d38dd33..501bc03 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 _0x906c=['ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateReportAgentPreview','body','options','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x906c,0xa7));var _0xc906=function(_0x3ac38e,_0x33160d){_0x3ac38e=_0x3ac38e-0x0;var _0x1abca5=_0x906c[_0x3ac38e];return _0x1abca5;};'use strict';var _=require(_0xc906('0x0'));var util=require(_0xc906('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc906('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc906('0x3'))(_0xc906('0x4'));var config=require(_0xc906('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc906('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x23cfb5,_0x281616,_0x749f80){return new BPromise(function(_0x8800db,_0x933477){return client[_0xc906('0x7')](_0x23cfb5,_0x749f80)[_0xc906('0x8')](function(_0x375fce){logger['info'](_0xc906('0x9'),_0x281616,_0xc906('0xa'));logger[_0xc906('0xb')](_0xc906('0xc'),_0x281616,_0xc906('0xa'),JSON[_0xc906('0xd')](_0x375fce));if(_0x375fce[_0xc906('0xe')]){if(_0x375fce[_0xc906('0xe')]['code']===0x1f4){logger['error'](_0xc906('0x9'),_0x281616,_0x375fce[_0xc906('0xe')][_0xc906('0xf')]);return _0x933477(_0x375fce['error'][_0xc906('0xf')]);}logger[_0xc906('0xe')](_0xc906('0x9'),_0x281616,_0x375fce[_0xc906('0xe')][_0xc906('0xf')]);return _0x8800db(_0x375fce['error']['message']);}else{logger[_0xc906('0x10')](_0xc906('0x9'),_0x281616,'request\x20sent');_0x8800db(_0x375fce[_0xc906('0x11')][_0xc906('0xf')]);}})[_0xc906('0x12')](function(_0x1a3068){logger[_0xc906('0xe')](_0xc906('0x9'),_0x281616,_0x1a3068);_0x933477(_0x1a3068);});});}exports[_0xc906('0x13')]=function(_0x5d0dfc){var _0x58380a=this;return new Promise(function(_0x1472da,_0x383e2b){return db['ReportAgentPreview']['create'](_0x5d0dfc[_0xc906('0x14')],{'raw':_0x5d0dfc[_0xc906('0x15')]?_0x5d0dfc['options']['raw']===undefined?!![]:![]:!![]})[_0xc906('0x8')](function(_0x410416){logger['info'](_0xc906('0x13'),_0x5d0dfc);logger[_0xc906('0xb')]('CreateReportAgentPreview',_0x5d0dfc,JSON[_0xc906('0xd')](_0x410416));_0x1472da(_0x410416);})[_0xc906('0x12')](function(_0x103448){logger[_0xc906('0xe')](_0xc906('0x13'),_0x103448[_0xc906('0xf')],_0x5d0dfc);_0x383e2b(_0x58380a[_0xc906('0xe')](0x1f4,_0x103448['message']));});});}; \ No newline at end of file +var _0x8d8e=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x297806,_0x2134b2){var _0x55c003=function(_0x207195){while(--_0x207195){_0x297806['push'](_0x297806['shift']());}};_0x55c003(++_0x2134b2);}(_0x8d8e,0xd9));var _0xe8d8=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x8d8e[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xe8d8('0x0'));var util=require(_0xe8d8('0x1'));var moment=require(_0xe8d8('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8d8('0x3'));var fs=require('fs');var Redis=require(_0xe8d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8d8('0x5'));var logger=require(_0xe8d8('0x6'))(_0xe8d8('0x7'));var config=require(_0xe8d8('0x8'));var jayson=require(_0xe8d8('0x9'));var client=jayson[_0xe8d8('0xa')][_0xe8d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e40fb,_0xf4d452,_0x2ee240){return new BPromise(function(_0x567e10,_0x216e8b){return client['request'](_0x3e40fb,_0x2ee240)[_0xe8d8('0xc')](function(_0x3c4339){logger[_0xe8d8('0xd')](_0xe8d8('0xe'),_0xf4d452,'request\x20sent');logger['debug'](_0xe8d8('0xf'),_0xf4d452,_0xe8d8('0x10'),JSON[_0xe8d8('0x11')](_0x3c4339));if(_0x3c4339[_0xe8d8('0x12')]){if(_0x3c4339[_0xe8d8('0x12')]['code']===0x1f4){logger[_0xe8d8('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0xf4d452,_0x3c4339[_0xe8d8('0x12')][_0xe8d8('0x13')]);return _0x216e8b(_0x3c4339[_0xe8d8('0x12')]['message']);}logger[_0xe8d8('0x12')](_0xe8d8('0xe'),_0xf4d452,_0x3c4339['error'][_0xe8d8('0x13')]);return _0x567e10(_0x3c4339[_0xe8d8('0x12')]['message']);}else{logger[_0xe8d8('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0xf4d452,_0xe8d8('0x10'));_0x567e10(_0x3c4339[_0xe8d8('0x14')][_0xe8d8('0x13')]);}})[_0xe8d8('0x15')](function(_0x594b78){logger[_0xe8d8('0x12')](_0xe8d8('0xe'),_0xf4d452,_0x594b78);_0x216e8b(_0x594b78);});});}exports[_0xe8d8('0x16')]=function(_0x5153e8){var _0x541034=this;return new Promise(function(_0x209370,_0x5427a0){return db[_0xe8d8('0x17')][_0xe8d8('0x18')](_0x5153e8[_0xe8d8('0x19')],{'raw':_0x5153e8['options']?_0x5153e8[_0xe8d8('0x1a')][_0xe8d8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x32af49){logger[_0xe8d8('0xd')]('CreateReportAgentPreview',_0x5153e8);logger[_0xe8d8('0x1c')](_0xe8d8('0x16'),_0x5153e8,JSON[_0xe8d8('0x11')](_0x32af49));_0x209370(_0x32af49);})[_0xe8d8('0x15')](function(_0x25eedd){logger['error']('CreateReportAgentPreview',_0x25eedd[_0xe8d8('0x13')],_0x5153e8);_0x5427a0(_0x541034['error'](0x1f4,_0x25eedd[_0xe8d8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index e638dc1..b6bdaf4 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 _0x8f09=['/telephones','/trunks','/campaigns','campaigns','/fax/accounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','/outbound/channels','outboundChannels','/agents','agentCapacity'];(function(_0x44b865,_0x20ed9b){var _0x5e7b13=function(_0x5efd5b){while(--_0x5efd5b){_0x44b865['push'](_0x44b865['shift']());}};_0x5e7b13(++_0x20ed9b);}(_0x8f09,0x157));var _0x98f0=function(_0xd0b134,_0x416eea){_0xd0b134=_0xd0b134-0x0;var _0x4cac62=_0x8f09[_0xd0b134];return _0x4cac62;};'use strict';var multer=require(_0x98f0('0x0'));var util=require('util');var path=require(_0x98f0('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x98f0('0x2'));var controller=require('./rpc.controller');router[_0x98f0('0x3')](_0x98f0('0x4'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x6')]);router['get'](_0x98f0('0x7'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x8')]);router[_0x98f0('0x3')](_0x98f0('0x9'),auth['isAuthenticated'](),controller[_0x98f0('0xa')]);router['get'](_0x98f0('0xb'),auth[_0x98f0('0x5')](),controller['voiceQueues']);router[_0x98f0('0x3')]('/chat/queues',auth[_0x98f0('0x5')](),controller[_0x98f0('0xc')]);router['get'](_0x98f0('0xd'),auth[_0x98f0('0x5')](),controller['mailQueues']);router[_0x98f0('0x3')](_0x98f0('0xe'),auth[_0x98f0('0x5')](),controller[_0x98f0('0xf')]);router[_0x98f0('0x3')]('/openchannel/queues',auth[_0x98f0('0x5')](),controller[_0x98f0('0x10')]);router[_0x98f0('0x3')](_0x98f0('0x11'),auth[_0x98f0('0x5')](),controller['smsQueues']);router[_0x98f0('0x3')]('/whatsapp/queues',auth[_0x98f0('0x5')](),controller[_0x98f0('0x12')]);router[_0x98f0('0x3')](_0x98f0('0x13'),auth['isAuthenticated'](),controller[_0x98f0('0x14')]);router[_0x98f0('0x3')](_0x98f0('0x15'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x16')]);router[_0x98f0('0x3')]('/voice/queues/channels',auth[_0x98f0('0x5')](),controller['voiceQueuesChannels']);router[_0x98f0('0x3')](_0x98f0('0x17'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x18')]);router[_0x98f0('0x3')](_0x98f0('0x19'),auth['isAuthenticated'](),controller[_0x98f0('0x1a')]);router[_0x98f0('0x3')](_0x98f0('0x1b'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x1c')]);router[_0x98f0('0x3')](_0x98f0('0x1d'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x1e')]);router[_0x98f0('0x1f')](_0x98f0('0x1d'),auth[_0x98f0('0x5')](),controller['updateVoiceQueue']);router[_0x98f0('0x3')](_0x98f0('0x20'),auth[_0x98f0('0x5')](),controller['outbound']);router['get'](_0x98f0('0x21'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x22')]);router[_0x98f0('0x3')](_0x98f0('0x23'),auth['isAuthenticated'](),controller['agents']);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x98f0('0x24')]);router[_0x98f0('0x3')](_0x98f0('0x25'),auth[_0x98f0('0x5')](),controller['telephones']);router['get'](_0x98f0('0x26'),auth['isAuthenticated'](),controller['trunks']);router[_0x98f0('0x3')](_0x98f0('0x27'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x28')]);router[_0x98f0('0x3')](_0x98f0('0x29'),auth[_0x98f0('0x5')](),controller['faxAccounts']);router[_0x98f0('0x3')]('/chat/queues/waitinginteractions',auth[_0x98f0('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x98f0('0x3')](_0x98f0('0x2a'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x2b')]);router[_0x98f0('0x3')]('/openchannel/queues/waitinginteractions',auth[_0x98f0('0x5')](),controller[_0x98f0('0x2c')]);router[_0x98f0('0x3')](_0x98f0('0x2d'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x2e')]);router[_0x98f0('0x3')](_0x98f0('0x2f'),auth['isAuthenticated'](),controller[_0x98f0('0x30')]);router[_0x98f0('0x3')](_0x98f0('0x31'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x32')]);router[_0x98f0('0x3')](_0x98f0('0x33'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x34')]);router[_0x98f0('0x35')]('/mail/queues/:id/notify',auth[_0x98f0('0x5')](),controller['queueNotify'](_0x98f0('0x36')));router['get'](_0x98f0('0x37'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x38')]);router[_0x98f0('0x35')](_0x98f0('0x39'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x3a')](_0x98f0('0x3b')));router[_0x98f0('0x3')](_0x98f0('0x3c'),auth['isAuthenticated'](),controller[_0x98f0('0x3d')]);router[_0x98f0('0x35')]('/fax/queues/:id/notify',auth[_0x98f0('0x5')](),controller[_0x98f0('0x3a')](_0x98f0('0x3e')));router[_0x98f0('0x3')](_0x98f0('0x3f'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x40')]);router['post']('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0x98f0('0x3a')]('openchannel'));router[_0x98f0('0x3')](_0x98f0('0x41'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x42')]);router[_0x98f0('0x35')](_0x98f0('0x43'),auth[_0x98f0('0x5')](),controller['queueNotify']('sms'));router[_0x98f0('0x35')](_0x98f0('0x44'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x3a')](_0x98f0('0x45')));router['get'](_0x98f0('0x46'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x47')]);router['get']('/whatsapp/queues/:id',auth[_0x98f0('0x5')](),controller[_0x98f0('0x48')]);router[_0x98f0('0x35')](_0x98f0('0x49'),auth[_0x98f0('0x5')](),controller[_0x98f0('0x4a')]);module[_0x98f0('0x4b')]=router; \ No newline at end of file +var _0x7497=['isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/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','voiceQueuesChannelRedirect','/voice/queues/:id','put','outbound','/outbound/channels','outboundChannels','agentCapacity','/telephones','telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','queueNotify','showMailQueues','chat','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','multer','util','path','./rpc.controller','get'];(function(_0x2308cf,_0x4c3652){var _0x49c6fe=function(_0x22e1aa){while(--_0x22e1aa){_0x2308cf['push'](_0x2308cf['shift']());}};_0x49c6fe(++_0x4c3652);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var path=require(_0x7749('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x7749('0x3'));router[_0x7749('0x4')]('/voice/channels',auth[_0x7749('0x5')](),controller[_0x7749('0x6')]);router[_0x7749('0x4')](_0x7749('0x7'),auth[_0x7749('0x5')](),controller[_0x7749('0x8')]);router[_0x7749('0x4')](_0x7749('0x9'),auth[_0x7749('0x5')](),controller[_0x7749('0xa')]);router[_0x7749('0x4')]('/voice/queues',auth[_0x7749('0x5')](),controller['voiceQueues']);router[_0x7749('0x4')](_0x7749('0xb'),auth[_0x7749('0x5')](),controller[_0x7749('0xc')]);router[_0x7749('0x4')](_0x7749('0xd'),auth[_0x7749('0x5')](),controller[_0x7749('0xe')]);router[_0x7749('0x4')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x7749('0xf')]);router['get']('/openchannel/queues',auth[_0x7749('0x5')](),controller[_0x7749('0x10')]);router[_0x7749('0x4')](_0x7749('0x11'),auth[_0x7749('0x5')](),controller[_0x7749('0x12')]);router['get']('/whatsapp/queues',auth[_0x7749('0x5')](),controller[_0x7749('0x13')]);router['get'](_0x7749('0x14'),auth[_0x7749('0x5')](),controller[_0x7749('0x15')]);router[_0x7749('0x4')](_0x7749('0x16'),auth[_0x7749('0x5')](),controller[_0x7749('0x17')]);router[_0x7749('0x4')](_0x7749('0x18'),auth[_0x7749('0x5')](),controller['voiceQueuesChannels']);router[_0x7749('0x4')](_0x7749('0x19'),auth['isAuthenticated'](),controller[_0x7749('0x1a')]);router['get'](_0x7749('0x1b'),auth[_0x7749('0x5')](),controller[_0x7749('0x1c')]);router[_0x7749('0x4')](_0x7749('0x1d'),auth[_0x7749('0x5')](),controller[_0x7749('0x1e')]);router[_0x7749('0x4')](_0x7749('0x1f'),auth[_0x7749('0x5')](),controller['showVoiceQueues']);router[_0x7749('0x20')](_0x7749('0x1f'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0x7749('0x4')]('/outbound',auth[_0x7749('0x5')](),controller[_0x7749('0x21')]);router[_0x7749('0x4')](_0x7749('0x22'),auth['isAuthenticated'](),controller[_0x7749('0x23')]);router['get']('/agents',auth['isAuthenticated'](),controller['agents']);router['put']('/agents/:id/capacity',auth[_0x7749('0x5')](),controller[_0x7749('0x24')]);router['get'](_0x7749('0x25'),auth[_0x7749('0x5')](),controller[_0x7749('0x26')]);router[_0x7749('0x4')](_0x7749('0x27'),auth[_0x7749('0x5')](),controller['trunks']);router[_0x7749('0x4')](_0x7749('0x28'),auth[_0x7749('0x5')](),controller['campaigns']);router[_0x7749('0x4')](_0x7749('0x29'),auth[_0x7749('0x5')](),controller[_0x7749('0x2a')]);router[_0x7749('0x4')](_0x7749('0x2b'),auth[_0x7749('0x5')](),controller[_0x7749('0x2c')]);router[_0x7749('0x4')](_0x7749('0x2d'),auth[_0x7749('0x5')](),controller[_0x7749('0x2e')]);router[_0x7749('0x4')](_0x7749('0x2f'),auth[_0x7749('0x5')](),controller[_0x7749('0x30')]);router[_0x7749('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x7749('0x5')](),controller[_0x7749('0x31')]);router[_0x7749('0x4')](_0x7749('0x32'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router['get'](_0x7749('0x33'),auth[_0x7749('0x5')](),controller[_0x7749('0x34')]);router[_0x7749('0x4')]('/fax/queues/waitinginteractions',auth[_0x7749('0x5')](),controller[_0x7749('0x35')]);router[_0x7749('0x36')]('/mail/queues/:id/notify',auth[_0x7749('0x5')](),controller[_0x7749('0x37')]('mail'));router[_0x7749('0x4')]('/mail/queues/:id',auth[_0x7749('0x5')](),controller[_0x7749('0x38')]);router[_0x7749('0x36')]('/chat/queues/:id/notify',auth[_0x7749('0x5')](),controller[_0x7749('0x37')](_0x7749('0x39')));router[_0x7749('0x4')]('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router[_0x7749('0x36')](_0x7749('0x3a'),auth[_0x7749('0x5')](),controller[_0x7749('0x37')](_0x7749('0x3b')));router[_0x7749('0x4')](_0x7749('0x3c'),auth[_0x7749('0x5')](),controller['showFaxQueues']);router[_0x7749('0x36')](_0x7749('0x3d'),auth[_0x7749('0x5')](),controller[_0x7749('0x37')](_0x7749('0x3e')));router[_0x7749('0x4')](_0x7749('0x3f'),auth[_0x7749('0x5')](),controller[_0x7749('0x40')]);router[_0x7749('0x36')](_0x7749('0x41'),auth[_0x7749('0x5')](),controller[_0x7749('0x37')](_0x7749('0x42')));router[_0x7749('0x36')]('/whatsapp/queues/:id/notify',auth[_0x7749('0x5')](),controller[_0x7749('0x37')]('whatsapp'));router['get'](_0x7749('0x43'),auth[_0x7749('0x5')](),controller[_0x7749('0x44')]);router[_0x7749('0x4')]('/whatsapp/queues/:id',auth[_0x7749('0x5')](),controller[_0x7749('0x45')]);router[_0x7749('0x36')]('/agents/:id/notify',auth[_0x7749('0x5')](),controller[_0x7749('0x46')]);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 92ce975..d551e78 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 _0xb4c7=['query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','user','interaction','MemberReport','findAll','INTERACTION','length','updateAttributes','findOrCreate','format','SIP/%s','interface','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','messageId','queue','InteractionId','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels'];(function(_0x4c96b0,_0x20dc20){var _0x225bbb=function(_0x5c2f09){while(--_0x5c2f09){_0x4c96b0['push'](_0x4c96b0['shift']());}};_0x225bbb(++_0x20dc20);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0xe0e66d,_0x4feb28){_0xe0e66d=_0xe0e66d-0x0;var _0x33be5e=_0xb4c7[_0xe0e66d];return _0x33be5e;};'use strict';var BPromise=require(_0x7b4c('0x0'));var moment=require(_0x7b4c('0x1'));var _=require(_0x7b4c('0x2'));var util=require(_0x7b4c('0x3'));var db=require(_0x7b4c('0x4'))['db'];var logger=require('../../config/logger')(_0x7b4c('0x5'));var jayson=require(_0x7b4c('0x6'));var amiClient=jayson[_0x7b4c('0x7')][_0x7b4c('0x8')]({'port':0x232a});var mailClient=jayson[_0x7b4c('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x7b4c('0x7')][_0x7b4c('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){var _0x433aa2=_0x2d7b7e?_0x2d7b7e:amiClient;return _0x433aa2[_0x7b4c('0x9')](_0x2dd5c7,_0x4bf85d)[_0x7b4c('0xa')](function(_0x237e28){if(_0x237e28[_0x7b4c('0xb')]){if(_0x237e28[_0x7b4c('0xb')][_0x7b4c('0xc')]===0x1f4){return _0x570daa(_0x237e28[_0x7b4c('0xb')][_0x7b4c('0xd')]);}return _0x21687f(_0x237e28[_0x7b4c('0xb')]['message']);}else{_0x21687f(_0x237e28['result']);}})[_0x7b4c('0xe')](function(_0x18342b){_0x570daa(_0x18342b);});});}function respondWithResult(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xc8;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0xf')](_0x1722ad)[_0x7b4c('0x10')](_0x3e1558);}return _0x38656b[_0x7b4c('0x11')](0x194);};}function handleError(_0x25b90b,_0x387488){_0x387488=_0x387488||0x1f4;return function(_0x593a19){logger[_0x7b4c('0xb')](_0x593a19[_0x7b4c('0x12')]);if(_0x593a19[_0x7b4c('0x13')]){delete _0x593a19[_0x7b4c('0x13')];}_0x25b90b[_0x7b4c('0xf')](_0x387488)[_0x7b4c('0x14')](_0x593a19);};}function findById(_0x1642e1){return function(_0x22c409){if(!_['isNil'](_0x1642e1)&&!_[_0x7b4c('0x15')](_0x22c409)&&!_[_0x7b4c('0x15')](_0x22c409[_0x7b4c('0x16')])){return _[_0x7b4c('0x17')](_0x22c409['rows'],function(_0x3ce10c){return _0x3ce10c['id']==_0x1642e1;});}return null;};}exports[_0x7b4c('0x18')]=function(_0x32110e,_0x380b79){return respondWithRpcPromise(_0x7b4c('0x19'),_0x32110e[_0x7b4c('0x1a')])[_0x7b4c('0xa')](respondWithResult(_0x380b79,null))[_0x7b4c('0xe')](handleError(_0x380b79,null));};exports[_0x7b4c('0x1b')]=function(_0x55e3df,_0x1f06ec){return respondWithRpcPromise(_0x7b4c('0x1c'),_[_0x7b4c('0x1d')](_0x55e3df[_0x7b4c('0x1a')],_0x55e3df[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x1f06ec,null))[_0x7b4c('0xe')](handleError(_0x1f06ec,null));};exports[_0x7b4c('0x1f')]=function(_0x2ab9e1,_0x2c267c){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x7b4c('0x1d')](_0x2ab9e1[_0x7b4c('0x1a')],_0x2ab9e1[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x2c267c,null))[_0x7b4c('0xe')](handleError(_0x2c267c,null));};exports[_0x7b4c('0x20')]=function(_0x37c059,_0x459eb4){return respondWithRpcPromise(_0x7b4c('0x21'),_0x37c059[_0x7b4c('0x1a')])[_0x7b4c('0xa')](respondWithResult(_0x459eb4,null))[_0x7b4c('0xe')](handleError(_0x459eb4,null));};exports[_0x7b4c('0x22')]=function(_0x501f75,_0x27f361){return respondWithRpcPromise(_0x7b4c('0x21'),_0x501f75[_0x7b4c('0x1a')])[_0x7b4c('0xa')](findById(_0x501f75[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x27f361,null))[_0x7b4c('0xe')](handleError(_0x27f361,null));};exports[_0x7b4c('0x23')]=function(_0x3e4a46,_0x9a799b){return respondWithRpcPromise(_0x7b4c('0x24'),_[_0x7b4c('0x1d')](_0x3e4a46[_0x7b4c('0x25')],_0x3e4a46[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x9a799b,null))[_0x7b4c('0xe')](handleError(_0x9a799b,null));};exports[_0x7b4c('0x26')]=function(_0xce5781,_0x9d3d31){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0xce5781['query'],_0xce5781[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x9d3d31,null))[_0x7b4c('0xe')](handleError(_0x9d3d31,null));};exports[_0x7b4c('0x27')]=function(_0x498391,_0x6e66e3){return respondWithRpcPromise(_0x7b4c('0x28'),_0x498391['query'])[_0x7b4c('0xa')](respondWithResult(_0x6e66e3,null))['catch'](handleError(_0x6e66e3,null));};exports[_0x7b4c('0x29')]=function(_0x3b9149,_0x159001){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x7b4c('0x1d')](_0x3b9149[_0x7b4c('0x1a')],_0x3b9149['params']))[_0x7b4c('0xa')](respondWithResult(_0x159001,null))[_0x7b4c('0xe')](handleError(_0x159001,null));};exports[_0x7b4c('0x2a')]=function(_0x2e0835,_0x56ff38){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x7b4c('0x1d')](_0x2e0835[_0x7b4c('0x1a')],_0x2e0835['params']))[_0x7b4c('0xa')](respondWithResult(_0x56ff38,null))['catch'](handleError(_0x56ff38,null));};exports['voiceQueuesChannelRedirect']=function(_0x11ca38,_0x16ae89){return respondWithRpcPromise(_0x7b4c('0x2b'),_[_0x7b4c('0x1d')](_0x11ca38['query'],_0x11ca38[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x16ae89,null))[_0x7b4c('0xe')](handleError(_0x16ae89,null));};exports[_0x7b4c('0x2c')]=function(_0x346e0c,_0xddd16){return respondWithRpcPromise(_0x7b4c('0x2d'),_0x346e0c['query'])['then'](respondWithResult(_0xddd16,null))[_0x7b4c('0xe')](handleError(_0xddd16,null));};exports[_0x7b4c('0x2e')]=function(_0x31ef1e,_0x123a3a){return respondWithRpcPromise(_0x7b4c('0x2f'),_0x31ef1e['query'])[_0x7b4c('0xa')](respondWithResult(_0x123a3a,null))[_0x7b4c('0xe')](handleError(_0x123a3a,null));};exports[_0x7b4c('0x30')]=function(_0x26346a,_0x22f71b){var _0x25659d;return respondWithRpcPromise(_0x7b4c('0x31'),_0x26346a[_0x7b4c('0x1a')])[_0x7b4c('0xa')](function(_0x54cd10){_0x25659d=_0x54cd10;return respondWithRpcPromise(_0x7b4c('0x31'),_0x26346a['query'],routingClient);})[_0x7b4c('0xa')](function(_0x4dc71f){return _[_0x7b4c('0x1d')]({},_0x4dc71f,_0x25659d);})[_0x7b4c('0xa')](respondWithResult(_0x22f71b,null))['catch'](handleError(_0x22f71b,null));};exports['agentCapacity']=function(_0x354578,_0x4314b6){if(_0x354578[_0x7b4c('0x25')]&&_0x354578[_0x7b4c('0x25')]['interaction']&&_0x354578[_0x7b4c('0x32')]&&_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')]){for(var _0x5d4ed8 in _0x354578[_0x7b4c('0x25')]['interaction']){if(_0x354578['body'][_0x7b4c('0x33')]['hasOwnProperty'](_0x5d4ed8)){db[_0x7b4c('0x34')][_0x7b4c('0x35')]({'where':{'channel':_0x5d4ed8,'membername':_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')],'type':_0x7b4c('0x36'),'exitAt':null,'uniqueid':_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8]&&_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8]['length']?{'$notIn':_0x354578[_0x7b4c('0x25')]['interaction'][_0x5d4ed8]}:{'$ne':null}}})['then'](function(_0x23372c){var _0x1f1653=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x255cca=0x0,_0x2ce694=_0x23372c[_0x7b4c('0x37')];_0x255cca<_0x2ce694;_0x255cca+=0x1){_0x23372c[_0x255cca][_0x7b4c('0x38')]({'exitAt':_0x1f1653});}});for(var _0x8ebf9b=0x0;_0x8ebf9b<_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8][_0x7b4c('0x37')];_0x8ebf9b+=0x1){db['MemberReport'][_0x7b4c('0x39')]({'where':{'channel':_0x5d4ed8,'membername':_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')],'type':_0x7b4c('0x36'),'uniqueid':_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8][_0x8ebf9b],'exitAt':null},'defaults':{'channel':_0x5d4ed8,'membername':_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')],'interface':_[_0x7b4c('0x15')](_0x354578['user']['interface'])?util[_0x7b4c('0x3a')](_0x7b4c('0x3b'),_0x354578[_0x7b4c('0x32')]['name']):_0x354578[_0x7b4c('0x32')][_0x7b4c('0x3c')],'type':'INTERACTION','enterAt':moment()[_0x7b4c('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x7b4c('0x3d'),'internal':_0x354578['user'][_0x7b4c('0x3e')],'uniqueid':_0x354578['body'][_0x7b4c('0x33')][_0x5d4ed8][_0x8ebf9b]}});}}}}return respondWithRpcPromise(_0x7b4c('0x3f'),{'id':_0x354578['params']['id'],'capacity':_0x354578['body'][_0x7b4c('0x40')]},routingClient)[_0x7b4c('0xa')](respondWithResult(_0x4314b6,null))[_0x7b4c('0xe')](handleError(_0x4314b6,null));};exports['telephones']=function(_0x56233b,_0x2fc5b5){return respondWithRpcPromise(_0x7b4c('0x41'),_0x56233b['query'])['then'](respondWithResult(_0x2fc5b5,null))[_0x7b4c('0xe')](handleError(_0x2fc5b5,null));};exports[_0x7b4c('0x42')]=function(_0x166fd1,_0x4b2207){return respondWithRpcPromise(_0x7b4c('0x43'),_0x166fd1[_0x7b4c('0x1a')])['then'](respondWithResult(_0x4b2207,null))['catch'](handleError(_0x4b2207,null));};exports[_0x7b4c('0x44')]=function(_0x4d8491,_0x59db20){return respondWithRpcPromise(_0x7b4c('0x45'),_0x4d8491['query'])['then'](respondWithResult(_0x59db20,null))[_0x7b4c('0xe')](handleError(_0x59db20,null));};exports[_0x7b4c('0x46')]=function(_0xde9f5,_0x17af17){return respondWithRpcPromise('ChatQueues',_0xde9f5['query'],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x17af17,null))[_0x7b4c('0xe')](handleError(_0x17af17,null));};exports[_0x7b4c('0x47')]=function(_0x59b358,_0x255262){return respondWithRpcPromise(_0x7b4c('0x48'),_0x59b358[_0x7b4c('0x1a')],routingClient)['then'](findById(_0x59b358[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x255262,null))['catch'](handleError(_0x255262,null));};exports[_0x7b4c('0x49')]=function(_0x186e7d,_0x30de26){return respondWithRpcPromise(_0x7b4c('0x4a'),_0x186e7d[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x30de26,null))[_0x7b4c('0xe')](handleError(_0x30de26,null));};exports['showMailQueues']=function(_0x4443d0,_0x2dc79a){return respondWithRpcPromise('MailQueues',_0x4443d0[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0x4443d0[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x2dc79a,null))['catch'](handleError(_0x2dc79a,null));};exports[_0x7b4c('0x4b')]=function(_0x4e84a3,_0x542b85){return respondWithRpcPromise(_0x7b4c('0x4c'),_0x4e84a3[_0x7b4c('0x1a')],mailClient)[_0x7b4c('0xa')](respondWithResult(_0x542b85,null))[_0x7b4c('0xe')](handleError(_0x542b85,null));};exports[_0x7b4c('0x4d')]=function(_0x5b24f6,_0x4fcc9d){return respondWithRpcPromise(_0x7b4c('0x4e'),_0x5b24f6[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x4fcc9d,null))['catch'](handleError(_0x4fcc9d,null));};exports[_0x7b4c('0x4f')]=function(_0xc4dae0,_0x36fc5d){return respondWithRpcPromise('OpenchannelQueues',_0xc4dae0[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0xc4dae0[_0x7b4c('0x1e')]['id']))['then'](respondWithResult(_0x36fc5d,null))[_0x7b4c('0xe')](handleError(_0x36fc5d,null));};exports[_0x7b4c('0x50')]=function(_0x4ac03e,_0x1c64d5){return respondWithRpcPromise('SmsQueues',_0x4ac03e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x1c64d5,null))[_0x7b4c('0xe')](handleError(_0x1c64d5,null));};exports['showSmsQueues']=function(_0x5af2af,_0x237921){return respondWithRpcPromise(_0x7b4c('0x51'),_0x5af2af[_0x7b4c('0x1a')],routingClient)['then'](findById(_0x5af2af[_0x7b4c('0x1e')]['id']))['then'](respondWithResult(_0x237921,null))[_0x7b4c('0xe')](handleError(_0x237921,null));};exports[_0x7b4c('0x52')]=function(_0x1315bd,_0x5f3ed5){return respondWithRpcPromise(_0x7b4c('0x53'),_0x1315bd['query'],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x5f3ed5,null))[_0x7b4c('0xe')](handleError(_0x5f3ed5,null));};exports['showWhatsappQueues']=function(_0x7a38e,_0x13a882){return respondWithRpcPromise(_0x7b4c('0x53'),_0x7a38e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0x7a38e[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x13a882,null))[_0x7b4c('0xe')](handleError(_0x13a882,null));};exports['faxQueues']=function(_0x10d5b3,_0x2dc9a4){return respondWithRpcPromise(_0x7b4c('0x54'),_0x10d5b3[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x2dc9a4,null))[_0x7b4c('0xe')](handleError(_0x2dc9a4,null));};exports[_0x7b4c('0x55')]=function(_0x2a5f6e,_0x34fce4){return respondWithRpcPromise(_0x7b4c('0x54'),_0x2a5f6e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0x2a5f6e[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x34fce4,null))[_0x7b4c('0xe')](handleError(_0x34fce4,null));};exports[_0x7b4c('0x56')]=function(_0x168aa1,_0x36c7d9){return respondWithRpcPromise(_0x7b4c('0x57'),_0x168aa1[_0x7b4c('0x1a')])['then'](respondWithResult(_0x36c7d9,null))['catch'](handleError(_0x36c7d9,null));};exports[_0x7b4c('0x58')]=function(_0x15033e,_0x50069b){return respondWithRpcPromise(_0x7b4c('0x59'),_0x15033e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x50069b,null))[_0x7b4c('0xe')](handleError(_0x50069b,null));};exports[_0x7b4c('0x5a')]=function(_0x15df66,_0x22a254){return respondWithRpcPromise(_0x7b4c('0x5b'),_0x15df66[_0x7b4c('0x1a')],routingClient)['then'](respondWithResult(_0x22a254,null))[_0x7b4c('0xe')](handleError(_0x22a254,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x35067f,_0x5477e3){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x35067f[_0x7b4c('0x1a')],routingClient)['then'](respondWithResult(_0x5477e3,null))['catch'](handleError(_0x5477e3,null));};exports[_0x7b4c('0x5c')]=function(_0x2d17ed,_0x328948){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2d17ed[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](function(_0x10e789){if(_0x2d17ed[_0x7b4c('0x1a')][_0x7b4c('0x5d')]!==undefined){var _0x2837aa=_(_0x10e789[_0x7b4c('0x16')])[_0x7b4c('0x5e')]([_0x2d17ed[_0x7b4c('0x1a')][_0x7b4c('0x5d')],_0x2d17ed[_0x7b4c('0x1e')]['id']])[_0x7b4c('0x5f')](_0x7b4c('0x60'))[_0x7b4c('0x61')]()['value']();return _0x10e789[_0x7b4c('0x16')][_0x7b4c('0x5e')](function(_0x35e94a){return _0x2837aa[_0x7b4c('0x62')](_0x35e94a['queue_id'])>-0x1;});}else{return _0x10e789[_0x7b4c('0x16')][_0x7b4c('0x5e')](function(_0x149d53){return _0x149d53[_0x7b4c('0x60')]===parseInt(_0x2d17ed[_0x7b4c('0x1e')]['id']);});}})[_0x7b4c('0xa')](respondWithResult(_0x328948,null))[_0x7b4c('0xe')](handleError(_0x328948,null));};exports['smsQueuesWaitingInteractions']=function(_0x11c809,_0x108c99){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x11c809['query'],routingClient)['then'](respondWithResult(_0x108c99,null))[_0x7b4c('0xe')](handleError(_0x108c99,null));};exports[_0x7b4c('0x63')]=function(_0x24d4f9,_0x19804d){return respondWithRpcPromise(_0x7b4c('0x64'),_0x24d4f9[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x19804d,null))[_0x7b4c('0xe')](handleError(_0x19804d,null));};exports[_0x7b4c('0x65')]=function(_0x2bc889,_0x83e8bb){return respondWithRpcPromise(_0x7b4c('0x66'),_0x2bc889[_0x7b4c('0x1a')],routingClient)['then'](respondWithResult(_0x83e8bb,null))[_0x7b4c('0xe')](handleError(_0x83e8bb,null));};exports[_0x7b4c('0x67')]=function(_0x2afaa0){return function(_0x5dc6e6,_0x39c01d){var _0x392656,_0x1faa6f;var _0x3999bf=_[_0x7b4c('0x68')](_0x2afaa0);var _0x57f1a0=_0x2afaa0===_0x7b4c('0x69')?_0x7b4c('0x6a'):_0x7b4c('0x6b');return db[_0x3999bf+_0x7b4c('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x5dc6e6[_0x7b4c('0x1e')]['id']}})[_0x7b4c('0xa')](function(_0xdfa0bc){if(_['isNil'](_0xdfa0bc)){throw new Error(_0x3999bf+_0x7b4c('0x6d'));}_0x392656=_0xdfa0bc;return db[_0x3999bf+_0x7b4c('0x6e')][_0x7b4c('0x6f')]({'where':{'id':_0x5dc6e6[_0x7b4c('0x25')]['messageId']},'include':[{'model':db[_0x3999bf+_0x7b4c('0x70')],'as':_0x7b4c('0x70')},{'model':db[_0x3999bf+_0x57f1a0],'as':_0x7b4c('0x6b')}]});})[_0x7b4c('0xa')](function(_0x50c382){if(_[_0x7b4c('0x15')](_0x50c382)){throw new Error(_0x3999bf+'\x20Message\x20not\x20found');}_0x1faa6f=_0x50c382;return _0x50c382[_0x7b4c('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x24690a={'uniqueid':_0x2afaa0+'.'+_0x1faa6f['id']+'.'+_0x1faa6f[_0x7b4c('0x70')]['id'],'FromUserId':_0x5dc6e6[_0x7b4c('0x32')]['id'],'type':'queue'};_0x24690a[_0x3999bf+_0x7b4c('0x72')]=_0x1faa6f['id'];_0x24690a[_0x3999bf+'InteractionId']=_0x1faa6f[_0x7b4c('0x70')]['id'];_0x24690a[_0x7b4c('0x73')+_0x3999bf+_0x57f1a0+'Id']=_0x1faa6f['Account']['id'];_0x24690a['To'+_0x3999bf+_0x7b4c('0x74')]=_0x392656['id'];return db[_0x3999bf+_0x7b4c('0x75')][_0x7b4c('0x76')](_0x24690a);})[_0x7b4c('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x2afaa0,'interaction':_0x1faa6f[_0x7b4c('0x70')],'message':_0x1faa6f,'account':_0x1faa6f[_0x7b4c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x392656[_0x7b4c('0x13')]+','+(_0x1faa6f[_0x7b4c('0x6b')][_0x7b4c('0x77')]||0x12c),'interval':_0x7b4c('0x78')}]},routingClient);})[_0x7b4c('0xa')](respondWithResult(_0x39c01d,null))[_0x7b4c('0xe')](handleError(_0x39c01d,null));};};exports[_0x7b4c('0x79')]=function(_0x4e9781,_0x5ec399){var _0xdb202,_0x433d74;if(_[_0x7b4c('0x15')](_0x4e9781[_0x7b4c('0x25')][_0x7b4c('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x228b2b=_0x4e9781[_0x7b4c('0x25')][_0x7b4c('0x7a')];var _0x331db1=_['capitalize'](_0x228b2b);var _0x56ba6f=_0x228b2b===_0x7b4c('0x69')?_0x7b4c('0x6a'):_0x7b4c('0x6b');return db[_0x7b4c('0x7b')][_0x7b4c('0x6f')]({'raw':!![],'where':{'id':_0x4e9781['params']['id'],'role':_0x7b4c('0x3d')}})[_0x7b4c('0xa')](function(_0x450eca){if(_[_0x7b4c('0x15')](_0x450eca)){throw new Error('Agent\x20not\x20found');}_0xdb202=_0x450eca;return db[_0x331db1+'Message']['findOne']({'where':{'id':_0x4e9781[_0x7b4c('0x25')][_0x7b4c('0x7c')]},'include':[{'model':db[_0x331db1+_0x7b4c('0x70')],'as':'Interaction'},{'model':db[_0x331db1+_0x56ba6f],'as':_0x7b4c('0x6b')}]});})['then'](function(_0x530030){if(_[_0x7b4c('0x15')](_0x530030)){throw new Error(_0x331db1+'\x20Message\x20not\x20found');}_0x433d74=_0x530030;return _0x530030[_0x7b4c('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7b4c('0xa')](function(){var _0x5e444a={'uniqueid':_0x228b2b+'.'+_0x433d74['id']+'.'+_0x433d74['Interaction']['id'],'FromUserId':_0x4e9781[_0x7b4c('0x32')]['id'],'type':_0x7b4c('0x7d'),'ToUserId':_0xdb202['id']};_0x5e444a[_0x331db1+_0x7b4c('0x72')]=_0x433d74['id'];_0x5e444a[_0x331db1+_0x7b4c('0x7e')]=_0x433d74['Interaction']['id'];_0x5e444a['From'+_0x331db1+_0x56ba6f+'Id']=_0x433d74[_0x7b4c('0x6b')]['id'];return db[_0x331db1+_0x7b4c('0x75')][_0x7b4c('0x76')](_0x5e444a);})[_0x7b4c('0xa')](function(){return respondWithRpcPromise(_0x7b4c('0x7f'),{'channel':_0x228b2b,'interaction':_0x433d74[_0x7b4c('0x70')],'message':_0x433d74,'account':_0x433d74[_0x7b4c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0xdb202[_0x7b4c('0x13')]+','+(_0x433d74[_0x7b4c('0x6b')][_0x7b4c('0x80')]||0x12c),'interval':_0x7b4c('0x78')}]},routingClient);})[_0x7b4c('0xa')](respondWithResult(_0x5ec399,null))[_0x7b4c('0xe')](handleError(_0x5ec399,null));}; \ No newline at end of file +var _0x8d0e=['merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','interface','SIP/%s','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','showChatQueues','ChatQueues','mailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','findOne','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','agent','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','catch','json','stack','name','send','isNil','rows','voiceChannels','query','then','VoiceChannelMixMonitor'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2209a7,_0x2e8de3){_0x2209a7=_0x2209a7-0x0;var _0x23a37d=_0x8d0e[_0x2209a7];return _0x23a37d;};'use strict';var BPromise=require(_0xe8d0('0x0'));var moment=require(_0xe8d0('0x1'));var _=require(_0xe8d0('0x2'));var util=require(_0xe8d0('0x3'));var db=require(_0xe8d0('0x4'))['db'];var logger=require(_0xe8d0('0x5'))(_0xe8d0('0x6'));var jayson=require(_0xe8d0('0x7'));var amiClient=jayson[_0xe8d0('0x8')]['http']({'port':0x232a});var mailClient=jayson[_0xe8d0('0x8')]['http']({'port':0x232b});var routingClient=jayson['client'][_0xe8d0('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){var _0x1b353a=_0xcc03d0?_0xcc03d0:amiClient;return _0x1b353a[_0xe8d0('0xa')](_0x92483d,_0x469d37)['then'](function(_0x10e56c){if(_0x10e56c[_0xe8d0('0xb')]){if(_0x10e56c[_0xe8d0('0xb')]['code']===0x1f4){return _0x13aa63(_0x10e56c['error'][_0xe8d0('0xc')]);}return _0x2b6dce(_0x10e56c[_0xe8d0('0xb')][_0xe8d0('0xc')]);}else{_0x2b6dce(_0x10e56c[_0xe8d0('0xd')]);}})[_0xe8d0('0xe')](function(_0x41de69){_0x13aa63(_0x41de69);});});}function respondWithResult(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xc8;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['status'](_0x38fac0)[_0xe8d0('0xf')](_0x15b9e5);}return _0x5934b2['sendStatus'](0x194);};}function handleError(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0x1f4;return function(_0x2aa906){logger[_0xe8d0('0xb')](_0x2aa906[_0xe8d0('0x10')]);if(_0x2aa906[_0xe8d0('0x11')]){delete _0x2aa906[_0xe8d0('0x11')];}_0x59b4b7['status'](_0x90a1ea)[_0xe8d0('0x12')](_0x2aa906);};}function findById(_0x49554d){return function(_0x6d932b){if(!_[_0xe8d0('0x13')](_0x49554d)&&!_[_0xe8d0('0x13')](_0x6d932b)&&!_['isNil'](_0x6d932b['rows'])){return _['find'](_0x6d932b[_0xe8d0('0x14')],function(_0x384854){return _0x384854['id']==_0x49554d;});}return null;};}exports[_0xe8d0('0x15')]=function(_0x44bbe4,_0x83177b){return respondWithRpcPromise('VoiceChannels',_0x44bbe4[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x83177b,null))['catch'](handleError(_0x83177b,null));};exports['voiceChannelMixMonitor']=function(_0x554402,_0x384a60){return respondWithRpcPromise(_0xe8d0('0x18'),_[_0xe8d0('0x19')](_0x554402[_0xe8d0('0x16')],_0x554402[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x384a60,null))[_0xe8d0('0xe')](handleError(_0x384a60,null));};exports[_0xe8d0('0x1b')]=function(_0x32e39a,_0x5ab4e7){return respondWithRpcPromise(_0xe8d0('0x1c'),_[_0xe8d0('0x19')](_0x32e39a['query'],_0x32e39a[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x5ab4e7,null))[_0xe8d0('0xe')](handleError(_0x5ab4e7,null));};exports[_0xe8d0('0x1d')]=function(_0x146783,_0x149dfd){return respondWithRpcPromise(_0xe8d0('0x1e'),_0x146783[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x149dfd,null))[_0xe8d0('0xe')](handleError(_0x149dfd,null));};exports[_0xe8d0('0x1f')]=function(_0x539548,_0x24982c){return respondWithRpcPromise(_0xe8d0('0x1e'),_0x539548[_0xe8d0('0x16')])['then'](findById(_0x539548[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x24982c,null))['catch'](handleError(_0x24982c,null));};exports[_0xe8d0('0x20')]=function(_0x3ffcb7,_0x11fcf2){return respondWithRpcPromise(_0xe8d0('0x21'),_[_0xe8d0('0x19')](_0x3ffcb7['body'],_0x3ffcb7[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x11fcf2,null))['catch'](handleError(_0x11fcf2,null));};exports['voiceQueuesPreview']=function(_0x547a2b,_0x13cd4c){return respondWithRpcPromise(_0xe8d0('0x22'),_['merge'](_0x547a2b['query'],_0x547a2b[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x13cd4c,null))[_0xe8d0('0xe')](handleError(_0x13cd4c,null));};exports[_0xe8d0('0x23')]=function(_0x327004,_0x1b2b0a){return respondWithRpcPromise(_0xe8d0('0x24'),_0x327004['query'])[_0xe8d0('0x17')](respondWithResult(_0x1b2b0a,null))[_0xe8d0('0xe')](handleError(_0x1b2b0a,null));};exports[_0xe8d0('0x25')]=function(_0x145ddb,_0x587819){return respondWithRpcPromise(_0xe8d0('0x26'),_[_0xe8d0('0x19')](_0x145ddb['query'],_0x145ddb[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x587819,null))[_0xe8d0('0xe')](handleError(_0x587819,null));};exports['voiceQueuesChannelHangup']=function(_0x197e01,_0x531835){return respondWithRpcPromise(_0xe8d0('0x27'),_[_0xe8d0('0x19')](_0x197e01[_0xe8d0('0x16')],_0x197e01[_0xe8d0('0x1a')]))['then'](respondWithResult(_0x531835,null))[_0xe8d0('0xe')](handleError(_0x531835,null));};exports[_0xe8d0('0x28')]=function(_0x20eec5,_0x516243){return respondWithRpcPromise(_0xe8d0('0x29'),_[_0xe8d0('0x19')](_0x20eec5[_0xe8d0('0x16')],_0x20eec5[_0xe8d0('0x1a')]))[_0xe8d0('0x17')](respondWithResult(_0x516243,null))['catch'](handleError(_0x516243,null));};exports[_0xe8d0('0x2a')]=function(_0x1828c5,_0x10970d){return respondWithRpcPromise(_0xe8d0('0x2b'),_0x1828c5[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x10970d,null))[_0xe8d0('0xe')](handleError(_0x10970d,null));};exports[_0xe8d0('0x2c')]=function(_0x4edb3d,_0x5dff14){return respondWithRpcPromise(_0xe8d0('0x2d'),_0x4edb3d[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x5dff14,null))[_0xe8d0('0xe')](handleError(_0x5dff14,null));};exports[_0xe8d0('0x2e')]=function(_0x585d27,_0x2e4362){var _0x4bd7a2;return respondWithRpcPromise(_0xe8d0('0x2f'),_0x585d27[_0xe8d0('0x16')])[_0xe8d0('0x17')](function(_0x48fa07){_0x4bd7a2=_0x48fa07;return respondWithRpcPromise(_0xe8d0('0x2f'),_0x585d27[_0xe8d0('0x16')],routingClient);})[_0xe8d0('0x17')](function(_0x230a90){return _[_0xe8d0('0x19')]({},_0x230a90,_0x4bd7a2);})['then'](respondWithResult(_0x2e4362,null))['catch'](handleError(_0x2e4362,null));};exports['agentCapacity']=function(_0x4cf0da,_0x14ffb6){if(_0x4cf0da['body']&&_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')]&&_0x4cf0da[_0xe8d0('0x32')]&&_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')]){for(var _0x1156da in _0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')]){if(_0x4cf0da['body'][_0xe8d0('0x31')][_0xe8d0('0x33')](_0x1156da)){db['MemberReport']['findAll']({'where':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')],'type':_0xe8d0('0x34'),'exitAt':null,'uniqueid':_0x4cf0da['body'][_0xe8d0('0x31')][_0x1156da]&&_0x4cf0da[_0xe8d0('0x30')]['interaction'][_0x1156da][_0xe8d0('0x35')]?{'$notIn':_0x4cf0da[_0xe8d0('0x30')]['interaction'][_0x1156da]}:{'$ne':null}}})[_0xe8d0('0x17')](function(_0x23e250){var _0x1b7866=moment()[_0xe8d0('0x36')](_0xe8d0('0x37'));for(var _0x2a6760=0x0,_0x11339d=_0x23e250[_0xe8d0('0x35')];_0x2a6760<_0x11339d;_0x2a6760+=0x1){_0x23e250[_0x2a6760]['updateAttributes']({'exitAt':_0x1b7866});}});for(var _0x31a370=0x0;_0x31a370<_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0xe8d0('0x35')];_0x31a370+=0x1){db[_0xe8d0('0x38')][_0xe8d0('0x39')]({'where':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')],'type':_0xe8d0('0x34'),'uniqueid':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0x31a370],'exitAt':null},'defaults':{'channel':_0x1156da,'membername':_0x4cf0da[_0xe8d0('0x32')]['name'],'interface':_[_0xe8d0('0x13')](_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x3a')])?util[_0xe8d0('0x36')](_0xe8d0('0x3b'),_0x4cf0da[_0xe8d0('0x32')][_0xe8d0('0x11')]):_0x4cf0da['user'][_0xe8d0('0x3a')],'type':_0xe8d0('0x34'),'enterAt':moment()[_0xe8d0('0x36')](_0xe8d0('0x37')),'role':'agent','internal':_0x4cf0da[_0xe8d0('0x32')]['internal'],'uniqueid':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x31')][_0x1156da][_0x31a370]}});}}}}return respondWithRpcPromise(_0xe8d0('0x3c'),{'id':_0x4cf0da[_0xe8d0('0x1a')]['id'],'capacity':_0x4cf0da[_0xe8d0('0x30')][_0xe8d0('0x3d')]},routingClient)[_0xe8d0('0x17')](respondWithResult(_0x14ffb6,null))['catch'](handleError(_0x14ffb6,null));};exports[_0xe8d0('0x3e')]=function(_0x55f93d,_0x581a34){return respondWithRpcPromise(_0xe8d0('0x3f'),_0x55f93d['query'])[_0xe8d0('0x17')](respondWithResult(_0x581a34,null))['catch'](handleError(_0x581a34,null));};exports[_0xe8d0('0x40')]=function(_0x28494c,_0x13713c){return respondWithRpcPromise(_0xe8d0('0x41'),_0x28494c['query'])[_0xe8d0('0x17')](respondWithResult(_0x13713c,null))[_0xe8d0('0xe')](handleError(_0x13713c,null));};exports[_0xe8d0('0x42')]=function(_0x2e3f1d,_0x18cc14){return respondWithRpcPromise('Campaigns',_0x2e3f1d[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x18cc14,null))[_0xe8d0('0xe')](handleError(_0x18cc14,null));};exports['chatQueues']=function(_0x2f4d43,_0x571c4e){return respondWithRpcPromise('ChatQueues',_0x2f4d43[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x571c4e,null))['catch'](handleError(_0x571c4e,null));};exports[_0xe8d0('0x43')]=function(_0x3a8074,_0x47893d){return respondWithRpcPromise(_0xe8d0('0x44'),_0x3a8074[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x3a8074[_0xe8d0('0x1a')]['id']))['then'](respondWithResult(_0x47893d,null))[_0xe8d0('0xe')](handleError(_0x47893d,null));};exports[_0xe8d0('0x45')]=function(_0x25e5ab,_0x76316a){return respondWithRpcPromise('MailQueues',_0x25e5ab[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x76316a,null))[_0xe8d0('0xe')](handleError(_0x76316a,null));};exports[_0xe8d0('0x46')]=function(_0x1a74d0,_0x29667c){return respondWithRpcPromise('MailQueues',_0x1a74d0['query'],routingClient)[_0xe8d0('0x17')](findById(_0x1a74d0['params']['id']))[_0xe8d0('0x17')](respondWithResult(_0x29667c,null))[_0xe8d0('0xe')](handleError(_0x29667c,null));};exports['mailAccounts']=function(_0x5ac1ae,_0x995163){return respondWithRpcPromise('MailAccounts',_0x5ac1ae[_0xe8d0('0x16')],mailClient)['then'](respondWithResult(_0x995163,null))[_0xe8d0('0xe')](handleError(_0x995163,null));};exports[_0xe8d0('0x47')]=function(_0x13b9f0,_0x4e2abc){return respondWithRpcPromise(_0xe8d0('0x48'),_0x13b9f0[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x4e2abc,null))[_0xe8d0('0xe')](handleError(_0x4e2abc,null));};exports['showOpenchannelQueues']=function(_0x3d0908,_0x4ff583){return respondWithRpcPromise(_0xe8d0('0x48'),_0x3d0908[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x3d0908[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x4ff583,null))['catch'](handleError(_0x4ff583,null));};exports['smsQueues']=function(_0xd7d433,_0x55a2df){return respondWithRpcPromise(_0xe8d0('0x49'),_0xd7d433[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x55a2df,null))[_0xe8d0('0xe')](handleError(_0x55a2df,null));};exports[_0xe8d0('0x4a')]=function(_0x1e806b,_0x177485){return respondWithRpcPromise(_0xe8d0('0x49'),_0x1e806b[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x1e806b[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x177485,null))[_0xe8d0('0xe')](handleError(_0x177485,null));};exports[_0xe8d0('0x4b')]=function(_0x22992f,_0x4a68d5){return respondWithRpcPromise(_0xe8d0('0x4c'),_0x22992f[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x4a68d5,null))[_0xe8d0('0xe')](handleError(_0x4a68d5,null));};exports[_0xe8d0('0x4d')]=function(_0x4848d4,_0x2eeb92){return respondWithRpcPromise(_0xe8d0('0x4c'),_0x4848d4[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](findById(_0x4848d4[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x2eeb92,null))[_0xe8d0('0xe')](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x4e')]=function(_0x40cb5c,_0x24be86){return respondWithRpcPromise(_0xe8d0('0x4f'),_0x40cb5c[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x24be86,null))['catch'](handleError(_0x24be86,null));};exports[_0xe8d0('0x50')]=function(_0x54c04f,_0x169047){return respondWithRpcPromise(_0xe8d0('0x4f'),_0x54c04f['query'],routingClient)[_0xe8d0('0x17')](findById(_0x54c04f[_0xe8d0('0x1a')]['id']))[_0xe8d0('0x17')](respondWithResult(_0x169047,null))[_0xe8d0('0xe')](handleError(_0x169047,null));};exports[_0xe8d0('0x51')]=function(_0x1b5df8,_0x473e0b){return respondWithRpcPromise(_0xe8d0('0x52'),_0x1b5df8[_0xe8d0('0x16')])[_0xe8d0('0x17')](respondWithResult(_0x473e0b,null))[_0xe8d0('0xe')](handleError(_0x473e0b,null));};exports[_0xe8d0('0x53')]=function(_0xa0c61a,_0x2147d5){return respondWithRpcPromise(_0xe8d0('0x54'),_0xa0c61a[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x2147d5,null))[_0xe8d0('0xe')](handleError(_0x2147d5,null));};exports[_0xe8d0('0x55')]=function(_0x500fb0,_0x30ed66){return respondWithRpcPromise(_0xe8d0('0x56'),_0x500fb0[_0xe8d0('0x16')],routingClient)['then'](respondWithResult(_0x30ed66,null))[_0xe8d0('0xe')](handleError(_0x30ed66,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x31e6df,_0x1c1794){return respondWithRpcPromise(_0xe8d0('0x57'),_0x31e6df['query'],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x1c1794,null))[_0xe8d0('0xe')](handleError(_0x1c1794,null));};exports[_0xe8d0('0x58')]=function(_0x207680,_0x939184){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x207680[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](function(_0x23ba49){if(_0x207680[_0xe8d0('0x16')][_0xe8d0('0x59')]!==undefined){var _0x385a73=_(_0x23ba49[_0xe8d0('0x14')])[_0xe8d0('0x5a')]([_0x207680['query'][_0xe8d0('0x59')],_0x207680[_0xe8d0('0x1a')]['id']])[_0xe8d0('0x5b')](_0xe8d0('0x5c'))['uniq']()[_0xe8d0('0x5d')]();return _0x23ba49[_0xe8d0('0x14')][_0xe8d0('0x5a')](function(_0x575730){return _0x385a73[_0xe8d0('0x5e')](_0x575730['queue_id'])>-0x1;});}else{return _0x23ba49[_0xe8d0('0x14')]['filter'](function(_0x25bc77){return _0x25bc77[_0xe8d0('0x5c')]===parseInt(_0x207680[_0xe8d0('0x1a')]['id']);});}})[_0xe8d0('0x17')](respondWithResult(_0x939184,null))[_0xe8d0('0xe')](handleError(_0x939184,null));};exports[_0xe8d0('0x5f')]=function(_0x17fbdc,_0x3f5c69){return respondWithRpcPromise(_0xe8d0('0x60'),_0x17fbdc[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x3f5c69,null))[_0xe8d0('0xe')](handleError(_0x3f5c69,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x20e4ff,_0x1fa61e){return respondWithRpcPromise(_0xe8d0('0x61'),_0x20e4ff[_0xe8d0('0x16')],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x1fa61e,null))[_0xe8d0('0xe')](handleError(_0x1fa61e,null));};exports[_0xe8d0('0x62')]=function(_0x605b5f,_0x2f9702){return respondWithRpcPromise(_0xe8d0('0x63'),_0x605b5f['query'],routingClient)[_0xe8d0('0x17')](respondWithResult(_0x2f9702,null))[_0xe8d0('0xe')](handleError(_0x2f9702,null));};exports[_0xe8d0('0x64')]=function(_0xebc89e){return function(_0x255e4b,_0x550fe6){var _0x4c4ff0,_0xca752a;var _0x5c8c7d=_[_0xe8d0('0x65')](_0xebc89e);var _0x16098b=_0xebc89e===_0xe8d0('0x66')?'Website':_0xe8d0('0x67');return db[_0x5c8c7d+'Queue'][_0xe8d0('0x68')]({'raw':!![],'where':{'id':_0x255e4b[_0xe8d0('0x1a')]['id']}})[_0xe8d0('0x17')](function(_0x1a04a6){if(_[_0xe8d0('0x13')](_0x1a04a6)){throw new Error(_0x5c8c7d+'\x20Queue\x20not\x20found');}_0x4c4ff0=_0x1a04a6;return db[_0x5c8c7d+'Message'][_0xe8d0('0x68')]({'where':{'id':_0x255e4b[_0xe8d0('0x30')][_0xe8d0('0x69')]},'include':[{'model':db[_0x5c8c7d+_0xe8d0('0x6a')],'as':_0xe8d0('0x6a')},{'model':db[_0x5c8c7d+_0x16098b],'as':_0xe8d0('0x67')}]});})[_0xe8d0('0x17')](function(_0x1ff1cc){if(_[_0xe8d0('0x13')](_0x1ff1cc)){throw new Error(_0x5c8c7d+'\x20Message\x20not\x20found');}_0xca752a=_0x1ff1cc;return _0x1ff1cc[_0xe8d0('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe8d0('0x17')](function(){var _0x142db4={'uniqueid':_0xebc89e+'.'+_0xca752a['id']+'.'+_0xca752a[_0xe8d0('0x6a')]['id'],'FromUserId':_0x255e4b['user']['id'],'type':'queue'};_0x142db4[_0x5c8c7d+_0xe8d0('0x6c')]=_0xca752a['id'];_0x142db4[_0x5c8c7d+_0xe8d0('0x6d')]=_0xca752a[_0xe8d0('0x6a')]['id'];_0x142db4[_0xe8d0('0x6e')+_0x5c8c7d+_0x16098b+'Id']=_0xca752a[_0xe8d0('0x67')]['id'];_0x142db4['To'+_0x5c8c7d+_0xe8d0('0x6f')]=_0x4c4ff0['id'];return db[_0x5c8c7d+_0xe8d0('0x70')][_0xe8d0('0x71')](_0x142db4);})[_0xe8d0('0x17')](function(){return respondWithRpcPromise(_0xe8d0('0x72'),{'channel':_0xebc89e,'interaction':_0xca752a['Interaction'],'message':_0xca752a,'account':_0xca752a[_0xe8d0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe8d0('0x73'),'appdata':_0x4c4ff0[_0xe8d0('0x11')]+','+(_0xca752a[_0xe8d0('0x67')][_0xe8d0('0x74')]||0x12c),'interval':_0xe8d0('0x75')}]},routingClient);})[_0xe8d0('0x17')](respondWithResult(_0x550fe6,null))[_0xe8d0('0xe')](handleError(_0x550fe6,null));};};exports[_0xe8d0('0x76')]=function(_0x47bdc2,_0x52aece){var _0x2e11fc,_0x38e83f;if(_['isNil'](_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x77')])){throw new Error(_0xe8d0('0x78'));}var _0x499efb=_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x77')];var _0x233a5a=_[_0xe8d0('0x65')](_0x499efb);var _0x55588a=_0x499efb==='chat'?_0xe8d0('0x79'):_0xe8d0('0x67');return db['User']['findOne']({'raw':!![],'where':{'id':_0x47bdc2[_0xe8d0('0x1a')]['id'],'role':_0xe8d0('0x7a')}})[_0xe8d0('0x17')](function(_0x5eaf13){if(_[_0xe8d0('0x13')](_0x5eaf13)){throw new Error('Agent\x20not\x20found');}_0x2e11fc=_0x5eaf13;return db[_0x233a5a+'Message'][_0xe8d0('0x68')]({'where':{'id':_0x47bdc2[_0xe8d0('0x30')][_0xe8d0('0x69')]},'include':[{'model':db[_0x233a5a+_0xe8d0('0x6a')],'as':_0xe8d0('0x6a')},{'model':db[_0x233a5a+_0x55588a],'as':'Account'}]});})[_0xe8d0('0x17')](function(_0x455614){if(_['isNil'](_0x455614)){throw new Error(_0x233a5a+_0xe8d0('0x7b'));}_0x38e83f=_0x455614;return _0x455614[_0xe8d0('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe8d0('0x17')](function(){var _0x3e18af={'uniqueid':_0x499efb+'.'+_0x38e83f['id']+'.'+_0x38e83f['Interaction']['id'],'FromUserId':_0x47bdc2[_0xe8d0('0x32')]['id'],'type':_0xe8d0('0x73'),'ToUserId':_0x2e11fc['id']};_0x3e18af[_0x233a5a+_0xe8d0('0x6c')]=_0x38e83f['id'];_0x3e18af[_0x233a5a+_0xe8d0('0x6d')]=_0x38e83f[_0xe8d0('0x6a')]['id'];_0x3e18af[_0xe8d0('0x6e')+_0x233a5a+_0x55588a+'Id']=_0x38e83f[_0xe8d0('0x67')]['id'];return db[_0x233a5a+_0xe8d0('0x70')]['create'](_0x3e18af);})[_0xe8d0('0x17')](function(){return respondWithRpcPromise(_0xe8d0('0x72'),{'channel':_0x499efb,'interaction':_0x38e83f['Interaction'],'message':_0x38e83f,'account':_0x38e83f['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2e11fc['name']+','+(_0x38e83f[_0xe8d0('0x67')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe8d0('0x17')](respondWithResult(_0x52aece,null))['catch'](handleError(_0x52aece,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 665811b..66d699d 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 _0xec74=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./schedule.controller','get','isAuthenticated'];(function(_0x129a71,_0x2e62a8){var _0xc73b51=function(_0x4739e7){while(--_0x4739e7){_0x129a71['push'](_0x129a71['shift']());}};_0xc73b51(++_0x2e62a8);}(_0xec74,0x171));var _0x4ec7=function(_0x5cf245,_0x33976e){_0x5cf245=_0x5cf245-0x0;var _0x1178c7=_0xec74[_0x5cf245];return _0x1178c7;};'use strict';var multer=require(_0x4ec7('0x0'));var util=require(_0x4ec7('0x1'));var path=require(_0x4ec7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ec7('0x3')]();var fs_extra=require(_0x4ec7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4ec7('0x5'));var config=require('../../config/environment');var controller=require(_0x4ec7('0x6'));router[_0x4ec7('0x7')]('/',auth[_0x4ec7('0x8')](),controller[_0x4ec7('0x9')]);router[_0x4ec7('0x7')](_0x4ec7('0xa'),auth[_0x4ec7('0x8')](),controller['show']);router[_0x4ec7('0x7')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x4ec7('0xb')]('/',auth[_0x4ec7('0x8')](),controller[_0x4ec7('0xc')]);router[_0x4ec7('0xd')](_0x4ec7('0xa'),auth[_0x4ec7('0x8')](),controller[_0x4ec7('0xe')]);router[_0x4ec7('0xf')](_0x4ec7('0xa'),auth[_0x4ec7('0x8')](),controller[_0x4ec7('0x10')]);module[_0x4ec7('0x11')]=router; \ No newline at end of file +var _0x10af=['../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','run','put','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x10af,0x185));var _0xf10a=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x10af[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0xf10a('0x0'));var util=require(_0xf10a('0x1'));var path=require(_0xf10a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf10a('0x3'));var router=express[_0xf10a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf10a('0x5'));var interaction=require(_0xf10a('0x6'));var config=require(_0xf10a('0x7'));var controller=require(_0xf10a('0x8'));router[_0xf10a('0x9')]('/',auth[_0xf10a('0xa')](),controller['index']);router[_0xf10a('0x9')](_0xf10a('0xb'),auth[_0xf10a('0xa')](),controller[_0xf10a('0xc')]);router[_0xf10a('0x9')](_0xf10a('0xd'),auth[_0xf10a('0xa')](),controller[_0xf10a('0xe')]);router['post']('/',auth[_0xf10a('0xa')](),controller['create']);router[_0xf10a('0xf')](_0xf10a('0xb'),auth[_0xf10a('0xa')](),controller['update']);router[_0xf10a('0x10')](_0xf10a('0xb'),auth[_0xf10a('0xa')](),controller['destroy']);module[_0xf10a('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2f47b3c..6a33e25 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 _0x2e46=['weeks','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','years','quarters','months'];(function(_0x3426bd,_0x5e2c37){var _0x5e0971=function(_0x2ea0a6){while(--_0x2ea0a6){_0x3426bd['push'](_0x3426bd['shift']());}};_0x5e0971(++_0x5e2c37);}(_0x2e46,0x187));var _0x62e4=function(_0x2419c9,_0x262667){_0x2419c9=_0x2419c9-0x0;var _0x7605e=_0x2e46[_0x2419c9];return _0x7605e;};'use strict';var Sequelize=require(_0x62e4('0x0'));module[_0x62e4('0x1')]={'name':{'type':Sequelize[_0x62e4('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x62e4('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x62e4('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x62e4('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x62e4('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x62e4('0x6'),_0x62e4('0x7'),_0x62e4('0x8'),_0x62e4('0x9'),_0x62e4('0xa'),_0x62e4('0xb'),_0x62e4('0xc')),'allowNull':![],'defaultValue':_0x62e4('0xa')},'output':{'type':Sequelize[_0x62e4('0xd')](_0x62e4('0xe'),_0x62e4('0xf'),_0x62e4('0x10')),'allowNull':![],'defaultValue':_0x62e4('0xe')},'type':{'type':Sequelize[_0x62e4('0xd')](_0x62e4('0x11'),_0x62e4('0x12')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x62e4('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x62e4('0x2')]},'cc':{'type':Sequelize[_0x62e4('0x13')]},'bcc':{'type':Sequelize[_0x62e4('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x62e4('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5c55=['TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','default'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x5c55,0x10b));var _0x55c5=function(_0xd6fcb5,_0x526523){_0xd6fcb5=_0xd6fcb5-0x0;var _0x278ac7=_0x5c55[_0xd6fcb5];return _0x278ac7;};'use strict';var Sequelize=require(_0x55c5('0x0'));module['exports']={'name':{'type':Sequelize[_0x55c5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x55c5('0x1')]},'active':{'type':Sequelize[_0x55c5('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x55c5('0x1')],'allowNull':![],'defaultValue':_0x55c5('0x3')},'startAt':{'type':Sequelize[_0x55c5('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x55c5('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x55c5('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x55c5('0x6')](_0x55c5('0x7'),_0x55c5('0x8'),_0x55c5('0x9'),_0x55c5('0xa'),_0x55c5('0xb'),_0x55c5('0xc'),_0x55c5('0xd')),'allowNull':![],'defaultValue':_0x55c5('0xb')},'output':{'type':Sequelize[_0x55c5('0x6')](_0x55c5('0xe'),_0x55c5('0xf'),_0x55c5('0x10')),'allowNull':![],'defaultValue':_0x55c5('0xe')},'type':{'type':Sequelize[_0x55c5('0x6')]('custom',_0x55c5('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x55c5('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x55c5('0x1')]},'cc':{'type':Sequelize[_0x55c5('0x12')]},'bcc':{'type':Sequelize[_0x55c5('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x55c5('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index db7b415..f73ef3c 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 _0x6f0a=['Content-Range','save','update','then','destroy','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','include','rows','catch','params','keys','length','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x1e4de7,_0x54ad8d){var _0x43fa27=function(_0x995221){while(--_0x995221){_0x1e4de7['push'](_0x1e4de7['shift']());}};_0x43fa27(++_0x54ad8d);}(_0x6f0a,0x180));var _0xa6f0=function(_0x15aa8b,_0x1e02b2){_0x15aa8b=_0x15aa8b-0x0;var _0x24dd4b=_0x6f0a[_0x15aa8b];return _0x24dd4b;};'use strict';var emlformat=require(_0xa6f0('0x0'));var rimraf=require(_0xa6f0('0x1'));var zipdir=require(_0xa6f0('0x2'));var jsonpatch=require(_0xa6f0('0x3'));var rp=require(_0xa6f0('0x4'));var moment=require('moment');var BPromise=require(_0xa6f0('0x5'));var Mustache=require(_0xa6f0('0x6'));var util=require(_0xa6f0('0x7'));var path=require(_0xa6f0('0x8'));var sox=require(_0xa6f0('0x9'));var csv=require(_0xa6f0('0xa'));var ejs=require(_0xa6f0('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f0('0xc'));var _=require(_0xa6f0('0xd'));var squel=require('squel');var crypto=require(_0xa6f0('0xe'));var jsforce=require(_0xa6f0('0xf'));var deskjs=require(_0xa6f0('0x10'));var toCsv=require(_0xa6f0('0xa'));var querystring=require('querystring');var Papa=require(_0xa6f0('0x11'));var Redis=require(_0xa6f0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa6f0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6f0('0x14'));var logger=require(_0xa6f0('0x15'))(_0xa6f0('0x16'));var utils=require(_0xa6f0('0x17'));var config=require(_0xa6f0('0x18'));var licenseUtil=require(_0xa6f0('0x19'));var db=require(_0xa6f0('0x1a'))['db'];function respondWithStatusCode(_0x293574,_0x45068f){_0x45068f=_0x45068f||0xcc;return function(_0x17e2ca){if(_0x17e2ca){return _0x293574[_0xa6f0('0x1b')](_0x45068f);}return _0x293574[_0xa6f0('0x1c')](_0x45068f)[_0xa6f0('0x1d')]();};}function respondWithResult(_0x2f9f04,_0x11aa5d){_0x11aa5d=_0x11aa5d||0xc8;return function(_0x1bd7c1){if(_0x1bd7c1){return _0x2f9f04[_0xa6f0('0x1c')](_0x11aa5d)[_0xa6f0('0x1e')](_0x1bd7c1);}};}function respondWithFilteredResult(_0x53501c,_0xcced7b){return function(_0x17247c){if(_0x17247c){var _0x416d07=typeof _0xcced7b[_0xa6f0('0x1f')]===_0xa6f0('0x20')&&typeof _0xcced7b['limit']===_0xa6f0('0x20');var _0x36beae=_0x17247c['count'];var _0x1d3180=_0x416d07?0x0:_0xcced7b[_0xa6f0('0x1f')];var _0x2023e6=_0x416d07?_0x17247c[_0xa6f0('0x21')]:_0xcced7b[_0xa6f0('0x1f')]+_0xcced7b[_0xa6f0('0x22')];var _0xe5f454;if(_0x2023e6>=_0x36beae){_0x2023e6=_0x36beae;_0xe5f454=0xc8;}else{_0xe5f454=0xce;}_0x53501c[_0xa6f0('0x1c')](_0xe5f454);return _0x53501c[_0xa6f0('0x23')](_0xa6f0('0x24'),_0x1d3180+'-'+_0x2023e6+'/'+_0x36beae)[_0xa6f0('0x1e')](_0x17247c);}return null;};}function patchUpdates(_0x74ec6c){return function(_0x14cb93){try{jsonpatch['apply'](_0x14cb93,_0x74ec6c,!![]);}catch(_0x47e927){return BPromise['reject'](_0x47e927);}return _0x14cb93[_0xa6f0('0x25')]();};}function saveUpdates(_0x241e8f,_0xec8a9a){return function(_0x39ac56){if(_0x39ac56){return _0x39ac56[_0xa6f0('0x26')](_0x241e8f)[_0xa6f0('0x27')](function(_0x310528){return _0x310528;});}return null;};}function removeEntity(_0x3dc896,_0x1072f5){return function(_0xe29c6e){if(_0xe29c6e){return _0xe29c6e[_0xa6f0('0x28')]()[_0xa6f0('0x27')](function(){var _0x551946=_0xe29c6e['get']({'plain':!![]});var _0x45147e=_0xa6f0('0x29');return db[_0xa6f0('0x2a')][_0xa6f0('0x28')]({'where':{'type':_0x45147e,'resourceId':_0x551946['id']}})[_0xa6f0('0x27')](function(){return _0xe29c6e;});})[_0xa6f0('0x27')](function(){_0x3dc896[_0xa6f0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38a961,_0x37507d){return function(_0x54ee88){if(!_0x54ee88){_0x38a961['sendStatus'](0x194);}return _0x54ee88;};}function handleError(_0x3cece6,_0x107319){_0x107319=_0x107319||0x1f4;return function(_0x596325){logger[_0xa6f0('0x2b')](_0x596325[_0xa6f0('0x2c')]);if(_0x596325['name']){delete _0x596325[_0xa6f0('0x2d')];}_0x3cece6[_0xa6f0('0x1c')](_0x107319)[_0xa6f0('0x2e')](_0x596325);};}exports[_0xa6f0('0x2f')]=function(_0x365b41,_0x54d6af){var _0x462e9c={},_0x3e5f96={},_0x3c3edf={'count':0x0,'rows':[]};var _0x44e3c7=_[_0xa6f0('0x30')](db[_0xa6f0('0x31')][_0xa6f0('0x32')],function(_0x475937){return{'name':_0x475937['fieldName'],'type':_0x475937[_0xa6f0('0x33')]['key']};});_0x3e5f96[_0xa6f0('0x34')]=_['map'](_0x44e3c7,_0xa6f0('0x2d'));_0x3e5f96[_0xa6f0('0x35')]=_['keys'](_0x365b41[_0xa6f0('0x35')]);_0x3e5f96['filters']=_[_0xa6f0('0x36')](_0x3e5f96['model'],_0x3e5f96[_0xa6f0('0x35')]);_0x462e9c[_0xa6f0('0x37')]=_[_0xa6f0('0x36')](_0x3e5f96[_0xa6f0('0x34')],qs[_0xa6f0('0x38')](_0x365b41[_0xa6f0('0x35')][_0xa6f0('0x38')]));_0x462e9c[_0xa6f0('0x37')]=_0x462e9c[_0xa6f0('0x37')]['length']?_0x462e9c['attributes']:_0x3e5f96[_0xa6f0('0x34')];if(!_0x365b41[_0xa6f0('0x35')][_0xa6f0('0x39')](_0xa6f0('0x3a'))){_0x462e9c[_0xa6f0('0x22')]=qs[_0xa6f0('0x22')](_0x365b41['query'][_0xa6f0('0x22')]);_0x462e9c['offset']=qs[_0xa6f0('0x1f')](_0x365b41[_0xa6f0('0x35')][_0xa6f0('0x1f')]);}_0x462e9c[_0xa6f0('0x3b')]=qs[_0xa6f0('0x3c')](_0x365b41[_0xa6f0('0x35')][_0xa6f0('0x3c')]);_0x462e9c[_0xa6f0('0x3d')]=qs[_0xa6f0('0x3e')](_['pick'](_0x365b41[_0xa6f0('0x35')],_0x3e5f96[_0xa6f0('0x3e')]),_0x44e3c7);if(_0x365b41['query']['filter']){_0x462e9c[_0xa6f0('0x3d')]=_[_0xa6f0('0x3f')](_0x462e9c[_0xa6f0('0x3d')],{'$or':_[_0xa6f0('0x30')](_0x44e3c7,function(_0x2f8304){if(_0x2f8304[_0xa6f0('0x33')]!=='VIRTUAL'){var _0x5992e9={};_0x5992e9[_0x2f8304[_0xa6f0('0x2d')]]={'$like':'%'+_0x365b41['query'][_0xa6f0('0x40')]+'%'};return _0x5992e9;}})});}_0x462e9c=_[_0xa6f0('0x3f')]({},_0x462e9c,_0x365b41[_0xa6f0('0x41')]);var _0x643319={'where':_0x462e9c[_0xa6f0('0x3d')]};return db[_0xa6f0('0x31')][_0xa6f0('0x21')](_0x643319)['then'](function(_0x489688){_0x3c3edf[_0xa6f0('0x21')]=_0x489688;if(_0x365b41[_0xa6f0('0x35')][_0xa6f0('0x42')]){_0x462e9c[_0xa6f0('0x43')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x462e9c);})[_0xa6f0('0x27')](function(_0x228181){_0x3c3edf[_0xa6f0('0x44')]=_0x228181;return _0x3c3edf;})[_0xa6f0('0x27')](respondWithFilteredResult(_0x54d6af,_0x462e9c))[_0xa6f0('0x45')](handleError(_0x54d6af,null));};exports['show']=function(_0x5b047d,_0xba9863){var _0xafe583={'raw':![],'where':{'id':_0x5b047d[_0xa6f0('0x46')]['id']}},_0x4bae8b={};_0x4bae8b[_0xa6f0('0x34')]=_[_0xa6f0('0x47')](db[_0xa6f0('0x31')][_0xa6f0('0x32')]);_0x4bae8b[_0xa6f0('0x35')]=_[_0xa6f0('0x47')](_0x5b047d['query']);_0x4bae8b[_0xa6f0('0x3e')]=_[_0xa6f0('0x36')](_0x4bae8b['model'],_0x4bae8b[_0xa6f0('0x35')]);_0xafe583[_0xa6f0('0x37')]=_[_0xa6f0('0x36')](_0x4bae8b[_0xa6f0('0x34')],qs[_0xa6f0('0x38')](_0x5b047d['query'][_0xa6f0('0x38')]));_0xafe583[_0xa6f0('0x37')]=_0xafe583['attributes'][_0xa6f0('0x48')]?_0xafe583[_0xa6f0('0x37')]:_0x4bae8b[_0xa6f0('0x34')];if(_0x5b047d['query'][_0xa6f0('0x42')]){_0xafe583[_0xa6f0('0x43')]=[{'all':!![]}];}_0xafe583=_[_0xa6f0('0x3f')]({},_0xafe583,_0x5b047d[_0xa6f0('0x41')]);return db[_0xa6f0('0x31')][_0xa6f0('0x49')](_0xafe583)[_0xa6f0('0x27')](handleEntityNotFound(_0xba9863,null))[_0xa6f0('0x27')](respondWithResult(_0xba9863,null))[_0xa6f0('0x45')](handleError(_0xba9863,null));};exports['create']=function(_0x7c1ec0,_0x32b8bd){return db[_0xa6f0('0x31')][_0xa6f0('0x4a')](_0x7c1ec0[_0xa6f0('0x4b')],{})[_0xa6f0('0x27')](function(_0x52cd6f){var _0x492ea7=_0x7c1ec0[_0xa6f0('0x4c')][_0xa6f0('0x4d')]({'plain':!![]});if(!_0x492ea7)throw new Error(_0xa6f0('0x4e'));if(_0x492ea7[_0xa6f0('0x4f')]===_0xa6f0('0x4c')){var _0x4c71db=_0x52cd6f['get']({'plain':!![]});var _0xbd2b1a=_0xa6f0('0x29');return db[_0xa6f0('0x50')][_0xa6f0('0x49')]({'where':{'name':_0xbd2b1a,'userProfileId':_0x492ea7[_0xa6f0('0x51')]},'raw':!![]})[_0xa6f0('0x27')](function(_0x524933){if(_0x524933&&_0x524933[_0xa6f0('0x52')]===0x0){return db[_0xa6f0('0x2a')]['create']({'name':_0x4c71db['name'],'resourceId':_0x4c71db['id'],'type':_0x524933['name'],'sectionId':_0x524933['id']},{})[_0xa6f0('0x27')](function(){return _0x52cd6f;});}else{return _0x52cd6f;}})[_0xa6f0('0x45')](function(_0x4bca9f){logger[_0xa6f0('0x2b')](_0xa6f0('0x53'),_0x4bca9f);throw _0x4bca9f;});}return _0x52cd6f;})[_0xa6f0('0x27')](respondWithResult(_0x32b8bd,0xc9))['catch'](handleError(_0x32b8bd,null));};exports[_0xa6f0('0x26')]=function(_0x3c56ae,_0x83ba30){if(_0x3c56ae[_0xa6f0('0x4b')]['id']){delete _0x3c56ae['body']['id'];}return db['Schedule'][_0xa6f0('0x49')]({'where':{'id':_0x3c56ae[_0xa6f0('0x46')]['id']}})[_0xa6f0('0x27')](handleEntityNotFound(_0x83ba30,null))['then'](saveUpdates(_0x3c56ae[_0xa6f0('0x4b')],null))['then'](respondWithResult(_0x83ba30,null))['catch'](handleError(_0x83ba30,null));};exports[_0xa6f0('0x28')]=function(_0x25c94a,_0x48b21e){return db[_0xa6f0('0x31')][_0xa6f0('0x49')]({'where':{'id':_0x25c94a[_0xa6f0('0x46')]['id']}})[_0xa6f0('0x27')](handleEntityNotFound(_0x48b21e,null))[_0xa6f0('0x27')](removeEntity(_0x48b21e,null))[_0xa6f0('0x45')](handleError(_0x48b21e,null));};exports['run']=function(_0x3c4838,_0x3294c2,_0x2cd447){var _0xabb26f=require('../../config/schedule');return db[_0xa6f0('0x31')][_0xa6f0('0x49')]({'where':{'id':_0x3c4838[_0xa6f0('0x46')]['id']},'raw':!![]})[_0xa6f0('0x27')](handleEntityNotFound(_0x3294c2,null))[_0xa6f0('0x27')](function(){_0xabb26f['run'](_0x3c4838[_0xa6f0('0x46')]['id']);})['then'](respondWithStatusCode(_0x3294c2,null))[_0xa6f0('0x45')](handleError(_0x3294c2,null));}; \ No newline at end of file +var _0x37f8=['set','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','Schedule','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','body','run','../../config/schedule','eml-format','rimraf','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x4e170e,_0x207e58){var _0x338291=function(_0x4cb198){while(--_0x4cb198){_0x4e170e['push'](_0x4e170e['shift']());}};_0x338291(++_0x207e58);}(_0x37f8,0x88));var _0x837f=function(_0x424ef5,_0x29a698){_0x424ef5=_0x424ef5-0x0;var _0x56bdb6=_0x37f8[_0x424ef5];return _0x56bdb6;};'use strict';var emlformat=require(_0x837f('0x0'));var rimraf=require(_0x837f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x837f('0x2'));var moment=require(_0x837f('0x3'));var BPromise=require(_0x837f('0x4'));var Mustache=require('mustache');var util=require(_0x837f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x837f('0x6'));var ejs=require(_0x837f('0x7'));var fs=require('fs');var fs_extra=require(_0x837f('0x8'));var _=require(_0x837f('0x9'));var squel=require('squel');var crypto=require(_0x837f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x837f('0xb'));var toCsv=require(_0x837f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x837f('0xc'));var authService=require(_0x837f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x837f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x837f('0xf'))(_0x837f('0x10'));var utils=require('../../config/utils');var config=require(_0x837f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x837f('0x12'))['db'];function respondWithStatusCode(_0x50b8bd,_0x5035b6){_0x5035b6=_0x5035b6||0xcc;return function(_0x3ff9f8){if(_0x3ff9f8){return _0x50b8bd[_0x837f('0x13')](_0x5035b6);}return _0x50b8bd[_0x837f('0x14')](_0x5035b6)[_0x837f('0x15')]();};}function respondWithResult(_0x5d8922,_0x4903b8){_0x4903b8=_0x4903b8||0xc8;return function(_0xcb4b48){if(_0xcb4b48){return _0x5d8922[_0x837f('0x14')](_0x4903b8)['json'](_0xcb4b48);}};}function respondWithFilteredResult(_0xc0fdde,_0x44d0ca){return function(_0x5e5d1b){if(_0x5e5d1b){var _0x5ce5db=typeof _0x44d0ca[_0x837f('0x16')]===_0x837f('0x17')&&typeof _0x44d0ca[_0x837f('0x18')]===_0x837f('0x17');var _0x906ae1=_0x5e5d1b[_0x837f('0x19')];var _0x2c09a5=_0x5ce5db?0x0:_0x44d0ca[_0x837f('0x16')];var _0x495661=_0x5ce5db?_0x5e5d1b[_0x837f('0x19')]:_0x44d0ca[_0x837f('0x16')]+_0x44d0ca[_0x837f('0x18')];var _0x47ce7a;if(_0x495661>=_0x906ae1){_0x495661=_0x906ae1;_0x47ce7a=0xc8;}else{_0x47ce7a=0xce;}_0xc0fdde['status'](_0x47ce7a);return _0xc0fdde[_0x837f('0x1a')]('Content-Range',_0x2c09a5+'-'+_0x495661+'/'+_0x906ae1)[_0x837f('0x1b')](_0x5e5d1b);}return null;};}function patchUpdates(_0x14b4b2){return function(_0x233bd7){try{jsonpatch[_0x837f('0x1c')](_0x233bd7,_0x14b4b2,!![]);}catch(_0x3f3475){return BPromise[_0x837f('0x1d')](_0x3f3475);}return _0x233bd7[_0x837f('0x1e')]();};}function saveUpdates(_0x5e97e2,_0x2e374d){return function(_0x1bbb0b){if(_0x1bbb0b){return _0x1bbb0b[_0x837f('0x1f')](_0x5e97e2)[_0x837f('0x20')](function(_0x49b914){return _0x49b914;});}return null;};}function removeEntity(_0x46a42f,_0x536832){return function(_0x4646ef){if(_0x4646ef){return _0x4646ef[_0x837f('0x21')]()[_0x837f('0x20')](function(){var _0x4e7c88=_0x4646ef['get']({'plain':!![]});var _0x65ac1d='Scheduler';return db[_0x837f('0x22')][_0x837f('0x21')]({'where':{'type':_0x65ac1d,'resourceId':_0x4e7c88['id']}})[_0x837f('0x20')](function(){return _0x4646ef;});})['then'](function(){_0x46a42f[_0x837f('0x14')](0xcc)[_0x837f('0x15')]();});}};}function handleEntityNotFound(_0x5eb792,_0x83aeda){return function(_0x3e1868){if(!_0x3e1868){_0x5eb792[_0x837f('0x13')](0x194);}return _0x3e1868;};}function handleError(_0x2fae9d,_0x34310e){_0x34310e=_0x34310e||0x1f4;return function(_0x44829e){logger[_0x837f('0x23')](_0x44829e[_0x837f('0x24')]);if(_0x44829e[_0x837f('0x25')]){delete _0x44829e[_0x837f('0x25')];}_0x2fae9d[_0x837f('0x14')](_0x34310e)['send'](_0x44829e);};}exports[_0x837f('0x26')]=function(_0x13a006,_0x4f1564){var _0x45e29e={},_0x183bfe={},_0x1b4440={'count':0x0,'rows':[]};var _0x3b6de1=_[_0x837f('0x27')](db[_0x837f('0x28')][_0x837f('0x29')],function(_0x96bb72){return{'name':_0x96bb72[_0x837f('0x2a')],'type':_0x96bb72['type'][_0x837f('0x2b')]};});_0x183bfe[_0x837f('0x2c')]=_['map'](_0x3b6de1,'name');_0x183bfe['query']=_[_0x837f('0x2d')](_0x13a006[_0x837f('0x2e')]);_0x183bfe[_0x837f('0x2f')]=_[_0x837f('0x30')](_0x183bfe[_0x837f('0x2c')],_0x183bfe[_0x837f('0x2e')]);_0x45e29e[_0x837f('0x31')]=_[_0x837f('0x30')](_0x183bfe[_0x837f('0x2c')],qs[_0x837f('0x32')](_0x13a006[_0x837f('0x2e')]['fields']));_0x45e29e[_0x837f('0x31')]=_0x45e29e[_0x837f('0x31')][_0x837f('0x33')]?_0x45e29e['attributes']:_0x183bfe[_0x837f('0x2c')];if(!_0x13a006['query'][_0x837f('0x34')](_0x837f('0x35'))){_0x45e29e[_0x837f('0x18')]=qs[_0x837f('0x18')](_0x13a006['query'][_0x837f('0x18')]);_0x45e29e[_0x837f('0x16')]=qs['offset'](_0x13a006[_0x837f('0x2e')][_0x837f('0x16')]);}_0x45e29e[_0x837f('0x36')]=qs[_0x837f('0x37')](_0x13a006[_0x837f('0x2e')][_0x837f('0x37')]);_0x45e29e[_0x837f('0x38')]=qs[_0x837f('0x2f')](_[_0x837f('0x39')](_0x13a006[_0x837f('0x2e')],_0x183bfe[_0x837f('0x2f')]),_0x3b6de1);if(_0x13a006[_0x837f('0x2e')]['filter']){_0x45e29e[_0x837f('0x38')]=_[_0x837f('0x3a')](_0x45e29e['where'],{'$or':_[_0x837f('0x27')](_0x3b6de1,function(_0x365252){if(_0x365252[_0x837f('0x3b')]!==_0x837f('0x3c')){var _0x3f9c47={};_0x3f9c47[_0x365252[_0x837f('0x25')]]={'$like':'%'+_0x13a006[_0x837f('0x2e')][_0x837f('0x3d')]+'%'};return _0x3f9c47;}})});}_0x45e29e=_['merge']({},_0x45e29e,_0x13a006[_0x837f('0x3e')]);var _0x2d4090={'where':_0x45e29e[_0x837f('0x38')]};return db[_0x837f('0x28')]['count'](_0x2d4090)[_0x837f('0x20')](function(_0x22ef26){_0x1b4440[_0x837f('0x19')]=_0x22ef26;if(_0x13a006[_0x837f('0x2e')][_0x837f('0x3f')]){_0x45e29e[_0x837f('0x40')]=[{'all':!![]}];}return db['Schedule'][_0x837f('0x41')](_0x45e29e);})[_0x837f('0x20')](function(_0x273250){_0x1b4440[_0x837f('0x42')]=_0x273250;return _0x1b4440;})['then'](respondWithFilteredResult(_0x4f1564,_0x45e29e))[_0x837f('0x43')](handleError(_0x4f1564,null));};exports[_0x837f('0x44')]=function(_0x206a4a,_0x19277f){var _0x22ac30={'raw':![],'where':{'id':_0x206a4a[_0x837f('0x45')]['id']}},_0x11dc72={};_0x11dc72[_0x837f('0x2c')]=_[_0x837f('0x2d')](db[_0x837f('0x28')]['rawAttributes']);_0x11dc72[_0x837f('0x2e')]=_['keys'](_0x206a4a['query']);_0x11dc72[_0x837f('0x2f')]=_[_0x837f('0x30')](_0x11dc72[_0x837f('0x2c')],_0x11dc72[_0x837f('0x2e')]);_0x22ac30[_0x837f('0x31')]=_[_0x837f('0x30')](_0x11dc72[_0x837f('0x2c')],qs[_0x837f('0x32')](_0x206a4a[_0x837f('0x2e')]['fields']));_0x22ac30[_0x837f('0x31')]=_0x22ac30[_0x837f('0x31')][_0x837f('0x33')]?_0x22ac30[_0x837f('0x31')]:_0x11dc72[_0x837f('0x2c')];if(_0x206a4a[_0x837f('0x2e')][_0x837f('0x3f')]){_0x22ac30[_0x837f('0x40')]=[{'all':!![]}];}_0x22ac30=_['merge']({},_0x22ac30,_0x206a4a[_0x837f('0x3e')]);return db[_0x837f('0x28')]['find'](_0x22ac30)[_0x837f('0x20')](handleEntityNotFound(_0x19277f,null))[_0x837f('0x20')](respondWithResult(_0x19277f,null))[_0x837f('0x43')](handleError(_0x19277f,null));};exports['create']=function(_0x50529f,_0x2af266){return db['Schedule'][_0x837f('0x46')](_0x50529f['body'],{})['then'](function(_0x5c4b7e){var _0x5c7ec9=_0x50529f[_0x837f('0x47')][_0x837f('0x48')]({'plain':!![]});if(!_0x5c7ec9)throw new Error(_0x837f('0x49'));if(_0x5c7ec9['role']===_0x837f('0x47')){var _0x2acf13=_0x5c4b7e[_0x837f('0x48')]({'plain':!![]});var _0x1c4732='Scheduler';return db[_0x837f('0x4a')][_0x837f('0x4b')]({'where':{'name':_0x1c4732,'userProfileId':_0x5c7ec9[_0x837f('0x4c')]},'raw':!![]})[_0x837f('0x20')](function(_0x234e8a){if(_0x234e8a&&_0x234e8a[_0x837f('0x4d')]===0x0){return db[_0x837f('0x22')]['create']({'name':_0x2acf13['name'],'resourceId':_0x2acf13['id'],'type':_0x234e8a[_0x837f('0x25')],'sectionId':_0x234e8a['id']},{})[_0x837f('0x20')](function(){return _0x5c4b7e;});}else{return _0x5c4b7e;}})[_0x837f('0x43')](function(_0x381064){logger[_0x837f('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x381064);throw _0x381064;});}return _0x5c4b7e;})[_0x837f('0x20')](respondWithResult(_0x2af266,0xc9))[_0x837f('0x43')](handleError(_0x2af266,null));};exports[_0x837f('0x1f')]=function(_0x1adfda,_0x2f7a7c){if(_0x1adfda['body']['id']){delete _0x1adfda[_0x837f('0x4e')]['id'];}return db[_0x837f('0x28')][_0x837f('0x4b')]({'where':{'id':_0x1adfda[_0x837f('0x45')]['id']}})[_0x837f('0x20')](handleEntityNotFound(_0x2f7a7c,null))['then'](saveUpdates(_0x1adfda[_0x837f('0x4e')],null))['then'](respondWithResult(_0x2f7a7c,null))['catch'](handleError(_0x2f7a7c,null));};exports[_0x837f('0x21')]=function(_0x39d80a,_0x406362){return db[_0x837f('0x28')]['find']({'where':{'id':_0x39d80a[_0x837f('0x45')]['id']}})['then'](handleEntityNotFound(_0x406362,null))[_0x837f('0x20')](removeEntity(_0x406362,null))[_0x837f('0x43')](handleError(_0x406362,null));};exports[_0x837f('0x4f')]=function(_0x4b116f,_0x30c4a9,_0xe46066){var _0x121e7f=require(_0x837f('0x50'));return db[_0x837f('0x28')][_0x837f('0x4b')]({'where':{'id':_0x4b116f['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x30c4a9,null))[_0x837f('0x20')](function(){_0x121e7f[_0x837f('0x4f')](_0x4b116f[_0x837f('0x45')]['id']);})[_0x837f('0x20')](respondWithStatusCode(_0x30c4a9,null))[_0x837f('0x43')](handleError(_0x30c4a9,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 2c7d945..cf1e80a 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 _0x2f55=['exports','define','Schedule','tools_schedules','lodash','../../config/logger','api','moment','request-promise','rimraf','./schedule.attributes'];(function(_0x18fa48,_0x41bf01){var _0x1a9b20=function(_0x46b98c){while(--_0x46b98c){_0x18fa48['push'](_0x18fa48['shift']());}};_0x1a9b20(++_0x41bf01);}(_0x2f55,0x1bc));var _0x52f5=function(_0x465fcb,_0x1c405a){_0x465fcb=_0x465fcb-0x0;var _0x239569=_0x2f55[_0x465fcb];return _0x239569;};'use strict';var _=require(_0x52f5('0x0'));var util=require('util');var logger=require(_0x52f5('0x1'))(_0x52f5('0x2'));var moment=require(_0x52f5('0x3'));var BPromise=require('bluebird');var rp=require(_0x52f5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52f5('0x5'));var config=require('../../config/environment');var attributes=require(_0x52f5('0x6'));module[_0x52f5('0x7')]=function(_0x2dc463,_0x3ddf18){return _0x2dc463[_0x52f5('0x8')](_0x52f5('0x9'),attributes,{'tableName':_0x52f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3c5=['Schedule','tools_schedules','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xc3c5,0x182));var _0x5c3c=function(_0x2f00be,_0x4f69b7){_0x2f00be=_0x2f00be-0x0;var _0x16d849=_0xc3c5[_0x2f00be];return _0x16d849;};'use strict';var _=require(_0x5c3c('0x0'));var util=require('util');var logger=require(_0x5c3c('0x1'))(_0x5c3c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5c3c('0x3'));var fs=require('fs');var path=require(_0x5c3c('0x4'));var rimraf=require(_0x5c3c('0x5'));var config=require(_0x5c3c('0x6'));var attributes=require(_0x5c3c('0x7'));module[_0x5c3c('0x8')]=function(_0x463485,_0x58eb69){return _0x463485[_0x5c3c('0x9')](_0x5c3c('0xa'),attributes,{'tableName':_0x5c3c('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 aec462f..dd30a24 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 _0x71b3=['Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then'];(function(_0x1e1f97,_0x2f6925){var _0x1e45fb=function(_0x2389ac){while(--_0x2389ac){_0x1e1f97['push'](_0x1e1f97['shift']());}};_0x1e45fb(++_0x2f6925);}(_0x71b3,0xcf));var _0x371b=function(_0x2390d7,_0x2091f4){_0x2390d7=_0x2390d7-0x0;var _0x1060b8=_0x71b3[_0x2390d7];return _0x1060b8;};'use strict';var _=require(_0x371b('0x0'));var util=require(_0x371b('0x1'));var moment=require(_0x371b('0x2'));var BPromise=require(_0x371b('0x3'));var rs=require(_0x371b('0x4'));var fs=require('fs');var Redis=require(_0x371b('0x5'));var db=require(_0x371b('0x6'))['db'];var utils=require(_0x371b('0x7'));var logger=require(_0x371b('0x8'))(_0x371b('0x9'));var config=require('../../config/environment');var jayson=require(_0x371b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x219fe9,_0x111388,_0x15d179){return new BPromise(function(_0x1f6e1e,_0x32b53d){return client[_0x371b('0xb')](_0x219fe9,_0x15d179)[_0x371b('0xc')](function(_0x56e549){logger['info'](_0x371b('0xd'),_0x111388,_0x371b('0xe'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x111388,'request\x20sent',JSON[_0x371b('0xf')](_0x56e549));if(_0x56e549[_0x371b('0x10')]){if(_0x56e549[_0x371b('0x10')][_0x371b('0x11')]===0x1f4){logger[_0x371b('0x10')]('Schedule,\x20%s,\x20%s',_0x111388,_0x56e549[_0x371b('0x10')][_0x371b('0x12')]);return _0x32b53d(_0x56e549[_0x371b('0x10')][_0x371b('0x12')]);}logger[_0x371b('0x10')](_0x371b('0xd'),_0x111388,_0x56e549[_0x371b('0x10')]['message']);return _0x1f6e1e(_0x56e549['error'][_0x371b('0x12')]);}else{logger[_0x371b('0x13')]('Schedule,\x20%s,\x20%s',_0x111388,_0x371b('0xe'));_0x1f6e1e(_0x56e549[_0x371b('0x14')][_0x371b('0x12')]);}})[_0x371b('0x15')](function(_0x2ea000){logger[_0x371b('0x10')](_0x371b('0xd'),_0x111388,_0x2ea000);_0x32b53d(_0x2ea000);});});} \ No newline at end of file +var _0x360d=['code','message','error','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3f8a48,_0x442d16){var _0x3b5767=function(_0x24ac44){while(--_0x24ac44){_0x3f8a48['push'](_0x3f8a48['shift']());}};_0x3b5767(++_0x442d16);}(_0x360d,0xad));var _0xd360=function(_0x50e410,_0x36bb68){_0x50e410=_0x50e410-0x0;var _0x3eb22c=_0x360d[_0x50e410];return _0x3eb22c;};'use strict';var _=require(_0xd360('0x0'));var util=require(_0xd360('0x1'));var moment=require(_0xd360('0x2'));var BPromise=require(_0xd360('0x3'));var rs=require(_0xd360('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd360('0x5'))['db'];var utils=require(_0xd360('0x6'));var logger=require('../../config/logger')(_0xd360('0x7'));var config=require(_0xd360('0x8'));var jayson=require(_0xd360('0x9'));var client=jayson[_0xd360('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c0d26,_0x1a5a90,_0x197a42){return new BPromise(function(_0x14444e,_0x5abd9b){return client[_0xd360('0xb')](_0x3c0d26,_0x197a42)[_0xd360('0xc')](function(_0x21a70e){logger[_0xd360('0xd')](_0xd360('0xe'),_0x1a5a90,'request\x20sent');logger[_0xd360('0xf')](_0xd360('0x10'),_0x1a5a90,_0xd360('0x11'),JSON[_0xd360('0x12')](_0x21a70e));if(_0x21a70e['error']){if(_0x21a70e['error'][_0xd360('0x13')]===0x1f4){logger['error'](_0xd360('0xe'),_0x1a5a90,_0x21a70e['error'][_0xd360('0x14')]);return _0x5abd9b(_0x21a70e['error'][_0xd360('0x14')]);}logger[_0xd360('0x15')](_0xd360('0xe'),_0x1a5a90,_0x21a70e[_0xd360('0x15')][_0xd360('0x14')]);return _0x14444e(_0x21a70e[_0xd360('0x15')][_0xd360('0x14')]);}else{logger[_0xd360('0xd')]('Schedule,\x20%s,\x20%s',_0x1a5a90,_0xd360('0x11'));_0x14444e(_0x21a70e[_0xd360('0x16')]['message']);}})[_0xd360('0x17')](function(_0x34ba1d){logger[_0xd360('0x15')](_0xd360('0xe'),_0x1a5a90,_0x34ba1d);_0x5abd9b(_0x34ba1d);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 17b0a69..ecc902b 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 _0x543c=['/:id','update','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','show','/:id/download','post','create','put'];(function(_0x168e79,_0x3754d8){var _0x59d07f=function(_0x15f2d1){while(--_0x15f2d1){_0x168e79['push'](_0x168e79['shift']());}};_0x59d07f(++_0x3754d8);}(_0x543c,0xd3));var _0xc543=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x543c[_0x349367];return _0x14179b;};'use strict';var multer=require('multer');var util=require(_0xc543('0x0'));var path=require(_0xc543('0x1'));var timeout=require(_0xc543('0x2'));var express=require(_0xc543('0x3'));var router=express['Router']();var fs_extra=require(_0xc543('0x4'));var auth=require(_0xc543('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc543('0x6'));var controller=require(_0xc543('0x7'));router[_0xc543('0x8')]('/',auth[_0xc543('0x9')](),controller[_0xc543('0xa')]);router[_0xc543('0x8')](_0xc543('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xc543('0x9')](),controller[_0xc543('0xc')]);router[_0xc543('0x8')](_0xc543('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xc543('0xe')]('/',auth[_0xc543('0x9')](),controller[_0xc543('0xf')]);router[_0xc543('0x10')](_0xc543('0x11'),auth[_0xc543('0x9')](),controller[_0xc543('0x12')]);router['delete'](_0xc543('0x11'),auth[_0xc543('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x256e=['put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id/download','download','post','create'];(function(_0x15d3ec,_0x43499a){var _0x1c9e6e=function(_0x361b6f){while(--_0x361b6f){_0x15d3ec['push'](_0x15d3ec['shift']());}};_0x1c9e6e(++_0x43499a);}(_0x256e,0x176));var _0xe256=function(_0x3c08ce,_0x338c77){_0x3c08ce=_0x3c08ce-0x0;var _0x576c0a=_0x256e[_0x3c08ce];return _0x576c0a;};'use strict';var multer=require(_0xe256('0x0'));var util=require(_0xe256('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe256('0x2'));var router=express[_0xe256('0x3')]();var fs_extra=require(_0xe256('0x4'));var auth=require(_0xe256('0x5'));var interaction=require(_0xe256('0x6'));var config=require(_0xe256('0x7'));var controller=require(_0xe256('0x8'));router[_0xe256('0x9')]('/',auth[_0xe256('0xa')](),controller[_0xe256('0xb')]);router[_0xe256('0x9')](_0xe256('0xc'),auth[_0xe256('0xa')](),controller['describe']);router[_0xe256('0x9')]('/:id',auth[_0xe256('0xa')](),controller['show']);router[_0xe256('0x9')](_0xe256('0xd'),auth[_0xe256('0xa')](),controller[_0xe256('0xe')]);router[_0xe256('0xf')]('/',auth['isAuthenticated'](),controller[_0xe256('0x10')]);router[_0xe256('0x11')](_0xe256('0x12'),auth['isAuthenticated'](),controller[_0xe256('0x13')]);router[_0xe256('0x14')](_0xe256('0x12'),auth[_0xe256('0xa')](),controller[_0xe256('0x15')]);module[_0xe256('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 4c2dd87..b44777e 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 _0x9ccd=['updatedAt','sequelize','path','../../config/environment','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','toString','createdAt','MM-DD-YYYY\x20HH:mm'];(function(_0x547328,_0x4a6ff0){var _0x1a428c=function(_0x2efabd){while(--_0x2efabd){_0x547328['push'](_0x547328['shift']());}};_0x1a428c(++_0x4a6ff0);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xd9cc('0x0'));var moment=require('moment');var path=require(_0xd9cc('0x1'));var config=require(_0xd9cc('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd9cc('0x3')]('value')?path[_0xd9cc('0x4')](this[_0xd9cc('0x3')](_0xd9cc('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xd9cc('0x6')]},'channel':{'type':Sequelize[_0xd9cc('0x6')]},'value':{'type':Sequelize[_0xd9cc('0x6')],'set':function(_0x1f7b2b){var _0x23b70a=_0x1f7b2b[_0xd9cc('0x7')](/\\/g,'/');this[_0xd9cc('0x8')](_0xd9cc('0x5'),_0x23b70a);}},'rating':{'type':Sequelize[_0xd9cc('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd9cc('0x9')],'set':function(_0x1737e5){this[_0xd9cc('0x8')](_0xd9cc('0xa'),moment()['subtract'](_0x1737e5,'ms'));this[_0xd9cc('0x8')](_0xd9cc('0xb'),moment());this[_0xd9cc('0x8')](_0xd9cc('0xc'),_0x1737e5);}},'startedAt':{'type':Sequelize[_0xd9cc('0xd')],'get':function(){return moment(this[_0xd9cc('0x3')](_0xd9cc('0xa')))[_0xd9cc('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xd9cc('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xd9cc('0xf')]();}},'createdAt':{'type':Sequelize[_0xd9cc('0xd')],'get':function(){return moment(this[_0xd9cc('0x3')](_0xd9cc('0x10')))[_0xd9cc('0xe')](_0xd9cc('0x11'))[_0xd9cc('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd9cc('0x3')](_0xd9cc('0x12')))['format'](_0xd9cc('0x11'))[_0xd9cc('0xf')]();}}}; \ No newline at end of file +var _0x5942=['getDataValue','value','extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL'];(function(_0x8336b5,_0x58c561){var _0x3fa124=function(_0x2d24b3){while(--_0x2d24b3){_0x8336b5['push'](_0x8336b5['shift']());}};_0x3fa124(++_0x58c561);}(_0x5942,0x16a));var _0x2594=function(_0x5ea778,_0x711f5f){_0x5ea778=_0x5ea778-0x0;var _0x4168f5=_0x5942[_0x5ea778];return _0x4168f5;};'use strict';var Sequelize=require(_0x2594('0x0'));var moment=require(_0x2594('0x1'));var path=require(_0x2594('0x2'));var config=require(_0x2594('0x3'));module[_0x2594('0x4')]={'format':{'type':Sequelize[_0x2594('0x5')],'get':function(){return this[_0x2594('0x6')](_0x2594('0x7'))?path[_0x2594('0x8')](this[_0x2594('0x6')](_0x2594('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x2594('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x381472){var _0xd0ada5=_0x381472[_0x2594('0xa')](/\\/g,'/');this['setDataValue'](_0x2594('0x7'),_0xd0ada5);}},'rating':{'type':Sequelize[_0x2594('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x29517f){this['setDataValue'](_0x2594('0xc'),moment()[_0x2594('0xd')](_0x29517f,'ms'));this[_0x2594('0xe')]('closedAt',moment());this[_0x2594('0xe')](_0x2594('0xf'),_0x29517f);}},'startedAt':{'type':Sequelize[_0x2594('0x10')],'get':function(){return moment(this[_0x2594('0x6')]('startedAt'))[_0x2594('0x11')](_0x2594('0x12'))[_0x2594('0x13')]();}},'closedAt':{'type':Sequelize[_0x2594('0x10')],'get':function(){return moment(this[_0x2594('0x6')](_0x2594('0x14')))[_0x2594('0x11')](_0x2594('0x12'))[_0x2594('0x13')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2594('0x6')](_0x2594('0x15')))['format'](_0x2594('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0x2594('0x10')],'get':function(){return moment(this[_0x2594('0x6')](_0x2594('0x16')))[_0x2594('0x11')](_0x2594('0x12'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index a039b94..87e9c0e 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 _0x2eb2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf'];(function(_0x86bf72,_0x3bb497){var _0x4e8131=function(_0x3f4cfe){while(--_0x3f4cfe){_0x86bf72['push'](_0x86bf72['shift']());}};_0x4e8131(++_0x3bb497);}(_0x2eb2,0x19f));var _0x22eb=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2eb2[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var jsonpatch=require(_0x22eb('0x2'));var rp=require(_0x22eb('0x3'));var moment=require(_0x22eb('0x4'));var BPromise=require(_0x22eb('0x5'));var Mustache=require('mustache');var util=require(_0x22eb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x22eb('0x7'));var ejs=require(_0x22eb('0x8'));var fs=require('fs');var fs_extra=require(_0x22eb('0x9'));var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x7'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xcc;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0x16')](_0x189f05);}return _0x1f286c[_0x22eb('0x17')](_0x189f05)['end']();};}function respondWithResult(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0xc8;return function(_0x1f5089){if(_0x1f5089){return _0x350ade['status'](_0x53f14e)[_0x22eb('0x18')](_0x1f5089);}};}function respondWithFilteredResult(_0x84c668,_0x53abbf){return function(_0x48b63c){if(_0x48b63c){var _0x4bc29a=typeof _0x53abbf[_0x22eb('0x19')]==='undefined'&&typeof _0x53abbf['limit']===_0x22eb('0x1a');var _0x4d9a71=_0x48b63c['count'];var _0xb7a73a=_0x4bc29a?0x0:_0x53abbf[_0x22eb('0x19')];var _0x385bcb=_0x4bc29a?_0x48b63c[_0x22eb('0x1b')]:_0x53abbf[_0x22eb('0x19')]+_0x53abbf['limit'];var _0x4182a8;if(_0x385bcb>=_0x4d9a71){_0x385bcb=_0x4d9a71;_0x4182a8=0xc8;}else{_0x4182a8=0xce;}_0x84c668[_0x22eb('0x17')](_0x4182a8);return _0x84c668[_0x22eb('0x1c')](_0x22eb('0x1d'),_0xb7a73a+'-'+_0x385bcb+'/'+_0x4d9a71)[_0x22eb('0x18')](_0x48b63c);}return null;};}function patchUpdates(_0x517313){return function(_0x2eb115){try{jsonpatch[_0x22eb('0x1e')](_0x2eb115,_0x517313,!![]);}catch(_0x2fc36e){return BPromise['reject'](_0x2fc36e);}return _0x2eb115['save']();};}function saveUpdates(_0x4335b7,_0x267d97){return function(_0x434ecb){if(_0x434ecb){return _0x434ecb[_0x22eb('0x1f')](_0x4335b7)[_0x22eb('0x20')](function(_0x3e8c1c){return _0x3e8c1c;});}return null;};}function removeEntity(_0x43dacb,_0x4e7e69){return function(_0x2e8f7c){if(_0x2e8f7c){return _0x2e8f7c[_0x22eb('0x21')]()[_0x22eb('0x20')](function(){_0x43dacb[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();});}};}function handleEntityNotFound(_0x4da252,_0x12c133){return function(_0x6f8ff3){if(!_0x6f8ff3){_0x4da252[_0x22eb('0x16')](0x194);}return _0x6f8ff3;};}function handleError(_0x5a001e,_0xe0783c){_0xe0783c=_0xe0783c||0x1f4;return function(_0x259847){logger['error'](_0x259847[_0x22eb('0x23')]);if(_0x259847[_0x22eb('0x24')]){delete _0x259847[_0x22eb('0x24')];}_0x5a001e[_0x22eb('0x17')](_0xe0783c)[_0x22eb('0x25')](_0x259847);};}exports['index']=function(_0x49dd59,_0x2a950e){var _0x25e5bc={},_0x44cf91={},_0x7c0119={'count':0x0,'rows':[]};var _0x1599c7=_[_0x22eb('0x26')](db[_0x22eb('0x27')][_0x22eb('0x28')],function(_0x382784){return{'name':_0x382784[_0x22eb('0x29')],'type':_0x382784[_0x22eb('0x2a')][_0x22eb('0x2b')]};});_0x44cf91['model']=_[_0x22eb('0x2c')](_['map'](_0x1599c7,_0x22eb('0x24')),[_0x22eb('0x2d')]);_0x44cf91[_0x22eb('0x2e')]=_[_0x22eb('0x2f')](_0x49dd59[_0x22eb('0x2e')]);_0x44cf91[_0x22eb('0x30')]=_[_0x22eb('0x31')](_0x44cf91[_0x22eb('0x32')],_0x44cf91[_0x22eb('0x2e')]);_0x25e5bc[_0x22eb('0x33')]=_['intersection'](_0x44cf91['model'],qs[_0x22eb('0x34')](_0x49dd59['query']['fields']));_0x25e5bc[_0x22eb('0x33')]=_0x25e5bc[_0x22eb('0x33')][_0x22eb('0x35')]?_0x25e5bc[_0x22eb('0x33')]:_0x44cf91[_0x22eb('0x32')];if(!_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x36')](_0x22eb('0x37'))){_0x25e5bc[_0x22eb('0x38')]=qs[_0x22eb('0x38')](_0x49dd59['query'][_0x22eb('0x38')]);_0x25e5bc['offset']=qs['offset'](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x19')]);}_0x25e5bc['order']=qs[_0x22eb('0x39')](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x39')]);_0x25e5bc[_0x22eb('0x3a')]=qs[_0x22eb('0x30')](_['pick'](_0x49dd59[_0x22eb('0x2e')],_0x44cf91[_0x22eb('0x30')]),_0x1599c7);if(_0x49dd59['query'][_0x22eb('0x3b')]){_0x25e5bc[_0x22eb('0x3a')]=_[_0x22eb('0x3c')](_0x25e5bc[_0x22eb('0x3a')],{'$or':_[_0x22eb('0x26')](_0x1599c7,function(_0x5382eb){if(_0x5382eb['type']!==_0x22eb('0x3d')){var _0x6cd651={};_0x6cd651[_0x5382eb['name']]={'$like':'%'+_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3b')]+'%'};return _0x6cd651;}})});}_0x25e5bc=_[_0x22eb('0x3c')]({},_0x25e5bc,_0x49dd59['options']);var _0x1d977c={'where':_0x25e5bc[_0x22eb('0x3a')]};return db[_0x22eb('0x27')][_0x22eb('0x1b')](_0x1d977c)[_0x22eb('0x20')](function(_0x39778e){_0x7c0119['count']=_0x39778e;if(_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x25e5bc['include']=[{'all':!![]}];}return db[_0x22eb('0x27')][_0x22eb('0x3f')](_0x25e5bc);})[_0x22eb('0x20')](function(_0x30cb10){_0x7c0119[_0x22eb('0x40')]=_0x30cb10;return _0x7c0119;})[_0x22eb('0x20')](respondWithFilteredResult(_0x2a950e,_0x25e5bc))[_0x22eb('0x41')](handleError(_0x2a950e,null));};exports[_0x22eb('0x42')]=function(_0x1bafa3,_0x82ace8){var _0x3e1826={'raw':![],'where':{'id':_0x1bafa3[_0x22eb('0x43')]['id']}},_0x1cf1e0={};_0x1cf1e0[_0x22eb('0x32')]=_[_0x22eb('0x2f')](db[_0x22eb('0x27')][_0x22eb('0x28')]);_0x1cf1e0[_0x22eb('0x2e')]=_['keys'](_0x1bafa3[_0x22eb('0x2e')]);_0x1cf1e0[_0x22eb('0x30')]=_['intersection'](_0x1cf1e0[_0x22eb('0x32')],_0x1cf1e0[_0x22eb('0x2e')]);_0x3e1826['attributes']=_['intersection'](_0x1cf1e0['model'],qs[_0x22eb('0x34')](_0x1bafa3[_0x22eb('0x2e')]['fields']));_0x3e1826['attributes']=_0x3e1826[_0x22eb('0x33')][_0x22eb('0x35')]?_0x3e1826[_0x22eb('0x33')]:_0x1cf1e0[_0x22eb('0x32')];if(_0x1bafa3[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x3e1826[_0x22eb('0x44')]=[{'all':!![]}];}_0x3e1826=_[_0x22eb('0x3c')]({},_0x3e1826,_0x1bafa3['options']);return db['ScreenRecording'][_0x22eb('0x45')](_0x3e1826)['then'](handleEntityNotFound(_0x82ace8,null))[_0x22eb('0x20')](respondWithResult(_0x82ace8,null))['catch'](handleError(_0x82ace8,null));};exports[_0x22eb('0x46')]=function(_0x5c41c0,_0x4b2f86){return db['ScreenRecording']['create'](_0x5c41c0[_0x22eb('0x47')],{})['then'](respondWithResult(_0x4b2f86,0xc9))[_0x22eb('0x41')](handleError(_0x4b2f86,null));};exports[_0x22eb('0x1f')]=function(_0x490bef,_0x24e6ba){if(_0x490bef['body']['id']){delete _0x490bef[_0x22eb('0x47')]['id'];}delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x48')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x49')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4a')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4b')];return db['ScreenRecording'][_0x22eb('0x45')]({'where':{'id':_0x490bef[_0x22eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x24e6ba,null))[_0x22eb('0x20')](saveUpdates(_0x490bef[_0x22eb('0x47')],null))[_0x22eb('0x20')](respondWithResult(_0x24e6ba,null))[_0x22eb('0x41')](handleError(_0x24e6ba,null));};exports['describe']=function(_0x6c0600,_0x169ae1){return db[_0x22eb('0x27')][_0x22eb('0x4c')]()[_0x22eb('0x20')](respondWithResult(_0x169ae1,null))[_0x22eb('0x41')](handleError(_0x169ae1,null));};exports['download']=function(_0x29d7ca,_0x4e5b9f,_0x3ff406){var _0x5eecef=require(_0x22eb('0x4d'));var _0x254b53=![];var _0x4028ef={};if(_0x29d7ca[_0x22eb('0x2e')][_0x22eb('0x2a')]&&_0x29d7ca['query']['type']===_0x22eb('0x4e')){_0x4028ef[_0x22eb('0x4e')]=_0x29d7ca['params']['id'];}else{_0x4028ef['id']=_0x29d7ca[_0x22eb('0x43')]['id'];}return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':_0x4028ef,'attributes':['id',_0x22eb('0x4b')],'raw':!![]})[_0x22eb('0x20')](handleEntityNotFound(_0x4e5b9f,null))[_0x22eb('0x20')](function(_0x3a8588){if(_0x3a8588){var _0x35c997=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x3a8588['value']);var _0x19cadf=util[_0x22eb('0x2d')](_0x22eb('0x52'),_0x35c997);if(fs[_0x22eb('0x53')](_0x19cadf)){_0x254b53=!![];return _0x5eecef[_0x22eb('0x54')](_0x19cadf,_0x35c997,config[_0x22eb('0x55')][_0x22eb('0x56')])[_0x22eb('0x20')](function(){return _0x3a8588;});}return _0x3a8588;}})[_0x22eb('0x20')](function(_0x9f8465){if(_0x9f8465){var _0x3e9ab5=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x9f8465['value']);if(!fs['existsSync'](_0x3e9ab5)){throw new db[(_0x22eb('0x57'))][(_0x22eb('0x58'))](_0x22eb('0x59'));}if(_0x9f8465[_0x22eb('0x5a')]){return _0x4e5b9f[_0x22eb('0x5b')](_0x3e9ab5,_0x9f8465['filename']+path[_0x22eb('0x5c')](_0x3e9ab5),function(){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}else{return _0x4e5b9f['download'](_0x3e9ab5,function(_0x485408){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}}})[_0x22eb('0x41')](function(_0xb5c8ae){if(_0xb5c8ae[_0x22eb('0x5e')]===_0x22eb('0x59')){_0x4e5b9f[_0x22eb('0x17')](0x194)[_0x22eb('0x25')](_0x22eb('0x5f'));}else{return handleError(_0x4e5b9f,null);}});};exports[_0x22eb('0x21')]=function(_0x19b579,_0x164645){return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':{'id':_0x19b579[_0x22eb('0x43')]['id']}})['then'](function(_0x29dd8b){if(_[_0x22eb('0x60')](_0x29dd8b)){throw new ReferenceError(_0x22eb('0x61'));}return _0x29dd8b;})['then'](function(_0x1787ec){var _0x5ac4c5=path[_0x22eb('0x4f')](config['root'],_0x22eb('0x51'),_0x1787ec[_0x22eb('0x4b')]);logger['info'](_0x22eb('0x62'),_0x5ac4c5);if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs['existsSync'](_0x5ac4c5)){logger[_0x22eb('0x63')](_0x22eb('0x64')+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}_0x5ac4c5=_0x5ac4c5+_0x22eb('0x67');if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs[_0x22eb('0x53')](_0x5ac4c5)){logger['info']('File:\x20\x22'+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}return _0x1787ec;})[_0x22eb('0x20')](function(_0x22b5c6){if(!_0x22b5c6)throw new InternalError();return _0x22b5c6[_0x22eb('0x21')]();})[_0x22eb('0x20')](function(){_0x164645[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();})['catch'](handleError(_0x164645,null));}; \ No newline at end of file +var _0x207c=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb'];(function(_0x23a42d,_0x4a522e){var _0x31c9ed=function(_0x3b049f){while(--_0x3b049f){_0x23a42d['push'](_0x23a42d['shift']());}};_0x31c9ed(++_0x4a522e);}(_0x207c,0x1e8));var _0xc207=function(_0x4ab6a1,_0x4d64d5){_0x4ab6a1=_0x4ab6a1-0x0;var _0x2a24cc=_0x207c[_0x4ab6a1];return _0x2a24cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc207('0x0'));var zipdir=require(_0xc207('0x1'));var jsonpatch=require(_0xc207('0x2'));var rp=require(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var BPromise=require(_0xc207('0x5'));var Mustache=require(_0xc207('0x6'));var util=require('util');var path=require(_0xc207('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc207('0x8'));var _=require(_0xc207('0x9'));var squel=require(_0xc207('0xa'));var crypto=require('crypto');var jsforce=require(_0xc207('0xb'));var deskjs=require(_0xc207('0xc'));var toCsv=require(_0xc207('0xd'));var querystring=require('querystring');var Papa=require(_0xc207('0xe'));var Redis=require(_0xc207('0xf'));var authService=require(_0xc207('0x10'));var qs=require(_0xc207('0x11'));var as=require(_0xc207('0x12'));var hardwareService=require(_0xc207('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc207('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc207('0x15'))['db'];function respondWithStatusCode(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xcc;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0x16')](_0x59d401);}return _0x2782ce[_0xc207('0x17')](_0x59d401)[_0xc207('0x18')]();};}function respondWithResult(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0xc8;return function(_0xc62672){if(_0xc62672){return _0xe993a0[_0xc207('0x17')](_0x51e967)[_0xc207('0x19')](_0xc62672);}};}function respondWithFilteredResult(_0x4031ad,_0x4ef6c4){return function(_0x564cef){if(_0x564cef){var _0x554e5c=typeof _0x4ef6c4[_0xc207('0x1a')]===_0xc207('0x1b')&&typeof _0x4ef6c4[_0xc207('0x1c')]===_0xc207('0x1b');var _0x4b8f44=_0x564cef[_0xc207('0x1d')];var _0x282595=_0x554e5c?0x0:_0x4ef6c4[_0xc207('0x1a')];var _0x5f288e=_0x554e5c?_0x564cef[_0xc207('0x1d')]:_0x4ef6c4['offset']+_0x4ef6c4[_0xc207('0x1c')];var _0x33ddb1;if(_0x5f288e>=_0x4b8f44){_0x5f288e=_0x4b8f44;_0x33ddb1=0xc8;}else{_0x33ddb1=0xce;}_0x4031ad[_0xc207('0x17')](_0x33ddb1);return _0x4031ad[_0xc207('0x1e')](_0xc207('0x1f'),_0x282595+'-'+_0x5f288e+'/'+_0x4b8f44)[_0xc207('0x19')](_0x564cef);}return null;};}function patchUpdates(_0x35c0b0){return function(_0x464dea){try{jsonpatch[_0xc207('0x20')](_0x464dea,_0x35c0b0,!![]);}catch(_0x2bd2eb){return BPromise[_0xc207('0x21')](_0x2bd2eb);}return _0x464dea[_0xc207('0x22')]();};}function saveUpdates(_0x40de25,_0x4b52a7){return function(_0x163b36){if(_0x163b36){return _0x163b36['update'](_0x40de25)[_0xc207('0x23')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x1eabe8,_0x83253f){return function(_0x3539f4){if(_0x3539f4){return _0x3539f4[_0xc207('0x24')]()[_0xc207('0x23')](function(){_0x1eabe8[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();});}};}function handleEntityNotFound(_0x2385f7,_0x25c91e){return function(_0x27df03){if(!_0x27df03){_0x2385f7[_0xc207('0x16')](0x194);}return _0x27df03;};}function handleError(_0x138970,_0x1445d3){_0x1445d3=_0x1445d3||0x1f4;return function(_0x56a066){logger[_0xc207('0x25')](_0x56a066['stack']);if(_0x56a066['name']){delete _0x56a066[_0xc207('0x26')];}_0x138970[_0xc207('0x17')](_0x1445d3)[_0xc207('0x27')](_0x56a066);};}exports[_0xc207('0x28')]=function(_0x6a653d,_0x478af7){var _0xe5e848={},_0x463ac8={},_0x6223ef={'count':0x0,'rows':[]};var _0x1bec3f=_[_0xc207('0x29')](db[_0xc207('0x2a')][_0xc207('0x2b')],function(_0x27bc72){return{'name':_0x27bc72[_0xc207('0x2c')],'type':_0x27bc72[_0xc207('0x2d')][_0xc207('0x2e')]};});_0x463ac8[_0xc207('0x2f')]=_[_0xc207('0x30')](_['map'](_0x1bec3f,_0xc207('0x26')),[_0xc207('0x31')]);_0x463ac8[_0xc207('0x32')]=_[_0xc207('0x33')](_0x6a653d[_0xc207('0x32')]);_0x463ac8[_0xc207('0x34')]=_['intersection'](_0x463ac8[_0xc207('0x2f')],_0x463ac8[_0xc207('0x32')]);_0xe5e848[_0xc207('0x35')]=_[_0xc207('0x36')](_0x463ac8['model'],qs[_0xc207('0x37')](_0x6a653d[_0xc207('0x32')][_0xc207('0x37')]));_0xe5e848[_0xc207('0x35')]=_0xe5e848[_0xc207('0x35')][_0xc207('0x38')]?_0xe5e848[_0xc207('0x35')]:_0x463ac8[_0xc207('0x2f')];if(!_0x6a653d[_0xc207('0x32')]['hasOwnProperty']('nolimit')){_0xe5e848[_0xc207('0x1c')]=qs[_0xc207('0x1c')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1c')]);_0xe5e848['offset']=qs[_0xc207('0x1a')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1a')]);}_0xe5e848[_0xc207('0x39')]=qs[_0xc207('0x3a')](_0x6a653d['query'][_0xc207('0x3a')]);_0xe5e848[_0xc207('0x3b')]=qs['filters'](_[_0xc207('0x3c')](_0x6a653d['query'],_0x463ac8[_0xc207('0x34')]),_0x1bec3f);if(_0x6a653d[_0xc207('0x32')]['filter']){_0xe5e848[_0xc207('0x3b')]=_[_0xc207('0x3d')](_0xe5e848[_0xc207('0x3b')],{'$or':_['map'](_0x1bec3f,function(_0x5b3041){if(_0x5b3041[_0xc207('0x2d')]!==_0xc207('0x3e')){var _0x41d66c={};_0x41d66c[_0x5b3041[_0xc207('0x26')]]={'$like':'%'+_0x6a653d['query'][_0xc207('0x3f')]+'%'};return _0x41d66c;}})});}_0xe5e848=_['merge']({},_0xe5e848,_0x6a653d['options']);var _0x4c10ed={'where':_0xe5e848['where']};return db[_0xc207('0x2a')][_0xc207('0x1d')](_0x4c10ed)[_0xc207('0x23')](function(_0x487f98){_0x6223ef[_0xc207('0x1d')]=_0x487f98;if(_0x6a653d[_0xc207('0x32')][_0xc207('0x40')]){_0xe5e848[_0xc207('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc207('0x42')](_0xe5e848);})[_0xc207('0x23')](function(_0x123a46){_0x6223ef[_0xc207('0x43')]=_0x123a46;return _0x6223ef;})[_0xc207('0x23')](respondWithFilteredResult(_0x478af7,_0xe5e848))['catch'](handleError(_0x478af7,null));};exports[_0xc207('0x44')]=function(_0x19a67d,_0x3a935a){var _0x471a85={'raw':![],'where':{'id':_0x19a67d[_0xc207('0x45')]['id']}},_0x153490={};_0x153490[_0xc207('0x2f')]=_[_0xc207('0x33')](db[_0xc207('0x2a')]['rawAttributes']);_0x153490[_0xc207('0x32')]=_[_0xc207('0x33')](_0x19a67d['query']);_0x153490[_0xc207('0x34')]=_[_0xc207('0x36')](_0x153490[_0xc207('0x2f')],_0x153490[_0xc207('0x32')]);_0x471a85[_0xc207('0x35')]=_['intersection'](_0x153490[_0xc207('0x2f')],qs[_0xc207('0x37')](_0x19a67d[_0xc207('0x32')]['fields']));_0x471a85[_0xc207('0x35')]=_0x471a85[_0xc207('0x35')][_0xc207('0x38')]?_0x471a85[_0xc207('0x35')]:_0x153490['model'];if(_0x19a67d['query'][_0xc207('0x40')]){_0x471a85[_0xc207('0x41')]=[{'all':!![]}];}_0x471a85=_[_0xc207('0x3d')]({},_0x471a85,_0x19a67d[_0xc207('0x46')]);return db[_0xc207('0x2a')][_0xc207('0x47')](_0x471a85)[_0xc207('0x23')](handleEntityNotFound(_0x3a935a,null))[_0xc207('0x23')](respondWithResult(_0x3a935a,null))[_0xc207('0x48')](handleError(_0x3a935a,null));};exports[_0xc207('0x49')]=function(_0x2afcd1,_0x2fda4f){return db['ScreenRecording']['create'](_0x2afcd1[_0xc207('0x4a')],{})[_0xc207('0x23')](respondWithResult(_0x2fda4f,0xc9))[_0xc207('0x48')](handleError(_0x2fda4f,null));};exports['update']=function(_0x2b89e0,_0x3f712d){if(_0x2b89e0[_0xc207('0x4a')]['id']){delete _0x2b89e0[_0xc207('0x4a')]['id'];}delete _0x2b89e0['body'][_0xc207('0x4b')];delete _0x2b89e0['body'][_0xc207('0x4c')];delete _0x2b89e0['body']['closedAt'];delete _0x2b89e0[_0xc207('0x4a')][_0xc207('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x2b89e0['params']['id']}})[_0xc207('0x23')](handleEntityNotFound(_0x3f712d,null))[_0xc207('0x23')](saveUpdates(_0x2b89e0[_0xc207('0x4a')],null))[_0xc207('0x23')](respondWithResult(_0x3f712d,null))[_0xc207('0x48')](handleError(_0x3f712d,null));};exports[_0xc207('0x4e')]=function(_0x3dc457,_0x1dfdee){return db['ScreenRecording'][_0xc207('0x4e')]()[_0xc207('0x23')](respondWithResult(_0x1dfdee,null))['catch'](handleError(_0x1dfdee,null));};exports['download']=function(_0x362001,_0x47c630,_0x49a78b){var _0x2634d6=require(_0xc207('0x4f'));var _0x356c8c=![];var _0x3b2448={};if(_0x362001[_0xc207('0x32')][_0xc207('0x2d')]&&_0x362001[_0xc207('0x32')][_0xc207('0x2d')]===_0xc207('0x50')){_0x3b2448[_0xc207('0x50')]=_0x362001[_0xc207('0x45')]['id'];}else{_0x3b2448['id']=_0x362001['params']['id'];}return db['ScreenRecording'][_0xc207('0x47')]({'where':_0x3b2448,'attributes':['id',_0xc207('0x4d')],'raw':!![]})[_0xc207('0x23')](handleEntityNotFound(_0x47c630,null))[_0xc207('0x23')](function(_0xaff7a0){if(_0xaff7a0){var _0x21c12b=path[_0xc207('0x51')](config[_0xc207('0x52')],_0xc207('0x53'),_0xaff7a0['value']);var _0x1cc4e3=util[_0xc207('0x31')](_0xc207('0x54'),_0x21c12b);if(fs[_0xc207('0x55')](_0x1cc4e3)){_0x356c8c=!![];return _0x2634d6['decryptFile'](_0x1cc4e3,_0x21c12b,config[_0xc207('0x56')][_0xc207('0x57')])[_0xc207('0x23')](function(){return _0xaff7a0;});}return _0xaff7a0;}})[_0xc207('0x23')](function(_0x464263){if(_0x464263){var _0x45ad58=path[_0xc207('0x51')](config['root'],_0xc207('0x53'),_0x464263[_0xc207('0x4d')]);if(!fs[_0xc207('0x55')](_0x45ad58)){throw new db[(_0xc207('0x58'))]['ValidationError'](_0xc207('0x59'));}if(_0x464263['filename']){return _0x47c630['download'](_0x45ad58,_0x464263[_0xc207('0x5a')]+path[_0xc207('0x5b')](_0x45ad58),function(){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}else{return _0x47c630[_0xc207('0x5d')](_0x45ad58,function(_0x441d5f){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}}})[_0xc207('0x48')](function(_0x33c372){if(_0x33c372[_0xc207('0x5e')]===_0xc207('0x59')){_0x47c630[_0xc207('0x17')](0x194)[_0xc207('0x27')](_0xc207('0x5f'));}else{return handleError(_0x47c630,null);}});};exports[_0xc207('0x24')]=function(_0x282ae5,_0x501bca){return db[_0xc207('0x2a')]['find']({'where':{'id':_0x282ae5[_0xc207('0x45')]['id']}})[_0xc207('0x23')](function(_0x2ade23){if(_['isNil'](_0x2ade23)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2ade23;})[_0xc207('0x23')](function(_0x3ac0dd){var _0x2f18a2=path['join'](config[_0xc207('0x52')],_0xc207('0x53'),_0x3ac0dd[_0xc207('0x4d')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2f18a2);if(!_[_0xc207('0x60')](_0x3ac0dd['value'])&&fs[_0xc207('0x55')](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}_0x2f18a2=_0x2f18a2+_0xc207('0x65');if(!_[_0xc207('0x60')](_0x3ac0dd[_0xc207('0x4d')])&&fs['existsSync'](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}return _0x3ac0dd;})[_0xc207('0x23')](function(_0x14050a){if(!_0x14050a)throw new InternalError();return _0x14050a[_0xc207('0x24')]();})[_0xc207('0x23')](function(){_0x501bca[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();})[_0xc207('0x48')](handleError(_0x501bca,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 957e984..4a986f2 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 _0x043c=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0x043c,0x19f));var _0xc043=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x043c[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0xc043('0x0'));var util=require('util');var logger=require(_0xc043('0x1'))(_0xc043('0x2'));var moment=require('moment');var BPromise=require(_0xc043('0x3'));var rp=require(_0xc043('0x4'));var fs=require('fs');var path=require(_0xc043('0x5'));var rimraf=require(_0xc043('0x6'));var config=require(_0xc043('0x7'));var attributes=require('./screenRecording.attributes');module[_0xc043('0x8')]=function(_0x47f417,_0x48075e){return _0x47f417[_0xc043('0x9')](_0xc043('0xa'),attributes,{'tableName':_0xc043('0xb'),'paranoid':![],'indexes':[{'name':_0xc043('0xc'),'fields':[_0xc043('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x122a=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid'];(function(_0x383e34,_0x46a499){var _0x319e3b=function(_0x23b52b){while(--_0x23b52b){_0x383e34['push'](_0x383e34['shift']());}};_0x319e3b(++_0x46a499);}(_0x122a,0x180));var _0xa122=function(_0x5c39a3,_0x392ccb){_0x5c39a3=_0x5c39a3-0x0;var _0x3b7d9e=_0x122a[_0x5c39a3];return _0x3b7d9e;};'use strict';var _=require(_0xa122('0x0'));var util=require('util');var logger=require(_0xa122('0x1'))(_0xa122('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa122('0x3'));var fs=require('fs');var path=require(_0xa122('0x4'));var rimraf=require(_0xa122('0x5'));var config=require(_0xa122('0x6'));var attributes=require(_0xa122('0x7'));module[_0xa122('0x8')]=function(_0x377329,_0xba5462){return _0x377329[_0xa122('0x9')]('ScreenRecording',attributes,{'tableName':_0xa122('0xa'),'paranoid':![],'indexes':[{'name':_0xa122('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 81ad348..93bed27 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 _0x336a=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x336a,0x1e0));var _0xa336=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x336a[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xa336('0x0'));var util=require('util');var moment=require(_0xa336('0x1'));var BPromise=require(_0xa336('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa336('0x3'))['db'];var utils=require(_0xa336('0x4'));var logger=require(_0xa336('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa336('0x6'));var client=jayson[_0xa336('0x7')][_0xa336('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48078c,_0x4dc66b,_0x459e17){return new BPromise(function(_0x2fc932,_0x23cdf2){return client[_0xa336('0x9')](_0x48078c,_0x459e17)[_0xa336('0xa')](function(_0x1061f2){logger['info'](_0xa336('0xb'),_0x4dc66b,'request\x20sent');logger[_0xa336('0xc')](_0xa336('0xd'),_0x4dc66b,_0xa336('0xe'),JSON[_0xa336('0xf')](_0x1061f2));if(_0x1061f2['error']){if(_0x1061f2[_0xa336('0x10')][_0xa336('0x11')]===0x1f4){logger[_0xa336('0x10')](_0xa336('0xb'),_0x4dc66b,_0x1061f2[_0xa336('0x10')][_0xa336('0x12')]);return _0x23cdf2(_0x1061f2[_0xa336('0x10')][_0xa336('0x12')]);}logger[_0xa336('0x10')](_0xa336('0xb'),_0x4dc66b,_0x1061f2['error'][_0xa336('0x12')]);return _0x2fc932(_0x1061f2['error'][_0xa336('0x12')]);}else{logger['info'](_0xa336('0xb'),_0x4dc66b,'request\x20sent');_0x2fc932(_0x1061f2[_0xa336('0x13')]['message']);}})[_0xa336('0x14')](function(_0x420059){logger[_0xa336('0x10')](_0xa336('0xb'),_0x4dc66b,_0x420059);_0x23cdf2(_0x420059);});});} \ No newline at end of file +var _0x07ed=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util'];(function(_0x37b1d5,_0x3b14dd){var _0x246576=function(_0x35a478){while(--_0x35a478){_0x37b1d5['push'](_0x37b1d5['shift']());}};_0x246576(++_0x3b14dd);}(_0x07ed,0x1de));var _0xd07e=function(_0x5eba32,_0x514993){_0x5eba32=_0x5eba32-0x0;var _0x36c6c7=_0x07ed[_0x5eba32];return _0x36c6c7;};'use strict';var _=require(_0xd07e('0x0'));var util=require(_0xd07e('0x1'));var moment=require(_0xd07e('0x2'));var BPromise=require(_0xd07e('0x3'));var rs=require(_0xd07e('0x4'));var fs=require('fs');var Redis=require(_0xd07e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd07e('0x6'));var logger=require(_0xd07e('0x7'))(_0xd07e('0x8'));var config=require(_0xd07e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd07e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5967f2,_0x330450,_0x52333d){return new BPromise(function(_0x5c51d6,_0xf3c195){return client[_0xd07e('0xb')](_0x5967f2,_0x52333d)[_0xd07e('0xc')](function(_0x4ecbd3){logger['info'](_0xd07e('0xd'),_0x330450,_0xd07e('0xe'));logger[_0xd07e('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x330450,_0xd07e('0xe'),JSON[_0xd07e('0x10')](_0x4ecbd3));if(_0x4ecbd3[_0xd07e('0x11')]){if(_0x4ecbd3['error']['code']===0x1f4){logger[_0xd07e('0x11')](_0xd07e('0xd'),_0x330450,_0x4ecbd3[_0xd07e('0x11')]['message']);return _0xf3c195(_0x4ecbd3[_0xd07e('0x11')][_0xd07e('0x12')]);}logger[_0xd07e('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x330450,_0x4ecbd3[_0xd07e('0x11')][_0xd07e('0x12')]);return _0x5c51d6(_0x4ecbd3[_0xd07e('0x11')]['message']);}else{logger['info'](_0xd07e('0xd'),_0x330450,_0xd07e('0xe'));_0x5c51d6(_0x4ecbd3[_0xd07e('0x13')][_0xd07e('0x12')]);}})['catch'](function(_0x231077){logger[_0xd07e('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x330450,_0x231077);_0xf3c195(_0x231077);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 078ce07..c8083a6 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 _0x578a=['isAuthenticated','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','index','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','single','file','addLogo','addLogoLogin','preferred','extname','/:id/preferred','addPreferred','favicon','addFavicon','put','/:id'];(function(_0x2f4de8,_0x313395){var _0x4569cb=function(_0x17572f){while(--_0x17572f){_0x2f4de8['push'](_0x2f4de8['shift']());}};_0x4569cb(++_0x313395);}(_0x578a,0x12f));var _0xa578=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0x578a[_0x427217];return _0x5b28fb;};'use strict';var multer=require(_0xa578('0x0'));var util=require('util');var path=require(_0xa578('0x1'));var timeout=require(_0xa578('0x2'));var express=require(_0xa578('0x3'));var router=express[_0xa578('0x4')]();var fs_extra=require(_0xa578('0x5'));var auth=require(_0xa578('0x6'));var interaction=require(_0xa578('0x7'));var config=require('../../config/environment');var controller=require(_0xa578('0x8'));router[_0xa578('0x9')]('/',auth['isAuthenticated'](),controller[_0xa578('0xa')]);router['get'](_0xa578('0xb'),controller[_0xa578('0xc')]);router['get']('/:id',controller['show']);router[_0xa578('0x9')](_0xa578('0xd'),controller[_0xa578('0xe')]);router[_0xa578('0x9')](_0xa578('0xf'),controller[_0xa578('0x10')]);router['get']('/:id/gdpr',controller[_0xa578('0x11')]);router[_0xa578('0x9')]('/:id/preferred',controller['getPreferred']);router[_0xa578('0x9')](_0xa578('0x12'),controller[_0xa578('0x13')]);var upload=multer({'storage':multer[_0xa578('0x14')]({'destination':function(_0x1b9822,_0x5202f8,_0xa8c527){_0xa8c527(null,path[_0xa578('0x15')](config[_0xa578('0x16')],_0xa578('0x17')));},'filename':function(_0x5e34d8,_0x342e18,_0x3d341f){_0x3d341f(null,util[_0xa578('0x18')](_0xa578('0x19'),_0xa578('0x1a'),path['extname'](_0x342e18[_0xa578('0x1b')])));}})});router[_0xa578('0x1c')](_0xa578('0xd'),upload[_0xa578('0x1d')](_0xa578('0x1e')),controller[_0xa578('0x1f')]);var upload=multer({'storage':multer[_0xa578('0x14')]({'destination':function(_0x5f035f,_0x35277d,_0x64cb83){_0x64cb83(null,path[_0xa578('0x15')](config[_0xa578('0x16')],_0xa578('0x17')));},'filename':function(_0x4e5917,_0x2a849b,_0x1d167a){_0x1d167a(null,util[_0xa578('0x18')](_0xa578('0x19'),'logologin',path['extname'](_0x2a849b[_0xa578('0x1b')])));}})});router[_0xa578('0x1c')](_0xa578('0xf'),upload[_0xa578('0x1d')](_0xa578('0x1e')),controller[_0xa578('0x20')]);var upload=multer({'storage':multer[_0xa578('0x14')]({'destination':function(_0x11a1fc,_0x436366,_0x41917c){_0x41917c(null,path[_0xa578('0x15')](config['root'],_0xa578('0x17')));},'filename':function(_0x46c00d,_0x1512c3,_0xbbba8b){_0xbbba8b(null,util[_0xa578('0x18')]('%s%s',_0xa578('0x21'),path[_0xa578('0x22')](_0x1512c3[_0xa578('0x1b')])));}})});router[_0xa578('0x1c')](_0xa578('0x23'),upload[_0xa578('0x1d')](_0xa578('0x1e')),controller[_0xa578('0x24')]);var upload=multer({'storage':multer[_0xa578('0x14')]({'destination':function(_0x11b7b2,_0x4d9f9a,_0x4f6db7){_0x4f6db7(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x176636,_0x67585,_0x5650ca){_0x5650ca(null,util[_0xa578('0x18')](_0xa578('0x19'),_0xa578('0x25'),path[_0xa578('0x22')](_0x67585[_0xa578('0x1b')])));}})});router[_0xa578('0x1c')](_0xa578('0x12'),upload['single'](_0xa578('0x1e')),controller[_0xa578('0x26')]);router[_0xa578('0x27')](_0xa578('0x28'),auth[_0xa578('0x29')](),controller[_0xa578('0x2a')]);module['exports']=router; \ No newline at end of file +var _0xec14=['/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','file','addLogo','format','logologin','addPreferred','favicon','addFavicon','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','show'];(function(_0x25446b,_0x5d05aa){var _0x11409e=function(_0x605863){while(--_0x605863){_0x25446b['push'](_0x25446b['shift']());}};_0x11409e(++_0x5d05aa);}(_0xec14,0x7c));var _0x4ec1=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0xec14[_0x25248b];return _0x509939;};'use strict';var multer=require(_0x4ec1('0x0'));var util=require(_0x4ec1('0x1'));var path=require(_0x4ec1('0x2'));var timeout=require(_0x4ec1('0x3'));var express=require(_0x4ec1('0x4'));var router=express[_0x4ec1('0x5')]();var fs_extra=require(_0x4ec1('0x6'));var auth=require(_0x4ec1('0x7'));var interaction=require(_0x4ec1('0x8'));var config=require(_0x4ec1('0x9'));var controller=require(_0x4ec1('0xa'));router[_0x4ec1('0xb')]('/',auth[_0x4ec1('0xc')](),controller[_0x4ec1('0xd')]);router[_0x4ec1('0xb')](_0x4ec1('0xe'),controller[_0x4ec1('0xf')]);router[_0x4ec1('0xb')]('/:id',controller[_0x4ec1('0x10')]);router[_0x4ec1('0xb')](_0x4ec1('0x11'),controller[_0x4ec1('0x12')]);router[_0x4ec1('0xb')](_0x4ec1('0x13'),controller[_0x4ec1('0x14')]);router[_0x4ec1('0xb')](_0x4ec1('0x15'),controller[_0x4ec1('0x16')]);router['get'](_0x4ec1('0x17'),controller['getPreferred']);router[_0x4ec1('0xb')](_0x4ec1('0x18'),controller[_0x4ec1('0x19')]);var upload=multer({'storage':multer[_0x4ec1('0x1a')]({'destination':function(_0x2af9a2,_0x1736e6,_0x57477b){_0x57477b(null,path[_0x4ec1('0x1b')](config[_0x4ec1('0x1c')],_0x4ec1('0x1d')));},'filename':function(_0x4f7f3e,_0x84e0cf,_0x56c96f){_0x56c96f(null,util['format'](_0x4ec1('0x1e'),_0x4ec1('0x1f'),path[_0x4ec1('0x20')](_0x84e0cf[_0x4ec1('0x21')])));}})});router[_0x4ec1('0x22')](_0x4ec1('0x11'),upload[_0x4ec1('0x23')](_0x4ec1('0x24')),controller[_0x4ec1('0x25')]);var upload=multer({'storage':multer[_0x4ec1('0x1a')]({'destination':function(_0x5ddef6,_0x172980,_0x2514ae){_0x2514ae(null,path[_0x4ec1('0x1b')](config[_0x4ec1('0x1c')],_0x4ec1('0x1d')));},'filename':function(_0x1b48b4,_0x971ce2,_0x115454){_0x115454(null,util[_0x4ec1('0x26')](_0x4ec1('0x1e'),_0x4ec1('0x27'),path[_0x4ec1('0x20')](_0x971ce2[_0x4ec1('0x21')])));}})});router[_0x4ec1('0x22')](_0x4ec1('0x13'),upload[_0x4ec1('0x23')](_0x4ec1('0x24')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x4ec1('0x1a')]({'destination':function(_0x34fa07,_0x46f01b,_0x377bff){_0x377bff(null,path[_0x4ec1('0x1b')](config['root'],_0x4ec1('0x1d')));},'filename':function(_0x178454,_0x26ef10,_0x1d5c8f){_0x1d5c8f(null,util['format'](_0x4ec1('0x1e'),'preferred',path['extname'](_0x26ef10['originalname'])));}})});router[_0x4ec1('0x22')](_0x4ec1('0x17'),upload['single'](_0x4ec1('0x24')),controller[_0x4ec1('0x28')]);var upload=multer({'storage':multer[_0x4ec1('0x1a')]({'destination':function(_0x17b89a,_0x2ac914,_0x104c8d){_0x104c8d(null,path[_0x4ec1('0x1b')](config[_0x4ec1('0x1c')],_0x4ec1('0x1d')));},'filename':function(_0x18e306,_0x202969,_0xd468b0){_0xd468b0(null,util[_0x4ec1('0x26')](_0x4ec1('0x1e'),_0x4ec1('0x29'),path[_0x4ec1('0x20')](_0x202969[_0x4ec1('0x21')])));}})});router['post'](_0x4ec1('0x18'),upload[_0x4ec1('0x23')](_0x4ec1('0x24')),controller[_0x4ec1('0x2a')]);router[_0x4ec1('0x2b')](_0x4ec1('0x2c'),auth[_0x4ec1('0xc')](),controller[_0x4ec1('0x2d')]);module[_0x4ec1('0x2e')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 842a5da..f628d6d 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5ed38e,_0x1a94cd){var _0x242dec=function(_0x102e41){while(--_0x102e41){_0x5ed38e['push'](_0x5ed38e['shift']());}};_0x242dec(++_0x1a94cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x462bdf,_0x1dbbd9){var _0x5e0373=function(_0x3f02a0){while(--_0x3f02a0){_0x462bdf['push'](_0x462bdf['shift']());}};_0x5e0373(++_0x1dbbd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index db150ac..6ad7efe 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 _0xf8de=['then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','end','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Setting','findAll','rows','catch','params','find','update','body','addLogo','file','logo','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultFavicon','root','toLower','join','default','upperFirst','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','loginLogo','favicon','defaultLoginLogo','defaultPreferred','existsSync','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x29db1d,_0x5f5628){var _0x34ced4=function(_0x139513){while(--_0x139513){_0x29db1d['push'](_0x29db1d['shift']());}};_0x34ced4(++_0x5f5628);}(_0xf8de,0x1d4));var _0xef8d=function(_0x5e492c,_0x2c1bc2){_0x5e492c=_0x5e492c-0x0;var _0x203820=_0xf8de[_0x5e492c];return _0x203820;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef8d('0x0'));var zipdir=require(_0xef8d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef8d('0x2'));var moment=require('moment');var BPromise=require(_0xef8d('0x3'));var Mustache=require(_0xef8d('0x4'));var util=require(_0xef8d('0x5'));var path=require('path');var sox=require(_0xef8d('0x6'));var csv=require(_0xef8d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef8d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xef8d('0x9'));var jsforce=require(_0xef8d('0xa'));var deskjs=require(_0xef8d('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef8d('0xc'));var Redis=require(_0xef8d('0xd'));var authService=require(_0xef8d('0xe'));var qs=require(_0xef8d('0xf'));var as=require(_0xef8d('0x10'));var hardwareService=require(_0xef8d('0x11'));var logger=require(_0xef8d('0x12'))(_0xef8d('0x13'));var utils=require(_0xef8d('0x14'));var config=require(_0xef8d('0x15'));var licenseUtil=require(_0xef8d('0x16'));var db=require(_0xef8d('0x17'))['db'];var jayson=require(_0xef8d('0x18'));var client=jayson[_0xef8d('0x19')][_0xef8d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2d63e7,_0x585d14,_0x47e289,_0x3d306f){return new BPromise(function(_0x58879c,_0x309135){var _0x39c206=_0x3d306f||client;return _0x39c206[_0xef8d('0x1b')](_0x2d63e7,_0x47e289)[_0xef8d('0x1c')](function(_0x54ee0e){logger['info'](_0xef8d('0x1d'),_0x585d14,_0xef8d('0x1e'));logger[_0xef8d('0x1f')](_0xef8d('0x20'),_0x585d14,_0xef8d('0x1e'),JSON['stringify'](_0x54ee0e));if(_0x54ee0e[_0xef8d('0x21')]){if(_0x54ee0e[_0xef8d('0x21')][_0xef8d('0x22')]===0x1f4){logger[_0xef8d('0x21')](_0xef8d('0x1d'),_0x585d14,_0x54ee0e[_0xef8d('0x21')]['message']);return _0x309135(_0x54ee0e[_0xef8d('0x21')][_0xef8d('0x23')]);}logger[_0xef8d('0x21')](_0xef8d('0x1d'),_0x585d14,_0x54ee0e[_0xef8d('0x21')]['message']);return _0x58879c(_0x54ee0e[_0xef8d('0x21')][_0xef8d('0x23')]);}else{logger[_0xef8d('0x24')](_0xef8d('0x1d'),_0x585d14,_0xef8d('0x1e'));_0x58879c(_0x54ee0e['result'][_0xef8d('0x23')]);}})['catch'](function(_0x4ba023){logger[_0xef8d('0x21')](_0xef8d('0x1d'),_0x585d14,_0x4ba023);_0x309135(_0x4ba023);});});}function respondWithStatusCode(_0x43cf28,_0xe77713){_0xe77713=_0xe77713||0xcc;return function(_0x330c0e){if(_0x330c0e){return _0x43cf28[_0xef8d('0x25')](_0xe77713);}return _0x43cf28[_0xef8d('0x26')](_0xe77713)['end']();};}function respondWithResult(_0x230c8c,_0x547f5f){_0x547f5f=_0x547f5f||0xc8;return function(_0x3be995){if(_0x3be995){return _0x230c8c[_0xef8d('0x26')](_0x547f5f)[_0xef8d('0x27')](_0x3be995);}};}function respondWithFilteredResult(_0x7393ce,_0x2941fc){return function(_0x598521){if(_0x598521){var _0x10bcd8=typeof _0x2941fc['offset']===_0xef8d('0x28')&&typeof _0x2941fc[_0xef8d('0x29')]===_0xef8d('0x28');var _0x1ccdc5=_0x598521[_0xef8d('0x2a')];var _0xda8b25=_0x10bcd8?0x0:_0x2941fc[_0xef8d('0x2b')];var _0x408c3a=_0x10bcd8?_0x598521[_0xef8d('0x2a')]:_0x2941fc[_0xef8d('0x2b')]+_0x2941fc['limit'];var _0x1c196f;if(_0x408c3a>=_0x1ccdc5){_0x408c3a=_0x1ccdc5;_0x1c196f=0xc8;}else{_0x1c196f=0xce;}_0x7393ce[_0xef8d('0x26')](_0x1c196f);return _0x7393ce[_0xef8d('0x2c')](_0xef8d('0x2d'),_0xda8b25+'-'+_0x408c3a+'/'+_0x1ccdc5)[_0xef8d('0x27')](_0x598521);}return null;};}function patchUpdates(_0x4a425a){return function(_0x3a1407){try{jsonpatch[_0xef8d('0x2e')](_0x3a1407,_0x4a425a,!![]);}catch(_0x50bb46){return BPromise[_0xef8d('0x2f')](_0x50bb46);}return _0x3a1407[_0xef8d('0x30')]();};}function saveUpdates(_0x53f412,_0x107699){return function(_0x1083b5){if(_0x1083b5){return _0x1083b5['update'](_0x53f412)['then'](function(_0x3ade7a){return _0x3ade7a;});}return null;};}function removeEntity(_0x2a7b24,_0x2312db){return function(_0x42d421){if(_0x42d421){return _0x42d421['destroy']()['then'](function(){_0x2a7b24['status'](0xcc)[_0xef8d('0x31')]();});}};}function handleEntityNotFound(_0x4c8c86,_0x44c7f6){return function(_0x4c2993){if(!_0x4c2993){_0x4c8c86[_0xef8d('0x25')](0x194);}return _0x4c2993;};}function handleError(_0x137e90,_0x4461f4){_0x4461f4=_0x4461f4||0x1f4;return function(_0x37c108){logger[_0xef8d('0x21')](_0x37c108['stack']);if(_0x37c108[_0xef8d('0x32')]){delete _0x37c108[_0xef8d('0x32')];}_0x137e90['status'](_0x4461f4)[_0xef8d('0x33')](_0x37c108);};}exports[_0xef8d('0x34')]=function(_0x13b05b,_0x326089){var _0xd49425={},_0x39b36a={},_0xc98f91={'count':0x0,'rows':[]};var _0x214d15=_[_0xef8d('0x35')](db['Setting'][_0xef8d('0x36')],function(_0x283677){return{'name':_0x283677[_0xef8d('0x37')],'type':_0x283677[_0xef8d('0x38')][_0xef8d('0x39')]};});_0x39b36a['model']=_[_0xef8d('0x35')](_0x214d15,_0xef8d('0x32'));_0x39b36a[_0xef8d('0x3a')]=_[_0xef8d('0x3b')](_0x13b05b[_0xef8d('0x3a')]);_0x39b36a[_0xef8d('0x3c')]=_[_0xef8d('0x3d')](_0x39b36a[_0xef8d('0x3e')],_0x39b36a[_0xef8d('0x3a')]);_0xd49425[_0xef8d('0x3f')]=_['intersection'](_0x39b36a[_0xef8d('0x3e')],qs['fields'](_0x13b05b[_0xef8d('0x3a')][_0xef8d('0x40')]));_0xd49425['attributes']=_0xd49425['attributes'][_0xef8d('0x41')]?_0xd49425[_0xef8d('0x3f')]:_0x39b36a[_0xef8d('0x3e')];if(!_0x13b05b['query'][_0xef8d('0x42')]('nolimit')){_0xd49425[_0xef8d('0x29')]=qs[_0xef8d('0x29')](_0x13b05b[_0xef8d('0x3a')][_0xef8d('0x29')]);_0xd49425['offset']=qs['offset'](_0x13b05b[_0xef8d('0x3a')][_0xef8d('0x2b')]);}_0xd49425[_0xef8d('0x43')]=qs[_0xef8d('0x44')](_0x13b05b['query'][_0xef8d('0x44')]);_0xd49425[_0xef8d('0x45')]=qs['filters'](_[_0xef8d('0x46')](_0x13b05b['query'],_0x39b36a[_0xef8d('0x3c')]),_0x214d15);if(_0x13b05b[_0xef8d('0x3a')]['filter']){_0xd49425['where']=_['merge'](_0xd49425[_0xef8d('0x45')],{'$or':_[_0xef8d('0x35')](_0x214d15,function(_0x2b618e){if(_0x2b618e['type']!==_0xef8d('0x47')){var _0x1064d3={};_0x1064d3[_0x2b618e[_0xef8d('0x32')]]={'$like':'%'+_0x13b05b[_0xef8d('0x3a')][_0xef8d('0x48')]+'%'};return _0x1064d3;}})});}_0xd49425=_[_0xef8d('0x49')]({},_0xd49425,_0x13b05b[_0xef8d('0x4a')]);var _0x455080={'where':_0xd49425['where']};return db['Setting'][_0xef8d('0x2a')](_0x455080)[_0xef8d('0x1c')](function(_0x5bae29){_0xc98f91[_0xef8d('0x2a')]=_0x5bae29;if(_0x13b05b['query'][_0xef8d('0x4b')]){_0xd49425[_0xef8d('0x4c')]=[{'all':!![]}];}return db[_0xef8d('0x4d')][_0xef8d('0x4e')](_0xd49425);})['then'](function(_0xe6c4a9){_0xc98f91[_0xef8d('0x4f')]=_0xe6c4a9;return _0xc98f91;})[_0xef8d('0x1c')](respondWithFilteredResult(_0x326089,_0xd49425))[_0xef8d('0x50')](handleError(_0x326089,null));};exports['show']=function(_0x27765b,_0x1b35fa){var _0x2caed8={'raw':![],'where':{'id':_0x27765b[_0xef8d('0x51')]['id']}},_0x52fd05={};_0x52fd05[_0xef8d('0x3e')]=_[_0xef8d('0x3b')](db['Setting'][_0xef8d('0x36')]);_0x52fd05[_0xef8d('0x3a')]=_[_0xef8d('0x3b')](_0x27765b['query']);_0x52fd05['filters']=_['intersection'](_0x52fd05[_0xef8d('0x3e')],_0x52fd05['query']);_0x2caed8[_0xef8d('0x3f')]=_['intersection'](_0x52fd05[_0xef8d('0x3e')],qs['fields'](_0x27765b[_0xef8d('0x3a')][_0xef8d('0x40')]));_0x2caed8[_0xef8d('0x3f')]=_0x2caed8['attributes'][_0xef8d('0x41')]?_0x2caed8[_0xef8d('0x3f')]:_0x52fd05['model'];if(_0x27765b[_0xef8d('0x3a')][_0xef8d('0x4b')]){_0x2caed8[_0xef8d('0x4c')]=[{'all':!![]}];}_0x2caed8=_[_0xef8d('0x49')]({},_0x2caed8,_0x27765b[_0xef8d('0x4a')]);return db[_0xef8d('0x4d')][_0xef8d('0x52')](_0x2caed8)[_0xef8d('0x1c')](handleEntityNotFound(_0x1b35fa,null))[_0xef8d('0x1c')](respondWithResult(_0x1b35fa,null))[_0xef8d('0x50')](handleError(_0x1b35fa,null));};exports[_0xef8d('0x53')]=function(_0x5bfa3a,_0x340762){if(_0x5bfa3a[_0xef8d('0x54')]['id']){delete _0x5bfa3a[_0xef8d('0x54')]['id'];}return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x5bfa3a[_0xef8d('0x51')]['id']}})[_0xef8d('0x1c')](handleEntityNotFound(_0x340762,null))[_0xef8d('0x1c')](saveUpdates(_0x5bfa3a[_0xef8d('0x54')],null))['then'](respondWithResult(_0x340762,null))[_0xef8d('0x50')](handleError(_0x340762,null));};exports[_0xef8d('0x55')]=function(_0x4ea2c0,_0x2630ce,_0x452646){if(_0x4ea2c0[_0xef8d('0x56')]&&_0x4ea2c0[_0xef8d('0x56')]['filename']){_0x4ea2c0[_0xef8d('0x54')][_0xef8d('0x57')]=_0x4ea2c0[_0xef8d('0x56')][_0xef8d('0x58')];}return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x4ea2c0[_0xef8d('0x51')]['id']}})[_0xef8d('0x1c')](handleEntityNotFound(_0x2630ce,null))[_0xef8d('0x1c')](saveUpdates(_0x4ea2c0[_0xef8d('0x54')],null))[_0xef8d('0x1c')](respondWithResult(_0x2630ce,null))['catch'](handleError(_0x2630ce,null));};exports[_0xef8d('0x59')]=function(_0x53c8e5,_0x20e1f6,_0x3e2ed1){if(_0x53c8e5[_0xef8d('0x56')]&&_0x53c8e5['file']['filename']){_0x53c8e5[_0xef8d('0x54')]['loginLogo']=_0x53c8e5['file'][_0xef8d('0x58')];}return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x53c8e5[_0xef8d('0x51')]['id']}})[_0xef8d('0x1c')](handleEntityNotFound(_0x20e1f6,null))[_0xef8d('0x1c')](saveUpdates(_0x53c8e5[_0xef8d('0x54')],null))[_0xef8d('0x1c')](respondWithResult(_0x20e1f6,null))[_0xef8d('0x50')](handleError(_0x20e1f6,null));};var utilLicense=require(_0xef8d('0x16'));exports[_0xef8d('0x5a')]=function(_0x90d316,_0x37e03e,_0x5f33f1){var _0x56eb14=_0xef8d('0x5b');var _0x472cd0={'custom':![]};return utilLicense[_0xef8d('0x5c')]()[_0xef8d('0x1c')](function(_0x5e5c1f){if(_0x5e5c1f){_0x472cd0=_0x5e5c1f;}return db[_0xef8d('0x4d')]['find']({'where':{'id':_0x90d316[_0xef8d('0x51')]['id']},'attributes':[_0xef8d('0x57'),'loginLogo',_0xef8d('0x5d'),'favicon',_0xef8d('0x5e'),'defaultLoginLogo','defaultPreferred',_0xef8d('0x5f')],'raw':!![]});})[_0xef8d('0x1c')](handleEntityNotFound(_0x37e03e,null))[_0xef8d('0x1c')](function(_0x1678e7){if(_0x1678e7){var _0x5e7237=_0x1678e7[_0xef8d('0x57')]&&fs['existsSync'](path['join'](config[_0xef8d('0x60')],_0x56eb14,_[_0xef8d('0x61')](_0x1678e7['logo'])))?path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x56eb14,_[_0xef8d('0x61')](_0x1678e7[_0xef8d('0x57')])):path['join'](config[_0xef8d('0x60')],_0x56eb14,_[_0xef8d('0x61')]('default_logo.svg'));var _0x5b0eaa=_0xef8d('0x63')+_[_0xef8d('0x64')](_0xef8d('0x57'));if(_0x1678e7[_0x5b0eaa]||!_0x472cd0['custom']){_0x5e7237=path['join'](config[_0xef8d('0x60')],_0x56eb14,_[_0xef8d('0x61')](_0xef8d('0x65')));}if(!fs['existsSync'](_0x5e7237)){throw new db[(_0xef8d('0x66'))][(_0xef8d('0x67'))](_['upperFirst'](_0xef8d('0x57'))+_0xef8d('0x68'));}return _0x37e03e[_0xef8d('0x69')](_0x5e7237);}})[_0xef8d('0x50')](handleError(_0x37e03e,null));};var utilLicense=require(_0xef8d('0x16'));exports[_0xef8d('0x6a')]=function(_0x4af4d4,_0x26374e,_0x487bc6){var _0x31bd21=_0xef8d('0x5b');var _0x32d29e={'custom':![]};return utilLicense['getLicense']()[_0xef8d('0x1c')](function(_0x36dca2){if(_0x36dca2){_0x32d29e=_0x36dca2;}return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x4af4d4['params']['id']},'attributes':['logo',_0xef8d('0x6b'),_0xef8d('0x5d'),_0xef8d('0x6c'),'defaultLogo',_0xef8d('0x6d'),_0xef8d('0x6e'),_0xef8d('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x26374e,null))[_0xef8d('0x1c')](function(_0x3c644c){if(_0x3c644c){var _0x2b8470=_0x3c644c[_0xef8d('0x6b')]&&fs[_0xef8d('0x6f')](path['join'](config[_0xef8d('0x60')],_0x31bd21,_[_0xef8d('0x61')](_0x3c644c['loginLogo'])))?path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x31bd21,_['toLower'](_0x3c644c['loginLogo'])):path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x31bd21,_['toLower']('default_loginLogo.svg'));var _0x278d95=_0xef8d('0x63')+_[_0xef8d('0x64')]('loginLogo');if(_0x3c644c[_0x278d95]||!_0x32d29e['custom']){_0x2b8470=path[_0xef8d('0x62')](config['root'],_0x31bd21,_[_0xef8d('0x61')](_0xef8d('0x70')));}if(!fs[_0xef8d('0x6f')](_0x2b8470)){throw new db[(_0xef8d('0x66'))]['ValidationError'](_[_0xef8d('0x64')](_0xef8d('0x6b'))+_0xef8d('0x68'));}return _0x26374e[_0xef8d('0x69')](_0x2b8470);}})[_0xef8d('0x50')](handleError(_0x26374e,null));};exports[_0xef8d('0x71')]=function(_0x30bfd1,_0x4e7be6){return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x30bfd1[_0xef8d('0x51')]['id']},'attributes':[_0xef8d('0x72')]})[_0xef8d('0x1c')](respondWithResult(_0x4e7be6,null))['catch'](handleError(_0x4e7be6,null));};exports[_0xef8d('0x73')]=function(_0x278171,_0x537ed3,_0x3a2881){if(_0x278171[_0xef8d('0x56')]&&_0x278171[_0xef8d('0x56')]['filename']){_0x278171[_0xef8d('0x54')]['preferred']=_0x278171['file'][_0xef8d('0x58')];}return db['Setting'][_0xef8d('0x52')]({'where':{'id':_0x278171[_0xef8d('0x51')]['id']}})[_0xef8d('0x1c')](handleEntityNotFound(_0x537ed3,null))['then'](saveUpdates(_0x278171[_0xef8d('0x54')],null))[_0xef8d('0x1c')](respondWithResult(_0x537ed3,null))[_0xef8d('0x50')](handleError(_0x537ed3,null));};var utilLicense=require(_0xef8d('0x16'));exports[_0xef8d('0x74')]=function(_0x298cb8,_0x2efdc3,_0x3c54ec){var _0x39fe71=_0xef8d('0x5b');var _0x199137={'custom':![]};return utilLicense[_0xef8d('0x5c')]()[_0xef8d('0x1c')](function(_0x50f3f0){if(_0x50f3f0){_0x199137=_0x50f3f0;}return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x298cb8[_0xef8d('0x51')]['id']},'attributes':[_0xef8d('0x57'),_0xef8d('0x6b'),'preferred',_0xef8d('0x6c'),_0xef8d('0x5e'),_0xef8d('0x6d'),_0xef8d('0x6e'),_0xef8d('0x5f')],'raw':!![]});})[_0xef8d('0x1c')](handleEntityNotFound(_0x2efdc3,null))[_0xef8d('0x1c')](function(_0x3580f6){if(_0x3580f6){var _0x668e66=_0x3580f6[_0xef8d('0x5d')]&&fs[_0xef8d('0x6f')](path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x39fe71,_[_0xef8d('0x61')](_0x3580f6[_0xef8d('0x5d')])))?path['join'](config[_0xef8d('0x60')],_0x39fe71,_[_0xef8d('0x61')](_0x3580f6[_0xef8d('0x5d')])):path[_0xef8d('0x62')](config['root'],_0x39fe71,_[_0xef8d('0x61')](_0xef8d('0x75')));var _0x15892d=_0xef8d('0x63')+_['upperFirst'](_0xef8d('0x5d'));if(_0x3580f6[_0x15892d]||!_0x199137['custom']||!_0x199137[_0xef8d('0x5d')]){_0x668e66=path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x39fe71,_[_0xef8d('0x61')](_0xef8d('0x75')));}if(!fs[_0xef8d('0x6f')](_0x668e66)){throw new db[(_0xef8d('0x66'))][(_0xef8d('0x67'))](_[_0xef8d('0x64')](_0xef8d('0x5d'))+_0xef8d('0x68'));}return _0x2efdc3[_0xef8d('0x69')](_0x668e66);}})[_0xef8d('0x50')](handleError(_0x2efdc3,null));};exports[_0xef8d('0x76')]=function(_0x2e63e7,_0x10914b,_0x4fa5a5){if(_0x2e63e7[_0xef8d('0x56')]&&_0x2e63e7[_0xef8d('0x56')]['filename']){_0x2e63e7[_0xef8d('0x54')][_0xef8d('0x6c')]=_0x2e63e7[_0xef8d('0x56')][_0xef8d('0x58')];}return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x2e63e7[_0xef8d('0x51')]['id']}})['then'](handleEntityNotFound(_0x10914b,null))[_0xef8d('0x1c')](saveUpdates(_0x2e63e7[_0xef8d('0x54')],null))['then'](respondWithResult(_0x10914b,null))[_0xef8d('0x50')](handleError(_0x10914b,null));};var utilLicense=require(_0xef8d('0x16'));exports['getFavicon']=function(_0x4f5472,_0x27a78e,_0x4f420f){var _0x18c8c3=_0xef8d('0x5b');var _0x306490={'custom':![]};return utilLicense[_0xef8d('0x5c')]()['then'](function(_0x1c8492){if(_0x1c8492){_0x306490=_0x1c8492;}return db[_0xef8d('0x4d')][_0xef8d('0x52')]({'where':{'id':_0x4f5472[_0xef8d('0x51')]['id']},'attributes':[_0xef8d('0x57'),_0xef8d('0x6b'),_0xef8d('0x5d'),'favicon',_0xef8d('0x5e'),'defaultLoginLogo',_0xef8d('0x6e'),_0xef8d('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x27a78e,null))[_0xef8d('0x1c')](function(_0x45ddc3){if(_0x45ddc3){var _0x6df1ee=_0x45ddc3[_0xef8d('0x6c')]&&fs[_0xef8d('0x6f')](path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x18c8c3,_[_0xef8d('0x61')](_0x45ddc3[_0xef8d('0x6c')])))?path['join'](config[_0xef8d('0x60')],_0x18c8c3,_[_0xef8d('0x61')](_0x45ddc3['favicon'])):path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x18c8c3,_['toLower']('default_favicon.ico'));var _0x2ddb1e=_0xef8d('0x63')+_['upperFirst']('favicon');if(_0x45ddc3[_0x2ddb1e]||!_0x306490['custom']){_0x6df1ee=path[_0xef8d('0x62')](config[_0xef8d('0x60')],_0x18c8c3,_[_0xef8d('0x61')]('default_favicon.ico'));}if(!fs[_0xef8d('0x6f')](_0x6df1ee)){throw new db[(_0xef8d('0x66'))][(_0xef8d('0x67'))](_[_0xef8d('0x64')](_0xef8d('0x6c'))+'\x20not\x20found');}return _0x27a78e[_0xef8d('0x69')](_0x6df1ee);}})[_0xef8d('0x50')](handleError(_0x27a78e,null));};exports[_0xef8d('0x77')]=function(_0x9d3992,_0x37e1d7){var _0x222aab={'offset':moment()[_0xef8d('0x78')]()};_0x222aab[_0xef8d('0x79')]=moment()['utcOffset'](_0x222aab['offset'])[_0xef8d('0x7a')](_0xef8d('0x7b'));return _0x37e1d7['status'](0xc8)[_0xef8d('0x33')](_0x222aab);}; \ No newline at end of file +var _0x4680=['gdpr','securePassword','../../config/license/util','getPreferred','default_preferred.png','getFavicon','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','Setting','include','findAll','show','keys','includeAll','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','preferred','defaultLoginLogo','default_loginLogo.svg','custom'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4680,0x106));var _0x0468=function(_0x13b0e0,_0x204d71){_0x13b0e0=_0x13b0e0-0x0;var _0x1c15e5=_0x4680[_0x13b0e0];return _0x1c15e5;};'use strict';var emlformat=require(_0x0468('0x0'));var rimraf=require(_0x0468('0x1'));var zipdir=require(_0x0468('0x2'));var jsonpatch=require(_0x0468('0x3'));var rp=require('request-promise');var moment=require(_0x0468('0x4'));var BPromise=require(_0x0468('0x5'));var Mustache=require(_0x0468('0x6'));var util=require(_0x0468('0x7'));var path=require(_0x0468('0x8'));var sox=require(_0x0468('0x9'));var csv=require(_0x0468('0xa'));var ejs=require(_0x0468('0xb'));var fs=require('fs');var fs_extra=require(_0x0468('0xc'));var _=require('lodash');var squel=require(_0x0468('0xd'));var crypto=require(_0x0468('0xe'));var jsforce=require(_0x0468('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0468('0xa'));var querystring=require(_0x0468('0x10'));var Papa=require(_0x0468('0x11'));var Redis=require(_0x0468('0x12'));var authService=require(_0x0468('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0468('0x14'));var hardwareService=require(_0x0468('0x15'));var logger=require('../../config/logger')(_0x0468('0x16'));var utils=require('../../config/utils');var config=require(_0x0468('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0468('0x18'))['db'];var jayson=require(_0x0468('0x19'));var client=jayson[_0x0468('0x1a')][_0x0468('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x20c3fa,_0x3fee51,_0x37dd5a,_0x2fa8b4){return new BPromise(function(_0x1cf0a0,_0x2f583f){var _0x36ed72=_0x2fa8b4||client;return _0x36ed72[_0x0468('0x1c')](_0x20c3fa,_0x37dd5a)['then'](function(_0x12537a){logger[_0x0468('0x1d')]('Setting,\x20%s,\x20%s',_0x3fee51,_0x0468('0x1e'));logger[_0x0468('0x1f')](_0x0468('0x20'),_0x3fee51,_0x0468('0x1e'),JSON['stringify'](_0x12537a));if(_0x12537a[_0x0468('0x21')]){if(_0x12537a[_0x0468('0x21')][_0x0468('0x22')]===0x1f4){logger[_0x0468('0x21')](_0x0468('0x23'),_0x3fee51,_0x12537a[_0x0468('0x21')][_0x0468('0x24')]);return _0x2f583f(_0x12537a['error'][_0x0468('0x24')]);}logger[_0x0468('0x21')](_0x0468('0x23'),_0x3fee51,_0x12537a[_0x0468('0x21')][_0x0468('0x24')]);return _0x1cf0a0(_0x12537a[_0x0468('0x21')][_0x0468('0x24')]);}else{logger[_0x0468('0x1d')]('Setting,\x20%s,\x20%s',_0x3fee51,'request\x20sent');_0x1cf0a0(_0x12537a[_0x0468('0x25')][_0x0468('0x24')]);}})[_0x0468('0x26')](function(_0xf2ea57){logger[_0x0468('0x21')](_0x0468('0x23'),_0x3fee51,_0xf2ea57);_0x2f583f(_0xf2ea57);});});}function respondWithStatusCode(_0x5d9330,_0x57a232){_0x57a232=_0x57a232||0xcc;return function(_0x4cbbdf){if(_0x4cbbdf){return _0x5d9330[_0x0468('0x27')](_0x57a232);}return _0x5d9330[_0x0468('0x28')](_0x57a232)[_0x0468('0x29')]();};}function respondWithResult(_0x3d6042,_0x639946){_0x639946=_0x639946||0xc8;return function(_0x23e772){if(_0x23e772){return _0x3d6042['status'](_0x639946)['json'](_0x23e772);}};}function respondWithFilteredResult(_0x3b9d1f,_0x3d36a1){return function(_0x57c1cd){if(_0x57c1cd){var _0x203b69=typeof _0x3d36a1[_0x0468('0x2a')]===_0x0468('0x2b')&&typeof _0x3d36a1[_0x0468('0x2c')]===_0x0468('0x2b');var _0x17929b=_0x57c1cd[_0x0468('0x2d')];var _0x4097fd=_0x203b69?0x0:_0x3d36a1[_0x0468('0x2a')];var _0x240782=_0x203b69?_0x57c1cd['count']:_0x3d36a1[_0x0468('0x2a')]+_0x3d36a1[_0x0468('0x2c')];var _0x2e2089;if(_0x240782>=_0x17929b){_0x240782=_0x17929b;_0x2e2089=0xc8;}else{_0x2e2089=0xce;}_0x3b9d1f[_0x0468('0x28')](_0x2e2089);return _0x3b9d1f[_0x0468('0x2e')](_0x0468('0x2f'),_0x4097fd+'-'+_0x240782+'/'+_0x17929b)['json'](_0x57c1cd);}return null;};}function patchUpdates(_0xf921ce){return function(_0x51424d){try{jsonpatch[_0x0468('0x30')](_0x51424d,_0xf921ce,!![]);}catch(_0x1a8c4b){return BPromise['reject'](_0x1a8c4b);}return _0x51424d[_0x0468('0x31')]();};}function saveUpdates(_0x5d4391,_0x574888){return function(_0x4a6668){if(_0x4a6668){return _0x4a6668[_0x0468('0x32')](_0x5d4391)[_0x0468('0x33')](function(_0x3d42f3){return _0x3d42f3;});}return null;};}function removeEntity(_0x48afc8,_0x3510bb){return function(_0x2c9558){if(_0x2c9558){return _0x2c9558[_0x0468('0x34')]()[_0x0468('0x33')](function(){_0x48afc8[_0x0468('0x28')](0xcc)[_0x0468('0x29')]();});}};}function handleEntityNotFound(_0x241d3e,_0x882dd1){return function(_0x1caad1){if(!_0x1caad1){_0x241d3e[_0x0468('0x27')](0x194);}return _0x1caad1;};}function handleError(_0x2b387d,_0x56ded6){_0x56ded6=_0x56ded6||0x1f4;return function(_0x515fca){logger[_0x0468('0x21')](_0x515fca[_0x0468('0x35')]);if(_0x515fca[_0x0468('0x36')]){delete _0x515fca['name'];}_0x2b387d[_0x0468('0x28')](_0x56ded6)['send'](_0x515fca);};}exports[_0x0468('0x37')]=function(_0x10dcef,_0x5ac02b){var _0x1bfbc4={},_0x3b61cc={},_0x45f00a={'count':0x0,'rows':[]};var _0x8baaa1=_['map'](db['Setting'][_0x0468('0x38')],function(_0x109a5f){return{'name':_0x109a5f[_0x0468('0x39')],'type':_0x109a5f[_0x0468('0x3a')][_0x0468('0x3b')]};});_0x3b61cc[_0x0468('0x3c')]=_['map'](_0x8baaa1,_0x0468('0x36'));_0x3b61cc['query']=_['keys'](_0x10dcef[_0x0468('0x3d')]);_0x3b61cc[_0x0468('0x3e')]=_['intersection'](_0x3b61cc[_0x0468('0x3c')],_0x3b61cc[_0x0468('0x3d')]);_0x1bfbc4['attributes']=_[_0x0468('0x3f')](_0x3b61cc['model'],qs[_0x0468('0x40')](_0x10dcef[_0x0468('0x3d')][_0x0468('0x40')]));_0x1bfbc4[_0x0468('0x41')]=_0x1bfbc4['attributes'][_0x0468('0x42')]?_0x1bfbc4['attributes']:_0x3b61cc[_0x0468('0x3c')];if(!_0x10dcef[_0x0468('0x3d')][_0x0468('0x43')](_0x0468('0x44'))){_0x1bfbc4[_0x0468('0x2c')]=qs[_0x0468('0x2c')](_0x10dcef[_0x0468('0x3d')]['limit']);_0x1bfbc4[_0x0468('0x2a')]=qs[_0x0468('0x2a')](_0x10dcef[_0x0468('0x3d')]['offset']);}_0x1bfbc4[_0x0468('0x45')]=qs[_0x0468('0x46')](_0x10dcef[_0x0468('0x3d')]['sort']);_0x1bfbc4['where']=qs['filters'](_[_0x0468('0x47')](_0x10dcef['query'],_0x3b61cc[_0x0468('0x3e')]),_0x8baaa1);if(_0x10dcef[_0x0468('0x3d')][_0x0468('0x48')]){_0x1bfbc4[_0x0468('0x49')]=_[_0x0468('0x4a')](_0x1bfbc4['where'],{'$or':_['map'](_0x8baaa1,function(_0x491e6e){if(_0x491e6e[_0x0468('0x3a')]!=='VIRTUAL'){var _0x3746ce={};_0x3746ce[_0x491e6e[_0x0468('0x36')]]={'$like':'%'+_0x10dcef['query'][_0x0468('0x48')]+'%'};return _0x3746ce;}})});}_0x1bfbc4=_[_0x0468('0x4a')]({},_0x1bfbc4,_0x10dcef[_0x0468('0x4b')]);var _0x26fbc4={'where':_0x1bfbc4[_0x0468('0x49')]};return db[_0x0468('0x4c')][_0x0468('0x2d')](_0x26fbc4)[_0x0468('0x33')](function(_0x19516b){_0x45f00a[_0x0468('0x2d')]=_0x19516b;if(_0x10dcef[_0x0468('0x3d')]['includeAll']){_0x1bfbc4[_0x0468('0x4d')]=[{'all':!![]}];}return db[_0x0468('0x4c')][_0x0468('0x4e')](_0x1bfbc4);})['then'](function(_0x1b3fdc){_0x45f00a['rows']=_0x1b3fdc;return _0x45f00a;})['then'](respondWithFilteredResult(_0x5ac02b,_0x1bfbc4))[_0x0468('0x26')](handleError(_0x5ac02b,null));};exports[_0x0468('0x4f')]=function(_0x4bc0a1,_0x3488ed){var _0x228f29={'raw':![],'where':{'id':_0x4bc0a1['params']['id']}},_0x408ccb={};_0x408ccb['model']=_[_0x0468('0x50')](db[_0x0468('0x4c')][_0x0468('0x38')]);_0x408ccb[_0x0468('0x3d')]=_[_0x0468('0x50')](_0x4bc0a1[_0x0468('0x3d')]);_0x408ccb['filters']=_[_0x0468('0x3f')](_0x408ccb[_0x0468('0x3c')],_0x408ccb[_0x0468('0x3d')]);_0x228f29[_0x0468('0x41')]=_[_0x0468('0x3f')](_0x408ccb[_0x0468('0x3c')],qs['fields'](_0x4bc0a1[_0x0468('0x3d')][_0x0468('0x40')]));_0x228f29['attributes']=_0x228f29[_0x0468('0x41')][_0x0468('0x42')]?_0x228f29[_0x0468('0x41')]:_0x408ccb['model'];if(_0x4bc0a1[_0x0468('0x3d')][_0x0468('0x51')]){_0x228f29[_0x0468('0x4d')]=[{'all':!![]}];}_0x228f29=_[_0x0468('0x4a')]({},_0x228f29,_0x4bc0a1['options']);return db['Setting'][_0x0468('0x52')](_0x228f29)[_0x0468('0x33')](handleEntityNotFound(_0x3488ed,null))[_0x0468('0x33')](respondWithResult(_0x3488ed,null))[_0x0468('0x26')](handleError(_0x3488ed,null));};exports[_0x0468('0x32')]=function(_0x28e218,_0x27a4fe){if(_0x28e218['body']['id']){delete _0x28e218[_0x0468('0x53')]['id'];}return db[_0x0468('0x4c')][_0x0468('0x52')]({'where':{'id':_0x28e218[_0x0468('0x54')]['id']}})['then'](handleEntityNotFound(_0x27a4fe,null))[_0x0468('0x33')](saveUpdates(_0x28e218[_0x0468('0x53')],null))[_0x0468('0x33')](respondWithResult(_0x27a4fe,null))[_0x0468('0x26')](handleError(_0x27a4fe,null));};exports[_0x0468('0x55')]=function(_0x501801,_0x2e107e,_0x1bbbea){if(_0x501801[_0x0468('0x56')]&&_0x501801['file'][_0x0468('0x57')]){_0x501801['body'][_0x0468('0x58')]=_0x501801['file']['filename'];}return db[_0x0468('0x4c')]['find']({'where':{'id':_0x501801[_0x0468('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e107e,null))[_0x0468('0x33')](saveUpdates(_0x501801[_0x0468('0x53')],null))[_0x0468('0x33')](respondWithResult(_0x2e107e,null))[_0x0468('0x26')](handleError(_0x2e107e,null));};exports[_0x0468('0x59')]=function(_0x58d0ef,_0x16fb46,_0x3489c6){if(_0x58d0ef[_0x0468('0x56')]&&_0x58d0ef[_0x0468('0x56')][_0x0468('0x57')]){_0x58d0ef['body'][_0x0468('0x5a')]=_0x58d0ef[_0x0468('0x56')][_0x0468('0x57')];}return db['Setting']['find']({'where':{'id':_0x58d0ef[_0x0468('0x54')]['id']}})[_0x0468('0x33')](handleEntityNotFound(_0x16fb46,null))[_0x0468('0x33')](saveUpdates(_0x58d0ef[_0x0468('0x53')],null))['then'](respondWithResult(_0x16fb46,null))[_0x0468('0x26')](handleError(_0x16fb46,null));};var utilLicense=require('../../config/license/util');exports[_0x0468('0x5b')]=function(_0x143625,_0x3643b1,_0x121bcd){var _0x1c4538=_0x0468('0x5c');var _0x2ef05f={'custom':![]};return utilLicense[_0x0468('0x5d')]()['then'](function(_0x2cb9aa){if(_0x2cb9aa){_0x2ef05f=_0x2cb9aa;}return db[_0x0468('0x4c')][_0x0468('0x52')]({'where':{'id':_0x143625[_0x0468('0x54')]['id']},'attributes':[_0x0468('0x58'),_0x0468('0x5a'),'preferred',_0x0468('0x5e'),_0x0468('0x5f'),'defaultLoginLogo',_0x0468('0x60'),_0x0468('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x3643b1,null))['then'](function(_0x1dc5ed){if(_0x1dc5ed){var _0xe01d32=_0x1dc5ed['logo']&&fs[_0x0468('0x62')](path[_0x0468('0x63')](config[_0x0468('0x64')],_0x1c4538,_[_0x0468('0x65')](_0x1dc5ed['logo'])))?path[_0x0468('0x63')](config[_0x0468('0x64')],_0x1c4538,_[_0x0468('0x65')](_0x1dc5ed[_0x0468('0x58')])):path[_0x0468('0x63')](config[_0x0468('0x64')],_0x1c4538,_[_0x0468('0x65')](_0x0468('0x66')));var _0x5267df=_0x0468('0x67')+_[_0x0468('0x68')](_0x0468('0x58'));if(_0x1dc5ed[_0x5267df]||!_0x2ef05f['custom']){_0xe01d32=path[_0x0468('0x63')](config['root'],_0x1c4538,_[_0x0468('0x65')]('default_logo.svg'));}if(!fs[_0x0468('0x62')](_0xe01d32)){throw new db[(_0x0468('0x69'))][(_0x0468('0x6a'))](_[_0x0468('0x68')](_0x0468('0x58'))+_0x0468('0x6b'));}return _0x3643b1[_0x0468('0x6c')](_0xe01d32);}})['catch'](handleError(_0x3643b1,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x87b8d6,_0x3f6015,_0x1fc857){var _0x4928bd='server/files/images/logos';var _0x1b7d48={'custom':![]};return utilLicense[_0x0468('0x5d')]()[_0x0468('0x33')](function(_0x42c077){if(_0x42c077){_0x1b7d48=_0x42c077;}return db[_0x0468('0x4c')][_0x0468('0x52')]({'where':{'id':_0x87b8d6[_0x0468('0x54')]['id']},'attributes':[_0x0468('0x58'),_0x0468('0x5a'),_0x0468('0x6d'),_0x0468('0x5e'),_0x0468('0x5f'),_0x0468('0x6e'),_0x0468('0x60'),_0x0468('0x61')],'raw':!![]});})[_0x0468('0x33')](handleEntityNotFound(_0x3f6015,null))[_0x0468('0x33')](function(_0x159bca){if(_0x159bca){var _0x5a82ec=_0x159bca[_0x0468('0x5a')]&&fs[_0x0468('0x62')](path[_0x0468('0x63')](config['root'],_0x4928bd,_[_0x0468('0x65')](_0x159bca[_0x0468('0x5a')])))?path[_0x0468('0x63')](config[_0x0468('0x64')],_0x4928bd,_[_0x0468('0x65')](_0x159bca[_0x0468('0x5a')])):path[_0x0468('0x63')](config[_0x0468('0x64')],_0x4928bd,_[_0x0468('0x65')](_0x0468('0x6f')));var _0x1913d7=_0x0468('0x67')+_[_0x0468('0x68')](_0x0468('0x5a'));if(_0x159bca[_0x1913d7]||!_0x1b7d48[_0x0468('0x70')]){_0x5a82ec=path['join'](config[_0x0468('0x64')],_0x4928bd,_[_0x0468('0x65')](_0x0468('0x6f')));}if(!fs[_0x0468('0x62')](_0x5a82ec)){throw new db[(_0x0468('0x69'))][(_0x0468('0x6a'))](_['upperFirst'](_0x0468('0x5a'))+_0x0468('0x6b'));}return _0x3f6015[_0x0468('0x6c')](_0x5a82ec);}})[_0x0468('0x26')](handleError(_0x3f6015,null));};exports[_0x0468('0x71')]=function(_0x333eba,_0x419d8c){return db[_0x0468('0x4c')]['find']({'where':{'id':_0x333eba[_0x0468('0x54')]['id']},'attributes':[_0x0468('0x72')]})[_0x0468('0x33')](respondWithResult(_0x419d8c,null))[_0x0468('0x26')](handleError(_0x419d8c,null));};exports['addPreferred']=function(_0x195933,_0x18fddc,_0x1a6ede){if(_0x195933[_0x0468('0x56')]&&_0x195933[_0x0468('0x56')][_0x0468('0x57')]){_0x195933[_0x0468('0x53')][_0x0468('0x6d')]=_0x195933[_0x0468('0x56')][_0x0468('0x57')];}return db['Setting'][_0x0468('0x52')]({'where':{'id':_0x195933[_0x0468('0x54')]['id']}})[_0x0468('0x33')](handleEntityNotFound(_0x18fddc,null))[_0x0468('0x33')](saveUpdates(_0x195933[_0x0468('0x53')],null))[_0x0468('0x33')](respondWithResult(_0x18fddc,null))[_0x0468('0x26')](handleError(_0x18fddc,null));};var utilLicense=require(_0x0468('0x73'));exports[_0x0468('0x74')]=function(_0x4bb7be,_0x402814,_0x2089d7){var _0x10cd21='server/files/images/logos';var _0x3c6828={'custom':![]};return utilLicense['getLicense']()[_0x0468('0x33')](function(_0x4a5792){if(_0x4a5792){_0x3c6828=_0x4a5792;}return db[_0x0468('0x4c')][_0x0468('0x52')]({'where':{'id':_0x4bb7be['params']['id']},'attributes':[_0x0468('0x58'),_0x0468('0x5a'),_0x0468('0x6d'),_0x0468('0x5e'),'defaultLogo','defaultLoginLogo',_0x0468('0x60'),_0x0468('0x61')],'raw':!![]});})[_0x0468('0x33')](handleEntityNotFound(_0x402814,null))[_0x0468('0x33')](function(_0x5525a8){if(_0x5525a8){var _0x51f081=_0x5525a8[_0x0468('0x6d')]&&fs[_0x0468('0x62')](path['join'](config[_0x0468('0x64')],_0x10cd21,_[_0x0468('0x65')](_0x5525a8[_0x0468('0x6d')])))?path['join'](config[_0x0468('0x64')],_0x10cd21,_['toLower'](_0x5525a8[_0x0468('0x6d')])):path['join'](config['root'],_0x10cd21,_['toLower'](_0x0468('0x75')));var _0x364374=_0x0468('0x67')+_[_0x0468('0x68')]('preferred');if(_0x5525a8[_0x364374]||!_0x3c6828[_0x0468('0x70')]||!_0x3c6828['preferred']){_0x51f081=path[_0x0468('0x63')](config[_0x0468('0x64')],_0x10cd21,_['toLower']('default_preferred.png'));}if(!fs[_0x0468('0x62')](_0x51f081)){throw new db['Sequelize'][(_0x0468('0x6a'))](_['upperFirst'](_0x0468('0x6d'))+'\x20not\x20found');}return _0x402814[_0x0468('0x6c')](_0x51f081);}})[_0x0468('0x26')](handleError(_0x402814,null));};exports['addFavicon']=function(_0x737f24,_0x663f03,_0x6d2cef){if(_0x737f24['file']&&_0x737f24[_0x0468('0x56')][_0x0468('0x57')]){_0x737f24[_0x0468('0x53')][_0x0468('0x5e')]=_0x737f24['file']['filename'];}return db[_0x0468('0x4c')][_0x0468('0x52')]({'where':{'id':_0x737f24['params']['id']}})['then'](handleEntityNotFound(_0x663f03,null))[_0x0468('0x33')](saveUpdates(_0x737f24['body'],null))[_0x0468('0x33')](respondWithResult(_0x663f03,null))['catch'](handleError(_0x663f03,null));};var utilLicense=require(_0x0468('0x73'));exports[_0x0468('0x76')]=function(_0x4525af,_0x831127,_0x5686f9){var _0x3aa85c='server/files/images/logos';var _0x5909d8={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xe2ad56){if(_0xe2ad56){_0x5909d8=_0xe2ad56;}return db[_0x0468('0x4c')]['find']({'where':{'id':_0x4525af[_0x0468('0x54')]['id']},'attributes':[_0x0468('0x58'),_0x0468('0x5a'),_0x0468('0x6d'),_0x0468('0x5e'),'defaultLogo','defaultLoginLogo',_0x0468('0x60'),_0x0468('0x61')],'raw':!![]});})[_0x0468('0x33')](handleEntityNotFound(_0x831127,null))[_0x0468('0x33')](function(_0x4779a6){if(_0x4779a6){var _0xa66bc9=_0x4779a6[_0x0468('0x5e')]&&fs[_0x0468('0x62')](path[_0x0468('0x63')](config[_0x0468('0x64')],_0x3aa85c,_[_0x0468('0x65')](_0x4779a6['favicon'])))?path[_0x0468('0x63')](config[_0x0468('0x64')],_0x3aa85c,_['toLower'](_0x4779a6['favicon'])):path[_0x0468('0x63')](config[_0x0468('0x64')],_0x3aa85c,_[_0x0468('0x65')]('default_favicon.ico'));var _0x3d79c6=_0x0468('0x67')+_[_0x0468('0x68')](_0x0468('0x5e'));if(_0x4779a6[_0x3d79c6]||!_0x5909d8[_0x0468('0x70')]){_0xa66bc9=path[_0x0468('0x63')](config[_0x0468('0x64')],_0x3aa85c,_[_0x0468('0x65')]('default_favicon.ico'));}if(!fs['existsSync'](_0xa66bc9)){throw new db[(_0x0468('0x69'))][(_0x0468('0x6a'))](_[_0x0468('0x68')]('favicon')+_0x0468('0x6b'));}return _0x831127[_0x0468('0x6c')](_0xa66bc9);}})[_0x0468('0x26')](handleError(_0x831127,null));};exports[_0x0468('0x77')]=function(_0x59485f,_0x4b21b5){var _0x2c82b5={'offset':moment()['utcOffset']()};_0x2c82b5[_0x0468('0x78')]=moment()[_0x0468('0x79')](_0x2c82b5[_0x0468('0x2a')])[_0x0468('0x7a')](_0x0468('0x7b'));return _0x4b21b5['status'](0xc8)[_0x0468('0x7c')](_0x2c82b5);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 433e68d..398beca 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x4ec3ca,_0x47b047){var _0x308d4d=function(_0x4f0eeb){while(--_0x4f0eeb){_0x4ec3ca['push'](_0x4ec3ca['shift']());}};_0x308d4d(++_0x47b047);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fd9b2,_0x1be29e){_0x1fd9b2=_0x1fd9b2-0x0;var _0x1aacca=_0xedd9[_0x1fd9b2];return _0x1aacca;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x9ace37,_0x4d1159){var _0x23ecc0=function(_0xda11a){while(--_0xda11a){_0x9ace37['push'](_0x9ace37['shift']());}};_0x23ecc0(++_0x4d1159);}(_0x008c,0x188));var _0xc008=function(_0x58b14b,_0x5ab912){_0x58b14b=_0x58b14b-0x0;var _0x5aec73=_0x008c[_0x58b14b];return _0x5aec73;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'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 34c1c01..be33100 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 _0xb4ce=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Setting','find','options','where','attributes','include','model','map','ShowSetting','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb4ce,0x117));var _0xeb4c=function(_0x1ea370,_0x48461f){_0x1ea370=_0x1ea370-0x0;var _0x17c599=_0xb4ce[_0x1ea370];return _0x17c599;};'use strict';var _=require('lodash');var util=require(_0xeb4c('0x0'));var moment=require('moment');var BPromise=require(_0xeb4c('0x1'));var rs=require(_0xeb4c('0x2'));var fs=require('fs');var Redis=require(_0xeb4c('0x3'));var db=require(_0xeb4c('0x4'))['db'];var utils=require(_0xeb4c('0x5'));var logger=require('../../config/logger')(_0xeb4c('0x6'));var config=require(_0xeb4c('0x7'));var jayson=require(_0xeb4c('0x8'));var client=jayson['client'][_0xeb4c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a8e1,_0x3bf8ab,_0x1afd26){return new BPromise(function(_0x5314dc,_0x5882fa){return client[_0xeb4c('0xa')](_0x50a8e1,_0x1afd26)[_0xeb4c('0xb')](function(_0x158d62){logger[_0xeb4c('0xc')](_0xeb4c('0xd'),_0x3bf8ab,_0xeb4c('0xe'));logger['debug'](_0xeb4c('0xf'),_0x3bf8ab,_0xeb4c('0xe'),JSON[_0xeb4c('0x10')](_0x158d62));if(_0x158d62[_0xeb4c('0x11')]){if(_0x158d62['error'][_0xeb4c('0x12')]===0x1f4){logger[_0xeb4c('0x11')](_0xeb4c('0xd'),_0x3bf8ab,_0x158d62['error'][_0xeb4c('0x13')]);return _0x5882fa(_0x158d62[_0xeb4c('0x11')][_0xeb4c('0x13')]);}logger['error']('Setting,\x20%s,\x20%s',_0x3bf8ab,_0x158d62[_0xeb4c('0x11')][_0xeb4c('0x13')]);return _0x5314dc(_0x158d62[_0xeb4c('0x11')][_0xeb4c('0x13')]);}else{logger[_0xeb4c('0xc')](_0xeb4c('0xd'),_0x3bf8ab,_0xeb4c('0xe'));_0x5314dc(_0x158d62[_0xeb4c('0x14')][_0xeb4c('0x13')]);}})[_0xeb4c('0x15')](function(_0x424898){logger['error']('Setting,\x20%s,\x20%s',_0x3bf8ab,_0x424898);_0x5882fa(_0x424898);});});}exports['ShowSetting']=function(_0x1a7b46){var _0x560c5b=this;return new Promise(function(_0x574de3,_0x583789){return db[_0xeb4c('0x16')][_0xeb4c('0x17')]({'raw':_0x1a7b46['options']?_0x1a7b46['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a7b46[_0xeb4c('0x18')]?_0x1a7b46['options'][_0xeb4c('0x19')]||null:null,'attributes':_0x1a7b46[_0xeb4c('0x18')]?_0x1a7b46[_0xeb4c('0x18')][_0xeb4c('0x1a')]||null:null,'include':_0x1a7b46['options']?_0x1a7b46['options']['include']?_['map'](_0x1a7b46[_0xeb4c('0x18')][_0xeb4c('0x1b')],function(_0xa95cdd){return{'model':db[_0xa95cdd[_0xeb4c('0x1c')]],'as':_0xa95cdd['as'],'attributes':_0xa95cdd[_0xeb4c('0x1a')],'include':_0xa95cdd[_0xeb4c('0x1b')]?_['map'](_0xa95cdd[_0xeb4c('0x1b')],function(_0x28ceaf){return{'model':db[_0x28ceaf[_0xeb4c('0x1c')]],'as':_0x28ceaf['as'],'attributes':_0x28ceaf[_0xeb4c('0x1a')],'include':_0x28ceaf[_0xeb4c('0x1b')]?_[_0xeb4c('0x1d')](_0x28ceaf[_0xeb4c('0x1b')],function(_0x1a39f8){return{'model':db[_0x1a39f8[_0xeb4c('0x1c')]],'as':_0x1a39f8['as'],'attributes':_0x1a39f8[_0xeb4c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xeb4c('0xb')](function(_0x3e08b1){logger['info'](_0xeb4c('0x1e'),_0x1a7b46);logger[_0xeb4c('0x1f')]('ShowSetting',_0x1a7b46,JSON[_0xeb4c('0x10')](_0x3e08b1));_0x574de3(_0x3e08b1);})['catch'](function(_0x3bfb08){logger['error'](_0xeb4c('0x1e'),_0x3bfb08[_0xeb4c('0x13')],_0x1a7b46);_0x583789(_0x560c5b[_0xeb4c('0x11')](0x1f4,_0x3bfb08[_0xeb4c('0x13')]));});});}; \ No newline at end of file +var _0xf889=['request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSetting','options','raw','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf889,0x8e));var _0x9f88=function(_0x407e34,_0x327b01){_0x407e34=_0x407e34-0x0;var _0x2c7b6e=_0xf889[_0x407e34];return _0x2c7b6e;};'use strict';var _=require(_0x9f88('0x0'));var util=require(_0x9f88('0x1'));var moment=require(_0x9f88('0x2'));var BPromise=require(_0x9f88('0x3'));var rs=require(_0x9f88('0x4'));var fs=require('fs');var Redis=require(_0x9f88('0x5'));var db=require(_0x9f88('0x6'))['db'];var utils=require(_0x9f88('0x7'));var logger=require(_0x9f88('0x8'))(_0x9f88('0x9'));var config=require(_0x9f88('0xa'));var jayson=require(_0x9f88('0xb'));var client=jayson['client'][_0x9f88('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20d16d,_0x30e000,_0x25d7c7){return new BPromise(function(_0x5b05c3,_0x47c34b){return client[_0x9f88('0xd')](_0x20d16d,_0x25d7c7)[_0x9f88('0xe')](function(_0x16ad1e){logger['info'](_0x9f88('0xf'),_0x30e000,_0x9f88('0x10'));logger['debug'](_0x9f88('0x11'),_0x30e000,_0x9f88('0x10'),JSON[_0x9f88('0x12')](_0x16ad1e));if(_0x16ad1e['error']){if(_0x16ad1e[_0x9f88('0x13')]['code']===0x1f4){logger['error'](_0x9f88('0xf'),_0x30e000,_0x16ad1e['error']['message']);return _0x47c34b(_0x16ad1e[_0x9f88('0x13')][_0x9f88('0x14')]);}logger[_0x9f88('0x13')](_0x9f88('0xf'),_0x30e000,_0x16ad1e[_0x9f88('0x13')][_0x9f88('0x14')]);return _0x5b05c3(_0x16ad1e[_0x9f88('0x13')][_0x9f88('0x14')]);}else{logger[_0x9f88('0x15')](_0x9f88('0xf'),_0x30e000,'request\x20sent');_0x5b05c3(_0x16ad1e[_0x9f88('0x16')]['message']);}})['catch'](function(_0x2ef89a){logger[_0x9f88('0x13')](_0x9f88('0xf'),_0x30e000,_0x2ef89a);_0x47c34b(_0x2ef89a);});});}exports[_0x9f88('0x17')]=function(_0x436919){var _0x573d09=this;return new Promise(function(_0x75fb10,_0x494e60){return db['Setting']['find']({'raw':_0x436919['options']?_0x436919[_0x9f88('0x18')][_0x9f88('0x19')]===undefined?!![]:![]:!![],'where':_0x436919[_0x9f88('0x18')]?_0x436919['options']['where']||null:null,'attributes':_0x436919['options']?_0x436919[_0x9f88('0x18')][_0x9f88('0x1a')]||null:null,'include':_0x436919['options']?_0x436919[_0x9f88('0x18')][_0x9f88('0x1b')]?_['map'](_0x436919[_0x9f88('0x18')][_0x9f88('0x1b')],function(_0x25b18d){return{'model':db[_0x25b18d[_0x9f88('0x1c')]],'as':_0x25b18d['as'],'attributes':_0x25b18d[_0x9f88('0x1a')],'include':_0x25b18d[_0x9f88('0x1b')]?_[_0x9f88('0x1d')](_0x25b18d[_0x9f88('0x1b')],function(_0x4fbe44){return{'model':db[_0x4fbe44['model']],'as':_0x4fbe44['as'],'attributes':_0x4fbe44['attributes'],'include':_0x4fbe44['include']?_[_0x9f88('0x1d')](_0x4fbe44['include'],function(_0x5cc343){return{'model':db[_0x5cc343[_0x9f88('0x1c')]],'as':_0x5cc343['as'],'attributes':_0x5cc343[_0x9f88('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9f88('0xe')](function(_0x566fb3){logger['info'](_0x9f88('0x17'),_0x436919);logger[_0x9f88('0x1e')](_0x9f88('0x17'),_0x436919,JSON['stringify'](_0x566fb3));_0x75fb10(_0x566fb3);})['catch'](function(_0x5b8451){logger[_0x9f88('0x13')](_0x9f88('0x17'),_0x5b8451[_0x9f88('0x14')],_0x436919);_0x494e60(_0x573d09['error'](0x1f4,_0x5b8451['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8f605e6..f20efb8 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 _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x27acda,_0x4c11a6){var _0x47f760=function(_0xc481bc){while(--_0xc481bc){_0x27acda['push'](_0x27acda['shift']());}};_0x47f760(++_0x4c11a6);}(_0x5fab,0x177));var _0xb5fa=function(_0x94030f,_0x476ed2){_0x94030f=_0x94030f-0x0;var _0x9f7747=_0x5fab[_0x94030f];return _0x9f7747;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router; \ No newline at end of file +var _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0xa9d6d1,_0x3762b2){var _0x53a4cb=function(_0x181c1f){while(--_0x181c1f){_0xa9d6d1['push'](_0xa9d6d1['shift']());}};_0x53a4cb(++_0x3762b2);}(_0x5fab,0x177));var _0xb5fa=function(_0x206f02,_0x36f322){_0x206f02=_0x206f02-0x0;var _0x8a2663=_0x5fab[_0x206f02];return _0x8a2663;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('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 71da1d1..816b123 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 _0x245c=['skebby','connectel','clicksend','plivo','bandwidth','intelepeer','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','twilio'];(function(_0x485a6b,_0x52b019){var _0x2beb4b=function(_0x3c8c2a){while(--_0x3c8c2a){_0x485a6b['push'](_0x485a6b['shift']());}};_0x2beb4b(++_0x52b019);}(_0x245c,0x9b));var _0xc245=function(_0x64a581,_0x1873e2){_0x64a581=_0x64a581-0x0;var _0x4eefac=_0x245c[_0x64a581];return _0x4eefac;};'use strict';var Sequelize=require(_0xc245('0x0'));var rs=require(_0xc245('0x1'));module['exports']={'name':{'type':Sequelize[_0xc245('0x2')],'unique':_0xc245('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xc245('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc245('0x2')]},'type':{'type':Sequelize['ENUM'](_0xc245('0x4'),_0xc245('0x5'),_0xc245('0x6'),_0xc245('0x7'),_0xc245('0x8'),'clickatell',_0xc245('0x9'),'csc','infobip',_0xc245('0xa'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xc245('0x2')]},'authToken':{'type':Sequelize[_0xc245('0x2')]},'smsMethod':{'type':Sequelize[_0xc245('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0xc245('0x2')]},'password':{'type':Sequelize[_0xc245('0x2')]},'apiKey':{'type':Sequelize[_0xc245('0x2')]},'applicationId':{'type':Sequelize[_0xc245('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xc245('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xc245('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc245('0xc')],'defaultValue':function(){return _0xc245('0xd');}},'notificationSound':{'type':Sequelize[_0xc245('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc245('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc245('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc245('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc245('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc245('0xf')],'comment':_0xc245('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc245('0x11'),'set':function(_0x124567){if(!_0x124567)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc245('0x12')](_0xc245('0x13'),_0x124567);}}}; \ No newline at end of file +var _0x5111=['BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','twilio','connectel','plivo','clickatell','bandwidth','infobip','intelepeer'];(function(_0x1e9858,_0x46aa4f){var _0x1c68ac=function(_0x397523){while(--_0x397523){_0x1e9858['push'](_0x1e9858['shift']());}};_0x1c68ac(++_0x46aa4f);}(_0x5111,0x74));var _0x1511=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5111[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x1511('0x0'));var rs=require(_0x1511('0x1'));module['exports']={'name':{'type':Sequelize[_0x1511('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x1511('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x1511('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1511('0x3'),'skebby',_0x1511('0x4'),'clicksend',_0x1511('0x5'),_0x1511('0x6'),_0x1511('0x7'),'csc',_0x1511('0x8'),_0x1511('0x9'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x1511('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x1511('0x2')]},'password':{'type':Sequelize[_0x1511('0x2')]},'apiKey':{'type':Sequelize[_0x1511('0x2')]},'applicationId':{'type':Sequelize[_0x1511('0x2')]},'accountId':{'type':Sequelize[_0x1511('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x1511('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0x1511('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1511('0xb');}},'notificationSound':{'type':Sequelize[_0x1511('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1511('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1511('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1511('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1511('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1511('0xc')],'comment':_0x1511('0xd')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1511('0xe'),'set':function(_0x4d2184){if(!_0x4d2184)this['setDataValue'](_0x1511('0xf'),null);this[_0x1511('0x10')](_0x1511('0x11'),_0x4d2184);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index bdd00c7..ee8a33a 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 _0xfb25=['from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','ListId','Contacts','list','omit','spread','interaction','created','applications','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','SmsInteraction','Contact','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','out','SmsMessage','Messages','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','csc','addAgents','ids','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./smsAccount.socket','jayson/promise','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','find','create','body','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','orderBy','priority','asc','account','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','Sequelize'];(function(_0x23ee40,_0x2d8776){var _0x557ef8=function(_0x40f78c){while(--_0x40f78c){_0x23ee40['push'](_0x23ee40['shift']());}};_0x557ef8(++_0x2d8776);}(_0xfb25,0x136));var _0x5fb2=function(_0x2e15d1,_0x2c7601){_0x2e15d1=_0x2e15d1-0x0;var _0x54cc1d=_0xfb25[_0x2e15d1];return _0x54cc1d;};'use strict';var emlformat=require(_0x5fb2('0x0'));var rimraf=require(_0x5fb2('0x1'));var zipdir=require(_0x5fb2('0x2'));var jsonpatch=require(_0x5fb2('0x3'));var rp=require(_0x5fb2('0x4'));var moment=require(_0x5fb2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fb2('0x6'));var util=require(_0x5fb2('0x7'));var path=require('path');var sox=require(_0x5fb2('0x8'));var csv=require(_0x5fb2('0x9'));var ejs=require(_0x5fb2('0xa'));var fs=require('fs');var fs_extra=require(_0x5fb2('0xb'));var _=require(_0x5fb2('0xc'));var squel=require(_0x5fb2('0xd'));var crypto=require(_0x5fb2('0xe'));var jsforce=require(_0x5fb2('0xf'));var deskjs=require(_0x5fb2('0x10'));var toCsv=require(_0x5fb2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5fb2('0x11'));var authService=require(_0x5fb2('0x12'));var qs=require(_0x5fb2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fb2('0x14'))(_0x5fb2('0x15'));var utils=require(_0x5fb2('0x16'));var config=require(_0x5fb2('0x17'));var licenseUtil=require(_0x5fb2('0x18'));var db=require(_0x5fb2('0x19'))['db'];config['redis']=_[_0x5fb2('0x1a')](config[_0x5fb2('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5fb2('0x1c'))(new Redis(config[_0x5fb2('0x1b')]));require(_0x5fb2('0x1d'))['register'](socket);var jayson=require(_0x5fb2('0x1e'));var client=jayson['client'][_0x5fb2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2e88ea,_0x113e4b,_0x442ab6,_0x45a2c5){return new BPromise(function(_0x53b86e,_0x4b94b1){var _0x4f79cf=_0x45a2c5||client;return _0x4f79cf[_0x5fb2('0x20')](_0x2e88ea,_0x442ab6)[_0x5fb2('0x21')](function(_0x31a4bb){logger[_0x5fb2('0x22')]('SmsAccount,\x20%s,\x20%s',_0x113e4b,_0x5fb2('0x23'));logger['debug'](_0x5fb2('0x24'),_0x113e4b,_0x5fb2('0x23'),JSON['stringify'](_0x31a4bb));if(_0x31a4bb[_0x5fb2('0x25')]){if(_0x31a4bb[_0x5fb2('0x25')][_0x5fb2('0x26')]===0x1f4){logger[_0x5fb2('0x25')](_0x5fb2('0x27'),_0x113e4b,_0x31a4bb['error'][_0x5fb2('0x28')]);return _0x4b94b1(_0x31a4bb[_0x5fb2('0x25')][_0x5fb2('0x28')]);}logger[_0x5fb2('0x25')](_0x5fb2('0x27'),_0x113e4b,_0x31a4bb['error']['message']);return _0x53b86e(_0x31a4bb[_0x5fb2('0x25')][_0x5fb2('0x28')]);}else{logger[_0x5fb2('0x22')]('SmsAccount,\x20%s,\x20%s',_0x113e4b,'request\x20sent');_0x53b86e(_0x31a4bb[_0x5fb2('0x29')]['message']);}})[_0x5fb2('0x2a')](function(_0x3dbd4f){logger['error'](_0x5fb2('0x27'),_0x113e4b,_0x3dbd4f);_0x4b94b1(_0x3dbd4f);});});}function respondWithStatusCode(_0x40fd8b,_0x157356){_0x157356=_0x157356||0xcc;return function(_0x4839ce){if(_0x4839ce){return _0x40fd8b[_0x5fb2('0x2b')](_0x157356);}return _0x40fd8b[_0x5fb2('0x2c')](_0x157356)[_0x5fb2('0x2d')]();};}function respondWithResult(_0x155670,_0x32cc7c){_0x32cc7c=_0x32cc7c||0xc8;return function(_0xf5df39){if(_0xf5df39){return _0x155670[_0x5fb2('0x2c')](_0x32cc7c)[_0x5fb2('0x2e')](_0xf5df39);}};}function respondWithFilteredResult(_0x2bd5ee,_0x589c7d){return function(_0x2e4aca){if(_0x2e4aca){var _0x5f323b=typeof _0x589c7d[_0x5fb2('0x2f')]==='undefined'&&typeof _0x589c7d[_0x5fb2('0x30')]==='undefined';var _0xf03367=_0x2e4aca[_0x5fb2('0x31')];var _0xaaa194=_0x5f323b?0x0:_0x589c7d[_0x5fb2('0x2f')];var _0x1b89fe=_0x5f323b?_0x2e4aca[_0x5fb2('0x31')]:_0x589c7d[_0x5fb2('0x2f')]+_0x589c7d[_0x5fb2('0x30')];var _0x36d9bf;if(_0x1b89fe>=_0xf03367){_0x1b89fe=_0xf03367;_0x36d9bf=0xc8;}else{_0x36d9bf=0xce;}_0x2bd5ee['status'](_0x36d9bf);return _0x2bd5ee[_0x5fb2('0x32')](_0x5fb2('0x33'),_0xaaa194+'-'+_0x1b89fe+'/'+_0xf03367)[_0x5fb2('0x2e')](_0x2e4aca);}return null;};}function patchUpdates(_0x39b801){return function(_0x4feb91){try{jsonpatch[_0x5fb2('0x34')](_0x4feb91,_0x39b801,!![]);}catch(_0x46a1b2){return BPromise[_0x5fb2('0x35')](_0x46a1b2);}return _0x4feb91[_0x5fb2('0x36')]();};}function saveUpdates(_0x2ee44c,_0x4d22c9){return function(_0x2d8bb1){if(_0x2d8bb1){return _0x2d8bb1[_0x5fb2('0x37')](_0x2ee44c)[_0x5fb2('0x21')](function(_0x3cb4cc){return _0x3cb4cc;});}return null;};}function removeEntity(_0x45bcc2,_0x2728c2){return function(_0x36faa9){if(_0x36faa9){return _0x36faa9['destroy']()['then'](function(){var _0x999bf0=_0x36faa9[_0x5fb2('0x38')]({'plain':!![]});var _0x4e4259='SmsAccounts';return db[_0x5fb2('0x39')]['destroy']({'where':{'type':_0x4e4259,'resourceId':_0x999bf0['id']}})[_0x5fb2('0x21')](function(){return _0x36faa9;});})[_0x5fb2('0x21')](function(){_0x45bcc2[_0x5fb2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0998,_0xf899ee){return function(_0x2c889c){if(!_0x2c889c){_0x4e0998[_0x5fb2('0x2b')](0x194);}return _0x2c889c;};}function handleError(_0x58b1f2,_0x268459){_0x268459=_0x268459||0x1f4;return function(_0x5c2887){logger[_0x5fb2('0x25')](_0x5c2887[_0x5fb2('0x3a')]);if(_0x5c2887[_0x5fb2('0x3b')]){delete _0x5c2887[_0x5fb2('0x3b')];}_0x58b1f2[_0x5fb2('0x2c')](_0x268459)[_0x5fb2('0x3c')](_0x5c2887);};}exports[_0x5fb2('0x3d')]=function(_0x2beeb8,_0x2c071d){var _0x4ce76a={'include':[{'model':db[_0x5fb2('0x3e')],'as':_0x5fb2('0x3f')}]},_0x148284={},_0x1a364f={'count':0x0,'rows':[]};var _0x20307d=_[_0x5fb2('0x40')](db[_0x5fb2('0x41')][_0x5fb2('0x42')],function(_0x5e6351){return{'name':_0x5e6351[_0x5fb2('0x43')],'type':_0x5e6351[_0x5fb2('0x44')][_0x5fb2('0x45')]};});_0x148284['model']=_[_0x5fb2('0x40')](_0x20307d,_0x5fb2('0x3b'));_0x148284[_0x5fb2('0x46')]=_[_0x5fb2('0x47')](_0x2beeb8[_0x5fb2('0x46')]);_0x148284[_0x5fb2('0x48')]=_['intersection'](_0x148284[_0x5fb2('0x49')],_0x148284[_0x5fb2('0x46')]);_0x4ce76a[_0x5fb2('0x4a')]=_[_0x5fb2('0x4b')](_0x148284[_0x5fb2('0x49')],qs[_0x5fb2('0x4c')](_0x2beeb8[_0x5fb2('0x46')][_0x5fb2('0x4c')]));_0x4ce76a[_0x5fb2('0x4a')]=_0x4ce76a[_0x5fb2('0x4a')][_0x5fb2('0x4d')]?_0x4ce76a['attributes']:_0x148284['model'];if(!_0x2beeb8[_0x5fb2('0x46')][_0x5fb2('0x4e')](_0x5fb2('0x4f'))){_0x4ce76a['limit']=qs[_0x5fb2('0x30')](_0x2beeb8[_0x5fb2('0x46')][_0x5fb2('0x30')]);_0x4ce76a[_0x5fb2('0x2f')]=qs['offset'](_0x2beeb8[_0x5fb2('0x46')]['offset']);}_0x4ce76a[_0x5fb2('0x50')]=qs[_0x5fb2('0x51')](_0x2beeb8['query'][_0x5fb2('0x51')]);_0x4ce76a[_0x5fb2('0x52')]=qs[_0x5fb2('0x48')](_[_0x5fb2('0x53')](_0x2beeb8[_0x5fb2('0x46')],_0x148284[_0x5fb2('0x48')]),_0x20307d);if(_0x2beeb8[_0x5fb2('0x46')]['filter']){_0x4ce76a[_0x5fb2('0x52')]=_[_0x5fb2('0x54')](_0x4ce76a[_0x5fb2('0x52')],{'$or':_[_0x5fb2('0x40')](_0x20307d,function(_0x35f5d6){if(_0x35f5d6[_0x5fb2('0x44')]!=='VIRTUAL'){var _0x4d7741={};_0x4d7741[_0x35f5d6[_0x5fb2('0x3b')]]={'$like':'%'+_0x2beeb8[_0x5fb2('0x46')][_0x5fb2('0x55')]+'%'};return _0x4d7741;}})});}_0x4ce76a=_[_0x5fb2('0x54')]({},_0x4ce76a,_0x2beeb8[_0x5fb2('0x56')]);var _0xd016a5={'where':_0x4ce76a[_0x5fb2('0x52')]};return db['SmsAccount']['count'](_0xd016a5)[_0x5fb2('0x21')](function(_0x312f14){_0x1a364f['count']=_0x312f14;if(_0x2beeb8[_0x5fb2('0x46')][_0x5fb2('0x57')]){_0x4ce76a[_0x5fb2('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0x5fb2('0x59')](_0x4ce76a);})['then'](function(_0x2125a7){_0x1a364f[_0x5fb2('0x5a')]=_0x2125a7;return _0x1a364f;})[_0x5fb2('0x21')](respondWithFilteredResult(_0x2c071d,_0x4ce76a))[_0x5fb2('0x2a')](handleError(_0x2c071d,null));};exports[_0x5fb2('0x5b')]=function(_0x177201,_0x894d67){var _0x4cc8b7={'raw':![],'where':{'id':_0x177201['params']['id']},'include':[{'model':db[_0x5fb2('0x3e')],'as':_0x5fb2('0x3f')}]},_0x3b142f={};_0x3b142f[_0x5fb2('0x49')]=_[_0x5fb2('0x47')](db[_0x5fb2('0x41')][_0x5fb2('0x42')]);_0x3b142f[_0x5fb2('0x46')]=_[_0x5fb2('0x47')](_0x177201[_0x5fb2('0x46')]);_0x3b142f[_0x5fb2('0x48')]=_['intersection'](_0x3b142f[_0x5fb2('0x49')],_0x3b142f['query']);_0x4cc8b7[_0x5fb2('0x4a')]=_['intersection'](_0x3b142f[_0x5fb2('0x49')],qs['fields'](_0x177201[_0x5fb2('0x46')][_0x5fb2('0x4c')]));_0x4cc8b7[_0x5fb2('0x4a')]=_0x4cc8b7['attributes']['length']?_0x4cc8b7[_0x5fb2('0x4a')]:_0x3b142f[_0x5fb2('0x49')];if(_0x177201[_0x5fb2('0x46')]['includeAll']){_0x4cc8b7[_0x5fb2('0x58')]=[{'all':!![]}];}_0x4cc8b7=_[_0x5fb2('0x54')]({},_0x4cc8b7,_0x177201['options']);return db['SmsAccount'][_0x5fb2('0x5c')](_0x4cc8b7)[_0x5fb2('0x21')](handleEntityNotFound(_0x894d67,null))['then'](respondWithResult(_0x894d67,null))[_0x5fb2('0x2a')](handleError(_0x894d67,null));};exports[_0x5fb2('0x5d')]=function(_0x17fe36,_0xfacec2){return db[_0x5fb2('0x41')]['create'](_0x17fe36[_0x5fb2('0x5e')],{})[_0x5fb2('0x21')](function(_0x43df59){var _0x403146=_0x17fe36[_0x5fb2('0x5f')][_0x5fb2('0x38')]({'plain':!![]});if(!_0x403146)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x403146['role']===_0x5fb2('0x5f')){var _0xed3ca1=_0x43df59['get']({'plain':!![]});var _0x3f75c5='SmsAccounts';return db['UserProfileSection'][_0x5fb2('0x5c')]({'where':{'name':_0x3f75c5,'userProfileId':_0x403146['userProfileId']},'raw':!![]})[_0x5fb2('0x21')](function(_0x42ebcc){if(_0x42ebcc&&_0x42ebcc[_0x5fb2('0x60')]===0x0){return db[_0x5fb2('0x39')]['create']({'name':_0xed3ca1[_0x5fb2('0x3b')],'resourceId':_0xed3ca1['id'],'type':_0x42ebcc['name'],'sectionId':_0x42ebcc['id']},{})[_0x5fb2('0x21')](function(){return _0x43df59;});}else{return _0x43df59;}})[_0x5fb2('0x2a')](function(_0x2640e8){logger[_0x5fb2('0x25')](_0x5fb2('0x61'),_0x2640e8);throw _0x2640e8;});}return _0x43df59;})[_0x5fb2('0x21')](respondWithResult(_0xfacec2,0xc9))[_0x5fb2('0x2a')](handleError(_0xfacec2,null));};exports[_0x5fb2('0x37')]=function(_0x146b2e,_0x22c9fa){if(_0x146b2e['body']['id']){delete _0x146b2e[_0x5fb2('0x5e')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x146b2e['params']['id']},'include':[{'model':db['Pause'],'as':_0x5fb2('0x3f')}]})[_0x5fb2('0x21')](handleEntityNotFound(_0x22c9fa,null))[_0x5fb2('0x21')](saveUpdates(_0x146b2e['body'],null))[_0x5fb2('0x21')](respondWithResult(_0x22c9fa,null))[_0x5fb2('0x2a')](handleError(_0x22c9fa,null));};exports[_0x5fb2('0x62')]=function(_0x550ed5,_0x4b380f){return db['SmsAccount'][_0x5fb2('0x5c')]({'where':{'id':_0x550ed5[_0x5fb2('0x63')]['id']}})['then'](handleEntityNotFound(_0x4b380f,null))[_0x5fb2('0x21')](removeEntity(_0x4b380f,null))[_0x5fb2('0x2a')](handleError(_0x4b380f,null));};exports[_0x5fb2('0x64')]=function(_0x398441,_0x2d1ddd){return db[_0x5fb2('0x41')][_0x5fb2('0x64')]()[_0x5fb2('0x21')](respondWithResult(_0x2d1ddd,null))[_0x5fb2('0x2a')](handleError(_0x2d1ddd,null));};exports[_0x5fb2('0x65')]=function(_0x25f5da,_0x4740fc,_0x20a7c0){if(_0x25f5da[_0x5fb2('0x5e')]['id']){delete _0x25f5da['body']['id'];}return db[_0x5fb2('0x41')][_0x5fb2('0x5c')]({'where':{'id':_0x25f5da['params']['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x4740fc,null))[_0x5fb2('0x21')](function(_0x2b6c66){if(_0x2b6c66){_0x25f5da[_0x5fb2('0x5e')][_0x5fb2('0x66')]=_0x2b6c66['id'];return db[_0x5fb2('0x67')][_0x5fb2('0x5d')](_0x25f5da[_0x5fb2('0x5e')]);}})[_0x5fb2('0x21')](respondWithResult(_0x4740fc,null))['catch'](handleError(_0x4740fc,null));};exports[_0x5fb2('0x68')]=function(_0x4ac818,_0x4f610d,_0x4fc7b4){var _0x492e48={'raw':![],'where':{}};var _0x267906={};var _0x5d5a90={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5fb2('0x69')]({'where':{'id':_0x4ac818[_0x5fb2('0x63')]['id']}})['then'](handleEntityNotFound(_0x4f610d,null))[_0x5fb2('0x21')](function(_0x3b6619){if(_0x3b6619){_0x267906[_0x5fb2('0x49')]=_['keys'](db[_0x5fb2('0x67')][_0x5fb2('0x42')]);_0x267906[_0x5fb2('0x46')]=_['keys'](_0x4ac818['query']);_0x267906[_0x5fb2('0x48')]=_[_0x5fb2('0x4b')](_0x267906['model'],_0x267906[_0x5fb2('0x46')]);_0x492e48[_0x5fb2('0x4a')]=_['intersection'](_0x267906['model'],qs['fields'](_0x4ac818['query'][_0x5fb2('0x4c')]));_0x492e48['attributes']=_0x492e48[_0x5fb2('0x4a')][_0x5fb2('0x4d')]?_0x492e48[_0x5fb2('0x4a')]:_0x267906[_0x5fb2('0x49')];if(!_0x4ac818['query'][_0x5fb2('0x4e')](_0x5fb2('0x4f'))){_0x492e48['limit']=qs[_0x5fb2('0x30')](_0x4ac818[_0x5fb2('0x46')]['limit']);_0x492e48[_0x5fb2('0x2f')]=qs['offset'](_0x4ac818['query'][_0x5fb2('0x2f')]);}_0x492e48['order']=qs[_0x5fb2('0x51')](_0x4ac818[_0x5fb2('0x46')][_0x5fb2('0x51')]);_0x492e48[_0x5fb2('0x52')]=qs[_0x5fb2('0x48')](_[_0x5fb2('0x53')](_0x4ac818[_0x5fb2('0x46')],_0x267906['filters']));_0x492e48[_0x5fb2('0x52')][_0x5fb2('0x66')]=_0x3b6619['id'];if(_0x4ac818['query'][_0x5fb2('0x55')]){_0x492e48[_0x5fb2('0x52')]=_['merge'](_0x492e48[_0x5fb2('0x52')],{'$or':_['map'](_0x492e48[_0x5fb2('0x4a')],function(_0x388999){var _0x2ed1cd={};_0x2ed1cd[_0x388999]={'$like':'%'+_0x4ac818['query'][_0x5fb2('0x55')]+'%'};return _0x2ed1cd;})});}_0x492e48=_[_0x5fb2('0x54')]({},_0x492e48,_0x4ac818[_0x5fb2('0x56')]);return db[_0x5fb2('0x67')]['count']({'where':_0x492e48[_0x5fb2('0x52')]})[_0x5fb2('0x21')](function(_0x3738ce){_0x5d5a90[_0x5fb2('0x31')]=_0x3738ce;if(_0x4ac818[_0x5fb2('0x46')]['includeAll']){_0x492e48[_0x5fb2('0x58')]=[{'all':!![]}];}return db[_0x5fb2('0x67')]['findAll'](_0x492e48);})[_0x5fb2('0x21')](function(_0x4cf3cd){_0x5d5a90[_0x5fb2('0x5a')]=_0x4cf3cd;return _0x5d5a90;});}})['then'](respondWithFilteredResult(_0x4f610d,_0x492e48))['catch'](handleError(_0x4f610d,null));};exports[_0x5fb2('0x6a')]=function(_0x7d7924,_0x2b0812,_0xcc547b){return db['SmsAccount'][_0x5fb2('0x5c')]({'where':{'id':_0x7d7924[_0x5fb2('0x63')]['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x2b0812,null))['then'](function(_0x1fdb4d){if(_0x1fdb4d){return _0x1fdb4d[_0x5fb2('0x6a')](_0x7d7924[_0x5fb2('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x2b0812,null))[_0x5fb2('0x2a')](handleError(_0x2b0812,null));};exports[_0x5fb2('0x6b')]=function(_0x3f6993,_0x28b7cc,_0x3612fd){if(_0x3f6993[_0x5fb2('0x5e')]['id']){delete _0x3f6993[_0x5fb2('0x5e')]['id'];}return db[_0x5fb2('0x41')]['find']({'where':{'id':_0x3f6993['params']['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x28b7cc,null))[_0x5fb2('0x21')](function(_0x5da1f3){if(_0x5da1f3){_0x3f6993[_0x5fb2('0x5e')][_0x5fb2('0x66')]=_0x5da1f3['id'];return db[_0x5fb2('0x6c')][_0x5fb2('0x5d')](_0x3f6993['body']);}})[_0x5fb2('0x21')](respondWithResult(_0x28b7cc,null))[_0x5fb2('0x2a')](handleError(_0x28b7cc,null));};exports['getAnswers']=function(_0x1fabf,_0x1b193f,_0x21b663){var _0x1d6f36={'raw':![],'where':{}};var _0x27142c={};var _0x108761={'count':0x0,'rows':[]};return db[_0x5fb2('0x41')]['findOne']({'where':{'id':_0x1fabf[_0x5fb2('0x63')]['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x1b193f,null))[_0x5fb2('0x21')](function(_0x473a12){if(_0x473a12){_0x27142c[_0x5fb2('0x49')]=_[_0x5fb2('0x47')](db[_0x5fb2('0x6c')][_0x5fb2('0x42')]);_0x27142c[_0x5fb2('0x46')]=_['keys'](_0x1fabf[_0x5fb2('0x46')]);_0x27142c[_0x5fb2('0x48')]=_[_0x5fb2('0x4b')](_0x27142c[_0x5fb2('0x49')],_0x27142c[_0x5fb2('0x46')]);_0x1d6f36[_0x5fb2('0x4a')]=_[_0x5fb2('0x4b')](_0x27142c['model'],qs['fields'](_0x1fabf['query'][_0x5fb2('0x4c')]));_0x1d6f36['attributes']=_0x1d6f36[_0x5fb2('0x4a')][_0x5fb2('0x4d')]?_0x1d6f36[_0x5fb2('0x4a')]:_0x27142c[_0x5fb2('0x49')];if(!_0x1fabf['query'][_0x5fb2('0x4e')](_0x5fb2('0x4f'))){_0x1d6f36[_0x5fb2('0x30')]=qs[_0x5fb2('0x30')](_0x1fabf[_0x5fb2('0x46')][_0x5fb2('0x30')]);_0x1d6f36['offset']=qs[_0x5fb2('0x2f')](_0x1fabf['query'][_0x5fb2('0x2f')]);}_0x1d6f36['order']=qs[_0x5fb2('0x51')](_0x1fabf[_0x5fb2('0x46')]['sort']);_0x1d6f36[_0x5fb2('0x52')]=qs['filters'](_['pick'](_0x1fabf['query'],_0x27142c['filters']));_0x1d6f36['where'][_0x5fb2('0x66')]=_0x473a12['id'];if(_0x1fabf[_0x5fb2('0x46')]['filter']){_0x1d6f36[_0x5fb2('0x52')]=_[_0x5fb2('0x54')](_0x1d6f36[_0x5fb2('0x52')],{'$or':_[_0x5fb2('0x40')](_0x1d6f36['attributes'],function(_0x201d1b){var _0x59ab70={};_0x59ab70[_0x201d1b]={'$like':'%'+_0x1fabf[_0x5fb2('0x46')]['filter']+'%'};return _0x59ab70;})});}_0x1d6f36=_['merge']({},_0x1d6f36,_0x1fabf[_0x5fb2('0x56')]);return db[_0x5fb2('0x6c')]['count']({'where':_0x1d6f36[_0x5fb2('0x52')]})[_0x5fb2('0x21')](function(_0x301791){_0x108761[_0x5fb2('0x31')]=_0x301791;if(_0x1fabf['query'][_0x5fb2('0x57')]){_0x1d6f36[_0x5fb2('0x58')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1d6f36);})['then'](function(_0x150f76){_0x108761[_0x5fb2('0x5a')]=_0x150f76;return _0x108761;});}})['then'](respondWithFilteredResult(_0x1b193f,_0x1d6f36))[_0x5fb2('0x2a')](handleError(_0x1b193f,null));};exports[_0x5fb2('0x6d')]=function(_0x35daf8,_0x209962,_0x59d0b3){return db[_0x5fb2('0x41')]['find']({'where':{'id':_0x35daf8[_0x5fb2('0x63')]['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x209962,null))[_0x5fb2('0x21')](function(_0x2c70f0){if(_0x2c70f0){return _0x2c70f0[_0x5fb2('0x6d')](_0x35daf8[_0x5fb2('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x209962,null))[_0x5fb2('0x2a')](handleError(_0x209962,null));};exports[_0x5fb2('0x6e')]=function(_0x4e61da,_0xb5af07,_0x2ab08b){var _0x4f7570={'channel':_0x5fb2('0x6f')};var _0x2756b1=[];var _0x397084=[];var _0x4e9bea={};return db[_0x5fb2('0x41')][_0x5fb2('0x5c')]({'where':{'id':_0x4e61da[_0x5fb2('0x63')]['id']},'include':[{'model':db[_0x5fb2('0x70')],'as':_0x5fb2('0x71')}]})['then'](handleEntityNotFound(_0xb5af07,null))['then'](function(_0x414951){_0x4f7570['account']=_0x414951;_0x4f7570['applications']=_[_0x5fb2('0x72')](_0x414951[_0x5fb2('0x71')],[_0x5fb2('0x73')],[_0x5fb2('0x74')]);if(_0x4f7570[_0x5fb2('0x75')][_0x5fb2('0x71')]){delete _0x4f7570[_0x5fb2('0x75')]['Applications'];}return db[_0x5fb2('0x76')][_0x5fb2('0x64')]();})[_0x5fb2('0x21')](function(_0x3e9814){if(!_0x3e9814){throw new db['Sequelize'][(_0x5fb2('0x77'))](_0x5fb2('0x78'));}_0x2756b1=_[_0x5fb2('0x79')](_[_0x5fb2('0x47')](_0x3e9814),['createdAt',_0x5fb2('0x7a')]);_0x397084=_[_0x5fb2('0x79')](_[_0x5fb2('0x47')](_0x3e9814),[_0x5fb2('0x7b'),'updatedAt',_0x5fb2('0x7c'),'ListId']);_0x4f7570[_0x5fb2('0x5e')]={'mapKey':_0x5fb2('0x7d')};if(_0x4f7570[_0x5fb2('0x75')][_0x5fb2('0x44')]){switch(_0x4f7570[_0x5fb2('0x75')][_0x5fb2('0x44')]){case _0x5fb2('0x7e'):_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x80')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x81')];_0x4f7570['body'][_0x5fb2('0x82')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x83')];break;case _0x5fb2('0x84'):_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]='+'+_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x85')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x86')];break;case _0x5fb2('0x87'):_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x7f')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x28')];break;case _0x5fb2('0x88'):_0x4f7570['body'][_0x5fb2('0x7f')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x7f')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da[_0x5fb2('0x5e')]['body'];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x82')]=_0x4e61da['body'][_0x5fb2('0x89')];break;case _0x5fb2('0x8a'):_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x80')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x8b')];_0x4f7570[_0x5fb2('0x5e')]['messageId']=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x8c')];break;case _0x5fb2('0x8d'):_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]='+'+_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x8e')][0x0][_0x5fb2('0x7f')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da['body'][_0x5fb2('0x8e')][0x0]['text'];_0x4f7570['body'][_0x5fb2('0x82')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x8e')][0x0][_0x5fb2('0x82')];break;case'csc':_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x8f')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da['body'][_0x5fb2('0x90')]['message'];break;case _0x5fb2('0x91'):_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x92')];_0x4f7570[_0x5fb2('0x5e')]['body']=_0x4e61da['body'][_0x5fb2('0x86')];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x82')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x93')];break;case _0x5fb2('0x94'):_0x4f7570[_0x5fb2('0x5e')]['messageId']=_0x4e61da[_0x5fb2('0x5e')][0x0][_0x5fb2('0x28')]['id'];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]=_0x4e61da['body'][0x0][_0x5fb2('0x28')]['from'];_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]=_0x4e61da[_0x5fb2('0x5e')][0x0][_0x5fb2('0x28')]['text'];break;case _0x5fb2('0x95'):_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')]=_0x4e61da[_0x5fb2('0x5e')][_0x5fb2('0x7f')];_0x4f7570['body'][_0x5fb2('0x5e')]=_0x4e61da['body'][_0x5fb2('0x28')];_0x4f7570['body'][_0x5fb2('0x82')]=_0x4e61da[_0x5fb2('0x5e')]['refid'];break;}}if(_0x4f7570[_0x5fb2('0x5e')]['id']){delete _0x4f7570[_0x5fb2('0x5e')]['id'];}if(_[_0x5fb2('0x96')](_0x4f7570['body']['from'])){throw new db[(_0x5fb2('0x97'))][(_0x5fb2('0x77'))](_0x5fb2('0x98'));}if(_[_0x5fb2('0x96')](_0x4f7570['body'][_0x5fb2('0x5e')])||_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')]===''){throw new db[(_0x5fb2('0x97'))][(_0x5fb2('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5fb2('0x96')](_0x4f7570[_0x5fb2('0x5e')]['mapKey'])){throw new db[(_0x5fb2('0x97'))][(_0x5fb2('0x77'))](_0x5fb2('0x99')+_0x397084);}if(!_['includes'](_0x397084,_0x4f7570[_0x5fb2('0x5e')]['mapKey'])){throw new db[(_0x5fb2('0x97'))]['ValidationError'](_0x5fb2('0x9a')+_0x397084);}_0x4e9bea[_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x9b')]]=_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')];return db['CmList'][_0x5fb2('0x5c')]({'where':{'id':_0x4f7570[_0x5fb2('0x75')][_0x5fb2('0x9c')]},'include':[{'model':db[_0x5fb2('0x76')],'as':_0x5fb2('0x9d'),'where':_0x4e9bea,'limit':0x1,'order':[[_0x5fb2('0x7a'),'DESC']]}]});})[_0x5fb2('0x21')](handleEntityNotFound(_0xb5af07,null))[_0x5fb2('0x21')](function(_0x337f5b){if(_0x337f5b){_0x4f7570[_0x5fb2('0x9e')]=_[_0x5fb2('0x9f')](_0x337f5b,[_0x5fb2('0x9d')]);if(_0x337f5b[_0x5fb2('0x9d')][_0x5fb2('0x4d')]){return _0x337f5b['Contacts'][0x0];}var _0x143ddf=_[_0x5fb2('0x1a')](_0x4f7570[_0x5fb2('0x5e')],{'firstName':_0x4f7570['body'][_0x5fb2('0x7f')],'ListId':_0x337f5b['id']});_0x143ddf[_0x4f7570['body']['mapKey']]=_0x4f7570[_0x5fb2('0x5e')]['from'];return db['CmContact'][_0x5fb2('0x5d')](_0x143ddf,{'fields':_0x2756b1,'raw':!![]});}})[_0x5fb2('0x21')](handleEntityNotFound(_0xb5af07,null))['then'](function(_0x995808){if(_0x995808){_0x4f7570['contact']=_0x995808;var _0x1fad36={'ContactId':_0x995808['id'],'phone':_0x4f7570[_0x5fb2('0x5e')]['from'],'SmsAccountId':_0x4e61da[_0x5fb2('0x63')]['id']};var _0x342e4c={'ContactId':_0x995808['id'],'SmsAccountId':_0x4e61da['params']['id'],'closed':![]};return db['SmsInteraction'][_0x5fb2('0x5c')]({'where':_0x342e4c})[_0x5fb2('0x21')](function(_0x9d9874){if(_0x9d9874){return[_0x9d9874,![]];}return db['SmsInteraction'][_0x5fb2('0x5d')](_0x1fad36)[_0x5fb2('0x21')](function(_0x4097b3){return[_0x4097b3,!![]];});});}})[_0x5fb2('0xa0')](function(_0x388b51,_0x1f0b07){_0x4f7570[_0x5fb2('0xa1')]=_0x388b51[_0x5fb2('0x38')]({'plain':!![]});_0x4f7570[_0x5fb2('0xa1')][_0x5fb2('0xa2')]=![];if(_0x1f0b07){if(_0x4f7570[_0x5fb2('0x75')]['autoclose']){_0x4f7570[_0x5fb2('0xa3')][_0x5fb2('0xa4')]({'id':0x0,'priority':_0x4f7570[_0x5fb2('0xa3')][_0x5fb2('0x4d')]+0x1,'app':_0x5fb2('0xa5'),'appdata':_0x5fb2('0xa6'),'interval':_0x5fb2('0xa7')});}_0x4f7570[_0x5fb2('0xa1')][_0x5fb2('0xa2')]=!![];}return db['SmsMessage'][_0x5fb2('0x5d')]({'phone':_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x7f')],'messageId':_0x4f7570[_0x5fb2('0x5e')]['messageId'],'body':_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0x5e')],'SmsAccountId':_0x4e61da['params']['id'],'SmsInteractionId':_0x388b51['id'],'direction':'in','ContactId':_0x388b51[_0x5fb2('0xa8')],'AttachmentId':_0x4f7570[_0x5fb2('0x5e')][_0x5fb2('0xa9')]});})[_0x5fb2('0x21')](function(_0xa27148){_0x4f7570['message']=_0xa27148;if(_0x4f7570[_0x5fb2('0xa1')][_0x5fb2('0xaa')]){return db[_0x5fb2('0xab')][_0x5fb2('0x5c')]({'attributes':['id',_0x5fb2('0x3b')],'where':{'id':_0x4f7570[_0x5fb2('0xa1')][_0x5fb2('0xaa')]}})['then'](function(_0x25022e){if(_0x25022e){_0x4f7570['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x5fb2('0xac'),'appdata':_0x25022e[_0x5fb2('0x3b')]+','+(_0x4f7570['account'][_0x5fb2('0xad')]||0xa),'interval':_0x5fb2('0xa7')});}return respondWithRpcPromise(_0x5fb2('0xae'),'startRouting',_0x4f7570);});}return respondWithRpcPromise(_0x5fb2('0xae'),_0x5fb2('0xaf'),_0x4f7570);})[_0x5fb2('0x21')](function(_0x38a64e){if(_0x38a64e){var _0x4b4f98=0xc8;var _0x56146e='receiveMessage';logger[_0x5fb2('0x22')](_0x5fb2('0x24'),_0x56146e,_0x4b4f98,_0x5fb2('0xb0'));logger['debug'](_0x5fb2('0xb1'),_0x56146e,_0x4b4f98,_0x5fb2('0xb0'),JSON['stringify'](_0x38a64e));if(_0x4f7570[_0x5fb2('0x75')][_0x5fb2('0x44')]===_0x5fb2('0x7e')){return _0xb5af07[_0x5fb2('0x2c')](_0x4b4f98)[_0x5fb2('0x32')](_0x5fb2('0xb2'),_0x5fb2('0xb3'))['send'](_0x5fb2('0xb4'));}else{return _0xb5af07[_0x5fb2('0x2c')](_0x4b4f98)[_0x5fb2('0x2e')](_0x38a64e);}}})['catch'](handleError(_0xb5af07,null));};exports[_0x5fb2('0xb5')]=function(_0x3a4169,_0x594ecd){var _0x32de72=_0x3a4169['params']['id'];var _0x26c446=_0x3a4169[_0x5fb2('0x5e')];var _0x1e0992=0xc8;var _0x44d4bd=null;return db[_0x5fb2('0xb6')]['transaction']({'isolationLevel':db[_0x5fb2('0xb6')][_0x5fb2('0xb7')][_0x5fb2('0xb8')][_0x5fb2('0xb9')]},function(_0x182d3d){return db[_0x5fb2('0x41')][_0x5fb2('0x69')]({'where':{'id':_0x32de72},'transaction':_0x182d3d})[_0x5fb2('0x21')](function(_0x4b437b){if(_0x4b437b){return db[_0x5fb2('0x70')][_0x5fb2('0x62')]({'where':{'SmsAccountId':_0x32de72},'transaction':_0x182d3d})[_0x5fb2('0x21')](function(){var _0x5104a3=_[_0x5fb2('0x40')](_0x26c446,function(_0x5501d4){_0x5501d4[_0x5fb2('0x66')]=_0x32de72;return _0x5501d4;});return db[_0x5fb2('0x70')][_0x5fb2('0xba')](_0x5104a3,{'transaction':_0x182d3d});});}else{_0x1e0992=0x194;_0x44d4bd=[];}});})['then'](function(){if(_0x1e0992!==0x194){return db[_0x5fb2('0x70')][_0x5fb2('0xbb')]({'where':{'SmsAccountId':_0x32de72},'order':'priority'})[_0x5fb2('0x21')](function(_0x1d3d7f){_0x44d4bd=_0x1d3d7f;});}})[_0x5fb2('0x2a')](function(_0x41a8eb){_0x1e0992=0x1f4;logger['error'](_0x41a8eb[_0x5fb2('0x3a')]);if(_0x41a8eb[_0x5fb2('0x3b')]){delete _0x41a8eb[_0x5fb2('0x3b')];}_0x44d4bd=_0x41a8eb;})[_0x5fb2('0xbc')](function(){if(_0x44d4bd===null){_0x594ecd[_0x5fb2('0x2b')](_0x1e0992);}else{if(_0x1e0992===0x1f4){_0x594ecd['status'](_0x1e0992)['send'](_0x44d4bd);}else{_0x594ecd['status'](_0x1e0992)[_0x5fb2('0x2e')](_0x44d4bd);}}});};exports[_0x5fb2('0xbd')]=function(_0x117b54,_0x2566ee,_0x386d14){var _0x3082ce={};var _0x5c2979={};var _0x333121;var _0x4349b1;return db[_0x5fb2('0x41')][_0x5fb2('0x69')]({'where':{'id':_0x117b54[_0x5fb2('0x63')]['id']}})['then'](handleEntityNotFound(_0x2566ee,null))['then'](function(_0x1164ad){if(_0x1164ad){_0x333121=_0x1164ad;_0x5c2979[_0x5fb2('0x49')]=_[_0x5fb2('0x47')](db[_0x5fb2('0x70')][_0x5fb2('0x42')]);_0x5c2979[_0x5fb2('0x46')]=_[_0x5fb2('0x47')](_0x117b54[_0x5fb2('0x46')]);_0x5c2979[_0x5fb2('0x48')]=_['intersection'](_0x5c2979['model'],_0x5c2979[_0x5fb2('0x46')]);_0x3082ce[_0x5fb2('0x4a')]=_[_0x5fb2('0x4b')](_0x5c2979[_0x5fb2('0x49')],qs[_0x5fb2('0x4c')](_0x117b54[_0x5fb2('0x46')][_0x5fb2('0x4c')]));_0x3082ce[_0x5fb2('0x4a')]=_0x3082ce[_0x5fb2('0x4a')][_0x5fb2('0x4d')]?_0x3082ce[_0x5fb2('0x4a')]:_0x5c2979[_0x5fb2('0x49')];_0x3082ce[_0x5fb2('0x50')]=qs[_0x5fb2('0x51')](_0x117b54['query'][_0x5fb2('0x51')]);_0x3082ce[_0x5fb2('0x52')]=qs[_0x5fb2('0x48')](_[_0x5fb2('0x53')](_0x117b54[_0x5fb2('0x46')],_0x5c2979[_0x5fb2('0x48')]));if(_0x117b54[_0x5fb2('0x46')][_0x5fb2('0x55')]){_0x3082ce[_0x5fb2('0x52')]=_[_0x5fb2('0x54')](_0x3082ce['where'],{'$or':_[_0x5fb2('0x40')](_0x3082ce[_0x5fb2('0x4a')],function(_0x585ec8){var _0x360afd={};_0x360afd[_0x585ec8]={'$like':'%'+_0x117b54[_0x5fb2('0x46')][_0x5fb2('0x55')]+'%'};return _0x360afd;})});}_0x3082ce=_[_0x5fb2('0x54')]({},_0x3082ce,_0x117b54[_0x5fb2('0x56')]);return _0x333121[_0x5fb2('0xbd')](_0x3082ce);}})[_0x5fb2('0x21')](function(_0xd93576){if(_0xd93576){_0x4349b1=_0xd93576[_0x5fb2('0x4d')];if(!_0x117b54[_0x5fb2('0x46')]['hasOwnProperty'](_0x5fb2('0x4f'))){_0x3082ce[_0x5fb2('0x30')]=qs[_0x5fb2('0x30')](_0x117b54[_0x5fb2('0x46')]['limit']);_0x3082ce[_0x5fb2('0x2f')]=qs[_0x5fb2('0x2f')](_0x117b54[_0x5fb2('0x46')][_0x5fb2('0x2f')]);}return _0x333121[_0x5fb2('0xbd')](_0x3082ce);}})[_0x5fb2('0x21')](function(_0x3fde7f){if(_0x3fde7f){return _0x3fde7f?{'count':_0x4349b1,'rows':_0x3fde7f}:null;}})['then'](respondWithResult(_0x2566ee,null))[_0x5fb2('0x2a')](handleError(_0x2566ee,null));};exports[_0x5fb2('0xbe')]=function(_0x7427b6,_0x40d261,_0x1d043d){var _0x1f1eaa={'raw':![],'where':{}};var _0x50523f={};var _0x2df45d={'count':0x0,'rows':[]};return db[_0x5fb2('0x41')][_0x5fb2('0x69')]({'where':{'id':_0x7427b6['params']['id']}})['then'](handleEntityNotFound(_0x40d261,null))[_0x5fb2('0x21')](function(_0x9095b5){if(_0x9095b5){_0x50523f[_0x5fb2('0x49')]=_['keys'](db[_0x5fb2('0xbf')][_0x5fb2('0x42')]);_0x50523f[_0x5fb2('0x46')]=_[_0x5fb2('0x47')](_0x7427b6[_0x5fb2('0x46')]);_0x50523f[_0x5fb2('0x48')]=_[_0x5fb2('0x4b')](_0x50523f[_0x5fb2('0x49')],_0x50523f['query']);_0x1f1eaa[_0x5fb2('0x4a')]=_[_0x5fb2('0x4b')](_0x50523f[_0x5fb2('0x49')],qs[_0x5fb2('0x4c')](_0x7427b6[_0x5fb2('0x46')][_0x5fb2('0x4c')]));_0x1f1eaa[_0x5fb2('0x4a')]=_0x1f1eaa[_0x5fb2('0x4a')][_0x5fb2('0x4d')]?_0x1f1eaa[_0x5fb2('0x4a')]:_0x50523f[_0x5fb2('0x49')];if(!_0x7427b6[_0x5fb2('0x46')]['hasOwnProperty'](_0x5fb2('0x4f'))){_0x1f1eaa[_0x5fb2('0x30')]=qs[_0x5fb2('0x30')](_0x7427b6[_0x5fb2('0x46')][_0x5fb2('0x30')]);_0x1f1eaa[_0x5fb2('0x2f')]=qs[_0x5fb2('0x2f')](_0x7427b6['query'][_0x5fb2('0x2f')]);}_0x1f1eaa[_0x5fb2('0x50')]=qs[_0x5fb2('0x51')](_0x7427b6[_0x5fb2('0x46')][_0x5fb2('0x51')]);_0x1f1eaa[_0x5fb2('0x52')]=qs[_0x5fb2('0x48')](_[_0x5fb2('0x53')](_0x7427b6[_0x5fb2('0x46')],_0x50523f['filters']));_0x1f1eaa[_0x5fb2('0x52')]['SmsAccountId']=_0x9095b5['id'];if(_0x7427b6[_0x5fb2('0x46')]['filter']){_0x1f1eaa[_0x5fb2('0x52')]=_[_0x5fb2('0x54')](_0x1f1eaa[_0x5fb2('0x52')],{'$or':_[_0x5fb2('0x40')](_0x1f1eaa['attributes'],function(_0x8ae0f3){var _0x392c93={};_0x392c93[_0x8ae0f3]={'$like':'%'+_0x7427b6[_0x5fb2('0x46')]['filter']+'%'};return _0x392c93;})});}_0x1f1eaa=_[_0x5fb2('0x54')]({},_0x1f1eaa,_0x7427b6[_0x5fb2('0x56')]);return db[_0x5fb2('0xbf')][_0x5fb2('0x31')]({'where':_0x1f1eaa['where']})['then'](function(_0xf55262){_0x2df45d['count']=_0xf55262;if(_0x7427b6[_0x5fb2('0x46')][_0x5fb2('0x57')]){_0x1f1eaa[_0x5fb2('0x58')]=[{'model':db['CmContact'],'as':_0x5fb2('0xc0'),'required':![]},{'model':db[_0x5fb2('0xab')],'as':'Owner','attributes':[_0x5fb2('0x3b'),_0x5fb2('0xc1'),_0x5fb2('0xc2')],'required':![]},{'model':db[_0x5fb2('0xc3')],'as':_0x5fb2('0xc4'),'attributes':['id',_0x5fb2('0x3b'),_0x5fb2('0xc5')],'where':_0x7427b6[_0x5fb2('0x46')][_0x5fb2('0xc6')]?{'id':_0x7427b6['query'][_0x5fb2('0xc6')]}:undefined,'required':_0x7427b6['query'][_0x5fb2('0xc6')]?!![]:![]}];}return db[_0x5fb2('0xbf')]['findAll'](_0x1f1eaa);})[_0x5fb2('0x21')](function(_0x15fd0c){_0x2df45d[_0x5fb2('0x5a')]=_0x15fd0c;return _0x2df45d;});}})[_0x5fb2('0x21')](respondWithFilteredResult(_0x40d261,_0x1f1eaa))['catch'](handleError(_0x40d261,null));};exports[_0x5fb2('0x3c')]=function(_0x27aac1,_0x4fb766,_0x3cf19d){var _0x3f78a2,_0x4affef,_0x47b7d3;if(_['isNil'](_0x27aac1[_0x5fb2('0x5e')][_0x5fb2('0x5e')])||_0x27aac1[_0x5fb2('0x5e')][_0x5fb2('0x5e')]===''){throw new db[(_0x5fb2('0x97'))][(_0x5fb2('0x77'))](_0x5fb2('0xc7'));}if(_[_0x5fb2('0x96')](_0x27aac1[_0x5fb2('0x5e')]['to'])){throw new db[(_0x5fb2('0x97'))][(_0x5fb2('0x77'))]('to\x20is\x20mandatory');}_0x3f78a2=_0x27aac1[_0x5fb2('0x5e')]['to'];return db[_0x5fb2('0x41')]['find']({'where':{'id':_0x27aac1[_0x5fb2('0x63')]['id']},'include':[{'model':db[_0x5fb2('0xc8')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x3f78a2},'limit':0x1,'order':[[_0x5fb2('0x7a'),'DESC']]}]}]})[_0x5fb2('0x21')](handleEntityNotFound(_0x4fb766,null))[_0x5fb2('0x21')](function(_0x28bdfb){if(_0x28bdfb&&_0x28bdfb[_0x5fb2('0xc9')]){_0x4affef=_0x28bdfb['get']({'plain':!![]});if(_0x4affef[_0x5fb2('0xc9')]&&_0x4affef[_0x5fb2('0xc9')][_0x5fb2('0x9d')][_0x5fb2('0x4d')]){return _0x4affef[_0x5fb2('0xc9')][_0x5fb2('0x9d')][0x0];}return db[_0x5fb2('0x76')]['create'](_[_0x5fb2('0x1a')](_0x27aac1[_0x5fb2('0x5e')],{'firstName':_0x3f78a2,'mobile':_0x3f78a2,'phone':_0x3f78a2,'ListId':_0x4affef[_0x5fb2('0x9c')]}));}})[_0x5fb2('0x21')](handleEntityNotFound(_0x4fb766,null))['then'](function(_0x73383c){if(_0x73383c){_0x47b7d3=_0x73383c;return db[_0x5fb2('0xbf')][_0x5fb2('0x5c')]({'where':{'ContactId':_0x47b7d3['id'],'closed':![],'SmsAccountId':_0x4affef['id']}})[_0x5fb2('0x21')](function(_0x171449){if(_0x171449){return[_0x171449,![]];}return db[_0x5fb2('0xbf')][_0x5fb2('0x5d')]({'UserId':_0x27aac1[_0x5fb2('0x5f')]['id'],'ContactId':_0x47b7d3['id'],'SmsAccountId':_0x4affef['id'],'phone':_0x3f78a2,'firstMsgDirection':_0x5fb2('0xca'),'Messages':[_[_0x5fb2('0x54')](_0x27aac1['body'],{'read':![],'body':_0x27aac1['body'][_0x5fb2('0x5e')],'phone':_0x3f78a2,'SmsAccountId':_0x4affef['id'],'UserId':_0x27aac1['user']['id'],'ContactId':_0x47b7d3['id']})]},{'include':[{'model':db[_0x5fb2('0xcb')],'as':_0x5fb2('0xcc')}]})[_0x5fb2('0x21')](function(_0x19e4b4){return[_0x19e4b4,!![]];});});}})['spread'](function(_0x299cb4,_0x4c1267){if(_0x4c1267){return _0x299cb4;}return db[_0x5fb2('0xcb')]['create'](_[_0x5fb2('0x54')](_0x27aac1[_0x5fb2('0x5e')],{'read':![],'body':_0x27aac1['body']['body'],'phone':_0x3f78a2,'SmsAccountId':_0x4affef['id'],'SmsInteractionId':_0x299cb4['id'],'UserId':_0x27aac1['user']['id'],'ContactId':_0x47b7d3['id']}))[_0x5fb2('0x21')](function(_0x541fca){_0x299cb4[_0x5fb2('0xcd')][_0x5fb2('0xcc')]=[];_0x299cb4[_0x5fb2('0xcd')][_0x5fb2('0xcc')][_0x5fb2('0xa4')](_0x541fca[_0x5fb2('0xcd')]);return _0x299cb4;});})[_0x5fb2('0x21')](respondWithResult(_0x4fb766,null))[_0x5fb2('0x2a')](handleError(_0x4fb766,null));};exports['status']=function(_0x215dfe,_0x1b8113,_0x21d49f){if(_0x215dfe[_0x5fb2('0x5e')]['id']){delete _0x215dfe[_0x5fb2('0x5e')]['id'];}var _0x2e851e,_0x122e5e,_0x12a4cb;return db[_0x5fb2('0x41')]['find']({'where':{'id':_0x215dfe[_0x5fb2('0x63')]['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x1b8113,null))[_0x5fb2('0x21')](function(_0x4cd087){if(_0x4cd087){_0x12a4cb=_0x4cd087;logger[_0x5fb2('0xce')](_0x5fb2('0x24'),_0x5fb2('0x2c'),_0x5fb2('0xcf'),_0x4cd087['type'],util[_0x5fb2('0xd0')](_0x215dfe[_0x5fb2('0x5e')],{'showHidden':![],'depth':null}));switch(_0x4cd087[_0x5fb2('0x44')]){case _0x5fb2('0x84'):if(_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd1')]&&_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0x2c')]){_0x122e5e=_0x215dfe['body'][_0x5fb2('0x2c')];return db['SmsMessage'][_0x5fb2('0x5c')]({'where':{'messageId':_0x215dfe[_0x5fb2('0x5e')]['skebby_dispatch_id']}});}break;case _0x5fb2('0x87'):if(_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd2')]&&_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd3')]){_0x122e5e=_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd3')];return db[_0x5fb2('0xcb')][_0x5fb2('0x5c')]({'where':{'messageId':_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd2')]}});}break;case _0x5fb2('0x88'):if(_0x215dfe['body'][_0x5fb2('0x89')]&&_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd4')]){_0x122e5e=_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd4')];return db[_0x5fb2('0xcb')]['find']({'where':{'messageId':_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0x89')]}});}break;case'infobip':var _0x1fa175=_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0x8e')][0x0];if(_0x1fa175['messageId']&&_0x1fa175[_0x5fb2('0x2c')]['groupName']==='DELIVERED'){_0x122e5e=_0x1fa175[_0x5fb2('0x2c')][_0x5fb2('0xd5')];return db[_0x5fb2('0xcb')][_0x5fb2('0x5c')]({'where':{'messageId':_0x1fa175[_0x5fb2('0x82')]}});}break;case _0x5fb2('0x91'):if(_0x215dfe['body']['messageId']&&_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0x2c')]){_0x122e5e=_0x215dfe[_0x5fb2('0x5e')]['status'];return db[_0x5fb2('0xcb')][_0x5fb2('0x5c')]({'where':{'messageId':_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0x82')]}});}break;case _0x5fb2('0x94'):if(_0x215dfe[_0x5fb2('0x5e')][0x0]['message']['id']){_0x122e5e=_0x215dfe[_0x5fb2('0x5e')][0x0][_0x5fb2('0x44')];return db[_0x5fb2('0xcb')][_0x5fb2('0x5c')]({'where':{'messageId':_0x215dfe['body'][0x0]['message']['id']}});}break;case _0x5fb2('0x95'):if(_0x215dfe['body']['redif']&&_0x215dfe['body'][_0x5fb2('0x2c')]){_0x122e5e=_0x215dfe[_0x5fb2('0x5e')]['status'];return db['SmsMessage'][_0x5fb2('0x5c')]({'where':{'messageId':_0x215dfe['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x1b8113,null))[_0x5fb2('0x21')](function(_0xa4a5d5){if(_0xa4a5d5){_0x2e851e=_0xa4a5d5;switch(_0x12a4cb[_0x5fb2('0x44')]){case'skebby':if(_0x122e5e==='DELIVERED'){return _0x2e851e[_0x5fb2('0x37')]({'read':!![]});}else{logger[_0x5fb2('0x25')](_0x5fb2('0x24'),'status',_0x5fb2('0x84'),util[_0x5fb2('0xd0')](_0x215dfe['body'],{'showHidden':![],'depth':null}));}break;case _0x5fb2('0x87'):if(_0x122e5e==='1'){return _0x2e851e[_0x5fb2('0x37')]({'read':!![]});}else{logger['error'](_0x5fb2('0x24'),_0x5fb2('0x2c'),_0x5fb2('0x84'),util['inspect'](_0x215dfe['body'],{'showHidden':![],'depth':null}));}break;case _0x5fb2('0x88'):if(!_0x215dfe[_0x5fb2('0x5e')][_0x5fb2('0xd6')]&&_0x122e5e>=0xc8&&_0x122e5e<=0xce){return _0x2e851e[_0x5fb2('0x37')]({'read':!![]});}else{logger['error'](_0x5fb2('0x24'),_0x5fb2('0x2c'),'clicksend',util[_0x5fb2('0xd0')](_0x215dfe[_0x5fb2('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5fb2('0x8d'):var _0x106609=_0x215dfe[_0x5fb2('0x5e')]['results'][0x0];if(_0x106609['status'][_0x5fb2('0xd5')]==='DELIVERED'){return _0x2e851e[_0x5fb2('0x37')]({'read':!![]});}else{logger[_0x5fb2('0x25')](_0x5fb2('0x24'),_0x5fb2('0x2c'),'infobip',util[_0x5fb2('0xd0')](_0x215dfe[_0x5fb2('0x5e')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x122e5e==_0x5fb2('0xd7')||_0x122e5e==_0x5fb2('0xd8')){return _0x2e851e[_0x5fb2('0x37')]({'read':!![]});}else{logger[_0x5fb2('0x25')](_0x5fb2('0x24'),_0x5fb2('0x2c'),'clickatell',util[_0x5fb2('0xd0')](_0x215dfe[_0x5fb2('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5fb2('0x94'):if(_0x122e5e==_0x5fb2('0xd9')){return _0x2e851e[_0x5fb2('0x37')]({'read':!![]});}else{logger[_0x5fb2('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5fb2('0x2c'),_0x5fb2('0x94'),util['inspect'](_0x215dfe[_0x5fb2('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5fb2('0x95'):if(_0x122e5e===_0x5fb2('0xda')||_0x122e5e===_0x5fb2('0xdb')){return _0x2e851e[_0x5fb2('0x37')]({'read':!![]});}else{logger[_0x5fb2('0x25')](_0x5fb2('0x24'),_0x5fb2('0x2c'),_0x5fb2('0x95'),util[_0x5fb2('0xd0')](_0x215dfe['body'],{'showHidden':![],'depth':null}));}break;}return _0x2e851e;}})[_0x5fb2('0x21')](respondWithResult(_0x1b8113,null))[_0x5fb2('0x2a')](handleError(_0x1b8113,null));};exports[_0x5fb2('0xdc')]=function(_0x2c9a5b,_0xb86283,_0xbc100d){var _0x2068c7,_0xd631df,_0x2f619c;return db['SmsAccount'][_0x5fb2('0x5c')]({'where':{'id':_0x2c9a5b['params']['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0xb86283,null))['then'](function(_0x387cf9){if(_0x387cf9){_0x2f619c=_0x387cf9;logger[_0x5fb2('0xce')](_0x5fb2('0x24'),'status','received\x20delivery\x20report\x20from',_0x387cf9['type'],util['inspect'](_0x2c9a5b[_0x5fb2('0x46')],{'showHidden':![],'depth':null}));switch(_0x387cf9[_0x5fb2('0x44')]){case'csc':if(_0x2c9a5b[_0x5fb2('0x46')][_0x5fb2('0xdd')]&&_0x2c9a5b[_0x5fb2('0x46')]['state']){_0xd631df=_0x2c9a5b[_0x5fb2('0x46')][_0x5fb2('0xde')];return db[_0x5fb2('0xcb')]['find']({'where':{'messageId':_0x2c9a5b[_0x5fb2('0x46')]['message-id']}});}break;}}})[_0x5fb2('0x21')](handleEntityNotFound(_0xb86283,null))['then'](function(_0x14027f){if(_0x14027f){_0x2068c7=_0x14027f;switch(_0x2f619c[_0x5fb2('0x44')]){case _0x5fb2('0xdf'):if(_0xd631df==='2'||_0xd631df==='6'){return _0x2068c7['update']({'read':!![]});}else{logger['error'](_0x5fb2('0x24'),_0x5fb2('0x2c'),_0x5fb2('0xdf'),util[_0x5fb2('0xd0')](_0x2c9a5b['query'],{'showHidden':![],'depth':null}));};break;}return _0x2068c7;}})[_0x5fb2('0x21')](respondWithResult(_0xb86283,null))[_0x5fb2('0x2a')](handleError(_0xb86283,null));};exports['addAgents']=function(_0x5b2a7b,_0x3f26f4,_0x31cec8){return db[_0x5fb2('0x41')][_0x5fb2('0x5c')]({'where':{'id':_0x5b2a7b['params']['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x3f26f4,null))[_0x5fb2('0x21')](function(_0x3c80fd){if(_0x3c80fd){return _0x3c80fd[_0x5fb2('0xe0')](_0x5b2a7b[_0x5fb2('0x5e')][_0x5fb2('0xe1')],_['omit'](_0x5b2a7b[_0x5fb2('0x5e')],[_0x5fb2('0xe1'),'id'])||{})[_0x5fb2('0xa0')](function(_0x2630d8){for(var _0x602cd=0x0;_0x602cd<_0x5b2a7b['body'][_0x5fb2('0xe1')][_0x5fb2('0x4d')];_0x602cd+=0x1){socket[_0x5fb2('0xe2')](_0x5fb2('0xe3'),{'UserId':Number(_0x5b2a7b['body'][_0x5fb2('0xe1')][_0x602cd]),'SmsAccountId':Number(_0x5b2a7b[_0x5fb2('0x63')]['id'])});}return _0x2630d8;});}})['then'](respondWithResult(_0x3f26f4,null))[_0x5fb2('0x2a')](handleError(_0x3f26f4,null));};exports[_0x5fb2('0xe4')]=function(_0x96a4af,_0x4c0020,_0x335185){return db[_0x5fb2('0x41')][_0x5fb2('0x5c')]({'where':{'id':_0x96a4af[_0x5fb2('0x63')]['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0x4c0020,null))[_0x5fb2('0x21')](function(_0x541063){if(_0x541063){return _0x541063[_0x5fb2('0xe4')](_0x96a4af[_0x5fb2('0x46')]['ids'])[_0x5fb2('0x21')](function(){if(_['isArray'](_0x96a4af[_0x5fb2('0x46')][_0x5fb2('0xe1')])){for(var _0xb6ee34=0x0;_0xb6ee34<_0x96a4af[_0x5fb2('0x46')][_0x5fb2('0xe1')][_0x5fb2('0x4d')];_0xb6ee34+=0x1){socket[_0x5fb2('0xe2')](_0x5fb2('0xe5'),{'UserId':Number(_0x96a4af['query'][_0x5fb2('0xe1')][_0xb6ee34]),'SmsAccountId':Number(_0x96a4af[_0x5fb2('0x63')]['id'])});}}else{socket[_0x5fb2('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0x96a4af[_0x5fb2('0x46')][_0x5fb2('0xe1')]),'SmsAccountId':Number(_0x96a4af[_0x5fb2('0x63')]['id'])});}});}})[_0x5fb2('0x21')](respondWithStatusCode(_0x4c0020,null))[_0x5fb2('0x2a')](handleError(_0x4c0020,null));};exports[_0x5fb2('0xe6')]=function(_0x4b3612,_0xa07a6d,_0x2938c3){var _0x401f99={};var _0x4c0692={};var _0x2e5f27;var _0x4daf83;return db['SmsAccount']['findOne']({'where':{'id':_0x4b3612['params']['id']}})[_0x5fb2('0x21')](handleEntityNotFound(_0xa07a6d,null))[_0x5fb2('0x21')](function(_0x532fcb){if(_0x532fcb){_0x2e5f27=_0x532fcb;_0x4c0692[_0x5fb2('0x49')]=_[_0x5fb2('0x47')](db[_0x5fb2('0xab')][_0x5fb2('0x42')]);_0x4c0692[_0x5fb2('0x46')]=_[_0x5fb2('0x47')](_0x4b3612[_0x5fb2('0x46')]);_0x4c0692[_0x5fb2('0x48')]=_[_0x5fb2('0x4b')](_0x4c0692[_0x5fb2('0x49')],_0x4c0692[_0x5fb2('0x46')]);_0x401f99[_0x5fb2('0x4a')]=_[_0x5fb2('0x4b')](_0x4c0692['model'],qs[_0x5fb2('0x4c')](_0x4b3612[_0x5fb2('0x46')][_0x5fb2('0x4c')]));_0x401f99[_0x5fb2('0x4a')]=_0x401f99['attributes'][_0x5fb2('0x4d')]?_0x401f99['attributes']:_0x4c0692['model'];_0x401f99[_0x5fb2('0x50')]=qs[_0x5fb2('0x51')](_0x4b3612['query'][_0x5fb2('0x51')]);_0x401f99[_0x5fb2('0x52')]=qs[_0x5fb2('0x48')](_['pick'](_0x4b3612[_0x5fb2('0x46')],_0x4c0692['filters']));if(_0x4b3612['query']['filter']){_0x401f99[_0x5fb2('0x52')]=_[_0x5fb2('0x54')](_0x401f99[_0x5fb2('0x52')],{'$or':_[_0x5fb2('0x40')](_0x401f99[_0x5fb2('0x4a')],function(_0x38346c){var _0xbee495={};_0xbee495[_0x38346c]={'$like':'%'+_0x4b3612[_0x5fb2('0x46')][_0x5fb2('0x55')]+'%'};return _0xbee495;})});}_0x401f99=_['merge']({},_0x401f99,_0x4b3612[_0x5fb2('0x56')]);return _0x2e5f27[_0x5fb2('0xe6')](_0x401f99);}})[_0x5fb2('0x21')](function(_0x37c97c){if(_0x37c97c){_0x4daf83=_0x37c97c[_0x5fb2('0x4d')];if(!_0x4b3612[_0x5fb2('0x46')][_0x5fb2('0x4e')](_0x5fb2('0x4f'))){_0x401f99[_0x5fb2('0x30')]=qs[_0x5fb2('0x30')](_0x4b3612[_0x5fb2('0x46')][_0x5fb2('0x30')]);_0x401f99[_0x5fb2('0x2f')]=qs[_0x5fb2('0x2f')](_0x4b3612[_0x5fb2('0x46')]['offset']);}return _0x2e5f27[_0x5fb2('0xe6')](_0x401f99);}})[_0x5fb2('0x21')](function(_0x56cd0a){if(_0x56cd0a){return _0x56cd0a?{'count':_0x4daf83,'rows':_0x56cd0a}:null;}})['then'](respondWithResult(_0xa07a6d,null))[_0x5fb2('0x2a')](handleError(_0xa07a6d,null));}; \ No newline at end of file +var _0x2292=['show','params','mandatoryDispositionPause','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','describe','addDisposition','getDispositions','Disposition','nolimit','sort','SmsAccountId','removeDispositions','ids','order','CannedAnswer','removeAnswers','notify','sms','Applications','account','orderBy','priority','asc','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','messageId','MessageSid','skebby','text','connectel','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','applications','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','findAndCountAll','stack','finally','findOne','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','get','UserProfileResource','destroy','name','send','index','Pause','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','map','VIRTUAL','merge','includeAll','findAll','rows'];(function(_0x1ae7b0,_0x2301a2){var _0x2d83dc=function(_0x32a63f){while(--_0x32a63f){_0x1ae7b0['push'](_0x1ae7b0['shift']());}};_0x2d83dc(++_0x2301a2);}(_0x2292,0x169));var _0x2229=function(_0x3bb63a,_0x15af8f){_0x3bb63a=_0x3bb63a-0x0;var _0x3b822a=_0x2292[_0x3bb63a];return _0x3b822a;};'use strict';var emlformat=require(_0x2229('0x0'));var rimraf=require(_0x2229('0x1'));var zipdir=require(_0x2229('0x2'));var jsonpatch=require(_0x2229('0x3'));var rp=require(_0x2229('0x4'));var moment=require(_0x2229('0x5'));var BPromise=require(_0x2229('0x6'));var Mustache=require(_0x2229('0x7'));var util=require(_0x2229('0x8'));var path=require(_0x2229('0x9'));var sox=require('sox');var csv=require(_0x2229('0xa'));var ejs=require(_0x2229('0xb'));var fs=require('fs');var fs_extra=require(_0x2229('0xc'));var _=require(_0x2229('0xd'));var squel=require(_0x2229('0xe'));var crypto=require(_0x2229('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2229('0xa'));var querystring=require(_0x2229('0x10'));var Papa=require(_0x2229('0x11'));var Redis=require(_0x2229('0x12'));var authService=require(_0x2229('0x13'));var qs=require(_0x2229('0x14'));var as=require(_0x2229('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2229('0x16'))('api');var utils=require(_0x2229('0x17'));var config=require(_0x2229('0x18'));var licenseUtil=require(_0x2229('0x19'));var db=require('../../mysqldb')['db'];config[_0x2229('0x1a')]=_[_0x2229('0x1b')](config[_0x2229('0x1a')],{'host':_0x2229('0x1c'),'port':0x18eb});var socket=require(_0x2229('0x1d'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x2229('0x1e')](socket);var jayson=require(_0x2229('0x1f'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x5b43b9,_0x3395df,_0x7d6d07,_0x13dd17){return new BPromise(function(_0x3fa76a,_0x59173c){var _0x45bd2c=_0x13dd17||client;return _0x45bd2c['request'](_0x5b43b9,_0x7d6d07)['then'](function(_0x3acf74){logger['info'](_0x2229('0x20'),_0x3395df,_0x2229('0x21'));logger[_0x2229('0x22')](_0x2229('0x23'),_0x3395df,'request\x20sent',JSON[_0x2229('0x24')](_0x3acf74));if(_0x3acf74[_0x2229('0x25')]){if(_0x3acf74[_0x2229('0x25')]['code']===0x1f4){logger[_0x2229('0x25')](_0x2229('0x20'),_0x3395df,_0x3acf74[_0x2229('0x25')]['message']);return _0x59173c(_0x3acf74[_0x2229('0x25')][_0x2229('0x26')]);}logger[_0x2229('0x25')]('SmsAccount,\x20%s,\x20%s',_0x3395df,_0x3acf74[_0x2229('0x25')][_0x2229('0x26')]);return _0x3fa76a(_0x3acf74[_0x2229('0x25')]['message']);}else{logger[_0x2229('0x27')](_0x2229('0x20'),_0x3395df,_0x2229('0x21'));_0x3fa76a(_0x3acf74['result'][_0x2229('0x26')]);}})[_0x2229('0x28')](function(_0x19c37a){logger['error'](_0x2229('0x20'),_0x3395df,_0x19c37a);_0x59173c(_0x19c37a);});});}function respondWithStatusCode(_0x14fc0b,_0x4c1f3b){_0x4c1f3b=_0x4c1f3b||0xcc;return function(_0x273fac){if(_0x273fac){return _0x14fc0b[_0x2229('0x29')](_0x4c1f3b);}return _0x14fc0b[_0x2229('0x2a')](_0x4c1f3b)[_0x2229('0x2b')]();};}function respondWithResult(_0x14b771,_0x4e2821){_0x4e2821=_0x4e2821||0xc8;return function(_0xe3e510){if(_0xe3e510){return _0x14b771[_0x2229('0x2a')](_0x4e2821)[_0x2229('0x2c')](_0xe3e510);}};}function respondWithFilteredResult(_0x574c81,_0x508abc){return function(_0x2805e9){if(_0x2805e9){var _0x5a810f=typeof _0x508abc[_0x2229('0x2d')]===_0x2229('0x2e')&&typeof _0x508abc[_0x2229('0x2f')]===_0x2229('0x2e');var _0x164276=_0x2805e9[_0x2229('0x30')];var _0xdbecf8=_0x5a810f?0x0:_0x508abc[_0x2229('0x2d')];var _0x178a12=_0x5a810f?_0x2805e9[_0x2229('0x30')]:_0x508abc[_0x2229('0x2d')]+_0x508abc[_0x2229('0x2f')];var _0x201366;if(_0x178a12>=_0x164276){_0x178a12=_0x164276;_0x201366=0xc8;}else{_0x201366=0xce;}_0x574c81['status'](_0x201366);return _0x574c81['set'](_0x2229('0x31'),_0xdbecf8+'-'+_0x178a12+'/'+_0x164276)[_0x2229('0x2c')](_0x2805e9);}return null;};}function patchUpdates(_0x5375bc){return function(_0x1fcee7){try{jsonpatch['apply'](_0x1fcee7,_0x5375bc,!![]);}catch(_0x1e4ceb){return BPromise[_0x2229('0x32')](_0x1e4ceb);}return _0x1fcee7['save']();};}function saveUpdates(_0x4aafc1,_0x35bbbb){return function(_0x458477){if(_0x458477){return _0x458477[_0x2229('0x33')](_0x4aafc1)['then'](function(_0x491ab5){return _0x491ab5;});}return null;};}function removeEntity(_0x2437e2,_0x4b5b85){return function(_0x4242de){if(_0x4242de){return _0x4242de['destroy']()[_0x2229('0x34')](function(){var _0x203404=_0x4242de[_0x2229('0x35')]({'plain':!![]});var _0x5914dd='SmsAccounts';return db[_0x2229('0x36')][_0x2229('0x37')]({'where':{'type':_0x5914dd,'resourceId':_0x203404['id']}})[_0x2229('0x34')](function(){return _0x4242de;});})[_0x2229('0x34')](function(){_0x2437e2[_0x2229('0x2a')](0xcc)[_0x2229('0x2b')]();});}};}function handleEntityNotFound(_0xd18d58,_0x19393a){return function(_0x1a6e86){if(!_0x1a6e86){_0xd18d58[_0x2229('0x29')](0x194);}return _0x1a6e86;};}function handleError(_0x590904,_0x3621e2){_0x3621e2=_0x3621e2||0x1f4;return function(_0x2428a9){logger[_0x2229('0x25')](_0x2428a9['stack']);if(_0x2428a9[_0x2229('0x38')]){delete _0x2428a9['name'];}_0x590904['status'](_0x3621e2)[_0x2229('0x39')](_0x2428a9);};}exports[_0x2229('0x3a')]=function(_0x2ba5f8,_0x37200a){var _0x4bc757={'include':[{'model':db[_0x2229('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3ccc0a={},_0x22bb50={'count':0x0,'rows':[]};var _0x5c3f16=_['map'](db[_0x2229('0x3c')][_0x2229('0x3d')],function(_0x851faf){return{'name':_0x851faf[_0x2229('0x3e')],'type':_0x851faf[_0x2229('0x3f')][_0x2229('0x40')]};});_0x3ccc0a[_0x2229('0x41')]=_['map'](_0x5c3f16,_0x2229('0x38'));_0x3ccc0a[_0x2229('0x42')]=_[_0x2229('0x43')](_0x2ba5f8['query']);_0x3ccc0a[_0x2229('0x44')]=_['intersection'](_0x3ccc0a[_0x2229('0x41')],_0x3ccc0a[_0x2229('0x42')]);_0x4bc757['attributes']=_[_0x2229('0x45')](_0x3ccc0a[_0x2229('0x41')],qs[_0x2229('0x46')](_0x2ba5f8[_0x2229('0x42')][_0x2229('0x46')]));_0x4bc757[_0x2229('0x47')]=_0x4bc757[_0x2229('0x47')][_0x2229('0x48')]?_0x4bc757[_0x2229('0x47')]:_0x3ccc0a[_0x2229('0x41')];if(!_0x2ba5f8[_0x2229('0x42')][_0x2229('0x49')]('nolimit')){_0x4bc757[_0x2229('0x2f')]=qs[_0x2229('0x2f')](_0x2ba5f8['query']['limit']);_0x4bc757[_0x2229('0x2d')]=qs[_0x2229('0x2d')](_0x2ba5f8[_0x2229('0x42')]['offset']);}_0x4bc757['order']=qs['sort'](_0x2ba5f8['query']['sort']);_0x4bc757[_0x2229('0x4a')]=qs[_0x2229('0x44')](_[_0x2229('0x4b')](_0x2ba5f8[_0x2229('0x42')],_0x3ccc0a[_0x2229('0x44')]),_0x5c3f16);if(_0x2ba5f8['query'][_0x2229('0x4c')]){_0x4bc757[_0x2229('0x4a')]=_['merge'](_0x4bc757[_0x2229('0x4a')],{'$or':_[_0x2229('0x4d')](_0x5c3f16,function(_0x7cea47){if(_0x7cea47['type']!==_0x2229('0x4e')){var _0x36ca2d={};_0x36ca2d[_0x7cea47[_0x2229('0x38')]]={'$like':'%'+_0x2ba5f8[_0x2229('0x42')][_0x2229('0x4c')]+'%'};return _0x36ca2d;}})});}_0x4bc757=_[_0x2229('0x4f')]({},_0x4bc757,_0x2ba5f8['options']);var _0x5874e9={'where':_0x4bc757['where']};return db[_0x2229('0x3c')][_0x2229('0x30')](_0x5874e9)['then'](function(_0x23113c){_0x22bb50['count']=_0x23113c;if(_0x2ba5f8[_0x2229('0x42')][_0x2229('0x50')]){_0x4bc757['include']=[{'all':!![]}];}return db['SmsAccount'][_0x2229('0x51')](_0x4bc757);})[_0x2229('0x34')](function(_0x3fc9b4){_0x22bb50[_0x2229('0x52')]=_0x3fc9b4;return _0x22bb50;})['then'](respondWithFilteredResult(_0x37200a,_0x4bc757))['catch'](handleError(_0x37200a,null));};exports[_0x2229('0x53')]=function(_0x4fbc03,_0x1d8873){var _0x388205={'raw':![],'where':{'id':_0x4fbc03[_0x2229('0x54')]['id']},'include':[{'model':db[_0x2229('0x3b')],'as':_0x2229('0x55')}]},_0x8802a={};_0x8802a[_0x2229('0x41')]=_[_0x2229('0x43')](db[_0x2229('0x3c')]['rawAttributes']);_0x8802a['query']=_[_0x2229('0x43')](_0x4fbc03['query']);_0x8802a[_0x2229('0x44')]=_[_0x2229('0x45')](_0x8802a[_0x2229('0x41')],_0x8802a[_0x2229('0x42')]);_0x388205[_0x2229('0x47')]=_[_0x2229('0x45')](_0x8802a[_0x2229('0x41')],qs[_0x2229('0x46')](_0x4fbc03[_0x2229('0x42')]['fields']));_0x388205[_0x2229('0x47')]=_0x388205[_0x2229('0x47')][_0x2229('0x48')]?_0x388205['attributes']:_0x8802a[_0x2229('0x41')];if(_0x4fbc03[_0x2229('0x42')][_0x2229('0x50')]){_0x388205[_0x2229('0x56')]=[{'all':!![]}];}_0x388205=_[_0x2229('0x4f')]({},_0x388205,_0x4fbc03[_0x2229('0x57')]);return db[_0x2229('0x3c')][_0x2229('0x58')](_0x388205)[_0x2229('0x34')](handleEntityNotFound(_0x1d8873,null))['then'](respondWithResult(_0x1d8873,null))['catch'](handleError(_0x1d8873,null));};exports[_0x2229('0x59')]=function(_0xffaf6a,_0x407e1b){return db['SmsAccount']['create'](_0xffaf6a[_0x2229('0x5a')],{})[_0x2229('0x34')](function(_0x3dcab7){var _0x522438=_0xffaf6a['user']['get']({'plain':!![]});if(!_0x522438)throw new Error(_0x2229('0x5b'));if(_0x522438[_0x2229('0x5c')]===_0x2229('0x5d')){var _0x1957b0=_0x3dcab7['get']({'plain':!![]});var _0x5a3677='SmsAccounts';return db['UserProfileSection'][_0x2229('0x58')]({'where':{'name':_0x5a3677,'userProfileId':_0x522438[_0x2229('0x5e')]},'raw':!![]})[_0x2229('0x34')](function(_0x4126fa){if(_0x4126fa&&_0x4126fa[_0x2229('0x5f')]===0x0){return db[_0x2229('0x36')][_0x2229('0x59')]({'name':_0x1957b0[_0x2229('0x38')],'resourceId':_0x1957b0['id'],'type':_0x4126fa[_0x2229('0x38')],'sectionId':_0x4126fa['id']},{})[_0x2229('0x34')](function(){return _0x3dcab7;});}else{return _0x3dcab7;}})[_0x2229('0x28')](function(_0x41e947){logger[_0x2229('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41e947);throw _0x41e947;});}return _0x3dcab7;})[_0x2229('0x34')](respondWithResult(_0x407e1b,0xc9))[_0x2229('0x28')](handleError(_0x407e1b,null));};exports[_0x2229('0x33')]=function(_0x572fb4,_0x2025e3){if(_0x572fb4[_0x2229('0x5a')]['id']){delete _0x572fb4[_0x2229('0x5a')]['id'];}return db['SmsAccount'][_0x2229('0x58')]({'where':{'id':_0x572fb4['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x2229('0x34')](handleEntityNotFound(_0x2025e3,null))[_0x2229('0x34')](saveUpdates(_0x572fb4[_0x2229('0x5a')],null))[_0x2229('0x34')](respondWithResult(_0x2025e3,null))[_0x2229('0x28')](handleError(_0x2025e3,null));};exports['destroy']=function(_0x1b2617,_0x1b9ec2){return db['SmsAccount'][_0x2229('0x58')]({'where':{'id':_0x1b2617['params']['id']}})['then'](handleEntityNotFound(_0x1b9ec2,null))[_0x2229('0x34')](removeEntity(_0x1b9ec2,null))['catch'](handleError(_0x1b9ec2,null));};exports[_0x2229('0x60')]=function(_0x55729a,_0x586676){return db[_0x2229('0x3c')][_0x2229('0x60')]()[_0x2229('0x34')](respondWithResult(_0x586676,null))[_0x2229('0x28')](handleError(_0x586676,null));};exports[_0x2229('0x61')]=function(_0xcd9d81,_0x143288,_0x406e7f){if(_0xcd9d81[_0x2229('0x5a')]['id']){delete _0xcd9d81[_0x2229('0x5a')]['id'];}return db[_0x2229('0x3c')]['find']({'where':{'id':_0xcd9d81['params']['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x143288,null))[_0x2229('0x34')](function(_0x365d77){if(_0x365d77){_0xcd9d81[_0x2229('0x5a')]['SmsAccountId']=_0x365d77['id'];return db['Disposition'][_0x2229('0x59')](_0xcd9d81[_0x2229('0x5a')]);}})['then'](respondWithResult(_0x143288,null))[_0x2229('0x28')](handleError(_0x143288,null));};exports[_0x2229('0x62')]=function(_0x19fbbe,_0x174820,_0x24e22a){var _0x1ddca1={'raw':![],'where':{}};var _0x42602a={};var _0x272760={'count':0x0,'rows':[]};return db[_0x2229('0x3c')]['findOne']({'where':{'id':_0x19fbbe[_0x2229('0x54')]['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x174820,null))[_0x2229('0x34')](function(_0x2d0f72){if(_0x2d0f72){_0x42602a['model']=_[_0x2229('0x43')](db[_0x2229('0x63')][_0x2229('0x3d')]);_0x42602a[_0x2229('0x42')]=_['keys'](_0x19fbbe[_0x2229('0x42')]);_0x42602a[_0x2229('0x44')]=_['intersection'](_0x42602a['model'],_0x42602a[_0x2229('0x42')]);_0x1ddca1['attributes']=_[_0x2229('0x45')](_0x42602a[_0x2229('0x41')],qs[_0x2229('0x46')](_0x19fbbe[_0x2229('0x42')]['fields']));_0x1ddca1[_0x2229('0x47')]=_0x1ddca1[_0x2229('0x47')][_0x2229('0x48')]?_0x1ddca1[_0x2229('0x47')]:_0x42602a[_0x2229('0x41')];if(!_0x19fbbe['query']['hasOwnProperty'](_0x2229('0x64'))){_0x1ddca1[_0x2229('0x2f')]=qs['limit'](_0x19fbbe['query']['limit']);_0x1ddca1[_0x2229('0x2d')]=qs[_0x2229('0x2d')](_0x19fbbe[_0x2229('0x42')][_0x2229('0x2d')]);}_0x1ddca1['order']=qs[_0x2229('0x65')](_0x19fbbe[_0x2229('0x42')][_0x2229('0x65')]);_0x1ddca1[_0x2229('0x4a')]=qs['filters'](_[_0x2229('0x4b')](_0x19fbbe[_0x2229('0x42')],_0x42602a[_0x2229('0x44')]));_0x1ddca1[_0x2229('0x4a')][_0x2229('0x66')]=_0x2d0f72['id'];if(_0x19fbbe[_0x2229('0x42')][_0x2229('0x4c')]){_0x1ddca1[_0x2229('0x4a')]=_[_0x2229('0x4f')](_0x1ddca1[_0x2229('0x4a')],{'$or':_[_0x2229('0x4d')](_0x1ddca1['attributes'],function(_0x476bf6){var _0x3dcbff={};_0x3dcbff[_0x476bf6]={'$like':'%'+_0x19fbbe[_0x2229('0x42')][_0x2229('0x4c')]+'%'};return _0x3dcbff;})});}_0x1ddca1=_['merge']({},_0x1ddca1,_0x19fbbe[_0x2229('0x57')]);return db['Disposition'][_0x2229('0x30')]({'where':_0x1ddca1[_0x2229('0x4a')]})[_0x2229('0x34')](function(_0x2a392c){_0x272760[_0x2229('0x30')]=_0x2a392c;if(_0x19fbbe[_0x2229('0x42')][_0x2229('0x50')]){_0x1ddca1[_0x2229('0x56')]=[{'all':!![]}];}return db[_0x2229('0x63')][_0x2229('0x51')](_0x1ddca1);})['then'](function(_0x133ff6){_0x272760[_0x2229('0x52')]=_0x133ff6;return _0x272760;});}})['then'](respondWithFilteredResult(_0x174820,_0x1ddca1))[_0x2229('0x28')](handleError(_0x174820,null));};exports[_0x2229('0x67')]=function(_0x31efde,_0x4f9126,_0x1f6cd5){return db['SmsAccount'][_0x2229('0x58')]({'where':{'id':_0x31efde[_0x2229('0x54')]['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x4f9126,null))[_0x2229('0x34')](function(_0x57e6ca){if(_0x57e6ca){return _0x57e6ca[_0x2229('0x67')](_0x31efde[_0x2229('0x42')][_0x2229('0x68')]);}})[_0x2229('0x34')](respondWithStatusCode(_0x4f9126,null))['catch'](handleError(_0x4f9126,null));};exports['addAnswer']=function(_0x1f14c0,_0x492cff,_0x543395){if(_0x1f14c0['body']['id']){delete _0x1f14c0[_0x2229('0x5a')]['id'];}return db['SmsAccount'][_0x2229('0x58')]({'where':{'id':_0x1f14c0['params']['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x492cff,null))['then'](function(_0x185540){if(_0x185540){_0x1f14c0[_0x2229('0x5a')][_0x2229('0x66')]=_0x185540['id'];return db['CannedAnswer']['create'](_0x1f14c0[_0x2229('0x5a')]);}})['then'](respondWithResult(_0x492cff,null))['catch'](handleError(_0x492cff,null));};exports['getAnswers']=function(_0x3ded1e,_0x230977,_0x3f8a13){var _0x53ae65={'raw':![],'where':{}};var _0x1569f7={};var _0x2e14dd={'count':0x0,'rows':[]};return db[_0x2229('0x3c')]['findOne']({'where':{'id':_0x3ded1e['params']['id']}})['then'](handleEntityNotFound(_0x230977,null))[_0x2229('0x34')](function(_0x3d89e9){if(_0x3d89e9){_0x1569f7['model']=_['keys'](db['CannedAnswer'][_0x2229('0x3d')]);_0x1569f7[_0x2229('0x42')]=_[_0x2229('0x43')](_0x3ded1e[_0x2229('0x42')]);_0x1569f7[_0x2229('0x44')]=_['intersection'](_0x1569f7['model'],_0x1569f7[_0x2229('0x42')]);_0x53ae65[_0x2229('0x47')]=_[_0x2229('0x45')](_0x1569f7['model'],qs['fields'](_0x3ded1e[_0x2229('0x42')][_0x2229('0x46')]));_0x53ae65['attributes']=_0x53ae65[_0x2229('0x47')][_0x2229('0x48')]?_0x53ae65[_0x2229('0x47')]:_0x1569f7['model'];if(!_0x3ded1e[_0x2229('0x42')][_0x2229('0x49')]('nolimit')){_0x53ae65['limit']=qs[_0x2229('0x2f')](_0x3ded1e['query']['limit']);_0x53ae65[_0x2229('0x2d')]=qs['offset'](_0x3ded1e[_0x2229('0x42')]['offset']);}_0x53ae65[_0x2229('0x69')]=qs['sort'](_0x3ded1e[_0x2229('0x42')]['sort']);_0x53ae65[_0x2229('0x4a')]=qs[_0x2229('0x44')](_[_0x2229('0x4b')](_0x3ded1e['query'],_0x1569f7['filters']));_0x53ae65[_0x2229('0x4a')][_0x2229('0x66')]=_0x3d89e9['id'];if(_0x3ded1e[_0x2229('0x42')][_0x2229('0x4c')]){_0x53ae65[_0x2229('0x4a')]=_['merge'](_0x53ae65[_0x2229('0x4a')],{'$or':_[_0x2229('0x4d')](_0x53ae65['attributes'],function(_0x30d4d1){var _0x43a410={};_0x43a410[_0x30d4d1]={'$like':'%'+_0x3ded1e[_0x2229('0x42')][_0x2229('0x4c')]+'%'};return _0x43a410;})});}_0x53ae65=_[_0x2229('0x4f')]({},_0x53ae65,_0x3ded1e[_0x2229('0x57')]);return db[_0x2229('0x6a')][_0x2229('0x30')]({'where':_0x53ae65[_0x2229('0x4a')]})[_0x2229('0x34')](function(_0x1ccbb6){_0x2e14dd[_0x2229('0x30')]=_0x1ccbb6;if(_0x3ded1e[_0x2229('0x42')][_0x2229('0x50')]){_0x53ae65[_0x2229('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x53ae65);})[_0x2229('0x34')](function(_0x4a69a2){_0x2e14dd[_0x2229('0x52')]=_0x4a69a2;return _0x2e14dd;});}})['then'](respondWithFilteredResult(_0x230977,_0x53ae65))[_0x2229('0x28')](handleError(_0x230977,null));};exports['removeAnswers']=function(_0x20db0c,_0x41d15e,_0x251c56){return db[_0x2229('0x3c')][_0x2229('0x58')]({'where':{'id':_0x20db0c[_0x2229('0x54')]['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x41d15e,null))[_0x2229('0x34')](function(_0x148f8a){if(_0x148f8a){return _0x148f8a[_0x2229('0x6b')](_0x20db0c[_0x2229('0x42')][_0x2229('0x68')]);}})[_0x2229('0x34')](respondWithStatusCode(_0x41d15e,null))[_0x2229('0x28')](handleError(_0x41d15e,null));};exports[_0x2229('0x6c')]=function(_0x1aad48,_0x11cc0f,_0x1ca618){var _0x4a289b={'channel':_0x2229('0x6d')};var _0x236856=[];var _0x18401c=[];var _0x156186={};return db[_0x2229('0x3c')][_0x2229('0x58')]({'where':{'id':_0x1aad48[_0x2229('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x2229('0x6e')}]})[_0x2229('0x34')](handleEntityNotFound(_0x11cc0f,null))['then'](function(_0x49eb0b){_0x4a289b[_0x2229('0x6f')]=_0x49eb0b;_0x4a289b['applications']=_[_0x2229('0x70')](_0x49eb0b[_0x2229('0x6e')],[_0x2229('0x71')],[_0x2229('0x72')]);if(_0x4a289b[_0x2229('0x6f')][_0x2229('0x6e')]){delete _0x4a289b[_0x2229('0x6f')][_0x2229('0x6e')];}return db['CmContact'][_0x2229('0x60')]();})[_0x2229('0x34')](function(_0xc2c0de){if(!_0xc2c0de){throw new db['Sequelize'][(_0x2229('0x73'))]('no\x20available\x20attributes');}_0x236856=_[_0x2229('0x74')](_['keys'](_0xc2c0de),[_0x2229('0x75'),'updatedAt']);_0x18401c=_[_0x2229('0x74')](_[_0x2229('0x43')](_0xc2c0de),['createdAt',_0x2229('0x76'),_0x2229('0x77'),_0x2229('0x78')]);_0x4a289b[_0x2229('0x5a')]={'mapKey':'mobile'};if(_0x4a289b[_0x2229('0x6f')][_0x2229('0x3f')]){switch(_0x4a289b['account']['type']){case _0x2229('0x79'):_0x4a289b['body'][_0x2229('0x7a')]=_0x1aad48['body'][_0x2229('0x7b')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48[_0x2229('0x5a')]['Body'];_0x4a289b[_0x2229('0x5a')][_0x2229('0x7c')]=_0x1aad48['body'][_0x2229('0x7d')];break;case _0x2229('0x7e'):_0x4a289b[_0x2229('0x5a')][_0x2229('0x7a')]='+'+_0x1aad48[_0x2229('0x5a')]['sender'];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48['body'][_0x2229('0x7f')];break;case _0x2229('0x80'):_0x4a289b[_0x2229('0x5a')][_0x2229('0x7a')]=_0x1aad48['body'][_0x2229('0x7a')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48[_0x2229('0x5a')][_0x2229('0x26')];break;case'clicksend':_0x4a289b[_0x2229('0x5a')]['from']=_0x1aad48[_0x2229('0x5a')][_0x2229('0x7a')];_0x4a289b['body']['body']=_0x1aad48['body'][_0x2229('0x5a')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x7c')]=_0x1aad48[_0x2229('0x5a')][_0x2229('0x81')];break;case _0x2229('0x82'):_0x4a289b[_0x2229('0x5a')][_0x2229('0x7a')]=_0x1aad48['body']['From'];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48['body'][_0x2229('0x83')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x7c')]=_0x1aad48[_0x2229('0x5a')]['MessageUUID'];break;case _0x2229('0x84'):_0x4a289b['body'][_0x2229('0x7a')]='+'+_0x1aad48[_0x2229('0x5a')][_0x2229('0x85')][0x0][_0x2229('0x7a')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48[_0x2229('0x5a')][_0x2229('0x85')][0x0]['text'];_0x4a289b[_0x2229('0x5a')]['messageId']=_0x1aad48[_0x2229('0x5a')]['results'][0x0]['messageId'];break;case _0x2229('0x86'):_0x4a289b[_0x2229('0x5a')][_0x2229('0x7a')]=_0x1aad48[_0x2229('0x5a')][_0x2229('0x87')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48['body'][_0x2229('0x88')][_0x2229('0x26')];break;case'clickatell':_0x4a289b['body'][_0x2229('0x7a')]=_0x1aad48[_0x2229('0x5a')]['fromNumber'];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48['body'][_0x2229('0x7f')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x7c')]=_0x1aad48[_0x2229('0x5a')][_0x2229('0x89')];break;case _0x2229('0x8a'):_0x4a289b[_0x2229('0x5a')][_0x2229('0x7c')]=_0x1aad48[_0x2229('0x5a')][0x0][_0x2229('0x26')]['id'];_0x4a289b[_0x2229('0x5a')][_0x2229('0x7a')]=_0x1aad48['body'][0x0][_0x2229('0x26')][_0x2229('0x7a')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48[_0x2229('0x5a')][0x0][_0x2229('0x26')]['text'];break;case _0x2229('0x8b'):_0x4a289b[_0x2229('0x5a')][_0x2229('0x7a')]=_0x1aad48[_0x2229('0x5a')][_0x2229('0x7a')];_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')]=_0x1aad48[_0x2229('0x5a')]['message'];_0x4a289b[_0x2229('0x5a')][_0x2229('0x7c')]=_0x1aad48[_0x2229('0x5a')][_0x2229('0x8c')];break;}}if(_0x4a289b[_0x2229('0x5a')]['id']){delete _0x4a289b[_0x2229('0x5a')]['id'];}if(_['isNil'](_0x4a289b[_0x2229('0x5a')]['from'])){throw new db[(_0x2229('0x8d'))][(_0x2229('0x73'))](_0x2229('0x8e'));}if(_[_0x2229('0x8f')](_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')])||_0x4a289b[_0x2229('0x5a')]['body']===''){throw new db[(_0x2229('0x8d'))][(_0x2229('0x73'))](_0x2229('0x90'));}if(_[_0x2229('0x8f')](_0x4a289b['body']['mapKey'])){throw new db[(_0x2229('0x8d'))][(_0x2229('0x73'))](_0x2229('0x91')+_0x18401c);}if(!_['includes'](_0x18401c,_0x4a289b[_0x2229('0x5a')][_0x2229('0x92')])){throw new db[(_0x2229('0x8d'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18401c);}_0x156186[_0x4a289b[_0x2229('0x5a')][_0x2229('0x92')]]=_0x4a289b['body'][_0x2229('0x7a')];return db[_0x2229('0x93')][_0x2229('0x58')]({'where':{'id':_0x4a289b[_0x2229('0x6f')]['ListId']},'include':[{'model':db[_0x2229('0x94')],'as':'Contacts','where':_0x156186,'limit':0x1,'order':[[_0x2229('0x76'),_0x2229('0x95')]]}]});})[_0x2229('0x34')](handleEntityNotFound(_0x11cc0f,null))[_0x2229('0x34')](function(_0x33f0ff){if(_0x33f0ff){_0x4a289b[_0x2229('0x96')]=_[_0x2229('0x97')](_0x33f0ff,[_0x2229('0x98')]);if(_0x33f0ff[_0x2229('0x98')][_0x2229('0x48')]){return _0x33f0ff[_0x2229('0x98')][0x0];}var _0x5dedec=_[_0x2229('0x1b')](_0x4a289b[_0x2229('0x5a')],{'firstName':_0x4a289b[_0x2229('0x5a')]['from'],'ListId':_0x33f0ff['id']});_0x5dedec[_0x4a289b[_0x2229('0x5a')][_0x2229('0x92')]]=_0x4a289b[_0x2229('0x5a')]['from'];return db[_0x2229('0x94')][_0x2229('0x59')](_0x5dedec,{'fields':_0x236856,'raw':!![]});}})[_0x2229('0x34')](handleEntityNotFound(_0x11cc0f,null))[_0x2229('0x34')](function(_0x174a6c){if(_0x174a6c){_0x4a289b[_0x2229('0x99')]=_0x174a6c;var _0x2a999c={'ContactId':_0x174a6c['id'],'phone':_0x4a289b[_0x2229('0x5a')]['from'],'SmsAccountId':_0x1aad48[_0x2229('0x54')]['id']};var _0x1f854d={'ContactId':_0x174a6c['id'],'SmsAccountId':_0x1aad48[_0x2229('0x54')]['id'],'closed':![]};return db[_0x2229('0x9a')][_0x2229('0x58')]({'where':_0x1f854d})['then'](function(_0x19dfaa){if(_0x19dfaa){return[_0x19dfaa,![]];}return db[_0x2229('0x9a')][_0x2229('0x59')](_0x2a999c)[_0x2229('0x34')](function(_0x3e60ca){return[_0x3e60ca,!![]];});});}})[_0x2229('0x9b')](function(_0x54be86,_0x5c463f){_0x4a289b[_0x2229('0x9c')]=_0x54be86[_0x2229('0x35')]({'plain':!![]});_0x4a289b[_0x2229('0x9c')]['created']=![];if(_0x5c463f){if(_0x4a289b[_0x2229('0x6f')]['autoclose']){_0x4a289b[_0x2229('0x9d')][_0x2229('0x9e')]({'id':0x0,'priority':_0x4a289b[_0x2229('0x9d')][_0x2229('0x48')]+0x1,'app':_0x2229('0x9f'),'appdata':_0x2229('0xa0'),'interval':'*,*,*,*'});}_0x4a289b[_0x2229('0x9c')]['created']=!![];}return db[_0x2229('0xa1')][_0x2229('0x59')]({'phone':_0x4a289b['body'][_0x2229('0x7a')],'messageId':_0x4a289b['body']['messageId'],'body':_0x4a289b[_0x2229('0x5a')][_0x2229('0x5a')],'SmsAccountId':_0x1aad48['params']['id'],'SmsInteractionId':_0x54be86['id'],'direction':'in','ContactId':_0x54be86[_0x2229('0xa2')],'AttachmentId':_0x4a289b[_0x2229('0x5a')][_0x2229('0xa3')]});})[_0x2229('0x34')](function(_0x18beef){_0x4a289b[_0x2229('0x26')]=_0x18beef;if(_0x4a289b[_0x2229('0x9c')][_0x2229('0xa4')]){return db[_0x2229('0xa5')][_0x2229('0x58')]({'attributes':['id',_0x2229('0x38')],'where':{'id':_0x4a289b[_0x2229('0x9c')][_0x2229('0xa4')]}})[_0x2229('0x34')](function(_0x21af2f){if(_0x21af2f){_0x4a289b['applications'][_0x2229('0xa6')]({'id':0x0,'priority':0x0,'app':_0x2229('0xa7'),'appdata':_0x21af2f[_0x2229('0x38')]+','+(_0x4a289b['account']['waitForTheAssignedAgent']||0xa),'interval':_0x2229('0xa8')});}return respondWithRpcPromise(_0x2229('0xa9'),_0x2229('0xaa'),_0x4a289b);});}return respondWithRpcPromise(_0x2229('0xa9'),_0x2229('0xaa'),_0x4a289b);})[_0x2229('0x34')](function(_0x10182a){if(_0x10182a){var _0x5ded41=0xc8;var _0x16406d=_0x2229('0xab');logger[_0x2229('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x16406d,_0x5ded41,_0x2229('0xac'));logger[_0x2229('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x16406d,_0x5ded41,_0x2229('0xac'),JSON[_0x2229('0x24')](_0x10182a));if(_0x4a289b[_0x2229('0x6f')][_0x2229('0x3f')]===_0x2229('0x79')){return _0x11cc0f[_0x2229('0x2a')](_0x5ded41)['set'](_0x2229('0xad'),_0x2229('0xae'))['send']('\x0a');}else{return _0x11cc0f[_0x2229('0x2a')](_0x5ded41)[_0x2229('0x2c')](_0x10182a);}}})[_0x2229('0x28')](handleError(_0x11cc0f,null));};exports[_0x2229('0xaf')]=function(_0xc03d2f,_0x57a526){var _0x5acc3e=_0xc03d2f['params']['id'];var _0x508e87=_0xc03d2f[_0x2229('0x5a')];var _0x1bf0d8=0xc8;var _0x2ddf91=null;return db[_0x2229('0xb0')][_0x2229('0xb1')]({'isolationLevel':db[_0x2229('0xb0')][_0x2229('0xb2')]['ISOLATION_LEVELS'][_0x2229('0xb3')]},function(_0x4ec386){return db[_0x2229('0x3c')]['findOne']({'where':{'id':_0x5acc3e},'transaction':_0x4ec386})[_0x2229('0x34')](function(_0x326407){if(_0x326407){return db[_0x2229('0xb4')][_0x2229('0x37')]({'where':{'SmsAccountId':_0x5acc3e},'transaction':_0x4ec386})[_0x2229('0x34')](function(){var _0x57eaf7=_[_0x2229('0x4d')](_0x508e87,function(_0x307cb6){_0x307cb6[_0x2229('0x66')]=_0x5acc3e;return _0x307cb6;});return db[_0x2229('0xb4')]['bulkCreate'](_0x57eaf7,{'transaction':_0x4ec386});});}else{_0x1bf0d8=0x194;_0x2ddf91=[];}});})[_0x2229('0x34')](function(){if(_0x1bf0d8!==0x194){return db[_0x2229('0xb4')][_0x2229('0xb5')]({'where':{'SmsAccountId':_0x5acc3e},'order':_0x2229('0x71')})['then'](function(_0x3f6bda){_0x2ddf91=_0x3f6bda;});}})[_0x2229('0x28')](function(_0x1d4f87){_0x1bf0d8=0x1f4;logger[_0x2229('0x25')](_0x1d4f87[_0x2229('0xb6')]);if(_0x1d4f87[_0x2229('0x38')]){delete _0x1d4f87[_0x2229('0x38')];}_0x2ddf91=_0x1d4f87;})[_0x2229('0xb7')](function(){if(_0x2ddf91===null){_0x57a526[_0x2229('0x29')](_0x1bf0d8);}else{if(_0x1bf0d8===0x1f4){_0x57a526[_0x2229('0x2a')](_0x1bf0d8)[_0x2229('0x39')](_0x2ddf91);}else{_0x57a526[_0x2229('0x2a')](_0x1bf0d8)[_0x2229('0x2c')](_0x2ddf91);}}});};exports['getApplications']=function(_0x43e61d,_0x2142db,_0x2b273d){var _0x12a431={};var _0xf60a34={};var _0x40f6f9;var _0x312ff3;return db[_0x2229('0x3c')][_0x2229('0xb8')]({'where':{'id':_0x43e61d[_0x2229('0x54')]['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x2142db,null))[_0x2229('0x34')](function(_0x453e1b){if(_0x453e1b){_0x40f6f9=_0x453e1b;_0xf60a34[_0x2229('0x41')]=_['keys'](db[_0x2229('0xb4')][_0x2229('0x3d')]);_0xf60a34[_0x2229('0x42')]=_[_0x2229('0x43')](_0x43e61d[_0x2229('0x42')]);_0xf60a34[_0x2229('0x44')]=_['intersection'](_0xf60a34[_0x2229('0x41')],_0xf60a34['query']);_0x12a431[_0x2229('0x47')]=_[_0x2229('0x45')](_0xf60a34[_0x2229('0x41')],qs['fields'](_0x43e61d[_0x2229('0x42')][_0x2229('0x46')]));_0x12a431[_0x2229('0x47')]=_0x12a431[_0x2229('0x47')]['length']?_0x12a431[_0x2229('0x47')]:_0xf60a34[_0x2229('0x41')];_0x12a431[_0x2229('0x69')]=qs['sort'](_0x43e61d[_0x2229('0x42')][_0x2229('0x65')]);_0x12a431['where']=qs[_0x2229('0x44')](_['pick'](_0x43e61d['query'],_0xf60a34['filters']));if(_0x43e61d[_0x2229('0x42')][_0x2229('0x4c')]){_0x12a431['where']=_[_0x2229('0x4f')](_0x12a431[_0x2229('0x4a')],{'$or':_[_0x2229('0x4d')](_0x12a431['attributes'],function(_0x2a9a8c){var _0x2bed00={};_0x2bed00[_0x2a9a8c]={'$like':'%'+_0x43e61d['query'][_0x2229('0x4c')]+'%'};return _0x2bed00;})});}_0x12a431=_['merge']({},_0x12a431,_0x43e61d[_0x2229('0x57')]);return _0x40f6f9[_0x2229('0xb9')](_0x12a431);}})['then'](function(_0x46fa5d){if(_0x46fa5d){_0x312ff3=_0x46fa5d[_0x2229('0x48')];if(!_0x43e61d[_0x2229('0x42')][_0x2229('0x49')](_0x2229('0x64'))){_0x12a431['limit']=qs['limit'](_0x43e61d['query'][_0x2229('0x2f')]);_0x12a431['offset']=qs['offset'](_0x43e61d['query'][_0x2229('0x2d')]);}return _0x40f6f9[_0x2229('0xb9')](_0x12a431);}})['then'](function(_0x44c155){if(_0x44c155){return _0x44c155?{'count':_0x312ff3,'rows':_0x44c155}:null;}})['then'](respondWithResult(_0x2142db,null))[_0x2229('0x28')](handleError(_0x2142db,null));};exports[_0x2229('0xba')]=function(_0x495305,_0x4d2a61,_0x25145d){var _0x1c8df2={'raw':![],'where':{}};var _0x1ac771={};var _0xe0e3cc={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x495305[_0x2229('0x54')]['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x4d2a61,null))[_0x2229('0x34')](function(_0x535340){if(_0x535340){_0x1ac771[_0x2229('0x41')]=_[_0x2229('0x43')](db[_0x2229('0x9a')]['rawAttributes']);_0x1ac771['query']=_['keys'](_0x495305[_0x2229('0x42')]);_0x1ac771[_0x2229('0x44')]=_[_0x2229('0x45')](_0x1ac771[_0x2229('0x41')],_0x1ac771[_0x2229('0x42')]);_0x1c8df2[_0x2229('0x47')]=_['intersection'](_0x1ac771['model'],qs['fields'](_0x495305[_0x2229('0x42')]['fields']));_0x1c8df2[_0x2229('0x47')]=_0x1c8df2[_0x2229('0x47')][_0x2229('0x48')]?_0x1c8df2[_0x2229('0x47')]:_0x1ac771['model'];if(!_0x495305[_0x2229('0x42')][_0x2229('0x49')](_0x2229('0x64'))){_0x1c8df2[_0x2229('0x2f')]=qs['limit'](_0x495305[_0x2229('0x42')]['limit']);_0x1c8df2[_0x2229('0x2d')]=qs['offset'](_0x495305[_0x2229('0x42')][_0x2229('0x2d')]);}_0x1c8df2[_0x2229('0x69')]=qs[_0x2229('0x65')](_0x495305['query'][_0x2229('0x65')]);_0x1c8df2[_0x2229('0x4a')]=qs['filters'](_['pick'](_0x495305['query'],_0x1ac771[_0x2229('0x44')]));_0x1c8df2[_0x2229('0x4a')][_0x2229('0x66')]=_0x535340['id'];if(_0x495305['query'][_0x2229('0x4c')]){_0x1c8df2['where']=_[_0x2229('0x4f')](_0x1c8df2[_0x2229('0x4a')],{'$or':_['map'](_0x1c8df2[_0x2229('0x47')],function(_0x4cb9b5){var _0x451ec3={};_0x451ec3[_0x4cb9b5]={'$like':'%'+_0x495305[_0x2229('0x42')]['filter']+'%'};return _0x451ec3;})});}_0x1c8df2=_['merge']({},_0x1c8df2,_0x495305[_0x2229('0x57')]);return db[_0x2229('0x9a')][_0x2229('0x30')]({'where':_0x1c8df2['where']})['then'](function(_0x3d8dd5){_0xe0e3cc[_0x2229('0x30')]=_0x3d8dd5;if(_0x495305[_0x2229('0x42')]['includeAll']){_0x1c8df2[_0x2229('0x56')]=[{'model':db[_0x2229('0x94')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x2229('0xbb'),'attributes':[_0x2229('0x38'),_0x2229('0xbc'),_0x2229('0xbd')],'required':![]},{'model':db[_0x2229('0xbe')],'as':'Tags','attributes':['id','name',_0x2229('0xbf')],'where':_0x495305[_0x2229('0x42')]['tag']?{'id':_0x495305[_0x2229('0x42')]['tag']}:undefined,'required':_0x495305[_0x2229('0x42')][_0x2229('0xc0')]?!![]:![]}];}return db[_0x2229('0x9a')][_0x2229('0x51')](_0x1c8df2);})[_0x2229('0x34')](function(_0x4a6250){_0xe0e3cc['rows']=_0x4a6250;return _0xe0e3cc;});}})[_0x2229('0x34')](respondWithFilteredResult(_0x4d2a61,_0x1c8df2))[_0x2229('0x28')](handleError(_0x4d2a61,null));};exports[_0x2229('0x39')]=function(_0x374598,_0xd9dda0,_0x579de7){var _0x2a55cf,_0x2483ed,_0x4db2bd;if(_[_0x2229('0x8f')](_0x374598[_0x2229('0x5a')][_0x2229('0x5a')])||_0x374598['body'][_0x2229('0x5a')]===''){throw new db[(_0x2229('0x8d'))]['ValidationError'](_0x2229('0x90'));}if(_[_0x2229('0x8f')](_0x374598[_0x2229('0x5a')]['to'])){throw new db[(_0x2229('0x8d'))][(_0x2229('0x73'))](_0x2229('0xc1'));}_0x2a55cf=_0x374598[_0x2229('0x5a')]['to'];return db[_0x2229('0x3c')][_0x2229('0x58')]({'where':{'id':_0x374598['params']['id']},'include':[{'model':db[_0x2229('0x93')],'as':_0x2229('0xc2'),'include':[{'model':db[_0x2229('0x94')],'as':_0x2229('0x98'),'where':{'mobile':_0x2a55cf},'limit':0x1,'order':[['updatedAt',_0x2229('0x95')]]}]}]})[_0x2229('0x34')](handleEntityNotFound(_0xd9dda0,null))[_0x2229('0x34')](function(_0x48ef9e){if(_0x48ef9e&&_0x48ef9e[_0x2229('0xc2')]){_0x2483ed=_0x48ef9e[_0x2229('0x35')]({'plain':!![]});if(_0x2483ed['List']&&_0x2483ed[_0x2229('0xc2')]['Contacts']['length']){return _0x2483ed[_0x2229('0xc2')][_0x2229('0x98')][0x0];}return db[_0x2229('0x94')]['create'](_[_0x2229('0x1b')](_0x374598['body'],{'firstName':_0x2a55cf,'mobile':_0x2a55cf,'phone':_0x2a55cf,'ListId':_0x2483ed['ListId']}));}})[_0x2229('0x34')](handleEntityNotFound(_0xd9dda0,null))[_0x2229('0x34')](function(_0x2978c3){if(_0x2978c3){_0x4db2bd=_0x2978c3;return db[_0x2229('0x9a')][_0x2229('0x58')]({'where':{'ContactId':_0x4db2bd['id'],'closed':![],'SmsAccountId':_0x2483ed['id']}})[_0x2229('0x34')](function(_0x47d02f){if(_0x47d02f){return[_0x47d02f,![]];}return db[_0x2229('0x9a')][_0x2229('0x59')]({'UserId':_0x374598[_0x2229('0x5d')]['id'],'ContactId':_0x4db2bd['id'],'SmsAccountId':_0x2483ed['id'],'phone':_0x2a55cf,'firstMsgDirection':_0x2229('0xc3'),'Messages':[_[_0x2229('0x4f')](_0x374598['body'],{'read':![],'body':_0x374598[_0x2229('0x5a')][_0x2229('0x5a')],'phone':_0x2a55cf,'SmsAccountId':_0x2483ed['id'],'UserId':_0x374598['user']['id'],'ContactId':_0x4db2bd['id']})]},{'include':[{'model':db[_0x2229('0xa1')],'as':_0x2229('0xc4')}]})[_0x2229('0x34')](function(_0x4ea181){return[_0x4ea181,!![]];});});}})[_0x2229('0x9b')](function(_0x32db62,_0x10bfa9){if(_0x10bfa9){return _0x32db62;}return db['SmsMessage'][_0x2229('0x59')](_['merge'](_0x374598[_0x2229('0x5a')],{'read':![],'body':_0x374598[_0x2229('0x5a')][_0x2229('0x5a')],'phone':_0x2a55cf,'SmsAccountId':_0x2483ed['id'],'SmsInteractionId':_0x32db62['id'],'UserId':_0x374598[_0x2229('0x5d')]['id'],'ContactId':_0x4db2bd['id']}))[_0x2229('0x34')](function(_0x561770){_0x32db62['dataValues'][_0x2229('0xc4')]=[];_0x32db62[_0x2229('0xc5')][_0x2229('0xc4')]['push'](_0x561770[_0x2229('0xc5')]);return _0x32db62;});})[_0x2229('0x34')](respondWithResult(_0xd9dda0,null))[_0x2229('0x28')](handleError(_0xd9dda0,null));};exports['status']=function(_0x330dba,_0x5738b3,_0x4eb178){if(_0x330dba[_0x2229('0x5a')]['id']){delete _0x330dba[_0x2229('0x5a')]['id'];}var _0x4f96b3,_0x2f4b6d,_0x11b9de;return db[_0x2229('0x3c')]['find']({'where':{'id':_0x330dba[_0x2229('0x54')]['id']}})['then'](handleEntityNotFound(_0x5738b3,null))[_0x2229('0x34')](function(_0x5b9b02){if(_0x5b9b02){_0x11b9de=_0x5b9b02;logger['debug'](_0x2229('0x23'),_0x2229('0x2a'),'received\x20delivery\x20report\x20from',_0x5b9b02[_0x2229('0x3f')],util[_0x2229('0xc6')](_0x330dba[_0x2229('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5b9b02['type']){case _0x2229('0x7e'):if(_0x330dba[_0x2229('0x5a')][_0x2229('0xc7')]&&_0x330dba[_0x2229('0x5a')][_0x2229('0x2a')]){_0x2f4b6d=_0x330dba['body']['status'];return db[_0x2229('0xa1')]['find']({'where':{'messageId':_0x330dba[_0x2229('0x5a')][_0x2229('0xc7')]}});}break;case _0x2229('0x80'):if(_0x330dba[_0x2229('0x5a')][_0x2229('0xc8')]&&_0x330dba['body']['statusInt']){_0x2f4b6d=_0x330dba[_0x2229('0x5a')][_0x2229('0xc9')];return db['SmsMessage'][_0x2229('0x58')]({'where':{'messageId':_0x330dba[_0x2229('0x5a')][_0x2229('0xc8')]}});}break;case _0x2229('0xca'):if(_0x330dba['body'][_0x2229('0x81')]&&_0x330dba['body']['status_code']){_0x2f4b6d=_0x330dba[_0x2229('0x5a')][_0x2229('0xcb')];return db['SmsMessage'][_0x2229('0x58')]({'where':{'messageId':_0x330dba[_0x2229('0x5a')][_0x2229('0x81')]}});}break;case'infobip':var _0x3c3e17=_0x330dba[_0x2229('0x5a')][_0x2229('0x85')][0x0];if(_0x3c3e17[_0x2229('0x7c')]&&_0x3c3e17[_0x2229('0x2a')][_0x2229('0xcc')]===_0x2229('0xcd')){_0x2f4b6d=_0x3c3e17[_0x2229('0x2a')][_0x2229('0xcc')];return db[_0x2229('0xa1')][_0x2229('0x58')]({'where':{'messageId':_0x3c3e17[_0x2229('0x7c')]}});}break;case'clickatell':if(_0x330dba[_0x2229('0x5a')][_0x2229('0x7c')]&&_0x330dba['body'][_0x2229('0x2a')]){_0x2f4b6d=_0x330dba[_0x2229('0x5a')]['status'];return db['SmsMessage'][_0x2229('0x58')]({'where':{'messageId':_0x330dba['body'][_0x2229('0x7c')]}});}break;case'bandwidth':if(_0x330dba['body'][0x0][_0x2229('0x26')]['id']){_0x2f4b6d=_0x330dba[_0x2229('0x5a')][0x0][_0x2229('0x3f')];return db[_0x2229('0xa1')]['find']({'where':{'messageId':_0x330dba[_0x2229('0x5a')][0x0][_0x2229('0x26')]['id']}});}break;case _0x2229('0x8b'):if(_0x330dba[_0x2229('0x5a')]['redif']&&_0x330dba[_0x2229('0x5a')][_0x2229('0x2a')]){_0x2f4b6d=_0x330dba['body'][_0x2229('0x2a')];return db[_0x2229('0xa1')][_0x2229('0x58')]({'where':{'messageId':_0x330dba[_0x2229('0x5a')][_0x2229('0xce')]}});}break;}}})[_0x2229('0x34')](handleEntityNotFound(_0x5738b3,null))[_0x2229('0x34')](function(_0x135ad8){if(_0x135ad8){_0x4f96b3=_0x135ad8;switch(_0x11b9de[_0x2229('0x3f')]){case'skebby':if(_0x2f4b6d===_0x2229('0xcd')){return _0x4f96b3[_0x2229('0x33')]({'read':!![]});}else{logger['error'](_0x2229('0x23'),_0x2229('0x2a'),_0x2229('0x7e'),util[_0x2229('0xc6')](_0x330dba[_0x2229('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2229('0x80'):if(_0x2f4b6d==='1'){return _0x4f96b3[_0x2229('0x33')]({'read':!![]});}else{logger[_0x2229('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2229('0x7e'),util['inspect'](_0x330dba['body'],{'showHidden':![],'depth':null}));}break;case _0x2229('0xca'):if(!_0x330dba[_0x2229('0x5a')][_0x2229('0xcf')]&&_0x2f4b6d>=0xc8&&_0x2f4b6d<=0xce){return _0x4f96b3['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2229('0xca'),util[_0x2229('0xc6')](_0x330dba[_0x2229('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2229('0x84'):var _0x49024d=_0x330dba['body'][_0x2229('0x85')][0x0];if(_0x49024d[_0x2229('0x2a')][_0x2229('0xcc')]===_0x2229('0xcd')){return _0x4f96b3[_0x2229('0x33')]({'read':!![]});}else{logger[_0x2229('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2229('0x2a'),_0x2229('0x84'),util[_0x2229('0xc6')](_0x330dba[_0x2229('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2f4b6d==_0x2229('0xd0')||_0x2f4b6d==_0x2229('0xd1')){return _0x4f96b3[_0x2229('0x33')]({'read':!![]});}else{logger['error'](_0x2229('0x23'),_0x2229('0x2a'),'clickatell',util[_0x2229('0xc6')](_0x330dba[_0x2229('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x2f4b6d=='message-delivered'){return _0x4f96b3['update']({'read':!![]});}else{logger[_0x2229('0x25')](_0x2229('0x23'),_0x2229('0x2a'),_0x2229('0x8a'),util[_0x2229('0xc6')](_0x330dba[_0x2229('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2229('0x8b'):if(_0x2f4b6d===_0x2229('0xd2')||_0x2f4b6d===_0x2229('0xd3')){return _0x4f96b3[_0x2229('0x33')]({'read':!![]});}else{logger['error'](_0x2229('0x23'),_0x2229('0x2a'),_0x2229('0x8b'),util['inspect'](_0x330dba['body'],{'showHidden':![],'depth':null}));}break;}return _0x4f96b3;}})[_0x2229('0x34')](respondWithResult(_0x5738b3,null))[_0x2229('0x28')](handleError(_0x5738b3,null));};exports[_0x2229('0xd4')]=function(_0x418910,_0x3f50ff,_0x911392){var _0x58f99c,_0x5bba44,_0x1ea0fe;return db['SmsAccount']['find']({'where':{'id':_0x418910[_0x2229('0x54')]['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x3f50ff,null))[_0x2229('0x34')](function(_0x16057d){if(_0x16057d){_0x1ea0fe=_0x16057d;logger[_0x2229('0x22')](_0x2229('0x23'),_0x2229('0x2a'),_0x2229('0xd5'),_0x16057d[_0x2229('0x3f')],util[_0x2229('0xc6')](_0x418910[_0x2229('0x42')],{'showHidden':![],'depth':null}));switch(_0x16057d['type']){case _0x2229('0x86'):if(_0x418910[_0x2229('0x42')][_0x2229('0xd6')]&&_0x418910[_0x2229('0x42')][_0x2229('0xd7')]){_0x5bba44=_0x418910[_0x2229('0x42')][_0x2229('0xd7')];return db[_0x2229('0xa1')][_0x2229('0x58')]({'where':{'messageId':_0x418910['query']['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x3f50ff,null))[_0x2229('0x34')](function(_0x28c894){if(_0x28c894){_0x58f99c=_0x28c894;switch(_0x1ea0fe[_0x2229('0x3f')]){case _0x2229('0x86'):if(_0x5bba44==='2'||_0x5bba44==='6'){return _0x58f99c[_0x2229('0x33')]({'read':!![]});}else{logger[_0x2229('0x25')](_0x2229('0x23'),'status',_0x2229('0x86'),util[_0x2229('0xc6')](_0x418910[_0x2229('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x58f99c;}})[_0x2229('0x34')](respondWithResult(_0x3f50ff,null))[_0x2229('0x28')](handleError(_0x3f50ff,null));};exports[_0x2229('0xd8')]=function(_0x360909,_0x1547f1,_0x64f85a){return db['SmsAccount'][_0x2229('0x58')]({'where':{'id':_0x360909[_0x2229('0x54')]['id']}})['then'](handleEntityNotFound(_0x1547f1,null))[_0x2229('0x34')](function(_0x3c5a84){if(_0x3c5a84){return _0x3c5a84[_0x2229('0xd8')](_0x360909['body'][_0x2229('0x68')],_[_0x2229('0x97')](_0x360909[_0x2229('0x5a')],[_0x2229('0x68'),'id'])||{})[_0x2229('0x9b')](function(_0x2174c6){for(var _0x513903=0x0;_0x513903<_0x360909[_0x2229('0x5a')][_0x2229('0x68')][_0x2229('0x48')];_0x513903+=0x1){socket[_0x2229('0xd9')]('userSmsAccount:save',{'UserId':Number(_0x360909[_0x2229('0x5a')][_0x2229('0x68')][_0x513903]),'SmsAccountId':Number(_0x360909[_0x2229('0x54')]['id'])});}return _0x2174c6;});}})[_0x2229('0x34')](respondWithResult(_0x1547f1,null))[_0x2229('0x28')](handleError(_0x1547f1,null));};exports['removeAgents']=function(_0x1739fb,_0x2ba2b6,_0x5cb634){return db[_0x2229('0x3c')][_0x2229('0x58')]({'where':{'id':_0x1739fb['params']['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x2ba2b6,null))[_0x2229('0x34')](function(_0x50e6dc){if(_0x50e6dc){return _0x50e6dc[_0x2229('0xda')](_0x1739fb['query'][_0x2229('0x68')])[_0x2229('0x34')](function(){if(_[_0x2229('0xdb')](_0x1739fb[_0x2229('0x42')][_0x2229('0x68')])){for(var _0x4a259d=0x0;_0x4a259d<_0x1739fb[_0x2229('0x42')][_0x2229('0x68')]['length'];_0x4a259d+=0x1){socket[_0x2229('0xd9')](_0x2229('0xdc'),{'UserId':Number(_0x1739fb[_0x2229('0x42')][_0x2229('0x68')][_0x4a259d]),'SmsAccountId':Number(_0x1739fb['params']['id'])});}}else{socket[_0x2229('0xd9')]('userSmsAccount:remove',{'UserId':Number(_0x1739fb[_0x2229('0x42')][_0x2229('0x68')]),'SmsAccountId':Number(_0x1739fb[_0x2229('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x2ba2b6,null))[_0x2229('0x28')](handleError(_0x2ba2b6,null));};exports['getAgents']=function(_0x2adac3,_0x3b1052,_0x23710c){var _0x168449={};var _0x5005e8={};var _0x560a71;var _0x49887d;return db[_0x2229('0x3c')][_0x2229('0xb8')]({'where':{'id':_0x2adac3[_0x2229('0x54')]['id']}})[_0x2229('0x34')](handleEntityNotFound(_0x3b1052,null))[_0x2229('0x34')](function(_0x25871a){if(_0x25871a){_0x560a71=_0x25871a;_0x5005e8[_0x2229('0x41')]=_['keys'](db['User']['rawAttributes']);_0x5005e8[_0x2229('0x42')]=_[_0x2229('0x43')](_0x2adac3[_0x2229('0x42')]);_0x5005e8[_0x2229('0x44')]=_['intersection'](_0x5005e8[_0x2229('0x41')],_0x5005e8[_0x2229('0x42')]);_0x168449[_0x2229('0x47')]=_['intersection'](_0x5005e8['model'],qs['fields'](_0x2adac3[_0x2229('0x42')][_0x2229('0x46')]));_0x168449['attributes']=_0x168449[_0x2229('0x47')][_0x2229('0x48')]?_0x168449[_0x2229('0x47')]:_0x5005e8[_0x2229('0x41')];_0x168449[_0x2229('0x69')]=qs['sort'](_0x2adac3[_0x2229('0x42')][_0x2229('0x65')]);_0x168449[_0x2229('0x4a')]=qs[_0x2229('0x44')](_[_0x2229('0x4b')](_0x2adac3[_0x2229('0x42')],_0x5005e8[_0x2229('0x44')]));if(_0x2adac3[_0x2229('0x42')][_0x2229('0x4c')]){_0x168449[_0x2229('0x4a')]=_[_0x2229('0x4f')](_0x168449[_0x2229('0x4a')],{'$or':_['map'](_0x168449[_0x2229('0x47')],function(_0xd8e517){var _0x5a3fa0={};_0x5a3fa0[_0xd8e517]={'$like':'%'+_0x2adac3['query']['filter']+'%'};return _0x5a3fa0;})});}_0x168449=_['merge']({},_0x168449,_0x2adac3[_0x2229('0x57')]);return _0x560a71[_0x2229('0xdd')](_0x168449);}})['then'](function(_0x2e9da2){if(_0x2e9da2){_0x49887d=_0x2e9da2[_0x2229('0x48')];if(!_0x2adac3[_0x2229('0x42')][_0x2229('0x49')](_0x2229('0x64'))){_0x168449[_0x2229('0x2f')]=qs[_0x2229('0x2f')](_0x2adac3[_0x2229('0x42')][_0x2229('0x2f')]);_0x168449[_0x2229('0x2d')]=qs['offset'](_0x2adac3[_0x2229('0x42')][_0x2229('0x2d')]);}return _0x560a71['getAgents'](_0x168449);}})[_0x2229('0x34')](function(_0x2fbd23){if(_0x2fbd23){return _0x2fbd23?{'count':_0x49887d,'rows':_0x2fbd23}:null;}})[_0x2229('0x34')](respondWithResult(_0x3b1052,null))[_0x2229('0x28')](handleError(_0x3b1052,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index d56ef20..f05d39f 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 _0x6bfa=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x2147f0,_0x3e93d1){var _0x27b8f1=function(_0x5ba64c){while(--_0x5ba64c){_0x2147f0['push'](_0x2147f0['shift']());}};_0x27b8f1(++_0x3e93d1);}(_0x6bfa,0x1f0));var _0xa6bf=function(_0x369ff2,_0x466a61){_0x369ff2=_0x369ff2-0x0;var _0xb53a59=_0x6bfa[_0x369ff2];return _0xb53a59;};'use strict';var EventEmitter=require(_0xa6bf('0x0'));var SmsAccount=require(_0xa6bf('0x1'))['db'][_0xa6bf('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa6bf('0x3')](0x0);var events={'afterCreate':_0xa6bf('0x4'),'afterUpdate':'update','afterDestroy':_0xa6bf('0x5')};function emitEvent(_0x410378){return function(_0x10a35e,_0x45f523,_0x3e2403){SmsAccountEvents['emit'](_0x410378+':'+_0x10a35e['id'],_0x10a35e);SmsAccountEvents[_0xa6bf('0x6')](_0x410378,_0x10a35e);_0x3e2403(null);};}for(var e in events){if(events[_0xa6bf('0x7')](e)){var event=events[e];SmsAccount[_0xa6bf('0x8')](e,emitEvent(event));}}module[_0xa6bf('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x2565=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x380718,_0x2661bb){var _0x26e175=function(_0x93fc83){while(--_0x93fc83){_0x380718['push'](_0x380718['shift']());}};_0x26e175(++_0x2661bb);}(_0x2565,0x1cc));var _0x5256=function(_0x5b7c15,_0x964668){_0x5b7c15=_0x5b7c15-0x0;var _0xcdb61a=_0x2565[_0x5b7c15];return _0xcdb61a;};'use strict';var EventEmitter=require(_0x5256('0x0'));var SmsAccount=require(_0x5256('0x1'))['db'][_0x5256('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5256('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5256('0x4')};function emitEvent(_0x1ff0d1){return function(_0x2057b9,_0x47d3ee,_0x40d455){SmsAccountEvents['emit'](_0x1ff0d1+':'+_0x2057b9['id'],_0x2057b9);SmsAccountEvents[_0x5256('0x5')](_0x1ff0d1,_0x2057b9);_0x40d455(null);};}for(var e in events){if(events[_0x5256('0x6')](e)){var event=events[e];SmsAccount[_0x5256('0x7')](e,emitEvent(event));}}module[_0x5256('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 1b74da0..79943b0 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 _0xbd8e=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','moment'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbd8e[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xebd8('0x0'));var util=require(_0xebd8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xebd8('0x2'));var BPromise=require('bluebird');var rp=require(_0xebd8('0x3'));var fs=require('fs');var path=require(_0xebd8('0x4'));var rimraf=require(_0xebd8('0x5'));var config=require(_0xebd8('0x6'));var attributes=require(_0xebd8('0x7'));module['exports']=function(_0x225b6e,_0x1ef9d9){return _0x225b6e[_0xebd8('0x8')](_0xebd8('0x9'),attributes,{'tableName':_0xebd8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f44=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','moment','bluebird','path'];(function(_0x580973,_0x45f49f){var _0x1079b0=function(_0x5e66e7){while(--_0x5e66e7){_0x580973['push'](_0x580973['shift']());}};_0x1079b0(++_0x45f49f);}(_0x8f44,0xd7));var _0x48f4=function(_0x420501,_0x4f5374){_0x420501=_0x420501-0x0;var _0x303742=_0x8f44[_0x420501];return _0x303742;};'use strict';var _=require(_0x48f4('0x0'));var util=require(_0x48f4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x48f4('0x2'));var BPromise=require(_0x48f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48f4('0x4'));var rimraf=require('rimraf');var config=require(_0x48f4('0x5'));var attributes=require(_0x48f4('0x6'));module[_0x48f4('0x7')]=function(_0x369c6b,_0x360c52){return _0x369c6b[_0x48f4('0x8')](_0x48f4('0x9'),attributes,{'tableName':_0x48f4('0xa'),'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 cdd5adc..393b094 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 _0x25bb=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','SmsAccount','options','raw','attributes','include','map','model','ShowSmsAccount','lodash'];(function(_0xa5d9f9,_0x17c6bf){var _0x40e9f6=function(_0x1c2585){while(--_0x1c2585){_0xa5d9f9['push'](_0xa5d9f9['shift']());}};_0x40e9f6(++_0x17c6bf);}(_0x25bb,0x1ac));var _0xb25b=function(_0x30a5a7,_0x554107){_0x30a5a7=_0x30a5a7-0x0;var _0x319de3=_0x25bb[_0x30a5a7];return _0x319de3;};'use strict';var _=require(_0xb25b('0x0'));var util=require(_0xb25b('0x1'));var moment=require(_0xb25b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb25b('0x3'));var db=require(_0xb25b('0x4'))['db'];var utils=require(_0xb25b('0x5'));var logger=require(_0xb25b('0x6'))(_0xb25b('0x7'));var config=require(_0xb25b('0x8'));var jayson=require(_0xb25b('0x9'));var client=jayson[_0xb25b('0xa')][_0xb25b('0xb')]({'port':0x232a});config[_0xb25b('0xc')]=_[_0xb25b('0xd')](config['redis'],{'host':_0xb25b('0xe'),'port':0x18eb});var socket=require(_0xb25b('0xf'))(new Redis(config[_0xb25b('0xc')]));require(_0xb25b('0x10'))[_0xb25b('0x11')](socket);function respondWithRpcPromise(_0x4dd3b8,_0x17b400,_0x1037b0){return new BPromise(function(_0x832768,_0xd41694){return client[_0xb25b('0x12')](_0x4dd3b8,_0x1037b0)[_0xb25b('0x13')](function(_0x14ce78){logger[_0xb25b('0x14')]('SmsAccount,\x20%s,\x20%s',_0x17b400,_0xb25b('0x15'));logger[_0xb25b('0x16')](_0xb25b('0x17'),_0x17b400,_0xb25b('0x15'),JSON[_0xb25b('0x18')](_0x14ce78));if(_0x14ce78['error']){if(_0x14ce78[_0xb25b('0x19')][_0xb25b('0x1a')]===0x1f4){logger[_0xb25b('0x19')](_0xb25b('0x1b'),_0x17b400,_0x14ce78['error'][_0xb25b('0x1c')]);return _0xd41694(_0x14ce78['error'][_0xb25b('0x1c')]);}logger[_0xb25b('0x19')](_0xb25b('0x1b'),_0x17b400,_0x14ce78[_0xb25b('0x19')][_0xb25b('0x1c')]);return _0x832768(_0x14ce78[_0xb25b('0x19')][_0xb25b('0x1c')]);}else{logger[_0xb25b('0x14')]('SmsAccount,\x20%s,\x20%s',_0x17b400,_0xb25b('0x15'));_0x832768(_0x14ce78[_0xb25b('0x1d')][_0xb25b('0x1c')]);}})[_0xb25b('0x1e')](function(_0x18c6ab){logger[_0xb25b('0x19')](_0xb25b('0x1b'),_0x17b400,_0x18c6ab);_0xd41694(_0x18c6ab);});});}exports['ShowSmsAccount']=function(_0x166a30){var _0x116e6b=this;return new Promise(function(_0x4985b7,_0x445202){return db[_0xb25b('0x1f')]['find']({'raw':_0x166a30[_0xb25b('0x20')]?_0x166a30['options'][_0xb25b('0x21')]===undefined?!![]:![]:!![],'where':_0x166a30['options']?_0x166a30[_0xb25b('0x20')]['where']||null:null,'attributes':_0x166a30[_0xb25b('0x20')]?_0x166a30[_0xb25b('0x20')][_0xb25b('0x22')]||null:null,'include':_0x166a30['options']?_0x166a30[_0xb25b('0x20')][_0xb25b('0x23')]?_[_0xb25b('0x24')](_0x166a30[_0xb25b('0x20')]['include'],function(_0x449c15){return{'model':db[_0x449c15[_0xb25b('0x25')]],'as':_0x449c15['as'],'attributes':_0x449c15[_0xb25b('0x22')],'include':_0x449c15[_0xb25b('0x23')]?_[_0xb25b('0x24')](_0x449c15['include'],function(_0x5d1c25){return{'model':db[_0x5d1c25[_0xb25b('0x25')]],'as':_0x5d1c25['as'],'attributes':_0x5d1c25[_0xb25b('0x22')],'include':_0x5d1c25[_0xb25b('0x23')]?_[_0xb25b('0x24')](_0x5d1c25['include'],function(_0xba35c4){return{'model':db[_0xba35c4['model']],'as':_0xba35c4['as'],'attributes':_0xba35c4[_0xb25b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb25b('0x13')](function(_0x40de8d){logger['info'](_0xb25b('0x26'),_0x166a30);logger[_0xb25b('0x16')](_0xb25b('0x26'),_0x166a30,JSON[_0xb25b('0x18')](_0x40de8d));_0x4985b7(_0x40de8d);})['catch'](function(_0x2d205d){logger[_0xb25b('0x19')](_0xb25b('0x26'),_0x2d205d[_0xb25b('0x1c')],_0x166a30);_0x445202(_0x116e6b[_0xb25b('0x19')](0x1f4,_0x2d205d[_0xb25b('0x1c')]));});});}; \ No newline at end of file +var _0x6eec=['error','code','message','SmsAccount','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','stringify'];(function(_0x3e845b,_0x5ae50b){var _0x425a54=function(_0x72d265){while(--_0x72d265){_0x3e845b['push'](_0x3e845b['shift']());}};_0x425a54(++_0x5ae50b);}(_0x6eec,0x136));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6ee('0x0'));var util=require(_0xc6ee('0x1'));var moment=require('moment');var BPromise=require(_0xc6ee('0x2'));var rs=require(_0xc6ee('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6ee('0x4'))['db'];var utils=require(_0xc6ee('0x5'));var logger=require(_0xc6ee('0x6'))(_0xc6ee('0x7'));var config=require(_0xc6ee('0x8'));var jayson=require(_0xc6ee('0x9'));var client=jayson[_0xc6ee('0xa')][_0xc6ee('0xb')]({'port':0x232a});config[_0xc6ee('0xc')]=_[_0xc6ee('0xd')](config[_0xc6ee('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6ee('0xe'))(new Redis(config['redis']));require(_0xc6ee('0xf'))[_0xc6ee('0x10')](socket);function respondWithRpcPromise(_0x1fcac2,_0x904e92,_0x31ee2a){return new BPromise(function(_0x484663,_0x5dcb57){return client[_0xc6ee('0x11')](_0x1fcac2,_0x31ee2a)[_0xc6ee('0x12')](function(_0x20031e){logger[_0xc6ee('0x13')](_0xc6ee('0x14'),_0x904e92,'request\x20sent');logger[_0xc6ee('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x904e92,'request\x20sent',JSON[_0xc6ee('0x16')](_0x20031e));if(_0x20031e[_0xc6ee('0x17')]){if(_0x20031e[_0xc6ee('0x17')][_0xc6ee('0x18')]===0x1f4){logger[_0xc6ee('0x17')](_0xc6ee('0x14'),_0x904e92,_0x20031e[_0xc6ee('0x17')][_0xc6ee('0x19')]);return _0x5dcb57(_0x20031e['error'][_0xc6ee('0x19')]);}logger[_0xc6ee('0x17')](_0xc6ee('0x14'),_0x904e92,_0x20031e[_0xc6ee('0x17')]['message']);return _0x484663(_0x20031e[_0xc6ee('0x17')][_0xc6ee('0x19')]);}else{logger[_0xc6ee('0x13')](_0xc6ee('0x14'),_0x904e92,'request\x20sent');_0x484663(_0x20031e['result'][_0xc6ee('0x19')]);}})['catch'](function(_0x348ce1){logger[_0xc6ee('0x17')](_0xc6ee('0x14'),_0x904e92,_0x348ce1);_0x5dcb57(_0x348ce1);});});}exports['ShowSmsAccount']=function(_0x29f1f2){var _0x357775=this;return new Promise(function(_0x1b41e6,_0x1c901a){return db[_0xc6ee('0x1a')][_0xc6ee('0x1b')]({'raw':_0x29f1f2['options']?_0x29f1f2[_0xc6ee('0x1c')][_0xc6ee('0x1d')]===undefined?!![]:![]:!![],'where':_0x29f1f2[_0xc6ee('0x1c')]?_0x29f1f2['options'][_0xc6ee('0x1e')]||null:null,'attributes':_0x29f1f2[_0xc6ee('0x1c')]?_0x29f1f2[_0xc6ee('0x1c')][_0xc6ee('0x1f')]||null:null,'include':_0x29f1f2[_0xc6ee('0x1c')]?_0x29f1f2[_0xc6ee('0x1c')]['include']?_['map'](_0x29f1f2[_0xc6ee('0x1c')][_0xc6ee('0x20')],function(_0x7e19a4){return{'model':db[_0x7e19a4[_0xc6ee('0x21')]],'as':_0x7e19a4['as'],'attributes':_0x7e19a4[_0xc6ee('0x1f')],'include':_0x7e19a4[_0xc6ee('0x20')]?_[_0xc6ee('0x22')](_0x7e19a4['include'],function(_0x22ae3f){return{'model':db[_0x22ae3f[_0xc6ee('0x21')]],'as':_0x22ae3f['as'],'attributes':_0x22ae3f[_0xc6ee('0x1f')],'include':_0x22ae3f[_0xc6ee('0x20')]?_[_0xc6ee('0x22')](_0x22ae3f['include'],function(_0x5e9cfd){return{'model':db[_0x5e9cfd[_0xc6ee('0x21')]],'as':_0x5e9cfd['as'],'attributes':_0x5e9cfd[_0xc6ee('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc6ee('0x12')](function(_0x16b91a){logger[_0xc6ee('0x13')](_0xc6ee('0x23'),_0x29f1f2);logger[_0xc6ee('0x15')]('ShowSmsAccount',_0x29f1f2,JSON[_0xc6ee('0x16')](_0x16b91a));_0x1b41e6(_0x16b91a);})[_0xc6ee('0x24')](function(_0x5af13f){logger['error'](_0xc6ee('0x23'),_0x5af13f['message'],_0x29f1f2);_0x1c901a(_0x357775[_0xc6ee('0x17')](0x1f4,_0x5af13f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f361a4d..8137e32 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 _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.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(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 1c062bc..92d43d8 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x3ee44d,_0x17c3ad){var _0x3599a0=function(_0x38eb01){while(--_0x38eb01){_0x3ee44d['push'](_0x3ee44d['shift']());}};_0x3599a0(++_0x17c3ad);}(_0x3e74,0x175));var _0x43e7=function(_0x3b2b72,_0x332d89){_0x3b2b72=_0x3b2b72-0x0;var _0x57af84=_0x3e74[_0x3b2b72];return _0x57af84;};'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 fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x762099,_0x4e03e4){var _0x2c0495=function(_0x2876cf){while(--_0x2876cf){_0x762099['push'](_0x762099['shift']());}};_0x2c0495(++_0x4e03e4);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'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 fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index da606c3..76930d5 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 _0x6351=['STRING','noop','TEXT','INTEGER'];(function(_0x5e3ed4,_0x2f690e){var _0xe2e0a8=function(_0x5344c4){while(--_0x5344c4){_0x5e3ed4['push'](_0x5e3ed4['shift']());}};_0xe2e0a8(++_0x2f690e);}(_0x6351,0x1c3));var _0x1635=function(_0xa5b3f7,_0x32993c){_0xa5b3f7=_0xa5b3f7-0x0;var _0x514b5f=_0x6351[_0xa5b3f7];return _0x514b5f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x1635('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x1635('0x1')],'allowNull':![],'defaultValue':_0x1635('0x2')},'appdata':{'type':Sequelize[_0x1635('0x3')]()},'description':{'type':Sequelize[_0x1635('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5f5e=['TEXT','*,*,*,*','exports','STRING'];(function(_0x26fdec,_0x46c36c){var _0x46b276=function(_0x1608b6){while(--_0x1608b6){_0x26fdec['push'](_0x26fdec['shift']());}};_0x46b276(++_0x46c36c);}(_0x5f5e,0xd6));var _0xe5f5=function(_0x5e15b5,_0x43036b){_0x5e15b5=_0x5e15b5-0x0;var _0x13cd01=_0x5f5e[_0x5e15b5];return _0x13cd01;};'use strict';var Sequelize=require('sequelize');module[_0xe5f5('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe5f5('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe5f5('0x2')]()},'description':{'type':Sequelize[_0xe5f5('0x1')]},'interval':{'type':Sequelize[_0xe5f5('0x1')],'defaultValue':_0xe5f5('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 779e950..6085982 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 _0xaf45=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','SmsApplication','rows','show','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4df402,_0x4e1421){var _0x36b8f5=function(_0x531daa){while(--_0x531daa){_0x4df402['push'](_0x4df402['shift']());}};_0x36b8f5(++_0x4e1421);}(_0xaf45,0xc3));var _0x5af4=function(_0x335e24,_0x3fbd76){_0x335e24=_0x335e24-0x0;var _0x3e3b08=_0xaf45[_0x335e24];return _0x3e3b08;};'use strict';var emlformat=require(_0x5af4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5af4('0x1'));var jsonpatch=require(_0x5af4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5af4('0x3'));var Mustache=require('mustache');var util=require(_0x5af4('0x4'));var path=require('path');var sox=require(_0x5af4('0x5'));var csv=require(_0x5af4('0x6'));var ejs=require(_0x5af4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5af4('0x8'));var squel=require(_0x5af4('0x9'));var crypto=require(_0x5af4('0xa'));var jsforce=require(_0x5af4('0xb'));var deskjs=require(_0x5af4('0xc'));var toCsv=require(_0x5af4('0x6'));var querystring=require(_0x5af4('0xd'));var Papa=require(_0x5af4('0xe'));var Redis=require(_0x5af4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5af4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5af4('0x11'));var logger=require(_0x5af4('0x12'))('api');var utils=require(_0x5af4('0x13'));var config=require(_0x5af4('0x14'));var licenseUtil=require(_0x5af4('0x15'));var db=require(_0x5af4('0x16'))['db'];function respondWithStatusCode(_0xb0f58f,_0x2ed94d){_0x2ed94d=_0x2ed94d||0xcc;return function(_0x44a1b9){if(_0x44a1b9){return _0xb0f58f['sendStatus'](_0x2ed94d);}return _0xb0f58f[_0x5af4('0x17')](_0x2ed94d)[_0x5af4('0x18')]();};}function respondWithResult(_0x3f0620,_0x10e935){_0x10e935=_0x10e935||0xc8;return function(_0x1eabb4){if(_0x1eabb4){return _0x3f0620[_0x5af4('0x17')](_0x10e935)[_0x5af4('0x19')](_0x1eabb4);}};}function respondWithFilteredResult(_0x42cae1,_0x4133b2){return function(_0x598248){if(_0x598248){var _0xd446fc=typeof _0x4133b2[_0x5af4('0x1a')]===_0x5af4('0x1b')&&typeof _0x4133b2['limit']===_0x5af4('0x1b');var _0x43bd38=_0x598248['count'];var _0x509e9c=_0xd446fc?0x0:_0x4133b2[_0x5af4('0x1a')];var _0x109f24=_0xd446fc?_0x598248['count']:_0x4133b2[_0x5af4('0x1a')]+_0x4133b2['limit'];var _0x140347;if(_0x109f24>=_0x43bd38){_0x109f24=_0x43bd38;_0x140347=0xc8;}else{_0x140347=0xce;}_0x42cae1['status'](_0x140347);return _0x42cae1['set'](_0x5af4('0x1c'),_0x509e9c+'-'+_0x109f24+'/'+_0x43bd38)[_0x5af4('0x19')](_0x598248);}return null;};}function patchUpdates(_0x6b8171){return function(_0x2f8a71){try{jsonpatch[_0x5af4('0x1d')](_0x2f8a71,_0x6b8171,!![]);}catch(_0x2bb86e){return BPromise[_0x5af4('0x1e')](_0x2bb86e);}return _0x2f8a71['save']();};}function saveUpdates(_0x525c05,_0x3b1145){return function(_0x592756){if(_0x592756){return _0x592756[_0x5af4('0x1f')](_0x525c05)[_0x5af4('0x20')](function(_0x23fb6c){return _0x23fb6c;});}return null;};}function removeEntity(_0x1d24d1,_0x48c66d){return function(_0xe92493){if(_0xe92493){return _0xe92493[_0x5af4('0x21')]()['then'](function(){_0x1d24d1['status'](0xcc)[_0x5af4('0x18')]();});}};}function handleEntityNotFound(_0x389e1d,_0x4261db){return function(_0x185b66){if(!_0x185b66){_0x389e1d[_0x5af4('0x22')](0x194);}return _0x185b66;};}function handleError(_0x5f1d00,_0x26a2d4){_0x26a2d4=_0x26a2d4||0x1f4;return function(_0x73e46b){logger[_0x5af4('0x23')](_0x73e46b['stack']);if(_0x73e46b[_0x5af4('0x24')]){delete _0x73e46b[_0x5af4('0x24')];}_0x5f1d00[_0x5af4('0x17')](_0x26a2d4)['send'](_0x73e46b);};}exports[_0x5af4('0x25')]=function(_0x48d40d,_0x14c6a0){var _0x3eff5d={},_0x4de8c3={},_0x4e3171={'count':0x0,'rows':[]};var _0x2a7996=_['map'](db['SmsApplication'][_0x5af4('0x26')],function(_0x3f2436){return{'name':_0x3f2436['fieldName'],'type':_0x3f2436[_0x5af4('0x27')][_0x5af4('0x28')]};});_0x4de8c3[_0x5af4('0x29')]=_[_0x5af4('0x2a')](_0x2a7996,_0x5af4('0x24'));_0x4de8c3[_0x5af4('0x2b')]=_[_0x5af4('0x2c')](_0x48d40d[_0x5af4('0x2b')]);_0x4de8c3[_0x5af4('0x2d')]=_[_0x5af4('0x2e')](_0x4de8c3[_0x5af4('0x29')],_0x4de8c3[_0x5af4('0x2b')]);_0x3eff5d['attributes']=_[_0x5af4('0x2e')](_0x4de8c3['model'],qs[_0x5af4('0x2f')](_0x48d40d['query'][_0x5af4('0x2f')]));_0x3eff5d[_0x5af4('0x30')]=_0x3eff5d[_0x5af4('0x30')][_0x5af4('0x31')]?_0x3eff5d[_0x5af4('0x30')]:_0x4de8c3[_0x5af4('0x29')];if(!_0x48d40d[_0x5af4('0x2b')][_0x5af4('0x32')](_0x5af4('0x33'))){_0x3eff5d[_0x5af4('0x34')]=qs[_0x5af4('0x34')](_0x48d40d[_0x5af4('0x2b')][_0x5af4('0x34')]);_0x3eff5d[_0x5af4('0x1a')]=qs[_0x5af4('0x1a')](_0x48d40d[_0x5af4('0x2b')]['offset']);}_0x3eff5d['order']=qs[_0x5af4('0x35')](_0x48d40d[_0x5af4('0x2b')]['sort']);_0x3eff5d[_0x5af4('0x36')]=qs[_0x5af4('0x2d')](_['pick'](_0x48d40d[_0x5af4('0x2b')],_0x4de8c3[_0x5af4('0x2d')]),_0x2a7996);if(_0x48d40d[_0x5af4('0x2b')][_0x5af4('0x37')]){_0x3eff5d[_0x5af4('0x36')]=_[_0x5af4('0x38')](_0x3eff5d[_0x5af4('0x36')],{'$or':_['map'](_0x2a7996,function(_0x5f2b59){if(_0x5f2b59['type']!==_0x5af4('0x39')){var _0x8b5c2c={};_0x8b5c2c[_0x5f2b59[_0x5af4('0x24')]]={'$like':'%'+_0x48d40d[_0x5af4('0x2b')][_0x5af4('0x37')]+'%'};return _0x8b5c2c;}})});}_0x3eff5d=_[_0x5af4('0x38')]({},_0x3eff5d,_0x48d40d[_0x5af4('0x3a')]);var _0x3d3b12={'where':_0x3eff5d[_0x5af4('0x36')]};return db['SmsApplication'][_0x5af4('0x3b')](_0x3d3b12)[_0x5af4('0x20')](function(_0x5b85be){_0x4e3171[_0x5af4('0x3b')]=_0x5b85be;if(_0x48d40d['query'][_0x5af4('0x3c')]){_0x3eff5d['include']=[{'all':!![]}];}return db[_0x5af4('0x3d')]['findAll'](_0x3eff5d);})[_0x5af4('0x20')](function(_0x3202e4){_0x4e3171[_0x5af4('0x3e')]=_0x3202e4;return _0x4e3171;})['then'](respondWithFilteredResult(_0x14c6a0,_0x3eff5d))['catch'](handleError(_0x14c6a0,null));};exports[_0x5af4('0x3f')]=function(_0x17b3e5,_0x320df9){var _0x274e3c={'raw':!![],'where':{'id':_0x17b3e5[_0x5af4('0x40')]['id']}},_0x2ddf97={};_0x2ddf97[_0x5af4('0x29')]=_['keys'](db['SmsApplication'][_0x5af4('0x26')]);_0x2ddf97[_0x5af4('0x2b')]=_[_0x5af4('0x2c')](_0x17b3e5[_0x5af4('0x2b')]);_0x2ddf97[_0x5af4('0x2d')]=_[_0x5af4('0x2e')](_0x2ddf97['model'],_0x2ddf97[_0x5af4('0x2b')]);_0x274e3c['attributes']=_[_0x5af4('0x2e')](_0x2ddf97[_0x5af4('0x29')],qs[_0x5af4('0x2f')](_0x17b3e5[_0x5af4('0x2b')][_0x5af4('0x2f')]));_0x274e3c[_0x5af4('0x30')]=_0x274e3c['attributes']['length']?_0x274e3c[_0x5af4('0x30')]:_0x2ddf97[_0x5af4('0x29')];if(_0x17b3e5[_0x5af4('0x2b')][_0x5af4('0x3c')]){_0x274e3c[_0x5af4('0x41')]=[{'all':!![]}];}_0x274e3c=_[_0x5af4('0x38')]({},_0x274e3c,_0x17b3e5[_0x5af4('0x3a')]);return db[_0x5af4('0x3d')][_0x5af4('0x42')](_0x274e3c)[_0x5af4('0x20')](handleEntityNotFound(_0x320df9,null))[_0x5af4('0x20')](respondWithResult(_0x320df9,null))[_0x5af4('0x43')](handleError(_0x320df9,null));};exports[_0x5af4('0x44')]=function(_0x1efaa8,_0x2c6cd9){return db['SmsApplication']['create'](_0x1efaa8[_0x5af4('0x45')],{})[_0x5af4('0x20')](respondWithResult(_0x2c6cd9,0xc9))[_0x5af4('0x43')](handleError(_0x2c6cd9,null));};exports[_0x5af4('0x1f')]=function(_0x519830,_0x575166){if(_0x519830[_0x5af4('0x45')]['id']){delete _0x519830[_0x5af4('0x45')]['id'];}return db[_0x5af4('0x3d')]['find']({'where':{'id':_0x519830[_0x5af4('0x40')]['id']}})[_0x5af4('0x20')](handleEntityNotFound(_0x575166,null))[_0x5af4('0x20')](saveUpdates(_0x519830[_0x5af4('0x45')],null))[_0x5af4('0x20')](respondWithResult(_0x575166,null))[_0x5af4('0x43')](handleError(_0x575166,null));};exports[_0x5af4('0x21')]=function(_0x352b8e,_0x2e0a0f){return db['SmsApplication'][_0x5af4('0x42')]({'where':{'id':_0x352b8e[_0x5af4('0x40')]['id']}})[_0x5af4('0x20')](handleEntityNotFound(_0x2e0a0f,null))[_0x5af4('0x20')](removeEntity(_0x2e0a0f,null))[_0x5af4('0x43')](handleError(_0x2e0a0f,null));}; \ No newline at end of file +var _0x5106=['length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','update','then','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields'];(function(_0x55ed83,_0x18c410){var _0x1f2336=function(_0x463c37){while(--_0x463c37){_0x55ed83['push'](_0x55ed83['shift']());}};_0x1f2336(++_0x18c410);}(_0x5106,0xa3));var _0x6510=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5106[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6510('0x0'));var zipdir=require(_0x6510('0x1'));var jsonpatch=require(_0x6510('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6510('0x3'));var Mustache=require(_0x6510('0x4'));var util=require(_0x6510('0x5'));var path=require('path');var sox=require(_0x6510('0x6'));var csv=require('to-csv');var ejs=require(_0x6510('0x7'));var fs=require('fs');var fs_extra=require(_0x6510('0x8'));var _=require(_0x6510('0x9'));var squel=require(_0x6510('0xa'));var crypto=require(_0x6510('0xb'));var jsforce=require(_0x6510('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6510('0xd'));var querystring=require(_0x6510('0xe'));var Papa=require(_0x6510('0xf'));var Redis=require(_0x6510('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6510('0x11'));var as=require(_0x6510('0x12'));var hardwareService=require(_0x6510('0x13'));var logger=require('../../config/logger')(_0x6510('0x14'));var utils=require(_0x6510('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6510('0x16'));var db=require(_0x6510('0x17'))['db'];function respondWithStatusCode(_0xe9a3e2,_0x436d9e){_0x436d9e=_0x436d9e||0xcc;return function(_0x67a0d9){if(_0x67a0d9){return _0xe9a3e2[_0x6510('0x18')](_0x436d9e);}return _0xe9a3e2[_0x6510('0x19')](_0x436d9e)['end']();};}function respondWithResult(_0x5a760b,_0x35edb3){_0x35edb3=_0x35edb3||0xc8;return function(_0x769136){if(_0x769136){return _0x5a760b['status'](_0x35edb3)[_0x6510('0x1a')](_0x769136);}};}function respondWithFilteredResult(_0x21017b,_0x48215c){return function(_0x1c6d66){if(_0x1c6d66){var _0x5515be=typeof _0x48215c[_0x6510('0x1b')]===_0x6510('0x1c')&&typeof _0x48215c[_0x6510('0x1d')]===_0x6510('0x1c');var _0xff6643=_0x1c6d66[_0x6510('0x1e')];var _0x1d3933=_0x5515be?0x0:_0x48215c[_0x6510('0x1b')];var _0x2a7f31=_0x5515be?_0x1c6d66[_0x6510('0x1e')]:_0x48215c[_0x6510('0x1b')]+_0x48215c[_0x6510('0x1d')];var _0x1cb842;if(_0x2a7f31>=_0xff6643){_0x2a7f31=_0xff6643;_0x1cb842=0xc8;}else{_0x1cb842=0xce;}_0x21017b[_0x6510('0x19')](_0x1cb842);return _0x21017b['set']('Content-Range',_0x1d3933+'-'+_0x2a7f31+'/'+_0xff6643)['json'](_0x1c6d66);}return null;};}function patchUpdates(_0x30d7ba){return function(_0x37aae7){try{jsonpatch['apply'](_0x37aae7,_0x30d7ba,!![]);}catch(_0x4e95ae){return BPromise[_0x6510('0x1f')](_0x4e95ae);}return _0x37aae7['save']();};}function saveUpdates(_0x296492,_0x5a57bb){return function(_0x34a93c){if(_0x34a93c){return _0x34a93c[_0x6510('0x20')](_0x296492)[_0x6510('0x21')](function(_0x128a68){return _0x128a68;});}return null;};}function removeEntity(_0x535a72,_0x55054e){return function(_0x2cb164){if(_0x2cb164){return _0x2cb164['destroy']()[_0x6510('0x21')](function(){_0x535a72[_0x6510('0x19')](0xcc)[_0x6510('0x22')]();});}};}function handleEntityNotFound(_0x2088f1,_0x5df58a){return function(_0x275b2b){if(!_0x275b2b){_0x2088f1[_0x6510('0x18')](0x194);}return _0x275b2b;};}function handleError(_0x1b47a5,_0x330823){_0x330823=_0x330823||0x1f4;return function(_0x24a964){logger[_0x6510('0x23')](_0x24a964[_0x6510('0x24')]);if(_0x24a964[_0x6510('0x25')]){delete _0x24a964[_0x6510('0x25')];}_0x1b47a5[_0x6510('0x19')](_0x330823)['send'](_0x24a964);};}exports[_0x6510('0x26')]=function(_0x1e3178,_0x4be958){var _0x1bbfdf={},_0x5dea9e={},_0x209a30={'count':0x0,'rows':[]};var _0xd7ef9b=_[_0x6510('0x27')](db[_0x6510('0x28')][_0x6510('0x29')],function(_0x51a966){return{'name':_0x51a966[_0x6510('0x2a')],'type':_0x51a966['type']['key']};});_0x5dea9e[_0x6510('0x2b')]=_[_0x6510('0x27')](_0xd7ef9b,'name');_0x5dea9e['query']=_[_0x6510('0x2c')](_0x1e3178[_0x6510('0x2d')]);_0x5dea9e[_0x6510('0x2e')]=_[_0x6510('0x2f')](_0x5dea9e[_0x6510('0x2b')],_0x5dea9e[_0x6510('0x2d')]);_0x1bbfdf[_0x6510('0x30')]=_[_0x6510('0x2f')](_0x5dea9e[_0x6510('0x2b')],qs[_0x6510('0x31')](_0x1e3178[_0x6510('0x2d')]['fields']));_0x1bbfdf[_0x6510('0x30')]=_0x1bbfdf[_0x6510('0x30')][_0x6510('0x32')]?_0x1bbfdf['attributes']:_0x5dea9e['model'];if(!_0x1e3178['query'][_0x6510('0x33')](_0x6510('0x34'))){_0x1bbfdf['limit']=qs[_0x6510('0x1d')](_0x1e3178[_0x6510('0x2d')][_0x6510('0x1d')]);_0x1bbfdf[_0x6510('0x1b')]=qs[_0x6510('0x1b')](_0x1e3178[_0x6510('0x2d')][_0x6510('0x1b')]);}_0x1bbfdf['order']=qs[_0x6510('0x35')](_0x1e3178[_0x6510('0x2d')]['sort']);_0x1bbfdf[_0x6510('0x36')]=qs[_0x6510('0x2e')](_[_0x6510('0x37')](_0x1e3178[_0x6510('0x2d')],_0x5dea9e['filters']),_0xd7ef9b);if(_0x1e3178['query'][_0x6510('0x38')]){_0x1bbfdf['where']=_[_0x6510('0x39')](_0x1bbfdf[_0x6510('0x36')],{'$or':_[_0x6510('0x27')](_0xd7ef9b,function(_0x204200){if(_0x204200[_0x6510('0x3a')]!=='VIRTUAL'){var _0x71e614={};_0x71e614[_0x204200[_0x6510('0x25')]]={'$like':'%'+_0x1e3178[_0x6510('0x2d')][_0x6510('0x38')]+'%'};return _0x71e614;}})});}_0x1bbfdf=_[_0x6510('0x39')]({},_0x1bbfdf,_0x1e3178[_0x6510('0x3b')]);var _0x4cbdb5={'where':_0x1bbfdf[_0x6510('0x36')]};return db[_0x6510('0x28')][_0x6510('0x1e')](_0x4cbdb5)[_0x6510('0x21')](function(_0x301701){_0x209a30['count']=_0x301701;if(_0x1e3178[_0x6510('0x2d')][_0x6510('0x3c')]){_0x1bbfdf[_0x6510('0x3d')]=[{'all':!![]}];}return db[_0x6510('0x28')][_0x6510('0x3e')](_0x1bbfdf);})[_0x6510('0x21')](function(_0x13a21c){_0x209a30[_0x6510('0x3f')]=_0x13a21c;return _0x209a30;})[_0x6510('0x21')](respondWithFilteredResult(_0x4be958,_0x1bbfdf))['catch'](handleError(_0x4be958,null));};exports[_0x6510('0x40')]=function(_0x1df1b3,_0x1feef6){var _0x31b31b={'raw':!![],'where':{'id':_0x1df1b3['params']['id']}},_0x145185={};_0x145185['model']=_[_0x6510('0x2c')](db[_0x6510('0x28')][_0x6510('0x29')]);_0x145185[_0x6510('0x2d')]=_[_0x6510('0x2c')](_0x1df1b3[_0x6510('0x2d')]);_0x145185['filters']=_[_0x6510('0x2f')](_0x145185[_0x6510('0x2b')],_0x145185['query']);_0x31b31b[_0x6510('0x30')]=_[_0x6510('0x2f')](_0x145185[_0x6510('0x2b')],qs['fields'](_0x1df1b3[_0x6510('0x2d')][_0x6510('0x31')]));_0x31b31b[_0x6510('0x30')]=_0x31b31b[_0x6510('0x30')][_0x6510('0x32')]?_0x31b31b[_0x6510('0x30')]:_0x145185['model'];if(_0x1df1b3[_0x6510('0x2d')][_0x6510('0x3c')]){_0x31b31b[_0x6510('0x3d')]=[{'all':!![]}];}_0x31b31b=_[_0x6510('0x39')]({},_0x31b31b,_0x1df1b3[_0x6510('0x3b')]);return db[_0x6510('0x28')][_0x6510('0x41')](_0x31b31b)[_0x6510('0x21')](handleEntityNotFound(_0x1feef6,null))[_0x6510('0x21')](respondWithResult(_0x1feef6,null))[_0x6510('0x42')](handleError(_0x1feef6,null));};exports[_0x6510('0x43')]=function(_0x4fe5ee,_0x4912c9){return db[_0x6510('0x28')][_0x6510('0x43')](_0x4fe5ee['body'],{})[_0x6510('0x21')](respondWithResult(_0x4912c9,0xc9))['catch'](handleError(_0x4912c9,null));};exports['update']=function(_0x2a1af9,_0x3101c0){if(_0x2a1af9[_0x6510('0x44')]['id']){delete _0x2a1af9['body']['id'];}return db[_0x6510('0x28')][_0x6510('0x41')]({'where':{'id':_0x2a1af9[_0x6510('0x45')]['id']}})[_0x6510('0x21')](handleEntityNotFound(_0x3101c0,null))[_0x6510('0x21')](saveUpdates(_0x2a1af9[_0x6510('0x44')],null))[_0x6510('0x21')](respondWithResult(_0x3101c0,null))['catch'](handleError(_0x3101c0,null));};exports[_0x6510('0x46')]=function(_0x249892,_0x423ae8){return db[_0x6510('0x28')][_0x6510('0x41')]({'where':{'id':_0x249892[_0x6510('0x45')]['id']}})['then'](handleEntityNotFound(_0x423ae8,null))[_0x6510('0x21')](removeEntity(_0x423ae8,null))[_0x6510('0x42')](handleError(_0x423ae8,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 4350deb..00a965f 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 _0x3ec5=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','SmsApplication'];(function(_0x2204b2,_0x3b0895){var _0x47ea1d=function(_0x1a0907){while(--_0x1a0907){_0x2204b2['push'](_0x2204b2['shift']());}};_0x47ea1d(++_0x3b0895);}(_0x3ec5,0x195));var _0x53ec=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3ec5[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x53ec('0x0'));var util=require(_0x53ec('0x1'));var logger=require(_0x53ec('0x2'))(_0x53ec('0x3'));var moment=require(_0x53ec('0x4'));var BPromise=require('bluebird');var rp=require(_0x53ec('0x5'));var fs=require('fs');var path=require(_0x53ec('0x6'));var rimraf=require(_0x53ec('0x7'));var config=require(_0x53ec('0x8'));var attributes=require('./smsApplication.attributes');module[_0x53ec('0x9')]=function(_0x218963,_0x2fa841){return _0x218963['define'](_0x53ec('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53ec('0xb'),'collate':_0x53ec('0xc')});}; \ No newline at end of file +var _0x95d9=['api','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1353dd,_0x15ddb5){var _0x438986=function(_0x3aa405){while(--_0x3aa405){_0x1353dd['push'](_0x1353dd['shift']());}};_0x438986(++_0x15ddb5);}(_0x95d9,0x97));var _0x995d=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x95d9[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var logger=require(_0x995d('0x2'))(_0x995d('0x3'));var moment=require('moment');var BPromise=require(_0x995d('0x4'));var rp=require(_0x995d('0x5'));var fs=require('fs');var path=require(_0x995d('0x6'));var rimraf=require('rimraf');var config=require(_0x995d('0x7'));var attributes=require(_0x995d('0x8'));module[_0x995d('0x9')]=function(_0x226250,_0xe6d244){return _0x226250['define'](_0x995d('0xa'),attributes,{'tableName':_0x995d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x995d('0xc'),'collate':_0x995d('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 4d567af..51f6ffa 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 _0x6dc0=['rpc','../../config/environment','client','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5572ef,_0x18107b){var _0x22d5e9=function(_0xc79fab){while(--_0xc79fab){_0x5572ef['push'](_0x5572ef['shift']());}};_0x22d5e9(++_0x18107b);}(_0x6dc0,0xb6));var _0x06dc=function(_0x29dc8a,_0x784548){_0x29dc8a=_0x29dc8a-0x0;var _0x3512f1=_0x6dc0[_0x29dc8a];return _0x3512f1;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var moment=require(_0x06dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require(_0x06dc('0x6'));var logger=require('../../config/logger')(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x419534,_0x3212ca,_0x14c15b){return new BPromise(function(_0x10e23b,_0x140eef){return client['request'](_0x419534,_0x14c15b)['then'](function(_0x480f30){logger[_0x06dc('0xa')](_0x06dc('0xb'),_0x3212ca,'request\x20sent');logger[_0x06dc('0xc')](_0x06dc('0xd'),_0x3212ca,_0x06dc('0xe'),JSON[_0x06dc('0xf')](_0x480f30));if(_0x480f30['error']){if(_0x480f30[_0x06dc('0x10')][_0x06dc('0x11')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x3212ca,_0x480f30['error']['message']);return _0x140eef(_0x480f30[_0x06dc('0x10')]['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x3212ca,_0x480f30[_0x06dc('0x10')][_0x06dc('0x12')]);return _0x10e23b(_0x480f30[_0x06dc('0x10')]['message']);}else{logger[_0x06dc('0xa')](_0x06dc('0xb'),_0x3212ca,_0x06dc('0xe'));_0x10e23b(_0x480f30[_0x06dc('0x13')]['message']);}})[_0x06dc('0x14')](function(_0x30c1c5){logger[_0x06dc('0x10')](_0x06dc('0xb'),_0x3212ca,_0x30c1c5);_0x140eef(_0x30c1c5);});});} \ No newline at end of file +var _0xce14=['code','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x107872,_0x1c2f89){var _0x3fc897=function(_0x322af2){while(--_0x322af2){_0x107872['push'](_0x107872['shift']());}};_0x3fc897(++_0x1c2f89);}(_0xce14,0x17f));var _0x4ce1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xce14[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x4ce1('0x0'));var moment=require('moment');var BPromise=require(_0x4ce1('0x1'));var rs=require(_0x4ce1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ce1('0x3'))['db'];var utils=require(_0x4ce1('0x4'));var logger=require(_0x4ce1('0x5'))(_0x4ce1('0x6'));var config=require(_0x4ce1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ce1('0x8')][_0x4ce1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f603d,_0x2b9923,_0x539c1d){return new BPromise(function(_0x256648,_0x2beed4){return client[_0x4ce1('0xa')](_0x1f603d,_0x539c1d)['then'](function(_0x1b5bd8){logger[_0x4ce1('0xb')](_0x4ce1('0xc'),_0x2b9923,_0x4ce1('0xd'));logger['debug'](_0x4ce1('0xe'),_0x2b9923,_0x4ce1('0xd'),JSON[_0x4ce1('0xf')](_0x1b5bd8));if(_0x1b5bd8[_0x4ce1('0x10')]){if(_0x1b5bd8['error'][_0x4ce1('0x11')]===0x1f4){logger[_0x4ce1('0x10')](_0x4ce1('0xc'),_0x2b9923,_0x1b5bd8[_0x4ce1('0x10')][_0x4ce1('0x12')]);return _0x2beed4(_0x1b5bd8[_0x4ce1('0x10')][_0x4ce1('0x12')]);}logger[_0x4ce1('0x10')](_0x4ce1('0xc'),_0x2b9923,_0x1b5bd8[_0x4ce1('0x10')][_0x4ce1('0x12')]);return _0x256648(_0x1b5bd8['error'][_0x4ce1('0x12')]);}else{logger['info'](_0x4ce1('0xc'),_0x2b9923,_0x4ce1('0xd'));_0x256648(_0x1b5bd8[_0x4ce1('0x13')][_0x4ce1('0x12')]);}})['catch'](function(_0x221306){logger['error']('SmsApplication,\x20%s,\x20%s',_0x2b9923,_0x221306);_0x2beed4(_0x221306);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f980644..72fc324 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 _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2da7d9,_0x4eff47){_0x2da7d9=_0x2da7d9-0x0;var _0x2ab4c8=_0xd7d1[_0x2da7d9];return _0x2ab4c8;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file +var _0x6324=['isAuthenticated','index','describe','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','/:id','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x51b506,_0x1b60bf){var _0x33c41a=function(_0x14b6cc){while(--_0x14b6cc){_0x51b506['push'](_0x51b506['shift']());}};_0x33c41a(++_0x1b60bf);}(_0x6324,0x142));var _0x4632=function(_0x8a22fd,_0x3f6c4e){_0x8a22fd=_0x8a22fd-0x0;var _0x3e12fe=_0x6324[_0x8a22fd];return _0x3e12fe;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./smsInteraction.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0x7')](_0x4632('0xd'),auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xf')]('/',auth[_0x4632('0x8')](),controller['create']);router[_0x4632('0xf')]('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0x10')]);router[_0x4632('0xf')](_0x4632('0x11'),auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x14')),controller[_0x4632('0x15')]);router[_0x4632('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x17')),controller[_0x4632('0x18')]);router['delete'](_0x4632('0x19'),auth[_0x4632('0x8')](),interaction[_0x4632('0x12')]('sms',_0x4632('0x1a')),controller[_0x4632('0x1b')]);router['delete']('/:id/tags',auth[_0x4632('0x8')](),controller[_0x4632('0x1c')]);module[_0x4632('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 2efb69a..931ca69 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 _0xb934=['out','BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0xb934,0x92));var _0x4b93=function(_0x3d04ee,_0x13c3bb){_0x3d04ee=_0x3d04ee-0x0;var _0x353a25=_0xb934[_0x3d04ee];return _0x353a25;};'use strict';var Sequelize=require(_0x4b93('0x0'));var moment=require(_0x4b93('0x1'));module[_0x4b93('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4b93('0x3')]},'disposition':{'type':Sequelize[_0x4b93('0x4')]},'secondDisposition':{'type':Sequelize[_0x4b93('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4b93('0x4')]},'note':{'type':Sequelize[_0x4b93('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x4b93('0x5')]('in',_0x4b93('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4b93('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4b93('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4b93('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x3641=['out','moment','DATE','STRING','ENUM'];(function(_0x30baa0,_0x3d8e1b){var _0x3737c1=function(_0x126398){while(--_0x126398){_0x30baa0['push'](_0x30baa0['shift']());}};_0x3737c1(++_0x3d8e1b);}(_0x3641,0x173));var _0x1364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3641[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1364('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1364('0x1')]},'disposition':{'type':Sequelize[_0x1364('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1364('0x2')]},'note':{'type':Sequelize[_0x1364('0x2')]},'phone':{'type':Sequelize[_0x1364('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x1364('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1364('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x1364('0x3')]('in',_0x1364('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index dba321e..89a7734 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 _0xceee=['merge','find','create','body','update','describe','addMessage','omit','getMessages','findOne','SmsMessage','length','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','spread','Tag','color','ids','emit','smsInteractionTags:save','removeTags','download','unix','join','root','tmp','push','User','CmContact','Contact','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','toString','closed','disposition','out','System','firstName','value','renderFile','server','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','register','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','map','SmsInteraction','fieldName','type','key','findAll','sms','query','user','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','includeAll'];(function(_0x57c7a0,_0x53d1c5){var _0x3298ae=function(_0x2521c1){while(--_0x2521c1){_0x57c7a0['push'](_0x57c7a0['shift']());}};_0x3298ae(++_0x53d1c5);}(_0xceee,0xbb));var _0xecee=function(_0xa93fc1,_0x323783){_0xa93fc1=_0xa93fc1-0x0;var _0x3fa08e=_0xceee[_0xa93fc1];return _0x3fa08e;};'use strict';var rimraf=require(_0xecee('0x0'));var zipdir=require(_0xecee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xecee('0x2'));var path=require(_0xecee('0x3'));var ejs=require(_0xecee('0x4'));var fs=require('fs');var _=require(_0xecee('0x5'));var Redis=require(_0xecee('0x6'));var interaction=require(_0xecee('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xecee('0x8'));var logger=require(_0xecee('0x9'))(_0xecee('0xa'));var config=require(_0xecee('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xecee('0xc')](config[_0xecee('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xecee('0xe'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xecee('0xf')](socket);function respondWithStatusCode(_0x126619,_0x5d9cb0){_0x5d9cb0=_0x5d9cb0||0xcc;return function(_0x4c768d){if(_0x4c768d){return _0x126619['sendStatus'](_0x5d9cb0);}return _0x126619[_0xecee('0x10')](_0x5d9cb0)['end']();};}function respondWithResult(_0x2020bb,_0x5b2034){_0x5b2034=_0x5b2034||0xc8;return function(_0x2556da){if(_0x2556da){return _0x2020bb[_0xecee('0x10')](_0x5b2034)[_0xecee('0x11')](_0x2556da);}};}function respondWithFilteredResult(_0x2fb8eb,_0x52c45a){return function(_0x182ff4){if(_0x182ff4){var _0x24b240=typeof _0x52c45a[_0xecee('0x12')]==='undefined'&&typeof _0x52c45a[_0xecee('0x13')]===_0xecee('0x14');var _0x1a2878=_0x182ff4[_0xecee('0x15')];var _0x3e04a0=_0x24b240?0x0:_0x52c45a['offset'];var _0x4754df=_0x24b240?_0x182ff4[_0xecee('0x15')]:_0x52c45a[_0xecee('0x12')]+_0x52c45a[_0xecee('0x13')];var _0x4f40aa;if(_0x4754df>=_0x1a2878){_0x4754df=_0x1a2878;_0x4f40aa=0xc8;}else{_0x4f40aa=0xce;}_0x2fb8eb[_0xecee('0x10')](_0x4f40aa);return _0x2fb8eb[_0xecee('0x16')](_0xecee('0x17'),_0x3e04a0+'-'+_0x4754df+'/'+_0x1a2878)[_0xecee('0x11')](_0x182ff4);}return null;};}function saveUpdates(_0x308d2b){return function(_0x11d520){if(_0x11d520){return _0x11d520['update'](_0x308d2b)[_0xecee('0x18')](function(_0x45a3af){return _0x45a3af;});}return null;};}function removeEntity(_0x293dfd){return function(_0x2df447){if(_0x2df447){return _0x2df447[_0xecee('0x19')]()[_0xecee('0x18')](function(){_0x293dfd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ab36f){return function(_0x9f8c62){if(!_0x9f8c62){_0x5ab36f[_0xecee('0x1a')](0x194);}return _0x9f8c62;};}function handleError(_0x532483,_0x86fe0f){_0x86fe0f=_0x86fe0f||0x1f4;return function(_0x27e3d7){logger[_0xecee('0x1b')](_0x27e3d7[_0xecee('0x1c')]);if(_0x27e3d7[_0xecee('0x1d')]){delete _0x27e3d7[_0xecee('0x1d')];}_0x532483['status'](_0x86fe0f)[_0xecee('0x1e')](_0x27e3d7);};}exports['index']=function(_0x2a45a2,_0x56f50d){var _0x32a791={};var _0x16624e=_[_0xecee('0x1f')](db[_0xecee('0x20')]['rawAttributes'],function(_0x4f94bd){return{'name':_0x4f94bd[_0xecee('0x21')],'type':_0x4f94bd[_0xecee('0x22')][_0xecee('0x23')]};});_0x32a791=qs['getOptions'](_0x16624e,_0x2a45a2);return interaction[_0xecee('0x24')](_0xecee('0x25'),_0x2a45a2[_0xecee('0x26')],_0x2a45a2[_0xecee('0x27')],_0x32a791,_0x16624e)[_0xecee('0x18')](respondWithFilteredResult(_0x56f50d,_0x32a791))[_0xecee('0x28')](handleError(_0x56f50d,null));};exports[_0xecee('0x29')]=function(_0x42733d,_0x4d5bb9){var _0x48e16b={'raw':![],'where':{'id':_0x42733d[_0xecee('0x2a')]['id']}},_0x72ae5f={};_0x72ae5f[_0xecee('0x2b')]=_[_0xecee('0x2c')](db['SmsInteraction'][_0xecee('0x2d')]);_0x72ae5f['query']=_[_0xecee('0x2c')](_0x42733d['query']);_0x72ae5f[_0xecee('0x2e')]=_[_0xecee('0x2f')](_0x72ae5f[_0xecee('0x2b')],_0x72ae5f[_0xecee('0x26')]);_0x48e16b[_0xecee('0x30')]=_['intersection'](_0x72ae5f[_0xecee('0x2b')],qs[_0xecee('0x31')](_0x42733d[_0xecee('0x26')][_0xecee('0x31')]));_0x48e16b[_0xecee('0x30')]=_0x48e16b[_0xecee('0x30')]['length']?_0x48e16b[_0xecee('0x30')]:_0x72ae5f[_0xecee('0x2b')];if(_0x42733d['query'][_0xecee('0x32')]){_0x48e16b['include']=[{'all':!![]}];}_0x48e16b=_[_0xecee('0x33')]({},_0x48e16b,_0x42733d['options']);return db['SmsInteraction'][_0xecee('0x34')](_0x48e16b)[_0xecee('0x18')](handleEntityNotFound(_0x4d5bb9,null))[_0xecee('0x18')](respondWithResult(_0x4d5bb9,null))['catch'](handleError(_0x4d5bb9,null));};exports[_0xecee('0x35')]=function(_0x4f1e39,_0x2ff8dc){return db[_0xecee('0x20')]['create'](_0x4f1e39[_0xecee('0x36')],{})['then'](respondWithResult(_0x2ff8dc,0xc9))['catch'](handleError(_0x2ff8dc,null));};exports[_0xecee('0x37')]=function(_0xc0343f,_0x59ad53){if(_0xc0343f['body']['id']){delete _0xc0343f['body']['id'];}return db[_0xecee('0x20')][_0xecee('0x34')]({'where':{'id':_0xc0343f[_0xecee('0x2a')]['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x59ad53,null))['then'](saveUpdates(_0xc0343f[_0xecee('0x36')],null))[_0xecee('0x18')](respondWithResult(_0x59ad53,null))[_0xecee('0x28')](handleError(_0x59ad53,null));};exports[_0xecee('0x19')]=function(_0x120a88,_0x4289ab){return db[_0xecee('0x20')]['find']({'where':{'id':_0x120a88[_0xecee('0x2a')]['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x4289ab,null))[_0xecee('0x18')](removeEntity(_0x4289ab,null))[_0xecee('0x28')](handleError(_0x4289ab,null));};exports[_0xecee('0x38')]=function(_0x272a38,_0x15bf00){return db[_0xecee('0x20')][_0xecee('0x38')]()[_0xecee('0x18')](respondWithResult(_0x15bf00,null))[_0xecee('0x28')](handleError(_0x15bf00,null));};exports[_0xecee('0x39')]=function(_0x1196d4,_0x586c14){return db['SmsMessage'][_0xecee('0x34')]({'where':{'id':_0x1196d4[_0xecee('0x2a')]['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x586c14,null))[_0xecee('0x18')](function(_0x52937f){if(_0x52937f){return _0x52937f[_0xecee('0x39')](_0x1196d4[_0xecee('0x36')]['ids'],_[_0xecee('0x3a')](_0x1196d4[_0xecee('0x36')],['ids','id'])||{});}})[_0xecee('0x18')](respondWithResult(_0x586c14,null))['catch'](handleError(_0x586c14,null));};exports[_0xecee('0x3b')]=function(_0x571725,_0x2b6210){var _0x5e2dc5={'raw':![],'where':{}};var _0x232217={};var _0x49a700={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xecee('0x3c')]({'where':{'id':_0x571725[_0xecee('0x2a')]['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x2b6210,null))[_0xecee('0x18')](function(_0x13635d){if(_0x13635d){_0x232217[_0xecee('0x2b')]=_[_0xecee('0x2c')](db[_0xecee('0x3d')][_0xecee('0x2d')]);_0x232217['query']=_[_0xecee('0x2c')](_0x571725[_0xecee('0x26')]);_0x232217[_0xecee('0x2e')]=_[_0xecee('0x2f')](_0x232217['model'],_0x232217[_0xecee('0x26')]);_0x5e2dc5[_0xecee('0x30')]=_[_0xecee('0x2f')](_0x232217[_0xecee('0x2b')],qs[_0xecee('0x31')](_0x571725['query'][_0xecee('0x31')]));_0x5e2dc5[_0xecee('0x30')]=_0x5e2dc5[_0xecee('0x30')][_0xecee('0x3e')]?_0x5e2dc5[_0xecee('0x30')]:_0x232217[_0xecee('0x2b')];if(!_0x571725[_0xecee('0x26')][_0xecee('0x3f')]('nolimit')){_0x5e2dc5[_0xecee('0x13')]=qs[_0xecee('0x13')](_0x571725[_0xecee('0x26')][_0xecee('0x13')]);_0x5e2dc5['offset']=qs[_0xecee('0x12')](_0x571725[_0xecee('0x26')][_0xecee('0x12')]);}_0x5e2dc5[_0xecee('0x40')]=qs['sort'](_0x571725['query'][_0xecee('0x41')]);_0x5e2dc5[_0xecee('0x42')]=qs[_0xecee('0x2e')](_[_0xecee('0x43')](_0x571725[_0xecee('0x26')],_0x232217[_0xecee('0x2e')]));_0x5e2dc5[_0xecee('0x42')][_0xecee('0x44')]=_0x13635d['id'];if(_0x571725[_0xecee('0x26')][_0xecee('0x45')]){_0x5e2dc5[_0xecee('0x42')]=_[_0xecee('0x33')](_0x5e2dc5[_0xecee('0x42')],{'$or':_[_0xecee('0x1f')](_0x5e2dc5['attributes'],function(_0xb08e02){var _0x2ff792={};_0x2ff792[_0xb08e02]={'$like':'%'+_0x571725[_0xecee('0x26')][_0xecee('0x45')]+'%'};return _0x2ff792;})});}if(_0x571725[_0xecee('0x26')]['$gte']){var _0x2a9e8a=_0x571725[_0xecee('0x26')]['$gte']['split'](',');var _0x12ddc5={};_0x12ddc5[_0x2a9e8a[0x0]]={'$gte':moment(_0x2a9e8a[0x1])[_0xecee('0x46')](_0xecee('0x47'))};_0x5e2dc5[_0xecee('0x42')]=_[_0xecee('0x33')](_0x5e2dc5[_0xecee('0x42')],_0x12ddc5);}_0x5e2dc5=_[_0xecee('0x33')]({},_0x5e2dc5,_0x571725[_0xecee('0x48')]);return db[_0xecee('0x3d')][_0xecee('0x15')]({'where':_0x5e2dc5[_0xecee('0x42')]})['then'](function(_0x482f84){_0x49a700[_0xecee('0x15')]=_0x482f84;if(_0x571725[_0xecee('0x26')][_0xecee('0x32')]){_0x5e2dc5['include']=[{'all':!![]}];}return db[_0xecee('0x3d')][_0xecee('0x24')](_0x5e2dc5);})['then'](function(_0x292224){_0x49a700['rows']=_0x292224;return _0x49a700;});}})['then'](respondWithFilteredResult(_0x2b6210,_0x5e2dc5))[_0xecee('0x28')](handleError(_0x2b6210,null));};exports[_0xecee('0x49')]=function(_0x3a1342,_0x782df7){return db[_0xecee('0x20')][_0xecee('0x34')]({'where':{'id':_0x3a1342[_0xecee('0x2a')]['id']}})[_0xecee('0x18')](handleEntityNotFound(_0x782df7,null))['then'](function(_0x3470cd){if(_0x3470cd){return _0x3470cd[_0xecee('0x4a')](_0x3a1342[_0xecee('0x36')]['ids'],_['omit'](_0x3a1342[_0xecee('0x36')],['ids','id'])||{})[_0xecee('0x4b')](function(){return db[_0xecee('0x4c')][_0xecee('0x24')]({'attributes':['id',_0xecee('0x1d'),_0xecee('0x4d')],'where':{'id':_0x3a1342['body'][_0xecee('0x4e')]}});})[_0xecee('0x18')](function(_0x963137){socket[_0xecee('0x4f')](_0xecee('0x50'),{'id':Number(_0x3a1342[_0xecee('0x2a')]['id']),'tags':_0x963137||[]});return{'id':Number(_0x3a1342['params']['id']),'tags':_0x963137||[]};});}})[_0xecee('0x18')](respondWithResult(_0x782df7,null))[_0xecee('0x28')](handleError(_0x782df7,null));};exports[_0xecee('0x51')]=function(_0x347521,_0xaee551){return db[_0xecee('0x20')][_0xecee('0x34')]({'where':{'id':_0x347521[_0xecee('0x2a')]['id']}})['then'](handleEntityNotFound(_0xaee551,null))[_0xecee('0x18')](function(_0x2b6761){if(_0x2b6761){return _0x2b6761['removeTags'](_0x347521['query']['ids']);}})['then'](respondWithStatusCode(_0xaee551,null))[_0xecee('0x28')](handleError(_0xaee551,null));};exports[_0xecee('0x52')]=function(_0x1e8bad,_0xac3408){var _0x5d1750=moment()[_0xecee('0x53')]()['toString']();var _0x47a2ec=path[_0xecee('0x54')](config[_0xecee('0x55')],'server','files',_0xecee('0x56'));var _0x39421f=path[_0xecee('0x54')](_0x47a2ec,_0x5d1750);var _0x485f4b=util[_0xecee('0x46')]('transcript-%d-%s.zip',_0x1e8bad[_0xecee('0x2a')]['id'],_0x5d1750);var _0x27fde3=path['join'](_0x47a2ec,_0x485f4b);var _0x2075cd=[];_0x2075cd[_0xecee('0x57')]({'model':db[_0xecee('0x58')],'as':_0xecee('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x2075cd['push']({'model':db[_0xecee('0x59')],'as':_0xecee('0x5a'),'attributes':['id','firstName',_0xecee('0x5b')],'raw':!![]});var _0x26316c=[{'model':db['SmsMessage'],'as':_0xecee('0x5c'),'attributes':['id',_0xecee('0x36'),_0xecee('0x5d'),_0xecee('0x5e'),_0xecee('0x5f'),_0xecee('0x60')],'include':_0x2075cd}];_0x26316c[_0xecee('0x57')]({'model':db[_0xecee('0x61')],'as':_0xecee('0x62'),'attributes':['id','name']});_0x26316c[_0xecee('0x57')]({'model':db[_0xecee('0x58')],'as':'Owner','attributes':['id',_0xecee('0x63')]});return db[_0xecee('0x20')][_0xecee('0x34')]({'where':{'id':_0x1e8bad[_0xecee('0x2a')]['id']},'include':_0x26316c})[_0xecee('0x18')](handleEntityNotFound(_0xac3408,null))[_0xecee('0x18')](function(_0x25ceb5){if(_0x25ceb5){var _0x52991f=_0x25ceb5[_0xecee('0x64')]({'plain':!![]});fs[_0xecee('0x65')](_0x39421f);var _0x1d15f6={'channel':_0xecee('0x66'),'account':_0x52991f[_0xecee('0x62')][_0xecee('0x1d')],'agent':_0x52991f['Owner']?_0x52991f[_0xecee('0x67')][_0xecee('0x63')]:'N.A.','createdAt':moment(_0x52991f['createdAt'])[_0xecee('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0xecee('0x68')](),'closedAt':_0x52991f[_0xecee('0x69')]?moment(_0x52991f['closedAt'])[_0xecee('0x46')](_0xecee('0x47'))['toString']():'','disposition':_0x52991f[_0xecee('0x6a')],'messages':_(_0x52991f[_0xecee('0x5c')])[_0xecee('0x45')]({'secret':![]})[_0xecee('0x1f')](function(_0xbdba79){return{'date':moment(_0xbdba79[_0xecee('0x5d')])[_0xecee('0x46')](_0xecee('0x47'))[_0xecee('0x68')](),'sender':_0xbdba79[_0xecee('0x5e')]===_0xecee('0x6b')?_0xbdba79[_0xecee('0x58')]?_0xbdba79['User']['fullname']:_0xecee('0x6c'):_0xbdba79[_0xecee('0x5a')][_0xecee('0x6d')]+(_0xbdba79[_0xecee('0x5a')]['lastName']?'\x20'+_0xbdba79[_0xecee('0x5a')][_0xecee('0x5b')]:''),'body':_0xbdba79[_0xecee('0x36')],'direction':_0xbdba79[_0xecee('0x5e')]===_0xecee('0x6b')?'A':'C','secret':_0xbdba79['secret'],'read':_0xbdba79[_0xecee('0x60')]};})[_0xecee('0x6e')]()};return ejs[_0xecee('0x6f')](path[_0xecee('0x54')](config[_0xecee('0x55')],_0xecee('0x70'),_0xecee('0x71'),_0xecee('0x72')),{'interaction':_0x1d15f6})[_0xecee('0x18')](function(_0xbcc47e){var _0xa35e3a=path[_0xecee('0x54')](_0x39421f,_0xecee('0x73')+_0x52991f['id']+'-'+_0x5d1750+'.pdf');var _0x15ec1f={'path':_0xa35e3a,'channel':_0xecee('0x66'),'interactionId':_0x52991f['id']};return pdf[_0xecee('0x74')](_0xbcc47e,_0x15ec1f);})[_0xecee('0x18')](function(){return new BPromise(function(_0x39aa41,_0x105b70){zipdir(_0x39421f,{'saveTo':_0x27fde3},function(_0x4523bf,_0x4e1533){if(_0x4523bf)return _0x105b70(_0x4523bf);return _0x39aa41(_0x4e1533);});})['then'](function(){return new BPromise(function(_0x1a28cc,_0xf4ab62){rimraf(_0x39421f,function(_0x357667){if(_0x357667)_0xf4ab62(_0x357667);return _0x1a28cc();});});})['then'](function(){return _0xac3408[_0xecee('0x52')](_0x27fde3,_0x485f4b,function(_0x47c8fb){if(_0x47c8fb){console[_0xecee('0x75')]('err',_0x47c8fb);}else{fs[_0xecee('0x76')](_0x27fde3);}});});});}else{return _0xac3408['sendStatus'](0xc8);}})[_0xecee('0x28')](handleError(_0xac3408,null));}; \ No newline at end of file +var _0x108d=['Messages','out','firstName','secret','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','then','sendStatus','error','stack','index','type','key','getOptions','findAll','sms','query','user','show','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','SmsInteraction','body','params','destroy','describe','addMessage','SmsMessage','ids','findOne','length','hasOwnProperty','order','sort','pick','where','SmsInteractionId','filter','map','$gte','format','rows','addTags','setTags','spread','Tag','name','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','Contact','lastName','createdAt','direction','read','SmsAccount','Account','Owner','fullname','get','Sms','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition'];(function(_0x3f450b,_0x23b2de){var _0x6f3679=function(_0x14153b){while(--_0x14153b){_0x3f450b['push'](_0x3f450b['shift']());}};_0x6f3679(++_0x23b2de);}(_0x108d,0x7e));var _0xd108=function(_0x2cedd5,_0x1f8e2b){_0x2cedd5=_0x2cedd5-0x0;var _0x1bdd01=_0x108d[_0x2cedd5];return _0x1bdd01;};'use strict';var rimraf=require(_0xd108('0x0'));var zipdir=require(_0xd108('0x1'));var moment=require(_0xd108('0x2'));var BPromise=require(_0xd108('0x3'));var util=require(_0xd108('0x4'));var path=require('path');var ejs=require(_0xd108('0x5'));var fs=require('fs');var _=require(_0xd108('0x6'));var Redis=require(_0xd108('0x7'));var interaction=require(_0xd108('0x8'));var qs=require(_0xd108('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xd108('0xa'))(_0xd108('0xb'));var config=require(_0xd108('0xc'));var db=require('../../mysqldb')['db'];config[_0xd108('0xd')]=_['defaults'](config[_0xd108('0xd')],{'host':_0xd108('0xe'),'port':0x18eb});var socket=require(_0xd108('0xf'))(new Redis(config[_0xd108('0xd')]));require(_0xd108('0x10'))[_0xd108('0x11')](socket);function respondWithStatusCode(_0x16ffcd,_0x437794){_0x437794=_0x437794||0xcc;return function(_0x29e3fb){if(_0x29e3fb){return _0x16ffcd['sendStatus'](_0x437794);}return _0x16ffcd[_0xd108('0x12')](_0x437794)[_0xd108('0x13')]();};}function respondWithResult(_0x10f040,_0x2abf52){_0x2abf52=_0x2abf52||0xc8;return function(_0x347906){if(_0x347906){return _0x10f040[_0xd108('0x12')](_0x2abf52)[_0xd108('0x14')](_0x347906);}};}function respondWithFilteredResult(_0xe8e9c0,_0x13c1f7){return function(_0x1981bd){if(_0x1981bd){var _0x332a18=typeof _0x13c1f7['offset']===_0xd108('0x15')&&typeof _0x13c1f7[_0xd108('0x16')]===_0xd108('0x15');var _0x291ec2=_0x1981bd[_0xd108('0x17')];var _0x5e2284=_0x332a18?0x0:_0x13c1f7['offset'];var _0x277106=_0x332a18?_0x1981bd[_0xd108('0x17')]:_0x13c1f7[_0xd108('0x18')]+_0x13c1f7[_0xd108('0x16')];var _0x1da675;if(_0x277106>=_0x291ec2){_0x277106=_0x291ec2;_0x1da675=0xc8;}else{_0x1da675=0xce;}_0xe8e9c0[_0xd108('0x12')](_0x1da675);return _0xe8e9c0[_0xd108('0x19')](_0xd108('0x1a'),_0x5e2284+'-'+_0x277106+'/'+_0x291ec2)[_0xd108('0x14')](_0x1981bd);}return null;};}function saveUpdates(_0x108b76){return function(_0x53f9fd){if(_0x53f9fd){return _0x53f9fd['update'](_0x108b76)[_0xd108('0x1b')](function(_0x53e944){return _0x53e944;});}return null;};}function removeEntity(_0x41274c){return function(_0x212ffc){if(_0x212ffc){return _0x212ffc['destroy']()[_0xd108('0x1b')](function(){_0x41274c[_0xd108('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39a6aa){return function(_0x5c5d0b){if(!_0x5c5d0b){_0x39a6aa[_0xd108('0x1c')](0x194);}return _0x5c5d0b;};}function handleError(_0x1da9e3,_0x238fb6){_0x238fb6=_0x238fb6||0x1f4;return function(_0x8a0a8f){logger[_0xd108('0x1d')](_0x8a0a8f[_0xd108('0x1e')]);if(_0x8a0a8f['name']){delete _0x8a0a8f['name'];}_0x1da9e3['status'](_0x238fb6)['send'](_0x8a0a8f);};}exports[_0xd108('0x1f')]=function(_0x3affc4,_0x25f940){var _0x32868c={};var _0x31c53d=_['map'](db['SmsInteraction']['rawAttributes'],function(_0x14ac48){return{'name':_0x14ac48['fieldName'],'type':_0x14ac48[_0xd108('0x20')][_0xd108('0x21')]};});_0x32868c=qs[_0xd108('0x22')](_0x31c53d,_0x3affc4);return interaction[_0xd108('0x23')](_0xd108('0x24'),_0x3affc4[_0xd108('0x25')],_0x3affc4[_0xd108('0x26')],_0x32868c,_0x31c53d)[_0xd108('0x1b')](respondWithFilteredResult(_0x25f940,_0x32868c))['catch'](handleError(_0x25f940,null));};exports[_0xd108('0x27')]=function(_0x555b13,_0x3cbedc){var _0x4efb98={'raw':![],'where':{'id':_0x555b13['params']['id']}},_0x3ad85a={};_0x3ad85a[_0xd108('0x28')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x3ad85a[_0xd108('0x25')]=_[_0xd108('0x29')](_0x555b13[_0xd108('0x25')]);_0x3ad85a[_0xd108('0x2a')]=_[_0xd108('0x2b')](_0x3ad85a[_0xd108('0x28')],_0x3ad85a['query']);_0x4efb98[_0xd108('0x2c')]=_[_0xd108('0x2b')](_0x3ad85a[_0xd108('0x28')],qs[_0xd108('0x2d')](_0x555b13[_0xd108('0x25')][_0xd108('0x2d')]));_0x4efb98[_0xd108('0x2c')]=_0x4efb98[_0xd108('0x2c')]['length']?_0x4efb98[_0xd108('0x2c')]:_0x3ad85a['model'];if(_0x555b13[_0xd108('0x25')][_0xd108('0x2e')]){_0x4efb98[_0xd108('0x2f')]=[{'all':!![]}];}_0x4efb98=_[_0xd108('0x30')]({},_0x4efb98,_0x555b13[_0xd108('0x31')]);return db['SmsInteraction'][_0xd108('0x32')](_0x4efb98)[_0xd108('0x1b')](handleEntityNotFound(_0x3cbedc,null))[_0xd108('0x1b')](respondWithResult(_0x3cbedc,null))[_0xd108('0x33')](handleError(_0x3cbedc,null));};exports[_0xd108('0x34')]=function(_0x150c68,_0x26106a){return db[_0xd108('0x35')]['create'](_0x150c68['body'],{})[_0xd108('0x1b')](respondWithResult(_0x26106a,0xc9))[_0xd108('0x33')](handleError(_0x26106a,null));};exports['update']=function(_0x4ae0a4,_0x3296d5){if(_0x4ae0a4[_0xd108('0x36')]['id']){delete _0x4ae0a4[_0xd108('0x36')]['id'];}return db['SmsInteraction'][_0xd108('0x32')]({'where':{'id':_0x4ae0a4[_0xd108('0x37')]['id']}})[_0xd108('0x1b')](handleEntityNotFound(_0x3296d5,null))[_0xd108('0x1b')](saveUpdates(_0x4ae0a4[_0xd108('0x36')],null))[_0xd108('0x1b')](respondWithResult(_0x3296d5,null))['catch'](handleError(_0x3296d5,null));};exports[_0xd108('0x38')]=function(_0x35d2ca,_0x5bf9a1){return db[_0xd108('0x35')][_0xd108('0x32')]({'where':{'id':_0x35d2ca['params']['id']}})['then'](handleEntityNotFound(_0x5bf9a1,null))[_0xd108('0x1b')](removeEntity(_0x5bf9a1,null))[_0xd108('0x33')](handleError(_0x5bf9a1,null));};exports[_0xd108('0x39')]=function(_0x3f88fd,_0x3ba730){return db[_0xd108('0x35')][_0xd108('0x39')]()['then'](respondWithResult(_0x3ba730,null))[_0xd108('0x33')](handleError(_0x3ba730,null));};exports[_0xd108('0x3a')]=function(_0x128887,_0x1db78a){return db[_0xd108('0x3b')][_0xd108('0x32')]({'where':{'id':_0x128887[_0xd108('0x37')]['id']}})['then'](handleEntityNotFound(_0x1db78a,null))['then'](function(_0x2f4d25){if(_0x2f4d25){return _0x2f4d25[_0xd108('0x3a')](_0x128887[_0xd108('0x36')][_0xd108('0x3c')],_['omit'](_0x128887[_0xd108('0x36')],[_0xd108('0x3c'),'id'])||{});}})[_0xd108('0x1b')](respondWithResult(_0x1db78a,null))['catch'](handleError(_0x1db78a,null));};exports['getMessages']=function(_0x2ef3e0,_0x4a96f1){var _0x4d5655={'raw':![],'where':{}};var _0x57549e={};var _0x262735={'count':0x0,'rows':[]};return db[_0xd108('0x35')][_0xd108('0x3d')]({'where':{'id':_0x2ef3e0[_0xd108('0x37')]['id']}})['then'](handleEntityNotFound(_0x4a96f1,null))['then'](function(_0x546430){if(_0x546430){_0x57549e[_0xd108('0x28')]=_[_0xd108('0x29')](db[_0xd108('0x3b')]['rawAttributes']);_0x57549e[_0xd108('0x25')]=_[_0xd108('0x29')](_0x2ef3e0[_0xd108('0x25')]);_0x57549e['filters']=_[_0xd108('0x2b')](_0x57549e[_0xd108('0x28')],_0x57549e['query']);_0x4d5655['attributes']=_['intersection'](_0x57549e[_0xd108('0x28')],qs[_0xd108('0x2d')](_0x2ef3e0[_0xd108('0x25')]['fields']));_0x4d5655['attributes']=_0x4d5655[_0xd108('0x2c')][_0xd108('0x3e')]?_0x4d5655[_0xd108('0x2c')]:_0x57549e[_0xd108('0x28')];if(!_0x2ef3e0[_0xd108('0x25')][_0xd108('0x3f')]('nolimit')){_0x4d5655[_0xd108('0x16')]=qs['limit'](_0x2ef3e0[_0xd108('0x25')][_0xd108('0x16')]);_0x4d5655[_0xd108('0x18')]=qs[_0xd108('0x18')](_0x2ef3e0['query'][_0xd108('0x18')]);}_0x4d5655[_0xd108('0x40')]=qs[_0xd108('0x41')](_0x2ef3e0[_0xd108('0x25')][_0xd108('0x41')]);_0x4d5655['where']=qs[_0xd108('0x2a')](_[_0xd108('0x42')](_0x2ef3e0[_0xd108('0x25')],_0x57549e[_0xd108('0x2a')]));_0x4d5655[_0xd108('0x43')][_0xd108('0x44')]=_0x546430['id'];if(_0x2ef3e0['query'][_0xd108('0x45')]){_0x4d5655[_0xd108('0x43')]=_[_0xd108('0x30')](_0x4d5655['where'],{'$or':_[_0xd108('0x46')](_0x4d5655[_0xd108('0x2c')],function(_0x4f013c){var _0x1ae795={};_0x1ae795[_0x4f013c]={'$like':'%'+_0x2ef3e0[_0xd108('0x25')]['filter']+'%'};return _0x1ae795;})});}if(_0x2ef3e0[_0xd108('0x25')][_0xd108('0x47')]){var _0x1d6018=_0x2ef3e0['query'][_0xd108('0x47')]['split'](',');var _0x5dc206={};_0x5dc206[_0x1d6018[0x0]]={'$gte':moment(_0x1d6018[0x1])[_0xd108('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4d5655[_0xd108('0x43')]=_[_0xd108('0x30')](_0x4d5655[_0xd108('0x43')],_0x5dc206);}_0x4d5655=_[_0xd108('0x30')]({},_0x4d5655,_0x2ef3e0['options']);return db[_0xd108('0x3b')][_0xd108('0x17')]({'where':_0x4d5655[_0xd108('0x43')]})[_0xd108('0x1b')](function(_0x1a2c7f){_0x262735['count']=_0x1a2c7f;if(_0x2ef3e0[_0xd108('0x25')][_0xd108('0x2e')]){_0x4d5655[_0xd108('0x2f')]=[{'all':!![]}];}return db[_0xd108('0x3b')][_0xd108('0x23')](_0x4d5655);})[_0xd108('0x1b')](function(_0x11c690){_0x262735[_0xd108('0x49')]=_0x11c690;return _0x262735;});}})[_0xd108('0x1b')](respondWithFilteredResult(_0x4a96f1,_0x4d5655))[_0xd108('0x33')](handleError(_0x4a96f1,null));};exports[_0xd108('0x4a')]=function(_0x228003,_0x2bacaf){return db[_0xd108('0x35')]['find']({'where':{'id':_0x228003[_0xd108('0x37')]['id']}})[_0xd108('0x1b')](handleEntityNotFound(_0x2bacaf,null))[_0xd108('0x1b')](function(_0x4a1b01){if(_0x4a1b01){return _0x4a1b01[_0xd108('0x4b')](_0x228003['body']['ids'],_['omit'](_0x228003[_0xd108('0x36')],[_0xd108('0x3c'),'id'])||{})[_0xd108('0x4c')](function(){return db[_0xd108('0x4d')][_0xd108('0x23')]({'attributes':['id',_0xd108('0x4e'),'color'],'where':{'id':_0x228003[_0xd108('0x36')][_0xd108('0x3c')]}});})[_0xd108('0x1b')](function(_0x550932){socket[_0xd108('0x4f')](_0xd108('0x50'),{'id':Number(_0x228003[_0xd108('0x37')]['id']),'tags':_0x550932||[]});return{'id':Number(_0x228003['params']['id']),'tags':_0x550932||[]};});}})[_0xd108('0x1b')](respondWithResult(_0x2bacaf,null))[_0xd108('0x33')](handleError(_0x2bacaf,null));};exports[_0xd108('0x51')]=function(_0x8d22ba,_0x5101d5){return db[_0xd108('0x35')][_0xd108('0x32')]({'where':{'id':_0x8d22ba['params']['id']}})[_0xd108('0x1b')](handleEntityNotFound(_0x5101d5,null))[_0xd108('0x1b')](function(_0x3627e9){if(_0x3627e9){return _0x3627e9[_0xd108('0x51')](_0x8d22ba[_0xd108('0x25')]['ids']);}})[_0xd108('0x1b')](respondWithStatusCode(_0x5101d5,null))[_0xd108('0x33')](handleError(_0x5101d5,null));};exports[_0xd108('0x52')]=function(_0x4e6415,_0x57914f){var _0x2ed16b=moment()[_0xd108('0x53')]()[_0xd108('0x54')]();var _0x4cb05e=path[_0xd108('0x55')](config[_0xd108('0x56')],_0xd108('0x57'),_0xd108('0x58'),_0xd108('0x59'));var _0x516ce9=path[_0xd108('0x55')](_0x4cb05e,_0x2ed16b);var _0x4fe09b=util[_0xd108('0x48')](_0xd108('0x5a'),_0x4e6415[_0xd108('0x37')]['id'],_0x2ed16b);var _0x1108a2=path[_0xd108('0x55')](_0x4cb05e,_0x4fe09b);var _0x923afa=[];_0x923afa[_0xd108('0x5b')]({'model':db[_0xd108('0x5c')],'as':_0xd108('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x923afa[_0xd108('0x5b')]({'model':db['CmContact'],'as':_0xd108('0x5d'),'attributes':['id','firstName',_0xd108('0x5e')],'raw':!![]});var _0xb46dec=[{'model':db[_0xd108('0x3b')],'as':'Messages','attributes':['id','body',_0xd108('0x5f'),_0xd108('0x60'),'secret',_0xd108('0x61')],'include':_0x923afa}];_0xb46dec[_0xd108('0x5b')]({'model':db[_0xd108('0x62')],'as':_0xd108('0x63'),'attributes':['id',_0xd108('0x4e')]});_0xb46dec[_0xd108('0x5b')]({'model':db['User'],'as':_0xd108('0x64'),'attributes':['id',_0xd108('0x65')]});return db[_0xd108('0x35')][_0xd108('0x32')]({'where':{'id':_0x4e6415['params']['id']},'include':_0xb46dec})[_0xd108('0x1b')](handleEntityNotFound(_0x57914f,null))[_0xd108('0x1b')](function(_0x400e41){if(_0x400e41){var _0x32de9a=_0x400e41[_0xd108('0x66')]({'plain':!![]});fs['mkdirSync'](_0x516ce9);var _0x21063f={'channel':_0xd108('0x67'),'account':_0x32de9a[_0xd108('0x63')][_0xd108('0x4e')],'agent':_0x32de9a[_0xd108('0x64')]?_0x32de9a[_0xd108('0x64')][_0xd108('0x65')]:'N.A.','createdAt':moment(_0x32de9a['createdAt'])[_0xd108('0x48')](_0xd108('0x68'))['toString'](),'closedAt':_0x32de9a[_0xd108('0x69')]?moment(_0x32de9a[_0xd108('0x6a')])[_0xd108('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd108('0x54')]():'','disposition':_0x32de9a[_0xd108('0x6b')],'messages':_(_0x32de9a[_0xd108('0x6c')])['filter']({'secret':![]})[_0xd108('0x46')](function(_0x40640a){return{'date':moment(_0x40640a[_0xd108('0x5f')])['format'](_0xd108('0x68'))[_0xd108('0x54')](),'sender':_0x40640a[_0xd108('0x60')]===_0xd108('0x6d')?_0x40640a[_0xd108('0x5c')]?_0x40640a['User'][_0xd108('0x65')]:'System':_0x40640a['Contact'][_0xd108('0x6e')]+(_0x40640a['Contact'][_0xd108('0x5e')]?'\x20'+_0x40640a['Contact'][_0xd108('0x5e')]:''),'body':_0x40640a[_0xd108('0x36')],'direction':_0x40640a[_0xd108('0x60')]===_0xd108('0x6d')?'A':'C','secret':_0x40640a[_0xd108('0x6f')],'read':_0x40640a[_0xd108('0x61')]};})['value']()};return ejs['renderFile'](path[_0xd108('0x55')](config[_0xd108('0x56')],_0xd108('0x57'),'views','downloadInteraction.ejs'),{'interaction':_0x21063f})['then'](function(_0x5c2ee0){var _0x36018d=path['join'](_0x516ce9,_0xd108('0x70')+_0x32de9a['id']+'-'+_0x2ed16b+'.pdf');var _0x4f6f32={'path':_0x36018d,'channel':_0xd108('0x67'),'interactionId':_0x32de9a['id']};return pdf[_0xd108('0x71')](_0x5c2ee0,_0x4f6f32);})[_0xd108('0x1b')](function(){return new BPromise(function(_0x54d21e,_0x3fd2db){zipdir(_0x516ce9,{'saveTo':_0x1108a2},function(_0x435191,_0x247071){if(_0x435191)return _0x3fd2db(_0x435191);return _0x54d21e(_0x247071);});})[_0xd108('0x1b')](function(){return new BPromise(function(_0x41ad25,_0x5cbf94){rimraf(_0x516ce9,function(_0x24efb0){if(_0x24efb0)_0x5cbf94(_0x24efb0);return _0x41ad25();});});})['then'](function(){return _0x57914f[_0xd108('0x52')](_0x1108a2,_0x4fe09b,function(_0x1272d4){if(_0x1272d4){console[_0xd108('0x72')](_0xd108('0x73'),_0x1272d4);}else{fs[_0xd108('0x74')](_0x1108a2);}});});});}else{return _0x57914f[_0xd108('0x1c')](0xc8);}})['catch'](handleError(_0x57914f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index feb70dc..032288b 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 _0xa456=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x33472e,_0x5c0680){var _0xd444b2=function(_0x132f90){while(--_0x132f90){_0x33472e['push'](_0x33472e['shift']());}};_0xd444b2(++_0x5c0680);}(_0xa456,0x142));var _0x6a45=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa456[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require(_0x6a45('0x0'));var SmsInteraction=require(_0x6a45('0x1'))['db'][_0x6a45('0x2')];var SmsMessage=require(_0x6a45('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6a45('0x3')](0x0);var events={'afterCreate':_0x6a45('0x4'),'afterUpdate':_0x6a45('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f0701){return function(_0x40acad,_0x1e5882,_0x14da6b){_0x40acad['getUsers']({'attributes':['id'],'raw':!![]})[_0x6a45('0x6')](function(_0x26bfc0){_0x40acad[_0x6a45('0x7')](_0x6a45('0x8'),_0x26bfc0[_0x6a45('0x9')](function(_0x4858df){return{'id':_0x4858df['id']};}));return SmsMessage[_0x6a45('0xa')]({'where':{'SmsInteractionId':_0x40acad['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x36378a){_0x40acad[_0x6a45('0x7')](_0x6a45('0xb'),_0x36378a[_0x6a45('0xc')]);SmsInteractionEvents[_0x6a45('0xd')](_0x1f0701+':'+_0x40acad['id'],_0x40acad);SmsInteractionEvents['emit'](_0x1f0701,_0x40acad);_0x14da6b(null);})['catch'](_0x14da6b(null));};}for(var e in events){if(events[_0x6a45('0xe')](e)){var event=events[e];SmsInteraction[_0x6a45('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x47c5=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0x47c5,0x165));var _0x547c=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x47c5[_0x296897];return _0x2b44ab;};'use strict';var EventEmitter=require(_0x547c('0x0'));var SmsInteraction=require(_0x547c('0x1'))['db'][_0x547c('0x2')];var SmsMessage=require(_0x547c('0x1'))['db'][_0x547c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x547c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x547c('0x5'),'afterDestroy':_0x547c('0x6')};function emitEvent(_0x5b48c9){return function(_0x3e827e,_0x468220,_0x51ab7f){_0x3e827e[_0x547c('0x7')]({'attributes':['id'],'raw':!![]})[_0x547c('0x8')](function(_0x381f2e){_0x3e827e[_0x547c('0x9')](_0x547c('0xa'),_0x381f2e[_0x547c('0xb')](function(_0x3e2279){return{'id':_0x3e2279['id']};}));return SmsMessage[_0x547c('0xc')]({'where':{'SmsInteractionId':_0x3e827e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x547c('0x8')](function(_0x44a581){_0x3e827e[_0x547c('0x9')](_0x547c('0xd'),_0x44a581[_0x547c('0xe')]);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9+':'+_0x3e827e['id'],_0x3e827e);SmsInteractionEvents[_0x547c('0xf')](_0x5b48c9,_0x3e827e);_0x51ab7f(null);})[_0x547c('0x10')](_0x51ab7f(null));};}for(var e in events){if(events[_0x547c('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x547c('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 48bc667..27a1413 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 _0x5a63=['./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x587c48,_0x32e6c7){var _0x44d87b=function(_0x3d2f92){while(--_0x3d2f92){_0x587c48['push'](_0x587c48['shift']());}};_0x44d87b(++_0x32e6c7);}(_0x5a63,0xb3));var _0x35a6=function(_0x1f6c57,_0x444adc){_0x1f6c57=_0x1f6c57-0x0;var _0x393e91=_0x5a63[_0x1f6c57];return _0x393e91;};'use strict';var _=require('lodash');var util=require(_0x35a6('0x0'));var logger=require(_0x35a6('0x1'))(_0x35a6('0x2'));var moment=require(_0x35a6('0x3'));var BPromise=require('bluebird');var rp=require(_0x35a6('0x4'));var fs=require('fs');var path=require(_0x35a6('0x5'));var rimraf=require(_0x35a6('0x6'));var config=require(_0x35a6('0x7'));var attributes=require(_0x35a6('0x8'));module[_0x35a6('0x9')]=function(_0x45777f,_0x20ab09){return _0x45777f['define'](_0x35a6('0xa'),attributes,{'tableName':_0x35a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cf541,_0x1c828a,_0x19bf57){if(_0x3cf541[_0x35a6('0xc')](_0x35a6('0xd'))){_0x3cf541[_0x35a6('0xe')]=moment()[_0x35a6('0xf')](_0x35a6('0x10'));}_0x19bf57(null,_0x3cf541);}}});}; \ No newline at end of file +var _0xa79d=['SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0xa79d,0x6f));var _0xda79=function(_0x5d9b68,_0x426f17){_0x5d9b68=_0x5d9b68-0x0;var _0x5561=_0xa79d[_0x5d9b68];return _0x5561;};'use strict';var _=require(_0xda79('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xda79('0x1'));var moment=require('moment');var BPromise=require(_0xda79('0x2'));var rp=require(_0xda79('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda79('0x4'));var config=require(_0xda79('0x5'));var attributes=require(_0xda79('0x6'));module[_0xda79('0x7')]=function(_0x162b5c,_0x2fb167){return _0x162b5c[_0xda79('0x8')](_0xda79('0x9'),attributes,{'tableName':_0xda79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cfb9f,_0x5409b5,_0x28673d){if(_0x3cfb9f[_0xda79('0xb')](_0xda79('0xc'))){_0x3cfb9f[_0xda79('0xd')]=moment()['format'](_0xda79('0xe'));}_0x28673d(null,_0x3cfb9f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a8e19fb..4c5a05f 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 _0xdd81=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsInteraction','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','find','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring'];(function(_0x56fe1c,_0x30b7a5){var _0x5e58aa=function(_0xb6a2c3){while(--_0xb6a2c3){_0x56fe1c['push'](_0x56fe1c['shift']());}};_0x5e58aa(++_0x30b7a5);}(_0xdd81,0xfe));var _0x1dd8=function(_0x21f30b,_0x355485){_0x21f30b=_0x21f30b-0x0;var _0x3ea8c2=_0xdd81[_0x21f30b];return _0x3ea8c2;};'use strict';var _=require(_0x1dd8('0x0'));var util=require(_0x1dd8('0x1'));var moment=require('moment');var BPromise=require(_0x1dd8('0x2'));var rs=require(_0x1dd8('0x3'));var fs=require('fs');var Redis=require(_0x1dd8('0x4'));var db=require(_0x1dd8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dd8('0x6'))(_0x1dd8('0x7'));var config=require(_0x1dd8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1dd8('0x9')][_0x1dd8('0xa')]({'port':0x232a});config[_0x1dd8('0xb')]=_[_0x1dd8('0xc')](config[_0x1dd8('0xb')],{'host':_0x1dd8('0xd'),'port':0x18eb});var socket=require(_0x1dd8('0xe'))(new Redis(config['redis']));require(_0x1dd8('0xf'))[_0x1dd8('0x10')](socket);function respondWithRpcPromise(_0x1ef380,_0x5d855b,_0x3d3963){return new BPromise(function(_0x1693c4,_0x56639b){return client[_0x1dd8('0x11')](_0x1ef380,_0x3d3963)[_0x1dd8('0x12')](function(_0x322fae){logger[_0x1dd8('0x13')](_0x1dd8('0x14'),_0x5d855b,_0x1dd8('0x15'));logger[_0x1dd8('0x16')](_0x1dd8('0x17'),_0x5d855b,_0x1dd8('0x15'),JSON[_0x1dd8('0x18')](_0x322fae));if(_0x322fae['error']){if(_0x322fae[_0x1dd8('0x19')]['code']===0x1f4){logger[_0x1dd8('0x19')](_0x1dd8('0x14'),_0x5d855b,_0x322fae[_0x1dd8('0x19')]['message']);return _0x56639b(_0x322fae['error']['message']);}logger[_0x1dd8('0x19')](_0x1dd8('0x14'),_0x5d855b,_0x322fae['error'][_0x1dd8('0x1a')]);return _0x1693c4(_0x322fae[_0x1dd8('0x19')][_0x1dd8('0x1a')]);}else{logger['info'](_0x1dd8('0x14'),_0x5d855b,'request\x20sent');_0x1693c4(_0x322fae[_0x1dd8('0x1b')][_0x1dd8('0x1a')]);}})[_0x1dd8('0x1c')](function(_0x69c445){logger[_0x1dd8('0x19')](_0x1dd8('0x14'),_0x5d855b,_0x69c445);_0x56639b(_0x69c445);});});}exports['UpdateSmsInteraction']=function(_0x33fe48){var _0x37fe76=this;return new Promise(function(_0x1d57f9,_0x27499d){return db[_0x1dd8('0x1d')][_0x1dd8('0x1e')](_0x33fe48[_0x1dd8('0x1f')],{'raw':_0x33fe48[_0x1dd8('0x20')]?_0x33fe48[_0x1dd8('0x20')][_0x1dd8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33fe48['options']?_0x33fe48['options'][_0x1dd8('0x22')]||null:null,'attributes':_0x33fe48[_0x1dd8('0x20')]?_0x33fe48['options'][_0x1dd8('0x23')]||null:null,'limit':_0x33fe48[_0x1dd8('0x20')]?_0x33fe48[_0x1dd8('0x20')][_0x1dd8('0x24')]||null:null})[_0x1dd8('0x12')](function(_0x3691cc){logger[_0x1dd8('0x13')]('UpdateSmsInteraction',_0x33fe48);logger[_0x1dd8('0x16')](_0x1dd8('0x25'),_0x33fe48,JSON[_0x1dd8('0x18')](_0x3691cc));_0x1d57f9(_0x3691cc);})[_0x1dd8('0x1c')](function(_0x1848ea){logger[_0x1dd8('0x19')]('UpdateSmsInteraction',_0x1848ea[_0x1dd8('0x1a')],_0x33fe48);_0x27499d(_0x37fe76[_0x1dd8('0x19')](0x1f4,_0x1848ea['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x49bd67){return new Promise(function(_0xb26156,_0x440699){return db['SmsInteraction'][_0x1dd8('0x26')]({'where':_0x49bd67[_0x1dd8('0x20')]?_0x49bd67[_0x1dd8('0x20')][_0x1dd8('0x22')]||null:null})[_0x1dd8('0x12')](function(_0x171cc6){if(_0x171cc6){return _0x171cc6[_0x1dd8('0x27')](_0x49bd67['body'][_0x1dd8('0x28')],_[_0x1dd8('0x29')](_0x49bd67['body'],['ids','id'])||{});}})['spread'](function(_0x1eaa25){logger['info'](_0x1dd8('0x2a'),_0x49bd67);logger[_0x1dd8('0x16')]('AddTags',_0x49bd67,JSON[_0x1dd8('0x18')](_0x1eaa25));_0xb26156(_0x1eaa25);})[_0x1dd8('0x1c')](function(_0x41dda3){logger['error'](_0x1dd8('0x2a'),_0x41dda3['message'],_0x49bd67);_0x440699(_this[_0x1dd8('0x19')](0x1f4,_0x41dda3[_0x1dd8('0x1a')]));});});}; \ No newline at end of file +var _0xafb6=['defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','SmsInteraction','update','options','attributes','limit','then','UpdateSmsInteraction','AddTagsToSmsInteraction','where','body','omit','ids','spread','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x123297,_0x38edbe){var _0x3a3dcd=function(_0x420f61){while(--_0x420f61){_0x123297['push'](_0x123297['shift']());}};_0x3a3dcd(++_0x38edbe);}(_0xafb6,0x9a));var _0x6afb=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0xafb6[_0x5ad220];return _0xdec77d;};'use strict';var _=require('lodash');var util=require(_0x6afb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6afb('0x1'));var fs=require('fs');var Redis=require(_0x6afb('0x2'));var db=require(_0x6afb('0x3'))['db'];var utils=require(_0x6afb('0x4'));var logger=require('../../config/logger')(_0x6afb('0x5'));var config=require(_0x6afb('0x6'));var jayson=require(_0x6afb('0x7'));var client=jayson[_0x6afb('0x8')]['http']({'port':0x232a});config[_0x6afb('0x9')]=_[_0x6afb('0xa')](config[_0x6afb('0x9')],{'host':_0x6afb('0xb'),'port':0x18eb});var socket=require(_0x6afb('0xc'))(new Redis(config[_0x6afb('0x9')]));require(_0x6afb('0xd'))[_0x6afb('0xe')](socket);function respondWithRpcPromise(_0x29f2e3,_0x370b22,_0x410389){return new BPromise(function(_0x3619b7,_0x4ed0f7){return client[_0x6afb('0xf')](_0x29f2e3,_0x410389)['then'](function(_0x361532){logger[_0x6afb('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x370b22,_0x6afb('0x11'));logger[_0x6afb('0x12')](_0x6afb('0x13'),_0x370b22,'request\x20sent',JSON[_0x6afb('0x14')](_0x361532));if(_0x361532['error']){if(_0x361532[_0x6afb('0x15')][_0x6afb('0x16')]===0x1f4){logger[_0x6afb('0x15')](_0x6afb('0x17'),_0x370b22,_0x361532[_0x6afb('0x15')]['message']);return _0x4ed0f7(_0x361532[_0x6afb('0x15')]['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x370b22,_0x361532[_0x6afb('0x15')][_0x6afb('0x18')]);return _0x3619b7(_0x361532[_0x6afb('0x15')]['message']);}else{logger[_0x6afb('0x10')](_0x6afb('0x17'),_0x370b22,_0x6afb('0x11'));_0x3619b7(_0x361532[_0x6afb('0x19')][_0x6afb('0x18')]);}})[_0x6afb('0x1a')](function(_0x79dd28){logger[_0x6afb('0x15')](_0x6afb('0x17'),_0x370b22,_0x79dd28);_0x4ed0f7(_0x79dd28);});});}exports['UpdateSmsInteraction']=function(_0x262faf){var _0x45068a=this;return new Promise(function(_0x3bc2ca,_0x2df80b){return db[_0x6afb('0x1b')][_0x6afb('0x1c')](_0x262faf['body'],{'raw':_0x262faf['options']?_0x262faf[_0x6afb('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x262faf['options']?_0x262faf[_0x6afb('0x1d')]['where']||null:null,'attributes':_0x262faf[_0x6afb('0x1d')]?_0x262faf[_0x6afb('0x1d')][_0x6afb('0x1e')]||null:null,'limit':_0x262faf[_0x6afb('0x1d')]?_0x262faf[_0x6afb('0x1d')][_0x6afb('0x1f')]||null:null})[_0x6afb('0x20')](function(_0xcdb0a){logger[_0x6afb('0x10')](_0x6afb('0x21'),_0x262faf);logger['debug'](_0x6afb('0x21'),_0x262faf,JSON[_0x6afb('0x14')](_0xcdb0a));_0x3bc2ca(_0xcdb0a);})[_0x6afb('0x1a')](function(_0x2762a8){logger[_0x6afb('0x15')]('UpdateSmsInteraction',_0x2762a8[_0x6afb('0x18')],_0x262faf);_0x2df80b(_0x45068a[_0x6afb('0x15')](0x1f4,_0x2762a8[_0x6afb('0x18')]));});});};exports[_0x6afb('0x22')]=function(_0x326732){return new Promise(function(_0x2a7551,_0x3b46fb){return db[_0x6afb('0x1b')]['find']({'where':_0x326732[_0x6afb('0x1d')]?_0x326732['options'][_0x6afb('0x23')]||null:null})[_0x6afb('0x20')](function(_0x13a51d){if(_0x13a51d){return _0x13a51d['addTags'](_0x326732[_0x6afb('0x24')]['ids'],_[_0x6afb('0x25')](_0x326732[_0x6afb('0x24')],[_0x6afb('0x26'),'id'])||{});}})[_0x6afb('0x27')](function(_0x54a1bd){logger[_0x6afb('0x10')](_0x6afb('0x28'),_0x326732);logger[_0x6afb('0x12')](_0x6afb('0x28'),_0x326732,JSON[_0x6afb('0x14')](_0x54a1bd));_0x2a7551(_0x54a1bd);})[_0x6afb('0x1a')](function(_0x376fd8){logger['error'](_0x6afb('0x28'),_0x376fd8['message'],_0x326732);_0x3b46fb(_this['error'](0x1f4,_0x376fd8[_0x6afb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index fb38444..3f6b654 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 _0xdf90=['./smsInteraction.events','save','update','removeListener','register','length','smsInteraction:'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0xdf90,0x126));var _0x0df9=function(_0x117994,_0x46bbbb){_0x117994=_0x117994-0x0;var _0x40814a=_0xdf90[_0x117994];return _0x40814a;};'use strict';var SmsInteractionEvents=require(_0x0df9('0x0'));var events=[_0x0df9('0x1'),'remove',_0x0df9('0x2')];function createListener(_0x37fdfa,_0x14ea49){return function(_0xfeb99e){_0x14ea49['emit'](_0x37fdfa,_0xfeb99e);};}function removeListener(_0x8fb2ec,_0x3fbb55){return function(){SmsInteractionEvents[_0x0df9('0x3')](_0x8fb2ec,_0x3fbb55);};}exports[_0x0df9('0x4')]=function(_0x54fa69){for(var _0x17d566=0x0,_0x119bb0=events[_0x0df9('0x5')];_0x17d566<_0x119bb0;_0x17d566++){var _0x5c8f49=events[_0x17d566];var _0x3ac998=createListener(_0x0df9('0x6')+_0x5c8f49,_0x54fa69);SmsInteractionEvents['on'](_0x5c8f49,_0x3ac998);}}; \ No newline at end of file +var _0xfd46=['save','remove','update','emit','register','length','./smsInteraction.events'];(function(_0x40eec9,_0x817a67){var _0xfee890=function(_0x186640){while(--_0x186640){_0x40eec9['push'](_0x40eec9['shift']());}};_0xfee890(++_0x817a67);}(_0xfd46,0xae));var _0x6fd4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd46[_0x3ab51d];return _0x29a04e;};'use strict';var SmsInteractionEvents=require(_0x6fd4('0x0'));var events=[_0x6fd4('0x1'),_0x6fd4('0x2'),_0x6fd4('0x3')];function createListener(_0x1a5331,_0x430954){return function(_0x2cd6f9){_0x430954[_0x6fd4('0x4')](_0x1a5331,_0x2cd6f9);};}function removeListener(_0x5985e4,_0x4ba916){return function(){SmsInteractionEvents['removeListener'](_0x5985e4,_0x4ba916);};}exports[_0x6fd4('0x5')]=function(_0x43ebe5){for(var _0x4a1a48=0x0,_0x5ae8d4=events[_0x6fd4('0x6')];_0x4a1a48<_0x5ae8d4;_0x4a1a48++){var _0x1ace70=events[_0x4a1a48];var _0x34df52=createListener('smsInteraction:'+_0x1ace70,_0x43ebe5);SmsInteractionEvents['on'](_0x1ace70,_0x34df52);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c9ad98f..32a4b65 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 _0xfb3e=['get','isAuthenticated','describe','show','tracked','sms','create','/:id/status','/:id','put','/:id/reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller'];(function(_0x26393b,_0x449a84){var _0x57230a=function(_0x583888){while(--_0x583888){_0x26393b['push'](_0x26393b['shift']());}};_0x57230a(++_0x449a84);}(_0xfb3e,0x150));var _0xefb3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfb3e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xefb3('0x0'));var util=require(_0xefb3('0x1'));var path=require('path');var timeout=require(_0xefb3('0x2'));var express=require(_0xefb3('0x3'));var router=express[_0xefb3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xefb3('0x5'));var interaction=require(_0xefb3('0x6'));var config=require(_0xefb3('0x7'));var controller=require(_0xefb3('0x8'));router[_0xefb3('0x9')]('/',auth[_0xefb3('0xa')](),controller['index']);router['get']('/describe',auth[_0xefb3('0xa')](),controller[_0xefb3('0xb')]);router[_0xefb3('0x9')]('/:id',auth[_0xefb3('0xa')](),controller[_0xefb3('0xc')]);router['post']('/',auth[_0xefb3('0xa')](),interaction[_0xefb3('0xd')](_0xefb3('0xe'),'smsmessage:create'),controller[_0xefb3('0xf')]);router['post'](_0xefb3('0x10'),controller['status']);router['put'](_0xefb3('0x11'),auth[_0xefb3('0xa')](),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0xefb3('0x12')](_0xefb3('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0xefb3('0x14')]('/:id',auth[_0xefb3('0xa')](),controller[_0xefb3('0x15')]);module[_0xefb3('0x16')]=router; \ No newline at end of file +var _0xfbd6=['smsmessage:create','create','/:id/status','status','update','put','/:id/reject','reject','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked'];(function(_0x503d9c,_0x32e000){var _0x197c52=function(_0x1be198){while(--_0x1be198){_0x503d9c['push'](_0x503d9c['shift']());}};_0x197c52(++_0x32e000);}(_0xfbd6,0x1b2));var _0x6fbd=function(_0x4fa692,_0x56313c){_0x4fa692=_0x4fa692-0x0;var _0x5a531b=_0xfbd6[_0x4fa692];return _0x5a531b;};'use strict';var multer=require(_0x6fbd('0x0'));var util=require(_0x6fbd('0x1'));var path=require(_0x6fbd('0x2'));var timeout=require(_0x6fbd('0x3'));var express=require('express');var router=express[_0x6fbd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6fbd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6fbd('0x6'));var controller=require(_0x6fbd('0x7'));router[_0x6fbd('0x8')]('/',auth[_0x6fbd('0x9')](),controller['index']);router[_0x6fbd('0x8')](_0x6fbd('0xa'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0xb')]);router[_0x6fbd('0x8')](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0xd')]);router[_0x6fbd('0xe')]('/',auth[_0x6fbd('0x9')](),interaction[_0x6fbd('0xf')]('sms',_0x6fbd('0x10')),controller[_0x6fbd('0x11')]);router[_0x6fbd('0xe')](_0x6fbd('0x12'),controller[_0x6fbd('0x13')]);router['put'](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0x14')]);router[_0x6fbd('0x15')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put'](_0x6fbd('0x16'),auth[_0x6fbd('0x9')](),controller[_0x6fbd('0x17')]);router['delete'](_0x6fbd('0xc'),auth[_0x6fbd('0x9')](),controller['destroy']);module[_0x6fbd('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 389548e..8599be8 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 _0xa2e7=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x191b58,_0x2ca1f8){var _0x5df59e=function(_0x529eb6){while(--_0x529eb6){_0x191b58['push'](_0x191b58['shift']());}};_0x5df59e(++_0x2ca1f8);}(_0xa2e7,0x185));var _0x7a2e=function(_0x56eafe,_0x427600){_0x56eafe=_0x56eafe-0x0;var _0x5c27af=_0xa2e7[_0x56eafe];return _0x5c27af;};'use strict';var Sequelize=require(_0x7a2e('0x0'));module[_0x7a2e('0x1')]={'body':{'type':Sequelize[_0x7a2e('0x2')](_0x7a2e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7a2e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7a2e('0x5')]('in',_0x7a2e('0x6')),'defaultValue':_0x7a2e('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x7a2e('0x7')]},'readAt':{'type':Sequelize[_0x7a2e('0x8')]},'secret':{'type':Sequelize[_0x7a2e('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7a2e('0x2')]}}; \ No newline at end of file +var _0x71a1=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x9077a4,_0x41748c){var _0x204bdc=function(_0x1c611e){while(--_0x1c611e){_0x9077a4['push'](_0x9077a4['shift']());}};_0x204bdc(++_0x41748c);}(_0x71a1,0xfa));var _0x171a=function(_0x1551c3,_0x5b202d){_0x1551c3=_0x1551c3-0x0;var _0x469e95=_0x71a1[_0x1551c3];return _0x469e95;};'use strict';var Sequelize=require(_0x171a('0x0'));module[_0x171a('0x1')]={'body':{'type':Sequelize[_0x171a('0x2')](_0x171a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x171a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x171a('0x5')]('in',_0x171a('0x6')),'defaultValue':_0x171a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x171a('0x7')]},'secret':{'type':Sequelize[_0x171a('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x171a('0x8')]},'providerResponse':{'type':Sequelize[_0x171a('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 2ec3c7e..ac906b2 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 _0xdbc6=['get','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','motionChannel','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','zip-dir','request-promise','moment','bluebird','mustache','util','path','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','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','send','map','rawAttributes','type','key','model','name','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','SmsMessage','includeAll','findAll','rows','params','length','include','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','SmsInteractionId'];(function(_0x485381,_0x4713fd){var _0x1f2550=function(_0x941e64){while(--_0x941e64){_0x485381['push'](_0x485381['shift']());}};_0x1f2550(++_0x4713fd);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x2b4407,_0x4e47fc){_0x2b4407=_0x2b4407-0x0;var _0x1d54c4=_0xdbc6[_0x2b4407];return _0x1d54c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6dbc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dbc('0x1'));var moment=require(_0x6dbc('0x2'));var BPromise=require(_0x6dbc('0x3'));var Mustache=require(_0x6dbc('0x4'));var util=require(_0x6dbc('0x5'));var path=require(_0x6dbc('0x6'));var sox=require('sox');var csv=require(_0x6dbc('0x7'));var ejs=require(_0x6dbc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6dbc('0x9'));var squel=require(_0x6dbc('0xa'));var crypto=require(_0x6dbc('0xb'));var jsforce=require(_0x6dbc('0xc'));var deskjs=require(_0x6dbc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6dbc('0xe'));var Papa=require(_0x6dbc('0xf'));var Redis=require('ioredis');var authService=require(_0x6dbc('0x10'));var qs=require(_0x6dbc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6dbc('0x12'));var logger=require(_0x6dbc('0x13'))(_0x6dbc('0x14'));var utils=require(_0x6dbc('0x15'));var config=require(_0x6dbc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6dbc('0x17')]=_[_0x6dbc('0x18')](config[_0x6dbc('0x17')],{'host':_0x6dbc('0x19'),'port':0x18eb});var socket=require(_0x6dbc('0x1a'))(new Redis(config[_0x6dbc('0x17')]));require(_0x6dbc('0x1b'))[_0x6dbc('0x1c')](socket);var jayson=require(_0x6dbc('0x1d'));var client=jayson['client'][_0x6dbc('0x1e')]({'port':0x232c});var client9002=jayson[_0x6dbc('0x1f')][_0x6dbc('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x418e71,_0x25b8a8,_0x269fac,_0x3da417){return new BPromise(function(_0x1ee71a,_0x4bac98){var _0x5a896d=_0x3da417||client;return _0x5a896d['request'](_0x418e71,_0x269fac)[_0x6dbc('0x20')](function(_0x18d95d){logger[_0x6dbc('0x21')](_0x6dbc('0x22'),_0x25b8a8,_0x6dbc('0x23'));logger['debug'](_0x6dbc('0x24'),_0x25b8a8,_0x6dbc('0x23'),JSON[_0x6dbc('0x25')](_0x18d95d));if(_0x18d95d[_0x6dbc('0x26')]){if(_0x18d95d[_0x6dbc('0x26')][_0x6dbc('0x27')]===0x1f4){logger[_0x6dbc('0x26')](_0x6dbc('0x22'),_0x25b8a8,_0x18d95d[_0x6dbc('0x26')][_0x6dbc('0x28')]);return _0x4bac98(_0x18d95d[_0x6dbc('0x26')]['message']);}logger[_0x6dbc('0x26')](_0x6dbc('0x22'),_0x25b8a8,_0x18d95d[_0x6dbc('0x26')]['message']);return _0x1ee71a(_0x18d95d[_0x6dbc('0x26')]['message']);}else{logger[_0x6dbc('0x21')](_0x6dbc('0x22'),_0x25b8a8,_0x6dbc('0x23'));_0x1ee71a(_0x18d95d['result'][_0x6dbc('0x28')]);}})[_0x6dbc('0x29')](function(_0x2be03c){logger[_0x6dbc('0x26')](_0x6dbc('0x22'),_0x25b8a8,_0x2be03c);_0x4bac98(_0x2be03c);});});}function respondWithStatusCode(_0x3c7fdb,_0x43fab4){_0x43fab4=_0x43fab4||0xcc;return function(_0x1eb3fd){if(_0x1eb3fd){return _0x3c7fdb['sendStatus'](_0x43fab4);}return _0x3c7fdb[_0x6dbc('0x2a')](_0x43fab4)[_0x6dbc('0x2b')]();};}function respondWithResult(_0x455f29,_0x8a24fd){_0x8a24fd=_0x8a24fd||0xc8;return function(_0x19e43e){if(_0x19e43e){return _0x455f29[_0x6dbc('0x2a')](_0x8a24fd)[_0x6dbc('0x2c')](_0x19e43e);}};}function respondWithFilteredResult(_0x235e00,_0xe77d87){return function(_0x485593){if(_0x485593){var _0x23ea7d=typeof _0xe77d87[_0x6dbc('0x2d')]===_0x6dbc('0x2e')&&typeof _0xe77d87[_0x6dbc('0x2f')]===_0x6dbc('0x2e');var _0x491a19=_0x485593[_0x6dbc('0x30')];var _0x30cefd=_0x23ea7d?0x0:_0xe77d87[_0x6dbc('0x2d')];var _0x165f76=_0x23ea7d?_0x485593[_0x6dbc('0x30')]:_0xe77d87[_0x6dbc('0x2d')]+_0xe77d87['limit'];var _0x1599b3;if(_0x165f76>=_0x491a19){_0x165f76=_0x491a19;_0x1599b3=0xc8;}else{_0x1599b3=0xce;}_0x235e00[_0x6dbc('0x2a')](_0x1599b3);return _0x235e00[_0x6dbc('0x31')](_0x6dbc('0x32'),_0x30cefd+'-'+_0x165f76+'/'+_0x491a19)[_0x6dbc('0x2c')](_0x485593);}return null;};}function patchUpdates(_0x46c626){return function(_0x1e9f7a){try{jsonpatch[_0x6dbc('0x33')](_0x1e9f7a,_0x46c626,!![]);}catch(_0x313a7b){return BPromise[_0x6dbc('0x34')](_0x313a7b);}return _0x1e9f7a[_0x6dbc('0x35')]();};}function saveUpdates(_0x30f399,_0x3be925){return function(_0x49b39e){if(_0x49b39e){return _0x49b39e[_0x6dbc('0x36')](_0x30f399)[_0x6dbc('0x20')](function(_0x3b951c){return _0x3b951c;});}return null;};}function removeEntity(_0x41726f,_0x22d1e7){return function(_0x174b17){if(_0x174b17){return _0x174b17[_0x6dbc('0x37')]()[_0x6dbc('0x20')](function(){_0x41726f[_0x6dbc('0x2a')](0xcc)[_0x6dbc('0x2b')]();});}};}function handleEntityNotFound(_0xb1cbdc,_0x1bb22b){return function(_0x57e7a3){if(!_0x57e7a3){_0xb1cbdc['sendStatus'](0x194);}return _0x57e7a3;};}function handleError(_0x32ae2e,_0x3230c6){_0x3230c6=_0x3230c6||0x1f4;return function(_0x3e8a2e){logger['error'](_0x3e8a2e[_0x6dbc('0x38')]);if(_0x3e8a2e['name']){delete _0x3e8a2e['name'];}_0x32ae2e[_0x6dbc('0x2a')](_0x3230c6)[_0x6dbc('0x39')](_0x3e8a2e);};}exports['index']=function(_0x3e948f,_0x1c81a4){var _0x3057ac={},_0x119ce1={},_0x35e1b5={'count':0x0,'rows':[]};var _0x53c797=_[_0x6dbc('0x3a')](db['SmsMessage'][_0x6dbc('0x3b')],function(_0x11554b){return{'name':_0x11554b['fieldName'],'type':_0x11554b[_0x6dbc('0x3c')][_0x6dbc('0x3d')]};});_0x119ce1[_0x6dbc('0x3e')]=_[_0x6dbc('0x3a')](_0x53c797,_0x6dbc('0x3f'));_0x119ce1['query']=_[_0x6dbc('0x40')](_0x3e948f['query']);_0x119ce1['filters']=_['intersection'](_0x119ce1[_0x6dbc('0x3e')],_0x119ce1[_0x6dbc('0x41')]);_0x3057ac[_0x6dbc('0x42')]=_[_0x6dbc('0x43')](_0x119ce1[_0x6dbc('0x3e')],qs[_0x6dbc('0x44')](_0x3e948f[_0x6dbc('0x41')][_0x6dbc('0x44')]));_0x3057ac[_0x6dbc('0x42')]=_0x3057ac[_0x6dbc('0x42')]['length']?_0x3057ac[_0x6dbc('0x42')]:_0x119ce1[_0x6dbc('0x3e')];if(!_0x3e948f['query'][_0x6dbc('0x45')](_0x6dbc('0x46'))){_0x3057ac[_0x6dbc('0x2f')]=qs[_0x6dbc('0x2f')](_0x3e948f[_0x6dbc('0x41')]['limit']);_0x3057ac[_0x6dbc('0x2d')]=qs[_0x6dbc('0x2d')](_0x3e948f[_0x6dbc('0x41')][_0x6dbc('0x2d')]);}_0x3057ac[_0x6dbc('0x47')]=qs[_0x6dbc('0x48')](_0x3e948f[_0x6dbc('0x41')]['sort']);_0x3057ac[_0x6dbc('0x49')]=qs['filters'](_[_0x6dbc('0x4a')](_0x3e948f[_0x6dbc('0x41')],_0x119ce1[_0x6dbc('0x4b')]),_0x53c797);if(_0x3e948f[_0x6dbc('0x41')][_0x6dbc('0x4c')]){_0x3057ac[_0x6dbc('0x49')]=_[_0x6dbc('0x4d')](_0x3057ac[_0x6dbc('0x49')],{'$or':_[_0x6dbc('0x3a')](_0x53c797,function(_0x5ef4e4){if(_0x5ef4e4[_0x6dbc('0x3c')]!==_0x6dbc('0x4e')){var _0x3ca337={};_0x3ca337[_0x5ef4e4[_0x6dbc('0x3f')]]={'$like':'%'+_0x3e948f['query']['filter']+'%'};return _0x3ca337;}})});}_0x3057ac=_[_0x6dbc('0x4d')]({},_0x3057ac,_0x3e948f['options']);var _0x27a189={'where':_0x3057ac[_0x6dbc('0x49')]};return db[_0x6dbc('0x4f')][_0x6dbc('0x30')](_0x27a189)[_0x6dbc('0x20')](function(_0x4efc7a){_0x35e1b5[_0x6dbc('0x30')]=_0x4efc7a;if(_0x3e948f[_0x6dbc('0x41')][_0x6dbc('0x50')]){_0x3057ac['include']=[{'all':!![]}];}return db[_0x6dbc('0x4f')][_0x6dbc('0x51')](_0x3057ac);})['then'](function(_0x2532d4){_0x35e1b5[_0x6dbc('0x52')]=_0x2532d4;return _0x35e1b5;})[_0x6dbc('0x20')](respondWithFilteredResult(_0x1c81a4,_0x3057ac))['catch'](handleError(_0x1c81a4,null));};exports['show']=function(_0x53e422,_0x534f2c){var _0x8035fa={'raw':!![],'where':{'id':_0x53e422[_0x6dbc('0x53')]['id']}},_0x441ea7={};_0x441ea7['model']=_[_0x6dbc('0x40')](db[_0x6dbc('0x4f')][_0x6dbc('0x3b')]);_0x441ea7['query']=_['keys'](_0x53e422[_0x6dbc('0x41')]);_0x441ea7[_0x6dbc('0x4b')]=_[_0x6dbc('0x43')](_0x441ea7[_0x6dbc('0x3e')],_0x441ea7[_0x6dbc('0x41')]);_0x8035fa['attributes']=_[_0x6dbc('0x43')](_0x441ea7[_0x6dbc('0x3e')],qs['fields'](_0x53e422[_0x6dbc('0x41')][_0x6dbc('0x44')]));_0x8035fa['attributes']=_0x8035fa[_0x6dbc('0x42')][_0x6dbc('0x54')]?_0x8035fa['attributes']:_0x441ea7[_0x6dbc('0x3e')];if(_0x53e422[_0x6dbc('0x41')][_0x6dbc('0x50')]){_0x8035fa[_0x6dbc('0x55')]=[{'all':!![]}];}_0x8035fa=_[_0x6dbc('0x4d')]({},_0x8035fa,_0x53e422['options']);return db[_0x6dbc('0x4f')]['find'](_0x8035fa)[_0x6dbc('0x20')](handleEntityNotFound(_0x534f2c,null))[_0x6dbc('0x20')](respondWithResult(_0x534f2c,null))[_0x6dbc('0x29')](handleError(_0x534f2c,null));};exports[_0x6dbc('0x56')]=function(_0x1e1dbb,_0x2a6607){return db[_0x6dbc('0x4f')]['create'](_0x1e1dbb[_0x6dbc('0x57')],{})[_0x6dbc('0x20')](respondWithResult(_0x2a6607,0xc9))[_0x6dbc('0x29')](handleError(_0x2a6607,null));};exports[_0x6dbc('0x36')]=function(_0x45dcbf,_0x18ae42){if(_0x45dcbf[_0x6dbc('0x57')]['id']){delete _0x45dcbf['body']['id'];}return db[_0x6dbc('0x4f')][_0x6dbc('0x58')]({'where':{'id':_0x45dcbf['params']['id']}})['then'](handleEntityNotFound(_0x18ae42,null))[_0x6dbc('0x20')](saveUpdates(_0x45dcbf['body'],null))[_0x6dbc('0x20')](respondWithResult(_0x18ae42,null))[_0x6dbc('0x29')](handleError(_0x18ae42,null));};exports['destroy']=function(_0xbb5629,_0x1dd723){return db[_0x6dbc('0x4f')]['find']({'where':{'id':_0xbb5629[_0x6dbc('0x53')]['id']}})[_0x6dbc('0x20')](handleEntityNotFound(_0x1dd723,null))[_0x6dbc('0x20')](removeEntity(_0x1dd723,null))[_0x6dbc('0x29')](handleError(_0x1dd723,null));};exports['describe']=function(_0x280562,_0x5ec883){return db[_0x6dbc('0x4f')][_0x6dbc('0x59')]()[_0x6dbc('0x20')](respondWithResult(_0x5ec883,null))[_0x6dbc('0x29')](handleError(_0x5ec883,null));};var interaction_log=require(_0x6dbc('0x13'))(_0x6dbc('0x5a'));exports[_0x6dbc('0x5b')]=function(_0x68fb91,_0x2856a1,_0x13775f){var _0x4a3fde={'agent':{},'channel':_0x6dbc('0x5c')};if(_0x68fb91[_0x6dbc('0x57')]['id']){delete _0x68fb91[_0x6dbc('0x57')]['id'];}_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x5d')]=!![];_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x5e')]=moment()[_0x6dbc('0x5f')](_0x6dbc('0x60'));_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x61')]=_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x61')]||_0x68fb91['user']['id'];_0x4a3fde[_0x6dbc('0x62')]['id']=_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x61')];return db['SmsMessage'][_0x6dbc('0x58')]({'where':{'id':_0x68fb91[_0x6dbc('0x53')]['id'],'UserId':null}})[_0x6dbc('0x20')](handleEntityNotFound(_0x2856a1,null))[_0x6dbc('0x20')](saveUpdates(_0x68fb91[_0x6dbc('0x57')],null))[_0x6dbc('0x20')](function(_0x371cff){if(_0x371cff){_0x4a3fde['message']=_0x371cff['get']({'plain':!![]});return db[_0x6dbc('0x63')]['find']({'where':{'id':_0x371cff['SmsInteractionId']}});}return null;})[_0x6dbc('0x20')](handleEntityNotFound(_0x2856a1,null))['then'](function(_0x2c9d3c){if(_0x2c9d3c){return _0x2c9d3c[_0x6dbc('0x36')]({'UserId':_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x61')],'read1stAt':_[_0x6dbc('0x64')](_0x2c9d3c[_0x6dbc('0x65')])?moment()[_0x6dbc('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6dbc('0x20')](function(_0xf76996){if(_0xf76996){_0x4a3fde['interaction']=_0xf76996['get']({'plain':!![]});interaction_log[_0x6dbc('0x21')](_0x6dbc('0x66'),_0x68fb91['user']['id'],_0x68fb91['user'][_0x6dbc('0x3f')],_0x68fb91[_0x6dbc('0x67')][_0x6dbc('0x68')],_0x4a3fde[_0x6dbc('0x69')]['id'],_0x68fb91[_0x6dbc('0x57')]?JSON['stringify'](_0x68fb91[_0x6dbc('0x57')]):'null');return respondWithRpcPromise(_0x6dbc('0x6a'),'acceptMessage',_0x4a3fde);}return null;})[_0x6dbc('0x20')](function(_0x17d160){var _0x14c78a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17d160[_0x6dbc('0x28')][_0x6dbc('0x6b')];return db['sequelize']['query'](_0x14c78a,{'type':db[_0x6dbc('0x6c')][_0x6dbc('0x6d')]['SELECT'],'raw':!![]})[_0x6dbc('0x20')](function(_0x2fccb6){return _0x2fccb6;});})[_0x6dbc('0x20')](function(_0x2674dd){if(_0x2674dd){_0x4a3fde[_0x6dbc('0x28')][_0x6dbc('0x6e')]=_0x2674dd[0x0];if(!_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x61')])return;return db[_0x6dbc('0x6f')]['find']({'where':{'id':_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x61')],'role':_0x6dbc('0x62')},'attributes':['id',_0x6dbc('0x3f'),_0x6dbc('0x70'),_0x6dbc('0x71'),_0x6dbc('0x72')],'raw':!![]});}return null;})[_0x6dbc('0x20')](function(_0x39bc9a){if(!_0x39bc9a)return null;_0x4a3fde[_0x6dbc('0x28')]['agent']=_0x39bc9a;return _0x4a3fde;})[_0x6dbc('0x20')](function(_0xa7e803){if(_0xa7e803){if(_0x68fb91[_0x6dbc('0x57')][_0x6dbc('0x73')]){_0x4a3fde[_0x6dbc('0x28')][_0x6dbc('0x74')]=util[_0x6dbc('0x5f')](_0x6dbc('0x75'),_0x68fb91[_0x6dbc('0x67')][_0x6dbc('0x3f')]);_0x4a3fde['message'][_0x6dbc('0x76')]=_0x4a3fde[_0x6dbc('0x76')];_0x4a3fde[_0x6dbc('0x28')]['motionChannel']=_0x4a3fde[_0x6dbc('0x76')];_0x4a3fde[_0x6dbc('0x28')][_0x6dbc('0x77')]=_0x6dbc('0x5b');return respondWithRpcPromise(_0x6dbc('0x78'),_0x6dbc('0x78'),{'event':_0x6dbc('0x79'),'message':_0x4a3fde[_0x6dbc('0x28')]},client9002)['then'](function(){return _0x4a3fde;});}return _0x4a3fde;}return null;})['then'](respondWithResult(_0x2856a1,null))['catch'](handleError(_0x2856a1,null));};var interaction_log=require(_0x6dbc('0x13'))(_0x6dbc('0x5a'));exports['reject']=function(_0x472c65,_0x92601f,_0x371d85){var _0xff5090={'agent':{},'channel':_0x6dbc('0x5c')};if(_0x472c65['body']['id']){delete _0x472c65['body']['id'];}_0x472c65[_0x6dbc('0x57')][_0x6dbc('0x61')]=_0x472c65[_0x6dbc('0x57')][_0x6dbc('0x61')]||_0x472c65[_0x6dbc('0x67')]['id'];_0xff5090['agent']['id']=_0x472c65[_0x6dbc('0x57')][_0x6dbc('0x61')];return db[_0x6dbc('0x4f')][_0x6dbc('0x58')]({'where':{'id':_0x472c65['params']['id'],'UserId':null}})[_0x6dbc('0x20')](handleEntityNotFound(_0x92601f,null))[_0x6dbc('0x20')](function(_0x2267d6){if(_0x2267d6){_0xff5090[_0x6dbc('0x28')]=_0x2267d6['get']({'plain':!![]});return db[_0x6dbc('0x63')][_0x6dbc('0x58')]({'where':{'id':_0x2267d6[_0x6dbc('0x7a')]}});}return null;})[_0x6dbc('0x20')](handleEntityNotFound(_0x92601f,null))['then'](function(_0x5f5903){if(_0x5f5903){_0xff5090['interaction']=_0x5f5903[_0x6dbc('0x7b')]({'plain':!![]});interaction_log[_0x6dbc('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x472c65[_0x6dbc('0x67')]['id'],_0x472c65['user'][_0x6dbc('0x3f')],_0x472c65[_0x6dbc('0x67')][_0x6dbc('0x68')],_0xff5090['interaction']['id'],_0x472c65[_0x6dbc('0x57')]?JSON[_0x6dbc('0x25')](_0x472c65['body']):'null');return respondWithRpcPromise(_0x6dbc('0x7c'),_0x6dbc('0x7d'),_0xff5090);}return null;})[_0x6dbc('0x20')](function(_0x118b97){var _0x13c0de=_0x6dbc('0x7e')+_0x118b97[_0x6dbc('0x28')][_0x6dbc('0x6b')];return db[_0x6dbc('0x7f')][_0x6dbc('0x41')](_0x13c0de,{'type':db[_0x6dbc('0x6c')][_0x6dbc('0x6d')]['SELECT'],'raw':!![]})[_0x6dbc('0x20')](function(_0x3429bd){return _0x3429bd;});})[_0x6dbc('0x20')](function(_0x265c32){if(_0x265c32){_0xff5090['message'][_0x6dbc('0x6e')]=_0x265c32[0x0];if(!_0x472c65['body']['UserId'])return;return db[_0x6dbc('0x6f')]['find']({'where':{'id':_0x472c65['body'][_0x6dbc('0x61')],'role':_0x6dbc('0x62')},'attributes':['id',_0x6dbc('0x3f'),'fullname',_0x6dbc('0x71'),_0x6dbc('0x72')],'raw':!![]});}return null;})[_0x6dbc('0x20')](function(_0x300bc2){if(!_0x300bc2)return null;_0xff5090[_0x6dbc('0x28')][_0x6dbc('0x62')]=_0x300bc2;return _0xff5090;})['then'](function(_0x5c10c2){if(_0x5c10c2){_0x5c10c2[_0x6dbc('0x28')][_0x6dbc('0x74')]=util[_0x6dbc('0x5f')](_0x6dbc('0x75'),_0x472c65[_0x6dbc('0x67')]['name']);_0x5c10c2[_0x6dbc('0x28')][_0x6dbc('0x76')]=_0xff5090['channel'];_0x5c10c2['message'][_0x6dbc('0x80')]=_0xff5090[_0x6dbc('0x76')];_0x5c10c2['message'][_0x6dbc('0x77')]=_0x6dbc('0x34');respondWithRpcPromise(_0x6dbc('0x78'),_0x6dbc('0x78'),{'event':'rejectmessage','message':_0x5c10c2[_0x6dbc('0x28')]},client9002);return _0xff5090;}return null;})[_0x6dbc('0x20')](respondWithResult(_0x92601f,null))[_0x6dbc('0x29')](handleError(_0x92601f,null));};exports['status']=function(_0x29f9d8,_0x4ea395,_0x198e8e){if(_0x29f9d8[_0x6dbc('0x57')]['id']){delete _0x29f9d8[_0x6dbc('0x57')]['id'];}var _0x4d9e15;return db[_0x6dbc('0x4f')][_0x6dbc('0x58')]({'where':{'id':_0x29f9d8[_0x6dbc('0x53')]['id']}})[_0x6dbc('0x20')](handleEntityNotFound(_0x4ea395,null))[_0x6dbc('0x20')](function(_0x372b26){if(_0x372b26){_0x4d9e15=_0x372b26;return db['SmsAccount'][_0x6dbc('0x58')]({'where':{'id':_0x372b26[_0x6dbc('0x81')]}});}})[_0x6dbc('0x20')](handleEntityNotFound(_0x4ea395,null))[_0x6dbc('0x20')](function(_0x5d390c){if(_0x5d390c){logger['debug'](_0x6dbc('0x24'),'status',_0x6dbc('0x82'),_0x5d390c[_0x6dbc('0x3c')],util[_0x6dbc('0x83')](_0x29f9d8[_0x6dbc('0x57')],{'showHidden':![],'depth':null}));switch(_0x5d390c[_0x6dbc('0x3c')]){case _0x6dbc('0x84'):if(_0x29f9d8[_0x6dbc('0x57')]['MessageSid']&&_0x29f9d8['body'][_0x6dbc('0x85')]===_0x4d9e15[_0x6dbc('0x86')]){return _0x4d9e15[_0x6dbc('0x36')]({'read':!![]});}else{logger[_0x6dbc('0x26')](_0x6dbc('0x87'),_0x6dbc('0x2a'),_0x6dbc('0x84'),util[_0x6dbc('0x83')](_0x29f9d8[_0x6dbc('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6dbc('0x88'):if(_0x29f9d8[_0x6dbc('0x57')][_0x6dbc('0x89')]&&_0x29f9d8[_0x6dbc('0x57')]['MessageUUID']===_0x4d9e15[_0x6dbc('0x86')]&&_[_0x6dbc('0x8a')]([_0x6dbc('0x8b'),_0x6dbc('0x8c')],_0x29f9d8[_0x6dbc('0x57')][_0x6dbc('0x8d')])>=0x0){return _0x4d9e15['update']({'read':!![]});}else{logger[_0x6dbc('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6dbc('0x2a'),_0x6dbc('0x8e'),util[_0x6dbc('0x83')](_0x29f9d8['body'],{'showHidden':![],'depth':null}));}break;case _0x6dbc('0x8f'):var _0x3792be=_0x29f9d8[_0x6dbc('0x57')]['results'][0x0];if(_0x3792be[_0x6dbc('0x2a')][_0x6dbc('0x90')]===_0x6dbc('0x91')){return _0x4d9e15['update']({'read':!![]});}else{logger[_0x6dbc('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6dbc('0x2a'),_0x6dbc('0x8f'),util[_0x6dbc('0x83')](_0x29f9d8[_0x6dbc('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4d9e15;}})[_0x6dbc('0x20')](respondWithResult(_0x4ea395,null))[_0x6dbc('0x29')](handleError(_0x4ea395,null));}; \ No newline at end of file +var _0xf470=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','name','index','map','SmsMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','keys','rawAttributes','include','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','fullname','email','manual','interface','channel','motionChannel','event','EventManager','reject','SmsInteraction','role','RejectMessage','Sequelize','QueryTypes','User','internal','rejectmessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','then'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0xf470,0xfd));var _0x0f47=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xf470[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0x0f47('0x0'));var rimraf=require(_0x0f47('0x1'));var zipdir=require(_0x0f47('0x2'));var jsonpatch=require(_0x0f47('0x3'));var rp=require(_0x0f47('0x4'));var moment=require(_0x0f47('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0f47('0x6'));var util=require(_0x0f47('0x7'));var path=require('path');var sox=require(_0x0f47('0x8'));var csv=require(_0x0f47('0x9'));var ejs=require(_0x0f47('0xa'));var fs=require('fs');var fs_extra=require(_0x0f47('0xb'));var _=require(_0x0f47('0xc'));var squel=require(_0x0f47('0xd'));var crypto=require(_0x0f47('0xe'));var jsforce=require(_0x0f47('0xf'));var deskjs=require(_0x0f47('0x10'));var toCsv=require(_0x0f47('0x9'));var querystring=require(_0x0f47('0x11'));var Papa=require(_0x0f47('0x12'));var Redis=require(_0x0f47('0x13'));var authService=require(_0x0f47('0x14'));var qs=require(_0x0f47('0x15'));var as=require(_0x0f47('0x16'));var hardwareService=require(_0x0f47('0x17'));var logger=require(_0x0f47('0x18'))(_0x0f47('0x19'));var utils=require('../../config/utils');var config=require(_0x0f47('0x1a'));var licenseUtil=require(_0x0f47('0x1b'));var db=require(_0x0f47('0x1c'))['db'];config[_0x0f47('0x1d')]=_[_0x0f47('0x1e')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0f47('0x1f'))(new Redis(config[_0x0f47('0x1d')]));require(_0x0f47('0x20'))[_0x0f47('0x21')](socket);var jayson=require(_0x0f47('0x22'));var client=jayson['client'][_0x0f47('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e08f6,_0x2c2ba8,_0x3edb61,_0x1e84eb){return new BPromise(function(_0x475754,_0x325569){var _0x25e2e9=_0x1e84eb||client;return _0x25e2e9['request'](_0x1e08f6,_0x3edb61)[_0x0f47('0x24')](function(_0x3fcc5b){logger['info'](_0x0f47('0x25'),_0x2c2ba8,_0x0f47('0x26'));logger[_0x0f47('0x27')](_0x0f47('0x28'),_0x2c2ba8,_0x0f47('0x26'),JSON[_0x0f47('0x29')](_0x3fcc5b));if(_0x3fcc5b[_0x0f47('0x2a')]){if(_0x3fcc5b[_0x0f47('0x2a')][_0x0f47('0x2b')]===0x1f4){logger[_0x0f47('0x2a')](_0x0f47('0x25'),_0x2c2ba8,_0x3fcc5b['error']['message']);return _0x325569(_0x3fcc5b['error'][_0x0f47('0x2c')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x2c2ba8,_0x3fcc5b[_0x0f47('0x2a')][_0x0f47('0x2c')]);return _0x475754(_0x3fcc5b[_0x0f47('0x2a')][_0x0f47('0x2c')]);}else{logger[_0x0f47('0x2d')](_0x0f47('0x25'),_0x2c2ba8,_0x0f47('0x26'));_0x475754(_0x3fcc5b['result']['message']);}})[_0x0f47('0x2e')](function(_0x48c86){logger[_0x0f47('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x2c2ba8,_0x48c86);_0x325569(_0x48c86);});});}function respondWithStatusCode(_0x365482,_0x41a31e){_0x41a31e=_0x41a31e||0xcc;return function(_0x3e1fb0){if(_0x3e1fb0){return _0x365482[_0x0f47('0x2f')](_0x41a31e);}return _0x365482['status'](_0x41a31e)[_0x0f47('0x30')]();};}function respondWithResult(_0x327ebb,_0x44c56d){_0x44c56d=_0x44c56d||0xc8;return function(_0x401aea){if(_0x401aea){return _0x327ebb[_0x0f47('0x31')](_0x44c56d)[_0x0f47('0x32')](_0x401aea);}};}function respondWithFilteredResult(_0x1142cd,_0xd47c98){return function(_0x2b902e){if(_0x2b902e){var _0x2648f1=typeof _0xd47c98[_0x0f47('0x33')]===_0x0f47('0x34')&&typeof _0xd47c98['limit']===_0x0f47('0x34');var _0x28575c=_0x2b902e[_0x0f47('0x35')];var _0x1a0d44=_0x2648f1?0x0:_0xd47c98[_0x0f47('0x33')];var _0x49c679=_0x2648f1?_0x2b902e[_0x0f47('0x35')]:_0xd47c98[_0x0f47('0x33')]+_0xd47c98[_0x0f47('0x36')];var _0x503fd2;if(_0x49c679>=_0x28575c){_0x49c679=_0x28575c;_0x503fd2=0xc8;}else{_0x503fd2=0xce;}_0x1142cd[_0x0f47('0x31')](_0x503fd2);return _0x1142cd[_0x0f47('0x37')](_0x0f47('0x38'),_0x1a0d44+'-'+_0x49c679+'/'+_0x28575c)[_0x0f47('0x32')](_0x2b902e);}return null;};}function patchUpdates(_0xcfb085){return function(_0x52006a){try{jsonpatch['apply'](_0x52006a,_0xcfb085,!![]);}catch(_0x53ea2e){return BPromise['reject'](_0x53ea2e);}return _0x52006a[_0x0f47('0x39')]();};}function saveUpdates(_0x4f0aab,_0xdb5135){return function(_0x4bc23c){if(_0x4bc23c){return _0x4bc23c[_0x0f47('0x3a')](_0x4f0aab)[_0x0f47('0x24')](function(_0x5d10d3){return _0x5d10d3;});}return null;};}function removeEntity(_0x444d87,_0x4e879e){return function(_0x38470b){if(_0x38470b){return _0x38470b[_0x0f47('0x3b')]()[_0x0f47('0x24')](function(){_0x444d87[_0x0f47('0x31')](0xcc)[_0x0f47('0x30')]();});}};}function handleEntityNotFound(_0x4d7d38,_0x1c4e1a){return function(_0x280d77){if(!_0x280d77){_0x4d7d38[_0x0f47('0x2f')](0x194);}return _0x280d77;};}function handleError(_0x2d7fc6,_0x2fc8a3){_0x2fc8a3=_0x2fc8a3||0x1f4;return function(_0x47cf68){logger['error'](_0x47cf68['stack']);if(_0x47cf68[_0x0f47('0x3c')]){delete _0x47cf68[_0x0f47('0x3c')];}_0x2d7fc6[_0x0f47('0x31')](_0x2fc8a3)['send'](_0x47cf68);};}exports[_0x0f47('0x3d')]=function(_0x278e8c,_0x4814fe){var _0x5e17c7={},_0x497833={},_0xa42420={'count':0x0,'rows':[]};var _0x5471b6=_[_0x0f47('0x3e')](db[_0x0f47('0x3f')]['rawAttributes'],function(_0x477c59){return{'name':_0x477c59[_0x0f47('0x40')],'type':_0x477c59[_0x0f47('0x41')][_0x0f47('0x42')]};});_0x497833[_0x0f47('0x43')]=_[_0x0f47('0x3e')](_0x5471b6,_0x0f47('0x3c'));_0x497833[_0x0f47('0x44')]=_['keys'](_0x278e8c[_0x0f47('0x44')]);_0x497833[_0x0f47('0x45')]=_[_0x0f47('0x46')](_0x497833[_0x0f47('0x43')],_0x497833[_0x0f47('0x44')]);_0x5e17c7[_0x0f47('0x47')]=_['intersection'](_0x497833[_0x0f47('0x43')],qs['fields'](_0x278e8c[_0x0f47('0x44')][_0x0f47('0x48')]));_0x5e17c7['attributes']=_0x5e17c7[_0x0f47('0x47')][_0x0f47('0x49')]?_0x5e17c7[_0x0f47('0x47')]:_0x497833[_0x0f47('0x43')];if(!_0x278e8c[_0x0f47('0x44')]['hasOwnProperty']('nolimit')){_0x5e17c7[_0x0f47('0x36')]=qs[_0x0f47('0x36')](_0x278e8c[_0x0f47('0x44')][_0x0f47('0x36')]);_0x5e17c7[_0x0f47('0x33')]=qs[_0x0f47('0x33')](_0x278e8c[_0x0f47('0x44')]['offset']);}_0x5e17c7['order']=qs[_0x0f47('0x4a')](_0x278e8c[_0x0f47('0x44')][_0x0f47('0x4a')]);_0x5e17c7['where']=qs[_0x0f47('0x45')](_[_0x0f47('0x4b')](_0x278e8c[_0x0f47('0x44')],_0x497833[_0x0f47('0x45')]),_0x5471b6);if(_0x278e8c[_0x0f47('0x44')][_0x0f47('0x4c')]){_0x5e17c7[_0x0f47('0x4d')]=_[_0x0f47('0x4e')](_0x5e17c7[_0x0f47('0x4d')],{'$or':_['map'](_0x5471b6,function(_0x6fef01){if(_0x6fef01[_0x0f47('0x41')]!==_0x0f47('0x4f')){var _0x254176={};_0x254176[_0x6fef01[_0x0f47('0x3c')]]={'$like':'%'+_0x278e8c[_0x0f47('0x44')][_0x0f47('0x4c')]+'%'};return _0x254176;}})});}_0x5e17c7=_[_0x0f47('0x4e')]({},_0x5e17c7,_0x278e8c[_0x0f47('0x50')]);var _0x5b10f8={'where':_0x5e17c7['where']};return db[_0x0f47('0x3f')][_0x0f47('0x35')](_0x5b10f8)[_0x0f47('0x24')](function(_0x334c6f){_0xa42420[_0x0f47('0x35')]=_0x334c6f;if(_0x278e8c[_0x0f47('0x44')][_0x0f47('0x51')]){_0x5e17c7['include']=[{'all':!![]}];}return db[_0x0f47('0x3f')][_0x0f47('0x52')](_0x5e17c7);})[_0x0f47('0x24')](function(_0x6a478){_0xa42420[_0x0f47('0x53')]=_0x6a478;return _0xa42420;})[_0x0f47('0x24')](respondWithFilteredResult(_0x4814fe,_0x5e17c7))[_0x0f47('0x2e')](handleError(_0x4814fe,null));};exports['show']=function(_0x364950,_0xbc93b4){var _0x552dc3={'raw':!![],'where':{'id':_0x364950['params']['id']}},_0x2c2c04={};_0x2c2c04[_0x0f47('0x43')]=_[_0x0f47('0x54')](db[_0x0f47('0x3f')][_0x0f47('0x55')]);_0x2c2c04[_0x0f47('0x44')]=_[_0x0f47('0x54')](_0x364950[_0x0f47('0x44')]);_0x2c2c04[_0x0f47('0x45')]=_[_0x0f47('0x46')](_0x2c2c04['model'],_0x2c2c04[_0x0f47('0x44')]);_0x552dc3[_0x0f47('0x47')]=_[_0x0f47('0x46')](_0x2c2c04[_0x0f47('0x43')],qs[_0x0f47('0x48')](_0x364950[_0x0f47('0x44')][_0x0f47('0x48')]));_0x552dc3[_0x0f47('0x47')]=_0x552dc3[_0x0f47('0x47')][_0x0f47('0x49')]?_0x552dc3[_0x0f47('0x47')]:_0x2c2c04[_0x0f47('0x43')];if(_0x364950[_0x0f47('0x44')]['includeAll']){_0x552dc3[_0x0f47('0x56')]=[{'all':!![]}];}_0x552dc3=_[_0x0f47('0x4e')]({},_0x552dc3,_0x364950[_0x0f47('0x50')]);return db['SmsMessage'][_0x0f47('0x57')](_0x552dc3)[_0x0f47('0x24')](handleEntityNotFound(_0xbc93b4,null))[_0x0f47('0x24')](respondWithResult(_0xbc93b4,null))[_0x0f47('0x2e')](handleError(_0xbc93b4,null));};exports[_0x0f47('0x58')]=function(_0x4d9708,_0x1eaced){return db['SmsMessage'][_0x0f47('0x58')](_0x4d9708[_0x0f47('0x59')],{})[_0x0f47('0x24')](respondWithResult(_0x1eaced,0xc9))[_0x0f47('0x2e')](handleError(_0x1eaced,null));};exports[_0x0f47('0x3a')]=function(_0x26def7,_0x4e76a6){if(_0x26def7['body']['id']){delete _0x26def7[_0x0f47('0x59')]['id'];}return db['SmsMessage'][_0x0f47('0x57')]({'where':{'id':_0x26def7[_0x0f47('0x5a')]['id']}})[_0x0f47('0x24')](handleEntityNotFound(_0x4e76a6,null))['then'](saveUpdates(_0x26def7['body'],null))['then'](respondWithResult(_0x4e76a6,null))['catch'](handleError(_0x4e76a6,null));};exports['destroy']=function(_0x222be6,_0x650220){return db[_0x0f47('0x3f')][_0x0f47('0x57')]({'where':{'id':_0x222be6['params']['id']}})[_0x0f47('0x24')](handleEntityNotFound(_0x650220,null))['then'](removeEntity(_0x650220,null))[_0x0f47('0x2e')](handleError(_0x650220,null));};exports[_0x0f47('0x5b')]=function(_0x1f4b7c,_0xd39a78){return db[_0x0f47('0x3f')][_0x0f47('0x5b')]()[_0x0f47('0x24')](respondWithResult(_0xd39a78,null))[_0x0f47('0x2e')](handleError(_0xd39a78,null));};var interaction_log=require(_0x0f47('0x18'))(_0x0f47('0x5c'));exports[_0x0f47('0x5d')]=function(_0x8d72d0,_0x227aae,_0x3fd03b){var _0x5da95d={'agent':{},'channel':_0x0f47('0x5e')};if(_0x8d72d0[_0x0f47('0x59')]['id']){delete _0x8d72d0[_0x0f47('0x59')]['id'];}_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x5f')]=!![];_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x60')]=moment()[_0x0f47('0x61')](_0x0f47('0x62'));_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x63')]=_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x63')]||_0x8d72d0['user']['id'];_0x5da95d[_0x0f47('0x64')]['id']=_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x63')];return db[_0x0f47('0x3f')][_0x0f47('0x57')]({'where':{'id':_0x8d72d0['params']['id'],'UserId':null}})[_0x0f47('0x24')](handleEntityNotFound(_0x227aae,null))[_0x0f47('0x24')](saveUpdates(_0x8d72d0[_0x0f47('0x59')],null))[_0x0f47('0x24')](function(_0x11fe7b){if(_0x11fe7b){_0x5da95d[_0x0f47('0x2c')]=_0x11fe7b[_0x0f47('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x0f47('0x57')]({'where':{'id':_0x11fe7b[_0x0f47('0x66')]}});}return null;})[_0x0f47('0x24')](handleEntityNotFound(_0x227aae,null))['then'](function(_0x42c268){if(_0x42c268){return _0x42c268['update']({'UserId':_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x63')],'read1stAt':_[_0x0f47('0x67')](_0x42c268[_0x0f47('0x68')])?moment()[_0x0f47('0x61')](_0x0f47('0x62')):undefined});}return null;})[_0x0f47('0x24')](function(_0x49cd50){if(_0x49cd50){_0x5da95d[_0x0f47('0x69')]=_0x49cd50[_0x0f47('0x65')]({'plain':!![]});interaction_log[_0x0f47('0x2d')](_0x0f47('0x6a'),_0x8d72d0[_0x0f47('0x6b')]['id'],_0x8d72d0['user'][_0x0f47('0x3c')],_0x8d72d0[_0x0f47('0x6b')]['role'],_0x5da95d[_0x0f47('0x69')]['id'],_0x8d72d0[_0x0f47('0x59')]?JSON[_0x0f47('0x29')](_0x8d72d0['body']):_0x0f47('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5da95d);}return null;})[_0x0f47('0x24')](function(_0x546bff){var _0x496ea7=_0x0f47('0x6d')+_0x546bff[_0x0f47('0x2c')]['ContactId'];return db['sequelize'][_0x0f47('0x44')](_0x496ea7,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x1571f1){return _0x1571f1;});})['then'](function(_0x2f142b){if(_0x2f142b){_0x5da95d['message'][_0x0f47('0x6e')]=_0x2f142b[0x0];if(!_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x63')])return;return db['User'][_0x0f47('0x57')]({'where':{'id':_0x8d72d0[_0x0f47('0x59')]['UserId'],'role':_0x0f47('0x64')},'attributes':['id','name',_0x0f47('0x6f'),_0x0f47('0x70'),'internal'],'raw':!![]});}return null;})[_0x0f47('0x24')](function(_0x12ee48){if(!_0x12ee48)return null;_0x5da95d[_0x0f47('0x2c')][_0x0f47('0x64')]=_0x12ee48;return _0x5da95d;})[_0x0f47('0x24')](function(_0x5ab65e){if(_0x5ab65e){if(_0x8d72d0[_0x0f47('0x59')][_0x0f47('0x71')]){_0x5da95d[_0x0f47('0x2c')][_0x0f47('0x72')]=util['format']('SIP/%s',_0x8d72d0['user'][_0x0f47('0x3c')]);_0x5da95d[_0x0f47('0x2c')][_0x0f47('0x73')]=_0x5da95d[_0x0f47('0x73')];_0x5da95d['message'][_0x0f47('0x74')]=_0x5da95d[_0x0f47('0x73')];_0x5da95d[_0x0f47('0x2c')][_0x0f47('0x75')]='accept';return respondWithRpcPromise('EventManager',_0x0f47('0x76'),{'event':'acceptmessage','message':_0x5da95d['message']},client9002)[_0x0f47('0x24')](function(){return _0x5da95d;});}return _0x5da95d;}return null;})['then'](respondWithResult(_0x227aae,null))[_0x0f47('0x2e')](handleError(_0x227aae,null));};var interaction_log=require(_0x0f47('0x18'))(_0x0f47('0x5c'));exports[_0x0f47('0x77')]=function(_0x46de5d,_0x2dc480,_0x15274a){var _0x54262d={'agent':{},'channel':_0x0f47('0x5e')};if(_0x46de5d['body']['id']){delete _0x46de5d[_0x0f47('0x59')]['id'];}_0x46de5d[_0x0f47('0x59')][_0x0f47('0x63')]=_0x46de5d['body'][_0x0f47('0x63')]||_0x46de5d[_0x0f47('0x6b')]['id'];_0x54262d[_0x0f47('0x64')]['id']=_0x46de5d[_0x0f47('0x59')][_0x0f47('0x63')];return db['SmsMessage'][_0x0f47('0x57')]({'where':{'id':_0x46de5d[_0x0f47('0x5a')]['id'],'UserId':null}})[_0x0f47('0x24')](handleEntityNotFound(_0x2dc480,null))[_0x0f47('0x24')](function(_0x2bc339){if(_0x2bc339){_0x54262d[_0x0f47('0x2c')]=_0x2bc339[_0x0f47('0x65')]({'plain':!![]});return db[_0x0f47('0x78')][_0x0f47('0x57')]({'where':{'id':_0x2bc339[_0x0f47('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x2dc480,null))[_0x0f47('0x24')](function(_0x157f6b){if(_0x157f6b){_0x54262d[_0x0f47('0x69')]=_0x157f6b['get']({'plain':!![]});interaction_log[_0x0f47('0x2d')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46de5d[_0x0f47('0x6b')]['id'],_0x46de5d[_0x0f47('0x6b')][_0x0f47('0x3c')],_0x46de5d[_0x0f47('0x6b')][_0x0f47('0x79')],_0x54262d[_0x0f47('0x69')]['id'],_0x46de5d[_0x0f47('0x59')]?JSON[_0x0f47('0x29')](_0x46de5d[_0x0f47('0x59')]):_0x0f47('0x6c'));return respondWithRpcPromise(_0x0f47('0x7a'),'rejectMessage',_0x54262d);}return null;})['then'](function(_0xbef679){var _0x1b7db5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xbef679[_0x0f47('0x2c')]['ContactId'];return db['sequelize'][_0x0f47('0x44')](_0x1b7db5,{'type':db[_0x0f47('0x7b')][_0x0f47('0x7c')]['SELECT'],'raw':!![]})['then'](function(_0xa16f52){return _0xa16f52;});})[_0x0f47('0x24')](function(_0x59cc63){if(_0x59cc63){_0x54262d[_0x0f47('0x2c')][_0x0f47('0x6e')]=_0x59cc63[0x0];if(!_0x46de5d[_0x0f47('0x59')][_0x0f47('0x63')])return;return db[_0x0f47('0x7d')][_0x0f47('0x57')]({'where':{'id':_0x46de5d['body'][_0x0f47('0x63')],'role':_0x0f47('0x64')},'attributes':['id','name',_0x0f47('0x6f'),_0x0f47('0x70'),_0x0f47('0x7e')],'raw':!![]});}return null;})['then'](function(_0x4b07b3){if(!_0x4b07b3)return null;_0x54262d[_0x0f47('0x2c')]['agent']=_0x4b07b3;return _0x54262d;})['then'](function(_0x4acb5c){if(_0x4acb5c){_0x4acb5c['message'][_0x0f47('0x72')]=util[_0x0f47('0x61')]('SIP/%s',_0x46de5d[_0x0f47('0x6b')][_0x0f47('0x3c')]);_0x4acb5c[_0x0f47('0x2c')][_0x0f47('0x73')]=_0x54262d[_0x0f47('0x73')];_0x4acb5c[_0x0f47('0x2c')]['motionChannel']=_0x54262d[_0x0f47('0x73')];_0x4acb5c[_0x0f47('0x2c')][_0x0f47('0x75')]=_0x0f47('0x77');respondWithRpcPromise('EventManager',_0x0f47('0x76'),{'event':_0x0f47('0x7f'),'message':_0x4acb5c[_0x0f47('0x2c')]},client9002);return _0x54262d;}return null;})[_0x0f47('0x24')](respondWithResult(_0x2dc480,null))[_0x0f47('0x2e')](handleError(_0x2dc480,null));};exports['status']=function(_0x4032c1,_0x1866bc,_0x226783){if(_0x4032c1[_0x0f47('0x59')]['id']){delete _0x4032c1[_0x0f47('0x59')]['id'];}var _0x36a654;return db['SmsMessage'][_0x0f47('0x57')]({'where':{'id':_0x4032c1[_0x0f47('0x5a')]['id']}})[_0x0f47('0x24')](handleEntityNotFound(_0x1866bc,null))[_0x0f47('0x24')](function(_0x24fbdf){if(_0x24fbdf){_0x36a654=_0x24fbdf;return db[_0x0f47('0x80')][_0x0f47('0x57')]({'where':{'id':_0x24fbdf[_0x0f47('0x81')]}});}})[_0x0f47('0x24')](handleEntityNotFound(_0x1866bc,null))[_0x0f47('0x24')](function(_0x155447){if(_0x155447){logger[_0x0f47('0x27')](_0x0f47('0x28'),_0x0f47('0x31'),'received\x20delivery\x20report\x20from',_0x155447[_0x0f47('0x41')],util[_0x0f47('0x82')](_0x4032c1[_0x0f47('0x59')],{'showHidden':![],'depth':null}));switch(_0x155447['type']){case'twilio':if(_0x4032c1[_0x0f47('0x59')][_0x0f47('0x83')]&&_0x4032c1[_0x0f47('0x59')][_0x0f47('0x83')]===_0x36a654[_0x0f47('0x84')]){return _0x36a654['update']({'read':!![]});}else{logger[_0x0f47('0x2a')](_0x0f47('0x85'),_0x0f47('0x31'),_0x0f47('0x86'),util['inspect'](_0x4032c1[_0x0f47('0x59')],{'showHidden':![],'depth':null}));}break;case _0x0f47('0x87'):if(_0x4032c1[_0x0f47('0x59')]['MessageUUID']&&_0x4032c1['body'][_0x0f47('0x88')]===_0x36a654[_0x0f47('0x84')]&&_[_0x0f47('0x89')]([_0x0f47('0x8a'),'delivered'],_0x4032c1[_0x0f47('0x59')][_0x0f47('0x8b')])>=0x0){return _0x36a654[_0x0f47('0x3a')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0f47('0x8c'),util[_0x0f47('0x82')](_0x4032c1[_0x0f47('0x59')],{'showHidden':![],'depth':null}));}break;case _0x0f47('0x8d'):var _0x169983=_0x4032c1[_0x0f47('0x59')][_0x0f47('0x8e')][0x0];if(_0x169983['status'][_0x0f47('0x8f')]===_0x0f47('0x90')){return _0x36a654[_0x0f47('0x3a')]({'read':!![]});}else{logger['error'](_0x0f47('0x85'),_0x0f47('0x31'),_0x0f47('0x8d'),util['inspect'](_0x4032c1[_0x0f47('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x36a654;}})[_0x0f47('0x24')](respondWithResult(_0x1866bc,null))[_0x0f47('0x2e')](handleError(_0x1866bc,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 20494c5..f4fb4f8 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 _0x7828=['emit','hook','events','SmsMessage','setMaxListeners','save','update'];(function(_0x443663,_0x1edc17){var _0x1a2063=function(_0x3bf0f6){while(--_0x3bf0f6){_0x443663['push'](_0x443663['shift']());}};_0x1a2063(++_0x1edc17);}(_0x7828,0x183));var _0x8782=function(_0x455fef,_0xbf0e7d){_0x455fef=_0x455fef-0x0;var _0x34c3b6=_0x7828[_0x455fef];return _0x34c3b6;};'use strict';var EventEmitter=require(_0x8782('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x8782('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8782('0x2')](0x0);var events={'afterCreate':_0x8782('0x3'),'afterUpdate':_0x8782('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3eb113){return function(_0x73c158,_0x13aec7,_0x1b1086){SmsMessageEvents['emit'](_0x3eb113+':'+_0x73c158['id'],_0x73c158);SmsMessageEvents[_0x8782('0x5')](_0x3eb113,_0x73c158);_0x1b1086(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x8782('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x3d60=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2e819c,_0x3f99a5){var _0x24e271=function(_0x27d596){while(--_0x27d596){_0x2e819c['push'](_0x2e819c['shift']());}};_0x24e271(++_0x3f99a5);}(_0x3d60,0x1f1));var _0x03d6=function(_0x3c5cff,_0x3136f2){_0x3c5cff=_0x3c5cff-0x0;var _0x489f32=_0x3d60[_0x3c5cff];return _0x489f32;};'use strict';var EventEmitter=require(_0x03d6('0x0'));var SmsMessage=require(_0x03d6('0x1'))['db'][_0x03d6('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x03d6('0x3')](0x0);var events={'afterCreate':_0x03d6('0x4'),'afterUpdate':_0x03d6('0x5'),'afterDestroy':_0x03d6('0x6')};function emitEvent(_0x2c07e2){return function(_0x4c36b1,_0x2b981d,_0x229dc5){SmsMessageEvents['emit'](_0x2c07e2+':'+_0x4c36b1['id'],_0x4c36b1);SmsMessageEvents[_0x03d6('0x7')](_0x2c07e2,_0x4c36b1);_0x229dc5(null);};}for(var e in events){if(events[_0x03d6('0x8')](e)){var event=events[e];SmsMessage[_0x03d6('0x9')](e,emitEvent(event));}}module[_0x03d6('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 577694b..708700a 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 _0x1bc3=['models','toLowerCase','direction','out','secret','UserId','isNil','SmsInteraction','findOne','SmsInteractionId','then','createdAt','error','SmsAccount','SmsAccountId','type','twilio','authToken','accountSid','messages','create','/status?token=','token','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','phone','body','smsMethod','sender','password','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','message_id','clickSend','plivo','authId','%s:%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','remote','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','sort','length','md5','digest','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','accountId','/messages','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','FULLTEXT'];(function(_0x177558,_0x333314){var _0xfa2c1a=function(_0x41ba3b){while(--_0x41ba3b){_0x177558['push'](_0x177558['shift']());}};_0xfa2c1a(++_0x333314);}(_0x1bc3,0x66));var _0x31bc=function(_0x13415d,_0x21cb00){_0x13415d=_0x13415d-0x0;var _0xc0b181=_0x1bc3[_0x13415d];return _0xc0b181;};'use strict';var _=require(_0x31bc('0x0'));var util=require(_0x31bc('0x1'));var logger=require(_0x31bc('0x2'))('api');var moment=require(_0x31bc('0x3'));var BPromise=require(_0x31bc('0x4'));var rp=require(_0x31bc('0x5'));var fs=require('fs');var path=require(_0x31bc('0x6'));var rimraf=require(_0x31bc('0x7'));var config=require('../../config/environment');var attributes=require(_0x31bc('0x8'));module[_0x31bc('0x9')]=function(_0x18c2aa,_0x347ecf){return _0x18c2aa['define'](_0x31bc('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x31bc('0xb')]},{'name':_0x31bc('0xc'),'fields':['body'],'type':_0x31bc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e88b,_0x25adc2,_0x233822){var _0x4b1b67=_0x18c2aa[_0x31bc('0xe')];var _0x1eec4d=_0x49e88b['get']({'plain':!![]});if(_0x1eec4d['direction'][_0x31bc('0xf')]()==='in'||_0x1eec4d[_0x31bc('0x10')][_0x31bc('0xf')]()===_0x31bc('0x11')&&!_0x1eec4d[_0x31bc('0x12')]&&!_['isNil'](_0x1eec4d[_0x31bc('0x13')])&&!_[_0x31bc('0x14')](_0x1eec4d['SmsInteractionId'])){_0x4b1b67[_0x31bc('0x15')][_0x31bc('0x16')]({'where':{'id':_0x1eec4d[_0x31bc('0x17')]}})[_0x31bc('0x18')](function(_0x1d7e51){if(_0x1d7e51){_0x1d7e51['update']({'lastMsgAt':_0x1eec4d[_0x31bc('0x19')],'lastMsgDirection':_0x1eec4d[_0x31bc('0x10')][_0x31bc('0xf')]()});}})['catch'](function(_0x50626b){console[_0x31bc('0x1a')](_0x50626b);});}if(_0x1eec4d[_0x31bc('0x10')]===_0x31bc('0x11')&&!_0x1eec4d[_0x31bc('0x12')]){var _0x144c6b;_0x4b1b67[_0x31bc('0x1b')]['find']({'where':{'id':_0x1eec4d[_0x31bc('0x1c')]},'raw':!![]})[_0x31bc('0x18')](function(_0x10e64d){_0x144c6b=_0x10e64d;if(_0x144c6b&&_0x144c6b[_0x31bc('0x1d')]){switch(_0x144c6b[_0x31bc('0x1d')]){case _0x31bc('0x1e'):var _0x205abf=require(_0x31bc('0x1e'));if(_0x144c6b['accountSid']&&_0x144c6b[_0x31bc('0x1f')]&&_0x144c6b['phone']){var _0x353b0f=new _0x205abf(_0x144c6b[_0x31bc('0x20')],_0x144c6b[_0x31bc('0x1f')]);_0x353b0f[_0x31bc('0x21')][_0x31bc('0x22')]({'body':_0x1eec4d['body'],'to':_0x1eec4d['phone'],'from':_0x144c6b['phone'],'statusCallback':_0x144c6b['remote']+'/api/sms/messages/'+_0x1eec4d['id']+_0x31bc('0x23')+_0x144c6b[_0x31bc('0x24')]})[_0x31bc('0x18')](function(_0x1d7ebf){if(_0x1d7ebf['sid']){return _0x49e88b[_0x31bc('0x25')]({'messageId':_0x1d7ebf['sid']});}})[_0x31bc('0x26')](function(_0x117eff){logger[_0x31bc('0x1a')](_0x31bc('0x27'),'afterCreate',_0x31bc('0x1e'),util[_0x31bc('0x28')](_0x117eff,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31bc('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x31bc('0x2a'):var _0x2849da=_0x31bc('0x2b');if(_0x144c6b[_0x31bc('0x2c')]&&_0x144c6b['password']){var _0xcf8063={'recipient':[_0x1eec4d[_0x31bc('0x2d')]],'message':_0x1eec4d[_0x31bc('0x2e')],'message_type':_0x144c6b['smsMethod']};if(_0x144c6b['smsMethod']&&_0x144c6b[_0x31bc('0x2f')]!=='SI'){_0xcf8063[_0x31bc('0x30')]=_0x144c6b[_0x31bc('0x2d')];}var _0x42bd76={'url':_0x2849da+'login?username='+_0x144c6b[_0x31bc('0x2c')]+'&password='+_0x144c6b[_0x31bc('0x31')],'method':_0x31bc('0x32')};rp(_0x42bd76)[_0x31bc('0x18')](function(_0x34c998){var _0x24f4b9=_0x34c998[_0x31bc('0x33')](';');var _0x346658={'user_key':_0x24f4b9[0x0],'session_key':_0x24f4b9[0x1]};_0x42bd76={'url':_0x2849da+_0x31bc('0x34'),'method':_0x31bc('0x35'),'headers':{'user_key':_0x346658[_0x31bc('0x36')],'Session_key':_0x346658[_0x31bc('0x37')]},'json':!![],'body':_0xcf8063};return rp(_0x42bd76);})['then'](function(_0x166622){if(_0x166622[_0x31bc('0x38')]>=0x1){var _0x4710db={'messageId':_0x166622['internal_order_id']};if(_0x144c6b['smsMethod']!=='GP'||!_0x144c6b[_0x31bc('0x39')]){_0x4710db[_0x31bc('0x3a')]=!![];}return _0x49e88b['update'](_0x4710db);}else{return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x2a'),util[_0x31bc('0x28')](_0x166622,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4fddc0){return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x2a'),util[_0x31bc('0x28')](_0x4fddc0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x31bc('0x27'),'afterCreate','skebby',_0x31bc('0x3b'));}break;case'connectel':if(_0x144c6b[_0x31bc('0x1f')]){var _0x1755b3={'recipient':_0x1eec4d[_0x31bc('0x2d')],'message':_0x1eec4d[_0x31bc('0x2e')],'sender':_0x144c6b[_0x31bc('0x3c')]||_0x144c6b[_0x31bc('0x2d')],'authorization':_0x144c6b[_0x31bc('0x1f')]};var _0x25adc2={'method':_0x31bc('0x35'),'uri':_0x31bc('0x3d'),'body':_0x1755b3,'json':!![]};rp(_0x25adc2)[_0x31bc('0x18')](function(_0x3b9a50){var _0xd76eca={'messageId':_0x3b9a50[_0x31bc('0x3e')]};if(!_0x144c6b['deliveryReport']){_0xd76eca['read']=!![];}return _0x49e88b[_0x31bc('0x25')](_0xd76eca);})[_0x31bc('0x26')](function(_0x5d3263){logger[_0x31bc('0x1a')](_0x31bc('0x27'),'afterCreate','connectel',util[_0x31bc('0x28')](_0x5d3263,{'showHidden':![],'depth':null}));});}else{logger[_0x31bc('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31bc('0x29'),_0x31bc('0x3f'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x144c6b[_0x31bc('0x2c')]&&_0x144c6b[_0x31bc('0x31')]){var _0x1755b3={'messages':[{'source':_0x31bc('0x40'),'to':_0x1eec4d['phone'],'body':_0x1eec4d['body'],'from':_0x144c6b[_0x31bc('0x3c')]||_0x144c6b[_0x31bc('0x2d')]}]};var _0x386c23=util[_0x31bc('0x41')]('%s:%s',_0x144c6b[_0x31bc('0x2c')],_0x144c6b['password']);var _0x25adc2={'method':_0x31bc('0x35'),'uri':_0x31bc('0x42'),'body':_0x1755b3,'headers':{'Authorization':util[_0x31bc('0x41')](_0x31bc('0x43'),new Buffer(_0x386c23)[_0x31bc('0x44')](_0x31bc('0x45')))},'json':!![]};rp(_0x25adc2)['then'](function(_0xe0cf1d){if(_0xe0cf1d[_0x31bc('0x46')]>=0xc8&&_0xe0cf1d[_0x31bc('0x46')]<=0xce){if(_0xe0cf1d[_0x31bc('0x47')]&&_0xe0cf1d[_0x31bc('0x47')]['queued_count']>0x0){var _0x24613c=_['head'](_0xe0cf1d[_0x31bc('0x47')][_0x31bc('0x21')]);var _0x568f32={'messageId':_0x24613c[_0x31bc('0x48')]};if(!_0x144c6b['deliveryReport']){_0x568f32[_0x31bc('0x3a')]=!![];}return _0x49e88b[_0x31bc('0x25')](_0x568f32);}else{logger[_0x31bc('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31bc('0x29'),_0x31bc('0x49'),util[_0x31bc('0x28')](_0xe0cf1d,{'showHidden':![],'depth':null}));}}else{logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x49'),util[_0x31bc('0x28')](_0xe0cf1d,{'showHidden':![],'depth':null}));}})['catch'](function(_0xdff35e){logger['error'](_0x31bc('0x27'),'afterCreate',_0x31bc('0x49'),util[_0x31bc('0x28')](_0xdff35e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x49'),_0x31bc('0x3b'));}break;case _0x31bc('0x4a'):if(_0x144c6b[_0x31bc('0x4b')]&&_0x144c6b[_0x31bc('0x1f')]){var _0x1755b3={'dst':_0x1eec4d[_0x31bc('0x2d')],'text':_0x1eec4d[_0x31bc('0x2e')],'src':_0x144c6b[_0x31bc('0x3c')]||_0x144c6b[_0x31bc('0x2d')],'url':_0x144c6b['remote']+'/api/sms/messages/'+_0x1eec4d['id']+_0x31bc('0x23')+_0x144c6b['token']};var _0x386c23=util[_0x31bc('0x41')](_0x31bc('0x4c'),_0x144c6b[_0x31bc('0x4b')],_0x144c6b[_0x31bc('0x1f')]);var _0x25adc2={'method':_0x31bc('0x35'),'uri':util[_0x31bc('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x144c6b[_0x31bc('0x4b')]),'body':_0x1755b3,'headers':{'Authorization':util['format'](_0x31bc('0x43'),new Buffer(_0x386c23)['toString'](_0x31bc('0x45')))},'json':!![]};rp(_0x25adc2)[_0x31bc('0x18')](function(_0x389897){var _0x5f0939={'messageId':_0x389897[_0x31bc('0x4d')][0x0]};return _0x49e88b[_0x31bc('0x25')](_0x5f0939);})['catch'](function(_0x3cb92b){logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x4a'),util[_0x31bc('0x28')](_0x3cb92b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x31bc('0x27'),_0x31bc('0x29'),'plivo',_0x31bc('0x4e'));}break;case'infobip':if(_0x144c6b['username']&&_0x144c6b['password']){if(_0x144c6b[_0x31bc('0x4f')]){var _0x903a64={'method':'POST','uri':_0x144c6b[_0x31bc('0x4f')]+'/auth/1/session','body':{'username':_0x144c6b[_0x31bc('0x2c')],'password':_0x144c6b[_0x31bc('0x31')]},'json':!![]};return rp(_0x903a64)['then'](function(_0x431923){var _0x3dbf40={'method':'POST','uri':_0x144c6b['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x144c6b[_0x31bc('0x2d')],'destinations':[{'to':_0x1eec4d[_0x31bc('0x2d')]}],'text':_0x1eec4d[_0x31bc('0x2e')],'notifyUrl':_0x144c6b[_0x31bc('0x50')]+'/api/sms/messages/'+_0x1eec4d['id']+_0x31bc('0x23')+_0x144c6b[_0x31bc('0x24')],'notifyContentType':_0x31bc('0x51'),'callbackData':_0x144c6b[_0x31bc('0x2d')]+';'+_0x1eec4d[_0x31bc('0x2e')]}]},'headers':{'Authorization':_0x31bc('0x52')+_0x431923[_0x31bc('0x24')]},'json':!![]};return rp(_0x3dbf40)[_0x31bc('0x18')](function(_0x5dbaed){if(_0x5dbaed[_0x31bc('0x21')]){var _0xe05bf5={'messageId':_0x5dbaed[_0x31bc('0x21')][0x0][_0x31bc('0xb')]};if(!_0x144c6b[_0x31bc('0x39')]){_0xe05bf5['read']=!![];}return _0x49e88b[_0x31bc('0x25')](_0xe05bf5);}else{return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x53'),util[_0x31bc('0x28')](_0x5dbaed,{'showHidden':![],'depth':null}));}});})[_0x31bc('0x26')](function(_0x12c044){return logger[_0x31bc('0x1a')](_0x31bc('0x27'),'afterCreate',_0x31bc('0x53'),util['inspect'](_0x12c044,{'showHidden':![],'depth':null}));});}else{logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x53'),_0x31bc('0x54'));}}else{logger[_0x31bc('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31bc('0x29'),_0x31bc('0x53'),_0x31bc('0x3b'));}break;case _0x31bc('0x55'):var _0x23daba=require('crypto');if(_0x144c6b[_0x31bc('0x56')]){var _0x21860d={};_0x21860d[_0x31bc('0x57')]=_0x144c6b[_0x31bc('0x2c')];_0x21860d[_0x31bc('0x2d')]=_0x1eec4d[_0x31bc('0x2d')];_0x21860d[_0x31bc('0x30')]=_0x144c6b['phone'];_0x21860d[_0x31bc('0x58')]=_0x1eec4d['body'];_0x21860d['timestamp']=+new Date();var _0x2dfde8='';var _0x19c6da='';var _0x30fb86=Object['keys'](_0x21860d);_0x30fb86[_0x31bc('0x59')]();for(var _0x10ec87=0x0;_0x10ec87<_0x30fb86[_0x31bc('0x5a')];_0x10ec87++){if(_0x2dfde8!=''){_0x2dfde8+='&';}_0x2dfde8+=_0x30fb86[_0x10ec87]+'='+encodeURIComponent(_0x21860d[_0x30fb86[_0x10ec87]]);_0x19c6da+=_0x21860d[_0x30fb86[_0x10ec87]];}_0x19c6da+=_0x144c6b[_0x31bc('0x56')];_0x19c6da=_0x23daba['createHash'](_0x31bc('0x5b'))[_0x31bc('0x25')](_0x19c6da)[_0x31bc('0x5c')]('hex');if(_0x2dfde8!==''){_0x2dfde8+='&';}_0x2dfde8+=_0x31bc('0x5d')+_0x19c6da;var _0x42bd76={'method':_0x31bc('0x32'),'uri':_0x144c6b[_0x31bc('0x4f')]+_0x31bc('0x5e')+_0x2dfde8,'json':!![]};return rp(_0x42bd76)['then'](function(_0x567daf){var _0x2fee0f=Object[_0x31bc('0x5f')](_0x567daf);if(_0x567daf[_0x2fee0f[0x0]][_0x31bc('0x1a')]&&parseInt(_0x567daf[_0x2fee0f[0x0]][_0x31bc('0x1a')])===0x0){var _0x53455e={'messageId':_0x567daf[_0x2fee0f[0x0]][_0x31bc('0x60')]};if(!_0x144c6b[_0x31bc('0x39')]){_0x53455e[_0x31bc('0x3a')]=!![];}return _0x49e88b[_0x31bc('0x25')](_0x53455e);}else{return logger[_0x31bc('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31bc('0x29'),_0x31bc('0x55'),util['inspect'](_0x567daf[_0x31bc('0x1a')],{'showHidden':![],'depth':null}));}})[_0x31bc('0x26')](function(_0x3adbab){return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x55'),util[_0x31bc('0x28')](_0x3adbab,{'showHidden':![],'depth':null}));});}else{logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),'csc',_0x31bc('0x61'));}break;case _0x31bc('0x62'):if(_0x144c6b[_0x31bc('0x56')]){var _0x397f1c={'method':_0x31bc('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x144c6b[_0x31bc('0x56')]},'body':{'content':_0x1eec4d[_0x31bc('0x2e')],'to':[_0x1eec4d[_0x31bc('0x2d')]],'from':_0x144c6b[_0x31bc('0x2d')],'binary':![],'clientMessageId':_0x31bc('0x63'),'charset':_0x31bc('0x64')},'json':!![]};rp(_0x397f1c)[_0x31bc('0x18')](function(_0x2f2de4){if(!_0x2f2de4[_0x31bc('0x1a')]){var _0x27ef0b={'messageId':_0x2f2de4[_0x31bc('0x21')][0x0][_0x31bc('0x65')]};if(!_0x144c6b[_0x31bc('0x39')]){_0x27ef0b['read']=!![];}return _0x49e88b['update'](_0x27ef0b);}else{return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x62'),util[_0x31bc('0x28')](_0x2f2de4[_0x31bc('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x184126){return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x62'),util[_0x31bc('0x28')](_0x184126,{'showHidden':![],'depth':null}));});}else{logger[_0x31bc('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31bc('0x29'),_0x31bc('0x62'),_0x31bc('0x61'));}break;case _0x31bc('0x66'):if(_0x144c6b['username']&&_0x144c6b['password']){var _0x386c23=util[_0x31bc('0x41')](_0x31bc('0x4c'),_0x144c6b[_0x31bc('0x2c')],_0x144c6b[_0x31bc('0x31')]);var _0x25adc2={'method':_0x31bc('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x144c6b[_0x31bc('0x67')]+_0x31bc('0x68'),'body':{'to':[_0x1eec4d['phone']],'text':_0x1eec4d[_0x31bc('0x2e')],'from':_0x144c6b['phone'],'applicationId':_0x144c6b['applicationId']},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x386c23)[_0x31bc('0x44')](_0x31bc('0x45')))},'json':!![]};rp(_0x25adc2)[_0x31bc('0x18')](function(_0x33c6fe){if(_0x33c6fe['id']){var _0x1018b1={'messageId':_0x33c6fe['id']};return _0x49e88b['update'](_0x1018b1);}else{logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x66'),util[_0x31bc('0x28')](_0x33c6fe,{'showHidden':![],'depth':null}));}})[_0x31bc('0x26')](function(_0x3d5521){logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x66'),util[_0x31bc('0x28')](_0x3d5521,{'showHidden':![],'depth':null}));});}else{logger[_0x31bc('0x1a')](_0x31bc('0x27'),'afterCreate',_0x31bc('0x66'),_0x31bc('0x3b'));}break;case _0x31bc('0x69'):if(_0x144c6b[_0x31bc('0x56')]){var _0x4b355e={};var _0x42bd76={'method':_0x31bc('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x31bc('0x6a')+_0x144c6b[_0x31bc('0x56')],'Content-Type':_0x31bc('0x51')},'body':{'from':_0x144c6b['phone'],'to':_0x1eec4d[_0x31bc('0x2d')],'text':_0x1eec4d[_0x31bc('0x2e')]},'json':!![]};return rp(_0x42bd76)[_0x31bc('0x18')](function(_0x50ed5e){if(_0x50ed5e[_0x31bc('0x6b')]==0xca){_0x4b355e[_0x31bc('0x6c')]=_0x50ed5e;var _0x17df82={'method':'POST','uri':_0x31bc('0x6d'),'headers':{'Authorization':_0x31bc('0x6a')+_0x144c6b[_0x31bc('0x56')],'Content-Type':'application/json'},'body':{'refid':_0x4b355e[_0x31bc('0x6c')]['refid']},'json':!![]};return rp(_0x17df82)[_0x31bc('0x18')](function(_0x5894de){_0x4b355e[_0x31bc('0x6e')]=_0x5894de;var _0x422e92={'messageId':_0x4b355e[_0x31bc('0x6c')][_0x31bc('0x6f')],'read':!![]};return _0x49e88b[_0x31bc('0x25')](_0x422e92);});}else{return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x69'),util[_0x31bc('0x28')](_0x50ed5e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x46c4aa){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31bc('0x29'),_0x31bc('0x69'),util[_0x31bc('0x28')](_0x46c4aa,{'showHidden':![],'depth':null}));});}else{return logger[_0x31bc('0x1a')](_0x31bc('0x27'),_0x31bc('0x29'),_0x31bc('0x69'),_0x31bc('0x70'));}break;}}})[_0x31bc('0x71')](function(){_0x233822();});}else{_0x233822();}}},'charset':_0x31bc('0x72'),'collate':_0x31bc('0x73')});}; \ No newline at end of file +var _0x27a0=['/sms/2/text/advanced','token','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','sender','timestamp','sort','apiKey','digest','/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','catch','error','find','type','twilio','accountSid','phone','authToken','remote','/status?token=','update','sid','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=','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','skebby','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','messages','message_id','deliveryReport','clickSend','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x27a0,0x19c));var _0x027a=function(_0x5433a5,_0x24e249){_0x5433a5=_0x5433a5-0x0;var _0x2474c8=_0x27a0[_0x5433a5];return _0x2474c8;};'use strict';var _=require(_0x027a('0x0'));var util=require(_0x027a('0x1'));var logger=require(_0x027a('0x2'))(_0x027a('0x3'));var moment=require(_0x027a('0x4'));var BPromise=require(_0x027a('0x5'));var rp=require(_0x027a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x027a('0x7'));var config=require('../../config/environment');var attributes=require(_0x027a('0x8'));module[_0x027a('0x9')]=function(_0x2d37c3,_0x3f8f32){return _0x2d37c3[_0x027a('0xa')](_0x027a('0xb'),attributes,{'tableName':_0x027a('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x027a('0xd')]},{'name':'fti_sms_messages','fields':[_0x027a('0xe')],'type':_0x027a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b4198,_0x3bbf94,_0x29aec0){var _0x5c10bd=_0x2d37c3[_0x027a('0x10')];var _0x593ad9=_0x1b4198['get']({'plain':!![]});if(_0x593ad9[_0x027a('0x11')][_0x027a('0x12')]()==='in'||_0x593ad9[_0x027a('0x11')]['toLowerCase']()===_0x027a('0x13')&&!_0x593ad9[_0x027a('0x14')]&&!_[_0x027a('0x15')](_0x593ad9['UserId'])&&!_[_0x027a('0x15')](_0x593ad9[_0x027a('0x16')])){_0x5c10bd[_0x027a('0x17')][_0x027a('0x18')]({'where':{'id':_0x593ad9[_0x027a('0x16')]}})[_0x027a('0x19')](function(_0x441432){if(_0x441432){_0x441432['update']({'lastMsgAt':_0x593ad9['createdAt'],'lastMsgDirection':_0x593ad9[_0x027a('0x11')][_0x027a('0x12')]()});}})[_0x027a('0x1a')](function(_0x16ccdd){console[_0x027a('0x1b')](_0x16ccdd);});}if(_0x593ad9[_0x027a('0x11')]===_0x027a('0x13')&&!_0x593ad9[_0x027a('0x14')]){var _0x3be662;_0x5c10bd['SmsAccount'][_0x027a('0x1c')]({'where':{'id':_0x593ad9['SmsAccountId']},'raw':!![]})[_0x027a('0x19')](function(_0x54a63a){_0x3be662=_0x54a63a;if(_0x3be662&&_0x3be662[_0x027a('0x1d')]){switch(_0x3be662['type']){case _0x027a('0x1e'):var _0x3b1f97=require('twilio');if(_0x3be662[_0x027a('0x1f')]&&_0x3be662['authToken']&&_0x3be662[_0x027a('0x20')]){var _0x215050=new _0x3b1f97(_0x3be662[_0x027a('0x1f')],_0x3be662[_0x027a('0x21')]);_0x215050['messages']['create']({'body':_0x593ad9['body'],'to':_0x593ad9[_0x027a('0x20')],'from':_0x3be662['phone'],'statusCallback':_0x3be662[_0x027a('0x22')]+'/api/sms/messages/'+_0x593ad9['id']+_0x027a('0x23')+_0x3be662['token']})['then'](function(_0x5b789a){if(_0x5b789a['sid']){return _0x1b4198[_0x027a('0x24')]({'messageId':_0x5b789a[_0x027a('0x25')]});}})[_0x027a('0x1a')](function(_0xd27722){logger[_0x027a('0x1b')](_0x027a('0x26'),'afterCreate',_0x027a('0x1e'),util[_0x027a('0x27')](_0xd27722,{'showHidden':![],'depth':null}));});}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x1e'),_0x027a('0x29'));}break;case'skebby':var _0x2e6420=_0x027a('0x2a');if(_0x3be662['username']&&_0x3be662[_0x027a('0x2b')]){var _0x3cb479={'recipient':[_0x593ad9[_0x027a('0x20')]],'message':_0x593ad9['body'],'message_type':_0x3be662[_0x027a('0x2c')]};if(_0x3be662['smsMethod']&&_0x3be662[_0x027a('0x2c')]!=='SI'){_0x3cb479['sender']=_0x3be662[_0x027a('0x20')];}var _0x137a3f={'url':_0x2e6420+_0x027a('0x2d')+_0x3be662[_0x027a('0x2e')]+_0x027a('0x2f')+_0x3be662[_0x027a('0x2b')],'method':_0x027a('0x30')};rp(_0x137a3f)[_0x027a('0x19')](function(_0x20d8cc){var _0xa0794a=_0x20d8cc[_0x027a('0x31')](';');var _0x3823e8={'user_key':_0xa0794a[0x0],'session_key':_0xa0794a[0x1]};_0x137a3f={'url':_0x2e6420+_0x027a('0x32'),'method':_0x027a('0x33'),'headers':{'user_key':_0x3823e8[_0x027a('0x34')],'Session_key':_0x3823e8[_0x027a('0x35')]},'json':!![],'body':_0x3cb479};return rp(_0x137a3f);})[_0x027a('0x19')](function(_0x470a2c){if(_0x470a2c[_0x027a('0x36')]>=0x1){var _0x5559c0={'messageId':_0x470a2c[_0x027a('0x37')]};if(_0x3be662['smsMethod']!=='GP'||!_0x3be662['deliveryReport']){_0x5559c0['read']=!![];}return _0x1b4198[_0x027a('0x24')](_0x5559c0);}else{return logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x38'),util['inspect'](_0x470a2c,{'showHidden':![],'depth':null}));}})[_0x027a('0x1a')](function(_0x51dd5d){return logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x38'),util[_0x027a('0x27')](_0x51dd5d,{'showHidden':![],'depth':null}));});}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x38'),_0x027a('0x39'));}break;case _0x027a('0x3a'):if(_0x3be662[_0x027a('0x21')]){var _0xd02eb5={'recipient':_0x593ad9[_0x027a('0x20')],'message':_0x593ad9[_0x027a('0xe')],'sender':_0x3be662['senderString']||_0x3be662[_0x027a('0x20')],'authorization':_0x3be662['authToken']};var _0x3bbf94={'method':_0x027a('0x33'),'uri':_0x027a('0x3b'),'body':_0xd02eb5,'json':!![]};rp(_0x3bbf94)['then'](function(_0x3f6f0b){var _0x1eadb5={'messageId':_0x3f6f0b[_0x027a('0x3c')]};if(!_0x3be662['deliveryReport']){_0x1eadb5[_0x027a('0x3d')]=!![];}return _0x1b4198[_0x027a('0x24')](_0x1eadb5);})[_0x027a('0x1a')](function(_0x22fe8a){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027a('0x28'),'connectel',util[_0x027a('0x27')](_0x22fe8a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x3a'),_0x027a('0x3e'));}break;case _0x027a('0x3f'):if(_0x3be662[_0x027a('0x2e')]&&_0x3be662[_0x027a('0x2b')]){var _0xd02eb5={'messages':[{'source':_0x027a('0x40'),'to':_0x593ad9['phone'],'body':_0x593ad9[_0x027a('0xe')],'from':_0x3be662[_0x027a('0x41')]||_0x3be662[_0x027a('0x20')]}]};var _0x1991be=util[_0x027a('0x42')](_0x027a('0x43'),_0x3be662[_0x027a('0x2e')],_0x3be662[_0x027a('0x2b')]);var _0x3bbf94={'method':_0x027a('0x33'),'uri':_0x027a('0x44'),'body':_0xd02eb5,'headers':{'Authorization':util[_0x027a('0x42')](_0x027a('0x45'),new Buffer(_0x1991be)[_0x027a('0x46')](_0x027a('0x47')))},'json':!![]};rp(_0x3bbf94)['then'](function(_0x2f1bfa){if(_0x2f1bfa['http_code']>=0xc8&&_0x2f1bfa[_0x027a('0x48')]<=0xce){if(_0x2f1bfa[_0x027a('0x49')]&&_0x2f1bfa['data']['queued_count']>0x0){var _0x409309=_[_0x027a('0x4a')](_0x2f1bfa[_0x027a('0x49')][_0x027a('0x4b')]);var _0x3c5bad={'messageId':_0x409309[_0x027a('0x4c')]};if(!_0x3be662[_0x027a('0x4d')]){_0x3c5bad[_0x027a('0x3d')]=!![];}return _0x1b4198[_0x027a('0x24')](_0x3c5bad);}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x4e'),util[_0x027a('0x27')](_0x2f1bfa,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x027a('0x26'),_0x027a('0x28'),'clickSend',util[_0x027a('0x27')](_0x2f1bfa,{'showHidden':![],'depth':null}));}})['catch'](function(_0x36c6d1){logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),'clickSend',util['inspect'](_0x36c6d1,{'showHidden':![],'depth':null}));});}else{logger[_0x027a('0x1b')](_0x027a('0x26'),'afterCreate',_0x027a('0x4e'),_0x027a('0x39'));}break;case'plivo':if(_0x3be662[_0x027a('0x4f')]&&_0x3be662[_0x027a('0x21')]){var _0xd02eb5={'dst':_0x593ad9['phone'],'text':_0x593ad9['body'],'src':_0x3be662['senderString']||_0x3be662[_0x027a('0x20')],'url':_0x3be662[_0x027a('0x22')]+_0x027a('0x50')+_0x593ad9['id']+_0x027a('0x23')+_0x3be662['token']};var _0x1991be=util[_0x027a('0x42')](_0x027a('0x43'),_0x3be662[_0x027a('0x4f')],_0x3be662[_0x027a('0x21')]);var _0x3bbf94={'method':_0x027a('0x33'),'uri':util[_0x027a('0x42')](_0x027a('0x51'),_0x3be662[_0x027a('0x4f')]),'body':_0xd02eb5,'headers':{'Authorization':util[_0x027a('0x42')](_0x027a('0x45'),new Buffer(_0x1991be)['toString'](_0x027a('0x47')))},'json':!![]};rp(_0x3bbf94)[_0x027a('0x19')](function(_0x569954){var _0xb697e3={'messageId':_0x569954[_0x027a('0x52')][0x0]};return _0x1b4198['update'](_0xb697e3);})['catch'](function(_0x25eb2b){logger['error'](_0x027a('0x26'),_0x027a('0x28'),'plivo',util[_0x027a('0x27')](_0x25eb2b,{'showHidden':![],'depth':null}));});}else{logger[_0x027a('0x1b')](_0x027a('0x26'),'afterCreate',_0x027a('0x53'),_0x027a('0x54'));}break;case _0x027a('0x55'):if(_0x3be662[_0x027a('0x2e')]&&_0x3be662[_0x027a('0x2b')]){if(_0x3be662['baseUrl']){var _0x1cac67={'method':_0x027a('0x33'),'uri':_0x3be662[_0x027a('0x56')]+_0x027a('0x57'),'body':{'username':_0x3be662[_0x027a('0x2e')],'password':_0x3be662[_0x027a('0x2b')]},'json':!![]};return rp(_0x1cac67)[_0x027a('0x19')](function(_0xc8024d){var _0x51ea01={'method':_0x027a('0x33'),'uri':_0x3be662[_0x027a('0x56')]+_0x027a('0x58'),'body':{'messages':[{'from':_0x3be662[_0x027a('0x20')],'destinations':[{'to':_0x593ad9[_0x027a('0x20')]}],'text':_0x593ad9['body'],'notifyUrl':_0x3be662[_0x027a('0x22')]+_0x027a('0x50')+_0x593ad9['id']+'/status?token='+_0x3be662[_0x027a('0x59')],'notifyContentType':'application/json','callbackData':_0x3be662[_0x027a('0x20')]+';'+_0x593ad9['body']}]},'headers':{'Authorization':_0x027a('0x5a')+_0xc8024d[_0x027a('0x59')]},'json':!![]};return rp(_0x51ea01)[_0x027a('0x19')](function(_0x41debe){if(_0x41debe[_0x027a('0x4b')]){var _0x2857cc={'messageId':_0x41debe[_0x027a('0x4b')][0x0][_0x027a('0xd')]};if(!_0x3be662[_0x027a('0x4d')]){_0x2857cc['read']=!![];}return _0x1b4198[_0x027a('0x24')](_0x2857cc);}else{return logger[_0x027a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util[_0x027a('0x27')](_0x41debe,{'showHidden':![],'depth':null}));}});})[_0x027a('0x1a')](function(_0x22fb45){return logger[_0x027a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x027a('0x55'),util[_0x027a('0x27')](_0x22fb45,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x55'),_0x027a('0x5b'));}}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x55'),_0x027a('0x39'));}break;case'csc':var _0x237467=require(_0x027a('0x5c'));if(_0x3be662['apiKey']){var _0x2c4ae4={};_0x2c4ae4[_0x027a('0x5d')]=_0x3be662['username'];_0x2c4ae4[_0x027a('0x20')]=_0x593ad9[_0x027a('0x20')];_0x2c4ae4[_0x027a('0x5e')]=_0x3be662[_0x027a('0x20')];_0x2c4ae4['text']=_0x593ad9['body'];_0x2c4ae4[_0x027a('0x5f')]=+new Date();var _0x3154b8='';var _0x4eebc3='';var _0x2d3c99=Object['keys'](_0x2c4ae4);_0x2d3c99[_0x027a('0x60')]();for(var _0x460258=0x0;_0x460258<_0x2d3c99['length'];_0x460258++){if(_0x3154b8!=''){_0x3154b8+='&';}_0x3154b8+=_0x2d3c99[_0x460258]+'='+encodeURIComponent(_0x2c4ae4[_0x2d3c99[_0x460258]]);_0x4eebc3+=_0x2c4ae4[_0x2d3c99[_0x460258]];}_0x4eebc3+=_0x3be662[_0x027a('0x61')];_0x4eebc3=_0x237467['createHash']('md5')['update'](_0x4eebc3)[_0x027a('0x62')]('hex');if(_0x3154b8!==''){_0x3154b8+='&';}_0x3154b8+='signature='+_0x4eebc3;var _0x137a3f={'method':_0x027a('0x30'),'uri':_0x3be662['baseUrl']+_0x027a('0x63')+_0x3154b8,'json':!![]};return rp(_0x137a3f)['then'](function(_0x4417c7){var _0x17386a=Object[_0x027a('0x64')](_0x4417c7);if(_0x4417c7[_0x17386a[0x0]][_0x027a('0x1b')]&&parseInt(_0x4417c7[_0x17386a[0x0]][_0x027a('0x1b')])===0x0){var _0x30a687={'messageId':_0x4417c7[_0x17386a[0x0]][_0x027a('0x65')]};if(!_0x3be662[_0x027a('0x4d')]){_0x30a687[_0x027a('0x3d')]=!![];}return _0x1b4198[_0x027a('0x24')](_0x30a687);}else{return logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),'csc',util[_0x027a('0x27')](_0x4417c7[_0x027a('0x1b')],{'showHidden':![],'depth':null}));}})[_0x027a('0x1a')](function(_0x570acc){return logger[_0x027a('0x1b')](_0x027a('0x26'),'afterCreate',_0x027a('0x66'),util[_0x027a('0x27')](_0x570acc,{'showHidden':![],'depth':null}));});}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x66'),_0x027a('0x67'));}break;case _0x027a('0x68'):if(_0x3be662[_0x027a('0x61')]){var _0x4ebdc9={'method':_0x027a('0x33'),'uri':_0x027a('0x69'),'headers':{'Authorization':_0x3be662[_0x027a('0x61')]},'body':{'content':_0x593ad9[_0x027a('0xe')],'to':[_0x593ad9[_0x027a('0x20')]],'from':_0x3be662[_0x027a('0x20')],'binary':![],'clientMessageId':_0x027a('0x6a'),'charset':_0x027a('0x6b')},'json':!![]};rp(_0x4ebdc9)['then'](function(_0x411295){if(!_0x411295[_0x027a('0x1b')]){var _0x2dfe1f={'messageId':_0x411295[_0x027a('0x4b')][0x0]['apiMessageId']};if(!_0x3be662[_0x027a('0x4d')]){_0x2dfe1f[_0x027a('0x3d')]=!![];}return _0x1b4198[_0x027a('0x24')](_0x2dfe1f);}else{return logger[_0x027a('0x1b')](_0x027a('0x26'),'afterCreate',_0x027a('0x68'),util[_0x027a('0x27')](_0x411295[_0x027a('0x1b')],{'showHidden':![],'depth':null}));}})[_0x027a('0x1a')](function(_0x29b4ce){return logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),'clickatell',util['inspect'](_0x29b4ce,{'showHidden':![],'depth':null}));});}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x68'),_0x027a('0x67'));}break;case _0x027a('0x6c'):if(_0x3be662[_0x027a('0x2e')]&&_0x3be662['password']){var _0x1991be=util[_0x027a('0x42')]('%s:%s',_0x3be662[_0x027a('0x2e')],_0x3be662[_0x027a('0x2b')]);var _0x3bbf94={'method':_0x027a('0x33'),'uri':_0x027a('0x6d')+_0x3be662[_0x027a('0x6e')]+_0x027a('0x6f'),'body':{'to':[_0x593ad9[_0x027a('0x20')]],'text':_0x593ad9[_0x027a('0xe')],'from':_0x3be662['phone'],'applicationId':_0x3be662[_0x027a('0x70')]},'headers':{'Authorization':util[_0x027a('0x42')]('Basic\x20%s',new Buffer(_0x1991be)[_0x027a('0x46')](_0x027a('0x47')))},'json':!![]};rp(_0x3bbf94)[_0x027a('0x19')](function(_0x4e1e6a){if(_0x4e1e6a['id']){var _0x505956={'messageId':_0x4e1e6a['id']};return _0x1b4198[_0x027a('0x24')](_0x505956);}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),'bandwidth',util['inspect'](_0x4e1e6a,{'showHidden':![],'depth':null}));}})[_0x027a('0x1a')](function(_0x328cd8){logger[_0x027a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x027a('0x28'),'bandwidth',util[_0x027a('0x27')](_0x328cd8,{'showHidden':![],'depth':null}));});}else{logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x6c'),_0x027a('0x39'));}break;case _0x027a('0x71'):if(_0x3be662[_0x027a('0x61')]){var _0x47393b={};var _0x137a3f={'method':_0x027a('0x33'),'uri':_0x027a('0x72'),'headers':{'Authorization':_0x027a('0x73')+_0x3be662[_0x027a('0x61')],'Content-Type':_0x027a('0x74')},'body':{'from':_0x3be662['phone'],'to':_0x593ad9[_0x027a('0x20')],'text':_0x593ad9[_0x027a('0xe')]},'json':!![]};return rp(_0x137a3f)[_0x027a('0x19')](function(_0x41f147){if(_0x41f147[_0x027a('0x75')]==0xca){_0x47393b[_0x027a('0x76')]=_0x41f147;var _0xc262c7={'method':'POST','uri':_0x027a('0x77'),'headers':{'Authorization':_0x027a('0x73')+_0x3be662[_0x027a('0x61')],'Content-Type':'application/json'},'body':{'refid':_0x47393b[_0x027a('0x76')][_0x027a('0x78')]},'json':!![]};return rp(_0xc262c7)[_0x027a('0x19')](function(_0x3c6488){_0x47393b[_0x027a('0x79')]=_0x3c6488;var _0xc4b582={'messageId':_0x47393b['message'][_0x027a('0x78')],'read':!![]};return _0x1b4198[_0x027a('0x24')](_0xc4b582);});}else{return logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x71'),util[_0x027a('0x27')](_0x41f147,{'showHidden':![],'depth':null}));}})[_0x027a('0x1a')](function(_0x94a60){return logger[_0x027a('0x1b')](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x71'),util['inspect'](_0x94a60,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x027a('0x26'),_0x027a('0x28'),_0x027a('0x71'),_0x027a('0x7a'));}break;}}})[_0x027a('0x7b')](function(){_0x29aec0();});}else{_0x29aec0();}}},'charset':_0x027a('0x7c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index ce94b69..1397776 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 _0x1a15=['request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x8ae845,_0x4c01c7){var _0x2aa5f8=function(_0xab489f){while(--_0xab489f){_0x8ae845['push'](_0x8ae845['shift']());}};_0x2aa5f8(++_0x4c01c7);}(_0x1a15,0x103));var _0x51a1=function(_0x9b80ea,_0x1af636){_0x9b80ea=_0x9b80ea-0x0;var _0x3839d5=_0x1a15[_0x9b80ea];return _0x3839d5;};'use strict';var _=require(_0x51a1('0x0'));var util=require(_0x51a1('0x1'));var moment=require(_0x51a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x51a1('0x3'));var fs=require('fs');var Redis=require(_0x51a1('0x4'));var db=require(_0x51a1('0x5'))['db'];var utils=require(_0x51a1('0x6'));var logger=require(_0x51a1('0x7'))('rpc');var config=require(_0x51a1('0x8'));var jayson=require(_0x51a1('0x9'));var client=jayson[_0x51a1('0xa')]['http']({'port':0x232a});config[_0x51a1('0xb')]=_[_0x51a1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x51a1('0xd'))(new Redis(config[_0x51a1('0xb')]));require(_0x51a1('0xe'))[_0x51a1('0xf')](socket);function respondWithRpcPromise(_0x4e5c67,_0xe80c91,_0x5132ff){return new BPromise(function(_0x1ef9df,_0x2ba272){return client[_0x51a1('0x10')](_0x4e5c67,_0x5132ff)[_0x51a1('0x11')](function(_0x401ff9){logger[_0x51a1('0x12')](_0x51a1('0x13'),_0xe80c91,_0x51a1('0x14'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe80c91,_0x51a1('0x14'),JSON[_0x51a1('0x15')](_0x401ff9));if(_0x401ff9[_0x51a1('0x16')]){if(_0x401ff9[_0x51a1('0x16')][_0x51a1('0x17')]===0x1f4){logger['error'](_0x51a1('0x13'),_0xe80c91,_0x401ff9['error']['message']);return _0x2ba272(_0x401ff9[_0x51a1('0x16')][_0x51a1('0x18')]);}logger[_0x51a1('0x16')](_0x51a1('0x13'),_0xe80c91,_0x401ff9[_0x51a1('0x16')][_0x51a1('0x18')]);return _0x1ef9df(_0x401ff9[_0x51a1('0x16')][_0x51a1('0x18')]);}else{logger[_0x51a1('0x12')](_0x51a1('0x13'),_0xe80c91,_0x51a1('0x14'));_0x1ef9df(_0x401ff9[_0x51a1('0x19')][_0x51a1('0x18')]);}})[_0x51a1('0x1a')](function(_0xe25544){logger[_0x51a1('0x16')](_0x51a1('0x13'),_0xe80c91,_0xe25544);_0x2ba272(_0xe25544);});});}exports[_0x51a1('0x1b')]=function(_0x584809){var _0x1dbcec=this;return new Promise(function(_0x57d7fe,_0xd6117c){return db[_0x51a1('0x1c')]['create'](_0x584809[_0x51a1('0x1d')],{'raw':_0x584809[_0x51a1('0x1e')]?_0x584809['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x39bf5f){logger[_0x51a1('0x12')](_0x51a1('0x1b'),_0x584809);logger['debug'](_0x51a1('0x1b'),_0x584809,JSON[_0x51a1('0x15')](_0x39bf5f));_0x57d7fe(_0x39bf5f);})[_0x51a1('0x1a')](function(_0x165e25){logger[_0x51a1('0x16')](_0x51a1('0x1b'),_0x165e25[_0x51a1('0x18')],_0x584809);_0xd6117c(_0x1dbcec[_0x51a1('0x16')](0x1f4,_0x165e25['message']));});});}; \ No newline at end of file +var _0x3f87=['./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x46a5fa,_0x5d755a){var _0x5f5291=function(_0x36d09b){while(--_0x36d09b){_0x46a5fa['push'](_0x46a5fa['shift']());}};_0x5f5291(++_0x5d755a);}(_0x3f87,0x73));var _0x73f8=function(_0x111914,_0x2a83bc){_0x111914=_0x111914-0x0;var _0x576501=_0x3f87[_0x111914];return _0x576501;};'use strict';var _=require(_0x73f8('0x0'));var util=require(_0x73f8('0x1'));var moment=require(_0x73f8('0x2'));var BPromise=require(_0x73f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73f8('0x4'));var db=require(_0x73f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x73f8('0x6'));var config=require('../../config/environment');var jayson=require(_0x73f8('0x7'));var client=jayson[_0x73f8('0x8')][_0x73f8('0x9')]({'port':0x232a});config[_0x73f8('0xa')]=_[_0x73f8('0xb')](config[_0x73f8('0xa')],{'host':_0x73f8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73f8('0xa')]));require(_0x73f8('0xd'))[_0x73f8('0xe')](socket);function respondWithRpcPromise(_0x11f4d0,_0x7f7db5,_0x186058){return new BPromise(function(_0x271f4d,_0x44742f){return client[_0x73f8('0xf')](_0x11f4d0,_0x186058)[_0x73f8('0x10')](function(_0xd6c2dc){logger[_0x73f8('0x11')](_0x73f8('0x12'),_0x7f7db5,'request\x20sent');logger[_0x73f8('0x13')](_0x73f8('0x14'),_0x7f7db5,'request\x20sent',JSON['stringify'](_0xd6c2dc));if(_0xd6c2dc[_0x73f8('0x15')]){if(_0xd6c2dc[_0x73f8('0x15')][_0x73f8('0x16')]===0x1f4){logger[_0x73f8('0x15')](_0x73f8('0x12'),_0x7f7db5,_0xd6c2dc[_0x73f8('0x15')]['message']);return _0x44742f(_0xd6c2dc['error']['message']);}logger[_0x73f8('0x15')](_0x73f8('0x12'),_0x7f7db5,_0xd6c2dc[_0x73f8('0x15')][_0x73f8('0x17')]);return _0x271f4d(_0xd6c2dc[_0x73f8('0x15')]['message']);}else{logger[_0x73f8('0x11')](_0x73f8('0x12'),_0x7f7db5,'request\x20sent');_0x271f4d(_0xd6c2dc[_0x73f8('0x18')][_0x73f8('0x17')]);}})[_0x73f8('0x19')](function(_0x985a24){logger['error'](_0x73f8('0x12'),_0x7f7db5,_0x985a24);_0x44742f(_0x985a24);});});}exports[_0x73f8('0x1a')]=function(_0x4e80c6){var _0x5d323e=this;return new Promise(function(_0x1d8490,_0x5539ae){return db['SmsMessage'][_0x73f8('0x1b')](_0x4e80c6[_0x73f8('0x1c')],{'raw':_0x4e80c6[_0x73f8('0x1d')]?_0x4e80c6['options'][_0x73f8('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x4673d5){logger[_0x73f8('0x11')](_0x73f8('0x1a'),_0x4e80c6);logger[_0x73f8('0x13')]('CreateSmsMessage',_0x4e80c6,JSON[_0x73f8('0x1f')](_0x4673d5));_0x1d8490(_0x4673d5);})[_0x73f8('0x19')](function(_0x2f9bd6){logger[_0x73f8('0x15')](_0x73f8('0x1a'),_0x2f9bd6['message'],_0x4e80c6);_0x5539ae(_0x5d323e[_0x73f8('0x15')](0x1f4,_0x2f9bd6['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 3428161..beb1148 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 _0x7d97=['length','smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener','register'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0x7d97,0x161));var _0x77d9=function(_0x51223d,_0xbc5b82){_0x51223d=_0x51223d-0x0;var _0x417b92=_0x7d97[_0x51223d];return _0x417b92;};'use strict';var SmsMessageEvents=require(_0x77d9('0x0'));var events=[_0x77d9('0x1'),_0x77d9('0x2'),_0x77d9('0x3')];function createListener(_0x52f943,_0x52c704){return function(_0x2bbd47){_0x52c704[_0x77d9('0x4')](_0x52f943,_0x2bbd47);};}function removeListener(_0x355f11,_0x40d6bf){return function(){SmsMessageEvents[_0x77d9('0x5')](_0x355f11,_0x40d6bf);};}exports[_0x77d9('0x6')]=function(_0x456db5){for(var _0x5ac96e=0x0,_0x444843=events[_0x77d9('0x7')];_0x5ac96e<_0x444843;_0x5ac96e++){var _0x501aa2=events[_0x5ac96e];var _0x40fd83=createListener(_0x77d9('0x8')+_0x501aa2,_0x456db5);SmsMessageEvents['on'](_0x501aa2,_0x40fd83);}}; \ No newline at end of file +var _0x92ea=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','remove'];(function(_0x2c3872,_0x546554){var _0x173d19=function(_0x130339){while(--_0x130339){_0x2c3872['push'](_0x2c3872['shift']());}};_0x173d19(++_0x546554);}(_0x92ea,0x1c6));var _0xa92e=function(_0x3c45de,_0x1f0979){_0x3c45de=_0x3c45de-0x0;var _0x270350=_0x92ea[_0x3c45de];return _0x270350;};'use strict';var SmsMessageEvents=require(_0xa92e('0x0'));var events=['save',_0xa92e('0x1'),_0xa92e('0x2')];function createListener(_0x16bbc2,_0xc6f47e){return function(_0x15f10b){_0xc6f47e[_0xa92e('0x3')](_0x16bbc2,_0x15f10b);};}function removeListener(_0x4b9944,_0x27e7d9){return function(){SmsMessageEvents[_0xa92e('0x4')](_0x4b9944,_0x27e7d9);};}exports[_0xa92e('0x5')]=function(_0x3a9258){for(var _0x393a0d=0x0,_0x25bfbb=events[_0xa92e('0x6')];_0x393a0d<_0x25bfbb;_0x393a0d++){var _0x535bc7=events[_0x393a0d];var _0x535a3e=createListener(_0xa92e('0x7')+_0x535bc7,_0x3a9258);SmsMessageEvents['on'](_0x535bc7,_0x535a3e);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 466bab7..297de15 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 _0xe09d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path'];(function(_0x50340c,_0xb894b5){var _0x11b814=function(_0x320187){while(--_0x320187){_0x50340c['push'](_0x50340c['shift']());}};_0x11b814(++_0xb894b5);}(_0xe09d,0x14e));var _0xde09=function(_0x139011,_0x45e957){_0x139011=_0x139011-0x0;var _0x3fa96c=_0xe09d[_0x139011];return _0x3fa96c;};'use strict';var multer=require(_0xde09('0x0'));var util=require('util');var path=require(_0xde09('0x1'));var timeout=require(_0xde09('0x2'));var express=require(_0xde09('0x3'));var router=express[_0xde09('0x4')]();var fs_extra=require(_0xde09('0x5'));var auth=require(_0xde09('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xde09('0x7'));var controller=require(_0xde09('0x8'));router[_0xde09('0x9')]('/',auth[_0xde09('0xa')](),controller['index']);router[_0xde09('0x9')]('/describe',auth[_0xde09('0xa')](),controller['describe']);router['get'](_0xde09('0xb'),auth[_0xde09('0xa')](),controller['show']);router[_0xde09('0x9')](_0xde09('0xc'),auth[_0xde09('0xa')](),controller[_0xde09('0xd')]);router[_0xde09('0x9')](_0xde09('0xe'),auth[_0xde09('0xa')](),controller[_0xde09('0xf')]);router[_0xde09('0x9')](_0xde09('0x10'),auth[_0xde09('0xa')](),controller['getAgents']);router[_0xde09('0x11')]('/',auth[_0xde09('0xa')](),controller[_0xde09('0x12')]);router[_0xde09('0x11')](_0xde09('0xe'),auth[_0xde09('0xa')](),controller[_0xde09('0x13')]);router[_0xde09('0x11')](_0xde09('0x10'),auth[_0xde09('0xa')](),controller[_0xde09('0x14')]);router[_0xde09('0x15')]('/:id',auth[_0xde09('0xa')](),controller[_0xde09('0x16')]);router[_0xde09('0x17')](_0xde09('0xb'),auth[_0xde09('0xa')](),controller[_0xde09('0x18')]);router[_0xde09('0x17')](_0xde09('0xe'),auth[_0xde09('0xa')](),controller[_0xde09('0x19')]);router[_0xde09('0x17')]('/:id/users',auth[_0xde09('0xa')](),controller[_0xde09('0x1a')]);module[_0xde09('0x1b')]=router; \ No newline at end of file +var _0xf359=['isAuthenticated','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','/:id','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsQueue.controller','get','/describe'];(function(_0x16c083,_0x20476d){var _0x31c5e9=function(_0x541ce3){while(--_0x541ce3){_0x16c083['push'](_0x16c083['shift']());}};_0x31c5e9(++_0x20476d);}(_0xf359,0xe9));var _0x9f35=function(_0x5984a5,_0x487391){_0x5984a5=_0x5984a5-0x0;var _0x4e3e31=_0xf359[_0x5984a5];return _0x4e3e31;};'use strict';var multer=require(_0x9f35('0x0'));var util=require(_0x9f35('0x1'));var path=require('path');var timeout=require(_0x9f35('0x2'));var express=require(_0x9f35('0x3'));var router=express[_0x9f35('0x4')]();var fs_extra=require(_0x9f35('0x5'));var auth=require(_0x9f35('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f35('0x7'));router[_0x9f35('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9f35('0x9'),auth[_0x9f35('0xa')](),controller[_0x9f35('0xb')]);router[_0x9f35('0x8')]('/:id',auth[_0x9f35('0xa')](),controller['show']);router[_0x9f35('0x8')](_0x9f35('0xc'),auth[_0x9f35('0xa')](),controller[_0x9f35('0xd')]);router[_0x9f35('0x8')](_0x9f35('0xe'),auth[_0x9f35('0xa')](),controller[_0x9f35('0xf')]);router[_0x9f35('0x8')](_0x9f35('0x10'),auth[_0x9f35('0xa')](),controller[_0x9f35('0x11')]);router[_0x9f35('0x12')]('/',auth[_0x9f35('0xa')](),controller['create']);router[_0x9f35('0x12')]('/:id/teams',auth[_0x9f35('0xa')](),controller[_0x9f35('0x13')]);router['post'](_0x9f35('0x10'),auth[_0x9f35('0xa')](),controller['addAgents']);router[_0x9f35('0x14')](_0x9f35('0x15'),auth[_0x9f35('0xa')](),controller['update']);router['delete'](_0x9f35('0x15'),auth[_0x9f35('0xa')](),controller[_0x9f35('0x16')]);router[_0x9f35('0x17')](_0x9f35('0xe'),auth[_0x9f35('0xa')](),controller[_0x9f35('0x18')]);router[_0x9f35('0x17')]('/:id/users',auth[_0x9f35('0xa')](),controller[_0x9f35('0x19')]);module[_0x9f35('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 0d58779..d5e1006 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 _0x415b=['STRING','INTEGER','ENUM','beepall','exports'];(function(_0x10f843,_0x1f7da7){var _0x129fb9=function(_0x45ee40){while(--_0x45ee40){_0x10f843['push'](_0x10f843['shift']());}};_0x129fb9(++_0x1f7da7);}(_0x415b,0x9f));var _0xb415=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x415b[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module[_0xb415('0x0')]={'name':{'type':Sequelize[_0xb415('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb415('0x1')]},'timeout':{'type':Sequelize[_0xb415('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb415('0x3')]('rrmemory',_0xb415('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x67c6=['sequelize','exports','name','rrmemory','beepall','roundrobin'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x67c6,0x180));var _0x667c=function(_0x2e6dec,_0x436b65){_0x2e6dec=_0x2e6dec-0x0;var _0xed156=_0x67c6[_0x2e6dec];return _0xed156;};'use strict';var Sequelize=require(_0x667c('0x0'));module[_0x667c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x667c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x667c('0x3'),_0x667c('0x4'),_0x667c('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 4d7f0f0..44c3a3a 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 _0x241c=['fields','length','attributes','hasOwnProperty','sort','pick','where','VIRTUAL','filter','includeAll','findAll','rows','catch','show','keys','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','merge','User','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','nolimit','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','clone','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','spread','emit','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','get','SmsQueues','UserProfileResource','destroy','sendStatus','stack','name','map','SmsQueue','rawAttributes','type','key','model','query','filters','intersection'];(function(_0x45ede2,_0x1b419e){var _0x513193=function(_0x49bd68){while(--_0x49bd68){_0x45ede2['push'](_0x45ede2['shift']());}};_0x513193(++_0x1b419e);}(_0x241c,0xd8));var _0xc241=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x241c[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xc241('0x0'));var rimraf=require(_0xc241('0x1'));var zipdir=require(_0xc241('0x2'));var jsonpatch=require(_0xc241('0x3'));var rp=require(_0xc241('0x4'));var moment=require('moment');var BPromise=require(_0xc241('0x5'));var Mustache=require(_0xc241('0x6'));var util=require(_0xc241('0x7'));var path=require(_0xc241('0x8'));var sox=require(_0xc241('0x9'));var csv=require(_0xc241('0xa'));var ejs=require(_0xc241('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc241('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc241('0xa'));var querystring=require(_0xc241('0xd'));var Papa=require(_0xc241('0xe'));var Redis=require('ioredis');var authService=require(_0xc241('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc241('0x10'));var hardwareService=require(_0xc241('0x11'));var logger=require(_0xc241('0x12'))(_0xc241('0x13'));var utils=require(_0xc241('0x14'));var config=require(_0xc241('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc241('0x16'))['db'];config['redis']=_[_0xc241('0x17')](config[_0xc241('0x18')],{'host':_0xc241('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc241('0x18')]));require(_0xc241('0x1a'))[_0xc241('0x1b')](socket);function respondWithStatusCode(_0x42ee5b,_0x5df5d1){_0x5df5d1=_0x5df5d1||0xcc;return function(_0x397ff4){if(_0x397ff4){return _0x42ee5b['sendStatus'](_0x5df5d1);}return _0x42ee5b[_0xc241('0x1c')](_0x5df5d1)[_0xc241('0x1d')]();};}function respondWithResult(_0x149cce,_0x2d6e22){_0x2d6e22=_0x2d6e22||0xc8;return function(_0x52227f){if(_0x52227f){return _0x149cce['status'](_0x2d6e22)[_0xc241('0x1e')](_0x52227f);}};}function respondWithFilteredResult(_0x4783ff,_0x19b1e2){return function(_0x214532){if(_0x214532){var _0x1670d8=typeof _0x19b1e2[_0xc241('0x1f')]==='undefined'&&typeof _0x19b1e2[_0xc241('0x20')]===_0xc241('0x21');var _0x4afa2b=_0x214532[_0xc241('0x22')];var _0x126ee8=_0x1670d8?0x0:_0x19b1e2[_0xc241('0x1f')];var _0x2ed702=_0x1670d8?_0x214532['count']:_0x19b1e2['offset']+_0x19b1e2[_0xc241('0x20')];var _0x48dd3b;if(_0x2ed702>=_0x4afa2b){_0x2ed702=_0x4afa2b;_0x48dd3b=0xc8;}else{_0x48dd3b=0xce;}_0x4783ff[_0xc241('0x1c')](_0x48dd3b);return _0x4783ff[_0xc241('0x23')](_0xc241('0x24'),_0x126ee8+'-'+_0x2ed702+'/'+_0x4afa2b)[_0xc241('0x1e')](_0x214532);}return null;};}function patchUpdates(_0x43203d){return function(_0x597cb3){try{jsonpatch['apply'](_0x597cb3,_0x43203d,!![]);}catch(_0x29d8c9){return BPromise['reject'](_0x29d8c9);}return _0x597cb3[_0xc241('0x25')]();};}function saveUpdates(_0x38566a,_0x57c509){return function(_0xf05399){if(_0xf05399){return _0xf05399[_0xc241('0x26')](_0x38566a)[_0xc241('0x27')](function(_0x17ae5f){return _0x17ae5f;});}return null;};}function removeEntity(_0x2ad47c,_0x19bd55){return function(_0x2fcb46){if(_0x2fcb46){return _0x2fcb46['destroy']()['then'](function(){var _0x5946dc=_0x2fcb46[_0xc241('0x28')]({'plain':!![]});var _0x573587=_0xc241('0x29');return db[_0xc241('0x2a')][_0xc241('0x2b')]({'where':{'type':_0x573587,'resourceId':_0x5946dc['id']}})[_0xc241('0x27')](function(){return _0x2fcb46;});})[_0xc241('0x27')](function(){_0x2ad47c[_0xc241('0x1c')](0xcc)[_0xc241('0x1d')]();});}};}function handleEntityNotFound(_0x266e70,_0x35cfe3){return function(_0x50cd23){if(!_0x50cd23){_0x266e70[_0xc241('0x2c')](0x194);}return _0x50cd23;};}function handleError(_0x386b90,_0x34a355){_0x34a355=_0x34a355||0x1f4;return function(_0x54dd4e){logger['error'](_0x54dd4e[_0xc241('0x2d')]);if(_0x54dd4e['name']){delete _0x54dd4e[_0xc241('0x2e')];}_0x386b90['status'](_0x34a355)['send'](_0x54dd4e);};}exports['index']=function(_0x5ac91e,_0x5803d1){var _0x5cf2dc={},_0x1f551f={},_0x316506={'count':0x0,'rows':[]};var _0x54b254=_[_0xc241('0x2f')](db[_0xc241('0x30')][_0xc241('0x31')],function(_0x9384ce){return{'name':_0x9384ce['fieldName'],'type':_0x9384ce[_0xc241('0x32')][_0xc241('0x33')]};});_0x1f551f[_0xc241('0x34')]=_[_0xc241('0x2f')](_0x54b254,'name');_0x1f551f[_0xc241('0x35')]=_['keys'](_0x5ac91e[_0xc241('0x35')]);_0x1f551f[_0xc241('0x36')]=_[_0xc241('0x37')](_0x1f551f['model'],_0x1f551f[_0xc241('0x35')]);_0x5cf2dc['attributes']=_[_0xc241('0x37')](_0x1f551f[_0xc241('0x34')],qs['fields'](_0x5ac91e[_0xc241('0x35')][_0xc241('0x38')]));_0x5cf2dc['attributes']=_0x5cf2dc['attributes'][_0xc241('0x39')]?_0x5cf2dc[_0xc241('0x3a')]:_0x1f551f[_0xc241('0x34')];if(!_0x5ac91e[_0xc241('0x35')][_0xc241('0x3b')]('nolimit')){_0x5cf2dc[_0xc241('0x20')]=qs[_0xc241('0x20')](_0x5ac91e[_0xc241('0x35')][_0xc241('0x20')]);_0x5cf2dc[_0xc241('0x1f')]=qs[_0xc241('0x1f')](_0x5ac91e[_0xc241('0x35')][_0xc241('0x1f')]);}_0x5cf2dc['order']=qs[_0xc241('0x3c')](_0x5ac91e[_0xc241('0x35')][_0xc241('0x3c')]);_0x5cf2dc['where']=qs[_0xc241('0x36')](_[_0xc241('0x3d')](_0x5ac91e['query'],_0x1f551f[_0xc241('0x36')]),_0x54b254);if(_0x5ac91e['query']['filter']){_0x5cf2dc[_0xc241('0x3e')]=_['merge'](_0x5cf2dc[_0xc241('0x3e')],{'$or':_[_0xc241('0x2f')](_0x54b254,function(_0x132139){if(_0x132139[_0xc241('0x32')]!==_0xc241('0x3f')){var _0x47d28d={};_0x47d28d[_0x132139[_0xc241('0x2e')]]={'$like':'%'+_0x5ac91e[_0xc241('0x35')][_0xc241('0x40')]+'%'};return _0x47d28d;}})});}_0x5cf2dc=_['merge']({},_0x5cf2dc,_0x5ac91e['options']);var _0x2ec924={'where':_0x5cf2dc[_0xc241('0x3e')]};return db[_0xc241('0x30')][_0xc241('0x22')](_0x2ec924)[_0xc241('0x27')](function(_0x1ad318){_0x316506[_0xc241('0x22')]=_0x1ad318;if(_0x5ac91e[_0xc241('0x35')][_0xc241('0x41')]){_0x5cf2dc['include']=[{'all':!![]}];}return db[_0xc241('0x30')][_0xc241('0x42')](_0x5cf2dc);})[_0xc241('0x27')](function(_0x624cc8){_0x316506[_0xc241('0x43')]=_0x624cc8;return _0x316506;})[_0xc241('0x27')](respondWithFilteredResult(_0x5803d1,_0x5cf2dc))[_0xc241('0x44')](handleError(_0x5803d1,null));};exports[_0xc241('0x45')]=function(_0x25b9f3,_0x33e447){var _0x5323fa={'raw':!![],'where':{'id':_0x25b9f3['params']['id']}},_0x40c3d6={};_0x40c3d6['model']=_['keys'](db[_0xc241('0x30')][_0xc241('0x31')]);_0x40c3d6[_0xc241('0x35')]=_[_0xc241('0x46')](_0x25b9f3[_0xc241('0x35')]);_0x40c3d6[_0xc241('0x36')]=_['intersection'](_0x40c3d6[_0xc241('0x34')],_0x40c3d6[_0xc241('0x35')]);_0x5323fa['attributes']=_[_0xc241('0x37')](_0x40c3d6[_0xc241('0x34')],qs[_0xc241('0x38')](_0x25b9f3[_0xc241('0x35')][_0xc241('0x38')]));_0x5323fa['attributes']=_0x5323fa[_0xc241('0x3a')][_0xc241('0x39')]?_0x5323fa['attributes']:_0x40c3d6['model'];if(_0x25b9f3['query']['includeAll']){_0x5323fa[_0xc241('0x47')]=[{'all':!![]}];}_0x5323fa=_['merge']({},_0x5323fa,_0x25b9f3[_0xc241('0x48')]);return db[_0xc241('0x30')]['find'](_0x5323fa)[_0xc241('0x27')](handleEntityNotFound(_0x33e447,null))['then'](respondWithResult(_0x33e447,null))[_0xc241('0x44')](handleError(_0x33e447,null));};exports[_0xc241('0x49')]=function(_0xfcbcd,_0x2fff6d){return db[_0xc241('0x30')][_0xc241('0x49')](_0xfcbcd[_0xc241('0x4a')],{})['then'](function(_0x4bf9e4){var _0xe6e985=_0xfcbcd[_0xc241('0x4b')][_0xc241('0x28')]({'plain':!![]});if(!_0xe6e985)throw new Error(_0xc241('0x4c'));if(_0xe6e985['role']==='user'){var _0x3a4ba7=_0x4bf9e4[_0xc241('0x28')]({'plain':!![]});var _0x3dc797=_0xc241('0x29');return db['UserProfileSection'][_0xc241('0x4d')]({'where':{'name':_0x3dc797,'userProfileId':_0xe6e985[_0xc241('0x4e')]},'raw':!![]})['then'](function(_0x1a7ec9){if(_0x1a7ec9&&_0x1a7ec9['autoAssociation']===0x0){return db[_0xc241('0x2a')][_0xc241('0x49')]({'name':_0x3a4ba7['name'],'resourceId':_0x3a4ba7['id'],'type':_0x1a7ec9[_0xc241('0x2e')],'sectionId':_0x1a7ec9['id']},{})[_0xc241('0x27')](function(){return _0x4bf9e4;});}else{return _0x4bf9e4;}})['catch'](function(_0x14866d){logger['error'](_0xc241('0x4f'),_0x14866d);throw _0x14866d;});}return _0x4bf9e4;})['then'](respondWithResult(_0x2fff6d,0xc9))[_0xc241('0x44')](handleError(_0x2fff6d,null));};exports[_0xc241('0x26')]=function(_0x442ffb,_0x4bfe88){if(_0x442ffb[_0xc241('0x4a')]['id']){delete _0x442ffb[_0xc241('0x4a')]['id'];}return db[_0xc241('0x30')][_0xc241('0x4d')]({'where':{'id':_0x442ffb['params']['id']}})['then'](handleEntityNotFound(_0x4bfe88,null))[_0xc241('0x27')](saveUpdates(_0x442ffb['body'],null))['then'](respondWithResult(_0x4bfe88,null))['catch'](handleError(_0x4bfe88,null));};exports[_0xc241('0x2b')]=function(_0x1790c5,_0x1b59b8){return db[_0xc241('0x30')][_0xc241('0x4d')]({'where':{'id':_0x1790c5[_0xc241('0x50')]['id']}})[_0xc241('0x27')](handleEntityNotFound(_0x1b59b8,null))['then'](removeEntity(_0x1b59b8,null))[_0xc241('0x44')](handleError(_0x1b59b8,null));};exports[_0xc241('0x51')]=function(_0x2dae2d,_0x51db8e){return db['SmsQueue'][_0xc241('0x51')]()['then'](respondWithResult(_0x51db8e,null))[_0xc241('0x44')](handleError(_0x51db8e,null));};exports[_0xc241('0x52')]=function(_0x1222cb,_0x43ad17,_0x54d2d5){var _0x6fb773={'raw':!![],'where':{}},_0x435478={},_0x41eabc;return db[_0xc241('0x30')][_0xc241('0x53')]({'where':{'id':_0x1222cb[_0xc241('0x50')]['id']}})[_0xc241('0x27')](handleEntityNotFound(_0x43ad17,null))[_0xc241('0x27')](function(_0x36fef7){if(_0x36fef7){_0x41eabc=_0x36fef7[_0xc241('0x28')]({'plain':!![]});_0x435478[_0xc241('0x34')]=_[_0xc241('0x46')](db[_0xc241('0x54')]['rawAttributes']);_0x435478['query']=_[_0xc241('0x46')](_0x1222cb[_0xc241('0x35')]);_0x435478[_0xc241('0x36')]=_[_0xc241('0x37')](_0x435478[_0xc241('0x34')],_0x435478[_0xc241('0x35')]);_0x6fb773[_0xc241('0x3a')]=_[_0xc241('0x37')](_0x435478[_0xc241('0x34')],qs[_0xc241('0x38')](_0x1222cb[_0xc241('0x35')]['fields']));_0x6fb773[_0xc241('0x3a')]=_0x6fb773[_0xc241('0x3a')][_0xc241('0x39')]?_0x6fb773['attributes']:_0x435478[_0xc241('0x34')];if(!_0x1222cb[_0xc241('0x35')]['hasOwnProperty']('nolimit')){_0x6fb773[_0xc241('0x20')]=qs['limit'](_0x1222cb[_0xc241('0x35')]['limit']);_0x6fb773[_0xc241('0x1f')]=qs[_0xc241('0x1f')](_0x1222cb[_0xc241('0x35')][_0xc241('0x1f')]);}_0x6fb773[_0xc241('0x55')]=qs[_0xc241('0x3c')](_0x1222cb[_0xc241('0x35')][_0xc241('0x3c')]);_0x6fb773['where']=qs[_0xc241('0x36')](_[_0xc241('0x3d')](_0x1222cb['query'],_0x435478[_0xc241('0x36')]));_0x6fb773[_0xc241('0x3e')][_0xc241('0x56')]=_0x36fef7['id'];if(_0x1222cb[_0xc241('0x35')][_0xc241('0x40')]){_0x6fb773[_0xc241('0x3e')]=_[_0xc241('0x57')](_0x6fb773['where'],{'$or':_[_0xc241('0x2f')](_0x6fb773[_0xc241('0x3a')],function(_0x28d5ee){var _0x11335b={};_0x11335b[_0x28d5ee]={'$like':'%'+_0x1222cb[_0xc241('0x35')][_0xc241('0x40')]+'%'};return _0x11335b;})});}_0x6fb773=_[_0xc241('0x57')]({},_0x6fb773,_0x1222cb['options']);return db[_0xc241('0x54')][_0xc241('0x42')](_0x6fb773);}})[_0xc241('0x27')](function(_0x5d6a65){if(_0x5d6a65){return db[_0xc241('0x58')]['findAndCountAll']({'where':{'id':_[_0xc241('0x2f')](_0x5d6a65,_0xc241('0x59')),'role':_0xc241('0x5a')},'attributes':['id',_0xc241('0x2e'),_0xc241('0x5b'),_0xc241('0x5c'),_0xc241('0x5d')]});}})[_0xc241('0x27')](function(_0x130696){if(_0x130696){return{'count':_0x130696['count'],'rows':_[_0xc241('0x2f')](_0x130696[_0xc241('0x43')],function(_0x376334){return{'membername':_0x376334[_0xc241('0x2e')],'UserId':_0x376334['id'],'queue_name':_0x41eabc[_0xc241('0x2e')],'SmsQueueId':_0x41eabc['id'],'interface':util['format'](_0xc241('0x5e'),_0xc241('0x5f'),_0x376334['name']),'penalty':0x0,'paused':_0x376334[_0xc241('0x5b')],'createdAt':_0x376334[_0xc241('0x5d')],'updatedAt':_0x376334[_0xc241('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x43ad17,_0x6fb773))[_0xc241('0x44')](handleError(_0x43ad17,null));};exports[_0xc241('0x60')]=function(_0x6df393,_0x16ac4e,_0x323958){var _0x82ea27={};var _0x532e71={};var _0x51cada;var _0x3017f6;return db[_0xc241('0x30')][_0xc241('0x53')]({'where':{'id':_0x6df393[_0xc241('0x50')]['id']}})['then'](handleEntityNotFound(_0x16ac4e,null))[_0xc241('0x27')](function(_0x455297){if(_0x455297){_0x51cada=_0x455297;_0x532e71[_0xc241('0x34')]=_[_0xc241('0x46')](db[_0xc241('0x61')][_0xc241('0x31')]);_0x532e71['query']=_[_0xc241('0x46')](_0x6df393[_0xc241('0x35')]);_0x532e71[_0xc241('0x36')]=_['intersection'](_0x532e71[_0xc241('0x34')],_0x532e71['query']);_0x82ea27[_0xc241('0x3a')]=_['intersection'](_0x532e71[_0xc241('0x34')],qs['fields'](_0x6df393[_0xc241('0x35')][_0xc241('0x38')]));_0x82ea27['attributes']=_0x82ea27[_0xc241('0x3a')][_0xc241('0x39')]?_0x82ea27[_0xc241('0x3a')]:_0x532e71[_0xc241('0x34')];_0x82ea27[_0xc241('0x55')]=qs[_0xc241('0x3c')](_0x6df393[_0xc241('0x35')][_0xc241('0x3c')]);_0x82ea27['where']=qs['filters'](_[_0xc241('0x3d')](_0x6df393[_0xc241('0x35')],_0x532e71[_0xc241('0x36')]));if(_0x6df393[_0xc241('0x35')]['filter']){_0x82ea27[_0xc241('0x3e')]=_[_0xc241('0x57')](_0x82ea27[_0xc241('0x3e')],{'$or':_[_0xc241('0x2f')](_0x82ea27['attributes'],function(_0x33d3c4){var _0x345d53={};_0x345d53[_0x33d3c4]={'$like':'%'+_0x6df393[_0xc241('0x35')]['filter']+'%'};return _0x345d53;})});}_0x82ea27=_['merge']({},_0x82ea27,_0x6df393[_0xc241('0x48')]);return _0x51cada['getTeams'](_0x82ea27);}})['then'](function(_0x5962b8){if(_0x5962b8){_0x3017f6=_0x5962b8[_0xc241('0x39')];if(!_0x6df393[_0xc241('0x35')]['hasOwnProperty'](_0xc241('0x62'))){_0x82ea27[_0xc241('0x20')]=qs['limit'](_0x6df393['query'][_0xc241('0x20')]);_0x82ea27[_0xc241('0x1f')]=qs[_0xc241('0x1f')](_0x6df393[_0xc241('0x35')]['offset']);}return _0x51cada[_0xc241('0x60')](_0x82ea27);}})[_0xc241('0x27')](function(_0x1b423a){if(_0x1b423a){return _0x1b423a?{'count':_0x3017f6,'rows':_0x1b423a}:null;}})[_0xc241('0x27')](respondWithResult(_0x16ac4e,null))[_0xc241('0x44')](handleError(_0x16ac4e,null));};exports['addTeams']=function(_0x78e76c,_0x16f4d2,_0xe3d3bb){var _0x125f6c=_0x78e76c['body'][_0xc241('0x63')];return db[_0xc241('0x61')][_0xc241('0x42')]({'where':{'id':_0x125f6c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc241('0x64'),'attributes':['id','name',_0xc241('0x65'),_0xc241('0x66'),_0xc241('0x67')],'raw':!![]}]})[_0xc241('0x27')](function(_0x28a501){if(_0x28a501){var _0x1e3180=_[_0xc241('0x68')](_0x28a501,function(_0x1e6bab){var _0x808aa6=_0x1e6bab[_0xc241('0x28')]({'plain':!![]});return _0x808aa6['Agents'];});return db['SmsQueue'][_0xc241('0x4d')]({'where':{'id':_0x78e76c[_0xc241('0x50')]['id']}})[_0xc241('0x27')](function(_0x2e1b1d){return db[_0xc241('0x69')][_0xc241('0x6a')](function(_0x218f8c){return _0x2e1b1d[_0xc241('0x6b')](_0x125f6c,{'transaction':_0x218f8c})[_0xc241('0x27')](function(){return BPromise['each'](_0x1e3180,function(_0x15bbb2){return db['UserSmsQueue'][_0xc241('0x6c')]({'where':{'UserId':_0x15bbb2['id'],'SmsQueueId':_0x78e76c[_0xc241('0x50')]['id']},'transaction':_0x218f8c});});})[_0xc241('0x27')](function(){_0x1e3180[_0xc241('0x6d')](function(_0x5673e5){socket['emit'](_0xc241('0x6e'),{'UserId':_0x5673e5['id'],'SmsQueueId':_0x2e1b1d['id']});});});});});}})[_0xc241('0x27')](respondWithStatusCode(_0x16f4d2,null))[_0xc241('0x44')](handleError(_0x16f4d2,null));};exports['removeTeams']=function(_0x8cb715,_0x1729c3,_0x3c59b2){return db[_0xc241('0x61')][_0xc241('0x42')]({'where':{'id':_0x8cb715[_0xc241('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc241('0x58')],'as':_0xc241('0x64'),'attributes':['id'],'raw':!![]}]})[_0xc241('0x27')](handleEntityNotFound(_0x1729c3,null))[_0xc241('0x27')](function(_0x4c1292){var _0x2bac53=_[_0xc241('0x2f')](_0x4c1292,'id');var _0x4936db=[];var _0x5dd011=[];var _0x3ec756=squel[_0xc241('0x6f')]();_0x3ec756[_0xc241('0x70')](_0xc241('0x71'))[_0xc241('0x72')](_0xc241('0x73'),'tq')['join'](_0xc241('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc241('0x3e')]('SmsQueueId\x20=\x20?',_0x8cb715[_0xc241('0x50')]['id']);for(var _0x3b3f10=0x0;_0x3b3f10<_0x4c1292['length'];_0x3b3f10+=0x1){let _0x82d13e=_0x4c1292[_0x3b3f10];for(var _0x7258a3=0x0;_0x7258a3<_0x82d13e['Agents']['length'];_0x7258a3+=0x1){let _0x4641c9=_0x82d13e['Agents'][_0x7258a3];var _0x11f3f2=_0x3ec756[_0xc241('0x75')]();_0x11f3f2[_0xc241('0x3e')]('ut.UserId\x20=\x20?',_0x4641c9['id']);_0x5dd011[_0xc241('0x76')](db['sequelize']['query'](_0x11f3f2[_0xc241('0x77')](),{'type':db['sequelize'][_0xc241('0x78')][_0xc241('0x79')]})[_0xc241('0x27')](function(_0xcf5138){if(_0xcf5138[_0xc241('0x39')]===0x1){return _0x4641c9['id'];}else{var _0x175694=_[_0xc241('0x7a')](_[_0xc241('0x2f')](_0xcf5138,'TeamId'),function(_0x48345f){return _[_0xc241('0x7b')](_0x2bac53,_0x48345f);});if(_0x175694){return _0x4641c9['id'];}}}));}}return BPromise['all'](_0x5dd011)['then'](function(_0x73f1f3){_0x4936db=_(_0x4936db)[_0xc241('0x7c')](_0x73f1f3)[_0xc241('0x7d')]()[_0xc241('0x7e')]();return db['SmsQueue'][_0xc241('0x4d')]({'where':{'id':_0x8cb715[_0xc241('0x50')]['id']}})[_0xc241('0x27')](function(_0x15844e){return db[_0xc241('0x69')][_0xc241('0x6a')](function(_0x38d2fe){return _0x15844e[_0xc241('0x7f')](_0x8cb715[_0xc241('0x35')]['ids'],{'transaction':_0x38d2fe})[_0xc241('0x27')](function(){if(!_[_0xc241('0x80')](_0x4936db)){return _0x15844e[_0xc241('0x81')](_0x4936db,{'transaction':_0x38d2fe});}})[_0xc241('0x27')](function(){_0x4936db[_0xc241('0x6d')](function(_0x55a5e0){socket['emit']('userSmsQueue:remove',{'UserId':_0x55a5e0,'SmsQueueId':_0x15844e['id']});});});});});});})[_0xc241('0x27')](respondWithStatusCode(_0x1729c3,null))[_0xc241('0x44')](handleError(_0x1729c3,null));};exports[_0xc241('0x82')]=function(_0x19198e,_0x1976dd,_0x3af2b5){return db[_0xc241('0x30')][_0xc241('0x4d')]({'where':{'id':_0x19198e[_0xc241('0x50')]['id']}})[_0xc241('0x27')](handleEntityNotFound(_0x1976dd,null))[_0xc241('0x27')](function(_0x3730cc){if(_0x3730cc){return _0x3730cc[_0xc241('0x82')](_0x19198e['body'][_0xc241('0x63')],_['omit'](_0x19198e['body'],[_0xc241('0x63'),'id'])||{})[_0xc241('0x83')](function(_0x2bad05){for(var _0x3b5efd=0x0;_0x3b5efd<_0x19198e[_0xc241('0x4a')][_0xc241('0x63')][_0xc241('0x39')];_0x3b5efd+=0x1){socket[_0xc241('0x84')](_0xc241('0x6e'),{'UserId':Number(_0x19198e[_0xc241('0x4a')][_0xc241('0x63')][_0x3b5efd]),'SmsQueueId':Number(_0x19198e['params']['id'])});}return _0x2bad05;});}})['then'](respondWithResult(_0x1976dd,null))[_0xc241('0x44')](handleError(_0x1976dd,null));};exports['removeAgents']=function(_0x340bc4,_0x32d54f,_0x16a3dd){return db['SmsQueue']['find']({'where':{'id':_0x340bc4['params']['id']}})[_0xc241('0x27')](handleEntityNotFound(_0x32d54f,null))[_0xc241('0x27')](function(_0x28aafe){if(_0x28aafe){return _0x28aafe[_0xc241('0x81')](_0x340bc4[_0xc241('0x35')]['ids'])['then'](function(){if(_[_0xc241('0x85')](_0x340bc4['query'][_0xc241('0x63')])){for(var _0x3038d4=0x0;_0x3038d4<_0x340bc4['query'][_0xc241('0x63')][_0xc241('0x39')];_0x3038d4+=0x1){socket[_0xc241('0x84')](_0xc241('0x86'),{'UserId':Number(_0x340bc4[_0xc241('0x35')][_0xc241('0x63')][_0x3038d4]),'SmsQueueId':Number(_0x340bc4[_0xc241('0x50')]['id'])});}}else{socket[_0xc241('0x84')](_0xc241('0x86'),{'UserId':Number(_0x340bc4['query'][_0xc241('0x63')]),'SmsQueueId':Number(_0x340bc4[_0xc241('0x50')]['id'])});}});}})[_0xc241('0x27')](respondWithStatusCode(_0x32d54f,null))['catch'](handleError(_0x32d54f,null));};exports['getAgents']=function(_0x2cc96c,_0x335bdf,_0x222c7a){var _0x1effe8={};var _0xd43263={};var _0x143132;var _0x71c8ec;return db['SmsQueue'][_0xc241('0x53')]({'where':{'id':_0x2cc96c[_0xc241('0x50')]['id']}})[_0xc241('0x27')](handleEntityNotFound(_0x335bdf,null))[_0xc241('0x27')](function(_0x4dd7ca){if(_0x4dd7ca){_0x143132=_0x4dd7ca;_0xd43263[_0xc241('0x34')]=_[_0xc241('0x46')](db[_0xc241('0x58')][_0xc241('0x31')]);_0xd43263['query']=_[_0xc241('0x46')](_0x2cc96c[_0xc241('0x35')]);_0xd43263['filters']=_[_0xc241('0x37')](_0xd43263[_0xc241('0x34')],_0xd43263[_0xc241('0x35')]);_0x1effe8['attributes']=_[_0xc241('0x37')](_0xd43263[_0xc241('0x34')],qs['fields'](_0x2cc96c['query']['fields']));_0x1effe8[_0xc241('0x3a')]=_0x1effe8[_0xc241('0x3a')][_0xc241('0x39')]?_0x1effe8[_0xc241('0x3a')]:_0xd43263['model'];_0x1effe8[_0xc241('0x55')]=qs[_0xc241('0x3c')](_0x2cc96c[_0xc241('0x35')][_0xc241('0x3c')]);_0x1effe8[_0xc241('0x3e')]=qs[_0xc241('0x36')](_['pick'](_0x2cc96c[_0xc241('0x35')],_0xd43263[_0xc241('0x36')]));if(_0x2cc96c[_0xc241('0x35')][_0xc241('0x40')]){_0x1effe8['where']=_[_0xc241('0x57')](_0x1effe8[_0xc241('0x3e')],{'$or':_[_0xc241('0x2f')](_0x1effe8[_0xc241('0x3a')],function(_0x5b656b){var _0x540a47={};_0x540a47[_0x5b656b]={'$like':'%'+_0x2cc96c[_0xc241('0x35')]['filter']+'%'};return _0x540a47;})});}_0x1effe8=_[_0xc241('0x57')]({},_0x1effe8,_0x2cc96c['options']);return _0x143132[_0xc241('0x87')](_0x1effe8);}})[_0xc241('0x27')](function(_0x57831b){if(_0x57831b){_0x71c8ec=_0x57831b[_0xc241('0x39')];if(!_0x2cc96c['query'][_0xc241('0x3b')]('nolimit')){_0x1effe8[_0xc241('0x20')]=qs[_0xc241('0x20')](_0x2cc96c[_0xc241('0x35')][_0xc241('0x20')]);_0x1effe8['offset']=qs[_0xc241('0x1f')](_0x2cc96c[_0xc241('0x35')][_0xc241('0x1f')]);}return _0x143132[_0xc241('0x87')](_0x1effe8);}})[_0xc241('0x27')](function(_0x367928){if(_0x367928){return _0x367928?{'count':_0x71c8ec,'rows':_0x367928}:null;}})['then'](respondWithResult(_0x335bdf,null))[_0xc241('0x44')](handleError(_0x335bdf,null));}; \ No newline at end of file +var _0x0f97=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','index','map','SmsQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','describe','findOne','UserSmsQueue','options','User','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','Team','Agents','online','voicePause','interface','sequelize','each','findOrCreate','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','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','transaction','removeAgents','forEach','userSmsQueue:remove','addAgents','spread','getAgents','nolimit','eml-format','rimraf'];(function(_0x4b2617,_0x1bb529){var _0x31ac19=function(_0x31e145){while(--_0x31e145){_0x4b2617['push'](_0x4b2617['shift']());}};_0x31ac19(++_0x1bb529);}(_0x0f97,0x196));var _0x70f9=function(_0x5f50b5,_0xa8db83){_0x5f50b5=_0x5f50b5-0x0;var _0x54c383=_0x0f97[_0x5f50b5];return _0x54c383;};'use strict';var emlformat=require(_0x70f9('0x0'));var rimraf=require(_0x70f9('0x1'));var zipdir=require(_0x70f9('0x2'));var jsonpatch=require(_0x70f9('0x3'));var rp=require(_0x70f9('0x4'));var moment=require(_0x70f9('0x5'));var BPromise=require(_0x70f9('0x6'));var Mustache=require(_0x70f9('0x7'));var util=require(_0x70f9('0x8'));var path=require(_0x70f9('0x9'));var sox=require(_0x70f9('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70f9('0xb'));var _=require(_0x70f9('0xc'));var squel=require(_0x70f9('0xd'));var crypto=require(_0x70f9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x70f9('0xf'));var querystring=require(_0x70f9('0x10'));var Papa=require(_0x70f9('0x11'));var Redis=require(_0x70f9('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x70f9('0x13'))(_0x70f9('0x14'));var utils=require(_0x70f9('0x15'));var config=require(_0x70f9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x70f9('0x17'))['db'];config[_0x70f9('0x18')]=_[_0x70f9('0x19')](config[_0x70f9('0x18')],{'host':_0x70f9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70f9('0x18')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x4879b4,_0x4f1ba0){_0x4f1ba0=_0x4f1ba0||0xcc;return function(_0x30b651){if(_0x30b651){return _0x4879b4['sendStatus'](_0x4f1ba0);}return _0x4879b4[_0x70f9('0x1b')](_0x4f1ba0)[_0x70f9('0x1c')]();};}function respondWithResult(_0x138a8e,_0x3ce5ed){_0x3ce5ed=_0x3ce5ed||0xc8;return function(_0x25b88f){if(_0x25b88f){return _0x138a8e[_0x70f9('0x1b')](_0x3ce5ed)[_0x70f9('0x1d')](_0x25b88f);}};}function respondWithFilteredResult(_0x344590,_0x3a21d9){return function(_0x4b6e93){if(_0x4b6e93){var _0x59d036=typeof _0x3a21d9[_0x70f9('0x1e')]==='undefined'&&typeof _0x3a21d9[_0x70f9('0x1f')]===_0x70f9('0x20');var _0x1cc58c=_0x4b6e93[_0x70f9('0x21')];var _0x4e7cce=_0x59d036?0x0:_0x3a21d9['offset'];var _0x14de5c=_0x59d036?_0x4b6e93[_0x70f9('0x21')]:_0x3a21d9[_0x70f9('0x1e')]+_0x3a21d9[_0x70f9('0x1f')];var _0x4b87c8;if(_0x14de5c>=_0x1cc58c){_0x14de5c=_0x1cc58c;_0x4b87c8=0xc8;}else{_0x4b87c8=0xce;}_0x344590[_0x70f9('0x1b')](_0x4b87c8);return _0x344590['set'](_0x70f9('0x22'),_0x4e7cce+'-'+_0x14de5c+'/'+_0x1cc58c)[_0x70f9('0x1d')](_0x4b6e93);}return null;};}function patchUpdates(_0x3ce965){return function(_0x334fdc){try{jsonpatch[_0x70f9('0x23')](_0x334fdc,_0x3ce965,!![]);}catch(_0x4ae0c9){return BPromise[_0x70f9('0x24')](_0x4ae0c9);}return _0x334fdc[_0x70f9('0x25')]();};}function saveUpdates(_0x388f13,_0x5d5372){return function(_0x47057b){if(_0x47057b){return _0x47057b[_0x70f9('0x26')](_0x388f13)[_0x70f9('0x27')](function(_0x3c3051){return _0x3c3051;});}return null;};}function removeEntity(_0x2a9c4b,_0x49337a){return function(_0x3a8209){if(_0x3a8209){return _0x3a8209[_0x70f9('0x28')]()[_0x70f9('0x27')](function(){var _0x386ded=_0x3a8209[_0x70f9('0x29')]({'plain':!![]});var _0xfe324e='SmsQueues';return db[_0x70f9('0x2a')][_0x70f9('0x28')]({'where':{'type':_0xfe324e,'resourceId':_0x386ded['id']}})[_0x70f9('0x27')](function(){return _0x3a8209;});})[_0x70f9('0x27')](function(){_0x2a9c4b[_0x70f9('0x1b')](0xcc)[_0x70f9('0x1c')]();});}};}function handleEntityNotFound(_0x3e29b9,_0x28a8c6){return function(_0x562b72){if(!_0x562b72){_0x3e29b9['sendStatus'](0x194);}return _0x562b72;};}function handleError(_0xd56d2d,_0x428646){_0x428646=_0x428646||0x1f4;return function(_0x2f805a){logger['error'](_0x2f805a['stack']);if(_0x2f805a[_0x70f9('0x2b')]){delete _0x2f805a[_0x70f9('0x2b')];}_0xd56d2d['status'](_0x428646)['send'](_0x2f805a);};}exports[_0x70f9('0x2c')]=function(_0x17cf3f,_0x4c4a14){var _0x2a8cc9={},_0x227845={},_0x47a7d7={'count':0x0,'rows':[]};var _0x8bc855=_[_0x70f9('0x2d')](db[_0x70f9('0x2e')]['rawAttributes'],function(_0xa93f4a){return{'name':_0xa93f4a[_0x70f9('0x2f')],'type':_0xa93f4a['type'][_0x70f9('0x30')]};});_0x227845[_0x70f9('0x31')]=_['map'](_0x8bc855,_0x70f9('0x2b'));_0x227845[_0x70f9('0x32')]=_[_0x70f9('0x33')](_0x17cf3f[_0x70f9('0x32')]);_0x227845[_0x70f9('0x34')]=_[_0x70f9('0x35')](_0x227845[_0x70f9('0x31')],_0x227845['query']);_0x2a8cc9[_0x70f9('0x36')]=_[_0x70f9('0x35')](_0x227845[_0x70f9('0x31')],qs[_0x70f9('0x37')](_0x17cf3f[_0x70f9('0x32')][_0x70f9('0x37')]));_0x2a8cc9['attributes']=_0x2a8cc9[_0x70f9('0x36')][_0x70f9('0x38')]?_0x2a8cc9['attributes']:_0x227845[_0x70f9('0x31')];if(!_0x17cf3f['query'][_0x70f9('0x39')]('nolimit')){_0x2a8cc9[_0x70f9('0x1f')]=qs[_0x70f9('0x1f')](_0x17cf3f[_0x70f9('0x32')][_0x70f9('0x1f')]);_0x2a8cc9[_0x70f9('0x1e')]=qs[_0x70f9('0x1e')](_0x17cf3f[_0x70f9('0x32')][_0x70f9('0x1e')]);}_0x2a8cc9[_0x70f9('0x3a')]=qs[_0x70f9('0x3b')](_0x17cf3f['query'][_0x70f9('0x3b')]);_0x2a8cc9[_0x70f9('0x3c')]=qs[_0x70f9('0x34')](_[_0x70f9('0x3d')](_0x17cf3f[_0x70f9('0x32')],_0x227845[_0x70f9('0x34')]),_0x8bc855);if(_0x17cf3f['query'][_0x70f9('0x3e')]){_0x2a8cc9[_0x70f9('0x3c')]=_[_0x70f9('0x3f')](_0x2a8cc9[_0x70f9('0x3c')],{'$or':_[_0x70f9('0x2d')](_0x8bc855,function(_0x4e75c5){if(_0x4e75c5[_0x70f9('0x40')]!=='VIRTUAL'){var _0x8ca1a6={};_0x8ca1a6[_0x4e75c5['name']]={'$like':'%'+_0x17cf3f[_0x70f9('0x32')]['filter']+'%'};return _0x8ca1a6;}})});}_0x2a8cc9=_[_0x70f9('0x3f')]({},_0x2a8cc9,_0x17cf3f['options']);var _0x5e1292={'where':_0x2a8cc9[_0x70f9('0x3c')]};return db['SmsQueue'][_0x70f9('0x21')](_0x5e1292)['then'](function(_0x70e4a7){_0x47a7d7[_0x70f9('0x21')]=_0x70e4a7;if(_0x17cf3f[_0x70f9('0x32')]['includeAll']){_0x2a8cc9['include']=[{'all':!![]}];}return db[_0x70f9('0x2e')][_0x70f9('0x41')](_0x2a8cc9);})['then'](function(_0x29d827){_0x47a7d7[_0x70f9('0x42')]=_0x29d827;return _0x47a7d7;})[_0x70f9('0x27')](respondWithFilteredResult(_0x4c4a14,_0x2a8cc9))[_0x70f9('0x43')](handleError(_0x4c4a14,null));};exports[_0x70f9('0x44')]=function(_0x69485a,_0x1e4008){var _0x49d466={'raw':!![],'where':{'id':_0x69485a[_0x70f9('0x45')]['id']}},_0x49a7af={};_0x49a7af[_0x70f9('0x31')]=_[_0x70f9('0x33')](db['SmsQueue'][_0x70f9('0x46')]);_0x49a7af[_0x70f9('0x32')]=_[_0x70f9('0x33')](_0x69485a[_0x70f9('0x32')]);_0x49a7af[_0x70f9('0x34')]=_[_0x70f9('0x35')](_0x49a7af['model'],_0x49a7af[_0x70f9('0x32')]);_0x49d466[_0x70f9('0x36')]=_[_0x70f9('0x35')](_0x49a7af[_0x70f9('0x31')],qs['fields'](_0x69485a[_0x70f9('0x32')]['fields']));_0x49d466[_0x70f9('0x36')]=_0x49d466['attributes'][_0x70f9('0x38')]?_0x49d466[_0x70f9('0x36')]:_0x49a7af[_0x70f9('0x31')];if(_0x69485a[_0x70f9('0x32')][_0x70f9('0x47')]){_0x49d466['include']=[{'all':!![]}];}_0x49d466=_[_0x70f9('0x3f')]({},_0x49d466,_0x69485a['options']);return db[_0x70f9('0x2e')][_0x70f9('0x48')](_0x49d466)[_0x70f9('0x27')](handleEntityNotFound(_0x1e4008,null))[_0x70f9('0x27')](respondWithResult(_0x1e4008,null))[_0x70f9('0x43')](handleError(_0x1e4008,null));};exports['create']=function(_0x8bc338,_0x580ac4){return db['SmsQueue'][_0x70f9('0x49')](_0x8bc338[_0x70f9('0x4a')],{})['then'](function(_0x128bb6){var _0x175083=_0x8bc338[_0x70f9('0x4b')][_0x70f9('0x29')]({'plain':!![]});if(!_0x175083)throw new Error(_0x70f9('0x4c'));if(_0x175083[_0x70f9('0x4d')]===_0x70f9('0x4b')){var _0x344f7c=_0x128bb6[_0x70f9('0x29')]({'plain':!![]});var _0x1adb3d='SmsQueues';return db[_0x70f9('0x4e')][_0x70f9('0x48')]({'where':{'name':_0x1adb3d,'userProfileId':_0x175083['userProfileId']},'raw':!![]})[_0x70f9('0x27')](function(_0x28b50e){if(_0x28b50e&&_0x28b50e[_0x70f9('0x4f')]===0x0){return db[_0x70f9('0x2a')]['create']({'name':_0x344f7c[_0x70f9('0x2b')],'resourceId':_0x344f7c['id'],'type':_0x28b50e['name'],'sectionId':_0x28b50e['id']},{})[_0x70f9('0x27')](function(){return _0x128bb6;});}else{return _0x128bb6;}})[_0x70f9('0x43')](function(_0x2825cd){logger[_0x70f9('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2825cd);throw _0x2825cd;});}return _0x128bb6;})['then'](respondWithResult(_0x580ac4,0xc9))[_0x70f9('0x43')](handleError(_0x580ac4,null));};exports['update']=function(_0xab9755,_0xeab778){if(_0xab9755[_0x70f9('0x4a')]['id']){delete _0xab9755['body']['id'];}return db[_0x70f9('0x2e')][_0x70f9('0x48')]({'where':{'id':_0xab9755[_0x70f9('0x45')]['id']}})[_0x70f9('0x27')](handleEntityNotFound(_0xeab778,null))[_0x70f9('0x27')](saveUpdates(_0xab9755[_0x70f9('0x4a')],null))[_0x70f9('0x27')](respondWithResult(_0xeab778,null))[_0x70f9('0x43')](handleError(_0xeab778,null));};exports[_0x70f9('0x28')]=function(_0x2c2dd5,_0x1f7197){return db[_0x70f9('0x2e')]['find']({'where':{'id':_0x2c2dd5[_0x70f9('0x45')]['id']}})[_0x70f9('0x27')](handleEntityNotFound(_0x1f7197,null))['then'](removeEntity(_0x1f7197,null))[_0x70f9('0x43')](handleError(_0x1f7197,null));};exports[_0x70f9('0x51')]=function(_0x372cc6,_0x237ccb){return db['SmsQueue'][_0x70f9('0x51')]()['then'](respondWithResult(_0x237ccb,null))['catch'](handleError(_0x237ccb,null));};exports['getMembers']=function(_0x1681b2,_0x4ac43f,_0x465521){var _0x27eb58={'raw':!![],'where':{}},_0xc1f296={},_0x487b25;return db[_0x70f9('0x2e')][_0x70f9('0x52')]({'where':{'id':_0x1681b2[_0x70f9('0x45')]['id']}})[_0x70f9('0x27')](handleEntityNotFound(_0x4ac43f,null))[_0x70f9('0x27')](function(_0x389b83){if(_0x389b83){_0x487b25=_0x389b83[_0x70f9('0x29')]({'plain':!![]});_0xc1f296['model']=_[_0x70f9('0x33')](db[_0x70f9('0x53')][_0x70f9('0x46')]);_0xc1f296[_0x70f9('0x32')]=_[_0x70f9('0x33')](_0x1681b2['query']);_0xc1f296[_0x70f9('0x34')]=_[_0x70f9('0x35')](_0xc1f296[_0x70f9('0x31')],_0xc1f296['query']);_0x27eb58[_0x70f9('0x36')]=_[_0x70f9('0x35')](_0xc1f296[_0x70f9('0x31')],qs[_0x70f9('0x37')](_0x1681b2[_0x70f9('0x32')]['fields']));_0x27eb58[_0x70f9('0x36')]=_0x27eb58[_0x70f9('0x36')][_0x70f9('0x38')]?_0x27eb58[_0x70f9('0x36')]:_0xc1f296[_0x70f9('0x31')];if(!_0x1681b2['query'][_0x70f9('0x39')]('nolimit')){_0x27eb58[_0x70f9('0x1f')]=qs[_0x70f9('0x1f')](_0x1681b2[_0x70f9('0x32')][_0x70f9('0x1f')]);_0x27eb58[_0x70f9('0x1e')]=qs[_0x70f9('0x1e')](_0x1681b2[_0x70f9('0x32')][_0x70f9('0x1e')]);}_0x27eb58['order']=qs['sort'](_0x1681b2[_0x70f9('0x32')][_0x70f9('0x3b')]);_0x27eb58[_0x70f9('0x3c')]=qs[_0x70f9('0x34')](_[_0x70f9('0x3d')](_0x1681b2[_0x70f9('0x32')],_0xc1f296['filters']));_0x27eb58[_0x70f9('0x3c')]['SmsQueueId']=_0x389b83['id'];if(_0x1681b2[_0x70f9('0x32')][_0x70f9('0x3e')]){_0x27eb58['where']=_['merge'](_0x27eb58[_0x70f9('0x3c')],{'$or':_[_0x70f9('0x2d')](_0x27eb58['attributes'],function(_0x3f9e0f){var _0x4041d3={};_0x4041d3[_0x3f9e0f]={'$like':'%'+_0x1681b2[_0x70f9('0x32')][_0x70f9('0x3e')]+'%'};return _0x4041d3;})});}_0x27eb58=_[_0x70f9('0x3f')]({},_0x27eb58,_0x1681b2[_0x70f9('0x54')]);return db[_0x70f9('0x53')]['findAll'](_0x27eb58);}})[_0x70f9('0x27')](function(_0x3c88ce){if(_0x3c88ce){return db[_0x70f9('0x55')]['findAndCountAll']({'where':{'id':_[_0x70f9('0x2d')](_0x3c88ce,_0x70f9('0x56')),'role':_0x70f9('0x57')},'attributes':['id',_0x70f9('0x2b'),_0x70f9('0x58'),_0x70f9('0x59'),_0x70f9('0x5a')]});}})[_0x70f9('0x27')](function(_0x45e660){if(_0x45e660){return{'count':_0x45e660[_0x70f9('0x21')],'rows':_['map'](_0x45e660[_0x70f9('0x42')],function(_0x5b3676){return{'membername':_0x5b3676[_0x70f9('0x2b')],'UserId':_0x5b3676['id'],'queue_name':_0x487b25['name'],'SmsQueueId':_0x487b25['id'],'interface':util['format'](_0x70f9('0x5b'),_0x70f9('0x5c'),_0x5b3676['name']),'penalty':0x0,'paused':_0x5b3676[_0x70f9('0x58')],'createdAt':_0x5b3676['createdAt'],'updatedAt':_0x5b3676[_0x70f9('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4ac43f,_0x27eb58))[_0x70f9('0x43')](handleError(_0x4ac43f,null));};exports[_0x70f9('0x5d')]=function(_0x949af,_0x2ce2d1,_0x4904b3){var _0x49a4c4={};var _0x2a9421={};var _0x2e128d;var _0x1cba10;return db[_0x70f9('0x2e')]['findOne']({'where':{'id':_0x949af[_0x70f9('0x45')]['id']}})[_0x70f9('0x27')](handleEntityNotFound(_0x2ce2d1,null))['then'](function(_0x4151e1){if(_0x4151e1){_0x2e128d=_0x4151e1;_0x2a9421['model']=_[_0x70f9('0x33')](db['Team'][_0x70f9('0x46')]);_0x2a9421[_0x70f9('0x32')]=_[_0x70f9('0x33')](_0x949af[_0x70f9('0x32')]);_0x2a9421[_0x70f9('0x34')]=_[_0x70f9('0x35')](_0x2a9421['model'],_0x2a9421['query']);_0x49a4c4['attributes']=_[_0x70f9('0x35')](_0x2a9421[_0x70f9('0x31')],qs[_0x70f9('0x37')](_0x949af[_0x70f9('0x32')][_0x70f9('0x37')]));_0x49a4c4[_0x70f9('0x36')]=_0x49a4c4['attributes'][_0x70f9('0x38')]?_0x49a4c4['attributes']:_0x2a9421[_0x70f9('0x31')];_0x49a4c4[_0x70f9('0x3a')]=qs[_0x70f9('0x3b')](_0x949af['query'][_0x70f9('0x3b')]);_0x49a4c4[_0x70f9('0x3c')]=qs[_0x70f9('0x34')](_[_0x70f9('0x3d')](_0x949af[_0x70f9('0x32')],_0x2a9421[_0x70f9('0x34')]));if(_0x949af[_0x70f9('0x32')]['filter']){_0x49a4c4[_0x70f9('0x3c')]=_[_0x70f9('0x3f')](_0x49a4c4[_0x70f9('0x3c')],{'$or':_['map'](_0x49a4c4[_0x70f9('0x36')],function(_0x1b661d){var _0x3ca31c={};_0x3ca31c[_0x1b661d]={'$like':'%'+_0x949af[_0x70f9('0x32')][_0x70f9('0x3e')]+'%'};return _0x3ca31c;})});}_0x49a4c4=_[_0x70f9('0x3f')]({},_0x49a4c4,_0x949af['options']);return _0x2e128d['getTeams'](_0x49a4c4);}})[_0x70f9('0x27')](function(_0x5be371){if(_0x5be371){_0x1cba10=_0x5be371[_0x70f9('0x38')];if(!_0x949af[_0x70f9('0x32')][_0x70f9('0x39')]('nolimit')){_0x49a4c4['limit']=qs[_0x70f9('0x1f')](_0x949af[_0x70f9('0x32')][_0x70f9('0x1f')]);_0x49a4c4[_0x70f9('0x1e')]=qs[_0x70f9('0x1e')](_0x949af['query']['offset']);}return _0x2e128d[_0x70f9('0x5d')](_0x49a4c4);}})['then'](function(_0x67275d){if(_0x67275d){return _0x67275d?{'count':_0x1cba10,'rows':_0x67275d}:null;}})['then'](respondWithResult(_0x2ce2d1,null))[_0x70f9('0x43')](handleError(_0x2ce2d1,null));};exports[_0x70f9('0x5e')]=function(_0x5165e7,_0x166114,_0x203f1c){var _0x1208a5=_0x5165e7['body']['ids'];return db[_0x70f9('0x5f')][_0x70f9('0x41')]({'where':{'id':_0x1208a5},'attributes':['id'],'include':[{'model':db[_0x70f9('0x55')],'as':_0x70f9('0x60'),'attributes':['id','name',_0x70f9('0x61'),_0x70f9('0x62'),_0x70f9('0x63')],'raw':!![]}]})['then'](function(_0xa603d7){if(_0xa603d7){var _0x36469e=_['flatMap'](_0xa603d7,function(_0x584ab4){var _0x39ef3f=_0x584ab4[_0x70f9('0x29')]({'plain':!![]});return _0x39ef3f[_0x70f9('0x60')];});return db[_0x70f9('0x2e')]['find']({'where':{'id':_0x5165e7[_0x70f9('0x45')]['id']}})['then'](function(_0x4a8298){return db[_0x70f9('0x64')]['transaction'](function(_0x5eb493){return _0x4a8298[_0x70f9('0x5e')](_0x1208a5,{'transaction':_0x5eb493})['then'](function(){return BPromise[_0x70f9('0x65')](_0x36469e,function(_0xd498d5){return db['UserSmsQueue'][_0x70f9('0x66')]({'where':{'UserId':_0xd498d5['id'],'SmsQueueId':_0x5165e7['params']['id']},'transaction':_0x5eb493});});})[_0x70f9('0x27')](function(){_0x36469e['forEach'](function(_0x2e12de){socket[_0x70f9('0x67')](_0x70f9('0x68'),{'UserId':_0x2e12de['id'],'SmsQueueId':_0x4a8298['id']});});});});});}})[_0x70f9('0x27')](respondWithStatusCode(_0x166114,null))[_0x70f9('0x43')](handleError(_0x166114,null));};exports[_0x70f9('0x69')]=function(_0x2df2be,_0x48b6a5,_0x589764){return db[_0x70f9('0x5f')][_0x70f9('0x41')]({'where':{'id':_0x2df2be[_0x70f9('0x32')][_0x70f9('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48b6a5,null))['then'](function(_0x3d7290){var _0x2b5236=_[_0x70f9('0x2d')](_0x3d7290,'id');var _0x41ea52=[];var _0x230f9c=[];var _0x351189=squel[_0x70f9('0x6b')]();_0x351189[_0x70f9('0x6c')](_0x70f9('0x6d'))[_0x70f9('0x6e')]('team_has_sms_queues','tq')[_0x70f9('0x6f')](_0x70f9('0x70'),'ut',_0x70f9('0x71'))[_0x70f9('0x3c')](_0x70f9('0x72'),_0x2df2be[_0x70f9('0x45')]['id']);for(var _0x5d3882=0x0;_0x5d3882<_0x3d7290[_0x70f9('0x38')];_0x5d3882+=0x1){let _0x546f23=_0x3d7290[_0x5d3882];for(var _0x23d8f0=0x0;_0x23d8f0<_0x546f23[_0x70f9('0x60')][_0x70f9('0x38')];_0x23d8f0+=0x1){let _0x5edc63=_0x546f23[_0x70f9('0x60')][_0x23d8f0];var _0x282756=_0x351189[_0x70f9('0x73')]();_0x282756[_0x70f9('0x3c')](_0x70f9('0x74'),_0x5edc63['id']);_0x230f9c[_0x70f9('0x75')](db[_0x70f9('0x64')][_0x70f9('0x32')](_0x282756[_0x70f9('0x76')](),{'type':db[_0x70f9('0x64')][_0x70f9('0x77')][_0x70f9('0x78')]})['then'](function(_0x2b75d0){if(_0x2b75d0[_0x70f9('0x38')]===0x1){return _0x5edc63['id'];}else{var _0x31aa5f=_[_0x70f9('0x79')](_[_0x70f9('0x2d')](_0x2b75d0,_0x70f9('0x7a')),function(_0xa3578b){return _[_0x70f9('0x7b')](_0x2b5236,_0xa3578b);});if(_0x31aa5f){return _0x5edc63['id'];}}}));}}return BPromise[_0x70f9('0x7c')](_0x230f9c)[_0x70f9('0x27')](function(_0x4ca260){_0x41ea52=_(_0x41ea52)[_0x70f9('0x7d')](_0x4ca260)[_0x70f9('0x7e')]()[_0x70f9('0x7f')]();return db[_0x70f9('0x2e')][_0x70f9('0x48')]({'where':{'id':_0x2df2be['params']['id']}})[_0x70f9('0x27')](function(_0x2c6281){return db[_0x70f9('0x64')][_0x70f9('0x80')](function(_0x41280b){return _0x2c6281[_0x70f9('0x69')](_0x2df2be['query']['ids'],{'transaction':_0x41280b})[_0x70f9('0x27')](function(){if(!_['isEmpty'](_0x41ea52)){return _0x2c6281[_0x70f9('0x81')](_0x41ea52,{'transaction':_0x41280b});}})[_0x70f9('0x27')](function(){_0x41ea52[_0x70f9('0x82')](function(_0x32e6ca){socket[_0x70f9('0x67')](_0x70f9('0x83'),{'UserId':_0x32e6ca,'SmsQueueId':_0x2c6281['id']});});});});});});})[_0x70f9('0x27')](respondWithStatusCode(_0x48b6a5,null))[_0x70f9('0x43')](handleError(_0x48b6a5,null));};exports[_0x70f9('0x84')]=function(_0x13ea71,_0x542fab,_0x13b458){return db['SmsQueue'][_0x70f9('0x48')]({'where':{'id':_0x13ea71[_0x70f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x542fab,null))['then'](function(_0x1c2e24){if(_0x1c2e24){return _0x1c2e24['addAgents'](_0x13ea71[_0x70f9('0x4a')][_0x70f9('0x6a')],_['omit'](_0x13ea71[_0x70f9('0x4a')],[_0x70f9('0x6a'),'id'])||{})[_0x70f9('0x85')](function(_0x4802e5){for(var _0x4e850e=0x0;_0x4e850e<_0x13ea71[_0x70f9('0x4a')]['ids'][_0x70f9('0x38')];_0x4e850e+=0x1){socket[_0x70f9('0x67')](_0x70f9('0x68'),{'UserId':Number(_0x13ea71[_0x70f9('0x4a')][_0x70f9('0x6a')][_0x4e850e]),'SmsQueueId':Number(_0x13ea71[_0x70f9('0x45')]['id'])});}return _0x4802e5;});}})[_0x70f9('0x27')](respondWithResult(_0x542fab,null))[_0x70f9('0x43')](handleError(_0x542fab,null));};exports[_0x70f9('0x81')]=function(_0x30abfc,_0x330cb7,_0x2da6d0){return db[_0x70f9('0x2e')]['find']({'where':{'id':_0x30abfc[_0x70f9('0x45')]['id']}})[_0x70f9('0x27')](handleEntityNotFound(_0x330cb7,null))[_0x70f9('0x27')](function(_0x228562){if(_0x228562){return _0x228562['removeAgents'](_0x30abfc[_0x70f9('0x32')][_0x70f9('0x6a')])[_0x70f9('0x27')](function(){if(_['isArray'](_0x30abfc['query'][_0x70f9('0x6a')])){for(var _0x9c4b9c=0x0;_0x9c4b9c<_0x30abfc['query'][_0x70f9('0x6a')]['length'];_0x9c4b9c+=0x1){socket[_0x70f9('0x67')]('userSmsQueue:remove',{'UserId':Number(_0x30abfc[_0x70f9('0x32')]['ids'][_0x9c4b9c]),'SmsQueueId':Number(_0x30abfc['params']['id'])});}}else{socket[_0x70f9('0x67')](_0x70f9('0x83'),{'UserId':Number(_0x30abfc[_0x70f9('0x32')][_0x70f9('0x6a')]),'SmsQueueId':Number(_0x30abfc['params']['id'])});}});}})[_0x70f9('0x27')](respondWithStatusCode(_0x330cb7,null))['catch'](handleError(_0x330cb7,null));};exports[_0x70f9('0x86')]=function(_0xd1214e,_0xf71ed8,_0x4ee471){var _0x114b4d={};var _0xca9a74={};var _0x2e581a;var _0x3f7242;return db[_0x70f9('0x2e')][_0x70f9('0x52')]({'where':{'id':_0xd1214e['params']['id']}})['then'](handleEntityNotFound(_0xf71ed8,null))['then'](function(_0x6c2e67){if(_0x6c2e67){_0x2e581a=_0x6c2e67;_0xca9a74[_0x70f9('0x31')]=_[_0x70f9('0x33')](db['User'][_0x70f9('0x46')]);_0xca9a74['query']=_[_0x70f9('0x33')](_0xd1214e[_0x70f9('0x32')]);_0xca9a74[_0x70f9('0x34')]=_[_0x70f9('0x35')](_0xca9a74[_0x70f9('0x31')],_0xca9a74[_0x70f9('0x32')]);_0x114b4d['attributes']=_[_0x70f9('0x35')](_0xca9a74[_0x70f9('0x31')],qs[_0x70f9('0x37')](_0xd1214e[_0x70f9('0x32')][_0x70f9('0x37')]));_0x114b4d[_0x70f9('0x36')]=_0x114b4d[_0x70f9('0x36')]['length']?_0x114b4d['attributes']:_0xca9a74[_0x70f9('0x31')];_0x114b4d[_0x70f9('0x3a')]=qs[_0x70f9('0x3b')](_0xd1214e[_0x70f9('0x32')][_0x70f9('0x3b')]);_0x114b4d[_0x70f9('0x3c')]=qs['filters'](_[_0x70f9('0x3d')](_0xd1214e[_0x70f9('0x32')],_0xca9a74['filters']));if(_0xd1214e[_0x70f9('0x32')][_0x70f9('0x3e')]){_0x114b4d[_0x70f9('0x3c')]=_['merge'](_0x114b4d['where'],{'$or':_[_0x70f9('0x2d')](_0x114b4d[_0x70f9('0x36')],function(_0x3f7c01){var _0x29c180={};_0x29c180[_0x3f7c01]={'$like':'%'+_0xd1214e[_0x70f9('0x32')]['filter']+'%'};return _0x29c180;})});}_0x114b4d=_[_0x70f9('0x3f')]({},_0x114b4d,_0xd1214e['options']);return _0x2e581a[_0x70f9('0x86')](_0x114b4d);}})['then'](function(_0x3a904a){if(_0x3a904a){_0x3f7242=_0x3a904a[_0x70f9('0x38')];if(!_0xd1214e['query'][_0x70f9('0x39')](_0x70f9('0x87'))){_0x114b4d[_0x70f9('0x1f')]=qs[_0x70f9('0x1f')](_0xd1214e[_0x70f9('0x32')]['limit']);_0x114b4d['offset']=qs['offset'](_0xd1214e[_0x70f9('0x32')][_0x70f9('0x1e')]);}return _0x2e581a['getAgents'](_0x114b4d);}})[_0x70f9('0x27')](function(_0x15869a){if(_0x15869a){return _0x15869a?{'count':_0x3f7242,'rows':_0x15869a}:null;}})['then'](respondWithResult(_0xf71ed8,null))['catch'](handleError(_0xf71ed8,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ad851fc..3cd0270 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 _0x76a0=['hook','exports','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x380c1d,_0x145701){var _0x4d2c3f=function(_0x59d0c2){while(--_0x59d0c2){_0x380c1d['push'](_0x380c1d['shift']());}};_0x4d2c3f(++_0x145701);}(_0x76a0,0x1ba));var _0x076a=function(_0x2a286e,_0x4f97b2){_0x2a286e=_0x2a286e-0x0;var _0x453278=_0x76a0[_0x2a286e];return _0x453278;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x076a('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x076a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x076a('0x2'),'afterDestroy':_0x076a('0x3')};function emitEvent(_0x25b27b){return function(_0x5b5ac1,_0x45468a,_0x5966b6){SmsQueueEvents[_0x076a('0x4')](_0x25b27b+':'+_0x5b5ac1['id'],_0x5b5ac1);SmsQueueEvents[_0x076a('0x4')](_0x25b27b,_0x5b5ac1);_0x5966b6(null);};}for(var e in events){if(events[_0x076a('0x5')](e)){var event=events[e];SmsQueue[_0x076a('0x6')](e,emitEvent(event));}}module[_0x076a('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xc527=['events','../../mysqldb','SmsQueue','save','update','emit'];(function(_0xb4a704,_0x1deea9){var _0x23a1d5=function(_0x2f0120){while(--_0x2f0120){_0xb4a704['push'](_0xb4a704['shift']());}};_0x23a1d5(++_0x1deea9);}(_0xc527,0x168));var _0x7c52=function(_0x1dea0f,_0x218090){_0x1dea0f=_0x1dea0f-0x0;var _0x55f8f7=_0xc527[_0x1dea0f];return _0x55f8f7;};'use strict';var EventEmitter=require(_0x7c52('0x0'));var SmsQueue=require(_0x7c52('0x1'))['db'][_0x7c52('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7c52('0x3'),'afterUpdate':_0x7c52('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fbcd3){return function(_0x3302c3,_0x4139b5,_0x4f9dd3){SmsQueueEvents[_0x7c52('0x5')](_0x4fbcd3+':'+_0x3302c3['id'],_0x3302c3);SmsQueueEvents[_0x7c52('0x5')](_0x4fbcd3,_0x3302c3);_0x4f9dd3(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 e3c6302..f1b1ce4 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 _0xff40=['sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsQueue.attributes','define','SmsQueue'];(function(_0x3aa9bb,_0x346235){var _0x2591e8=function(_0x19617f){while(--_0x19617f){_0x3aa9bb['push'](_0x3aa9bb['shift']());}};_0x2591e8(++_0x346235);}(_0xff40,0x1e5));var _0x0ff4=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0xff40[_0x51fe5f];return _0x4abce9;};'use strict';var _=require('lodash');var util=require(_0x0ff4('0x0'));var logger=require(_0x0ff4('0x1'))(_0x0ff4('0x2'));var moment=require(_0x0ff4('0x3'));var BPromise=require(_0x0ff4('0x4'));var rp=require(_0x0ff4('0x5'));var fs=require('fs');var path=require(_0x0ff4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ff4('0x7'));module['exports']=function(_0x19b436,_0x17ac2c){return _0x19b436[_0x0ff4('0x8')](_0x0ff4('0x9'),attributes,{'tableName':_0x0ff4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2a1=['../../config/logger','moment','bluebird','request-promise','path','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x50345a,_0x4ba3bc){var _0x49d587=function(_0x2550b3){while(--_0x2550b3){_0x50345a['push'](_0x50345a['shift']());}};_0x49d587(++_0x4ba3bc);}(_0xa2a1,0x1c6));var _0x1a2a=function(_0x4ef8ff,_0x47d1e5){_0x4ef8ff=_0x4ef8ff-0x0;var _0x25631a=_0xa2a1[_0x4ef8ff];return _0x25631a;};'use strict';var _=require(_0x1a2a('0x0'));var util=require(_0x1a2a('0x1'));var logger=require(_0x1a2a('0x2'))('api');var moment=require(_0x1a2a('0x3'));var BPromise=require(_0x1a2a('0x4'));var rp=require(_0x1a2a('0x5'));var fs=require('fs');var path=require(_0x1a2a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1a2a('0x7'));module[_0x1a2a('0x8')]=function(_0x10ff7f,_0x4e4eb2){return _0x10ff7f[_0x1a2a('0x9')](_0x1a2a('0xa'),attributes,{'tableName':_0x1a2a('0xb'),'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 3d17361..bc8c654 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 _0x0e30=['../../config/logger','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','model','ShowSmsQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0x0e30,0x17f));var _0x00e3=function(_0x2ab733,_0x4d6fdd){_0x2ab733=_0x2ab733-0x0;var _0x1716ed=_0x0e30[_0x2ab733];return _0x1716ed;};'use strict';var _=require(_0x00e3('0x0'));var util=require(_0x00e3('0x1'));var moment=require(_0x00e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x00e3('0x3'));var fs=require('fs');var Redis=require(_0x00e3('0x4'));var db=require(_0x00e3('0x5'))['db'];var utils=require(_0x00e3('0x6'));var logger=require(_0x00e3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x00e3('0x8')][_0x00e3('0x9')]({'port':0x232a});config[_0x00e3('0xa')]=_[_0x00e3('0xb')](config[_0x00e3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x00e3('0xc'))(new Redis(config['redis']));require(_0x00e3('0xd'))['register'](socket);function respondWithRpcPromise(_0x2ca303,_0x3a2165,_0x284055){return new BPromise(function(_0xa86dba,_0x337b06){return client[_0x00e3('0xe')](_0x2ca303,_0x284055)[_0x00e3('0xf')](function(_0x391bd8){logger['info'](_0x00e3('0x10'),_0x3a2165,_0x00e3('0x11'));logger[_0x00e3('0x12')](_0x00e3('0x13'),_0x3a2165,_0x00e3('0x11'),JSON[_0x00e3('0x14')](_0x391bd8));if(_0x391bd8[_0x00e3('0x15')]){if(_0x391bd8[_0x00e3('0x15')][_0x00e3('0x16')]===0x1f4){logger[_0x00e3('0x15')](_0x00e3('0x10'),_0x3a2165,_0x391bd8[_0x00e3('0x15')][_0x00e3('0x17')]);return _0x337b06(_0x391bd8[_0x00e3('0x15')]['message']);}logger[_0x00e3('0x15')](_0x00e3('0x10'),_0x3a2165,_0x391bd8[_0x00e3('0x15')][_0x00e3('0x17')]);return _0xa86dba(_0x391bd8['error'][_0x00e3('0x17')]);}else{logger[_0x00e3('0x18')](_0x00e3('0x10'),_0x3a2165,_0x00e3('0x11'));_0xa86dba(_0x391bd8[_0x00e3('0x19')][_0x00e3('0x17')]);}})[_0x00e3('0x1a')](function(_0x576318){logger[_0x00e3('0x15')](_0x00e3('0x10'),_0x3a2165,_0x576318);_0x337b06(_0x576318);});});}exports[_0x00e3('0x1b')]=function(_0x269390){var _0x11e2e6=this;return new Promise(function(_0xc85dbd,_0x5d33ac){return db[_0x00e3('0x1c')][_0x00e3('0x1d')]({'raw':_0x269390[_0x00e3('0x1e')]?_0x269390[_0x00e3('0x1e')][_0x00e3('0x1f')]===undefined?!![]:![]:!![],'where':_0x269390[_0x00e3('0x1e')]?_0x269390[_0x00e3('0x1e')][_0x00e3('0x20')]||null:null,'attributes':_0x269390[_0x00e3('0x1e')]?_0x269390[_0x00e3('0x1e')][_0x00e3('0x21')]||null:null,'limit':_0x269390[_0x00e3('0x1e')]?_0x269390[_0x00e3('0x1e')]['limit']||null:null,'include':_0x269390[_0x00e3('0x1e')]?_0x269390[_0x00e3('0x1e')][_0x00e3('0x22')]?_[_0x00e3('0x23')](_0x269390[_0x00e3('0x1e')][_0x00e3('0x22')],function(_0x3719bd){return{'model':db[_0x3719bd[_0x00e3('0x24')]],'as':_0x3719bd['as'],'attributes':_0x3719bd['attributes'],'include':_0x3719bd[_0x00e3('0x22')]?_[_0x00e3('0x23')](_0x3719bd[_0x00e3('0x22')],function(_0x560d50){return{'model':db[_0x560d50['model']],'as':_0x560d50['as'],'attributes':_0x560d50[_0x00e3('0x21')],'include':_0x560d50['include']?_['map'](_0x560d50[_0x00e3('0x22')],function(_0x5e6ecb){return{'model':db[_0x5e6ecb[_0x00e3('0x24')]],'as':_0x5e6ecb['as'],'attributes':_0x5e6ecb[_0x00e3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x00e3('0xf')](function(_0x23eeeb){logger[_0x00e3('0x18')](_0x00e3('0x1b'),_0x269390);logger['debug']('GetSmsQueue',_0x269390,JSON[_0x00e3('0x14')](_0x23eeeb));_0xc85dbd(_0x23eeeb);})[_0x00e3('0x1a')](function(_0x4667ba){logger['error']('GetSmsQueue',_0x4667ba['message'],_0x269390);_0x5d33ac(_0x11e2e6[_0x00e3('0x15')](0x1f4,_0x4667ba[_0x00e3('0x17')]));});});};exports[_0x00e3('0x25')]=function(_0x13a354){var _0x5e7827=this;return new Promise(function(_0x2d9bb5,_0x37e7ce){return db[_0x00e3('0x1c')][_0x00e3('0x26')]({'raw':_0x13a354[_0x00e3('0x1e')]?_0x13a354[_0x00e3('0x1e')][_0x00e3('0x1f')]===undefined?!![]:![]:!![],'where':_0x13a354[_0x00e3('0x1e')]?_0x13a354[_0x00e3('0x1e')][_0x00e3('0x20')]||null:null,'attributes':_0x13a354[_0x00e3('0x1e')]?_0x13a354['options'][_0x00e3('0x21')]||null:null,'include':_0x13a354[_0x00e3('0x1e')]?_0x13a354[_0x00e3('0x1e')]['include']?_[_0x00e3('0x23')](_0x13a354[_0x00e3('0x1e')][_0x00e3('0x22')],function(_0xff1048){return{'model':db[_0xff1048[_0x00e3('0x24')]],'as':_0xff1048['as'],'attributes':_0xff1048[_0x00e3('0x21')],'include':_0xff1048[_0x00e3('0x22')]?_['map'](_0xff1048[_0x00e3('0x22')],function(_0x4ba271){return{'model':db[_0x4ba271[_0x00e3('0x24')]],'as':_0x4ba271['as'],'attributes':_0x4ba271['attributes'],'include':_0x4ba271[_0x00e3('0x22')]?_[_0x00e3('0x23')](_0x4ba271[_0x00e3('0x22')],function(_0x6af253){return{'model':db[_0x6af253[_0x00e3('0x24')]],'as':_0x6af253['as'],'attributes':_0x6af253['attributes']};}):[]};}):[]};}):[]:[]})[_0x00e3('0xf')](function(_0x133d5c){logger[_0x00e3('0x18')](_0x00e3('0x25'),_0x13a354);logger['debug']('ShowSmsQueue',_0x13a354,JSON[_0x00e3('0x14')](_0x133d5c));_0x2d9bb5(_0x133d5c);})[_0x00e3('0x1a')](function(_0x145320){logger[_0x00e3('0x15')]('ShowSmsQueue',_0x145320['message'],_0x13a354);_0x37e7ce(_0x5e7827[_0x00e3('0x15')](0x1f4,_0x145320[_0x00e3('0x17')]));});});}; \ No newline at end of file +var _0x39a1=['attributes','stringify','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x39a1,0xf4));var _0x139a=function(_0x5ad72d,_0x2e75ea){_0x5ad72d=_0x5ad72d-0x0;var _0x2c0a1e=_0x39a1[_0x5ad72d];return _0x2c0a1e;};'use strict';var _=require(_0x139a('0x0'));var util=require('util');var moment=require(_0x139a('0x1'));var BPromise=require(_0x139a('0x2'));var rs=require(_0x139a('0x3'));var fs=require('fs');var Redis=require(_0x139a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x139a('0x5'));var logger=require(_0x139a('0x6'))(_0x139a('0x7'));var config=require(_0x139a('0x8'));var jayson=require(_0x139a('0x9'));var client=jayson['client'][_0x139a('0xa')]({'port':0x232a});config[_0x139a('0xb')]=_[_0x139a('0xc')](config[_0x139a('0xb')],{'host':_0x139a('0xd'),'port':0x18eb});var socket=require(_0x139a('0xe'))(new Redis(config[_0x139a('0xb')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x561a07,_0x26a4c1,_0x13b6cf){return new BPromise(function(_0x5b5ed7,_0x515b0f){return client[_0x139a('0xf')](_0x561a07,_0x13b6cf)[_0x139a('0x10')](function(_0x411086){logger[_0x139a('0x11')](_0x139a('0x12'),_0x26a4c1,_0x139a('0x13'));logger[_0x139a('0x14')](_0x139a('0x15'),_0x26a4c1,'request\x20sent',JSON['stringify'](_0x411086));if(_0x411086[_0x139a('0x16')]){if(_0x411086[_0x139a('0x16')][_0x139a('0x17')]===0x1f4){logger['error'](_0x139a('0x12'),_0x26a4c1,_0x411086['error']['message']);return _0x515b0f(_0x411086[_0x139a('0x16')][_0x139a('0x18')]);}logger[_0x139a('0x16')]('SmsQueue,\x20%s,\x20%s',_0x26a4c1,_0x411086['error'][_0x139a('0x18')]);return _0x5b5ed7(_0x411086['error'][_0x139a('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x26a4c1,'request\x20sent');_0x5b5ed7(_0x411086['result']['message']);}})[_0x139a('0x19')](function(_0xb45488){logger['error'](_0x139a('0x12'),_0x26a4c1,_0xb45488);_0x515b0f(_0xb45488);});});}exports[_0x139a('0x1a')]=function(_0x7890d3){var _0x3b55f0=this;return new Promise(function(_0x104d9c,_0x4e1d0c){return db[_0x139a('0x1b')][_0x139a('0x1c')]({'raw':_0x7890d3[_0x139a('0x1d')]?_0x7890d3[_0x139a('0x1d')][_0x139a('0x1e')]===undefined?!![]:![]:!![],'where':_0x7890d3[_0x139a('0x1d')]?_0x7890d3[_0x139a('0x1d')][_0x139a('0x1f')]||null:null,'attributes':_0x7890d3[_0x139a('0x1d')]?_0x7890d3[_0x139a('0x1d')]['attributes']||null:null,'limit':_0x7890d3['options']?_0x7890d3[_0x139a('0x1d')][_0x139a('0x20')]||null:null,'include':_0x7890d3[_0x139a('0x1d')]?_0x7890d3[_0x139a('0x1d')][_0x139a('0x21')]?_[_0x139a('0x22')](_0x7890d3[_0x139a('0x1d')][_0x139a('0x21')],function(_0x1c820c){return{'model':db[_0x1c820c[_0x139a('0x23')]],'as':_0x1c820c['as'],'attributes':_0x1c820c['attributes'],'include':_0x1c820c['include']?_['map'](_0x1c820c[_0x139a('0x21')],function(_0xbb1d72){return{'model':db[_0xbb1d72[_0x139a('0x23')]],'as':_0xbb1d72['as'],'attributes':_0xbb1d72['attributes'],'include':_0xbb1d72['include']?_[_0x139a('0x22')](_0xbb1d72[_0x139a('0x21')],function(_0x7e37b9){return{'model':db[_0x7e37b9[_0x139a('0x23')]],'as':_0x7e37b9['as'],'attributes':_0x7e37b9[_0x139a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x139a('0x10')](function(_0x359533){logger['info'](_0x139a('0x1a'),_0x7890d3);logger[_0x139a('0x14')](_0x139a('0x1a'),_0x7890d3,JSON[_0x139a('0x25')](_0x359533));_0x104d9c(_0x359533);})[_0x139a('0x19')](function(_0x26670c){logger['error']('GetSmsQueue',_0x26670c[_0x139a('0x18')],_0x7890d3);_0x4e1d0c(_0x3b55f0[_0x139a('0x16')](0x1f4,_0x26670c[_0x139a('0x18')]));});});};exports[_0x139a('0x26')]=function(_0x57ef7d){var _0x2edd17=this;return new Promise(function(_0x393bfd,_0xa8198d){return db[_0x139a('0x1b')][_0x139a('0x27')]({'raw':_0x57ef7d[_0x139a('0x1d')]?_0x57ef7d[_0x139a('0x1d')][_0x139a('0x1e')]===undefined?!![]:![]:!![],'where':_0x57ef7d[_0x139a('0x1d')]?_0x57ef7d[_0x139a('0x1d')][_0x139a('0x1f')]||null:null,'attributes':_0x57ef7d[_0x139a('0x1d')]?_0x57ef7d[_0x139a('0x1d')]['attributes']||null:null,'include':_0x57ef7d[_0x139a('0x1d')]?_0x57ef7d[_0x139a('0x1d')]['include']?_['map'](_0x57ef7d[_0x139a('0x1d')][_0x139a('0x21')],function(_0x18a4a8){return{'model':db[_0x18a4a8[_0x139a('0x23')]],'as':_0x18a4a8['as'],'attributes':_0x18a4a8[_0x139a('0x24')],'include':_0x18a4a8['include']?_[_0x139a('0x22')](_0x18a4a8[_0x139a('0x21')],function(_0x486f2d){return{'model':db[_0x486f2d['model']],'as':_0x486f2d['as'],'attributes':_0x486f2d['attributes'],'include':_0x486f2d[_0x139a('0x21')]?_['map'](_0x486f2d[_0x139a('0x21')],function(_0x1909a0){return{'model':db[_0x1909a0[_0x139a('0x23')]],'as':_0x1909a0['as'],'attributes':_0x1909a0[_0x139a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5df7a9){logger[_0x139a('0x11')](_0x139a('0x26'),_0x57ef7d);logger['debug'](_0x139a('0x26'),_0x57ef7d,JSON[_0x139a('0x25')](_0x5df7a9));_0x393bfd(_0x5df7a9);})['catch'](function(_0x227200){logger['error'](_0x139a('0x26'),_0x227200[_0x139a('0x18')],_0x57ef7d);_0xa8198d(_0x2edd17['error'](0x1f4,_0x227200[_0x139a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index c32b2aa..582466b 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 _0x5534=['save','removeListener','length','smsQueue:'];(function(_0x3a6e3a,_0x4b5b17){var _0x351894=function(_0x2b4789){while(--_0x2b4789){_0x3a6e3a['push'](_0x3a6e3a['shift']());}};_0x351894(++_0x4b5b17);}(_0x5534,0x198));var _0x4553=function(_0x3ea07a,_0x387c5b){_0x3ea07a=_0x3ea07a-0x0;var _0x1a6834=_0x5534[_0x3ea07a];return _0x1a6834;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x4553('0x0'),'remove','update'];function createListener(_0x564b38,_0x474eae){return function(_0x2a1a98){_0x474eae['emit'](_0x564b38,_0x2a1a98);};}function removeListener(_0x2894c8,_0x87a6f7){return function(){SmsQueueEvents[_0x4553('0x1')](_0x2894c8,_0x87a6f7);};}exports['register']=function(_0x175ecd){for(var _0x22dbc8=0x0,_0x410907=events[_0x4553('0x2')];_0x22dbc8<_0x410907;_0x22dbc8++){var _0x3a5782=events[_0x22dbc8];var _0x23eb4e=createListener(_0x4553('0x3')+_0x3a5782,_0x175ecd);SmsQueueEvents['on'](_0x3a5782,_0x23eb4e);}}; \ No newline at end of file +var _0xaf0d=['save','remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0xe6e557,_0x4f724b){var _0x15f8a1=function(_0x50a1cf){while(--_0x50a1cf){_0xe6e557['push'](_0xe6e557['shift']());}};_0x15f8a1(++_0x4f724b);}(_0xaf0d,0x182));var _0xdaf0=function(_0x42dd25,_0x1b94a5){_0x42dd25=_0x42dd25-0x0;var _0xfe36e=_0xaf0d[_0x42dd25];return _0xfe36e;};'use strict';var SmsQueueEvents=require(_0xdaf0('0x0'));var events=[_0xdaf0('0x1'),_0xdaf0('0x2'),_0xdaf0('0x3')];function createListener(_0x3917fc,_0x8060c3){return function(_0x26879e){_0x8060c3[_0xdaf0('0x4')](_0x3917fc,_0x26879e);};}function removeListener(_0x362b79,_0x2b310c){return function(){SmsQueueEvents[_0xdaf0('0x5')](_0x362b79,_0x2b310c);};}exports[_0xdaf0('0x6')]=function(_0x5947af){for(var _0x516b2a=0x0,_0x64b68b=events[_0xdaf0('0x7')];_0x516b2a<_0x64b68b;_0x516b2a++){var _0x287597=events[_0x516b2a];var _0x1b3957=createListener(_0xdaf0('0x8')+_0x287597,_0x5947af);SmsQueueEvents['on'](_0x287597,_0x1b3957);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 3a613af..948ea08 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 _0x61bb=['destroy','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','update'];(function(_0x24ce3c,_0x4937e4){var _0x20508d=function(_0x193917){while(--_0x193917){_0x24ce3c['push'](_0x24ce3c['shift']());}};_0x20508d(++_0x4937e4);}(_0x61bb,0x1b1));var _0xb61b=function(_0x515a81,_0xfdf8fb){_0x515a81=_0x515a81-0x0;var _0x529369=_0x61bb[_0x515a81];return _0x529369;};'use strict';var multer=require(_0xb61b('0x0'));var util=require(_0xb61b('0x1'));var path=require('path');var timeout=require(_0xb61b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb61b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb61b('0x4'));var controller=require(_0xb61b('0x5'));router['get']('/',auth[_0xb61b('0x6')](),controller[_0xb61b('0x7')]);router[_0xb61b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xb61b('0x9')]);router[_0xb61b('0x8')](_0xb61b('0xa'),auth[_0xb61b('0x6')](),controller[_0xb61b('0xb')]);router[_0xb61b('0xc')]('/',auth[_0xb61b('0x6')](),controller[_0xb61b('0xd')]);router['put'](_0xb61b('0xa'),auth[_0xb61b('0x6')](),controller[_0xb61b('0xe')]);router['delete']('/:id',auth[_0xb61b('0x6')](),controller[_0xb61b('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4569=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','delete','exports','multer','util','path'];(function(_0x5f09ac,_0x428ad7){var _0x250af0=function(_0xe606a1){while(--_0xe606a1){_0x5f09ac['push'](_0x5f09ac['shift']());}};_0x250af0(++_0x428ad7);}(_0x4569,0xed));var _0x9456=function(_0x41921b,_0x5e66ed){_0x41921b=_0x41921b-0x0;var _0x164086=_0x4569[_0x41921b];return _0x164086;};'use strict';var multer=require(_0x9456('0x0'));var util=require(_0x9456('0x1'));var path=require(_0x9456('0x2'));var timeout=require(_0x9456('0x3'));var express=require(_0x9456('0x4'));var router=express[_0x9456('0x5')]();var fs_extra=require(_0x9456('0x6'));var auth=require(_0x9456('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9456('0x8'));var controller=require(_0x9456('0x9'));router[_0x9456('0xa')]('/',auth['isAuthenticated'](),controller[_0x9456('0xb')]);router[_0x9456('0xa')](_0x9456('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9456('0xa')](_0x9456('0xd'),auth[_0x9456('0xe')](),controller[_0x9456('0xf')]);router[_0x9456('0x10')]('/',auth['isAuthenticated'](),controller[_0x9456('0x11')]);router['put']('/:id',auth[_0x9456('0xe')](),controller['update']);router[_0x9456('0x12')](_0x9456('0xd'),auth[_0x9456('0xe')](),controller['destroy']);module[_0x9456('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 6322bf3..f87d594 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 _0x8bcc=['moment','sequelize','exports','STRING','DATE'];(function(_0x32b79a,_0xd2538a){var _0x483450=function(_0x17a15b){while(--_0x17a15b){_0x32b79a['push'](_0x32b79a['shift']());}};_0x483450(++_0xd2538a);}(_0x8bcc,0xaa));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xc8bc('0x0'));var Sequelize=require(_0xc8bc('0x1'));module[_0xc8bc('0x2')]={'uniqueid':{'type':Sequelize[_0xc8bc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc8bc('0x3')]},'joinAt':{'type':Sequelize[_0xc8bc('0x4')]},'leaveAt':{'type':Sequelize[_0xc8bc('0x4')]},'acceptAt':{'type':Sequelize[_0xc8bc('0x4')]},'exitAt':{'type':Sequelize[_0xc8bc('0x4')]},'reason':{'type':Sequelize[_0xc8bc('0x3')]}}; \ No newline at end of file +var _0xbb78=['DATE','exports','STRING'];(function(_0x59b2d3,_0xeca810){var _0x41aab1=function(_0x37c55c){while(--_0x37c55c){_0x59b2d3['push'](_0x59b2d3['shift']());}};_0x41aab1(++_0xeca810);}(_0xbb78,0xf4));var _0x8bb7=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xbb78[_0x4a7631];return _0x1a5a6f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8bb7('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8bb7('0x1')]},'joinAt':{'type':Sequelize[_0x8bb7('0x2')]},'leaveAt':{'type':Sequelize[_0x8bb7('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8bb7('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 8705440..4345ee9 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 _0x01b6=['stack','name','send','map','SmsQueueReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','findAll','show','params','keys','length','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x453c2a,_0x430b49){var _0x59d07b=function(_0x4e0aae){while(--_0x4e0aae){_0x453c2a['push'](_0x453c2a['shift']());}};_0x59d07b(++_0x430b49);}(_0x01b6,0x1e4));var _0x601b=function(_0x3d9312,_0x3363fc){_0x3d9312=_0x3d9312-0x0;var _0x3a0a42=_0x01b6[_0x3d9312];return _0x3a0a42;};'use strict';var emlformat=require(_0x601b('0x0'));var rimraf=require(_0x601b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x601b('0x2'));var rp=require(_0x601b('0x3'));var moment=require(_0x601b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x601b('0x5'));var util=require(_0x601b('0x6'));var path=require(_0x601b('0x7'));var sox=require(_0x601b('0x8'));var csv=require(_0x601b('0x9'));var ejs=require(_0x601b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x601b('0xb'));var squel=require(_0x601b('0xc'));var crypto=require(_0x601b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x601b('0xe'));var toCsv=require(_0x601b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x601b('0xf'));var authService=require(_0x601b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x601b('0x11'));var hardwareService=require(_0x601b('0x12'));var logger=require(_0x601b('0x13'))(_0x601b('0x14'));var utils=require(_0x601b('0x15'));var config=require(_0x601b('0x16'));var licenseUtil=require(_0x601b('0x17'));var db=require(_0x601b('0x18'))['db'];function respondWithStatusCode(_0x48ac8b,_0x168542){_0x168542=_0x168542||0xcc;return function(_0x274f0e){if(_0x274f0e){return _0x48ac8b[_0x601b('0x19')](_0x168542);}return _0x48ac8b['status'](_0x168542)[_0x601b('0x1a')]();};}function respondWithResult(_0x33f919,_0x1fc7e2){_0x1fc7e2=_0x1fc7e2||0xc8;return function(_0x112b91){if(_0x112b91){return _0x33f919[_0x601b('0x1b')](_0x1fc7e2)[_0x601b('0x1c')](_0x112b91);}};}function respondWithFilteredResult(_0x4634a3,_0x47a656){return function(_0x4b7f68){if(_0x4b7f68){var _0x4253cd=typeof _0x47a656[_0x601b('0x1d')]===_0x601b('0x1e')&&typeof _0x47a656[_0x601b('0x1f')]===_0x601b('0x1e');var _0x3d1a1a=_0x4b7f68[_0x601b('0x20')];var _0x2de802=_0x4253cd?0x0:_0x47a656['offset'];var _0x321959=_0x4253cd?_0x4b7f68[_0x601b('0x20')]:_0x47a656[_0x601b('0x1d')]+_0x47a656[_0x601b('0x1f')];var _0x1b5ea1;if(_0x321959>=_0x3d1a1a){_0x321959=_0x3d1a1a;_0x1b5ea1=0xc8;}else{_0x1b5ea1=0xce;}_0x4634a3[_0x601b('0x1b')](_0x1b5ea1);return _0x4634a3[_0x601b('0x21')](_0x601b('0x22'),_0x2de802+'-'+_0x321959+'/'+_0x3d1a1a)[_0x601b('0x1c')](_0x4b7f68);}return null;};}function patchUpdates(_0x4d7b15){return function(_0x4c98a5){try{jsonpatch[_0x601b('0x23')](_0x4c98a5,_0x4d7b15,!![]);}catch(_0x21a5e6){return BPromise[_0x601b('0x24')](_0x21a5e6);}return _0x4c98a5['save']();};}function saveUpdates(_0x1f9fce,_0xb6aa44){return function(_0xf8ba4e){if(_0xf8ba4e){return _0xf8ba4e[_0x601b('0x25')](_0x1f9fce)[_0x601b('0x26')](function(_0x53f817){return _0x53f817;});}return null;};}function removeEntity(_0x246abb,_0x355028){return function(_0x4b36a7){if(_0x4b36a7){return _0x4b36a7[_0x601b('0x27')]()['then'](function(){_0x246abb[_0x601b('0x1b')](0xcc)[_0x601b('0x1a')]();});}};}function handleEntityNotFound(_0x2be1f1,_0xe2a260){return function(_0x5f2d8c){if(!_0x5f2d8c){_0x2be1f1['sendStatus'](0x194);}return _0x5f2d8c;};}function handleError(_0x270532,_0x1cb97d){_0x1cb97d=_0x1cb97d||0x1f4;return function(_0x5ee6d6){logger[_0x601b('0x28')](_0x5ee6d6[_0x601b('0x29')]);if(_0x5ee6d6[_0x601b('0x2a')]){delete _0x5ee6d6[_0x601b('0x2a')];}_0x270532[_0x601b('0x1b')](_0x1cb97d)[_0x601b('0x2b')](_0x5ee6d6);};}exports['index']=function(_0x526d6f,_0x3ec934){var _0x1fa1b5={},_0x38c583={},_0x3b8313={'count':0x0,'rows':[]};var _0x38679c=_[_0x601b('0x2c')](db[_0x601b('0x2d')][_0x601b('0x2e')],function(_0x12ade3){return{'name':_0x12ade3['fieldName'],'type':_0x12ade3['type'][_0x601b('0x2f')]};});_0x38c583[_0x601b('0x30')]=_[_0x601b('0x2c')](_0x38679c,'name');_0x38c583['query']=_['keys'](_0x526d6f[_0x601b('0x31')]);_0x38c583[_0x601b('0x32')]=_[_0x601b('0x33')](_0x38c583['model'],_0x38c583[_0x601b('0x31')]);_0x1fa1b5[_0x601b('0x34')]=_[_0x601b('0x33')](_0x38c583[_0x601b('0x30')],qs[_0x601b('0x35')](_0x526d6f[_0x601b('0x31')][_0x601b('0x35')]));_0x1fa1b5['attributes']=_0x1fa1b5[_0x601b('0x34')]['length']?_0x1fa1b5['attributes']:_0x38c583[_0x601b('0x30')];if(!_0x526d6f[_0x601b('0x31')][_0x601b('0x36')](_0x601b('0x37'))){_0x1fa1b5['limit']=qs[_0x601b('0x1f')](_0x526d6f[_0x601b('0x31')][_0x601b('0x1f')]);_0x1fa1b5[_0x601b('0x1d')]=qs[_0x601b('0x1d')](_0x526d6f['query'][_0x601b('0x1d')]);}_0x1fa1b5[_0x601b('0x38')]=qs[_0x601b('0x39')](_0x526d6f[_0x601b('0x31')][_0x601b('0x39')]);_0x1fa1b5['where']=qs[_0x601b('0x32')](_[_0x601b('0x3a')](_0x526d6f[_0x601b('0x31')],_0x38c583['filters']),_0x38679c);if(_0x526d6f[_0x601b('0x31')]['filter']){_0x1fa1b5[_0x601b('0x3b')]=_[_0x601b('0x3c')](_0x1fa1b5[_0x601b('0x3b')],{'$or':_[_0x601b('0x2c')](_0x38679c,function(_0x454931){if(_0x454931[_0x601b('0x3d')]!==_0x601b('0x3e')){var _0x322930={};_0x322930[_0x454931[_0x601b('0x2a')]]={'$like':'%'+_0x526d6f['query']['filter']+'%'};return _0x322930;}})});}_0x1fa1b5=_[_0x601b('0x3c')]({},_0x1fa1b5,_0x526d6f[_0x601b('0x3f')]);var _0x4c98ea={'where':_0x1fa1b5['where']};return db['SmsQueueReport']['count'](_0x4c98ea)['then'](function(_0x2c0df5){_0x3b8313['count']=_0x2c0df5;if(_0x526d6f[_0x601b('0x31')][_0x601b('0x40')]){_0x1fa1b5['include']=[{'all':!![]}];}return db[_0x601b('0x2d')][_0x601b('0x41')](_0x1fa1b5);})[_0x601b('0x26')](function(_0x468f2e){_0x3b8313['rows']=_0x468f2e;return _0x3b8313;})[_0x601b('0x26')](respondWithFilteredResult(_0x3ec934,_0x1fa1b5))['catch'](handleError(_0x3ec934,null));};exports[_0x601b('0x42')]=function(_0x51f84e,_0x161dcc){var _0x30479d={'raw':!![],'where':{'id':_0x51f84e[_0x601b('0x43')]['id']}},_0x3b5e6c={};_0x3b5e6c[_0x601b('0x30')]=_['keys'](db[_0x601b('0x2d')][_0x601b('0x2e')]);_0x3b5e6c[_0x601b('0x31')]=_[_0x601b('0x44')](_0x51f84e[_0x601b('0x31')]);_0x3b5e6c['filters']=_['intersection'](_0x3b5e6c[_0x601b('0x30')],_0x3b5e6c['query']);_0x30479d[_0x601b('0x34')]=_[_0x601b('0x33')](_0x3b5e6c['model'],qs[_0x601b('0x35')](_0x51f84e['query']['fields']));_0x30479d[_0x601b('0x34')]=_0x30479d[_0x601b('0x34')][_0x601b('0x45')]?_0x30479d[_0x601b('0x34')]:_0x3b5e6c['model'];if(_0x51f84e[_0x601b('0x31')]['includeAll']){_0x30479d['include']=[{'all':!![]}];}_0x30479d=_[_0x601b('0x3c')]({},_0x30479d,_0x51f84e['options']);return db['SmsQueueReport'][_0x601b('0x46')](_0x30479d)[_0x601b('0x26')](handleEntityNotFound(_0x161dcc,null))['then'](respondWithResult(_0x161dcc,null))[_0x601b('0x47')](handleError(_0x161dcc,null));};exports[_0x601b('0x48')]=function(_0x574955,_0x2906c9){return db[_0x601b('0x2d')][_0x601b('0x48')](_0x574955['body'],{})[_0x601b('0x26')](respondWithResult(_0x2906c9,0xc9))[_0x601b('0x47')](handleError(_0x2906c9,null));};exports['update']=function(_0x44a0c8,_0x3bdfc7){if(_0x44a0c8[_0x601b('0x49')]['id']){delete _0x44a0c8['body']['id'];}return db[_0x601b('0x2d')][_0x601b('0x46')]({'where':{'id':_0x44a0c8[_0x601b('0x43')]['id']}})[_0x601b('0x26')](handleEntityNotFound(_0x3bdfc7,null))[_0x601b('0x26')](saveUpdates(_0x44a0c8[_0x601b('0x49')],null))['then'](respondWithResult(_0x3bdfc7,null))[_0x601b('0x47')](handleError(_0x3bdfc7,null));};exports[_0x601b('0x27')]=function(_0x303109,_0x21b378){return db[_0x601b('0x2d')][_0x601b('0x46')]({'where':{'id':_0x303109[_0x601b('0x43')]['id']}})[_0x601b('0x26')](handleEntityNotFound(_0x21b378,null))[_0x601b('0x26')](removeEntity(_0x21b378,null))['catch'](handleError(_0x21b378,null));};exports[_0x601b('0x4a')]=function(_0x4deeb8,_0xa78916){return db[_0x601b('0x2d')][_0x601b('0x4a')]()[_0x601b('0x26')](respondWithResult(_0xa78916,null))[_0x601b('0x47')](handleError(_0xa78916,null));}; \ No newline at end of file +var _0x6169=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','offset','limit','count','status','set','Content-Range','json','apply','reject','update','then','destroy','end','stack','name','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','order','sort','where','pick','type','merge','options','SmsQueueReport','includeAll','include','findAll','rows','catch','keys','length','find','create','body','params','describe','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0x5b1003,_0x4bfeb9){var _0x4a3ca8=function(_0x4f5bde){while(--_0x4f5bde){_0x5b1003['push'](_0x5b1003['shift']());}};_0x4a3ca8(++_0x4bfeb9);}(_0x6169,0x79));var _0x9616=function(_0x1f8935,_0x45a5c7){_0x1f8935=_0x1f8935-0x0;var _0x439176=_0x6169[_0x1f8935];return _0x439176;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9616('0x0'));var BPromise=require(_0x9616('0x1'));var Mustache=require(_0x9616('0x2'));var util=require(_0x9616('0x3'));var path=require(_0x9616('0x4'));var sox=require('sox');var csv=require(_0x9616('0x5'));var ejs=require(_0x9616('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9616('0x7'));var squel=require(_0x9616('0x8'));var crypto=require(_0x9616('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9616('0xa'));var toCsv=require(_0x9616('0x5'));var querystring=require(_0x9616('0xb'));var Papa=require(_0x9616('0xc'));var Redis=require(_0x9616('0xd'));var authService=require(_0x9616('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9616('0xf'))('api');var utils=require(_0x9616('0x10'));var config=require(_0x9616('0x11'));var licenseUtil=require(_0x9616('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449338,_0x14f4a9){_0x14f4a9=_0x14f4a9||0xcc;return function(_0x5d7830){if(_0x5d7830){return _0x449338['sendStatus'](_0x14f4a9);}return _0x449338['status'](_0x14f4a9)['end']();};}function respondWithResult(_0x204ef6,_0x41ef97){_0x41ef97=_0x41ef97||0xc8;return function(_0x995a5d){if(_0x995a5d){return _0x204ef6['status'](_0x41ef97)['json'](_0x995a5d);}};}function respondWithFilteredResult(_0x524440,_0x55a728){return function(_0x31b03b){if(_0x31b03b){var _0x19fdbb=typeof _0x55a728[_0x9616('0x13')]==='undefined'&&typeof _0x55a728[_0x9616('0x14')]==='undefined';var _0x1f673d=_0x31b03b[_0x9616('0x15')];var _0xbe2545=_0x19fdbb?0x0:_0x55a728[_0x9616('0x13')];var _0x5a6cfd=_0x19fdbb?_0x31b03b[_0x9616('0x15')]:_0x55a728[_0x9616('0x13')]+_0x55a728[_0x9616('0x14')];var _0x2b2feb;if(_0x5a6cfd>=_0x1f673d){_0x5a6cfd=_0x1f673d;_0x2b2feb=0xc8;}else{_0x2b2feb=0xce;}_0x524440[_0x9616('0x16')](_0x2b2feb);return _0x524440[_0x9616('0x17')](_0x9616('0x18'),_0xbe2545+'-'+_0x5a6cfd+'/'+_0x1f673d)[_0x9616('0x19')](_0x31b03b);}return null;};}function patchUpdates(_0x368838){return function(_0x2f706b){try{jsonpatch[_0x9616('0x1a')](_0x2f706b,_0x368838,!![]);}catch(_0x1325b6){return BPromise[_0x9616('0x1b')](_0x1325b6);}return _0x2f706b['save']();};}function saveUpdates(_0x5afdf1,_0x3d9d2d){return function(_0x36f1d0){if(_0x36f1d0){return _0x36f1d0[_0x9616('0x1c')](_0x5afdf1)[_0x9616('0x1d')](function(_0x16355f){return _0x16355f;});}return null;};}function removeEntity(_0x18f32,_0x1d08cf){return function(_0x2f421d){if(_0x2f421d){return _0x2f421d[_0x9616('0x1e')]()[_0x9616('0x1d')](function(){_0x18f32[_0x9616('0x16')](0xcc)[_0x9616('0x1f')]();});}};}function handleEntityNotFound(_0x15966e,_0x23d434){return function(_0x20325e){if(!_0x20325e){_0x15966e['sendStatus'](0x194);}return _0x20325e;};}function handleError(_0x43ba04,_0x425e27){_0x425e27=_0x425e27||0x1f4;return function(_0x2c6b3e){logger['error'](_0x2c6b3e[_0x9616('0x20')]);if(_0x2c6b3e[_0x9616('0x21')]){delete _0x2c6b3e[_0x9616('0x21')];}_0x43ba04[_0x9616('0x16')](_0x425e27)['send'](_0x2c6b3e);};}exports[_0x9616('0x22')]=function(_0x52ce82,_0x628ce7){var _0x36890b={},_0x6e0db6={},_0x484cd4={'count':0x0,'rows':[]};var _0x148cb1=_['map'](db['SmsQueueReport'][_0x9616('0x23')],function(_0x5104b9){return{'name':_0x5104b9[_0x9616('0x24')],'type':_0x5104b9['type'][_0x9616('0x25')]};});_0x6e0db6[_0x9616('0x26')]=_[_0x9616('0x27')](_0x148cb1,'name');_0x6e0db6['query']=_['keys'](_0x52ce82[_0x9616('0x28')]);_0x6e0db6[_0x9616('0x29')]=_[_0x9616('0x2a')](_0x6e0db6[_0x9616('0x26')],_0x6e0db6[_0x9616('0x28')]);_0x36890b[_0x9616('0x2b')]=_[_0x9616('0x2a')](_0x6e0db6[_0x9616('0x26')],qs[_0x9616('0x2c')](_0x52ce82[_0x9616('0x28')][_0x9616('0x2c')]));_0x36890b[_0x9616('0x2b')]=_0x36890b['attributes']['length']?_0x36890b[_0x9616('0x2b')]:_0x6e0db6[_0x9616('0x26')];if(!_0x52ce82[_0x9616('0x28')]['hasOwnProperty']('nolimit')){_0x36890b[_0x9616('0x14')]=qs[_0x9616('0x14')](_0x52ce82[_0x9616('0x28')][_0x9616('0x14')]);_0x36890b[_0x9616('0x13')]=qs[_0x9616('0x13')](_0x52ce82[_0x9616('0x28')][_0x9616('0x13')]);}_0x36890b[_0x9616('0x2d')]=qs[_0x9616('0x2e')](_0x52ce82[_0x9616('0x28')][_0x9616('0x2e')]);_0x36890b[_0x9616('0x2f')]=qs[_0x9616('0x29')](_[_0x9616('0x30')](_0x52ce82[_0x9616('0x28')],_0x6e0db6['filters']),_0x148cb1);if(_0x52ce82[_0x9616('0x28')]['filter']){_0x36890b['where']=_['merge'](_0x36890b[_0x9616('0x2f')],{'$or':_[_0x9616('0x27')](_0x148cb1,function(_0x1d784d){if(_0x1d784d[_0x9616('0x31')]!=='VIRTUAL'){var _0x5daee4={};_0x5daee4[_0x1d784d[_0x9616('0x21')]]={'$like':'%'+_0x52ce82[_0x9616('0x28')]['filter']+'%'};return _0x5daee4;}})});}_0x36890b=_[_0x9616('0x32')]({},_0x36890b,_0x52ce82[_0x9616('0x33')]);var _0x427059={'where':_0x36890b[_0x9616('0x2f')]};return db[_0x9616('0x34')]['count'](_0x427059)[_0x9616('0x1d')](function(_0x3833eb){_0x484cd4[_0x9616('0x15')]=_0x3833eb;if(_0x52ce82[_0x9616('0x28')][_0x9616('0x35')]){_0x36890b[_0x9616('0x36')]=[{'all':!![]}];}return db[_0x9616('0x34')][_0x9616('0x37')](_0x36890b);})[_0x9616('0x1d')](function(_0x38d627){_0x484cd4[_0x9616('0x38')]=_0x38d627;return _0x484cd4;})['then'](respondWithFilteredResult(_0x628ce7,_0x36890b))[_0x9616('0x39')](handleError(_0x628ce7,null));};exports['show']=function(_0x4d90b4,_0x3fc682){var _0x435bd0={'raw':!![],'where':{'id':_0x4d90b4['params']['id']}},_0x35e6ce={};_0x35e6ce[_0x9616('0x26')]=_[_0x9616('0x3a')](db[_0x9616('0x34')][_0x9616('0x23')]);_0x35e6ce[_0x9616('0x28')]=_[_0x9616('0x3a')](_0x4d90b4[_0x9616('0x28')]);_0x35e6ce['filters']=_[_0x9616('0x2a')](_0x35e6ce[_0x9616('0x26')],_0x35e6ce[_0x9616('0x28')]);_0x435bd0[_0x9616('0x2b')]=_[_0x9616('0x2a')](_0x35e6ce[_0x9616('0x26')],qs[_0x9616('0x2c')](_0x4d90b4[_0x9616('0x28')]['fields']));_0x435bd0[_0x9616('0x2b')]=_0x435bd0[_0x9616('0x2b')][_0x9616('0x3b')]?_0x435bd0[_0x9616('0x2b')]:_0x35e6ce[_0x9616('0x26')];if(_0x4d90b4[_0x9616('0x28')]['includeAll']){_0x435bd0[_0x9616('0x36')]=[{'all':!![]}];}_0x435bd0=_[_0x9616('0x32')]({},_0x435bd0,_0x4d90b4[_0x9616('0x33')]);return db[_0x9616('0x34')][_0x9616('0x3c')](_0x435bd0)[_0x9616('0x1d')](handleEntityNotFound(_0x3fc682,null))[_0x9616('0x1d')](respondWithResult(_0x3fc682,null))[_0x9616('0x39')](handleError(_0x3fc682,null));};exports[_0x9616('0x3d')]=function(_0x14eb79,_0x403d97){return db[_0x9616('0x34')]['create'](_0x14eb79['body'],{})[_0x9616('0x1d')](respondWithResult(_0x403d97,0xc9))['catch'](handleError(_0x403d97,null));};exports[_0x9616('0x1c')]=function(_0x7b334e,_0xe1c376){if(_0x7b334e[_0x9616('0x3e')]['id']){delete _0x7b334e[_0x9616('0x3e')]['id'];}return db[_0x9616('0x34')][_0x9616('0x3c')]({'where':{'id':_0x7b334e[_0x9616('0x3f')]['id']}})[_0x9616('0x1d')](handleEntityNotFound(_0xe1c376,null))['then'](saveUpdates(_0x7b334e[_0x9616('0x3e')],null))['then'](respondWithResult(_0xe1c376,null))[_0x9616('0x39')](handleError(_0xe1c376,null));};exports[_0x9616('0x1e')]=function(_0x24574b,_0x526402){return db[_0x9616('0x34')][_0x9616('0x3c')]({'where':{'id':_0x24574b[_0x9616('0x3f')]['id']}})[_0x9616('0x1d')](handleEntityNotFound(_0x526402,null))[_0x9616('0x1d')](removeEntity(_0x526402,null))['catch'](handleError(_0x526402,null));};exports[_0x9616('0x40')]=function(_0x4bf88a,_0x102ca8){return db[_0x9616('0x34')][_0x9616('0x40')]()[_0x9616('0x1d')](respondWithResult(_0x102ca8,null))[_0x9616('0x39')](handleError(_0x102ca8,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 5784170..c9d419b 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ae98e,_0x48c27f){var _0xe5a8dd=function(_0x30f8fb){while(--_0x30f8fb){_0x3ae98e['push'](_0x3ae98e['shift']());}};_0xe5a8dd(++_0x48c27f);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x432291,_0x283269){var _0xec2018=function(_0x11d4d3){while(--_0x11d4d3){_0x432291['push'](_0x432291['shift']());}};_0xec2018(++_0x283269);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index eb6dd5e..f6bb7dc 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 _0x9fbf=['then','debug','UpdateSmsQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw'];(function(_0x2c5d61,_0x36617f){var _0x4912ec=function(_0x5718c5){while(--_0x5718c5){_0x2c5d61['push'](_0x2c5d61['shift']());}};_0x4912ec(++_0x36617f);}(_0x9fbf,0x1f4));var _0xf9fb=function(_0x5f1aea,_0x1bc2b5){_0x5f1aea=_0x5f1aea-0x0;var _0x4e3585=_0x9fbf[_0x5f1aea];return _0x4e3585;};'use strict';var _=require(_0xf9fb('0x0'));var util=require(_0xf9fb('0x1'));var moment=require(_0xf9fb('0x2'));var BPromise=require(_0xf9fb('0x3'));var rs=require(_0xf9fb('0x4'));var fs=require('fs');var Redis=require(_0xf9fb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9fb('0x6'))(_0xf9fb('0x7'));var config=require(_0xf9fb('0x8'));var jayson=require(_0xf9fb('0x9'));var client=jayson[_0xf9fb('0xa')][_0xf9fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a7788,_0x25a4f5,_0x1621ee){return new BPromise(function(_0x4e4499,_0x18aa75){return client[_0xf9fb('0xc')](_0x1a7788,_0x1621ee)['then'](function(_0x4bb68b){logger[_0xf9fb('0xd')](_0xf9fb('0xe'),_0x25a4f5,_0xf9fb('0xf'));logger['debug'](_0xf9fb('0x10'),_0x25a4f5,'request\x20sent',JSON[_0xf9fb('0x11')](_0x4bb68b));if(_0x4bb68b['error']){if(_0x4bb68b[_0xf9fb('0x12')]['code']===0x1f4){logger[_0xf9fb('0x12')](_0xf9fb('0xe'),_0x25a4f5,_0x4bb68b['error'][_0xf9fb('0x13')]);return _0x18aa75(_0x4bb68b[_0xf9fb('0x12')][_0xf9fb('0x13')]);}logger[_0xf9fb('0x12')](_0xf9fb('0xe'),_0x25a4f5,_0x4bb68b[_0xf9fb('0x12')]['message']);return _0x4e4499(_0x4bb68b[_0xf9fb('0x12')][_0xf9fb('0x13')]);}else{logger[_0xf9fb('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x25a4f5,'request\x20sent');_0x4e4499(_0x4bb68b[_0xf9fb('0x14')][_0xf9fb('0x13')]);}})[_0xf9fb('0x15')](function(_0x2869d4){logger[_0xf9fb('0x12')](_0xf9fb('0xe'),_0x25a4f5,_0x2869d4);_0x18aa75(_0x2869d4);});});}exports[_0xf9fb('0x16')]=function(_0x33b3c3){var _0xf2b5f5=this;return new Promise(function(_0x49fd0f,_0x39ba62){return db[_0xf9fb('0x17')][_0xf9fb('0x18')](_0x33b3c3[_0xf9fb('0x19')],{'raw':_0x33b3c3['options']?_0x33b3c3[_0xf9fb('0x1a')][_0xf9fb('0x1b')]===undefined?!![]:![]:!![]})[_0xf9fb('0x1c')](function(_0x3098c3){logger[_0xf9fb('0xd')](_0xf9fb('0x16'),_0x33b3c3);logger[_0xf9fb('0x1d')](_0xf9fb('0x16'),_0x33b3c3,JSON[_0xf9fb('0x11')](_0x3098c3));_0x49fd0f(_0x3098c3);})[_0xf9fb('0x15')](function(_0x131e47){logger['error'](_0xf9fb('0x16'),_0x131e47[_0xf9fb('0x13')],_0x33b3c3);_0x39ba62(_0xf2b5f5[_0xf9fb('0x12')](0x1f4,_0x131e47['message']));});});};exports[_0xf9fb('0x1e')]=function(_0x3eeacd){var _0x22f6c4=this;return new Promise(function(_0x1d9386,_0x2bf1e9){return db[_0xf9fb('0x17')]['update'](_0x3eeacd[_0xf9fb('0x19')],{'raw':_0x3eeacd[_0xf9fb('0x1a')]?_0x3eeacd[_0xf9fb('0x1a')][_0xf9fb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eeacd[_0xf9fb('0x1a')]?_0x3eeacd[_0xf9fb('0x1a')]['where']||null:null,'attributes':_0x3eeacd['options']?_0x3eeacd[_0xf9fb('0x1a')][_0xf9fb('0x1f')]||null:null,'limit':_0x3eeacd[_0xf9fb('0x1a')]?_0x3eeacd[_0xf9fb('0x1a')][_0xf9fb('0x20')]||null:null})[_0xf9fb('0x1c')](function(_0x5644ab){logger[_0xf9fb('0xd')](_0xf9fb('0x1e'),_0x3eeacd);logger[_0xf9fb('0x1d')](_0xf9fb('0x1e'),_0x3eeacd,JSON['stringify'](_0x5644ab));_0x1d9386(_0x5644ab);})[_0xf9fb('0x15')](function(_0x43cef2){logger[_0xf9fb('0x12')](_0xf9fb('0x1e'),_0x43cef2[_0xf9fb('0x13')],_0x3eeacd);_0x2bf1e9(_0x22f6c4[_0xf9fb('0x12')](0x1f4,_0x43cef2[_0xf9fb('0x13')]));});});}; \ No newline at end of file +var _0x827a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','UpdateSmsQueueReport','SmsQueueReport','raw','limit','lodash','moment'];(function(_0x279b79,_0x378069){var _0x1ddaba=function(_0x21c66f){while(--_0x21c66f){_0x279b79['push'](_0x279b79['shift']());}};_0x1ddaba(++_0x378069);}(_0x827a,0xb8));var _0xa827=function(_0x1ab466,_0x59ee18){_0x1ab466=_0x1ab466-0x0;var _0x406801=_0x827a[_0x1ab466];return _0x406801;};'use strict';var _=require(_0xa827('0x0'));var util=require('util');var moment=require(_0xa827('0x1'));var BPromise=require(_0xa827('0x2'));var rs=require(_0xa827('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa827('0x4'))['db'];var utils=require(_0xa827('0x5'));var logger=require(_0xa827('0x6'))(_0xa827('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa827('0x8')][_0xa827('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x452349,_0x59d69f,_0x3a2be7){return new BPromise(function(_0x1495c3,_0xd679a){return client[_0xa827('0xa')](_0x452349,_0x3a2be7)[_0xa827('0xb')](function(_0x3fb062){logger[_0xa827('0xc')](_0xa827('0xd'),_0x59d69f,_0xa827('0xe'));logger[_0xa827('0xf')](_0xa827('0x10'),_0x59d69f,_0xa827('0xe'),JSON[_0xa827('0x11')](_0x3fb062));if(_0x3fb062[_0xa827('0x12')]){if(_0x3fb062[_0xa827('0x12')][_0xa827('0x13')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x59d69f,_0x3fb062['error'][_0xa827('0x14')]);return _0xd679a(_0x3fb062[_0xa827('0x12')]['message']);}logger['error'](_0xa827('0xd'),_0x59d69f,_0x3fb062[_0xa827('0x12')][_0xa827('0x14')]);return _0x1495c3(_0x3fb062['error']['message']);}else{logger[_0xa827('0xc')](_0xa827('0xd'),_0x59d69f,'request\x20sent');_0x1495c3(_0x3fb062[_0xa827('0x15')]['message']);}})[_0xa827('0x16')](function(_0x5ebd2c){logger[_0xa827('0x12')](_0xa827('0xd'),_0x59d69f,_0x5ebd2c);_0xd679a(_0x5ebd2c);});});}exports[_0xa827('0x17')]=function(_0x513af9){var _0x359223=this;return new Promise(function(_0x587d51,_0xde06c0){return db['SmsQueueReport'][_0xa827('0x18')](_0x513af9[_0xa827('0x19')],{'raw':_0x513af9['options']?_0x513af9[_0xa827('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xa827('0xb')](function(_0x1a3b95){logger[_0xa827('0xc')](_0xa827('0x17'),_0x513af9);logger['debug'](_0xa827('0x17'),_0x513af9,JSON[_0xa827('0x11')](_0x1a3b95));_0x587d51(_0x1a3b95);})[_0xa827('0x16')](function(_0x28745c){logger[_0xa827('0x12')]('CreateSmsQueueReport',_0x28745c[_0xa827('0x14')],_0x513af9);_0xde06c0(_0x359223['error'](0x1f4,_0x28745c[_0xa827('0x14')]));});});};exports[_0xa827('0x1b')]=function(_0x5c52ac){var _0x4515f1=this;return new Promise(function(_0x4f7eb8,_0xad35e9){return db[_0xa827('0x1c')]['update'](_0x5c52ac[_0xa827('0x19')],{'raw':_0x5c52ac[_0xa827('0x1a')]?_0x5c52ac[_0xa827('0x1a')][_0xa827('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c52ac['options']?_0x5c52ac[_0xa827('0x1a')]['where']||null:null,'attributes':_0x5c52ac['options']?_0x5c52ac['options']['attributes']||null:null,'limit':_0x5c52ac['options']?_0x5c52ac['options'][_0xa827('0x1e')]||null:null})['then'](function(_0x5d874e){logger[_0xa827('0xc')]('UpdateSmsQueueReport',_0x5c52ac);logger['debug'](_0xa827('0x1b'),_0x5c52ac,JSON[_0xa827('0x11')](_0x5d874e));_0x4f7eb8(_0x5d874e);})[_0xa827('0x16')](function(_0x3e166b){logger['error']('UpdateSmsQueueReport',_0x3e166b[_0xa827('0x14')],_0x5c52ac);_0xad35e9(_0x4515f1[_0xa827('0x12')](0x1f4,_0x3e166b[_0xa827('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 193a48c..6090a2f 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 _0x2d17=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','update','delete'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2d17,0x17e));var _0x72d1=function(_0x1b9cc0,_0x4256ea){_0x1b9cc0=_0x1b9cc0-0x0;var _0x19c7dc=_0x2d17[_0x1b9cc0];return _0x19c7dc;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./smsTransferReport.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/describe',auth[_0x72d1('0x9')](),controller[_0x72d1('0xa')]);router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x9')](),controller[_0x72d1('0xb')]);router[_0x72d1('0xc')]('/',auth['isAuthenticated'](),controller[_0x72d1('0xd')]);router[_0x72d1('0xe')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x11')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x12')]);module[_0x72d1('0x13')]=router; \ No newline at end of file +var _0xf8b2=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x4f2023,_0x3cfb01){_0x4f2023=_0x4f2023-0x0;var _0x58e5f8=_0xf8b2[_0x4f2023];return _0x58e5f8;};'use strict';var multer=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var path=require(_0x2f8b('0x2'));var timeout=require(_0x2f8b('0x3'));var express=require(_0x2f8b('0x4'));var router=express[_0x2f8b('0x5')]();var fs_extra=require(_0x2f8b('0x6'));var auth=require(_0x2f8b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f8b('0x8'));router[_0x2f8b('0x9')]('/',auth[_0x2f8b('0xa')](),controller[_0x2f8b('0xb')]);router[_0x2f8b('0x9')](_0x2f8b('0xc'),auth[_0x2f8b('0xa')](),controller[_0x2f8b('0xd')]);router[_0x2f8b('0x9')]('/:id',auth[_0x2f8b('0xa')](),controller[_0x2f8b('0xe')]);router[_0x2f8b('0xf')]('/',auth['isAuthenticated'](),controller[_0x2f8b('0x10')]);router[_0x2f8b('0x11')](_0x2f8b('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x2f8b('0x13')](_0x2f8b('0x12'),auth[_0x2f8b('0xa')](),controller[_0x2f8b('0x14')]);module[_0x2f8b('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 62efbdf..4f2f9dd 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x3e3f94,_0x27528b){var _0x5548bb=function(_0x272be9){while(--_0x272be9){_0x3e3f94['push'](_0x3e3f94['shift']());}};_0x5548bb(++_0x27528b);}(_0x54ef,0x112));var _0xf54e=function(_0x479b58,_0x27f309){_0x479b58=_0x479b58-0x0;var _0x462093=_0x54ef[_0x479b58];return _0x462093;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x4434d6,_0x62fbc0){var _0x39b89c=function(_0x1b1d3b){while(--_0x1b1d3b){_0x4434d6['push'](_0x4434d6['shift']());}};_0x39b89c(++_0x62fbc0);}(_0xe706,0xa3));var _0x6e70=function(_0x36153d,_0x4fed67){_0x36153d=_0x36153d-0x0;var _0xfdacff=_0xe706[_0x36153d];return _0xfdacff;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 0b26bbd..195d044 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 _0xbac7=['reject','save','update','then','destroy','stack','name','send','SmsTransferReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','include','findAll','catch','show','attributes','includeAll','options','create','body','params','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','set','json'];(function(_0x1952f8,_0x1c1925){var _0x5a2775=function(_0x398919){while(--_0x398919){_0x1952f8['push'](_0x1952f8['shift']());}};_0x5a2775(++_0x1c1925);}(_0xbac7,0x1ab));var _0x7bac=function(_0xfb45c,_0x4dbf35){_0xfb45c=_0xfb45c-0x0;var _0x525020=_0xbac7[_0xfb45c];return _0x525020;};'use strict';var emlformat=require(_0x7bac('0x0'));var rimraf=require(_0x7bac('0x1'));var zipdir=require(_0x7bac('0x2'));var jsonpatch=require(_0x7bac('0x3'));var rp=require(_0x7bac('0x4'));var moment=require(_0x7bac('0x5'));var BPromise=require(_0x7bac('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7bac('0x7'));var sox=require(_0x7bac('0x8'));var csv=require(_0x7bac('0x9'));var ejs=require(_0x7bac('0xa'));var fs=require('fs');var fs_extra=require(_0x7bac('0xb'));var _=require('lodash');var squel=require(_0x7bac('0xc'));var crypto=require(_0x7bac('0xd'));var jsforce=require(_0x7bac('0xe'));var deskjs=require(_0x7bac('0xf'));var toCsv=require(_0x7bac('0x9'));var querystring=require(_0x7bac('0x10'));var Papa=require(_0x7bac('0x11'));var Redis=require(_0x7bac('0x12'));var authService=require(_0x7bac('0x13'));var qs=require(_0x7bac('0x14'));var as=require(_0x7bac('0x15'));var hardwareService=require(_0x7bac('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x7bac('0x17'));var config=require(_0x7bac('0x18'));var licenseUtil=require(_0x7bac('0x19'));var db=require(_0x7bac('0x1a'))['db'];function respondWithStatusCode(_0x31e43b,_0x29070b){_0x29070b=_0x29070b||0xcc;return function(_0x1cdbeb){if(_0x1cdbeb){return _0x31e43b['sendStatus'](_0x29070b);}return _0x31e43b[_0x7bac('0x1b')](_0x29070b)[_0x7bac('0x1c')]();};}function respondWithResult(_0x151841,_0x58f840){_0x58f840=_0x58f840||0xc8;return function(_0x32436b){if(_0x32436b){return _0x151841[_0x7bac('0x1b')](_0x58f840)['json'](_0x32436b);}};}function respondWithFilteredResult(_0xe67a13,_0x554150){return function(_0x367ae7){if(_0x367ae7){var _0x388ce4=typeof _0x554150['offset']==='undefined'&&typeof _0x554150[_0x7bac('0x1d')]===_0x7bac('0x1e');var _0x14d7bc=_0x367ae7[_0x7bac('0x1f')];var _0x8d4376=_0x388ce4?0x0:_0x554150[_0x7bac('0x20')];var _0x37e005=_0x388ce4?_0x367ae7[_0x7bac('0x1f')]:_0x554150[_0x7bac('0x20')]+_0x554150['limit'];var _0x4b9092;if(_0x37e005>=_0x14d7bc){_0x37e005=_0x14d7bc;_0x4b9092=0xc8;}else{_0x4b9092=0xce;}_0xe67a13[_0x7bac('0x1b')](_0x4b9092);return _0xe67a13[_0x7bac('0x21')]('Content-Range',_0x8d4376+'-'+_0x37e005+'/'+_0x14d7bc)[_0x7bac('0x22')](_0x367ae7);}return null;};}function patchUpdates(_0x3ff6f3){return function(_0xa032f1){try{jsonpatch['apply'](_0xa032f1,_0x3ff6f3,!![]);}catch(_0x3cd816){return BPromise[_0x7bac('0x23')](_0x3cd816);}return _0xa032f1[_0x7bac('0x24')]();};}function saveUpdates(_0x5ee513,_0x574aec){return function(_0x4d747b){if(_0x4d747b){return _0x4d747b[_0x7bac('0x25')](_0x5ee513)[_0x7bac('0x26')](function(_0x107c30){return _0x107c30;});}return null;};}function removeEntity(_0x570356,_0x14fb4f){return function(_0x20a17b){if(_0x20a17b){return _0x20a17b[_0x7bac('0x27')]()[_0x7bac('0x26')](function(){_0x570356['status'](0xcc)[_0x7bac('0x1c')]();});}};}function handleEntityNotFound(_0x4a3e31,_0x114fa0){return function(_0x1fbd4d){if(!_0x1fbd4d){_0x4a3e31['sendStatus'](0x194);}return _0x1fbd4d;};}function handleError(_0xa3a2ca,_0x26b316){_0x26b316=_0x26b316||0x1f4;return function(_0x399fce){logger['error'](_0x399fce[_0x7bac('0x28')]);if(_0x399fce['name']){delete _0x399fce[_0x7bac('0x29')];}_0xa3a2ca[_0x7bac('0x1b')](_0x26b316)[_0x7bac('0x2a')](_0x399fce);};}exports['index']=function(_0x232394,_0x46d7c4){var _0x5ed09f={},_0x3c87f1={},_0x23263a={'count':0x0,'rows':[]};var _0x1948f=_['map'](db[_0x7bac('0x2b')][_0x7bac('0x2c')],function(_0x3edf5a){return{'name':_0x3edf5a[_0x7bac('0x2d')],'type':_0x3edf5a['type'][_0x7bac('0x2e')]};});_0x3c87f1[_0x7bac('0x2f')]=_[_0x7bac('0x30')](_0x1948f,_0x7bac('0x29'));_0x3c87f1['query']=_[_0x7bac('0x31')](_0x232394[_0x7bac('0x32')]);_0x3c87f1[_0x7bac('0x33')]=_[_0x7bac('0x34')](_0x3c87f1[_0x7bac('0x2f')],_0x3c87f1[_0x7bac('0x32')]);_0x5ed09f['attributes']=_[_0x7bac('0x34')](_0x3c87f1[_0x7bac('0x2f')],qs[_0x7bac('0x35')](_0x232394[_0x7bac('0x32')][_0x7bac('0x35')]));_0x5ed09f['attributes']=_0x5ed09f['attributes'][_0x7bac('0x36')]?_0x5ed09f['attributes']:_0x3c87f1[_0x7bac('0x2f')];if(!_0x232394[_0x7bac('0x32')][_0x7bac('0x37')](_0x7bac('0x38'))){_0x5ed09f[_0x7bac('0x1d')]=qs[_0x7bac('0x1d')](_0x232394[_0x7bac('0x32')][_0x7bac('0x1d')]);_0x5ed09f[_0x7bac('0x20')]=qs[_0x7bac('0x20')](_0x232394['query'][_0x7bac('0x20')]);}_0x5ed09f[_0x7bac('0x39')]=qs[_0x7bac('0x3a')](_0x232394[_0x7bac('0x32')][_0x7bac('0x3a')]);_0x5ed09f[_0x7bac('0x3b')]=qs[_0x7bac('0x33')](_[_0x7bac('0x3c')](_0x232394[_0x7bac('0x32')],_0x3c87f1['filters']),_0x1948f);if(_0x232394[_0x7bac('0x32')][_0x7bac('0x3d')]){_0x5ed09f['where']=_['merge'](_0x5ed09f['where'],{'$or':_[_0x7bac('0x30')](_0x1948f,function(_0x17f239){if(_0x17f239[_0x7bac('0x3e')]!==_0x7bac('0x3f')){var _0x2484c0={};_0x2484c0[_0x17f239[_0x7bac('0x29')]]={'$like':'%'+_0x232394[_0x7bac('0x32')][_0x7bac('0x3d')]+'%'};return _0x2484c0;}})});}_0x5ed09f=_[_0x7bac('0x40')]({},_0x5ed09f,_0x232394['options']);var _0x59ceda={'where':_0x5ed09f[_0x7bac('0x3b')]};return db[_0x7bac('0x2b')][_0x7bac('0x1f')](_0x59ceda)['then'](function(_0x43bc9f){_0x23263a[_0x7bac('0x1f')]=_0x43bc9f;if(_0x232394['query']['includeAll']){_0x5ed09f[_0x7bac('0x41')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x7bac('0x42')](_0x5ed09f);})[_0x7bac('0x26')](function(_0x39b937){_0x23263a['rows']=_0x39b937;return _0x23263a;})[_0x7bac('0x26')](respondWithFilteredResult(_0x46d7c4,_0x5ed09f))[_0x7bac('0x43')](handleError(_0x46d7c4,null));};exports[_0x7bac('0x44')]=function(_0x1c0775,_0x4608fb){var _0x3552d5={'raw':!![],'where':{'id':_0x1c0775['params']['id']}},_0x4e50d9={};_0x4e50d9[_0x7bac('0x2f')]=_['keys'](db[_0x7bac('0x2b')][_0x7bac('0x2c')]);_0x4e50d9[_0x7bac('0x32')]=_[_0x7bac('0x31')](_0x1c0775[_0x7bac('0x32')]);_0x4e50d9[_0x7bac('0x33')]=_['intersection'](_0x4e50d9[_0x7bac('0x2f')],_0x4e50d9[_0x7bac('0x32')]);_0x3552d5[_0x7bac('0x45')]=_[_0x7bac('0x34')](_0x4e50d9[_0x7bac('0x2f')],qs['fields'](_0x1c0775['query'][_0x7bac('0x35')]));_0x3552d5[_0x7bac('0x45')]=_0x3552d5['attributes']['length']?_0x3552d5[_0x7bac('0x45')]:_0x4e50d9[_0x7bac('0x2f')];if(_0x1c0775['query'][_0x7bac('0x46')]){_0x3552d5[_0x7bac('0x41')]=[{'all':!![]}];}_0x3552d5=_[_0x7bac('0x40')]({},_0x3552d5,_0x1c0775[_0x7bac('0x47')]);return db[_0x7bac('0x2b')]['find'](_0x3552d5)['then'](handleEntityNotFound(_0x4608fb,null))[_0x7bac('0x26')](respondWithResult(_0x4608fb,null))[_0x7bac('0x43')](handleError(_0x4608fb,null));};exports[_0x7bac('0x48')]=function(_0x16f127,_0x387348){return db[_0x7bac('0x2b')][_0x7bac('0x48')](_0x16f127['body'],{})[_0x7bac('0x26')](respondWithResult(_0x387348,0xc9))[_0x7bac('0x43')](handleError(_0x387348,null));};exports[_0x7bac('0x25')]=function(_0x546bfc,_0x413617){if(_0x546bfc[_0x7bac('0x49')]['id']){delete _0x546bfc['body']['id'];}return db[_0x7bac('0x2b')]['find']({'where':{'id':_0x546bfc[_0x7bac('0x4a')]['id']}})[_0x7bac('0x26')](handleEntityNotFound(_0x413617,null))['then'](saveUpdates(_0x546bfc[_0x7bac('0x49')],null))[_0x7bac('0x26')](respondWithResult(_0x413617,null))[_0x7bac('0x43')](handleError(_0x413617,null));};exports[_0x7bac('0x27')]=function(_0x2cd98d,_0x42ad41){return db[_0x7bac('0x2b')][_0x7bac('0x4b')]({'where':{'id':_0x2cd98d['params']['id']}})[_0x7bac('0x26')](handleEntityNotFound(_0x42ad41,null))[_0x7bac('0x26')](removeEntity(_0x42ad41,null))[_0x7bac('0x43')](handleError(_0x42ad41,null));};exports['describe']=function(_0x376983,_0x5776e4){return db['SmsTransferReport'][_0x7bac('0x4c')]()['then'](respondWithResult(_0x5776e4,null))[_0x7bac('0x43')](handleError(_0x5776e4,null));}; \ No newline at end of file +var _0x7770=['catch','show','params','keys','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','status','end','stack','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','type','filter','options','SmsTransferReport','include','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7770,0xe1));var _0x0777=function(_0xb0725b,_0x23e17b){_0xb0725b=_0xb0725b-0x0;var _0x4267b9=_0x7770[_0xb0725b];return _0x4267b9;};'use strict';var emlformat=require(_0x0777('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0777('0x1'));var jsonpatch=require(_0x0777('0x2'));var rp=require('request-promise');var moment=require(_0x0777('0x3'));var BPromise=require(_0x0777('0x4'));var Mustache=require(_0x0777('0x5'));var util=require(_0x0777('0x6'));var path=require(_0x0777('0x7'));var sox=require('sox');var csv=require(_0x0777('0x8'));var ejs=require(_0x0777('0x9'));var fs=require('fs');var fs_extra=require(_0x0777('0xa'));var _=require('lodash');var squel=require(_0x0777('0xb'));var crypto=require(_0x0777('0xc'));var jsforce=require(_0x0777('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0777('0x8'));var querystring=require('querystring');var Papa=require(_0x0777('0xe'));var Redis=require('ioredis');var authService=require(_0x0777('0xf'));var qs=require(_0x0777('0x10'));var as=require(_0x0777('0x11'));var hardwareService=require(_0x0777('0x12'));var logger=require(_0x0777('0x13'))(_0x0777('0x14'));var utils=require('../../config/utils');var config=require(_0x0777('0x15'));var licenseUtil=require(_0x0777('0x16'));var db=require(_0x0777('0x17'))['db'];function respondWithStatusCode(_0x4afbb3,_0x2c026c){_0x2c026c=_0x2c026c||0xcc;return function(_0x199816){if(_0x199816){return _0x4afbb3[_0x0777('0x18')](_0x2c026c);}return _0x4afbb3['status'](_0x2c026c)['end']();};}function respondWithResult(_0x1431d3,_0x299831){_0x299831=_0x299831||0xc8;return function(_0x1e80cb){if(_0x1e80cb){return _0x1431d3['status'](_0x299831)[_0x0777('0x19')](_0x1e80cb);}};}function respondWithFilteredResult(_0x29f529,_0x198c79){return function(_0x51c844){if(_0x51c844){var _0x275dd0=typeof _0x198c79['offset']==='undefined'&&typeof _0x198c79[_0x0777('0x1a')]==='undefined';var _0x576e84=_0x51c844[_0x0777('0x1b')];var _0xa828d3=_0x275dd0?0x0:_0x198c79['offset'];var _0x254ce9=_0x275dd0?_0x51c844[_0x0777('0x1b')]:_0x198c79[_0x0777('0x1c')]+_0x198c79['limit'];var _0x460c38;if(_0x254ce9>=_0x576e84){_0x254ce9=_0x576e84;_0x460c38=0xc8;}else{_0x460c38=0xce;}_0x29f529['status'](_0x460c38);return _0x29f529[_0x0777('0x1d')](_0x0777('0x1e'),_0xa828d3+'-'+_0x254ce9+'/'+_0x576e84)[_0x0777('0x19')](_0x51c844);}return null;};}function patchUpdates(_0x171967){return function(_0xdc7743){try{jsonpatch['apply'](_0xdc7743,_0x171967,!![]);}catch(_0x1c58c3){return BPromise[_0x0777('0x1f')](_0x1c58c3);}return _0xdc7743[_0x0777('0x20')]();};}function saveUpdates(_0x4625f0,_0x119121){return function(_0x4a1126){if(_0x4a1126){return _0x4a1126[_0x0777('0x21')](_0x4625f0)[_0x0777('0x22')](function(_0x63e3b6){return _0x63e3b6;});}return null;};}function removeEntity(_0x4b05a1,_0x7c8d08){return function(_0x42cbe7){if(_0x42cbe7){return _0x42cbe7[_0x0777('0x23')]()[_0x0777('0x22')](function(){_0x4b05a1[_0x0777('0x24')](0xcc)[_0x0777('0x25')]();});}};}function handleEntityNotFound(_0x4e7f4e,_0x2ab1df){return function(_0x8b4045){if(!_0x8b4045){_0x4e7f4e['sendStatus'](0x194);}return _0x8b4045;};}function handleError(_0x3ac842,_0x334a73){_0x334a73=_0x334a73||0x1f4;return function(_0x22cf68){logger['error'](_0x22cf68[_0x0777('0x26')]);if(_0x22cf68[_0x0777('0x27')]){delete _0x22cf68[_0x0777('0x27')];}_0x3ac842[_0x0777('0x24')](_0x334a73)[_0x0777('0x28')](_0x22cf68);};}exports[_0x0777('0x29')]=function(_0x34bf4e,_0x178904){var _0x44ccf3={},_0xb7e14e={},_0x3c7be7={'count':0x0,'rows':[]};var _0x3eb987=_[_0x0777('0x2a')](db['SmsTransferReport'][_0x0777('0x2b')],function(_0x20b547){return{'name':_0x20b547['fieldName'],'type':_0x20b547['type'][_0x0777('0x2c')]};});_0xb7e14e[_0x0777('0x2d')]=_[_0x0777('0x2a')](_0x3eb987,'name');_0xb7e14e[_0x0777('0x2e')]=_['keys'](_0x34bf4e[_0x0777('0x2e')]);_0xb7e14e[_0x0777('0x2f')]=_[_0x0777('0x30')](_0xb7e14e[_0x0777('0x2d')],_0xb7e14e['query']);_0x44ccf3[_0x0777('0x31')]=_[_0x0777('0x30')](_0xb7e14e['model'],qs[_0x0777('0x32')](_0x34bf4e[_0x0777('0x2e')][_0x0777('0x32')]));_0x44ccf3[_0x0777('0x31')]=_0x44ccf3[_0x0777('0x31')]['length']?_0x44ccf3[_0x0777('0x31')]:_0xb7e14e[_0x0777('0x2d')];if(!_0x34bf4e['query']['hasOwnProperty'](_0x0777('0x33'))){_0x44ccf3['limit']=qs['limit'](_0x34bf4e[_0x0777('0x2e')]['limit']);_0x44ccf3[_0x0777('0x1c')]=qs['offset'](_0x34bf4e[_0x0777('0x2e')][_0x0777('0x1c')]);}_0x44ccf3[_0x0777('0x34')]=qs[_0x0777('0x35')](_0x34bf4e[_0x0777('0x2e')][_0x0777('0x35')]);_0x44ccf3[_0x0777('0x36')]=qs[_0x0777('0x2f')](_['pick'](_0x34bf4e[_0x0777('0x2e')],_0xb7e14e[_0x0777('0x2f')]),_0x3eb987);if(_0x34bf4e[_0x0777('0x2e')]['filter']){_0x44ccf3[_0x0777('0x36')]=_[_0x0777('0x37')](_0x44ccf3[_0x0777('0x36')],{'$or':_[_0x0777('0x2a')](_0x3eb987,function(_0x498754){if(_0x498754[_0x0777('0x38')]!=='VIRTUAL'){var _0x278cd9={};_0x278cd9[_0x498754['name']]={'$like':'%'+_0x34bf4e[_0x0777('0x2e')][_0x0777('0x39')]+'%'};return _0x278cd9;}})});}_0x44ccf3=_[_0x0777('0x37')]({},_0x44ccf3,_0x34bf4e[_0x0777('0x3a')]);var _0x1eb43e={'where':_0x44ccf3['where']};return db[_0x0777('0x3b')][_0x0777('0x1b')](_0x1eb43e)['then'](function(_0x32a032){_0x3c7be7[_0x0777('0x1b')]=_0x32a032;if(_0x34bf4e['query']['includeAll']){_0x44ccf3[_0x0777('0x3c')]=[{'all':!![]}];}return db[_0x0777('0x3b')][_0x0777('0x3d')](_0x44ccf3);})[_0x0777('0x22')](function(_0x3e8256){_0x3c7be7[_0x0777('0x3e')]=_0x3e8256;return _0x3c7be7;})['then'](respondWithFilteredResult(_0x178904,_0x44ccf3))[_0x0777('0x3f')](handleError(_0x178904,null));};exports[_0x0777('0x40')]=function(_0x39c3b3,_0x2c9156){var _0x1055e8={'raw':!![],'where':{'id':_0x39c3b3[_0x0777('0x41')]['id']}},_0x5e9c61={};_0x5e9c61['model']=_[_0x0777('0x42')](db['SmsTransferReport']['rawAttributes']);_0x5e9c61[_0x0777('0x2e')]=_[_0x0777('0x42')](_0x39c3b3['query']);_0x5e9c61[_0x0777('0x2f')]=_['intersection'](_0x5e9c61['model'],_0x5e9c61['query']);_0x1055e8[_0x0777('0x31')]=_[_0x0777('0x30')](_0x5e9c61['model'],qs[_0x0777('0x32')](_0x39c3b3[_0x0777('0x2e')][_0x0777('0x32')]));_0x1055e8[_0x0777('0x31')]=_0x1055e8[_0x0777('0x31')]['length']?_0x1055e8[_0x0777('0x31')]:_0x5e9c61['model'];if(_0x39c3b3[_0x0777('0x2e')][_0x0777('0x43')]){_0x1055e8[_0x0777('0x3c')]=[{'all':!![]}];}_0x1055e8=_[_0x0777('0x37')]({},_0x1055e8,_0x39c3b3['options']);return db['SmsTransferReport'][_0x0777('0x44')](_0x1055e8)[_0x0777('0x22')](handleEntityNotFound(_0x2c9156,null))[_0x0777('0x22')](respondWithResult(_0x2c9156,null))['catch'](handleError(_0x2c9156,null));};exports['create']=function(_0x298e80,_0x59fcdc){return db['SmsTransferReport'][_0x0777('0x45')](_0x298e80['body'],{})[_0x0777('0x22')](respondWithResult(_0x59fcdc,0xc9))[_0x0777('0x3f')](handleError(_0x59fcdc,null));};exports[_0x0777('0x21')]=function(_0x245889,_0x593994){if(_0x245889['body']['id']){delete _0x245889[_0x0777('0x46')]['id'];}return db['SmsTransferReport'][_0x0777('0x44')]({'where':{'id':_0x245889[_0x0777('0x41')]['id']}})[_0x0777('0x22')](handleEntityNotFound(_0x593994,null))[_0x0777('0x22')](saveUpdates(_0x245889[_0x0777('0x46')],null))[_0x0777('0x22')](respondWithResult(_0x593994,null))[_0x0777('0x3f')](handleError(_0x593994,null));};exports[_0x0777('0x23')]=function(_0x3bbe8a,_0x205419){return db[_0x0777('0x3b')][_0x0777('0x44')]({'where':{'id':_0x3bbe8a['params']['id']}})[_0x0777('0x22')](handleEntityNotFound(_0x205419,null))[_0x0777('0x22')](removeEntity(_0x205419,null))[_0x0777('0x3f')](handleError(_0x205419,null));};exports[_0x0777('0x47')]=function(_0x3ab890,_0x23f49a){return db[_0x0777('0x3b')][_0x0777('0x47')]()[_0x0777('0x22')](respondWithResult(_0x23f49a,null))[_0x0777('0x3f')](handleError(_0x23f49a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5ea23ee..95af897 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 _0x59ce=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x35f9fd,_0x161f16){var _0x53a02d=function(_0x163ba9){while(--_0x163ba9){_0x35f9fd['push'](_0x35f9fd['shift']());}};_0x53a02d(++_0x161f16);}(_0x59ce,0x92));var _0xe59c=function(_0xbb3ab4,_0x4e549a){_0xbb3ab4=_0xbb3ab4-0x0;var _0x405e61=_0x59ce[_0xbb3ab4];return _0x405e61;};'use strict';var _=require(_0xe59c('0x0'));var util=require(_0xe59c('0x1'));var logger=require(_0xe59c('0x2'))('api');var moment=require(_0xe59c('0x3'));var BPromise=require(_0xe59c('0x4'));var rp=require(_0xe59c('0x5'));var fs=require('fs');var path=require(_0xe59c('0x6'));var rimraf=require(_0xe59c('0x7'));var config=require(_0xe59c('0x8'));var attributes=require(_0xe59c('0x9'));module['exports']=function(_0x387c49,_0x4ba903){return _0x387c49['define']('SmsTransferReport',attributes,{'tableName':_0xe59c('0xa'),'paranoid':![],'indexes':[{'name':_0xe59c('0xb'),'fields':[_0xe59c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56e6=['bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x5b142f,_0x10815a){var _0x327bbd=function(_0x56806f){while(--_0x56806f){_0x5b142f['push'](_0x5b142f['shift']());}};_0x327bbd(++_0x10815a);}(_0x56e6,0x6b));var _0x656e=function(_0x500364,_0x2b19e0){_0x500364=_0x500364-0x0;var _0x5b023a=_0x56e6[_0x500364];return _0x5b023a;};'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':[{'name':_0x656e('0xd'),'fields':[_0x656e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f5a9ef6..f401f1b 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 _0x4944=['code','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x546ace,_0x44eea7){var _0x52884e=function(_0x53f037){while(--_0x53f037){_0x546ace['push'](_0x546ace['shift']());}};_0x52884e(++_0x44eea7);}(_0x4944,0x6d));var _0x4494=function(_0x808eae,_0x1b5bd3){_0x808eae=_0x808eae-0x0;var _0x3b52bc=_0x4944[_0x808eae];return _0x3b52bc;};'use strict';var _=require(_0x4494('0x0'));var util=require('util');var moment=require(_0x4494('0x1'));var BPromise=require(_0x4494('0x2'));var rs=require(_0x4494('0x3'));var fs=require('fs');var Redis=require(_0x4494('0x4'));var db=require(_0x4494('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4494('0x6'))('rpc');var config=require(_0x4494('0x7'));var jayson=require(_0x4494('0x8'));var client=jayson[_0x4494('0x9')][_0x4494('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a4911,_0x1a94d6,_0x55bb81){return new BPromise(function(_0x12ef8e,_0x21098c){return client['request'](_0x2a4911,_0x55bb81)[_0x4494('0xb')](function(_0xec1762){logger[_0x4494('0xc')](_0x4494('0xd'),_0x1a94d6,'request\x20sent');logger['debug'](_0x4494('0xe'),_0x1a94d6,_0x4494('0xf'),JSON[_0x4494('0x10')](_0xec1762));if(_0xec1762['error']){if(_0xec1762['error'][_0x4494('0x11')]===0x1f4){logger[_0x4494('0x12')](_0x4494('0xd'),_0x1a94d6,_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);return _0x21098c(_0xec1762[_0x4494('0x12')]['message']);}logger[_0x4494('0x12')](_0x4494('0xd'),_0x1a94d6,_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);return _0x12ef8e(_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);}else{logger[_0x4494('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x1a94d6,_0x4494('0xf'));_0x12ef8e(_0xec1762['result']['message']);}})[_0x4494('0x14')](function(_0x267d0b){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x1a94d6,_0x267d0b);_0x21098c(_0x267d0b);});});} \ No newline at end of file +var _0x562d=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x14d326,_0x17ca1c){var _0x5b5e0b=function(_0xf6b54c){while(--_0xf6b54c){_0x14d326['push'](_0x14d326['shift']());}};_0x5b5e0b(++_0x17ca1c);}(_0x562d,0xe1));var _0xd562=function(_0xef5f0f,_0x35b798){_0xef5f0f=_0xef5f0f-0x0;var _0xd3b8d=_0x562d[_0xef5f0f];return _0xd3b8d;};'use strict';var _=require(_0xd562('0x0'));var util=require(_0xd562('0x1'));var moment=require(_0xd562('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd562('0x3'));var db=require(_0xd562('0x4'))['db'];var utils=require(_0xd562('0x5'));var logger=require('../../config/logger')(_0xd562('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd562('0x7')][_0xd562('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e6465,_0x3b03fe,_0x21f82a){return new BPromise(function(_0x38e1a7,_0x56c6f7){return client[_0xd562('0x9')](_0x3e6465,_0x21f82a)['then'](function(_0x32c054){logger[_0xd562('0xa')](_0xd562('0xb'),_0x3b03fe,_0xd562('0xc'));logger[_0xd562('0xd')](_0xd562('0xe'),_0x3b03fe,_0xd562('0xc'),JSON[_0xd562('0xf')](_0x32c054));if(_0x32c054[_0xd562('0x10')]){if(_0x32c054[_0xd562('0x10')][_0xd562('0x11')]===0x1f4){logger['error'](_0xd562('0xb'),_0x3b03fe,_0x32c054['error']['message']);return _0x56c6f7(_0x32c054[_0xd562('0x10')]['message']);}logger[_0xd562('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3b03fe,_0x32c054['error'][_0xd562('0x12')]);return _0x38e1a7(_0x32c054[_0xd562('0x10')][_0xd562('0x12')]);}else{logger[_0xd562('0xa')](_0xd562('0xb'),_0x3b03fe,'request\x20sent');_0x38e1a7(_0x32c054[_0xd562('0x13')][_0xd562('0x12')]);}})['catch'](function(_0x24b1c4){logger[_0xd562('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3b03fe,_0x24b1c4);_0x56c6f7(_0x24b1c4);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index a0337d0..5d9428a 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 _0x318a=['root','server/files/sounds/original/','replace','%s-%s%s','basename','originalname','extname','now','post','single','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','join'];(function(_0x57eaa0,_0x32aae5){var _0x9d53d2=function(_0x3c6ccd){while(--_0x3c6ccd){_0x57eaa0['push'](_0x57eaa0['shift']());}};_0x9d53d2(++_0x32aae5);}(_0x318a,0x1a1));var _0xa318=function(_0x2e0bdc,_0x1b6c00){_0x2e0bdc=_0x2e0bdc-0x0;var _0x558939=_0x318a[_0x2e0bdc];return _0x558939;};'use strict';var multer=require('multer');var util=require(_0xa318('0x0'));var path=require(_0xa318('0x1'));var timeout=require(_0xa318('0x2'));var express=require('express');var router=express[_0xa318('0x3')]();var fs_extra=require(_0xa318('0x4'));var auth=require(_0xa318('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa318('0x6'));var controller=require(_0xa318('0x7'));router[_0xa318('0x8')]('/',auth[_0xa318('0x9')](),controller[_0xa318('0xa')]);router[_0xa318('0x8')](_0xa318('0xb'),auth[_0xa318('0x9')](),controller['show']);router['get'](_0xa318('0xc'),auth[_0xa318('0x9')](),controller[_0xa318('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e629c,_0x54a65e,_0x322bb5){_0x322bb5(null,path[_0xa318('0xe')](config[_0xa318('0xf')],_0xa318('0x10')));},'filename':function(_0x3dba8c,_0x176143,_0x29575d){_0x176143['originalname']=_0x176143['originalname'][_0xa318('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29575d(null,util['format'](_0xa318('0x12'),path[_0xa318('0x13')](_0x176143[_0xa318('0x14')],path[_0xa318('0x15')](_0x176143['originalname'])),Date[_0xa318('0x16')](),path[_0xa318('0x15')](_0x176143[_0xa318('0x14')])));}})});router[_0xa318('0x17')]('/',upload[_0xa318('0x18')]('file'),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa318('0x19')](_0xa318('0xb'),auth[_0xa318('0x9')](),controller[_0xa318('0x19')]);module[_0xa318('0x1a')]=router; \ No newline at end of file +var _0xf480=['replace','basename','extname','post','single','create','/:id','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname'];(function(_0x72c194,_0x1a953a){var _0x1f4f68=function(_0x43bcdd){while(--_0x43bcdd){_0x72c194['push'](_0x72c194['shift']());}};_0x1f4f68(++_0x1a953a);}(_0xf480,0x1ef));var _0x0f48=function(_0x20e408,_0x578764){_0x20e408=_0x20e408-0x0;var _0x157fae=_0xf480[_0x20e408];return _0x157fae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0f48('0x0'));var timeout=require(_0x0f48('0x1'));var express=require(_0x0f48('0x2'));var router=express[_0x0f48('0x3')]();var fs_extra=require(_0x0f48('0x4'));var auth=require(_0x0f48('0x5'));var interaction=require(_0x0f48('0x6'));var config=require('../../config/environment');var controller=require(_0x0f48('0x7'));router[_0x0f48('0x8')]('/',auth[_0x0f48('0x9')](),controller[_0x0f48('0xa')]);router[_0x0f48('0x8')]('/:id',auth[_0x0f48('0x9')](),controller[_0x0f48('0xb')]);router[_0x0f48('0x8')](_0x0f48('0xc'),auth[_0x0f48('0x9')](),controller[_0x0f48('0xd')]);var upload=multer({'storage':multer[_0x0f48('0xe')]({'destination':function(_0x43bf46,_0x403e85,_0xc68a80){_0xc68a80(null,path['join'](config[_0x0f48('0xf')],_0x0f48('0x10')));},'filename':function(_0x357771,_0x108ef0,_0x5e8074){_0x108ef0[_0x0f48('0x11')]=_0x108ef0[_0x0f48('0x11')][_0x0f48('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e8074(null,util['format']('%s-%s%s',path[_0x0f48('0x13')](_0x108ef0[_0x0f48('0x11')],path[_0x0f48('0x14')](_0x108ef0['originalname'])),Date['now'](),path[_0x0f48('0x14')](_0x108ef0[_0x0f48('0x11')])));}})});router[_0x0f48('0x15')]('/',upload[_0x0f48('0x16')]('file'),controller[_0x0f48('0x17')]);router['put'](_0x0f48('0x18'),auth[_0x0f48('0x9')](),controller[_0x0f48('0x19')]);router[_0x0f48('0x1a')](_0x0f48('0x18'),auth[_0x0f48('0x9')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9eb52f2..a5b3612 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 _0xd536=['FLOAT','sequelize','exports','name','STRING','INTEGER','BIGINT'];(function(_0x4c53e7,_0x1f1239){var _0x1a2990=function(_0xcc0629){while(--_0xcc0629){_0x4c53e7['push'](_0x4c53e7['shift']());}};_0x1a2990(++_0x1f1239);}(_0xd536,0x158));var _0x6d53=function(_0x5aa42a,_0x101e54){_0x5aa42a=_0x5aa42a-0x0;var _0x4863d4=_0xd536[_0x5aa42a];return _0x4863d4;};'use strict';var Sequelize=require(_0x6d53('0x0'));module[_0x6d53('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6d53('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6d53('0x3')]},'display_name':{'type':Sequelize[_0x6d53('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x6d53('0x3')]},'original_format':{'type':Sequelize[_0x6d53('0x3')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x6d53('0x4')]},'original_bitRate':{'type':Sequelize[_0x6d53('0x5')]},'original_sampleRate':{'type':Sequelize[_0x6d53('0x4')]},'converted_format':{'type':Sequelize[_0x6d53('0x3')]},'converted_duration':{'type':Sequelize[_0x6d53('0x6')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x6d53('0x4')]},'converted_bitRate':{'type':Sequelize[_0x6d53('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x686e=['FLOAT','BIGINT','INTEGER','exports','STRING','name'];(function(_0x11505d,_0x3064df){var _0x2147ce=function(_0x1c33e9){while(--_0x1c33e9){_0x11505d['push'](_0x11505d['shift']());}};_0x2147ce(++_0x3064df);}(_0x686e,0x195));var _0xe686=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x686e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xe686('0x0')]={'name':{'type':Sequelize[_0xe686('0x1')],'unique':_0xe686('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe686('0x1')]},'display_name':{'type':Sequelize[_0xe686('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xe686('0x1')]},'original_format':{'type':Sequelize[_0xe686('0x1')]},'original_duration':{'type':Sequelize[_0xe686('0x3')]},'original_sampleCount':{'type':Sequelize[_0xe686('0x4')]},'original_channelCount':{'type':Sequelize[_0xe686('0x5')]},'original_bitRate':{'type':Sequelize[_0xe686('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xe686('0x1')]},'converted_duration':{'type':Sequelize[_0xe686('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xe686('0x4')]},'converted_channelCount':{'type':Sequelize[_0xe686('0x5')]},'converted_bitRate':{'type':Sequelize[_0xe686('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xe686('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 3ad0c22..44be5b2 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 _0xdc84=['rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','download','save_name','existsSync','join','root','converted_format','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','substring','server/files/sounds/original','server/files/sounds/converted','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','wav','error','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','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','delete','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','name','send','Sound'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0xdc84,0xcc));var _0x4dc8=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0xdc84[_0x4f431d];return _0x4f31e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4dc8('0x0'));var zipdir=require(_0x4dc8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4dc8('0x2'));var BPromise=require(_0x4dc8('0x3'));var Mustache=require('mustache');var util=require(_0x4dc8('0x4'));var path=require(_0x4dc8('0x5'));var sox=require(_0x4dc8('0x6'));var csv=require('to-csv');var ejs=require(_0x4dc8('0x7'));var fs=require('fs');var fs_extra=require(_0x4dc8('0x8'));var _=require(_0x4dc8('0x9'));var squel=require(_0x4dc8('0xa'));var crypto=require('crypto');var jsforce=require(_0x4dc8('0xb'));var deskjs=require(_0x4dc8('0xc'));var toCsv=require(_0x4dc8('0xd'));var querystring=require(_0x4dc8('0xe'));var Papa=require(_0x4dc8('0xf'));var Redis=require(_0x4dc8('0x10'));var authService=require(_0x4dc8('0x11'));var qs=require(_0x4dc8('0x12'));var as=require(_0x4dc8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4dc8('0x14'));var utils=require(_0x4dc8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4dc8('0x16'));var db=require(_0x4dc8('0x17'))['db'];function respondWithStatusCode(_0xb464ec,_0xf5af39){_0xf5af39=_0xf5af39||0xcc;return function(_0x1357d9){if(_0x1357d9){return _0xb464ec[_0x4dc8('0x18')](_0xf5af39);}return _0xb464ec[_0x4dc8('0x19')](_0xf5af39)[_0x4dc8('0x1a')]();};}function respondWithResult(_0x540bd1,_0x42c8c4){_0x42c8c4=_0x42c8c4||0xc8;return function(_0x4178ee){if(_0x4178ee){return _0x540bd1[_0x4dc8('0x19')](_0x42c8c4)[_0x4dc8('0x1b')](_0x4178ee);}};}function respondWithFilteredResult(_0x14ead4,_0x57c282){return function(_0x22d386){if(_0x22d386){var _0x460b1c=typeof _0x57c282[_0x4dc8('0x1c')]==='undefined'&&typeof _0x57c282[_0x4dc8('0x1d')]===_0x4dc8('0x1e');var _0x5f7b92=_0x22d386[_0x4dc8('0x1f')];var _0x2253ab=_0x460b1c?0x0:_0x57c282[_0x4dc8('0x1c')];var _0x1de3d3=_0x460b1c?_0x22d386[_0x4dc8('0x1f')]:_0x57c282[_0x4dc8('0x1c')]+_0x57c282[_0x4dc8('0x1d')];var _0x337215;if(_0x1de3d3>=_0x5f7b92){_0x1de3d3=_0x5f7b92;_0x337215=0xc8;}else{_0x337215=0xce;}_0x14ead4[_0x4dc8('0x19')](_0x337215);return _0x14ead4[_0x4dc8('0x20')]('Content-Range',_0x2253ab+'-'+_0x1de3d3+'/'+_0x5f7b92)[_0x4dc8('0x1b')](_0x22d386);}return null;};}function patchUpdates(_0x3db90f){return function(_0x1a3219){try{jsonpatch[_0x4dc8('0x21')](_0x1a3219,_0x3db90f,!![]);}catch(_0x16e313){return BPromise[_0x4dc8('0x22')](_0x16e313);}return _0x1a3219[_0x4dc8('0x23')]();};}function saveUpdates(_0x1b85a4,_0x1721f9){return function(_0x34805a){if(_0x34805a){return _0x34805a['update'](_0x1b85a4)[_0x4dc8('0x24')](function(_0x33db2f){return _0x33db2f;});}return null;};}function removeEntity(_0x44c252,_0x182448){return function(_0x344c81){if(_0x344c81){return _0x344c81[_0x4dc8('0x25')]()[_0x4dc8('0x24')](function(){var _0x2b2750=_0x344c81[_0x4dc8('0x26')]({'plain':!![]});var _0x1942c8=_0x4dc8('0x27');return db[_0x4dc8('0x28')][_0x4dc8('0x25')]({'where':{'type':_0x1942c8,'resourceId':_0x2b2750['id']}})[_0x4dc8('0x24')](function(){return _0x344c81;});})['then'](function(){_0x44c252['status'](0xcc)[_0x4dc8('0x1a')]();});}};}function handleEntityNotFound(_0x1ed9a7,_0x353701){return function(_0x3d0fd3){if(!_0x3d0fd3){_0x1ed9a7[_0x4dc8('0x18')](0x194);}return _0x3d0fd3;};}function handleError(_0x38a174,_0x3bad56){_0x3bad56=_0x3bad56||0x1f4;return function(_0x13b084){logger['error'](_0x13b084['stack']);if(_0x13b084[_0x4dc8('0x29')]){delete _0x13b084[_0x4dc8('0x29')];}_0x38a174[_0x4dc8('0x19')](_0x3bad56)[_0x4dc8('0x2a')](_0x13b084);};}exports['index']=function(_0x47f561,_0x491e47){var _0x4ae8b1={},_0x307f78={},_0x344291={'count':0x0,'rows':[]};var _0x1e9810=_['map'](db[_0x4dc8('0x2b')][_0x4dc8('0x2c')],function(_0x5c1eb9){return{'name':_0x5c1eb9[_0x4dc8('0x2d')],'type':_0x5c1eb9[_0x4dc8('0x2e')][_0x4dc8('0x2f')]};});_0x307f78[_0x4dc8('0x30')]=_[_0x4dc8('0x31')](_0x1e9810,_0x4dc8('0x29'));_0x307f78['query']=_[_0x4dc8('0x32')](_0x47f561['query']);_0x307f78['filters']=_[_0x4dc8('0x33')](_0x307f78['model'],_0x307f78[_0x4dc8('0x34')]);_0x4ae8b1[_0x4dc8('0x35')]=_[_0x4dc8('0x33')](_0x307f78[_0x4dc8('0x30')],qs['fields'](_0x47f561[_0x4dc8('0x34')][_0x4dc8('0x36')]));_0x4ae8b1[_0x4dc8('0x35')]=_0x4ae8b1[_0x4dc8('0x35')][_0x4dc8('0x37')]?_0x4ae8b1[_0x4dc8('0x35')]:_0x307f78[_0x4dc8('0x30')];if(!_0x47f561[_0x4dc8('0x34')][_0x4dc8('0x38')](_0x4dc8('0x39'))){_0x4ae8b1[_0x4dc8('0x1d')]=qs[_0x4dc8('0x1d')](_0x47f561[_0x4dc8('0x34')]['limit']);_0x4ae8b1[_0x4dc8('0x1c')]=qs[_0x4dc8('0x1c')](_0x47f561[_0x4dc8('0x34')]['offset']);}_0x4ae8b1['order']=qs['sort'](_0x47f561[_0x4dc8('0x34')]['sort']);_0x4ae8b1[_0x4dc8('0x3a')]=qs[_0x4dc8('0x3b')](_[_0x4dc8('0x3c')](_0x47f561['query'],_0x307f78[_0x4dc8('0x3b')]),_0x1e9810);if(_0x47f561['query'][_0x4dc8('0x3d')]){_0x4ae8b1[_0x4dc8('0x3a')]=_[_0x4dc8('0x3e')](_0x4ae8b1[_0x4dc8('0x3a')],{'$or':_[_0x4dc8('0x31')](_0x1e9810,function(_0x5dfd71){if(_0x5dfd71[_0x4dc8('0x2e')]!==_0x4dc8('0x3f')){var _0x401f98={};_0x401f98[_0x5dfd71['name']]={'$like':'%'+_0x47f561[_0x4dc8('0x34')][_0x4dc8('0x3d')]+'%'};return _0x401f98;}})});}_0x4ae8b1=_[_0x4dc8('0x3e')]({},_0x4ae8b1,_0x47f561[_0x4dc8('0x40')]);var _0x4d35b8={'where':_0x4ae8b1[_0x4dc8('0x3a')]};return db[_0x4dc8('0x2b')][_0x4dc8('0x1f')](_0x4d35b8)[_0x4dc8('0x24')](function(_0x3273a3){_0x344291[_0x4dc8('0x1f')]=_0x3273a3;if(_0x47f561['query'][_0x4dc8('0x41')]){_0x4ae8b1[_0x4dc8('0x42')]=[{'all':!![]}];}return db[_0x4dc8('0x2b')][_0x4dc8('0x43')](_0x4ae8b1);})[_0x4dc8('0x24')](function(_0x4c8ed4){_0x344291[_0x4dc8('0x44')]=_0x4c8ed4;return _0x344291;})[_0x4dc8('0x24')](respondWithFilteredResult(_0x491e47,_0x4ae8b1))[_0x4dc8('0x45')](handleError(_0x491e47,null));};exports['show']=function(_0x98c082,_0x19f99f){var _0x37f255={'raw':!![],'where':{'id':_0x98c082[_0x4dc8('0x46')]['id']}},_0x64c89={};_0x64c89[_0x4dc8('0x30')]=_[_0x4dc8('0x32')](db['Sound'][_0x4dc8('0x2c')]);_0x64c89[_0x4dc8('0x34')]=_[_0x4dc8('0x32')](_0x98c082[_0x4dc8('0x34')]);_0x64c89[_0x4dc8('0x3b')]=_['intersection'](_0x64c89['model'],_0x64c89[_0x4dc8('0x34')]);_0x37f255[_0x4dc8('0x35')]=_[_0x4dc8('0x33')](_0x64c89[_0x4dc8('0x30')],qs[_0x4dc8('0x36')](_0x98c082[_0x4dc8('0x34')][_0x4dc8('0x36')]));_0x37f255[_0x4dc8('0x35')]=_0x37f255['attributes'][_0x4dc8('0x37')]?_0x37f255[_0x4dc8('0x35')]:_0x64c89[_0x4dc8('0x30')];if(_0x98c082['query']['includeAll']){_0x37f255[_0x4dc8('0x42')]=[{'all':!![]}];}_0x37f255=_['merge']({},_0x37f255,_0x98c082[_0x4dc8('0x40')]);return db[_0x4dc8('0x2b')][_0x4dc8('0x47')](_0x37f255)[_0x4dc8('0x24')](handleEntityNotFound(_0x19f99f,null))[_0x4dc8('0x24')](respondWithResult(_0x19f99f,null))['catch'](handleError(_0x19f99f,null));};exports[_0x4dc8('0x48')]=function(_0x5a2dd9,_0x49387e,_0x5a1fdf){return db['Sound'][_0x4dc8('0x47')]({'where':{'id':_0x5a2dd9[_0x4dc8('0x46')]['id']},'attributes':['name',_0x4dc8('0x49'),'converted_format'],'raw':!![]})[_0x4dc8('0x24')](handleEntityNotFound(_0x49387e,null))['then'](function(_0x17e70e){if(_0x17e70e){if(!fs[_0x4dc8('0x4a')](path[_0x4dc8('0x4b')](config[_0x4dc8('0x4c')],'server/files/sounds/converted',_0x17e70e[_0x4dc8('0x49')]+'.'+_0x17e70e[_0x4dc8('0x4d')]))){throw new db[(_0x4dc8('0x4e'))]['ValidationError'](_0x4dc8('0x4f'));}return _0x49387e[_0x4dc8('0x48')](path[_0x4dc8('0x4b')](config['root'],'server/files/sounds/converted',util[_0x4dc8('0x50')](_0x4dc8('0x51'),_0x17e70e[_0x4dc8('0x49')],_0x17e70e[_0x4dc8('0x4d')])),util['format'](_0x4dc8('0x51'),_0x17e70e[_0x4dc8('0x29')],_0x17e70e['converted_format']));}return null;})['catch'](handleError(_0x49387e,null));};exports[_0x4dc8('0x52')]=function(_0xc537a,_0x44810f,_0x342541){var _0x1e7c84={'name':path[_0x4dc8('0x53')](_0xc537a['file'][_0x4dc8('0x54')],path[_0x4dc8('0x55')](_0xc537a[_0x4dc8('0x56')]['originalname'])),'save_name':path[_0x4dc8('0x53')](_0xc537a[_0x4dc8('0x56')]['filename'],path[_0x4dc8('0x55')](_0xc537a[_0x4dc8('0x56')]['filename'])),'original_format':path['extname'](_0xc537a[_0x4dc8('0x56')][_0x4dc8('0x54')])[_0x4dc8('0x57')](0x1),'converted_format':'wav'};var _0x64dae6=path[_0x4dc8('0x4b')](config[_0x4dc8('0x4c')],_0x4dc8('0x58'),_0xc537a[_0x4dc8('0x56')]['filename']);var _0x282d17=path[_0x4dc8('0x4b')](config[_0x4dc8('0x4c')],_0x4dc8('0x59'),util[_0x4dc8('0x50')](_0x4dc8('0x51'),path['basename'](_0xc537a[_0x4dc8('0x56')][_0x4dc8('0x5a')],path['extname'](_0xc537a[_0x4dc8('0x56')]['filename'])),_0x1e7c84[_0x4dc8('0x4d')]));logger[_0x4dc8('0x5b')](_0x4dc8('0x5c'),_0x64dae6);logger[_0x4dc8('0x5b')](_0x4dc8('0x5d'),_0x282d17);try{fs['chmodSync'](_0x64dae6,parseInt(_0x4dc8('0x5e'),0x8));var _0x527850=sox['transcode'](_0x64dae6,_0x282d17,{'sampleRate':0x1f40,'format':_0x4dc8('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x527850['on'](_0x4dc8('0x60'),function(_0xaf7acb){fs[_0x4dc8('0x61')](_0x64dae6);_0x44810f[_0x4dc8('0x19')](0x1f4)[_0x4dc8('0x2a')](_0xaf7acb);});_0x527850['on'](_0x4dc8('0x62'),function(_0x5ab644){_0x1e7c84['original_duration']=isNaN(_0x5ab644[_0x4dc8('0x63')])?null:_0x5ab644[_0x4dc8('0x63')]*0x3e8;_0x1e7c84['original_sampleCount']=isNaN(_0x5ab644[_0x4dc8('0x64')])?null:_0x5ab644['sampleCount'];_0x1e7c84[_0x4dc8('0x65')]=isNaN(_0x5ab644[_0x4dc8('0x66')])?null:_0x5ab644[_0x4dc8('0x66')];_0x1e7c84[_0x4dc8('0x67')]=isNaN(_0x5ab644['bitRate'])?null:_0x5ab644[_0x4dc8('0x68')];_0x1e7c84[_0x4dc8('0x69')]=isNaN(_0x5ab644[_0x4dc8('0x6a')])?null:_0x5ab644[_0x4dc8('0x6a')];});_0x527850['on'](_0x4dc8('0x6b'),function(_0x292474){_0x1e7c84[_0x4dc8('0x6c')]=isNaN(_0x292474[_0x4dc8('0x63')])?null:_0x292474[_0x4dc8('0x63')]*0x3e8;_0x1e7c84[_0x4dc8('0x6d')]=isNaN(_0x292474['sampleCount'])?null:_0x292474[_0x4dc8('0x64')];_0x1e7c84[_0x4dc8('0x6e')]=isNaN(_0x292474[_0x4dc8('0x66')])?null:_0x292474[_0x4dc8('0x66')];_0x1e7c84[_0x4dc8('0x6f')]=isNaN(_0x292474['bitRate'])?null:_0x292474['bitRate'];_0x1e7c84[_0x4dc8('0x70')]=isNaN(_0x292474['sampleRate'])?null:_0x292474['sampleRate'];});_0x527850['on'](_0x4dc8('0x1a'),function(){fs['chmodSync'](_0x282d17,parseInt(_0x4dc8('0x5e'),0x8));return db[_0x4dc8('0x2b')][_0x4dc8('0x52')](_0x1e7c84)[_0x4dc8('0x24')](function(_0x198063){var _0x443bdf={'role':_0xc537a[_0x4dc8('0x71')][_0x4dc8('0x72')],'userProfileId':_0xc537a[_0x4dc8('0x71')][_0x4dc8('0x73')]};if(!_0x443bdf)throw new Error(_0x4dc8('0x74'));if(_0x443bdf[_0x4dc8('0x72')]===_0x4dc8('0x75')){var _0x364a94=_0x198063[_0x4dc8('0x26')]({'plain':!![]});return db[_0x4dc8('0x76')][_0x4dc8('0x47')]({'where':{'name':_0x4dc8('0x27'),'userProfileId':_0x443bdf[_0x4dc8('0x73')]},'raw':!![]})[_0x4dc8('0x24')](function(_0x14a15d){if(_0x14a15d&&_0x14a15d[_0x4dc8('0x77')]===0x0){return db[_0x4dc8('0x28')][_0x4dc8('0x52')]({'name':_0x364a94[_0x4dc8('0x29')],'resourceId':_0x364a94['id'],'type':_0x14a15d[_0x4dc8('0x29')],'sectionId':_0x14a15d['id']},{})[_0x4dc8('0x24')](function(){return _0x198063;});}else{return _0x198063;}})[_0x4dc8('0x45')](function(_0x2197eb){logger['error'](_0x4dc8('0x78'),_0x2197eb);throw _0x2197eb;});}return _0x198063;})[_0x4dc8('0x24')](respondWithResult(_0x44810f,null))[_0x4dc8('0x45')](handleError(_0x44810f,null));});_0x527850[_0x4dc8('0x79')]();}catch(_0x3fa44a){_0x44810f[_0x4dc8('0x19')](0x1f4)[_0x4dc8('0x2a')](_0x3fa44a);}};exports[_0x4dc8('0x7a')]=function(_0x14b234,_0x150ac3,_0x5c1f05){return db['Sound'][_0x4dc8('0x47')]({'where':{'id':_0x14b234[_0x4dc8('0x46')]['id']}})[_0x4dc8('0x24')](handleEntityNotFound(_0x150ac3,null))[_0x4dc8('0x24')](saveUpdates(_['pick'](_0x14b234[_0x4dc8('0x71')],['name','description']),null))[_0x4dc8('0x24')](respondWithResult(_0x150ac3,null))[_0x4dc8('0x45')](handleError(_0x150ac3,null));};exports[_0x4dc8('0x7b')]=function(_0x618d0b,_0x58b47d,_0x5376ce){return db[_0x4dc8('0x2b')][_0x4dc8('0x47')]({'where':{'id':_0x618d0b[_0x4dc8('0x46')]['id']}})[_0x4dc8('0x24')](function(_0xf51e69){if(_0xf51e69){return _0xf51e69[_0x4dc8('0x25')]();}})[_0x4dc8('0x24')](function(_0x1b7cbb){var _0x426896=path['join'](config['root'],'server/files/sounds/original',util[_0x4dc8('0x50')](_0x4dc8('0x51'),_0x1b7cbb[_0x4dc8('0x49')],_0x1b7cbb['original_format']));var _0x1c0e36=path['join'](config[_0x4dc8('0x4c')],_0x4dc8('0x59'),util[_0x4dc8('0x50')](_0x4dc8('0x51'),_0x1b7cbb[_0x4dc8('0x49')],_0x1b7cbb['converted_format']));fs['unlinkSync'](_0x426896);fs['unlinkSync'](_0x1c0e36);return _0x1b7cbb;})[_0x4dc8('0x24')](function(_0x1ad849){if(_0x1ad849){return _0x58b47d[_0x4dc8('0x19')](0xcc)[_0x4dc8('0x1a')]();}})[_0x4dc8('0x24')](handleEntityNotFound(_0x58b47d,null))['catch'](handleError(_0x58b47d,null));}; \ No newline at end of file +var _0x7b83=['keys','query','intersection','model','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','length','find','catch','download','save_name','converted_format','join','root','server/files/sounds/converted','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','originalname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','pick','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','then','get','Sounds','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Sound','fieldName','type','key'];(function(_0x1c7ba2,_0x116154){var _0x156cb5=function(_0x26593e){while(--_0x26593e){_0x1c7ba2['push'](_0x1c7ba2['shift']());}};_0x156cb5(++_0x116154);}(_0x7b83,0xcb));var _0x37b8=function(_0x49d80d,_0x2ebb62){_0x49d80d=_0x49d80d-0x0;var _0x4de96a=_0x7b83[_0x49d80d];return _0x4de96a;};'use strict';var emlformat=require(_0x37b8('0x0'));var rimraf=require(_0x37b8('0x1'));var zipdir=require(_0x37b8('0x2'));var jsonpatch=require(_0x37b8('0x3'));var rp=require(_0x37b8('0x4'));var moment=require(_0x37b8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x37b8('0x6'));var util=require('util');var path=require(_0x37b8('0x7'));var sox=require(_0x37b8('0x8'));var csv=require('to-csv');var ejs=require(_0x37b8('0x9'));var fs=require('fs');var fs_extra=require(_0x37b8('0xa'));var _=require(_0x37b8('0xb'));var squel=require('squel');var crypto=require(_0x37b8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x37b8('0xd'));var toCsv=require(_0x37b8('0xe'));var querystring=require(_0x37b8('0xf'));var Papa=require('papaparse');var Redis=require(_0x37b8('0x10'));var authService=require(_0x37b8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x37b8('0x12'));var hardwareService=require(_0x37b8('0x13'));var logger=require(_0x37b8('0x14'))(_0x37b8('0x15'));var utils=require(_0x37b8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x37b8('0x17'));var db=require(_0x37b8('0x18'))['db'];function respondWithStatusCode(_0x758ee9,_0x2ffe42){_0x2ffe42=_0x2ffe42||0xcc;return function(_0x2ce192){if(_0x2ce192){return _0x758ee9['sendStatus'](_0x2ffe42);}return _0x758ee9[_0x37b8('0x19')](_0x2ffe42)[_0x37b8('0x1a')]();};}function respondWithResult(_0x3eb52e,_0x2a71f6){_0x2a71f6=_0x2a71f6||0xc8;return function(_0x1b7ced){if(_0x1b7ced){return _0x3eb52e[_0x37b8('0x19')](_0x2a71f6)[_0x37b8('0x1b')](_0x1b7ced);}};}function respondWithFilteredResult(_0x5ef0fc,_0x1975b8){return function(_0x23e2da){if(_0x23e2da){var _0x40d683=typeof _0x1975b8[_0x37b8('0x1c')]===_0x37b8('0x1d')&&typeof _0x1975b8['limit']==='undefined';var _0x232395=_0x23e2da[_0x37b8('0x1e')];var _0x2b5398=_0x40d683?0x0:_0x1975b8['offset'];var _0x1546f4=_0x40d683?_0x23e2da[_0x37b8('0x1e')]:_0x1975b8[_0x37b8('0x1c')]+_0x1975b8['limit'];var _0x15abef;if(_0x1546f4>=_0x232395){_0x1546f4=_0x232395;_0x15abef=0xc8;}else{_0x15abef=0xce;}_0x5ef0fc[_0x37b8('0x19')](_0x15abef);return _0x5ef0fc[_0x37b8('0x1f')](_0x37b8('0x20'),_0x2b5398+'-'+_0x1546f4+'/'+_0x232395)[_0x37b8('0x1b')](_0x23e2da);}return null;};}function patchUpdates(_0x53d017){return function(_0x5a9338){try{jsonpatch[_0x37b8('0x21')](_0x5a9338,_0x53d017,!![]);}catch(_0x54e5d7){return BPromise['reject'](_0x54e5d7);}return _0x5a9338['save']();};}function saveUpdates(_0x58891f,_0x3040a8){return function(_0x2a5605){if(_0x2a5605){return _0x2a5605['update'](_0x58891f)[_0x37b8('0x22')](function(_0x280726){return _0x280726;});}return null;};}function removeEntity(_0x1613ba,_0x312d54){return function(_0x4b265e){if(_0x4b265e){return _0x4b265e['destroy']()[_0x37b8('0x22')](function(){var _0x2045d3=_0x4b265e[_0x37b8('0x23')]({'plain':!![]});var _0x4736cf=_0x37b8('0x24');return db[_0x37b8('0x25')][_0x37b8('0x26')]({'where':{'type':_0x4736cf,'resourceId':_0x2045d3['id']}})[_0x37b8('0x22')](function(){return _0x4b265e;});})['then'](function(){_0x1613ba[_0x37b8('0x19')](0xcc)[_0x37b8('0x1a')]();});}};}function handleEntityNotFound(_0x154876,_0x1ad7da){return function(_0x2693cc){if(!_0x2693cc){_0x154876[_0x37b8('0x27')](0x194);}return _0x2693cc;};}function handleError(_0x2c20f8,_0x28895f){_0x28895f=_0x28895f||0x1f4;return function(_0x1839af){logger[_0x37b8('0x28')](_0x1839af[_0x37b8('0x29')]);if(_0x1839af[_0x37b8('0x2a')]){delete _0x1839af[_0x37b8('0x2a')];}_0x2c20f8[_0x37b8('0x19')](_0x28895f)['send'](_0x1839af);};}exports[_0x37b8('0x2b')]=function(_0x3ae08c,_0x509264){var _0x2c2ec0={},_0x108d75={},_0x5daf98={'count':0x0,'rows':[]};var _0x214fe0=_[_0x37b8('0x2c')](db[_0x37b8('0x2d')]['rawAttributes'],function(_0x475c4b){return{'name':_0x475c4b[_0x37b8('0x2e')],'type':_0x475c4b[_0x37b8('0x2f')][_0x37b8('0x30')]};});_0x108d75['model']=_[_0x37b8('0x2c')](_0x214fe0,_0x37b8('0x2a'));_0x108d75['query']=_[_0x37b8('0x31')](_0x3ae08c[_0x37b8('0x32')]);_0x108d75['filters']=_[_0x37b8('0x33')](_0x108d75[_0x37b8('0x34')],_0x108d75[_0x37b8('0x32')]);_0x2c2ec0['attributes']=_[_0x37b8('0x33')](_0x108d75[_0x37b8('0x34')],qs['fields'](_0x3ae08c[_0x37b8('0x32')]['fields']));_0x2c2ec0[_0x37b8('0x35')]=_0x2c2ec0[_0x37b8('0x35')]['length']?_0x2c2ec0[_0x37b8('0x35')]:_0x108d75[_0x37b8('0x34')];if(!_0x3ae08c['query'][_0x37b8('0x36')](_0x37b8('0x37'))){_0x2c2ec0[_0x37b8('0x38')]=qs[_0x37b8('0x38')](_0x3ae08c[_0x37b8('0x32')][_0x37b8('0x38')]);_0x2c2ec0[_0x37b8('0x1c')]=qs[_0x37b8('0x1c')](_0x3ae08c['query'][_0x37b8('0x1c')]);}_0x2c2ec0['order']=qs['sort'](_0x3ae08c[_0x37b8('0x32')][_0x37b8('0x39')]);_0x2c2ec0[_0x37b8('0x3a')]=qs['filters'](_['pick'](_0x3ae08c[_0x37b8('0x32')],_0x108d75[_0x37b8('0x3b')]),_0x214fe0);if(_0x3ae08c[_0x37b8('0x32')][_0x37b8('0x3c')]){_0x2c2ec0[_0x37b8('0x3a')]=_[_0x37b8('0x3d')](_0x2c2ec0[_0x37b8('0x3a')],{'$or':_[_0x37b8('0x2c')](_0x214fe0,function(_0x1c682c){if(_0x1c682c[_0x37b8('0x2f')]!=='VIRTUAL'){var _0x4211eb={};_0x4211eb[_0x1c682c[_0x37b8('0x2a')]]={'$like':'%'+_0x3ae08c[_0x37b8('0x32')]['filter']+'%'};return _0x4211eb;}})});}_0x2c2ec0=_['merge']({},_0x2c2ec0,_0x3ae08c[_0x37b8('0x3e')]);var _0x45a9e7={'where':_0x2c2ec0[_0x37b8('0x3a')]};return db[_0x37b8('0x2d')][_0x37b8('0x1e')](_0x45a9e7)['then'](function(_0x1d4419){_0x5daf98['count']=_0x1d4419;if(_0x3ae08c[_0x37b8('0x32')][_0x37b8('0x3f')]){_0x2c2ec0[_0x37b8('0x40')]=[{'all':!![]}];}return db[_0x37b8('0x2d')][_0x37b8('0x41')](_0x2c2ec0);})[_0x37b8('0x22')](function(_0x51c47d){_0x5daf98[_0x37b8('0x42')]=_0x51c47d;return _0x5daf98;})[_0x37b8('0x22')](respondWithFilteredResult(_0x509264,_0x2c2ec0))['catch'](handleError(_0x509264,null));};exports[_0x37b8('0x43')]=function(_0x44cbca,_0x4c8d07){var _0x545ee5={'raw':!![],'where':{'id':_0x44cbca[_0x37b8('0x44')]['id']}},_0x1ca3eb={};_0x1ca3eb[_0x37b8('0x34')]=_[_0x37b8('0x31')](db[_0x37b8('0x2d')][_0x37b8('0x45')]);_0x1ca3eb[_0x37b8('0x32')]=_[_0x37b8('0x31')](_0x44cbca[_0x37b8('0x32')]);_0x1ca3eb[_0x37b8('0x3b')]=_[_0x37b8('0x33')](_0x1ca3eb[_0x37b8('0x34')],_0x1ca3eb[_0x37b8('0x32')]);_0x545ee5[_0x37b8('0x35')]=_['intersection'](_0x1ca3eb[_0x37b8('0x34')],qs[_0x37b8('0x46')](_0x44cbca[_0x37b8('0x32')][_0x37b8('0x46')]));_0x545ee5[_0x37b8('0x35')]=_0x545ee5[_0x37b8('0x35')][_0x37b8('0x47')]?_0x545ee5[_0x37b8('0x35')]:_0x1ca3eb[_0x37b8('0x34')];if(_0x44cbca[_0x37b8('0x32')]['includeAll']){_0x545ee5[_0x37b8('0x40')]=[{'all':!![]}];}_0x545ee5=_[_0x37b8('0x3d')]({},_0x545ee5,_0x44cbca['options']);return db[_0x37b8('0x2d')][_0x37b8('0x48')](_0x545ee5)[_0x37b8('0x22')](handleEntityNotFound(_0x4c8d07,null))[_0x37b8('0x22')](respondWithResult(_0x4c8d07,null))[_0x37b8('0x49')](handleError(_0x4c8d07,null));};exports[_0x37b8('0x4a')]=function(_0x43cfc0,_0x3ba441,_0x95085e){return db['Sound']['find']({'where':{'id':_0x43cfc0[_0x37b8('0x44')]['id']},'attributes':[_0x37b8('0x2a'),_0x37b8('0x4b'),_0x37b8('0x4c')],'raw':!![]})[_0x37b8('0x22')](handleEntityNotFound(_0x3ba441,null))[_0x37b8('0x22')](function(_0x374286){if(_0x374286){if(!fs['existsSync'](path[_0x37b8('0x4d')](config[_0x37b8('0x4e')],_0x37b8('0x4f'),_0x374286['save_name']+'.'+_0x374286['converted_format']))){throw new db['Sequelize']['ValidationError'](_0x37b8('0x50'));}return _0x3ba441[_0x37b8('0x4a')](path[_0x37b8('0x4d')](config[_0x37b8('0x4e')],_0x37b8('0x4f'),util['format']('%s.%s',_0x374286['save_name'],_0x374286[_0x37b8('0x4c')])),util[_0x37b8('0x51')](_0x37b8('0x52'),_0x374286[_0x37b8('0x2a')],_0x374286[_0x37b8('0x4c')]));}return null;})[_0x37b8('0x49')](handleError(_0x3ba441,null));};exports[_0x37b8('0x53')]=function(_0x560108,_0xde1b7d,_0x284782){var _0x5edd23={'name':path[_0x37b8('0x54')](_0x560108[_0x37b8('0x55')]['originalname'],path[_0x37b8('0x56')](_0x560108[_0x37b8('0x55')][_0x37b8('0x57')])),'save_name':path['basename'](_0x560108[_0x37b8('0x55')][_0x37b8('0x58')],path[_0x37b8('0x56')](_0x560108[_0x37b8('0x55')][_0x37b8('0x58')])),'original_format':path['extname'](_0x560108['file'][_0x37b8('0x57')])[_0x37b8('0x59')](0x1),'converted_format':'wav'};var _0x10ddcb=path[_0x37b8('0x4d')](config['root'],_0x37b8('0x5a'),_0x560108[_0x37b8('0x55')]['filename']);var _0x167134=path['join'](config[_0x37b8('0x4e')],_0x37b8('0x4f'),util['format'](_0x37b8('0x52'),path['basename'](_0x560108['file']['filename'],path[_0x37b8('0x56')](_0x560108['file'][_0x37b8('0x58')])),_0x5edd23[_0x37b8('0x4c')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x10ddcb);logger[_0x37b8('0x5b')](_0x37b8('0x5c'),_0x167134);try{fs[_0x37b8('0x5d')](_0x10ddcb,parseInt(_0x37b8('0x5e'),0x8));var _0x47b7a6=sox[_0x37b8('0x5f')](_0x10ddcb,_0x167134,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x47b7a6['on']('error',function(_0x1e8baa){fs[_0x37b8('0x60')](_0x10ddcb);_0xde1b7d[_0x37b8('0x19')](0x1f4)[_0x37b8('0x61')](_0x1e8baa);});_0x47b7a6['on'](_0x37b8('0x62'),function(_0x286bff){_0x5edd23[_0x37b8('0x63')]=isNaN(_0x286bff[_0x37b8('0x64')])?null:_0x286bff[_0x37b8('0x64')]*0x3e8;_0x5edd23[_0x37b8('0x65')]=isNaN(_0x286bff[_0x37b8('0x66')])?null:_0x286bff[_0x37b8('0x66')];_0x5edd23[_0x37b8('0x67')]=isNaN(_0x286bff[_0x37b8('0x68')])?null:_0x286bff[_0x37b8('0x68')];_0x5edd23[_0x37b8('0x69')]=isNaN(_0x286bff[_0x37b8('0x6a')])?null:_0x286bff['bitRate'];_0x5edd23[_0x37b8('0x6b')]=isNaN(_0x286bff[_0x37b8('0x6c')])?null:_0x286bff[_0x37b8('0x6c')];});_0x47b7a6['on'](_0x37b8('0x6d'),function(_0x449fc8){_0x5edd23[_0x37b8('0x6e')]=isNaN(_0x449fc8[_0x37b8('0x64')])?null:_0x449fc8[_0x37b8('0x64')]*0x3e8;_0x5edd23[_0x37b8('0x6f')]=isNaN(_0x449fc8[_0x37b8('0x66')])?null:_0x449fc8['sampleCount'];_0x5edd23[_0x37b8('0x70')]=isNaN(_0x449fc8[_0x37b8('0x68')])?null:_0x449fc8['channelCount'];_0x5edd23[_0x37b8('0x71')]=isNaN(_0x449fc8['bitRate'])?null:_0x449fc8[_0x37b8('0x6a')];_0x5edd23[_0x37b8('0x72')]=isNaN(_0x449fc8[_0x37b8('0x6c')])?null:_0x449fc8[_0x37b8('0x6c')];});_0x47b7a6['on'](_0x37b8('0x1a'),function(){fs[_0x37b8('0x5d')](_0x167134,parseInt(_0x37b8('0x5e'),0x8));return db[_0x37b8('0x2d')]['create'](_0x5edd23)[_0x37b8('0x22')](function(_0x3a2bcf){var _0xb1032a={'role':_0x560108[_0x37b8('0x73')]['role'],'userProfileId':_0x560108[_0x37b8('0x73')]['userProfileId']};if(!_0xb1032a)throw new Error(_0x37b8('0x74'));if(_0xb1032a[_0x37b8('0x75')]===_0x37b8('0x76')){var _0xc70397=_0x3a2bcf['get']({'plain':!![]});return db[_0x37b8('0x77')]['find']({'where':{'name':'Sounds','userProfileId':_0xb1032a[_0x37b8('0x78')]},'raw':!![]})[_0x37b8('0x22')](function(_0x1be081){if(_0x1be081&&_0x1be081[_0x37b8('0x79')]===0x0){return db[_0x37b8('0x25')][_0x37b8('0x53')]({'name':_0xc70397[_0x37b8('0x2a')],'resourceId':_0xc70397['id'],'type':_0x1be081['name'],'sectionId':_0x1be081['id']},{})[_0x37b8('0x22')](function(){return _0x3a2bcf;});}else{return _0x3a2bcf;}})['catch'](function(_0x3a8b0c){logger[_0x37b8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a8b0c);throw _0x3a8b0c;});}return _0x3a2bcf;})[_0x37b8('0x22')](respondWithResult(_0xde1b7d,null))[_0x37b8('0x49')](handleError(_0xde1b7d,null));});_0x47b7a6['start']();}catch(_0x4d8f91){_0xde1b7d[_0x37b8('0x19')](0x1f4)[_0x37b8('0x61')](_0x4d8f91);}};exports[_0x37b8('0x7a')]=function(_0x185fd9,_0x56859e,_0x12b5b1){return db[_0x37b8('0x2d')][_0x37b8('0x48')]({'where':{'id':_0x185fd9['params']['id']}})[_0x37b8('0x22')](handleEntityNotFound(_0x56859e,null))[_0x37b8('0x22')](saveUpdates(_[_0x37b8('0x7b')](_0x185fd9[_0x37b8('0x73')],['name','description']),null))[_0x37b8('0x22')](respondWithResult(_0x56859e,null))['catch'](handleError(_0x56859e,null));};exports[_0x37b8('0x7c')]=function(_0x40e85c,_0x4e9657,_0x306804){return db[_0x37b8('0x2d')][_0x37b8('0x48')]({'where':{'id':_0x40e85c['params']['id']}})[_0x37b8('0x22')](function(_0x14ffeb){if(_0x14ffeb){return _0x14ffeb['destroy']();}})[_0x37b8('0x22')](function(_0x1d32cd){var _0x4f9832=path['join'](config[_0x37b8('0x4e')],'server/files/sounds/original',util[_0x37b8('0x51')](_0x37b8('0x52'),_0x1d32cd[_0x37b8('0x4b')],_0x1d32cd[_0x37b8('0x7d')]));var _0x4bc61b=path[_0x37b8('0x4d')](config[_0x37b8('0x4e')],'server/files/sounds/converted',util['format'](_0x37b8('0x52'),_0x1d32cd[_0x37b8('0x4b')],_0x1d32cd['converted_format']));fs[_0x37b8('0x60')](_0x4f9832);fs[_0x37b8('0x60')](_0x4bc61b);return _0x1d32cd;})[_0x37b8('0x22')](function(_0x16e769){if(_0x16e769){return _0x4e9657[_0x37b8('0x19')](0xcc)[_0x37b8('0x1a')]();}})[_0x37b8('0x22')](handleEntityNotFound(_0x4e9657,null))[_0x37b8('0x49')](handleError(_0x4e9657,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index fabd2ba..7b03878 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 _0x332f=['api','moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger'];(function(_0x146ef3,_0x1c7bb0){var _0x5d9bae=function(_0x3b70f7){while(--_0x3b70f7){_0x146ef3['push'](_0x146ef3['shift']());}};_0x5d9bae(++_0x1c7bb0);}(_0x332f,0x177));var _0xf332=function(_0x809739,_0x1b810c){_0x809739=_0x809739-0x0;var _0x4e2b5b=_0x332f[_0x809739];return _0x4e2b5b;};'use strict';var _=require(_0xf332('0x0'));var util=require('util');var logger=require(_0xf332('0x1'))(_0xf332('0x2'));var moment=require(_0xf332('0x3'));var BPromise=require(_0xf332('0x4'));var rp=require(_0xf332('0x5'));var fs=require('fs');var path=require(_0xf332('0x6'));var rimraf=require(_0xf332('0x7'));var config=require('../../config/environment');var attributes=require(_0xf332('0x8'));module[_0xf332('0x9')]=function(_0x4e314f,_0x3d2fab){return _0x4e314f[_0xf332('0xa')](_0xf332('0xb'),attributes,{'tableName':_0xf332('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfca4=['Sound','tools_sounds','lodash','api','request-promise','path','../../config/environment','exports','define'];(function(_0x1f6691,_0x3a3d46){var _0xf786b6=function(_0x2afbdb){while(--_0x2afbdb){_0x1f6691['push'](_0x1f6691['shift']());}};_0xf786b6(++_0x3a3d46);}(_0xfca4,0x1a0));var _0x4fca=function(_0x5c4d92,_0x1cca09){_0x5c4d92=_0x5c4d92-0x0;var _0x454a6a=_0xfca4[_0x5c4d92];return _0x454a6a;};'use strict';var _=require(_0x4fca('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4fca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4fca('0x2'));var fs=require('fs');var path=require(_0x4fca('0x3'));var rimraf=require('rimraf');var config=require(_0x4fca('0x4'));var attributes=require('./sound.attributes');module[_0x4fca('0x5')]=function(_0x44163f,_0x3753ca){return _0x44163f[_0x4fca('0x6')](_0x4fca('0x7'),attributes,{'tableName':_0x4fca('0x8'),'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 ad9db2a..3d338a5 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 _0xe823=['request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ShowSound','find','options','raw','where','attributes','include','map','model','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s'];(function(_0x52fc11,_0x5702d1){var _0x16d9f7=function(_0x3a3d43){while(--_0x3a3d43){_0x52fc11['push'](_0x52fc11['shift']());}};_0x16d9f7(++_0x5702d1);}(_0xe823,0x171));var _0x3e82=function(_0x1f3f70,_0x5cca61){_0x1f3f70=_0x1f3f70-0x0;var _0x334446=_0xe823[_0x1f3f70];return _0x334446;};'use strict';var _=require(_0x3e82('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e82('0x1'));var rs=require(_0x3e82('0x2'));var fs=require('fs');var Redis=require(_0x3e82('0x3'));var db=require(_0x3e82('0x4'))['db'];var utils=require(_0x3e82('0x5'));var logger=require(_0x3e82('0x6'))(_0x3e82('0x7'));var config=require(_0x3e82('0x8'));var jayson=require(_0x3e82('0x9'));var client=jayson[_0x3e82('0xa')][_0x3e82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x222bb5,_0x2c3b51,_0x4a4339){return new BPromise(function(_0x3f00ce,_0x36349a){return client[_0x3e82('0xc')](_0x222bb5,_0x4a4339)[_0x3e82('0xd')](function(_0x3cf4c8){logger['info'](_0x3e82('0xe'),_0x2c3b51,_0x3e82('0xf'));logger['debug'](_0x3e82('0x10'),_0x2c3b51,_0x3e82('0xf'),JSON[_0x3e82('0x11')](_0x3cf4c8));if(_0x3cf4c8[_0x3e82('0x12')]){if(_0x3cf4c8[_0x3e82('0x12')][_0x3e82('0x13')]===0x1f4){logger['error'](_0x3e82('0xe'),_0x2c3b51,_0x3cf4c8['error'][_0x3e82('0x14')]);return _0x36349a(_0x3cf4c8[_0x3e82('0x12')][_0x3e82('0x14')]);}logger[_0x3e82('0x12')](_0x3e82('0xe'),_0x2c3b51,_0x3cf4c8['error'][_0x3e82('0x14')]);return _0x3f00ce(_0x3cf4c8[_0x3e82('0x12')]['message']);}else{logger[_0x3e82('0x15')]('Sound,\x20%s,\x20%s',_0x2c3b51,_0x3e82('0xf'));_0x3f00ce(_0x3cf4c8['result'][_0x3e82('0x14')]);}})['catch'](function(_0x430687){logger[_0x3e82('0x12')](_0x3e82('0xe'),_0x2c3b51,_0x430687);_0x36349a(_0x430687);});});}exports[_0x3e82('0x16')]=function(_0x542414){var _0x550078=this;return new Promise(function(_0x26fc15,_0x4fafe5){return db['Sound'][_0x3e82('0x17')]({'raw':_0x542414['options']?_0x542414[_0x3e82('0x18')][_0x3e82('0x19')]===undefined?!![]:![]:!![],'where':_0x542414[_0x3e82('0x18')]?_0x542414[_0x3e82('0x18')][_0x3e82('0x1a')]||null:null,'attributes':_0x542414[_0x3e82('0x18')]?_0x542414[_0x3e82('0x18')][_0x3e82('0x1b')]||null:null,'include':_0x542414[_0x3e82('0x18')]?_0x542414[_0x3e82('0x18')][_0x3e82('0x1c')]?_[_0x3e82('0x1d')](_0x542414[_0x3e82('0x18')]['include'],function(_0x258efc){return{'model':db[_0x258efc[_0x3e82('0x1e')]],'as':_0x258efc['as'],'attributes':_0x258efc[_0x3e82('0x1b')],'include':_0x258efc[_0x3e82('0x1c')]?_[_0x3e82('0x1d')](_0x258efc[_0x3e82('0x1c')],function(_0x5241be){return{'model':db[_0x5241be['model']],'as':_0x5241be['as'],'attributes':_0x5241be['attributes'],'include':_0x5241be[_0x3e82('0x1c')]?_[_0x3e82('0x1d')](_0x5241be[_0x3e82('0x1c')],function(_0x1ee01f){return{'model':db[_0x1ee01f[_0x3e82('0x1e')]],'as':_0x1ee01f['as'],'attributes':_0x1ee01f[_0x3e82('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3e82('0xd')](function(_0xa8ce11){logger[_0x3e82('0x15')](_0x3e82('0x16'),_0x542414);logger[_0x3e82('0x1f')]('ShowSound',_0x542414,JSON[_0x3e82('0x11')](_0xa8ce11));_0x26fc15(_0xa8ce11);})['catch'](function(_0x39c4cc){logger[_0x3e82('0x12')](_0x3e82('0x16'),_0x39c4cc[_0x3e82('0x14')],_0x542414);_0x4fafe5(_0x550078[_0x3e82('0x12')](0x1f4,_0x39c4cc[_0x3e82('0x14')]));});});}; \ No newline at end of file +var _0x82c4=['options','raw','where','attributes','map','include','model','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0x82c4,0x17b));var _0x482c=function(_0x30aebd,_0x4d2300){_0x30aebd=_0x30aebd-0x0;var _0xf1f2bc=_0x82c4[_0x30aebd];return _0xf1f2bc;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require('moment');var BPromise=require(_0x482c('0x2'));var rs=require(_0x482c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x482c('0x4'));var logger=require(_0x482c('0x5'))(_0x482c('0x6'));var config=require('../../config/environment');var jayson=require(_0x482c('0x7'));var client=jayson[_0x482c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f0595,_0x44c850,_0x3d8c6c){return new BPromise(function(_0x5c60ec,_0x4570b9){return client['request'](_0x2f0595,_0x3d8c6c)[_0x482c('0x9')](function(_0x1e3829){logger[_0x482c('0xa')](_0x482c('0xb'),_0x44c850,_0x482c('0xc'));logger[_0x482c('0xd')](_0x482c('0xe'),_0x44c850,_0x482c('0xc'),JSON[_0x482c('0xf')](_0x1e3829));if(_0x1e3829[_0x482c('0x10')]){if(_0x1e3829[_0x482c('0x10')][_0x482c('0x11')]===0x1f4){logger['error'](_0x482c('0xb'),_0x44c850,_0x1e3829[_0x482c('0x10')][_0x482c('0x12')]);return _0x4570b9(_0x1e3829['error'][_0x482c('0x12')]);}logger[_0x482c('0x10')](_0x482c('0xb'),_0x44c850,_0x1e3829[_0x482c('0x10')]['message']);return _0x5c60ec(_0x1e3829['error']['message']);}else{logger[_0x482c('0xa')](_0x482c('0xb'),_0x44c850,_0x482c('0xc'));_0x5c60ec(_0x1e3829[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x55110){logger[_0x482c('0x10')](_0x482c('0xb'),_0x44c850,_0x55110);_0x4570b9(_0x55110);});});}exports[_0x482c('0x15')]=function(_0xe7bd4d){var _0x25c531=this;return new Promise(function(_0xc659fa,_0xb2a306){return db[_0x482c('0x16')][_0x482c('0x17')]({'raw':_0xe7bd4d[_0x482c('0x18')]?_0xe7bd4d[_0x482c('0x18')][_0x482c('0x19')]===undefined?!![]:![]:!![],'where':_0xe7bd4d['options']?_0xe7bd4d[_0x482c('0x18')][_0x482c('0x1a')]||null:null,'attributes':_0xe7bd4d[_0x482c('0x18')]?_0xe7bd4d[_0x482c('0x18')][_0x482c('0x1b')]||null:null,'include':_0xe7bd4d[_0x482c('0x18')]?_0xe7bd4d[_0x482c('0x18')]['include']?_[_0x482c('0x1c')](_0xe7bd4d['options'][_0x482c('0x1d')],function(_0x5634e5){return{'model':db[_0x5634e5[_0x482c('0x1e')]],'as':_0x5634e5['as'],'attributes':_0x5634e5[_0x482c('0x1b')],'include':_0x5634e5['include']?_[_0x482c('0x1c')](_0x5634e5[_0x482c('0x1d')],function(_0x8c590a){return{'model':db[_0x8c590a[_0x482c('0x1e')]],'as':_0x8c590a['as'],'attributes':_0x8c590a[_0x482c('0x1b')],'include':_0x8c590a[_0x482c('0x1d')]?_[_0x482c('0x1c')](_0x8c590a['include'],function(_0xf16ee8){return{'model':db[_0xf16ee8['model']],'as':_0xf16ee8['as'],'attributes':_0xf16ee8['attributes']};}):[]};}):[]};}):[]:[]})[_0x482c('0x9')](function(_0xd68822){logger[_0x482c('0xa')]('ShowSound',_0xe7bd4d);logger['debug']('ShowSound',_0xe7bd4d,JSON['stringify'](_0xd68822));_0xc659fa(_0xd68822);})['catch'](function(_0x36fe02){logger['error'](_0x482c('0x15'),_0x36fe02[_0x482c('0x12')],_0xe7bd4d);_0xb2a306(_0x25c531[_0x482c('0x10')](0x1f4,_0x36fe02[_0x482c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e3bd286..95eba14 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0xa25862,_0x27f1a4){var _0x5b9b0a=function(_0x300346){while(--_0x300346){_0xa25862['push'](_0xa25862['shift']());}};_0x5b9b0a(++_0x27f1a4);}(_0xda3f,0xec));var _0xfda3=function(_0x13913b,_0x2556e3){_0x13913b=_0x13913b-0x0;var _0x2b79bc=_0xda3f[_0x13913b];return _0x2b79bc;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x4ad9f0,_0x6ec64b){var _0x57d2df=function(_0x1d6bfa){while(--_0x1d6bfa){_0x4ad9f0['push'](_0x4ad9f0['shift']());}};_0x57d2df(++_0x6ec64b);}(_0x757a,0xde));var _0xa757=function(_0x132eb5,_0x2607a6){_0x132eb5=_0x132eb5-0x0;var _0x16229c=_0x757a[_0x132eb5];return _0x16229c;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 596ea3d..6840988 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 _0x614c=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x473bca,_0xd219ec){var _0x4e920c=function(_0x174797){while(--_0x174797){_0x473bca['push'](_0x473bca['shift']());}};_0x4e920c(++_0xd219ec);}(_0x614c,0xd2));var _0xc614=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x614c[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require(_0xc614('0x0'));module[_0xc614('0x1')]={'uniqueid':{'type':Sequelize[_0xc614('0x2')]},'body':{'type':Sequelize[_0xc614('0x3')](_0xc614('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xc614('0x5')]('in',_0xc614('0x6')),'defaultValue':_0xc614('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x558a=['medium','out','exports','STRING','TEXT'];(function(_0x25ddf7,_0x24f36b){var _0x2851b1=function(_0x2fc637){while(--_0x2fc637){_0x25ddf7['push'](_0x25ddf7['shift']());}};_0x2851b1(++_0x24f36b);}(_0x558a,0x101));var _0xa558=function(_0x17c624,_0x2c6f74){_0x17c624=_0x17c624-0x0;var _0x24c927=_0x558a[_0x17c624];return _0x24c927;};'use strict';var Sequelize=require('sequelize');module[_0xa558('0x0')]={'uniqueid':{'type':Sequelize[_0xa558('0x1')]},'body':{'type':Sequelize[_0xa558('0x2')](_0xa558('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa558('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xa558('0x1')]},'providerResponse':{'type':Sequelize[_0xa558('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c1946cb..0986aee 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 _0x7782=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','SquareMessage','length','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2eb376,_0x584b1b){var _0x45ea30=function(_0x56956e){while(--_0x56956e){_0x2eb376['push'](_0x2eb376['shift']());}};_0x45ea30(++_0x584b1b);}(_0x7782,0x134));var _0x2778=function(_0x59b903,_0x59ed63){_0x59b903=_0x59b903-0x0;var _0x563509=_0x7782[_0x59b903];return _0x563509;};'use strict';var emlformat=require(_0x2778('0x0'));var rimraf=require(_0x2778('0x1'));var zipdir=require(_0x2778('0x2'));var jsonpatch=require(_0x2778('0x3'));var rp=require('request-promise');var moment=require(_0x2778('0x4'));var BPromise=require(_0x2778('0x5'));var Mustache=require(_0x2778('0x6'));var util=require(_0x2778('0x7'));var path=require(_0x2778('0x8'));var sox=require(_0x2778('0x9'));var csv=require(_0x2778('0xa'));var ejs=require(_0x2778('0xb'));var fs=require('fs');var fs_extra=require(_0x2778('0xc'));var _=require(_0x2778('0xd'));var squel=require(_0x2778('0xe'));var crypto=require(_0x2778('0xf'));var jsforce=require(_0x2778('0x10'));var deskjs=require(_0x2778('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2778('0x12'));var Papa=require(_0x2778('0x13'));var Redis=require(_0x2778('0x14'));var authService=require(_0x2778('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x2778('0x16'));var hardwareService=require(_0x2778('0x17'));var logger=require(_0x2778('0x18'))(_0x2778('0x19'));var utils=require(_0x2778('0x1a'));var config=require(_0x2778('0x1b'));var licenseUtil=require(_0x2778('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x146615,_0x58ce62){_0x58ce62=_0x58ce62||0xcc;return function(_0x251d6a){if(_0x251d6a){return _0x146615[_0x2778('0x1d')](_0x58ce62);}return _0x146615[_0x2778('0x1e')](_0x58ce62)[_0x2778('0x1f')]();};}function respondWithResult(_0x249ee7,_0x5ca23b){_0x5ca23b=_0x5ca23b||0xc8;return function(_0x2336e4){if(_0x2336e4){return _0x249ee7[_0x2778('0x1e')](_0x5ca23b)[_0x2778('0x20')](_0x2336e4);}};}function respondWithFilteredResult(_0x49e0e5,_0x2ccd7c){return function(_0x57f546){if(_0x57f546){var _0x296067=typeof _0x2ccd7c[_0x2778('0x21')]===_0x2778('0x22')&&typeof _0x2ccd7c['limit']===_0x2778('0x22');var _0x58d74e=_0x57f546[_0x2778('0x23')];var _0x56d59a=_0x296067?0x0:_0x2ccd7c[_0x2778('0x21')];var _0x25edac=_0x296067?_0x57f546[_0x2778('0x23')]:_0x2ccd7c['offset']+_0x2ccd7c[_0x2778('0x24')];var _0x22fece;if(_0x25edac>=_0x58d74e){_0x25edac=_0x58d74e;_0x22fece=0xc8;}else{_0x22fece=0xce;}_0x49e0e5[_0x2778('0x1e')](_0x22fece);return _0x49e0e5[_0x2778('0x25')](_0x2778('0x26'),_0x56d59a+'-'+_0x25edac+'/'+_0x58d74e)[_0x2778('0x20')](_0x57f546);}return null;};}function patchUpdates(_0x6f0ed8){return function(_0x5ba89a){try{jsonpatch[_0x2778('0x27')](_0x5ba89a,_0x6f0ed8,!![]);}catch(_0x35c49b){return BPromise[_0x2778('0x28')](_0x35c49b);}return _0x5ba89a[_0x2778('0x29')]();};}function saveUpdates(_0x36a44f,_0x58ee02){return function(_0x229711){if(_0x229711){return _0x229711[_0x2778('0x2a')](_0x36a44f)[_0x2778('0x2b')](function(_0x55eb4d){return _0x55eb4d;});}return null;};}function removeEntity(_0x2bb7f2,_0x4b2de5){return function(_0x2cbd08){if(_0x2cbd08){return _0x2cbd08[_0x2778('0x2c')]()[_0x2778('0x2b')](function(){_0x2bb7f2[_0x2778('0x1e')](0xcc)[_0x2778('0x1f')]();});}};}function handleEntityNotFound(_0x3da83f,_0xfda515){return function(_0x21dd2f){if(!_0x21dd2f){_0x3da83f[_0x2778('0x1d')](0x194);}return _0x21dd2f;};}function handleError(_0x315b77,_0x2b75e9){_0x2b75e9=_0x2b75e9||0x1f4;return function(_0x9a1302){logger['error'](_0x9a1302[_0x2778('0x2d')]);if(_0x9a1302['name']){delete _0x9a1302['name'];}_0x315b77[_0x2778('0x1e')](_0x2b75e9)[_0x2778('0x2e')](_0x9a1302);};}exports[_0x2778('0x2f')]=function(_0x169a55,_0x3544f7){var _0x52af56={},_0x3c1cad={},_0x9549dc={'count':0x0,'rows':[]};var _0x43d3b0=_[_0x2778('0x30')](db['SquareMessage'][_0x2778('0x31')],function(_0x58e378){return{'name':_0x58e378[_0x2778('0x32')],'type':_0x58e378[_0x2778('0x33')][_0x2778('0x34')]};});_0x3c1cad[_0x2778('0x35')]=_['map'](_0x43d3b0,_0x2778('0x36'));_0x3c1cad[_0x2778('0x37')]=_[_0x2778('0x38')](_0x169a55[_0x2778('0x37')]);_0x3c1cad[_0x2778('0x39')]=_[_0x2778('0x3a')](_0x3c1cad[_0x2778('0x35')],_0x3c1cad[_0x2778('0x37')]);_0x52af56[_0x2778('0x3b')]=_[_0x2778('0x3a')](_0x3c1cad[_0x2778('0x35')],qs[_0x2778('0x3c')](_0x169a55['query']['fields']));_0x52af56['attributes']=_0x52af56['attributes']['length']?_0x52af56['attributes']:_0x3c1cad[_0x2778('0x35')];if(!_0x169a55['query'][_0x2778('0x3d')]('nolimit')){_0x52af56[_0x2778('0x24')]=qs[_0x2778('0x24')](_0x169a55[_0x2778('0x37')][_0x2778('0x24')]);_0x52af56[_0x2778('0x21')]=qs[_0x2778('0x21')](_0x169a55[_0x2778('0x37')][_0x2778('0x21')]);}_0x52af56[_0x2778('0x3e')]=qs['sort'](_0x169a55[_0x2778('0x37')]['sort']);_0x52af56[_0x2778('0x3f')]=qs[_0x2778('0x39')](_[_0x2778('0x40')](_0x169a55[_0x2778('0x37')],_0x3c1cad[_0x2778('0x39')]),_0x43d3b0);if(_0x169a55[_0x2778('0x37')]['filter']){_0x52af56['where']=_[_0x2778('0x41')](_0x52af56[_0x2778('0x3f')],{'$or':_[_0x2778('0x30')](_0x43d3b0,function(_0x3349fb){if(_0x3349fb[_0x2778('0x33')]!==_0x2778('0x42')){var _0x2f5c04={};_0x2f5c04[_0x3349fb[_0x2778('0x36')]]={'$like':'%'+_0x169a55[_0x2778('0x37')][_0x2778('0x43')]+'%'};return _0x2f5c04;}})});}_0x52af56=_[_0x2778('0x41')]({},_0x52af56,_0x169a55[_0x2778('0x44')]);var _0x7527cd={'where':_0x52af56[_0x2778('0x3f')]};return db['SquareMessage'][_0x2778('0x23')](_0x7527cd)[_0x2778('0x2b')](function(_0x252b35){_0x9549dc[_0x2778('0x23')]=_0x252b35;if(_0x169a55['query']['includeAll']){_0x52af56[_0x2778('0x45')]=[{'all':!![]}];}return db['SquareMessage'][_0x2778('0x46')](_0x52af56);})[_0x2778('0x2b')](function(_0x1d7750){_0x9549dc[_0x2778('0x47')]=_0x1d7750;return _0x9549dc;})[_0x2778('0x2b')](respondWithFilteredResult(_0x3544f7,_0x52af56))['catch'](handleError(_0x3544f7,null));};exports['show']=function(_0x43aee9,_0x4e03c1){var _0x1b1f62={'raw':!![],'where':{'id':_0x43aee9[_0x2778('0x48')]['id']}},_0x17e8db={};_0x17e8db[_0x2778('0x35')]=_[_0x2778('0x38')](db[_0x2778('0x49')]['rawAttributes']);_0x17e8db[_0x2778('0x37')]=_['keys'](_0x43aee9[_0x2778('0x37')]);_0x17e8db[_0x2778('0x39')]=_['intersection'](_0x17e8db['model'],_0x17e8db['query']);_0x1b1f62[_0x2778('0x3b')]=_[_0x2778('0x3a')](_0x17e8db[_0x2778('0x35')],qs[_0x2778('0x3c')](_0x43aee9[_0x2778('0x37')][_0x2778('0x3c')]));_0x1b1f62[_0x2778('0x3b')]=_0x1b1f62[_0x2778('0x3b')][_0x2778('0x4a')]?_0x1b1f62[_0x2778('0x3b')]:_0x17e8db[_0x2778('0x35')];if(_0x43aee9['query'][_0x2778('0x4b')]){_0x1b1f62[_0x2778('0x45')]=[{'all':!![]}];}_0x1b1f62=_[_0x2778('0x41')]({},_0x1b1f62,_0x43aee9[_0x2778('0x44')]);return db[_0x2778('0x49')][_0x2778('0x4c')](_0x1b1f62)[_0x2778('0x2b')](handleEntityNotFound(_0x4e03c1,null))[_0x2778('0x2b')](respondWithResult(_0x4e03c1,null))[_0x2778('0x4d')](handleError(_0x4e03c1,null));};exports['create']=function(_0x3938a8,_0x5a912b){return db[_0x2778('0x49')][_0x2778('0x4e')](_0x3938a8[_0x2778('0x4f')],{})[_0x2778('0x2b')](respondWithResult(_0x5a912b,0xc9))['catch'](handleError(_0x5a912b,null));};exports[_0x2778('0x2a')]=function(_0x40ac40,_0x3ec7a9){if(_0x40ac40[_0x2778('0x4f')]['id']){delete _0x40ac40[_0x2778('0x4f')]['id'];}return db[_0x2778('0x49')][_0x2778('0x4c')]({'where':{'id':_0x40ac40[_0x2778('0x48')]['id']}})[_0x2778('0x2b')](handleEntityNotFound(_0x3ec7a9,null))['then'](saveUpdates(_0x40ac40['body'],null))[_0x2778('0x2b')](respondWithResult(_0x3ec7a9,null))['catch'](handleError(_0x3ec7a9,null));};exports[_0x2778('0x2c')]=function(_0x402e66,_0x415121){return db[_0x2778('0x49')]['find']({'where':{'id':_0x402e66[_0x2778('0x48')]['id']}})['then'](handleEntityNotFound(_0x415121,null))[_0x2778('0x2b')](removeEntity(_0x415121,null))[_0x2778('0x4d')](handleError(_0x415121,null));}; \ No newline at end of file +var _0x83d9=['map','SquareMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','name','send'];(function(_0x266271,_0x5eac91){var _0x3bf3fd=function(_0x1da5e0){while(--_0x1da5e0){_0x266271['push'](_0x266271['shift']());}};_0x3bf3fd(++_0x5eac91);}(_0x83d9,0x134));var _0x983d=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x83d9[_0xf0bcac];return _0x4e4c65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x983d('0x0'));var zipdir=require(_0x983d('0x1'));var jsonpatch=require(_0x983d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x983d('0x3'));var util=require(_0x983d('0x4'));var path=require(_0x983d('0x5'));var sox=require(_0x983d('0x6'));var csv=require(_0x983d('0x7'));var ejs=require(_0x983d('0x8'));var fs=require('fs');var fs_extra=require(_0x983d('0x9'));var _=require(_0x983d('0xa'));var squel=require(_0x983d('0xb'));var crypto=require(_0x983d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x983d('0x7'));var querystring=require(_0x983d('0xd'));var Papa=require('papaparse');var Redis=require(_0x983d('0xe'));var authService=require(_0x983d('0xf'));var qs=require(_0x983d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x983d('0x11'));var logger=require(_0x983d('0x12'))(_0x983d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x983d('0x14'))['db'];function respondWithStatusCode(_0x47c3f7,_0x53575a){_0x53575a=_0x53575a||0xcc;return function(_0x57114e){if(_0x57114e){return _0x47c3f7[_0x983d('0x15')](_0x53575a);}return _0x47c3f7[_0x983d('0x16')](_0x53575a)[_0x983d('0x17')]();};}function respondWithResult(_0x9f87ff,_0x127f12){_0x127f12=_0x127f12||0xc8;return function(_0x1c6de1){if(_0x1c6de1){return _0x9f87ff[_0x983d('0x16')](_0x127f12)['json'](_0x1c6de1);}};}function respondWithFilteredResult(_0x39c63f,_0x5847ee){return function(_0x2cf3a5){if(_0x2cf3a5){var _0x39abb6=typeof _0x5847ee[_0x983d('0x18')]==='undefined'&&typeof _0x5847ee[_0x983d('0x19')]===_0x983d('0x1a');var _0x1dbe66=_0x2cf3a5[_0x983d('0x1b')];var _0x59e060=_0x39abb6?0x0:_0x5847ee['offset'];var _0x20885f=_0x39abb6?_0x2cf3a5[_0x983d('0x1b')]:_0x5847ee['offset']+_0x5847ee[_0x983d('0x19')];var _0xb84d59;if(_0x20885f>=_0x1dbe66){_0x20885f=_0x1dbe66;_0xb84d59=0xc8;}else{_0xb84d59=0xce;}_0x39c63f[_0x983d('0x16')](_0xb84d59);return _0x39c63f[_0x983d('0x1c')](_0x983d('0x1d'),_0x59e060+'-'+_0x20885f+'/'+_0x1dbe66)[_0x983d('0x1e')](_0x2cf3a5);}return null;};}function patchUpdates(_0x4c19a0){return function(_0x101077){try{jsonpatch[_0x983d('0x1f')](_0x101077,_0x4c19a0,!![]);}catch(_0x28a54b){return BPromise[_0x983d('0x20')](_0x28a54b);}return _0x101077[_0x983d('0x21')]();};}function saveUpdates(_0x43916f,_0x18b2c6){return function(_0x2fddca){if(_0x2fddca){return _0x2fddca['update'](_0x43916f)[_0x983d('0x22')](function(_0xa8d5ab){return _0xa8d5ab;});}return null;};}function removeEntity(_0x1ac4ec,_0x4a2653){return function(_0x184722){if(_0x184722){return _0x184722['destroy']()[_0x983d('0x22')](function(){_0x1ac4ec[_0x983d('0x16')](0xcc)[_0x983d('0x17')]();});}};}function handleEntityNotFound(_0x2bb9be,_0x1ab414){return function(_0x45ce11){if(!_0x45ce11){_0x2bb9be[_0x983d('0x15')](0x194);}return _0x45ce11;};}function handleError(_0x201e31,_0x52a78b){_0x52a78b=_0x52a78b||0x1f4;return function(_0x4ca386){logger['error'](_0x4ca386['stack']);if(_0x4ca386[_0x983d('0x23')]){delete _0x4ca386['name'];}_0x201e31[_0x983d('0x16')](_0x52a78b)[_0x983d('0x24')](_0x4ca386);};}exports['index']=function(_0x26e987,_0x1578d8){var _0x32202f={},_0x3878dd={},_0x2b70f8={'count':0x0,'rows':[]};var _0x192272=_[_0x983d('0x25')](db[_0x983d('0x26')][_0x983d('0x27')],function(_0x1622ba){return{'name':_0x1622ba[_0x983d('0x28')],'type':_0x1622ba[_0x983d('0x29')]['key']};});_0x3878dd[_0x983d('0x2a')]=_[_0x983d('0x25')](_0x192272,_0x983d('0x23'));_0x3878dd[_0x983d('0x2b')]=_['keys'](_0x26e987[_0x983d('0x2b')]);_0x3878dd['filters']=_[_0x983d('0x2c')](_0x3878dd[_0x983d('0x2a')],_0x3878dd['query']);_0x32202f[_0x983d('0x2d')]=_[_0x983d('0x2c')](_0x3878dd[_0x983d('0x2a')],qs['fields'](_0x26e987['query'][_0x983d('0x2e')]));_0x32202f[_0x983d('0x2d')]=_0x32202f[_0x983d('0x2d')][_0x983d('0x2f')]?_0x32202f['attributes']:_0x3878dd[_0x983d('0x2a')];if(!_0x26e987[_0x983d('0x2b')][_0x983d('0x30')](_0x983d('0x31'))){_0x32202f[_0x983d('0x19')]=qs[_0x983d('0x19')](_0x26e987['query'][_0x983d('0x19')]);_0x32202f[_0x983d('0x18')]=qs[_0x983d('0x18')](_0x26e987[_0x983d('0x2b')][_0x983d('0x18')]);}_0x32202f[_0x983d('0x32')]=qs[_0x983d('0x33')](_0x26e987[_0x983d('0x2b')]['sort']);_0x32202f['where']=qs[_0x983d('0x34')](_['pick'](_0x26e987[_0x983d('0x2b')],_0x3878dd['filters']),_0x192272);if(_0x26e987[_0x983d('0x2b')]['filter']){_0x32202f['where']=_[_0x983d('0x35')](_0x32202f[_0x983d('0x36')],{'$or':_[_0x983d('0x25')](_0x192272,function(_0x2919d7){if(_0x2919d7[_0x983d('0x29')]!=='VIRTUAL'){var _0x213140={};_0x213140[_0x2919d7['name']]={'$like':'%'+_0x26e987[_0x983d('0x2b')][_0x983d('0x37')]+'%'};return _0x213140;}})});}_0x32202f=_['merge']({},_0x32202f,_0x26e987[_0x983d('0x38')]);var _0x224f17={'where':_0x32202f[_0x983d('0x36')]};return db[_0x983d('0x26')][_0x983d('0x1b')](_0x224f17)[_0x983d('0x22')](function(_0x1e18cf){_0x2b70f8['count']=_0x1e18cf;if(_0x26e987['query'][_0x983d('0x39')]){_0x32202f[_0x983d('0x3a')]=[{'all':!![]}];}return db[_0x983d('0x26')]['findAll'](_0x32202f);})['then'](function(_0x2935a9){_0x2b70f8[_0x983d('0x3b')]=_0x2935a9;return _0x2b70f8;})[_0x983d('0x22')](respondWithFilteredResult(_0x1578d8,_0x32202f))[_0x983d('0x3c')](handleError(_0x1578d8,null));};exports[_0x983d('0x3d')]=function(_0x92ba82,_0x15ac5c){var _0x1d934c={'raw':!![],'where':{'id':_0x92ba82[_0x983d('0x3e')]['id']}},_0x52499c={};_0x52499c[_0x983d('0x2a')]=_[_0x983d('0x3f')](db[_0x983d('0x26')][_0x983d('0x27')]);_0x52499c[_0x983d('0x2b')]=_['keys'](_0x92ba82[_0x983d('0x2b')]);_0x52499c[_0x983d('0x34')]=_[_0x983d('0x2c')](_0x52499c[_0x983d('0x2a')],_0x52499c['query']);_0x1d934c[_0x983d('0x2d')]=_[_0x983d('0x2c')](_0x52499c[_0x983d('0x2a')],qs['fields'](_0x92ba82[_0x983d('0x2b')][_0x983d('0x2e')]));_0x1d934c[_0x983d('0x2d')]=_0x1d934c['attributes'][_0x983d('0x2f')]?_0x1d934c[_0x983d('0x2d')]:_0x52499c[_0x983d('0x2a')];if(_0x92ba82['query']['includeAll']){_0x1d934c[_0x983d('0x3a')]=[{'all':!![]}];}_0x1d934c=_[_0x983d('0x35')]({},_0x1d934c,_0x92ba82['options']);return db[_0x983d('0x26')][_0x983d('0x40')](_0x1d934c)[_0x983d('0x22')](handleEntityNotFound(_0x15ac5c,null))[_0x983d('0x22')](respondWithResult(_0x15ac5c,null))[_0x983d('0x3c')](handleError(_0x15ac5c,null));};exports[_0x983d('0x41')]=function(_0x2c2c2b,_0x24ef47){return db[_0x983d('0x26')][_0x983d('0x41')](_0x2c2c2b[_0x983d('0x42')],{})[_0x983d('0x22')](respondWithResult(_0x24ef47,0xc9))['catch'](handleError(_0x24ef47,null));};exports[_0x983d('0x43')]=function(_0x4e2557,_0x17b5b9){if(_0x4e2557[_0x983d('0x42')]['id']){delete _0x4e2557[_0x983d('0x42')]['id'];}return db[_0x983d('0x26')]['find']({'where':{'id':_0x4e2557[_0x983d('0x3e')]['id']}})[_0x983d('0x22')](handleEntityNotFound(_0x17b5b9,null))[_0x983d('0x22')](saveUpdates(_0x4e2557[_0x983d('0x42')],null))[_0x983d('0x22')](respondWithResult(_0x17b5b9,null))['catch'](handleError(_0x17b5b9,null));};exports[_0x983d('0x44')]=function(_0x34ad99,_0x2fc5f1){return db[_0x983d('0x26')][_0x983d('0x40')]({'where':{'id':_0x34ad99[_0x983d('0x3e')]['id']}})[_0x983d('0x22')](handleEntityNotFound(_0x2fc5f1,null))[_0x983d('0x22')](removeEntity(_0x2fc5f1,null))[_0x983d('0x3c')](handleError(_0x2fc5f1,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ca55732..82f0e02 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 _0x4739=['define','SquareMessage','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5eef42,_0x19f0cd){var _0x4cdb3d=function(_0x26d823){while(--_0x26d823){_0x5eef42['push'](_0x5eef42['shift']());}};_0x4cdb3d(++_0x19f0cd);}(_0x4739,0x178));var _0x9473=function(_0x1f4618,_0x2d2e66){_0x1f4618=_0x1f4618-0x0;var _0x48cc4b=_0x4739[_0x1f4618];return _0x48cc4b;};'use strict';var _=require(_0x9473('0x0'));var util=require(_0x9473('0x1'));var logger=require(_0x9473('0x2'))(_0x9473('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9473('0x4'));var fs=require('fs');var path=require(_0x9473('0x5'));var rimraf=require(_0x9473('0x6'));var config=require(_0x9473('0x7'));var attributes=require('./squareMessage.attributes');module[_0x9473('0x8')]=function(_0x731b3f,_0x3a401f){return _0x731b3f[_0x9473('0x9')](_0x9473('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x214b=['path','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x214b,0x8a));var _0xb214=function(_0x1094cb,_0x4cc56e){_0x1094cb=_0x1094cb-0x0;var _0x24a983=_0x214b[_0x1094cb];return _0x24a983;};'use strict';var _=require(_0xb214('0x0'));var util=require(_0xb214('0x1'));var logger=require(_0xb214('0x2'))(_0xb214('0x3'));var moment=require(_0xb214('0x4'));var BPromise=require('bluebird');var rp=require(_0xb214('0x5'));var fs=require('fs');var path=require(_0xb214('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb214('0x7'));module[_0xb214('0x8')]=function(_0x51c712,_0x30c772){return _0x51c712[_0xb214('0x9')](_0xb214('0xa'),attributes,{'tableName':_0xb214('0xb'),'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 5beeea0..e5b6c5f 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 _0x4fe3=['request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareMessage','SquareMessage','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SquareMessage,\x20%s,\x20%s'];(function(_0x1dda39,_0x221826){var _0x269408=function(_0x545613){while(--_0x545613){_0x1dda39['push'](_0x1dda39['shift']());}};_0x269408(++_0x221826);}(_0x4fe3,0xa8));var _0x34fe=function(_0x514654,_0x495bf9){_0x514654=_0x514654-0x0;var _0x1bb470=_0x4fe3[_0x514654];return _0x1bb470;};'use strict';var _=require(_0x34fe('0x0'));var util=require(_0x34fe('0x1'));var moment=require(_0x34fe('0x2'));var BPromise=require('bluebird');var rs=require(_0x34fe('0x3'));var fs=require('fs');var Redis=require(_0x34fe('0x4'));var db=require(_0x34fe('0x5'))['db'];var utils=require(_0x34fe('0x6'));var logger=require(_0x34fe('0x7'))(_0x34fe('0x8'));var config=require(_0x34fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x34fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x359464,_0x5099d5,_0x3b57cd){return new BPromise(function(_0x3a7398,_0x5a5c79){return client['request'](_0x359464,_0x3b57cd)[_0x34fe('0xb')](function(_0x34927b){logger[_0x34fe('0xc')](_0x34fe('0xd'),_0x5099d5,_0x34fe('0xe'));logger[_0x34fe('0xf')](_0x34fe('0x10'),_0x5099d5,_0x34fe('0xe'),JSON[_0x34fe('0x11')](_0x34927b));if(_0x34927b[_0x34fe('0x12')]){if(_0x34927b[_0x34fe('0x12')]['code']===0x1f4){logger[_0x34fe('0x12')]('SquareMessage,\x20%s,\x20%s',_0x5099d5,_0x34927b[_0x34fe('0x12')][_0x34fe('0x13')]);return _0x5a5c79(_0x34927b['error']['message']);}logger[_0x34fe('0x12')](_0x34fe('0xd'),_0x5099d5,_0x34927b[_0x34fe('0x12')]['message']);return _0x3a7398(_0x34927b[_0x34fe('0x12')][_0x34fe('0x13')]);}else{logger[_0x34fe('0xc')](_0x34fe('0xd'),_0x5099d5,'request\x20sent');_0x3a7398(_0x34927b[_0x34fe('0x14')][_0x34fe('0x13')]);}})['catch'](function(_0xd38058){logger[_0x34fe('0x12')](_0x34fe('0xd'),_0x5099d5,_0xd38058);_0x5a5c79(_0xd38058);});});}exports[_0x34fe('0x15')]=function(_0x562c7f){var _0x25da0d=this;return new Promise(function(_0x2c3a36,_0x2c8b20){return db[_0x34fe('0x16')]['create'](_0x562c7f['body'],{'raw':_0x562c7f[_0x34fe('0x17')]?_0x562c7f[_0x34fe('0x17')][_0x34fe('0x18')]===undefined?!![]:![]:!![]})[_0x34fe('0xb')](function(_0x4c80c1){logger['info']('CreateSquareMessage',_0x562c7f);logger[_0x34fe('0xf')](_0x34fe('0x15'),_0x562c7f,JSON[_0x34fe('0x11')](_0x4c80c1));_0x2c3a36(_0x4c80c1);})[_0x34fe('0x19')](function(_0x3220f8){logger[_0x34fe('0x12')]('CreateSquareMessage',_0x3220f8[_0x34fe('0x13')],_0x562c7f);_0x2c8b20(_0x25da0d[_0x34fe('0x12')](0x1f4,_0x3220f8[_0x34fe('0x13')]));});});}; \ No newline at end of file +var _0x7ce7=['message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x9adcd6,_0x36278b){var _0xdf8ff2=function(_0x4f7087){while(--_0x4f7087){_0x9adcd6['push'](_0x9adcd6['shift']());}};_0xdf8ff2(++_0x36278b);}(_0x7ce7,0x7e));var _0x77ce=function(_0x38419f,_0x3e326e){_0x38419f=_0x38419f-0x0;var _0x4ee9b3=_0x7ce7[_0x38419f];return _0x4ee9b3;};'use strict';var _=require(_0x77ce('0x0'));var util=require('util');var moment=require(_0x77ce('0x1'));var BPromise=require(_0x77ce('0x2'));var rs=require(_0x77ce('0x3'));var fs=require('fs');var Redis=require(_0x77ce('0x4'));var db=require(_0x77ce('0x5'))['db'];var utils=require(_0x77ce('0x6'));var logger=require('../../config/logger')(_0x77ce('0x7'));var config=require(_0x77ce('0x8'));var jayson=require(_0x77ce('0x9'));var client=jayson[_0x77ce('0xa')][_0x77ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9c99ab,_0x5208de,_0x1b0dd5){return new BPromise(function(_0x5a437d,_0x127540){return client[_0x77ce('0xc')](_0x9c99ab,_0x1b0dd5)[_0x77ce('0xd')](function(_0x1a23ca){logger['info'](_0x77ce('0xe'),_0x5208de,_0x77ce('0xf'));logger[_0x77ce('0x10')](_0x77ce('0x11'),_0x5208de,_0x77ce('0xf'),JSON['stringify'](_0x1a23ca));if(_0x1a23ca[_0x77ce('0x12')]){if(_0x1a23ca[_0x77ce('0x12')]['code']===0x1f4){logger[_0x77ce('0x12')]('SquareMessage,\x20%s,\x20%s',_0x5208de,_0x1a23ca[_0x77ce('0x12')][_0x77ce('0x13')]);return _0x127540(_0x1a23ca[_0x77ce('0x12')][_0x77ce('0x13')]);}logger[_0x77ce('0x12')](_0x77ce('0xe'),_0x5208de,_0x1a23ca[_0x77ce('0x12')][_0x77ce('0x13')]);return _0x5a437d(_0x1a23ca[_0x77ce('0x12')][_0x77ce('0x13')]);}else{logger[_0x77ce('0x14')]('SquareMessage,\x20%s,\x20%s',_0x5208de,_0x77ce('0xf'));_0x5a437d(_0x1a23ca[_0x77ce('0x15')][_0x77ce('0x13')]);}})[_0x77ce('0x16')](function(_0x2bfe71){logger[_0x77ce('0x12')](_0x77ce('0xe'),_0x5208de,_0x2bfe71);_0x127540(_0x2bfe71);});});}exports[_0x77ce('0x17')]=function(_0x26a14d){var _0x12130d=this;return new Promise(function(_0x7ddf90,_0x58142e){return db[_0x77ce('0x18')][_0x77ce('0x19')](_0x26a14d[_0x77ce('0x1a')],{'raw':_0x26a14d[_0x77ce('0x1b')]?_0x26a14d['options'][_0x77ce('0x1c')]===undefined?!![]:![]:!![]})[_0x77ce('0xd')](function(_0x34dde3){logger[_0x77ce('0x14')](_0x77ce('0x17'),_0x26a14d);logger[_0x77ce('0x10')](_0x77ce('0x17'),_0x26a14d,JSON['stringify'](_0x34dde3));_0x7ddf90(_0x34dde3);})['catch'](function(_0x670bcb){logger[_0x77ce('0x12')]('CreateSquareMessage',_0x670bcb[_0x77ce('0x13')],_0x26a14d);_0x58142e(_0x12130d[_0x77ce('0x12')](0x1f4,_0x670bcb['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 8b8b2bd..1096c47 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 _0x4222=['15s','test','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x4222,0x75));var _0x2422=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x4222[_0x32f7d7];return _0x133d09;};'use strict';var multer=require('multer');var util=require(_0x2422('0x0'));var path=require(_0x2422('0x1'));var timeout=require(_0x2422('0x2'));var express=require(_0x2422('0x3'));var router=express[_0x2422('0x4')]();var fs_extra=require(_0x2422('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2422('0x6'));var config=require(_0x2422('0x7'));var controller=require(_0x2422('0x8'));router[_0x2422('0x9')]('/',auth[_0x2422('0xa')](),controller[_0x2422('0xb')]);router['get'](_0x2422('0xc'),auth[_0x2422('0xa')](),controller[_0x2422('0xd')]);router[_0x2422('0x9')](_0x2422('0xe'),auth['isAuthenticated'](),timeout(_0x2422('0xf')),controller[_0x2422('0x10')]);router[_0x2422('0x11')]('/',auth[_0x2422('0xa')](),controller[_0x2422('0x12')]);router['put'](_0x2422('0xc'),auth['isAuthenticated'](),controller[_0x2422('0x13')]);router['delete'](_0x2422('0xc'),auth['isAuthenticated'](),controller[_0x2422('0x14')]);module[_0x2422('0x15')]=router; \ No newline at end of file +var _0x49b2=['update','delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','test','post','create','put'];(function(_0x46614f,_0x2d3cd7){var _0x5c77c5=function(_0xa8448a){while(--_0xa8448a){_0x46614f['push'](_0x46614f['shift']());}};_0x5c77c5(++_0x2d3cd7);}(_0x49b2,0xfb));var _0x249b=function(_0x10ab17,_0x24de77){_0x10ab17=_0x10ab17-0x0;var _0xbbb279=_0x49b2[_0x10ab17];return _0xbbb279;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x249b('0x0'));var timeout=require('connect-timeout');var express=require(_0x249b('0x1'));var router=express['Router']();var fs_extra=require(_0x249b('0x2'));var auth=require(_0x249b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x249b('0x4'));var controller=require(_0x249b('0x5'));router[_0x249b('0x6')]('/',auth[_0x249b('0x7')](),controller[_0x249b('0x8')]);router[_0x249b('0x6')](_0x249b('0x9'),auth[_0x249b('0x7')](),controller['show']);router[_0x249b('0x6')](_0x249b('0xa'),auth[_0x249b('0x7')](),timeout('15s'),controller[_0x249b('0xb')]);router[_0x249b('0xc')]('/',auth[_0x249b('0x7')](),controller[_0x249b('0xd')]);router[_0x249b('0xe')](_0x249b('0x9'),auth[_0x249b('0x7')](),controller[_0x249b('0xf')]);router[_0x249b('0x10')](_0x249b('0x9'),auth[_0x249b('0x7')](),controller[_0x249b('0x11')]);module[_0x249b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 4a7197a..f0cf3a2 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 _0xdef3=['exports','STRING','sequelize'];(function(_0x1fda0d,_0x4af2fd){var _0xdbf571=function(_0x4677c7){while(--_0x4677c7){_0x1fda0d['push'](_0x1fda0d['shift']());}};_0xdbf571(++_0x4af2fd);}(_0xdef3,0x197));var _0x3def=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xdef3[_0x3b90ab];return _0x206e92;};'use strict';var Sequelize=require(_0x3def('0x0'));module[_0x3def('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x3def('0x2')]},'description':{'type':Sequelize[_0x3def('0x2')]}}; \ No newline at end of file +var _0xdef8=['STRING','name'];(function(_0x29f014,_0x508522){var _0x316be5=function(_0x1753a5){while(--_0x1753a5){_0x29f014['push'](_0x29f014['shift']());}};_0x316be5(++_0x508522);}(_0xdef8,0x125));var _0x8def=function(_0x56b35c,_0x7c821b){_0x56b35c=_0x56b35c-0x0;var _0x360b30=_0xdef8[_0x56b35c];return _0x360b30;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8def('0x0'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8def('0x1')]},'description':{'type':Sequelize[_0x8def('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 8ad3dab..3ec1170 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 _0xb720=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','length','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','body','params','test','dsn','openSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x515425,_0x49aa8b){var _0x233091=function(_0x474b9a){while(--_0x474b9a){_0x515425['push'](_0x515425['shift']());}};_0x233091(++_0x49aa8b);}(_0xb720,0x1e2));var _0x0b72=function(_0x13fdb1,_0x1c6fba){_0x13fdb1=_0x13fdb1-0x0;var _0x55f710=_0xb720[_0x13fdb1];return _0x55f710;};'use strict';var emlformat=require(_0x0b72('0x0'));var rimraf=require(_0x0b72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b72('0x2'));var rp=require(_0x0b72('0x3'));var moment=require(_0x0b72('0x4'));var BPromise=require(_0x0b72('0x5'));var Mustache=require(_0x0b72('0x6'));var util=require(_0x0b72('0x7'));var path=require(_0x0b72('0x8'));var sox=require(_0x0b72('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0b72('0xa'));var crypto=require('crypto');var jsforce=require(_0x0b72('0xb'));var deskjs=require(_0x0b72('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0b72('0xd'));var Papa=require(_0x0b72('0xe'));var Redis=require(_0x0b72('0xf'));var authService=require(_0x0b72('0x10'));var qs=require(_0x0b72('0x11'));var as=require(_0x0b72('0x12'));var hardwareService=require(_0x0b72('0x13'));var logger=require(_0x0b72('0x14'))(_0x0b72('0x15'));var utils=require('../../config/utils');var config=require(_0x0b72('0x16'));var licenseUtil=require(_0x0b72('0x17'));var db=require(_0x0b72('0x18'))['db'];function respondWithStatusCode(_0x1e2e8d,_0x343673){_0x343673=_0x343673||0xcc;return function(_0x3208df){if(_0x3208df){return _0x1e2e8d['sendStatus'](_0x343673);}return _0x1e2e8d['status'](_0x343673)[_0x0b72('0x19')]();};}function respondWithResult(_0x11d022,_0x3c5c8b){_0x3c5c8b=_0x3c5c8b||0xc8;return function(_0x50c805){if(_0x50c805){return _0x11d022[_0x0b72('0x1a')](_0x3c5c8b)[_0x0b72('0x1b')](_0x50c805);}};}function respondWithFilteredResult(_0x4797c7,_0x2da94e){return function(_0x594099){if(_0x594099){var _0x971984=typeof _0x2da94e[_0x0b72('0x1c')]===_0x0b72('0x1d')&&typeof _0x2da94e[_0x0b72('0x1e')]==='undefined';var _0x2ab634=_0x594099[_0x0b72('0x1f')];var _0x26989e=_0x971984?0x0:_0x2da94e['offset'];var _0x1dbbc2=_0x971984?_0x594099[_0x0b72('0x1f')]:_0x2da94e[_0x0b72('0x1c')]+_0x2da94e[_0x0b72('0x1e')];var _0x62696c;if(_0x1dbbc2>=_0x2ab634){_0x1dbbc2=_0x2ab634;_0x62696c=0xc8;}else{_0x62696c=0xce;}_0x4797c7[_0x0b72('0x1a')](_0x62696c);return _0x4797c7[_0x0b72('0x20')](_0x0b72('0x21'),_0x26989e+'-'+_0x1dbbc2+'/'+_0x2ab634)[_0x0b72('0x1b')](_0x594099);}return null;};}function patchUpdates(_0x1974f9){return function(_0x2e02d5){try{jsonpatch['apply'](_0x2e02d5,_0x1974f9,!![]);}catch(_0x49a880){return BPromise['reject'](_0x49a880);}return _0x2e02d5[_0x0b72('0x22')]();};}function saveUpdates(_0x195264,_0x5d7257){return function(_0x37b34a){if(_0x37b34a){return _0x37b34a[_0x0b72('0x23')](_0x195264)[_0x0b72('0x24')](function(_0x2e8295){return _0x2e8295;});}return null;};}function removeEntity(_0x411061,_0x19a5ff){return function(_0x42c343){if(_0x42c343){return _0x42c343[_0x0b72('0x25')]()[_0x0b72('0x24')](function(){var _0x136d27=_0x42c343[_0x0b72('0x26')]({'plain':!![]});var _0x33b6e1=_0x0b72('0x27');return db[_0x0b72('0x28')][_0x0b72('0x25')]({'where':{'type':_0x33b6e1,'resourceId':_0x136d27['id']}})[_0x0b72('0x24')](function(){return _0x42c343;});})[_0x0b72('0x24')](function(){_0x411061[_0x0b72('0x1a')](0xcc)[_0x0b72('0x19')]();});}};}function handleEntityNotFound(_0x190daf,_0x36bf4f){return function(_0x3fff4f){if(!_0x3fff4f){_0x190daf[_0x0b72('0x29')](0x194);}return _0x3fff4f;};}function handleError(_0x1b197d,_0xffdc53){_0xffdc53=_0xffdc53||0x1f4;return function(_0x2c7003){logger[_0x0b72('0x2a')](_0x2c7003[_0x0b72('0x2b')]);if(_0x2c7003[_0x0b72('0x2c')]){delete _0x2c7003[_0x0b72('0x2c')];}_0x1b197d[_0x0b72('0x1a')](_0xffdc53)['send'](_0x2c7003);};}exports[_0x0b72('0x2d')]=function(_0x575ac8,_0x1ba72a){var _0x2decb0={},_0x9ad6f9={},_0x2884df={'count':0x0,'rows':[]};var _0x1592c6=_[_0x0b72('0x2e')](db[_0x0b72('0x2f')][_0x0b72('0x30')],function(_0x1b4742){return{'name':_0x1b4742[_0x0b72('0x31')],'type':_0x1b4742[_0x0b72('0x32')][_0x0b72('0x33')]};});_0x9ad6f9[_0x0b72('0x34')]=_[_0x0b72('0x2e')](_0x1592c6,_0x0b72('0x2c'));_0x9ad6f9[_0x0b72('0x35')]=_[_0x0b72('0x36')](_0x575ac8[_0x0b72('0x35')]);_0x9ad6f9[_0x0b72('0x37')]=_['intersection'](_0x9ad6f9[_0x0b72('0x34')],_0x9ad6f9[_0x0b72('0x35')]);_0x2decb0['attributes']=_[_0x0b72('0x38')](_0x9ad6f9[_0x0b72('0x34')],qs[_0x0b72('0x39')](_0x575ac8['query'][_0x0b72('0x39')]));_0x2decb0[_0x0b72('0x3a')]=_0x2decb0['attributes']['length']?_0x2decb0[_0x0b72('0x3a')]:_0x9ad6f9[_0x0b72('0x34')];if(!_0x575ac8['query']['hasOwnProperty']('nolimit')){_0x2decb0['limit']=qs[_0x0b72('0x1e')](_0x575ac8[_0x0b72('0x35')][_0x0b72('0x1e')]);_0x2decb0['offset']=qs[_0x0b72('0x1c')](_0x575ac8[_0x0b72('0x35')]['offset']);}_0x2decb0[_0x0b72('0x3b')]=qs[_0x0b72('0x3c')](_0x575ac8['query'][_0x0b72('0x3c')]);_0x2decb0[_0x0b72('0x3d')]=qs[_0x0b72('0x37')](_['pick'](_0x575ac8['query'],_0x9ad6f9[_0x0b72('0x37')]),_0x1592c6);if(_0x575ac8[_0x0b72('0x35')][_0x0b72('0x3e')]){_0x2decb0[_0x0b72('0x3d')]=_[_0x0b72('0x3f')](_0x2decb0[_0x0b72('0x3d')],{'$or':_['map'](_0x1592c6,function(_0x4be49f){if(_0x4be49f[_0x0b72('0x32')]!==_0x0b72('0x40')){var _0x2aa8c9={};_0x2aa8c9[_0x4be49f[_0x0b72('0x2c')]]={'$like':'%'+_0x575ac8[_0x0b72('0x35')][_0x0b72('0x3e')]+'%'};return _0x2aa8c9;}})});}_0x2decb0=_[_0x0b72('0x3f')]({},_0x2decb0,_0x575ac8[_0x0b72('0x41')]);var _0x430b4e={'where':_0x2decb0[_0x0b72('0x3d')]};return db['SquareOdbc'][_0x0b72('0x1f')](_0x430b4e)['then'](function(_0x2f1bbc){_0x2884df[_0x0b72('0x1f')]=_0x2f1bbc;if(_0x575ac8[_0x0b72('0x35')]['includeAll']){_0x2decb0['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x0b72('0x42')](_0x2decb0);})['then'](function(_0x38a108){_0x2884df[_0x0b72('0x43')]=_0x38a108;return _0x2884df;})['then'](respondWithFilteredResult(_0x1ba72a,_0x2decb0))[_0x0b72('0x44')](handleError(_0x1ba72a,null));};exports[_0x0b72('0x45')]=function(_0x5ddc73,_0x282cb1){var _0x49ddc5={'raw':!![],'where':{'id':_0x5ddc73['params']['id']}},_0x3a4d46={};_0x3a4d46[_0x0b72('0x34')]=_[_0x0b72('0x36')](db['SquareOdbc'][_0x0b72('0x30')]);_0x3a4d46[_0x0b72('0x35')]=_['keys'](_0x5ddc73['query']);_0x3a4d46['filters']=_[_0x0b72('0x38')](_0x3a4d46[_0x0b72('0x34')],_0x3a4d46['query']);_0x49ddc5['attributes']=_[_0x0b72('0x38')](_0x3a4d46[_0x0b72('0x34')],qs[_0x0b72('0x39')](_0x5ddc73[_0x0b72('0x35')][_0x0b72('0x39')]));_0x49ddc5[_0x0b72('0x3a')]=_0x49ddc5['attributes'][_0x0b72('0x46')]?_0x49ddc5['attributes']:_0x3a4d46[_0x0b72('0x34')];if(_0x5ddc73[_0x0b72('0x35')]['includeAll']){_0x49ddc5[_0x0b72('0x47')]=[{'all':!![]}];}_0x49ddc5=_[_0x0b72('0x3f')]({},_0x49ddc5,_0x5ddc73['options']);return db['SquareOdbc']['find'](_0x49ddc5)[_0x0b72('0x24')](handleEntityNotFound(_0x282cb1,null))[_0x0b72('0x24')](respondWithResult(_0x282cb1,null))[_0x0b72('0x44')](handleError(_0x282cb1,null));};exports[_0x0b72('0x48')]=function(_0x222103,_0x5ba07f){return db['SquareOdbc']['create'](_0x222103['body'],{})['then'](function(_0x33e9f3){var _0x3abec3=_0x222103['user']['get']({'plain':!![]});if(!_0x3abec3)throw new Error(_0x0b72('0x49'));if(_0x3abec3[_0x0b72('0x4a')]==='user'){var _0x491608=_0x33e9f3[_0x0b72('0x26')]({'plain':!![]});var _0x42ddd5='ODBC';return db[_0x0b72('0x4b')][_0x0b72('0x4c')]({'where':{'name':_0x42ddd5,'userProfileId':_0x3abec3['userProfileId']},'raw':!![]})[_0x0b72('0x24')](function(_0x45a8e5){if(_0x45a8e5&&_0x45a8e5['autoAssociation']===0x0){return db['UserProfileResource'][_0x0b72('0x48')]({'name':_0x491608[_0x0b72('0x2c')],'resourceId':_0x491608['id'],'type':_0x45a8e5[_0x0b72('0x2c')],'sectionId':_0x45a8e5['id']},{})['then'](function(){return _0x33e9f3;});}else{return _0x33e9f3;}})['catch'](function(_0x3d6d63){logger[_0x0b72('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d6d63);throw _0x3d6d63;});}return _0x33e9f3;})[_0x0b72('0x24')](respondWithResult(_0x5ba07f,0xc9))[_0x0b72('0x44')](handleError(_0x5ba07f,null));};exports['update']=function(_0x36ec79,_0x167313){if(_0x36ec79[_0x0b72('0x4d')]['id']){delete _0x36ec79['body']['id'];}return db['SquareOdbc'][_0x0b72('0x4c')]({'where':{'id':_0x36ec79[_0x0b72('0x4e')]['id']}})[_0x0b72('0x24')](handleEntityNotFound(_0x167313,null))['then'](saveUpdates(_0x36ec79[_0x0b72('0x4d')],null))[_0x0b72('0x24')](respondWithResult(_0x167313,null))[_0x0b72('0x44')](handleError(_0x167313,null));};exports[_0x0b72('0x25')]=function(_0x113982,_0x4c40dc){return db[_0x0b72('0x2f')][_0x0b72('0x4c')]({'where':{'id':_0x113982[_0x0b72('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c40dc,null))[_0x0b72('0x24')](removeEntity(_0x4c40dc,null))['catch'](handleError(_0x4c40dc,null));};exports[_0x0b72('0x4f')]=function(_0x10ae70,_0x201cc6,_0x15fe32){var _0x253b7b;return db['SquareOdbc'][_0x0b72('0x4c')]({'where':{'id':_0x10ae70[_0x0b72('0x4e')]['id']},'attributes':['id',_0x0b72('0x50')]})[_0x0b72('0x24')](handleEntityNotFound(_0x201cc6,null))[_0x0b72('0x24')](function(_0x3e0e65){if(_0x3e0e65){var _0x257671=require('odbc')();_0x257671[_0x0b72('0x51')](_0x3e0e65[_0x0b72('0x50')]);_0x257671['closeSync']();return _0x3e0e65;}})['then'](respondWithResult(_0x201cc6,null))[_0x0b72('0x44')](handleError(_0x201cc6,null));}; \ No newline at end of file +var _0x0489=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','get','ODBC','error','stack','name','index','map','SquareOdbc','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0x0489,0x1f0));var _0x9048=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0x0489[_0x31c5e9];return _0x517a8d;};'use strict';var emlformat=require(_0x9048('0x0'));var rimraf=require(_0x9048('0x1'));var zipdir=require(_0x9048('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9048('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9048('0x4'));var path=require(_0x9048('0x5'));var sox=require(_0x9048('0x6'));var csv=require(_0x9048('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9048('0x8'));var squel=require(_0x9048('0x9'));var crypto=require(_0x9048('0xa'));var jsforce=require(_0x9048('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9048('0xc'));var Redis=require(_0x9048('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9048('0xe'));var as=require(_0x9048('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9048('0x10'))(_0x9048('0x11'));var utils=require(_0x9048('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9048('0x13'));var db=require(_0x9048('0x14'))['db'];function respondWithStatusCode(_0x1d47ec,_0x51aaf4){_0x51aaf4=_0x51aaf4||0xcc;return function(_0x477814){if(_0x477814){return _0x1d47ec[_0x9048('0x15')](_0x51aaf4);}return _0x1d47ec[_0x9048('0x16')](_0x51aaf4)[_0x9048('0x17')]();};}function respondWithResult(_0xd08fe6,_0x21c129){_0x21c129=_0x21c129||0xc8;return function(_0x43fb52){if(_0x43fb52){return _0xd08fe6['status'](_0x21c129)[_0x9048('0x18')](_0x43fb52);}};}function respondWithFilteredResult(_0x4d427c,_0x5c0bfa){return function(_0x33f7ea){if(_0x33f7ea){var _0x3ec7bf=typeof _0x5c0bfa[_0x9048('0x19')]===_0x9048('0x1a')&&typeof _0x5c0bfa[_0x9048('0x1b')]===_0x9048('0x1a');var _0x102168=_0x33f7ea['count'];var _0x15c5f0=_0x3ec7bf?0x0:_0x5c0bfa[_0x9048('0x19')];var _0x2dfd8f=_0x3ec7bf?_0x33f7ea['count']:_0x5c0bfa[_0x9048('0x19')]+_0x5c0bfa['limit'];var _0x4cab47;if(_0x2dfd8f>=_0x102168){_0x2dfd8f=_0x102168;_0x4cab47=0xc8;}else{_0x4cab47=0xce;}_0x4d427c[_0x9048('0x16')](_0x4cab47);return _0x4d427c[_0x9048('0x1c')](_0x9048('0x1d'),_0x15c5f0+'-'+_0x2dfd8f+'/'+_0x102168)['json'](_0x33f7ea);}return null;};}function patchUpdates(_0xed6bb2){return function(_0x5adcd4){try{jsonpatch[_0x9048('0x1e')](_0x5adcd4,_0xed6bb2,!![]);}catch(_0x381496){return BPromise['reject'](_0x381496);}return _0x5adcd4['save']();};}function saveUpdates(_0x474e28,_0x2e7f93){return function(_0x3b4173){if(_0x3b4173){return _0x3b4173[_0x9048('0x1f')](_0x474e28)[_0x9048('0x20')](function(_0x65e0ec){return _0x65e0ec;});}return null;};}function removeEntity(_0x364711,_0x575b97){return function(_0x25b114){if(_0x25b114){return _0x25b114[_0x9048('0x21')]()[_0x9048('0x20')](function(){var _0x41b257=_0x25b114[_0x9048('0x22')]({'plain':!![]});var _0x40cc60=_0x9048('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x40cc60,'resourceId':_0x41b257['id']}})[_0x9048('0x20')](function(){return _0x25b114;});})[_0x9048('0x20')](function(){_0x364711[_0x9048('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x786171,_0x1523f9){return function(_0xdd818){if(!_0xdd818){_0x786171['sendStatus'](0x194);}return _0xdd818;};}function handleError(_0x179e04,_0x4382b1){_0x4382b1=_0x4382b1||0x1f4;return function(_0x438a0d){logger[_0x9048('0x24')](_0x438a0d[_0x9048('0x25')]);if(_0x438a0d[_0x9048('0x26')]){delete _0x438a0d['name'];}_0x179e04[_0x9048('0x16')](_0x4382b1)['send'](_0x438a0d);};}exports[_0x9048('0x27')]=function(_0x22fcc1,_0x37da41){var _0x36c900={},_0x289d10={},_0xe8851e={'count':0x0,'rows':[]};var _0x50c162=_[_0x9048('0x28')](db[_0x9048('0x29')]['rawAttributes'],function(_0x47f292){return{'name':_0x47f292[_0x9048('0x2a')],'type':_0x47f292[_0x9048('0x2b')][_0x9048('0x2c')]};});_0x289d10[_0x9048('0x2d')]=_['map'](_0x50c162,_0x9048('0x26'));_0x289d10[_0x9048('0x2e')]=_['keys'](_0x22fcc1[_0x9048('0x2e')]);_0x289d10[_0x9048('0x2f')]=_[_0x9048('0x30')](_0x289d10[_0x9048('0x2d')],_0x289d10[_0x9048('0x2e')]);_0x36c900[_0x9048('0x31')]=_['intersection'](_0x289d10['model'],qs['fields'](_0x22fcc1['query']['fields']));_0x36c900[_0x9048('0x31')]=_0x36c900['attributes'][_0x9048('0x32')]?_0x36c900['attributes']:_0x289d10[_0x9048('0x2d')];if(!_0x22fcc1[_0x9048('0x2e')][_0x9048('0x33')](_0x9048('0x34'))){_0x36c900['limit']=qs[_0x9048('0x1b')](_0x22fcc1['query']['limit']);_0x36c900['offset']=qs[_0x9048('0x19')](_0x22fcc1[_0x9048('0x2e')][_0x9048('0x19')]);}_0x36c900['order']=qs[_0x9048('0x35')](_0x22fcc1[_0x9048('0x2e')][_0x9048('0x35')]);_0x36c900['where']=qs['filters'](_[_0x9048('0x36')](_0x22fcc1[_0x9048('0x2e')],_0x289d10[_0x9048('0x2f')]),_0x50c162);if(_0x22fcc1[_0x9048('0x2e')]['filter']){_0x36c900['where']=_['merge'](_0x36c900[_0x9048('0x37')],{'$or':_[_0x9048('0x28')](_0x50c162,function(_0x537a41){if(_0x537a41['type']!==_0x9048('0x38')){var _0x54821c={};_0x54821c[_0x537a41[_0x9048('0x26')]]={'$like':'%'+_0x22fcc1[_0x9048('0x2e')][_0x9048('0x39')]+'%'};return _0x54821c;}})});}_0x36c900=_[_0x9048('0x3a')]({},_0x36c900,_0x22fcc1[_0x9048('0x3b')]);var _0x316f99={'where':_0x36c900[_0x9048('0x37')]};return db[_0x9048('0x29')][_0x9048('0x3c')](_0x316f99)[_0x9048('0x20')](function(_0x335887){_0xe8851e['count']=_0x335887;if(_0x22fcc1[_0x9048('0x2e')][_0x9048('0x3d')]){_0x36c900[_0x9048('0x3e')]=[{'all':!![]}];}return db[_0x9048('0x29')][_0x9048('0x3f')](_0x36c900);})[_0x9048('0x20')](function(_0x303080){_0xe8851e[_0x9048('0x40')]=_0x303080;return _0xe8851e;})[_0x9048('0x20')](respondWithFilteredResult(_0x37da41,_0x36c900))[_0x9048('0x41')](handleError(_0x37da41,null));};exports[_0x9048('0x42')]=function(_0x49823c,_0x2889b1){var _0x234b82={'raw':!![],'where':{'id':_0x49823c[_0x9048('0x43')]['id']}},_0x1104a1={};_0x1104a1[_0x9048('0x2d')]=_['keys'](db[_0x9048('0x29')][_0x9048('0x44')]);_0x1104a1['query']=_['keys'](_0x49823c[_0x9048('0x2e')]);_0x1104a1['filters']=_['intersection'](_0x1104a1[_0x9048('0x2d')],_0x1104a1[_0x9048('0x2e')]);_0x234b82[_0x9048('0x31')]=_[_0x9048('0x30')](_0x1104a1[_0x9048('0x2d')],qs[_0x9048('0x45')](_0x49823c[_0x9048('0x2e')][_0x9048('0x45')]));_0x234b82[_0x9048('0x31')]=_0x234b82[_0x9048('0x31')][_0x9048('0x32')]?_0x234b82[_0x9048('0x31')]:_0x1104a1['model'];if(_0x49823c['query'][_0x9048('0x3d')]){_0x234b82[_0x9048('0x3e')]=[{'all':!![]}];}_0x234b82=_[_0x9048('0x3a')]({},_0x234b82,_0x49823c[_0x9048('0x3b')]);return db[_0x9048('0x29')]['find'](_0x234b82)[_0x9048('0x20')](handleEntityNotFound(_0x2889b1,null))[_0x9048('0x20')](respondWithResult(_0x2889b1,null))['catch'](handleError(_0x2889b1,null));};exports[_0x9048('0x46')]=function(_0x2ea8c3,_0x4e2c09){return db[_0x9048('0x29')][_0x9048('0x46')](_0x2ea8c3[_0x9048('0x47')],{})[_0x9048('0x20')](function(_0x70d7d0){var _0x5170a3=_0x2ea8c3[_0x9048('0x48')][_0x9048('0x22')]({'plain':!![]});if(!_0x5170a3)throw new Error(_0x9048('0x49'));if(_0x5170a3['role']===_0x9048('0x48')){var _0x1266c8=_0x70d7d0[_0x9048('0x22')]({'plain':!![]});var _0x3fb988=_0x9048('0x23');return db[_0x9048('0x4a')][_0x9048('0x4b')]({'where':{'name':_0x3fb988,'userProfileId':_0x5170a3[_0x9048('0x4c')]},'raw':!![]})['then'](function(_0x2acf19){if(_0x2acf19&&_0x2acf19[_0x9048('0x4d')]===0x0){return db[_0x9048('0x4e')][_0x9048('0x46')]({'name':_0x1266c8[_0x9048('0x26')],'resourceId':_0x1266c8['id'],'type':_0x2acf19['name'],'sectionId':_0x2acf19['id']},{})[_0x9048('0x20')](function(){return _0x70d7d0;});}else{return _0x70d7d0;}})[_0x9048('0x41')](function(_0x9a6c9e){logger[_0x9048('0x24')](_0x9048('0x4f'),_0x9a6c9e);throw _0x9a6c9e;});}return _0x70d7d0;})['then'](respondWithResult(_0x4e2c09,0xc9))['catch'](handleError(_0x4e2c09,null));};exports[_0x9048('0x1f')]=function(_0x1be032,_0x8a6374){if(_0x1be032[_0x9048('0x47')]['id']){delete _0x1be032[_0x9048('0x47')]['id'];}return db[_0x9048('0x29')][_0x9048('0x4b')]({'where':{'id':_0x1be032[_0x9048('0x43')]['id']}})[_0x9048('0x20')](handleEntityNotFound(_0x8a6374,null))['then'](saveUpdates(_0x1be032['body'],null))[_0x9048('0x20')](respondWithResult(_0x8a6374,null))[_0x9048('0x41')](handleError(_0x8a6374,null));};exports['destroy']=function(_0x16f40e,_0x3e5b35){return db[_0x9048('0x29')]['find']({'where':{'id':_0x16f40e[_0x9048('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e5b35,null))['then'](removeEntity(_0x3e5b35,null))['catch'](handleError(_0x3e5b35,null));};exports['test']=function(_0x34c6c,_0xf9adeb,_0x184644){var _0x56e634;return db['SquareOdbc']['find']({'where':{'id':_0x34c6c[_0x9048('0x43')]['id']},'attributes':['id',_0x9048('0x50')]})[_0x9048('0x20')](handleEntityNotFound(_0xf9adeb,null))[_0x9048('0x20')](function(_0x16a616){if(_0x16a616){var _0x477b9a=require(_0x9048('0x51'))();_0x477b9a[_0x9048('0x52')](_0x16a616[_0x9048('0x50')]);_0x477b9a[_0x9048('0x53')]();return _0x16a616;}})[_0x9048('0x20')](respondWithResult(_0xf9adeb,null))[_0x9048('0x41')](handleError(_0xf9adeb,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 727b21a..1c53ae5 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 _0x3ede=['bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util','api'];(function(_0x42aba3,_0x4ef48f){var _0x33b03c=function(_0x424739){while(--_0x424739){_0x42aba3['push'](_0x42aba3['shift']());}};_0x33b03c(++_0x4ef48f);}(_0x3ede,0xd9));var _0xe3ed=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x3ede[_0x5c468f];return _0x2136b0;};'use strict';var _=require(_0xe3ed('0x0'));var util=require(_0xe3ed('0x1'));var logger=require('../../config/logger')(_0xe3ed('0x2'));var moment=require('moment');var BPromise=require(_0xe3ed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3ed('0x4'));var rimraf=require(_0xe3ed('0x5'));var config=require(_0xe3ed('0x6'));var attributes=require(_0xe3ed('0x7'));module['exports']=function(_0x34db36,_0x26ec28){return _0x34db36[_0xe3ed('0x8')](_0xe3ed('0x9'),attributes,{'tableName':_0xe3ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4808=['exports','SquareOdbc','square_odbc','util','../../config/logger','api','moment','bluebird','request-promise','path','./squareOdbc.attributes'];(function(_0x2e0661,_0x22ad87){var _0x2185d5=function(_0x58f56f){while(--_0x58f56f){_0x2e0661['push'](_0x2e0661['shift']());}};_0x2185d5(++_0x22ad87);}(_0x4808,0xd4));var _0x8480=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x4808[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0x8480('0x0'));var logger=require(_0x8480('0x1'))(_0x8480('0x2'));var moment=require(_0x8480('0x3'));var BPromise=require(_0x8480('0x4'));var rp=require(_0x8480('0x5'));var fs=require('fs');var path=require(_0x8480('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8480('0x7'));module[_0x8480('0x8')]=function(_0x47b1c9,_0x18ec11){return _0x47b1c9['define'](_0x8480('0x9'),attributes,{'tableName':_0x8480('0xa'),'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 4e60d22..1163566 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 _0x252a=['stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x2d398b,_0x5e98f8){var _0x5d8b9d=function(_0x121a78){while(--_0x121a78){_0x2d398b['push'](_0x2d398b['shift']());}};_0x5d8b9d(++_0x5e98f8);}(_0x252a,0x72));var _0xa252=function(_0x275a18,_0x589410){_0x275a18=_0x275a18-0x0;var _0x2ee544=_0x252a[_0x275a18];return _0x2ee544;};'use strict';var _=require(_0xa252('0x0'));var util=require(_0xa252('0x1'));var moment=require(_0xa252('0x2'));var BPromise=require('bluebird');var rs=require(_0xa252('0x3'));var fs=require('fs');var Redis=require(_0xa252('0x4'));var db=require(_0xa252('0x5'))['db'];var utils=require(_0xa252('0x6'));var logger=require(_0xa252('0x7'))(_0xa252('0x8'));var config=require(_0xa252('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa252('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cd6c1,_0x6081ab,_0x2edaac){return new BPromise(function(_0x787d05,_0x3a02c1){return client[_0xa252('0xb')](_0x5cd6c1,_0x2edaac)[_0xa252('0xc')](function(_0x27a5ec){logger[_0xa252('0xd')](_0xa252('0xe'),_0x6081ab,_0xa252('0xf'));logger[_0xa252('0x10')](_0xa252('0x11'),_0x6081ab,_0xa252('0xf'),JSON[_0xa252('0x12')](_0x27a5ec));if(_0x27a5ec[_0xa252('0x13')]){if(_0x27a5ec['error'][_0xa252('0x14')]===0x1f4){logger[_0xa252('0x13')](_0xa252('0xe'),_0x6081ab,_0x27a5ec['error']['message']);return _0x3a02c1(_0x27a5ec[_0xa252('0x13')]['message']);}logger[_0xa252('0x13')](_0xa252('0xe'),_0x6081ab,_0x27a5ec[_0xa252('0x13')][_0xa252('0x15')]);return _0x787d05(_0x27a5ec[_0xa252('0x13')][_0xa252('0x15')]);}else{logger[_0xa252('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x6081ab,_0xa252('0xf'));_0x787d05(_0x27a5ec[_0xa252('0x16')][_0xa252('0x15')]);}})[_0xa252('0x17')](function(_0x577dcb){logger[_0xa252('0x13')](_0xa252('0xe'),_0x6081ab,_0x577dcb);_0x3a02c1(_0x577dcb);});});}exports[_0xa252('0x18')]=function(_0x2633ca){var _0x5c21c8=this;return new Promise(function(_0x2230aa,_0x5beea3){return db[_0xa252('0x19')][_0xa252('0x1a')]({'raw':_0x2633ca[_0xa252('0x1b')]?_0x2633ca[_0xa252('0x1b')][_0xa252('0x1c')]===undefined?!![]:![]:!![],'where':_0x2633ca[_0xa252('0x1b')]?_0x2633ca['options']['where']||null:null,'attributes':_0x2633ca[_0xa252('0x1b')]?_0x2633ca['options']['attributes']||null:null,'include':_0x2633ca[_0xa252('0x1b')]?_0x2633ca[_0xa252('0x1b')][_0xa252('0x1d')]?_[_0xa252('0x1e')](_0x2633ca[_0xa252('0x1b')][_0xa252('0x1d')],function(_0x5e5b99){return{'model':db[_0x5e5b99[_0xa252('0x1f')]],'as':_0x5e5b99['as'],'attributes':_0x5e5b99['attributes'],'include':_0x5e5b99[_0xa252('0x1d')]?_[_0xa252('0x1e')](_0x5e5b99[_0xa252('0x1d')],function(_0x22e27c){return{'model':db[_0x22e27c[_0xa252('0x1f')]],'as':_0x22e27c['as'],'attributes':_0x22e27c[_0xa252('0x20')],'include':_0x22e27c[_0xa252('0x1d')]?_[_0xa252('0x1e')](_0x22e27c['include'],function(_0x2540c7){return{'model':db[_0x2540c7[_0xa252('0x1f')]],'as':_0x2540c7['as'],'attributes':_0x2540c7[_0xa252('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa252('0xc')](function(_0x260fc9){logger['info'](_0xa252('0x18'),_0x2633ca);logger[_0xa252('0x10')]('ShowSquareOdbc',_0x2633ca,JSON[_0xa252('0x12')](_0x260fc9));_0x2230aa(_0x260fc9);})[_0xa252('0x17')](function(_0x249853){logger[_0xa252('0x13')](_0xa252('0x18'),_0x249853['message'],_0x2633ca);_0x5beea3(_0x5c21c8[_0xa252('0x13')](0x1f4,_0x249853[_0xa252('0x15')]));});});}; \ No newline at end of file +var _0x8d5e=['http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','include','map','model','attributes','debug','lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1a3509,_0x37ab8d){var _0x364c19=function(_0x201721){while(--_0x201721){_0x1a3509['push'](_0x1a3509['shift']());}};_0x364c19(++_0x37ab8d);}(_0x8d5e,0xfd));var _0xe8d5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8d5e[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xe8d5('0x0'));var util=require(_0xe8d5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe8d5('0x2'));var logger=require(_0xe8d5('0x3'))(_0xe8d5('0x4'));var config=require(_0xe8d5('0x5'));var jayson=require(_0xe8d5('0x6'));var client=jayson[_0xe8d5('0x7')][_0xe8d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x315ff8,_0x2f5d2d,_0x545ffb){return new BPromise(function(_0x386a78,_0x2332b5){return client[_0xe8d5('0x9')](_0x315ff8,_0x545ffb)[_0xe8d5('0xa')](function(_0x4be548){logger[_0xe8d5('0xb')](_0xe8d5('0xc'),_0x2f5d2d,_0xe8d5('0xd'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x2f5d2d,_0xe8d5('0xd'),JSON[_0xe8d5('0xe')](_0x4be548));if(_0x4be548[_0xe8d5('0xf')]){if(_0x4be548[_0xe8d5('0xf')][_0xe8d5('0x10')]===0x1f4){logger[_0xe8d5('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x2f5d2d,_0x4be548['error'][_0xe8d5('0x11')]);return _0x2332b5(_0x4be548[_0xe8d5('0xf')]['message']);}logger['error'](_0xe8d5('0xc'),_0x2f5d2d,_0x4be548[_0xe8d5('0xf')][_0xe8d5('0x11')]);return _0x386a78(_0x4be548[_0xe8d5('0xf')][_0xe8d5('0x11')]);}else{logger[_0xe8d5('0xb')](_0xe8d5('0xc'),_0x2f5d2d,_0xe8d5('0xd'));_0x386a78(_0x4be548['result']['message']);}})[_0xe8d5('0x12')](function(_0x3613ce){logger[_0xe8d5('0xf')](_0xe8d5('0xc'),_0x2f5d2d,_0x3613ce);_0x2332b5(_0x3613ce);});});}exports[_0xe8d5('0x13')]=function(_0x1c59d9){var _0x3b55eb=this;return new Promise(function(_0x388943,_0x3c8540){return db[_0xe8d5('0x14')][_0xe8d5('0x15')]({'raw':_0x1c59d9[_0xe8d5('0x16')]?_0x1c59d9['options'][_0xe8d5('0x17')]===undefined?!![]:![]:!![],'where':_0x1c59d9[_0xe8d5('0x16')]?_0x1c59d9['options']['where']||null:null,'attributes':_0x1c59d9[_0xe8d5('0x16')]?_0x1c59d9['options']['attributes']||null:null,'include':_0x1c59d9[_0xe8d5('0x16')]?_0x1c59d9['options'][_0xe8d5('0x18')]?_['map'](_0x1c59d9[_0xe8d5('0x16')][_0xe8d5('0x18')],function(_0x2401f4){return{'model':db[_0x2401f4['model']],'as':_0x2401f4['as'],'attributes':_0x2401f4['attributes'],'include':_0x2401f4['include']?_[_0xe8d5('0x19')](_0x2401f4[_0xe8d5('0x18')],function(_0x3b9a84){return{'model':db[_0x3b9a84[_0xe8d5('0x1a')]],'as':_0x3b9a84['as'],'attributes':_0x3b9a84[_0xe8d5('0x1b')],'include':_0x3b9a84['include']?_[_0xe8d5('0x19')](_0x3b9a84[_0xe8d5('0x18')],function(_0x3f8c04){return{'model':db[_0x3f8c04[_0xe8d5('0x1a')]],'as':_0x3f8c04['as'],'attributes':_0x3f8c04[_0xe8d5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11b74d){logger[_0xe8d5('0xb')](_0xe8d5('0x13'),_0x1c59d9);logger[_0xe8d5('0x1c')](_0xe8d5('0x13'),_0x1c59d9,JSON[_0xe8d5('0xe')](_0x11b74d));_0x388943(_0x11b74d);})[_0xe8d5('0x12')](function(_0x29ac1e){logger['error']('ShowSquareOdbc',_0x29ac1e[_0xe8d5('0x11')],_0x1c59d9);_0x3c8540(_0x3b55eb[_0xe8d5('0xf')](0x1f4,_0x29ac1e[_0xe8d5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 38e916f..79e0490 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 _0x7334=['get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','update','delete','destroy','removeUsers','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x37b943,_0x609d18){var _0x54e67a=function(_0x409a2c){while(--_0x409a2c){_0x37b943['push'](_0x37b943['shift']());}};_0x54e67a(++_0x609d18);}(_0x7334,0x184));var _0x4733=function(_0x18632e,_0x47e775){_0x18632e=_0x18632e-0x0;var _0x3fed75=_0x7334[_0x18632e];return _0x3fed75;};'use strict';var multer=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4733('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4733('0x4'));var interaction=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var controller=require(_0x4733('0x7'));router[_0x4733('0x8')]('/',auth[_0x4733('0x9')](),controller[_0x4733('0xa')]);router[_0x4733('0x8')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0xc')]);router[_0x4733('0x8')](_0x4733('0xd'),auth[_0x4733('0x9')](),controller[_0x4733('0xe')]);router[_0x4733('0xf')]('/',auth[_0x4733('0x9')](),controller['create']);router[_0x4733('0xf')](_0x4733('0xd'),auth['isAuthenticated'](),controller[_0x4733('0x10')]);router['put'](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x11')]);router[_0x4733('0x12')](_0x4733('0xb'),auth[_0x4733('0x9')](),controller[_0x4733('0x13')]);router['delete'](_0x4733('0xd'),auth['isAuthenticated'](),controller[_0x4733('0x14')]);module[_0x4733('0x15')]=router; \ No newline at end of file +var _0x1a21=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users','getUsers','post','create','addUsers','update','destroy','removeUsers','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x1a21,0x1d9));var _0x11a2=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0x1a21[_0x363b81];return _0x1d92fb;};'use strict';var multer=require(_0x11a2('0x0'));var util=require(_0x11a2('0x1'));var path=require(_0x11a2('0x2'));var timeout=require(_0x11a2('0x3'));var express=require(_0x11a2('0x4'));var router=express[_0x11a2('0x5')]();var fs_extra=require(_0x11a2('0x6'));var auth=require(_0x11a2('0x7'));var interaction=require(_0x11a2('0x8'));var config=require(_0x11a2('0x9'));var controller=require(_0x11a2('0xa'));router['get']('/',auth[_0x11a2('0xb')](),controller[_0x11a2('0xc')]);router[_0x11a2('0xd')](_0x11a2('0xe'),auth[_0x11a2('0xb')](),controller[_0x11a2('0xf')]);router['get'](_0x11a2('0x10'),auth[_0x11a2('0xb')](),controller[_0x11a2('0x11')]);router[_0x11a2('0x12')]('/',auth['isAuthenticated'](),controller[_0x11a2('0x13')]);router[_0x11a2('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x11a2('0x14')]);router['put'](_0x11a2('0xe'),auth[_0x11a2('0xb')](),controller[_0x11a2('0x15')]);router['delete'](_0x11a2('0xe'),auth[_0x11a2('0xb')](),controller[_0x11a2('0x16')]);router['delete']('/:id/users',auth[_0x11a2('0xb')](),controller[_0x11a2('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index aa7de9b..fcf42fa 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 _0x6caf=['sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x6caf,0x90));var _0xf6ca=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x6caf[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0xf6ca('0x0'));module[_0xf6ca('0x1')]={'name':{'type':Sequelize[_0xf6ca('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf6ca('0x2')]},'notes':{'type':Sequelize[_0xf6ca('0x3')]},'preproduction':{'type':Sequelize[_0xf6ca('0x4')](_0xf6ca('0x5')),'get':function(){if(this[_0xf6ca('0x6')](_0xf6ca('0x7'))){return this[_0xf6ca('0x6')]('preproduction')[_0xf6ca('0x8')](_0xf6ca('0x9'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xf6ca('0x6')](_0xf6ca('0xa'))){return this[_0xf6ca('0x6')](_0xf6ca('0xa'))[_0xf6ca('0x8')](_0xf6ca('0x9'));}}},'savedAt':{'type':Sequelize[_0xf6ca('0xb')]},'publishedAt':{'type':Sequelize[_0xf6ca('0xb')]}}; \ No newline at end of file +var _0x5fab=['toString','production','utf8','sequelize','exports','name','STRING','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x4957c4,_0x1e3896){var _0x4f6844=function(_0x212e90){while(--_0x212e90){_0x4957c4['push'](_0x4957c4['shift']());}};_0x4f6844(++_0x1e3896);}(_0x5fab,0x177));var _0xb5fa=function(_0xce1a87,_0x372c44){_0xce1a87=_0xce1a87-0x0;var _0x26669d=_0x5fab[_0xce1a87];return _0x26669d;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb5fa('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x3')]},'notes':{'type':Sequelize[_0xb5fa('0x4')]},'preproduction':{'type':Sequelize[_0xb5fa('0x5')](_0xb5fa('0x6')),'get':function(){if(this[_0xb5fa('0x7')](_0xb5fa('0x8'))){return this[_0xb5fa('0x7')](_0xb5fa('0x8'))[_0xb5fa('0x9')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xb5fa('0x6')),'get':function(){if(this[_0xb5fa('0x7')](_0xb5fa('0xa'))){return this['getDataValue'](_0xb5fa('0xa'))[_0xb5fa('0x9')](_0xb5fa('0xb'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 9f8f212..40b4985 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 _0x9536=['fieldName','key','name','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','type','filter','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','model','length','include','create','body','user','role','UserProfileSection','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','agi','production','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','nolimit','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','stringify','sendStatus','error','send','map','SquareProject'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x9536,0x179));var _0x6953=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x9536[_0x44216d];return _0xeca523;};'use strict';var _=require(_0x6953('0x0'));var Redis=require(_0x6953('0x1'));var qs=require(_0x6953('0x2'));var logger=require(_0x6953('0x3'))('api');var config=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];config[_0x6953('0x5')]=_[_0x6953('0x6')](config[_0x6953('0x5')],{'host':_0x6953('0x7'),'port':0x18eb});var socket=require(_0x6953('0x8'))(new Redis(config['redis']));require(_0x6953('0x9'))[_0x6953('0xa')](socket);function respondWithStatusCode(_0x385f2d,_0x3e1aff){_0x3e1aff=_0x3e1aff||0xcc;return function(_0x1c8225){if(_0x1c8225){return _0x385f2d['sendStatus'](_0x3e1aff);}return _0x385f2d[_0x6953('0xb')](_0x3e1aff)[_0x6953('0xc')]();};}function respondWithResult(_0x449acb,_0x4b505f){_0x4b505f=_0x4b505f||0xc8;return function(_0x41f41b){if(_0x41f41b){return _0x449acb[_0x6953('0xb')](_0x4b505f)[_0x6953('0xd')](_0x41f41b);}};}function respondWithFilteredResult(_0xb13f2c,_0x448c89){return function(_0x1f3062){if(_0x1f3062){var _0x246534=typeof _0x448c89[_0x6953('0xe')]===_0x6953('0xf')&&typeof _0x448c89['limit']===_0x6953('0xf');var _0x513dd0=_0x1f3062[_0x6953('0x10')];var _0x5b0558=_0x246534?0x0:_0x448c89[_0x6953('0xe')];var _0xe35f08=_0x246534?_0x1f3062[_0x6953('0x10')]:_0x448c89[_0x6953('0xe')]+_0x448c89[_0x6953('0x11')];var _0x27a57c;if(_0xe35f08>=_0x513dd0){_0xe35f08=_0x513dd0;_0x27a57c=0xc8;}else{_0x27a57c=0xce;}_0xb13f2c[_0x6953('0xb')](_0x27a57c);return _0xb13f2c[_0x6953('0x12')](_0x6953('0x13'),_0x5b0558+'-'+_0xe35f08+'/'+_0x513dd0)['json'](_0x1f3062);}return null;};}function saveUpdates(_0x5f49db){return function(_0x399b9b){if(_0x399b9b){return _0x399b9b[_0x6953('0x14')](_0x5f49db)[_0x6953('0x15')](function(_0x16251d){return _0x16251d;});}return null;};}function removeEntity(_0x510d46){return function(_0x1b6dcb){if(_0x1b6dcb){return _0x1b6dcb[_0x6953('0x16')]()['then'](function(){var _0x10858a=_0x1b6dcb[_0x6953('0x17')]({'plain':!![]});var _0x283cf4=_0x6953('0x18');return db[_0x6953('0x19')]['destroy']({'where':{'type':_0x283cf4,'resourceId':_0x10858a['id']}})[_0x6953('0x15')](function(){return _0x1b6dcb;});})[_0x6953('0x15')](function(){var _0x31d5fd=new Redis(config[_0x6953('0x5')]);_0x31d5fd[_0x6953('0x1a')]('agi',JSON[_0x6953('0x1b')]({'id':_0x1b6dcb['id'],'deleted':!![]}));})[_0x6953('0x15')](function(){_0x510d46['status'](0xcc)[_0x6953('0xc')]();});}};}function handleEntityNotFound(_0x40c9d1){return function(_0xb92529){if(!_0xb92529){_0x40c9d1[_0x6953('0x1c')](0x194);}return _0xb92529;};}function handleError(_0x53640a,_0x37f339){_0x37f339=_0x37f339||0x1f4;return function(_0x231cb2){logger[_0x6953('0x1d')](_0x231cb2['stack']);if(_0x231cb2['name']){delete _0x231cb2['name'];}_0x53640a[_0x6953('0xb')](_0x37f339)[_0x6953('0x1e')](_0x231cb2);};}exports['index']=function(_0x1a32f4,_0x587df0){var _0x328f67={},_0x2bf39b={},_0xcdbce8={'count':0x0,'rows':[]};var _0x2cc01e=_[_0x6953('0x1f')](db[_0x6953('0x20')]['rawAttributes'],function(_0x3dd890){return{'name':_0x3dd890[_0x6953('0x21')],'type':_0x3dd890['type'][_0x6953('0x22')]};});_0x2bf39b['model']=_[_0x6953('0x1f')](_0x2cc01e,_0x6953('0x23'));_0x2bf39b[_0x6953('0x24')]=_['keys'](_0x1a32f4[_0x6953('0x24')]);_0x2bf39b[_0x6953('0x25')]=_[_0x6953('0x26')](_0x2bf39b['model'],_0x2bf39b[_0x6953('0x24')]);_0x328f67[_0x6953('0x27')]=_['intersection'](_0x2bf39b['model'],qs[_0x6953('0x28')](_0x1a32f4[_0x6953('0x24')][_0x6953('0x28')]));_0x328f67[_0x6953('0x27')]=_0x328f67[_0x6953('0x27')]['length']?_0x328f67[_0x6953('0x27')]:_0x2bf39b['model'];if(!_0x1a32f4[_0x6953('0x24')][_0x6953('0x29')]('nolimit')){_0x328f67['limit']=qs[_0x6953('0x11')](_0x1a32f4[_0x6953('0x24')][_0x6953('0x11')]);_0x328f67['offset']=qs[_0x6953('0xe')](_0x1a32f4['query']['offset']);}_0x328f67['order']=qs['sort'](_0x1a32f4[_0x6953('0x24')][_0x6953('0x2a')]);_0x328f67[_0x6953('0x2b')]=qs[_0x6953('0x25')](_[_0x6953('0x2c')](_0x1a32f4[_0x6953('0x24')],_0x2bf39b['filters']),_0x2cc01e);if(_0x1a32f4[_0x6953('0x24')]['filter']){_0x328f67[_0x6953('0x2b')]=_['merge'](_0x328f67[_0x6953('0x2b')],{'$or':_[_0x6953('0x1f')](_0x2cc01e,function(_0xd81149){if(_0xd81149[_0x6953('0x2d')]!=='VIRTUAL'){var _0x13c677={};_0x13c677[_0xd81149[_0x6953('0x23')]]={'$like':'%'+_0x1a32f4[_0x6953('0x24')][_0x6953('0x2e')]+'%'};return _0x13c677;}})});}_0x328f67=_[_0x6953('0x2f')]({},_0x328f67,_0x1a32f4[_0x6953('0x30')]);var _0x37b2b3={'where':_0x328f67[_0x6953('0x2b')]};return db[_0x6953('0x20')][_0x6953('0x10')](_0x37b2b3)[_0x6953('0x15')](function(_0x483a33){_0xcdbce8[_0x6953('0x10')]=_0x483a33;if(_0x1a32f4[_0x6953('0x24')][_0x6953('0x31')]){_0x328f67['include']=[{'all':!![]}];}return db['SquareProject'][_0x6953('0x32')](_0x328f67);})['then'](function(_0x5abaf2){_0xcdbce8[_0x6953('0x33')]=_0x5abaf2;return _0xcdbce8;})[_0x6953('0x15')](respondWithFilteredResult(_0x587df0,_0x328f67))['catch'](handleError(_0x587df0,null));};exports[_0x6953('0x34')]=function(_0x263728,_0x1abad9){var _0x419648={'raw':![],'where':{'id':_0x263728[_0x6953('0x35')]['id']}},_0x8df9fc={};_0x8df9fc['model']=_[_0x6953('0x36')](db[_0x6953('0x20')][_0x6953('0x37')]);_0x8df9fc[_0x6953('0x24')]=_[_0x6953('0x36')](_0x263728[_0x6953('0x24')]);_0x8df9fc['filters']=_['intersection'](_0x8df9fc[_0x6953('0x38')],_0x8df9fc['query']);_0x419648['attributes']=_[_0x6953('0x26')](_0x8df9fc[_0x6953('0x38')],qs[_0x6953('0x28')](_0x263728[_0x6953('0x24')][_0x6953('0x28')]));_0x419648['attributes']=_0x419648['attributes'][_0x6953('0x39')]?_0x419648[_0x6953('0x27')]:_0x8df9fc['model'];if(_0x263728[_0x6953('0x24')]['includeAll']){_0x419648[_0x6953('0x3a')]=[{'all':!![]}];}_0x419648=_[_0x6953('0x2f')]({},_0x419648,_0x263728[_0x6953('0x30')]);return db[_0x6953('0x20')]['find'](_0x419648)[_0x6953('0x15')](handleEntityNotFound(_0x1abad9,null))[_0x6953('0x15')](respondWithResult(_0x1abad9,null))['catch'](handleError(_0x1abad9,null));};exports[_0x6953('0x3b')]=function(_0x296d81,_0x1b4377){return db[_0x6953('0x20')][_0x6953('0x3b')](_0x296d81[_0x6953('0x3c')],{})[_0x6953('0x15')](function(_0x4f7a2f){var _0x156785=_0x296d81[_0x6953('0x3d')][_0x6953('0x17')]({'plain':!![]});if(!_0x156785)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x156785[_0x6953('0x3e')]==='user'){var _0x15c142=_0x4f7a2f[_0x6953('0x17')]({'plain':!![]});var _0x382332='SquareProjects';return db[_0x6953('0x3f')][_0x6953('0x40')]({'where':{'name':_0x382332,'userProfileId':_0x156785['userProfileId']},'raw':!![]})['then'](function(_0xbf5b61){if(_0xbf5b61&&_0xbf5b61[_0x6953('0x41')]===0x0){return db[_0x6953('0x19')][_0x6953('0x3b')]({'name':_0x15c142[_0x6953('0x23')],'resourceId':_0x15c142['id'],'type':_0xbf5b61[_0x6953('0x23')],'sectionId':_0xbf5b61['id']},{})[_0x6953('0x15')](function(){return _0x4f7a2f;});}else{return _0x4f7a2f;}})[_0x6953('0x42')](function(_0x2baf90){logger[_0x6953('0x1d')](_0x6953('0x43'),_0x2baf90);throw _0x2baf90;});}return _0x4f7a2f;})['then'](respondWithResult(_0x1b4377,0xc9))['catch'](handleError(_0x1b4377,null));};exports[_0x6953('0x14')]=function(_0x38e3e8,_0x68ab5d){if(_0x38e3e8[_0x6953('0x3c')]['id']){delete _0x38e3e8[_0x6953('0x3c')]['id'];}return db[_0x6953('0x20')][_0x6953('0x40')]({'where':{'id':_0x38e3e8[_0x6953('0x35')]['id']}})[_0x6953('0x15')](handleEntityNotFound(_0x68ab5d,null))['then'](saveUpdates(_0x38e3e8['body'],null))['then'](function(_0x4d278f){if(!_0x4d278f)return;var _0x34d1aa=_0x4d278f[_0x6953('0x17')]({'plain':!![]});return _0x34d1aa;})[_0x6953('0x15')](function(_0x47bd97){var _0x5c192a=new Redis(config[_0x6953('0x5')]);_0x5c192a[_0x6953('0x1a')](_0x6953('0x44'),JSON['stringify'](_['pick'](_0x47bd97,['id',_0x6953('0x23'),_0x6953('0x45')])));return _0x47bd97;})['then'](respondWithResult(_0x68ab5d,null))['catch'](handleError(_0x68ab5d,null));};exports[_0x6953('0x16')]=function(_0xafbd35,_0x414096){return db[_0x6953('0x20')][_0x6953('0x40')]({'where':{'id':_0xafbd35['params']['id']}})[_0x6953('0x15')](handleEntityNotFound(_0x414096,null))[_0x6953('0x15')](removeEntity(_0x414096,null))['catch'](handleError(_0x414096,null));};exports[_0x6953('0x46')]=function(_0x50592f,_0x309795){return db[_0x6953('0x20')][_0x6953('0x40')]({'where':{'id':_0x50592f[_0x6953('0x35')]['id']}})['then'](handleEntityNotFound(_0x309795,null))[_0x6953('0x15')](function(_0x366390){if(_0x366390){return _0x366390[_0x6953('0x46')](_0x50592f['body']['ids'],_[_0x6953('0x47')](_0x50592f[_0x6953('0x3c')],[_0x6953('0x48'),'id'])||{});}})['then'](respondWithResult(_0x309795,null))['catch'](handleError(_0x309795,null));};exports[_0x6953('0x49')]=function(_0x2b90f7,_0x4c0f1c){return db[_0x6953('0x20')][_0x6953('0x40')]({'where':{'id':_0x2b90f7['params']['id']}})[_0x6953('0x15')](handleEntityNotFound(_0x4c0f1c,null))[_0x6953('0x15')](function(_0x109b5e){if(_0x109b5e){return _0x109b5e[_0x6953('0x49')](_0x2b90f7[_0x6953('0x24')]['ids'])[_0x6953('0x15')](function(){if(_[_0x6953('0x4a')](_0x2b90f7[_0x6953('0x24')]['ids'])){for(var _0x479ab4=0x0;_0x479ab4<_0x2b90f7[_0x6953('0x24')][_0x6953('0x48')][_0x6953('0x39')];_0x479ab4+=0x1){socket[_0x6953('0x4b')](_0x6953('0x4c'),{'UserId':Number(_0x2b90f7['query'][_0x6953('0x48')][_0x479ab4]),'SquareProjectId':Number(_0x2b90f7[_0x6953('0x35')]['id'])});}}else{socket[_0x6953('0x4b')](_0x6953('0x4c'),{'UserId':Number(_0x2b90f7[_0x6953('0x24')][_0x6953('0x48')]),'SquareProjectId':Number(_0x2b90f7[_0x6953('0x35')]['id'])});}});}})[_0x6953('0x15')](respondWithStatusCode(_0x4c0f1c,null))[_0x6953('0x42')](handleError(_0x4c0f1c,null));};exports[_0x6953('0x4d')]=function(_0xb26c63,_0x390ba0){var _0x25ac55={};var _0x583e1f={};var _0x398e2c;var _0x1d264a;return db[_0x6953('0x20')][_0x6953('0x4e')]({'where':{'id':_0xb26c63[_0x6953('0x35')]['id']}})['then'](handleEntityNotFound(_0x390ba0,null))['then'](function(_0x310a90){if(_0x310a90){_0x398e2c=_0x310a90;_0x583e1f['model']=_[_0x6953('0x36')](db[_0x6953('0x4f')][_0x6953('0x37')]);_0x583e1f[_0x6953('0x24')]=_['keys'](_0xb26c63[_0x6953('0x24')]);_0x583e1f[_0x6953('0x25')]=_[_0x6953('0x26')](_0x583e1f[_0x6953('0x38')],_0x583e1f[_0x6953('0x24')]);_0x25ac55[_0x6953('0x27')]=_[_0x6953('0x26')](_0x583e1f[_0x6953('0x38')],qs[_0x6953('0x28')](_0xb26c63[_0x6953('0x24')][_0x6953('0x28')]));_0x25ac55[_0x6953('0x27')]=_0x25ac55[_0x6953('0x27')][_0x6953('0x39')]?_0x25ac55[_0x6953('0x27')]:_0x583e1f['model'];_0x25ac55[_0x6953('0x50')]=qs[_0x6953('0x2a')](_0xb26c63[_0x6953('0x24')][_0x6953('0x2a')]);_0x25ac55[_0x6953('0x2b')]=qs[_0x6953('0x25')](_[_0x6953('0x2c')](_0xb26c63['query'],_0x583e1f[_0x6953('0x25')]));if(_0xb26c63[_0x6953('0x24')]['filter']){_0x25ac55[_0x6953('0x2b')]=_[_0x6953('0x2f')](_0x25ac55[_0x6953('0x2b')],{'$or':_['map'](_0x25ac55['attributes'],function(_0x1ea573){var _0x12987e={};_0x12987e[_0x1ea573]={'$like':'%'+_0xb26c63[_0x6953('0x24')][_0x6953('0x2e')]+'%'};return _0x12987e;})});}_0x25ac55=_[_0x6953('0x2f')]({},_0x25ac55,_0xb26c63[_0x6953('0x30')]);return _0x398e2c[_0x6953('0x4d')](_0x25ac55);}})[_0x6953('0x15')](function(_0x2d1bba){if(_0x2d1bba){_0x1d264a=_0x2d1bba['length'];if(!_0xb26c63[_0x6953('0x24')][_0x6953('0x29')](_0x6953('0x51'))){_0x25ac55[_0x6953('0x11')]=qs['limit'](_0xb26c63[_0x6953('0x24')][_0x6953('0x11')]);_0x25ac55[_0x6953('0xe')]=qs['offset'](_0xb26c63[_0x6953('0x24')][_0x6953('0xe')]);}return _0x398e2c[_0x6953('0x4d')](_0x25ac55);}})[_0x6953('0x15')](function(_0x5c660b){if(_0x5c660b){return _0x5c660b?{'count':_0x1d264a,'rows':_0x5c660b}:null;}})[_0x6953('0x15')](respondWithResult(_0x390ba0,null))[_0x6953('0x42')](handleError(_0x390ba0,null));}; \ No newline at end of file +var _0x2ef3=['include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','stringify','pick','production','addUsers','omit','removeUsers','ids','isArray','getUsers','findOne','User','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','count','limit','set','update','then','destroy','get','UserProfileResource','agi','error','stack','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','merge','where','VIRTUAL','name','filter','options','includeAll'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x2ef3,0xba));var _0x32ef=function(_0x474f22,_0x27cf6b){_0x474f22=_0x474f22-0x0;var _0x14aecb=_0x2ef3[_0x474f22];return _0x14aecb;};'use strict';var _=require(_0x32ef('0x0'));var Redis=require(_0x32ef('0x1'));var qs=require(_0x32ef('0x2'));var logger=require(_0x32ef('0x3'))(_0x32ef('0x4'));var config=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x6')]=_[_0x32ef('0x7')](config['redis'],{'host':_0x32ef('0x8'),'port':0x18eb});var socket=require(_0x32ef('0x9'))(new Redis(config['redis']));require('./squareProject.socket')[_0x32ef('0xa')](socket);function respondWithStatusCode(_0x4bfcf8,_0x367c39){_0x367c39=_0x367c39||0xcc;return function(_0x2fb8eb){if(_0x2fb8eb){return _0x4bfcf8[_0x32ef('0xb')](_0x367c39);}return _0x4bfcf8[_0x32ef('0xc')](_0x367c39)[_0x32ef('0xd')]();};}function respondWithResult(_0x2bbb50,_0x28275c){_0x28275c=_0x28275c||0xc8;return function(_0x77df79){if(_0x77df79){return _0x2bbb50['status'](_0x28275c)['json'](_0x77df79);}};}function respondWithFilteredResult(_0x401d0b,_0x33281d){return function(_0x45bfd5){if(_0x45bfd5){var _0x1499c2=typeof _0x33281d['offset']===_0x32ef('0xe')&&typeof _0x33281d['limit']===_0x32ef('0xe');var _0x49d590=_0x45bfd5[_0x32ef('0xf')];var _0x1ef1ae=_0x1499c2?0x0:_0x33281d['offset'];var _0x539d18=_0x1499c2?_0x45bfd5[_0x32ef('0xf')]:_0x33281d['offset']+_0x33281d[_0x32ef('0x10')];var _0x40a6e6;if(_0x539d18>=_0x49d590){_0x539d18=_0x49d590;_0x40a6e6=0xc8;}else{_0x40a6e6=0xce;}_0x401d0b[_0x32ef('0xc')](_0x40a6e6);return _0x401d0b[_0x32ef('0x11')]('Content-Range',_0x1ef1ae+'-'+_0x539d18+'/'+_0x49d590)['json'](_0x45bfd5);}return null;};}function saveUpdates(_0x531e30){return function(_0x13db1a){if(_0x13db1a){return _0x13db1a[_0x32ef('0x12')](_0x531e30)[_0x32ef('0x13')](function(_0x53a5ca){return _0x53a5ca;});}return null;};}function removeEntity(_0x5d559b){return function(_0x1eb468){if(_0x1eb468){return _0x1eb468[_0x32ef('0x14')]()[_0x32ef('0x13')](function(){var _0x57863c=_0x1eb468[_0x32ef('0x15')]({'plain':!![]});var _0x33e230='SquareProjects';return db[_0x32ef('0x16')][_0x32ef('0x14')]({'where':{'type':_0x33e230,'resourceId':_0x57863c['id']}})[_0x32ef('0x13')](function(){return _0x1eb468;});})[_0x32ef('0x13')](function(){var _0x445cda=new Redis(config[_0x32ef('0x6')]);_0x445cda['publish'](_0x32ef('0x17'),JSON['stringify']({'id':_0x1eb468['id'],'deleted':!![]}));})[_0x32ef('0x13')](function(){_0x5d559b[_0x32ef('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1af371){return function(_0x97780){if(!_0x97780){_0x1af371[_0x32ef('0xb')](0x194);}return _0x97780;};}function handleError(_0x55f7f2,_0x57f5e5){_0x57f5e5=_0x57f5e5||0x1f4;return function(_0x22f2d7){logger[_0x32ef('0x18')](_0x22f2d7[_0x32ef('0x19')]);if(_0x22f2d7['name']){delete _0x22f2d7['name'];}_0x55f7f2[_0x32ef('0xc')](_0x57f5e5)['send'](_0x22f2d7);};}exports['index']=function(_0x278495,_0x14d4b3){var _0x371540={},_0x1dbe98={},_0x15ce54={'count':0x0,'rows':[]};var _0x234175=_[_0x32ef('0x1a')](db[_0x32ef('0x1b')][_0x32ef('0x1c')],function(_0x2f52d7){return{'name':_0x2f52d7[_0x32ef('0x1d')],'type':_0x2f52d7[_0x32ef('0x1e')]['key']};});_0x1dbe98[_0x32ef('0x1f')]=_[_0x32ef('0x1a')](_0x234175,'name');_0x1dbe98[_0x32ef('0x20')]=_[_0x32ef('0x21')](_0x278495[_0x32ef('0x20')]);_0x1dbe98[_0x32ef('0x22')]=_['intersection'](_0x1dbe98[_0x32ef('0x1f')],_0x1dbe98[_0x32ef('0x20')]);_0x371540[_0x32ef('0x23')]=_[_0x32ef('0x24')](_0x1dbe98[_0x32ef('0x1f')],qs[_0x32ef('0x25')](_0x278495[_0x32ef('0x20')]['fields']));_0x371540[_0x32ef('0x23')]=_0x371540['attributes'][_0x32ef('0x26')]?_0x371540[_0x32ef('0x23')]:_0x1dbe98['model'];if(!_0x278495[_0x32ef('0x20')][_0x32ef('0x27')](_0x32ef('0x28'))){_0x371540[_0x32ef('0x10')]=qs[_0x32ef('0x10')](_0x278495['query']['limit']);_0x371540[_0x32ef('0x29')]=qs['offset'](_0x278495[_0x32ef('0x20')][_0x32ef('0x29')]);}_0x371540[_0x32ef('0x2a')]=qs[_0x32ef('0x2b')](_0x278495[_0x32ef('0x20')][_0x32ef('0x2b')]);_0x371540['where']=qs['filters'](_['pick'](_0x278495[_0x32ef('0x20')],_0x1dbe98[_0x32ef('0x22')]),_0x234175);if(_0x278495[_0x32ef('0x20')]['filter']){_0x371540['where']=_[_0x32ef('0x2c')](_0x371540[_0x32ef('0x2d')],{'$or':_[_0x32ef('0x1a')](_0x234175,function(_0x480348){if(_0x480348['type']!==_0x32ef('0x2e')){var _0x21706f={};_0x21706f[_0x480348[_0x32ef('0x2f')]]={'$like':'%'+_0x278495[_0x32ef('0x20')][_0x32ef('0x30')]+'%'};return _0x21706f;}})});}_0x371540=_[_0x32ef('0x2c')]({},_0x371540,_0x278495[_0x32ef('0x31')]);var _0x21da90={'where':_0x371540[_0x32ef('0x2d')]};return db['SquareProject'][_0x32ef('0xf')](_0x21da90)[_0x32ef('0x13')](function(_0x14b54f){_0x15ce54['count']=_0x14b54f;if(_0x278495[_0x32ef('0x20')][_0x32ef('0x32')]){_0x371540[_0x32ef('0x33')]=[{'all':!![]}];}return db[_0x32ef('0x1b')][_0x32ef('0x34')](_0x371540);})[_0x32ef('0x13')](function(_0x256c40){_0x15ce54[_0x32ef('0x35')]=_0x256c40;return _0x15ce54;})[_0x32ef('0x13')](respondWithFilteredResult(_0x14d4b3,_0x371540))[_0x32ef('0x36')](handleError(_0x14d4b3,null));};exports[_0x32ef('0x37')]=function(_0x4615b4,_0x48e071){var _0x3cac2e={'raw':![],'where':{'id':_0x4615b4[_0x32ef('0x38')]['id']}},_0xc3a6d3={};_0xc3a6d3[_0x32ef('0x1f')]=_[_0x32ef('0x21')](db[_0x32ef('0x1b')][_0x32ef('0x1c')]);_0xc3a6d3['query']=_['keys'](_0x4615b4[_0x32ef('0x20')]);_0xc3a6d3[_0x32ef('0x22')]=_[_0x32ef('0x24')](_0xc3a6d3[_0x32ef('0x1f')],_0xc3a6d3['query']);_0x3cac2e[_0x32ef('0x23')]=_[_0x32ef('0x24')](_0xc3a6d3['model'],qs[_0x32ef('0x25')](_0x4615b4['query'][_0x32ef('0x25')]));_0x3cac2e[_0x32ef('0x23')]=_0x3cac2e[_0x32ef('0x23')][_0x32ef('0x26')]?_0x3cac2e[_0x32ef('0x23')]:_0xc3a6d3[_0x32ef('0x1f')];if(_0x4615b4[_0x32ef('0x20')][_0x32ef('0x32')]){_0x3cac2e[_0x32ef('0x33')]=[{'all':!![]}];}_0x3cac2e=_[_0x32ef('0x2c')]({},_0x3cac2e,_0x4615b4['options']);return db[_0x32ef('0x1b')]['find'](_0x3cac2e)[_0x32ef('0x13')](handleEntityNotFound(_0x48e071,null))[_0x32ef('0x13')](respondWithResult(_0x48e071,null))[_0x32ef('0x36')](handleError(_0x48e071,null));};exports['create']=function(_0x502113,_0x230ac9){return db[_0x32ef('0x1b')][_0x32ef('0x39')](_0x502113[_0x32ef('0x3a')],{})[_0x32ef('0x13')](function(_0x12c9e6){var _0x47dbe1=_0x502113['user'][_0x32ef('0x15')]({'plain':!![]});if(!_0x47dbe1)throw new Error(_0x32ef('0x3b'));if(_0x47dbe1[_0x32ef('0x3c')]===_0x32ef('0x3d')){var _0x209361=_0x12c9e6[_0x32ef('0x15')]({'plain':!![]});var _0x44ad11=_0x32ef('0x3e');return db[_0x32ef('0x3f')][_0x32ef('0x40')]({'where':{'name':_0x44ad11,'userProfileId':_0x47dbe1[_0x32ef('0x41')]},'raw':!![]})[_0x32ef('0x13')](function(_0x36a65c){if(_0x36a65c&&_0x36a65c['autoAssociation']===0x0){return db[_0x32ef('0x16')][_0x32ef('0x39')]({'name':_0x209361[_0x32ef('0x2f')],'resourceId':_0x209361['id'],'type':_0x36a65c[_0x32ef('0x2f')],'sectionId':_0x36a65c['id']},{})[_0x32ef('0x13')](function(){return _0x12c9e6;});}else{return _0x12c9e6;}})[_0x32ef('0x36')](function(_0x278696){logger[_0x32ef('0x18')](_0x32ef('0x42'),_0x278696);throw _0x278696;});}return _0x12c9e6;})[_0x32ef('0x13')](respondWithResult(_0x230ac9,0xc9))[_0x32ef('0x36')](handleError(_0x230ac9,null));};exports[_0x32ef('0x12')]=function(_0x272377,_0x326445){if(_0x272377[_0x32ef('0x3a')]['id']){delete _0x272377[_0x32ef('0x3a')]['id'];}return db[_0x32ef('0x1b')][_0x32ef('0x40')]({'where':{'id':_0x272377['params']['id']}})['then'](handleEntityNotFound(_0x326445,null))[_0x32ef('0x13')](saveUpdates(_0x272377[_0x32ef('0x3a')],null))[_0x32ef('0x13')](function(_0x166405){if(!_0x166405)return;var _0x34bd3e=_0x166405[_0x32ef('0x15')]({'plain':!![]});return _0x34bd3e;})[_0x32ef('0x13')](function(_0x1f105a){var _0x15b640=new Redis(config[_0x32ef('0x6')]);_0x15b640[_0x32ef('0x43')]('agi',JSON[_0x32ef('0x44')](_[_0x32ef('0x45')](_0x1f105a,['id',_0x32ef('0x2f'),_0x32ef('0x46')])));return _0x1f105a;})[_0x32ef('0x13')](respondWithResult(_0x326445,null))[_0x32ef('0x36')](handleError(_0x326445,null));};exports['destroy']=function(_0x44a4e9,_0x1eeb3e){return db[_0x32ef('0x1b')]['find']({'where':{'id':_0x44a4e9[_0x32ef('0x38')]['id']}})['then'](handleEntityNotFound(_0x1eeb3e,null))[_0x32ef('0x13')](removeEntity(_0x1eeb3e,null))[_0x32ef('0x36')](handleError(_0x1eeb3e,null));};exports['addUsers']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x1b')][_0x32ef('0x40')]({'where':{'id':_0x206ad5[_0x32ef('0x38')]['id']}})[_0x32ef('0x13')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x13')](function(_0x30e377){if(_0x30e377){return _0x30e377[_0x32ef('0x47')](_0x206ad5['body']['ids'],_[_0x32ef('0x48')](_0x206ad5['body'],['ids','id'])||{});}})[_0x32ef('0x13')](respondWithResult(_0x59e5f9,null))[_0x32ef('0x36')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x49')]=function(_0x6aae59,_0x2468e6){return db[_0x32ef('0x1b')][_0x32ef('0x40')]({'where':{'id':_0x6aae59[_0x32ef('0x38')]['id']}})[_0x32ef('0x13')](handleEntityNotFound(_0x2468e6,null))[_0x32ef('0x13')](function(_0x4c125c){if(_0x4c125c){return _0x4c125c['removeUsers'](_0x6aae59[_0x32ef('0x20')][_0x32ef('0x4a')])['then'](function(){if(_[_0x32ef('0x4b')](_0x6aae59[_0x32ef('0x20')][_0x32ef('0x4a')])){for(var _0x49c245=0x0;_0x49c245<_0x6aae59[_0x32ef('0x20')][_0x32ef('0x4a')][_0x32ef('0x26')];_0x49c245+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x6aae59[_0x32ef('0x20')]['ids'][_0x49c245]),'SquareProjectId':Number(_0x6aae59[_0x32ef('0x38')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x6aae59[_0x32ef('0x20')][_0x32ef('0x4a')]),'SquareProjectId':Number(_0x6aae59[_0x32ef('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x2468e6,null))[_0x32ef('0x36')](handleError(_0x2468e6,null));};exports[_0x32ef('0x4c')]=function(_0x5f9da7,_0x58ecbb){var _0x4557ce={};var _0x12b7f8={};var _0x4c3bab;var _0x4a4eaa;return db[_0x32ef('0x1b')][_0x32ef('0x4d')]({'where':{'id':_0x5f9da7[_0x32ef('0x38')]['id']}})[_0x32ef('0x13')](handleEntityNotFound(_0x58ecbb,null))[_0x32ef('0x13')](function(_0x40700e){if(_0x40700e){_0x4c3bab=_0x40700e;_0x12b7f8['model']=_[_0x32ef('0x21')](db[_0x32ef('0x4e')][_0x32ef('0x1c')]);_0x12b7f8[_0x32ef('0x20')]=_[_0x32ef('0x21')](_0x5f9da7[_0x32ef('0x20')]);_0x12b7f8[_0x32ef('0x22')]=_[_0x32ef('0x24')](_0x12b7f8[_0x32ef('0x1f')],_0x12b7f8['query']);_0x4557ce[_0x32ef('0x23')]=_[_0x32ef('0x24')](_0x12b7f8[_0x32ef('0x1f')],qs[_0x32ef('0x25')](_0x5f9da7[_0x32ef('0x20')]['fields']));_0x4557ce['attributes']=_0x4557ce[_0x32ef('0x23')][_0x32ef('0x26')]?_0x4557ce[_0x32ef('0x23')]:_0x12b7f8[_0x32ef('0x1f')];_0x4557ce[_0x32ef('0x2a')]=qs['sort'](_0x5f9da7[_0x32ef('0x20')]['sort']);_0x4557ce[_0x32ef('0x2d')]=qs[_0x32ef('0x22')](_['pick'](_0x5f9da7['query'],_0x12b7f8[_0x32ef('0x22')]));if(_0x5f9da7[_0x32ef('0x20')][_0x32ef('0x30')]){_0x4557ce['where']=_['merge'](_0x4557ce[_0x32ef('0x2d')],{'$or':_[_0x32ef('0x1a')](_0x4557ce[_0x32ef('0x23')],function(_0x416e62){var _0x4f4006={};_0x4f4006[_0x416e62]={'$like':'%'+_0x5f9da7[_0x32ef('0x20')][_0x32ef('0x30')]+'%'};return _0x4f4006;})});}_0x4557ce=_[_0x32ef('0x2c')]({},_0x4557ce,_0x5f9da7[_0x32ef('0x31')]);return _0x4c3bab[_0x32ef('0x4c')](_0x4557ce);}})[_0x32ef('0x13')](function(_0x43b176){if(_0x43b176){_0x4a4eaa=_0x43b176[_0x32ef('0x26')];if(!_0x5f9da7[_0x32ef('0x20')][_0x32ef('0x27')](_0x32ef('0x28'))){_0x4557ce[_0x32ef('0x10')]=qs['limit'](_0x5f9da7['query'][_0x32ef('0x10')]);_0x4557ce[_0x32ef('0x29')]=qs['offset'](_0x5f9da7[_0x32ef('0x20')]['offset']);}return _0x4c3bab[_0x32ef('0x4c')](_0x4557ce);}})[_0x32ef('0x13')](function(_0x323758){if(_0x323758){return _0x323758?{'count':_0x4a4eaa,'rows':_0x323758}:null;}})['then'](respondWithResult(_0x58ecbb,null))[_0x32ef('0x36')](handleError(_0x58ecbb,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a2289de..8509951 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 _0xe906=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe906,0x89));var _0x6e90=function(_0x260b8f,_0x177af6){_0x260b8f=_0x260b8f-0x0;var _0xa4574a=_0xe906[_0x260b8f];return _0xa4574a;};'use strict';var EventEmitter=require(_0x6e90('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6e90('0x1')](0x0);var events={'afterCreate':_0x6e90('0x2'),'afterUpdate':_0x6e90('0x3'),'afterDestroy':_0x6e90('0x4')};function emitEvent(_0x2487be){return function(_0x55e94d,_0x38a945,_0x3b84d6){SquareProjectEvents[_0x6e90('0x5')](_0x2487be+':'+_0x55e94d['id'],_0x55e94d);SquareProjectEvents[_0x6e90('0x5')](_0x2487be,_0x55e94d);_0x3b84d6(null);};}for(var e in events){if(events[_0x6e90('0x6')](e)){var event=events[e];SquareProject[_0x6e90('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xae67=['setMaxListeners','save','update','emit','hook','exports','events','SquareProject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae67,0xae));var _0x7ae6=function(_0x4b3904,_0x257ae3){_0x4b3904=_0x4b3904-0x0;var _0x475f19=_0xae67[_0x4b3904];return _0x475f19;};'use strict';var EventEmitter=require(_0x7ae6('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x7ae6('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7ae6('0x2')](0x0);var events={'afterCreate':_0x7ae6('0x3'),'afterUpdate':_0x7ae6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x206da7){return function(_0x425883,_0x408ed1,_0x388c74){SquareProjectEvents[_0x7ae6('0x5')](_0x206da7+':'+_0x425883['id'],_0x425883);SquareProjectEvents['emit'](_0x206da7,_0x425883);_0x388c74(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7ae6('0x6')](e,emitEvent(event));}}module[_0x7ae6('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index efcf91a..f31cc5e 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 _0x5c87=['api','moment','request-promise','path','../../config/environment','./squareProject.attributes','SquareProject','changed','preproduction','format','production','publishedAt','lodash'];(function(_0x337a17,_0x502354){var _0x30b5ff=function(_0x586513){while(--_0x586513){_0x337a17['push'](_0x337a17['shift']());}};_0x30b5ff(++_0x502354);}(_0x5c87,0xf6));var _0x75c8=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x5c87[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x75c8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x75c8('0x1'));var moment=require(_0x75c8('0x2'));var BPromise=require('bluebird');var rp=require(_0x75c8('0x3'));var fs=require('fs');var path=require(_0x75c8('0x4'));var rimraf=require('rimraf');var config=require(_0x75c8('0x5'));var attributes=require(_0x75c8('0x6'));module['exports']=function(_0x13c0b3,_0x2c1d6e){return _0x13c0b3['define'](_0x75c8('0x7'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e6372,_0x2a7179,_0x4ba4fb){if(_0x3e6372[_0x75c8('0x8')](_0x75c8('0x9'))){_0x3e6372['savedAt']=moment()[_0x75c8('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e6372[_0x75c8('0x8')](_0x75c8('0xb'))){_0x3e6372[_0x75c8('0xc')]=moment()[_0x75c8('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ba4fb(null,_0x3e6372);}}});}; \ No newline at end of file +var _0xbda2=['path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x496c69,_0x10d8fa){var _0x4814fc=function(_0x2c5642){while(--_0x2c5642){_0x496c69['push'](_0x496c69['shift']());}};_0x4814fc(++_0x10d8fa);}(_0xbda2,0x111));var _0x2bda=function(_0x1bbd2e,_0x378a2f){_0x1bbd2e=_0x1bbd2e-0x0;var _0x306824=_0xbda2[_0x1bbd2e];return _0x306824;};'use strict';var _=require(_0x2bda('0x0'));var util=require(_0x2bda('0x1'));var logger=require(_0x2bda('0x2'))(_0x2bda('0x3'));var moment=require(_0x2bda('0x4'));var BPromise=require(_0x2bda('0x5'));var rp=require(_0x2bda('0x6'));var fs=require('fs');var path=require(_0x2bda('0x7'));var rimraf=require(_0x2bda('0x8'));var config=require(_0x2bda('0x9'));var attributes=require(_0x2bda('0xa'));module[_0x2bda('0xb')]=function(_0x228573,_0x424620){return _0x228573[_0x2bda('0xc')](_0x2bda('0xd'),attributes,{'tableName':_0x2bda('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x543173,_0x5f5dd7,_0x145298){if(_0x543173[_0x2bda('0xf')](_0x2bda('0x10'))){_0x543173['savedAt']=moment()[_0x2bda('0x11')](_0x2bda('0x12'));}if(_0x543173['changed']('production')){_0x543173[_0x2bda('0x13')]=moment()['format'](_0x2bda('0x12'));}_0x145298(null,_0x543173);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index d670d2f..9d3d788 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 _0x57ff=['error','message','ShowSquareProject','find','lodash','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','then','info','debug','GetSquareProjects','stringify','catch'];(function(_0x424959,_0x1551e8){var _0xecc6a0=function(_0x1af1dc){while(--_0x1af1dc){_0x424959['push'](_0x424959['shift']());}};_0xecc6a0(++_0x1551e8);}(_0x57ff,0xcf));var _0xf57f=function(_0x2f6e62,_0x1a618b){_0x2f6e62=_0x2f6e62-0x0;var _0x3438c9=_0x57ff[_0x2f6e62];return _0x3438c9;};'use strict';var _=require(_0xf57f('0x0'));var Redis=require(_0xf57f('0x1'));var db=require(_0xf57f('0x2'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0xf57f('0x3'));config[_0xf57f('0x4')]=_[_0xf57f('0x5')](config[_0xf57f('0x4')],{'host':_0xf57f('0x6'),'port':0x18eb});var socket=require(_0xf57f('0x7'))(new Redis(config[_0xf57f('0x4')]));require('./squareProject.socket')[_0xf57f('0x8')](socket);exports['GetSquareProjects']=function(_0x3925b0){var _0x361335=this;return new Promise(function(_0xe04483,_0x43cb38){return db[_0xf57f('0x9')][_0xf57f('0xa')]({'raw':_0x3925b0[_0xf57f('0xb')]?_0x3925b0[_0xf57f('0xb')][_0xf57f('0xc')]===undefined?!![]:![]:!![],'where':_0x3925b0['options']?_0x3925b0[_0xf57f('0xb')][_0xf57f('0xd')]||null:null,'attributes':_0x3925b0[_0xf57f('0xb')]?_0x3925b0[_0xf57f('0xb')][_0xf57f('0xe')]||null:null,'limit':_0x3925b0[_0xf57f('0xb')]?_0x3925b0[_0xf57f('0xb')][_0xf57f('0xf')]||null:null,'include':_0x3925b0[_0xf57f('0xb')]?_0x3925b0[_0xf57f('0xb')]['include']?_[_0xf57f('0x10')](_0x3925b0['options'][_0xf57f('0x11')],function(_0x5e6da2){return{'model':db[_0x5e6da2[_0xf57f('0x12')]],'as':_0x5e6da2['as'],'attributes':_0x5e6da2[_0xf57f('0xe')],'include':_0x5e6da2[_0xf57f('0x11')]?_[_0xf57f('0x10')](_0x5e6da2[_0xf57f('0x11')],function(_0x5ea9ea){return{'model':db[_0x5ea9ea[_0xf57f('0x12')]],'as':_0x5ea9ea['as'],'attributes':_0x5ea9ea[_0xf57f('0xe')],'include':_0x5ea9ea[_0xf57f('0x11')]?_[_0xf57f('0x10')](_0x5ea9ea[_0xf57f('0x11')],function(_0x2810c3){return{'model':db[_0x2810c3[_0xf57f('0x12')]],'as':_0x2810c3['as'],'attributes':_0x2810c3[_0xf57f('0xe')]};}):[]};}):[]};}):[]:[]})[_0xf57f('0x13')](function(_0x1452ec){logger[_0xf57f('0x14')]('GetSquareProjects',_0x3925b0);logger[_0xf57f('0x15')](_0xf57f('0x16'),_0x3925b0,JSON[_0xf57f('0x17')](_0x1452ec));_0xe04483(_0x1452ec);})[_0xf57f('0x18')](function(_0x147977){logger[_0xf57f('0x19')](_0xf57f('0x16'),_0x147977[_0xf57f('0x1a')],_0x3925b0);_0x43cb38(_0x361335['error'](0x1f4,_0x147977[_0xf57f('0x1a')]));});});};exports[_0xf57f('0x1b')]=function(_0x5ac321){var _0x4105dd=this;return new Promise(function(_0x31ccb6,_0x212865){return db[_0xf57f('0x9')][_0xf57f('0x1c')]({'raw':_0x5ac321[_0xf57f('0xb')]?_0x5ac321[_0xf57f('0xb')][_0xf57f('0xc')]===undefined?!![]:![]:!![],'where':_0x5ac321[_0xf57f('0xb')]?_0x5ac321[_0xf57f('0xb')][_0xf57f('0xd')]||null:null,'attributes':_0x5ac321[_0xf57f('0xb')]?_0x5ac321[_0xf57f('0xb')][_0xf57f('0xe')]||null:null,'include':_0x5ac321[_0xf57f('0xb')]?_0x5ac321[_0xf57f('0xb')][_0xf57f('0x11')]?_['map'](_0x5ac321[_0xf57f('0xb')][_0xf57f('0x11')],function(_0x2ae079){return{'model':db[_0x2ae079['model']],'as':_0x2ae079['as'],'attributes':_0x2ae079[_0xf57f('0xe')],'include':_0x2ae079['include']?_[_0xf57f('0x10')](_0x2ae079['include'],function(_0x49421d){return{'model':db[_0x49421d[_0xf57f('0x12')]],'as':_0x49421d['as'],'attributes':_0x49421d[_0xf57f('0xe')],'include':_0x49421d[_0xf57f('0x11')]?_['map'](_0x49421d[_0xf57f('0x11')],function(_0x181aaf){return{'model':db[_0x181aaf[_0xf57f('0x12')]],'as':_0x181aaf['as'],'attributes':_0x181aaf[_0xf57f('0xe')]};}):[]};}):[]};}):[]:[]})[_0xf57f('0x13')](function(_0x51e9c5){logger['info'](_0xf57f('0x1b'),_0x5ac321);logger[_0xf57f('0x15')](_0xf57f('0x1b'),_0x5ac321,JSON[_0xf57f('0x17')](_0x51e9c5));_0x31ccb6(_0x51e9c5);})['catch'](function(_0x192e75){logger[_0xf57f('0x19')](_0xf57f('0x1b'),_0x192e75[_0xf57f('0x1a')],_0x5ac321);_0x212865(_0x4105dd[_0xf57f('0x19')](0x1f4,_0x192e75[_0xf57f('0x1a')]));});});}; \ No newline at end of file +var _0xe367=['ioredis','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','attributes','limit','map','include','model','then','info','debug','catch','message','error','find','where','ShowSquareProject','lodash'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe367,0x1bf));var _0x7e36=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe367[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x7e36('0x0'));var Redis=require(_0x7e36('0x1'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x7e36('0x2'));var config=require(_0x7e36('0x3'));config[_0x7e36('0x4')]=_[_0x7e36('0x5')](config[_0x7e36('0x4')],{'host':_0x7e36('0x6'),'port':0x18eb});var socket=require(_0x7e36('0x7'))(new Redis(config['redis']));require(_0x7e36('0x8'))[_0x7e36('0x9')](socket);exports[_0x7e36('0xa')]=function(_0x27464b){var _0x3ca86d=this;return new Promise(function(_0x11c077,_0x457692){return db[_0x7e36('0xb')]['findAll']({'raw':_0x27464b[_0x7e36('0xc')]?_0x27464b[_0x7e36('0xc')][_0x7e36('0xd')]===undefined?!![]:![]:!![],'where':_0x27464b[_0x7e36('0xc')]?_0x27464b[_0x7e36('0xc')]['where']||null:null,'attributes':_0x27464b[_0x7e36('0xc')]?_0x27464b[_0x7e36('0xc')][_0x7e36('0xe')]||null:null,'limit':_0x27464b[_0x7e36('0xc')]?_0x27464b[_0x7e36('0xc')][_0x7e36('0xf')]||null:null,'include':_0x27464b[_0x7e36('0xc')]?_0x27464b[_0x7e36('0xc')]['include']?_[_0x7e36('0x10')](_0x27464b[_0x7e36('0xc')][_0x7e36('0x11')],function(_0x50b7c9){return{'model':db[_0x50b7c9[_0x7e36('0x12')]],'as':_0x50b7c9['as'],'attributes':_0x50b7c9[_0x7e36('0xe')],'include':_0x50b7c9[_0x7e36('0x11')]?_[_0x7e36('0x10')](_0x50b7c9[_0x7e36('0x11')],function(_0x31b410){return{'model':db[_0x31b410[_0x7e36('0x12')]],'as':_0x31b410['as'],'attributes':_0x31b410[_0x7e36('0xe')],'include':_0x31b410[_0x7e36('0x11')]?_[_0x7e36('0x10')](_0x31b410[_0x7e36('0x11')],function(_0x69eb76){return{'model':db[_0x69eb76['model']],'as':_0x69eb76['as'],'attributes':_0x69eb76[_0x7e36('0xe')]};}):[]};}):[]};}):[]:[]})[_0x7e36('0x13')](function(_0x5b09c7){logger[_0x7e36('0x14')](_0x7e36('0xa'),_0x27464b);logger[_0x7e36('0x15')](_0x7e36('0xa'),_0x27464b,JSON['stringify'](_0x5b09c7));_0x11c077(_0x5b09c7);})[_0x7e36('0x16')](function(_0x1c68d8){logger['error']('GetSquareProjects',_0x1c68d8[_0x7e36('0x17')],_0x27464b);_0x457692(_0x3ca86d[_0x7e36('0x18')](0x1f4,_0x1c68d8[_0x7e36('0x17')]));});});};exports['ShowSquareProject']=function(_0x34b52c){var _0x27e577=this;return new Promise(function(_0x322da5,_0x29d6c4){return db[_0x7e36('0xb')][_0x7e36('0x19')]({'raw':_0x34b52c[_0x7e36('0xc')]?_0x34b52c[_0x7e36('0xc')][_0x7e36('0xd')]===undefined?!![]:![]:!![],'where':_0x34b52c[_0x7e36('0xc')]?_0x34b52c[_0x7e36('0xc')][_0x7e36('0x1a')]||null:null,'attributes':_0x34b52c['options']?_0x34b52c[_0x7e36('0xc')][_0x7e36('0xe')]||null:null,'include':_0x34b52c[_0x7e36('0xc')]?_0x34b52c[_0x7e36('0xc')]['include']?_[_0x7e36('0x10')](_0x34b52c['options']['include'],function(_0x2143fe){return{'model':db[_0x2143fe[_0x7e36('0x12')]],'as':_0x2143fe['as'],'attributes':_0x2143fe[_0x7e36('0xe')],'include':_0x2143fe[_0x7e36('0x11')]?_['map'](_0x2143fe[_0x7e36('0x11')],function(_0x434d96){return{'model':db[_0x434d96[_0x7e36('0x12')]],'as':_0x434d96['as'],'attributes':_0x434d96['attributes'],'include':_0x434d96['include']?_[_0x7e36('0x10')](_0x434d96['include'],function(_0x5d4e4b){return{'model':db[_0x5d4e4b['model']],'as':_0x5d4e4b['as'],'attributes':_0x5d4e4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e36('0x13')](function(_0x2ec8ee){logger[_0x7e36('0x14')](_0x7e36('0x1b'),_0x34b52c);logger[_0x7e36('0x15')](_0x7e36('0x1b'),_0x34b52c,JSON['stringify'](_0x2ec8ee));_0x322da5(_0x2ec8ee);})[_0x7e36('0x16')](function(_0x3c33d9){logger['error'](_0x7e36('0x1b'),_0x3c33d9[_0x7e36('0x17')],_0x34b52c);_0x29d6c4(_0x27e577[_0x7e36('0x18')](0x1f4,_0x3c33d9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 0be822c..6551b69 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 _0x8fa6=['register','length','save','update','emit','removeListener'];(function(_0x5b37f9,_0x311ec1){var _0x5945e2=function(_0x5af157){while(--_0x5af157){_0x5b37f9['push'](_0x5b37f9['shift']());}};_0x5945e2(++_0x311ec1);}(_0x8fa6,0x1ca));var _0x68fa=function(_0x5cae8a,_0x5249e2){_0x5cae8a=_0x5cae8a-0x0;var _0x4a15c1=_0x8fa6[_0x5cae8a];return _0x4a15c1;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x68fa('0x0'),'remove',_0x68fa('0x1')];function createListener(_0x18dbb5,_0x41fad6){return function(_0x2ec801){_0x41fad6[_0x68fa('0x2')](_0x18dbb5,_0x2ec801);};}function removeListener(_0x520e1c,_0x19d5b0){return function(){SquareProjectEvents[_0x68fa('0x3')](_0x520e1c,_0x19d5b0);};}exports[_0x68fa('0x4')]=function(_0x34d637){for(var _0x30b422=0x0,_0x16d7d3=events[_0x68fa('0x5')];_0x30b422<_0x16d7d3;_0x30b422++){var _0x1b512e=events[_0x30b422];var _0x3a04bd=createListener('squareProject:'+_0x1b512e,_0x34d637);SquareProjectEvents['on'](_0x1b512e,_0x3a04bd);}}; \ No newline at end of file +var _0x31b3=['length','squareProject:','save','update','emit','removeListener','register'];(function(_0xa35666,_0x19fb8a){var _0x4b2d2f=function(_0x5d3fca){while(--_0x5d3fca){_0xa35666['push'](_0xa35666['shift']());}};_0x4b2d2f(++_0x19fb8a);}(_0x31b3,0x1ec));var _0x331b=function(_0x5bd6d9,_0x51aa71){_0x5bd6d9=_0x5bd6d9-0x0;var _0x32dab4=_0x31b3[_0x5bd6d9];return _0x32dab4;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x331b('0x0'),'remove',_0x331b('0x1')];function createListener(_0xddfa24,_0x2bfa26){return function(_0x43d52d){_0x2bfa26[_0x331b('0x2')](_0xddfa24,_0x43d52d);};}function removeListener(_0x26b727,_0x2376ca){return function(){SquareProjectEvents[_0x331b('0x3')](_0x26b727,_0x2376ca);};}exports[_0x331b('0x4')]=function(_0x2206a5){for(var _0x337973=0x0,_0x421af2=events[_0x331b('0x5')];_0x337973<_0x421af2;_0x337973++){var _0x51cf19=events[_0x337973];var _0x3dbc23=createListener(_0x331b('0x6')+_0x51cf19,_0x2206a5);SquareProjectEvents['on'](_0x51cf19,_0x3dbc23);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 76f8244..a726772 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x291b70,_0x1bc6db){var _0x40770b=function(_0x4c3c94){while(--_0x4c3c94){_0x291b70['push'](_0x291b70['shift']());}};_0x40770b(++_0x1bc6db);}(_0x53ec,0x192));var _0xc53e=function(_0x5c956b,_0xa87d11){_0x5c956b=_0x5c956b-0x0;var _0xaff46a=_0x53ec[_0x5c956b];return _0xaff46a;};'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 fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3c0ba0,_0x48fa5e){var _0x5f360f=function(_0x4530b6){while(--_0x4530b6){_0x3c0ba0['push'](_0x3c0ba0['shift']());}};_0x5f360f(++_0x48fa5e);}(_0x4975,0x86));var _0x5497=function(_0x308786,_0x2f1d02){_0x308786=_0x308786-0x0;var _0x461513=_0x4975[_0x308786];return _0x461513;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 1de286d..38130f0 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 _0xe14b=['VIRTUAL','lastIndexOf','sequelize','exports','STRING'];(function(_0x5d1e06,_0x4d6881){var _0x56baba=function(_0x1045df){while(--_0x1045df){_0x5d1e06['push'](_0x5d1e06['shift']());}};_0x56baba(++_0x4d6881);}(_0xe14b,0x93));var _0xbe14=function(_0x545be0,_0x1e819e){_0x545be0=_0x545be0-0x0;var _0x18e6f6=_0xe14b[_0x545be0];return _0x18e6f6;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbe14('0x2')]},'context':{'type':Sequelize[_0xbe14('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbe14('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xbe14('0x2')]},'saveName':{'type':Sequelize[_0xbe14('0x2')]},'filename':{'type':Sequelize[_0xbe14('0x2')]},'savePath':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x3')],'get':function(){var _0x39387e='';var _0x196fca=this['getDataValue']('savePath');if(_0x196fca){_0x39387e=_0x196fca['substring'](_0x196fca[_0xbe14('0x4')]('.'));}return _0x39387e;}}}; \ No newline at end of file +var _0xdbf5=['lastIndexOf','exports','STRING','VIRTUAL','savePath'];(function(_0x2b39d9,_0x18d637){var _0x3978be=function(_0x3ec6f8){while(--_0x3ec6f8){_0x2b39d9['push'](_0x2b39d9['shift']());}};_0x3978be(++_0x18d637);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x3ffb74,_0x39e685){_0x3ffb74=_0x3ffb74-0x0;var _0x2a735a=_0xdbf5[_0x3ffb74];return _0x2a735a;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5dbf('0x1')]},'context':{'type':Sequelize[_0x5dbf('0x1')]},'extension':{'type':Sequelize[_0x5dbf('0x1')]},'priority':{'type':Sequelize[_0x5dbf('0x1')]},'accountcode':{'type':Sequelize[_0x5dbf('0x1')]},'dnid':{'type':Sequelize[_0x5dbf('0x1')]},'projectName':{'type':Sequelize[_0x5dbf('0x1')]},'saveName':{'type':Sequelize[_0x5dbf('0x1')]},'filename':{'type':Sequelize[_0x5dbf('0x1')]},'savePath':{'type':Sequelize[_0x5dbf('0x1')]},'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){var _0x88128e='';var _0x93e657=this['getDataValue'](_0x5dbf('0x3'));if(_0x93e657){_0x88128e=_0x93e657['substring'](_0x93e657[_0x5dbf('0x4')]('.'));}return _0x88128e;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 07dd1a7..b20edc1 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 _0x5777=['rows','show','intersection','length','includeAll','find','body','catch','params','../../components/encryptor','uniqueid','savePath','format','%s.cypher','decryptFile','secrets','recording','existsSync','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include'];(function(_0x22c6b3,_0x1477d3){var _0xf7f740=function(_0x40cbf8){while(--_0x40cbf8){_0x22c6b3['push'](_0x22c6b3['shift']());}};_0xf7f740(++_0x1477d3);}(_0x5777,0x89));var _0x7577=function(_0x25bf9,_0x467adb){_0x25bf9=_0x25bf9-0x0;var _0x5642e5=_0x5777[_0x25bf9];return _0x5642e5;};'use strict';var emlformat=require(_0x7577('0x0'));var rimraf=require(_0x7577('0x1'));var zipdir=require(_0x7577('0x2'));var jsonpatch=require(_0x7577('0x3'));var rp=require(_0x7577('0x4'));var moment=require('moment');var BPromise=require(_0x7577('0x5'));var Mustache=require(_0x7577('0x6'));var util=require(_0x7577('0x7'));var path=require(_0x7577('0x8'));var sox=require(_0x7577('0x9'));var csv=require(_0x7577('0xa'));var ejs=require(_0x7577('0xb'));var fs=require('fs');var fs_extra=require(_0x7577('0xc'));var _=require('lodash');var squel=require(_0x7577('0xd'));var crypto=require(_0x7577('0xe'));var jsforce=require(_0x7577('0xf'));var deskjs=require(_0x7577('0x10'));var toCsv=require(_0x7577('0xa'));var querystring=require('querystring');var Papa=require(_0x7577('0x11'));var Redis=require(_0x7577('0x12'));var authService=require(_0x7577('0x13'));var qs=require(_0x7577('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7577('0x15'));var logger=require(_0x7577('0x16'))(_0x7577('0x17'));var utils=require(_0x7577('0x18'));var config=require(_0x7577('0x19'));var licenseUtil=require(_0x7577('0x1a'));var db=require(_0x7577('0x1b'))['db'];function respondWithStatusCode(_0x5cdcfa,_0x30c3b9){_0x30c3b9=_0x30c3b9||0xcc;return function(_0x45e91f){if(_0x45e91f){return _0x5cdcfa[_0x7577('0x1c')](_0x30c3b9);}return _0x5cdcfa[_0x7577('0x1d')](_0x30c3b9)[_0x7577('0x1e')]();};}function respondWithResult(_0x1c5ab1,_0x5c9c34){_0x5c9c34=_0x5c9c34||0xc8;return function(_0x41bc70){if(_0x41bc70){return _0x1c5ab1[_0x7577('0x1d')](_0x5c9c34)[_0x7577('0x1f')](_0x41bc70);}};}function respondWithFilteredResult(_0x11514b,_0x110f30){return function(_0x3ff9d0){if(_0x3ff9d0){var _0x4b2a44=typeof _0x110f30[_0x7577('0x20')]==='undefined'&&typeof _0x110f30[_0x7577('0x21')]===_0x7577('0x22');var _0x12637b=_0x3ff9d0['count'];var _0x59f365=_0x4b2a44?0x0:_0x110f30[_0x7577('0x20')];var _0x10ace5=_0x4b2a44?_0x3ff9d0[_0x7577('0x23')]:_0x110f30[_0x7577('0x20')]+_0x110f30[_0x7577('0x21')];var _0x1dfabc;if(_0x10ace5>=_0x12637b){_0x10ace5=_0x12637b;_0x1dfabc=0xc8;}else{_0x1dfabc=0xce;}_0x11514b[_0x7577('0x1d')](_0x1dfabc);return _0x11514b['set'](_0x7577('0x24'),_0x59f365+'-'+_0x10ace5+'/'+_0x12637b)[_0x7577('0x1f')](_0x3ff9d0);}return null;};}function patchUpdates(_0xe06ce){return function(_0x11d84f){try{jsonpatch[_0x7577('0x25')](_0x11d84f,_0xe06ce,!![]);}catch(_0x194566){return BPromise[_0x7577('0x26')](_0x194566);}return _0x11d84f['save']();};}function saveUpdates(_0x7e668e,_0x1d30c4){return function(_0x24398d){if(_0x24398d){return _0x24398d[_0x7577('0x27')](_0x7e668e)[_0x7577('0x28')](function(_0x2a233d){return _0x2a233d;});}return null;};}function removeEntity(_0x7cf79c,_0x36dbc6){return function(_0xc912bc){if(_0xc912bc){return _0xc912bc[_0x7577('0x29')]()['then'](function(){_0x7cf79c[_0x7577('0x1d')](0xcc)[_0x7577('0x1e')]();});}};}function handleEntityNotFound(_0x41e972,_0x420a71){return function(_0x23ea1d){if(!_0x23ea1d){_0x41e972[_0x7577('0x1c')](0x194);}return _0x23ea1d;};}function handleError(_0x810e34,_0xda4021){_0xda4021=_0xda4021||0x1f4;return function(_0x5c1565){logger[_0x7577('0x2a')](_0x5c1565[_0x7577('0x2b')]);if(_0x5c1565[_0x7577('0x2c')]){delete _0x5c1565[_0x7577('0x2c')];}_0x810e34[_0x7577('0x1d')](_0xda4021)[_0x7577('0x2d')](_0x5c1565);};}exports[_0x7577('0x2e')]=function(_0x1d1bf9,_0x27edac){var _0x4c21ea={},_0x3c3613={},_0x2fffc3={'count':0x0,'rows':[]};var _0x34cc5a=_[_0x7577('0x2f')](db[_0x7577('0x30')][_0x7577('0x31')],function(_0x5ee1d9){return{'name':_0x5ee1d9[_0x7577('0x32')],'type':_0x5ee1d9[_0x7577('0x33')][_0x7577('0x34')]};});_0x3c3613[_0x7577('0x35')]=_[_0x7577('0x2f')](_0x34cc5a,'name');_0x3c3613['query']=_[_0x7577('0x36')](_0x1d1bf9[_0x7577('0x37')]);_0x3c3613[_0x7577('0x38')]=_['intersection'](_0x3c3613[_0x7577('0x35')],_0x3c3613[_0x7577('0x37')]);_0x4c21ea[_0x7577('0x39')]=_['intersection'](_0x3c3613['model'],qs[_0x7577('0x3a')](_0x1d1bf9[_0x7577('0x37')][_0x7577('0x3a')]));_0x4c21ea[_0x7577('0x39')]=_0x4c21ea['attributes']['length']?_0x4c21ea[_0x7577('0x39')]:_0x3c3613[_0x7577('0x35')];if(!_0x1d1bf9[_0x7577('0x37')][_0x7577('0x3b')](_0x7577('0x3c'))){_0x4c21ea[_0x7577('0x21')]=qs[_0x7577('0x21')](_0x1d1bf9[_0x7577('0x37')][_0x7577('0x21')]);_0x4c21ea[_0x7577('0x20')]=qs[_0x7577('0x20')](_0x1d1bf9[_0x7577('0x37')][_0x7577('0x20')]);}_0x4c21ea[_0x7577('0x3d')]=qs[_0x7577('0x3e')](_0x1d1bf9['query']['sort']);_0x4c21ea[_0x7577('0x3f')]=qs['filters'](_['pick'](_0x1d1bf9[_0x7577('0x37')],_0x3c3613[_0x7577('0x38')]),_0x34cc5a);if(_0x1d1bf9['query'][_0x7577('0x40')]){_0x4c21ea[_0x7577('0x3f')]=_['merge'](_0x4c21ea[_0x7577('0x3f')],{'$or':_['map'](_0x34cc5a,function(_0x126916){if(_0x126916['type']!==_0x7577('0x41')){var _0x38c0f7={};_0x38c0f7[_0x126916['name']]={'$like':'%'+_0x1d1bf9[_0x7577('0x37')]['filter']+'%'};return _0x38c0f7;}})});}_0x4c21ea=_[_0x7577('0x42')]({},_0x4c21ea,_0x1d1bf9[_0x7577('0x43')]);var _0x460d31={'where':_0x4c21ea[_0x7577('0x3f')]};return db[_0x7577('0x30')][_0x7577('0x23')](_0x460d31)[_0x7577('0x28')](function(_0x341cee){_0x2fffc3[_0x7577('0x23')]=_0x341cee;if(_0x1d1bf9[_0x7577('0x37')]['includeAll']){_0x4c21ea[_0x7577('0x44')]=[{'all':!![]}];}return db[_0x7577('0x30')]['findAll'](_0x4c21ea);})['then'](function(_0x5f4c2c){_0x2fffc3[_0x7577('0x45')]=_0x5f4c2c;return _0x2fffc3;})[_0x7577('0x28')](respondWithFilteredResult(_0x27edac,_0x4c21ea))['catch'](handleError(_0x27edac,null));};exports[_0x7577('0x46')]=function(_0x450f02,_0x219219){var _0x932f9c={'raw':!![],'where':{'id':_0x450f02['params']['id']}},_0x9c2042={};_0x9c2042[_0x7577('0x35')]=_[_0x7577('0x36')](db[_0x7577('0x30')][_0x7577('0x31')]);_0x9c2042[_0x7577('0x37')]=_[_0x7577('0x36')](_0x450f02[_0x7577('0x37')]);_0x9c2042['filters']=_[_0x7577('0x47')](_0x9c2042['model'],_0x9c2042['query']);_0x932f9c[_0x7577('0x39')]=_[_0x7577('0x47')](_0x9c2042[_0x7577('0x35')],qs[_0x7577('0x3a')](_0x450f02[_0x7577('0x37')][_0x7577('0x3a')]));_0x932f9c[_0x7577('0x39')]=_0x932f9c['attributes'][_0x7577('0x48')]?_0x932f9c[_0x7577('0x39')]:_0x9c2042['model'];if(_0x450f02[_0x7577('0x37')][_0x7577('0x49')]){_0x932f9c['include']=[{'all':!![]}];}_0x932f9c=_[_0x7577('0x42')]({},_0x932f9c,_0x450f02['options']);return db[_0x7577('0x30')][_0x7577('0x4a')](_0x932f9c)['then'](handleEntityNotFound(_0x219219,null))[_0x7577('0x28')](respondWithResult(_0x219219,null))['catch'](handleError(_0x219219,null));};exports['create']=function(_0x3a6e75,_0x5c5bdf){return db[_0x7577('0x30')]['create'](_0x3a6e75[_0x7577('0x4b')],{})['then'](respondWithResult(_0x5c5bdf,0xc9))[_0x7577('0x4c')](handleError(_0x5c5bdf,null));};exports['update']=function(_0x49edc2,_0x5d3459){if(_0x49edc2['body']['id']){delete _0x49edc2[_0x7577('0x4b')]['id'];}return db[_0x7577('0x30')][_0x7577('0x4a')]({'where':{'id':_0x49edc2[_0x7577('0x4d')]['id']}})[_0x7577('0x28')](handleEntityNotFound(_0x5d3459,null))[_0x7577('0x28')](saveUpdates(_0x49edc2['body'],null))[_0x7577('0x28')](respondWithResult(_0x5d3459,null))[_0x7577('0x4c')](handleError(_0x5d3459,null));};exports['download']=function(_0x2ea83f,_0x4b32b2,_0x4aee77){var _0x1db299=require(_0x7577('0x4e'));var _0x20cdc7=![];var _0x14ecab={};if(_0x2ea83f[_0x7577('0x37')][_0x7577('0x33')]&&_0x2ea83f[_0x7577('0x37')]['type']===_0x7577('0x4f')){_0x14ecab['uniqueid']=_0x2ea83f[_0x7577('0x4d')]['id'];}else{_0x14ecab['id']=_0x2ea83f[_0x7577('0x4d')]['id'];}return db[_0x7577('0x30')][_0x7577('0x4a')]({'where':_0x14ecab,'attributes':['id',_0x7577('0x50'),'filename'],'raw':!![]})[_0x7577('0x28')](handleEntityNotFound(_0x4b32b2,null))[_0x7577('0x28')](function(_0x1d9cc4){if(_0x1d9cc4){var _0x3e9552=_0x1d9cc4[_0x7577('0x50')];var _0x53197d=util[_0x7577('0x51')](_0x7577('0x52'),_0x3e9552);if(fs['existsSync'](_0x53197d)){_0x20cdc7=!![];return _0x1db299[_0x7577('0x53')](_0x53197d,_0x3e9552,config[_0x7577('0x54')][_0x7577('0x55')])[_0x7577('0x28')](function(){return _0x1d9cc4;});}return _0x1d9cc4;}})[_0x7577('0x28')](function(_0xd596f6){if(_0xd596f6){var _0x3d868f=_0xd596f6['savePath'];if(!fs[_0x7577('0x56')](_0x3d868f)){throw new db['Sequelize'][(_0x7577('0x57'))](_0x7577('0x58'));}if(_0xd596f6[_0x7577('0x59')]){return _0x4b32b2[_0x7577('0x5a')](_0x3d868f,_0xd596f6[_0x7577('0x59')]+path[_0x7577('0x5b')](_0x3d868f),function(){if(_0x20cdc7){fs['unlink'](_0x3d868f);}});}else{return _0x4b32b2[_0x7577('0x5a')](_0x3d868f,function(_0x9478ed){if(_0x20cdc7){fs[_0x7577('0x5c')](_0x3d868f);}});}}})[_0x7577('0x4c')](function(_0x501566){if(_0x501566[_0x7577('0x5d')]===_0x7577('0x58')){_0x4b32b2[_0x7577('0x1d')](0x194)[_0x7577('0x2d')](_0x7577('0x5e'));}else{return handleError(_0x4b32b2,null);}});};exports[_0x7577('0x29')]=function(_0x3f605e,_0x3e70f8){return db['SquareRecording'][_0x7577('0x4a')]({'where':{'id':_0x3f605e[_0x7577('0x4d')]['id']}})[_0x7577('0x28')](function(_0x3ed501){if(_[_0x7577('0x5f')](_0x3ed501)){throw new ReferenceError(_0x7577('0x60'));}return _0x3ed501;})[_0x7577('0x28')](function(_0x5b7e2f){var _0x33140b=_0x5b7e2f[_0x7577('0x50')];logger['info'](_0x7577('0x61'),_0x33140b);if(!_[_0x7577('0x5f')](_0x5b7e2f[_0x7577('0x50')])&&fs[_0x7577('0x56')](_0x33140b)){logger['info'](_0x7577('0x62')+_0x33140b+_0x7577('0x63'));fs[_0x7577('0x64')](_0x33140b);}_0x33140b=_0x33140b+_0x7577('0x65');if(!_['isNil'](_0x5b7e2f[_0x7577('0x50')])&&fs[_0x7577('0x56')](_0x33140b)){logger[_0x7577('0x66')](_0x7577('0x62')+_0x33140b+_0x7577('0x63'));fs[_0x7577('0x64')](_0x33140b);}return _0x5b7e2f;})[_0x7577('0x28')](function(_0x1a1006){if(!_0x1a1006)throw new InternalError();return _0x1a1006[_0x7577('0x29')]();})['then'](function(){_0x3e70f8[_0x7577('0x1d')](0xcc)[_0x7577('0x1e')]();})[_0x7577('0x4c')](handleError(_0x3e70f8,null));}; \ No newline at end of file +var _0x1dfe=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','SquareRecording','includeAll','include','findAll','catch','create','body','update','find','params','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','secrets','recording','Sequelize','ValidationError','download','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','existsSync','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','fast-json-patch','moment','bluebird','to-csv','ejs','lodash'];(function(_0x29797a,_0x4eee43){var _0x7197ce=function(_0x57f011){while(--_0x57f011){_0x29797a['push'](_0x29797a['shift']());}};_0x7197ce(++_0x4eee43);}(_0x1dfe,0xb0));var _0xe1df=function(_0x4bc792,_0x29eee9){_0x4bc792=_0x4bc792-0x0;var _0x2f54c5=_0x1dfe[_0x4bc792];return _0x2f54c5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe1df('0x0'));var rp=require('request-promise');var moment=require(_0xe1df('0x1'));var BPromise=require(_0xe1df('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe1df('0x3'));var ejs=require(_0xe1df('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1df('0x5'));var squel=require(_0xe1df('0x6'));var crypto=require(_0xe1df('0x7'));var jsforce=require(_0xe1df('0x8'));var deskjs=require(_0xe1df('0x9'));var toCsv=require(_0xe1df('0x3'));var querystring=require('querystring');var Papa=require(_0xe1df('0xa'));var Redis=require(_0xe1df('0xb'));var authService=require(_0xe1df('0xc'));var qs=require(_0xe1df('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1df('0xe'))(_0xe1df('0xf'));var utils=require(_0xe1df('0x10'));var config=require(_0xe1df('0x11'));var licenseUtil=require(_0xe1df('0x12'));var db=require(_0xe1df('0x13'))['db'];function respondWithStatusCode(_0x1ef891,_0x269555){_0x269555=_0x269555||0xcc;return function(_0x4ceaec){if(_0x4ceaec){return _0x1ef891['sendStatus'](_0x269555);}return _0x1ef891[_0xe1df('0x14')](_0x269555)['end']();};}function respondWithResult(_0x45833a,_0x5e6a59){_0x5e6a59=_0x5e6a59||0xc8;return function(_0x240685){if(_0x240685){return _0x45833a[_0xe1df('0x14')](_0x5e6a59)[_0xe1df('0x15')](_0x240685);}};}function respondWithFilteredResult(_0x5935b0,_0x493ab4){return function(_0x31831b){if(_0x31831b){var _0x2e38c6=typeof _0x493ab4[_0xe1df('0x16')]===_0xe1df('0x17')&&typeof _0x493ab4[_0xe1df('0x18')]===_0xe1df('0x17');var _0xbc19ef=_0x31831b[_0xe1df('0x19')];var _0x5dc0c1=_0x2e38c6?0x0:_0x493ab4['offset'];var _0x71b27b=_0x2e38c6?_0x31831b[_0xe1df('0x19')]:_0x493ab4['offset']+_0x493ab4['limit'];var _0xfa477;if(_0x71b27b>=_0xbc19ef){_0x71b27b=_0xbc19ef;_0xfa477=0xc8;}else{_0xfa477=0xce;}_0x5935b0[_0xe1df('0x14')](_0xfa477);return _0x5935b0[_0xe1df('0x1a')](_0xe1df('0x1b'),_0x5dc0c1+'-'+_0x71b27b+'/'+_0xbc19ef)[_0xe1df('0x15')](_0x31831b);}return null;};}function patchUpdates(_0x23ce64){return function(_0x167862){try{jsonpatch['apply'](_0x167862,_0x23ce64,!![]);}catch(_0xbc935c){return BPromise['reject'](_0xbc935c);}return _0x167862[_0xe1df('0x1c')]();};}function saveUpdates(_0x1303ad,_0x28c0ac){return function(_0x55a862){if(_0x55a862){return _0x55a862['update'](_0x1303ad)[_0xe1df('0x1d')](function(_0x46e975){return _0x46e975;});}return null;};}function removeEntity(_0x33fb14,_0x1d3dd2){return function(_0x2e40a9){if(_0x2e40a9){return _0x2e40a9[_0xe1df('0x1e')]()[_0xe1df('0x1d')](function(){_0x33fb14[_0xe1df('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a9713,_0x7f6713){return function(_0x57a9be){if(!_0x57a9be){_0x3a9713[_0xe1df('0x1f')](0x194);}return _0x57a9be;};}function handleError(_0x28c7cd,_0x550452){_0x550452=_0x550452||0x1f4;return function(_0x591cd6){logger[_0xe1df('0x20')](_0x591cd6['stack']);if(_0x591cd6[_0xe1df('0x21')]){delete _0x591cd6[_0xe1df('0x21')];}_0x28c7cd[_0xe1df('0x14')](_0x550452)[_0xe1df('0x22')](_0x591cd6);};}exports[_0xe1df('0x23')]=function(_0x4eba5a,_0x445022){var _0x436b35={},_0x2effe0={},_0x1dba7c={'count':0x0,'rows':[]};var _0x2be342=_[_0xe1df('0x24')](db['SquareRecording'][_0xe1df('0x25')],function(_0x451f0e){return{'name':_0x451f0e[_0xe1df('0x26')],'type':_0x451f0e[_0xe1df('0x27')]['key']};});_0x2effe0[_0xe1df('0x28')]=_[_0xe1df('0x24')](_0x2be342,_0xe1df('0x21'));_0x2effe0[_0xe1df('0x29')]=_[_0xe1df('0x2a')](_0x4eba5a[_0xe1df('0x29')]);_0x2effe0[_0xe1df('0x2b')]=_[_0xe1df('0x2c')](_0x2effe0[_0xe1df('0x28')],_0x2effe0[_0xe1df('0x29')]);_0x436b35[_0xe1df('0x2d')]=_[_0xe1df('0x2c')](_0x2effe0[_0xe1df('0x28')],qs[_0xe1df('0x2e')](_0x4eba5a[_0xe1df('0x29')]['fields']));_0x436b35[_0xe1df('0x2d')]=_0x436b35[_0xe1df('0x2d')][_0xe1df('0x2f')]?_0x436b35[_0xe1df('0x2d')]:_0x2effe0[_0xe1df('0x28')];if(!_0x4eba5a[_0xe1df('0x29')][_0xe1df('0x30')](_0xe1df('0x31'))){_0x436b35['limit']=qs[_0xe1df('0x18')](_0x4eba5a[_0xe1df('0x29')][_0xe1df('0x18')]);_0x436b35[_0xe1df('0x16')]=qs[_0xe1df('0x16')](_0x4eba5a['query']['offset']);}_0x436b35[_0xe1df('0x32')]=qs[_0xe1df('0x33')](_0x4eba5a['query'][_0xe1df('0x33')]);_0x436b35['where']=qs[_0xe1df('0x2b')](_[_0xe1df('0x34')](_0x4eba5a[_0xe1df('0x29')],_0x2effe0[_0xe1df('0x2b')]),_0x2be342);if(_0x4eba5a['query']['filter']){_0x436b35['where']=_[_0xe1df('0x35')](_0x436b35[_0xe1df('0x36')],{'$or':_[_0xe1df('0x24')](_0x2be342,function(_0x3f7538){if(_0x3f7538[_0xe1df('0x27')]!==_0xe1df('0x37')){var _0x57e8f8={};_0x57e8f8[_0x3f7538[_0xe1df('0x21')]]={'$like':'%'+_0x4eba5a[_0xe1df('0x29')][_0xe1df('0x38')]+'%'};return _0x57e8f8;}})});}_0x436b35=_[_0xe1df('0x35')]({},_0x436b35,_0x4eba5a[_0xe1df('0x39')]);var _0x4367f8={'where':_0x436b35[_0xe1df('0x36')]};return db[_0xe1df('0x3a')][_0xe1df('0x19')](_0x4367f8)['then'](function(_0x183328){_0x1dba7c[_0xe1df('0x19')]=_0x183328;if(_0x4eba5a[_0xe1df('0x29')][_0xe1df('0x3b')]){_0x436b35[_0xe1df('0x3c')]=[{'all':!![]}];}return db[_0xe1df('0x3a')][_0xe1df('0x3d')](_0x436b35);})[_0xe1df('0x1d')](function(_0x50483a){_0x1dba7c['rows']=_0x50483a;return _0x1dba7c;})[_0xe1df('0x1d')](respondWithFilteredResult(_0x445022,_0x436b35))[_0xe1df('0x3e')](handleError(_0x445022,null));};exports['show']=function(_0x4c8b32,_0x2e080a){var _0x45e400={'raw':!![],'where':{'id':_0x4c8b32['params']['id']}},_0x5e07ca={};_0x5e07ca[_0xe1df('0x28')]=_[_0xe1df('0x2a')](db[_0xe1df('0x3a')][_0xe1df('0x25')]);_0x5e07ca[_0xe1df('0x29')]=_[_0xe1df('0x2a')](_0x4c8b32[_0xe1df('0x29')]);_0x5e07ca[_0xe1df('0x2b')]=_[_0xe1df('0x2c')](_0x5e07ca[_0xe1df('0x28')],_0x5e07ca['query']);_0x45e400[_0xe1df('0x2d')]=_[_0xe1df('0x2c')](_0x5e07ca[_0xe1df('0x28')],qs[_0xe1df('0x2e')](_0x4c8b32[_0xe1df('0x29')][_0xe1df('0x2e')]));_0x45e400['attributes']=_0x45e400[_0xe1df('0x2d')][_0xe1df('0x2f')]?_0x45e400['attributes']:_0x5e07ca['model'];if(_0x4c8b32['query'][_0xe1df('0x3b')]){_0x45e400[_0xe1df('0x3c')]=[{'all':!![]}];}_0x45e400=_[_0xe1df('0x35')]({},_0x45e400,_0x4c8b32[_0xe1df('0x39')]);return db['SquareRecording']['find'](_0x45e400)['then'](handleEntityNotFound(_0x2e080a,null))[_0xe1df('0x1d')](respondWithResult(_0x2e080a,null))[_0xe1df('0x3e')](handleError(_0x2e080a,null));};exports[_0xe1df('0x3f')]=function(_0x390eb5,_0x34395c){return db['SquareRecording']['create'](_0x390eb5[_0xe1df('0x40')],{})[_0xe1df('0x1d')](respondWithResult(_0x34395c,0xc9))[_0xe1df('0x3e')](handleError(_0x34395c,null));};exports[_0xe1df('0x41')]=function(_0x571a30,_0x2c65d4){if(_0x571a30[_0xe1df('0x40')]['id']){delete _0x571a30[_0xe1df('0x40')]['id'];}return db[_0xe1df('0x3a')][_0xe1df('0x42')]({'where':{'id':_0x571a30[_0xe1df('0x43')]['id']}})[_0xe1df('0x1d')](handleEntityNotFound(_0x2c65d4,null))[_0xe1df('0x1d')](saveUpdates(_0x571a30[_0xe1df('0x40')],null))[_0xe1df('0x1d')](respondWithResult(_0x2c65d4,null))[_0xe1df('0x3e')](handleError(_0x2c65d4,null));};exports['download']=function(_0x1e949c,_0x1676be,_0x3b8d03){var _0xa0e76a=require(_0xe1df('0x44'));var _0x2a0dfa=![];var _0x2c3d40={};if(_0x1e949c[_0xe1df('0x29')][_0xe1df('0x27')]&&_0x1e949c[_0xe1df('0x29')][_0xe1df('0x27')]===_0xe1df('0x45')){_0x2c3d40[_0xe1df('0x45')]=_0x1e949c[_0xe1df('0x43')]['id'];}else{_0x2c3d40['id']=_0x1e949c['params']['id'];}return db[_0xe1df('0x3a')][_0xe1df('0x42')]({'where':_0x2c3d40,'attributes':['id','savePath',_0xe1df('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x1676be,null))[_0xe1df('0x1d')](function(_0x12b547){if(_0x12b547){var _0x570286=_0x12b547[_0xe1df('0x47')];var _0x37bad5=util[_0xe1df('0x48')](_0xe1df('0x49'),_0x570286);if(fs['existsSync'](_0x37bad5)){_0x2a0dfa=!![];return _0xa0e76a['decryptFile'](_0x37bad5,_0x570286,config[_0xe1df('0x4a')][_0xe1df('0x4b')])['then'](function(){return _0x12b547;});}return _0x12b547;}})[_0xe1df('0x1d')](function(_0x34db38){if(_0x34db38){var _0x30ce55=_0x34db38[_0xe1df('0x47')];if(!fs['existsSync'](_0x30ce55)){throw new db[(_0xe1df('0x4c'))][(_0xe1df('0x4d'))]('SquareRecording\x20not\x20found');}if(_0x34db38[_0xe1df('0x46')]){return _0x1676be[_0xe1df('0x4e')](_0x30ce55,_0x34db38[_0xe1df('0x46')]+path[_0xe1df('0x4f')](_0x30ce55),function(){if(_0x2a0dfa){fs[_0xe1df('0x50')](_0x30ce55);}});}else{return _0x1676be[_0xe1df('0x4e')](_0x30ce55,function(_0x40911f){if(_0x2a0dfa){fs[_0xe1df('0x50')](_0x30ce55);}});}}})[_0xe1df('0x3e')](function(_0x443496){if(_0x443496[_0xe1df('0x51')]===_0xe1df('0x52')){_0x1676be[_0xe1df('0x14')](0x194)[_0xe1df('0x22')](_0xe1df('0x53'));}else{return handleError(_0x1676be,null);}});};exports['destroy']=function(_0x3c7e99,_0x15cfbe){return db['SquareRecording']['find']({'where':{'id':_0x3c7e99[_0xe1df('0x43')]['id']}})[_0xe1df('0x1d')](function(_0x1b9048){if(_[_0xe1df('0x54')](_0x1b9048)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1b9048;})[_0xe1df('0x1d')](function(_0x3145f7){var _0xb66092=_0x3145f7[_0xe1df('0x47')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0xb66092);if(!_[_0xe1df('0x54')](_0x3145f7[_0xe1df('0x47')])&&fs[_0xe1df('0x55')](_0xb66092)){logger[_0xe1df('0x56')](_0xe1df('0x57')+_0xb66092+_0xe1df('0x58'));fs[_0xe1df('0x59')](_0xb66092);}_0xb66092=_0xb66092+_0xe1df('0x5a');if(!_[_0xe1df('0x54')](_0x3145f7['savePath'])&&fs[_0xe1df('0x55')](_0xb66092)){logger[_0xe1df('0x56')](_0xe1df('0x57')+_0xb66092+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe1df('0x59')](_0xb66092);}return _0x3145f7;})['then'](function(_0x2996a2){if(!_0x2996a2)throw new InternalError();return _0x2996a2[_0xe1df('0x1e')]();})[_0xe1df('0x1d')](function(){_0x15cfbe['status'](0xcc)['end']();})[_0xe1df('0x3e')](handleError(_0x15cfbe,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 79feb72..89fc727 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 _0xf19c=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x5de3a8,_0x442445){var _0x472bf1=function(_0x427cf0){while(--_0x427cf0){_0x5de3a8['push'](_0x5de3a8['shift']());}};_0x472bf1(++_0x442445);}(_0xf19c,0x10b));var _0xcf19=function(_0x5437ae,_0x567cdc){_0x5437ae=_0x5437ae-0x0;var _0x4cd47b=_0xf19c[_0x5437ae];return _0x4cd47b;};'use strict';var _=require(_0xcf19('0x0'));var util=require(_0xcf19('0x1'));var logger=require(_0xcf19('0x2'))('api');var moment=require(_0xcf19('0x3'));var BPromise=require(_0xcf19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf19('0x5'));var rimraf=require(_0xcf19('0x6'));var config=require(_0xcf19('0x7'));var attributes=require(_0xcf19('0x8'));module[_0xcf19('0x9')]=function(_0x59a408,_0x3d3608){return _0x59a408[_0xcf19('0xa')](_0xcf19('0xb'),attributes,{'tableName':_0xcf19('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4d8=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','../../config/logger','api','request-promise'];(function(_0x114ccd,_0x285307){var _0x24eae6=function(_0x3b4d2a){while(--_0x3b4d2a){_0x114ccd['push'](_0x114ccd['shift']());}};_0x24eae6(++_0x285307);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc4d8[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x8c4d('0x0'));var util=require('util');var logger=require(_0x8c4d('0x1'))(_0x8c4d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8c4d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c4d('0x4'));var attributes=require(_0x8c4d('0x5'));module[_0x8c4d('0x6')]=function(_0xa1bc80,_0x227bc8){return _0xa1bc80[_0x8c4d('0x7')](_0x8c4d('0x8'),attributes,{'tableName':_0x8c4d('0x9'),'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 1f3fb11..f9fb44b 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 _0xe19a=['SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','SquareRecording','create','body','options','raw','CreateSquareRecording','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x169014,_0x2704c6){var _0x4afa79=function(_0x434352){while(--_0x434352){_0x169014['push'](_0x169014['shift']());}};_0x4afa79(++_0x2704c6);}(_0xe19a,0x10a));var _0xae19=function(_0xcd39c8,_0x2ad166){_0xcd39c8=_0xcd39c8-0x0;var _0x463dfc=_0xe19a[_0xcd39c8];return _0x463dfc;};'use strict';var _=require(_0xae19('0x0'));var util=require(_0xae19('0x1'));var moment=require(_0xae19('0x2'));var BPromise=require(_0xae19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae19('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xae19('0x5'))(_0xae19('0x6'));var config=require(_0xae19('0x7'));var jayson=require(_0xae19('0x8'));var client=jayson[_0xae19('0x9')][_0xae19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59d364,_0x20f378,_0x3a0d5d){return new BPromise(function(_0x20cd26,_0x290651){return client[_0xae19('0xb')](_0x59d364,_0x3a0d5d)[_0xae19('0xc')](function(_0x2cd97b){logger[_0xae19('0xd')](_0xae19('0xe'),_0x20f378,'request\x20sent');logger[_0xae19('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x20f378,_0xae19('0x10'),JSON[_0xae19('0x11')](_0x2cd97b));if(_0x2cd97b[_0xae19('0x12')]){if(_0x2cd97b[_0xae19('0x12')][_0xae19('0x13')]===0x1f4){logger[_0xae19('0x12')](_0xae19('0xe'),_0x20f378,_0x2cd97b[_0xae19('0x12')]['message']);return _0x290651(_0x2cd97b[_0xae19('0x12')]['message']);}logger[_0xae19('0x12')](_0xae19('0xe'),_0x20f378,_0x2cd97b[_0xae19('0x12')][_0xae19('0x14')]);return _0x20cd26(_0x2cd97b[_0xae19('0x12')][_0xae19('0x14')]);}else{logger['info'](_0xae19('0xe'),_0x20f378,_0xae19('0x10'));_0x20cd26(_0x2cd97b['result']['message']);}})['catch'](function(_0x552d09){logger[_0xae19('0x12')](_0xae19('0xe'),_0x20f378,_0x552d09);_0x290651(_0x552d09);});});}exports['CreateSquareRecording']=function(_0x4c974c){var _0x44709b=this;return new Promise(function(_0x1e980d,_0x3a5649){return db[_0xae19('0x15')][_0xae19('0x16')](_0x4c974c[_0xae19('0x17')],{'raw':_0x4c974c[_0xae19('0x18')]?_0x4c974c['options'][_0xae19('0x19')]===undefined?!![]:![]:!![]})[_0xae19('0xc')](function(_0x25d2ed){logger[_0xae19('0xd')](_0xae19('0x1a'),_0x4c974c);logger[_0xae19('0xf')](_0xae19('0x1a'),_0x4c974c,JSON[_0xae19('0x11')](_0x25d2ed));_0x1e980d(_0x25d2ed);})[_0xae19('0x1b')](function(_0x16a75f){logger['error']('CreateSquareRecording',_0x16a75f[_0xae19('0x14')],_0x4c974c);_0x3a5649(_0x44709b['error'](0x1f4,_0x16a75f[_0xae19('0x14')]));});});}; \ No newline at end of file +var _0x692b=['then','info','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request'];(function(_0x5983ce,_0x2121a2){var _0x3ccc0e=function(_0x92f5a1){while(--_0x92f5a1){_0x5983ce['push'](_0x5983ce['shift']());}};_0x3ccc0e(++_0x2121a2);}(_0x692b,0x114));var _0xb692=function(_0x3e3fde,_0x418b27){_0x3e3fde=_0x3e3fde-0x0;var _0x6a2763=_0x692b[_0x3e3fde];return _0x6a2763;};'use strict';var _=require(_0xb692('0x0'));var util=require(_0xb692('0x1'));var moment=require('moment');var BPromise=require(_0xb692('0x2'));var rs=require(_0xb692('0x3'));var fs=require('fs');var Redis=require(_0xb692('0x4'));var db=require(_0xb692('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb692('0x6'));var client=jayson[_0xb692('0x7')][_0xb692('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x531c63,_0x3912f8,_0x25fd8d){return new BPromise(function(_0x25e2f6,_0x456a5e){return client[_0xb692('0x9')](_0x531c63,_0x25fd8d)[_0xb692('0xa')](function(_0x303474){logger[_0xb692('0xb')](_0xb692('0xc'),_0x3912f8,'request\x20sent');logger['debug'](_0xb692('0xd'),_0x3912f8,_0xb692('0xe'),JSON[_0xb692('0xf')](_0x303474));if(_0x303474[_0xb692('0x10')]){if(_0x303474[_0xb692('0x10')][_0xb692('0x11')]===0x1f4){logger[_0xb692('0x10')](_0xb692('0xc'),_0x3912f8,_0x303474[_0xb692('0x10')][_0xb692('0x12')]);return _0x456a5e(_0x303474[_0xb692('0x10')][_0xb692('0x12')]);}logger[_0xb692('0x10')]('SquareRecording,\x20%s,\x20%s',_0x3912f8,_0x303474[_0xb692('0x10')]['message']);return _0x25e2f6(_0x303474[_0xb692('0x10')]['message']);}else{logger[_0xb692('0xb')]('SquareRecording,\x20%s,\x20%s',_0x3912f8,_0xb692('0xe'));_0x25e2f6(_0x303474[_0xb692('0x13')][_0xb692('0x12')]);}})[_0xb692('0x14')](function(_0x5083d7){logger[_0xb692('0x10')](_0xb692('0xc'),_0x3912f8,_0x5083d7);_0x456a5e(_0x5083d7);});});}exports[_0xb692('0x15')]=function(_0x4d3ddb){var _0x4a3eba=this;return new Promise(function(_0x459cb3,_0x473c14){return db['SquareRecording'][_0xb692('0x16')](_0x4d3ddb[_0xb692('0x17')],{'raw':_0x4d3ddb[_0xb692('0x18')]?_0x4d3ddb[_0xb692('0x18')][_0xb692('0x19')]===undefined?!![]:![]:!![]})[_0xb692('0xa')](function(_0x3520e0){logger[_0xb692('0xb')](_0xb692('0x15'),_0x4d3ddb);logger['debug'](_0xb692('0x15'),_0x4d3ddb,JSON[_0xb692('0xf')](_0x3520e0));_0x459cb3(_0x3520e0);})['catch'](function(_0xafe923){logger[_0xb692('0x10')]('CreateSquareRecording',_0xafe923['message'],_0x4d3ddb);_0x473c14(_0x4a3eba[_0xb692('0x10')](0x1f4,_0xafe923['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index c9b5d0c..d8e53e7 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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2ddca3,_0x3cabe4){var _0xc8cb2=function(_0x134510){while(--_0x134510){_0x2ddca3['push'](_0x2ddca3['shift']());}};_0xc8cb2(++_0x3cabe4);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c446a,_0x3b3ad2){_0x1c446a=_0x1c446a-0x0;var _0x899e24=_0xb10b[_0x1c446a];return _0x899e24;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2dfd0e,_0x13739e){var _0x343af6=function(_0x206e2f){while(--_0x206e2f){_0x2dfd0e['push'](_0x2dfd0e['shift']());}};_0x343af6(++_0x13739e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index c6d703f..a1b5565 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 _0xd94c=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x145b93,_0x4cf77a){var _0x596ac2=function(_0x2c418d){while(--_0x2c418d){_0x145b93['push'](_0x145b93['shift']());}};_0x596ac2(++_0x4cf77a);}(_0xd94c,0x16b));var _0xcd94=function(_0x67f213,_0xee43d7){_0x67f213=_0x67f213-0x0;var _0x2c9405=_0xd94c[_0x67f213];return _0x2c9405;};'use strict';var Sequelize=require(_0xcd94('0x0'));module[_0xcd94('0x1')]={'network':{'type':Sequelize[_0xcd94('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xcd94('0x2')]},'channel':{'type':Sequelize[_0xcd94('0x2')]},'language':{'type':Sequelize[_0xcd94('0x2')]},'type':{'type':Sequelize[_0xcd94('0x2')]},'uniqueid':{'type':Sequelize[_0xcd94('0x2')]},'version':{'type':Sequelize[_0xcd94('0x2')]},'callerid':{'type':Sequelize[_0xcd94('0x2')]},'calleridname':{'type':Sequelize[_0xcd94('0x2')]},'callingpres':{'type':Sequelize[_0xcd94('0x2')]},'callingani2':{'type':Sequelize[_0xcd94('0x2')]},'callington':{'type':Sequelize[_0xcd94('0x2')]},'callingtns':{'type':Sequelize[_0xcd94('0x2')]},'dnid':{'type':Sequelize[_0xcd94('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xcd94('0x2')]},'extension':{'type':Sequelize[_0xcd94('0x2')]},'priority':{'type':Sequelize[_0xcd94('0x2')]},'enhanced':{'type':Sequelize[_0xcd94('0x2')]},'accountcode':{'type':Sequelize[_0xcd94('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xcd94('0x2')]},'joinAt':{'type':Sequelize[_0xcd94('0x3')]},'leaveAt':{'type':Sequelize[_0xcd94('0x3')]},'bot':{'type':Sequelize[_0xcd94('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x194f=['sequelize','exports','STRING','DATE'];(function(_0x5d946b,_0x1a7996){var _0x5c2ea7=function(_0x3f4dc6){while(--_0x3f4dc6){_0x5d946b['push'](_0x5d946b['shift']());}};_0x5c2ea7(++_0x1a7996);}(_0x194f,0x188));var _0xf194=function(_0x2f2b66,_0x6825bd){_0x2f2b66=_0x2f2b66-0x0;var _0xdd99be=_0x194f[_0x2f2b66];return _0xdd99be;};'use strict';var Sequelize=require(_0xf194('0x0'));module[_0xf194('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xf194('0x2')]},'request':{'type':Sequelize[_0xf194('0x2')]},'channel':{'type':Sequelize[_0xf194('0x2')]},'language':{'type':Sequelize[_0xf194('0x2')]},'type':{'type':Sequelize[_0xf194('0x2')]},'uniqueid':{'type':Sequelize[_0xf194('0x2')]},'version':{'type':Sequelize[_0xf194('0x2')]},'callerid':{'type':Sequelize[_0xf194('0x2')]},'calleridname':{'type':Sequelize[_0xf194('0x2')]},'callingpres':{'type':Sequelize[_0xf194('0x2')]},'callingani2':{'type':Sequelize[_0xf194('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xf194('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xf194('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xf194('0x2')]},'priority':{'type':Sequelize[_0xf194('0x2')]},'enhanced':{'type':Sequelize[_0xf194('0x2')]},'accountcode':{'type':Sequelize[_0xf194('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf194('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 66bb8f7..29afd60 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 _0x5c0d=['keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c0d,0x14a));var _0xd5c0=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x5c0d[_0x2ef44b];return _0x2405b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd5c0('0x0'));var zipdir=require(_0xd5c0('0x1'));var jsonpatch=require(_0xd5c0('0x2'));var rp=require(_0xd5c0('0x3'));var moment=require(_0xd5c0('0x4'));var BPromise=require(_0xd5c0('0x5'));var Mustache=require(_0xd5c0('0x6'));var util=require(_0xd5c0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd5c0('0x8'));var ejs=require(_0xd5c0('0x9'));var fs=require('fs');var fs_extra=require(_0xd5c0('0xa'));var _=require('lodash');var squel=require(_0xd5c0('0xb'));var crypto=require(_0xd5c0('0xc'));var jsforce=require(_0xd5c0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd5c0('0x8'));var querystring=require('querystring');var Papa=require(_0xd5c0('0xe'));var Redis=require(_0xd5c0('0xf'));var authService=require(_0xd5c0('0x10'));var qs=require(_0xd5c0('0x11'));var as=require(_0xd5c0('0x12'));var hardwareService=require(_0xd5c0('0x13'));var logger=require('../../config/logger')(_0xd5c0('0x14'));var utils=require(_0xd5c0('0x15'));var config=require(_0xd5c0('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12a0a2,_0x3109ae){_0x3109ae=_0x3109ae||0xcc;return function(_0x3aa131){if(_0x3aa131){return _0x12a0a2[_0xd5c0('0x17')](_0x3109ae);}return _0x12a0a2[_0xd5c0('0x18')](_0x3109ae)[_0xd5c0('0x19')]();};}function respondWithResult(_0x96862a,_0x567df2){_0x567df2=_0x567df2||0xc8;return function(_0x201ea3){if(_0x201ea3){return _0x96862a[_0xd5c0('0x18')](_0x567df2)[_0xd5c0('0x1a')](_0x201ea3);}};}function respondWithFilteredResult(_0x5320f8,_0x55fae3){return function(_0x10f7e9){if(_0x10f7e9){var _0x5c4fac=typeof _0x55fae3[_0xd5c0('0x1b')]===_0xd5c0('0x1c')&&typeof _0x55fae3[_0xd5c0('0x1d')]==='undefined';var _0x4230b4=_0x10f7e9[_0xd5c0('0x1e')];var _0x53aed2=_0x5c4fac?0x0:_0x55fae3[_0xd5c0('0x1b')];var _0xa97da7=_0x5c4fac?_0x10f7e9[_0xd5c0('0x1e')]:_0x55fae3[_0xd5c0('0x1b')]+_0x55fae3[_0xd5c0('0x1d')];var _0x57697b;if(_0xa97da7>=_0x4230b4){_0xa97da7=_0x4230b4;_0x57697b=0xc8;}else{_0x57697b=0xce;}_0x5320f8[_0xd5c0('0x18')](_0x57697b);return _0x5320f8[_0xd5c0('0x1f')]('Content-Range',_0x53aed2+'-'+_0xa97da7+'/'+_0x4230b4)[_0xd5c0('0x1a')](_0x10f7e9);}return null;};}function patchUpdates(_0x465eb7){return function(_0x2f9115){try{jsonpatch[_0xd5c0('0x20')](_0x2f9115,_0x465eb7,!![]);}catch(_0x271068){return BPromise[_0xd5c0('0x21')](_0x271068);}return _0x2f9115['save']();};}function saveUpdates(_0x55293e,_0x211a3e){return function(_0x307ff4){if(_0x307ff4){return _0x307ff4[_0xd5c0('0x22')](_0x55293e)[_0xd5c0('0x23')](function(_0x4175aa){return _0x4175aa;});}return null;};}function removeEntity(_0x451095,_0x3e258d){return function(_0x494d5d){if(_0x494d5d){return _0x494d5d[_0xd5c0('0x24')]()[_0xd5c0('0x23')](function(){_0x451095[_0xd5c0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed230,_0x4e2d14){return function(_0x32fb97){if(!_0x32fb97){_0x3ed230[_0xd5c0('0x17')](0x194);}return _0x32fb97;};}function handleError(_0x3c25b8,_0x5d42c2){_0x5d42c2=_0x5d42c2||0x1f4;return function(_0x6cbc7a){logger[_0xd5c0('0x25')](_0x6cbc7a[_0xd5c0('0x26')]);if(_0x6cbc7a[_0xd5c0('0x27')]){delete _0x6cbc7a[_0xd5c0('0x27')];}_0x3c25b8[_0xd5c0('0x18')](_0x5d42c2)[_0xd5c0('0x28')](_0x6cbc7a);};}exports[_0xd5c0('0x29')]=function(_0x20f0be,_0xf94534){var _0x10a33b={},_0x2df394={},_0x267bc2={'count':0x0,'rows':[]};var _0xb3b783=_[_0xd5c0('0x2a')](db[_0xd5c0('0x2b')][_0xd5c0('0x2c')],function(_0x4da35e){return{'name':_0x4da35e[_0xd5c0('0x2d')],'type':_0x4da35e[_0xd5c0('0x2e')][_0xd5c0('0x2f')]};});_0x2df394[_0xd5c0('0x30')]=_[_0xd5c0('0x2a')](_0xb3b783,_0xd5c0('0x27'));_0x2df394[_0xd5c0('0x31')]=_[_0xd5c0('0x32')](_0x20f0be[_0xd5c0('0x31')]);_0x2df394['filters']=_[_0xd5c0('0x33')](_0x2df394[_0xd5c0('0x30')],_0x2df394[_0xd5c0('0x31')]);_0x10a33b[_0xd5c0('0x34')]=_[_0xd5c0('0x33')](_0x2df394['model'],qs[_0xd5c0('0x35')](_0x20f0be[_0xd5c0('0x31')]['fields']));_0x10a33b['attributes']=_0x10a33b[_0xd5c0('0x34')]['length']?_0x10a33b[_0xd5c0('0x34')]:_0x2df394[_0xd5c0('0x30')];if(!_0x20f0be[_0xd5c0('0x31')][_0xd5c0('0x36')](_0xd5c0('0x37'))){_0x10a33b[_0xd5c0('0x1d')]=qs['limit'](_0x20f0be[_0xd5c0('0x31')]['limit']);_0x10a33b[_0xd5c0('0x1b')]=qs[_0xd5c0('0x1b')](_0x20f0be[_0xd5c0('0x31')][_0xd5c0('0x1b')]);}_0x10a33b[_0xd5c0('0x38')]=qs[_0xd5c0('0x39')](_0x20f0be[_0xd5c0('0x31')][_0xd5c0('0x39')]);_0x10a33b[_0xd5c0('0x3a')]=qs['filters'](_[_0xd5c0('0x3b')](_0x20f0be[_0xd5c0('0x31')],_0x2df394[_0xd5c0('0x3c')]),_0xb3b783);if(_0x20f0be['query']['filter']){_0x10a33b['where']=_['merge'](_0x10a33b[_0xd5c0('0x3a')],{'$or':_['map'](_0xb3b783,function(_0x2425e0){if(_0x2425e0['type']!=='VIRTUAL'){var _0x262ba0={};_0x262ba0[_0x2425e0[_0xd5c0('0x27')]]={'$like':'%'+_0x20f0be['query'][_0xd5c0('0x3d')]+'%'};return _0x262ba0;}})});}_0x10a33b=_['merge']({},_0x10a33b,_0x20f0be[_0xd5c0('0x3e')]);var _0x4dd235={'where':_0x10a33b['where']};return db[_0xd5c0('0x2b')][_0xd5c0('0x1e')](_0x4dd235)[_0xd5c0('0x23')](function(_0x3540ee){_0x267bc2[_0xd5c0('0x1e')]=_0x3540ee;if(_0x20f0be['query'][_0xd5c0('0x3f')]){_0x10a33b[_0xd5c0('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0xd5c0('0x41')](_0x10a33b);})['then'](function(_0x507251){_0x267bc2[_0xd5c0('0x42')]=_0x507251;return _0x267bc2;})[_0xd5c0('0x23')](respondWithFilteredResult(_0xf94534,_0x10a33b))[_0xd5c0('0x43')](handleError(_0xf94534,null));};exports[_0xd5c0('0x44')]=function(_0xcee75f,_0x1db814){var _0x4290c1={'raw':!![],'where':{'id':_0xcee75f[_0xd5c0('0x45')]['id']}},_0x39f386={};_0x39f386[_0xd5c0('0x30')]=_[_0xd5c0('0x32')](db[_0xd5c0('0x2b')][_0xd5c0('0x2c')]);_0x39f386[_0xd5c0('0x31')]=_[_0xd5c0('0x32')](_0xcee75f[_0xd5c0('0x31')]);_0x39f386['filters']=_[_0xd5c0('0x33')](_0x39f386[_0xd5c0('0x30')],_0x39f386['query']);_0x4290c1[_0xd5c0('0x34')]=_['intersection'](_0x39f386[_0xd5c0('0x30')],qs[_0xd5c0('0x35')](_0xcee75f['query']['fields']));_0x4290c1[_0xd5c0('0x34')]=_0x4290c1[_0xd5c0('0x34')][_0xd5c0('0x46')]?_0x4290c1['attributes']:_0x39f386[_0xd5c0('0x30')];if(_0xcee75f[_0xd5c0('0x31')][_0xd5c0('0x3f')]){_0x4290c1[_0xd5c0('0x40')]=[{'all':!![]}];}_0x4290c1=_[_0xd5c0('0x47')]({},_0x4290c1,_0xcee75f['options']);return db[_0xd5c0('0x2b')][_0xd5c0('0x48')](_0x4290c1)[_0xd5c0('0x23')](handleEntityNotFound(_0x1db814,null))[_0xd5c0('0x23')](respondWithResult(_0x1db814,null))[_0xd5c0('0x43')](handleError(_0x1db814,null));};exports['create']=function(_0x4b4905,_0x304f07){return db[_0xd5c0('0x2b')][_0xd5c0('0x49')](_0x4b4905['body'],{})['then'](respondWithResult(_0x304f07,0xc9))['catch'](handleError(_0x304f07,null));};exports['update']=function(_0x271e2d,_0x349239){if(_0x271e2d['body']['id']){delete _0x271e2d[_0xd5c0('0x4a')]['id'];}return db[_0xd5c0('0x2b')][_0xd5c0('0x48')]({'where':{'id':_0x271e2d[_0xd5c0('0x45')]['id']}})[_0xd5c0('0x23')](handleEntityNotFound(_0x349239,null))[_0xd5c0('0x23')](saveUpdates(_0x271e2d[_0xd5c0('0x4a')],null))[_0xd5c0('0x23')](respondWithResult(_0x349239,null))[_0xd5c0('0x43')](handleError(_0x349239,null));};exports['destroy']=function(_0x3dfdc2,_0x2cc0c7){return db[_0xd5c0('0x2b')][_0xd5c0('0x48')]({'where':{'id':_0x3dfdc2['params']['id']}})[_0xd5c0('0x23')](handleEntityNotFound(_0x2cc0c7,null))[_0xd5c0('0x23')](removeEntity(_0x2cc0c7,null))[_0xd5c0('0x43')](handleError(_0x2cc0c7,null));};exports[_0xd5c0('0x4b')]=function(_0x3070f9,_0x5c2f61){return db['SquareReport'][_0xd5c0('0x4b')]()[_0xd5c0('0x23')](respondWithResult(_0x5c2f61,null))['catch'](handleError(_0x5c2f61,null));}; \ No newline at end of file +var _0xf339=['findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','status','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','options','SquareReport','includeAll','include'];(function(_0x2ea3a8,_0x5ec0a4){var _0x269226=function(_0x269c5b){while(--_0x269c5b){_0x2ea3a8['push'](_0x2ea3a8['shift']());}};_0x269226(++_0x5ec0a4);}(_0xf339,0xa8));var _0x9f33=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf339[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x9f33('0x0'));var rimraf=require(_0x9f33('0x1'));var zipdir=require(_0x9f33('0x2'));var jsonpatch=require(_0x9f33('0x3'));var rp=require(_0x9f33('0x4'));var moment=require(_0x9f33('0x5'));var BPromise=require(_0x9f33('0x6'));var Mustache=require('mustache');var util=require(_0x9f33('0x7'));var path=require(_0x9f33('0x8'));var sox=require('sox');var csv=require(_0x9f33('0x9'));var ejs=require(_0x9f33('0xa'));var fs=require('fs');var fs_extra=require(_0x9f33('0xb'));var _=require('lodash');var squel=require(_0x9f33('0xc'));var crypto=require(_0x9f33('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f33('0xe'));var toCsv=require(_0x9f33('0x9'));var querystring=require(_0x9f33('0xf'));var Papa=require(_0x9f33('0x10'));var Redis=require(_0x9f33('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f33('0x12'));var as=require(_0x9f33('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f33('0x14'))(_0x9f33('0x15'));var utils=require(_0x9f33('0x16'));var config=require(_0x9f33('0x17'));var licenseUtil=require(_0x9f33('0x18'));var db=require(_0x9f33('0x19'))['db'];function respondWithStatusCode(_0x34ed60,_0x16b11d){_0x16b11d=_0x16b11d||0xcc;return function(_0x37612b){if(_0x37612b){return _0x34ed60[_0x9f33('0x1a')](_0x16b11d);}return _0x34ed60['status'](_0x16b11d)[_0x9f33('0x1b')]();};}function respondWithResult(_0x3829a1,_0x1515c6){_0x1515c6=_0x1515c6||0xc8;return function(_0x456db5){if(_0x456db5){return _0x3829a1['status'](_0x1515c6)[_0x9f33('0x1c')](_0x456db5);}};}function respondWithFilteredResult(_0x1a1975,_0x833447){return function(_0x1e869d){if(_0x1e869d){var _0x1b0305=typeof _0x833447['offset']===_0x9f33('0x1d')&&typeof _0x833447[_0x9f33('0x1e')]===_0x9f33('0x1d');var _0x380cf2=_0x1e869d[_0x9f33('0x1f')];var _0x1efb78=_0x1b0305?0x0:_0x833447[_0x9f33('0x20')];var _0x53d9cd=_0x1b0305?_0x1e869d[_0x9f33('0x1f')]:_0x833447['offset']+_0x833447[_0x9f33('0x1e')];var _0x128087;if(_0x53d9cd>=_0x380cf2){_0x53d9cd=_0x380cf2;_0x128087=0xc8;}else{_0x128087=0xce;}_0x1a1975['status'](_0x128087);return _0x1a1975[_0x9f33('0x21')](_0x9f33('0x22'),_0x1efb78+'-'+_0x53d9cd+'/'+_0x380cf2)['json'](_0x1e869d);}return null;};}function patchUpdates(_0x255949){return function(_0x136fa1){try{jsonpatch[_0x9f33('0x23')](_0x136fa1,_0x255949,!![]);}catch(_0x7913ba){return BPromise[_0x9f33('0x24')](_0x7913ba);}return _0x136fa1[_0x9f33('0x25')]();};}function saveUpdates(_0x2f129e,_0x929ca6){return function(_0xde4816){if(_0xde4816){return _0xde4816[_0x9f33('0x26')](_0x2f129e)[_0x9f33('0x27')](function(_0x27656d){return _0x27656d;});}return null;};}function removeEntity(_0x39704f,_0x4b47ea){return function(_0x12b505){if(_0x12b505){return _0x12b505['destroy']()['then'](function(){_0x39704f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc51a,_0x1d99a7){return function(_0x250a06){if(!_0x250a06){_0x2cc51a[_0x9f33('0x1a')](0x194);}return _0x250a06;};}function handleError(_0x42bde4,_0x4ae9ea){_0x4ae9ea=_0x4ae9ea||0x1f4;return function(_0x11dd2){logger[_0x9f33('0x28')](_0x11dd2['stack']);if(_0x11dd2[_0x9f33('0x29')]){delete _0x11dd2[_0x9f33('0x29')];}_0x42bde4[_0x9f33('0x2a')](_0x4ae9ea)[_0x9f33('0x2b')](_0x11dd2);};}exports[_0x9f33('0x2c')]=function(_0x55c522,_0x3ad1b2){var _0x2fc8ab={},_0x8c9530={},_0x4700bf={'count':0x0,'rows':[]};var _0x2069d7=_['map'](db['SquareReport'][_0x9f33('0x2d')],function(_0x3d84f7){return{'name':_0x3d84f7[_0x9f33('0x2e')],'type':_0x3d84f7[_0x9f33('0x2f')][_0x9f33('0x30')]};});_0x8c9530[_0x9f33('0x31')]=_[_0x9f33('0x32')](_0x2069d7,_0x9f33('0x29'));_0x8c9530['query']=_[_0x9f33('0x33')](_0x55c522[_0x9f33('0x34')]);_0x8c9530[_0x9f33('0x35')]=_['intersection'](_0x8c9530[_0x9f33('0x31')],_0x8c9530['query']);_0x2fc8ab[_0x9f33('0x36')]=_[_0x9f33('0x37')](_0x8c9530[_0x9f33('0x31')],qs[_0x9f33('0x38')](_0x55c522[_0x9f33('0x34')][_0x9f33('0x38')]));_0x2fc8ab[_0x9f33('0x36')]=_0x2fc8ab['attributes'][_0x9f33('0x39')]?_0x2fc8ab[_0x9f33('0x36')]:_0x8c9530[_0x9f33('0x31')];if(!_0x55c522[_0x9f33('0x34')]['hasOwnProperty'](_0x9f33('0x3a'))){_0x2fc8ab[_0x9f33('0x1e')]=qs[_0x9f33('0x1e')](_0x55c522[_0x9f33('0x34')]['limit']);_0x2fc8ab[_0x9f33('0x20')]=qs[_0x9f33('0x20')](_0x55c522[_0x9f33('0x34')][_0x9f33('0x20')]);}_0x2fc8ab[_0x9f33('0x3b')]=qs['sort'](_0x55c522[_0x9f33('0x34')]['sort']);_0x2fc8ab[_0x9f33('0x3c')]=qs[_0x9f33('0x35')](_[_0x9f33('0x3d')](_0x55c522[_0x9f33('0x34')],_0x8c9530[_0x9f33('0x35')]),_0x2069d7);if(_0x55c522[_0x9f33('0x34')][_0x9f33('0x3e')]){_0x2fc8ab[_0x9f33('0x3c')]=_['merge'](_0x2fc8ab[_0x9f33('0x3c')],{'$or':_[_0x9f33('0x32')](_0x2069d7,function(_0x13dbda){if(_0x13dbda[_0x9f33('0x2f')]!==_0x9f33('0x3f')){var _0x3074fe={};_0x3074fe[_0x13dbda[_0x9f33('0x29')]]={'$like':'%'+_0x55c522[_0x9f33('0x34')]['filter']+'%'};return _0x3074fe;}})});}_0x2fc8ab=_[_0x9f33('0x40')]({},_0x2fc8ab,_0x55c522[_0x9f33('0x41')]);var _0x774301={'where':_0x2fc8ab[_0x9f33('0x3c')]};return db[_0x9f33('0x42')]['count'](_0x774301)['then'](function(_0x301801){_0x4700bf[_0x9f33('0x1f')]=_0x301801;if(_0x55c522[_0x9f33('0x34')][_0x9f33('0x43')]){_0x2fc8ab[_0x9f33('0x44')]=[{'all':!![]}];}return db[_0x9f33('0x42')][_0x9f33('0x45')](_0x2fc8ab);})[_0x9f33('0x27')](function(_0x328aa0){_0x4700bf[_0x9f33('0x46')]=_0x328aa0;return _0x4700bf;})[_0x9f33('0x27')](respondWithFilteredResult(_0x3ad1b2,_0x2fc8ab))[_0x9f33('0x47')](handleError(_0x3ad1b2,null));};exports[_0x9f33('0x48')]=function(_0x50d177,_0xfd77bb){var _0x589009={'raw':!![],'where':{'id':_0x50d177[_0x9f33('0x49')]['id']}},_0x520efb={};_0x520efb[_0x9f33('0x31')]=_['keys'](db[_0x9f33('0x42')][_0x9f33('0x2d')]);_0x520efb['query']=_[_0x9f33('0x33')](_0x50d177[_0x9f33('0x34')]);_0x520efb['filters']=_[_0x9f33('0x37')](_0x520efb['model'],_0x520efb[_0x9f33('0x34')]);_0x589009[_0x9f33('0x36')]=_[_0x9f33('0x37')](_0x520efb[_0x9f33('0x31')],qs['fields'](_0x50d177[_0x9f33('0x34')][_0x9f33('0x38')]));_0x589009[_0x9f33('0x36')]=_0x589009['attributes'][_0x9f33('0x39')]?_0x589009[_0x9f33('0x36')]:_0x520efb[_0x9f33('0x31')];if(_0x50d177[_0x9f33('0x34')][_0x9f33('0x43')]){_0x589009['include']=[{'all':!![]}];}_0x589009=_[_0x9f33('0x40')]({},_0x589009,_0x50d177[_0x9f33('0x41')]);return db['SquareReport'][_0x9f33('0x4a')](_0x589009)[_0x9f33('0x27')](handleEntityNotFound(_0xfd77bb,null))[_0x9f33('0x27')](respondWithResult(_0xfd77bb,null))[_0x9f33('0x47')](handleError(_0xfd77bb,null));};exports[_0x9f33('0x4b')]=function(_0x209479,_0x322f51){return db[_0x9f33('0x42')][_0x9f33('0x4b')](_0x209479['body'],{})[_0x9f33('0x27')](respondWithResult(_0x322f51,0xc9))['catch'](handleError(_0x322f51,null));};exports[_0x9f33('0x26')]=function(_0x4312ee,_0x41f5f6){if(_0x4312ee['body']['id']){delete _0x4312ee[_0x9f33('0x4c')]['id'];}return db[_0x9f33('0x42')][_0x9f33('0x4a')]({'where':{'id':_0x4312ee[_0x9f33('0x49')]['id']}})['then'](handleEntityNotFound(_0x41f5f6,null))[_0x9f33('0x27')](saveUpdates(_0x4312ee[_0x9f33('0x4c')],null))[_0x9f33('0x27')](respondWithResult(_0x41f5f6,null))[_0x9f33('0x47')](handleError(_0x41f5f6,null));};exports[_0x9f33('0x4d')]=function(_0x2ab185,_0x39839c){return db['SquareReport']['find']({'where':{'id':_0x2ab185[_0x9f33('0x49')]['id']}})[_0x9f33('0x27')](handleEntityNotFound(_0x39839c,null))['then'](removeEntity(_0x39839c,null))['catch'](handleError(_0x39839c,null));};exports['describe']=function(_0x11628e,_0x493c47){return db[_0x9f33('0x42')][_0x9f33('0x4e')]()[_0x9f33('0x27')](respondWithResult(_0x493c47,null))[_0x9f33('0x47')](handleError(_0x493c47,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 963d492..a0512f8 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 _0x4e4a=['lodash','util','moment','request-promise','path','rimraf','exports','define','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x41f55e,_0x264009){var _0x922b33=function(_0x510189){while(--_0x510189){_0x41f55e['push'](_0x41f55e['shift']());}};_0x922b33(++_0x264009);}(_0x4e4a,0xf0));var _0xa4e4=function(_0x1a7b6d,_0x5a31a9){_0x1a7b6d=_0x1a7b6d-0x0;var _0x28933b=_0x4e4a[_0x1a7b6d];return _0x28933b;};'use strict';var _=require(_0xa4e4('0x0'));var util=require(_0xa4e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa4e4('0x2'));var BPromise=require('bluebird');var rp=require(_0xa4e4('0x3'));var fs=require('fs');var path=require(_0xa4e4('0x4'));var rimraf=require(_0xa4e4('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0xa4e4('0x6')]=function(_0x5a1139,_0x4a8778){return _0x5a1139[_0xa4e4('0x7')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xa4e4('0x8'),'fields':[_0xa4e4('0x9'),_0xa4e4('0xa')]},{'name':_0xa4e4('0xb'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b40=['moment','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','../../config/logger','api'];(function(_0x26d741,_0x18409b){var _0x564540=function(_0x23250b){while(--_0x23250b){_0x26d741['push'](_0x26d741['shift']());}};_0x564540(++_0x18409b);}(_0x5b40,0x1a2));var _0x05b4=function(_0xf5b1be,_0x5b6e02){_0xf5b1be=_0xf5b1be-0x0;var _0x10ccab=_0x5b40[_0xf5b1be];return _0x10ccab;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x05b4('0x0'))(_0x05b4('0x1'));var moment=require(_0x05b4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x05b4('0x3'));var config=require(_0x05b4('0x4'));var attributes=require(_0x05b4('0x5'));module['exports']=function(_0x5f28f7,_0x4e4522){return _0x5f28f7[_0x05b4('0x6')](_0x05b4('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x05b4('0x8'),'fields':[_0x05b4('0x9'),_0x05b4('0xa')]},{'name':_0x05b4('0xb'),'fields':[_0x05b4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 99d1049..9a56c93 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 _0x1d60=['moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','create','options','raw','then','UpdateSquareReport','update','body','where','attributes','limit','lodash','util'];(function(_0x500ce3,_0x2c5cce){var _0x5c4c8a=function(_0x22e960){while(--_0x22e960){_0x500ce3['push'](_0x500ce3['shift']());}};_0x5c4c8a(++_0x2c5cce);}(_0x1d60,0x134));var _0x01d6=function(_0x2ca853,_0x1eb12a){_0x2ca853=_0x2ca853-0x0;var _0x3032c0=_0x1d60[_0x2ca853];return _0x3032c0;};'use strict';var _=require(_0x01d6('0x0'));var util=require(_0x01d6('0x1'));var moment=require(_0x01d6('0x2'));var BPromise=require(_0x01d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01d6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x01d6('0x5'));var logger=require(_0x01d6('0x6'))('rpc');var config=require(_0x01d6('0x7'));var jayson=require(_0x01d6('0x8'));var client=jayson[_0x01d6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdb4a6b,_0x51c814,_0x28a83b){return new BPromise(function(_0x49b189,_0x35aa58){return client['request'](_0xdb4a6b,_0x28a83b)['then'](function(_0x20f766){logger[_0x01d6('0xa')](_0x01d6('0xb'),_0x51c814,_0x01d6('0xc'));logger[_0x01d6('0xd')](_0x01d6('0xe'),_0x51c814,'request\x20sent',JSON[_0x01d6('0xf')](_0x20f766));if(_0x20f766['error']){if(_0x20f766[_0x01d6('0x10')][_0x01d6('0x11')]===0x1f4){logger[_0x01d6('0x10')](_0x01d6('0xb'),_0x51c814,_0x20f766[_0x01d6('0x10')][_0x01d6('0x12')]);return _0x35aa58(_0x20f766[_0x01d6('0x10')][_0x01d6('0x12')]);}logger[_0x01d6('0x10')](_0x01d6('0xb'),_0x51c814,_0x20f766['error'][_0x01d6('0x12')]);return _0x49b189(_0x20f766['error']['message']);}else{logger[_0x01d6('0xa')](_0x01d6('0xb'),_0x51c814,_0x01d6('0xc'));_0x49b189(_0x20f766['result'][_0x01d6('0x12')]);}})[_0x01d6('0x13')](function(_0x46c594){logger['error'](_0x01d6('0xb'),_0x51c814,_0x46c594);_0x35aa58(_0x46c594);});});}exports[_0x01d6('0x14')]=function(_0x4a3587){var _0x41aa80=this;return new Promise(function(_0x11b957,_0x264f70){return db['SquareReport'][_0x01d6('0x15')](_0x4a3587['body'],{'raw':_0x4a3587['options']?_0x4a3587[_0x01d6('0x16')][_0x01d6('0x17')]===undefined?!![]:![]:!![]})[_0x01d6('0x18')](function(_0x291c62){logger[_0x01d6('0xa')](_0x01d6('0x14'),_0x4a3587);logger['debug'](_0x01d6('0x14'),_0x4a3587,JSON['stringify'](_0x291c62));_0x11b957(_0x291c62);})['catch'](function(_0x45c161){logger[_0x01d6('0x10')](_0x01d6('0x14'),_0x45c161[_0x01d6('0x12')],_0x4a3587);_0x264f70(_0x41aa80[_0x01d6('0x10')](0x1f4,_0x45c161[_0x01d6('0x12')]));});});};exports[_0x01d6('0x19')]=function(_0x305b7f){var _0x24282b=this;return new Promise(function(_0x299de2,_0x1267b7){return db['SquareReport'][_0x01d6('0x1a')](_0x305b7f[_0x01d6('0x1b')],{'raw':_0x305b7f[_0x01d6('0x16')]?_0x305b7f[_0x01d6('0x16')][_0x01d6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x305b7f[_0x01d6('0x16')]?_0x305b7f[_0x01d6('0x16')][_0x01d6('0x1c')]||null:null,'attributes':_0x305b7f[_0x01d6('0x16')]?_0x305b7f[_0x01d6('0x16')][_0x01d6('0x1d')]||null:null,'limit':_0x305b7f[_0x01d6('0x16')]?_0x305b7f[_0x01d6('0x16')][_0x01d6('0x1e')]||null:null})[_0x01d6('0x18')](function(_0x42987f){logger[_0x01d6('0xa')](_0x01d6('0x19'),_0x305b7f);logger['debug'](_0x01d6('0x19'),_0x305b7f,JSON['stringify'](_0x42987f));_0x299de2(_0x42987f);})['catch'](function(_0x1620af){logger['error']('UpdateSquareReport',_0x1620af[_0x01d6('0x12')],_0x305b7f);_0x1267b7(_0x24282b[_0x01d6('0x10')](0x1f4,_0x1620af[_0x01d6('0x12')]));});});}; \ No newline at end of file +var _0x4d8f=['info','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x4d8f,0xdf));var _0xf4d8=function(_0x4d6e5c,_0x116c67){_0x4d6e5c=_0x4d6e5c-0x0;var _0x11bfa3=_0x4d8f[_0x4d6e5c];return _0x11bfa3;};'use strict';var _=require('lodash');var util=require(_0xf4d8('0x0'));var moment=require('moment');var BPromise=require(_0xf4d8('0x1'));var rs=require(_0xf4d8('0x2'));var fs=require('fs');var Redis=require(_0xf4d8('0x3'));var db=require(_0xf4d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf4d8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf4d8('0x6')][_0xf4d8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43c1d1,_0x27de15,_0x556b70){return new BPromise(function(_0x722629,_0x499fa8){return client[_0xf4d8('0x8')](_0x43c1d1,_0x556b70)[_0xf4d8('0x9')](function(_0x2f6fef){logger['info'](_0xf4d8('0xa'),_0x27de15,_0xf4d8('0xb'));logger[_0xf4d8('0xc')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x27de15,_0xf4d8('0xb'),JSON[_0xf4d8('0xd')](_0x2f6fef));if(_0x2f6fef['error']){if(_0x2f6fef[_0xf4d8('0xe')][_0xf4d8('0xf')]===0x1f4){logger[_0xf4d8('0xe')](_0xf4d8('0xa'),_0x27de15,_0x2f6fef['error']['message']);return _0x499fa8(_0x2f6fef[_0xf4d8('0xe')][_0xf4d8('0x10')]);}logger[_0xf4d8('0xe')](_0xf4d8('0xa'),_0x27de15,_0x2f6fef['error'][_0xf4d8('0x10')]);return _0x722629(_0x2f6fef[_0xf4d8('0xe')][_0xf4d8('0x10')]);}else{logger[_0xf4d8('0x11')](_0xf4d8('0xa'),_0x27de15,'request\x20sent');_0x722629(_0x2f6fef[_0xf4d8('0x12')]['message']);}})[_0xf4d8('0x13')](function(_0x39c287){logger['error'](_0xf4d8('0xa'),_0x27de15,_0x39c287);_0x499fa8(_0x39c287);});});}exports[_0xf4d8('0x14')]=function(_0x4275ba){var _0x418e13=this;return new Promise(function(_0x5edeaf,_0x5e3788){return db[_0xf4d8('0x15')][_0xf4d8('0x16')](_0x4275ba[_0xf4d8('0x17')],{'raw':_0x4275ba['options']?_0x4275ba[_0xf4d8('0x18')][_0xf4d8('0x19')]===undefined?!![]:![]:!![]})[_0xf4d8('0x9')](function(_0x54b37d){logger[_0xf4d8('0x11')](_0xf4d8('0x14'),_0x4275ba);logger[_0xf4d8('0xc')](_0xf4d8('0x14'),_0x4275ba,JSON[_0xf4d8('0xd')](_0x54b37d));_0x5edeaf(_0x54b37d);})['catch'](function(_0x68d5b1){logger['error']('CreateSquareReport',_0x68d5b1[_0xf4d8('0x10')],_0x4275ba);_0x5e3788(_0x418e13[_0xf4d8('0xe')](0x1f4,_0x68d5b1[_0xf4d8('0x10')]));});});};exports[_0xf4d8('0x1a')]=function(_0x5b3e00){var _0x3e5b33=this;return new Promise(function(_0x34f73a,_0x1c5301){return db[_0xf4d8('0x15')][_0xf4d8('0x1b')](_0x5b3e00[_0xf4d8('0x17')],{'raw':_0x5b3e00['options']?_0x5b3e00[_0xf4d8('0x18')][_0xf4d8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b3e00[_0xf4d8('0x18')]?_0x5b3e00[_0xf4d8('0x18')][_0xf4d8('0x1c')]||null:null,'attributes':_0x5b3e00['options']?_0x5b3e00[_0xf4d8('0x18')]['attributes']||null:null,'limit':_0x5b3e00[_0xf4d8('0x18')]?_0x5b3e00[_0xf4d8('0x18')][_0xf4d8('0x1d')]||null:null})[_0xf4d8('0x9')](function(_0x9819f6){logger[_0xf4d8('0x11')](_0xf4d8('0x1a'),_0x5b3e00);logger[_0xf4d8('0xc')](_0xf4d8('0x1a'),_0x5b3e00,JSON[_0xf4d8('0xd')](_0x9819f6));_0x34f73a(_0x9819f6);})['catch'](function(_0xdfba9a){logger[_0xf4d8('0xe')]('UpdateSquareReport',_0xdfba9a['message'],_0x5b3e00);_0x1c5301(_0x3e5b33[_0xf4d8('0xe')](0x1f4,_0xdfba9a[_0xf4d8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 69ef0f2..df3a9a5 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 _0xb99a=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x2dee2f,_0x19572f){var _0x327c18=function(_0x130ec0){while(--_0x130ec0){_0x2dee2f['push'](_0x2dee2f['shift']());}};_0x327c18(++_0x19572f);}(_0xb99a,0x101));var _0xab99=function(_0xec6acd,_0x49b281){_0xec6acd=_0xec6acd-0x0;var _0x1fdc07=_0xb99a[_0xec6acd];return _0x1fdc07;};'use strict';var multer=require(_0xab99('0x0'));var util=require('util');var path=require(_0xab99('0x1'));var timeout=require(_0xab99('0x2'));var express=require('express');var router=express[_0xab99('0x3')]();var fs_extra=require(_0xab99('0x4'));var auth=require(_0xab99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab99('0x6'));var controller=require('./squareReportDetail.controller');router[_0xab99('0x7')]('/',auth[_0xab99('0x8')](),controller[_0xab99('0x9')]);router[_0xab99('0x7')](_0xab99('0xa'),auth[_0xab99('0x8')](),controller[_0xab99('0xb')]);router[_0xab99('0x7')]('/:id',auth[_0xab99('0x8')](),controller['show']);router[_0xab99('0xc')]('/',auth['isAuthenticated'](),controller[_0xab99('0xd')]);router[_0xab99('0xe')]('/:id',auth[_0xab99('0x8')](),controller[_0xab99('0xf')]);router[_0xab99('0x10')](_0xab99('0x11'),auth[_0xab99('0x8')](),controller[_0xab99('0x12')]);module[_0xab99('0x13')]=router; \ No newline at end of file +var _0x3813=['exports','path','connect-timeout','Router','fs-extra','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x164a85,_0x52f341){var _0x4e40c4=function(_0x3e692e){while(--_0x3e692e){_0x164a85['push'](_0x164a85['shift']());}};_0x4e40c4(++_0x52f341);}(_0x3813,0xd2));var _0x3381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3813[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3381('0x0'));var timeout=require(_0x3381('0x1'));var express=require('express');var router=express[_0x3381('0x2')]();var fs_extra=require(_0x3381('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3381('0x4'));var controller=require(_0x3381('0x5'));router[_0x3381('0x6')]('/',auth[_0x3381('0x7')](),controller[_0x3381('0x8')]);router[_0x3381('0x6')]('/describe',auth[_0x3381('0x7')](),controller[_0x3381('0x9')]);router['get'](_0x3381('0xa'),auth[_0x3381('0x7')](),controller[_0x3381('0xb')]);router[_0x3381('0xc')]('/',auth[_0x3381('0x7')](),controller[_0x3381('0xd')]);router[_0x3381('0xe')](_0x3381('0xa'),auth['isAuthenticated'](),controller[_0x3381('0xf')]);router[_0x3381('0x10')](_0x3381('0xa'),auth[_0x3381('0x7')](),controller[_0x3381('0x11')]);module[_0x3381('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index cca7f14..37f1e28 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 _0xf423=['STRING','sequelize'];(function(_0x2ae444,_0x5e9881){var _0x4d8790=function(_0x568cbb){while(--_0x568cbb){_0x2ae444['push'](_0x2ae444['shift']());}};_0x4d8790(++_0x5e9881);}(_0xf423,0x1c1));var _0x3f42=function(_0x4e8414,_0x1580b2){_0x4e8414=_0x4e8414-0x0;var _0x33e32c=_0xf423[_0x4e8414];return _0x33e32c;};'use strict';var Sequelize=require(_0x3f42('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3f42('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x3f42('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x3f42('0x1')]},'callerid':{'type':Sequelize[_0x3f42('0x1')]}}; \ No newline at end of file +var _0x3306=['sequelize','exports','STRING','TEXT'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x3306,0x1e0));var _0x6330=function(_0x1a6543,_0x5d0116){_0x1a6543=_0x1a6543-0x0;var _0x12ba9a=_0x3306[_0x1a6543];return _0x12ba9a;};'use strict';var Sequelize=require(_0x6330('0x0'));module[_0x6330('0x1')]={'uniqueid':{'type':Sequelize[_0x6330('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x6330('0x2')]},'data':{'type':Sequelize[_0x6330('0x3')]},'project_name':{'type':Sequelize[_0x6330('0x2')]},'callerid':{'type':Sequelize[_0x6330('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8748387..a6ff9b5 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 _0x576c=['count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','name','send','map','SquareDetailsReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined'];(function(_0x252f45,_0x4884c4){var _0x2b0beb=function(_0x3f6257){while(--_0x3f6257){_0x252f45['push'](_0x252f45['shift']());}};_0x2b0beb(++_0x4884c4);}(_0x576c,0x183));var _0xc576=function(_0x59f9ee,_0x4e5c40){_0x59f9ee=_0x59f9ee-0x0;var _0x4e1b8f=_0x576c[_0x59f9ee];return _0x4e1b8f;};'use strict';var emlformat=require(_0xc576('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc576('0x1'));var jsonpatch=require(_0xc576('0x2'));var rp=require(_0xc576('0x3'));var moment=require(_0xc576('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc576('0x5'));var util=require(_0xc576('0x6'));var path=require('path');var sox=require(_0xc576('0x7'));var csv=require('to-csv');var ejs=require(_0xc576('0x8'));var fs=require('fs');var fs_extra=require(_0xc576('0x9'));var _=require('lodash');var squel=require(_0xc576('0xa'));var crypto=require(_0xc576('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc576('0xc'));var toCsv=require(_0xc576('0xd'));var querystring=require(_0xc576('0xe'));var Papa=require('papaparse');var Redis=require(_0xc576('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc576('0x10'));var hardwareService=require(_0xc576('0x11'));var logger=require(_0xc576('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc576('0x13'));var db=require(_0xc576('0x14'))['db'];function respondWithStatusCode(_0x4601fe,_0x11b9a4){_0x11b9a4=_0x11b9a4||0xcc;return function(_0x19fe05){if(_0x19fe05){return _0x4601fe['sendStatus'](_0x11b9a4);}return _0x4601fe[_0xc576('0x15')](_0x11b9a4)[_0xc576('0x16')]();};}function respondWithResult(_0x411908,_0x5e5a63){_0x5e5a63=_0x5e5a63||0xc8;return function(_0x531737){if(_0x531737){return _0x411908[_0xc576('0x15')](_0x5e5a63)[_0xc576('0x17')](_0x531737);}};}function respondWithFilteredResult(_0x5ddc89,_0x1be997){return function(_0x325dbc){if(_0x325dbc){var _0xbff9b8=typeof _0x1be997[_0xc576('0x18')]==='undefined'&&typeof _0x1be997[_0xc576('0x19')]===_0xc576('0x1a');var _0x33b210=_0x325dbc[_0xc576('0x1b')];var _0x181de3=_0xbff9b8?0x0:_0x1be997[_0xc576('0x18')];var _0x46bb7c=_0xbff9b8?_0x325dbc[_0xc576('0x1b')]:_0x1be997[_0xc576('0x18')]+_0x1be997[_0xc576('0x19')];var _0x5801e2;if(_0x46bb7c>=_0x33b210){_0x46bb7c=_0x33b210;_0x5801e2=0xc8;}else{_0x5801e2=0xce;}_0x5ddc89[_0xc576('0x15')](_0x5801e2);return _0x5ddc89['set'](_0xc576('0x1c'),_0x181de3+'-'+_0x46bb7c+'/'+_0x33b210)[_0xc576('0x17')](_0x325dbc);}return null;};}function patchUpdates(_0x2b9f1c){return function(_0x4d5b45){try{jsonpatch[_0xc576('0x1d')](_0x4d5b45,_0x2b9f1c,!![]);}catch(_0x336912){return BPromise[_0xc576('0x1e')](_0x336912);}return _0x4d5b45[_0xc576('0x1f')]();};}function saveUpdates(_0x1cff7b,_0x3b3552){return function(_0x3093d){if(_0x3093d){return _0x3093d[_0xc576('0x20')](_0x1cff7b)['then'](function(_0x48e829){return _0x48e829;});}return null;};}function removeEntity(_0x28a050,_0x333684){return function(_0x482a9c){if(_0x482a9c){return _0x482a9c[_0xc576('0x21')]()[_0xc576('0x22')](function(){_0x28a050[_0xc576('0x15')](0xcc)[_0xc576('0x16')]();});}};}function handleEntityNotFound(_0x4939a3,_0x43fcb7){return function(_0x5c2945){if(!_0x5c2945){_0x4939a3[_0xc576('0x23')](0x194);}return _0x5c2945;};}function handleError(_0x16447f,_0x3ef1ca){_0x3ef1ca=_0x3ef1ca||0x1f4;return function(_0xedcbff){logger['error'](_0xedcbff['stack']);if(_0xedcbff[_0xc576('0x24')]){delete _0xedcbff[_0xc576('0x24')];}_0x16447f[_0xc576('0x15')](_0x3ef1ca)[_0xc576('0x25')](_0xedcbff);};}exports['index']=function(_0x5af410,_0x5ba3df){var _0x4adb28={},_0x264158={},_0x2abb8b={'count':0x0,'rows':[]};var _0x3331ea=_[_0xc576('0x26')](db[_0xc576('0x27')][_0xc576('0x28')],function(_0x23902f){return{'name':_0x23902f['fieldName'],'type':_0x23902f[_0xc576('0x29')]['key']};});_0x264158[_0xc576('0x2a')]=_[_0xc576('0x26')](_0x3331ea,'name');_0x264158[_0xc576('0x2b')]=_[_0xc576('0x2c')](_0x5af410[_0xc576('0x2b')]);_0x264158[_0xc576('0x2d')]=_[_0xc576('0x2e')](_0x264158[_0xc576('0x2a')],_0x264158[_0xc576('0x2b')]);_0x4adb28['attributes']=_[_0xc576('0x2e')](_0x264158['model'],qs[_0xc576('0x2f')](_0x5af410[_0xc576('0x2b')][_0xc576('0x2f')]));_0x4adb28[_0xc576('0x30')]=_0x4adb28['attributes'][_0xc576('0x31')]?_0x4adb28[_0xc576('0x30')]:_0x264158[_0xc576('0x2a')];if(!_0x5af410[_0xc576('0x2b')][_0xc576('0x32')](_0xc576('0x33'))){_0x4adb28[_0xc576('0x19')]=qs['limit'](_0x5af410['query'][_0xc576('0x19')]);_0x4adb28['offset']=qs['offset'](_0x5af410['query'][_0xc576('0x18')]);}_0x4adb28[_0xc576('0x34')]=qs[_0xc576('0x35')](_0x5af410[_0xc576('0x2b')][_0xc576('0x35')]);_0x4adb28[_0xc576('0x36')]=qs['filters'](_[_0xc576('0x37')](_0x5af410['query'],_0x264158[_0xc576('0x2d')]),_0x3331ea);if(_0x5af410['query'][_0xc576('0x38')]){_0x4adb28[_0xc576('0x36')]=_[_0xc576('0x39')](_0x4adb28['where'],{'$or':_['map'](_0x3331ea,function(_0x31368e){if(_0x31368e[_0xc576('0x29')]!==_0xc576('0x3a')){var _0x8c8ba6={};_0x8c8ba6[_0x31368e[_0xc576('0x24')]]={'$like':'%'+_0x5af410['query'][_0xc576('0x38')]+'%'};return _0x8c8ba6;}})});}_0x4adb28=_[_0xc576('0x39')]({},_0x4adb28,_0x5af410['options']);var _0x5a4842={'where':_0x4adb28[_0xc576('0x36')]};return db[_0xc576('0x27')][_0xc576('0x1b')](_0x5a4842)[_0xc576('0x22')](function(_0x23eca1){_0x2abb8b['count']=_0x23eca1;if(_0x5af410[_0xc576('0x2b')][_0xc576('0x3b')]){_0x4adb28[_0xc576('0x3c')]=[{'all':!![]}];}return db[_0xc576('0x27')]['findAll'](_0x4adb28);})[_0xc576('0x22')](function(_0x1aac5e){_0x2abb8b[_0xc576('0x3d')]=_0x1aac5e;return _0x2abb8b;})[_0xc576('0x22')](respondWithFilteredResult(_0x5ba3df,_0x4adb28))['catch'](handleError(_0x5ba3df,null));};exports[_0xc576('0x3e')]=function(_0x30db48,_0x249c3b){var _0x264ad1={'raw':!![],'where':{'id':_0x30db48[_0xc576('0x3f')]['id']}},_0x1c3f80={};_0x1c3f80[_0xc576('0x2a')]=_[_0xc576('0x2c')](db[_0xc576('0x27')]['rawAttributes']);_0x1c3f80[_0xc576('0x2b')]=_[_0xc576('0x2c')](_0x30db48[_0xc576('0x2b')]);_0x1c3f80['filters']=_[_0xc576('0x2e')](_0x1c3f80[_0xc576('0x2a')],_0x1c3f80[_0xc576('0x2b')]);_0x264ad1['attributes']=_[_0xc576('0x2e')](_0x1c3f80[_0xc576('0x2a')],qs[_0xc576('0x2f')](_0x30db48[_0xc576('0x2b')][_0xc576('0x2f')]));_0x264ad1[_0xc576('0x30')]=_0x264ad1[_0xc576('0x30')][_0xc576('0x31')]?_0x264ad1['attributes']:_0x1c3f80[_0xc576('0x2a')];if(_0x30db48[_0xc576('0x2b')][_0xc576('0x3b')]){_0x264ad1[_0xc576('0x3c')]=[{'all':!![]}];}_0x264ad1=_[_0xc576('0x39')]({},_0x264ad1,_0x30db48['options']);return db[_0xc576('0x27')][_0xc576('0x40')](_0x264ad1)[_0xc576('0x22')](handleEntityNotFound(_0x249c3b,null))[_0xc576('0x22')](respondWithResult(_0x249c3b,null))['catch'](handleError(_0x249c3b,null));};exports[_0xc576('0x41')]=function(_0x52199e,_0xfa5e5d){return db[_0xc576('0x27')][_0xc576('0x41')](_0x52199e[_0xc576('0x42')],{})[_0xc576('0x22')](respondWithResult(_0xfa5e5d,0xc9))[_0xc576('0x43')](handleError(_0xfa5e5d,null));};exports[_0xc576('0x20')]=function(_0x5e54cb,_0x43cb00){if(_0x5e54cb[_0xc576('0x42')]['id']){delete _0x5e54cb[_0xc576('0x42')]['id'];}return db[_0xc576('0x27')][_0xc576('0x40')]({'where':{'id':_0x5e54cb[_0xc576('0x3f')]['id']}})[_0xc576('0x22')](handleEntityNotFound(_0x43cb00,null))[_0xc576('0x22')](saveUpdates(_0x5e54cb[_0xc576('0x42')],null))['then'](respondWithResult(_0x43cb00,null))[_0xc576('0x43')](handleError(_0x43cb00,null));};exports[_0xc576('0x21')]=function(_0x2b7464,_0x537223){return db[_0xc576('0x27')][_0xc576('0x40')]({'where':{'id':_0x2b7464[_0xc576('0x3f')]['id']}})[_0xc576('0x22')](handleEntityNotFound(_0x537223,null))['then'](removeEntity(_0x537223,null))['catch'](handleError(_0x537223,null));};exports[_0xc576('0x44')]=function(_0x30b4f0,_0x386b8e){return db['SquareDetailsReport'][_0xc576('0x44')]()[_0xc576('0x22')](respondWithResult(_0x386b8e,null))[_0xc576('0x43')](handleError(_0x386b8e,null));}; \ No newline at end of file +var _0x9465=['index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send'];(function(_0x4f2654,_0xddb1ad){var _0x3858b6=function(_0x2ff80e){while(--_0x2ff80e){_0x4f2654['push'](_0x4f2654['shift']());}};_0x3858b6(++_0xddb1ad);}(_0x9465,0xbc));var _0x5946=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x9465[_0x2002b3];return _0x2756f0;};'use strict';var emlformat=require(_0x5946('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5946('0x1'));var rp=require(_0x5946('0x2'));var moment=require(_0x5946('0x3'));var BPromise=require(_0x5946('0x4'));var Mustache=require(_0x5946('0x5'));var util=require('util');var path=require(_0x5946('0x6'));var sox=require(_0x5946('0x7'));var csv=require(_0x5946('0x8'));var ejs=require(_0x5946('0x9'));var fs=require('fs');var fs_extra=require(_0x5946('0xa'));var _=require(_0x5946('0xb'));var squel=require(_0x5946('0xc'));var crypto=require(_0x5946('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5946('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5946('0xf'));var Papa=require(_0x5946('0x10'));var Redis=require('ioredis');var authService=require(_0x5946('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5946('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5946('0x13'));var db=require(_0x5946('0x14'))['db'];function respondWithStatusCode(_0x45ef04,_0x18b131){_0x18b131=_0x18b131||0xcc;return function(_0x50acb1){if(_0x50acb1){return _0x45ef04[_0x5946('0x15')](_0x18b131);}return _0x45ef04[_0x5946('0x16')](_0x18b131)['end']();};}function respondWithResult(_0x432a4a,_0x15d59d){_0x15d59d=_0x15d59d||0xc8;return function(_0x424bab){if(_0x424bab){return _0x432a4a[_0x5946('0x16')](_0x15d59d)[_0x5946('0x17')](_0x424bab);}};}function respondWithFilteredResult(_0xc719f6,_0x47f6c7){return function(_0x58cbdc){if(_0x58cbdc){var _0xaf795c=typeof _0x47f6c7['offset']===_0x5946('0x18')&&typeof _0x47f6c7[_0x5946('0x19')]===_0x5946('0x18');var _0x3d75a5=_0x58cbdc[_0x5946('0x1a')];var _0x2f4a68=_0xaf795c?0x0:_0x47f6c7[_0x5946('0x1b')];var _0x864805=_0xaf795c?_0x58cbdc[_0x5946('0x1a')]:_0x47f6c7['offset']+_0x47f6c7[_0x5946('0x19')];var _0xe65bc4;if(_0x864805>=_0x3d75a5){_0x864805=_0x3d75a5;_0xe65bc4=0xc8;}else{_0xe65bc4=0xce;}_0xc719f6['status'](_0xe65bc4);return _0xc719f6[_0x5946('0x1c')](_0x5946('0x1d'),_0x2f4a68+'-'+_0x864805+'/'+_0x3d75a5)[_0x5946('0x17')](_0x58cbdc);}return null;};}function patchUpdates(_0x2ba013){return function(_0x58d496){try{jsonpatch[_0x5946('0x1e')](_0x58d496,_0x2ba013,!![]);}catch(_0x47a1d9){return BPromise[_0x5946('0x1f')](_0x47a1d9);}return _0x58d496[_0x5946('0x20')]();};}function saveUpdates(_0x4cba19,_0xdbbc69){return function(_0x3f1bc4){if(_0x3f1bc4){return _0x3f1bc4[_0x5946('0x21')](_0x4cba19)[_0x5946('0x22')](function(_0x3daa53){return _0x3daa53;});}return null;};}function removeEntity(_0x5ee992,_0xf11a78){return function(_0x35ef7f){if(_0x35ef7f){return _0x35ef7f[_0x5946('0x23')]()[_0x5946('0x22')](function(){_0x5ee992[_0x5946('0x16')](0xcc)[_0x5946('0x24')]();});}};}function handleEntityNotFound(_0x511aa5,_0x5b6936){return function(_0x2ddf6d){if(!_0x2ddf6d){_0x511aa5[_0x5946('0x15')](0x194);}return _0x2ddf6d;};}function handleError(_0x15f3b8,_0x5b5a49){_0x5b5a49=_0x5b5a49||0x1f4;return function(_0x4db637){logger[_0x5946('0x25')](_0x4db637['stack']);if(_0x4db637[_0x5946('0x26')]){delete _0x4db637[_0x5946('0x26')];}_0x15f3b8['status'](_0x5b5a49)[_0x5946('0x27')](_0x4db637);};}exports[_0x5946('0x28')]=function(_0x57c17e,_0x3faf35){var _0x24d5e3={},_0x1b870c={},_0xd46da7={'count':0x0,'rows':[]};var _0x3c06cc=_[_0x5946('0x29')](db[_0x5946('0x2a')][_0x5946('0x2b')],function(_0x1ea745){return{'name':_0x1ea745[_0x5946('0x2c')],'type':_0x1ea745[_0x5946('0x2d')][_0x5946('0x2e')]};});_0x1b870c['model']=_[_0x5946('0x29')](_0x3c06cc,'name');_0x1b870c[_0x5946('0x2f')]=_[_0x5946('0x30')](_0x57c17e[_0x5946('0x2f')]);_0x1b870c['filters']=_[_0x5946('0x31')](_0x1b870c[_0x5946('0x32')],_0x1b870c['query']);_0x24d5e3[_0x5946('0x33')]=_['intersection'](_0x1b870c[_0x5946('0x32')],qs['fields'](_0x57c17e[_0x5946('0x2f')][_0x5946('0x34')]));_0x24d5e3[_0x5946('0x33')]=_0x24d5e3[_0x5946('0x33')][_0x5946('0x35')]?_0x24d5e3['attributes']:_0x1b870c[_0x5946('0x32')];if(!_0x57c17e[_0x5946('0x2f')][_0x5946('0x36')](_0x5946('0x37'))){_0x24d5e3[_0x5946('0x19')]=qs['limit'](_0x57c17e[_0x5946('0x2f')][_0x5946('0x19')]);_0x24d5e3[_0x5946('0x1b')]=qs[_0x5946('0x1b')](_0x57c17e[_0x5946('0x2f')][_0x5946('0x1b')]);}_0x24d5e3[_0x5946('0x38')]=qs[_0x5946('0x39')](_0x57c17e[_0x5946('0x2f')][_0x5946('0x39')]);_0x24d5e3[_0x5946('0x3a')]=qs['filters'](_[_0x5946('0x3b')](_0x57c17e[_0x5946('0x2f')],_0x1b870c[_0x5946('0x3c')]),_0x3c06cc);if(_0x57c17e['query'][_0x5946('0x3d')]){_0x24d5e3[_0x5946('0x3a')]=_[_0x5946('0x3e')](_0x24d5e3[_0x5946('0x3a')],{'$or':_[_0x5946('0x29')](_0x3c06cc,function(_0x247e2a){if(_0x247e2a[_0x5946('0x2d')]!==_0x5946('0x3f')){var _0x399303={};_0x399303[_0x247e2a['name']]={'$like':'%'+_0x57c17e[_0x5946('0x2f')]['filter']+'%'};return _0x399303;}})});}_0x24d5e3=_[_0x5946('0x3e')]({},_0x24d5e3,_0x57c17e['options']);var _0x2b0999={'where':_0x24d5e3['where']};return db[_0x5946('0x2a')][_0x5946('0x1a')](_0x2b0999)['then'](function(_0x5ec92f){_0xd46da7[_0x5946('0x1a')]=_0x5ec92f;if(_0x57c17e[_0x5946('0x2f')][_0x5946('0x40')]){_0x24d5e3[_0x5946('0x41')]=[{'all':!![]}];}return db[_0x5946('0x2a')][_0x5946('0x42')](_0x24d5e3);})[_0x5946('0x22')](function(_0x24f8d7){_0xd46da7[_0x5946('0x43')]=_0x24f8d7;return _0xd46da7;})[_0x5946('0x22')](respondWithFilteredResult(_0x3faf35,_0x24d5e3))[_0x5946('0x44')](handleError(_0x3faf35,null));};exports[_0x5946('0x45')]=function(_0x428e76,_0x5a1416){var _0x22e260={'raw':!![],'where':{'id':_0x428e76['params']['id']}},_0x784b3b={};_0x784b3b[_0x5946('0x32')]=_[_0x5946('0x30')](db[_0x5946('0x2a')][_0x5946('0x2b')]);_0x784b3b[_0x5946('0x2f')]=_[_0x5946('0x30')](_0x428e76[_0x5946('0x2f')]);_0x784b3b[_0x5946('0x3c')]=_[_0x5946('0x31')](_0x784b3b[_0x5946('0x32')],_0x784b3b[_0x5946('0x2f')]);_0x22e260[_0x5946('0x33')]=_[_0x5946('0x31')](_0x784b3b[_0x5946('0x32')],qs[_0x5946('0x34')](_0x428e76[_0x5946('0x2f')][_0x5946('0x34')]));_0x22e260[_0x5946('0x33')]=_0x22e260[_0x5946('0x33')][_0x5946('0x35')]?_0x22e260['attributes']:_0x784b3b[_0x5946('0x32')];if(_0x428e76[_0x5946('0x2f')][_0x5946('0x40')]){_0x22e260[_0x5946('0x41')]=[{'all':!![]}];}_0x22e260=_['merge']({},_0x22e260,_0x428e76[_0x5946('0x46')]);return db['SquareDetailsReport'][_0x5946('0x47')](_0x22e260)[_0x5946('0x22')](handleEntityNotFound(_0x5a1416,null))[_0x5946('0x22')](respondWithResult(_0x5a1416,null))[_0x5946('0x44')](handleError(_0x5a1416,null));};exports[_0x5946('0x48')]=function(_0x1bcf22,_0x273d94){return db[_0x5946('0x2a')]['create'](_0x1bcf22[_0x5946('0x49')],{})['then'](respondWithResult(_0x273d94,0xc9))[_0x5946('0x44')](handleError(_0x273d94,null));};exports['update']=function(_0x5a3fd8,_0xa5f67c){if(_0x5a3fd8['body']['id']){delete _0x5a3fd8[_0x5946('0x49')]['id'];}return db[_0x5946('0x2a')][_0x5946('0x47')]({'where':{'id':_0x5a3fd8['params']['id']}})['then'](handleEntityNotFound(_0xa5f67c,null))[_0x5946('0x22')](saveUpdates(_0x5a3fd8[_0x5946('0x49')],null))[_0x5946('0x22')](respondWithResult(_0xa5f67c,null))['catch'](handleError(_0xa5f67c,null));};exports[_0x5946('0x23')]=function(_0x4f8aa3,_0x3be7d6){return db[_0x5946('0x2a')]['find']({'where':{'id':_0x4f8aa3[_0x5946('0x4a')]['id']}})[_0x5946('0x22')](handleEntityNotFound(_0x3be7d6,null))[_0x5946('0x22')](removeEntity(_0x3be7d6,null))[_0x5946('0x44')](handleError(_0x3be7d6,null));};exports[_0x5946('0x4b')]=function(_0x207307,_0x3f66ed){return db[_0x5946('0x2a')][_0x5946('0x4b')]()[_0x5946('0x22')](respondWithResult(_0x3f66ed,null))[_0x5946('0x44')](handleError(_0x3f66ed,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index d22162f..6d7040f 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 _0xbcf8=['request-promise','path','../../config/environment','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird'];(function(_0xcaca45,_0x2c494a){var _0x643bd9=function(_0xc45812){while(--_0xc45812){_0xcaca45['push'](_0xcaca45['shift']());}};_0x643bd9(++_0x2c494a);}(_0xbcf8,0x16f));var _0x8bcf=function(_0x2c36cf,_0x24ff18){_0x2c36cf=_0x2c36cf-0x0;var _0x35036a=_0xbcf8[_0x2c36cf];return _0x35036a;};'use strict';var _=require(_0x8bcf('0x0'));var util=require(_0x8bcf('0x1'));var logger=require(_0x8bcf('0x2'))(_0x8bcf('0x3'));var moment=require('moment');var BPromise=require(_0x8bcf('0x4'));var rp=require(_0x8bcf('0x5'));var fs=require('fs');var path=require(_0x8bcf('0x6'));var rimraf=require('rimraf');var config=require(_0x8bcf('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x8bcf('0x8')]=function(_0x2f2498,_0x5f260e){return _0x2f2498[_0x8bcf('0x9')](_0x8bcf('0xa'),attributes,{'tableName':_0x8bcf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7233=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7233,0x18c));var _0x3723=function(_0x37d95e,_0x20dacf){_0x37d95e=_0x37d95e-0x0;var _0x5dbacd=_0x7233[_0x37d95e];return _0x5dbacd;};'use strict';var _=require('lodash');var util=require(_0x3723('0x0'));var logger=require(_0x3723('0x1'))(_0x3723('0x2'));var moment=require('moment');var BPromise=require(_0x3723('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3723('0x4'));var rimraf=require(_0x3723('0x5'));var config=require(_0x3723('0x6'));var attributes=require(_0x3723('0x7'));module[_0x3723('0x8')]=function(_0x9d10c5,_0x2aa24b){return _0x9d10c5[_0x3723('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x3723('0xa'),'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 cd2aa2a..e50768c 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 _0x253d=['create','options','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','result','SquareDetailsReport,\x20%s,\x20%s','CreateSquareDetailsReport'];(function(_0x98db33,_0x397f20){var _0x5ae63a=function(_0x411f1c){while(--_0x411f1c){_0x98db33['push'](_0x98db33['shift']());}};_0x5ae63a(++_0x397f20);}(_0x253d,0x1b3));var _0xd253=function(_0x2f3bc4,_0x5a44d7){_0x2f3bc4=_0x2f3bc4-0x0;var _0x5d4973=_0x253d[_0x2f3bc4];return _0x5d4973;};'use strict';var _=require(_0xd253('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd253('0x1'));var db=require(_0xd253('0x2'))['db'];var utils=require(_0xd253('0x3'));var logger=require(_0xd253('0x4'))(_0xd253('0x5'));var config=require('../../config/environment');var jayson=require(_0xd253('0x6'));var client=jayson[_0xd253('0x7')][_0xd253('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17589a,_0xf4b457,_0x487f4e){return new BPromise(function(_0x2c4de4,_0x712c81){return client[_0xd253('0x9')](_0x17589a,_0x487f4e)[_0xd253('0xa')](function(_0x351047){logger[_0xd253('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0xf4b457,'request\x20sent');logger[_0xd253('0xc')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'),JSON[_0xd253('0xe')](_0x351047));if(_0x351047[_0xd253('0xf')]){if(_0x351047[_0xd253('0xf')][_0xd253('0x10')]===0x1f4){logger[_0xd253('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0xf4b457,_0x351047['error'][_0xd253('0x11')]);return _0x712c81(_0x351047[_0xd253('0xf')][_0xd253('0x11')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xf4b457,_0x351047[_0xd253('0xf')][_0xd253('0x11')]);return _0x2c4de4(_0x351047[_0xd253('0xf')]['message']);}else{logger[_0xd253('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0xf4b457,_0xd253('0xd'));_0x2c4de4(_0x351047[_0xd253('0x12')][_0xd253('0x11')]);}})['catch'](function(_0x1b7ed1){logger['error'](_0xd253('0x13'),_0xf4b457,_0x1b7ed1);_0x712c81(_0x1b7ed1);});});}exports[_0xd253('0x14')]=function(_0x5e4051){var _0x2496cb=this;return new Promise(function(_0x2a2adc,_0x5b24ff){return db['SquareDetailsReport'][_0xd253('0x15')](_0x5e4051['body'],{'raw':_0x5e4051['options']?_0x5e4051[_0xd253('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd253('0xa')](function(_0x1e48c3){logger[_0xd253('0xb')](_0xd253('0x14'),_0x5e4051);logger['debug'](_0xd253('0x14'),_0x5e4051,JSON['stringify'](_0x1e48c3));_0x2a2adc(_0x1e48c3);})[_0xd253('0x17')](function(_0x50f8b5){logger[_0xd253('0xf')](_0xd253('0x14'),_0x50f8b5[_0xd253('0x11')],_0x5e4051);_0x5b24ff(_0x2496cb[_0xd253('0xf')](0x1f4,_0x50f8b5['message']));});});}; \ No newline at end of file +var _0xe493=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','create','options','raw','lodash','util','moment','bluebird'];(function(_0x50a6e6,_0x54fcc3){var _0x28ae3d=function(_0x9cad6e){while(--_0x9cad6e){_0x50a6e6['push'](_0x50a6e6['shift']());}};_0x28ae3d(++_0x54fcc3);}(_0xe493,0x7e));var _0x3e49=function(_0x3afaa6,_0x20bae5){_0x3afaa6=_0x3afaa6-0x0;var _0x532cef=_0xe493[_0x3afaa6];return _0x532cef;};'use strict';var _=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var moment=require(_0x3e49('0x2'));var BPromise=require(_0x3e49('0x3'));var rs=require(_0x3e49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e49('0x5'))['db'];var utils=require(_0x3e49('0x6'));var logger=require('../../config/logger')(_0x3e49('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e49('0x8'));var client=jayson[_0x3e49('0x9')][_0x3e49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7821,_0x12dd84,_0x3626b6){return new BPromise(function(_0x4e96ac,_0x56b767){return client['request'](_0x3f7821,_0x3626b6)[_0x3e49('0xb')](function(_0x8b8c0e){logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));logger[_0x3e49('0xf')](_0x3e49('0x10'),_0x12dd84,_0x3e49('0xe'),JSON[_0x3e49('0x11')](_0x8b8c0e));if(_0x8b8c0e[_0x3e49('0x12')]){if(_0x8b8c0e[_0x3e49('0x12')]['code']===0x1f4){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x56b767(_0x8b8c0e[_0x3e49('0x12')]['message']);}logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x4e96ac(_0x8b8c0e[_0x3e49('0x12')][_0x3e49('0x13')]);}else{logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));_0x4e96ac(_0x8b8c0e[_0x3e49('0x14')][_0x3e49('0x13')]);}})[_0x3e49('0x15')](function(_0x1d9cce){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x1d9cce);_0x56b767(_0x1d9cce);});});}exports[_0x3e49('0x16')]=function(_0x3ae5f4){var _0x448c36=this;return new Promise(function(_0x4e1cdf,_0xf33205){return db['SquareDetailsReport'][_0x3e49('0x17')](_0x3ae5f4['body'],{'raw':_0x3ae5f4[_0x3e49('0x18')]?_0x3ae5f4['options'][_0x3e49('0x19')]===undefined?!![]:![]:!![]})[_0x3e49('0xb')](function(_0x420d7b){logger['info'](_0x3e49('0x16'),_0x3ae5f4);logger['debug'](_0x3e49('0x16'),_0x3ae5f4,JSON[_0x3e49('0x11')](_0x420d7b));_0x4e1cdf(_0x420d7b);})[_0x3e49('0x15')](function(_0x5e0f1d){logger['error'](_0x3e49('0x16'),_0x5e0f1d['message'],_0x3ae5f4);_0xf33205(_0x448c36[_0x3e49('0x12')](0x1f4,_0x5e0f1d[_0x3e49('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 9cf6ee5..08bda8b 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 _0x18ca=['isAuthenticated','get','/process/:pid/kill','killProcess','express','Router','./system.controller'];(function(_0x5bca99,_0x10ac41){var _0xd827c0=function(_0x3721d6){while(--_0x3721d6){_0x5bca99['push'](_0x5bca99['shift']());}};_0xd827c0(++_0x10ac41);}(_0x18ca,0x12a));var _0xa18c=function(_0x3573a3,_0x32afe7){_0x3573a3=_0x3573a3-0x0;var _0x27b54e=_0x18ca[_0x3573a3];return _0x27b54e;};'use strict';var express=require(_0xa18c('0x0'));var router=express[_0xa18c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa18c('0x2'));router['get']('/',auth[_0xa18c('0x3')](),controller['index']);router[_0xa18c('0x4')](_0xa18c('0x5'),auth[_0xa18c('0x3')](),controller[_0xa18c('0x6')]);module['exports']=router; \ No newline at end of file +var _0xd81b=['/process/:pid/kill','exports','express','Router','../../components/auth/service','isAuthenticated','index','get'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0xd81b,0x152));var _0xbd81=function(_0x43bf05,_0xec3c37){_0x43bf05=_0x43bf05-0x0;var _0x514dde=_0xd81b[_0x43bf05];return _0x514dde;};'use strict';var express=require(_0xbd81('0x0'));var router=express[_0xbd81('0x1')]();var auth=require(_0xbd81('0x2'));var controller=require('./system.controller');router['get']('/',auth[_0xbd81('0x3')](),controller[_0xbd81('0x4')]);router[_0xbd81('0x5')](_0xbd81('0x6'),auth[_0xbd81('0x3')](),controller['killProcess']);module[_0xbd81('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f963873..b87949b 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 _0xe185=['pid','SIGINT','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params'];(function(_0x888385,_0x9cdc66){var _0x22d5c2=function(_0x3b1599){while(--_0x3b1599){_0x888385['push'](_0x888385['shift']());}};_0x22d5c2(++_0x9cdc66);}(_0xe185,0x120));var _0x5e18=function(_0x5c8768,_0xae6f49){_0x5c8768=_0x5c8768-0x0;var _0x3a17af=_0xe185[_0x5c8768];return _0x3a17af;};'use strict';var info=require(_0x5e18('0x0'));var exec=require(_0x5e18('0x1'))[_0x5e18('0x2')];var logger=require(_0x5e18('0x3'))(_0x5e18('0x4'));var util=require('util');var BPromise=require(_0x5e18('0x5'));var _=require(_0x5e18('0x6'));function handleError(_0x272d86,_0x1fdff9,_0x288ab2){_0x1fdff9=_0x1fdff9||0x1f4;return function(_0x1deb26){logger[_0x5e18('0x7')](_0x5e18('0x8'),_0x288ab2,_0x1fdff9,util[_0x5e18('0x9')](_0x1deb26,{'showHidden':![],'depth':null}));delete _0x1deb26['name'];_0x272d86[_0x5e18('0xa')](_0x1fdff9)[_0x5e18('0xb')](_0x1deb26);};}exports[_0x5e18('0xc')]=function(_0x32600c,_0x96ed7){return info[_0x5e18('0xd')]()[_0x5e18('0xe')](function(_0x2fb442){return _0x96ed7[_0x5e18('0xa')](0xc8)[_0x5e18('0xf')](_0x2fb442);})['catch'](function(_0x56fa66){return _0x96ed7['status'](0x1f4)[_0x5e18('0xf')](_0x56fa66);});};exports[_0x5e18('0x10')]=function(_0x1cfd67,_0x34b58d){var _0x3ce066=['components/import/cm'];return new BPromise(function(_0x134eb6,_0x1004cf){return exec(util[_0x5e18('0x11')](_0x5e18('0x12'),_0x1cfd67['params']['pid']),function(_0x53c6a8,_0x37c199,_0x5bbc90){if(_0x53c6a8){return _0x1004cf(_0x53c6a8);}return _0x134eb6(_0x37c199);});})[_0x5e18('0xe')](function(_0x296bb8){var _0x30844f=![];var _0x39b7ee=_0x296bb8[_0x5e18('0x13')](/\n/);for(var _0x258608=0x0,_0x47237a=_0x3ce066[_0x5e18('0x14')];_0x258608<_0x47237a,_0x30844f===![];_0x258608+=0x1){if(_0x296bb8[_0x5e18('0x15')](_0x3ce066[_0x258608])>=0x0){_0x30844f=!![];}}if(!_0x30844f){throw new Error(util[_0x5e18('0x11')](_0x5e18('0x16'),_0x1cfd67['params']['pid']));}process['kill'](_0x1cfd67[_0x5e18('0x17')][_0x5e18('0x18')],_0x5e18('0x19'));return _0x34b58d[_0x5e18('0xa')](0xc8)['json']({'message':util[_0x5e18('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1cfd67[_0x5e18('0x17')]['pid'])});})['catch'](handleError(_0x34b58d,null,_0x5e18('0x10')));}; \ No newline at end of file +var _0xdc59=['indexOf','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid'];(function(_0x24fda4,_0x299583){var _0x56b85b=function(_0x3cea84){while(--_0x3cea84){_0x24fda4['push'](_0x24fda4['shift']());}};_0x56b85b(++_0x299583);}(_0xdc59,0x19c));var _0x9dc5=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdc59[_0x8c43de];return _0xa6591b;};'use strict';var info=require(_0x9dc5('0x0'));var exec=require(_0x9dc5('0x1'))[_0x9dc5('0x2')];var logger=require(_0x9dc5('0x3'))(_0x9dc5('0x4'));var util=require(_0x9dc5('0x5'));var BPromise=require(_0x9dc5('0x6'));var _=require(_0x9dc5('0x7'));function handleError(_0x64f751,_0x1e276f,_0x10b7fb){_0x1e276f=_0x1e276f||0x1f4;return function(_0x51d2da){logger[_0x9dc5('0x8')](_0x9dc5('0x9'),_0x10b7fb,_0x1e276f,util[_0x9dc5('0xa')](_0x51d2da,{'showHidden':![],'depth':null}));delete _0x51d2da[_0x9dc5('0xb')];_0x64f751[_0x9dc5('0xc')](_0x1e276f)[_0x9dc5('0xd')](_0x51d2da);};}exports[_0x9dc5('0xe')]=function(_0x597497,_0x22d0a4){return info[_0x9dc5('0xf')]()[_0x9dc5('0x10')](function(_0x196e45){return _0x22d0a4[_0x9dc5('0xc')](0xc8)[_0x9dc5('0x11')](_0x196e45);})[_0x9dc5('0x12')](function(_0x56af6a){return _0x22d0a4['status'](0x1f4)['json'](_0x56af6a);});};exports['killProcess']=function(_0x42d8f0,_0x149e52){var _0x5c806b=[_0x9dc5('0x13')];return new BPromise(function(_0x43c351,_0x25bcea){return exec(util[_0x9dc5('0x14')](_0x9dc5('0x15'),_0x42d8f0['params'][_0x9dc5('0x16')]),function(_0x253aaa,_0x5f11a9,_0x9786fe){if(_0x253aaa){return _0x25bcea(_0x253aaa);}return _0x43c351(_0x5f11a9);});})[_0x9dc5('0x10')](function(_0x5dbe7b){var _0x1f6892=![];var _0x52d328=_0x5dbe7b['split'](/\n/);for(var _0x1ea302=0x0,_0x154742=_0x5c806b['length'];_0x1ea302<_0x154742,_0x1f6892===![];_0x1ea302+=0x1){if(_0x5dbe7b[_0x9dc5('0x17')](_0x5c806b[_0x1ea302])>=0x0){_0x1f6892=!![];}}if(!_0x1f6892){throw new Error(util[_0x9dc5('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x42d8f0[_0x9dc5('0x18')][_0x9dc5('0x16')]));}process[_0x9dc5('0x19')](_0x42d8f0['params']['pid'],_0x9dc5('0x1a'));return _0x149e52[_0x9dc5('0xc')](0xc8)['json']({'message':util[_0x9dc5('0x14')](_0x9dc5('0x1b'),_0x42d8f0[_0x9dc5('0x18')][_0x9dc5('0x16')])});})[_0x9dc5('0x12')](handleError(_0x149e52,null,_0x9dc5('0x1c')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5c3c13b..4d3cdec 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 _0x6eb2=['multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports'];(function(_0x315753,_0x1ff1c8){var _0x6f58fa=function(_0x5f2d10){while(--_0x5f2d10){_0x315753['push'](_0x315753['shift']());}};_0x6f58fa(++_0x1ff1c8);}(_0x6eb2,0x10a));var _0x26eb=function(_0xc67594,_0x25a6f3){_0xc67594=_0xc67594-0x0;var _0x2f9020=_0x6eb2[_0xc67594];return _0x2f9020;};'use strict';var multer=require(_0x26eb('0x0'));var util=require('util');var path=require(_0x26eb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x26eb('0x2')]();var fs_extra=require(_0x26eb('0x3'));var auth=require(_0x26eb('0x4'));var interaction=require(_0x26eb('0x5'));var config=require(_0x26eb('0x6'));var controller=require(_0x26eb('0x7'));router[_0x26eb('0x8')]('/',auth['isAuthenticated'](),controller[_0x26eb('0x9')]);router[_0x26eb('0x8')](_0x26eb('0xa'),auth[_0x26eb('0xb')](),controller['show']);router[_0x26eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x26eb('0xd')]);router[_0x26eb('0xe')]('/:id',auth[_0x26eb('0xb')](),controller[_0x26eb('0xf')]);router[_0x26eb('0x10')]('/:id',auth[_0x26eb('0xb')](),controller[_0x26eb('0x11')]);module[_0x26eb('0x12')]=router; \ No newline at end of file +var _0xb098=['post','create','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xb098,0x1c4));var _0x8b09=function(_0x54d739,_0xd35798){_0x54d739=_0x54d739-0x0;var _0x44ecf4=_0xb098[_0x54d739];return _0x44ecf4;};'use strict';var multer=require(_0x8b09('0x0'));var util=require(_0x8b09('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8b09('0x2'));var router=express[_0x8b09('0x3')]();var fs_extra=require(_0x8b09('0x4'));var auth=require(_0x8b09('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b09('0x6'));var controller=require('./tag.controller');router[_0x8b09('0x7')]('/',auth[_0x8b09('0x8')](),controller[_0x8b09('0x9')]);router[_0x8b09('0x7')](_0x8b09('0xa'),auth[_0x8b09('0x8')](),controller[_0x8b09('0xb')]);router[_0x8b09('0xc')]('/',auth[_0x8b09('0x8')](),controller[_0x8b09('0xd')]);router['put'](_0x8b09('0xa'),auth[_0x8b09('0x8')](),controller['update']);router[_0x8b09('0xe')](_0x8b09('0xa'),auth[_0x8b09('0x8')](),controller['destroy']);module[_0x8b09('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 553bef5..e2c20ea 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 _0xb67f=['#0091EA','exports','STRING','name'];(function(_0x2e3df4,_0x56767f){var _0x4659f0=function(_0x58d829){while(--_0x58d829){_0x2e3df4['push'](_0x2e3df4['shift']());}};_0x4659f0(++_0x56767f);}(_0xb67f,0x12d));var _0xfb67=function(_0x41fc7b,_0x4e840c){_0x41fc7b=_0x41fc7b-0x0;var _0x1d1b0f=_0xb67f[_0x41fc7b];return _0x1d1b0f;};'use strict';var Sequelize=require('sequelize');module[_0xfb67('0x0')]={'name':{'type':Sequelize[_0xfb67('0x1')],'unique':_0xfb67('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xfb67('0x1')],'defaultValue':_0xfb67('0x3')},'description':{'type':Sequelize[_0xfb67('0x1')]}}; \ No newline at end of file +var _0x73a1=['name','#0091EA','STRING'];(function(_0x41c79b,_0x465ebd){var _0x36402d=function(_0x340d91){while(--_0x340d91){_0x41c79b['push'](_0x41c79b['shift']());}};_0x36402d(++_0x465ebd);}(_0x73a1,0x161));var _0x173a=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x73a1[_0x1147ab];return _0x55cb5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x173a('0x0')],'unique':_0x173a('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x173a('0x2')},'description':{'type':Sequelize[_0x173a('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 2b00e4f..c82758f 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 _0x4c4e=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Tags','destroy','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','Tag','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x4c4e,0x152));var _0xe4c4=function(_0x393aac,_0x16432a){_0x393aac=_0x393aac-0x0;var _0x30489a=_0x4c4e[_0x393aac];return _0x30489a;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){var _0x4dc8cc=_0x59498e[_0xe4c4('0x27')]({'plain':!![]});var _0x5374fd=_0xe4c4('0x28');return db['UserProfileResource'][_0xe4c4('0x29')]({'where':{'type':_0x5374fd,'resourceId':_0x4dc8cc['id']}})['then'](function(){return _0x59498e;});})[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cea1f,_0x5d66ab){return function(_0x3221cd){if(!_0x3221cd){_0x4cea1f['sendStatus'](0x194);}return _0x3221cd;};}function handleError(_0x5b5ea5,_0xe2c1b4){_0xe2c1b4=_0xe2c1b4||0x1f4;return function(_0x11deab){logger['error'](_0x11deab['stack']);if(_0x11deab[_0xe4c4('0x2a')]){delete _0x11deab[_0xe4c4('0x2a')];}_0x5b5ea5['status'](_0xe2c1b4)[_0xe4c4('0x2b')](_0x11deab);};}exports[_0xe4c4('0x2c')]=function(_0x3f60fc,_0x48060e){var _0x5d49fd={},_0x46db7e={},_0x2c5652={'count':0x0,'rows':[]};var _0x12bde8=_[_0xe4c4('0x2d')](db['Tag']['rawAttributes'],function(_0x1731c8){return{'name':_0x1731c8[_0xe4c4('0x2e')],'type':_0x1731c8['type'][_0xe4c4('0x2f')]};});_0x46db7e[_0xe4c4('0x30')]=_[_0xe4c4('0x2d')](_0x12bde8,'name');_0x46db7e[_0xe4c4('0x31')]=_['keys'](_0x3f60fc[_0xe4c4('0x31')]);_0x46db7e[_0xe4c4('0x32')]=_[_0xe4c4('0x33')](_0x46db7e[_0xe4c4('0x30')],_0x46db7e[_0xe4c4('0x31')]);_0x5d49fd[_0xe4c4('0x34')]=_[_0xe4c4('0x33')](_0x46db7e[_0xe4c4('0x30')],qs[_0xe4c4('0x35')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x35')]));_0x5d49fd[_0xe4c4('0x34')]=_0x5d49fd['attributes'][_0xe4c4('0x36')]?_0x5d49fd[_0xe4c4('0x34')]:_0x46db7e[_0xe4c4('0x30')];if(!_0x3f60fc['query'][_0xe4c4('0x37')](_0xe4c4('0x38'))){_0x5d49fd[_0xe4c4('0x1f')]=qs['limit'](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x1f')]);_0x5d49fd[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x1d')]);}_0x5d49fd[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x3a')]);_0x5d49fd['where']=qs[_0xe4c4('0x32')](_[_0xe4c4('0x3b')](_0x3f60fc[_0xe4c4('0x31')],_0x46db7e[_0xe4c4('0x32')]),_0x12bde8);if(_0x3f60fc['query'][_0xe4c4('0x3c')]){_0x5d49fd[_0xe4c4('0x3d')]=_['merge'](_0x5d49fd[_0xe4c4('0x3d')],{'$or':_[_0xe4c4('0x2d')](_0x12bde8,function(_0x4db15d){if(_0x4db15d[_0xe4c4('0x3e')]!==_0xe4c4('0x3f')){var _0x127bcd={};_0x127bcd[_0x4db15d[_0xe4c4('0x2a')]]={'$like':'%'+_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x3c')]+'%'};return _0x127bcd;}})});}_0x5d49fd=_[_0xe4c4('0x40')]({},_0x5d49fd,_0x3f60fc[_0xe4c4('0x41')]);var _0x1e457c={'where':_0x5d49fd[_0xe4c4('0x3d')]};return db[_0xe4c4('0x42')][_0xe4c4('0x20')](_0x1e457c)['then'](function(_0x3773dd){_0x2c5652[_0xe4c4('0x20')]=_0x3773dd;if(_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x43')]){_0x5d49fd[_0xe4c4('0x44')]=[{'all':!![]}];}return db[_0xe4c4('0x42')]['findAll'](_0x5d49fd);})[_0xe4c4('0x26')](function(_0x526bef){_0x2c5652[_0xe4c4('0x45')]=_0x526bef;return _0x2c5652;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x48060e,_0x5d49fd))[_0xe4c4('0x46')](handleError(_0x48060e,null));};exports[_0xe4c4('0x47')]=function(_0x48177f,_0x566eb7){var _0x55b527={'raw':!![],'where':{'id':_0x48177f[_0xe4c4('0x48')]['id']}},_0x23a668={};_0x23a668[_0xe4c4('0x30')]=_['keys'](db[_0xe4c4('0x42')][_0xe4c4('0x49')]);_0x23a668[_0xe4c4('0x31')]=_[_0xe4c4('0x4a')](_0x48177f['query']);_0x23a668[_0xe4c4('0x32')]=_[_0xe4c4('0x33')](_0x23a668[_0xe4c4('0x30')],_0x23a668[_0xe4c4('0x31')]);_0x55b527[_0xe4c4('0x34')]=_[_0xe4c4('0x33')](_0x23a668[_0xe4c4('0x30')],qs[_0xe4c4('0x35')](_0x48177f[_0xe4c4('0x31')]['fields']));_0x55b527[_0xe4c4('0x34')]=_0x55b527['attributes'][_0xe4c4('0x36')]?_0x55b527[_0xe4c4('0x34')]:_0x23a668[_0xe4c4('0x30')];if(_0x48177f[_0xe4c4('0x31')][_0xe4c4('0x43')]){_0x55b527[_0xe4c4('0x44')]=[{'all':!![]}];}_0x55b527=_[_0xe4c4('0x40')]({},_0x55b527,_0x48177f[_0xe4c4('0x41')]);return db[_0xe4c4('0x42')][_0xe4c4('0x4b')](_0x55b527)[_0xe4c4('0x26')](handleEntityNotFound(_0x566eb7,null))[_0xe4c4('0x26')](respondWithResult(_0x566eb7,null))[_0xe4c4('0x46')](handleError(_0x566eb7,null));};exports[_0xe4c4('0x4c')]=function(_0x535bcc,_0x4922f5){return db[_0xe4c4('0x42')][_0xe4c4('0x4c')](_0x535bcc['body'],{})[_0xe4c4('0x26')](function(_0x2853da){var _0x1211f9=_0x535bcc[_0xe4c4('0x4d')][_0xe4c4('0x27')]({'plain':!![]});if(!_0x1211f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1211f9[_0xe4c4('0x4e')]===_0xe4c4('0x4d')){var _0x4f6e03=_0x2853da[_0xe4c4('0x27')]({'plain':!![]});var _0x24b0e7='Tags';return db[_0xe4c4('0x4f')]['find']({'where':{'name':_0x24b0e7,'userProfileId':_0x1211f9[_0xe4c4('0x50')]},'raw':!![]})[_0xe4c4('0x26')](function(_0x2a54ef){if(_0x2a54ef&&_0x2a54ef[_0xe4c4('0x51')]===0x0){return db[_0xe4c4('0x52')]['create']({'name':_0x4f6e03[_0xe4c4('0x2a')],'resourceId':_0x4f6e03['id'],'type':_0x2a54ef[_0xe4c4('0x2a')],'sectionId':_0x2a54ef['id']},{})[_0xe4c4('0x26')](function(){return _0x2853da;});}else{return _0x2853da;}})[_0xe4c4('0x46')](function(_0x3c9fc4){logger[_0xe4c4('0x53')](_0xe4c4('0x54'),_0x3c9fc4);throw _0x3c9fc4;});}return _0x2853da;})[_0xe4c4('0x26')](respondWithResult(_0x4922f5,0xc9))[_0xe4c4('0x46')](handleError(_0x4922f5,null));};exports[_0xe4c4('0x25')]=function(_0x1fe354,_0x1940e3){if(_0x1fe354[_0xe4c4('0x55')]['id']){delete _0x1fe354[_0xe4c4('0x55')]['id'];}return db[_0xe4c4('0x42')][_0xe4c4('0x4b')]({'where':{'id':_0x1fe354['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x1940e3,null))[_0xe4c4('0x26')](saveUpdates(_0x1fe354[_0xe4c4('0x55')],null))['then'](respondWithResult(_0x1940e3,null))[_0xe4c4('0x46')](handleError(_0x1940e3,null));};exports[_0xe4c4('0x29')]=function(_0x35f750,_0x512ca9){return db[_0xe4c4('0x42')]['find']({'where':{'id':_0x35f750[_0xe4c4('0x48')]['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x512ca9,null))[_0xe4c4('0x26')](removeEntity(_0x512ca9,null))['catch'](handleError(_0x512ca9,null));}; \ No newline at end of file +var _0x6c76=['to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply','reject','save','then','destroy','get','Tags','UserProfileResource','error','name','send','index','map','Tag','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','request-promise','moment','util','path'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0x6c76,0x184));var _0x66c7=function(_0x5415cd,_0x7d0518){_0x5415cd=_0x5415cd-0x0;var _0x308bac=_0x6c76[_0x5415cd];return _0x308bac;};'use strict';var emlformat=require(_0x66c7('0x0'));var rimraf=require(_0x66c7('0x1'));var zipdir=require(_0x66c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66c7('0x3'));var moment=require(_0x66c7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x66c7('0x5'));var path=require(_0x66c7('0x6'));var sox=require('sox');var csv=require(_0x66c7('0x7'));var ejs=require(_0x66c7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c7('0xa'));var deskjs=require(_0x66c7('0xb'));var toCsv=require(_0x66c7('0x7'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var Redis=require(_0x66c7('0xd'));var authService=require(_0x66c7('0xe'));var qs=require(_0x66c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c7('0x10'));var logger=require(_0x66c7('0x11'))(_0x66c7('0x12'));var utils=require(_0x66c7('0x13'));var config=require(_0x66c7('0x14'));var licenseUtil=require(_0x66c7('0x15'));var db=require(_0x66c7('0x16'))['db'];function respondWithStatusCode(_0x5176a3,_0x18c309){_0x18c309=_0x18c309||0xcc;return function(_0x760e36){if(_0x760e36){return _0x5176a3[_0x66c7('0x17')](_0x18c309);}return _0x5176a3[_0x66c7('0x18')](_0x18c309)[_0x66c7('0x19')]();};}function respondWithResult(_0x1e91d1,_0x618bd7){_0x618bd7=_0x618bd7||0xc8;return function(_0xf3b04){if(_0xf3b04){return _0x1e91d1[_0x66c7('0x18')](_0x618bd7)['json'](_0xf3b04);}};}function respondWithFilteredResult(_0x110f6d,_0x4dd902){return function(_0x208010){if(_0x208010){var _0x39f951=typeof _0x4dd902[_0x66c7('0x1a')]===_0x66c7('0x1b')&&typeof _0x4dd902[_0x66c7('0x1c')]==='undefined';var _0x5cf913=_0x208010['count'];var _0x5129f6=_0x39f951?0x0:_0x4dd902[_0x66c7('0x1a')];var _0x19f29d=_0x39f951?_0x208010['count']:_0x4dd902['offset']+_0x4dd902[_0x66c7('0x1c')];var _0x9b65cf;if(_0x19f29d>=_0x5cf913){_0x19f29d=_0x5cf913;_0x9b65cf=0xc8;}else{_0x9b65cf=0xce;}_0x110f6d[_0x66c7('0x18')](_0x9b65cf);return _0x110f6d[_0x66c7('0x1d')]('Content-Range',_0x5129f6+'-'+_0x19f29d+'/'+_0x5cf913)['json'](_0x208010);}return null;};}function patchUpdates(_0x1853b2){return function(_0x237177){try{jsonpatch[_0x66c7('0x1e')](_0x237177,_0x1853b2,!![]);}catch(_0x1c43c4){return BPromise[_0x66c7('0x1f')](_0x1c43c4);}return _0x237177[_0x66c7('0x20')]();};}function saveUpdates(_0x4804cf,_0x4ddbd2){return function(_0x366e9b){if(_0x366e9b){return _0x366e9b['update'](_0x4804cf)[_0x66c7('0x21')](function(_0x8b96b1){return _0x8b96b1;});}return null;};}function removeEntity(_0x44bdef,_0x1fc9d3){return function(_0x5bfaf6){if(_0x5bfaf6){return _0x5bfaf6[_0x66c7('0x22')]()[_0x66c7('0x21')](function(){var _0x5b28e6=_0x5bfaf6[_0x66c7('0x23')]({'plain':!![]});var _0x11a6b9=_0x66c7('0x24');return db[_0x66c7('0x25')][_0x66c7('0x22')]({'where':{'type':_0x11a6b9,'resourceId':_0x5b28e6['id']}})['then'](function(){return _0x5bfaf6;});})['then'](function(){_0x44bdef['status'](0xcc)[_0x66c7('0x19')]();});}};}function handleEntityNotFound(_0x542ff1,_0x5c5e42){return function(_0x9afd50){if(!_0x9afd50){_0x542ff1[_0x66c7('0x17')](0x194);}return _0x9afd50;};}function handleError(_0x205b7e,_0xb4b65b){_0xb4b65b=_0xb4b65b||0x1f4;return function(_0x36a830){logger[_0x66c7('0x26')](_0x36a830['stack']);if(_0x36a830[_0x66c7('0x27')]){delete _0x36a830[_0x66c7('0x27')];}_0x205b7e[_0x66c7('0x18')](_0xb4b65b)[_0x66c7('0x28')](_0x36a830);};}exports[_0x66c7('0x29')]=function(_0x592f0e,_0x263b48){var _0x4f1a34={},_0xfbd97={},_0x543fbf={'count':0x0,'rows':[]};var _0x296875=_[_0x66c7('0x2a')](db[_0x66c7('0x2b')][_0x66c7('0x2c')],function(_0xb26028){return{'name':_0xb26028[_0x66c7('0x2d')],'type':_0xb26028['type']['key']};});_0xfbd97[_0x66c7('0x2e')]=_[_0x66c7('0x2a')](_0x296875,_0x66c7('0x27'));_0xfbd97[_0x66c7('0x2f')]=_[_0x66c7('0x30')](_0x592f0e[_0x66c7('0x2f')]);_0xfbd97[_0x66c7('0x31')]=_[_0x66c7('0x32')](_0xfbd97[_0x66c7('0x2e')],_0xfbd97[_0x66c7('0x2f')]);_0x4f1a34[_0x66c7('0x33')]=_[_0x66c7('0x32')](_0xfbd97['model'],qs['fields'](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x34')]));_0x4f1a34[_0x66c7('0x33')]=_0x4f1a34[_0x66c7('0x33')][_0x66c7('0x35')]?_0x4f1a34[_0x66c7('0x33')]:_0xfbd97[_0x66c7('0x2e')];if(!_0x592f0e['query'][_0x66c7('0x36')](_0x66c7('0x37'))){_0x4f1a34[_0x66c7('0x1c')]=qs[_0x66c7('0x1c')](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x1c')]);_0x4f1a34[_0x66c7('0x1a')]=qs[_0x66c7('0x1a')](_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x1a')]);}_0x4f1a34[_0x66c7('0x38')]=qs['sort'](_0x592f0e['query'][_0x66c7('0x39')]);_0x4f1a34[_0x66c7('0x3a')]=qs[_0x66c7('0x31')](_['pick'](_0x592f0e['query'],_0xfbd97[_0x66c7('0x31')]),_0x296875);if(_0x592f0e[_0x66c7('0x2f')]['filter']){_0x4f1a34[_0x66c7('0x3a')]=_[_0x66c7('0x3b')](_0x4f1a34[_0x66c7('0x3a')],{'$or':_['map'](_0x296875,function(_0x20374a){if(_0x20374a[_0x66c7('0x3c')]!==_0x66c7('0x3d')){var _0x14d59c={};_0x14d59c[_0x20374a[_0x66c7('0x27')]]={'$like':'%'+_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x3e')]+'%'};return _0x14d59c;}})});}_0x4f1a34=_[_0x66c7('0x3b')]({},_0x4f1a34,_0x592f0e[_0x66c7('0x3f')]);var _0x5f34ed={'where':_0x4f1a34[_0x66c7('0x3a')]};return db[_0x66c7('0x2b')][_0x66c7('0x40')](_0x5f34ed)[_0x66c7('0x21')](function(_0x3f169e){_0x543fbf[_0x66c7('0x40')]=_0x3f169e;if(_0x592f0e[_0x66c7('0x2f')][_0x66c7('0x41')]){_0x4f1a34[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x2b')]['findAll'](_0x4f1a34);})['then'](function(_0x528f5c){_0x543fbf[_0x66c7('0x43')]=_0x528f5c;return _0x543fbf;})[_0x66c7('0x21')](respondWithFilteredResult(_0x263b48,_0x4f1a34))['catch'](handleError(_0x263b48,null));};exports['show']=function(_0x34d002,_0x3cd3ab){var _0x44d637={'raw':!![],'where':{'id':_0x34d002[_0x66c7('0x44')]['id']}},_0x900ee7={};_0x900ee7['model']=_[_0x66c7('0x30')](db['Tag']['rawAttributes']);_0x900ee7[_0x66c7('0x2f')]=_[_0x66c7('0x30')](_0x34d002[_0x66c7('0x2f')]);_0x900ee7[_0x66c7('0x31')]=_['intersection'](_0x900ee7['model'],_0x900ee7[_0x66c7('0x2f')]);_0x44d637['attributes']=_['intersection'](_0x900ee7[_0x66c7('0x2e')],qs[_0x66c7('0x34')](_0x34d002[_0x66c7('0x2f')][_0x66c7('0x34')]));_0x44d637['attributes']=_0x44d637[_0x66c7('0x33')][_0x66c7('0x35')]?_0x44d637[_0x66c7('0x33')]:_0x900ee7['model'];if(_0x34d002[_0x66c7('0x2f')][_0x66c7('0x41')]){_0x44d637[_0x66c7('0x42')]=[{'all':!![]}];}_0x44d637=_[_0x66c7('0x3b')]({},_0x44d637,_0x34d002[_0x66c7('0x3f')]);return db[_0x66c7('0x2b')][_0x66c7('0x45')](_0x44d637)[_0x66c7('0x21')](handleEntityNotFound(_0x3cd3ab,null))['then'](respondWithResult(_0x3cd3ab,null))[_0x66c7('0x46')](handleError(_0x3cd3ab,null));};exports[_0x66c7('0x47')]=function(_0x23d0eb,_0x1386a2){return db[_0x66c7('0x2b')][_0x66c7('0x47')](_0x23d0eb[_0x66c7('0x48')],{})[_0x66c7('0x21')](function(_0x1b3dc2){var _0x2d8eeb=_0x23d0eb[_0x66c7('0x49')][_0x66c7('0x23')]({'plain':!![]});if(!_0x2d8eeb)throw new Error(_0x66c7('0x4a'));if(_0x2d8eeb[_0x66c7('0x4b')]==='user'){var _0x43d4db=_0x1b3dc2[_0x66c7('0x23')]({'plain':!![]});var _0x27070b=_0x66c7('0x24');return db['UserProfileSection'][_0x66c7('0x45')]({'where':{'name':_0x27070b,'userProfileId':_0x2d8eeb[_0x66c7('0x4c')]},'raw':!![]})['then'](function(_0x275a20){if(_0x275a20&&_0x275a20[_0x66c7('0x4d')]===0x0){return db[_0x66c7('0x25')][_0x66c7('0x47')]({'name':_0x43d4db[_0x66c7('0x27')],'resourceId':_0x43d4db['id'],'type':_0x275a20[_0x66c7('0x27')],'sectionId':_0x275a20['id']},{})[_0x66c7('0x21')](function(){return _0x1b3dc2;});}else{return _0x1b3dc2;}})['catch'](function(_0x933dd6){logger[_0x66c7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x933dd6);throw _0x933dd6;});}return _0x1b3dc2;})[_0x66c7('0x21')](respondWithResult(_0x1386a2,0xc9))[_0x66c7('0x46')](handleError(_0x1386a2,null));};exports[_0x66c7('0x4e')]=function(_0x5df6d1,_0x382a48){if(_0x5df6d1[_0x66c7('0x48')]['id']){delete _0x5df6d1[_0x66c7('0x48')]['id'];}return db[_0x66c7('0x2b')][_0x66c7('0x45')]({'where':{'id':_0x5df6d1[_0x66c7('0x44')]['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x382a48,null))[_0x66c7('0x21')](saveUpdates(_0x5df6d1['body'],null))[_0x66c7('0x21')](respondWithResult(_0x382a48,null))[_0x66c7('0x46')](handleError(_0x382a48,null));};exports['destroy']=function(_0x23f865,_0x167968){return db[_0x66c7('0x2b')]['find']({'where':{'id':_0x23f865['params']['id']}})[_0x66c7('0x21')](handleEntityNotFound(_0x167968,null))['then'](removeEntity(_0x167968,null))[_0x66c7('0x46')](handleError(_0x167968,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index cc8e7d5..02cb20e 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 _0xd609=['path','rimraf','../../config/environment','exports','define','tools_tags','../../config/logger','bluebird','request-promise'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xd609,0x10b));var _0x9d60=function(_0x49ac41,_0x5f33da){_0x49ac41=_0x49ac41-0x0;var _0x5dd908=_0xd609[_0x49ac41];return _0x5dd908;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d60('0x0'))('api');var moment=require('moment');var BPromise=require(_0x9d60('0x1'));var rp=require(_0x9d60('0x2'));var fs=require('fs');var path=require(_0x9d60('0x3'));var rimraf=require(_0x9d60('0x4'));var config=require(_0x9d60('0x5'));var attributes=require('./tag.attributes');module[_0x9d60('0x6')]=function(_0x43cabe,_0x43e863){return _0x43cabe[_0x9d60('0x7')]('Tag',attributes,{'tableName':_0x9d60('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a91=['define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports'];(function(_0x5b35d9,_0x2e3e2d){var _0x263f91=function(_0x54eefb){while(--_0x54eefb){_0x5b35d9['push'](_0x5b35d9['shift']());}};_0x263f91(++_0x2e3e2d);}(_0x9a91,0x153));var _0x19a9=function(_0x56b4f6,_0x3124e1){_0x56b4f6=_0x56b4f6-0x0;var _0x3c230f=_0x9a91[_0x56b4f6];return _0x3c230f;};'use strict';var _=require(_0x19a9('0x0'));var util=require(_0x19a9('0x1'));var logger=require(_0x19a9('0x2'))(_0x19a9('0x3'));var moment=require(_0x19a9('0x4'));var BPromise=require(_0x19a9('0x5'));var rp=require(_0x19a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19a9('0x7'));var config=require(_0x19a9('0x8'));var attributes=require(_0x19a9('0x9'));module[_0x19a9('0xa')]=function(_0x56ee26,_0x4c7821){return _0x56ee26[_0x19a9('0xb')](_0x19a9('0xc'),attributes,{'tableName':_0x19a9('0xd'),'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 717a6b8..eb85c99 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 _0x8d9b=['rpc','../../config/environment','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var moment=require(_0xb8d9('0x2'));var BPromise=require(_0xb8d9('0x3'));var rs=require(_0xb8d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8d9('0x5'));var logger=require('../../config/logger')(_0xb8d9('0x6'));var config=require(_0xb8d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21c87d,_0x537b18,_0x53339b){return new BPromise(function(_0x4c2b8f,_0x13352e){return client[_0xb8d9('0x8')](_0x21c87d,_0x53339b)[_0xb8d9('0x9')](function(_0x2189b1){logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));logger['debug'](_0xb8d9('0xd'),_0x537b18,'request\x20sent',JSON[_0xb8d9('0xe')](_0x2189b1));if(_0x2189b1[_0xb8d9('0xf')]){if(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x10')]===0x1f4){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x13352e(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);}logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x4c2b8f(_0x2189b1['error'][_0xb8d9('0x11')]);}else{logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));_0x4c2b8f(_0x2189b1[_0xb8d9('0x12')]['message']);}})['catch'](function(_0x5b7d5a){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x5b7d5a);_0x13352e(_0x5b7d5a);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x31f9a5,_0x21f66c){var _0x2e5293=function(_0x236efc){while(--_0x236efc){_0x31f9a5['push'](_0x31f9a5['shift']());}};_0x2e5293(++_0x21f66c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x00bb[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e8fbb34..f9fa1bb 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);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 abf79ec..9e6eb63 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 _0xb10b=['name','sequelize','STRING'];(function(_0x36b045,_0x1bab41){var _0x2c6230=function(_0x5eff9a){while(--_0x5eff9a){_0x36b045['push'](_0x36b045['shift']());}};_0x2c6230(++_0x1bab41);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ef71d,_0x453e87){_0x1ef71d=_0x1ef71d-0x0;var _0x5bd739=_0xb10b[_0x1ef71d];return _0x5bd739;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 08ee8e7..73510b0 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 _0xd3a7=['VoicePrefixId','getQueues','channel','ValidationError','Unknown\x20channel','capitalize','Queue','pick','Queues','addQueues','findOne','isValidChannel','add','toLowerCase','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','format','voicePause','all','Sms','Fax','removeAgents','emit','getAgents','hasOwnProperty','nolimit','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','TeamVoicePrefix','UserVoicePrefix'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0xd3a7,0xcb));var _0x7d3a=function(_0x424e26,_0x788ec0){_0x424e26=_0x424e26-0x0;var _0x157b03=_0xd3a7[_0x424e26];return _0x157b03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d3a('0x0'));var zipdir=require(_0x7d3a('0x1'));var jsonpatch=require(_0x7d3a('0x2'));var rp=require('request-promise');var moment=require(_0x7d3a('0x3'));var BPromise=require(_0x7d3a('0x4'));var Mustache=require(_0x7d3a('0x5'));var util=require('util');var path=require(_0x7d3a('0x6'));var sox=require(_0x7d3a('0x7'));var csv=require(_0x7d3a('0x8'));var ejs=require(_0x7d3a('0x9'));var fs=require('fs');var fs_extra=require(_0x7d3a('0xa'));var _=require('lodash');var squel=require(_0x7d3a('0xb'));var crypto=require('crypto');var jsforce=require(_0x7d3a('0xc'));var deskjs=require(_0x7d3a('0xd'));var toCsv=require(_0x7d3a('0x8'));var querystring=require(_0x7d3a('0xe'));var Papa=require(_0x7d3a('0xf'));var Redis=require(_0x7d3a('0x10'));var authService=require(_0x7d3a('0x11'));var qs=require(_0x7d3a('0x12'));var as=require(_0x7d3a('0x13'));var hardwareService=require(_0x7d3a('0x14'));var logger=require(_0x7d3a('0x15'))(_0x7d3a('0x16'));var utils=require(_0x7d3a('0x17'));var config=require(_0x7d3a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d3a('0x19'))['db'];config[_0x7d3a('0x1a')]=_[_0x7d3a('0x1b')](config[_0x7d3a('0x1a')],{'host':_0x7d3a('0x1c'),'port':0x18eb});var socket=require(_0x7d3a('0x1d'))(new Redis(config[_0x7d3a('0x1a')]));require(_0x7d3a('0x1e'))[_0x7d3a('0x1f')](socket);function respondWithStatusCode(_0x3c8d63,_0x1bdfb0){_0x1bdfb0=_0x1bdfb0||0xcc;return function(_0x31b36d){if(_0x31b36d){return _0x3c8d63[_0x7d3a('0x20')](_0x1bdfb0);}return _0x3c8d63[_0x7d3a('0x21')](_0x1bdfb0)[_0x7d3a('0x22')]();};}function respondWithResult(_0x11682f,_0x130a68){_0x130a68=_0x130a68||0xc8;return function(_0x1d0f9b){if(_0x1d0f9b){return _0x11682f[_0x7d3a('0x21')](_0x130a68)[_0x7d3a('0x23')](_0x1d0f9b);}};}function respondWithFilteredResult(_0x2b7e22,_0x4ca8c9){return function(_0x463cf7){if(_0x463cf7){var _0x423081=typeof _0x4ca8c9[_0x7d3a('0x24')]==='undefined'&&typeof _0x4ca8c9['limit']===_0x7d3a('0x25');var _0x490b05=_0x463cf7['count'];var _0x26b8b7=_0x423081?0x0:_0x4ca8c9['offset'];var _0x2245f7=_0x423081?_0x463cf7[_0x7d3a('0x26')]:_0x4ca8c9[_0x7d3a('0x24')]+_0x4ca8c9[_0x7d3a('0x27')];var _0x24714;if(_0x2245f7>=_0x490b05){_0x2245f7=_0x490b05;_0x24714=0xc8;}else{_0x24714=0xce;}_0x2b7e22[_0x7d3a('0x21')](_0x24714);return _0x2b7e22[_0x7d3a('0x28')](_0x7d3a('0x29'),_0x26b8b7+'-'+_0x2245f7+'/'+_0x490b05)[_0x7d3a('0x23')](_0x463cf7);}return null;};}function patchUpdates(_0x46fd2b){return function(_0x268ab8){try{jsonpatch[_0x7d3a('0x2a')](_0x268ab8,_0x46fd2b,!![]);}catch(_0x4833e3){return BPromise[_0x7d3a('0x2b')](_0x4833e3);}return _0x268ab8[_0x7d3a('0x2c')]();};}function saveUpdates(_0x236a79,_0x522f71){return function(_0x1b49d2){if(_0x1b49d2){return _0x1b49d2[_0x7d3a('0x2d')](_0x236a79)[_0x7d3a('0x2e')](function(_0x19a918){return _0x19a918;});}return null;};}function handleEntityNotFound(_0x3adfac,_0xb1ed38){return function(_0x421da9){if(!_0x421da9){_0x3adfac[_0x7d3a('0x20')](0x194);}return _0x421da9;};}function handleError(_0x4a154f,_0x3cae62){_0x3cae62=_0x3cae62||0x1f4;return function(_0x52f5a2){logger[_0x7d3a('0x2f')](_0x52f5a2['stack']);if(_0x52f5a2[_0x7d3a('0x30')]){delete _0x52f5a2[_0x7d3a('0x30')];}_0x4a154f['status'](_0x3cae62)[_0x7d3a('0x31')](_0x52f5a2);};}exports[_0x7d3a('0x32')]=function(_0x407869,_0x554d8c){var _0x412c5a={},_0x1b6aae={},_0x2a151f={'count':0x0,'rows':[]};var _0x54b489=_[_0x7d3a('0x33')](db[_0x7d3a('0x34')][_0x7d3a('0x35')],function(_0x1949e3){return{'name':_0x1949e3[_0x7d3a('0x36')],'type':_0x1949e3[_0x7d3a('0x37')][_0x7d3a('0x38')]};});_0x1b6aae[_0x7d3a('0x39')]=_[_0x7d3a('0x33')](_0x54b489,_0x7d3a('0x30'));_0x1b6aae['query']=_[_0x7d3a('0x3a')](_0x407869[_0x7d3a('0x3b')]);_0x1b6aae[_0x7d3a('0x3c')]=_['intersection'](_0x1b6aae[_0x7d3a('0x39')],_0x1b6aae[_0x7d3a('0x3b')]);_0x412c5a['attributes']=_[_0x7d3a('0x3d')](_0x1b6aae['model'],qs[_0x7d3a('0x3e')](_0x407869[_0x7d3a('0x3b')][_0x7d3a('0x3e')]));_0x412c5a[_0x7d3a('0x3f')]=_0x412c5a['attributes'][_0x7d3a('0x40')]?_0x412c5a[_0x7d3a('0x3f')]:_0x1b6aae[_0x7d3a('0x39')];if(!_0x407869[_0x7d3a('0x3b')]['hasOwnProperty']('nolimit')){_0x412c5a['limit']=qs['limit'](_0x407869[_0x7d3a('0x3b')]['limit']);_0x412c5a['offset']=qs[_0x7d3a('0x24')](_0x407869['query'][_0x7d3a('0x24')]);}_0x412c5a[_0x7d3a('0x41')]=qs['sort'](_0x407869[_0x7d3a('0x3b')][_0x7d3a('0x42')]);_0x412c5a[_0x7d3a('0x43')]=qs['filters'](_['pick'](_0x407869['query'],_0x1b6aae[_0x7d3a('0x3c')]),_0x54b489);if(_0x407869['query'][_0x7d3a('0x44')]){_0x412c5a[_0x7d3a('0x43')]=_[_0x7d3a('0x45')](_0x412c5a[_0x7d3a('0x43')],{'$or':_[_0x7d3a('0x33')](_0x54b489,function(_0x372ac1){if(_0x372ac1['type']!==_0x7d3a('0x46')){var _0x11ea7f={};_0x11ea7f[_0x372ac1['name']]={'$like':'%'+_0x407869[_0x7d3a('0x3b')][_0x7d3a('0x44')]+'%'};return _0x11ea7f;}})});}_0x412c5a=_[_0x7d3a('0x45')]({},_0x412c5a,_0x407869[_0x7d3a('0x47')]);var _0x595b08={'where':_0x412c5a[_0x7d3a('0x43')]};return db[_0x7d3a('0x34')]['count'](_0x595b08)['then'](function(_0x369abd){_0x2a151f['count']=_0x369abd;if(_0x407869[_0x7d3a('0x3b')]['includeAll']){_0x412c5a[_0x7d3a('0x48')]=[{'all':!![]}];}return db[_0x7d3a('0x34')][_0x7d3a('0x49')](_0x412c5a);})[_0x7d3a('0x2e')](function(_0x464d89){_0x2a151f[_0x7d3a('0x4a')]=_0x464d89;return _0x2a151f;})[_0x7d3a('0x2e')](respondWithFilteredResult(_0x554d8c,_0x412c5a))[_0x7d3a('0x4b')](handleError(_0x554d8c,null));};exports[_0x7d3a('0x4c')]=function(_0x1838ea,_0x592ba7){var _0x15e313={'raw':![],'where':{'id':_0x1838ea[_0x7d3a('0x4d')]['id']}},_0xf61e7b={};_0xf61e7b[_0x7d3a('0x39')]=_[_0x7d3a('0x3a')](db['Team']['rawAttributes']);_0xf61e7b[_0x7d3a('0x3b')]=_[_0x7d3a('0x3a')](_0x1838ea['query']);_0xf61e7b['filters']=_[_0x7d3a('0x3d')](_0xf61e7b[_0x7d3a('0x39')],_0xf61e7b[_0x7d3a('0x3b')]);_0x15e313[_0x7d3a('0x3f')]=_[_0x7d3a('0x3d')](_0xf61e7b[_0x7d3a('0x39')],qs[_0x7d3a('0x3e')](_0x1838ea[_0x7d3a('0x3b')][_0x7d3a('0x3e')]));_0x15e313[_0x7d3a('0x3f')]=_0x15e313['attributes'][_0x7d3a('0x40')]?_0x15e313[_0x7d3a('0x3f')]:_0xf61e7b[_0x7d3a('0x39')];if(_0x1838ea[_0x7d3a('0x3b')][_0x7d3a('0x4e')]){_0x15e313[_0x7d3a('0x48')]=[{'all':!![]}];}_0x15e313=_[_0x7d3a('0x45')]({},_0x15e313,_0x1838ea[_0x7d3a('0x47')]);return db[_0x7d3a('0x34')][_0x7d3a('0x4f')](_0x15e313)[_0x7d3a('0x2e')](handleEntityNotFound(_0x592ba7,null))[_0x7d3a('0x2e')](respondWithResult(_0x592ba7,null))[_0x7d3a('0x4b')](handleError(_0x592ba7,null));};exports['create']=function(_0x24e7c5,_0xdf5167){return db[_0x7d3a('0x34')][_0x7d3a('0x50')](_0x24e7c5['body'],{})[_0x7d3a('0x2e')](function(_0x3f4c1e){var _0x2fb50b=_0x24e7c5[_0x7d3a('0x51')][_0x7d3a('0x52')]({'plain':!![]});if(!_0x2fb50b)throw new Error(_0x7d3a('0x53'));if(_0x2fb50b[_0x7d3a('0x54')]===_0x7d3a('0x51')){var _0x18b0ef=_0x3f4c1e[_0x7d3a('0x52')]({'plain':!![]});var _0x258c20=_0x7d3a('0x55');return db[_0x7d3a('0x56')][_0x7d3a('0x4f')]({'where':{'name':_0x258c20,'userProfileId':_0x2fb50b[_0x7d3a('0x57')]},'raw':!![]})[_0x7d3a('0x2e')](function(_0xec48ab){if(_0xec48ab&&_0xec48ab[_0x7d3a('0x58')]===0x0){return db[_0x7d3a('0x59')][_0x7d3a('0x50')]({'name':_0x18b0ef['name'],'resourceId':_0x18b0ef['id'],'type':_0xec48ab['name'],'sectionId':_0xec48ab['id']},{})['then'](function(){return _0x3f4c1e;});}else{return _0x3f4c1e;}})[_0x7d3a('0x4b')](function(_0x53b3ab){logger[_0x7d3a('0x2f')](_0x7d3a('0x5a'),_0x53b3ab);throw _0x53b3ab;});}return _0x3f4c1e;})[_0x7d3a('0x2e')](respondWithResult(_0xdf5167,0xc9))[_0x7d3a('0x4b')](handleError(_0xdf5167,null));};exports[_0x7d3a('0x2d')]=function(_0x294397,_0x52cdf9){if(_0x294397[_0x7d3a('0x5b')]['id']){delete _0x294397[_0x7d3a('0x5b')]['id'];}return db[_0x7d3a('0x34')][_0x7d3a('0x4f')]({'where':{'id':_0x294397[_0x7d3a('0x4d')]['id']}})[_0x7d3a('0x2e')](handleEntityNotFound(_0x52cdf9,null))[_0x7d3a('0x2e')](saveUpdates(_0x294397[_0x7d3a('0x5b')],null))['then'](respondWithResult(_0x52cdf9,null))[_0x7d3a('0x4b')](handleError(_0x52cdf9,null));};exports[_0x7d3a('0x5c')]=function(_0x1a9a06,_0x3617fa){var _0x5b65ec=_0x1a9a06['params']['id'];var _0x32e9cb=[];return db[_0x7d3a('0x5d')][_0x7d3a('0x5e')](function(_0x47bc9f){var _0x2b2559=_0x7d3a('0x5f')+_0x5b65ec;return db[_0x7d3a('0x5d')][_0x7d3a('0x3b')](_0x2b2559,{'type':db[_0x7d3a('0x60')][_0x7d3a('0x61')][_0x7d3a('0x62')],'raw':!![],'transaction':_0x47bc9f})['then'](function(_0x276c0d){_0x32e9cb=_[_0x7d3a('0x33')](_0x276c0d,function(_0x2f21b0){return Number(_0x2f21b0['UserId']);});})[_0x7d3a('0x2e')](function(){var _0x4cf837=_0x7d3a('0x63')+_0x5b65ec;return db[_0x7d3a('0x5d')][_0x7d3a('0x3b')](_0x4cf837,{'type':db[_0x7d3a('0x60')][_0x7d3a('0x61')]['SELECT'],'raw':!![],'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(_0x12e44f){var _0xe65555=_['map'](_0x12e44f,function(_0x58fd33){return Number(_0x58fd33[_0x7d3a('0x64')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x32e9cb},'VoiceQueueId':{'$in':_0xe65555}},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){var _0x5a4aca=_0x7d3a('0x65')+_0x5b65ec;return db[_0x7d3a('0x5d')][_0x7d3a('0x3b')](_0x5a4aca,{'type':db[_0x7d3a('0x60')][_0x7d3a('0x61')]['SELECT'],'raw':!![],'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(_0x38f0fa){var _0x5263f0=_[_0x7d3a('0x33')](_0x38f0fa,function(_0xa21a9a){return Number(_0xa21a9a['MailQueueId']);});return db['UserMailQueue'][_0x7d3a('0x5c')]({'where':{'UserId':{'$in':_0x32e9cb},'MailQueueId':{'$in':_0x5263f0}},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){var _0x93d5ba=_0x7d3a('0x66')+_0x5b65ec;return db[_0x7d3a('0x5d')][_0x7d3a('0x3b')](_0x93d5ba,{'type':db['Sequelize'][_0x7d3a('0x61')][_0x7d3a('0x62')],'raw':!![],'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(_0x5604a3){var _0x253ebc=_[_0x7d3a('0x33')](_0x5604a3,function(_0x50a539){return Number(_0x50a539[_0x7d3a('0x67')]);});return db[_0x7d3a('0x68')]['destroy']({'where':{'UserId':{'$in':_0x32e9cb},'SmsQueueId':{'$in':_0x253ebc}},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){var _0x5c8a9d=_0x7d3a('0x69')+_0x5b65ec;return db[_0x7d3a('0x5d')]['query'](_0x5c8a9d,{'type':db[_0x7d3a('0x60')][_0x7d3a('0x61')][_0x7d3a('0x62')],'raw':!![],'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(_0x549fd4){var _0x377d5a=_[_0x7d3a('0x33')](_0x549fd4,function(_0x34a659){return Number(_0x34a659['ChatQueueId']);});return db[_0x7d3a('0x6a')][_0x7d3a('0x5c')]({'where':{'UserId':{'$in':_0x32e9cb},'ChatQueueId':{'$in':_0x377d5a}},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){var _0x519d72='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5b65ec;return db[_0x7d3a('0x5d')][_0x7d3a('0x3b')](_0x519d72,{'type':db['Sequelize'][_0x7d3a('0x61')][_0x7d3a('0x62')],'raw':!![],'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(_0x3aef1d){var _0x5d2abc=_[_0x7d3a('0x33')](_0x3aef1d,function(_0x3fff9b){return Number(_0x3fff9b['FaxQueueId']);});return db[_0x7d3a('0x6b')][_0x7d3a('0x5c')]({'where':{'UserId':{'$in':_0x32e9cb},'FaxQueueId':{'$in':_0x5d2abc}},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){var _0x3c8dc5=_0x7d3a('0x6c')+_0x5b65ec;return db['sequelize'][_0x7d3a('0x3b')](_0x3c8dc5,{'type':db['Sequelize'][_0x7d3a('0x61')][_0x7d3a('0x62')],'raw':!![],'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(_0x28e09f){var _0x36271c=_[_0x7d3a('0x33')](_0x28e09f,function(_0x34adcb){return Number(_0x34adcb[_0x7d3a('0x6d')]);});return db[_0x7d3a('0x6e')][_0x7d3a('0x5c')]({'where':{'UserId':{'$in':_0x32e9cb},'OpenchannelQueueId':{'$in':_0x36271c}},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){var _0x463ae6='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5b65ec;return db[_0x7d3a('0x5d')]['query'](_0x463ae6,{'type':db[_0x7d3a('0x60')][_0x7d3a('0x61')][_0x7d3a('0x62')],'raw':!![],'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(_0x1e8903){var _0x3e6179=_['map'](_0x1e8903,function(_0x1ab670){return Number(_0x1ab670['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0x7d3a('0x5c')]({'where':{'UserId':{'$in':_0x32e9cb},'WhatsappQueueId':{'$in':_0x3e6179}},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){return db[_0x7d3a('0x6f')]['find']({'where':{'TeamId':_0x5b65ec}});})[_0x7d3a('0x2e')](function(_0x45a118){if(_0x45a118===null){return;}return db[_0x7d3a('0x70')]['destroy']({'where':{'UserId':{'$in':_0x32e9cb},'VoicePrefixId':_0x45a118[_0x7d3a('0x71')]},'transaction':_0x47bc9f});})[_0x7d3a('0x2e')](function(){return db[_0x7d3a('0x34')][_0x7d3a('0x5c')]({'where':{'id':_0x5b65ec},'cascade':!![],'transaction':_0x47bc9f});})['then'](function(_0x6547fc){if(_0x6547fc===0x0){_0x3617fa['sendStatus'](0x194);}else{return db[_0x7d3a('0x59')][_0x7d3a('0x5c')]({'where':{'type':_0x7d3a('0x55'),'resourceId':_0x5b65ec},'cascade':!![],'transaction':_0x47bc9f})[_0x7d3a('0x2e')](function(){_0x3617fa[_0x7d3a('0x21')](0xcc)[_0x7d3a('0x22')]();});}})[_0x7d3a('0x4b')](function(_0x288353){_0x3617fa[_0x7d3a('0x21')](0x1f4)['send'](_0x288353);});});};exports[_0x7d3a('0x72')]=function(_0x545943,_0x341270,_0x5b0a6c){return db['Team']['findOne']({'where':{'id':_0x545943['params']['id']}})[_0x7d3a('0x2e')](handleEntityNotFound(_0x341270,null))['then'](function(_0x142fc9){if(!_0x545943['query'][_0x7d3a('0x73')]||!utils['isValidChannel'](_0x545943[_0x7d3a('0x3b')][_0x7d3a('0x73')])){throw new db[(_0x7d3a('0x60'))][(_0x7d3a('0x74'))](_0x7d3a('0x75'));}var _0x44be7e={};var _0x1bf8ba={};_0x1bf8ba['model']=_[_0x7d3a('0x3a')](db[_[_0x7d3a('0x76')](_0x545943[_0x7d3a('0x3b')][_0x7d3a('0x73')]['toLowerCase']())+_0x7d3a('0x77')][_0x7d3a('0x35')]);_0x1bf8ba[_0x7d3a('0x3b')]=_[_0x7d3a('0x3a')](_0x545943[_0x7d3a('0x3b')]);_0x1bf8ba[_0x7d3a('0x3c')]=_[_0x7d3a('0x3d')](_0x1bf8ba[_0x7d3a('0x39')],_0x1bf8ba[_0x7d3a('0x3b')]);_0x44be7e[_0x7d3a('0x3f')]=_[_0x7d3a('0x3d')](_0x1bf8ba['model'],qs[_0x7d3a('0x3e')](_0x545943[_0x7d3a('0x3b')][_0x7d3a('0x3e')]));_0x44be7e[_0x7d3a('0x3f')]=_0x44be7e[_0x7d3a('0x3f')]['length']?_0x44be7e[_0x7d3a('0x3f')]:_0x1bf8ba['model'];_0x44be7e['limit']=qs[_0x7d3a('0x27')](_0x545943[_0x7d3a('0x3b')][_0x7d3a('0x27')]);_0x44be7e[_0x7d3a('0x24')]=qs[_0x7d3a('0x24')](_0x545943[_0x7d3a('0x3b')][_0x7d3a('0x24')]);_0x44be7e['order']=qs[_0x7d3a('0x42')](_0x545943[_0x7d3a('0x3b')][_0x7d3a('0x42')]);_0x44be7e[_0x7d3a('0x43')]=qs['filters'](_[_0x7d3a('0x78')](_0x545943[_0x7d3a('0x3b')],_0x1bf8ba[_0x7d3a('0x3c')]));_0x44be7e=_[_0x7d3a('0x45')]({},_0x44be7e,_0x545943[_0x7d3a('0x47')]);return _0x142fc9[_0x7d3a('0x52')+_[_0x7d3a('0x76')](_0x545943[_0x7d3a('0x3b')][_0x7d3a('0x73')]['toLowerCase']())+_0x7d3a('0x79')](_0x44be7e);})['then'](respondWithResult(_0x341270,null))[_0x7d3a('0x4b')](handleError(_0x341270,null));};exports[_0x7d3a('0x7a')]=function(_0x15d7d1,_0x3712d3,_0x50280a){return db[_0x7d3a('0x34')][_0x7d3a('0x7b')]({'where':{'id':_0x15d7d1[_0x7d3a('0x4d')]['id']}})[_0x7d3a('0x2e')](function(_0x29b0b8){if(_0x29b0b8){if(!_0x15d7d1[_0x7d3a('0x5b')][_0x7d3a('0x73')]||!utils[_0x7d3a('0x7c')](_0x15d7d1[_0x7d3a('0x5b')][_0x7d3a('0x73')])){throw new db[(_0x7d3a('0x60'))][(_0x7d3a('0x74'))](_0x7d3a('0x75'));}return _0x29b0b8[_0x7d3a('0x7d')+_['capitalize'](_0x15d7d1[_0x7d3a('0x5b')][_0x7d3a('0x73')][_0x7d3a('0x7e')]())+_0x7d3a('0x79')](_0x15d7d1[_0x7d3a('0x5b')][_0x7d3a('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x3712d3,null))[_0x7d3a('0x2e')](respondWithStatusCode(_0x3712d3,null))[_0x7d3a('0x4b')](handleError(_0x3712d3,null));};exports[_0x7d3a('0x80')]=function(_0x57b0cc,_0x48cd0f,_0xcc3b2e){return db[_0x7d3a('0x34')][_0x7d3a('0x7b')]({'where':{'id':_0x57b0cc['params']['id']}})['then'](function(_0x4090be){if(_0x4090be){if(!_0x57b0cc[_0x7d3a('0x3b')][_0x7d3a('0x73')]||!utils[_0x7d3a('0x7c')](_0x57b0cc[_0x7d3a('0x3b')][_0x7d3a('0x73')])){throw new db[(_0x7d3a('0x60'))][(_0x7d3a('0x74'))](_0x7d3a('0x75'));}return _0x4090be[_0x7d3a('0x81')+_[_0x7d3a('0x76')](_0x57b0cc['query'][_0x7d3a('0x73')][_0x7d3a('0x7e')]())+'Queues'](_0x57b0cc['query']['ids']);}return null;})[_0x7d3a('0x2e')](handleEntityNotFound(_0x48cd0f,null))[_0x7d3a('0x2e')](respondWithStatusCode(_0x48cd0f,null))['catch'](handleError(_0x48cd0f,null));};exports[_0x7d3a('0x82')]=function(_0x4cc50c,_0x5389b3){var _0x41fbf7=_[_0x7d3a('0x83')](_0x4cc50c[_0x7d3a('0x5b')][_0x7d3a('0x7f')])?_0x4cc50c[_0x7d3a('0x5b')][_0x7d3a('0x7f')]:[_0x4cc50c['body'][_0x7d3a('0x7f')]];var _0x23c09e=_0x4cc50c[_0x7d3a('0x4d')]['id'];return db[_0x7d3a('0x34')]['find']({'where':{'id':_0x23c09e}})[_0x7d3a('0x2e')](handleEntityNotFound(_0x5389b3,null))[_0x7d3a('0x2e')](function(_0x5104a4){if(_0x5104a4){var _0x177c61=[_0x7d3a('0x84'),_0x7d3a('0x85'),_0x7d3a('0x86'),'Sms','Fax',_0x7d3a('0x87'),_0x7d3a('0x88')];return db['sequelize'][_0x7d3a('0x5e')](function(_0x5ceeab){var _0x42c631=_[_0x7d3a('0x33')](_0x177c61,function(_0x2110e1){var _0xa1fc2d={'attributes':['id',_0x7d3a('0x30')]};if(_0x2110e1===_0x7d3a('0x84')){_0xa1fc2d['through']={'attributes':[_0x7d3a('0x89')]};}return _0x5104a4[_0x7d3a('0x52')+_0x2110e1+_0x7d3a('0x79')](_0xa1fc2d)[_0x7d3a('0x2e')](function(_0x39f6b2){var _0x3a6e18=_[_0x7d3a('0x33')](_0x39f6b2,function(_0x52bb4b){var _0x2f4dbb=_[_0x7d3a('0x33')](_0x41fbf7,function(_0x2ecc10){var _0x5b37df={'where':{'UserId':_0x2ecc10,[_0x2110e1+_0x7d3a('0x8a')]:_0x52bb4b['id']},'transaction':_0x5ceeab};if(_0x2110e1===_0x7d3a('0x84')){_0x5b37df[_0x7d3a('0x1b')]={'penalty':_0x52bb4b[_0x7d3a('0x8b')][_0x7d3a('0x89')]};}return db[_0x7d3a('0x8c')+_0x2110e1+_0x7d3a('0x77')][_0x7d3a('0x8d')](_0x5b37df)['then'](function(){socket['emit']('user'+_0x2110e1+_0x7d3a('0x8e'),{'UserId':_0x2ecc10,[_0x2110e1+_0x7d3a('0x8a')]:_0x52bb4b['id']});if(_0x2110e1!=='Voice'){return;}return db['User'][_0x7d3a('0x49')]({'where':{'id':_0x41fbf7,'online':0x1},'attributes':['id','name',_0x7d3a('0x8f'),'voicePause',_0x7d3a('0x90')],'raw':!![]})[_0x7d3a('0x2e')](function(_0x1c8381){var _0x5c857b=_[_0x7d3a('0x33')](_0x1c8381,function(_0x5d151f){return db[_0x7d3a('0x91')][_0x7d3a('0x92')]({'membername':_0x5d151f[_0x7d3a('0x30')],'UserId':_0x5d151f['id'],'queue_name':_0x52bb4b['name'],'VoiceQueueId':_0x52bb4b['id'],'interface':_[_0x7d3a('0x93')](_0x5d151f[_0x7d3a('0x90')])?util[_0x7d3a('0x94')]('SIP/%s',_0x5d151f['name']):_0x5d151f['interface'],'paused':_0x5d151f[_0x7d3a('0x95')]||![],'penalty':_0x52bb4b[_0x7d3a('0x8b')][_0x7d3a('0x89')]},{'transaction':_0x5ceeab});});return Promise[_0x7d3a('0x96')](_0x5c857b);});});});return Promise['all'](_0x2f4dbb);});return Promise[_0x7d3a('0x96')](_0x3a6e18);})[_0x7d3a('0x2e')](function(){return db[_0x7d3a('0x6f')]['findOne']({'where':{'teamId':_0x23c09e}})[_0x7d3a('0x2e')](function(_0x44dd32){if(_0x44dd32){var _0x13742e=_[_0x7d3a('0x33')](_0x41fbf7,function(_0x18c4fd){db[_0x7d3a('0x70')][_0x7d3a('0x92')]({'UserId':_0x18c4fd,'VoicePrefixId':_0x44dd32[_0x7d3a('0x71')]});});return Promise[_0x7d3a('0x96')](_0x13742e);}});});});return Promise[_0x7d3a('0x96')](_0x42c631)[_0x7d3a('0x2e')](function(){return _0x5104a4['addAgents'](_0x41fbf7,{'transaction':_0x5ceeab})['spread'](function(_0x2646d1){return _0x2646d1;});});});}})[_0x7d3a('0x2e')](respondWithResult(_0x5389b3,null))[_0x7d3a('0x4b')](handleError(_0x5389b3,null));};exports['removeAgents']=function(_0x5828a7,_0x277e0b){var _0x6bcefc=_['isArray'](_0x5828a7[_0x7d3a('0x3b')]['ids'])?_0x5828a7[_0x7d3a('0x3b')][_0x7d3a('0x7f')]:[_0x5828a7[_0x7d3a('0x3b')]['ids']];var _0xd848b7=_0x5828a7[_0x7d3a('0x4d')]['id'];return db[_0x7d3a('0x34')][_0x7d3a('0x4f')]({'where':{'id':_0xd848b7}})['then'](handleEntityNotFound(_0x277e0b,null))[_0x7d3a('0x2e')](function(_0x248274){if(_0x248274){var _0x42efa9=['Voice',_0x7d3a('0x85'),'Mail',_0x7d3a('0x97'),_0x7d3a('0x98'),_0x7d3a('0x87'),_0x7d3a('0x88')];return db[_0x7d3a('0x5d')][_0x7d3a('0x5e')](function(_0x1f933a){var _0x82b59=_['map'](_0x42efa9,function(_0x9b3d63){var _0x5d2681={'attributes':['id',_0x7d3a('0x30')]};return _0x248274[_0x7d3a('0x52')+_0x9b3d63+_0x7d3a('0x79')](_0x5d2681)[_0x7d3a('0x2e')](function(_0x48462b){var _0x279577=_[_0x7d3a('0x33')](_0x48462b,function(_0x54888c){return _0x54888c[_0x7d3a('0x99')](_0x6bcefc,{'transaction':_0x1f933a})['then'](function(){var _0x41b0b5=_[_0x7d3a('0x33')](_0x6bcefc,function(_0xa5ce2d){socket[_0x7d3a('0x9a')](_0x7d3a('0x51')+_0x9b3d63+'Queue:remove',{'UserId':Number(_0xa5ce2d),[_0x9b3d63+'QueueId']:_0x54888c['id']});if(_0x9b3d63!=='Voice'){return;}return db[_0x7d3a('0x91')][_0x7d3a('0x5c')]({'where':{'VoiceQueueId':_0x54888c['id'],'UserId':_0xa5ce2d},'transaction':_0x1f933a});});return Promise[_0x7d3a('0x96')](_0x41b0b5);});});return Promise[_0x7d3a('0x96')](_0x279577);});});return Promise['all'](_0x82b59)[_0x7d3a('0x2e')](function(){return _0x248274[_0x7d3a('0x99')](_0x6bcefc,{'transaction':_0x1f933a});})[_0x7d3a('0x2e')](function(){return db[_0x7d3a('0x6f')][_0x7d3a('0x7b')]({'where':{'teamId':_0xd848b7}})[_0x7d3a('0x2e')](function(_0x2b4385){if(_0x2b4385){var _0x59f657=_[_0x7d3a('0x33')](_0x6bcefc,function(_0x3780cd){db[_0x7d3a('0x70')]['destroy']({'where':{'UserId':_0x3780cd,'VoicePrefixId':_0x2b4385['VoicePrefixId']}});});return Promise[_0x7d3a('0x96')](_0x59f657);}});});});}})[_0x7d3a('0x2e')](respondWithStatusCode(_0x277e0b,null))[_0x7d3a('0x4b')](handleError(_0x277e0b,null));};exports[_0x7d3a('0x9b')]=function(_0x276345,_0x5bea08,_0x52608e){var _0x16daaa={};var _0x37c7a7={};var _0x2b55fa;var _0x47d4df;return db[_0x7d3a('0x34')][_0x7d3a('0x7b')]({'where':{'id':_0x276345[_0x7d3a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5bea08,null))[_0x7d3a('0x2e')](function(_0x55996d){if(_0x55996d){_0x2b55fa=_0x55996d;_0x37c7a7[_0x7d3a('0x39')]=_['keys'](db[_0x7d3a('0x8c')]['rawAttributes']);_0x37c7a7['query']=_['keys'](_0x276345['query']);_0x37c7a7[_0x7d3a('0x3c')]=_[_0x7d3a('0x3d')](_0x37c7a7[_0x7d3a('0x39')],_0x37c7a7['query']);_0x16daaa[_0x7d3a('0x3f')]=_['intersection'](_0x37c7a7[_0x7d3a('0x39')],qs[_0x7d3a('0x3e')](_0x276345[_0x7d3a('0x3b')][_0x7d3a('0x3e')]));_0x16daaa[_0x7d3a('0x3f')]=_0x16daaa['attributes'][_0x7d3a('0x40')]?_0x16daaa[_0x7d3a('0x3f')]:_0x37c7a7['model'];_0x16daaa[_0x7d3a('0x41')]=qs[_0x7d3a('0x42')](_0x276345[_0x7d3a('0x3b')][_0x7d3a('0x42')]);_0x16daaa[_0x7d3a('0x43')]=qs[_0x7d3a('0x3c')](_['pick'](_0x276345[_0x7d3a('0x3b')],_0x37c7a7[_0x7d3a('0x3c')]));if(_0x276345[_0x7d3a('0x3b')][_0x7d3a('0x44')]){_0x16daaa[_0x7d3a('0x43')]=_[_0x7d3a('0x45')](_0x16daaa[_0x7d3a('0x43')],{'$or':_['map'](_0x16daaa['attributes'],function(_0x136f2e){var _0x3e3460={};_0x3e3460[_0x136f2e]={'$like':'%'+_0x276345[_0x7d3a('0x3b')][_0x7d3a('0x44')]+'%'};return _0x3e3460;})});}_0x16daaa=_[_0x7d3a('0x45')]({},_0x16daaa,_0x276345[_0x7d3a('0x47')]);return _0x2b55fa[_0x7d3a('0x9b')](_0x16daaa);}})['then'](function(_0x43830d){if(_0x43830d){_0x47d4df=_0x43830d[_0x7d3a('0x40')];if(!_0x276345[_0x7d3a('0x3b')][_0x7d3a('0x9c')](_0x7d3a('0x9d'))){_0x16daaa[_0x7d3a('0x27')]=qs[_0x7d3a('0x27')](_0x276345[_0x7d3a('0x3b')][_0x7d3a('0x27')]);_0x16daaa['offset']=qs[_0x7d3a('0x24')](_0x276345[_0x7d3a('0x3b')][_0x7d3a('0x24')]);}return _0x2b55fa[_0x7d3a('0x9b')](_0x16daaa);}})[_0x7d3a('0x2e')](function(_0x8b9afe){if(_0x8b9afe){return _0x8b9afe?{'count':_0x47d4df,'rows':_0x8b9afe}:null;}})[_0x7d3a('0x2e')](respondWithResult(_0x5bea08,null))[_0x7d3a('0x4b')](handleError(_0x5bea08,null));}; \ No newline at end of file +var _0xf48f=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','order','capitalize','Queues','add','ids','remove','addAgents','Voice','Chat','Sms','Whatsapp','through','penalty','QueueId','defaults','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','TeamVoicePrefix','VoicePrefixId','isArray','Fax','Openchannel','removeAgents','Queue:remove','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','error','stack','name','send','map','Team','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x329808,_0x343255){var _0x1bbad0=function(_0x458c5b){while(--_0x458c5b){_0x329808['push'](_0x329808['shift']());}};_0x1bbad0(++_0x343255);}(_0xf48f,0x181));var _0xff48=function(_0x443423,_0x171ddc){_0x443423=_0x443423-0x0;var _0x56256b=_0xf48f[_0x443423];return _0x56256b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff48('0x0'));var jsonpatch=require(_0xff48('0x1'));var rp=require(_0xff48('0x2'));var moment=require('moment');var BPromise=require(_0xff48('0x3'));var Mustache=require(_0xff48('0x4'));var util=require(_0xff48('0x5'));var path=require(_0xff48('0x6'));var sox=require(_0xff48('0x7'));var csv=require(_0xff48('0x8'));var ejs=require(_0xff48('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff48('0xa'));var squel=require('squel');var crypto=require(_0xff48('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff48('0x8'));var querystring=require('querystring');var Papa=require(_0xff48('0xc'));var Redis=require(_0xff48('0xd'));var authService=require(_0xff48('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xff48('0xf'));var hardwareService=require(_0xff48('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xff48('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xff48('0x12'));var db=require('../../mysqldb')['db'];config[_0xff48('0x13')]=_['defaults'](config[_0xff48('0x13')],{'host':_0xff48('0x14'),'port':0x18eb});var socket=require(_0xff48('0x15'))(new Redis(config[_0xff48('0x13')]));require(_0xff48('0x16'))['register'](socket);function respondWithStatusCode(_0x400700,_0x49dfe9){_0x49dfe9=_0x49dfe9||0xcc;return function(_0x215e87){if(_0x215e87){return _0x400700[_0xff48('0x17')](_0x49dfe9);}return _0x400700[_0xff48('0x18')](_0x49dfe9)[_0xff48('0x19')]();};}function respondWithResult(_0x36b735,_0x4fdacf){_0x4fdacf=_0x4fdacf||0xc8;return function(_0x2d74c5){if(_0x2d74c5){return _0x36b735[_0xff48('0x18')](_0x4fdacf)[_0xff48('0x1a')](_0x2d74c5);}};}function respondWithFilteredResult(_0x206c67,_0x9ec550){return function(_0x5a5e3d){if(_0x5a5e3d){var _0x128ebd=typeof _0x9ec550['offset']===_0xff48('0x1b')&&typeof _0x9ec550[_0xff48('0x1c')]==='undefined';var _0x402684=_0x5a5e3d['count'];var _0x3bcc8b=_0x128ebd?0x0:_0x9ec550[_0xff48('0x1d')];var _0x5959f4=_0x128ebd?_0x5a5e3d[_0xff48('0x1e')]:_0x9ec550[_0xff48('0x1d')]+_0x9ec550[_0xff48('0x1c')];var _0x58f2a2;if(_0x5959f4>=_0x402684){_0x5959f4=_0x402684;_0x58f2a2=0xc8;}else{_0x58f2a2=0xce;}_0x206c67[_0xff48('0x18')](_0x58f2a2);return _0x206c67[_0xff48('0x1f')](_0xff48('0x20'),_0x3bcc8b+'-'+_0x5959f4+'/'+_0x402684)['json'](_0x5a5e3d);}return null;};}function patchUpdates(_0x31cf16){return function(_0x1b057e){try{jsonpatch['apply'](_0x1b057e,_0x31cf16,!![]);}catch(_0x17756e){return BPromise[_0xff48('0x21')](_0x17756e);}return _0x1b057e[_0xff48('0x22')]();};}function saveUpdates(_0x24b46f,_0x43164a){return function(_0x52e56a){if(_0x52e56a){return _0x52e56a[_0xff48('0x23')](_0x24b46f)[_0xff48('0x24')](function(_0x1015e7){return _0x1015e7;});}return null;};}function handleEntityNotFound(_0x212b16,_0x4285ad){return function(_0x3ebaf4){if(!_0x3ebaf4){_0x212b16['sendStatus'](0x194);}return _0x3ebaf4;};}function handleError(_0x6c6cd6,_0x1d3aa6){_0x1d3aa6=_0x1d3aa6||0x1f4;return function(_0x4b44f9){logger[_0xff48('0x25')](_0x4b44f9[_0xff48('0x26')]);if(_0x4b44f9[_0xff48('0x27')]){delete _0x4b44f9[_0xff48('0x27')];}_0x6c6cd6['status'](_0x1d3aa6)[_0xff48('0x28')](_0x4b44f9);};}exports['index']=function(_0x2cbfb9,_0x173aa4){var _0x3ee0b1={},_0x5e8102={},_0x2a9f81={'count':0x0,'rows':[]};var _0x17d44b=_[_0xff48('0x29')](db[_0xff48('0x2a')][_0xff48('0x2b')],function(_0x5c0762){return{'name':_0x5c0762[_0xff48('0x2c')],'type':_0x5c0762['type'][_0xff48('0x2d')]};});_0x5e8102['model']=_[_0xff48('0x29')](_0x17d44b,_0xff48('0x27'));_0x5e8102[_0xff48('0x2e')]=_[_0xff48('0x2f')](_0x2cbfb9[_0xff48('0x2e')]);_0x5e8102[_0xff48('0x30')]=_[_0xff48('0x31')](_0x5e8102[_0xff48('0x32')],_0x5e8102[_0xff48('0x2e')]);_0x3ee0b1[_0xff48('0x33')]=_[_0xff48('0x31')](_0x5e8102[_0xff48('0x32')],qs['fields'](_0x2cbfb9[_0xff48('0x2e')][_0xff48('0x34')]));_0x3ee0b1[_0xff48('0x33')]=_0x3ee0b1['attributes']['length']?_0x3ee0b1[_0xff48('0x33')]:_0x5e8102[_0xff48('0x32')];if(!_0x2cbfb9['query'][_0xff48('0x35')](_0xff48('0x36'))){_0x3ee0b1[_0xff48('0x1c')]=qs[_0xff48('0x1c')](_0x2cbfb9[_0xff48('0x2e')][_0xff48('0x1c')]);_0x3ee0b1[_0xff48('0x1d')]=qs[_0xff48('0x1d')](_0x2cbfb9[_0xff48('0x2e')][_0xff48('0x1d')]);}_0x3ee0b1['order']=qs['sort'](_0x2cbfb9[_0xff48('0x2e')][_0xff48('0x37')]);_0x3ee0b1[_0xff48('0x38')]=qs[_0xff48('0x30')](_[_0xff48('0x39')](_0x2cbfb9[_0xff48('0x2e')],_0x5e8102[_0xff48('0x30')]),_0x17d44b);if(_0x2cbfb9[_0xff48('0x2e')][_0xff48('0x3a')]){_0x3ee0b1[_0xff48('0x38')]=_[_0xff48('0x3b')](_0x3ee0b1[_0xff48('0x38')],{'$or':_[_0xff48('0x29')](_0x17d44b,function(_0x3d4b4c){if(_0x3d4b4c['type']!==_0xff48('0x3c')){var _0x54b224={};_0x54b224[_0x3d4b4c[_0xff48('0x27')]]={'$like':'%'+_0x2cbfb9[_0xff48('0x2e')][_0xff48('0x3a')]+'%'};return _0x54b224;}})});}_0x3ee0b1=_[_0xff48('0x3b')]({},_0x3ee0b1,_0x2cbfb9[_0xff48('0x3d')]);var _0x5188c0={'where':_0x3ee0b1[_0xff48('0x38')]};return db[_0xff48('0x2a')][_0xff48('0x1e')](_0x5188c0)[_0xff48('0x24')](function(_0x233e5f){_0x2a9f81[_0xff48('0x1e')]=_0x233e5f;if(_0x2cbfb9['query'][_0xff48('0x3e')]){_0x3ee0b1[_0xff48('0x3f')]=[{'all':!![]}];}return db[_0xff48('0x2a')][_0xff48('0x40')](_0x3ee0b1);})['then'](function(_0x3c5ffb){_0x2a9f81[_0xff48('0x41')]=_0x3c5ffb;return _0x2a9f81;})[_0xff48('0x24')](respondWithFilteredResult(_0x173aa4,_0x3ee0b1))[_0xff48('0x42')](handleError(_0x173aa4,null));};exports['show']=function(_0x1c8dd3,_0x27ae8e){var _0xcb0dcb={'raw':![],'where':{'id':_0x1c8dd3[_0xff48('0x43')]['id']}},_0x1f6a51={};_0x1f6a51[_0xff48('0x32')]=_[_0xff48('0x2f')](db[_0xff48('0x2a')][_0xff48('0x2b')]);_0x1f6a51[_0xff48('0x2e')]=_[_0xff48('0x2f')](_0x1c8dd3[_0xff48('0x2e')]);_0x1f6a51[_0xff48('0x30')]=_[_0xff48('0x31')](_0x1f6a51[_0xff48('0x32')],_0x1f6a51[_0xff48('0x2e')]);_0xcb0dcb[_0xff48('0x33')]=_[_0xff48('0x31')](_0x1f6a51[_0xff48('0x32')],qs[_0xff48('0x34')](_0x1c8dd3['query'][_0xff48('0x34')]));_0xcb0dcb[_0xff48('0x33')]=_0xcb0dcb['attributes'][_0xff48('0x44')]?_0xcb0dcb[_0xff48('0x33')]:_0x1f6a51[_0xff48('0x32')];if(_0x1c8dd3[_0xff48('0x2e')][_0xff48('0x3e')]){_0xcb0dcb[_0xff48('0x3f')]=[{'all':!![]}];}_0xcb0dcb=_[_0xff48('0x3b')]({},_0xcb0dcb,_0x1c8dd3['options']);return db['Team'][_0xff48('0x45')](_0xcb0dcb)[_0xff48('0x24')](handleEntityNotFound(_0x27ae8e,null))['then'](respondWithResult(_0x27ae8e,null))[_0xff48('0x42')](handleError(_0x27ae8e,null));};exports[_0xff48('0x46')]=function(_0x21d0b3,_0x91766b){return db[_0xff48('0x2a')][_0xff48('0x46')](_0x21d0b3[_0xff48('0x47')],{})['then'](function(_0x459e36){var _0x23d4b9=_0x21d0b3[_0xff48('0x48')][_0xff48('0x49')]({'plain':!![]});if(!_0x23d4b9)throw new Error(_0xff48('0x4a'));if(_0x23d4b9['role']===_0xff48('0x48')){var _0x26f584=_0x459e36[_0xff48('0x49')]({'plain':!![]});var _0x55f883=_0xff48('0x4b');return db['UserProfileSection'][_0xff48('0x45')]({'where':{'name':_0x55f883,'userProfileId':_0x23d4b9['userProfileId']},'raw':!![]})[_0xff48('0x24')](function(_0x1b248a){if(_0x1b248a&&_0x1b248a[_0xff48('0x4c')]===0x0){return db[_0xff48('0x4d')][_0xff48('0x46')]({'name':_0x26f584[_0xff48('0x27')],'resourceId':_0x26f584['id'],'type':_0x1b248a[_0xff48('0x27')],'sectionId':_0x1b248a['id']},{})['then'](function(){return _0x459e36;});}else{return _0x459e36;}})[_0xff48('0x42')](function(_0x284727){logger[_0xff48('0x25')](_0xff48('0x4e'),_0x284727);throw _0x284727;});}return _0x459e36;})['then'](respondWithResult(_0x91766b,0xc9))['catch'](handleError(_0x91766b,null));};exports[_0xff48('0x23')]=function(_0xc9c411,_0x5764d3){if(_0xc9c411['body']['id']){delete _0xc9c411['body']['id'];}return db[_0xff48('0x2a')][_0xff48('0x45')]({'where':{'id':_0xc9c411[_0xff48('0x43')]['id']}})[_0xff48('0x24')](handleEntityNotFound(_0x5764d3,null))[_0xff48('0x24')](saveUpdates(_0xc9c411[_0xff48('0x47')],null))['then'](respondWithResult(_0x5764d3,null))[_0xff48('0x42')](handleError(_0x5764d3,null));};exports[_0xff48('0x4f')]=function(_0x3bfa94,_0x3d3d8c){var _0x57fff0=_0x3bfa94[_0xff48('0x43')]['id'];var _0x126f53=[];return db[_0xff48('0x50')][_0xff48('0x51')](function(_0x11a62f){var _0x294b41=_0xff48('0x52')+_0x57fff0;return db[_0xff48('0x50')]['query'](_0x294b41,{'type':db[_0xff48('0x53')][_0xff48('0x54')][_0xff48('0x55')],'raw':!![],'transaction':_0x11a62f})[_0xff48('0x24')](function(_0x55a4ff){_0x126f53=_[_0xff48('0x29')](_0x55a4ff,function(_0x10046b){return Number(_0x10046b[_0xff48('0x56')]);});})[_0xff48('0x24')](function(){var _0xa58678=_0xff48('0x57')+_0x57fff0;return db['sequelize'][_0xff48('0x2e')](_0xa58678,{'type':db['Sequelize'][_0xff48('0x54')][_0xff48('0x55')],'raw':!![],'transaction':_0x11a62f});})[_0xff48('0x24')](function(_0x1f414f){var _0x3928ba=_[_0xff48('0x29')](_0x1f414f,function(_0x5bf661){return Number(_0x5bf661['VoiceQueueId']);});return db[_0xff48('0x58')][_0xff48('0x4f')]({'where':{'UserId':{'$in':_0x126f53},'VoiceQueueId':{'$in':_0x3928ba}},'transaction':_0x11a62f});})[_0xff48('0x24')](function(){var _0x250b74=_0xff48('0x59')+_0x57fff0;return db[_0xff48('0x50')][_0xff48('0x2e')](_0x250b74,{'type':db[_0xff48('0x53')]['QueryTypes'][_0xff48('0x55')],'raw':!![],'transaction':_0x11a62f});})[_0xff48('0x24')](function(_0x1566ee){var _0x209bf0=_[_0xff48('0x29')](_0x1566ee,function(_0x5331bc){return Number(_0x5331bc[_0xff48('0x5a')]);});return db[_0xff48('0x5b')][_0xff48('0x4f')]({'where':{'UserId':{'$in':_0x126f53},'MailQueueId':{'$in':_0x209bf0}},'transaction':_0x11a62f});})[_0xff48('0x24')](function(){var _0x327348=_0xff48('0x5c')+_0x57fff0;return db[_0xff48('0x50')][_0xff48('0x2e')](_0x327348,{'type':db[_0xff48('0x53')][_0xff48('0x54')][_0xff48('0x55')],'raw':!![],'transaction':_0x11a62f});})[_0xff48('0x24')](function(_0x49387d){var _0x334683=_[_0xff48('0x29')](_0x49387d,function(_0x5504bd){return Number(_0x5504bd['SmsQueueId']);});return db[_0xff48('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x126f53},'SmsQueueId':{'$in':_0x334683}},'transaction':_0x11a62f});})[_0xff48('0x24')](function(){var _0x1b3c4a=_0xff48('0x5e')+_0x57fff0;return db['sequelize'][_0xff48('0x2e')](_0x1b3c4a,{'type':db[_0xff48('0x53')][_0xff48('0x54')]['SELECT'],'raw':!![],'transaction':_0x11a62f});})[_0xff48('0x24')](function(_0x5beb91){var _0x244631=_[_0xff48('0x29')](_0x5beb91,function(_0x23417e){return Number(_0x23417e['ChatQueueId']);});return db[_0xff48('0x5f')][_0xff48('0x4f')]({'where':{'UserId':{'$in':_0x126f53},'ChatQueueId':{'$in':_0x244631}},'transaction':_0x11a62f});})['then'](function(){var _0x48501f=_0xff48('0x60')+_0x57fff0;return db[_0xff48('0x50')][_0xff48('0x2e')](_0x48501f,{'type':db[_0xff48('0x53')]['QueryTypes'][_0xff48('0x55')],'raw':!![],'transaction':_0x11a62f});})['then'](function(_0x52fd86){var _0x282d99=_[_0xff48('0x29')](_0x52fd86,function(_0xaa431f){return Number(_0xaa431f['FaxQueueId']);});return db[_0xff48('0x61')][_0xff48('0x4f')]({'where':{'UserId':{'$in':_0x126f53},'FaxQueueId':{'$in':_0x282d99}},'transaction':_0x11a62f});})[_0xff48('0x24')](function(){var _0xe0d50b='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x57fff0;return db[_0xff48('0x50')][_0xff48('0x2e')](_0xe0d50b,{'type':db[_0xff48('0x53')][_0xff48('0x54')][_0xff48('0x55')],'raw':!![],'transaction':_0x11a62f});})[_0xff48('0x24')](function(_0x342a67){var _0x22a796=_[_0xff48('0x29')](_0x342a67,function(_0x154bfa){return Number(_0x154bfa[_0xff48('0x62')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x126f53},'OpenchannelQueueId':{'$in':_0x22a796}},'transaction':_0x11a62f});})[_0xff48('0x24')](function(){var _0x447729=_0xff48('0x63')+_0x57fff0;return db[_0xff48('0x50')][_0xff48('0x2e')](_0x447729,{'type':db[_0xff48('0x53')][_0xff48('0x54')][_0xff48('0x55')],'raw':!![],'transaction':_0x11a62f});})[_0xff48('0x24')](function(_0x6e13c6){var _0x5b43f7=_[_0xff48('0x29')](_0x6e13c6,function(_0x29c380){return Number(_0x29c380[_0xff48('0x64')]);});return db[_0xff48('0x65')]['destroy']({'where':{'UserId':{'$in':_0x126f53},'WhatsappQueueId':{'$in':_0x5b43f7}},'transaction':_0x11a62f});})[_0xff48('0x24')](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x57fff0}});})[_0xff48('0x24')](function(_0x35d85f){if(_0x35d85f===null){return;}return db[_0xff48('0x66')][_0xff48('0x4f')]({'where':{'UserId':{'$in':_0x126f53},'VoicePrefixId':_0x35d85f['VoicePrefixId']},'transaction':_0x11a62f});})['then'](function(){return db[_0xff48('0x2a')][_0xff48('0x4f')]({'where':{'id':_0x57fff0},'cascade':!![],'transaction':_0x11a62f});})[_0xff48('0x24')](function(_0x3b12a0){if(_0x3b12a0===0x0){_0x3d3d8c[_0xff48('0x17')](0x194);}else{return db[_0xff48('0x4d')][_0xff48('0x4f')]({'where':{'type':_0xff48('0x4b'),'resourceId':_0x57fff0},'cascade':!![],'transaction':_0x11a62f})[_0xff48('0x24')](function(){_0x3d3d8c['status'](0xcc)[_0xff48('0x19')]();});}})['catch'](function(_0x1282dd){_0x3d3d8c[_0xff48('0x18')](0x1f4)[_0xff48('0x28')](_0x1282dd);});});};exports[_0xff48('0x67')]=function(_0x4fbab7,_0x393358,_0x399cc5){return db[_0xff48('0x2a')][_0xff48('0x68')]({'where':{'id':_0x4fbab7[_0xff48('0x43')]['id']}})['then'](handleEntityNotFound(_0x393358,null))[_0xff48('0x24')](function(_0x333bed){if(!_0x4fbab7[_0xff48('0x2e')][_0xff48('0x69')]||!utils[_0xff48('0x6a')](_0x4fbab7['query'][_0xff48('0x69')])){throw new db['Sequelize'][(_0xff48('0x6b'))](_0xff48('0x6c'));}var _0x1e4dfa={};var _0x43b39c={};_0x43b39c[_0xff48('0x32')]=_[_0xff48('0x2f')](db[_['capitalize'](_0x4fbab7['query'][_0xff48('0x69')][_0xff48('0x6d')]())+'Queue'][_0xff48('0x2b')]);_0x43b39c[_0xff48('0x2e')]=_['keys'](_0x4fbab7['query']);_0x43b39c[_0xff48('0x30')]=_[_0xff48('0x31')](_0x43b39c['model'],_0x43b39c[_0xff48('0x2e')]);_0x1e4dfa[_0xff48('0x33')]=_['intersection'](_0x43b39c[_0xff48('0x32')],qs[_0xff48('0x34')](_0x4fbab7[_0xff48('0x2e')][_0xff48('0x34')]));_0x1e4dfa[_0xff48('0x33')]=_0x1e4dfa[_0xff48('0x33')][_0xff48('0x44')]?_0x1e4dfa[_0xff48('0x33')]:_0x43b39c[_0xff48('0x32')];_0x1e4dfa[_0xff48('0x1c')]=qs['limit'](_0x4fbab7[_0xff48('0x2e')][_0xff48('0x1c')]);_0x1e4dfa['offset']=qs[_0xff48('0x1d')](_0x4fbab7[_0xff48('0x2e')][_0xff48('0x1d')]);_0x1e4dfa[_0xff48('0x6e')]=qs[_0xff48('0x37')](_0x4fbab7[_0xff48('0x2e')][_0xff48('0x37')]);_0x1e4dfa[_0xff48('0x38')]=qs[_0xff48('0x30')](_[_0xff48('0x39')](_0x4fbab7['query'],_0x43b39c[_0xff48('0x30')]));_0x1e4dfa=_[_0xff48('0x3b')]({},_0x1e4dfa,_0x4fbab7['options']);return _0x333bed[_0xff48('0x49')+_[_0xff48('0x6f')](_0x4fbab7[_0xff48('0x2e')][_0xff48('0x69')][_0xff48('0x6d')]())+_0xff48('0x70')](_0x1e4dfa);})[_0xff48('0x24')](respondWithResult(_0x393358,null))[_0xff48('0x42')](handleError(_0x393358,null));};exports['addQueues']=function(_0x590ebe,_0x3bbf16,_0x2aced2){return db[_0xff48('0x2a')][_0xff48('0x68')]({'where':{'id':_0x590ebe[_0xff48('0x43')]['id']}})[_0xff48('0x24')](function(_0x150c58){if(_0x150c58){if(!_0x590ebe[_0xff48('0x47')][_0xff48('0x69')]||!utils[_0xff48('0x6a')](_0x590ebe['body'][_0xff48('0x69')])){throw new db[(_0xff48('0x53'))][(_0xff48('0x6b'))]('Unknown\x20channel');}return _0x150c58[_0xff48('0x71')+_[_0xff48('0x6f')](_0x590ebe['body'][_0xff48('0x69')][_0xff48('0x6d')]())+_0xff48('0x70')](_0x590ebe[_0xff48('0x47')][_0xff48('0x72')]);}return null;})['then'](handleEntityNotFound(_0x3bbf16,null))[_0xff48('0x24')](respondWithStatusCode(_0x3bbf16,null))[_0xff48('0x42')](handleError(_0x3bbf16,null));};exports['removeQueues']=function(_0x2cf50f,_0x28dbbc,_0x29a390){return db[_0xff48('0x2a')]['findOne']({'where':{'id':_0x2cf50f[_0xff48('0x43')]['id']}})[_0xff48('0x24')](function(_0x53b558){if(_0x53b558){if(!_0x2cf50f[_0xff48('0x2e')][_0xff48('0x69')]||!utils[_0xff48('0x6a')](_0x2cf50f[_0xff48('0x2e')][_0xff48('0x69')])){throw new db[(_0xff48('0x53'))][(_0xff48('0x6b'))](_0xff48('0x6c'));}return _0x53b558[_0xff48('0x73')+_[_0xff48('0x6f')](_0x2cf50f[_0xff48('0x2e')]['channel'][_0xff48('0x6d')]())+'Queues'](_0x2cf50f['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x28dbbc,null))[_0xff48('0x24')](respondWithStatusCode(_0x28dbbc,null))[_0xff48('0x42')](handleError(_0x28dbbc,null));};exports[_0xff48('0x74')]=function(_0x294d54,_0x43cfff){var _0x95e175=_['isArray'](_0x294d54[_0xff48('0x47')][_0xff48('0x72')])?_0x294d54[_0xff48('0x47')]['ids']:[_0x294d54[_0xff48('0x47')][_0xff48('0x72')]];var _0x3e03fa=_0x294d54[_0xff48('0x43')]['id'];return db[_0xff48('0x2a')]['find']({'where':{'id':_0x3e03fa}})['then'](handleEntityNotFound(_0x43cfff,null))[_0xff48('0x24')](function(_0x29c06d){if(_0x29c06d){var _0x1f8af5=[_0xff48('0x75'),_0xff48('0x76'),'Mail',_0xff48('0x77'),'Fax','Openchannel',_0xff48('0x78')];return db['sequelize'][_0xff48('0x51')](function(_0x52528a){var _0x534535=_['map'](_0x1f8af5,function(_0x5cd9fd){var _0x3362e6={'attributes':['id',_0xff48('0x27')]};if(_0x5cd9fd===_0xff48('0x75')){_0x3362e6[_0xff48('0x79')]={'attributes':[_0xff48('0x7a')]};}return _0x29c06d[_0xff48('0x49')+_0x5cd9fd+_0xff48('0x70')](_0x3362e6)[_0xff48('0x24')](function(_0x4abfb5){var _0x2685ff=_[_0xff48('0x29')](_0x4abfb5,function(_0x5190b3){var _0x1facee=_[_0xff48('0x29')](_0x95e175,function(_0x3ee6a0){var _0x1d3951={'where':{'UserId':_0x3ee6a0,[_0x5cd9fd+_0xff48('0x7b')]:_0x5190b3['id']},'transaction':_0x52528a};if(_0x5cd9fd==='Voice'){_0x1d3951[_0xff48('0x7c')]={'penalty':_0x5190b3[_0xff48('0x7d')]['penalty']};}return db[_0xff48('0x7e')+_0x5cd9fd+_0xff48('0x7f')][_0xff48('0x80')](_0x1d3951)[_0xff48('0x24')](function(){socket[_0xff48('0x81')]('user'+_0x5cd9fd+_0xff48('0x82'),{'UserId':_0x3ee6a0,[_0x5cd9fd+'QueueId']:_0x5190b3['id']});if(_0x5cd9fd!==_0xff48('0x75')){return;}return db[_0xff48('0x7e')][_0xff48('0x40')]({'where':{'id':_0x95e175,'online':0x1},'attributes':['id',_0xff48('0x27'),_0xff48('0x83'),_0xff48('0x84'),'interface'],'raw':!![]})[_0xff48('0x24')](function(_0x426210){var _0x579711=_['map'](_0x426210,function(_0x374c7f){return db[_0xff48('0x85')][_0xff48('0x86')]({'membername':_0x374c7f[_0xff48('0x27')],'UserId':_0x374c7f['id'],'queue_name':_0x5190b3[_0xff48('0x27')],'VoiceQueueId':_0x5190b3['id'],'interface':_[_0xff48('0x87')](_0x374c7f[_0xff48('0x88')])?util[_0xff48('0x89')](_0xff48('0x8a'),_0x374c7f[_0xff48('0x27')]):_0x374c7f[_0xff48('0x88')],'paused':_0x374c7f['voicePause']||![],'penalty':_0x5190b3[_0xff48('0x7d')][_0xff48('0x7a')]},{'transaction':_0x52528a});});return Promise[_0xff48('0x8b')](_0x579711);});});});return Promise[_0xff48('0x8b')](_0x1facee);});return Promise[_0xff48('0x8b')](_0x2685ff);})['then'](function(){return db[_0xff48('0x8c')]['findOne']({'where':{'teamId':_0x3e03fa}})[_0xff48('0x24')](function(_0x3f6661){if(_0x3f6661){var _0x58210d=_[_0xff48('0x29')](_0x95e175,function(_0x37b6cc){db[_0xff48('0x66')][_0xff48('0x86')]({'UserId':_0x37b6cc,'VoicePrefixId':_0x3f6661[_0xff48('0x8d')]});});return Promise[_0xff48('0x8b')](_0x58210d);}});});});return Promise[_0xff48('0x8b')](_0x534535)[_0xff48('0x24')](function(){return _0x29c06d[_0xff48('0x74')](_0x95e175,{'transaction':_0x52528a})['spread'](function(_0xfed814){return _0xfed814;});});});}})[_0xff48('0x24')](respondWithResult(_0x43cfff,null))[_0xff48('0x42')](handleError(_0x43cfff,null));};exports['removeAgents']=function(_0x8f2425,_0x546315){var _0x55a334=_[_0xff48('0x8e')](_0x8f2425[_0xff48('0x2e')][_0xff48('0x72')])?_0x8f2425[_0xff48('0x2e')]['ids']:[_0x8f2425[_0xff48('0x2e')][_0xff48('0x72')]];var _0x3695b5=_0x8f2425['params']['id'];return db[_0xff48('0x2a')][_0xff48('0x45')]({'where':{'id':_0x3695b5}})[_0xff48('0x24')](handleEntityNotFound(_0x546315,null))[_0xff48('0x24')](function(_0xd155a2){if(_0xd155a2){var _0xfa8f4a=['Voice',_0xff48('0x76'),'Mail',_0xff48('0x77'),_0xff48('0x8f'),_0xff48('0x90'),_0xff48('0x78')];return db[_0xff48('0x50')][_0xff48('0x51')](function(_0x1046cf){var _0x4e3ef7=_[_0xff48('0x29')](_0xfa8f4a,function(_0xdfa42f){var _0xf968bc={'attributes':['id',_0xff48('0x27')]};return _0xd155a2[_0xff48('0x49')+_0xdfa42f+_0xff48('0x70')](_0xf968bc)[_0xff48('0x24')](function(_0x2762bf){var _0x543bde=_['map'](_0x2762bf,function(_0x252e76){return _0x252e76[_0xff48('0x91')](_0x55a334,{'transaction':_0x1046cf})['then'](function(){var _0x526442=_[_0xff48('0x29')](_0x55a334,function(_0x2e5747){socket[_0xff48('0x81')](_0xff48('0x48')+_0xdfa42f+_0xff48('0x92'),{'UserId':Number(_0x2e5747),[_0xdfa42f+'QueueId']:_0x252e76['id']});if(_0xdfa42f!==_0xff48('0x75')){return;}return db[_0xff48('0x85')][_0xff48('0x4f')]({'where':{'VoiceQueueId':_0x252e76['id'],'UserId':_0x2e5747},'transaction':_0x1046cf});});return Promise['all'](_0x526442);});});return Promise['all'](_0x543bde);});});return Promise['all'](_0x4e3ef7)['then'](function(){return _0xd155a2[_0xff48('0x91')](_0x55a334,{'transaction':_0x1046cf});})[_0xff48('0x24')](function(){return db[_0xff48('0x8c')]['findOne']({'where':{'teamId':_0x3695b5}})['then'](function(_0xacf12e){if(_0xacf12e){var _0x5c27b1=_['map'](_0x55a334,function(_0x4f4e6e){db[_0xff48('0x66')][_0xff48('0x4f')]({'where':{'UserId':_0x4f4e6e,'VoicePrefixId':_0xacf12e[_0xff48('0x8d')]}});});return Promise[_0xff48('0x8b')](_0x5c27b1);}});});});}})[_0xff48('0x24')](respondWithStatusCode(_0x546315,null))[_0xff48('0x42')](handleError(_0x546315,null));};exports[_0xff48('0x93')]=function(_0x53c7a2,_0x44dbfe,_0x38100c){var _0x910732={};var _0x11ab28={};var _0xa90e08;var _0x3d2cc2;return db[_0xff48('0x2a')][_0xff48('0x68')]({'where':{'id':_0x53c7a2[_0xff48('0x43')]['id']}})[_0xff48('0x24')](handleEntityNotFound(_0x44dbfe,null))[_0xff48('0x24')](function(_0x371b8a){if(_0x371b8a){_0xa90e08=_0x371b8a;_0x11ab28[_0xff48('0x32')]=_[_0xff48('0x2f')](db['User']['rawAttributes']);_0x11ab28[_0xff48('0x2e')]=_[_0xff48('0x2f')](_0x53c7a2[_0xff48('0x2e')]);_0x11ab28[_0xff48('0x30')]=_[_0xff48('0x31')](_0x11ab28['model'],_0x11ab28[_0xff48('0x2e')]);_0x910732[_0xff48('0x33')]=_['intersection'](_0x11ab28[_0xff48('0x32')],qs[_0xff48('0x34')](_0x53c7a2['query']['fields']));_0x910732[_0xff48('0x33')]=_0x910732[_0xff48('0x33')][_0xff48('0x44')]?_0x910732['attributes']:_0x11ab28[_0xff48('0x32')];_0x910732[_0xff48('0x6e')]=qs['sort'](_0x53c7a2['query'][_0xff48('0x37')]);_0x910732[_0xff48('0x38')]=qs[_0xff48('0x30')](_['pick'](_0x53c7a2[_0xff48('0x2e')],_0x11ab28['filters']));if(_0x53c7a2[_0xff48('0x2e')][_0xff48('0x3a')]){_0x910732[_0xff48('0x38')]=_[_0xff48('0x3b')](_0x910732[_0xff48('0x38')],{'$or':_[_0xff48('0x29')](_0x910732[_0xff48('0x33')],function(_0x24bc01){var _0x16c0ce={};_0x16c0ce[_0x24bc01]={'$like':'%'+_0x53c7a2[_0xff48('0x2e')][_0xff48('0x3a')]+'%'};return _0x16c0ce;})});}_0x910732=_[_0xff48('0x3b')]({},_0x910732,_0x53c7a2[_0xff48('0x3d')]);return _0xa90e08[_0xff48('0x93')](_0x910732);}})['then'](function(_0x23a0a5){if(_0x23a0a5){_0x3d2cc2=_0x23a0a5[_0xff48('0x44')];if(!_0x53c7a2[_0xff48('0x2e')][_0xff48('0x35')](_0xff48('0x36'))){_0x910732['limit']=qs['limit'](_0x53c7a2[_0xff48('0x2e')][_0xff48('0x1c')]);_0x910732[_0xff48('0x1d')]=qs[_0xff48('0x1d')](_0x53c7a2['query'][_0xff48('0x1d')]);}return _0xa90e08[_0xff48('0x93')](_0x910732);}})[_0xff48('0x24')](function(_0x3e6217){if(_0x3e6217){return _0x3e6217?{'count':_0x3d2cc2,'rows':_0x3e6217}:null;}})[_0xff48('0x24')](respondWithResult(_0x44dbfe,null))[_0xff48('0x42')](handleError(_0x44dbfe,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1f92681..472c3a2 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 _0x01f1=['update','remove','emit','hook','exports','../../mysqldb','Team','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01f1,0x1c5));var _0x101f=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x01f1[_0x298ed3];return _0x5aad28;};'use strict';var EventEmitter=require('events');var Team=require(_0x101f('0x0'))['db'][_0x101f('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x101f('0x2'),'afterUpdate':_0x101f('0x3'),'afterDestroy':_0x101f('0x4')};function emitEvent(_0x488edc){return function(_0x48c9f8,_0x27d406,_0x5598a4){TeamEvents['emit'](_0x488edc+':'+_0x48c9f8['id'],_0x48c9f8);TeamEvents[_0x101f('0x5')](_0x488edc,_0x48c9f8);_0x5598a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x101f('0x6')](e,emitEvent(event));}}module[_0x101f('0x7')]=TeamEvents; \ No newline at end of file +var _0xda7a=['Team','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xda7a,0xe9));var _0xada7=function(_0x181849,_0x23d2e0){_0x181849=_0x181849-0x0;var _0xa2ef85=_0xda7a[_0x181849];return _0xa2ef85;};'use strict';var EventEmitter=require(_0xada7('0x0'));var Team=require('../../mysqldb')['db'][_0xada7('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xada7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xada7('0x3'),'afterDestroy':_0xada7('0x4')};function emitEvent(_0x302655){return function(_0x5c98d2,_0x414422,_0x3b4c96){TeamEvents[_0xada7('0x5')](_0x302655+':'+_0x5c98d2['id'],_0x5c98d2);TeamEvents[_0xada7('0x5')](_0x302655,_0x5c98d2);_0x3b4c96(null);};}for(var e in events){if(events[_0xada7('0x6')](e)){var event=events[e];Team[_0xada7('0x7')](e,emitEvent(event));}}module[_0xada7('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index a9722a4..d4b22ab 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 _0x8e00=['Whatsapp','resolve','all','lodash','./team.attributes','Queues','then','map','setDataValue','catch','exports','define','Team','teams','Fax','Mail','Openchannel','Voice'];(function(_0x57075d,_0x1c0db7){var _0x10a32c=function(_0x4d79f6){while(--_0x4d79f6){_0x57075d['push'](_0x57075d['shift']());}};_0x10a32c(++_0x1c0db7);}(_0x8e00,0xc9));var _0x08e0=function(_0x5f5331,_0x37d76e){_0x5f5331=_0x5f5331-0x0;var _0x5b83a7=_0x8e00[_0x5f5331];return _0x5b83a7;};'use strict';var _=require(_0x08e0('0x0'));var attributes=require(_0x08e0('0x1'));function getQueuesByChannel(_0x3d838f,_0x3faf82){var _0x174732='get'+_0x3faf82+_0x08e0('0x2');return _0x3d838f[_0x174732]()[_0x08e0('0x3')](function(_0x5e4293){return _[_0x08e0('0x4')](_0x5e4293,function(_0x598b11){_0x598b11[_0x08e0('0x5')]('channel',_0x3faf82);return _0x598b11;});})[_0x08e0('0x6')](function(_0x1d762b){throw _0x1d762b;});}module[_0x08e0('0x7')]=function(_0x3565b1){return _0x3565b1[_0x08e0('0x8')](_0x08e0('0x9'),attributes,{'tableName':_0x08e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1170d9=this;var _0x595d26=['Chat',_0x08e0('0xb'),_0x08e0('0xc'),_0x08e0('0xd'),'Sms',_0x08e0('0xe'),_0x08e0('0xf')];return Promise[_0x08e0('0x10')]()['then'](function(){var _0x554434=_[_0x08e0('0x4')](_0x595d26,function(_0x2fa415){return getQueuesByChannel(_0x1170d9,_0x2fa415);});return Promise[_0x08e0('0x11')](_0x554434);})[_0x08e0('0x6')](function(_0x380844){throw _0x380844;});}}});}; \ No newline at end of file +var _0xf9a4=['setDataValue','channel','catch','exports','define','Chat','Sms','Voice','Whatsapp','resolve','all','Queues','map'];(function(_0x1e4f5f,_0x15cc5f){var _0x47b799=function(_0x35ee43){while(--_0x35ee43){_0x1e4f5f['push'](_0x1e4f5f['shift']());}};_0x47b799(++_0x15cc5f);}(_0xf9a4,0x8d));var _0x4f9a=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xf9a4[_0x525c7b];return _0x27b33e;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x5b43b1,_0x2cdc13){var _0x4fb86e='get'+_0x2cdc13+_0x4f9a('0x0');return _0x5b43b1[_0x4fb86e]()['then'](function(_0x13d14c){return _[_0x4f9a('0x1')](_0x13d14c,function(_0x4811d6){_0x4811d6[_0x4f9a('0x2')](_0x4f9a('0x3'),_0x2cdc13);return _0x4811d6;});})[_0x4f9a('0x4')](function(_0x18236f){throw _0x18236f;});}module[_0x4f9a('0x5')]=function(_0x58256c){return _0x58256c[_0x4f9a('0x6')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5250e6=this;var _0x5ecb7b=[_0x4f9a('0x7'),'Fax','Mail','Openchannel',_0x4f9a('0x8'),_0x4f9a('0x9'),_0x4f9a('0xa')];return Promise[_0x4f9a('0xb')]()['then'](function(){var _0x295ad1=_[_0x4f9a('0x1')](_0x5ecb7b,function(_0x260213){return getQueuesByChannel(_0x5250e6,_0x260213);});return Promise[_0x4f9a('0xc')](_0x295ad1);})[_0x4f9a('0x4')](function(_0x154cb2){throw _0x154cb2;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 1c953b9..be71223 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 _0x671a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','util','moment','ioredis'];(function(_0x319473,_0x42b7b3){var _0x500fac=function(_0x20de9a){while(--_0x20de9a){_0x319473['push'](_0x319473['shift']());}};_0x500fac(++_0x42b7b3);}(_0x671a,0x13b));var _0xa671=function(_0x49870c,_0x4d2e2b){_0x49870c=_0x49870c-0x0;var _0x2c98f5=_0x671a[_0x49870c];return _0x2c98f5;};'use strict';var _=require(_0xa671('0x0'));var util=require(_0xa671('0x1'));var moment=require(_0xa671('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa671('0x3'));var db=require(_0xa671('0x4'))['db'];var utils=require(_0xa671('0x5'));var logger=require(_0xa671('0x6'))(_0xa671('0x7'));var config=require(_0xa671('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa671('0x9')][_0xa671('0xa')]({'port':0x232a});config[_0xa671('0xb')]=_['defaults'](config['redis'],{'host':_0xa671('0xc'),'port':0x18eb});var socket=require(_0xa671('0xd'))(new Redis(config[_0xa671('0xb')]));require(_0xa671('0xe'))[_0xa671('0xf')](socket);function respondWithRpcPromise(_0x4298b7,_0xb06c8e,_0x208334){return new BPromise(function(_0x15b31f,_0x4dd5f4){return client[_0xa671('0x10')](_0x4298b7,_0x208334)[_0xa671('0x11')](function(_0x51b743){logger[_0xa671('0x12')](_0xa671('0x13'),_0xb06c8e,_0xa671('0x14'));logger[_0xa671('0x15')](_0xa671('0x16'),_0xb06c8e,'request\x20sent',JSON[_0xa671('0x17')](_0x51b743));if(_0x51b743['error']){if(_0x51b743['error'][_0xa671('0x18')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0xb06c8e,_0x51b743['error'][_0xa671('0x19')]);return _0x4dd5f4(_0x51b743[_0xa671('0x1a')][_0xa671('0x19')]);}logger[_0xa671('0x1a')](_0xa671('0x13'),_0xb06c8e,_0x51b743[_0xa671('0x1a')][_0xa671('0x19')]);return _0x15b31f(_0x51b743[_0xa671('0x1a')][_0xa671('0x19')]);}else{logger[_0xa671('0x12')](_0xa671('0x13'),_0xb06c8e,_0xa671('0x14'));_0x15b31f(_0x51b743[_0xa671('0x1b')][_0xa671('0x19')]);}})[_0xa671('0x1c')](function(_0x2651f4){logger['error']('Team,\x20%s,\x20%s',_0xb06c8e,_0x2651f4);_0x4dd5f4(_0x2651f4);});});} \ No newline at end of file +var _0x9ea0=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Team,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x10921d,_0x242a14){var _0x163ca1=function(_0x3429b2){while(--_0x3429b2){_0x10921d['push'](_0x10921d['shift']());}};_0x163ca1(++_0x242a14);}(_0x9ea0,0xc0));var _0x09ea=function(_0x8956eb,_0x3ee779){_0x8956eb=_0x8956eb-0x0;var _0x14fbee=_0x9ea0[_0x8956eb];return _0x14fbee;};'use strict';var _=require(_0x09ea('0x0'));var util=require(_0x09ea('0x1'));var moment=require(_0x09ea('0x2'));var BPromise=require(_0x09ea('0x3'));var rs=require(_0x09ea('0x4'));var fs=require('fs');var Redis=require(_0x09ea('0x5'));var db=require(_0x09ea('0x6'))['db'];var utils=require(_0x09ea('0x7'));var logger=require(_0x09ea('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x09ea('0x9'));var client=jayson[_0x09ea('0xa')]['http']({'port':0x232a});config[_0x09ea('0xb')]=_[_0x09ea('0xc')](config[_0x09ea('0xb')],{'host':_0x09ea('0xd'),'port':0x18eb});var socket=require(_0x09ea('0xe'))(new Redis(config[_0x09ea('0xb')]));require('./team.socket')[_0x09ea('0xf')](socket);function respondWithRpcPromise(_0x17cddc,_0x3dc9cd,_0x595d8d){return new BPromise(function(_0x56563a,_0x96f289){return client[_0x09ea('0x10')](_0x17cddc,_0x595d8d)[_0x09ea('0x11')](function(_0x3a05e8){logger[_0x09ea('0x12')]('Team,\x20%s,\x20%s',_0x3dc9cd,_0x09ea('0x13'));logger[_0x09ea('0x14')](_0x09ea('0x15'),_0x3dc9cd,_0x09ea('0x13'),JSON[_0x09ea('0x16')](_0x3a05e8));if(_0x3a05e8[_0x09ea('0x17')]){if(_0x3a05e8[_0x09ea('0x17')][_0x09ea('0x18')]===0x1f4){logger[_0x09ea('0x17')]('Team,\x20%s,\x20%s',_0x3dc9cd,_0x3a05e8['error'][_0x09ea('0x19')]);return _0x96f289(_0x3a05e8[_0x09ea('0x17')][_0x09ea('0x19')]);}logger[_0x09ea('0x17')](_0x09ea('0x1a'),_0x3dc9cd,_0x3a05e8['error']['message']);return _0x56563a(_0x3a05e8[_0x09ea('0x17')][_0x09ea('0x19')]);}else{logger[_0x09ea('0x12')]('Team,\x20%s,\x20%s',_0x3dc9cd,'request\x20sent');_0x56563a(_0x3a05e8[_0x09ea('0x1b')]['message']);}})[_0x09ea('0x1c')](function(_0x312042){logger['error'](_0x09ea('0x1a'),_0x3dc9cd,_0x312042);_0x96f289(_0x312042);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 49325be..91f87db 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 _0x57e6=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0x1f9f73,_0x2287b7){var _0x210601=function(_0x436bd0){while(--_0x436bd0){_0x1f9f73['push'](_0x1f9f73['shift']());}};_0x210601(++_0x2287b7);}(_0x57e6,0x177));var _0x657e=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x57e6[_0x57fa7e];return _0x320671;};'use strict';var TeamEvents=require(_0x657e('0x0'));var events=[_0x657e('0x1'),_0x657e('0x2'),_0x657e('0x3')];function createListener(_0x520ec0,_0x7980e0){return function(_0x48a582){_0x7980e0[_0x657e('0x4')](_0x520ec0,_0x48a582);};}function removeListener(_0x773dd8,_0x3324d3){return function(){TeamEvents[_0x657e('0x5')](_0x773dd8,_0x3324d3);};}exports[_0x657e('0x6')]=function(_0x24708a){for(var _0x3521b1=0x0,_0x4358f1=events[_0x657e('0x7')];_0x3521b1<_0x4358f1;_0x3521b1++){var _0x440667=events[_0x3521b1];var _0x12807d=createListener(_0x657e('0x8')+_0x440667,_0x24708a);TeamEvents['on'](_0x440667,_0x12807d);}}; \ No newline at end of file +var _0x1601=['length','save','update','removeListener'];(function(_0x27df4c,_0x2715f4){var _0x71f61f=function(_0x44e228){while(--_0x44e228){_0x27df4c['push'](_0x27df4c['shift']());}};_0x71f61f(++_0x2715f4);}(_0x1601,0x151));var _0x1160=function(_0x4dd909,_0x407b30){_0x4dd909=_0x4dd909-0x0;var _0x73872=_0x1601[_0x4dd909];return _0x73872;};'use strict';var TeamEvents=require('./team.events');var events=[_0x1160('0x0'),'remove',_0x1160('0x1')];function createListener(_0x5ab7da,_0x3adf1d){return function(_0x5afc50){_0x3adf1d['emit'](_0x5ab7da,_0x5afc50);};}function removeListener(_0x403b07,_0xae5d8a){return function(){TeamEvents[_0x1160('0x2')](_0x403b07,_0xae5d8a);};}exports['register']=function(_0x50e2bf){for(var _0x305897=0x0,_0x154a88=events[_0x1160('0x3')];_0x305897<_0x154a88;_0x305897++){var _0x5cbc51=events[_0x305897];var _0x40e174=createListener('team:'+_0x5cbc51,_0x50e2bf);TeamEvents['on'](_0x5cbc51,_0x40e174);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7c0c219..ff16b29 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7794=['INTEGER','exports'];(function(_0x4034dc,_0x305114){var _0x2c387c=function(_0x3e9c3a){while(--_0x3e9c3a){_0x4034dc['push'](_0x4034dc['shift']());}};_0x2c387c(++_0x305114);}(_0x7794,0x7b));var _0x4779=function(_0x4540d9,_0x448cab){_0x4540d9=_0x4540d9-0x0;var _0x1d6a11=_0x7794[_0x4540d9];return _0x1d6a11;};'use strict';var Sequelize=require('sequelize');module[_0x4779('0x0')]={'TeamId':{'type':Sequelize[_0x4779('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x4779('0x1')]}}; \ No newline at end of file +var _0x834d=['exports','INTEGER','sequelize'];(function(_0x58fb13,_0x3c1350){var _0x210e69=function(_0x1b2c97){while(--_0x1b2c97){_0x58fb13['push'](_0x58fb13['shift']());}};_0x210e69(++_0x3c1350);}(_0x834d,0x140));var _0xd834=function(_0x5e513b,_0x4f363a){_0x5e513b=_0x5e513b-0x0;var _0x7eb087=_0x834d[_0x5e513b];return _0x7eb087;};'use strict';var Sequelize=require(_0xd834('0x0'));module[_0xd834('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd834('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 215cf79..79048dd 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','../../config/logger'];(function(_0x2a6501,_0x9c5a0e){var _0x34d3ae=function(_0x204c8b){while(--_0x204c8b){_0x2a6501['push'](_0x2a6501['shift']());}};_0x34d3ae(++_0x9c5a0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x13ecca,_0xfd4f01){_0x13ecca=_0x13ecca-0x0;var _0x17c3b6=_0xb10b[_0x13ecca];return _0x17c3b6;};'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')]('TeamVoicePrefix',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8286=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x3210f7,_0xecec0e){var _0x32f551=function(_0x1e5b54){while(--_0x1e5b54){_0x3210f7['push'](_0x3210f7['shift']());}};_0x32f551(++_0xecec0e);}(_0x8286,0x66));var _0x6828=function(_0xb129c9,_0x51f85e){_0xb129c9=_0xb129c9-0x0;var _0x50f023=_0x8286[_0xb129c9];return _0x50f023;};'use strict';var _=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var logger=require(_0x6828('0x2'))(_0x6828('0x3'));var moment=require(_0x6828('0x4'));var BPromise=require(_0x6828('0x5'));var rp=require(_0x6828('0x6'));var fs=require('fs');var path=require(_0x6828('0x7'));var rimraf=require(_0x6828('0x8'));var config=require(_0x6828('0x9'));var attributes=require(_0x6828('0xa'));module['exports']=function(_0x31c3d0,_0xe4b9bb){return _0x31c3d0['define'](_0x6828('0xb'),attributes,{'tableName':_0x6828('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 8e66886..7f12911 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x416eed,_0x3a2a24){var _0x325487=function(_0x45656c){while(--_0x45656c){_0x416eed['push'](_0x416eed['shift']());}};_0x325487(++_0x3a2a24);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3f163a,_0x1a2ff4){var _0x2a07a4=function(_0x1e0666){while(--_0x1e0666){_0x3f163a['push'](_0x3f163a['shift']());}};_0x2a07a4(++_0x1a2ff4);}(_0x70e0,0x17b));var _0x070e=function(_0x1c30fd,_0x3bf7bc){_0x1c30fd=_0x1c30fd-0x0;var _0x1e060b=_0x70e0[_0x1c30fd];return _0x1e060b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 8b629b3..f94cfef 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3981=['sequelize','INTEGER'];(function(_0x3db7e4,_0x47dfd9){var _0xaabc7c=function(_0x15607b){while(--_0x15607b){_0x3db7e4['push'](_0x3db7e4['shift']());}};_0xaabc7c(++_0x47dfd9);}(_0x3981,0x144));var _0x1398=function(_0x1de8ea,_0x398e5d){_0x1de8ea=_0x1de8ea-0x0;var _0x3fb05f=_0x3981[_0x1de8ea];return _0x3fb05f;};'use strict';var Sequelize=require(_0x1398('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1398('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4b28=['INTEGER','sequelize','exports'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x4b28,0x121));var _0x84b2=function(_0xd11b94,_0x152cff){_0xd11b94=_0xd11b94-0x0;var _0x4292ba=_0x4b28[_0xd11b94];return _0x4292ba;};'use strict';var Sequelize=require(_0x84b2('0x0'));module[_0x84b2('0x1')]={'penalty':{'type':Sequelize[_0x84b2('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 0c764aa..68b6bb9 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2b3=['team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0xb2b3,0x71));var _0x3b2b=function(_0x3cdc72,_0x29c75c){_0x3cdc72=_0x3cdc72-0x0;var _0x3f3f70=_0xb2b3[_0x3cdc72];return _0x3f3f70;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var logger=require(_0x3b2b('0x2'))(_0x3b2b('0x3'));var moment=require(_0x3b2b('0x4'));var BPromise=require(_0x3b2b('0x5'));var rp=require(_0x3b2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b2b('0x7'));var config=require(_0x3b2b('0x8'));var attributes=require(_0x3b2b('0x9'));module[_0x3b2b('0xa')]=function(_0x2581eb,_0xc53a84){return _0x2581eb[_0x3b2b('0xb')](_0x3b2b('0xc'),attributes,{'tableName':_0x3b2b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa25a=['rimraf','exports','define','TeamVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3873ab,_0x360457){var _0x5238bb=function(_0x3ce9ec){while(--_0x3ce9ec){_0x3873ab['push'](_0x3873ab['shift']());}};_0x5238bb(++_0x360457);}(_0xa25a,0x160));var _0xaa25=function(_0x399dbc,_0x48ada2){_0x399dbc=_0x399dbc-0x0;var _0x586e79=_0xa25a[_0x399dbc];return _0x586e79;};'use strict';var _=require(_0xaa25('0x0'));var util=require(_0xaa25('0x1'));var logger=require(_0xaa25('0x2'))(_0xaa25('0x3'));var moment=require(_0xaa25('0x4'));var BPromise=require(_0xaa25('0x5'));var rp=require(_0xaa25('0x6'));var fs=require('fs');var path=require(_0xaa25('0x7'));var rimraf=require(_0xaa25('0x8'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0xaa25('0x9')]=function(_0x866fa1,_0x51ce9a){return _0x866fa1[_0xaa25('0xa')](_0xaa25('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index be43489..795abb9 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf491=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','ioredis'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xf491,0x178));var _0x1f49=function(_0x17a0dd,_0x422a7c){_0x17a0dd=_0x17a0dd-0x0;var _0x43f02b=_0xf491[_0x17a0dd];return _0x43f02b;};'use strict';var _=require(_0x1f49('0x0'));var util=require(_0x1f49('0x1'));var moment=require(_0x1f49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f49('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f49('0x4'));var logger=require('../../config/logger')(_0x1f49('0x5'));var config=require(_0x1f49('0x6'));var jayson=require(_0x1f49('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe91160,_0x48717d,_0x5ccd6a){return new BPromise(function(_0x59ae42,_0x2a1510){return client[_0x1f49('0x8')](_0xe91160,_0x5ccd6a)[_0x1f49('0x9')](function(_0x51bad6){logger[_0x1f49('0xa')](_0x1f49('0xb'),_0x48717d,_0x1f49('0xc'));logger[_0x1f49('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x48717d,_0x1f49('0xc'),JSON[_0x1f49('0xe')](_0x51bad6));if(_0x51bad6[_0x1f49('0xf')]){if(_0x51bad6[_0x1f49('0xf')]['code']===0x1f4){logger['error'](_0x1f49('0xb'),_0x48717d,_0x51bad6[_0x1f49('0xf')][_0x1f49('0x10')]);return _0x2a1510(_0x51bad6[_0x1f49('0xf')][_0x1f49('0x10')]);}logger[_0x1f49('0xf')](_0x1f49('0xb'),_0x48717d,_0x51bad6[_0x1f49('0xf')][_0x1f49('0x10')]);return _0x59ae42(_0x51bad6[_0x1f49('0xf')]['message']);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x48717d,_0x1f49('0xc'));_0x59ae42(_0x51bad6[_0x1f49('0x11')][_0x1f49('0x10')]);}})[_0x1f49('0x12')](function(_0x5ad5dd){logger['error'](_0x1f49('0xb'),_0x48717d,_0x5ad5dd);_0x2a1510(_0x5ad5dd);});});} \ No newline at end of file +var _0xf9cb=['request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0xf9cb,0xdb));var _0xbf9c=function(_0x21f3bf,_0xfb0f59){_0x21f3bf=_0x21f3bf-0x0;var _0x249d08=_0xf9cb[_0x21f3bf];return _0x249d08;};'use strict';var _=require(_0xbf9c('0x0'));var util=require(_0xbf9c('0x1'));var moment=require(_0xbf9c('0x2'));var BPromise=require(_0xbf9c('0x3'));var rs=require(_0xbf9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf9c('0x5'))['db'];var utils=require(_0xbf9c('0x6'));var logger=require(_0xbf9c('0x7'))('rpc');var config=require(_0xbf9c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x239728,_0x3ba567,_0x2f669e){return new BPromise(function(_0x5d8ca6,_0x1be20f){return client[_0xbf9c('0x9')](_0x239728,_0x2f669e)[_0xbf9c('0xa')](function(_0x352a17){logger[_0xbf9c('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3ba567,_0xbf9c('0xc'));logger[_0xbf9c('0xd')](_0xbf9c('0xe'),_0x3ba567,'request\x20sent',JSON[_0xbf9c('0xf')](_0x352a17));if(_0x352a17[_0xbf9c('0x10')]){if(_0x352a17['error'][_0xbf9c('0x11')]===0x1f4){logger['error'](_0xbf9c('0x12'),_0x3ba567,_0x352a17[_0xbf9c('0x10')]['message']);return _0x1be20f(_0x352a17[_0xbf9c('0x10')][_0xbf9c('0x13')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x3ba567,_0x352a17['error'][_0xbf9c('0x13')]);return _0x5d8ca6(_0x352a17['error'][_0xbf9c('0x13')]);}else{logger['info'](_0xbf9c('0x12'),_0x3ba567,_0xbf9c('0xc'));_0x5d8ca6(_0x352a17[_0xbf9c('0x14')]['message']);}})['catch'](function(_0x54db91){logger[_0xbf9c('0x10')](_0xbf9c('0x12'),_0x3ba567,_0x54db91);_0x1be20f(_0x54db91);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 49759d9..693f296 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 _0xc0d7=['index','/:id','isAuthenticated','post','create','put','update','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x2ea998,_0x5ac2fb){var _0x16b489=function(_0x145f07){while(--_0x145f07){_0x2ea998['push'](_0x2ea998['shift']());}};_0x16b489(++_0x5ac2fb);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x26dbbf,_0x4ac1c7){_0x26dbbf=_0x26dbbf-0x0;var _0x1bba37=_0xc0d7[_0x26dbbf];return _0x1bba37;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c0d('0x0'));var express=require(_0x7c0d('0x1'));var router=express[_0x7c0d('0x2')]();var fs_extra=require(_0x7c0d('0x3'));var auth=require(_0x7c0d('0x4'));var interaction=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var controller=require(_0x7c0d('0x7'));router[_0x7c0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x7c0d('0x9')]);router[_0x7c0d('0x8')](_0x7c0d('0xa'),auth[_0x7c0d('0xb')](),controller['show']);router[_0x7c0d('0xc')]('/',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xd')]);router[_0x7c0d('0xe')]('/:id',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xf')]);router['delete']('/:id',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6bab=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer'];(function(_0x12370d,_0x56f1d6){var _0x4e51ea=function(_0x5ac682){while(--_0x5ac682){_0x12370d['push'](_0x12370d['shift']());}};_0x4e51ea(++_0x56f1d6);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0x6bab[_0x26e727];return _0x563800;};'use strict';var multer=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var path=require(_0xb6ba('0x2'));var timeout=require(_0xb6ba('0x3'));var express=require('express');var router=express[_0xb6ba('0x4')]();var fs_extra=require(_0xb6ba('0x5'));var auth=require(_0xb6ba('0x6'));var interaction=require(_0xb6ba('0x7'));var config=require(_0xb6ba('0x8'));var controller=require('./template.controller');router[_0xb6ba('0x9')]('/',auth['isAuthenticated'](),controller[_0xb6ba('0xa')]);router[_0xb6ba('0x9')](_0xb6ba('0xb'),auth[_0xb6ba('0xc')](),controller[_0xb6ba('0xd')]);router[_0xb6ba('0xe')]('/',auth[_0xb6ba('0xc')](),controller[_0xb6ba('0xf')]);router[_0xb6ba('0x10')]('/:id',auth[_0xb6ba('0xc')](),controller['update']);router['delete']('/:id',auth[_0xb6ba('0xc')](),controller[_0xb6ba('0x11')]);module[_0xb6ba('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 917662d..e6abf4f 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 _0x8219=['sequelize','exports','STRING','TEXT'];(function(_0x1dc73e,_0x792805){var _0x35274b=function(_0x364508){while(--_0x364508){_0x1dc73e['push'](_0x1dc73e['shift']());}};_0x35274b(++_0x792805);}(_0x8219,0x10c));var _0x9821=function(_0x3899cb,_0xb95555){_0x3899cb=_0x3899cb-0x0;var _0x3fe239=_0x8219[_0x3899cb];return _0x3fe239;};'use strict';var Sequelize=require(_0x9821('0x0'));module[_0x9821('0x1')]={'name':{'type':Sequelize[_0x9821('0x2')]},'description':{'type':Sequelize[_0x9821('0x2')]},'html':{'type':Sequelize[_0x9821('0x3')]}}; \ No newline at end of file +var _0x0ca7=['exports','STRING','TEXT','sequelize'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0ca7,0x17f));var _0x70ca=function(_0x5ea529,_0xb364a2){_0x5ea529=_0x5ea529-0x0;var _0x42c1af=_0x0ca7[_0x5ea529];return _0x42c1af;};'use strict';var Sequelize=require(_0x70ca('0x0'));module[_0x70ca('0x1')]={'name':{'type':Sequelize[_0x70ca('0x2')]},'description':{'type':Sequelize[_0x70ca('0x2')]},'html':{'type':Sequelize[_0x70ca('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 2964913..a7a4492 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 _0xb114=['bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','Templates','UserProfileResource','sendStatus','error','stack','name','index','map','Template','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','length','nolimit','order','sort','where','filter','merge','options','includeAll','rows','catch','show','params','keys','fields','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x42ea54,_0x5172f3){var _0x4f6d66=function(_0x1e24c5){while(--_0x1e24c5){_0x42ea54['push'](_0x42ea54['shift']());}};_0x4f6d66(++_0x5172f3);}(_0xb114,0x148));var _0x4b11=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xb114[_0x4b73a2];return _0x383c66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b11('0x0'));var zipdir=require(_0x4b11('0x1'));var jsonpatch=require(_0x4b11('0x2'));var rp=require('request-promise');var moment=require(_0x4b11('0x3'));var BPromise=require(_0x4b11('0x4'));var Mustache=require(_0x4b11('0x5'));var util=require('util');var path=require(_0x4b11('0x6'));var sox=require(_0x4b11('0x7'));var csv=require(_0x4b11('0x8'));var ejs=require(_0x4b11('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b11('0xa'));var squel=require('squel');var crypto=require(_0x4b11('0xb'));var jsforce=require(_0x4b11('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4b11('0x8'));var querystring=require(_0x4b11('0xd'));var Papa=require(_0x4b11('0xe'));var Redis=require(_0x4b11('0xf'));var authService=require(_0x4b11('0x10'));var qs=require(_0x4b11('0x11'));var as=require(_0x4b11('0x12'));var hardwareService=require(_0x4b11('0x13'));var logger=require(_0x4b11('0x14'))(_0x4b11('0x15'));var utils=require(_0x4b11('0x16'));var config=require(_0x4b11('0x17'));var licenseUtil=require(_0x4b11('0x18'));var db=require(_0x4b11('0x19'))['db'];function respondWithStatusCode(_0x7fd156,_0x4712e4){_0x4712e4=_0x4712e4||0xcc;return function(_0x229e22){if(_0x229e22){return _0x7fd156['sendStatus'](_0x4712e4);}return _0x7fd156[_0x4b11('0x1a')](_0x4712e4)[_0x4b11('0x1b')]();};}function respondWithResult(_0x15bfc6,_0x4c8073){_0x4c8073=_0x4c8073||0xc8;return function(_0x421974){if(_0x421974){return _0x15bfc6['status'](_0x4c8073)[_0x4b11('0x1c')](_0x421974);}};}function respondWithFilteredResult(_0x321090,_0x3700f9){return function(_0x4a2833){if(_0x4a2833){var _0x10b0aa=typeof _0x3700f9[_0x4b11('0x1d')]==='undefined'&&typeof _0x3700f9[_0x4b11('0x1e')]==='undefined';var _0x36cbac=_0x4a2833[_0x4b11('0x1f')];var _0x5ce19f=_0x10b0aa?0x0:_0x3700f9[_0x4b11('0x1d')];var _0x2f2f53=_0x10b0aa?_0x4a2833[_0x4b11('0x1f')]:_0x3700f9[_0x4b11('0x1d')]+_0x3700f9[_0x4b11('0x1e')];var _0x452f3b;if(_0x2f2f53>=_0x36cbac){_0x2f2f53=_0x36cbac;_0x452f3b=0xc8;}else{_0x452f3b=0xce;}_0x321090[_0x4b11('0x1a')](_0x452f3b);return _0x321090[_0x4b11('0x20')](_0x4b11('0x21'),_0x5ce19f+'-'+_0x2f2f53+'/'+_0x36cbac)[_0x4b11('0x1c')](_0x4a2833);}return null;};}function patchUpdates(_0x5750cf){return function(_0x4e15d8){try{jsonpatch[_0x4b11('0x22')](_0x4e15d8,_0x5750cf,!![]);}catch(_0xdc62c){return BPromise[_0x4b11('0x23')](_0xdc62c);}return _0x4e15d8[_0x4b11('0x24')]();};}function saveUpdates(_0x1e12a1,_0x2e4d7e){return function(_0x423eb1){if(_0x423eb1){return _0x423eb1[_0x4b11('0x25')](_0x1e12a1)[_0x4b11('0x26')](function(_0x393168){return _0x393168;});}return null;};}function removeEntity(_0x9f9edb,_0x2129da){return function(_0x14568b){if(_0x14568b){return _0x14568b['destroy']()[_0x4b11('0x26')](function(){var _0x4e17b1=_0x14568b[_0x4b11('0x27')]({'plain':!![]});var _0x1a9c56=_0x4b11('0x28');return db[_0x4b11('0x29')]['destroy']({'where':{'type':_0x1a9c56,'resourceId':_0x4e17b1['id']}})[_0x4b11('0x26')](function(){return _0x14568b;});})[_0x4b11('0x26')](function(){_0x9f9edb[_0x4b11('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c478d,_0x37480a){return function(_0x1d7a63){if(!_0x1d7a63){_0x1c478d[_0x4b11('0x2a')](0x194);}return _0x1d7a63;};}function handleError(_0x2f7322,_0x7873fb){_0x7873fb=_0x7873fb||0x1f4;return function(_0x1acac8){logger[_0x4b11('0x2b')](_0x1acac8[_0x4b11('0x2c')]);if(_0x1acac8[_0x4b11('0x2d')]){delete _0x1acac8['name'];}_0x2f7322['status'](_0x7873fb)['send'](_0x1acac8);};}exports[_0x4b11('0x2e')]=function(_0x2ddec0,_0x317c5){var _0x265def={},_0x3a89a1={},_0x1bda35={'count':0x0,'rows':[]};var _0x29d89c=_[_0x4b11('0x2f')](db[_0x4b11('0x30')][_0x4b11('0x31')],function(_0xa597c9){return{'name':_0xa597c9[_0x4b11('0x32')],'type':_0xa597c9[_0x4b11('0x33')][_0x4b11('0x34')]};});_0x3a89a1['model']=_[_0x4b11('0x2f')](_0x29d89c,_0x4b11('0x2d'));_0x3a89a1['query']=_['keys'](_0x2ddec0[_0x4b11('0x35')]);_0x3a89a1[_0x4b11('0x36')]=_[_0x4b11('0x37')](_0x3a89a1['model'],_0x3a89a1[_0x4b11('0x35')]);_0x265def[_0x4b11('0x38')]=_[_0x4b11('0x37')](_0x3a89a1[_0x4b11('0x39')],qs['fields'](_0x2ddec0[_0x4b11('0x35')]['fields']));_0x265def[_0x4b11('0x38')]=_0x265def[_0x4b11('0x38')][_0x4b11('0x3a')]?_0x265def['attributes']:_0x3a89a1[_0x4b11('0x39')];if(!_0x2ddec0[_0x4b11('0x35')]['hasOwnProperty'](_0x4b11('0x3b'))){_0x265def['limit']=qs[_0x4b11('0x1e')](_0x2ddec0[_0x4b11('0x35')]['limit']);_0x265def[_0x4b11('0x1d')]=qs[_0x4b11('0x1d')](_0x2ddec0['query']['offset']);}_0x265def[_0x4b11('0x3c')]=qs[_0x4b11('0x3d')](_0x2ddec0[_0x4b11('0x35')][_0x4b11('0x3d')]);_0x265def[_0x4b11('0x3e')]=qs[_0x4b11('0x36')](_['pick'](_0x2ddec0[_0x4b11('0x35')],_0x3a89a1[_0x4b11('0x36')]),_0x29d89c);if(_0x2ddec0['query'][_0x4b11('0x3f')]){_0x265def[_0x4b11('0x3e')]=_['merge'](_0x265def[_0x4b11('0x3e')],{'$or':_['map'](_0x29d89c,function(_0x3c4639){if(_0x3c4639[_0x4b11('0x33')]!=='VIRTUAL'){var _0x458e74={};_0x458e74[_0x3c4639[_0x4b11('0x2d')]]={'$like':'%'+_0x2ddec0[_0x4b11('0x35')][_0x4b11('0x3f')]+'%'};return _0x458e74;}})});}_0x265def=_[_0x4b11('0x40')]({},_0x265def,_0x2ddec0[_0x4b11('0x41')]);var _0x3b7423={'where':_0x265def[_0x4b11('0x3e')]};return db['Template']['count'](_0x3b7423)['then'](function(_0x225a23){_0x1bda35[_0x4b11('0x1f')]=_0x225a23;if(_0x2ddec0['query'][_0x4b11('0x42')]){_0x265def['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x265def);})['then'](function(_0x175887){_0x1bda35[_0x4b11('0x43')]=_0x175887;return _0x1bda35;})[_0x4b11('0x26')](respondWithFilteredResult(_0x317c5,_0x265def))[_0x4b11('0x44')](handleError(_0x317c5,null));};exports[_0x4b11('0x45')]=function(_0x2ba8e3,_0x227280){var _0x185f03={'raw':!![],'where':{'id':_0x2ba8e3[_0x4b11('0x46')]['id']}},_0x135865={};_0x135865['model']=_[_0x4b11('0x47')](db[_0x4b11('0x30')][_0x4b11('0x31')]);_0x135865[_0x4b11('0x35')]=_[_0x4b11('0x47')](_0x2ba8e3[_0x4b11('0x35')]);_0x135865[_0x4b11('0x36')]=_[_0x4b11('0x37')](_0x135865[_0x4b11('0x39')],_0x135865[_0x4b11('0x35')]);_0x185f03['attributes']=_[_0x4b11('0x37')](_0x135865[_0x4b11('0x39')],qs[_0x4b11('0x48')](_0x2ba8e3[_0x4b11('0x35')][_0x4b11('0x48')]));_0x185f03[_0x4b11('0x38')]=_0x185f03[_0x4b11('0x38')][_0x4b11('0x3a')]?_0x185f03[_0x4b11('0x38')]:_0x135865['model'];if(_0x2ba8e3['query'][_0x4b11('0x42')]){_0x185f03[_0x4b11('0x49')]=[{'all':!![]}];}_0x185f03=_[_0x4b11('0x40')]({},_0x185f03,_0x2ba8e3[_0x4b11('0x41')]);return db[_0x4b11('0x30')]['find'](_0x185f03)[_0x4b11('0x26')](handleEntityNotFound(_0x227280,null))[_0x4b11('0x26')](respondWithResult(_0x227280,null))[_0x4b11('0x44')](handleError(_0x227280,null));};exports[_0x4b11('0x4a')]=function(_0x323ff2,_0xe23e29){return db['Template'][_0x4b11('0x4a')](_0x323ff2['body'],{})['then'](function(_0x3204e1){var _0x5dc9ce=_0x323ff2[_0x4b11('0x4b')][_0x4b11('0x27')]({'plain':!![]});if(!_0x5dc9ce)throw new Error(_0x4b11('0x4c'));if(_0x5dc9ce[_0x4b11('0x4d')]===_0x4b11('0x4b')){var _0x3c4dce=_0x3204e1[_0x4b11('0x27')]({'plain':!![]});var _0x3f12a3=_0x4b11('0x28');return db['UserProfileSection'][_0x4b11('0x4e')]({'where':{'name':_0x3f12a3,'userProfileId':_0x5dc9ce[_0x4b11('0x4f')]},'raw':!![]})['then'](function(_0x11df35){if(_0x11df35&&_0x11df35['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3c4dce[_0x4b11('0x2d')],'resourceId':_0x3c4dce['id'],'type':_0x11df35['name'],'sectionId':_0x11df35['id']},{})['then'](function(){return _0x3204e1;});}else{return _0x3204e1;}})[_0x4b11('0x44')](function(_0x50d331){logger[_0x4b11('0x2b')](_0x4b11('0x50'),_0x50d331);throw _0x50d331;});}return _0x3204e1;})['then'](respondWithResult(_0xe23e29,0xc9))[_0x4b11('0x44')](handleError(_0xe23e29,null));};exports[_0x4b11('0x25')]=function(_0x19f2e3,_0x17a343){if(_0x19f2e3[_0x4b11('0x51')]['id']){delete _0x19f2e3[_0x4b11('0x51')]['id'];}return db[_0x4b11('0x30')][_0x4b11('0x4e')]({'where':{'id':_0x19f2e3[_0x4b11('0x46')]['id']}})[_0x4b11('0x26')](handleEntityNotFound(_0x17a343,null))[_0x4b11('0x26')](saveUpdates(_0x19f2e3['body'],null))['then'](respondWithResult(_0x17a343,null))[_0x4b11('0x44')](handleError(_0x17a343,null));};exports[_0x4b11('0x52')]=function(_0x51b23b,_0x10776a){return db[_0x4b11('0x30')][_0x4b11('0x4e')]({'where':{'id':_0x51b23b['params']['id']}})[_0x4b11('0x26')](handleEntityNotFound(_0x10776a,null))[_0x4b11('0x26')](removeEntity(_0x10776a,null))['catch'](handleError(_0x10776a,null));}; \ No newline at end of file +var _0xb6c2=['stack','name','send','index','map','Template','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','status'];(function(_0x141adb,_0x1116e0){var _0x25bcc2=function(_0x4baee2){while(--_0x4baee2){_0x141adb['push'](_0x141adb['shift']());}};_0x25bcc2(++_0x1116e0);}(_0xb6c2,0x131));var _0x2b6c=function(_0x3c7cf0,_0x81feb7){_0x3c7cf0=_0x3c7cf0-0x0;var _0x2ddb7e=_0xb6c2[_0x3c7cf0];return _0x2ddb7e;};'use strict';var emlformat=require(_0x2b6c('0x0'));var rimraf=require(_0x2b6c('0x1'));var zipdir=require(_0x2b6c('0x2'));var jsonpatch=require(_0x2b6c('0x3'));var rp=require(_0x2b6c('0x4'));var moment=require(_0x2b6c('0x5'));var BPromise=require(_0x2b6c('0x6'));var Mustache=require(_0x2b6c('0x7'));var util=require(_0x2b6c('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2b6c('0x9'));var fs=require('fs');var fs_extra=require(_0x2b6c('0xa'));var _=require(_0x2b6c('0xb'));var squel=require(_0x2b6c('0xc'));var crypto=require('crypto');var jsforce=require(_0x2b6c('0xd'));var deskjs=require(_0x2b6c('0xe'));var toCsv=require(_0x2b6c('0xf'));var querystring=require(_0x2b6c('0x10'));var Papa=require(_0x2b6c('0x11'));var Redis=require(_0x2b6c('0x12'));var authService=require(_0x2b6c('0x13'));var qs=require(_0x2b6c('0x14'));var as=require(_0x2b6c('0x15'));var hardwareService=require(_0x2b6c('0x16'));var logger=require(_0x2b6c('0x17'))(_0x2b6c('0x18'));var utils=require(_0x2b6c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2b6c('0x1a'));var db=require(_0x2b6c('0x1b'))['db'];function respondWithStatusCode(_0x35b2d3,_0x97d461){_0x97d461=_0x97d461||0xcc;return function(_0x11d696){if(_0x11d696){return _0x35b2d3[_0x2b6c('0x1c')](_0x97d461);}return _0x35b2d3['status'](_0x97d461)[_0x2b6c('0x1d')]();};}function respondWithResult(_0x323e80,_0x59ba94){_0x59ba94=_0x59ba94||0xc8;return function(_0x3b1c04){if(_0x3b1c04){return _0x323e80['status'](_0x59ba94)[_0x2b6c('0x1e')](_0x3b1c04);}};}function respondWithFilteredResult(_0x524b3a,_0x56ca7f){return function(_0x2ede2f){if(_0x2ede2f){var _0x219439=typeof _0x56ca7f[_0x2b6c('0x1f')]===_0x2b6c('0x20')&&typeof _0x56ca7f['limit']===_0x2b6c('0x20');var _0x464009=_0x2ede2f[_0x2b6c('0x21')];var _0x22a39d=_0x219439?0x0:_0x56ca7f[_0x2b6c('0x1f')];var _0x572448=_0x219439?_0x2ede2f['count']:_0x56ca7f['offset']+_0x56ca7f[_0x2b6c('0x22')];var _0x4f4c1a;if(_0x572448>=_0x464009){_0x572448=_0x464009;_0x4f4c1a=0xc8;}else{_0x4f4c1a=0xce;}_0x524b3a['status'](_0x4f4c1a);return _0x524b3a[_0x2b6c('0x23')](_0x2b6c('0x24'),_0x22a39d+'-'+_0x572448+'/'+_0x464009)[_0x2b6c('0x1e')](_0x2ede2f);}return null;};}function patchUpdates(_0x3f193c){return function(_0x5b0796){try{jsonpatch[_0x2b6c('0x25')](_0x5b0796,_0x3f193c,!![]);}catch(_0x3317c1){return BPromise[_0x2b6c('0x26')](_0x3317c1);}return _0x5b0796[_0x2b6c('0x27')]();};}function saveUpdates(_0x31c831,_0xe75d16){return function(_0x197e42){if(_0x197e42){return _0x197e42[_0x2b6c('0x28')](_0x31c831)[_0x2b6c('0x29')](function(_0x3499b6){return _0x3499b6;});}return null;};}function removeEntity(_0x357616,_0x37b76c){return function(_0x1eed2e){if(_0x1eed2e){return _0x1eed2e[_0x2b6c('0x2a')]()[_0x2b6c('0x29')](function(){var _0x31f128=_0x1eed2e[_0x2b6c('0x2b')]({'plain':!![]});var _0x39bbcb=_0x2b6c('0x2c');return db[_0x2b6c('0x2d')][_0x2b6c('0x2a')]({'where':{'type':_0x39bbcb,'resourceId':_0x31f128['id']}})['then'](function(){return _0x1eed2e;});})[_0x2b6c('0x29')](function(){_0x357616[_0x2b6c('0x2e')](0xcc)[_0x2b6c('0x1d')]();});}};}function handleEntityNotFound(_0x281c31,_0x1f03b0){return function(_0x36e692){if(!_0x36e692){_0x281c31[_0x2b6c('0x1c')](0x194);}return _0x36e692;};}function handleError(_0x482254,_0x5a3878){_0x5a3878=_0x5a3878||0x1f4;return function(_0xcdb359){logger['error'](_0xcdb359[_0x2b6c('0x2f')]);if(_0xcdb359[_0x2b6c('0x30')]){delete _0xcdb359[_0x2b6c('0x30')];}_0x482254[_0x2b6c('0x2e')](_0x5a3878)[_0x2b6c('0x31')](_0xcdb359);};}exports[_0x2b6c('0x32')]=function(_0x1105b7,_0x31394b){var _0x50b5f5={},_0x184e30={},_0x2611b4={'count':0x0,'rows':[]};var _0x23867a=_[_0x2b6c('0x33')](db[_0x2b6c('0x34')]['rawAttributes'],function(_0xefd3ed){return{'name':_0xefd3ed[_0x2b6c('0x35')],'type':_0xefd3ed[_0x2b6c('0x36')]['key']};});_0x184e30[_0x2b6c('0x37')]=_['map'](_0x23867a,_0x2b6c('0x30'));_0x184e30[_0x2b6c('0x38')]=_[_0x2b6c('0x39')](_0x1105b7[_0x2b6c('0x38')]);_0x184e30[_0x2b6c('0x3a')]=_['intersection'](_0x184e30[_0x2b6c('0x37')],_0x184e30['query']);_0x50b5f5[_0x2b6c('0x3b')]=_[_0x2b6c('0x3c')](_0x184e30[_0x2b6c('0x37')],qs['fields'](_0x1105b7[_0x2b6c('0x38')]['fields']));_0x50b5f5[_0x2b6c('0x3b')]=_0x50b5f5['attributes'][_0x2b6c('0x3d')]?_0x50b5f5[_0x2b6c('0x3b')]:_0x184e30[_0x2b6c('0x37')];if(!_0x1105b7[_0x2b6c('0x38')][_0x2b6c('0x3e')](_0x2b6c('0x3f'))){_0x50b5f5[_0x2b6c('0x22')]=qs[_0x2b6c('0x22')](_0x1105b7[_0x2b6c('0x38')][_0x2b6c('0x22')]);_0x50b5f5[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x1105b7[_0x2b6c('0x38')]['offset']);}_0x50b5f5[_0x2b6c('0x40')]=qs['sort'](_0x1105b7[_0x2b6c('0x38')][_0x2b6c('0x41')]);_0x50b5f5[_0x2b6c('0x42')]=qs[_0x2b6c('0x3a')](_['pick'](_0x1105b7[_0x2b6c('0x38')],_0x184e30[_0x2b6c('0x3a')]),_0x23867a);if(_0x1105b7[_0x2b6c('0x38')][_0x2b6c('0x43')]){_0x50b5f5[_0x2b6c('0x42')]=_[_0x2b6c('0x44')](_0x50b5f5[_0x2b6c('0x42')],{'$or':_['map'](_0x23867a,function(_0x56d3af){if(_0x56d3af[_0x2b6c('0x36')]!==_0x2b6c('0x45')){var _0x24c04d={};_0x24c04d[_0x56d3af[_0x2b6c('0x30')]]={'$like':'%'+_0x1105b7[_0x2b6c('0x38')]['filter']+'%'};return _0x24c04d;}})});}_0x50b5f5=_[_0x2b6c('0x44')]({},_0x50b5f5,_0x1105b7[_0x2b6c('0x46')]);var _0x339700={'where':_0x50b5f5['where']};return db[_0x2b6c('0x34')][_0x2b6c('0x21')](_0x339700)[_0x2b6c('0x29')](function(_0x1bb413){_0x2611b4['count']=_0x1bb413;if(_0x1105b7[_0x2b6c('0x38')][_0x2b6c('0x47')]){_0x50b5f5[_0x2b6c('0x48')]=[{'all':!![]}];}return db['Template'][_0x2b6c('0x49')](_0x50b5f5);})['then'](function(_0x343349){_0x2611b4[_0x2b6c('0x4a')]=_0x343349;return _0x2611b4;})[_0x2b6c('0x29')](respondWithFilteredResult(_0x31394b,_0x50b5f5))[_0x2b6c('0x4b')](handleError(_0x31394b,null));};exports[_0x2b6c('0x4c')]=function(_0xb1b7c9,_0x42d90f){var _0x1ab18c={'raw':!![],'where':{'id':_0xb1b7c9[_0x2b6c('0x4d')]['id']}},_0xd10220={};_0xd10220['model']=_['keys'](db[_0x2b6c('0x34')]['rawAttributes']);_0xd10220['query']=_['keys'](_0xb1b7c9[_0x2b6c('0x38')]);_0xd10220[_0x2b6c('0x3a')]=_[_0x2b6c('0x3c')](_0xd10220[_0x2b6c('0x37')],_0xd10220[_0x2b6c('0x38')]);_0x1ab18c[_0x2b6c('0x3b')]=_[_0x2b6c('0x3c')](_0xd10220[_0x2b6c('0x37')],qs[_0x2b6c('0x4e')](_0xb1b7c9['query'][_0x2b6c('0x4e')]));_0x1ab18c['attributes']=_0x1ab18c[_0x2b6c('0x3b')][_0x2b6c('0x3d')]?_0x1ab18c['attributes']:_0xd10220[_0x2b6c('0x37')];if(_0xb1b7c9['query'][_0x2b6c('0x47')]){_0x1ab18c[_0x2b6c('0x48')]=[{'all':!![]}];}_0x1ab18c=_[_0x2b6c('0x44')]({},_0x1ab18c,_0xb1b7c9[_0x2b6c('0x46')]);return db['Template'][_0x2b6c('0x4f')](_0x1ab18c)[_0x2b6c('0x29')](handleEntityNotFound(_0x42d90f,null))['then'](respondWithResult(_0x42d90f,null))[_0x2b6c('0x4b')](handleError(_0x42d90f,null));};exports[_0x2b6c('0x50')]=function(_0x4bd28b,_0x445fe9){return db['Template'][_0x2b6c('0x50')](_0x4bd28b[_0x2b6c('0x51')],{})[_0x2b6c('0x29')](function(_0x5e90ab){var _0x98f37b=_0x4bd28b[_0x2b6c('0x52')]['get']({'plain':!![]});if(!_0x98f37b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x98f37b[_0x2b6c('0x53')]===_0x2b6c('0x52')){var _0xb27769=_0x5e90ab['get']({'plain':!![]});var _0x46447f=_0x2b6c('0x2c');return db[_0x2b6c('0x54')][_0x2b6c('0x4f')]({'where':{'name':_0x46447f,'userProfileId':_0x98f37b[_0x2b6c('0x55')]},'raw':!![]})[_0x2b6c('0x29')](function(_0x11d0e0){if(_0x11d0e0&&_0x11d0e0['autoAssociation']===0x0){return db[_0x2b6c('0x2d')][_0x2b6c('0x50')]({'name':_0xb27769[_0x2b6c('0x30')],'resourceId':_0xb27769['id'],'type':_0x11d0e0['name'],'sectionId':_0x11d0e0['id']},{})[_0x2b6c('0x29')](function(){return _0x5e90ab;});}else{return _0x5e90ab;}})[_0x2b6c('0x4b')](function(_0x28fe9b){logger[_0x2b6c('0x56')](_0x2b6c('0x57'),_0x28fe9b);throw _0x28fe9b;});}return _0x5e90ab;})[_0x2b6c('0x29')](respondWithResult(_0x445fe9,0xc9))[_0x2b6c('0x4b')](handleError(_0x445fe9,null));};exports[_0x2b6c('0x28')]=function(_0x4fc261,_0x59bb67){if(_0x4fc261[_0x2b6c('0x51')]['id']){delete _0x4fc261['body']['id'];}return db['Template']['find']({'where':{'id':_0x4fc261[_0x2b6c('0x4d')]['id']}})[_0x2b6c('0x29')](handleEntityNotFound(_0x59bb67,null))['then'](saveUpdates(_0x4fc261[_0x2b6c('0x51')],null))[_0x2b6c('0x29')](respondWithResult(_0x59bb67,null))[_0x2b6c('0x4b')](handleError(_0x59bb67,null));};exports[_0x2b6c('0x2a')]=function(_0x2a475b,_0x1ad447){return db['Template'][_0x2b6c('0x4f')]({'where':{'id':_0x2a475b['params']['id']}})[_0x2b6c('0x29')](handleEntityNotFound(_0x1ad447,null))[_0x2b6c('0x29')](removeEntity(_0x1ad447,null))[_0x2b6c('0x4b')](handleError(_0x1ad447,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 26f1ef9..4d2675c 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 _0xba21=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_templates','lodash','util','../../config/logger'];(function(_0x13fef6,_0x14c5ba){var _0xbeb461=function(_0x1cd5d3){while(--_0x1cd5d3){_0x13fef6['push'](_0x13fef6['shift']());}};_0xbeb461(++_0x14c5ba);}(_0xba21,0xc9));var _0x1ba2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xba21[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1ba2('0x0'));var util=require(_0x1ba2('0x1'));var logger=require(_0x1ba2('0x2'))(_0x1ba2('0x3'));var moment=require('moment');var BPromise=require(_0x1ba2('0x4'));var rp=require(_0x1ba2('0x5'));var fs=require('fs');var path=require(_0x1ba2('0x6'));var rimraf=require(_0x1ba2('0x7'));var config=require(_0x1ba2('0x8'));var attributes=require('./template.attributes');module[_0x1ba2('0x9')]=function(_0x2aebe9,_0x15780c){return _0x2aebe9[_0x1ba2('0xa')]('Template',attributes,{'tableName':_0x1ba2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1de2=['tools_templates','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Template'];(function(_0xc7f289,_0x5cc966){var _0x527f3d=function(_0x764e45){while(--_0x764e45){_0xc7f289['push'](_0xc7f289['shift']());}};_0x527f3d(++_0x5cc966);}(_0x1de2,0x1a1));var _0x21de=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1de2[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x21de('0x0'));var util=require(_0x21de('0x1'));var logger=require(_0x21de('0x2'))(_0x21de('0x3'));var moment=require(_0x21de('0x4'));var BPromise=require('bluebird');var rp=require(_0x21de('0x5'));var fs=require('fs');var path=require(_0x21de('0x6'));var rimraf=require(_0x21de('0x7'));var config=require(_0x21de('0x8'));var attributes=require('./template.attributes');module[_0x21de('0x9')]=function(_0x2d2907,_0x31e07c){return _0x2d2907[_0x21de('0xa')](_0x21de('0xb'),attributes,{'tableName':_0x21de('0xc'),'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 647fa62..e9c065b 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 _0x6f12=['stringify','error','message','catch','Template','findAll','options','raw','attributes','limit','include','map','model','GetTemplate','debug','util','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s'];(function(_0x4889b7,_0x488d76){var _0xc8f8af=function(_0xd54d9d){while(--_0xd54d9d){_0x4889b7['push'](_0x4889b7['shift']());}};_0xc8f8af(++_0x488d76);}(_0x6f12,0x17b));var _0x26f1=function(_0x2a67f9,_0x4c168b){_0x2a67f9=_0x2a67f9-0x0;var _0xa9afc=_0x6f12[_0x2a67f9];return _0xa9afc;};'use strict';var _=require('lodash');var util=require(_0x26f1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26f1('0x1'))['db'];var utils=require(_0x26f1('0x2'));var logger=require(_0x26f1('0x3'))(_0x26f1('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x26f1('0x5')][_0x26f1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x544e35,_0x5b7237,_0x32dcad){return new BPromise(function(_0x31e1de,_0x1374bc){return client[_0x26f1('0x7')](_0x544e35,_0x32dcad)[_0x26f1('0x8')](function(_0x4acf1d){logger[_0x26f1('0x9')](_0x26f1('0xa'),_0x5b7237,_0x26f1('0xb'));logger['debug'](_0x26f1('0xc'),_0x5b7237,_0x26f1('0xb'),JSON[_0x26f1('0xd')](_0x4acf1d));if(_0x4acf1d['error']){if(_0x4acf1d[_0x26f1('0xe')]['code']===0x1f4){logger[_0x26f1('0xe')](_0x26f1('0xa'),_0x5b7237,_0x4acf1d[_0x26f1('0xe')][_0x26f1('0xf')]);return _0x1374bc(_0x4acf1d[_0x26f1('0xe')][_0x26f1('0xf')]);}logger[_0x26f1('0xe')]('Template,\x20%s,\x20%s',_0x5b7237,_0x4acf1d[_0x26f1('0xe')]['message']);return _0x31e1de(_0x4acf1d[_0x26f1('0xe')][_0x26f1('0xf')]);}else{logger[_0x26f1('0x9')](_0x26f1('0xa'),_0x5b7237,'request\x20sent');_0x31e1de(_0x4acf1d['result'][_0x26f1('0xf')]);}})[_0x26f1('0x10')](function(_0x51e7ca){logger[_0x26f1('0xe')](_0x26f1('0xa'),_0x5b7237,_0x51e7ca);_0x1374bc(_0x51e7ca);});});}exports['GetTemplate']=function(_0x44bca5){var _0x15266e=this;return new Promise(function(_0x4fe591,_0x4420d9){return db[_0x26f1('0x11')][_0x26f1('0x12')]({'raw':_0x44bca5[_0x26f1('0x13')]?_0x44bca5[_0x26f1('0x13')][_0x26f1('0x14')]===undefined?!![]:![]:!![],'where':_0x44bca5[_0x26f1('0x13')]?_0x44bca5[_0x26f1('0x13')]['where']||null:null,'attributes':_0x44bca5['options']?_0x44bca5[_0x26f1('0x13')][_0x26f1('0x15')]||null:null,'limit':_0x44bca5[_0x26f1('0x13')]?_0x44bca5['options'][_0x26f1('0x16')]||null:null,'include':_0x44bca5['options']?_0x44bca5[_0x26f1('0x13')]['include']?_['map'](_0x44bca5[_0x26f1('0x13')]['include'],function(_0x5b569c){return{'model':db[_0x5b569c['model']],'as':_0x5b569c['as'],'attributes':_0x5b569c[_0x26f1('0x15')],'include':_0x5b569c[_0x26f1('0x17')]?_[_0x26f1('0x18')](_0x5b569c[_0x26f1('0x17')],function(_0x26fdd4){return{'model':db[_0x26fdd4['model']],'as':_0x26fdd4['as'],'attributes':_0x26fdd4['attributes'],'include':_0x26fdd4[_0x26f1('0x17')]?_[_0x26f1('0x18')](_0x26fdd4[_0x26f1('0x17')],function(_0x5b0ccd){return{'model':db[_0x5b0ccd[_0x26f1('0x19')]],'as':_0x5b0ccd['as'],'attributes':_0x5b0ccd[_0x26f1('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf19f49){logger[_0x26f1('0x9')](_0x26f1('0x1a'),_0x44bca5);logger[_0x26f1('0x1b')](_0x26f1('0x1a'),_0x44bca5,JSON[_0x26f1('0xd')](_0xf19f49));_0x4fe591(_0xf19f49);})[_0x26f1('0x10')](function(_0x15b6d7){logger[_0x26f1('0xe')]('GetTemplate',_0x15b6d7[_0x26f1('0xf')],_0x44bca5);_0x4420d9(_0x15266e[_0x26f1('0xe')](0x1f4,_0x15b6d7[_0x26f1('0xf')]));});});}; \ No newline at end of file +var _0x6b6d=['then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','limit','include','map','model','attributes'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x6b6d,0xb1));var _0xd6b6=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x6b6d[_0x4b91c4];return _0x25cb80;};'use strict';var _=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var moment=require(_0xd6b6('0x2'));var BPromise=require(_0xd6b6('0x3'));var rs=require(_0xd6b6('0x4'));var fs=require('fs');var Redis=require(_0xd6b6('0x5'));var db=require(_0xd6b6('0x6'))['db'];var utils=require(_0xd6b6('0x7'));var logger=require(_0xd6b6('0x8'))(_0xd6b6('0x9'));var config=require(_0xd6b6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd6b6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa6c1,_0x381e97,_0x416f64){return new BPromise(function(_0x3bb835,_0x1dce6e){return client[_0xd6b6('0xc')](_0x4aa6c1,_0x416f64)['then'](function(_0x413310){logger[_0xd6b6('0xd')](_0xd6b6('0xe'),_0x381e97,'request\x20sent');logger[_0xd6b6('0xf')](_0xd6b6('0x10'),_0x381e97,_0xd6b6('0x11'),JSON['stringify'](_0x413310));if(_0x413310[_0xd6b6('0x12')]){if(_0x413310[_0xd6b6('0x12')][_0xd6b6('0x13')]===0x1f4){logger[_0xd6b6('0x12')](_0xd6b6('0xe'),_0x381e97,_0x413310[_0xd6b6('0x12')][_0xd6b6('0x14')]);return _0x1dce6e(_0x413310[_0xd6b6('0x12')]['message']);}logger[_0xd6b6('0x12')](_0xd6b6('0xe'),_0x381e97,_0x413310[_0xd6b6('0x12')]['message']);return _0x3bb835(_0x413310['error'][_0xd6b6('0x14')]);}else{logger[_0xd6b6('0xd')](_0xd6b6('0xe'),_0x381e97,_0xd6b6('0x11'));_0x3bb835(_0x413310[_0xd6b6('0x15')][_0xd6b6('0x14')]);}})[_0xd6b6('0x16')](function(_0x497fd8){logger[_0xd6b6('0x12')](_0xd6b6('0xe'),_0x381e97,_0x497fd8);_0x1dce6e(_0x497fd8);});});}exports[_0xd6b6('0x17')]=function(_0x52f934){var _0x35558b=this;return new Promise(function(_0x579e9e,_0x2af087){return db[_0xd6b6('0x18')][_0xd6b6('0x19')]({'raw':_0x52f934[_0xd6b6('0x1a')]?_0x52f934[_0xd6b6('0x1a')][_0xd6b6('0x1b')]===undefined?!![]:![]:!![],'where':_0x52f934['options']?_0x52f934[_0xd6b6('0x1a')]['where']||null:null,'attributes':_0x52f934[_0xd6b6('0x1a')]?_0x52f934['options']['attributes']||null:null,'limit':_0x52f934[_0xd6b6('0x1a')]?_0x52f934[_0xd6b6('0x1a')][_0xd6b6('0x1c')]||null:null,'include':_0x52f934[_0xd6b6('0x1a')]?_0x52f934['options'][_0xd6b6('0x1d')]?_[_0xd6b6('0x1e')](_0x52f934[_0xd6b6('0x1a')][_0xd6b6('0x1d')],function(_0x195cb5){return{'model':db[_0x195cb5[_0xd6b6('0x1f')]],'as':_0x195cb5['as'],'attributes':_0x195cb5[_0xd6b6('0x20')],'include':_0x195cb5['include']?_[_0xd6b6('0x1e')](_0x195cb5[_0xd6b6('0x1d')],function(_0x34e24b){return{'model':db[_0x34e24b[_0xd6b6('0x1f')]],'as':_0x34e24b['as'],'attributes':_0x34e24b['attributes'],'include':_0x34e24b[_0xd6b6('0x1d')]?_[_0xd6b6('0x1e')](_0x34e24b[_0xd6b6('0x1d')],function(_0x41db65){return{'model':db[_0x41db65[_0xd6b6('0x1f')]],'as':_0x41db65['as'],'attributes':_0x41db65[_0xd6b6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd6b6('0x21')](function(_0x3d1afb){logger['info']('GetTemplate',_0x52f934);logger['debug'](_0xd6b6('0x17'),_0x52f934,JSON[_0xd6b6('0x22')](_0x3d1afb));_0x579e9e(_0x3d1afb);})['catch'](function(_0xf98c57){logger[_0xd6b6('0x12')](_0xd6b6('0x17'),_0xf98c57[_0xd6b6('0x14')],_0x52f934);_0x2af087(_0x35558b[_0xd6b6('0x12')](0x1f4,_0xf98c57[_0xd6b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 4906335..38e874a 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 _0x4189=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','/:id','show','get','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','update','delete','destroy'];(function(_0x1d757a,_0x50dda6){var _0x118e5a=function(_0x3c8242){while(--_0x3c8242){_0x1d757a['push'](_0x1d757a['shift']());}};_0x118e5a(++_0x50dda6);}(_0x4189,0x160));var _0x9418=function(_0x6e1225,_0xe2a704){_0x6e1225=_0x6e1225-0x0;var _0x36d463=_0x4189[_0x6e1225];return _0x36d463;};'use strict';var multer=require(_0x9418('0x0'));var util=require('util');var path=require(_0x9418('0x1'));var timeout=require(_0x9418('0x2'));var express=require(_0x9418('0x3'));var router=express['Router']();var fs_extra=require(_0x9418('0x4'));var auth=require(_0x9418('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9418('0x6'));var controller=require(_0x9418('0x7'));router['get']('/',auth[_0x9418('0x8')](),controller[_0x9418('0x9')]);router['get'](_0x9418('0xa'),auth[_0x9418('0x8')](),controller[_0x9418('0xb')]);router[_0x9418('0xc')](_0x9418('0xd'),auth[_0x9418('0x8')](),controller[_0x9418('0xe')]);router[_0x9418('0xc')](_0x9418('0xf'),auth[_0x9418('0x8')](),controller['getAnyConditions']);router[_0x9418('0xc')]('/:id/actions',auth[_0x9418('0x8')](),controller[_0x9418('0x10')]);router[_0x9418('0x11')]('/',auth['isAuthenticated'](),controller[_0x9418('0x12')]);router[_0x9418('0x11')](_0x9418('0xd'),auth[_0x9418('0x8')](),controller[_0x9418('0x13')]);router[_0x9418('0x11')](_0x9418('0xf'),auth[_0x9418('0x8')](),controller[_0x9418('0x14')]);router['post'](_0x9418('0x15'),auth['isAuthenticated'](),controller[_0x9418('0x16')]);router['put']('/:id',auth[_0x9418('0x8')](),controller[_0x9418('0x17')]);router[_0x9418('0x18')](_0x9418('0xa'),auth[_0x9418('0x8')](),controller[_0x9418('0x19')]);module[_0x9418('0x1a')]=router; \ No newline at end of file +var _0xb2ca=['../../config/environment','isAuthenticated','index','get','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAction','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3df1e9,_0x3cd30e){var _0xd6b371=function(_0x4b5457){while(--_0x4b5457){_0x3df1e9['push'](_0x3df1e9['shift']());}};_0xd6b371(++_0x3cd30e);}(_0xb2ca,0x1a8));var _0xab2c=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb2ca[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0xab2c('0x0'));var util=require(_0xab2c('0x1'));var path=require('path');var timeout=require(_0xab2c('0x2'));var express=require(_0xab2c('0x3'));var router=express[_0xab2c('0x4')]();var fs_extra=require(_0xab2c('0x5'));var auth=require(_0xab2c('0x6'));var interaction=require(_0xab2c('0x7'));var config=require(_0xab2c('0x8'));var controller=require('./trigger.controller');router['get']('/',auth[_0xab2c('0x9')](),controller[_0xab2c('0xa')]);router[_0xab2c('0xb')]('/:id',auth[_0xab2c('0x9')](),controller[_0xab2c('0xc')]);router[_0xab2c('0xb')](_0xab2c('0xd'),auth[_0xab2c('0x9')](),controller[_0xab2c('0xe')]);router['get'](_0xab2c('0xf'),auth[_0xab2c('0x9')](),controller[_0xab2c('0x10')]);router[_0xab2c('0xb')](_0xab2c('0x11'),auth[_0xab2c('0x9')](),controller[_0xab2c('0x12')]);router[_0xab2c('0x13')]('/',auth[_0xab2c('0x9')](),controller['create']);router['post'](_0xab2c('0xd'),auth[_0xab2c('0x9')](),controller[_0xab2c('0x14')]);router[_0xab2c('0x13')](_0xab2c('0xf'),auth[_0xab2c('0x9')](),controller['addAnyCondition']);router[_0xab2c('0x13')](_0xab2c('0x11'),auth[_0xab2c('0x9')](),controller[_0xab2c('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xab2c('0x16')]);router[_0xab2c('0x17')](_0xab2c('0x18'),auth[_0xab2c('0x9')](),controller[_0xab2c('0x19')]);module[_0xab2c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1df6888..44846c0 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 _0x052a=['exports','STRING'];(function(_0x4781cc,_0x154023){var _0x31f1ca=function(_0x2b13f5){while(--_0x2b13f5){_0x4781cc['push'](_0x4781cc['shift']());}};_0x31f1ca(++_0x154023);}(_0x052a,0xd6));var _0xa052=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x052a[_0x2307fa];return _0x496486;};'use strict';var Sequelize=require('sequelize');module[_0xa052('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa052('0x1')]},'description':{'type':Sequelize[_0xa052('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfb68=['BOOLEAN','sequelize','STRING'];(function(_0x3c1f23,_0x30ae2b){var _0x44896f=function(_0x4347c6){while(--_0x4347c6){_0x3c1f23['push'](_0x3c1f23['shift']());}};_0x44896f(++_0x30ae2b);}(_0xfb68,0xca));var _0x8fb6=function(_0x3ab175,_0x235a0a){_0x3ab175=_0x3ab175-0x0;var _0x3f65d3=_0xfb68[_0x3ab175];return _0x3f65d3;};'use strict';var Sequelize=require(_0x8fb6('0x0'));module['exports']={'name':{'type':Sequelize[_0x8fb6('0x1')]},'channel':{'type':Sequelize[_0x8fb6('0x1')]},'description':{'type':Sequelize[_0x8fb6('0x1')]},'status':{'type':Sequelize[_0x8fb6('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index bfca7f7..da7db14 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 _0xb5fc=['fields','length','nolimit','order','sort','filters','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','intersection','attributes'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xb5fc,0x88));var _0xcb5f=function(_0x101f5b,_0x3dc974){_0x101f5b=_0x101f5b-0x0;var _0x40dd9d=_0xb5fc[_0x101f5b];return _0x40dd9d;};'use strict';var emlformat=require(_0xcb5f('0x0'));var rimraf=require(_0xcb5f('0x1'));var zipdir=require(_0xcb5f('0x2'));var jsonpatch=require(_0xcb5f('0x3'));var rp=require(_0xcb5f('0x4'));var moment=require('moment');var BPromise=require(_0xcb5f('0x5'));var Mustache=require(_0xcb5f('0x6'));var util=require(_0xcb5f('0x7'));var path=require(_0xcb5f('0x8'));var sox=require(_0xcb5f('0x9'));var csv=require(_0xcb5f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb5f('0xb'));var _=require(_0xcb5f('0xc'));var squel=require(_0xcb5f('0xd'));var crypto=require(_0xcb5f('0xe'));var jsforce=require(_0xcb5f('0xf'));var deskjs=require(_0xcb5f('0x10'));var toCsv=require(_0xcb5f('0xa'));var querystring=require(_0xcb5f('0x11'));var Papa=require('papaparse');var Redis=require(_0xcb5f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcb5f('0x13'));var as=require(_0xcb5f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb5f('0x15'))('api');var utils=require(_0xcb5f('0x16'));var config=require(_0xcb5f('0x17'));var licenseUtil=require(_0xcb5f('0x18'));var db=require(_0xcb5f('0x19'))['db'];function respondWithStatusCode(_0x2448f1,_0x1db34e){_0x1db34e=_0x1db34e||0xcc;return function(_0x4edf00){if(_0x4edf00){return _0x2448f1[_0xcb5f('0x1a')](_0x1db34e);}return _0x2448f1['status'](_0x1db34e)[_0xcb5f('0x1b')]();};}function respondWithResult(_0x2c8626,_0x3772a6){_0x3772a6=_0x3772a6||0xc8;return function(_0xe927ca){if(_0xe927ca){return _0x2c8626[_0xcb5f('0x1c')](_0x3772a6)[_0xcb5f('0x1d')](_0xe927ca);}};}function respondWithFilteredResult(_0x1c58ff,_0x281c85){return function(_0x7f583f){if(_0x7f583f){var _0x24c444=typeof _0x281c85[_0xcb5f('0x1e')]===_0xcb5f('0x1f')&&typeof _0x281c85[_0xcb5f('0x20')]===_0xcb5f('0x1f');var _0x310330=_0x7f583f[_0xcb5f('0x21')];var _0x342356=_0x24c444?0x0:_0x281c85['offset'];var _0xee5111=_0x24c444?_0x7f583f[_0xcb5f('0x21')]:_0x281c85['offset']+_0x281c85[_0xcb5f('0x20')];var _0x330b7f;if(_0xee5111>=_0x310330){_0xee5111=_0x310330;_0x330b7f=0xc8;}else{_0x330b7f=0xce;}_0x1c58ff[_0xcb5f('0x1c')](_0x330b7f);return _0x1c58ff[_0xcb5f('0x22')](_0xcb5f('0x23'),_0x342356+'-'+_0xee5111+'/'+_0x310330)['json'](_0x7f583f);}return null;};}function patchUpdates(_0x230fe8){return function(_0x5b3faf){try{jsonpatch[_0xcb5f('0x24')](_0x5b3faf,_0x230fe8,!![]);}catch(_0x5dce46){return BPromise[_0xcb5f('0x25')](_0x5dce46);}return _0x5b3faf['save']();};}function saveUpdates(_0x27bb5d,_0x4ac6f4){return function(_0x596a87){if(_0x596a87){return _0x596a87[_0xcb5f('0x26')](_0x27bb5d)[_0xcb5f('0x27')](function(_0x39c2bd){return _0x39c2bd;});}return null;};}function removeEntity(_0x36be5e,_0x14b6e2){return function(_0x53c40a){if(_0x53c40a){return _0x53c40a[_0xcb5f('0x28')]()[_0xcb5f('0x27')](function(){var _0x5073a4=_0x53c40a['get']({'plain':!![]});var _0x397c28=_0xcb5f('0x29');return db[_0xcb5f('0x2a')][_0xcb5f('0x28')]({'where':{'type':_0x397c28,'resourceId':_0x5073a4['id']}})[_0xcb5f('0x27')](function(){return _0x53c40a;});})['then'](function(){_0x36be5e[_0xcb5f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5013f2,_0x4c7cb9){return function(_0x242b37){if(!_0x242b37){_0x5013f2[_0xcb5f('0x1a')](0x194);}return _0x242b37;};}function handleError(_0x5e4d04,_0x43b563){_0x43b563=_0x43b563||0x1f4;return function(_0x3a4e1b){logger[_0xcb5f('0x2b')](_0x3a4e1b[_0xcb5f('0x2c')]);if(_0x3a4e1b[_0xcb5f('0x2d')]){delete _0x3a4e1b[_0xcb5f('0x2d')];}_0x5e4d04[_0xcb5f('0x1c')](_0x43b563)[_0xcb5f('0x2e')](_0x3a4e1b);};}exports[_0xcb5f('0x2f')]=function(_0x2afe9f,_0x337d52){var _0x50259c={},_0x3598d5={},_0x47de93={'count':0x0,'rows':[]};var _0x2c7d6a=_[_0xcb5f('0x30')](db[_0xcb5f('0x31')][_0xcb5f('0x32')],function(_0x5cf150){return{'name':_0x5cf150[_0xcb5f('0x33')],'type':_0x5cf150[_0xcb5f('0x34')]['key']};});_0x3598d5[_0xcb5f('0x35')]=_[_0xcb5f('0x30')](_0x2c7d6a,_0xcb5f('0x2d'));_0x3598d5[_0xcb5f('0x36')]=_[_0xcb5f('0x37')](_0x2afe9f[_0xcb5f('0x36')]);_0x3598d5['filters']=_[_0xcb5f('0x38')](_0x3598d5[_0xcb5f('0x35')],_0x3598d5['query']);_0x50259c[_0xcb5f('0x39')]=_[_0xcb5f('0x38')](_0x3598d5[_0xcb5f('0x35')],qs[_0xcb5f('0x3a')](_0x2afe9f[_0xcb5f('0x36')][_0xcb5f('0x3a')]));_0x50259c[_0xcb5f('0x39')]=_0x50259c[_0xcb5f('0x39')][_0xcb5f('0x3b')]?_0x50259c['attributes']:_0x3598d5[_0xcb5f('0x35')];if(!_0x2afe9f['query']['hasOwnProperty'](_0xcb5f('0x3c'))){_0x50259c['limit']=qs['limit'](_0x2afe9f[_0xcb5f('0x36')]['limit']);_0x50259c[_0xcb5f('0x1e')]=qs['offset'](_0x2afe9f[_0xcb5f('0x36')][_0xcb5f('0x1e')]);}_0x50259c[_0xcb5f('0x3d')]=qs[_0xcb5f('0x3e')](_0x2afe9f[_0xcb5f('0x36')]['sort']);_0x50259c['where']=qs[_0xcb5f('0x3f')](_[_0xcb5f('0x40')](_0x2afe9f['query'],_0x3598d5[_0xcb5f('0x3f')]),_0x2c7d6a);if(_0x2afe9f[_0xcb5f('0x36')]['filter']){_0x50259c[_0xcb5f('0x41')]=_[_0xcb5f('0x42')](_0x50259c[_0xcb5f('0x41')],{'$or':_[_0xcb5f('0x30')](_0x2c7d6a,function(_0x5dc219){if(_0x5dc219[_0xcb5f('0x34')]!=='VIRTUAL'){var _0x210153={};_0x210153[_0x5dc219[_0xcb5f('0x2d')]]={'$like':'%'+_0x2afe9f['query'][_0xcb5f('0x43')]+'%'};return _0x210153;}})});}_0x50259c=_[_0xcb5f('0x42')]({},_0x50259c,_0x2afe9f[_0xcb5f('0x44')]);var _0x1020ca={'where':_0x50259c['where']};return db[_0xcb5f('0x31')][_0xcb5f('0x21')](_0x1020ca)['then'](function(_0x462f02){_0x47de93['count']=_0x462f02;if(_0x2afe9f[_0xcb5f('0x36')][_0xcb5f('0x45')]){_0x50259c[_0xcb5f('0x46')]=[{'all':!![]}];}return db[_0xcb5f('0x31')][_0xcb5f('0x47')](_0x50259c);})['then'](function(_0x4e163f){_0x47de93[_0xcb5f('0x48')]=_0x4e163f;return _0x47de93;})['then'](respondWithFilteredResult(_0x337d52,_0x50259c))[_0xcb5f('0x49')](handleError(_0x337d52,null));};exports['show']=function(_0x5e8246,_0x1a2993){var _0x25d022={'raw':![],'where':{'id':_0x5e8246[_0xcb5f('0x4a')]['id']}},_0x4648e5={};_0x4648e5[_0xcb5f('0x35')]=_[_0xcb5f('0x37')](db['Trigger']['rawAttributes']);_0x4648e5['query']=_[_0xcb5f('0x37')](_0x5e8246[_0xcb5f('0x36')]);_0x4648e5['filters']=_[_0xcb5f('0x38')](_0x4648e5['model'],_0x4648e5['query']);_0x25d022[_0xcb5f('0x39')]=_[_0xcb5f('0x38')](_0x4648e5[_0xcb5f('0x35')],qs[_0xcb5f('0x3a')](_0x5e8246[_0xcb5f('0x36')]['fields']));_0x25d022[_0xcb5f('0x39')]=_0x25d022[_0xcb5f('0x39')][_0xcb5f('0x3b')]?_0x25d022[_0xcb5f('0x39')]:_0x4648e5[_0xcb5f('0x35')];if(_0x5e8246[_0xcb5f('0x36')][_0xcb5f('0x45')]){_0x25d022[_0xcb5f('0x46')]=[{'all':!![]}];}_0x25d022=_[_0xcb5f('0x42')]({},_0x25d022,_0x5e8246[_0xcb5f('0x44')]);return db[_0xcb5f('0x31')][_0xcb5f('0x4b')](_0x25d022)[_0xcb5f('0x27')](handleEntityNotFound(_0x1a2993,null))[_0xcb5f('0x27')](respondWithResult(_0x1a2993,null))['catch'](handleError(_0x1a2993,null));};exports[_0xcb5f('0x4c')]=function(_0xf8db3e,_0x4554f8){return db[_0xcb5f('0x31')]['create'](_0xf8db3e[_0xcb5f('0x4d')],{})[_0xcb5f('0x27')](function(_0x1ebdb8){var _0x562b12=_0xf8db3e[_0xcb5f('0x4e')][_0xcb5f('0x4f')]({'plain':!![]});if(!_0x562b12)throw new Error(_0xcb5f('0x50'));if(_0x562b12[_0xcb5f('0x51')]===_0xcb5f('0x4e')){var _0x3d9156=_0x1ebdb8[_0xcb5f('0x4f')]({'plain':!![]});var _0x5257d4='Triggers';return db['UserProfileSection'][_0xcb5f('0x4b')]({'where':{'name':_0x5257d4,'userProfileId':_0x562b12[_0xcb5f('0x52')]},'raw':!![]})[_0xcb5f('0x27')](function(_0x3489db){if(_0x3489db&&_0x3489db[_0xcb5f('0x53')]===0x0){return db[_0xcb5f('0x2a')][_0xcb5f('0x4c')]({'name':_0x3d9156[_0xcb5f('0x2d')],'resourceId':_0x3d9156['id'],'type':_0x3489db[_0xcb5f('0x2d')],'sectionId':_0x3489db['id']},{})[_0xcb5f('0x27')](function(){return _0x1ebdb8;});}else{return _0x1ebdb8;}})[_0xcb5f('0x49')](function(_0x288919){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x288919);throw _0x288919;});}return _0x1ebdb8;})[_0xcb5f('0x27')](respondWithResult(_0x4554f8,0xc9))[_0xcb5f('0x49')](handleError(_0x4554f8,null));};exports['update']=function(_0x460112,_0x1d338c){if(_0x460112[_0xcb5f('0x4d')]['id']){delete _0x460112[_0xcb5f('0x4d')]['id'];}return db['Trigger'][_0xcb5f('0x4b')]({'where':{'id':_0x460112[_0xcb5f('0x4a')]['id']}})[_0xcb5f('0x27')](handleEntityNotFound(_0x1d338c,null))['then'](saveUpdates(_0x460112[_0xcb5f('0x4d')],null))['then'](respondWithResult(_0x1d338c,null))[_0xcb5f('0x49')](handleError(_0x1d338c,null));};exports[_0xcb5f('0x28')]=function(_0x1e549a,_0x3cabbb){return db[_0xcb5f('0x31')][_0xcb5f('0x4b')]({'where':{'id':_0x1e549a['params']['id']}})[_0xcb5f('0x27')](handleEntityNotFound(_0x3cabbb,null))[_0xcb5f('0x27')](removeEntity(_0x3cabbb,null))['catch'](handleError(_0x3cabbb,null));};exports[_0xcb5f('0x54')]=function(_0x8ff2b8,_0x1a3005,_0x52ed3b){if(_0x8ff2b8[_0xcb5f('0x4d')]['id']){delete _0x8ff2b8[_0xcb5f('0x4d')]['id'];}return db[_0xcb5f('0x31')][_0xcb5f('0x4b')]({'where':{'id':_0x8ff2b8[_0xcb5f('0x4a')]['id']}})[_0xcb5f('0x27')](handleEntityNotFound(_0x1a3005,null))[_0xcb5f('0x27')](function(_0x26c921){if(_0x26c921){_0x8ff2b8[_0xcb5f('0x4d')][_0xcb5f('0x55')]=_0x26c921['id'];return db[_0xcb5f('0x56')][_0xcb5f('0x4c')](_0x8ff2b8['body']);}})[_0xcb5f('0x27')](respondWithResult(_0x1a3005,null))['catch'](handleError(_0x1a3005,null));};exports[_0xcb5f('0x57')]=function(_0x4b06ef,_0x160f45,_0x991388){if(_0x4b06ef['body']['id']){delete _0x4b06ef['body']['id'];}return db['Trigger'][_0xcb5f('0x4b')]({'where':{'id':_0x4b06ef['params']['id']}})['then'](handleEntityNotFound(_0x160f45,null))['then'](function(_0x4d8d2d){if(_0x4d8d2d){_0x4b06ef[_0xcb5f('0x4d')][_0xcb5f('0x58')]=_0x4d8d2d['id'];return db[_0xcb5f('0x56')][_0xcb5f('0x4c')](_0x4b06ef[_0xcb5f('0x4d')]);}})[_0xcb5f('0x27')](respondWithResult(_0x160f45,null))[_0xcb5f('0x49')](handleError(_0x160f45,null));};exports[_0xcb5f('0x59')]=function(_0x4409f1,_0x1e42c0,_0x280ff7){var _0x19d078={};var _0x48afb4={};var _0x354f18;var _0x2cc26e;return db[_0xcb5f('0x31')][_0xcb5f('0x5a')]({'where':{'id':_0x4409f1[_0xcb5f('0x4a')]['id']}})[_0xcb5f('0x27')](handleEntityNotFound(_0x1e42c0,null))[_0xcb5f('0x27')](function(_0xc5e6e6){if(_0xc5e6e6){_0x354f18=_0xc5e6e6;_0x48afb4[_0xcb5f('0x35')]=_[_0xcb5f('0x37')](db[_0xcb5f('0x56')][_0xcb5f('0x32')]);_0x48afb4[_0xcb5f('0x36')]=_['keys'](_0x4409f1[_0xcb5f('0x36')]);_0x48afb4[_0xcb5f('0x3f')]=_[_0xcb5f('0x38')](_0x48afb4[_0xcb5f('0x35')],_0x48afb4['query']);_0x19d078[_0xcb5f('0x39')]=_['intersection'](_0x48afb4['model'],qs[_0xcb5f('0x3a')](_0x4409f1['query']['fields']));_0x19d078[_0xcb5f('0x39')]=_0x19d078[_0xcb5f('0x39')][_0xcb5f('0x3b')]?_0x19d078[_0xcb5f('0x39')]:_0x48afb4['model'];_0x19d078[_0xcb5f('0x3d')]=qs[_0xcb5f('0x3e')](_0x4409f1[_0xcb5f('0x36')][_0xcb5f('0x3e')]);_0x19d078[_0xcb5f('0x41')]=qs[_0xcb5f('0x3f')](_[_0xcb5f('0x40')](_0x4409f1['query'],_0x48afb4['filters']));if(_0x4409f1['query'][_0xcb5f('0x43')]){_0x19d078[_0xcb5f('0x41')]=_[_0xcb5f('0x42')](_0x19d078['where'],{'$or':_['map'](_0x19d078['attributes'],function(_0x138f01){var _0x281f8c={};_0x281f8c[_0x138f01]={'$like':'%'+_0x4409f1[_0xcb5f('0x36')][_0xcb5f('0x43')]+'%'};return _0x281f8c;})});}_0x19d078=_[_0xcb5f('0x42')]({},_0x19d078,_0x4409f1[_0xcb5f('0x44')]);return _0x354f18[_0xcb5f('0x59')](_0x19d078);}})[_0xcb5f('0x27')](function(_0x284497){if(_0x284497){_0x2cc26e=_0x284497[_0xcb5f('0x3b')];if(!_0x4409f1[_0xcb5f('0x36')][_0xcb5f('0x5b')](_0xcb5f('0x3c'))){_0x19d078[_0xcb5f('0x20')]=qs[_0xcb5f('0x20')](_0x4409f1[_0xcb5f('0x36')][_0xcb5f('0x20')]);_0x19d078['offset']=qs[_0xcb5f('0x1e')](_0x4409f1[_0xcb5f('0x36')][_0xcb5f('0x1e')]);}return _0x354f18[_0xcb5f('0x59')](_0x19d078);}})['then'](function(_0x1b2ed8){if(_0x1b2ed8){return _0x1b2ed8?{'count':_0x2cc26e,'rows':_0x1b2ed8}:null;}})[_0xcb5f('0x27')](respondWithResult(_0x1e42c0,null))[_0xcb5f('0x49')](handleError(_0x1e42c0,null));};exports[_0xcb5f('0x5c')]=function(_0x36964c,_0x930822,_0x550d32){var _0x577be6={};var _0x28fa25={};var _0x447d79;var _0x5b6517;return db[_0xcb5f('0x31')]['findOne']({'where':{'id':_0x36964c[_0xcb5f('0x4a')]['id']}})[_0xcb5f('0x27')](handleEntityNotFound(_0x930822,null))[_0xcb5f('0x27')](function(_0x115461){if(_0x115461){_0x447d79=_0x115461;_0x28fa25[_0xcb5f('0x35')]=_['keys'](db[_0xcb5f('0x56')][_0xcb5f('0x32')]);_0x28fa25[_0xcb5f('0x36')]=_[_0xcb5f('0x37')](_0x36964c[_0xcb5f('0x36')]);_0x28fa25[_0xcb5f('0x3f')]=_[_0xcb5f('0x38')](_0x28fa25[_0xcb5f('0x35')],_0x28fa25[_0xcb5f('0x36')]);_0x577be6[_0xcb5f('0x39')]=_[_0xcb5f('0x38')](_0x28fa25[_0xcb5f('0x35')],qs[_0xcb5f('0x3a')](_0x36964c[_0xcb5f('0x36')][_0xcb5f('0x3a')]));_0x577be6[_0xcb5f('0x39')]=_0x577be6[_0xcb5f('0x39')]['length']?_0x577be6[_0xcb5f('0x39')]:_0x28fa25[_0xcb5f('0x35')];_0x577be6[_0xcb5f('0x3d')]=qs[_0xcb5f('0x3e')](_0x36964c[_0xcb5f('0x36')]['sort']);_0x577be6[_0xcb5f('0x41')]=qs[_0xcb5f('0x3f')](_[_0xcb5f('0x40')](_0x36964c[_0xcb5f('0x36')],_0x28fa25[_0xcb5f('0x3f')]));if(_0x36964c[_0xcb5f('0x36')][_0xcb5f('0x43')]){_0x577be6[_0xcb5f('0x41')]=_[_0xcb5f('0x42')](_0x577be6[_0xcb5f('0x41')],{'$or':_['map'](_0x577be6[_0xcb5f('0x39')],function(_0xf5275d){var _0x422f80={};_0x422f80[_0xf5275d]={'$like':'%'+_0x36964c[_0xcb5f('0x36')][_0xcb5f('0x43')]+'%'};return _0x422f80;})});}_0x577be6=_['merge']({},_0x577be6,_0x36964c[_0xcb5f('0x44')]);return _0x447d79[_0xcb5f('0x5c')](_0x577be6);}})[_0xcb5f('0x27')](function(_0x532d23){if(_0x532d23){_0x5b6517=_0x532d23[_0xcb5f('0x3b')];if(!_0x36964c[_0xcb5f('0x36')][_0xcb5f('0x5b')](_0xcb5f('0x3c'))){_0x577be6['limit']=qs[_0xcb5f('0x20')](_0x36964c[_0xcb5f('0x36')]['limit']);_0x577be6[_0xcb5f('0x1e')]=qs[_0xcb5f('0x1e')](_0x36964c[_0xcb5f('0x36')][_0xcb5f('0x1e')]);}return _0x447d79['getAnyConditions'](_0x577be6);}})[_0xcb5f('0x27')](function(_0x110c29){if(_0x110c29){return _0x110c29?{'count':_0x5b6517,'rows':_0x110c29}:null;}})['then'](respondWithResult(_0x930822,null))[_0xcb5f('0x49')](handleError(_0x930822,null));};exports[_0xcb5f('0x5d')]=function(_0x1defa0,_0x5a117f,_0x441f4f){if(_0x1defa0[_0xcb5f('0x4d')]['id']){delete _0x1defa0[_0xcb5f('0x4d')]['id'];}return db[_0xcb5f('0x31')][_0xcb5f('0x4b')]({'where':{'id':_0x1defa0[_0xcb5f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a117f,null))[_0xcb5f('0x27')](function(_0x40c481){if(_0x40c481){_0x1defa0[_0xcb5f('0x4d')][_0xcb5f('0x5e')]=_0x40c481['id'];return db[_0xcb5f('0x5f')][_0xcb5f('0x4c')](_0x1defa0[_0xcb5f('0x4d')]);}})[_0xcb5f('0x27')](respondWithResult(_0x5a117f,null))[_0xcb5f('0x49')](handleError(_0x5a117f,null));};exports['getActions']=function(_0x3088af,_0x349e05,_0x40ded4){var _0xc52f72={};var _0x483e5d={};var _0x5a17aa;var _0x3a99a4;return db[_0xcb5f('0x31')][_0xcb5f('0x5a')]({'where':{'id':_0x3088af['params']['id']}})[_0xcb5f('0x27')](handleEntityNotFound(_0x349e05,null))[_0xcb5f('0x27')](function(_0x102bd8){if(_0x102bd8){_0x5a17aa=_0x102bd8;_0x483e5d[_0xcb5f('0x35')]=_[_0xcb5f('0x37')](db[_0xcb5f('0x5f')][_0xcb5f('0x32')]);_0x483e5d[_0xcb5f('0x36')]=_[_0xcb5f('0x37')](_0x3088af['query']);_0x483e5d[_0xcb5f('0x3f')]=_[_0xcb5f('0x38')](_0x483e5d[_0xcb5f('0x35')],_0x483e5d['query']);_0xc52f72[_0xcb5f('0x39')]=_[_0xcb5f('0x38')](_0x483e5d[_0xcb5f('0x35')],qs['fields'](_0x3088af[_0xcb5f('0x36')][_0xcb5f('0x3a')]));_0xc52f72[_0xcb5f('0x39')]=_0xc52f72[_0xcb5f('0x39')]['length']?_0xc52f72['attributes']:_0x483e5d['model'];_0xc52f72[_0xcb5f('0x3d')]=qs['sort'](_0x3088af[_0xcb5f('0x36')][_0xcb5f('0x3e')]);_0xc52f72[_0xcb5f('0x41')]=qs[_0xcb5f('0x3f')](_['pick'](_0x3088af[_0xcb5f('0x36')],_0x483e5d[_0xcb5f('0x3f')]));if(_0x3088af[_0xcb5f('0x36')][_0xcb5f('0x43')]){_0xc52f72['where']=_['merge'](_0xc52f72[_0xcb5f('0x41')],{'$or':_[_0xcb5f('0x30')](_0xc52f72[_0xcb5f('0x39')],function(_0x3567ed){var _0x5f4917={};_0x5f4917[_0x3567ed]={'$like':'%'+_0x3088af[_0xcb5f('0x36')][_0xcb5f('0x43')]+'%'};return _0x5f4917;})});}_0xc52f72=_[_0xcb5f('0x42')]({},_0xc52f72,_0x3088af[_0xcb5f('0x44')]);return _0x5a17aa[_0xcb5f('0x60')](_0xc52f72);}})[_0xcb5f('0x27')](function(_0x4b59b1){if(_0x4b59b1){_0x3a99a4=_0x4b59b1[_0xcb5f('0x3b')];if(!_0x3088af[_0xcb5f('0x36')][_0xcb5f('0x5b')](_0xcb5f('0x3c'))){_0xc52f72[_0xcb5f('0x20')]=qs[_0xcb5f('0x20')](_0x3088af[_0xcb5f('0x36')]['limit']);_0xc52f72[_0xcb5f('0x1e')]=qs[_0xcb5f('0x1e')](_0x3088af[_0xcb5f('0x36')]['offset']);}return _0x5a17aa[_0xcb5f('0x60')](_0xc52f72);}})[_0xcb5f('0x27')](function(_0xb9fab){if(_0xb9fab){return _0xb9fab?{'count':_0x3a99a4,'rows':_0xb9fab}:null;}})[_0xcb5f('0x27')](respondWithResult(_0x349e05,null))[_0xcb5f('0x49')](handleError(_0x349e05,null));}; \ No newline at end of file +var _0x5d13=['create','body','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','order','getAnyConditions','rawAttributes','options','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','Trigger','includeAll','include','rows','catch','show','params','length','find'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5d13,0x1f3));var _0x35d1=function(_0x42c351,_0x52c100){_0x42c351=_0x42c351-0x0;var _0x16bc83=_0x5d13[_0x42c351];return _0x16bc83;};'use strict';var emlformat=require(_0x35d1('0x0'));var rimraf=require(_0x35d1('0x1'));var zipdir=require(_0x35d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35d1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35d1('0x4'));var util=require(_0x35d1('0x5'));var path=require(_0x35d1('0x6'));var sox=require(_0x35d1('0x7'));var csv=require(_0x35d1('0x8'));var ejs=require(_0x35d1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35d1('0xa'));var squel=require(_0x35d1('0xb'));var crypto=require(_0x35d1('0xc'));var jsforce=require(_0x35d1('0xd'));var deskjs=require(_0x35d1('0xe'));var toCsv=require(_0x35d1('0x8'));var querystring=require('querystring');var Papa=require(_0x35d1('0xf'));var Redis=require(_0x35d1('0x10'));var authService=require(_0x35d1('0x11'));var qs=require(_0x35d1('0x12'));var as=require(_0x35d1('0x13'));var hardwareService=require(_0x35d1('0x14'));var logger=require(_0x35d1('0x15'))(_0x35d1('0x16'));var utils=require(_0x35d1('0x17'));var config=require(_0x35d1('0x18'));var licenseUtil=require(_0x35d1('0x19'));var db=require(_0x35d1('0x1a'))['db'];function respondWithStatusCode(_0x5bb3f9,_0x5e3a2a){_0x5e3a2a=_0x5e3a2a||0xcc;return function(_0x20a69c){if(_0x20a69c){return _0x5bb3f9[_0x35d1('0x1b')](_0x5e3a2a);}return _0x5bb3f9[_0x35d1('0x1c')](_0x5e3a2a)[_0x35d1('0x1d')]();};}function respondWithResult(_0x1befd2,_0x2626f0){_0x2626f0=_0x2626f0||0xc8;return function(_0x35916f){if(_0x35916f){return _0x1befd2[_0x35d1('0x1c')](_0x2626f0)[_0x35d1('0x1e')](_0x35916f);}};}function respondWithFilteredResult(_0x4aecf4,_0xf6916c){return function(_0x59efe3){if(_0x59efe3){var _0x559bc7=typeof _0xf6916c[_0x35d1('0x1f')]===_0x35d1('0x20')&&typeof _0xf6916c[_0x35d1('0x21')]==='undefined';var _0x41970e=_0x59efe3[_0x35d1('0x22')];var _0x3df230=_0x559bc7?0x0:_0xf6916c[_0x35d1('0x1f')];var _0x40d8b9=_0x559bc7?_0x59efe3['count']:_0xf6916c[_0x35d1('0x1f')]+_0xf6916c[_0x35d1('0x21')];var _0xd0338f;if(_0x40d8b9>=_0x41970e){_0x40d8b9=_0x41970e;_0xd0338f=0xc8;}else{_0xd0338f=0xce;}_0x4aecf4[_0x35d1('0x1c')](_0xd0338f);return _0x4aecf4[_0x35d1('0x23')](_0x35d1('0x24'),_0x3df230+'-'+_0x40d8b9+'/'+_0x41970e)['json'](_0x59efe3);}return null;};}function patchUpdates(_0x56f535){return function(_0x37ed7e){try{jsonpatch[_0x35d1('0x25')](_0x37ed7e,_0x56f535,!![]);}catch(_0x2bc2c0){return BPromise[_0x35d1('0x26')](_0x2bc2c0);}return _0x37ed7e[_0x35d1('0x27')]();};}function saveUpdates(_0x40a3b6,_0x596ac3){return function(_0x5aa20d){if(_0x5aa20d){return _0x5aa20d[_0x35d1('0x28')](_0x40a3b6)[_0x35d1('0x29')](function(_0xf5077e){return _0xf5077e;});}return null;};}function removeEntity(_0x4f9627,_0x1386a2){return function(_0x361a66){if(_0x361a66){return _0x361a66[_0x35d1('0x2a')]()[_0x35d1('0x29')](function(){var _0x32922d=_0x361a66[_0x35d1('0x2b')]({'plain':!![]});var _0x40eb3d=_0x35d1('0x2c');return db[_0x35d1('0x2d')][_0x35d1('0x2a')]({'where':{'type':_0x40eb3d,'resourceId':_0x32922d['id']}})[_0x35d1('0x29')](function(){return _0x361a66;});})[_0x35d1('0x29')](function(){_0x4f9627[_0x35d1('0x1c')](0xcc)[_0x35d1('0x1d')]();});}};}function handleEntityNotFound(_0x157342,_0x64cc06){return function(_0x2cc20c){if(!_0x2cc20c){_0x157342['sendStatus'](0x194);}return _0x2cc20c;};}function handleError(_0x34c88f,_0x2b9ef8){_0x2b9ef8=_0x2b9ef8||0x1f4;return function(_0x6b558){logger['error'](_0x6b558['stack']);if(_0x6b558[_0x35d1('0x2e')]){delete _0x6b558['name'];}_0x34c88f['status'](_0x2b9ef8)[_0x35d1('0x2f')](_0x6b558);};}exports[_0x35d1('0x30')]=function(_0x5894ff,_0x3da2d7){var _0x17ee15={},_0x2adbbb={},_0x2d54e8={'count':0x0,'rows':[]};var _0x273b08=_[_0x35d1('0x31')](db['Trigger']['rawAttributes'],function(_0x59c65e){return{'name':_0x59c65e[_0x35d1('0x32')],'type':_0x59c65e[_0x35d1('0x33')][_0x35d1('0x34')]};});_0x2adbbb[_0x35d1('0x35')]=_[_0x35d1('0x31')](_0x273b08,'name');_0x2adbbb[_0x35d1('0x36')]=_[_0x35d1('0x37')](_0x5894ff[_0x35d1('0x36')]);_0x2adbbb[_0x35d1('0x38')]=_['intersection'](_0x2adbbb['model'],_0x2adbbb['query']);_0x17ee15[_0x35d1('0x39')]=_[_0x35d1('0x3a')](_0x2adbbb[_0x35d1('0x35')],qs[_0x35d1('0x3b')](_0x5894ff['query'][_0x35d1('0x3b')]));_0x17ee15[_0x35d1('0x39')]=_0x17ee15[_0x35d1('0x39')]['length']?_0x17ee15['attributes']:_0x2adbbb[_0x35d1('0x35')];if(!_0x5894ff[_0x35d1('0x36')][_0x35d1('0x3c')](_0x35d1('0x3d'))){_0x17ee15[_0x35d1('0x21')]=qs[_0x35d1('0x21')](_0x5894ff['query']['limit']);_0x17ee15['offset']=qs['offset'](_0x5894ff[_0x35d1('0x36')][_0x35d1('0x1f')]);}_0x17ee15['order']=qs[_0x35d1('0x3e')](_0x5894ff[_0x35d1('0x36')][_0x35d1('0x3e')]);_0x17ee15[_0x35d1('0x3f')]=qs[_0x35d1('0x38')](_[_0x35d1('0x40')](_0x5894ff[_0x35d1('0x36')],_0x2adbbb[_0x35d1('0x38')]),_0x273b08);if(_0x5894ff[_0x35d1('0x36')]['filter']){_0x17ee15[_0x35d1('0x3f')]=_[_0x35d1('0x41')](_0x17ee15[_0x35d1('0x3f')],{'$or':_[_0x35d1('0x31')](_0x273b08,function(_0x3569a3){if(_0x3569a3[_0x35d1('0x33')]!==_0x35d1('0x42')){var _0xc35bad={};_0xc35bad[_0x3569a3[_0x35d1('0x2e')]]={'$like':'%'+_0x5894ff[_0x35d1('0x36')][_0x35d1('0x43')]+'%'};return _0xc35bad;}})});}_0x17ee15=_[_0x35d1('0x41')]({},_0x17ee15,_0x5894ff['options']);var _0x5dcb5f={'where':_0x17ee15[_0x35d1('0x3f')]};return db[_0x35d1('0x44')][_0x35d1('0x22')](_0x5dcb5f)[_0x35d1('0x29')](function(_0x80d5d6){_0x2d54e8['count']=_0x80d5d6;if(_0x5894ff[_0x35d1('0x36')][_0x35d1('0x45')]){_0x17ee15[_0x35d1('0x46')]=[{'all':!![]}];}return db[_0x35d1('0x44')]['findAll'](_0x17ee15);})[_0x35d1('0x29')](function(_0x5a1eea){_0x2d54e8[_0x35d1('0x47')]=_0x5a1eea;return _0x2d54e8;})['then'](respondWithFilteredResult(_0x3da2d7,_0x17ee15))[_0x35d1('0x48')](handleError(_0x3da2d7,null));};exports[_0x35d1('0x49')]=function(_0x1f9a3b,_0x194294){var _0x29194c={'raw':![],'where':{'id':_0x1f9a3b[_0x35d1('0x4a')]['id']}},_0x2deadc={};_0x2deadc[_0x35d1('0x35')]=_[_0x35d1('0x37')](db[_0x35d1('0x44')]['rawAttributes']);_0x2deadc[_0x35d1('0x36')]=_[_0x35d1('0x37')](_0x1f9a3b[_0x35d1('0x36')]);_0x2deadc['filters']=_[_0x35d1('0x3a')](_0x2deadc[_0x35d1('0x35')],_0x2deadc[_0x35d1('0x36')]);_0x29194c[_0x35d1('0x39')]=_[_0x35d1('0x3a')](_0x2deadc[_0x35d1('0x35')],qs[_0x35d1('0x3b')](_0x1f9a3b[_0x35d1('0x36')][_0x35d1('0x3b')]));_0x29194c['attributes']=_0x29194c[_0x35d1('0x39')][_0x35d1('0x4b')]?_0x29194c[_0x35d1('0x39')]:_0x2deadc[_0x35d1('0x35')];if(_0x1f9a3b[_0x35d1('0x36')]['includeAll']){_0x29194c[_0x35d1('0x46')]=[{'all':!![]}];}_0x29194c=_['merge']({},_0x29194c,_0x1f9a3b['options']);return db[_0x35d1('0x44')][_0x35d1('0x4c')](_0x29194c)[_0x35d1('0x29')](handleEntityNotFound(_0x194294,null))[_0x35d1('0x29')](respondWithResult(_0x194294,null))[_0x35d1('0x48')](handleError(_0x194294,null));};exports['create']=function(_0x2e3d08,_0x55cd1b){return db['Trigger'][_0x35d1('0x4d')](_0x2e3d08[_0x35d1('0x4e')],{})[_0x35d1('0x29')](function(_0xf3784a){var _0x11bf55=_0x2e3d08['user'][_0x35d1('0x2b')]({'plain':!![]});if(!_0x11bf55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11bf55['role']==='user'){var _0x7c286a=_0xf3784a[_0x35d1('0x2b')]({'plain':!![]});var _0x9a6451='Triggers';return db[_0x35d1('0x4f')][_0x35d1('0x4c')]({'where':{'name':_0x9a6451,'userProfileId':_0x11bf55[_0x35d1('0x50')]},'raw':!![]})[_0x35d1('0x29')](function(_0x29a1bf){if(_0x29a1bf&&_0x29a1bf['autoAssociation']===0x0){return db['UserProfileResource'][_0x35d1('0x4d')]({'name':_0x7c286a['name'],'resourceId':_0x7c286a['id'],'type':_0x29a1bf[_0x35d1('0x2e')],'sectionId':_0x29a1bf['id']},{})[_0x35d1('0x29')](function(){return _0xf3784a;});}else{return _0xf3784a;}})[_0x35d1('0x48')](function(_0x54791a){logger[_0x35d1('0x51')](_0x35d1('0x52'),_0x54791a);throw _0x54791a;});}return _0xf3784a;})['then'](respondWithResult(_0x55cd1b,0xc9))['catch'](handleError(_0x55cd1b,null));};exports[_0x35d1('0x28')]=function(_0x9b8f29,_0x4f08b5){if(_0x9b8f29['body']['id']){delete _0x9b8f29[_0x35d1('0x4e')]['id'];}return db[_0x35d1('0x44')][_0x35d1('0x4c')]({'where':{'id':_0x9b8f29[_0x35d1('0x4a')]['id']}})[_0x35d1('0x29')](handleEntityNotFound(_0x4f08b5,null))[_0x35d1('0x29')](saveUpdates(_0x9b8f29[_0x35d1('0x4e')],null))[_0x35d1('0x29')](respondWithResult(_0x4f08b5,null))[_0x35d1('0x48')](handleError(_0x4f08b5,null));};exports[_0x35d1('0x2a')]=function(_0x968828,_0x1c1e2e){return db[_0x35d1('0x44')][_0x35d1('0x4c')]({'where':{'id':_0x968828[_0x35d1('0x4a')]['id']}})[_0x35d1('0x29')](handleEntityNotFound(_0x1c1e2e,null))['then'](removeEntity(_0x1c1e2e,null))[_0x35d1('0x48')](handleError(_0x1c1e2e,null));};exports[_0x35d1('0x53')]=function(_0xc851e7,_0x4a0e26,_0x1d33d2){if(_0xc851e7[_0x35d1('0x4e')]['id']){delete _0xc851e7[_0x35d1('0x4e')]['id'];}return db[_0x35d1('0x44')]['find']({'where':{'id':_0xc851e7[_0x35d1('0x4a')]['id']}})[_0x35d1('0x29')](handleEntityNotFound(_0x4a0e26,null))['then'](function(_0x2ad392){if(_0x2ad392){_0xc851e7[_0x35d1('0x4e')]['TriggerAllId']=_0x2ad392['id'];return db[_0x35d1('0x54')][_0x35d1('0x4d')](_0xc851e7[_0x35d1('0x4e')]);}})[_0x35d1('0x29')](respondWithResult(_0x4a0e26,null))[_0x35d1('0x48')](handleError(_0x4a0e26,null));};exports[_0x35d1('0x55')]=function(_0x298b00,_0x37cb7e,_0x23820a){if(_0x298b00[_0x35d1('0x4e')]['id']){delete _0x298b00[_0x35d1('0x4e')]['id'];}return db[_0x35d1('0x44')]['find']({'where':{'id':_0x298b00[_0x35d1('0x4a')]['id']}})[_0x35d1('0x29')](handleEntityNotFound(_0x37cb7e,null))[_0x35d1('0x29')](function(_0x479b95){if(_0x479b95){_0x298b00[_0x35d1('0x4e')]['TriggerAnyId']=_0x479b95['id'];return db['Condition'][_0x35d1('0x4d')](_0x298b00['body']);}})[_0x35d1('0x29')](respondWithResult(_0x37cb7e,null))[_0x35d1('0x48')](handleError(_0x37cb7e,null));};exports[_0x35d1('0x56')]=function(_0x5ccb5e,_0xa0233a,_0x8b0cf2){var _0xe9d8d8={};var _0x2a1c31={};var _0x323c24;var _0x1428ad;return db[_0x35d1('0x44')][_0x35d1('0x57')]({'where':{'id':_0x5ccb5e['params']['id']}})['then'](handleEntityNotFound(_0xa0233a,null))[_0x35d1('0x29')](function(_0x474034){if(_0x474034){_0x323c24=_0x474034;_0x2a1c31[_0x35d1('0x35')]=_[_0x35d1('0x37')](db['Condition']['rawAttributes']);_0x2a1c31[_0x35d1('0x36')]=_[_0x35d1('0x37')](_0x5ccb5e[_0x35d1('0x36')]);_0x2a1c31[_0x35d1('0x38')]=_['intersection'](_0x2a1c31[_0x35d1('0x35')],_0x2a1c31[_0x35d1('0x36')]);_0xe9d8d8[_0x35d1('0x39')]=_['intersection'](_0x2a1c31[_0x35d1('0x35')],qs[_0x35d1('0x3b')](_0x5ccb5e[_0x35d1('0x36')]['fields']));_0xe9d8d8['attributes']=_0xe9d8d8[_0x35d1('0x39')][_0x35d1('0x4b')]?_0xe9d8d8[_0x35d1('0x39')]:_0x2a1c31[_0x35d1('0x35')];_0xe9d8d8[_0x35d1('0x58')]=qs[_0x35d1('0x3e')](_0x5ccb5e['query'][_0x35d1('0x3e')]);_0xe9d8d8['where']=qs[_0x35d1('0x38')](_[_0x35d1('0x40')](_0x5ccb5e[_0x35d1('0x36')],_0x2a1c31[_0x35d1('0x38')]));if(_0x5ccb5e[_0x35d1('0x36')]['filter']){_0xe9d8d8[_0x35d1('0x3f')]=_[_0x35d1('0x41')](_0xe9d8d8[_0x35d1('0x3f')],{'$or':_[_0x35d1('0x31')](_0xe9d8d8['attributes'],function(_0x3c013f){var _0x26039f={};_0x26039f[_0x3c013f]={'$like':'%'+_0x5ccb5e[_0x35d1('0x36')]['filter']+'%'};return _0x26039f;})});}_0xe9d8d8=_[_0x35d1('0x41')]({},_0xe9d8d8,_0x5ccb5e['options']);return _0x323c24[_0x35d1('0x56')](_0xe9d8d8);}})[_0x35d1('0x29')](function(_0x18f2e0){if(_0x18f2e0){_0x1428ad=_0x18f2e0['length'];if(!_0x5ccb5e[_0x35d1('0x36')][_0x35d1('0x3c')](_0x35d1('0x3d'))){_0xe9d8d8[_0x35d1('0x21')]=qs['limit'](_0x5ccb5e[_0x35d1('0x36')][_0x35d1('0x21')]);_0xe9d8d8[_0x35d1('0x1f')]=qs[_0x35d1('0x1f')](_0x5ccb5e[_0x35d1('0x36')][_0x35d1('0x1f')]);}return _0x323c24[_0x35d1('0x56')](_0xe9d8d8);}})[_0x35d1('0x29')](function(_0x28e375){if(_0x28e375){return _0x28e375?{'count':_0x1428ad,'rows':_0x28e375}:null;}})[_0x35d1('0x29')](respondWithResult(_0xa0233a,null))[_0x35d1('0x48')](handleError(_0xa0233a,null));};exports[_0x35d1('0x59')]=function(_0x135661,_0xdf38c4,_0x3fdc66){var _0x318f04={};var _0x4b0705={};var _0x477ce7;var _0x51de77;return db[_0x35d1('0x44')][_0x35d1('0x57')]({'where':{'id':_0x135661[_0x35d1('0x4a')]['id']}})[_0x35d1('0x29')](handleEntityNotFound(_0xdf38c4,null))[_0x35d1('0x29')](function(_0x465f5f){if(_0x465f5f){_0x477ce7=_0x465f5f;_0x4b0705[_0x35d1('0x35')]=_[_0x35d1('0x37')](db['Condition'][_0x35d1('0x5a')]);_0x4b0705[_0x35d1('0x36')]=_[_0x35d1('0x37')](_0x135661[_0x35d1('0x36')]);_0x4b0705[_0x35d1('0x38')]=_[_0x35d1('0x3a')](_0x4b0705['model'],_0x4b0705[_0x35d1('0x36')]);_0x318f04[_0x35d1('0x39')]=_[_0x35d1('0x3a')](_0x4b0705['model'],qs[_0x35d1('0x3b')](_0x135661[_0x35d1('0x36')][_0x35d1('0x3b')]));_0x318f04[_0x35d1('0x39')]=_0x318f04[_0x35d1('0x39')][_0x35d1('0x4b')]?_0x318f04[_0x35d1('0x39')]:_0x4b0705[_0x35d1('0x35')];_0x318f04[_0x35d1('0x58')]=qs['sort'](_0x135661[_0x35d1('0x36')][_0x35d1('0x3e')]);_0x318f04['where']=qs['filters'](_['pick'](_0x135661['query'],_0x4b0705['filters']));if(_0x135661[_0x35d1('0x36')][_0x35d1('0x43')]){_0x318f04[_0x35d1('0x3f')]=_[_0x35d1('0x41')](_0x318f04[_0x35d1('0x3f')],{'$or':_[_0x35d1('0x31')](_0x318f04[_0x35d1('0x39')],function(_0xe7a9d8){var _0x2f7559={};_0x2f7559[_0xe7a9d8]={'$like':'%'+_0x135661['query'][_0x35d1('0x43')]+'%'};return _0x2f7559;})});}_0x318f04=_[_0x35d1('0x41')]({},_0x318f04,_0x135661[_0x35d1('0x5b')]);return _0x477ce7['getAnyConditions'](_0x318f04);}})[_0x35d1('0x29')](function(_0x2f47ca){if(_0x2f47ca){_0x51de77=_0x2f47ca[_0x35d1('0x4b')];if(!_0x135661[_0x35d1('0x36')][_0x35d1('0x3c')](_0x35d1('0x3d'))){_0x318f04['limit']=qs[_0x35d1('0x21')](_0x135661[_0x35d1('0x36')][_0x35d1('0x21')]);_0x318f04[_0x35d1('0x1f')]=qs[_0x35d1('0x1f')](_0x135661['query'][_0x35d1('0x1f')]);}return _0x477ce7[_0x35d1('0x59')](_0x318f04);}})[_0x35d1('0x29')](function(_0x3e6c70){if(_0x3e6c70){return _0x3e6c70?{'count':_0x51de77,'rows':_0x3e6c70}:null;}})[_0x35d1('0x29')](respondWithResult(_0xdf38c4,null))[_0x35d1('0x48')](handleError(_0xdf38c4,null));};exports[_0x35d1('0x5c')]=function(_0x4dd6fc,_0x2a54f,_0x246a24){if(_0x4dd6fc[_0x35d1('0x4e')]['id']){delete _0x4dd6fc[_0x35d1('0x4e')]['id'];}return db[_0x35d1('0x44')][_0x35d1('0x4c')]({'where':{'id':_0x4dd6fc[_0x35d1('0x4a')]['id']}})[_0x35d1('0x29')](handleEntityNotFound(_0x2a54f,null))[_0x35d1('0x29')](function(_0x3fef2f){if(_0x3fef2f){_0x4dd6fc[_0x35d1('0x4e')][_0x35d1('0x5d')]=_0x3fef2f['id'];return db[_0x35d1('0x5e')][_0x35d1('0x4d')](_0x4dd6fc[_0x35d1('0x4e')]);}})[_0x35d1('0x29')](respondWithResult(_0x2a54f,null))[_0x35d1('0x48')](handleError(_0x2a54f,null));};exports[_0x35d1('0x5f')]=function(_0x1ef0be,_0x36c47d,_0x3b88a5){var _0x5d9259={};var _0x3b6df3={};var _0xf85200;var _0x440866;return db['Trigger']['findOne']({'where':{'id':_0x1ef0be[_0x35d1('0x4a')]['id']}})[_0x35d1('0x29')](handleEntityNotFound(_0x36c47d,null))['then'](function(_0x236410){if(_0x236410){_0xf85200=_0x236410;_0x3b6df3[_0x35d1('0x35')]=_[_0x35d1('0x37')](db['Action'][_0x35d1('0x5a')]);_0x3b6df3['query']=_['keys'](_0x1ef0be[_0x35d1('0x36')]);_0x3b6df3[_0x35d1('0x38')]=_[_0x35d1('0x3a')](_0x3b6df3[_0x35d1('0x35')],_0x3b6df3['query']);_0x5d9259['attributes']=_[_0x35d1('0x3a')](_0x3b6df3[_0x35d1('0x35')],qs[_0x35d1('0x3b')](_0x1ef0be[_0x35d1('0x36')]['fields']));_0x5d9259[_0x35d1('0x39')]=_0x5d9259['attributes'][_0x35d1('0x4b')]?_0x5d9259[_0x35d1('0x39')]:_0x3b6df3['model'];_0x5d9259['order']=qs[_0x35d1('0x3e')](_0x1ef0be['query'][_0x35d1('0x3e')]);_0x5d9259['where']=qs['filters'](_[_0x35d1('0x40')](_0x1ef0be['query'],_0x3b6df3['filters']));if(_0x1ef0be[_0x35d1('0x36')][_0x35d1('0x43')]){_0x5d9259[_0x35d1('0x3f')]=_[_0x35d1('0x41')](_0x5d9259[_0x35d1('0x3f')],{'$or':_[_0x35d1('0x31')](_0x5d9259[_0x35d1('0x39')],function(_0x1f9ea2){var _0x23e8c9={};_0x23e8c9[_0x1f9ea2]={'$like':'%'+_0x1ef0be[_0x35d1('0x36')]['filter']+'%'};return _0x23e8c9;})});}_0x5d9259=_[_0x35d1('0x41')]({},_0x5d9259,_0x1ef0be[_0x35d1('0x5b')]);return _0xf85200['getActions'](_0x5d9259);}})['then'](function(_0x1acbbb){if(_0x1acbbb){_0x440866=_0x1acbbb[_0x35d1('0x4b')];if(!_0x1ef0be[_0x35d1('0x36')][_0x35d1('0x3c')](_0x35d1('0x3d'))){_0x5d9259[_0x35d1('0x21')]=qs[_0x35d1('0x21')](_0x1ef0be['query'][_0x35d1('0x21')]);_0x5d9259[_0x35d1('0x1f')]=qs[_0x35d1('0x1f')](_0x1ef0be[_0x35d1('0x36')][_0x35d1('0x1f')]);}return _0xf85200[_0x35d1('0x5f')](_0x5d9259);}})[_0x35d1('0x29')](function(_0x37ac81){if(_0x37ac81){return _0x37ac81?{'count':_0x440866,'rows':_0x37ac81}:null;}})[_0x35d1('0x29')](respondWithResult(_0x36c47d,null))[_0x35d1('0x48')](handleError(_0x36c47d,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 4905d29..ecba93f 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 _0x33c5=['Trigger','tools_triggers','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./trigger.attributes','exports','define'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x33c5,0xe6));var _0x533c=function(_0x163d42,_0x3cabea){_0x163d42=_0x163d42-0x0;var _0x59186c=_0x33c5[_0x163d42];return _0x59186c;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var logger=require(_0x533c('0x1'))('api');var moment=require(_0x533c('0x2'));var BPromise=require(_0x533c('0x3'));var rp=require(_0x533c('0x4'));var fs=require('fs');var path=require(_0x533c('0x5'));var rimraf=require(_0x533c('0x6'));var config=require('../../config/environment');var attributes=require(_0x533c('0x7'));module[_0x533c('0x8')]=function(_0x31d912,_0x151732){return _0x31d912[_0x533c('0x9')](_0x533c('0xa'),attributes,{'tableName':_0x533c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7f3=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x21a6f0,_0x34f377){var _0x394ada=function(_0x523061){while(--_0x523061){_0x21a6f0['push'](_0x21a6f0['shift']());}};_0x394ada(++_0x34f377);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x247611,_0x2df0ec){_0x247611=_0x247611-0x0;var _0x3c42bb=_0xf7f3[_0x247611];return _0x3c42bb;};'use strict';var _=require(_0x3f7f('0x0'));var util=require(_0x3f7f('0x1'));var logger=require(_0x3f7f('0x2'))(_0x3f7f('0x3'));var moment=require(_0x3f7f('0x4'));var BPromise=require(_0x3f7f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f7f('0x6'));var config=require(_0x3f7f('0x7'));var attributes=require('./trigger.attributes');module[_0x3f7f('0x8')]=function(_0x4876e8,_0x2198f7){return _0x4876e8[_0x3f7f('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','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 4339589..5789709 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 _0xf331=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message','info','result','GetTrigger','findAll','options','where','attributes','limit','include','map','model','stringify','find','raw','ShowTrigger','catch','lodash','util'];(function(_0x47e34c,_0x35818d){var _0x3cccde=function(_0xb466fb){while(--_0xb466fb){_0x47e34c['push'](_0x47e34c['shift']());}};_0x3cccde(++_0x35818d);}(_0xf331,0x67));var _0x1f33=function(_0x8bc90f,_0x4666f7){_0x8bc90f=_0x8bc90f-0x0;var _0x45fe08=_0xf331[_0x8bc90f];return _0x45fe08;};'use strict';var _=require(_0x1f33('0x0'));var util=require(_0x1f33('0x1'));var moment=require('moment');var BPromise=require(_0x1f33('0x2'));var rs=require(_0x1f33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f33('0x4'))['db'];var utils=require(_0x1f33('0x5'));var logger=require('../../config/logger')(_0x1f33('0x6'));var config=require(_0x1f33('0x7'));var jayson=require(_0x1f33('0x8'));var client=jayson[_0x1f33('0x9')][_0x1f33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eebd6,_0x423947,_0x3e7c15){return new BPromise(function(_0x49c8cc,_0x5a490e){return client[_0x1f33('0xb')](_0x3eebd6,_0x3e7c15)[_0x1f33('0xc')](function(_0x2dd5e6){logger['info'](_0x1f33('0xd'),_0x423947,_0x1f33('0xe'));logger[_0x1f33('0xf')](_0x1f33('0x10'),_0x423947,'request\x20sent',JSON['stringify'](_0x2dd5e6));if(_0x2dd5e6[_0x1f33('0x11')]){if(_0x2dd5e6[_0x1f33('0x11')]['code']===0x1f4){logger['error'](_0x1f33('0xd'),_0x423947,_0x2dd5e6[_0x1f33('0x11')][_0x1f33('0x12')]);return _0x5a490e(_0x2dd5e6['error']['message']);}logger[_0x1f33('0x11')](_0x1f33('0xd'),_0x423947,_0x2dd5e6[_0x1f33('0x11')][_0x1f33('0x12')]);return _0x49c8cc(_0x2dd5e6['error'][_0x1f33('0x12')]);}else{logger[_0x1f33('0x13')](_0x1f33('0xd'),_0x423947,_0x1f33('0xe'));_0x49c8cc(_0x2dd5e6[_0x1f33('0x14')][_0x1f33('0x12')]);}})['catch'](function(_0x144096){logger[_0x1f33('0x11')]('Trigger,\x20%s,\x20%s',_0x423947,_0x144096);_0x5a490e(_0x144096);});});}exports[_0x1f33('0x15')]=function(_0x2eed4d){var _0x1e7314=this;return new Promise(function(_0x5a886c,_0x57d99d){return db['Trigger'][_0x1f33('0x16')]({'raw':_0x2eed4d[_0x1f33('0x17')]?_0x2eed4d[_0x1f33('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2eed4d[_0x1f33('0x17')]?_0x2eed4d[_0x1f33('0x17')][_0x1f33('0x18')]||null:null,'attributes':_0x2eed4d[_0x1f33('0x17')]?_0x2eed4d[_0x1f33('0x17')][_0x1f33('0x19')]||null:null,'limit':_0x2eed4d[_0x1f33('0x17')]?_0x2eed4d[_0x1f33('0x17')][_0x1f33('0x1a')]||null:null,'include':_0x2eed4d[_0x1f33('0x17')]?_0x2eed4d[_0x1f33('0x17')][_0x1f33('0x1b')]?_[_0x1f33('0x1c')](_0x2eed4d['options'][_0x1f33('0x1b')],function(_0xdd28e0){return{'model':db[_0xdd28e0[_0x1f33('0x1d')]],'as':_0xdd28e0['as'],'attributes':_0xdd28e0[_0x1f33('0x19')],'include':_0xdd28e0[_0x1f33('0x1b')]?_['map'](_0xdd28e0['include'],function(_0x3a2900){return{'model':db[_0x3a2900[_0x1f33('0x1d')]],'as':_0x3a2900['as'],'attributes':_0x3a2900[_0x1f33('0x19')],'include':_0x3a2900['include']?_[_0x1f33('0x1c')](_0x3a2900[_0x1f33('0x1b')],function(_0x18b873){return{'model':db[_0x18b873[_0x1f33('0x1d')]],'as':_0x18b873['as'],'attributes':_0x18b873['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f33('0xc')](function(_0x382df4){logger['info'](_0x1f33('0x15'),_0x2eed4d);logger[_0x1f33('0xf')]('GetTrigger',_0x2eed4d,JSON[_0x1f33('0x1e')](_0x382df4));_0x5a886c(_0x382df4);})['catch'](function(_0x43843e){logger[_0x1f33('0x11')](_0x1f33('0x15'),_0x43843e['message'],_0x2eed4d);_0x57d99d(_0x1e7314['error'](0x1f4,_0x43843e[_0x1f33('0x12')]));});});};exports['ShowTrigger']=function(_0x393172){var _0x5869ab=this;return new Promise(function(_0x374fb3,_0x37dbf0){return db['Trigger'][_0x1f33('0x1f')]({'raw':_0x393172[_0x1f33('0x17')]?_0x393172['options'][_0x1f33('0x20')]===undefined?!![]:![]:!![],'where':_0x393172[_0x1f33('0x17')]?_0x393172['options'][_0x1f33('0x18')]||null:null,'attributes':_0x393172[_0x1f33('0x17')]?_0x393172[_0x1f33('0x17')]['attributes']||null:null,'include':_0x393172[_0x1f33('0x17')]?_0x393172[_0x1f33('0x17')][_0x1f33('0x1b')]?_['map'](_0x393172[_0x1f33('0x17')][_0x1f33('0x1b')],function(_0x4dbbc4){return{'model':db[_0x4dbbc4[_0x1f33('0x1d')]],'as':_0x4dbbc4['as'],'attributes':_0x4dbbc4[_0x1f33('0x19')],'include':_0x4dbbc4[_0x1f33('0x1b')]?_[_0x1f33('0x1c')](_0x4dbbc4[_0x1f33('0x1b')],function(_0x17533d){return{'model':db[_0x17533d[_0x1f33('0x1d')]],'as':_0x17533d['as'],'attributes':_0x17533d[_0x1f33('0x19')],'include':_0x17533d[_0x1f33('0x1b')]?_['map'](_0x17533d[_0x1f33('0x1b')],function(_0x24cf78){return{'model':db[_0x24cf78[_0x1f33('0x1d')]],'as':_0x24cf78['as'],'attributes':_0x24cf78['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f33('0xc')](function(_0x77d67d){logger['info']('ShowTrigger',_0x393172);logger[_0x1f33('0xf')](_0x1f33('0x21'),_0x393172,JSON[_0x1f33('0x1e')](_0x77d67d));_0x374fb3(_0x77d67d);})[_0x1f33('0x22')](function(_0x535bc1){logger['error'](_0x1f33('0x21'),_0x535bc1['message'],_0x393172);_0x37dbf0(_0x5869ab[_0x1f33('0x11')](0x1f4,_0x535bc1[_0x1f33('0x12')]));});});}; \ No newline at end of file +var _0x21e5=['catch','GetTrigger','Trigger','options','raw','where','attributes','limit','include','map','model','debug','ShowTrigger','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result'];(function(_0x262d7c,_0x160444){var _0x8d0d7e=function(_0x250373){while(--_0x250373){_0x262d7c['push'](_0x262d7c['shift']());}};_0x8d0d7e(++_0x160444);}(_0x21e5,0x1a5));var _0x521e=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x21e5[_0x28669c];return _0x4a3af6;};'use strict';var _=require(_0x521e('0x0'));var util=require(_0x521e('0x1'));var moment=require(_0x521e('0x2'));var BPromise=require(_0x521e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x521e('0x4'));var db=require(_0x521e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x521e('0x6'))(_0x521e('0x7'));var config=require(_0x521e('0x8'));var jayson=require(_0x521e('0x9'));var client=jayson[_0x521e('0xa')][_0x521e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x343bc2,_0x336b6f,_0x873fa0){return new BPromise(function(_0x393957,_0x4e9995){return client['request'](_0x343bc2,_0x873fa0)[_0x521e('0xc')](function(_0x48f83a){logger[_0x521e('0xd')](_0x521e('0xe'),_0x336b6f,_0x521e('0xf'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x336b6f,_0x521e('0xf'),JSON[_0x521e('0x10')](_0x48f83a));if(_0x48f83a['error']){if(_0x48f83a['error'][_0x521e('0x11')]===0x1f4){logger['error'](_0x521e('0xe'),_0x336b6f,_0x48f83a['error'][_0x521e('0x12')]);return _0x4e9995(_0x48f83a['error'][_0x521e('0x12')]);}logger[_0x521e('0x13')](_0x521e('0xe'),_0x336b6f,_0x48f83a[_0x521e('0x13')][_0x521e('0x12')]);return _0x393957(_0x48f83a[_0x521e('0x13')][_0x521e('0x12')]);}else{logger[_0x521e('0xd')](_0x521e('0xe'),_0x336b6f,_0x521e('0xf'));_0x393957(_0x48f83a[_0x521e('0x14')]['message']);}})[_0x521e('0x15')](function(_0x76e95d){logger[_0x521e('0x13')]('Trigger,\x20%s,\x20%s',_0x336b6f,_0x76e95d);_0x4e9995(_0x76e95d);});});}exports[_0x521e('0x16')]=function(_0x567a0f){var _0x5a09cf=this;return new Promise(function(_0x495da8,_0x4f591e){return db[_0x521e('0x17')]['findAll']({'raw':_0x567a0f[_0x521e('0x18')]?_0x567a0f[_0x521e('0x18')][_0x521e('0x19')]===undefined?!![]:![]:!![],'where':_0x567a0f['options']?_0x567a0f[_0x521e('0x18')][_0x521e('0x1a')]||null:null,'attributes':_0x567a0f['options']?_0x567a0f[_0x521e('0x18')][_0x521e('0x1b')]||null:null,'limit':_0x567a0f[_0x521e('0x18')]?_0x567a0f[_0x521e('0x18')][_0x521e('0x1c')]||null:null,'include':_0x567a0f['options']?_0x567a0f[_0x521e('0x18')][_0x521e('0x1d')]?_['map'](_0x567a0f[_0x521e('0x18')][_0x521e('0x1d')],function(_0x35f9bf){return{'model':db[_0x35f9bf['model']],'as':_0x35f9bf['as'],'attributes':_0x35f9bf['attributes'],'include':_0x35f9bf[_0x521e('0x1d')]?_[_0x521e('0x1e')](_0x35f9bf[_0x521e('0x1d')],function(_0x52e870){return{'model':db[_0x52e870[_0x521e('0x1f')]],'as':_0x52e870['as'],'attributes':_0x52e870[_0x521e('0x1b')],'include':_0x52e870[_0x521e('0x1d')]?_[_0x521e('0x1e')](_0x52e870['include'],function(_0x4d2b7d){return{'model':db[_0x4d2b7d[_0x521e('0x1f')]],'as':_0x4d2b7d['as'],'attributes':_0x4d2b7d[_0x521e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x521e('0xc')](function(_0x4986af){logger[_0x521e('0xd')]('GetTrigger',_0x567a0f);logger[_0x521e('0x20')](_0x521e('0x16'),_0x567a0f,JSON['stringify'](_0x4986af));_0x495da8(_0x4986af);})[_0x521e('0x15')](function(_0x4acb73){logger[_0x521e('0x13')](_0x521e('0x16'),_0x4acb73['message'],_0x567a0f);_0x4f591e(_0x5a09cf[_0x521e('0x13')](0x1f4,_0x4acb73[_0x521e('0x12')]));});});};exports[_0x521e('0x21')]=function(_0x5e51a4){var _0x6e466d=this;return new Promise(function(_0x38c396,_0x5d3ae1){return db[_0x521e('0x17')]['find']({'raw':_0x5e51a4['options']?_0x5e51a4['options'][_0x521e('0x19')]===undefined?!![]:![]:!![],'where':_0x5e51a4[_0x521e('0x18')]?_0x5e51a4[_0x521e('0x18')][_0x521e('0x1a')]||null:null,'attributes':_0x5e51a4['options']?_0x5e51a4['options'][_0x521e('0x1b')]||null:null,'include':_0x5e51a4['options']?_0x5e51a4[_0x521e('0x18')][_0x521e('0x1d')]?_['map'](_0x5e51a4[_0x521e('0x18')][_0x521e('0x1d')],function(_0x11b732){return{'model':db[_0x11b732[_0x521e('0x1f')]],'as':_0x11b732['as'],'attributes':_0x11b732['attributes'],'include':_0x11b732[_0x521e('0x1d')]?_[_0x521e('0x1e')](_0x11b732['include'],function(_0x282d2c){return{'model':db[_0x282d2c[_0x521e('0x1f')]],'as':_0x282d2c['as'],'attributes':_0x282d2c[_0x521e('0x1b')],'include':_0x282d2c['include']?_['map'](_0x282d2c[_0x521e('0x1d')],function(_0x1888f6){return{'model':db[_0x1888f6['model']],'as':_0x1888f6['as'],'attributes':_0x1888f6['attributes']};}):[]};}):[]};}):[]:[]})[_0x521e('0xc')](function(_0x4d1216){logger[_0x521e('0xd')](_0x521e('0x21'),_0x5e51a4);logger['debug'](_0x521e('0x21'),_0x5e51a4,JSON[_0x521e('0x10')](_0x4d1216));_0x38c396(_0x4d1216);})[_0x521e('0x15')](function(_0x25fe3a){logger[_0x521e('0x13')](_0x521e('0x21'),_0x25fe3a['message'],_0x5e51a4);_0x5d3ae1(_0x6e466d[_0x521e('0x13')](0x1f4,_0x25fe3a[_0x521e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index fbc2615..73428f4 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 _0x3866=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','/:id/clone','clone','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1c87ee,_0x3b5519){var _0x4153e8=function(_0x3b32a5){while(--_0x3b32a5){_0x1c87ee['push'](_0x1c87ee['shift']());}};_0x4153e8(++_0x3b5519);}(_0x3866,0x14d));var _0x6386=function(_0xec9262,_0x3e62bd){_0xec9262=_0xec9262-0x0;var _0x19aeff=_0x3866[_0xec9262];return _0x19aeff;};'use strict';var multer=require(_0x6386('0x0'));var util=require(_0x6386('0x1'));var path=require('path');var timeout=require(_0x6386('0x2'));var express=require(_0x6386('0x3'));var router=express[_0x6386('0x4')]();var fs_extra=require(_0x6386('0x5'));var auth=require(_0x6386('0x6'));var interaction=require(_0x6386('0x7'));var config=require(_0x6386('0x8'));var controller=require('./trunk.controller');router[_0x6386('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6386('0x9')](_0x6386('0xa'),auth[_0x6386('0xb')](),controller[_0x6386('0xc')]);router[_0x6386('0xd')](_0x6386('0xe'),auth['isAuthenticated'](),controller[_0x6386('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6386('0x10')]);router['put'](_0x6386('0xa'),auth[_0x6386('0xb')](),controller[_0x6386('0x11')]);router[_0x6386('0x12')]('/:id',auth[_0x6386('0xb')](),controller['destroy']);module[_0x6386('0x13')]=router; \ No newline at end of file +var _0x09e6=['index','get','post','/:id/clone','create','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x09e6,0xb4));var _0x609e=function(_0x42f623,_0x3e37fb){_0x42f623=_0x42f623-0x0;var _0x57bc9e=_0x09e6[_0x42f623];return _0x57bc9e;};'use strict';var multer=require(_0x609e('0x0'));var util=require('util');var path=require(_0x609e('0x1'));var timeout=require(_0x609e('0x2'));var express=require(_0x609e('0x3'));var router=express[_0x609e('0x4')]();var fs_extra=require(_0x609e('0x5'));var auth=require(_0x609e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x609e('0x7'));var controller=require(_0x609e('0x8'));router['get']('/',auth[_0x609e('0x9')](),controller[_0x609e('0xa')]);router[_0x609e('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x609e('0xc')](_0x609e('0xd'),auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0x609e('0x9')](),controller[_0x609e('0xe')]);router['put'](_0x609e('0xf'),auth['isAuthenticated'](),controller[_0x609e('0x10')]);router[_0x609e('0x11')]('/:id',auth[_0x609e('0x9')](),controller['destroy']);module[_0x609e('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 2b79488..c7d1b15 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 _0x3afd=['inband','auto','yes','nonat','update','ENUM','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','active','passive','actpass','dynamic','update,nonat','sequelize','exports','STRING','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','info','shortinfo'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0x3afd,0x79));var _0xd3af=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0x3afd[_0x5cbd7b];return _0x3fdfb8;};'use strict';var Sequelize=require(_0xd3af('0x0'));module[_0xd3af('0x1')]={'name':{'type':Sequelize[_0xd3af('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xd3af('0x3'),_0xd3af('0x4'),'peer'),'allowNull':![],'defaultValue':_0xd3af('0x3')},'context':{'type':Sequelize[_0xd3af('0x2')],'allowNull':![],'defaultValue':_0xd3af('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xd3af('0x6'),_0xd3af('0x7'),_0xd3af('0x8'),_0xd3af('0x9'),_0xd3af('0xa'),'PROHIB_PASSED_SCREEN',_0xd3af('0xb'),_0xd3af('0xc'))},'deny':{'type':Sequelize[_0xd3af('0x2')]},'permit':{'type':Sequelize[_0xd3af('0x2')]},'secret':{'type':Sequelize[_0xd3af('0x2')]},'md5secret':{'type':Sequelize[_0xd3af('0x2')]},'remotesecret':{'type':Sequelize[_0xd3af('0x2')]},'transport':{'type':Sequelize[_0xd3af('0x2')],'defaultValue':_0xd3af('0xd'),'set':function(_0x137dca){this['setDataValue'](_0xd3af('0xe'),_0x137dca?_0x137dca[_0xd3af('0xf')](','):null);},'get':function(){return this[_0xd3af('0x10')]('transport')?this['getDataValue'](_0xd3af('0xe'))[_0xd3af('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xd3af('0x12'),_0xd3af('0x13'),_0xd3af('0x14'),_0xd3af('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xd3af('0x16'),'no',_0xd3af('0x17'),_0xd3af('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd3af('0x2')]},'directmediadeny':{'type':Sequelize[_0xd3af('0x2')]},'nat':{'type':Sequelize[_0xd3af('0x2')],'defaultValue':_0xd3af('0x1a'),'set':function(_0x160d62){this[_0xd3af('0x1b')](_0xd3af('0x1c'),_0x160d62?_0x160d62[_0xd3af('0xf')](','):null);},'get':function(){return this[_0xd3af('0x10')](_0xd3af('0x1c'))?this['getDataValue'](_0xd3af('0x1c'))[_0xd3af('0x11')](','):null;},'comment':_0xd3af('0x1d')},'callgroup':{'type':Sequelize[_0xd3af('0x2')]},'namedcallgroup':{'type':Sequelize[_0xd3af('0x2')]},'pickupgroup':{'type':Sequelize[_0xd3af('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xd3af('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd3af('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd3af('0x2')],'defaultValue':_0xd3af('0x1e')},'allow':{'type':Sequelize[_0xd3af('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4d10ef){this[_0xd3af('0x1b')](_0xd3af('0x1f'),_0x4d10ef?_0x4d10ef[_0xd3af('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xd3af('0x10')](_0xd3af('0x1f'))?this['getDataValue']('allow')[_0xd3af('0x11')](';'):null;},'comment':_0xd3af('0x20')},'autoframing':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no')},'insecure':{'type':Sequelize[_0xd3af('0x2')],'defaultValue':_0xd3af('0x21'),'set':function(_0x220a98){this['setDataValue']('insecure',_0x220a98?_0x220a98[_0xd3af('0xf')](','):null);},'get':function(){return this['getDataValue']('insecure')?this['getDataValue']('insecure')[_0xd3af('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd3af('0x19')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xd3af('0x22')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd3af('0x2')],'defaultValue':_0xd3af('0x23')},'amaflags':{'type':Sequelize[_0xd3af('0x2')]},'callcounter':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xd3af('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xd3af('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xd3af('0x2')]},'template':{'type':Sequelize[_0xd3af('0x2')]},'videosupport':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd3af('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xd3af('0x16'),'no')},'mailbox':{'type':Sequelize[_0xd3af('0x2')]},'session_timers':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x24'),_0xd3af('0x25'),_0xd3af('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xd3af('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x27'),_0xd3af('0x28')),'defaultValue':_0xd3af('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xd3af('0x2')]},'regexten':{'type':Sequelize[_0xd3af('0x2')]},'fromdomain':{'type':Sequelize[_0xd3af('0x2')]},'fromuser':{'type':Sequelize[_0xd3af('0x2')]},'port':{'type':Sequelize[_0xd3af('0x22')](0x5)},'qualify':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xd3af('0x2')]},'rtptimeout':{'type':Sequelize[_0xd3af('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xd3af('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd3af('0x2')]},'callbackextension':{'type':Sequelize[_0xd3af('0x2')]},'timert1':{'type':Sequelize[_0xd3af('0x22')](0xb)},'timerb':{'type':Sequelize[_0xd3af('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd3af('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xd3af('0x2')]},'contactdeny':{'type':Sequelize[_0xd3af('0x2')]},'contactacl':{'type':Sequelize[_0xd3af('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xd3af('0x2')]},'use_q850_reason':{'type':Sequelize[_0xd3af('0x2')]},'maxforwards':{'type':Sequelize[_0xd3af('0x22')](0xb)},'encryption':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd3af('0x19')]('yes','no')},'force_avp':{'type':Sequelize[_0xd3af('0x19')]('yes','no')},'icesupport':{'type':Sequelize[_0xd3af('0x19')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xd3af('0x19')]('yes','no')},'dtlsverify':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xd3af('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xd3af('0x2')]},'dtlscipher':{'type':Sequelize[_0xd3af('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xd3af('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xd3af('0x2a'),_0xd3af('0x2b'),_0xd3af('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd3af('0x2')]},'usereqphone':{'type':Sequelize[_0xd3af('0x19')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd3af('0x2')]},'recordofffeature':{'type':Sequelize[_0xd3af('0x2')]},'call_limit':{'type':Sequelize[_0xd3af('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xd3af('0x2')]},'mohsuggest':{'type':Sequelize[_0xd3af('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd3af('0x2')]},'host':{'type':Sequelize[_0xd3af('0x2')],'defaultValue':_0xd3af('0x2d')},'canreinvite':{'type':Sequelize[_0xd3af('0x19')](_0xd3af('0x16'),'no',_0xd3af('0x17'),_0xd3af('0x18'),_0xd3af('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xd3af('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd3af('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x9a58=['\x22\x22\x20<>','always','refuse','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','friend','user','peer','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER'];(function(_0x4f8acd,_0xf09cf4){var _0x5ddf80=function(_0x52e33f){while(--_0x52e33f){_0x4f8acd['push'](_0x4f8acd['shift']());}};_0x5ddf80(++_0xf09cf4);}(_0x9a58,0xde));var _0x89a5=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x9a58[_0x3c6dce];return _0x1450e9;};'use strict';var Sequelize=require(_0x89a5('0x0'));module[_0x89a5('0x1')]={'name':{'type':Sequelize[_0x89a5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x89a5('0x3'),_0x89a5('0x4'),_0x89a5('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x89a5('0x2')],'allowNull':![],'defaultValue':_0x89a5('0x6')},'callingpres':{'type':Sequelize[_0x89a5('0x7')]('ALLOWED_NOT_SCREENED',_0x89a5('0x8'),'ALLOWED_FAILED_SCREEN',_0x89a5('0x9'),_0x89a5('0xa'),_0x89a5('0xb'),_0x89a5('0xc'),_0x89a5('0xd'))},'deny':{'type':Sequelize[_0x89a5('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x89a5('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x89a5('0xe'),'set':function(_0x951c4e){this[_0x89a5('0xf')]('transport',_0x951c4e?_0x951c4e['join'](','):null);},'get':function(){return this[_0x89a5('0x10')](_0x89a5('0x11'))?this[_0x89a5('0x10')](_0x89a5('0x11'))[_0x89a5('0x12')](','):null;},'comment':_0x89a5('0x13')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x89a5('0x14'),_0x89a5('0x15'),'inband',_0x89a5('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no',_0x89a5('0x18'),'update',_0x89a5('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x89a5('0x2')]},'directmediadeny':{'type':Sequelize[_0x89a5('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x89a5('0x1a'),'set':function(_0x181641){this[_0x89a5('0xf')](_0x89a5('0x1b'),_0x181641?_0x181641[_0x89a5('0x1c')](','):null);},'get':function(){return this['getDataValue'](_0x89a5('0x1b'))?this['getDataValue'](_0x89a5('0x1b'))['split'](','):null;},'comment':_0x89a5('0x1d')},'callgroup':{'type':Sequelize[_0x89a5('0x2')]},'namedcallgroup':{'type':Sequelize[_0x89a5('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x89a5('0x2')]},'language':{'type':Sequelize[_0x89a5('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x89a5('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x89a5('0x2')],'defaultValue':_0x89a5('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x89a5('0x1f'),'set':function(_0x39b52d){this[_0x89a5('0xf')](_0x89a5('0x20'),_0x39b52d?_0x39b52d['join'](';'):_0x89a5('0x1f'));},'get':function(){return this[_0x89a5('0x10')](_0x89a5('0x20'))?this['getDataValue']('allow')[_0x89a5('0x12')](';'):null;},'comment':_0x89a5('0x21')},'autoframing':{'type':Sequelize[_0x89a5('0x7')]('yes','no')},'insecure':{'type':Sequelize[_0x89a5('0x2')],'defaultValue':'port,invite','set':function(_0x30438c){this['setDataValue'](_0x89a5('0x22'),_0x30438c?_0x30438c[_0x89a5('0x1c')](','):null);},'get':function(){return this[_0x89a5('0x10')](_0x89a5('0x22'))?this[_0x89a5('0x10')](_0x89a5('0x22'))[_0x89a5('0x12')](','):null;},'comment':_0x89a5('0x23')},'trustrpid':{'type':Sequelize[_0x89a5('0x7')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x89a5('0x7')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no',_0x89a5('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no')},'accountcode':{'type':Sequelize[_0x89a5('0x25')](0xb)},'setvar':{'type':Sequelize[_0x89a5('0x2')]},'callerid':{'type':Sequelize[_0x89a5('0x2')],'defaultValue':_0x89a5('0x26')},'amaflags':{'type':Sequelize[_0x89a5('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x89a5('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x89a5('0x7')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x89a5('0x2')]},'template':{'type':Sequelize[_0x89a5('0x2')]},'videosupport':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no',_0x89a5('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x89a5('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no')},'mailbox':{'type':Sequelize[_0x89a5('0x2')]},'session_timers':{'type':Sequelize[_0x89a5('0x7')]('accept',_0x89a5('0x28'),'originate')},'session_expires':{'type':Sequelize[_0x89a5('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x29'),_0x89a5('0x2a')),'defaultValue':_0x89a5('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x89a5('0x2')]},'fromdomain':{'type':Sequelize[_0x89a5('0x2')]},'fromuser':{'type':Sequelize[_0x89a5('0x2')]},'port':{'type':Sequelize[_0x89a5('0x25')](0x5)},'qualify':{'type':Sequelize[_0x89a5('0x7')]('yes','no'),'defaultValue':_0x89a5('0x17')},'keepalive':{'type':Sequelize[_0x89a5('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x89a5('0x2')]},'defaultuser':{'type':Sequelize[_0x89a5('0x2')]},'rtptimeout':{'type':Sequelize[_0x89a5('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x89a5('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no',_0x89a5('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x89a5('0x2')]},'callbackextension':{'type':Sequelize[_0x89a5('0x2')]},'timert1':{'type':Sequelize[_0x89a5('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x89a5('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x89a5('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x89a5('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x89a5('0x25')](0xb)},'encryption':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x89a5('0x7')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no',_0x89a5('0x2c'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x89a5('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x89a5('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x89a5('0x2')]},'dtlscipher':{'type':Sequelize[_0x89a5('0x2')]},'dtlscafile':{'type':Sequelize[_0x89a5('0x2')]},'dtlscapath':{'type':Sequelize[_0x89a5('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x89a5('0x2d'),_0x89a5('0x2e'),_0x89a5('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x89a5('0x2')]},'usereqphone':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x89a5('0x2')]},'recordofffeature':{'type':Sequelize[_0x89a5('0x2')]},'call_limit':{'type':Sequelize[_0x89a5('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x89a5('0x7')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x89a5('0x17'),'no')},'vmexten':{'type':Sequelize[_0x89a5('0x2')]},'mohinterpret':{'type':Sequelize[_0x89a5('0x2')]},'mohsuggest':{'type':Sequelize[_0x89a5('0x2')]},'parkinglot':{'type':Sequelize[_0x89a5('0x2')]},'description':{'type':Sequelize[_0x89a5('0x2')]},'host':{'type':Sequelize[_0x89a5('0x2')],'defaultValue':_0x89a5('0x30')},'canreinvite':{'type':Sequelize[_0x89a5('0x7')](_0x89a5('0x17'),'no','nonat',_0x89a5('0x31'),_0x89a5('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x89a5('0x2')]},'otherFields':{'type':Sequelize[_0x89a5('0x2')]},'active':{'type':Sequelize[_0x89a5('0x33')],'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 f5ce8da..68db3de 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 _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x285e6d,_0x212030){var _0x11637e=function(_0xe2eccb){while(--_0xe2eccb){_0x285e6d['push'](_0x285e6d['shift']());}};_0x11637e(++_0x212030);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x156a91,_0x167f52){_0x156a91=_0x156a91-0x0;var _0x452a54=_0xd6d6[_0x156a91];return _0x452a54;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));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('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file +var _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x122974,_0x111030){var _0x236b4b=function(_0x260de7){while(--_0x260de7){_0x122974['push'](_0x122974['shift']());}};_0x236b4b(++_0x111030);}(_0xa41a,0x6b));var _0xaa41=function(_0x262ac4,_0x2c337e){_0x262ac4=_0x262ac4-0x0;var _0x42debb=_0xa41a[_0x262ac4];return _0x42debb;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 12a2b96..faeeed6 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 _0xe0f5=['tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','define','Trunk'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xe0f5,0x187));var _0x5e0f=function(_0x1da3e1,_0x29ffe5){_0x1da3e1=_0x1da3e1-0x0;var _0x45bef0=_0xe0f5[_0x1da3e1];return _0x45bef0;};'use strict';var _=require(_0x5e0f('0x0'));var util=require(_0x5e0f('0x1'));var logger=require(_0x5e0f('0x2'))(_0x5e0f('0x3'));var moment=require(_0x5e0f('0x4'));var BPromise=require(_0x5e0f('0x5'));var rp=require(_0x5e0f('0x6'));var fs=require('fs');var path=require(_0x5e0f('0x7'));var rimraf=require('rimraf');var config=require(_0x5e0f('0x8'));var attributes=require(_0x5e0f('0x9'));module['exports']=function(_0x2806d7,_0x4835e3){return _0x2806d7[_0x5e0f('0xa')](_0x5e0f('0xb'),attributes,{'tableName':_0x5e0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d24=['moment','bluebird','path','rimraf','../../config/environment','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x5270f1,_0x566ef4){var _0x2c360b=function(_0x13684f){while(--_0x13684f){_0x5270f1['push'](_0x5270f1['shift']());}};_0x2c360b(++_0x566ef4);}(_0x2d24,0x81));var _0x42d2=function(_0x52033e,_0x19dcac){_0x52033e=_0x52033e-0x0;var _0x561278=_0x2d24[_0x52033e];return _0x561278;};'use strict';var _=require(_0x42d2('0x0'));var util=require(_0x42d2('0x1'));var logger=require(_0x42d2('0x2'))('api');var moment=require(_0x42d2('0x3'));var BPromise=require(_0x42d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42d2('0x5'));var rimraf=require(_0x42d2('0x6'));var config=require(_0x42d2('0x7'));var attributes=require('./trunk.attributes');module[_0x42d2('0x8')]=function(_0x4966ab,_0x489b50){return _0x4966ab[_0x42d2('0x9')](_0x42d2('0xa'),attributes,{'tableName':_0x42d2('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 220f17c..35beeb2 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 _0x6082=['ShowTrunk','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','include','map','model','debug'];(function(_0x4670de,_0x501757){var _0xb1aeea=function(_0x2a51f8){while(--_0x2a51f8){_0x4670de['push'](_0x4670de['shift']());}};_0xb1aeea(++_0x501757);}(_0x6082,0x19a));var _0x2608=function(_0xca7407,_0x420ff9){_0xca7407=_0xca7407-0x0;var _0x4792ba=_0x6082[_0xca7407];return _0x4792ba;};'use strict';var _=require(_0x2608('0x0'));var util=require('util');var moment=require(_0x2608('0x1'));var BPromise=require(_0x2608('0x2'));var rs=require(_0x2608('0x3'));var fs=require('fs');var Redis=require(_0x2608('0x4'));var db=require(_0x2608('0x5'))['db'];var utils=require(_0x2608('0x6'));var logger=require(_0x2608('0x7'))(_0x2608('0x8'));var config=require(_0x2608('0x9'));var jayson=require(_0x2608('0xa'));var client=jayson[_0x2608('0xb')][_0x2608('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x221206,_0x3b9c89,_0x5ac582){return new BPromise(function(_0xcc464a,_0x3159c0){return client[_0x2608('0xd')](_0x221206,_0x5ac582)[_0x2608('0xe')](function(_0x274ee7){logger[_0x2608('0xf')](_0x2608('0x10'),_0x3b9c89,_0x2608('0x11'));logger['debug'](_0x2608('0x12'),_0x3b9c89,_0x2608('0x11'),JSON[_0x2608('0x13')](_0x274ee7));if(_0x274ee7['error']){if(_0x274ee7[_0x2608('0x14')]['code']===0x1f4){logger[_0x2608('0x14')](_0x2608('0x10'),_0x3b9c89,_0x274ee7[_0x2608('0x14')][_0x2608('0x15')]);return _0x3159c0(_0x274ee7['error'][_0x2608('0x15')]);}logger['error'](_0x2608('0x10'),_0x3b9c89,_0x274ee7[_0x2608('0x14')][_0x2608('0x15')]);return _0xcc464a(_0x274ee7[_0x2608('0x14')][_0x2608('0x15')]);}else{logger[_0x2608('0xf')](_0x2608('0x10'),_0x3b9c89,_0x2608('0x11'));_0xcc464a(_0x274ee7[_0x2608('0x16')][_0x2608('0x15')]);}})[_0x2608('0x17')](function(_0x288cf1){logger['error'](_0x2608('0x10'),_0x3b9c89,_0x288cf1);_0x3159c0(_0x288cf1);});});}exports[_0x2608('0x18')]=function(_0x29d791){var _0x3ecaf2=this;return new Promise(function(_0x4a633c,_0x342bbd){return db[_0x2608('0x19')][_0x2608('0x1a')]({'raw':_0x29d791[_0x2608('0x1b')]?_0x29d791[_0x2608('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x29d791[_0x2608('0x1b')]?_0x29d791[_0x2608('0x1b')][_0x2608('0x1c')]||null:null,'attributes':_0x29d791[_0x2608('0x1b')]?_0x29d791[_0x2608('0x1b')][_0x2608('0x1d')]||null:null,'limit':_0x29d791[_0x2608('0x1b')]?_0x29d791[_0x2608('0x1b')]['limit']||null:null,'include':_0x29d791[_0x2608('0x1b')]?_0x29d791[_0x2608('0x1b')][_0x2608('0x1e')]?_[_0x2608('0x1f')](_0x29d791[_0x2608('0x1b')]['include'],function(_0x25bae3){return{'model':db[_0x25bae3[_0x2608('0x20')]],'as':_0x25bae3['as'],'attributes':_0x25bae3[_0x2608('0x1d')],'include':_0x25bae3[_0x2608('0x1e')]?_[_0x2608('0x1f')](_0x25bae3[_0x2608('0x1e')],function(_0x9db169){return{'model':db[_0x9db169[_0x2608('0x20')]],'as':_0x9db169['as'],'attributes':_0x9db169[_0x2608('0x1d')],'include':_0x9db169[_0x2608('0x1e')]?_[_0x2608('0x1f')](_0x9db169['include'],function(_0x270009){return{'model':db[_0x270009[_0x2608('0x20')]],'as':_0x270009['as'],'attributes':_0x270009[_0x2608('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2608('0xe')](function(_0x51ce4d){logger[_0x2608('0xf')](_0x2608('0x18'),_0x29d791);logger[_0x2608('0x21')](_0x2608('0x18'),_0x29d791,JSON[_0x2608('0x13')](_0x51ce4d));_0x4a633c(_0x51ce4d);})[_0x2608('0x17')](function(_0x498275){logger[_0x2608('0x14')]('GetTrunk',_0x498275[_0x2608('0x15')],_0x29d791);_0x342bbd(_0x3ecaf2[_0x2608('0x14')](0x1f4,_0x498275[_0x2608('0x15')]));});});};exports[_0x2608('0x22')]=function(_0x484f6a){var _0x4b3116=this;return new Promise(function(_0x108fca,_0x4881c6){return db[_0x2608('0x19')][_0x2608('0x23')]({'raw':_0x484f6a[_0x2608('0x1b')]?_0x484f6a[_0x2608('0x1b')][_0x2608('0x24')]===undefined?!![]:![]:!![],'where':_0x484f6a[_0x2608('0x1b')]?_0x484f6a[_0x2608('0x1b')]['where']||null:null,'attributes':_0x484f6a[_0x2608('0x1b')]?_0x484f6a[_0x2608('0x1b')][_0x2608('0x1d')]||null:null,'include':_0x484f6a[_0x2608('0x1b')]?_0x484f6a[_0x2608('0x1b')][_0x2608('0x1e')]?_['map'](_0x484f6a[_0x2608('0x1b')][_0x2608('0x1e')],function(_0x551052){return{'model':db[_0x551052[_0x2608('0x20')]],'as':_0x551052['as'],'attributes':_0x551052[_0x2608('0x1d')],'include':_0x551052[_0x2608('0x1e')]?_[_0x2608('0x1f')](_0x551052[_0x2608('0x1e')],function(_0x234aec){return{'model':db[_0x234aec[_0x2608('0x20')]],'as':_0x234aec['as'],'attributes':_0x234aec[_0x2608('0x1d')],'include':_0x234aec[_0x2608('0x1e')]?_[_0x2608('0x1f')](_0x234aec[_0x2608('0x1e')],function(_0x5da03e){return{'model':db[_0x5da03e['model']],'as':_0x5da03e['as'],'attributes':_0x5da03e[_0x2608('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2608('0xe')](function(_0x4f27fe){logger['info'](_0x2608('0x22'),_0x484f6a);logger['debug'](_0x2608('0x22'),_0x484f6a,JSON['stringify'](_0x4f27fe));_0x108fca(_0x4f27fe);})[_0x2608('0x17')](function(_0x44c58d){logger[_0x2608('0x14')](_0x2608('0x22'),_0x44c58d[_0x2608('0x15')],_0x484f6a);_0x4881c6(_0x4b3116[_0x2608('0x14')](0x1f4,_0x44c58d[_0x2608('0x15')]));});});}; \ No newline at end of file +var _0x96f2=['Trunk','options','raw','where','attributes','include','model','map','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x96f2,0x168));var _0x296f=function(_0x1e057b,_0x4a8660){_0x1e057b=_0x1e057b-0x0;var _0x28c8bf=_0x96f2[_0x1e057b];return _0x28c8bf;};'use strict';var _=require(_0x296f('0x0'));var util=require(_0x296f('0x1'));var moment=require(_0x296f('0x2'));var BPromise=require(_0x296f('0x3'));var rs=require(_0x296f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x5'))['db'];var utils=require(_0x296f('0x6'));var logger=require('../../config/logger')(_0x296f('0x7'));var config=require(_0x296f('0x8'));var jayson=require(_0x296f('0x9'));var client=jayson[_0x296f('0xa')][_0x296f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e86ff,_0x25b423,_0xcf438a){return new BPromise(function(_0x592a8b,_0x5f0763){return client['request'](_0x2e86ff,_0xcf438a)[_0x296f('0xc')](function(_0x158972){logger[_0x296f('0xd')]('Trunk,\x20%s,\x20%s',_0x25b423,'request\x20sent');logger[_0x296f('0xe')](_0x296f('0xf'),_0x25b423,_0x296f('0x10'),JSON[_0x296f('0x11')](_0x158972));if(_0x158972[_0x296f('0x12')]){if(_0x158972[_0x296f('0x12')][_0x296f('0x13')]===0x1f4){logger[_0x296f('0x12')](_0x296f('0x14'),_0x25b423,_0x158972[_0x296f('0x12')]['message']);return _0x5f0763(_0x158972[_0x296f('0x12')][_0x296f('0x15')]);}logger[_0x296f('0x12')]('Trunk,\x20%s,\x20%s',_0x25b423,_0x158972[_0x296f('0x12')][_0x296f('0x15')]);return _0x592a8b(_0x158972[_0x296f('0x12')][_0x296f('0x15')]);}else{logger[_0x296f('0xd')]('Trunk,\x20%s,\x20%s',_0x25b423,_0x296f('0x10'));_0x592a8b(_0x158972[_0x296f('0x16')]['message']);}})[_0x296f('0x17')](function(_0x5889a3){logger[_0x296f('0x12')](_0x296f('0x14'),_0x25b423,_0x5889a3);_0x5f0763(_0x5889a3);});});}exports[_0x296f('0x18')]=function(_0x5c4d28){var _0x1b5aeb=this;return new Promise(function(_0x46b1e0,_0x4b1b05){return db[_0x296f('0x19')]['findAll']({'raw':_0x5c4d28[_0x296f('0x1a')]?_0x5c4d28[_0x296f('0x1a')][_0x296f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c4d28['options']?_0x5c4d28[_0x296f('0x1a')][_0x296f('0x1c')]||null:null,'attributes':_0x5c4d28['options']?_0x5c4d28[_0x296f('0x1a')][_0x296f('0x1d')]||null:null,'limit':_0x5c4d28[_0x296f('0x1a')]?_0x5c4d28[_0x296f('0x1a')]['limit']||null:null,'include':_0x5c4d28[_0x296f('0x1a')]?_0x5c4d28[_0x296f('0x1a')]['include']?_['map'](_0x5c4d28['options'][_0x296f('0x1e')],function(_0x17dde8){return{'model':db[_0x17dde8[_0x296f('0x1f')]],'as':_0x17dde8['as'],'attributes':_0x17dde8['attributes'],'include':_0x17dde8[_0x296f('0x1e')]?_[_0x296f('0x20')](_0x17dde8[_0x296f('0x1e')],function(_0x52831e){return{'model':db[_0x52831e[_0x296f('0x1f')]],'as':_0x52831e['as'],'attributes':_0x52831e['attributes'],'include':_0x52831e[_0x296f('0x1e')]?_['map'](_0x52831e[_0x296f('0x1e')],function(_0x13f394){return{'model':db[_0x13f394[_0x296f('0x1f')]],'as':_0x13f394['as'],'attributes':_0x13f394[_0x296f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57d593){logger[_0x296f('0xd')]('GetTrunk',_0x5c4d28);logger[_0x296f('0xe')](_0x296f('0x18'),_0x5c4d28,JSON[_0x296f('0x11')](_0x57d593));_0x46b1e0(_0x57d593);})[_0x296f('0x17')](function(_0x4c9d85){logger['error'](_0x296f('0x18'),_0x4c9d85['message'],_0x5c4d28);_0x4b1b05(_0x1b5aeb[_0x296f('0x12')](0x1f4,_0x4c9d85['message']));});});};exports['ShowTrunk']=function(_0x1e967a){var _0x3b1052=this;return new Promise(function(_0x1e31ab,_0x367095){return db[_0x296f('0x19')][_0x296f('0x21')]({'raw':_0x1e967a[_0x296f('0x1a')]?_0x1e967a[_0x296f('0x1a')][_0x296f('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e967a['options']?_0x1e967a[_0x296f('0x1a')][_0x296f('0x1c')]||null:null,'attributes':_0x1e967a[_0x296f('0x1a')]?_0x1e967a[_0x296f('0x1a')][_0x296f('0x1d')]||null:null,'include':_0x1e967a[_0x296f('0x1a')]?_0x1e967a[_0x296f('0x1a')][_0x296f('0x1e')]?_[_0x296f('0x20')](_0x1e967a[_0x296f('0x1a')][_0x296f('0x1e')],function(_0x5b53ae){return{'model':db[_0x5b53ae[_0x296f('0x1f')]],'as':_0x5b53ae['as'],'attributes':_0x5b53ae['attributes'],'include':_0x5b53ae['include']?_[_0x296f('0x20')](_0x5b53ae[_0x296f('0x1e')],function(_0x42bba3){return{'model':db[_0x42bba3[_0x296f('0x1f')]],'as':_0x42bba3['as'],'attributes':_0x42bba3[_0x296f('0x1d')],'include':_0x42bba3[_0x296f('0x1e')]?_[_0x296f('0x20')](_0x42bba3[_0x296f('0x1e')],function(_0x2456d3){return{'model':db[_0x2456d3['model']],'as':_0x2456d3['as'],'attributes':_0x2456d3[_0x296f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x296f('0xc')](function(_0x17c277){logger[_0x296f('0xd')]('ShowTrunk',_0x1e967a);logger[_0x296f('0xe')](_0x296f('0x22'),_0x1e967a,JSON[_0x296f('0x11')](_0x17c277));_0x1e31ab(_0x17c277);})['catch'](function(_0x3c7d9e){logger[_0x296f('0x12')](_0x296f('0x22'),_0x3c7d9e[_0x296f('0x15')],_0x1e967a);_0x367095(_0x3b1052[_0x296f('0x12')](0x1f4,_0x3c7d9e[_0x296f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 801fead..c7d63b5 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03e5=['../../components/auth/service','put','/:id','update','exports','express','Router'];(function(_0x233fcd,_0x56899c){var _0x40b1e7=function(_0x1fb95d){while(--_0x1fb95d){_0x233fcd['push'](_0x233fcd['shift']());}};_0x40b1e7(++_0x56899c);}(_0x03e5,0xe5));var _0x503e=function(_0x42c49d,_0x275c8c){_0x42c49d=_0x42c49d-0x0;var _0x41beb4=_0x03e5[_0x42c49d];return _0x41beb4;};'use strict';var express=require(_0x503e('0x0'));var router=express[_0x503e('0x1')]();var auth=require(_0x503e('0x2'));var controller=require('./user-setting.controller');router[_0x503e('0x3')](_0x503e('0x4'),auth['isAuthenticated'](),controller[_0x503e('0x5')]);module[_0x503e('0x6')]=router; \ No newline at end of file +var _0xb7c3=['update','exports','express','Router','../../components/auth/service','put','/:id','isAuthenticated'];(function(_0x4b1f40,_0x5d2a33){var _0xf5cdcc=function(_0x383b64){while(--_0x383b64){_0x4b1f40['push'](_0x4b1f40['shift']());}};_0xf5cdcc(++_0x5d2a33);}(_0xb7c3,0xaa));var _0x3b7c=function(_0x12e87f,_0x2fa71e){_0x12e87f=_0x12e87f-0x0;var _0x4e0f51=_0xb7c3[_0x12e87f];return _0x4e0f51;};'use strict';var express=require(_0x3b7c('0x0'));var router=express[_0x3b7c('0x1')]();var auth=require(_0x3b7c('0x2'));var controller=require('./user-setting.controller');router[_0x3b7c('0x3')](_0x3b7c('0x4'),auth[_0x3b7c('0x5')](),controller[_0x3b7c('0x6')]);module[_0x3b7c('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index e3adb24..01d5b31 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa150=['TEXT','DATE','INTEGER','UserId','sequelize','warning','exports','ENUM','BOOLEAN'];(function(_0x11ee67,_0x1760b5){var _0x3ebfda=function(_0x73db8b){while(--_0x73db8b){_0x11ee67['push'](_0x11ee67['shift']());}};_0x3ebfda(++_0x1760b5);}(_0xa150,0x13f));var _0x0a15=function(_0x3ea212,_0x429cce){_0x3ea212=_0x3ea212-0x0;var _0x481a0e=_0xa150[_0x3ea212];return _0x481a0e;};'use strict';var Sequelize=require(_0x0a15('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x0a15('0x1'),'info','debug'];module[_0x0a15('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0x0a15('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0a15('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x0a15('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0a15('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x0a15('0x7')],'unique':_0x0a15('0x8')}}; \ No newline at end of file +var _0x5abf=['BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error','info','debug','exports','ENUM'];(function(_0x2c1f58,_0x3d21ef){var _0x19ef5c=function(_0x320890){while(--_0x320890){_0x2c1f58['push'](_0x2c1f58['shift']());}};_0x19ef5c(++_0x3d21ef);}(_0x5abf,0x73));var _0xf5ab=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x5abf[_0x131585];return _0x1fcca2;};'use strict';var Sequelize=require(_0xf5ab('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf5ab('0x1'),'warning',_0xf5ab('0x2'),_0xf5ab('0x3')];module[_0xf5ab('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf5ab('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf5ab('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf5ab('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf5ab('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf5ab('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf5ab('0x9')],'unique':_0xf5ab('0xa')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index b1f3c2c..2598183 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4b6=['params','Invalid\x20user\x20setting\x20id','UserSetting','body','lodash','ioredis','api','../../config/environment','socket.io-emitter','redis','defaults','status','update','then','sendStatus','error','name','user','role','admin','Unauthorized'];(function(_0x31de49,_0x180ca8){var _0x5ad6f1=function(_0x5cf1d0){while(--_0x5cf1d0){_0x31de49['push'](_0x31de49['shift']());}};_0x5ad6f1(++_0x180ca8);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x49b5f1,_0x2dd0eb){_0x49b5f1=_0x49b5f1-0x0;var _0x49872e=_0xd4b6[_0x49b5f1];return _0x49872e;};'use strict';var _=require(_0x6d4b('0x0'));var Redis=require(_0x6d4b('0x1'));var logger=require('../../config/logger')(_0x6d4b('0x2'));var config=require(_0x6d4b('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0x6d4b('0x4'))(new Redis(config['redis']));require('./user-setting.socket')['register'](socket);config[_0x6d4b('0x5')]=_[_0x6d4b('0x6')](config[_0x6d4b('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x20f52a,_0x42a52a){_0x42a52a=_0x42a52a||0xc8;return function(_0x424690){if(_0x424690){return _0x20f52a[_0x6d4b('0x7')](_0x42a52a)['json'](_0x424690);}};}function saveUpdates(_0x4462e4){return function(_0x4694eb){if(_0x4694eb){return _0x4694eb[_0x6d4b('0x8')](_0x4462e4)[_0x6d4b('0x9')](function(_0x559134){return _0x559134;});}return null;};}function handleEntityNotFound(_0x19f8ef){return function(_0x396267){if(!_0x396267){_0x19f8ef[_0x6d4b('0xa')](0x194);}return _0x396267;};}function handleError(_0x2006a4,_0x401e05){_0x401e05=_0x401e05||0x1f4;return function(_0x45126d){logger[_0x6d4b('0xb')](_0x45126d['stack']);if(_0x45126d[_0x6d4b('0xc')]){delete _0x45126d[_0x6d4b('0xc')];}_0x2006a4[_0x6d4b('0x7')](_0x401e05)['send'](_0x45126d);};}exports[_0x6d4b('0x8')]=function(_0x3d2e81,_0x148531){if(_0x3d2e81[_0x6d4b('0xd')][_0x6d4b('0xe')]!==_0x6d4b('0xf'))throw new Error(_0x6d4b('0x10'));if(isNaN(Number(_0x3d2e81[_0x6d4b('0x11')]['id'])))throw new Error(_0x6d4b('0x12'));return db[_0x6d4b('0x13')]['find']({'where':{'id':_0x3d2e81[_0x6d4b('0x11')]['id']}})['then'](handleEntityNotFound(_0x148531,null))[_0x6d4b('0x9')](saveUpdates(_0x3d2e81[_0x6d4b('0x14')],null))['then'](respondWithResult(_0x148531,null))['catch'](handleError(_0x148531,null));}; \ No newline at end of file +var _0x0a34=['api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','json','update','then','sendStatus','error','name','send','user','role','admin','UserSetting','find','params','body','catch','lodash','ioredis'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0a34,0x12a));var _0x40a3=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x0a34[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x40a3('0x0'));var Redis=require(_0x40a3('0x1'));var logger=require('../../config/logger')(_0x40a3('0x2'));var config=require(_0x40a3('0x3'));var db=require(_0x40a3('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x40a3('0x5')]));require(_0x40a3('0x6'))[_0x40a3('0x7')](socket);config['redis']=_[_0x40a3('0x8')](config[_0x40a3('0x5')],{'host':_0x40a3('0x9'),'port':0x18eb});function respondWithResult(_0x394f67,_0x655437){_0x655437=_0x655437||0xc8;return function(_0x3bf1de){if(_0x3bf1de){return _0x394f67['status'](_0x655437)[_0x40a3('0xa')](_0x3bf1de);}};}function saveUpdates(_0x2c938c){return function(_0x258101){if(_0x258101){return _0x258101[_0x40a3('0xb')](_0x2c938c)[_0x40a3('0xc')](function(_0x2edb15){return _0x2edb15;});}return null;};}function handleEntityNotFound(_0x4f3c10){return function(_0x643d61){if(!_0x643d61){_0x4f3c10[_0x40a3('0xd')](0x194);}return _0x643d61;};}function handleError(_0x261080,_0x52adb2){_0x52adb2=_0x52adb2||0x1f4;return function(_0x1ee5f8){logger[_0x40a3('0xe')](_0x1ee5f8['stack']);if(_0x1ee5f8[_0x40a3('0xf')]){delete _0x1ee5f8[_0x40a3('0xf')];}_0x261080['status'](_0x52adb2)[_0x40a3('0x10')](_0x1ee5f8);};}exports[_0x40a3('0xb')]=function(_0x5b8539,_0x116b69){if(_0x5b8539[_0x40a3('0x11')][_0x40a3('0x12')]!==_0x40a3('0x13'))throw new Error('Unauthorized');if(isNaN(Number(_0x5b8539['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x40a3('0x14')][_0x40a3('0x15')]({'where':{'id':_0x5b8539[_0x40a3('0x16')]['id']}})['then'](handleEntityNotFound(_0x116b69,null))[_0x40a3('0xc')](saveUpdates(_0x5b8539[_0x40a3('0x17')],null))['then'](respondWithResult(_0x116b69,null))[_0x40a3('0x18')](handleError(_0x116b69,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 7c30cb9..4196ea5 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x342f=['hasOwnProperty','hook','exports','../../mysqldb','UserSetting','save','update','remove','emit'];(function(_0x47d8a5,_0x79231c){var _0x582e68=function(_0x1aca77){while(--_0x1aca77){_0x47d8a5['push'](_0x47d8a5['shift']());}};_0x582e68(++_0x79231c);}(_0x342f,0x16b));var _0xf342=function(_0x26f429,_0x45d2c9){_0x26f429=_0x26f429-0x0;var _0x226603=_0x342f[_0x26f429];return _0x226603;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xf342('0x0'))['db'][_0xf342('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf342('0x2'),'afterUpdate':_0xf342('0x3'),'afterDestroy':_0xf342('0x4')};function emitEvent(_0x5befc5){return function(_0x2a9852,_0x582211,_0x4d7006){UserSettingEvents['emit'](_0x5befc5+':'+_0x2a9852['id'],_0x2a9852);UserSettingEvents[_0xf342('0x5')](_0x5befc5,_0x2a9852);_0x4d7006(null);};}for(var e in events){if(events[_0xf342('0x6')](e)){var event=events[e];UserSetting[_0xf342('0x7')](e,emitEvent(event));}}module[_0xf342('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x801e=['save','update','emit','exports','../../mysqldb','UserSetting'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x801e,0xd6));var _0xe801=function(_0x509fd5,_0x4f8493){_0x509fd5=_0x509fd5-0x0;var _0x3738b8=_0x801e[_0x509fd5];return _0x3738b8;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xe801('0x0'))['db'][_0xe801('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe801('0x2'),'afterUpdate':_0xe801('0x3'),'afterDestroy':'remove'};function emitEvent(_0x123ba8){return function(_0x1bd497,_0x322058,_0x1dcee5){UserSettingEvents[_0xe801('0x4')](_0x123ba8+':'+_0x1bd497['id'],_0x1bd497);UserSettingEvents['emit'](_0x123ba8,_0x1bd497);_0x1dcee5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xe801('0x5')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index fc20394..d4fb430 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d13=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports','define'];(function(_0x6e8543,_0x1b4903){var _0x3ce7c0=function(_0x3ad81f){while(--_0x3ad81f){_0x6e8543['push'](_0x6e8543['shift']());}};_0x3ce7c0(++_0x1b4903);}(_0x7d13,0x6c));var _0x37d1=function(_0x2ceb47,_0x5c6f60){_0x2ceb47=_0x2ceb47-0x0;var _0x4a77b0=_0x7d13[_0x2ceb47];return _0x4a77b0;};'use strict';var attributes=require('./user-setting.attributes');module[_0x37d1('0x0')]=function(_0x59c6ac){return _0x59c6ac[_0x37d1('0x1')]('UserSetting',attributes,{'tableName':_0x37d1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x317366){if(!_0x317366[_0x37d1('0x3')])_0x317366[_0x37d1('0x4')]=null;else if(_0x317366[_0x37d1('0x4')]===null)_0x317366['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xadcc=['UserSetting','user_settings','clientSideLoggingEnabledSince','./user-setting.attributes','define'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xadcc,0x76));var _0xcadc=function(_0x379686,_0x5a40ce){_0x379686=_0x379686-0x0;var _0x35dc97=_0xadcc[_0x379686];return _0x35dc97;};'use strict';var attributes=require(_0xcadc('0x0'));module['exports']=function(_0x150e40){return _0x150e40[_0xcadc('0x1')](_0xcadc('0x2'),attributes,{'tableName':_0xcadc('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c174f){if(!_0x2c174f['clientSideLoggingEnabled'])_0x2c174f['clientSideLoggingEnabledSince']=null;else if(_0x2c174f[_0xcadc('0x4')]===null)_0x2c174f[_0xcadc('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 63b7f56..4ef7ebd 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd8=['length','user-setting:','./user-setting.events','save','remove','update','user-setting:update','emit','user-setting:update:user-','UserId','register'];(function(_0x25c6c2,_0x1f0516){var _0x1bcf2c=function(_0x9df275){while(--_0x9df275){_0x25c6c2['push'](_0x25c6c2['shift']());}};_0x1bcf2c(++_0x1f0516);}(_0xedd8,0xb2));var _0x8edd=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0xedd8[_0x4d67b8];return _0x55af3b;};'use strict';var UserSettingEvents=require(_0x8edd('0x0'));var events=[_0x8edd('0x1'),_0x8edd('0x2'),_0x8edd('0x3')];function createListener(_0x1fdaf0,_0x54a8bc){return function(_0x136ea0){_0x54a8bc['emit'](_0x1fdaf0,_0x136ea0);if(_0x1fdaf0===_0x8edd('0x4')){_0x54a8bc[_0x8edd('0x5')](_0x8edd('0x6')+_0x136ea0[_0x8edd('0x7')],_0x136ea0);}};}exports[_0x8edd('0x8')]=function(_0x2a921d){for(var _0x47f073=0x0,_0xb80de6=events[_0x8edd('0x9')];_0x47f073<_0xb80de6;_0x47f073++){var _0x3dd377=events[_0x47f073];var _0x4cca9a=createListener(_0x8edd('0xa')+_0x3dd377,_0x2a921d);UserSettingEvents['on'](_0x3dd377,_0x4cca9a);}}; \ No newline at end of file +var _0x12f8=['register','length','user-setting:','./user-setting.events','update','emit','user-setting:update:user-','UserId'];(function(_0x2cdf0c,_0x4c66f4){var _0x4260d7=function(_0x1df228){while(--_0x1df228){_0x2cdf0c['push'](_0x2cdf0c['shift']());}};_0x4260d7(++_0x4c66f4);}(_0x12f8,0x1c3));var _0x812f=function(_0xa260aa,_0x3608b2){_0xa260aa=_0xa260aa-0x0;var _0x4bfb81=_0x12f8[_0xa260aa];return _0x4bfb81;};'use strict';var UserSettingEvents=require(_0x812f('0x0'));var events=['save','remove',_0x812f('0x1')];function createListener(_0x110bf9,_0x417667){return function(_0x134999){_0x417667[_0x812f('0x2')](_0x110bf9,_0x134999);if(_0x110bf9==='user-setting:update'){_0x417667[_0x812f('0x2')](_0x812f('0x3')+_0x134999[_0x812f('0x4')],_0x134999);}};}exports[_0x812f('0x5')]=function(_0x20af35){for(var _0x53c6b0=0x0,_0x594033=events[_0x812f('0x6')];_0x53c6b0<_0x594033;_0x53c6b0++){var _0x44ae72=events[_0x53c6b0];var _0x5aee78=createListener(_0x812f('0x7')+_0x44ae72,_0x20af35);UserSettingEvents['on'](_0x44ae72,_0x5aee78);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 5b6ee45..b1e6aa4 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 _0xbb18=['/:id','show','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','join','server/files/images/','format','%s-%s','now','originalname','single','addAvatar','login','/:id/logout','pause','unpause','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/whoami','/presence'];(function(_0x493c63,_0x2c7f1f){var _0x2d5330=function(_0x523c57){while(--_0x523c57){_0x493c63['push'](_0x493c63['shift']());}};_0x2d5330(++_0x2c7f1f);}(_0xbb18,0x12b));var _0x8bb1=function(_0x515da8,_0x3b69d2){_0x515da8=_0x515da8-0x0;var _0x10da36=_0xbb18[_0x515da8];return _0x10da36;};'use strict';var multer=require(_0x8bb1('0x0'));var util=require(_0x8bb1('0x1'));var path=require('path');var timeout=require(_0x8bb1('0x2'));var express=require(_0x8bb1('0x3'));var router=express['Router']();var fs_extra=require(_0x8bb1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8bb1('0x5'));var controller=require(_0x8bb1('0x6'));router['get']('/',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x8')]);router[_0x8bb1('0x9')](_0x8bb1('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8bb1('0x9')](_0x8bb1('0xb'),auth[_0x8bb1('0x7')](),controller['whoami']);router[_0x8bb1('0x9')](_0x8bb1('0xc'),auth[_0x8bb1('0x7')](),controller['getPresence']);router['get'](_0x8bb1('0xd'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0xe')]);router['get']('/:id/avatar',controller['getAvatar']);router['get'](_0x8bb1('0xf'),auth[_0x8bb1('0x7')](),controller['getOpenTabs']);router[_0x8bb1('0x9')](_0x8bb1('0x10'),auth['isAuthenticated'](),controller[_0x8bb1('0x11')]);router['get'](_0x8bb1('0x12'),auth['isAuthenticated'](),controller['getQueues']);router[_0x8bb1('0x9')]('/:id/queues_rt',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x13')]);router[_0x8bb1('0x9')](_0x8bb1('0x14'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x15')]);router[_0x8bb1('0x9')](_0x8bb1('0x16'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x17')]);router[_0x8bb1('0x9')](_0x8bb1('0x18'),auth['isAuthenticated'](),controller[_0x8bb1('0x19')]);router[_0x8bb1('0x9')](_0x8bb1('0x1a'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x1b')]);router[_0x8bb1('0x9')]('/:id/openchannel/interactions',auth[_0x8bb1('0x7')](),controller['getOpenchannelInteractions']);router[_0x8bb1('0x9')](_0x8bb1('0x1c'),auth['isAuthenticated'](),controller[_0x8bb1('0x1d')]);router['get']('/:id/sms/interactions',auth[_0x8bb1('0x7')](),controller['getSmsInteractions']);router[_0x8bb1('0x9')](_0x8bb1('0x1e'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x8bb1('0x9')](_0x8bb1('0x1f'),auth[_0x8bb1('0x7')](),controller['getWhatsappInteractions']);router[_0x8bb1('0x9')](_0x8bb1('0x20'),auth[_0x8bb1('0x7')](),controller['getTeams']);router['get'](_0x8bb1('0x21'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x22')]);router[_0x8bb1('0x9')](_0x8bb1('0x23'),auth[_0x8bb1('0x7')](),controller['getAgents']);router[_0x8bb1('0x9')](_0x8bb1('0x24'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x25')]);router[_0x8bb1('0x9')]('/:id/fax_accounts',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x26')]);router[_0x8bb1('0x9')](_0x8bb1('0x27'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x28')]);router['get'](_0x8bb1('0x29'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x2a')]);router[_0x8bb1('0x9')]('/:id/sms_accounts',auth[_0x8bb1('0x7')](),controller['getSmsAccounts']);router[_0x8bb1('0x9')](_0x8bb1('0x2b'),auth[_0x8bb1('0x7')](),controller['getChatWebsites']);router[_0x8bb1('0x9')](_0x8bb1('0x2c'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x2d')]);router[_0x8bb1('0x9')](_0x8bb1('0x2e'),auth[_0x8bb1('0x7')](),controller['getSquareProjects']);router[_0x8bb1('0x9')]('/:id/scheduled_calls',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x2f')]);router[_0x8bb1('0x9')](_0x8bb1('0x30'),auth['isAuthenticated'](),controller[_0x8bb1('0x31')]);router[_0x8bb1('0x32')](_0x8bb1('0x10'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x33')]);router[_0x8bb1('0x32')]('/',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x34')]);router['post'](_0x8bb1('0x35'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x36')]);router['post']('/:id/queues',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14ab82,_0x591eae,_0x262bdd){_0x262bdd(null,path[_0x8bb1('0x38')](config['root'],_0x8bb1('0x39')));},'filename':function(_0x3c05d8,_0x31f10a,_0x1f92ae){_0x1f92ae(null,util[_0x8bb1('0x3a')](_0x8bb1('0x3b'),Date[_0x8bb1('0x3c')](),_0x31f10a[_0x8bb1('0x3d')]));}})});router[_0x8bb1('0x32')]('/:id/avatar',upload[_0x8bb1('0x3e')]('file'),controller[_0x8bb1('0x3f')]);router[_0x8bb1('0x32')]('/:id/login',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x40')]);router[_0x8bb1('0x32')](_0x8bb1('0x41'),auth[_0x8bb1('0x7')](),controller['logout']);router['post']('/:id/pause',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x42')]);router[_0x8bb1('0x32')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x8bb1('0x43')]);router[_0x8bb1('0x32')](_0x8bb1('0x20'),auth[_0x8bb1('0x7')](),controller['addTeams']);router[_0x8bb1('0x32')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x8bb1('0x44')]);router['post']('/:id/mail_interactions',auth[_0x8bb1('0x7')](),controller['addMailInteractions']);router[_0x8bb1('0x32')](_0x8bb1('0x45'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x46')]);router[_0x8bb1('0x32')](_0x8bb1('0x47'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x48')]);router[_0x8bb1('0x32')](_0x8bb1('0x49'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x4a')]);router[_0x8bb1('0x32')](_0x8bb1('0x4b'),auth['isAuthenticated'](),controller[_0x8bb1('0x4c')]);router[_0x8bb1('0x32')](_0x8bb1('0x4d'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x4e')]);router[_0x8bb1('0x32')](_0x8bb1('0x27'),auth[_0x8bb1('0x7')](),controller['addMailAccounts']);router[_0x8bb1('0x32')](_0x8bb1('0x29'),auth[_0x8bb1('0x7')](),controller['addOpenchannelAccounts']);router[_0x8bb1('0x32')](_0x8bb1('0x4f'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x50')]);router['post'](_0x8bb1('0x2b'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x51')]);router[_0x8bb1('0x32')](_0x8bb1('0x2c'),auth[_0x8bb1('0x7')](),controller['addWhatsappAccounts']);router[_0x8bb1('0x32')](_0x8bb1('0x2e'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x52')]);router['post'](_0x8bb1('0x30'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x53')]);router[_0x8bb1('0x54')](_0x8bb1('0xd'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x55')]);router[_0x8bb1('0x54')]('/:id/password',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x56')]);router[_0x8bb1('0x57')](_0x8bb1('0x12'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x58')]);router[_0x8bb1('0x57')](_0x8bb1('0x20'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x59')]);router[_0x8bb1('0x57')](_0x8bb1('0xd'),auth['isAuthenticated'](),controller[_0x8bb1('0x5a')]);router['delete'](_0x8bb1('0x5b'),auth[_0x8bb1('0x7')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x5c')]);router[_0x8bb1('0x57')](_0x8bb1('0x45'),auth['isAuthenticated'](),controller[_0x8bb1('0x5d')]);router['delete'](_0x8bb1('0x47'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x5e')]);router[_0x8bb1('0x57')](_0x8bb1('0x49'),auth[_0x8bb1('0x7')](),controller['removeOpenchannelInteractions']);router[_0x8bb1('0x57')](_0x8bb1('0x4b'),auth['isAuthenticated'](),controller[_0x8bb1('0x5f')]);router[_0x8bb1('0x57')](_0x8bb1('0x4d'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x60')]);router[_0x8bb1('0x57')]('/:id/mail_accounts',auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x61')]);router[_0x8bb1('0x57')](_0x8bb1('0x29'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x62')]);router[_0x8bb1('0x57')](_0x8bb1('0x4f'),auth['isAuthenticated'](),controller[_0x8bb1('0x63')]);router[_0x8bb1('0x57')](_0x8bb1('0x2b'),auth[_0x8bb1('0x7')](),controller['removeChatWebsites']);router[_0x8bb1('0x57')](_0x8bb1('0x2c'),auth['isAuthenticated'](),controller[_0x8bb1('0x64')]);router[_0x8bb1('0x57')](_0x8bb1('0x2e'),auth[_0x8bb1('0x7')](),controller[_0x8bb1('0x65')]);router[_0x8bb1('0x57')](_0x8bb1('0x30'),auth['isAuthenticated'](),controller[_0x8bb1('0x66')]);module[_0x8bb1('0x67')]=router; \ No newline at end of file +var _0xd7d7=['/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/agents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getApiKey','post','addContacts','create','/create_many','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login'];(function(_0x119940,_0x4f6830){var _0x158581=function(_0x2ce545){while(--_0x2ce545){_0x119940['push'](_0x119940['shift']());}};_0x158581(++_0x4f6830);}(_0xd7d7,0x193));var _0x7d7d=function(_0x43ec69,_0x209500){_0x43ec69=_0x43ec69-0x0;var _0x1e0fcb=_0xd7d7[_0x43ec69];return _0x1e0fcb;};'use strict';var multer=require(_0x7d7d('0x0'));var util=require(_0x7d7d('0x1'));var path=require(_0x7d7d('0x2'));var timeout=require(_0x7d7d('0x3'));var express=require(_0x7d7d('0x4'));var router=express[_0x7d7d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7d7d('0x6'));var config=require(_0x7d7d('0x7'));var controller=require(_0x7d7d('0x8'));router[_0x7d7d('0x9')]('/',auth[_0x7d7d('0xa')](),controller['index']);router['get'](_0x7d7d('0xb'),auth[_0x7d7d('0xa')](),controller['describe']);router[_0x7d7d('0x9')](_0x7d7d('0xc'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0xd')]);router[_0x7d7d('0x9')](_0x7d7d('0xe'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0xf')]);router['get'](_0x7d7d('0x10'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x11')]);router[_0x7d7d('0x9')](_0x7d7d('0x12'),controller[_0x7d7d('0x13')]);router['get'](_0x7d7d('0x14'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x15')]);router[_0x7d7d('0x9')]('/:id/contacts',auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x16')]);router[_0x7d7d('0x9')](_0x7d7d('0x17'),auth['isAuthenticated'](),controller[_0x7d7d('0x18')]);router[_0x7d7d('0x9')](_0x7d7d('0x19'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x7d7d('0x9')](_0x7d7d('0x1a'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x1b')]);router[_0x7d7d('0x9')](_0x7d7d('0x1c'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x1d')]);router[_0x7d7d('0x9')](_0x7d7d('0x1e'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x1f')]);router['get'](_0x7d7d('0x20'),auth[_0x7d7d('0xa')](),controller['getChatInteractions']);router[_0x7d7d('0x9')](_0x7d7d('0x21'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x22')]);router[_0x7d7d('0x9')](_0x7d7d('0x23'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x24')]);router['get'](_0x7d7d('0x25'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x26')]);router['get'](_0x7d7d('0x27'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x28')]);router[_0x7d7d('0x9')](_0x7d7d('0x29'),auth[_0x7d7d('0xa')](),controller['getWhatsappInteractions']);router[_0x7d7d('0x9')]('/:id/teams',auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x2a')]);router['get']('/:id/lists',auth[_0x7d7d('0xa')](),controller['getLists']);router[_0x7d7d('0x9')](_0x7d7d('0x2b'),auth[_0x7d7d('0xa')](),controller['getAgents']);router[_0x7d7d('0x9')](_0x7d7d('0x2c'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x2d')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x7d7d('0x2e')]);router[_0x7d7d('0x9')](_0x7d7d('0x2f'),auth['isAuthenticated'](),controller[_0x7d7d('0x30')]);router['get'](_0x7d7d('0x31'),auth[_0x7d7d('0xa')](),controller['getOpenchannelAccounts']);router[_0x7d7d('0x9')](_0x7d7d('0x32'),auth['isAuthenticated'](),controller['getSmsAccounts']);router['get'](_0x7d7d('0x33'),auth['isAuthenticated'](),controller[_0x7d7d('0x34')]);router['get'](_0x7d7d('0x35'),auth['isAuthenticated'](),controller[_0x7d7d('0x36')]);router[_0x7d7d('0x9')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x7d7d('0x37')]);router[_0x7d7d('0x9')](_0x7d7d('0x38'),auth[_0x7d7d('0xa')](),controller['getScheduledCalls']);router[_0x7d7d('0x9')]('/:id/api_key',auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x39')]);router[_0x7d7d('0x3a')]('/:id/contacts',auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x3b')]);router[_0x7d7d('0x3a')]('/',auth['isAuthenticated'](),controller[_0x7d7d('0x3c')]);router[_0x7d7d('0x3a')](_0x7d7d('0x3d'),auth[_0x7d7d('0xa')](),controller['bulkCreate']);router[_0x7d7d('0x3a')]('/:id/queues',auth[_0x7d7d('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x47f470,_0x5ddcbd,_0x37b093){_0x37b093(null,path[_0x7d7d('0x3e')](config[_0x7d7d('0x3f')],_0x7d7d('0x40')));},'filename':function(_0x1f2615,_0x5320c2,_0xcdbdbf){_0xcdbdbf(null,util[_0x7d7d('0x41')](_0x7d7d('0x42'),Date[_0x7d7d('0x43')](),_0x5320c2[_0x7d7d('0x44')]));}})});router[_0x7d7d('0x3a')](_0x7d7d('0x12'),upload[_0x7d7d('0x45')](_0x7d7d('0x46')),controller[_0x7d7d('0x47')]);router[_0x7d7d('0x3a')](_0x7d7d('0x48'),auth['isAuthenticated'](),controller['login']);router[_0x7d7d('0x3a')](_0x7d7d('0x49'),auth[_0x7d7d('0xa')](),controller['logout']);router[_0x7d7d('0x3a')](_0x7d7d('0x4a'),auth['isAuthenticated'](),controller[_0x7d7d('0x4b')]);router[_0x7d7d('0x3a')](_0x7d7d('0x4c'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x4d')]);router[_0x7d7d('0x3a')](_0x7d7d('0x4e'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x4f')]);router['post'](_0x7d7d('0x50'),auth[_0x7d7d('0xa')](),controller['addChatInteractions']);router['post'](_0x7d7d('0x51'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x52')]);router[_0x7d7d('0x3a')](_0x7d7d('0x53'),auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x7d7d('0x3a')](_0x7d7d('0x54'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x55')]);router[_0x7d7d('0x3a')](_0x7d7d('0x56'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x57')]);router['post']('/:id/whatsapp_interactions',auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x58')]);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x7d7d('0x59')]);router[_0x7d7d('0x3a')](_0x7d7d('0x2f'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x5a')]);router['post'](_0x7d7d('0x31'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x5b')]);router[_0x7d7d('0x3a')](_0x7d7d('0x32'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x5c')]);router[_0x7d7d('0x3a')](_0x7d7d('0x33'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x5d')]);router[_0x7d7d('0x3a')]('/:id/whatsapp_accounts',auth[_0x7d7d('0xa')](),controller['addWhatsappAccounts']);router[_0x7d7d('0x3a')](_0x7d7d('0x5e'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x5f')]);router['post'](_0x7d7d('0x60'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x61')]);router[_0x7d7d('0x62')](_0x7d7d('0x10'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x63')]);router['put'](_0x7d7d('0x64'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x65')]);router[_0x7d7d('0x66')](_0x7d7d('0x17'),auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x7d7d('0x4e'),auth['isAuthenticated'](),controller[_0x7d7d('0x67')]);router[_0x7d7d('0x66')](_0x7d7d('0x10'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x68')]);router['delete'](_0x7d7d('0x50'),auth['isAuthenticated'](),controller[_0x7d7d('0x69')]);router['delete'](_0x7d7d('0x51'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x6a')]);router[_0x7d7d('0x66')](_0x7d7d('0x53'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x6b')]);router[_0x7d7d('0x66')](_0x7d7d('0x54'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x6c')]);router[_0x7d7d('0x66')](_0x7d7d('0x56'),auth['isAuthenticated'](),controller[_0x7d7d('0x6d')]);router[_0x7d7d('0x66')](_0x7d7d('0x6e'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x6f')]);router['delete'](_0x7d7d('0x70'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x71')]);router['delete'](_0x7d7d('0x2f'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x72')]);router['delete'](_0x7d7d('0x31'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x7d7d('0x66')](_0x7d7d('0x32'),auth[_0x7d7d('0xa')](),controller['removeSmsAccounts']);router[_0x7d7d('0x66')](_0x7d7d('0x33'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x7d7d('0x66')](_0x7d7d('0x35'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x73')]);router[_0x7d7d('0x66')](_0x7d7d('0x5e'),auth['isAuthenticated'](),controller[_0x7d7d('0x74')]);router[_0x7d7d('0x66')](_0x7d7d('0x60'),auth[_0x7d7d('0xa')](),controller[_0x7d7d('0x75')]);module[_0x7d7d('0x76')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index bf10270..5d099f9 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 _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x5c5e88,_0x520709){var _0x46f315=function(_0x5a0d28){while(--_0x5a0d28){_0x5c5e88['push'](_0x5c5e88['shift']());}};_0x46f315(++_0x520709);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0xcb91[_0x421c56];return _0x49b244;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x406e46,_0x5799cb){var _0x4a3742=function(_0x1fa435){while(--_0x1fa435){_0x406e46['push'](_0x406e46['shift']());}};_0x4a3742(++_0x5799cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](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['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](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')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'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(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'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('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'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['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'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['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'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['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index d9e70c2..8260123 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 _0xe0a1=['uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','offline','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','util','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','redis','./user.socket','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','update','userNotification:recalc:','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','find','name','UserProfileResource','send','index','User','fieldName','type','key','includes','password','salt','getOptions','where','includeAll','include','query','true','userSetting','attributes','push','findAll','openTabs','rows','length','chat','dataValues','sms','fax','openchannel','whatsapp','all','params','differenceBy','rawAttributes','keys','filters','model','intersection','fields','UserSetting','merge','options','body','describe','addContacts','ids','internal','Setting','findById','validatePasswordPattern','isNil','min_internal','sequelize','SELECT','from','mailbox','email','permissions','103','113','110','105','106','107','109','111','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','channel','online','loginInPause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','spread','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','upsert','Unknown\x20channel','isArray','QueueId','Queue:remove','addAvatar','file','filename','server/files/images/logos/default_profile.png','userpic','download','existsSync','root','server/files/images/','join','getOpenTabs','mail','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','hasOwnProperty','Tag','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','intrf','user:%s','connection','remoteAddress','socket','UserVoiceQueueRt','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','Team','getTeams','addTeams','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','penalty','UserVoicePrefix','removeTeams','removeAgent','TeamVoicePrefix','VoicePrefixId','getLists','CmList','getAgents','addChatInteractions','omit','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gt','$gte','$lte','$ne','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','lastName','Contact','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','flatten','lower','toString','desc','asc','substring'];(function(_0x50d12c,_0x2ce42a){var _0x800541=function(_0x366640){while(--_0x366640){_0x50d12c['push'](_0x50d12c['shift']());}};_0x800541(++_0x2ce42a);}(_0xe0a1,0x1a0));var _0x1e0a=function(_0x449949,_0x4065ba){_0x449949=_0x449949-0x0;var _0x2e76fe=_0xe0a1[_0x449949];return _0x2e76fe;};'use strict';var moment=require('moment');var util=require(_0x1e0a('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x1e0a('0x1'));var squel=require(_0x1e0a('0x2'));var jayson=require(_0x1e0a('0x3'));var Redis=require(_0x1e0a('0x4'));var authService=require(_0x1e0a('0x5'));var qs=require(_0x1e0a('0x6'));var logger=require('../../config/logger')(_0x1e0a('0x7'));var utils=require('../../config/utils');var config=require(_0x1e0a('0x8'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x1e0a('0x9'))[_0x1e0a('0xa')];var APINotFoundError=require(_0x1e0a('0x9'))[_0x1e0a('0xb')];var APIHandleError=require(_0x1e0a('0x9'))[_0x1e0a('0xc')];var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x1e0a('0xd')]));require(_0x1e0a('0xe'))['register'](socket);config[_0x1e0a('0xd')]=_[_0x1e0a('0xf')](config[_0x1e0a('0xd')],{'host':_0x1e0a('0x10'),'port':0x18eb});var amiClient=jayson[_0x1e0a('0x11')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x1989ce,_0x486d20,_0x320c2c,_0x1c7de5){return new Promise(function(_0x20a27a,_0x36595a){var _0x1a769e=_0x1c7de5||amiClient;return _0x1a769e[_0x1e0a('0x12')](_0x1989ce,_0x320c2c)[_0x1e0a('0x13')](function(_0x403e3f){logger[_0x1e0a('0x14')](_0x1e0a('0x15'),_0x486d20,_0x1e0a('0x16'));logger['debug'](_0x1e0a('0x17'),_0x486d20,_0x1e0a('0x16'),JSON[_0x1e0a('0x18')](_0x403e3f));if(_0x403e3f['error']){if(_0x403e3f[_0x1e0a('0x19')][_0x1e0a('0x1a')]===0x1f4){logger[_0x1e0a('0x19')](_0x1e0a('0x15'),_0x486d20,_0x403e3f[_0x1e0a('0x19')]['message']);return _0x36595a(_0x403e3f[_0x1e0a('0x19')]['message']);}logger[_0x1e0a('0x19')]('User,\x20%s,\x20%s',_0x486d20,_0x403e3f['error']['message']);return _0x20a27a(_0x403e3f['error'][_0x1e0a('0x1b')]);}else{logger[_0x1e0a('0x14')]('User,\x20%s,\x20%s',_0x486d20,_0x1e0a('0x16'));_0x20a27a(_0x403e3f[_0x1e0a('0x1c')][_0x1e0a('0x1b')]);}})[_0x1e0a('0x1d')](function(_0xda14b1){logger['error'](_0x1e0a('0x15'),_0x486d20,_0xda14b1);_0x36595a(_0xda14b1);});});}function respondWithStatusCode(_0xe0e673,_0xad59aa){_0xad59aa=_0xad59aa||0xcc;return function(_0x461bb8){if(_0x461bb8){return _0xe0e673[_0x1e0a('0x1e')](_0xad59aa);}return _0xe0e673['status'](_0xad59aa)[_0x1e0a('0x1f')]();};}function respondWithResult(_0x2c9bb0,_0x5bcdb7){_0x5bcdb7=_0x5bcdb7||0xc8;return function(_0x57bc06){if(_0x57bc06){return _0x2c9bb0[_0x1e0a('0x20')](_0x5bcdb7)['json'](_0x57bc06);}};}function respondWithFilteredResult(_0x417e3e,_0x515cb8){return function(_0x55a831){if(_0x55a831){var _0x498b38=typeof _0x515cb8[_0x1e0a('0x21')]===_0x1e0a('0x22')&&typeof _0x515cb8['limit']===_0x1e0a('0x22');var _0x501c31=_0x55a831[_0x1e0a('0x23')];var _0x2769ed=_0x498b38?0x0:_0x515cb8[_0x1e0a('0x21')];var _0x35a5fc=_0x498b38?_0x55a831['count']:_0x515cb8['offset']+_0x515cb8[_0x1e0a('0x24')];var _0x25c744;if(_0x35a5fc>=_0x501c31){_0x35a5fc=_0x501c31;_0x25c744=0xc8;}else{_0x25c744=0xce;}_0x417e3e[_0x1e0a('0x20')](_0x25c744);return _0x417e3e[_0x1e0a('0x25')](_0x1e0a('0x26'),_0x2769ed+'-'+_0x35a5fc+'/'+_0x501c31)[_0x1e0a('0x27')](_0x55a831);}return null;};}function saveUpdates(_0x523065){return function(_0x35acb1){if(_0x35acb1){return _0x35acb1[_0x1e0a('0x28')](_0x523065)[_0x1e0a('0x13')](function(_0x1350ff){socket['emit'](_0x1e0a('0x29')+_0x1350ff['id'],{});return _0x1350ff;});}return null;};}function removeEntity(_0x162420){return function(_0x1a3bb0){if(_0x1a3bb0){return _0x1a3bb0[_0x1e0a('0x2a')]()[_0x1e0a('0x13')](function(){var _0x5396bd=_0x1a3bb0[_0x1e0a('0x2b')]({'plain':!![]});if(_0x5396bd[_0x1e0a('0x2c')]===_0x1e0a('0x2d'))return;var _0x234b6a=[{'name':_0x1e0a('0x2e'),'value':_0x1e0a('0x2f'),'ignore':!![]},{'name':_0x1e0a('0x30'),'value':_0x1e0a('0x31'),'ignore':![]},{'name':_0x1e0a('0x32'),'value':_0x1e0a('0x33'),'ignore':![]}];var _0x2b3d82=_(_0x234b6a)[_0x1e0a('0x34')](_0x1e0a('0x35'))[_0x1e0a('0x36')](_0x1e0a('0x37'))['value']();if(_['includes'](_0x2b3d82,_0x5396bd[_0x1e0a('0x2c')])){return;}var _0x16e329=_[_0x1e0a('0x38')](_0x234b6a,[_0x1e0a('0x37'),_0x5396bd[_0x1e0a('0x2c')]])[_0x1e0a('0x39')];return db[_0x1e0a('0x3a')][_0x1e0a('0x2a')]({'where':{'type':_0x16e329,'resourceId':_0x5396bd['id']}})[_0x1e0a('0x13')](function(){return _0x1a3bb0;});})[_0x1e0a('0x13')](function(){_0x162420[_0x1e0a('0x20')](0xcc)[_0x1e0a('0x1f')]();});}};}function handleEntityNotFound(_0x15dbbd){return function(_0x6c0908){if(!_0x6c0908){_0x15dbbd[_0x1e0a('0x1e')](0x194);}return _0x6c0908;};}function handleError(_0x579d16,_0x52ef98){_0x52ef98=_0x52ef98||0x1f4;return function(_0x3b0de7){logger[_0x1e0a('0x19')](_0x3b0de7['stack']);if(_0x3b0de7[_0x1e0a('0x39')]){delete _0x3b0de7[_0x1e0a('0x39')];}_0x579d16[_0x1e0a('0x20')](_0x52ef98)[_0x1e0a('0x3b')](_0x3b0de7);};}exports[_0x1e0a('0x3c')]=function(_0x14118b,_0x998dc){var _0x1a4a07={},_0x5cd819={'count':0x0,'rows':[]};var _0x8deb12=_(db[_0x1e0a('0x3d')]['rawAttributes'])[_0x1e0a('0x36')](function(_0x4d0b64){return{'name':_0x4d0b64[_0x1e0a('0x3e')],'type':_0x4d0b64[_0x1e0a('0x3f')][_0x1e0a('0x40')]};})[_0x1e0a('0x34')](function(_0x22c4e4){return!_[_0x1e0a('0x41')]([_0x1e0a('0x42'),_0x1e0a('0x43')],_0x22c4e4[_0x1e0a('0x39')]);})[_0x1e0a('0x37')]();_0x1a4a07=qs[_0x1e0a('0x44')](_0x8deb12,_0x14118b);var _0x12431f={'where':_0x1a4a07[_0x1e0a('0x45')]};return db[_0x1e0a('0x3d')][_0x1e0a('0x23')](_0x12431f)[_0x1e0a('0x13')](function(_0x51154b){_0x5cd819[_0x1e0a('0x23')]=_0x51154b;if(_0x14118b['query'][_0x1e0a('0x46')]){_0x1a4a07[_0x1e0a('0x47')]=[{'all':!![]}];}if(_0x14118b[_0x1e0a('0x48')]['userSetting']===_0x1e0a('0x49')){_0x1a4a07[_0x1e0a('0x47')]=[{'model':db['UserSetting'],'as':_0x1e0a('0x4a')}];}if(!_['includes'](_0x1a4a07[_0x1e0a('0x4b')],'id')){_0x1a4a07['attributes'][_0x1e0a('0x4c')]('id');}return db['User'][_0x1e0a('0x4d')](_0x1a4a07);})['then'](function(_0x369160){_0x5cd819['rows']=_0x369160;if(_0x14118b['query'][_0x1e0a('0x4e')]===_0x1e0a('0x49')){var _0x11f326=[];for(var _0x4abd65=0x0;_0x4abd65<_0x5cd819[_0x1e0a('0x4f')][_0x1e0a('0x50')];_0x4abd65++){_0x11f326['push'](get_open_tabs(_0x1e0a('0x51'),_0x5cd819['rows'][_0x4abd65][_0x1e0a('0x52')]));_0x11f326['push'](get_open_tabs(_0x1e0a('0x53'),_0x5cd819['rows'][_0x4abd65][_0x1e0a('0x52')]));_0x11f326[_0x1e0a('0x4c')](get_open_tabs(_0x1e0a('0x54'),_0x5cd819[_0x1e0a('0x4f')][_0x4abd65][_0x1e0a('0x52')]));_0x11f326[_0x1e0a('0x4c')](get_open_tabs('mail',_0x5cd819[_0x1e0a('0x4f')][_0x4abd65][_0x1e0a('0x52')]));_0x11f326['push'](get_open_tabs(_0x1e0a('0x55'),_0x5cd819['rows'][_0x4abd65][_0x1e0a('0x52')]));_0x11f326['push'](get_open_tabs(_0x1e0a('0x56'),_0x5cd819[_0x1e0a('0x4f')][_0x4abd65][_0x1e0a('0x52')]));}return Promise[_0x1e0a('0x57')](_0x11f326)[_0x1e0a('0x13')](function(){return _0x5cd819;});}else{return _0x5cd819;}})[_0x1e0a('0x13')](respondWithFilteredResult(_0x998dc,_0x1a4a07))['catch'](handleError(_0x998dc,null));};exports['show']=function(_0xfb872b,_0x2fd4d2){var _0x2e316d={'raw':![],'where':{'id':_0xfb872b[_0x1e0a('0x58')]['id']}},_0x1a5992={};_0x1a5992['model']=_[_0x1e0a('0x59')](_['keys'](db['User'][_0x1e0a('0x5a')]),[_0x1e0a('0x42'),'salt']);_0x1a5992[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0xfb872b[_0x1e0a('0x48')]);_0x1a5992[_0x1e0a('0x5c')]=_['intersection'](_0x1a5992[_0x1e0a('0x5d')],_0x1a5992[_0x1e0a('0x48')]);_0x2e316d[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x1a5992[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0xfb872b[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x2e316d[_0x1e0a('0x4b')]=_0x2e316d[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x2e316d[_0x1e0a('0x4b')]:_0x1a5992[_0x1e0a('0x5d')];if(_0xfb872b['query'][_0x1e0a('0x46')]){_0x2e316d[_0x1e0a('0x47')]=[{'all':!![]}];}if(_0xfb872b['query']['userSetting']===_0x1e0a('0x49')){_0x2e316d['include']=[{'model':db[_0x1e0a('0x60')],'as':'userSetting'}];}_0x2e316d=_[_0x1e0a('0x61')]({},_0x2e316d,_0xfb872b[_0x1e0a('0x62')]);if(!_['includes'](_0x2e316d[_0x1e0a('0x4b')],'id')){_0x2e316d[_0x1e0a('0x4b')][_0x1e0a('0x4c')]('id');}return db[_0x1e0a('0x3d')][_0x1e0a('0x38')](_0x2e316d)[_0x1e0a('0x13')](handleEntityNotFound(_0x2fd4d2,null))['then'](function(_0x5d797e){var _0x2947da=[];values=_0x5d797e;if(_0xfb872b[_0x1e0a('0x48')]['openTabs']===_0x1e0a('0x49')){_0x2947da[_0x1e0a('0x4c')](get_open_tabs(_0x1e0a('0x51'),_0x5d797e[_0x1e0a('0x52')]));_0x2947da[_0x1e0a('0x4c')](get_open_tabs(_0x1e0a('0x53'),_0x5d797e[_0x1e0a('0x52')]));_0x2947da['push'](get_open_tabs(_0x1e0a('0x55'),_0x5d797e['dataValues']));_0x2947da['push'](get_open_tabs('whatsapp',_0x5d797e[_0x1e0a('0x52')]));_0x2947da[_0x1e0a('0x4c')](get_open_tabs(_0x1e0a('0x54'),_0x5d797e[_0x1e0a('0x52')]));_0x2947da['push'](get_open_tabs('mail',_0x5d797e[_0x1e0a('0x52')]));return Promise[_0x1e0a('0x57')](_0x2947da);}else{return values;}})[_0x1e0a('0x13')](function(){return values;})['then'](respondWithResult(_0x2fd4d2,null))[_0x1e0a('0x1d')](handleError(_0x2fd4d2,null));};exports[_0x1e0a('0x28')]=function(_0x33bd5a,_0x13cd2d){if(_0x33bd5a[_0x1e0a('0x63')]['id']){delete _0x33bd5a[_0x1e0a('0x63')]['id'];}delete _0x33bd5a[_0x1e0a('0x63')][_0x1e0a('0x2c')];return db['User'][_0x1e0a('0x38')]({'where':{'id':_0x33bd5a[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x13cd2d,null))['then'](saveUpdates(_0x33bd5a['body'],null))[_0x1e0a('0x13')](respondWithResult(_0x13cd2d,null))[_0x1e0a('0x1d')](handleError(_0x13cd2d,null));};exports[_0x1e0a('0x64')]=function(_0x1f43c5,_0x19f6b8){return db[_0x1e0a('0x3d')][_0x1e0a('0x64')]()['then'](respondWithResult(_0x19f6b8,null))['catch'](handleError(_0x19f6b8,null));};exports['addContacts']=function(_0x3ccee4,_0x115fad){return db[_0x1e0a('0x3d')]['find']({'where':{'id':_0x3ccee4[_0x1e0a('0x58')]['id']}})['then'](handleEntityNotFound(_0x115fad,null))[_0x1e0a('0x13')](function(_0x1f83ab){if(_0x1f83ab){return _0x1f83ab[_0x1e0a('0x65')](_0x3ccee4[_0x1e0a('0x63')][_0x1e0a('0x66')],_['omit'](_0x3ccee4['body'],[_0x1e0a('0x66'),'id'])||{});}})[_0x1e0a('0x13')](respondWithResult(_0x115fad,null))['catch'](handleError(_0x115fad,null));};function validateUser(_0x2bf1a7){return new Promise(function(_0x35957c,_0x9f195f){if(_0x2bf1a7[_0x1e0a('0x67')])return _0x35957c(_0x2bf1a7);return db[_0x1e0a('0x68')][_0x1e0a('0x69')](0x1)[_0x1e0a('0x13')](function(_0xce73b9){if(_0xce73b9['securePassword'])authService[_0x1e0a('0x6a')](_0x2bf1a7[_0x1e0a('0x42')]);db[_0x1e0a('0x3d')]['max'](_0x1e0a('0x67'))[_0x1e0a('0x13')](function(_0x2ad78f){if(_[_0x1e0a('0x6b')](_0x2ad78f)){_0x2bf1a7[_0x1e0a('0x67')]=_0xce73b9[_0x1e0a('0x6c')]||0x1;return;}if(_[_0x1e0a('0x6b')](_0xce73b9[_0x1e0a('0x6c')])||_0xce73b9['min_internal']===_0x2ad78f){_0x2bf1a7[_0x1e0a('0x67')]=_0x2ad78f+0x1;return;}if(_0xce73b9[_0x1e0a('0x6c')]>_0x2ad78f){_0x2bf1a7['internal']=_0xce73b9[_0x1e0a('0x6c')];return;}return db[_0x1e0a('0x6d')][_0x1e0a('0x48')]('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']['QueryTypes'][_0x1e0a('0x6e')]})[_0x1e0a('0x13')](function(_0x12bf48){if(_0x12bf48&&_0x12bf48[_0x1e0a('0x50')]){for(var _0x510ab7=0x0,_0x2836ad=_0x12bf48['length'];_0x510ab7<_0x2836ad&&_['isNil'](_0x2bf1a7[_0x1e0a('0x67')]);_0x510ab7++){if(_0xce73b9['min_internal']<=_0x12bf48[_0x510ab7][_0x1e0a('0x6f')]){_0x2bf1a7[_0x1e0a('0x67')]=_0x12bf48[_0x510ab7][_0x1e0a('0x6f')];}else if(_0xce73b9['min_internal']>_0x12bf48[_0x510ab7][_0x1e0a('0x6f')]&&_0xce73b9[_0x1e0a('0x6c')]<=_0x12bf48[_0x510ab7]['to']){_0x2bf1a7[_0x1e0a('0x67')]=_0xce73b9[_0x1e0a('0x6c')];}}}if(_[_0x1e0a('0x6b')](_0x2bf1a7['internal'])){_0x2bf1a7['internal']=_0x2ad78f+0x1;}return _0x35957c(_0x2bf1a7);});});})[_0x1e0a('0x1d')](function(_0x25b691){_0x9f195f(_0x25b691);});});}function updateUser(_0x2cc57c){return new Promise(function(_0x5bd377,_0x241d64){try{if(_0x2cc57c['voicemail']){_0x2cc57c[_0x1e0a('0x70')]=_0x2cc57c[_0x1e0a('0x67')];_0x2cc57c['VoiceMail']={'mailbox':_0x2cc57c[_0x1e0a('0x67')],'password':_0x2cc57c[_0x1e0a('0x42')],'fullname':_0x2cc57c['fullname'],'email':_0x2cc57c[_0x1e0a('0x71')]};}if(_0x2cc57c[_0x1e0a('0x2c')]===_0x1e0a('0x31')){if(!_0x2cc57c[_0x1e0a('0x72')])_0x2cc57c[_0x1e0a('0x72')]=['101','102',_0x1e0a('0x73'),_0x1e0a('0x74'),_0x1e0a('0x75'),'104',_0x1e0a('0x76'),_0x1e0a('0x77'),_0x1e0a('0x78'),'108',_0x1e0a('0x79'),'100',_0x1e0a('0x7a'),'114','115'];}_0x5bd377(_0x2cc57c);}catch(_0x292d6c){_0x241d64(_0x292d6c);}});}exports[_0x1e0a('0x7b')]=function(_0x3e64e4,_0x486b2f){if(_0x3e64e4[_0x1e0a('0x2f')][_0x1e0a('0x2c')]===_0x1e0a('0x31'))throw new Error(_0x1e0a('0x7c'));if(_0x3e64e4[_0x1e0a('0x63')]['role']===_0x1e0a('0x2f')&&_0x3e64e4[_0x1e0a('0x2f')][_0x1e0a('0x2c')]!==_0x1e0a('0x2d')){throw new Error(_0x1e0a('0x7d'));}if(_0x3e64e4['body']['role']==='admin'&&_0x3e64e4[_0x1e0a('0x2f')]['role']!==_0x1e0a('0x2d')){throw new Error(_0x1e0a('0x7e'));}return licenseUtil[_0x1e0a('0x7f')]([_0x3e64e4[_0x1e0a('0x63')]])['then'](function(){return validateUser(_0x3e64e4[_0x1e0a('0x63')]);})[_0x1e0a('0x13')](function(_0x4efdcf){return updateUser(_0x4efdcf)['then'](function(_0x458037){if(_0x458037[_0x1e0a('0x2c')]===_0x1e0a('0x2d')){_0x458037[_0x1e0a('0x80')]=_0x3e64e4[_0x1e0a('0x2f')]['settingsEnabled'];delete _0x458037[_0x1e0a('0x81')];}return _0x458037;});})[_0x1e0a('0x13')](function(_0x4a0930){return db['User'][_0x1e0a('0x7b')](_0x4a0930,{'include':[{'model':db['VoiceMail'],'as':_0x1e0a('0x82')}]});})['then'](function(_0x5d32bd){if(_0x3e64e4[_0x1e0a('0x63')][_0x1e0a('0x2c')]===_0x1e0a('0x2f'))return _0x5d32bd;if(_0x3e64e4['user']['role']!==_0x1e0a('0x2f'))return _0x5d32bd;return db[_0x1e0a('0x83')][_0x1e0a('0x38')]({'where':{'name':_0x5d32bd['role']===_0x1e0a('0x31')?'Agents':'Telephones','userProfileId':_0x3e64e4[_0x1e0a('0x2f')][_0x1e0a('0x81')]},'raw':!![]})[_0x1e0a('0x13')](function(_0x52e30b){if(!_0x52e30b||_0x52e30b[_0x1e0a('0x84')]!=0x0)return _0x5d32bd;return db['UserProfileResource'][_0x1e0a('0x7b')]({'name':_0x5d32bd[_0x1e0a('0x39')],'resourceId':_0x5d32bd['id'],'type':_0x52e30b['name'],'sectionId':_0x52e30b['id']},{})[_0x1e0a('0x13')](function(){return _0x5d32bd;});})[_0x1e0a('0x1d')](function(_0x343d77){logger[_0x1e0a('0x19')](_0x1e0a('0x85'),_0x343d77);throw _0x343d77;});})[_0x1e0a('0x13')](respondWithResult(_0x486b2f,0xc9))[_0x1e0a('0x1d')](handleError(_0x486b2f,null));};exports[_0x1e0a('0x86')]=function(_0x52f7e9,_0x3ca9dd){var _0x2a63a1=_0x52f7e9[_0x1e0a('0x63')];var _0x18225c=[];if(_0x52f7e9['user'][_0x1e0a('0x2c')]==='agent')throw new Error('Unauthorized');if(_[_0x1e0a('0x87')](_0x2a63a1,[_0x1e0a('0x2c'),'user'])&&_0x52f7e9[_0x1e0a('0x2f')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x2a63a1,['role','admin'])&&_0x52f7e9[_0x1e0a('0x2f')][_0x1e0a('0x2c')]!==_0x1e0a('0x2d')){throw new Error(_0x1e0a('0x88'));}return licenseUtil[_0x1e0a('0x7f')](_0x2a63a1)['then'](function(){return validateUser(_0x2a63a1[0x0]);})[_0x1e0a('0x13')](function(){for(var _0x485a47=0x1;_0x485a47<_0x2a63a1[_0x1e0a('0x50')];_0x485a47++){var _0x17ec7d=_0x2a63a1[_0x485a47-0x1][_0x1e0a('0x67')];if(!_0x2a63a1[_0x485a47][_0x1e0a('0x67')])_0x2a63a1[_0x485a47][_0x1e0a('0x67')]=_0x17ec7d+0x1;_0x18225c[_0x1e0a('0x4c')](validateUser(_0x2a63a1[_0x485a47]));}return Promise['all'](_0x18225c);})[_0x1e0a('0x13')](function(){_0x18225c=[];for(var _0x2173c9=0x0;_0x2173c9<_0x2a63a1['length'];_0x2173c9++){_0x18225c[_0x1e0a('0x4c')](updateUser(_0x2a63a1[_0x2173c9]));}return Promise['all'](_0x18225c);})[_0x1e0a('0x13')](function(){_0x18225c=_0x2a63a1['map'](function(_0x10b5e6){return db[_0x1e0a('0x3d')][_0x1e0a('0x7b')](_0x10b5e6,{'include':[{'model':db[_0x1e0a('0x82')],'as':_0x1e0a('0x82')}]})[_0x1e0a('0x13')](function(_0x2ad525){_0x10b5e6['id']=_0x2ad525['id'];return _0x10b5e6;});});return Promise['all'](_0x18225c);})['then'](function(_0x2747a5){if(_0x52f7e9[_0x1e0a('0x63')][_0x1e0a('0x2c')]==='user')return _0x2747a5;if(_0x52f7e9[_0x1e0a('0x2f')][_0x1e0a('0x2c')]!==_0x1e0a('0x2f'))return _0x2747a5;var _0x40f446=_[_0x1e0a('0x87')](_0x2747a5,function(_0x5f3c74){return _0x5f3c74[_0x1e0a('0x2c')]===_0x1e0a('0x31')||_0x5f3c74[_0x1e0a('0x2c')]===_0x1e0a('0x33');});if(!_0x40f446)return _0x2747a5;return db[_0x1e0a('0x83')][_0x1e0a('0x4d')]({'where':{'name':{'$or':['Agents',_0x1e0a('0x32')]},'userProfileId':_0x52f7e9[_0x1e0a('0x2f')]['userProfileId']},'raw':!![]})['then'](function(_0x58f9e1){if(_[_0x1e0a('0x89')](_0x58f9e1)||!_['some'](_0x58f9e1,[_0x1e0a('0x84'),0x0]))return _0x2747a5;_0x18225c=[];var _0x44f74f=_(_0x58f9e1)[_0x1e0a('0x36')](function(_0x17cb41){if(_0x17cb41[_0x1e0a('0x84')]===0x1)return;return _0x17cb41[_0x1e0a('0x39')]===_0x1e0a('0x30')?'agent':_0x1e0a('0x33');})[_0x1e0a('0x8a')]()[_0x1e0a('0x37')]();for(var _0x256c52=0x0;_0x256c52<_0x2747a5[_0x1e0a('0x50')];_0x256c52++){if(!_['includes'](_0x44f74f,_0x2747a5[_0x256c52][_0x1e0a('0x2c')]))return;var _0x8d3b3=_0x2747a5[_0x256c52]['role']==='agent'?'Agents':_0x1e0a('0x32');_0x18225c[_0x1e0a('0x4c')](db[_0x1e0a('0x3a')][_0x1e0a('0x7b')]({'name':_0x2747a5[_0x256c52][_0x1e0a('0x39')],'resourceId':_0x2747a5[_0x256c52]['id'],'type':_0x8d3b3,'sectionId':_[_0x1e0a('0x38')](_0x58f9e1,[_0x1e0a('0x39'),_0x8d3b3])['id']},{}));}return Promise[_0x1e0a('0x57')](_0x18225c);});})['then'](respondWithResult(_0x3ca9dd,0xc9))['catch'](handleError(_0x3ca9dd,null));};exports['changePassword']=function(_0x5984c8,_0x45e0d5){if(_0x5984c8[_0x1e0a('0x63')]['id']){delete _0x5984c8[_0x1e0a('0x63')]['id'];}return db['User'][_0x1e0a('0x38')]({'where':{'id':_0x5984c8[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](function(_0x47f0e5){if(!_0x47f0e5)return null;if(_0x47f0e5['id']===_0x5984c8['user']['id']){if(!_0x5984c8[_0x1e0a('0x63')][_0x1e0a('0x8b')]||!_0x5984c8[_0x1e0a('0x63')]['newPassword']){throw new db['Sequelize'][(_0x1e0a('0x8c'))](_0x1e0a('0x8d'));}if(!_0x47f0e5[_0x1e0a('0x8e')](_0x5984c8[_0x1e0a('0x63')][_0x1e0a('0x8b')])){throw new db[(_0x1e0a('0x8f'))][(_0x1e0a('0x8c'))]('Wrong\x20credentials');}if(_0x5984c8[_0x1e0a('0x63')]['oldPassword']===_0x5984c8['body']['newPassword']){throw new db[(_0x1e0a('0x8f'))][(_0x1e0a('0x8c'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x5984c8['user'][_0x1e0a('0x2c')]===_0x1e0a('0x2d')){if(!_0x5984c8['body'][_0x1e0a('0x90')]){throw new db[(_0x1e0a('0x8f'))]['ValidationError'](_0x1e0a('0x91'));}}else if(_0x5984c8[_0x1e0a('0x2f')][_0x1e0a('0x2c')]===_0x1e0a('0x2f')){if(!_0x5984c8[_0x1e0a('0x63')][_0x1e0a('0x90')]){throw new db[(_0x1e0a('0x8f'))]['ValidationError'](_0x1e0a('0x91'));}if(_0x47f0e5[_0x1e0a('0x2c')]!=='agent'){throw new db[(_0x1e0a('0x8f'))]['ValidationError'](_0x1e0a('0x7c'));}}else{throw new db[(_0x1e0a('0x8f'))]['ValidationError'](_0x1e0a('0x7c'));}return _0x47f0e5;})[_0x1e0a('0x13')](handleEntityNotFound(_0x45e0d5,null))[_0x1e0a('0x13')](function(_0x542134){return db[_0x1e0a('0x68')][_0x1e0a('0x92')]({'attributes':['id',_0x1e0a('0x93'),_0x1e0a('0x94'),_0x1e0a('0x95')]})[_0x1e0a('0x13')](function(_0x508856){if(_0x508856[_0x1e0a('0x93')])authService[_0x1e0a('0x6a')](_0x5984c8[_0x1e0a('0x63')]['newPassword']);if(!_0x508856[_0x1e0a('0x94')]||!_0x542134[_0x1e0a('0x96')])return _0x542134;authService['validatePasswordHistory'](_0x5984c8[_0x1e0a('0x63')][_0x1e0a('0x90')],_0x542134[_0x1e0a('0x96')],_0x508856[_0x1e0a('0x95')]);return _0x542134;})['then'](saveUpdates({'password':_0x5984c8[_0x1e0a('0x63')][_0x1e0a('0x90')],'passwordResetAt':_0x5984c8['user']['id']==_0x5984c8[_0x1e0a('0x58')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x5984c8[_0x1e0a('0x63')][_0x1e0a('0x90')],_0x542134[_0x1e0a('0x96')])},null));})[_0x1e0a('0x13')](respondWithResult(_0x45e0d5,null))[_0x1e0a('0x1d')](handleError(_0x45e0d5,null));};exports['addQueues']=function(_0x7330b,_0x296b70){var _0x14f81c=_0x7330b['body'][_0x1e0a('0x97')];return db[_0x1e0a('0x3d')][_0x1e0a('0x38')]({'where':{'id':_0x7330b[_0x1e0a('0x58')]['id']},'attributes':['id',_0x1e0a('0x39'),_0x1e0a('0x2c'),_0x1e0a('0x98'),_0x1e0a('0x99'),'voicePause',_0x1e0a('0x9a')]})['then'](handleEntityNotFound(_0x296b70,null))[_0x1e0a('0x13')](function(_0x49c83b){if(_0x49c83b){if(!utils[_0x1e0a('0x9b')](_0x14f81c)){throw new db[(_0x1e0a('0x8f'))][(_0x1e0a('0x8c'))]('Unknown\x20channel');}return _0x49c83b[_0x1e0a('0x9c')+_[_0x1e0a('0x9d')](_0x14f81c[_0x1e0a('0x9e')]())+_0x1e0a('0x9f')](_0x7330b['body'][_0x1e0a('0x66')],{'penalty':_0x7330b['body']['penalty']||0x0})[_0x1e0a('0xa0')](function(_0x2c4959){for(var _0x21980a=0x0;_0x21980a<_0x7330b[_0x1e0a('0x63')][_0x1e0a('0x66')][_0x1e0a('0x50')];_0x21980a+=0x1){var _0x2095d8={'UserId':Number(_0x7330b['params']['id'])};_0x2095d8[_[_0x1e0a('0x9d')](_0x14f81c[_0x1e0a('0x9e')]())+'QueueId']=Number(_0x7330b['body'][_0x1e0a('0x66')][_0x21980a]);socket[_0x1e0a('0xa1')](_0x1e0a('0x2f')+_['capitalize'](_0x14f81c[_0x1e0a('0x9e')]())+_0x1e0a('0xa2'),_0x2095d8);}return _0x2c4959;})[_0x1e0a('0x13')](function(){if(_0x14f81c===_0x1e0a('0xa3')){return db[_0x1e0a('0xa4')][_0x1e0a('0x4d')]({'where':{'id':_0x7330b[_0x1e0a('0x63')]['ids']||[]},'raw':!![],'attributes':['id',_0x1e0a('0x39')]});}})[_0x1e0a('0x13')](function(_0x450bf3){var _0x379758=_0x49c83b['get']({'plain':!![]});var _0x3f3c6d=[];if(_0x14f81c==='voice'&&_0x379758['role']===_0x1e0a('0x31')&&_0x379758[_0x1e0a('0x98')]){for(let _0x4fd2da=0x0;_0x4fd2da<_0x450bf3[_0x1e0a('0x50')];_0x4fd2da+=0x1){_0x3f3c6d['push']({'membername':_0x379758[_0x1e0a('0x39')],'UserId':_0x379758['id'],'queue_name':_0x450bf3[_0x4fd2da][_0x1e0a('0x39')],'VoiceQueueId':_0x450bf3[_0x4fd2da]['id'],'interface':_[_0x1e0a('0x6b')](_0x379758[_0x1e0a('0x9a')])?util[_0x1e0a('0xa5')](_0x1e0a('0xa6'),_0x379758[_0x1e0a('0x39')]):_0x379758['interface'],'paused':_0x379758['voicePause']||![],'penalty':_0x7330b[_0x1e0a('0x63')]['penalty']||0x0});}return Promise['all'](_0x3f3c6d[_0x1e0a('0x36')](function(_0x426352){return db['UserVoiceQueueRt'][_0x1e0a('0xa7')](_0x426352);}));}return _0x49c83b;});}})['then'](respondWithStatusCode(_0x296b70,null))[_0x1e0a('0x1d')](handleError(_0x296b70,null));};exports['removeQueues']=function(_0x1116b7,_0x3adf02){var _0x171df9,_0x5a13d9;return db[_0x1e0a('0x3d')]['find']({'where':{'id':_0x1116b7[_0x1e0a('0x58')]['id']},'attributes':['id',_0x1e0a('0x39'),'role']})[_0x1e0a('0x13')](handleEntityNotFound(_0x3adf02,null))['then'](function(_0x3c632a){if(_0x3c632a){_0x171df9=_0x3c632a;if(!_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x97')]||!utils[_0x1e0a('0x9b')](_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x97')])){throw new db[(_0x1e0a('0x8f'))][(_0x1e0a('0x8c'))](_0x1e0a('0xa8'));}return _0x3c632a['remove'+_['capitalize'](_0x1116b7['query'][_0x1e0a('0x97')]['toLowerCase']())+_0x1e0a('0x9f')](_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x66')]);}})[_0x1e0a('0x13')](function(_0x3f15a0){if(_[_0x1e0a('0xa9')](_0x1116b7[_0x1e0a('0x48')]['ids'])){for(var _0x334565=0x0;_0x334565<_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x66')][_0x1e0a('0x50')];_0x334565+=0x1){_0x5a13d9={'UserId':Number(_0x1116b7[_0x1e0a('0x58')]['id'])};_0x5a13d9[_['capitalize'](_0x1116b7[_0x1e0a('0x48')]['channel'][_0x1e0a('0x9e')]())+_0x1e0a('0xaa')]=Number(_0x1116b7['query'][_0x1e0a('0x66')][_0x334565]);socket['emit']('user'+_['capitalize'](_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x97')][_0x1e0a('0x9e')]())+_0x1e0a('0xab'),_0x5a13d9);}}else{_0x5a13d9={'UserId':Number(_0x1116b7[_0x1e0a('0x58')]['id'])};_0x5a13d9[_['capitalize'](_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x97')]['toLowerCase']())+_0x1e0a('0xaa')]=Number(_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x66')]);socket[_0x1e0a('0xa1')](_0x1e0a('0x2f')+_['capitalize'](_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x97')][_0x1e0a('0x9e')]())+_0x1e0a('0xab'),_0x5a13d9);}return _0x3f15a0;})[_0x1e0a('0x13')](function(){if(_0x1116b7[_0x1e0a('0x48')][_0x1e0a('0x97')]==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x1116b7[_0x1e0a('0x58')]['id'],'VoiceQueueId':_0x1116b7[_0x1e0a('0x48')]['ids']},'individualHooks':!![]})['then'](function(){return _0x171df9;});}return _0x171df9;})['then'](respondWithStatusCode(_0x3adf02,null))[_0x1e0a('0x1d')](handleError(_0x3adf02,null));};exports[_0x1e0a('0xac')]=function(_0x31fb50,_0x4e0cc4){_0x31fb50[_0x1e0a('0x63')]['userpic']=_0x31fb50[_0x1e0a('0xad')][_0x1e0a('0xae')];return db['User'][_0x1e0a('0x38')]({'where':{'id':_0x31fb50['params']['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x4e0cc4,null))[_0x1e0a('0x13')](saveUpdates(_0x31fb50[_0x1e0a('0x63')],null))[_0x1e0a('0x13')](respondWithResult(_0x4e0cc4,null))['catch'](handleError(_0x4e0cc4,null));};exports['getAvatar']=function(_0x36d51b,_0x3d6544){var _0x3c89ff=path['join'](config['root'],_0x1e0a('0xaf'));return db[_0x1e0a('0x3d')]['find']({'where':{'id':_0x36d51b['params']['id']},'attributes':['id',_0x1e0a('0xb0')],'raw':!![]})[_0x1e0a('0x13')](handleEntityNotFound(_0x3d6544,null))['then'](function(_0x26904e){if(_0x26904e){if(_['isNil'](_0x26904e[_0x1e0a('0xb0')])){return _0x3d6544[_0x1e0a('0xb1')](_0x3c89ff);}else{if(!fs[_0x1e0a('0xb2')](path['join'](config[_0x1e0a('0xb3')],_0x1e0a('0xb4'),_0x26904e[_0x1e0a('0xb0')]))){return _0x3d6544['download'](_0x3c89ff);}return _0x3d6544[_0x1e0a('0xb1')](path[_0x1e0a('0xb5')](config['root'],_0x1e0a('0xb4'),_0x26904e[_0x1e0a('0xb0')]));}}})[_0x1e0a('0x1d')](handleError(_0x3d6544,null));};exports[_0x1e0a('0xb6')]=function(_0x2b0b5b,_0x32a941){return db[_0x1e0a('0x3d')][_0x1e0a('0x38')]({'where':{'id':_0x2b0b5b[_0x1e0a('0x58')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x32a941,null))[_0x1e0a('0x13')](function(_0x34e893){var _0x866659=[];values=_0x34e893[_0x1e0a('0x52')];_0x866659['push'](get_open_tabs(_0x1e0a('0x51'),_0x34e893['dataValues']));_0x866659['push'](get_open_tabs(_0x1e0a('0x53'),_0x34e893[_0x1e0a('0x52')]));_0x866659[_0x1e0a('0x4c')](get_open_tabs(_0x1e0a('0x55'),_0x34e893['dataValues']));_0x866659[_0x1e0a('0x4c')](get_open_tabs(_0x1e0a('0x56'),_0x34e893[_0x1e0a('0x52')]));_0x866659['push'](get_open_tabs(_0x1e0a('0x54'),_0x34e893[_0x1e0a('0x52')]));_0x866659[_0x1e0a('0x4c')](get_open_tabs(_0x1e0a('0xb7'),_0x34e893[_0x1e0a('0x52')]));return Promise[_0x1e0a('0x57')](_0x866659);})[_0x1e0a('0x13')](function(_0x1f88d6){if(_0x1f88d6){var _0x89cf25=_[_0x1e0a('0x36')](values[_0x1e0a('0xb8')],function(_0x423608){return{'channel':_0x1e0a('0xb9'),'id':_0x423608['id'],'createdAt':_0x423608[_0x1e0a('0xba')]};});var _0x3b19ef=_[_0x1e0a('0x36')](values[_0x1e0a('0xbb')],function(_0x3833e6){return{'channel':'FAX','id':_0x3833e6['id'],'createdAt':_0x3833e6[_0x1e0a('0xba')]};});var _0x55b58e=_['map'](values[_0x1e0a('0xbc')],function(_0x14bbd2){return{'channel':_0x1e0a('0xbd'),'id':_0x14bbd2['id'],'createdAt':_0x14bbd2['createdAt']};});var _0x2e4064=_['map'](values[_0x1e0a('0xbe')],function(_0x39e297){return{'channel':_0x1e0a('0xbf'),'id':_0x39e297['id'],'createdAt':_0x39e297[_0x1e0a('0xba')]};});var _0x37ab3f=_[_0x1e0a('0x36')](values[_0x1e0a('0xc0')],function(_0xcc3e40){return{'channel':_0x1e0a('0xc1'),'id':_0xcc3e40['id'],'createdAt':_0xcc3e40[_0x1e0a('0xba')]};});var _0x250540=_[_0x1e0a('0x36')](values[_0x1e0a('0xc2')],function(_0x4a3206){return{'channel':_0x1e0a('0xc3'),'id':_0x4a3206['id'],'createdAt':_0x4a3206[_0x1e0a('0xba')]};});var _0x143652=_[_0x1e0a('0xc4')](_0x89cf25,_0x3b19ef,_0x55b58e,_0x2e4064,_0x37ab3f,_0x250540);var _0x249e68={'count':_0x143652[_0x1e0a('0x50')],'rows':_0x143652};return _0x249e68;}else return null;})[_0x1e0a('0x13')](respondWithResult(_0x32a941,null))[_0x1e0a('0x1d')](handleError(_0x32a941,null));};exports[_0x1e0a('0xc5')]=function(_0x234d7,_0x55b3bb){var _0x47997c={};var _0xe8fbb4={};var _0x1e0de6;var _0x50147c;return db[_0x1e0a('0x3d')]['findOne']({'where':{'id':_0x234d7[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x55b3bb,null))[_0x1e0a('0x13')](function(_0x546f48){if(_0x546f48){_0x1e0de6=_0x546f48;_0xe8fbb4[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db[_0x1e0a('0xc6')][_0x1e0a('0x5a')]);_0xe8fbb4['query']=_[_0x1e0a('0x5b')](_0x234d7[_0x1e0a('0x48')]);_0xe8fbb4[_0x1e0a('0x5c')]=_['intersection'](_0xe8fbb4[_0x1e0a('0x5d')],_0xe8fbb4['query']);_0x47997c['attributes']=_[_0x1e0a('0x5e')](_0xe8fbb4[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x234d7['query'][_0x1e0a('0x5f')]));_0x47997c[_0x1e0a('0x4b')]=_0x47997c[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x47997c['attributes']:_0xe8fbb4['model'];_0x47997c[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x234d7[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x47997c[_0x1e0a('0x45')]=qs['filters'](_[_0x1e0a('0xc9')](_0x234d7['query'],_0xe8fbb4[_0x1e0a('0x5c')]));if(_0x234d7[_0x1e0a('0x48')]['filter']){_0x47997c[_0x1e0a('0x45')]=_[_0x1e0a('0x61')](_0x47997c['where'],{'$or':_[_0x1e0a('0x36')](_0x47997c['attributes'],function(_0x27a88c){var _0x2cbf29={};_0x2cbf29[_0x27a88c]={'$like':'%'+_0x234d7[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0x2cbf29;})});}_0x47997c=_[_0x1e0a('0x61')]({},_0x47997c,_0x234d7[_0x1e0a('0x62')]);return _0x1e0de6[_0x1e0a('0xc5')](_0x47997c);}})[_0x1e0a('0x13')](function(_0xdd75dd){if(_0xdd75dd){_0x50147c=_0xdd75dd[_0x1e0a('0x50')];if(_0x234d7[_0x1e0a('0x48')][_0x1e0a('0xca')](_0x1e0a('0x46'))){_0x47997c[_0x1e0a('0x47')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0x1e0a('0xcb')],'as':'Tags','attributes':['id',_0x1e0a('0x39'),'color'],'where':_0x234d7[_0x1e0a('0x48')][_0x1e0a('0xcc')]?{'id':_0x234d7['query'][_0x1e0a('0xcc')]}:undefined,'required':_0x234d7[_0x1e0a('0x48')][_0x1e0a('0xcc')]?!![]:![]}];}if(!_0x234d7['query'][_0x1e0a('0xca')](_0x1e0a('0xcd'))){_0x47997c[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0x234d7[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x47997c[_0x1e0a('0x21')]=qs['offset'](_0x234d7[_0x1e0a('0x48')][_0x1e0a('0x21')]);}return _0x1e0de6[_0x1e0a('0xc5')](_0x47997c);}})[_0x1e0a('0x13')](function(_0x13f27e){if(_0x13f27e){return _0x13f27e?{'count':_0x50147c,'rows':_0x13f27e}:null;}})[_0x1e0a('0x13')](respondWithResult(_0x55b3bb,null))[_0x1e0a('0x1d')](handleError(_0x55b3bb,null));};exports[_0x1e0a('0xce')]=function(_0x5c43f3,_0x1b2c9b){var _0x26c2c0;var _0x3f2447={};var _0x43046a;return db[_0x1e0a('0x3d')]['findOne']({'where':{'id':_0x5c43f3[_0x1e0a('0x58')]['id']},'attributes':['id',_0x1e0a('0x39'),_0x1e0a('0x2c')]})['then'](handleEntityNotFound(_0x1b2c9b,null))[_0x1e0a('0x13')](function(_0x202386){if(!utils[_0x1e0a('0x9b')](_0x5c43f3['query'][_0x1e0a('0x97')])){throw new db[(_0x1e0a('0x8f'))]['ValidationError'](_0x1e0a('0xa8'));}_0x26c2c0=_0x202386;var _0x5bba0a={};_0x5bba0a['model']=_['keys'](db[_[_0x1e0a('0x9d')](_0x5c43f3['query'][_0x1e0a('0x97')])+_0x1e0a('0xcf')][_0x1e0a('0x5a')]);_0x5bba0a[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0x5c43f3[_0x1e0a('0x48')]);_0x5bba0a[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x5bba0a[_0x1e0a('0x5d')],_0x5bba0a[_0x1e0a('0x48')]);_0x3f2447['attributes']=_[_0x1e0a('0x5e')](_0x5bba0a[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x5c43f3[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x3f2447[_0x1e0a('0x4b')]=_0x3f2447[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x3f2447[_0x1e0a('0x4b')]:_0x5bba0a[_0x1e0a('0x5d')];_0x3f2447[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x5c43f3[_0x1e0a('0x48')]['sort']);_0x3f2447[_0x1e0a('0x45')]=qs['filters'](_['pick'](_0x5c43f3[_0x1e0a('0x48')],_0x5bba0a['filters']));if(_0x5c43f3[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x3f2447[_0x1e0a('0x45')]=_[_0x1e0a('0x61')](_0x3f2447[_0x1e0a('0x45')],{'$or':_['map'](_0x3f2447['attributes'],function(_0x2c3e0e){var _0x36b6f3={};_0x36b6f3[_0x2c3e0e]={'$like':'%'+_0x5c43f3[_0x1e0a('0x48')]['filter']+'%'};return _0x36b6f3;})});}_0x3f2447=_['merge']({},_0x3f2447,_0x5c43f3['options']);switch(_0x26c2c0[_0x1e0a('0x2c')]){case _0x1e0a('0x2d'):return db[_['capitalize'](_0x5c43f3[_0x1e0a('0x48')][_0x1e0a('0x97')])+_0x1e0a('0xcf')][_0x1e0a('0x4d')](_0x3f2447);case _0x1e0a('0x2f'):case'agent':return _0x26c2c0[_0x1e0a('0x2b')+_[_0x1e0a('0x9d')](_0x5c43f3[_0x1e0a('0x48')][_0x1e0a('0x97')])+_0x1e0a('0x9f')](_0x3f2447);default:throw new db[(_0x1e0a('0x8f'))]['ValidationError'](_0x1e0a('0xd0'));}})[_0x1e0a('0x13')](function(_0x1a6375){_0x43046a=_0x1a6375[_0x1e0a('0x50')];if(!_0x5c43f3[_0x1e0a('0x48')]['hasOwnProperty'](_0x1e0a('0xcd'))){_0x3f2447[_0x1e0a('0x24')]=qs['limit'](_0x5c43f3['query'][_0x1e0a('0x24')]);_0x3f2447[_0x1e0a('0x21')]=qs['offset'](_0x5c43f3['query'][_0x1e0a('0x21')]);}switch(_0x26c2c0[_0x1e0a('0x2c')]){case _0x1e0a('0x2d'):return db[_['capitalize'](_0x5c43f3[_0x1e0a('0x48')]['channel'])+'Queue']['findAll'](_0x3f2447);case _0x1e0a('0x2f'):case'agent':return _0x26c2c0[_0x1e0a('0x2b')+_[_0x1e0a('0x9d')](_0x5c43f3['query']['channel'])+_0x1e0a('0x9f')](_0x3f2447);}})['then'](function(_0x1afee4){return{'count':_0x43046a,'rows':_0x1afee4};})[_0x1e0a('0x13')](respondWithResult(_0x1b2c9b,null))[_0x1e0a('0x1d')](handleError(_0x1b2c9b,null));};exports['getVoiceQueuesRt']=function(_0x418521,_0x2d9e1c){var _0x31dbda={};var _0x23d259={};var _0xaab649;var _0x2eab3c;return db['User'][_0x1e0a('0x92')]({'where':{'id':_0x418521[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x2d9e1c,null))[_0x1e0a('0x13')](function(_0x1a4818){if(_0x1a4818){_0xaab649=_0x1a4818;_0x23d259[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db['UserVoiceQueueRt']['rawAttributes']);_0x23d259[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0x418521[_0x1e0a('0x48')]);_0x23d259[_0x1e0a('0x5c')]=_['intersection'](_0x23d259[_0x1e0a('0x5d')],_0x23d259[_0x1e0a('0x48')]);_0x31dbda[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x23d259[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x418521['query'][_0x1e0a('0x5f')]));_0x31dbda['attributes']=_0x31dbda[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x31dbda[_0x1e0a('0x4b')]:_0x23d259['model'];_0x31dbda[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x418521[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x31dbda['where']=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x418521[_0x1e0a('0x48')],_0x23d259[_0x1e0a('0x5c')]));if(_0x418521[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x31dbda[_0x1e0a('0x45')]=_[_0x1e0a('0x61')](_0x31dbda[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x31dbda[_0x1e0a('0x4b')],function(_0x1e2eed){var _0xbc996={};_0xbc996[_0x1e2eed]={'$like':'%'+_0x418521[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0xbc996;})});}_0x31dbda=_[_0x1e0a('0x61')]({},_0x31dbda,_0x418521[_0x1e0a('0x62')]);return _0xaab649[_0x1e0a('0xd1')](_0x31dbda);}})[_0x1e0a('0x13')](function(_0x511f90){if(_0x511f90){_0x2eab3c=_0x511f90[_0x1e0a('0x50')];if(!_0x418521[_0x1e0a('0x48')]['hasOwnProperty']('nolimit')){_0x31dbda[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0x418521['query']['limit']);_0x31dbda[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x418521['query'][_0x1e0a('0x21')]);}return _0xaab649[_0x1e0a('0xd1')](_0x31dbda);}})[_0x1e0a('0x13')](function(_0x1fd920){if(_0x1fd920){return _0x1fd920?{'count':_0x2eab3c,'rows':_0x1fd920}:null;}})[_0x1e0a('0x13')](respondWithResult(_0x2d9e1c,null))[_0x1e0a('0x1d')](handleError(_0x2d9e1c,null));};exports['getGroups']=function(_0x58d2bb,_0xb43a3a){var _0x1fb9b7={};var _0x19f873={};var _0x14f0e9;var _0xf6087e;return db[_0x1e0a('0x3d')]['findOne']({'where':{'id':_0x58d2bb[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0xb43a3a,null))[_0x1e0a('0x13')](function(_0x917b4e){if(_0x917b4e){_0x14f0e9=_0x917b4e;_0x19f873[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db['ChatGroup'][_0x1e0a('0x5a')]);_0x19f873[_0x1e0a('0x48')]=_['keys'](_0x58d2bb[_0x1e0a('0x48')]);_0x19f873[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x19f873[_0x1e0a('0x5d')],_0x19f873[_0x1e0a('0x48')]);_0x1fb9b7['attributes']=_[_0x1e0a('0x5e')](_0x19f873[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x58d2bb['query'][_0x1e0a('0x5f')]));_0x1fb9b7[_0x1e0a('0x4b')]=_0x1fb9b7[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x1fb9b7[_0x1e0a('0x4b')]:_0x19f873['model'];_0x1fb9b7[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x58d2bb['query'][_0x1e0a('0xc8')]);_0x1fb9b7[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x58d2bb[_0x1e0a('0x48')],_0x19f873[_0x1e0a('0x5c')]));if(_0x58d2bb['query'][_0x1e0a('0x34')]){_0x1fb9b7['where']=_[_0x1e0a('0x61')](_0x1fb9b7['where'],{'$or':_['map'](_0x1fb9b7[_0x1e0a('0x4b')],function(_0x2913d3){var _0x42649f={};_0x42649f[_0x2913d3]={'$like':'%'+_0x58d2bb[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0x42649f;})});}_0x1fb9b7=_[_0x1e0a('0x61')]({},_0x1fb9b7,_0x58d2bb[_0x1e0a('0x62')]);return _0x14f0e9[_0x1e0a('0xd2')](_0x1fb9b7);}})[_0x1e0a('0x13')](function(_0x554747){if(_0x554747){_0xf6087e=_0x554747['length'];if(!_0x58d2bb['query'][_0x1e0a('0xca')](_0x1e0a('0xcd'))){_0x1fb9b7[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0x58d2bb[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x1fb9b7['offset']=qs[_0x1e0a('0x21')](_0x58d2bb[_0x1e0a('0x48')]['offset']);}return _0x14f0e9[_0x1e0a('0xd2')](_0x1fb9b7);}})[_0x1e0a('0x13')](function(_0xdc6376){if(_0xdc6376){return _0xdc6376?{'count':_0xf6087e,'rows':_0xdc6376}:null;}})[_0x1e0a('0x13')](respondWithResult(_0xb43a3a,null))[_0x1e0a('0x1d')](handleError(_0xb43a3a,null));};exports[_0x1e0a('0xd3')]=function(_0x19b09d,_0x340b3e){var _0x1def77={'raw':!![],'where':{}};var _0x3522c3={};var _0x2c6fc3={'count':0x0,'rows':[]};return db[_0x1e0a('0x3d')]['findOne']({'where':{'id':_0x19b09d[_0x1e0a('0x58')]['id']}})['then'](handleEntityNotFound(_0x340b3e,null))[_0x1e0a('0x13')](function(_0x3549be){if(_0x3549be){_0x3522c3[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db[_0x1e0a('0xd4')][_0x1e0a('0x5a')]);_0x3522c3[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0x19b09d[_0x1e0a('0x48')]);_0x3522c3[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x3522c3[_0x1e0a('0x5d')],_0x3522c3[_0x1e0a('0x48')]);_0x1def77[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x3522c3[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x19b09d[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x1def77[_0x1e0a('0x4b')]=_0x1def77['attributes'][_0x1e0a('0x50')]?_0x1def77[_0x1e0a('0x4b')]:_0x3522c3[_0x1e0a('0x5d')];if(!_0x19b09d[_0x1e0a('0x48')][_0x1e0a('0xca')](_0x1e0a('0xcd'))){_0x1def77[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0x19b09d[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x1def77[_0x1e0a('0x21')]=qs['offset'](_0x19b09d[_0x1e0a('0x48')][_0x1e0a('0x21')]);}_0x1def77[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x19b09d['query'][_0x1e0a('0xc8')]);_0x1def77[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x19b09d['query'],_0x3522c3[_0x1e0a('0x5c')]));_0x1def77['where'][_0x1e0a('0xd5')]=_0x3549be['id'];if(_0x19b09d[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x1def77[_0x1e0a('0x45')]=_['merge'](_0x1def77[_0x1e0a('0x45')],{'$or':_['map'](_0x1def77[_0x1e0a('0x4b')],function(_0x8c7382){var _0x3ef9fd={};_0x3ef9fd[_0x8c7382]={'$like':'%'+_0x19b09d[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0x3ef9fd;})});}_0x1def77=_[_0x1e0a('0x61')]({},_0x1def77,_0x19b09d[_0x1e0a('0x62')]);return db[_0x1e0a('0xd4')]['count']({'where':_0x1def77[_0x1e0a('0x45')]})['then'](function(_0x522858){_0x2c6fc3['count']=_0x522858;if(_0x19b09d['query']['includeAll']){_0x1def77[_0x1e0a('0x47')]=[{'all':!![]}];}return db[_0x1e0a('0xd4')][_0x1e0a('0x4d')](_0x1def77);})[_0x1e0a('0x13')](function(_0x468ec2){_0x2c6fc3[_0x1e0a('0x4f')]=_0x468ec2;return _0x2c6fc3;});}})[_0x1e0a('0x13')](respondWithFilteredResult(_0x340b3e,_0x1def77))['catch'](handleError(_0x340b3e,null));};exports[_0x1e0a('0xd6')]=function(_0x577d2d,_0x153a97){var _0x719e22={'raw':!![],'where':{}};var _0x4597d8={};var _0x5878be={'count':0x0,'rows':[]};return db[_0x1e0a('0x3d')][_0x1e0a('0x92')]({'where':{'id':_0x577d2d[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x153a97,null))[_0x1e0a('0x13')](function(_0x3076f7){if(_0x3076f7){_0x4597d8[_0x1e0a('0x5d')]=_['keys'](db['ScreenRecording'][_0x1e0a('0x5a')]);_0x4597d8[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0x577d2d[_0x1e0a('0x48')]);_0x4597d8[_0x1e0a('0x5c')]=_['intersection'](_0x4597d8['model'],_0x4597d8['query']);_0x719e22[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x4597d8['model'],qs['fields'](_0x577d2d[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x719e22[_0x1e0a('0x4b')]=_0x719e22[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x719e22['attributes']:_0x4597d8[_0x1e0a('0x5d')];if(!_0x577d2d[_0x1e0a('0x48')][_0x1e0a('0xca')]('nolimit')){_0x719e22[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0x577d2d['query'][_0x1e0a('0x24')]);_0x719e22[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x577d2d[_0x1e0a('0x48')][_0x1e0a('0x21')]);}_0x719e22[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x577d2d[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x719e22[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x577d2d[_0x1e0a('0x48')],_0x4597d8[_0x1e0a('0x5c')]));_0x719e22[_0x1e0a('0x45')][_0x1e0a('0xd5')]=_0x3076f7['id'];if(_0x577d2d[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x719e22['where']=_['merge'](_0x719e22[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x719e22[_0x1e0a('0x4b')],function(_0x34807d){var _0x3e9485={};_0x3e9485[_0x34807d]={'$like':'%'+_0x577d2d[_0x1e0a('0x48')]['filter']+'%'};return _0x3e9485;})});}_0x719e22=_[_0x1e0a('0x61')]({},_0x719e22,_0x577d2d[_0x1e0a('0x62')]);return db[_0x1e0a('0xd7')][_0x1e0a('0x23')]({'where':_0x719e22[_0x1e0a('0x45')]})[_0x1e0a('0x13')](function(_0x4a6f07){_0x5878be['count']=_0x4a6f07;if(_0x577d2d['query'][_0x1e0a('0x46')]){_0x719e22[_0x1e0a('0x47')]=[{'all':!![]}];}return db[_0x1e0a('0xd7')][_0x1e0a('0x4d')](_0x719e22);})['then'](function(_0x30f083){_0x5878be[_0x1e0a('0x4f')]=_0x30f083;return _0x5878be;});}})[_0x1e0a('0x13')](respondWithFilteredResult(_0x153a97,_0x719e22))[_0x1e0a('0x1d')](handleError(_0x153a97,null));};exports['getChatInteractions']=function(_0x445635,_0x43be9b){var _0x53d579={};var _0x115910={};var _0x862619;var _0x154955;return db['User'][_0x1e0a('0x92')]({'where':{'id':_0x445635[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x43be9b,null))[_0x1e0a('0x13')](function(_0x4dccfb){if(_0x4dccfb){_0x862619=_0x4dccfb;_0x115910['model']=_[_0x1e0a('0x5b')](db[_0x1e0a('0xd8')][_0x1e0a('0x5a')]);_0x115910['query']=_[_0x1e0a('0x5b')](_0x445635[_0x1e0a('0x48')]);_0x115910['filters']=_[_0x1e0a('0x5e')](_0x115910[_0x1e0a('0x5d')],_0x115910[_0x1e0a('0x48')]);_0x53d579[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x115910[_0x1e0a('0x5d')],qs['fields'](_0x445635['query'][_0x1e0a('0x5f')]));_0x53d579[_0x1e0a('0x4b')]=_0x53d579['attributes'][_0x1e0a('0x50')]?_0x53d579['attributes']:_0x115910[_0x1e0a('0x5d')];_0x53d579['order']=qs[_0x1e0a('0xc8')](_0x445635[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x53d579['where']=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x445635[_0x1e0a('0x48')],_0x115910['filters']));if(_0x445635[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x53d579[_0x1e0a('0x45')]=_['merge'](_0x53d579[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x53d579[_0x1e0a('0x4b')],function(_0x38ca71){var _0x10720a={};_0x10720a[_0x38ca71]={'$like':'%'+_0x445635['query'][_0x1e0a('0x34')]+'%'};return _0x10720a;})});}_0x53d579=_[_0x1e0a('0x61')]({},_0x53d579,_0x445635[_0x1e0a('0x62')]);return _0x862619[_0x1e0a('0xd9')](_0x53d579);}})[_0x1e0a('0x13')](function(_0x14f206){if(_0x14f206){_0x154955=_0x14f206[_0x1e0a('0x50')];if(!_0x445635[_0x1e0a('0x48')]['hasOwnProperty']('nolimit')){_0x53d579[_0x1e0a('0x24')]=qs['limit'](_0x445635[_0x1e0a('0x48')]['limit']);_0x53d579[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x445635[_0x1e0a('0x48')][_0x1e0a('0x21')]);}return _0x862619[_0x1e0a('0xd9')](_0x53d579);}})[_0x1e0a('0x13')](function(_0x388b5a){if(_0x388b5a){return _0x388b5a?{'count':_0x154955,'rows':_0x388b5a}:null;}})['then'](respondWithResult(_0x43be9b,null))['catch'](handleError(_0x43be9b,null));};exports[_0x1e0a('0xda')]=function(_0x4f3cba,_0x62f997){var _0x3cbb59={};var _0x22c77b={};var _0x415a4e;var _0x5ca27d;return db['User'][_0x1e0a('0x92')]({'where':{'id':_0x4f3cba['params']['id']}})['then'](handleEntityNotFound(_0x62f997,null))[_0x1e0a('0x13')](function(_0x38dff8){if(_0x38dff8){_0x415a4e=_0x38dff8;_0x22c77b[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db[_0x1e0a('0xdb')][_0x1e0a('0x5a')]);_0x22c77b[_0x1e0a('0x48')]=_['keys'](_0x4f3cba[_0x1e0a('0x48')]);_0x22c77b[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x22c77b[_0x1e0a('0x5d')],_0x22c77b['query']);_0x3cbb59['attributes']=_[_0x1e0a('0x5e')](_0x22c77b[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x4f3cba['query'][_0x1e0a('0x5f')]));_0x3cbb59[_0x1e0a('0x4b')]=_0x3cbb59[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x3cbb59[_0x1e0a('0x4b')]:_0x22c77b[_0x1e0a('0x5d')];_0x3cbb59[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x4f3cba[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x3cbb59[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x4f3cba['query'],_0x22c77b[_0x1e0a('0x5c')]));if(_0x4f3cba[_0x1e0a('0x48')]['filter']){_0x3cbb59[_0x1e0a('0x45')]=_[_0x1e0a('0x61')](_0x3cbb59[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x3cbb59[_0x1e0a('0x4b')],function(_0x52caa1){var _0x42d2a8={};_0x42d2a8[_0x52caa1]={'$like':'%'+_0x4f3cba[_0x1e0a('0x48')]['filter']+'%'};return _0x42d2a8;})});}_0x3cbb59=_['merge']({},_0x3cbb59,_0x4f3cba[_0x1e0a('0x62')]);return _0x415a4e[_0x1e0a('0xda')](_0x3cbb59);}})[_0x1e0a('0x13')](function(_0x389af4){if(_0x389af4){_0x5ca27d=_0x389af4[_0x1e0a('0x50')];if(!_0x4f3cba['query'][_0x1e0a('0xca')]('nolimit')){_0x3cbb59[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0x4f3cba[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x3cbb59[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x4f3cba[_0x1e0a('0x48')][_0x1e0a('0x21')]);}return _0x415a4e[_0x1e0a('0xda')](_0x3cbb59);}})[_0x1e0a('0x13')](function(_0x14565f){if(_0x14565f){return _0x14565f?{'count':_0x5ca27d,'rows':_0x14565f}:null;}})['then'](respondWithResult(_0x62f997,null))['catch'](handleError(_0x62f997,null));};exports[_0x1e0a('0xdc')]=function(_0xeb6e7d,_0x2aef91){var _0x4320f1={'raw':!![],'where':{}};var _0x349069={};var _0x53c8ee={'count':0x0,'rows':[]};return db[_0x1e0a('0x3d')][_0x1e0a('0x92')]({'where':{'id':_0xeb6e7d[_0x1e0a('0x58')]['id']}})['then'](handleEntityNotFound(_0x2aef91,null))[_0x1e0a('0x13')](function(_0x12a9ea){if(_0x12a9ea){_0x349069[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db[_0x1e0a('0xdd')][_0x1e0a('0x5a')]);_0x349069[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0xeb6e7d[_0x1e0a('0x48')]);_0x349069[_0x1e0a('0x5c')]=_['intersection'](_0x349069[_0x1e0a('0x5d')],_0x349069[_0x1e0a('0x48')]);_0x4320f1[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x349069['model'],qs[_0x1e0a('0x5f')](_0xeb6e7d[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x4320f1[_0x1e0a('0x4b')]=_0x4320f1[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x4320f1[_0x1e0a('0x4b')]:_0x349069[_0x1e0a('0x5d')];if(!_0xeb6e7d[_0x1e0a('0x48')][_0x1e0a('0xca')](_0x1e0a('0xcd'))){_0x4320f1[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0xeb6e7d[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x4320f1['offset']=qs[_0x1e0a('0x21')](_0xeb6e7d[_0x1e0a('0x48')][_0x1e0a('0x21')]);}_0x4320f1[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0xeb6e7d[_0x1e0a('0x48')]['sort']);_0x4320f1['where']=qs['filters'](_[_0x1e0a('0xc9')](_0xeb6e7d[_0x1e0a('0x48')],_0x349069['filters']));_0x4320f1[_0x1e0a('0x45')]['UserId']=_0x12a9ea['id'];if(_0xeb6e7d[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x4320f1[_0x1e0a('0x45')]=_[_0x1e0a('0x61')](_0x4320f1['where'],{'$or':_[_0x1e0a('0x36')](_0x4320f1[_0x1e0a('0x4b')],function(_0x46489f){var _0x3820c0={};_0x3820c0[_0x46489f]={'$like':'%'+_0xeb6e7d['query']['filter']+'%'};return _0x3820c0;})});}_0x4320f1=_['merge']({},_0x4320f1,_0xeb6e7d['options']);return db['MailInteraction'][_0x1e0a('0x23')]({'where':_0x4320f1[_0x1e0a('0x45')]})[_0x1e0a('0x13')](function(_0x4536f3){_0x53c8ee[_0x1e0a('0x23')]=_0x4536f3;if(_0xeb6e7d[_0x1e0a('0x48')]['includeAll']){_0x4320f1[_0x1e0a('0x47')]=[{'all':!![]}];}return db['MailInteraction'][_0x1e0a('0x4d')](_0x4320f1);})[_0x1e0a('0x13')](function(_0x502ff3){_0x53c8ee['rows']=_0x502ff3;return _0x53c8ee;});}})[_0x1e0a('0x13')](respondWithFilteredResult(_0x2aef91,_0x4320f1))['catch'](handleError(_0x2aef91,null));};exports[_0x1e0a('0xde')]=function(_0x2057e2,_0x52243e){var _0x90b843={};var _0x5366ac={};var _0x2718fa;var _0xcded3a;return db[_0x1e0a('0x3d')][_0x1e0a('0x92')]({'where':{'id':_0x2057e2['params']['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x52243e,null))[_0x1e0a('0x13')](function(_0x1c502f){if(_0x1c502f){_0x2718fa=_0x1c502f;_0x5366ac[_0x1e0a('0x5d')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x5366ac[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0x2057e2['query']);_0x5366ac[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x5366ac[_0x1e0a('0x5d')],_0x5366ac['query']);_0x90b843['attributes']=_[_0x1e0a('0x5e')](_0x5366ac[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x2057e2[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x90b843[_0x1e0a('0x4b')]=_0x90b843[_0x1e0a('0x4b')]['length']?_0x90b843['attributes']:_0x5366ac[_0x1e0a('0x5d')];_0x90b843[_0x1e0a('0xc7')]=qs['sort'](_0x2057e2['query'][_0x1e0a('0xc8')]);_0x90b843[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x2057e2['query'],_0x5366ac[_0x1e0a('0x5c')]));if(_0x2057e2[_0x1e0a('0x48')]['filter']){_0x90b843[_0x1e0a('0x45')]=_['merge'](_0x90b843['where'],{'$or':_[_0x1e0a('0x36')](_0x90b843[_0x1e0a('0x4b')],function(_0xd2b9a0){var _0xd04452={};_0xd04452[_0xd2b9a0]={'$like':'%'+_0x2057e2[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0xd04452;})});}_0x90b843=_[_0x1e0a('0x61')]({},_0x90b843,_0x2057e2[_0x1e0a('0x62')]);return _0x2718fa[_0x1e0a('0xde')](_0x90b843);}})[_0x1e0a('0x13')](function(_0xb7e99a){if(_0xb7e99a){_0xcded3a=_0xb7e99a['length'];if(!_0x2057e2['query'][_0x1e0a('0xca')]('nolimit')){_0x90b843[_0x1e0a('0x24')]=qs['limit'](_0x2057e2[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x90b843['offset']=qs[_0x1e0a('0x21')](_0x2057e2[_0x1e0a('0x48')][_0x1e0a('0x21')]);}return _0x2718fa[_0x1e0a('0xde')](_0x90b843);}})['then'](function(_0x51ed0c){if(_0x51ed0c){return _0x51ed0c?{'count':_0xcded3a,'rows':_0x51ed0c}:null;}})[_0x1e0a('0x13')](respondWithResult(_0x52243e,null))[_0x1e0a('0x1d')](handleError(_0x52243e,null));};exports[_0x1e0a('0xdf')]=function(_0x2ed637,_0x573c0f){var _0x275921={};var _0x4f9ef5={};var _0x29dd67;var _0x1c9b8c;return db[_0x1e0a('0x3d')]['findOne']({'where':{'id':_0x2ed637[_0x1e0a('0x58')]['id']}})['then'](handleEntityNotFound(_0x573c0f,null))[_0x1e0a('0x13')](function(_0x4b0ac8){if(_0x4b0ac8){_0x29dd67=_0x4b0ac8;_0x4f9ef5['model']=_[_0x1e0a('0x5b')](db['FaxInteraction']['rawAttributes']);_0x4f9ef5[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0x2ed637[_0x1e0a('0x48')]);_0x4f9ef5[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x4f9ef5['model'],_0x4f9ef5[_0x1e0a('0x48')]);_0x275921[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x4f9ef5[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x2ed637[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x275921[_0x1e0a('0x4b')]=_0x275921['attributes'][_0x1e0a('0x50')]?_0x275921[_0x1e0a('0x4b')]:_0x4f9ef5[_0x1e0a('0x5d')];_0x275921['order']=qs[_0x1e0a('0xc8')](_0x2ed637[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x275921[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_['pick'](_0x2ed637[_0x1e0a('0x48')],_0x4f9ef5[_0x1e0a('0x5c')]));if(_0x2ed637[_0x1e0a('0x48')]['filter']){_0x275921[_0x1e0a('0x45')]=_['merge'](_0x275921[_0x1e0a('0x45')],{'$or':_['map'](_0x275921[_0x1e0a('0x4b')],function(_0x37c646){var _0x2a1058={};_0x2a1058[_0x37c646]={'$like':'%'+_0x2ed637[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0x2a1058;})});}_0x275921=_[_0x1e0a('0x61')]({},_0x275921,_0x2ed637[_0x1e0a('0x62')]);return _0x29dd67[_0x1e0a('0xdf')](_0x275921);}})[_0x1e0a('0x13')](function(_0x58cce9){if(_0x58cce9){_0x1c9b8c=_0x58cce9[_0x1e0a('0x50')];if(!_0x2ed637['query']['hasOwnProperty']('nolimit')){_0x275921['limit']=qs[_0x1e0a('0x24')](_0x2ed637[_0x1e0a('0x48')]['limit']);_0x275921['offset']=qs[_0x1e0a('0x21')](_0x2ed637[_0x1e0a('0x48')][_0x1e0a('0x21')]);}return _0x29dd67['getFaxInteractions'](_0x275921);}})[_0x1e0a('0x13')](function(_0x22382e){if(_0x22382e){return _0x22382e?{'count':_0x1c9b8c,'rows':_0x22382e}:null;}})[_0x1e0a('0x13')](respondWithResult(_0x573c0f,null))[_0x1e0a('0x1d')](handleError(_0x573c0f,null));};exports['getWhatsappInteractions']=function(_0xceed47,_0x5ffb6e){var _0x315238={};var _0x5f29c7={};var _0x27aaf7;var _0x425216;return db['User'][_0x1e0a('0x92')]({'where':{'id':_0xceed47['params']['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x5ffb6e,null))[_0x1e0a('0x13')](function(_0x48a50f){if(_0x48a50f){_0x27aaf7=_0x48a50f;_0x5f29c7[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db[_0x1e0a('0xe0')][_0x1e0a('0x5a')]);_0x5f29c7['query']=_['keys'](_0xceed47[_0x1e0a('0x48')]);_0x5f29c7[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x5f29c7[_0x1e0a('0x5d')],_0x5f29c7[_0x1e0a('0x48')]);_0x315238[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x5f29c7[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0xceed47[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x315238[_0x1e0a('0x4b')]=_0x315238[_0x1e0a('0x4b')]['length']?_0x315238[_0x1e0a('0x4b')]:_0x5f29c7[_0x1e0a('0x5d')];_0x315238['order']=qs['sort'](_0xceed47[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x315238[_0x1e0a('0x45')]=qs['filters'](_[_0x1e0a('0xc9')](_0xceed47[_0x1e0a('0x48')],_0x5f29c7[_0x1e0a('0x5c')]));if(_0xceed47['query'][_0x1e0a('0x34')]){_0x315238['where']=_[_0x1e0a('0x61')](_0x315238[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x315238[_0x1e0a('0x4b')],function(_0x8330f6){var _0x5ca10={};_0x5ca10[_0x8330f6]={'$like':'%'+_0xceed47[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0x5ca10;})});}_0x315238=_['merge']({},_0x315238,_0xceed47[_0x1e0a('0x62')]);return _0x27aaf7['getWhatsappInteractions'](_0x315238);}})[_0x1e0a('0x13')](function(_0x2a5ec3){if(_0x2a5ec3){_0x425216=_0x2a5ec3[_0x1e0a('0x50')];if(!_0xceed47[_0x1e0a('0x48')][_0x1e0a('0xca')](_0x1e0a('0xcd'))){_0x315238[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0xceed47[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x315238[_0x1e0a('0x21')]=qs['offset'](_0xceed47['query'][_0x1e0a('0x21')]);}return _0x27aaf7[_0x1e0a('0xe1')](_0x315238);}})[_0x1e0a('0x13')](function(_0x2604c3){if(_0x2604c3){return _0x2604c3?{'count':_0x425216,'rows':_0x2604c3}:null;}})[_0x1e0a('0x13')](respondWithResult(_0x5ffb6e,null))[_0x1e0a('0x1d')](handleError(_0x5ffb6e,null));};exports[_0x1e0a('0xe2')]=function(_0x2e2ac5,_0x485788,_0x1896f1){var _0x2de7dc;var _0x20b5a6;var _0x3ef694;var _0x3983df=!_['isNil'](_0x2e2ac5['params']['id'])?_0x2e2ac5[_0x1e0a('0x58')]['id']:!_[_0x1e0a('0x6b')](_0x2e2ac5[_0x1e0a('0x2f')]['id'])?_0x2e2ac5[_0x1e0a('0x2f')]['id']:null;return db[_0x1e0a('0x3d')][_0x1e0a('0x38')]({'where':{'id':_0x3983df,'role':{'$or':['admin',_0x1e0a('0x2f'),_0x1e0a('0x31')]}},'attributes':['id',_0x1e0a('0x39'),_0x1e0a('0xe3'),_0x1e0a('0xe4'),_0x1e0a('0x2c'),'internal','loginInPause']})['then'](function(_0x27908f){if(_0x27908f){if(_0x27908f['role']===_0x1e0a('0x31')){_0x2de7dc=_0x27908f;if(_0x2e2ac5['body'][_0x1e0a('0x9a')]){_0x3ef694=util[_0x1e0a('0xa5')]('LOCAL/%s@from-sip/n',_0x2de7dc[_0x2e2ac5['body']['interface']]);}else if(_0x2e2ac5[_0x1e0a('0x63')][_0x1e0a('0xe5')]){_0x3ef694=util[_0x1e0a('0xa5')](_0x1e0a('0xa6'),_0x2e2ac5[_0x1e0a('0x63')][_0x1e0a('0xe5')]);}else{_0x3ef694=util[_0x1e0a('0xa5')](_0x1e0a('0xa6'),_0x2de7dc['name']);}socket['to'](util[_0x1e0a('0xa5')](_0x1e0a('0xe6'),_0x2de7dc[_0x1e0a('0x39')]))[_0x1e0a('0xa1')]('user:forcelogout',{'user':{'id':_0x2de7dc['id'],'name':_0x2de7dc['name']},'ip':_0x2e2ac5['headers']['x-forwarded-for']||_0x2e2ac5[_0x1e0a('0xe7')][_0x1e0a('0xe8')]||_0x2e2ac5[_0x1e0a('0xe9')][_0x1e0a('0xe8')]||_0x2e2ac5[_0x1e0a('0xe7')][_0x1e0a('0xe9')]['remoteAddress']});return db[_0x1e0a('0xea')][_0x1e0a('0x2a')]({'where':{'membername':_0x2de7dc[_0x1e0a('0x39')]},'individualHooks':!![]});}}else{throw new db[(_0x1e0a('0x8f'))]['ValidationError'](_0x1e0a('0xeb'));}})[_0x1e0a('0x13')](function(){if(_0x2de7dc){return _0x2de7dc[_0x1e0a('0xec')]({'raw':!![]});}})[_0x1e0a('0x13')](function(_0x155815){if(_0x2de7dc){if(_0x155815){_0x20b5a6=_0x155815;if(_0x20b5a6[_0x1e0a('0x50')]){var _0x57a76b=_0x20b5a6['map'](function(_0x4fa270){var _0x32ebb8={'membername':_0x2de7dc[_0x1e0a('0x39')],'UserId':_0x2de7dc['id'],'queue_name':_0x4fa270[_0x1e0a('0x39')],'VoiceQueueId':_0x4fa270['id'],'interface':_0x3ef694,'paused':_0x2de7dc[_0x1e0a('0x99')]||![],'penalty':_0x4fa270['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0x1e0a('0xa7')](_0x32ebb8);});return Promise[_0x1e0a('0x57')](_0x57a76b);}}}})['then'](function(){if(_0x2de7dc){return db[_0x1e0a('0xed')][_0x1e0a('0x4d')]({'where':{'membername':_0x2de7dc[_0x1e0a('0x39')],'exitAt':null}});}})[_0x1e0a('0x13')](function(_0x5a8d0e){if(_0x2de7dc){var _0x51772b=[];_0x5a8d0e[_0x1e0a('0xee')](function(_0x8dd8c5){_0x51772b['push'](_0x8dd8c5[_0x1e0a('0x28')]({'exitAt':moment()[_0x1e0a('0xa5')](_0x1e0a('0xef'))}));});return Promise[_0x1e0a('0x57')](_0x51772b);}})[_0x1e0a('0x13')](function(){if(_0x2de7dc){var _0x5462a3=[];var _0x31de54=[];var _0x4772bb=utils['getChannels']();var _0x2e8d13={'membername':_0x2de7dc[_0x1e0a('0x39')],'interface':_0x3ef694,'enterAt':moment()[_0x1e0a('0xa5')](_0x1e0a('0xef')),'role':_0x2de7dc[_0x1e0a('0x2c')],'internal':_0x2de7dc[_0x1e0a('0x67')]};_0x4772bb['forEach'](function(_0x3af130){_0x5462a3['push'](_[_0x1e0a('0x61')]({'channel':_0x3af130,'type':_0x1e0a('0xf0'),'data1':_0x2e2ac5[_0x1e0a('0x63')][_0x1e0a('0xf1')],'data2':_0x3ef694},_0x2e8d13));if(_0x2de7dc[_0x1e0a('0x99')]){_0x31de54[_0x1e0a('0x4c')](_[_0x1e0a('0x61')]({'channel':_0x3af130,'type':_0x1e0a('0xf2'),'data1':_0x1e0a('0xf3')},_0x2e8d13));}});return db['MemberReport'][_0x1e0a('0x86')](_0x5462a3[_0x1e0a('0xc4')](_0x31de54),{'individualHooks':!![]});}})[_0x1e0a('0x13')](function(){if(_0x2de7dc){return _0x2de7dc['update']({'online':!![],'lastLoginAt':moment()[_0x1e0a('0xa5')](_0x1e0a('0xef')),'voicePause':_0x2de7dc[_0x1e0a('0x99')]||![],'mailPause':_0x2de7dc[_0x1e0a('0x99')]||![],'chatPause':_0x2de7dc[_0x1e0a('0x99')]||![],'faxPause':_0x2de7dc['loginInPause']||![],'smsPause':_0x2de7dc[_0x1e0a('0x99')]||![],'openchannelPause':_0x2de7dc[_0x1e0a('0x99')]||![],'whatsappPause':_0x2de7dc['loginInPause']||![],'pauseType':_0x2de7dc[_0x1e0a('0x99')]?_0x1e0a('0xf3'):null,'interface':_0x3ef694,'lastPauseAt':moment()[_0x1e0a('0xa5')](_0x1e0a('0xef'))});}})[_0x1e0a('0x13')](function(_0x39cd7f){if(_0x2e2ac5[_0x1e0a('0xf4')]){return _0x1896f1();}else{return Promise[_0x1e0a('0xf5')](_0x39cd7f)[_0x1e0a('0x13')](respondWithResult(_0x485788,null));}})[_0x1e0a('0x1d')](handleError(_0x485788,null));};exports[_0x1e0a('0xf6')]=function(_0x563516,_0xe5add2){var _0x95ab7f;return db[_0x1e0a('0x3d')][_0x1e0a('0x38')]({'where':{'id':_0x563516[_0x1e0a('0x58')]['id'],'role':_0x1e0a('0x31')},'attributes':['id',_0x1e0a('0x39'),_0x1e0a('0x2c')]})[_0x1e0a('0x13')](handleEntityNotFound(_0xe5add2,null))[_0x1e0a('0x13')](function(_0x51ea07){if(_0x51ea07){_0x95ab7f=_0x51ea07;return db[_0x1e0a('0xea')][_0x1e0a('0x2a')]({'where':{'membername':_0x95ab7f[_0x1e0a('0x39')]},'individualHooks':!![]});}})['then'](function(){return db[_0x1e0a('0xed')][_0x1e0a('0x4d')]({'where':{'membername':_0x95ab7f['name'],'exitAt':null}});})[_0x1e0a('0x13')](function(_0x38d945){var _0x2623a7=[];_0x38d945[_0x1e0a('0xee')](function(_0x3e4348){_0x2623a7[_0x1e0a('0x4c')](_0x3e4348[_0x1e0a('0x28')]({'exitAt':moment()[_0x1e0a('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x1e0a('0x57')](_0x2623a7);})[_0x1e0a('0x13')](function(){return _0x95ab7f[_0x1e0a('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0xe5add2,null))[_0x1e0a('0x1d')](handleError(_0xe5add2,null));};exports[_0x1e0a('0xf7')]=function(_0x3e9ccd,_0x114f92){var _0xfd2b43;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x3e9ccd[_0x1e0a('0x58')]['id']},'individualHooks':!![]})[_0x1e0a('0x13')](function(){return db[_0x1e0a('0x3d')][_0x1e0a('0x38')]({'where':{'id':_0x3e9ccd[_0x1e0a('0x58')]['id'],'role':_0x1e0a('0x31')},'attributes':['id',_0x1e0a('0x39'),_0x1e0a('0x2c'),_0x1e0a('0x67'),_0x1e0a('0x9a'),_0x1e0a('0x98')]});})[_0x1e0a('0x13')](handleEntityNotFound(_0x114f92,null))[_0x1e0a('0x13')](function(_0x2fb97d){if(_0x2fb97d){_0xfd2b43=_0x2fb97d;return respondWithRpcPromise('QueuePause','pause',{'id':_0xfd2b43['id'],'name':_0xfd2b43[_0x1e0a('0x39')],'pause':!![]});}})['then'](function(){if(_0xfd2b43){return db[_0x1e0a('0xed')][_0x1e0a('0x4d')]({'where':{'membername':_0xfd2b43['name'],'type':'PAUSE','exitAt':null}});}})[_0x1e0a('0x13')](function(_0x1550cd){if(_0x1550cd['length']){var _0x58d705=moment()[_0x1e0a('0xa5')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xe34e6e=0x0,_0x228635=_0x1550cd[_0x1e0a('0x50')];_0xe34e6e<_0x228635;_0xe34e6e++){_0x1550cd[_0xe34e6e][_0x1e0a('0xf8')]({'exitAt':_0x58d705});}}})[_0x1e0a('0x13')](function(){var _0x2a4936=[];var _0x1ea948=utils[_0x1e0a('0xf9')]();_0x1ea948[_0x1e0a('0xee')](function(_0x576c18){_0x2a4936[_0x1e0a('0x4c')]({'channel':_0x576c18,'membername':_0xfd2b43['name'],'interface':_['isNil'](_0xfd2b43['interface'])?util[_0x1e0a('0xa5')](_0x1e0a('0xa6'),_0xfd2b43[_0x1e0a('0x39')]):_0xfd2b43[_0x1e0a('0x9a')],'type':_0x1e0a('0xf2'),'enterAt':moment()[_0x1e0a('0xa5')](_0x1e0a('0xef')),'data1':_0x3e9ccd['body'][_0x1e0a('0x3f')]||_0x1e0a('0xfa'),'role':_0xfd2b43[_0x1e0a('0x2c')],'internal':_0xfd2b43[_0x1e0a('0x67')]});});return db[_0x1e0a('0xed')][_0x1e0a('0x86')](_0x2a4936,{'individualHooks':!![]});})['then'](function(){return _0xfd2b43[_0x1e0a('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3e9ccd[_0x1e0a('0x63')][_0x1e0a('0x3f')]||_0x1e0a('0xfa'),'lastPauseAt':moment()['format'](_0x1e0a('0xef'))});})[_0x1e0a('0x13')](respondWithResult(_0x114f92,null))[_0x1e0a('0x1d')](handleError(_0x114f92,null));};exports['unpause']=function(_0xe99225,_0x351435){if(_0xe99225['body'][_0x1e0a('0x97')]&&!utils['isValidChannel'](_0xe99225[_0x1e0a('0x63')]['channel'])){throw new APIBadRequestError(util['format'](_0x1e0a('0xfb'),_0xe99225[_0x1e0a('0x63')]['channel']));}return db['User']['find']({'where':{'id':_0xe99225[_0x1e0a('0x58')]['id']},'attributes':['id',_0x1e0a('0x39'),_0x1e0a('0x2c'),_0x1e0a('0x67'),'interface',_0x1e0a('0x98'),_0x1e0a('0xfc'),_0x1e0a('0xfd'),_0x1e0a('0xfe'),_0x1e0a('0xff'),_0x1e0a('0x100'),_0x1e0a('0x101'),'whatsappPause',_0x1e0a('0x102'),_0x1e0a('0x103')]})[_0x1e0a('0x13')](function(_0x1791a4){if(!_0x1791a4){throw new APINotFoundError(util['format'](_0x1e0a('0x104'),_0xe99225['params']['id']));}return _0x1791a4[_0x1e0a('0x105')](_0xe99225[_0x1e0a('0x63')][_0x1e0a('0x97')]);})[_0x1e0a('0x13')](respondWithResult(_0x351435,null))[_0x1e0a('0x1d')](APIHandleError(_0x351435));};exports['getTeams']=function(_0x17cfed,_0x1b19a1){var _0x5b9b2a={};var _0x403eef={};var _0x521311;var _0x38e930;return db[_0x1e0a('0x3d')][_0x1e0a('0x92')]({'where':{'id':_0x17cfed[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x1b19a1,null))[_0x1e0a('0x13')](function(_0xf0951d){if(_0xf0951d){_0x521311=_0xf0951d;_0x403eef[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db[_0x1e0a('0x106')]['rawAttributes']);_0x403eef[_0x1e0a('0x48')]=_['keys'](_0x17cfed['query']);_0x403eef[_0x1e0a('0x5c')]=_['intersection'](_0x403eef[_0x1e0a('0x5d')],_0x403eef['query']);_0x5b9b2a[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x403eef[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x17cfed[_0x1e0a('0x48')]['fields']));_0x5b9b2a[_0x1e0a('0x4b')]=_0x5b9b2a[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x5b9b2a[_0x1e0a('0x4b')]:_0x403eef[_0x1e0a('0x5d')];_0x5b9b2a[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x17cfed[_0x1e0a('0x48')]['sort']);_0x5b9b2a[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x17cfed[_0x1e0a('0x48')],_0x403eef[_0x1e0a('0x5c')]));if(_0x17cfed[_0x1e0a('0x48')]['filter']){_0x5b9b2a[_0x1e0a('0x45')]=_[_0x1e0a('0x61')](_0x5b9b2a[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x5b9b2a[_0x1e0a('0x4b')],function(_0x1ea3c8){var _0x33a9de={};_0x33a9de[_0x1ea3c8]={'$like':'%'+_0x17cfed[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0x33a9de;})});}_0x5b9b2a=_[_0x1e0a('0x61')]({},_0x5b9b2a,_0x17cfed['options']);return _0x521311[_0x1e0a('0x107')](_0x5b9b2a);}})[_0x1e0a('0x13')](function(_0x52d1ca){if(_0x52d1ca){_0x38e930=_0x52d1ca[_0x1e0a('0x50')];if(!_0x17cfed[_0x1e0a('0x48')][_0x1e0a('0xca')](_0x1e0a('0xcd'))){_0x5b9b2a[_0x1e0a('0x24')]=qs[_0x1e0a('0x24')](_0x17cfed[_0x1e0a('0x48')]['limit']);_0x5b9b2a[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x17cfed[_0x1e0a('0x48')][_0x1e0a('0x21')]);}return _0x521311[_0x1e0a('0x107')](_0x5b9b2a);}})[_0x1e0a('0x13')](function(_0x4ce205){if(_0x4ce205){return _0x4ce205?{'count':_0x38e930,'rows':_0x4ce205}:null;}})[_0x1e0a('0x13')](respondWithResult(_0x1b19a1,null))[_0x1e0a('0x1d')](handleError(_0x1b19a1,null));};exports[_0x1e0a('0x108')]=function(_0x6a9739,_0x4860a9){var _0x5a01ad=_0x6a9739[_0x1e0a('0x58')]['id'];var _0x2fc0f1=_0x6a9739[_0x1e0a('0x63')]?_0x6a9739[_0x1e0a('0x63')][_0x1e0a('0x66')]:null;var _0x1b5eb7=[];return Promise[_0x1e0a('0xf5')]()[_0x1e0a('0x13')](function(){if(!_0x2fc0f1)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x1e0a('0x13')](function(){return db[_0x1e0a('0x3d')]['findOne']({'where':{'id':_0x5a01ad}});})[_0x1e0a('0x13')](function(_0xfe7191){if(!_0xfe7191)throw new APINotFoundError(util[_0x1e0a('0xa5')]('User\x20with\x20id\x20%s\x20not\x20found',_0x6a9739[_0x1e0a('0x58')]['id']));return db['sequelize']['transaction'](function(_0x8afe3a){return _0xfe7191[_0x1e0a('0x108')](_0x2fc0f1,{'transaction':_0x8afe3a})[_0x1e0a('0x13')](function(){return db[_0x1e0a('0x106')][_0x1e0a('0x4d')]({'where':{'id':{'$in':_0x2fc0f1}}});})[_0x1e0a('0x13')](function(_0x5874f9){var _0x42c870=_['map'](_0x5874f9,function(_0x528b22){return _0x528b22[_0x1e0a('0x109')]();});return Promise[_0x1e0a('0x57')](_0x42c870);})[_0x1e0a('0x13')](function(_0x411330){_0x1b5eb7=_[_0x1e0a('0x10a')](_0x411330);var _0x5e0a3a=_[_0x1e0a('0x36')](_0x1b5eb7,function(_0xaddfdf){return _0xaddfdf[_0x1e0a('0x10b')](_0xfe7191['id'],{'transaction':_0x8afe3a});});return Promise[_0x1e0a('0x57')](_0x5e0a3a);})[_0x1e0a('0x13')](function(){if(!_0xfe7191[_0x1e0a('0x98')])return;var _0x1519f5=_['filter'](_0x1b5eb7,function(_0x30587b){return _0x30587b[_0x1e0a('0x10c')](_0x1e0a('0x97'))===_0x1e0a('0x10d');});var _0x23eb56=_[_0x1e0a('0x36')](_0x1519f5,function(_0x5e0456){return db['UserVoiceQueueRt'][_0x1e0a('0xa7')]({'membername':_0xfe7191[_0x1e0a('0x39')],'UserId':_0xfe7191['id'],'queue_name':_0x5e0456[_0x1e0a('0x39')],'VoiceQueueId':_0x5e0456['id'],'interface':_[_0x1e0a('0x6b')](_0xfe7191['interface'])?util[_0x1e0a('0xa5')](_0x1e0a('0xa6'),_0xfe7191[_0x1e0a('0x39')]):_0xfe7191[_0x1e0a('0x9a')],'paused':_0xfe7191['voicePause']||![],'penalty':_0xfe7191[_0x1e0a('0x10e')]},{'transaction':_0x8afe3a});});return Promise['all'](_0x23eb56);})['then'](function(){return db['TeamVoicePrefix'][_0x1e0a('0x4d')]({'where':{'teamId':{'$in':_0x2fc0f1}}});})[_0x1e0a('0x13')](function(_0x5cb77f){var _0x114216=_[_0x1e0a('0x36')](_0x5cb77f,function(_0x3a9234){return db[_0x1e0a('0x10f')][_0x1e0a('0x7b')]({'UserId':_0xfe7191['id'],'VoicePrefixId':_0x3a9234['VoicePrefixId']},{'transaction':_0x8afe3a});});return Promise[_0x1e0a('0x57')](_0x114216);});});})[_0x1e0a('0x13')](function(){for(var _0x4beb9c=0x0;_0x4beb9c<_0x1b5eb7[_0x1e0a('0x50')];_0x4beb9c++){var _0x3a0524=_0x1b5eb7[_0x4beb9c][_0x1e0a('0x10c')](_0x1e0a('0x97'));var _0x55536e=_0x3a0524+'QueueId';socket[_0x1e0a('0xa1')](_0x1e0a('0x2f')+_0x3a0524+_0x1e0a('0xa2'),{'UserId':_0x5a01ad,['queueField']:_0x1b5eb7[_0x4beb9c]['id']});}})[_0x1e0a('0x13')](respondWithStatusCode(_0x4860a9,null))[_0x1e0a('0x1d')](APIHandleError(_0x4860a9));};exports[_0x1e0a('0x110')]=function(_0xad25f8,_0x8c2add){var _0x13f617=_0xad25f8[_0x1e0a('0x58')]['id'];var _0x24160d=null;if(_0xad25f8[_0x1e0a('0x48')][_0x1e0a('0x66')]){_0x24160d=_['isArray'](_0xad25f8[_0x1e0a('0x48')][_0x1e0a('0x66')])?_0xad25f8['query'][_0x1e0a('0x66')]:[_0xad25f8[_0x1e0a('0x48')][_0x1e0a('0x66')]];}var _0x15d69d=[];return Promise[_0x1e0a('0xf5')]()[_0x1e0a('0x13')](function(){if(!_0x24160d)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x1e0a('0x13')](function(){return db['User']['findOne']({'where':{'id':_0x13f617}});})['then'](function(_0x45d235){if(!_0x45d235)throw new APINotFoundError(util[_0x1e0a('0xa5')](_0x1e0a('0x104'),_0xad25f8[_0x1e0a('0x58')]['id']));return db[_0x1e0a('0x6d')]['transaction'](function(_0x4eed93){return _0x45d235[_0x1e0a('0x110')](_0x24160d,{'transaction':_0x4eed93})[_0x1e0a('0x13')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x24160d}}});})[_0x1e0a('0x13')](function(_0x394f3a){var _0x306fba=_['map'](_0x394f3a,function(_0x5c782d){return _0x5c782d[_0x1e0a('0x109')]();});return Promise[_0x1e0a('0x57')](_0x306fba);})[_0x1e0a('0x13')](function(_0x187aa8){_0x15d69d=_[_0x1e0a('0x10a')](_0x187aa8);var _0x55066a=_['map'](_0x15d69d,function(_0xbf1ded){return _0xbf1ded[_0x1e0a('0x111')](_0x45d235['id'],{'transaction':_0x4eed93});});return Promise[_0x1e0a('0x57')](_0x55066a);})[_0x1e0a('0x13')](function(){if(!_0x45d235[_0x1e0a('0x98')])return;var _0x3e2650=_[_0x1e0a('0x34')](_0x15d69d,function(_0x3e9e13){return _0x3e9e13['getDataValue']('channel')===_0x1e0a('0x10d');});var _0x2159a4=_[_0x1e0a('0x36')](_0x3e2650,function(_0xda2844){return db['UserVoiceQueueRt'][_0x1e0a('0x2a')]({'where':{'VoiceQueueId':_0xda2844['id'],'UserId':_0x45d235['id']},'transaction':_0x4eed93});});return Promise['all'](_0x2159a4);})['then'](function(){return db[_0x1e0a('0x112')][_0x1e0a('0x4d')]({'where':{'teamId':{'$in':_0x24160d}}});})[_0x1e0a('0x13')](function(_0x298509){var _0x40fa52=_[_0x1e0a('0x36')](_0x298509,function(_0x270a62){return db[_0x1e0a('0x10f')][_0x1e0a('0x2a')]({'where':{'UserId':_0x45d235['id'],'VoicePrefixId':_0x270a62[_0x1e0a('0x113')]}},{'transaction':_0x4eed93});});return Promise['all'](_0x40fa52);});});})[_0x1e0a('0x13')](function(){for(var _0x4ae0dc=0x0;_0x4ae0dc<_0x15d69d[_0x1e0a('0x50')];_0x4ae0dc++){var _0x1558c8=_0x15d69d[_0x4ae0dc][_0x1e0a('0x10c')](_0x1e0a('0x97'));var _0x4e9c8=_0x1558c8+'QueueId';socket[_0x1e0a('0xa1')]('user'+_0x1558c8+_0x1e0a('0xab'),{'UserId':_0x13f617,['queueField']:_0x15d69d[_0x4ae0dc]['id']});}})['then'](respondWithStatusCode(_0x8c2add,null))[_0x1e0a('0x1d')](APIHandleError(_0x8c2add));};exports[_0x1e0a('0x114')]=function(_0x5d6a7e,_0x517e96){var _0x558638={};var _0x5e62cb={};var _0x1d1331;var _0x6fd1e8;return db['User']['findOne']({'where':{'id':_0x5d6a7e[_0x1e0a('0x58')]['id']}})['then'](handleEntityNotFound(_0x517e96,null))[_0x1e0a('0x13')](function(_0x5dbce0){if(_0x5dbce0){_0x1d1331=_0x5dbce0;_0x5e62cb[_0x1e0a('0x5d')]=_[_0x1e0a('0x5b')](db[_0x1e0a('0x115')][_0x1e0a('0x5a')]);_0x5e62cb[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0x5d6a7e[_0x1e0a('0x48')]);_0x5e62cb[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x5e62cb['model'],_0x5e62cb[_0x1e0a('0x48')]);_0x558638[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x5e62cb[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0x5d6a7e[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x558638['attributes']=_0x558638[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x558638[_0x1e0a('0x4b')]:_0x5e62cb['model'];_0x558638[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0x5d6a7e[_0x1e0a('0x48')][_0x1e0a('0xc8')]);_0x558638[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_[_0x1e0a('0xc9')](_0x5d6a7e[_0x1e0a('0x48')],_0x5e62cb[_0x1e0a('0x5c')]));if(_0x5d6a7e[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x558638[_0x1e0a('0x45')]=_[_0x1e0a('0x61')](_0x558638[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x558638[_0x1e0a('0x4b')],function(_0x34dcf7){var _0x3f3238={};_0x3f3238[_0x34dcf7]={'$like':'%'+_0x5d6a7e[_0x1e0a('0x48')][_0x1e0a('0x34')]+'%'};return _0x3f3238;})});}_0x558638=_[_0x1e0a('0x61')]({},_0x558638,_0x5d6a7e['options']);return _0x1d1331[_0x1e0a('0x114')](_0x558638);}})['then'](function(_0x256ac2){if(_0x256ac2){_0x6fd1e8=_0x256ac2['length'];if(!_0x5d6a7e[_0x1e0a('0x48')][_0x1e0a('0xca')](_0x1e0a('0xcd'))){_0x558638[_0x1e0a('0x24')]=qs['limit'](_0x5d6a7e[_0x1e0a('0x48')][_0x1e0a('0x24')]);_0x558638[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x5d6a7e[_0x1e0a('0x48')][_0x1e0a('0x21')]);}return _0x1d1331[_0x1e0a('0x114')](_0x558638);}})[_0x1e0a('0x13')](function(_0x25ea0c){if(_0x25ea0c){return _0x25ea0c?{'count':_0x6fd1e8,'rows':_0x25ea0c}:null;}})[_0x1e0a('0x13')](respondWithResult(_0x517e96,null))[_0x1e0a('0x1d')](handleError(_0x517e96,null));};exports[_0x1e0a('0x116')]=function(_0xde218f,_0x5bda38){var _0x9bc34e={};var _0x4b5e61={};var _0x5241cf;return db['User'][_0x1e0a('0x92')]({'where':{'id':_0xde218f[_0x1e0a('0x58')]['id']}})[_0x1e0a('0x13')](handleEntityNotFound(_0x5bda38,null))[_0x1e0a('0x13')](function(_0x50df1f){if(_0x50df1f){_0x5241cf=_0x50df1f;_0x4b5e61['model']=_['keys'](db[_0x1e0a('0x3d')][_0x1e0a('0x5a')]);_0x4b5e61[_0x1e0a('0x48')]=_[_0x1e0a('0x5b')](_0xde218f[_0x1e0a('0x48')]);_0x4b5e61[_0x1e0a('0x5c')]=_[_0x1e0a('0x5e')](_0x4b5e61['model'],_0x4b5e61[_0x1e0a('0x48')]);_0x9bc34e[_0x1e0a('0x4b')]=_[_0x1e0a('0x5e')](_0x4b5e61[_0x1e0a('0x5d')],qs[_0x1e0a('0x5f')](_0xde218f[_0x1e0a('0x48')][_0x1e0a('0x5f')]));_0x9bc34e[_0x1e0a('0x4b')]=_0x9bc34e[_0x1e0a('0x4b')][_0x1e0a('0x50')]?_0x9bc34e[_0x1e0a('0x4b')]:_0x4b5e61[_0x1e0a('0x5d')];_0x9bc34e[_0x1e0a('0xc7')]=qs[_0x1e0a('0xc8')](_0xde218f['query'][_0x1e0a('0xc8')]);_0x9bc34e[_0x1e0a('0x45')]=qs[_0x1e0a('0x5c')](_['pick'](_0xde218f[_0x1e0a('0x48')],_0x4b5e61[_0x1e0a('0x5c')]));if(_0xde218f[_0x1e0a('0x48')][_0x1e0a('0x34')]){_0x9bc34e['where']=_['merge'](_0x9bc34e[_0x1e0a('0x45')],{'$or':_[_0x1e0a('0x36')](_0x9bc34e[_0x1e0a('0x4b')],function(_0x183005){var _0x6dbff4={};_0x6dbff4[_0x183005]={'$like':'%'+_0xde218f['query']['filter']+'%'};return _0x6dbff4;})});}_0x9bc34e[_0x1e0a('0x5d')]=db[_0x1e0a('0x3d')];_0x9bc34e['as']=_0x1e0a('0x30');_0x9bc34e=_['merge']({},_0x9bc34e,_0xde218f['options']);return _0x5241cf[_0x1e0a('0xec')]({'include':[_0x9bc34e]});}})[_0x1e0a('0x13')](function(_0x173c64){if(_0x173c64){var _0x44e0ef={},_0x487eff=[];for(var _0x19c3a1=0x0;_0x19c3a1<_0x173c64[_0x1e0a('0x50')];_0x19c3a1+=0x1){for(var _0xf847a7=0x0,_0x5d8658;_0xf847a7<_0x173c64[_0x19c3a1][_0x1e0a('0x30')]['length'];_0xf847a7+=0x1){_0x5d8658=_0x173c64[_0x19c3a1][_0x1e0a('0x30')][_0xf847a7][_0x1e0a('0x2b')]({'plain':!![]});_0x44e0ef[_0x5d8658['id']]=_0x5d8658;}}_0x44e0ef=_['values'](_0x44e0ef);for(var _0x289c33=qs[_0x1e0a('0x21')](_0xde218f[_0x1e0a('0x48')][_0x1e0a('0x21')]);_0x289c33<_0x44e0ef['length']&&_0x487eff['length']=_0x1bf552){_0x14fb8c=_0x1bf552;_0x5c9a8d=0xc8;}else{_0x5c9a8d=0xce;}_0x2d3eb0[_0x7d1b('0x1d')](_0x5c9a8d);return _0x2d3eb0[_0x7d1b('0x24')]('Content-Range',_0x11b9b0+'-'+_0x14fb8c+'/'+_0x1bf552)[_0x7d1b('0x1f')](_0x4a4b37);}return null;};}function saveUpdates(_0x593340){return function(_0x8c1670){if(_0x8c1670){return _0x8c1670[_0x7d1b('0x25')](_0x593340)[_0x7d1b('0x14')](function(_0x58ec95){socket['emit'](_0x7d1b('0x26')+_0x58ec95['id'],{});return _0x58ec95;});}return null;};}function removeEntity(_0x5e598d){return function(_0x555588){if(_0x555588){return _0x555588[_0x7d1b('0x27')]()['then'](function(){var _0x253d43=_0x555588[_0x7d1b('0x28')]({'plain':!![]});if(_0x253d43[_0x7d1b('0x29')]===_0x7d1b('0x2a'))return;var _0x24bd62=[{'name':_0x7d1b('0x2b'),'value':_0x7d1b('0x2c'),'ignore':!![]},{'name':_0x7d1b('0x2d'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x7d1b('0x2e'),'ignore':![]}];var _0x4b0e44=_(_0x24bd62)[_0x7d1b('0x2f')](_0x7d1b('0x30'))['map'](_0x7d1b('0x31'))[_0x7d1b('0x31')]();if(_['includes'](_0x4b0e44,_0x253d43[_0x7d1b('0x29')])){return;}var _0x467fa4=_[_0x7d1b('0x32')](_0x24bd62,['value',_0x253d43[_0x7d1b('0x29')]])[_0x7d1b('0x33')];return db[_0x7d1b('0x34')]['destroy']({'where':{'type':_0x467fa4,'resourceId':_0x253d43['id']}})[_0x7d1b('0x14')](function(){return _0x555588;});})['then'](function(){_0x5e598d[_0x7d1b('0x1d')](0xcc)[_0x7d1b('0x1e')]();});}};}function handleEntityNotFound(_0x18202d){return function(_0x422e15){if(!_0x422e15){_0x18202d[_0x7d1b('0x35')](0x194);}return _0x422e15;};}function handleError(_0x7b20c0,_0x2d492f){_0x2d492f=_0x2d492f||0x1f4;return function(_0x24e443){logger[_0x7d1b('0x19')](_0x24e443[_0x7d1b('0x36')]);if(_0x24e443['name']){delete _0x24e443[_0x7d1b('0x33')];}_0x7b20c0[_0x7d1b('0x1d')](_0x2d492f)[_0x7d1b('0x37')](_0x24e443);};}exports[_0x7d1b('0x38')]=function(_0x477264,_0x2112b3){var _0x48bfa9={},_0x565e25={'count':0x0,'rows':[]};var _0xa6c692=_(db[_0x7d1b('0x39')]['rawAttributes'])[_0x7d1b('0x3a')](function(_0x38a7ee){return{'name':_0x38a7ee[_0x7d1b('0x3b')],'type':_0x38a7ee[_0x7d1b('0x3c')][_0x7d1b('0x3d')]};})[_0x7d1b('0x2f')](function(_0x5ad690){return!_[_0x7d1b('0x3e')]([_0x7d1b('0x3f'),_0x7d1b('0x40')],_0x5ad690[_0x7d1b('0x33')]);})[_0x7d1b('0x31')]();_0x48bfa9=qs['getOptions'](_0xa6c692,_0x477264);var _0x40aabc={'where':_0x48bfa9[_0x7d1b('0x41')]};return db[_0x7d1b('0x39')][_0x7d1b('0x22')](_0x40aabc)[_0x7d1b('0x14')](function(_0x479f1f){_0x565e25[_0x7d1b('0x22')]=_0x479f1f;if(_0x477264[_0x7d1b('0x42')][_0x7d1b('0x43')]){_0x48bfa9[_0x7d1b('0x44')]=[{'all':!![]}];}if(_0x477264[_0x7d1b('0x42')][_0x7d1b('0x45')]===_0x7d1b('0x46')){_0x48bfa9['include']=[{'model':db['UserSetting'],'as':_0x7d1b('0x45')}];}if(!_[_0x7d1b('0x3e')](_0x48bfa9[_0x7d1b('0x47')],'id')){_0x48bfa9['attributes']['push']('id');}return db['User'][_0x7d1b('0x48')](_0x48bfa9);})[_0x7d1b('0x14')](function(_0x334bde){_0x565e25[_0x7d1b('0x49')]=_0x334bde;if(_0x477264[_0x7d1b('0x42')]['openTabs']===_0x7d1b('0x46')){var _0x3ae259=[];for(var _0x2b6624=0x0;_0x2b6624<_0x565e25[_0x7d1b('0x49')][_0x7d1b('0x4a')];_0x2b6624++){_0x3ae259[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x4c'),_0x565e25[_0x7d1b('0x49')][_0x2b6624][_0x7d1b('0x4d')]));_0x3ae259['push'](get_open_tabs(_0x7d1b('0x4e'),_0x565e25[_0x7d1b('0x49')][_0x2b6624][_0x7d1b('0x4d')]));_0x3ae259[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x4f'),_0x565e25[_0x7d1b('0x49')][_0x2b6624][_0x7d1b('0x4d')]));_0x3ae259['push'](get_open_tabs(_0x7d1b('0x50'),_0x565e25[_0x7d1b('0x49')][_0x2b6624][_0x7d1b('0x4d')]));_0x3ae259[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x51'),_0x565e25[_0x7d1b('0x49')][_0x2b6624]['dataValues']));_0x3ae259[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x52'),_0x565e25[_0x7d1b('0x49')][_0x2b6624][_0x7d1b('0x4d')]));}return Promise[_0x7d1b('0x53')](_0x3ae259)[_0x7d1b('0x14')](function(){return _0x565e25;});}else{return _0x565e25;}})[_0x7d1b('0x14')](respondWithFilteredResult(_0x2112b3,_0x48bfa9))['catch'](handleError(_0x2112b3,null));};exports[_0x7d1b('0x54')]=function(_0x188b79,_0x145054){var _0x33cc37={'raw':![],'where':{'id':_0x188b79['params']['id']}},_0x1c3e6b={};_0x1c3e6b[_0x7d1b('0x55')]=_[_0x7d1b('0x56')](_[_0x7d1b('0x57')](db['User'][_0x7d1b('0x58')]),['password','salt']);_0x1c3e6b['query']=_[_0x7d1b('0x57')](_0x188b79['query']);_0x1c3e6b['filters']=_[_0x7d1b('0x59')](_0x1c3e6b[_0x7d1b('0x55')],_0x1c3e6b[_0x7d1b('0x42')]);_0x33cc37[_0x7d1b('0x47')]=_['intersection'](_0x1c3e6b[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x188b79['query'][_0x7d1b('0x5a')]));_0x33cc37[_0x7d1b('0x47')]=_0x33cc37[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0x33cc37[_0x7d1b('0x47')]:_0x1c3e6b[_0x7d1b('0x55')];if(_0x188b79[_0x7d1b('0x42')]['includeAll']){_0x33cc37[_0x7d1b('0x44')]=[{'all':!![]}];}if(_0x188b79[_0x7d1b('0x42')][_0x7d1b('0x45')]===_0x7d1b('0x46')){_0x33cc37[_0x7d1b('0x44')]=[{'model':db[_0x7d1b('0x5b')],'as':'userSetting'}];}_0x33cc37=_[_0x7d1b('0x5c')]({},_0x33cc37,_0x188b79[_0x7d1b('0x5d')]);if(!_['includes'](_0x33cc37[_0x7d1b('0x47')],'id')){_0x33cc37[_0x7d1b('0x47')][_0x7d1b('0x4b')]('id');}return db[_0x7d1b('0x39')]['find'](_0x33cc37)['then'](handleEntityNotFound(_0x145054,null))[_0x7d1b('0x14')](function(_0x3e4a50){var _0x3536b6=[];values=_0x3e4a50;if(_0x188b79[_0x7d1b('0x42')][_0x7d1b('0x5e')]===_0x7d1b('0x46')){_0x3536b6[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x4c'),_0x3e4a50['dataValues']));_0x3536b6[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x4e'),_0x3e4a50[_0x7d1b('0x4d')]));_0x3536b6[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x51'),_0x3e4a50[_0x7d1b('0x4d')]));_0x3536b6['push'](get_open_tabs(_0x7d1b('0x52'),_0x3e4a50['dataValues']));_0x3536b6[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x4f'),_0x3e4a50[_0x7d1b('0x4d')]));_0x3536b6['push'](get_open_tabs(_0x7d1b('0x50'),_0x3e4a50[_0x7d1b('0x4d')]));return Promise[_0x7d1b('0x53')](_0x3536b6);}else{return values;}})[_0x7d1b('0x14')](function(){return values;})['then'](respondWithResult(_0x145054,null))[_0x7d1b('0x1c')](handleError(_0x145054,null));};exports[_0x7d1b('0x25')]=function(_0x3a2862,_0x2b46e9){if(_0x3a2862[_0x7d1b('0x5f')]['id']){delete _0x3a2862[_0x7d1b('0x5f')]['id'];}delete _0x3a2862[_0x7d1b('0x5f')]['role'];return db['User']['find']({'where':{'id':_0x3a2862[_0x7d1b('0x60')]['id']}})['then'](handleEntityNotFound(_0x2b46e9,null))['then'](saveUpdates(_0x3a2862[_0x7d1b('0x5f')],null))[_0x7d1b('0x14')](respondWithResult(_0x2b46e9,null))[_0x7d1b('0x1c')](handleError(_0x2b46e9,null));};exports[_0x7d1b('0x61')]=function(_0x39f3d4,_0x34472d){return db['User'][_0x7d1b('0x61')]()[_0x7d1b('0x14')](respondWithResult(_0x34472d,null))[_0x7d1b('0x1c')](handleError(_0x34472d,null));};exports['addContacts']=function(_0x3666e6,_0x24a3db){return db['User'][_0x7d1b('0x32')]({'where':{'id':_0x3666e6[_0x7d1b('0x60')]['id']}})['then'](handleEntityNotFound(_0x24a3db,null))[_0x7d1b('0x14')](function(_0x1176f9){if(_0x1176f9){return _0x1176f9[_0x7d1b('0x62')](_0x3666e6[_0x7d1b('0x5f')]['ids'],_[_0x7d1b('0x63')](_0x3666e6['body'],[_0x7d1b('0x64'),'id'])||{});}})[_0x7d1b('0x14')](respondWithResult(_0x24a3db,null))['catch'](handleError(_0x24a3db,null));};function validateUser(_0x30458d){return new Promise(function(_0x8c0fc3,_0x2a367d){if(_0x30458d[_0x7d1b('0x65')])return _0x8c0fc3(_0x30458d);return db['Setting'][_0x7d1b('0x66')](0x1)[_0x7d1b('0x14')](function(_0x19a828){if(_0x19a828[_0x7d1b('0x67')])authService[_0x7d1b('0x68')](_0x30458d['password']);db['User'][_0x7d1b('0x69')]('internal')[_0x7d1b('0x14')](function(_0x5aeafa){if(_[_0x7d1b('0x6a')](_0x5aeafa)){_0x30458d[_0x7d1b('0x65')]=_0x19a828[_0x7d1b('0x6b')]||0x1;return;}if(_['isNil'](_0x19a828[_0x7d1b('0x6b')])||_0x19a828[_0x7d1b('0x6b')]===_0x5aeafa){_0x30458d['internal']=_0x5aeafa+0x1;return;}if(_0x19a828['min_internal']>_0x5aeafa){_0x30458d[_0x7d1b('0x65')]=_0x19a828[_0x7d1b('0x6b')];return;}return db['sequelize']['query'](_0x7d1b('0x6c'),{'type':db[_0x7d1b('0x6d')][_0x7d1b('0x6e')][_0x7d1b('0x6f')]})[_0x7d1b('0x14')](function(_0x16ebb9){if(_0x16ebb9&&_0x16ebb9[_0x7d1b('0x4a')]){for(var _0x26c472=0x0,_0xb10d9=_0x16ebb9['length'];_0x26c472<_0xb10d9&&_[_0x7d1b('0x6a')](_0x30458d[_0x7d1b('0x65')]);_0x26c472++){if(_0x19a828['min_internal']<=_0x16ebb9[_0x26c472][_0x7d1b('0x70')]){_0x30458d[_0x7d1b('0x65')]=_0x16ebb9[_0x26c472][_0x7d1b('0x70')];}else if(_0x19a828[_0x7d1b('0x6b')]>_0x16ebb9[_0x26c472]['from']&&_0x19a828[_0x7d1b('0x6b')]<=_0x16ebb9[_0x26c472]['to']){_0x30458d['internal']=_0x19a828[_0x7d1b('0x6b')];}}}if(_[_0x7d1b('0x6a')](_0x30458d[_0x7d1b('0x65')])){_0x30458d[_0x7d1b('0x65')]=_0x5aeafa+0x1;}return _0x8c0fc3(_0x30458d);});});})[_0x7d1b('0x1c')](function(_0x5844e6){_0x2a367d(_0x5844e6);});});}function updateUser(_0x1e04db){return new Promise(function(_0x12aa3f,_0x3b8e26){try{if(_0x1e04db[_0x7d1b('0x71')]){_0x1e04db[_0x7d1b('0x72')]=_0x1e04db['internal'];_0x1e04db[_0x7d1b('0x73')]={'mailbox':_0x1e04db[_0x7d1b('0x65')],'password':_0x1e04db['password'],'fullname':_0x1e04db['fullname'],'email':_0x1e04db[_0x7d1b('0x74')]};}if(_0x1e04db[_0x7d1b('0x29')]===_0x7d1b('0x75')){if(!_0x1e04db[_0x7d1b('0x76')])_0x1e04db[_0x7d1b('0x76')]=['101','102','103',_0x7d1b('0x77'),_0x7d1b('0x78'),_0x7d1b('0x79'),_0x7d1b('0x7a'),_0x7d1b('0x7b'),_0x7d1b('0x7c'),_0x7d1b('0x7d'),_0x7d1b('0x7e'),_0x7d1b('0x7f'),_0x7d1b('0x80'),_0x7d1b('0x81'),_0x7d1b('0x82')];}_0x12aa3f(_0x1e04db);}catch(_0x515c21){_0x3b8e26(_0x515c21);}});}exports['create']=function(_0x203df0,_0xff2f6b){if(_0x203df0['user'][_0x7d1b('0x29')]===_0x7d1b('0x75'))throw new Error('Unauthorized');if(_0x203df0[_0x7d1b('0x5f')][_0x7d1b('0x29')]===_0x7d1b('0x2c')&&_0x203df0['user'][_0x7d1b('0x29')]!==_0x7d1b('0x2a')){throw new Error(_0x7d1b('0x83'));}if(_0x203df0[_0x7d1b('0x5f')][_0x7d1b('0x29')]===_0x7d1b('0x2a')&&_0x203df0[_0x7d1b('0x2c')][_0x7d1b('0x29')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x7d1b('0x84')]([_0x203df0['body']])[_0x7d1b('0x14')](function(){return validateUser(_0x203df0['body']);})['then'](function(_0x47174b){return updateUser(_0x47174b)[_0x7d1b('0x14')](function(_0x13a0fc){if(_0x13a0fc[_0x7d1b('0x29')]===_0x7d1b('0x2a')){_0x13a0fc['settingsEnabled']=_0x203df0[_0x7d1b('0x2c')]['settingsEnabled'];delete _0x13a0fc['userProfileId'];}return _0x13a0fc;});})[_0x7d1b('0x14')](function(_0x117841){return db[_0x7d1b('0x39')][_0x7d1b('0x85')](_0x117841,{'include':[{'model':db[_0x7d1b('0x73')],'as':_0x7d1b('0x73')}]});})[_0x7d1b('0x14')](function(_0x46de22){if(_0x203df0[_0x7d1b('0x5f')]['role']===_0x7d1b('0x2c'))return _0x46de22;if(_0x203df0[_0x7d1b('0x2c')][_0x7d1b('0x29')]!=='user')return _0x46de22;return db[_0x7d1b('0x86')][_0x7d1b('0x32')]({'where':{'name':_0x46de22['role']===_0x7d1b('0x75')?_0x7d1b('0x2d'):_0x7d1b('0x87'),'userProfileId':_0x203df0[_0x7d1b('0x2c')][_0x7d1b('0x88')]},'raw':!![]})[_0x7d1b('0x14')](function(_0xb65775){if(!_0xb65775||_0xb65775[_0x7d1b('0x89')]!=0x0)return _0x46de22;return db[_0x7d1b('0x34')][_0x7d1b('0x85')]({'name':_0x46de22[_0x7d1b('0x33')],'resourceId':_0x46de22['id'],'type':_0xb65775[_0x7d1b('0x33')],'sectionId':_0xb65775['id']},{})['then'](function(){return _0x46de22;});})[_0x7d1b('0x1c')](function(_0x44478c){logger['error'](_0x7d1b('0x8a'),_0x44478c);throw _0x44478c;});})[_0x7d1b('0x14')](respondWithResult(_0xff2f6b,0xc9))['catch'](handleError(_0xff2f6b,null));};exports[_0x7d1b('0x8b')]=function(_0x2e0a10,_0x470fca){var _0x396ea0=_0x2e0a10[_0x7d1b('0x5f')];var _0x1b79f1=[];if(_0x2e0a10[_0x7d1b('0x2c')][_0x7d1b('0x29')]===_0x7d1b('0x75'))throw new Error('Unauthorized');if(_[_0x7d1b('0x8c')](_0x396ea0,['role',_0x7d1b('0x2c')])&&_0x2e0a10[_0x7d1b('0x2c')][_0x7d1b('0x29')]!==_0x7d1b('0x2a')){throw new Error(_0x7d1b('0x83'));}if(_[_0x7d1b('0x8c')](_0x396ea0,['role','admin'])&&_0x2e0a10['user'][_0x7d1b('0x29')]!==_0x7d1b('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x7d1b('0x84')](_0x396ea0)[_0x7d1b('0x14')](function(){return validateUser(_0x396ea0[0x0]);})[_0x7d1b('0x14')](function(){for(var _0x1645bc=0x1;_0x1645bc<_0x396ea0[_0x7d1b('0x4a')];_0x1645bc++){var _0x3a3cf9=_0x396ea0[_0x1645bc-0x1][_0x7d1b('0x65')];if(!_0x396ea0[_0x1645bc][_0x7d1b('0x65')])_0x396ea0[_0x1645bc][_0x7d1b('0x65')]=_0x3a3cf9+0x1;_0x1b79f1['push'](validateUser(_0x396ea0[_0x1645bc]));}return Promise[_0x7d1b('0x53')](_0x1b79f1);})[_0x7d1b('0x14')](function(){_0x1b79f1=[];for(var _0x547b41=0x0;_0x547b41<_0x396ea0['length'];_0x547b41++){_0x1b79f1[_0x7d1b('0x4b')](updateUser(_0x396ea0[_0x547b41]));}return Promise['all'](_0x1b79f1);})[_0x7d1b('0x14')](function(){_0x1b79f1=_0x396ea0[_0x7d1b('0x3a')](function(_0x3e0098){return db[_0x7d1b('0x39')]['create'](_0x3e0098,{'include':[{'model':db[_0x7d1b('0x73')],'as':_0x7d1b('0x73')}]})[_0x7d1b('0x14')](function(_0x5512db){_0x3e0098['id']=_0x5512db['id'];return _0x3e0098;});});return Promise[_0x7d1b('0x53')](_0x1b79f1);})[_0x7d1b('0x14')](function(_0x3bfa55){if(_0x2e0a10['body'][_0x7d1b('0x29')]==='user')return _0x3bfa55;if(_0x2e0a10[_0x7d1b('0x2c')]['role']!=='user')return _0x3bfa55;var _0x5292fd=_['some'](_0x3bfa55,function(_0x49fe1d){return _0x49fe1d['role']===_0x7d1b('0x75')||_0x49fe1d[_0x7d1b('0x29')]===_0x7d1b('0x2e');});if(!_0x5292fd)return _0x3bfa55;return db[_0x7d1b('0x86')][_0x7d1b('0x48')]({'where':{'name':{'$or':[_0x7d1b('0x2d'),_0x7d1b('0x87')]},'userProfileId':_0x2e0a10[_0x7d1b('0x2c')][_0x7d1b('0x88')]},'raw':!![]})[_0x7d1b('0x14')](function(_0xa35c92){if(_[_0x7d1b('0x8d')](_0xa35c92)||!_['some'](_0xa35c92,[_0x7d1b('0x89'),0x0]))return _0x3bfa55;_0x1b79f1=[];var _0x36b2dc=_(_0xa35c92)[_0x7d1b('0x3a')](function(_0x112470){if(_0x112470[_0x7d1b('0x89')]===0x1)return;return _0x112470['name']==='Agents'?'agent':_0x7d1b('0x2e');})[_0x7d1b('0x8e')]()[_0x7d1b('0x31')]();for(var _0x53e645=0x0;_0x53e645<_0x3bfa55['length'];_0x53e645++){if(!_['includes'](_0x36b2dc,_0x3bfa55[_0x53e645]['role']))return;var _0x1c1e3e=_0x3bfa55[_0x53e645][_0x7d1b('0x29')]===_0x7d1b('0x75')?_0x7d1b('0x2d'):'Telephones';_0x1b79f1[_0x7d1b('0x4b')](db[_0x7d1b('0x34')][_0x7d1b('0x85')]({'name':_0x3bfa55[_0x53e645][_0x7d1b('0x33')],'resourceId':_0x3bfa55[_0x53e645]['id'],'type':_0x1c1e3e,'sectionId':_[_0x7d1b('0x32')](_0xa35c92,[_0x7d1b('0x33'),_0x1c1e3e])['id']},{}));}return Promise[_0x7d1b('0x53')](_0x1b79f1);});})[_0x7d1b('0x14')](respondWithResult(_0x470fca,0xc9))[_0x7d1b('0x1c')](handleError(_0x470fca,null));};exports['changePassword']=function(_0x5b0bb1,_0x1adbe7){if(_0x5b0bb1['body']['id']){delete _0x5b0bb1[_0x7d1b('0x5f')]['id'];}return db[_0x7d1b('0x39')][_0x7d1b('0x32')]({'where':{'id':_0x5b0bb1[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](function(_0x110945){if(!_0x110945)return null;if(_0x110945['id']===_0x5b0bb1[_0x7d1b('0x2c')]['id']){if(!_0x5b0bb1[_0x7d1b('0x5f')][_0x7d1b('0x8f')]||!_0x5b0bb1[_0x7d1b('0x5f')][_0x7d1b('0x90')]){throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))](_0x7d1b('0x93'));}if(!_0x110945[_0x7d1b('0x94')](_0x5b0bb1['body'][_0x7d1b('0x8f')])){throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))]('Wrong\x20credentials');}if(_0x5b0bb1['body']['oldPassword']===_0x5b0bb1[_0x7d1b('0x5f')][_0x7d1b('0x90')]){throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))](_0x7d1b('0x95'));}}else if(_0x5b0bb1[_0x7d1b('0x2c')][_0x7d1b('0x29')]===_0x7d1b('0x2a')){if(!_0x5b0bb1['body'][_0x7d1b('0x90')]){throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x5b0bb1['user'][_0x7d1b('0x29')]===_0x7d1b('0x2c')){if(!_0x5b0bb1['body'][_0x7d1b('0x90')]){throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))](_0x7d1b('0x96'));}if(_0x110945[_0x7d1b('0x29')]!==_0x7d1b('0x75')){throw new db[(_0x7d1b('0x91'))]['ValidationError'](_0x7d1b('0x97'));}}else{throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))](_0x7d1b('0x97'));}return _0x110945;})[_0x7d1b('0x14')](handleEntityNotFound(_0x1adbe7,null))[_0x7d1b('0x14')](function(_0x16fb0d){return db['Setting']['findOne']({'attributes':['id','securePassword',_0x7d1b('0x98'),_0x7d1b('0x99')]})[_0x7d1b('0x14')](function(_0xff591f){if(_0xff591f[_0x7d1b('0x67')])authService[_0x7d1b('0x68')](_0x5b0bb1[_0x7d1b('0x5f')][_0x7d1b('0x90')]);if(!_0xff591f[_0x7d1b('0x98')]||!_0x16fb0d[_0x7d1b('0x9a')])return _0x16fb0d;authService['validatePasswordHistory'](_0x5b0bb1['body'][_0x7d1b('0x90')],_0x16fb0d['previousPasswords'],_0xff591f['passwordHistoryLimit']);return _0x16fb0d;})['then'](saveUpdates({'password':_0x5b0bb1[_0x7d1b('0x5f')]['newPassword'],'passwordResetAt':_0x5b0bb1['user']['id']==_0x5b0bb1[_0x7d1b('0x60')]['id']?moment():null,'previousPasswords':authService[_0x7d1b('0x9b')](_0x5b0bb1[_0x7d1b('0x5f')]['newPassword'],_0x16fb0d['previousPasswords'])},null));})[_0x7d1b('0x14')](respondWithResult(_0x1adbe7,null))['catch'](handleError(_0x1adbe7,null));};exports['addQueues']=function(_0x25edf9,_0x34bfca){var _0x1e99b6=_0x25edf9[_0x7d1b('0x5f')]['channel'];return db[_0x7d1b('0x39')]['find']({'where':{'id':_0x25edf9[_0x7d1b('0x60')]['id']},'attributes':['id',_0x7d1b('0x33'),'role','online',_0x7d1b('0x9c'),'voicePause','interface']})[_0x7d1b('0x14')](handleEntityNotFound(_0x34bfca,null))[_0x7d1b('0x14')](function(_0x30dced){if(_0x30dced){if(!utils[_0x7d1b('0x9d')](_0x1e99b6)){throw new db['Sequelize'][(_0x7d1b('0x92'))](_0x7d1b('0x9e'));}return _0x30dced[_0x7d1b('0x9f')+_[_0x7d1b('0xa0')](_0x1e99b6[_0x7d1b('0xa1')]())+'Queues'](_0x25edf9[_0x7d1b('0x5f')][_0x7d1b('0x64')],{'penalty':_0x25edf9[_0x7d1b('0x5f')][_0x7d1b('0xa2')]||0x0})['spread'](function(_0x42aecd){for(var _0x4876ad=0x0;_0x4876ad<_0x25edf9[_0x7d1b('0x5f')][_0x7d1b('0x64')][_0x7d1b('0x4a')];_0x4876ad+=0x1){var _0x3cf194={'UserId':Number(_0x25edf9[_0x7d1b('0x60')]['id'])};_0x3cf194[_[_0x7d1b('0xa0')](_0x1e99b6[_0x7d1b('0xa1')]())+_0x7d1b('0xa3')]=Number(_0x25edf9[_0x7d1b('0x5f')][_0x7d1b('0x64')][_0x4876ad]);socket[_0x7d1b('0xa4')](_0x7d1b('0x2c')+_[_0x7d1b('0xa0')](_0x1e99b6['toLowerCase']())+_0x7d1b('0xa5'),_0x3cf194);}return _0x42aecd;})[_0x7d1b('0x14')](function(){if(_0x1e99b6===_0x7d1b('0xa6')){return db[_0x7d1b('0xa7')][_0x7d1b('0x48')]({'where':{'id':_0x25edf9[_0x7d1b('0x5f')]['ids']||[]},'raw':!![],'attributes':['id',_0x7d1b('0x33')]});}})[_0x7d1b('0x14')](function(_0x2f9694){var _0x57e386=_0x30dced['get']({'plain':!![]});var _0x46ab08=[];if(_0x1e99b6===_0x7d1b('0xa6')&&_0x57e386[_0x7d1b('0x29')]===_0x7d1b('0x75')&&_0x57e386[_0x7d1b('0xa8')]){for(let _0x539023=0x0;_0x539023<_0x2f9694[_0x7d1b('0x4a')];_0x539023+=0x1){_0x46ab08['push']({'membername':_0x57e386[_0x7d1b('0x33')],'UserId':_0x57e386['id'],'queue_name':_0x2f9694[_0x539023]['name'],'VoiceQueueId':_0x2f9694[_0x539023]['id'],'interface':_[_0x7d1b('0x6a')](_0x57e386[_0x7d1b('0xa9')])?util[_0x7d1b('0xaa')](_0x7d1b('0xab'),_0x57e386[_0x7d1b('0x33')]):_0x57e386['interface'],'paused':_0x57e386[_0x7d1b('0xac')]||![],'penalty':_0x25edf9[_0x7d1b('0x5f')]['penalty']||0x0});}return Promise[_0x7d1b('0x53')](_0x46ab08[_0x7d1b('0x3a')](function(_0x18708e){return db[_0x7d1b('0xad')][_0x7d1b('0xae')](_0x18708e);}));}return _0x30dced;});}})['then'](respondWithStatusCode(_0x34bfca,null))[_0x7d1b('0x1c')](handleError(_0x34bfca,null));};exports[_0x7d1b('0xaf')]=function(_0x2b333e,_0x11e00c){var _0x296140,_0x4e7bd6;return db['User'][_0x7d1b('0x32')]({'where':{'id':_0x2b333e[_0x7d1b('0x60')]['id']},'attributes':['id',_0x7d1b('0x33'),_0x7d1b('0x29')]})[_0x7d1b('0x14')](handleEntityNotFound(_0x11e00c,null))[_0x7d1b('0x14')](function(_0x5547e7){if(_0x5547e7){_0x296140=_0x5547e7;if(!_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0xb0')]||!utils['isValidChannel'](_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0xb0')])){throw new db[(_0x7d1b('0x91'))]['ValidationError'](_0x7d1b('0x9e'));}return _0x5547e7[_0x7d1b('0xb1')+_['capitalize'](_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0xb0')]['toLowerCase']())+'Queues'](_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0x64')]);}})[_0x7d1b('0x14')](function(_0x4252a6){if(_[_0x7d1b('0xb2')](_0x2b333e[_0x7d1b('0x42')]['ids'])){for(var _0x24b784=0x0;_0x24b784<_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0x64')][_0x7d1b('0x4a')];_0x24b784+=0x1){_0x4e7bd6={'UserId':Number(_0x2b333e[_0x7d1b('0x60')]['id'])};_0x4e7bd6[_[_0x7d1b('0xa0')](_0x2b333e['query'][_0x7d1b('0xb0')][_0x7d1b('0xa1')]())+_0x7d1b('0xa3')]=Number(_0x2b333e[_0x7d1b('0x42')]['ids'][_0x24b784]);socket[_0x7d1b('0xa4')](_0x7d1b('0x2c')+_[_0x7d1b('0xa0')](_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0xb0')]['toLowerCase']())+_0x7d1b('0xb3'),_0x4e7bd6);}}else{_0x4e7bd6={'UserId':Number(_0x2b333e['params']['id'])};_0x4e7bd6[_[_0x7d1b('0xa0')](_0x2b333e['query'][_0x7d1b('0xb0')][_0x7d1b('0xa1')]())+_0x7d1b('0xa3')]=Number(_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0x64')]);socket[_0x7d1b('0xa4')](_0x7d1b('0x2c')+_['capitalize'](_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0xb0')][_0x7d1b('0xa1')]())+_0x7d1b('0xb3'),_0x4e7bd6);}return _0x4252a6;})['then'](function(){if(_0x2b333e[_0x7d1b('0x42')]['channel']===_0x7d1b('0xa6')){return db[_0x7d1b('0xad')][_0x7d1b('0x27')]({'where':{'UserId':_0x2b333e[_0x7d1b('0x60')]['id'],'VoiceQueueId':_0x2b333e[_0x7d1b('0x42')][_0x7d1b('0x64')]},'individualHooks':!![]})[_0x7d1b('0x14')](function(){return _0x296140;});}return _0x296140;})[_0x7d1b('0x14')](respondWithStatusCode(_0x11e00c,null))['catch'](handleError(_0x11e00c,null));};exports['addAvatar']=function(_0x567b34,_0x4c691c){_0x567b34['body'][_0x7d1b('0xb4')]=_0x567b34['file'][_0x7d1b('0xb5')];return db['User'][_0x7d1b('0x32')]({'where':{'id':_0x567b34[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x4c691c,null))['then'](saveUpdates(_0x567b34[_0x7d1b('0x5f')],null))[_0x7d1b('0x14')](respondWithResult(_0x4c691c,null))['catch'](handleError(_0x4c691c,null));};exports[_0x7d1b('0xb6')]=function(_0x1453c9,_0x193fa5){var _0x2c53b1=path['join'](config[_0x7d1b('0xb7')],_0x7d1b('0xb8'));return db[_0x7d1b('0x39')][_0x7d1b('0x32')]({'where':{'id':_0x1453c9[_0x7d1b('0x60')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x7d1b('0x14')](handleEntityNotFound(_0x193fa5,null))[_0x7d1b('0x14')](function(_0x15fa5e){if(_0x15fa5e){if(_[_0x7d1b('0x6a')](_0x15fa5e[_0x7d1b('0xb4')])){return _0x193fa5['download'](_0x2c53b1);}else{if(!fs['existsSync'](path[_0x7d1b('0xb9')](config[_0x7d1b('0xb7')],_0x7d1b('0xba'),_0x15fa5e[_0x7d1b('0xb4')]))){return _0x193fa5[_0x7d1b('0xbb')](_0x2c53b1);}return _0x193fa5['download'](path['join'](config[_0x7d1b('0xb7')],_0x7d1b('0xba'),_0x15fa5e[_0x7d1b('0xb4')]));}}})[_0x7d1b('0x1c')](handleError(_0x193fa5,null));};exports[_0x7d1b('0xbc')]=function(_0x29d69d,_0x3d9809){return db[_0x7d1b('0x39')][_0x7d1b('0x32')]({'where':{'id':_0x29d69d['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x3d9809,null))['then'](function(_0x42cd1d){var _0x28a018=[];values=_0x42cd1d[_0x7d1b('0x4d')];_0x28a018[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x4c'),_0x42cd1d[_0x7d1b('0x4d')]));_0x28a018[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x4e'),_0x42cd1d[_0x7d1b('0x4d')]));_0x28a018['push'](get_open_tabs('openchannel',_0x42cd1d['dataValues']));_0x28a018['push'](get_open_tabs(_0x7d1b('0x52'),_0x42cd1d['dataValues']));_0x28a018['push'](get_open_tabs(_0x7d1b('0x4f'),_0x42cd1d[_0x7d1b('0x4d')]));_0x28a018[_0x7d1b('0x4b')](get_open_tabs(_0x7d1b('0x50'),_0x42cd1d['dataValues']));return Promise['all'](_0x28a018);})[_0x7d1b('0x14')](function(_0x38057c){if(_0x38057c){var _0x136677=_[_0x7d1b('0x3a')](values[_0x7d1b('0xbd')],function(_0xe827dd){return{'channel':_0x7d1b('0xbe'),'id':_0xe827dd['id'],'createdAt':_0xe827dd[_0x7d1b('0xbf')]};});var _0x5df788=_[_0x7d1b('0x3a')](values[_0x7d1b('0xc0')],function(_0x48687d){return{'channel':_0x7d1b('0xc1'),'id':_0x48687d['id'],'createdAt':_0x48687d[_0x7d1b('0xbf')]};});var _0x93a04b=_[_0x7d1b('0x3a')](values[_0x7d1b('0xc2')],function(_0x1bfe54){return{'channel':_0x7d1b('0xc3'),'id':_0x1bfe54['id'],'createdAt':_0x1bfe54[_0x7d1b('0xbf')]};});var _0x126939=_['map'](values['MailOpenTabs'],function(_0x23a84c){return{'channel':_0x7d1b('0xc4'),'id':_0x23a84c['id'],'createdAt':_0x23a84c[_0x7d1b('0xbf')]};});var _0x190d0f=_['map'](values[_0x7d1b('0xc5')],function(_0x392f60){return{'channel':_0x7d1b('0xc6'),'id':_0x392f60['id'],'createdAt':_0x392f60[_0x7d1b('0xbf')]};});var _0x2ea12a=_[_0x7d1b('0x3a')](values[_0x7d1b('0xc7')],function(_0x38e2f5){return{'channel':_0x7d1b('0xc8'),'id':_0x38e2f5['id'],'createdAt':_0x38e2f5['createdAt']};});var _0xec89e=_[_0x7d1b('0xc9')](_0x136677,_0x5df788,_0x93a04b,_0x126939,_0x190d0f,_0x2ea12a);var _0x5f3ebc={'count':_0xec89e[_0x7d1b('0x4a')],'rows':_0xec89e};return _0x5f3ebc;}else return null;})[_0x7d1b('0x14')](respondWithResult(_0x3d9809,null))[_0x7d1b('0x1c')](handleError(_0x3d9809,null));};exports[_0x7d1b('0xca')]=function(_0x444f9a,_0x2d1460){var _0xea7ef7={};var _0x11c754={};var _0x548e41;var _0x4c85df;return db['User'][_0x7d1b('0xcb')]({'where':{'id':_0x444f9a[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x2d1460,null))[_0x7d1b('0x14')](function(_0x5ce62e){if(_0x5ce62e){_0x548e41=_0x5ce62e;_0x11c754[_0x7d1b('0x55')]=_[_0x7d1b('0x57')](db[_0x7d1b('0xcc')][_0x7d1b('0x58')]);_0x11c754[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x444f9a[_0x7d1b('0x42')]);_0x11c754[_0x7d1b('0xcd')]=_['intersection'](_0x11c754['model'],_0x11c754[_0x7d1b('0x42')]);_0xea7ef7[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x11c754[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x444f9a[_0x7d1b('0x42')]['fields']));_0xea7ef7[_0x7d1b('0x47')]=_0xea7ef7[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0xea7ef7[_0x7d1b('0x47')]:_0x11c754['model'];_0xea7ef7[_0x7d1b('0xce')]=qs['sort'](_0x444f9a['query'][_0x7d1b('0xcf')]);_0xea7ef7[_0x7d1b('0x41')]=qs['filters'](_['pick'](_0x444f9a[_0x7d1b('0x42')],_0x11c754[_0x7d1b('0xcd')]));if(_0x444f9a[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0xea7ef7[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0xea7ef7[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0xea7ef7['attributes'],function(_0x15fb40){var _0x241b30={};_0x241b30[_0x15fb40]={'$like':'%'+_0x444f9a[_0x7d1b('0x42')]['filter']+'%'};return _0x241b30;})});}_0xea7ef7=_[_0x7d1b('0x5c')]({},_0xea7ef7,_0x444f9a[_0x7d1b('0x5d')]);return _0x548e41[_0x7d1b('0xca')](_0xea7ef7);}})[_0x7d1b('0x14')](function(_0x2f3313){if(_0x2f3313){_0x4c85df=_0x2f3313['length'];if(_0x444f9a[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0x43'))){_0xea7ef7['include']=[{'model':db['CmList'],'as':_0x7d1b('0xd1'),'required':![]},{'model':db[_0x7d1b('0xd2')],'as':_0x7d1b('0xd3'),'attributes':['id',_0x7d1b('0x33'),'color'],'where':_0x444f9a['query']['tag']?{'id':_0x444f9a[_0x7d1b('0x42')][_0x7d1b('0xd4')]}:undefined,'required':_0x444f9a['query'][_0x7d1b('0xd4')]?!![]:![]}];}if(!_0x444f9a[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0xea7ef7[_0x7d1b('0x23')]=qs[_0x7d1b('0x23')](_0x444f9a[_0x7d1b('0x42')][_0x7d1b('0x23')]);_0xea7ef7[_0x7d1b('0x20')]=qs[_0x7d1b('0x20')](_0x444f9a[_0x7d1b('0x42')][_0x7d1b('0x20')]);}return _0x548e41['getContacts'](_0xea7ef7);}})[_0x7d1b('0x14')](function(_0x3e1c2b){if(_0x3e1c2b){return _0x3e1c2b?{'count':_0x4c85df,'rows':_0x3e1c2b}:null;}})[_0x7d1b('0x14')](respondWithResult(_0x2d1460,null))['catch'](handleError(_0x2d1460,null));};exports[_0x7d1b('0xd6')]=function(_0x1841b6,_0x4a82f2){var _0x92b250;var _0x5081e3={};var _0x574c92;return db[_0x7d1b('0x39')]['findOne']({'where':{'id':_0x1841b6[_0x7d1b('0x60')]['id']},'attributes':['id','name',_0x7d1b('0x29')]})[_0x7d1b('0x14')](handleEntityNotFound(_0x4a82f2,null))[_0x7d1b('0x14')](function(_0x3962d7){if(!utils['isValidChannel'](_0x1841b6[_0x7d1b('0x42')][_0x7d1b('0xb0')])){throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))]('Unknown\x20channel');}_0x92b250=_0x3962d7;var _0x1512e5={};_0x1512e5['model']=_[_0x7d1b('0x57')](db[_[_0x7d1b('0xa0')](_0x1841b6['query'][_0x7d1b('0xb0')])+'Queue'][_0x7d1b('0x58')]);_0x1512e5[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x1841b6['query']);_0x1512e5['filters']=_[_0x7d1b('0x59')](_0x1512e5[_0x7d1b('0x55')],_0x1512e5[_0x7d1b('0x42')]);_0x5081e3[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x1512e5[_0x7d1b('0x55')],qs['fields'](_0x1841b6['query'][_0x7d1b('0x5a')]));_0x5081e3[_0x7d1b('0x47')]=_0x5081e3[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0x5081e3[_0x7d1b('0x47')]:_0x1512e5[_0x7d1b('0x55')];_0x5081e3[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x1841b6[_0x7d1b('0x42')][_0x7d1b('0xcf')]);_0x5081e3[_0x7d1b('0x41')]=qs[_0x7d1b('0xcd')](_['pick'](_0x1841b6[_0x7d1b('0x42')],_0x1512e5[_0x7d1b('0xcd')]));if(_0x1841b6[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0x5081e3[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x5081e3[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x5081e3[_0x7d1b('0x47')],function(_0x2a8d26){var _0x20354d={};_0x20354d[_0x2a8d26]={'$like':'%'+_0x1841b6[_0x7d1b('0x42')][_0x7d1b('0x2f')]+'%'};return _0x20354d;})});}_0x5081e3=_[_0x7d1b('0x5c')]({},_0x5081e3,_0x1841b6[_0x7d1b('0x5d')]);switch(_0x92b250[_0x7d1b('0x29')]){case'admin':return db[_[_0x7d1b('0xa0')](_0x1841b6['query'][_0x7d1b('0xb0')])+_0x7d1b('0xd7')][_0x7d1b('0x48')](_0x5081e3);case'user':case _0x7d1b('0x75'):return _0x92b250[_0x7d1b('0x28')+_[_0x7d1b('0xa0')](_0x1841b6[_0x7d1b('0x42')][_0x7d1b('0xb0')])+_0x7d1b('0xd8')](_0x5081e3);default:throw new db['Sequelize'][(_0x7d1b('0x92'))](_0x7d1b('0xd9'));}})[_0x7d1b('0x14')](function(_0x2facc1){_0x574c92=_0x2facc1[_0x7d1b('0x4a')];if(!_0x1841b6['query'][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x5081e3['limit']=qs['limit'](_0x1841b6['query'][_0x7d1b('0x23')]);_0x5081e3[_0x7d1b('0x20')]=qs['offset'](_0x1841b6[_0x7d1b('0x42')]['offset']);}switch(_0x92b250[_0x7d1b('0x29')]){case _0x7d1b('0x2a'):return db[_['capitalize'](_0x1841b6['query'][_0x7d1b('0xb0')])+'Queue'][_0x7d1b('0x48')](_0x5081e3);case _0x7d1b('0x2c'):case _0x7d1b('0x75'):return _0x92b250[_0x7d1b('0x28')+_['capitalize'](_0x1841b6[_0x7d1b('0x42')][_0x7d1b('0xb0')])+_0x7d1b('0xd8')](_0x5081e3);}})[_0x7d1b('0x14')](function(_0x7b1ec2){return{'count':_0x574c92,'rows':_0x7b1ec2};})[_0x7d1b('0x14')](respondWithResult(_0x4a82f2,null))[_0x7d1b('0x1c')](handleError(_0x4a82f2,null));};exports['getVoiceQueuesRt']=function(_0x2ee867,_0x1b490d){var _0x186d42={};var _0x2dd6a1={};var _0x25a08d;var _0x3e3c60;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x2ee867[_0x7d1b('0x60')]['id']}})['then'](handleEntityNotFound(_0x1b490d,null))[_0x7d1b('0x14')](function(_0x4c313b){if(_0x4c313b){_0x25a08d=_0x4c313b;_0x2dd6a1['model']=_['keys'](db[_0x7d1b('0xad')][_0x7d1b('0x58')]);_0x2dd6a1[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x2ee867[_0x7d1b('0x42')]);_0x2dd6a1['filters']=_['intersection'](_0x2dd6a1['model'],_0x2dd6a1[_0x7d1b('0x42')]);_0x186d42[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x2dd6a1['model'],qs[_0x7d1b('0x5a')](_0x2ee867[_0x7d1b('0x42')][_0x7d1b('0x5a')]));_0x186d42['attributes']=_0x186d42[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0x186d42['attributes']:_0x2dd6a1[_0x7d1b('0x55')];_0x186d42[_0x7d1b('0xce')]=qs['sort'](_0x2ee867['query'][_0x7d1b('0xcf')]);_0x186d42[_0x7d1b('0x41')]=qs['filters'](_[_0x7d1b('0xda')](_0x2ee867[_0x7d1b('0x42')],_0x2dd6a1['filters']));if(_0x2ee867[_0x7d1b('0x42')]['filter']){_0x186d42[_0x7d1b('0x41')]=_['merge'](_0x186d42[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x186d42[_0x7d1b('0x47')],function(_0x565c85){var _0x20108e={};_0x20108e[_0x565c85]={'$like':'%'+_0x2ee867[_0x7d1b('0x42')][_0x7d1b('0x2f')]+'%'};return _0x20108e;})});}_0x186d42=_[_0x7d1b('0x5c')]({},_0x186d42,_0x2ee867[_0x7d1b('0x5d')]);return _0x25a08d[_0x7d1b('0xdb')](_0x186d42);}})['then'](function(_0x19095c){if(_0x19095c){_0x3e3c60=_0x19095c[_0x7d1b('0x4a')];if(!_0x2ee867[_0x7d1b('0x42')]['hasOwnProperty'](_0x7d1b('0xd5'))){_0x186d42[_0x7d1b('0x23')]=qs['limit'](_0x2ee867[_0x7d1b('0x42')]['limit']);_0x186d42[_0x7d1b('0x20')]=qs[_0x7d1b('0x20')](_0x2ee867['query'][_0x7d1b('0x20')]);}return _0x25a08d['getVoiceQueuesRt'](_0x186d42);}})[_0x7d1b('0x14')](function(_0x3b26e7){if(_0x3b26e7){return _0x3b26e7?{'count':_0x3e3c60,'rows':_0x3b26e7}:null;}})[_0x7d1b('0x14')](respondWithResult(_0x1b490d,null))[_0x7d1b('0x1c')](handleError(_0x1b490d,null));};exports[_0x7d1b('0xdc')]=function(_0x3fe9d5,_0x5551ee){var _0x260df0={};var _0x1e858e={};var _0x34159f;var _0x5f4611;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x3fe9d5[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x5551ee,null))['then'](function(_0x3fd211){if(_0x3fd211){_0x34159f=_0x3fd211;_0x1e858e[_0x7d1b('0x55')]=_['keys'](db[_0x7d1b('0xdd')][_0x7d1b('0x58')]);_0x1e858e[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x3fe9d5[_0x7d1b('0x42')]);_0x1e858e['filters']=_[_0x7d1b('0x59')](_0x1e858e[_0x7d1b('0x55')],_0x1e858e[_0x7d1b('0x42')]);_0x260df0[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x1e858e[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x3fe9d5[_0x7d1b('0x42')][_0x7d1b('0x5a')]));_0x260df0[_0x7d1b('0x47')]=_0x260df0[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0x260df0[_0x7d1b('0x47')]:_0x1e858e[_0x7d1b('0x55')];_0x260df0['order']=qs['sort'](_0x3fe9d5[_0x7d1b('0x42')][_0x7d1b('0xcf')]);_0x260df0['where']=qs['filters'](_['pick'](_0x3fe9d5[_0x7d1b('0x42')],_0x1e858e[_0x7d1b('0xcd')]));if(_0x3fe9d5['query'][_0x7d1b('0x2f')]){_0x260df0['where']=_['merge'](_0x260df0[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x260df0[_0x7d1b('0x47')],function(_0x58a240){var _0x2c0281={};_0x2c0281[_0x58a240]={'$like':'%'+_0x3fe9d5[_0x7d1b('0x42')][_0x7d1b('0x2f')]+'%'};return _0x2c0281;})});}_0x260df0=_[_0x7d1b('0x5c')]({},_0x260df0,_0x3fe9d5[_0x7d1b('0x5d')]);return _0x34159f['getGroups'](_0x260df0);}})[_0x7d1b('0x14')](function(_0x380e88){if(_0x380e88){_0x5f4611=_0x380e88[_0x7d1b('0x4a')];if(!_0x3fe9d5['query']['hasOwnProperty']('nolimit')){_0x260df0[_0x7d1b('0x23')]=qs[_0x7d1b('0x23')](_0x3fe9d5[_0x7d1b('0x42')][_0x7d1b('0x23')]);_0x260df0[_0x7d1b('0x20')]=qs['offset'](_0x3fe9d5['query']['offset']);}return _0x34159f[_0x7d1b('0xdc')](_0x260df0);}})[_0x7d1b('0x14')](function(_0x2b3c71){if(_0x2b3c71){return _0x2b3c71?{'count':_0x5f4611,'rows':_0x2b3c71}:null;}})[_0x7d1b('0x14')](respondWithResult(_0x5551ee,null))[_0x7d1b('0x1c')](handleError(_0x5551ee,null));};exports[_0x7d1b('0xde')]=function(_0x4a5ebe,_0x1e2583){var _0x12a3d9={'raw':!![],'where':{}};var _0x6b5cdd={};var _0x530b41={'count':0x0,'rows':[]};return db['User'][_0x7d1b('0xcb')]({'where':{'id':_0x4a5ebe[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x1e2583,null))[_0x7d1b('0x14')](function(_0x1f2a65){if(_0x1f2a65){_0x6b5cdd['model']=_[_0x7d1b('0x57')](db[_0x7d1b('0xdf')][_0x7d1b('0x58')]);_0x6b5cdd[_0x7d1b('0x42')]=_['keys'](_0x4a5ebe['query']);_0x6b5cdd[_0x7d1b('0xcd')]=_['intersection'](_0x6b5cdd[_0x7d1b('0x55')],_0x6b5cdd['query']);_0x12a3d9[_0x7d1b('0x47')]=_['intersection'](_0x6b5cdd[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x4a5ebe['query'][_0x7d1b('0x5a')]));_0x12a3d9[_0x7d1b('0x47')]=_0x12a3d9[_0x7d1b('0x47')]['length']?_0x12a3d9[_0x7d1b('0x47')]:_0x6b5cdd['model'];if(!_0x4a5ebe[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x12a3d9['limit']=qs[_0x7d1b('0x23')](_0x4a5ebe['query']['limit']);_0x12a3d9[_0x7d1b('0x20')]=qs[_0x7d1b('0x20')](_0x4a5ebe['query'][_0x7d1b('0x20')]);}_0x12a3d9[_0x7d1b('0xce')]=qs['sort'](_0x4a5ebe[_0x7d1b('0x42')][_0x7d1b('0xcf')]);_0x12a3d9[_0x7d1b('0x41')]=qs[_0x7d1b('0xcd')](_[_0x7d1b('0xda')](_0x4a5ebe[_0x7d1b('0x42')],_0x6b5cdd['filters']));_0x12a3d9['where'][_0x7d1b('0xe0')]=_0x1f2a65['id'];if(_0x4a5ebe[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0x12a3d9[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x12a3d9[_0x7d1b('0x41')],{'$or':_['map'](_0x12a3d9[_0x7d1b('0x47')],function(_0x1d234c){var _0x395249={};_0x395249[_0x1d234c]={'$like':'%'+_0x4a5ebe['query'][_0x7d1b('0x2f')]+'%'};return _0x395249;})});}_0x12a3d9=_[_0x7d1b('0x5c')]({},_0x12a3d9,_0x4a5ebe[_0x7d1b('0x5d')]);return db['VoiceRecording'][_0x7d1b('0x22')]({'where':_0x12a3d9[_0x7d1b('0x41')]})[_0x7d1b('0x14')](function(_0x3e83aa){_0x530b41[_0x7d1b('0x22')]=_0x3e83aa;if(_0x4a5ebe['query']['includeAll']){_0x12a3d9[_0x7d1b('0x44')]=[{'all':!![]}];}return db[_0x7d1b('0xdf')][_0x7d1b('0x48')](_0x12a3d9);})[_0x7d1b('0x14')](function(_0x4ac73a){_0x530b41['rows']=_0x4ac73a;return _0x530b41;});}})['then'](respondWithFilteredResult(_0x1e2583,_0x12a3d9))['catch'](handleError(_0x1e2583,null));};exports[_0x7d1b('0xe1')]=function(_0x3b8c75,_0x4cdff7){var _0x230811={'raw':!![],'where':{}};var _0x54c0e9={};var _0x3fbaf6={'count':0x0,'rows':[]};return db['User'][_0x7d1b('0xcb')]({'where':{'id':_0x3b8c75[_0x7d1b('0x60')]['id']}})['then'](handleEntityNotFound(_0x4cdff7,null))[_0x7d1b('0x14')](function(_0x54b9b6){if(_0x54b9b6){_0x54c0e9[_0x7d1b('0x55')]=_['keys'](db[_0x7d1b('0xe2')][_0x7d1b('0x58')]);_0x54c0e9[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x3b8c75[_0x7d1b('0x42')]);_0x54c0e9[_0x7d1b('0xcd')]=_[_0x7d1b('0x59')](_0x54c0e9[_0x7d1b('0x55')],_0x54c0e9[_0x7d1b('0x42')]);_0x230811[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x54c0e9[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x3b8c75[_0x7d1b('0x42')][_0x7d1b('0x5a')]));_0x230811[_0x7d1b('0x47')]=_0x230811[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0x230811['attributes']:_0x54c0e9[_0x7d1b('0x55')];if(!_0x3b8c75['query'][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x230811['limit']=qs[_0x7d1b('0x23')](_0x3b8c75['query']['limit']);_0x230811['offset']=qs[_0x7d1b('0x20')](_0x3b8c75[_0x7d1b('0x42')][_0x7d1b('0x20')]);}_0x230811[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x3b8c75[_0x7d1b('0x42')]['sort']);_0x230811[_0x7d1b('0x41')]=qs[_0x7d1b('0xcd')](_[_0x7d1b('0xda')](_0x3b8c75[_0x7d1b('0x42')],_0x54c0e9[_0x7d1b('0xcd')]));_0x230811[_0x7d1b('0x41')][_0x7d1b('0xe0')]=_0x54b9b6['id'];if(_0x3b8c75[_0x7d1b('0x42')]['filter']){_0x230811[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x230811['where'],{'$or':_[_0x7d1b('0x3a')](_0x230811[_0x7d1b('0x47')],function(_0x2a9b69){var _0x5bb256={};_0x5bb256[_0x2a9b69]={'$like':'%'+_0x3b8c75[_0x7d1b('0x42')][_0x7d1b('0x2f')]+'%'};return _0x5bb256;})});}_0x230811=_[_0x7d1b('0x5c')]({},_0x230811,_0x3b8c75['options']);return db[_0x7d1b('0xe2')]['count']({'where':_0x230811[_0x7d1b('0x41')]})[_0x7d1b('0x14')](function(_0x2f2850){_0x3fbaf6[_0x7d1b('0x22')]=_0x2f2850;if(_0x3b8c75[_0x7d1b('0x42')][_0x7d1b('0x43')]){_0x230811[_0x7d1b('0x44')]=[{'all':!![]}];}return db[_0x7d1b('0xe2')][_0x7d1b('0x48')](_0x230811);})[_0x7d1b('0x14')](function(_0x1a24b5){_0x3fbaf6[_0x7d1b('0x49')]=_0x1a24b5;return _0x3fbaf6;});}})[_0x7d1b('0x14')](respondWithFilteredResult(_0x4cdff7,_0x230811))[_0x7d1b('0x1c')](handleError(_0x4cdff7,null));};exports['getChatInteractions']=function(_0x13305f,_0x196321){var _0x48537b={};var _0xc0e6a1={};var _0x4a68db;var _0x284776;return db['User'][_0x7d1b('0xcb')]({'where':{'id':_0x13305f[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x196321,null))[_0x7d1b('0x14')](function(_0x7dfe0a){if(_0x7dfe0a){_0x4a68db=_0x7dfe0a;_0xc0e6a1[_0x7d1b('0x55')]=_['keys'](db[_0x7d1b('0xe3')][_0x7d1b('0x58')]);_0xc0e6a1[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x13305f['query']);_0xc0e6a1['filters']=_[_0x7d1b('0x59')](_0xc0e6a1['model'],_0xc0e6a1[_0x7d1b('0x42')]);_0x48537b['attributes']=_[_0x7d1b('0x59')](_0xc0e6a1[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x13305f['query'][_0x7d1b('0x5a')]));_0x48537b[_0x7d1b('0x47')]=_0x48537b['attributes'][_0x7d1b('0x4a')]?_0x48537b[_0x7d1b('0x47')]:_0xc0e6a1[_0x7d1b('0x55')];_0x48537b[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x13305f[_0x7d1b('0x42')][_0x7d1b('0xcf')]);_0x48537b[_0x7d1b('0x41')]=qs[_0x7d1b('0xcd')](_[_0x7d1b('0xda')](_0x13305f[_0x7d1b('0x42')],_0xc0e6a1[_0x7d1b('0xcd')]));if(_0x13305f[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0x48537b[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x48537b[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x48537b[_0x7d1b('0x47')],function(_0x1d749c){var _0xe8b3eb={};_0xe8b3eb[_0x1d749c]={'$like':'%'+_0x13305f['query'][_0x7d1b('0x2f')]+'%'};return _0xe8b3eb;})});}_0x48537b=_[_0x7d1b('0x5c')]({},_0x48537b,_0x13305f[_0x7d1b('0x5d')]);return _0x4a68db[_0x7d1b('0xe4')](_0x48537b);}})[_0x7d1b('0x14')](function(_0x47be96){if(_0x47be96){_0x284776=_0x47be96['length'];if(!_0x13305f['query'][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x48537b['limit']=qs[_0x7d1b('0x23')](_0x13305f[_0x7d1b('0x42')][_0x7d1b('0x23')]);_0x48537b['offset']=qs[_0x7d1b('0x20')](_0x13305f[_0x7d1b('0x42')][_0x7d1b('0x20')]);}return _0x4a68db[_0x7d1b('0xe4')](_0x48537b);}})['then'](function(_0x5f5925){if(_0x5f5925){return _0x5f5925?{'count':_0x284776,'rows':_0x5f5925}:null;}})['then'](respondWithResult(_0x196321,null))[_0x7d1b('0x1c')](handleError(_0x196321,null));};exports[_0x7d1b('0xe5')]=function(_0x3e18d2,_0x5d2dd5){var _0xaf8a5d={};var _0xe6d27c={};var _0x540778;var _0x4f787f;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x3e18d2[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x5d2dd5,null))[_0x7d1b('0x14')](function(_0x273e97){if(_0x273e97){_0x540778=_0x273e97;_0xe6d27c['model']=_[_0x7d1b('0x57')](db[_0x7d1b('0xe6')]['rawAttributes']);_0xe6d27c[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x3e18d2[_0x7d1b('0x42')]);_0xe6d27c[_0x7d1b('0xcd')]=_[_0x7d1b('0x59')](_0xe6d27c[_0x7d1b('0x55')],_0xe6d27c[_0x7d1b('0x42')]);_0xaf8a5d['attributes']=_[_0x7d1b('0x59')](_0xe6d27c[_0x7d1b('0x55')],qs['fields'](_0x3e18d2[_0x7d1b('0x42')]['fields']));_0xaf8a5d[_0x7d1b('0x47')]=_0xaf8a5d[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0xaf8a5d['attributes']:_0xe6d27c[_0x7d1b('0x55')];_0xaf8a5d[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x3e18d2[_0x7d1b('0x42')]['sort']);_0xaf8a5d[_0x7d1b('0x41')]=qs['filters'](_['pick'](_0x3e18d2[_0x7d1b('0x42')],_0xe6d27c['filters']));if(_0x3e18d2[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0xaf8a5d[_0x7d1b('0x41')]=_['merge'](_0xaf8a5d[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0xaf8a5d[_0x7d1b('0x47')],function(_0xcb1727){var _0x106876={};_0x106876[_0xcb1727]={'$like':'%'+_0x3e18d2[_0x7d1b('0x42')]['filter']+'%'};return _0x106876;})});}_0xaf8a5d=_[_0x7d1b('0x5c')]({},_0xaf8a5d,_0x3e18d2[_0x7d1b('0x5d')]);return _0x540778[_0x7d1b('0xe5')](_0xaf8a5d);}})['then'](function(_0x222ed8){if(_0x222ed8){_0x4f787f=_0x222ed8[_0x7d1b('0x4a')];if(!_0x3e18d2[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0xaf8a5d['limit']=qs[_0x7d1b('0x23')](_0x3e18d2[_0x7d1b('0x42')]['limit']);_0xaf8a5d[_0x7d1b('0x20')]=qs[_0x7d1b('0x20')](_0x3e18d2['query'][_0x7d1b('0x20')]);}return _0x540778['getOpenchannelInteractions'](_0xaf8a5d);}})[_0x7d1b('0x14')](function(_0x1f7b1c){if(_0x1f7b1c){return _0x1f7b1c?{'count':_0x4f787f,'rows':_0x1f7b1c}:null;}})['then'](respondWithResult(_0x5d2dd5,null))[_0x7d1b('0x1c')](handleError(_0x5d2dd5,null));};exports['getMailInteractions']=function(_0x12b839,_0x531a31){var _0x3dd405={'raw':!![],'where':{}};var _0x540732={};var _0x59b7c2={'count':0x0,'rows':[]};return db['User'][_0x7d1b('0xcb')]({'where':{'id':_0x12b839[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x531a31,null))[_0x7d1b('0x14')](function(_0x550dbc){if(_0x550dbc){_0x540732[_0x7d1b('0x55')]=_[_0x7d1b('0x57')](db[_0x7d1b('0xe7')][_0x7d1b('0x58')]);_0x540732[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x12b839[_0x7d1b('0x42')]);_0x540732[_0x7d1b('0xcd')]=_[_0x7d1b('0x59')](_0x540732[_0x7d1b('0x55')],_0x540732['query']);_0x3dd405[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x540732[_0x7d1b('0x55')],qs['fields'](_0x12b839[_0x7d1b('0x42')][_0x7d1b('0x5a')]));_0x3dd405[_0x7d1b('0x47')]=_0x3dd405['attributes'][_0x7d1b('0x4a')]?_0x3dd405[_0x7d1b('0x47')]:_0x540732[_0x7d1b('0x55')];if(!_0x12b839[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x3dd405[_0x7d1b('0x23')]=qs['limit'](_0x12b839['query']['limit']);_0x3dd405[_0x7d1b('0x20')]=qs[_0x7d1b('0x20')](_0x12b839['query'][_0x7d1b('0x20')]);}_0x3dd405[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x12b839[_0x7d1b('0x42')][_0x7d1b('0xcf')]);_0x3dd405[_0x7d1b('0x41')]=qs['filters'](_[_0x7d1b('0xda')](_0x12b839[_0x7d1b('0x42')],_0x540732['filters']));_0x3dd405['where'][_0x7d1b('0xe0')]=_0x550dbc['id'];if(_0x12b839[_0x7d1b('0x42')]['filter']){_0x3dd405[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x3dd405[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x3dd405[_0x7d1b('0x47')],function(_0x3dcb96){var _0x13db06={};_0x13db06[_0x3dcb96]={'$like':'%'+_0x12b839[_0x7d1b('0x42')]['filter']+'%'};return _0x13db06;})});}_0x3dd405=_['merge']({},_0x3dd405,_0x12b839[_0x7d1b('0x5d')]);return db[_0x7d1b('0xe7')][_0x7d1b('0x22')]({'where':_0x3dd405[_0x7d1b('0x41')]})[_0x7d1b('0x14')](function(_0x256604){_0x59b7c2['count']=_0x256604;if(_0x12b839[_0x7d1b('0x42')][_0x7d1b('0x43')]){_0x3dd405[_0x7d1b('0x44')]=[{'all':!![]}];}return db[_0x7d1b('0xe7')]['findAll'](_0x3dd405);})[_0x7d1b('0x14')](function(_0x5decac){_0x59b7c2[_0x7d1b('0x49')]=_0x5decac;return _0x59b7c2;});}})[_0x7d1b('0x14')](respondWithFilteredResult(_0x531a31,_0x3dd405))['catch'](handleError(_0x531a31,null));};exports['getSmsInteractions']=function(_0x3f8e7e,_0x4696ad){var _0x4f9d12={};var _0xfb6dc0={};var _0x370930;var _0x222841;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x3f8e7e[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x4696ad,null))['then'](function(_0x4d2620){if(_0x4d2620){_0x370930=_0x4d2620;_0xfb6dc0[_0x7d1b('0x55')]=_[_0x7d1b('0x57')](db[_0x7d1b('0xe8')][_0x7d1b('0x58')]);_0xfb6dc0[_0x7d1b('0x42')]=_['keys'](_0x3f8e7e[_0x7d1b('0x42')]);_0xfb6dc0['filters']=_[_0x7d1b('0x59')](_0xfb6dc0[_0x7d1b('0x55')],_0xfb6dc0['query']);_0x4f9d12[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0xfb6dc0[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x3f8e7e[_0x7d1b('0x42')][_0x7d1b('0x5a')]));_0x4f9d12[_0x7d1b('0x47')]=_0x4f9d12[_0x7d1b('0x47')]['length']?_0x4f9d12[_0x7d1b('0x47')]:_0xfb6dc0[_0x7d1b('0x55')];_0x4f9d12[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x3f8e7e[_0x7d1b('0x42')]['sort']);_0x4f9d12[_0x7d1b('0x41')]=qs[_0x7d1b('0xcd')](_[_0x7d1b('0xda')](_0x3f8e7e[_0x7d1b('0x42')],_0xfb6dc0[_0x7d1b('0xcd')]));if(_0x3f8e7e[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0x4f9d12['where']=_[_0x7d1b('0x5c')](_0x4f9d12['where'],{'$or':_[_0x7d1b('0x3a')](_0x4f9d12[_0x7d1b('0x47')],function(_0x5cea9c){var _0x3bdb0e={};_0x3bdb0e[_0x5cea9c]={'$like':'%'+_0x3f8e7e['query'][_0x7d1b('0x2f')]+'%'};return _0x3bdb0e;})});}_0x4f9d12=_['merge']({},_0x4f9d12,_0x3f8e7e[_0x7d1b('0x5d')]);return _0x370930[_0x7d1b('0xe9')](_0x4f9d12);}})[_0x7d1b('0x14')](function(_0x3e926d){if(_0x3e926d){_0x222841=_0x3e926d[_0x7d1b('0x4a')];if(!_0x3f8e7e[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x4f9d12[_0x7d1b('0x23')]=qs[_0x7d1b('0x23')](_0x3f8e7e[_0x7d1b('0x42')]['limit']);_0x4f9d12['offset']=qs[_0x7d1b('0x20')](_0x3f8e7e['query'][_0x7d1b('0x20')]);}return _0x370930[_0x7d1b('0xe9')](_0x4f9d12);}})['then'](function(_0x259063){if(_0x259063){return _0x259063?{'count':_0x222841,'rows':_0x259063}:null;}})[_0x7d1b('0x14')](respondWithResult(_0x4696ad,null))[_0x7d1b('0x1c')](handleError(_0x4696ad,null));};exports[_0x7d1b('0xea')]=function(_0x49bca6,_0x136c99){var _0x88830e={};var _0x151dd2={};var _0x372c6e;var _0x24ccf5;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x49bca6[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x136c99,null))[_0x7d1b('0x14')](function(_0x213d45){if(_0x213d45){_0x372c6e=_0x213d45;_0x151dd2['model']=_['keys'](db[_0x7d1b('0xeb')][_0x7d1b('0x58')]);_0x151dd2['query']=_['keys'](_0x49bca6[_0x7d1b('0x42')]);_0x151dd2[_0x7d1b('0xcd')]=_['intersection'](_0x151dd2[_0x7d1b('0x55')],_0x151dd2[_0x7d1b('0x42')]);_0x88830e[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x151dd2['model'],qs[_0x7d1b('0x5a')](_0x49bca6[_0x7d1b('0x42')]['fields']));_0x88830e[_0x7d1b('0x47')]=_0x88830e['attributes']['length']?_0x88830e[_0x7d1b('0x47')]:_0x151dd2[_0x7d1b('0x55')];_0x88830e['order']=qs[_0x7d1b('0xcf')](_0x49bca6[_0x7d1b('0x42')]['sort']);_0x88830e[_0x7d1b('0x41')]=qs['filters'](_[_0x7d1b('0xda')](_0x49bca6[_0x7d1b('0x42')],_0x151dd2[_0x7d1b('0xcd')]));if(_0x49bca6[_0x7d1b('0x42')]['filter']){_0x88830e[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x88830e[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x88830e['attributes'],function(_0x5b34b5){var _0x2cecb9={};_0x2cecb9[_0x5b34b5]={'$like':'%'+_0x49bca6[_0x7d1b('0x42')][_0x7d1b('0x2f')]+'%'};return _0x2cecb9;})});}_0x88830e=_[_0x7d1b('0x5c')]({},_0x88830e,_0x49bca6['options']);return _0x372c6e[_0x7d1b('0xea')](_0x88830e);}})[_0x7d1b('0x14')](function(_0xec5ced){if(_0xec5ced){_0x24ccf5=_0xec5ced[_0x7d1b('0x4a')];if(!_0x49bca6[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x88830e[_0x7d1b('0x23')]=qs[_0x7d1b('0x23')](_0x49bca6['query'][_0x7d1b('0x23')]);_0x88830e['offset']=qs[_0x7d1b('0x20')](_0x49bca6[_0x7d1b('0x42')][_0x7d1b('0x20')]);}return _0x372c6e['getFaxInteractions'](_0x88830e);}})[_0x7d1b('0x14')](function(_0x14449c){if(_0x14449c){return _0x14449c?{'count':_0x24ccf5,'rows':_0x14449c}:null;}})['then'](respondWithResult(_0x136c99,null))[_0x7d1b('0x1c')](handleError(_0x136c99,null));};exports['getWhatsappInteractions']=function(_0x1f4948,_0x404f5e){var _0x2a254e={};var _0x153647={};var _0xb70064;var _0x288e57;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x1f4948[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x404f5e,null))[_0x7d1b('0x14')](function(_0x588c82){if(_0x588c82){_0xb70064=_0x588c82;_0x153647[_0x7d1b('0x55')]=_[_0x7d1b('0x57')](db[_0x7d1b('0xec')][_0x7d1b('0x58')]);_0x153647[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x1f4948[_0x7d1b('0x42')]);_0x153647[_0x7d1b('0xcd')]=_[_0x7d1b('0x59')](_0x153647[_0x7d1b('0x55')],_0x153647[_0x7d1b('0x42')]);_0x2a254e['attributes']=_[_0x7d1b('0x59')](_0x153647['model'],qs[_0x7d1b('0x5a')](_0x1f4948['query'][_0x7d1b('0x5a')]));_0x2a254e['attributes']=_0x2a254e[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0x2a254e[_0x7d1b('0x47')]:_0x153647[_0x7d1b('0x55')];_0x2a254e[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x1f4948[_0x7d1b('0x42')]['sort']);_0x2a254e[_0x7d1b('0x41')]=qs[_0x7d1b('0xcd')](_[_0x7d1b('0xda')](_0x1f4948[_0x7d1b('0x42')],_0x153647['filters']));if(_0x1f4948['query'][_0x7d1b('0x2f')]){_0x2a254e[_0x7d1b('0x41')]=_['merge'](_0x2a254e[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x2a254e[_0x7d1b('0x47')],function(_0x7cab64){var _0x5542db={};_0x5542db[_0x7cab64]={'$like':'%'+_0x1f4948[_0x7d1b('0x42')][_0x7d1b('0x2f')]+'%'};return _0x5542db;})});}_0x2a254e=_['merge']({},_0x2a254e,_0x1f4948[_0x7d1b('0x5d')]);return _0xb70064[_0x7d1b('0xed')](_0x2a254e);}})[_0x7d1b('0x14')](function(_0x41d1e4){if(_0x41d1e4){_0x288e57=_0x41d1e4[_0x7d1b('0x4a')];if(!_0x1f4948[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x2a254e[_0x7d1b('0x23')]=qs[_0x7d1b('0x23')](_0x1f4948[_0x7d1b('0x42')][_0x7d1b('0x23')]);_0x2a254e[_0x7d1b('0x20')]=qs[_0x7d1b('0x20')](_0x1f4948[_0x7d1b('0x42')][_0x7d1b('0x20')]);}return _0xb70064[_0x7d1b('0xed')](_0x2a254e);}})['then'](function(_0xf258fe){if(_0xf258fe){return _0xf258fe?{'count':_0x288e57,'rows':_0xf258fe}:null;}})[_0x7d1b('0x14')](respondWithResult(_0x404f5e,null))['catch'](handleError(_0x404f5e,null));};exports[_0x7d1b('0xee')]=function(_0x332b3b,_0x3063d,_0x4c59a6){var _0x520334;var _0x594e0f;var _0x594ee5;var _0x32bd63=!_['isNil'](_0x332b3b[_0x7d1b('0x60')]['id'])?_0x332b3b['params']['id']:!_[_0x7d1b('0x6a')](_0x332b3b['user']['id'])?_0x332b3b[_0x7d1b('0x2c')]['id']:null;return db[_0x7d1b('0x39')]['find']({'where':{'id':_0x32bd63,'role':{'$or':[_0x7d1b('0x2a'),_0x7d1b('0x2c'),'agent']}},'attributes':['id',_0x7d1b('0x33'),_0x7d1b('0xef'),_0x7d1b('0xf0'),_0x7d1b('0x29'),'internal',_0x7d1b('0x9c')]})[_0x7d1b('0x14')](function(_0x712b0d){if(_0x712b0d){if(_0x712b0d[_0x7d1b('0x29')]===_0x7d1b('0x75')){_0x520334=_0x712b0d;if(_0x332b3b[_0x7d1b('0x5f')][_0x7d1b('0xa9')]){_0x594ee5=util[_0x7d1b('0xaa')](_0x7d1b('0xf1'),_0x520334[_0x332b3b[_0x7d1b('0x5f')][_0x7d1b('0xa9')]]);}else if(_0x332b3b['body'][_0x7d1b('0xf2')]){_0x594ee5=util[_0x7d1b('0xaa')](_0x7d1b('0xab'),_0x332b3b[_0x7d1b('0x5f')][_0x7d1b('0xf2')]);}else{_0x594ee5=util[_0x7d1b('0xaa')]('SIP/%s',_0x520334['name']);}socket['to'](util[_0x7d1b('0xaa')](_0x7d1b('0xf3'),_0x520334['name']))['emit'](_0x7d1b('0xf4'),{'user':{'id':_0x520334['id'],'name':_0x520334['name']},'ip':_0x332b3b[_0x7d1b('0xf5')][_0x7d1b('0xf6')]||_0x332b3b[_0x7d1b('0xf7')][_0x7d1b('0xf8')]||_0x332b3b[_0x7d1b('0xf9')][_0x7d1b('0xf8')]||_0x332b3b[_0x7d1b('0xf7')][_0x7d1b('0xf9')][_0x7d1b('0xf8')]});return db[_0x7d1b('0xad')][_0x7d1b('0x27')]({'where':{'membername':_0x520334[_0x7d1b('0x33')]},'individualHooks':!![]});}}else{throw new db[(_0x7d1b('0x91'))][(_0x7d1b('0x92'))](_0x7d1b('0xfa'));}})['then'](function(){if(_0x520334){return _0x520334['getVoiceQueues']({'raw':!![]});}})[_0x7d1b('0x14')](function(_0xe91fc5){if(_0x520334){if(_0xe91fc5){_0x594e0f=_0xe91fc5;if(_0x594e0f[_0x7d1b('0x4a')]){var _0x298ac6=_0x594e0f[_0x7d1b('0x3a')](function(_0x2d9064){var _0xe767a5={'membername':_0x520334[_0x7d1b('0x33')],'UserId':_0x520334['id'],'queue_name':_0x2d9064[_0x7d1b('0x33')],'VoiceQueueId':_0x2d9064['id'],'interface':_0x594ee5,'paused':_0x520334['loginInPause']||![],'penalty':_0x2d9064[_0x7d1b('0xfb')]||0x0};return db['UserVoiceQueueRt'][_0x7d1b('0xae')](_0xe767a5);});return Promise[_0x7d1b('0x53')](_0x298ac6);}}}})[_0x7d1b('0x14')](function(){if(_0x520334){return db[_0x7d1b('0xfc')][_0x7d1b('0x48')]({'where':{'membername':_0x520334[_0x7d1b('0x33')],'exitAt':null}});}})[_0x7d1b('0x14')](function(_0x14391e){if(_0x520334){var _0x13d80c=[];_0x14391e[_0x7d1b('0xfd')](function(_0x6f4dbd){_0x13d80c[_0x7d1b('0x4b')](_0x6f4dbd['update']({'exitAt':moment()[_0x7d1b('0xaa')](_0x7d1b('0xfe'))}));});return Promise[_0x7d1b('0x53')](_0x13d80c);}})[_0x7d1b('0x14')](function(){if(_0x520334){var _0x3b1711=[];var _0xaf5bec=[];var _0x4ffb4c=utils[_0x7d1b('0xff')]();var _0x5ab95b={'membername':_0x520334['name'],'interface':_0x594ee5,'enterAt':moment()[_0x7d1b('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x520334[_0x7d1b('0x29')],'internal':_0x520334['internal']};_0x4ffb4c[_0x7d1b('0xfd')](function(_0xa0ed59){_0x3b1711['push'](_[_0x7d1b('0x5c')]({'channel':_0xa0ed59,'type':_0x7d1b('0x100'),'data1':_0x332b3b[_0x7d1b('0x5f')][_0x7d1b('0x101')],'data2':_0x594ee5},_0x5ab95b));if(_0x520334[_0x7d1b('0x9c')]){_0xaf5bec[_0x7d1b('0x4b')](_[_0x7d1b('0x5c')]({'channel':_0xa0ed59,'type':_0x7d1b('0x102'),'data1':_0x7d1b('0x103')},_0x5ab95b));}});return db[_0x7d1b('0xfc')][_0x7d1b('0x8b')](_0x3b1711['concat'](_0xaf5bec),{'individualHooks':!![]});}})[_0x7d1b('0x14')](function(){if(_0x520334){return _0x520334[_0x7d1b('0x25')]({'online':!![],'lastLoginAt':moment()[_0x7d1b('0xaa')](_0x7d1b('0xfe')),'voicePause':_0x520334[_0x7d1b('0x9c')]||![],'mailPause':_0x520334['loginInPause']||![],'chatPause':_0x520334[_0x7d1b('0x9c')]||![],'faxPause':_0x520334[_0x7d1b('0x9c')]||![],'smsPause':_0x520334[_0x7d1b('0x9c')]||![],'openchannelPause':_0x520334['loginInPause']||![],'whatsappPause':_0x520334[_0x7d1b('0x9c')]||![],'pauseType':_0x520334[_0x7d1b('0x9c')]?_0x7d1b('0x103'):null,'interface':_0x594ee5,'lastPauseAt':moment()[_0x7d1b('0xaa')](_0x7d1b('0xfe'))});}})[_0x7d1b('0x14')](function(_0x278247){if(_0x332b3b[_0x7d1b('0x104')]){return _0x4c59a6();}else{return Promise[_0x7d1b('0x105')](_0x278247)['then'](respondWithResult(_0x3063d,null));}})[_0x7d1b('0x1c')](handleError(_0x3063d,null));};exports[_0x7d1b('0x106')]=function(_0x1ffa7a,_0x2c5f70){var _0x4635a4;return db[_0x7d1b('0x39')][_0x7d1b('0x32')]({'where':{'id':_0x1ffa7a[_0x7d1b('0x60')]['id'],'role':_0x7d1b('0x75')},'attributes':['id',_0x7d1b('0x33'),_0x7d1b('0x29')]})[_0x7d1b('0x14')](handleEntityNotFound(_0x2c5f70,null))[_0x7d1b('0x14')](function(_0x1e76aa){if(_0x1e76aa){_0x4635a4=_0x1e76aa;return db[_0x7d1b('0xad')][_0x7d1b('0x27')]({'where':{'membername':_0x4635a4[_0x7d1b('0x33')]},'individualHooks':!![]});}})[_0x7d1b('0x14')](function(){return db[_0x7d1b('0xfc')][_0x7d1b('0x48')]({'where':{'membername':_0x4635a4[_0x7d1b('0x33')],'exitAt':null}});})['then'](function(_0x2e9ca1){var _0x19a505=[];_0x2e9ca1['forEach'](function(_0x23fb14){_0x19a505[_0x7d1b('0x4b')](_0x23fb14[_0x7d1b('0x25')]({'exitAt':moment()[_0x7d1b('0xaa')](_0x7d1b('0xfe'))}));});return Promise[_0x7d1b('0x53')](_0x19a505);})[_0x7d1b('0x14')](function(){return _0x4635a4[_0x7d1b('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x2c5f70,null))['catch'](handleError(_0x2c5f70,null));};exports[_0x7d1b('0x107')]=function(_0x592eae,_0x361bbb){var _0x38876b;return db[_0x7d1b('0xad')][_0x7d1b('0x25')]({'paused':0x1},{'where':{'UserId':_0x592eae[_0x7d1b('0x60')]['id']},'individualHooks':!![]})[_0x7d1b('0x14')](function(){return db[_0x7d1b('0x39')][_0x7d1b('0x32')]({'where':{'id':_0x592eae[_0x7d1b('0x60')]['id'],'role':'agent'},'attributes':['id',_0x7d1b('0x33'),_0x7d1b('0x29'),_0x7d1b('0x65'),_0x7d1b('0xa9'),_0x7d1b('0xa8')]});})[_0x7d1b('0x14')](handleEntityNotFound(_0x361bbb,null))[_0x7d1b('0x14')](function(_0x40912a){if(_0x40912a){_0x38876b=_0x40912a;return respondWithRpcPromise('QueuePause',_0x7d1b('0x107'),{'id':_0x38876b['id'],'name':_0x38876b[_0x7d1b('0x33')],'pause':!![]});}})[_0x7d1b('0x14')](function(){if(_0x38876b){return db[_0x7d1b('0xfc')]['findAll']({'where':{'membername':_0x38876b['name'],'type':_0x7d1b('0x102'),'exitAt':null}});}})[_0x7d1b('0x14')](function(_0x4aeba6){if(_0x4aeba6[_0x7d1b('0x4a')]){var _0x5858a5=moment()['format'](_0x7d1b('0xfe'));for(var _0x5ca59e=0x0,_0x5cdd05=_0x4aeba6[_0x7d1b('0x4a')];_0x5ca59e<_0x5cdd05;_0x5ca59e++){_0x4aeba6[_0x5ca59e][_0x7d1b('0x108')]({'exitAt':_0x5858a5});}}})[_0x7d1b('0x14')](function(){var _0x1827b3=[];var _0x137653=utils[_0x7d1b('0xff')]();_0x137653['forEach'](function(_0x4d0457){_0x1827b3[_0x7d1b('0x4b')]({'channel':_0x4d0457,'membername':_0x38876b[_0x7d1b('0x33')],'interface':_[_0x7d1b('0x6a')](_0x38876b['interface'])?util[_0x7d1b('0xaa')](_0x7d1b('0xab'),_0x38876b[_0x7d1b('0x33')]):_0x38876b[_0x7d1b('0xa9')],'type':_0x7d1b('0x102'),'enterAt':moment()[_0x7d1b('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x592eae[_0x7d1b('0x5f')]['type']||_0x7d1b('0x109'),'role':_0x38876b[_0x7d1b('0x29')],'internal':_0x38876b['internal']});});return db[_0x7d1b('0xfc')][_0x7d1b('0x8b')](_0x1827b3,{'individualHooks':!![]});})[_0x7d1b('0x14')](function(){return _0x38876b['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x592eae[_0x7d1b('0x5f')][_0x7d1b('0x3c')]||_0x7d1b('0x109'),'lastPauseAt':moment()[_0x7d1b('0xaa')](_0x7d1b('0xfe'))});})[_0x7d1b('0x14')](respondWithResult(_0x361bbb,null))['catch'](handleError(_0x361bbb,null));};exports[_0x7d1b('0x10a')]=function(_0x398741,_0x5935c7){if(_0x398741[_0x7d1b('0x5f')]['channel']&&!utils[_0x7d1b('0x9d')](_0x398741[_0x7d1b('0x5f')][_0x7d1b('0xb0')])){throw new APIBadRequestError(util['format'](_0x7d1b('0x10b'),_0x398741['body'][_0x7d1b('0xb0')]));}return db['User'][_0x7d1b('0x32')]({'where':{'id':_0x398741[_0x7d1b('0x60')]['id']},'attributes':['id',_0x7d1b('0x33'),_0x7d1b('0x29'),_0x7d1b('0x65'),'interface',_0x7d1b('0xa8'),_0x7d1b('0xac'),_0x7d1b('0x10c'),_0x7d1b('0x10d'),'faxPause','openchannelPause','smsPause','whatsappPause',_0x7d1b('0x10e'),_0x7d1b('0x10f')]})[_0x7d1b('0x14')](function(_0x109d28){if(!_0x109d28){throw new APINotFoundError(util[_0x7d1b('0xaa')](_0x7d1b('0x110'),_0x398741[_0x7d1b('0x60')]['id']));}return _0x109d28['unpause'](_0x398741['body'][_0x7d1b('0xb0')]);})[_0x7d1b('0x14')](respondWithResult(_0x5935c7,null))[_0x7d1b('0x1c')](APIHandleError(_0x5935c7));};exports[_0x7d1b('0x111')]=function(_0x8bdccb,_0x3af345){var _0x57d86a={};var _0x227e89={};var _0x5db131;var _0x234c98;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x8bdccb[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x3af345,null))['then'](function(_0x47e7a8){if(_0x47e7a8){_0x5db131=_0x47e7a8;_0x227e89[_0x7d1b('0x55')]=_[_0x7d1b('0x57')](db[_0x7d1b('0x112')][_0x7d1b('0x58')]);_0x227e89[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x8bdccb[_0x7d1b('0x42')]);_0x227e89['filters']=_[_0x7d1b('0x59')](_0x227e89[_0x7d1b('0x55')],_0x227e89['query']);_0x57d86a[_0x7d1b('0x47')]=_[_0x7d1b('0x59')](_0x227e89[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x8bdccb['query'][_0x7d1b('0x5a')]));_0x57d86a[_0x7d1b('0x47')]=_0x57d86a[_0x7d1b('0x47')][_0x7d1b('0x4a')]?_0x57d86a[_0x7d1b('0x47')]:_0x227e89[_0x7d1b('0x55')];_0x57d86a[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x8bdccb[_0x7d1b('0x42')][_0x7d1b('0xcf')]);_0x57d86a[_0x7d1b('0x41')]=qs['filters'](_[_0x7d1b('0xda')](_0x8bdccb[_0x7d1b('0x42')],_0x227e89[_0x7d1b('0xcd')]));if(_0x8bdccb[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0x57d86a[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x57d86a[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x57d86a[_0x7d1b('0x47')],function(_0x391ef1){var _0x34061e={};_0x34061e[_0x391ef1]={'$like':'%'+_0x8bdccb[_0x7d1b('0x42')]['filter']+'%'};return _0x34061e;})});}_0x57d86a=_[_0x7d1b('0x5c')]({},_0x57d86a,_0x8bdccb[_0x7d1b('0x5d')]);return _0x5db131[_0x7d1b('0x111')](_0x57d86a);}})[_0x7d1b('0x14')](function(_0xde9561){if(_0xde9561){_0x234c98=_0xde9561[_0x7d1b('0x4a')];if(!_0x8bdccb[_0x7d1b('0x42')]['hasOwnProperty']('nolimit')){_0x57d86a[_0x7d1b('0x23')]=qs[_0x7d1b('0x23')](_0x8bdccb['query'][_0x7d1b('0x23')]);_0x57d86a['offset']=qs[_0x7d1b('0x20')](_0x8bdccb[_0x7d1b('0x42')]['offset']);}return _0x5db131['getTeams'](_0x57d86a);}})[_0x7d1b('0x14')](function(_0x3fc5d8){if(_0x3fc5d8){return _0x3fc5d8?{'count':_0x234c98,'rows':_0x3fc5d8}:null;}})[_0x7d1b('0x14')](respondWithResult(_0x3af345,null))[_0x7d1b('0x1c')](handleError(_0x3af345,null));};exports[_0x7d1b('0x113')]=function(_0x2a906f,_0x10080e){var _0x81dbae=_0x2a906f[_0x7d1b('0x60')]['id'];var _0x107057=_0x2a906f['body']?_0x2a906f[_0x7d1b('0x5f')][_0x7d1b('0x64')]:null;var _0x4736c2=[];return Promise[_0x7d1b('0x105')]()[_0x7d1b('0x14')](function(){if(!_0x107057)throw new APIBadRequestError(_0x7d1b('0x114'));})['then'](function(){return db['User'][_0x7d1b('0xcb')]({'where':{'id':_0x81dbae}});})[_0x7d1b('0x14')](function(_0x2b421c){if(!_0x2b421c)throw new APINotFoundError(util[_0x7d1b('0xaa')](_0x7d1b('0x110'),_0x2a906f[_0x7d1b('0x60')]['id']));return db[_0x7d1b('0x6d')]['transaction'](function(_0x1615d7){return _0x2b421c[_0x7d1b('0x113')](_0x107057,{'transaction':_0x1615d7})[_0x7d1b('0x14')](function(){return db[_0x7d1b('0x112')][_0x7d1b('0x48')]({'where':{'id':{'$in':_0x107057}}});})[_0x7d1b('0x14')](function(_0x2bd619){var _0x282972=_[_0x7d1b('0x3a')](_0x2bd619,function(_0x12c3e7){return _0x12c3e7['getAssociatedQueues']();});return Promise[_0x7d1b('0x53')](_0x282972);})[_0x7d1b('0x14')](function(_0x596f10){_0x4736c2=_['flattenDeep'](_0x596f10);var _0x4e5094=_['map'](_0x4736c2,function(_0xd7e81){return _0xd7e81['addAgent'](_0x2b421c['id'],{'transaction':_0x1615d7});});return Promise[_0x7d1b('0x53')](_0x4e5094);})['then'](function(){if(!_0x2b421c[_0x7d1b('0xa8')])return;var _0x51eb77=_[_0x7d1b('0x2f')](_0x4736c2,function(_0xe0ee9a){return _0xe0ee9a[_0x7d1b('0x115')]('channel')===_0x7d1b('0x116');});var _0x558c4e=_[_0x7d1b('0x3a')](_0x51eb77,function(_0x263186){return db[_0x7d1b('0xad')][_0x7d1b('0xae')]({'membername':_0x2b421c['name'],'UserId':_0x2b421c['id'],'queue_name':_0x263186[_0x7d1b('0x33')],'VoiceQueueId':_0x263186['id'],'interface':_[_0x7d1b('0x6a')](_0x2b421c[_0x7d1b('0xa9')])?util[_0x7d1b('0xaa')]('SIP/%s',_0x2b421c[_0x7d1b('0x33')]):_0x2b421c['interface'],'paused':_0x2b421c[_0x7d1b('0xac')]||![],'penalty':_0x2b421c[_0x7d1b('0xa2')]},{'transaction':_0x1615d7});});return Promise[_0x7d1b('0x53')](_0x558c4e);})[_0x7d1b('0x14')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x107057}}});})[_0x7d1b('0x14')](function(_0x3bff3d){var _0x36abed=_['map'](_0x3bff3d,function(_0x549f37){return db[_0x7d1b('0x117')][_0x7d1b('0x85')]({'UserId':_0x2b421c['id'],'VoicePrefixId':_0x549f37[_0x7d1b('0x118')]},{'transaction':_0x1615d7});});return Promise['all'](_0x36abed);});});})[_0x7d1b('0x14')](function(){for(var _0x130eec=0x0;_0x130eec<_0x4736c2[_0x7d1b('0x4a')];_0x130eec++){var _0x24a95d=_0x4736c2[_0x130eec][_0x7d1b('0x115')](_0x7d1b('0xb0'));var _0x20a38b=_0x24a95d+_0x7d1b('0xa3');socket[_0x7d1b('0xa4')](_0x7d1b('0x2c')+_0x24a95d+'Queue:save',{'UserId':_0x81dbae,['queueField']:_0x4736c2[_0x130eec]['id']});}})[_0x7d1b('0x14')](respondWithStatusCode(_0x10080e,null))[_0x7d1b('0x1c')](APIHandleError(_0x10080e));};exports[_0x7d1b('0x119')]=function(_0x37b2aa,_0xf19edb){var _0x2f282b=_0x37b2aa[_0x7d1b('0x60')]['id'];var _0x57b083=null;if(_0x37b2aa[_0x7d1b('0x42')][_0x7d1b('0x64')]){_0x57b083=_[_0x7d1b('0xb2')](_0x37b2aa['query'][_0x7d1b('0x64')])?_0x37b2aa[_0x7d1b('0x42')][_0x7d1b('0x64')]:[_0x37b2aa[_0x7d1b('0x42')][_0x7d1b('0x64')]];}var _0x347f4e=[];return Promise[_0x7d1b('0x105')]()['then'](function(){if(!_0x57b083)throw new APIBadRequestError(_0x7d1b('0x11a'));})[_0x7d1b('0x14')](function(){return db[_0x7d1b('0x39')]['findOne']({'where':{'id':_0x2f282b}});})[_0x7d1b('0x14')](function(_0x377a85){if(!_0x377a85)throw new APINotFoundError(util[_0x7d1b('0xaa')]('User\x20with\x20id\x20%s\x20not\x20found',_0x37b2aa[_0x7d1b('0x60')]['id']));return db['sequelize'][_0x7d1b('0x11b')](function(_0x35d031){return _0x377a85[_0x7d1b('0x119')](_0x57b083,{'transaction':_0x35d031})[_0x7d1b('0x14')](function(){return db[_0x7d1b('0x112')][_0x7d1b('0x48')]({'where':{'id':{'$in':_0x57b083}}});})[_0x7d1b('0x14')](function(_0x2f9636){var _0xf0d119=_[_0x7d1b('0x3a')](_0x2f9636,function(_0x31a85e){return _0x31a85e[_0x7d1b('0x11c')]();});return Promise[_0x7d1b('0x53')](_0xf0d119);})[_0x7d1b('0x14')](function(_0x466701){_0x347f4e=_['flattenDeep'](_0x466701);var _0x1133da=_[_0x7d1b('0x3a')](_0x347f4e,function(_0x3f1fd0){return _0x3f1fd0[_0x7d1b('0x11d')](_0x377a85['id'],{'transaction':_0x35d031});});return Promise[_0x7d1b('0x53')](_0x1133da);})[_0x7d1b('0x14')](function(){if(!_0x377a85['online'])return;var _0x418d3a=_[_0x7d1b('0x2f')](_0x347f4e,function(_0xbf9460){return _0xbf9460[_0x7d1b('0x115')]('channel')==='Voice';});var _0x2014e1=_[_0x7d1b('0x3a')](_0x418d3a,function(_0x2b5d74){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2b5d74['id'],'UserId':_0x377a85['id']},'transaction':_0x35d031});});return Promise[_0x7d1b('0x53')](_0x2014e1);})['then'](function(){return db[_0x7d1b('0x11e')][_0x7d1b('0x48')]({'where':{'teamId':{'$in':_0x57b083}}});})[_0x7d1b('0x14')](function(_0x4443a1){var _0x59b9cb=_[_0x7d1b('0x3a')](_0x4443a1,function(_0xe432e2){return db[_0x7d1b('0x117')][_0x7d1b('0x27')]({'where':{'UserId':_0x377a85['id'],'VoicePrefixId':_0xe432e2['VoicePrefixId']}},{'transaction':_0x35d031});});return Promise['all'](_0x59b9cb);});});})['then'](function(){for(var _0x1de863=0x0;_0x1de863<_0x347f4e[_0x7d1b('0x4a')];_0x1de863++){var _0x4648d2=_0x347f4e[_0x1de863][_0x7d1b('0x115')](_0x7d1b('0xb0'));var _0x29519c=_0x4648d2+_0x7d1b('0xa3');socket[_0x7d1b('0xa4')]('user'+_0x4648d2+'Queue:remove',{'UserId':_0x2f282b,['queueField']:_0x347f4e[_0x1de863]['id']});}})[_0x7d1b('0x14')](respondWithStatusCode(_0xf19edb,null))[_0x7d1b('0x1c')](APIHandleError(_0xf19edb));};exports[_0x7d1b('0x11f')]=function(_0x9891d6,_0x480baa){var _0x4944ff={};var _0xec5dfa={};var _0x422caf;var _0x70fb3a;return db[_0x7d1b('0x39')]['findOne']({'where':{'id':_0x9891d6[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x480baa,null))[_0x7d1b('0x14')](function(_0xd04f2c){if(_0xd04f2c){_0x422caf=_0xd04f2c;_0xec5dfa[_0x7d1b('0x55')]=_[_0x7d1b('0x57')](db['CmList'][_0x7d1b('0x58')]);_0xec5dfa[_0x7d1b('0x42')]=_[_0x7d1b('0x57')](_0x9891d6[_0x7d1b('0x42')]);_0xec5dfa[_0x7d1b('0xcd')]=_[_0x7d1b('0x59')](_0xec5dfa[_0x7d1b('0x55')],_0xec5dfa[_0x7d1b('0x42')]);_0x4944ff['attributes']=_[_0x7d1b('0x59')](_0xec5dfa[_0x7d1b('0x55')],qs[_0x7d1b('0x5a')](_0x9891d6[_0x7d1b('0x42')][_0x7d1b('0x5a')]));_0x4944ff[_0x7d1b('0x47')]=_0x4944ff[_0x7d1b('0x47')]['length']?_0x4944ff[_0x7d1b('0x47')]:_0xec5dfa[_0x7d1b('0x55')];_0x4944ff[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x9891d6[_0x7d1b('0x42')]['sort']);_0x4944ff['where']=qs[_0x7d1b('0xcd')](_[_0x7d1b('0xda')](_0x9891d6[_0x7d1b('0x42')],_0xec5dfa[_0x7d1b('0xcd')]));if(_0x9891d6['query'][_0x7d1b('0x2f')]){_0x4944ff[_0x7d1b('0x41')]=_['merge'](_0x4944ff[_0x7d1b('0x41')],{'$or':_['map'](_0x4944ff['attributes'],function(_0x4459e4){var _0x18e55b={};_0x18e55b[_0x4459e4]={'$like':'%'+_0x9891d6['query'][_0x7d1b('0x2f')]+'%'};return _0x18e55b;})});}_0x4944ff=_[_0x7d1b('0x5c')]({},_0x4944ff,_0x9891d6['options']);return _0x422caf[_0x7d1b('0x11f')](_0x4944ff);}})['then'](function(_0x350420){if(_0x350420){_0x70fb3a=_0x350420[_0x7d1b('0x4a')];if(!_0x9891d6[_0x7d1b('0x42')][_0x7d1b('0xd0')](_0x7d1b('0xd5'))){_0x4944ff[_0x7d1b('0x23')]=qs[_0x7d1b('0x23')](_0x9891d6[_0x7d1b('0x42')]['limit']);_0x4944ff[_0x7d1b('0x20')]=qs[_0x7d1b('0x20')](_0x9891d6[_0x7d1b('0x42')][_0x7d1b('0x20')]);}return _0x422caf['getLists'](_0x4944ff);}})[_0x7d1b('0x14')](function(_0x536634){if(_0x536634){return _0x536634?{'count':_0x70fb3a,'rows':_0x536634}:null;}})[_0x7d1b('0x14')](respondWithResult(_0x480baa,null))[_0x7d1b('0x1c')](handleError(_0x480baa,null));};exports[_0x7d1b('0x120')]=function(_0x3fda50,_0x202c79){var _0x24abdc={};var _0x134ff6={};var _0x2886bc;return db[_0x7d1b('0x39')][_0x7d1b('0xcb')]({'where':{'id':_0x3fda50[_0x7d1b('0x60')]['id']}})[_0x7d1b('0x14')](handleEntityNotFound(_0x202c79,null))[_0x7d1b('0x14')](function(_0x2786af){if(_0x2786af){_0x2886bc=_0x2786af;_0x134ff6['model']=_[_0x7d1b('0x57')](db[_0x7d1b('0x39')]['rawAttributes']);_0x134ff6[_0x7d1b('0x42')]=_['keys'](_0x3fda50[_0x7d1b('0x42')]);_0x134ff6['filters']=_[_0x7d1b('0x59')](_0x134ff6[_0x7d1b('0x55')],_0x134ff6[_0x7d1b('0x42')]);_0x24abdc[_0x7d1b('0x47')]=_['intersection'](_0x134ff6['model'],qs[_0x7d1b('0x5a')](_0x3fda50['query'][_0x7d1b('0x5a')]));_0x24abdc[_0x7d1b('0x47')]=_0x24abdc[_0x7d1b('0x47')]['length']?_0x24abdc[_0x7d1b('0x47')]:_0x134ff6['model'];_0x24abdc[_0x7d1b('0xce')]=qs[_0x7d1b('0xcf')](_0x3fda50['query'][_0x7d1b('0xcf')]);_0x24abdc[_0x7d1b('0x41')]=qs['filters'](_[_0x7d1b('0xda')](_0x3fda50[_0x7d1b('0x42')],_0x134ff6[_0x7d1b('0xcd')]));if(_0x3fda50[_0x7d1b('0x42')][_0x7d1b('0x2f')]){_0x24abdc[_0x7d1b('0x41')]=_[_0x7d1b('0x5c')](_0x24abdc[_0x7d1b('0x41')],{'$or':_[_0x7d1b('0x3a')](_0x24abdc[_0x7d1b('0x47')],function(_0x169818){var _0x40cb9f={};_0x40cb9f[_0x169818]={'$like':'%'+_0x3fda50['query'][_0x7d1b('0x2f')]+'%'};return _0x40cb9f;})});}_0x24abdc[_0x7d1b('0x55')]=db[_0x7d1b('0x39')];_0x24abdc['as']=_0x7d1b('0x2d');_0x24abdc=_[_0x7d1b('0x5c')]({},_0x24abdc,_0x3fda50['options']);return _0x2886bc[_0x7d1b('0x121')]({'include':[_0x24abdc]});}})['then'](function(_0xf40678){if(_0xf40678){var _0x29bfd0={},_0x5c886b=[];for(var _0x271074=0x0;_0x271074<_0xf40678[_0x7d1b('0x4a')];_0x271074+=0x1){for(var _0x1c3c1b=0x0,_0xd0cbca;_0x1c3c1b<_0xf40678[_0x271074][_0x7d1b('0x2d')]['length'];_0x1c3c1b+=0x1){_0xd0cbca=_0xf40678[_0x271074][_0x7d1b('0x2d')][_0x1c3c1b][_0x7d1b('0x28')]({'plain':!![]});_0x29bfd0[_0xd0cbca['id']]=_0xd0cbca;}}_0x29bfd0=_['values'](_0x29bfd0);for(var _0x3cc8ab=qs[_0x7d1b('0x20')](_0x3fda50[_0x7d1b('0x42')][_0x7d1b('0x20')]);_0x3cc8ab<_0x29bfd0[_0x7d1b('0x4a')]&&_0x5c886b[_0x7d1b('0x4a')]=_0x1454fe[_0x710e('0x51')]){throw new Error(_0x710e('0x52'));}})[_0x710e('0x18')](function(){if(_0x54b289){return db[_0x710e('0x27')][_0x710e('0x49')]({'where':{'membername':_0x54b289[_0x710e('0x24')]},'individualHooks':!![]});}})[_0x710e('0x18')](function(){if(_0x54b289){return _0x54b289[_0x710e('0x53')]({'raw':!![]});}})[_0x710e('0x18')](function(_0x118c00){if(_0x54b289){if(_0x118c00){var _0x7532d7=[];_0x34a67c=_0x118c00;if(_0x34a67c[_0x710e('0x2a')]){for(var _0x2ef71e=0x0;_0x2ef71e<_0x34a67c[_0x710e('0x2a')];_0x2ef71e++){_0x7532d7['push'](db[_0x710e('0x27')][_0x710e('0x54')]({'membername':_0x54b289[_0x710e('0x24')],'UserId':_0x54b289['id'],'queue_name':_0x34a67c[_0x2ef71e][_0x710e('0x24')],'VoiceQueueId':_0x34a67c[_0x2ef71e]['id'],'interface':_0x5e9ec6,'paused':_0x54b289[_0x710e('0x4c')]||![],'penalty':_0x34a67c[_0x2ef71e][_0x710e('0x55')]||0x0}));}return BPromise[_0x710e('0x4a')](_0x7532d7);}}}})[_0x710e('0x18')](function(){if(_0x54b289){return db[_0x710e('0x28')][_0x710e('0x10')]({'where':{'membername':_0x54b289[_0x710e('0x24')],'exitAt':null}});}})['then'](function(_0x54f566){if(_0x54b289){if(_0x54f566&&_0x54f566[_0x710e('0x2a')]){var _0x5711d2=[];_0x54f566[_0x710e('0x2e')](function(_0x29d66b){_0x5711d2[_0x710e('0x2f')](_0x29d66b[_0x710e('0x37')]({'exitAt':moment()[_0x710e('0x2b')](_0x710e('0x2c'))}));});return BPromise[_0x710e('0x4a')](_0x5711d2);}}})[_0x710e('0x18')](function(){if(_0x54b289){var _0x387639=[];var _0x341d67=[];var _0x470a74=utils[_0x710e('0x56')]();var _0x4b9733={'membername':_0x54b289[_0x710e('0x24')],'interface':_0x5e9ec6,'enterAt':moment()['format'](_0x710e('0x2c')),'role':_0x54b289['role'],'internal':_0x54b289[_0x710e('0x25')]};_0x470a74[_0x710e('0x2e')](function(_0x475bd2){_0x387639[_0x710e('0x2f')](_[_0x710e('0x57')]({'channel':_0x475bd2,'type':'LOGIN','data1':_0x710e('0x58'),'data2':_0x5e9ec6},_0x4b9733));if(_0x54b289['loginInPause']){_0x341d67[_0x710e('0x2f')](_['merge']({'channel':_0x475bd2,'type':_0x710e('0x29'),'data1':_0x710e('0x59')},_0x4b9733));}});return db[_0x710e('0x28')][_0x710e('0x36')](_0x387639[_0x710e('0x5a')](_0x341d67),{'individualHooks':!![]});}})[_0x710e('0x18')](function(){if(_0x54b289){return _0x54b289[_0x710e('0x37')]({'online':!![],'lastLoginAt':moment()[_0x710e('0x2b')](_0x710e('0x2c')),'voicePause':_0x54b289[_0x710e('0x4c')]||![],'mailPause':_0x54b289[_0x710e('0x4c')]||![],'chatPause':_0x54b289[_0x710e('0x4c')]||![],'faxPause':_0x54b289['loginInPause']||![],'smsPause':_0x54b289[_0x710e('0x4c')]||![],'openchannelPause':_0x54b289[_0x710e('0x4c')]||![],'pauseType':_0x54b289[_0x710e('0x4c')]?_0x710e('0x59'):null,'lastPauseAt':moment()[_0x710e('0x2b')](_0x710e('0x2c')),'interface':_0x5e9ec6});}})[_0x710e('0x18')](function(_0x1c8b98){_0x458715(_0x1c8b98);})['catch'](function(_0x2dbeee){_0x1e326b(_0x5eb0ce[_0x710e('0x1e')](0x1f4,_0x2dbeee[_0x710e('0x1f')]));});});}; \ No newline at end of file +var _0x3008=['forEach','push','SIP/%s','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','type','UnpauseUser','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','params','LogoutUser','destroy','all','LoginUser','mobile','phone','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','loginInPause','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','../../config/utils','../../config/logger','defaults','redis','./user.socket','register','GetUser','User','findAll','options','where','attributes','limit','include','map','model','debug','stringify','catch','message','find','raw','then','info','ShowUser','error','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3008,0x11f));var _0x8300=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0x3008[_0x3dea7d];return _0x53919a;};'use strict';var _=require(_0x8300('0x0'));var util=require(_0x8300('0x1'));var moment=require(_0x8300('0x2'));var BPromise=require('bluebird');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8300('0x3'));var logger=require(_0x8300('0x4'))('rpc');var config=require('../../config/environment');config['redis']=_[_0x8300('0x5')](config[_0x8300('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8300('0x7'))[_0x8300('0x8')](socket);exports[_0x8300('0x9')]=function(_0x5f9c78){var _0x28c95e=this;return new Promise(function(_0x4ab608,_0xfcf294){return db[_0x8300('0xa')][_0x8300('0xb')]({'raw':_0x5f9c78[_0x8300('0xc')]?_0x5f9c78[_0x8300('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x5f9c78['options']?_0x5f9c78['options'][_0x8300('0xd')]||null:null,'attributes':_0x5f9c78[_0x8300('0xc')]?_0x5f9c78['options'][_0x8300('0xe')]||null:null,'limit':_0x5f9c78[_0x8300('0xc')]?_0x5f9c78[_0x8300('0xc')][_0x8300('0xf')]||null:null,'include':_0x5f9c78[_0x8300('0xc')]?_0x5f9c78[_0x8300('0xc')][_0x8300('0x10')]?_[_0x8300('0x11')](_0x5f9c78[_0x8300('0xc')]['include'],function(_0x3e8c07){return{'model':db[_0x3e8c07['model']],'as':_0x3e8c07['as'],'attributes':_0x3e8c07[_0x8300('0xe')],'include':_0x3e8c07[_0x8300('0x10')]?_[_0x8300('0x11')](_0x3e8c07[_0x8300('0x10')],function(_0x3b390a){return{'model':db[_0x3b390a[_0x8300('0x12')]],'as':_0x3b390a['as'],'attributes':_0x3b390a[_0x8300('0xe')],'include':_0x3b390a[_0x8300('0x10')]?_[_0x8300('0x11')](_0x3b390a[_0x8300('0x10')],function(_0x3cfc44){return{'model':db[_0x3cfc44[_0x8300('0x12')]],'as':_0x3cfc44['as'],'attributes':_0x3cfc44['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ef222){logger['info'](_0x8300('0x9'),_0x5f9c78);logger[_0x8300('0x13')](_0x8300('0x9'),_0x5f9c78,JSON[_0x8300('0x14')](_0x3ef222));_0x4ab608(_0x3ef222);})[_0x8300('0x15')](function(_0x113cf6){logger['error'](_0x8300('0x9'),_0x113cf6[_0x8300('0x16')],_0x5f9c78);_0xfcf294(_0x28c95e['error'](0x1f4,_0x113cf6['message']));});});};exports['ShowUser']=function(_0x4f005b){var _0x122954=this;return new Promise(function(_0x374476,_0x36918c){return db['User'][_0x8300('0x17')]({'raw':_0x4f005b[_0x8300('0xc')]?_0x4f005b[_0x8300('0xc')][_0x8300('0x18')]===undefined?!![]:![]:!![],'where':_0x4f005b[_0x8300('0xc')]?_0x4f005b['options'][_0x8300('0xd')]||null:null,'attributes':_0x4f005b[_0x8300('0xc')]?_0x4f005b[_0x8300('0xc')][_0x8300('0xe')]||null:null,'include':_0x4f005b[_0x8300('0xc')]?_0x4f005b[_0x8300('0xc')]['include']?_[_0x8300('0x11')](_0x4f005b[_0x8300('0xc')]['include'],function(_0x3a7152){return{'model':db[_0x3a7152[_0x8300('0x12')]],'as':_0x3a7152['as'],'attributes':_0x3a7152[_0x8300('0xe')],'include':_0x3a7152[_0x8300('0x10')]?_[_0x8300('0x11')](_0x3a7152[_0x8300('0x10')],function(_0x5b2327){return{'model':db[_0x5b2327['model']],'as':_0x5b2327['as'],'attributes':_0x5b2327[_0x8300('0xe')],'include':_0x5b2327[_0x8300('0x10')]?_['map'](_0x5b2327[_0x8300('0x10')],function(_0x224d29){return{'model':db[_0x224d29[_0x8300('0x12')]],'as':_0x224d29['as'],'attributes':_0x224d29[_0x8300('0xe')]};}):[]};}):[]};}):[]:[]})[_0x8300('0x19')](function(_0x253a27){logger[_0x8300('0x1a')](_0x8300('0x1b'),_0x4f005b);logger[_0x8300('0x13')](_0x8300('0x1b'),_0x4f005b,JSON['stringify'](_0x253a27));_0x374476(_0x253a27);})['catch'](function(_0x4ffb57){logger[_0x8300('0x1c')](_0x8300('0x1b'),_0x4ffb57[_0x8300('0x16')],_0x4f005b);_0x36918c(_0x122954[_0x8300('0x1c')](0x1f4,_0x4ffb57[_0x8300('0x16')]));});});};exports[_0x8300('0x1d')]=function(_0x3ca117){var _0x5876fa=this;return new Promise(function(_0x4321ce,_0x7b2f3e){var _0x4c00cd;return db[_0x8300('0xa')]['find']({'where':_0x3ca117[_0x8300('0xc')]['where']||{},'attributes':['id',_0x8300('0x1e'),_0x8300('0x1f'),_0x8300('0x20'),_0x8300('0x21')]})[_0x8300('0x19')](function(_0x1e977b){if(_0x1e977b){_0x4c00cd=_0x1e977b;return db[_0x8300('0x22')][_0x8300('0x23')]({'paused':0x1},{'where':{'UserId':_0x4c00cd['id']},'individualHooks':!![]});}})[_0x8300('0x19')](function(){if(_0x4c00cd){return db[_0x8300('0x24')]['findAll']({'where':{'membername':_0x4c00cd[_0x8300('0x1e')],'type':_0x8300('0x25'),'exitAt':null}});}})['then'](function(_0x3955f9){if(_0x4c00cd){if(_0x3955f9&&_0x3955f9[_0x8300('0x26')]){var _0x49c783=moment()[_0x8300('0x27')](_0x8300('0x28'));for(var _0x3e6941=0x0,_0x24eec0=_0x3955f9[_0x8300('0x26')];_0x3e6941<_0x24eec0;_0x3e6941++){_0x3955f9[_0x3e6941]['updateAttributes']({'exitAt':_0x49c783});}}}})[_0x8300('0x19')](function(){if(_0x4c00cd){var _0xa4c297=[];var _0x534dc8=utils['getChannels']();_0x534dc8[_0x8300('0x29')](function(_0x24559b){_0xa4c297[_0x8300('0x2a')]({'channel':_0x24559b,'membername':_0x4c00cd[_0x8300('0x1e')],'interface':_['isNil'](_0x4c00cd[_0x8300('0x21')])?util[_0x8300('0x27')](_0x8300('0x2b'),_0x4c00cd['name']):_0x4c00cd[_0x8300('0x21')],'type':'PAUSE','enterAt':moment()[_0x8300('0x27')](_0x8300('0x28')),'data1':_0x3ca117[_0x8300('0x2c')]['type']||_0x8300('0x2d'),'role':_0x4c00cd['role'],'internal':_0x4c00cd[_0x8300('0x20')],'uniqueid':_0x3ca117['body'][_0x8300('0x2e')]||null});});return db[_0x8300('0x24')][_0x8300('0x2f')](_0xa4c297,{'individualHooks':!![]});}})[_0x8300('0x19')](function(){if(_0x4c00cd){return _0x4c00cd[_0x8300('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3ca117[_0x8300('0x2c')][_0x8300('0x30')]||_0x8300('0x2d'),'lastPauseAt':moment()[_0x8300('0x27')](_0x8300('0x28'))});}})[_0x8300('0x19')](function(_0x335cae){_0x4321ce(_0x335cae);})[_0x8300('0x15')](function(_0x1a3544){_0x7b2f3e(_0x5876fa[_0x8300('0x1c')](0x1f4,_0x1a3544[_0x8300('0x16')]));});});};exports[_0x8300('0x31')]=function(_0x16f93d){var _0x367207=this;return new Promise(function(_0x3ce9b7,_0xcb8a5f){if(_0x16f93d[_0x8300('0x2c')][_0x8300('0x32')]&&!utils['isValidChannel'](_0x16f93d[_0x8300('0x2c')][_0x8300('0x32')])){throw new Error(util[_0x8300('0x27')](_0x8300('0x33'),_0x16f93d[_0x8300('0x2c')][_0x8300('0x32')]));}return db[_0x8300('0xa')][_0x8300('0x34')]({'where':_0x16f93d[_0x8300('0xc')][_0x8300('0xd')]||{},'attributes':['id','name','role',_0x8300('0x20'),_0x8300('0x21'),_0x8300('0x35'),_0x8300('0x36'),_0x8300('0x37'),_0x8300('0x38'),_0x8300('0x39'),_0x8300('0x3a'),_0x8300('0x3b'),'whatsappPause',_0x8300('0x3c'),'lastPauseAt']})[_0x8300('0x19')](function(_0x3a2ed9){if(!_0x3a2ed9){throw new Error(util[_0x8300('0x27')](_0x8300('0x3d'),_0x16f93d[_0x8300('0x3e')]['id']));}return _0x3a2ed9['unpause'](_0x16f93d[_0x8300('0x2c')][_0x8300('0x32')],'system');})['then'](function(_0x585e2c){_0x3ce9b7(_0x585e2c);})['catch'](function(_0x557cd7){_0xcb8a5f(_0x367207[_0x8300('0x1c')](0x1f4,_0x557cd7[_0x8300('0x16')]));});});};exports[_0x8300('0x3f')]=function(_0x5d92f0){var _0x5265ac=this;return new Promise(function(_0x1dbb1f,_0x344ad4){var _0xcc420c;return db['User'][_0x8300('0x34')]({'where':_0x5d92f0[_0x8300('0xc')]['where']||{},'attributes':['id',_0x8300('0x1e')]})[_0x8300('0x19')](function(_0x476802){if(_0x476802){_0xcc420c=_0x476802;return db[_0x8300('0x22')][_0x8300('0x40')]({'where':{'membername':_0xcc420c[_0x8300('0x1e')]},'individualHooks':!![]});}})[_0x8300('0x19')](function(){if(_0xcc420c){return db[_0x8300('0x24')][_0x8300('0xb')]({'where':{'membername':_0xcc420c['name'],'exitAt':null}});}})[_0x8300('0x19')](function(_0x206873){if(_0xcc420c){if(_0x206873&&_0x206873[_0x8300('0x26')]){var _0x30f12c=[];_0x206873[_0x8300('0x29')](function(_0x21a003){_0x30f12c[_0x8300('0x2a')](_0x21a003[_0x8300('0x23')]({'exitAt':moment()['format'](_0x8300('0x28'))}));});return BPromise[_0x8300('0x41')](_0x30f12c);}}})[_0x8300('0x19')](function(){if(_0xcc420c){return _0xcc420c['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x8300('0x19')](function(_0x4c376c){_0x1dbb1f(_0x4c376c);})['catch'](function(_0x161012){_0x344ad4(_0x5265ac['error'](0x1f4,_0x161012[_0x8300('0x16')]));});});};exports[_0x8300('0x42')]=function(_0x3dfa71){var _0x526fe3=this;return new Promise(function(_0x4d1fdc,_0x2fe318){var _0x292f6e;var _0x3e313d;var _0x203a83;var _0x1c941f;return db[_0x8300('0xa')][_0x8300('0x34')]({'where':_0x3dfa71[_0x8300('0xc')][_0x8300('0xd')]||{},'attributes':['id',_0x8300('0x1e'),'role',_0x8300('0x43'),_0x8300('0x44'),'internal','loginInPause','interface']})[_0x8300('0x19')](function(_0x4f66b9){if(_0x4f66b9){_0x292f6e=_0x4f66b9;_0x1c941f=_0x3dfa71[_0x8300('0x2c')][_0x8300('0x21')]?_0x3dfa71[_0x8300('0x2c')][_0x8300('0x21')]:util[_0x8300('0x27')](_0x8300('0x2b'),_0x292f6e[_0x8300('0x1e')]);return db['User'][_0x8300('0x45')]({'where':{'role':_0x8300('0x46'),'online':!![],'id':{'$ne':_0x292f6e['id']}}});}})[_0x8300('0x19')](function(_0x21f9bc){if(_0x21f9bc){_0x203a83=_0x21f9bc;return require(_0x8300('0x47'))['getLicense']();}})[_0x8300('0x19')](function(_0x5232b1){if(_0x5232b1&&_0x5232b1[_0x8300('0x48')]&&_0x203a83>=_0x5232b1[_0x8300('0x48')]){throw new Error(_0x8300('0x49'));}})['then'](function(){if(_0x292f6e){return db[_0x8300('0x22')]['destroy']({'where':{'membername':_0x292f6e['name']},'individualHooks':!![]});}})[_0x8300('0x19')](function(){if(_0x292f6e){return _0x292f6e['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x26a397){if(_0x292f6e){if(_0x26a397){var _0xfc3cb6=[];_0x3e313d=_0x26a397;if(_0x3e313d[_0x8300('0x26')]){for(var _0x43a631=0x0;_0x43a631<_0x3e313d[_0x8300('0x26')];_0x43a631++){_0xfc3cb6['push'](db[_0x8300('0x22')][_0x8300('0x4a')]({'membername':_0x292f6e[_0x8300('0x1e')],'UserId':_0x292f6e['id'],'queue_name':_0x3e313d[_0x43a631][_0x8300('0x1e')],'VoiceQueueId':_0x3e313d[_0x43a631]['id'],'interface':_0x1c941f,'paused':_0x292f6e[_0x8300('0x4b')]||![],'penalty':_0x3e313d[_0x43a631]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x8300('0x41')](_0xfc3cb6);}}}})[_0x8300('0x19')](function(){if(_0x292f6e){return db[_0x8300('0x24')]['findAll']({'where':{'membername':_0x292f6e[_0x8300('0x1e')],'exitAt':null}});}})[_0x8300('0x19')](function(_0x264da3){if(_0x292f6e){if(_0x264da3&&_0x264da3[_0x8300('0x26')]){var _0x51dd69=[];_0x264da3['forEach'](function(_0x51e94d){_0x51dd69[_0x8300('0x2a')](_0x51e94d[_0x8300('0x23')]({'exitAt':moment()[_0x8300('0x27')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8300('0x41')](_0x51dd69);}}})[_0x8300('0x19')](function(){if(_0x292f6e){var _0x7b435c=[];var _0x4d46d1=[];var _0x4237a4=utils[_0x8300('0x4c')]();var _0x4bb287={'membername':_0x292f6e['name'],'interface':_0x1c941f,'enterAt':moment()[_0x8300('0x27')](_0x8300('0x28')),'role':_0x292f6e[_0x8300('0x1f')],'internal':_0x292f6e['internal']};_0x4237a4[_0x8300('0x29')](function(_0x25d9ab){_0x7b435c[_0x8300('0x2a')](_[_0x8300('0x4d')]({'channel':_0x25d9ab,'type':_0x8300('0x4e'),'data1':_0x8300('0x4f'),'data2':_0x1c941f},_0x4bb287));if(_0x292f6e[_0x8300('0x4b')]){_0x4d46d1['push'](_[_0x8300('0x4d')]({'channel':_0x25d9ab,'type':'PAUSE','data1':_0x8300('0x50')},_0x4bb287));}});return db[_0x8300('0x24')][_0x8300('0x2f')](_0x7b435c[_0x8300('0x51')](_0x4d46d1),{'individualHooks':!![]});}})[_0x8300('0x19')](function(){if(_0x292f6e){return _0x292f6e[_0x8300('0x23')]({'online':!![],'lastLoginAt':moment()[_0x8300('0x27')](_0x8300('0x28')),'voicePause':_0x292f6e['loginInPause']||![],'mailPause':_0x292f6e['loginInPause']||![],'chatPause':_0x292f6e[_0x8300('0x4b')]||![],'faxPause':_0x292f6e[_0x8300('0x4b')]||![],'smsPause':_0x292f6e[_0x8300('0x4b')]||![],'openchannelPause':_0x292f6e[_0x8300('0x4b')]||![],'pauseType':_0x292f6e['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x8300('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x1c941f});}})[_0x8300('0x19')](function(_0x549a2b){_0x4d1fdc(_0x549a2b);})[_0x8300('0x15')](function(_0x5beaf4){_0x2fe318(_0x526fe3[_0x8300('0x1c')](0x1f4,_0x5beaf4[_0x8300('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index d2301f9..e496bca 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 _0xea69=['save','remove','update','length','user:','./user.events'];(function(_0x57ba8c,_0x27ca0a){var _0x5383c8=function(_0x4fa0ce){while(--_0x4fa0ce){_0x57ba8c['push'](_0x57ba8c['shift']());}};_0x5383c8(++_0x27ca0a);}(_0xea69,0x1f1));var _0x9ea6=function(_0x5dd0a4,_0x2b46a5){_0x5dd0a4=_0x5dd0a4-0x0;var _0x35475d=_0xea69[_0x5dd0a4];return _0x35475d;};'use strict';var UserEvents=require(_0x9ea6('0x0'));var events=[_0x9ea6('0x1'),_0x9ea6('0x2'),_0x9ea6('0x3')];function createListener(_0xbf9fd0,_0x5ec4bb){return function(_0x21cce3){_0x5ec4bb['emit'](_0xbf9fd0,_0x21cce3);};}function removeListener(_0x438898,_0x109808){return function(){UserEvents['removeListener'](_0x438898,_0x109808);};}exports['register']=function(_0x3fc0b9){for(var _0x5840b2=0x0,_0x12d474=events[_0x9ea6('0x4')];_0x5840b2<_0x12d474;_0x5840b2++){var _0x1b837a=events[_0x5840b2];var _0x170eec=createListener(_0x9ea6('0x5')+_0x1b837a,_0x3fc0b9);UserEvents['on'](_0x1b837a,_0x170eec);}}; \ No newline at end of file +var _0x668a=['length','./user.events','update','emit','removeListener'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x668a,0x132));var _0xa668=function(_0x3e74a4,_0x5a9801){_0x3e74a4=_0x3e74a4-0x0;var _0x561749=_0x668a[_0x3e74a4];return _0x561749;};'use strict';var UserEvents=require(_0xa668('0x0'));var events=['save','remove',_0xa668('0x1')];function createListener(_0xf1aec6,_0x14af75){return function(_0x185394){_0x14af75[_0xa668('0x2')](_0xf1aec6,_0x185394);};}function removeListener(_0x4a96c1,_0x5b93f4){return function(){UserEvents[_0xa668('0x3')](_0x4a96c1,_0x5b93f4);};}exports['register']=function(_0x130fb9){for(var _0x41c1f1=0x0,_0x33f29d=events[_0xa668('0x4')];_0x41c1f1<_0x33f29d;_0x41c1f1++){var _0x3591df=events[_0x41c1f1];var _0x3b6dd1=createListener('user:'+_0x3591df,_0x130fb9);UserEvents['on'](_0x3591df,_0x3b6dd1);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index e575537..f65d389 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x21092c,_0x437e28){var _0x1cc660=function(_0x3f3216){while(--_0x3f3216){_0x21092c['push'](_0x21092c['shift']());}};_0x1cc660(++_0x437e28);}(_0xedd9,0xfc));var _0x9edd=function(_0x413f8e,_0x1fbbda){_0x413f8e=_0x413f8e-0x0;var _0x5d7ef9=_0xedd9[_0x413f8e];return _0x5d7ef9;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5f0a4d,_0x4dfc04){var _0x382972=function(_0x24913c){while(--_0x24913c){_0x5f0a4d['push'](_0x5f0a4d['shift']());}};_0x382972(++_0x4dfc04);}(_0x70e0,0x17b));var _0x070e=function(_0xbdd6bc,_0xd4d56f){_0xbdd6bc=_0xbdd6bc-0x0;var _0x1e98ab=_0x70e0[_0xbdd6bc];return _0x1e98ab;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 01d8a71..d707b68 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 _0xd87f=['exports','sequelize'];(function(_0x14f30b,_0x4ac7ca){var _0x248b2e=function(_0x800f64){while(--_0x800f64){_0x14f30b['push'](_0x14f30b['shift']());}};_0x248b2e(++_0x4ac7ca);}(_0xd87f,0x137));var _0xfd87=function(_0x9b355a,_0x599896){_0x9b355a=_0x9b355a-0x0;var _0x44d7aa=_0xd87f[_0x9b355a];return _0x44d7aa;};'use strict';var Sequelize=require(_0xfd87('0x0'));module[_0xfd87('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8a26=['sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8a26,0x1a8));var _0x68a2=function(_0x5f7495,_0x3beb03){_0x5f7495=_0x5f7495-0x0;var _0x65a897=_0x8a26[_0x5f7495];return _0x65a897;};'use strict';var Sequelize=require(_0x68a2('0x0'));module[_0x68a2('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 877f8f7..22c72f7 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 _0xfb04=['path','rimraf','./userChatQueue.attributes','exports','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb04,0xc0));var _0x4fb0=function(_0x3b0000,_0x4acd7a){_0x3b0000=_0x3b0000-0x0;var _0x3339f3=_0xfb04[_0x3b0000];return _0x3339f3;};'use strict';var _=require('lodash');var util=require(_0x4fb0('0x0'));var logger=require(_0x4fb0('0x1'))(_0x4fb0('0x2'));var moment=require(_0x4fb0('0x3'));var BPromise=require(_0x4fb0('0x4'));var rp=require(_0x4fb0('0x5'));var fs=require('fs');var path=require(_0x4fb0('0x6'));var rimraf=require(_0x4fb0('0x7'));var config=require('../../config/environment');var attributes=require(_0x4fb0('0x8'));module[_0x4fb0('0x9')]=function(_0xd5066,_0x4c0694){return _0xd5066['define']('UserChatQueue',attributes,{'tableName':_0x4fb0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aa1=['lodash','util','api','moment','bluebird','../../config/environment','./userChatQueue.attributes','exports','user_has_chat_queues'];(function(_0x55fa5c,_0x30bd41){var _0xea802f=function(_0x4bc014){while(--_0x4bc014){_0x55fa5c['push'](_0x55fa5c['shift']());}};_0xea802f(++_0x30bd41);}(_0x7aa1,0xc6));var _0x17aa=function(_0x3f51e3,_0x48a100){_0x3f51e3=_0x3f51e3-0x0;var _0x4f2a88=_0x7aa1[_0x3f51e3];return _0x4f2a88;};'use strict';var _=require(_0x17aa('0x0'));var util=require(_0x17aa('0x1'));var logger=require('../../config/logger')(_0x17aa('0x2'));var moment=require(_0x17aa('0x3'));var BPromise=require(_0x17aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x17aa('0x5'));var attributes=require(_0x17aa('0x6'));module[_0x17aa('0x7')]=function(_0x8d446e,_0x3717ac){return _0x8d446e['define']('UserChatQueue',attributes,{'tableName':_0x17aa('0x8'),'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 f633b77..9684244 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 _0xc1f4=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserChatQueue,\x20%s,\x20%s'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0xc1f4,0x12d));var _0x4c1f=function(_0x4ccbe2,_0x11eacf){_0x4ccbe2=_0x4ccbe2-0x0;var _0x134525=_0xc1f4[_0x4ccbe2];return _0x134525;};'use strict';var _=require(_0x4c1f('0x0'));var util=require(_0x4c1f('0x1'));var moment=require(_0x4c1f('0x2'));var BPromise=require(_0x4c1f('0x3'));var rs=require(_0x4c1f('0x4'));var fs=require('fs');var Redis=require(_0x4c1f('0x5'));var db=require(_0x4c1f('0x6'))['db'];var utils=require(_0x4c1f('0x7'));var logger=require('../../config/logger')(_0x4c1f('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c1f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd61c08,_0x8bd951,_0x4921c3){return new BPromise(function(_0x2247b2,_0x2a60bd){return client['request'](_0xd61c08,_0x4921c3)[_0x4c1f('0xa')](function(_0x681ac0){logger[_0x4c1f('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x8bd951,_0x4c1f('0xc'));logger[_0x4c1f('0xd')](_0x4c1f('0xe'),_0x8bd951,'request\x20sent',JSON[_0x4c1f('0xf')](_0x681ac0));if(_0x681ac0[_0x4c1f('0x10')]){if(_0x681ac0[_0x4c1f('0x10')]['code']===0x1f4){logger[_0x4c1f('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x8bd951,_0x681ac0[_0x4c1f('0x10')][_0x4c1f('0x11')]);return _0x2a60bd(_0x681ac0['error'][_0x4c1f('0x11')]);}logger['error'](_0x4c1f('0x12'),_0x8bd951,_0x681ac0[_0x4c1f('0x10')][_0x4c1f('0x11')]);return _0x2247b2(_0x681ac0['error'][_0x4c1f('0x11')]);}else{logger[_0x4c1f('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x8bd951,'request\x20sent');_0x2247b2(_0x681ac0[_0x4c1f('0x13')][_0x4c1f('0x11')]);}})['catch'](function(_0xf49765){logger[_0x4c1f('0x10')](_0x4c1f('0x12'),_0x8bd951,_0xf49765);_0x2a60bd(_0xf49765);});});} \ No newline at end of file +var _0xa49b=['info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa49b,0x78));var _0xba49=function(_0x122194,_0x4e596f){_0x122194=_0x122194-0x0;var _0x30ba40=_0xa49b[_0x122194];return _0x30ba40;};'use strict';var _=require(_0xba49('0x0'));var util=require('util');var moment=require(_0xba49('0x1'));var BPromise=require(_0xba49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba49('0x3'));var db=require(_0xba49('0x4'))['db'];var utils=require(_0xba49('0x5'));var logger=require(_0xba49('0x6'))(_0xba49('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xba49('0x8')][_0xba49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56c03d,_0x2dd789,_0x31a74f){return new BPromise(function(_0x191c88,_0x3bca65){return client[_0xba49('0xa')](_0x56c03d,_0x31a74f)[_0xba49('0xb')](function(_0x4ac0a2){logger[_0xba49('0xc')](_0xba49('0xd'),_0x2dd789,_0xba49('0xe'));logger[_0xba49('0xf')](_0xba49('0x10'),_0x2dd789,'request\x20sent',JSON[_0xba49('0x11')](_0x4ac0a2));if(_0x4ac0a2['error']){if(_0x4ac0a2['error'][_0xba49('0x12')]===0x1f4){logger[_0xba49('0x13')](_0xba49('0xd'),_0x2dd789,_0x4ac0a2[_0xba49('0x13')]['message']);return _0x3bca65(_0x4ac0a2[_0xba49('0x13')][_0xba49('0x14')]);}logger[_0xba49('0x13')](_0xba49('0xd'),_0x2dd789,_0x4ac0a2[_0xba49('0x13')][_0xba49('0x14')]);return _0x191c88(_0x4ac0a2['error']['message']);}else{logger['info'](_0xba49('0xd'),_0x2dd789,_0xba49('0xe'));_0x191c88(_0x4ac0a2['result'][_0xba49('0x14')]);}})[_0xba49('0x15')](function(_0x30389d){logger[_0xba49('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x2dd789,_0x30389d);_0x3bca65(_0x30389d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index a5ae960..d6a3ed5 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4e505d,_0x25b48f){var _0x102d4f=function(_0x2dc2e0){while(--_0x2dc2e0){_0x4e505d['push'](_0x4e505d['shift']());}};_0x102d4f(++_0x25b48f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3cb7e8,_0xb8f77){var _0x72798f=function(_0x114662){while(--_0x114662){_0x3cb7e8['push'](_0x3cb7e8['shift']());}};_0x72798f(++_0xb8f77);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 016f01a..940a53b 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 _0xe975=['STRING','INTEGER'];(function(_0xe36749,_0x2a45c8){var _0x5d86b7=function(_0x1219e5){while(--_0x1219e5){_0xe36749['push'](_0xe36749['shift']());}};_0x5d86b7(++_0x2a45c8);}(_0xe975,0xc3));var _0x5e97=function(_0x492012,_0x1a0941){_0x492012=_0x492012-0x0;var _0x520c8c=_0xe975[_0x492012];return _0x520c8c;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5e97('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x5e97('0x1')]}}; \ No newline at end of file +var _0x6d9d=['sequelize','exports','INTEGER'];(function(_0x5353a5,_0x550668){var _0x1a856b=function(_0x140fb2){while(--_0x140fb2){_0x5353a5['push'](_0x5353a5['shift']());}};_0x1a856b(++_0x550668);}(_0x6d9d,0x1d1));var _0xd6d9=function(_0x3bbe32,_0x3b10ca){_0x3bbe32=_0x3bbe32-0x0;var _0x4a5efe=_0x6d9d[_0x3bbe32];return _0x4a5efe;};'use strict';var Sequelize=require(_0xd6d9('0x0'));module[_0xd6d9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd6d9('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2d16ebd..c3abe84 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 _0x8b77=['define','UserFaxQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0xf4b0c7,_0x2eb38b){var _0x47b3c9=function(_0x3e3f82){while(--_0x3e3f82){_0xf4b0c7['push'](_0xf4b0c7['shift']());}};_0x47b3c9(++_0x2eb38b);}(_0x8b77,0x152));var _0x78b7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8b77[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x78b7('0x0'));var util=require(_0x78b7('0x1'));var logger=require('../../config/logger')(_0x78b7('0x2'));var moment=require(_0x78b7('0x3'));var BPromise=require(_0x78b7('0x4'));var rp=require(_0x78b7('0x5'));var fs=require('fs');var path=require(_0x78b7('0x6'));var rimraf=require(_0x78b7('0x7'));var config=require(_0x78b7('0x8'));var attributes=require(_0x78b7('0x9'));module['exports']=function(_0x1649fe,_0x453cf5){return _0x1649fe[_0x78b7('0xa')](_0x78b7('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x664d=['./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','api','moment','request-promise','../../config/environment'];(function(_0x448649,_0x63bb21){var _0x2e91c6=function(_0x5babca){while(--_0x5babca){_0x448649['push'](_0x448649['shift']());}};_0x2e91c6(++_0x63bb21);}(_0x664d,0x1c6));var _0xd664=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x664d[_0xbc346f];return _0x9f9260;};'use strict';var _=require('lodash');var util=require(_0xd664('0x0'));var logger=require('../../config/logger')(_0xd664('0x1'));var moment=require(_0xd664('0x2'));var BPromise=require('bluebird');var rp=require(_0xd664('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd664('0x4'));var attributes=require(_0xd664('0x5'));module[_0xd664('0x6')]=function(_0x33bfee,_0x4e35f6){return _0x33bfee['define'](_0xd664('0x7'),attributes,{'tableName':_0xd664('0x8'),'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 db85e7a..ade532e 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 _0x61a2=['http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x46e5e4,_0x224609){var _0x41ab43=function(_0x3c13b2){while(--_0x3c13b2){_0x46e5e4['push'](_0x46e5e4['shift']());}};_0x41ab43(++_0x224609);}(_0x61a2,0x1ab));var _0x261a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x61a2[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x261a('0x0'));var util=require(_0x261a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x261a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x261a('0x3'))['db'];var utils=require(_0x261a('0x4'));var logger=require(_0x261a('0x5'))(_0x261a('0x6'));var config=require(_0x261a('0x7'));var jayson=require(_0x261a('0x8'));var client=jayson[_0x261a('0x9')][_0x261a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8a2d3b,_0x31e0e4,_0x4e12dc){return new BPromise(function(_0x918a9a,_0x210c92){return client[_0x261a('0xb')](_0x8a2d3b,_0x4e12dc)[_0x261a('0xc')](function(_0x5f5a0e){logger[_0x261a('0xd')](_0x261a('0xe'),_0x31e0e4,'request\x20sent');logger[_0x261a('0xf')](_0x261a('0x10'),_0x31e0e4,'request\x20sent',JSON[_0x261a('0x11')](_0x5f5a0e));if(_0x5f5a0e['error']){if(_0x5f5a0e[_0x261a('0x12')][_0x261a('0x13')]===0x1f4){logger['error'](_0x261a('0xe'),_0x31e0e4,_0x5f5a0e[_0x261a('0x12')]['message']);return _0x210c92(_0x5f5a0e[_0x261a('0x12')][_0x261a('0x14')]);}logger[_0x261a('0x12')](_0x261a('0xe'),_0x31e0e4,_0x5f5a0e['error']['message']);return _0x918a9a(_0x5f5a0e[_0x261a('0x12')][_0x261a('0x14')]);}else{logger[_0x261a('0xd')](_0x261a('0xe'),_0x31e0e4,_0x261a('0x15'));_0x918a9a(_0x5f5a0e[_0x261a('0x16')]['message']);}})['catch'](function(_0x586f76){logger['error'](_0x261a('0xe'),_0x31e0e4,_0x586f76);_0x210c92(_0x586f76);});});} \ No newline at end of file +var _0xe952=['jayson/promise','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2f85b9,_0x3c5346){var _0x11b468=function(_0x1804ea){while(--_0x1804ea){_0x2f85b9['push'](_0x2f85b9['shift']());}};_0x11b468(++_0x3c5346);}(_0xe952,0x175));var _0x2e95=function(_0xb1dd47,_0x179ed0){_0xb1dd47=_0xb1dd47-0x0;var _0x279006=_0xe952[_0xb1dd47];return _0x279006;};'use strict';var _=require(_0x2e95('0x0'));var util=require(_0x2e95('0x1'));var moment=require(_0x2e95('0x2'));var BPromise=require(_0x2e95('0x3'));var rs=require(_0x2e95('0x4'));var fs=require('fs');var Redis=require(_0x2e95('0x5'));var db=require(_0x2e95('0x6'))['db'];var utils=require(_0x2e95('0x7'));var logger=require(_0x2e95('0x8'))(_0x2e95('0x9'));var config=require(_0x2e95('0xa'));var jayson=require(_0x2e95('0xb'));var client=jayson['client'][_0x2e95('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x480cfa,_0x2851fe,_0x4d40a1){return new BPromise(function(_0x42b8f4,_0x2ac6f8){return client[_0x2e95('0xd')](_0x480cfa,_0x4d40a1)[_0x2e95('0xe')](function(_0x99f3a6){logger['info'](_0x2e95('0xf'),_0x2851fe,_0x2e95('0x10'));logger[_0x2e95('0x11')](_0x2e95('0x12'),_0x2851fe,_0x2e95('0x10'),JSON[_0x2e95('0x13')](_0x99f3a6));if(_0x99f3a6[_0x2e95('0x14')]){if(_0x99f3a6[_0x2e95('0x14')]['code']===0x1f4){logger[_0x2e95('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x2851fe,_0x99f3a6[_0x2e95('0x14')][_0x2e95('0x15')]);return _0x2ac6f8(_0x99f3a6[_0x2e95('0x14')]['message']);}logger[_0x2e95('0x14')](_0x2e95('0xf'),_0x2851fe,_0x99f3a6['error'][_0x2e95('0x15')]);return _0x42b8f4(_0x99f3a6[_0x2e95('0x14')][_0x2e95('0x15')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x2851fe,'request\x20sent');_0x42b8f4(_0x99f3a6[_0x2e95('0x16')][_0x2e95('0x15')]);}})[_0x2e95('0x17')](function(_0x145776){logger[_0x2e95('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x2851fe,_0x145776);_0x2ac6f8(_0x145776);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index fdc6182..10669fa 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1d2918,_0x2c1ba7){var _0x5a36e4=function(_0x3423bb){while(--_0x3423bb){_0x1d2918['push'](_0x1d2918['shift']());}};_0x5a36e4(++_0x2c1ba7);}(_0xedd9,0xfc));var _0x9edd=function(_0x728c14,_0x6ecc92){_0x728c14=_0x728c14-0x0;var _0x3ee458=_0xedd9[_0x728c14];return _0x3ee458;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 87d91e4..ca8c7a0 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 _0x2dd3=['exports','INTEGER'];(function(_0x1b436c,_0x2924cf){var _0x151a43=function(_0x5da39c){while(--_0x5da39c){_0x1b436c['push'](_0x1b436c['shift']());}};_0x151a43(++_0x2924cf);}(_0x2dd3,0x6e));var _0x32dd=function(_0x4dade3,_0x1bb28d){_0x4dade3=_0x4dade3-0x0;var _0x537b05=_0x2dd3[_0x4dade3];return _0x537b05;};'use strict';var Sequelize=require('sequelize');module[_0x32dd('0x0')]={'penalty':{'type':Sequelize[_0x32dd('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf2c0=['sequelize','exports','INTEGER'];(function(_0x245c9f,_0x1d9e8c){var _0x276b79=function(_0x2bdbd7){while(--_0x2bdbd7){_0x245c9f['push'](_0x245c9f['shift']());}};_0x276b79(++_0x1d9e8c);}(_0xf2c0,0xc0));var _0x0f2c=function(_0x52abc2,_0x1dc8de){_0x52abc2=_0x52abc2-0x0;var _0x497e6c=_0xf2c0[_0x52abc2];return _0x497e6c;};'use strict';var Sequelize=require(_0x0f2c('0x0'));module[_0x0f2c('0x1')]={'penalty':{'type':Sequelize[_0x0f2c('0x2')],'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 4b6375a..40b4a8a 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 _0x9975=['UserMailQueue','user_has_mail_queues','lodash','bluebird','request-promise','../../config/environment','./userMailQueue.attributes','exports','define'];(function(_0x18f268,_0x4b870f){var _0x1b8253=function(_0x2bf6a3){while(--_0x2bf6a3){_0x18f268['push'](_0x18f268['shift']());}};_0x1b8253(++_0x4b870f);}(_0x9975,0xda));var _0x5997=function(_0x9bb5b7,_0x3cf018){_0x9bb5b7=_0x9bb5b7-0x0;var _0x77b474=_0x9975[_0x9bb5b7];return _0x77b474;};'use strict';var _=require(_0x5997('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5997('0x1'));var rp=require(_0x5997('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5997('0x3'));var attributes=require(_0x5997('0x4'));module[_0x5997('0x5')]=function(_0xeddc37,_0x1d9f40){return _0xeddc37[_0x5997('0x6')](_0x5997('0x7'),attributes,{'tableName':_0x5997('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7974=['../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x599c44,_0x2fb16e){var _0x1d6cf6=function(_0x43f375){while(--_0x43f375){_0x599c44['push'](_0x599c44['shift']());}};_0x1d6cf6(++_0x2fb16e);}(_0x7974,0x10f));var _0x4797=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x7974[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x4797('0x0'));var util=require(_0x4797('0x1'));var logger=require(_0x4797('0x2'))(_0x4797('0x3'));var moment=require(_0x4797('0x4'));var BPromise=require(_0x4797('0x5'));var rp=require(_0x4797('0x6'));var fs=require('fs');var path=require(_0x4797('0x7'));var rimraf=require(_0x4797('0x8'));var config=require(_0x4797('0x9'));var attributes=require('./userMailQueue.attributes');module[_0x4797('0xa')]=function(_0x48260b,_0x3747d5){return _0x48260b[_0x4797('0xb')](_0x4797('0xc'),attributes,{'tableName':_0x4797('0xd'),'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 227124d..1f2eca2 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x008c,0x188));var _0xc008=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x008c[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3f62b6,_0x38b161){var _0x2f43ef=function(_0x3347fe){while(--_0x3347fe){_0x3f62b6['push'](_0x3f62b6['shift']());}};_0x2f43ef(++_0x38b161);}(_0x34e8,0x12c));var _0x834e=function(_0x2d2507,_0x3a474e){_0x2d2507=_0x2d2507-0x0;var _0x2c37da=_0x34e8[_0x2d2507];return _0x2c37da;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 9aec95f..82eb036 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbda3=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated'];(function(_0xebbc39,_0x427a35){var _0x5892df=function(_0xdbc14a){while(--_0xdbc14a){_0xebbc39['push'](_0xebbc39['shift']());}};_0x5892df(++_0x427a35);}(_0xbda3,0x18d));var _0x3bda=function(_0x164289,_0x55628d){_0x164289=_0x164289-0x0;var _0x37c715=_0xbda3[_0x164289];return _0x37c715;};'use strict';var multer=require(_0x3bda('0x0'));var util=require(_0x3bda('0x1'));var path=require(_0x3bda('0x2'));var timeout=require('connect-timeout');var express=require(_0x3bda('0x3'));var router=express[_0x3bda('0x4')]();var fs_extra=require(_0x3bda('0x5'));var auth=require(_0x3bda('0x6'));var interaction=require(_0x3bda('0x7'));var config=require('../../config/environment');var controller=require(_0x3bda('0x8'));router[_0x3bda('0x9')]('/',auth[_0x3bda('0xa')](),controller['sendUserNotification']);module[_0x3bda('0xb')]=router; \ No newline at end of file +var _0xfbcb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','sendUserNotification','multer','path','connect-timeout','express','Router'];(function(_0x3aa065,_0x47d67b){var _0x146d37=function(_0x16c9a4){while(--_0x16c9a4){_0x3aa065['push'](_0x3aa065['shift']());}};_0x146d37(++_0x47d67b);}(_0xfbcb,0xa0));var _0xbfbc=function(_0x504172,_0x4b0a3e){_0x504172=_0x504172-0x0;var _0x1968b5=_0xfbcb[_0x504172];return _0x1968b5;};'use strict';var multer=require(_0xbfbc('0x0'));var util=require('util');var path=require(_0xbfbc('0x1'));var timeout=require(_0xbfbc('0x2'));var express=require(_0xbfbc('0x3'));var router=express[_0xbfbc('0x4')]();var fs_extra=require(_0xbfbc('0x5'));var auth=require(_0xbfbc('0x6'));var interaction=require(_0xbfbc('0x7'));var config=require(_0xbfbc('0x8'));var controller=require(_0xbfbc('0x9'));router['post']('/',auth['isAuthenticated'](),controller[_0xbfbc('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index a4e2ced..0dfbbf0 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ad8=['TEXT','STRING','sequelize'];(function(_0x3e7d2e,_0x1f8e8a){var _0x51b4ea=function(_0x44c327){while(--_0x44c327){_0x3e7d2e['push'](_0x3e7d2e['shift']());}};_0x51b4ea(++_0x1f8e8a);}(_0x5ad8,0xad));var _0x85ad=function(_0x4ad56c,_0x121ad8){_0x4ad56c=_0x4ad56c-0x0;var _0x441169=_0x5ad8[_0x4ad56c];return _0x441169;};'use strict';var Sequelize=require(_0x85ad('0x0'));module['exports']={'body':{'type':Sequelize[_0x85ad('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x85ad('0x1')]},'recipientsDescription':{'type':Sequelize[_0x85ad('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xd34f=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0xd34f,0xd9));var _0xfd34=function(_0x3784bd,_0x49b5c7){_0x3784bd=_0x3784bd-0x0;var _0x53457e=_0xd34f[_0x3784bd];return _0x53457e;};'use strict';var Sequelize=require(_0xfd34('0x0'));module[_0xfd34('0x1')]={'body':{'type':Sequelize[_0xfd34('0x2')]},'senderName':{'type':Sequelize[_0xfd34('0x3')]},'recipientsId':{'type':Sequelize[_0xfd34('0x2')]},'recipientsDescription':{'type':Sequelize[_0xfd34('0x3')]},'beep':{'type':Sequelize[_0xfd34('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index b8fd8fd..27b50d7 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fb7=['userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','model','User','union','ids','queue','replace','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','forEach','emit'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0x4fb7,0x1b1));var _0x74fb=function(_0x36f62f,_0x50afeb){_0x36f62f=_0x36f62f-0x0;var _0x1bf90c=_0x4fb7[_0x36f62f];return _0x1bf90c;};'use strict';var emlformat=require(_0x74fb('0x0'));var rimraf=require(_0x74fb('0x1'));var zipdir=require(_0x74fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x74fb('0x3'));var Mustache=require(_0x74fb('0x4'));var util=require(_0x74fb('0x5'));var path=require(_0x74fb('0x6'));var sox=require(_0x74fb('0x7'));var csv=require(_0x74fb('0x8'));var ejs=require(_0x74fb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74fb('0xa'));var squel=require(_0x74fb('0xb'));var crypto=require('crypto');var jsforce=require(_0x74fb('0xc'));var deskjs=require(_0x74fb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x74fb('0xe'));var Papa=require(_0x74fb('0xf'));var Redis=require(_0x74fb('0x10'));var authService=require(_0x74fb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x74fb('0x12'));var hardwareService=require(_0x74fb('0x13'));var logger=require(_0x74fb('0x14'))(_0x74fb('0x15'));var utils=require('../../config/utils');var config=require(_0x74fb('0x16'));var licenseUtil=require(_0x74fb('0x17'));var db=require(_0x74fb('0x18'))['db'];config[_0x74fb('0x19')]=_[_0x74fb('0x1a')](config['redis'],{'host':_0x74fb('0x1b'),'port':0x18eb});var socket=require(_0x74fb('0x1c'))(new Redis(config[_0x74fb('0x19')]));require(_0x74fb('0x1d'))[_0x74fb('0x1e')](socket);function respondWithStatusCode(_0x56471d,_0x234c23){_0x234c23=_0x234c23||0xcc;return function(_0x59821e){if(_0x59821e){return _0x56471d[_0x74fb('0x1f')](_0x234c23);}return _0x56471d[_0x74fb('0x20')](_0x234c23)[_0x74fb('0x21')]();};}function respondWithResult(_0x56a038,_0x43d23c){_0x43d23c=_0x43d23c||0xc8;return function(_0x446c28){if(_0x446c28){return _0x56a038[_0x74fb('0x20')](_0x43d23c)[_0x74fb('0x22')](_0x446c28);}};}function respondWithFilteredResult(_0x5c4863,_0x3384df){return function(_0x377d0b){if(_0x377d0b){var _0x56d9da=typeof _0x3384df[_0x74fb('0x23')]===_0x74fb('0x24')&&typeof _0x3384df[_0x74fb('0x25')]==='undefined';var _0x5398d4=_0x377d0b[_0x74fb('0x26')];var _0x321fcc=_0x56d9da?0x0:_0x3384df[_0x74fb('0x23')];var _0x4ed542=_0x56d9da?_0x377d0b[_0x74fb('0x26')]:_0x3384df[_0x74fb('0x23')]+_0x3384df[_0x74fb('0x25')];var _0x45a9b0;if(_0x4ed542>=_0x5398d4){_0x4ed542=_0x5398d4;_0x45a9b0=0xc8;}else{_0x45a9b0=0xce;}_0x5c4863[_0x74fb('0x20')](_0x45a9b0);return _0x5c4863[_0x74fb('0x27')](_0x74fb('0x28'),_0x321fcc+'-'+_0x4ed542+'/'+_0x5398d4)['json'](_0x377d0b);}return null;};}function patchUpdates(_0xda080c){return function(_0x4a3171){try{jsonpatch['apply'](_0x4a3171,_0xda080c,!![]);}catch(_0x2ce6bd){return BPromise[_0x74fb('0x29')](_0x2ce6bd);}return _0x4a3171[_0x74fb('0x2a')]();};}function saveUpdates(_0x1de526,_0xfeb8ff){return function(_0x1a4c42){if(_0x1a4c42){return _0x1a4c42[_0x74fb('0x2b')](_0x1de526)[_0x74fb('0x2c')](function(_0x49881b){return _0x49881b;});}return null;};}function removeEntity(_0x38af75,_0x471e15){return function(_0x4c02dc){if(_0x4c02dc){return _0x4c02dc[_0x74fb('0x2d')]()[_0x74fb('0x2c')](function(){_0x38af75[_0x74fb('0x20')](0xcc)[_0x74fb('0x21')]();});}};}function handleEntityNotFound(_0x1bb446,_0x4f7ba1){return function(_0x21af18){if(!_0x21af18){_0x1bb446[_0x74fb('0x1f')](0x194);}return _0x21af18;};}function handleError(_0x4dea9b,_0x2f0ba0){_0x2f0ba0=_0x2f0ba0||0x1f4;return function(_0x4fd6f1){logger[_0x74fb('0x2e')](_0x4fd6f1['stack']);if(_0x4fd6f1[_0x74fb('0x2f')]){delete _0x4fd6f1['name'];}_0x4dea9b[_0x74fb('0x20')](_0x2f0ba0)['send'](_0x4fd6f1);};}exports[_0x74fb('0x30')]=function(_0x568310,_0x390588,_0x5d756e){if(!_0x568310[_0x74fb('0x31')][_0x74fb('0x32')](_0x74fb('0x33'))&&!_0x568310[_0x74fb('0x31')]['hasOwnProperty'](_0x74fb('0x34'))){throw new db[(_0x74fb('0x35'))][(_0x74fb('0x36'))](_0x74fb('0x37'));}else{if(_0x568310[_0x74fb('0x31')][_0x74fb('0x32')](_0x74fb('0x34'))&&!_0x568310[_0x74fb('0x31')][_0x74fb('0x32')](_0x74fb('0x38'))){throw new db['Sequelize'][(_0x74fb('0x36'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x568310['body'][_0x74fb('0x32')](_0x74fb('0x39'))){throw new db[(_0x74fb('0x35'))][(_0x74fb('0x36'))](_0x74fb('0x3a'));}else{try{var _0x4aa0d7=JSON[_0x74fb('0x3b')](_0x568310[_0x74fb('0x31')][_0x74fb('0x39')]);}catch(_0x24f56a){logger[_0x74fb('0x2e')](_0x24f56a);throw new db['Sequelize'][(_0x74fb('0x36'))](_0x74fb('0x3c'));}var _0x351e53=[_0x74fb('0x3d'),_0x74fb('0x3e'),_0x74fb('0x3f'),_0x74fb('0x40'),_0x74fb('0x41'),_0x74fb('0x42'),_0x74fb('0x43'),_0x74fb('0x44'),'user'];if(_[_0x74fb('0x45')](_0x4aa0d7,function(_0x203c14){return!_[_0x74fb('0x46')](_0x351e53,_0x203c14['model'][_0x74fb('0x47')]());})){throw new db['Sequelize'][(_0x74fb('0x36'))](_0x74fb('0x48'));}}}var _0x3d910d={};_0x3d910d[_0x74fb('0x49')]=_0x568310['body'][_0x74fb('0x32')](_0x74fb('0x49'))?_0x568310[_0x74fb('0x31')][_0x74fb('0x49')]:_0x568310[_0x74fb('0x4a')][_0x74fb('0x4b')];_0x3d910d['recipientsDescription']=_[_0x74fb('0x4c')](_0x568310[_0x74fb('0x31')][_0x74fb('0x4d')])?null:_0x568310[_0x74fb('0x31')][_0x74fb('0x4d')];_0x3d910d[_0x74fb('0x4e')]=_0x568310[_0x74fb('0x31')][_0x74fb('0x4e')]||![];_0x3d910d[_0x74fb('0x4f')]=_0x568310[_0x74fb('0x4a')]['id'];return getContent(_0x568310['body'])[_0x74fb('0x2c')](function(_0x1c94c7){_0x3d910d[_0x74fb('0x31')]=_0x1c94c7;return getRecipients(_0x4aa0d7);})[_0x74fb('0x2c')](function(_0x5d0a7a){_0x3d910d[_0x74fb('0x50')]=_[_0x74fb('0x51')](_0x5d0a7a)['join'](',');return db[_0x74fb('0x52')][_0x74fb('0x53')](function(_0x59444a){return db[_0x74fb('0x54')]['create'](_0x3d910d,{'raw':!![],'transaction':_0x59444a})[_0x74fb('0x2c')](function(_0x5cb5a6){var _0x315e39={'sender':_0x3d910d[_0x74fb('0x49')],'description':_0x3d910d['recipientsDescription'],'content':_0x3d910d[_0x74fb('0x31')],'beep':_0x3d910d[_0x74fb('0x4e')]};_0x5d0a7a[_0x74fb('0x55')](function(_0xbebed7){_0x315e39['recipient']=_0xbebed7;socket[_0x74fb('0x56')](_0x74fb('0x57'),_0x315e39);});return _0x5cb5a6;});});})[_0x74fb('0x2c')](respondWithResult(_0x390588,0xc9))[_0x74fb('0x58')](handleError(_0x390588,null));};function getContent(_0x808c36){return new BPromise(function(_0x1696cc,_0x5b849c){if(_0x808c36[_0x74fb('0x33')]){_0x1696cc(_0x808c36[_0x74fb('0x33')]);return;}return db['Template']['findOne']({'attributes':[_0x74fb('0x59')],'where':{'id':_0x808c36['TemplateId']},'raw':!![]})[_0x74fb('0x2c')](function(_0x592d16){if(!_0x592d16)throw new db[(_0x74fb('0x35'))]['ValidationError'](_0x74fb('0x5a'));var _0x183d54=Mustache[_0x74fb('0x5b')](_0x592d16[_0x74fb('0x59')],_0x808c36[_0x74fb('0x38')]);_0x1696cc(_0x183d54);})['catch'](function(_0x44944b){_0x5b849c(_0x44944b);});});}function getRecipients(_0x158a63){return new BPromise(function(_0x5a01e4,_0x27f18d){var _0x5e9c6f=[];var _0x2ba4c6=[];_0x158a63['forEach'](function(_0x29b762){var _0xf58350=_['startCase'](_0x29b762[_0x74fb('0x5c')][_0x74fb('0x47')]());if(_0xf58350===_0x74fb('0x5d')){_0x5e9c6f=_[_0x74fb('0x5e')](_0x5e9c6f,_0x29b762[_0x74fb('0x5f')]);}else{if(_[_0x74fb('0x46')](_0xf58350,_0x74fb('0x60')))_0xf58350=_0xf58350[_0x74fb('0x61')]('queue','Queue');_0x29b762['ids'][_0x74fb('0x55')](function(_0x94ae42){_0x2ba4c6[_0x74fb('0x62')](getAgents(_0xf58350,_0x94ae42));});}});return BPromise[_0x74fb('0x63')](_0x2ba4c6)[_0x74fb('0x2c')](function(_0x51b590){_0x5e9c6f=_[_0x74fb('0x5e')](_0x5e9c6f,_[_0x74fb('0x64')](_0x51b590));_0x5a01e4(_0x5e9c6f);})[_0x74fb('0x58')](function(_0x55464a){_0x27f18d(_0x55464a);});});}function getAgents(_0x45372f,_0xd68689){return new BPromise(function(_0x12dc37,_0x10dc48){return db[_0x45372f][_0x74fb('0x65')]({'where':{'id':_0xd68689}})[_0x74fb('0x2c')](function(_0x11b3d3){return _0x11b3d3[_0x74fb('0x66')]({'attributes':['id'],'raw':!![]})[_0x74fb('0x2c')](function(_0x130d7f){var _0xc455dc=_[_0x74fb('0x67')](_0x130d7f,'id');_0x12dc37(_0xc455dc);});})[_0x74fb('0x58')](function(_0x3cfef5){_0x10dc48(_0x3cfef5);});});} \ No newline at end of file +var _0x5ea4=['request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','register','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','name','sendUserNotification','body','text','hasOwnProperty','TemplateId','ValidationError','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','mailqueue','openchannelqueue','smsqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1f75f6,_0x3654e1){var _0x5c06c1=function(_0x21b3ba){while(--_0x21b3ba){_0x1f75f6['push'](_0x1f75f6['shift']());}};_0x5c06c1(++_0x3654e1);}(_0x5ea4,0x178));var _0x45ea=function(_0x1bcc8d,_0x39f043){_0x1bcc8d=_0x1bcc8d-0x0;var _0x471167=_0x5ea4[_0x1bcc8d];return _0x471167;};'use strict';var emlformat=require(_0x45ea('0x0'));var rimraf=require(_0x45ea('0x1'));var zipdir=require(_0x45ea('0x2'));var jsonpatch=require(_0x45ea('0x3'));var rp=require(_0x45ea('0x4'));var moment=require(_0x45ea('0x5'));var BPromise=require(_0x45ea('0x6'));var Mustache=require(_0x45ea('0x7'));var util=require('util');var path=require(_0x45ea('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x45ea('0x9'));var fs=require('fs');var fs_extra=require(_0x45ea('0xa'));var _=require(_0x45ea('0xb'));var squel=require(_0x45ea('0xc'));var crypto=require('crypto');var jsforce=require(_0x45ea('0xd'));var deskjs=require(_0x45ea('0xe'));var toCsv=require(_0x45ea('0xf'));var querystring=require('querystring');var Papa=require(_0x45ea('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x45ea('0x11'));var as=require(_0x45ea('0x12'));var hardwareService=require(_0x45ea('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x45ea('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x45ea('0x15'));var db=require('../../mysqldb')['db'];config[_0x45ea('0x16')]=_[_0x45ea('0x17')](config[_0x45ea('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0x45ea('0x18')](socket);function respondWithStatusCode(_0x3dadd2,_0x7a8a4){_0x7a8a4=_0x7a8a4||0xcc;return function(_0x439997){if(_0x439997){return _0x3dadd2['sendStatus'](_0x7a8a4);}return _0x3dadd2[_0x45ea('0x19')](_0x7a8a4)[_0x45ea('0x1a')]();};}function respondWithResult(_0x3a632e,_0x40ec3d){_0x40ec3d=_0x40ec3d||0xc8;return function(_0x3996ae){if(_0x3996ae){return _0x3a632e['status'](_0x40ec3d)[_0x45ea('0x1b')](_0x3996ae);}};}function respondWithFilteredResult(_0x18ce1b,_0x1be41b){return function(_0x39cb9c){if(_0x39cb9c){var _0xb05751=typeof _0x1be41b[_0x45ea('0x1c')]===_0x45ea('0x1d')&&typeof _0x1be41b[_0x45ea('0x1e')]===_0x45ea('0x1d');var _0x51b247=_0x39cb9c['count'];var _0x4336c5=_0xb05751?0x0:_0x1be41b['offset'];var _0xcd97e1=_0xb05751?_0x39cb9c[_0x45ea('0x1f')]:_0x1be41b['offset']+_0x1be41b[_0x45ea('0x1e')];var _0x1a168e;if(_0xcd97e1>=_0x51b247){_0xcd97e1=_0x51b247;_0x1a168e=0xc8;}else{_0x1a168e=0xce;}_0x18ce1b[_0x45ea('0x19')](_0x1a168e);return _0x18ce1b[_0x45ea('0x20')]('Content-Range',_0x4336c5+'-'+_0xcd97e1+'/'+_0x51b247)['json'](_0x39cb9c);}return null;};}function patchUpdates(_0xc85a31){return function(_0x56aae2){try{jsonpatch['apply'](_0x56aae2,_0xc85a31,!![]);}catch(_0x3a76be){return BPromise[_0x45ea('0x21')](_0x3a76be);}return _0x56aae2[_0x45ea('0x22')]();};}function saveUpdates(_0x306df3,_0x96e46b){return function(_0x27e278){if(_0x27e278){return _0x27e278[_0x45ea('0x23')](_0x306df3)[_0x45ea('0x24')](function(_0x1c3adf){return _0x1c3adf;});}return null;};}function removeEntity(_0x4c8dd1,_0x1f247f){return function(_0x27be42){if(_0x27be42){return _0x27be42[_0x45ea('0x25')]()['then'](function(){_0x4c8dd1[_0x45ea('0x19')](0xcc)[_0x45ea('0x1a')]();});}};}function handleEntityNotFound(_0x46f64c,_0x207499){return function(_0xc6bc9){if(!_0xc6bc9){_0x46f64c[_0x45ea('0x26')](0x194);}return _0xc6bc9;};}function handleError(_0x23b140,_0x403be7){_0x403be7=_0x403be7||0x1f4;return function(_0x7cd21c){logger['error'](_0x7cd21c['stack']);if(_0x7cd21c[_0x45ea('0x27')]){delete _0x7cd21c['name'];}_0x23b140[_0x45ea('0x19')](_0x403be7)['send'](_0x7cd21c);};}exports[_0x45ea('0x28')]=function(_0x2ac9e4,_0x39611b,_0x3a92dc){if(!_0x2ac9e4[_0x45ea('0x29')]['hasOwnProperty'](_0x45ea('0x2a'))&&!_0x2ac9e4[_0x45ea('0x29')][_0x45ea('0x2b')](_0x45ea('0x2c'))){throw new db['Sequelize'][(_0x45ea('0x2d'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x2ac9e4[_0x45ea('0x29')][_0x45ea('0x2b')]('TemplateId')&&!_0x2ac9e4[_0x45ea('0x29')][_0x45ea('0x2b')](_0x45ea('0x2e'))){throw new db[(_0x45ea('0x2f'))][(_0x45ea('0x2d'))](_0x45ea('0x30'));}if(!_0x2ac9e4[_0x45ea('0x29')][_0x45ea('0x2b')](_0x45ea('0x31'))){throw new db['Sequelize'][(_0x45ea('0x2d'))](_0x45ea('0x32'));}else{try{var _0x580498=JSON[_0x45ea('0x33')](_0x2ac9e4[_0x45ea('0x29')][_0x45ea('0x31')]);}catch(_0x33f987){logger[_0x45ea('0x34')](_0x33f987);throw new db['Sequelize'][(_0x45ea('0x2d'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5e94c5=['chatqueue','faxqueue',_0x45ea('0x35'),_0x45ea('0x36'),_0x45ea('0x37'),'voicequeue','whatsappqueue',_0x45ea('0x38'),_0x45ea('0x39')];if(_[_0x45ea('0x3a')](_0x580498,function(_0x2b27f9){return!_[_0x45ea('0x3b')](_0x5e94c5,_0x2b27f9[_0x45ea('0x3c')][_0x45ea('0x3d')]());})){throw new db['Sequelize']['ValidationError'](_0x45ea('0x3e'));}}}var _0x2f706f={};_0x2f706f[_0x45ea('0x3f')]=_0x2ac9e4[_0x45ea('0x29')][_0x45ea('0x2b')](_0x45ea('0x3f'))?_0x2ac9e4[_0x45ea('0x29')]['senderName']:_0x2ac9e4[_0x45ea('0x39')][_0x45ea('0x40')];_0x2f706f[_0x45ea('0x41')]=_[_0x45ea('0x42')](_0x2ac9e4['body'][_0x45ea('0x41')])?null:_0x2ac9e4['body'][_0x45ea('0x41')];_0x2f706f[_0x45ea('0x43')]=_0x2ac9e4[_0x45ea('0x29')][_0x45ea('0x43')]||![];_0x2f706f[_0x45ea('0x44')]=_0x2ac9e4['user']['id'];return getContent(_0x2ac9e4[_0x45ea('0x29')])[_0x45ea('0x24')](function(_0x1ec6db){_0x2f706f['body']=_0x1ec6db;return getRecipients(_0x580498);})[_0x45ea('0x24')](function(_0x551d9f){_0x2f706f[_0x45ea('0x45')]=_[_0x45ea('0x46')](_0x551d9f)[_0x45ea('0x47')](',');return db[_0x45ea('0x48')][_0x45ea('0x49')](function(_0xd57fb5){return db[_0x45ea('0x4a')]['create'](_0x2f706f,{'raw':!![],'transaction':_0xd57fb5})[_0x45ea('0x24')](function(_0x5bf302){var _0x116357={'sender':_0x2f706f[_0x45ea('0x3f')],'description':_0x2f706f[_0x45ea('0x41')],'content':_0x2f706f[_0x45ea('0x29')],'beep':_0x2f706f[_0x45ea('0x43')]};_0x551d9f[_0x45ea('0x4b')](function(_0x557d72){_0x116357[_0x45ea('0x4c')]=_0x557d72;socket[_0x45ea('0x4d')](_0x45ea('0x4e'),_0x116357);});return _0x5bf302;});});})[_0x45ea('0x24')](respondWithResult(_0x39611b,0xc9))[_0x45ea('0x4f')](handleError(_0x39611b,null));};function getContent(_0x2265d3){return new BPromise(function(_0x4245bc,_0x76087e){if(_0x2265d3['text']){_0x4245bc(_0x2265d3[_0x45ea('0x2a')]);return;}return db['Template'][_0x45ea('0x50')]({'attributes':[_0x45ea('0x51')],'where':{'id':_0x2265d3['TemplateId']},'raw':!![]})[_0x45ea('0x24')](function(_0x518f79){if(!_0x518f79)throw new db[(_0x45ea('0x2f'))][(_0x45ea('0x2d'))](_0x45ea('0x52'));var _0x41d8bf=Mustache[_0x45ea('0x53')](_0x518f79['html'],_0x2265d3[_0x45ea('0x2e')]);_0x4245bc(_0x41d8bf);})[_0x45ea('0x4f')](function(_0x13731a){_0x76087e(_0x13731a);});});}function getRecipients(_0x2445ac){return new BPromise(function(_0x7e9d3f,_0x47c050){var _0x563a73=[];var _0x36ca94=[];_0x2445ac[_0x45ea('0x4b')](function(_0x1e359f){var _0x2f402a=_[_0x45ea('0x54')](_0x1e359f[_0x45ea('0x3c')][_0x45ea('0x3d')]());if(_0x2f402a===_0x45ea('0x55')){_0x563a73=_[_0x45ea('0x56')](_0x563a73,_0x1e359f[_0x45ea('0x57')]);}else{if(_[_0x45ea('0x3b')](_0x2f402a,_0x45ea('0x58')))_0x2f402a=_0x2f402a['replace']('queue',_0x45ea('0x59'));_0x1e359f['ids'][_0x45ea('0x4b')](function(_0x5aaf4a){_0x36ca94[_0x45ea('0x5a')](getAgents(_0x2f402a,_0x5aaf4a));});}});return BPromise[_0x45ea('0x5b')](_0x36ca94)['then'](function(_0x3b5a7a){_0x563a73=_[_0x45ea('0x56')](_0x563a73,_[_0x45ea('0x5c')](_0x3b5a7a));_0x7e9d3f(_0x563a73);})[_0x45ea('0x4f')](function(_0x1c78e8){_0x47c050(_0x1c78e8);});});}function getAgents(_0x4c3220,_0x37d06f){return new BPromise(function(_0x17c1b9,_0x3de9d0){return db[_0x4c3220][_0x45ea('0x50')]({'where':{'id':_0x37d06f}})[_0x45ea('0x24')](function(_0xf46c8d){return _0xf46c8d[_0x45ea('0x5d')]({'attributes':['id'],'raw':!![]})[_0x45ea('0x24')](function(_0xe3e5c8){var _0x29357b=_[_0x45ea('0x5e')](_0xe3e5c8,'id');_0x17c1b9(_0x29357b);});})[_0x45ea('0x4f')](function(_0x59bf53){_0x3de9d0(_0x59bf53);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 2b583ff..e977ff0 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x413e=['hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x413e,0xbe));var _0xe413=function(_0x418070,_0x137717){_0x418070=_0x418070-0x0;var _0x20f471=_0x413e[_0x418070];return _0x20f471;};'use strict';var EventEmitter=require(_0xe413('0x0'));var UserNotification=require(_0xe413('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe413('0x2')](0x0);var events={'afterCreate':_0xe413('0x3'),'afterUpdate':_0xe413('0x4'),'afterDestroy':_0xe413('0x5')};function emitEvent(_0x3d5ddc){return function(_0x48102c,_0x4ca648,_0x535a6a){UserNotificationEvents['emit'](_0x3d5ddc+':'+_0x48102c['id'],_0x48102c);UserNotificationEvents['emit'](_0x3d5ddc,_0x48102c);_0x535a6a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xe413('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x759e=['exports','../../mysqldb','UserNotification','update','remove','emit','hasOwnProperty','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x759e,0x1d1));var _0xe759=function(_0x3b8085,_0x460d46){_0x3b8085=_0x3b8085-0x0;var _0x18abec=_0x759e[_0x3b8085];return _0x18abec;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xe759('0x0'))['db'][_0xe759('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe759('0x2'),'afterDestroy':_0xe759('0x3')};function emitEvent(_0x24fe45){return function(_0x308f07,_0x5a6d40,_0x50c50c){UserNotificationEvents[_0xe759('0x4')](_0x24fe45+':'+_0x308f07['id'],_0x308f07);UserNotificationEvents[_0xe759('0x4')](_0x24fe45,_0x308f07);_0x50c50c(null);};}for(var e in events){if(events[_0xe759('0x5')](e)){var event=events[e];UserNotification[_0xe759('0x6')](e,emitEvent(event));}}module[_0xe759('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 64f8f44..fc6b7cb 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf485=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserNotification','userNotifications'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0xf485,0x1af));var _0x5f48=function(_0xe7672b,_0x3eecba){_0xe7672b=_0xe7672b-0x0;var _0x29b6ee=_0xf485[_0xe7672b];return _0x29b6ee;};'use strict';var _=require(_0x5f48('0x0'));var util=require('util');var logger=require(_0x5f48('0x1'))('api');var moment=require(_0x5f48('0x2'));var BPromise=require(_0x5f48('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f48('0x4'));var rimraf=require(_0x5f48('0x5'));var config=require(_0x5f48('0x6'));var attributes=require('./userNotification.attributes');module[_0x5f48('0x7')]=function(_0x3859af,_0x447ae8){return _0x3859af[_0x5f48('0x8')](_0x5f48('0x9'),attributes,{'tableName':_0x5f48('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f48('0xb'),'collate':_0x5f48('0xc')});}; \ No newline at end of file +var _0xb21b=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserNotification','userNotifications'];(function(_0x4325ab,_0x3d6d50){var _0x3a8cf7=function(_0x4c443e){while(--_0x4c443e){_0x4325ab['push'](_0x4325ab['shift']());}};_0x3a8cf7(++_0x3d6d50);}(_0xb21b,0x1ec));var _0xbb21=function(_0x16da9d,_0x41329b){_0x16da9d=_0x16da9d-0x0;var _0x3b8fe2=_0xb21b[_0x16da9d];return _0x3b8fe2;};'use strict';var _=require(_0xbb21('0x0'));var util=require('util');var logger=require(_0xbb21('0x1'))('api');var moment=require(_0xbb21('0x2'));var BPromise=require(_0xbb21('0x3'));var rp=require(_0xbb21('0x4'));var fs=require('fs');var path=require(_0xbb21('0x5'));var rimraf=require(_0xbb21('0x6'));var config=require(_0xbb21('0x7'));var attributes=require('./userNotification.attributes');module[_0xbb21('0x8')]=function(_0x51e21f,_0x4705d3){return _0x51e21f[_0xbb21('0x9')](_0xbb21('0xa'),attributes,{'tableName':_0xbb21('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb21('0xc'),'collate':_0xbb21('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index df5684e..013fc54 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2980=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','localhost','redis','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4db5e1,_0x1ccd85){var _0x5b3067=function(_0x2f04aa){while(--_0x2f04aa){_0x4db5e1['push'](_0x4db5e1['shift']());}};_0x5b3067(++_0x1ccd85);}(_0x2980,0x114));var _0x0298=function(_0x2c869a,_0x30dc6a){_0x2c869a=_0x2c869a-0x0;var _0x1c69c1=_0x2980[_0x2c869a];return _0x1c69c1;};'use strict';var _=require(_0x0298('0x0'));var util=require(_0x0298('0x1'));var moment=require(_0x0298('0x2'));var BPromise=require(_0x0298('0x3'));var rs=require(_0x0298('0x4'));var fs=require('fs');var Redis=require(_0x0298('0x5'));var db=require(_0x0298('0x6'))['db'];var utils=require(_0x0298('0x7'));var logger=require(_0x0298('0x8'))(_0x0298('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0298('0xa')][_0x0298('0xb')]({'port':0x232a});config['redis']=_[_0x0298('0xc')](config['redis'],{'host':_0x0298('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0298('0xe')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x2c5ccf,_0x366c09,_0x172244){return new BPromise(function(_0x4de617,_0x439256){return client[_0x0298('0xf')](_0x2c5ccf,_0x172244)[_0x0298('0x10')](function(_0x4c7aa5){logger[_0x0298('0x11')](_0x0298('0x12'),_0x366c09,_0x0298('0x13'));logger[_0x0298('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x366c09,_0x0298('0x13'),JSON[_0x0298('0x15')](_0x4c7aa5));if(_0x4c7aa5[_0x0298('0x16')]){if(_0x4c7aa5[_0x0298('0x16')][_0x0298('0x17')]===0x1f4){logger[_0x0298('0x16')]('UserNotification,\x20%s,\x20%s',_0x366c09,_0x4c7aa5['error'][_0x0298('0x18')]);return _0x439256(_0x4c7aa5[_0x0298('0x16')][_0x0298('0x18')]);}logger[_0x0298('0x16')]('UserNotification,\x20%s,\x20%s',_0x366c09,_0x4c7aa5[_0x0298('0x16')]['message']);return _0x4de617(_0x4c7aa5[_0x0298('0x16')][_0x0298('0x18')]);}else{logger[_0x0298('0x11')]('UserNotification,\x20%s,\x20%s',_0x366c09,'request\x20sent');_0x4de617(_0x4c7aa5[_0x0298('0x19')][_0x0298('0x18')]);}})[_0x0298('0x1a')](function(_0x266227){logger[_0x0298('0x16')](_0x0298('0x12'),_0x366c09,_0x266227);_0x439256(_0x266227);});});} \ No newline at end of file +var _0xb82c=['rpc','client','http','defaults','redis','localhost','socket.io-emitter','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4f35ca,_0x232f60){var _0x44ad50=function(_0x57e6c9){while(--_0x57e6c9){_0x4f35ca['push'](_0x4f35ca['shift']());}};_0x44ad50(++_0x232f60);}(_0xb82c,0x89));var _0xcb82=function(_0x526f88,_0x4fcbf2){_0x526f88=_0x526f88-0x0;var _0x234959=_0xb82c[_0x526f88];return _0x234959;};'use strict';var _=require('lodash');var util=require(_0xcb82('0x0'));var moment=require('moment');var BPromise=require(_0xcb82('0x1'));var rs=require(_0xcb82('0x2'));var fs=require('fs');var Redis=require(_0xcb82('0x3'));var db=require(_0xcb82('0x4'))['db'];var utils=require(_0xcb82('0x5'));var logger=require(_0xcb82('0x6'))(_0xcb82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb82('0x8')][_0xcb82('0x9')]({'port':0x232a});config['redis']=_[_0xcb82('0xa')](config[_0xcb82('0xb')],{'host':_0xcb82('0xc'),'port':0x18eb});var socket=require(_0xcb82('0xd'))(new Redis(config[_0xcb82('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x7d9b2c,_0x5d08ed,_0x3c8f31){return new BPromise(function(_0x330b00,_0x2e29d3){return client['request'](_0x7d9b2c,_0x3c8f31)[_0xcb82('0xe')](function(_0xd8920c){logger['info'](_0xcb82('0xf'),_0x5d08ed,_0xcb82('0x10'));logger[_0xcb82('0x11')](_0xcb82('0x12'),_0x5d08ed,_0xcb82('0x10'),JSON['stringify'](_0xd8920c));if(_0xd8920c[_0xcb82('0x13')]){if(_0xd8920c[_0xcb82('0x13')]['code']===0x1f4){logger['error'](_0xcb82('0xf'),_0x5d08ed,_0xd8920c[_0xcb82('0x13')][_0xcb82('0x14')]);return _0x2e29d3(_0xd8920c[_0xcb82('0x13')][_0xcb82('0x14')]);}logger[_0xcb82('0x13')](_0xcb82('0xf'),_0x5d08ed,_0xd8920c[_0xcb82('0x13')][_0xcb82('0x14')]);return _0x330b00(_0xd8920c[_0xcb82('0x13')][_0xcb82('0x14')]);}else{logger[_0xcb82('0x15')]('UserNotification,\x20%s,\x20%s',_0x5d08ed,_0xcb82('0x10'));_0x330b00(_0xd8920c[_0xcb82('0x16')][_0xcb82('0x14')]);}})[_0xcb82('0x17')](function(_0x548cb0){logger[_0xcb82('0x13')](_0xcb82('0xf'),_0x5d08ed,_0x548cb0);_0x2e29d3(_0x548cb0);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 223475e..af2a271 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcb6=['./userNotification.events','save','remove','update','emit','removeListener','register','length'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0xfcb6,0x78));var _0x6fcb=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xfcb6[_0xf55e73];return _0x116b99;};'use strict';var UserNotificationEvents=require(_0x6fcb('0x0'));var events=[_0x6fcb('0x1'),_0x6fcb('0x2'),_0x6fcb('0x3')];function createListener(_0x36d496,_0x53015e){return function(_0x53079d){_0x53015e[_0x6fcb('0x4')](_0x36d496,_0x53079d);};}function removeListener(_0x37c43c,_0x413312){return function(){UserNotificationEvents[_0x6fcb('0x5')](_0x37c43c,_0x413312);};}exports[_0x6fcb('0x6')]=function(_0x13754){for(var _0x2450ad=0x0,_0x21b77f=events[_0x6fcb('0x7')];_0x2450ad<_0x21b77f;_0x2450ad++){var _0x19f3a3=events[_0x2450ad];var _0x44b6a8=createListener('userNotification:'+_0x19f3a3,_0x13754);UserNotificationEvents['on'](_0x19f3a3,_0x44b6a8);}}; \ No newline at end of file +var _0x4bcb=['update','emit','removeListener','length','userNotification:','./userNotification.events','save'];(function(_0x50d12f,_0x33ed91){var _0xa0cf4d=function(_0x3d723e){while(--_0x3d723e){_0x50d12f['push'](_0x50d12f['shift']());}};_0xa0cf4d(++_0x33ed91);}(_0x4bcb,0x7c));var _0xb4bc=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x4bcb[_0x4c1ec2];return _0x3f6f1c;};'use strict';var UserNotificationEvents=require(_0xb4bc('0x0'));var events=[_0xb4bc('0x1'),'remove',_0xb4bc('0x2')];function createListener(_0x53a7b5,_0x2efcd6){return function(_0x3287f4){_0x2efcd6[_0xb4bc('0x3')](_0x53a7b5,_0x3287f4);};}function removeListener(_0x93a34b,_0xcea2af){return function(){UserNotificationEvents[_0xb4bc('0x4')](_0x93a34b,_0xcea2af);};}exports['register']=function(_0x2fa90b){for(var _0x131e75=0x0,_0x3f3b8f=events[_0xb4bc('0x5')];_0x131e75<_0x3f3b8f;_0x131e75++){var _0x5b4e7a=events[_0x131e75];var _0x5e0272=createListener(_0xb4bc('0x6')+_0x5b4e7a,_0x2fa90b);UserNotificationEvents['on'](_0x5b4e7a,_0x5e0272);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index cc21bb7..184b461 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x291167,_0x482eff){var _0x102c7b=function(_0x5c2d5e){while(--_0x5c2d5e){_0x291167['push'](_0x291167['shift']());}};_0x102c7b(++_0x482eff);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3dcc78,_0x5a3972){var _0x4c173c=function(_0x2f675f){while(--_0x2f675f){_0x3dcc78['push'](_0x3dcc78['shift']());}};_0x4c173c(++_0x5a3972);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 6ee927a..3732954 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 _0x7378=['INTEGER','exports'];(function(_0x108c52,_0xb676e7){var _0x4c7243=function(_0x2ee870){while(--_0x2ee870){_0x108c52['push'](_0x108c52['shift']());}};_0x4c7243(++_0xb676e7);}(_0x7378,0xbd));var _0x8737=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7378[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x8737('0x0')]={'penalty':{'type':Sequelize[_0x8737('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9fcf=['INTEGER','sequelize','exports'];(function(_0x5dd7ed,_0x14b936){var _0x313013=function(_0x28fd7f){while(--_0x28fd7f){_0x5dd7ed['push'](_0x5dd7ed['shift']());}};_0x313013(++_0x14b936);}(_0x9fcf,0x73));var _0xf9fc=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x9fcf[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0xf9fc('0x0'));module[_0xf9fc('0x1')]={'penalty':{'type':Sequelize[_0xf9fc('0x2')],'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 fd199fe..900372e 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 _0xcd9a=['path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x50ce7f,_0xe062a0){var _0x4ec604=function(_0x5e59e2){while(--_0x5e59e2){_0x50ce7f['push'](_0x50ce7f['shift']());}};_0x4ec604(++_0xe062a0);}(_0xcd9a,0xb0));var _0xacd9=function(_0x423b45,_0x4c4a38){_0x423b45=_0x423b45-0x0;var _0x33d404=_0xcd9a[_0x423b45];return _0x33d404;};'use strict';var _=require(_0xacd9('0x0'));var util=require(_0xacd9('0x1'));var logger=require(_0xacd9('0x2'))(_0xacd9('0x3'));var moment=require(_0xacd9('0x4'));var BPromise=require('bluebird');var rp=require(_0xacd9('0x5'));var fs=require('fs');var path=require(_0xacd9('0x6'));var rimraf=require(_0xacd9('0x7'));var config=require(_0xacd9('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xacd9('0x9')]=function(_0x482969,_0x437e16){return _0x482969[_0xacd9('0xa')](_0xacd9('0xb'),attributes,{'tableName':_0xacd9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc84=['util','../../config/logger','api','moment','request-promise','rimraf','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdc84,0x10e));var _0x4dc8=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0xdc84[_0x260b48];return _0x3f730b;};'use strict';var _=require('lodash');var util=require(_0x4dc8('0x0'));var logger=require(_0x4dc8('0x1'))(_0x4dc8('0x2'));var moment=require(_0x4dc8('0x3'));var BPromise=require('bluebird');var rp=require(_0x4dc8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4dc8('0x5'));var config=require('../../config/environment');var attributes=require(_0x4dc8('0x6'));module['exports']=function(_0x192549,_0x453f42){return _0x192549[_0x4dc8('0x7')](_0x4dc8('0x8'),attributes,{'tableName':'user_has_openchannel_queues','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 7a36773..dd87966 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 _0x0e46=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x444764,_0x4e4a3b){var _0x578438=function(_0x218bc4){while(--_0x218bc4){_0x444764['push'](_0x444764['shift']());}};_0x578438(++_0x4e4a3b);}(_0x0e46,0x175));var _0x60e4=function(_0x40b2cd,_0x23eb2b){_0x40b2cd=_0x40b2cd-0x0;var _0x3ce6c4=_0x0e46[_0x40b2cd];return _0x3ce6c4;};'use strict';var _=require(_0x60e4('0x0'));var util=require(_0x60e4('0x1'));var moment=require(_0x60e4('0x2'));var BPromise=require(_0x60e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60e4('0x4'));var db=require(_0x60e4('0x5'))['db'];var utils=require(_0x60e4('0x6'));var logger=require(_0x60e4('0x7'))(_0x60e4('0x8'));var config=require(_0x60e4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x60e4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208f4d,_0xcab85b,_0xd219f7){return new BPromise(function(_0x4db1ab,_0x586fed){return client['request'](_0x208f4d,_0xd219f7)['then'](function(_0x452322){logger[_0x60e4('0xb')](_0x60e4('0xc'),_0xcab85b,_0x60e4('0xd'));logger[_0x60e4('0xe')](_0x60e4('0xf'),_0xcab85b,_0x60e4('0xd'),JSON[_0x60e4('0x10')](_0x452322));if(_0x452322[_0x60e4('0x11')]){if(_0x452322[_0x60e4('0x11')][_0x60e4('0x12')]===0x1f4){logger[_0x60e4('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xcab85b,_0x452322[_0x60e4('0x11')][_0x60e4('0x13')]);return _0x586fed(_0x452322[_0x60e4('0x11')][_0x60e4('0x13')]);}logger[_0x60e4('0x11')](_0x60e4('0xc'),_0xcab85b,_0x452322[_0x60e4('0x11')]['message']);return _0x4db1ab(_0x452322[_0x60e4('0x11')][_0x60e4('0x13')]);}else{logger[_0x60e4('0xb')](_0x60e4('0xc'),_0xcab85b,_0x60e4('0xd'));_0x4db1ab(_0x452322[_0x60e4('0x14')]['message']);}})[_0x60e4('0x15')](function(_0x834263){logger[_0x60e4('0x11')](_0x60e4('0xc'),_0xcab85b,_0x834263);_0x586fed(_0x834263);});});} \ No newline at end of file +var _0x6df0=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4a845d,_0x8c0c4a){var _0x5b763a=function(_0xfbc195){while(--_0xfbc195){_0x4a845d['push'](_0x4a845d['shift']());}};_0x5b763a(++_0x8c0c4a);}(_0x6df0,0x7c));var _0x06df=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x6df0[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x06df('0x0'));var util=require(_0x06df('0x1'));var moment=require(_0x06df('0x2'));var BPromise=require('bluebird');var rs=require(_0x06df('0x3'));var fs=require('fs');var Redis=require(_0x06df('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06df('0x5'))(_0x06df('0x6'));var config=require(_0x06df('0x7'));var jayson=require(_0x06df('0x8'));var client=jayson['client'][_0x06df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36caae,_0x2bd2cc,_0x50004a){return new BPromise(function(_0x1e2b00,_0x452908){return client[_0x06df('0xa')](_0x36caae,_0x50004a)[_0x06df('0xb')](function(_0x5b6eef){logger[_0x06df('0xc')](_0x06df('0xd'),_0x2bd2cc,_0x06df('0xe'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2bd2cc,_0x06df('0xe'),JSON[_0x06df('0xf')](_0x5b6eef));if(_0x5b6eef['error']){if(_0x5b6eef[_0x06df('0x10')][_0x06df('0x11')]===0x1f4){logger[_0x06df('0x10')](_0x06df('0xd'),_0x2bd2cc,_0x5b6eef[_0x06df('0x10')][_0x06df('0x12')]);return _0x452908(_0x5b6eef[_0x06df('0x10')][_0x06df('0x12')]);}logger[_0x06df('0x10')](_0x06df('0xd'),_0x2bd2cc,_0x5b6eef[_0x06df('0x10')]['message']);return _0x1e2b00(_0x5b6eef['error']['message']);}else{logger[_0x06df('0xc')](_0x06df('0xd'),_0x2bd2cc,_0x06df('0xe'));_0x1e2b00(_0x5b6eef[_0x06df('0x13')][_0x06df('0x12')]);}})[_0x06df('0x14')](function(_0xa22eb2){logger[_0x06df('0x10')](_0x06df('0xd'),_0x2bd2cc,_0xa22eb2);_0x452908(_0xa22eb2);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index d0d5c3e..0c140ab 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 _0xa6d8=['/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addSections','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa6d8,0x6a));var _0x8a6d=function(_0x4b99f0,_0x419040){_0x4b99f0=_0x4b99f0-0x0;var _0x29d886=_0xa6d8[_0x4b99f0];return _0x29d886;};'use strict';var multer=require(_0x8a6d('0x0'));var util=require(_0x8a6d('0x1'));var path=require(_0x8a6d('0x2'));var timeout=require(_0x8a6d('0x3'));var express=require(_0x8a6d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a6d('0x5'));var config=require('../../config/environment');var controller=require(_0x8a6d('0x6'));router[_0x8a6d('0x7')]('/',auth[_0x8a6d('0x8')](),controller[_0x8a6d('0x9')]);router[_0x8a6d('0x7')](_0x8a6d('0xa'),auth[_0x8a6d('0x8')](),controller[_0x8a6d('0xb')]);router[_0x8a6d('0x7')](_0x8a6d('0xc'),auth[_0x8a6d('0x8')](),controller[_0x8a6d('0xd')]);router[_0x8a6d('0x7')](_0x8a6d('0xe'),auth['isAuthenticated'](),controller[_0x8a6d('0xf')]);router[_0x8a6d('0x7')](_0x8a6d('0x10'),auth[_0x8a6d('0x8')](),controller['getResources']);router[_0x8a6d('0x11')]('/',auth[_0x8a6d('0x8')](),controller[_0x8a6d('0x12')]);router[_0x8a6d('0x11')](_0x8a6d('0x13'),auth[_0x8a6d('0x8')](),controller[_0x8a6d('0x14')]);router[_0x8a6d('0x11')]('/:id/sections',auth[_0x8a6d('0x8')](),controller[_0x8a6d('0x15')]);router[_0x8a6d('0x11')](_0x8a6d('0x10'),auth['isAuthenticated'](),controller['addResources']);router[_0x8a6d('0x16')]('/:id',auth[_0x8a6d('0x8')](),controller[_0x8a6d('0x17')]);router[_0x8a6d('0x18')]('/:id',auth[_0x8a6d('0x8')](),controller[_0x8a6d('0x19')]);router[_0x8a6d('0x18')](_0x8a6d('0xe'),auth['isAuthenticated'](),controller[_0x8a6d('0x1a')]);router[_0x8a6d('0x18')](_0x8a6d('0x10'),auth['isAuthenticated'](),controller[_0x8a6d('0x1b')]);module[_0x8a6d('0x1c')]=router; \ No newline at end of file +var _0x853d=['describe','show','/:id/sections','getSections','getResources','post','addSections','/:id/resources','put','/:id','destroy','delete','removeResources','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x853d,0xd5));var _0xd853=function(_0x2d4224,_0x394591){_0x2d4224=_0x2d4224-0x0;var _0x2246fe=_0x853d[_0x2d4224];return _0x2246fe;};'use strict';var multer=require(_0xd853('0x0'));var util=require(_0xd853('0x1'));var path=require(_0xd853('0x2'));var timeout=require('connect-timeout');var express=require(_0xd853('0x3'));var router=express['Router']();var fs_extra=require(_0xd853('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd853('0x5'));var config=require(_0xd853('0x6'));var controller=require(_0xd853('0x7'));router[_0xd853('0x8')]('/',auth[_0xd853('0x9')](),controller[_0xd853('0xa')]);router[_0xd853('0x8')](_0xd853('0xb'),auth[_0xd853('0x9')](),controller[_0xd853('0xc')]);router[_0xd853('0x8')]('/:id',auth[_0xd853('0x9')](),controller[_0xd853('0xd')]);router[_0xd853('0x8')](_0xd853('0xe'),auth['isAuthenticated'](),controller[_0xd853('0xf')]);router['get']('/:id/resources',auth['isAuthenticated'](),controller[_0xd853('0x10')]);router[_0xd853('0x11')]('/',auth[_0xd853('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0xd853('0x9')](),controller['clone']);router[_0xd853('0x11')](_0xd853('0xe'),auth['isAuthenticated'](),controller[_0xd853('0x12')]);router['post'](_0xd853('0x13'),auth[_0xd853('0x9')](),controller['addResources']);router[_0xd853('0x14')](_0xd853('0x15'),auth[_0xd853('0x9')](),controller['update']);router['delete'](_0xd853('0x15'),auth[_0xd853('0x9')](),controller[_0xd853('0x16')]);router[_0xd853('0x17')](_0xd853('0xe'),auth['isAuthenticated'](),controller['removeSections']);router[_0xd853('0x17')](_0xd853('0x13'),auth[_0xd853('0x9')](),controller[_0xd853('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 899bccb..d9a44cf 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 _0x8d53=['getDataValue','crudPermissions','BOOLEAN','exports','STRING','join'];(function(_0x469fe3,_0x1c116f){var _0x323496=function(_0x5a639f){while(--_0x5a639f){_0x469fe3['push'](_0x469fe3['shift']());}};_0x323496(++_0x1c116f);}(_0x8d53,0x1cb));var _0x38d5=function(_0x191b5f,_0x2677fe){_0x191b5f=_0x191b5f-0x0;var _0x59e223=_0x8d53[_0x191b5f];return _0x59e223;};'use strict';var Sequelize=require('sequelize');module[_0x38d5('0x0')]={'name':{'type':Sequelize[_0x38d5('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x38d5('0x1')],'set':function(_0x11c314){this['setDataValue']('crudPermissions',_0x11c314?_0x11c314[_0x38d5('0x2')](''):[]);},'get':function(){return this[_0x38d5('0x3')](_0x38d5('0x4'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x38d5('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x38d5('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x38d5('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x38d5('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x38d5('0x5')],'defaultValue':!![]}}; \ No newline at end of file +var _0x053c=['crudPermissions','join','getDataValue','BOOLEAN','STRING','name'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x053c,0x106));var _0xc053=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x053c[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc053('0x0')],'allowNull':![],'unique':_0xc053('0x1')},'crudPermissions':{'type':Sequelize[_0xc053('0x0')],'set':function(_0xe8c4ea){this['setDataValue'](_0xc053('0x2'),_0xe8c4ea?_0xe8c4ea[_0xc053('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0xc053('0x2'))?this[_0xc053('0x4')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc053('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc053('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc053('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc053('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc053('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc053('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc053('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc053('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index fc00ae6..30fa266 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 _0x964b=['UserProfile','includeAll','include','findAll','rows','catch','show','merge','find','create','body','keys','get','omit','crudPermissions','updatedAt','sequelize','UserProfileSection','params','autoAssociation','UserProfileResource','createdAt','sectionId','userProfileId','Resources','describe','addSections','transaction','each','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./userProfile.socket','register','status','json','offset','count','set','reject','update','destroy','then','end','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','filter','where','map','VIRTUAL','options'];(function(_0x468ef1,_0x42dca7){var _0x2891a7=function(_0x3d62b1){while(--_0x3d62b1){_0x468ef1['push'](_0x468ef1['shift']());}};_0x2891a7(++_0x42dca7);}(_0x964b,0x112));var _0xb964=function(_0x47a165,_0x54b065){_0x47a165=_0x47a165-0x0;var _0x249158=_0x964b[_0x47a165];return _0x249158;};'use strict';var emlformat=require(_0xb964('0x0'));var rimraf=require(_0xb964('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb964('0x2'));var rp=require(_0xb964('0x3'));var moment=require(_0xb964('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb964('0x5'));var path=require('path');var sox=require(_0xb964('0x6'));var csv=require(_0xb964('0x7'));var ejs=require(_0xb964('0x8'));var fs=require('fs');var fs_extra=require(_0xb964('0x9'));var _=require(_0xb964('0xa'));var squel=require(_0xb964('0xb'));var crypto=require(_0xb964('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb964('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb964('0xd'));var authService=require(_0xb964('0xe'));var qs=require(_0xb964('0xf'));var as=require(_0xb964('0x10'));var hardwareService=require(_0xb964('0x11'));var logger=require(_0xb964('0x12'))('api');var utils=require(_0xb964('0x13'));var config=require(_0xb964('0x14'));var licenseUtil=require(_0xb964('0x15'));var db=require(_0xb964('0x16'))['db'];config['redis']=_[_0xb964('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb964('0x18'))(new Redis(config[_0xb964('0x19')]));require(_0xb964('0x1a'))[_0xb964('0x1b')](socket);function respondWithStatusCode(_0x2eebf3,_0x31c7f4){_0x31c7f4=_0x31c7f4||0xcc;return function(_0x3d5baa){if(_0x3d5baa){return _0x2eebf3['sendStatus'](_0x31c7f4);}return _0x2eebf3[_0xb964('0x1c')](_0x31c7f4)['end']();};}function respondWithResult(_0x538d2e,_0xd775d5){_0xd775d5=_0xd775d5||0xc8;return function(_0x19eb59){if(_0x19eb59){return _0x538d2e[_0xb964('0x1c')](_0xd775d5)[_0xb964('0x1d')](_0x19eb59);}};}function respondWithFilteredResult(_0x96e70a,_0x43309f){return function(_0x263276){if(_0x263276){var _0x44d78a=typeof _0x43309f[_0xb964('0x1e')]==='undefined'&&typeof _0x43309f['limit']==='undefined';var _0x2f5068=_0x263276[_0xb964('0x1f')];var _0x209075=_0x44d78a?0x0:_0x43309f[_0xb964('0x1e')];var _0x12056d=_0x44d78a?_0x263276['count']:_0x43309f['offset']+_0x43309f['limit'];var _0x36df0d;if(_0x12056d>=_0x2f5068){_0x12056d=_0x2f5068;_0x36df0d=0xc8;}else{_0x36df0d=0xce;}_0x96e70a[_0xb964('0x1c')](_0x36df0d);return _0x96e70a[_0xb964('0x20')]('Content-Range',_0x209075+'-'+_0x12056d+'/'+_0x2f5068)[_0xb964('0x1d')](_0x263276);}return null;};}function patchUpdates(_0x39f423){return function(_0x1ba889){try{jsonpatch['apply'](_0x1ba889,_0x39f423,!![]);}catch(_0x486d66){return BPromise[_0xb964('0x21')](_0x486d66);}return _0x1ba889['save']();};}function saveUpdates(_0x14dece,_0x2bace5){return function(_0x2b9b74){if(_0x2b9b74){return _0x2b9b74[_0xb964('0x22')](_0x14dece)['then'](function(_0x1cecce){return _0x1cecce;});}return null;};}function removeEntity(_0x1d9dcd,_0x2801dd){return function(_0x227d11){if(_0x227d11){return _0x227d11[_0xb964('0x23')]()[_0xb964('0x24')](function(){_0x1d9dcd[_0xb964('0x1c')](0xcc)[_0xb964('0x25')]();});}};}function handleEntityNotFound(_0x142f76,_0x4d82e2){return function(_0x2b5b7d){if(!_0x2b5b7d){_0x142f76[_0xb964('0x26')](0x194);}return _0x2b5b7d;};}function handleError(_0x9e2530,_0x271c55){_0x271c55=_0x271c55||0x1f4;return function(_0x4249fa){logger[_0xb964('0x27')](_0x4249fa[_0xb964('0x28')]);if(_0x4249fa['name']){delete _0x4249fa[_0xb964('0x29')];}_0x9e2530[_0xb964('0x1c')](_0x271c55)[_0xb964('0x2a')](_0x4249fa);};}exports['index']=function(_0x3615c0,_0x42fc07){var _0xa0df8b={},_0x2cc8b6={},_0x4321c3={'count':0x0,'rows':[]};var _0x36117c=_['map'](db['UserProfile'][_0xb964('0x2b')],function(_0x3b38c0){return{'name':_0x3b38c0[_0xb964('0x2c')],'type':_0x3b38c0[_0xb964('0x2d')]['key']};});_0x2cc8b6[_0xb964('0x2e')]=_['map'](_0x36117c,_0xb964('0x29'));_0x2cc8b6[_0xb964('0x2f')]=_['keys'](_0x3615c0['query']);_0x2cc8b6[_0xb964('0x30')]=_[_0xb964('0x31')](_0x2cc8b6[_0xb964('0x2e')],_0x2cc8b6[_0xb964('0x2f')]);_0xa0df8b[_0xb964('0x32')]=_[_0xb964('0x31')](_0x2cc8b6['model'],qs['fields'](_0x3615c0['query'][_0xb964('0x33')]));_0xa0df8b[_0xb964('0x32')]=_0xa0df8b[_0xb964('0x32')][_0xb964('0x34')]?_0xa0df8b[_0xb964('0x32')]:_0x2cc8b6[_0xb964('0x2e')];if(!_0x3615c0['query']['hasOwnProperty'](_0xb964('0x35'))){_0xa0df8b[_0xb964('0x36')]=qs[_0xb964('0x36')](_0x3615c0[_0xb964('0x2f')][_0xb964('0x36')]);_0xa0df8b['offset']=qs[_0xb964('0x1e')](_0x3615c0[_0xb964('0x2f')][_0xb964('0x1e')]);}_0xa0df8b[_0xb964('0x37')]=qs[_0xb964('0x38')](_0x3615c0[_0xb964('0x2f')][_0xb964('0x38')]);_0xa0df8b['where']=qs[_0xb964('0x30')](_['pick'](_0x3615c0[_0xb964('0x2f')],_0x2cc8b6['filters']),_0x36117c);if(_0x3615c0[_0xb964('0x2f')][_0xb964('0x39')]){_0xa0df8b['where']=_['merge'](_0xa0df8b[_0xb964('0x3a')],{'$or':_[_0xb964('0x3b')](_0x36117c,function(_0x2f9e6d){if(_0x2f9e6d[_0xb964('0x2d')]!==_0xb964('0x3c')){var _0x47c798={};_0x47c798[_0x2f9e6d[_0xb964('0x29')]]={'$like':'%'+_0x3615c0[_0xb964('0x2f')][_0xb964('0x39')]+'%'};return _0x47c798;}})});}_0xa0df8b=_['merge']({},_0xa0df8b,_0x3615c0[_0xb964('0x3d')]);var _0x16c4bc={'where':_0xa0df8b[_0xb964('0x3a')]};return db[_0xb964('0x3e')][_0xb964('0x1f')](_0x16c4bc)['then'](function(_0xe962f9){_0x4321c3[_0xb964('0x1f')]=_0xe962f9;if(_0x3615c0['query'][_0xb964('0x3f')]){_0xa0df8b[_0xb964('0x40')]=[{'all':!![]}];}return db[_0xb964('0x3e')][_0xb964('0x41')](_0xa0df8b);})['then'](function(_0x4a0d65){_0x4321c3[_0xb964('0x42')]=_0x4a0d65;return _0x4321c3;})[_0xb964('0x24')](respondWithFilteredResult(_0x42fc07,_0xa0df8b))[_0xb964('0x43')](handleError(_0x42fc07,null));};exports[_0xb964('0x44')]=function(_0x141f3d,_0x176c92){var _0x218562={'raw':![],'where':{'id':_0x141f3d['params']['id']}},_0x19687e={};_0x19687e[_0xb964('0x2e')]=_['keys'](db[_0xb964('0x3e')][_0xb964('0x2b')]);_0x19687e[_0xb964('0x2f')]=_['keys'](_0x141f3d[_0xb964('0x2f')]);_0x19687e[_0xb964('0x30')]=_[_0xb964('0x31')](_0x19687e[_0xb964('0x2e')],_0x19687e[_0xb964('0x2f')]);_0x218562[_0xb964('0x32')]=_[_0xb964('0x31')](_0x19687e[_0xb964('0x2e')],qs[_0xb964('0x33')](_0x141f3d['query']['fields']));_0x218562['attributes']=_0x218562[_0xb964('0x32')][_0xb964('0x34')]?_0x218562['attributes']:_0x19687e[_0xb964('0x2e')];if(_0x141f3d[_0xb964('0x2f')]['includeAll']){_0x218562['include']=[{'all':!![]}];}_0x218562=_[_0xb964('0x45')]({},_0x218562,_0x141f3d[_0xb964('0x3d')]);return db[_0xb964('0x3e')][_0xb964('0x46')](_0x218562)['then'](handleEntityNotFound(_0x176c92,null))[_0xb964('0x24')](respondWithResult(_0x176c92,null))['catch'](handleError(_0x176c92,null));};exports[_0xb964('0x47')]=function(_0x29bf54,_0x3cbfd5){return db[_0xb964('0x3e')][_0xb964('0x47')](_0x29bf54[_0xb964('0x48')],{})[_0xb964('0x24')](respondWithResult(_0x3cbfd5,0xc9))[_0xb964('0x43')](handleError(_0x3cbfd5,null));};exports['clone']=function(_0x2d74b7,_0x2f6406){var _0xd97da7={'where':{'id':_0x2d74b7['params']['id']}},_0x28c31a={};_0x28c31a[_0xb964('0x2e')]=_[_0xb964('0x49')](db[_0xb964('0x3e')][_0xb964('0x2b')]);_0xd97da7[_0xb964('0x32')]=_[_0xb964('0x31')](_0x28c31a[_0xb964('0x2e')],qs[_0xb964('0x33')](_0x2d74b7[_0xb964('0x2f')][_0xb964('0x33')]));_0xd97da7[_0xb964('0x32')]=_0xd97da7[_0xb964('0x32')][_0xb964('0x34')]?_0xd97da7[_0xb964('0x32')]:_0x28c31a[_0xb964('0x2e')];if(_0x2d74b7['query'][_0xb964('0x3f')]){_0xd97da7['include']=[{'all':!![]}];}_0xd97da7=_[_0xb964('0x45')]({},_0xd97da7,_0x2d74b7[_0xb964('0x3d')]);return db[_0xb964('0x3e')][_0xb964('0x46')](_0xd97da7)['then'](handleEntityNotFound(_0x2f6406,null))[_0xb964('0x24')](function(_0xc73004){if(_0xc73004){var _0x3947de=_0xc73004[_0xb964('0x4a')]({'plain':!![]});_0x3947de=qs[_0xb964('0x4b')](_0x3947de,['id','createdAt','updatedAt',_0xb964('0x4c')]);_0x2d74b7['body']=_[_0xb964('0x4b')](_0x2d74b7[_0xb964('0x48')],['id','createdAt',_0xb964('0x4d')]);return db[_0xb964('0x4e')]['transaction'](function(_0x44d05d){return db[_0xb964('0x3e')]['create'](_[_0xb964('0x45')](_0x3947de,_0x2d74b7['body']),{'include':_0x2d74b7[_0xb964('0x2f')][_0xb964('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x44d05d})[_0xb964('0x24')](function(_0xa4874){var _0x2e787a=_0xa4874[_0xb964('0x4a')]({'plain':!![]});return db[_0xb964('0x4f')]['findAll']({'where':{'userProfileId':_0x2d74b7[_0xb964('0x50')]['id']},'raw':!![]})['then'](function(_0x3f3b42){if(_0x3f3b42){return BPromise['each'](_0x3f3b42,function(_0x21c239){return new BPromise(function(_0x2f0fe7,_0x7c61f1){if(_0x21c239[_0xb964('0x51')]===null||_0x21c239[_0xb964('0x51')]===0x1)_0x2f0fe7(null);return db[_0xb964('0x52')]['findAll']({'where':{'sectionId':_0x21c239['id']},'raw':!![]})[_0xb964('0x24')](function(_0xd527bb){var _0x58cfbe=_[_0xb964('0x3b')](_0xd527bb,function(_0x1665b6){return qs['omit'](_0x1665b6,['id',_0xb964('0x53'),_0xb964('0x4d'),_0xb964('0x54')]);});_0x2f0fe7(_0x58cfbe);})['catch'](function(_0x299588){_0x7c61f1(_0x299588);});})[_0xb964('0x24')](function(_0x3840a0){var _0x146f78=qs[_0xb964('0x4b')](_0x21c239,['id',_0xb964('0x53'),_0xb964('0x4d')]);_0x146f78[_0xb964('0x55')]=_0x2e787a['id'];if(_0x3840a0)_0x146f78[_0xb964('0x56')]=_0x3840a0;return _0x146f78;})['then'](function(_0x15e8b2){return db['UserProfileSection']['create'](_0x15e8b2,{'include':[{'model':db[_0xb964('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x44d05d});});})[_0xb964('0x24')](function(){return _0x2e787a;});}});});});}})[_0xb964('0x24')](respondWithResult(_0x2f6406,0xc9))[_0xb964('0x43')](handleError(_0x2f6406,null));};exports['update']=function(_0x157805,_0x2235ce){if(_0x157805['body']['id']){delete _0x157805[_0xb964('0x48')]['id'];}return db[_0xb964('0x3e')][_0xb964('0x46')]({'where':{'id':_0x157805['params']['id']}})[_0xb964('0x24')](handleEntityNotFound(_0x2235ce,null))['then'](saveUpdates(_0x157805[_0xb964('0x48')],null))['then'](respondWithResult(_0x2235ce,null))[_0xb964('0x43')](handleError(_0x2235ce,null));};exports[_0xb964('0x23')]=function(_0x452cca,_0x1f3f68){return db['UserProfile'][_0xb964('0x46')]({'where':{'id':_0x452cca['params']['id']}})[_0xb964('0x24')](handleEntityNotFound(_0x1f3f68,null))[_0xb964('0x24')](removeEntity(_0x1f3f68,null))[_0xb964('0x43')](handleError(_0x1f3f68,null));};exports[_0xb964('0x57')]=function(_0x541999,_0x18d18c){return db[_0xb964('0x3e')][_0xb964('0x57')]()[_0xb964('0x24')](respondWithResult(_0x18d18c,null))[_0xb964('0x43')](handleError(_0x18d18c,null));};exports[_0xb964('0x58')]=function(_0xcd064b,_0x302351){var _0x1fdcbd=_0xcd064b[_0xb964('0x48')];return db['UserProfile'][_0xb964('0x46')]({'where':{'id':_0xcd064b[_0xb964('0x50')]['id']}})[_0xb964('0x24')](handleEntityNotFound(_0x302351,null))[_0xb964('0x24')](function(_0x289901){if(_0x289901){return db[_0xb964('0x4e')][_0xb964('0x59')](function(_0x39d8e1){return db[_0xb964('0x4f')][_0xb964('0x23')]({'where':{'userProfileId':_0xcd064b[_0xb964('0x50')]['id'],'sectionId':_['map'](_0x1fdcbd,function(_0x5e9151){return _0x5e9151[_0xb964('0x54')];})},'transaction':_0x39d8e1})[_0xb964('0x24')](function(){var _0x3ce6ba=_['map'](_0x1fdcbd,function(_0x351e23){_0x351e23['userProfileId']=_0xcd064b[_0xb964('0x50')]['id'];return _0x351e23;});var _0x4f4892=[];return BPromise[_0xb964('0x5a')](_0x3ce6ba,function(_0x206fc8){return db[_0xb964('0x4f')][_0xb964('0x47')](_0x206fc8,{'include':[{'model':db[_0xb964('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x39d8e1})[_0xb964('0x24')](function(_0x4a2ebf){_0x4f4892['push'](_0x4a2ebf[_0xb964('0x4a')]({'plain':!![]}));});})['then'](function(){return _0x4f4892;});});});}})[_0xb964('0x24')](function(_0x564ad0){return _0x564ad0;})[_0xb964('0x24')](respondWithResult(_0x302351,null))[_0xb964('0x43')](handleError(_0x302351,null));};exports[_0xb964('0x5b')]=function(_0x169add,_0x4d34f3){var _0x3d95e9;return db[_0xb964('0x3e')][_0xb964('0x46')]({'where':{'id':_0x169add[_0xb964('0x50')]['id']},'attributes':['id','name']})[_0xb964('0x24')](handleEntityNotFound(_0x4d34f3,null))[_0xb964('0x24')](function(_0x51e057){if(_0x51e057){_0x3d95e9=_0x51e057;return db[_0xb964('0x4f')][_0xb964('0x23')]({'where':{'userProfileId':_0x169add['params']['id'],'sectionId':_0x169add['query'][_0xb964('0x5c')]}});}})[_0xb964('0x24')](function(){return _0x3d95e9;})['then'](respondWithStatusCode(_0x4d34f3,null))[_0xb964('0x43')](handleError(_0x4d34f3,null));};exports[_0xb964('0x5d')]=function(_0x26ce8f,_0x293d12){var _0x554a5a=[];var _0x24d922=[];return db[_0xb964('0x4f')][_0xb964('0x41')]({'where':{'userProfileId':_0x26ce8f[_0xb964('0x50')]['id']},'raw':!![]})[_0xb964('0x24')](function(_0x48d2c9){_0x554a5a=_['filter'](_0x48d2c9,function(_0x33b756){return _0x33b756[_0xb964('0x5e')]===0x1||_[_0xb964('0x5f')]([0x3eb,0x709],_0x33b756[_0xb964('0x54')]);});if(!_[_0xb964('0x60')](_0x554a5a)){return _[_0xb964('0x3b')](_0x554a5a,function(_0x55ef89){return _0x55ef89[_0xb964('0x54')];});}else{return;}})[_0xb964('0x24')](function(_0x46b1c7){if(_0x46b1c7)_0x24d922=_0x46b1c7;if(_[_0xb964('0x5f')](_0x24d922,0x64)){var _0x52171b=_['find'](_0x554a5a,{'sectionId':0x64});return hasDefaultDashboard(_0x52171b)[_0xb964('0x24')](function(_0x23e516){return _[_0xb964('0x3b')](_0x554a5a,function(_0x28cba2){if(_0x28cba2[_0xb964('0x54')]===0x64){_0x28cba2['subsections']=_0x23e516;}return _0x28cba2;});});}else{return;}})[_0xb964('0x24')](function(_0x3f6148){if(_0x3f6148)_0x554a5a=_0x3f6148;if(_[_0xb964('0x5f')](_0x24d922,0x3eb)){var _0x4667d6=_[_0xb964('0x46')](_0x554a5a,{'sectionId':0x3eb});return getCustomDashboards(_0x4667d6)[_0xb964('0x24')](function(_0xbe89ff){return _[_0xb964('0x3b')](_0x554a5a,function(_0x30556b){if(_0x4667d6['enabled']){if(_0x30556b[_0xb964('0x54')]===0x3eb){_0x30556b[_0xb964('0x61')]=_0xbe89ff;}}else{if(_0x30556b['sectionId']===0x64){_0x30556b['subsections']=_0xbe89ff;}}return _0x30556b;});});}else{return;}})[_0xb964('0x24')](function(_0x44f4e3){if(_0x44f4e3)_0x554a5a=_0x44f4e3;if(_[_0xb964('0x5f')](_0x24d922,0x709)){var _0x3570a8=_[_0xb964('0x46')](_0x554a5a,{'sectionId':0x709});return getPlugins(_0x3570a8)[_0xb964('0x24')](function(_0x5306f2){if(_0x3570a8['enabled']){return _[_0xb964('0x3b')](_0x554a5a,function(_0x367c17){if(_0x367c17['sectionId']===0x709){_0x367c17[_0xb964('0x61')]=_0x5306f2;}return _0x367c17;});}else{var _0x1ab87d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5306f2};var _0x4ec7bb=_[_0xb964('0x3b')](_0x554a5a);_0x4ec7bb[_0xb964('0x62')](_0x1ab87d);return _0x4ec7bb;}});}else{return;}})[_0xb964('0x24')](function(_0x3298ad){if(_0x3298ad)_0x554a5a=_0x3298ad;return _[_0xb964('0x39')](_0x554a5a,[_0xb964('0x5e'),0x1]);})[_0xb964('0x24')](respondWithResult(_0x293d12,null))[_0xb964('0x43')](handleError(_0x293d12,null));};function hasDefaultDashboard(_0x3285cb){var _0x367eb8=[0x65];return new BPromise(function(_0x49707f,_0x541323){try{if(_0x3285cb[_0xb964('0x51')]){_0x49707f(_0x367eb8);}else{return db[_0xb964('0x52')][_0xb964('0x63')]({'where':{'sectionId':_0x3285cb['id']},'raw':!![]})['then'](function(_0x4a76f7){_0x4a76f7?_0x49707f(_0x367eb8):_0x49707f();});}}catch(_0x4d1b94){_0x541323(_0x4d1b94);}});}function getCustomDashboards(_0x1e0889){var _0x2ba9e5=[];return new BPromise(function(_0x38e30b,_0x3d4778){try{if(_0x1e0889[_0xb964('0x51')]){return db[_0xb964('0x64')]['findAll']({'raw':!![]})[_0xb964('0x24')](function(_0x4dbe07){_0x4dbe07[_0xb964('0x65')](function(_0x45854d){_0x2ba9e5['push'](_0x45854d['id']+0x1869f);});_0x38e30b(_0x2ba9e5);});}else{return db[_0xb964('0x52')][_0xb964('0x41')]({'where':{'sectionId':_0x1e0889['id']},'raw':!![]})[_0xb964('0x24')](function(_0x2d0e69){_0x2d0e69[_0xb964('0x65')](function(_0x53c7d0){_0x2ba9e5[_0xb964('0x62')](_0x53c7d0[_0xb964('0x66')]+0x1869f);});_0x38e30b(_0x2ba9e5);});}}catch(_0x1447a2){_0x3d4778(_0x1447a2);}});}function getPlugins(_0x476d92){var _0x1341a9=[];return new BPromise(function(_0x1e336a,_0x407ff7){try{if(_0x476d92['autoAssociation']){return db[_0xb964('0x67')][_0xb964('0x41')]({'raw':!![]})[_0xb964('0x24')](function(_0x26a401){_0x26a401[_0xb964('0x65')](function(_0x1df67e){_0x1341a9[_0xb964('0x62')](_0x1df67e['id']+0x15b38);});_0x1e336a(_0x1341a9);});}else{return db[_0xb964('0x52')]['findAll']({'where':{'sectionId':_0x476d92['id']},'raw':!![]})['then'](function(_0xeed18c){_0xeed18c[_0xb964('0x65')](function(_0x5b3c1d){_0x1341a9['push'](_0x5b3c1d[_0xb964('0x66')]+0x15b38);});_0x1e336a(_0x1341a9);});}}catch(_0x2d59b8){_0x407ff7(_0x2d59b8);}});}exports[_0xb964('0x68')]=function(_0x3e080d,_0xbc4508){return db[_0xb964('0x3e')][_0xb964('0x46')]({'where':{'id':_0x3e080d[_0xb964('0x50')]['id']}})[_0xb964('0x24')](handleEntityNotFound(_0xbc4508,null))['then'](function(_0x12ea3d){if(_0x12ea3d){return db[_0xb964('0x4e')][_0xb964('0x59')](function(_0x360036){return db[_0xb964('0x4f')][_0xb964('0x41')]({'where':{'userProfileId':_0x3e080d['params']['id']},'attributes':['id'],'raw':!![]})[_0xb964('0x24')](function(_0x233466){if(_0x233466){return db[_0xb964('0x4f')][_0xb964('0x23')]({'where':{'userProfileId':_0x3e080d['params']['id'],'id':_[_0xb964('0x3b')](_0x233466,function(_0x3b7988){return _0x3b7988['id'];})},'transaction':_0x360036});}})[_0xb964('0x24')](function(_0x534578){var _0xfcfaba=_[_0xb964('0x3b')](_0x3e080d['body'],function(_0x4a7746){_0x4a7746[_0xb964('0x55')]=_0x3e080d[_0xb964('0x50')]['id'];return _0x4a7746;});return db[_0xb964('0x4f')][_0xb964('0x69')](_0xfcfaba,{'raw':!![],'transaction':_0x360036});})[_0xb964('0x24')](function(_0x4f1df1){var _0x5b8844=_[_0xb964('0x39')](_['map'](_0x4f1df1,function(_0xdf8915){return _0xdf8915[_0xb964('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x5b8844){return db[_0xb964('0x4f')]['findAll']({'where':{'userProfileId':_0x3e080d['params']['id'],'sectionId':_[_0xb964('0x3b')](_0x5b8844,function(_0xcf9333){return _0xcf9333[_0xb964('0x54')];})},'attributes':['id',_0xb964('0x54')],'raw':!![]})[_0xb964('0x24')](function(_0x5746b7){var _0x4ce9f2=_[_0xb964('0x3b')](_0x3e080d[_0xb964('0x48')],function(_0x310f9b){_0x310f9b['userProfileId']=_0x3e080d[_0xb964('0x50')]['id'];return _0x310f9b;});return db['UserProfileResource'][_0xb964('0x69')](_0x4ce9f2,{'raw':!![],'transaction':_0x360036});});}})[_0xb964('0x43')](handleError(_0xbc4508,null));});}})[_0xb964('0x24')](function(_0x1b9773){var _0x4b2803=_[_0xb964('0x3b')](_0x1b9773,function(_0x2f21d2){return _0x2f21d2[_0xb964('0x4a')]({'plain':!![]});});})['then'](respondWithResult(_0xbc4508,null))[_0xb964('0x43')](handleError(_0xbc4508,null));};exports[_0xb964('0x6a')]=function(_0xc5c8c6,_0x37c3ba,_0x1a1998){return db[_0xb964('0x3e')][_0xb964('0x46')]({'where':{'id':_0xc5c8c6[_0xb964('0x50')]['id']}})['then'](handleEntityNotFound(_0x37c3ba,null))[_0xb964('0x24')](function(_0x5532e3){if(_0x5532e3){return _0x5532e3[_0xb964('0x6a')](_0xc5c8c6[_0xb964('0x2f')][_0xb964('0x5c')]);}})[_0xb964('0x24')](respondWithStatusCode(_0x37c3ba,null))['catch'](handleError(_0x37c3ba,null));};exports[_0xb964('0x6b')]=function(_0xd13e14,_0x278e24){var _0x304954={};if(!_0xd13e14['query'][_0xb964('0x6c')])throw new Error(_0xb964('0x6d'));if(!_0xd13e14['query'][_0xb964('0x6e')](_0xb964('0x35'))){_0x304954[_0xb964('0x36')]=qs[_0xb964('0x36')](_0xd13e14['query']['limit']);_0x304954[_0xb964('0x1e')]=qs[_0xb964('0x1e')](_0xd13e14[_0xb964('0x2f')][_0xb964('0x1e')]);}return db[_0xb964('0x3e')][_0xb964('0x46')]({'where':{'id':_0xd13e14[_0xb964('0x50')]['id']}})[_0xb964('0x24')](function(_0x5dc11c){if(!_0x5dc11c)throw new Error(_0xb964('0x6f')+_0xd13e14[_0xb964('0x50')]['id']);return db[_0xb964('0x3e')][_0xb964('0x6b')](_0xd13e14);})[_0xb964('0x24')](respondWithFilteredResult(_0x278e24,_0x304954))[_0xb964('0x43')](handleError(_0x278e24,null));}; \ No newline at end of file +var _0x8ff9=['send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','find','catch','create','body','clone','includeAll','options','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','UserProfileSection','destroy','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','push','findOne','Dashboard','resourceId','forEach','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x4d52e6,_0x40d3ea){_0x4d52e6=_0x4d52e6-0x0;var _0x3646c6=_0x8ff9[_0x4d52e6];return _0x3646c6;};'use strict';var emlformat=require(_0x98ff('0x0'));var rimraf=require(_0x98ff('0x1'));var zipdir=require(_0x98ff('0x2'));var jsonpatch=require(_0x98ff('0x3'));var rp=require(_0x98ff('0x4'));var moment=require(_0x98ff('0x5'));var BPromise=require(_0x98ff('0x6'));var Mustache=require(_0x98ff('0x7'));var util=require(_0x98ff('0x8'));var path=require(_0x98ff('0x9'));var sox=require(_0x98ff('0xa'));var csv=require('to-csv');var ejs=require(_0x98ff('0xb'));var fs=require('fs');var fs_extra=require(_0x98ff('0xc'));var _=require(_0x98ff('0xd'));var squel=require(_0x98ff('0xe'));var crypto=require(_0x98ff('0xf'));var jsforce=require(_0x98ff('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x98ff('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x98ff('0x12'));var authService=require(_0x98ff('0x13'));var qs=require(_0x98ff('0x14'));var as=require(_0x98ff('0x15'));var hardwareService=require(_0x98ff('0x16'));var logger=require('../../config/logger')(_0x98ff('0x17'));var utils=require('../../config/utils');var config=require(_0x98ff('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x98ff('0x19')]=_[_0x98ff('0x1a')](config[_0x98ff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x98ff('0x1b'))(new Redis(config['redis']));require(_0x98ff('0x1c'))[_0x98ff('0x1d')](socket);function respondWithStatusCode(_0x2c4e4d,_0x3a7e21){_0x3a7e21=_0x3a7e21||0xcc;return function(_0x2aae4d){if(_0x2aae4d){return _0x2c4e4d[_0x98ff('0x1e')](_0x3a7e21);}return _0x2c4e4d['status'](_0x3a7e21)[_0x98ff('0x1f')]();};}function respondWithResult(_0x196f27,_0xb48c72){_0xb48c72=_0xb48c72||0xc8;return function(_0x5af32){if(_0x5af32){return _0x196f27[_0x98ff('0x20')](_0xb48c72)[_0x98ff('0x21')](_0x5af32);}};}function respondWithFilteredResult(_0x1f3044,_0x33023e){return function(_0x268121){if(_0x268121){var _0x3c04d4=typeof _0x33023e[_0x98ff('0x22')]===_0x98ff('0x23')&&typeof _0x33023e[_0x98ff('0x24')]===_0x98ff('0x23');var _0x4c235b=_0x268121[_0x98ff('0x25')];var _0x31f525=_0x3c04d4?0x0:_0x33023e[_0x98ff('0x22')];var _0x43fb4f=_0x3c04d4?_0x268121[_0x98ff('0x25')]:_0x33023e[_0x98ff('0x22')]+_0x33023e[_0x98ff('0x24')];var _0x3a6c52;if(_0x43fb4f>=_0x4c235b){_0x43fb4f=_0x4c235b;_0x3a6c52=0xc8;}else{_0x3a6c52=0xce;}_0x1f3044[_0x98ff('0x20')](_0x3a6c52);return _0x1f3044[_0x98ff('0x26')](_0x98ff('0x27'),_0x31f525+'-'+_0x43fb4f+'/'+_0x4c235b)[_0x98ff('0x21')](_0x268121);}return null;};}function patchUpdates(_0x2fdbc2){return function(_0x4ea518){try{jsonpatch['apply'](_0x4ea518,_0x2fdbc2,!![]);}catch(_0x4c6ddc){return BPromise[_0x98ff('0x28')](_0x4c6ddc);}return _0x4ea518[_0x98ff('0x29')]();};}function saveUpdates(_0x547fab,_0xd0293e){return function(_0x58b281){if(_0x58b281){return _0x58b281[_0x98ff('0x2a')](_0x547fab)[_0x98ff('0x2b')](function(_0x308efd){return _0x308efd;});}return null;};}function removeEntity(_0x2b3ee9,_0x4003de){return function(_0x5c1c0c){if(_0x5c1c0c){return _0x5c1c0c['destroy']()[_0x98ff('0x2b')](function(){_0x2b3ee9[_0x98ff('0x20')](0xcc)[_0x98ff('0x1f')]();});}};}function handleEntityNotFound(_0x6ccf21,_0x8b7939){return function(_0x231e00){if(!_0x231e00){_0x6ccf21[_0x98ff('0x1e')](0x194);}return _0x231e00;};}function handleError(_0x28e0a0,_0xda7649){_0xda7649=_0xda7649||0x1f4;return function(_0x25a658){logger['error'](_0x25a658[_0x98ff('0x2c')]);if(_0x25a658[_0x98ff('0x2d')]){delete _0x25a658[_0x98ff('0x2d')];}_0x28e0a0[_0x98ff('0x20')](_0xda7649)[_0x98ff('0x2e')](_0x25a658);};}exports[_0x98ff('0x2f')]=function(_0x17975c,_0x41c093){var _0x42213a={},_0x205d85={},_0x3fa70c={'count':0x0,'rows':[]};var _0x1472cb=_[_0x98ff('0x30')](db[_0x98ff('0x31')][_0x98ff('0x32')],function(_0x81e918){return{'name':_0x81e918[_0x98ff('0x33')],'type':_0x81e918[_0x98ff('0x34')][_0x98ff('0x35')]};});_0x205d85[_0x98ff('0x36')]=_[_0x98ff('0x30')](_0x1472cb,'name');_0x205d85[_0x98ff('0x37')]=_[_0x98ff('0x38')](_0x17975c[_0x98ff('0x37')]);_0x205d85[_0x98ff('0x39')]=_[_0x98ff('0x3a')](_0x205d85['model'],_0x205d85[_0x98ff('0x37')]);_0x42213a['attributes']=_[_0x98ff('0x3a')](_0x205d85[_0x98ff('0x36')],qs[_0x98ff('0x3b')](_0x17975c[_0x98ff('0x37')][_0x98ff('0x3b')]));_0x42213a[_0x98ff('0x3c')]=_0x42213a[_0x98ff('0x3c')][_0x98ff('0x3d')]?_0x42213a[_0x98ff('0x3c')]:_0x205d85[_0x98ff('0x36')];if(!_0x17975c['query'][_0x98ff('0x3e')](_0x98ff('0x3f'))){_0x42213a[_0x98ff('0x24')]=qs[_0x98ff('0x24')](_0x17975c[_0x98ff('0x37')][_0x98ff('0x24')]);_0x42213a[_0x98ff('0x22')]=qs[_0x98ff('0x22')](_0x17975c['query'][_0x98ff('0x22')]);}_0x42213a['order']=qs[_0x98ff('0x40')](_0x17975c[_0x98ff('0x37')][_0x98ff('0x40')]);_0x42213a[_0x98ff('0x41')]=qs[_0x98ff('0x39')](_['pick'](_0x17975c['query'],_0x205d85[_0x98ff('0x39')]),_0x1472cb);if(_0x17975c[_0x98ff('0x37')][_0x98ff('0x42')]){_0x42213a[_0x98ff('0x41')]=_[_0x98ff('0x43')](_0x42213a[_0x98ff('0x41')],{'$or':_[_0x98ff('0x30')](_0x1472cb,function(_0x55286f){if(_0x55286f[_0x98ff('0x34')]!==_0x98ff('0x44')){var _0x2ef081={};_0x2ef081[_0x55286f[_0x98ff('0x2d')]]={'$like':'%'+_0x17975c[_0x98ff('0x37')][_0x98ff('0x42')]+'%'};return _0x2ef081;}})});}_0x42213a=_[_0x98ff('0x43')]({},_0x42213a,_0x17975c['options']);var _0x2c6ea8={'where':_0x42213a[_0x98ff('0x41')]};return db[_0x98ff('0x31')][_0x98ff('0x25')](_0x2c6ea8)[_0x98ff('0x2b')](function(_0x5d8c45){_0x3fa70c['count']=_0x5d8c45;if(_0x17975c[_0x98ff('0x37')]['includeAll']){_0x42213a[_0x98ff('0x45')]=[{'all':!![]}];}return db[_0x98ff('0x31')][_0x98ff('0x46')](_0x42213a);})[_0x98ff('0x2b')](function(_0x4208f5){_0x3fa70c[_0x98ff('0x47')]=_0x4208f5;return _0x3fa70c;})['then'](respondWithFilteredResult(_0x41c093,_0x42213a))['catch'](handleError(_0x41c093,null));};exports[_0x98ff('0x48')]=function(_0x4f2be4,_0x1507d1){var _0x61d31d={'raw':![],'where':{'id':_0x4f2be4[_0x98ff('0x49')]['id']}},_0xd3c5b0={};_0xd3c5b0[_0x98ff('0x36')]=_[_0x98ff('0x38')](db['UserProfile'][_0x98ff('0x32')]);_0xd3c5b0[_0x98ff('0x37')]=_[_0x98ff('0x38')](_0x4f2be4['query']);_0xd3c5b0[_0x98ff('0x39')]=_[_0x98ff('0x3a')](_0xd3c5b0[_0x98ff('0x36')],_0xd3c5b0[_0x98ff('0x37')]);_0x61d31d[_0x98ff('0x3c')]=_[_0x98ff('0x3a')](_0xd3c5b0[_0x98ff('0x36')],qs[_0x98ff('0x3b')](_0x4f2be4[_0x98ff('0x37')][_0x98ff('0x3b')]));_0x61d31d[_0x98ff('0x3c')]=_0x61d31d[_0x98ff('0x3c')][_0x98ff('0x3d')]?_0x61d31d[_0x98ff('0x3c')]:_0xd3c5b0[_0x98ff('0x36')];if(_0x4f2be4[_0x98ff('0x37')]['includeAll']){_0x61d31d['include']=[{'all':!![]}];}_0x61d31d=_[_0x98ff('0x43')]({},_0x61d31d,_0x4f2be4['options']);return db[_0x98ff('0x31')][_0x98ff('0x4a')](_0x61d31d)[_0x98ff('0x2b')](handleEntityNotFound(_0x1507d1,null))[_0x98ff('0x2b')](respondWithResult(_0x1507d1,null))[_0x98ff('0x4b')](handleError(_0x1507d1,null));};exports[_0x98ff('0x4c')]=function(_0x4596f5,_0x3eb900){return db[_0x98ff('0x31')]['create'](_0x4596f5[_0x98ff('0x4d')],{})['then'](respondWithResult(_0x3eb900,0xc9))[_0x98ff('0x4b')](handleError(_0x3eb900,null));};exports[_0x98ff('0x4e')]=function(_0x5e3283,_0x1e62ec){var _0x35cda7={'where':{'id':_0x5e3283[_0x98ff('0x49')]['id']}},_0x55c04f={};_0x55c04f[_0x98ff('0x36')]=_['keys'](db[_0x98ff('0x31')][_0x98ff('0x32')]);_0x35cda7[_0x98ff('0x3c')]=_[_0x98ff('0x3a')](_0x55c04f[_0x98ff('0x36')],qs[_0x98ff('0x3b')](_0x5e3283['query'][_0x98ff('0x3b')]));_0x35cda7[_0x98ff('0x3c')]=_0x35cda7[_0x98ff('0x3c')][_0x98ff('0x3d')]?_0x35cda7[_0x98ff('0x3c')]:_0x55c04f[_0x98ff('0x36')];if(_0x5e3283[_0x98ff('0x37')][_0x98ff('0x4f')]){_0x35cda7[_0x98ff('0x45')]=[{'all':!![]}];}_0x35cda7=_[_0x98ff('0x43')]({},_0x35cda7,_0x5e3283[_0x98ff('0x50')]);return db['UserProfile']['find'](_0x35cda7)[_0x98ff('0x2b')](handleEntityNotFound(_0x1e62ec,null))[_0x98ff('0x2b')](function(_0x3fe60f){if(_0x3fe60f){var _0x2b9789=_0x3fe60f[_0x98ff('0x51')]({'plain':!![]});_0x2b9789=qs[_0x98ff('0x52')](_0x2b9789,['id',_0x98ff('0x53'),_0x98ff('0x54'),_0x98ff('0x55')]);_0x5e3283['body']=_[_0x98ff('0x52')](_0x5e3283[_0x98ff('0x4d')],['id',_0x98ff('0x53'),_0x98ff('0x54')]);return db[_0x98ff('0x56')][_0x98ff('0x57')](function(_0x407fc8){return db[_0x98ff('0x31')][_0x98ff('0x4c')](_[_0x98ff('0x43')](_0x2b9789,_0x5e3283['body']),{'include':_0x5e3283['query'][_0x98ff('0x4f')]?[{'all':!![]}]:undefined,'transaction':_0x407fc8})[_0x98ff('0x2b')](function(_0x56b10a){var _0x302e7c=_0x56b10a['get']({'plain':!![]});return db['UserProfileSection'][_0x98ff('0x46')]({'where':{'userProfileId':_0x5e3283[_0x98ff('0x49')]['id']},'raw':!![]})['then'](function(_0x4f97c9){if(_0x4f97c9){return BPromise[_0x98ff('0x58')](_0x4f97c9,function(_0x3bb079){return new BPromise(function(_0x3a4ee2,_0x38fc80){if(_0x3bb079[_0x98ff('0x59')]===null||_0x3bb079['autoAssociation']===0x1)_0x3a4ee2(null);return db[_0x98ff('0x5a')][_0x98ff('0x46')]({'where':{'sectionId':_0x3bb079['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0xa794c4){var _0x23479a=_[_0x98ff('0x30')](_0xa794c4,function(_0x595e5a){return qs['omit'](_0x595e5a,['id',_0x98ff('0x53'),_0x98ff('0x54'),_0x98ff('0x5b')]);});_0x3a4ee2(_0x23479a);})['catch'](function(_0x3abd71){_0x38fc80(_0x3abd71);});})[_0x98ff('0x2b')](function(_0x717195){var _0xc88fee=qs[_0x98ff('0x52')](_0x3bb079,['id',_0x98ff('0x53'),_0x98ff('0x54')]);_0xc88fee[_0x98ff('0x5c')]=_0x302e7c['id'];if(_0x717195)_0xc88fee['Resources']=_0x717195;return _0xc88fee;})[_0x98ff('0x2b')](function(_0x1d3bf6){return db['UserProfileSection'][_0x98ff('0x4c')](_0x1d3bf6,{'include':[{'model':db[_0x98ff('0x5a')],'as':_0x98ff('0x5d')}],'raw':!![],'transaction':_0x407fc8});});})[_0x98ff('0x2b')](function(){return _0x302e7c;});}});});});}})['then'](respondWithResult(_0x1e62ec,0xc9))[_0x98ff('0x4b')](handleError(_0x1e62ec,null));};exports['update']=function(_0x488d84,_0x1d28d7){if(_0x488d84[_0x98ff('0x4d')]['id']){delete _0x488d84[_0x98ff('0x4d')]['id'];}return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x488d84[_0x98ff('0x49')]['id']}})[_0x98ff('0x2b')](handleEntityNotFound(_0x1d28d7,null))[_0x98ff('0x2b')](saveUpdates(_0x488d84['body'],null))[_0x98ff('0x2b')](respondWithResult(_0x1d28d7,null))[_0x98ff('0x4b')](handleError(_0x1d28d7,null));};exports['destroy']=function(_0x47dde5,_0x54ed73){return db[_0x98ff('0x31')]['find']({'where':{'id':_0x47dde5[_0x98ff('0x49')]['id']}})[_0x98ff('0x2b')](handleEntityNotFound(_0x54ed73,null))[_0x98ff('0x2b')](removeEntity(_0x54ed73,null))[_0x98ff('0x4b')](handleError(_0x54ed73,null));};exports[_0x98ff('0x5e')]=function(_0x3960e2,_0x1e5937){return db[_0x98ff('0x31')][_0x98ff('0x5e')]()[_0x98ff('0x2b')](respondWithResult(_0x1e5937,null))[_0x98ff('0x4b')](handleError(_0x1e5937,null));};exports[_0x98ff('0x5f')]=function(_0x46dfad,_0x4f27ed){var _0x1fe438=_0x46dfad['body'];return db[_0x98ff('0x31')]['find']({'where':{'id':_0x46dfad[_0x98ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f27ed,null))[_0x98ff('0x2b')](function(_0x41e465){if(_0x41e465){return db[_0x98ff('0x56')][_0x98ff('0x57')](function(_0x580d9a){return db[_0x98ff('0x60')][_0x98ff('0x61')]({'where':{'userProfileId':_0x46dfad[_0x98ff('0x49')]['id'],'sectionId':_[_0x98ff('0x30')](_0x1fe438,function(_0x531a4d){return _0x531a4d['sectionId'];})},'transaction':_0x580d9a})['then'](function(){var _0x200064=_[_0x98ff('0x30')](_0x1fe438,function(_0x13e386){_0x13e386[_0x98ff('0x5c')]=_0x46dfad[_0x98ff('0x49')]['id'];return _0x13e386;});var _0x4bc79f=[];return BPromise[_0x98ff('0x58')](_0x200064,function(_0x426979){return db[_0x98ff('0x60')][_0x98ff('0x4c')](_0x426979,{'include':[{'model':db[_0x98ff('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x580d9a})[_0x98ff('0x2b')](function(_0x5c887c){_0x4bc79f['push'](_0x5c887c[_0x98ff('0x51')]({'plain':!![]}));});})[_0x98ff('0x2b')](function(){return _0x4bc79f;});});});}})[_0x98ff('0x2b')](function(_0x3e5572){return _0x3e5572;})[_0x98ff('0x2b')](respondWithResult(_0x4f27ed,null))['catch'](handleError(_0x4f27ed,null));};exports[_0x98ff('0x62')]=function(_0x5f197d,_0x5302ac){var _0x321f61;return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x5f197d['params']['id']},'attributes':['id',_0x98ff('0x2d')]})[_0x98ff('0x2b')](handleEntityNotFound(_0x5302ac,null))[_0x98ff('0x2b')](function(_0x3f78a7){if(_0x3f78a7){_0x321f61=_0x3f78a7;return db[_0x98ff('0x60')][_0x98ff('0x61')]({'where':{'userProfileId':_0x5f197d[_0x98ff('0x49')]['id'],'sectionId':_0x5f197d['query'][_0x98ff('0x63')]}});}})['then'](function(){return _0x321f61;})['then'](respondWithStatusCode(_0x5302ac,null))[_0x98ff('0x4b')](handleError(_0x5302ac,null));};exports[_0x98ff('0x64')]=function(_0x460bed,_0x1af88c){var _0x1ccae4=[];var _0x3d9333=[];return db[_0x98ff('0x60')][_0x98ff('0x46')]({'where':{'userProfileId':_0x460bed[_0x98ff('0x49')]['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x5efbdc){_0x1ccae4=_[_0x98ff('0x42')](_0x5efbdc,function(_0xf01703){return _0xf01703[_0x98ff('0x65')]===0x1||_['includes']([0x3eb,0x709],_0xf01703[_0x98ff('0x5b')]);});if(!_[_0x98ff('0x66')](_0x1ccae4)){return _[_0x98ff('0x30')](_0x1ccae4,function(_0x5b9d87){return _0x5b9d87[_0x98ff('0x5b')];});}else{return;}})[_0x98ff('0x2b')](function(_0x41ca49){if(_0x41ca49)_0x3d9333=_0x41ca49;if(_[_0x98ff('0x67')](_0x3d9333,0x64)){var _0x184005=_[_0x98ff('0x4a')](_0x1ccae4,{'sectionId':0x64});return hasDefaultDashboard(_0x184005)[_0x98ff('0x2b')](function(_0x93ea98){return _['map'](_0x1ccae4,function(_0xee17ca){if(_0xee17ca[_0x98ff('0x5b')]===0x64){_0xee17ca[_0x98ff('0x68')]=_0x93ea98;}return _0xee17ca;});});}else{return;}})['then'](function(_0x5c388c){if(_0x5c388c)_0x1ccae4=_0x5c388c;if(_['includes'](_0x3d9333,0x3eb)){var _0x48dcb5=_['find'](_0x1ccae4,{'sectionId':0x3eb});return getCustomDashboards(_0x48dcb5)[_0x98ff('0x2b')](function(_0x34bf7d){return _[_0x98ff('0x30')](_0x1ccae4,function(_0x7f7a01){if(_0x48dcb5[_0x98ff('0x65')]){if(_0x7f7a01[_0x98ff('0x5b')]===0x3eb){_0x7f7a01['subsections']=_0x34bf7d;}}else{if(_0x7f7a01[_0x98ff('0x5b')]===0x64){_0x7f7a01[_0x98ff('0x68')]=_0x34bf7d;}}return _0x7f7a01;});});}else{return;}})[_0x98ff('0x2b')](function(_0x5e90f7){if(_0x5e90f7)_0x1ccae4=_0x5e90f7;if(_['includes'](_0x3d9333,0x709)){var _0x591239=_[_0x98ff('0x4a')](_0x1ccae4,{'sectionId':0x709});return getPlugins(_0x591239)['then'](function(_0xa5f58a){if(_0x591239[_0x98ff('0x65')]){return _[_0x98ff('0x30')](_0x1ccae4,function(_0x46ebbf){if(_0x46ebbf['sectionId']===0x709){_0x46ebbf['subsections']=_0xa5f58a;}return _0x46ebbf;});}else{var _0x4b7100={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa5f58a};var _0x538497=_[_0x98ff('0x30')](_0x1ccae4);_0x538497[_0x98ff('0x69')](_0x4b7100);return _0x538497;}});}else{return;}})[_0x98ff('0x2b')](function(_0x8a790a){if(_0x8a790a)_0x1ccae4=_0x8a790a;return _[_0x98ff('0x42')](_0x1ccae4,[_0x98ff('0x65'),0x1]);})[_0x98ff('0x2b')](respondWithResult(_0x1af88c,null))['catch'](handleError(_0x1af88c,null));};function hasDefaultDashboard(_0x348833){var _0x4ba137=[0x65];return new BPromise(function(_0x3a0faa,_0x50fda4){try{if(_0x348833[_0x98ff('0x59')]){_0x3a0faa(_0x4ba137);}else{return db['UserProfileResource'][_0x98ff('0x6a')]({'where':{'sectionId':_0x348833['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x4c3c62){_0x4c3c62?_0x3a0faa(_0x4ba137):_0x3a0faa();});}}catch(_0x528cb3){_0x50fda4(_0x528cb3);}});}function getCustomDashboards(_0x39fab1){var _0x527d68=[];return new BPromise(function(_0x2bc84f,_0x358fb6){try{if(_0x39fab1[_0x98ff('0x59')]){return db[_0x98ff('0x6b')][_0x98ff('0x46')]({'raw':!![]})[_0x98ff('0x2b')](function(_0x5cd834){_0x5cd834['forEach'](function(_0x61dcdf){_0x527d68[_0x98ff('0x69')](_0x61dcdf['id']+0x1869f);});_0x2bc84f(_0x527d68);});}else{return db[_0x98ff('0x5a')][_0x98ff('0x46')]({'where':{'sectionId':_0x39fab1['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x10da98){_0x10da98['forEach'](function(_0x4c8899){_0x527d68[_0x98ff('0x69')](_0x4c8899[_0x98ff('0x6c')]+0x1869f);});_0x2bc84f(_0x527d68);});}}catch(_0x8b1ee1){_0x358fb6(_0x8b1ee1);}});}function getPlugins(_0x7be72c){var _0x468157=[];return new BPromise(function(_0x30de9b,_0x1f7537){try{if(_0x7be72c[_0x98ff('0x59')]){return db['Plugin'][_0x98ff('0x46')]({'raw':!![]})['then'](function(_0x2bd7a7){_0x2bd7a7[_0x98ff('0x6d')](function(_0x58532b){_0x468157[_0x98ff('0x69')](_0x58532b['id']+0x15b38);});_0x30de9b(_0x468157);});}else{return db[_0x98ff('0x5a')][_0x98ff('0x46')]({'where':{'sectionId':_0x7be72c['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x45890c){_0x45890c[_0x98ff('0x6d')](function(_0x1f3345){_0x468157[_0x98ff('0x69')](_0x1f3345[_0x98ff('0x6c')]+0x15b38);});_0x30de9b(_0x468157);});}}catch(_0x106f0b){_0x1f7537(_0x106f0b);}});}exports[_0x98ff('0x6e')]=function(_0x541994,_0x4eeeea){return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x541994['params']['id']}})['then'](handleEntityNotFound(_0x4eeeea,null))['then'](function(_0x553df4){if(_0x553df4){return db[_0x98ff('0x56')][_0x98ff('0x57')](function(_0x3a337b){return db[_0x98ff('0x60')][_0x98ff('0x46')]({'where':{'userProfileId':_0x541994[_0x98ff('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x98ff('0x2b')](function(_0x436859){if(_0x436859){return db[_0x98ff('0x60')][_0x98ff('0x61')]({'where':{'userProfileId':_0x541994['params']['id'],'id':_[_0x98ff('0x30')](_0x436859,function(_0x3a51b2){return _0x3a51b2['id'];})},'transaction':_0x3a337b});}})[_0x98ff('0x2b')](function(_0x19be95){var _0x5eaeb8=_[_0x98ff('0x30')](_0x541994[_0x98ff('0x4d')],function(_0x5b3aa0){_0x5b3aa0[_0x98ff('0x5c')]=_0x541994[_0x98ff('0x49')]['id'];return _0x5b3aa0;});return db['UserProfileSection'][_0x98ff('0x6f')](_0x5eaeb8,{'raw':!![],'transaction':_0x3a337b});})[_0x98ff('0x2b')](function(_0x150b27){var _0x2e12c6=_[_0x98ff('0x42')](_[_0x98ff('0x30')](_0x150b27,function(_0x552d36){return _0x552d36[_0x98ff('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x2e12c6){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x541994[_0x98ff('0x49')]['id'],'sectionId':_[_0x98ff('0x30')](_0x2e12c6,function(_0x8d939c){return _0x8d939c['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x98ff('0x2b')](function(_0x306f88){var _0xfbf24f=_[_0x98ff('0x30')](_0x541994[_0x98ff('0x4d')],function(_0x435b95){_0x435b95[_0x98ff('0x5c')]=_0x541994[_0x98ff('0x49')]['id'];return _0x435b95;});return db[_0x98ff('0x5a')]['bulkCreate'](_0xfbf24f,{'raw':!![],'transaction':_0x3a337b});});}})['catch'](handleError(_0x4eeeea,null));});}})['then'](function(_0x222765){var _0x16b43c=_[_0x98ff('0x30')](_0x222765,function(_0x2b631d){return _0x2b631d[_0x98ff('0x51')]({'plain':!![]});});})[_0x98ff('0x2b')](respondWithResult(_0x4eeeea,null))[_0x98ff('0x4b')](handleError(_0x4eeeea,null));};exports['removeResources']=function(_0x80d1e8,_0x2f7370,_0x4fb094){return db['UserProfile'][_0x98ff('0x4a')]({'where':{'id':_0x80d1e8['params']['id']}})['then'](handleEntityNotFound(_0x2f7370,null))[_0x98ff('0x2b')](function(_0xac0688){if(_0xac0688){return _0xac0688[_0x98ff('0x70')](_0x80d1e8['query'][_0x98ff('0x63')]);}})[_0x98ff('0x2b')](respondWithStatusCode(_0x2f7370,null))[_0x98ff('0x4b')](handleError(_0x2f7370,null));};exports[_0x98ff('0x71')]=function(_0x4931aa,_0x5b0d37){var _0x33db1d={};if(!_0x4931aa['query'][_0x98ff('0x72')])throw new Error(_0x98ff('0x73'));if(!_0x4931aa['query'][_0x98ff('0x3e')](_0x98ff('0x3f'))){_0x33db1d[_0x98ff('0x24')]=qs['limit'](_0x4931aa[_0x98ff('0x37')][_0x98ff('0x24')]);_0x33db1d['offset']=qs[_0x98ff('0x22')](_0x4931aa[_0x98ff('0x37')][_0x98ff('0x22')]);}return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x4931aa[_0x98ff('0x49')]['id']}})[_0x98ff('0x2b')](function(_0x40d35d){if(!_0x40d35d)throw new Error(_0x98ff('0x74')+_0x4931aa[_0x98ff('0x49')]['id']);return db[_0x98ff('0x31')][_0x98ff('0x71')](_0x4931aa);})[_0x98ff('0x2b')](respondWithFilteredResult(_0x5b0d37,_0x33db1d))['catch'](handleError(_0x5b0d37,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b3887d6..9c7c480 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 _0x9e8a=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9e8a,0x112));var _0xa9e8=function(_0xc542a4,_0xee726a){_0xc542a4=_0xc542a4-0x0;var _0x33341b=_0x9e8a[_0xc542a4];return _0x33341b;};'use strict';var EventEmitter=require(_0xa9e8('0x0'));var UserProfile=require(_0xa9e8('0x1'))['db'][_0xa9e8('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa9e8('0x3')](0x0);var events={'afterCreate':_0xa9e8('0x4'),'afterUpdate':_0xa9e8('0x5'),'afterDestroy':_0xa9e8('0x6')};function emitEvent(_0x337024){return function(_0xe3b2c8,_0x57736c,_0x4f9ddb){UserProfileEvents['emit'](_0x337024+':'+_0xe3b2c8['id'],_0xe3b2c8);UserProfileEvents['emit'](_0x337024,_0xe3b2c8);_0x4f9ddb(null);};}for(var e in events){if(events[_0xa9e8('0x7')](e)){var event=events[e];UserProfile[_0xa9e8('0x8')](e,emitEvent(event));}}module[_0xa9e8('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x8aad=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3b990a,_0x57610f){var _0x6b3a5f=function(_0x3b0a7b){while(--_0x3b0a7b){_0x3b990a['push'](_0x3b990a['shift']());}};_0x6b3a5f(++_0x57610f);}(_0x8aad,0x146));var _0xd8aa=function(_0x2b3706,_0x418b2b){_0x2b3706=_0x2b3706-0x0;var _0x494571=_0x8aad[_0x2b3706];return _0x494571;};'use strict';var EventEmitter=require(_0xd8aa('0x0'));var UserProfile=require(_0xd8aa('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd8aa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd8aa('0x3'),'afterDestroy':_0xd8aa('0x4')};function emitEvent(_0x5f2e0a){return function(_0x4a4235,_0x401aef,_0x59804a){UserProfileEvents['emit'](_0x5f2e0a+':'+_0x4a4235['id'],_0x4a4235);UserProfileEvents[_0xd8aa('0x5')](_0x5f2e0a,_0x4a4235);_0x59804a(null);};}for(var e in events){if(events[_0xd8aa('0x6')](e)){var event=events[e];UserProfile[_0xd8aa('0x7')](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 5a692f4..1feaad8 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 _0xe8de=['WhatsappAccount','Team','queuecampaigns','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','Pause','scheduler','Schedule','tags','Tag','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','Reports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','InteractionId','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','params','ignore','length','find','autoAssociation','model','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','Tags','ThroughTags','color','tag','openTabs','true','chat','sms','fax','dataValues','openchannel','whatsapp','lodash','../../components/parsers/qs','exports','models','filter','value','findAll','associatedResources','map','catch','then','field','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','User','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','whatsappqueues'];(function(_0x3e31b7,_0x2bd6e5){var _0xe94a0=function(_0x20bf2f){while(--_0x20bf2f){_0x3e31b7['push'](_0x3e31b7['shift']());}};_0xe94a0(++_0x2bd6e5);}(_0xe8de,0x132));var _0xee8d=function(_0x1dcf85,_0x3c6f78){_0x1dcf85=_0x1dcf85-0x0;var _0x4f4b12=_0xe8de[_0x1dcf85];return _0x4f4b12;};'use strict';var _=require(_0xee8d('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xee8d('0x1'));var squel=require('squel');module[_0xee8d('0x2')]=function(_0x214360){var _0xb9c8d8=_0x214360[_0xee8d('0x3')];function _0x143ceb(_0x38224b,_0x575ae7){return new Promise(function(_0x13bf77,_0x1ddfd5){if(!_0x575ae7)return _0x13bf77(null);var _0x165bee=_0x575ae7[_0xee8d('0x4')]?{[_0x575ae7[_0xee8d('0x4')]['field']]:_0x575ae7[_0xee8d('0x4')][_0xee8d('0x5')]}:undefined;return _0xb9c8d8[_0x38224b][_0xee8d('0x6')]({'where':_0x165bee,'raw':!![]})['then'](function(_0x3c3eca){_0x575ae7[_0xee8d('0x7')]=_[_0xee8d('0x8')](_0x3c3eca,'id');_0x13bf77(_0x575ae7);})[_0xee8d('0x9')](function(_0x450150){_0x1ddfd5(_0x450150);});});}function _0x7d372b(_0x28bb57,_0x29704b){return new Promise(function(_0x1342bc,_0x2b717d){var _0x2bfc25=_0x28bb57['filter']?{[_0x28bb57[_0xee8d('0x4')]['field']]:_0x28bb57[_0xee8d('0x4')]['value']}:undefined;return _0xb9c8d8[_0x28bb57['model']]['findAll']({'where':_0x2bfc25,'raw':!![]})[_0xee8d('0xa')](function(_0xfc488a){_0x29704b[_0xee8d('0x7')]=_[_0xee8d('0x8')](_0xfc488a,function(_0x4aca90){return _0x4aca90['name'];});_0x1342bc(_0x29704b);})[_0xee8d('0x9')](function(_0x135e7d){_0x2b717d(_0x135e7d);});});}function _0x2e982b(_0x3d094f,_0x56bab2,_0xdc48ed){if(!_0x56bab2)return Promise['resolve'](null);return new Promise(function(_0x45db8f,_0x514170){return _0xb9c8d8['UserProfileResource']['findAll']({'where':{'sectionId':_0x56bab2['id']},'raw':!![]})['then'](function(_0x4b9070){if(_0x3d094f[_0xee8d('0xb')]&&_0x3d094f[_0xee8d('0xb')]!=='id'){_0x56bab2['associatedResources']=_[_0xee8d('0x8')](_0x4b9070,function(_0x3a9d50){return _0x3a9d50[_0x3d094f['field']];});}else{if(_0xdc48ed===_0xee8d('0xc')){_0x56bab2[_0xee8d('0x7')]=_['map'](_0x4b9070,function(_0x5b4d1){return{'id':_0x5b4d1[_0xee8d('0xd')],'type':_0x5b4d1['type']};});}else{_0x56bab2[_0xee8d('0x7')]=_[_0xee8d('0x8')](_0x4b9070,function(_0x4b6083){return _0x4b6083[_0xee8d('0xd')];});}}_0x45db8f(_0x56bab2);})[_0xee8d('0x9')](function(_0x38db71){_0x514170(_0x38db71);});});}function _0x22bdb5(_0x73e5d6,_0x11f8a3){var _0x53edaf={'parentSections':[]};switch(_0x73e5d6[_0xee8d('0xe')]()){case _0xee8d('0xf'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x11');break;case _0xee8d('0x12'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x13');break;case _0xee8d('0x14'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x15');_0x53edaf[_0xee8d('0x16')]=[{'name':_0xee8d('0x17'),'field':_0xee8d('0x18'),'foreignKey':_0xee8d('0x19')}];break;case _0xee8d('0x1a'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x1b');break;case _0xee8d('0x1c'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x1d');_0x53edaf[_0xee8d('0x16')]=[{'name':_0xee8d('0x1e'),'field':'id','foreignKey':_0xee8d('0x1f')}];break;case _0xee8d('0x20'):_0x53edaf['childModel']=_0xee8d('0x21');break;case _0xee8d('0x22'):_0x53edaf['childModel']=_0xee8d('0x23');break;case'globalcustomfields':_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x24');break;case _0xee8d('0x25'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x26');break;case _0xee8d('0x27'):_0x53edaf[_0xee8d('0x10')]='ChatWebsite';break;case _0xee8d('0x28'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x29');break;case _0xee8d('0x2a'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x2b');break;case _0xee8d('0x2c'):case _0xee8d('0x2d'):case _0xee8d('0x2e'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x2f');break;case _0xee8d('0x30'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x31');break;case _0xee8d('0x32'):_0x53edaf[_0xee8d('0x10')]='VoiceMail';break;case _0xee8d('0x33'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x34');_0x53edaf[_0xee8d('0x16')]=[{'name':_0xee8d('0x35'),'field':_0xee8d('0x18'),'foreignKey':'membername','model':_0xee8d('0x36'),'filter':{'field':'role','value':['agent']}},{'name':_0xee8d('0x37'),'field':_0xee8d('0x18'),'foreignKey':'membername','model':'User','filter':{'field':_0xee8d('0x38'),'value':[_0xee8d('0x39')]}},{'name':_0xee8d('0x3a'),'field':'name','foreignKey':_0xee8d('0x3b'),'model':_0xee8d('0x3c'),'filter':{'field':_0xee8d('0x3d'),'value':[_0xee8d('0x3e')]}},{'name':_0xee8d('0x3f'),'field':_0xee8d('0x18'),'foreignKey':'queue','model':_0xee8d('0x3c'),'filter':{'field':_0xee8d('0x3d'),'value':['outbound']}}];break;case _0xee8d('0x40'):_0x53edaf['childModel']=_0xee8d('0x41');break;case'chanspies':_0x53edaf['childModel']=_0xee8d('0x42');break;case _0xee8d('0x43'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x44');break;case'ivrcampaigns':_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x45');break;case'mailqueues':_0x53edaf['childModel']='MailQueue';break;case'mailaccounts':_0x53edaf['childModel']=_0xee8d('0x46');break;case _0xee8d('0x47'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x48');break;case _0xee8d('0x49'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x4a');break;case _0xee8d('0x4b'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x4c');break;case'smsqueues':_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x4d');break;case'smsaccounts':_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x4e');break;case _0xee8d('0x4f'):_0x53edaf[_0xee8d('0x10')]='WhatsappQueue';break;case'whatsappaccounts':_0x53edaf['childModel']=_0xee8d('0x50');break;case'teams':_0x53edaf['childModel']=_0xee8d('0x51');break;case'voicequeues':case _0xee8d('0x52'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x3c');if(_0x11f8a3){_0x53edaf[_0xee8d('0x16')]=[{'name':'VoiceQueues'},{'name':_0xee8d('0x3f')}];}break;case'users':case _0xee8d('0x53'):case _0xee8d('0x54'):_0x53edaf['childModel']=_0xee8d('0x36');if(_0x11f8a3){_0x53edaf['parentSections']=[{'name':_0xee8d('0x55'),'filter':{'field':_0xee8d('0x38'),'value':[_0xee8d('0x56'),_0xee8d('0x57')]},'ignore':!![]},{'name':_0xee8d('0x35')},{'name':'Telephones'}];}break;case _0xee8d('0x58'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x59');break;case _0xee8d('0x5a'):_0x53edaf[_0xee8d('0x10')]='SalesforceAccount';break;case _0xee8d('0x5b'):_0x53edaf['childModel']=_0xee8d('0x5c');break;case _0xee8d('0x5d'):_0x53edaf['childModel']=_0xee8d('0x5e');break;case _0xee8d('0x5f'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x60');break;case _0xee8d('0x61'):_0x53edaf['childModel']=_0xee8d('0x62');break;case'vtigeraccounts':_0x53edaf[_0xee8d('0x10')]='User';break;case'cannedanswers':_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x63');break;case _0xee8d('0x64'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x65');break;case'customdashboards':_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x66');break;case _0xee8d('0x67'):_0x53edaf[_0xee8d('0x10')]='Interval';break;case _0xee8d('0x68'):_0x53edaf['childModel']=_0xee8d('0x69');break;case _0xee8d('0x6a'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x6b');break;case'sounds':_0x53edaf[_0xee8d('0x10')]='Sound';break;case _0xee8d('0x6c'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x6d');break;case _0xee8d('0x6e'):_0x53edaf['childModel']=_0xee8d('0x6f');break;case _0xee8d('0x70'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x71');break;case _0xee8d('0x72'):_0x53edaf[_0xee8d('0x10')]='Trunk';break;case _0xee8d('0x73'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x74');break;case _0xee8d('0x75'):_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x76');break;case'extractedreports':_0x53edaf['childModel']='AnalyticExtractedReport';_0x53edaf['parentSections']=[{'name':_0xee8d('0x77'),'field':'id','foreignKey':_0xee8d('0x78')}];break;case'metrics':_0x53edaf[_0xee8d('0x10')]=_0xee8d('0x79');break;}return _0x53edaf;}function _0x1cdcc7(_0x3f11bb,_0x22335d){var _0x158ae5=_0x3f11bb[_0xee8d('0x7a')](0x0)[_0xee8d('0x7b')]()+_0x3f11bb['slice'](0x1);var _0x1abfe9={'type':_0xb9c8d8[_0xee8d('0x7c')][_0xee8d('0x7d')][_0xee8d('0x7e')],'raw':!![]};return new Promise(function(_0x58777c,_0x5b4aa6){var _0x59712b=squel[_0xee8d('0x7f')]()[_0xee8d('0xb')]('ui.'+_0x158ae5+_0xee8d('0x80'),'id')[_0xee8d('0xb')](_0xee8d('0x81'))['from'](_0xee8d('0x82')+_0x3f11bb+'_interactions','ui')[_0xee8d('0x83')](_0xee8d('0x84'),_0x22335d['id']);return _0xb9c8d8['sequelize'][_0xee8d('0x85')](_0x59712b[_0xee8d('0x86')](),_0x1abfe9)[_0xee8d('0xa')](function(_0x366b5f){_0x22335d[_0x158ae5+_0xee8d('0x87')]=_0x366b5f;_0x58777c(_0x366b5f);})['catch'](function(_0x301985){_0x5b4aa6(_0x301985);});});}return _0x214360[_0xee8d('0x88')](_0xee8d('0x89'),attributes,{'tableName':_0xee8d('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x552e42){var _0x5d3b83={'raw':_0x552e42[_0xee8d('0x85')][_0xee8d('0x8b')],'where':{}};var _0x4458aa={};var _0x170b64={'count':0x0,'rows':[]};var _0x5459a7=_0x552e42['query']['section'];var _0x26295d=_0x552e42[_0xee8d('0x85')]['mergeResources']||![];var _0x2d3b06=_0x22bdb5(_0x5459a7,_0x26295d);if(!_0x2d3b06['childModel'])throw new Error(_0xee8d('0x8c')+_0x5459a7+'\x27');var _0x2f4c5f=[{'name':_0x5459a7}];if(!_[_0xee8d('0x8d')](_0x2d3b06['parentSections']))_0x2f4c5f=_0x2d3b06[_0xee8d('0x16')];var _0x502398=[];for(var _0x4ec712=0x0;_0x4ec712<_0x2f4c5f['length'];_0x4ec712++){_0x502398[_0xee8d('0x8e')](_0xb9c8d8[_0xee8d('0x8f')]['find']({'where':{'userProfileId':_0x552e42[_0xee8d('0x90')]['id'],'name':_0x2f4c5f[_0x4ec712][_0xee8d('0x18')]},'raw':!![]}));}return Promise['all'](_0x502398)[_0xee8d('0xa')](function(_0x2e314c){var _0x868f1e=_[_0xee8d('0x4')](_0x2e314c,function(_0x31c581){return _0x31c581?_0x31c581:undefined;});var _0x25b311=_['filter'](_0x2f4c5f,[_0xee8d('0x91'),!![]]);var _0x397250=_[_0xee8d('0x8d')](_0x868f1e)&&_[_0xee8d('0x8d')](_0x25b311)?null:_['union'](_0x25b311,_0x868f1e);if(!_0x397250)return null;var _0x1b6bad=[];for(var _0x4fb384=0x0;_0x4fb384<_0x397250[_0xee8d('0x92')];_0x4fb384++){var _0x294733=_[_0xee8d('0x93')](_0x2f4c5f,function(_0x1bf2b6){return _0x397250[_0x4fb384]?_0x1bf2b6['name']===_0x397250[_0x4fb384]['name']:null;});if(_0x294733){if(_0x397250[_0x4fb384]['ignore']){_0x1b6bad[_0xee8d('0x8e')](_0x143ceb(_0x2d3b06['childModel'],_0x397250[_0x4fb384]));}else{if(!_0x397250[_0x4fb384][_0xee8d('0x94')]){_0x1b6bad['push'](_0x2e982b(_0x294733,_0x397250[_0x4fb384],_0x2d3b06[_0xee8d('0x10')]));}else{if(_0x294733[_0xee8d('0x95')]){_0x1b6bad[_0xee8d('0x8e')](_0x7d372b(_0x294733,_0x397250[_0x4fb384]));}}}}}return Promise[_0xee8d('0x96')](_0x1b6bad);})[_0xee8d('0xa')](function(_0x2e7ffb){var _0x271bc5=_0x2e7ffb;var _0x3d8c19=null;if(_0x271bc5){_0x3d8c19=_0x271bc5[_0xee8d('0x92')]===0x1?_0x271bc5[0x0]:null;}if(!_0x3d8c19&&!_0x271bc5)return _0x170b64;var _0x31edaa=_0xb9c8d8[_0x2d3b06[_0xee8d('0x10')]][_0xee8d('0x97')];_0x4458aa[_0xee8d('0x95')]=_[_0xee8d('0x98')](_0x31edaa);_0x4458aa[_0xee8d('0x85')]=_['keys'](_0x552e42[_0xee8d('0x85')]);_0x4458aa[_0xee8d('0x99')]=_[_0xee8d('0x9a')](_0x4458aa[_0xee8d('0x95')],_0x4458aa['query']);_0x5d3b83[_0xee8d('0x9b')]=_[_0xee8d('0x9a')](_0x4458aa[_0xee8d('0x95')],qs[_0xee8d('0x9c')](_0x552e42['query']['fields']));_0x5d3b83[_0xee8d('0x9b')]=_0x5d3b83[_0xee8d('0x9b')][_0xee8d('0x92')]?_0x5d3b83[_0xee8d('0x9b')]:_0x4458aa[_0xee8d('0x95')];if(!_0x552e42[_0xee8d('0x85')][_0xee8d('0x9d')](_0xee8d('0x9e'))){_0x5d3b83['limit']=qs[_0xee8d('0x9f')](_0x552e42[_0xee8d('0x85')][_0xee8d('0x9f')]);_0x5d3b83[_0xee8d('0xa0')]=qs['offset'](_0x552e42[_0xee8d('0x85')]['offset']);}_0x5d3b83['order']=qs[_0xee8d('0xa1')](_0x552e42[_0xee8d('0x85')][_0xee8d('0xa1')]);_0x5d3b83[_0xee8d('0x83')]=qs[_0xee8d('0x99')](_[_0xee8d('0xa2')](_0x552e42[_0xee8d('0x85')],_0x4458aa['filters']));if(_0x552e42['query'][_0xee8d('0x4')]){_0x5d3b83[_0xee8d('0x83')]=_['merge'](_0x5d3b83[_0xee8d('0x83')],{'$or':_[_0xee8d('0x8')](_0x31edaa,function(_0x17ee2f){if(_0x17ee2f['type'][_0xee8d('0xa3')]!==_0xee8d('0xa4')){var _0x10927f={};_0x10927f[_0x17ee2f['field']]={'$like':'%'+_0x552e42[_0xee8d('0x85')][_0xee8d('0x4')]+'%'};return _0x10927f;}})});}var _0x37d5ed=[];var _0x319180=null;var _0x486c0a={};if(_0x3d8c19){_0x319180=_['find'](_0x2f4c5f,[_0xee8d('0x18'),_0x3d8c19[_0xee8d('0x18')]]);if(_0x319180[_0xee8d('0xb')]){_0x486c0a={};if(_0x2d3b06['childModel']===_0xee8d('0xc')){_0x486c0a[_0x319180[_0xee8d('0xa5')]]=_['map'](_0x3d8c19[_0xee8d('0x7')],'id');}else{_0x486c0a[_0x319180[_0xee8d('0xa5')]]=_0x3d8c19[_0xee8d('0x7')];}_0x37d5ed[_0xee8d('0x8e')](_0x486c0a);}else{_0x5d3b83[_0xee8d('0x83')]['id']=_0x3d8c19['associatedResources'];}}else{for(var _0xf5a0b7=0x0;_0xf5a0b7<_0x271bc5[_0xee8d('0x92')];_0xf5a0b7++){_0x319180=_[_0xee8d('0x93')](_0x2f4c5f,['name',_0x271bc5[_0xf5a0b7][_0xee8d('0x18')]]);if(_0x319180[_0xee8d('0xb')]){_0x486c0a={};_0x486c0a[_0x319180['foreignKey']]=_0x271bc5[_0xf5a0b7][_0xee8d('0x7')];_0x37d5ed[_0xee8d('0x8e')](_0x486c0a);}else{if(!_0x5d3b83['where']['id'])_0x5d3b83[_0xee8d('0x83')]['id']=[];_0x271bc5[_0xf5a0b7][_0xee8d('0x7')][_0xee8d('0xa6')](function(_0x5bb702){_0x5d3b83['where']['id'][_0xee8d('0x8e')](_0x5bb702);});}}}if(!_[_0xee8d('0x8d')](_0x37d5ed)){_0x5d3b83[_0xee8d('0x83')]=_[_0xee8d('0xa7')](_0x5d3b83[_0xee8d('0x83')],{'$and':{'$or':_0x37d5ed}});}_0x5d3b83=_[_0xee8d('0xa7')]({},_0x5d3b83,_0x552e42[_0xee8d('0xa8')]);if(_0x3d8c19&&!_0x3d8c19[_0xee8d('0x94')]&&_0x2d3b06[_0xee8d('0x10')]==='AnalyticExtractedReport'){if(_0x552e42[_0xee8d('0x85')][_0xee8d('0xa9')]){_0x5d3b83[_0xee8d('0xaa')]=[{'all':!![]}];}return _0xb9c8d8[_0x2d3b06['childModel']]['findAll'](_0x5d3b83)[_0xee8d('0xa')](function(_0x248c6f){var _0x5ddb32=[];_0x248c6f[_0xee8d('0xa6')](function(_0xb8c34f){var _0x1a4001;switch(_0xb8c34f[_0xee8d('0xab')]){case _0xee8d('0xac'):_0x1a4001=_['find'](_0x3d8c19['associatedResources'],function(_0x47c967){return _0x47c967['id']===_0xb8c34f['reportId']&&_0x47c967[_0xee8d('0x3d')]==='DefaultReports';});break;case _0xee8d('0xad'):_0x1a4001=_[_0xee8d('0x93')](_0x3d8c19[_0xee8d('0x7')],function(_0x1254cc){return _0x1254cc['id']===_0xb8c34f[_0xee8d('0x78')]&&_0x1254cc['type']===_0xee8d('0xae');});break;}if(_0x1a4001)_0x5ddb32[_0xee8d('0x8e')](_0xb8c34f);});_0x170b64[_0xee8d('0xaf')]=_0x5ddb32['length'];_0x170b64[_0xee8d('0xb0')]=_0x5ddb32;return _0x170b64;});}else{if(!_[_0xee8d('0x8d')](_0x552e42[_0xee8d('0x85')]['ids'])){_0x5d3b83[_0xee8d('0x83')]['id']=_0x5d3b83[_0xee8d('0x83')]['id']?_['intersection'](_0x5d3b83[_0xee8d('0x83')]['id'],_0x552e42[_0xee8d('0x85')][_0xee8d('0xb1')]):_0x552e42[_0xee8d('0x85')]['ids'];if(_0x552e42[_0xee8d('0x85')][_0xee8d('0xb2')]){_0x5d3b83[_0xee8d('0xb3')]=_0x552e42[_0xee8d('0x85')]['customSorting'];}}if(_0x552e42['query']['extraQueryConditions']){_0x5d3b83['where']=_[_0xee8d('0xa7')](_0x5d3b83[_0xee8d('0x83')],{'$and':_0x552e42[_0xee8d('0x85')][_0xee8d('0xb4')]});}return _0xb9c8d8[_0x2d3b06[_0xee8d('0x10')]][_0xee8d('0xaf')]({'where':_0x5d3b83[_0xee8d('0x83')]})[_0xee8d('0xa')](function(_0x406e80){_0x170b64[_0xee8d('0xaf')]=_0x406e80;if(_0x552e42[_0xee8d('0x85')][_0xee8d('0xa9')]){if(_0x2d3b06[_0xee8d('0x10')]==='CmContact'){_0x5d3b83[_0xee8d('0xaa')]=[{'model':_0xb9c8d8[_0xee8d('0x6d')],'as':_0xee8d('0xb5'),'attributes':['id',_0xee8d('0x18'),'color'],'required':_0x552e42[_0xee8d('0x85')]['tag']?!![]:![]},{'model':_0xb9c8d8['Tag'],'as':_0xee8d('0xb6'),'attributes':['id','name',_0xee8d('0xb7')],'through':_0x552e42[_0xee8d('0x85')]['tag']?{'attributes':[],'where':{'TagId':_0x552e42['query'][_0xee8d('0xb8')]||undefined}}:{},'required':_0x552e42[_0xee8d('0x85')][_0xee8d('0xb8')]?!![]:![]}];}else{_0x5d3b83[_0xee8d('0xaa')]=[{'all':!![]}];}}return _0xb9c8d8[_0x2d3b06['childModel']][_0xee8d('0x6')](_0x5d3b83);})[_0xee8d('0xa')](function(_0x423ab8){_0x170b64[_0xee8d('0xb0')]=_0x423ab8;if(_0x5459a7===_0xee8d('0x35')&&_0x552e42[_0xee8d('0x85')][_0xee8d('0xb9')]===_0xee8d('0xba')){var _0x974dcd=[];for(var _0xb580ce=0x0;_0xb580ce<_0x170b64[_0xee8d('0xb0')][_0xee8d('0x92')];_0xb580ce++){_0x974dcd['push'](_0x1cdcc7(_0xee8d('0xbb'),_0x170b64['rows'][_0xb580ce]['dataValues']));_0x974dcd[_0xee8d('0x8e')](_0x1cdcc7(_0xee8d('0xbc'),_0x170b64[_0xee8d('0xb0')][_0xb580ce]['dataValues']));_0x974dcd['push'](_0x1cdcc7(_0xee8d('0xbd'),_0x170b64[_0xee8d('0xb0')][_0xb580ce][_0xee8d('0xbe')]));_0x974dcd[_0xee8d('0x8e')](_0x1cdcc7('mail',_0x170b64['rows'][_0xb580ce][_0xee8d('0xbe')]));_0x974dcd[_0xee8d('0x8e')](_0x1cdcc7(_0xee8d('0xbf'),_0x170b64[_0xee8d('0xb0')][_0xb580ce][_0xee8d('0xbe')]));_0x974dcd['push'](_0x1cdcc7(_0xee8d('0xc0'),_0x170b64[_0xee8d('0xb0')][_0xb580ce][_0xee8d('0xbe')]));}return Promise['all'](_0x974dcd)[_0xee8d('0xa')](function(){return _0x170b64;});}return _0x170b64;});}});}}});}; \ No newline at end of file +var _0xe05a=['admin','user','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','Schedule','Sound','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','sequelize','toString','define','UserProfile','user_profiles','query','raw','section','mergeResources','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','key','foreignKey','forEach','default','DefaultReports','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','include','Tag','color','tag','ThroughTags','Agents','openTabs','true','dataValues','sms','fax','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','model','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','parentSections','name','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','agent','Telephones','membername','role','telephone','VoiceQueues','queue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','Users'];(function(_0x10644f,_0x39f5fc){var _0x3fcaa0=function(_0x261f80){while(--_0x261f80){_0x10644f['push'](_0x10644f['shift']());}};_0x3fcaa0(++_0x39f5fc);}(_0xe05a,0x128));var _0xae05=function(_0x1a940f,_0x2ae9dd){_0x1a940f=_0x1a940f-0x0;var _0xbb78ce=_0xe05a[_0x1a940f];return _0xbb78ce;};'use strict';var _=require(_0xae05('0x0'));var attributes=require(_0xae05('0x1'));var qs=require(_0xae05('0x2'));var squel=require(_0xae05('0x3'));module[_0xae05('0x4')]=function(_0x4deddf){var _0x2b6ee9=_0x4deddf[_0xae05('0x5')];function _0x1768f2(_0x2e125b,_0x3249d7){return new Promise(function(_0x5e8c7d,_0x8a8827){if(!_0x3249d7)return _0x5e8c7d(null);var _0xa04531=_0x3249d7['filter']?{[_0x3249d7[_0xae05('0x6')][_0xae05('0x7')]]:_0x3249d7['filter'][_0xae05('0x8')]}:undefined;return _0x2b6ee9[_0x2e125b][_0xae05('0x9')]({'where':_0xa04531,'raw':!![]})[_0xae05('0xa')](function(_0x254c64){_0x3249d7[_0xae05('0xb')]=_[_0xae05('0xc')](_0x254c64,'id');_0x5e8c7d(_0x3249d7);})['catch'](function(_0x3793c0){_0x8a8827(_0x3793c0);});});}function _0x55c9fa(_0x4173e5,_0x57fa09){return new Promise(function(_0xf478b1,_0x5407fc){var _0x484225=_0x4173e5[_0xae05('0x6')]?{[_0x4173e5[_0xae05('0x6')][_0xae05('0x7')]]:_0x4173e5[_0xae05('0x6')][_0xae05('0x8')]}:undefined;return _0x2b6ee9[_0x4173e5[_0xae05('0xd')]]['findAll']({'where':_0x484225,'raw':!![]})[_0xae05('0xa')](function(_0x53ec55){_0x57fa09['associatedResources']=_[_0xae05('0xc')](_0x53ec55,function(_0x4fe76f){return _0x4fe76f['name'];});_0xf478b1(_0x57fa09);})[_0xae05('0xe')](function(_0x51d6cd){_0x5407fc(_0x51d6cd);});});}function _0x4a4f1f(_0x581590,_0x57901c,_0x4c077a){if(!_0x57901c)return Promise[_0xae05('0xf')](null);return new Promise(function(_0x38878d,_0xafc70d){return _0x2b6ee9[_0xae05('0x10')][_0xae05('0x9')]({'where':{'sectionId':_0x57901c['id']},'raw':!![]})[_0xae05('0xa')](function(_0x4dc6ce){if(_0x581590[_0xae05('0x7')]&&_0x581590[_0xae05('0x7')]!=='id'){_0x57901c[_0xae05('0xb')]=_[_0xae05('0xc')](_0x4dc6ce,function(_0x54c9a9){return _0x54c9a9[_0x581590[_0xae05('0x7')]];});}else{if(_0x4c077a===_0xae05('0x11')){_0x57901c['associatedResources']=_[_0xae05('0xc')](_0x4dc6ce,function(_0xf880ba){return{'id':_0xf880ba[_0xae05('0x12')],'type':_0xf880ba[_0xae05('0x13')]};});}else{_0x57901c[_0xae05('0xb')]=_['map'](_0x4dc6ce,function(_0x338db0){return _0x338db0[_0xae05('0x12')];});}}_0x38878d(_0x57901c);})[_0xae05('0xe')](function(_0x298509){_0xafc70d(_0x298509);});});}function _0x548ebe(_0x3c797b,_0x5d8ecb){var _0x1641dc={'parentSections':[]};switch(_0x3c797b[_0xae05('0x14')]()){case _0xae05('0x15'):_0x1641dc['childModel']='SquareProject';break;case'odbc':_0x1641dc[_0xae05('0x16')]=_0xae05('0x17');break;case _0xae05('0x18'):_0x1641dc[_0xae05('0x16')]='SquareRecording';_0x1641dc[_0xae05('0x19')]=[{'name':'SquareProjects','field':_0xae05('0x1a'),'foreignKey':_0xae05('0x1b')}];break;case'projects':_0x1641dc[_0xae05('0x16')]=_0xae05('0x1c');break;case _0xae05('0x1d'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x1e');_0x1641dc['parentSections']=[{'name':_0xae05('0x1f'),'field':'id','foreignKey':_0xae05('0x20')}];break;case _0xae05('0x21'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x22');break;case _0xae05('0x23'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x24');break;case _0xae05('0x25'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x26');break;case _0xae05('0x27'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x28');break;case'chatwebsites':_0x1641dc[_0xae05('0x16')]=_0xae05('0x29');break;case'faxqueues':_0x1641dc[_0xae05('0x16')]=_0xae05('0x2a');break;case _0xae05('0x2b'):_0x1641dc[_0xae05('0x16')]='FaxAccount';break;case _0xae05('0x2c'):case _0xae05('0x2d'):case'outboundroutes':_0x1641dc[_0xae05('0x16')]=_0xae05('0x2e');break;case _0xae05('0x2f'):_0x1641dc['childModel']=_0xae05('0x30');break;case _0xae05('0x31'):_0x1641dc['childModel']=_0xae05('0x32');break;case _0xae05('0x33'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x34');_0x1641dc[_0xae05('0x19')]=[{'name':'Agents','field':_0xae05('0x1a'),'foreignKey':'membername','model':_0xae05('0x35'),'filter':{'field':'role','value':[_0xae05('0x36')]}},{'name':_0xae05('0x37'),'field':_0xae05('0x1a'),'foreignKey':_0xae05('0x38'),'model':_0xae05('0x35'),'filter':{'field':_0xae05('0x39'),'value':[_0xae05('0x3a')]}},{'name':_0xae05('0x3b'),'field':_0xae05('0x1a'),'foreignKey':_0xae05('0x3c'),'model':'VoiceQueue','filter':{'field':_0xae05('0x13'),'value':[_0xae05('0x3d')]}},{'name':_0xae05('0x3e'),'field':_0xae05('0x1a'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0xae05('0x3f')]}}];break;case'musiconholds':_0x1641dc[_0xae05('0x16')]=_0xae05('0x40');break;case _0xae05('0x41'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x42');break;case _0xae05('0x43'):_0x1641dc[_0xae05('0x16')]='VoicePrefix';break;case _0xae05('0x44'):_0x1641dc[_0xae05('0x16')]='Campaign';break;case _0xae05('0x45'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x46');break;case _0xae05('0x47'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x48');break;case'mailsubstatuses':_0x1641dc['childModel']=_0xae05('0x49');break;case _0xae05('0x4a'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x4b');break;case _0xae05('0x4c'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x4d');break;case _0xae05('0x4e'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x4f');break;case _0xae05('0x50'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x51');break;case _0xae05('0x52'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x53');break;case _0xae05('0x54'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x55');break;case _0xae05('0x56'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x57');break;case _0xae05('0x58'):case _0xae05('0x59'):_0x1641dc[_0xae05('0x16')]='VoiceQueue';if(_0x5d8ecb){_0x1641dc[_0xae05('0x19')]=[{'name':_0xae05('0x3b')},{'name':_0xae05('0x3e')}];}break;case _0xae05('0x5a'):case'agents':case'telephones':_0x1641dc[_0xae05('0x16')]='User';if(_0x5d8ecb){_0x1641dc[_0xae05('0x19')]=[{'name':_0xae05('0x5b'),'filter':{'field':_0xae05('0x39'),'value':[_0xae05('0x5c'),_0xae05('0x5d')]},'ignore':!![]},{'name':'Agents'},{'name':_0xae05('0x37')}];}break;case'zendeskaccounts':_0x1641dc[_0xae05('0x16')]=_0xae05('0x5e');break;case _0xae05('0x5f'):_0x1641dc[_0xae05('0x16')]='SalesforceAccount';break;case _0xae05('0x60'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x61');break;case _0xae05('0x62'):_0x1641dc[_0xae05('0x16')]='SugarcrmAccount';break;case'deskaccounts':_0x1641dc[_0xae05('0x16')]=_0xae05('0x63');break;case _0xae05('0x64'):_0x1641dc['childModel']=_0xae05('0x65');break;case _0xae05('0x66'):_0x1641dc['childModel']='User';break;case _0xae05('0x67'):_0x1641dc['childModel']=_0xae05('0x68');break;case _0xae05('0x69'):_0x1641dc['childModel']=_0xae05('0x6a');break;case _0xae05('0x6b'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x6c');break;case _0xae05('0x6d'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x6e');break;case'pauses':_0x1641dc[_0xae05('0x16')]=_0xae05('0x6f');break;case'scheduler':_0x1641dc['childModel']=_0xae05('0x70');break;case'sounds':_0x1641dc[_0xae05('0x16')]=_0xae05('0x71');break;case'tags':_0x1641dc['childModel']='Tag';break;case'templates':_0x1641dc['childModel']=_0xae05('0x72');break;case _0xae05('0x73'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x74');break;case _0xae05('0x75'):_0x1641dc['childModel']='Trunk';break;case _0xae05('0x76'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x77');break;case _0xae05('0x78'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x79');break;case'extractedreports':_0x1641dc[_0xae05('0x16')]=_0xae05('0x11');_0x1641dc[_0xae05('0x19')]=[{'name':_0xae05('0x7a'),'field':'id','foreignKey':_0xae05('0x7b')}];break;case _0xae05('0x7c'):_0x1641dc[_0xae05('0x16')]=_0xae05('0x7d');break;}return _0x1641dc;}function _0x1d90d8(_0x4ae682,_0x57ff07){var _0x11ee75=_0x4ae682[_0xae05('0x7e')](0x0)[_0xae05('0x7f')]()+_0x4ae682[_0xae05('0x80')](0x1);var _0x414861={'type':_0x2b6ee9[_0xae05('0x81')]['QueryTypes'][_0xae05('0x82')],'raw':!![]};return new Promise(function(_0x586b4d,_0xe5ab9d){var _0x32dae2=squel[_0xae05('0x83')]()[_0xae05('0x7')]('ui.'+_0x11ee75+_0xae05('0x84'),'id')[_0xae05('0x7')](_0xae05('0x85'))[_0xae05('0x86')]('user_has_'+_0x4ae682+_0xae05('0x87'),'ui')['where'](_0xae05('0x88'),_0x57ff07['id']);return _0x2b6ee9[_0xae05('0x89')]['query'](_0x32dae2[_0xae05('0x8a')](),_0x414861)[_0xae05('0xa')](function(_0x50d59b){_0x57ff07[_0x11ee75+'OpenTabs']=_0x50d59b;_0x586b4d(_0x50d59b);})['catch'](function(_0x139c67){_0xe5ab9d(_0x139c67);});});}return _0x4deddf[_0xae05('0x8b')](_0xae05('0x8c'),attributes,{'tableName':_0xae05('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1a0831){var _0x4280de={'raw':_0x1a0831[_0xae05('0x8e')][_0xae05('0x8f')],'where':{}};var _0x1693b5={};var _0x4d065d={'count':0x0,'rows':[]};var _0x342eba=_0x1a0831['query'][_0xae05('0x90')];var _0x7374e=_0x1a0831[_0xae05('0x8e')][_0xae05('0x91')]||![];var _0x21a683=_0x548ebe(_0x342eba,_0x7374e);if(!_0x21a683[_0xae05('0x16')])throw new Error('Invalid\x20section\x20\x27'+_0x342eba+'\x27');var _0x4b29a1=[{'name':_0x342eba}];if(!_[_0xae05('0x92')](_0x21a683[_0xae05('0x19')]))_0x4b29a1=_0x21a683[_0xae05('0x19')];var _0x5d9c56=[];for(var _0x491911=0x0;_0x491911<_0x4b29a1[_0xae05('0x93')];_0x491911++){_0x5d9c56[_0xae05('0x94')](_0x2b6ee9['UserProfileSection'][_0xae05('0x95')]({'where':{'userProfileId':_0x1a0831[_0xae05('0x96')]['id'],'name':_0x4b29a1[_0x491911]['name']},'raw':!![]}));}return Promise[_0xae05('0x97')](_0x5d9c56)[_0xae05('0xa')](function(_0x2271a1){var _0x1ba6a3=_['filter'](_0x2271a1,function(_0x280227){return _0x280227?_0x280227:undefined;});var _0x5d058c=_[_0xae05('0x6')](_0x4b29a1,[_0xae05('0x98'),!![]]);var _0x3e774c=_[_0xae05('0x92')](_0x1ba6a3)&&_[_0xae05('0x92')](_0x5d058c)?null:_[_0xae05('0x99')](_0x5d058c,_0x1ba6a3);if(!_0x3e774c)return null;var _0x609345=[];for(var _0x3ac200=0x0;_0x3ac200<_0x3e774c['length'];_0x3ac200++){var _0x5a6417=_[_0xae05('0x95')](_0x4b29a1,function(_0x10afca){return _0x3e774c[_0x3ac200]?_0x10afca[_0xae05('0x1a')]===_0x3e774c[_0x3ac200][_0xae05('0x1a')]:null;});if(_0x5a6417){if(_0x3e774c[_0x3ac200][_0xae05('0x98')]){_0x609345[_0xae05('0x94')](_0x1768f2(_0x21a683[_0xae05('0x16')],_0x3e774c[_0x3ac200]));}else{if(!_0x3e774c[_0x3ac200][_0xae05('0x9a')]){_0x609345[_0xae05('0x94')](_0x4a4f1f(_0x5a6417,_0x3e774c[_0x3ac200],_0x21a683['childModel']));}else{if(_0x5a6417[_0xae05('0xd')]){_0x609345[_0xae05('0x94')](_0x55c9fa(_0x5a6417,_0x3e774c[_0x3ac200]));}}}}}return Promise['all'](_0x609345);})[_0xae05('0xa')](function(_0x5e085b){var _0x9d509f=_0x5e085b;var _0x379df9=null;if(_0x9d509f){_0x379df9=_0x9d509f[_0xae05('0x93')]===0x1?_0x9d509f[0x0]:null;}if(!_0x379df9&&!_0x9d509f)return _0x4d065d;var _0x26c020=_0x2b6ee9[_0x21a683[_0xae05('0x16')]][_0xae05('0x9b')];_0x1693b5['model']=_[_0xae05('0x9c')](_0x26c020);_0x1693b5[_0xae05('0x8e')]=_[_0xae05('0x9c')](_0x1a0831['query']);_0x1693b5[_0xae05('0x9d')]=_[_0xae05('0x9e')](_0x1693b5[_0xae05('0xd')],_0x1693b5[_0xae05('0x8e')]);_0x4280de[_0xae05('0x9f')]=_[_0xae05('0x9e')](_0x1693b5[_0xae05('0xd')],qs[_0xae05('0xa0')](_0x1a0831['query'][_0xae05('0xa0')]));_0x4280de[_0xae05('0x9f')]=_0x4280de[_0xae05('0x9f')]['length']?_0x4280de[_0xae05('0x9f')]:_0x1693b5['model'];if(!_0x1a0831[_0xae05('0x8e')][_0xae05('0xa1')](_0xae05('0xa2'))){_0x4280de['limit']=qs[_0xae05('0xa3')](_0x1a0831[_0xae05('0x8e')][_0xae05('0xa3')]);_0x4280de[_0xae05('0xa4')]=qs['offset'](_0x1a0831[_0xae05('0x8e')]['offset']);}_0x4280de[_0xae05('0xa5')]=qs[_0xae05('0xa6')](_0x1a0831['query'][_0xae05('0xa6')]);_0x4280de[_0xae05('0xa7')]=qs[_0xae05('0x9d')](_[_0xae05('0xa8')](_0x1a0831[_0xae05('0x8e')],_0x1693b5[_0xae05('0x9d')]));if(_0x1a0831[_0xae05('0x8e')][_0xae05('0x6')]){_0x4280de[_0xae05('0xa7')]=_[_0xae05('0xa9')](_0x4280de['where'],{'$or':_[_0xae05('0xc')](_0x26c020,function(_0x23117e){if(_0x23117e[_0xae05('0x13')][_0xae05('0xaa')]!=='VIRTUAL'){var _0x160866={};_0x160866[_0x23117e[_0xae05('0x7')]]={'$like':'%'+_0x1a0831[_0xae05('0x8e')]['filter']+'%'};return _0x160866;}})});}var _0x355737=[];var _0x2f8f6c=null;var _0x5ce7d1={};if(_0x379df9){_0x2f8f6c=_[_0xae05('0x95')](_0x4b29a1,['name',_0x379df9[_0xae05('0x1a')]]);if(_0x2f8f6c[_0xae05('0x7')]){_0x5ce7d1={};if(_0x21a683[_0xae05('0x16')]===_0xae05('0x11')){_0x5ce7d1[_0x2f8f6c[_0xae05('0xab')]]=_[_0xae05('0xc')](_0x379df9[_0xae05('0xb')],'id');}else{_0x5ce7d1[_0x2f8f6c[_0xae05('0xab')]]=_0x379df9[_0xae05('0xb')];}_0x355737[_0xae05('0x94')](_0x5ce7d1);}else{_0x4280de[_0xae05('0xa7')]['id']=_0x379df9['associatedResources'];}}else{for(var _0x58bb8c=0x0;_0x58bb8c<_0x9d509f['length'];_0x58bb8c++){_0x2f8f6c=_[_0xae05('0x95')](_0x4b29a1,[_0xae05('0x1a'),_0x9d509f[_0x58bb8c][_0xae05('0x1a')]]);if(_0x2f8f6c[_0xae05('0x7')]){_0x5ce7d1={};_0x5ce7d1[_0x2f8f6c[_0xae05('0xab')]]=_0x9d509f[_0x58bb8c][_0xae05('0xb')];_0x355737[_0xae05('0x94')](_0x5ce7d1);}else{if(!_0x4280de['where']['id'])_0x4280de[_0xae05('0xa7')]['id']=[];_0x9d509f[_0x58bb8c][_0xae05('0xb')][_0xae05('0xac')](function(_0xaed293){_0x4280de[_0xae05('0xa7')]['id'][_0xae05('0x94')](_0xaed293);});}}}if(!_[_0xae05('0x92')](_0x355737)){_0x4280de[_0xae05('0xa7')]=_[_0xae05('0xa9')](_0x4280de[_0xae05('0xa7')],{'$and':{'$or':_0x355737}});}_0x4280de=_['merge']({},_0x4280de,_0x1a0831['options']);if(_0x379df9&&!_0x379df9[_0xae05('0x9a')]&&_0x21a683['childModel']===_0xae05('0x11')){if(_0x1a0831['query']['includeAll']){_0x4280de['include']=[{'all':!![]}];}return _0x2b6ee9[_0x21a683['childModel']]['findAll'](_0x4280de)[_0xae05('0xa')](function(_0x1ad45b){var _0x325cb6=[];_0x1ad45b['forEach'](function(_0x57aed1){var _0x132959;switch(_0x57aed1['reportType']){case _0xae05('0xad'):_0x132959=_['find'](_0x379df9[_0xae05('0xb')],function(_0x461f1f){return _0x461f1f['id']===_0x57aed1['reportId']&&_0x461f1f[_0xae05('0x13')]===_0xae05('0xae');});break;case'custom':_0x132959=_[_0xae05('0x95')](_0x379df9[_0xae05('0xb')],function(_0xfed334){return _0xfed334['id']===_0x57aed1[_0xae05('0x7b')]&&_0xfed334[_0xae05('0x13')]===_0xae05('0xaf');});break;}if(_0x132959)_0x325cb6[_0xae05('0x94')](_0x57aed1);});_0x4d065d[_0xae05('0xb0')]=_0x325cb6['length'];_0x4d065d[_0xae05('0xb1')]=_0x325cb6;return _0x4d065d;});}else{if(!_[_0xae05('0x92')](_0x1a0831[_0xae05('0x8e')][_0xae05('0xb2')])){_0x4280de['where']['id']=_0x4280de[_0xae05('0xa7')]['id']?_['intersection'](_0x4280de[_0xae05('0xa7')]['id'],_0x1a0831['query']['ids']):_0x1a0831[_0xae05('0x8e')]['ids'];if(_0x1a0831[_0xae05('0x8e')][_0xae05('0xb3')]){_0x4280de['order']=_0x1a0831[_0xae05('0x8e')][_0xae05('0xb3')];}}if(_0x1a0831[_0xae05('0x8e')][_0xae05('0xb4')]){_0x4280de[_0xae05('0xa7')]=_[_0xae05('0xa9')](_0x4280de[_0xae05('0xa7')],{'$and':_0x1a0831[_0xae05('0x8e')][_0xae05('0xb4')]});}return _0x2b6ee9[_0x21a683[_0xae05('0x16')]][_0xae05('0xb0')]({'where':_0x4280de[_0xae05('0xa7')]})[_0xae05('0xa')](function(_0x4529f6){_0x4d065d[_0xae05('0xb0')]=_0x4529f6;if(_0x1a0831[_0xae05('0x8e')][_0xae05('0xb5')]){if(_0x21a683[_0xae05('0x16')]===_0xae05('0x1e')){_0x4280de[_0xae05('0xb6')]=[{'model':_0x2b6ee9[_0xae05('0xb7')],'as':'Tags','attributes':['id','name',_0xae05('0xb8')],'required':_0x1a0831[_0xae05('0x8e')][_0xae05('0xb9')]?!![]:![]},{'model':_0x2b6ee9[_0xae05('0xb7')],'as':_0xae05('0xba'),'attributes':['id',_0xae05('0x1a'),'color'],'through':_0x1a0831[_0xae05('0x8e')][_0xae05('0xb9')]?{'attributes':[],'where':{'TagId':_0x1a0831[_0xae05('0x8e')]['tag']||undefined}}:{},'required':_0x1a0831[_0xae05('0x8e')][_0xae05('0xb9')]?!![]:![]}];}else{_0x4280de[_0xae05('0xb6')]=[{'all':!![]}];}}return _0x2b6ee9[_0x21a683[_0xae05('0x16')]][_0xae05('0x9')](_0x4280de);})['then'](function(_0x5e40ae){_0x4d065d[_0xae05('0xb1')]=_0x5e40ae;if(_0x342eba===_0xae05('0xbb')&&_0x1a0831[_0xae05('0x8e')][_0xae05('0xbc')]===_0xae05('0xbd')){var _0x3aa7e6=[];for(var _0x19a561=0x0;_0x19a561<_0x4d065d[_0xae05('0xb1')][_0xae05('0x93')];_0x19a561++){_0x3aa7e6[_0xae05('0x94')](_0x1d90d8('chat',_0x4d065d[_0xae05('0xb1')][_0x19a561][_0xae05('0xbe')]));_0x3aa7e6['push'](_0x1d90d8(_0xae05('0xbf'),_0x4d065d[_0xae05('0xb1')][_0x19a561][_0xae05('0xbe')]));_0x3aa7e6[_0xae05('0x94')](_0x1d90d8(_0xae05('0xc0'),_0x4d065d['rows'][_0x19a561][_0xae05('0xbe')]));_0x3aa7e6['push'](_0x1d90d8('mail',_0x4d065d[_0xae05('0xb1')][_0x19a561]['dataValues']));_0x3aa7e6[_0xae05('0x94')](_0x1d90d8(_0xae05('0xc1'),_0x4d065d[_0xae05('0xb1')][_0x19a561][_0xae05('0xbe')]));_0x3aa7e6[_0xae05('0x94')](_0x1d90d8('whatsapp',_0x4d065d[_0xae05('0xb1')][_0x19a561][_0xae05('0xbe')]));}return Promise[_0xae05('0x97')](_0x3aa7e6)[_0xae05('0xa')](function(){return _0x4d065d;});}return _0x4d065d;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 3569bfa..8fa39f1 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 _0x9505=['request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s'];(function(_0x3744c5,_0x23c183){var _0x175042=function(_0x5c2b03){while(--_0x5c2b03){_0x3744c5['push'](_0x3744c5['shift']());}};_0x175042(++_0x23c183);}(_0x9505,0x1e5));var _0x5950=function(_0x325059,_0xf35de0){_0x325059=_0x325059-0x0;var _0x519013=_0x9505[_0x325059];return _0x519013;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var moment=require('moment');var BPromise=require(_0x5950('0x2'));var rs=require(_0x5950('0x3'));var fs=require('fs');var Redis=require(_0x5950('0x4'));var db=require(_0x5950('0x5'))['db'];var utils=require(_0x5950('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5950('0x7'));var jayson=require(_0x5950('0x8'));var client=jayson[_0x5950('0x9')][_0x5950('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5950('0xb')],{'host':_0x5950('0xc'),'port':0x18eb});var socket=require(_0x5950('0xd'))(new Redis(config[_0x5950('0xb')]));require(_0x5950('0xe'))[_0x5950('0xf')](socket);function respondWithRpcPromise(_0x1148ef,_0x213e3b,_0x1c8f39){return new BPromise(function(_0x5ef4ab,_0x32f2e0){return client[_0x5950('0x10')](_0x1148ef,_0x1c8f39)['then'](function(_0x5a6098){logger[_0x5950('0x11')](_0x5950('0x12'),_0x213e3b,_0x5950('0x13'));logger[_0x5950('0x14')](_0x5950('0x15'),_0x213e3b,_0x5950('0x13'),JSON[_0x5950('0x16')](_0x5a6098));if(_0x5a6098[_0x5950('0x17')]){if(_0x5a6098[_0x5950('0x17')][_0x5950('0x18')]===0x1f4){logger[_0x5950('0x17')](_0x5950('0x12'),_0x213e3b,_0x5a6098[_0x5950('0x17')][_0x5950('0x19')]);return _0x32f2e0(_0x5a6098[_0x5950('0x17')][_0x5950('0x19')]);}logger[_0x5950('0x17')](_0x5950('0x12'),_0x213e3b,_0x5a6098[_0x5950('0x17')][_0x5950('0x19')]);return _0x5ef4ab(_0x5a6098[_0x5950('0x17')]['message']);}else{logger['info'](_0x5950('0x12'),_0x213e3b,_0x5950('0x13'));_0x5ef4ab(_0x5a6098[_0x5950('0x1a')][_0x5950('0x19')]);}})[_0x5950('0x1b')](function(_0x483aaf){logger['error'](_0x5950('0x12'),_0x213e3b,_0x483aaf);_0x32f2e0(_0x483aaf);});});} \ No newline at end of file +var _0x002d=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x002d,0xca));var _0xd002=function(_0x253dcf,_0x5e12e5){_0x253dcf=_0x253dcf-0x0;var _0x231701=_0x002d[_0x253dcf];return _0x231701;};'use strict';var _=require(_0xd002('0x0'));var util=require(_0xd002('0x1'));var moment=require(_0xd002('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd002('0x3'));var db=require(_0xd002('0x4'))['db'];var utils=require(_0xd002('0x5'));var logger=require(_0xd002('0x6'))(_0xd002('0x7'));var config=require(_0xd002('0x8'));var jayson=require(_0xd002('0x9'));var client=jayson[_0xd002('0xa')][_0xd002('0xb')]({'port':0x232a});config[_0xd002('0xc')]=_[_0xd002('0xd')](config[_0xd002('0xc')],{'host':_0xd002('0xe'),'port':0x18eb});var socket=require(_0xd002('0xf'))(new Redis(config[_0xd002('0xc')]));require(_0xd002('0x10'))[_0xd002('0x11')](socket);function respondWithRpcPromise(_0x4a6621,_0x55d14a,_0x269cfe){return new BPromise(function(_0x3e283b,_0x2be09b){return client['request'](_0x4a6621,_0x269cfe)[_0xd002('0x12')](function(_0x12dad3){logger[_0xd002('0x13')](_0xd002('0x14'),_0x55d14a,_0xd002('0x15'));logger[_0xd002('0x16')](_0xd002('0x17'),_0x55d14a,_0xd002('0x15'),JSON[_0xd002('0x18')](_0x12dad3));if(_0x12dad3[_0xd002('0x19')]){if(_0x12dad3[_0xd002('0x19')][_0xd002('0x1a')]===0x1f4){logger[_0xd002('0x19')](_0xd002('0x14'),_0x55d14a,_0x12dad3['error']['message']);return _0x2be09b(_0x12dad3['error'][_0xd002('0x1b')]);}logger['error'](_0xd002('0x14'),_0x55d14a,_0x12dad3[_0xd002('0x19')][_0xd002('0x1b')]);return _0x3e283b(_0x12dad3[_0xd002('0x19')][_0xd002('0x1b')]);}else{logger[_0xd002('0x13')](_0xd002('0x14'),_0x55d14a,'request\x20sent');_0x3e283b(_0x12dad3[_0xd002('0x1c')][_0xd002('0x1b')]);}})[_0xd002('0x1d')](function(_0x3b1725){logger[_0xd002('0x19')]('UserProfile,\x20%s,\x20%s',_0x55d14a,_0x3b1725);_0x2be09b(_0x3b1725);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index dbf8dad..27ea5ff 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 _0x20e1=['emit','removeListener','length','userProfile:','./userProfile.events','remove','update'];(function(_0xfa9a4b,_0x4b9d45){var _0x4e9336=function(_0x3ed2b2){while(--_0x3ed2b2){_0xfa9a4b['push'](_0xfa9a4b['shift']());}};_0x4e9336(++_0x4b9d45);}(_0x20e1,0xf2));var _0x120e=function(_0xea1bcd,_0x465e08){_0xea1bcd=_0xea1bcd-0x0;var _0xfbe4c6=_0x20e1[_0xea1bcd];return _0xfbe4c6;};'use strict';var UserProfileEvents=require(_0x120e('0x0'));var events=['save',_0x120e('0x1'),_0x120e('0x2')];function createListener(_0x45cbde,_0x42b0fd){return function(_0x475576){_0x42b0fd[_0x120e('0x3')](_0x45cbde,_0x475576);};}function removeListener(_0x178b70,_0x4c0b97){return function(){UserProfileEvents[_0x120e('0x4')](_0x178b70,_0x4c0b97);};}exports['register']=function(_0x2ba3f1){for(var _0x5796a3=0x0,_0x4ccc65=events[_0x120e('0x5')];_0x5796a3<_0x4ccc65;_0x5796a3++){var _0x32f96a=events[_0x5796a3];var _0x4bc92a=createListener(_0x120e('0x6')+_0x32f96a,_0x2ba3f1);UserProfileEvents['on'](_0x32f96a,_0x4bc92a);}}; \ No newline at end of file +var _0x6b1e=['save','update','register','length','userProfile:','./userProfile.events'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0x6b1e,0x167));var _0xe6b1=function(_0xe255e6,_0x29b41f){_0xe255e6=_0xe255e6-0x0;var _0x24e584=_0x6b1e[_0xe255e6];return _0x24e584;};'use strict';var UserProfileEvents=require(_0xe6b1('0x0'));var events=[_0xe6b1('0x1'),'remove',_0xe6b1('0x2')];function createListener(_0x34ce58,_0x536b0f){return function(_0xa46350){_0x536b0f['emit'](_0x34ce58,_0xa46350);};}function removeListener(_0x53baa6,_0x444eb0){return function(){UserProfileEvents['removeListener'](_0x53baa6,_0x444eb0);};}exports[_0xe6b1('0x3')]=function(_0x499d52){for(var _0x48fde7=0x0,_0x5c9467=events[_0xe6b1('0x4')];_0x48fde7<_0x5c9467;_0x48fde7++){var _0x38ac30=events[_0x48fde7];var _0x424c7f=createListener(_0xe6b1('0x5')+_0x38ac30,_0x499d52);UserProfileEvents['on'](_0x38ac30,_0x424c7f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index daa8b38..1395cd6 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 _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','get','describe','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x186222,_0x3bdfb0){var _0x226a38=function(_0x3b071f){while(--_0x3b071f){_0x186222['push'](_0x186222['shift']());}};_0x226a38(++_0x3bdfb0);}(_0xac4a,0x13f));var _0xaac4=function(_0x4fdbfe,_0x4898a4){_0x4fdbfe=_0x4fdbfe-0x0;var _0x489776=_0xac4a[_0x4fdbfe];return _0x489776;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/describe',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id',auth[_0xaac4('0x9')](),controller['show']);router[_0xaac4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaac4('0xd')](_0xaac4('0xe'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);module[_0xaac4('0x12')]=router; \ No newline at end of file +var _0x7a07=['get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller'];(function(_0x4c59c0,_0x5a34be){var _0x5bc19c=function(_0x4a8dd7){while(--_0x4a8dd7){_0x4c59c0['push'](_0x4c59c0['shift']());}};_0x5bc19c(++_0x5a34be);}(_0x7a07,0x16d));var _0x77a0=function(_0x357ef2,_0x515f16){_0x357ef2=_0x357ef2-0x0;var _0x285585=_0x7a07[_0x357ef2];return _0x285585;};'use strict';var multer=require(_0x77a0('0x0'));var util=require(_0x77a0('0x1'));var path=require(_0x77a0('0x2'));var timeout=require(_0x77a0('0x3'));var express=require(_0x77a0('0x4'));var router=express['Router']();var fs_extra=require(_0x77a0('0x5'));var auth=require(_0x77a0('0x6'));var interaction=require(_0x77a0('0x7'));var config=require('../../config/environment');var controller=require(_0x77a0('0x8'));router[_0x77a0('0x9')]('/',auth['isAuthenticated'](),controller[_0x77a0('0xa')]);router[_0x77a0('0x9')](_0x77a0('0xb'),auth[_0x77a0('0xc')](),controller[_0x77a0('0xd')]);router[_0x77a0('0x9')](_0x77a0('0xe'),auth[_0x77a0('0xc')](),controller[_0x77a0('0xf')]);router[_0x77a0('0x10')]('/',auth[_0x77a0('0xc')](),controller['create']);router[_0x77a0('0x11')](_0x77a0('0xe'),auth['isAuthenticated'](),controller[_0x77a0('0x12')]);router[_0x77a0('0x13')]('/:id',auth[_0x77a0('0xc')](),controller[_0x77a0('0x14')]);module[_0x77a0('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 5fecc62..8fef021 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 _0x5edb=['STRING','INTEGER'];(function(_0x2a37b4,_0x2885de){var _0x3df84f=function(_0x1ba3a7){while(--_0x1ba3a7){_0x2a37b4['push'](_0x2a37b4['shift']());}};_0x3df84f(++_0x2885de);}(_0x5edb,0xef));var _0xb5ed=function(_0x41ef53,_0x3ff923){_0x41ef53=_0x41ef53-0x0;var _0x28cea8=_0x5edb[_0x41ef53];return _0x28cea8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb5ed('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xb5ed('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe878=['INTEGER','exports','STRING'];(function(_0x5b1042,_0x21f757){var _0x28485d=function(_0xecfefd){while(--_0xecfefd){_0x5b1042['push'](_0x5b1042['shift']());}};_0x28485d(++_0x21f757);}(_0xe878,0x1c6));var _0x8e87=function(_0x24a737,_0x3ff299){_0x24a737=_0x24a737-0x0;var _0x37b618=_0xe878[_0x24a737];return _0x37b618;};'use strict';var Sequelize=require('sequelize');module[_0x8e87('0x0')]={'name':{'type':Sequelize[_0x8e87('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8e87('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8e87('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 5da5157..17e28bf 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 _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x23441a,_0x566c84){var _0x33f9d8=function(_0x2b9871){while(--_0x2b9871){_0x23441a['push'](_0x23441a['shift']());}};_0x33f9d8(++_0x566c84);}(_0x47c5,0x165));var _0x547c=function(_0x5a2201,_0x494e47){_0x5a2201=_0x5a2201-0x0;var _0x15b753=_0x47c5[_0x5a2201];return _0x15b753;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file +var _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x6343,0x168));var _0x3634=function(_0x53f7c1,_0x41f3e4){_0x53f7c1=_0x53f7c1-0x0;var _0x44bac9=_0x6343[_0x53f7c1];return _0x44bac9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 8e04ae3..88cfdd3 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 _0x05f7=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x1ebe53,_0x35cc29){var _0x56cb47=function(_0x1fc9fc){while(--_0x1fc9fc){_0x1ebe53['push'](_0x1ebe53['shift']());}};_0x56cb47(++_0x35cc29);}(_0x05f7,0x84));var _0x705f=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x05f7[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x705f('0x0'));var util=require(_0x705f('0x1'));var logger=require('../../config/logger')(_0x705f('0x2'));var moment=require(_0x705f('0x3'));var BPromise=require(_0x705f('0x4'));var rp=require(_0x705f('0x5'));var fs=require('fs');var path=require(_0x705f('0x6'));var rimraf=require('rimraf');var config=require(_0x705f('0x7'));var attributes=require(_0x705f('0x8'));module[_0x705f('0x9')]=function(_0x49786d,_0x173735){return _0x49786d[_0x705f('0xa')](_0x705f('0xb'),attributes,{'tableName':_0x705f('0xc'),'paranoid':![],'indexes':[{'name':_0x705f('0xd'),'fields':[_0x705f('0xe'),_0x705f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8248=['rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','moment','bluebird','path'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x8248,0x1e5));var _0x8824=function(_0x5f31f6,_0x83e4f3){_0x5f31f6=_0x5f31f6-0x0;var _0x5acc4b=_0x8248[_0x5f31f6];return _0x5acc4b;};'use strict';var _=require('lodash');var util=require(_0x8824('0x0'));var logger=require(_0x8824('0x1'))('api');var moment=require(_0x8824('0x2'));var BPromise=require(_0x8824('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8824('0x4'));var rimraf=require(_0x8824('0x5'));var config=require(_0x8824('0x6'));var attributes=require(_0x8824('0x7'));module[_0x8824('0x8')]=function(_0x547473,_0x32f573){return _0x547473['define'](_0x8824('0x9'),attributes,{'tableName':_0x8824('0xa'),'paranoid':![],'indexes':[{'name':_0x8824('0xb'),'fields':[_0x8824('0xc'),_0x8824('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 c77e1db..b528151 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 _0xb805=['../../config/logger','../../config/environment','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xb805,0x1b3));var _0x5b80=function(_0x38bfdd,_0x190f5e){_0x38bfdd=_0x38bfdd-0x0;var _0x8f1298=_0xb805[_0x38bfdd];return _0x8f1298;};'use strict';var _=require(_0x5b80('0x0'));var util=require(_0x5b80('0x1'));var moment=require(_0x5b80('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b80('0x3'));var fs=require('fs');var Redis=require(_0x5b80('0x4'));var db=require(_0x5b80('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b80('0x6'))('rpc');var config=require(_0x5b80('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b80('0x8')][_0x5b80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ae95b,_0x4921ca,_0x20d58f){return new BPromise(function(_0x45f730,_0x59addd){return client[_0x5b80('0xa')](_0x1ae95b,_0x20d58f)[_0x5b80('0xb')](function(_0x5debe9){logger['info'](_0x5b80('0xc'),_0x4921ca,_0x5b80('0xd'));logger['debug'](_0x5b80('0xe'),_0x4921ca,_0x5b80('0xd'),JSON[_0x5b80('0xf')](_0x5debe9));if(_0x5debe9[_0x5b80('0x10')]){if(_0x5debe9[_0x5b80('0x10')]['code']===0x1f4){logger[_0x5b80('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x4921ca,_0x5debe9['error'][_0x5b80('0x11')]);return _0x59addd(_0x5debe9[_0x5b80('0x10')][_0x5b80('0x11')]);}logger[_0x5b80('0x10')](_0x5b80('0xc'),_0x4921ca,_0x5debe9[_0x5b80('0x10')][_0x5b80('0x11')]);return _0x45f730(_0x5debe9[_0x5b80('0x10')][_0x5b80('0x11')]);}else{logger[_0x5b80('0x12')](_0x5b80('0xc'),_0x4921ca,'request\x20sent');_0x45f730(_0x5debe9[_0x5b80('0x13')]['message']);}})[_0x5b80('0x14')](function(_0x564fe5){logger[_0x5b80('0x10')](_0x5b80('0xc'),_0x4921ca,_0x564fe5);_0x59addd(_0x564fe5);});});} \ No newline at end of file +var _0x5cb0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x1d2c2e,_0x34a46b){var _0x19c339=function(_0x52ef8b){while(--_0x52ef8b){_0x1d2c2e['push'](_0x1d2c2e['shift']());}};_0x19c339(++_0x34a46b);}(_0x5cb0,0xb6));var _0x05cb=function(_0x52c759,_0x5ae52b){_0x52c759=_0x52c759-0x0;var _0x296cf9=_0x5cb0[_0x52c759];return _0x296cf9;};'use strict';var _=require(_0x05cb('0x0'));var util=require(_0x05cb('0x1'));var moment=require('moment');var BPromise=require(_0x05cb('0x2'));var rs=require(_0x05cb('0x3'));var fs=require('fs');var Redis=require(_0x05cb('0x4'));var db=require(_0x05cb('0x5'))['db'];var utils=require(_0x05cb('0x6'));var logger=require('../../config/logger')(_0x05cb('0x7'));var config=require(_0x05cb('0x8'));var jayson=require(_0x05cb('0x9'));var client=jayson['client'][_0x05cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f18fe,_0x473197,_0xaf9410){return new BPromise(function(_0x56f986,_0x439241){return client[_0x05cb('0xb')](_0x3f18fe,_0xaf9410)[_0x05cb('0xc')](function(_0x60ce73){logger[_0x05cb('0xd')](_0x05cb('0xe'),_0x473197,_0x05cb('0xf'));logger[_0x05cb('0x10')](_0x05cb('0x11'),_0x473197,_0x05cb('0xf'),JSON['stringify'](_0x60ce73));if(_0x60ce73[_0x05cb('0x12')]){if(_0x60ce73[_0x05cb('0x12')][_0x05cb('0x13')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x473197,_0x60ce73[_0x05cb('0x12')]['message']);return _0x439241(_0x60ce73[_0x05cb('0x12')][_0x05cb('0x14')]);}logger[_0x05cb('0x12')](_0x05cb('0xe'),_0x473197,_0x60ce73[_0x05cb('0x12')][_0x05cb('0x14')]);return _0x56f986(_0x60ce73[_0x05cb('0x12')][_0x05cb('0x14')]);}else{logger[_0x05cb('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x473197,_0x05cb('0xf'));_0x56f986(_0x60ce73[_0x05cb('0x15')][_0x05cb('0x14')]);}})[_0x05cb('0x16')](function(_0x369ddc){logger[_0x05cb('0x12')](_0x05cb('0xe'),_0x473197,_0x369ddc);_0x439241(_0x369ddc);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index f39aca0..5e87751 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 _0xaa96=['post','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xaa96,0x107));var _0x6aa9=function(_0x11205a,_0x28d698){_0x11205a=_0x11205a-0x0;var _0x5b14ed=_0xaa96[_0x11205a];return _0x5b14ed;};'use strict';var multer=require('multer');var util=require(_0x6aa9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6aa9('0x1')]();var fs_extra=require(_0x6aa9('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6aa9('0x3'));var controller=require('./userProfileSection.controller');router[_0x6aa9('0x4')]('/',auth[_0x6aa9('0x5')](),controller[_0x6aa9('0x6')]);router['get']('/describe',auth[_0x6aa9('0x5')](),controller[_0x6aa9('0x7')]);router['get'](_0x6aa9('0x8'),auth[_0x6aa9('0x5')](),controller['show']);router[_0x6aa9('0x9')]('/',auth[_0x6aa9('0x5')](),controller[_0x6aa9('0xa')]);router[_0x6aa9('0xb')]('/:id',auth[_0x6aa9('0x5')](),controller[_0x6aa9('0xc')]);router[_0x6aa9('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6aa9('0xe')]);module[_0x6aa9('0xf')]=router; \ No newline at end of file +var _0x7338=['put','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','/describe','describe','show','post'];(function(_0x2b9a36,_0x3acb06){var _0x484b16=function(_0x2ec6dc){while(--_0x2ec6dc){_0x2b9a36['push'](_0x2b9a36['shift']());}};_0x484b16(++_0x3acb06);}(_0x7338,0x82));var _0x8733=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x7338[_0x220f3f];return _0x1f170e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8733('0x0'));var timeout=require(_0x8733('0x1'));var express=require(_0x8733('0x2'));var router=express[_0x8733('0x3')]();var fs_extra=require(_0x8733('0x4'));var auth=require(_0x8733('0x5'));var interaction=require(_0x8733('0x6'));var config=require('../../config/environment');var controller=require(_0x8733('0x7'));router[_0x8733('0x8')]('/',auth[_0x8733('0x9')](),controller['index']);router['get'](_0x8733('0xa'),auth['isAuthenticated'](),controller[_0x8733('0xb')]);router['get']('/:id',auth[_0x8733('0x9')](),controller[_0x8733('0xc')]);router[_0x8733('0xd')]('/',auth[_0x8733('0x9')](),controller['create']);router[_0x8733('0xe')](_0x8733('0xf'),auth[_0x8733('0x9')](),controller['update']);router[_0x8733('0x10')]('/:id',auth[_0x8733('0x9')](),controller['destroy']);module[_0x8733('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 49d41a0..461f528 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 _0xefda=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x4c8df6,_0x54b972){var _0x3e33f9=function(_0x580a34){while(--_0x580a34){_0x4c8df6['push'](_0x4c8df6['shift']());}};_0x3e33f9(++_0x54b972);}(_0xefda,0x96));var _0xaefd=function(_0x1b3852,_0x433d0e){_0x1b3852=_0x1b3852-0x0;var _0x2c8f2c=_0xefda[_0x1b3852];return _0x2c8f2c;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xaefd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaefd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaefd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaefd('0x1')],'set':function(_0x2ade44){this[_0xaefd('0x4')](_0xaefd('0x5'),_0x2ade44?_0x2ade44[_0xaefd('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xaefd('0x5'))?this[_0xaefd('0x7')](_0xaefd('0x5'))[_0xaefd('0x8')](''):[];}}}; \ No newline at end of file +var _0xb78e=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x408314,_0x11682e){var _0x1af4ab=function(_0x284557){while(--_0x284557){_0x408314['push'](_0x408314['shift']());}};_0x1af4ab(++_0x11682e);}(_0xb78e,0x1c9));var _0xeb78=function(_0x3741e3,_0x3c3312){_0x3741e3=_0x3741e3-0x0;var _0x43c8e6=_0xb78e[_0x3741e3];return _0x43c8e6;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xeb78('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xeb78('0x2')],'set':function(_0x308d12){this[_0xeb78('0x5')](_0xeb78('0x6'),_0x308d12?_0x308d12['join'](''):[]);},'get':function(){return this[_0xeb78('0x7')](_0xeb78('0x6'))?this[_0xeb78('0x7')](_0xeb78('0x6'))[_0xeb78('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 77b47ab..905e947 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 _0x360a=['body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create'];(function(_0x4eabf9,_0x54a55a){var _0x722c1f=function(_0x59d824){while(--_0x59d824){_0x4eabf9['push'](_0x4eabf9['shift']());}};_0x722c1f(++_0x54a55a);}(_0x360a,0xe4));var _0xa360=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x360a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xa360('0x0'));var rimraf=require(_0xa360('0x1'));var zipdir=require(_0xa360('0x2'));var jsonpatch=require(_0xa360('0x3'));var rp=require(_0xa360('0x4'));var moment=require(_0xa360('0x5'));var BPromise=require(_0xa360('0x6'));var Mustache=require(_0xa360('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa360('0x8'));var csv=require(_0xa360('0x9'));var ejs=require(_0xa360('0xa'));var fs=require('fs');var fs_extra=require(_0xa360('0xb'));var _=require(_0xa360('0xc'));var squel=require(_0xa360('0xd'));var crypto=require(_0xa360('0xe'));var jsforce=require(_0xa360('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa360('0x9'));var querystring=require('querystring');var Papa=require(_0xa360('0x10'));var Redis=require(_0xa360('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa360('0x12'));var as=require(_0xa360('0x13'));var hardwareService=require(_0xa360('0x14'));var logger=require(_0xa360('0x15'))(_0xa360('0x16'));var utils=require('../../config/utils');var config=require(_0xa360('0x17'));var licenseUtil=require(_0xa360('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a4416,_0x7541f6){_0x7541f6=_0x7541f6||0xcc;return function(_0x5e1b93){if(_0x5e1b93){return _0x2a4416[_0xa360('0x19')](_0x7541f6);}return _0x2a4416[_0xa360('0x1a')](_0x7541f6)[_0xa360('0x1b')]();};}function respondWithResult(_0x1bafa4,_0x5836ac){_0x5836ac=_0x5836ac||0xc8;return function(_0x3e31f9){if(_0x3e31f9){return _0x1bafa4[_0xa360('0x1a')](_0x5836ac)[_0xa360('0x1c')](_0x3e31f9);}};}function respondWithFilteredResult(_0x7136d2,_0x441050){return function(_0x3c62fd){if(_0x3c62fd){var _0x5e64a9=typeof _0x441050[_0xa360('0x1d')]==='undefined'&&typeof _0x441050['limit']===_0xa360('0x1e');var _0x269be7=_0x3c62fd[_0xa360('0x1f')];var _0x507fa7=_0x5e64a9?0x0:_0x441050['offset'];var _0x3f607a=_0x5e64a9?_0x3c62fd[_0xa360('0x1f')]:_0x441050[_0xa360('0x1d')]+_0x441050[_0xa360('0x20')];var _0x577c50;if(_0x3f607a>=_0x269be7){_0x3f607a=_0x269be7;_0x577c50=0xc8;}else{_0x577c50=0xce;}_0x7136d2[_0xa360('0x1a')](_0x577c50);return _0x7136d2[_0xa360('0x21')]('Content-Range',_0x507fa7+'-'+_0x3f607a+'/'+_0x269be7)['json'](_0x3c62fd);}return null;};}function patchUpdates(_0x33f4c3){return function(_0x1a5c0c){try{jsonpatch['apply'](_0x1a5c0c,_0x33f4c3,!![]);}catch(_0x3d3f17){return BPromise[_0xa360('0x22')](_0x3d3f17);}return _0x1a5c0c[_0xa360('0x23')]();};}function saveUpdates(_0x2e3cad,_0x13b8bf){return function(_0x1e0bef){if(_0x1e0bef){return _0x1e0bef[_0xa360('0x24')](_0x2e3cad)[_0xa360('0x25')](function(_0x7009){return _0x7009;});}return null;};}function removeEntity(_0x4754de,_0x1550fd){return function(_0x50f6a9){if(_0x50f6a9){return _0x50f6a9[_0xa360('0x26')]()[_0xa360('0x25')](function(){_0x4754de[_0xa360('0x1a')](0xcc)[_0xa360('0x1b')]();});}};}function handleEntityNotFound(_0x72ae75,_0x1b74e3){return function(_0x1623b7){if(!_0x1623b7){_0x72ae75[_0xa360('0x19')](0x194);}return _0x1623b7;};}function handleError(_0x1ad018,_0x1ee1eb){_0x1ee1eb=_0x1ee1eb||0x1f4;return function(_0x3dce1b){logger[_0xa360('0x27')](_0x3dce1b['stack']);if(_0x3dce1b[_0xa360('0x28')]){delete _0x3dce1b[_0xa360('0x28')];}_0x1ad018[_0xa360('0x1a')](_0x1ee1eb)[_0xa360('0x29')](_0x3dce1b);};}exports[_0xa360('0x2a')]=function(_0x115410,_0x390d41){var _0x3b90af={},_0x5c0bea={},_0x51976e={'count':0x0,'rows':[]};var _0xa9bc6a=_[_0xa360('0x2b')](db[_0xa360('0x2c')][_0xa360('0x2d')],function(_0x2773a0){return{'name':_0x2773a0[_0xa360('0x2e')],'type':_0x2773a0[_0xa360('0x2f')]['key']};});_0x5c0bea[_0xa360('0x30')]=_[_0xa360('0x2b')](_0xa9bc6a,_0xa360('0x28'));_0x5c0bea[_0xa360('0x31')]=_[_0xa360('0x32')](_0x115410[_0xa360('0x31')]);_0x5c0bea[_0xa360('0x33')]=_[_0xa360('0x34')](_0x5c0bea[_0xa360('0x30')],_0x5c0bea[_0xa360('0x31')]);_0x3b90af[_0xa360('0x35')]=_[_0xa360('0x34')](_0x5c0bea[_0xa360('0x30')],qs[_0xa360('0x36')](_0x115410['query']['fields']));_0x3b90af[_0xa360('0x35')]=_0x3b90af['attributes']['length']?_0x3b90af['attributes']:_0x5c0bea['model'];if(!_0x115410['query']['hasOwnProperty'](_0xa360('0x37'))){_0x3b90af[_0xa360('0x20')]=qs[_0xa360('0x20')](_0x115410['query'][_0xa360('0x20')]);_0x3b90af[_0xa360('0x1d')]=qs[_0xa360('0x1d')](_0x115410['query'][_0xa360('0x1d')]);}_0x3b90af['order']=qs[_0xa360('0x38')](_0x115410[_0xa360('0x31')][_0xa360('0x38')]);_0x3b90af[_0xa360('0x39')]=qs['filters'](_[_0xa360('0x3a')](_0x115410[_0xa360('0x31')],_0x5c0bea[_0xa360('0x33')]),_0xa9bc6a);if(_0x115410[_0xa360('0x31')][_0xa360('0x3b')]){_0x3b90af[_0xa360('0x39')]=_[_0xa360('0x3c')](_0x3b90af[_0xa360('0x39')],{'$or':_[_0xa360('0x2b')](_0xa9bc6a,function(_0x49997c){if(_0x49997c[_0xa360('0x2f')]!==_0xa360('0x3d')){var _0x6144be={};_0x6144be[_0x49997c[_0xa360('0x28')]]={'$like':'%'+_0x115410[_0xa360('0x31')][_0xa360('0x3b')]+'%'};return _0x6144be;}})});}_0x3b90af=_[_0xa360('0x3c')]({},_0x3b90af,_0x115410['options']);var _0x34541c={'where':_0x3b90af['where']};return db['UserProfileSection'][_0xa360('0x1f')](_0x34541c)[_0xa360('0x25')](function(_0x5490f5){_0x51976e[_0xa360('0x1f')]=_0x5490f5;if(_0x115410[_0xa360('0x31')][_0xa360('0x3e')]){_0x3b90af[_0xa360('0x3f')]=[{'all':!![]}];}return db[_0xa360('0x2c')][_0xa360('0x40')](_0x3b90af);})['then'](function(_0x293342){_0x51976e[_0xa360('0x41')]=_0x293342;return _0x51976e;})[_0xa360('0x25')](respondWithFilteredResult(_0x390d41,_0x3b90af))[_0xa360('0x42')](handleError(_0x390d41,null));};exports[_0xa360('0x43')]=function(_0x3edd3c,_0x3d128f){var _0x35c9a0={'raw':![],'where':{'id':_0x3edd3c['params']['id']}},_0x41715d={};_0x41715d['model']=_[_0xa360('0x32')](db[_0xa360('0x2c')][_0xa360('0x2d')]);_0x41715d[_0xa360('0x31')]=_['keys'](_0x3edd3c[_0xa360('0x31')]);_0x41715d[_0xa360('0x33')]=_['intersection'](_0x41715d[_0xa360('0x30')],_0x41715d['query']);_0x35c9a0[_0xa360('0x35')]=_[_0xa360('0x34')](_0x41715d[_0xa360('0x30')],qs[_0xa360('0x36')](_0x3edd3c[_0xa360('0x31')][_0xa360('0x36')]));_0x35c9a0['attributes']=_0x35c9a0['attributes'][_0xa360('0x44')]?_0x35c9a0[_0xa360('0x35')]:_0x41715d[_0xa360('0x30')];if(_0x3edd3c['query']['includeAll']){_0x35c9a0[_0xa360('0x3f')]=[{'all':!![]}];}_0x35c9a0=_['merge']({},_0x35c9a0,_0x3edd3c[_0xa360('0x45')]);return db[_0xa360('0x2c')][_0xa360('0x46')](_0x35c9a0)[_0xa360('0x25')](handleEntityNotFound(_0x3d128f,null))[_0xa360('0x25')](respondWithResult(_0x3d128f,null))[_0xa360('0x42')](handleError(_0x3d128f,null));};exports['create']=function(_0x511deb,_0x49a4ce){return db[_0xa360('0x2c')][_0xa360('0x47')](_0x511deb[_0xa360('0x48')],{})[_0xa360('0x25')](respondWithResult(_0x49a4ce,0xc9))['catch'](handleError(_0x49a4ce,null));};exports[_0xa360('0x24')]=function(_0x27709f,_0x294f96){if(_0x27709f[_0xa360('0x48')]['id']){delete _0x27709f[_0xa360('0x48')]['id'];}return db[_0xa360('0x2c')]['find']({'where':{'id':_0x27709f[_0xa360('0x49')]['id']}})[_0xa360('0x25')](handleEntityNotFound(_0x294f96,null))[_0xa360('0x25')](saveUpdates(_0x27709f[_0xa360('0x48')],null))[_0xa360('0x25')](respondWithResult(_0x294f96,null))[_0xa360('0x42')](handleError(_0x294f96,null));};exports[_0xa360('0x26')]=function(_0xd3998e,_0xe88309){return db[_0xa360('0x2c')][_0xa360('0x46')]({'where':{'id':_0xd3998e[_0xa360('0x49')]['id']}})[_0xa360('0x25')](handleEntityNotFound(_0xe88309,null))[_0xa360('0x25')](removeEntity(_0xe88309,null))['catch'](handleError(_0xe88309,null));};exports[_0xa360('0x4a')]=function(_0x564283,_0x53b1cb){return db[_0xa360('0x2c')][_0xa360('0x4a')]()[_0xa360('0x25')](respondWithResult(_0x53b1cb,null))[_0xa360('0x42')](handleError(_0x53b1cb,null));}; \ No newline at end of file +var _0xcc4a=['order','sort','where','filters','pick','filter','merge','options','UserProfileSection','includeAll','include','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x17326c,_0x1cf33d){var _0x61041b=function(_0x17eece){while(--_0x17eece){_0x17326c['push'](_0x17326c['shift']());}};_0x61041b(++_0x1cf33d);}(_0xcc4a,0xa9));var _0xacc4=function(_0x2ffbd6,_0x5317dd){_0x2ffbd6=_0x2ffbd6-0x0;var _0x2c1f61=_0xcc4a[_0x2ffbd6];return _0x2c1f61;};'use strict';var emlformat=require(_0xacc4('0x0'));var rimraf=require(_0xacc4('0x1'));var zipdir=require(_0xacc4('0x2'));var jsonpatch=require(_0xacc4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xacc4('0x4'));var util=require(_0xacc4('0x5'));var path=require(_0xacc4('0x6'));var sox=require(_0xacc4('0x7'));var csv=require(_0xacc4('0x8'));var ejs=require(_0xacc4('0x9'));var fs=require('fs');var fs_extra=require(_0xacc4('0xa'));var _=require(_0xacc4('0xb'));var squel=require(_0xacc4('0xc'));var crypto=require(_0xacc4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xacc4('0xe'));var toCsv=require(_0xacc4('0x8'));var querystring=require(_0xacc4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xacc4('0x10'));var qs=require(_0xacc4('0x11'));var as=require(_0xacc4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacc4('0x13'))('api');var utils=require(_0xacc4('0x14'));var config=require(_0xacc4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xacc4('0x16'))['db'];function respondWithStatusCode(_0x2f8c92,_0x5c36ba){_0x5c36ba=_0x5c36ba||0xcc;return function(_0x1bec79){if(_0x1bec79){return _0x2f8c92['sendStatus'](_0x5c36ba);}return _0x2f8c92[_0xacc4('0x17')](_0x5c36ba)[_0xacc4('0x18')]();};}function respondWithResult(_0x59543a,_0x101b3d){_0x101b3d=_0x101b3d||0xc8;return function(_0x20fa2e){if(_0x20fa2e){return _0x59543a[_0xacc4('0x17')](_0x101b3d)[_0xacc4('0x19')](_0x20fa2e);}};}function respondWithFilteredResult(_0x30083d,_0x5ad171){return function(_0x3a2fce){if(_0x3a2fce){var _0x141973=typeof _0x5ad171[_0xacc4('0x1a')]===_0xacc4('0x1b')&&typeof _0x5ad171[_0xacc4('0x1c')]===_0xacc4('0x1b');var _0x2d0a86=_0x3a2fce[_0xacc4('0x1d')];var _0x29fbb8=_0x141973?0x0:_0x5ad171[_0xacc4('0x1a')];var _0x36597b=_0x141973?_0x3a2fce['count']:_0x5ad171[_0xacc4('0x1a')]+_0x5ad171[_0xacc4('0x1c')];var _0x6992e9;if(_0x36597b>=_0x2d0a86){_0x36597b=_0x2d0a86;_0x6992e9=0xc8;}else{_0x6992e9=0xce;}_0x30083d[_0xacc4('0x17')](_0x6992e9);return _0x30083d[_0xacc4('0x1e')]('Content-Range',_0x29fbb8+'-'+_0x36597b+'/'+_0x2d0a86)[_0xacc4('0x19')](_0x3a2fce);}return null;};}function patchUpdates(_0x51dec4){return function(_0x3a6984){try{jsonpatch[_0xacc4('0x1f')](_0x3a6984,_0x51dec4,!![]);}catch(_0x917c6a){return BPromise[_0xacc4('0x20')](_0x917c6a);}return _0x3a6984['save']();};}function saveUpdates(_0x435574,_0x4eec97){return function(_0x578cb2){if(_0x578cb2){return _0x578cb2[_0xacc4('0x21')](_0x435574)['then'](function(_0x3e6bc0){return _0x3e6bc0;});}return null;};}function removeEntity(_0x3203c8,_0x418ca8){return function(_0x376a90){if(_0x376a90){return _0x376a90[_0xacc4('0x22')]()[_0xacc4('0x23')](function(){_0x3203c8['status'](0xcc)[_0xacc4('0x18')]();});}};}function handleEntityNotFound(_0x383c1c,_0x394e5c){return function(_0x3a3fd3){if(!_0x3a3fd3){_0x383c1c[_0xacc4('0x24')](0x194);}return _0x3a3fd3;};}function handleError(_0x15668f,_0x4e2f09){_0x4e2f09=_0x4e2f09||0x1f4;return function(_0x523931){logger[_0xacc4('0x25')](_0x523931[_0xacc4('0x26')]);if(_0x523931[_0xacc4('0x27')]){delete _0x523931[_0xacc4('0x27')];}_0x15668f[_0xacc4('0x17')](_0x4e2f09)[_0xacc4('0x28')](_0x523931);};}exports[_0xacc4('0x29')]=function(_0x45375f,_0x46296b){var _0x43e982={},_0x12c479={},_0x598417={'count':0x0,'rows':[]};var _0x234d35=_[_0xacc4('0x2a')](db['UserProfileSection'][_0xacc4('0x2b')],function(_0x2156bd){return{'name':_0x2156bd[_0xacc4('0x2c')],'type':_0x2156bd[_0xacc4('0x2d')][_0xacc4('0x2e')]};});_0x12c479[_0xacc4('0x2f')]=_['map'](_0x234d35,_0xacc4('0x27'));_0x12c479[_0xacc4('0x30')]=_[_0xacc4('0x31')](_0x45375f[_0xacc4('0x30')]);_0x12c479['filters']=_[_0xacc4('0x32')](_0x12c479[_0xacc4('0x2f')],_0x12c479[_0xacc4('0x30')]);_0x43e982[_0xacc4('0x33')]=_[_0xacc4('0x32')](_0x12c479['model'],qs[_0xacc4('0x34')](_0x45375f[_0xacc4('0x30')][_0xacc4('0x34')]));_0x43e982[_0xacc4('0x33')]=_0x43e982[_0xacc4('0x33')][_0xacc4('0x35')]?_0x43e982[_0xacc4('0x33')]:_0x12c479[_0xacc4('0x2f')];if(!_0x45375f[_0xacc4('0x30')][_0xacc4('0x36')](_0xacc4('0x37'))){_0x43e982['limit']=qs[_0xacc4('0x1c')](_0x45375f[_0xacc4('0x30')][_0xacc4('0x1c')]);_0x43e982['offset']=qs[_0xacc4('0x1a')](_0x45375f[_0xacc4('0x30')][_0xacc4('0x1a')]);}_0x43e982[_0xacc4('0x38')]=qs['sort'](_0x45375f[_0xacc4('0x30')][_0xacc4('0x39')]);_0x43e982[_0xacc4('0x3a')]=qs[_0xacc4('0x3b')](_[_0xacc4('0x3c')](_0x45375f[_0xacc4('0x30')],_0x12c479[_0xacc4('0x3b')]),_0x234d35);if(_0x45375f['query'][_0xacc4('0x3d')]){_0x43e982[_0xacc4('0x3a')]=_[_0xacc4('0x3e')](_0x43e982['where'],{'$or':_[_0xacc4('0x2a')](_0x234d35,function(_0x335e2f){if(_0x335e2f['type']!=='VIRTUAL'){var _0x3ab7b6={};_0x3ab7b6[_0x335e2f[_0xacc4('0x27')]]={'$like':'%'+_0x45375f[_0xacc4('0x30')][_0xacc4('0x3d')]+'%'};return _0x3ab7b6;}})});}_0x43e982=_[_0xacc4('0x3e')]({},_0x43e982,_0x45375f[_0xacc4('0x3f')]);var _0x43434e={'where':_0x43e982[_0xacc4('0x3a')]};return db[_0xacc4('0x40')][_0xacc4('0x1d')](_0x43434e)[_0xacc4('0x23')](function(_0x27853b){_0x598417[_0xacc4('0x1d')]=_0x27853b;if(_0x45375f[_0xacc4('0x30')][_0xacc4('0x41')]){_0x43e982[_0xacc4('0x42')]=[{'all':!![]}];}return db[_0xacc4('0x40')]['findAll'](_0x43e982);})[_0xacc4('0x23')](function(_0x288276){_0x598417[_0xacc4('0x43')]=_0x288276;return _0x598417;})[_0xacc4('0x23')](respondWithFilteredResult(_0x46296b,_0x43e982))['catch'](handleError(_0x46296b,null));};exports[_0xacc4('0x44')]=function(_0x4289ef,_0xf8033f){var _0x1e6e26={'raw':![],'where':{'id':_0x4289ef[_0xacc4('0x45')]['id']}},_0x309a77={};_0x309a77[_0xacc4('0x2f')]=_[_0xacc4('0x31')](db[_0xacc4('0x40')][_0xacc4('0x2b')]);_0x309a77[_0xacc4('0x30')]=_['keys'](_0x4289ef[_0xacc4('0x30')]);_0x309a77['filters']=_[_0xacc4('0x32')](_0x309a77['model'],_0x309a77['query']);_0x1e6e26[_0xacc4('0x33')]=_[_0xacc4('0x32')](_0x309a77[_0xacc4('0x2f')],qs[_0xacc4('0x34')](_0x4289ef[_0xacc4('0x30')][_0xacc4('0x34')]));_0x1e6e26[_0xacc4('0x33')]=_0x1e6e26[_0xacc4('0x33')][_0xacc4('0x35')]?_0x1e6e26[_0xacc4('0x33')]:_0x309a77[_0xacc4('0x2f')];if(_0x4289ef[_0xacc4('0x30')][_0xacc4('0x41')]){_0x1e6e26[_0xacc4('0x42')]=[{'all':!![]}];}_0x1e6e26=_['merge']({},_0x1e6e26,_0x4289ef[_0xacc4('0x3f')]);return db[_0xacc4('0x40')]['find'](_0x1e6e26)[_0xacc4('0x23')](handleEntityNotFound(_0xf8033f,null))['then'](respondWithResult(_0xf8033f,null))[_0xacc4('0x46')](handleError(_0xf8033f,null));};exports['create']=function(_0x39d12b,_0x356ff6){return db['UserProfileSection'][_0xacc4('0x47')](_0x39d12b[_0xacc4('0x48')],{})[_0xacc4('0x23')](respondWithResult(_0x356ff6,0xc9))[_0xacc4('0x46')](handleError(_0x356ff6,null));};exports[_0xacc4('0x21')]=function(_0x64557a,_0xb4a855){if(_0x64557a[_0xacc4('0x48')]['id']){delete _0x64557a['body']['id'];}return db[_0xacc4('0x40')][_0xacc4('0x49')]({'where':{'id':_0x64557a[_0xacc4('0x45')]['id']}})[_0xacc4('0x23')](handleEntityNotFound(_0xb4a855,null))[_0xacc4('0x23')](saveUpdates(_0x64557a[_0xacc4('0x48')],null))['then'](respondWithResult(_0xb4a855,null))[_0xacc4('0x46')](handleError(_0xb4a855,null));};exports['destroy']=function(_0x1d52e8,_0x269c78){return db[_0xacc4('0x40')]['find']({'where':{'id':_0x1d52e8[_0xacc4('0x45')]['id']}})[_0xacc4('0x23')](handleEntityNotFound(_0x269c78,null))['then'](removeEntity(_0x269c78,null))[_0xacc4('0x46')](handleError(_0x269c78,null));};exports[_0xacc4('0x4a')]=function(_0x380c29,_0x22df34){return db[_0xacc4('0x40')]['describe']()[_0xacc4('0x23')](respondWithResult(_0x22df34,null))[_0xacc4('0x46')](handleError(_0x22df34,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index cfd6c3f..af64dcd 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 _0xba21=['userProfileId','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','user_profile_has_sections','compositeIndex'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xba21,0x145));var _0x1ba2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xba21[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1ba2('0x0'));var util=require(_0x1ba2('0x1'));var logger=require(_0x1ba2('0x2'))(_0x1ba2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ba2('0x4'));var rimraf=require(_0x1ba2('0x5'));var config=require(_0x1ba2('0x6'));var attributes=require(_0x1ba2('0x7'));module[_0x1ba2('0x8')]=function(_0x165178,_0x452755){return _0x165178['define']('UserProfileSection',attributes,{'tableName':_0x1ba2('0x9'),'paranoid':![],'indexes':[{'name':_0x1ba2('0xa'),'fields':['sectionId',_0x1ba2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe384=['rimraf','../../config/environment','exports','define','compositeIndex','sectionId','userProfileId','util','moment','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe384,0x10f));var _0x4e38=function(_0x31dca8,_0xf1040a){_0x31dca8=_0x31dca8-0x0;var _0x3a7b54=_0xe384[_0x31dca8];return _0x3a7b54;};'use strict';var _=require('lodash');var util=require(_0x4e38('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4e38('0x1'));var BPromise=require(_0x4e38('0x2'));var rp=require(_0x4e38('0x3'));var fs=require('fs');var path=require(_0x4e38('0x4'));var rimraf=require(_0x4e38('0x5'));var config=require(_0x4e38('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x4e38('0x7')]=function(_0x45dd5a,_0x211984){return _0x45dd5a[_0x4e38('0x8')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x4e38('0x9'),'fields':[_0x4e38('0xa'),_0x4e38('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 2be6341..fb81bc8 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 _0x22ba=['request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug'];(function(_0x548933,_0x2a75d5){var _0x2b0cbc=function(_0x4c85cf){while(--_0x4c85cf){_0x548933['push'](_0x548933['shift']());}};_0x2b0cbc(++_0x2a75d5);}(_0x22ba,0x18e));var _0xa22b=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x22ba[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xa22b('0x0'));var util=require(_0xa22b('0x1'));var moment=require(_0xa22b('0x2'));var BPromise=require(_0xa22b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa22b('0x4'));var db=require(_0xa22b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa22b('0x6'))(_0xa22b('0x7'));var config=require(_0xa22b('0x8'));var jayson=require(_0xa22b('0x9'));var client=jayson[_0xa22b('0xa')][_0xa22b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4db965,_0x45d1ef,_0xf9b9e2){return new BPromise(function(_0x142aa8,_0x54ce3b){return client['request'](_0x4db965,_0xf9b9e2)[_0xa22b('0xc')](function(_0x36b84d){logger[_0xa22b('0xd')](_0xa22b('0xe'),_0x45d1ef,'request\x20sent');logger[_0xa22b('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x45d1ef,_0xa22b('0x10'),JSON[_0xa22b('0x11')](_0x36b84d));if(_0x36b84d['error']){if(_0x36b84d['error'][_0xa22b('0x12')]===0x1f4){logger[_0xa22b('0x13')](_0xa22b('0xe'),_0x45d1ef,_0x36b84d[_0xa22b('0x13')][_0xa22b('0x14')]);return _0x54ce3b(_0x36b84d[_0xa22b('0x13')][_0xa22b('0x14')]);}logger['error'](_0xa22b('0xe'),_0x45d1ef,_0x36b84d[_0xa22b('0x13')][_0xa22b('0x14')]);return _0x142aa8(_0x36b84d[_0xa22b('0x13')]['message']);}else{logger[_0xa22b('0xd')](_0xa22b('0xe'),_0x45d1ef,_0xa22b('0x10'));_0x142aa8(_0x36b84d[_0xa22b('0x15')][_0xa22b('0x14')]);}})[_0xa22b('0x16')](function(_0x1d9a76){logger['error'](_0xa22b('0xe'),_0x45d1ef,_0x1d9a76);_0x54ce3b(_0x1d9a76);});});} \ No newline at end of file +var _0x3c89=['lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x5129e1,_0x4baf70){var _0x58b34e=function(_0x4fd2f7){while(--_0x4fd2f7){_0x5129e1['push'](_0x5129e1['shift']());}};_0x58b34e(++_0x4baf70);}(_0x3c89,0xf2));var _0x93c8=function(_0x207738,_0x18dcfa){_0x207738=_0x207738-0x0;var _0xda3f57=_0x3c89[_0x207738];return _0xda3f57;};'use strict';var _=require(_0x93c8('0x0'));var util=require('util');var moment=require(_0x93c8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93c8('0x2'));var db=require(_0x93c8('0x3'))['db'];var utils=require(_0x93c8('0x4'));var logger=require(_0x93c8('0x5'))(_0x93c8('0x6'));var config=require(_0x93c8('0x7'));var jayson=require(_0x93c8('0x8'));var client=jayson[_0x93c8('0x9')][_0x93c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x581e40,_0x5cf31a,_0x690e0f){return new BPromise(function(_0x4125f0,_0x16cd29){return client[_0x93c8('0xb')](_0x581e40,_0x690e0f)[_0x93c8('0xc')](function(_0x18f23e){logger[_0x93c8('0xd')](_0x93c8('0xe'),_0x5cf31a,_0x93c8('0xf'));logger[_0x93c8('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5cf31a,_0x93c8('0xf'),JSON[_0x93c8('0x11')](_0x18f23e));if(_0x18f23e[_0x93c8('0x12')]){if(_0x18f23e[_0x93c8('0x12')][_0x93c8('0x13')]===0x1f4){logger[_0x93c8('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x5cf31a,_0x18f23e[_0x93c8('0x12')][_0x93c8('0x14')]);return _0x16cd29(_0x18f23e[_0x93c8('0x12')][_0x93c8('0x14')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5cf31a,_0x18f23e[_0x93c8('0x12')][_0x93c8('0x14')]);return _0x4125f0(_0x18f23e['error'][_0x93c8('0x14')]);}else{logger[_0x93c8('0xd')](_0x93c8('0xe'),_0x5cf31a,'request\x20sent');_0x4125f0(_0x18f23e['result'][_0x93c8('0x14')]);}})[_0x93c8('0x15')](function(_0x58e20f){logger[_0x93c8('0x12')](_0x93c8('0xe'),_0x5cf31a,_0x58e20f);_0x16cd29(_0x58e20f);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index cf8c373..fd94967 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x323d15,_0x45e03a){var _0x437850=function(_0x53824c){while(--_0x53824c){_0x323d15['push'](_0x323d15['shift']());}};_0x437850(++_0x45e03a);}(_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 fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x580409,_0x11a6e8){var _0x126a85=function(_0x1ff8a5){while(--_0x1ff8a5){_0x580409['push'](_0x580409['shift']());}};_0x126a85(++_0x11a6e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 09bc2d1..4d0da42 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 _0xdb2f=['exports','INTEGER'];(function(_0x388914,_0x3c63f9){var _0x1f9111=function(_0x23dd69){while(--_0x23dd69){_0x388914['push'](_0x388914['shift']());}};_0x1f9111(++_0x3c63f9);}(_0xdb2f,0x1d8));var _0xfdb2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdb2f[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xfdb2('0x0')]={'penalty':{'type':Sequelize[_0xfdb2('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe75a=['sequelize','exports'];(function(_0x926384,_0x3ae459){var _0x5308b2=function(_0xf5e0b1){while(--_0xf5e0b1){_0x926384['push'](_0x926384['shift']());}};_0x5308b2(++_0x3ae459);}(_0xe75a,0x1de));var _0xae75=function(_0x6eb02d,_0x20bdf5){_0x6eb02d=_0x6eb02d-0x0;var _0xb756de=_0xe75a[_0x6eb02d];return _0xb756de;};'use strict';var Sequelize=require(_0xae75('0x0'));module[_0xae75('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 510cbcf..d058d4c 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 _0x0af5=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x66306a,_0x519133){var _0x3ce3b6=function(_0x22e099){while(--_0x22e099){_0x66306a['push'](_0x66306a['shift']());}};_0x3ce3b6(++_0x519133);}(_0x0af5,0x158));var _0x50af=function(_0x130c19,_0x37e5c9){_0x130c19=_0x130c19-0x0;var _0x1f5f72=_0x0af5[_0x130c19];return _0x1f5f72;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var fs=require('fs');var path=require(_0x50af('0x6'));var rimraf=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var attributes=require(_0x50af('0x9'));module[_0x50af('0xa')]=function(_0xe37b1,_0x5e94f8){return _0xe37b1['define'](_0x50af('0xb'),attributes,{'tableName':_0x50af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0x356a11,_0x5151c2){var _0x238da2=function(_0x231505){while(--_0x231505){_0x356a11['push'](_0x356a11['shift']());}};_0x238da2(++_0x5151c2);}(_0x1a37,0xb4));var _0x71a3=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x1a37[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./userSmsQueue.attributes');module[_0x71a3('0xa')]=function(_0x4f6b7a,_0xd09f7){return _0x4f6b7a[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':_0x71a3('0xd'),'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 10f8e79..5aa0ea8 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 _0xb755=['rpc','../../config/environment','jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb755,0x127));var _0x5b75=function(_0x464b7a,_0x324835){_0x464b7a=_0x464b7a-0x0;var _0x24ab5c=_0xb755[_0x464b7a];return _0x24ab5c;};'use strict';var _=require(_0x5b75('0x0'));var util=require('util');var moment=require(_0x5b75('0x1'));var BPromise=require(_0x5b75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b75('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b75('0x4'));var logger=require('../../config/logger')(_0x5b75('0x5'));var config=require(_0x5b75('0x6'));var jayson=require(_0x5b75('0x7'));var client=jayson[_0x5b75('0x8')][_0x5b75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13a1fb,_0x3691c7,_0x47963a){return new BPromise(function(_0x2d20a2,_0x3fa75a){return client['request'](_0x13a1fb,_0x47963a)[_0x5b75('0xa')](function(_0x561440){logger['info'](_0x5b75('0xb'),_0x3691c7,_0x5b75('0xc'));logger[_0x5b75('0xd')](_0x5b75('0xe'),_0x3691c7,_0x5b75('0xc'),JSON[_0x5b75('0xf')](_0x561440));if(_0x561440['error']){if(_0x561440[_0x5b75('0x10')]['code']===0x1f4){logger[_0x5b75('0x10')](_0x5b75('0xb'),_0x3691c7,_0x561440['error'][_0x5b75('0x11')]);return _0x3fa75a(_0x561440[_0x5b75('0x10')][_0x5b75('0x11')]);}logger[_0x5b75('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x3691c7,_0x561440[_0x5b75('0x10')][_0x5b75('0x11')]);return _0x2d20a2(_0x561440[_0x5b75('0x10')]['message']);}else{logger[_0x5b75('0x12')](_0x5b75('0xb'),_0x3691c7,_0x5b75('0xc'));_0x2d20a2(_0x561440['result'][_0x5b75('0x11')]);}})[_0x5b75('0x13')](function(_0x1e0c15){logger[_0x5b75('0x10')](_0x5b75('0xb'),_0x3691c7,_0x1e0c15);_0x3fa75a(_0x1e0c15);});});} \ No newline at end of file +var _0x953a=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4411ae,_0x202bbb){var _0x5c9635=function(_0x5cf5ea){while(--_0x5cf5ea){_0x4411ae['push'](_0x4411ae['shift']());}};_0x5c9635(++_0x202bbb);}(_0x953a,0x103));var _0xa953=function(_0x163f45,_0x2606ee){_0x163f45=_0x163f45-0x0;var _0x100682=_0x953a[_0x163f45];return _0x100682;};'use strict';var _=require('lodash');var util=require(_0xa953('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa953('0x1'));var fs=require('fs');var Redis=require(_0xa953('0x2'));var db=require(_0xa953('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa953('0x4'))(_0xa953('0x5'));var config=require('../../config/environment');var jayson=require(_0xa953('0x6'));var client=jayson[_0xa953('0x7')][_0xa953('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3313a0,_0x4aa10d,_0x372d88){return new BPromise(function(_0x2a7f81,_0x148b07){return client[_0xa953('0x9')](_0x3313a0,_0x372d88)[_0xa953('0xa')](function(_0x456f7f){logger[_0xa953('0xb')](_0xa953('0xc'),_0x4aa10d,_0xa953('0xd'));logger[_0xa953('0xe')](_0xa953('0xf'),_0x4aa10d,_0xa953('0xd'),JSON[_0xa953('0x10')](_0x456f7f));if(_0x456f7f[_0xa953('0x11')]){if(_0x456f7f[_0xa953('0x11')]['code']===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4aa10d,_0x456f7f['error'][_0xa953('0x12')]);return _0x148b07(_0x456f7f['error'][_0xa953('0x12')]);}logger['error'](_0xa953('0xc'),_0x4aa10d,_0x456f7f[_0xa953('0x11')][_0xa953('0x12')]);return _0x2a7f81(_0x456f7f['error'][_0xa953('0x12')]);}else{logger[_0xa953('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x4aa10d,_0xa953('0xd'));_0x2a7f81(_0x456f7f[_0xa953('0x13')]['message']);}})[_0xa953('0x14')](function(_0x299b82){logger[_0xa953('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x4aa10d,_0x299b82);_0x148b07(_0x299b82);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 0c93972..08a292b 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c91=['exports','INTEGER','sequelize'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x7c91,0x107));var _0x17c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c91[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x17c9('0x0'));module[_0x17c9('0x1')]={'UserId':{'type':Sequelize[_0x17c9('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x17c9('0x2')]}}; \ No newline at end of file +var _0xb917=['INTEGER','sequelize','exports'];(function(_0x154524,_0x2527dc){var _0x22da87=function(_0x54be11){while(--_0x54be11){_0x154524['push'](_0x154524['shift']());}};_0x22da87(++_0x2527dc);}(_0xb917,0x1e1));var _0x7b91=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb917[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7b91('0x0'));module[_0x7b91('0x1')]={'UserId':{'type':Sequelize[_0x7b91('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7b91('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a7dd864..46b90ab 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1d5e05,_0x33e3ac){var _0xf90253=function(_0x3c3181){while(--_0x3c3181){_0x1d5e05['push'](_0x1d5e05['shift']());}};_0xf90253(++_0x33e3ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x734c51,_0x5914d3){var _0xe618df=function(_0x50fd94){while(--_0x50fd94){_0x734c51['push'](_0x734c51['shift']());}};_0xe618df(++_0x5914d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index aced4b7..8388475 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x50865d,_0x47cfcf){var _0x2f4df4=function(_0x165758){while(--_0x165758){_0x50865d['push'](_0x50865d['shift']());}};_0x2f4df4(++_0x47cfcf);}(_0x70e0,0x17b));var _0x070e=function(_0xcbca8f,_0x2612f0){_0xcbca8f=_0xcbca8f-0x0;var _0x50dbaa=_0x70e0[_0xcbca8f];return _0x50dbaa;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xaec478,_0x1703e7){var _0x301e3f=function(_0x22fd25){while(--_0x22fd25){_0xaec478['push'](_0xaec478['shift']());}};_0x301e3f(++_0x1703e7);}(_0x70e0,0x17b));var _0x070e=function(_0x41082e,_0x2888d9){_0x41082e=_0x41082e-0x0;var _0x3bebd4=_0x70e0[_0x41082e];return _0x3bebd4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('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 9006424..7b9d6d2 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9f39=['sequelize','INTEGER'];(function(_0x2c70fc,_0x2864fe){var _0x3eccf4=function(_0x35de2c){while(--_0x35de2c){_0x2c70fc['push'](_0x2c70fc['shift']());}};_0x3eccf4(++_0x2864fe);}(_0x9f39,0x152));var _0x99f3=function(_0x1008bc,_0x193921){_0x1008bc=_0x1008bc-0x0;var _0x551839=_0x9f39[_0x1008bc];return _0x551839;};'use strict';var Sequelize=require(_0x99f3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x99f3('0x1')],'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 77fc06f..3e9cbdc 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 _0xab4a=['request-promise','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','api','moment','bluebird'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0xab4a,0x125));var _0xaab4=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0xab4a[_0x114b7c];return _0x47185f;};'use strict';var _=require(_0xaab4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaab4('0x1'));var moment=require(_0xaab4('0x2'));var BPromise=require(_0xaab4('0x3'));var rp=require(_0xaab4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaab4('0x5'));var config=require('../../config/environment');var attributes=require(_0xaab4('0x6'));module[_0xaab4('0x7')]=function(_0x146ca0,_0x5d7ad6){return _0x146ca0[_0xaab4('0x8')](_0xaab4('0x9'),attributes,{'tableName':_0xaab4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cd1=['moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','util','../../config/logger'];(function(_0xa4acec,_0x257925){var _0x84718e=function(_0x5c66ed){while(--_0x5c66ed){_0xa4acec['push'](_0xa4acec['shift']());}};_0x84718e(++_0x257925);}(_0x9cd1,0xf0));var _0x19cd=function(_0x42c6d6,_0xe9ff7a){_0x42c6d6=_0x42c6d6-0x0;var _0x2057b8=_0x9cd1[_0x42c6d6];return _0x2057b8;};'use strict';var _=require('lodash');var util=require(_0x19cd('0x0'));var logger=require(_0x19cd('0x1'))('api');var moment=require(_0x19cd('0x2'));var BPromise=require(_0x19cd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19cd('0x4'));var rimraf=require(_0x19cd('0x5'));var config=require(_0x19cd('0x6'));var attributes=require(_0x19cd('0x7'));module[_0x19cd('0x8')]=function(_0x3fbb1b,_0x56402f){return _0x3fbb1b['define'](_0x19cd('0x9'),attributes,{'tableName':_0x19cd('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 a73b53c..5aae4a0 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 _0x9c9d=['UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9c9d,0xf0));var _0xd9c9=function(_0x20790c,_0x381c88){_0x20790c=_0x20790c-0x0;var _0x5c8997=_0x9c9d[_0x20790c];return _0x5c8997;};'use strict';var _=require(_0xd9c9('0x0'));var util=require('util');var moment=require(_0xd9c9('0x1'));var BPromise=require(_0xd9c9('0x2'));var rs=require(_0xd9c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9c9('0x4'))['db'];var utils=require(_0xd9c9('0x5'));var logger=require(_0xd9c9('0x6'))(_0xd9c9('0x7'));var config=require(_0xd9c9('0x8'));var jayson=require(_0xd9c9('0x9'));var client=jayson['client'][_0xd9c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x362496,_0x1ace73,_0x454d4a){return new BPromise(function(_0x2acef6,_0x11bcc7){return client[_0xd9c9('0xb')](_0x362496,_0x454d4a)[_0xd9c9('0xc')](function(_0x1c5fb8){logger['info'](_0xd9c9('0xd'),_0x1ace73,'request\x20sent');logger[_0xd9c9('0xe')](_0xd9c9('0xf'),_0x1ace73,_0xd9c9('0x10'),JSON[_0xd9c9('0x11')](_0x1c5fb8));if(_0x1c5fb8[_0xd9c9('0x12')]){if(_0x1c5fb8['error'][_0xd9c9('0x13')]===0x1f4){logger[_0xd9c9('0x12')](_0xd9c9('0xd'),_0x1ace73,_0x1c5fb8[_0xd9c9('0x12')]['message']);return _0x11bcc7(_0x1c5fb8['error'][_0xd9c9('0x14')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1ace73,_0x1c5fb8[_0xd9c9('0x12')]['message']);return _0x2acef6(_0x1c5fb8[_0xd9c9('0x12')][_0xd9c9('0x14')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x1ace73,'request\x20sent');_0x2acef6(_0x1c5fb8[_0xd9c9('0x15')][_0xd9c9('0x14')]);}})[_0xd9c9('0x16')](function(_0x38e026){logger[_0xd9c9('0x12')](_0xd9c9('0xd'),_0x1ace73,_0x38e026);_0x11bcc7(_0x38e026);});});} \ No newline at end of file +var _0x0c00=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x47743d,_0x57306d){var _0x35ad4f=function(_0x21209){while(--_0x21209){_0x47743d['push'](_0x47743d['shift']());}};_0x35ad4f(++_0x57306d);}(_0x0c00,0xb4));var _0x00c0=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x0c00[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x00c0('0x0'));var util=require(_0x00c0('0x1'));var moment=require('moment');var BPromise=require(_0x00c0('0x2'));var rs=require(_0x00c0('0x3'));var fs=require('fs');var Redis=require(_0x00c0('0x4'));var db=require(_0x00c0('0x5'))['db'];var utils=require(_0x00c0('0x6'));var logger=require(_0x00c0('0x7'))('rpc');var config=require(_0x00c0('0x8'));var jayson=require(_0x00c0('0x9'));var client=jayson[_0x00c0('0xa')][_0x00c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3667e9,_0x41967d,_0x4c1f4a){return new BPromise(function(_0xd3d64,_0x2ae7f0){return client[_0x00c0('0xc')](_0x3667e9,_0x4c1f4a)[_0x00c0('0xd')](function(_0x267422){logger[_0x00c0('0xe')](_0x00c0('0xf'),_0x41967d,_0x00c0('0x10'));logger[_0x00c0('0x11')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x41967d,_0x00c0('0x10'),JSON[_0x00c0('0x12')](_0x267422));if(_0x267422[_0x00c0('0x13')]){if(_0x267422[_0x00c0('0x13')]['code']===0x1f4){logger['error'](_0x00c0('0xf'),_0x41967d,_0x267422[_0x00c0('0x13')][_0x00c0('0x14')]);return _0x2ae7f0(_0x267422[_0x00c0('0x13')][_0x00c0('0x14')]);}logger[_0x00c0('0x13')](_0x00c0('0xf'),_0x41967d,_0x267422[_0x00c0('0x13')][_0x00c0('0x14')]);return _0xd3d64(_0x267422[_0x00c0('0x13')][_0x00c0('0x14')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x41967d,_0x00c0('0x10'));_0xd3d64(_0x267422[_0x00c0('0x15')][_0x00c0('0x14')]);}})[_0x00c0('0x16')](function(_0x260864){logger[_0x00c0('0x13')](_0x00c0('0xf'),_0x41967d,_0x260864);_0x2ae7f0(_0x260864);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 8b6cd48..83d79c1 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3bafe6,_0x3432b7){var _0x30bc43=function(_0x1e8389){while(--_0x1e8389){_0x3bafe6['push'](_0x3bafe6['shift']());}};_0x30bc43(++_0x3432b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x11a604,_0x559daf){var _0xe79a7b=function(_0x345239){while(--_0x345239){_0x11a604['push'](_0x11a604['shift']());}};_0xe79a7b(++_0x559daf);}(_0x70e0,0x17b));var _0x070e=function(_0x1a3d8a,_0x1aed6a){_0x1a3d8a=_0x1a3d8a-0x0;var _0x20df9d=_0x70e0[_0x1a3d8a];return _0x20df9d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c4bfb64..4710dc3 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 _0xfafd=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','exports'];(function(_0x263a13,_0x293e3d){var _0x271a57=function(_0x12032e){while(--_0x12032e){_0x263a13['push'](_0x263a13['shift']());}};_0x271a57(++_0x293e3d);}(_0xfafd,0xcc));var _0xdfaf=function(_0x22c525,_0x38acf7){_0x22c525=_0x22c525-0x0;var _0x2c3407=_0xfafd[_0x22c525];return _0x2c3407;};'use strict';var Sequelize=require('sequelize');module[_0xdfaf('0x0')]={'uniqueid':{'type':Sequelize[_0xdfaf('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xdfaf('0x2')},'membername':{'type':Sequelize[_0xdfaf('0x3')],'allowNull':![],'comment':_0xdfaf('0x2')},'UserId':{'type':Sequelize[_0xdfaf('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdfaf('0x3')],'allowNull':![],'unique':_0xdfaf('0x4'),'comment':_0xdfaf('0x2')},'VoiceQueueId':{'type':Sequelize[_0xdfaf('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xdfaf('0x3')],'allowNull':![],'unique':_0xdfaf('0x4'),'comment':_0xdfaf('0x2')},'penalty':{'type':Sequelize[_0xdfaf('0x1')](0xb),'defaultValue':0x0,'comment':_0xdfaf('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xdfaf('0x2')}}; \ No newline at end of file +var _0x3178=['INTEGER','sequelize','exports','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x4a56f1,_0x27dbb7){var _0x1f909c=function(_0x436c4b){while(--_0x436c4b){_0x4a56f1['push'](_0x4a56f1['shift']());}};_0x1f909c(++_0x27dbb7);}(_0x3178,0x7f));var _0x8317=function(_0x34a602,_0x2c0a1b){_0x34a602=_0x34a602-0x0;var _0x6c20ec=_0x3178[_0x34a602];return _0x6c20ec;};'use strict';var Sequelize=require(_0x8317('0x0'));module[_0x8317('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x8317('0x2')},'membername':{'type':Sequelize[_0x8317('0x3')],'allowNull':![],'comment':_0x8317('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x8317('0x3')],'allowNull':![],'unique':_0x8317('0x4'),'comment':_0x8317('0x2')},'VoiceQueueId':{'type':Sequelize[_0x8317('0x5')],'allowNull':![]},'interface':{'type':Sequelize[_0x8317('0x3')],'allowNull':![],'unique':_0x8317('0x4'),'comment':_0x8317('0x2')},'penalty':{'type':Sequelize[_0x8317('0x5')](0xb),'defaultValue':0x0,'comment':_0x8317('0x2')},'paused':{'type':Sequelize[_0x8317('0x5')](0xb),'defaultValue':0x0,'comment':_0x8317('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index f7d0ac4..cc21b82 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 _0x7054=['exports','events','../../mysqldb','update','remove','emit'];(function(_0x591aed,_0x1ba0ac){var _0x730a30=function(_0x591d72){while(--_0x591d72){_0x591aed['push'](_0x591aed['shift']());}};_0x730a30(++_0x1ba0ac);}(_0x7054,0x1e1));var _0x4705=function(_0x5ecc63,_0x110d0d){_0x5ecc63=_0x5ecc63-0x0;var _0x56e65f=_0x7054[_0x5ecc63];return _0x56e65f;};'use strict';var EventEmitter=require(_0x4705('0x0'));var UserVoiceQueueRt=require(_0x4705('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4705('0x2'),'afterDestroy':_0x4705('0x3')};function emitEvent(_0x839d65){return function(_0x50326f,_0x20c47e,_0x3f1a54){UserVoiceQueueRtEvents['emit'](_0x839d65+':'+_0x50326f['id'],_0x50326f);UserVoiceQueueRtEvents[_0x4705('0x4')](_0x839d65,_0x50326f);_0x3f1a54(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4705('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0186=['emit','hasOwnProperty','exports','events','UserVoiceQueueRt','save','update'];(function(_0x369e8d,_0x42ad4e){var _0x30e513=function(_0xf248cc){while(--_0xf248cc){_0x369e8d['push'](_0x369e8d['shift']());}};_0x30e513(++_0x42ad4e);}(_0x0186,0x15a));var _0x6018=function(_0x2b5fda,_0x2f2cc2){_0x2b5fda=_0x2b5fda-0x0;var _0x3d17db=_0x0186[_0x2b5fda];return _0x3d17db;};'use strict';var EventEmitter=require(_0x6018('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x6018('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6018('0x2'),'afterUpdate':_0x6018('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cfec9){return function(_0x31217b,_0x543d59,_0x42f3f4){UserVoiceQueueRtEvents[_0x6018('0x4')](_0x3cfec9+':'+_0x31217b['id'],_0x31217b);UserVoiceQueueRtEvents[_0x6018('0x4')](_0x3cfec9,_0x31217b);_0x42f3f4(null);};}for(var e in events){if(events[_0x6018('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x6018('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c7c8423..48b33ff 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 _0x97fb=['bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment'];(function(_0x58cee1,_0x2b5a65){var _0x11db32=function(_0x21daa8){while(--_0x21daa8){_0x58cee1['push'](_0x58cee1['shift']());}};_0x11db32(++_0x2b5a65);}(_0x97fb,0x14d));var _0xb97f=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x97fb[_0x441563];return _0x2369ec;};'use strict';var _=require(_0xb97f('0x0'));var util=require(_0xb97f('0x1'));var logger=require(_0xb97f('0x2'))(_0xb97f('0x3'));var moment=require(_0xb97f('0x4'));var BPromise=require(_0xb97f('0x5'));var rp=require(_0xb97f('0x6'));var fs=require('fs');var path=require(_0xb97f('0x7'));var rimraf=require('rimraf');var config=require(_0xb97f('0x8'));var attributes=require(_0xb97f('0x9'));module[_0xb97f('0xa')]=function(_0x2496ff,_0x483c44){return _0x2496ff[_0xb97f('0xb')](_0xb97f('0xc'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d2=['define','UserVoiceQueueRt','user_has_voice_queues_rt','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports'];(function(_0x1bbfd8,_0x4c8511){var _0x4bf75a=function(_0x3c9fb0){while(--_0x3c9fb0){_0x1bbfd8['push'](_0x1bbfd8['shift']());}};_0x4bf75a(++_0x4c8511);}(_0xa2d2,0x6f));var _0x2a2d=function(_0x150490,_0x794fbf){_0x150490=_0x150490-0x0;var _0x1fffd7=_0xa2d2[_0x150490];return _0x1fffd7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2a2d('0x0'));var moment=require(_0x2a2d('0x1'));var BPromise=require(_0x2a2d('0x2'));var rp=require(_0x2a2d('0x3'));var fs=require('fs');var path=require(_0x2a2d('0x4'));var rimraf=require(_0x2a2d('0x5'));var config=require(_0x2a2d('0x6'));var attributes=require(_0x2a2d('0x7'));module[_0x2a2d('0x8')]=function(_0x9a2bc7,_0x8bc704){return _0x9a2bc7[_0x2a2d('0x9')](_0x2a2d('0xa'),attributes,{'tableName':_0x2a2d('0xb'),'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 68dbf8c..b5ee237 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 _0x2b62=['stringify','error','code','message','catch','GetVoiceQueueRtPauses','options','raw','where','sequelize','COUNT','literal','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x13aa63,_0x2b0567){var _0x56315d=function(_0x5a6cc0){while(--_0x5a6cc0){_0x13aa63['push'](_0x13aa63['shift']());}};_0x56315d(++_0x2b0567);}(_0x2b62,0x136));var _0x22b6=function(_0x4947b8,_0x2cf432){_0x4947b8=_0x4947b8-0x0;var _0x3f655b=_0x2b62[_0x4947b8];return _0x3f655b;};'use strict';var _=require(_0x22b6('0x0'));var util=require(_0x22b6('0x1'));var moment=require('moment');var BPromise=require(_0x22b6('0x2'));var rs=require(_0x22b6('0x3'));var fs=require('fs');var Redis=require(_0x22b6('0x4'));var db=require(_0x22b6('0x5'))['db'];var utils=require(_0x22b6('0x6'));var logger=require('../../config/logger')(_0x22b6('0x7'));var config=require(_0x22b6('0x8'));var jayson=require(_0x22b6('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x22b6('0xa')]=_[_0x22b6('0xb')](config['redis'],{'host':_0x22b6('0xc'),'port':0x18eb});var socket=require(_0x22b6('0xd'))(new Redis(config['redis']));require(_0x22b6('0xe'))[_0x22b6('0xf')](socket);function respondWithRpcPromise(_0xb63bbf,_0x402f34,_0x3279b7){return new BPromise(function(_0x36a7dd,_0x3f2e78){return client['request'](_0xb63bbf,_0x3279b7)['then'](function(_0x5c446b){logger[_0x22b6('0x10')](_0x22b6('0x11'),_0x402f34,_0x22b6('0x12'));logger[_0x22b6('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x402f34,'request\x20sent',JSON[_0x22b6('0x14')](_0x5c446b));if(_0x5c446b[_0x22b6('0x15')]){if(_0x5c446b[_0x22b6('0x15')][_0x22b6('0x16')]===0x1f4){logger[_0x22b6('0x15')](_0x22b6('0x11'),_0x402f34,_0x5c446b[_0x22b6('0x15')][_0x22b6('0x17')]);return _0x3f2e78(_0x5c446b[_0x22b6('0x15')][_0x22b6('0x17')]);}logger[_0x22b6('0x15')](_0x22b6('0x11'),_0x402f34,_0x5c446b[_0x22b6('0x15')]['message']);return _0x36a7dd(_0x5c446b[_0x22b6('0x15')][_0x22b6('0x17')]);}else{logger[_0x22b6('0x10')](_0x22b6('0x11'),_0x402f34,_0x22b6('0x12'));_0x36a7dd(_0x5c446b['result']['message']);}})[_0x22b6('0x18')](function(_0x566ae4){logger[_0x22b6('0x15')](_0x22b6('0x11'),_0x402f34,_0x566ae4);_0x3f2e78(_0x566ae4);});});}exports[_0x22b6('0x19')]=function(_0x21b14d){var _0x11033f=this;return new Promise(function(_0x57e6cf,_0x38717b){return db['UserVoiceQueueRt']['findAll']({'raw':_0x21b14d[_0x22b6('0x1a')]?_0x21b14d[_0x22b6('0x1a')][_0x22b6('0x1b')]===undefined?!![]:![]:!![],'where':_0x21b14d[_0x22b6('0x1a')]?_0x21b14d[_0x22b6('0x1a')][_0x22b6('0x1c')]||null:null,'attributes':[[db[_0x22b6('0x1d')]['fn'](_0x22b6('0x1e'),db[_0x22b6('0x1d')]['fn']('IF',db[_0x22b6('0x1d')][_0x22b6('0x1f')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x22b6('0x20')](function(_0x2733bc){logger[_0x22b6('0x10')](_0x22b6('0x19'),_0x21b14d);logger[_0x22b6('0x13')]('GetVoiceQueueRtPauses',_0x21b14d,JSON['stringify'](_0x2733bc));_0x57e6cf(_0x2733bc);})['catch'](function(_0x3f98dd){logger['error'](_0x22b6('0x19'),_0x3f98dd['message'],_0x21b14d);_0x38717b(_0x11033f[_0x22b6('0x15')](0x1f4,_0x3f98dd['message']));});});}; \ No newline at end of file +var _0xe968=['COUNT','debug','lodash','util','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xe968,0x182));var _0x8e96=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe968[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x8e96('0x0'));var util=require(_0x8e96('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e96('0x2'));var fs=require('fs');var Redis=require(_0x8e96('0x3'));var db=require(_0x8e96('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e96('0x5'));var config=require('../../config/environment');var jayson=require(_0x8e96('0x6'));var client=jayson[_0x8e96('0x7')][_0x8e96('0x8')]({'port':0x232a});config[_0x8e96('0x9')]=_[_0x8e96('0xa')](config[_0x8e96('0x9')],{'host':_0x8e96('0xb'),'port':0x18eb});var socket=require(_0x8e96('0xc'))(new Redis(config[_0x8e96('0x9')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x4e1cb3,_0x3bdd24,_0x565ae0){return new BPromise(function(_0x256918,_0x323e6e){return client['request'](_0x4e1cb3,_0x565ae0)[_0x8e96('0xd')](function(_0x4228d2){logger[_0x8e96('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bdd24,_0x8e96('0xf'));logger['debug'](_0x8e96('0x10'),_0x3bdd24,'request\x20sent',JSON[_0x8e96('0x11')](_0x4228d2));if(_0x4228d2[_0x8e96('0x12')]){if(_0x4228d2['error'][_0x8e96('0x13')]===0x1f4){logger[_0x8e96('0x12')](_0x8e96('0x14'),_0x3bdd24,_0x4228d2['error'][_0x8e96('0x15')]);return _0x323e6e(_0x4228d2['error'][_0x8e96('0x15')]);}logger[_0x8e96('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bdd24,_0x4228d2[_0x8e96('0x12')][_0x8e96('0x15')]);return _0x256918(_0x4228d2[_0x8e96('0x12')][_0x8e96('0x15')]);}else{logger[_0x8e96('0xe')](_0x8e96('0x14'),_0x3bdd24,_0x8e96('0xf'));_0x256918(_0x4228d2[_0x8e96('0x16')]['message']);}})[_0x8e96('0x17')](function(_0x642930){logger[_0x8e96('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bdd24,_0x642930);_0x323e6e(_0x642930);});});}exports[_0x8e96('0x18')]=function(_0x3f8c0f){var _0x54abca=this;return new Promise(function(_0x4968a6,_0x1b3d88){return db[_0x8e96('0x19')][_0x8e96('0x1a')]({'raw':_0x3f8c0f[_0x8e96('0x1b')]?_0x3f8c0f[_0x8e96('0x1b')][_0x8e96('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f8c0f['options']?_0x3f8c0f[_0x8e96('0x1b')]['where']||null:null,'attributes':[[db[_0x8e96('0x1d')]['fn'](_0x8e96('0x1e'),db[_0x8e96('0x1d')]['fn']('IF',db[_0x8e96('0x1d')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})['then'](function(_0x17dfce){logger['info'](_0x8e96('0x18'),_0x3f8c0f);logger[_0x8e96('0x1f')](_0x8e96('0x18'),_0x3f8c0f,JSON[_0x8e96('0x11')](_0x17dfce));_0x4968a6(_0x17dfce);})[_0x8e96('0x17')](function(_0x3d0a24){logger[_0x8e96('0x12')](_0x8e96('0x18'),_0x3d0a24[_0x8e96('0x15')],_0x3f8c0f);_0x1b3d88(_0x54abca['error'](0x1f4,_0x3d0a24[_0x8e96('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index a4ec9ed..fd5ea46 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 _0x71ab=['length','userVoiceQueueRt:','save','update','emit','removeListener','register'];(function(_0x3140a4,_0xcc98bb){var _0x29d0c8=function(_0x5055f7){while(--_0x5055f7){_0x3140a4['push'](_0x3140a4['shift']());}};_0x29d0c8(++_0xcc98bb);}(_0x71ab,0x64));var _0xb71a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x71ab[_0x3947c9];return _0x2e7871;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xb71a('0x0'),'remove',_0xb71a('0x1')];function createListener(_0x5bdf89,_0x3e985a){return function(_0x3f0529){_0x3e985a[_0xb71a('0x2')](_0x5bdf89,_0x3f0529);};}function removeListener(_0x4094b2,_0x37ce74){return function(){UserVoiceQueueRtEvents[_0xb71a('0x3')](_0x4094b2,_0x37ce74);};}exports[_0xb71a('0x4')]=function(_0x38d931){for(var _0x22c072=0x0,_0x35a84e=events[_0xb71a('0x5')];_0x22c072<_0x35a84e;_0x22c072++){var _0x2a4c86=events[_0x22c072];var _0x43ca14=createListener(_0xb71a('0x6')+_0x2a4c86,_0x38d931);UserVoiceQueueRtEvents['on'](_0x2a4c86,_0x43ca14);}}; \ No newline at end of file +var _0x29eb=['remove','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x2a1832,_0x2149a0){var _0x51f72e=function(_0x206dc1){while(--_0x206dc1){_0x2a1832['push'](_0x2a1832['shift']());}};_0x51f72e(++_0x2149a0);}(_0x29eb,0x1c5));var _0xb29e=function(_0x2f15fe,_0x20749d){_0x2f15fe=_0x2f15fe-0x0;var _0x13f917=_0x29eb[_0x2f15fe];return _0x13f917;};'use strict';var UserVoiceQueueRtEvents=require(_0xb29e('0x0'));var events=[_0xb29e('0x1'),_0xb29e('0x2'),'update'];function createListener(_0x194ba3,_0x443c9c){return function(_0xbacdd6){_0x443c9c['emit'](_0x194ba3,_0xbacdd6);};}function removeListener(_0x29356f,_0x4c648e){return function(){UserVoiceQueueRtEvents[_0xb29e('0x3')](_0x29356f,_0x4c648e);};}exports[_0xb29e('0x4')]=function(_0x3426f3){for(var _0x2e216f=0x0,_0x4dde31=events[_0xb29e('0x5')];_0x2e216f<_0x4dde31;_0x2e216f++){var _0x5bf1ae=events[_0x2e216f];var _0x1995ab=createListener(_0xb29e('0x6')+_0x5bf1ae,_0x3426f3);UserVoiceQueueRtEvents['on'](_0x5bf1ae,_0x1995ab);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 1996e8c..3e86f00 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2594b5,_0x1f0ec9){var _0x989874=function(_0x2fade4){while(--_0x2fade4){_0x2594b5['push'](_0x2594b5['shift']());}};_0x989874(++_0x1f0ec9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x59ef57,_0x3c2021){var _0x4b0784=function(_0x37e8e2){while(--_0x37e8e2){_0x59ef57['push'](_0x59ef57['shift']());}};_0x4b0784(++_0x3c2021);}(_0xe706,0xa3));var _0x6e70=function(_0xf7ff4,_0x543a19){_0xf7ff4=_0xf7ff4-0x0;var _0x554e6a=_0xe706[_0xf7ff4];return _0x554e6a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 66ce32f..5a56daf 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ec0=['INTEGER','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5ec0,0x10d));var _0x05ec=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5ec0[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x05ec('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x05ec('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaa21=['INTEGER'];(function(_0x101076,_0x5c8f3f){var _0x2d873d=function(_0xac9f4f){while(--_0xac9f4f){_0x101076['push'](_0x101076['shift']());}};_0x2d873d(++_0x5c8f3f);}(_0xaa21,0x17e));var _0x1aa2=function(_0x312e07,_0x4b0626){_0x312e07=_0x312e07-0x0;var _0xed31a4=_0xaa21[_0x312e07];return _0xed31a4;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x1aa2('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index dee29b6..165418e 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce8e=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','bluebird','../../config/environment','exports','define'];(function(_0xd3e90b,_0x38f368){var _0x2ca5a9=function(_0x5ef9a1){while(--_0x5ef9a1){_0xd3e90b['push'](_0xd3e90b['shift']());}};_0x2ca5a9(++_0x38f368);}(_0xce8e,0x19c));var _0xece8=function(_0x10a665,_0x13f460){_0x10a665=_0x10a665-0x0;var _0x3f95a9=_0xce8e[_0x10a665];return _0x3f95a9;};'use strict';var _=require(_0xece8('0x0'));var util=require(_0xece8('0x1'));var logger=require(_0xece8('0x2'))(_0xece8('0x3'));var moment=require('moment');var BPromise=require(_0xece8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xece8('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0xece8('0x6')]=function(_0x2e3a99,_0x50eaf4){return _0x2e3a99[_0xece8('0x7')](_0xece8('0x8'),attributes,{'tableName':_0xece8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dcf=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','lodash'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x5dcf,0x154));var _0xf5dc=function(_0x1cc0a0,_0x29319d){_0x1cc0a0=_0x1cc0a0-0x0;var _0x43e0b5=_0x5dcf[_0x1cc0a0];return _0x43e0b5;};'use strict';var _=require(_0xf5dc('0x0'));var util=require(_0xf5dc('0x1'));var logger=require(_0xf5dc('0x2'))(_0xf5dc('0x3'));var moment=require(_0xf5dc('0x4'));var BPromise=require(_0xf5dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5dc('0x6'));var rimraf=require(_0xf5dc('0x7'));var config=require(_0xf5dc('0x8'));var attributes=require(_0xf5dc('0x9'));module['exports']=function(_0x41a477,_0x48ab2d){return _0x41a477[_0xf5dc('0xa')]('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 7a237c3..267d1b7 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0f7=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x1bb0b8,_0x24add2){var _0x22fc67=function(_0x2e051d){while(--_0x2e051d){_0x1bb0b8['push'](_0x1bb0b8['shift']());}};_0x22fc67(++_0x24add2);}(_0xf0f7,0x1ee));var _0x7f0f=function(_0x485430,_0x33b15f){_0x485430=_0x485430-0x0;var _0x1558da=_0xf0f7[_0x485430];return _0x1558da;};'use strict';var _=require(_0x7f0f('0x0'));var util=require(_0x7f0f('0x1'));var moment=require('moment');var BPromise=require(_0x7f0f('0x2'));var rs=require(_0x7f0f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f0f('0x4'))['db'];var utils=require(_0x7f0f('0x5'));var logger=require(_0x7f0f('0x6'))(_0x7f0f('0x7'));var config=require(_0x7f0f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7f0f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ddb0,_0x3a2090,_0x570ec1){return new BPromise(function(_0x3b0a70,_0x5e0d34){return client[_0x7f0f('0xa')](_0x41ddb0,_0x570ec1)[_0x7f0f('0xb')](function(_0xa95a6a){logger[_0x7f0f('0xc')](_0x7f0f('0xd'),_0x3a2090,_0x7f0f('0xe'));logger[_0x7f0f('0xf')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3a2090,'request\x20sent',JSON['stringify'](_0xa95a6a));if(_0xa95a6a[_0x7f0f('0x10')]){if(_0xa95a6a[_0x7f0f('0x10')][_0x7f0f('0x11')]===0x1f4){logger[_0x7f0f('0x10')](_0x7f0f('0xd'),_0x3a2090,_0xa95a6a[_0x7f0f('0x10')][_0x7f0f('0x12')]);return _0x5e0d34(_0xa95a6a[_0x7f0f('0x10')]['message']);}logger[_0x7f0f('0x10')](_0x7f0f('0xd'),_0x3a2090,_0xa95a6a['error']['message']);return _0x3b0a70(_0xa95a6a[_0x7f0f('0x10')][_0x7f0f('0x12')]);}else{logger['info'](_0x7f0f('0xd'),_0x3a2090,'request\x20sent');_0x3b0a70(_0xa95a6a[_0x7f0f('0x13')][_0x7f0f('0x12')]);}})[_0x7f0f('0x14')](function(_0x420f6e){logger['error'](_0x7f0f('0xd'),_0x3a2090,_0x420f6e);_0x5e0d34(_0x420f6e);});});} \ No newline at end of file +var _0xabc7=['code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0xabc7,0x194));var _0x7abc=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xabc7[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x7abc('0x0'));var util=require(_0x7abc('0x1'));var moment=require('moment');var BPromise=require(_0x7abc('0x2'));var rs=require(_0x7abc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7abc('0x4'))['db'];var utils=require(_0x7abc('0x5'));var logger=require(_0x7abc('0x6'))('rpc');var config=require(_0x7abc('0x7'));var jayson=require(_0x7abc('0x8'));var client=jayson['client'][_0x7abc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50c3ac,_0x288bd5,_0x18e5d6){return new BPromise(function(_0x76bfc7,_0x256126){return client['request'](_0x50c3ac,_0x18e5d6)['then'](function(_0x1def9f){logger[_0x7abc('0xa')](_0x7abc('0xb'),_0x288bd5,'request\x20sent');logger[_0x7abc('0xc')](_0x7abc('0xd'),_0x288bd5,'request\x20sent',JSON[_0x7abc('0xe')](_0x1def9f));if(_0x1def9f[_0x7abc('0xf')]){if(_0x1def9f['error'][_0x7abc('0x10')]===0x1f4){logger[_0x7abc('0xf')](_0x7abc('0xb'),_0x288bd5,_0x1def9f[_0x7abc('0xf')][_0x7abc('0x11')]);return _0x256126(_0x1def9f[_0x7abc('0xf')]['message']);}logger['error'](_0x7abc('0xb'),_0x288bd5,_0x1def9f[_0x7abc('0xf')][_0x7abc('0x11')]);return _0x76bfc7(_0x1def9f['error'][_0x7abc('0x11')]);}else{logger[_0x7abc('0xa')](_0x7abc('0xb'),_0x288bd5,_0x7abc('0x12'));_0x76bfc7(_0x1def9f[_0x7abc('0x13')][_0x7abc('0x11')]);}})[_0x7abc('0x14')](function(_0x15f7a1){logger[_0x7abc('0xf')](_0x7abc('0xb'),_0x288bd5,_0x15f7a1);_0x256126(_0x15f7a1);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index d74108c..e1da854 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 _0x6953=['../../config/environment','get','index','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x6953,0x91));var _0x3695=function(_0x41cd93,_0x382eb8){_0x41cd93=_0x41cd93-0x0;var _0x58a7f8=_0x6953[_0x41cd93];return _0x58a7f8;};'use strict';var multer=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3695('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3695('0x3'));var interaction=require(_0x3695('0x4'));var config=require(_0x3695('0x5'));var controller=require('./variable.controller');router[_0x3695('0x6')]('/',auth['isAuthenticated'](),controller[_0x3695('0x7')]);router[_0x3695('0x6')](_0x3695('0x8'),auth[_0x3695('0x9')](),controller[_0x3695('0xa')]);router['post']('/',auth[_0x3695('0x9')](),controller['create']);router[_0x3695('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3695('0xc')]);router['delete'](_0x3695('0x8'),auth[_0x3695('0x9')](),controller[_0x3695('0xd')]);module[_0x3695('0xe')]=router; \ No newline at end of file +var _0x534d=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x627b1b,_0x462114){var _0x2fd022=function(_0x2059c5){while(--_0x2059c5){_0x627b1b['push'](_0x627b1b['shift']());}};_0x2fd022(++_0x462114);}(_0x534d,0x79));var _0xd534=function(_0x40c4ac,_0x4d700d){_0x40c4ac=_0x40c4ac-0x0;var _0x5bd8c0=_0x534d[_0x40c4ac];return _0x5bd8c0;};'use strict';var multer=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var path=require(_0xd534('0x2'));var timeout=require(_0xd534('0x3'));var express=require(_0xd534('0x4'));var router=express[_0xd534('0x5')]();var fs_extra=require(_0xd534('0x6'));var auth=require(_0xd534('0x7'));var interaction=require(_0xd534('0x8'));var config=require(_0xd534('0x9'));var controller=require(_0xd534('0xa'));router[_0xd534('0xb')]('/',auth[_0xd534('0xc')](),controller[_0xd534('0xd')]);router[_0xd534('0xb')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0xf')]);router[_0xd534('0x10')]('/',auth['isAuthenticated'](),controller[_0xd534('0x11')]);router[_0xd534('0x12')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x13')]);router['delete'](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x14')]);module[_0xd534('0x15')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 5a4dfb0..896a46d 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 _0x08a2=['STRING','name'];(function(_0x1b811c,_0x3b93f7){var _0x2d93ac=function(_0x5d2e4c){while(--_0x5d2e4c){_0x1b811c['push'](_0x1b811c['shift']());}};_0x2d93ac(++_0x3b93f7);}(_0x08a2,0xd2));var _0x208a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x08a2[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x208a('0x0')],'unique':_0x208a('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x208a('0x0')]}}; \ No newline at end of file +var _0xa82a=['exports','STRING','name','sequelize'];(function(_0x4b3069,_0x2872df){var _0x152d6a=function(_0x2019ee){while(--_0x2019ee){_0x4b3069['push'](_0x4b3069['shift']());}};_0x152d6a(++_0x2872df);}(_0xa82a,0x1e7));var _0xaa82=function(_0xc3e2c,_0x2b733d){_0xc3e2c=_0xc3e2c-0x0;var _0x2cc4f1=_0xa82a[_0xc3e2c];return _0x2cc4f1;};'use strict';var Sequelize=require(_0xaa82('0x0'));module[_0xaa82('0x1')]={'name':{'type':Sequelize[_0xaa82('0x2')],'unique':_0xaa82('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaa82('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 188a008..dca5b82 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 _0xcdcf=['error','name','send','Variable','rawAttributes','type','map','query','keys','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','Variables','UserProfileResource'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdcf,0x77));var _0xfcdc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdcf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfcdc('0x0'));var rimraf=require(_0xfcdc('0x1'));var zipdir=require(_0xfcdc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfcdc('0x3'));var path=require(_0xfcdc('0x4'));var sox=require(_0xfcdc('0x5'));var csv=require(_0xfcdc('0x6'));var ejs=require(_0xfcdc('0x7'));var fs=require('fs');var fs_extra=require(_0xfcdc('0x8'));var _=require(_0xfcdc('0x9'));var squel=require(_0xfcdc('0xa'));var crypto=require(_0xfcdc('0xb'));var jsforce=require(_0xfcdc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfcdc('0x6'));var querystring=require(_0xfcdc('0xd'));var Papa=require(_0xfcdc('0xe'));var Redis=require(_0xfcdc('0xf'));var authService=require(_0xfcdc('0x10'));var qs=require(_0xfcdc('0x11'));var as=require(_0xfcdc('0x12'));var hardwareService=require(_0xfcdc('0x13'));var logger=require(_0xfcdc('0x14'))('api');var utils=require(_0xfcdc('0x15'));var config=require(_0xfcdc('0x16'));var licenseUtil=require(_0xfcdc('0x17'));var db=require(_0xfcdc('0x18'))['db'];function respondWithStatusCode(_0x48a7b9,_0x23cc4e){_0x23cc4e=_0x23cc4e||0xcc;return function(_0x1d0431){if(_0x1d0431){return _0x48a7b9['sendStatus'](_0x23cc4e);}return _0x48a7b9[_0xfcdc('0x19')](_0x23cc4e)[_0xfcdc('0x1a')]();};}function respondWithResult(_0x4519cd,_0x272eeb){_0x272eeb=_0x272eeb||0xc8;return function(_0x4684b4){if(_0x4684b4){return _0x4519cd['status'](_0x272eeb)[_0xfcdc('0x1b')](_0x4684b4);}};}function respondWithFilteredResult(_0x20eab8,_0x4d823f){return function(_0x3cf301){if(_0x3cf301){var _0x33a047=typeof _0x4d823f[_0xfcdc('0x1c')]===_0xfcdc('0x1d')&&typeof _0x4d823f[_0xfcdc('0x1e')]===_0xfcdc('0x1d');var _0x5aca46=_0x3cf301[_0xfcdc('0x1f')];var _0x348c37=_0x33a047?0x0:_0x4d823f['offset'];var _0x59dee4=_0x33a047?_0x3cf301[_0xfcdc('0x1f')]:_0x4d823f[_0xfcdc('0x1c')]+_0x4d823f[_0xfcdc('0x1e')];var _0x3113fd;if(_0x59dee4>=_0x5aca46){_0x59dee4=_0x5aca46;_0x3113fd=0xc8;}else{_0x3113fd=0xce;}_0x20eab8['status'](_0x3113fd);return _0x20eab8['set'](_0xfcdc('0x20'),_0x348c37+'-'+_0x59dee4+'/'+_0x5aca46)[_0xfcdc('0x1b')](_0x3cf301);}return null;};}function patchUpdates(_0xda3d0e){return function(_0x4e988d){try{jsonpatch[_0xfcdc('0x21')](_0x4e988d,_0xda3d0e,!![]);}catch(_0x5f1c23){return BPromise[_0xfcdc('0x22')](_0x5f1c23);}return _0x4e988d[_0xfcdc('0x23')]();};}function saveUpdates(_0x3785eb,_0x1b86de){return function(_0x365172){if(_0x365172){return _0x365172['update'](_0x3785eb)[_0xfcdc('0x24')](function(_0x245f47){return _0x245f47;});}return null;};}function removeEntity(_0x40cfb9,_0x4bdc1a){return function(_0x3f915d){if(_0x3f915d){return _0x3f915d[_0xfcdc('0x25')]()[_0xfcdc('0x24')](function(){var _0x167177=_0x3f915d[_0xfcdc('0x26')]({'plain':!![]});var _0x3c0897=_0xfcdc('0x27');return db[_0xfcdc('0x28')][_0xfcdc('0x25')]({'where':{'type':_0x3c0897,'resourceId':_0x167177['id']}})['then'](function(){return _0x3f915d;});})['then'](function(){_0x40cfb9['status'](0xcc)[_0xfcdc('0x1a')]();});}};}function handleEntityNotFound(_0x3703ba,_0x5c5198){return function(_0x3ed22f){if(!_0x3ed22f){_0x3703ba['sendStatus'](0x194);}return _0x3ed22f;};}function handleError(_0x26ab81,_0x1222d3){_0x1222d3=_0x1222d3||0x1f4;return function(_0x5ae360){logger[_0xfcdc('0x29')](_0x5ae360['stack']);if(_0x5ae360[_0xfcdc('0x2a')]){delete _0x5ae360[_0xfcdc('0x2a')];}_0x26ab81['status'](_0x1222d3)[_0xfcdc('0x2b')](_0x5ae360);};}exports['index']=function(_0x4e07d5,_0x3bdca4){var _0x4948ed={},_0x4b4f9f={},_0x58c719={'count':0x0,'rows':[]};var _0x165a8e=_['map'](db[_0xfcdc('0x2c')][_0xfcdc('0x2d')],function(_0xe8b145){return{'name':_0xe8b145['fieldName'],'type':_0xe8b145[_0xfcdc('0x2e')]['key']};});_0x4b4f9f['model']=_[_0xfcdc('0x2f')](_0x165a8e,_0xfcdc('0x2a'));_0x4b4f9f[_0xfcdc('0x30')]=_[_0xfcdc('0x31')](_0x4e07d5['query']);_0x4b4f9f['filters']=_['intersection'](_0x4b4f9f[_0xfcdc('0x32')],_0x4b4f9f[_0xfcdc('0x30')]);_0x4948ed[_0xfcdc('0x33')]=_[_0xfcdc('0x34')](_0x4b4f9f[_0xfcdc('0x32')],qs[_0xfcdc('0x35')](_0x4e07d5[_0xfcdc('0x30')][_0xfcdc('0x35')]));_0x4948ed[_0xfcdc('0x33')]=_0x4948ed[_0xfcdc('0x33')]['length']?_0x4948ed[_0xfcdc('0x33')]:_0x4b4f9f['model'];if(!_0x4e07d5[_0xfcdc('0x30')][_0xfcdc('0x36')]('nolimit')){_0x4948ed[_0xfcdc('0x1e')]=qs['limit'](_0x4e07d5[_0xfcdc('0x30')][_0xfcdc('0x1e')]);_0x4948ed[_0xfcdc('0x1c')]=qs['offset'](_0x4e07d5[_0xfcdc('0x30')]['offset']);}_0x4948ed[_0xfcdc('0x37')]=qs[_0xfcdc('0x38')](_0x4e07d5[_0xfcdc('0x30')][_0xfcdc('0x38')]);_0x4948ed[_0xfcdc('0x39')]=qs[_0xfcdc('0x3a')](_[_0xfcdc('0x3b')](_0x4e07d5['query'],_0x4b4f9f[_0xfcdc('0x3a')]),_0x165a8e);if(_0x4e07d5['query'][_0xfcdc('0x3c')]){_0x4948ed[_0xfcdc('0x39')]=_[_0xfcdc('0x3d')](_0x4948ed[_0xfcdc('0x39')],{'$or':_[_0xfcdc('0x2f')](_0x165a8e,function(_0x53e713){if(_0x53e713[_0xfcdc('0x2e')]!==_0xfcdc('0x3e')){var _0x14efff={};_0x14efff[_0x53e713[_0xfcdc('0x2a')]]={'$like':'%'+_0x4e07d5[_0xfcdc('0x30')][_0xfcdc('0x3c')]+'%'};return _0x14efff;}})});}_0x4948ed=_['merge']({},_0x4948ed,_0x4e07d5[_0xfcdc('0x3f')]);var _0x4bdff4={'where':_0x4948ed[_0xfcdc('0x39')]};return db['Variable'][_0xfcdc('0x1f')](_0x4bdff4)[_0xfcdc('0x24')](function(_0x2700b4){_0x58c719[_0xfcdc('0x1f')]=_0x2700b4;if(_0x4e07d5[_0xfcdc('0x30')][_0xfcdc('0x40')]){_0x4948ed[_0xfcdc('0x41')]=[{'all':!![]}];}return db[_0xfcdc('0x2c')][_0xfcdc('0x42')](_0x4948ed);})[_0xfcdc('0x24')](function(_0x3b15ea){_0x58c719[_0xfcdc('0x43')]=_0x3b15ea;return _0x58c719;})[_0xfcdc('0x24')](respondWithFilteredResult(_0x3bdca4,_0x4948ed))[_0xfcdc('0x44')](handleError(_0x3bdca4,null));};exports[_0xfcdc('0x45')]=function(_0x23c01e,_0x3ee364){var _0x31ce6a={'raw':!![],'where':{'id':_0x23c01e[_0xfcdc('0x46')]['id']}},_0x58564d={};_0x58564d['model']=_[_0xfcdc('0x31')](db['Variable'][_0xfcdc('0x2d')]);_0x58564d[_0xfcdc('0x30')]=_['keys'](_0x23c01e[_0xfcdc('0x30')]);_0x58564d[_0xfcdc('0x3a')]=_[_0xfcdc('0x34')](_0x58564d[_0xfcdc('0x32')],_0x58564d[_0xfcdc('0x30')]);_0x31ce6a[_0xfcdc('0x33')]=_[_0xfcdc('0x34')](_0x58564d[_0xfcdc('0x32')],qs['fields'](_0x23c01e[_0xfcdc('0x30')][_0xfcdc('0x35')]));_0x31ce6a[_0xfcdc('0x33')]=_0x31ce6a[_0xfcdc('0x33')][_0xfcdc('0x47')]?_0x31ce6a[_0xfcdc('0x33')]:_0x58564d[_0xfcdc('0x32')];if(_0x23c01e[_0xfcdc('0x30')][_0xfcdc('0x40')]){_0x31ce6a['include']=[{'all':!![]}];}_0x31ce6a=_[_0xfcdc('0x3d')]({},_0x31ce6a,_0x23c01e[_0xfcdc('0x3f')]);return db['Variable'][_0xfcdc('0x48')](_0x31ce6a)[_0xfcdc('0x24')](handleEntityNotFound(_0x3ee364,null))[_0xfcdc('0x24')](respondWithResult(_0x3ee364,null))[_0xfcdc('0x44')](handleError(_0x3ee364,null));};exports[_0xfcdc('0x49')]=function(_0x269476,_0x4d104a){return db[_0xfcdc('0x2c')][_0xfcdc('0x49')](_0x269476['body'],{})['then'](function(_0x1b42e9){var _0x24919c=_0x269476[_0xfcdc('0x4a')]['get']({'plain':!![]});if(!_0x24919c)throw new Error(_0xfcdc('0x4b'));if(_0x24919c['role']===_0xfcdc('0x4a')){var _0xf38046=_0x1b42e9[_0xfcdc('0x26')]({'plain':!![]});var _0x136e59=_0xfcdc('0x27');return db[_0xfcdc('0x4c')][_0xfcdc('0x48')]({'where':{'name':_0x136e59,'userProfileId':_0x24919c[_0xfcdc('0x4d')]},'raw':!![]})['then'](function(_0x37d24d){if(_0x37d24d&&_0x37d24d[_0xfcdc('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0xf38046['name'],'resourceId':_0xf38046['id'],'type':_0x37d24d[_0xfcdc('0x2a')],'sectionId':_0x37d24d['id']},{})[_0xfcdc('0x24')](function(){return _0x1b42e9;});}else{return _0x1b42e9;}})[_0xfcdc('0x44')](function(_0x349486){logger[_0xfcdc('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x349486);throw _0x349486;});}return _0x1b42e9;})[_0xfcdc('0x24')](respondWithResult(_0x4d104a,0xc9))[_0xfcdc('0x44')](handleError(_0x4d104a,null));};exports['update']=function(_0x59787d,_0x252550){if(_0x59787d['body']['id']){delete _0x59787d[_0xfcdc('0x4f')]['id'];}return db['Variable'][_0xfcdc('0x48')]({'where':{'id':_0x59787d[_0xfcdc('0x46')]['id']}})['then'](handleEntityNotFound(_0x252550,null))['then'](saveUpdates(_0x59787d[_0xfcdc('0x4f')],null))['then'](respondWithResult(_0x252550,null))['catch'](handleError(_0x252550,null));};exports[_0xfcdc('0x25')]=function(_0xe18cc8,_0x615525){return db[_0xfcdc('0x2c')][_0xfcdc('0x48')]({'where':{'id':_0xe18cc8[_0xfcdc('0x46')]['id']}})[_0xfcdc('0x24')](handleEntityNotFound(_0x615525,null))['then'](removeEntity(_0x615525,null))[_0xfcdc('0x44')](handleError(_0x615525,null));}; \ No newline at end of file +var _0x4dcc=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','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','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','get','Variables','sendStatus','error','stack','name','index','map','Variable','rawAttributes','fieldName','key','model','query'];(function(_0xd4cd2e,_0x40b14e){var _0x508357=function(_0x5db810){while(--_0x5db810){_0xd4cd2e['push'](_0xd4cd2e['shift']());}};_0x508357(++_0x40b14e);}(_0x4dcc,0x1bb));var _0xc4dc=function(_0x487d0a,_0x1b7cb4){_0x487d0a=_0x487d0a-0x0;var _0x3d740c=_0x4dcc[_0x487d0a];return _0x3d740c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4dc('0x0'));var zipdir=require(_0xc4dc('0x1'));var jsonpatch=require(_0xc4dc('0x2'));var rp=require('request-promise');var moment=require(_0xc4dc('0x3'));var BPromise=require(_0xc4dc('0x4'));var Mustache=require(_0xc4dc('0x5'));var util=require(_0xc4dc('0x6'));var path=require('path');var sox=require(_0xc4dc('0x7'));var csv=require(_0xc4dc('0x8'));var ejs=require(_0xc4dc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4dc('0xa'));var squel=require('squel');var crypto=require(_0xc4dc('0xb'));var jsforce=require(_0xc4dc('0xc'));var deskjs=require(_0xc4dc('0xd'));var toCsv=require(_0xc4dc('0x8'));var querystring=require('querystring');var Papa=require(_0xc4dc('0xe'));var Redis=require(_0xc4dc('0xf'));var authService=require(_0xc4dc('0x10'));var qs=require(_0xc4dc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4dc('0x12'));var logger=require(_0xc4dc('0x13'))(_0xc4dc('0x14'));var utils=require(_0xc4dc('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc4dc('0x16'))['db'];function respondWithStatusCode(_0x855ccb,_0x488651){_0x488651=_0x488651||0xcc;return function(_0x64e8d5){if(_0x64e8d5){return _0x855ccb['sendStatus'](_0x488651);}return _0x855ccb['status'](_0x488651)[_0xc4dc('0x17')]();};}function respondWithResult(_0x1ef052,_0x5e8879){_0x5e8879=_0x5e8879||0xc8;return function(_0x45d749){if(_0x45d749){return _0x1ef052[_0xc4dc('0x18')](_0x5e8879)['json'](_0x45d749);}};}function respondWithFilteredResult(_0x1aab75,_0x244f1e){return function(_0x50b3c3){if(_0x50b3c3){var _0x1f8257=typeof _0x244f1e[_0xc4dc('0x19')]===_0xc4dc('0x1a')&&typeof _0x244f1e[_0xc4dc('0x1b')]==='undefined';var _0x71bfc5=_0x50b3c3[_0xc4dc('0x1c')];var _0x3d546b=_0x1f8257?0x0:_0x244f1e[_0xc4dc('0x19')];var _0x1478c9=_0x1f8257?_0x50b3c3[_0xc4dc('0x1c')]:_0x244f1e[_0xc4dc('0x19')]+_0x244f1e[_0xc4dc('0x1b')];var _0x5cb243;if(_0x1478c9>=_0x71bfc5){_0x1478c9=_0x71bfc5;_0x5cb243=0xc8;}else{_0x5cb243=0xce;}_0x1aab75[_0xc4dc('0x18')](_0x5cb243);return _0x1aab75[_0xc4dc('0x1d')](_0xc4dc('0x1e'),_0x3d546b+'-'+_0x1478c9+'/'+_0x71bfc5)[_0xc4dc('0x1f')](_0x50b3c3);}return null;};}function patchUpdates(_0x373eb2){return function(_0x5616ef){try{jsonpatch['apply'](_0x5616ef,_0x373eb2,!![]);}catch(_0x4a7676){return BPromise[_0xc4dc('0x20')](_0x4a7676);}return _0x5616ef['save']();};}function saveUpdates(_0x5172a9,_0x54ea63){return function(_0x182ed7){if(_0x182ed7){return _0x182ed7[_0xc4dc('0x21')](_0x5172a9)[_0xc4dc('0x22')](function(_0x5aebeb){return _0x5aebeb;});}return null;};}function removeEntity(_0x21aeb5,_0x7724a4){return function(_0x35577c){if(_0x35577c){return _0x35577c['destroy']()[_0xc4dc('0x22')](function(){var _0x1f5ba5=_0x35577c[_0xc4dc('0x23')]({'plain':!![]});var _0x5af7f5=_0xc4dc('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x5af7f5,'resourceId':_0x1f5ba5['id']}})[_0xc4dc('0x22')](function(){return _0x35577c;});})[_0xc4dc('0x22')](function(){_0x21aeb5[_0xc4dc('0x18')](0xcc)[_0xc4dc('0x17')]();});}};}function handleEntityNotFound(_0x51b300,_0x42619e){return function(_0x1f1f5e){if(!_0x1f1f5e){_0x51b300[_0xc4dc('0x25')](0x194);}return _0x1f1f5e;};}function handleError(_0x41e6c6,_0x10c423){_0x10c423=_0x10c423||0x1f4;return function(_0xcc3ea2){logger[_0xc4dc('0x26')](_0xcc3ea2[_0xc4dc('0x27')]);if(_0xcc3ea2['name']){delete _0xcc3ea2[_0xc4dc('0x28')];}_0x41e6c6[_0xc4dc('0x18')](_0x10c423)['send'](_0xcc3ea2);};}exports[_0xc4dc('0x29')]=function(_0xea4d80,_0x137a59){var _0x599ef9={},_0x2f7a01={},_0x157c0a={'count':0x0,'rows':[]};var _0x4c48f8=_[_0xc4dc('0x2a')](db[_0xc4dc('0x2b')][_0xc4dc('0x2c')],function(_0x17118a){return{'name':_0x17118a[_0xc4dc('0x2d')],'type':_0x17118a['type'][_0xc4dc('0x2e')]};});_0x2f7a01[_0xc4dc('0x2f')]=_[_0xc4dc('0x2a')](_0x4c48f8,_0xc4dc('0x28'));_0x2f7a01[_0xc4dc('0x30')]=_['keys'](_0xea4d80[_0xc4dc('0x30')]);_0x2f7a01[_0xc4dc('0x31')]=_[_0xc4dc('0x32')](_0x2f7a01[_0xc4dc('0x2f')],_0x2f7a01[_0xc4dc('0x30')]);_0x599ef9[_0xc4dc('0x33')]=_[_0xc4dc('0x32')](_0x2f7a01['model'],qs[_0xc4dc('0x34')](_0xea4d80['query']['fields']));_0x599ef9[_0xc4dc('0x33')]=_0x599ef9[_0xc4dc('0x33')][_0xc4dc('0x35')]?_0x599ef9[_0xc4dc('0x33')]:_0x2f7a01['model'];if(!_0xea4d80[_0xc4dc('0x30')][_0xc4dc('0x36')](_0xc4dc('0x37'))){_0x599ef9[_0xc4dc('0x1b')]=qs[_0xc4dc('0x1b')](_0xea4d80['query'][_0xc4dc('0x1b')]);_0x599ef9[_0xc4dc('0x19')]=qs[_0xc4dc('0x19')](_0xea4d80[_0xc4dc('0x30')]['offset']);}_0x599ef9[_0xc4dc('0x38')]=qs[_0xc4dc('0x39')](_0xea4d80['query']['sort']);_0x599ef9[_0xc4dc('0x3a')]=qs[_0xc4dc('0x31')](_['pick'](_0xea4d80['query'],_0x2f7a01['filters']),_0x4c48f8);if(_0xea4d80[_0xc4dc('0x30')]['filter']){_0x599ef9[_0xc4dc('0x3a')]=_[_0xc4dc('0x3b')](_0x599ef9[_0xc4dc('0x3a')],{'$or':_[_0xc4dc('0x2a')](_0x4c48f8,function(_0x2134a4){if(_0x2134a4[_0xc4dc('0x3c')]!=='VIRTUAL'){var _0x33f2f7={};_0x33f2f7[_0x2134a4[_0xc4dc('0x28')]]={'$like':'%'+_0xea4d80[_0xc4dc('0x30')][_0xc4dc('0x3d')]+'%'};return _0x33f2f7;}})});}_0x599ef9=_['merge']({},_0x599ef9,_0xea4d80[_0xc4dc('0x3e')]);var _0x18bab5={'where':_0x599ef9[_0xc4dc('0x3a')]};return db['Variable'][_0xc4dc('0x1c')](_0x18bab5)[_0xc4dc('0x22')](function(_0x1bbb68){_0x157c0a[_0xc4dc('0x1c')]=_0x1bbb68;if(_0xea4d80[_0xc4dc('0x30')][_0xc4dc('0x3f')]){_0x599ef9[_0xc4dc('0x40')]=[{'all':!![]}];}return db[_0xc4dc('0x2b')][_0xc4dc('0x41')](_0x599ef9);})[_0xc4dc('0x22')](function(_0x46e834){_0x157c0a[_0xc4dc('0x42')]=_0x46e834;return _0x157c0a;})[_0xc4dc('0x22')](respondWithFilteredResult(_0x137a59,_0x599ef9))[_0xc4dc('0x43')](handleError(_0x137a59,null));};exports[_0xc4dc('0x44')]=function(_0xf29ef9,_0x4ee081){var _0x1afef4={'raw':!![],'where':{'id':_0xf29ef9[_0xc4dc('0x45')]['id']}},_0x384e1e={};_0x384e1e[_0xc4dc('0x2f')]=_[_0xc4dc('0x46')](db[_0xc4dc('0x2b')]['rawAttributes']);_0x384e1e[_0xc4dc('0x30')]=_[_0xc4dc('0x46')](_0xf29ef9['query']);_0x384e1e[_0xc4dc('0x31')]=_[_0xc4dc('0x32')](_0x384e1e[_0xc4dc('0x2f')],_0x384e1e[_0xc4dc('0x30')]);_0x1afef4[_0xc4dc('0x33')]=_['intersection'](_0x384e1e[_0xc4dc('0x2f')],qs['fields'](_0xf29ef9[_0xc4dc('0x30')]['fields']));_0x1afef4[_0xc4dc('0x33')]=_0x1afef4[_0xc4dc('0x33')]['length']?_0x1afef4['attributes']:_0x384e1e[_0xc4dc('0x2f')];if(_0xf29ef9['query'][_0xc4dc('0x3f')]){_0x1afef4[_0xc4dc('0x40')]=[{'all':!![]}];}_0x1afef4=_['merge']({},_0x1afef4,_0xf29ef9[_0xc4dc('0x3e')]);return db['Variable'][_0xc4dc('0x47')](_0x1afef4)[_0xc4dc('0x22')](handleEntityNotFound(_0x4ee081,null))[_0xc4dc('0x22')](respondWithResult(_0x4ee081,null))[_0xc4dc('0x43')](handleError(_0x4ee081,null));};exports['create']=function(_0x362113,_0x24eb34){return db['Variable'][_0xc4dc('0x48')](_0x362113[_0xc4dc('0x49')],{})['then'](function(_0x3f6c05){var _0x1bddb5=_0x362113[_0xc4dc('0x4a')][_0xc4dc('0x23')]({'plain':!![]});if(!_0x1bddb5)throw new Error(_0xc4dc('0x4b'));if(_0x1bddb5[_0xc4dc('0x4c')]===_0xc4dc('0x4a')){var _0x4cb4ba=_0x3f6c05[_0xc4dc('0x23')]({'plain':!![]});var _0x15ae42='Variables';return db[_0xc4dc('0x4d')]['find']({'where':{'name':_0x15ae42,'userProfileId':_0x1bddb5[_0xc4dc('0x4e')]},'raw':!![]})[_0xc4dc('0x22')](function(_0x5dd302){if(_0x5dd302&&_0x5dd302[_0xc4dc('0x4f')]===0x0){return db[_0xc4dc('0x50')][_0xc4dc('0x48')]({'name':_0x4cb4ba[_0xc4dc('0x28')],'resourceId':_0x4cb4ba['id'],'type':_0x5dd302[_0xc4dc('0x28')],'sectionId':_0x5dd302['id']},{})['then'](function(){return _0x3f6c05;});}else{return _0x3f6c05;}})[_0xc4dc('0x43')](function(_0x19c6bb){logger[_0xc4dc('0x26')](_0xc4dc('0x51'),_0x19c6bb);throw _0x19c6bb;});}return _0x3f6c05;})[_0xc4dc('0x22')](respondWithResult(_0x24eb34,0xc9))[_0xc4dc('0x43')](handleError(_0x24eb34,null));};exports[_0xc4dc('0x21')]=function(_0x44ef62,_0x29e5b7){if(_0x44ef62[_0xc4dc('0x49')]['id']){delete _0x44ef62[_0xc4dc('0x49')]['id'];}return db[_0xc4dc('0x2b')][_0xc4dc('0x47')]({'where':{'id':_0x44ef62['params']['id']}})['then'](handleEntityNotFound(_0x29e5b7,null))['then'](saveUpdates(_0x44ef62[_0xc4dc('0x49')],null))[_0xc4dc('0x22')](respondWithResult(_0x29e5b7,null))[_0xc4dc('0x43')](handleError(_0x29e5b7,null));};exports['destroy']=function(_0x5b3e87,_0xa28b77){return db[_0xc4dc('0x2b')][_0xc4dc('0x47')]({'where':{'id':_0x5b3e87[_0xc4dc('0x45')]['id']}})['then'](handleEntityNotFound(_0xa28b77,null))[_0xc4dc('0x22')](removeEntity(_0xa28b77,null))[_0xc4dc('0x43')](handleError(_0xa28b77,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a57e560..ce41307 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 _0xc608=['Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc608,0x10c));var _0x8c60=function(_0x1fa40d,_0xb92f4e){_0x1fa40d=_0x1fa40d-0x0;var _0x55937f=_0xc608[_0x1fa40d];return _0x55937f;};'use strict';var _=require(_0x8c60('0x0'));var util=require(_0x8c60('0x1'));var logger=require(_0x8c60('0x2'))(_0x8c60('0x3'));var moment=require(_0x8c60('0x4'));var BPromise=require(_0x8c60('0x5'));var rp=require(_0x8c60('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c60('0x7'));var config=require(_0x8c60('0x8'));var attributes=require(_0x8c60('0x9'));module[_0x8c60('0xa')]=function(_0x98fc94,_0x36bb38){return _0x98fc94[_0x8c60('0xb')](_0x8c60('0xc'),attributes,{'tableName':_0x8c60('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ca0=['util','api','request-promise','path','rimraf','../../config/environment','exports','define','Variable','tools_variables'];(function(_0x4d9898,_0x182198){var _0x1611f3=function(_0x337ba0){while(--_0x337ba0){_0x4d9898['push'](_0x4d9898['shift']());}};_0x1611f3(++_0x182198);}(_0x5ca0,0x15e));var _0x05ca=function(_0x587a9f,_0x366c87){_0x587a9f=_0x587a9f-0x0;var _0x38fa2d=_0x5ca0[_0x587a9f];return _0x38fa2d;};'use strict';var _=require('lodash');var util=require(_0x05ca('0x0'));var logger=require('../../config/logger')(_0x05ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x05ca('0x2'));var fs=require('fs');var path=require(_0x05ca('0x3'));var rimraf=require(_0x05ca('0x4'));var config=require(_0x05ca('0x5'));var attributes=require('./variable.attributes');module[_0x05ca('0x6')]=function(_0x436b9e,_0x5aca0d){return _0x436b9e[_0x05ca('0x7')](_0x05ca('0x8'),attributes,{'tableName':_0x05ca('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 345120c..af925d4 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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x113982,_0x597be2){var _0x13ff92=function(_0x344be9){while(--_0x344be9){_0x113982['push'](_0x113982['shift']());}};_0x13ff92(++_0x597be2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x5fc3[_0x543084];return _0x306a57;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file +var _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x22c250,_0x4fbc3c){var _0x249589=function(_0x4ec136){while(--_0x4ec136){_0x22c250['push'](_0x22c250['shift']());}};_0x249589(++_0x4fbc3c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0x4b84[_0x5751e6];return _0x4199e4;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index f9280c1..36eb0fd 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 _0xdb22=['restart','/migrations','migrations','exports','express','./version.controller','get','index','/fetch','canUpdate','/reset','isAuthenticated','reset','/pull','pull','/restart'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xdb22,0x164));var _0x2db2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdb22[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0x2db2('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x2db2('0x1'));router[_0x2db2('0x2')]('/',controller[_0x2db2('0x3')]);router[_0x2db2('0x2')](_0x2db2('0x4'),auth['isAuthenticated'](),auth[_0x2db2('0x5')](),controller['fetch']);router[_0x2db2('0x2')](_0x2db2('0x6'),auth[_0x2db2('0x7')](),auth['canUpdate'](),controller[_0x2db2('0x8')]);router[_0x2db2('0x2')](_0x2db2('0x9'),auth[_0x2db2('0x7')](),auth[_0x2db2('0x5')](),controller[_0x2db2('0xa')]);router[_0x2db2('0x2')](_0x2db2('0xb'),auth['isAuthenticated'](),controller[_0x2db2('0xc')]);router[_0x2db2('0x2')](_0x2db2('0xd'),controller[_0x2db2('0xe')]);module[_0x2db2('0xf')]=router; \ No newline at end of file +var _0x2eb2=['/pull','pull','restart','/migrations','migrations','exports','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset'];(function(_0x250769,_0x5d795c){var _0x510a25=function(_0x143624){while(--_0x143624){_0x250769['push'](_0x250769['shift']());}};_0x510a25(++_0x5d795c);}(_0x2eb2,0x1aa));var _0x22eb=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x2eb2[_0x2cf2e9];return _0xd3670d;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x22eb('0x0'));var controller=require(_0x22eb('0x1'));router['get']('/',controller['index']);router[_0x22eb('0x2')](_0x22eb('0x3'),auth[_0x22eb('0x4')](),auth[_0x22eb('0x5')](),controller[_0x22eb('0x6')]);router['get'](_0x22eb('0x7'),auth[_0x22eb('0x4')](),auth[_0x22eb('0x5')](),controller[_0x22eb('0x8')]);router[_0x22eb('0x2')](_0x22eb('0x9'),auth['isAuthenticated'](),auth[_0x22eb('0x5')](),controller[_0x22eb('0xa')]);router['get']('/restart',auth['isAuthenticated'](),controller[_0x22eb('0xb')]);router[_0x22eb('0x2')](_0x22eb('0xc'),controller[_0x22eb('0xd')]);module[_0x22eb('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 7fd4555..c28c6aa 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 _0x5989=['FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','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.','root','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','exec','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','reset'];(function(_0x4d44ff,_0x4dbe86){var _0x2e9706=function(_0xba1c71){while(--_0xba1c71){_0x4d44ff['push'](_0x4d44ff['shift']());}};_0x2e9706(++_0x4dbe86);}(_0x5989,0x1c6));var _0x9598=function(_0x2bc0f5,_0x44f336){_0x2bc0f5=_0x2bc0f5-0x0;var _0x42c6ac=_0x5989[_0x2bc0f5];return _0x42c6ac;};'use strict';var Umzug=require(_0x9598('0x0'));var path=require(_0x9598('0x1'));var fs=require('fs');var _=require(_0x9598('0x2'));var pkginfo=require('pkginfo')(module,_0x9598('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x9598('0x4')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x9598('0x5'));var logger=require(_0x9598('0x6'))(_0x9598('0x7'));var git=require(_0x9598('0x8'))(config['root']);exports[_0x9598('0x9')]=function(_0x1f318a,_0x3586f6){var _0x227052={'current':module[_0x9598('0xa')]['version'],'phonebar':0x2};if(_0x1f318a[_0x9598('0xb')]&&_0x1f318a[_0x9598('0xb')][_0x9598('0xc')]){return git[_0x9598('0xd')]()[_0x9598('0xe')](function(_0xa9b40f,_0x2b8420){_0x227052[_0x9598('0xc')]=(_0xa9b40f?module['exports'][_0x9598('0x3')]:_0x2b8420[_0x9598('0xc')])||_0x9598('0xf');return _0x3586f6[_0x9598('0x10')](0xc8)[_0x9598('0x11')](_0x227052);});}else{return _0x3586f6[_0x9598('0x10')](0xc8)['json'](_0x227052);}};exports[_0x9598('0xd')]=function(_0x7cc43,_0xcb6eb8){return git[_0x9598('0xd')]([_0x9598('0x12'),'master'],function(_0x1d835a){if(_0x1d835a){logger[_0x9598('0x13')](_0x1d835a);return _0xcb6eb8[_0x9598('0x10')](0x1f4)['json'](_0x1d835a);}logger[_0x9598('0x14')](_0x9598('0x15'));return _0xcb6eb8[_0x9598('0x10')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x9598('0x16')]=function(_0x16607a,_0x5943ec){return git[_0x9598('0x16')](['--hard',_0x9598('0x17')],function(_0x329888){if(_0x329888){logger[_0x9598('0x13')](_0x329888);return _0x5943ec[_0x9598('0x10')](0x1f4)[_0x9598('0x11')](_0x329888);}logger[_0x9598('0x14')](_0x9598('0x18'));return _0x5943ec[_0x9598('0x10')](0xc8)[_0x9598('0x11')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x1e9e21,_0x5a852a){exec(_0x9598('0x19'),function(_0xd461df,_0x55d6c3,_0x4f81c1){logger[_0x9598('0x14')](_0x55d6c3);logger['info'](_0x4f81c1);if(_0xd461df){logger[_0x9598('0x13')](_0xd461df);return _0x5a852a[_0x9598('0x10')](0x1f4)[_0x9598('0x11')](_0xd461df);}return _0x5a852a['status'](0xc8)['json']({'output':_0x55d6c3});});};exports['restart']=function(_0x7b538e,_0x1ba5a5){return pm2[_0x9598('0x1a')](_0x9598('0x1b'))[_0x9598('0x1c')](function(_0x353a7b){logger['info'](_0x9598('0x1d'),_0x353a7b);return _0x1ba5a5[_0x9598('0x10')](0xc8)[_0x9598('0x11')]({'output':_0x9598('0x1e')});})['catch'](function(_0x1227a0){logger[_0x9598('0x13')](_0x1227a0);return _0x1ba5a5[_0x9598('0x10')](0x1f4)[_0x9598('0x11')](_0x1227a0);});};exports[_0x9598('0x1f')]=function(_0x59bda3,_0x50647c){var _0x5668a6=fs[_0x9598('0x20')](path['join'](config['root'],_0x9598('0x21'),_0x9598('0x1f')));var _0x5065a1=[];for(var _0xd60517=0x0;_0xd60517<_0x5668a6[_0x9598('0x22')];_0xd60517++){var _0x2f4265=_0x5668a6[_0xd60517][_0x9598('0x23')](_0x9598('0x24'),'');if(compareVersions(module['exports']['version'],_0x2f4265)===-0x1){_0x5065a1[_0x9598('0x25')](_0x2f4265);}}if(_0x5065a1[_0x9598('0x22')]){var _0x2e3128=_0x5065a1[_0x9598('0x26')](compareVersions);var _0x16fd5d=new Umzug({'storage':_0x9598('0x27'),'storageOptions':{'model':db[_0x9598('0x28')],'modelName':_0x9598('0x28'),'columnName':_0x9598('0x3')},'migrations':{'params':[db[_0x9598('0x27')][_0x9598('0x29')](),db[_0x9598('0x27')][_0x9598('0x2a')],function(){throw new Error(_0x9598('0x2b'));}],'path':path['join'](config[_0x9598('0x2c')],_0x9598('0x21'),_0x9598('0x1f')),'pattern':/\.js$/}});_0x16fd5d['up']({'migrations':_[_0x9598('0x2d')](_0x2e3128,function(_0x1058e1){return _0x1058e1+_0x9598('0x24');})})['then'](function(){return _0x50647c[_0x9598('0x10')](0xc8)['json']({'output':_0x9598('0x2e')+module[_0x9598('0xa')][_0x9598('0x3')]+_0x9598('0x2f')+_[_0x9598('0x30')](_0x2e3128),'migrations':_[_0x9598('0x31')](_0x2e3128)});})[_0x9598('0x32')](function(_0x42a51c){if(_0x42a51c instanceof db[_0x9598('0x27')][_0x9598('0x33')]){return _0x50647c[_0x9598('0x10')](0xc8)['json']({'output':_0x9598('0x34')});}else{return _0x50647c[_0x9598('0x10')](0x1f4)[_0x9598('0x11')](_0x42a51c);}});}else{return _0x50647c[_0x9598('0x10')](0xc8)[_0x9598('0x11')]({'output':_0x9598('0x34')});}}; \ No newline at end of file +var _0x03fb=['.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','last','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','query','latest','tags','exports','status','fetch','origin','master','error','info','git\x20fetch','json','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace'];(function(_0x436da0,_0x209460){var _0x29eba5=function(_0x5b1d9c){while(--_0x5b1d9c){_0x436da0['push'](_0x436da0['shift']());}};_0x29eba5(++_0x209460);}(_0x03fb,0x7b));var _0xb03f=function(_0x1ed54c,_0xe6599b){_0x1ed54c=_0x1ed54c-0x0;var _0x3ca3c1=_0x03fb[_0x1ed54c];return _0x3ca3c1;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0xb03f('0x0'));var pkginfo=require(_0xb03f('0x1'))(module,_0xb03f('0x2'));var compareVersions=require(_0xb03f('0x3'));var exec=require(_0xb03f('0x4'))[_0xb03f('0x5')];var db=require(_0xb03f('0x6'))['db'];var config=require(_0xb03f('0x7'));var pm2=require(_0xb03f('0x8'));var logger=require(_0xb03f('0x9'))(_0xb03f('0xa'));var git=require('simple-git')(config[_0xb03f('0xb')]);exports[_0xb03f('0xc')]=function(_0x4db5b7,_0x100612){var _0x235bef={'current':module['exports'][_0xb03f('0x2')],'phonebar':0x2};if(_0x4db5b7[_0xb03f('0xd')]&&_0x4db5b7[_0xb03f('0xd')][_0xb03f('0xe')]){return git['fetch']()[_0xb03f('0xf')](function(_0x1183f2,_0x356a9c){_0x235bef[_0xb03f('0xe')]=(_0x1183f2?module[_0xb03f('0x10')]['version']:_0x356a9c[_0xb03f('0xe')])||'2.0.0';return _0x100612[_0xb03f('0x11')](0xc8)['json'](_0x235bef);});}else{return _0x100612[_0xb03f('0x11')](0xc8)['json'](_0x235bef);}};exports[_0xb03f('0x12')]=function(_0x30456e,_0x49dfdd){return git['fetch']([_0xb03f('0x13'),_0xb03f('0x14')],function(_0x573cf9){if(_0x573cf9){logger[_0xb03f('0x15')](_0x573cf9);return _0x49dfdd[_0xb03f('0x11')](0x1f4)['json'](_0x573cf9);}logger[_0xb03f('0x16')](_0xb03f('0x17'));return _0x49dfdd[_0xb03f('0x11')](0xc8)[_0xb03f('0x18')]({'output':_0xb03f('0x19')});});};exports[_0xb03f('0x1a')]=function(_0x14b1cc,_0x3e4c95){return git['reset']([_0xb03f('0x1b'),_0xb03f('0x1c')],function(_0xfdf476){if(_0xfdf476){logger[_0xb03f('0x15')](_0xfdf476);return _0x3e4c95[_0xb03f('0x11')](0x1f4)['json'](_0xfdf476);}logger[_0xb03f('0x16')](_0xb03f('0x1d'));return _0x3e4c95[_0xb03f('0x11')](0xc8)['json']({'output':_0xb03f('0x1e')});});};exports[_0xb03f('0x1f')]=function(_0x1fb8b1,_0x4ae6bf){exec('npm\x20install\x20--production',function(_0x2e8295,_0x343b35,_0xd48cdf){logger[_0xb03f('0x16')](_0x343b35);logger[_0xb03f('0x16')](_0xd48cdf);if(_0x2e8295){logger[_0xb03f('0x15')](_0x2e8295);return _0x4ae6bf['status'](0x1f4)[_0xb03f('0x18')](_0x2e8295);}return _0x4ae6bf[_0xb03f('0x11')](0xc8)[_0xb03f('0x18')]({'output':_0x343b35});});};exports['restart']=function(_0x49f610,_0x378345){return pm2[_0xb03f('0x20')](_0xb03f('0x21'))['then'](function(_0x19ee68){logger['info']('pm2\x20restart\x20motion\x20%s',_0x19ee68);return _0x378345[_0xb03f('0x11')](0xc8)[_0xb03f('0x18')]({'output':_0xb03f('0x22')});})[_0xb03f('0x23')](function(_0x2ada6f){logger[_0xb03f('0x15')](_0x2ada6f);return _0x378345['status'](0x1f4)[_0xb03f('0x18')](_0x2ada6f);});};exports[_0xb03f('0x24')]=function(_0x316e31,_0x3bae29){var _0x4de60f=fs[_0xb03f('0x25')](path[_0xb03f('0x26')](config[_0xb03f('0xb')],_0xb03f('0x27'),_0xb03f('0x24')));var _0x481808=[];for(var _0x3d257c=0x0;_0x3d257c<_0x4de60f[_0xb03f('0x28')];_0x3d257c++){var _0xe1ca44=_0x4de60f[_0x3d257c][_0xb03f('0x29')](_0xb03f('0x2a'),'');if(compareVersions(module[_0xb03f('0x10')]['version'],_0xe1ca44)===-0x1){_0x481808[_0xb03f('0x2b')](_0xe1ca44);}}if(_0x481808[_0xb03f('0x28')]){var _0x525400=_0x481808[_0xb03f('0x2c')](compareVersions);var _0xc48f44=new Umzug({'storage':_0xb03f('0x2d'),'storageOptions':{'model':db[_0xb03f('0x2e')],'modelName':_0xb03f('0x2e'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0xb03f('0x2f')](),db[_0xb03f('0x2d')][_0xb03f('0x30')],function(){throw new Error(_0xb03f('0x31'));}],'path':path['join'](config[_0xb03f('0xb')],'server',_0xb03f('0x24')),'pattern':/\.js$/}});_0xc48f44['up']({'migrations':_[_0xb03f('0x32')](_0x525400,function(_0x45b05c){return _0x45b05c+'.js';})})['then'](function(){return _0x3bae29[_0xb03f('0x11')](0xc8)[_0xb03f('0x18')]({'output':_0xb03f('0x33')+module[_0xb03f('0x10')][_0xb03f('0x2')]+'\x20to\x20'+_[_0xb03f('0x34')](_0x525400),'migrations':_[_0xb03f('0x26')](_0x525400)});})[_0xb03f('0x23')](function(_0x3b7c0d){if(_0x3b7c0d instanceof db[_0xb03f('0x2d')][_0xb03f('0x35')]){return _0x3bae29['status'](0xc8)['json']({'output':_0xb03f('0x36')});}else{return _0x3bae29[_0xb03f('0x11')](0x1f4)['json'](_0x3b7c0d);}});}else{return _0x3bae29[_0xb03f('0x11')](0xc8)[_0xb03f('0x18')]({'output':_0xb03f('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index aab41c5..d9e65bd 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 _0x2e9e=['create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x523b42,_0x6b3006){var _0x4d5db1=function(_0x8dd5aa){while(--_0x8dd5aa){_0x523b42['push'](_0x523b42['shift']());}};_0x4d5db1(++_0x6b3006);}(_0x2e9e,0x6f));var _0xe2e9=function(_0x59d4bc,_0x2d4b7f){_0x59d4bc=_0x59d4bc-0x0;var _0x3b147b=_0x2e9e[_0x59d4bc];return _0x3b147b;};'use strict';var multer=require(_0xe2e9('0x0'));var util=require(_0xe2e9('0x1'));var path=require(_0xe2e9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe2e9('0x3')]();var fs_extra=require(_0xe2e9('0x4'));var auth=require(_0xe2e9('0x5'));var interaction=require(_0xe2e9('0x6'));var config=require('../../config/environment');var controller=require(_0xe2e9('0x7'));router[_0xe2e9('0x8')]('/',auth['isAuthenticated'](),controller[_0xe2e9('0x9')]);router['get'](_0xe2e9('0xa'),auth[_0xe2e9('0xb')](),controller[_0xe2e9('0xc')]);router[_0xe2e9('0x8')](_0xe2e9('0xd'),auth['isAuthenticated'](),controller[_0xe2e9('0xe')]);router['post']('/',auth[_0xe2e9('0xb')](),controller[_0xe2e9('0xf')]);router[_0xe2e9('0x10')](_0xe2e9('0xd'),auth[_0xe2e9('0xb')](),controller[_0xe2e9('0x11')]);router[_0xe2e9('0x12')](_0xe2e9('0xd'),auth[_0xe2e9('0xb')](),controller[_0xe2e9('0x13')]);module[_0xe2e9('0x14')]=router; \ No newline at end of file +var _0x7b3b=['create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0xd41e13,_0x5db603){var _0x309bb9=function(_0x5ac215){while(--_0x5ac215){_0xd41e13['push'](_0xd41e13['shift']());}};_0x309bb9(++_0x5db603);}(_0x7b3b,0x117));var _0xb7b3=function(_0x3f6309,_0xd216fd){_0x3f6309=_0x3f6309-0x0;var _0x41ba77=_0x7b3b[_0x3f6309];return _0x41ba77;};'use strict';var multer=require(_0xb7b3('0x0'));var util=require(_0xb7b3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb7b3('0x2'));var router=express[_0xb7b3('0x3')]();var fs_extra=require(_0xb7b3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb7b3('0x5'));var config=require('../../config/environment');var controller=require(_0xb7b3('0x6'));router[_0xb7b3('0x7')]('/',auth[_0xb7b3('0x8')](),controller[_0xb7b3('0x9')]);router['get'](_0xb7b3('0xa'),auth[_0xb7b3('0x8')](),controller[_0xb7b3('0xb')]);router[_0xb7b3('0x7')](_0xb7b3('0xc'),auth[_0xb7b3('0x8')](),controller[_0xb7b3('0xd')]);router[_0xb7b3('0xe')]('/',auth['isAuthenticated'](),controller[_0xb7b3('0xf')]);router[_0xb7b3('0x10')](_0xb7b3('0xc'),auth['isAuthenticated'](),controller[_0xb7b3('0x11')]);router[_0xb7b3('0x12')](_0xb7b3('0xc'),auth['isAuthenticated'](),controller[_0xb7b3('0x13')]);module[_0xb7b3('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 527bc80..100d94e 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 _0x761c=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x2d15ab,_0x2eec7c){var _0x2cab1d=function(_0x3cc7c6){while(--_0x3cc7c6){_0x2d15ab['push'](_0x2d15ab['shift']());}};_0x2cab1d(++_0x2eec7c);}(_0x761c,0x18a));var _0xc761=function(_0x187560,_0x1e99f7){_0x187560=_0x187560-0x0;var _0x3e5c49=_0x761c[_0x187560];return _0x3e5c49;};'use strict';var Sequelize=require(_0xc761('0x0'));module['exports']={'type':{'type':Sequelize[_0xc761('0x1')]},'uniqueid':{'type':Sequelize[_0xc761('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc761('0x1')]},'queue':{'type':Sequelize[_0xc761('0x1')]},'interface':{'type':Sequelize[_0xc761('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc761('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xc761('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xc761('0x2')]},'agentdumpAt':{'type':Sequelize[_0xc761('0x2')]},'holdtime':{'type':Sequelize[_0xc761('0x3')]},'agentcomplete':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc761('0x3')]},'reason':{'type':Sequelize[_0xc761('0x1')]},'lastevent':{'type':Sequelize[_0xc761('0x1')]},'channel':{'type':Sequelize[_0xc761('0x1')]},'channelstate':{'type':Sequelize[_0xc761('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc761('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc761('0x1')]},'accountcode':{'type':Sequelize[_0xc761('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc761('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc761('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc761('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xc761('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xc761('0x1')]},'destlanguage':{'type':Sequelize[_0xc761('0x1')]},'destaccountcode':{'type':Sequelize[_0xc761('0x1')]},'destcontext':{'type':Sequelize[_0xc761('0x1')]},'destexten':{'type':Sequelize[_0xc761('0x1')]},'destpriority':{'type':Sequelize[_0xc761('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xc761('0x1')]},'transfer':{'type':Sequelize[_0xc761('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc761('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xc761('0x1')]},'transferuniqueid':{'type':Sequelize[_0xc761('0x1')]},'agententerreason':{'type':Sequelize[_0xc761('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa486=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa486,0x17d));var _0x6a48=function(_0x19da9d,_0x2a0474){_0x19da9d=_0x19da9d-0x0;var _0x4137de=_0xa486[_0x19da9d];return _0x4137de;};'use strict';var Sequelize=require(_0x6a48('0x0'));module['exports']={'type':{'type':Sequelize[_0x6a48('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6a48('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6a48('0x1')]},'interface':{'type':Sequelize[_0x6a48('0x1')]},'membername':{'type':Sequelize[_0x6a48('0x1')]},'agentcalledAt':{'type':Sequelize[_0x6a48('0x2')]},'agentconnectAt':{'type':Sequelize[_0x6a48('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x6a48('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x6a48('0x2')]},'agentdumpAt':{'type':Sequelize[_0x6a48('0x2')]},'holdtime':{'type':Sequelize[_0x6a48('0x3')]},'agentcomplete':{'type':Sequelize[_0x6a48('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x6a48('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6a48('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x6a48('0x3')]},'agentacw':{'type':Sequelize[_0x6a48('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6a48('0x3')]},'reason':{'type':Sequelize[_0x6a48('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6a48('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6a48('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6a48('0x1')]},'connectedlinename':{'type':Sequelize[_0x6a48('0x1')]},'language':{'type':Sequelize[_0x6a48('0x1')]},'accountcode':{'type':Sequelize[_0x6a48('0x1')]},'context':{'type':Sequelize[_0x6a48('0x1')]},'exten':{'type':Sequelize[_0x6a48('0x1')]},'priority':{'type':Sequelize[_0x6a48('0x1')]},'destchannel':{'type':Sequelize[_0x6a48('0x1')]},'destchannelstate':{'type':Sequelize[_0x6a48('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6a48('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6a48('0x1')]},'destcalleridname':{'type':Sequelize[_0x6a48('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6a48('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x6a48('0x1')]},'destlanguage':{'type':Sequelize[_0x6a48('0x1')]},'destaccountcode':{'type':Sequelize[_0x6a48('0x1')]},'destcontext':{'type':Sequelize[_0x6a48('0x1')]},'destexten':{'type':Sequelize[_0x6a48('0x1')]},'destpriority':{'type':Sequelize[_0x6a48('0x1')]},'destuniqueid':{'type':Sequelize[_0x6a48('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6a48('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x6a48('0x1')]},'transfer':{'type':Sequelize[_0x6a48('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6a48('0x1')],'comment':_0x6a48('0x5')},'transferexten':{'type':Sequelize[_0x6a48('0x1')]},'transferuniqueid':{'type':Sequelize[_0x6a48('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 2e8ad93..a80e502 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 _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 0f0e5b6..74fe7f7 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 _0xb7a8=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger'];(function(_0x1b305f,_0x211568){var _0x34b011=function(_0x1880fc){while(--_0x1880fc){_0x1b305f['push'](_0x1b305f['shift']());}};_0x34b011(++_0x211568);}(_0xb7a8,0xec));var _0x8b7a=function(_0x4c9047,_0x431c63){_0x4c9047=_0x4c9047-0x0;var _0x58012a=_0xb7a8[_0x4c9047];return _0x58012a;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))('api');var moment=require(_0x8b7a('0x2'));var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var attributes=require(_0x8b7a('0x7'));module[_0x8b7a('0x8')]=function(_0x1d61f3,_0x42e4c1){return _0x1d61f3[_0x8b7a('0x9')](_0x8b7a('0xa'),attributes,{'tableName':_0x8b7a('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8b7a('0xc'),_0x8b7a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae1c=['VoiceAgentReport','report_agent','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x1d71b3,_0xe9adc9){var _0x1dd9d5=function(_0x209316){while(--_0x209316){_0x1d71b3['push'](_0x1d71b3['shift']());}};_0x1dd9d5(++_0xe9adc9);}(_0xae1c,0xff));var _0xcae1=function(_0x5e6434,_0x52ab7b){_0x5e6434=_0x5e6434-0x0;var _0x111321=_0xae1c[_0x5e6434];return _0x111321;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcae1('0x0'));var BPromise=require(_0xcae1('0x1'));var rp=require(_0xcae1('0x2'));var fs=require('fs');var path=require(_0xcae1('0x3'));var rimraf=require(_0xcae1('0x4'));var config=require(_0xcae1('0x5'));var attributes=require(_0xcae1('0x6'));module[_0xcae1('0x7')]=function(_0x3513e5,_0x40fcec){return _0x3513e5[_0xcae1('0x8')](_0xcae1('0x9'),attributes,{'tableName':_0xcae1('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 1ea70af..26082f7 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 _0x1020=['message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','update','where','attributes','limit','UpdateVoiceAgentReport','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x1b244b,_0x1347f5){var _0x1d3aea=function(_0x2ce3fc){while(--_0x2ce3fc){_0x1b244b['push'](_0x1b244b['shift']());}};_0x1d3aea(++_0x1347f5);}(_0x1020,0x9b));var _0x0102=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0x1020[_0x350aeb];return _0x3c5273;};'use strict';var _=require('lodash');var util=require(_0x0102('0x0'));var moment=require(_0x0102('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0102('0x2'));var db=require(_0x0102('0x3'))['db'];var utils=require(_0x0102('0x4'));var logger=require(_0x0102('0x5'))(_0x0102('0x6'));var config=require(_0x0102('0x7'));var jayson=require(_0x0102('0x8'));var client=jayson[_0x0102('0x9')][_0x0102('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c2420,_0x3bcbca,_0x1746f2){return new BPromise(function(_0x1f1f09,_0x4f4656){return client[_0x0102('0xb')](_0x5c2420,_0x1746f2)[_0x0102('0xc')](function(_0x5c6d61){logger[_0x0102('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bcbca,_0x0102('0xe'));logger[_0x0102('0xf')](_0x0102('0x10'),_0x3bcbca,_0x0102('0xe'),JSON['stringify'](_0x5c6d61));if(_0x5c6d61[_0x0102('0x11')]){if(_0x5c6d61[_0x0102('0x11')][_0x0102('0x12')]===0x1f4){logger[_0x0102('0x11')](_0x0102('0x13'),_0x3bcbca,_0x5c6d61[_0x0102('0x11')][_0x0102('0x14')]);return _0x4f4656(_0x5c6d61['error'][_0x0102('0x14')]);}logger['error'](_0x0102('0x13'),_0x3bcbca,_0x5c6d61[_0x0102('0x11')][_0x0102('0x14')]);return _0x1f1f09(_0x5c6d61['error'][_0x0102('0x14')]);}else{logger[_0x0102('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3bcbca,_0x0102('0xe'));_0x1f1f09(_0x5c6d61[_0x0102('0x15')]['message']);}})[_0x0102('0x16')](function(_0xcadb42){logger['error'](_0x0102('0x13'),_0x3bcbca,_0xcadb42);_0x4f4656(_0xcadb42);});});}exports[_0x0102('0x17')]=function(_0x4afad2){var _0x355aa6=this;return new Promise(function(_0x2cded2,_0xf97b22){return db[_0x0102('0x18')][_0x0102('0x19')](_0x4afad2[_0x0102('0x1a')],{'raw':_0x4afad2[_0x0102('0x1b')]?_0x4afad2[_0x0102('0x1b')][_0x0102('0x1c')]===undefined?!![]:![]:!![]})[_0x0102('0xc')](function(_0x7de887){logger[_0x0102('0xd')](_0x0102('0x17'),_0x4afad2);logger['debug'](_0x0102('0x17'),_0x4afad2,JSON[_0x0102('0x1d')](_0x7de887));_0x2cded2(_0x7de887);})[_0x0102('0x16')](function(_0x2b5426){logger[_0x0102('0x11')](_0x0102('0x17'),_0x2b5426[_0x0102('0x14')],_0x4afad2);_0xf97b22(_0x355aa6['error'](0x1f4,_0x2b5426['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x2e99ce){var _0x873054=this;return new Promise(function(_0xf272f5,_0x1dc4cf){return db[_0x0102('0x18')][_0x0102('0x1e')](_0x2e99ce[_0x0102('0x1a')],{'raw':_0x2e99ce[_0x0102('0x1b')]?_0x2e99ce[_0x0102('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e99ce[_0x0102('0x1b')]?_0x2e99ce['options'][_0x0102('0x1f')]||null:null,'attributes':_0x2e99ce['options']?_0x2e99ce[_0x0102('0x1b')][_0x0102('0x20')]||null:null,'limit':_0x2e99ce['options']?_0x2e99ce['options'][_0x0102('0x21')]||null:null})[_0x0102('0xc')](function(_0x135220){logger[_0x0102('0xd')](_0x0102('0x22'),_0x2e99ce);logger['debug'](_0x0102('0x22'),_0x2e99ce,JSON[_0x0102('0x1d')](_0x135220));_0xf272f5(_0x135220);})['catch'](function(_0x3840b5){logger['error'](_0x0102('0x22'),_0x3840b5[_0x0102('0x14')],_0x2e99ce);_0x1dc4cf(_0x873054['error'](0x1f4,_0x3840b5[_0x0102('0x14')]));});});}; \ No newline at end of file +var _0xc307=['http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','create','body','options','debug','UpdateVoiceAgentReport','VoiceAgentReport','update','raw','attributes','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1439d7,_0x53e51f){var _0x54b7a8=function(_0x1abf3d){while(--_0x1abf3d){_0x1439d7['push'](_0x1439d7['shift']());}};_0x54b7a8(++_0x53e51f);}(_0xc307,0x1c8));var _0x7c30=function(_0x50aa86,_0x478c92){_0x50aa86=_0x50aa86-0x0;var _0x148b1f=_0xc307[_0x50aa86];return _0x148b1f;};'use strict';var _=require('lodash');var util=require(_0x7c30('0x0'));var moment=require(_0x7c30('0x1'));var BPromise=require('bluebird');var rs=require(_0x7c30('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c30('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c30('0x4'))(_0x7c30('0x5'));var config=require(_0x7c30('0x6'));var jayson=require(_0x7c30('0x7'));var client=jayson[_0x7c30('0x8')][_0x7c30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x544ca9,_0x242438,_0x4c1633){return new BPromise(function(_0x4399d4,_0x306b56){return client['request'](_0x544ca9,_0x4c1633)[_0x7c30('0xa')](function(_0x11eb94){logger['info'](_0x7c30('0xb'),_0x242438,_0x7c30('0xc'));logger['debug'](_0x7c30('0xd'),_0x242438,_0x7c30('0xc'),JSON[_0x7c30('0xe')](_0x11eb94));if(_0x11eb94[_0x7c30('0xf')]){if(_0x11eb94[_0x7c30('0xf')][_0x7c30('0x10')]===0x1f4){logger[_0x7c30('0xf')](_0x7c30('0xb'),_0x242438,_0x11eb94[_0x7c30('0xf')][_0x7c30('0x11')]);return _0x306b56(_0x11eb94[_0x7c30('0xf')][_0x7c30('0x11')]);}logger['error'](_0x7c30('0xb'),_0x242438,_0x11eb94[_0x7c30('0xf')][_0x7c30('0x11')]);return _0x4399d4(_0x11eb94['error']['message']);}else{logger[_0x7c30('0x12')](_0x7c30('0xb'),_0x242438,_0x7c30('0xc'));_0x4399d4(_0x11eb94[_0x7c30('0x13')][_0x7c30('0x11')]);}})[_0x7c30('0x14')](function(_0x2749a4){logger[_0x7c30('0xf')](_0x7c30('0xb'),_0x242438,_0x2749a4);_0x306b56(_0x2749a4);});});}exports[_0x7c30('0x15')]=function(_0x192b6b){var _0x592dcc=this;return new Promise(function(_0x205ec3,_0x50d029){return db['VoiceAgentReport'][_0x7c30('0x16')](_0x192b6b[_0x7c30('0x17')],{'raw':_0x192b6b[_0x7c30('0x18')]?_0x192b6b[_0x7c30('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x7c30('0xa')](function(_0x401a22){logger[_0x7c30('0x12')](_0x7c30('0x15'),_0x192b6b);logger[_0x7c30('0x19')](_0x7c30('0x15'),_0x192b6b,JSON[_0x7c30('0xe')](_0x401a22));_0x205ec3(_0x401a22);})[_0x7c30('0x14')](function(_0x5f5025){logger[_0x7c30('0xf')](_0x7c30('0x15'),_0x5f5025[_0x7c30('0x11')],_0x192b6b);_0x50d029(_0x592dcc[_0x7c30('0xf')](0x1f4,_0x5f5025[_0x7c30('0x11')]));});});};exports[_0x7c30('0x1a')]=function(_0x1b24c3){var _0x3a9484=this;return new Promise(function(_0x2f86ef,_0x36676f){return db[_0x7c30('0x1b')][_0x7c30('0x1c')](_0x1b24c3[_0x7c30('0x17')],{'raw':_0x1b24c3[_0x7c30('0x18')]?_0x1b24c3[_0x7c30('0x18')][_0x7c30('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b24c3['options']?_0x1b24c3[_0x7c30('0x18')]['where']||null:null,'attributes':_0x1b24c3[_0x7c30('0x18')]?_0x1b24c3[_0x7c30('0x18')][_0x7c30('0x1e')]||null:null,'limit':_0x1b24c3[_0x7c30('0x18')]?_0x1b24c3[_0x7c30('0x18')]['limit']||null:null})[_0x7c30('0xa')](function(_0x1e92b8){logger[_0x7c30('0x12')]('UpdateVoiceAgentReport',_0x1b24c3);logger[_0x7c30('0x19')](_0x7c30('0x1a'),_0x1b24c3,JSON[_0x7c30('0xe')](_0x1e92b8));_0x2f86ef(_0x1e92b8);})['catch'](function(_0x711bbb){logger['error'](_0x7c30('0x1a'),_0x711bbb[_0x7c30('0x11')],_0x1b24c3);_0x36676f(_0x3a9484[_0x7c30('0xf')](0x1f4,_0x711bbb[_0x7c30('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index f72e13c..9e37def 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 _0x46ed=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer'];(function(_0x123d3d,_0x114ea5){var _0x5707bf=function(_0x9e1a39){while(--_0x9e1a39){_0x123d3d['push'](_0x123d3d['shift']());}};_0x5707bf(++_0x114ea5);}(_0x46ed,0x168));var _0xd46e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x46ed[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')]('/',auth[_0xd46e('0x9')](),controller[_0xd46e('0xa')]);router[_0xd46e('0x8')](_0xd46e('0xb'),auth[_0xd46e('0x9')](),controller[_0xd46e('0xc')]);router[_0xd46e('0x8')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller['show']);router[_0xd46e('0xe')]('/',auth[_0xd46e('0x9')](),controller['create']);router[_0xd46e('0xf')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller[_0xd46e('0x10')]);router[_0xd46e('0x11')](_0xd46e('0xd'),auth['isAuthenticated'](),controller[_0xd46e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5fc3=['/:id','show','post','create','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe'];(function(_0x457402,_0x396df5){var _0x23e76d=function(_0x145810){while(--_0x145810){_0x457402['push'](_0x457402['shift']());}};_0x23e76d(++_0x396df5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x13992d,_0x3029ea){_0x13992d=_0x13992d-0x0;var _0x3d15bf=_0x5fc3[_0x13992d];return _0x3d15bf;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 14817c5..90591f9 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 _0x7f52=['outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','exports','STRING','ENUM','internal'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7f52,0xec));var _0x27f5=function(_0x18cb5c,_0x58e8ca){_0x18cb5c=_0x18cb5c-0x0;var _0x2f9171=_0x7f52[_0x18cb5c];return _0x2f9171;};'use strict';var Sequelize=require('sequelize');module[_0x27f5('0x0')]={'uniqueid':{'type':Sequelize[_0x27f5('0x1')]},'type':{'type':Sequelize[_0x27f5('0x2')]('inbound',_0x27f5('0x3'),_0x27f5('0x4'),_0x27f5('0x5'),_0x27f5('0x6'),'dialer')},'tag':{'type':Sequelize[_0x27f5('0x1')]},'accountcode':{'type':Sequelize[_0x27f5('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x27f5('0x1')]},'destinationcontext':{'type':Sequelize[_0x27f5('0x1')]},'callerid':{'type':Sequelize[_0x27f5('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x27f5('0x1')]},'lastapplication':{'type':Sequelize[_0x27f5('0x1')]},'lastdata':{'type':Sequelize[_0x27f5('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x27f5('0x8')]},'answertime':{'type':Sequelize[_0x27f5('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x27f5('0x9')]},'billableseconds':{'type':Sequelize[_0x27f5('0x9')]},'mohtime':{'type':Sequelize[_0x27f5('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x27f5('0x1')]},'amaflags':{'type':Sequelize[_0x27f5('0x1')]},'userfield':{'type':Sequelize[_0x27f5('0x1')]},'userDisposition':{'type':Sequelize[_0x27f5('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x27f5('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x27f5('0x1')]},'note':{'type':Sequelize[_0x27f5('0x1')]},'prefix':{'type':Sequelize[_0x27f5('0x1')]},'routeid':{'type':Sequelize[_0x27f5('0x9')]},'sipcallid':{'type':Sequelize[_0x27f5('0x1')]}}; \ No newline at end of file +var _0xdb2b=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound'];(function(_0x46811d,_0x44df36){var _0x36e67c=function(_0x17299b){while(--_0x17299b){_0x46811d['push'](_0x46811d['shift']());}};_0x36e67c(++_0x44df36);}(_0xdb2b,0xa2));var _0xbdb2=function(_0x1062e3,_0x49349e){_0x1062e3=_0x1062e3-0x0;var _0x92e616=_0xdb2b[_0x1062e3];return _0x92e616;};'use strict';var Sequelize=require(_0xbdb2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbdb2('0x1')]},'type':{'type':Sequelize[_0xbdb2('0x2')](_0xbdb2('0x3'),_0xbdb2('0x4'),_0xbdb2('0x5'),_0xbdb2('0x6'),_0xbdb2('0x7'),_0xbdb2('0x8'))},'tag':{'type':Sequelize[_0xbdb2('0x1')]},'accountcode':{'type':Sequelize[_0xbdb2('0x1')]},'source':{'type':Sequelize[_0xbdb2('0x1')]},'destination':{'type':Sequelize[_0xbdb2('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbdb2('0x1')]},'destinationchannel':{'type':Sequelize[_0xbdb2('0x1')]},'lastapplication':{'type':Sequelize[_0xbdb2('0x1')]},'lastdata':{'type':Sequelize[_0xbdb2('0x9')]},'starttime':{'type':Sequelize[_0xbdb2('0xa')]},'systemanswertime':{'type':Sequelize[_0xbdb2('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xbdb2('0xa')]},'duration':{'type':Sequelize[_0xbdb2('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xbdb2('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbdb2('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbdb2('0x1')]},'userDisposition':{'type':Sequelize[_0xbdb2('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xbdb2('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbdb2('0x1')]},'prefix':{'type':Sequelize[_0xbdb2('0x1')]},'routeid':{'type':Sequelize[_0xbdb2('0xb')]},'sipcallid':{'type':Sequelize[_0xbdb2('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 93b7953..8eb00bc 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x5f2f,0x73));var _0xf5f2=function(_0x13e9d8,_0x5afef8){_0x13e9d8=_0x13e9d8-0x0;var _0x1acd01=_0x5f2f[_0x13e9d8];return _0x1acd01;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0xadb5,0xad));var _0x5adb=function(_0x42ba08,_0x1d90a5){_0x42ba08=_0x42ba08-0x0;var _0x29977a=_0xadb5[_0x42ba08];return _0x29977a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));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('0x7'));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 as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ecd645c..466a326 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 _0x6c63=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c63,0x1ee));var _0x36c6=function(_0xe8a916,_0x34b51a){_0xe8a916=_0xe8a916-0x0;var _0x436e28=_0x6c63[_0xe8a916];return _0x436e28;};'use strict';var _=require(_0x36c6('0x0'));var util=require(_0x36c6('0x1'));var logger=require(_0x36c6('0x2'))(_0x36c6('0x3'));var moment=require(_0x36c6('0x4'));var BPromise=require(_0x36c6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36c6('0x6'));var rimraf=require(_0x36c6('0x7'));var config=require(_0x36c6('0x8'));var attributes=require(_0x36c6('0x9'));module[_0x36c6('0xa')]=function(_0x586e75,_0x3c0d6c){return _0x586e75[_0x36c6('0xb')](_0x36c6('0xc'),attributes,{'tableName':_0x36c6('0xd'),'paranoid':![],'indexes':[{'fields':[_0x36c6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x92d4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3c13ae,_0x531f44){var _0x38411c=function(_0x187f91){while(--_0x187f91){_0x3c13ae['push'](_0x3c13ae['shift']());}};_0x38411c(++_0x531f44);}(_0x92d4,0x6c));var _0x492d=function(_0x5840fb,_0x478054){_0x5840fb=_0x5840fb-0x0;var _0x407e5b=_0x92d4[_0x5840fb];return _0x407e5b;};'use strict';var _=require(_0x492d('0x0'));var util=require(_0x492d('0x1'));var logger=require(_0x492d('0x2'))(_0x492d('0x3'));var moment=require(_0x492d('0x4'));var BPromise=require(_0x492d('0x5'));var rp=require(_0x492d('0x6'));var fs=require('fs');var path=require(_0x492d('0x7'));var rimraf=require(_0x492d('0x8'));var config=require(_0x492d('0x9'));var attributes=require(_0x492d('0xa'));module['exports']=function(_0x12981d,_0x558cb3){return _0x12981d['define'](_0x492d('0xb'),attributes,{'tableName':_0x492d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x492d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index b3d3f91..aac85da 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 _0x9ccf=['http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','map','model','catch','CreateVoiceCallReport','create','body','stringify','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment'];(function(_0x3969df,_0x543d73){var _0x12dae2=function(_0x22906a){while(--_0x22906a){_0x3969df['push'](_0x3969df['shift']());}};_0x12dae2(++_0x543d73);}(_0x9ccf,0x111));var _0xf9cc=function(_0x22cfdc,_0xe97df4){_0x22cfdc=_0x22cfdc-0x0;var _0x396bc2=_0x9ccf[_0x22cfdc];return _0x396bc2;};'use strict';var _=require(_0xf9cc('0x0'));var util=require(_0xf9cc('0x1'));var moment=require(_0xf9cc('0x2'));var BPromise=require(_0xf9cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf9cc('0x5'));var config=require(_0xf9cc('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf9cc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5104e6,_0x3e21b8,_0x1d5c46){return new BPromise(function(_0x34f706,_0x365b2f){return client['request'](_0x5104e6,_0x1d5c46)[_0xf9cc('0x8')](function(_0x2522f9){logger[_0xf9cc('0x9')](_0xf9cc('0xa'),_0x3e21b8,_0xf9cc('0xb'));logger[_0xf9cc('0xc')](_0xf9cc('0xd'),_0x3e21b8,_0xf9cc('0xb'),JSON['stringify'](_0x2522f9));if(_0x2522f9[_0xf9cc('0xe')]){if(_0x2522f9['error'][_0xf9cc('0xf')]===0x1f4){logger[_0xf9cc('0xe')](_0xf9cc('0xa'),_0x3e21b8,_0x2522f9['error'][_0xf9cc('0x10')]);return _0x365b2f(_0x2522f9['error'][_0xf9cc('0x10')]);}logger['error'](_0xf9cc('0xa'),_0x3e21b8,_0x2522f9[_0xf9cc('0xe')][_0xf9cc('0x10')]);return _0x34f706(_0x2522f9[_0xf9cc('0xe')][_0xf9cc('0x10')]);}else{logger[_0xf9cc('0x9')]('VoiceCallReport,\x20%s,\x20%s',_0x3e21b8,_0xf9cc('0xb'));_0x34f706(_0x2522f9[_0xf9cc('0x11')]['message']);}})['catch'](function(_0x1e4534){logger[_0xf9cc('0xe')](_0xf9cc('0xa'),_0x3e21b8,_0x1e4534);_0x365b2f(_0x1e4534);});});}exports[_0xf9cc('0x12')]=function(_0x6d954d){var _0x44c8ac=this;return new Promise(function(_0x3b9881,_0x196f52){return db[_0xf9cc('0x13')]['findAll']({'raw':_0x6d954d[_0xf9cc('0x14')]?_0x6d954d[_0xf9cc('0x14')][_0xf9cc('0x15')]===undefined?!![]:![]:!![],'where':_0x6d954d[_0xf9cc('0x14')]?_0x6d954d['options'][_0xf9cc('0x16')]||null:null,'attributes':_0x6d954d['options']?_0x6d954d[_0xf9cc('0x14')][_0xf9cc('0x17')]||null:null,'limit':_0x6d954d['options']?_0x6d954d['options'][_0xf9cc('0x18')]||null:null,'include':_0x6d954d['options']?_0x6d954d[_0xf9cc('0x14')][_0xf9cc('0x19')]?_[_0xf9cc('0x1a')](_0x6d954d['options'][_0xf9cc('0x19')],function(_0xa3bcc){return{'model':db[_0xa3bcc['model']],'as':_0xa3bcc['as'],'attributes':_0xa3bcc[_0xf9cc('0x17')],'include':_0xa3bcc['include']?_[_0xf9cc('0x1a')](_0xa3bcc[_0xf9cc('0x19')],function(_0x5a6961){return{'model':db[_0x5a6961[_0xf9cc('0x1b')]],'as':_0x5a6961['as'],'attributes':_0x5a6961['attributes'],'include':_0x5a6961[_0xf9cc('0x19')]?_['map'](_0x5a6961[_0xf9cc('0x19')],function(_0x83099d){return{'model':db[_0x83099d['model']],'as':_0x83099d['as'],'attributes':_0x83099d[_0xf9cc('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf9cc('0x8')](function(_0x49d0b4){logger[_0xf9cc('0x9')](_0xf9cc('0x12'),_0x6d954d);logger[_0xf9cc('0xc')](_0xf9cc('0x12'),_0x6d954d,JSON['stringify'](_0x49d0b4));_0x3b9881(_0x49d0b4);})[_0xf9cc('0x1c')](function(_0x4f18d2){logger[_0xf9cc('0xe')](_0xf9cc('0x12'),_0x4f18d2['message'],_0x6d954d);_0x196f52(_0x44c8ac[_0xf9cc('0xe')](0x1f4,_0x4f18d2[_0xf9cc('0x10')]));});});};exports[_0xf9cc('0x1d')]=function(_0x485dc6){var _0x52c51c=this;return new Promise(function(_0x42a6ca,_0x36ea2d){return db[_0xf9cc('0x13')][_0xf9cc('0x1e')](_0x485dc6[_0xf9cc('0x1f')],{'raw':_0x485dc6['options']?_0x485dc6[_0xf9cc('0x14')][_0xf9cc('0x15')]===undefined?!![]:![]:!![]})[_0xf9cc('0x8')](function(_0x9e5146){logger['info']('CreateVoiceCallReport',_0x485dc6);logger[_0xf9cc('0xc')](_0xf9cc('0x1d'),_0x485dc6,JSON[_0xf9cc('0x20')](_0x9e5146));_0x42a6ca(_0x9e5146);})['catch'](function(_0x1e016f){logger[_0xf9cc('0xe')](_0xf9cc('0x1d'),_0x1e016f['message'],_0x485dc6);_0x36ea2d(_0x52c51c[_0xf9cc('0xe')](0x1f4,_0x1e016f[_0xf9cc('0x10')]));});});};exports[_0xf9cc('0x21')]=function(_0x4e8ead){var _0x852b3b=this;return new Promise(function(_0x59fd8a,_0x1d3fe0){return db['VoiceCallReport'][_0xf9cc('0x22')](_0x4e8ead[_0xf9cc('0x1f')],{'raw':_0x4e8ead['options']?_0x4e8ead[_0xf9cc('0x14')][_0xf9cc('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e8ead[_0xf9cc('0x14')]?_0x4e8ead[_0xf9cc('0x14')][_0xf9cc('0x16')]||null:null,'attributes':_0x4e8ead[_0xf9cc('0x14')]?_0x4e8ead[_0xf9cc('0x14')][_0xf9cc('0x17')]||null:null,'limit':_0x4e8ead[_0xf9cc('0x14')]?_0x4e8ead[_0xf9cc('0x14')]['limit']||null:null})[_0xf9cc('0x8')](function(_0x2ba996){logger[_0xf9cc('0x9')](_0xf9cc('0x21'),_0x4e8ead);logger['debug'](_0xf9cc('0x21'),_0x4e8ead,JSON['stringify'](_0x2ba996));_0x59fd8a(_0x2ba996);})[_0xf9cc('0x1c')](function(_0x19dee1){logger[_0xf9cc('0xe')]('UpdateVoiceCallReport',_0x19dee1[_0xf9cc('0x10')],_0x4e8ead);_0x1d3fe0(_0x852b3b['error'](0x1f4,_0x19dee1[_0xf9cc('0x10')]));});});}; \ No newline at end of file +var _0xeeaf=['result','catch','findAll','raw','options','where','attributes','limit','include','model','map','then','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','body','stringify','update','UpdateVoiceCallReport','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceCallReport,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent'];(function(_0xf1c96c,_0x116265){var _0x23632a=function(_0x2e7301){while(--_0x2e7301){_0xf1c96c['push'](_0xf1c96c['shift']());}};_0x23632a(++_0x116265);}(_0xeeaf,0x1b6));var _0xfeea=function(_0x448654,_0x5d8357){_0x448654=_0x448654-0x0;var _0x5a7b3d=_0xeeaf[_0x448654];return _0x5a7b3d;};'use strict';var _=require(_0xfeea('0x0'));var util=require('util');var moment=require(_0xfeea('0x1'));var BPromise=require(_0xfeea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfeea('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfeea('0x4'))(_0xfeea('0x5'));var config=require(_0xfeea('0x6'));var jayson=require(_0xfeea('0x7'));var client=jayson[_0xfeea('0x8')][_0xfeea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x439d40,_0x1dbff0,_0x298462){return new BPromise(function(_0x2c0b2c,_0x3f16ed){return client[_0xfeea('0xa')](_0x439d40,_0x298462)['then'](function(_0x1620a9){logger['info'](_0xfeea('0xb'),_0x1dbff0,'request\x20sent');logger[_0xfeea('0xc')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1dbff0,'request\x20sent',JSON['stringify'](_0x1620a9));if(_0x1620a9[_0xfeea('0xd')]){if(_0x1620a9[_0xfeea('0xd')][_0xfeea('0xe')]===0x1f4){logger['error'](_0xfeea('0xb'),_0x1dbff0,_0x1620a9[_0xfeea('0xd')][_0xfeea('0xf')]);return _0x3f16ed(_0x1620a9[_0xfeea('0xd')][_0xfeea('0xf')]);}logger[_0xfeea('0xd')](_0xfeea('0xb'),_0x1dbff0,_0x1620a9[_0xfeea('0xd')]['message']);return _0x2c0b2c(_0x1620a9[_0xfeea('0xd')][_0xfeea('0xf')]);}else{logger[_0xfeea('0x10')](_0xfeea('0xb'),_0x1dbff0,_0xfeea('0x11'));_0x2c0b2c(_0x1620a9[_0xfeea('0x12')][_0xfeea('0xf')]);}})[_0xfeea('0x13')](function(_0x1e0d05){logger[_0xfeea('0xd')](_0xfeea('0xb'),_0x1dbff0,_0x1e0d05);_0x3f16ed(_0x1e0d05);});});}exports['GetVoiceCallReport']=function(_0x1f16c1){var _0x37f7d9=this;return new Promise(function(_0x5bc374,_0x1d4903){return db['VoiceCallReport'][_0xfeea('0x14')]({'raw':_0x1f16c1['options']?_0x1f16c1['options'][_0xfeea('0x15')]===undefined?!![]:![]:!![],'where':_0x1f16c1[_0xfeea('0x16')]?_0x1f16c1[_0xfeea('0x16')][_0xfeea('0x17')]||null:null,'attributes':_0x1f16c1[_0xfeea('0x16')]?_0x1f16c1['options'][_0xfeea('0x18')]||null:null,'limit':_0x1f16c1['options']?_0x1f16c1[_0xfeea('0x16')][_0xfeea('0x19')]||null:null,'include':_0x1f16c1['options']?_0x1f16c1[_0xfeea('0x16')][_0xfeea('0x1a')]?_['map'](_0x1f16c1[_0xfeea('0x16')][_0xfeea('0x1a')],function(_0x6b5ec5){return{'model':db[_0x6b5ec5[_0xfeea('0x1b')]],'as':_0x6b5ec5['as'],'attributes':_0x6b5ec5[_0xfeea('0x18')],'include':_0x6b5ec5['include']?_[_0xfeea('0x1c')](_0x6b5ec5[_0xfeea('0x1a')],function(_0x4f0c42){return{'model':db[_0x4f0c42['model']],'as':_0x4f0c42['as'],'attributes':_0x4f0c42[_0xfeea('0x18')],'include':_0x4f0c42[_0xfeea('0x1a')]?_['map'](_0x4f0c42[_0xfeea('0x1a')],function(_0x29a98e){return{'model':db[_0x29a98e[_0xfeea('0x1b')]],'as':_0x29a98e['as'],'attributes':_0x29a98e['attributes']};}):[]};}):[]};}):[]:[]})[_0xfeea('0x1d')](function(_0x5c86a2){logger['info'](_0xfeea('0x1e'),_0x1f16c1);logger['debug'](_0xfeea('0x1e'),_0x1f16c1,JSON['stringify'](_0x5c86a2));_0x5bc374(_0x5c86a2);})[_0xfeea('0x13')](function(_0x1d4e7d){logger[_0xfeea('0xd')]('GetVoiceCallReport',_0x1d4e7d[_0xfeea('0xf')],_0x1f16c1);_0x1d4903(_0x37f7d9[_0xfeea('0xd')](0x1f4,_0x1d4e7d[_0xfeea('0xf')]));});});};exports[_0xfeea('0x1f')]=function(_0x124f6d){var _0xd5eea7=this;return new Promise(function(_0x58fdad,_0x4bbe83){return db[_0xfeea('0x20')][_0xfeea('0x21')](_0x124f6d[_0xfeea('0x22')],{'raw':_0x124f6d['options']?_0x124f6d['options'][_0xfeea('0x15')]===undefined?!![]:![]:!![]})[_0xfeea('0x1d')](function(_0xaa7e39){logger[_0xfeea('0x10')](_0xfeea('0x1f'),_0x124f6d);logger[_0xfeea('0xc')]('CreateVoiceCallReport',_0x124f6d,JSON[_0xfeea('0x23')](_0xaa7e39));_0x58fdad(_0xaa7e39);})[_0xfeea('0x13')](function(_0x512717){logger[_0xfeea('0xd')](_0xfeea('0x1f'),_0x512717['message'],_0x124f6d);_0x4bbe83(_0xd5eea7[_0xfeea('0xd')](0x1f4,_0x512717[_0xfeea('0xf')]));});});};exports['UpdateVoiceCallReport']=function(_0x5f1a40){var _0x1225f1=this;return new Promise(function(_0x2251d3,_0x3ec495){return db[_0xfeea('0x20')][_0xfeea('0x24')](_0x5f1a40[_0xfeea('0x22')],{'raw':_0x5f1a40[_0xfeea('0x16')]?_0x5f1a40[_0xfeea('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f1a40[_0xfeea('0x16')]?_0x5f1a40[_0xfeea('0x16')][_0xfeea('0x17')]||null:null,'attributes':_0x5f1a40[_0xfeea('0x16')]?_0x5f1a40[_0xfeea('0x16')]['attributes']||null:null,'limit':_0x5f1a40['options']?_0x5f1a40['options']['limit']||null:null})['then'](function(_0x4fdd6b){logger[_0xfeea('0x10')](_0xfeea('0x25'),_0x5f1a40);logger[_0xfeea('0xc')](_0xfeea('0x25'),_0x5f1a40,JSON['stringify'](_0x4fdd6b));_0x2251d3(_0x4fdd6b);})['catch'](function(_0x3dc3e4){logger[_0xfeea('0xd')](_0xfeea('0x25'),_0x3dc3e4[_0xfeea('0xf')],_0x5f1a40);_0x3ec495(_0x1225f1['error'](0x1f4,_0x3dc3e4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 08aa7b1..acc8b08 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 _0xf3b0=['put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0xf3b0,0x194));var _0x0f3b=function(_0x44606e,_0x2bf244){_0x44606e=_0x44606e-0x0;var _0xe68388=_0xf3b0[_0x44606e];return _0xe68388;};'use strict';var multer=require('multer');var util=require(_0x0f3b('0x0'));var path=require(_0x0f3b('0x1'));var timeout=require(_0x0f3b('0x2'));var express=require(_0x0f3b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0f3b('0x4'));var interaction=require(_0x0f3b('0x5'));var config=require(_0x0f3b('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x0f3b('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f3b('0x8')]);router[_0x0f3b('0x7')](_0x0f3b('0x9'),auth[_0x0f3b('0xa')](),controller[_0x0f3b('0xb')]);router[_0x0f3b('0xc')]('/',auth['isAuthenticated'](),controller[_0x0f3b('0xd')]);router[_0x0f3b('0xe')]('/:id',auth[_0x0f3b('0xa')](),controller[_0x0f3b('0xf')]);router[_0x0f3b('0x10')](_0x0f3b('0x9'),auth['isAuthenticated'](),controller[_0x0f3b('0x11')]);module[_0x0f3b('0x12')]=router; \ No newline at end of file +var _0xfdd1=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index','post','isAuthenticated','create','delete','/:id','destroy'];(function(_0x1d9214,_0x39b7e5){var _0x35a973=function(_0x4dc751){while(--_0x4dc751){_0x1d9214['push'](_0x1d9214['shift']());}};_0x35a973(++_0x39b7e5);}(_0xfdd1,0xab));var _0x1fdd=function(_0x38a162,_0x4396b2){_0x38a162=_0x38a162-0x0;var _0x1f622b=_0xfdd1[_0x38a162];return _0x1f622b;};'use strict';var multer=require(_0x1fdd('0x0'));var util=require(_0x1fdd('0x1'));var path=require(_0x1fdd('0x2'));var timeout=require(_0x1fdd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1fdd('0x4'));var auth=require(_0x1fdd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fdd('0x6'));var controller=require(_0x1fdd('0x7'));router[_0x1fdd('0x8')]('/',auth['isAuthenticated'](),controller[_0x1fdd('0x9')]);router[_0x1fdd('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1fdd('0xa')]('/',auth[_0x1fdd('0xb')](),controller[_0x1fdd('0xc')]);router['put']('/:id',auth[_0x1fdd('0xb')](),controller['update']);router[_0x1fdd('0xd')](_0x1fdd('0xe'),auth[_0x1fdd('0xb')](),controller[_0x1fdd('0xf')]);module[_0x1fdd('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index dacb1a3..134911b 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 _0xf937=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','options'];(function(_0xb43d1b,_0x3935cf){var _0x4aafca=function(_0x3b26d2){while(--_0x3b26d2){_0xb43d1b['push'](_0xb43d1b['shift']());}};_0x4aafca(++_0x3935cf);}(_0xf937,0x189));var _0x7f93=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0xf937[_0x147497];return _0x35f45;};'use strict';var Sequelize=require(_0x7f93('0x0'));module[_0x7f93('0x1')]={'name':{'type':Sequelize[_0x7f93('0x2')]},'prefix':{'type':Sequelize[_0x7f93('0x2')],'unique':_0x7f93('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x7f93('0x2')],'set':function(_0x18b038){this[_0x7f93('0x4')]('options',_0x18b038?_0x18b038[_0x7f93('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x7f93('0x6'))?this[_0x7f93('0x7')]('options')[_0x7f93('0x8')](''):[];}},'auth':{'type':Sequelize[_0x7f93('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x7f93('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7f93('0x2')]},'description':{'type':Sequelize[_0x7f93('0x2')]}}; \ No newline at end of file +var _0xd030=['getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue','options'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0xd030,0xb3));var _0x0d03=function(_0x3a8cec,_0x193cee){_0x3a8cec=_0x3a8cec-0x0;var _0x2c2509=_0xd030[_0x3a8cec];return _0x2c2509;};'use strict';var Sequelize=require(_0x0d03('0x0'));module['exports']={'name':{'type':Sequelize[_0x0d03('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x0d03('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x2cb080){this[_0x0d03('0x3')](_0x0d03('0x4'),_0x2cb080?_0x2cb080['join'](''):[]);},'get':function(){return this['getDataValue'](_0x0d03('0x4'))?this[_0x0d03('0x5')](_0x0d03('0x4'))[_0x0d03('0x6')](''):[];}},'auth':{'type':Sequelize[_0x0d03('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0d03('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0d03('0x1')]},'description':{'type':Sequelize[_0x0d03('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 6c7e8e2..b282825 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 _0x6ddd=['include','find','catch','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','stack','name','send','index','map','VoiceChanSpy','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','params'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x6ddd,0xae));var _0xd6dd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6ddd[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd6dd('0x0'));var jsonpatch=require(_0xd6dd('0x1'));var rp=require(_0xd6dd('0x2'));var moment=require(_0xd6dd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd6dd('0x4'));var util=require('util');var path=require(_0xd6dd('0x5'));var sox=require('sox');var csv=require(_0xd6dd('0x6'));var ejs=require(_0xd6dd('0x7'));var fs=require('fs');var fs_extra=require(_0xd6dd('0x8'));var _=require('lodash');var squel=require(_0xd6dd('0x9'));var crypto=require(_0xd6dd('0xa'));var jsforce=require(_0xd6dd('0xb'));var deskjs=require(_0xd6dd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd6dd('0xd'));var Papa=require(_0xd6dd('0xe'));var Redis=require(_0xd6dd('0xf'));var authService=require(_0xd6dd('0x10'));var qs=require(_0xd6dd('0x11'));var as=require(_0xd6dd('0x12'));var hardwareService=require(_0xd6dd('0x13'));var logger=require(_0xd6dd('0x14'))(_0xd6dd('0x15'));var utils=require(_0xd6dd('0x16'));var config=require(_0xd6dd('0x17'));var licenseUtil=require(_0xd6dd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3436b5,_0x1ddb38){_0x1ddb38=_0x1ddb38||0xcc;return function(_0x240b83){if(_0x240b83){return _0x3436b5[_0xd6dd('0x19')](_0x1ddb38);}return _0x3436b5[_0xd6dd('0x1a')](_0x1ddb38)[_0xd6dd('0x1b')]();};}function respondWithResult(_0x302760,_0x550953){_0x550953=_0x550953||0xc8;return function(_0x305928){if(_0x305928){return _0x302760[_0xd6dd('0x1a')](_0x550953)[_0xd6dd('0x1c')](_0x305928);}};}function respondWithFilteredResult(_0x40febd,_0x3381e9){return function(_0x2c935e){if(_0x2c935e){var _0x41b358=typeof _0x3381e9[_0xd6dd('0x1d')]===_0xd6dd('0x1e')&&typeof _0x3381e9[_0xd6dd('0x1f')]===_0xd6dd('0x1e');var _0x289865=_0x2c935e['count'];var _0x254fb9=_0x41b358?0x0:_0x3381e9[_0xd6dd('0x1d')];var _0x3941d3=_0x41b358?_0x2c935e[_0xd6dd('0x20')]:_0x3381e9['offset']+_0x3381e9['limit'];var _0x84a5d4;if(_0x3941d3>=_0x289865){_0x3941d3=_0x289865;_0x84a5d4=0xc8;}else{_0x84a5d4=0xce;}_0x40febd[_0xd6dd('0x1a')](_0x84a5d4);return _0x40febd['set'](_0xd6dd('0x21'),_0x254fb9+'-'+_0x3941d3+'/'+_0x289865)[_0xd6dd('0x1c')](_0x2c935e);}return null;};}function patchUpdates(_0x4f27dd){return function(_0x4436c9){try{jsonpatch[_0xd6dd('0x22')](_0x4436c9,_0x4f27dd,!![]);}catch(_0x1786c8){return BPromise['reject'](_0x1786c8);}return _0x4436c9[_0xd6dd('0x23')]();};}function saveUpdates(_0x44e84c,_0x2acc65){return function(_0x4b2275){if(_0x4b2275){return _0x4b2275[_0xd6dd('0x24')](_0x44e84c)[_0xd6dd('0x25')](function(_0x46fe45){return _0x46fe45;});}return null;};}function removeEntity(_0x1b9275,_0x23d5bc){return function(_0x33f40b){if(_0x33f40b){return _0x33f40b[_0xd6dd('0x26')]()['then'](function(){var _0x4cca24=_0x33f40b[_0xd6dd('0x27')]({'plain':!![]});var _0x48c31a='ChanSpies';return db['UserProfileResource'][_0xd6dd('0x26')]({'where':{'type':_0x48c31a,'resourceId':_0x4cca24['id']}})['then'](function(){return _0x33f40b;});})['then'](function(){_0x1b9275['status'](0xcc)[_0xd6dd('0x1b')]();});}};}function handleEntityNotFound(_0x17bed4,_0x199057){return function(_0x86bab9){if(!_0x86bab9){_0x17bed4[_0xd6dd('0x19')](0x194);}return _0x86bab9;};}function handleError(_0x315e97,_0x5d9ca3){_0x5d9ca3=_0x5d9ca3||0x1f4;return function(_0x108c10){logger['error'](_0x108c10[_0xd6dd('0x28')]);if(_0x108c10[_0xd6dd('0x29')]){delete _0x108c10[_0xd6dd('0x29')];}_0x315e97[_0xd6dd('0x1a')](_0x5d9ca3)[_0xd6dd('0x2a')](_0x108c10);};}exports[_0xd6dd('0x2b')]=function(_0x394ac2,_0x38e44d){var _0x45b10e={},_0x17e11c={},_0x5aa9c0={'count':0x0,'rows':[]};var _0x357a80=_[_0xd6dd('0x2c')](db[_0xd6dd('0x2d')][_0xd6dd('0x2e')],function(_0x2a5a73){return{'name':_0x2a5a73['fieldName'],'type':_0x2a5a73['type'][_0xd6dd('0x2f')]};});_0x17e11c[_0xd6dd('0x30')]=_[_0xd6dd('0x2c')](_0x357a80,_0xd6dd('0x29'));_0x17e11c[_0xd6dd('0x31')]=_[_0xd6dd('0x32')](_0x394ac2[_0xd6dd('0x31')]);_0x17e11c[_0xd6dd('0x33')]=_['intersection'](_0x17e11c[_0xd6dd('0x30')],_0x17e11c[_0xd6dd('0x31')]);_0x45b10e[_0xd6dd('0x34')]=_[_0xd6dd('0x35')](_0x17e11c[_0xd6dd('0x30')],qs[_0xd6dd('0x36')](_0x394ac2[_0xd6dd('0x31')]['fields']));_0x45b10e[_0xd6dd('0x34')]=_0x45b10e['attributes'][_0xd6dd('0x37')]?_0x45b10e['attributes']:_0x17e11c[_0xd6dd('0x30')];if(!_0x394ac2[_0xd6dd('0x31')]['hasOwnProperty'](_0xd6dd('0x38'))){_0x45b10e[_0xd6dd('0x1f')]=qs['limit'](_0x394ac2['query'][_0xd6dd('0x1f')]);_0x45b10e[_0xd6dd('0x1d')]=qs[_0xd6dd('0x1d')](_0x394ac2[_0xd6dd('0x31')][_0xd6dd('0x1d')]);}_0x45b10e['order']=qs['sort'](_0x394ac2[_0xd6dd('0x31')][_0xd6dd('0x39')]);_0x45b10e[_0xd6dd('0x3a')]=qs[_0xd6dd('0x33')](_[_0xd6dd('0x3b')](_0x394ac2[_0xd6dd('0x31')],_0x17e11c['filters']),_0x357a80);if(_0x394ac2[_0xd6dd('0x31')]['filter']){_0x45b10e['where']=_[_0xd6dd('0x3c')](_0x45b10e[_0xd6dd('0x3a')],{'$or':_[_0xd6dd('0x2c')](_0x357a80,function(_0x2d037e){if(_0x2d037e[_0xd6dd('0x3d')]!==_0xd6dd('0x3e')){var _0x254365={};_0x254365[_0x2d037e[_0xd6dd('0x29')]]={'$like':'%'+_0x394ac2['query'][_0xd6dd('0x3f')]+'%'};return _0x254365;}})});}_0x45b10e=_[_0xd6dd('0x3c')]({},_0x45b10e,_0x394ac2[_0xd6dd('0x40')]);var _0x4ff1ed={'where':_0x45b10e['where']};return db[_0xd6dd('0x2d')][_0xd6dd('0x20')](_0x4ff1ed)['then'](function(_0x20ccb4){_0x5aa9c0['count']=_0x20ccb4;if(_0x394ac2[_0xd6dd('0x31')][_0xd6dd('0x41')]){_0x45b10e['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xd6dd('0x42')](_0x45b10e);})['then'](function(_0x3b73ff){_0x5aa9c0[_0xd6dd('0x43')]=_0x3b73ff;return _0x5aa9c0;})[_0xd6dd('0x25')](respondWithFilteredResult(_0x38e44d,_0x45b10e))['catch'](handleError(_0x38e44d,null));};exports['show']=function(_0x46adaa,_0x3f2e89){var _0x20b4e8={'raw':![],'where':{'id':_0x46adaa[_0xd6dd('0x44')]['id']}},_0x128ec6={};_0x128ec6[_0xd6dd('0x30')]=_[_0xd6dd('0x32')](db['VoiceChanSpy'][_0xd6dd('0x2e')]);_0x128ec6[_0xd6dd('0x31')]=_[_0xd6dd('0x32')](_0x46adaa['query']);_0x128ec6[_0xd6dd('0x33')]=_[_0xd6dd('0x35')](_0x128ec6[_0xd6dd('0x30')],_0x128ec6[_0xd6dd('0x31')]);_0x20b4e8[_0xd6dd('0x34')]=_[_0xd6dd('0x35')](_0x128ec6[_0xd6dd('0x30')],qs[_0xd6dd('0x36')](_0x46adaa['query'][_0xd6dd('0x36')]));_0x20b4e8[_0xd6dd('0x34')]=_0x20b4e8[_0xd6dd('0x34')]['length']?_0x20b4e8[_0xd6dd('0x34')]:_0x128ec6[_0xd6dd('0x30')];if(_0x46adaa[_0xd6dd('0x31')]['includeAll']){_0x20b4e8[_0xd6dd('0x45')]=[{'all':!![]}];}_0x20b4e8=_[_0xd6dd('0x3c')]({},_0x20b4e8,_0x46adaa[_0xd6dd('0x40')]);return db[_0xd6dd('0x2d')][_0xd6dd('0x46')](_0x20b4e8)[_0xd6dd('0x25')](handleEntityNotFound(_0x3f2e89,null))['then'](respondWithResult(_0x3f2e89,null))[_0xd6dd('0x47')](handleError(_0x3f2e89,null));};exports[_0xd6dd('0x48')]=function(_0x36befa,_0x9de2ea){return db[_0xd6dd('0x2d')]['create'](_0x36befa[_0xd6dd('0x49')],{})[_0xd6dd('0x25')](function(_0x517d4a){var _0x41b7e8=_0x36befa[_0xd6dd('0x4a')][_0xd6dd('0x27')]({'plain':!![]});if(!_0x41b7e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41b7e8[_0xd6dd('0x4b')]===_0xd6dd('0x4a')){var _0x41a7f7=_0x517d4a[_0xd6dd('0x27')]({'plain':!![]});var _0x18243f='ChanSpies';return db[_0xd6dd('0x4c')]['find']({'where':{'name':_0x18243f,'userProfileId':_0x41b7e8['userProfileId']},'raw':!![]})[_0xd6dd('0x25')](function(_0x2f3826){if(_0x2f3826&&_0x2f3826[_0xd6dd('0x4d')]===0x0){return db[_0xd6dd('0x4e')][_0xd6dd('0x48')]({'name':_0x41a7f7['name'],'resourceId':_0x41a7f7['id'],'type':_0x2f3826['name'],'sectionId':_0x2f3826['id']},{})[_0xd6dd('0x25')](function(){return _0x517d4a;});}else{return _0x517d4a;}})[_0xd6dd('0x47')](function(_0x48f04b){logger[_0xd6dd('0x4f')](_0xd6dd('0x50'),_0x48f04b);throw _0x48f04b;});}return _0x517d4a;})[_0xd6dd('0x25')](respondWithResult(_0x9de2ea,0xc9))[_0xd6dd('0x47')](handleError(_0x9de2ea,null));};exports['update']=function(_0x3b559f,_0x3348e4){if(_0x3b559f[_0xd6dd('0x49')]['id']){delete _0x3b559f[_0xd6dd('0x49')]['id'];}return db[_0xd6dd('0x2d')][_0xd6dd('0x46')]({'where':{'id':_0x3b559f[_0xd6dd('0x44')]['id']}})[_0xd6dd('0x25')](handleEntityNotFound(_0x3348e4,null))['then'](saveUpdates(_0x3b559f[_0xd6dd('0x49')],null))[_0xd6dd('0x25')](respondWithResult(_0x3348e4,null))['catch'](handleError(_0x3348e4,null));};exports[_0xd6dd('0x26')]=function(_0x79805c,_0x287610){return db['VoiceChanSpy'][_0xd6dd('0x46')]({'where':{'id':_0x79805c[_0xd6dd('0x44')]['id']}})['then'](handleEntityNotFound(_0x287610,null))[_0xd6dd('0x25')](removeEntity(_0x287610,null))[_0xd6dd('0x47')](handleError(_0x287610,null));}; \ No newline at end of file +var _0x2392=['update','then','destroy','get','ChanSpies','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply'];(function(_0x3768e4,_0x446f5e){var _0x38645f=function(_0x342889){while(--_0x342889){_0x3768e4['push'](_0x3768e4['shift']());}};_0x38645f(++_0x446f5e);}(_0x2392,0xd0));var _0x2239=function(_0x528f40,_0x384220){_0x528f40=_0x528f40-0x0;var _0x3951a9=_0x2392[_0x528f40];return _0x3951a9;};'use strict';var emlformat=require(_0x2239('0x0'));var rimraf=require(_0x2239('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2239('0x2'));var rp=require(_0x2239('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2239('0x4'));var util=require(_0x2239('0x5'));var path=require(_0x2239('0x6'));var sox=require(_0x2239('0x7'));var csv=require(_0x2239('0x8'));var ejs=require(_0x2239('0x9'));var fs=require('fs');var fs_extra=require(_0x2239('0xa'));var _=require(_0x2239('0xb'));var squel=require(_0x2239('0xc'));var crypto=require(_0x2239('0xd'));var jsforce=require(_0x2239('0xe'));var deskjs=require(_0x2239('0xf'));var toCsv=require(_0x2239('0x8'));var querystring=require('querystring');var Papa=require(_0x2239('0x10'));var Redis=require(_0x2239('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2239('0x12'));var hardwareService=require(_0x2239('0x13'));var logger=require(_0x2239('0x14'))(_0x2239('0x15'));var utils=require(_0x2239('0x16'));var config=require(_0x2239('0x17'));var licenseUtil=require(_0x2239('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4702dd,_0x3cee95){_0x3cee95=_0x3cee95||0xcc;return function(_0x4af7b7){if(_0x4af7b7){return _0x4702dd[_0x2239('0x19')](_0x3cee95);}return _0x4702dd[_0x2239('0x1a')](_0x3cee95)[_0x2239('0x1b')]();};}function respondWithResult(_0x3338b0,_0x5165dc){_0x5165dc=_0x5165dc||0xc8;return function(_0x367c82){if(_0x367c82){return _0x3338b0['status'](_0x5165dc)[_0x2239('0x1c')](_0x367c82);}};}function respondWithFilteredResult(_0x163e09,_0x4236da){return function(_0x472ce2){if(_0x472ce2){var _0x4f23ce=typeof _0x4236da[_0x2239('0x1d')]===_0x2239('0x1e')&&typeof _0x4236da['limit']===_0x2239('0x1e');var _0x4f218a=_0x472ce2[_0x2239('0x1f')];var _0x558138=_0x4f23ce?0x0:_0x4236da[_0x2239('0x1d')];var _0x594f20=_0x4f23ce?_0x472ce2[_0x2239('0x1f')]:_0x4236da[_0x2239('0x1d')]+_0x4236da[_0x2239('0x20')];var _0x3d8fd9;if(_0x594f20>=_0x4f218a){_0x594f20=_0x4f218a;_0x3d8fd9=0xc8;}else{_0x3d8fd9=0xce;}_0x163e09['status'](_0x3d8fd9);return _0x163e09[_0x2239('0x21')]('Content-Range',_0x558138+'-'+_0x594f20+'/'+_0x4f218a)[_0x2239('0x1c')](_0x472ce2);}return null;};}function patchUpdates(_0x4917cb){return function(_0x174bf7){try{jsonpatch[_0x2239('0x22')](_0x174bf7,_0x4917cb,!![]);}catch(_0x2c2d74){return BPromise['reject'](_0x2c2d74);}return _0x174bf7['save']();};}function saveUpdates(_0x2b2000,_0x521079){return function(_0x2f625d){if(_0x2f625d){return _0x2f625d[_0x2239('0x23')](_0x2b2000)[_0x2239('0x24')](function(_0x407581){return _0x407581;});}return null;};}function removeEntity(_0x54af84,_0x1f1f49){return function(_0x12133e){if(_0x12133e){return _0x12133e[_0x2239('0x25')]()[_0x2239('0x24')](function(){var _0x5c0fa7=_0x12133e[_0x2239('0x26')]({'plain':!![]});var _0x44e671=_0x2239('0x27');return db['UserProfileResource'][_0x2239('0x25')]({'where':{'type':_0x44e671,'resourceId':_0x5c0fa7['id']}})[_0x2239('0x24')](function(){return _0x12133e;});})[_0x2239('0x24')](function(){_0x54af84[_0x2239('0x1a')](0xcc)[_0x2239('0x1b')]();});}};}function handleEntityNotFound(_0x1937ee,_0xcb6711){return function(_0x4f4135){if(!_0x4f4135){_0x1937ee['sendStatus'](0x194);}return _0x4f4135;};}function handleError(_0x4a970a,_0x587ebc){_0x587ebc=_0x587ebc||0x1f4;return function(_0x576ac9){logger[_0x2239('0x28')](_0x576ac9[_0x2239('0x29')]);if(_0x576ac9[_0x2239('0x2a')]){delete _0x576ac9[_0x2239('0x2a')];}_0x4a970a['status'](_0x587ebc)[_0x2239('0x2b')](_0x576ac9);};}exports[_0x2239('0x2c')]=function(_0x3e164a,_0x23fab8){var _0xbf989f={},_0xac6fe8={},_0x26f3f2={'count':0x0,'rows':[]};var _0x5a9cdf=_[_0x2239('0x2d')](db[_0x2239('0x2e')][_0x2239('0x2f')],function(_0x3cc74c){return{'name':_0x3cc74c[_0x2239('0x30')],'type':_0x3cc74c['type'][_0x2239('0x31')]};});_0xac6fe8[_0x2239('0x32')]=_['map'](_0x5a9cdf,'name');_0xac6fe8['query']=_['keys'](_0x3e164a['query']);_0xac6fe8[_0x2239('0x33')]=_[_0x2239('0x34')](_0xac6fe8[_0x2239('0x32')],_0xac6fe8[_0x2239('0x35')]);_0xbf989f[_0x2239('0x36')]=_['intersection'](_0xac6fe8[_0x2239('0x32')],qs[_0x2239('0x37')](_0x3e164a[_0x2239('0x35')]['fields']));_0xbf989f[_0x2239('0x36')]=_0xbf989f[_0x2239('0x36')][_0x2239('0x38')]?_0xbf989f['attributes']:_0xac6fe8['model'];if(!_0x3e164a['query'][_0x2239('0x39')](_0x2239('0x3a'))){_0xbf989f[_0x2239('0x20')]=qs['limit'](_0x3e164a['query'][_0x2239('0x20')]);_0xbf989f['offset']=qs[_0x2239('0x1d')](_0x3e164a[_0x2239('0x35')][_0x2239('0x1d')]);}_0xbf989f[_0x2239('0x3b')]=qs['sort'](_0x3e164a[_0x2239('0x35')][_0x2239('0x3c')]);_0xbf989f[_0x2239('0x3d')]=qs[_0x2239('0x33')](_[_0x2239('0x3e')](_0x3e164a[_0x2239('0x35')],_0xac6fe8[_0x2239('0x33')]),_0x5a9cdf);if(_0x3e164a[_0x2239('0x35')]['filter']){_0xbf989f[_0x2239('0x3d')]=_[_0x2239('0x3f')](_0xbf989f[_0x2239('0x3d')],{'$or':_[_0x2239('0x2d')](_0x5a9cdf,function(_0x45136b){if(_0x45136b[_0x2239('0x40')]!==_0x2239('0x41')){var _0x1c55ef={};_0x1c55ef[_0x45136b[_0x2239('0x2a')]]={'$like':'%'+_0x3e164a[_0x2239('0x35')]['filter']+'%'};return _0x1c55ef;}})});}_0xbf989f=_[_0x2239('0x3f')]({},_0xbf989f,_0x3e164a[_0x2239('0x42')]);var _0x16304d={'where':_0xbf989f[_0x2239('0x3d')]};return db['VoiceChanSpy']['count'](_0x16304d)[_0x2239('0x24')](function(_0x546862){_0x26f3f2[_0x2239('0x1f')]=_0x546862;if(_0x3e164a['query'][_0x2239('0x43')]){_0xbf989f[_0x2239('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0xbf989f);})['then'](function(_0x4242c2){_0x26f3f2['rows']=_0x4242c2;return _0x26f3f2;})[_0x2239('0x24')](respondWithFilteredResult(_0x23fab8,_0xbf989f))[_0x2239('0x45')](handleError(_0x23fab8,null));};exports['show']=function(_0x2a2a6a,_0x1f9aa1){var _0x153449={'raw':![],'where':{'id':_0x2a2a6a[_0x2239('0x46')]['id']}},_0x1f6288={};_0x1f6288[_0x2239('0x32')]=_[_0x2239('0x47')](db[_0x2239('0x2e')][_0x2239('0x2f')]);_0x1f6288['query']=_[_0x2239('0x47')](_0x2a2a6a['query']);_0x1f6288[_0x2239('0x33')]=_['intersection'](_0x1f6288[_0x2239('0x32')],_0x1f6288[_0x2239('0x35')]);_0x153449['attributes']=_[_0x2239('0x34')](_0x1f6288['model'],qs[_0x2239('0x37')](_0x2a2a6a[_0x2239('0x35')][_0x2239('0x37')]));_0x153449['attributes']=_0x153449['attributes']['length']?_0x153449[_0x2239('0x36')]:_0x1f6288[_0x2239('0x32')];if(_0x2a2a6a[_0x2239('0x35')][_0x2239('0x43')]){_0x153449[_0x2239('0x44')]=[{'all':!![]}];}_0x153449=_[_0x2239('0x3f')]({},_0x153449,_0x2a2a6a['options']);return db[_0x2239('0x2e')][_0x2239('0x48')](_0x153449)[_0x2239('0x24')](handleEntityNotFound(_0x1f9aa1,null))['then'](respondWithResult(_0x1f9aa1,null))[_0x2239('0x45')](handleError(_0x1f9aa1,null));};exports['create']=function(_0x4a9c3c,_0x410bc6){return db[_0x2239('0x2e')][_0x2239('0x49')](_0x4a9c3c[_0x2239('0x4a')],{})[_0x2239('0x24')](function(_0x51bcad){var _0xba071b=_0x4a9c3c[_0x2239('0x4b')]['get']({'plain':!![]});if(!_0xba071b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xba071b['role']===_0x2239('0x4b')){var _0x51f5d3=_0x51bcad[_0x2239('0x26')]({'plain':!![]});var _0x4b674b=_0x2239('0x27');return db[_0x2239('0x4c')][_0x2239('0x48')]({'where':{'name':_0x4b674b,'userProfileId':_0xba071b[_0x2239('0x4d')]},'raw':!![]})['then'](function(_0x509651){if(_0x509651&&_0x509651[_0x2239('0x4e')]===0x0){return db[_0x2239('0x4f')][_0x2239('0x49')]({'name':_0x51f5d3[_0x2239('0x2a')],'resourceId':_0x51f5d3['id'],'type':_0x509651[_0x2239('0x2a')],'sectionId':_0x509651['id']},{})['then'](function(){return _0x51bcad;});}else{return _0x51bcad;}})[_0x2239('0x45')](function(_0x430c56){logger[_0x2239('0x28')](_0x2239('0x50'),_0x430c56);throw _0x430c56;});}return _0x51bcad;})[_0x2239('0x24')](respondWithResult(_0x410bc6,0xc9))['catch'](handleError(_0x410bc6,null));};exports[_0x2239('0x23')]=function(_0x2286f6,_0x4bf50f){if(_0x2286f6[_0x2239('0x4a')]['id']){delete _0x2286f6[_0x2239('0x4a')]['id'];}return db['VoiceChanSpy'][_0x2239('0x48')]({'where':{'id':_0x2286f6[_0x2239('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bf50f,null))[_0x2239('0x24')](saveUpdates(_0x2286f6[_0x2239('0x4a')],null))['then'](respondWithResult(_0x4bf50f,null))[_0x2239('0x45')](handleError(_0x4bf50f,null));};exports[_0x2239('0x25')]=function(_0x3ef97,_0x1ffbb6){return db[_0x2239('0x2e')][_0x2239('0x48')]({'where':{'id':_0x3ef97[_0x2239('0x46')]['id']}})[_0x2239('0x24')](handleEntityNotFound(_0x1ffbb6,null))[_0x2239('0x24')](removeEntity(_0x1ffbb6,null))[_0x2239('0x45')](handleError(_0x1ffbb6,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index f174ea6..4b7a8b5 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 _0x8007=['agent','then','catch','exports','define','voice_chanspy','VoiceExtension','bulkCreate','from-sip','format','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','concat','User','findAll'];(function(_0x4c5840,_0x6c4ad0){var _0x15f3d3=function(_0x4e392b){while(--_0x4e392b){_0x4c5840['push'](_0x4c5840['shift']());}};_0x15f3d3(++_0x6c4ad0);}(_0x8007,0xda));var _0x7800=function(_0x5a5cf2,_0x432422){_0x5a5cf2=_0x5a5cf2-0x0;var _0x1ba373=_0x8007[_0x5a5cf2];return _0x1ba373;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x385f05,_0x49986e,_0x568380){var _0xcbc321=0x1;var _0x3d6ab6=[];var _0x594d43={'context':_0x49986e['context']||_0x7800('0x0'),'exten':util[_0x7800('0x1')]('%s%s',_0x385f05[_0x7800('0x2')],_0x568380),'type':_0x7800('0x3'),'isApp':![],'ChanSpyId':_0x385f05['id'],'UserId':_0x49986e['id']};_0x3d6ab6[_0x7800('0x4')](_['merge']({'app':_0x7800('0x5'),'appdata':util['format'](_0x7800('0x6'),_0x7800('0x7')),'priority':_0xcbc321++},_0x594d43));if(_0x385f05[_0x7800('0x8')]){_0x3d6ab6['push'](_[_0x7800('0x9')]({'app':_0x7800('0xa'),'appdata':util['format'](_0x7800('0xb'),_0x385f05[_0x7800('0xc')]),'priority':_0xcbc321++},_0x594d43));}if(_0x385f05[_0x7800('0xd')]){_0x3d6ab6[_0x7800('0x4')](_[_0x7800('0x9')]({'app':_0x7800('0xe'),'appdata':_0x385f05[_0x7800('0xf')],'priority':_0xcbc321++},_0x594d43));}_0x3d6ab6[_0x7800('0x4')](_[_0x7800('0x9')]({'app':_0x7800('0x10'),'appdata':util[_0x7800('0x1')](_0x7800('0x11'),_0x49986e[_0x7800('0x12')],_0x385f05[_0x7800('0x13')]?_0x385f05[_0x7800('0x13')][_0x7800('0x14')](''):''),'priority':_0xcbc321++},_0x594d43));if(_0x385f05[_0x7800('0x8')]){_0x3d6ab6[_0x7800('0x4')](_['merge']({'app':_0x7800('0x15'),'priority':_0xcbc321++},_0x594d43));}return _0x3d6ab6;};var getChanSpyApplications=function(_0x1fb574,_0x1155e5){var _0x30c7b1=[];for(var _0x44b793=0x0,_0xb5ddfc=0x1;_0x44b793<_0x1155e5[_0x7800('0x16')];_0x44b793++,_0xb5ddfc=0x1){_0x30c7b1=_0x30c7b1['concat'](getUserApplications(_0x1fb574,_0x1155e5[_0x44b793],_0x1155e5[_0x44b793][_0x7800('0x17')]));if(_0x1155e5[_0x44b793][_0x7800('0x17')]!=_0x1155e5[_0x44b793][_0x7800('0x12')]){_0x30c7b1=_0x30c7b1[_0x7800('0x18')](getUserApplications(_0x1fb574,_0x1155e5[_0x44b793],_0x1155e5[_0x44b793][_0x7800('0x12')]));}}return _0x30c7b1;};var getChanSpyPromise=function(_0x2d9dfe,_0x187564){return new BPromise(function(_0x1c593a,_0x213a95){return _0x2d9dfe[_0x7800('0x19')][_0x7800('0x1a')]({'attributes':['id',_0x7800('0x12'),_0x7800('0x17')],'where':{'role':_0x7800('0x1b'),'chanspy':!![]},'raw':!![]})[_0x7800('0x1c')](function(_0x41cdf9){if(_0x41cdf9){return _0x1c593a(getChanSpyApplications(_0x187564,_0x41cdf9));}return _0x1c593a([]);})[_0x7800('0x1d')](function(_0x35dcc1){_0x213a95(_0x35dcc1);});});};module[_0x7800('0x1e')]=function(_0x8ede0b,_0x5d466c){var _0x1a4ec6=_0x8ede0b['models'];return _0x8ede0b[_0x7800('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0x7800('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x419d16,_0x17fa2e,_0x211885){return getChanSpyPromise(_0x1a4ec6,_0x419d16)[_0x7800('0x1c')](function(_0x3941d8){if(_0x3941d8&&_0x3941d8['length']){return _0x1a4ec6[_0x7800('0x21')][_0x7800('0x22')](_0x3941d8);}})[_0x7800('0x1c')](function(){_0x211885();})[_0x7800('0x1d')](function(_0x473124){_0x211885(_0x473124);});},'afterUpdate':function(_0x42be08,_0x2e1ea4,_0x2fecb5){return _0x1a4ec6['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x42be08['id']}})[_0x7800('0x1c')](function(){return getChanSpyPromise(_0x1a4ec6,_0x42be08);})[_0x7800('0x1c')](function(_0xa6e0c0){if(_0xa6e0c0&&_0xa6e0c0[_0x7800('0x16')]){return _0x1a4ec6[_0x7800('0x21')][_0x7800('0x22')](_0xa6e0c0);}})['then'](function(){_0x2fecb5();})[_0x7800('0x1d')](function(_0x2a8510){_0x2fecb5(_0x2a8510);});},'afterDestroy':function(_0x5b033e,_0x4b9d0f,_0x1257f8){return _0x1a4ec6[_0x7800('0x21')]['destroy']({'where':{'ChanSpyId':_0x5b033e['id']}})['then'](function(){_0x1257f8();})[_0x7800('0x1d')](function(_0x5c3e48){_0x1257f8(_0x5c3e48);});}}});}; \ No newline at end of file +var _0x9095=['bulkCreate','destroy','lodash','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','Set','CDR(type)=%s','chanspy','record','push','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension'];(function(_0x434a01,_0x25989d){var _0x43d9f8=function(_0x3ec6c1){while(--_0x3ec6c1){_0x434a01['push'](_0x434a01['shift']());}};_0x43d9f8(++_0x25989d);}(_0x9095,0x1f0));var _0x5909=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9095[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0x5909('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x5909('0x1'));var getUserApplications=function(_0x43200c,_0x10aba7,_0x535a99){var _0xdd7f42=0x1;var _0x808860=[];var _0xcaed28={'context':_0x10aba7[_0x5909('0x2')]||_0x5909('0x3'),'exten':util[_0x5909('0x4')]('%s%s',_0x43200c[_0x5909('0x5')],_0x535a99),'type':_0x5909('0x6'),'isApp':![],'ChanSpyId':_0x43200c['id'],'UserId':_0x10aba7['id']};_0x808860['push'](_['merge']({'app':_0x5909('0x7'),'appdata':util[_0x5909('0x4')](_0x5909('0x8'),_0x5909('0x9')),'priority':_0xdd7f42++},_0xcaed28));if(_0x43200c[_0x5909('0xa')]){_0x808860[_0x5909('0xb')](_[_0x5909('0xc')]({'app':_0x5909('0xd'),'appdata':util[_0x5909('0x4')](_0x5909('0xe'),_0x43200c[_0x5909('0xf')]),'priority':_0xdd7f42++},_0xcaed28));}if(_0x43200c[_0x5909('0x10')]){_0x808860['push'](_[_0x5909('0xc')]({'app':'Authenticate','appdata':_0x43200c[_0x5909('0x11')],'priority':_0xdd7f42++},_0xcaed28));}_0x808860[_0x5909('0xb')](_['merge']({'app':'ChanSpy','appdata':util[_0x5909('0x4')]('SIP/%s,%s',_0x10aba7[_0x5909('0x12')],_0x43200c[_0x5909('0x13')]?_0x43200c['options'][_0x5909('0x14')](''):''),'priority':_0xdd7f42++},_0xcaed28));if(_0x43200c[_0x5909('0xa')]){_0x808860[_0x5909('0xb')](_[_0x5909('0xc')]({'app':_0x5909('0x15'),'priority':_0xdd7f42++},_0xcaed28));}return _0x808860;};var getChanSpyApplications=function(_0x27551b,_0x4b5d87){var _0x3dfa3c=[];for(var _0x2ca8e6=0x0,_0x4a8090=0x1;_0x2ca8e6<_0x4b5d87[_0x5909('0x16')];_0x2ca8e6++,_0x4a8090=0x1){_0x3dfa3c=_0x3dfa3c[_0x5909('0x17')](getUserApplications(_0x27551b,_0x4b5d87[_0x2ca8e6],_0x4b5d87[_0x2ca8e6][_0x5909('0x18')]));if(_0x4b5d87[_0x2ca8e6][_0x5909('0x18')]!=_0x4b5d87[_0x2ca8e6][_0x5909('0x12')]){_0x3dfa3c=_0x3dfa3c['concat'](getUserApplications(_0x27551b,_0x4b5d87[_0x2ca8e6],_0x4b5d87[_0x2ca8e6][_0x5909('0x12')]));}}return _0x3dfa3c;};var getChanSpyPromise=function(_0x1ed912,_0x58689b){return new BPromise(function(_0x5ddaf4,_0x3cfba4){return _0x1ed912[_0x5909('0x19')][_0x5909('0x1a')]({'attributes':['id','name','internal'],'where':{'role':_0x5909('0x1b'),'chanspy':!![]},'raw':!![]})[_0x5909('0x1c')](function(_0x3b7dcf){if(_0x3b7dcf){return _0x5ddaf4(getChanSpyApplications(_0x58689b,_0x3b7dcf));}return _0x5ddaf4([]);})[_0x5909('0x1d')](function(_0x268b24){_0x3cfba4(_0x268b24);});});};module[_0x5909('0x1e')]=function(_0x4be2fe,_0x2076a3){var _0x4f786b=_0x4be2fe[_0x5909('0x1f')];return _0x4be2fe[_0x5909('0x20')](_0x5909('0x21'),attributes,{'tableName':_0x5909('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x404456,_0x4fdf01,_0x4f8c97){return getChanSpyPromise(_0x4f786b,_0x404456)[_0x5909('0x1c')](function(_0x5dac1d){if(_0x5dac1d&&_0x5dac1d['length']){return _0x4f786b[_0x5909('0x23')][_0x5909('0x24')](_0x5dac1d);}})[_0x5909('0x1c')](function(){_0x4f8c97();})['catch'](function(_0x55dd84){_0x4f8c97(_0x55dd84);});},'afterUpdate':function(_0x3f7052,_0x1c57a5,_0x22ea71){return _0x4f786b[_0x5909('0x23')][_0x5909('0x25')]({'where':{'ChanSpyId':_0x3f7052['id']}})[_0x5909('0x1c')](function(){return getChanSpyPromise(_0x4f786b,_0x3f7052);})[_0x5909('0x1c')](function(_0x5675f7){if(_0x5675f7&&_0x5675f7[_0x5909('0x16')]){return _0x4f786b[_0x5909('0x23')]['bulkCreate'](_0x5675f7);}})['then'](function(){_0x22ea71();})[_0x5909('0x1d')](function(_0x4320eb){_0x22ea71(_0x4320eb);});},'afterDestroy':function(_0x3be939,_0x399404,_0x1e3e3d){return _0x4f786b[_0x5909('0x23')][_0x5909('0x25')]({'where':{'ChanSpyId':_0x3be939['id']}})[_0x5909('0x1c')](function(){_0x1e3e3d();})[_0x5909('0x1d')](function(_0x34ba76){_0x1e3e3d(_0x34ba76);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 285b114..3de7770 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 _0x5ec6=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x22f064,_0x27faf4){var _0x42f03e=function(_0x21183f){while(--_0x21183f){_0x22f064['push'](_0x22f064['shift']());}};_0x42f03e(++_0x27faf4);}(_0x5ec6,0x7f));var _0x65ec=function(_0x509d4f,_0x4f2583){_0x509d4f=_0x509d4f-0x0;var _0x1ecbe5=_0x5ec6[_0x509d4f];return _0x1ecbe5;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});} \ No newline at end of file +var _0x2f68=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x4e639c,_0x1f97e0){var _0x5e9f4d=function(_0x3e93b3){while(--_0x3e93b3){_0x4e639c['push'](_0x4e639c['shift']());}};_0x5e9f4d(++_0x1f97e0);}(_0x2f68,0x9a));var _0x82f6=function(_0x1c85d2,_0x19177b){_0x1c85d2=_0x1c85d2-0x0;var _0x4a3b90=_0x2f68[_0x1c85d2];return _0x4a3b90;};'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);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index c4471ab..0ed5d85 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 _0x43e4=['/:id','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x512e3a,_0xfd8129){var _0xa4cd18=function(_0x424bb5){while(--_0x424bb5){_0x512e3a['push'](_0x512e3a['shift']());}};_0xa4cd18(++_0xfd8129);}(_0x43e4,0xcc));var _0x443e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x43e4[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x443e('0x0'));var util=require(_0x443e('0x1'));var path=require(_0x443e('0x2'));var timeout=require(_0x443e('0x3'));var express=require(_0x443e('0x4'));var router=express['Router']();var fs_extra=require(_0x443e('0x5'));var auth=require(_0x443e('0x6'));var interaction=require(_0x443e('0x7'));var config=require(_0x443e('0x8'));var controller=require(_0x443e('0x9'));router[_0x443e('0xa')]('/',auth[_0x443e('0xb')](),controller['index']);router[_0x443e('0xa')](_0x443e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x443e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x443e('0xe')](_0x443e('0xc'),auth['isAuthenticated'](),controller[_0x443e('0xf')]);router[_0x443e('0x10')]('/:id',auth[_0x443e('0xb')](),controller[_0x443e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9344=['update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','/:id','show','post','create','put'];(function(_0x78f35e,_0x14f71f){var _0x445627=function(_0x3db789){while(--_0x3db789){_0x78f35e['push'](_0x78f35e['shift']());}};_0x445627(++_0x14f71f);}(_0x9344,0xc8));var _0x4934=function(_0x3160b1,_0x1af397){_0x3160b1=_0x3160b1-0x0;var _0x5242c9=_0x9344[_0x3160b1];return _0x5242c9;};'use strict';var multer=require('multer');var util=require(_0x4934('0x0'));var path=require(_0x4934('0x1'));var timeout=require(_0x4934('0x2'));var express=require(_0x4934('0x3'));var router=express[_0x4934('0x4')]();var fs_extra=require(_0x4934('0x5'));var auth=require(_0x4934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4934('0x7'));var controller=require(_0x4934('0x8'));router['get']('/',auth[_0x4934('0x9')](),controller['index']);router[_0x4934('0xa')](_0x4934('0xb'),auth['isAuthenticated'](),controller[_0x4934('0xc')]);router[_0x4934('0xd')]('/',auth['isAuthenticated'](),controller[_0x4934('0xe')]);router[_0x4934('0xf')](_0x4934('0xb'),auth[_0x4934('0x9')](),controller[_0x4934('0x10')]);router[_0x4934('0x11')]('/:id',auth[_0x4934('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index cd43e7d..4354a48 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 _0x7879=['sequelize','exports','STRING','name'];(function(_0x5540f3,_0x2c662f){var _0x26cd8d=function(_0xaff418){while(--_0xaff418){_0x5540f3['push'](_0x5540f3['shift']());}};_0x26cd8d(++_0x2c662f);}(_0x7879,0x1f4));var _0x9787=function(_0x549bde,_0x1ab69f){_0x549bde=_0x549bde-0x0;var _0x286e02=_0x7879[_0x549bde];return _0x286e02;};'use strict';var Sequelize=require(_0x9787('0x0'));module[_0x9787('0x1')]={'name':{'type':Sequelize[_0x9787('0x2')],'unique':_0x9787('0x3')},'description':{'type':Sequelize[_0x9787('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x77b7=['sequelize','STRING','name'];(function(_0x1f5a63,_0x511504){var _0x30bb7a=function(_0x476310){while(--_0x476310){_0x1f5a63['push'](_0x1f5a63['shift']());}};_0x30bb7a(++_0x511504);}(_0x77b7,0x72));var _0x777b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x77b7[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x777b('0x0'));module['exports']={'name':{'type':Sequelize[_0x777b('0x1')],'unique':_0x777b('0x2')},'description':{'type':Sequelize[_0x777b('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 9878539..92273d1 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 _0x2e84=['index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','include','VoiceContext','findAll','rows','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','get','UserProfileResource','destroy','end','stack','name','send'];(function(_0x3259ee,_0x258672){var _0x47c1a=function(_0x293491){while(--_0x293491){_0x3259ee['push'](_0x3259ee['shift']());}};_0x47c1a(++_0x258672);}(_0x2e84,0x96));var _0x42e8=function(_0x3eab3e,_0x1fcc9e){_0x3eab3e=_0x3eab3e-0x0;var _0x1e1269=_0x2e84[_0x3eab3e];return _0x1e1269;};'use strict';var emlformat=require(_0x42e8('0x0'));var rimraf=require(_0x42e8('0x1'));var zipdir=require(_0x42e8('0x2'));var jsonpatch=require(_0x42e8('0x3'));var rp=require(_0x42e8('0x4'));var moment=require(_0x42e8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x42e8('0x6'));var path=require(_0x42e8('0x7'));var sox=require(_0x42e8('0x8'));var csv=require(_0x42e8('0x9'));var ejs=require(_0x42e8('0xa'));var fs=require('fs');var fs_extra=require(_0x42e8('0xb'));var _=require(_0x42e8('0xc'));var squel=require(_0x42e8('0xd'));var crypto=require('crypto');var jsforce=require(_0x42e8('0xe'));var deskjs=require(_0x42e8('0xf'));var toCsv=require(_0x42e8('0x9'));var querystring=require(_0x42e8('0x10'));var Papa=require(_0x42e8('0x11'));var Redis=require(_0x42e8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x42e8('0x13'));var as=require(_0x42e8('0x14'));var hardwareService=require(_0x42e8('0x15'));var logger=require(_0x42e8('0x16'))('api');var utils=require(_0x42e8('0x17'));var config=require(_0x42e8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e8('0x19'))['db'];var jayson=require(_0x42e8('0x1a'));var client=jayson[_0x42e8('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51175d,_0x477d0b,_0x2bc20f,_0x5ed075){return new BPromise(function(_0x51be1e,_0x3575ea){var _0x549b67=_0x5ed075||client;return _0x549b67[_0x42e8('0x1c')](_0x51175d,_0x2bc20f)[_0x42e8('0x1d')](function(_0x1817ea){logger[_0x42e8('0x1e')](_0x42e8('0x1f'),_0x477d0b,_0x42e8('0x20'));logger[_0x42e8('0x21')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x477d0b,'request\x20sent',JSON[_0x42e8('0x22')](_0x1817ea));if(_0x1817ea[_0x42e8('0x23')]){if(_0x1817ea[_0x42e8('0x23')][_0x42e8('0x24')]===0x1f4){logger[_0x42e8('0x23')](_0x42e8('0x1f'),_0x477d0b,_0x1817ea['error'][_0x42e8('0x25')]);return _0x3575ea(_0x1817ea['error'][_0x42e8('0x25')]);}logger[_0x42e8('0x23')]('VoiceContext,\x20%s,\x20%s',_0x477d0b,_0x1817ea['error']['message']);return _0x51be1e(_0x1817ea['error'][_0x42e8('0x25')]);}else{logger[_0x42e8('0x1e')](_0x42e8('0x1f'),_0x477d0b,_0x42e8('0x20'));_0x51be1e(_0x1817ea['result'][_0x42e8('0x25')]);}})[_0x42e8('0x26')](function(_0x1fd788){logger[_0x42e8('0x23')]('VoiceContext,\x20%s,\x20%s',_0x477d0b,_0x1fd788);_0x3575ea(_0x1fd788);});});}function respondWithStatusCode(_0x2186be,_0x277573){_0x277573=_0x277573||0xcc;return function(_0x1c78a9){if(_0x1c78a9){return _0x2186be[_0x42e8('0x27')](_0x277573);}return _0x2186be[_0x42e8('0x28')](_0x277573)['end']();};}function respondWithResult(_0x4eb5b5,_0x9c567b){_0x9c567b=_0x9c567b||0xc8;return function(_0xf39d65){if(_0xf39d65){return _0x4eb5b5[_0x42e8('0x28')](_0x9c567b)['json'](_0xf39d65);}};}function respondWithFilteredResult(_0x13d572,_0x47037b){return function(_0x19acd8){if(_0x19acd8){var _0x395dc4=typeof _0x47037b[_0x42e8('0x29')]===_0x42e8('0x2a')&&typeof _0x47037b['limit']==='undefined';var _0x16ed5e=_0x19acd8[_0x42e8('0x2b')];var _0x5ef019=_0x395dc4?0x0:_0x47037b[_0x42e8('0x29')];var _0x4dcd9a=_0x395dc4?_0x19acd8['count']:_0x47037b[_0x42e8('0x29')]+_0x47037b[_0x42e8('0x2c')];var _0x12e804;if(_0x4dcd9a>=_0x16ed5e){_0x4dcd9a=_0x16ed5e;_0x12e804=0xc8;}else{_0x12e804=0xce;}_0x13d572['status'](_0x12e804);return _0x13d572[_0x42e8('0x2d')](_0x42e8('0x2e'),_0x5ef019+'-'+_0x4dcd9a+'/'+_0x16ed5e)[_0x42e8('0x2f')](_0x19acd8);}return null;};}function patchUpdates(_0x460705){return function(_0x41367a){try{jsonpatch[_0x42e8('0x30')](_0x41367a,_0x460705,!![]);}catch(_0x473f3f){return BPromise[_0x42e8('0x31')](_0x473f3f);}return _0x41367a[_0x42e8('0x32')]();};}function saveUpdates(_0xa78632,_0x54f03c){return function(_0x43c582){if(_0x43c582){return _0x43c582['update'](_0xa78632)[_0x42e8('0x1d')](function(_0x1dcdb0){return _0x1dcdb0;});}return null;};}function removeEntity(_0x297bac,_0x5005ba){return function(_0x56b7c9){if(_0x56b7c9){return _0x56b7c9['destroy']()[_0x42e8('0x1d')](function(){var _0x440e79=_0x56b7c9[_0x42e8('0x33')]({'plain':!![]});var _0x5cb67f='Contexts';return db[_0x42e8('0x34')][_0x42e8('0x35')]({'where':{'type':_0x5cb67f,'resourceId':_0x440e79['id']}})[_0x42e8('0x1d')](function(){return _0x56b7c9;});})[_0x42e8('0x1d')](function(){_0x297bac[_0x42e8('0x28')](0xcc)[_0x42e8('0x36')]();});}};}function handleEntityNotFound(_0x57438c,_0xf06397){return function(_0x36b90a){if(!_0x36b90a){_0x57438c['sendStatus'](0x194);}return _0x36b90a;};}function handleError(_0x27e9c4,_0x2a785d){_0x2a785d=_0x2a785d||0x1f4;return function(_0x2088dc){logger[_0x42e8('0x23')](_0x2088dc[_0x42e8('0x37')]);if(_0x2088dc['name']){delete _0x2088dc[_0x42e8('0x38')];}_0x27e9c4[_0x42e8('0x28')](_0x2a785d)[_0x42e8('0x39')](_0x2088dc);};}exports[_0x42e8('0x3a')]=function(_0x4868c1,_0x3cfce2){var _0x2a0d9b={},_0xf893d={},_0x122fed={'count':0x0,'rows':[]};var _0x554d29=_['map'](db['VoiceContext'][_0x42e8('0x3b')],function(_0x5a3b94){return{'name':_0x5a3b94[_0x42e8('0x3c')],'type':_0x5a3b94[_0x42e8('0x3d')][_0x42e8('0x3e')]};});_0xf893d[_0x42e8('0x3f')]=_[_0x42e8('0x40')](_0x554d29,'name');_0xf893d['query']=_[_0x42e8('0x41')](_0x4868c1[_0x42e8('0x42')]);_0xf893d[_0x42e8('0x43')]=_[_0x42e8('0x44')](_0xf893d[_0x42e8('0x3f')],_0xf893d[_0x42e8('0x42')]);_0x2a0d9b[_0x42e8('0x45')]=_[_0x42e8('0x44')](_0xf893d[_0x42e8('0x3f')],qs['fields'](_0x4868c1[_0x42e8('0x42')][_0x42e8('0x46')]));_0x2a0d9b[_0x42e8('0x45')]=_0x2a0d9b['attributes'][_0x42e8('0x47')]?_0x2a0d9b[_0x42e8('0x45')]:_0xf893d[_0x42e8('0x3f')];if(!_0x4868c1['query'][_0x42e8('0x48')](_0x42e8('0x49'))){_0x2a0d9b[_0x42e8('0x2c')]=qs[_0x42e8('0x2c')](_0x4868c1['query'][_0x42e8('0x2c')]);_0x2a0d9b['offset']=qs[_0x42e8('0x29')](_0x4868c1[_0x42e8('0x42')][_0x42e8('0x29')]);}_0x2a0d9b[_0x42e8('0x4a')]=qs[_0x42e8('0x4b')](_0x4868c1[_0x42e8('0x42')][_0x42e8('0x4b')]);_0x2a0d9b[_0x42e8('0x4c')]=qs[_0x42e8('0x43')](_[_0x42e8('0x4d')](_0x4868c1[_0x42e8('0x42')],_0xf893d['filters']),_0x554d29);if(_0x4868c1[_0x42e8('0x42')]['filter']){_0x2a0d9b[_0x42e8('0x4c')]=_['merge'](_0x2a0d9b[_0x42e8('0x4c')],{'$or':_['map'](_0x554d29,function(_0x2f5bd2){if(_0x2f5bd2[_0x42e8('0x3d')]!==_0x42e8('0x4e')){var _0x15758a={};_0x15758a[_0x2f5bd2[_0x42e8('0x38')]]={'$like':'%'+_0x4868c1['query']['filter']+'%'};return _0x15758a;}})});}_0x2a0d9b=_[_0x42e8('0x4f')]({},_0x2a0d9b,_0x4868c1[_0x42e8('0x50')]);var _0x3757ab={'where':_0x2a0d9b[_0x42e8('0x4c')]};return db['VoiceContext']['count'](_0x3757ab)[_0x42e8('0x1d')](function(_0xd18df0){_0x122fed[_0x42e8('0x2b')]=_0xd18df0;if(_0x4868c1['query']['includeAll']){_0x2a0d9b[_0x42e8('0x51')]=[{'all':!![]}];}return db[_0x42e8('0x52')][_0x42e8('0x53')](_0x2a0d9b);})['then'](function(_0x3c544b){_0x122fed[_0x42e8('0x54')]=_0x3c544b;return _0x122fed;})[_0x42e8('0x1d')](respondWithFilteredResult(_0x3cfce2,_0x2a0d9b))[_0x42e8('0x26')](handleError(_0x3cfce2,null));};exports['show']=function(_0x3bc6ce,_0xe02cc8){var _0x508ff3={'raw':![],'where':{'id':_0x3bc6ce['params']['id']}},_0xe0cee7={};_0xe0cee7[_0x42e8('0x3f')]=_[_0x42e8('0x41')](db[_0x42e8('0x52')]['rawAttributes']);_0xe0cee7['query']=_[_0x42e8('0x41')](_0x3bc6ce[_0x42e8('0x42')]);_0xe0cee7[_0x42e8('0x43')]=_[_0x42e8('0x44')](_0xe0cee7[_0x42e8('0x3f')],_0xe0cee7[_0x42e8('0x42')]);_0x508ff3[_0x42e8('0x45')]=_['intersection'](_0xe0cee7['model'],qs[_0x42e8('0x46')](_0x3bc6ce[_0x42e8('0x42')]['fields']));_0x508ff3[_0x42e8('0x45')]=_0x508ff3[_0x42e8('0x45')][_0x42e8('0x47')]?_0x508ff3[_0x42e8('0x45')]:_0xe0cee7[_0x42e8('0x3f')];if(_0x3bc6ce['query']['includeAll']){_0x508ff3[_0x42e8('0x51')]=[{'all':!![]}];}_0x508ff3=_[_0x42e8('0x4f')]({},_0x508ff3,_0x3bc6ce[_0x42e8('0x50')]);return db[_0x42e8('0x52')][_0x42e8('0x55')](_0x508ff3)[_0x42e8('0x1d')](handleEntityNotFound(_0xe02cc8,null))['then'](respondWithResult(_0xe02cc8,null))['catch'](handleError(_0xe02cc8,null));};exports[_0x42e8('0x56')]=function(_0x1d233e,_0x4d8b76,_0x1101cc){var _0x44f995;return db[_0x42e8('0x52')][_0x42e8('0x56')](_0x1d233e[_0x42e8('0x57')],{'raw':!![]})['then'](function(_0x589fb1){_0x44f995=_0x589fb1;return db[_0x42e8('0x52')][_0x42e8('0x53')]({'raw':!![]});})[_0x42e8('0x1d')](function(_0x4f21fb){var _0x19b6e3=fs[_0x42e8('0x58')](path[_0x42e8('0x59')](config[_0x42e8('0x5a')],_0x42e8('0x5b')),_0x42e8('0x5c'));var _0x4904a4=ejs[_0x42e8('0x5d')](_0x19b6e3,{'contexts':_0x4f21fb||[]});fs[_0x42e8('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4904a4);})[_0x42e8('0x1d')](function(){return respondWithRpcPromise(_0x42e8('0x5f'),_0x42e8('0x56'),{'module':_0x42e8('0x60')});})['then'](function(){var _0x4e5a9e=_0x1d233e[_0x42e8('0x61')]['get']({'plain':!![]});if(!_0x4e5a9e)throw new Error(_0x42e8('0x62'));if(_0x4e5a9e[_0x42e8('0x63')]==='user'){var _0x2fc817=_0x44f995[_0x42e8('0x33')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Contexts','userProfileId':_0x4e5a9e['userProfileId']},'raw':!![]})[_0x42e8('0x1d')](function(_0x158208){if(_0x158208&&_0x158208[_0x42e8('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x2fc817[_0x42e8('0x38')],'resourceId':_0x2fc817['id'],'type':_0x158208[_0x42e8('0x38')],'sectionId':_0x158208['id']},{})[_0x42e8('0x1d')](function(){return _0x44f995;});}else{return _0x44f995;}})[_0x42e8('0x26')](function(_0xcc1191){logger[_0x42e8('0x23')](_0x42e8('0x65'),_0xcc1191);throw _0xcc1191;});}return _0x44f995;})['then'](respondWithResult(_0x4d8b76,0xc9))['catch'](handleError(_0x4d8b76,null));};exports[_0x42e8('0x66')]=function(_0x45d3a6,_0xedf150,_0x35b29e){var _0x1688e1;return db['VoiceContext'][_0x42e8('0x55')]({'where':{'id':_0x45d3a6['params']['id']}})[_0x42e8('0x1d')](handleEntityNotFound(_0xedf150,null))[_0x42e8('0x1d')](saveUpdates(_0x45d3a6['body'],null))['then'](function(_0x55ae2b){if(_0x55ae2b){_0x1688e1=_0x55ae2b;return db['VoiceContext'][_0x42e8('0x53')]({'raw':!![]});}})[_0x42e8('0x1d')](function(_0x1d4ac9){var _0x3a8040=fs[_0x42e8('0x58')](path[_0x42e8('0x59')](config[_0x42e8('0x5a')],_0x42e8('0x5b')),_0x42e8('0x5c'));var _0x5f589e=ejs[_0x42e8('0x5d')](_0x3a8040,{'contexts':_0x1d4ac9||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x5f589e);})[_0x42e8('0x1d')](function(){return respondWithRpcPromise('Reload',_0x42e8('0x66'),{'module':_0x42e8('0x60')});})[_0x42e8('0x1d')](function(){return _0x1688e1;})[_0x42e8('0x1d')](respondWithResult(_0xedf150,null))[_0x42e8('0x26')](handleError(_0xedf150,null));};exports['destroy']=function(_0x2fbb41,_0x555030,_0x793cd7){var _0x1e43d4;return db[_0x42e8('0x52')][_0x42e8('0x55')]({'where':{'id':_0x2fbb41['params']['id']}})['then'](handleEntityNotFound(_0x555030,null))['then'](removeEntity(_0x555030,null))[_0x42e8('0x1d')](function(){return db[_0x42e8('0x52')]['findAll']({'raw':!![]});})[_0x42e8('0x1d')](function(_0x2e86ab){var _0x29c36c=fs[_0x42e8('0x58')](path[_0x42e8('0x59')](config[_0x42e8('0x5a')],'server/files/templates/context.ejs'),'utf8');var _0xcf6ffa=ejs[_0x42e8('0x5d')](_0x29c36c,{'contexts':_0x2e86ab});fs[_0x42e8('0x5e')](_0x42e8('0x67'),_0xcf6ffa);return respondWithRpcPromise('Reload',_0x42e8('0x35'),{'module':_0x42e8('0x60')});})[_0x42e8('0x26')](handleError(_0x555030,null));}; \ No newline at end of file +var _0xf350=['key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','map','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','merge','find','create','findAll','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','role','user','UserProfileSection','userProfileId','update','body','server/files/templates/context.ejs','readFileSync','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','destroy','then','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf350,0x94));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0f35('0x0'));var rimraf=require(_0x0f35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0f35('0x2'));var moment=require(_0x0f35('0x3'));var BPromise=require(_0x0f35('0x4'));var Mustache=require('mustache');var util=require(_0x0f35('0x5'));var path=require(_0x0f35('0x6'));var sox=require('sox');var csv=require(_0x0f35('0x7'));var ejs=require(_0x0f35('0x8'));var fs=require('fs');var fs_extra=require(_0x0f35('0x9'));var _=require(_0x0f35('0xa'));var squel=require(_0x0f35('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0f35('0xc'));var toCsv=require(_0x0f35('0x7'));var querystring=require('querystring');var Papa=require(_0x0f35('0xd'));var Redis=require('ioredis');var authService=require(_0x0f35('0xe'));var qs=require(_0x0f35('0xf'));var as=require(_0x0f35('0x10'));var hardwareService=require(_0x0f35('0x11'));var logger=require(_0x0f35('0x12'))(_0x0f35('0x13'));var utils=require(_0x0f35('0x14'));var config=require(_0x0f35('0x15'));var licenseUtil=require(_0x0f35('0x16'));var db=require(_0x0f35('0x17'))['db'];var jayson=require(_0x0f35('0x18'));var client=jayson[_0x0f35('0x19')][_0x0f35('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x599c9c,_0x46c176,_0x3007e8,_0x276aed){return new BPromise(function(_0x1594d6,_0x3c8218){var _0x25f262=_0x276aed||client;return _0x25f262['request'](_0x599c9c,_0x3007e8)['then'](function(_0x21d90f){logger[_0x0f35('0x1b')](_0x0f35('0x1c'),_0x46c176,'request\x20sent');logger['debug'](_0x0f35('0x1d'),_0x46c176,_0x0f35('0x1e'),JSON[_0x0f35('0x1f')](_0x21d90f));if(_0x21d90f[_0x0f35('0x20')]){if(_0x21d90f[_0x0f35('0x20')][_0x0f35('0x21')]===0x1f4){logger['error'](_0x0f35('0x1c'),_0x46c176,_0x21d90f[_0x0f35('0x20')]['message']);return _0x3c8218(_0x21d90f[_0x0f35('0x20')][_0x0f35('0x22')]);}logger[_0x0f35('0x20')](_0x0f35('0x1c'),_0x46c176,_0x21d90f[_0x0f35('0x20')][_0x0f35('0x22')]);return _0x1594d6(_0x21d90f[_0x0f35('0x20')][_0x0f35('0x22')]);}else{logger[_0x0f35('0x1b')](_0x0f35('0x1c'),_0x46c176,_0x0f35('0x1e'));_0x1594d6(_0x21d90f[_0x0f35('0x23')][_0x0f35('0x22')]);}})[_0x0f35('0x24')](function(_0x228cb6){logger[_0x0f35('0x20')](_0x0f35('0x1c'),_0x46c176,_0x228cb6);_0x3c8218(_0x228cb6);});});}function respondWithStatusCode(_0x520cbd,_0x335407){_0x335407=_0x335407||0xcc;return function(_0x41f3a9){if(_0x41f3a9){return _0x520cbd[_0x0f35('0x25')](_0x335407);}return _0x520cbd[_0x0f35('0x26')](_0x335407)[_0x0f35('0x27')]();};}function respondWithResult(_0x1a6c73,_0x58c0fe){_0x58c0fe=_0x58c0fe||0xc8;return function(_0x5c5fcb){if(_0x5c5fcb){return _0x1a6c73[_0x0f35('0x26')](_0x58c0fe)[_0x0f35('0x28')](_0x5c5fcb);}};}function respondWithFilteredResult(_0x32bc19,_0x45eda9){return function(_0x333e0b){if(_0x333e0b){var _0x4736f7=typeof _0x45eda9[_0x0f35('0x29')]===_0x0f35('0x2a')&&typeof _0x45eda9['limit']===_0x0f35('0x2a');var _0x1bbe2d=_0x333e0b['count'];var _0x580f5b=_0x4736f7?0x0:_0x45eda9['offset'];var _0x54ebd6=_0x4736f7?_0x333e0b[_0x0f35('0x2b')]:_0x45eda9[_0x0f35('0x29')]+_0x45eda9['limit'];var _0x4aef9b;if(_0x54ebd6>=_0x1bbe2d){_0x54ebd6=_0x1bbe2d;_0x4aef9b=0xc8;}else{_0x4aef9b=0xce;}_0x32bc19['status'](_0x4aef9b);return _0x32bc19[_0x0f35('0x2c')](_0x0f35('0x2d'),_0x580f5b+'-'+_0x54ebd6+'/'+_0x1bbe2d)[_0x0f35('0x28')](_0x333e0b);}return null;};}function patchUpdates(_0x5f1f15){return function(_0x231285){try{jsonpatch['apply'](_0x231285,_0x5f1f15,!![]);}catch(_0x3d9c94){return BPromise[_0x0f35('0x2e')](_0x3d9c94);}return _0x231285['save']();};}function saveUpdates(_0x12a8f0,_0x1c436d){return function(_0x5790f7){if(_0x5790f7){return _0x5790f7['update'](_0x12a8f0)['then'](function(_0x5d16ba){return _0x5d16ba;});}return null;};}function removeEntity(_0x49751c,_0x382dd0){return function(_0x5c9cf5){if(_0x5c9cf5){return _0x5c9cf5[_0x0f35('0x2f')]()[_0x0f35('0x30')](function(){var _0x4ccdb9=_0x5c9cf5['get']({'plain':!![]});var _0x5a2b90=_0x0f35('0x31');return db[_0x0f35('0x32')][_0x0f35('0x2f')]({'where':{'type':_0x5a2b90,'resourceId':_0x4ccdb9['id']}})[_0x0f35('0x30')](function(){return _0x5c9cf5;});})[_0x0f35('0x30')](function(){_0x49751c[_0x0f35('0x26')](0xcc)[_0x0f35('0x27')]();});}};}function handleEntityNotFound(_0xf31ae0,_0xb1524f){return function(_0x2f89c4){if(!_0x2f89c4){_0xf31ae0['sendStatus'](0x194);}return _0x2f89c4;};}function handleError(_0x2ffbba,_0x8a12ca){_0x8a12ca=_0x8a12ca||0x1f4;return function(_0x4140f9){logger[_0x0f35('0x20')](_0x4140f9[_0x0f35('0x33')]);if(_0x4140f9['name']){delete _0x4140f9[_0x0f35('0x34')];}_0x2ffbba[_0x0f35('0x26')](_0x8a12ca)[_0x0f35('0x35')](_0x4140f9);};}exports[_0x0f35('0x36')]=function(_0x3fec59,_0x251879){var _0x46f489={},_0x4f7adc={},_0x41c7fe={'count':0x0,'rows':[]};var _0x57d0e2=_['map'](db[_0x0f35('0x37')]['rawAttributes'],function(_0x3f956f){return{'name':_0x3f956f[_0x0f35('0x38')],'type':_0x3f956f[_0x0f35('0x39')][_0x0f35('0x3a')]};});_0x4f7adc[_0x0f35('0x3b')]=_['map'](_0x57d0e2,_0x0f35('0x34'));_0x4f7adc[_0x0f35('0x3c')]=_[_0x0f35('0x3d')](_0x3fec59['query']);_0x4f7adc[_0x0f35('0x3e')]=_[_0x0f35('0x3f')](_0x4f7adc[_0x0f35('0x3b')],_0x4f7adc[_0x0f35('0x3c')]);_0x46f489['attributes']=_[_0x0f35('0x3f')](_0x4f7adc[_0x0f35('0x3b')],qs[_0x0f35('0x40')](_0x3fec59[_0x0f35('0x3c')][_0x0f35('0x40')]));_0x46f489[_0x0f35('0x41')]=_0x46f489['attributes'][_0x0f35('0x42')]?_0x46f489[_0x0f35('0x41')]:_0x4f7adc[_0x0f35('0x3b')];if(!_0x3fec59[_0x0f35('0x3c')][_0x0f35('0x43')](_0x0f35('0x44'))){_0x46f489[_0x0f35('0x45')]=qs[_0x0f35('0x45')](_0x3fec59[_0x0f35('0x3c')][_0x0f35('0x45')]);_0x46f489[_0x0f35('0x29')]=qs['offset'](_0x3fec59[_0x0f35('0x3c')][_0x0f35('0x29')]);}_0x46f489['order']=qs[_0x0f35('0x46')](_0x3fec59[_0x0f35('0x3c')][_0x0f35('0x46')]);_0x46f489['where']=qs[_0x0f35('0x3e')](_[_0x0f35('0x47')](_0x3fec59[_0x0f35('0x3c')],_0x4f7adc['filters']),_0x57d0e2);if(_0x3fec59[_0x0f35('0x3c')][_0x0f35('0x48')]){_0x46f489[_0x0f35('0x49')]=_['merge'](_0x46f489[_0x0f35('0x49')],{'$or':_[_0x0f35('0x4a')](_0x57d0e2,function(_0x51ca68){if(_0x51ca68[_0x0f35('0x39')]!==_0x0f35('0x4b')){var _0x1d3a93={};_0x1d3a93[_0x51ca68[_0x0f35('0x34')]]={'$like':'%'+_0x3fec59['query'][_0x0f35('0x48')]+'%'};return _0x1d3a93;}})});}_0x46f489=_['merge']({},_0x46f489,_0x3fec59[_0x0f35('0x4c')]);var _0x4fd26f={'where':_0x46f489[_0x0f35('0x49')]};return db['VoiceContext'][_0x0f35('0x2b')](_0x4fd26f)[_0x0f35('0x30')](function(_0x2e0880){_0x41c7fe['count']=_0x2e0880;if(_0x3fec59[_0x0f35('0x3c')][_0x0f35('0x4d')]){_0x46f489['include']=[{'all':!![]}];}return db[_0x0f35('0x37')]['findAll'](_0x46f489);})[_0x0f35('0x30')](function(_0x6075ce){_0x41c7fe[_0x0f35('0x4e')]=_0x6075ce;return _0x41c7fe;})['then'](respondWithFilteredResult(_0x251879,_0x46f489))[_0x0f35('0x24')](handleError(_0x251879,null));};exports[_0x0f35('0x4f')]=function(_0x54343d,_0x25c5a6){var _0x2e2e4d={'raw':![],'where':{'id':_0x54343d[_0x0f35('0x50')]['id']}},_0x35e0d2={};_0x35e0d2[_0x0f35('0x3b')]=_['keys'](db['VoiceContext'][_0x0f35('0x51')]);_0x35e0d2[_0x0f35('0x3c')]=_['keys'](_0x54343d[_0x0f35('0x3c')]);_0x35e0d2['filters']=_['intersection'](_0x35e0d2['model'],_0x35e0d2[_0x0f35('0x3c')]);_0x2e2e4d[_0x0f35('0x41')]=_[_0x0f35('0x3f')](_0x35e0d2['model'],qs[_0x0f35('0x40')](_0x54343d[_0x0f35('0x3c')][_0x0f35('0x40')]));_0x2e2e4d['attributes']=_0x2e2e4d['attributes']['length']?_0x2e2e4d[_0x0f35('0x41')]:_0x35e0d2[_0x0f35('0x3b')];if(_0x54343d[_0x0f35('0x3c')][_0x0f35('0x4d')]){_0x2e2e4d['include']=[{'all':!![]}];}_0x2e2e4d=_[_0x0f35('0x52')]({},_0x2e2e4d,_0x54343d[_0x0f35('0x4c')]);return db[_0x0f35('0x37')][_0x0f35('0x53')](_0x2e2e4d)[_0x0f35('0x30')](handleEntityNotFound(_0x25c5a6,null))[_0x0f35('0x30')](respondWithResult(_0x25c5a6,null))[_0x0f35('0x24')](handleError(_0x25c5a6,null));};exports[_0x0f35('0x54')]=function(_0x4a151e,_0x211624,_0x3ae283){var _0x75973b;return db[_0x0f35('0x37')][_0x0f35('0x54')](_0x4a151e['body'],{'raw':!![]})[_0x0f35('0x30')](function(_0x2204d3){_0x75973b=_0x2204d3;return db[_0x0f35('0x37')][_0x0f35('0x55')]({'raw':!![]});})[_0x0f35('0x30')](function(_0x39c527){var _0x192f79=fs['readFileSync'](path[_0x0f35('0x56')](config[_0x0f35('0x57')],'server/files/templates/context.ejs'),_0x0f35('0x58'));var _0x44d4d6=ejs[_0x0f35('0x59')](_0x192f79,{'contexts':_0x39c527||[]});fs[_0x0f35('0x5a')](_0x0f35('0x5b'),_0x44d4d6);})['then'](function(){return respondWithRpcPromise(_0x0f35('0x5c'),_0x0f35('0x54'),{'module':_0x0f35('0x5d')});})[_0x0f35('0x30')](function(){var _0x214374=_0x4a151e['user'][_0x0f35('0x5e')]({'plain':!![]});if(!_0x214374)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x214374[_0x0f35('0x5f')]===_0x0f35('0x60')){var _0x4aa100=_0x75973b[_0x0f35('0x5e')]({'plain':!![]});return db[_0x0f35('0x61')]['find']({'where':{'name':'Contexts','userProfileId':_0x214374[_0x0f35('0x62')]},'raw':!![]})['then'](function(_0x3ae941){if(_0x3ae941&&_0x3ae941['autoAssociation']===0x0){return db[_0x0f35('0x32')][_0x0f35('0x54')]({'name':_0x4aa100['name'],'resourceId':_0x4aa100['id'],'type':_0x3ae941[_0x0f35('0x34')],'sectionId':_0x3ae941['id']},{})[_0x0f35('0x30')](function(){return _0x75973b;});}else{return _0x75973b;}})['catch'](function(_0x3d3ab2){logger[_0x0f35('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d3ab2);throw _0x3d3ab2;});}return _0x75973b;})[_0x0f35('0x30')](respondWithResult(_0x211624,0xc9))[_0x0f35('0x24')](handleError(_0x211624,null));};exports[_0x0f35('0x63')]=function(_0x28ac58,_0x5a24cd,_0x5b2d1e){var _0x5106b3;return db[_0x0f35('0x37')][_0x0f35('0x53')]({'where':{'id':_0x28ac58['params']['id']}})[_0x0f35('0x30')](handleEntityNotFound(_0x5a24cd,null))[_0x0f35('0x30')](saveUpdates(_0x28ac58[_0x0f35('0x64')],null))[_0x0f35('0x30')](function(_0x56ad79){if(_0x56ad79){_0x5106b3=_0x56ad79;return db[_0x0f35('0x37')][_0x0f35('0x55')]({'raw':!![]});}})[_0x0f35('0x30')](function(_0x35bd2b){var _0x36222b=fs['readFileSync'](path[_0x0f35('0x56')](config['root'],_0x0f35('0x65')),_0x0f35('0x58'));var _0x233b3f=ejs[_0x0f35('0x59')](_0x36222b,{'contexts':_0x35bd2b||[]});fs[_0x0f35('0x5a')](_0x0f35('0x5b'),_0x233b3f);})['then'](function(){return respondWithRpcPromise('Reload',_0x0f35('0x63'),{'module':'chan_sip.so'});})['then'](function(){return _0x5106b3;})[_0x0f35('0x30')](respondWithResult(_0x5a24cd,null))[_0x0f35('0x24')](handleError(_0x5a24cd,null));};exports[_0x0f35('0x2f')]=function(_0x1bebc4,_0x14927f,_0x337cbc){var _0xbdaec2;return db[_0x0f35('0x37')][_0x0f35('0x53')]({'where':{'id':_0x1bebc4[_0x0f35('0x50')]['id']}})[_0x0f35('0x30')](handleEntityNotFound(_0x14927f,null))[_0x0f35('0x30')](removeEntity(_0x14927f,null))[_0x0f35('0x30')](function(){return db[_0x0f35('0x37')][_0x0f35('0x55')]({'raw':!![]});})[_0x0f35('0x30')](function(_0x532556){var _0x1883bc=fs[_0x0f35('0x66')](path[_0x0f35('0x56')](config[_0x0f35('0x57')],'server/files/templates/context.ejs'),_0x0f35('0x58'));var _0x3480d1=ejs[_0x0f35('0x59')](_0x1883bc,{'contexts':_0x532556});fs[_0x0f35('0x5a')](_0x0f35('0x5b'),_0x3480d1);return respondWithRpcPromise(_0x0f35('0x5c'),_0x0f35('0x2f'),{'module':'chan_sip.so'});})[_0x0f35('0x24')](handleError(_0x14927f,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b5a3904..6278cad 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 _0xf058=['voice_contexts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext'];(function(_0x1bd411,_0x2b2ca2){var _0x5dcc9f=function(_0x12d987){while(--_0x12d987){_0x1bd411['push'](_0x1bd411['shift']());}};_0x5dcc9f(++_0x2b2ca2);}(_0xf058,0x1ef));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8f05('0x0'));var util=require(_0x8f05('0x1'));var logger=require(_0x8f05('0x2'))('api');var moment=require(_0x8f05('0x3'));var BPromise=require(_0x8f05('0x4'));var rp=require(_0x8f05('0x5'));var fs=require('fs');var path=require(_0x8f05('0x6'));var rimraf=require(_0x8f05('0x7'));var config=require(_0x8f05('0x8'));var attributes=require(_0x8f05('0x9'));module[_0x8f05('0xa')]=function(_0x12fd26,_0x447514){return _0x12fd26['define'](_0x8f05('0xb'),attributes,{'tableName':_0x8f05('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6a2=['rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x49d280,_0x33d68f){var _0x25274a=function(_0x8ace90){while(--_0x8ace90){_0x49d280['push'](_0x49d280['shift']());}};_0x25274a(++_0x33d68f);}(_0xc6a2,0x69));var _0x2c6a=function(_0x3fc0cd,_0x275a5e){_0x3fc0cd=_0x3fc0cd-0x0;var _0x33c236=_0xc6a2[_0x3fc0cd];return _0x33c236;};'use strict';var _=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var logger=require('../../config/logger')(_0x2c6a('0x2'));var moment=require(_0x2c6a('0x3'));var BPromise=require(_0x2c6a('0x4'));var rp=require(_0x2c6a('0x5'));var fs=require('fs');var path=require(_0x2c6a('0x6'));var rimraf=require(_0x2c6a('0x7'));var config=require(_0x2c6a('0x8'));var attributes=require(_0x2c6a('0x9'));module[_0x2c6a('0xa')]=function(_0x3c7e44,_0x4559d8){return _0x3c7e44[_0x2c6a('0xb')](_0x2c6a('0xc'),attributes,{'tableName':_0x2c6a('0xd'),'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 579cea1..aa28f77 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 _0xa958=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring'];(function(_0x5c35ee,_0x3d5a83){var _0x409e33=function(_0x464fd4){while(--_0x464fd4){_0x5c35ee['push'](_0x5c35ee['shift']());}};_0x409e33(++_0x3d5a83);}(_0xa958,0x94));var _0x8a95=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa958[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x8a95('0x0'));var util=require('util');var moment=require(_0x8a95('0x1'));var BPromise=require(_0x8a95('0x2'));var rs=require(_0x8a95('0x3'));var fs=require('fs');var Redis=require(_0x8a95('0x4'));var db=require(_0x8a95('0x5'))['db'];var utils=require(_0x8a95('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a95('0x7'));var jayson=require(_0x8a95('0x8'));var client=jayson[_0x8a95('0x9')][_0x8a95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387db4,_0xdd54e1,_0x161f00){return new BPromise(function(_0x49287d,_0xe03b31){return client[_0x8a95('0xb')](_0x387db4,_0x161f00)[_0x8a95('0xc')](function(_0x240b22){logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));logger['debug'](_0x8a95('0x10'),_0xdd54e1,_0x8a95('0xf'),JSON['stringify'](_0x240b22));if(_0x240b22[_0x8a95('0x11')]){if(_0x240b22['error']['code']===0x1f4){logger[_0x8a95('0x11')]('VoiceContext,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0xe03b31(_0x240b22['error'][_0x8a95('0x12')]);}logger[_0x8a95('0x11')]('VoiceContext,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0x49287d(_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);}else{logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));_0x49287d(_0x240b22['result'][_0x8a95('0x12')]);}})['catch'](function(_0x334b18){logger['error'](_0x8a95('0xe'),_0xdd54e1,_0x334b18);_0xe03b31(_0x334b18);});});} \ No newline at end of file +var _0x152f=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message'];(function(_0x4a133d,_0x3b4141){var _0x58b4e9=function(_0xa55812){while(--_0xa55812){_0x4a133d['push'](_0x4a133d['shift']());}};_0x58b4e9(++_0x3b4141);}(_0x152f,0x144));var _0xf152=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x152f[_0x24237f];return _0x48298e;};'use strict';var _=require(_0xf152('0x0'));var util=require(_0xf152('0x1'));var moment=require(_0xf152('0x2'));var BPromise=require(_0xf152('0x3'));var rs=require(_0xf152('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf152('0x5'))['db'];var utils=require(_0xf152('0x6'));var logger=require(_0xf152('0x7'))(_0xf152('0x8'));var config=require('../../config/environment');var jayson=require(_0xf152('0x9'));var client=jayson['client'][_0xf152('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504fb6,_0x36498a,_0x5ec158){return new BPromise(function(_0x5206b3,_0x3190e3){return client[_0xf152('0xb')](_0x504fb6,_0x5ec158)['then'](function(_0x133f44){logger[_0xf152('0xc')]('VoiceContext,\x20%s,\x20%s',_0x36498a,_0xf152('0xd'));logger[_0xf152('0xe')](_0xf152('0xf'),_0x36498a,_0xf152('0xd'),JSON[_0xf152('0x10')](_0x133f44));if(_0x133f44[_0xf152('0x11')]){if(_0x133f44[_0xf152('0x11')][_0xf152('0x12')]===0x1f4){logger[_0xf152('0x11')](_0xf152('0x13'),_0x36498a,_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);return _0x3190e3(_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);}logger['error'](_0xf152('0x13'),_0x36498a,_0x133f44[_0xf152('0x11')]['message']);return _0x5206b3(_0x133f44[_0xf152('0x11')][_0xf152('0x14')]);}else{logger[_0xf152('0xc')]('VoiceContext,\x20%s,\x20%s',_0x36498a,_0xf152('0xd'));_0x5206b3(_0x133f44[_0xf152('0x15')]['message']);}})[_0xf152('0x16')](function(_0x29bad9){logger[_0xf152('0x11')](_0xf152('0x13'),_0x36498a,_0x29bad9);_0x3190e3(_0x29bad9);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 09b6fcd..9c91e1d 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 _0x5d31=['/describe','isAuthenticated','show','/:id','update','delete','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5d31,0xf7));var _0x15d3=function(_0x5d381c,_0x445675){_0x5d381c=_0x5d381c-0x0;var _0x5d0199=_0x5d31[_0x5d381c];return _0x5d0199;};'use strict';var multer=require('multer');var util=require(_0x15d3('0x0'));var path=require(_0x15d3('0x1'));var timeout=require(_0x15d3('0x2'));var express=require('express');var router=express[_0x15d3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x15d3('0x4'));var config=require(_0x15d3('0x5'));var controller=require(_0x15d3('0x6'));router[_0x15d3('0x7')]('/',auth['isAuthenticated'](),controller[_0x15d3('0x8')]);router[_0x15d3('0x7')](_0x15d3('0x9'),auth[_0x15d3('0xa')](),controller['describe']);router[_0x15d3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x15d3('0xb')]);router['post']('/',auth[_0x15d3('0xa')](),controller['create']);router['put'](_0x15d3('0xc'),auth[_0x15d3('0xa')](),controller[_0x15d3('0xd')]);router[_0x15d3('0xe')](_0x15d3('0xc'),auth[_0x15d3('0xa')](),controller['destroy']);module[_0x15d3('0xf')]=router; \ No newline at end of file +var _0xd691=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x415eea,_0x323fe7){var _0x120bb9=function(_0x7973b2){while(--_0x7973b2){_0x415eea['push'](_0x415eea['shift']());}};_0x120bb9(++_0x323fe7);}(_0xd691,0xe6));var _0x1d69=function(_0x15797a,_0x16274f){_0x15797a=_0x15797a-0x0;var _0x3e2618=_0xd691[_0x15797a];return _0x3e2618;};'use strict';var multer=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var path=require(_0x1d69('0x2'));var timeout=require('connect-timeout');var express=require(_0x1d69('0x3'));var router=express[_0x1d69('0x4')]();var fs_extra=require(_0x1d69('0x5'));var auth=require(_0x1d69('0x6'));var interaction=require(_0x1d69('0x7'));var config=require(_0x1d69('0x8'));var controller=require(_0x1d69('0x9'));router[_0x1d69('0xa')]('/',auth[_0x1d69('0xb')](),controller[_0x1d69('0xc')]);router['get']('/describe',auth[_0x1d69('0xb')](),controller['describe']);router[_0x1d69('0xa')](_0x1d69('0xd'),auth[_0x1d69('0xb')](),controller[_0x1d69('0xe')]);router['post']('/',auth[_0x1d69('0xb')](),controller[_0x1d69('0xf')]);router[_0x1d69('0x10')](_0x1d69('0xd'),auth[_0x1d69('0xb')](),controller['update']);router['delete'](_0x1d69('0xd'),auth[_0x1d69('0xb')](),controller[_0x1d69('0x11')]);module[_0x1d69('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 1565f44..91974bc 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 _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x113bc8,_0x320cf0){var _0x43e3fa=function(_0x5e84e5){while(--_0x5e84e5){_0x113bc8['push'](_0x113bc8['shift']());}};_0x43e3fa(++_0x320cf0);}(_0x24ca,0x1bc));var _0xa24c=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0x24ca[_0x15cbce];return _0x257f29;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file +var _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x595076,_0x42ae11){var _0x2b418d=function(_0x28c5e4){while(--_0x28c5e4){_0x595076['push'](_0x595076['shift']());}};_0x2b418d(++_0x42ae11);}(_0x6aa7,0x178));var _0x76aa=function(_0x18f69f,_0x216d28){_0x18f69f=_0x18f69f-0x0;var _0x227a9e=_0x6aa7[_0x18f69f];return _0x227a9e;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 76a627b..0f2b6de 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 _0x1be2=['offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceDialReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x3a8842,_0x4149be){var _0x4d05e6=function(_0x201c61){while(--_0x201c61){_0x3a8842['push'](_0x3a8842['shift']());}};_0x4d05e6(++_0x4149be);}(_0x1be2,0x1ac));var _0x21be=function(_0xa6802d,_0x2c3f41){_0xa6802d=_0xa6802d-0x0;var _0x23c946=_0x1be2[_0xa6802d];return _0x23c946;};'use strict';var emlformat=require(_0x21be('0x0'));var rimraf=require(_0x21be('0x1'));var zipdir=require(_0x21be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x21be('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x21be('0x4'));var util=require(_0x21be('0x5'));var path=require(_0x21be('0x6'));var sox=require(_0x21be('0x7'));var csv=require(_0x21be('0x8'));var ejs=require(_0x21be('0x9'));var fs=require('fs');var fs_extra=require(_0x21be('0xa'));var _=require(_0x21be('0xb'));var squel=require(_0x21be('0xc'));var crypto=require(_0x21be('0xd'));var jsforce=require(_0x21be('0xe'));var deskjs=require(_0x21be('0xf'));var toCsv=require(_0x21be('0x8'));var querystring=require(_0x21be('0x10'));var Papa=require('papaparse');var Redis=require(_0x21be('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x21be('0x12'));var hardwareService=require(_0x21be('0x13'));var logger=require(_0x21be('0x14'))(_0x21be('0x15'));var utils=require(_0x21be('0x16'));var config=require(_0x21be('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x21be('0x18'))['db'];function respondWithStatusCode(_0x193d53,_0x4b736b){_0x4b736b=_0x4b736b||0xcc;return function(_0x2126e5){if(_0x2126e5){return _0x193d53[_0x21be('0x19')](_0x4b736b);}return _0x193d53[_0x21be('0x1a')](_0x4b736b)['end']();};}function respondWithResult(_0x37c026,_0x1a4933){_0x1a4933=_0x1a4933||0xc8;return function(_0x503b4c){if(_0x503b4c){return _0x37c026[_0x21be('0x1a')](_0x1a4933)[_0x21be('0x1b')](_0x503b4c);}};}function respondWithFilteredResult(_0x1e7cec,_0x4a3318){return function(_0xd9f18){if(_0xd9f18){var _0x320ca7=typeof _0x4a3318[_0x21be('0x1c')]===_0x21be('0x1d')&&typeof _0x4a3318[_0x21be('0x1e')]===_0x21be('0x1d');var _0x12fa13=_0xd9f18[_0x21be('0x1f')];var _0x32fe82=_0x320ca7?0x0:_0x4a3318['offset'];var _0x4ed041=_0x320ca7?_0xd9f18[_0x21be('0x1f')]:_0x4a3318['offset']+_0x4a3318[_0x21be('0x1e')];var _0x5e1533;if(_0x4ed041>=_0x12fa13){_0x4ed041=_0x12fa13;_0x5e1533=0xc8;}else{_0x5e1533=0xce;}_0x1e7cec['status'](_0x5e1533);return _0x1e7cec[_0x21be('0x20')]('Content-Range',_0x32fe82+'-'+_0x4ed041+'/'+_0x12fa13)[_0x21be('0x1b')](_0xd9f18);}return null;};}function patchUpdates(_0x5c59d1){return function(_0x4b3ae6){try{jsonpatch[_0x21be('0x21')](_0x4b3ae6,_0x5c59d1,!![]);}catch(_0x393bf6){return BPromise[_0x21be('0x22')](_0x393bf6);}return _0x4b3ae6[_0x21be('0x23')]();};}function saveUpdates(_0x1e1b26,_0x3622ea){return function(_0x16ddf0){if(_0x16ddf0){return _0x16ddf0[_0x21be('0x24')](_0x1e1b26)[_0x21be('0x25')](function(_0x21f0a2){return _0x21f0a2;});}return null;};}function removeEntity(_0x5f0531,_0x2bdec1){return function(_0x5320bc){if(_0x5320bc){return _0x5320bc[_0x21be('0x26')]()['then'](function(){_0x5f0531['status'](0xcc)[_0x21be('0x27')]();});}};}function handleEntityNotFound(_0x2a53aa,_0x81042f){return function(_0x8cf1e5){if(!_0x8cf1e5){_0x2a53aa['sendStatus'](0x194);}return _0x8cf1e5;};}function handleError(_0x5ded2b,_0x32228b){_0x32228b=_0x32228b||0x1f4;return function(_0x974717){logger[_0x21be('0x28')](_0x974717[_0x21be('0x29')]);if(_0x974717[_0x21be('0x2a')]){delete _0x974717[_0x21be('0x2a')];}_0x5ded2b[_0x21be('0x1a')](_0x32228b)[_0x21be('0x2b')](_0x974717);};}exports[_0x21be('0x2c')]=function(_0x433acf,_0x548674){var _0x2975d7={},_0x5b8dc4={},_0x8dd92c={'count':0x0,'rows':[]};var _0x39af14=_[_0x21be('0x2d')](db[_0x21be('0x2e')]['rawAttributes'],function(_0x5efefc){return{'name':_0x5efefc[_0x21be('0x2f')],'type':_0x5efefc[_0x21be('0x30')]['key']};});_0x5b8dc4[_0x21be('0x31')]=_[_0x21be('0x2d')](_0x39af14,_0x21be('0x2a'));_0x5b8dc4[_0x21be('0x32')]=_['keys'](_0x433acf[_0x21be('0x32')]);_0x5b8dc4[_0x21be('0x33')]=_[_0x21be('0x34')](_0x5b8dc4[_0x21be('0x31')],_0x5b8dc4[_0x21be('0x32')]);_0x2975d7[_0x21be('0x35')]=_[_0x21be('0x34')](_0x5b8dc4[_0x21be('0x31')],qs['fields'](_0x433acf[_0x21be('0x32')][_0x21be('0x36')]));_0x2975d7[_0x21be('0x35')]=_0x2975d7[_0x21be('0x35')][_0x21be('0x37')]?_0x2975d7[_0x21be('0x35')]:_0x5b8dc4[_0x21be('0x31')];if(!_0x433acf[_0x21be('0x32')]['hasOwnProperty']('nolimit')){_0x2975d7[_0x21be('0x1e')]=qs[_0x21be('0x1e')](_0x433acf[_0x21be('0x32')][_0x21be('0x1e')]);_0x2975d7[_0x21be('0x1c')]=qs[_0x21be('0x1c')](_0x433acf[_0x21be('0x32')][_0x21be('0x1c')]);}_0x2975d7[_0x21be('0x38')]=qs[_0x21be('0x39')](_0x433acf[_0x21be('0x32')][_0x21be('0x39')]);_0x2975d7['where']=qs['filters'](_[_0x21be('0x3a')](_0x433acf[_0x21be('0x32')],_0x5b8dc4[_0x21be('0x33')]),_0x39af14);if(_0x433acf[_0x21be('0x32')]['filter']){_0x2975d7[_0x21be('0x3b')]=_[_0x21be('0x3c')](_0x2975d7['where'],{'$or':_[_0x21be('0x2d')](_0x39af14,function(_0x208bf3){if(_0x208bf3['type']!==_0x21be('0x3d')){var _0x1267ab={};_0x1267ab[_0x208bf3['name']]={'$like':'%'+_0x433acf[_0x21be('0x32')][_0x21be('0x3e')]+'%'};return _0x1267ab;}})});}_0x2975d7=_[_0x21be('0x3c')]({},_0x2975d7,_0x433acf[_0x21be('0x3f')]);var _0x32154e={'where':_0x2975d7[_0x21be('0x3b')]};return db[_0x21be('0x2e')]['count'](_0x32154e)[_0x21be('0x25')](function(_0x224f9c){_0x8dd92c['count']=_0x224f9c;if(_0x433acf[_0x21be('0x32')][_0x21be('0x40')]){_0x2975d7[_0x21be('0x41')]=[{'all':!![]}];}return db[_0x21be('0x2e')]['findAll'](_0x2975d7);})[_0x21be('0x25')](function(_0x336306){_0x8dd92c[_0x21be('0x42')]=_0x336306;return _0x8dd92c;})[_0x21be('0x25')](respondWithFilteredResult(_0x548674,_0x2975d7))[_0x21be('0x43')](handleError(_0x548674,null));};exports[_0x21be('0x44')]=function(_0x28f6b9,_0x3ac74a){var _0x554f40={'raw':!![],'where':{'id':_0x28f6b9[_0x21be('0x45')]['id']}},_0x3f3ac4={};_0x3f3ac4[_0x21be('0x31')]=_[_0x21be('0x46')](db['VoiceDialReport'][_0x21be('0x47')]);_0x3f3ac4['query']=_[_0x21be('0x46')](_0x28f6b9['query']);_0x3f3ac4['filters']=_[_0x21be('0x34')](_0x3f3ac4['model'],_0x3f3ac4['query']);_0x554f40['attributes']=_[_0x21be('0x34')](_0x3f3ac4['model'],qs[_0x21be('0x36')](_0x28f6b9[_0x21be('0x32')][_0x21be('0x36')]));_0x554f40[_0x21be('0x35')]=_0x554f40[_0x21be('0x35')][_0x21be('0x37')]?_0x554f40[_0x21be('0x35')]:_0x3f3ac4[_0x21be('0x31')];if(_0x28f6b9[_0x21be('0x32')][_0x21be('0x40')]){_0x554f40['include']=[{'all':!![]}];}_0x554f40=_['merge']({},_0x554f40,_0x28f6b9['options']);return db[_0x21be('0x2e')][_0x21be('0x48')](_0x554f40)[_0x21be('0x25')](handleEntityNotFound(_0x3ac74a,null))[_0x21be('0x25')](respondWithResult(_0x3ac74a,null))['catch'](handleError(_0x3ac74a,null));};exports['create']=function(_0x46d27d,_0x10802b){return db[_0x21be('0x2e')][_0x21be('0x49')](_0x46d27d[_0x21be('0x4a')],{})['then'](respondWithResult(_0x10802b,0xc9))[_0x21be('0x43')](handleError(_0x10802b,null));};exports[_0x21be('0x24')]=function(_0x514490,_0x4e2bf8){if(_0x514490[_0x21be('0x4a')]['id']){delete _0x514490[_0x21be('0x4a')]['id'];}return db[_0x21be('0x2e')][_0x21be('0x48')]({'where':{'id':_0x514490[_0x21be('0x45')]['id']}})[_0x21be('0x25')](handleEntityNotFound(_0x4e2bf8,null))[_0x21be('0x25')](saveUpdates(_0x514490[_0x21be('0x4a')],null))['then'](respondWithResult(_0x4e2bf8,null))['catch'](handleError(_0x4e2bf8,null));};exports[_0x21be('0x26')]=function(_0x59ae3b,_0x76a6b9){return db[_0x21be('0x2e')][_0x21be('0x48')]({'where':{'id':_0x59ae3b['params']['id']}})[_0x21be('0x25')](handleEntityNotFound(_0x76a6b9,null))['then'](removeEntity(_0x76a6b9,null))[_0x21be('0x43')](handleError(_0x76a6b9,null));};exports[_0x21be('0x4b')]=function(_0x2021ae,_0x399dfa){return db['VoiceDialReport'][_0x21be('0x4b')]()['then'](respondWithResult(_0x399dfa,null))[_0x21be('0x43')](handleError(_0x399dfa,null));}; \ No newline at end of file +var _0xc5a9=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','find','create','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xc5a9,0xd2));var _0x9c5a=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0xc5a9[_0x2a67fe];return _0x57e726;};'use strict';var emlformat=require(_0x9c5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9c5a('0x1'));var rp=require(_0x9c5a('0x2'));var moment=require(_0x9c5a('0x3'));var BPromise=require(_0x9c5a('0x4'));var Mustache=require(_0x9c5a('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9c5a('0x6'));var ejs=require(_0x9c5a('0x7'));var fs=require('fs');var fs_extra=require(_0x9c5a('0x8'));var _=require(_0x9c5a('0x9'));var squel=require(_0x9c5a('0xa'));var crypto=require(_0x9c5a('0xb'));var jsforce=require(_0x9c5a('0xc'));var deskjs=require(_0x9c5a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9c5a('0xe'));var Redis=require(_0x9c5a('0xf'));var authService=require(_0x9c5a('0x10'));var qs=require(_0x9c5a('0x11'));var as=require(_0x9c5a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9c5a('0x13'));var db=require(_0x9c5a('0x14'))['db'];function respondWithStatusCode(_0x16bb03,_0x41db7d){_0x41db7d=_0x41db7d||0xcc;return function(_0xc05b61){if(_0xc05b61){return _0x16bb03[_0x9c5a('0x15')](_0x41db7d);}return _0x16bb03[_0x9c5a('0x16')](_0x41db7d)[_0x9c5a('0x17')]();};}function respondWithResult(_0x1e1309,_0x27c949){_0x27c949=_0x27c949||0xc8;return function(_0x4d2b98){if(_0x4d2b98){return _0x1e1309['status'](_0x27c949)['json'](_0x4d2b98);}};}function respondWithFilteredResult(_0x1ffbe8,_0x4fc2a2){return function(_0x253293){if(_0x253293){var _0x53450a=typeof _0x4fc2a2[_0x9c5a('0x18')]===_0x9c5a('0x19')&&typeof _0x4fc2a2['limit']===_0x9c5a('0x19');var _0x4fe65e=_0x253293[_0x9c5a('0x1a')];var _0x1a87fb=_0x53450a?0x0:_0x4fc2a2[_0x9c5a('0x18')];var _0x566c11=_0x53450a?_0x253293[_0x9c5a('0x1a')]:_0x4fc2a2['offset']+_0x4fc2a2[_0x9c5a('0x1b')];var _0x73fbae;if(_0x566c11>=_0x4fe65e){_0x566c11=_0x4fe65e;_0x73fbae=0xc8;}else{_0x73fbae=0xce;}_0x1ffbe8['status'](_0x73fbae);return _0x1ffbe8[_0x9c5a('0x1c')](_0x9c5a('0x1d'),_0x1a87fb+'-'+_0x566c11+'/'+_0x4fe65e)[_0x9c5a('0x1e')](_0x253293);}return null;};}function patchUpdates(_0x194ca4){return function(_0x44f1a){try{jsonpatch[_0x9c5a('0x1f')](_0x44f1a,_0x194ca4,!![]);}catch(_0x325afd){return BPromise[_0x9c5a('0x20')](_0x325afd);}return _0x44f1a[_0x9c5a('0x21')]();};}function saveUpdates(_0x573975,_0x46efa0){return function(_0x4c51df){if(_0x4c51df){return _0x4c51df[_0x9c5a('0x22')](_0x573975)['then'](function(_0x21b0b7){return _0x21b0b7;});}return null;};}function removeEntity(_0x2c9070,_0x12f3ca){return function(_0x4e7a73){if(_0x4e7a73){return _0x4e7a73[_0x9c5a('0x23')]()['then'](function(){_0x2c9070['status'](0xcc)[_0x9c5a('0x17')]();});}};}function handleEntityNotFound(_0x582f96,_0x4cad53){return function(_0x58b3ea){if(!_0x58b3ea){_0x582f96[_0x9c5a('0x15')](0x194);}return _0x58b3ea;};}function handleError(_0x4c3450,_0xe5a311){_0xe5a311=_0xe5a311||0x1f4;return function(_0x4c45b8){logger[_0x9c5a('0x24')](_0x4c45b8[_0x9c5a('0x25')]);if(_0x4c45b8[_0x9c5a('0x26')]){delete _0x4c45b8[_0x9c5a('0x26')];}_0x4c3450['status'](_0xe5a311)[_0x9c5a('0x27')](_0x4c45b8);};}exports[_0x9c5a('0x28')]=function(_0x33f708,_0x4a3db7){var _0x51df3f={},_0xfe932f={},_0x3dd321={'count':0x0,'rows':[]};var _0x17acb8=_['map'](db[_0x9c5a('0x29')][_0x9c5a('0x2a')],function(_0x391fd8){return{'name':_0x391fd8[_0x9c5a('0x2b')],'type':_0x391fd8[_0x9c5a('0x2c')]['key']};});_0xfe932f[_0x9c5a('0x2d')]=_[_0x9c5a('0x2e')](_0x17acb8,_0x9c5a('0x26'));_0xfe932f['query']=_[_0x9c5a('0x2f')](_0x33f708[_0x9c5a('0x30')]);_0xfe932f[_0x9c5a('0x31')]=_['intersection'](_0xfe932f['model'],_0xfe932f[_0x9c5a('0x30')]);_0x51df3f['attributes']=_[_0x9c5a('0x32')](_0xfe932f[_0x9c5a('0x2d')],qs['fields'](_0x33f708[_0x9c5a('0x30')][_0x9c5a('0x33')]));_0x51df3f['attributes']=_0x51df3f[_0x9c5a('0x34')][_0x9c5a('0x35')]?_0x51df3f[_0x9c5a('0x34')]:_0xfe932f[_0x9c5a('0x2d')];if(!_0x33f708[_0x9c5a('0x30')][_0x9c5a('0x36')](_0x9c5a('0x37'))){_0x51df3f[_0x9c5a('0x1b')]=qs[_0x9c5a('0x1b')](_0x33f708[_0x9c5a('0x30')]['limit']);_0x51df3f[_0x9c5a('0x18')]=qs[_0x9c5a('0x18')](_0x33f708[_0x9c5a('0x30')][_0x9c5a('0x18')]);}_0x51df3f[_0x9c5a('0x38')]=qs[_0x9c5a('0x39')](_0x33f708[_0x9c5a('0x30')][_0x9c5a('0x39')]);_0x51df3f[_0x9c5a('0x3a')]=qs[_0x9c5a('0x31')](_[_0x9c5a('0x3b')](_0x33f708['query'],_0xfe932f[_0x9c5a('0x31')]),_0x17acb8);if(_0x33f708[_0x9c5a('0x30')][_0x9c5a('0x3c')]){_0x51df3f['where']=_[_0x9c5a('0x3d')](_0x51df3f[_0x9c5a('0x3a')],{'$or':_['map'](_0x17acb8,function(_0x2cfa7d){if(_0x2cfa7d[_0x9c5a('0x2c')]!==_0x9c5a('0x3e')){var _0x164fee={};_0x164fee[_0x2cfa7d[_0x9c5a('0x26')]]={'$like':'%'+_0x33f708[_0x9c5a('0x30')][_0x9c5a('0x3c')]+'%'};return _0x164fee;}})});}_0x51df3f=_['merge']({},_0x51df3f,_0x33f708[_0x9c5a('0x3f')]);var _0x5e3a84={'where':_0x51df3f[_0x9c5a('0x3a')]};return db['VoiceDialReport'][_0x9c5a('0x1a')](_0x5e3a84)[_0x9c5a('0x40')](function(_0x507561){_0x3dd321[_0x9c5a('0x1a')]=_0x507561;if(_0x33f708[_0x9c5a('0x30')][_0x9c5a('0x41')]){_0x51df3f[_0x9c5a('0x42')]=[{'all':!![]}];}return db[_0x9c5a('0x29')][_0x9c5a('0x43')](_0x51df3f);})[_0x9c5a('0x40')](function(_0x1d4583){_0x3dd321[_0x9c5a('0x44')]=_0x1d4583;return _0x3dd321;})[_0x9c5a('0x40')](respondWithFilteredResult(_0x4a3db7,_0x51df3f))['catch'](handleError(_0x4a3db7,null));};exports[_0x9c5a('0x45')]=function(_0x49329f,_0x27b6d4){var _0x1e6152={'raw':!![],'where':{'id':_0x49329f[_0x9c5a('0x46')]['id']}},_0x449810={};_0x449810['model']=_[_0x9c5a('0x2f')](db[_0x9c5a('0x29')]['rawAttributes']);_0x449810[_0x9c5a('0x30')]=_[_0x9c5a('0x2f')](_0x49329f[_0x9c5a('0x30')]);_0x449810[_0x9c5a('0x31')]=_['intersection'](_0x449810[_0x9c5a('0x2d')],_0x449810['query']);_0x1e6152[_0x9c5a('0x34')]=_['intersection'](_0x449810[_0x9c5a('0x2d')],qs[_0x9c5a('0x33')](_0x49329f[_0x9c5a('0x30')]['fields']));_0x1e6152[_0x9c5a('0x34')]=_0x1e6152[_0x9c5a('0x34')][_0x9c5a('0x35')]?_0x1e6152[_0x9c5a('0x34')]:_0x449810['model'];if(_0x49329f[_0x9c5a('0x30')][_0x9c5a('0x41')]){_0x1e6152[_0x9c5a('0x42')]=[{'all':!![]}];}_0x1e6152=_['merge']({},_0x1e6152,_0x49329f[_0x9c5a('0x3f')]);return db[_0x9c5a('0x29')][_0x9c5a('0x47')](_0x1e6152)[_0x9c5a('0x40')](handleEntityNotFound(_0x27b6d4,null))[_0x9c5a('0x40')](respondWithResult(_0x27b6d4,null))['catch'](handleError(_0x27b6d4,null));};exports['create']=function(_0x1c07fc,_0x498ea8){return db[_0x9c5a('0x29')][_0x9c5a('0x48')](_0x1c07fc[_0x9c5a('0x49')],{})[_0x9c5a('0x40')](respondWithResult(_0x498ea8,0xc9))[_0x9c5a('0x4a')](handleError(_0x498ea8,null));};exports[_0x9c5a('0x22')]=function(_0xc47e57,_0x3dd5a1){if(_0xc47e57[_0x9c5a('0x49')]['id']){delete _0xc47e57[_0x9c5a('0x49')]['id'];}return db[_0x9c5a('0x29')]['find']({'where':{'id':_0xc47e57['params']['id']}})[_0x9c5a('0x40')](handleEntityNotFound(_0x3dd5a1,null))[_0x9c5a('0x40')](saveUpdates(_0xc47e57['body'],null))[_0x9c5a('0x40')](respondWithResult(_0x3dd5a1,null))[_0x9c5a('0x4a')](handleError(_0x3dd5a1,null));};exports[_0x9c5a('0x23')]=function(_0x4a98f0,_0x9e1b2b){return db[_0x9c5a('0x29')][_0x9c5a('0x47')]({'where':{'id':_0x4a98f0[_0x9c5a('0x46')]['id']}})[_0x9c5a('0x40')](handleEntityNotFound(_0x9e1b2b,null))[_0x9c5a('0x40')](removeEntity(_0x9e1b2b,null))['catch'](handleError(_0x9e1b2b,null));};exports['describe']=function(_0x7430a0,_0x4179c2){return db[_0x9c5a('0x29')]['describe']()[_0x9c5a('0x40')](respondWithResult(_0x4179c2,null))[_0x9c5a('0x4a')](handleError(_0x4179c2,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6affe56..e947c79 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 _0x5d66=['request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x5d66,0x126));var _0x65d6=function(_0x364a90,_0x1d99ea){_0x364a90=_0x364a90-0x0;var _0x506042=_0x5d66[_0x364a90];return _0x506042;};'use strict';var _=require(_0x65d6('0x0'));var util=require(_0x65d6('0x1'));var logger=require(_0x65d6('0x2'))(_0x65d6('0x3'));var moment=require(_0x65d6('0x4'));var BPromise=require(_0x65d6('0x5'));var rp=require(_0x65d6('0x6'));var fs=require('fs');var path=require(_0x65d6('0x7'));var rimraf=require(_0x65d6('0x8'));var config=require(_0x65d6('0x9'));var attributes=require(_0x65d6('0xa'));module[_0x65d6('0xb')]=function(_0x553c6e,_0x1b2b84){return _0x553c6e[_0x65d6('0xc')]('VoiceDialReport',attributes,{'tableName':_0x65d6('0xd'),'paranoid':![],'indexes':[{'fields':[_0x65d6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4044=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x4044,0xcb));var _0x4404=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4044[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x4404('0x0'));var util=require(_0x4404('0x1'));var logger=require(_0x4404('0x2'))(_0x4404('0x3'));var moment=require(_0x4404('0x4'));var BPromise=require(_0x4404('0x5'));var rp=require(_0x4404('0x6'));var fs=require('fs');var path=require(_0x4404('0x7'));var rimraf=require(_0x4404('0x8'));var config=require(_0x4404('0x9'));var attributes=require(_0x4404('0xa'));module[_0x4404('0xb')]=function(_0x53cef4,_0x4f8263){return _0x53cef4[_0x4404('0xc')](_0x4404('0xd'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x4404('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 738e8f5..2814cdc 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 _0xaf25=['body','options','then','CreateVoiceDialReport','catch','UpdateVoiceDialReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceDialReport,\x20%s,\x20%s','result','VoiceDialReport'];(function(_0x273f92,_0x5e6ea2){var _0x38b53c=function(_0x494d4e){while(--_0x494d4e){_0x273f92['push'](_0x273f92['shift']());}};_0x38b53c(++_0x5e6ea2);}(_0xaf25,0x77));var _0x5af2=function(_0x40a733,_0x113532){_0x40a733=_0x40a733-0x0;var _0xb7d934=_0xaf25[_0x40a733];return _0xb7d934;};'use strict';var _=require(_0x5af2('0x0'));var util=require(_0x5af2('0x1'));var moment=require(_0x5af2('0x2'));var BPromise=require(_0x5af2('0x3'));var rs=require(_0x5af2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5af2('0x5'))['db'];var utils=require(_0x5af2('0x6'));var logger=require(_0x5af2('0x7'))(_0x5af2('0x8'));var config=require(_0x5af2('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42567e,_0x137dee,_0x4f6144){return new BPromise(function(_0x4ea6b5,_0x181d6b){return client[_0x5af2('0xa')](_0x42567e,_0x4f6144)['then'](function(_0x559d88){logger[_0x5af2('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x137dee,_0x5af2('0xc'));logger[_0x5af2('0xd')](_0x5af2('0xe'),_0x137dee,_0x5af2('0xc'),JSON[_0x5af2('0xf')](_0x559d88));if(_0x559d88['error']){if(_0x559d88['error']['code']===0x1f4){logger[_0x5af2('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x137dee,_0x559d88[_0x5af2('0x10')]['message']);return _0x181d6b(_0x559d88[_0x5af2('0x10')][_0x5af2('0x11')]);}logger[_0x5af2('0x10')](_0x5af2('0x12'),_0x137dee,_0x559d88[_0x5af2('0x10')][_0x5af2('0x11')]);return _0x4ea6b5(_0x559d88[_0x5af2('0x10')]['message']);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x137dee,_0x5af2('0xc'));_0x4ea6b5(_0x559d88[_0x5af2('0x13')]['message']);}})['catch'](function(_0x5a4b0b){logger[_0x5af2('0x10')](_0x5af2('0x12'),_0x137dee,_0x5a4b0b);_0x181d6b(_0x5a4b0b);});});}exports['CreateVoiceDialReport']=function(_0x169a2f){var _0x47389e=this;return new Promise(function(_0x3c26c1,_0x421eac){return db[_0x5af2('0x14')]['create'](_0x169a2f[_0x5af2('0x15')],{'raw':_0x169a2f[_0x5af2('0x16')]?_0x169a2f[_0x5af2('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x5af2('0x17')](function(_0x4da384){logger[_0x5af2('0xb')](_0x5af2('0x18'),_0x169a2f);logger[_0x5af2('0xd')]('CreateVoiceDialReport',_0x169a2f,JSON[_0x5af2('0xf')](_0x4da384));_0x3c26c1(_0x4da384);})[_0x5af2('0x19')](function(_0x57aff3){logger[_0x5af2('0x10')](_0x5af2('0x18'),_0x57aff3[_0x5af2('0x11')],_0x169a2f);_0x421eac(_0x47389e[_0x5af2('0x10')](0x1f4,_0x57aff3[_0x5af2('0x11')]));});});};exports[_0x5af2('0x1a')]=function(_0x56db05){var _0x1b8d6d=this;return new Promise(function(_0x54a368,_0x1f622f){return db[_0x5af2('0x14')][_0x5af2('0x1b')](_0x56db05[_0x5af2('0x15')],{'raw':_0x56db05[_0x5af2('0x16')]?_0x56db05[_0x5af2('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56db05[_0x5af2('0x16')]?_0x56db05[_0x5af2('0x16')]['where']||null:null,'attributes':_0x56db05['options']?_0x56db05['options']['attributes']||null:null,'limit':_0x56db05[_0x5af2('0x16')]?_0x56db05['options']['limit']||null:null})['then'](function(_0x168a16){logger[_0x5af2('0xb')](_0x5af2('0x1a'),_0x56db05);logger['debug'](_0x5af2('0x1a'),_0x56db05,JSON[_0x5af2('0xf')](_0x168a16));_0x54a368(_0x168a16);})[_0x5af2('0x19')](function(_0xe7452f){logger['error'](_0x5af2('0x1a'),_0xe7452f[_0x5af2('0x11')],_0x56db05);_0x1f622f(_0x1b8d6d[_0x5af2('0x10')](0x1f4,_0xe7452f['message']));});});}; \ No newline at end of file +var _0x10a2=['info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','limit','UpdateVoiceDialReport','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1d5a14,_0x113dc2){var _0x50faf0=function(_0x35f1d8){while(--_0x35f1d8){_0x1d5a14['push'](_0x1d5a14['shift']());}};_0x50faf0(++_0x113dc2);}(_0x10a2,0x134));var _0x210a=function(_0x3f9ece,_0xe2b4d2){_0x3f9ece=_0x3f9ece-0x0;var _0x4f0c13=_0x10a2[_0x3f9ece];return _0x4f0c13;};'use strict';var _=require('lodash');var util=require(_0x210a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x210a('0x1'));var db=require(_0x210a('0x2'))['db'];var utils=require(_0x210a('0x3'));var logger=require('../../config/logger')(_0x210a('0x4'));var config=require(_0x210a('0x5'));var jayson=require(_0x210a('0x6'));var client=jayson[_0x210a('0x7')][_0x210a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1944fb,_0x5ee866,_0x50399c){return new BPromise(function(_0x59170d,_0x3cfc8f){return client[_0x210a('0x9')](_0x1944fb,_0x50399c)[_0x210a('0xa')](function(_0x5ebe7b){logger[_0x210a('0xb')](_0x210a('0xc'),_0x5ee866,_0x210a('0xd'));logger[_0x210a('0xe')](_0x210a('0xf'),_0x5ee866,_0x210a('0xd'),JSON[_0x210a('0x10')](_0x5ebe7b));if(_0x5ebe7b[_0x210a('0x11')]){if(_0x5ebe7b[_0x210a('0x11')][_0x210a('0x12')]===0x1f4){logger[_0x210a('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x5ee866,_0x5ebe7b[_0x210a('0x11')]['message']);return _0x3cfc8f(_0x5ebe7b['error'][_0x210a('0x13')]);}logger[_0x210a('0x11')](_0x210a('0xc'),_0x5ee866,_0x5ebe7b[_0x210a('0x11')][_0x210a('0x13')]);return _0x59170d(_0x5ebe7b[_0x210a('0x11')]['message']);}else{logger['info'](_0x210a('0xc'),_0x5ee866,_0x210a('0xd'));_0x59170d(_0x5ebe7b['result'][_0x210a('0x13')]);}})[_0x210a('0x14')](function(_0x2c6e39){logger[_0x210a('0x11')](_0x210a('0xc'),_0x5ee866,_0x2c6e39);_0x3cfc8f(_0x2c6e39);});});}exports[_0x210a('0x15')]=function(_0x33e56e){var _0x5dd233=this;return new Promise(function(_0x421a1a,_0x299acc){return db[_0x210a('0x16')][_0x210a('0x17')](_0x33e56e[_0x210a('0x18')],{'raw':_0x33e56e[_0x210a('0x19')]?_0x33e56e[_0x210a('0x19')][_0x210a('0x1a')]===undefined?!![]:![]:!![]})[_0x210a('0xa')](function(_0x2a817b){logger[_0x210a('0xb')](_0x210a('0x15'),_0x33e56e);logger['debug'](_0x210a('0x15'),_0x33e56e,JSON[_0x210a('0x10')](_0x2a817b));_0x421a1a(_0x2a817b);})['catch'](function(_0x50afd9){logger[_0x210a('0x11')](_0x210a('0x15'),_0x50afd9['message'],_0x33e56e);_0x299acc(_0x5dd233[_0x210a('0x11')](0x1f4,_0x50afd9[_0x210a('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x7ccdd1){var _0x4b7f6a=this;return new Promise(function(_0x7836eb,_0x35e8f8){return db[_0x210a('0x16')]['update'](_0x7ccdd1[_0x210a('0x18')],{'raw':_0x7ccdd1[_0x210a('0x19')]?_0x7ccdd1[_0x210a('0x19')][_0x210a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ccdd1[_0x210a('0x19')]?_0x7ccdd1['options']['where']||null:null,'attributes':_0x7ccdd1[_0x210a('0x19')]?_0x7ccdd1['options']['attributes']||null:null,'limit':_0x7ccdd1[_0x210a('0x19')]?_0x7ccdd1[_0x210a('0x19')][_0x210a('0x1b')]||null:null})['then'](function(_0x434f4e){logger[_0x210a('0xb')](_0x210a('0x1c'),_0x7ccdd1);logger[_0x210a('0xe')](_0x210a('0x1c'),_0x7ccdd1,JSON[_0x210a('0x10')](_0x434f4e));_0x7836eb(_0x434f4e);})[_0x210a('0x14')](function(_0x4299de){logger['error'](_0x210a('0x1c'),_0x4299de[_0x210a('0x13')],_0x7ccdd1);_0x35e8f8(_0x4b7f6a[_0x210a('0x11')](0x1f4,_0x4299de[_0x210a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 43053a4..d8fa853 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 _0x5501=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','/:id/applications','put','update'];(function(_0x57f8eb,_0x484ee9){var _0xc72795=function(_0x17cb9d){while(--_0x17cb9d){_0x57f8eb['push'](_0x57f8eb['shift']());}};_0xc72795(++_0x484ee9);}(_0x5501,0xa3));var _0x1550=function(_0x2fca37,_0x1733a1){_0x2fca37=_0x2fca37-0x0;var _0x4c338d=_0x5501[_0x2fca37];return _0x4c338d;};'use strict';var multer=require(_0x1550('0x0'));var util=require('util');var path=require(_0x1550('0x1'));var timeout=require(_0x1550('0x2'));var express=require(_0x1550('0x3'));var router=express['Router']();var fs_extra=require(_0x1550('0x4'));var auth=require(_0x1550('0x5'));var interaction=require(_0x1550('0x6'));var config=require(_0x1550('0x7'));var controller=require('./voiceExtension.controller');router[_0x1550('0x8')]('/',auth[_0x1550('0x9')](),controller[_0x1550('0xa')]);router[_0x1550('0x8')](_0x1550('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1550('0xc')]('/',auth[_0x1550('0x9')](),controller[_0x1550('0xd')]);router[_0x1550('0xc')](_0x1550('0xe'),auth[_0x1550('0x9')](),controller['addApplications']);router[_0x1550('0xf')](_0x1550('0xb'),auth['isAuthenticated'](),controller[_0x1550('0x10')]);router[_0x1550('0x11')](_0x1550('0xb'),auth[_0x1550('0x9')](),controller[_0x1550('0x12')]);module[_0x1550('0x13')]=router; \ No newline at end of file +var _0x7c9d=['../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','post','put','update','delete','exports','multer','path','express','Router'];(function(_0x49ca92,_0x445884){var _0xfa3a4d=function(_0x3bbe68){while(--_0x3bbe68){_0x49ca92['push'](_0x49ca92['shift']());}};_0xfa3a4d(++_0x445884);}(_0x7c9d,0xfb));var _0xd7c9=function(_0x2832a8,_0x43424a){_0x2832a8=_0x2832a8-0x0;var _0x5b53cb=_0x7c9d[_0x2832a8];return _0x5b53cb;};'use strict';var multer=require(_0xd7c9('0x0'));var util=require('util');var path=require(_0xd7c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd7c9('0x2'));var router=express[_0xd7c9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd7c9('0x4'));var config=require('../../config/environment');var controller=require(_0xd7c9('0x5'));router[_0xd7c9('0x6')]('/',auth[_0xd7c9('0x7')](),controller[_0xd7c9('0x8')]);router[_0xd7c9('0x6')](_0xd7c9('0x9'),auth[_0xd7c9('0x7')](),controller[_0xd7c9('0xa')]);router['post']('/',auth[_0xd7c9('0x7')](),controller[_0xd7c9('0xb')]);router[_0xd7c9('0xc')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0xd7c9('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd7c9('0xe')]);router[_0xd7c9('0xf')](_0xd7c9('0x9'),auth[_0xd7c9('0x7')](),controller['destroy']);module[_0xd7c9('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d14329c..135eac4 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 _0xc464=['system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x5a4cea,_0x2fc40f){var _0x239ff0=function(_0x179038){while(--_0x179038){_0x5a4cea['push'](_0x5a4cea['shift']());}};_0x239ff0(++_0x2fc40f);}(_0xc464,0x90));var _0x4c46=function(_0x25d17f,_0x14eeb9){_0x25d17f=_0x25d17f-0x0;var _0x4b90f7=_0xc464[_0x25d17f];return _0x4b90f7;};'use strict';var Sequelize=require(_0x4c46('0x0'));module['exports']={'context':{'type':Sequelize[_0x4c46('0x1')],'allowNull':![],'unique':_0x4c46('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4c46('0x1')],'allowNull':![],'unique':_0x4c46('0x2')},'priority':{'type':Sequelize[_0x4c46('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x4c46('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4c46('0x1')],'allowNull':![],'defaultValue':_0x4c46('0x3')},'appdata':{'type':Sequelize[_0x4c46('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4c46('0x4')](_0x4c46('0x5'),'outbound',_0x4c46('0x6'),_0x4c46('0x7'),_0x4c46('0x8'),_0x4c46('0x9'),_0x4c46('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x4c46('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4c46('0xb')},'IntervalId':{'type':Sequelize[_0x4c46('0xc')]},'isApp':{'type':Sequelize[_0x4c46('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4c46('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4c46('0xc')]},'recordingFormat':{'type':Sequelize[_0x4c46('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x4c46('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4c46('0xe')],'get':function(_0x1d52a7){return this[_0x4c46('0xf')](_0x4c46('0x10'));}},'alias':{'type':Sequelize[_0x4c46('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x75ec=['STRING','NoOp','ENUM','inbound','internal','outbound-fax','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','getDataValue','exten','sequelize','exports'];(function(_0x151418,_0x2cbffa){var _0x40e29a=function(_0xec4d7){while(--_0xec4d7){_0x151418['push'](_0x151418['shift']());}};_0x40e29a(++_0x2cbffa);}(_0x75ec,0x1de));var _0xc75e=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x75ec[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0xc75e('0x0'));module[_0xc75e('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xc75e('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xc75e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc75e('0x3')},'appdata':{'type':Sequelize[_0xc75e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc75e('0x4')](_0xc75e('0x5'),'outbound',_0xc75e('0x6'),'inbound-fax',_0xc75e('0x7'),'system',_0xc75e('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xc75e('0x2')]},'interval':{'type':Sequelize[_0xc75e('0x2')],'allowNull':![],'defaultValue':_0xc75e('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xc75e('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc75e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc75e('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc75e('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc75e('0xb')]},'recordingFormat':{'type':Sequelize[_0xc75e('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xc75e('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc75e('0xc')],'get':function(_0x40f8a9){return this[_0xc75e('0xd')](_0xc75e('0xe'));}},'alias':{'type':Sequelize[_0xc75e('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index cf66173..0b18907 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 _0xe312=['limit','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','value','includes','type','find','name','UserProfileResource','send','index','map','VoiceExtension','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','length','include','params','create','body','startsWith','exten','role','user','UserProfileSection','userProfileId','autoAssociation','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','error','stack','lodash','ioredis','../../components/parsers/qs','api','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','count'];(function(_0x3cfc44,_0x275c22){var _0x4f77c2=function(_0x57e6f6){while(--_0x57e6f6){_0x3cfc44['push'](_0x3cfc44['shift']());}};_0x4f77c2(++_0x275c22);}(_0xe312,0x19f));var _0x2e31=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xe312[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x2e31('0x0'));var Redis=require(_0x2e31('0x1'));var qs=require(_0x2e31('0x2'));var logger=require('../../config/logger')(_0x2e31('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2e31('0x4')]=_[_0x2e31('0x5')](config[_0x2e31('0x4')],{'host':_0x2e31('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e31('0x4')]));require('./voiceExtension.socket')[_0x2e31('0x7')](socket);function respondWithStatusCode(_0x109b72,_0xcd27e0){_0xcd27e0=_0xcd27e0||0xcc;return function(_0x5ed6b5){if(_0x5ed6b5){return _0x109b72[_0x2e31('0x8')](_0xcd27e0);}return _0x109b72[_0x2e31('0x9')](_0xcd27e0)[_0x2e31('0xa')]();};}function respondWithResult(_0x24e1cc,_0x344883){_0x344883=_0x344883||0xc8;return function(_0x7be280){if(_0x7be280){return _0x24e1cc['status'](_0x344883)[_0x2e31('0xb')](_0x7be280);}};}function respondWithFilteredResult(_0x29c621,_0x2e9076){return function(_0x33e81b){if(_0x33e81b){var _0x3447e5=typeof _0x2e9076[_0x2e31('0xc')]===_0x2e31('0xd')&&typeof _0x2e9076['limit']===_0x2e31('0xd');var _0x501d13=_0x33e81b[_0x2e31('0xe')];var _0x7b7276=_0x3447e5?0x0:_0x2e9076['offset'];var _0x21e7c1=_0x3447e5?_0x33e81b[_0x2e31('0xe')]:_0x2e9076['offset']+_0x2e9076[_0x2e31('0xf')];var _0x29e46e;if(_0x21e7c1>=_0x501d13){_0x21e7c1=_0x501d13;_0x29e46e=0xc8;}else{_0x29e46e=0xce;}_0x29c621[_0x2e31('0x9')](_0x29e46e);return _0x29c621['set']('Content-Range',_0x7b7276+'-'+_0x21e7c1+'/'+_0x501d13)['json'](_0x33e81b);}return null;};}function removeEntity(_0x3fe228){return function(_0x6300ee){if(_0x6300ee){return _0x6300ee[_0x2e31('0x10')]()[_0x2e31('0x11')](function(){var _0x910571=_0x6300ee[_0x2e31('0x12')]({'plain':!![]});var _0x5a0e4b=[{'name':_0x2e31('0x13'),'value':_0x2e31('0x14'),'ignore':![]},{'name':_0x2e31('0x15'),'value':_0x2e31('0x16'),'ignore':![]},{'name':_0x2e31('0x17'),'value':_0x2e31('0x18'),'ignore':![]}];var _0x4f135b=_(_0x5a0e4b)['filter']('ignore')['map'](_0x2e31('0x19'))[_0x2e31('0x19')]();if(_[_0x2e31('0x1a')](_0x4f135b,_0x910571[_0x2e31('0x1b')])){return;}var _0x1e931a=_[_0x2e31('0x1c')](_0x5a0e4b,[_0x2e31('0x19'),_0x910571[_0x2e31('0x1b')]])[_0x2e31('0x1d')];return db[_0x2e31('0x1e')][_0x2e31('0x10')]({'where':{'type':_0x1e931a,'resourceId':_0x910571['id']}})[_0x2e31('0x11')](function(){return _0x6300ee;});})[_0x2e31('0x11')](function(){_0x3fe228[_0x2e31('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x368e49){return function(_0x5407ed){if(!_0x5407ed){_0x368e49[_0x2e31('0x8')](0x194);}return _0x5407ed;};}function handleError(_0x5c1325,_0x3c8e89){_0x3c8e89=_0x3c8e89||0x1f4;return function(_0x3dca25){logger['error'](_0x3dca25['stack']);if(_0x3dca25[_0x2e31('0x1d')]){delete _0x3dca25[_0x2e31('0x1d')];}_0x5c1325[_0x2e31('0x9')](_0x3c8e89)[_0x2e31('0x1f')](_0x3dca25);};}exports[_0x2e31('0x20')]=function(_0xfb4a1b,_0x140aa1){var _0x35bad2={},_0x4a745f={},_0x1a3b7a={'count':0x0,'rows':[]};var _0x11994d=_[_0x2e31('0x21')](db[_0x2e31('0x22')]['rawAttributes'],function(_0x494018){return{'name':_0x494018['fieldName'],'type':_0x494018[_0x2e31('0x1b')][_0x2e31('0x23')]};});_0x4a745f['model']=_[_0x2e31('0x21')](_0x11994d,_0x2e31('0x1d'));_0x4a745f[_0x2e31('0x24')]=_[_0x2e31('0x25')](_0xfb4a1b[_0x2e31('0x24')]);_0x4a745f[_0x2e31('0x26')]=_[_0x2e31('0x27')](_0x4a745f[_0x2e31('0x28')],_0x4a745f['query']);_0x35bad2[_0x2e31('0x29')]=_[_0x2e31('0x27')](_0x4a745f[_0x2e31('0x28')],qs[_0x2e31('0x2a')](_0xfb4a1b['query'][_0x2e31('0x2a')]));_0x35bad2[_0x2e31('0x29')]=_0x35bad2[_0x2e31('0x29')]['length']?_0x35bad2[_0x2e31('0x29')]:_0x4a745f[_0x2e31('0x28')];if(!_0xfb4a1b[_0x2e31('0x24')][_0x2e31('0x2b')](_0x2e31('0x2c'))){_0x35bad2[_0x2e31('0xf')]=qs[_0x2e31('0xf')](_0xfb4a1b[_0x2e31('0x24')][_0x2e31('0xf')]);_0x35bad2[_0x2e31('0xc')]=qs['offset'](_0xfb4a1b[_0x2e31('0x24')][_0x2e31('0xc')]);}_0x35bad2['order']=qs[_0x2e31('0x2d')](_0xfb4a1b['query'][_0x2e31('0x2d')]);_0x35bad2[_0x2e31('0x2e')]=qs['filters'](_[_0x2e31('0x2f')](_0xfb4a1b[_0x2e31('0x24')],_0x4a745f[_0x2e31('0x26')]),_0x11994d);if(_0xfb4a1b['query']['filter']){_0x35bad2[_0x2e31('0x2e')]=_[_0x2e31('0x30')](_0x35bad2[_0x2e31('0x2e')],{'$or':_[_0x2e31('0x21')](_0x11994d,function(_0x443c55){if(_0x443c55[_0x2e31('0x1b')]!==_0x2e31('0x31')){var _0x198d8f={};_0x198d8f[_0x443c55[_0x2e31('0x1d')]]={'$like':'%'+_0xfb4a1b[_0x2e31('0x24')]['filter']+'%'};return _0x198d8f;}})});}_0x35bad2=_[_0x2e31('0x30')]({},_0x35bad2,_0xfb4a1b[_0x2e31('0x32')]);var _0x552fef={'where':_0x35bad2[_0x2e31('0x2e')]};return db[_0x2e31('0x22')][_0x2e31('0xe')](_0x552fef)[_0x2e31('0x11')](function(_0x4b7927){_0x1a3b7a[_0x2e31('0xe')]=_0x4b7927;if(_0xfb4a1b[_0x2e31('0x24')][_0x2e31('0x33')]){_0x35bad2['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x2e31('0x34')](_0x35bad2);})[_0x2e31('0x11')](function(_0x53a773){_0x1a3b7a[_0x2e31('0x35')]=_0x53a773;return _0x1a3b7a;})['then'](respondWithFilteredResult(_0x140aa1,_0x35bad2))[_0x2e31('0x36')](handleError(_0x140aa1,null));};exports[_0x2e31('0x37')]=function(_0x197a29,_0x3a5e9a){var _0x5a97bc={'raw':![],'where':{'id':_0x197a29['params']['id']}},_0x577858={};_0x577858[_0x2e31('0x28')]=_[_0x2e31('0x25')](db[_0x2e31('0x22')][_0x2e31('0x38')]);_0x577858[_0x2e31('0x24')]=_['keys'](_0x197a29[_0x2e31('0x24')]);_0x577858[_0x2e31('0x26')]=_[_0x2e31('0x27')](_0x577858['model'],_0x577858[_0x2e31('0x24')]);_0x5a97bc[_0x2e31('0x29')]=_[_0x2e31('0x27')](_0x577858[_0x2e31('0x28')],qs[_0x2e31('0x2a')](_0x197a29[_0x2e31('0x24')]['fields']));_0x5a97bc[_0x2e31('0x29')]=_0x5a97bc['attributes'][_0x2e31('0x39')]?_0x5a97bc[_0x2e31('0x29')]:_0x577858[_0x2e31('0x28')];if(_0x197a29[_0x2e31('0x24')][_0x2e31('0x33')]){_0x5a97bc[_0x2e31('0x3a')]=[{'all':!![]}];}_0x5a97bc=_[_0x2e31('0x30')]({},_0x5a97bc,_0x197a29[_0x2e31('0x32')]);return db[_0x2e31('0x22')]['find'](_0x5a97bc)[_0x2e31('0x11')](handleEntityNotFound(_0x3a5e9a,null))[_0x2e31('0x11')](respondWithResult(_0x3a5e9a,null))[_0x2e31('0x36')](handleError(_0x3a5e9a,null));};exports[_0x2e31('0x10')]=function(_0x1d69aa,_0x48157a){return db[_0x2e31('0x22')][_0x2e31('0x1c')]({'where':{'id':_0x1d69aa[_0x2e31('0x3b')]['id']}})[_0x2e31('0x11')](handleEntityNotFound(_0x48157a,null))['then'](removeEntity(_0x48157a,null))[_0x2e31('0x36')](handleError(_0x48157a,null));};exports[_0x2e31('0x3c')]=function(_0x2dbd21,_0x59124a){if(_0x2dbd21[_0x2e31('0x3d')][_0x2e31('0x1b')]==='outbound'&&!_[_0x2e31('0x3e')](_0x2dbd21[_0x2e31('0x3d')]['exten'],'_')){_0x2dbd21['body'][_0x2e31('0x3f')]='_'['concat'](_0x2dbd21['body']['exten']);}return db[_0x2e31('0x22')]['create'](_0x2dbd21[_0x2e31('0x3d')],{'raw':![]})[_0x2e31('0x11')](function(_0x15999f){var _0x3b2f49=_0x2dbd21['user']['get']({'plain':!![]});if(!_0x3b2f49)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b2f49[_0x2e31('0x40')]===_0x2e31('0x41')){var _0x46b866=_0x15999f[_0x2e31('0x12')]({'plain':!![]});var _0x5194d9=[{'name':_0x2e31('0x13'),'value':_0x2e31('0x14')},{'name':_0x2e31('0x15'),'value':_0x2e31('0x16')},{'name':_0x2e31('0x17'),'value':'internal'}];var _0x3cdd7d=_[_0x2e31('0x1c')](_0x5194d9,[_0x2e31('0x19'),_0x46b866[_0x2e31('0x1b')]])['name'];return db[_0x2e31('0x42')][_0x2e31('0x1c')]({'where':{'name':_0x3cdd7d,'userProfileId':_0x3b2f49[_0x2e31('0x43')]},'raw':!![]})['then'](function(_0x5d170c){if(_0x5d170c&&_0x5d170c[_0x2e31('0x44')]===0x0){return db[_0x2e31('0x1e')][_0x2e31('0x3c')]({'name':_0x46b866['name'],'resourceId':_0x46b866['id'],'type':_0x5d170c[_0x2e31('0x1d')],'sectionId':_0x5d170c['id']},{})[_0x2e31('0x11')](function(){return _0x15999f;});}else{return _0x15999f;}})[_0x2e31('0x36')](function(_0x384f2e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x384f2e);throw _0x384f2e;});}return _0x15999f;})['then'](respondWithResult(_0x59124a,0xc9))['catch'](handleError(_0x59124a,null));};exports[_0x2e31('0x45')]=function(_0x3b3a17,_0xd2b092){if(_0x3b3a17[_0x2e31('0x3d')]['id']){delete _0x3b3a17[_0x2e31('0x3d')]['id'];}return db['VoiceExtension'][_0x2e31('0x1c')]({'where':{'id':_0x3b3a17[_0x2e31('0x3b')]['id']}})['then'](handleEntityNotFound(_0xd2b092,null))['then'](function(_0x448755){if(_0x448755){return db['VoiceExtension'][_0x2e31('0x45')](_['pick'](_0x3b3a17[_0x2e31('0x3d')],[_0x2e31('0x3f'),_0x2e31('0x46'),_0x2e31('0x47'),_0x2e31('0x48'),_0x2e31('0x49'),_0x2e31('0x4a'),_0x2e31('0x4b')]),{'where':{'context':_0x448755[_0x2e31('0x46')],'exten':_0x448755['exten']},'individualHooks':!![]})[_0x2e31('0x11')](function(_0x4739c0){return _0x4739c0;});}return null;})[_0x2e31('0x11')](respondWithStatusCode(_0xd2b092,null))[_0x2e31('0x36')](handleError(_0xd2b092,null));};exports['addApplications']=function(_0x4ff03b,_0x1b23fb){var _0x544ca7=_0x4ff03b[_0x2e31('0x3b')]['id'];var _0x3f7f70=_0x4ff03b[_0x2e31('0x3d')];var _0x2406c6=0xc8;var _0xfd5037=null;return db[_0x2e31('0x4c')]['transaction']({'isolationLevel':db[_0x2e31('0x4c')][_0x2e31('0x4d')][_0x2e31('0x4e')]['READ_COMMITTED']},function(_0x7cbb33){return db['VoiceExtension'][_0x2e31('0x4f')]({'where':{'id':_0x544ca7},'transaction':_0x7cbb33})['then'](function(_0xe10a8f){if(_0xe10a8f){return db['VoiceExtension'][_0x2e31('0x10')]({'where':{'VoiceExtensionId':_0x544ca7},'transaction':_0x7cbb33})[_0x2e31('0x11')](function(){var _0xd76bcf=_['map'](_0x3f7f70,function(_0x6bcb36){_0x6bcb36[_0x2e31('0x50')]=_0x544ca7;_0x6bcb36[_0x2e31('0x51')]=!![];return _0x6bcb36;});return _0xe10a8f['createRouting'](_0xd76bcf);})[_0x2e31('0x11')](function(_0x4e7159){return db[_0x2e31('0x22')]['bulkCreate'](_0x4e7159,{'transaction':_0x7cbb33});});}else{_0x2406c6=0x194;_0xfd5037=[];}});})[_0x2e31('0x11')](function(){if(_0x2406c6!==0x194){return db['VoiceExtension'][_0x2e31('0x52')]({'where':{'isApp':!![],'VoiceExtensionId':_0x544ca7},'order':_0x2e31('0x53')})['then'](function(_0x17010d){_0xfd5037=_0x17010d;});}})['catch'](function(_0x394e7e){_0x2406c6=0x1f4;logger[_0x2e31('0x54')](_0x394e7e[_0x2e31('0x55')]);if(_0x394e7e[_0x2e31('0x1d')]){delete _0x394e7e[_0x2e31('0x1d')];}_0xfd5037=_0x394e7e;})['finally'](function(){if(_0xfd5037===null){_0x1b23fb['sendStatus'](_0x2406c6);}else{if(_0x2406c6===0x1f4){_0x1b23fb['status'](_0x2406c6)[_0x2e31('0x1f')](_0xfd5037);}else{_0x1b23fb['status'](_0x2406c6)['json'](_0xfd5037);}}});}; \ No newline at end of file +var _0x4455=['OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','body','outbound','startsWith','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','undefined','limit','offset','count','status','set','json','destroy','then','InboundRoutes','inbound'];(function(_0x1e338c,_0x1b29de){var _0x539c74=function(_0x419d23){while(--_0x419d23){_0x1e338c['push'](_0x1e338c['shift']());}};_0x539c74(++_0x1b29de);}(_0x4455,0x15a));var _0x5445=function(_0x21b75c,_0x5871f2){_0x21b75c=_0x21b75c-0x0;var _0x16ad4b=_0x4455[_0x21b75c];return _0x16ad4b;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x5445('0x0'));var logger=require('../../config/logger')(_0x5445('0x1'));var config=require(_0x5445('0x2'));var db=require(_0x5445('0x3'))['db'];config[_0x5445('0x4')]=_[_0x5445('0x5')](config[_0x5445('0x4')],{'host':_0x5445('0x6'),'port':0x18eb});var socket=require(_0x5445('0x7'))(new Redis(config[_0x5445('0x4')]));require(_0x5445('0x8'))[_0x5445('0x9')](socket);function respondWithStatusCode(_0x255287,_0x3abe83){_0x3abe83=_0x3abe83||0xcc;return function(_0x37921d){if(_0x37921d){return _0x255287[_0x5445('0xa')](_0x3abe83);}return _0x255287['status'](_0x3abe83)['end']();};}function respondWithResult(_0x14c437,_0x5bb2ea){_0x5bb2ea=_0x5bb2ea||0xc8;return function(_0x5d7af9){if(_0x5d7af9){return _0x14c437['status'](_0x5bb2ea)['json'](_0x5d7af9);}};}function respondWithFilteredResult(_0xde0dcf,_0x52a700){return function(_0xee743e){if(_0xee743e){var _0x18cef6=typeof _0x52a700['offset']===_0x5445('0xb')&&typeof _0x52a700[_0x5445('0xc')]===_0x5445('0xb');var _0x2798bc=_0xee743e['count'];var _0x48bccb=_0x18cef6?0x0:_0x52a700[_0x5445('0xd')];var _0x58ab0b=_0x18cef6?_0xee743e[_0x5445('0xe')]:_0x52a700[_0x5445('0xd')]+_0x52a700[_0x5445('0xc')];var _0x279941;if(_0x58ab0b>=_0x2798bc){_0x58ab0b=_0x2798bc;_0x279941=0xc8;}else{_0x279941=0xce;}_0xde0dcf[_0x5445('0xf')](_0x279941);return _0xde0dcf[_0x5445('0x10')]('Content-Range',_0x48bccb+'-'+_0x58ab0b+'/'+_0x2798bc)[_0x5445('0x11')](_0xee743e);}return null;};}function removeEntity(_0x4518a2){return function(_0x11ba8e){if(_0x11ba8e){return _0x11ba8e[_0x5445('0x12')]()[_0x5445('0x13')](function(){var _0x2456c1=_0x11ba8e['get']({'plain':!![]});var _0x1ca80e=[{'name':_0x5445('0x14'),'value':_0x5445('0x15'),'ignore':![]},{'name':_0x5445('0x16'),'value':'outbound','ignore':![]},{'name':_0x5445('0x17'),'value':_0x5445('0x18'),'ignore':![]}];var _0x520653=_(_0x1ca80e)[_0x5445('0x19')](_0x5445('0x1a'))[_0x5445('0x1b')]('value')[_0x5445('0x1c')]();if(_[_0x5445('0x1d')](_0x520653,_0x2456c1[_0x5445('0x1e')])){return;}var _0x5a4453=_[_0x5445('0x1f')](_0x1ca80e,[_0x5445('0x1c'),_0x2456c1[_0x5445('0x1e')]])[_0x5445('0x20')];return db['UserProfileResource']['destroy']({'where':{'type':_0x5a4453,'resourceId':_0x2456c1['id']}})[_0x5445('0x13')](function(){return _0x11ba8e;});})[_0x5445('0x13')](function(){_0x4518a2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a9cb1){return function(_0x15c1b3){if(!_0x15c1b3){_0x1a9cb1['sendStatus'](0x194);}return _0x15c1b3;};}function handleError(_0x355295,_0x39a10b){_0x39a10b=_0x39a10b||0x1f4;return function(_0x57020f){logger[_0x5445('0x21')](_0x57020f['stack']);if(_0x57020f['name']){delete _0x57020f[_0x5445('0x20')];}_0x355295[_0x5445('0xf')](_0x39a10b)[_0x5445('0x22')](_0x57020f);};}exports[_0x5445('0x23')]=function(_0x19433e,_0x38f8d5){var _0x4d86f5={},_0x8d648f={},_0x9cc12a={'count':0x0,'rows':[]};var _0x5e2e3b=_[_0x5445('0x1b')](db[_0x5445('0x24')][_0x5445('0x25')],function(_0x30246d){return{'name':_0x30246d[_0x5445('0x26')],'type':_0x30246d[_0x5445('0x1e')][_0x5445('0x27')]};});_0x8d648f[_0x5445('0x28')]=_['map'](_0x5e2e3b,_0x5445('0x20'));_0x8d648f[_0x5445('0x29')]=_[_0x5445('0x2a')](_0x19433e[_0x5445('0x29')]);_0x8d648f[_0x5445('0x2b')]=_['intersection'](_0x8d648f[_0x5445('0x28')],_0x8d648f[_0x5445('0x29')]);_0x4d86f5[_0x5445('0x2c')]=_[_0x5445('0x2d')](_0x8d648f[_0x5445('0x28')],qs[_0x5445('0x2e')](_0x19433e[_0x5445('0x29')][_0x5445('0x2e')]));_0x4d86f5['attributes']=_0x4d86f5[_0x5445('0x2c')][_0x5445('0x2f')]?_0x4d86f5[_0x5445('0x2c')]:_0x8d648f[_0x5445('0x28')];if(!_0x19433e[_0x5445('0x29')]['hasOwnProperty']('nolimit')){_0x4d86f5['limit']=qs[_0x5445('0xc')](_0x19433e[_0x5445('0x29')][_0x5445('0xc')]);_0x4d86f5[_0x5445('0xd')]=qs[_0x5445('0xd')](_0x19433e[_0x5445('0x29')][_0x5445('0xd')]);}_0x4d86f5[_0x5445('0x30')]=qs['sort'](_0x19433e[_0x5445('0x29')][_0x5445('0x31')]);_0x4d86f5[_0x5445('0x32')]=qs[_0x5445('0x2b')](_[_0x5445('0x33')](_0x19433e['query'],_0x8d648f[_0x5445('0x2b')]),_0x5e2e3b);if(_0x19433e['query'][_0x5445('0x19')]){_0x4d86f5[_0x5445('0x32')]=_[_0x5445('0x34')](_0x4d86f5['where'],{'$or':_[_0x5445('0x1b')](_0x5e2e3b,function(_0x2b0dd1){if(_0x2b0dd1[_0x5445('0x1e')]!==_0x5445('0x35')){var _0x2d867b={};_0x2d867b[_0x2b0dd1[_0x5445('0x20')]]={'$like':'%'+_0x19433e['query'][_0x5445('0x19')]+'%'};return _0x2d867b;}})});}_0x4d86f5=_['merge']({},_0x4d86f5,_0x19433e[_0x5445('0x36')]);var _0x92b7a6={'where':_0x4d86f5['where']};return db[_0x5445('0x24')][_0x5445('0xe')](_0x92b7a6)[_0x5445('0x13')](function(_0xc01598){_0x9cc12a[_0x5445('0xe')]=_0xc01598;if(_0x19433e['query']['includeAll']){_0x4d86f5[_0x5445('0x37')]=[{'all':!![]}];}return db[_0x5445('0x24')][_0x5445('0x38')](_0x4d86f5);})['then'](function(_0x77f9b){_0x9cc12a[_0x5445('0x39')]=_0x77f9b;return _0x9cc12a;})[_0x5445('0x13')](respondWithFilteredResult(_0x38f8d5,_0x4d86f5))[_0x5445('0x3a')](handleError(_0x38f8d5,null));};exports[_0x5445('0x3b')]=function(_0xb62aef,_0xaed558){var _0x1057a5={'raw':![],'where':{'id':_0xb62aef[_0x5445('0x3c')]['id']}},_0x14c5a1={};_0x14c5a1[_0x5445('0x28')]=_[_0x5445('0x2a')](db[_0x5445('0x24')][_0x5445('0x25')]);_0x14c5a1[_0x5445('0x29')]=_[_0x5445('0x2a')](_0xb62aef[_0x5445('0x29')]);_0x14c5a1[_0x5445('0x2b')]=_[_0x5445('0x2d')](_0x14c5a1[_0x5445('0x28')],_0x14c5a1[_0x5445('0x29')]);_0x1057a5[_0x5445('0x2c')]=_[_0x5445('0x2d')](_0x14c5a1[_0x5445('0x28')],qs[_0x5445('0x2e')](_0xb62aef[_0x5445('0x29')]['fields']));_0x1057a5[_0x5445('0x2c')]=_0x1057a5['attributes']['length']?_0x1057a5['attributes']:_0x14c5a1[_0x5445('0x28')];if(_0xb62aef[_0x5445('0x29')][_0x5445('0x3d')]){_0x1057a5[_0x5445('0x37')]=[{'all':!![]}];}_0x1057a5=_[_0x5445('0x34')]({},_0x1057a5,_0xb62aef[_0x5445('0x36')]);return db[_0x5445('0x24')]['find'](_0x1057a5)['then'](handleEntityNotFound(_0xaed558,null))[_0x5445('0x13')](respondWithResult(_0xaed558,null))[_0x5445('0x3a')](handleError(_0xaed558,null));};exports['destroy']=function(_0x2023e2,_0x4c6259){return db[_0x5445('0x24')]['find']({'where':{'id':_0x2023e2[_0x5445('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4c6259,null))[_0x5445('0x13')](removeEntity(_0x4c6259,null))[_0x5445('0x3a')](handleError(_0x4c6259,null));};exports['create']=function(_0x221b0b,_0xced5f6){if(_0x221b0b[_0x5445('0x3e')][_0x5445('0x1e')]===_0x5445('0x3f')&&!_[_0x5445('0x40')](_0x221b0b[_0x5445('0x3e')][_0x5445('0x41')],'_')){_0x221b0b[_0x5445('0x3e')][_0x5445('0x41')]='_'[_0x5445('0x42')](_0x221b0b[_0x5445('0x3e')]['exten']);}return db['VoiceExtension'][_0x5445('0x43')](_0x221b0b['body'],{'raw':![]})[_0x5445('0x13')](function(_0xdf9f4e){var _0x30c169=_0x221b0b[_0x5445('0x44')][_0x5445('0x45')]({'plain':!![]});if(!_0x30c169)throw new Error(_0x5445('0x46'));if(_0x30c169[_0x5445('0x47')]==='user'){var _0x386a1e=_0xdf9f4e[_0x5445('0x45')]({'plain':!![]});var _0x25cf9d=[{'name':_0x5445('0x14'),'value':_0x5445('0x15')},{'name':'OutboundRoutes','value':_0x5445('0x3f')},{'name':_0x5445('0x17'),'value':'internal'}];var _0x19be9e=_['find'](_0x25cf9d,['value',_0x386a1e[_0x5445('0x1e')]])['name'];return db['UserProfileSection'][_0x5445('0x1f')]({'where':{'name':_0x19be9e,'userProfileId':_0x30c169[_0x5445('0x48')]},'raw':!![]})[_0x5445('0x13')](function(_0x171702){if(_0x171702&&_0x171702[_0x5445('0x49')]===0x0){return db['UserProfileResource'][_0x5445('0x43')]({'name':_0x386a1e[_0x5445('0x20')],'resourceId':_0x386a1e['id'],'type':_0x171702[_0x5445('0x20')],'sectionId':_0x171702['id']},{})[_0x5445('0x13')](function(){return _0xdf9f4e;});}else{return _0xdf9f4e;}})[_0x5445('0x3a')](function(_0x505de9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x505de9);throw _0x505de9;});}return _0xdf9f4e;})['then'](respondWithResult(_0xced5f6,0xc9))[_0x5445('0x3a')](handleError(_0xced5f6,null));};exports[_0x5445('0x4a')]=function(_0x5bc254,_0x180a64){if(_0x5bc254[_0x5445('0x3e')]['id']){delete _0x5bc254[_0x5445('0x3e')]['id'];}return db[_0x5445('0x24')][_0x5445('0x1f')]({'where':{'id':_0x5bc254[_0x5445('0x3c')]['id']}})[_0x5445('0x13')](handleEntityNotFound(_0x180a64,null))['then'](function(_0x4998b0){if(_0x4998b0){return db[_0x5445('0x24')][_0x5445('0x4a')](_['pick'](_0x5bc254[_0x5445('0x3e')],[_0x5445('0x41'),'context',_0x5445('0x4b'),_0x5445('0x4c'),_0x5445('0x4d'),_0x5445('0x4e'),_0x5445('0x4f')]),{'where':{'context':_0x4998b0[_0x5445('0x50')],'exten':_0x4998b0[_0x5445('0x41')]},'individualHooks':!![]})[_0x5445('0x13')](function(_0x9b4d34){return _0x9b4d34;});}return null;})[_0x5445('0x13')](respondWithStatusCode(_0x180a64,null))['catch'](handleError(_0x180a64,null));};exports[_0x5445('0x51')]=function(_0x4ae5e3,_0x5193be){var _0x33335c=_0x4ae5e3[_0x5445('0x3c')]['id'];var _0x41cb81=_0x4ae5e3[_0x5445('0x3e')];var _0x28a7db=0xc8;var _0xa411d8=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x5445('0x52')][_0x5445('0x53')]['ISOLATION_LEVELS'][_0x5445('0x54')]},function(_0x202ef1){return db[_0x5445('0x24')][_0x5445('0x55')]({'where':{'id':_0x33335c},'transaction':_0x202ef1})[_0x5445('0x13')](function(_0x3dfe8e){if(_0x3dfe8e){return db['VoiceExtension'][_0x5445('0x12')]({'where':{'VoiceExtensionId':_0x33335c},'transaction':_0x202ef1})[_0x5445('0x13')](function(){var _0x124823=_[_0x5445('0x1b')](_0x41cb81,function(_0x338fea){_0x338fea[_0x5445('0x56')]=_0x33335c;_0x338fea['isApp']=!![];return _0x338fea;});return _0x3dfe8e[_0x5445('0x57')](_0x124823);})[_0x5445('0x13')](function(_0x444f81){return db[_0x5445('0x24')][_0x5445('0x58')](_0x444f81,{'transaction':_0x202ef1});});}else{_0x28a7db=0x194;_0xa411d8=[];}});})[_0x5445('0x13')](function(){if(_0x28a7db!==0x194){return db[_0x5445('0x24')][_0x5445('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x33335c},'order':_0x5445('0x5a')})['then'](function(_0x3b6fd6){_0xa411d8=_0x3b6fd6;});}})[_0x5445('0x3a')](function(_0xf2a6e6){_0x28a7db=0x1f4;logger[_0x5445('0x21')](_0xf2a6e6['stack']);if(_0xf2a6e6[_0x5445('0x20')]){delete _0xf2a6e6[_0x5445('0x20')];}_0xa411d8=_0xf2a6e6;})[_0x5445('0x5b')](function(){if(_0xa411d8===null){_0x5193be[_0x5445('0xa')](_0x28a7db);}else{if(_0x28a7db===0x1f4){_0x5193be[_0x5445('0xf')](_0x28a7db)[_0x5445('0x22')](_0xa411d8);}else{_0x5193be[_0x5445('0xf')](_0x28a7db)[_0x5445('0x11')](_0xa411d8);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 00d96d1..5fcc9c8 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 _0xe638=['exports','events','../../mysqldb','VoiceExtension','update','remove','emit','hasOwnProperty','hook'];(function(_0x373908,_0x454ac1){var _0x40fe46=function(_0x1ab617){while(--_0x1ab617){_0x373908['push'](_0x373908['shift']());}};_0x40fe46(++_0x454ac1);}(_0xe638,0x1cc));var _0x8e63=function(_0x35aca1,_0x3812ac){_0x35aca1=_0x35aca1-0x0;var _0x38c0d0=_0xe638[_0x35aca1];return _0x38c0d0;};'use strict';var EventEmitter=require(_0x8e63('0x0'));var VoiceExtension=require(_0x8e63('0x1'))['db'][_0x8e63('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e63('0x3'),'afterDestroy':_0x8e63('0x4')};function emitEvent(_0x4fc9bb){return function(_0x405ea7,_0x255422,_0x38d955){VoiceExtensionEvents[_0x8e63('0x5')](_0x4fc9bb+':'+_0x405ea7['id'],_0x405ea7);VoiceExtensionEvents[_0x8e63('0x5')](_0x4fc9bb,_0x405ea7);_0x38d955(null);};}for(var e in events){if(events[_0x8e63('0x6')](e)){var event=events[e];VoiceExtension[_0x8e63('0x7')](e,emitEvent(event));}}module[_0x8e63('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x67ee=['events','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xd90262,_0x14586f){var _0x1ddcaf=function(_0x19699a){while(--_0x19699a){_0xd90262['push'](_0xd90262['shift']());}};_0x1ddcaf(++_0x14586f);}(_0x67ee,0x10e));var _0xe67e=function(_0x5cf2dd,_0x180e5a){_0x5cf2dd=_0x5cf2dd-0x0;var _0x3573c8=_0x67ee[_0x5cf2dd];return _0x3573c8;};'use strict';var EventEmitter=require(_0xe67e('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xe67e('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe67e('0x2')](0x0);var events={'afterCreate':_0xe67e('0x3'),'afterUpdate':_0xe67e('0x4'),'afterDestroy':_0xe67e('0x5')};function emitEvent(_0x184080){return function(_0x51550c,_0x5e1021,_0x8b1cb3){VoiceExtensionEvents['emit'](_0x184080+':'+_0x51550c['id'],_0x51550c);VoiceExtensionEvents[_0xe67e('0x6')](_0x184080,_0x51550c);_0x8b1cb3(null);};}for(var e in events){if(events[_0xe67e('0x7')](e)){var event=events[e];VoiceExtension[_0xe67e('0x8')](e,emitEvent(event));}}module[_0xe67e('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 83d31a3..7d6983e 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 _0x44c5=['join','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','push','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','U(xcally-mixmonitor-context)','replace'];(function(_0x24a632,_0x7410d0){var _0x482e91=function(_0x512b5a){while(--_0x512b5a){_0x24a632['push'](_0x24a632['shift']());}};_0x482e91(++_0x7410d0);}(_0x44c5,0x76));var _0x544c=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0x44c5[_0x1bd323];return _0x13097b;};'use strict';var _=require(_0x544c('0x0'));var attributes=require(_0x544c('0x1'));module[_0x544c('0x2')]=function(_0x28d9a3){var _0x544714=_0x28d9a3[_0x544c('0x3')];function _0x4709ca(_0x213d03){var _0x2aacb3=0x2;var _0x18703a=[{'type':_0x213d03[_0x544c('0x4')],'app':_0x544c('0x5'),'appdata':_0x544c('0x6')+_0x213d03[_0x544c('0x4')],'context':_0x213d03[_0x544c('0x7')],'exten':_0x213d03[_0x544c('0x8')],'priority':_0x2aacb3++,'VoiceExtensionId':_0x213d03['id']},{'type':_0x213d03[_0x544c('0x4')],'app':_0x213d03[_0x544c('0x9')]?_0x544c('0x5'):_0x544c('0xa'),'appdata':_0x213d03[_0x544c('0x9')]?'CDR(routeAlias)='+_0x213d03[_0x544c('0x9')]:'No\x20alias\x20set','context':_0x213d03[_0x544c('0x7')],'exten':_0x213d03[_0x544c('0x8')],'priority':_0x2aacb3++,'VoiceExtensionId':_0x213d03['id']}];if(_0x213d03[_0x544c('0x4')]===_0x544c('0xb')){_0x18703a['push']({'type':_0x544c('0xb'),'app':'Set','appdata':_0x544c('0xc')+_0x213d03['id'],'context':_0x213d03['context'],'exten':_0x213d03['exten'],'priority':_0x2aacb3++,'VoiceExtensionId':_0x213d03['id']});}_0x18703a['push']({'type':_0x213d03['type'],'app':_0x544c('0x5'),'appdata':_0x544c('0xd'),'context':_0x213d03[_0x544c('0x7')],'exten':_0x213d03[_0x544c('0x8')],'priority':_0x2aacb3++,'VoiceExtensionId':_0x213d03['id']},{'type':_0x213d03[_0x544c('0x4')],'app':_0x544c('0x5'),'appdata':_0x544c('0xe'),'context':_0x213d03['context'],'exten':_0x213d03[_0x544c('0x8')],'priority':_0x2aacb3++,'VoiceExtensionId':_0x213d03['id']},{'type':_0x213d03['type'],'app':_0x544c('0x5'),'appdata':_0x544c('0xf'),'context':_0x213d03[_0x544c('0x7')],'exten':_0x213d03[_0x544c('0x8')],'priority':_0x2aacb3++,'VoiceExtensionId':_0x213d03['id']});return _0x18703a;}function _0x50ba92(_0x5e253f){var _0x31bf1c=0x2;var _0x5e5478=[{'type':_0x544c('0x10'),'app':_0x544c('0x5'),'appdata':'CDR(type)=outbound','context':_0x5e253f['context'],'exten':_0x5e253f['exten'],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':_0x5e253f[_0x544c('0x9')]?_0x544c('0x5'):_0x544c('0xa'),'appdata':_0x5e253f[_0x544c('0x9')]?_0x544c('0x11')+_0x5e253f['alias']:'No\x20alias\x20set','context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':'Set','appdata':_0x544c('0x12')+(_0x5e253f[_0x544c('0x13')]?_0x544c('0x14')+_0x5e253f[_0x544c('0x13')]+'}':_0x544c('0x15')),'context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':_0x544c('0x5'),'appdata':'CDR(routeid)='+_0x5e253f['id'],'context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':'outbound','app':_0x544c('0x16'),'appdata':_0x544c('0x17')+(_0x31bf1c+0x2)+_0x544c('0x18')+(_0x31bf1c+0x1)+')','context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':'Set','appdata':_0x5e253f[_0x544c('0x13')]?_0x544c('0x19')+_0x5e253f[_0x544c('0x13')]+'}':_0x544c('0x1a'),'context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f['exten'],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':'Set','appdata':_0x544c('0xd'),'context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f['exten'],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':'Set','appdata':_0x544c('0xf'),'context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':'outbound','app':_0x544c('0x5'),'appdata':'outboundrouteid='+_0x5e253f['id'],'context':_0x5e253f['context'],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']}];if(_0x5e253f[_0x544c('0x1b')](_0x544c('0x1c'))&&_0x5e253f['recordingFormat']!==_0x544c('0x1d')){_0x5e5478[_0x544c('0x1e')]({'type':_0x544c('0x10'),'app':_0x544c('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5e253f['context'],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']},{'type':_0x544c('0x10'),'app':_0x544c('0x5'),'appdata':_0x544c('0x1f')+_0x5e253f['recordingFormat']||_0x544c('0x20'),'context':_0x5e253f[_0x544c('0x7')],'exten':_0x5e253f[_0x544c('0x8')],'priority':_0x31bf1c++,'VoiceExtensionId':_0x5e253f['id']});}return _0x5e5478;}function _0x2a51d7(_0x13042b,_0x280ab6){var _0x260602=[{'name':_0x544c('0x21'),'param':0x0},{'name':_0x544c('0x22'),'param':0x1},{'name':_0x544c('0x23'),'param':0x2},{'name':_0x544c('0x24'),'param':0x3}];var _0x5af01b={};var _0x59b095=_0x280ab6[_0x544c('0x25')](',');var _0x4959c0=[];for(var _0x4e9f24=0x0;_0x4e9f24<_0x260602[_0x544c('0x26')];_0x4e9f24++){switch(_0x260602[_0x4e9f24][_0x544c('0x27')]){case _0x544c('0x21'):_0x5af01b[_0x544c('0x21')]=_0x59b095[_0x260602[_0x4e9f24][_0x544c('0x28')]][_0x544c('0x25')]('/')[0x1];_0x5af01b['phone']=_0x59b095[_0x260602[_0x4e9f24][_0x544c('0x28')]][_0x544c('0x25')]('/')[0x2];_0x5af01b['prefix']=_0x5af01b[_0x544c('0x29')]?_0x5af01b['phone'][_0x544c('0x25')]('$')[0x0]:undefined;_0x5af01b[_0x544c('0x29')]=_0x13042b[_0x544c('0x13')]?(_0x5af01b['prefix']||'')+_0x544c('0x14')+_0x13042b[_0x544c('0x13')]+'}':(_0x5af01b[_0x544c('0x2a')]||'')+_0x544c('0x15');_0x4959c0[_0x260602[_0x4e9f24]['param']]=[_0x544c('0x2b'),_0x5af01b[_0x544c('0x21')],_0x5af01b[_0x544c('0x29')]]['join']('/');break;case _0x544c('0x23'):_0x5af01b['options']=_0x59b095[_0x260602[_0x4e9f24][_0x544c('0x28')]];if(_0x13042b['recordingFormat']!==_0x544c('0x1d')){if(_0x5af01b[_0x544c('0x23')]['indexOf'](_0x544c('0x2c'))<0x0){_0x5af01b[_0x544c('0x23')]+='U(xcally-mixmonitor-context)';}}else{_0x5af01b['options']=_0x5af01b[_0x544c('0x23')][_0x544c('0x2d')](_0x544c('0x2c'),'');}_0x4959c0[_0x260602[_0x4e9f24][_0x544c('0x28')]]=_0x5af01b[_0x544c('0x23')];break;default:_0x4959c0[_0x260602[_0x4e9f24][_0x544c('0x28')]]=_0x59b095[_0x260602[_0x4e9f24][_0x544c('0x28')]];}}return _0x4959c0[_0x544c('0x2e')](',');}function _0x4785c5(_0x121fed,_0x18af52,_0x2914b8){return new Promise(function(_0xbcd16e,_0x4ad547){var _0x201e19=[];if(_[_0x544c('0x2f')](_0x18af52))return _0xbcd16e(_0x201e19);_0x544714[_0x544c('0x30')][_0x544c('0x31')]({'attributes':['id',_0x544c('0x32'),_0x544c('0x33')],'raw':!![]})[_0x544c('0x34')](function(_0x2e7e54){for(var _0x3186f1=0x0,_0x463208=0x0;_0x3186f1<_0x18af52[_0x544c('0x26')];_0x3186f1++,_0x463208=0x0){var _0x2584eb=_0x18af52[_0x3186f1];var _0x10ffb5=[];var _0x3f2e7b=[];delete _0x2584eb['id'];if(_0x2584eb[_0x544c('0x32')]!==_0x544c('0x35')){_0x2584eb[_0x544c('0x36')]=[_0x2584eb[_0x544c('0x32')]];}else{_0x2584eb['intervals']=_0x2584eb[_0x544c('0x33')]?_['map'](_[_0x544c('0x37')](_0x2e7e54,{'IntervalId':_0x2584eb[_0x544c('0x33')]}),_0x544c('0x32')):[];}_0x2584eb[_0x544c('0x7')]=_0x121fed['context'];_0x2584eb[_0x544c('0x8')]=_0x121fed[_0x544c('0x8')];if(_0x2584eb[_0x544c('0x4')])_0x2584eb[_0x544c('0x4')]=_0x2584eb[_0x544c('0x4')][_0x544c('0x38')]();if(_0x121fed[_0x544c('0x4')]==='outbound'){if(_0x2584eb[_0x544c('0x1b')]('tag')&&_0x2584eb['tag']&&_0x2584eb[_0x544c('0x39')]!=='--'){_0x10ffb5['push']({'type':_0x2584eb[_0x544c('0x4')][_0x544c('0x38')](),'app':_0x544c('0x5'),'appdata':_0x544c('0x3a')+_0x2584eb['tag'],'context':_0x121fed['context'],'exten':_0x121fed['exten'],'priority':_0x2584eb['intervals'][_0x544c('0x26')]+_0x2914b8+_0x463208++,'VoiceExtensionId':_0x121fed['id']});}_0x10ffb5[_0x544c('0x1e')]({'type':_0x2584eb[_0x544c('0x4')][_0x544c('0x38')](),'app':_0x544c('0x16'),'appdata':_0x544c('0x3b')+(_0x2584eb[_0x544c('0x3c')]?_0x544c('0x3d')+_0x2584eb['callerID']+')':_0x544c('0x3e')),'context':_0x121fed[_0x544c('0x7')],'exten':_0x121fed[_0x544c('0x8')],'priority':_0x2584eb[_0x544c('0x36')][_0x544c('0x26')]+_0x2914b8+_0x463208++,'VoiceExtensionId':_0x121fed['id']});}else{if(_0x2584eb[_0x544c('0x1b')]('answer')){if(['queue',_0x544c('0x3f')][_0x544c('0x40')](_0x2584eb[_0x544c('0x41')][_0x544c('0x38')]())&&_0x2584eb[_0x544c('0x42')]!=='custom'){if(_0x2584eb['answer']){_0x10ffb5['push']({'type':_0x2584eb[_0x544c('0x4')][_0x544c('0x38')](),'app':_0x544c('0x16'),'appdata':_0x544c('0x43'),'context':_0x121fed['context'],'exten':_0x121fed[_0x544c('0x8')],'priority':_0x2584eb[_0x544c('0x36')][_0x544c('0x26')]+_0x2914b8+_0x463208++,'VoiceExtensionId':_0x121fed['id']});_0x10ffb5[_0x544c('0x1e')]({'type':_0x2584eb[_0x544c('0x4')][_0x544c('0x38')](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x121fed[_0x544c('0x7')],'exten':_0x121fed[_0x544c('0x8')],'priority':_0x2584eb['intervals'][_0x544c('0x26')]+_0x2914b8+_0x463208++,'VoiceExtensionId':_0x121fed['id']});}else{_0x10ffb5['push']({'type':_0x2584eb[_0x544c('0x4')][_0x544c('0x38')](),'app':_0x544c('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x121fed[_0x544c('0x7')],'exten':_0x121fed['exten'],'priority':_0x2584eb[_0x544c('0x36')][_0x544c('0x26')]+_0x2914b8+_0x463208++,'VoiceExtensionId':_0x121fed['id']});_0x10ffb5['push']({'type':_0x2584eb['type'][_0x544c('0x38')](),'app':_0x544c('0x5'),'appdata':_0x544c('0x44'),'context':_0x121fed[_0x544c('0x7')],'exten':_0x121fed['exten'],'priority':_0x2584eb['intervals']['length']+_0x2914b8+_0x463208++,'VoiceExtensionId':_0x121fed['id']});}}}}for(var _0x383385=0x0;_0x383385<_0x2584eb['intervals']['length'];_0x383385++){var _0x445e45=_0x2914b8+_0x2584eb[_0x544c('0x36')][_0x544c('0x26')];var _0x4569c8=_0x383385===_0x2584eb['intervals'][_0x544c('0x26')]-0x1?_0x2914b8+_0x10ffb5[_0x544c('0x26')]+_0x3f2e7b['length']+0x2:_0x2914b8+_0x383385+0x1;_0x10ffb5[_0x544c('0x45')](_0x383385,0x0,{'type':_0x121fed[_0x544c('0x4')],'app':_0x544c('0x46'),'appdata':_0x2584eb[_0x544c('0x36')][_0x383385]+'?'+_0x121fed[_0x544c('0x7')]+_0x544c('0x47')+_0x445e45+':'+_0x121fed[_0x544c('0x7')]+',${EXTEN},'+_0x4569c8,'exten':_0x121fed['exten'],'context':_0x121fed[_0x544c('0x7')],'priority':_0x2914b8+_0x383385,'VoiceExtensionId':_0x121fed['id']});}if(_0x2584eb[_0x544c('0x42')]==='outboundDial')_0x2584eb[_0x544c('0x48')]=_0x2a51d7(_0x121fed,_0x2584eb[_0x544c('0x48')]);_0x2584eb[_0x544c('0x49')]=_0x10ffb5[_0x544c('0x26')]?_[_0x544c('0x4a')](_0x10ffb5)[_0x544c('0x49')]+0x1:_0x2914b8;_0x201e19=_[_0x544c('0x4b')](_0x201e19,_0x10ffb5,[_0x2584eb],_0x3f2e7b);_0x2914b8=_['last'](_0x201e19)[_0x544c('0x49')]+0x1;}return _0xbcd16e(_0x201e19);})[_0x544c('0x4c')](function(_0x13aaca){_0x4ad547(_0x13aaca);});});}return _0x28d9a3[_0x544c('0x4d')](_0x544c('0x4e'),attributes,{'tableName':_0x544c('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x44504f){var _0xb6827=this[_0x544c('0x50')]({'plain':!![]});var _0x2202f5=_0xb6827['type']===_0x544c('0x10')?_0x50ba92(_0xb6827):_0x4709ca(_0xb6827);return _0x4785c5(_0xb6827,_0x44504f,_[_0x544c('0x4a')](_0x2202f5)[_0x544c('0x49')]+0x1)[_0x544c('0x34')](function(_0x2ad482){var _0x383aa1=_[_0x544c('0x4b')](_0x2202f5,_0x2ad482);_0x383aa1['push']({'type':_0xb6827['type'],'app':_0x544c('0x51'),'exten':_0xb6827[_0x544c('0x8')],'context':_0xb6827[_0x544c('0x7')],'priority':_['last'](_0x383aa1)['priority']+0x1,'VoiceExtensionId':_0xb6827['id']});return _0x383aa1;});}}});}; \ No newline at end of file +var _0xd493=['IntervalId','then','length','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','outboundDial','appdata','priority','last','define','voice_extensions','concat','Hangup','lodash','exports','models','CDR(type)=','type','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','options','url','name','param','split','prefix','phone','SIP','join','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval'];(function(_0x28d5fa,_0x1119c4){var _0x44cc54=function(_0x812b97){while(--_0x812b97){_0x28d5fa['push'](_0x28d5fa['shift']());}};_0x44cc54(++_0x1119c4);}(_0xd493,0x1bd));var _0x3d49=function(_0x4e7d5d,_0x1a3ceb){_0x4e7d5d=_0x4e7d5d-0x0;var _0x5f1719=_0xd493[_0x4e7d5d];return _0x5f1719;};'use strict';var _=require(_0x3d49('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x3d49('0x1')]=function(_0x14193e){var _0x55cb43=_0x14193e[_0x3d49('0x2')];function _0x4a877d(_0x58dce8){var _0x439989=0x2;var _0xab52eb=[{'type':_0x58dce8['type'],'app':'Set','appdata':_0x3d49('0x3')+_0x58dce8[_0x3d49('0x4')],'context':_0x58dce8[_0x3d49('0x5')],'exten':_0x58dce8[_0x3d49('0x6')],'priority':_0x439989++,'VoiceExtensionId':_0x58dce8['id']},{'type':_0x58dce8['type'],'app':_0x58dce8[_0x3d49('0x7')]?_0x3d49('0x8'):_0x3d49('0x9'),'appdata':_0x58dce8[_0x3d49('0x7')]?_0x3d49('0xa')+_0x58dce8[_0x3d49('0x7')]:_0x3d49('0xb'),'context':_0x58dce8[_0x3d49('0x5')],'exten':_0x58dce8[_0x3d49('0x6')],'priority':_0x439989++,'VoiceExtensionId':_0x58dce8['id']}];if(_0x58dce8[_0x3d49('0x4')]==='inbound'){_0xab52eb[_0x3d49('0xc')]({'type':'inbound','app':_0x3d49('0x8'),'appdata':_0x3d49('0xd')+_0x58dce8['id'],'context':_0x58dce8[_0x3d49('0x5')],'exten':_0x58dce8[_0x3d49('0x6')],'priority':_0x439989++,'VoiceExtensionId':_0x58dce8['id']});}_0xab52eb[_0x3d49('0xc')]({'type':_0x58dce8[_0x3d49('0x4')],'app':_0x3d49('0x8'),'appdata':_0x3d49('0xe'),'context':_0x58dce8[_0x3d49('0x5')],'exten':_0x58dce8[_0x3d49('0x6')],'priority':_0x439989++,'VoiceExtensionId':_0x58dce8['id']},{'type':_0x58dce8[_0x3d49('0x4')],'app':_0x3d49('0x8'),'appdata':_0x3d49('0xf'),'context':_0x58dce8['context'],'exten':_0x58dce8[_0x3d49('0x6')],'priority':_0x439989++,'VoiceExtensionId':_0x58dce8['id']},{'type':_0x58dce8[_0x3d49('0x4')],'app':_0x3d49('0x8'),'appdata':_0x3d49('0x10'),'context':_0x58dce8[_0x3d49('0x5')],'exten':_0x58dce8[_0x3d49('0x6')],'priority':_0x439989++,'VoiceExtensionId':_0x58dce8['id']});return _0xab52eb;}function _0x296b8d(_0x30f01c){var _0x7126d5=0x2;var _0x55c868=[{'type':_0x3d49('0x11'),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x12'),'context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c['exten'],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x30f01c[_0x3d49('0x7')]?_0x3d49('0x8'):'NoOp','appdata':_0x30f01c[_0x3d49('0x7')]?'CDR(routeAlias)='+_0x30f01c['alias']:_0x3d49('0xb'),'context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x13')+(_0x30f01c['cutdigits']?_0x3d49('0x14')+_0x30f01c[_0x3d49('0x15')]+'}':_0x3d49('0x16')),'context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':'outbound','app':_0x3d49('0x8'),'appdata':_0x3d49('0xd')+_0x30f01c['id'],'context':_0x30f01c['context'],'exten':_0x30f01c['exten'],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x3d49('0x17'),'appdata':_0x3d49('0x18')+(_0x7126d5+0x2)+_0x3d49('0x19')+(_0x7126d5+0x1)+')','context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':'outbound','app':_0x3d49('0x8'),'appdata':_0x30f01c['cutdigits']?_0x3d49('0x1a')+_0x30f01c['cutdigits']+'}':_0x3d49('0x1b'),'context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c['exten'],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x3d49('0x8'),'appdata':_0x3d49('0xe'),'context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x3d49('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x10'),'context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x1c')+_0x30f01c['id'],'context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']}];if(_0x30f01c['hasOwnProperty'](_0x3d49('0x1d'))&&_0x30f01c[_0x3d49('0x1d')]!==_0x3d49('0x1e')){_0x55c868['push']({'type':_0x3d49('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x30f01c['context'],'exten':_0x30f01c['exten'],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']},{'type':_0x3d49('0x11'),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x1f')+_0x30f01c[_0x3d49('0x1d')]||'wav','context':_0x30f01c[_0x3d49('0x5')],'exten':_0x30f01c[_0x3d49('0x6')],'priority':_0x7126d5++,'VoiceExtensionId':_0x30f01c['id']});}return _0x55c868;}function _0x239a6b(_0x509f6f,_0x49ac01){var _0x25c426=[{'name':_0x3d49('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x3d49('0x21'),'param':0x2},{'name':_0x3d49('0x22'),'param':0x3}];var _0x47085f={};var _0xeaa04e=_0x49ac01['split'](',');var _0x31593b=[];for(var _0x502b83=0x0;_0x502b83<_0x25c426['length'];_0x502b83++){switch(_0x25c426[_0x502b83][_0x3d49('0x23')]){case'trunk':_0x47085f[_0x3d49('0x20')]=_0xeaa04e[_0x25c426[_0x502b83][_0x3d49('0x24')]][_0x3d49('0x25')]('/')[0x1];_0x47085f['phone']=_0xeaa04e[_0x25c426[_0x502b83]['param']][_0x3d49('0x25')]('/')[0x2];_0x47085f[_0x3d49('0x26')]=_0x47085f[_0x3d49('0x27')]?_0x47085f[_0x3d49('0x27')]['split']('$')[0x0]:undefined;_0x47085f[_0x3d49('0x27')]=_0x509f6f[_0x3d49('0x15')]?(_0x47085f[_0x3d49('0x26')]||'')+_0x3d49('0x14')+_0x509f6f[_0x3d49('0x15')]+'}':(_0x47085f[_0x3d49('0x26')]||'')+_0x3d49('0x16');_0x31593b[_0x25c426[_0x502b83][_0x3d49('0x24')]]=[_0x3d49('0x28'),_0x47085f[_0x3d49('0x20')],_0x47085f['phone']][_0x3d49('0x29')]('/');break;case _0x3d49('0x21'):_0x47085f[_0x3d49('0x21')]=_0xeaa04e[_0x25c426[_0x502b83][_0x3d49('0x24')]];if(_0x509f6f['recordingFormat']!==_0x3d49('0x1e')){if(_0x47085f[_0x3d49('0x21')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x47085f[_0x3d49('0x21')]+=_0x3d49('0x2a');}}else{_0x47085f[_0x3d49('0x21')]=_0x47085f[_0x3d49('0x21')]['replace'](_0x3d49('0x2a'),'');}_0x31593b[_0x25c426[_0x502b83][_0x3d49('0x24')]]=_0x47085f[_0x3d49('0x21')];break;default:_0x31593b[_0x25c426[_0x502b83][_0x3d49('0x24')]]=_0xeaa04e[_0x25c426[_0x502b83][_0x3d49('0x24')]];}}return _0x31593b['join'](',');}function _0x4d68f1(_0x49bd6a,_0x215dfa,_0x53c06a){return new Promise(function(_0x5776b6,_0x14007d){var _0x11629a=[];if(_[_0x3d49('0x2b')](_0x215dfa))return _0x5776b6(_0x11629a);_0x55cb43[_0x3d49('0x2c')][_0x3d49('0x2d')]({'attributes':['id',_0x3d49('0x2e'),_0x3d49('0x2f')],'raw':!![]})[_0x3d49('0x30')](function(_0xe2d6a5){for(var _0x26a5c2=0x0,_0x59d5f4=0x0;_0x26a5c2<_0x215dfa[_0x3d49('0x31')];_0x26a5c2++,_0x59d5f4=0x0){var _0xff64ba=_0x215dfa[_0x26a5c2];var _0x392215=[];var _0x1df8ad=[];delete _0xff64ba['id'];if(_0xff64ba[_0x3d49('0x2e')]!==_0x3d49('0x32')){_0xff64ba[_0x3d49('0x33')]=[_0xff64ba[_0x3d49('0x2e')]];}else{_0xff64ba['intervals']=_0xff64ba[_0x3d49('0x2f')]?_[_0x3d49('0x34')](_[_0x3d49('0x35')](_0xe2d6a5,{'IntervalId':_0xff64ba['IntervalId']}),_0x3d49('0x2e')):[];}_0xff64ba[_0x3d49('0x5')]=_0x49bd6a['context'];_0xff64ba[_0x3d49('0x6')]=_0x49bd6a[_0x3d49('0x6')];if(_0xff64ba['type'])_0xff64ba[_0x3d49('0x4')]=_0xff64ba[_0x3d49('0x4')][_0x3d49('0x36')]();if(_0x49bd6a[_0x3d49('0x4')]===_0x3d49('0x11')){if(_0xff64ba[_0x3d49('0x37')](_0x3d49('0x38'))&&_0xff64ba[_0x3d49('0x38')]&&_0xff64ba[_0x3d49('0x38')]!=='--'){_0x392215['push']({'type':_0xff64ba['type'][_0x3d49('0x36')](),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x39')+_0xff64ba[_0x3d49('0x38')],'context':_0x49bd6a[_0x3d49('0x5')],'exten':_0x49bd6a['exten'],'priority':_0xff64ba[_0x3d49('0x33')]['length']+_0x53c06a+_0x59d5f4++,'VoiceExtensionId':_0x49bd6a['id']});}_0x392215[_0x3d49('0xc')]({'type':_0xff64ba[_0x3d49('0x4')][_0x3d49('0x36')](),'app':_0x3d49('0x17'),'appdata':_0x3d49('0x3a')+(_0xff64ba[_0x3d49('0x3b')]?_0x3d49('0x3c')+_0xff64ba[_0x3d49('0x3b')]+')':_0x3d49('0x3d')),'context':_0x49bd6a['context'],'exten':_0x49bd6a[_0x3d49('0x6')],'priority':_0xff64ba[_0x3d49('0x33')][_0x3d49('0x31')]+_0x53c06a+_0x59d5f4++,'VoiceExtensionId':_0x49bd6a['id']});}else{if(_0xff64ba[_0x3d49('0x37')](_0x3d49('0x3e'))){if([_0x3d49('0x3f'),_0x3d49('0x40')][_0x3d49('0x41')](_0xff64ba[_0x3d49('0x42')][_0x3d49('0x36')]())&&_0xff64ba[_0x3d49('0x43')]!==_0x3d49('0x44')){if(_0xff64ba[_0x3d49('0x3e')]){_0x392215[_0x3d49('0xc')]({'type':_0xff64ba['type'][_0x3d49('0x36')](),'app':_0x3d49('0x17'),'appdata':_0x3d49('0x45'),'context':_0x49bd6a[_0x3d49('0x5')],'exten':_0x49bd6a[_0x3d49('0x6')],'priority':_0xff64ba[_0x3d49('0x33')]['length']+_0x53c06a+_0x59d5f4++,'VoiceExtensionId':_0x49bd6a['id']});_0x392215[_0x3d49('0xc')]({'type':_0xff64ba[_0x3d49('0x4')][_0x3d49('0x36')](),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x46'),'context':_0x49bd6a[_0x3d49('0x5')],'exten':_0x49bd6a[_0x3d49('0x6')],'priority':_0xff64ba[_0x3d49('0x33')][_0x3d49('0x31')]+_0x53c06a+_0x59d5f4++,'VoiceExtensionId':_0x49bd6a['id']});}else{_0x392215[_0x3d49('0xc')]({'type':_0xff64ba[_0x3d49('0x4')]['toLowerCase'](),'app':_0x3d49('0x17'),'appdata':_0x3d49('0x47'),'context':_0x49bd6a[_0x3d49('0x5')],'exten':_0x49bd6a['exten'],'priority':_0xff64ba[_0x3d49('0x33')][_0x3d49('0x31')]+_0x53c06a+_0x59d5f4++,'VoiceExtensionId':_0x49bd6a['id']});_0x392215[_0x3d49('0xc')]({'type':_0xff64ba[_0x3d49('0x4')][_0x3d49('0x36')](),'app':_0x3d49('0x8'),'appdata':_0x3d49('0x48'),'context':_0x49bd6a[_0x3d49('0x5')],'exten':_0x49bd6a[_0x3d49('0x6')],'priority':_0xff64ba[_0x3d49('0x33')][_0x3d49('0x31')]+_0x53c06a+_0x59d5f4++,'VoiceExtensionId':_0x49bd6a['id']});}}}}for(var _0x4ab50e=0x0;_0x4ab50e<_0xff64ba[_0x3d49('0x33')]['length'];_0x4ab50e++){var _0x43a1b6=_0x53c06a+_0xff64ba['intervals'][_0x3d49('0x31')];var _0x89c85a=_0x4ab50e===_0xff64ba[_0x3d49('0x33')]['length']-0x1?_0x53c06a+_0x392215[_0x3d49('0x31')]+_0x1df8ad[_0x3d49('0x31')]+0x2:_0x53c06a+_0x4ab50e+0x1;_0x392215['splice'](_0x4ab50e,0x0,{'type':_0x49bd6a['type'],'app':'GotoIfTime','appdata':_0xff64ba[_0x3d49('0x33')][_0x4ab50e]+'?'+_0x49bd6a[_0x3d49('0x5')]+_0x3d49('0x49')+_0x43a1b6+':'+_0x49bd6a['context']+_0x3d49('0x49')+_0x89c85a,'exten':_0x49bd6a[_0x3d49('0x6')],'context':_0x49bd6a['context'],'priority':_0x53c06a+_0x4ab50e,'VoiceExtensionId':_0x49bd6a['id']});}if(_0xff64ba[_0x3d49('0x43')]===_0x3d49('0x4a'))_0xff64ba['appdata']=_0x239a6b(_0x49bd6a,_0xff64ba[_0x3d49('0x4b')]);_0xff64ba[_0x3d49('0x4c')]=_0x392215['length']?_[_0x3d49('0x4d')](_0x392215)[_0x3d49('0x4c')]+0x1:_0x53c06a;_0x11629a=_['concat'](_0x11629a,_0x392215,[_0xff64ba],_0x1df8ad);_0x53c06a=_['last'](_0x11629a)[_0x3d49('0x4c')]+0x1;}return _0x5776b6(_0x11629a);})['catch'](function(_0x538078){_0x14007d(_0x538078);});});}return _0x14193e[_0x3d49('0x4e')]('VoiceExtension',attributes,{'tableName':_0x3d49('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x305d05){var _0x1fba20=this['get']({'plain':!![]});var _0x218e9e=_0x1fba20[_0x3d49('0x4')]===_0x3d49('0x11')?_0x296b8d(_0x1fba20):_0x4a877d(_0x1fba20);return _0x4d68f1(_0x1fba20,_0x305d05,_[_0x3d49('0x4d')](_0x218e9e)['priority']+0x1)[_0x3d49('0x30')](function(_0x372e2b){var _0x1d5d22=_[_0x3d49('0x50')](_0x218e9e,_0x372e2b);_0x1d5d22[_0x3d49('0xc')]({'type':_0x1fba20[_0x3d49('0x4')],'app':_0x3d49('0x51'),'exten':_0x1fba20[_0x3d49('0x6')],'context':_0x1fba20[_0x3d49('0x5')],'priority':_[_0x3d49('0x4d')](_0x1d5d22)[_0x3d49('0x4c')]+0x1,'VoiceExtensionId':_0x1fba20['id']});return _0x1d5d22;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 88ca5f9..8e73dc5 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 _0x7d10=['request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then'];(function(_0x2de602,_0x365d80){var _0x5eceae=function(_0x50b78d){while(--_0x50b78d){_0x2de602['push'](_0x2de602['shift']());}};_0x5eceae(++_0x365d80);}(_0x7d10,0x1ce));var _0x07d1=function(_0x67cfd4,_0x2fd916){_0x67cfd4=_0x67cfd4-0x0;var _0x474365=_0x7d10[_0x67cfd4];return _0x474365;};'use strict';var _=require('lodash');var util=require(_0x07d1('0x0'));var moment=require(_0x07d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x07d1('0x2'));var fs=require('fs');var Redis=require(_0x07d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x07d1('0x4'));var logger=require(_0x07d1('0x5'))('rpc');var config=require(_0x07d1('0x6'));var jayson=require(_0x07d1('0x7'));var client=jayson[_0x07d1('0x8')][_0x07d1('0x9')]({'port':0x232a});config['redis']=_[_0x07d1('0xa')](config[_0x07d1('0xb')],{'host':_0x07d1('0xc'),'port':0x18eb});var socket=require(_0x07d1('0xd'))(new Redis(config[_0x07d1('0xb')]));require(_0x07d1('0xe'))[_0x07d1('0xf')](socket);function respondWithRpcPromise(_0x42bf2b,_0x370103,_0x40eccc){return new BPromise(function(_0x259865,_0x33abbd){return client[_0x07d1('0x10')](_0x42bf2b,_0x40eccc)[_0x07d1('0x11')](function(_0x40ccbd){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x370103,_0x07d1('0x12'));logger[_0x07d1('0x13')](_0x07d1('0x14'),_0x370103,_0x07d1('0x12'),JSON[_0x07d1('0x15')](_0x40ccbd));if(_0x40ccbd[_0x07d1('0x16')]){if(_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x17')]===0x1f4){logger[_0x07d1('0x16')](_0x07d1('0x18'),_0x370103,_0x40ccbd['error'][_0x07d1('0x19')]);return _0x33abbd(_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x19')]);}logger[_0x07d1('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x370103,_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x19')]);return _0x259865(_0x40ccbd[_0x07d1('0x16')]['message']);}else{logger[_0x07d1('0x1a')](_0x07d1('0x18'),_0x370103,_0x07d1('0x12'));_0x259865(_0x40ccbd[_0x07d1('0x1b')][_0x07d1('0x19')]);}})[_0x07d1('0x1c')](function(_0x234d47){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x370103,_0x234d47);_0x33abbd(_0x234d47);});});}exports[_0x07d1('0x1d')]=function(_0x4aed02){var _0xf369a1=this;return new Promise(function(_0x550c7f,_0x2b5153){return db[_0x07d1('0x1e')][_0x07d1('0x1f')]({'raw':_0x4aed02[_0x07d1('0x20')]?_0x4aed02[_0x07d1('0x20')][_0x07d1('0x21')]===undefined?!![]:![]:!![],'where':_0x4aed02[_0x07d1('0x20')]?_0x4aed02[_0x07d1('0x20')][_0x07d1('0x22')]||null:null,'attributes':_0x4aed02['options']?_0x4aed02['options']['attributes']||null:null,'limit':_0x4aed02[_0x07d1('0x20')]?_0x4aed02['options'][_0x07d1('0x23')]||null:null,'include':_0x4aed02[_0x07d1('0x20')]?_0x4aed02[_0x07d1('0x20')][_0x07d1('0x24')]?_[_0x07d1('0x25')](_0x4aed02['options'][_0x07d1('0x24')],function(_0x16b55c){return{'model':db[_0x16b55c[_0x07d1('0x26')]],'as':_0x16b55c['as'],'attributes':_0x16b55c[_0x07d1('0x27')],'include':_0x16b55c[_0x07d1('0x24')]?_['map'](_0x16b55c[_0x07d1('0x24')],function(_0x16a56a){return{'model':db[_0x16a56a[_0x07d1('0x26')]],'as':_0x16a56a['as'],'attributes':_0x16a56a[_0x07d1('0x27')],'include':_0x16a56a[_0x07d1('0x24')]?_['map'](_0x16a56a['include'],function(_0x3a0254){return{'model':db[_0x3a0254[_0x07d1('0x26')]],'as':_0x3a0254['as'],'attributes':_0x3a0254['attributes']};}):[]};}):[]};}):[]:[]})[_0x07d1('0x11')](function(_0x12cb9c){logger['info']('GetVoiceExtension',_0x4aed02);logger['debug']('GetVoiceExtension',_0x4aed02,JSON[_0x07d1('0x15')](_0x12cb9c));_0x550c7f(_0x12cb9c);})['catch'](function(_0x3e8136){logger[_0x07d1('0x16')](_0x07d1('0x1d'),_0x3e8136[_0x07d1('0x19')],_0x4aed02);_0x2b5153(_0xf369a1[_0x07d1('0x16')](0x1f4,_0x3e8136['message']));});});}; \ No newline at end of file +var _0xd69e=['./voiceExtension.socket','register','then','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','randomstring','ioredis','../../config/environment','http','redis','defaults','socket.io-emitter'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd69e,0xa0));var _0xed69=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd69e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var moment=require(_0xed69('0x2'));var BPromise=require('bluebird');var rs=require(_0xed69('0x3'));var fs=require('fs');var Redis=require(_0xed69('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xed69('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xed69('0x6')]({'port':0x232a});config[_0xed69('0x7')]=_[_0xed69('0x8')](config[_0xed69('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xed69('0x9'))(new Redis(config['redis']));require(_0xed69('0xa'))[_0xed69('0xb')](socket);function respondWithRpcPromise(_0x47da53,_0x2dc08a,_0x1eb1f8){return new BPromise(function(_0x4ebc85,_0x51e609){return client['request'](_0x47da53,_0x1eb1f8)[_0xed69('0xc')](function(_0x218c3c){logger['info'](_0xed69('0xd'),_0x2dc08a,'request\x20sent');logger[_0xed69('0xe')](_0xed69('0xf'),_0x2dc08a,_0xed69('0x10'),JSON['stringify'](_0x218c3c));if(_0x218c3c['error']){if(_0x218c3c[_0xed69('0x11')][_0xed69('0x12')]===0x1f4){logger[_0xed69('0x11')](_0xed69('0xd'),_0x2dc08a,_0x218c3c[_0xed69('0x11')]['message']);return _0x51e609(_0x218c3c[_0xed69('0x11')][_0xed69('0x13')]);}logger[_0xed69('0x11')](_0xed69('0xd'),_0x2dc08a,_0x218c3c[_0xed69('0x11')][_0xed69('0x13')]);return _0x4ebc85(_0x218c3c[_0xed69('0x11')][_0xed69('0x13')]);}else{logger[_0xed69('0x14')](_0xed69('0xd'),_0x2dc08a,'request\x20sent');_0x4ebc85(_0x218c3c['result']['message']);}})[_0xed69('0x15')](function(_0x2cd704){logger[_0xed69('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x2dc08a,_0x2cd704);_0x51e609(_0x2cd704);});});}exports[_0xed69('0x16')]=function(_0x11c1fc){var _0x589f07=this;return new Promise(function(_0x3ed869,_0x10285d){return db[_0xed69('0x17')][_0xed69('0x18')]({'raw':_0x11c1fc['options']?_0x11c1fc[_0xed69('0x19')][_0xed69('0x1a')]===undefined?!![]:![]:!![],'where':_0x11c1fc['options']?_0x11c1fc[_0xed69('0x19')][_0xed69('0x1b')]||null:null,'attributes':_0x11c1fc[_0xed69('0x19')]?_0x11c1fc[_0xed69('0x19')][_0xed69('0x1c')]||null:null,'limit':_0x11c1fc[_0xed69('0x19')]?_0x11c1fc['options'][_0xed69('0x1d')]||null:null,'include':_0x11c1fc[_0xed69('0x19')]?_0x11c1fc[_0xed69('0x19')][_0xed69('0x1e')]?_[_0xed69('0x1f')](_0x11c1fc[_0xed69('0x19')][_0xed69('0x1e')],function(_0x1e34c8){return{'model':db[_0x1e34c8[_0xed69('0x20')]],'as':_0x1e34c8['as'],'attributes':_0x1e34c8[_0xed69('0x1c')],'include':_0x1e34c8[_0xed69('0x1e')]?_['map'](_0x1e34c8['include'],function(_0x383a83){return{'model':db[_0x383a83[_0xed69('0x20')]],'as':_0x383a83['as'],'attributes':_0x383a83[_0xed69('0x1c')],'include':_0x383a83[_0xed69('0x1e')]?_[_0xed69('0x1f')](_0x383a83[_0xed69('0x1e')],function(_0x5b6ee3){return{'model':db[_0x5b6ee3[_0xed69('0x20')]],'as':_0x5b6ee3['as'],'attributes':_0x5b6ee3[_0xed69('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xed69('0xc')](function(_0x582fdc){logger['info'](_0xed69('0x16'),_0x11c1fc);logger['debug'](_0xed69('0x16'),_0x11c1fc,JSON[_0xed69('0x21')](_0x582fdc));_0x3ed869(_0x582fdc);})[_0xed69('0x15')](function(_0x1f4e54){logger[_0xed69('0x11')](_0xed69('0x16'),_0x1f4e54[_0xed69('0x13')],_0x11c1fc);_0x10285d(_0x589f07['error'](0x1f4,_0x1f4e54[_0xed69('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index d0c64b0..e5bc894 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 _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x4bb482,_0x309707){var _0x20a34c=function(_0x292d1c){while(--_0x292d1c){_0x4bb482['push'](_0x4bb482['shift']());}};_0x20a34c(++_0x309707);}(_0x1261,0x144));var _0x1126=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x1261[_0x2b152a];return _0x2ad4c7;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x4e8efd,_0x46bc20){var _0x31e442=function(_0x4c6c00){while(--_0x4c6c00){_0x4e8efd['push'](_0x4e8efd['shift']());}};_0x31e442(++_0x46bc20);}(_0xe14b,0x93));var _0xbe14=function(_0x307eca,_0x1aebf0){_0x307eca=_0x307eca-0x0;var _0x5956a6=_0xe14b[_0x307eca];return _0x5956a6;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 0f9aecb..0a707f4 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 _0x90b1=['getMessages','post','create','put','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','/:id/messages'];(function(_0x5c027f,_0xa40135){var _0x5392f3=function(_0x581c3b){while(--_0x581c3b){_0x5c027f['push'](_0x5c027f['shift']());}};_0x5392f3(++_0xa40135);}(_0x90b1,0x1bb));var _0x190b=function(_0x4b526b,_0x2f1317){_0x4b526b=_0x4b526b-0x0;var _0x57f25d=_0x90b1[_0x4b526b];return _0x57f25d;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0xe')]('/',auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x10')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0x11')]);router['delete'](_0x190b('0x9'),auth[_0x190b('0xa')](),controller['destroy']);module[_0x190b('0x12')]=router; \ No newline at end of file +var _0x430c=['isAuthenticated','show','/:id/messages','getMessages','post','put','update','destroy','exports','multer','connect-timeout','express','Router','./voiceMail.controller','get','index','/:id'];(function(_0x4a68ad,_0x4f9637){var _0x233716=function(_0x30ff4b){while(--_0x30ff4b){_0x4a68ad['push'](_0x4a68ad['shift']());}};_0x233716(++_0x4f9637);}(_0x430c,0x1a1));var _0xc430=function(_0x24618a,_0x2cd0f4){_0x24618a=_0x24618a-0x0;var _0x2e3d64=_0x430c[_0x24618a];return _0x2e3d64;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0xc')]('/',auth[_0xc430('0x8')](),controller['create']);router[_0xc430('0xd')](_0xc430('0x7'),auth['isAuthenticated'](),controller[_0xc430('0xe')]);router['delete'](_0xc430('0x7'),auth['isAuthenticated'](),controller[_0xc430('0xf')]);module[_0xc430('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d64e027..468280e 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 _0xbb53=['trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb53,0x15e));var _0x3bb5=function(_0x57112d,_0x9ea573){_0x57112d=_0x57112d-0x0;var _0x3c32b9=_0xbb53[_0x57112d];return _0x3c32b9;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'customer_id':{'type':Sequelize[_0x3bb5('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x3bb5('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x3bb5('0x4')},'password':{'type':Sequelize[_0x3bb5('0x2')]},'fullname':{'type':Sequelize[_0x3bb5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x3c31bf){this[_0x3bb5('0x5')]('email',typeof _0x3c31bf===_0x3bb5('0x6')&&_0x3c31bf[_0x3bb5('0x7')]()?_0x3c31bf[_0x3bb5('0x7')]():null);}},'pager':{'type':Sequelize[_0x3bb5('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x3bb5('0x8')},'attach':{'type':Sequelize['ENUM'](_0x3bb5('0x9'),'no'),'defaultValue':_0x3bb5('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x3bb5('0x9'),'no'),'defaultValue':_0x3bb5('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x3bb5('0x2')]},'review':{'type':Sequelize['ENUM'](_0x3bb5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3bb5('0xa')](_0x3bb5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x3bb5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3bb5('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3bb5('0xa')](_0x3bb5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3bb5('0xa')](_0x3bb5('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3bb5('0xa')](_0x3bb5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3bb5('0xa')](_0x3bb5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3bb5('0xa')]('yes','no'),'defaultValue':_0x3bb5('0x9'),'allowNull':![]},'stamp':{'type':_0x3bb5('0xc')},'emailsubject':{'type':Sequelize[_0x3bb5('0x2')]},'emailbody':{'type':Sequelize[_0x3bb5('0x2')]},'maxsecs':{'type':Sequelize[_0x3bb5('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3bb5('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3bb5('0xe')](_0x3bb5('0xf'))+_0x3bb5('0x10')+this[_0x3bb5('0xe')]('mailbox');}}}; \ No newline at end of file +var _0x0344=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','STRING','contest_mailbox','setDataValue','string','trim','central'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x0344,0x1d9));var _0x4034=function(_0x51cb81,_0x53a62f){_0x51cb81=_0x51cb81-0x0;var _0x40cf7f=_0x0344[_0x51cb81];return _0x40cf7f;};'use strict';var Sequelize=require(_0x4034('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x4034('0x1')]},'context':{'type':Sequelize[_0x4034('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x4034('0x1')],'defaultValue':'','allowNull':![],'unique':_0x4034('0x2')},'password':{'type':Sequelize[_0x4034('0x1')]},'fullname':{'type':Sequelize[_0x4034('0x1')]},'email':{'type':Sequelize[_0x4034('0x1')],'validate':{'isEmail':!![]},'set':function(_0x688afd){this[_0x4034('0x3')]('email',typeof _0x688afd===_0x4034('0x4')&&_0x688afd[_0x4034('0x5')]()?_0x688afd[_0x4034('0x5')]():null);}},'pager':{'type':Sequelize[_0x4034('0x1')]},'tz':{'type':Sequelize[_0x4034('0x1')],'defaultValue':_0x4034('0x6')},'attach':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':_0x4034('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x4034('0x1')]},'callback':{'type':Sequelize[_0x4034('0x1')]},'review':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x4034('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4034('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4034('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4034('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x4034('0x8'),'no'),'defaultValue':_0x4034('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4034('0x7')](_0x4034('0x8'),'no'),'defaultValue':_0x4034('0x8'),'allowNull':![]},'stamp':{'type':_0x4034('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x4034('0x1')]},'maxsecs':{'type':Sequelize[_0x4034('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4034('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4034('0xc')],'get':function(){return this[_0x4034('0xd')]('fullname')+_0x4034('0xe')+this['getDataValue'](_0x4034('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f109efc..beac91e 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 _0x236c=['fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x180525,_0x481c15){var _0x3e1444=function(_0x47a611){while(--_0x47a611){_0x180525['push'](_0x180525['shift']());}};_0x3e1444(++_0x481c15);}(_0x236c,0x155));var _0xc236=function(_0x47220b,_0x43cd3e){_0x47220b=_0x47220b-0x0;var _0x4669b5=_0x236c[_0x47220b];return _0x4669b5;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){var _0x17cb3b=_0xf921e6['get']({'plain':!![]});var _0x308cd6=_0xc236('0x26');return db[_0xc236('0x27')][_0xc236('0x25')]({'where':{'type':_0x308cd6,'resourceId':_0x17cb3b['id']}})['then'](function(){return _0xf921e6;});})[_0xc236('0x24')](function(){_0x21fab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ead8,_0x4eace8){return function(_0x36e578){if(!_0x36e578){_0x15ead8['sendStatus'](0x194);}return _0x36e578;};}function handleError(_0x54365,_0x5c79d6){_0x5c79d6=_0x5c79d6||0x1f4;return function(_0x423842){logger[_0xc236('0x28')](_0x423842['stack']);if(_0x423842['name']){delete _0x423842[_0xc236('0x29')];}_0x54365[_0xc236('0x18')](_0x5c79d6)[_0xc236('0x2a')](_0x423842);};}exports[_0xc236('0x2b')]=function(_0x5f3891,_0x4e3262){var _0x28ffa5={},_0x53b767={},_0x2c756f={'count':0x0,'rows':[]};var _0x4ddc87=_[_0xc236('0x2c')](db[_0xc236('0x2d')]['rawAttributes'],function(_0x5a5ec3){return{'name':_0x5a5ec3[_0xc236('0x2e')],'type':_0x5a5ec3[_0xc236('0x2f')][_0xc236('0x30')]};});_0x53b767[_0xc236('0x31')]=_[_0xc236('0x2c')](_0x4ddc87,_0xc236('0x29'));_0x53b767[_0xc236('0x32')]=_[_0xc236('0x33')](_0x5f3891[_0xc236('0x32')]);_0x53b767['filters']=_['intersection'](_0x53b767['model'],_0x53b767[_0xc236('0x32')]);_0x28ffa5[_0xc236('0x34')]=_[_0xc236('0x35')](_0x53b767[_0xc236('0x31')],qs[_0xc236('0x36')](_0x5f3891[_0xc236('0x32')][_0xc236('0x36')]));_0x28ffa5['attributes']=_0x28ffa5[_0xc236('0x34')][_0xc236('0x37')]?_0x28ffa5[_0xc236('0x34')]:_0x53b767['model'];if(!_0x5f3891[_0xc236('0x32')][_0xc236('0x38')](_0xc236('0x39'))){_0x28ffa5[_0xc236('0x3a')]=qs['limit'](_0x5f3891[_0xc236('0x32')][_0xc236('0x3a')]);_0x28ffa5[_0xc236('0x1a')]=qs[_0xc236('0x1a')](_0x5f3891[_0xc236('0x32')][_0xc236('0x1a')]);}_0x28ffa5[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x5f3891[_0xc236('0x32')][_0xc236('0x3c')]);_0x28ffa5[_0xc236('0x3d')]=qs[_0xc236('0x3e')](_[_0xc236('0x3f')](_0x5f3891[_0xc236('0x32')],_0x53b767[_0xc236('0x3e')]),_0x4ddc87);if(_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]){_0x28ffa5['where']=_['merge'](_0x28ffa5['where'],{'$or':_['map'](_0x4ddc87,function(_0x369a79){if(_0x369a79['type']!==_0xc236('0x41')){var _0x361526={};_0x361526[_0x369a79[_0xc236('0x29')]]={'$like':'%'+_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]+'%'};return _0x361526;}})});}_0x28ffa5=_[_0xc236('0x42')]({},_0x28ffa5,_0x5f3891[_0xc236('0x43')]);var _0x201ba3={'where':_0x28ffa5[_0xc236('0x3d')]};return db[_0xc236('0x2d')][_0xc236('0x1c')](_0x201ba3)[_0xc236('0x24')](function(_0x3b2f2f){_0x2c756f[_0xc236('0x1c')]=_0x3b2f2f;if(_0x5f3891[_0xc236('0x32')]['includeAll']){_0x28ffa5[_0xc236('0x44')]=[{'all':!![]}];}return db[_0xc236('0x2d')]['findAll'](_0x28ffa5);})[_0xc236('0x24')](function(_0x5b0bc5){_0x2c756f[_0xc236('0x45')]=_0x5b0bc5;return _0x2c756f;})['then'](respondWithFilteredResult(_0x4e3262,_0x28ffa5))[_0xc236('0x46')](handleError(_0x4e3262,null));};exports[_0xc236('0x47')]=function(_0x8d04c9,_0x479e02){var _0x11e3dd={'raw':!![],'where':{'id':_0x8d04c9[_0xc236('0x48')]['id']}},_0x429e08={};_0x429e08['model']=_[_0xc236('0x33')](db[_0xc236('0x2d')][_0xc236('0x49')]);_0x429e08[_0xc236('0x32')]=_[_0xc236('0x33')](_0x8d04c9[_0xc236('0x32')]);_0x429e08['filters']=_[_0xc236('0x35')](_0x429e08['model'],_0x429e08[_0xc236('0x32')]);_0x11e3dd[_0xc236('0x34')]=_[_0xc236('0x35')](_0x429e08[_0xc236('0x31')],qs[_0xc236('0x36')](_0x8d04c9[_0xc236('0x32')][_0xc236('0x36')]));_0x11e3dd['attributes']=_0x11e3dd[_0xc236('0x34')]['length']?_0x11e3dd[_0xc236('0x34')]:_0x429e08[_0xc236('0x31')];if(_0x8d04c9['query'][_0xc236('0x4a')]){_0x11e3dd[_0xc236('0x44')]=[{'all':!![]}];}_0x11e3dd=_[_0xc236('0x42')]({},_0x11e3dd,_0x8d04c9[_0xc236('0x43')]);return db[_0xc236('0x2d')][_0xc236('0x4b')](_0x11e3dd)[_0xc236('0x24')](handleEntityNotFound(_0x479e02,null))['then'](respondWithResult(_0x479e02,null))['catch'](handleError(_0x479e02,null));};exports[_0xc236('0x4c')]=function(_0x2afed2,_0x510f7f){return db[_0xc236('0x2d')][_0xc236('0x4c')](_0x2afed2[_0xc236('0x4d')],{})[_0xc236('0x24')](function(_0x45fa20){var _0x1683f4=_0x2afed2[_0xc236('0x4e')][_0xc236('0x4f')]({'plain':!![]});if(!_0x1683f4)throw new Error(_0xc236('0x50'));if(_0x1683f4['role']===_0xc236('0x4e')){var _0x307663=_0x45fa20[_0xc236('0x4f')]({'plain':!![]});var _0x447a83=_0xc236('0x26');return db[_0xc236('0x51')][_0xc236('0x4b')]({'where':{'name':_0x447a83,'userProfileId':_0x1683f4['userProfileId']},'raw':!![]})[_0xc236('0x24')](function(_0x3788ff){if(_0x3788ff&&_0x3788ff[_0xc236('0x52')]===0x0){return db[_0xc236('0x27')]['create']({'name':_0x307663[_0xc236('0x29')],'resourceId':_0x307663['id'],'type':_0x3788ff[_0xc236('0x29')],'sectionId':_0x3788ff['id']},{})[_0xc236('0x24')](function(){return _0x45fa20;});}else{return _0x45fa20;}})[_0xc236('0x46')](function(_0x9d81c8){logger['error'](_0xc236('0x53'),_0x9d81c8);throw _0x9d81c8;});}return _0x45fa20;})['then'](respondWithResult(_0x510f7f,0xc9))[_0xc236('0x46')](handleError(_0x510f7f,null));};exports[_0xc236('0x23')]=function(_0x3f9e85,_0x15defc){if(_0x3f9e85[_0xc236('0x4d')]['id']){delete _0x3f9e85['body']['id'];}return db['VoiceMail'][_0xc236('0x4b')]({'where':{'id':_0x3f9e85[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x15defc,null))[_0xc236('0x24')](saveUpdates(_0x3f9e85[_0xc236('0x4d')],null))[_0xc236('0x24')](respondWithResult(_0x15defc,null))[_0xc236('0x46')](handleError(_0x15defc,null));};exports[_0xc236('0x25')]=function(_0x24af08,_0x2d27e7){return db['VoiceMail']['find']({'where':{'id':_0x24af08[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x2d27e7,null))[_0xc236('0x24')](removeEntity(_0x2d27e7,null))[_0xc236('0x46')](handleError(_0x2d27e7,null));};exports['getMessages']=function(_0x94fc7,_0x460076,_0x56e476){return db[_0xc236('0x2d')][_0xc236('0x54')]({'where':{'id':_0x94fc7[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x460076,null))['then'](function(_0x1558dd){var _0xec00da;var _0x35955c={},_0x2602f8={};_0x2602f8[_0xc236('0x31')]=_[_0xc236('0x33')](db[_0xc236('0x55')]['rawAttributes']);_0x2602f8[_0xc236('0x32')]=_['keys'](_0x94fc7[_0xc236('0x32')]);_0x2602f8[_0xc236('0x3e')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],_0x2602f8['query']);_0x35955c[_0xc236('0x34')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],qs['fields'](_0x94fc7[_0xc236('0x32')][_0xc236('0x36')]));_0x35955c[_0xc236('0x34')]=_0x35955c[_0xc236('0x34')][_0xc236('0x37')]?_0x35955c[_0xc236('0x34')]:_0x2602f8['model'];if(!_0x94fc7['query'][_0xc236('0x38')](_0xc236('0x39'))){_0x35955c[_0xc236('0x3a')]=qs[_0xc236('0x3a')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3a')]);_0x35955c[_0xc236('0x1a')]=qs['offset'](_0x94fc7['query']['offset']);}_0x35955c[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3c')]);_0x35955c['where']=qs['filters'](_['pick'](_0x94fc7['query'],_0x2602f8[_0xc236('0x3e')]));if(_0x94fc7['query'][_0xc236('0x40')]){_0x35955c['where']=_[_0xc236('0x42')](_0x35955c[_0xc236('0x3d')],{'$or':_[_0xc236('0x2c')](_0x35955c[_0xc236('0x34')],function(_0x26d708){var _0x169e73={};_0x169e73[_0x26d708]={'$like':'%'+_0x94fc7[_0xc236('0x32')]['filter']+'%'};return _0x169e73;})});}_0x35955c[_0xc236('0x3d')]=_['merge'](_0x35955c[_0xc236('0x3d')],{'mailboxuser':_0x1558dd[_0xc236('0x56')]});_0x35955c=_[_0xc236('0x42')]({},_0x35955c,_0x94fc7[_0xc236('0x43')]);return db[_0xc236('0x55')][_0xc236('0x57')](_0x35955c)['then'](respondWithFilteredResult(_0x460076,_0x35955c));})[_0xc236('0x46')](handleError(_0x460076,null));}; \ No newline at end of file +var _0x065e=['findOne','VoiceMailMessage','findAndCountAll','eml-format','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoiceMail','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages'];(function(_0x607e26,_0x3fa4f7){var _0x43f797=function(_0x20b4cf){while(--_0x20b4cf){_0x607e26['push'](_0x607e26['shift']());}};_0x43f797(++_0x3fa4f7);}(_0x065e,0x1a7));var _0xe065=function(_0x5c63bc,_0x51c676){_0x5c63bc=_0x5c63bc-0x0;var _0x62604=_0x065e[_0x5c63bc];return _0x62604;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){var _0x5e8b60=_0x43b712['get']({'plain':!![]});var _0x164965='Voicemails';return db[_0xe065('0x24')][_0xe065('0x23')]({'where':{'type':_0x164965,'resourceId':_0x5e8b60['id']}})[_0xe065('0x22')](function(){return _0x43b712;});})[_0xe065('0x22')](function(){_0x5081a3[_0xe065('0x17')](0xcc)[_0xe065('0x18')]();});}};}function handleEntityNotFound(_0x3b1caf,_0x26a159){return function(_0x52cd9c){if(!_0x52cd9c){_0x3b1caf['sendStatus'](0x194);}return _0x52cd9c;};}function handleError(_0x14de01,_0x10e6ba){_0x10e6ba=_0x10e6ba||0x1f4;return function(_0x23aee9){logger[_0xe065('0x25')](_0x23aee9['stack']);if(_0x23aee9[_0xe065('0x26')]){delete _0x23aee9['name'];}_0x14de01['status'](_0x10e6ba)[_0xe065('0x27')](_0x23aee9);};}exports[_0xe065('0x28')]=function(_0x2aa766,_0x5b8523){var _0x883747={},_0x59b915={},_0x12679d={'count':0x0,'rows':[]};var _0x46db7e=_[_0xe065('0x29')](db[_0xe065('0x2a')]['rawAttributes'],function(_0x3f02b2){return{'name':_0x3f02b2['fieldName'],'type':_0x3f02b2[_0xe065('0x2b')][_0xe065('0x2c')]};});_0x59b915['model']=_[_0xe065('0x29')](_0x46db7e,'name');_0x59b915[_0xe065('0x2d')]=_['keys'](_0x2aa766[_0xe065('0x2d')]);_0x59b915[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],_0x59b915['query']);_0x883747[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x32')]));_0x883747['attributes']=_0x883747[_0xe065('0x31')][_0xe065('0x33')]?_0x883747['attributes']:_0x59b915[_0xe065('0x30')];if(!_0x2aa766[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x883747[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x2aa766[_0xe065('0x2d')]['limit']);_0x883747[_0xe065('0x1a')]=qs['offset'](_0x2aa766[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x883747[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x37')]);_0x883747['where']=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x2aa766[_0xe065('0x2d')],_0x59b915['filters']),_0x46db7e);if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]){_0x883747[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x883747[_0xe065('0x3a')],{'$or':_['map'](_0x46db7e,function(_0x341740){if(_0x341740[_0xe065('0x2b')]!=='VIRTUAL'){var _0x236e75={};_0x236e75[_0x341740['name']]={'$like':'%'+_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x236e75;}})});}_0x883747=_['merge']({},_0x883747,_0x2aa766[_0xe065('0x3c')]);var _0x20c881={'where':_0x883747['where']};return db[_0xe065('0x2a')][_0xe065('0x1d')](_0x20c881)[_0xe065('0x22')](function(_0x44a3f6){_0x12679d[_0xe065('0x1d')]=_0x44a3f6;if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x3d')]){_0x883747[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x3f')](_0x883747);})[_0xe065('0x22')](function(_0x4364c3){_0x12679d[_0xe065('0x40')]=_0x4364c3;return _0x12679d;})['then'](respondWithFilteredResult(_0x5b8523,_0x883747))['catch'](handleError(_0x5b8523,null));};exports[_0xe065('0x41')]=function(_0x2bf092,_0x5ee4ec){var _0x3ba838={'raw':!![],'where':{'id':_0x2bf092[_0xe065('0x42')]['id']}},_0x448044={};_0x448044[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x448044[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x2bf092['query']);_0x448044[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],_0x448044['query']);_0x3ba838[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2bf092['query'][_0xe065('0x32')]));_0x3ba838[_0xe065('0x31')]=_0x3ba838[_0xe065('0x31')][_0xe065('0x33')]?_0x3ba838[_0xe065('0x31')]:_0x448044[_0xe065('0x30')];if(_0x2bf092[_0xe065('0x2d')]['includeAll']){_0x3ba838[_0xe065('0x3e')]=[{'all':!![]}];}_0x3ba838=_[_0xe065('0x3b')]({},_0x3ba838,_0x2bf092[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x3ba838)[_0xe065('0x22')](handleEntityNotFound(_0x5ee4ec,null))[_0xe065('0x22')](respondWithResult(_0x5ee4ec,null))['catch'](handleError(_0x5ee4ec,null));};exports[_0xe065('0x46')]=function(_0x5a2360,_0x45fe1f){return db[_0xe065('0x2a')][_0xe065('0x46')](_0x5a2360['body'],{})[_0xe065('0x22')](function(_0x16898c){var _0x3ab70d=_0x5a2360[_0xe065('0x47')][_0xe065('0x48')]({'plain':!![]});if(!_0x3ab70d)throw new Error(_0xe065('0x49'));if(_0x3ab70d[_0xe065('0x4a')]===_0xe065('0x47')){var _0x3095c8=_0x16898c[_0xe065('0x48')]({'plain':!![]});var _0x3f91a2=_0xe065('0x4b');return db[_0xe065('0x4c')]['find']({'where':{'name':_0x3f91a2,'userProfileId':_0x3ab70d['userProfileId']},'raw':!![]})['then'](function(_0x23ba0b){if(_0x23ba0b&&_0x23ba0b['autoAssociation']===0x0){return db[_0xe065('0x24')][_0xe065('0x46')]({'name':_0x3095c8[_0xe065('0x26')],'resourceId':_0x3095c8['id'],'type':_0x23ba0b['name'],'sectionId':_0x23ba0b['id']},{})[_0xe065('0x22')](function(){return _0x16898c;});}else{return _0x16898c;}})[_0xe065('0x4d')](function(_0x5cce78){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x5cce78);throw _0x5cce78;});}return _0x16898c;})[_0xe065('0x22')](respondWithResult(_0x45fe1f,0xc9))[_0xe065('0x4d')](handleError(_0x45fe1f,null));};exports[_0xe065('0x21')]=function(_0x1ea568,_0xe77af6){if(_0x1ea568[_0xe065('0x4f')]['id']){delete _0x1ea568[_0xe065('0x4f')]['id'];}return db[_0xe065('0x2a')]['find']({'where':{'id':_0x1ea568[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xe77af6,null))[_0xe065('0x22')](saveUpdates(_0x1ea568[_0xe065('0x4f')],null))['then'](respondWithResult(_0xe77af6,null))[_0xe065('0x4d')](handleError(_0xe77af6,null));};exports[_0xe065('0x23')]=function(_0x21884d,_0xb1fca1){return db['VoiceMail'][_0xe065('0x45')]({'where':{'id':_0x21884d[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0xb1fca1,null))['then'](removeEntity(_0xb1fca1,null))[_0xe065('0x4d')](handleError(_0xb1fca1,null));};exports[_0xe065('0x50')]=function(_0x18b43e,_0x1f782f,_0x2d13ab){return db[_0xe065('0x2a')][_0xe065('0x51')]({'where':{'id':_0x18b43e[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x1f782f,null))['then'](function(_0x2accad){var _0x550c37;var _0x44edf0={},_0x24fc1c={};_0x24fc1c[_0xe065('0x30')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x24fc1c[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x18b43e[_0xe065('0x2d')]);_0x24fc1c[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x24fc1c[_0xe065('0x30')],_0x24fc1c[_0xe065('0x2d')]);_0x44edf0[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x24fc1c[_0xe065('0x30')],qs[_0xe065('0x32')](_0x18b43e['query']['fields']));_0x44edf0[_0xe065('0x31')]=_0x44edf0[_0xe065('0x31')]['length']?_0x44edf0[_0xe065('0x31')]:_0x24fc1c['model'];if(!_0x18b43e['query'][_0xe065('0x34')](_0xe065('0x35'))){_0x44edf0[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x18b43e[_0xe065('0x2d')][_0xe065('0x1b')]);_0x44edf0[_0xe065('0x1a')]=qs['offset'](_0x18b43e[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x44edf0[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x18b43e[_0xe065('0x2d')]['sort']);_0x44edf0[_0xe065('0x3a')]=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x18b43e[_0xe065('0x2d')],_0x24fc1c[_0xe065('0x2e')]));if(_0x18b43e[_0xe065('0x2d')]['filter']){_0x44edf0['where']=_['merge'](_0x44edf0['where'],{'$or':_['map'](_0x44edf0[_0xe065('0x31')],function(_0x45b033){var _0x1733b4={};_0x1733b4[_0x45b033]={'$like':'%'+_0x18b43e[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x1733b4;})});}_0x44edf0[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x44edf0[_0xe065('0x3a')],{'mailboxuser':_0x2accad['mailbox']});_0x44edf0=_['merge']({},_0x44edf0,_0x18b43e[_0xe065('0x3c')]);return db[_0xe065('0x52')][_0xe065('0x53')](_0x44edf0)['then'](respondWithFilteredResult(_0x1f782f,_0x44edf0));})[_0xe065('0x4d')](handleError(_0x1f782f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8f46ce4..3289125 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 _0xd52f=['VoiceMail','mailbox_context','mailbox','context','../../config/logger','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x2c9ccd,_0x4f3f3f){var _0x3c5182=function(_0x566ead){while(--_0x566ead){_0x2c9ccd['push'](_0x2c9ccd['shift']());}};_0x3c5182(++_0x4f3f3f);}(_0xd52f,0x101));var _0xfd52=function(_0x27c121,_0x18b166){_0x27c121=_0x27c121-0x0;var _0x1596aa=_0xd52f[_0x27c121];return _0x1596aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfd52('0x0'))(_0xfd52('0x1'));var moment=require(_0xfd52('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd52('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfd52('0x4'));var attributes=require('./voiceMail.attributes');module[_0xfd52('0x5')]=function(_0x3d6015,_0x318fbc){return _0x3d6015[_0xfd52('0x6')](_0xfd52('0x7'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xfd52('0x8'),'fields':[_0xfd52('0x9'),_0xfd52('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd307=['bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api'];(function(_0x23932e,_0xae3c98){var _0x32bf41=function(_0x6d12f){while(--_0x6d12f){_0x23932e['push'](_0x23932e['shift']());}};_0x32bf41(++_0xae3c98);}(_0xd307,0x1bc));var _0x7d30=function(_0x1a5c86,_0x355ac0){_0x1a5c86=_0x1a5c86-0x0;var _0x96f889=_0xd307[_0x1a5c86];return _0x96f889;};'use strict';var _=require(_0x7d30('0x0'));var util=require(_0x7d30('0x1'));var logger=require(_0x7d30('0x2'))(_0x7d30('0x3'));var moment=require('moment');var BPromise=require(_0x7d30('0x4'));var rp=require(_0x7d30('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d30('0x6'));var config=require(_0x7d30('0x7'));var attributes=require(_0x7d30('0x8'));module[_0x7d30('0x9')]=function(_0x2bd5a7,_0x5d6b11){return _0x2bd5a7[_0x7d30('0xa')](_0x7d30('0xb'),attributes,{'tableName':_0x7d30('0xc'),'paranoid':![],'indexes':[{'name':_0x7d30('0xd'),'fields':[_0x7d30('0xe'),_0x7d30('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index b094de9..b58f31a 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 _0x57e4=['../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','VoiceMail,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x47fe32,_0x55865a){var _0x272b95=function(_0x363e59){while(--_0x363e59){_0x47fe32['push'](_0x47fe32['shift']());}};_0x272b95(++_0x55865a);}(_0x57e4,0x1ef));var _0x457e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x57e4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x457e('0x0'));var util=require(_0x457e('0x1'));var moment=require(_0x457e('0x2'));var BPromise=require(_0x457e('0x3'));var rs=require(_0x457e('0x4'));var fs=require('fs');var Redis=require(_0x457e('0x5'));var db=require(_0x457e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x457e('0x7'))(_0x457e('0x8'));var config=require(_0x457e('0x9'));var jayson=require(_0x457e('0xa'));var client=jayson[_0x457e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x988ad0,_0xd5caf6,_0x3d886a){return new BPromise(function(_0x2c5bcd,_0x9fde4){return client[_0x457e('0xc')](_0x988ad0,_0x3d886a)['then'](function(_0x38684c){logger[_0x457e('0xd')]('VoiceMail,\x20%s,\x20%s',_0xd5caf6,_0x457e('0xe'));logger[_0x457e('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0xd5caf6,_0x457e('0xe'),JSON[_0x457e('0x10')](_0x38684c));if(_0x38684c[_0x457e('0x11')]){if(_0x38684c[_0x457e('0x11')]['code']===0x1f4){logger['error'](_0x457e('0x12'),_0xd5caf6,_0x38684c['error']['message']);return _0x9fde4(_0x38684c[_0x457e('0x11')][_0x457e('0x13')]);}logger['error'](_0x457e('0x12'),_0xd5caf6,_0x38684c[_0x457e('0x11')][_0x457e('0x13')]);return _0x2c5bcd(_0x38684c['error'][_0x457e('0x13')]);}else{logger['info'](_0x457e('0x12'),_0xd5caf6,'request\x20sent');_0x2c5bcd(_0x38684c['result'][_0x457e('0x13')]);}})[_0x457e('0x14')](function(_0x57d72c){logger[_0x457e('0x11')]('VoiceMail,\x20%s,\x20%s',_0xd5caf6,_0x57d72c);_0x9fde4(_0x57d72c);});});} \ No newline at end of file +var _0x0850=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0xd49b9f,_0x57700d){var _0x13c507=function(_0x302e90){while(--_0x302e90){_0xd49b9f['push'](_0xd49b9f['shift']());}};_0x13c507(++_0x57700d);}(_0x0850,0x1c0));var _0x0085=function(_0x16c6a3,_0x1e5867){_0x16c6a3=_0x16c6a3-0x0;var _0x1cc69c=_0x0850[_0x16c6a3];return _0x1cc69c;};'use strict';var _=require(_0x0085('0x0'));var util=require(_0x0085('0x1'));var moment=require(_0x0085('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0085('0x3'))['db'];var utils=require(_0x0085('0x4'));var logger=require(_0x0085('0x5'))(_0x0085('0x6'));var config=require(_0x0085('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0085('0x8')][_0x0085('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20d08c,_0x30863b,_0x1a3c27){return new BPromise(function(_0x185c2d,_0x1d3e9b){return client['request'](_0x20d08c,_0x1a3c27)[_0x0085('0xa')](function(_0x3deccb){logger[_0x0085('0xb')](_0x0085('0xc'),_0x30863b,_0x0085('0xd'));logger[_0x0085('0xe')](_0x0085('0xf'),_0x30863b,_0x0085('0xd'),JSON[_0x0085('0x10')](_0x3deccb));if(_0x3deccb['error']){if(_0x3deccb['error'][_0x0085('0x11')]===0x1f4){logger[_0x0085('0x12')](_0x0085('0xc'),_0x30863b,_0x3deccb[_0x0085('0x12')][_0x0085('0x13')]);return _0x1d3e9b(_0x3deccb[_0x0085('0x12')]['message']);}logger[_0x0085('0x12')](_0x0085('0xc'),_0x30863b,_0x3deccb[_0x0085('0x12')][_0x0085('0x13')]);return _0x185c2d(_0x3deccb['error'][_0x0085('0x13')]);}else{logger[_0x0085('0xb')](_0x0085('0xc'),_0x30863b,_0x0085('0xd'));_0x185c2d(_0x3deccb['result'][_0x0085('0x13')]);}})[_0x0085('0x14')](function(_0x6b6452){logger['error'](_0x0085('0xc'),_0x30863b,_0x6b6452);_0x1d3e9b(_0x6b6452);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index c5b9ef3..a4eb29c 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 _0xa4bd=['fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3a65de,_0x245483){var _0x311a88=function(_0x355e93){while(--_0x355e93){_0x3a65de['push'](_0x3a65de['shift']());}};_0x311a88(++_0x245483);}(_0xa4bd,0x145));var _0xda4b=function(_0x1bc71c,_0x129bb8){_0x1bc71c=_0x1bc71c-0x0;var _0x581c26=_0xa4bd[_0x1bc71c];return _0x581c26;};'use strict';var multer=require('multer');var util=require(_0xda4b('0x0'));var path=require(_0xda4b('0x1'));var timeout=require(_0xda4b('0x2'));var express=require(_0xda4b('0x3'));var router=express[_0xda4b('0x4')]();var fs_extra=require(_0xda4b('0x5'));var auth=require(_0xda4b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda4b('0x7'));var controller=require(_0xda4b('0x8'));router[_0xda4b('0x9')]('/',auth[_0xda4b('0xa')](),controller[_0xda4b('0xb')]);router[_0xda4b('0x9')]('/:id',auth[_0xda4b('0xa')](),controller[_0xda4b('0xc')]);router[_0xda4b('0x9')]('/:id/download',auth[_0xda4b('0xa')](),controller[_0xda4b('0xd')]);router[_0xda4b('0xe')]('/',auth[_0xda4b('0xa')](),controller[_0xda4b('0xf')]);router[_0xda4b('0x10')](_0xda4b('0x11'),auth[_0xda4b('0xa')](),controller[_0xda4b('0x12')]);router[_0xda4b('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xda4b('0x14')]);module[_0xda4b('0x15')]=router; \ No newline at end of file +var _0x38bd=['/:id/download','download','post','create','put','update','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x38bd,0xa7));var _0xd38b=function(_0x421480,_0x1210a5){_0x421480=_0x421480-0x0;var _0x141d1c=_0x38bd[_0x421480];return _0x141d1c;};'use strict';var multer=require('multer');var util=require(_0xd38b('0x0'));var path=require('path');var timeout=require(_0xd38b('0x1'));var express=require('express');var router=express[_0xd38b('0x2')]();var fs_extra=require(_0xd38b('0x3'));var auth=require(_0xd38b('0x4'));var interaction=require(_0xd38b('0x5'));var config=require(_0xd38b('0x6'));var controller=require(_0xd38b('0x7'));router[_0xd38b('0x8')]('/',auth[_0xd38b('0x9')](),controller[_0xd38b('0xa')]);router[_0xd38b('0x8')](_0xd38b('0xb'),auth[_0xd38b('0x9')](),controller[_0xd38b('0xc')]);router['get'](_0xd38b('0xd'),auth[_0xd38b('0x9')](),controller[_0xd38b('0xe')]);router[_0xd38b('0xf')]('/',auth['isAuthenticated'](),controller[_0xd38b('0x10')]);router[_0xd38b('0x11')](_0xd38b('0xb'),auth[_0xd38b('0x9')](),controller[_0xd38b('0x12')]);router['delete'](_0xd38b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd38b('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 2db869a..4928936 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 _0x338d=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x2ea135,_0x369f25){var _0x1d91c9=function(_0x22cf24){while(--_0x22cf24){_0x2ea135['push'](_0x2ea135['shift']());}};_0x1d91c9(++_0x369f25);}(_0x338d,0x17e));var _0xd338=function(_0xbebb82,_0x513458){_0xbebb82=_0xbebb82-0x0;var _0x19cdfd=_0x338d[_0xbebb82];return _0x19cdfd;};'use strict';var Sequelize=require('sequelize');module[_0xd338('0x0')]={'name':{'type':Sequelize[_0xd338('0x1')],'get':function(_0x34c63f){return this[_0xd338('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd338('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xd338('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd338('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd338('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xd338('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd338('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xd338('0x5')](_0xd338('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xd338('0x7'),'defaultValue':Sequelize[_0xd338('0x8')](_0xd338('0x9'))}}; \ No newline at end of file +var _0x6cb8=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x6cb8,0x1d8));var _0x86cb=function(_0x2cbc47,_0x2daf86){_0x2cbc47=_0x2cbc47-0x0;var _0x2b429e=_0x6cb8[_0x2cbc47];return _0x2b429e;};'use strict';var Sequelize=require('sequelize');module[_0x86cb('0x0')]={'name':{'type':Sequelize[_0x86cb('0x1')],'get':function(_0x27cba4){return this[_0x86cb('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x86cb('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x86cb('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x86cb('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x86cb('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x86cb('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x86cb('0x5')](_0x86cb('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x86cb('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x86cb('0x7'),'defaultValue':Sequelize[_0x86cb('0x8')](_0x86cb('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 688a731..b52cf5a 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 _0x0088=['destroy','download','recording','msg_id','Sequelize','ValidationError','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params'];(function(_0x2de22d,_0x2ece0e){var _0x249de2=function(_0x172997){while(--_0x172997){_0x2de22d['push'](_0x2de22d['shift']());}};_0x249de2(++_0x2ece0e);}(_0x0088,0x100));var _0x8008=function(_0x4bda54,_0x284f60){_0x4bda54=_0x4bda54-0x0;var _0x10f61f=_0x0088[_0x4bda54];return _0x10f61f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8008('0x0'));var zipdir=require(_0x8008('0x1'));var jsonpatch=require(_0x8008('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8008('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8008('0x4'));var sox=require('sox');var csv=require(_0x8008('0x5'));var ejs=require(_0x8008('0x6'));var fs=require('fs');var fs_extra=require(_0x8008('0x7'));var _=require(_0x8008('0x8'));var squel=require(_0x8008('0x9'));var crypto=require(_0x8008('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8008('0x5'));var querystring=require(_0x8008('0xb'));var Papa=require(_0x8008('0xc'));var Redis=require(_0x8008('0xd'));var authService=require(_0x8008('0xe'));var qs=require(_0x8008('0xf'));var as=require(_0x8008('0x10'));var hardwareService=require(_0x8008('0x11'));var logger=require(_0x8008('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8008('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18cb10,_0x422510){_0x422510=_0x422510||0xcc;return function(_0x217351){if(_0x217351){return _0x18cb10[_0x8008('0x14')](_0x422510);}return _0x18cb10[_0x8008('0x15')](_0x422510)[_0x8008('0x16')]();};}function respondWithResult(_0x21140b,_0x34f0a0){_0x34f0a0=_0x34f0a0||0xc8;return function(_0x368a9a){if(_0x368a9a){return _0x21140b[_0x8008('0x15')](_0x34f0a0)[_0x8008('0x17')](_0x368a9a);}};}function respondWithFilteredResult(_0x5a1ba3,_0x18a038){return function(_0x75d73b){if(_0x75d73b){var _0x11ec44=typeof _0x18a038['offset']==='undefined'&&typeof _0x18a038[_0x8008('0x18')]===_0x8008('0x19');var _0x41dd28=_0x75d73b[_0x8008('0x1a')];var _0x1e5f95=_0x11ec44?0x0:_0x18a038[_0x8008('0x1b')];var _0x117af8=_0x11ec44?_0x75d73b[_0x8008('0x1a')]:_0x18a038[_0x8008('0x1b')]+_0x18a038[_0x8008('0x18')];var _0x2728d8;if(_0x117af8>=_0x41dd28){_0x117af8=_0x41dd28;_0x2728d8=0xc8;}else{_0x2728d8=0xce;}_0x5a1ba3[_0x8008('0x15')](_0x2728d8);return _0x5a1ba3[_0x8008('0x1c')]('Content-Range',_0x1e5f95+'-'+_0x117af8+'/'+_0x41dd28)[_0x8008('0x17')](_0x75d73b);}return null;};}function patchUpdates(_0x13b54d){return function(_0x8b9d4a){try{jsonpatch[_0x8008('0x1d')](_0x8b9d4a,_0x13b54d,!![]);}catch(_0x545850){return BPromise[_0x8008('0x1e')](_0x545850);}return _0x8b9d4a[_0x8008('0x1f')]();};}function saveUpdates(_0x1af050,_0x523d39){return function(_0x593e9d){if(_0x593e9d){return _0x593e9d[_0x8008('0x20')](_0x1af050)[_0x8008('0x21')](function(_0x537a2c){return _0x537a2c;});}return null;};}function removeEntity(_0x470024,_0x44f518){return function(_0x29b623){if(_0x29b623){return _0x29b623['destroy']()[_0x8008('0x21')](function(){_0x470024[_0x8008('0x15')](0xcc)[_0x8008('0x16')]();});}};}function handleEntityNotFound(_0x122157,_0x460f62){return function(_0x2d1420){if(!_0x2d1420){_0x122157[_0x8008('0x14')](0x194);}return _0x2d1420;};}function handleError(_0x22c56b,_0xc7ca1c){_0xc7ca1c=_0xc7ca1c||0x1f4;return function(_0x24d899){logger[_0x8008('0x22')](_0x24d899[_0x8008('0x23')]);if(_0x24d899[_0x8008('0x24')]){delete _0x24d899[_0x8008('0x24')];}_0x22c56b[_0x8008('0x15')](_0xc7ca1c)[_0x8008('0x25')](_0x24d899);};}exports[_0x8008('0x26')]=function(_0x551aea,_0x5b63ab){var _0x58c65b={},_0x594f7d={},_0x23ab7b={'count':0x0,'rows':[]};var _0x1480ca=_[_0x8008('0x27')](db['VoiceMailMessage'][_0x8008('0x28')],function(_0x2cf8de){return{'name':_0x2cf8de[_0x8008('0x29')],'type':_0x2cf8de[_0x8008('0x2a')][_0x8008('0x2b')]};});_0x594f7d[_0x8008('0x2c')]=_['differenceBy'](_[_0x8008('0x27')](_0x1480ca,_0x8008('0x24')),[_0x8008('0x24')]);_0x594f7d[_0x8008('0x2d')]=_['keys'](_0x551aea[_0x8008('0x2d')]);_0x594f7d['filters']=_[_0x8008('0x2e')](_0x594f7d['model'],_0x594f7d[_0x8008('0x2d')]);_0x58c65b['attributes']=_[_0x8008('0x2e')](_0x594f7d['model'],qs[_0x8008('0x2f')](_0x551aea[_0x8008('0x2d')][_0x8008('0x2f')]));_0x58c65b[_0x8008('0x30')]=_0x58c65b[_0x8008('0x30')][_0x8008('0x31')]?_0x58c65b[_0x8008('0x30')]:_0x594f7d[_0x8008('0x2c')];if(!_0x551aea[_0x8008('0x2d')][_0x8008('0x32')](_0x8008('0x33'))){_0x58c65b[_0x8008('0x18')]=qs['limit'](_0x551aea['query'][_0x8008('0x18')]);_0x58c65b[_0x8008('0x1b')]=qs[_0x8008('0x1b')](_0x551aea[_0x8008('0x2d')][_0x8008('0x1b')]);}_0x58c65b[_0x8008('0x34')]=qs[_0x8008('0x35')](_0x551aea[_0x8008('0x2d')][_0x8008('0x35')]);_0x58c65b['where']=qs[_0x8008('0x36')](_[_0x8008('0x37')](_0x551aea[_0x8008('0x2d')],_0x594f7d['filters']),_0x1480ca);if(_0x551aea['query'][_0x8008('0x38')]){_0x58c65b[_0x8008('0x39')]=_['merge'](_0x58c65b[_0x8008('0x39')],{'$or':_[_0x8008('0x27')](_0x1480ca,function(_0x33514a){if(_0x33514a[_0x8008('0x2a')]!=='VIRTUAL'){var _0x2b91cc={};_0x2b91cc[_0x33514a[_0x8008('0x24')]]={'$like':'%'+_0x551aea[_0x8008('0x2d')][_0x8008('0x38')]+'%'};return _0x2b91cc;}})});}_0x58c65b=_[_0x8008('0x3a')]({},_0x58c65b,_0x551aea[_0x8008('0x3b')]);var _0x4af07b={'where':_0x58c65b['where']};return db[_0x8008('0x3c')]['count'](_0x4af07b)['then'](function(_0x24b3f8){_0x23ab7b['count']=_0x24b3f8;if(_0x551aea['query'][_0x8008('0x3d')]){_0x58c65b[_0x8008('0x3e')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x8008('0x3f')](_0x58c65b);})[_0x8008('0x21')](function(_0x11a386){_0x23ab7b[_0x8008('0x40')]=_0x11a386;return _0x23ab7b;})[_0x8008('0x21')](respondWithFilteredResult(_0x5b63ab,_0x58c65b))[_0x8008('0x41')](handleError(_0x5b63ab,null));};exports[_0x8008('0x42')]=function(_0x419a74,_0x473f07){var _0x57f02d={'raw':!![],'where':{'id':_0x419a74['params']['id']}},_0xafb6e1={};_0xafb6e1['model']=_[_0x8008('0x43')](db['VoiceMailMessage'][_0x8008('0x28')]);_0xafb6e1[_0x8008('0x2d')]=_['keys'](_0x419a74['query']);_0xafb6e1[_0x8008('0x36')]=_[_0x8008('0x2e')](_0xafb6e1[_0x8008('0x2c')],_0xafb6e1[_0x8008('0x2d')]);_0x57f02d[_0x8008('0x30')]=_['intersection'](_0xafb6e1[_0x8008('0x2c')],qs[_0x8008('0x2f')](_0x419a74[_0x8008('0x2d')][_0x8008('0x2f')]));_0x57f02d[_0x8008('0x30')]=_0x57f02d['attributes'][_0x8008('0x31')]?_0x57f02d['attributes']:_0xafb6e1[_0x8008('0x2c')];if(_0x419a74['query'][_0x8008('0x3d')]){_0x57f02d[_0x8008('0x3e')]=[{'all':!![]}];}_0x57f02d=_['merge']({},_0x57f02d,_0x419a74[_0x8008('0x3b')]);return db[_0x8008('0x3c')]['find'](_0x57f02d)[_0x8008('0x21')](handleEntityNotFound(_0x473f07,null))[_0x8008('0x21')](respondWithResult(_0x473f07,null))[_0x8008('0x41')](handleError(_0x473f07,null));};exports[_0x8008('0x44')]=function(_0x255717,_0x1c4cda){return db[_0x8008('0x3c')]['create'](_0x255717[_0x8008('0x45')],{})[_0x8008('0x21')](respondWithResult(_0x1c4cda,0xc9))[_0x8008('0x41')](handleError(_0x1c4cda,null));};exports[_0x8008('0x20')]=function(_0x6fa09b,_0x340724){if(_0x6fa09b[_0x8008('0x45')]['id']){delete _0x6fa09b[_0x8008('0x45')]['id'];}return db[_0x8008('0x3c')][_0x8008('0x46')]({'where':{'id':_0x6fa09b[_0x8008('0x47')]['id']}})[_0x8008('0x21')](handleEntityNotFound(_0x340724,null))['then'](saveUpdates(_0x6fa09b[_0x8008('0x45')],null))[_0x8008('0x21')](respondWithResult(_0x340724,null))[_0x8008('0x41')](handleError(_0x340724,null));};exports[_0x8008('0x48')]=function(_0xf44b42,_0x1de20e){return db[_0x8008('0x3c')][_0x8008('0x46')]({'where':{'id':_0xf44b42[_0x8008('0x47')]['id']}})['then'](handleEntityNotFound(_0x1de20e,null))[_0x8008('0x21')](removeEntity(_0x1de20e,null))[_0x8008('0x41')](handleError(_0x1de20e,null));};exports[_0x8008('0x49')]=function(_0x32dc0f,_0x2cb721,_0x51f9ed){return db[_0x8008('0x3c')][_0x8008('0x46')]({'where':{'id':_0x32dc0f['params']['id']},'attributes':['id',_0x8008('0x4a'),_0x8008('0x4b')]})[_0x8008('0x21')](handleEntityNotFound(_0x2cb721,null))['then'](function(_0x143676){if(_0x143676){if(!_0x143676['recording']){throw new db[(_0x8008('0x4c'))][(_0x8008('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x20f689={'Content-Type':'audio/wav','Content-Disposition':_0x8008('0x4e')};if(_0x143676[_0x8008('0x4b')]){_0x20f689[_0x8008('0x4f')]=_0x8008('0x50')+_0x143676[_0x8008('0x4b')]+_0x8008('0x51');}_0x2cb721[_0x8008('0x1c')](_0x20f689);return _0x2cb721[_0x8008('0x25')](new Buffer(_0x143676['recording']));}})[_0x8008('0x41')](handleError(_0x2cb721,null));}; \ No newline at end of file +var _0xd81b=['ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','stack','name','send','index','map','VoiceMailMessage','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','recording','Sequelize'];(function(_0xe2684e,_0x457bd7){var _0x4e4668=function(_0x49131c){while(--_0x49131c){_0xe2684e['push'](_0xe2684e['shift']());}};_0x4e4668(++_0x457bd7);}(_0xd81b,0x1a1));var _0xbd81=function(_0xf51edd,_0x194dac){_0xf51edd=_0xf51edd-0x0;var _0x28800b=_0xd81b[_0xf51edd];return _0x28800b;};'use strict';var emlformat=require(_0xbd81('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbd81('0x1'));var rp=require(_0xbd81('0x2'));var moment=require(_0xbd81('0x3'));var BPromise=require(_0xbd81('0x4'));var Mustache=require('mustache');var util=require(_0xbd81('0x5'));var path=require(_0xbd81('0x6'));var sox=require(_0xbd81('0x7'));var csv=require(_0xbd81('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd81('0x9'));var _=require(_0xbd81('0xa'));var squel=require(_0xbd81('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd81('0xc'));var deskjs=require(_0xbd81('0xd'));var toCsv=require(_0xbd81('0x8'));var querystring=require(_0xbd81('0xe'));var Papa=require('papaparse');var Redis=require(_0xbd81('0xf'));var authService=require(_0xbd81('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbd81('0x11'));var hardwareService=require(_0xbd81('0x12'));var logger=require(_0xbd81('0x13'))('api');var utils=require(_0xbd81('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd81('0x15'));var db=require(_0xbd81('0x16'))['db'];function respondWithStatusCode(_0x2a20ea,_0x5253f6){_0x5253f6=_0x5253f6||0xcc;return function(_0x12124a){if(_0x12124a){return _0x2a20ea[_0xbd81('0x17')](_0x5253f6);}return _0x2a20ea[_0xbd81('0x18')](_0x5253f6)[_0xbd81('0x19')]();};}function respondWithResult(_0x161726,_0x4f1fff){_0x4f1fff=_0x4f1fff||0xc8;return function(_0x56b196){if(_0x56b196){return _0x161726[_0xbd81('0x18')](_0x4f1fff)[_0xbd81('0x1a')](_0x56b196);}};}function respondWithFilteredResult(_0x13feab,_0x21eb3d){return function(_0x3adbb0){if(_0x3adbb0){var _0x5d2540=typeof _0x21eb3d[_0xbd81('0x1b')]===_0xbd81('0x1c')&&typeof _0x21eb3d['limit']===_0xbd81('0x1c');var _0x409403=_0x3adbb0[_0xbd81('0x1d')];var _0x37ac3b=_0x5d2540?0x0:_0x21eb3d[_0xbd81('0x1b')];var _0xa39c1e=_0x5d2540?_0x3adbb0['count']:_0x21eb3d[_0xbd81('0x1b')]+_0x21eb3d[_0xbd81('0x1e')];var _0x50d71a;if(_0xa39c1e>=_0x409403){_0xa39c1e=_0x409403;_0x50d71a=0xc8;}else{_0x50d71a=0xce;}_0x13feab[_0xbd81('0x18')](_0x50d71a);return _0x13feab[_0xbd81('0x1f')]('Content-Range',_0x37ac3b+'-'+_0xa39c1e+'/'+_0x409403)['json'](_0x3adbb0);}return null;};}function patchUpdates(_0x4bb475){return function(_0x4aa177){try{jsonpatch[_0xbd81('0x20')](_0x4aa177,_0x4bb475,!![]);}catch(_0x25616d){return BPromise[_0xbd81('0x21')](_0x25616d);}return _0x4aa177['save']();};}function saveUpdates(_0x270c10,_0x1dcd83){return function(_0x3d9614){if(_0x3d9614){return _0x3d9614[_0xbd81('0x22')](_0x270c10)[_0xbd81('0x23')](function(_0x5a4cb5){return _0x5a4cb5;});}return null;};}function removeEntity(_0x27b97f,_0x3fc36e){return function(_0x16d970){if(_0x16d970){return _0x16d970[_0xbd81('0x24')]()[_0xbd81('0x23')](function(){_0x27b97f[_0xbd81('0x18')](0xcc)[_0xbd81('0x19')]();});}};}function handleEntityNotFound(_0x20d790,_0x4a9f86){return function(_0x32b8c2){if(!_0x32b8c2){_0x20d790[_0xbd81('0x17')](0x194);}return _0x32b8c2;};}function handleError(_0x209587,_0x18cdaa){_0x18cdaa=_0x18cdaa||0x1f4;return function(_0x228961){logger['error'](_0x228961[_0xbd81('0x25')]);if(_0x228961[_0xbd81('0x26')]){delete _0x228961[_0xbd81('0x26')];}_0x209587[_0xbd81('0x18')](_0x18cdaa)[_0xbd81('0x27')](_0x228961);};}exports[_0xbd81('0x28')]=function(_0x11b0fe,_0x5e9888){var _0x5722b0={},_0x5c6476={},_0x4eb1cb={'count':0x0,'rows':[]};var _0x3d0ef9=_[_0xbd81('0x29')](db[_0xbd81('0x2a')]['rawAttributes'],function(_0x4facd4){return{'name':_0x4facd4['fieldName'],'type':_0x4facd4[_0xbd81('0x2b')][_0xbd81('0x2c')]};});_0x5c6476[_0xbd81('0x2d')]=_[_0xbd81('0x2e')](_[_0xbd81('0x29')](_0x3d0ef9,_0xbd81('0x26')),[_0xbd81('0x26')]);_0x5c6476[_0xbd81('0x2f')]=_[_0xbd81('0x30')](_0x11b0fe[_0xbd81('0x2f')]);_0x5c6476[_0xbd81('0x31')]=_[_0xbd81('0x32')](_0x5c6476[_0xbd81('0x2d')],_0x5c6476[_0xbd81('0x2f')]);_0x5722b0[_0xbd81('0x33')]=_[_0xbd81('0x32')](_0x5c6476[_0xbd81('0x2d')],qs[_0xbd81('0x34')](_0x11b0fe[_0xbd81('0x2f')][_0xbd81('0x34')]));_0x5722b0[_0xbd81('0x33')]=_0x5722b0[_0xbd81('0x33')][_0xbd81('0x35')]?_0x5722b0[_0xbd81('0x33')]:_0x5c6476['model'];if(!_0x11b0fe[_0xbd81('0x2f')][_0xbd81('0x36')](_0xbd81('0x37'))){_0x5722b0[_0xbd81('0x1e')]=qs[_0xbd81('0x1e')](_0x11b0fe[_0xbd81('0x2f')][_0xbd81('0x1e')]);_0x5722b0[_0xbd81('0x1b')]=qs['offset'](_0x11b0fe[_0xbd81('0x2f')]['offset']);}_0x5722b0[_0xbd81('0x38')]=qs[_0xbd81('0x39')](_0x11b0fe[_0xbd81('0x2f')][_0xbd81('0x39')]);_0x5722b0[_0xbd81('0x3a')]=qs[_0xbd81('0x31')](_[_0xbd81('0x3b')](_0x11b0fe['query'],_0x5c6476['filters']),_0x3d0ef9);if(_0x11b0fe['query'][_0xbd81('0x3c')]){_0x5722b0['where']=_['merge'](_0x5722b0[_0xbd81('0x3a')],{'$or':_['map'](_0x3d0ef9,function(_0x11311e){if(_0x11311e['type']!=='VIRTUAL'){var _0x3ca01f={};_0x3ca01f[_0x11311e[_0xbd81('0x26')]]={'$like':'%'+_0x11b0fe[_0xbd81('0x2f')][_0xbd81('0x3c')]+'%'};return _0x3ca01f;}})});}_0x5722b0=_[_0xbd81('0x3d')]({},_0x5722b0,_0x11b0fe[_0xbd81('0x3e')]);var _0x2e6f6b={'where':_0x5722b0[_0xbd81('0x3a')]};return db[_0xbd81('0x2a')][_0xbd81('0x1d')](_0x2e6f6b)[_0xbd81('0x23')](function(_0x1acc12){_0x4eb1cb[_0xbd81('0x1d')]=_0x1acc12;if(_0x11b0fe[_0xbd81('0x2f')][_0xbd81('0x3f')]){_0x5722b0[_0xbd81('0x40')]=[{'all':!![]}];}return db[_0xbd81('0x2a')]['findAll'](_0x5722b0);})[_0xbd81('0x23')](function(_0x2164d8){_0x4eb1cb[_0xbd81('0x41')]=_0x2164d8;return _0x4eb1cb;})[_0xbd81('0x23')](respondWithFilteredResult(_0x5e9888,_0x5722b0))[_0xbd81('0x42')](handleError(_0x5e9888,null));};exports[_0xbd81('0x43')]=function(_0x33e711,_0x5c5a38){var _0x26dff2={'raw':!![],'where':{'id':_0x33e711['params']['id']}},_0x33aa2d={};_0x33aa2d[_0xbd81('0x2d')]=_[_0xbd81('0x30')](db[_0xbd81('0x2a')][_0xbd81('0x44')]);_0x33aa2d['query']=_[_0xbd81('0x30')](_0x33e711[_0xbd81('0x2f')]);_0x33aa2d['filters']=_['intersection'](_0x33aa2d[_0xbd81('0x2d')],_0x33aa2d[_0xbd81('0x2f')]);_0x26dff2[_0xbd81('0x33')]=_[_0xbd81('0x32')](_0x33aa2d['model'],qs[_0xbd81('0x34')](_0x33e711['query'][_0xbd81('0x34')]));_0x26dff2[_0xbd81('0x33')]=_0x26dff2[_0xbd81('0x33')][_0xbd81('0x35')]?_0x26dff2[_0xbd81('0x33')]:_0x33aa2d[_0xbd81('0x2d')];if(_0x33e711[_0xbd81('0x2f')]['includeAll']){_0x26dff2[_0xbd81('0x40')]=[{'all':!![]}];}_0x26dff2=_[_0xbd81('0x3d')]({},_0x26dff2,_0x33e711['options']);return db[_0xbd81('0x2a')][_0xbd81('0x45')](_0x26dff2)['then'](handleEntityNotFound(_0x5c5a38,null))[_0xbd81('0x23')](respondWithResult(_0x5c5a38,null))[_0xbd81('0x42')](handleError(_0x5c5a38,null));};exports[_0xbd81('0x46')]=function(_0x36462e,_0x10444b){return db['VoiceMailMessage'][_0xbd81('0x46')](_0x36462e[_0xbd81('0x47')],{})[_0xbd81('0x23')](respondWithResult(_0x10444b,0xc9))[_0xbd81('0x42')](handleError(_0x10444b,null));};exports['update']=function(_0xbfab29,_0x147ad6){if(_0xbfab29[_0xbd81('0x47')]['id']){delete _0xbfab29[_0xbd81('0x47')]['id'];}return db[_0xbd81('0x2a')][_0xbd81('0x45')]({'where':{'id':_0xbfab29['params']['id']}})[_0xbd81('0x23')](handleEntityNotFound(_0x147ad6,null))[_0xbd81('0x23')](saveUpdates(_0xbfab29['body'],null))[_0xbd81('0x23')](respondWithResult(_0x147ad6,null))[_0xbd81('0x42')](handleError(_0x147ad6,null));};exports[_0xbd81('0x24')]=function(_0x2b63c8,_0x431ba8){return db[_0xbd81('0x2a')][_0xbd81('0x45')]({'where':{'id':_0x2b63c8[_0xbd81('0x48')]['id']}})['then'](handleEntityNotFound(_0x431ba8,null))[_0xbd81('0x23')](removeEntity(_0x431ba8,null))[_0xbd81('0x42')](handleError(_0x431ba8,null));};exports['download']=function(_0x426e08,_0x3b77de,_0x1e7cf4){return db[_0xbd81('0x2a')][_0xbd81('0x45')]({'where':{'id':_0x426e08[_0xbd81('0x48')]['id']},'attributes':['id','recording','msg_id']})[_0xbd81('0x23')](handleEntityNotFound(_0x3b77de,null))[_0xbd81('0x23')](function(_0x9897cc){if(_0x9897cc){if(!_0x9897cc[_0xbd81('0x49')]){throw new db[(_0xbd81('0x4a'))][(_0xbd81('0x4b'))](_0xbd81('0x4c'));}var _0x21c9d8={'Content-Type':_0xbd81('0x4d'),'Content-Disposition':_0xbd81('0x4e')};if(_0x9897cc[_0xbd81('0x4f')]){_0x21c9d8[_0xbd81('0x50')]=_0xbd81('0x51')+_0x9897cc[_0xbd81('0x4f')]+'.wav\x22';}_0x3b77de[_0xbd81('0x1f')](_0x21c9d8);return _0x3b77de[_0xbd81('0x27')](new Buffer(_0x9897cc[_0xbd81('0x49')]));}})[_0xbd81('0x42')](handleError(_0x3b77de,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2407420..2f26b3b 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 _0x27a0=['util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x4e9052,_0x4b76da){var _0x1ffdeb=function(_0x3388c7){while(--_0x3388c7){_0x4e9052['push'](_0x4e9052['shift']());}};_0x1ffdeb(++_0x4b76da);}(_0x27a0,0xd8));var _0x027a=function(_0x40a962,_0x5d2148){_0x40a962=_0x40a962-0x0;var _0x327bf4=_0x27a0[_0x40a962];return _0x327bf4;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require('../../config/logger')(_0x027a('0x1'));var moment=require(_0x027a('0x2'));var BPromise=require(_0x027a('0x3'));var rp=require(_0x027a('0x4'));var fs=require('fs');var path=require(_0x027a('0x5'));var rimraf=require('rimraf');var config=require(_0x027a('0x6'));var attributes=require(_0x027a('0x7'));module[_0x027a('0x8')]=function(_0x4d87bb,_0x202682){return _0x4d87bb['define'](_0x027a('0x9'),attributes,{'tableName':_0x027a('0xa'),'paranoid':![],'indexes':[{'name':_0x027a('0xb'),'fields':[_0x027a('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd756=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMailMessage.attributes'];(function(_0x182bc7,_0x5fe9d7){var _0x4316ea=function(_0x235802){while(--_0x235802){_0x182bc7['push'](_0x182bc7['shift']());}};_0x4316ea(++_0x5fe9d7);}(_0xd756,0x67));var _0x6d75=function(_0x47382c,_0x943f0b){_0x47382c=_0x47382c-0x0;var _0x1ef790=_0xd756[_0x47382c];return _0x1ef790;};'use strict';var _=require(_0x6d75('0x0'));var util=require(_0x6d75('0x1'));var logger=require(_0x6d75('0x2'))(_0x6d75('0x3'));var moment=require(_0x6d75('0x4'));var BPromise=require(_0x6d75('0x5'));var rp=require(_0x6d75('0x6'));var fs=require('fs');var path=require(_0x6d75('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d75('0x8'));module[_0x6d75('0x9')]=function(_0x5e84b6,_0x98a92a){return _0x5e84b6[_0x6d75('0xa')](_0x6d75('0xb'),attributes,{'tableName':_0x6d75('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x6d75('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5ab29c8..008593c 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 _0x434d=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x35a553,_0x26a6ec){var _0x1591b8=function(_0xa595a5){while(--_0xa595a5){_0x35a553['push'](_0x35a553['shift']());}};_0x1591b8(++_0x26a6ec);}(_0x434d,0x100));var _0xd434=function(_0x5b01d6,_0x5f2e4c){_0x5b01d6=_0x5b01d6-0x0;var _0xa18190=_0x434d[_0x5b01d6];return _0xa18190;};'use strict';var _=require('lodash');var util=require(_0xd434('0x0'));var moment=require(_0xd434('0x1'));var BPromise=require(_0xd434('0x2'));var rs=require(_0xd434('0x3'));var fs=require('fs');var Redis=require(_0xd434('0x4'));var db=require(_0xd434('0x5'))['db'];var utils=require(_0xd434('0x6'));var logger=require(_0xd434('0x7'))('rpc');var config=require(_0xd434('0x8'));var jayson=require(_0xd434('0x9'));var client=jayson[_0xd434('0xa')][_0xd434('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x97a6e1,_0x5bb161,_0x50ca42){return new BPromise(function(_0x44881d,_0x4ea3a3){return client['request'](_0x97a6e1,_0x50ca42)[_0xd434('0xc')](function(_0x492f5e){logger[_0xd434('0xd')](_0xd434('0xe'),_0x5bb161,'request\x20sent');logger['debug'](_0xd434('0xf'),_0x5bb161,_0xd434('0x10'),JSON['stringify'](_0x492f5e));if(_0x492f5e['error']){if(_0x492f5e[_0xd434('0x11')]['code']===0x1f4){logger['error'](_0xd434('0xe'),_0x5bb161,_0x492f5e[_0xd434('0x11')][_0xd434('0x12')]);return _0x4ea3a3(_0x492f5e[_0xd434('0x11')][_0xd434('0x12')]);}logger['error'](_0xd434('0xe'),_0x5bb161,_0x492f5e['error'][_0xd434('0x12')]);return _0x44881d(_0x492f5e['error'][_0xd434('0x12')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x5bb161,_0xd434('0x10'));_0x44881d(_0x492f5e[_0xd434('0x13')][_0xd434('0x12')]);}})[_0xd434('0x14')](function(_0x1772ca){logger['error'](_0xd434('0xe'),_0x5bb161,_0x1772ca);_0x4ea3a3(_0x1772ca);});});} \ No newline at end of file +var _0xb3ef=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code','message','VoiceMailMessage,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0xb3ef,0x166));var _0xfb3e=function(_0x4d7a29,_0x464577){_0x4d7a29=_0x4d7a29-0x0;var _0x4f8ae7=_0xb3ef[_0x4d7a29];return _0x4f8ae7;};'use strict';var _=require(_0xfb3e('0x0'));var util=require(_0xfb3e('0x1'));var moment=require(_0xfb3e('0x2'));var BPromise=require(_0xfb3e('0x3'));var rs=require(_0xfb3e('0x4'));var fs=require('fs');var Redis=require(_0xfb3e('0x5'));var db=require(_0xfb3e('0x6'))['db'];var utils=require(_0xfb3e('0x7'));var logger=require(_0xfb3e('0x8'))(_0xfb3e('0x9'));var config=require(_0xfb3e('0xa'));var jayson=require(_0xfb3e('0xb'));var client=jayson[_0xfb3e('0xc')][_0xfb3e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1eafdd,_0x1c6965,_0x4b0e1a){return new BPromise(function(_0x5ed870,_0x2cd35f){return client[_0xfb3e('0xe')](_0x1eafdd,_0x4b0e1a)['then'](function(_0xc0a56){logger[_0xfb3e('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1c6965,_0xfb3e('0x10'));logger[_0xfb3e('0x11')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1c6965,_0xfb3e('0x10'),JSON['stringify'](_0xc0a56));if(_0xc0a56[_0xfb3e('0x12')]){if(_0xc0a56[_0xfb3e('0x12')][_0xfb3e('0x13')]===0x1f4){logger[_0xfb3e('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x1c6965,_0xc0a56[_0xfb3e('0x12')][_0xfb3e('0x14')]);return _0x2cd35f(_0xc0a56[_0xfb3e('0x12')][_0xfb3e('0x14')]);}logger[_0xfb3e('0x12')](_0xfb3e('0x15'),_0x1c6965,_0xc0a56[_0xfb3e('0x12')]['message']);return _0x5ed870(_0xc0a56[_0xfb3e('0x12')]['message']);}else{logger[_0xfb3e('0xf')](_0xfb3e('0x15'),_0x1c6965,_0xfb3e('0x10'));_0x5ed870(_0xc0a56[_0xfb3e('0x16')]['message']);}})[_0xfb3e('0x17')](function(_0x4f0571){logger['error'](_0xfb3e('0x15'),_0x1c6965,_0x4f0571);_0x2cd35f(_0x4f0571);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index b053d4a..5c33089 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 _0xa0b9=['destroy','removeSound','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','getSounds','post','create','addSound','put','update','delete'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xa0b9,0x8d));var _0x9a0b=function(_0x16c381,_0x389245){_0x16c381=_0x16c381-0x0;var _0x3a864f=_0xa0b9[_0x16c381];return _0x3a864f;};'use strict';var multer=require(_0x9a0b('0x0'));var util=require(_0x9a0b('0x1'));var path=require(_0x9a0b('0x2'));var timeout=require(_0x9a0b('0x3'));var express=require(_0x9a0b('0x4'));var router=express['Router']();var fs_extra=require(_0x9a0b('0x5'));var auth=require(_0x9a0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9a0b('0x7'));var controller=require(_0x9a0b('0x8'));router[_0x9a0b('0x9')]('/',auth[_0x9a0b('0xa')](),controller['index']);router[_0x9a0b('0x9')](_0x9a0b('0xb'),auth[_0x9a0b('0xa')](),controller[_0x9a0b('0xc')]);router[_0x9a0b('0x9')]('/:id/sounds',auth[_0x9a0b('0xa')](),controller[_0x9a0b('0xd')]);router[_0x9a0b('0xe')]('/',auth[_0x9a0b('0xa')](),controller[_0x9a0b('0xf')]);router[_0x9a0b('0xe')]('/:id/sounds',auth[_0x9a0b('0xa')](),controller[_0x9a0b('0x10')]);router[_0x9a0b('0x11')](_0x9a0b('0xb'),auth[_0x9a0b('0xa')](),controller[_0x9a0b('0x12')]);router[_0x9a0b('0x13')](_0x9a0b('0xb'),auth[_0x9a0b('0xa')](),controller[_0x9a0b('0x14')]);router[_0x9a0b('0x13')]('/:id/sounds/:id2',auth[_0x9a0b('0xa')](),controller[_0x9a0b('0x15')]);module[_0x9a0b('0x16')]=router; \ No newline at end of file +var _0x9d4d=['post','/:id/sounds','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','show','getSounds','create'];(function(_0x373827,_0x32efc8){var _0x30deee=function(_0x8abffd){while(--_0x8abffd){_0x373827['push'](_0x373827['shift']());}};_0x30deee(++_0x32efc8);}(_0x9d4d,0x14b));var _0xd9d4=function(_0x5d3805,_0x4e0ec5){_0x5d3805=_0x5d3805-0x0;var _0xeff499=_0x9d4d[_0x5d3805];return _0xeff499;};'use strict';var multer=require(_0xd9d4('0x0'));var util=require(_0xd9d4('0x1'));var path=require('path');var timeout=require(_0xd9d4('0x2'));var express=require(_0xd9d4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd9d4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd9d4('0x5'));var controller=require(_0xd9d4('0x6'));router[_0xd9d4('0x7')]('/',auth['isAuthenticated'](),controller[_0xd9d4('0x8')]);router[_0xd9d4('0x7')](_0xd9d4('0x9'),auth[_0xd9d4('0xa')](),controller[_0xd9d4('0xb')]);router[_0xd9d4('0x7')]('/:id/sounds',auth[_0xd9d4('0xa')](),controller[_0xd9d4('0xc')]);router['post']('/',auth[_0xd9d4('0xa')](),controller[_0xd9d4('0xd')]);router[_0xd9d4('0xe')](_0xd9d4('0xf'),auth[_0xd9d4('0xa')](),controller['addSound']);router[_0xd9d4('0x10')](_0xd9d4('0x9'),auth[_0xd9d4('0xa')](),controller[_0xd9d4('0x11')]);router[_0xd9d4('0x12')](_0xd9d4('0x9'),auth[_0xd9d4('0xa')](),controller[_0xd9d4('0x13')]);router['delete'](_0xd9d4('0x14'),auth[_0xd9d4('0xa')](),controller[_0xd9d4('0x15')]);module[_0xd9d4('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 0d26ae7..1136f60 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 _0x5684=['quietmp3','mp3','BOOLEAN','sequelize','exports','STRING','name','custom','files','mp3nb','quietmp3nb'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x5684,0xf5));var _0x4568=function(_0x2eb484,_0x7d7b55){_0x2eb484=_0x2eb484-0x0;var _0x195fcb=_0x5684[_0x2eb484];return _0x195fcb;};'use strict';var Sequelize=require(_0x4568('0x0'));module[_0x4568('0x1')]={'name':{'type':Sequelize[_0x4568('0x2')],'allowNull':![],'unique':_0x4568('0x3')},'mode':{'type':Sequelize['ENUM'](_0x4568('0x4'),_0x4568('0x5'),_0x4568('0x6'),_0x4568('0x7'),_0x4568('0x8'),_0x4568('0x9')),'allowNull':!![],'defaultValue':_0x4568('0x5')},'directory':{'type':Sequelize[_0x4568('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x4568('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4568('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x4568('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x4568('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x379c=['custom','mp3nb','quietmp3nb','files','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM'];(function(_0x3da385,_0x4def34){var _0x465e46=function(_0x4730cf){while(--_0x4730cf){_0x3da385['push'](_0x3da385['shift']());}};_0x465e46(++_0x4def34);}(_0x379c,0xb6));var _0xc379=function(_0x49ecae,_0x4a3d84){_0x49ecae=_0x49ecae-0x0;var _0x4f9644=_0x379c[_0x49ecae];return _0x4f9644;};'use strict';var Sequelize=require(_0xc379('0x0'));module[_0xc379('0x1')]={'name':{'type':Sequelize[_0xc379('0x2')],'allowNull':![],'unique':_0xc379('0x3')},'mode':{'type':Sequelize[_0xc379('0x4')](_0xc379('0x5'),'files',_0xc379('0x6'),_0xc379('0x7'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0xc379('0x8')},'directory':{'type':Sequelize[_0xc379('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xc379('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc379('0x2')],'allowNull':!![],'defaultValue':_0xc379('0x9')},'format':{'type':Sequelize[_0xc379('0x2')],'allowNull':!![]},'stamp':{'type':_0xc379('0xa')},'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 dc1e752..a701f71 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 _0xd967=['message','addSound','findOne','save_name','createdAt','join','format','%s.%s','basename','extname','converted_format','symlinkSync','Sequelize','removeSound','id2','Sound','length','order','getSounds','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','sequelize','transaction','mode','files','root','server/files/moh','directory','0777','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','ValidationError'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd967,0xe7));var _0x7d96=function(_0x11a741,_0x1e7097){_0x11a741=_0x11a741-0x0;var _0xa466f6=_0xd967[_0x11a741];return _0xa466f6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d96('0x0'));var jsonpatch=require(_0x7d96('0x1'));var rp=require('request-promise');var moment=require(_0x7d96('0x2'));var BPromise=require(_0x7d96('0x3'));var Mustache=require(_0x7d96('0x4'));var util=require(_0x7d96('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7d96('0x6'));var ejs=require(_0x7d96('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7d96('0x8'));var crypto=require(_0x7d96('0x9'));var jsforce=require(_0x7d96('0xa'));var deskjs=require(_0x7d96('0xb'));var toCsv=require(_0x7d96('0x6'));var querystring=require(_0x7d96('0xc'));var Papa=require(_0x7d96('0xd'));var Redis=require('ioredis');var authService=require(_0x7d96('0xe'));var qs=require(_0x7d96('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d96('0x10'));var utils=require('../../config/utils');var config=require(_0x7d96('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d96('0x12'))['db'];function respondWithStatusCode(_0x547817,_0x8e3ec2){_0x8e3ec2=_0x8e3ec2||0xcc;return function(_0x60cbbe){if(_0x60cbbe){return _0x547817[_0x7d96('0x13')](_0x8e3ec2);}return _0x547817[_0x7d96('0x14')](_0x8e3ec2)[_0x7d96('0x15')]();};}function respondWithResult(_0xddb7f0,_0x3ed808){_0x3ed808=_0x3ed808||0xc8;return function(_0x1c2932){if(_0x1c2932){return _0xddb7f0[_0x7d96('0x14')](_0x3ed808)[_0x7d96('0x16')](_0x1c2932);}};}function respondWithFilteredResult(_0x59ed95,_0x341f59){return function(_0x4b4600){if(_0x4b4600){var _0x5b8a29=typeof _0x341f59[_0x7d96('0x17')]===_0x7d96('0x18')&&typeof _0x341f59[_0x7d96('0x19')]===_0x7d96('0x18');var _0x5bbe81=_0x4b4600[_0x7d96('0x1a')];var _0xedc119=_0x5b8a29?0x0:_0x341f59['offset'];var _0x125259=_0x5b8a29?_0x4b4600[_0x7d96('0x1a')]:_0x341f59[_0x7d96('0x17')]+_0x341f59[_0x7d96('0x19')];var _0x5f00c2;if(_0x125259>=_0x5bbe81){_0x125259=_0x5bbe81;_0x5f00c2=0xc8;}else{_0x5f00c2=0xce;}_0x59ed95['status'](_0x5f00c2);return _0x59ed95[_0x7d96('0x1b')]('Content-Range',_0xedc119+'-'+_0x125259+'/'+_0x5bbe81)[_0x7d96('0x16')](_0x4b4600);}return null;};}function patchUpdates(_0x397c73){return function(_0x3e2b28){try{jsonpatch[_0x7d96('0x1c')](_0x3e2b28,_0x397c73,!![]);}catch(_0x497f96){return BPromise['reject'](_0x497f96);}return _0x3e2b28['save']();};}function saveUpdates(_0x1791c1,_0x1bbc24){return function(_0x1a078d){if(_0x1a078d){return _0x1a078d[_0x7d96('0x1d')](_0x1791c1)[_0x7d96('0x1e')](function(_0x18a7ec){return _0x18a7ec;});}return null;};}function removeEntity(_0x5975d9,_0x2cc411){return function(_0x47c9f2){if(_0x47c9f2){return _0x47c9f2[_0x7d96('0x1f')]()[_0x7d96('0x1e')](function(){var _0x32f7a8=_0x47c9f2['get']({'plain':!![]});var _0x55f3ee=_0x7d96('0x20');return db[_0x7d96('0x21')][_0x7d96('0x1f')]({'where':{'type':_0x55f3ee,'resourceId':_0x32f7a8['id']}})[_0x7d96('0x1e')](function(){return _0x47c9f2;});})['then'](function(){_0x5975d9[_0x7d96('0x14')](0xcc)[_0x7d96('0x15')]();});}};}function handleEntityNotFound(_0x1ac1a2,_0x24d8b7){return function(_0xdb386f){if(!_0xdb386f){_0x1ac1a2[_0x7d96('0x13')](0x194);}return _0xdb386f;};}function handleError(_0x1e4d14,_0x412047){_0x412047=_0x412047||0x1f4;return function(_0x5d67d6){logger[_0x7d96('0x22')](_0x5d67d6['stack']);if(_0x5d67d6[_0x7d96('0x23')]){delete _0x5d67d6[_0x7d96('0x23')];}_0x1e4d14[_0x7d96('0x14')](_0x412047)[_0x7d96('0x24')](_0x5d67d6);};}exports['index']=function(_0x26b720,_0x2062ba){var _0x20246d={},_0x494d33={},_0x237ba1={'count':0x0,'rows':[]};var _0x3cc989=_[_0x7d96('0x25')](db[_0x7d96('0x26')][_0x7d96('0x27')],function(_0x3037ba){return{'name':_0x3037ba[_0x7d96('0x28')],'type':_0x3037ba[_0x7d96('0x29')][_0x7d96('0x2a')]};});_0x494d33[_0x7d96('0x2b')]=_[_0x7d96('0x25')](_0x3cc989,_0x7d96('0x23'));_0x494d33[_0x7d96('0x2c')]=_[_0x7d96('0x2d')](_0x26b720[_0x7d96('0x2c')]);_0x494d33[_0x7d96('0x2e')]=_['intersection'](_0x494d33['model'],_0x494d33[_0x7d96('0x2c')]);_0x20246d[_0x7d96('0x2f')]=_[_0x7d96('0x30')](_0x494d33[_0x7d96('0x2b')],qs[_0x7d96('0x31')](_0x26b720['query'][_0x7d96('0x31')]));_0x20246d['attributes']=_0x20246d[_0x7d96('0x2f')]['length']?_0x20246d[_0x7d96('0x2f')]:_0x494d33[_0x7d96('0x2b')];if(!_0x26b720[_0x7d96('0x2c')][_0x7d96('0x32')](_0x7d96('0x33'))){_0x20246d['limit']=qs[_0x7d96('0x19')](_0x26b720[_0x7d96('0x2c')]['limit']);_0x20246d[_0x7d96('0x17')]=qs[_0x7d96('0x17')](_0x26b720[_0x7d96('0x2c')]['offset']);}_0x20246d['order']=qs[_0x7d96('0x34')](_0x26b720[_0x7d96('0x2c')][_0x7d96('0x34')]);delete _0x26b720[_0x7d96('0x2c')]['sort'];_0x20246d[_0x7d96('0x35')]=qs[_0x7d96('0x2e')](_[_0x7d96('0x36')](_0x26b720[_0x7d96('0x2c')],_0x494d33[_0x7d96('0x2e')]),_0x3cc989);if(_0x26b720['query'][_0x7d96('0x37')]){_0x20246d[_0x7d96('0x35')]=_[_0x7d96('0x38')](_0x20246d['where'],{'$or':_[_0x7d96('0x25')](_0x3cc989,function(_0xb28b2c){if(_0xb28b2c[_0x7d96('0x29')]!==_0x7d96('0x39')){var _0x1e366c={};_0x1e366c[_0xb28b2c[_0x7d96('0x23')]]={'$like':'%'+_0x26b720[_0x7d96('0x2c')][_0x7d96('0x37')]+'%'};return _0x1e366c;}})});}_0x20246d=_['merge']({},_0x20246d,_0x26b720[_0x7d96('0x3a')]);var _0x17e8f8={'where':_0x20246d[_0x7d96('0x35')]};return db['VoiceMusicOnHold'][_0x7d96('0x1a')](_0x17e8f8)['then'](function(_0x5351ae){_0x237ba1[_0x7d96('0x1a')]=_0x5351ae;if(_0x26b720[_0x7d96('0x2c')][_0x7d96('0x3b')]){_0x20246d[_0x7d96('0x3c')]=[{'all':!![]}];}return db[_0x7d96('0x26')][_0x7d96('0x3d')](_0x20246d);})[_0x7d96('0x1e')](function(_0x30f95b){_0x237ba1[_0x7d96('0x3e')]=_0x30f95b;return _0x237ba1;})[_0x7d96('0x1e')](respondWithFilteredResult(_0x2062ba,_0x20246d))[_0x7d96('0x3f')](handleError(_0x2062ba,null));};exports[_0x7d96('0x40')]=function(_0x137c20,_0x4ee9ef){var _0x5b15c6={'raw':![],'where':{'id':_0x137c20[_0x7d96('0x41')]['id']}},_0x2c1350={};_0x2c1350[_0x7d96('0x2b')]=_[_0x7d96('0x2d')](db['VoiceMusicOnHold']['rawAttributes']);_0x2c1350[_0x7d96('0x2c')]=_['keys'](_0x137c20['query']);_0x2c1350[_0x7d96('0x2e')]=_[_0x7d96('0x30')](_0x2c1350[_0x7d96('0x2b')],_0x2c1350[_0x7d96('0x2c')]);_0x5b15c6[_0x7d96('0x2f')]=_[_0x7d96('0x30')](_0x2c1350[_0x7d96('0x2b')],qs[_0x7d96('0x31')](_0x137c20[_0x7d96('0x2c')][_0x7d96('0x31')]));_0x5b15c6[_0x7d96('0x2f')]=_0x5b15c6[_0x7d96('0x2f')]['length']?_0x5b15c6[_0x7d96('0x2f')]:_0x2c1350['model'];if(_0x137c20['query'][_0x7d96('0x3b')]){_0x5b15c6[_0x7d96('0x3c')]=[{'all':!![]}];}_0x5b15c6=_[_0x7d96('0x38')]({},_0x5b15c6,_0x137c20['options']);return db[_0x7d96('0x26')][_0x7d96('0x42')](_0x5b15c6)[_0x7d96('0x1e')](handleEntityNotFound(_0x4ee9ef,null))[_0x7d96('0x1e')](respondWithResult(_0x4ee9ef,null))[_0x7d96('0x3f')](handleError(_0x4ee9ef,null));};exports['update']=function(_0x1689fb,_0x220f34){if(_0x1689fb[_0x7d96('0x43')]['id']){delete _0x1689fb[_0x7d96('0x43')]['id'];}return db[_0x7d96('0x26')]['find']({'where':{'id':_0x1689fb[_0x7d96('0x41')]['id']}})[_0x7d96('0x1e')](handleEntityNotFound(_0x220f34,null))[_0x7d96('0x1e')](saveUpdates(_0x1689fb[_0x7d96('0x43')],null))[_0x7d96('0x1e')](respondWithResult(_0x220f34,null))[_0x7d96('0x3f')](handleError(_0x220f34,null));};exports[_0x7d96('0x44')]=function(_0x37a066,_0x347a1c,_0xfd16c2){return db[_0x7d96('0x45')][_0x7d96('0x46')](function(_0x283fda){if(_0x37a066[_0x7d96('0x43')][_0x7d96('0x47')]===_0x7d96('0x48')){_0x37a066[_0x7d96('0x43')]['directory']=path['join'](config[_0x7d96('0x49')],_0x7d96('0x4a'),_0x37a066[_0x7d96('0x43')][_0x7d96('0x23')]);}return db['VoiceMusicOnHold']['create'](_0x37a066[_0x7d96('0x43')],{'transaction':_0x283fda})[_0x7d96('0x1e')](function(_0x46e62e){if(_0x37a066[_0x7d96('0x43')][_0x7d96('0x47')]==='files'){fs['mkdirSync'](_0x46e62e[_0x7d96('0x4b')],parseInt(_0x7d96('0x4c'),0x8));}var _0x489bc6=_0x37a066[_0x7d96('0x4d')][_0x7d96('0x4e')]({'plain':!![]});if(!_0x489bc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x489bc6['role']===_0x7d96('0x4d')){var _0xf267b4=_0x46e62e[_0x7d96('0x4e')]({'plain':!![]});return db[_0x7d96('0x4f')]['find']({'where':{'name':_0x7d96('0x20'),'userProfileId':_0x489bc6[_0x7d96('0x50')]},'raw':!![]})[_0x7d96('0x1e')](function(_0x4f9bba){if(_0x4f9bba&&_0x4f9bba[_0x7d96('0x51')]===0x0){return db[_0x7d96('0x21')][_0x7d96('0x44')]({'name':_0xf267b4[_0x7d96('0x23')],'resourceId':_0xf267b4['id'],'type':_0x4f9bba[_0x7d96('0x23')],'sectionId':_0x4f9bba['id']},{})[_0x7d96('0x1e')](function(){return _0x46e62e;});}else{return _0x46e62e;}})[_0x7d96('0x3f')](function(_0x192dbf){logger[_0x7d96('0x22')](_0x7d96('0x52'),_0x192dbf);});}return _0x46e62e;});})[_0x7d96('0x1e')](respondWithResult(_0x347a1c,0xc9))[_0x7d96('0x3f')](handleError(_0x347a1c,null));};exports[_0x7d96('0x1f')]=function(_0x3f4c8e,_0x2f9843,_0x26e794){var _0x4231fa;return db[_0x7d96('0x26')][_0x7d96('0x42')]({'where':{'id':_0x3f4c8e['params']['id']}})[_0x7d96('0x1e')](function(_0x4809c6){if(_0x4809c6){return db[_0x7d96('0x45')][_0x7d96('0x46')](function(_0x1bfaf5){return _0x4809c6['destroy']({'transaction':_0x1bfaf5,'raw':!![]})['then'](function(_0x199dc6){if(_0x199dc6[_0x7d96('0x4b')]){fs[_0x7d96('0x53')](_0x199dc6[_0x7d96('0x4b')])['forEach'](function(_0x47430b){fs[_0x7d96('0x54')](path['join'](_0x199dc6[_0x7d96('0x4b')],_0x47430b));});fs[_0x7d96('0x55')](_0x199dc6[_0x7d96('0x4b')]);}return _0x199dc6;});})[_0x7d96('0x3f')](function(_0x586229){throw new db['Sequelize'][(_0x7d96('0x56'))](_0x586229[_0x7d96('0x57')]);});}})[_0x7d96('0x1e')](handleEntityNotFound(_0x2f9843,null))[_0x7d96('0x1e')](removeEntity(_0x2f9843,null))[_0x7d96('0x3f')](handleError(_0x2f9843,null));};exports[_0x7d96('0x58')]=function(_0x565bb6,_0x102d84,_0x4b3932){return db[_0x7d96('0x45')][_0x7d96('0x46')](function(_0x2fb7a6){var _0x437a2c;return db['VoiceMusicOnHold'][_0x7d96('0x42')]({'where':{'id':_0x565bb6[_0x7d96('0x41')]['id']}})['then'](function(_0x484dfb){if(_0x484dfb){_0x437a2c=_0x484dfb;return _0x484dfb['addSound'](_0x565bb6[_0x7d96('0x43')]['id'],{'transaction':_0x2fb7a6});}})[_0x7d96('0x1e')](function(_0x44b5ef){if(_0x44b5ef){return db['Sound'][_0x7d96('0x59')]({'where':{'id':_0x565bb6[_0x7d96('0x43')]['id']},'attributes':['id',_0x7d96('0x23'),_0x7d96('0x5a'),'converted_format',_0x7d96('0x5b')],'raw':!![]});}})[_0x7d96('0x1e')](function(_0xa75013){if(_0xa75013){var _0x58594c=path[_0x7d96('0x5c')](config[_0x7d96('0x49')],'server/files/sounds/converted',util[_0x7d96('0x5d')](_0x7d96('0x5e'),path[_0x7d96('0x5f')](_0xa75013[_0x7d96('0x5a')],path[_0x7d96('0x60')](_0xa75013[_0x7d96('0x5a')])),_0xa75013[_0x7d96('0x61')]));var _0x17dd96=path['join'](config[_0x7d96('0x49')],_0x7d96('0x4a'),_0x437a2c[_0x7d96('0x23')],util[_0x7d96('0x5d')](_0x7d96('0x5e'),_0xa75013[_0x7d96('0x23')],_0xa75013[_0x7d96('0x61')]));fs[_0x7d96('0x62')](_0x58594c,_0x17dd96);return _0xa75013;}})[_0x7d96('0x3f')](function(_0xea5189){throw new db[(_0x7d96('0x63'))]['ValidationError'](_0xea5189['message']);});})['then'](handleEntityNotFound(_0x102d84,null))[_0x7d96('0x1e')](respondWithResult(_0x102d84,0xc9))['catch'](handleError(_0x102d84,null));};exports['removeSound']=function(_0x1b918e,_0x369253,_0x2c6b1c){return db[_0x7d96('0x45')][_0x7d96('0x46')](function(_0x17488f){var _0x45ac7f;return db['VoiceMusicOnHold'][_0x7d96('0x59')]({'where':{'id':_0x1b918e['params']['id']}})[_0x7d96('0x1e')](handleEntityNotFound(_0x369253,null))[_0x7d96('0x1e')](function(_0x10f433){if(_0x10f433){_0x45ac7f=_0x10f433;return _0x10f433[_0x7d96('0x64')](_0x1b918e[_0x7d96('0x41')][_0x7d96('0x65')]);}})['then'](function(_0x3e1533){if(_0x3e1533){return db['Sound'][_0x7d96('0x59')]({'where':{'id':_0x1b918e[_0x7d96('0x41')][_0x7d96('0x65')]},'attributes':['id','name',_0x7d96('0x5a'),_0x7d96('0x61'),_0x7d96('0x5b')],'raw':!![]});}})[_0x7d96('0x1e')](function(_0x16c90c){if(_0x16c90c){fs[_0x7d96('0x54')](path['join'](_0x45ac7f[_0x7d96('0x4b')],util[_0x7d96('0x5d')](_0x7d96('0x5e'),_0x16c90c[_0x7d96('0x23')],_0x16c90c[_0x7d96('0x61')])));return _0x16c90c;}})[_0x7d96('0x3f')](function(_0x20d9a8){throw new db[(_0x7d96('0x63'))][(_0x7d96('0x56'))](_0x20d9a8[_0x7d96('0x57')]);});})[_0x7d96('0x1e')](handleEntityNotFound(_0x369253,null))[_0x7d96('0x1e')](respondWithStatusCode(_0x369253,0xcc))[_0x7d96('0x3f')](handleError(_0x369253,null));};exports['getSounds']=function(_0x29f704,_0x3793ff,_0x329595){var _0x20e41a={};var _0x7fb7={};var _0x3f7cfa;var _0xa55e2c;return db[_0x7d96('0x26')][_0x7d96('0x59')]({'where':{'id':_0x29f704[_0x7d96('0x41')]['id']}})['then'](handleEntityNotFound(_0x3793ff,null))['then'](function(_0x32ae7a){if(_0x32ae7a){_0x3f7cfa=_0x32ae7a;_0x7fb7['model']=_[_0x7d96('0x2d')](db[_0x7d96('0x66')][_0x7d96('0x27')]);_0x7fb7[_0x7d96('0x2c')]=_['keys'](_0x29f704[_0x7d96('0x2c')]);_0x7fb7[_0x7d96('0x2e')]=_[_0x7d96('0x30')](_0x7fb7[_0x7d96('0x2b')],_0x7fb7[_0x7d96('0x2c')]);_0x20e41a[_0x7d96('0x2f')]=_['intersection'](_0x7fb7[_0x7d96('0x2b')],qs[_0x7d96('0x31')](_0x29f704[_0x7d96('0x2c')][_0x7d96('0x31')]));_0x20e41a['attributes']=_0x20e41a[_0x7d96('0x2f')][_0x7d96('0x67')]?_0x20e41a[_0x7d96('0x2f')]:_0x7fb7[_0x7d96('0x2b')];_0x20e41a[_0x7d96('0x68')]=qs[_0x7d96('0x34')](_0x29f704[_0x7d96('0x2c')][_0x7d96('0x34')]);_0x20e41a[_0x7d96('0x35')]=qs[_0x7d96('0x2e')](_[_0x7d96('0x36')](_0x29f704['query'],_0x7fb7['filters']));if(_0x29f704['query']['filter']){_0x20e41a[_0x7d96('0x35')]=_[_0x7d96('0x38')](_0x20e41a[_0x7d96('0x35')],{'$or':_['map'](_0x20e41a[_0x7d96('0x2f')],function(_0x94a666){var _0x178432={};_0x178432[_0x94a666]={'$like':'%'+_0x29f704['query'][_0x7d96('0x37')]+'%'};return _0x178432;})});}_0x20e41a=_[_0x7d96('0x38')]({},_0x20e41a,_0x29f704[_0x7d96('0x3a')]);return _0x3f7cfa[_0x7d96('0x69')](_0x20e41a);}})[_0x7d96('0x1e')](function(_0x1992b6){if(_0x1992b6){_0xa55e2c=_0x1992b6[_0x7d96('0x67')];if(!_0x29f704[_0x7d96('0x2c')][_0x7d96('0x32')]('nolimit')){_0x20e41a[_0x7d96('0x19')]=qs[_0x7d96('0x19')](_0x29f704[_0x7d96('0x2c')]['limit']);_0x20e41a[_0x7d96('0x17')]=qs[_0x7d96('0x17')](_0x29f704[_0x7d96('0x2c')][_0x7d96('0x17')]);}return _0x3f7cfa[_0x7d96('0x69')](_0x20e41a);}})['then'](function(_0x18572c){if(_0x18572c){return _0x18572c?{'count':_0xa55e2c,'rows':_0x18572c}:null;}})[_0x7d96('0x1e')](respondWithResult(_0x3793ff,null))['catch'](handleError(_0x3793ff,null));}; \ No newline at end of file +var _0x582a=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','mode','files','directory','join','root','server/files/moh','0777','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','converted_format','symlinkSync','Sequelize','findOne','removeSound','id2','getSounds','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce'];(function(_0x167715,_0x4575df){var _0x2e9da2=function(_0x3e9fe0){while(--_0x3e9fe0){_0x167715['push'](_0x167715['shift']());}};_0x2e9da2(++_0x4575df);}(_0x582a,0xdd));var _0xa582=function(_0x5a8981,_0x12fe84){_0x5a8981=_0x5a8981-0x0;var _0x4a3592=_0x582a[_0x5a8981];return _0x4a3592;};'use strict';var emlformat=require(_0xa582('0x0'));var rimraf=require(_0xa582('0x1'));var zipdir=require(_0xa582('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa582('0x3'));var moment=require(_0xa582('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa582('0x5'));var util=require(_0xa582('0x6'));var path=require(_0xa582('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa582('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa582('0x9'));var squel=require(_0xa582('0xa'));var crypto=require(_0xa582('0xb'));var jsforce=require(_0xa582('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa582('0xd'));var querystring=require(_0xa582('0xe'));var Papa=require(_0xa582('0xf'));var Redis=require(_0xa582('0x10'));var authService=require(_0xa582('0x11'));var qs=require(_0xa582('0x12'));var as=require(_0xa582('0x13'));var hardwareService=require(_0xa582('0x14'));var logger=require(_0xa582('0x15'))(_0xa582('0x16'));var utils=require(_0xa582('0x17'));var config=require(_0xa582('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa582('0x19'))['db'];function respondWithStatusCode(_0x1b76d3,_0x31f6c4){_0x31f6c4=_0x31f6c4||0xcc;return function(_0x1a28d9){if(_0x1a28d9){return _0x1b76d3['sendStatus'](_0x31f6c4);}return _0x1b76d3[_0xa582('0x1a')](_0x31f6c4)[_0xa582('0x1b')]();};}function respondWithResult(_0x2c296f,_0x5a0363){_0x5a0363=_0x5a0363||0xc8;return function(_0x3c5930){if(_0x3c5930){return _0x2c296f['status'](_0x5a0363)[_0xa582('0x1c')](_0x3c5930);}};}function respondWithFilteredResult(_0x32484c,_0x499b03){return function(_0x5b5c28){if(_0x5b5c28){var _0x17815a=typeof _0x499b03['offset']==='undefined'&&typeof _0x499b03['limit']===_0xa582('0x1d');var _0xbb771e=_0x5b5c28[_0xa582('0x1e')];var _0x4f1e9b=_0x17815a?0x0:_0x499b03['offset'];var _0x266541=_0x17815a?_0x5b5c28[_0xa582('0x1e')]:_0x499b03['offset']+_0x499b03[_0xa582('0x1f')];var _0x2ba891;if(_0x266541>=_0xbb771e){_0x266541=_0xbb771e;_0x2ba891=0xc8;}else{_0x2ba891=0xce;}_0x32484c[_0xa582('0x1a')](_0x2ba891);return _0x32484c[_0xa582('0x20')](_0xa582('0x21'),_0x4f1e9b+'-'+_0x266541+'/'+_0xbb771e)[_0xa582('0x1c')](_0x5b5c28);}return null;};}function patchUpdates(_0x35e30e){return function(_0x13c150){try{jsonpatch[_0xa582('0x22')](_0x13c150,_0x35e30e,!![]);}catch(_0x3ab2a7){return BPromise[_0xa582('0x23')](_0x3ab2a7);}return _0x13c150['save']();};}function saveUpdates(_0x304514,_0x285bfd){return function(_0x42c48b){if(_0x42c48b){return _0x42c48b[_0xa582('0x24')](_0x304514)[_0xa582('0x25')](function(_0x201845){return _0x201845;});}return null;};}function removeEntity(_0x28a950,_0x148277){return function(_0x5f577a){if(_0x5f577a){return _0x5f577a[_0xa582('0x26')]()[_0xa582('0x25')](function(){var _0x163a4c=_0x5f577a[_0xa582('0x27')]({'plain':!![]});var _0x43d86c=_0xa582('0x28');return db[_0xa582('0x29')]['destroy']({'where':{'type':_0x43d86c,'resourceId':_0x163a4c['id']}})[_0xa582('0x25')](function(){return _0x5f577a;});})[_0xa582('0x25')](function(){_0x28a950['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30e075,_0x13bb50){return function(_0x315171){if(!_0x315171){_0x30e075[_0xa582('0x2a')](0x194);}return _0x315171;};}function handleError(_0x30db2f,_0x34ca86){_0x34ca86=_0x34ca86||0x1f4;return function(_0x346dbc){logger['error'](_0x346dbc[_0xa582('0x2b')]);if(_0x346dbc[_0xa582('0x2c')]){delete _0x346dbc[_0xa582('0x2c')];}_0x30db2f[_0xa582('0x1a')](_0x34ca86)[_0xa582('0x2d')](_0x346dbc);};}exports[_0xa582('0x2e')]=function(_0x15179d,_0x165a39){var _0x306cf7={},_0x1fcfca={},_0x22e032={'count':0x0,'rows':[]};var _0x1ef7bd=_[_0xa582('0x2f')](db[_0xa582('0x30')][_0xa582('0x31')],function(_0x3a753f){return{'name':_0x3a753f['fieldName'],'type':_0x3a753f[_0xa582('0x32')][_0xa582('0x33')]};});_0x1fcfca[_0xa582('0x34')]=_[_0xa582('0x2f')](_0x1ef7bd,_0xa582('0x2c'));_0x1fcfca[_0xa582('0x35')]=_['keys'](_0x15179d[_0xa582('0x35')]);_0x1fcfca['filters']=_[_0xa582('0x36')](_0x1fcfca[_0xa582('0x34')],_0x1fcfca[_0xa582('0x35')]);_0x306cf7['attributes']=_[_0xa582('0x36')](_0x1fcfca[_0xa582('0x34')],qs[_0xa582('0x37')](_0x15179d[_0xa582('0x35')][_0xa582('0x37')]));_0x306cf7[_0xa582('0x38')]=_0x306cf7[_0xa582('0x38')][_0xa582('0x39')]?_0x306cf7[_0xa582('0x38')]:_0x1fcfca[_0xa582('0x34')];if(!_0x15179d[_0xa582('0x35')][_0xa582('0x3a')](_0xa582('0x3b'))){_0x306cf7['limit']=qs['limit'](_0x15179d['query'][_0xa582('0x1f')]);_0x306cf7['offset']=qs[_0xa582('0x3c')](_0x15179d[_0xa582('0x35')][_0xa582('0x3c')]);}_0x306cf7[_0xa582('0x3d')]=qs['sort'](_0x15179d[_0xa582('0x35')][_0xa582('0x3e')]);delete _0x15179d['query'][_0xa582('0x3e')];_0x306cf7[_0xa582('0x3f')]=qs[_0xa582('0x40')](_[_0xa582('0x41')](_0x15179d[_0xa582('0x35')],_0x1fcfca[_0xa582('0x40')]),_0x1ef7bd);if(_0x15179d[_0xa582('0x35')][_0xa582('0x42')]){_0x306cf7[_0xa582('0x3f')]=_[_0xa582('0x43')](_0x306cf7[_0xa582('0x3f')],{'$or':_[_0xa582('0x2f')](_0x1ef7bd,function(_0x31f2fe){if(_0x31f2fe[_0xa582('0x32')]!==_0xa582('0x44')){var _0x24ae0b={};_0x24ae0b[_0x31f2fe[_0xa582('0x2c')]]={'$like':'%'+_0x15179d[_0xa582('0x35')][_0xa582('0x42')]+'%'};return _0x24ae0b;}})});}_0x306cf7=_[_0xa582('0x43')]({},_0x306cf7,_0x15179d[_0xa582('0x45')]);var _0x20d2fc={'where':_0x306cf7[_0xa582('0x3f')]};return db[_0xa582('0x30')][_0xa582('0x1e')](_0x20d2fc)[_0xa582('0x25')](function(_0x2a0c2b){_0x22e032['count']=_0x2a0c2b;if(_0x15179d[_0xa582('0x35')][_0xa582('0x46')]){_0x306cf7[_0xa582('0x47')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xa582('0x48')](_0x306cf7);})[_0xa582('0x25')](function(_0x294844){_0x22e032[_0xa582('0x49')]=_0x294844;return _0x22e032;})['then'](respondWithFilteredResult(_0x165a39,_0x306cf7))[_0xa582('0x4a')](handleError(_0x165a39,null));};exports[_0xa582('0x4b')]=function(_0xfffecb,_0x28def5){var _0x3fdf38={'raw':![],'where':{'id':_0xfffecb[_0xa582('0x4c')]['id']}},_0x35d30c={};_0x35d30c[_0xa582('0x34')]=_[_0xa582('0x4d')](db[_0xa582('0x30')][_0xa582('0x31')]);_0x35d30c[_0xa582('0x35')]=_[_0xa582('0x4d')](_0xfffecb['query']);_0x35d30c[_0xa582('0x40')]=_[_0xa582('0x36')](_0x35d30c[_0xa582('0x34')],_0x35d30c[_0xa582('0x35')]);_0x3fdf38[_0xa582('0x38')]=_[_0xa582('0x36')](_0x35d30c[_0xa582('0x34')],qs[_0xa582('0x37')](_0xfffecb[_0xa582('0x35')][_0xa582('0x37')]));_0x3fdf38[_0xa582('0x38')]=_0x3fdf38[_0xa582('0x38')]['length']?_0x3fdf38['attributes']:_0x35d30c[_0xa582('0x34')];if(_0xfffecb['query']['includeAll']){_0x3fdf38[_0xa582('0x47')]=[{'all':!![]}];}_0x3fdf38=_[_0xa582('0x43')]({},_0x3fdf38,_0xfffecb[_0xa582('0x45')]);return db['VoiceMusicOnHold'][_0xa582('0x4e')](_0x3fdf38)[_0xa582('0x25')](handleEntityNotFound(_0x28def5,null))[_0xa582('0x25')](respondWithResult(_0x28def5,null))[_0xa582('0x4a')](handleError(_0x28def5,null));};exports[_0xa582('0x24')]=function(_0x330d5e,_0x1a0b68){if(_0x330d5e[_0xa582('0x4f')]['id']){delete _0x330d5e[_0xa582('0x4f')]['id'];}return db[_0xa582('0x30')]['find']({'where':{'id':_0x330d5e[_0xa582('0x4c')]['id']}})[_0xa582('0x25')](handleEntityNotFound(_0x1a0b68,null))[_0xa582('0x25')](saveUpdates(_0x330d5e[_0xa582('0x4f')],null))['then'](respondWithResult(_0x1a0b68,null))[_0xa582('0x4a')](handleError(_0x1a0b68,null));};exports[_0xa582('0x50')]=function(_0x5f28bb,_0x4d689c,_0x5112cd){return db['sequelize']['transaction'](function(_0x26d910){if(_0x5f28bb[_0xa582('0x4f')][_0xa582('0x51')]===_0xa582('0x52')){_0x5f28bb['body'][_0xa582('0x53')]=path[_0xa582('0x54')](config[_0xa582('0x55')],_0xa582('0x56'),_0x5f28bb[_0xa582('0x4f')][_0xa582('0x2c')]);}return db[_0xa582('0x30')][_0xa582('0x50')](_0x5f28bb[_0xa582('0x4f')],{'transaction':_0x26d910})['then'](function(_0x36043f){if(_0x5f28bb[_0xa582('0x4f')][_0xa582('0x51')]===_0xa582('0x52')){fs['mkdirSync'](_0x36043f['directory'],parseInt(_0xa582('0x57'),0x8));}var _0x102d3d=_0x5f28bb[_0xa582('0x58')][_0xa582('0x27')]({'plain':!![]});if(!_0x102d3d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x102d3d['role']===_0xa582('0x58')){var _0x5be0ac=_0x36043f[_0xa582('0x27')]({'plain':!![]});return db[_0xa582('0x59')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x102d3d[_0xa582('0x5a')]},'raw':!![]})['then'](function(_0x4f3b85){if(_0x4f3b85&&_0x4f3b85[_0xa582('0x5b')]===0x0){return db['UserProfileResource'][_0xa582('0x50')]({'name':_0x5be0ac[_0xa582('0x2c')],'resourceId':_0x5be0ac['id'],'type':_0x4f3b85['name'],'sectionId':_0x4f3b85['id']},{})[_0xa582('0x25')](function(){return _0x36043f;});}else{return _0x36043f;}})[_0xa582('0x4a')](function(_0x8f619f){logger[_0xa582('0x5c')](_0xa582('0x5d'),_0x8f619f);});}return _0x36043f;});})[_0xa582('0x25')](respondWithResult(_0x4d689c,0xc9))[_0xa582('0x4a')](handleError(_0x4d689c,null));};exports[_0xa582('0x26')]=function(_0x439592,_0x419e8b,_0x1922d6){var _0xadcdfa;return db[_0xa582('0x30')][_0xa582('0x4e')]({'where':{'id':_0x439592['params']['id']}})[_0xa582('0x25')](function(_0x3f7474){if(_0x3f7474){return db[_0xa582('0x5e')][_0xa582('0x5f')](function(_0x10a53e){return _0x3f7474['destroy']({'transaction':_0x10a53e,'raw':!![]})[_0xa582('0x25')](function(_0x42cd30){if(_0x42cd30['directory']){fs['readdirSync'](_0x42cd30['directory'])[_0xa582('0x60')](function(_0x4e3fe4){fs[_0xa582('0x61')](path['join'](_0x42cd30[_0xa582('0x53')],_0x4e3fe4));});fs[_0xa582('0x62')](_0x42cd30[_0xa582('0x53')]);}return _0x42cd30;});})[_0xa582('0x4a')](function(_0x1e34e0){throw new db['Sequelize'][(_0xa582('0x63'))](_0x1e34e0[_0xa582('0x64')]);});}})['then'](handleEntityNotFound(_0x419e8b,null))[_0xa582('0x25')](removeEntity(_0x419e8b,null))[_0xa582('0x4a')](handleError(_0x419e8b,null));};exports[_0xa582('0x65')]=function(_0x5647d7,_0x1a768d,_0x2a903b){return db['sequelize'][_0xa582('0x5f')](function(_0x2177b6){var _0x542025;return db['VoiceMusicOnHold'][_0xa582('0x4e')]({'where':{'id':_0x5647d7[_0xa582('0x4c')]['id']}})[_0xa582('0x25')](function(_0xfa86ab){if(_0xfa86ab){_0x542025=_0xfa86ab;return _0xfa86ab[_0xa582('0x65')](_0x5647d7[_0xa582('0x4f')]['id'],{'transaction':_0x2177b6});}})[_0xa582('0x25')](function(_0x33f0d4){if(_0x33f0d4){return db[_0xa582('0x66')]['findOne']({'where':{'id':_0x5647d7[_0xa582('0x4f')]['id']},'attributes':['id',_0xa582('0x2c'),'save_name','converted_format',_0xa582('0x67')],'raw':!![]});}})[_0xa582('0x25')](function(_0x29a86e){if(_0x29a86e){var _0x588d62=path['join'](config[_0xa582('0x55')],_0xa582('0x68'),util[_0xa582('0x69')](_0xa582('0x6a'),path[_0xa582('0x6b')](_0x29a86e[_0xa582('0x6c')],path[_0xa582('0x6d')](_0x29a86e[_0xa582('0x6c')])),_0x29a86e['converted_format']));var _0x354c5a=path['join'](config[_0xa582('0x55')],_0xa582('0x56'),_0x542025['name'],util[_0xa582('0x69')](_0xa582('0x6a'),_0x29a86e[_0xa582('0x2c')],_0x29a86e[_0xa582('0x6e')]));fs[_0xa582('0x6f')](_0x588d62,_0x354c5a);return _0x29a86e;}})[_0xa582('0x4a')](function(_0x378ea5){throw new db[(_0xa582('0x70'))]['ValidationError'](_0x378ea5[_0xa582('0x64')]);});})[_0xa582('0x25')](handleEntityNotFound(_0x1a768d,null))[_0xa582('0x25')](respondWithResult(_0x1a768d,0xc9))[_0xa582('0x4a')](handleError(_0x1a768d,null));};exports['removeSound']=function(_0x39764d,_0x22d827,_0x3658da){return db['sequelize'][_0xa582('0x5f')](function(_0x29b990){var _0x1fd686;return db[_0xa582('0x30')][_0xa582('0x71')]({'where':{'id':_0x39764d['params']['id']}})[_0xa582('0x25')](handleEntityNotFound(_0x22d827,null))['then'](function(_0x34a316){if(_0x34a316){_0x1fd686=_0x34a316;return _0x34a316[_0xa582('0x72')](_0x39764d[_0xa582('0x4c')][_0xa582('0x73')]);}})['then'](function(_0x418f99){if(_0x418f99){return db[_0xa582('0x66')][_0xa582('0x71')]({'where':{'id':_0x39764d[_0xa582('0x4c')][_0xa582('0x73')]},'attributes':['id',_0xa582('0x2c'),_0xa582('0x6c'),_0xa582('0x6e'),'createdAt'],'raw':!![]});}})[_0xa582('0x25')](function(_0x334163){if(_0x334163){fs[_0xa582('0x61')](path[_0xa582('0x54')](_0x1fd686['directory'],util[_0xa582('0x69')]('%s.%s',_0x334163[_0xa582('0x2c')],_0x334163[_0xa582('0x6e')])));return _0x334163;}})[_0xa582('0x4a')](function(_0x12e47f){throw new db[(_0xa582('0x70'))]['ValidationError'](_0x12e47f['message']);});})['then'](handleEntityNotFound(_0x22d827,null))[_0xa582('0x25')](respondWithStatusCode(_0x22d827,0xcc))[_0xa582('0x4a')](handleError(_0x22d827,null));};exports[_0xa582('0x74')]=function(_0x5d68ea,_0x219d64,_0x1099d3){var _0x584cee={};var _0x36158a={};var _0x35e99f;var _0x5333fd;return db[_0xa582('0x30')][_0xa582('0x71')]({'where':{'id':_0x5d68ea[_0xa582('0x4c')]['id']}})[_0xa582('0x25')](handleEntityNotFound(_0x219d64,null))[_0xa582('0x25')](function(_0x135531){if(_0x135531){_0x35e99f=_0x135531;_0x36158a[_0xa582('0x34')]=_[_0xa582('0x4d')](db[_0xa582('0x66')][_0xa582('0x31')]);_0x36158a[_0xa582('0x35')]=_['keys'](_0x5d68ea[_0xa582('0x35')]);_0x36158a['filters']=_[_0xa582('0x36')](_0x36158a[_0xa582('0x34')],_0x36158a[_0xa582('0x35')]);_0x584cee[_0xa582('0x38')]=_['intersection'](_0x36158a['model'],qs[_0xa582('0x37')](_0x5d68ea[_0xa582('0x35')][_0xa582('0x37')]));_0x584cee['attributes']=_0x584cee[_0xa582('0x38')][_0xa582('0x39')]?_0x584cee['attributes']:_0x36158a[_0xa582('0x34')];_0x584cee['order']=qs[_0xa582('0x3e')](_0x5d68ea['query'][_0xa582('0x3e')]);_0x584cee[_0xa582('0x3f')]=qs[_0xa582('0x40')](_['pick'](_0x5d68ea['query'],_0x36158a['filters']));if(_0x5d68ea[_0xa582('0x35')][_0xa582('0x42')]){_0x584cee[_0xa582('0x3f')]=_[_0xa582('0x43')](_0x584cee[_0xa582('0x3f')],{'$or':_[_0xa582('0x2f')](_0x584cee[_0xa582('0x38')],function(_0x4579e5){var _0x543e95={};_0x543e95[_0x4579e5]={'$like':'%'+_0x5d68ea[_0xa582('0x35')][_0xa582('0x42')]+'%'};return _0x543e95;})});}_0x584cee=_[_0xa582('0x43')]({},_0x584cee,_0x5d68ea[_0xa582('0x45')]);return _0x35e99f[_0xa582('0x74')](_0x584cee);}})[_0xa582('0x25')](function(_0x39225d){if(_0x39225d){_0x5333fd=_0x39225d['length'];if(!_0x5d68ea[_0xa582('0x35')]['hasOwnProperty'](_0xa582('0x3b'))){_0x584cee[_0xa582('0x1f')]=qs[_0xa582('0x1f')](_0x5d68ea[_0xa582('0x35')]['limit']);_0x584cee[_0xa582('0x3c')]=qs[_0xa582('0x3c')](_0x5d68ea[_0xa582('0x35')][_0xa582('0x3c')]);}return _0x35e99f[_0xa582('0x74')](_0x584cee);}})['then'](function(_0x187705){if(_0x187705){return _0x187705?{'count':_0x5333fd,'rows':_0x187705}:null;}})[_0xa582('0x25')](respondWithResult(_0x219d64,null))[_0xa582('0x4a')](handleError(_0x219d64,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 7adecb3..2ae0a32 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 _0xa477=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceMusicOnHold'];(function(_0x4b8dcd,_0x380bbd){var _0x233875=function(_0x440ddc){while(--_0x440ddc){_0x4b8dcd['push'](_0x4b8dcd['shift']());}};_0x233875(++_0x380bbd);}(_0xa477,0x9c));var _0x7a47=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa477[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var logger=require(_0x7a47('0x2'))(_0x7a47('0x3'));var moment=require(_0x7a47('0x4'));var BPromise=require(_0x7a47('0x5'));var rp=require(_0x7a47('0x6'));var fs=require('fs');var path=require(_0x7a47('0x7'));var rimraf=require('rimraf');var config=require(_0x7a47('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x7a47('0x9')]=function(_0x1600e8,_0x5a6f0c){return _0x1600e8[_0x7a47('0xa')](_0x7a47('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddec=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise'];(function(_0x210603,_0x4adbac){var _0x1bcb7d=function(_0x2cdf89){while(--_0x2cdf89){_0x210603['push'](_0x210603['shift']());}};_0x1bcb7d(++_0x4adbac);}(_0xddec,0x1ce));var _0xcdde=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xddec[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xcdde('0x0'));var util=require(_0xcdde('0x1'));var logger=require('../../config/logger')(_0xcdde('0x2'));var moment=require(_0xcdde('0x3'));var BPromise=require(_0xcdde('0x4'));var rp=require(_0xcdde('0x5'));var fs=require('fs');var path=require(_0xcdde('0x6'));var rimraf=require(_0xcdde('0x7'));var config=require(_0xcdde('0x8'));var attributes=require(_0xcdde('0x9'));module['exports']=function(_0x4cadc5,_0xad01d6){return _0x4cadc5[_0xcdde('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0xcdde('0xb'),'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 49c24ba..d64620f 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x48b09d,_0x5418f8){var _0x1c9b39=function(_0x5bfc44){while(--_0x5bfc44){_0x48b09d['push'](_0x48b09d['shift']());}};_0x1c9b39(++_0x5418f8);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x48c800,_0x50778e){var _0x5a7bbd=function(_0x3031ff){while(--_0x3031ff){_0x48c800['push'](_0x48c800['shift']());}};_0x5a7bbd(++_0x50778e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xcb91[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index bb75010..b208eba 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 _0x3fec=['multer','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','getTeams','create','post','addAgents','/:id/teams','addTeams','update','delete','destroy','removeAgents','removeTeams','exports'];(function(_0xe2b6c9,_0xdbe40e){var _0x41bbcc=function(_0x1a7bf4){while(--_0x1a7bf4){_0xe2b6c9['push'](_0xe2b6c9['shift']());}};_0x41bbcc(++_0xdbe40e);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc3fe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc3fe('0x1'));var express=require(_0xc3fe('0x2'));var router=express['Router']();var fs_extra=require(_0xc3fe('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc3fe('0x4'));var controller=require('./voicePrefix.controller');router[_0xc3fe('0x5')]('/',auth[_0xc3fe('0x6')](),controller[_0xc3fe('0x7')]);router[_0xc3fe('0x5')](_0xc3fe('0x8'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0x9')]);router[_0xc3fe('0x5')](_0xc3fe('0xa'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0xb')]);router[_0xc3fe('0x5')](_0xc3fe('0xc'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0xd')]);router[_0xc3fe('0x5')]('/:id/teams',auth[_0xc3fe('0x6')](),controller[_0xc3fe('0xe')]);router['post']('/',auth[_0xc3fe('0x6')](),controller[_0xc3fe('0xf')]);router[_0xc3fe('0x10')](_0xc3fe('0xc'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0x11')]);router[_0xc3fe('0x10')](_0xc3fe('0x12'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0x13')]);router['put'](_0xc3fe('0xa'),auth['isAuthenticated'](),controller[_0xc3fe('0x14')]);router[_0xc3fe('0x15')](_0xc3fe('0xa'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0x16')]);router[_0xc3fe('0x15')](_0xc3fe('0xc'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0x17')]);router[_0xc3fe('0x15')](_0xc3fe('0x12'),auth[_0xc3fe('0x6')](),controller[_0xc3fe('0x18')]);module[_0xc3fe('0x19')]=router; \ No newline at end of file +var _0xc9b9=['path','connect-timeout','express','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','getAgents','/:id/teams','post','/:id/users','addTeams','delete','destroy','removeAgents','removeTeams','exports'];(function(_0x19420d,_0xbc4303){var _0x1de2d1=function(_0xd6dcd5){while(--_0xd6dcd5){_0x19420d['push'](_0x19420d['shift']());}};_0x1de2d1(++_0xbc4303);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0xc9b9[_0x45b29d];return _0x32d74;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9c9b('0x0'));var timeout=require(_0x9c9b('0x1'));var express=require(_0x9c9b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c9b('0x3'));var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9c9b('0x4')]);router[_0x9c9b('0x5')](_0x9c9b('0x6'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x8')]);router['get'](_0x9c9b('0x9'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0xa')]);router[_0x9c9b('0x5')]('/:id/users',auth[_0x9c9b('0x7')](),controller[_0x9c9b('0xb')]);router['get'](_0x9c9b('0xc'),auth[_0x9c9b('0x7')](),controller['getTeams']);router['post']('/',auth[_0x9c9b('0x7')](),controller['create']);router[_0x9c9b('0xd')](_0x9c9b('0xe'),auth['isAuthenticated'](),controller['addAgents']);router['post']('/:id/teams',auth[_0x9c9b('0x7')](),controller[_0x9c9b('0xf')]);router['put'](_0x9c9b('0x9'),auth[_0x9c9b('0x7')](),controller['update']);router[_0x9c9b('0x10')](_0x9c9b('0x9'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x11')]);router[_0x9c9b('0x10')](_0x9c9b('0xe'),auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x12')]);router[_0x9c9b('0x10')]('/:id/teams',auth[_0x9c9b('0x7')](),controller[_0x9c9b('0x13')]);module[_0x9c9b('0x14')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 649c97f..51fba3f 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 _0x96ec=['STRING','name','VIRTUAL','getDataValue','sequelize'];(function(_0x515c95,_0x18930f){var _0x55ad4b=function(_0x2c706c){while(--_0x2c706c){_0x515c95['push'](_0x515c95['shift']());}};_0x55ad4b(++_0x18930f);}(_0x96ec,0x1ad));var _0xc96e=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x96ec[_0x334fea];return _0x3c5829;};'use strict';var Sequelize=require(_0xc96e('0x0'));module['exports']={'name':{'type':Sequelize[_0xc96e('0x1')],'allowNull':![],'unique':_0xc96e('0x2')},'prefix':{'type':Sequelize[_0xc96e('0x3')],'get':function(_0x58e516){return'system-'+this[_0xc96e('0x4')](_0xc96e('0x2'))+'-';}},'description':{'type':Sequelize[_0xc96e('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb8f2=['STRING','sequelize','exports','name','VIRTUAL','system-','getDataValue'];(function(_0x4e9ce1,_0x59beed){var _0x5d19cf=function(_0x14af09){while(--_0x14af09){_0x4e9ce1['push'](_0x4e9ce1['shift']());}};_0x5d19cf(++_0x59beed);}(_0xb8f2,0x104));var _0x2b8f=function(_0x4f9449,_0x44f559){_0x4f9449=_0x4f9449-0x0;var _0x5d1884=_0xb8f2[_0x4f9449];return _0x5d1884;};'use strict';var Sequelize=require(_0x2b8f('0x0'));module[_0x2b8f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2b8f('0x2')},'prefix':{'type':Sequelize[_0x2b8f('0x3')],'get':function(_0x27aeb9){return _0x2b8f('0x4')+this[_0x2b8f('0x5')](_0x2b8f('0x2'))+'-';}},'description':{'type':Sequelize[_0x2b8f('0x6')]},'callerIdAll':{'type':Sequelize[_0x2b8f('0x6')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 7679268..96fda4d 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 _0x4213=['limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','name','index','map','VoicePrefix','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','find','catch','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','CDR(prefix)=','callerIdAll','Set','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','nolimit','Team','order','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','offset','undefined'];(function(_0x5d7005,_0x41f35a){var _0x31ed20=function(_0x3624f8){while(--_0x3624f8){_0x5d7005['push'](_0x5d7005['shift']());}};_0x31ed20(++_0x41f35a);}(_0x4213,0x77));var _0x3421=function(_0xb2e7ed,_0xe7bb03){_0xb2e7ed=_0xb2e7ed-0x0;var _0xfa2cab=_0x4213[_0xb2e7ed];return _0xfa2cab;};'use strict';var emlformat=require(_0x3421('0x0'));var rimraf=require(_0x3421('0x1'));var zipdir=require(_0x3421('0x2'));var jsonpatch=require(_0x3421('0x3'));var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require('mustache');var util=require(_0x3421('0x7'));var path=require('path');var sox=require(_0x3421('0x8'));var csv=require(_0x3421('0x9'));var ejs=require(_0x3421('0xa'));var fs=require('fs');var fs_extra=require(_0x3421('0xb'));var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0x9'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3421('0x12'));var logger=require(_0x3421('0x13'))(_0x3421('0x14'));var utils=require(_0x3421('0x15'));var config=require(_0x3421('0x16'));var licenseUtil=require(_0x3421('0x17'));var db=require(_0x3421('0x18'))['db'];config['redis']=_[_0x3421('0x19')](config[_0x3421('0x1a')],{'host':_0x3421('0x1b'),'port':0x18eb});var socket=require(_0x3421('0x1c'))(new Redis(config[_0x3421('0x1a')]));require(_0x3421('0x1d'))[_0x3421('0x1e')](socket);function respondWithStatusCode(_0x59ea4a,_0xafd9e0){_0xafd9e0=_0xafd9e0||0xcc;return function(_0x4b5f43){if(_0x4b5f43){return _0x59ea4a[_0x3421('0x1f')](_0xafd9e0);}return _0x59ea4a[_0x3421('0x20')](_0xafd9e0)['end']();};}function respondWithResult(_0x1e33ab,_0x4c6f7b){_0x4c6f7b=_0x4c6f7b||0xc8;return function(_0x16bc8f){if(_0x16bc8f){return _0x1e33ab[_0x3421('0x20')](_0x4c6f7b)['json'](_0x16bc8f);}};}function respondWithFilteredResult(_0x3584d6,_0x3dec08){return function(_0x130d3c){if(_0x130d3c){var _0x104cc5=typeof _0x3dec08[_0x3421('0x21')]===_0x3421('0x22')&&typeof _0x3dec08[_0x3421('0x23')]===_0x3421('0x22');var _0x197b83=_0x130d3c[_0x3421('0x24')];var _0x538a8b=_0x104cc5?0x0:_0x3dec08['offset'];var _0x420114=_0x104cc5?_0x130d3c['count']:_0x3dec08['offset']+_0x3dec08['limit'];var _0x33155b;if(_0x420114>=_0x197b83){_0x420114=_0x197b83;_0x33155b=0xc8;}else{_0x33155b=0xce;}_0x3584d6[_0x3421('0x20')](_0x33155b);return _0x3584d6[_0x3421('0x25')](_0x3421('0x26'),_0x538a8b+'-'+_0x420114+'/'+_0x197b83)[_0x3421('0x27')](_0x130d3c);}return null;};}function patchUpdates(_0x39bed4){return function(_0x3df305){try{jsonpatch[_0x3421('0x28')](_0x3df305,_0x39bed4,!![]);}catch(_0xb9af5f){return BPromise[_0x3421('0x29')](_0xb9af5f);}return _0x3df305['save']();};}function saveUpdates(_0x57a4af,_0x494423){return function(_0x3fef90){if(_0x3fef90){return _0x3fef90[_0x3421('0x2a')](_0x57a4af)[_0x3421('0x2b')](function(_0x5bc28a){return _0x5bc28a;});}return null;};}function removeEntity(_0x506af4,_0x1b65d0){return function(_0x5b53b6){if(_0x5b53b6){return _0x5b53b6[_0x3421('0x2c')]()['then'](function(){var _0x15e73c=_0x5b53b6[_0x3421('0x2d')]({'plain':!![]});var _0x36d75f=_0x3421('0x2e');return db[_0x3421('0x2f')]['destroy']({'where':{'type':_0x36d75f,'resourceId':_0x15e73c['id']}})[_0x3421('0x2b')](function(){return _0x5b53b6;});})['then'](function(){_0x506af4['status'](0xcc)[_0x3421('0x30')]();});}};}function handleEntityNotFound(_0x5aa96b,_0x5074a2){return function(_0xb4eaf4){if(!_0xb4eaf4){_0x5aa96b['sendStatus'](0x194);}return _0xb4eaf4;};}function handleError(_0x20abc7,_0x5bcd19){_0x5bcd19=_0x5bcd19||0x1f4;return function(_0xc7f9fb){logger[_0x3421('0x31')](_0xc7f9fb['stack']);if(_0xc7f9fb[_0x3421('0x32')]){delete _0xc7f9fb[_0x3421('0x32')];}_0x20abc7[_0x3421('0x20')](_0x5bcd19)['send'](_0xc7f9fb);};}exports[_0x3421('0x33')]=function(_0x50d61b,_0x2b5af4){var _0xf0039={},_0x1045ab={},_0x841e08={'count':0x0,'rows':[]};var _0x3875c6=_[_0x3421('0x34')](db[_0x3421('0x35')][_0x3421('0x36')],function(_0x94559a){return{'name':_0x94559a[_0x3421('0x37')],'type':_0x94559a['type']['key']};});_0x1045ab[_0x3421('0x38')]=_[_0x3421('0x34')](_0x3875c6,'name');_0x1045ab[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x50d61b[_0x3421('0x39')]);_0x1045ab[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x1045ab['model'],_0x1045ab[_0x3421('0x39')]);_0xf0039[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x1045ab['model'],qs[_0x3421('0x3e')](_0x50d61b['query'][_0x3421('0x3e')]));_0xf0039[_0x3421('0x3d')]=_0xf0039[_0x3421('0x3d')][_0x3421('0x3f')]?_0xf0039[_0x3421('0x3d')]:_0x1045ab[_0x3421('0x38')];if(!_0x50d61b[_0x3421('0x39')]['hasOwnProperty']('nolimit')){_0xf0039['limit']=qs[_0x3421('0x23')](_0x50d61b['query']['limit']);_0xf0039[_0x3421('0x21')]=qs['offset'](_0x50d61b[_0x3421('0x39')][_0x3421('0x21')]);}_0xf0039['order']=qs[_0x3421('0x40')](_0x50d61b[_0x3421('0x39')][_0x3421('0x40')]);_0xf0039[_0x3421('0x41')]=qs['filters'](_[_0x3421('0x42')](_0x50d61b[_0x3421('0x39')],_0x1045ab[_0x3421('0x3b')]),_0x3875c6);if(_0x50d61b[_0x3421('0x39')][_0x3421('0x43')]){_0xf0039['where']=_[_0x3421('0x44')](_0xf0039[_0x3421('0x41')],{'$or':_['map'](_0x3875c6,function(_0x15551c){if(_0x15551c['type']!=='VIRTUAL'){var _0x486ce8={};_0x486ce8[_0x15551c[_0x3421('0x32')]]={'$like':'%'+_0x50d61b[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x486ce8;}})});}_0xf0039=_[_0x3421('0x44')]({},_0xf0039,_0x50d61b[_0x3421('0x45')]);var _0x417d6e={'where':_0xf0039[_0x3421('0x41')]};return db[_0x3421('0x35')][_0x3421('0x24')](_0x417d6e)[_0x3421('0x2b')](function(_0x3b9d15){_0x841e08[_0x3421('0x24')]=_0x3b9d15;if(_0x50d61b[_0x3421('0x39')][_0x3421('0x46')]){_0xf0039['include']=[{'all':!![]}];}return db[_0x3421('0x35')][_0x3421('0x47')](_0xf0039);})[_0x3421('0x2b')](function(_0x4466be){_0x841e08['rows']=_0x4466be;return _0x841e08;})[_0x3421('0x2b')](respondWithFilteredResult(_0x2b5af4,_0xf0039))['catch'](handleError(_0x2b5af4,null));};exports[_0x3421('0x48')]=function(_0x248f84,_0x669cfd){var _0x176aef={'raw':![],'where':{'id':_0x248f84[_0x3421('0x49')]['id']}},_0x2f9a84={};_0x2f9a84[_0x3421('0x38')]=_[_0x3421('0x3a')](db[_0x3421('0x35')][_0x3421('0x36')]);_0x2f9a84[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x248f84[_0x3421('0x39')]);_0x2f9a84['filters']=_[_0x3421('0x3c')](_0x2f9a84['model'],_0x2f9a84[_0x3421('0x39')]);_0x176aef[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x2f9a84[_0x3421('0x38')],qs[_0x3421('0x3e')](_0x248f84[_0x3421('0x39')][_0x3421('0x3e')]));_0x176aef[_0x3421('0x3d')]=_0x176aef[_0x3421('0x3d')][_0x3421('0x3f')]?_0x176aef['attributes']:_0x2f9a84[_0x3421('0x38')];if(_0x248f84[_0x3421('0x39')][_0x3421('0x46')]){_0x176aef['include']=[{'all':!![]}];}_0x176aef=_['merge']({},_0x176aef,_0x248f84[_0x3421('0x45')]);return db[_0x3421('0x35')][_0x3421('0x4a')](_0x176aef)['then'](handleEntityNotFound(_0x669cfd,null))[_0x3421('0x2b')](respondWithResult(_0x669cfd,null))[_0x3421('0x4b')](handleError(_0x669cfd,null));};exports[_0x3421('0x2c')]=function(_0x356376,_0x57554a){return db[_0x3421('0x35')][_0x3421('0x4a')]({'where':{'id':_0x356376[_0x3421('0x49')]['id']}})['then'](handleEntityNotFound(_0x57554a,null))['then'](removeEntity(_0x57554a,null))['catch'](handleError(_0x57554a,null));};exports[_0x3421('0x4c')]=function(_0x1021f8,_0x5a9ccf){return db['VoicePrefix'][_0x3421('0x4c')]()[_0x3421('0x2b')](respondWithResult(_0x5a9ccf,null))[_0x3421('0x4b')](handleError(_0x5a9ccf,null));};exports[_0x3421('0x4d')]=function(_0x127835,_0x4987e3){var _0x27d284;return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x2f9ce1){return db['VoicePrefix'][_0x3421('0x4d')](_0x127835[_0x3421('0x50')],{'transaction':_0x2f9ce1})[_0x3421('0x2b')](function(_0x48a967){_0x27d284=_0x48a967[_0x3421('0x2d')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x27d284[_0x3421('0x51')]},'raw':!![]})['then'](function(_0x4e33a0){return createVoicePrefixExtensions(_0x27d284,_0x4e33a0,_0x2f9ce1);});});})[_0x3421('0x2b')](function(){var _0x12bd9a=_0x127835['user'][_0x3421('0x2d')]({'plain':!![]});if(!_0x12bd9a)throw new Error(_0x3421('0x52'));if(_0x12bd9a[_0x3421('0x53')]===_0x3421('0x54')){var _0x1c73b9=_0x27d284;return db[_0x3421('0x55')][_0x3421('0x4a')]({'where':{'name':_0x3421('0x2e'),'userProfileId':_0x12bd9a[_0x3421('0x56')]},'raw':!![]})['then'](function(_0x1e4add){if(_0x1e4add&&_0x1e4add[_0x3421('0x57')]===0x0){return db['UserProfileResource'][_0x3421('0x4d')]({'name':_0x1c73b9[_0x3421('0x32')],'resourceId':_0x1c73b9['id'],'type':_0x1e4add[_0x3421('0x32')],'sectionId':_0x1e4add['id']},{})['then'](function(){return _0x27d284;});}else{return _0x27d284;}})[_0x3421('0x4b')](function(_0x27085d){logger[_0x3421('0x31')](_0x3421('0x58'),_0x27085d);throw _0x27085d;});}return _0x27d284;})[_0x3421('0x2b')](respondWithResult(_0x4987e3,null))[_0x3421('0x4b')](handleError(_0x4987e3,null));};function Extension(_0x333b86,_0x3254aa,_0x31fd9b,_0x279b44){this[_0x3421('0x59')]=_0x3421('0x5a');this[_0x3421('0x5b')]=_0x333b86;this[_0x3421('0x5c')]=_0x31fd9b;this[_0x3421('0x5d')]='system';this[_0x3421('0x5e')]=_0x3421('0x5f');this[_0x3421('0x60')]=_0x3254aa;this[_0x3421('0x61')]=_0x279b44;}function createVoicePrefixExtensions(_0x1813c9,_0x25a641,_0x32c9a7){return new BPromise(function(_0x374a6a,_0x5d6488){var _0x379673=new Extension(formatPrefixName(_0x1813c9['prefix']),0x1,_0x3421('0x62'),_0x3421('0x63'));_0x379673[_0x3421('0x64')]=_0x1813c9['id'];return db[_0x3421('0x65')]['create'](_0x379673,{'transaction':_0x32c9a7})[_0x3421('0x2b')](function(_0x21e11b){var _0x9def45=_0x21e11b[_0x3421('0x2d')]({'plain':!![]});var _0x9e649=_[_0x3421('0x34')](addVoicePrefixExtensions(_0x1813c9,_0x25a641),function(_0x5e6c4d){_0x5e6c4d[_0x3421('0x51')]=_0x9def45['id'];_0x5e6c4d[_0x3421('0x64')]=_0x1813c9['id'];return _0x5e6c4d;});return db[_0x3421('0x65')][_0x3421('0x66')](_0x9e649,{'transaction':_0x32c9a7})[_0x3421('0x2b')](function(_0x1ba5e1){if(!_0x1ba5e1){return _0x5d6488(_0x3421('0x67'));}else{return _0x374a6a(_0x1ba5e1);}})[_0x3421('0x4b')](function(_0x4edb4e){return _0x5d6488(_0x4edb4e);});});;});};function addVoicePrefixExtensions(_0xfbdb57,_0x46717b){var _0x200958=[];var _0x40ae83=formatPrefixName(_0xfbdb57[_0x3421('0x68')]);_0x200958['push'](new Extension(_0x40ae83,0x2,'Set',_0x3421('0x69')+_0xfbdb57[_0x3421('0x32')]));if(_0xfbdb57[_0x3421('0x6a')]){_0x200958['push'](new Extension(_0x40ae83,0x3,_0x3421('0x6b'),'PREFIX-CALLERIDALL='+_0xfbdb57[_0x3421('0x6a')]));}else{_0x200958['push'](new Extension(_0x40ae83,0x3,'NoOp','No\x20callerid\x20available'));}_0x200958['push'](new Extension(_0x40ae83,0x4,'goto',_0x46717b[_0x3421('0x59')]+','+_0x3421('0x6c')+(0x8+_0xfbdb57[_0x3421('0x32')][_0x3421('0x3f')])+'}'+','+0x1));return _0x200958;}function formatPrefixName(_0xa05828){var _0x3ccb08='_';for(var _0x231067=0x0;_0x231067<_0xa05828[_0x3421('0x3f')];_0x231067++){if(_0xa05828[_0x3421('0x6d')](_0x231067)=='-'){_0x3ccb08+=_0xa05828[_0x3421('0x6d')](_0x231067);}else{_0x3ccb08+='['+_0xa05828['charAt'](_0x231067)+']';}}_0x3ccb08+='.';return _0x3ccb08;}exports[_0x3421('0x2a')]=function(_0x4dce60,_0x252b28,_0x41e5f8){var _0x40e0a6=_0x4dce60[_0x3421('0x50')];_0x40e0a6[_0x3421('0x68')]=_0x3421('0x6e')+_0x40e0a6[_0x3421('0x32')]+'-';return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x5c74a8){return db[_0x3421('0x35')][_0x3421('0x2a')](_0x40e0a6,{'where':{'id':_0x40e0a6['id']},'transaction':_0x5c74a8})[_0x3421('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x40e0a6['id']},'transaction':_0x5c74a8})['then'](function(){return db['VoiceExtension'][_0x3421('0x4a')]({'where':{'id':_0x40e0a6['VoiceExtensionId']},'raw':!![]})[_0x3421('0x2b')](function(_0x8aee05){return createVoicePrefixExtensions(_0x40e0a6,_0x8aee05,_0x5c74a8);});});});})[_0x3421('0x2b')](function(){return db[_0x3421('0x35')]['findById'](_0x40e0a6['id']);})[_0x3421('0x2b')](respondWithResult(_0x252b28,null))[_0x3421('0x4b')](handleError(_0x252b28,null));};exports[_0x3421('0x6f')]=function(_0xfb8c60,_0x151eaf,_0x4177cc){return db['VoicePrefix'][_0x3421('0x4a')]({'where':{'id':_0xfb8c60[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x151eaf,null))[_0x3421('0x2b')](function(_0x37e6d8){if(_0x37e6d8){return _0x37e6d8[_0x3421('0x6f')](_0xfb8c60[_0x3421('0x50')]['ids'],_['omit'](_0xfb8c60[_0x3421('0x50')],[_0x3421('0x70'),'id'])||{})[_0x3421('0x71')](function(_0x5d04c6){for(var _0x2dac40=0x0;_0x2dac40<_0xfb8c60['body'][_0x3421('0x70')]['length'];_0x2dac40+=0x1){socket[_0x3421('0x72')](_0x3421('0x73'),{'UserId':Number(_0xfb8c60[_0x3421('0x50')][_0x3421('0x70')][_0x2dac40]),'VoicePrefixId':Number(_0xfb8c60[_0x3421('0x49')]['id'])});}return _0x5d04c6;});}})[_0x3421('0x2b')](respondWithResult(_0x151eaf,null))[_0x3421('0x4b')](handleError(_0x151eaf,null));};exports[_0x3421('0x74')]=function(_0x3f1df5,_0x37ca80,_0x427013){return db[_0x3421('0x35')]['find']({'where':{'id':_0x3f1df5[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x37ca80,null))[_0x3421('0x2b')](function(_0x387d09){if(_0x387d09){return _0x387d09[_0x3421('0x74')](_0x3f1df5[_0x3421('0x39')][_0x3421('0x70')])[_0x3421('0x2b')](function(){if(_['isArray'](_0x3f1df5[_0x3421('0x39')]['ids'])){for(var _0x4d92ed=0x0;_0x4d92ed<_0x3f1df5['query'][_0x3421('0x70')][_0x3421('0x3f')];_0x4d92ed+=0x1){socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':Number(_0x3f1df5['query'][_0x3421('0x70')][_0x4d92ed]),'VoicePrefixId':Number(_0x3f1df5[_0x3421('0x49')]['id'])});}}else{socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':Number(_0x3f1df5[_0x3421('0x39')][_0x3421('0x70')]),'VoicePrefixId':Number(_0x3f1df5[_0x3421('0x49')]['id'])});}});}})[_0x3421('0x2b')](respondWithStatusCode(_0x37ca80,null))[_0x3421('0x4b')](handleError(_0x37ca80,null));};exports[_0x3421('0x76')]=function(_0x19e35d,_0x414218,_0x1d65ba){var _0x170340={};var _0x456644={};var _0x355f47;var _0x826d7c;return db['VoicePrefix']['findOne']({'where':{'id':_0x19e35d[_0x3421('0x49')]['id']}})['then'](handleEntityNotFound(_0x414218,null))[_0x3421('0x2b')](function(_0x2fd442){if(_0x2fd442){_0x355f47=_0x2fd442;_0x456644['model']=_[_0x3421('0x3a')](db[_0x3421('0x77')][_0x3421('0x36')]);_0x456644[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x19e35d[_0x3421('0x39')]);_0x456644[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x456644[_0x3421('0x38')],_0x456644[_0x3421('0x39')]);_0x170340[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x456644[_0x3421('0x38')],qs['fields'](_0x19e35d[_0x3421('0x39')]['fields']));_0x170340[_0x3421('0x3d')]=_0x170340[_0x3421('0x3d')]['length']?_0x170340[_0x3421('0x3d')]:_0x456644['model'];_0x170340['order']=qs[_0x3421('0x40')](_0x19e35d[_0x3421('0x39')][_0x3421('0x40')]);_0x170340['where']=qs[_0x3421('0x3b')](_[_0x3421('0x42')](_0x19e35d[_0x3421('0x39')],_0x456644['filters']));if(_0x19e35d['query'][_0x3421('0x43')]){_0x170340[_0x3421('0x41')]=_[_0x3421('0x44')](_0x170340[_0x3421('0x41')],{'$or':_['map'](_0x170340[_0x3421('0x3d')],function(_0x1fcd4b){var _0x298afc={};_0x298afc[_0x1fcd4b]={'$like':'%'+_0x19e35d[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x298afc;})});}_0x170340=_[_0x3421('0x44')]({},_0x170340,_0x19e35d[_0x3421('0x45')]);return _0x355f47[_0x3421('0x76')](_0x170340);}})['then'](function(_0x27967d){if(_0x27967d){_0x826d7c=_0x27967d[_0x3421('0x3f')];if(!_0x19e35d['query']['hasOwnProperty'](_0x3421('0x78'))){_0x170340[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x19e35d[_0x3421('0x39')][_0x3421('0x23')]);_0x170340['offset']=qs['offset'](_0x19e35d[_0x3421('0x39')]['offset']);}return _0x355f47['getAgents'](_0x170340);}})[_0x3421('0x2b')](function(_0x1a5b7c){if(_0x1a5b7c){return _0x1a5b7c?{'count':_0x826d7c,'rows':_0x1a5b7c}:null;}})[_0x3421('0x2b')](respondWithResult(_0x414218,null))[_0x3421('0x4b')](handleError(_0x414218,null));};exports['getTeams']=function(_0x595f0a,_0x335331,_0x5a922d){var _0x5af9c9={};var _0x1fb48f={};var _0x3fc2b6;var _0x4289f3;return db['VoicePrefix']['findOne']({'where':{'id':_0x595f0a['params']['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x335331,null))[_0x3421('0x2b')](function(_0x176b12){if(_0x176b12){_0x3fc2b6=_0x176b12;_0x1fb48f[_0x3421('0x38')]=_[_0x3421('0x3a')](db[_0x3421('0x79')][_0x3421('0x36')]);_0x1fb48f['query']=_[_0x3421('0x3a')](_0x595f0a[_0x3421('0x39')]);_0x1fb48f[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x1fb48f[_0x3421('0x38')],_0x1fb48f[_0x3421('0x39')]);_0x5af9c9[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x1fb48f[_0x3421('0x38')],qs['fields'](_0x595f0a['query'][_0x3421('0x3e')]));_0x5af9c9['attributes']=_0x5af9c9[_0x3421('0x3d')]['length']?_0x5af9c9[_0x3421('0x3d')]:_0x1fb48f[_0x3421('0x38')];_0x5af9c9[_0x3421('0x7a')]=qs[_0x3421('0x40')](_0x595f0a[_0x3421('0x39')]['sort']);_0x5af9c9['where']=qs[_0x3421('0x3b')](_[_0x3421('0x42')](_0x595f0a[_0x3421('0x39')],_0x1fb48f[_0x3421('0x3b')]));if(_0x595f0a['query'][_0x3421('0x43')]){_0x5af9c9[_0x3421('0x41')]=_[_0x3421('0x44')](_0x5af9c9[_0x3421('0x41')],{'$or':_[_0x3421('0x34')](_0x5af9c9[_0x3421('0x3d')],function(_0x31095c){var _0x4c3058={};_0x4c3058[_0x31095c]={'$like':'%'+_0x595f0a[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x4c3058;})});}_0x5af9c9=_['merge']({},_0x5af9c9,_0x595f0a[_0x3421('0x45')]);return _0x3fc2b6[_0x3421('0x7b')](_0x5af9c9);}})[_0x3421('0x2b')](function(_0x58b3e4){if(_0x58b3e4){_0x4289f3=_0x58b3e4[_0x3421('0x3f')];if(!_0x595f0a[_0x3421('0x39')]['hasOwnProperty'](_0x3421('0x78'))){_0x5af9c9[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x595f0a[_0x3421('0x39')][_0x3421('0x23')]);_0x5af9c9[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x595f0a[_0x3421('0x39')]['offset']);}return _0x3fc2b6[_0x3421('0x7b')](_0x5af9c9);}})['then'](function(_0x5aaa8a){if(_0x5aaa8a){return _0x5aaa8a?{'count':_0x4289f3,'rows':_0x5aaa8a}:null;}})[_0x3421('0x2b')](respondWithResult(_0x335331,null))[_0x3421('0x4b')](handleError(_0x335331,null));};exports[_0x3421('0x7c')]=function(_0x2c62d7,_0x5cbf21,_0x25c6a0){var _0x44e166=_0x2c62d7[_0x3421('0x50')][_0x3421('0x70')];var _0x13b03f;return db[_0x3421('0x79')][_0x3421('0x47')]({'where':{'id':_0x44e166},'attributes':['id'],'include':[{'model':db[_0x3421('0x77')],'as':_0x3421('0x7d'),'attributes':['id',_0x3421('0x32'),_0x3421('0x7e'),_0x3421('0x7f'),_0x3421('0x80')],'raw':!![]}]})[_0x3421('0x2b')](function(_0x1cde5f){if(_0x1cde5f){_0x13b03f=_0x1cde5f;var _0x1ddc33=_[_0x3421('0x81')](_0x1cde5f,function(_0x34f980){var _0x7d7398=_0x34f980[_0x3421('0x2d')]({'plain':!![]});return _0x7d7398[_0x3421('0x7d')];});return db['VoicePrefix']['find']({'where':{'id':_0x2c62d7[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](function(_0x1a7038){return db[_0x3421('0x4e')]['transaction'](function(_0x18f27a){return _0x1a7038[_0x3421('0x7c')](_0x44e166,{'transaction':_0x18f27a})['then'](function(){return BPromise[_0x3421('0x82')](_0x13b03f,function(_0x2eb3f4){return db[_0x3421('0x83')]['upsert']({'TeamId':_0x2eb3f4['id'],'VoicePrefixId':_0x2c62d7[_0x3421('0x49')]['id']},{'transaction':_0x18f27a});});})['then'](function(){return BPromise[_0x3421('0x82')](_0x1ddc33,function(_0x3f6f2c){return db[_0x3421('0x84')][_0x3421('0x85')]({'where':{'UserId':_0x3f6f2c['id'],'VoicePrefixId':_0x2c62d7[_0x3421('0x49')]['id']},'transaction':_0x18f27a});});})[_0x3421('0x2b')](function(){_0x1ddc33[_0x3421('0x86')](function(_0x50607f){socket[_0x3421('0x72')]('userVoicePrefix:save',{'UserId':_0x50607f['id'],'VoicePrefixId':_0x1a7038['id']});});});});});}})['then'](respondWithStatusCode(_0x5cbf21,null))[_0x3421('0x4b')](handleError(_0x5cbf21,null));};exports[_0x3421('0x87')]=function(_0x4a85d1,_0x1b48e1,_0x4c357e){return db[_0x3421('0x79')][_0x3421('0x47')]({'where':{'id':_0x4a85d1[_0x3421('0x39')][_0x3421('0x70')]},'attributes':['id'],'include':[{'model':db[_0x3421('0x77')],'as':_0x3421('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x3421('0x2b')](handleEntityNotFound(_0x1b48e1,null))[_0x3421('0x2b')](function(_0x2f38ec){var _0x11f294=_[_0x3421('0x34')](_0x2f38ec,'id');var _0x2d7330=[];var _0x5bf9a4=[];var _0x36868f=squel['select']();_0x36868f['field'](_0x3421('0x88'))[_0x3421('0x89')](_0x3421('0x8a'),'tq')[_0x3421('0x8b')]('user_has_teams','ut',_0x3421('0x8c'))[_0x3421('0x41')]('VoicePrefixId\x20=\x20?',_0x4a85d1[_0x3421('0x49')]['id']);for(var _0x4a933a=0x0;_0x4a933a<_0x2f38ec[_0x3421('0x3f')];_0x4a933a+=0x1){let _0x2defcb=_0x2f38ec[_0x4a933a];for(var _0x16735e=0x0;_0x16735e<_0x2defcb['Agents'][_0x3421('0x3f')];_0x16735e+=0x1){let _0x303df7=_0x2defcb[_0x3421('0x7d')][_0x16735e];var _0x1d8163=_0x36868f[_0x3421('0x8d')]();_0x1d8163[_0x3421('0x41')](_0x3421('0x8e'),_0x303df7['id']);_0x5bf9a4[_0x3421('0x8f')](db['sequelize'][_0x3421('0x39')](_0x1d8163[_0x3421('0x90')](),{'type':db[_0x3421('0x4e')][_0x3421('0x91')][_0x3421('0x92')]})[_0x3421('0x2b')](function(_0x3a5346){if(_0x3a5346['length']===0x1){return _0x303df7['id'];}else{var _0x3f64d0=_[_0x3421('0x93')](_['map'](_0x3a5346,'TeamId'),function(_0x4aa261){return _[_0x3421('0x94')](_0x11f294,_0x4aa261);});if(_0x3f64d0){return _0x303df7['id'];}}}));}}return BPromise[_0x3421('0x95')](_0x5bf9a4)['then'](function(_0x256976){_0x2d7330=_(_0x2d7330)[_0x3421('0x96')](_0x256976)[_0x3421('0x97')]()[_0x3421('0x98')]();return db[_0x3421('0x35')][_0x3421('0x4a')]({'where':{'id':_0x4a85d1[_0x3421('0x49')]['id']}})['then'](function(_0x224e26){return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x1e2a67){return _0x224e26[_0x3421('0x87')](_0x4a85d1[_0x3421('0x39')]['ids'],{'transaction':_0x1e2a67})[_0x3421('0x2b')](function(){if(!_[_0x3421('0x99')](_0x2d7330)){return _0x224e26['removeAgents'](_0x2d7330,{'transaction':_0x1e2a67});}})[_0x3421('0x2b')](function(){_0x2d7330[_0x3421('0x86')](function(_0x25cc13){socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':_0x25cc13,'VoicePrefixId':_0x224e26['id']});});});});});});})[_0x3421('0x2b')](respondWithStatusCode(_0x1b48e1,null))[_0x3421('0x4b')](handleError(_0x1b48e1,null));}; \ No newline at end of file +var _0x4213=['limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','name','index','map','VoicePrefix','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','includeAll','findAll','show','params','find','catch','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','CDR(prefix)=','callerIdAll','Set','${EXTEN:','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','nolimit','Team','order','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','offset','undefined'];(function(_0x3ea538,_0x34be34){var _0x10f15a=function(_0x1335a5){while(--_0x1335a5){_0x3ea538['push'](_0x3ea538['shift']());}};_0x10f15a(++_0x34be34);}(_0x4213,0x77));var _0x3421=function(_0x4716aa,_0x427bd8){_0x4716aa=_0x4716aa-0x0;var _0x37e331=_0x4213[_0x4716aa];return _0x37e331;};'use strict';var emlformat=require(_0x3421('0x0'));var rimraf=require(_0x3421('0x1'));var zipdir=require(_0x3421('0x2'));var jsonpatch=require(_0x3421('0x3'));var rp=require(_0x3421('0x4'));var moment=require(_0x3421('0x5'));var BPromise=require(_0x3421('0x6'));var Mustache=require('mustache');var util=require(_0x3421('0x7'));var path=require('path');var sox=require(_0x3421('0x8'));var csv=require(_0x3421('0x9'));var ejs=require(_0x3421('0xa'));var fs=require('fs');var fs_extra=require(_0x3421('0xb'));var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0x9'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3421('0x12'));var logger=require(_0x3421('0x13'))(_0x3421('0x14'));var utils=require(_0x3421('0x15'));var config=require(_0x3421('0x16'));var licenseUtil=require(_0x3421('0x17'));var db=require(_0x3421('0x18'))['db'];config['redis']=_[_0x3421('0x19')](config[_0x3421('0x1a')],{'host':_0x3421('0x1b'),'port':0x18eb});var socket=require(_0x3421('0x1c'))(new Redis(config[_0x3421('0x1a')]));require(_0x3421('0x1d'))[_0x3421('0x1e')](socket);function respondWithStatusCode(_0x59ea4a,_0xafd9e0){_0xafd9e0=_0xafd9e0||0xcc;return function(_0x4b5f43){if(_0x4b5f43){return _0x59ea4a[_0x3421('0x1f')](_0xafd9e0);}return _0x59ea4a[_0x3421('0x20')](_0xafd9e0)['end']();};}function respondWithResult(_0x1e33ab,_0x4c6f7b){_0x4c6f7b=_0x4c6f7b||0xc8;return function(_0x16bc8f){if(_0x16bc8f){return _0x1e33ab[_0x3421('0x20')](_0x4c6f7b)['json'](_0x16bc8f);}};}function respondWithFilteredResult(_0x3584d6,_0x3dec08){return function(_0x130d3c){if(_0x130d3c){var _0x104cc5=typeof _0x3dec08[_0x3421('0x21')]===_0x3421('0x22')&&typeof _0x3dec08[_0x3421('0x23')]===_0x3421('0x22');var _0x197b83=_0x130d3c[_0x3421('0x24')];var _0x538a8b=_0x104cc5?0x0:_0x3dec08['offset'];var _0x420114=_0x104cc5?_0x130d3c['count']:_0x3dec08['offset']+_0x3dec08['limit'];var _0x33155b;if(_0x420114>=_0x197b83){_0x420114=_0x197b83;_0x33155b=0xc8;}else{_0x33155b=0xce;}_0x3584d6[_0x3421('0x20')](_0x33155b);return _0x3584d6[_0x3421('0x25')](_0x3421('0x26'),_0x538a8b+'-'+_0x420114+'/'+_0x197b83)[_0x3421('0x27')](_0x130d3c);}return null;};}function patchUpdates(_0x39bed4){return function(_0x3df305){try{jsonpatch[_0x3421('0x28')](_0x3df305,_0x39bed4,!![]);}catch(_0xb9af5f){return BPromise[_0x3421('0x29')](_0xb9af5f);}return _0x3df305['save']();};}function saveUpdates(_0x57a4af,_0x494423){return function(_0x3fef90){if(_0x3fef90){return _0x3fef90[_0x3421('0x2a')](_0x57a4af)[_0x3421('0x2b')](function(_0x5bc28a){return _0x5bc28a;});}return null;};}function removeEntity(_0x506af4,_0x1b65d0){return function(_0x5b53b6){if(_0x5b53b6){return _0x5b53b6[_0x3421('0x2c')]()['then'](function(){var _0x15e73c=_0x5b53b6[_0x3421('0x2d')]({'plain':!![]});var _0x36d75f=_0x3421('0x2e');return db[_0x3421('0x2f')]['destroy']({'where':{'type':_0x36d75f,'resourceId':_0x15e73c['id']}})[_0x3421('0x2b')](function(){return _0x5b53b6;});})['then'](function(){_0x506af4['status'](0xcc)[_0x3421('0x30')]();});}};}function handleEntityNotFound(_0x5aa96b,_0x5074a2){return function(_0xb4eaf4){if(!_0xb4eaf4){_0x5aa96b['sendStatus'](0x194);}return _0xb4eaf4;};}function handleError(_0x20abc7,_0x5bcd19){_0x5bcd19=_0x5bcd19||0x1f4;return function(_0xc7f9fb){logger[_0x3421('0x31')](_0xc7f9fb['stack']);if(_0xc7f9fb[_0x3421('0x32')]){delete _0xc7f9fb[_0x3421('0x32')];}_0x20abc7[_0x3421('0x20')](_0x5bcd19)['send'](_0xc7f9fb);};}exports[_0x3421('0x33')]=function(_0x50d61b,_0x2b5af4){var _0xf0039={},_0x1045ab={},_0x841e08={'count':0x0,'rows':[]};var _0x3875c6=_[_0x3421('0x34')](db[_0x3421('0x35')][_0x3421('0x36')],function(_0x94559a){return{'name':_0x94559a[_0x3421('0x37')],'type':_0x94559a['type']['key']};});_0x1045ab[_0x3421('0x38')]=_[_0x3421('0x34')](_0x3875c6,'name');_0x1045ab[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x50d61b[_0x3421('0x39')]);_0x1045ab[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x1045ab['model'],_0x1045ab[_0x3421('0x39')]);_0xf0039[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x1045ab['model'],qs[_0x3421('0x3e')](_0x50d61b['query'][_0x3421('0x3e')]));_0xf0039[_0x3421('0x3d')]=_0xf0039[_0x3421('0x3d')][_0x3421('0x3f')]?_0xf0039[_0x3421('0x3d')]:_0x1045ab[_0x3421('0x38')];if(!_0x50d61b[_0x3421('0x39')]['hasOwnProperty']('nolimit')){_0xf0039['limit']=qs[_0x3421('0x23')](_0x50d61b['query']['limit']);_0xf0039[_0x3421('0x21')]=qs['offset'](_0x50d61b[_0x3421('0x39')][_0x3421('0x21')]);}_0xf0039['order']=qs[_0x3421('0x40')](_0x50d61b[_0x3421('0x39')][_0x3421('0x40')]);_0xf0039[_0x3421('0x41')]=qs['filters'](_[_0x3421('0x42')](_0x50d61b[_0x3421('0x39')],_0x1045ab[_0x3421('0x3b')]),_0x3875c6);if(_0x50d61b[_0x3421('0x39')][_0x3421('0x43')]){_0xf0039['where']=_[_0x3421('0x44')](_0xf0039[_0x3421('0x41')],{'$or':_['map'](_0x3875c6,function(_0x15551c){if(_0x15551c['type']!=='VIRTUAL'){var _0x486ce8={};_0x486ce8[_0x15551c[_0x3421('0x32')]]={'$like':'%'+_0x50d61b[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x486ce8;}})});}_0xf0039=_[_0x3421('0x44')]({},_0xf0039,_0x50d61b[_0x3421('0x45')]);var _0x417d6e={'where':_0xf0039[_0x3421('0x41')]};return db[_0x3421('0x35')][_0x3421('0x24')](_0x417d6e)[_0x3421('0x2b')](function(_0x3b9d15){_0x841e08[_0x3421('0x24')]=_0x3b9d15;if(_0x50d61b[_0x3421('0x39')][_0x3421('0x46')]){_0xf0039['include']=[{'all':!![]}];}return db[_0x3421('0x35')][_0x3421('0x47')](_0xf0039);})[_0x3421('0x2b')](function(_0x4466be){_0x841e08['rows']=_0x4466be;return _0x841e08;})[_0x3421('0x2b')](respondWithFilteredResult(_0x2b5af4,_0xf0039))['catch'](handleError(_0x2b5af4,null));};exports[_0x3421('0x48')]=function(_0x248f84,_0x669cfd){var _0x176aef={'raw':![],'where':{'id':_0x248f84[_0x3421('0x49')]['id']}},_0x2f9a84={};_0x2f9a84[_0x3421('0x38')]=_[_0x3421('0x3a')](db[_0x3421('0x35')][_0x3421('0x36')]);_0x2f9a84[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x248f84[_0x3421('0x39')]);_0x2f9a84['filters']=_[_0x3421('0x3c')](_0x2f9a84['model'],_0x2f9a84[_0x3421('0x39')]);_0x176aef[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x2f9a84[_0x3421('0x38')],qs[_0x3421('0x3e')](_0x248f84[_0x3421('0x39')][_0x3421('0x3e')]));_0x176aef[_0x3421('0x3d')]=_0x176aef[_0x3421('0x3d')][_0x3421('0x3f')]?_0x176aef['attributes']:_0x2f9a84[_0x3421('0x38')];if(_0x248f84[_0x3421('0x39')][_0x3421('0x46')]){_0x176aef['include']=[{'all':!![]}];}_0x176aef=_['merge']({},_0x176aef,_0x248f84[_0x3421('0x45')]);return db[_0x3421('0x35')][_0x3421('0x4a')](_0x176aef)['then'](handleEntityNotFound(_0x669cfd,null))[_0x3421('0x2b')](respondWithResult(_0x669cfd,null))[_0x3421('0x4b')](handleError(_0x669cfd,null));};exports[_0x3421('0x2c')]=function(_0x356376,_0x57554a){return db[_0x3421('0x35')][_0x3421('0x4a')]({'where':{'id':_0x356376[_0x3421('0x49')]['id']}})['then'](handleEntityNotFound(_0x57554a,null))['then'](removeEntity(_0x57554a,null))['catch'](handleError(_0x57554a,null));};exports[_0x3421('0x4c')]=function(_0x1021f8,_0x5a9ccf){return db['VoicePrefix'][_0x3421('0x4c')]()[_0x3421('0x2b')](respondWithResult(_0x5a9ccf,null))[_0x3421('0x4b')](handleError(_0x5a9ccf,null));};exports[_0x3421('0x4d')]=function(_0x127835,_0x4987e3){var _0x27d284;return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x2f9ce1){return db['VoicePrefix'][_0x3421('0x4d')](_0x127835[_0x3421('0x50')],{'transaction':_0x2f9ce1})[_0x3421('0x2b')](function(_0x48a967){_0x27d284=_0x48a967[_0x3421('0x2d')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x27d284[_0x3421('0x51')]},'raw':!![]})['then'](function(_0x4e33a0){return createVoicePrefixExtensions(_0x27d284,_0x4e33a0,_0x2f9ce1);});});})[_0x3421('0x2b')](function(){var _0x12bd9a=_0x127835['user'][_0x3421('0x2d')]({'plain':!![]});if(!_0x12bd9a)throw new Error(_0x3421('0x52'));if(_0x12bd9a[_0x3421('0x53')]===_0x3421('0x54')){var _0x1c73b9=_0x27d284;return db[_0x3421('0x55')][_0x3421('0x4a')]({'where':{'name':_0x3421('0x2e'),'userProfileId':_0x12bd9a[_0x3421('0x56')]},'raw':!![]})['then'](function(_0x1e4add){if(_0x1e4add&&_0x1e4add[_0x3421('0x57')]===0x0){return db['UserProfileResource'][_0x3421('0x4d')]({'name':_0x1c73b9[_0x3421('0x32')],'resourceId':_0x1c73b9['id'],'type':_0x1e4add[_0x3421('0x32')],'sectionId':_0x1e4add['id']},{})['then'](function(){return _0x27d284;});}else{return _0x27d284;}})[_0x3421('0x4b')](function(_0x27085d){logger[_0x3421('0x31')](_0x3421('0x58'),_0x27085d);throw _0x27085d;});}return _0x27d284;})[_0x3421('0x2b')](respondWithResult(_0x4987e3,null))[_0x3421('0x4b')](handleError(_0x4987e3,null));};function Extension(_0x333b86,_0x3254aa,_0x31fd9b,_0x279b44){this[_0x3421('0x59')]=_0x3421('0x5a');this[_0x3421('0x5b')]=_0x333b86;this[_0x3421('0x5c')]=_0x31fd9b;this[_0x3421('0x5d')]='system';this[_0x3421('0x5e')]=_0x3421('0x5f');this[_0x3421('0x60')]=_0x3254aa;this[_0x3421('0x61')]=_0x279b44;}function createVoicePrefixExtensions(_0x1813c9,_0x25a641,_0x32c9a7){return new BPromise(function(_0x374a6a,_0x5d6488){var _0x379673=new Extension(formatPrefixName(_0x1813c9['prefix']),0x1,_0x3421('0x62'),_0x3421('0x63'));_0x379673[_0x3421('0x64')]=_0x1813c9['id'];return db[_0x3421('0x65')]['create'](_0x379673,{'transaction':_0x32c9a7})[_0x3421('0x2b')](function(_0x21e11b){var _0x9def45=_0x21e11b[_0x3421('0x2d')]({'plain':!![]});var _0x9e649=_[_0x3421('0x34')](addVoicePrefixExtensions(_0x1813c9,_0x25a641),function(_0x5e6c4d){_0x5e6c4d[_0x3421('0x51')]=_0x9def45['id'];_0x5e6c4d[_0x3421('0x64')]=_0x1813c9['id'];return _0x5e6c4d;});return db[_0x3421('0x65')][_0x3421('0x66')](_0x9e649,{'transaction':_0x32c9a7})[_0x3421('0x2b')](function(_0x1ba5e1){if(!_0x1ba5e1){return _0x5d6488(_0x3421('0x67'));}else{return _0x374a6a(_0x1ba5e1);}})[_0x3421('0x4b')](function(_0x4edb4e){return _0x5d6488(_0x4edb4e);});});;});};function addVoicePrefixExtensions(_0xfbdb57,_0x46717b){var _0x200958=[];var _0x40ae83=formatPrefixName(_0xfbdb57[_0x3421('0x68')]);_0x200958['push'](new Extension(_0x40ae83,0x2,'Set',_0x3421('0x69')+_0xfbdb57[_0x3421('0x32')]));if(_0xfbdb57[_0x3421('0x6a')]){_0x200958['push'](new Extension(_0x40ae83,0x3,_0x3421('0x6b'),'PREFIX-CALLERIDALL='+_0xfbdb57[_0x3421('0x6a')]));}else{_0x200958['push'](new Extension(_0x40ae83,0x3,'NoOp','No\x20callerid\x20available'));}_0x200958['push'](new Extension(_0x40ae83,0x4,'goto',_0x46717b[_0x3421('0x59')]+','+_0x3421('0x6c')+(0x8+_0xfbdb57[_0x3421('0x32')][_0x3421('0x3f')])+'}'+','+0x1));return _0x200958;}function formatPrefixName(_0xa05828){var _0x3ccb08='_';for(var _0x231067=0x0;_0x231067<_0xa05828[_0x3421('0x3f')];_0x231067++){if(_0xa05828[_0x3421('0x6d')](_0x231067)=='-'){_0x3ccb08+=_0xa05828[_0x3421('0x6d')](_0x231067);}else{_0x3ccb08+='['+_0xa05828['charAt'](_0x231067)+']';}}_0x3ccb08+='.';return _0x3ccb08;}exports[_0x3421('0x2a')]=function(_0x4dce60,_0x252b28,_0x41e5f8){var _0x40e0a6=_0x4dce60[_0x3421('0x50')];_0x40e0a6[_0x3421('0x68')]=_0x3421('0x6e')+_0x40e0a6[_0x3421('0x32')]+'-';return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x5c74a8){return db[_0x3421('0x35')][_0x3421('0x2a')](_0x40e0a6,{'where':{'id':_0x40e0a6['id']},'transaction':_0x5c74a8})[_0x3421('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x40e0a6['id']},'transaction':_0x5c74a8})['then'](function(){return db['VoiceExtension'][_0x3421('0x4a')]({'where':{'id':_0x40e0a6['VoiceExtensionId']},'raw':!![]})[_0x3421('0x2b')](function(_0x8aee05){return createVoicePrefixExtensions(_0x40e0a6,_0x8aee05,_0x5c74a8);});});});})[_0x3421('0x2b')](function(){return db[_0x3421('0x35')]['findById'](_0x40e0a6['id']);})[_0x3421('0x2b')](respondWithResult(_0x252b28,null))[_0x3421('0x4b')](handleError(_0x252b28,null));};exports[_0x3421('0x6f')]=function(_0xfb8c60,_0x151eaf,_0x4177cc){return db['VoicePrefix'][_0x3421('0x4a')]({'where':{'id':_0xfb8c60[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x151eaf,null))[_0x3421('0x2b')](function(_0x37e6d8){if(_0x37e6d8){return _0x37e6d8[_0x3421('0x6f')](_0xfb8c60[_0x3421('0x50')]['ids'],_['omit'](_0xfb8c60[_0x3421('0x50')],[_0x3421('0x70'),'id'])||{})[_0x3421('0x71')](function(_0x5d04c6){for(var _0x2dac40=0x0;_0x2dac40<_0xfb8c60['body'][_0x3421('0x70')]['length'];_0x2dac40+=0x1){socket[_0x3421('0x72')](_0x3421('0x73'),{'UserId':Number(_0xfb8c60[_0x3421('0x50')][_0x3421('0x70')][_0x2dac40]),'VoicePrefixId':Number(_0xfb8c60[_0x3421('0x49')]['id'])});}return _0x5d04c6;});}})[_0x3421('0x2b')](respondWithResult(_0x151eaf,null))[_0x3421('0x4b')](handleError(_0x151eaf,null));};exports[_0x3421('0x74')]=function(_0x3f1df5,_0x37ca80,_0x427013){return db[_0x3421('0x35')]['find']({'where':{'id':_0x3f1df5[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x37ca80,null))[_0x3421('0x2b')](function(_0x387d09){if(_0x387d09){return _0x387d09[_0x3421('0x74')](_0x3f1df5[_0x3421('0x39')][_0x3421('0x70')])[_0x3421('0x2b')](function(){if(_['isArray'](_0x3f1df5[_0x3421('0x39')]['ids'])){for(var _0x4d92ed=0x0;_0x4d92ed<_0x3f1df5['query'][_0x3421('0x70')][_0x3421('0x3f')];_0x4d92ed+=0x1){socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':Number(_0x3f1df5['query'][_0x3421('0x70')][_0x4d92ed]),'VoicePrefixId':Number(_0x3f1df5[_0x3421('0x49')]['id'])});}}else{socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':Number(_0x3f1df5[_0x3421('0x39')][_0x3421('0x70')]),'VoicePrefixId':Number(_0x3f1df5[_0x3421('0x49')]['id'])});}});}})[_0x3421('0x2b')](respondWithStatusCode(_0x37ca80,null))[_0x3421('0x4b')](handleError(_0x37ca80,null));};exports[_0x3421('0x76')]=function(_0x19e35d,_0x414218,_0x1d65ba){var _0x170340={};var _0x456644={};var _0x355f47;var _0x826d7c;return db['VoicePrefix']['findOne']({'where':{'id':_0x19e35d[_0x3421('0x49')]['id']}})['then'](handleEntityNotFound(_0x414218,null))[_0x3421('0x2b')](function(_0x2fd442){if(_0x2fd442){_0x355f47=_0x2fd442;_0x456644['model']=_[_0x3421('0x3a')](db[_0x3421('0x77')][_0x3421('0x36')]);_0x456644[_0x3421('0x39')]=_[_0x3421('0x3a')](_0x19e35d[_0x3421('0x39')]);_0x456644[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x456644[_0x3421('0x38')],_0x456644[_0x3421('0x39')]);_0x170340[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x456644[_0x3421('0x38')],qs['fields'](_0x19e35d[_0x3421('0x39')]['fields']));_0x170340[_0x3421('0x3d')]=_0x170340[_0x3421('0x3d')]['length']?_0x170340[_0x3421('0x3d')]:_0x456644['model'];_0x170340['order']=qs[_0x3421('0x40')](_0x19e35d[_0x3421('0x39')][_0x3421('0x40')]);_0x170340['where']=qs[_0x3421('0x3b')](_[_0x3421('0x42')](_0x19e35d[_0x3421('0x39')],_0x456644['filters']));if(_0x19e35d['query'][_0x3421('0x43')]){_0x170340[_0x3421('0x41')]=_[_0x3421('0x44')](_0x170340[_0x3421('0x41')],{'$or':_['map'](_0x170340[_0x3421('0x3d')],function(_0x1fcd4b){var _0x298afc={};_0x298afc[_0x1fcd4b]={'$like':'%'+_0x19e35d[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x298afc;})});}_0x170340=_[_0x3421('0x44')]({},_0x170340,_0x19e35d[_0x3421('0x45')]);return _0x355f47[_0x3421('0x76')](_0x170340);}})['then'](function(_0x27967d){if(_0x27967d){_0x826d7c=_0x27967d[_0x3421('0x3f')];if(!_0x19e35d['query']['hasOwnProperty'](_0x3421('0x78'))){_0x170340[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x19e35d[_0x3421('0x39')][_0x3421('0x23')]);_0x170340['offset']=qs['offset'](_0x19e35d[_0x3421('0x39')]['offset']);}return _0x355f47['getAgents'](_0x170340);}})[_0x3421('0x2b')](function(_0x1a5b7c){if(_0x1a5b7c){return _0x1a5b7c?{'count':_0x826d7c,'rows':_0x1a5b7c}:null;}})[_0x3421('0x2b')](respondWithResult(_0x414218,null))[_0x3421('0x4b')](handleError(_0x414218,null));};exports['getTeams']=function(_0x595f0a,_0x335331,_0x5a922d){var _0x5af9c9={};var _0x1fb48f={};var _0x3fc2b6;var _0x4289f3;return db['VoicePrefix']['findOne']({'where':{'id':_0x595f0a['params']['id']}})[_0x3421('0x2b')](handleEntityNotFound(_0x335331,null))[_0x3421('0x2b')](function(_0x176b12){if(_0x176b12){_0x3fc2b6=_0x176b12;_0x1fb48f[_0x3421('0x38')]=_[_0x3421('0x3a')](db[_0x3421('0x79')][_0x3421('0x36')]);_0x1fb48f['query']=_[_0x3421('0x3a')](_0x595f0a[_0x3421('0x39')]);_0x1fb48f[_0x3421('0x3b')]=_[_0x3421('0x3c')](_0x1fb48f[_0x3421('0x38')],_0x1fb48f[_0x3421('0x39')]);_0x5af9c9[_0x3421('0x3d')]=_[_0x3421('0x3c')](_0x1fb48f[_0x3421('0x38')],qs['fields'](_0x595f0a['query'][_0x3421('0x3e')]));_0x5af9c9['attributes']=_0x5af9c9[_0x3421('0x3d')]['length']?_0x5af9c9[_0x3421('0x3d')]:_0x1fb48f[_0x3421('0x38')];_0x5af9c9[_0x3421('0x7a')]=qs[_0x3421('0x40')](_0x595f0a[_0x3421('0x39')]['sort']);_0x5af9c9['where']=qs[_0x3421('0x3b')](_[_0x3421('0x42')](_0x595f0a[_0x3421('0x39')],_0x1fb48f[_0x3421('0x3b')]));if(_0x595f0a['query'][_0x3421('0x43')]){_0x5af9c9[_0x3421('0x41')]=_[_0x3421('0x44')](_0x5af9c9[_0x3421('0x41')],{'$or':_[_0x3421('0x34')](_0x5af9c9[_0x3421('0x3d')],function(_0x31095c){var _0x4c3058={};_0x4c3058[_0x31095c]={'$like':'%'+_0x595f0a[_0x3421('0x39')][_0x3421('0x43')]+'%'};return _0x4c3058;})});}_0x5af9c9=_['merge']({},_0x5af9c9,_0x595f0a[_0x3421('0x45')]);return _0x3fc2b6[_0x3421('0x7b')](_0x5af9c9);}})[_0x3421('0x2b')](function(_0x58b3e4){if(_0x58b3e4){_0x4289f3=_0x58b3e4[_0x3421('0x3f')];if(!_0x595f0a[_0x3421('0x39')]['hasOwnProperty'](_0x3421('0x78'))){_0x5af9c9[_0x3421('0x23')]=qs[_0x3421('0x23')](_0x595f0a[_0x3421('0x39')][_0x3421('0x23')]);_0x5af9c9[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x595f0a[_0x3421('0x39')]['offset']);}return _0x3fc2b6[_0x3421('0x7b')](_0x5af9c9);}})['then'](function(_0x5aaa8a){if(_0x5aaa8a){return _0x5aaa8a?{'count':_0x4289f3,'rows':_0x5aaa8a}:null;}})[_0x3421('0x2b')](respondWithResult(_0x335331,null))[_0x3421('0x4b')](handleError(_0x335331,null));};exports[_0x3421('0x7c')]=function(_0x2c62d7,_0x5cbf21,_0x25c6a0){var _0x44e166=_0x2c62d7[_0x3421('0x50')][_0x3421('0x70')];var _0x13b03f;return db[_0x3421('0x79')][_0x3421('0x47')]({'where':{'id':_0x44e166},'attributes':['id'],'include':[{'model':db[_0x3421('0x77')],'as':_0x3421('0x7d'),'attributes':['id',_0x3421('0x32'),_0x3421('0x7e'),_0x3421('0x7f'),_0x3421('0x80')],'raw':!![]}]})[_0x3421('0x2b')](function(_0x1cde5f){if(_0x1cde5f){_0x13b03f=_0x1cde5f;var _0x1ddc33=_[_0x3421('0x81')](_0x1cde5f,function(_0x34f980){var _0x7d7398=_0x34f980[_0x3421('0x2d')]({'plain':!![]});return _0x7d7398[_0x3421('0x7d')];});return db['VoicePrefix']['find']({'where':{'id':_0x2c62d7[_0x3421('0x49')]['id']}})[_0x3421('0x2b')](function(_0x1a7038){return db[_0x3421('0x4e')]['transaction'](function(_0x18f27a){return _0x1a7038[_0x3421('0x7c')](_0x44e166,{'transaction':_0x18f27a})['then'](function(){return BPromise[_0x3421('0x82')](_0x13b03f,function(_0x2eb3f4){return db[_0x3421('0x83')]['upsert']({'TeamId':_0x2eb3f4['id'],'VoicePrefixId':_0x2c62d7[_0x3421('0x49')]['id']},{'transaction':_0x18f27a});});})['then'](function(){return BPromise[_0x3421('0x82')](_0x1ddc33,function(_0x3f6f2c){return db[_0x3421('0x84')][_0x3421('0x85')]({'where':{'UserId':_0x3f6f2c['id'],'VoicePrefixId':_0x2c62d7[_0x3421('0x49')]['id']},'transaction':_0x18f27a});});})[_0x3421('0x2b')](function(){_0x1ddc33[_0x3421('0x86')](function(_0x50607f){socket[_0x3421('0x72')]('userVoicePrefix:save',{'UserId':_0x50607f['id'],'VoicePrefixId':_0x1a7038['id']});});});});});}})['then'](respondWithStatusCode(_0x5cbf21,null))[_0x3421('0x4b')](handleError(_0x5cbf21,null));};exports[_0x3421('0x87')]=function(_0x4a85d1,_0x1b48e1,_0x4c357e){return db[_0x3421('0x79')][_0x3421('0x47')]({'where':{'id':_0x4a85d1[_0x3421('0x39')][_0x3421('0x70')]},'attributes':['id'],'include':[{'model':db[_0x3421('0x77')],'as':_0x3421('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x3421('0x2b')](handleEntityNotFound(_0x1b48e1,null))[_0x3421('0x2b')](function(_0x2f38ec){var _0x11f294=_[_0x3421('0x34')](_0x2f38ec,'id');var _0x2d7330=[];var _0x5bf9a4=[];var _0x36868f=squel['select']();_0x36868f['field'](_0x3421('0x88'))[_0x3421('0x89')](_0x3421('0x8a'),'tq')[_0x3421('0x8b')]('user_has_teams','ut',_0x3421('0x8c'))[_0x3421('0x41')]('VoicePrefixId\x20=\x20?',_0x4a85d1[_0x3421('0x49')]['id']);for(var _0x4a933a=0x0;_0x4a933a<_0x2f38ec[_0x3421('0x3f')];_0x4a933a+=0x1){let _0x2defcb=_0x2f38ec[_0x4a933a];for(var _0x16735e=0x0;_0x16735e<_0x2defcb['Agents'][_0x3421('0x3f')];_0x16735e+=0x1){let _0x303df7=_0x2defcb[_0x3421('0x7d')][_0x16735e];var _0x1d8163=_0x36868f[_0x3421('0x8d')]();_0x1d8163[_0x3421('0x41')](_0x3421('0x8e'),_0x303df7['id']);_0x5bf9a4[_0x3421('0x8f')](db['sequelize'][_0x3421('0x39')](_0x1d8163[_0x3421('0x90')](),{'type':db[_0x3421('0x4e')][_0x3421('0x91')][_0x3421('0x92')]})[_0x3421('0x2b')](function(_0x3a5346){if(_0x3a5346['length']===0x1){return _0x303df7['id'];}else{var _0x3f64d0=_[_0x3421('0x93')](_['map'](_0x3a5346,'TeamId'),function(_0x4aa261){return _[_0x3421('0x94')](_0x11f294,_0x4aa261);});if(_0x3f64d0){return _0x303df7['id'];}}}));}}return BPromise[_0x3421('0x95')](_0x5bf9a4)['then'](function(_0x256976){_0x2d7330=_(_0x2d7330)[_0x3421('0x96')](_0x256976)[_0x3421('0x97')]()[_0x3421('0x98')]();return db[_0x3421('0x35')][_0x3421('0x4a')]({'where':{'id':_0x4a85d1[_0x3421('0x49')]['id']}})['then'](function(_0x224e26){return db[_0x3421('0x4e')][_0x3421('0x4f')](function(_0x1e2a67){return _0x224e26[_0x3421('0x87')](_0x4a85d1[_0x3421('0x39')]['ids'],{'transaction':_0x1e2a67})[_0x3421('0x2b')](function(){if(!_[_0x3421('0x99')](_0x2d7330)){return _0x224e26['removeAgents'](_0x2d7330,{'transaction':_0x1e2a67});}})[_0x3421('0x2b')](function(){_0x2d7330[_0x3421('0x86')](function(_0x25cc13){socket[_0x3421('0x72')](_0x3421('0x75'),{'UserId':_0x25cc13,'VoicePrefixId':_0x224e26['id']});});});});});});})[_0x3421('0x2b')](respondWithStatusCode(_0x1b48e1,null))[_0x3421('0x4b')](handleError(_0x1b48e1,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 77389c4..3dfd503 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 _0xf25f=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x153917,_0x457e5e){var _0x274d75=function(_0x190de1){while(--_0x190de1){_0x153917['push'](_0x153917['shift']());}};_0x274d75(++_0x457e5e);}(_0xf25f,0xcc));var _0xff25=function(_0x5f1813,_0x11ed77){_0x5f1813=_0x5f1813-0x0;var _0x10a02e=_0xf25f[_0x5f1813];return _0x10a02e;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xff25('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xff25('0x1')](0x0);var events={'afterCreate':_0xff25('0x2'),'afterUpdate':_0xff25('0x3'),'afterDestroy':'remove'};function emitEvent(_0x33061b){return function(_0x3792c3,_0x1f2621,_0x56f358){VoicePrefixEvents['emit'](_0x33061b+':'+_0x3792c3['id'],_0x3792c3);VoicePrefixEvents[_0xff25('0x4')](_0x33061b,_0x3792c3);_0x56f358(null);};}for(var e in events){if(events[_0xff25('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xff25('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0xd656=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','VoicePrefix'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xd656,0xa6));var _0x6d65=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd656[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x6d65('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x6d65('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6d65('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d65('0x3'),'afterDestroy':_0x6d65('0x4')};function emitEvent(_0x140456){return function(_0x513d7d,_0x160315,_0x3ce961){VoicePrefixEvents[_0x6d65('0x5')](_0x140456+':'+_0x513d7d['id'],_0x513d7d);VoicePrefixEvents[_0x6d65('0x5')](_0x140456,_0x513d7d);_0x3ce961(null);};}for(var e in events){if(events[_0x6d65('0x6')](e)){var event=events[e];VoicePrefix[_0x6d65('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index c87cc5d..9a04384 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 _0x0d4e=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash'];(function(_0x46f19e,_0x120b55){var _0x402a56=function(_0x531441){while(--_0x531441){_0x46f19e['push'](_0x46f19e['shift']());}};_0x402a56(++_0x120b55);}(_0x0d4e,0x113));var _0xe0d4=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x0d4e[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var logger=require(_0xe0d4('0x2'))('api');var moment=require(_0xe0d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0d4('0x4'));var fs=require('fs');var path=require(_0xe0d4('0x5'));var rimraf=require(_0xe0d4('0x6'));var config=require(_0xe0d4('0x7'));var attributes=require(_0xe0d4('0x8'));module[_0xe0d4('0x9')]=function(_0x503b86,_0x2674ac){return _0x503b86[_0xe0d4('0xa')](_0xe0d4('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f68=['api','moment','bluebird','request-promise','path','../../config/environment','define','voice_prefixes','lodash','util','../../config/logger'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7f68,0xce));var _0x87f6=function(_0xf95114,_0x3a96dc){_0xf95114=_0xf95114-0x0;var _0x1d135c=_0x7f68[_0xf95114];return _0x1d135c;};'use strict';var _=require(_0x87f6('0x0'));var util=require(_0x87f6('0x1'));var logger=require(_0x87f6('0x2'))(_0x87f6('0x3'));var moment=require(_0x87f6('0x4'));var BPromise=require(_0x87f6('0x5'));var rp=require(_0x87f6('0x6'));var fs=require('fs');var path=require(_0x87f6('0x7'));var rimraf=require('rimraf');var config=require(_0x87f6('0x8'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x1f4b85,_0x3fa2a1){return _0x1f4b85[_0x87f6('0x9')]('VoicePrefix',attributes,{'tableName':_0x87f6('0xa'),'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 7a2a2bc..6c2a51f 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 _0x7b77=['localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x7b77,0x179));var _0x77b7=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0x7b77[_0x4aa4e6];return _0x322588;};'use strict';var _=require(_0x77b7('0x0'));var util=require(_0x77b7('0x1'));var moment=require(_0x77b7('0x2'));var BPromise=require(_0x77b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77b7('0x4'));var db=require(_0x77b7('0x5'))['db'];var utils=require(_0x77b7('0x6'));var logger=require('../../config/logger')(_0x77b7('0x7'));var config=require(_0x77b7('0x8'));var jayson=require(_0x77b7('0x9'));var client=jayson[_0x77b7('0xa')][_0x77b7('0xb')]({'port':0x232a});config[_0x77b7('0xc')]=_['defaults'](config[_0x77b7('0xc')],{'host':_0x77b7('0xd'),'port':0x18eb});var socket=require(_0x77b7('0xe'))(new Redis(config['redis']));require(_0x77b7('0xf'))['register'](socket);function respondWithRpcPromise(_0x4a628c,_0x5aaacf,_0x2d820d){return new BPromise(function(_0x2bf69a,_0x5e7f6a){return client[_0x77b7('0x10')](_0x4a628c,_0x2d820d)[_0x77b7('0x11')](function(_0xde9906){logger[_0x77b7('0x12')](_0x77b7('0x13'),_0x5aaacf,_0x77b7('0x14'));logger[_0x77b7('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5aaacf,_0x77b7('0x14'),JSON[_0x77b7('0x16')](_0xde9906));if(_0xde9906['error']){if(_0xde9906['error']['code']===0x1f4){logger[_0x77b7('0x17')](_0x77b7('0x13'),_0x5aaacf,_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);return _0x5e7f6a(_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);}logger['error'](_0x77b7('0x13'),_0x5aaacf,_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);return _0x2bf69a(_0xde9906[_0x77b7('0x17')][_0x77b7('0x18')]);}else{logger[_0x77b7('0x12')](_0x77b7('0x13'),_0x5aaacf,_0x77b7('0x14'));_0x2bf69a(_0xde9906[_0x77b7('0x19')]['message']);}})['catch'](function(_0x5f391d){logger[_0x77b7('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x5aaacf,_0x5f391d);_0x5e7f6a(_0x5f391d);});});} \ No newline at end of file +var _0xa899=['error','message','VoicePrefix,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voicePrefix.socket','request','then','info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','code'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xa899,0x155));var _0x9a89=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0xa899[_0x2e53e1];return _0x3a23de;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var moment=require(_0x9a89('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a89('0x3'));var fs=require('fs');var Redis=require(_0x9a89('0x4'));var db=require(_0x9a89('0x5'))['db'];var utils=require(_0x9a89('0x6'));var logger=require(_0x9a89('0x7'))(_0x9a89('0x8'));var config=require(_0x9a89('0x9'));var jayson=require(_0x9a89('0xa'));var client=jayson[_0x9a89('0xb')][_0x9a89('0xc')]({'port':0x232a});config[_0x9a89('0xd')]=_[_0x9a89('0xe')](config[_0x9a89('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a89('0xd')]));require(_0x9a89('0xf'))['register'](socket);function respondWithRpcPromise(_0xccf078,_0x4f487d,_0x111d99){return new BPromise(function(_0x2a9e30,_0x401680){return client[_0x9a89('0x10')](_0xccf078,_0x111d99)[_0x9a89('0x11')](function(_0xc61526){logger[_0x9a89('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x4f487d,'request\x20sent');logger[_0x9a89('0x13')](_0x9a89('0x14'),_0x4f487d,_0x9a89('0x15'),JSON['stringify'](_0xc61526));if(_0xc61526['error']){if(_0xc61526['error'][_0x9a89('0x16')]===0x1f4){logger[_0x9a89('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x4f487d,_0xc61526[_0x9a89('0x17')][_0x9a89('0x18')]);return _0x401680(_0xc61526[_0x9a89('0x17')][_0x9a89('0x18')]);}logger['error'](_0x9a89('0x19'),_0x4f487d,_0xc61526[_0x9a89('0x17')]['message']);return _0x2a9e30(_0xc61526['error'][_0x9a89('0x18')]);}else{logger['info'](_0x9a89('0x19'),_0x4f487d,_0x9a89('0x15'));_0x2a9e30(_0xc61526['result'][_0x9a89('0x18')]);}})['catch'](function(_0x2d648f){logger[_0x9a89('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x4f487d,_0x2d648f);_0x401680(_0x2d648f);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2e1cb74..c77a2b0 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 _0x7229=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7229,0x76));var _0x9722=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7229[_0x501510];return _0x1e6ee5;};'use strict';var VoicePrefixEvents=require(_0x9722('0x0'));var events=[_0x9722('0x1'),_0x9722('0x2'),_0x9722('0x3')];function createListener(_0x18f480,_0x5eccad){return function(_0x5226eb){_0x5eccad[_0x9722('0x4')](_0x18f480,_0x5226eb);};}function removeListener(_0x255678,_0x43fcea){return function(){VoicePrefixEvents[_0x9722('0x5')](_0x255678,_0x43fcea);};}exports[_0x9722('0x6')]=function(_0x43e0ed){for(var _0x2689b3=0x0,_0x541b0c=events[_0x9722('0x7')];_0x2689b3<_0x541b0c;_0x2689b3++){var _0x5a5bd1=events[_0x2689b3];var _0x237c3e=createListener(_0x9722('0x8')+_0x5a5bd1,_0x43e0ed);VoicePrefixEvents['on'](_0x5a5bd1,_0x237c3e);}}; \ No newline at end of file +var _0x7834=['voicePrefix:','./voicePrefix.events','update','emit','removeListener','register'];(function(_0xa58076,_0x5a16a4){var _0x318015=function(_0x457df6){while(--_0x457df6){_0xa58076['push'](_0xa58076['shift']());}};_0x318015(++_0x5a16a4);}(_0x7834,0x13f));var _0x4783=function(_0x36fe63,_0x13af61){_0x36fe63=_0x36fe63-0x0;var _0x33841c=_0x7834[_0x36fe63];return _0x33841c;};'use strict';var VoicePrefixEvents=require(_0x4783('0x0'));var events=['save','remove',_0x4783('0x1')];function createListener(_0x51b60a,_0x15dbb4){return function(_0x30c3ee){_0x15dbb4[_0x4783('0x2')](_0x51b60a,_0x30c3ee);};}function removeListener(_0x2ebef6,_0x29566c){return function(){VoicePrefixEvents[_0x4783('0x3')](_0x2ebef6,_0x29566c);};}exports[_0x4783('0x4')]=function(_0x49114c){for(var _0x1cb674=0x0,_0xf8c030=events['length'];_0x1cb674<_0xf8c030;_0x1cb674++){var _0x2dcf46=events[_0x1cb674];var _0x16c83e=createListener(_0x4783('0x5')+_0x2dcf46,_0x49114c);VoicePrefixEvents['on'](_0x2dcf46,_0x16c83e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 29499ce..d8ba6ab 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fec1f,_0x563512){_0x3fec1f=_0x3fec1f-0x0;var _0x5cb79b=_0xb10b[_0x3fec1f];return _0x5cb79b;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x1b3c40,_0x48cc44){var _0x54a769=function(_0x13fbe5){while(--_0x13fbe5){_0x1b3c40['push'](_0x1b3c40['shift']());}};_0x54a769(++_0x48cc44);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('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 5b09bcb..bbd7f96 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 _0xa887=['Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','exports','STRING','name','inbound','outbound','default','ENUM','ringall','fewestcalls','random','rrmemory','rrordered','setDataValue','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','TEXT','periodic_announce','join','joinempty','leavewhenempty','split','acw','wrapuptime','BOOLEAN','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','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.'];(function(_0x5e9bec,_0x13062a){var _0x4db7c0=function(_0x3bde12){while(--_0x3bde12){_0x5e9bec['push'](_0x5e9bec['shift']());}};_0x4db7c0(++_0x13062a);}(_0xa887,0x187));var _0x7a88=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa887[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require('sequelize');module[_0x7a88('0x0')]={'name':{'type':Sequelize[_0x7a88('0x1')],'allowNull':![],'unique':_0x7a88('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x7a88('0x3'),_0x7a88('0x4')),'allowNull':![],'defaultValue':_0x7a88('0x3')},'musiconhold':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':_0x7a88('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x7a88('0x6')]('rr',_0x7a88('0x7'),'leastrecent',_0x7a88('0x8'),_0x7a88('0x9'),_0x7a88('0xa'),'linear','wrandom',_0x7a88('0xb')),'allowNull':![],'defaultValue':_0x7a88('0x7'),'set':function(_0x49e917){this[_0x7a88('0xc')]('strategy',_0x49e917?_0x49e917:_0x7a88('0xa'));},'get':function(){var _0x1dbf6a=this[_0x7a88('0xd')](_0x7a88('0xe'));var _0x27eb6b=this['getDataValue']('dialMethod');var _0x4761e6=this[_0x7a88('0xd')]('strategy');if(_0x1dbf6a===_0x7a88('0x3')){return _0x4761e6;}if(_0x27eb6b==='booked'&&_0x4761e6===_0x7a88('0xa')||_0x27eb6b===_0x7a88('0xf')&&_0x4761e6===_0x7a88('0x10')){return _0x4761e6;}if(_0x27eb6b===_0x7a88('0x11')||_0x27eb6b===_0x7a88('0x12')||_0x27eb6b===_0x7a88('0x13')){return _0x4761e6;}return null;}},'servicelevel':{'type':Sequelize[_0x7a88('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x7a88('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x7a88('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x7a88('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x7a88('0x6')]('yes','no'),'defaultValue':_0x7a88('0x15')},'autopause':{'type':Sequelize['ENUM'](_0x7a88('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x7a88('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x7a88('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x7a88('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x7a88('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x7a88('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7a88('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x7a88('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x7a88('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x7a88('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x7a88('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x7a88('0x1')]},'queue_quantity1':{'type':Sequelize[_0x7a88('0x1')]},'queue_quantity2':{'type':Sequelize[_0x7a88('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x7a88('0x1')]},'queue_less_than':{'type':Sequelize[_0x7a88('0x1')]},'periodic_announce':{'type':Sequelize[_0x7a88('0x16')],'set':function(_0x5a9c00){this[_0x7a88('0xc')](_0x7a88('0x17'),_0x5a9c00?_0x5a9c00[_0x7a88('0x18')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x7a88('0xd')](_0x7a88('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x7a88('0x15'),'set':function(_0x5d473a){this[_0x7a88('0xc')](_0x7a88('0x19'),_0x5d473a?_0x5d473a['join'](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x7a88('0xd')](_0x7a88('0x19'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':'no','set':function(_0x2c0db9){this[_0x7a88('0xc')](_0x7a88('0x1a'),_0x2c0db9?_0x2c0db9[_0x7a88('0x18')](','):undefined);},'get':function(){return this[_0x7a88('0xd')](_0x7a88('0x1a'))?this['getDataValue'](_0x7a88('0x1a'))[_0x7a88('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x7a88('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x7a88('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3f0a3d){this[_0x7a88('0xc')](_0x7a88('0x1c'),_0x3f0a3d);if(_0x3f0a3d){if(this['getDataValue'](_0x7a88('0x1d'))<0x2){this[_0x7a88('0xc')](_0x7a88('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x7a88('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7a88('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x1f'),_0x7a88('0x11'),'power',_0x7a88('0x12'),_0x7a88('0xf')),'defaultValue':'progressive','comment':_0x7a88('0x20')},'dialLimitChannel':{'type':Sequelize[_0x7a88('0x14')](0x4)[_0x7a88('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7a88('0x22')},'dialLimitQueue':{'type':Sequelize[_0x7a88('0x14')](0x4)[_0x7a88('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7a88('0x23')},'dialPowerLevel':{'type':Sequelize[_0x7a88('0x24')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x7a88('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x26'),_0x7a88('0x27')),'defaultValue':_0x7a88('0x27'),'comment':_0x7a88('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x7a88('0x24')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x7a88('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x7a88('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7a88('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7a88('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x7a88('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a88('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x7a88('0x2b'),'comment':_0x7a88('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x7a88('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a88('0x2d')},'dialQueueProject':{'type':Sequelize[_0x7a88('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7a88('0x14')](0x5)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a88('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a88('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7a88('0x14')](0x5)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a88('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7a88('0x14')](0x5)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7a88('0x31')},'dialTimezone':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7a88('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x32'),_0x7a88('0x33'),_0x7a88('0x34')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7a88('0x1e')],'defaultValue':0x0,'comment':_0x7a88('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x7a88('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7a88('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x7a88('0x14')](0x9)[_0x7a88('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7a88('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7a88('0x14')](0x9)[_0x7a88('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7a88('0x14')](0x9)[_0x7a88('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7a88('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7a88('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7a88('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7a88('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7a88('0x39')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7a88('0x14')](0x5)[_0x7a88('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7a88('0x3a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7a88('0x14')](0x9)[_0x7a88('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x7a88('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x7a88('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0x7a88('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x7a88('0x6')](_0x7a88('0x3c'),_0x7a88('0x3d')),'defaultValue':_0x7a88('0x3c')},'dialQueueProject2':{'type':Sequelize[_0x7a88('0x1')],'comment':_0x7a88('0x3e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x7a88('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7a88('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a88('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7a88('0x14')](0x5)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a88('0x40')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a88('0x41')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7a88('0x14')](0x5)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a88('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a88('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7a88('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7a88('0x44')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7a88('0x14')](0x5)[_0x7a88('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7a88('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7a88('0x14')],'allowNull':!![],'comment':_0x7a88('0x46')},'mandatoryDisposition':{'type':Sequelize[_0x7a88('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4a93f5){if(!_0x4a93f5)this[_0x7a88('0xc')](_0x7a88('0x47'),null);this['setDataValue']('mandatoryDisposition',_0x4a93f5);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x7a88('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x7a88('0x14')](0x3)[_0x7a88('0x21')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x7a88('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0x5ec9=['ringall','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\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)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','ENUM','inbound','outbound','STRING','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered'];(function(_0x5bd9d0,_0x358a63){var _0x4a1649=function(_0x5e4bac){while(--_0x5e4bac){_0x5bd9d0['push'](_0x5bd9d0['shift']());}};_0x4a1649(++_0x358a63);}(_0x5ec9,0x126));var _0x95ec=function(_0x753c33,_0x592175){_0x753c33=_0x753c33-0x0;var _0xb25268=_0x5ec9[_0x753c33];return _0xb25268;};'use strict';var Sequelize=require('sequelize');module[_0x95ec('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x95ec('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x3'),_0x95ec('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':_0x95ec('0x6')},'announce':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x95ec('0x7'),_0x95ec('0x8'),_0x95ec('0x9'),_0x95ec('0xa'),_0x95ec('0xb'),_0x95ec('0xc'),_0x95ec('0xd')),'allowNull':![],'defaultValue':_0x95ec('0xe'),'set':function(_0x4eda9c){this[_0x95ec('0xf')](_0x95ec('0x10'),_0x4eda9c?_0x4eda9c:_0x95ec('0xa'));},'get':function(){var _0x3ae772=this[_0x95ec('0x11')](_0x95ec('0x12'));var _0x189f08=this[_0x95ec('0x11')](_0x95ec('0x13'));var _0x1b1c2e=this[_0x95ec('0x11')](_0x95ec('0x10'));if(_0x3ae772===_0x95ec('0x3')){return _0x1b1c2e;}if(_0x189f08===_0x95ec('0x14')&&_0x1b1c2e===_0x95ec('0xa')||_0x189f08===_0x95ec('0x14')&&_0x1b1c2e===_0x95ec('0x15')){return _0x1b1c2e;}if(_0x189f08==='progressive'||_0x189f08==='predictive'||_0x189f08==='power'){return _0x1b1c2e;}return null;}},'servicelevel':{'type':Sequelize[_0x95ec('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x95ec('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x95ec('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x95ec('0x5')]},'weight':{'type':Sequelize[_0x95ec('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x95ec('0x2')]('yes','no'),'defaultValue':_0x95ec('0x17')},'autopause':{'type':Sequelize['ENUM']('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x95ec('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x95ec('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x95ec('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x95ec('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x95ec('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x95ec('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defaultValue':_0x95ec('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x95ec('0x17'),'no',_0x95ec('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x95ec('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x95ec('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x95ec('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x95ec('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x95ec('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x95ec('0x5')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x95ec('0x5')]},'queue_less_than':{'type':Sequelize[_0x95ec('0x5')]},'periodic_announce':{'type':Sequelize[_0x95ec('0x19')],'set':function(_0x1b42cd){this[_0x95ec('0xf')](_0x95ec('0x1a'),_0x1b42cd?_0x1b42cd[_0x95ec('0x1b')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x95ec('0x11')](_0x95ec('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':_0x95ec('0x17'),'set':function(_0x267751){this['setDataValue'](_0x95ec('0x1c'),_0x267751?_0x267751[_0x95ec('0x1b')](','):undefined);},'get':function(){return this[_0x95ec('0x11')](_0x95ec('0x1c'))?this[_0x95ec('0x11')](_0x95ec('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':'no','set':function(_0x1ba0e6){this[_0x95ec('0xf')](_0x95ec('0x1d'),_0x1ba0e6?_0x1ba0e6[_0x95ec('0x1b')](','):undefined);},'get':function(){return this[_0x95ec('0x11')]('leavewhenempty')?this[_0x95ec('0x11')](_0x95ec('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x95ec('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x95ec('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x95ec('0x5')]},'description':{'type':Sequelize[_0x95ec('0x5')]},'acw':{'type':Sequelize[_0x95ec('0x1e')],'defaultValue':0x0,'set':function(_0x5eca15){this['setDataValue']('acw',_0x5eca15);if(_0x5eca15){if(this['getDataValue'](_0x95ec('0x1f'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x95ec('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x20'),_0x95ec('0x21'),_0x95ec('0x22'),'predictive',_0x95ec('0x14')),'defaultValue':'progressive','comment':_0x95ec('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x95ec('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x95ec('0x16')](0x4)[_0x95ec('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x95ec('0x25')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x95ec('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x26'),'dropRate'),'defaultValue':_0x95ec('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x95ec('0x28')](0x2)[_0x95ec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x95ec('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x95ec('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x95ec('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x95ec('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x95ec('0x2a'),'comment':_0x95ec('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95ec('0x2c')},'dialQueueProject':{'type':Sequelize[_0x95ec('0x5')],'comment':_0x95ec('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0x95ec('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95ec('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95ec('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x95ec('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x95ec('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95ec('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x95ec('0x32')},'dialTimezone':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':_0x95ec('0x33')},'dialPrefix':{'type':Sequelize[_0x95ec('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x95ec('0x2')](_0x95ec('0x34'),_0x95ec('0x35'),_0x95ec('0x36')),'defaultValue':_0x95ec('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x95ec('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x95ec('0x16')](0x9)[_0x95ec('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x95ec('0x38')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x95ec('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x95ec('0x16')](0x9)[_0x95ec('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x95ec('0x39')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x95ec('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x95ec('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x95ec('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x95ec('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x95ec('0x16')](0x9)[_0x95ec('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x95ec('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x95ec('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x95ec('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x95ec('0x16')](0x9)[_0x95ec('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x95ec('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x95ec('0x1e')],'defaultValue':0x0,'comment':_0x95ec('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x95ec('0x2')]('DESC',_0x95ec('0x40')),'defaultValue':_0x95ec('0x41')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x95ec('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x95ec('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x95ec('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x95ec('0x42')},'dialCutDigit':{'type':Sequelize[_0x95ec('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x95ec('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95ec('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95ec('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95ec('0x46')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x95ec('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x95ec('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x95ec('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x95ec('0x16')](0x5)[_0x95ec('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x95ec('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x95ec('0x16')],'allowNull':!![],'comment':_0x95ec('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x95ec('0x4a'),'set':function(_0x57a410){if(!_0x57a410)this[_0x95ec('0xf')](_0x95ec('0x4b'),null);this['setDataValue'](_0x95ec('0x4c'),_0x57a410);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x95ec('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x95ec('0x16')](0x3)[_0x95ec('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x95ec('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index cbf14d8..9cce355 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 _0xc7b3=['userVoiceQueue:save','removeTeams','ids','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','QueryTypes','every','TeamId','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','push','getAgents','getMembers','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','scheduledAt','ListId','phone','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','addBlackLists','cm_hopper_black','NOW()','all','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','map','value','includes','type','find','name','UserProfileResource','destroy','stack','send','index','VoiceQueue','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','create','body','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','include','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','flatMap','forEach','sequelize','transaction','each','TeamVoiceQueue','penalty','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','SIP/%s','interface','voicePause'];(function(_0x35a734,_0x23341b){var _0x25f01f=function(_0x3a6125){while(--_0x3a6125){_0x35a734['push'](_0x35a734['shift']());}};_0x25f01f(++_0x23341b);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc7b3[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x3c7b('0x0'));var rimraf=require(_0x3c7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c7b('0x2'));var rp=require(_0x3c7b('0x3'));var moment=require(_0x3c7b('0x4'));var BPromise=require(_0x3c7b('0x5'));var Mustache=require(_0x3c7b('0x6'));var util=require(_0x3c7b('0x7'));var path=require('path');var sox=require(_0x3c7b('0x8'));var csv=require(_0x3c7b('0x9'));var ejs=require(_0x3c7b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c7b('0xb'));var squel=require(_0x3c7b('0xc'));var crypto=require('crypto');var jsforce=require(_0x3c7b('0xd'));var deskjs=require(_0x3c7b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3c7b('0xf'));var Papa=require(_0x3c7b('0x10'));var Redis=require(_0x3c7b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3c7b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7b('0x13'));var logger=require(_0x3c7b('0x14'))('api');var utils=require(_0x3c7b('0x15'));var config=require(_0x3c7b('0x16'));var licenseUtil=require(_0x3c7b('0x17'));var db=require(_0x3c7b('0x18'))['db'];config[_0x3c7b('0x19')]=_[_0x3c7b('0x1a')](config['redis'],{'host':_0x3c7b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c7b('0x19')]));require(_0x3c7b('0x1c'))[_0x3c7b('0x1d')](socket);function respondWithStatusCode(_0x31630d,_0x1b5490){_0x1b5490=_0x1b5490||0xcc;return function(_0x38d64){if(_0x38d64){return _0x31630d[_0x3c7b('0x1e')](_0x1b5490);}return _0x31630d[_0x3c7b('0x1f')](_0x1b5490)[_0x3c7b('0x20')]();};}function respondWithResult(_0x38a02c,_0x1df4a7){_0x1df4a7=_0x1df4a7||0xc8;return function(_0x220f9d){if(_0x220f9d){return _0x38a02c['status'](_0x1df4a7)[_0x3c7b('0x21')](_0x220f9d);}};}function respondWithFilteredResult(_0x287d05,_0x318767){return function(_0x457c09){if(_0x457c09){var _0x25b465=typeof _0x318767[_0x3c7b('0x22')]===_0x3c7b('0x23')&&typeof _0x318767[_0x3c7b('0x24')]===_0x3c7b('0x23');var _0x23d01c=_0x457c09[_0x3c7b('0x25')];var _0x357c5e=_0x25b465?0x0:_0x318767[_0x3c7b('0x22')];var _0x29fdc1=_0x25b465?_0x457c09[_0x3c7b('0x25')]:_0x318767[_0x3c7b('0x22')]+_0x318767[_0x3c7b('0x24')];var _0xd05d3;if(_0x29fdc1>=_0x23d01c){_0x29fdc1=_0x23d01c;_0xd05d3=0xc8;}else{_0xd05d3=0xce;}_0x287d05['status'](_0xd05d3);return _0x287d05[_0x3c7b('0x26')](_0x3c7b('0x27'),_0x357c5e+'-'+_0x29fdc1+'/'+_0x23d01c)[_0x3c7b('0x21')](_0x457c09);}return null;};}function patchUpdates(_0x2a390e){return function(_0x4181b8){try{jsonpatch[_0x3c7b('0x28')](_0x4181b8,_0x2a390e,!![]);}catch(_0x2bcd73){return BPromise[_0x3c7b('0x29')](_0x2bcd73);}return _0x4181b8[_0x3c7b('0x2a')]();};}function saveUpdates(_0x29acf5,_0x1de2ae){return function(_0x231ed5){if(_0x231ed5){return _0x231ed5[_0x3c7b('0x2b')](_0x29acf5)[_0x3c7b('0x2c')](function(_0x47f23c){return _0x47f23c;});}return null;};}function removeEntity(_0x5866d2,_0x416f8d){return function(_0x3740da){if(_0x3740da){return _0x3740da['destroy']()[_0x3c7b('0x2c')](function(){var _0x181097=_0x3740da[_0x3c7b('0x2d')]({'plain':!![]});var _0xed56ee=[{'name':_0x3c7b('0x2e'),'value':_0x3c7b('0x2f'),'ignore':![]},{'name':_0x3c7b('0x30'),'value':_0x3c7b('0x31'),'ignore':![]}];var _0x3c0dcf=_(_0xed56ee)['filter']('ignore')[_0x3c7b('0x32')](_0x3c7b('0x33'))[_0x3c7b('0x33')]();if(_[_0x3c7b('0x34')](_0x3c0dcf,_0x181097[_0x3c7b('0x35')])){return;}var _0x4124b9=_[_0x3c7b('0x36')](_0xed56ee,[_0x3c7b('0x33'),_0x181097['type']])[_0x3c7b('0x37')];return db[_0x3c7b('0x38')][_0x3c7b('0x39')]({'where':{'type':_0x4124b9,'resourceId':_0x181097['id']}})['then'](function(){return _0x3740da;});})[_0x3c7b('0x2c')](function(){_0x5866d2[_0x3c7b('0x1f')](0xcc)[_0x3c7b('0x20')]();});}};}function handleEntityNotFound(_0x5e586e,_0x261234){return function(_0x2b0955){if(!_0x2b0955){_0x5e586e[_0x3c7b('0x1e')](0x194);}return _0x2b0955;};}function handleError(_0x5041a8,_0x12ef0c){_0x12ef0c=_0x12ef0c||0x1f4;return function(_0x10fc5b){logger['error'](_0x10fc5b[_0x3c7b('0x3a')]);if(_0x10fc5b[_0x3c7b('0x37')]){delete _0x10fc5b[_0x3c7b('0x37')];}_0x5041a8['status'](_0x12ef0c)[_0x3c7b('0x3b')](_0x10fc5b);};}exports[_0x3c7b('0x3c')]=function(_0x4e252f,_0x5bf91b){var _0x305f32={},_0x1a35b5={},_0x57c4cc={'count':0x0,'rows':[]};var _0x1126c7=_[_0x3c7b('0x32')](db[_0x3c7b('0x3d')]['rawAttributes'],function(_0x423a9d){return{'name':_0x423a9d[_0x3c7b('0x3e')],'type':_0x423a9d[_0x3c7b('0x35')][_0x3c7b('0x3f')]};});_0x1a35b5[_0x3c7b('0x40')]=_[_0x3c7b('0x32')](_0x1126c7,_0x3c7b('0x37'));_0x1a35b5[_0x3c7b('0x41')]=_[_0x3c7b('0x42')](_0x4e252f[_0x3c7b('0x41')]);_0x1a35b5[_0x3c7b('0x43')]=_['intersection'](_0x1a35b5[_0x3c7b('0x40')],_0x1a35b5[_0x3c7b('0x41')]);_0x305f32[_0x3c7b('0x44')]=_[_0x3c7b('0x45')](_0x1a35b5['model'],qs['fields'](_0x4e252f[_0x3c7b('0x41')][_0x3c7b('0x46')]));_0x305f32[_0x3c7b('0x44')]=_0x305f32[_0x3c7b('0x44')][_0x3c7b('0x47')]?_0x305f32[_0x3c7b('0x44')]:_0x1a35b5[_0x3c7b('0x40')];if(!_0x4e252f[_0x3c7b('0x41')][_0x3c7b('0x48')](_0x3c7b('0x49'))){_0x305f32[_0x3c7b('0x24')]=qs['limit'](_0x4e252f[_0x3c7b('0x41')][_0x3c7b('0x24')]);_0x305f32[_0x3c7b('0x22')]=qs['offset'](_0x4e252f[_0x3c7b('0x41')][_0x3c7b('0x22')]);}_0x305f32[_0x3c7b('0x4a')]=qs[_0x3c7b('0x4b')](_0x4e252f['query'][_0x3c7b('0x4b')]);_0x305f32[_0x3c7b('0x4c')]=qs[_0x3c7b('0x43')](_[_0x3c7b('0x4d')](_0x4e252f[_0x3c7b('0x41')],_0x1a35b5[_0x3c7b('0x43')]),_0x1126c7);if(_0x4e252f['query'][_0x3c7b('0x4e')]){_0x305f32[_0x3c7b('0x4c')]=_[_0x3c7b('0x4f')](_0x305f32[_0x3c7b('0x4c')],{'$or':_['map'](_0x1126c7,function(_0x4a9e7b){if(_0x4a9e7b[_0x3c7b('0x35')]!==_0x3c7b('0x50')){var _0x8cdd0c={};_0x8cdd0c[_0x4a9e7b[_0x3c7b('0x37')]]={'$like':'%'+_0x4e252f[_0x3c7b('0x41')]['filter']+'%'};return _0x8cdd0c;}})});}_0x305f32=_[_0x3c7b('0x4f')]({},_0x305f32,_0x4e252f[_0x3c7b('0x51')]);var _0x51bd9d={'where':_0x305f32['where']};return db[_0x3c7b('0x3d')][_0x3c7b('0x25')](_0x51bd9d)[_0x3c7b('0x2c')](function(_0x186272){_0x57c4cc[_0x3c7b('0x25')]=_0x186272;if(_0x4e252f['query'][_0x3c7b('0x52')]){_0x305f32['include']=[{'all':!![]}];}return db[_0x3c7b('0x3d')][_0x3c7b('0x53')](_0x305f32);})[_0x3c7b('0x2c')](function(_0x5193f3){_0x57c4cc[_0x3c7b('0x54')]=_0x5193f3;return _0x57c4cc;})['then'](respondWithFilteredResult(_0x5bf91b,_0x305f32))['catch'](handleError(_0x5bf91b,null));};exports[_0x3c7b('0x55')]=function(_0x23114a,_0x174800){var _0x3896e2={'raw':![],'where':{'id':_0x23114a[_0x3c7b('0x56')]['id']}},_0x4ab553={};_0x4ab553[_0x3c7b('0x40')]=_['keys'](db['VoiceQueue'][_0x3c7b('0x57')]);_0x4ab553['query']=_['keys'](_0x23114a[_0x3c7b('0x41')]);_0x4ab553[_0x3c7b('0x43')]=_['intersection'](_0x4ab553[_0x3c7b('0x40')],_0x4ab553['query']);_0x3896e2[_0x3c7b('0x44')]=_[_0x3c7b('0x45')](_0x4ab553[_0x3c7b('0x40')],qs[_0x3c7b('0x46')](_0x23114a[_0x3c7b('0x41')]['fields']));_0x3896e2[_0x3c7b('0x44')]=_0x3896e2[_0x3c7b('0x44')][_0x3c7b('0x47')]?_0x3896e2[_0x3c7b('0x44')]:_0x4ab553['model'];if(_0x23114a[_0x3c7b('0x41')][_0x3c7b('0x52')]){_0x3896e2['include']=[{'all':!![]}];}_0x3896e2=_[_0x3c7b('0x4f')]({},_0x3896e2,_0x23114a[_0x3c7b('0x51')]);return db[_0x3c7b('0x3d')][_0x3c7b('0x36')](_0x3896e2)['then'](handleEntityNotFound(_0x174800,null))[_0x3c7b('0x2c')](respondWithResult(_0x174800,null))['catch'](handleError(_0x174800,null));};exports[_0x3c7b('0x58')]=function(_0x3eaf56,_0x307833){return db['VoiceQueue'][_0x3c7b('0x58')](_0x3eaf56[_0x3c7b('0x59')],{})[_0x3c7b('0x2c')](function(_0x464341){var _0x29d082=_0x3eaf56[_0x3c7b('0x5a')]['get']({'plain':!![]});if(!_0x29d082)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29d082[_0x3c7b('0x5b')]===_0x3c7b('0x5a')){var _0x22e913=_0x464341['get']({'plain':!![]});var _0x13aaaf=[{'name':_0x3c7b('0x2e'),'value':_0x3c7b('0x2f')},{'name':'QueueCampaigns','value':_0x3c7b('0x31')}];var _0x434d59=_[_0x3c7b('0x36')](_0x13aaaf,['value',_0x22e913['type']])[_0x3c7b('0x37')];return db['UserProfileSection'][_0x3c7b('0x36')]({'where':{'name':_0x434d59,'userProfileId':_0x29d082[_0x3c7b('0x5c')]},'raw':!![]})[_0x3c7b('0x2c')](function(_0x1f210b){if(_0x1f210b&&_0x1f210b[_0x3c7b('0x5d')]===0x0){return db['UserProfileResource'][_0x3c7b('0x58')]({'name':_0x22e913[_0x3c7b('0x37')],'resourceId':_0x22e913['id'],'type':_0x1f210b[_0x3c7b('0x37')],'sectionId':_0x1f210b['id']},{})[_0x3c7b('0x2c')](function(){return _0x464341;});}else{return _0x464341;}})['catch'](function(_0xa21ada){logger[_0x3c7b('0x5e')](_0x3c7b('0x5f'),_0xa21ada);throw _0xa21ada;});}return _0x464341;})['then'](respondWithResult(_0x307833,0xc9))[_0x3c7b('0x60')](handleError(_0x307833,null));};exports[_0x3c7b('0x61')]=function(_0x2bb255,_0x42acf4){var _0x23ceba={'where':{'id':_0x2bb255[_0x3c7b('0x56')]['id']}},_0x16e1a5={};_0x16e1a5[_0x3c7b('0x40')]=_[_0x3c7b('0x42')](db[_0x3c7b('0x3d')][_0x3c7b('0x57')]);_0x23ceba['attributes']=_[_0x3c7b('0x45')](_0x16e1a5[_0x3c7b('0x40')],qs[_0x3c7b('0x46')](_0x2bb255[_0x3c7b('0x41')][_0x3c7b('0x46')]));_0x23ceba[_0x3c7b('0x44')]=_0x23ceba[_0x3c7b('0x44')][_0x3c7b('0x47')]?_0x23ceba[_0x3c7b('0x44')]:_0x16e1a5[_0x3c7b('0x40')];if(_0x2bb255[_0x3c7b('0x41')][_0x3c7b('0x52')]){_0x23ceba[_0x3c7b('0x62')]=[{'all':!![]}];}_0x23ceba=_[_0x3c7b('0x4f')]({},_0x23ceba,_0x2bb255[_0x3c7b('0x51')]);return db[_0x3c7b('0x3d')][_0x3c7b('0x36')](_0x23ceba)[_0x3c7b('0x2c')](handleEntityNotFound(_0x42acf4,null))[_0x3c7b('0x2c')](function(_0x16cd81){if(_0x16cd81){var _0x5a3fbe=_0x16cd81[_0x3c7b('0x2d')]({'plain':!![]});_0x5a3fbe=qs[_0x3c7b('0x63')](_0x5a3fbe,['id',_0x3c7b('0x64'),_0x3c7b('0x65')]);_0x2bb255['body']=_[_0x3c7b('0x63')](_0x2bb255[_0x3c7b('0x59')],['id',_0x3c7b('0x64'),_0x3c7b('0x65')]);return db['VoiceQueue'][_0x3c7b('0x58')](_[_0x3c7b('0x4f')](_0x5a3fbe,_0x2bb255[_0x3c7b('0x59')]),{'include':_0x2bb255['query'][_0x3c7b('0x52')]?[{'all':!![]}]:undefined})[_0x3c7b('0x2c')](function(_0x1ecd9d){var _0x2462d0=_0x2bb255['user'][_0x3c7b('0x2d')]({'plain':!![]});if(!_0x2462d0)throw new Error(_0x3c7b('0x66'));if(_0x2462d0[_0x3c7b('0x5b')]===_0x3c7b('0x5a')){var _0x58c8eb=_0x1ecd9d['get']({'plain':!![]});var _0x2ba98f=[{'name':_0x3c7b('0x2e'),'value':_0x3c7b('0x2f')},{'name':_0x3c7b('0x30'),'value':_0x3c7b('0x31')}];var _0x3345d9=_['find'](_0x2ba98f,[_0x3c7b('0x33'),_0x58c8eb['type']])[_0x3c7b('0x37')];return db[_0x3c7b('0x67')]['find']({'where':{'name':_0x3345d9,'userProfileId':_0x2462d0[_0x3c7b('0x5c')]},'raw':!![]})['then'](function(_0x22e87c){if(_0x22e87c&&_0x22e87c[_0x3c7b('0x5d')]===0x0){return db[_0x3c7b('0x38')]['create']({'name':_0x58c8eb[_0x3c7b('0x37')],'resourceId':_0x58c8eb['id'],'type':_0x22e87c['name'],'sectionId':_0x22e87c['id']},{})[_0x3c7b('0x2c')](function(){return _0x1ecd9d;});}else{return _0x1ecd9d;}})[_0x3c7b('0x60')](function(_0x76e496){logger[_0x3c7b('0x5e')](_0x3c7b('0x5f'),_0x76e496);throw _0x76e496;});}return _0x1ecd9d;});}})[_0x3c7b('0x2c')](respondWithResult(_0x42acf4,0xc9))['catch'](handleError(_0x42acf4,null));};exports[_0x3c7b('0x2b')]=function(_0x21767a,_0x5040e2){if(_0x21767a[_0x3c7b('0x59')]['id']){delete _0x21767a[_0x3c7b('0x59')]['id'];}return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x21767a[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x5040e2,null))[_0x3c7b('0x2c')](saveUpdates(_0x21767a[_0x3c7b('0x59')],null))[_0x3c7b('0x2c')](respondWithResult(_0x5040e2,null))[_0x3c7b('0x60')](handleError(_0x5040e2,null));};exports[_0x3c7b('0x39')]=function(_0x49e506,_0x1380ab){return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x49e506[_0x3c7b('0x56')]['id']}})['then'](handleEntityNotFound(_0x1380ab,null))[_0x3c7b('0x2c')](removeEntity(_0x1380ab,null))[_0x3c7b('0x60')](handleError(_0x1380ab,null));};exports[_0x3c7b('0x68')]=function(_0x109f02,_0x4b1688,_0x1af333){var _0xc51eb3={'raw':![],'where':{}};var _0x2f0261={};var _0x1c6fbc={'count':0x0,'rows':[]};return db[_0x3c7b('0x3d')][_0x3c7b('0x69')]({'where':{'id':_0x109f02[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x4b1688,null))[_0x3c7b('0x2c')](function(_0x577eda){if(_0x577eda){_0x2f0261[_0x3c7b('0x40')]=_[_0x3c7b('0x42')](db[_0x3c7b('0x6a')][_0x3c7b('0x57')]);_0x2f0261[_0x3c7b('0x41')]=_['keys'](_0x109f02['query']);_0x2f0261['filters']=_[_0x3c7b('0x45')](_0x2f0261['model'],_0x2f0261[_0x3c7b('0x41')]);_0xc51eb3['attributes']=_[_0x3c7b('0x45')](_0x2f0261['model'],qs[_0x3c7b('0x46')](_0x109f02[_0x3c7b('0x41')]['fields']));_0xc51eb3[_0x3c7b('0x44')]=_0xc51eb3['attributes'][_0x3c7b('0x47')]?_0xc51eb3[_0x3c7b('0x44')]:_0x2f0261[_0x3c7b('0x40')];if(!_0x109f02['query'][_0x3c7b('0x48')](_0x3c7b('0x49'))){_0xc51eb3[_0x3c7b('0x24')]=qs[_0x3c7b('0x24')](_0x109f02['query'][_0x3c7b('0x24')]);_0xc51eb3[_0x3c7b('0x22')]=qs[_0x3c7b('0x22')](_0x109f02[_0x3c7b('0x41')][_0x3c7b('0x22')]);}_0xc51eb3[_0x3c7b('0x4a')]=qs[_0x3c7b('0x4b')](_0x109f02[_0x3c7b('0x41')]['sort']);_0xc51eb3[_0x3c7b('0x4c')]=qs[_0x3c7b('0x43')](_[_0x3c7b('0x4d')](_0x109f02['query'],_0x2f0261[_0x3c7b('0x43')]));_0xc51eb3[_0x3c7b('0x4c')][_0x3c7b('0x6b')]=_0x577eda['id'];if(_0x109f02[_0x3c7b('0x41')][_0x3c7b('0x4e')]){_0xc51eb3[_0x3c7b('0x4c')]=_[_0x3c7b('0x4f')](_0xc51eb3['where'],{'$or':_['map'](_0xc51eb3[_0x3c7b('0x44')],function(_0x1dc39a){var _0x4584b4={};_0x4584b4[_0x1dc39a]={'$like':'%'+_0x109f02[_0x3c7b('0x41')][_0x3c7b('0x4e')]+'%'};return _0x4584b4;})});}_0xc51eb3=_[_0x3c7b('0x4f')]({},_0xc51eb3,_0x109f02[_0x3c7b('0x51')]);return db[_0x3c7b('0x6a')][_0x3c7b('0x25')]({'where':_0xc51eb3[_0x3c7b('0x4c')]})[_0x3c7b('0x2c')](function(_0x5ad1ae){_0x1c6fbc[_0x3c7b('0x25')]=_0x5ad1ae;if(_0x109f02['query'][_0x3c7b('0x52')]){_0xc51eb3[_0x3c7b('0x62')]=[{'all':!![]}];}return db[_0x3c7b('0x6a')][_0x3c7b('0x53')](_0xc51eb3);})[_0x3c7b('0x2c')](function(_0x5d06ff){_0x1c6fbc[_0x3c7b('0x54')]=_0x5d06ff;return _0x1c6fbc;});}})['then'](respondWithFilteredResult(_0x4b1688,_0xc51eb3))[_0x3c7b('0x60')](handleError(_0x4b1688,null));};exports['getHopperHistories']=function(_0x1399bc,_0x593783,_0x2fe5af){var _0x19b6a6={'raw':!![],'where':{}};var _0x2e68c2={};var _0x5200e0={'count':0x0,'rows':[]};return db[_0x3c7b('0x3d')][_0x3c7b('0x69')]({'where':{'id':_0x1399bc[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x593783,null))[_0x3c7b('0x2c')](function(_0x2e1be2){if(_0x2e1be2){_0x2e68c2[_0x3c7b('0x40')]=_['keys'](db[_0x3c7b('0x6c')][_0x3c7b('0x57')]);_0x2e68c2[_0x3c7b('0x41')]=_['keys'](_0x1399bc[_0x3c7b('0x41')]);_0x2e68c2[_0x3c7b('0x43')]=_[_0x3c7b('0x45')](_0x2e68c2[_0x3c7b('0x40')],_0x2e68c2[_0x3c7b('0x41')]);_0x19b6a6['attributes']=_[_0x3c7b('0x45')](_0x2e68c2[_0x3c7b('0x40')],qs['fields'](_0x1399bc['query'][_0x3c7b('0x46')]));_0x19b6a6[_0x3c7b('0x44')]=_0x19b6a6[_0x3c7b('0x44')][_0x3c7b('0x47')]?_0x19b6a6['attributes']:_0x2e68c2[_0x3c7b('0x40')];if(!_0x1399bc['query']['hasOwnProperty'](_0x3c7b('0x49'))){_0x19b6a6[_0x3c7b('0x24')]=qs[_0x3c7b('0x24')](_0x1399bc[_0x3c7b('0x41')][_0x3c7b('0x24')]);_0x19b6a6[_0x3c7b('0x22')]=qs[_0x3c7b('0x22')](_0x1399bc[_0x3c7b('0x41')]['offset']);}_0x19b6a6[_0x3c7b('0x4a')]=qs[_0x3c7b('0x4b')](_0x1399bc[_0x3c7b('0x41')]['sort']);_0x19b6a6['where']=qs['filters'](_[_0x3c7b('0x4d')](_0x1399bc[_0x3c7b('0x41')],_0x2e68c2['filters']));_0x19b6a6[_0x3c7b('0x4c')][_0x3c7b('0x6b')]=_0x2e1be2['id'];if(_0x1399bc['query']['filter']){_0x19b6a6[_0x3c7b('0x4c')]=_['merge'](_0x19b6a6[_0x3c7b('0x4c')],{'$or':_['map'](_0x19b6a6[_0x3c7b('0x44')],function(_0x71ea8){var _0x18c14a={};_0x18c14a[_0x71ea8]={'$like':'%'+_0x1399bc[_0x3c7b('0x41')][_0x3c7b('0x4e')]+'%'};return _0x18c14a;})});}_0x19b6a6=_['merge']({},_0x19b6a6,_0x1399bc[_0x3c7b('0x51')]);return db[_0x3c7b('0x6c')][_0x3c7b('0x25')]({'where':_0x19b6a6[_0x3c7b('0x4c')]})[_0x3c7b('0x2c')](function(_0x549a73){_0x5200e0[_0x3c7b('0x25')]=_0x549a73;if(_0x1399bc[_0x3c7b('0x41')][_0x3c7b('0x52')]){_0x19b6a6[_0x3c7b('0x62')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3c7b('0x53')](_0x19b6a6);})[_0x3c7b('0x2c')](function(_0x159a92){_0x5200e0[_0x3c7b('0x54')]=_0x159a92;return _0x5200e0;});}})[_0x3c7b('0x2c')](respondWithFilteredResult(_0x593783,_0x19b6a6))[_0x3c7b('0x60')](handleError(_0x593783,null));};exports[_0x3c7b('0x6d')]=function(_0x25e7b6,_0x57c21d,_0x2103cd){var _0x52b5f3={'raw':!![],'where':{}};var _0x3ff0da={};var _0x4827ca={'count':0x0,'rows':[]};return db[_0x3c7b('0x3d')]['findOne']({'where':{'id':_0x25e7b6[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x57c21d,null))['then'](function(_0x247932){if(_0x247932){_0x3ff0da[_0x3c7b('0x40')]=_[_0x3c7b('0x42')](db[_0x3c7b('0x6e')][_0x3c7b('0x57')]);_0x3ff0da[_0x3c7b('0x41')]=_[_0x3c7b('0x42')](_0x25e7b6[_0x3c7b('0x41')]);_0x3ff0da[_0x3c7b('0x43')]=_['intersection'](_0x3ff0da[_0x3c7b('0x40')],_0x3ff0da[_0x3c7b('0x41')]);_0x52b5f3[_0x3c7b('0x44')]=_[_0x3c7b('0x45')](_0x3ff0da[_0x3c7b('0x40')],qs['fields'](_0x25e7b6[_0x3c7b('0x41')]['fields']));_0x52b5f3[_0x3c7b('0x44')]=_0x52b5f3[_0x3c7b('0x44')][_0x3c7b('0x47')]?_0x52b5f3['attributes']:_0x3ff0da[_0x3c7b('0x40')];if(!_0x25e7b6['query'][_0x3c7b('0x48')](_0x3c7b('0x49'))){_0x52b5f3['limit']=qs[_0x3c7b('0x24')](_0x25e7b6['query'][_0x3c7b('0x24')]);_0x52b5f3[_0x3c7b('0x22')]=qs[_0x3c7b('0x22')](_0x25e7b6[_0x3c7b('0x41')]['offset']);}_0x52b5f3[_0x3c7b('0x4a')]=qs[_0x3c7b('0x4b')](_0x25e7b6[_0x3c7b('0x41')][_0x3c7b('0x4b')]);_0x52b5f3[_0x3c7b('0x4c')]=qs[_0x3c7b('0x43')](_['pick'](_0x25e7b6[_0x3c7b('0x41')],_0x3ff0da[_0x3c7b('0x43')]));_0x52b5f3[_0x3c7b('0x4c')]['VoiceQueueId']=_0x247932['id'];if(_0x25e7b6[_0x3c7b('0x41')][_0x3c7b('0x4e')]){_0x52b5f3[_0x3c7b('0x4c')]=_['merge'](_0x52b5f3['where'],{'$or':_[_0x3c7b('0x32')](_0x52b5f3[_0x3c7b('0x44')],function(_0x33bd0c){var _0x3320ad={};_0x3320ad[_0x33bd0c]={'$like':'%'+_0x25e7b6[_0x3c7b('0x41')][_0x3c7b('0x4e')]+'%'};return _0x3320ad;})});}_0x52b5f3=_['merge']({},_0x52b5f3,_0x25e7b6[_0x3c7b('0x51')]);return db[_0x3c7b('0x6e')][_0x3c7b('0x25')]({'where':_0x52b5f3[_0x3c7b('0x4c')]})['then'](function(_0x5ca55a){_0x4827ca['count']=_0x5ca55a;if(_0x25e7b6[_0x3c7b('0x41')][_0x3c7b('0x52')]){_0x52b5f3[_0x3c7b('0x62')]=[{'all':!![]}];}return db[_0x3c7b('0x6e')][_0x3c7b('0x53')](_0x52b5f3);})[_0x3c7b('0x2c')](function(_0x2ce223){_0x4827ca[_0x3c7b('0x54')]=_0x2ce223;return _0x4827ca;});}})[_0x3c7b('0x2c')](respondWithFilteredResult(_0x57c21d,_0x52b5f3))['catch'](handleError(_0x57c21d,null));};exports[_0x3c7b('0x6f')]=function(_0x4b8e5e,_0x394b81,_0x2670e4){var _0x1b829e={'raw':!![],'where':{}};var _0x3bf7b1={};var _0x1f3396={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x4b8e5e[_0x3c7b('0x56')]['id']}})['then'](handleEntityNotFound(_0x394b81,null))[_0x3c7b('0x2c')](function(_0x165987){if(_0x165987){_0x3bf7b1[_0x3c7b('0x40')]=_[_0x3c7b('0x42')](db[_0x3c7b('0x70')][_0x3c7b('0x57')]);_0x3bf7b1['query']=_['keys'](_0x4b8e5e['query']);_0x3bf7b1[_0x3c7b('0x43')]=_[_0x3c7b('0x45')](_0x3bf7b1[_0x3c7b('0x40')],_0x3bf7b1[_0x3c7b('0x41')]);_0x1b829e['attributes']=_[_0x3c7b('0x45')](_0x3bf7b1[_0x3c7b('0x40')],qs['fields'](_0x4b8e5e[_0x3c7b('0x41')][_0x3c7b('0x46')]));_0x1b829e[_0x3c7b('0x44')]=_0x1b829e[_0x3c7b('0x44')]['length']?_0x1b829e[_0x3c7b('0x44')]:_0x3bf7b1[_0x3c7b('0x40')];if(!_0x4b8e5e[_0x3c7b('0x41')][_0x3c7b('0x48')](_0x3c7b('0x49'))){_0x1b829e[_0x3c7b('0x24')]=qs[_0x3c7b('0x24')](_0x4b8e5e[_0x3c7b('0x41')][_0x3c7b('0x24')]);_0x1b829e['offset']=qs[_0x3c7b('0x22')](_0x4b8e5e[_0x3c7b('0x41')][_0x3c7b('0x22')]);}_0x1b829e['order']=qs[_0x3c7b('0x4b')](_0x4b8e5e[_0x3c7b('0x41')][_0x3c7b('0x4b')]);_0x1b829e[_0x3c7b('0x4c')]=qs['filters'](_[_0x3c7b('0x4d')](_0x4b8e5e[_0x3c7b('0x41')],_0x3bf7b1['filters']));_0x1b829e[_0x3c7b('0x4c')][_0x3c7b('0x6b')]=_0x165987['id'];if(_0x4b8e5e[_0x3c7b('0x41')]['filter']){_0x1b829e[_0x3c7b('0x4c')]=_[_0x3c7b('0x4f')](_0x1b829e[_0x3c7b('0x4c')],{'$or':_[_0x3c7b('0x32')](_0x1b829e[_0x3c7b('0x44')],function(_0x33bd7c){var _0x4a9c3f={};_0x4a9c3f[_0x33bd7c]={'$like':'%'+_0x4b8e5e[_0x3c7b('0x41')][_0x3c7b('0x4e')]+'%'};return _0x4a9c3f;})});}_0x1b829e=_[_0x3c7b('0x4f')]({},_0x1b829e,_0x4b8e5e[_0x3c7b('0x51')]);return db[_0x3c7b('0x70')][_0x3c7b('0x25')]({'where':_0x1b829e['where']})[_0x3c7b('0x2c')](function(_0x54648f){_0x1f3396['count']=_0x54648f;if(_0x4b8e5e[_0x3c7b('0x41')]['includeAll']){_0x1b829e[_0x3c7b('0x62')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3c7b('0x53')](_0x1b829e);})[_0x3c7b('0x2c')](function(_0x9d2cb){_0x1f3396[_0x3c7b('0x54')]=_0x9d2cb;return _0x1f3396;});}})[_0x3c7b('0x2c')](respondWithFilteredResult(_0x394b81,_0x1b829e))['catch'](handleError(_0x394b81,null));};exports[_0x3c7b('0x71')]=function(_0x30718d,_0x508f9a,_0x92bb2d){var _0x4421ec={};var _0x4f3e85={};var _0x588d92;var _0x5c22df;return db[_0x3c7b('0x3d')][_0x3c7b('0x69')]({'where':{'id':_0x30718d[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x508f9a,null))[_0x3c7b('0x2c')](function(_0x1b6912){if(_0x1b6912){_0x588d92=_0x1b6912;_0x4f3e85['model']=_[_0x3c7b('0x42')](db[_0x3c7b('0x72')][_0x3c7b('0x57')]);_0x4f3e85[_0x3c7b('0x41')]=_[_0x3c7b('0x42')](_0x30718d[_0x3c7b('0x41')]);_0x4f3e85[_0x3c7b('0x43')]=_['intersection'](_0x4f3e85[_0x3c7b('0x40')],_0x4f3e85[_0x3c7b('0x41')]);_0x4421ec['attributes']=_[_0x3c7b('0x45')](_0x4f3e85[_0x3c7b('0x40')],qs[_0x3c7b('0x46')](_0x30718d[_0x3c7b('0x41')]['fields']));_0x4421ec[_0x3c7b('0x44')]=_0x4421ec['attributes'][_0x3c7b('0x47')]?_0x4421ec['attributes']:_0x4f3e85[_0x3c7b('0x40')];_0x4421ec['order']=qs['sort'](_0x30718d['query'][_0x3c7b('0x4b')]);_0x4421ec['where']=qs[_0x3c7b('0x43')](_[_0x3c7b('0x4d')](_0x30718d[_0x3c7b('0x41')],_0x4f3e85[_0x3c7b('0x43')]));if(_0x30718d[_0x3c7b('0x41')][_0x3c7b('0x4e')]){_0x4421ec[_0x3c7b('0x4c')]=_[_0x3c7b('0x4f')](_0x4421ec['where'],{'$or':_[_0x3c7b('0x32')](_0x4421ec[_0x3c7b('0x44')],function(_0x5d0539){var _0x487e04={};_0x487e04[_0x5d0539]={'$like':'%'+_0x30718d[_0x3c7b('0x41')]['filter']+'%'};return _0x487e04;})});}_0x4421ec=_[_0x3c7b('0x4f')]({},_0x4421ec,_0x30718d[_0x3c7b('0x51')]);return _0x588d92[_0x3c7b('0x71')](_0x4421ec);}})[_0x3c7b('0x2c')](function(_0x262020){if(_0x262020){_0x5c22df=_0x262020[_0x3c7b('0x47')];if(!_0x30718d['query'][_0x3c7b('0x48')](_0x3c7b('0x49'))){_0x4421ec[_0x3c7b('0x24')]=qs[_0x3c7b('0x24')](_0x30718d[_0x3c7b('0x41')][_0x3c7b('0x24')]);_0x4421ec[_0x3c7b('0x22')]=qs['offset'](_0x30718d[_0x3c7b('0x41')][_0x3c7b('0x22')]);}return _0x588d92[_0x3c7b('0x71')](_0x4421ec);}})[_0x3c7b('0x2c')](function(_0x4e0f75){if(_0x4e0f75){return _0x4e0f75?{'count':_0x5c22df,'rows':_0x4e0f75}:null;}})['then'](respondWithResult(_0x508f9a,null))[_0x3c7b('0x60')](handleError(_0x508f9a,null));};exports[_0x3c7b('0x73')]=function(_0x10387f,_0x130751,_0x2309a7){var _0x152516=_0x10387f[_0x3c7b('0x59')][_0x3c7b('0x74')];var _0xa64610=_[_0x3c7b('0x32')](_0x152516,'id');return db['Team'][_0x3c7b('0x53')]({'where':{'id':_0xa64610},'attributes':['id'],'include':[{'model':db[_0x3c7b('0x75')],'as':_0x3c7b('0x76'),'attributes':['id',_0x3c7b('0x37'),_0x3c7b('0x77'),'voicePause','interface'],'raw':!![]}]})[_0x3c7b('0x2c')](function(_0x236ffe){if(_0x236ffe){var _0x1935b1=_[_0x3c7b('0x78')](_0x236ffe,function(_0x4c3e89){var _0x515b6e=_0x4c3e89[_0x3c7b('0x2d')]({'plain':!![]});_0x515b6e['Agents'][_0x3c7b('0x79')](function(_0x23ea50){_0x23ea50['penalty']=_[_0x3c7b('0x36')](_0x152516,{'id':_0x515b6e['id']})['penalty'];});return _0x515b6e[_0x3c7b('0x76')];});return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x10387f[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](function(_0x110d4b){return db[_0x3c7b('0x7a')][_0x3c7b('0x7b')](function(_0xf2771d){return _0x110d4b[_0x3c7b('0x73')](_0xa64610,{'transaction':_0xf2771d})['then'](function(){return BPromise[_0x3c7b('0x7c')](_0x152516,function(_0x3dfdda){return db[_0x3c7b('0x7d')]['upsert']({'TeamId':_0x3dfdda['id'],'VoiceQueueId':_0x10387f['params']['id'],'penalty':_0x3dfdda[_0x3c7b('0x7e')]},{'transaction':_0xf2771d});});})['then'](function(){return BPromise[_0x3c7b('0x7c')](_0x1935b1,function(_0x238c33){return db[_0x3c7b('0x7f')]['findOrCreate']({'where':{'UserId':_0x238c33['id'],'VoiceQueueId':_0x10387f[_0x3c7b('0x56')]['id']},'defaults':{'penalty':_0x238c33['penalty']},'transaction':_0xf2771d});});})[_0x3c7b('0x2c')](function(){return BPromise[_0x3c7b('0x7c')](_[_0x3c7b('0x4e')](_0x1935b1,{'online':!![]}),function(_0x2a0b5d){return db[_0x3c7b('0x80')][_0x3c7b('0x81')]({'membername':_0x2a0b5d[_0x3c7b('0x37')],'UserId':_0x2a0b5d['id'],'queue_name':_0x110d4b[_0x3c7b('0x37')],'VoiceQueueId':_0x110d4b['id'],'interface':_[_0x3c7b('0x82')](_0x2a0b5d['interface'])?util['format'](_0x3c7b('0x83'),_0x2a0b5d[_0x3c7b('0x37')]):_0x2a0b5d[_0x3c7b('0x84')],'paused':_0x2a0b5d[_0x3c7b('0x85')]||![],'penalty':_0x2a0b5d['penalty']},{'transaction':_0xf2771d});});})[_0x3c7b('0x2c')](function(){_0x1935b1[_0x3c7b('0x79')](function(_0x518a8c){socket['emit'](_0x3c7b('0x86'),{'UserId':_0x518a8c['id'],'VoiceQueueId':_0x110d4b['id']});});});});});}})['then'](respondWithStatusCode(_0x130751,null))[_0x3c7b('0x60')](handleError(_0x130751,null));};exports[_0x3c7b('0x87')]=function(_0x319a98,_0x59e9db,_0x3e9e70){return db[_0x3c7b('0x72')][_0x3c7b('0x53')]({'where':{'id':_0x319a98[_0x3c7b('0x41')][_0x3c7b('0x88')]},'attributes':['id'],'include':[{'model':db[_0x3c7b('0x75')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x59e9db,null))[_0x3c7b('0x2c')](function(_0x43964c){var _0x485f78=_[_0x3c7b('0x32')](_0x43964c,'id');var _0x1b55eb=[];var _0x31d542=[];var _0xaa624e=squel[_0x3c7b('0x89')]();_0xaa624e[_0x3c7b('0x8a')]('tq.TeamId')[_0x3c7b('0x8b')]('team_has_voice_queues','tq')['join'](_0x3c7b('0x8c'),'ut',_0x3c7b('0x8d'))[_0x3c7b('0x4c')](_0x3c7b('0x8e'),_0x319a98[_0x3c7b('0x56')]['id']);for(var _0x1d3476=0x0;_0x1d3476<_0x43964c[_0x3c7b('0x47')];_0x1d3476+=0x1){let _0x220126=_0x43964c[_0x1d3476];for(var _0x3bbd0a=0x0;_0x3bbd0a<_0x220126[_0x3c7b('0x76')][_0x3c7b('0x47')];_0x3bbd0a+=0x1){let _0x490eb8=_0x220126[_0x3c7b('0x76')][_0x3bbd0a];var _0xb992ba=_0xaa624e['clone']();_0xb992ba[_0x3c7b('0x4c')]('ut.UserId\x20=\x20?',_0x490eb8['id']);_0x31d542['push'](db[_0x3c7b('0x7a')][_0x3c7b('0x41')](_0xb992ba['toString'](),{'type':db[_0x3c7b('0x7a')][_0x3c7b('0x8f')]['SELECT']})['then'](function(_0x4249d8){if(_0x4249d8['length']===0x1){return _0x490eb8['id'];}else{var _0x1e0602=_[_0x3c7b('0x90')](_[_0x3c7b('0x32')](_0x4249d8,_0x3c7b('0x91')),function(_0x4fdf66){return _[_0x3c7b('0x34')](_0x485f78,_0x4fdf66);});if(_0x1e0602){return _0x490eb8['id'];}}}));}}return BPromise['all'](_0x31d542)[_0x3c7b('0x2c')](function(_0x45ac13){_0x1b55eb=_(_0x1b55eb)['union'](_0x45ac13)['compact']()[_0x3c7b('0x33')]();return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x319a98[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](function(_0x1a8ada){return db['sequelize'][_0x3c7b('0x7b')](function(_0x245138){return _0x1a8ada[_0x3c7b('0x87')](_0x319a98[_0x3c7b('0x41')][_0x3c7b('0x88')],{'transaction':_0x245138})[_0x3c7b('0x2c')](function(){if(!_[_0x3c7b('0x92')](_0x1b55eb)){return _0x1a8ada[_0x3c7b('0x93')](_0x1b55eb,{'transaction':_0x245138})[_0x3c7b('0x2c')](function(){return db[_0x3c7b('0x80')][_0x3c7b('0x39')]({'where':{'VoiceQueueId':_0x319a98[_0x3c7b('0x56')]['id'],'UserId':_0x1b55eb},'transaction':_0x245138});});}})[_0x3c7b('0x2c')](function(){_0x1b55eb[_0x3c7b('0x79')](function(_0x26b6f1){socket[_0x3c7b('0x94')](_0x3c7b('0x95'),{'UserId':_0x26b6f1,'VoiceQueueId':_0x1a8ada['id']});});});});});});})['then'](respondWithStatusCode(_0x59e9db,null))[_0x3c7b('0x60')](handleError(_0x59e9db,null));};exports[_0x3c7b('0x96')]=function(_0x1ac084,_0x14993c,_0x1531d7){var _0x575ad7,_0x3cb4a1;return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x1ac084[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x14993c,null))['then'](function(_0x361246){if(_0x361246){_0x3cb4a1=_0x361246;return _0x361246[_0x3c7b('0x96')](_0x1ac084[_0x3c7b('0x59')][_0x3c7b('0x88')],_['omit'](_0x1ac084[_0x3c7b('0x59')],[_0x3c7b('0x88'),'id'])||{})[_0x3c7b('0x97')](function(_0x4f6834){for(var _0x482ebc=0x0;_0x482ebc<_0x1ac084[_0x3c7b('0x59')]['ids'][_0x3c7b('0x47')];_0x482ebc+=0x1){socket[_0x3c7b('0x94')](_0x3c7b('0x86'),{'UserId':Number(_0x1ac084[_0x3c7b('0x59')][_0x3c7b('0x88')][_0x482ebc]),'VoiceQueueId':Number(_0x1ac084['params']['id'])});}return _0x4f6834;});}})[_0x3c7b('0x2c')](function(_0x4ae95d){_0x575ad7=_0x4ae95d||[];if(_0x3cb4a1){return db['User'][_0x3c7b('0x53')]({'where':{'id':_0x1ac084[_0x3c7b('0x59')][_0x3c7b('0x88')]},'attributes':['id','name','online',_0x3c7b('0x85'),_0x3c7b('0x84')],'raw':!![]});}})[_0x3c7b('0x2c')](function(_0x10259a){if(!_[_0x3c7b('0x92')](_0x10259a)){var _0x34f9d5=[];for(var _0x5b6559=0x0;_0x5b6559<_0x10259a[_0x3c7b('0x47')];_0x5b6559++){if(_0x10259a[_0x5b6559][_0x3c7b('0x77')]){_0x34f9d5[_0x3c7b('0x98')](db[_0x3c7b('0x80')][_0x3c7b('0x81')]({'membername':_0x10259a[_0x5b6559][_0x3c7b('0x37')],'UserId':_0x10259a[_0x5b6559]['id'],'queue_name':_0x3cb4a1[_0x3c7b('0x37')],'VoiceQueueId':_0x3cb4a1['id'],'interface':_['isNil'](_0x10259a[_0x5b6559][_0x3c7b('0x84')])?util['format'](_0x3c7b('0x83'),_0x10259a[_0x5b6559][_0x3c7b('0x37')]):_0x10259a[_0x5b6559][_0x3c7b('0x84')],'paused':_0x10259a[_0x5b6559][_0x3c7b('0x85')]||![],'penalty':_0x1ac084[_0x3c7b('0x59')][_0x3c7b('0x7e')]||0x0}));}}return BPromise['all'](_0x34f9d5);}})['then'](function(){return _0x575ad7;})[_0x3c7b('0x2c')](respondWithResult(_0x14993c,null))[_0x3c7b('0x60')](handleError(_0x14993c,null));};exports[_0x3c7b('0x93')]=function(_0x4a47d0,_0x179c68,_0x231286){return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x4a47d0['params']['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x179c68,null))[_0x3c7b('0x2c')](function(_0x399fff){if(_0x399fff){return _0x399fff['removeAgents'](_0x4a47d0[_0x3c7b('0x41')][_0x3c7b('0x88')])[_0x3c7b('0x2c')](function(){if(_['isArray'](_0x4a47d0[_0x3c7b('0x41')][_0x3c7b('0x88')])){for(var _0x2c51b7=0x0;_0x2c51b7<_0x4a47d0['query'][_0x3c7b('0x88')][_0x3c7b('0x47')];_0x2c51b7+=0x1){socket[_0x3c7b('0x94')](_0x3c7b('0x95'),{'UserId':Number(_0x4a47d0['query']['ids'][_0x2c51b7]),'VoiceQueueId':Number(_0x4a47d0['params']['id'])});}}else{socket[_0x3c7b('0x94')](_0x3c7b('0x95'),{'UserId':Number(_0x4a47d0['query'][_0x3c7b('0x88')]),'VoiceQueueId':Number(_0x4a47d0[_0x3c7b('0x56')]['id'])});}});}})[_0x3c7b('0x2c')](function(_0x4715be){return db[_0x3c7b('0x80')][_0x3c7b('0x39')]({'where':{'VoiceQueueId':_0x4a47d0[_0x3c7b('0x56')]['id'],'UserId':_0x4a47d0['query'][_0x3c7b('0x88')]}})['then'](function(){return _0x4715be;});})[_0x3c7b('0x2c')](respondWithStatusCode(_0x179c68,null))['catch'](handleError(_0x179c68,null));};exports[_0x3c7b('0x99')]=function(_0x268cbf,_0xfa7ccb,_0x2fbb71){var _0x310302={};var _0xa2e3e8={};var _0x119d05;var _0x153cca;return db[_0x3c7b('0x3d')]['findOne']({'where':{'id':_0x268cbf['params']['id']}})['then'](handleEntityNotFound(_0xfa7ccb,null))['then'](function(_0x34e5d5){if(_0x34e5d5){_0x119d05=_0x34e5d5;_0xa2e3e8['model']=_[_0x3c7b('0x42')](db['User'][_0x3c7b('0x57')]);_0xa2e3e8[_0x3c7b('0x41')]=_[_0x3c7b('0x42')](_0x268cbf[_0x3c7b('0x41')]);_0xa2e3e8[_0x3c7b('0x43')]=_[_0x3c7b('0x45')](_0xa2e3e8[_0x3c7b('0x40')],_0xa2e3e8['query']);_0x310302[_0x3c7b('0x44')]=_[_0x3c7b('0x45')](_0xa2e3e8[_0x3c7b('0x40')],qs[_0x3c7b('0x46')](_0x268cbf[_0x3c7b('0x41')]['fields']));_0x310302[_0x3c7b('0x44')]=_0x310302[_0x3c7b('0x44')][_0x3c7b('0x47')]?_0x310302[_0x3c7b('0x44')]:_0xa2e3e8[_0x3c7b('0x40')];_0x310302['order']=qs['sort'](_0x268cbf[_0x3c7b('0x41')]['sort']);_0x310302[_0x3c7b('0x4c')]=qs['filters'](_[_0x3c7b('0x4d')](_0x268cbf[_0x3c7b('0x41')],_0xa2e3e8['filters']));if(_0x268cbf[_0x3c7b('0x41')][_0x3c7b('0x4e')]){_0x310302['where']=_['merge'](_0x310302[_0x3c7b('0x4c')],{'$or':_[_0x3c7b('0x32')](_0x310302['attributes'],function(_0x329d55){var _0x88a8b4={};_0x88a8b4[_0x329d55]={'$like':'%'+_0x268cbf[_0x3c7b('0x41')][_0x3c7b('0x4e')]+'%'};return _0x88a8b4;})});}_0x310302=_[_0x3c7b('0x4f')]({},_0x310302,_0x268cbf[_0x3c7b('0x51')]);return _0x119d05['getAgents'](_0x310302);}})[_0x3c7b('0x2c')](function(_0x468820){if(_0x468820){_0x153cca=_0x468820[_0x3c7b('0x47')];if(!_0x268cbf[_0x3c7b('0x41')]['hasOwnProperty'](_0x3c7b('0x49'))){_0x310302[_0x3c7b('0x24')]=qs[_0x3c7b('0x24')](_0x268cbf[_0x3c7b('0x41')][_0x3c7b('0x24')]);_0x310302[_0x3c7b('0x22')]=qs['offset'](_0x268cbf[_0x3c7b('0x41')][_0x3c7b('0x22')]);}return _0x119d05['getAgents'](_0x310302);}})[_0x3c7b('0x2c')](function(_0x4d9a41){if(_0x4d9a41){return _0x4d9a41?{'count':_0x153cca,'rows':_0x4d9a41}:null;}})['then'](respondWithResult(_0xfa7ccb,null))['catch'](handleError(_0xfa7ccb,null));};exports['getMembers']=function(_0x521be5,_0x4266c2,_0x5eff7b){var _0x420a36={};var _0x5d7071={};var _0x2238fe;var _0x5b127c;return db[_0x3c7b('0x3d')][_0x3c7b('0x69')]({'where':{'id':_0x521be5[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x4266c2,null))['then'](function(_0x37f015){if(_0x37f015){_0x2238fe=_0x37f015;_0x5d7071[_0x3c7b('0x40')]=_['keys'](db[_0x3c7b('0x80')][_0x3c7b('0x57')]);_0x5d7071[_0x3c7b('0x41')]=_[_0x3c7b('0x42')](_0x521be5[_0x3c7b('0x41')]);_0x5d7071[_0x3c7b('0x43')]=_[_0x3c7b('0x45')](_0x5d7071[_0x3c7b('0x40')],_0x5d7071[_0x3c7b('0x41')]);_0x420a36[_0x3c7b('0x44')]=_[_0x3c7b('0x45')](_0x5d7071['model'],qs[_0x3c7b('0x46')](_0x521be5[_0x3c7b('0x41')][_0x3c7b('0x46')]));_0x420a36['attributes']=_0x420a36[_0x3c7b('0x44')][_0x3c7b('0x47')]?_0x420a36['attributes']:_0x5d7071['model'];_0x420a36[_0x3c7b('0x4a')]=qs[_0x3c7b('0x4b')](_0x521be5[_0x3c7b('0x41')][_0x3c7b('0x4b')]);_0x420a36['where']=qs[_0x3c7b('0x43')](_[_0x3c7b('0x4d')](_0x521be5[_0x3c7b('0x41')],_0x5d7071[_0x3c7b('0x43')]));if(_0x521be5[_0x3c7b('0x41')][_0x3c7b('0x4e')]){_0x420a36[_0x3c7b('0x4c')]=_[_0x3c7b('0x4f')](_0x420a36[_0x3c7b('0x4c')],{'$or':_[_0x3c7b('0x32')](_0x420a36[_0x3c7b('0x44')],function(_0x14d9a8){var _0x30d80f={};_0x30d80f[_0x14d9a8]={'$like':'%'+_0x521be5[_0x3c7b('0x41')]['filter']+'%'};return _0x30d80f;})});}_0x420a36=_['merge']({},_0x420a36,_0x521be5[_0x3c7b('0x51')]);return _0x2238fe[_0x3c7b('0x9a')](_0x420a36);}})['then'](function(_0x5507c9){if(_0x5507c9){_0x5b127c=_0x5507c9[_0x3c7b('0x47')];if(!_0x521be5[_0x3c7b('0x41')]['hasOwnProperty'](_0x3c7b('0x49'))){_0x420a36[_0x3c7b('0x24')]=qs['limit'](_0x521be5[_0x3c7b('0x41')][_0x3c7b('0x24')]);_0x420a36['offset']=qs[_0x3c7b('0x22')](_0x521be5[_0x3c7b('0x41')][_0x3c7b('0x22')]);}return _0x2238fe['getMembers'](_0x420a36);}})[_0x3c7b('0x2c')](function(_0x312f68){return _0x312f68?{'count':_0x5b127c,'rows':_0x312f68}:null;})['then'](respondWithResult(_0x4266c2,null))[_0x3c7b('0x60')](handleError(_0x4266c2,null));};exports[_0x3c7b('0x9b')]=function(_0xf0a54a,_0x2595fc,_0x26d0e0){var _0x2476f3={};var _0x43239a={};var _0x4c9525;var _0xd26be4;return db[_0x3c7b('0x3d')]['findOne']({'where':{'id':_0xf0a54a[_0x3c7b('0x56')]['id']}})['then'](handleEntityNotFound(_0x2595fc,null))[_0x3c7b('0x2c')](function(_0x5433b1){if(_0x5433b1){_0x4c9525=_0x5433b1;_0x43239a[_0x3c7b('0x40')]=_[_0x3c7b('0x42')](db[_0x3c7b('0x9c')][_0x3c7b('0x57')]);_0x43239a[_0x3c7b('0x41')]=_[_0x3c7b('0x42')](_0xf0a54a['query']);_0x43239a['filters']=_[_0x3c7b('0x45')](_0x43239a[_0x3c7b('0x40')],_0x43239a[_0x3c7b('0x41')]);_0x2476f3[_0x3c7b('0x44')]=_[_0x3c7b('0x45')](_0x43239a[_0x3c7b('0x40')],qs[_0x3c7b('0x46')](_0xf0a54a[_0x3c7b('0x41')][_0x3c7b('0x46')]));_0x2476f3[_0x3c7b('0x44')]=_0x2476f3['attributes']['length']?_0x2476f3[_0x3c7b('0x44')]:_0x43239a[_0x3c7b('0x40')];_0x2476f3[_0x3c7b('0x4a')]=qs[_0x3c7b('0x4b')](_0xf0a54a['query'][_0x3c7b('0x4b')]);_0x2476f3[_0x3c7b('0x4c')]=qs['filters'](_[_0x3c7b('0x4d')](_0xf0a54a['query'],_0x43239a[_0x3c7b('0x43')]));if(_0xf0a54a[_0x3c7b('0x41')][_0x3c7b('0x4e')]){_0x2476f3[_0x3c7b('0x4c')]=_[_0x3c7b('0x4f')](_0x2476f3['where'],{'$or':_[_0x3c7b('0x32')](_0x2476f3[_0x3c7b('0x44')],function(_0x286567){var _0x28d3a2={};_0x28d3a2[_0x286567]={'$like':'%'+_0xf0a54a[_0x3c7b('0x41')][_0x3c7b('0x4e')]+'%'};return _0x28d3a2;})});}_0x2476f3=_['merge']({},_0x2476f3,_0xf0a54a[_0x3c7b('0x51')]);return _0x4c9525[_0x3c7b('0x9b')](_0x2476f3);}})[_0x3c7b('0x2c')](function(_0x509a2f){if(_0x509a2f){_0xd26be4=_0x509a2f['length'];if(!_0xf0a54a[_0x3c7b('0x41')]['hasOwnProperty'](_0x3c7b('0x49'))){_0x2476f3[_0x3c7b('0x24')]=qs[_0x3c7b('0x24')](_0xf0a54a[_0x3c7b('0x41')]['limit']);_0x2476f3['offset']=qs['offset'](_0xf0a54a['query'][_0x3c7b('0x22')]);}return _0x4c9525['getLists'](_0x2476f3);}})['then'](function(_0x157c73){if(_0x157c73){return _0x157c73?{'count':_0xd26be4,'rows':_0x157c73}:null;}})[_0x3c7b('0x2c')](respondWithResult(_0x2595fc,null))[_0x3c7b('0x60')](handleError(_0x2595fc,null));};exports[_0x3c7b('0x9d')]=function(_0x1a32d9,_0x11f4f3,_0x1e736d){var _0x44265c=moment()[_0x3c7b('0x9e')](_0x3c7b('0x9f'));var _0x24203f,_0x2dbbb7;return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x1a32d9[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x11f4f3,null))['then'](function(_0x5a2431){if(_0x5a2431){_0x2dbbb7=_0x5a2431;return _0x5a2431[_0x3c7b('0x9d')](_0x1a32d9['body'][_0x3c7b('0x88')],_[_0x3c7b('0x63')](_0x1a32d9[_0x3c7b('0x59')],[_0x3c7b('0x88'),'id'])||{});}return null;})[_0x3c7b('0x97')](function(_0x1b3290){var _0x28062c;_0x24203f=_0x1b3290||[];var _0x42bbb9=[];if(_0x1b3290){for(var _0x51913d=0x0;_0x51913d<_0x1b3290['length'];_0x51913d+=0x1){var _0x18e32d=_0x1b3290[_0x51913d]['get']({'plain':!![]});_0x2dbbb7['dialCheckDuplicateType']=_0x1a32d9[_0x3c7b('0x59')][_0x3c7b('0xa0')]?_0x1a32d9[_0x3c7b('0x59')][_0x3c7b('0xa0')]:_0x2dbbb7['dialCheckDuplicateType'];switch(_0x2dbbb7[_0x3c7b('0xa0')]){case'always':_0x28062c=squel[_0x3c7b('0xa1')]()[_0x3c7b('0xa2')]('cm_hopper')['fromQuery'](['phone',_0x3c7b('0xa3'),'ContactId',_0x3c7b('0xa4'),_0x3c7b('0x6b'),_0x3c7b('0x64'),'updatedAt'],squel[_0x3c7b('0x89')]()['field'](_0x3c7b('0xa5'),'phone')[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0xa3'))['field']('id',_0x3c7b('0xa6'))['field'](_0x18e32d['CmListId']['toString'](),'ListId')['field'](_0x1a32d9['params']['id'][_0x3c7b('0xa7')](),_0x3c7b('0x6b'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0x64'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27','updatedAt')['from'](_0x3c7b('0xa8'))[_0x3c7b('0x4c')](_0x3c7b('0xa9'))['where'](_0x3c7b('0xaa'),_0x18e32d[_0x3c7b('0xab')][_0x3c7b('0xa7')]())[_0x3c7b('0x4c')](_0x3c7b('0xac'))[_0x3c7b('0x4c')](_0x3c7b('0xad'),squel[_0x3c7b('0x89')]()[_0x3c7b('0x8a')]('COALESCE(calleridnum,\x27\x27)')[_0x3c7b('0x8b')](_0x3c7b('0xae'))[_0x3c7b('0x4c')](_0x3c7b('0x8e'),_0x1a32d9['params']['id']['toString']()))['where'](_0x3c7b('0xad'),squel['select']()[_0x3c7b('0x8a')](_0x3c7b('0xaf'))[_0x3c7b('0x8b')](_0x3c7b('0xb0'))[_0x3c7b('0x4c')](_0x3c7b('0x8e'),_0x1a32d9[_0x3c7b('0x56')]['id'][_0x3c7b('0xa7')]())))[_0x3c7b('0xa7')]();break;case _0x3c7b('0xb1'):_0x28062c=squel[_0x3c7b('0xa1')]()[_0x3c7b('0xa2')](_0x3c7b('0xb0'))[_0x3c7b('0xb2')]([_0x3c7b('0xa5'),_0x3c7b('0xa3'),_0x3c7b('0xa6'),'ListId',_0x3c7b('0x6b'),'createdAt',_0x3c7b('0x65')],squel['select']()[_0x3c7b('0x8a')](_0x3c7b('0xa5'),_0x3c7b('0xa5'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27','scheduledAt')['field']('id','ContactId')[_0x3c7b('0x8a')](_0x18e32d[_0x3c7b('0xab')]['toString'](),_0x3c7b('0xa4'))[_0x3c7b('0x8a')](_0x1a32d9[_0x3c7b('0x56')]['id'][_0x3c7b('0xa7')](),_0x3c7b('0x6b'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0x64'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0x65'))[_0x3c7b('0x8b')]('cm_contacts')[_0x3c7b('0x4c')](_0x3c7b('0xa9'))[_0x3c7b('0x4c')](_0x3c7b('0xaa'),_0x18e32d[_0x3c7b('0xab')][_0x3c7b('0xa7')]())[_0x3c7b('0x4c')](_0x3c7b('0xac'))[_0x3c7b('0x4c')](_0x3c7b('0xad'),squel[_0x3c7b('0x89')]()['field']('COALESCE(phone,\x27\x27)')[_0x3c7b('0x8b')](_0x3c7b('0xb0'))['where']('VoiceQueueId\x20=\x20?',_0x1a32d9[_0x3c7b('0x56')]['id']['toString']())))[_0x3c7b('0xa7')]();break;default:_0x28062c=squel[_0x3c7b('0xa1')]()[_0x3c7b('0xa2')](_0x3c7b('0xb0'))[_0x3c7b('0xb2')]([_0x3c7b('0xa5'),_0x3c7b('0xa3'),'ContactId',_0x3c7b('0xa4'),_0x3c7b('0x6b'),_0x3c7b('0x64'),_0x3c7b('0x65')],squel[_0x3c7b('0x89')]()['field'](_0x3c7b('0xa5'),_0x3c7b('0xa5'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0xa3'))[_0x3c7b('0x8a')]('id','ContactId')[_0x3c7b('0x8a')](_0x18e32d[_0x3c7b('0xab')][_0x3c7b('0xa7')](),_0x3c7b('0xa4'))[_0x3c7b('0x8a')](_0x1a32d9[_0x3c7b('0x56')]['id']['toString'](),_0x3c7b('0x6b'))['field']('\x27'+_0x44265c+'\x27',_0x3c7b('0x64'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0x65'))[_0x3c7b('0x8b')](_0x3c7b('0xa8'))[_0x3c7b('0x4c')]('deletedAt\x20IS\x20NULL')[_0x3c7b('0x4c')]('ListId\x20=\x20?',_0x18e32d[_0x3c7b('0xab')][_0x3c7b('0xa7')]())[_0x3c7b('0x4c')](_0x3c7b('0xac')))['toString']();}_0x42bbb9['push'](db[_0x3c7b('0x7a')]['query'](_0x28062c));}return BPromise['all'](_0x42bbb9);}})[_0x3c7b('0x2c')](function(){var _0x4882e6=[];var _0x1276bc=squel['insert']()[_0x3c7b('0xa2')](_0x3c7b('0xb3'))[_0x3c7b('0xb2')](['CmHopperId',_0x3c7b('0xa5'),_0x3c7b('0xb4'),'createdAt',_0x3c7b('0x65')],squel[_0x3c7b('0x89')]()[_0x3c7b('0x8a')](_0x3c7b('0xb5'))[_0x3c7b('0x8a')](_0x3c7b('0xb6'))[_0x3c7b('0x8a')](_0x3c7b('0xb7'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0x64'))[_0x3c7b('0x8a')]('\x27'+_0x44265c+'\x27',_0x3c7b('0x65'))[_0x3c7b('0x8b')](_0x3c7b('0xb8'),'ci')[_0x3c7b('0xb9')](_0x3c7b('0xb0'),'h',_0x3c7b('0xba'))[_0x3c7b('0x4c')](_0x3c7b('0xbb'),_0x44265c)[_0x3c7b('0x4c')](_0x3c7b('0xbc'),_0x3c7b('0xbd')))[_0x3c7b('0xa7')]();_0x4882e6[_0x3c7b('0x98')](db[_0x3c7b('0x7a')][_0x3c7b('0x41')](_0x1276bc));return BPromise['all'](_0x4882e6);})[_0x3c7b('0x2c')](function(){return _0x24203f;})[_0x3c7b('0x2c')](respondWithResult(_0x11f4f3,null))['catch'](handleError(_0x11f4f3,null));};exports['removeLists']=function(_0x4241f7,_0x244bb9,_0x142625){return db['VoiceQueue'][_0x3c7b('0x36')]({'where':{'id':_0x4241f7[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x244bb9,null))[_0x3c7b('0x2c')](function(_0x14f9ee){if(_0x14f9ee){return _0x14f9ee['removeLists'](_0x4241f7[_0x3c7b('0x41')]['ids']);}})[_0x3c7b('0x2c')](function(_0x150be6){if(_0x150be6){return db[_0x3c7b('0x6a')][_0x3c7b('0x39')]({'where':{'ListId':_0x4241f7[_0x3c7b('0x41')][_0x3c7b('0x88')],'VoiceQueueId':_0x4241f7[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](function(){return _0x150be6;});}})['then'](respondWithStatusCode(_0x244bb9,null))[_0x3c7b('0x60')](handleError(_0x244bb9,null));};exports[_0x3c7b('0xbe')]=function(_0x4e8638,_0x1f8fdd,_0x2701d8){var _0x27a957={};var _0xfd72bd={};var _0x2b34a6;var _0x13f4c4;return db[_0x3c7b('0x3d')][_0x3c7b('0x69')]({'where':{'id':_0x4e8638[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x1f8fdd,null))['then'](function(_0xe86a2a){if(_0xe86a2a){_0x2b34a6=_0xe86a2a;_0xfd72bd[_0x3c7b('0x40')]=_[_0x3c7b('0x42')](db[_0x3c7b('0x9c')]['rawAttributes']);_0xfd72bd['query']=_[_0x3c7b('0x42')](_0x4e8638['query']);_0xfd72bd['filters']=_[_0x3c7b('0x45')](_0xfd72bd[_0x3c7b('0x40')],_0xfd72bd[_0x3c7b('0x41')]);_0x27a957['attributes']=_[_0x3c7b('0x45')](_0xfd72bd[_0x3c7b('0x40')],qs[_0x3c7b('0x46')](_0x4e8638['query'][_0x3c7b('0x46')]));_0x27a957['attributes']=_0x27a957[_0x3c7b('0x44')]['length']?_0x27a957[_0x3c7b('0x44')]:_0xfd72bd[_0x3c7b('0x40')];_0x27a957[_0x3c7b('0x4a')]=qs[_0x3c7b('0x4b')](_0x4e8638[_0x3c7b('0x41')][_0x3c7b('0x4b')]);_0x27a957[_0x3c7b('0x4c')]=qs[_0x3c7b('0x43')](_['pick'](_0x4e8638[_0x3c7b('0x41')],_0xfd72bd[_0x3c7b('0x43')]));if(_0x4e8638[_0x3c7b('0x41')][_0x3c7b('0x4e')]){_0x27a957['where']=_['merge'](_0x27a957[_0x3c7b('0x4c')],{'$or':_[_0x3c7b('0x32')](_0x27a957[_0x3c7b('0x44')],function(_0x5836a0){var _0x5e347e={};_0x5e347e[_0x5836a0]={'$like':'%'+_0x4e8638[_0x3c7b('0x41')][_0x3c7b('0x4e')]+'%'};return _0x5e347e;})});}_0x27a957=_['merge']({},_0x27a957,_0x4e8638[_0x3c7b('0x51')]);return _0x2b34a6['getBlackLists'](_0x27a957);}})[_0x3c7b('0x2c')](function(_0x48d9f4){if(_0x48d9f4){_0x13f4c4=_0x48d9f4[_0x3c7b('0x47')];if(!_0x4e8638[_0x3c7b('0x41')][_0x3c7b('0x48')](_0x3c7b('0x49'))){_0x27a957['limit']=qs['limit'](_0x4e8638[_0x3c7b('0x41')][_0x3c7b('0x24')]);_0x27a957[_0x3c7b('0x22')]=qs[_0x3c7b('0x22')](_0x4e8638[_0x3c7b('0x41')]['offset']);}return _0x2b34a6[_0x3c7b('0xbe')](_0x27a957);}})['then'](function(_0x3cbcd4){if(_0x3cbcd4){return _0x3cbcd4?{'count':_0x13f4c4,'rows':_0x3cbcd4}:null;}})[_0x3c7b('0x2c')](respondWithResult(_0x1f8fdd,null))[_0x3c7b('0x60')](handleError(_0x1f8fdd,null));};exports[_0x3c7b('0xbf')]=function(_0x46de7c,_0x2f592b,_0x48767a){var _0x1d5819,_0x4676ed;return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x46de7c['params']['id']}})[_0x3c7b('0x2c')](handleEntityNotFound(_0x2f592b,null))['then'](function(_0x57d0b3){if(_0x57d0b3){_0x4676ed=_0x57d0b3;return _0x57d0b3['addBlackLists'](_0x46de7c[_0x3c7b('0x59')][_0x3c7b('0x88')],_[_0x3c7b('0x63')](_0x46de7c[_0x3c7b('0x59')],['ids','id'])||{});}return null;})[_0x3c7b('0x97')](function(_0x7dfeff){var _0x2b2567;_0x1d5819=_0x7dfeff||[];var _0x244fa6=[];if(_0x7dfeff){for(var _0x46a93d=0x0;_0x46a93d<_0x7dfeff[_0x3c7b('0x47')];_0x46a93d+=0x1){var _0x577962=_0x7dfeff[_0x46a93d][_0x3c7b('0x2d')]({'plain':!![]});_0x2b2567=squel[_0x3c7b('0xa1')]()[_0x3c7b('0xa2')](_0x3c7b('0xc0'))[_0x3c7b('0xb2')]([_0x3c7b('0xa5'),'ContactId',_0x3c7b('0xa4'),_0x3c7b('0x6b'),'createdAt',_0x3c7b('0x65')],squel['select']()['field'](_0x3c7b('0xa5'),'phone')['field']('id',_0x3c7b('0xa6'))[_0x3c7b('0x8a')](_0x577962['CmListId'][_0x3c7b('0xa7')](),_0x3c7b('0xa4'))['field'](_0x46de7c[_0x3c7b('0x56')]['id'][_0x3c7b('0xa7')](),_0x3c7b('0x6b'))['field'](_0x3c7b('0xc1'),_0x3c7b('0x64'))[_0x3c7b('0x8a')](_0x3c7b('0xc1'),_0x3c7b('0x65'))['from'](_0x3c7b('0xa8'))[_0x3c7b('0x4c')](_0x3c7b('0xa9'))['where'](_0x3c7b('0xaa'),_0x577962['CmListId'][_0x3c7b('0xa7')]())[_0x3c7b('0x4c')](_0x3c7b('0xac')))[_0x3c7b('0xa7')]();_0x244fa6[_0x3c7b('0x98')](db['sequelize']['query'](_0x2b2567));}return BPromise[_0x3c7b('0xc2')](_0x244fa6);}})[_0x3c7b('0x2c')](function(){return _0x1d5819;})[_0x3c7b('0x2c')](respondWithResult(_0x2f592b,null))['catch'](handleError(_0x2f592b,null));};exports['removeBlackLists']=function(_0x1eaf19,_0x240289,_0x560731){return db[_0x3c7b('0x3d')][_0x3c7b('0x36')]({'where':{'id':_0x1eaf19[_0x3c7b('0x56')]['id']}})['then'](handleEntityNotFound(_0x240289,null))[_0x3c7b('0x2c')](function(_0x2b4cf1){if(_0x2b4cf1){return _0x2b4cf1[_0x3c7b('0xc3')](_0x1eaf19[_0x3c7b('0x41')][_0x3c7b('0x88')]);}})[_0x3c7b('0x2c')](function(_0x4742fe){if(_0x4742fe){return db['CmHopperBlack'][_0x3c7b('0x39')]({'where':{'ListId':_0x1eaf19[_0x3c7b('0x41')]['ids'],'VoiceQueueId':_0x1eaf19[_0x3c7b('0x56')]['id']}})[_0x3c7b('0x2c')](function(){return _0x4742fe;});}})[_0x3c7b('0x2c')](respondWithStatusCode(_0x240289,null))[_0x3c7b('0x60')](handleError(_0x240289,null));}; \ No newline at end of file +var _0x9206=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','UserProfileResource','error','stack','name','send','VoiceQueue','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','nolimit','sort','filters','where','options','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','update','getHoppers','findOne','CmHopper','hasOwnProperty','order','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','interface','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','userVoiceQueue:remove','addAgents','spread','isEmpty','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','all','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','join','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x503946,_0x4bfc24){var _0x40ee19=function(_0x4c382e){while(--_0x4c382e){_0x503946['push'](_0x503946['shift']());}};_0x40ee19(++_0x4bfc24);}(_0x9206,0x176));var _0x6920=function(_0x154bd1,_0x5a050c){_0x154bd1=_0x154bd1-0x0;var _0x39d685=_0x9206[_0x154bd1];return _0x39d685;};'use strict';var emlformat=require(_0x6920('0x0'));var rimraf=require(_0x6920('0x1'));var zipdir=require(_0x6920('0x2'));var jsonpatch=require(_0x6920('0x3'));var rp=require(_0x6920('0x4'));var moment=require(_0x6920('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6920('0x6'));var path=require(_0x6920('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6920('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6920('0x9'));var squel=require(_0x6920('0xa'));var crypto=require(_0x6920('0xb'));var jsforce=require(_0x6920('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6920('0xd'));var Papa=require(_0x6920('0xe'));var Redis=require(_0x6920('0xf'));var authService=require(_0x6920('0x10'));var qs=require(_0x6920('0x11'));var as=require(_0x6920('0x12'));var hardwareService=require(_0x6920('0x13'));var logger=require(_0x6920('0x14'))(_0x6920('0x15'));var utils=require(_0x6920('0x16'));var config=require(_0x6920('0x17'));var licenseUtil=require(_0x6920('0x18'));var db=require(_0x6920('0x19'))['db'];config['redis']=_['defaults'](config[_0x6920('0x1a')],{'host':_0x6920('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6920('0x1a')]));require(_0x6920('0x1c'))[_0x6920('0x1d')](socket);function respondWithStatusCode(_0x2c3a35,_0x17c6e9){_0x17c6e9=_0x17c6e9||0xcc;return function(_0x4b39c4){if(_0x4b39c4){return _0x2c3a35[_0x6920('0x1e')](_0x17c6e9);}return _0x2c3a35[_0x6920('0x1f')](_0x17c6e9)[_0x6920('0x20')]();};}function respondWithResult(_0xa64034,_0x289b73){_0x289b73=_0x289b73||0xc8;return function(_0x3e94ee){if(_0x3e94ee){return _0xa64034[_0x6920('0x1f')](_0x289b73)[_0x6920('0x21')](_0x3e94ee);}};}function respondWithFilteredResult(_0x11ce91,_0x2d04e7){return function(_0x462500){if(_0x462500){var _0x3d0059=typeof _0x2d04e7[_0x6920('0x22')]===_0x6920('0x23')&&typeof _0x2d04e7[_0x6920('0x24')]==='undefined';var _0x3a0c0c=_0x462500[_0x6920('0x25')];var _0x377e25=_0x3d0059?0x0:_0x2d04e7[_0x6920('0x22')];var _0xf4b5bd=_0x3d0059?_0x462500[_0x6920('0x25')]:_0x2d04e7[_0x6920('0x22')]+_0x2d04e7[_0x6920('0x24')];var _0xaf93ba;if(_0xf4b5bd>=_0x3a0c0c){_0xf4b5bd=_0x3a0c0c;_0xaf93ba=0xc8;}else{_0xaf93ba=0xce;}_0x11ce91[_0x6920('0x1f')](_0xaf93ba);return _0x11ce91[_0x6920('0x26')](_0x6920('0x27'),_0x377e25+'-'+_0xf4b5bd+'/'+_0x3a0c0c)[_0x6920('0x21')](_0x462500);}return null;};}function patchUpdates(_0x2dd788){return function(_0x1f68c5){try{jsonpatch[_0x6920('0x28')](_0x1f68c5,_0x2dd788,!![]);}catch(_0x1ae686){return BPromise[_0x6920('0x29')](_0x1ae686);}return _0x1f68c5[_0x6920('0x2a')]();};}function saveUpdates(_0x258986,_0x51cb24){return function(_0x1996f1){if(_0x1996f1){return _0x1996f1['update'](_0x258986)[_0x6920('0x2b')](function(_0x4dd08b){return _0x4dd08b;});}return null;};}function removeEntity(_0x72316a,_0x32a6ae){return function(_0x23e4cd){if(_0x23e4cd){return _0x23e4cd[_0x6920('0x2c')]()['then'](function(){var _0x1cab00=_0x23e4cd[_0x6920('0x2d')]({'plain':!![]});var _0x305129=[{'name':_0x6920('0x2e'),'value':_0x6920('0x2f'),'ignore':![]},{'name':_0x6920('0x30'),'value':_0x6920('0x31'),'ignore':![]}];var _0x38d0f6=_(_0x305129)[_0x6920('0x32')](_0x6920('0x33'))[_0x6920('0x34')](_0x6920('0x35'))['value']();if(_[_0x6920('0x36')](_0x38d0f6,_0x1cab00['type'])){return;}var _0x411ea2=_['find'](_0x305129,[_0x6920('0x35'),_0x1cab00[_0x6920('0x37')]])['name'];return db[_0x6920('0x38')][_0x6920('0x2c')]({'where':{'type':_0x411ea2,'resourceId':_0x1cab00['id']}})[_0x6920('0x2b')](function(){return _0x23e4cd;});})['then'](function(){_0x72316a['status'](0xcc)[_0x6920('0x20')]();});}};}function handleEntityNotFound(_0x5bb636,_0x59506b){return function(_0xc2807c){if(!_0xc2807c){_0x5bb636[_0x6920('0x1e')](0x194);}return _0xc2807c;};}function handleError(_0x8b95ba,_0x7155e5){_0x7155e5=_0x7155e5||0x1f4;return function(_0x86aa6f){logger[_0x6920('0x39')](_0x86aa6f[_0x6920('0x3a')]);if(_0x86aa6f['name']){delete _0x86aa6f[_0x6920('0x3b')];}_0x8b95ba['status'](_0x7155e5)[_0x6920('0x3c')](_0x86aa6f);};}exports['index']=function(_0x495b5b,_0x5d1ac3){var _0x155b3a={},_0x1d4426={},_0xcfe1bf={'count':0x0,'rows':[]};var _0x54af8a=_[_0x6920('0x34')](db[_0x6920('0x3d')][_0x6920('0x3e')],function(_0x33acf7){return{'name':_0x33acf7[_0x6920('0x3f')],'type':_0x33acf7[_0x6920('0x37')][_0x6920('0x40')]};});_0x1d4426['model']=_[_0x6920('0x34')](_0x54af8a,'name');_0x1d4426[_0x6920('0x41')]=_[_0x6920('0x42')](_0x495b5b[_0x6920('0x41')]);_0x1d4426['filters']=_[_0x6920('0x43')](_0x1d4426[_0x6920('0x44')],_0x1d4426[_0x6920('0x41')]);_0x155b3a[_0x6920('0x45')]=_['intersection'](_0x1d4426[_0x6920('0x44')],qs[_0x6920('0x46')](_0x495b5b['query']['fields']));_0x155b3a[_0x6920('0x45')]=_0x155b3a[_0x6920('0x45')]['length']?_0x155b3a[_0x6920('0x45')]:_0x1d4426[_0x6920('0x44')];if(!_0x495b5b['query']['hasOwnProperty'](_0x6920('0x47'))){_0x155b3a[_0x6920('0x24')]=qs[_0x6920('0x24')](_0x495b5b[_0x6920('0x41')][_0x6920('0x24')]);_0x155b3a['offset']=qs['offset'](_0x495b5b['query'][_0x6920('0x22')]);}_0x155b3a['order']=qs['sort'](_0x495b5b[_0x6920('0x41')][_0x6920('0x48')]);_0x155b3a['where']=qs[_0x6920('0x49')](_['pick'](_0x495b5b[_0x6920('0x41')],_0x1d4426[_0x6920('0x49')]),_0x54af8a);if(_0x495b5b[_0x6920('0x41')][_0x6920('0x32')]){_0x155b3a[_0x6920('0x4a')]=_['merge'](_0x155b3a['where'],{'$or':_[_0x6920('0x34')](_0x54af8a,function(_0x56508c){if(_0x56508c['type']!=='VIRTUAL'){var _0x520cd1={};_0x520cd1[_0x56508c[_0x6920('0x3b')]]={'$like':'%'+_0x495b5b[_0x6920('0x41')][_0x6920('0x32')]+'%'};return _0x520cd1;}})});}_0x155b3a=_['merge']({},_0x155b3a,_0x495b5b[_0x6920('0x4b')]);var _0x29306b={'where':_0x155b3a[_0x6920('0x4a')]};return db[_0x6920('0x3d')][_0x6920('0x25')](_0x29306b)[_0x6920('0x2b')](function(_0x4b487c){_0xcfe1bf[_0x6920('0x25')]=_0x4b487c;if(_0x495b5b[_0x6920('0x41')][_0x6920('0x4c')]){_0x155b3a[_0x6920('0x4d')]=[{'all':!![]}];}return db[_0x6920('0x3d')][_0x6920('0x4e')](_0x155b3a);})[_0x6920('0x2b')](function(_0x22a8bb){_0xcfe1bf[_0x6920('0x4f')]=_0x22a8bb;return _0xcfe1bf;})[_0x6920('0x2b')](respondWithFilteredResult(_0x5d1ac3,_0x155b3a))[_0x6920('0x50')](handleError(_0x5d1ac3,null));};exports[_0x6920('0x51')]=function(_0x552a81,_0x1d50f7){var _0x383c6d={'raw':![],'where':{'id':_0x552a81['params']['id']}},_0x571aed={};_0x571aed[_0x6920('0x44')]=_[_0x6920('0x42')](db[_0x6920('0x3d')][_0x6920('0x3e')]);_0x571aed[_0x6920('0x41')]=_['keys'](_0x552a81[_0x6920('0x41')]);_0x571aed[_0x6920('0x49')]=_[_0x6920('0x43')](_0x571aed['model'],_0x571aed['query']);_0x383c6d[_0x6920('0x45')]=_[_0x6920('0x43')](_0x571aed[_0x6920('0x44')],qs[_0x6920('0x46')](_0x552a81['query'][_0x6920('0x46')]));_0x383c6d[_0x6920('0x45')]=_0x383c6d[_0x6920('0x45')][_0x6920('0x52')]?_0x383c6d[_0x6920('0x45')]:_0x571aed['model'];if(_0x552a81[_0x6920('0x41')][_0x6920('0x4c')]){_0x383c6d[_0x6920('0x4d')]=[{'all':!![]}];}_0x383c6d=_[_0x6920('0x53')]({},_0x383c6d,_0x552a81[_0x6920('0x4b')]);return db[_0x6920('0x3d')][_0x6920('0x54')](_0x383c6d)[_0x6920('0x2b')](handleEntityNotFound(_0x1d50f7,null))[_0x6920('0x2b')](respondWithResult(_0x1d50f7,null))[_0x6920('0x50')](handleError(_0x1d50f7,null));};exports['create']=function(_0x2557c0,_0x303247){return db[_0x6920('0x3d')][_0x6920('0x55')](_0x2557c0[_0x6920('0x56')],{})[_0x6920('0x2b')](function(_0xf7412b){var _0x5f27e7=_0x2557c0[_0x6920('0x57')][_0x6920('0x2d')]({'plain':!![]});if(!_0x5f27e7)throw new Error(_0x6920('0x58'));if(_0x5f27e7[_0x6920('0x59')]==='user'){var _0x52e62e=_0xf7412b['get']({'plain':!![]});var _0x2e0a39=[{'name':_0x6920('0x2e'),'value':_0x6920('0x2f')},{'name':'QueueCampaigns','value':_0x6920('0x31')}];var _0x12c261=_[_0x6920('0x54')](_0x2e0a39,[_0x6920('0x35'),_0x52e62e[_0x6920('0x37')]])[_0x6920('0x3b')];return db[_0x6920('0x5a')]['find']({'where':{'name':_0x12c261,'userProfileId':_0x5f27e7[_0x6920('0x5b')]},'raw':!![]})[_0x6920('0x2b')](function(_0x4a8664){if(_0x4a8664&&_0x4a8664[_0x6920('0x5c')]===0x0){return db[_0x6920('0x38')][_0x6920('0x55')]({'name':_0x52e62e[_0x6920('0x3b')],'resourceId':_0x52e62e['id'],'type':_0x4a8664[_0x6920('0x3b')],'sectionId':_0x4a8664['id']},{})['then'](function(){return _0xf7412b;});}else{return _0xf7412b;}})[_0x6920('0x50')](function(_0x10bde8){logger['error'](_0x6920('0x5d'),_0x10bde8);throw _0x10bde8;});}return _0xf7412b;})[_0x6920('0x2b')](respondWithResult(_0x303247,0xc9))['catch'](handleError(_0x303247,null));};exports['clone']=function(_0x4483ac,_0x24cfbe){var _0x56cedc={'where':{'id':_0x4483ac[_0x6920('0x5e')]['id']}},_0x1489c4={};_0x1489c4[_0x6920('0x44')]=_[_0x6920('0x42')](db[_0x6920('0x3d')][_0x6920('0x3e')]);_0x56cedc[_0x6920('0x45')]=_['intersection'](_0x1489c4[_0x6920('0x44')],qs[_0x6920('0x46')](_0x4483ac[_0x6920('0x41')][_0x6920('0x46')]));_0x56cedc[_0x6920('0x45')]=_0x56cedc[_0x6920('0x45')][_0x6920('0x52')]?_0x56cedc[_0x6920('0x45')]:_0x1489c4[_0x6920('0x44')];if(_0x4483ac['query'][_0x6920('0x4c')]){_0x56cedc[_0x6920('0x4d')]=[{'all':!![]}];}_0x56cedc=_[_0x6920('0x53')]({},_0x56cedc,_0x4483ac[_0x6920('0x4b')]);return db['VoiceQueue'][_0x6920('0x54')](_0x56cedc)[_0x6920('0x2b')](handleEntityNotFound(_0x24cfbe,null))[_0x6920('0x2b')](function(_0x231f4c){if(_0x231f4c){var _0x4248bb=_0x231f4c[_0x6920('0x2d')]({'plain':!![]});_0x4248bb=qs['omit'](_0x4248bb,['id',_0x6920('0x5f'),_0x6920('0x60')]);_0x4483ac['body']=_[_0x6920('0x61')](_0x4483ac[_0x6920('0x56')],['id',_0x6920('0x5f'),_0x6920('0x60')]);return db[_0x6920('0x3d')][_0x6920('0x55')](_[_0x6920('0x53')](_0x4248bb,_0x4483ac[_0x6920('0x56')]),{'include':_0x4483ac[_0x6920('0x41')][_0x6920('0x4c')]?[{'all':!![]}]:undefined})[_0x6920('0x2b')](function(_0xe389f2){var _0x15b24d=_0x4483ac[_0x6920('0x57')]['get']({'plain':!![]});if(!_0x15b24d)throw new Error(_0x6920('0x58'));if(_0x15b24d[_0x6920('0x59')]===_0x6920('0x57')){var _0x4bc290=_0xe389f2[_0x6920('0x2d')]({'plain':!![]});var _0x42508f=[{'name':_0x6920('0x2e'),'value':_0x6920('0x2f')},{'name':_0x6920('0x30'),'value':'outbound'}];var _0xc12b4c=_[_0x6920('0x54')](_0x42508f,[_0x6920('0x35'),_0x4bc290['type']])[_0x6920('0x3b')];return db['UserProfileSection']['find']({'where':{'name':_0xc12b4c,'userProfileId':_0x15b24d[_0x6920('0x5b')]},'raw':!![]})['then'](function(_0x194fa3){if(_0x194fa3&&_0x194fa3[_0x6920('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x4bc290[_0x6920('0x3b')],'resourceId':_0x4bc290['id'],'type':_0x194fa3[_0x6920('0x3b')],'sectionId':_0x194fa3['id']},{})[_0x6920('0x2b')](function(){return _0xe389f2;});}else{return _0xe389f2;}})[_0x6920('0x50')](function(_0x3a2175){logger[_0x6920('0x39')](_0x6920('0x5d'),_0x3a2175);throw _0x3a2175;});}return _0xe389f2;});}})[_0x6920('0x2b')](respondWithResult(_0x24cfbe,0xc9))[_0x6920('0x50')](handleError(_0x24cfbe,null));};exports[_0x6920('0x62')]=function(_0x4a1228,_0x4f11b1){if(_0x4a1228[_0x6920('0x56')]['id']){delete _0x4a1228[_0x6920('0x56')]['id'];}return db['VoiceQueue'][_0x6920('0x54')]({'where':{'id':_0x4a1228['params']['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x4f11b1,null))[_0x6920('0x2b')](saveUpdates(_0x4a1228[_0x6920('0x56')],null))[_0x6920('0x2b')](respondWithResult(_0x4f11b1,null))[_0x6920('0x50')](handleError(_0x4f11b1,null));};exports['destroy']=function(_0x568ca4,_0x4b80e9){return db['VoiceQueue'][_0x6920('0x54')]({'where':{'id':_0x568ca4[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x4b80e9,null))[_0x6920('0x2b')](removeEntity(_0x4b80e9,null))['catch'](handleError(_0x4b80e9,null));};exports[_0x6920('0x63')]=function(_0x3e7446,_0x160b6a,_0x17f172){var _0x3f2497={'raw':![],'where':{}};var _0x89a443={};var _0x18be21={'count':0x0,'rows':[]};return db[_0x6920('0x3d')][_0x6920('0x64')]({'where':{'id':_0x3e7446[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x160b6a,null))[_0x6920('0x2b')](function(_0x58e4be){if(_0x58e4be){_0x89a443[_0x6920('0x44')]=_[_0x6920('0x42')](db[_0x6920('0x65')]['rawAttributes']);_0x89a443[_0x6920('0x41')]=_[_0x6920('0x42')](_0x3e7446[_0x6920('0x41')]);_0x89a443[_0x6920('0x49')]=_[_0x6920('0x43')](_0x89a443['model'],_0x89a443[_0x6920('0x41')]);_0x3f2497[_0x6920('0x45')]=_[_0x6920('0x43')](_0x89a443[_0x6920('0x44')],qs['fields'](_0x3e7446[_0x6920('0x41')][_0x6920('0x46')]));_0x3f2497['attributes']=_0x3f2497[_0x6920('0x45')][_0x6920('0x52')]?_0x3f2497['attributes']:_0x89a443[_0x6920('0x44')];if(!_0x3e7446['query'][_0x6920('0x66')](_0x6920('0x47'))){_0x3f2497[_0x6920('0x24')]=qs[_0x6920('0x24')](_0x3e7446[_0x6920('0x41')][_0x6920('0x24')]);_0x3f2497['offset']=qs[_0x6920('0x22')](_0x3e7446[_0x6920('0x41')][_0x6920('0x22')]);}_0x3f2497[_0x6920('0x67')]=qs[_0x6920('0x48')](_0x3e7446[_0x6920('0x41')][_0x6920('0x48')]);_0x3f2497[_0x6920('0x4a')]=qs['filters'](_[_0x6920('0x68')](_0x3e7446['query'],_0x89a443[_0x6920('0x49')]));_0x3f2497[_0x6920('0x4a')][_0x6920('0x69')]=_0x58e4be['id'];if(_0x3e7446['query']['filter']){_0x3f2497['where']=_[_0x6920('0x53')](_0x3f2497['where'],{'$or':_['map'](_0x3f2497['attributes'],function(_0x30e537){var _0x37817f={};_0x37817f[_0x30e537]={'$like':'%'+_0x3e7446[_0x6920('0x41')][_0x6920('0x32')]+'%'};return _0x37817f;})});}_0x3f2497=_[_0x6920('0x53')]({},_0x3f2497,_0x3e7446['options']);return db[_0x6920('0x65')][_0x6920('0x25')]({'where':_0x3f2497[_0x6920('0x4a')]})['then'](function(_0xe1ed18){_0x18be21[_0x6920('0x25')]=_0xe1ed18;if(_0x3e7446['query']['includeAll']){_0x3f2497[_0x6920('0x4d')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3f2497);})[_0x6920('0x2b')](function(_0x349fb5){_0x18be21[_0x6920('0x4f')]=_0x349fb5;return _0x18be21;});}})[_0x6920('0x2b')](respondWithFilteredResult(_0x160b6a,_0x3f2497))['catch'](handleError(_0x160b6a,null));};exports[_0x6920('0x6a')]=function(_0x1d53d4,_0x4e2d4c,_0x1f78df){var _0x30e9f3={'raw':!![],'where':{}};var _0x4d8071={};var _0xfe89f4={'count':0x0,'rows':[]};return db[_0x6920('0x3d')][_0x6920('0x64')]({'where':{'id':_0x1d53d4[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x4e2d4c,null))[_0x6920('0x2b')](function(_0x190aa7){if(_0x190aa7){_0x4d8071[_0x6920('0x44')]=_[_0x6920('0x42')](db[_0x6920('0x6b')][_0x6920('0x3e')]);_0x4d8071[_0x6920('0x41')]=_[_0x6920('0x42')](_0x1d53d4[_0x6920('0x41')]);_0x4d8071[_0x6920('0x49')]=_['intersection'](_0x4d8071[_0x6920('0x44')],_0x4d8071[_0x6920('0x41')]);_0x30e9f3[_0x6920('0x45')]=_['intersection'](_0x4d8071['model'],qs[_0x6920('0x46')](_0x1d53d4['query'][_0x6920('0x46')]));_0x30e9f3[_0x6920('0x45')]=_0x30e9f3[_0x6920('0x45')][_0x6920('0x52')]?_0x30e9f3['attributes']:_0x4d8071[_0x6920('0x44')];if(!_0x1d53d4[_0x6920('0x41')][_0x6920('0x66')](_0x6920('0x47'))){_0x30e9f3['limit']=qs['limit'](_0x1d53d4[_0x6920('0x41')]['limit']);_0x30e9f3[_0x6920('0x22')]=qs[_0x6920('0x22')](_0x1d53d4[_0x6920('0x41')][_0x6920('0x22')]);}_0x30e9f3[_0x6920('0x67')]=qs[_0x6920('0x48')](_0x1d53d4['query'][_0x6920('0x48')]);_0x30e9f3[_0x6920('0x4a')]=qs[_0x6920('0x49')](_[_0x6920('0x68')](_0x1d53d4[_0x6920('0x41')],_0x4d8071[_0x6920('0x49')]));_0x30e9f3['where']['VoiceQueueId']=_0x190aa7['id'];if(_0x1d53d4[_0x6920('0x41')][_0x6920('0x32')]){_0x30e9f3[_0x6920('0x4a')]=_[_0x6920('0x53')](_0x30e9f3[_0x6920('0x4a')],{'$or':_[_0x6920('0x34')](_0x30e9f3[_0x6920('0x45')],function(_0xa01fc9){var _0x2644ef={};_0x2644ef[_0xa01fc9]={'$like':'%'+_0x1d53d4['query'][_0x6920('0x32')]+'%'};return _0x2644ef;})});}_0x30e9f3=_['merge']({},_0x30e9f3,_0x1d53d4['options']);return db[_0x6920('0x6b')][_0x6920('0x25')]({'where':_0x30e9f3[_0x6920('0x4a')]})['then'](function(_0x2dc2e4){_0xfe89f4[_0x6920('0x25')]=_0x2dc2e4;if(_0x1d53d4['query'][_0x6920('0x4c')]){_0x30e9f3['include']=[{'all':!![]}];}return db[_0x6920('0x6b')]['findAll'](_0x30e9f3);})['then'](function(_0x461a87){_0xfe89f4[_0x6920('0x4f')]=_0x461a87;return _0xfe89f4;});}})[_0x6920('0x2b')](respondWithFilteredResult(_0x4e2d4c,_0x30e9f3))[_0x6920('0x50')](handleError(_0x4e2d4c,null));};exports[_0x6920('0x6c')]=function(_0x5560cf,_0x3915e1,_0x56f766){var _0x2f9c4f={'raw':!![],'where':{}};var _0x50fed3={};var _0x2f3b73={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5560cf[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x3915e1,null))[_0x6920('0x2b')](function(_0x447854){if(_0x447854){_0x50fed3[_0x6920('0x44')]=_[_0x6920('0x42')](db[_0x6920('0x6d')][_0x6920('0x3e')]);_0x50fed3['query']=_[_0x6920('0x42')](_0x5560cf[_0x6920('0x41')]);_0x50fed3[_0x6920('0x49')]=_[_0x6920('0x43')](_0x50fed3['model'],_0x50fed3[_0x6920('0x41')]);_0x2f9c4f[_0x6920('0x45')]=_[_0x6920('0x43')](_0x50fed3[_0x6920('0x44')],qs['fields'](_0x5560cf[_0x6920('0x41')][_0x6920('0x46')]));_0x2f9c4f[_0x6920('0x45')]=_0x2f9c4f[_0x6920('0x45')][_0x6920('0x52')]?_0x2f9c4f[_0x6920('0x45')]:_0x50fed3['model'];if(!_0x5560cf['query'][_0x6920('0x66')](_0x6920('0x47'))){_0x2f9c4f[_0x6920('0x24')]=qs[_0x6920('0x24')](_0x5560cf[_0x6920('0x41')]['limit']);_0x2f9c4f[_0x6920('0x22')]=qs[_0x6920('0x22')](_0x5560cf[_0x6920('0x41')][_0x6920('0x22')]);}_0x2f9c4f['order']=qs[_0x6920('0x48')](_0x5560cf[_0x6920('0x41')][_0x6920('0x48')]);_0x2f9c4f['where']=qs[_0x6920('0x49')](_[_0x6920('0x68')](_0x5560cf['query'],_0x50fed3[_0x6920('0x49')]));_0x2f9c4f['where'][_0x6920('0x69')]=_0x447854['id'];if(_0x5560cf['query'][_0x6920('0x32')]){_0x2f9c4f[_0x6920('0x4a')]=_['merge'](_0x2f9c4f['where'],{'$or':_[_0x6920('0x34')](_0x2f9c4f[_0x6920('0x45')],function(_0x263fed){var _0x2dffa3={};_0x2dffa3[_0x263fed]={'$like':'%'+_0x5560cf[_0x6920('0x41')]['filter']+'%'};return _0x2dffa3;})});}_0x2f9c4f=_[_0x6920('0x53')]({},_0x2f9c4f,_0x5560cf[_0x6920('0x4b')]);return db[_0x6920('0x6d')][_0x6920('0x25')]({'where':_0x2f9c4f[_0x6920('0x4a')]})[_0x6920('0x2b')](function(_0x3196bc){_0x2f3b73['count']=_0x3196bc;if(_0x5560cf[_0x6920('0x41')][_0x6920('0x4c')]){_0x2f9c4f['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x6920('0x4e')](_0x2f9c4f);})[_0x6920('0x2b')](function(_0x2da154){_0x2f3b73[_0x6920('0x4f')]=_0x2da154;return _0x2f3b73;});}})[_0x6920('0x2b')](respondWithFilteredResult(_0x3915e1,_0x2f9c4f))[_0x6920('0x50')](handleError(_0x3915e1,null));};exports[_0x6920('0x6e')]=function(_0x4ed45a,_0x1c3791,_0xf64e8f){var _0x53112f={'raw':!![],'where':{}};var _0x1dd8e4={};var _0x2b0ba0={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6920('0x64')]({'where':{'id':_0x4ed45a[_0x6920('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1c3791,null))[_0x6920('0x2b')](function(_0x331205){if(_0x331205){_0x1dd8e4[_0x6920('0x44')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x1dd8e4[_0x6920('0x41')]=_['keys'](_0x4ed45a[_0x6920('0x41')]);_0x1dd8e4['filters']=_['intersection'](_0x1dd8e4[_0x6920('0x44')],_0x1dd8e4['query']);_0x53112f['attributes']=_[_0x6920('0x43')](_0x1dd8e4[_0x6920('0x44')],qs[_0x6920('0x46')](_0x4ed45a['query'][_0x6920('0x46')]));_0x53112f[_0x6920('0x45')]=_0x53112f[_0x6920('0x45')][_0x6920('0x52')]?_0x53112f['attributes']:_0x1dd8e4[_0x6920('0x44')];if(!_0x4ed45a[_0x6920('0x41')]['hasOwnProperty'](_0x6920('0x47'))){_0x53112f['limit']=qs[_0x6920('0x24')](_0x4ed45a[_0x6920('0x41')]['limit']);_0x53112f[_0x6920('0x22')]=qs['offset'](_0x4ed45a[_0x6920('0x41')][_0x6920('0x22')]);}_0x53112f[_0x6920('0x67')]=qs[_0x6920('0x48')](_0x4ed45a[_0x6920('0x41')][_0x6920('0x48')]);_0x53112f['where']=qs[_0x6920('0x49')](_[_0x6920('0x68')](_0x4ed45a[_0x6920('0x41')],_0x1dd8e4[_0x6920('0x49')]));_0x53112f[_0x6920('0x4a')][_0x6920('0x69')]=_0x331205['id'];if(_0x4ed45a[_0x6920('0x41')][_0x6920('0x32')]){_0x53112f[_0x6920('0x4a')]=_['merge'](_0x53112f['where'],{'$or':_[_0x6920('0x34')](_0x53112f[_0x6920('0x45')],function(_0x182b29){var _0x377ed0={};_0x377ed0[_0x182b29]={'$like':'%'+_0x4ed45a[_0x6920('0x41')][_0x6920('0x32')]+'%'};return _0x377ed0;})});}_0x53112f=_['merge']({},_0x53112f,_0x4ed45a['options']);return db[_0x6920('0x6f')][_0x6920('0x25')]({'where':_0x53112f[_0x6920('0x4a')]})[_0x6920('0x2b')](function(_0x2233d5){_0x2b0ba0['count']=_0x2233d5;if(_0x4ed45a[_0x6920('0x41')][_0x6920('0x4c')]){_0x53112f[_0x6920('0x4d')]=[{'all':!![]}];}return db[_0x6920('0x6f')][_0x6920('0x4e')](_0x53112f);})[_0x6920('0x2b')](function(_0x2a70fd){_0x2b0ba0['rows']=_0x2a70fd;return _0x2b0ba0;});}})[_0x6920('0x2b')](respondWithFilteredResult(_0x1c3791,_0x53112f))['catch'](handleError(_0x1c3791,null));};exports['getTeams']=function(_0xa267d9,_0x3f6a1f,_0x4dd9fd){var _0x4e618e={};var _0x2977b2={};var _0xcff624;var _0x4f971c;return db[_0x6920('0x3d')][_0x6920('0x64')]({'where':{'id':_0xa267d9[_0x6920('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3f6a1f,null))[_0x6920('0x2b')](function(_0x2d4b51){if(_0x2d4b51){_0xcff624=_0x2d4b51;_0x2977b2[_0x6920('0x44')]=_['keys'](db[_0x6920('0x70')][_0x6920('0x3e')]);_0x2977b2[_0x6920('0x41')]=_[_0x6920('0x42')](_0xa267d9['query']);_0x2977b2['filters']=_['intersection'](_0x2977b2[_0x6920('0x44')],_0x2977b2[_0x6920('0x41')]);_0x4e618e[_0x6920('0x45')]=_['intersection'](_0x2977b2[_0x6920('0x44')],qs[_0x6920('0x46')](_0xa267d9['query'][_0x6920('0x46')]));_0x4e618e[_0x6920('0x45')]=_0x4e618e['attributes'][_0x6920('0x52')]?_0x4e618e[_0x6920('0x45')]:_0x2977b2['model'];_0x4e618e[_0x6920('0x67')]=qs[_0x6920('0x48')](_0xa267d9[_0x6920('0x41')][_0x6920('0x48')]);_0x4e618e['where']=qs['filters'](_['pick'](_0xa267d9[_0x6920('0x41')],_0x2977b2[_0x6920('0x49')]));if(_0xa267d9[_0x6920('0x41')][_0x6920('0x32')]){_0x4e618e[_0x6920('0x4a')]=_['merge'](_0x4e618e[_0x6920('0x4a')],{'$or':_[_0x6920('0x34')](_0x4e618e[_0x6920('0x45')],function(_0x21b32a){var _0x453124={};_0x453124[_0x21b32a]={'$like':'%'+_0xa267d9[_0x6920('0x41')][_0x6920('0x32')]+'%'};return _0x453124;})});}_0x4e618e=_[_0x6920('0x53')]({},_0x4e618e,_0xa267d9[_0x6920('0x4b')]);return _0xcff624['getTeams'](_0x4e618e);}})['then'](function(_0x5542b2){if(_0x5542b2){_0x4f971c=_0x5542b2[_0x6920('0x52')];if(!_0xa267d9[_0x6920('0x41')]['hasOwnProperty']('nolimit')){_0x4e618e[_0x6920('0x24')]=qs[_0x6920('0x24')](_0xa267d9[_0x6920('0x41')][_0x6920('0x24')]);_0x4e618e[_0x6920('0x22')]=qs[_0x6920('0x22')](_0xa267d9[_0x6920('0x41')][_0x6920('0x22')]);}return _0xcff624[_0x6920('0x71')](_0x4e618e);}})[_0x6920('0x2b')](function(_0x53df6c){if(_0x53df6c){return _0x53df6c?{'count':_0x4f971c,'rows':_0x53df6c}:null;}})[_0x6920('0x2b')](respondWithResult(_0x3f6a1f,null))[_0x6920('0x50')](handleError(_0x3f6a1f,null));};exports[_0x6920('0x72')]=function(_0x1a7eeb,_0x108b41,_0x2af942){var _0x1c1d3d=_0x1a7eeb[_0x6920('0x56')]['teams'];var _0x23dd81=_['map'](_0x1c1d3d,'id');return db[_0x6920('0x70')][_0x6920('0x4e')]({'where':{'id':_0x23dd81},'attributes':['id'],'include':[{'model':db[_0x6920('0x73')],'as':_0x6920('0x74'),'attributes':['id',_0x6920('0x3b'),_0x6920('0x75'),_0x6920('0x76'),'interface'],'raw':!![]}]})[_0x6920('0x2b')](function(_0x21108d){if(_0x21108d){var _0x3be9d0=_[_0x6920('0x77')](_0x21108d,function(_0x235378){var _0x28c7e2=_0x235378[_0x6920('0x2d')]({'plain':!![]});_0x28c7e2[_0x6920('0x74')][_0x6920('0x78')](function(_0x4adca7){_0x4adca7[_0x6920('0x79')]=_[_0x6920('0x54')](_0x1c1d3d,{'id':_0x28c7e2['id']})[_0x6920('0x79')];});return _0x28c7e2[_0x6920('0x74')];});return db[_0x6920('0x3d')]['find']({'where':{'id':_0x1a7eeb[_0x6920('0x5e')]['id']}})['then'](function(_0x19ba78){return db[_0x6920('0x7a')][_0x6920('0x7b')](function(_0x174a3c){return _0x19ba78['addTeams'](_0x23dd81,{'transaction':_0x174a3c})[_0x6920('0x2b')](function(){return BPromise[_0x6920('0x7c')](_0x1c1d3d,function(_0x1e9c8f){return db[_0x6920('0x7d')][_0x6920('0x7e')]({'TeamId':_0x1e9c8f['id'],'VoiceQueueId':_0x1a7eeb[_0x6920('0x5e')]['id'],'penalty':_0x1e9c8f['penalty']},{'transaction':_0x174a3c});});})[_0x6920('0x2b')](function(){return BPromise['each'](_0x3be9d0,function(_0x153f64){return db[_0x6920('0x7f')][_0x6920('0x80')]({'where':{'UserId':_0x153f64['id'],'VoiceQueueId':_0x1a7eeb[_0x6920('0x5e')]['id']},'defaults':{'penalty':_0x153f64[_0x6920('0x79')]},'transaction':_0x174a3c});});})[_0x6920('0x2b')](function(){return BPromise[_0x6920('0x7c')](_[_0x6920('0x32')](_0x3be9d0,{'online':!![]}),function(_0xbeee5a){return db[_0x6920('0x81')][_0x6920('0x7e')]({'membername':_0xbeee5a[_0x6920('0x3b')],'UserId':_0xbeee5a['id'],'queue_name':_0x19ba78['name'],'VoiceQueueId':_0x19ba78['id'],'interface':_[_0x6920('0x82')](_0xbeee5a['interface'])?util[_0x6920('0x83')](_0x6920('0x84'),_0xbeee5a[_0x6920('0x3b')]):_0xbeee5a[_0x6920('0x85')],'paused':_0xbeee5a[_0x6920('0x76')]||![],'penalty':_0xbeee5a[_0x6920('0x79')]},{'transaction':_0x174a3c});});})[_0x6920('0x2b')](function(){_0x3be9d0[_0x6920('0x78')](function(_0x3c2077){socket[_0x6920('0x86')](_0x6920('0x87'),{'UserId':_0x3c2077['id'],'VoiceQueueId':_0x19ba78['id']});});});});});}})[_0x6920('0x2b')](respondWithStatusCode(_0x108b41,null))[_0x6920('0x50')](handleError(_0x108b41,null));};exports[_0x6920('0x88')]=function(_0x527be7,_0x2399eb,_0x934f1){return db[_0x6920('0x70')][_0x6920('0x4e')]({'where':{'id':_0x527be7[_0x6920('0x41')][_0x6920('0x89')]},'attributes':['id'],'include':[{'model':db[_0x6920('0x73')],'as':_0x6920('0x74'),'attributes':['id'],'raw':!![]}]})[_0x6920('0x2b')](handleEntityNotFound(_0x2399eb,null))[_0x6920('0x2b')](function(_0x35bedf){var _0x6d6d6a=_[_0x6920('0x34')](_0x35bedf,'id');var _0xad2cec=[];var _0x47eac6=[];var _0x568136=squel[_0x6920('0x8a')]();_0x568136['field'](_0x6920('0x8b'))[_0x6920('0x8c')](_0x6920('0x8d'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6920('0x4a')](_0x6920('0x8e'),_0x527be7['params']['id']);for(var _0x1e2eb7=0x0;_0x1e2eb7<_0x35bedf[_0x6920('0x52')];_0x1e2eb7+=0x1){let _0x1f22fa=_0x35bedf[_0x1e2eb7];for(var _0x364ab5=0x0;_0x364ab5<_0x1f22fa['Agents'][_0x6920('0x52')];_0x364ab5+=0x1){let _0x2b59fe=_0x1f22fa[_0x6920('0x74')][_0x364ab5];var _0x1d58e3=_0x568136['clone']();_0x1d58e3[_0x6920('0x4a')](_0x6920('0x8f'),_0x2b59fe['id']);_0x47eac6[_0x6920('0x90')](db['sequelize']['query'](_0x1d58e3[_0x6920('0x91')](),{'type':db[_0x6920('0x7a')]['QueryTypes'][_0x6920('0x92')]})[_0x6920('0x2b')](function(_0x352fa6){if(_0x352fa6[_0x6920('0x52')]===0x1){return _0x2b59fe['id'];}else{var _0x1d9130=_[_0x6920('0x93')](_['map'](_0x352fa6,_0x6920('0x94')),function(_0x5e8112){return _['includes'](_0x6d6d6a,_0x5e8112);});if(_0x1d9130){return _0x2b59fe['id'];}}}));}}return BPromise['all'](_0x47eac6)[_0x6920('0x2b')](function(_0x5cd70d){_0xad2cec=_(_0xad2cec)[_0x6920('0x95')](_0x5cd70d)['compact']()[_0x6920('0x35')]();return db[_0x6920('0x3d')]['find']({'where':{'id':_0x527be7[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](function(_0x2bfa3b){return db[_0x6920('0x7a')]['transaction'](function(_0x4b8880){return _0x2bfa3b[_0x6920('0x88')](_0x527be7[_0x6920('0x41')]['ids'],{'transaction':_0x4b8880})[_0x6920('0x2b')](function(){if(!_['isEmpty'](_0xad2cec)){return _0x2bfa3b['removeAgents'](_0xad2cec,{'transaction':_0x4b8880})['then'](function(){return db[_0x6920('0x81')]['destroy']({'where':{'VoiceQueueId':_0x527be7[_0x6920('0x5e')]['id'],'UserId':_0xad2cec},'transaction':_0x4b8880});});}})[_0x6920('0x2b')](function(){_0xad2cec['forEach'](function(_0x20b344){socket[_0x6920('0x86')](_0x6920('0x96'),{'UserId':_0x20b344,'VoiceQueueId':_0x2bfa3b['id']});});});});});});})[_0x6920('0x2b')](respondWithStatusCode(_0x2399eb,null))[_0x6920('0x50')](handleError(_0x2399eb,null));};exports[_0x6920('0x97')]=function(_0x25e21f,_0x566740,_0x3b079d){var _0x2b0389,_0x1680b6;return db[_0x6920('0x3d')][_0x6920('0x54')]({'where':{'id':_0x25e21f[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x566740,null))['then'](function(_0x214948){if(_0x214948){_0x1680b6=_0x214948;return _0x214948['addAgents'](_0x25e21f['body'][_0x6920('0x89')],_[_0x6920('0x61')](_0x25e21f[_0x6920('0x56')],['ids','id'])||{})[_0x6920('0x98')](function(_0x60feef){for(var _0x3e936c=0x0;_0x3e936c<_0x25e21f[_0x6920('0x56')]['ids']['length'];_0x3e936c+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x25e21f['body']['ids'][_0x3e936c]),'VoiceQueueId':Number(_0x25e21f[_0x6920('0x5e')]['id'])});}return _0x60feef;});}})[_0x6920('0x2b')](function(_0x452c9d){_0x2b0389=_0x452c9d||[];if(_0x1680b6){return db['User'][_0x6920('0x4e')]({'where':{'id':_0x25e21f['body']['ids']},'attributes':['id',_0x6920('0x3b'),'online',_0x6920('0x76'),_0x6920('0x85')],'raw':!![]});}})[_0x6920('0x2b')](function(_0x5e5958){if(!_[_0x6920('0x99')](_0x5e5958)){var _0x3d6de1=[];for(var _0x248e07=0x0;_0x248e07<_0x5e5958['length'];_0x248e07++){if(_0x5e5958[_0x248e07][_0x6920('0x75')]){_0x3d6de1[_0x6920('0x90')](db['UserVoiceQueueRt'][_0x6920('0x7e')]({'membername':_0x5e5958[_0x248e07][_0x6920('0x3b')],'UserId':_0x5e5958[_0x248e07]['id'],'queue_name':_0x1680b6[_0x6920('0x3b')],'VoiceQueueId':_0x1680b6['id'],'interface':_[_0x6920('0x82')](_0x5e5958[_0x248e07]['interface'])?util[_0x6920('0x83')](_0x6920('0x84'),_0x5e5958[_0x248e07][_0x6920('0x3b')]):_0x5e5958[_0x248e07]['interface'],'paused':_0x5e5958[_0x248e07][_0x6920('0x76')]||![],'penalty':_0x25e21f[_0x6920('0x56')]['penalty']||0x0}));}}return BPromise['all'](_0x3d6de1);}})[_0x6920('0x2b')](function(){return _0x2b0389;})[_0x6920('0x2b')](respondWithResult(_0x566740,null))['catch'](handleError(_0x566740,null));};exports['removeAgents']=function(_0x3b0c97,_0x41b0c9,_0x15dfc0){return db[_0x6920('0x3d')][_0x6920('0x54')]({'where':{'id':_0x3b0c97[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x41b0c9,null))['then'](function(_0x5e0330){if(_0x5e0330){return _0x5e0330[_0x6920('0x9a')](_0x3b0c97['query'][_0x6920('0x89')])['then'](function(){if(_[_0x6920('0x9b')](_0x3b0c97[_0x6920('0x41')][_0x6920('0x89')])){for(var _0x1b1d78=0x0;_0x1b1d78<_0x3b0c97[_0x6920('0x41')][_0x6920('0x89')][_0x6920('0x52')];_0x1b1d78+=0x1){socket[_0x6920('0x86')](_0x6920('0x96'),{'UserId':Number(_0x3b0c97[_0x6920('0x41')][_0x6920('0x89')][_0x1b1d78]),'VoiceQueueId':Number(_0x3b0c97[_0x6920('0x5e')]['id'])});}}else{socket[_0x6920('0x86')](_0x6920('0x96'),{'UserId':Number(_0x3b0c97['query'][_0x6920('0x89')]),'VoiceQueueId':Number(_0x3b0c97['params']['id'])});}});}})[_0x6920('0x2b')](function(_0x3dd656){return db['UserVoiceQueueRt'][_0x6920('0x2c')]({'where':{'VoiceQueueId':_0x3b0c97[_0x6920('0x5e')]['id'],'UserId':_0x3b0c97['query'][_0x6920('0x89')]}})[_0x6920('0x2b')](function(){return _0x3dd656;});})[_0x6920('0x2b')](respondWithStatusCode(_0x41b0c9,null))[_0x6920('0x50')](handleError(_0x41b0c9,null));};exports[_0x6920('0x9c')]=function(_0x392cda,_0x195573,_0x3e5b14){var _0xc70f40={};var _0x326f96={};var _0x138c2f;var _0x18ba6f;return db[_0x6920('0x3d')][_0x6920('0x64')]({'where':{'id':_0x392cda[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x195573,null))['then'](function(_0x2ee98a){if(_0x2ee98a){_0x138c2f=_0x2ee98a;_0x326f96[_0x6920('0x44')]=_['keys'](db['User'][_0x6920('0x3e')]);_0x326f96['query']=_[_0x6920('0x42')](_0x392cda[_0x6920('0x41')]);_0x326f96['filters']=_[_0x6920('0x43')](_0x326f96[_0x6920('0x44')],_0x326f96[_0x6920('0x41')]);_0xc70f40[_0x6920('0x45')]=_[_0x6920('0x43')](_0x326f96[_0x6920('0x44')],qs[_0x6920('0x46')](_0x392cda[_0x6920('0x41')]['fields']));_0xc70f40['attributes']=_0xc70f40[_0x6920('0x45')][_0x6920('0x52')]?_0xc70f40[_0x6920('0x45')]:_0x326f96[_0x6920('0x44')];_0xc70f40['order']=qs['sort'](_0x392cda[_0x6920('0x41')]['sort']);_0xc70f40[_0x6920('0x4a')]=qs[_0x6920('0x49')](_[_0x6920('0x68')](_0x392cda[_0x6920('0x41')],_0x326f96[_0x6920('0x49')]));if(_0x392cda[_0x6920('0x41')][_0x6920('0x32')]){_0xc70f40[_0x6920('0x4a')]=_[_0x6920('0x53')](_0xc70f40[_0x6920('0x4a')],{'$or':_[_0x6920('0x34')](_0xc70f40[_0x6920('0x45')],function(_0x515a50){var _0x2627b6={};_0x2627b6[_0x515a50]={'$like':'%'+_0x392cda['query']['filter']+'%'};return _0x2627b6;})});}_0xc70f40=_['merge']({},_0xc70f40,_0x392cda['options']);return _0x138c2f[_0x6920('0x9c')](_0xc70f40);}})[_0x6920('0x2b')](function(_0x31f372){if(_0x31f372){_0x18ba6f=_0x31f372[_0x6920('0x52')];if(!_0x392cda[_0x6920('0x41')][_0x6920('0x66')](_0x6920('0x47'))){_0xc70f40[_0x6920('0x24')]=qs[_0x6920('0x24')](_0x392cda[_0x6920('0x41')][_0x6920('0x24')]);_0xc70f40[_0x6920('0x22')]=qs['offset'](_0x392cda[_0x6920('0x41')][_0x6920('0x22')]);}return _0x138c2f['getAgents'](_0xc70f40);}})[_0x6920('0x2b')](function(_0x4708a6){if(_0x4708a6){return _0x4708a6?{'count':_0x18ba6f,'rows':_0x4708a6}:null;}})[_0x6920('0x2b')](respondWithResult(_0x195573,null))[_0x6920('0x50')](handleError(_0x195573,null));};exports['getMembers']=function(_0xca4fdd,_0xf0742f,_0x195592){var _0x5917b4={};var _0x316244={};var _0x13b47a;var _0x7d9ee5;return db[_0x6920('0x3d')][_0x6920('0x64')]({'where':{'id':_0xca4fdd[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0xf0742f,null))[_0x6920('0x2b')](function(_0xf9f273){if(_0xf9f273){_0x13b47a=_0xf9f273;_0x316244['model']=_[_0x6920('0x42')](db['UserVoiceQueueRt']['rawAttributes']);_0x316244[_0x6920('0x41')]=_[_0x6920('0x42')](_0xca4fdd[_0x6920('0x41')]);_0x316244[_0x6920('0x49')]=_[_0x6920('0x43')](_0x316244['model'],_0x316244['query']);_0x5917b4[_0x6920('0x45')]=_['intersection'](_0x316244['model'],qs['fields'](_0xca4fdd[_0x6920('0x41')][_0x6920('0x46')]));_0x5917b4['attributes']=_0x5917b4[_0x6920('0x45')][_0x6920('0x52')]?_0x5917b4[_0x6920('0x45')]:_0x316244[_0x6920('0x44')];_0x5917b4[_0x6920('0x67')]=qs[_0x6920('0x48')](_0xca4fdd[_0x6920('0x41')]['sort']);_0x5917b4[_0x6920('0x4a')]=qs['filters'](_[_0x6920('0x68')](_0xca4fdd[_0x6920('0x41')],_0x316244['filters']));if(_0xca4fdd['query'][_0x6920('0x32')]){_0x5917b4['where']=_[_0x6920('0x53')](_0x5917b4[_0x6920('0x4a')],{'$or':_[_0x6920('0x34')](_0x5917b4[_0x6920('0x45')],function(_0xc2646){var _0x3a6673={};_0x3a6673[_0xc2646]={'$like':'%'+_0xca4fdd['query'][_0x6920('0x32')]+'%'};return _0x3a6673;})});}_0x5917b4=_[_0x6920('0x53')]({},_0x5917b4,_0xca4fdd[_0x6920('0x4b')]);return _0x13b47a[_0x6920('0x9d')](_0x5917b4);}})[_0x6920('0x2b')](function(_0xe4f8c3){if(_0xe4f8c3){_0x7d9ee5=_0xe4f8c3['length'];if(!_0xca4fdd['query'][_0x6920('0x66')](_0x6920('0x47'))){_0x5917b4[_0x6920('0x24')]=qs[_0x6920('0x24')](_0xca4fdd['query'][_0x6920('0x24')]);_0x5917b4['offset']=qs['offset'](_0xca4fdd['query'][_0x6920('0x22')]);}return _0x13b47a[_0x6920('0x9d')](_0x5917b4);}})[_0x6920('0x2b')](function(_0x3a482b){return _0x3a482b?{'count':_0x7d9ee5,'rows':_0x3a482b}:null;})[_0x6920('0x2b')](respondWithResult(_0xf0742f,null))[_0x6920('0x50')](handleError(_0xf0742f,null));};exports[_0x6920('0x9e')]=function(_0x435479,_0x5e2d04,_0x587266){var _0x5926ed={};var _0x1b59da={};var _0x4d66c3;var _0x536f40;return db[_0x6920('0x3d')][_0x6920('0x64')]({'where':{'id':_0x435479[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x5e2d04,null))[_0x6920('0x2b')](function(_0x36a755){if(_0x36a755){_0x4d66c3=_0x36a755;_0x1b59da[_0x6920('0x44')]=_['keys'](db['CmList'][_0x6920('0x3e')]);_0x1b59da[_0x6920('0x41')]=_['keys'](_0x435479['query']);_0x1b59da[_0x6920('0x49')]=_[_0x6920('0x43')](_0x1b59da[_0x6920('0x44')],_0x1b59da[_0x6920('0x41')]);_0x5926ed[_0x6920('0x45')]=_[_0x6920('0x43')](_0x1b59da[_0x6920('0x44')],qs[_0x6920('0x46')](_0x435479[_0x6920('0x41')]['fields']));_0x5926ed[_0x6920('0x45')]=_0x5926ed[_0x6920('0x45')][_0x6920('0x52')]?_0x5926ed['attributes']:_0x1b59da[_0x6920('0x44')];_0x5926ed[_0x6920('0x67')]=qs[_0x6920('0x48')](_0x435479[_0x6920('0x41')][_0x6920('0x48')]);_0x5926ed[_0x6920('0x4a')]=qs[_0x6920('0x49')](_['pick'](_0x435479[_0x6920('0x41')],_0x1b59da[_0x6920('0x49')]));if(_0x435479[_0x6920('0x41')][_0x6920('0x32')]){_0x5926ed[_0x6920('0x4a')]=_[_0x6920('0x53')](_0x5926ed[_0x6920('0x4a')],{'$or':_[_0x6920('0x34')](_0x5926ed[_0x6920('0x45')],function(_0xa964cd){var _0xcf5946={};_0xcf5946[_0xa964cd]={'$like':'%'+_0x435479[_0x6920('0x41')]['filter']+'%'};return _0xcf5946;})});}_0x5926ed=_['merge']({},_0x5926ed,_0x435479[_0x6920('0x4b')]);return _0x4d66c3[_0x6920('0x9e')](_0x5926ed);}})[_0x6920('0x2b')](function(_0x5f0893){if(_0x5f0893){_0x536f40=_0x5f0893[_0x6920('0x52')];if(!_0x435479[_0x6920('0x41')][_0x6920('0x66')]('nolimit')){_0x5926ed[_0x6920('0x24')]=qs['limit'](_0x435479['query']['limit']);_0x5926ed[_0x6920('0x22')]=qs[_0x6920('0x22')](_0x435479[_0x6920('0x41')][_0x6920('0x22')]);}return _0x4d66c3['getLists'](_0x5926ed);}})[_0x6920('0x2b')](function(_0x36287b){if(_0x36287b){return _0x36287b?{'count':_0x536f40,'rows':_0x36287b}:null;}})[_0x6920('0x2b')](respondWithResult(_0x5e2d04,null))[_0x6920('0x50')](handleError(_0x5e2d04,null));};exports[_0x6920('0x9f')]=function(_0x4b40b9,_0x426fcf,_0x118e8f){var _0x284eac=moment()[_0x6920('0x83')]('YYYY-MM-DD\x20HH:mm:ss');var _0xbd34d2,_0x1c9012;return db['VoiceQueue'][_0x6920('0x54')]({'where':{'id':_0x4b40b9[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x426fcf,null))['then'](function(_0x4f2c8b){if(_0x4f2c8b){_0x1c9012=_0x4f2c8b;return _0x4f2c8b[_0x6920('0x9f')](_0x4b40b9['body']['ids'],_['omit'](_0x4b40b9[_0x6920('0x56')],['ids','id'])||{});}return null;})[_0x6920('0x98')](function(_0x1df35b){var _0x217256;_0xbd34d2=_0x1df35b||[];var _0x229852=[];if(_0x1df35b){for(var _0x3a9982=0x0;_0x3a9982<_0x1df35b[_0x6920('0x52')];_0x3a9982+=0x1){var _0x7bf194=_0x1df35b[_0x3a9982][_0x6920('0x2d')]({'plain':!![]});_0x1c9012[_0x6920('0xa0')]=_0x4b40b9[_0x6920('0x56')]['dialCheckDuplicateType']?_0x4b40b9[_0x6920('0x56')][_0x6920('0xa0')]:_0x1c9012['dialCheckDuplicateType'];switch(_0x1c9012[_0x6920('0xa0')]){case _0x6920('0xa1'):_0x217256=squel[_0x6920('0xa2')]()[_0x6920('0xa3')](_0x6920('0xa4'))[_0x6920('0xa5')]([_0x6920('0xa6'),_0x6920('0xa7'),_0x6920('0xa8'),'ListId','VoiceQueueId',_0x6920('0x5f'),_0x6920('0x60')],squel[_0x6920('0x8a')]()[_0x6920('0xa9')](_0x6920('0xa6'),_0x6920('0xa6'))[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27',_0x6920('0xa7'))[_0x6920('0xa9')]('id','ContactId')['field'](_0x7bf194[_0x6920('0xaa')]['toString'](),_0x6920('0xab'))['field'](_0x4b40b9['params']['id']['toString'](),_0x6920('0x69'))[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27',_0x6920('0x5f'))[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27',_0x6920('0x60'))['from'](_0x6920('0xac'))[_0x6920('0x4a')](_0x6920('0xad'))[_0x6920('0x4a')](_0x6920('0xae'),_0x7bf194[_0x6920('0xaa')][_0x6920('0x91')]())['where'](_0x6920('0xaf'))[_0x6920('0x4a')](_0x6920('0xb0'),squel[_0x6920('0x8a')]()[_0x6920('0xa9')](_0x6920('0xb1'))['from'](_0x6920('0xb2'))[_0x6920('0x4a')](_0x6920('0x8e'),_0x4b40b9[_0x6920('0x5e')]['id'][_0x6920('0x91')]()))['where'](_0x6920('0xb0'),squel['select']()[_0x6920('0xa9')](_0x6920('0xb3'))[_0x6920('0x8c')](_0x6920('0xa4'))[_0x6920('0x4a')](_0x6920('0x8e'),_0x4b40b9[_0x6920('0x5e')]['id'][_0x6920('0x91')]())))[_0x6920('0x91')]();break;case _0x6920('0xb4'):_0x217256=squel[_0x6920('0xa2')]()[_0x6920('0xa3')]('cm_hopper')[_0x6920('0xa5')](['phone',_0x6920('0xa7'),_0x6920('0xa8'),_0x6920('0xab'),'VoiceQueueId',_0x6920('0x5f'),_0x6920('0x60')],squel[_0x6920('0x8a')]()[_0x6920('0xa9')](_0x6920('0xa6'),_0x6920('0xa6'))[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27',_0x6920('0xa7'))[_0x6920('0xa9')]('id','ContactId')[_0x6920('0xa9')](_0x7bf194[_0x6920('0xaa')][_0x6920('0x91')](),'ListId')['field'](_0x4b40b9['params']['id'][_0x6920('0x91')](),_0x6920('0x69'))['field']('\x27'+_0x284eac+'\x27',_0x6920('0x5f'))[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27',_0x6920('0x60'))[_0x6920('0x8c')](_0x6920('0xac'))[_0x6920('0x4a')](_0x6920('0xad'))['where'](_0x6920('0xae'),_0x7bf194['CmListId']['toString']())[_0x6920('0x4a')](_0x6920('0xaf'))[_0x6920('0x4a')](_0x6920('0xb0'),squel['select']()[_0x6920('0xa9')](_0x6920('0xb3'))[_0x6920('0x8c')](_0x6920('0xa4'))[_0x6920('0x4a')](_0x6920('0x8e'),_0x4b40b9[_0x6920('0x5e')]['id'][_0x6920('0x91')]())))['toString']();break;default:_0x217256=squel['insert']()['into']('cm_hopper')[_0x6920('0xa5')]([_0x6920('0xa6'),_0x6920('0xa7'),_0x6920('0xa8'),_0x6920('0xab'),_0x6920('0x69'),_0x6920('0x5f'),_0x6920('0x60')],squel['select']()['field'](_0x6920('0xa6'),_0x6920('0xa6'))['field']('\x27'+_0x284eac+'\x27','scheduledAt')['field']('id',_0x6920('0xa8'))['field'](_0x7bf194['CmListId'][_0x6920('0x91')](),_0x6920('0xab'))[_0x6920('0xa9')](_0x4b40b9['params']['id']['toString'](),_0x6920('0x69'))[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27','createdAt')[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27','updatedAt')[_0x6920('0x8c')](_0x6920('0xac'))['where']('deletedAt\x20IS\x20NULL')[_0x6920('0x4a')](_0x6920('0xae'),_0x7bf194['CmListId']['toString']())[_0x6920('0x4a')](_0x6920('0xaf')))[_0x6920('0x91')]();}_0x229852['push'](db[_0x6920('0x7a')][_0x6920('0x41')](_0x217256));}return BPromise[_0x6920('0xb5')](_0x229852);}})[_0x6920('0x2b')](function(){var _0x1331a5=[];var _0x32912f=squel[_0x6920('0xa2')]()[_0x6920('0xa3')](_0x6920('0xb6'))[_0x6920('0xa5')]([_0x6920('0xb7'),_0x6920('0xa6'),_0x6920('0xb8'),_0x6920('0x5f'),_0x6920('0x60')],squel[_0x6920('0x8a')]()[_0x6920('0xa9')](_0x6920('0xb9'))[_0x6920('0xa9')]('ci.item')[_0x6920('0xa9')]('ci.OrderBy+1')[_0x6920('0xa9')]('\x27'+_0x284eac+'\x27','createdAt')['field']('\x27'+_0x284eac+'\x27',_0x6920('0x60'))[_0x6920('0x8c')]('cm_contact_has_items','ci')[_0x6920('0xba')](_0x6920('0xa4'),'h',_0x6920('0xbb'))['where']('h.scheduledat=?',_0x284eac)['where'](_0x6920('0xbc'),_0x6920('0xbd')))['toString']();_0x1331a5[_0x6920('0x90')](db[_0x6920('0x7a')][_0x6920('0x41')](_0x32912f));return BPromise[_0x6920('0xb5')](_0x1331a5);})[_0x6920('0x2b')](function(){return _0xbd34d2;})[_0x6920('0x2b')](respondWithResult(_0x426fcf,null))[_0x6920('0x50')](handleError(_0x426fcf,null));};exports['removeLists']=function(_0xf0165c,_0x95302c,_0x2f5c07){return db[_0x6920('0x3d')][_0x6920('0x54')]({'where':{'id':_0xf0165c[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x95302c,null))[_0x6920('0x2b')](function(_0x9e3ca9){if(_0x9e3ca9){return _0x9e3ca9[_0x6920('0xbe')](_0xf0165c[_0x6920('0x41')]['ids']);}})[_0x6920('0x2b')](function(_0x13960b){if(_0x13960b){return db[_0x6920('0x65')]['destroy']({'where':{'ListId':_0xf0165c[_0x6920('0x41')][_0x6920('0x89')],'VoiceQueueId':_0xf0165c[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](function(){return _0x13960b;});}})[_0x6920('0x2b')](respondWithStatusCode(_0x95302c,null))[_0x6920('0x50')](handleError(_0x95302c,null));};exports[_0x6920('0xbf')]=function(_0x5e3625,_0x3857ec,_0x29b987){var _0x21914d={};var _0x2a5201={};var _0x24af5a;var _0x24a559;return db[_0x6920('0x3d')][_0x6920('0x64')]({'where':{'id':_0x5e3625[_0x6920('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3857ec,null))[_0x6920('0x2b')](function(_0x10ae03){if(_0x10ae03){_0x24af5a=_0x10ae03;_0x2a5201['model']=_[_0x6920('0x42')](db[_0x6920('0xc0')][_0x6920('0x3e')]);_0x2a5201[_0x6920('0x41')]=_['keys'](_0x5e3625[_0x6920('0x41')]);_0x2a5201[_0x6920('0x49')]=_['intersection'](_0x2a5201[_0x6920('0x44')],_0x2a5201[_0x6920('0x41')]);_0x21914d[_0x6920('0x45')]=_[_0x6920('0x43')](_0x2a5201['model'],qs[_0x6920('0x46')](_0x5e3625[_0x6920('0x41')][_0x6920('0x46')]));_0x21914d['attributes']=_0x21914d[_0x6920('0x45')][_0x6920('0x52')]?_0x21914d[_0x6920('0x45')]:_0x2a5201[_0x6920('0x44')];_0x21914d[_0x6920('0x67')]=qs[_0x6920('0x48')](_0x5e3625['query'][_0x6920('0x48')]);_0x21914d[_0x6920('0x4a')]=qs[_0x6920('0x49')](_[_0x6920('0x68')](_0x5e3625[_0x6920('0x41')],_0x2a5201[_0x6920('0x49')]));if(_0x5e3625[_0x6920('0x41')][_0x6920('0x32')]){_0x21914d['where']=_[_0x6920('0x53')](_0x21914d[_0x6920('0x4a')],{'$or':_[_0x6920('0x34')](_0x21914d[_0x6920('0x45')],function(_0x58bd1f){var _0x30cb4d={};_0x30cb4d[_0x58bd1f]={'$like':'%'+_0x5e3625[_0x6920('0x41')]['filter']+'%'};return _0x30cb4d;})});}_0x21914d=_[_0x6920('0x53')]({},_0x21914d,_0x5e3625[_0x6920('0x4b')]);return _0x24af5a[_0x6920('0xbf')](_0x21914d);}})[_0x6920('0x2b')](function(_0x1b29c7){if(_0x1b29c7){_0x24a559=_0x1b29c7[_0x6920('0x52')];if(!_0x5e3625[_0x6920('0x41')][_0x6920('0x66')](_0x6920('0x47'))){_0x21914d[_0x6920('0x24')]=qs['limit'](_0x5e3625[_0x6920('0x41')]['limit']);_0x21914d[_0x6920('0x22')]=qs['offset'](_0x5e3625[_0x6920('0x41')]['offset']);}return _0x24af5a[_0x6920('0xbf')](_0x21914d);}})[_0x6920('0x2b')](function(_0x2e59ad){if(_0x2e59ad){return _0x2e59ad?{'count':_0x24a559,'rows':_0x2e59ad}:null;}})[_0x6920('0x2b')](respondWithResult(_0x3857ec,null))[_0x6920('0x50')](handleError(_0x3857ec,null));};exports[_0x6920('0xc1')]=function(_0x134524,_0x42aa96,_0x100d6a){var _0x8558f,_0xd1745f;return db[_0x6920('0x3d')][_0x6920('0x54')]({'where':{'id':_0x134524[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x42aa96,null))[_0x6920('0x2b')](function(_0x5abcc8){if(_0x5abcc8){_0xd1745f=_0x5abcc8;return _0x5abcc8[_0x6920('0xc1')](_0x134524[_0x6920('0x56')][_0x6920('0x89')],_[_0x6920('0x61')](_0x134524['body'],[_0x6920('0x89'),'id'])||{});}return null;})[_0x6920('0x98')](function(_0x5d7184){var _0x3a019c;_0x8558f=_0x5d7184||[];var _0x65febb=[];if(_0x5d7184){for(var _0x1e1608=0x0;_0x1e1608<_0x5d7184[_0x6920('0x52')];_0x1e1608+=0x1){var _0x40a6a4=_0x5d7184[_0x1e1608]['get']({'plain':!![]});_0x3a019c=squel['insert']()['into'](_0x6920('0xc2'))[_0x6920('0xa5')](['phone',_0x6920('0xa8'),_0x6920('0xab'),'VoiceQueueId',_0x6920('0x5f'),'updatedAt'],squel[_0x6920('0x8a')]()[_0x6920('0xa9')]('phone','phone')[_0x6920('0xa9')]('id',_0x6920('0xa8'))['field'](_0x40a6a4[_0x6920('0xaa')][_0x6920('0x91')](),_0x6920('0xab'))[_0x6920('0xa9')](_0x134524[_0x6920('0x5e')]['id'][_0x6920('0x91')](),'VoiceQueueId')['field'](_0x6920('0xc3'),_0x6920('0x5f'))['field']('NOW()',_0x6920('0x60'))[_0x6920('0x8c')](_0x6920('0xac'))[_0x6920('0x4a')](_0x6920('0xad'))[_0x6920('0x4a')](_0x6920('0xae'),_0x40a6a4[_0x6920('0xaa')][_0x6920('0x91')]())['where'](_0x6920('0xaf')))['toString']();_0x65febb[_0x6920('0x90')](db['sequelize'][_0x6920('0x41')](_0x3a019c));}return BPromise['all'](_0x65febb);}})[_0x6920('0x2b')](function(){return _0x8558f;})[_0x6920('0x2b')](respondWithResult(_0x42aa96,null))[_0x6920('0x50')](handleError(_0x42aa96,null));};exports[_0x6920('0xc4')]=function(_0x175ecd,_0x1bf8f1,_0x2ff08f){return db['VoiceQueue'][_0x6920('0x54')]({'where':{'id':_0x175ecd[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](handleEntityNotFound(_0x1bf8f1,null))[_0x6920('0x2b')](function(_0x20b6ac){if(_0x20b6ac){return _0x20b6ac[_0x6920('0xc4')](_0x175ecd[_0x6920('0x41')]['ids']);}})[_0x6920('0x2b')](function(_0x278029){if(_0x278029){return db['CmHopperBlack'][_0x6920('0x2c')]({'where':{'ListId':_0x175ecd[_0x6920('0x41')][_0x6920('0x89')],'VoiceQueueId':_0x175ecd[_0x6920('0x5e')]['id']}})[_0x6920('0x2b')](function(){return _0x278029;});}})[_0x6920('0x2b')](respondWithStatusCode(_0x1bf8f1,null))[_0x6920('0x50')](handleError(_0x1bf8f1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index c488bf1..b6f08a5 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 _0x0b53=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue'];(function(_0x2ed511,_0x3be079){var _0x10dd72=function(_0x42fd1b){while(--_0x42fd1b){_0x2ed511['push'](_0x2ed511['shift']());}};_0x10dd72(++_0x3be079);}(_0x0b53,0x9f));var _0x30b5=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x0b53[_0x25248b];return _0x509939;};'use strict';var EventEmitter=require(_0x30b5('0x0'));var VoiceQueue=require(_0x30b5('0x1'))['db'][_0x30b5('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x30b5('0x3')](0x0);var events={'afterCreate':_0x30b5('0x4'),'afterUpdate':_0x30b5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48007b){return function(_0x4a5cbf,_0x44b3a9,_0x1de935){VoiceQueueEvents[_0x30b5('0x6')](_0x48007b+':'+_0x4a5cbf['id'],_0x4a5cbf);VoiceQueueEvents['emit'](_0x48007b,_0x4a5cbf);_0x1de935(null);};}for(var e in events){if(events[_0x30b5('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x30b5('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xd6bd=['emit','exports','events','VoiceQueue','setMaxListeners','update','remove'];(function(_0x51da98,_0x56c0d8){var _0x324051=function(_0x5916f4){while(--_0x5916f4){_0x51da98['push'](_0x51da98['shift']());}};_0x324051(++_0x56c0d8);}(_0xd6bd,0x175));var _0xdd6b=function(_0x36b9a6,_0x264956){_0x36b9a6=_0x36b9a6-0x0;var _0x3177a9=_0xd6bd[_0x36b9a6];return _0x3177a9;};'use strict';var EventEmitter=require(_0xdd6b('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xdd6b('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdd6b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdd6b('0x3'),'afterDestroy':_0xdd6b('0x4')};function emitEvent(_0x49eda5){return function(_0x2aa746,_0x82b146,_0x45c08a){VoiceQueueEvents[_0xdd6b('0x5')](_0x49eda5+':'+_0x2aa746['id'],_0x2aa746);VoiceQueueEvents[_0xdd6b('0x5')](_0x49eda5,_0x2aa746);_0x45c08a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xdd6b('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index fb202a2..79db585 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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2e9c18,_0xb531ee){var _0x1ee3c7=function(_0x49a2bf){while(--_0x49a2bf){_0x2e9c18['push'](_0x2e9c18['shift']());}};_0x1ee3c7(++_0xb531ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x53bb79,_0x3cf3be){var _0x4ea549=function(_0x4d5dc2){while(--_0x4d5dc2){_0x53bb79['push'](_0x53bb79['shift']());}};_0x4ea549(++_0x3cf3be);}(_0xedd9,0xfc));var _0x9edd=function(_0xea046b,_0xe5834e){_0xea046b=_0xea046b-0x0;var _0x481a80=_0xedd9[_0xea046b];return _0x481a80;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),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 18e3398..dd9cf51 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 _0xfd4c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','redis','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','debug','stringify','catch','ShowVoiceQueue','find','lodash','util','moment'];(function(_0x49b153,_0x194075){var _0x127ef2=function(_0x2338e1){while(--_0x2338e1){_0x49b153['push'](_0x49b153['shift']());}};_0x127ef2(++_0x194075);}(_0xfd4c,0x12d));var _0xcfd4=function(_0x269c2c,_0x2d6b1d){_0x269c2c=_0x269c2c-0x0;var _0x27644e=_0xfd4c[_0x269c2c];return _0x27644e;};'use strict';var _=require(_0xcfd4('0x0'));var util=require(_0xcfd4('0x1'));var moment=require(_0xcfd4('0x2'));var BPromise=require(_0xcfd4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfd4('0x4'));var db=require(_0xcfd4('0x5'))['db'];var utils=require(_0xcfd4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcfd4('0x7'));var jayson=require(_0xcfd4('0x8'));var client=jayson[_0xcfd4('0x9')][_0xcfd4('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xcfd4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfd4('0xc')]));require(_0xcfd4('0xd'))['register'](socket);function respondWithRpcPromise(_0x4295d5,_0x364836,_0x3bf5cb){return new BPromise(function(_0x3ee50f,_0x390ab0){return client[_0xcfd4('0xe')](_0x4295d5,_0x3bf5cb)[_0xcfd4('0xf')](function(_0x23ecf3){logger[_0xcfd4('0x10')](_0xcfd4('0x11'),_0x364836,'request\x20sent');logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x364836,_0xcfd4('0x12'),JSON['stringify'](_0x23ecf3));if(_0x23ecf3[_0xcfd4('0x13')]){if(_0x23ecf3['error'][_0xcfd4('0x14')]===0x1f4){logger[_0xcfd4('0x13')](_0xcfd4('0x11'),_0x364836,_0x23ecf3[_0xcfd4('0x13')][_0xcfd4('0x15')]);return _0x390ab0(_0x23ecf3[_0xcfd4('0x13')][_0xcfd4('0x15')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x364836,_0x23ecf3[_0xcfd4('0x13')]['message']);return _0x3ee50f(_0x23ecf3[_0xcfd4('0x13')][_0xcfd4('0x15')]);}else{logger[_0xcfd4('0x10')](_0xcfd4('0x11'),_0x364836,_0xcfd4('0x12'));_0x3ee50f(_0x23ecf3[_0xcfd4('0x16')][_0xcfd4('0x15')]);}})['catch'](function(_0x56a5da){logger[_0xcfd4('0x13')](_0xcfd4('0x11'),_0x364836,_0x56a5da);_0x390ab0(_0x56a5da);});});}exports[_0xcfd4('0x17')]=function(_0x378b73){var _0x30b09a=this;return new Promise(function(_0x4b7e5e,_0x5c0e2b){return db[_0xcfd4('0x18')][_0xcfd4('0x19')]({'raw':_0x378b73[_0xcfd4('0x1a')]?_0x378b73[_0xcfd4('0x1a')][_0xcfd4('0x1b')]===undefined?!![]:![]:!![],'where':_0x378b73[_0xcfd4('0x1a')]?_0x378b73[_0xcfd4('0x1a')][_0xcfd4('0x1c')]||null:null,'attributes':_0x378b73['options']?_0x378b73['options'][_0xcfd4('0x1d')]||null:null,'limit':_0x378b73[_0xcfd4('0x1a')]?_0x378b73[_0xcfd4('0x1a')]['limit']||null:null,'include':_0x378b73[_0xcfd4('0x1a')]?_0x378b73[_0xcfd4('0x1a')][_0xcfd4('0x1e')]?_[_0xcfd4('0x1f')](_0x378b73['options'][_0xcfd4('0x1e')],function(_0x3be072){return{'model':db[_0x3be072[_0xcfd4('0x20')]],'as':_0x3be072['as'],'attributes':_0x3be072[_0xcfd4('0x1d')],'include':_0x3be072[_0xcfd4('0x1e')]?_[_0xcfd4('0x1f')](_0x3be072['include'],function(_0x8224fc){return{'model':db[_0x8224fc['model']],'as':_0x8224fc['as'],'attributes':_0x8224fc[_0xcfd4('0x1d')],'include':_0x8224fc[_0xcfd4('0x1e')]?_[_0xcfd4('0x1f')](_0x8224fc[_0xcfd4('0x1e')],function(_0x18209c){return{'model':db[_0x18209c[_0xcfd4('0x20')]],'as':_0x18209c['as'],'attributes':_0x18209c[_0xcfd4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b9136){logger['info']('GetVoiceQueue',_0x378b73);logger[_0xcfd4('0x21')](_0xcfd4('0x17'),_0x378b73,JSON[_0xcfd4('0x22')](_0x2b9136));_0x4b7e5e(_0x2b9136);})[_0xcfd4('0x23')](function(_0x19b637){logger['error'](_0xcfd4('0x17'),_0x19b637['message'],_0x378b73);_0x5c0e2b(_0x30b09a[_0xcfd4('0x13')](0x1f4,_0x19b637['message']));});});};exports[_0xcfd4('0x24')]=function(_0x420221){var _0x391923=this;return new Promise(function(_0xbf85ff,_0x406ee1){return db['VoiceQueue'][_0xcfd4('0x25')]({'raw':_0x420221['options']?_0x420221[_0xcfd4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x420221[_0xcfd4('0x1a')]?_0x420221[_0xcfd4('0x1a')][_0xcfd4('0x1c')]||null:null,'attributes':_0x420221['options']?_0x420221[_0xcfd4('0x1a')][_0xcfd4('0x1d')]||null:null,'include':_0x420221['options']?_0x420221[_0xcfd4('0x1a')][_0xcfd4('0x1e')]?_[_0xcfd4('0x1f')](_0x420221[_0xcfd4('0x1a')][_0xcfd4('0x1e')],function(_0x5a6aba){return{'model':db[_0x5a6aba[_0xcfd4('0x20')]],'as':_0x5a6aba['as'],'attributes':_0x5a6aba[_0xcfd4('0x1d')],'include':_0x5a6aba['include']?_[_0xcfd4('0x1f')](_0x5a6aba[_0xcfd4('0x1e')],function(_0xd6985b){return{'model':db[_0xd6985b['model']],'as':_0xd6985b['as'],'attributes':_0xd6985b['attributes'],'include':_0xd6985b[_0xcfd4('0x1e')]?_['map'](_0xd6985b['include'],function(_0x3609d3){return{'model':db[_0x3609d3[_0xcfd4('0x20')]],'as':_0x3609d3['as'],'attributes':_0x3609d3[_0xcfd4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcfd4('0xf')](function(_0x319b76){logger['info'](_0xcfd4('0x24'),_0x420221);logger[_0xcfd4('0x21')](_0xcfd4('0x24'),_0x420221,JSON['stringify'](_0x319b76));_0xbf85ff(_0x319b76);})[_0xcfd4('0x23')](function(_0x4b92b4){logger[_0xcfd4('0x13')](_0xcfd4('0x24'),_0x4b92b4[_0xcfd4('0x15')],_0x420221);_0x406ee1(_0x391923[_0xcfd4('0x13')](0x1f4,_0x4b92b4[_0xcfd4('0x15')]));});});}; \ No newline at end of file +var _0x6679=['model','find','raw','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','where','limit','include','map','attributes'];(function(_0x174283,_0x3fd836){var _0x139f1a=function(_0xfe1f95){while(--_0xfe1f95){_0x174283['push'](_0x174283['shift']());}};_0x139f1a(++_0x3fd836);}(_0x6679,0x1df));var _0x9667=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x6679[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x9667('0x0'));var util=require('util');var moment=require(_0x9667('0x1'));var BPromise=require(_0x9667('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9667('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9667('0x4'));var config=require(_0x9667('0x5'));var jayson=require(_0x9667('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x9667('0x7')]=_[_0x9667('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9667('0x9'))(new Redis(config[_0x9667('0x7')]));require('./voiceQueue.socket')[_0x9667('0xa')](socket);function respondWithRpcPromise(_0x11ba45,_0x54a69b,_0x3feb3c){return new BPromise(function(_0x8c53bf,_0x4da50b){return client[_0x9667('0xb')](_0x11ba45,_0x3feb3c)[_0x9667('0xc')](function(_0x3ee881){logger[_0x9667('0xd')](_0x9667('0xe'),_0x54a69b,_0x9667('0xf'));logger[_0x9667('0x10')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x54a69b,'request\x20sent',JSON[_0x9667('0x11')](_0x3ee881));if(_0x3ee881['error']){if(_0x3ee881[_0x9667('0x12')][_0x9667('0x13')]===0x1f4){logger[_0x9667('0x12')](_0x9667('0xe'),_0x54a69b,_0x3ee881[_0x9667('0x12')][_0x9667('0x14')]);return _0x4da50b(_0x3ee881[_0x9667('0x12')][_0x9667('0x14')]);}logger[_0x9667('0x12')](_0x9667('0xe'),_0x54a69b,_0x3ee881[_0x9667('0x12')][_0x9667('0x14')]);return _0x8c53bf(_0x3ee881['error'][_0x9667('0x14')]);}else{logger['info'](_0x9667('0xe'),_0x54a69b,_0x9667('0xf'));_0x8c53bf(_0x3ee881[_0x9667('0x15')]['message']);}})[_0x9667('0x16')](function(_0x1396fa){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x54a69b,_0x1396fa);_0x4da50b(_0x1396fa);});});}exports[_0x9667('0x17')]=function(_0x28faa7){var _0x4b2d29=this;return new Promise(function(_0x24851f,_0x15519e){return db[_0x9667('0x18')]['findAll']({'raw':_0x28faa7[_0x9667('0x19')]?_0x28faa7['options']['raw']===undefined?!![]:![]:!![],'where':_0x28faa7[_0x9667('0x19')]?_0x28faa7['options'][_0x9667('0x1a')]||null:null,'attributes':_0x28faa7[_0x9667('0x19')]?_0x28faa7[_0x9667('0x19')]['attributes']||null:null,'limit':_0x28faa7[_0x9667('0x19')]?_0x28faa7['options'][_0x9667('0x1b')]||null:null,'include':_0x28faa7[_0x9667('0x19')]?_0x28faa7[_0x9667('0x19')][_0x9667('0x1c')]?_[_0x9667('0x1d')](_0x28faa7[_0x9667('0x19')][_0x9667('0x1c')],function(_0x16a29f){return{'model':db[_0x16a29f['model']],'as':_0x16a29f['as'],'attributes':_0x16a29f[_0x9667('0x1e')],'include':_0x16a29f['include']?_[_0x9667('0x1d')](_0x16a29f[_0x9667('0x1c')],function(_0x59c2bc){return{'model':db[_0x59c2bc[_0x9667('0x1f')]],'as':_0x59c2bc['as'],'attributes':_0x59c2bc[_0x9667('0x1e')],'include':_0x59c2bc[_0x9667('0x1c')]?_[_0x9667('0x1d')](_0x59c2bc[_0x9667('0x1c')],function(_0x37b5fe){return{'model':db[_0x37b5fe['model']],'as':_0x37b5fe['as'],'attributes':_0x37b5fe['attributes']};}):[]};}):[]};}):[]:[]})[_0x9667('0xc')](function(_0x3c837b){logger[_0x9667('0xd')](_0x9667('0x17'),_0x28faa7);logger[_0x9667('0x10')](_0x9667('0x17'),_0x28faa7,JSON[_0x9667('0x11')](_0x3c837b));_0x24851f(_0x3c837b);})[_0x9667('0x16')](function(_0x5a140e){logger[_0x9667('0x12')](_0x9667('0x17'),_0x5a140e[_0x9667('0x14')],_0x28faa7);_0x15519e(_0x4b2d29[_0x9667('0x12')](0x1f4,_0x5a140e['message']));});});};exports['ShowVoiceQueue']=function(_0xbfd29d){var _0x17b97a=this;return new Promise(function(_0x4a8007,_0x480df7){return db[_0x9667('0x18')][_0x9667('0x20')]({'raw':_0xbfd29d['options']?_0xbfd29d[_0x9667('0x19')][_0x9667('0x21')]===undefined?!![]:![]:!![],'where':_0xbfd29d['options']?_0xbfd29d[_0x9667('0x19')][_0x9667('0x1a')]||null:null,'attributes':_0xbfd29d['options']?_0xbfd29d[_0x9667('0x19')][_0x9667('0x1e')]||null:null,'include':_0xbfd29d[_0x9667('0x19')]?_0xbfd29d['options']['include']?_[_0x9667('0x1d')](_0xbfd29d[_0x9667('0x19')][_0x9667('0x1c')],function(_0x228e0d){return{'model':db[_0x228e0d['model']],'as':_0x228e0d['as'],'attributes':_0x228e0d[_0x9667('0x1e')],'include':_0x228e0d[_0x9667('0x1c')]?_[_0x9667('0x1d')](_0x228e0d['include'],function(_0x2e18fd){return{'model':db[_0x2e18fd[_0x9667('0x1f')]],'as':_0x2e18fd['as'],'attributes':_0x2e18fd[_0x9667('0x1e')],'include':_0x2e18fd[_0x9667('0x1c')]?_[_0x9667('0x1d')](_0x2e18fd[_0x9667('0x1c')],function(_0x10b158){return{'model':db[_0x10b158['model']],'as':_0x10b158['as'],'attributes':_0x10b158['attributes']};}):[]};}):[]};}):[]:[]})[_0x9667('0xc')](function(_0x560736){logger[_0x9667('0xd')]('ShowVoiceQueue',_0xbfd29d);logger[_0x9667('0x10')]('ShowVoiceQueue',_0xbfd29d,JSON[_0x9667('0x11')](_0x560736));_0x4a8007(_0x560736);})['catch'](function(_0x2355b7){logger[_0x9667('0x12')]('ShowVoiceQueue',_0x2355b7[_0x9667('0x14')],_0xbfd29d);_0x480df7(_0x17b97a[_0x9667('0x12')](0x1f4,_0x2355b7['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 67ddd3a..42e5829 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 _0x455d=['removeListener','register','voiceQueue:','./voiceQueue.events','save','remove','emit'];(function(_0x353650,_0x289341){var _0x27db06=function(_0x3105a7){while(--_0x3105a7){_0x353650['push'](_0x353650['shift']());}};_0x27db06(++_0x289341);}(_0x455d,0x1a7));var _0xd455=function(_0x2dc50c,_0x5b1fa9){_0x2dc50c=_0x2dc50c-0x0;var _0x3d0d27=_0x455d[_0x2dc50c];return _0x3d0d27;};'use strict';var VoiceQueueEvents=require(_0xd455('0x0'));var events=[_0xd455('0x1'),_0xd455('0x2'),'update'];function createListener(_0x2b7943,_0xaa3222){return function(_0x573594){_0xaa3222[_0xd455('0x3')](_0x2b7943,_0x573594);};}function removeListener(_0x46a6e5,_0x28233a){return function(){VoiceQueueEvents[_0xd455('0x4')](_0x46a6e5,_0x28233a);};}exports[_0xd455('0x5')]=function(_0x1292aa){for(var _0x3092ea=0x0,_0x42ca71=events['length'];_0x3092ea<_0x42ca71;_0x3092ea++){var _0x7a8384=events[_0x3092ea];var _0x3702e7=createListener(_0xd455('0x6')+_0x7a8384,_0x1292aa);VoiceQueueEvents['on'](_0x7a8384,_0x3702e7);}}; \ No newline at end of file +var _0x2f19=['save','remove','update','emit','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2f19,0x67));var _0x92f1=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0x2f19[_0x1b8f5a];return _0x594189;};'use strict';var VoiceQueueEvents=require(_0x92f1('0x0'));var events=[_0x92f1('0x1'),_0x92f1('0x2'),_0x92f1('0x3')];function createListener(_0x4b34a5,_0x5611dd){return function(_0x984427){_0x5611dd[_0x92f1('0x4')](_0x4b34a5,_0x984427);};}function removeListener(_0x3a5b99,_0x50b74d){return function(){VoiceQueueEvents['removeListener'](_0x3a5b99,_0x50b74d);};}exports[_0x92f1('0x5')]=function(_0x35ba34){for(var _0x512812=0x0,_0x576263=events[_0x92f1('0x6')];_0x512812<_0x576263;_0x512812++){var _0x5119f0=events[_0x512812];var _0x3fe170=createListener(_0x92f1('0x7')+_0x5119f0,_0x35ba34);VoiceQueueEvents['on'](_0x5119f0,_0x3fe170);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 3a9d049..75081c0 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 _0xa652=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','describe','/index','isAuthenticated','/:id','show','post','create','put','update','delete','multer','path','connect-timeout'];(function(_0x5d9030,_0x390ec8){var _0x49639d=function(_0x4afa75){while(--_0x4afa75){_0x5d9030['push'](_0x5d9030['shift']());}};_0x49639d(++_0x390ec8);}(_0xa652,0xb1));var _0x2a65=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa652[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x2a65('0x0'));var util=require('util');var path=require(_0x2a65('0x1'));var timeout=require(_0x2a65('0x2'));var express=require(_0x2a65('0x3'));var router=express[_0x2a65('0x4')]();var fs_extra=require(_0x2a65('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a65('0x6'));var config=require(_0x2a65('0x7'));var controller=require(_0x2a65('0x8'));router[_0x2a65('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2a65('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2a65('0xa')]);router[_0x2a65('0x9')](_0x2a65('0xb'),auth[_0x2a65('0xc')](),controller['getVoiceQueuesReport']);router[_0x2a65('0x9')](_0x2a65('0xd'),auth['isAuthenticated'](),controller[_0x2a65('0xe')]);router[_0x2a65('0xf')]('/',auth[_0x2a65('0xc')](),controller[_0x2a65('0x10')]);router[_0x2a65('0x11')](_0x2a65('0xd'),auth['isAuthenticated'](),controller[_0x2a65('0x12')]);router[_0x2a65('0x13')](_0x2a65('0xd'),auth[_0x2a65('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xecd6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xecd6,0xd1));var _0x6ecd=function(_0x1373ca,_0x5bc71e){_0x1373ca=_0x1373ca-0x0;var _0x3d8634=_0xecd6[_0x1373ca];return _0x3d8634;};'use strict';var multer=require(_0x6ecd('0x0'));var util=require(_0x6ecd('0x1'));var path=require(_0x6ecd('0x2'));var timeout=require(_0x6ecd('0x3'));var express=require(_0x6ecd('0x4'));var router=express[_0x6ecd('0x5')]();var fs_extra=require(_0x6ecd('0x6'));var auth=require(_0x6ecd('0x7'));var interaction=require(_0x6ecd('0x8'));var config=require(_0x6ecd('0x9'));var controller=require(_0x6ecd('0xa'));router[_0x6ecd('0xb')]('/',auth['isAuthenticated'](),controller[_0x6ecd('0xc')]);router[_0x6ecd('0xb')](_0x6ecd('0xd'),auth['isAuthenticated'](),controller[_0x6ecd('0xe')]);router[_0x6ecd('0xb')](_0x6ecd('0xf'),auth[_0x6ecd('0x10')](),controller[_0x6ecd('0x11')]);router['get'](_0x6ecd('0x12'),auth[_0x6ecd('0x10')](),controller[_0x6ecd('0x13')]);router['post']('/',auth[_0x6ecd('0x10')](),controller[_0x6ecd('0x14')]);router[_0x6ecd('0x15')](_0x6ecd('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x6ecd('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6ecd('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index fc4d55d..977aa65 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 _0x4312=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4312,0x114));var _0x2431=function(_0x50f63f,_0x3be855){_0x50f63f=_0x50f63f-0x0;var _0xa38248=_0x4312[_0x50f63f];return _0xa38248;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2431('0x0'));module[_0x2431('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2431('0x2')]},'calleridnum':{'type':Sequelize[_0x2431('0x2')]},'calleridname':{'type':Sequelize[_0x2431('0x2')]},'queue':{'type':Sequelize[_0x2431('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x2431('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x2431('0x3')],'set':function(_0x484977){var _0x399602=moment(_0x484977);var _0x29e3b1=moment(this[_0x2431('0x4')](_0x2431('0x5')))[_0x2431('0x6')](_0x2431('0x7'));var _0x5dd673=_0x399602[_0x2431('0x8')](_0x29e3b1,_0x2431('0x9'));this[_0x2431('0xa')](_0x2431('0xb'),_0x484977);this['setDataValue'](_0x2431('0xc'),_0x5dd673||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x2431('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2431('0x3')]},'queuecallerexit':{'type':Sequelize[_0x2431('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2431('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x2431('0xe')},'originalposition':{'type':Sequelize[_0x2431('0xf')]},'channel':{'type':Sequelize[_0x2431('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2431('0x2')]},'accountcode':{'type':Sequelize[_0x2431('0x2')]},'context':{'type':Sequelize[_0x2431('0x2')]},'exten':{'type':Sequelize[_0x2431('0x2')]},'priority':{'type':Sequelize[_0x2431('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x2431('0xf')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2431('0x2')]},'transfer':{'type':Sequelize[_0x2431('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2431('0x2')],'comment':_0x2431('0x10')},'transferexten':{'type':Sequelize[_0x2431('0x2')]},'transferuniqueid':{'type':Sequelize[_0x2431('0x2')]},'disposition':{'type':Sequelize[_0x2431('0x2')]},'secondDisposition':{'type':Sequelize[_0x2431('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x2431('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe352=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x5a4257,_0x3ae34d){var _0x3746a7=function(_0x31fff0){while(--_0x31fff0){_0x5a4257['push'](_0x5a4257['shift']());}};_0x3746a7(++_0x3ae34d);}(_0xe352,0x196));var _0x2e35=function(_0x108d8f,_0x586ad6){_0x108d8f=_0x108d8f-0x0;var _0x2fd8d1=_0xe352[_0x108d8f];return _0x2fd8d1;};'use strict';var Sequelize=require(_0x2e35('0x0'));var moment=require(_0x2e35('0x1'));module[_0x2e35('0x2')]={'type':{'type':Sequelize[_0x2e35('0x3')]},'uniqueid':{'type':Sequelize[_0x2e35('0x3')]},'calleridnum':{'type':Sequelize[_0x2e35('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2e35('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x2e35('0x4')],'set':function(_0x5f317b){var _0x2cf040=moment(_0x5f317b);var _0x5ed882=moment(this[_0x2e35('0x5')](_0x2e35('0x6')))[_0x2e35('0x7')](_0x2e35('0x8'));var _0x3b7a98=_0x2cf040[_0x2e35('0x9')](_0x5ed882,_0x2e35('0xa'));this[_0x2e35('0xb')]('queuecallerleaveAt',_0x5f317b);this[_0x2e35('0xb')](_0x2e35('0xc'),_0x3b7a98||null);}},'position':{'type':Sequelize[_0x2e35('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x2e35('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2e35('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x2e35('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2e35('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x2e35('0x3')],'comment':_0x2e35('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x2e35('0x3')]},'connectedlinenum':{'type':Sequelize[_0x2e35('0x3')]},'connectedlinename':{'type':Sequelize[_0x2e35('0x3')]},'accountcode':{'type':Sequelize[_0x2e35('0x3')]},'context':{'type':Sequelize[_0x2e35('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x2e35('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x2e35('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2e35('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2e35('0x3')]},'transfer':{'type':Sequelize[_0x2e35('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2e35('0x3')],'comment':_0x2e35('0x10')},'transferexten':{'type':Sequelize[_0x2e35('0x3')]},'transferuniqueid':{'type':Sequelize[_0x2e35('0x3')]},'disposition':{'type':Sequelize[_0x2e35('0x3')]},'secondDisposition':{'type':Sequelize[_0x2e35('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2e35('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 fc70e0c..e052304 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 _0x1703=['pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','include','find','catch','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','defaults','./voiceQueueReport.socket','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x307cec,_0x1cf922){var _0x285c73=function(_0x2602e7){while(--_0x2602e7){_0x307cec['push'](_0x307cec['shift']());}};_0x285c73(++_0x1cf922);}(_0x1703,0x152));var _0x3170=function(_0x339c9a,_0x1a5012){_0x339c9a=_0x339c9a-0x0;var _0x32803f=_0x1703[_0x339c9a];return _0x32803f;};'use strict';var emlformat=require(_0x3170('0x0'));var rimraf=require(_0x3170('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3170('0x2'));var moment=require(_0x3170('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3170('0x4'));var util=require(_0x3170('0x5'));var path=require(_0x3170('0x6'));var sox=require('sox');var csv=require(_0x3170('0x7'));var ejs=require(_0x3170('0x8'));var fs=require('fs');var fs_extra=require(_0x3170('0x9'));var _=require(_0x3170('0xa'));var squel=require(_0x3170('0xb'));var crypto=require(_0x3170('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3170('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3170('0xe'));var Papa=require(_0x3170('0xf'));var Redis=require(_0x3170('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3170('0x11'));var as=require(_0x3170('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3170('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3170('0x14'))['db'];config[_0x3170('0x15')]=_[_0x3170('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3170('0x15')]));require(_0x3170('0x17'))['register'](socket);function respondWithStatusCode(_0x38ab90,_0x32a74f){_0x32a74f=_0x32a74f||0xcc;return function(_0x4db2ff){if(_0x4db2ff){return _0x38ab90[_0x3170('0x18')](_0x32a74f);}return _0x38ab90['status'](_0x32a74f)[_0x3170('0x19')]();};}function respondWithResult(_0x28c4c9,_0x75170f){_0x75170f=_0x75170f||0xc8;return function(_0x2390e9){if(_0x2390e9){return _0x28c4c9[_0x3170('0x1a')](_0x75170f)[_0x3170('0x1b')](_0x2390e9);}};}function respondWithFilteredResult(_0x2b8cdd,_0x21bf66){return function(_0x243bef){if(_0x243bef){var _0x3e220f=typeof _0x21bf66['offset']===_0x3170('0x1c')&&typeof _0x21bf66[_0x3170('0x1d')]===_0x3170('0x1c');var _0x58606c=_0x243bef[_0x3170('0x1e')];var _0x39a90d=_0x3e220f?0x0:_0x21bf66['offset'];var _0x4ae415=_0x3e220f?_0x243bef[_0x3170('0x1e')]:_0x21bf66[_0x3170('0x1f')]+_0x21bf66[_0x3170('0x1d')];var _0x651397;if(_0x4ae415>=_0x58606c){_0x4ae415=_0x58606c;_0x651397=0xc8;}else{_0x651397=0xce;}_0x2b8cdd[_0x3170('0x1a')](_0x651397);return _0x2b8cdd[_0x3170('0x20')](_0x3170('0x21'),_0x39a90d+'-'+_0x4ae415+'/'+_0x58606c)[_0x3170('0x1b')](_0x243bef);}return null;};}function patchUpdates(_0x4ad0c4){return function(_0x18cefd){try{jsonpatch[_0x3170('0x22')](_0x18cefd,_0x4ad0c4,!![]);}catch(_0x20c4ea){return BPromise['reject'](_0x20c4ea);}return _0x18cefd[_0x3170('0x23')]();};}function saveUpdates(_0x2b2268,_0x3e9993){return function(_0x525188){if(_0x525188){return _0x525188[_0x3170('0x24')](_0x2b2268)[_0x3170('0x25')](function(_0x2328d4){return _0x2328d4;});}return null;};}function removeEntity(_0x1bff19,_0x3500b5){return function(_0x48a9a1){if(_0x48a9a1){return _0x48a9a1[_0x3170('0x26')]()[_0x3170('0x25')](function(){_0x1bff19[_0x3170('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bf9c6,_0x3adbba){return function(_0x58b090){if(!_0x58b090){_0x5bf9c6[_0x3170('0x18')](0x194);}return _0x58b090;};}function handleError(_0x3212a4,_0x16e9e4){_0x16e9e4=_0x16e9e4||0x1f4;return function(_0x4c6138){logger[_0x3170('0x27')](_0x4c6138[_0x3170('0x28')]);if(_0x4c6138[_0x3170('0x29')]){delete _0x4c6138[_0x3170('0x29')];}_0x3212a4[_0x3170('0x1a')](_0x16e9e4)[_0x3170('0x2a')](_0x4c6138);};}exports[_0x3170('0x2b')]=function(_0xa9a2a2,_0x22c6d5){var _0x5efc0d={},_0x2fda76={},_0x400ad4={'count':0x0,'rows':[]};var _0x55a254=_[_0x3170('0x2c')](db[_0x3170('0x2d')][_0x3170('0x2e')],function(_0xfea375){return{'name':_0xfea375[_0x3170('0x2f')],'type':_0xfea375[_0x3170('0x30')][_0x3170('0x31')]};});_0x2fda76[_0x3170('0x32')]=_[_0x3170('0x2c')](_0x55a254,'name');_0x2fda76[_0x3170('0x33')]=_[_0x3170('0x34')](_0xa9a2a2[_0x3170('0x33')]);_0x2fda76[_0x3170('0x35')]=_[_0x3170('0x36')](_0x2fda76['model'],_0x2fda76['query']);_0x5efc0d[_0x3170('0x37')]=_[_0x3170('0x36')](_0x2fda76[_0x3170('0x32')],qs[_0x3170('0x38')](_0xa9a2a2['query'][_0x3170('0x38')]));_0x5efc0d['attributes']=_0x5efc0d[_0x3170('0x37')][_0x3170('0x39')]?_0x5efc0d[_0x3170('0x37')]:_0x2fda76[_0x3170('0x32')];if(!_0xa9a2a2[_0x3170('0x33')][_0x3170('0x3a')](_0x3170('0x3b'))){_0x5efc0d[_0x3170('0x1d')]=qs[_0x3170('0x1d')](_0xa9a2a2['query']['limit']);_0x5efc0d[_0x3170('0x1f')]=qs[_0x3170('0x1f')](_0xa9a2a2[_0x3170('0x33')]['offset']);}_0x5efc0d[_0x3170('0x3c')]=qs[_0x3170('0x3d')](_0xa9a2a2[_0x3170('0x33')][_0x3170('0x3d')]);_0x5efc0d['where']=qs['filters'](_[_0x3170('0x3e')](_0xa9a2a2['query'],_0x2fda76[_0x3170('0x35')]),_0x55a254);if(_0xa9a2a2[_0x3170('0x33')]['filter']){_0x5efc0d[_0x3170('0x3f')]=_[_0x3170('0x40')](_0x5efc0d[_0x3170('0x3f')],{'$or':_['map'](_0x55a254,function(_0x5e2458){if(_0x5e2458[_0x3170('0x30')]!==_0x3170('0x41')){var _0x176a88={};_0x176a88[_0x5e2458[_0x3170('0x29')]]={'$like':'%'+_0xa9a2a2[_0x3170('0x33')][_0x3170('0x42')]+'%'};return _0x176a88;}})});}_0x5efc0d=_[_0x3170('0x40')]({},_0x5efc0d,_0xa9a2a2[_0x3170('0x43')]);var _0x2babec={'where':_0x5efc0d['where']};return db[_0x3170('0x2d')][_0x3170('0x1e')](_0x2babec)[_0x3170('0x25')](function(_0x4372fd){_0x400ad4[_0x3170('0x1e')]=_0x4372fd;if(_0xa9a2a2['query'][_0x3170('0x44')]){_0x5efc0d['include']=[{'all':!![]}];}return db[_0x3170('0x2d')][_0x3170('0x45')](_0x5efc0d);})[_0x3170('0x25')](function(_0x259e1e){_0x400ad4[_0x3170('0x46')]=_0x259e1e;return _0x400ad4;})[_0x3170('0x25')](respondWithFilteredResult(_0x22c6d5,_0x5efc0d))['catch'](handleError(_0x22c6d5,null));};exports[_0x3170('0x47')]=function(_0x115401,_0x5e4684){var _0x58b44d={'raw':![],'where':{'id':_0x115401['params']['id']}},_0x1826c3={};_0x1826c3[_0x3170('0x32')]=_['keys'](db[_0x3170('0x2d')][_0x3170('0x2e')]);_0x1826c3[_0x3170('0x33')]=_[_0x3170('0x34')](_0x115401[_0x3170('0x33')]);_0x1826c3[_0x3170('0x35')]=_['intersection'](_0x1826c3[_0x3170('0x32')],_0x1826c3[_0x3170('0x33')]);_0x58b44d[_0x3170('0x37')]=_[_0x3170('0x36')](_0x1826c3[_0x3170('0x32')],qs[_0x3170('0x38')](_0x115401['query'][_0x3170('0x38')]));_0x58b44d[_0x3170('0x37')]=_0x58b44d[_0x3170('0x37')][_0x3170('0x39')]?_0x58b44d[_0x3170('0x37')]:_0x1826c3[_0x3170('0x32')];if(_0x115401['query'][_0x3170('0x44')]){_0x58b44d[_0x3170('0x48')]=[{'all':!![]}];}_0x58b44d=_[_0x3170('0x40')]({},_0x58b44d,_0x115401[_0x3170('0x43')]);return db[_0x3170('0x2d')][_0x3170('0x49')](_0x58b44d)[_0x3170('0x25')](handleEntityNotFound(_0x5e4684,null))['then'](respondWithResult(_0x5e4684,null))[_0x3170('0x4a')](handleError(_0x5e4684,null));};exports[_0x3170('0x4b')]=function(_0x374b48,_0x2f81f3){return db['VoiceQueueReport']['create'](_0x374b48[_0x3170('0x4c')],{})['then'](respondWithResult(_0x2f81f3,0xc9))[_0x3170('0x4a')](handleError(_0x2f81f3,null));};exports[_0x3170('0x24')]=function(_0x33c420,_0x37492b){if(_0x33c420[_0x3170('0x4c')]['id']){delete _0x33c420[_0x3170('0x4c')]['id'];}return db['VoiceQueueReport'][_0x3170('0x49')]({'where':{'id':_0x33c420[_0x3170('0x4d')]['id']}})[_0x3170('0x25')](handleEntityNotFound(_0x37492b,null))['then'](saveUpdates(_0x33c420[_0x3170('0x4c')],null))[_0x3170('0x25')](respondWithResult(_0x37492b,null))[_0x3170('0x4a')](handleError(_0x37492b,null));};exports['destroy']=function(_0x1b9ba,_0x403fdf){return db['VoiceQueueReport']['find']({'where':{'id':_0x1b9ba[_0x3170('0x4d')]['id']}})[_0x3170('0x25')](handleEntityNotFound(_0x403fdf,null))['then'](removeEntity(_0x403fdf,null))[_0x3170('0x4a')](handleError(_0x403fdf,null));};exports[_0x3170('0x4e')]=function(_0x4e437f,_0x115dbe){return db[_0x3170('0x2d')][_0x3170('0x4e')]()[_0x3170('0x25')](respondWithResult(_0x115dbe,null))[_0x3170('0x4a')](handleError(_0x115dbe,null));};exports[_0x3170('0x4f')]=function(_0x7d543b,_0x2400e9){var _0xa54cad={},_0x1925d3={},_0x59a13c={'count':0x0,'rows':[]};_0x1925d3[_0x3170('0x32')]=_[_0x3170('0x34')](db['VoiceQueueReport'][_0x3170('0x2e')]);_0x1925d3[_0x3170('0x33')]=_['keys'](_0x7d543b[_0x3170('0x33')]);_0x1925d3['filters']=_['intersection'](_0x1925d3[_0x3170('0x32')],_0x1925d3[_0x3170('0x33')]);_0xa54cad[_0x3170('0x37')]=_[_0x3170('0x36')](_0x1925d3['model'],qs[_0x3170('0x38')](_0x7d543b[_0x3170('0x33')][_0x3170('0x38')]));_0xa54cad[_0x3170('0x37')]=_0xa54cad[_0x3170('0x37')][_0x3170('0x39')]?_0xa54cad[_0x3170('0x37')]:_0x1925d3[_0x3170('0x32')];if(!_0x7d543b[_0x3170('0x33')][_0x3170('0x3a')](_0x3170('0x3b'))){_0xa54cad[_0x3170('0x1d')]=qs[_0x3170('0x1d')](_0x7d543b[_0x3170('0x33')][_0x3170('0x1d')]);_0xa54cad[_0x3170('0x1f')]=qs['offset'](_0x7d543b[_0x3170('0x33')][_0x3170('0x1f')]);}_0xa54cad[_0x3170('0x3c')]=qs[_0x3170('0x3d')](_0x7d543b[_0x3170('0x33')][_0x3170('0x3d')]);_0xa54cad['where']=qs[_0x3170('0x35')](_[_0x3170('0x3e')](_0x7d543b['query'],_0x1925d3[_0x3170('0x35')]));if(_0x7d543b['query'][_0x3170('0x42')]){_0xa54cad[_0x3170('0x3f')]=_[_0x3170('0x40')](_0xa54cad[_0x3170('0x3f')],{'$or':_[_0x3170('0x2c')](_0xa54cad['attributes'],function(_0x50130d){var _0x2dfa67={};_0x2dfa67[_0x50130d]={'$like':'%'+_0x7d543b[_0x3170('0x33')][_0x3170('0x42')]+'%'};return _0x2dfa67;})});}_0xa54cad=_[_0x3170('0x40')]({},_0xa54cad,_0x7d543b[_0x3170('0x43')]);var _0x4571fc={'where':_0xa54cad['where']};return db[_0x3170('0x2d')][_0x3170('0x1e')](_0x4571fc)[_0x3170('0x25')](function(_0x32c6a2){_0x59a13c[_0x3170('0x1e')]=_0x32c6a2;if(_0x7d543b[_0x3170('0x33')][_0x3170('0x44')]){_0xa54cad[_0x3170('0x48')]=[{'all':!![]}];}return db[_0x3170('0x2d')][_0x3170('0x45')](_0xa54cad);})[_0x3170('0x25')](function(_0x3a5fac){_0x59a13c[_0x3170('0x46')]=_0x3a5fac;return _0x59a13c;})[_0x3170('0x25')](respondWithFilteredResult(_0x2400e9,_0xa54cad,_0x3170('0x4f')))[_0x3170('0x4a')](handleError(_0x2400e9,null,_0x3170('0x4f')));}; \ No newline at end of file +var _0xcff3=['hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','getVoiceQueuesReport','order','pick','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length'];(function(_0x2c416a,_0x732630){var _0x4218d5=function(_0x436357){while(--_0x436357){_0x2c416a['push'](_0x2c416a['shift']());}};_0x4218d5(++_0x732630);}(_0xcff3,0x199));var _0x3cff=function(_0x4d95db,_0x28b7e9){_0x4d95db=_0x4d95db-0x0;var _0x1cc484=_0xcff3[_0x4d95db];return _0x1cc484;};'use strict';var emlformat=require(_0x3cff('0x0'));var rimraf=require(_0x3cff('0x1'));var zipdir=require(_0x3cff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3cff('0x3'));var moment=require('moment');var BPromise=require(_0x3cff('0x4'));var Mustache=require(_0x3cff('0x5'));var util=require(_0x3cff('0x6'));var path=require(_0x3cff('0x7'));var sox=require(_0x3cff('0x8'));var csv=require(_0x3cff('0x9'));var ejs=require(_0x3cff('0xa'));var fs=require('fs');var fs_extra=require(_0x3cff('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3cff('0xc'));var jsforce=require(_0x3cff('0xd'));var deskjs=require(_0x3cff('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3cff('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3cff('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cff('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x3cff('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3cff('0x13'))['db'];config[_0x3cff('0x14')]=_[_0x3cff('0x15')](config['redis'],{'host':_0x3cff('0x16'),'port':0x18eb});var socket=require(_0x3cff('0x17'))(new Redis(config[_0x3cff('0x14')]));require(_0x3cff('0x18'))[_0x3cff('0x19')](socket);function respondWithStatusCode(_0xef92bf,_0x120d97){_0x120d97=_0x120d97||0xcc;return function(_0x40ca47){if(_0x40ca47){return _0xef92bf[_0x3cff('0x1a')](_0x120d97);}return _0xef92bf[_0x3cff('0x1b')](_0x120d97)[_0x3cff('0x1c')]();};}function respondWithResult(_0x39bc20,_0x23ee68){_0x23ee68=_0x23ee68||0xc8;return function(_0x39af8b){if(_0x39af8b){return _0x39bc20[_0x3cff('0x1b')](_0x23ee68)['json'](_0x39af8b);}};}function respondWithFilteredResult(_0x42d58c,_0x3e319e){return function(_0xb8b0af){if(_0xb8b0af){var _0x2da213=typeof _0x3e319e[_0x3cff('0x1d')]==='undefined'&&typeof _0x3e319e[_0x3cff('0x1e')]==='undefined';var _0x1418ee=_0xb8b0af['count'];var _0x196e65=_0x2da213?0x0:_0x3e319e['offset'];var _0xbb4373=_0x2da213?_0xb8b0af['count']:_0x3e319e[_0x3cff('0x1d')]+_0x3e319e[_0x3cff('0x1e')];var _0x4f74ad;if(_0xbb4373>=_0x1418ee){_0xbb4373=_0x1418ee;_0x4f74ad=0xc8;}else{_0x4f74ad=0xce;}_0x42d58c['status'](_0x4f74ad);return _0x42d58c[_0x3cff('0x1f')](_0x3cff('0x20'),_0x196e65+'-'+_0xbb4373+'/'+_0x1418ee)['json'](_0xb8b0af);}return null;};}function patchUpdates(_0x337087){return function(_0x3e44c2){try{jsonpatch[_0x3cff('0x21')](_0x3e44c2,_0x337087,!![]);}catch(_0x27c165){return BPromise[_0x3cff('0x22')](_0x27c165);}return _0x3e44c2['save']();};}function saveUpdates(_0x21e627,_0x394fda){return function(_0x3ee54c){if(_0x3ee54c){return _0x3ee54c[_0x3cff('0x23')](_0x21e627)['then'](function(_0x4bbbda){return _0x4bbbda;});}return null;};}function removeEntity(_0x3d47fa,_0x349a85){return function(_0x551c4d){if(_0x551c4d){return _0x551c4d[_0x3cff('0x24')]()[_0x3cff('0x25')](function(){_0x3d47fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b57a,_0x4bb65f){return function(_0x47c128){if(!_0x47c128){_0x25b57a[_0x3cff('0x1a')](0x194);}return _0x47c128;};}function handleError(_0xce27b8,_0x44d752){_0x44d752=_0x44d752||0x1f4;return function(_0x5e67b2){logger[_0x3cff('0x26')](_0x5e67b2['stack']);if(_0x5e67b2[_0x3cff('0x27')]){delete _0x5e67b2[_0x3cff('0x27')];}_0xce27b8[_0x3cff('0x1b')](_0x44d752)[_0x3cff('0x28')](_0x5e67b2);};}exports[_0x3cff('0x29')]=function(_0x54615e,_0x496482){var _0x3f5f42={},_0x13f623={},_0x5dbfe0={'count':0x0,'rows':[]};var _0x5cdfa3=_[_0x3cff('0x2a')](db[_0x3cff('0x2b')][_0x3cff('0x2c')],function(_0x2afe7d){return{'name':_0x2afe7d['fieldName'],'type':_0x2afe7d[_0x3cff('0x2d')]['key']};});_0x13f623[_0x3cff('0x2e')]=_[_0x3cff('0x2a')](_0x5cdfa3,_0x3cff('0x27'));_0x13f623[_0x3cff('0x2f')]=_[_0x3cff('0x30')](_0x54615e['query']);_0x13f623['filters']=_[_0x3cff('0x31')](_0x13f623[_0x3cff('0x2e')],_0x13f623[_0x3cff('0x2f')]);_0x3f5f42[_0x3cff('0x32')]=_[_0x3cff('0x31')](_0x13f623[_0x3cff('0x2e')],qs[_0x3cff('0x33')](_0x54615e[_0x3cff('0x2f')][_0x3cff('0x33')]));_0x3f5f42[_0x3cff('0x32')]=_0x3f5f42['attributes'][_0x3cff('0x34')]?_0x3f5f42[_0x3cff('0x32')]:_0x13f623[_0x3cff('0x2e')];if(!_0x54615e[_0x3cff('0x2f')][_0x3cff('0x35')](_0x3cff('0x36'))){_0x3f5f42[_0x3cff('0x1e')]=qs[_0x3cff('0x1e')](_0x54615e['query'][_0x3cff('0x1e')]);_0x3f5f42['offset']=qs['offset'](_0x54615e[_0x3cff('0x2f')][_0x3cff('0x1d')]);}_0x3f5f42['order']=qs[_0x3cff('0x37')](_0x54615e[_0x3cff('0x2f')]['sort']);_0x3f5f42[_0x3cff('0x38')]=qs[_0x3cff('0x39')](_['pick'](_0x54615e[_0x3cff('0x2f')],_0x13f623['filters']),_0x5cdfa3);if(_0x54615e['query'][_0x3cff('0x3a')]){_0x3f5f42[_0x3cff('0x38')]=_['merge'](_0x3f5f42[_0x3cff('0x38')],{'$or':_[_0x3cff('0x2a')](_0x5cdfa3,function(_0x54c16e){if(_0x54c16e['type']!==_0x3cff('0x3b')){var _0x36bbbc={};_0x36bbbc[_0x54c16e[_0x3cff('0x27')]]={'$like':'%'+_0x54615e[_0x3cff('0x2f')][_0x3cff('0x3a')]+'%'};return _0x36bbbc;}})});}_0x3f5f42=_['merge']({},_0x3f5f42,_0x54615e[_0x3cff('0x3c')]);var _0x52fd6e={'where':_0x3f5f42[_0x3cff('0x38')]};return db[_0x3cff('0x2b')][_0x3cff('0x3d')](_0x52fd6e)[_0x3cff('0x25')](function(_0x2acccc){_0x5dbfe0[_0x3cff('0x3d')]=_0x2acccc;if(_0x54615e[_0x3cff('0x2f')][_0x3cff('0x3e')]){_0x3f5f42[_0x3cff('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x3cff('0x40')](_0x3f5f42);})[_0x3cff('0x25')](function(_0x64983a){_0x5dbfe0[_0x3cff('0x41')]=_0x64983a;return _0x5dbfe0;})[_0x3cff('0x25')](respondWithFilteredResult(_0x496482,_0x3f5f42))[_0x3cff('0x42')](handleError(_0x496482,null));};exports[_0x3cff('0x43')]=function(_0x4dbac3,_0x3cc425){var _0x516cfe={'raw':![],'where':{'id':_0x4dbac3[_0x3cff('0x44')]['id']}},_0x5c806a={};_0x5c806a[_0x3cff('0x2e')]=_[_0x3cff('0x30')](db['VoiceQueueReport'][_0x3cff('0x2c')]);_0x5c806a[_0x3cff('0x2f')]=_[_0x3cff('0x30')](_0x4dbac3[_0x3cff('0x2f')]);_0x5c806a[_0x3cff('0x39')]=_[_0x3cff('0x31')](_0x5c806a['model'],_0x5c806a['query']);_0x516cfe['attributes']=_[_0x3cff('0x31')](_0x5c806a[_0x3cff('0x2e')],qs['fields'](_0x4dbac3[_0x3cff('0x2f')][_0x3cff('0x33')]));_0x516cfe[_0x3cff('0x32')]=_0x516cfe['attributes'][_0x3cff('0x34')]?_0x516cfe['attributes']:_0x5c806a['model'];if(_0x4dbac3[_0x3cff('0x2f')][_0x3cff('0x3e')]){_0x516cfe[_0x3cff('0x3f')]=[{'all':!![]}];}_0x516cfe=_[_0x3cff('0x45')]({},_0x516cfe,_0x4dbac3[_0x3cff('0x3c')]);return db['VoiceQueueReport'][_0x3cff('0x46')](_0x516cfe)[_0x3cff('0x25')](handleEntityNotFound(_0x3cc425,null))[_0x3cff('0x25')](respondWithResult(_0x3cc425,null))['catch'](handleError(_0x3cc425,null));};exports[_0x3cff('0x47')]=function(_0x3be7ab,_0x465e26){return db[_0x3cff('0x2b')][_0x3cff('0x47')](_0x3be7ab[_0x3cff('0x48')],{})[_0x3cff('0x25')](respondWithResult(_0x465e26,0xc9))[_0x3cff('0x42')](handleError(_0x465e26,null));};exports[_0x3cff('0x23')]=function(_0x54a254,_0x4fa8d7){if(_0x54a254[_0x3cff('0x48')]['id']){delete _0x54a254[_0x3cff('0x48')]['id'];}return db[_0x3cff('0x2b')][_0x3cff('0x46')]({'where':{'id':_0x54a254[_0x3cff('0x44')]['id']}})[_0x3cff('0x25')](handleEntityNotFound(_0x4fa8d7,null))['then'](saveUpdates(_0x54a254[_0x3cff('0x48')],null))[_0x3cff('0x25')](respondWithResult(_0x4fa8d7,null))['catch'](handleError(_0x4fa8d7,null));};exports[_0x3cff('0x24')]=function(_0x58b178,_0x269ba2){return db['VoiceQueueReport']['find']({'where':{'id':_0x58b178[_0x3cff('0x44')]['id']}})['then'](handleEntityNotFound(_0x269ba2,null))[_0x3cff('0x25')](removeEntity(_0x269ba2,null))['catch'](handleError(_0x269ba2,null));};exports['describe']=function(_0x2be295,_0x572747){return db[_0x3cff('0x2b')][_0x3cff('0x49')]()[_0x3cff('0x25')](respondWithResult(_0x572747,null))[_0x3cff('0x42')](handleError(_0x572747,null));};exports[_0x3cff('0x4a')]=function(_0x4ddbb0,_0x10db3c){var _0x16504a={},_0x19f917={},_0x5ba398={'count':0x0,'rows':[]};_0x19f917[_0x3cff('0x2e')]=_[_0x3cff('0x30')](db['VoiceQueueReport'][_0x3cff('0x2c')]);_0x19f917[_0x3cff('0x2f')]=_[_0x3cff('0x30')](_0x4ddbb0['query']);_0x19f917[_0x3cff('0x39')]=_[_0x3cff('0x31')](_0x19f917[_0x3cff('0x2e')],_0x19f917['query']);_0x16504a['attributes']=_[_0x3cff('0x31')](_0x19f917[_0x3cff('0x2e')],qs[_0x3cff('0x33')](_0x4ddbb0[_0x3cff('0x2f')][_0x3cff('0x33')]));_0x16504a[_0x3cff('0x32')]=_0x16504a[_0x3cff('0x32')][_0x3cff('0x34')]?_0x16504a[_0x3cff('0x32')]:_0x19f917[_0x3cff('0x2e')];if(!_0x4ddbb0[_0x3cff('0x2f')][_0x3cff('0x35')](_0x3cff('0x36'))){_0x16504a[_0x3cff('0x1e')]=qs[_0x3cff('0x1e')](_0x4ddbb0[_0x3cff('0x2f')][_0x3cff('0x1e')]);_0x16504a[_0x3cff('0x1d')]=qs[_0x3cff('0x1d')](_0x4ddbb0['query'][_0x3cff('0x1d')]);}_0x16504a[_0x3cff('0x4b')]=qs[_0x3cff('0x37')](_0x4ddbb0[_0x3cff('0x2f')][_0x3cff('0x37')]);_0x16504a[_0x3cff('0x38')]=qs[_0x3cff('0x39')](_[_0x3cff('0x4c')](_0x4ddbb0['query'],_0x19f917[_0x3cff('0x39')]));if(_0x4ddbb0[_0x3cff('0x2f')][_0x3cff('0x3a')]){_0x16504a['where']=_[_0x3cff('0x45')](_0x16504a[_0x3cff('0x38')],{'$or':_[_0x3cff('0x2a')](_0x16504a['attributes'],function(_0x518436){var _0x410076={};_0x410076[_0x518436]={'$like':'%'+_0x4ddbb0[_0x3cff('0x2f')]['filter']+'%'};return _0x410076;})});}_0x16504a=_[_0x3cff('0x45')]({},_0x16504a,_0x4ddbb0[_0x3cff('0x3c')]);var _0x9951f0={'where':_0x16504a[_0x3cff('0x38')]};return db['VoiceQueueReport']['count'](_0x9951f0)[_0x3cff('0x25')](function(_0x477f79){_0x5ba398[_0x3cff('0x3d')]=_0x477f79;if(_0x4ddbb0[_0x3cff('0x2f')][_0x3cff('0x3e')]){_0x16504a[_0x3cff('0x3f')]=[{'all':!![]}];}return db[_0x3cff('0x2b')][_0x3cff('0x40')](_0x16504a);})[_0x3cff('0x25')](function(_0x35a454){_0x5ba398[_0x3cff('0x41')]=_0x35a454;return _0x5ba398;})[_0x3cff('0x25')](respondWithFilteredResult(_0x10db3c,_0x16504a,'getVoiceQueuesReport'))[_0x3cff('0x42')](handleError(_0x10db3c,null,_0x3cff('0x4a')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1be3cb4..747ef7c 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 _0x7ad8=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save','update'];(function(_0x10a4aa,_0x450d01){var _0xedab42=function(_0x33c606){while(--_0x33c606){_0x10a4aa['push'](_0x10a4aa['shift']());}};_0xedab42(++_0x450d01);}(_0x7ad8,0x175));var _0x87ad=function(_0x962fc5,_0x58f074){_0x962fc5=_0x962fc5-0x0;var _0x43667c=_0x7ad8[_0x962fc5];return _0x43667c;};'use strict';var EventEmitter=require(_0x87ad('0x0'));var VoiceQueueReport=require(_0x87ad('0x1'))['db'][_0x87ad('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x87ad('0x3'),'afterUpdate':_0x87ad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1378fa){return function(_0x770147,_0x12883c,_0x2a0afb){VoiceQueueReportEvents['emit'](_0x1378fa+':'+_0x770147['id'],_0x770147);VoiceQueueReportEvents[_0x87ad('0x5')](_0x1378fa,_0x770147);_0x2a0afb(null);};}for(var e in events){if(events[_0x87ad('0x6')](e)){var event=events[e];VoiceQueueReport[_0x87ad('0x7')](e,emitEvent(event));}}module[_0x87ad('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xe2ac=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1f9a22,_0x136ec1){var _0x489f0e=function(_0xa8a809){while(--_0xa8a809){_0x1f9a22['push'](_0x1f9a22['shift']());}};_0x489f0e(++_0x136ec1);}(_0xe2ac,0x1de));var _0xce2a=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xe2ac[_0x5c3ae9];return _0x3f5950;};'use strict';var EventEmitter=require(_0xce2a('0x0'));var VoiceQueueReport=require(_0xce2a('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce2a('0x2'),'afterUpdate':_0xce2a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2e6378){return function(_0x35b7db,_0x589439,_0x1265d4){VoiceQueueReportEvents[_0xce2a('0x4')](_0x2e6378+':'+_0x35b7db['id'],_0x35b7db);VoiceQueueReportEvents[_0xce2a('0x4')](_0x2e6378,_0x35b7db);_0x1265d4(null);};}for(var e in events){if(events[_0xce2a('0x5')](e)){var event=events[e];VoiceQueueReport[_0xce2a('0x6')](e,emitEvent(event));}}module[_0xce2a('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 4141298..d479aaf 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 _0x4774=['define','VoiceQueueReport','report_queue','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x34b393,_0x184844){var _0xd854f4=function(_0x729554){while(--_0x729554){_0x34b393['push'](_0x34b393['shift']());}};_0xd854f4(++_0x184844);}(_0x4774,0xa0));var _0x4477=function(_0x40643a,_0x28b6e7){_0x40643a=_0x40643a-0x0;var _0x5ee24e=_0x4774[_0x40643a];return _0x5ee24e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4477('0x0'))('api');var moment=require(_0x4477('0x1'));var BPromise=require(_0x4477('0x2'));var rp=require(_0x4477('0x3'));var fs=require('fs');var path=require(_0x4477('0x4'));var rimraf=require(_0x4477('0x5'));var config=require(_0x4477('0x6'));var attributes=require(_0x4477('0x7'));module[_0x4477('0x8')]=function(_0xc7a752,_0x50a3e3){return _0xc7a752[_0x4477('0x9')](_0x4477('0xa'),attributes,{'tableName':_0x4477('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4477('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x59a3=['../../config/environment','./voiceQueueReport.attributes','define','report_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x59a3,0x123));var _0x359a=function(_0x3ced7c,_0x160993){_0x3ced7c=_0x3ced7c-0x0;var _0x55f590=_0x59a3[_0x3ced7c];return _0x55f590;};'use strict';var _=require(_0x359a('0x0'));var util=require(_0x359a('0x1'));var logger=require(_0x359a('0x2'))('api');var moment=require(_0x359a('0x3'));var BPromise=require(_0x359a('0x4'));var rp=require(_0x359a('0x5'));var fs=require('fs');var path=require(_0x359a('0x6'));var rimraf=require(_0x359a('0x7'));var config=require(_0x359a('0x8'));var attributes=require(_0x359a('0x9'));module['exports']=function(_0x170ef,_0x15083b){return _0x170ef[_0x359a('0xa')]('VoiceQueueReport',attributes,{'tableName':_0x359a('0xb'),'paranoid':![],'indexes':[{'fields':[_0x359a('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e2bc02b..28c44da 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 _0x6311=['../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','include','map','attributes','model','then','CreateVoiceQueueReport','create','update','body','limit','UpdateVoiceQueueReport','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x6311,0x113));var _0x1631=function(_0x467ed7,_0x5f3c23){_0x467ed7=_0x467ed7-0x0;var _0x4572d2=_0x6311[_0x467ed7];return _0x4572d2;};'use strict';var _=require(_0x1631('0x0'));var util=require(_0x1631('0x1'));var moment=require(_0x1631('0x2'));var BPromise=require(_0x1631('0x3'));var rs=require(_0x1631('0x4'));var fs=require('fs');var Redis=require(_0x1631('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1631('0x6'));var logger=require(_0x1631('0x7'))(_0x1631('0x8'));var config=require(_0x1631('0x9'));var jayson=require(_0x1631('0xa'));var client=jayson['client'][_0x1631('0xb')]({'port':0x232a});config['redis']=_[_0x1631('0xc')](config[_0x1631('0xd')],{'host':_0x1631('0xe'),'port':0x18eb});var socket=require(_0x1631('0xf'))(new Redis(config[_0x1631('0xd')]));require(_0x1631('0x10'))[_0x1631('0x11')](socket);function respondWithRpcPromise(_0x166ef0,_0x4b8694,_0x164439){return new BPromise(function(_0x4ebfc8,_0x202fe3){return client[_0x1631('0x12')](_0x166ef0,_0x164439)['then'](function(_0x51f544){logger[_0x1631('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x4b8694,_0x1631('0x14'));logger['debug'](_0x1631('0x15'),_0x4b8694,_0x1631('0x14'),JSON[_0x1631('0x16')](_0x51f544));if(_0x51f544[_0x1631('0x17')]){if(_0x51f544[_0x1631('0x17')][_0x1631('0x18')]===0x1f4){logger['error'](_0x1631('0x19'),_0x4b8694,_0x51f544['error'][_0x1631('0x1a')]);return _0x202fe3(_0x51f544[_0x1631('0x17')][_0x1631('0x1a')]);}logger['error'](_0x1631('0x19'),_0x4b8694,_0x51f544[_0x1631('0x17')]['message']);return _0x4ebfc8(_0x51f544[_0x1631('0x17')]['message']);}else{logger[_0x1631('0x13')](_0x1631('0x19'),_0x4b8694,'request\x20sent');_0x4ebfc8(_0x51f544[_0x1631('0x1b')][_0x1631('0x1a')]);}})[_0x1631('0x1c')](function(_0x54ccf4){logger[_0x1631('0x17')](_0x1631('0x19'),_0x4b8694,_0x54ccf4);_0x202fe3(_0x54ccf4);});});}exports[_0x1631('0x1d')]=function(_0x3333e6){var _0x366952=this;return new Promise(function(_0x314286,_0x54abac){return db[_0x1631('0x1e')][_0x1631('0x1f')]({'raw':_0x3333e6[_0x1631('0x20')]?_0x3333e6['options'][_0x1631('0x21')]===undefined?!![]:![]:!![],'where':_0x3333e6[_0x1631('0x20')]?_0x3333e6[_0x1631('0x20')][_0x1631('0x22')]||null:null,'attributes':_0x3333e6[_0x1631('0x20')]?_0x3333e6[_0x1631('0x20')]['attributes']||null:null,'limit':_0x3333e6[_0x1631('0x20')]?_0x3333e6[_0x1631('0x20')]['limit']||null:null,'include':_0x3333e6[_0x1631('0x20')]?_0x3333e6[_0x1631('0x20')][_0x1631('0x23')]?_[_0x1631('0x24')](_0x3333e6[_0x1631('0x20')][_0x1631('0x23')],function(_0xb2b51){return{'model':db[_0xb2b51['model']],'as':_0xb2b51['as'],'attributes':_0xb2b51[_0x1631('0x25')],'include':_0xb2b51[_0x1631('0x23')]?_[_0x1631('0x24')](_0xb2b51[_0x1631('0x23')],function(_0x54ad6d){return{'model':db[_0x54ad6d['model']],'as':_0x54ad6d['as'],'attributes':_0x54ad6d[_0x1631('0x25')],'include':_0x54ad6d[_0x1631('0x23')]?_[_0x1631('0x24')](_0x54ad6d[_0x1631('0x23')],function(_0x380918){return{'model':db[_0x380918[_0x1631('0x26')]],'as':_0x380918['as'],'attributes':_0x380918[_0x1631('0x25')]};}):[]};}):[]};}):[]:[]})[_0x1631('0x27')](function(_0x19c7c0){logger[_0x1631('0x13')]('GetVoiceQueueReport',_0x3333e6);logger['debug']('GetVoiceQueueReport',_0x3333e6,JSON[_0x1631('0x16')](_0x19c7c0));_0x314286(_0x19c7c0);})['catch'](function(_0x1f433a){logger[_0x1631('0x17')]('GetVoiceQueueReport',_0x1f433a[_0x1631('0x1a')],_0x3333e6);_0x54abac(_0x366952[_0x1631('0x17')](0x1f4,_0x1f433a[_0x1631('0x1a')]));});});};exports[_0x1631('0x28')]=function(_0x1c4a5d){var _0x582b40=this;return new Promise(function(_0x1aa53f,_0x8c6ef8){return db[_0x1631('0x1e')][_0x1631('0x29')](_0x1c4a5d['body'],{'raw':_0x1c4a5d['options']?_0x1c4a5d[_0x1631('0x20')][_0x1631('0x21')]===undefined?!![]:![]:!![]})[_0x1631('0x27')](function(_0x58047d){logger['info'](_0x1631('0x28'),_0x1c4a5d);logger['debug']('CreateVoiceQueueReport',_0x1c4a5d,JSON['stringify'](_0x58047d));_0x1aa53f(_0x58047d);})['catch'](function(_0x2af5f9){logger[_0x1631('0x17')](_0x1631('0x28'),_0x2af5f9[_0x1631('0x1a')],_0x1c4a5d);_0x8c6ef8(_0x582b40[_0x1631('0x17')](0x1f4,_0x2af5f9[_0x1631('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x536015){var _0x14645d=this;return new Promise(function(_0x4771bf,_0x772b88){return db['VoiceQueueReport'][_0x1631('0x2a')](_0x536015[_0x1631('0x2b')],{'raw':_0x536015[_0x1631('0x20')]?_0x536015[_0x1631('0x20')][_0x1631('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x536015[_0x1631('0x20')]?_0x536015[_0x1631('0x20')][_0x1631('0x22')]||null:null,'attributes':_0x536015[_0x1631('0x20')]?_0x536015[_0x1631('0x20')][_0x1631('0x25')]||null:null,'limit':_0x536015['options']?_0x536015[_0x1631('0x20')][_0x1631('0x2c')]||null:null})[_0x1631('0x27')](function(_0x434946){logger['info'](_0x1631('0x2d'),_0x536015);logger[_0x1631('0x2e')](_0x1631('0x2d'),_0x536015,JSON[_0x1631('0x16')](_0x434946));_0x4771bf(_0x434946);})[_0x1631('0x1c')](function(_0x28f160){logger[_0x1631('0x17')]('UpdateVoiceQueueReport',_0x28f160[_0x1631('0x1a')],_0x536015);_0x772b88(_0x14645d[_0x1631('0x17')](0x1f4,_0x28f160['message']));});});}; \ No newline at end of file +var _0x895b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','map','include','model','CreateVoiceQueueReport','create','body','update','limit','UpdateVoiceQueueReport','lodash','util'];(function(_0x1ebee8,_0x5846bc){var _0x857047=function(_0xbfe794){while(--_0xbfe794){_0x1ebee8['push'](_0x1ebee8['shift']());}};_0x857047(++_0x5846bc);}(_0x895b,0x132));var _0xb895=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x895b[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xb895('0x0'));var util=require(_0xb895('0x1'));var moment=require('moment');var BPromise=require(_0xb895('0x2'));var rs=require(_0xb895('0x3'));var fs=require('fs');var Redis=require(_0xb895('0x4'));var db=require(_0xb895('0x5'))['db'];var utils=require(_0xb895('0x6'));var logger=require(_0xb895('0x7'))(_0xb895('0x8'));var config=require(_0xb895('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb895('0xa')]['http']({'port':0x232a});config[_0xb895('0xb')]=_[_0xb895('0xc')](config['redis'],{'host':_0xb895('0xd'),'port':0x18eb});var socket=require(_0xb895('0xe'))(new Redis(config[_0xb895('0xb')]));require(_0xb895('0xf'))[_0xb895('0x10')](socket);function respondWithRpcPromise(_0x5b903f,_0x1c5317,_0x264407){return new BPromise(function(_0x56bb3d,_0x377f7f){return client[_0xb895('0x11')](_0x5b903f,_0x264407)[_0xb895('0x12')](function(_0x2ce7b1){logger['info'](_0xb895('0x13'),_0x1c5317,_0xb895('0x14'));logger[_0xb895('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1c5317,_0xb895('0x14'),JSON[_0xb895('0x16')](_0x2ce7b1));if(_0x2ce7b1[_0xb895('0x17')]){if(_0x2ce7b1['error']['code']===0x1f4){logger[_0xb895('0x17')](_0xb895('0x13'),_0x1c5317,_0x2ce7b1[_0xb895('0x17')]['message']);return _0x377f7f(_0x2ce7b1[_0xb895('0x17')][_0xb895('0x18')]);}logger[_0xb895('0x17')](_0xb895('0x13'),_0x1c5317,_0x2ce7b1[_0xb895('0x17')]['message']);return _0x56bb3d(_0x2ce7b1[_0xb895('0x17')][_0xb895('0x18')]);}else{logger[_0xb895('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x1c5317,_0xb895('0x14'));_0x56bb3d(_0x2ce7b1[_0xb895('0x1a')][_0xb895('0x18')]);}})[_0xb895('0x1b')](function(_0x18153b){logger[_0xb895('0x17')](_0xb895('0x13'),_0x1c5317,_0x18153b);_0x377f7f(_0x18153b);});});}exports[_0xb895('0x1c')]=function(_0x528997){var _0xffaf8c=this;return new Promise(function(_0x2f1139,_0x4e3724){return db[_0xb895('0x1d')][_0xb895('0x1e')]({'raw':_0x528997[_0xb895('0x1f')]?_0x528997['options'][_0xb895('0x20')]===undefined?!![]:![]:!![],'where':_0x528997[_0xb895('0x1f')]?_0x528997[_0xb895('0x1f')][_0xb895('0x21')]||null:null,'attributes':_0x528997[_0xb895('0x1f')]?_0x528997[_0xb895('0x1f')][_0xb895('0x22')]||null:null,'limit':_0x528997[_0xb895('0x1f')]?_0x528997[_0xb895('0x1f')]['limit']||null:null,'include':_0x528997['options']?_0x528997[_0xb895('0x1f')]['include']?_[_0xb895('0x23')](_0x528997[_0xb895('0x1f')][_0xb895('0x24')],function(_0x194681){return{'model':db[_0x194681[_0xb895('0x25')]],'as':_0x194681['as'],'attributes':_0x194681['attributes'],'include':_0x194681[_0xb895('0x24')]?_['map'](_0x194681[_0xb895('0x24')],function(_0x59abdf){return{'model':db[_0x59abdf[_0xb895('0x25')]],'as':_0x59abdf['as'],'attributes':_0x59abdf['attributes'],'include':_0x59abdf[_0xb895('0x24')]?_[_0xb895('0x23')](_0x59abdf[_0xb895('0x24')],function(_0x8c2825){return{'model':db[_0x8c2825['model']],'as':_0x8c2825['as'],'attributes':_0x8c2825[_0xb895('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb895('0x12')](function(_0x51e406){logger[_0xb895('0x19')](_0xb895('0x1c'),_0x528997);logger[_0xb895('0x15')](_0xb895('0x1c'),_0x528997,JSON[_0xb895('0x16')](_0x51e406));_0x2f1139(_0x51e406);})['catch'](function(_0x211186){logger[_0xb895('0x17')](_0xb895('0x1c'),_0x211186[_0xb895('0x18')],_0x528997);_0x4e3724(_0xffaf8c[_0xb895('0x17')](0x1f4,_0x211186['message']));});});};exports[_0xb895('0x26')]=function(_0xf34f81){var _0x44b11a=this;return new Promise(function(_0x27031c,_0x4a143d){return db[_0xb895('0x1d')][_0xb895('0x27')](_0xf34f81[_0xb895('0x28')],{'raw':_0xf34f81[_0xb895('0x1f')]?_0xf34f81[_0xb895('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xb895('0x12')](function(_0x2d02e0){logger[_0xb895('0x19')](_0xb895('0x26'),_0xf34f81);logger[_0xb895('0x15')]('CreateVoiceQueueReport',_0xf34f81,JSON[_0xb895('0x16')](_0x2d02e0));_0x27031c(_0x2d02e0);})[_0xb895('0x1b')](function(_0x1e7518){logger[_0xb895('0x17')](_0xb895('0x26'),_0x1e7518[_0xb895('0x18')],_0xf34f81);_0x4a143d(_0x44b11a['error'](0x1f4,_0x1e7518[_0xb895('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0x37d58a){var _0x2c10ed=this;return new Promise(function(_0x2ee548,_0x246b15){return db['VoiceQueueReport'][_0xb895('0x29')](_0x37d58a['body'],{'raw':_0x37d58a[_0xb895('0x1f')]?_0x37d58a[_0xb895('0x1f')][_0xb895('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37d58a[_0xb895('0x1f')]?_0x37d58a[_0xb895('0x1f')][_0xb895('0x21')]||null:null,'attributes':_0x37d58a['options']?_0x37d58a['options'][_0xb895('0x22')]||null:null,'limit':_0x37d58a[_0xb895('0x1f')]?_0x37d58a['options'][_0xb895('0x2a')]||null:null})[_0xb895('0x12')](function(_0x2ac654){logger[_0xb895('0x19')](_0xb895('0x2b'),_0x37d58a);logger['debug'](_0xb895('0x2b'),_0x37d58a,JSON[_0xb895('0x16')](_0x2ac654));_0x2ee548(_0x2ac654);})['catch'](function(_0x226629){logger[_0xb895('0x17')](_0xb895('0x2b'),_0x226629['message'],_0x37d58a);_0x246b15(_0x2c10ed[_0xb895('0x17')](0x1f4,_0x226629['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 87df8ae..4ab1b63 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 _0xe14f=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','register'];(function(_0x286658,_0x4c08f8){var _0xf6a915=function(_0x1a55b6){while(--_0x1a55b6){_0x286658['push'](_0x286658['shift']());}};_0xf6a915(++_0x4c08f8);}(_0xe14f,0xea));var _0xfe14=function(_0xf52d11,_0x127df8){_0xf52d11=_0xf52d11-0x0;var _0x44b199=_0xe14f[_0xf52d11];return _0x44b199;};'use strict';var VoiceQueueReportEvents=require(_0xfe14('0x0'));var events=[_0xfe14('0x1'),_0xfe14('0x2'),_0xfe14('0x3')];function createListener(_0x452f7f,_0x23b297){return function(_0x211173){_0x23b297[_0xfe14('0x4')](_0x452f7f,_0x211173);};}function removeListener(_0x2b7784,_0x4b7546){return function(){VoiceQueueReportEvents['removeListener'](_0x2b7784,_0x4b7546);};}exports[_0xfe14('0x5')]=function(_0x4f5db4){for(var _0x474d33=0x0,_0x174635=events[_0xfe14('0x6')];_0x474d33<_0x174635;_0x474d33++){var _0x350c85=events[_0x474d33];var _0x4232cd=createListener(_0xfe14('0x7')+_0x350c85,_0x4f5db4);VoiceQueueReportEvents['on'](_0x350c85,_0x4232cd);}}; \ No newline at end of file +var _0xcb3a=['register','length','voiceQueueReport:','./voiceQueueReport.events','update','emit'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0xcb3a,0x1d7));var _0xacb3=function(_0x2bb69a,_0x457be3){_0x2bb69a=_0x2bb69a-0x0;var _0x226dea=_0xcb3a[_0x2bb69a];return _0x226dea;};'use strict';var VoiceQueueReportEvents=require(_0xacb3('0x0'));var events=['save','remove',_0xacb3('0x1')];function createListener(_0x5a95fb,_0xa7b083){return function(_0x1299c1){_0xa7b083[_0xacb3('0x2')](_0x5a95fb,_0x1299c1);};}function removeListener(_0x14f3e3,_0x15b71d){return function(){VoiceQueueReportEvents['removeListener'](_0x14f3e3,_0x15b71d);};}exports[_0xacb3('0x3')]=function(_0x1cf521){for(var _0xa9c481=0x0,_0x4cb19d=events[_0xacb3('0x4')];_0xa9c481<_0x4cb19d;_0xa9c481++){var _0x3c0669=events[_0xa9c481];var _0x4382cc=createListener(_0xacb3('0x5')+_0x3c0669,_0x1cf521);VoiceQueueReportEvents['on'](_0x3c0669,_0x4382cc);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 622d14b..f1de1fb 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 _0x2f07=['fs-extra','../../components/auth/service','./voiceQueuesLog.controller','get','create','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','express','Router'];(function(_0x1f6f1f,_0x30be6b){var _0x2f7025=function(_0x558e20){while(--_0x558e20){_0x1f6f1f['push'](_0x1f6f1f['shift']());}};_0x2f7025(++_0x30be6b);}(_0x2f07,0xb0));var _0x72f0=function(_0x4b4433,_0x466113){_0x4b4433=_0x4b4433-0x0;var _0x48a083=_0x2f07[_0x4b4433];return _0x48a083;};'use strict';var multer=require(_0x72f0('0x0'));var util=require(_0x72f0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x72f0('0x2'));var router=express[_0x72f0('0x3')]();var fs_extra=require(_0x72f0('0x4'));var auth=require(_0x72f0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x72f0('0x6'));router[_0x72f0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x72f0('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x72f0('0x8')]);router[_0x72f0('0x9')](_0x72f0('0xa'),auth[_0x72f0('0xb')](),controller['update']);router[_0x72f0('0xc')]('/:id',auth[_0x72f0('0xb')](),controller[_0x72f0('0xd')]);module[_0x72f0('0xe')]=router; \ No newline at end of file +var _0xface=['util','connect-timeout','express','Router','fs-extra','./voiceQueuesLog.controller','get','isAuthenticated','index','show','create','/:id','update','delete','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xface,0x12c));var _0xefac=function(_0x501572,_0x1baccc){_0x501572=_0x501572-0x0;var _0x1490f5=_0xface[_0x501572];return _0x1490f5;};'use strict';var multer=require('multer');var util=require(_0xefac('0x0'));var path=require('path');var timeout=require(_0xefac('0x1'));var express=require(_0xefac('0x2'));var router=express[_0xefac('0x3')]();var fs_extra=require(_0xefac('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xefac('0x5'));router[_0xefac('0x6')]('/',auth[_0xefac('0x7')](),controller[_0xefac('0x8')]);router['get']('/:id',auth[_0xefac('0x7')](),controller[_0xefac('0x9')]);router['post']('/',auth[_0xefac('0x7')](),controller[_0xefac('0xa')]);router['put'](_0xefac('0xb'),auth['isAuthenticated'](),controller[_0xefac('0xc')]);router[_0xefac('0xd')](_0xefac('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xefac('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 374264b..ad8f368 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 _0x458a=['sequelize','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x458a,0x110));var _0xa458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x458a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa458('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0xa458('0x1')]},'callid':{'type':Sequelize[_0xa458('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa458('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa458('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa458('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa458('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa458('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa458('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xa458('0x2')](_0xa458('0x3'))}}; \ No newline at end of file +var _0x164f=['moment','exports','STRING','DATE','format'];(function(_0x5a9c51,_0x3f98a7){var _0x555c6c=function(_0x498a16){while(--_0x498a16){_0x5a9c51['push'](_0x5a9c51['shift']());}};_0x555c6c(++_0x3f98a7);}(_0x164f,0x186));var _0xf164=function(_0x3b4a17,_0x4af882){_0x3b4a17=_0x3b4a17-0x0;var _0x1e02c4=_0x164f[_0x3b4a17];return _0x1e02c4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf164('0x0'));module[_0xf164('0x1')]={'time':{'type':Sequelize[_0xf164('0x2')]},'callid':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf164('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf164('0x3')],'allowNull':![],'defaultValue':moment()[_0xf164('0x4')]('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 81bd80f..75752cf 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 _0x6128=['limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count'];(function(_0x810c17,_0x1c5fc2){var _0x4f86a2=function(_0x2b9450){while(--_0x2b9450){_0x810c17['push'](_0x810c17['shift']());}};_0x4f86a2(++_0x1c5fc2);}(_0x6128,0xc2));var _0x8612=function(_0x4f482e,_0x37e2f4){_0x4f482e=_0x4f482e-0x0;var _0x3fbb28=_0x6128[_0x4f482e];return _0x3fbb28;};'use strict';var emlformat=require(_0x8612('0x0'));var rimraf=require(_0x8612('0x1'));var zipdir=require(_0x8612('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8612('0x3'));var moment=require(_0x8612('0x4'));var BPromise=require(_0x8612('0x5'));var Mustache=require(_0x8612('0x6'));var util=require(_0x8612('0x7'));var path=require(_0x8612('0x8'));var sox=require('sox');var csv=require(_0x8612('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8612('0xa'));var _=require(_0x8612('0xb'));var squel=require(_0x8612('0xc'));var crypto=require(_0x8612('0xd'));var jsforce=require(_0x8612('0xe'));var deskjs=require(_0x8612('0xf'));var toCsv=require(_0x8612('0x9'));var querystring=require('querystring');var Papa=require(_0x8612('0x10'));var Redis=require(_0x8612('0x11'));var authService=require(_0x8612('0x12'));var qs=require(_0x8612('0x13'));var as=require(_0x8612('0x14'));var hardwareService=require(_0x8612('0x15'));var logger=require(_0x8612('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8612('0x17'));var licenseUtil=require(_0x8612('0x18'));var db=require(_0x8612('0x19'))['db'];function respondWithStatusCode(_0x1e6b64,_0x3fa6ad){_0x3fa6ad=_0x3fa6ad||0xcc;return function(_0x3b466e){if(_0x3b466e){return _0x1e6b64[_0x8612('0x1a')](_0x3fa6ad);}return _0x1e6b64[_0x8612('0x1b')](_0x3fa6ad)['end']();};}function respondWithResult(_0xaaec43,_0x503d90){_0x503d90=_0x503d90||0xc8;return function(_0x40c092){if(_0x40c092){return _0xaaec43[_0x8612('0x1b')](_0x503d90)['json'](_0x40c092);}};}function respondWithFilteredResult(_0x4f1d58,_0x3c7692){return function(_0xab0e8f){if(_0xab0e8f){var _0x11885c=typeof _0x3c7692[_0x8612('0x1c')]===_0x8612('0x1d')&&typeof _0x3c7692['limit']===_0x8612('0x1d');var _0x5a77b9=_0xab0e8f[_0x8612('0x1e')];var _0x5a91d6=_0x11885c?0x0:_0x3c7692[_0x8612('0x1c')];var _0x5334cb=_0x11885c?_0xab0e8f[_0x8612('0x1e')]:_0x3c7692['offset']+_0x3c7692[_0x8612('0x1f')];var _0x4913b7;if(_0x5334cb>=_0x5a77b9){_0x5334cb=_0x5a77b9;_0x4913b7=0xc8;}else{_0x4913b7=0xce;}_0x4f1d58[_0x8612('0x1b')](_0x4913b7);return _0x4f1d58['set'](_0x8612('0x20'),_0x5a91d6+'-'+_0x5334cb+'/'+_0x5a77b9)[_0x8612('0x21')](_0xab0e8f);}return null;};}function patchUpdates(_0x5cdfdc){return function(_0x1a1b29){try{jsonpatch[_0x8612('0x22')](_0x1a1b29,_0x5cdfdc,!![]);}catch(_0x2b6af0){return BPromise[_0x8612('0x23')](_0x2b6af0);}return _0x1a1b29[_0x8612('0x24')]();};}function saveUpdates(_0x49aefe,_0xc6dee){return function(_0x3db102){if(_0x3db102){return _0x3db102[_0x8612('0x25')](_0x49aefe)[_0x8612('0x26')](function(_0xc89b18){return _0xc89b18;});}return null;};}function removeEntity(_0x5ae89d,_0x7fbc96){return function(_0x1893aa){if(_0x1893aa){return _0x1893aa[_0x8612('0x27')]()[_0x8612('0x26')](function(){_0x5ae89d[_0x8612('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ccb20,_0x213fb2){return function(_0xa6195e){if(!_0xa6195e){_0x2ccb20[_0x8612('0x1a')](0x194);}return _0xa6195e;};}function handleError(_0x1cbdec,_0x244e0e){_0x244e0e=_0x244e0e||0x1f4;return function(_0x3abc84){logger[_0x8612('0x28')](_0x3abc84[_0x8612('0x29')]);if(_0x3abc84[_0x8612('0x2a')]){delete _0x3abc84[_0x8612('0x2a')];}_0x1cbdec[_0x8612('0x1b')](_0x244e0e)[_0x8612('0x2b')](_0x3abc84);};}exports[_0x8612('0x2c')]=function(_0x29a8ae,_0x42a810){var _0x27e603={},_0x2b3e84={},_0x2eac80={'count':0x0,'rows':[]};var _0x5764cf=_[_0x8612('0x2d')](db[_0x8612('0x2e')][_0x8612('0x2f')],function(_0x7ca92c){return{'name':_0x7ca92c[_0x8612('0x30')],'type':_0x7ca92c['type'][_0x8612('0x31')]};});_0x2b3e84['model']=_[_0x8612('0x2d')](_0x5764cf,_0x8612('0x2a'));_0x2b3e84[_0x8612('0x32')]=_[_0x8612('0x33')](_0x29a8ae['query']);_0x2b3e84[_0x8612('0x34')]=_[_0x8612('0x35')](_0x2b3e84[_0x8612('0x36')],_0x2b3e84[_0x8612('0x32')]);_0x27e603[_0x8612('0x37')]=_[_0x8612('0x35')](_0x2b3e84[_0x8612('0x36')],qs['fields'](_0x29a8ae['query'][_0x8612('0x38')]));_0x27e603[_0x8612('0x37')]=_0x27e603['attributes'][_0x8612('0x39')]?_0x27e603[_0x8612('0x37')]:_0x2b3e84['model'];if(!_0x29a8ae[_0x8612('0x32')]['hasOwnProperty'](_0x8612('0x3a'))){_0x27e603[_0x8612('0x1f')]=qs[_0x8612('0x1f')](_0x29a8ae[_0x8612('0x32')][_0x8612('0x1f')]);_0x27e603[_0x8612('0x1c')]=qs[_0x8612('0x1c')](_0x29a8ae[_0x8612('0x32')][_0x8612('0x1c')]);}_0x27e603[_0x8612('0x3b')]=qs[_0x8612('0x3c')](_0x29a8ae[_0x8612('0x32')][_0x8612('0x3c')]);_0x27e603[_0x8612('0x3d')]=qs[_0x8612('0x34')](_[_0x8612('0x3e')](_0x29a8ae[_0x8612('0x32')],_0x2b3e84[_0x8612('0x34')]),_0x5764cf);if(_0x29a8ae[_0x8612('0x32')][_0x8612('0x3f')]){_0x27e603[_0x8612('0x3d')]=_[_0x8612('0x40')](_0x27e603['where'],{'$or':_['map'](_0x5764cf,function(_0x3bd9fb){if(_0x3bd9fb['type']!=='VIRTUAL'){var _0x54e6ab={};_0x54e6ab[_0x3bd9fb[_0x8612('0x2a')]]={'$like':'%'+_0x29a8ae[_0x8612('0x32')][_0x8612('0x3f')]+'%'};return _0x54e6ab;}})});}_0x27e603=_[_0x8612('0x40')]({},_0x27e603,_0x29a8ae['options']);var _0xb96ed4={'where':_0x27e603[_0x8612('0x3d')]};return db[_0x8612('0x2e')][_0x8612('0x1e')](_0xb96ed4)[_0x8612('0x26')](function(_0xaa7162){_0x2eac80[_0x8612('0x1e')]=_0xaa7162;if(_0x29a8ae[_0x8612('0x32')]['includeAll']){_0x27e603[_0x8612('0x41')]=[{'all':!![]}];}return db[_0x8612('0x2e')][_0x8612('0x42')](_0x27e603);})[_0x8612('0x26')](function(_0xa7c8ad){_0x2eac80[_0x8612('0x43')]=_0xa7c8ad;return _0x2eac80;})['then'](respondWithFilteredResult(_0x42a810,_0x27e603))[_0x8612('0x44')](handleError(_0x42a810,null));};exports[_0x8612('0x45')]=function(_0x467674,_0x57299a){var _0x44c6f1={'raw':!![],'where':{'id':_0x467674[_0x8612('0x46')]['id']}},_0x2bb791={};_0x2bb791['model']=_[_0x8612('0x33')](db[_0x8612('0x2e')][_0x8612('0x2f')]);_0x2bb791['query']=_[_0x8612('0x33')](_0x467674['query']);_0x2bb791[_0x8612('0x34')]=_[_0x8612('0x35')](_0x2bb791[_0x8612('0x36')],_0x2bb791['query']);_0x44c6f1['attributes']=_[_0x8612('0x35')](_0x2bb791['model'],qs['fields'](_0x467674[_0x8612('0x32')][_0x8612('0x38')]));_0x44c6f1[_0x8612('0x37')]=_0x44c6f1['attributes']['length']?_0x44c6f1['attributes']:_0x2bb791[_0x8612('0x36')];if(_0x467674[_0x8612('0x32')][_0x8612('0x47')]){_0x44c6f1[_0x8612('0x41')]=[{'all':!![]}];}_0x44c6f1=_[_0x8612('0x40')]({},_0x44c6f1,_0x467674['options']);return db['VoiceQueuesLog'][_0x8612('0x48')](_0x44c6f1)[_0x8612('0x26')](handleEntityNotFound(_0x57299a,null))['then'](respondWithResult(_0x57299a,null))[_0x8612('0x44')](handleError(_0x57299a,null));};exports[_0x8612('0x49')]=function(_0x282b0a,_0x47ff71){return db['VoiceQueuesLog']['create'](_0x282b0a['body'],{})['then'](respondWithResult(_0x47ff71,0xc9))[_0x8612('0x44')](handleError(_0x47ff71,null));};exports[_0x8612('0x25')]=function(_0xd3952b,_0x43f6ec){if(_0xd3952b['body']['id']){delete _0xd3952b[_0x8612('0x4a')]['id'];}return db['VoiceQueuesLog'][_0x8612('0x48')]({'where':{'id':_0xd3952b[_0x8612('0x46')]['id']}})[_0x8612('0x26')](handleEntityNotFound(_0x43f6ec,null))[_0x8612('0x26')](saveUpdates(_0xd3952b[_0x8612('0x4a')],null))['then'](respondWithResult(_0x43f6ec,null))[_0x8612('0x44')](handleError(_0x43f6ec,null));};exports[_0x8612('0x27')]=function(_0x9cc92a,_0x104774){return db[_0x8612('0x2e')][_0x8612('0x48')]({'where':{'id':_0x9cc92a['params']['id']}})['then'](handleEntityNotFound(_0x104774,null))['then'](removeEntity(_0x104774,null))[_0x8612('0x44')](handleError(_0x104774,null));}; \ No newline at end of file +var _0x6a29=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','eml-format','fast-json-patch','request-promise','moment','path','sox','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x6a29,0x1a4));var _0x96a2=function(_0x199fea,_0x90c9a){_0x199fea=_0x199fea-0x0;var _0x2b3552=_0x6a29[_0x199fea];return _0x2b3552;};'use strict';var emlformat=require(_0x96a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x96a2('0x1'));var rp=require(_0x96a2('0x2'));var moment=require(_0x96a2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x96a2('0x4'));var sox=require(_0x96a2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96a2('0x6'));var squel=require(_0x96a2('0x7'));var crypto=require(_0x96a2('0x8'));var jsforce=require(_0x96a2('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x96a2('0xa'));var querystring=require('querystring');var Papa=require(_0x96a2('0xb'));var Redis=require(_0x96a2('0xc'));var authService=require(_0x96a2('0xd'));var qs=require(_0x96a2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96a2('0xf'));var logger=require('../../config/logger')(_0x96a2('0x10'));var utils=require('../../config/utils');var config=require(_0x96a2('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3136d2,_0x193c8d){_0x193c8d=_0x193c8d||0xcc;return function(_0x29eec3){if(_0x29eec3){return _0x3136d2[_0x96a2('0x12')](_0x193c8d);}return _0x3136d2[_0x96a2('0x13')](_0x193c8d)[_0x96a2('0x14')]();};}function respondWithResult(_0x1d32c7,_0x8be002){_0x8be002=_0x8be002||0xc8;return function(_0x47c75e){if(_0x47c75e){return _0x1d32c7['status'](_0x8be002)[_0x96a2('0x15')](_0x47c75e);}};}function respondWithFilteredResult(_0x54e510,_0x5e842a){return function(_0x1702c3){if(_0x1702c3){var _0x71e8cb=typeof _0x5e842a[_0x96a2('0x16')]==='undefined'&&typeof _0x5e842a[_0x96a2('0x17')]===_0x96a2('0x18');var _0x1fa118=_0x1702c3['count'];var _0x2803a3=_0x71e8cb?0x0:_0x5e842a[_0x96a2('0x16')];var _0x5178ef=_0x71e8cb?_0x1702c3[_0x96a2('0x19')]:_0x5e842a[_0x96a2('0x16')]+_0x5e842a[_0x96a2('0x17')];var _0x1d75c0;if(_0x5178ef>=_0x1fa118){_0x5178ef=_0x1fa118;_0x1d75c0=0xc8;}else{_0x1d75c0=0xce;}_0x54e510[_0x96a2('0x13')](_0x1d75c0);return _0x54e510[_0x96a2('0x1a')](_0x96a2('0x1b'),_0x2803a3+'-'+_0x5178ef+'/'+_0x1fa118)['json'](_0x1702c3);}return null;};}function patchUpdates(_0x26aa64){return function(_0x2fa83e){try{jsonpatch['apply'](_0x2fa83e,_0x26aa64,!![]);}catch(_0x3b5c14){return BPromise[_0x96a2('0x1c')](_0x3b5c14);}return _0x2fa83e['save']();};}function saveUpdates(_0x3ce630,_0x1d0c5a){return function(_0x47f1b9){if(_0x47f1b9){return _0x47f1b9[_0x96a2('0x1d')](_0x3ce630)[_0x96a2('0x1e')](function(_0x5b49f5){return _0x5b49f5;});}return null;};}function removeEntity(_0x70c6aa,_0x4bb29c){return function(_0x4d03d5){if(_0x4d03d5){return _0x4d03d5[_0x96a2('0x1f')]()[_0x96a2('0x1e')](function(){_0x70c6aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19efcc,_0x3076b6){return function(_0x46611a){if(!_0x46611a){_0x19efcc[_0x96a2('0x12')](0x194);}return _0x46611a;};}function handleError(_0x1ef442,_0x2633b9){_0x2633b9=_0x2633b9||0x1f4;return function(_0x31fd6b){logger[_0x96a2('0x20')](_0x31fd6b['stack']);if(_0x31fd6b[_0x96a2('0x21')]){delete _0x31fd6b[_0x96a2('0x21')];}_0x1ef442[_0x96a2('0x13')](_0x2633b9)[_0x96a2('0x22')](_0x31fd6b);};}exports['index']=function(_0x3aeae4,_0x22447a){var _0x2c3984={},_0x16c383={},_0x5670eb={'count':0x0,'rows':[]};var _0x5c37f5=_[_0x96a2('0x23')](db[_0x96a2('0x24')][_0x96a2('0x25')],function(_0x203380){return{'name':_0x203380[_0x96a2('0x26')],'type':_0x203380[_0x96a2('0x27')][_0x96a2('0x28')]};});_0x16c383[_0x96a2('0x29')]=_[_0x96a2('0x23')](_0x5c37f5,_0x96a2('0x21'));_0x16c383[_0x96a2('0x2a')]=_[_0x96a2('0x2b')](_0x3aeae4[_0x96a2('0x2a')]);_0x16c383[_0x96a2('0x2c')]=_[_0x96a2('0x2d')](_0x16c383[_0x96a2('0x29')],_0x16c383[_0x96a2('0x2a')]);_0x2c3984[_0x96a2('0x2e')]=_['intersection'](_0x16c383[_0x96a2('0x29')],qs[_0x96a2('0x2f')](_0x3aeae4[_0x96a2('0x2a')][_0x96a2('0x2f')]));_0x2c3984[_0x96a2('0x2e')]=_0x2c3984['attributes'][_0x96a2('0x30')]?_0x2c3984['attributes']:_0x16c383[_0x96a2('0x29')];if(!_0x3aeae4['query'][_0x96a2('0x31')](_0x96a2('0x32'))){_0x2c3984['limit']=qs[_0x96a2('0x17')](_0x3aeae4[_0x96a2('0x2a')][_0x96a2('0x17')]);_0x2c3984[_0x96a2('0x16')]=qs[_0x96a2('0x16')](_0x3aeae4[_0x96a2('0x2a')][_0x96a2('0x16')]);}_0x2c3984['order']=qs[_0x96a2('0x33')](_0x3aeae4[_0x96a2('0x2a')][_0x96a2('0x33')]);_0x2c3984[_0x96a2('0x34')]=qs['filters'](_[_0x96a2('0x35')](_0x3aeae4[_0x96a2('0x2a')],_0x16c383[_0x96a2('0x2c')]),_0x5c37f5);if(_0x3aeae4[_0x96a2('0x2a')][_0x96a2('0x36')]){_0x2c3984['where']=_[_0x96a2('0x37')](_0x2c3984['where'],{'$or':_[_0x96a2('0x23')](_0x5c37f5,function(_0x5a3022){if(_0x5a3022[_0x96a2('0x27')]!==_0x96a2('0x38')){var _0x2e17fe={};_0x2e17fe[_0x5a3022[_0x96a2('0x21')]]={'$like':'%'+_0x3aeae4[_0x96a2('0x2a')]['filter']+'%'};return _0x2e17fe;}})});}_0x2c3984=_['merge']({},_0x2c3984,_0x3aeae4[_0x96a2('0x39')]);var _0x1d27b7={'where':_0x2c3984[_0x96a2('0x34')]};return db[_0x96a2('0x24')][_0x96a2('0x19')](_0x1d27b7)[_0x96a2('0x1e')](function(_0x203afd){_0x5670eb[_0x96a2('0x19')]=_0x203afd;if(_0x3aeae4[_0x96a2('0x2a')]['includeAll']){_0x2c3984[_0x96a2('0x3a')]=[{'all':!![]}];}return db[_0x96a2('0x24')][_0x96a2('0x3b')](_0x2c3984);})[_0x96a2('0x1e')](function(_0x5e3595){_0x5670eb[_0x96a2('0x3c')]=_0x5e3595;return _0x5670eb;})[_0x96a2('0x1e')](respondWithFilteredResult(_0x22447a,_0x2c3984))[_0x96a2('0x3d')](handleError(_0x22447a,null));};exports['show']=function(_0x1fd220,_0xe5bd22){var _0x1698d8={'raw':!![],'where':{'id':_0x1fd220[_0x96a2('0x3e')]['id']}},_0x1a4502={};_0x1a4502[_0x96a2('0x29')]=_[_0x96a2('0x2b')](db[_0x96a2('0x24')]['rawAttributes']);_0x1a4502[_0x96a2('0x2a')]=_[_0x96a2('0x2b')](_0x1fd220['query']);_0x1a4502[_0x96a2('0x2c')]=_['intersection'](_0x1a4502['model'],_0x1a4502[_0x96a2('0x2a')]);_0x1698d8['attributes']=_['intersection'](_0x1a4502[_0x96a2('0x29')],qs['fields'](_0x1fd220['query'][_0x96a2('0x2f')]));_0x1698d8[_0x96a2('0x2e')]=_0x1698d8[_0x96a2('0x2e')]['length']?_0x1698d8['attributes']:_0x1a4502[_0x96a2('0x29')];if(_0x1fd220['query'][_0x96a2('0x3f')]){_0x1698d8[_0x96a2('0x3a')]=[{'all':!![]}];}_0x1698d8=_[_0x96a2('0x37')]({},_0x1698d8,_0x1fd220[_0x96a2('0x39')]);return db[_0x96a2('0x24')][_0x96a2('0x40')](_0x1698d8)[_0x96a2('0x1e')](handleEntityNotFound(_0xe5bd22,null))[_0x96a2('0x1e')](respondWithResult(_0xe5bd22,null))['catch'](handleError(_0xe5bd22,null));};exports[_0x96a2('0x41')]=function(_0xa3ea80,_0x1cec70){return db['VoiceQueuesLog'][_0x96a2('0x41')](_0xa3ea80[_0x96a2('0x42')],{})[_0x96a2('0x1e')](respondWithResult(_0x1cec70,0xc9))[_0x96a2('0x3d')](handleError(_0x1cec70,null));};exports[_0x96a2('0x1d')]=function(_0x5f16f2,_0x1b2a5f){if(_0x5f16f2['body']['id']){delete _0x5f16f2[_0x96a2('0x42')]['id'];}return db[_0x96a2('0x24')]['find']({'where':{'id':_0x5f16f2[_0x96a2('0x3e')]['id']}})[_0x96a2('0x1e')](handleEntityNotFound(_0x1b2a5f,null))[_0x96a2('0x1e')](saveUpdates(_0x5f16f2[_0x96a2('0x42')],null))[_0x96a2('0x1e')](respondWithResult(_0x1b2a5f,null))[_0x96a2('0x3d')](handleError(_0x1b2a5f,null));};exports[_0x96a2('0x1f')]=function(_0x153f9e,_0xcae193){return db[_0x96a2('0x24')][_0x96a2('0x40')]({'where':{'id':_0x153f9e[_0x96a2('0x3e')]['id']}})[_0x96a2('0x1e')](handleEntityNotFound(_0xcae193,null))[_0x96a2('0x1e')](removeEntity(_0xcae193,null))['catch'](handleError(_0xcae193,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7f460b1..c699689 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 _0x177d=['./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x2d1e99,_0xa8fb07){var _0x12598f=function(_0x44f24e){while(--_0x44f24e){_0x2d1e99['push'](_0x2d1e99['shift']());}};_0x12598f(++_0xa8fb07);}(_0x177d,0x68));var _0xd177=function(_0x13742a,_0x5bac8b){_0x13742a=_0x13742a-0x0;var _0x4873f3=_0x177d[_0x13742a];return _0x4873f3;};'use strict';var _=require(_0xd177('0x0'));var util=require(_0xd177('0x1'));var logger=require(_0xd177('0x2'))(_0xd177('0x3'));var moment=require(_0xd177('0x4'));var BPromise=require(_0xd177('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd177('0x6'));var config=require(_0xd177('0x7'));var attributes=require(_0xd177('0x8'));module[_0xd177('0x9')]=function(_0x3e88f5,_0x5d7a11){return _0x3e88f5[_0xd177('0xa')](_0xd177('0xb'),attributes,{'tableName':_0xd177('0xc'),'paranoid':![],'indexes':[{'name':_0xd177('0xd'),'fields':[_0xd177('0xe'),_0xd177('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8ff5=['path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x58557d,_0x53da2e){var _0x3c6034=function(_0x3931f8){while(--_0x3931f8){_0x58557d['push'](_0x58557d['shift']());}};_0x3c6034(++_0x53da2e);}(_0x8ff5,0x78));var _0x58ff=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x8ff5[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x58ff('0x0'));var util=require(_0x58ff('0x1'));var logger=require(_0x58ff('0x2'))(_0x58ff('0x3'));var moment=require(_0x58ff('0x4'));var BPromise=require(_0x58ff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ff('0x6'));var rimraf=require(_0x58ff('0x7'));var config=require('../../config/environment');var attributes=require(_0x58ff('0x8'));module[_0x58ff('0x9')]=function(_0x52ff98,_0x425959){return _0x52ff98[_0x58ff('0xa')](_0x58ff('0xb'),attributes,{'tableName':_0x58ff('0xc'),'paranoid':![],'indexes':[{'name':_0x58ff('0xd'),'fields':['event','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 9732f8d..a531964 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 _0x9567=['info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x1d5458,_0x3acf09){var _0x9bf6f=function(_0x8d948c){while(--_0x8d948c){_0x1d5458['push'](_0x1d5458['shift']());}};_0x9bf6f(++_0x3acf09);}(_0x9567,0xdc));var _0x7956=function(_0x416d4c,_0x58d984){_0x416d4c=_0x416d4c-0x0;var _0x52739d=_0x9567[_0x416d4c];return _0x52739d;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});} \ No newline at end of file +var _0xb49e=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb49e,0x84));var _0xeb49=function(_0x492532,_0x5aedd2){_0x492532=_0x492532-0x0;var _0x258d3d=_0xb49e[_0x492532];return _0x258d3d;};'use strict';var _=require(_0xeb49('0x0'));var util=require(_0xeb49('0x1'));var moment=require(_0xeb49('0x2'));var BPromise=require('bluebird');var rs=require(_0xeb49('0x3'));var fs=require('fs');var Redis=require(_0xeb49('0x4'));var db=require(_0xeb49('0x5'))['db'];var utils=require(_0xeb49('0x6'));var logger=require(_0xeb49('0x7'))(_0xeb49('0x8'));var config=require(_0xeb49('0x9'));var jayson=require(_0xeb49('0xa'));var client=jayson[_0xeb49('0xb')][_0xeb49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a6e30,_0x366b45,_0x12973c){return new BPromise(function(_0x331ea9,_0x4c66a0){return client[_0xeb49('0xd')](_0x1a6e30,_0x12973c)[_0xeb49('0xe')](function(_0x120b5f){logger[_0xeb49('0xf')](_0xeb49('0x10'),_0x366b45,_0xeb49('0x11'));logger[_0xeb49('0x12')](_0xeb49('0x13'),_0x366b45,_0xeb49('0x11'),JSON[_0xeb49('0x14')](_0x120b5f));if(_0x120b5f[_0xeb49('0x15')]){if(_0x120b5f[_0xeb49('0x15')][_0xeb49('0x16')]===0x1f4){logger[_0xeb49('0x15')](_0xeb49('0x10'),_0x366b45,_0x120b5f[_0xeb49('0x15')][_0xeb49('0x17')]);return _0x4c66a0(_0x120b5f['error'][_0xeb49('0x17')]);}logger[_0xeb49('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0x366b45,_0x120b5f['error'][_0xeb49('0x17')]);return _0x331ea9(_0x120b5f[_0xeb49('0x15')][_0xeb49('0x17')]);}else{logger[_0xeb49('0xf')](_0xeb49('0x10'),_0x366b45,_0xeb49('0x11'));_0x331ea9(_0x120b5f[_0xeb49('0x18')]['message']);}})[_0xeb49('0x19')](function(_0x1ea69f){logger[_0xeb49('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0x366b45,_0x1ea69f);_0x4c66a0(_0x1ea69f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index d8606eb..9654738 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 _0x7184=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download','downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','put','path'];(function(_0x105873,_0xb66cc){var _0x4c8519=function(_0x3924a2){while(--_0x3924a2){_0x105873['push'](_0x105873['shift']());}};_0x4c8519(++_0xb66cc);}(_0x7184,0x17b));var _0x4718=function(_0x10244a,_0x3e96f4){_0x10244a=_0x10244a-0x0;var _0x4daacd=_0x7184[_0x10244a];return _0x4daacd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4718('0x0'));var timeout=require('connect-timeout');var express=require(_0x4718('0x1'));var router=express[_0x4718('0x2')]();var fs_extra=require(_0x4718('0x3'));var auth=require(_0x4718('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4718('0x5'));var controller=require(_0x4718('0x6'));router[_0x4718('0x7')]('/',auth[_0x4718('0x8')](),controller[_0x4718('0x9')]);router['get'](_0x4718('0xa'),auth[_0x4718('0x8')](),controller['describe']);router['get'](_0x4718('0xb'),auth[_0x4718('0x8')](),controller[_0x4718('0xc')]);router[_0x4718('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x4718('0xd')]);router[_0x4718('0x7')]('/:id/downloads',controller[_0x4718('0xe')]);router[_0x4718('0x7')](_0x4718('0xf'),auth[_0x4718('0x8')](),controller[_0x4718('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4718('0x11')]);router['post'](_0x4718('0xf'),auth[_0x4718('0x8')](),controller[_0x4718('0x12')]);router[_0x4718('0x13')]('/:id',auth[_0x4718('0x8')](),controller['update']);router['delete']('/:id',auth[_0x4718('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb6c8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','isAuthenticated','describe','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','/:id','update','delete','destroy','multer','path'];(function(_0x3cb391,_0x471df5){var _0x50fabf=function(_0x5e93d2){while(--_0x5e93d2){_0x3cb391['push'](_0x3cb391['shift']());}};_0x50fabf(++_0x471df5);}(_0xb6c8,0x6a));var _0x8b6c=function(_0x101c99,_0x27a8ed){_0x101c99=_0x101c99-0x0;var _0x250a4e=_0xb6c8[_0x101c99];return _0x250a4e;};'use strict';var multer=require(_0x8b6c('0x0'));var util=require('util');var path=require(_0x8b6c('0x1'));var timeout=require(_0x8b6c('0x2'));var express=require(_0x8b6c('0x3'));var router=express[_0x8b6c('0x4')]();var fs_extra=require(_0x8b6c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b6c('0x6'));var config=require(_0x8b6c('0x7'));var controller=require(_0x8b6c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b6c('0x9')]);router[_0x8b6c('0xa')]('/describe',auth[_0x8b6c('0xb')](),controller[_0x8b6c('0xc')]);router[_0x8b6c('0xa')]('/:id',auth[_0x8b6c('0xb')](),controller[_0x8b6c('0xd')]);router[_0x8b6c('0xa')](_0x8b6c('0xe'),auth[_0x8b6c('0xb')](),controller['download']);router[_0x8b6c('0xa')](_0x8b6c('0xf'),controller[_0x8b6c('0x10')]);router[_0x8b6c('0xa')](_0x8b6c('0x11'),auth[_0x8b6c('0xb')](),controller[_0x8b6c('0x12')]);router[_0x8b6c('0x13')]('/',auth['isAuthenticated'](),controller[_0x8b6c('0x14')]);router['post']('/:id/transcribe',auth[_0x8b6c('0xb')](),controller[_0x8b6c('0x15')]);router[_0x8b6c('0x16')](_0x8b6c('0x17'),auth['isAuthenticated'](),controller[_0x8b6c('0x18')]);router[_0x8b6c('0x19')](_0x8b6c('0x17'),auth[_0x8b6c('0xb')](),controller[_0x8b6c('0x1a')]);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 6357675..6c6af90 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 _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index ed8cce6..adcbf00 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 _0x4ac7=['to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','then','error','stack','name','send','index','map','VoiceRecording','fieldName','type','differenceBy','format','query','filters','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','rows','show','params','intersection','find','create','update','body','catch','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','download','extname','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','Location','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','moment','bluebird','mustache','path','sox'];(function(_0x2f74ce,_0x3c3647){var _0x13d8f7=function(_0x1dcb00){while(--_0x1dcb00){_0x2f74ce['push'](_0x2f74ce['shift']());}};_0x13d8f7(++_0x3c3647);}(_0x4ac7,0x1b5));var _0x74ac=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x4ac7[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require(_0x74ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74ac('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x74ac('0x2'));var BPromise=require(_0x74ac('0x3'));var Mustache=require(_0x74ac('0x4'));var util=require('util');var path=require(_0x74ac('0x5'));var sox=require(_0x74ac('0x6'));var csv=require(_0x74ac('0x7'));var ejs=require(_0x74ac('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74ac('0x9'));var squel=require(_0x74ac('0xa'));var crypto=require(_0x74ac('0xb'));var jsforce=require(_0x74ac('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x74ac('0x7'));var querystring=require(_0x74ac('0xd'));var Papa=require(_0x74ac('0xe'));var AWS=require(_0x74ac('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0x74ac('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x74ac('0x11'));var as=require(_0x74ac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74ac('0x13'))(_0x74ac('0x14'));var utils=require(_0x74ac('0x15'));var config=require(_0x74ac('0x16'));var licenseUtil=require(_0x74ac('0x17'));var db=require(_0x74ac('0x18'))['db'];function respondWithStatusCode(_0x1ff84f,_0x33b760){_0x33b760=_0x33b760||0xcc;return function(_0x5b5551){if(_0x5b5551){return _0x1ff84f[_0x74ac('0x19')](_0x33b760);}return _0x1ff84f[_0x74ac('0x1a')](_0x33b760)[_0x74ac('0x1b')]();};}function respondWithResult(_0x34022f,_0x2e1d65){_0x2e1d65=_0x2e1d65||0xc8;return function(_0x19db03){if(_0x19db03){return _0x34022f[_0x74ac('0x1a')](_0x2e1d65)['json'](_0x19db03);}};}function respondWithFilteredResult(_0x4c678c,_0x193fe9){return function(_0x410146){if(_0x410146){var _0x3866d7=typeof _0x193fe9[_0x74ac('0x1c')]===_0x74ac('0x1d')&&typeof _0x193fe9[_0x74ac('0x1e')]===_0x74ac('0x1d');var _0x108cb5=_0x410146[_0x74ac('0x1f')];var _0x584855=_0x3866d7?0x0:_0x193fe9[_0x74ac('0x1c')];var _0x348d9e=_0x3866d7?_0x410146[_0x74ac('0x1f')]:_0x193fe9[_0x74ac('0x1c')]+_0x193fe9['limit'];var _0xb9c8e0;if(_0x348d9e>=_0x108cb5){_0x348d9e=_0x108cb5;_0xb9c8e0=0xc8;}else{_0xb9c8e0=0xce;}_0x4c678c[_0x74ac('0x1a')](_0xb9c8e0);return _0x4c678c['set'](_0x74ac('0x20'),_0x584855+'-'+_0x348d9e+'/'+_0x108cb5)['json'](_0x410146);}return null;};}function patchUpdates(_0x57a664){return function(_0x214ac3){try{jsonpatch['apply'](_0x214ac3,_0x57a664,!![]);}catch(_0x332f15){return BPromise[_0x74ac('0x21')](_0x332f15);}return _0x214ac3[_0x74ac('0x22')]();};}function saveUpdates(_0x43911e,_0x2d525f){return function(_0x1b43d8){if(_0x1b43d8){return _0x1b43d8['update'](_0x43911e)[_0x74ac('0x23')](function(_0x53c005){return _0x53c005;});}return null;};}function removeEntity(_0x4b39dd,_0x295f39){return function(_0x5ce2ea){if(_0x5ce2ea){return _0x5ce2ea['destroy']()[_0x74ac('0x23')](function(){_0x4b39dd[_0x74ac('0x1a')](0xcc)[_0x74ac('0x1b')]();});}};}function handleEntityNotFound(_0x2f5b40,_0x47c029){return function(_0x54e840){if(!_0x54e840){_0x2f5b40[_0x74ac('0x19')](0x194);}return _0x54e840;};}function handleError(_0x4964b8,_0x2b4103){_0x2b4103=_0x2b4103||0x1f4;return function(_0x5b9c65){logger[_0x74ac('0x24')](_0x5b9c65[_0x74ac('0x25')]);if(_0x5b9c65['name']){delete _0x5b9c65[_0x74ac('0x26')];}_0x4964b8[_0x74ac('0x1a')](_0x2b4103)[_0x74ac('0x27')](_0x5b9c65);};}exports[_0x74ac('0x28')]=function(_0x4f07f7,_0x207dbd){var _0xe23984={},_0x31c487={},_0x2f3977={'count':0x0,'rows':[]};var _0x56be28=_[_0x74ac('0x29')](db[_0x74ac('0x2a')]['rawAttributes'],function(_0x4dd775){return{'name':_0x4dd775[_0x74ac('0x2b')],'type':_0x4dd775[_0x74ac('0x2c')]['key']};});_0x31c487['model']=_[_0x74ac('0x2d')](_[_0x74ac('0x29')](_0x56be28,_0x74ac('0x26')),[_0x74ac('0x2e')]);_0x31c487[_0x74ac('0x2f')]=_['keys'](_0x4f07f7[_0x74ac('0x2f')]);_0x31c487[_0x74ac('0x30')]=_['intersection'](_0x31c487['model'],_0x31c487[_0x74ac('0x2f')]);_0xe23984[_0x74ac('0x31')]=_['intersection'](_0x31c487[_0x74ac('0x32')],qs['fields'](_0x4f07f7[_0x74ac('0x2f')][_0x74ac('0x33')]));_0xe23984[_0x74ac('0x31')]=_0xe23984['attributes'][_0x74ac('0x34')]?_0xe23984[_0x74ac('0x31')]:_0x31c487[_0x74ac('0x32')];if(!_0x4f07f7[_0x74ac('0x2f')][_0x74ac('0x35')]('nolimit')){_0xe23984[_0x74ac('0x1e')]=qs[_0x74ac('0x1e')](_0x4f07f7['query']['limit']);_0xe23984[_0x74ac('0x1c')]=qs[_0x74ac('0x1c')](_0x4f07f7[_0x74ac('0x2f')][_0x74ac('0x1c')]);}_0xe23984[_0x74ac('0x36')]=qs[_0x74ac('0x37')](_0x4f07f7['query'][_0x74ac('0x37')]);_0xe23984[_0x74ac('0x38')]=qs[_0x74ac('0x30')](_[_0x74ac('0x39')](_0x4f07f7[_0x74ac('0x2f')],_0x31c487[_0x74ac('0x30')]),_0x56be28);if(_0x4f07f7['query'][_0x74ac('0x3a')]){_0xe23984[_0x74ac('0x38')]=_['merge'](_0xe23984[_0x74ac('0x38')],{'$or':_['map'](_0x56be28,function(_0x3b88bc){if(_0x3b88bc[_0x74ac('0x2c')]!=='VIRTUAL'){var _0x5279d6={};_0x5279d6[_0x3b88bc['name']]={'$like':'%'+_0x4f07f7[_0x74ac('0x2f')][_0x74ac('0x3a')]+'%'};return _0x5279d6;}})});}_0xe23984=_[_0x74ac('0x3b')]({},_0xe23984,_0x4f07f7[_0x74ac('0x3c')]);var _0x32e6fd={'where':_0xe23984[_0x74ac('0x38')]};return db[_0x74ac('0x2a')]['count'](_0x32e6fd)[_0x74ac('0x23')](function(_0x504ab1){_0x2f3977[_0x74ac('0x1f')]=_0x504ab1;if(_0x4f07f7[_0x74ac('0x2f')]['includeAll']){_0xe23984[_0x74ac('0x3d')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0xe23984);})['then'](function(_0x1b5bf6){_0x2f3977[_0x74ac('0x3e')]=_0x1b5bf6;return _0x2f3977;})[_0x74ac('0x23')](respondWithFilteredResult(_0x207dbd,_0xe23984))['catch'](handleError(_0x207dbd,null));};exports[_0x74ac('0x3f')]=function(_0x2e961c,_0x5c77f8){var _0xe07020={'raw':![],'where':{'id':_0x2e961c[_0x74ac('0x40')]['id']}},_0x379492={};_0x379492[_0x74ac('0x32')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x379492['query']=_['keys'](_0x2e961c[_0x74ac('0x2f')]);_0x379492['filters']=_[_0x74ac('0x41')](_0x379492[_0x74ac('0x32')],_0x379492['query']);_0xe07020[_0x74ac('0x31')]=_[_0x74ac('0x41')](_0x379492[_0x74ac('0x32')],qs['fields'](_0x2e961c[_0x74ac('0x2f')][_0x74ac('0x33')]));_0xe07020[_0x74ac('0x31')]=_0xe07020[_0x74ac('0x31')]['length']?_0xe07020[_0x74ac('0x31')]:_0x379492[_0x74ac('0x32')];if(_0x2e961c[_0x74ac('0x2f')]['includeAll']){_0xe07020['include']=[{'all':!![]}];}_0xe07020=_['merge']({},_0xe07020,_0x2e961c[_0x74ac('0x3c')]);return db['VoiceRecording'][_0x74ac('0x42')](_0xe07020)[_0x74ac('0x23')](handleEntityNotFound(_0x5c77f8,null))[_0x74ac('0x23')](respondWithResult(_0x5c77f8,null))['catch'](handleError(_0x5c77f8,null));};exports[_0x74ac('0x43')]=function(_0x335e9,_0x2bd52a){return db[_0x74ac('0x2a')][_0x74ac('0x43')](_0x335e9['body'],{})['then'](respondWithResult(_0x2bd52a,0xc9))['catch'](handleError(_0x2bd52a,null));};exports[_0x74ac('0x44')]=function(_0x5a604a,_0x38b3f5){if(_0x5a604a[_0x74ac('0x45')]['id']){delete _0x5a604a[_0x74ac('0x45')]['id'];}return db['VoiceRecording'][_0x74ac('0x42')]({'where':{'id':_0x5a604a['params']['id']}})[_0x74ac('0x23')](handleEntityNotFound(_0x38b3f5,null))[_0x74ac('0x23')](saveUpdates(_0x5a604a[_0x74ac('0x45')],null))['then'](respondWithResult(_0x38b3f5,null))[_0x74ac('0x46')](handleError(_0x38b3f5,null));};exports[_0x74ac('0x47')]=function(_0x577b39,_0x3f547e){return db[_0x74ac('0x2a')][_0x74ac('0x47')]()[_0x74ac('0x23')](respondWithResult(_0x3f547e,null))[_0x74ac('0x46')](handleError(_0x3f547e,null));};exports['download']=function(_0xb64c09,_0x4f66b3,_0x4ebeab){var _0x1a790a=require(_0x74ac('0x48'));var _0x30e27c=![];var _0x18c4d4={};if(_0xb64c09[_0x74ac('0x2f')][_0x74ac('0x2c')]&&_0xb64c09[_0x74ac('0x2f')][_0x74ac('0x2c')]==='uniqueid'){_0x18c4d4[_0x74ac('0x49')]=_0xb64c09['params']['id'];}else{_0x18c4d4['id']=_0xb64c09[_0x74ac('0x40')]['id'];}return db['VoiceRecording'][_0x74ac('0x42')]({'where':_0x18c4d4,'attributes':['id',_0x74ac('0x4a')],'raw':!![]})[_0x74ac('0x23')](handleEntityNotFound(_0x4f66b3,null))[_0x74ac('0x23')](function(_0x28a1ad){if(_0x28a1ad){var _0x5b3d7f=_0x28a1ad['value'];var _0x10946b=util['format'](_0x74ac('0x4b'),_0x5b3d7f);if(fs[_0x74ac('0x4c')](_0x10946b)){_0x30e27c=!![];return _0x1a790a[_0x74ac('0x4d')](_0x10946b,_0x5b3d7f,config[_0x74ac('0x4e')][_0x74ac('0x4f')])[_0x74ac('0x23')](function(){return _0x28a1ad;});}return _0x28a1ad;}})['then'](function(_0x12e3ab){if(_0x12e3ab){var _0x90d2f6=_0x12e3ab[_0x74ac('0x4a')];if(!fs[_0x74ac('0x4c')](_0x90d2f6)){throw new db[(_0x74ac('0x50'))][(_0x74ac('0x51'))](_0x74ac('0x52'));}if(_0x12e3ab[_0x74ac('0x53')]){return _0x4f66b3['download'](_0x90d2f6,_0x12e3ab['filename']+path['extname'](_0x90d2f6),function(){if(_0x30e27c){fs[_0x74ac('0x54')](_0x90d2f6);}});}else{return _0x4f66b3['download'](_0x90d2f6,function(_0x210ad2){if(_0x30e27c){fs['unlink'](_0x90d2f6);}});}}})[_0x74ac('0x46')](function(_0x128d93){if(_0x128d93[_0x74ac('0x55')]===_0x74ac('0x52')){_0x4f66b3['status'](0x194)[_0x74ac('0x27')](_0x74ac('0x56'));}else{return handleError(_0x4f66b3,null);}});};exports[_0x74ac('0x57')]=function(_0x1b937a,_0x4d2989,_0x1d1576){var _0x44b5ef=require(_0x74ac('0x48'));var _0x142ddd=![];var _0x920e49={'$and':[db[_0x74ac('0x58')]['where'](db[_0x74ac('0x58')]['fn']('MD5',db[_0x74ac('0x58')][_0x74ac('0x59')](_0x74ac('0x49'))),_0x1b937a[_0x74ac('0x2f')][_0x74ac('0x5a')])]};if(_0x1b937a[_0x74ac('0x2f')][_0x74ac('0x2c')]&&_0x1b937a[_0x74ac('0x2f')][_0x74ac('0x2c')]===_0x74ac('0x49')){_0x920e49[_0x74ac('0x5b')][_0x74ac('0x5c')]({'uniqueid':_0x1b937a['params']['id']});}else{_0x920e49[_0x74ac('0x5b')][_0x74ac('0x5c')]({'id':_0x1b937a['params']['id']});}return db[_0x74ac('0x2a')]['find']({'where':_0x920e49,'attributes':['id',_0x74ac('0x4a')],'raw':!![]})[_0x74ac('0x23')](handleEntityNotFound(_0x4d2989,null))[_0x74ac('0x23')](function(_0x1fd64a){if(_0x1fd64a){var _0xd07dce=util[_0x74ac('0x2e')](_0x74ac('0x4b'),_0x1fd64a[_0x74ac('0x4a')]);if(fs['existsSync'](_0xd07dce)){_0x142ddd=!![];return _0x44b5ef[_0x74ac('0x4d')](_0xd07dce,_0x1fd64a[_0x74ac('0x4a')],config[_0x74ac('0x4e')][_0x74ac('0x4f')])[_0x74ac('0x23')](function(){return _0x1fd64a;});}return _0x1fd64a;}})[_0x74ac('0x23')](function(_0x38edd4){if(_0x38edd4){if(!fs[_0x74ac('0x4c')](_0x38edd4['value'])){throw new db[(_0x74ac('0x50'))]['ValidationError'](_0x74ac('0x52'));}if(_0x38edd4[_0x74ac('0x53')]){return _0x4d2989[_0x74ac('0x5d')](_0x38edd4['value'],_0x38edd4[_0x74ac('0x53')]+path[_0x74ac('0x5e')](_0x38edd4[_0x74ac('0x4a')]),function(){if(_0x142ddd){fs[_0x74ac('0x54')](_0x38edd4['value']);}});}else{return _0x4d2989[_0x74ac('0x5d')](_0x38edd4['value'],function(_0x4ab412){if(_0x142ddd){fs[_0x74ac('0x54')](_0x38edd4[_0x74ac('0x4a')]);}});}}})['catch'](handleError(_0x4d2989,null));};exports[_0x74ac('0x5f')]=function(_0x3581e0,_0x40963f){return db['VoiceRecording'][_0x74ac('0x42')]({'where':{'id':_0x3581e0[_0x74ac('0x40')]['id']}})[_0x74ac('0x23')](function(_0x308698){if(_['isNil'](_0x308698)){throw new ReferenceError(_0x74ac('0x60'));}return _0x308698;})[_0x74ac('0x23')](function(_0x6cc700){var _0x55e771=_0x6cc700[_0x74ac('0x4a')];logger['info'](_0x74ac('0x61'),_0x55e771);if(!_[_0x74ac('0x62')](_0x6cc700[_0x74ac('0x4a')])&&fs['existsSync'](_0x55e771)){logger[_0x74ac('0x63')](_0x74ac('0x64')+_0x55e771+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x74ac('0x65')](_0x55e771);}_0x55e771=_0x55e771+_0x74ac('0x66');if(!_[_0x74ac('0x62')](_0x6cc700[_0x74ac('0x4a')])&&fs[_0x74ac('0x4c')](_0x55e771)){logger[_0x74ac('0x63')]('File:\x20\x22'+_0x55e771+_0x74ac('0x67'));fs[_0x74ac('0x65')](_0x55e771);}return _0x6cc700;})[_0x74ac('0x23')](function(_0x57595b){if(!_0x57595b)throw new InternalError();return _0x57595b[_0x74ac('0x5f')]();})[_0x74ac('0x23')](function(){_0x40963f[_0x74ac('0x1a')](0xcc)[_0x74ac('0x1b')]();})[_0x74ac('0x46')](handleError(_0x40963f,null));};function getBucketslist(_0x111e94,_0x2ccff6,_0x483ec0){return new Promise(function(_0x4db01d,_0x504f9e){var _0xd956b9=new AWS['S3']({'accessKeyId':_0x2ccff6,'secretAccessKey':_0x111e94,'region':_0x483ec0});_0xd956b9[_0x74ac('0x68')]({},function(_0x2bb73b,_0x269384){if(_0x2bb73b){return _0x504f9e(_0x2bb73b);}else{return _0x4db01d(_0x269384);}});});}function createBucket(_0x3f21e5,_0x22cb63,_0x2afde5,_0x1ac053){return new Promise(function(_0x5aba4f,_0x12acff){var _0x80045f=new AWS['S3']({'accessKeyId':_0x22cb63,'secretAccessKey':_0x3f21e5,'region':_0x2afde5});_0x80045f[_0x74ac('0x69')]({'Bucket':_0x1ac053},function(_0x138da0,_0x1427e5){if(_0x138da0){return _0x12acff(_0x138da0);}else{return _0x5aba4f(_0x1427e5);}});});}function uploadFile(_0x10d405,_0xd94015,_0x3a9fd7,_0x441ac1,_0x33d549,_0xd4ab77){return new Promise(function(_0x40c9d1,_0x506a57){var _0x548bd9=new AWS['S3']({'accessKeyId':_0xd94015,'secretAccessKey':_0x10d405,'region':_0x3a9fd7});_0x548bd9[_0x74ac('0x6a')]({'Bucket':_0x441ac1,'Key':_0x33d549,'Body':_0xd4ab77},function(_0x30f22d,_0x51dcd4){if(_0x30f22d){return _0x506a57(_0x30f22d);}else{return _0x40c9d1(_0x51dcd4);}});});}function startTranscribe(_0x54fa8c,_0x42b69a,_0x2733c6,_0xfa6325,_0x3fb359,_0x2b4ab9){return new Promise(function(_0x6dc108,_0x378cbd){var _0x22be64=new AWS[(_0x74ac('0x6b'))]({'accessKeyId':_0x42b69a,'secretAccessKey':_0x54fa8c,'region':_0x2733c6});_0x22be64[_0x74ac('0x6c')]({'TranscriptionJobName':_0xfa6325,'LanguageCode':_0x3fb359,'Media':{'MediaFileUri':_0x2b4ab9}},function(_0x3eb439,_0x3ed32a){if(_0x3eb439){return _0x378cbd(_0x3eb439);}else{return _0x6dc108(_0x3ed32a);}});});}function transcribe(_0x342564,_0x24fdb3,_0x2f8ce9,_0x37c40d,_0x1aca9e,_0x1746ed,_0xe6aa1f){return new Promise(function(_0x2c9dd6,_0x3d9582){var _0x405c31={};logger[_0x74ac('0x63')](util[_0x74ac('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x342564,_0x1aca9e));return uploadFile(_0x24fdb3,_0x2f8ce9,_0x37c40d,_0x1aca9e,path[_0x74ac('0x6d')](_0x1746ed),fs[_0x74ac('0x6e')](_0x1746ed))[_0x74ac('0x23')](function(_0xe47424){logger[_0x74ac('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x342564,_0x1aca9e,_0xe47424[_0x74ac('0x6f')]));_0x405c31['bucket']=_0xe47424[_0x74ac('0x70')];_0x405c31['location']=_0xe47424['Location'];logger[_0x74ac('0x63')](util['format'](_0x74ac('0x71'),_0x342564));return startTranscribe(_0x24fdb3,_0x2f8ce9,_0x37c40d,uuidv4(),_0xe6aa1f,_0xe47424[_0x74ac('0x6f')]);})[_0x74ac('0x23')](function(_0x1dac02){logger[_0x74ac('0x63')](util[_0x74ac('0x2e')](_0x74ac('0x72'),_0x342564,_0x1dac02[_0x74ac('0x73')]['TranscriptionJobName']));_0x405c31['transcribeName']=_0x1dac02[_0x74ac('0x73')][_0x74ac('0x74')];_0x405c31[_0x74ac('0x75')]=_0x1dac02[_0x74ac('0x73')]['TranscriptionJobStatus'];return _0x2c9dd6(_0x405c31);})[_0x74ac('0x46')](function(_0x17dd2b){return _0x3d9582(_0x17dd2b);});});}exports[_0x74ac('0x76')]=function(_0xbaf7e6,_0x4d8cbb,_0x22a677){var _0x342d44;var _0x47efa7;var _0x543d7e;var _0x331fd2=require('../../components/encryptor');return db[_0x74ac('0x2a')][_0x74ac('0x77')]({'where':{'id':_0xbaf7e6[_0x74ac('0x40')]['id']}})[_0x74ac('0x23')](function(_0x21bedc){if(_0x21bedc){var _0x3eab9a=util[_0x74ac('0x2e')](_0x74ac('0x4b'),_0x21bedc[_0x74ac('0x4a')]);if(fs[_0x74ac('0x4c')](_0x3eab9a)){cypher=!![];return _0x331fd2[_0x74ac('0x4d')](_0x3eab9a,_0x21bedc[_0x74ac('0x4a')],config[_0x74ac('0x4e')]['recording'])[_0x74ac('0x23')](function(){return _0x21bedc;});}return _0x21bedc;}})[_0x74ac('0x23')](function(_0x35d8b5){if(!_0x35d8b5){throw new db[(_0x74ac('0x50'))][(_0x74ac('0x51'))](_0x74ac('0x78'));}_0x47efa7=_0x35d8b5;return db[_0x74ac('0x79')][_0x74ac('0x77')]({'where':{'id':0x1}});})[_0x74ac('0x23')](handleEntityNotFound(_0x4d8cbb,null))[_0x74ac('0x23')](function(_0x5e8e30){if(_0x5e8e30){_0x342d44=_0x5e8e30;if(!_0x342d44[_0x74ac('0x7a')]||!_0x342d44[_0x74ac('0x7b')]||!_0x342d44[_0x74ac('0x7c')]||!_0x342d44[_0x74ac('0x7d')]||!_0x342d44['bucket']){throw new db['Sequelize'][(_0x74ac('0x51'))]('Transcribe\x20not\x20configured');}if(_0xbaf7e6[_0x74ac('0x45')][_0x74ac('0x7e')]&&(!_0x342d44[_0x74ac('0x7f')]||!_0x342d44[_0x74ac('0x80')]||!_0x342d44[_0x74ac('0x81')]||!_0x342d44['language']||!_0x342d44[_0x74ac('0x82')])){throw new db[(_0x74ac('0x50'))][(_0x74ac('0x51'))](_0x74ac('0x83'));}return db['CloudProvider'][_0x74ac('0x77')]({'where':{'id':_0x342d44[_0x74ac('0x7b')]}});}})[_0x74ac('0x23')](function(_0x10b7a9){if(!_0x10b7a9){throw new db[(_0x74ac('0x50'))][(_0x74ac('0x51'))](_0x74ac('0x84'));}if(!_0x10b7a9[_0x74ac('0x85')]||!_0x10b7a9[_0x74ac('0x86')]){throw new db['Sequelize'][(_0x74ac('0x51'))]('Cloud\x20Provider\x20not\x20configured');}_0x543d7e=_0x10b7a9;return getBucketslist(_0x543d7e[_0x74ac('0x85')],_0x543d7e[_0x74ac('0x86')],_0x342d44[_0x74ac('0x7c')]);})['then'](function(_0x4df630){if(_0x4df630&&_0x4df630[_0x74ac('0x87')]){var _0x27fc0a=_[_0x74ac('0x42')](_0x4df630[_0x74ac('0x87')],function(_0x2943df){return _0x2943df['Name']===_0x342d44[_0x74ac('0x82')];});if(!_0x27fc0a){logger['info'](util['format'](_0x74ac('0x88'),_0xbaf7e6[_0x74ac('0x40')]['id'],_0x342d44['bucket']));return createBucket(_0x543d7e[_0x74ac('0x85')],_0x543d7e[_0x74ac('0x86')],_0x342d44[_0x74ac('0x7c')],_0x342d44[_0x74ac('0x82')]);}logger[_0x74ac('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xbaf7e6[_0x74ac('0x40')]['id'],_0x342d44[_0x74ac('0x82')]));return;}})[_0x74ac('0x23')](function(_0x1e925b){if(_0x47efa7['transcribeStatus']==='NEW'){return transcribe(_0xbaf7e6[_0x74ac('0x40')]['id'],_0x543d7e[_0x74ac('0x85')],_0x543d7e[_0x74ac('0x86')],_0x342d44[_0x74ac('0x7c')],_0x342d44[_0x74ac('0x82')],_0x47efa7[_0x74ac('0x4a')],_0x342d44['language']);}else{logger['info'](util[_0x74ac('0x2e')](_0x74ac('0x89'),_0xbaf7e6[_0x74ac('0x40')]['id']));return{'transcribeStatus':_0x74ac('0x8a')};}})['then'](function(_0x53b677){if(_0x53b677){_0x53b677[_0x74ac('0x8b')]=_0xbaf7e6[_0x74ac('0x45')][_0x74ac('0x7e')];return _0x47efa7[_0x74ac('0x8c')](_0x53b677);}})[_0x74ac('0x23')](respondWithResult(_0x4d8cbb,null))[_0x74ac('0x46')](handleError(_0x4d8cbb,null));};function writeFile(_0x516b09,_0xa53bdd){return new Promise(function(_0x2bc75f,_0x37ef67){fs[_0x74ac('0x8d')](_0xa53bdd,_0x516b09,function(_0xee6b88,_0x508360){if(_0xee6b88){return _0x37ef67(_0xee6b88);}else{return _0x2bc75f(_0x508360);}});});}exports[_0x74ac('0x8e')]=function(_0x32e745,_0x3dfd86,_0x265e2c){return db[_0x74ac('0x2a')][_0x74ac('0x77')]({'where':{'id':_0x32e745[_0x74ac('0x40')]['id']}})['then'](handleEntityNotFound(_0x3dfd86))[_0x74ac('0x23')](function(_0x4d8c69){if(_0x4d8c69&&_0x4d8c69[_0x74ac('0x8f')]){var _0x2a7490=_0x4d8c69[_0x74ac('0x8f')];var _0x3b452b=config[_0x74ac('0x90')]+_0x74ac('0x91')+_0x4d8c69['id']+_0x74ac('0x92');if(fs[_0x74ac('0x4c')](_0x3b452b)){return _0x3b452b;}return writeFile(_0x2a7490,_0x3b452b)[_0x74ac('0x23')](function(){return _0x3b452b;});}else{throw new db[(_0x74ac('0x50'))][(_0x74ac('0x51'))](_0x74ac('0x93'));}})[_0x74ac('0x23')](function(_0x3896ed){return _0x3dfd86['download'](_0x3896ed);})[_0x74ac('0x46')](handleError(_0x3dfd86));}; \ No newline at end of file +var _0x008d=['index','map','VoiceRecording','rawAttributes','fieldName','type','model','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','include','rows','catch','params','length','create','body','describe','download','../../components/encryptor','uniqueid','find','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','destroy','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','startTranscriptionJob','basename','readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','ValidationError','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','stack','name','send'];(function(_0x583ca0,_0x22a723){var _0x57f884=function(_0x185844){while(--_0x185844){_0x583ca0['push'](_0x583ca0['shift']());}};_0x57f884(++_0x22a723);}(_0x008d,0x6b));var _0xd008=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x008d[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xd008('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd008('0x1'));var jsonpatch=require(_0xd008('0x2'));var rp=require(_0xd008('0x3'));var moment=require(_0xd008('0x4'));var BPromise=require(_0xd008('0x5'));var Mustache=require(_0xd008('0x6'));var util=require('util');var path=require(_0xd008('0x7'));var sox=require(_0xd008('0x8'));var csv=require(_0xd008('0x9'));var ejs=require(_0xd008('0xa'));var fs=require('fs');var fs_extra=require(_0xd008('0xb'));var _=require(_0xd008('0xc'));var squel=require(_0xd008('0xd'));var crypto=require(_0xd008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd008('0xf'));var toCsv=require(_0xd008('0x9'));var querystring=require(_0xd008('0x10'));var Papa=require(_0xd008('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0xd008('0x12'));var Redis=require(_0xd008('0x13'));var authService=require(_0xd008('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd008('0x15'));var hardwareService=require(_0xd008('0x16'));var logger=require(_0xd008('0x17'))(_0xd008('0x18'));var utils=require('../../config/utils');var config=require(_0xd008('0x19'));var licenseUtil=require(_0xd008('0x1a'));var db=require(_0xd008('0x1b'))['db'];function respondWithStatusCode(_0xb501bc,_0x112740){_0x112740=_0x112740||0xcc;return function(_0x5aa2a1){if(_0x5aa2a1){return _0xb501bc[_0xd008('0x1c')](_0x112740);}return _0xb501bc['status'](_0x112740)[_0xd008('0x1d')]();};}function respondWithResult(_0x3cbbf0,_0x3785b5){_0x3785b5=_0x3785b5||0xc8;return function(_0x13b270){if(_0x13b270){return _0x3cbbf0[_0xd008('0x1e')](_0x3785b5)[_0xd008('0x1f')](_0x13b270);}};}function respondWithFilteredResult(_0x353e48,_0x27d58e){return function(_0x38ef74){if(_0x38ef74){var _0x2674d3=typeof _0x27d58e['offset']===_0xd008('0x20')&&typeof _0x27d58e[_0xd008('0x21')]===_0xd008('0x20');var _0x3ede9e=_0x38ef74[_0xd008('0x22')];var _0x669c5=_0x2674d3?0x0:_0x27d58e[_0xd008('0x23')];var _0x570996=_0x2674d3?_0x38ef74['count']:_0x27d58e[_0xd008('0x23')]+_0x27d58e[_0xd008('0x21')];var _0x555437;if(_0x570996>=_0x3ede9e){_0x570996=_0x3ede9e;_0x555437=0xc8;}else{_0x555437=0xce;}_0x353e48[_0xd008('0x1e')](_0x555437);return _0x353e48['set'](_0xd008('0x24'),_0x669c5+'-'+_0x570996+'/'+_0x3ede9e)[_0xd008('0x1f')](_0x38ef74);}return null;};}function patchUpdates(_0x5ed83b){return function(_0x298453){try{jsonpatch['apply'](_0x298453,_0x5ed83b,!![]);}catch(_0x44f3f7){return BPromise[_0xd008('0x25')](_0x44f3f7);}return _0x298453[_0xd008('0x26')]();};}function saveUpdates(_0x3b67f6,_0x179df5){return function(_0x5d8046){if(_0x5d8046){return _0x5d8046[_0xd008('0x27')](_0x3b67f6)[_0xd008('0x28')](function(_0x140bce){return _0x140bce;});}return null;};}function removeEntity(_0x4ec645,_0x345f5e){return function(_0x19c77e){if(_0x19c77e){return _0x19c77e['destroy']()[_0xd008('0x28')](function(){_0x4ec645[_0xd008('0x1e')](0xcc)[_0xd008('0x1d')]();});}};}function handleEntityNotFound(_0x38dafd,_0x56a0b){return function(_0x3fad34){if(!_0x3fad34){_0x38dafd[_0xd008('0x1c')](0x194);}return _0x3fad34;};}function handleError(_0x44c4ce,_0x5d7a3f){_0x5d7a3f=_0x5d7a3f||0x1f4;return function(_0x1c9add){logger['error'](_0x1c9add[_0xd008('0x29')]);if(_0x1c9add[_0xd008('0x2a')]){delete _0x1c9add[_0xd008('0x2a')];}_0x44c4ce[_0xd008('0x1e')](_0x5d7a3f)[_0xd008('0x2b')](_0x1c9add);};}exports[_0xd008('0x2c')]=function(_0x2b8b60,_0x17224c){var _0x3f7620={},_0x39947c={},_0x178ef2={'count':0x0,'rows':[]};var _0x5946b0=_[_0xd008('0x2d')](db[_0xd008('0x2e')][_0xd008('0x2f')],function(_0x58dac1){return{'name':_0x58dac1[_0xd008('0x30')],'type':_0x58dac1[_0xd008('0x31')]['key']};});_0x39947c[_0xd008('0x32')]=_['differenceBy'](_['map'](_0x5946b0,_0xd008('0x2a')),[_0xd008('0x33')]);_0x39947c[_0xd008('0x34')]=_[_0xd008('0x35')](_0x2b8b60[_0xd008('0x34')]);_0x39947c['filters']=_[_0xd008('0x36')](_0x39947c[_0xd008('0x32')],_0x39947c[_0xd008('0x34')]);_0x3f7620[_0xd008('0x37')]=_[_0xd008('0x36')](_0x39947c[_0xd008('0x32')],qs[_0xd008('0x38')](_0x2b8b60[_0xd008('0x34')][_0xd008('0x38')]));_0x3f7620[_0xd008('0x37')]=_0x3f7620[_0xd008('0x37')]['length']?_0x3f7620[_0xd008('0x37')]:_0x39947c[_0xd008('0x32')];if(!_0x2b8b60['query'][_0xd008('0x39')](_0xd008('0x3a'))){_0x3f7620[_0xd008('0x21')]=qs['limit'](_0x2b8b60[_0xd008('0x34')][_0xd008('0x21')]);_0x3f7620[_0xd008('0x23')]=qs[_0xd008('0x23')](_0x2b8b60[_0xd008('0x34')]['offset']);}_0x3f7620[_0xd008('0x3b')]=qs[_0xd008('0x3c')](_0x2b8b60[_0xd008('0x34')]['sort']);_0x3f7620[_0xd008('0x3d')]=qs[_0xd008('0x3e')](_[_0xd008('0x3f')](_0x2b8b60[_0xd008('0x34')],_0x39947c['filters']),_0x5946b0);if(_0x2b8b60[_0xd008('0x34')]['filter']){_0x3f7620['where']=_[_0xd008('0x40')](_0x3f7620[_0xd008('0x3d')],{'$or':_[_0xd008('0x2d')](_0x5946b0,function(_0x1b1895){if(_0x1b1895[_0xd008('0x31')]!=='VIRTUAL'){var _0x3779fe={};_0x3779fe[_0x1b1895[_0xd008('0x2a')]]={'$like':'%'+_0x2b8b60['query'][_0xd008('0x41')]+'%'};return _0x3779fe;}})});}_0x3f7620=_[_0xd008('0x40')]({},_0x3f7620,_0x2b8b60[_0xd008('0x42')]);var _0x221317={'where':_0x3f7620[_0xd008('0x3d')]};return db['VoiceRecording']['count'](_0x221317)[_0xd008('0x28')](function(_0x5dc3d3){_0x178ef2[_0xd008('0x22')]=_0x5dc3d3;if(_0x2b8b60['query']['includeAll']){_0x3f7620[_0xd008('0x43')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x3f7620);})['then'](function(_0x59b24c){_0x178ef2[_0xd008('0x44')]=_0x59b24c;return _0x178ef2;})['then'](respondWithFilteredResult(_0x17224c,_0x3f7620))[_0xd008('0x45')](handleError(_0x17224c,null));};exports['show']=function(_0x484abf,_0x354471){var _0xe95a85={'raw':![],'where':{'id':_0x484abf[_0xd008('0x46')]['id']}},_0x26dd95={};_0x26dd95[_0xd008('0x32')]=_[_0xd008('0x35')](db[_0xd008('0x2e')][_0xd008('0x2f')]);_0x26dd95[_0xd008('0x34')]=_[_0xd008('0x35')](_0x484abf['query']);_0x26dd95[_0xd008('0x3e')]=_[_0xd008('0x36')](_0x26dd95[_0xd008('0x32')],_0x26dd95['query']);_0xe95a85[_0xd008('0x37')]=_[_0xd008('0x36')](_0x26dd95['model'],qs['fields'](_0x484abf[_0xd008('0x34')]['fields']));_0xe95a85[_0xd008('0x37')]=_0xe95a85[_0xd008('0x37')][_0xd008('0x47')]?_0xe95a85[_0xd008('0x37')]:_0x26dd95[_0xd008('0x32')];if(_0x484abf['query']['includeAll']){_0xe95a85[_0xd008('0x43')]=[{'all':!![]}];}_0xe95a85=_['merge']({},_0xe95a85,_0x484abf[_0xd008('0x42')]);return db[_0xd008('0x2e')]['find'](_0xe95a85)[_0xd008('0x28')](handleEntityNotFound(_0x354471,null))[_0xd008('0x28')](respondWithResult(_0x354471,null))[_0xd008('0x45')](handleError(_0x354471,null));};exports[_0xd008('0x48')]=function(_0x5c1929,_0x5a7791){return db[_0xd008('0x2e')][_0xd008('0x48')](_0x5c1929[_0xd008('0x49')],{})['then'](respondWithResult(_0x5a7791,0xc9))['catch'](handleError(_0x5a7791,null));};exports['update']=function(_0x41362c,_0x2d1c48){if(_0x41362c['body']['id']){delete _0x41362c['body']['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x41362c[_0xd008('0x46')]['id']}})[_0xd008('0x28')](handleEntityNotFound(_0x2d1c48,null))[_0xd008('0x28')](saveUpdates(_0x41362c[_0xd008('0x49')],null))[_0xd008('0x28')](respondWithResult(_0x2d1c48,null))['catch'](handleError(_0x2d1c48,null));};exports[_0xd008('0x4a')]=function(_0x5e8a2d,_0x4a3dc2){return db['VoiceRecording'][_0xd008('0x4a')]()[_0xd008('0x28')](respondWithResult(_0x4a3dc2,null))['catch'](handleError(_0x4a3dc2,null));};exports[_0xd008('0x4b')]=function(_0x4fe00a,_0x3b1ab0,_0x6f2df9){var _0x531cce=require(_0xd008('0x4c'));var _0x224946=![];var _0x54df52={};if(_0x4fe00a['query']['type']&&_0x4fe00a[_0xd008('0x34')][_0xd008('0x31')]===_0xd008('0x4d')){_0x54df52[_0xd008('0x4d')]=_0x4fe00a[_0xd008('0x46')]['id'];}else{_0x54df52['id']=_0x4fe00a[_0xd008('0x46')]['id'];}return db[_0xd008('0x2e')][_0xd008('0x4e')]({'where':_0x54df52,'attributes':['id',_0xd008('0x4f')],'raw':!![]})[_0xd008('0x28')](handleEntityNotFound(_0x3b1ab0,null))[_0xd008('0x28')](function(_0x1024d7){if(_0x1024d7){var _0x4fada4=_0x1024d7['value'];var _0x2da8d0=util['format'](_0xd008('0x50'),_0x4fada4);if(fs[_0xd008('0x51')](_0x2da8d0)){_0x224946=!![];return _0x531cce[_0xd008('0x52')](_0x2da8d0,_0x4fada4,config[_0xd008('0x53')][_0xd008('0x54')])['then'](function(){return _0x1024d7;});}return _0x1024d7;}})[_0xd008('0x28')](function(_0x1e81f9){if(_0x1e81f9){var _0x75714=_0x1e81f9['value'];if(!fs['existsSync'](_0x75714)){throw new db[(_0xd008('0x55'))]['ValidationError'](_0xd008('0x56'));}if(_0x1e81f9[_0xd008('0x57')]){return _0x3b1ab0[_0xd008('0x4b')](_0x75714,_0x1e81f9['filename']+path[_0xd008('0x58')](_0x75714),function(){if(_0x224946){fs[_0xd008('0x59')](_0x75714);}});}else{return _0x3b1ab0[_0xd008('0x4b')](_0x75714,function(_0x5e6df3){if(_0x224946){fs['unlink'](_0x75714);}});}}})[_0xd008('0x45')](function(_0x2cac5f){if(_0x2cac5f[_0xd008('0x5a')]===_0xd008('0x56')){_0x3b1ab0[_0xd008('0x1e')](0x194)[_0xd008('0x2b')](_0xd008('0x5b'));}else{return handleError(_0x3b1ab0,null);}});};exports[_0xd008('0x5c')]=function(_0xe7b676,_0x57c342,_0x302ad3){var _0x6eef7d=require('../../components/encryptor');var _0x545127=![];var _0x1521e4={'$and':[db[_0xd008('0x5d')][_0xd008('0x3d')](db['sequelize']['fn'](_0xd008('0x5e'),db['sequelize'][_0xd008('0x5f')](_0xd008('0x4d'))),_0xe7b676['query']['token'])]};if(_0xe7b676[_0xd008('0x34')][_0xd008('0x31')]&&_0xe7b676['query']['type']===_0xd008('0x4d')){_0x1521e4[_0xd008('0x60')][_0xd008('0x61')]({'uniqueid':_0xe7b676[_0xd008('0x46')]['id']});}else{_0x1521e4[_0xd008('0x60')][_0xd008('0x61')]({'id':_0xe7b676[_0xd008('0x46')]['id']});}return db[_0xd008('0x2e')][_0xd008('0x4e')]({'where':_0x1521e4,'attributes':['id',_0xd008('0x4f')],'raw':!![]})[_0xd008('0x28')](handleEntityNotFound(_0x57c342,null))[_0xd008('0x28')](function(_0x1585c7){if(_0x1585c7){var _0x36c2b9=util[_0xd008('0x33')](_0xd008('0x50'),_0x1585c7[_0xd008('0x4f')]);if(fs[_0xd008('0x51')](_0x36c2b9)){_0x545127=!![];return _0x6eef7d['decryptFile'](_0x36c2b9,_0x1585c7[_0xd008('0x4f')],config[_0xd008('0x53')]['recording'])['then'](function(){return _0x1585c7;});}return _0x1585c7;}})[_0xd008('0x28')](function(_0x24003d){if(_0x24003d){if(!fs[_0xd008('0x51')](_0x24003d[_0xd008('0x4f')])){throw new db[(_0xd008('0x55'))]['ValidationError'](_0xd008('0x56'));}if(_0x24003d[_0xd008('0x57')]){return _0x57c342['download'](_0x24003d[_0xd008('0x4f')],_0x24003d[_0xd008('0x57')]+path[_0xd008('0x58')](_0x24003d['value']),function(){if(_0x545127){fs['unlink'](_0x24003d[_0xd008('0x4f')]);}});}else{return _0x57c342[_0xd008('0x4b')](_0x24003d[_0xd008('0x4f')],function(_0x5a13ff){if(_0x545127){fs[_0xd008('0x59')](_0x24003d[_0xd008('0x4f')]);}});}}})['catch'](handleError(_0x57c342,null));};exports[_0xd008('0x62')]=function(_0x465eb4,_0x2da2a8){return db[_0xd008('0x2e')][_0xd008('0x4e')]({'where':{'id':_0x465eb4[_0xd008('0x46')]['id']}})[_0xd008('0x28')](function(_0x3ba6f1){if(_[_0xd008('0x63')](_0x3ba6f1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3ba6f1;})[_0xd008('0x28')](function(_0x346615){var _0x74809d=_0x346615[_0xd008('0x4f')];logger[_0xd008('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x74809d);if(!_[_0xd008('0x63')](_0x346615[_0xd008('0x4f')])&&fs[_0xd008('0x51')](_0x74809d)){logger['info'](_0xd008('0x65')+_0x74809d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd008('0x66')](_0x74809d);}_0x74809d=_0x74809d+_0xd008('0x67');if(!_[_0xd008('0x63')](_0x346615[_0xd008('0x4f')])&&fs[_0xd008('0x51')](_0x74809d)){logger['info']('File:\x20\x22'+_0x74809d+_0xd008('0x68'));fs[_0xd008('0x66')](_0x74809d);}return _0x346615;})[_0xd008('0x28')](function(_0x550329){if(!_0x550329)throw new InternalError();return _0x550329['destroy']();})[_0xd008('0x28')](function(){_0x2da2a8['status'](0xcc)[_0xd008('0x1d')]();})['catch'](handleError(_0x2da2a8,null));};function getBucketslist(_0x2b7f0f,_0xd3945c,_0x21bf00){return new Promise(function(_0x34f4ee,_0x237032){var _0x1386a9=new AWS['S3']({'accessKeyId':_0xd3945c,'secretAccessKey':_0x2b7f0f,'region':_0x21bf00});_0x1386a9[_0xd008('0x69')]({},function(_0x11a9af,_0x15b3ed){if(_0x11a9af){return _0x237032(_0x11a9af);}else{return _0x34f4ee(_0x15b3ed);}});});}function createBucket(_0x3dae39,_0x55d717,_0x324606,_0x39ebe6){return new Promise(function(_0x5e86c6,_0x42dae9){var _0x1db69d=new AWS['S3']({'accessKeyId':_0x55d717,'secretAccessKey':_0x3dae39,'region':_0x324606});_0x1db69d[_0xd008('0x6a')]({'Bucket':_0x39ebe6},function(_0x51b1a4,_0x5a545b){if(_0x51b1a4){return _0x42dae9(_0x51b1a4);}else{return _0x5e86c6(_0x5a545b);}});});}function uploadFile(_0x5062f2,_0x42d10c,_0x141e3e,_0x2f4db3,_0x195d02,_0x1088c9){return new Promise(function(_0x563e60,_0x5768b3){var _0x12c456=new AWS['S3']({'accessKeyId':_0x42d10c,'secretAccessKey':_0x5062f2,'region':_0x141e3e});_0x12c456['upload']({'Bucket':_0x2f4db3,'Key':_0x195d02,'Body':_0x1088c9},function(_0x2d82c0,_0x1bb6b5){if(_0x2d82c0){return _0x5768b3(_0x2d82c0);}else{return _0x563e60(_0x1bb6b5);}});});}function startTranscribe(_0xd2296e,_0x27e656,_0x1355d4,_0x37c287,_0xb6e21,_0xb2a881){return new Promise(function(_0xd2e63,_0x3590d2){var _0x57cdf1=new AWS['TranscribeService']({'accessKeyId':_0x27e656,'secretAccessKey':_0xd2296e,'region':_0x1355d4});_0x57cdf1[_0xd008('0x6b')]({'TranscriptionJobName':_0x37c287,'LanguageCode':_0xb6e21,'Media':{'MediaFileUri':_0xb2a881}},function(_0x37396a,_0x3b4efe){if(_0x37396a){return _0x3590d2(_0x37396a);}else{return _0xd2e63(_0x3b4efe);}});});}function transcribe(_0x16d689,_0x1dfee0,_0x2ab64c,_0x5c1e8f,_0x8433ca,_0x2b83c7,_0x300fd9){return new Promise(function(_0x51880a,_0x4e79c8){var _0x400adb={};logger[_0xd008('0x64')](util[_0xd008('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x16d689,_0x8433ca));return uploadFile(_0x1dfee0,_0x2ab64c,_0x5c1e8f,_0x8433ca,path[_0xd008('0x6c')](_0x2b83c7),fs[_0xd008('0x6d')](_0x2b83c7))['then'](function(_0x18da05){logger[_0xd008('0x64')](util[_0xd008('0x33')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x16d689,_0x8433ca,_0x18da05['Location']));_0x400adb[_0xd008('0x6e')]=_0x18da05[_0xd008('0x6f')];_0x400adb[_0xd008('0x70')]=_0x18da05[_0xd008('0x71')];logger['info'](util[_0xd008('0x33')](_0xd008('0x72'),_0x16d689));return startTranscribe(_0x1dfee0,_0x2ab64c,_0x5c1e8f,uuidv4(),_0x300fd9,_0x18da05[_0xd008('0x71')]);})[_0xd008('0x28')](function(_0x1f7176){logger[_0xd008('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x16d689,_0x1f7176[_0xd008('0x73')][_0xd008('0x74')]));_0x400adb[_0xd008('0x75')]=_0x1f7176['TranscriptionJob']['TranscriptionJobName'];_0x400adb[_0xd008('0x76')]=_0x1f7176[_0xd008('0x73')][_0xd008('0x77')];return _0x51880a(_0x400adb);})[_0xd008('0x45')](function(_0x57ae7e){return _0x4e79c8(_0x57ae7e);});});}exports['runTranscribe']=function(_0x10ed0b,_0x54bc59,_0x34874c){var _0xc68b06;var _0x31b83d;var _0xe7733a;var _0xce7cbb=require(_0xd008('0x4c'));return db[_0xd008('0x2e')][_0xd008('0x78')]({'where':{'id':_0x10ed0b['params']['id']}})['then'](function(_0x44ab7c){if(_0x44ab7c){var _0x152bfd=util[_0xd008('0x33')](_0xd008('0x50'),_0x44ab7c[_0xd008('0x4f')]);if(fs[_0xd008('0x51')](_0x152bfd)){cypher=!![];return _0xce7cbb['decryptFile'](_0x152bfd,_0x44ab7c['value'],config[_0xd008('0x53')][_0xd008('0x54')])[_0xd008('0x28')](function(){return _0x44ab7c;});}return _0x44ab7c;}})['then'](function(_0x5cbcb2){if(!_0x5cbcb2){throw new db[(_0xd008('0x55'))][(_0xd008('0x79'))](_0xd008('0x7a'));}_0x31b83d=_0x5cbcb2;return db[_0xd008('0x7b')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x54bc59,null))['then'](function(_0x4ece6d){if(_0x4ece6d){_0xc68b06=_0x4ece6d;if(!_0xc68b06[_0xd008('0x7c')]||!_0xc68b06['transcribeAccountId']||!_0xc68b06[_0xd008('0x7d')]||!_0xc68b06['language']||!_0xc68b06['bucket']){throw new db['Sequelize'][(_0xd008('0x79'))](_0xd008('0x7e'));}if(_0x10ed0b[_0xd008('0x49')]['runSentiment']&&(!_0xc68b06[_0xd008('0x7f')]||!_0xc68b06[_0xd008('0x80')]||!_0xc68b06[_0xd008('0x81')]||!_0xc68b06['language']||!_0xc68b06['bucket'])){throw new db[(_0xd008('0x55'))][(_0xd008('0x79'))](_0xd008('0x82'));}return db[_0xd008('0x83')][_0xd008('0x78')]({'where':{'id':_0xc68b06['transcribeAccountId']}});}})[_0xd008('0x28')](function(_0x27f2da){if(!_0x27f2da){throw new db[(_0xd008('0x55'))][(_0xd008('0x79'))](_0xd008('0x84'));}if(!_0x27f2da[_0xd008('0x85')]||!_0x27f2da['data2']){throw new db[(_0xd008('0x55'))][(_0xd008('0x79'))](_0xd008('0x86'));}_0xe7733a=_0x27f2da;return getBucketslist(_0xe7733a['data1'],_0xe7733a[_0xd008('0x87')],_0xc68b06[_0xd008('0x7d')]);})[_0xd008('0x28')](function(_0x22ffa0){if(_0x22ffa0&&_0x22ffa0[_0xd008('0x88')]){var _0x44765b=_[_0xd008('0x4e')](_0x22ffa0[_0xd008('0x88')],function(_0x2c3f41){return _0x2c3f41['Name']===_0xc68b06[_0xd008('0x6e')];});if(!_0x44765b){logger[_0xd008('0x64')](util[_0xd008('0x33')](_0xd008('0x89'),_0x10ed0b[_0xd008('0x46')]['id'],_0xc68b06[_0xd008('0x6e')]));return createBucket(_0xe7733a[_0xd008('0x85')],_0xe7733a[_0xd008('0x87')],_0xc68b06[_0xd008('0x7d')],_0xc68b06[_0xd008('0x6e')]);}logger[_0xd008('0x64')](util[_0xd008('0x33')](_0xd008('0x8a'),_0x10ed0b[_0xd008('0x46')]['id'],_0xc68b06[_0xd008('0x6e')]));return;}})[_0xd008('0x28')](function(_0x28b68b){if(_0x31b83d[_0xd008('0x76')]==='NEW'){return transcribe(_0x10ed0b[_0xd008('0x46')]['id'],_0xe7733a[_0xd008('0x85')],_0xe7733a['data2'],_0xc68b06['transcribeRegion'],_0xc68b06[_0xd008('0x6e')],_0x31b83d[_0xd008('0x4f')],_0xc68b06[_0xd008('0x8b')]);}else{logger[_0xd008('0x64')](util['format'](_0xd008('0x8c'),_0x10ed0b[_0xd008('0x46')]['id']));return{'transcribeStatus':_0xd008('0x8d')};}})[_0xd008('0x28')](function(_0x41eb0e){if(_0x41eb0e){_0x41eb0e[_0xd008('0x8e')]=_0x10ed0b[_0xd008('0x49')][_0xd008('0x8f')];return _0x31b83d[_0xd008('0x90')](_0x41eb0e);}})['then'](respondWithResult(_0x54bc59,null))['catch'](handleError(_0x54bc59,null));};function writeFile(_0x1f04bb,_0x2b4365){return new Promise(function(_0x4e2372,_0x2315fc){fs[_0xd008('0x91')](_0x2b4365,_0x1f04bb,function(_0x501df4,_0x1ac974){if(_0x501df4){return _0x2315fc(_0x501df4);}else{return _0x4e2372(_0x1ac974);}});});}exports[_0xd008('0x92')]=function(_0xeccdb4,_0x38d56b,_0x570d31){return db[_0xd008('0x2e')][_0xd008('0x78')]({'where':{'id':_0xeccdb4[_0xd008('0x46')]['id']}})['then'](handleEntityNotFound(_0x38d56b))[_0xd008('0x28')](function(_0x5b6dce){if(_0x5b6dce&&_0x5b6dce[_0xd008('0x93')]){var _0x206f1e=_0x5b6dce[_0xd008('0x93')];var _0x51b1da=config[_0xd008('0x94')]+'/server/files/transcribes/transcribe_'+_0x5b6dce['id']+_0xd008('0x95');if(fs[_0xd008('0x51')](_0x51b1da)){return _0x51b1da;}return writeFile(_0x206f1e,_0x51b1da)['then'](function(){return _0x51b1da;});}else{throw new db[(_0xd008('0x55'))]['ValidationError'](_0xd008('0x96'));}})[_0xd008('0x28')](function(_0x5b6102){return _0x38d56b[_0xd008('0x4b')](_0x5b6102);})[_0xd008('0x45')](handleError(_0x38d56b));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index ffed395..3539aae 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 _0x98d3=['exports','VoiceRecording','uniqueid','./voiceRecording.attributes'];(function(_0x37c0ac,_0xa6f090){var _0xf22837=function(_0x3e5340){while(--_0x3e5340){_0x37c0ac['push'](_0x37c0ac['shift']());}};_0xf22837(++_0xa6f090);}(_0x98d3,0x173));var _0x398d=function(_0x2db9d4,_0x26337a){_0x2db9d4=_0x2db9d4-0x0;var _0x4399fe=_0x98d3[_0x2db9d4];return _0x4399fe;};'use strict';var attributes=require(_0x398d('0x0'));module[_0x398d('0x1')]=function(_0x58c1f9,_0x35bbe1){return _0x58c1f9['define'](_0x398d('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x398d('0x3'),'fields':[_0x398d('0x3')]},{'name':'transcribeStatus','fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x55e0=['./voiceRecording.attributes','exports','voice_recordings','uniqueid','transcribeStatus'];(function(_0x556e63,_0x16abaf){var _0x1f18a9=function(_0xd80b8){while(--_0xd80b8){_0x556e63['push'](_0x556e63['shift']());}};_0x1f18a9(++_0x16abaf);}(_0x55e0,0xdc));var _0x055e=function(_0x284e36,_0x5385e4){_0x284e36=_0x284e36-0x0;var _0x51e50f=_0x55e0[_0x284e36];return _0x51e50f;};'use strict';var attributes=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740){return _0x2e09a6['define']('VoiceRecording',attributes,{'tableName':_0x055e('0x2'),'paranoid':![],'indexes':[{'name':_0x055e('0x3'),'fields':[_0x055e('0x3')]},{'name':_0x055e('0x4'),'fields':[_0x055e('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b1beb7d..1e379ac 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 _0x6050=['existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','../../components/encryptor','Setting','findOne','callRecordingEncryption'];(function(_0xedd211,_0x5dfa47){var _0x56ac57=function(_0x1e450a){while(--_0x1e450a){_0xedd211['push'](_0xedd211['shift']());}};_0x56ac57(++_0x5dfa47);}(_0x6050,0x196));var _0x0605=function(_0x58cddd,_0x1a8ede){_0x58cddd=_0x58cddd-0x0;var _0x26440f=_0x6050[_0x58cddd];return _0x26440f;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});}exports[_0x0605('0x16')]=function(_0x2b7b5a){var _0x1d57ba=this;return new Promise(function(_0x193520,_0x40abb2){return db[_0x0605('0x17')][_0x0605('0x18')](_0x2b7b5a[_0x0605('0x19')],{'raw':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a['options'][_0x0605('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')][_0x0605('0x1c')]||null:null,'attributes':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')][_0x0605('0x1d')]||null:null,'limit':_0x2b7b5a[_0x0605('0x1a')]?_0x2b7b5a[_0x0605('0x1a')]['limit']||null:null})[_0x0605('0xb')](function(_0x4fe293){logger[_0x0605('0x14')](_0x0605('0x16'),_0x2b7b5a);logger[_0x0605('0xe')](_0x0605('0x16'),_0x2b7b5a,JSON[_0x0605('0x10')](_0x4fe293));_0x193520(_0x4fe293);})[_0x0605('0x15')](function(_0x2ea61d){logger[_0x0605('0x11')](_0x0605('0x16'),_0x2ea61d[_0x0605('0x13')],_0x2b7b5a);_0x40abb2(_0x1d57ba[_0x0605('0x11')](0x1f4,_0x2ea61d[_0x0605('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x6bc204){var _0x3c8e36=this;return new Promise(function(_0x4b1e0c,_0x4d9a31){var _0x55ebd8=require(_0x0605('0x1e'));var _0x226825;return db[_0x0605('0x1f')][_0x0605('0x20')]({'attributes':['id',_0x0605('0x21')],'where':{'id':0x1},'raw':!![]})[_0x0605('0xb')](function(_0x4e32ef){_0x226825=_0x4e32ef;return db[_0x0605('0x17')]['create'](_0x6bc204[_0x0605('0x19')]);})[_0x0605('0xb')](function(_0x421c26){if(_0x226825[_0x0605('0x21')]&&fs[_0x0605('0x22')](_0x421c26[_0x0605('0x23')])){var _0x56dd1a=util[_0x0605('0x24')](_0x0605('0x25'),_0x421c26[_0x0605('0x23')]);return _0x55ebd8[_0x0605('0x26')](_0x421c26[_0x0605('0x23')],_0x56dd1a,config[_0x0605('0x27')][_0x0605('0x28')])[_0x0605('0xb')](function(){fs[_0x0605('0x29')](_0x421c26[_0x0605('0x23')]);logger[_0x0605('0x14')](_0x0605('0x2a'));return _0x421c26;});}return _0x421c26;})[_0x0605('0xb')](function(_0x992e4f){logger[_0x0605('0x14')](_0x0605('0x2b'),_0x6bc204);logger[_0x0605('0xe')](_0x0605('0x2b'),_0x6bc204,JSON[_0x0605('0x10')](_0x992e4f));_0x4b1e0c(_0x992e4f);})[_0x0605('0x15')](function(_0x3a1c75){logger[_0x0605('0x11')](_0x0605('0x2b'),_0x3a1c75[_0x0605('0x13')],_0x6bc204);_0x4d9a31(_0x3c8e36[_0x0605('0x11')](0x1f4,_0x3a1c75[_0x0605('0x13')]));});});}; \ No newline at end of file +var _0x8ace=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','body','callRecordingEncryption','value','format','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x5a75e7,_0x3ad506){_0x5a75e7=_0x5a75e7-0x0;var _0x15c695=_0x8ace[_0x5a75e7];return _0x15c695;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});}exports[_0xe8ac('0x19')]=function(_0x36759c){var _0x4892d0=this;return new Promise(function(_0x59df3d,_0x5f3433){return db[_0xe8ac('0x1a')][_0xe8ac('0x1b')](_0x36759c['body'],{'raw':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1e')]||null:null,'attributes':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')]||null:null,'limit':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')]['limit']||null:null})[_0xe8ac('0x20')](function(_0x3933d2){logger[_0xe8ac('0xf')](_0xe8ac('0x19'),_0x36759c);logger[_0xe8ac('0x12')](_0xe8ac('0x19'),_0x36759c,JSON[_0xe8ac('0x14')](_0x3933d2));_0x59df3d(_0x3933d2);})['catch'](function(_0x1c3ea4){logger[_0xe8ac('0x15')](_0xe8ac('0x19'),_0x1c3ea4[_0xe8ac('0x16')],_0x36759c);_0x5f3433(_0x4892d0[_0xe8ac('0x15')](0x1f4,_0x1c3ea4[_0xe8ac('0x16')]));});});};exports[_0xe8ac('0x21')]=function(_0x3e3fc2){var _0x44b07c=this;return new Promise(function(_0x562e44,_0x5a1b69){var _0x346dcb=require(_0xe8ac('0x22'));var _0x59512c;return db[_0xe8ac('0x23')][_0xe8ac('0x24')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1f1e44){_0x59512c=_0x1f1e44;return db[_0xe8ac('0x1a')][_0xe8ac('0x25')](_0x3e3fc2[_0xe8ac('0x26')]);})[_0xe8ac('0x20')](function(_0x41ffe8){if(_0x59512c[_0xe8ac('0x27')]&&fs['existsSync'](_0x41ffe8[_0xe8ac('0x28')])){var _0x5459e5=util[_0xe8ac('0x29')]('%s.cypher',_0x41ffe8['value']);return _0x346dcb['encryptFile'](_0x41ffe8['value'],_0x5459e5,config[_0xe8ac('0x2a')][_0xe8ac('0x2b')])[_0xe8ac('0x20')](function(){fs[_0xe8ac('0x2c')](_0x41ffe8[_0xe8ac('0x28')]);logger[_0xe8ac('0xf')](_0xe8ac('0x2d'));return _0x41ffe8;});}return _0x41ffe8;})['then'](function(_0x1cacb0){logger['info']('CreateVoiceRecording',_0x3e3fc2);logger['debug'](_0xe8ac('0x21'),_0x3e3fc2,JSON[_0xe8ac('0x14')](_0x1cacb0));_0x562e44(_0x1cacb0);})[_0xe8ac('0x18')](function(_0x56feff){logger['error'](_0xe8ac('0x21'),_0x56feff[_0xe8ac('0x16')],_0x3e3fc2);_0x5a1b69(_0x44b07c[_0xe8ac('0x15')](0x1f4,_0x56feff[_0xe8ac('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b3d5c1a..b46e0da 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 _0x32d8=['/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x32d8,0x78));var _0x832d=function(_0x26dfc5,_0x138166){_0x26dfc5=_0x26dfc5-0x0;var _0x566350=_0x32d8[_0x26dfc5];return _0x566350;};'use strict';var multer=require('multer');var util=require(_0x832d('0x0'));var path=require(_0x832d('0x1'));var timeout=require(_0x832d('0x2'));var express=require(_0x832d('0x3'));var router=express[_0x832d('0x4')]();var fs_extra=require(_0x832d('0x5'));var auth=require(_0x832d('0x6'));var interaction=require(_0x832d('0x7'));var config=require(_0x832d('0x8'));var controller=require(_0x832d('0x9'));router[_0x832d('0xa')]('/',auth[_0x832d('0xb')](),controller['index']);router[_0x832d('0xa')](_0x832d('0xc'),auth[_0x832d('0xb')](),controller[_0x832d('0xd')]);router[_0x832d('0xa')](_0x832d('0xe'),auth['isAuthenticated'](),controller[_0x832d('0xf')]);router[_0x832d('0x10')]('/',auth[_0x832d('0xb')](),controller[_0x832d('0x11')]);router[_0x832d('0x12')](_0x832d('0xe'),auth[_0x832d('0xb')](),controller['update']);router[_0x832d('0x13')](_0x832d('0xe'),auth['isAuthenticated'](),controller[_0x832d('0x14')]);module[_0x832d('0x15')]=router; \ No newline at end of file +var _0x6ee9=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x39f2a8,_0x42b848){var _0x2fba76=function(_0x3bb996){while(--_0x3bb996){_0x39f2a8['push'](_0x39f2a8['shift']());}};_0x2fba76(++_0x42b848);}(_0x6ee9,0x15c));var _0x96ee=function(_0x4fb74c,_0x32ab4a){_0x4fb74c=_0x4fb74c-0x0;var _0x1400f2=_0x6ee9[_0x4fb74c];return _0x1400f2;};'use strict';var multer=require(_0x96ee('0x0'));var util=require(_0x96ee('0x1'));var path=require(_0x96ee('0x2'));var timeout=require(_0x96ee('0x3'));var express=require(_0x96ee('0x4'));var router=express['Router']();var fs_extra=require(_0x96ee('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x96ee('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x96ee('0x7')]('/',auth[_0x96ee('0x8')](),controller['index']);router[_0x96ee('0x7')](_0x96ee('0x9'),auth[_0x96ee('0x8')](),controller[_0x96ee('0xa')]);router['get'](_0x96ee('0xb'),auth['isAuthenticated'](),controller[_0x96ee('0xc')]);router[_0x96ee('0xd')]('/',auth[_0x96ee('0x8')](),controller[_0x96ee('0xe')]);router[_0x96ee('0xf')](_0x96ee('0xb'),auth[_0x96ee('0x8')](),controller[_0x96ee('0x10')]);router[_0x96ee('0x11')]('/:id',auth[_0x96ee('0x8')](),controller[_0x96ee('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 053d784..9e5b54b 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 _0x4709=['ENUM','moment','exports','blind','attended','STRING'];(function(_0x3aec43,_0x1b69b6){var _0x49b1ac=function(_0x117579){while(--_0x117579){_0x3aec43['push'](_0x3aec43['shift']());}};_0x49b1ac(++_0x1b69b6);}(_0x4709,0x19f));var _0x9470=function(_0x11d821,_0x4ed769){_0x11d821=_0x11d821-0x0;var _0x9130b6=_0x4709[_0x11d821];return _0x9130b6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9470('0x0'));module[_0x9470('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9470('0x2'),_0x9470('0x3'))},'result':{'type':Sequelize[_0x9470('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x9470('0x4')]},'transferercalleridname':{'type':Sequelize[_0x9470('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x9470('0x4')]},'transfererexten':{'type':Sequelize[_0x9470('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x9470('0x4')]},'transfereechannel':{'type':Sequelize[_0x9470('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x9470('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x9470('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9470('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x9470('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x9470('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x9470('0x5')]('Yes','No')},'context':{'type':Sequelize[_0x9470('0x4')]},'extension':{'type':Sequelize[_0x9470('0x4')]}}; \ No newline at end of file +var _0x8493=['moment','exports','blind','attended','STRING','ENUM','Yes','sequelize'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0x8493,0x1df));var _0x3849=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0x8493[_0x5af97c];return _0x3472ae;};'use strict';var Sequelize=require(_0x3849('0x0'));var moment=require(_0x3849('0x1'));module[_0x3849('0x2')]={'type':{'type':Sequelize['ENUM'](_0x3849('0x3'),_0x3849('0x4'))},'result':{'type':Sequelize[_0x3849('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x3849('0x5')]},'transferercalleridname':{'type':Sequelize[_0x3849('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x3849('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x3849('0x5')]},'transferercontext':{'type':Sequelize[_0x3849('0x5')]},'transfererexten':{'type':Sequelize[_0x3849('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x3849('0x5')]},'transfereechannel':{'type':Sequelize[_0x3849('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x3849('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x3849('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x3849('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x3849('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x3849('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x3849('0x5')]},'isexternal':{'type':Sequelize[_0x3849('0x6')](_0x3849('0x7'),'No')},'context':{'type':Sequelize[_0x3849('0x5')]},'extension':{'type':Sequelize[_0x3849('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3c802b0..ba16da7 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 _0x6329=['find','params','describe','eml-format','zip-dir','fast-json-patch','moment','util','sox','ejs','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','json','save','then','destroy','stack','send','index','map','VoiceTransferReport','rawAttributes','type','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','include','catch','show','body'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6329,0xc0));var _0x9632=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6329[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x9632('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9632('0x1'));var jsonpatch=require(_0x9632('0x2'));var rp=require('request-promise');var moment=require(_0x9632('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9632('0x4'));var path=require('path');var sox=require(_0x9632('0x5'));var csv=require('to-csv');var ejs=require(_0x9632('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9632('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9632('0x8'));var querystring=require('querystring');var Papa=require(_0x9632('0x9'));var Redis=require(_0x9632('0xa'));var authService=require(_0x9632('0xb'));var qs=require(_0x9632('0xc'));var as=require(_0x9632('0xd'));var hardwareService=require(_0x9632('0xe'));var logger=require(_0x9632('0xf'))(_0x9632('0x10'));var utils=require(_0x9632('0x11'));var config=require(_0x9632('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9632('0x13'))['db'];function respondWithStatusCode(_0x6c4870,_0x6f30c6){_0x6f30c6=_0x6f30c6||0xcc;return function(_0x3653ca){if(_0x3653ca){return _0x6c4870[_0x9632('0x14')](_0x6f30c6);}return _0x6c4870['status'](_0x6f30c6)[_0x9632('0x15')]();};}function respondWithResult(_0x19cc3b,_0x1c7c78){_0x1c7c78=_0x1c7c78||0xc8;return function(_0x5a120c){if(_0x5a120c){return _0x19cc3b['status'](_0x1c7c78)['json'](_0x5a120c);}};}function respondWithFilteredResult(_0x15984f,_0x4e5db0){return function(_0x22cea6){if(_0x22cea6){var _0xbfbf8=typeof _0x4e5db0[_0x9632('0x16')]===_0x9632('0x17')&&typeof _0x4e5db0[_0x9632('0x18')]==='undefined';var _0x1ca44a=_0x22cea6[_0x9632('0x19')];var _0x38c3bf=_0xbfbf8?0x0:_0x4e5db0['offset'];var _0x139cb5=_0xbfbf8?_0x22cea6[_0x9632('0x19')]:_0x4e5db0[_0x9632('0x16')]+_0x4e5db0['limit'];var _0x25c1fc;if(_0x139cb5>=_0x1ca44a){_0x139cb5=_0x1ca44a;_0x25c1fc=0xc8;}else{_0x25c1fc=0xce;}_0x15984f[_0x9632('0x1a')](_0x25c1fc);return _0x15984f[_0x9632('0x1b')]('Content-Range',_0x38c3bf+'-'+_0x139cb5+'/'+_0x1ca44a)[_0x9632('0x1c')](_0x22cea6);}return null;};}function patchUpdates(_0x49c7c5){return function(_0x13fe7b){try{jsonpatch['apply'](_0x13fe7b,_0x49c7c5,!![]);}catch(_0x2325e7){return BPromise['reject'](_0x2325e7);}return _0x13fe7b[_0x9632('0x1d')]();};}function saveUpdates(_0x2a19e0,_0x4ba8d3){return function(_0x2c94bd){if(_0x2c94bd){return _0x2c94bd['update'](_0x2a19e0)[_0x9632('0x1e')](function(_0x1a218d){return _0x1a218d;});}return null;};}function removeEntity(_0x2c2cc5,_0x3788b8){return function(_0x6935d){if(_0x6935d){return _0x6935d[_0x9632('0x1f')]()[_0x9632('0x1e')](function(){_0x2c2cc5[_0x9632('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e5803,_0x4bfafd){return function(_0x599e5a){if(!_0x599e5a){_0x4e5803['sendStatus'](0x194);}return _0x599e5a;};}function handleError(_0x36b952,_0x4927fd){_0x4927fd=_0x4927fd||0x1f4;return function(_0x1664e6){logger['error'](_0x1664e6[_0x9632('0x20')]);if(_0x1664e6['name']){delete _0x1664e6['name'];}_0x36b952['status'](_0x4927fd)[_0x9632('0x21')](_0x1664e6);};}exports[_0x9632('0x22')]=function(_0x2fec29,_0x5d5999){var _0x2d8dd4={},_0x2d59b5={},_0x4fd5ec={'count':0x0,'rows':[]};var _0x4eaee9=_[_0x9632('0x23')](db[_0x9632('0x24')][_0x9632('0x25')],function(_0x2df7d0){return{'name':_0x2df7d0['fieldName'],'type':_0x2df7d0[_0x9632('0x26')]['key']};});_0x2d59b5[_0x9632('0x27')]=_[_0x9632('0x23')](_0x4eaee9,_0x9632('0x28'));_0x2d59b5[_0x9632('0x29')]=_[_0x9632('0x2a')](_0x2fec29[_0x9632('0x29')]);_0x2d59b5['filters']=_[_0x9632('0x2b')](_0x2d59b5['model'],_0x2d59b5[_0x9632('0x29')]);_0x2d8dd4['attributes']=_[_0x9632('0x2b')](_0x2d59b5[_0x9632('0x27')],qs[_0x9632('0x2c')](_0x2fec29['query'][_0x9632('0x2c')]));_0x2d8dd4[_0x9632('0x2d')]=_0x2d8dd4[_0x9632('0x2d')][_0x9632('0x2e')]?_0x2d8dd4['attributes']:_0x2d59b5[_0x9632('0x27')];if(!_0x2fec29[_0x9632('0x29')][_0x9632('0x2f')](_0x9632('0x30'))){_0x2d8dd4[_0x9632('0x18')]=qs[_0x9632('0x18')](_0x2fec29[_0x9632('0x29')][_0x9632('0x18')]);_0x2d8dd4[_0x9632('0x16')]=qs['offset'](_0x2fec29[_0x9632('0x29')]['offset']);}_0x2d8dd4[_0x9632('0x31')]=qs[_0x9632('0x32')](_0x2fec29[_0x9632('0x29')][_0x9632('0x32')]);_0x2d8dd4[_0x9632('0x33')]=qs[_0x9632('0x34')](_['pick'](_0x2fec29[_0x9632('0x29')],_0x2d59b5[_0x9632('0x34')]),_0x4eaee9);if(_0x2fec29['query']['filter']){_0x2d8dd4[_0x9632('0x33')]=_[_0x9632('0x35')](_0x2d8dd4[_0x9632('0x33')],{'$or':_[_0x9632('0x23')](_0x4eaee9,function(_0x5f2c7e){if(_0x5f2c7e[_0x9632('0x26')]!==_0x9632('0x36')){var _0x15be30={};_0x15be30[_0x5f2c7e['name']]={'$like':'%'+_0x2fec29['query']['filter']+'%'};return _0x15be30;}})});}_0x2d8dd4=_[_0x9632('0x35')]({},_0x2d8dd4,_0x2fec29[_0x9632('0x37')]);var _0x348735={'where':_0x2d8dd4['where']};return db['VoiceTransferReport']['count'](_0x348735)[_0x9632('0x1e')](function(_0x569be6){_0x4fd5ec[_0x9632('0x19')]=_0x569be6;if(_0x2fec29[_0x9632('0x29')]['includeAll']){_0x2d8dd4[_0x9632('0x38')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x2d8dd4);})[_0x9632('0x1e')](function(_0x1fa0d9){_0x4fd5ec['rows']=_0x1fa0d9;return _0x4fd5ec;})['then'](respondWithFilteredResult(_0x5d5999,_0x2d8dd4))[_0x9632('0x39')](handleError(_0x5d5999,null));};exports[_0x9632('0x3a')]=function(_0x50268a,_0x4ce3d9){var _0x519af3={'raw':!![],'where':{'id':_0x50268a['params']['id']}},_0x4470aa={};_0x4470aa[_0x9632('0x27')]=_[_0x9632('0x2a')](db['VoiceTransferReport'][_0x9632('0x25')]);_0x4470aa['query']=_[_0x9632('0x2a')](_0x50268a[_0x9632('0x29')]);_0x4470aa[_0x9632('0x34')]=_[_0x9632('0x2b')](_0x4470aa[_0x9632('0x27')],_0x4470aa[_0x9632('0x29')]);_0x519af3[_0x9632('0x2d')]=_[_0x9632('0x2b')](_0x4470aa[_0x9632('0x27')],qs['fields'](_0x50268a['query'][_0x9632('0x2c')]));_0x519af3[_0x9632('0x2d')]=_0x519af3['attributes'][_0x9632('0x2e')]?_0x519af3['attributes']:_0x4470aa[_0x9632('0x27')];if(_0x50268a[_0x9632('0x29')]['includeAll']){_0x519af3[_0x9632('0x38')]=[{'all':!![]}];}_0x519af3=_[_0x9632('0x35')]({},_0x519af3,_0x50268a[_0x9632('0x37')]);return db['VoiceTransferReport']['find'](_0x519af3)[_0x9632('0x1e')](handleEntityNotFound(_0x4ce3d9,null))[_0x9632('0x1e')](respondWithResult(_0x4ce3d9,null))[_0x9632('0x39')](handleError(_0x4ce3d9,null));};exports['create']=function(_0x499f13,_0x2eaf5b){return db[_0x9632('0x24')]['create'](_0x499f13[_0x9632('0x3b')],{})[_0x9632('0x1e')](respondWithResult(_0x2eaf5b,0xc9))[_0x9632('0x39')](handleError(_0x2eaf5b,null));};exports['update']=function(_0x58c02d,_0x4061b4){if(_0x58c02d[_0x9632('0x3b')]['id']){delete _0x58c02d['body']['id'];}return db[_0x9632('0x24')][_0x9632('0x3c')]({'where':{'id':_0x58c02d[_0x9632('0x3d')]['id']}})[_0x9632('0x1e')](handleEntityNotFound(_0x4061b4,null))[_0x9632('0x1e')](saveUpdates(_0x58c02d[_0x9632('0x3b')],null))[_0x9632('0x1e')](respondWithResult(_0x4061b4,null))[_0x9632('0x39')](handleError(_0x4061b4,null));};exports[_0x9632('0x1f')]=function(_0x1825f0,_0x445750){return db[_0x9632('0x24')][_0x9632('0x3c')]({'where':{'id':_0x1825f0[_0x9632('0x3d')]['id']}})[_0x9632('0x1e')](handleEntityNotFound(_0x445750,null))[_0x9632('0x1e')](removeEntity(_0x445750,null))[_0x9632('0x39')](handleError(_0x445750,null));};exports[_0x9632('0x3e')]=function(_0x52345c,_0x1cdc5d){return db[_0x9632('0x24')][_0x9632('0x3e')]()[_0x9632('0x1e')](respondWithResult(_0x1cdc5d,null))['catch'](handleError(_0x1cdc5d,null));}; \ No newline at end of file +var _0x1c62=['then','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','reject','save','update','destroy'];(function(_0x163395,_0x2e3464){var _0x804441=function(_0x677470){while(--_0x677470){_0x163395['push'](_0x163395['shift']());}};_0x804441(++_0x2e3464);}(_0x1c62,0x73));var _0x21c6=function(_0x5c883f,_0x38f092){_0x5c883f=_0x5c883f-0x0;var _0x4210cc=_0x1c62[_0x5c883f];return _0x4210cc;};'use strict';var emlformat=require(_0x21c6('0x0'));var rimraf=require(_0x21c6('0x1'));var zipdir=require(_0x21c6('0x2'));var jsonpatch=require(_0x21c6('0x3'));var rp=require(_0x21c6('0x4'));var moment=require(_0x21c6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x21c6('0x6'));var sox=require('sox');var csv=require(_0x21c6('0x7'));var ejs=require(_0x21c6('0x8'));var fs=require('fs');var fs_extra=require(_0x21c6('0x9'));var _=require(_0x21c6('0xa'));var squel=require(_0x21c6('0xb'));var crypto=require(_0x21c6('0xc'));var jsforce=require(_0x21c6('0xd'));var deskjs=require(_0x21c6('0xe'));var toCsv=require(_0x21c6('0x7'));var querystring=require(_0x21c6('0xf'));var Papa=require(_0x21c6('0x10'));var Redis=require('ioredis');var authService=require(_0x21c6('0x11'));var qs=require(_0x21c6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21c6('0x13'));var logger=require('../../config/logger')(_0x21c6('0x14'));var utils=require(_0x21c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x21c6('0x16'));var db=require(_0x21c6('0x17'))['db'];function respondWithStatusCode(_0x46ccfb,_0x1aecb8){_0x1aecb8=_0x1aecb8||0xcc;return function(_0x1249be){if(_0x1249be){return _0x46ccfb[_0x21c6('0x18')](_0x1aecb8);}return _0x46ccfb['status'](_0x1aecb8)[_0x21c6('0x19')]();};}function respondWithResult(_0xbcddc3,_0x543a27){_0x543a27=_0x543a27||0xc8;return function(_0x3af830){if(_0x3af830){return _0xbcddc3[_0x21c6('0x1a')](_0x543a27)[_0x21c6('0x1b')](_0x3af830);}};}function respondWithFilteredResult(_0x150434,_0x2bea4e){return function(_0x24b4d2){if(_0x24b4d2){var _0x19f78e=typeof _0x2bea4e[_0x21c6('0x1c')]==='undefined'&&typeof _0x2bea4e['limit']==='undefined';var _0x5e0f20=_0x24b4d2[_0x21c6('0x1d')];var _0x556c4d=_0x19f78e?0x0:_0x2bea4e[_0x21c6('0x1c')];var _0x41da6e=_0x19f78e?_0x24b4d2[_0x21c6('0x1d')]:_0x2bea4e[_0x21c6('0x1c')]+_0x2bea4e[_0x21c6('0x1e')];var _0x281efa;if(_0x41da6e>=_0x5e0f20){_0x41da6e=_0x5e0f20;_0x281efa=0xc8;}else{_0x281efa=0xce;}_0x150434[_0x21c6('0x1a')](_0x281efa);return _0x150434[_0x21c6('0x1f')](_0x21c6('0x20'),_0x556c4d+'-'+_0x41da6e+'/'+_0x5e0f20)[_0x21c6('0x1b')](_0x24b4d2);}return null;};}function patchUpdates(_0x5517cd){return function(_0x4d8208){try{jsonpatch['apply'](_0x4d8208,_0x5517cd,!![]);}catch(_0x23df7f){return BPromise[_0x21c6('0x21')](_0x23df7f);}return _0x4d8208[_0x21c6('0x22')]();};}function saveUpdates(_0x100963,_0x1a3c25){return function(_0x19442a){if(_0x19442a){return _0x19442a[_0x21c6('0x23')](_0x100963)['then'](function(_0x20d1c8){return _0x20d1c8;});}return null;};}function removeEntity(_0x3f1c25,_0x2024d0){return function(_0x4aca9e){if(_0x4aca9e){return _0x4aca9e[_0x21c6('0x24')]()[_0x21c6('0x25')](function(){_0x3f1c25[_0x21c6('0x1a')](0xcc)[_0x21c6('0x19')]();});}};}function handleEntityNotFound(_0x4b4f48,_0xebbeab){return function(_0x5525fc){if(!_0x5525fc){_0x4b4f48['sendStatus'](0x194);}return _0x5525fc;};}function handleError(_0x5c93b0,_0x18ec33){_0x18ec33=_0x18ec33||0x1f4;return function(_0x13448d){logger[_0x21c6('0x26')](_0x13448d['stack']);if(_0x13448d[_0x21c6('0x27')]){delete _0x13448d[_0x21c6('0x27')];}_0x5c93b0[_0x21c6('0x1a')](_0x18ec33)[_0x21c6('0x28')](_0x13448d);};}exports['index']=function(_0x25b133,_0x5a67ff){var _0x3764d7={},_0x27b44f={},_0x3e782b={'count':0x0,'rows':[]};var _0x250b92=_[_0x21c6('0x29')](db['VoiceTransferReport'][_0x21c6('0x2a')],function(_0xe7ee2){return{'name':_0xe7ee2[_0x21c6('0x2b')],'type':_0xe7ee2[_0x21c6('0x2c')][_0x21c6('0x2d')]};});_0x27b44f[_0x21c6('0x2e')]=_[_0x21c6('0x29')](_0x250b92,'name');_0x27b44f[_0x21c6('0x2f')]=_[_0x21c6('0x30')](_0x25b133[_0x21c6('0x2f')]);_0x27b44f[_0x21c6('0x31')]=_[_0x21c6('0x32')](_0x27b44f[_0x21c6('0x2e')],_0x27b44f['query']);_0x3764d7['attributes']=_['intersection'](_0x27b44f[_0x21c6('0x2e')],qs[_0x21c6('0x33')](_0x25b133[_0x21c6('0x2f')][_0x21c6('0x33')]));_0x3764d7[_0x21c6('0x34')]=_0x3764d7['attributes'][_0x21c6('0x35')]?_0x3764d7['attributes']:_0x27b44f[_0x21c6('0x2e')];if(!_0x25b133[_0x21c6('0x2f')][_0x21c6('0x36')](_0x21c6('0x37'))){_0x3764d7[_0x21c6('0x1e')]=qs[_0x21c6('0x1e')](_0x25b133[_0x21c6('0x2f')][_0x21c6('0x1e')]);_0x3764d7['offset']=qs[_0x21c6('0x1c')](_0x25b133[_0x21c6('0x2f')]['offset']);}_0x3764d7[_0x21c6('0x38')]=qs[_0x21c6('0x39')](_0x25b133['query'][_0x21c6('0x39')]);_0x3764d7[_0x21c6('0x3a')]=qs['filters'](_[_0x21c6('0x3b')](_0x25b133[_0x21c6('0x2f')],_0x27b44f[_0x21c6('0x31')]),_0x250b92);if(_0x25b133[_0x21c6('0x2f')][_0x21c6('0x3c')]){_0x3764d7[_0x21c6('0x3a')]=_[_0x21c6('0x3d')](_0x3764d7[_0x21c6('0x3a')],{'$or':_[_0x21c6('0x29')](_0x250b92,function(_0x68db7e){if(_0x68db7e['type']!==_0x21c6('0x3e')){var _0x42f649={};_0x42f649[_0x68db7e[_0x21c6('0x27')]]={'$like':'%'+_0x25b133[_0x21c6('0x2f')]['filter']+'%'};return _0x42f649;}})});}_0x3764d7=_[_0x21c6('0x3d')]({},_0x3764d7,_0x25b133[_0x21c6('0x3f')]);var _0x4bf638={'where':_0x3764d7[_0x21c6('0x3a')]};return db[_0x21c6('0x40')]['count'](_0x4bf638)['then'](function(_0x3d90a7){_0x3e782b['count']=_0x3d90a7;if(_0x25b133['query'][_0x21c6('0x41')]){_0x3764d7[_0x21c6('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x21c6('0x43')](_0x3764d7);})[_0x21c6('0x25')](function(_0x572d56){_0x3e782b[_0x21c6('0x44')]=_0x572d56;return _0x3e782b;})['then'](respondWithFilteredResult(_0x5a67ff,_0x3764d7))['catch'](handleError(_0x5a67ff,null));};exports[_0x21c6('0x45')]=function(_0x27edb9,_0x3fb6e3){var _0x5eb0d1={'raw':!![],'where':{'id':_0x27edb9[_0x21c6('0x46')]['id']}},_0x499e03={};_0x499e03[_0x21c6('0x2e')]=_[_0x21c6('0x30')](db[_0x21c6('0x40')][_0x21c6('0x2a')]);_0x499e03[_0x21c6('0x2f')]=_['keys'](_0x27edb9[_0x21c6('0x2f')]);_0x499e03[_0x21c6('0x31')]=_['intersection'](_0x499e03[_0x21c6('0x2e')],_0x499e03['query']);_0x5eb0d1[_0x21c6('0x34')]=_[_0x21c6('0x32')](_0x499e03[_0x21c6('0x2e')],qs[_0x21c6('0x33')](_0x27edb9[_0x21c6('0x2f')]['fields']));_0x5eb0d1['attributes']=_0x5eb0d1['attributes'][_0x21c6('0x35')]?_0x5eb0d1['attributes']:_0x499e03[_0x21c6('0x2e')];if(_0x27edb9[_0x21c6('0x2f')][_0x21c6('0x41')]){_0x5eb0d1['include']=[{'all':!![]}];}_0x5eb0d1=_['merge']({},_0x5eb0d1,_0x27edb9[_0x21c6('0x3f')]);return db[_0x21c6('0x40')]['find'](_0x5eb0d1)[_0x21c6('0x25')](handleEntityNotFound(_0x3fb6e3,null))[_0x21c6('0x25')](respondWithResult(_0x3fb6e3,null))[_0x21c6('0x47')](handleError(_0x3fb6e3,null));};exports[_0x21c6('0x48')]=function(_0x266682,_0x2717d5){return db[_0x21c6('0x40')][_0x21c6('0x48')](_0x266682['body'],{})['then'](respondWithResult(_0x2717d5,0xc9))[_0x21c6('0x47')](handleError(_0x2717d5,null));};exports['update']=function(_0x516059,_0x196603){if(_0x516059[_0x21c6('0x49')]['id']){delete _0x516059['body']['id'];}return db[_0x21c6('0x40')][_0x21c6('0x4a')]({'where':{'id':_0x516059[_0x21c6('0x46')]['id']}})[_0x21c6('0x25')](handleEntityNotFound(_0x196603,null))['then'](saveUpdates(_0x516059['body'],null))[_0x21c6('0x25')](respondWithResult(_0x196603,null))[_0x21c6('0x47')](handleError(_0x196603,null));};exports['destroy']=function(_0x595b17,_0x55be04){return db['VoiceTransferReport']['find']({'where':{'id':_0x595b17[_0x21c6('0x46')]['id']}})[_0x21c6('0x25')](handleEntityNotFound(_0x55be04,null))[_0x21c6('0x25')](removeEntity(_0x55be04,null))[_0x21c6('0x47')](handleError(_0x55be04,null));};exports[_0x21c6('0x4b')]=function(_0x1ede83,_0x5dc11d){return db['VoiceTransferReport']['describe']()[_0x21c6('0x25')](respondWithResult(_0x5dc11d,null))['catch'](handleError(_0x5dc11d,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index fae9677..87e4c1a 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 _0x8e91=['request-promise','path','rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','bluebird'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0x8e91,0x158));var _0x18e9=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x8e91[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x18e9('0x0'));var util=require(_0x18e9('0x1'));var logger=require('../../config/logger')(_0x18e9('0x2'));var moment=require('moment');var BPromise=require(_0x18e9('0x3'));var rp=require(_0x18e9('0x4'));var fs=require('fs');var path=require(_0x18e9('0x5'));var rimraf=require(_0x18e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x18e9('0x7'));module[_0x18e9('0x8')]=function(_0x481cbb,_0x4b0514){return _0x481cbb[_0x18e9('0x9')](_0x18e9('0xa'),attributes,{'tableName':_0x18e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb995=['../../config/environment','define','report_call_transfer','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x2ed507,_0x15b536){var _0x363175=function(_0x3735df){while(--_0x3735df){_0x2ed507['push'](_0x2ed507['shift']());}};_0x363175(++_0x15b536);}(_0xb995,0xf3));var _0x5b99=function(_0x249143,_0x54bdb6){_0x249143=_0x249143-0x0;var _0xd3f33=_0xb995[_0x249143];return _0xd3f33;};'use strict';var _=require(_0x5b99('0x0'));var util=require(_0x5b99('0x1'));var logger=require('../../config/logger')(_0x5b99('0x2'));var moment=require('moment');var BPromise=require(_0x5b99('0x3'));var rp=require(_0x5b99('0x4'));var fs=require('fs');var path=require(_0x5b99('0x5'));var rimraf=require(_0x5b99('0x6'));var config=require(_0x5b99('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x2f4be5,_0x560750){return _0x2f4be5[_0x5b99('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x5b99('0x9'),'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 9636ec8..8e18252 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 _0x75a3=['body','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0xc990e4,_0x1551f5){var _0x326b0f=function(_0x598a89){while(--_0x598a89){_0xc990e4['push'](_0xc990e4['shift']());}};_0x326b0f(++_0x1551f5);}(_0x75a3,0x104));var _0x375a=function(_0x2dad23,_0x5183a8){_0x2dad23=_0x2dad23-0x0;var _0x3bde6e=_0x75a3[_0x2dad23];return _0x3bde6e;};'use strict';var _=require(_0x375a('0x0'));var util=require(_0x375a('0x1'));var moment=require(_0x375a('0x2'));var BPromise=require(_0x375a('0x3'));var rs=require(_0x375a('0x4'));var fs=require('fs');var Redis=require(_0x375a('0x5'));var db=require(_0x375a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x375a('0x7'))(_0x375a('0x8'));var config=require(_0x375a('0x9'));var jayson=require(_0x375a('0xa'));var client=jayson[_0x375a('0xb')][_0x375a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3161ef,_0x4eadfe,_0x157168){return new BPromise(function(_0x19f828,_0x383083){return client[_0x375a('0xd')](_0x3161ef,_0x157168)[_0x375a('0xe')](function(_0x82d105){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x4eadfe,_0x375a('0xf'));logger[_0x375a('0x10')](_0x375a('0x11'),_0x4eadfe,'request\x20sent',JSON[_0x375a('0x12')](_0x82d105));if(_0x82d105[_0x375a('0x13')]){if(_0x82d105['error'][_0x375a('0x14')]===0x1f4){logger[_0x375a('0x13')](_0x375a('0x15'),_0x4eadfe,_0x82d105[_0x375a('0x13')][_0x375a('0x16')]);return _0x383083(_0x82d105[_0x375a('0x13')][_0x375a('0x16')]);}logger[_0x375a('0x13')](_0x375a('0x15'),_0x4eadfe,_0x82d105[_0x375a('0x13')][_0x375a('0x16')]);return _0x19f828(_0x82d105['error'][_0x375a('0x16')]);}else{logger['info'](_0x375a('0x15'),_0x4eadfe,'request\x20sent');_0x19f828(_0x82d105[_0x375a('0x17')][_0x375a('0x16')]);}})[_0x375a('0x18')](function(_0xb7e211){logger[_0x375a('0x13')](_0x375a('0x15'),_0x4eadfe,_0xb7e211);_0x383083(_0xb7e211);});});}exports[_0x375a('0x19')]=function(_0xae95a7){var _0x4e6c76=this;return new Promise(function(_0xcbf2da,_0x4c97fe){return db[_0x375a('0x1a')][_0x375a('0x1b')](_0xae95a7[_0x375a('0x1c')],{'raw':_0xae95a7['options']?_0xae95a7[_0x375a('0x1d')][_0x375a('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x32397e){logger[_0x375a('0x1f')]('CreateVoiceTransferReport',_0xae95a7);logger[_0x375a('0x10')](_0x375a('0x19'),_0xae95a7,JSON[_0x375a('0x12')](_0x32397e));_0xcbf2da(_0x32397e);})[_0x375a('0x18')](function(_0x1b4a6e){logger[_0x375a('0x13')](_0x375a('0x19'),_0x1b4a6e[_0x375a('0x16')],_0xae95a7);_0x4c97fe(_0x4e6c76['error'](0x1f4,_0x1b4a6e[_0x375a('0x16')]));});});}; \ No newline at end of file +var _0x7ed6=['options','raw','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceTransferReport,\x20%s,\x20%s','info','result','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0x3e4295,_0x3ebdd7){var _0x57f4ac=function(_0xbe15a6){while(--_0xbe15a6){_0x3e4295['push'](_0x3e4295['shift']());}};_0x57f4ac(++_0x3ebdd7);}(_0x7ed6,0xab));var _0x67ed=function(_0x21b41e,_0x2e16f2){_0x21b41e=_0x21b41e-0x0;var _0x49ca2d=_0x7ed6[_0x21b41e];return _0x49ca2d;};'use strict';var _=require(_0x67ed('0x0'));var util=require('util');var moment=require(_0x67ed('0x1'));var BPromise=require(_0x67ed('0x2'));var rs=require(_0x67ed('0x3'));var fs=require('fs');var Redis=require(_0x67ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x67ed('0x5'));var logger=require('../../config/logger')(_0x67ed('0x6'));var config=require(_0x67ed('0x7'));var jayson=require(_0x67ed('0x8'));var client=jayson['client'][_0x67ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4df5e7,_0x273520,_0x4d2eea){return new BPromise(function(_0x4584e3,_0x186044){return client[_0x67ed('0xa')](_0x4df5e7,_0x4d2eea)[_0x67ed('0xb')](function(_0x1fd11c){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x273520,_0x67ed('0xc'));logger[_0x67ed('0xd')](_0x67ed('0xe'),_0x273520,_0x67ed('0xc'),JSON[_0x67ed('0xf')](_0x1fd11c));if(_0x1fd11c['error']){if(_0x1fd11c['error'][_0x67ed('0x10')]===0x1f4){logger[_0x67ed('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x273520,_0x1fd11c[_0x67ed('0x11')][_0x67ed('0x12')]);return _0x186044(_0x1fd11c['error'][_0x67ed('0x12')]);}logger[_0x67ed('0x11')](_0x67ed('0x13'),_0x273520,_0x1fd11c[_0x67ed('0x11')][_0x67ed('0x12')]);return _0x4584e3(_0x1fd11c[_0x67ed('0x11')][_0x67ed('0x12')]);}else{logger[_0x67ed('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x273520,_0x67ed('0xc'));_0x4584e3(_0x1fd11c[_0x67ed('0x15')]['message']);}})['catch'](function(_0x45f55e){logger[_0x67ed('0x11')](_0x67ed('0x13'),_0x273520,_0x45f55e);_0x186044(_0x45f55e);});});}exports[_0x67ed('0x16')]=function(_0x3716b3){var _0x47b491=this;return new Promise(function(_0x459a44,_0x34cac8){return db[_0x67ed('0x17')][_0x67ed('0x18')](_0x3716b3['body'],{'raw':_0x3716b3[_0x67ed('0x19')]?_0x3716b3[_0x67ed('0x19')][_0x67ed('0x1a')]===undefined?!![]:![]:!![]})[_0x67ed('0xb')](function(_0x386ce7){logger[_0x67ed('0x14')](_0x67ed('0x16'),_0x3716b3);logger['debug'](_0x67ed('0x16'),_0x3716b3,JSON[_0x67ed('0xf')](_0x386ce7));_0x459a44(_0x386ce7);})[_0x67ed('0x1b')](function(_0x42cf78){logger[_0x67ed('0x11')]('CreateVoiceTransferReport',_0x42cf78[_0x67ed('0x12')],_0x3716b3);_0x34cac8(_0x47b491['error'](0x1f4,_0x42cf78['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 025f299..c9e21e1 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/hold','hold','/unhold'];(function(_0xc396f2,_0x1405b6){var _0x5440a6=function(_0x1f0eaa){while(--_0x1f0eaa){_0xc396f2['push'](_0xc396f2['shift']());}};_0x5440a6(++_0x1405b6);}(_0x54ef,0x112));var _0xf54e=function(_0xe1a8fe,_0x214804){_0xe1a8fe=_0xe1a8fe-0x0;var _0x231607=_0x54ef[_0xe1a8fe];return _0x231607;};'use strict';var express=require(_0xf54e('0x0'));var router=express[_0xf54e('0x1')]();var auth=require(_0xf54e('0x2'));var controller=require('./webbar.controller');router[_0xf54e('0x3')](_0xf54e('0x4'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x7')]);router[_0xf54e('0x3')](_0xf54e('0x8'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xf54e('0x9')]);router[_0xf54e('0x3')](_0xf54e('0xa'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['answer']);router[_0xf54e('0x3')](_0xf54e('0xb'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xc')]);router[_0xf54e('0x3')](_0xf54e('0xd'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x3')](_0xf54e('0xf'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['calls']);router['post'](_0xf54e('0x10'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','answer','post','/hold','/unhold'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x70e0,0x17b));var _0x070e=function(_0x38a330,_0x2ac95e){_0x38a330=_0x38a330-0x0;var _0x2ecd14=_0x70e0[_0x38a330];return _0x2ecd14;};'use strict';var express=require(_0x070e('0x0'));var router=express[_0x070e('0x1')]();var auth=require(_0x070e('0x2'));var controller=require('./webbar.controller');router['post'](_0x070e('0x3'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x6')]);router['post'](_0x070e('0x7'),auth['isAuthenticated'](),auth[_0x070e('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x8')]);router[_0x070e('0x9')](_0x070e('0xa'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller['hold']);router['post'](_0x070e('0xb'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xc')]);router[_0x070e('0x9')](_0x070e('0xd'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xe')]);router[_0x070e('0x9')](_0x070e('0xf'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x070e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0c69109..9afd6a9 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf6e=['bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','../../mysqldb','../../config/environment','util'];(function(_0x14ace5,_0x2fc54c){var _0x1391cb=function(_0x126f12){while(--_0x126f12){_0x14ace5['push'](_0x14ace5['shift']());}};_0x1391cb(++_0x2fc54c);}(_0xbf6e,0x149));var _0xebf6=function(_0x12309b,_0x59dd8c){_0x12309b=_0x12309b-0x0;var _0x482e4d=_0xbf6e[_0x12309b];return _0x482e4d;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xebf6('0x0'))['db'];var config=require(_0xebf6('0x1'));var util=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var jayson=require(_0xebf6('0x4'));var amiClient=jayson[_0xebf6('0x5')][_0xebf6('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0xebf6('0x7'));var Redis=require(_0xebf6('0x8'));config[_0xebf6('0x9')]=_[_0xebf6('0xa')](config[_0xebf6('0x9')],{'host':_0xebf6('0xb'),'port':0x18eb});var io=require(_0xebf6('0xc'))(new Redis(config['redis']));var Schema=require(_0xebf6('0xd'));var originateValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'callNumber':{'type':'string','required':[!![],_0xebf6('0x10')]},'callerId':{'type':_0xebf6('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xebf6('0x11'),'required':[!![],_0xebf6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]}});function emit(_0x2c980f,_0xb164a1,_0x642167){logger[_0xebf6('0x13')](_0x2c980f,_0xb164a1,JSON[_0xebf6('0x14')](_0x642167));io['to'](_0x2c980f)[_0xebf6('0x15')](_0xb164a1,_0x642167);}function handleError(_0x2dc96f){return function(_0x2d3984){console[_0xebf6('0x16')]('handleError:',_0x2d3984,_0x2d3984 instanceof RangeError);logger['error'](_0x2d3984[_0xebf6('0x17')]);if(_0x2d3984 instanceof RangeError){if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x194)[_0xebf6('0x1a')](_0x2d3984);}else{if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x1f4)['send'](_0x2d3984);}};}function checkError(){return function(_0xbe39dd){if(!_0xbe39dd){throw new RangeError(_0xebf6('0x1b'));}return _0xbe39dd;};}function respondWithRpcPromise(_0x377934,_0x23d487){return new BPromise(function(_0x6303ac,_0x14c8ac){var _0x2f419e=amiClient;return _0x2f419e[_0xebf6('0x1c')](_0x377934,_0x23d487)[_0xebf6('0x1d')](function(_0x2e32c6){if(_0x2e32c6[_0xebf6('0x1e')]){if(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x1f')]===0x1f4){return _0x14c8ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}return _0x6303ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}else{_0x6303ac(_0x2e32c6[_0xebf6('0x21')]);}})[_0xebf6('0x22')](function(_0x4dadf7){_0x14c8ac(_0x4dadf7);});});}function getAgent(_0x58fb66){return db[_0xebf6('0x23')]['findOne']({'where':{'id':_0x58fb66,'role':_0xebf6('0x24')}})[_0xebf6('0x1d')](checkError());}function getAgentCheckSession(_0x5a01ea,_0x4f39eb){return new BPromise(function(_0x37950c,_0x40ae57){var _0x3c3d5c=respondWithRpcPromise(_0xebf6('0x25'));var _0xedaaeb=getAgent(_0x5a01ea);Promise[_0xebf6('0x26')]([_0x3c3d5c,_0xedaaeb])[_0xebf6('0x1d')](function(_0x7551ce){var _0x4c3495=_0x7551ce[0x0];var _0x37cd67=_0x7551ce[0x1];var _0x78cdf0=_['filter'](_0x4c3495[_0xebf6('0x27')],function(_0x28bbea){return _0x28bbea['UserId']==_0x37cd67['id']&&_0x28bbea[_0xebf6('0x28')]==_0x4f39eb;});if(_0x78cdf0[_0xebf6('0x29')]==0x1){_0x37950c(_0x37cd67);}else{_0x40ae57(new RangeError(_0xebf6('0x2a')+_0x4f39eb+_0xebf6('0x2b')));}});});}exports[_0xebf6('0x2c')]=function(_0x41da63,_0x4907d0){logger[_0xebf6('0x13')](_0xebf6('0x2d'),_0x41da63['body']);var _0x534142=originateValidation[_0xebf6('0xd')](_0x41da63[_0xebf6('0x2e')]);if(_0x534142['length']>0x0){return _0x4907d0[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x534142);}var _0x4d736c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x12bd27=_0x41da63['body'][_0xebf6('0x31')];var _0x20192c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x32')];var _0x4b6d95=_0x41da63['body'][_0xebf6('0x33')];return getAgent(_0x4d736c)[_0xebf6('0x1d')](function(_0x562f76){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x562f76['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x562f76[_0xebf6('0x18')]),_0xebf6('0x37'),{'callNumber':_0x12bd27,'callerId':_0x20192c,'callbackUrl':_0x4b6d95});return _0x4907d0[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x38')});})['catch'](handleError(_0x4907d0));};exports[_0xebf6('0x39')]=function(_0x54702d,_0xafef4d){logger[_0xebf6('0x13')](_0xebf6('0x3a'),_0x54702d[_0xebf6('0x2e')]);var _0x2f1236=hangupValidation[_0xebf6('0xd')](_0x54702d['body']);if(_0x2f1236[_0xebf6('0x29')]>0x0){return _0xafef4d[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x2f1236);}var _0x144b41=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x49f089=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x144b41)[_0xebf6('0x1d')](function(_0x111ff7){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x111ff7['name']);emit(util['format']('user:%s',_0x111ff7[_0xebf6('0x18')]),_0xebf6('0x3b'),{'sessionId':_0x49f089});return _0xafef4d[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x3c')});})[_0xebf6('0x22')](handleError(_0xafef4d));};exports[_0xebf6('0x3d')]=function(_0x5ca582,_0x8cca55){logger[_0xebf6('0x13')]('answer\x20fired:',_0x5ca582[_0xebf6('0x2e')]);var _0x1de50e=answerValidation[_0xebf6('0xd')](_0x5ca582['body']);if(_0x1de50e[_0xebf6('0x29')]>0x0){return _0x8cca55['status'](0x190)['json'](_0x1de50e);}var _0x256552=_0x5ca582[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x2ac140=_0x5ca582['body'][_0xebf6('0x28')];return getAgent(_0x256552)['then'](function(_0x4483d2){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x4483d2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')]('user:%s',_0x4483d2['name']),_0xebf6('0x3e'),{'sessionId':_0x2ac140});return _0x8cca55[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x3f')});})['catch'](handleError(_0x8cca55));};exports[_0xebf6('0x40')]=function(_0x21999e,_0x41c4ce){logger[_0xebf6('0x13')](_0xebf6('0x41'),_0x21999e[_0xebf6('0x2e')]);var _0x45e0f1=holdValidation['validate'](_0x21999e[_0xebf6('0x2e')]);if(_0x45e0f1[_0xebf6('0x29')]>0x0){return _0x41c4ce[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x45e0f1);}var _0x166664=_0x21999e[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x56b26b=_0x21999e[_0xebf6('0x2e')]['sessionId'];return getAgent(_0x166664)[_0xebf6('0x1d')](function(_0x31d8ba){logger['info'](_0xebf6('0x34'),_0x31d8ba['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x31d8ba[_0xebf6('0x18')]),_0xebf6('0x42'),{'sessionId':_0x56b26b});return _0x41c4ce[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x43')});})[_0xebf6('0x22')](handleError(_0x41c4ce));};exports['unhold']=function(_0x1f98fd,_0x2765f2){logger[_0xebf6('0x13')](_0xebf6('0x44'),_0x1f98fd[_0xebf6('0x2e')]);var _0x549892=unholdValidation[_0xebf6('0xd')](_0x1f98fd[_0xebf6('0x2e')]);if(_0x549892[_0xebf6('0x29')]>0x0){return _0x2765f2[_0xebf6('0x19')](0x190)['json'](_0x549892);}var _0x3629aa=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x303997=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x3629aa)[_0xebf6('0x1d')](function(_0x9184ce){logger[_0xebf6('0x13')]('entityFound:',_0x9184ce[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x9184ce['name']),_0xebf6('0x45'),{'sessionId':_0x303997});return _0x2765f2['status'](0xc8)['json']({'error':![],'message':_0xebf6('0x46')});})[_0xebf6('0x22')](handleError(_0x2765f2));};exports[_0xebf6('0x47')]=function(_0x32baee,_0x13c447){logger['info'](_0xebf6('0x48'),_0x13c447['body']);var _0x4ed306=callsValidation['validate'](_0x32baee[_0xebf6('0x2e')]);if(_0x4ed306[_0xebf6('0x29')]>0x0){return _0x13c447['status'](0x190)[_0xebf6('0x2f')](_0x4ed306);}var _0x151476=_0x32baee[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x3a4b20=respondWithRpcPromise(_0xebf6('0x25'));var _0x246f9f=getAgent(_0x151476);return Promise['all']([_0x3a4b20,_0x246f9f])[_0xebf6('0x1d')](function(_0xddf329){var _0x40d85f=_0xddf329[0x0];var _0x3101c2=_0xddf329[0x1];var _0x39637b=_[_0xebf6('0x49')](_0x40d85f['rows'],function(_0x44a46f){return _0x44a46f[_0xebf6('0x4a')]==_0x3101c2['id'];});return _0x13c447[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'count':_0x39637b[_0xebf6('0x29')],'rows':_0x39637b});})[_0xebf6('0x22')](handleError(_0x13c447));};exports['conference']=function(_0x33c973,_0x193e5b){logger[_0xebf6('0x13')](_0xebf6('0x4b'),_0x33c973[_0xebf6('0x2e')]);var _0x537751=conferenceValidation[_0xebf6('0xd')](_0x33c973[_0xebf6('0x2e')]);if(_0x537751[_0xebf6('0x29')]>0x0){return _0x193e5b[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x537751);}var _0x6c43e4=_0x33c973[_0xebf6('0x2e')][_0xebf6('0x30')];return getAgent(_0x6c43e4)[_0xebf6('0x1d')](function(_0x3debd2){logger[_0xebf6('0x13')]('entityFound:',_0x3debd2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x3debd2[_0xebf6('0x18')]),_0xebf6('0x4c'));return _0x193e5b[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x4d')});})['catch'](handleError(_0x193e5b));};exports[_0xebf6('0x4e')]=function(_0x34fa02,_0x10272b){logger[_0xebf6('0x13')](_0xebf6('0x4f'),_0x34fa02[_0xebf6('0x2e')]);var _0x398074=transferValidation['validate'](_0x34fa02['body']);if(_0x398074[_0xebf6('0x29')]>0x0){return _0x10272b[_0xebf6('0x19')](0x190)['json'](_0x398074);}var _0x3dc02c=_0x34fa02[_0xebf6('0x2e')]['userId'];var _0x3bee09=_0x34fa02[_0xebf6('0x2e')]['sessionId'];var _0x35a5c4=_0x34fa02[_0xebf6('0x2e')][_0xebf6('0x50')];return getAgent(_0x3dc02c)[_0xebf6('0x1d')](function(_0x345763){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x345763['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x345763[_0xebf6('0x18')]),_0xebf6('0x51'),{'sessionId':_0x3bee09,'transferNumber':_0x35a5c4});return _0x10272b[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x52')});})[_0xebf6('0x22')](handleError(_0x10272b));}; \ No newline at end of file +var _0x0f9f=['hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','error','name','status','send','NotFound','then','code','message','result','catch','User','agent','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate\x20fired:','body','length','json','userId','callNumber','callerId','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','validate','webbar:answer','answer\x20executed!'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x49c69c,_0x2e6150){_0x49c69c=_0x49c69c-0x0;var _0x55cdd2=_0x0f9f[_0x49c69c];return _0x55cdd2;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xf0f9('0x0'));var db=require(_0xf0f9('0x1'))['db'];var config=require(_0xf0f9('0x2'));var util=require('util');var BPromise=require(_0xf0f9('0x3'));var jayson=require(_0xf0f9('0x4'));var amiClient=jayson[_0xf0f9('0x5')][_0xf0f9('0x6')]({'port':0x232a});var logger=require(_0xf0f9('0x7'))(_0xf0f9('0x8'));var Redis=require(_0xf0f9('0x9'));config[_0xf0f9('0xa')]=_[_0xf0f9('0xb')](config[_0xf0f9('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xf0f9('0xc'))(new Redis(config[_0xf0f9('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'callNumber':{'type':_0xf0f9('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xf0f9('0xf')},'callbackUrl':{'type':_0xf0f9('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'sessionId':{'type':_0xf0f9('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'sessionId':{'type':_0xf0f9('0xf'),'required':[!![],_0xf0f9('0x10')]},'transferNumber':{'type':'string','required':[!![],_0xf0f9('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]},'sessionId':{'type':_0xf0f9('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf0f9('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf0f9('0xd'),'required':[!![],_0xf0f9('0xe')]}});function emit(_0x2f5bec,_0x2f75da,_0x16a928){logger[_0xf0f9('0x12')](_0x2f5bec,_0x2f75da,JSON[_0xf0f9('0x13')](_0x16a928));io['to'](_0x2f5bec)['emit'](_0x2f75da,_0x16a928);}function handleError(_0x526fff){return function(_0x350a48){console[_0xf0f9('0x14')]('handleError:',_0x350a48,_0x350a48 instanceof RangeError);logger[_0xf0f9('0x15')](_0x350a48['stack']);if(_0x350a48 instanceof RangeError){if(_0x350a48['name']){delete _0x350a48[_0xf0f9('0x16')];}_0x526fff[_0xf0f9('0x17')](0x194)[_0xf0f9('0x18')](_0x350a48);}else{if(_0x350a48[_0xf0f9('0x16')]){delete _0x350a48[_0xf0f9('0x16')];}_0x526fff['status'](0x1f4)['send'](_0x350a48);}};}function checkError(){return function(_0x5294ac){if(!_0x5294ac){throw new RangeError(_0xf0f9('0x19'));}return _0x5294ac;};}function respondWithRpcPromise(_0x1c8c39,_0x126ba7){return new BPromise(function(_0x5d87a9,_0x4a8726){var _0x209cd4=amiClient;return _0x209cd4['request'](_0x1c8c39,_0x126ba7)[_0xf0f9('0x1a')](function(_0x414f87){if(_0x414f87[_0xf0f9('0x15')]){if(_0x414f87['error'][_0xf0f9('0x1b')]===0x1f4){return _0x4a8726(_0x414f87[_0xf0f9('0x15')][_0xf0f9('0x1c')]);}return _0x5d87a9(_0x414f87['error'][_0xf0f9('0x1c')]);}else{_0x5d87a9(_0x414f87[_0xf0f9('0x1d')]);}})[_0xf0f9('0x1e')](function(_0x185e1e){_0x4a8726(_0x185e1e);});});}function getAgent(_0x16f639){return db[_0xf0f9('0x1f')]['findOne']({'where':{'id':_0x16f639,'role':_0xf0f9('0x20')}})['then'](checkError());}function getAgentCheckSession(_0x1288e0,_0x30e85c){return new BPromise(function(_0x519a46,_0x4b75b2){var _0x119793=respondWithRpcPromise('VoiceChannels');var _0x2121b8=getAgent(_0x1288e0);Promise[_0xf0f9('0x21')]([_0x119793,_0x2121b8])[_0xf0f9('0x1a')](function(_0x353502){var _0x3ec658=_0x353502[0x0];var _0x39cd34=_0x353502[0x1];var _0x1377ed=_[_0xf0f9('0x22')](_0x3ec658[_0xf0f9('0x23')],function(_0x4e4e08){return _0x4e4e08[_0xf0f9('0x24')]==_0x39cd34['id']&&_0x4e4e08[_0xf0f9('0x25')]==_0x30e85c;});if(_0x1377ed['length']==0x1){_0x519a46(_0x39cd34);}else{_0x4b75b2(new RangeError('sessionId\x20'+_0x30e85c+_0xf0f9('0x26')));}});});}exports['originate']=function(_0x483a8c,_0x14f3cb){logger['info'](_0xf0f9('0x27'),_0x483a8c[_0xf0f9('0x28')]);var _0x5305e0=originateValidation['validate'](_0x483a8c[_0xf0f9('0x28')]);if(_0x5305e0[_0xf0f9('0x29')]>0x0){return _0x14f3cb[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x5305e0);}var _0x278192=_0x483a8c[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x30bc8e=_0x483a8c[_0xf0f9('0x28')][_0xf0f9('0x2c')];var _0x2a7648=_0x483a8c[_0xf0f9('0x28')][_0xf0f9('0x2d')];var _0x5a8b35=_0x483a8c[_0xf0f9('0x28')]['callbackUrl'];return getAgent(_0x278192)[_0xf0f9('0x1a')](function(_0x44c9ed){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0x44c9ed[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x44c9ed['name']),'webbar:originate',{'callNumber':_0x30bc8e,'callerId':_0x2a7648,'callbackUrl':_0x5a8b35});return _0x14f3cb[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x31')});})[_0xf0f9('0x1e')](handleError(_0x14f3cb));};exports[_0xf0f9('0x32')]=function(_0x4ac1d2,_0x2b9d56){logger[_0xf0f9('0x12')](_0xf0f9('0x33'),_0x4ac1d2[_0xf0f9('0x28')]);var _0x32a248=hangupValidation['validate'](_0x4ac1d2[_0xf0f9('0x28')]);if(_0x32a248[_0xf0f9('0x29')]>0x0){return _0x2b9d56[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x32a248);}var _0x7cf75a=_0x4ac1d2[_0xf0f9('0x28')]['userId'];var _0x3a0f27=_0x4ac1d2[_0xf0f9('0x28')][_0xf0f9('0x25')];return getAgent(_0x7cf75a)['then'](function(_0x3b52e3){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0x3b52e3[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x3b52e3[_0xf0f9('0x16')]),_0xf0f9('0x34'),{'sessionId':_0x3a0f27});return _0x2b9d56[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x35')});})[_0xf0f9('0x1e')](handleError(_0x2b9d56));};exports[_0xf0f9('0x36')]=function(_0x5153b5,_0x4ff1f0){logger[_0xf0f9('0x12')]('answer\x20fired:',_0x5153b5['body']);var _0x4e8234=answerValidation[_0xf0f9('0x37')](_0x5153b5[_0xf0f9('0x28')]);if(_0x4e8234[_0xf0f9('0x29')]>0x0){return _0x4ff1f0[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x4e8234);}var _0xfef8ad=_0x5153b5[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x1a3a6b=_0x5153b5['body'][_0xf0f9('0x25')];return getAgent(_0xfef8ad)[_0xf0f9('0x1a')](function(_0x434fc1){logger['info'](_0xf0f9('0x2e'),_0x434fc1[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')]('user:%s',_0x434fc1[_0xf0f9('0x16')]),_0xf0f9('0x38'),{'sessionId':_0x1a3a6b});return _0x4ff1f0['status'](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x39')});})[_0xf0f9('0x1e')](handleError(_0x4ff1f0));};exports[_0xf0f9('0x3a')]=function(_0x4be16e,_0x35bcf8){logger[_0xf0f9('0x12')](_0xf0f9('0x3b'),_0x4be16e[_0xf0f9('0x28')]);var _0x226bda=holdValidation[_0xf0f9('0x37')](_0x4be16e['body']);if(_0x226bda[_0xf0f9('0x29')]>0x0){return _0x35bcf8['status'](0x190)[_0xf0f9('0x2a')](_0x226bda);}var _0x38956b=_0x4be16e[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x44b00d=_0x4be16e[_0xf0f9('0x28')][_0xf0f9('0x25')];return getAgent(_0x38956b)[_0xf0f9('0x1a')](function(_0x1f47fa){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0x1f47fa[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x1f47fa[_0xf0f9('0x16')]),_0xf0f9('0x3c'),{'sessionId':_0x44b00d});return _0x35bcf8[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x3d')});})[_0xf0f9('0x1e')](handleError(_0x35bcf8));};exports[_0xf0f9('0x3e')]=function(_0x40711c,_0x3db0b2){logger[_0xf0f9('0x12')]('unhold\x20fired:',_0x40711c['body']);var _0x2eb8b4=unholdValidation['validate'](_0x40711c[_0xf0f9('0x28')]);if(_0x2eb8b4[_0xf0f9('0x29')]>0x0){return _0x3db0b2[_0xf0f9('0x17')](0x190)['json'](_0x2eb8b4);}var _0x2b2604=_0x40711c['body'][_0xf0f9('0x2b')];var _0x603804=_0x40711c[_0xf0f9('0x28')][_0xf0f9('0x25')];return getAgent(_0x2b2604)[_0xf0f9('0x1a')](function(_0x593b54){logger[_0xf0f9('0x12')]('entityFound:',_0x593b54[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0x593b54[_0xf0f9('0x16')]),_0xf0f9('0x3f'),{'sessionId':_0x603804});return _0x3db0b2['status'](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x40')});})[_0xf0f9('0x1e')](handleError(_0x3db0b2));};exports[_0xf0f9('0x41')]=function(_0x1dbc9d,_0x2a8aae){logger[_0xf0f9('0x12')](_0xf0f9('0x42'),_0x2a8aae[_0xf0f9('0x28')]);var _0x406b45=callsValidation[_0xf0f9('0x37')](_0x1dbc9d[_0xf0f9('0x28')]);if(_0x406b45[_0xf0f9('0x29')]>0x0){return _0x2a8aae[_0xf0f9('0x17')](0x190)['json'](_0x406b45);}var _0x329b59=_0x1dbc9d[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x59d7bd=respondWithRpcPromise(_0xf0f9('0x43'));var _0x32f641=getAgent(_0x329b59);return Promise[_0xf0f9('0x21')]([_0x59d7bd,_0x32f641])[_0xf0f9('0x1a')](function(_0x6979f){var _0x586022=_0x6979f[0x0];var _0x3b1d45=_0x6979f[0x1];var _0x838550=_[_0xf0f9('0x22')](_0x586022[_0xf0f9('0x23')],function(_0x2807f9){return _0x2807f9[_0xf0f9('0x24')]==_0x3b1d45['id'];});return _0x2a8aae[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'count':_0x838550[_0xf0f9('0x29')],'rows':_0x838550});})[_0xf0f9('0x1e')](handleError(_0x2a8aae));};exports['conference']=function(_0x3777ae,_0x3fa078){logger['info'](_0xf0f9('0x44'),_0x3777ae['body']);var _0x3ac206=conferenceValidation[_0xf0f9('0x37')](_0x3777ae[_0xf0f9('0x28')]);if(_0x3ac206['length']>0x0){return _0x3fa078[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x3ac206);}var _0x28879c=_0x3777ae[_0xf0f9('0x28')][_0xf0f9('0x2b')];return getAgent(_0x28879c)[_0xf0f9('0x1a')](function(_0xdb0e6c){logger[_0xf0f9('0x12')](_0xf0f9('0x2e'),_0xdb0e6c[_0xf0f9('0x16')]);emit(util[_0xf0f9('0x2f')](_0xf0f9('0x30'),_0xdb0e6c['name']),_0xf0f9('0x45'));return _0x3fa078[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':_0xf0f9('0x46')});})['catch'](handleError(_0x3fa078));};exports[_0xf0f9('0x47')]=function(_0xb29b92,_0xb47567){logger['info'](_0xf0f9('0x48'),_0xb29b92[_0xf0f9('0x28')]);var _0x56e467=transferValidation[_0xf0f9('0x37')](_0xb29b92[_0xf0f9('0x28')]);if(_0x56e467['length']>0x0){return _0xb47567[_0xf0f9('0x17')](0x190)[_0xf0f9('0x2a')](_0x56e467);}var _0x3d1542=_0xb29b92[_0xf0f9('0x28')][_0xf0f9('0x2b')];var _0x16564d=_0xb29b92[_0xf0f9('0x28')]['sessionId'];var _0x392ffa=_0xb29b92[_0xf0f9('0x28')]['transferNumber'];return getAgent(_0x3d1542)[_0xf0f9('0x1a')](function(_0x539ac6){logger['info'](_0xf0f9('0x2e'),_0x539ac6[_0xf0f9('0x16')]);emit(util['format'](_0xf0f9('0x30'),_0x539ac6['name']),_0xf0f9('0x49'),{'sessionId':_0x16564d,'transferNumber':_0x392ffa});return _0xb47567[_0xf0f9('0x17')](0xc8)[_0xf0f9('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0xf0f9('0x1e')](handleError(_0xb47567));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4e1f8ad..8cec78c 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x1b87a5,_0x5875ef){var _0x212666=function(_0x49f640){while(--_0x49f640){_0x1b87a5['push'](_0x1b87a5['shift']());}};_0x212666(++_0x5875ef);}(_0x524e,0x15e));var _0xe524=function(_0x1127e8,_0x2dee96){_0x1127e8=_0x1127e8-0x0;var _0x148dcf=_0x524e[_0x1127e8];return _0x148dcf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router; \ No newline at end of file +var _0x1a37=['get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addAgents','addApplications','notify','/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x1a37[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require('./whatsappAccount.controller');router[_0x71a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xb')]);router[_0x71a3('0xa')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x71a3('0xe')]);router[_0x71a3('0xa')](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x10')]);router[_0x71a3('0xa')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['getAnswers']);router['get']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router[_0x71a3('0xa')](_0x71a3('0x13'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x14')]);router[_0x71a3('0x15')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x16')]);router[_0x71a3('0x15')](_0x71a3('0xf'),auth['isAuthenticated'](),controller[_0x71a3('0x17')]);router[_0x71a3('0x15')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x71a3('0x18')]);router[_0x71a3('0x15')](_0x71a3('0x19'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1a')]);router[_0x71a3('0x15')]('/:id/applications',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1b')]);router['post']('/:id/notify',controller[_0x71a3('0x1c')]);router[_0x71a3('0x15')](_0x71a3('0x1d'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1e')]);router['put'](_0x71a3('0x1f'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x20')]);router[_0x71a3('0x21')](_0x71a3('0x1f'),auth['isAuthenticated'](),controller[_0x71a3('0x22')]);router['delete'](_0x71a3('0xf'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x23')]);router[_0x71a3('0x21')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller['removeAnswers']);router[_0x71a3('0x21')](_0x71a3('0x19'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x24')]);module[_0x71a3('0x25')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index def0d0d..0ab4f4d 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa082=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xa082,0x130));var _0x2a08=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xa082[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require(_0x2a08('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x2a08('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2a08('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2a08('0x2')]();}},'phone':{'type':Sequelize[_0x2a08('0x1')]},'type':{'type':Sequelize[_0x2a08('0x3')](_0x2a08('0x4'),_0x2a08('0x5'))},'accountSid':{'type':Sequelize[_0x2a08('0x1')]},'baseUrl':{'type':Sequelize[_0x2a08('0x1')]},'authToken':{'type':Sequelize[_0x2a08('0x1')]},'notificationTemplate':{'type':Sequelize[_0x2a08('0x6')],'defaultValue':function(){return _0x2a08('0x7');}},'notificationSound':{'type':Sequelize[_0x2a08('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2a08('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2a08('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2a08('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2a08('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2a08('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2a08('0x9')],'comment':_0x2a08('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x2a08('0x8')],'defaultValue':![],'comment':_0x2a08('0xb'),'set':function(_0x353e4c){if(!_0x353e4c){this[_0x2a08('0xc')](_0x2a08('0xd'),null);}this[_0x2a08('0xc')](_0x2a08('0xe'),_0x353e4c);}},'description':{'type':Sequelize[_0x2a08('0x1')]}}; \ No newline at end of file +var _0xccf3=['sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','twilio'];(function(_0x1ca4cc,_0x402c23){var _0x108010=function(_0x4c5082){while(--_0x4c5082){_0x1ca4cc['push'](_0x1ca4cc['shift']());}};_0x108010(++_0x402c23);}(_0xccf3,0x132));var _0x3ccf=function(_0x580347,_0x844ba6){_0x580347=_0x580347-0x0;var _0x2492b8=_0xccf3[_0x580347];return _0x2492b8;};'use strict';var Sequelize=require(_0x3ccf('0x0'));var rs=require('randomstring');module[_0x3ccf('0x1')]={'name':{'type':Sequelize[_0x3ccf('0x2')],'unique':_0x3ccf('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3ccf('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x3ccf('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3ccf('0x4')]();}},'phone':{'type':Sequelize[_0x3ccf('0x2')]},'type':{'type':Sequelize['ENUM'](_0x3ccf('0x5'),_0x3ccf('0x6'))},'accountSid':{'type':Sequelize[_0x3ccf('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3ccf('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x3ccf('0x7');}},'notificationSound':{'type':Sequelize[_0x3ccf('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3ccf('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3ccf('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3ccf('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ccf('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3ccf('0x9')],'comment':_0x3ccf('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x3ccf('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3aa0cf){if(!_0x3aa0cf){this['setDataValue'](_0x3ccf('0xb'),null);}this['setDataValue'](_0x3ccf('0xc'),_0x3aa0cf);}},'description':{'type':Sequelize[_0x3ccf('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index bf7c5b9..ddf83d8 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a2e=['message','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','fields','length','merge','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','addDisposition','Disposition','findOne','keys','include','removeDispositions','addAnswer','WhatsappAccountId','CannedAnswer','getAnswers','pick','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','whatsapp','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','whatsapp:','Body','messageId','MessageSid','notifications','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','WhatsappInteraction','interaction','autoclose','push','close','created','AttachmentId','UserId','*,*,*,*','startRouting','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s'];(function(_0x29f207,_0x3efb78){var _0x81c3da=function(_0x1fad07){while(--_0x1fad07){_0x29f207['push'](_0x29f207['shift']());}};_0x81c3da(++_0x3efb78);}(_0x7a2e,0x99));var _0xe7a2=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7a2e[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xe7a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7a2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a2('0x2'));var moment=require('moment');var BPromise=require(_0xe7a2('0x3'));var Mustache=require(_0xe7a2('0x4'));var util=require(_0xe7a2('0x5'));var path=require('path');var sox=require(_0xe7a2('0x6'));var csv=require('to-csv');var ejs=require(_0xe7a2('0x7'));var fs=require('fs');var fs_extra=require(_0xe7a2('0x8'));var _=require(_0xe7a2('0x9'));var squel=require(_0xe7a2('0xa'));var crypto=require(_0xe7a2('0xb'));var jsforce=require(_0xe7a2('0xc'));var deskjs=require(_0xe7a2('0xd'));var toCsv=require(_0xe7a2('0xe'));var querystring=require(_0xe7a2('0xf'));var Papa=require(_0xe7a2('0x10'));var Redis=require('ioredis');var authService=require(_0xe7a2('0x11'));var qs=require(_0xe7a2('0x12'));var as=require(_0xe7a2('0x13'));var hardwareService=require(_0xe7a2('0x14'));var logger=require(_0xe7a2('0x15'))('api');var utils=require(_0xe7a2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe7a2('0x17'));var db=require('../../mysqldb')['db'];config[_0xe7a2('0x18')]=_[_0xe7a2('0x19')](config[_0xe7a2('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xe7a2('0x1a'));var client=jayson[_0xe7a2('0x1b')][_0xe7a2('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0xefef27,_0xa6c20d,_0x5c9084,_0x5f3f87){return new BPromise(function(_0xff855f,_0x24b449){var _0x5a5158=_0x5f3f87||client;return _0x5a5158[_0xe7a2('0x1d')](_0xefef27,_0x5c9084)[_0xe7a2('0x1e')](function(_0x31d62f){logger[_0xe7a2('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0xa6c20d,_0xe7a2('0x20'));logger[_0xe7a2('0x21')](_0xe7a2('0x22'),_0xa6c20d,_0xe7a2('0x20'),JSON[_0xe7a2('0x23')](_0x31d62f));if(_0x31d62f[_0xe7a2('0x24')]){if(_0x31d62f[_0xe7a2('0x24')][_0xe7a2('0x25')]===0x1f4){logger[_0xe7a2('0x24')](_0xe7a2('0x26'),_0xa6c20d,_0x31d62f['error'][_0xe7a2('0x27')]);return _0x24b449(_0x31d62f[_0xe7a2('0x24')][_0xe7a2('0x27')]);}logger[_0xe7a2('0x24')](_0xe7a2('0x26'),_0xa6c20d,_0x31d62f['error'][_0xe7a2('0x27')]);return _0xff855f(_0x31d62f[_0xe7a2('0x24')]['message']);}else{logger[_0xe7a2('0x1f')](_0xe7a2('0x26'),_0xa6c20d,_0xe7a2('0x20'));_0xff855f(_0x31d62f['result']['message']);}})[_0xe7a2('0x28')](function(_0x2bd83d){logger[_0xe7a2('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0xa6c20d,_0x2bd83d);_0x24b449(_0x2bd83d);});});}function respondWithStatusCode(_0x2b887c,_0x2c87d2){_0x2c87d2=_0x2c87d2||0xcc;return function(_0x5ab0ea){if(_0x5ab0ea){return _0x2b887c[_0xe7a2('0x29')](_0x2c87d2);}return _0x2b887c['status'](_0x2c87d2)['end']();};}function respondWithResult(_0x42cacc,_0x111c15){_0x111c15=_0x111c15||0xc8;return function(_0x589353){if(_0x589353){return _0x42cacc['status'](_0x111c15)[_0xe7a2('0x2a')](_0x589353);}};}function respondWithFilteredResult(_0x1d19d8,_0x12557c){return function(_0x3e8034){if(_0x3e8034){var _0x2e4b07=typeof _0x12557c[_0xe7a2('0x2b')]===_0xe7a2('0x2c')&&typeof _0x12557c[_0xe7a2('0x2d')]===_0xe7a2('0x2c');var _0x98c3bb=_0x3e8034[_0xe7a2('0x2e')];var _0x1c3545=_0x2e4b07?0x0:_0x12557c['offset'];var _0x1e9905=_0x2e4b07?_0x3e8034[_0xe7a2('0x2e')]:_0x12557c['offset']+_0x12557c[_0xe7a2('0x2d')];var _0x174092;if(_0x1e9905>=_0x98c3bb){_0x1e9905=_0x98c3bb;_0x174092=0xc8;}else{_0x174092=0xce;}_0x1d19d8[_0xe7a2('0x2f')](_0x174092);return _0x1d19d8[_0xe7a2('0x30')](_0xe7a2('0x31'),_0x1c3545+'-'+_0x1e9905+'/'+_0x98c3bb)[_0xe7a2('0x2a')](_0x3e8034);}return null;};}function patchUpdates(_0x2f87e5){return function(_0xca46d1){try{jsonpatch[_0xe7a2('0x32')](_0xca46d1,_0x2f87e5,!![]);}catch(_0x3ad3f9){return BPromise[_0xe7a2('0x33')](_0x3ad3f9);}return _0xca46d1[_0xe7a2('0x34')]();};}function saveUpdates(_0x38c0a2,_0x4f5a16){return function(_0x17549b){if(_0x17549b){return _0x17549b[_0xe7a2('0x35')](_0x38c0a2)[_0xe7a2('0x1e')](function(_0xbb7a2a){return _0xbb7a2a;});}return null;};}function removeEntity(_0x5b9c3f,_0x46b90e){return function(_0x439401){if(_0x439401){return _0x439401[_0xe7a2('0x36')]()['then'](function(){var _0x1dabdc=_0x439401[_0xe7a2('0x37')]({'plain':!![]});var _0x582232=_0xe7a2('0x38');return db[_0xe7a2('0x39')][_0xe7a2('0x36')]({'where':{'type':_0x582232,'resourceId':_0x1dabdc['id']}})[_0xe7a2('0x1e')](function(){return _0x439401;});})[_0xe7a2('0x1e')](function(){_0x5b9c3f[_0xe7a2('0x2f')](0xcc)[_0xe7a2('0x3a')]();});}};}function handleEntityNotFound(_0x27cc29,_0x2b1c18){return function(_0x4ed385){if(!_0x4ed385){_0x27cc29['sendStatus'](0x194);}return _0x4ed385;};}function handleError(_0x51e4b7,_0x2fc78a){_0x2fc78a=_0x2fc78a||0x1f4;return function(_0x5406cf){logger[_0xe7a2('0x24')](_0x5406cf[_0xe7a2('0x3b')]);if(_0x5406cf['name']){delete _0x5406cf['name'];}_0x51e4b7[_0xe7a2('0x2f')](_0x2fc78a)[_0xe7a2('0x3c')](_0x5406cf);};}exports[_0xe7a2('0x3d')]=function(_0x1c5d2e,_0x12a27b){var _0x545d89={'include':[{'model':db[_0xe7a2('0x3e')],'as':'mandatoryDispositionPause'}]},_0x1f5ffb={},_0x1b58b3={'count':0x0,'rows':[]};var _0x5f3a16=_[_0xe7a2('0x3f')](db[_0xe7a2('0x40')][_0xe7a2('0x41')],function(_0x3b12d3){return{'name':_0x3b12d3[_0xe7a2('0x42')],'type':_0x3b12d3[_0xe7a2('0x43')][_0xe7a2('0x44')]};});_0x1f5ffb[_0xe7a2('0x45')]=_[_0xe7a2('0x3f')](_0x5f3a16,_0xe7a2('0x46'));_0x1f5ffb['query']=_['keys'](_0x1c5d2e[_0xe7a2('0x47')]);_0x1f5ffb[_0xe7a2('0x48')]=_['intersection'](_0x1f5ffb[_0xe7a2('0x45')],_0x1f5ffb['query']);_0x545d89[_0xe7a2('0x49')]=_[_0xe7a2('0x4a')](_0x1f5ffb[_0xe7a2('0x45')],qs['fields'](_0x1c5d2e[_0xe7a2('0x47')]['fields']));_0x545d89[_0xe7a2('0x49')]=_0x545d89['attributes']['length']?_0x545d89[_0xe7a2('0x49')]:_0x1f5ffb['model'];if(!_0x1c5d2e[_0xe7a2('0x47')][_0xe7a2('0x4b')](_0xe7a2('0x4c'))){_0x545d89['limit']=qs['limit'](_0x1c5d2e[_0xe7a2('0x47')]['limit']);_0x545d89['offset']=qs[_0xe7a2('0x2b')](_0x1c5d2e[_0xe7a2('0x47')]['offset']);}_0x545d89[_0xe7a2('0x4d')]=qs[_0xe7a2('0x4e')](_0x1c5d2e['query'][_0xe7a2('0x4e')]);_0x545d89[_0xe7a2('0x4f')]=qs[_0xe7a2('0x48')](_['pick'](_0x1c5d2e[_0xe7a2('0x47')],_0x1f5ffb['filters']),_0x5f3a16);if(_0x1c5d2e[_0xe7a2('0x47')][_0xe7a2('0x50')]){_0x545d89[_0xe7a2('0x4f')]=_['merge'](_0x545d89['where'],{'$or':_['map'](_0x5f3a16,function(_0x21a506){if(_0x21a506['type']!=='VIRTUAL'){var _0x3de842={};_0x3de842[_0x21a506[_0xe7a2('0x46')]]={'$like':'%'+_0x1c5d2e[_0xe7a2('0x47')][_0xe7a2('0x50')]+'%'};return _0x3de842;}})});}_0x545d89=_['merge']({},_0x545d89,_0x1c5d2e[_0xe7a2('0x51')]);var _0x408816={'where':_0x545d89[_0xe7a2('0x4f')]};return db[_0xe7a2('0x40')][_0xe7a2('0x2e')](_0x408816)[_0xe7a2('0x1e')](function(_0x35d5d7){_0x1b58b3[_0xe7a2('0x2e')]=_0x35d5d7;if(_0x1c5d2e['query'][_0xe7a2('0x52')]){_0x545d89['include']=[{'all':!![]}];}return db[_0xe7a2('0x40')][_0xe7a2('0x53')](_0x545d89);})['then'](function(_0x96553f){_0x1b58b3[_0xe7a2('0x54')]=_0x96553f;return _0x1b58b3;})['then'](respondWithFilteredResult(_0x12a27b,_0x545d89))[_0xe7a2('0x28')](handleError(_0x12a27b,null));};exports[_0xe7a2('0x55')]=function(_0x32bafa,_0x29e015){var _0x3a6235={'raw':![],'where':{'id':_0x32bafa[_0xe7a2('0x56')]['id']},'include':[{'model':db[_0xe7a2('0x3e')],'as':_0xe7a2('0x57')}]},_0x4da1f2={};_0x4da1f2[_0xe7a2('0x45')]=_['keys'](db['WhatsappAccount'][_0xe7a2('0x41')]);_0x4da1f2[_0xe7a2('0x47')]=_['keys'](_0x32bafa[_0xe7a2('0x47')]);_0x4da1f2[_0xe7a2('0x48')]=_[_0xe7a2('0x4a')](_0x4da1f2[_0xe7a2('0x45')],_0x4da1f2[_0xe7a2('0x47')]);_0x3a6235[_0xe7a2('0x49')]=_[_0xe7a2('0x4a')](_0x4da1f2[_0xe7a2('0x45')],qs[_0xe7a2('0x58')](_0x32bafa[_0xe7a2('0x47')]['fields']));_0x3a6235[_0xe7a2('0x49')]=_0x3a6235[_0xe7a2('0x49')][_0xe7a2('0x59')]?_0x3a6235[_0xe7a2('0x49')]:_0x4da1f2[_0xe7a2('0x45')];if(_0x32bafa['query'][_0xe7a2('0x52')]){_0x3a6235['include']=[{'all':!![]}];}_0x3a6235=_[_0xe7a2('0x5a')]({},_0x3a6235,_0x32bafa[_0xe7a2('0x51')]);return db[_0xe7a2('0x40')][_0xe7a2('0x5b')](_0x3a6235)[_0xe7a2('0x1e')](handleEntityNotFound(_0x29e015,null))[_0xe7a2('0x1e')](respondWithResult(_0x29e015,null))[_0xe7a2('0x28')](handleError(_0x29e015,null));};exports[_0xe7a2('0x5c')]=function(_0x219d5a,_0x103df1){return db[_0xe7a2('0x40')][_0xe7a2('0x5c')](_0x219d5a[_0xe7a2('0x5d')],{})[_0xe7a2('0x1e')](function(_0x181689){var _0xb4a1a6=_0x219d5a['user'][_0xe7a2('0x37')]({'plain':!![]});if(!_0xb4a1a6)throw new Error(_0xe7a2('0x5e'));if(_0xb4a1a6[_0xe7a2('0x5f')]===_0xe7a2('0x60')){var _0x52f000=_0x181689['get']({'plain':!![]});var _0x15cc16='WhatsappAccounts';return db[_0xe7a2('0x61')][_0xe7a2('0x5b')]({'where':{'name':_0x15cc16,'userProfileId':_0xb4a1a6[_0xe7a2('0x62')]},'raw':!![]})[_0xe7a2('0x1e')](function(_0x139a1c){if(_0x139a1c&&_0x139a1c[_0xe7a2('0x63')]===0x0){return db[_0xe7a2('0x39')][_0xe7a2('0x5c')]({'name':_0x52f000['name'],'resourceId':_0x52f000['id'],'type':_0x139a1c['name'],'sectionId':_0x139a1c['id']},{})[_0xe7a2('0x1e')](function(){return _0x181689;});}else{return _0x181689;}})['catch'](function(_0x32063b){logger['error'](_0xe7a2('0x64'),_0x32063b);throw _0x32063b;});}return _0x181689;})['then'](respondWithResult(_0x103df1,0xc9))[_0xe7a2('0x28')](handleError(_0x103df1,null));};exports[_0xe7a2('0x35')]=function(_0x481236,_0x4523e0){if(_0x481236[_0xe7a2('0x5d')]['id']){delete _0x481236[_0xe7a2('0x5d')]['id'];}return db[_0xe7a2('0x40')][_0xe7a2('0x5b')]({'where':{'id':_0x481236[_0xe7a2('0x56')]['id']},'include':[{'model':db[_0xe7a2('0x3e')],'as':_0xe7a2('0x57')}]})[_0xe7a2('0x1e')](handleEntityNotFound(_0x4523e0,null))[_0xe7a2('0x1e')](saveUpdates(_0x481236[_0xe7a2('0x5d')],null))[_0xe7a2('0x1e')](respondWithResult(_0x4523e0,null))[_0xe7a2('0x28')](handleError(_0x4523e0,null));};exports[_0xe7a2('0x36')]=function(_0x42fb1e,_0x1795e9){return db[_0xe7a2('0x40')]['find']({'where':{'id':_0x42fb1e[_0xe7a2('0x56')]['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x1795e9,null))[_0xe7a2('0x1e')](removeEntity(_0x1795e9,null))[_0xe7a2('0x28')](handleError(_0x1795e9,null));};exports[_0xe7a2('0x65')]=function(_0x21e1c2,_0x1dc2e1){return db[_0xe7a2('0x40')][_0xe7a2('0x65')]()[_0xe7a2('0x1e')](respondWithResult(_0x1dc2e1,null))[_0xe7a2('0x28')](handleError(_0x1dc2e1,null));};exports[_0xe7a2('0x66')]=function(_0x5ac69d,_0xbde3e8,_0x406e48){if(_0x5ac69d[_0xe7a2('0x5d')]['id']){delete _0x5ac69d[_0xe7a2('0x5d')]['id'];}return db[_0xe7a2('0x40')][_0xe7a2('0x5b')]({'where':{'id':_0x5ac69d[_0xe7a2('0x56')]['id']}})['then'](handleEntityNotFound(_0xbde3e8,null))[_0xe7a2('0x1e')](function(_0x161d5d){if(_0x161d5d){_0x5ac69d['body']['WhatsappAccountId']=_0x161d5d['id'];return db[_0xe7a2('0x67')][_0xe7a2('0x5c')](_0x5ac69d[_0xe7a2('0x5d')]);}})['then'](respondWithResult(_0xbde3e8,null))['catch'](handleError(_0xbde3e8,null));};exports['getDispositions']=function(_0x43284e,_0x1ea274,_0x2d87a7){var _0x182912={'raw':![],'where':{}};var _0x2cfd5f={};var _0x3f1ad4={'count':0x0,'rows':[]};return db[_0xe7a2('0x40')][_0xe7a2('0x68')]({'where':{'id':_0x43284e[_0xe7a2('0x56')]['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x1ea274,null))[_0xe7a2('0x1e')](function(_0x3973e0){if(_0x3973e0){_0x2cfd5f[_0xe7a2('0x45')]=_[_0xe7a2('0x69')](db[_0xe7a2('0x67')][_0xe7a2('0x41')]);_0x2cfd5f['query']=_[_0xe7a2('0x69')](_0x43284e[_0xe7a2('0x47')]);_0x2cfd5f[_0xe7a2('0x48')]=_[_0xe7a2('0x4a')](_0x2cfd5f[_0xe7a2('0x45')],_0x2cfd5f[_0xe7a2('0x47')]);_0x182912['attributes']=_['intersection'](_0x2cfd5f[_0xe7a2('0x45')],qs[_0xe7a2('0x58')](_0x43284e[_0xe7a2('0x47')][_0xe7a2('0x58')]));_0x182912[_0xe7a2('0x49')]=_0x182912[_0xe7a2('0x49')]['length']?_0x182912[_0xe7a2('0x49')]:_0x2cfd5f[_0xe7a2('0x45')];if(!_0x43284e[_0xe7a2('0x47')][_0xe7a2('0x4b')](_0xe7a2('0x4c'))){_0x182912['limit']=qs[_0xe7a2('0x2d')](_0x43284e[_0xe7a2('0x47')][_0xe7a2('0x2d')]);_0x182912['offset']=qs['offset'](_0x43284e['query']['offset']);}_0x182912[_0xe7a2('0x4d')]=qs[_0xe7a2('0x4e')](_0x43284e['query']['sort']);_0x182912['where']=qs[_0xe7a2('0x48')](_['pick'](_0x43284e['query'],_0x2cfd5f[_0xe7a2('0x48')]));_0x182912[_0xe7a2('0x4f')]['WhatsappAccountId']=_0x3973e0['id'];if(_0x43284e[_0xe7a2('0x47')]['filter']){_0x182912[_0xe7a2('0x4f')]=_[_0xe7a2('0x5a')](_0x182912[_0xe7a2('0x4f')],{'$or':_[_0xe7a2('0x3f')](_0x182912[_0xe7a2('0x49')],function(_0x1c5fe1){var _0x3bab56={};_0x3bab56[_0x1c5fe1]={'$like':'%'+_0x43284e[_0xe7a2('0x47')][_0xe7a2('0x50')]+'%'};return _0x3bab56;})});}_0x182912=_[_0xe7a2('0x5a')]({},_0x182912,_0x43284e[_0xe7a2('0x51')]);return db['Disposition'][_0xe7a2('0x2e')]({'where':_0x182912['where']})['then'](function(_0x1b66f5){_0x3f1ad4[_0xe7a2('0x2e')]=_0x1b66f5;if(_0x43284e[_0xe7a2('0x47')][_0xe7a2('0x52')]){_0x182912[_0xe7a2('0x6a')]=[{'all':!![]}];}return db[_0xe7a2('0x67')][_0xe7a2('0x53')](_0x182912);})['then'](function(_0x4ef1b1){_0x3f1ad4[_0xe7a2('0x54')]=_0x4ef1b1;return _0x3f1ad4;});}})['then'](respondWithFilteredResult(_0x1ea274,_0x182912))[_0xe7a2('0x28')](handleError(_0x1ea274,null));};exports[_0xe7a2('0x6b')]=function(_0xe280b3,_0x5e369f,_0x5d5e66){return db[_0xe7a2('0x40')]['find']({'where':{'id':_0xe280b3[_0xe7a2('0x56')]['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x5e369f,null))[_0xe7a2('0x1e')](function(_0x21488b){if(_0x21488b){return _0x21488b[_0xe7a2('0x6b')](_0xe280b3[_0xe7a2('0x47')]['ids']);}})[_0xe7a2('0x1e')](respondWithStatusCode(_0x5e369f,null))['catch'](handleError(_0x5e369f,null));};exports[_0xe7a2('0x6c')]=function(_0x3b9e7c,_0x30d79d,_0x553e80){if(_0x3b9e7c[_0xe7a2('0x5d')]['id']){delete _0x3b9e7c[_0xe7a2('0x5d')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3b9e7c[_0xe7a2('0x56')]['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x30d79d,null))[_0xe7a2('0x1e')](function(_0x1b84ae){if(_0x1b84ae){_0x3b9e7c[_0xe7a2('0x5d')][_0xe7a2('0x6d')]=_0x1b84ae['id'];return db[_0xe7a2('0x6e')][_0xe7a2('0x5c')](_0x3b9e7c[_0xe7a2('0x5d')]);}})[_0xe7a2('0x1e')](respondWithResult(_0x30d79d,null))[_0xe7a2('0x28')](handleError(_0x30d79d,null));};exports[_0xe7a2('0x6f')]=function(_0x4cc080,_0x49e155,_0x1fa66a){var _0x157cbb={'raw':![],'where':{}};var _0x2966cf={};var _0x59d4d9={'count':0x0,'rows':[]};return db[_0xe7a2('0x40')][_0xe7a2('0x68')]({'where':{'id':_0x4cc080['params']['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x49e155,null))[_0xe7a2('0x1e')](function(_0x546e91){if(_0x546e91){_0x2966cf[_0xe7a2('0x45')]=_[_0xe7a2('0x69')](db[_0xe7a2('0x6e')]['rawAttributes']);_0x2966cf['query']=_[_0xe7a2('0x69')](_0x4cc080[_0xe7a2('0x47')]);_0x2966cf['filters']=_['intersection'](_0x2966cf[_0xe7a2('0x45')],_0x2966cf[_0xe7a2('0x47')]);_0x157cbb['attributes']=_[_0xe7a2('0x4a')](_0x2966cf[_0xe7a2('0x45')],qs[_0xe7a2('0x58')](_0x4cc080['query']['fields']));_0x157cbb[_0xe7a2('0x49')]=_0x157cbb[_0xe7a2('0x49')][_0xe7a2('0x59')]?_0x157cbb['attributes']:_0x2966cf[_0xe7a2('0x45')];if(!_0x4cc080[_0xe7a2('0x47')][_0xe7a2('0x4b')]('nolimit')){_0x157cbb[_0xe7a2('0x2d')]=qs['limit'](_0x4cc080[_0xe7a2('0x47')]['limit']);_0x157cbb[_0xe7a2('0x2b')]=qs[_0xe7a2('0x2b')](_0x4cc080[_0xe7a2('0x47')][_0xe7a2('0x2b')]);}_0x157cbb[_0xe7a2('0x4d')]=qs[_0xe7a2('0x4e')](_0x4cc080[_0xe7a2('0x47')][_0xe7a2('0x4e')]);_0x157cbb[_0xe7a2('0x4f')]=qs[_0xe7a2('0x48')](_[_0xe7a2('0x70')](_0x4cc080[_0xe7a2('0x47')],_0x2966cf[_0xe7a2('0x48')]));_0x157cbb[_0xe7a2('0x4f')][_0xe7a2('0x6d')]=_0x546e91['id'];if(_0x4cc080[_0xe7a2('0x47')][_0xe7a2('0x50')]){_0x157cbb[_0xe7a2('0x4f')]=_['merge'](_0x157cbb['where'],{'$or':_[_0xe7a2('0x3f')](_0x157cbb[_0xe7a2('0x49')],function(_0x461c31){var _0x739c2={};_0x739c2[_0x461c31]={'$like':'%'+_0x4cc080[_0xe7a2('0x47')][_0xe7a2('0x50')]+'%'};return _0x739c2;})});}_0x157cbb=_[_0xe7a2('0x5a')]({},_0x157cbb,_0x4cc080[_0xe7a2('0x51')]);return db['CannedAnswer'][_0xe7a2('0x2e')]({'where':_0x157cbb[_0xe7a2('0x4f')]})[_0xe7a2('0x1e')](function(_0x96f31c){_0x59d4d9[_0xe7a2('0x2e')]=_0x96f31c;if(_0x4cc080[_0xe7a2('0x47')][_0xe7a2('0x52')]){_0x157cbb[_0xe7a2('0x6a')]=[{'all':!![]}];}return db[_0xe7a2('0x6e')][_0xe7a2('0x53')](_0x157cbb);})['then'](function(_0x3e63cb){_0x59d4d9[_0xe7a2('0x54')]=_0x3e63cb;return _0x59d4d9;});}})[_0xe7a2('0x1e')](respondWithFilteredResult(_0x49e155,_0x157cbb))[_0xe7a2('0x28')](handleError(_0x49e155,null));};exports['removeAnswers']=function(_0x98fce6,_0x51da6,_0x4da6c1){return db[_0xe7a2('0x40')][_0xe7a2('0x5b')]({'where':{'id':_0x98fce6[_0xe7a2('0x56')]['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x51da6,null))[_0xe7a2('0x1e')](function(_0x40ee52){if(_0x40ee52){return _0x40ee52[_0xe7a2('0x71')](_0x98fce6[_0xe7a2('0x47')][_0xe7a2('0x72')]);}})[_0xe7a2('0x1e')](respondWithStatusCode(_0x51da6,null))[_0xe7a2('0x28')](handleError(_0x51da6,null));};exports[_0xe7a2('0x73')]=function(_0x7c176b,_0x1736fd,_0x344698){return db[_0xe7a2('0x40')]['find']({'where':{'id':_0x7c176b[_0xe7a2('0x56')]['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x1736fd,null))['then'](function(_0x140368){if(_0x140368){return _0x140368[_0xe7a2('0x73')](_0x7c176b[_0xe7a2('0x5d')][_0xe7a2('0x72')],_[_0xe7a2('0x74')](_0x7c176b[_0xe7a2('0x5d')],[_0xe7a2('0x72'),'id'])||{})[_0xe7a2('0x75')](function(_0x1ca240){for(var _0x253830=0x0;_0x253830<_0x7c176b[_0xe7a2('0x5d')]['ids'][_0xe7a2('0x59')];_0x253830+=0x1){socket[_0xe7a2('0x76')](_0xe7a2('0x77'),{'UserId':Number(_0x7c176b[_0xe7a2('0x5d')][_0xe7a2('0x72')][_0x253830]),'WhatsappAccountId':Number(_0x7c176b['params']['id'])});}return _0x1ca240;});}})['then'](respondWithResult(_0x1736fd,null))[_0xe7a2('0x28')](handleError(_0x1736fd,null));};exports['removeAgents']=function(_0x383c59,_0x1ea6c4,_0x15f626){return db[_0xe7a2('0x40')]['find']({'where':{'id':_0x383c59[_0xe7a2('0x56')]['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x1ea6c4,null))[_0xe7a2('0x1e')](function(_0x422090){if(_0x422090){return _0x422090['removeAgents'](_0x383c59['query'][_0xe7a2('0x72')])['then'](function(){if(_['isArray'](_0x383c59[_0xe7a2('0x47')][_0xe7a2('0x72')])){for(var _0x3f2f6e=0x0;_0x3f2f6e<_0x383c59[_0xe7a2('0x47')][_0xe7a2('0x72')][_0xe7a2('0x59')];_0x3f2f6e+=0x1){socket[_0xe7a2('0x76')](_0xe7a2('0x78'),{'UserId':Number(_0x383c59[_0xe7a2('0x47')][_0xe7a2('0x72')][_0x3f2f6e]),'WhatsappAccountId':Number(_0x383c59[_0xe7a2('0x56')]['id'])});}}else{socket[_0xe7a2('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x383c59[_0xe7a2('0x47')]['ids']),'WhatsappAccountId':Number(_0x383c59[_0xe7a2('0x56')]['id'])});}});}})[_0xe7a2('0x1e')](respondWithStatusCode(_0x1ea6c4,null))[_0xe7a2('0x28')](handleError(_0x1ea6c4,null));};exports[_0xe7a2('0x79')]=function(_0x3d3395,_0x5e7377,_0x1fb4d5){var _0xcda301={};var _0x1f68e9={};var _0x4349b5;var _0xb606b2;return db[_0xe7a2('0x40')][_0xe7a2('0x68')]({'where':{'id':_0x3d3395[_0xe7a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x5e7377,null))[_0xe7a2('0x1e')](function(_0x27ac82){if(_0x27ac82){_0x4349b5=_0x27ac82;_0x1f68e9[_0xe7a2('0x45')]=_['keys'](db[_0xe7a2('0x7a')][_0xe7a2('0x41')]);_0x1f68e9[_0xe7a2('0x47')]=_[_0xe7a2('0x69')](_0x3d3395[_0xe7a2('0x47')]);_0x1f68e9[_0xe7a2('0x48')]=_['intersection'](_0x1f68e9[_0xe7a2('0x45')],_0x1f68e9['query']);_0xcda301[_0xe7a2('0x49')]=_[_0xe7a2('0x4a')](_0x1f68e9['model'],qs[_0xe7a2('0x58')](_0x3d3395['query']['fields']));_0xcda301[_0xe7a2('0x49')]=_0xcda301['attributes']['length']?_0xcda301[_0xe7a2('0x49')]:_0x1f68e9['model'];_0xcda301[_0xe7a2('0x4d')]=qs[_0xe7a2('0x4e')](_0x3d3395[_0xe7a2('0x47')][_0xe7a2('0x4e')]);_0xcda301[_0xe7a2('0x4f')]=qs[_0xe7a2('0x48')](_[_0xe7a2('0x70')](_0x3d3395[_0xe7a2('0x47')],_0x1f68e9[_0xe7a2('0x48')]));if(_0x3d3395[_0xe7a2('0x47')][_0xe7a2('0x50')]){_0xcda301[_0xe7a2('0x4f')]=_[_0xe7a2('0x5a')](_0xcda301[_0xe7a2('0x4f')],{'$or':_[_0xe7a2('0x3f')](_0xcda301[_0xe7a2('0x49')],function(_0x350bb6){var _0x275f0d={};_0x275f0d[_0x350bb6]={'$like':'%'+_0x3d3395['query'][_0xe7a2('0x50')]+'%'};return _0x275f0d;})});}_0xcda301=_['merge']({},_0xcda301,_0x3d3395[_0xe7a2('0x51')]);return _0x4349b5[_0xe7a2('0x79')](_0xcda301);}})[_0xe7a2('0x1e')](function(_0x3c22bc){if(_0x3c22bc){_0xb606b2=_0x3c22bc[_0xe7a2('0x59')];if(!_0x3d3395['query'][_0xe7a2('0x4b')](_0xe7a2('0x4c'))){_0xcda301[_0xe7a2('0x2d')]=qs[_0xe7a2('0x2d')](_0x3d3395['query']['limit']);_0xcda301[_0xe7a2('0x2b')]=qs['offset'](_0x3d3395[_0xe7a2('0x47')][_0xe7a2('0x2b')]);}return _0x4349b5['getAgents'](_0xcda301);}})[_0xe7a2('0x1e')](function(_0x4ac13b){if(_0x4ac13b){return _0x4ac13b?{'count':_0xb606b2,'rows':_0x4ac13b}:null;}})[_0xe7a2('0x1e')](respondWithResult(_0x5e7377,null))['catch'](handleError(_0x5e7377,null));};exports[_0xe7a2('0x7b')]=function(_0xdd56af,_0x27510){var _0x22abd3=_0xdd56af['params']['id'];var _0x321cca=_0xdd56af[_0xe7a2('0x5d')];var _0x171ebb=0xc8;var _0x583ebf=null;return db[_0xe7a2('0x7c')]['transaction']({'isolationLevel':db[_0xe7a2('0x7c')][_0xe7a2('0x7d')]['ISOLATION_LEVELS'][_0xe7a2('0x7e')]},function(_0xbc1b58){return db[_0xe7a2('0x40')][_0xe7a2('0x68')]({'where':{'id':_0x22abd3},'transaction':_0xbc1b58})[_0xe7a2('0x1e')](function(_0x49e688){if(_0x49e688){return db[_0xe7a2('0x7f')][_0xe7a2('0x36')]({'where':{'WhatsappAccountId':_0x22abd3},'transaction':_0xbc1b58})[_0xe7a2('0x1e')](function(){var _0x39e786=_[_0xe7a2('0x3f')](_0x321cca,function(_0x26cc10){_0x26cc10['WhatsappAccountId']=_0x22abd3;return _0x26cc10;});return db[_0xe7a2('0x7f')][_0xe7a2('0x80')](_0x39e786,{'transaction':_0xbc1b58});});}else{_0x171ebb=0x194;_0x583ebf=[];}});})[_0xe7a2('0x1e')](function(){if(_0x171ebb!==0x194){return db[_0xe7a2('0x7f')][_0xe7a2('0x81')]({'where':{'WhatsappAccountId':_0x22abd3},'order':'priority'})[_0xe7a2('0x1e')](function(_0x18bf13){_0x583ebf=_0x18bf13;});}})[_0xe7a2('0x28')](function(_0x1381d1){_0x171ebb=0x1f4;logger[_0xe7a2('0x24')](_0x1381d1[_0xe7a2('0x3b')]);if(_0x1381d1[_0xe7a2('0x46')]){delete _0x1381d1[_0xe7a2('0x46')];}_0x583ebf=_0x1381d1;})[_0xe7a2('0x82')](function(){if(_0x583ebf===null){_0x27510[_0xe7a2('0x29')](_0x171ebb);}else{if(_0x171ebb===0x1f4){_0x27510['status'](_0x171ebb)[_0xe7a2('0x3c')](_0x583ebf);}else{_0x27510[_0xe7a2('0x2f')](_0x171ebb)[_0xe7a2('0x2a')](_0x583ebf);}}});};exports[_0xe7a2('0x83')]=function(_0x1e651a,_0x1cf174,_0x4be64c){var _0x29ca8b={};var _0x507fed={};var _0x47f054;var _0x2a3c90;return db[_0xe7a2('0x40')][_0xe7a2('0x68')]({'where':{'id':_0x1e651a['params']['id']}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x1cf174,null))['then'](function(_0x5ac0db){if(_0x5ac0db){_0x47f054=_0x5ac0db;_0x507fed[_0xe7a2('0x45')]=_['keys'](db[_0xe7a2('0x7f')][_0xe7a2('0x41')]);_0x507fed[_0xe7a2('0x47')]=_[_0xe7a2('0x69')](_0x1e651a[_0xe7a2('0x47')]);_0x507fed[_0xe7a2('0x48')]=_[_0xe7a2('0x4a')](_0x507fed[_0xe7a2('0x45')],_0x507fed[_0xe7a2('0x47')]);_0x29ca8b[_0xe7a2('0x49')]=_[_0xe7a2('0x4a')](_0x507fed[_0xe7a2('0x45')],qs['fields'](_0x1e651a[_0xe7a2('0x47')][_0xe7a2('0x58')]));_0x29ca8b['attributes']=_0x29ca8b[_0xe7a2('0x49')][_0xe7a2('0x59')]?_0x29ca8b[_0xe7a2('0x49')]:_0x507fed[_0xe7a2('0x45')];_0x29ca8b[_0xe7a2('0x4d')]=qs[_0xe7a2('0x4e')](_0x1e651a[_0xe7a2('0x47')][_0xe7a2('0x4e')]);_0x29ca8b[_0xe7a2('0x4f')]=qs['filters'](_['pick'](_0x1e651a[_0xe7a2('0x47')],_0x507fed[_0xe7a2('0x48')]));if(_0x1e651a['query'][_0xe7a2('0x50')]){_0x29ca8b[_0xe7a2('0x4f')]=_[_0xe7a2('0x5a')](_0x29ca8b[_0xe7a2('0x4f')],{'$or':_[_0xe7a2('0x3f')](_0x29ca8b[_0xe7a2('0x49')],function(_0x3d4b5c){var _0x20fd2f={};_0x20fd2f[_0x3d4b5c]={'$like':'%'+_0x1e651a[_0xe7a2('0x47')]['filter']+'%'};return _0x20fd2f;})});}_0x29ca8b=_['merge']({},_0x29ca8b,_0x1e651a[_0xe7a2('0x51')]);return _0x47f054[_0xe7a2('0x83')](_0x29ca8b);}})[_0xe7a2('0x1e')](function(_0x2e61fe){if(_0x2e61fe){_0x2a3c90=_0x2e61fe[_0xe7a2('0x59')];if(!_0x1e651a['query'][_0xe7a2('0x4b')](_0xe7a2('0x4c'))){_0x29ca8b[_0xe7a2('0x2d')]=qs[_0xe7a2('0x2d')](_0x1e651a[_0xe7a2('0x47')]['limit']);_0x29ca8b['offset']=qs['offset'](_0x1e651a['query'][_0xe7a2('0x2b')]);}return _0x47f054[_0xe7a2('0x83')](_0x29ca8b);}})['then'](function(_0x242e4f){if(_0x242e4f){return _0x242e4f?{'count':_0x2a3c90,'rows':_0x242e4f}:null;}})[_0xe7a2('0x1e')](respondWithResult(_0x1cf174,null))[_0xe7a2('0x28')](handleError(_0x1cf174,null));};exports[_0xe7a2('0x84')]=function(_0x23e3cc,_0x192eee,_0x14ba89){var _0x5ed0d3={'channel':_0xe7a2('0x85')};var _0x45555a=[];var _0x35ab37=[];var _0x5bf860={};return db[_0xe7a2('0x40')][_0xe7a2('0x5b')]({'where':{'id':_0x23e3cc[_0xe7a2('0x56')]['id']},'include':[{'model':db[_0xe7a2('0x7f')],'as':'Applications'}]})[_0xe7a2('0x1e')](handleEntityNotFound(_0x192eee,null))[_0xe7a2('0x1e')](function(_0xe17454){_0x5ed0d3[_0xe7a2('0x86')]=_0xe17454;if(_0x5ed0d3['account']&&_0x5ed0d3[_0xe7a2('0x86')][_0xe7a2('0x43')]==='sinch'&&_0x23e3cc[_0xe7a2('0x5d')][_0xe7a2('0x87')]){if(_0x23e3cc['body'][_0xe7a2('0x87')][_0xe7a2('0x59')]===0x0)return;if(_0x23e3cc[_0xe7a2('0x5d')][_0xe7a2('0x87')][0x0][_0xe7a2('0x88')]!==_0xe7a2('0x89'))return;return db[_0xe7a2('0x8a')]['update']({'read':!![],'readAt':_0x23e3cc['body']['statuses'][0x0][_0xe7a2('0x8b')]},{'where':{'messageId':_0x23e3cc[_0xe7a2('0x5d')][_0xe7a2('0x87')][0x0][_0xe7a2('0x8c')]},'individualHooks':!![]})[_0xe7a2('0x1e')](function(_0x1cbfff){return _0x192eee[_0xe7a2('0x2f')](0xc8)['json'](_0x1cbfff);});}_0x5ed0d3[_0xe7a2('0x8d')]=_['orderBy'](_0xe17454[_0xe7a2('0x8e')],[_0xe7a2('0x8f')],[_0xe7a2('0x90')]);if(_0x5ed0d3[_0xe7a2('0x86')][_0xe7a2('0x8e')]){delete _0x5ed0d3[_0xe7a2('0x86')][_0xe7a2('0x8e')];}return db[_0xe7a2('0x91')]['describe']()['then'](function(_0xbf69bb){if(!_0xbf69bb){throw new db[(_0xe7a2('0x92'))][(_0xe7a2('0x93'))](_0xe7a2('0x94'));}_0x45555a=_[_0xe7a2('0x95')](_['keys'](_0xbf69bb),[_0xe7a2('0x96'),'updatedAt']);_0x35ab37=_[_0xe7a2('0x95')](_[_0xe7a2('0x69')](_0xbf69bb),[_0xe7a2('0x96'),_0xe7a2('0x97'),_0xe7a2('0x98'),_0xe7a2('0x99')]);_0x5ed0d3[_0xe7a2('0x5d')]={'mapKey':_0xe7a2('0x9a')};if(_0x5ed0d3[_0xe7a2('0x86')]&&_0x5ed0d3['account'][_0xe7a2('0x43')]===_0xe7a2('0x9b')){_0x5ed0d3[_0xe7a2('0x5d')]['from']=_0x23e3cc[_0xe7a2('0x5d')]['From']['replace'](_0xe7a2('0x9c'),'');_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0x5d')]=_0x23e3cc['body'][_0xe7a2('0x9d')];_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0x9e')]=_0x23e3cc[_0xe7a2('0x5d')][_0xe7a2('0x9f')];}if(_0x5ed0d3[_0xe7a2('0x86')]&&_0x5ed0d3[_0xe7a2('0x86')][_0xe7a2('0x43')]==='sinch'){_0x5ed0d3['body']['from']=_0x23e3cc[_0xe7a2('0x5d')][_0xe7a2('0xa0')][0x0][_0xe7a2('0xa1')];_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0x5d')]=_0x23e3cc[_0xe7a2('0x5d')][_0xe7a2('0xa0')][0x0]['message']['body'];_0x5ed0d3[_0xe7a2('0x5d')]['messageId']=_0x23e3cc[_0xe7a2('0x5d')][_0xe7a2('0xa0')][0x0]['message_id'];}if(_0x5ed0d3['body']['id']){delete _0x5ed0d3[_0xe7a2('0x5d')]['id'];}if(_['isNil'](_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa1')])){throw new db[(_0xe7a2('0x92'))]['ValidationError'](_0xe7a2('0xa2'));}if(_[_0xe7a2('0xa3')](_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0x5d')])||_0x5ed0d3[_0xe7a2('0x5d')]['body']===''){throw new db['Sequelize'][(_0xe7a2('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe7a2('0xa3')](_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa4')])){throw new db['Sequelize'][(_0xe7a2('0x93'))](_0xe7a2('0xa5')+_0x35ab37);}if(!_['includes'](_0x35ab37,_0x5ed0d3[_0xe7a2('0x5d')]['mapKey'])){throw new db[(_0xe7a2('0x92'))][(_0xe7a2('0x93'))](_0xe7a2('0xa6')+_0x35ab37);}_0x5bf860[_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa4')]]=_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa1')];return db[_0xe7a2('0xa7')][_0xe7a2('0x5b')]({'where':{'id':_0x5ed0d3[_0xe7a2('0x86')][_0xe7a2('0x99')]},'include':[{'model':db[_0xe7a2('0x91')],'as':_0xe7a2('0xa8'),'where':_0x5bf860,'limit':0x1,'order':[[_0xe7a2('0x97'),_0xe7a2('0xa9')]]}]});})[_0xe7a2('0x1e')](handleEntityNotFound(_0x192eee,null))['then'](function(_0x331e9b){if(_0x331e9b){_0x5ed0d3['list']=_[_0xe7a2('0x74')](_0x331e9b,[_0xe7a2('0xa8')]);if(_0x331e9b['Contacts'][_0xe7a2('0x59')]){return _0x331e9b[_0xe7a2('0xa8')][0x0];}var _0x1dfc93=_[_0xe7a2('0x19')](_0x5ed0d3['body'],{'firstName':_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa1')],'ListId':_0x331e9b['id']});_0x1dfc93[_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa4')]]=_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa1')];return db['CmContact'][_0xe7a2('0x5c')](_0x1dfc93,{'fields':_0x45555a,'raw':!![]});}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x192eee,null))['then'](function(_0x4e2356){if(_0x4e2356){_0x5ed0d3[_0xe7a2('0xaa')]=_0x4e2356;var _0x14ff53={'ContactId':_0x4e2356['id'],'phone':_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xa1')],'WhatsappAccountId':_0x23e3cc[_0xe7a2('0x56')]['id']};var _0x4f9bbd={'ContactId':_0x4e2356['id'],'WhatsappAccountId':_0x23e3cc[_0xe7a2('0x56')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x4f9bbd})[_0xe7a2('0x1e')](function(_0x1de07d){if(_0x1de07d){return[_0x1de07d,![]];}return db[_0xe7a2('0xab')][_0xe7a2('0x5c')](_0x14ff53)[_0xe7a2('0x1e')](function(_0x21c0ea){return[_0x21c0ea,!![]];});});}})[_0xe7a2('0x75')](function(_0x310018,_0x3901ee){_0x5ed0d3[_0xe7a2('0xac')]=_0x310018[_0xe7a2('0x37')]({'plain':!![]});_0x5ed0d3[_0xe7a2('0xac')]['created']=![];if(_0x3901ee){if(_0x5ed0d3['account'][_0xe7a2('0xad')]){_0x5ed0d3[_0xe7a2('0x8d')][_0xe7a2('0xae')]({'id':0x0,'priority':_0x5ed0d3[_0xe7a2('0x8d')][_0xe7a2('0x59')]+0x1,'app':_0xe7a2('0xaf'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x5ed0d3['interaction'][_0xe7a2('0xb0')]=!![];}return db['WhatsappMessage']['create']({'phone':_0x5ed0d3['body'][_0xe7a2('0xa1')],'messageId':_0x5ed0d3['body'][_0xe7a2('0x9e')],'body':_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0x5d')],'WhatsappAccountId':_0x23e3cc[_0xe7a2('0x56')]['id'],'WhatsappInteractionId':_0x310018['id'],'direction':'in','ContactId':_0x310018['ContactId'],'AttachmentId':_0x5ed0d3[_0xe7a2('0x5d')][_0xe7a2('0xb1')]});})[_0xe7a2('0x1e')](function(_0x42f202){_0x5ed0d3['message']=_0x42f202;if(_0x5ed0d3['interaction']['UserId']){return db['User'][_0xe7a2('0x5b')]({'attributes':['id',_0xe7a2('0x46')],'where':{'id':_0x5ed0d3[_0xe7a2('0xac')][_0xe7a2('0xb2')]}})[_0xe7a2('0x1e')](function(_0x5dea30){if(_0x5dea30){_0x5ed0d3[_0xe7a2('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5dea30[_0xe7a2('0x46')]+','+(_0x5ed0d3[_0xe7a2('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0xe7a2('0xb3')});}return respondWithRpcPromise('Start',_0xe7a2('0xb4'),_0x5ed0d3);});}return respondWithRpcPromise(_0xe7a2('0xb5'),_0xe7a2('0xb4'),_0x5ed0d3);})[_0xe7a2('0x1e')](function(_0x360f47){if(_0x360f47){var _0x3b460b=0xc8;var _0x557f42='receiveMessage';logger[_0xe7a2('0x1f')](_0xe7a2('0x22'),_0x557f42,_0x3b460b,_0xe7a2('0xb6'));logger[_0xe7a2('0x21')](_0xe7a2('0xb7'),_0x557f42,_0x3b460b,_0xe7a2('0xb6'),JSON[_0xe7a2('0x23')](_0x360f47));if(_0x5ed0d3[_0xe7a2('0x86')][_0xe7a2('0x43')]==='twilio'){return _0x192eee[_0xe7a2('0x2f')](_0x3b460b)[_0xe7a2('0x30')](_0xe7a2('0xb8'),_0xe7a2('0xb9'))[_0xe7a2('0x3c')]('\x0a');}else{return _0x192eee[_0xe7a2('0x2f')](_0x3b460b)[_0xe7a2('0x2a')](_0x360f47);}}});})[_0xe7a2('0x28')](handleError(_0x192eee,null));};exports[_0xe7a2('0x3c')]=function(_0x20c51f,_0x5eed48,_0x216193){var _0x526de2,_0x1dc8d,_0x3ef906;if(_['isNil'](_0x20c51f[_0xe7a2('0x5d')][_0xe7a2('0x5d')])||_0x20c51f[_0xe7a2('0x5d')][_0xe7a2('0x5d')]===''){throw new db[(_0xe7a2('0x92'))][(_0xe7a2('0x93'))](_0xe7a2('0xba'));}if(_[_0xe7a2('0xa3')](_0x20c51f[_0xe7a2('0x5d')]['to'])){throw new db[(_0xe7a2('0x92'))][(_0xe7a2('0x93'))](_0xe7a2('0xbb'));}_0x526de2=_0x20c51f['body']['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x20c51f[_0xe7a2('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xe7a2('0xbc'),'include':[{'model':db[_0xe7a2('0x91')],'as':_0xe7a2('0xa8'),'where':{'mobile':_0x526de2},'limit':0x1,'order':[[_0xe7a2('0x97'),_0xe7a2('0xa9')]]}]}]})[_0xe7a2('0x1e')](handleEntityNotFound(_0x5eed48,null))[_0xe7a2('0x1e')](function(_0x1de420){if(_0x1de420&&_0x1de420[_0xe7a2('0xbc')]){_0x1dc8d=_0x1de420[_0xe7a2('0x37')]({'plain':!![]});if(_0x1dc8d['List']&&_0x1dc8d[_0xe7a2('0xbc')][_0xe7a2('0xa8')][_0xe7a2('0x59')]){return _0x1dc8d[_0xe7a2('0xbc')]['Contacts'][0x0];}return db[_0xe7a2('0x91')][_0xe7a2('0x5c')](_[_0xe7a2('0x19')](_0x20c51f[_0xe7a2('0x5d')],{'firstName':_0x526de2,'mobile':_0x526de2,'phone':_0x526de2,'ListId':_0x1dc8d[_0xe7a2('0x99')]}));}})[_0xe7a2('0x1e')](handleEntityNotFound(_0x5eed48,null))['then'](function(_0x4372f7){if(_0x4372f7){_0x3ef906=_0x4372f7;return db['WhatsappInteraction'][_0xe7a2('0x5b')]({'where':{'ContactId':_0x3ef906['id'],'closed':![],'WhatsappAccountId':_0x1dc8d['id']}})[_0xe7a2('0x1e')](function(_0x4416ef){if(_0x4416ef){return[_0x4416ef,![]];}return db[_0xe7a2('0xab')]['create']({'UserId':_0x20c51f[_0xe7a2('0x60')]['id'],'ContactId':_0x3ef906['id'],'WhatsappAccountId':_0x1dc8d['id'],'phone':_0x526de2,'firstMsgDirection':_0xe7a2('0xbd'),'Messages':[_[_0xe7a2('0x5a')](_0x20c51f['body'],{'read':![],'body':_0x20c51f['body'][_0xe7a2('0x5d')],'phone':_0x526de2,'WhatsappAccountId':_0x1dc8d['id'],'UserId':_0x20c51f[_0xe7a2('0x60')]['id'],'ContactId':_0x3ef906['id']})]},{'include':[{'model':db[_0xe7a2('0x8a')],'as':_0xe7a2('0xbe')}]})['then'](function(_0x561caa){return[_0x561caa,!![]];});});}})[_0xe7a2('0x75')](function(_0x520bbf,_0x52ef38){if(_0x52ef38){return _0x520bbf;}return db[_0xe7a2('0x8a')]['create'](_[_0xe7a2('0x5a')](_0x20c51f[_0xe7a2('0x5d')],{'read':![],'body':_0x20c51f['body'][_0xe7a2('0x5d')],'phone':_0x526de2,'WhatsappAccountId':_0x1dc8d['id'],'WhatsappInteractionId':_0x520bbf['id'],'UserId':_0x20c51f[_0xe7a2('0x60')]['id'],'ContactId':_0x3ef906['id']}))[_0xe7a2('0x1e')](function(_0x14b7c4){_0x520bbf['dataValues']['Messages']=[];_0x520bbf['dataValues'][_0xe7a2('0xbe')][_0xe7a2('0xae')](_0x14b7c4[_0xe7a2('0xbf')]);return _0x520bbf;});})['then'](respondWithResult(_0x5eed48,null))[_0xe7a2('0x28')](handleError(_0x5eed48,null));}; \ No newline at end of file +var _0x8344=['update','get','end','name','send','index','map','WhatsappAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','keys','includeAll','user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','body','find','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','pick','removeAnswers','ids','addAgents','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','destroy','bulkCreate','findAndCountAll','priority','stack','getApplications','notify','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','Applications','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','list','omit','Contacts','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','DESC','List','Messages','dataValues','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x3c749e,_0x4b7c88){var _0x4195c3=function(_0x314bb9){while(--_0x314bb9){_0x3c749e['push'](_0x3c749e['shift']());}};_0x4195c3(++_0x4b7c88);}(_0x8344,0x8f));var _0x4834=function(_0x43e7a6,_0x188b82){_0x43e7a6=_0x43e7a6-0x0;var _0x24b017=_0x8344[_0x43e7a6];return _0x24b017;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4834('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4834('0x1'));var BPromise=require(_0x4834('0x2'));var Mustache=require(_0x4834('0x3'));var util=require(_0x4834('0x4'));var path=require(_0x4834('0x5'));var sox=require(_0x4834('0x6'));var csv=require(_0x4834('0x7'));var ejs=require(_0x4834('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4834('0x9'));var squel=require('squel');var crypto=require(_0x4834('0xa'));var jsforce=require(_0x4834('0xb'));var deskjs=require(_0x4834('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4834('0xd'));var Redis=require('ioredis');var authService=require(_0x4834('0xe'));var qs=require(_0x4834('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4834('0x10'));var logger=require(_0x4834('0x11'))(_0x4834('0x12'));var utils=require(_0x4834('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4834('0x14'));var db=require('../../mysqldb')['db'];config[_0x4834('0x15')]=_[_0x4834('0x16')](config['redis'],{'host':_0x4834('0x17'),'port':0x18eb});var socket=require(_0x4834('0x18'))(new Redis(config[_0x4834('0x15')]));require(_0x4834('0x19'))[_0x4834('0x1a')](socket);var jayson=require(_0x4834('0x1b'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1d1f54,_0x1d7738,_0x2c1341,_0x5d4b66){return new BPromise(function(_0x190492,_0x3cf8d1){var _0x5ddc62=_0x5d4b66||client;return _0x5ddc62[_0x4834('0x1c')](_0x1d1f54,_0x2c1341)[_0x4834('0x1d')](function(_0x1b6069){logger['info'](_0x4834('0x1e'),_0x1d7738,_0x4834('0x1f'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1d7738,_0x4834('0x1f'),JSON[_0x4834('0x20')](_0x1b6069));if(_0x1b6069[_0x4834('0x21')]){if(_0x1b6069[_0x4834('0x21')][_0x4834('0x22')]===0x1f4){logger[_0x4834('0x21')](_0x4834('0x1e'),_0x1d7738,_0x1b6069[_0x4834('0x21')][_0x4834('0x23')]);return _0x3cf8d1(_0x1b6069[_0x4834('0x21')]['message']);}logger[_0x4834('0x21')](_0x4834('0x1e'),_0x1d7738,_0x1b6069[_0x4834('0x21')][_0x4834('0x23')]);return _0x190492(_0x1b6069[_0x4834('0x21')][_0x4834('0x23')]);}else{logger[_0x4834('0x24')](_0x4834('0x1e'),_0x1d7738,_0x4834('0x1f'));_0x190492(_0x1b6069[_0x4834('0x25')][_0x4834('0x23')]);}})[_0x4834('0x26')](function(_0x28b852){logger[_0x4834('0x21')](_0x4834('0x1e'),_0x1d7738,_0x28b852);_0x3cf8d1(_0x28b852);});});}function respondWithStatusCode(_0xe0ed7c,_0x56b72c){_0x56b72c=_0x56b72c||0xcc;return function(_0x26ff1a){if(_0x26ff1a){return _0xe0ed7c[_0x4834('0x27')](_0x56b72c);}return _0xe0ed7c['status'](_0x56b72c)['end']();};}function respondWithResult(_0x3327c6,_0x2ebe34){_0x2ebe34=_0x2ebe34||0xc8;return function(_0x39188e){if(_0x39188e){return _0x3327c6[_0x4834('0x28')](_0x2ebe34)[_0x4834('0x29')](_0x39188e);}};}function respondWithFilteredResult(_0x4abd17,_0x137fd9){return function(_0x3edb83){if(_0x3edb83){var _0x38b5b1=typeof _0x137fd9[_0x4834('0x2a')]===_0x4834('0x2b')&&typeof _0x137fd9[_0x4834('0x2c')]===_0x4834('0x2b');var _0x230138=_0x3edb83[_0x4834('0x2d')];var _0x5d6f1a=_0x38b5b1?0x0:_0x137fd9['offset'];var _0x567246=_0x38b5b1?_0x3edb83[_0x4834('0x2d')]:_0x137fd9[_0x4834('0x2a')]+_0x137fd9[_0x4834('0x2c')];var _0x27f906;if(_0x567246>=_0x230138){_0x567246=_0x230138;_0x27f906=0xc8;}else{_0x27f906=0xce;}_0x4abd17['status'](_0x27f906);return _0x4abd17[_0x4834('0x2e')](_0x4834('0x2f'),_0x5d6f1a+'-'+_0x567246+'/'+_0x230138)[_0x4834('0x29')](_0x3edb83);}return null;};}function patchUpdates(_0x57586d){return function(_0x4202e2){try{jsonpatch['apply'](_0x4202e2,_0x57586d,!![]);}catch(_0x1e3433){return BPromise['reject'](_0x1e3433);}return _0x4202e2[_0x4834('0x30')]();};}function saveUpdates(_0x1bfabe,_0x5602f5){return function(_0x4ef6ec){if(_0x4ef6ec){return _0x4ef6ec[_0x4834('0x31')](_0x1bfabe)[_0x4834('0x1d')](function(_0x2f401a){return _0x2f401a;});}return null;};}function removeEntity(_0x22c2e1,_0x1a39b2){return function(_0xa20563){if(_0xa20563){return _0xa20563['destroy']()[_0x4834('0x1d')](function(){var _0x19297f=_0xa20563[_0x4834('0x32')]({'plain':!![]});var _0x5c0c27='WhatsappAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x5c0c27,'resourceId':_0x19297f['id']}})[_0x4834('0x1d')](function(){return _0xa20563;});})[_0x4834('0x1d')](function(){_0x22c2e1[_0x4834('0x28')](0xcc)[_0x4834('0x33')]();});}};}function handleEntityNotFound(_0x23599e,_0x49fb9){return function(_0x1ffbdc){if(!_0x1ffbdc){_0x23599e['sendStatus'](0x194);}return _0x1ffbdc;};}function handleError(_0x4cce0f,_0xd2dfc1){_0xd2dfc1=_0xd2dfc1||0x1f4;return function(_0x234e5f){logger['error'](_0x234e5f['stack']);if(_0x234e5f['name']){delete _0x234e5f[_0x4834('0x34')];}_0x4cce0f['status'](_0xd2dfc1)[_0x4834('0x35')](_0x234e5f);};}exports[_0x4834('0x36')]=function(_0x2ca7e5,_0x453c07){var _0x3ebb1b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2db3fd={},_0xb9ebe4={'count':0x0,'rows':[]};var _0x1ae1b4=_[_0x4834('0x37')](db[_0x4834('0x38')]['rawAttributes'],function(_0x18aa6c){return{'name':_0x18aa6c[_0x4834('0x39')],'type':_0x18aa6c[_0x4834('0x3a')][_0x4834('0x3b')]};});_0x2db3fd[_0x4834('0x3c')]=_[_0x4834('0x37')](_0x1ae1b4,_0x4834('0x34'));_0x2db3fd[_0x4834('0x3d')]=_['keys'](_0x2ca7e5[_0x4834('0x3d')]);_0x2db3fd[_0x4834('0x3e')]=_[_0x4834('0x3f')](_0x2db3fd['model'],_0x2db3fd['query']);_0x3ebb1b[_0x4834('0x40')]=_['intersection'](_0x2db3fd['model'],qs[_0x4834('0x41')](_0x2ca7e5['query'][_0x4834('0x41')]));_0x3ebb1b[_0x4834('0x40')]=_0x3ebb1b['attributes'][_0x4834('0x42')]?_0x3ebb1b[_0x4834('0x40')]:_0x2db3fd['model'];if(!_0x2ca7e5[_0x4834('0x3d')][_0x4834('0x43')]('nolimit')){_0x3ebb1b['limit']=qs[_0x4834('0x2c')](_0x2ca7e5[_0x4834('0x3d')][_0x4834('0x2c')]);_0x3ebb1b[_0x4834('0x2a')]=qs[_0x4834('0x2a')](_0x2ca7e5[_0x4834('0x3d')]['offset']);}_0x3ebb1b[_0x4834('0x44')]=qs[_0x4834('0x45')](_0x2ca7e5['query'][_0x4834('0x45')]);_0x3ebb1b[_0x4834('0x46')]=qs[_0x4834('0x3e')](_['pick'](_0x2ca7e5['query'],_0x2db3fd[_0x4834('0x3e')]),_0x1ae1b4);if(_0x2ca7e5[_0x4834('0x3d')][_0x4834('0x47')]){_0x3ebb1b[_0x4834('0x46')]=_[_0x4834('0x48')](_0x3ebb1b['where'],{'$or':_[_0x4834('0x37')](_0x1ae1b4,function(_0x1cc0cd){if(_0x1cc0cd['type']!==_0x4834('0x49')){var _0x4b3fa3={};_0x4b3fa3[_0x1cc0cd[_0x4834('0x34')]]={'$like':'%'+_0x2ca7e5[_0x4834('0x3d')]['filter']+'%'};return _0x4b3fa3;}})});}_0x3ebb1b=_[_0x4834('0x48')]({},_0x3ebb1b,_0x2ca7e5[_0x4834('0x4a')]);var _0x312d8b={'where':_0x3ebb1b['where']};return db['WhatsappAccount'][_0x4834('0x2d')](_0x312d8b)['then'](function(_0x26ce1e){_0xb9ebe4[_0x4834('0x2d')]=_0x26ce1e;if(_0x2ca7e5[_0x4834('0x3d')]['includeAll']){_0x3ebb1b[_0x4834('0x4b')]=[{'all':!![]}];}return db[_0x4834('0x38')][_0x4834('0x4c')](_0x3ebb1b);})['then'](function(_0x3cc3f3){_0xb9ebe4[_0x4834('0x4d')]=_0x3cc3f3;return _0xb9ebe4;})[_0x4834('0x1d')](respondWithFilteredResult(_0x453c07,_0x3ebb1b))[_0x4834('0x26')](handleError(_0x453c07,null));};exports[_0x4834('0x4e')]=function(_0x70dfd5,_0x4a5225){var _0x5187e3={'raw':![],'where':{'id':_0x70dfd5[_0x4834('0x4f')]['id']},'include':[{'model':db[_0x4834('0x50')],'as':_0x4834('0x51')}]},_0x13a1db={};_0x13a1db[_0x4834('0x3c')]=_[_0x4834('0x52')](db[_0x4834('0x38')]['rawAttributes']);_0x13a1db[_0x4834('0x3d')]=_[_0x4834('0x52')](_0x70dfd5['query']);_0x13a1db['filters']=_[_0x4834('0x3f')](_0x13a1db[_0x4834('0x3c')],_0x13a1db[_0x4834('0x3d')]);_0x5187e3[_0x4834('0x40')]=_[_0x4834('0x3f')](_0x13a1db[_0x4834('0x3c')],qs[_0x4834('0x41')](_0x70dfd5[_0x4834('0x3d')][_0x4834('0x41')]));_0x5187e3[_0x4834('0x40')]=_0x5187e3['attributes'][_0x4834('0x42')]?_0x5187e3[_0x4834('0x40')]:_0x13a1db[_0x4834('0x3c')];if(_0x70dfd5[_0x4834('0x3d')][_0x4834('0x53')]){_0x5187e3[_0x4834('0x4b')]=[{'all':!![]}];}_0x5187e3=_[_0x4834('0x48')]({},_0x5187e3,_0x70dfd5[_0x4834('0x4a')]);return db[_0x4834('0x38')]['find'](_0x5187e3)[_0x4834('0x1d')](handleEntityNotFound(_0x4a5225,null))['then'](respondWithResult(_0x4a5225,null))[_0x4834('0x26')](handleError(_0x4a5225,null));};exports['create']=function(_0x3ded1e,_0x124926){return db['WhatsappAccount']['create'](_0x3ded1e['body'],{})[_0x4834('0x1d')](function(_0x406a3e){var _0x361dc0=_0x3ded1e[_0x4834('0x54')]['get']({'plain':!![]});if(!_0x361dc0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x361dc0[_0x4834('0x55')]==='user'){var _0x142329=_0x406a3e[_0x4834('0x32')]({'plain':!![]});var _0x4c6905=_0x4834('0x56');return db[_0x4834('0x57')]['find']({'where':{'name':_0x4c6905,'userProfileId':_0x361dc0[_0x4834('0x58')]},'raw':!![]})[_0x4834('0x1d')](function(_0x4aa191){if(_0x4aa191&&_0x4aa191[_0x4834('0x59')]===0x0){return db[_0x4834('0x5a')][_0x4834('0x5b')]({'name':_0x142329['name'],'resourceId':_0x142329['id'],'type':_0x4aa191['name'],'sectionId':_0x4aa191['id']},{})[_0x4834('0x1d')](function(){return _0x406a3e;});}else{return _0x406a3e;}})[_0x4834('0x26')](function(_0x324639){logger[_0x4834('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x324639);throw _0x324639;});}return _0x406a3e;})['then'](respondWithResult(_0x124926,0xc9))[_0x4834('0x26')](handleError(_0x124926,null));};exports[_0x4834('0x31')]=function(_0x32340e,_0xff5147){if(_0x32340e[_0x4834('0x5c')]['id']){delete _0x32340e[_0x4834('0x5c')]['id'];}return db[_0x4834('0x38')]['find']({'where':{'id':_0x32340e[_0x4834('0x4f')]['id']},'include':[{'model':db[_0x4834('0x50')],'as':_0x4834('0x51')}]})[_0x4834('0x1d')](handleEntityNotFound(_0xff5147,null))[_0x4834('0x1d')](saveUpdates(_0x32340e[_0x4834('0x5c')],null))[_0x4834('0x1d')](respondWithResult(_0xff5147,null))[_0x4834('0x26')](handleError(_0xff5147,null));};exports['destroy']=function(_0x557a4d,_0x605376){return db[_0x4834('0x38')][_0x4834('0x5d')]({'where':{'id':_0x557a4d[_0x4834('0x4f')]['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0x605376,null))[_0x4834('0x1d')](removeEntity(_0x605376,null))['catch'](handleError(_0x605376,null));};exports[_0x4834('0x5e')]=function(_0x32f09e,_0x508f0f){return db[_0x4834('0x38')]['describe']()[_0x4834('0x1d')](respondWithResult(_0x508f0f,null))[_0x4834('0x26')](handleError(_0x508f0f,null));};exports[_0x4834('0x5f')]=function(_0x37eccb,_0x164037,_0x2da34e){if(_0x37eccb[_0x4834('0x5c')]['id']){delete _0x37eccb[_0x4834('0x5c')]['id'];}return db[_0x4834('0x38')][_0x4834('0x5d')]({'where':{'id':_0x37eccb[_0x4834('0x4f')]['id']}})['then'](handleEntityNotFound(_0x164037,null))[_0x4834('0x1d')](function(_0xb1d908){if(_0xb1d908){_0x37eccb[_0x4834('0x5c')][_0x4834('0x60')]=_0xb1d908['id'];return db[_0x4834('0x61')]['create'](_0x37eccb[_0x4834('0x5c')]);}})[_0x4834('0x1d')](respondWithResult(_0x164037,null))[_0x4834('0x26')](handleError(_0x164037,null));};exports[_0x4834('0x62')]=function(_0x21991,_0x1d511a,_0x24a400){var _0x2858b3={'raw':![],'where':{}};var _0x1286ec={};var _0x22c621={'count':0x0,'rows':[]};return db[_0x4834('0x38')][_0x4834('0x63')]({'where':{'id':_0x21991['params']['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0x1d511a,null))['then'](function(_0x524121){if(_0x524121){_0x1286ec[_0x4834('0x3c')]=_[_0x4834('0x52')](db['Disposition'][_0x4834('0x64')]);_0x1286ec['query']=_[_0x4834('0x52')](_0x21991[_0x4834('0x3d')]);_0x1286ec['filters']=_[_0x4834('0x3f')](_0x1286ec[_0x4834('0x3c')],_0x1286ec['query']);_0x2858b3[_0x4834('0x40')]=_['intersection'](_0x1286ec[_0x4834('0x3c')],qs['fields'](_0x21991['query'][_0x4834('0x41')]));_0x2858b3[_0x4834('0x40')]=_0x2858b3[_0x4834('0x40')]['length']?_0x2858b3['attributes']:_0x1286ec['model'];if(!_0x21991['query']['hasOwnProperty']('nolimit')){_0x2858b3[_0x4834('0x2c')]=qs[_0x4834('0x2c')](_0x21991['query'][_0x4834('0x2c')]);_0x2858b3['offset']=qs[_0x4834('0x2a')](_0x21991[_0x4834('0x3d')][_0x4834('0x2a')]);}_0x2858b3[_0x4834('0x44')]=qs[_0x4834('0x45')](_0x21991['query']['sort']);_0x2858b3[_0x4834('0x46')]=qs['filters'](_['pick'](_0x21991['query'],_0x1286ec[_0x4834('0x3e')]));_0x2858b3[_0x4834('0x46')][_0x4834('0x60')]=_0x524121['id'];if(_0x21991[_0x4834('0x3d')][_0x4834('0x47')]){_0x2858b3['where']=_[_0x4834('0x48')](_0x2858b3['where'],{'$or':_[_0x4834('0x37')](_0x2858b3[_0x4834('0x40')],function(_0x57b98b){var _0x8f85d9={};_0x8f85d9[_0x57b98b]={'$like':'%'+_0x21991[_0x4834('0x3d')][_0x4834('0x47')]+'%'};return _0x8f85d9;})});}_0x2858b3=_[_0x4834('0x48')]({},_0x2858b3,_0x21991['options']);return db['Disposition'][_0x4834('0x2d')]({'where':_0x2858b3[_0x4834('0x46')]})[_0x4834('0x1d')](function(_0x36aab7){_0x22c621[_0x4834('0x2d')]=_0x36aab7;if(_0x21991[_0x4834('0x3d')][_0x4834('0x53')]){_0x2858b3[_0x4834('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0x4834('0x4c')](_0x2858b3);})[_0x4834('0x1d')](function(_0x2976a6){_0x22c621[_0x4834('0x4d')]=_0x2976a6;return _0x22c621;});}})['then'](respondWithFilteredResult(_0x1d511a,_0x2858b3))[_0x4834('0x26')](handleError(_0x1d511a,null));};exports[_0x4834('0x65')]=function(_0x1cddea,_0x39f8ff,_0x25bae3){return db[_0x4834('0x38')][_0x4834('0x5d')]({'where':{'id':_0x1cddea['params']['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0x39f8ff,null))[_0x4834('0x1d')](function(_0x58ebe0){if(_0x58ebe0){return _0x58ebe0[_0x4834('0x65')](_0x1cddea['query']['ids']);}})[_0x4834('0x1d')](respondWithStatusCode(_0x39f8ff,null))[_0x4834('0x26')](handleError(_0x39f8ff,null));};exports[_0x4834('0x66')]=function(_0x26ef47,_0xb0650e,_0x137dc3){if(_0x26ef47[_0x4834('0x5c')]['id']){delete _0x26ef47[_0x4834('0x5c')]['id'];}return db[_0x4834('0x38')]['find']({'where':{'id':_0x26ef47['params']['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0xb0650e,null))[_0x4834('0x1d')](function(_0x59c850){if(_0x59c850){_0x26ef47[_0x4834('0x5c')][_0x4834('0x60')]=_0x59c850['id'];return db[_0x4834('0x67')]['create'](_0x26ef47[_0x4834('0x5c')]);}})[_0x4834('0x1d')](respondWithResult(_0xb0650e,null))[_0x4834('0x26')](handleError(_0xb0650e,null));};exports[_0x4834('0x68')]=function(_0xc2322c,_0x23b772,_0x250c92){var _0x3bb447={'raw':![],'where':{}};var _0x5d5c51={};var _0x3c0623={'count':0x0,'rows':[]};return db[_0x4834('0x38')]['findOne']({'where':{'id':_0xc2322c[_0x4834('0x4f')]['id']}})['then'](handleEntityNotFound(_0x23b772,null))['then'](function(_0x289e82){if(_0x289e82){_0x5d5c51[_0x4834('0x3c')]=_[_0x4834('0x52')](db[_0x4834('0x67')][_0x4834('0x64')]);_0x5d5c51[_0x4834('0x3d')]=_[_0x4834('0x52')](_0xc2322c['query']);_0x5d5c51[_0x4834('0x3e')]=_[_0x4834('0x3f')](_0x5d5c51[_0x4834('0x3c')],_0x5d5c51[_0x4834('0x3d')]);_0x3bb447[_0x4834('0x40')]=_[_0x4834('0x3f')](_0x5d5c51['model'],qs[_0x4834('0x41')](_0xc2322c[_0x4834('0x3d')][_0x4834('0x41')]));_0x3bb447[_0x4834('0x40')]=_0x3bb447[_0x4834('0x40')]['length']?_0x3bb447[_0x4834('0x40')]:_0x5d5c51[_0x4834('0x3c')];if(!_0xc2322c[_0x4834('0x3d')][_0x4834('0x43')](_0x4834('0x69'))){_0x3bb447[_0x4834('0x2c')]=qs['limit'](_0xc2322c['query'][_0x4834('0x2c')]);_0x3bb447[_0x4834('0x2a')]=qs[_0x4834('0x2a')](_0xc2322c[_0x4834('0x3d')]['offset']);}_0x3bb447[_0x4834('0x44')]=qs[_0x4834('0x45')](_0xc2322c['query']['sort']);_0x3bb447[_0x4834('0x46')]=qs[_0x4834('0x3e')](_[_0x4834('0x6a')](_0xc2322c[_0x4834('0x3d')],_0x5d5c51[_0x4834('0x3e')]));_0x3bb447[_0x4834('0x46')][_0x4834('0x60')]=_0x289e82['id'];if(_0xc2322c[_0x4834('0x3d')]['filter']){_0x3bb447[_0x4834('0x46')]=_[_0x4834('0x48')](_0x3bb447['where'],{'$or':_[_0x4834('0x37')](_0x3bb447[_0x4834('0x40')],function(_0x4c6f08){var _0x45cb4f={};_0x45cb4f[_0x4c6f08]={'$like':'%'+_0xc2322c['query'][_0x4834('0x47')]+'%'};return _0x45cb4f;})});}_0x3bb447=_[_0x4834('0x48')]({},_0x3bb447,_0xc2322c[_0x4834('0x4a')]);return db[_0x4834('0x67')][_0x4834('0x2d')]({'where':_0x3bb447[_0x4834('0x46')]})['then'](function(_0x1bc778){_0x3c0623[_0x4834('0x2d')]=_0x1bc778;if(_0xc2322c[_0x4834('0x3d')][_0x4834('0x53')]){_0x3bb447['include']=[{'all':!![]}];}return db[_0x4834('0x67')]['findAll'](_0x3bb447);})[_0x4834('0x1d')](function(_0x27d1ae){_0x3c0623[_0x4834('0x4d')]=_0x27d1ae;return _0x3c0623;});}})[_0x4834('0x1d')](respondWithFilteredResult(_0x23b772,_0x3bb447))[_0x4834('0x26')](handleError(_0x23b772,null));};exports[_0x4834('0x6b')]=function(_0x4ecb06,_0xc81e4f,_0x4484f4){return db[_0x4834('0x38')][_0x4834('0x5d')]({'where':{'id':_0x4ecb06[_0x4834('0x4f')]['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0xc81e4f,null))[_0x4834('0x1d')](function(_0x330abb){if(_0x330abb){return _0x330abb[_0x4834('0x6b')](_0x4ecb06[_0x4834('0x3d')][_0x4834('0x6c')]);}})[_0x4834('0x1d')](respondWithStatusCode(_0xc81e4f,null))[_0x4834('0x26')](handleError(_0xc81e4f,null));};exports[_0x4834('0x6d')]=function(_0x4e4272,_0x93a2e6,_0x8851bf){return db['WhatsappAccount'][_0x4834('0x5d')]({'where':{'id':_0x4e4272[_0x4834('0x4f')]['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0x93a2e6,null))[_0x4834('0x1d')](function(_0x36fb91){if(_0x36fb91){return _0x36fb91[_0x4834('0x6d')](_0x4e4272[_0x4834('0x5c')][_0x4834('0x6c')],_['omit'](_0x4e4272[_0x4834('0x5c')],[_0x4834('0x6c'),'id'])||{})[_0x4834('0x6e')](function(_0x4369bc){for(var _0x3e0f72=0x0;_0x3e0f72<_0x4e4272['body']['ids'][_0x4834('0x42')];_0x3e0f72+=0x1){socket[_0x4834('0x6f')]('userWhatsappAccount:save',{'UserId':Number(_0x4e4272[_0x4834('0x5c')][_0x4834('0x6c')][_0x3e0f72]),'WhatsappAccountId':Number(_0x4e4272['params']['id'])});}return _0x4369bc;});}})[_0x4834('0x1d')](respondWithResult(_0x93a2e6,null))[_0x4834('0x26')](handleError(_0x93a2e6,null));};exports['removeAgents']=function(_0x389020,_0x10b061,_0x14ef17){return db[_0x4834('0x38')]['find']({'where':{'id':_0x389020[_0x4834('0x4f')]['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0x10b061,null))[_0x4834('0x1d')](function(_0x2b3bd4){if(_0x2b3bd4){return _0x2b3bd4[_0x4834('0x70')](_0x389020[_0x4834('0x3d')][_0x4834('0x6c')])[_0x4834('0x1d')](function(){if(_[_0x4834('0x71')](_0x389020[_0x4834('0x3d')]['ids'])){for(var _0x5e5fa1=0x0;_0x5e5fa1<_0x389020[_0x4834('0x3d')][_0x4834('0x6c')][_0x4834('0x42')];_0x5e5fa1+=0x1){socket[_0x4834('0x6f')](_0x4834('0x72'),{'UserId':Number(_0x389020['query'][_0x4834('0x6c')][_0x5e5fa1]),'WhatsappAccountId':Number(_0x389020[_0x4834('0x4f')]['id'])});}}else{socket[_0x4834('0x6f')](_0x4834('0x72'),{'UserId':Number(_0x389020[_0x4834('0x3d')]['ids']),'WhatsappAccountId':Number(_0x389020[_0x4834('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x10b061,null))[_0x4834('0x26')](handleError(_0x10b061,null));};exports['getAgents']=function(_0x2a0c17,_0x540648,_0xefa8d6){var _0x372e91={};var _0x33e134={};var _0x1ccb50;var _0x132c1e;return db[_0x4834('0x38')][_0x4834('0x63')]({'where':{'id':_0x2a0c17[_0x4834('0x4f')]['id']}})[_0x4834('0x1d')](handleEntityNotFound(_0x540648,null))[_0x4834('0x1d')](function(_0x2ff4fd){if(_0x2ff4fd){_0x1ccb50=_0x2ff4fd;_0x33e134[_0x4834('0x3c')]=_[_0x4834('0x52')](db['User'][_0x4834('0x64')]);_0x33e134[_0x4834('0x3d')]=_[_0x4834('0x52')](_0x2a0c17[_0x4834('0x3d')]);_0x33e134[_0x4834('0x3e')]=_[_0x4834('0x3f')](_0x33e134[_0x4834('0x3c')],_0x33e134[_0x4834('0x3d')]);_0x372e91['attributes']=_[_0x4834('0x3f')](_0x33e134['model'],qs['fields'](_0x2a0c17[_0x4834('0x3d')][_0x4834('0x41')]));_0x372e91['attributes']=_0x372e91[_0x4834('0x40')][_0x4834('0x42')]?_0x372e91['attributes']:_0x33e134[_0x4834('0x3c')];_0x372e91[_0x4834('0x44')]=qs[_0x4834('0x45')](_0x2a0c17[_0x4834('0x3d')]['sort']);_0x372e91[_0x4834('0x46')]=qs['filters'](_[_0x4834('0x6a')](_0x2a0c17['query'],_0x33e134[_0x4834('0x3e')]));if(_0x2a0c17['query'][_0x4834('0x47')]){_0x372e91[_0x4834('0x46')]=_[_0x4834('0x48')](_0x372e91[_0x4834('0x46')],{'$or':_[_0x4834('0x37')](_0x372e91[_0x4834('0x40')],function(_0x12aa6d){var _0x2f3de8={};_0x2f3de8[_0x12aa6d]={'$like':'%'+_0x2a0c17[_0x4834('0x3d')]['filter']+'%'};return _0x2f3de8;})});}_0x372e91=_[_0x4834('0x48')]({},_0x372e91,_0x2a0c17[_0x4834('0x4a')]);return _0x1ccb50[_0x4834('0x73')](_0x372e91);}})[_0x4834('0x1d')](function(_0x50e2ea){if(_0x50e2ea){_0x132c1e=_0x50e2ea['length'];if(!_0x2a0c17[_0x4834('0x3d')][_0x4834('0x43')](_0x4834('0x69'))){_0x372e91['limit']=qs['limit'](_0x2a0c17['query'][_0x4834('0x2c')]);_0x372e91[_0x4834('0x2a')]=qs[_0x4834('0x2a')](_0x2a0c17[_0x4834('0x3d')]['offset']);}return _0x1ccb50[_0x4834('0x73')](_0x372e91);}})[_0x4834('0x1d')](function(_0x57b2a1){if(_0x57b2a1){return _0x57b2a1?{'count':_0x132c1e,'rows':_0x57b2a1}:null;}})[_0x4834('0x1d')](respondWithResult(_0x540648,null))['catch'](handleError(_0x540648,null));};exports[_0x4834('0x74')]=function(_0x5b11f7,_0x3f9bf4){var _0x2ea835=_0x5b11f7[_0x4834('0x4f')]['id'];var _0x5a245d=_0x5b11f7['body'];var _0x2f6000=0xc8;var _0xa6a1a5=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x4834('0x75')][_0x4834('0x76')]['ISOLATION_LEVELS'][_0x4834('0x77')]},function(_0x5dc7dd){return db[_0x4834('0x38')][_0x4834('0x63')]({'where':{'id':_0x2ea835},'transaction':_0x5dc7dd})['then'](function(_0x27ceda){if(_0x27ceda){return db[_0x4834('0x78')][_0x4834('0x79')]({'where':{'WhatsappAccountId':_0x2ea835},'transaction':_0x5dc7dd})[_0x4834('0x1d')](function(){var _0xed7088=_[_0x4834('0x37')](_0x5a245d,function(_0x3a702f){_0x3a702f[_0x4834('0x60')]=_0x2ea835;return _0x3a702f;});return db['WhatsappApplication'][_0x4834('0x7a')](_0xed7088,{'transaction':_0x5dc7dd});});}else{_0x2f6000=0x194;_0xa6a1a5=[];}});})[_0x4834('0x1d')](function(){if(_0x2f6000!==0x194){return db[_0x4834('0x78')][_0x4834('0x7b')]({'where':{'WhatsappAccountId':_0x2ea835},'order':_0x4834('0x7c')})[_0x4834('0x1d')](function(_0x4a1776){_0xa6a1a5=_0x4a1776;});}})[_0x4834('0x26')](function(_0x12a005){_0x2f6000=0x1f4;logger[_0x4834('0x21')](_0x12a005[_0x4834('0x7d')]);if(_0x12a005[_0x4834('0x34')]){delete _0x12a005['name'];}_0xa6a1a5=_0x12a005;})['finally'](function(){if(_0xa6a1a5===null){_0x3f9bf4[_0x4834('0x27')](_0x2f6000);}else{if(_0x2f6000===0x1f4){_0x3f9bf4[_0x4834('0x28')](_0x2f6000)[_0x4834('0x35')](_0xa6a1a5);}else{_0x3f9bf4[_0x4834('0x28')](_0x2f6000)[_0x4834('0x29')](_0xa6a1a5);}}});};exports[_0x4834('0x7e')]=function(_0x3ec254,_0x1c8f68,_0x46b2e7){var _0x466340={};var _0x485359={};var _0x57594c;var _0x4e478e;return db[_0x4834('0x38')][_0x4834('0x63')]({'where':{'id':_0x3ec254[_0x4834('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c8f68,null))[_0x4834('0x1d')](function(_0x57acb9){if(_0x57acb9){_0x57594c=_0x57acb9;_0x485359[_0x4834('0x3c')]=_[_0x4834('0x52')](db[_0x4834('0x78')][_0x4834('0x64')]);_0x485359[_0x4834('0x3d')]=_[_0x4834('0x52')](_0x3ec254['query']);_0x485359[_0x4834('0x3e')]=_['intersection'](_0x485359[_0x4834('0x3c')],_0x485359[_0x4834('0x3d')]);_0x466340[_0x4834('0x40')]=_[_0x4834('0x3f')](_0x485359['model'],qs[_0x4834('0x41')](_0x3ec254[_0x4834('0x3d')]['fields']));_0x466340[_0x4834('0x40')]=_0x466340['attributes'][_0x4834('0x42')]?_0x466340[_0x4834('0x40')]:_0x485359[_0x4834('0x3c')];_0x466340[_0x4834('0x44')]=qs[_0x4834('0x45')](_0x3ec254[_0x4834('0x3d')][_0x4834('0x45')]);_0x466340[_0x4834('0x46')]=qs[_0x4834('0x3e')](_[_0x4834('0x6a')](_0x3ec254[_0x4834('0x3d')],_0x485359[_0x4834('0x3e')]));if(_0x3ec254[_0x4834('0x3d')]['filter']){_0x466340[_0x4834('0x46')]=_['merge'](_0x466340[_0x4834('0x46')],{'$or':_[_0x4834('0x37')](_0x466340[_0x4834('0x40')],function(_0x27f440){var _0x23a7cc={};_0x23a7cc[_0x27f440]={'$like':'%'+_0x3ec254[_0x4834('0x3d')][_0x4834('0x47')]+'%'};return _0x23a7cc;})});}_0x466340=_[_0x4834('0x48')]({},_0x466340,_0x3ec254[_0x4834('0x4a')]);return _0x57594c[_0x4834('0x7e')](_0x466340);}})[_0x4834('0x1d')](function(_0x4667c3){if(_0x4667c3){_0x4e478e=_0x4667c3['length'];if(!_0x3ec254[_0x4834('0x3d')][_0x4834('0x43')](_0x4834('0x69'))){_0x466340[_0x4834('0x2c')]=qs[_0x4834('0x2c')](_0x3ec254[_0x4834('0x3d')][_0x4834('0x2c')]);_0x466340[_0x4834('0x2a')]=qs[_0x4834('0x2a')](_0x3ec254['query']['offset']);}return _0x57594c[_0x4834('0x7e')](_0x466340);}})['then'](function(_0x3fbdc2){if(_0x3fbdc2){return _0x3fbdc2?{'count':_0x4e478e,'rows':_0x3fbdc2}:null;}})[_0x4834('0x1d')](respondWithResult(_0x1c8f68,null))[_0x4834('0x26')](handleError(_0x1c8f68,null));};exports[_0x4834('0x7f')]=function(_0x340de7,_0x1fb087,_0x5e121e){var _0x3ce1e1={'channel':'whatsapp'};var _0x383bb7=[];var _0x312e30=[];var _0x3a79bc={};return db[_0x4834('0x38')][_0x4834('0x5d')]({'where':{'id':_0x340de7[_0x4834('0x4f')]['id']},'include':[{'model':db[_0x4834('0x78')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1fb087,null))[_0x4834('0x1d')](function(_0x19e884){_0x3ce1e1[_0x4834('0x80')]=_0x19e884;if(_0x3ce1e1[_0x4834('0x80')]&&_0x3ce1e1[_0x4834('0x80')][_0x4834('0x3a')]===_0x4834('0x81')&&_0x340de7['body'][_0x4834('0x82')]){if(_0x340de7[_0x4834('0x5c')][_0x4834('0x82')][_0x4834('0x42')]===0x0)return;if(_0x340de7['body'][_0x4834('0x82')][0x0][_0x4834('0x83')]!==_0x4834('0x84'))return;return db[_0x4834('0x85')][_0x4834('0x31')]({'read':!![],'readAt':_0x340de7[_0x4834('0x5c')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x340de7[_0x4834('0x5c')][_0x4834('0x82')][0x0][_0x4834('0x86')]},'individualHooks':!![]})[_0x4834('0x1d')](function(_0x63d5e){return _0x1fb087[_0x4834('0x28')](0xc8)['json'](_0x63d5e);});}_0x3ce1e1[_0x4834('0x87')]=_['orderBy'](_0x19e884[_0x4834('0x88')],[_0x4834('0x7c')],['asc']);if(_0x3ce1e1['account'][_0x4834('0x88')]){delete _0x3ce1e1[_0x4834('0x80')][_0x4834('0x88')];}return db[_0x4834('0x89')][_0x4834('0x5e')]()[_0x4834('0x1d')](function(_0x28b2f6){if(!_0x28b2f6){throw new db[(_0x4834('0x8a'))]['ValidationError'](_0x4834('0x8b'));}_0x383bb7=_['difference'](_[_0x4834('0x52')](_0x28b2f6),[_0x4834('0x8c'),_0x4834('0x8d')]);_0x312e30=_[_0x4834('0x8e')](_['keys'](_0x28b2f6),['createdAt',_0x4834('0x8d'),_0x4834('0x8f'),'ListId']);_0x3ce1e1[_0x4834('0x5c')]={'mapKey':_0x4834('0x90')};if(_0x3ce1e1[_0x4834('0x80')]&&_0x3ce1e1[_0x4834('0x80')][_0x4834('0x3a')]===_0x4834('0x91')){_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x92')]=_0x340de7[_0x4834('0x5c')][_0x4834('0x93')][_0x4834('0x94')](_0x4834('0x95'),'');_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x5c')]=_0x340de7['body'][_0x4834('0x96')];_0x3ce1e1['body'][_0x4834('0x97')]=_0x340de7[_0x4834('0x5c')][_0x4834('0x98')];}if(_0x3ce1e1[_0x4834('0x80')]&&_0x3ce1e1[_0x4834('0x80')][_0x4834('0x3a')]==='sinch'){_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x92')]=_0x340de7[_0x4834('0x5c')][_0x4834('0x99')][0x0][_0x4834('0x92')];_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x5c')]=_0x340de7[_0x4834('0x5c')][_0x4834('0x99')][0x0][_0x4834('0x23')][_0x4834('0x5c')];_0x3ce1e1[_0x4834('0x5c')]['messageId']=_0x340de7[_0x4834('0x5c')][_0x4834('0x99')][0x0][_0x4834('0x86')];}if(_0x3ce1e1[_0x4834('0x5c')]['id']){delete _0x3ce1e1[_0x4834('0x5c')]['id'];}if(_[_0x4834('0x9a')](_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x92')])){throw new db[(_0x4834('0x8a'))][(_0x4834('0x9b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x5c')])||_0x3ce1e1[_0x4834('0x5c')]['body']===''){throw new db[(_0x4834('0x8a'))][(_0x4834('0x9b'))](_0x4834('0x9c'));}if(_['isNil'](_0x3ce1e1[_0x4834('0x5c')]['mapKey'])){throw new db[(_0x4834('0x8a'))][(_0x4834('0x9b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x312e30);}if(!_[_0x4834('0x9d')](_0x312e30,_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x9e')])){throw new db[(_0x4834('0x8a'))]['ValidationError'](_0x4834('0x9f')+_0x312e30);}_0x3a79bc[_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x9e')]]=_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x92')];return db[_0x4834('0xa0')]['find']({'where':{'id':_0x3ce1e1[_0x4834('0x80')][_0x4834('0xa1')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3a79bc,'limit':0x1,'order':[[_0x4834('0x8d'),'DESC']]}]});})[_0x4834('0x1d')](handleEntityNotFound(_0x1fb087,null))[_0x4834('0x1d')](function(_0x10176c){if(_0x10176c){_0x3ce1e1[_0x4834('0xa2')]=_[_0x4834('0xa3')](_0x10176c,[_0x4834('0xa4')]);if(_0x10176c[_0x4834('0xa4')][_0x4834('0x42')]){return _0x10176c['Contacts'][0x0];}var _0x335430=_[_0x4834('0x16')](_0x3ce1e1[_0x4834('0x5c')],{'firstName':_0x3ce1e1[_0x4834('0x5c')]['from'],'ListId':_0x10176c['id']});_0x335430[_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x9e')]]=_0x3ce1e1['body'][_0x4834('0x92')];return db[_0x4834('0x89')][_0x4834('0x5b')](_0x335430,{'fields':_0x383bb7,'raw':!![]});}})['then'](handleEntityNotFound(_0x1fb087,null))[_0x4834('0x1d')](function(_0x21c8c4){if(_0x21c8c4){_0x3ce1e1['contact']=_0x21c8c4;var _0x180676={'ContactId':_0x21c8c4['id'],'phone':_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x92')],'WhatsappAccountId':_0x340de7[_0x4834('0x4f')]['id']};var _0x399694={'ContactId':_0x21c8c4['id'],'WhatsappAccountId':_0x340de7['params']['id'],'closed':![]};return db[_0x4834('0xa5')][_0x4834('0x5d')]({'where':_0x399694})[_0x4834('0x1d')](function(_0x263cb8){if(_0x263cb8){return[_0x263cb8,![]];}return db[_0x4834('0xa5')][_0x4834('0x5b')](_0x180676)[_0x4834('0x1d')](function(_0x3f759d){return[_0x3f759d,!![]];});});}})[_0x4834('0x6e')](function(_0x22cce2,_0x4f809e){_0x3ce1e1[_0x4834('0xa6')]=_0x22cce2[_0x4834('0x32')]({'plain':!![]});_0x3ce1e1[_0x4834('0xa6')][_0x4834('0xa7')]=![];if(_0x4f809e){if(_0x3ce1e1[_0x4834('0x80')]['autoclose']){_0x3ce1e1['applications'][_0x4834('0xa8')]({'id':0x0,'priority':_0x3ce1e1['applications'][_0x4834('0x42')]+0x1,'app':'close','appdata':_0x4834('0xa9'),'interval':_0x4834('0xaa')});}_0x3ce1e1[_0x4834('0xa6')][_0x4834('0xa7')]=!![];}return db[_0x4834('0x85')][_0x4834('0x5b')]({'phone':_0x3ce1e1['body'][_0x4834('0x92')],'messageId':_0x3ce1e1[_0x4834('0x5c')]['messageId'],'body':_0x3ce1e1[_0x4834('0x5c')][_0x4834('0x5c')],'WhatsappAccountId':_0x340de7[_0x4834('0x4f')]['id'],'WhatsappInteractionId':_0x22cce2['id'],'direction':'in','ContactId':_0x22cce2[_0x4834('0xab')],'AttachmentId':_0x3ce1e1[_0x4834('0x5c')][_0x4834('0xac')]});})[_0x4834('0x1d')](function(_0x2e65d3){_0x3ce1e1[_0x4834('0x23')]=_0x2e65d3;if(_0x3ce1e1['interaction'][_0x4834('0xad')]){return db[_0x4834('0xae')][_0x4834('0x5d')]({'attributes':['id',_0x4834('0x34')],'where':{'id':_0x3ce1e1['interaction'][_0x4834('0xad')]}})['then'](function(_0x13f829){if(_0x13f829){_0x3ce1e1[_0x4834('0x87')][_0x4834('0xaf')]({'id':0x0,'priority':0x0,'app':_0x4834('0xb0'),'appdata':_0x13f829['name']+','+(_0x3ce1e1[_0x4834('0x80')][_0x4834('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4834('0xb2'),_0x4834('0xb3'),_0x3ce1e1);});}return respondWithRpcPromise(_0x4834('0xb2'),'startRouting',_0x3ce1e1);})[_0x4834('0x1d')](function(_0x21801b){if(_0x21801b){var _0x49bb85=0xc8;var _0x20668e=_0x4834('0xb4');logger[_0x4834('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x20668e,_0x49bb85,_0x4834('0xb5'));logger[_0x4834('0xb6')](_0x4834('0xb7'),_0x20668e,_0x49bb85,_0x4834('0xb5'),JSON[_0x4834('0x20')](_0x21801b));if(_0x3ce1e1['account'][_0x4834('0x3a')]===_0x4834('0x91')){return _0x1fb087[_0x4834('0x28')](_0x49bb85)[_0x4834('0x2e')](_0x4834('0xb8'),_0x4834('0xb9'))['send'](_0x4834('0xba'));}else{return _0x1fb087['status'](_0x49bb85)[_0x4834('0x29')](_0x21801b);}}});})[_0x4834('0x26')](handleError(_0x1fb087,null));};exports['send']=function(_0x4a8b43,_0x23059b,_0x13cc05){var _0x58f05c,_0x2577b5,_0x53ade2;if(_[_0x4834('0x9a')](_0x4a8b43[_0x4834('0x5c')][_0x4834('0x5c')])||_0x4a8b43[_0x4834('0x5c')][_0x4834('0x5c')]===''){throw new db[(_0x4834('0x8a'))][(_0x4834('0x9b'))](_0x4834('0x9c'));}if(_[_0x4834('0x9a')](_0x4a8b43[_0x4834('0x5c')]['to'])){throw new db[(_0x4834('0x8a'))][(_0x4834('0x9b'))](_0x4834('0xbb'));}_0x58f05c=_0x4a8b43[_0x4834('0x5c')]['to'];return db['WhatsappAccount'][_0x4834('0x5d')]({'where':{'id':_0x4a8b43[_0x4834('0x4f')]['id']},'include':[{'model':db[_0x4834('0xa0')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4834('0xa4'),'where':{'mobile':_0x58f05c},'limit':0x1,'order':[['updatedAt',_0x4834('0xbc')]]}]}]})[_0x4834('0x1d')](handleEntityNotFound(_0x23059b,null))['then'](function(_0x397bd4){if(_0x397bd4&&_0x397bd4[_0x4834('0xbd')]){_0x2577b5=_0x397bd4[_0x4834('0x32')]({'plain':!![]});if(_0x2577b5[_0x4834('0xbd')]&&_0x2577b5[_0x4834('0xbd')][_0x4834('0xa4')][_0x4834('0x42')]){return _0x2577b5[_0x4834('0xbd')][_0x4834('0xa4')][0x0];}return db[_0x4834('0x89')][_0x4834('0x5b')](_[_0x4834('0x16')](_0x4a8b43[_0x4834('0x5c')],{'firstName':_0x58f05c,'mobile':_0x58f05c,'phone':_0x58f05c,'ListId':_0x2577b5[_0x4834('0xa1')]}));}})[_0x4834('0x1d')](handleEntityNotFound(_0x23059b,null))[_0x4834('0x1d')](function(_0x53efa4){if(_0x53efa4){_0x53ade2=_0x53efa4;return db['WhatsappInteraction'][_0x4834('0x5d')]({'where':{'ContactId':_0x53ade2['id'],'closed':![],'WhatsappAccountId':_0x2577b5['id']}})['then'](function(_0x5371df){if(_0x5371df){return[_0x5371df,![]];}return db[_0x4834('0xa5')][_0x4834('0x5b')]({'UserId':_0x4a8b43[_0x4834('0x54')]['id'],'ContactId':_0x53ade2['id'],'WhatsappAccountId':_0x2577b5['id'],'phone':_0x58f05c,'firstMsgDirection':'out','Messages':[_[_0x4834('0x48')](_0x4a8b43[_0x4834('0x5c')],{'read':![],'body':_0x4a8b43[_0x4834('0x5c')][_0x4834('0x5c')],'phone':_0x58f05c,'WhatsappAccountId':_0x2577b5['id'],'UserId':_0x4a8b43[_0x4834('0x54')]['id'],'ContactId':_0x53ade2['id']})]},{'include':[{'model':db[_0x4834('0x85')],'as':_0x4834('0xbe')}]})[_0x4834('0x1d')](function(_0x41d38d){return[_0x41d38d,!![]];});});}})['spread'](function(_0x22fa9d,_0x325fe2){if(_0x325fe2){return _0x22fa9d;}return db['WhatsappMessage'][_0x4834('0x5b')](_[_0x4834('0x48')](_0x4a8b43[_0x4834('0x5c')],{'read':![],'body':_0x4a8b43[_0x4834('0x5c')]['body'],'phone':_0x58f05c,'WhatsappAccountId':_0x2577b5['id'],'WhatsappInteractionId':_0x22fa9d['id'],'UserId':_0x4a8b43[_0x4834('0x54')]['id'],'ContactId':_0x53ade2['id']}))['then'](function(_0x196931){_0x22fa9d[_0x4834('0xbf')]['Messages']=[];_0x22fa9d[_0x4834('0xbf')][_0x4834('0xbe')][_0x4834('0xa8')](_0x196931[_0x4834('0xbf')]);return _0x22fa9d;});})[_0x4834('0x1d')](respondWithResult(_0x23059b,null))[_0x4834('0x26')](handleError(_0x23059b,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index f016ec9..9bc400c 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x103e=['exports','events','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x5e6a44,_0x20cf76){var _0x4ae167=function(_0x828b2){while(--_0x828b2){_0x5e6a44['push'](_0x5e6a44['shift']());}};_0x4ae167(++_0x20cf76);}(_0x103e,0xf1));var _0xe103=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x103e[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xe103('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe103('0x1')](0x0);var events={'afterCreate':_0xe103('0x2'),'afterUpdate':'update','afterDestroy':_0xe103('0x3')};function emitEvent(_0x5dc0b9){return function(_0x3f095f,_0x22678e,_0x28c941){WhatsappAccountEvents[_0xe103('0x4')](_0x5dc0b9+':'+_0x3f095f['id'],_0x3f095f);WhatsappAccountEvents[_0xe103('0x4')](_0x5dc0b9,_0x3f095f);_0x28c941(null);};}for(var e in events){if(events[_0xe103('0x5')](e)){var event=events[e];WhatsappAccount[_0xe103('0x6')](e,emitEvent(event));}}module[_0xe103('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xdcb5=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x300277,_0x318be1){var _0x1ac119=function(_0x587f27){while(--_0x587f27){_0x300277['push'](_0x300277['shift']());}};_0x1ac119(++_0x318be1);}(_0xdcb5,0x1a5));var _0x5dcb=function(_0x51b975,_0x572e38){_0x51b975=_0x51b975-0x0;var _0x573df9=_0xdcb5[_0x51b975];return _0x573df9;};'use strict';var EventEmitter=require(_0x5dcb('0x0'));var WhatsappAccount=require(_0x5dcb('0x1'))['db'][_0x5dcb('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5dcb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5dcb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c5f39){return function(_0x51586a,_0x5f2bc9,_0x4ebf59){WhatsappAccountEvents[_0x5dcb('0x5')](_0x1c5f39+':'+_0x51586a['id'],_0x51586a);WhatsappAccountEvents[_0x5dcb('0x5')](_0x1c5f39,_0x51586a);_0x4ebf59(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x5dcb('0x6')](e,emitEvent(event));}}module[_0x5dcb('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 2a49cc6..c9bb61b 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22c0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappAccount','lodash','util'];(function(_0x373b9b,_0x3cee4e){var _0x8c114b=function(_0x495f0e){while(--_0x495f0e){_0x373b9b['push'](_0x373b9b['shift']());}};_0x8c114b(++_0x3cee4e);}(_0x22c0,0x80));var _0x022c=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x22c0[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0x022c('0x0'));var util=require(_0x022c('0x1'));var logger=require(_0x022c('0x2'))(_0x022c('0x3'));var moment=require(_0x022c('0x4'));var BPromise=require(_0x022c('0x5'));var rp=require(_0x022c('0x6'));var fs=require('fs');var path=require(_0x022c('0x7'));var rimraf=require(_0x022c('0x8'));var config=require(_0x022c('0x9'));var attributes=require('./whatsappAccount.attributes');module[_0x022c('0xa')]=function(_0x2bcfbf,_0x2a3f57){return _0x2bcfbf[_0x022c('0xb')](_0x022c('0xc'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2bb=['rimraf','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','moment'];(function(_0x37d7f5,_0x478e72){var _0x582bc7=function(_0x33448f){while(--_0x33448f){_0x37d7f5['push'](_0x37d7f5['shift']());}};_0x582bc7(++_0x478e72);}(_0xc2bb,0x1a4));var _0xbc2b=function(_0x179fd7,_0x298f8a){_0x179fd7=_0x179fd7-0x0;var _0x5a13bd=_0xc2bb[_0x179fd7];return _0x5a13bd;};'use strict';var _=require(_0xbc2b('0x0'));var util=require(_0xbc2b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbc2b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc2b('0x3'));var config=require(_0xbc2b('0x4'));var attributes=require(_0xbc2b('0x5'));module['exports']=function(_0x1295f1,_0x54f41b){return _0x1295f1[_0xbc2b('0x6')](_0xbc2b('0x7'),attributes,{'tableName':_0xbc2b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 2ec156a..281d04a 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb12=['where','attributes','include','map','model','ShowWhatsappAccount','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','find','options','raw'];(function(_0xb7a2fe,_0x2f7de5){var _0x2614ed=function(_0x153d30){while(--_0x153d30){_0xb7a2fe['push'](_0xb7a2fe['shift']());}};_0x2614ed(++_0x2f7de5);}(_0xdb12,0xd2));var _0x2db1=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0xdb12[_0x543c51];return _0x360555;};'use strict';var _=require('lodash');var util=require(_0x2db1('0x0'));var moment=require('moment');var BPromise=require(_0x2db1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2db1('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2db1('0x3'))(_0x2db1('0x4'));var config=require(_0x2db1('0x5'));var jayson=require(_0x2db1('0x6'));var client=jayson[_0x2db1('0x7')][_0x2db1('0x8')]({'port':0x232a});config[_0x2db1('0x9')]=_[_0x2db1('0xa')](config[_0x2db1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2db1('0xb'))(new Redis(config[_0x2db1('0x9')]));require('./whatsappAccount.socket')[_0x2db1('0xc')](socket);function respondWithRpcPromise(_0xda6ce3,_0x482df2,_0x1a526b){return new BPromise(function(_0x484be1,_0x1d028e){return client[_0x2db1('0xd')](_0xda6ce3,_0x1a526b)[_0x2db1('0xe')](function(_0x4fc827){logger[_0x2db1('0xf')](_0x2db1('0x10'),_0x482df2,_0x2db1('0x11'));logger[_0x2db1('0x12')](_0x2db1('0x13'),_0x482df2,_0x2db1('0x11'),JSON[_0x2db1('0x14')](_0x4fc827));if(_0x4fc827['error']){if(_0x4fc827[_0x2db1('0x15')]['code']===0x1f4){logger[_0x2db1('0x15')](_0x2db1('0x10'),_0x482df2,_0x4fc827[_0x2db1('0x15')][_0x2db1('0x16')]);return _0x1d028e(_0x4fc827[_0x2db1('0x15')][_0x2db1('0x16')]);}logger[_0x2db1('0x15')](_0x2db1('0x10'),_0x482df2,_0x4fc827[_0x2db1('0x15')][_0x2db1('0x16')]);return _0x484be1(_0x4fc827[_0x2db1('0x15')]['message']);}else{logger[_0x2db1('0xf')](_0x2db1('0x10'),_0x482df2,_0x2db1('0x11'));_0x484be1(_0x4fc827[_0x2db1('0x17')][_0x2db1('0x16')]);}})[_0x2db1('0x18')](function(_0x4078c9){logger[_0x2db1('0x15')](_0x2db1('0x10'),_0x482df2,_0x4078c9);_0x1d028e(_0x4078c9);});});}exports['ShowWhatsappAccount']=function(_0x1111ad){var _0x254676=this;return new Promise(function(_0x453d64,_0x11c64a){return db['WhatsappAccount'][_0x2db1('0x19')]({'raw':_0x1111ad[_0x2db1('0x1a')]?_0x1111ad[_0x2db1('0x1a')][_0x2db1('0x1b')]===undefined?!![]:![]:!![],'where':_0x1111ad[_0x2db1('0x1a')]?_0x1111ad[_0x2db1('0x1a')][_0x2db1('0x1c')]||null:null,'attributes':_0x1111ad['options']?_0x1111ad[_0x2db1('0x1a')][_0x2db1('0x1d')]||null:null,'include':_0x1111ad[_0x2db1('0x1a')]?_0x1111ad[_0x2db1('0x1a')][_0x2db1('0x1e')]?_[_0x2db1('0x1f')](_0x1111ad['options'][_0x2db1('0x1e')],function(_0x5e9dcb){return{'model':db[_0x5e9dcb[_0x2db1('0x20')]],'as':_0x5e9dcb['as'],'attributes':_0x5e9dcb['attributes'],'include':_0x5e9dcb[_0x2db1('0x1e')]?_[_0x2db1('0x1f')](_0x5e9dcb[_0x2db1('0x1e')],function(_0x394e4b){return{'model':db[_0x394e4b['model']],'as':_0x394e4b['as'],'attributes':_0x394e4b[_0x2db1('0x1d')],'include':_0x394e4b['include']?_['map'](_0x394e4b['include'],function(_0x130d5d){return{'model':db[_0x130d5d[_0x2db1('0x20')]],'as':_0x130d5d['as'],'attributes':_0x130d5d[_0x2db1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2db1('0xe')](function(_0x3f3ce5){logger['info']('ShowWhatsappAccount',_0x1111ad);logger[_0x2db1('0x12')]('ShowWhatsappAccount',_0x1111ad,JSON[_0x2db1('0x14')](_0x3f3ce5));_0x453d64(_0x3f3ce5);})['catch'](function(_0x5a9372){logger['error'](_0x2db1('0x21'),_0x5a9372[_0x2db1('0x16')],_0x1111ad);_0x11c64a(_0x254676[_0x2db1('0x15')](0x1f4,_0x5a9372[_0x2db1('0x16')]));});});}; \ No newline at end of file +var _0xc900=['map','model','include','debug','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes'];(function(_0x5e5d40,_0x39a90f){var _0x47b8eb=function(_0x54ecb9){while(--_0x54ecb9){_0x5e5d40['push'](_0x5e5d40['shift']());}};_0x47b8eb(++_0x39a90f);}(_0xc900,0xb3));var _0x0c90=function(_0x5335da,_0x2db61d){_0x5335da=_0x5335da-0x0;var _0x5ab15b=_0xc900[_0x5335da];return _0x5ab15b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c90('0x0'));var BPromise=require(_0x0c90('0x1'));var rs=require(_0x0c90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c90('0x3'))['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require(_0x0c90('0x6'));var jayson=require(_0x0c90('0x7'));var client=jayson[_0x0c90('0x8')][_0x0c90('0x9')]({'port':0x232a});config[_0x0c90('0xa')]=_['defaults'](config[_0x0c90('0xa')],{'host':_0x0c90('0xb'),'port':0x18eb});var socket=require(_0x0c90('0xc'))(new Redis(config[_0x0c90('0xa')]));require(_0x0c90('0xd'))[_0x0c90('0xe')](socket);function respondWithRpcPromise(_0x313ce9,_0x18d9fd,_0x3e0df6){return new BPromise(function(_0x34456e,_0x10daeb){return client[_0x0c90('0xf')](_0x313ce9,_0x3e0df6)[_0x0c90('0x10')](function(_0x57917b){logger[_0x0c90('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x18d9fd,_0x0c90('0x12'));logger['debug'](_0x0c90('0x13'),_0x18d9fd,_0x0c90('0x12'),JSON[_0x0c90('0x14')](_0x57917b));if(_0x57917b[_0x0c90('0x15')]){if(_0x57917b[_0x0c90('0x15')]['code']===0x1f4){logger[_0x0c90('0x15')](_0x0c90('0x16'),_0x18d9fd,_0x57917b['error'][_0x0c90('0x17')]);return _0x10daeb(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x18d9fd,_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);return _0x34456e(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}else{logger[_0x0c90('0x11')](_0x0c90('0x16'),_0x18d9fd,_0x0c90('0x12'));_0x34456e(_0x57917b['result'][_0x0c90('0x17')]);}})[_0x0c90('0x18')](function(_0x462d49){logger[_0x0c90('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x18d9fd,_0x462d49);_0x10daeb(_0x462d49);});});}exports[_0x0c90('0x19')]=function(_0xd129ca){var _0x143047=this;return new Promise(function(_0x1241a9,_0x315932){return db[_0x0c90('0x1a')]['find']({'raw':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca['options'][_0x0c90('0x1c')]===undefined?!![]:![]:!![],'where':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca['options'][_0x0c90('0x1d')]||null:null,'attributes':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca[_0x0c90('0x1b')][_0x0c90('0x1e')]||null:null,'include':_0xd129ca[_0x0c90('0x1b')]?_0xd129ca[_0x0c90('0x1b')]['include']?_[_0x0c90('0x1f')](_0xd129ca[_0x0c90('0x1b')]['include'],function(_0x54316b){return{'model':db[_0x54316b[_0x0c90('0x20')]],'as':_0x54316b['as'],'attributes':_0x54316b[_0x0c90('0x1e')],'include':_0x54316b[_0x0c90('0x21')]?_[_0x0c90('0x1f')](_0x54316b['include'],function(_0x2dfa14){return{'model':db[_0x2dfa14[_0x0c90('0x20')]],'as':_0x2dfa14['as'],'attributes':_0x2dfa14[_0x0c90('0x1e')],'include':_0x2dfa14[_0x0c90('0x21')]?_[_0x0c90('0x1f')](_0x2dfa14[_0x0c90('0x21')],function(_0x492028){return{'model':db[_0x492028[_0x0c90('0x20')]],'as':_0x492028['as'],'attributes':_0x492028[_0x0c90('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0c90('0x10')](function(_0x13b377){logger['info']('ShowWhatsappAccount',_0xd129ca);logger[_0x0c90('0x22')](_0x0c90('0x19'),_0xd129ca,JSON[_0x0c90('0x14')](_0x13b377));_0x1241a9(_0x13b377);})[_0x0c90('0x18')](function(_0x119e09){logger['error'](_0x0c90('0x19'),_0x119e09[_0x0c90('0x17')],_0xd129ca);_0x315932(_0x143047[_0x0c90('0x15')](0x1f4,_0x119e09['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 2221386..37c7e88 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a71=['remove','emit','removeListener','register','length','./whatsappAccount.events'];(function(_0x4c3296,_0x262566){var _0x5260de=function(_0x2543c6){while(--_0x2543c6){_0x4c3296['push'](_0x4c3296['shift']());}};_0x5260de(++_0x262566);}(_0x8a71,0xf5));var _0x18a7=function(_0x256717,_0x466a25){_0x256717=_0x256717-0x0;var _0x3d7e5a=_0x8a71[_0x256717];return _0x3d7e5a;};'use strict';var WhatsappAccountEvents=require(_0x18a7('0x0'));var events=['save',_0x18a7('0x1'),'update'];function createListener(_0x135138,_0xe641b8){return function(_0x4d44ff){_0xe641b8[_0x18a7('0x2')](_0x135138,_0x4d44ff);};}function removeListener(_0x433903,_0x553771){return function(){WhatsappAccountEvents[_0x18a7('0x3')](_0x433903,_0x553771);};}exports[_0x18a7('0x4')]=function(_0x1b3f13){for(var _0x129ee9=0x0,_0x3b75fb=events[_0x18a7('0x5')];_0x129ee9<_0x3b75fb;_0x129ee9++){var _0x2fda28=events[_0x129ee9];var _0x11eb1a=createListener('whatsappAccount:'+_0x2fda28,_0x1b3f13);WhatsappAccountEvents['on'](_0x2fda28,_0x11eb1a);}}; \ No newline at end of file +var _0x8c7f=['whatsappAccount:','save','remove','emit','removeListener','register','length'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x8c7f,0x9b));var _0xf8c7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8c7f[_0xa464c9];return _0x3d73c4;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xf8c7('0x0'),_0xf8c7('0x1'),'update'];function createListener(_0x56f022,_0x582474){return function(_0x3d0570){_0x582474[_0xf8c7('0x2')](_0x56f022,_0x3d0570);};}function removeListener(_0x4e684c,_0x3a6459){return function(){WhatsappAccountEvents[_0xf8c7('0x3')](_0x4e684c,_0x3a6459);};}exports[_0xf8c7('0x4')]=function(_0x2d08f4){for(var _0x567abb=0x0,_0x2f4339=events[_0xf8c7('0x5')];_0x567abb<_0x2f4339;_0x567abb++){var _0x33bf48=events[_0x567abb];var _0xbfd32c=createListener(_0xf8c7('0x6')+_0x33bf48,_0x2d08f4);WhatsappAccountEvents['on'](_0x33bf48,_0xbfd32c);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index d2843d3..c332d5c 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02a6=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index'];(function(_0x15b679,_0x2896c2){var _0x497c7f=function(_0x589dcf){while(--_0x589dcf){_0x15b679['push'](_0x15b679['shift']());}};_0x497c7f(++_0x2896c2);}(_0x02a6,0xbc));var _0x602a=function(_0x5e8f97,_0x15989b){_0x5e8f97=_0x5e8f97-0x0;var _0x1ae2f0=_0x02a6[_0x5e8f97];return _0x1ae2f0;};'use strict';var multer=require(_0x602a('0x0'));var util=require(_0x602a('0x1'));var path=require(_0x602a('0x2'));var timeout=require('connect-timeout');var express=require(_0x602a('0x3'));var router=express[_0x602a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x602a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x602a('0x6'));var controller=require(_0x602a('0x7'));router['get']('/',auth[_0x602a('0x8')](),controller[_0x602a('0x9')]);router['get'](_0x602a('0xa'),auth['isAuthenticated'](),controller[_0x602a('0xb')]);router[_0x602a('0xc')]('/',auth[_0x602a('0x8')](),controller[_0x602a('0xd')]);router[_0x602a('0xe')](_0x602a('0xa'),auth['isAuthenticated'](),controller[_0x602a('0xf')]);router[_0x602a('0x10')](_0x602a('0xa'),auth[_0x602a('0x8')](),controller[_0x602a('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2f3a=['index','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x60ae51,_0x2efeec){var _0x4bcec8=function(_0x18fcba){while(--_0x18fcba){_0x60ae51['push'](_0x60ae51['shift']());}};_0x4bcec8(++_0x2efeec);}(_0x2f3a,0x134));var _0xa2f3=function(_0x3ef883,_0xa223e4){_0x3ef883=_0x3ef883-0x0;var _0x4dbfd1=_0x2f3a[_0x3ef883];return _0x4dbfd1;};'use strict';var multer=require(_0xa2f3('0x0'));var util=require(_0xa2f3('0x1'));var path=require(_0xa2f3('0x2'));var timeout=require(_0xa2f3('0x3'));var express=require(_0xa2f3('0x4'));var router=express[_0xa2f3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa2f3('0x6'));var interaction=require(_0xa2f3('0x7'));var config=require(_0xa2f3('0x8'));var controller=require(_0xa2f3('0x9'));router[_0xa2f3('0xa')]('/',auth[_0xa2f3('0xb')](),controller[_0xa2f3('0xc')]);router['get'](_0xa2f3('0xd'),auth[_0xa2f3('0xb')](),controller[_0xa2f3('0xe')]);router[_0xa2f3('0xf')]('/',auth[_0xa2f3('0xb')](),controller['create']);router[_0xa2f3('0x10')](_0xa2f3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa2f3('0x11')](_0xa2f3('0xd'),auth['isAuthenticated'](),controller[_0xa2f3('0x12')]);module[_0xa2f3('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 18f4bd1..1e5fe31 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc46b=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x2b3fe1,_0x5b6191){var _0x47e2e4=function(_0x57f78a){while(--_0x57f78a){_0x2b3fe1['push'](_0x2b3fe1['shift']());}};_0x47e2e4(++_0x5b6191);}(_0xc46b,0x97));var _0xbc46=function(_0x5626a7,_0x2ecd02){_0x5626a7=_0x5626a7-0x0;var _0x2c0b87=_0xc46b[_0x5626a7];return _0x2c0b87;};'use strict';var Sequelize=require(_0xbc46('0x0'));module[_0xbc46('0x1')]={'priority':{'type':Sequelize[_0xbc46('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbc46('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbc46('0x4')]()},'description':{'type':Sequelize[_0xbc46('0x3')]},'interval':{'type':Sequelize[_0xbc46('0x3')],'defaultValue':_0xbc46('0x5')}}; \ No newline at end of file +var _0xce97=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0xce97,0x1b9));var _0x7ce9=function(_0x46cd42,_0x2e5f56){_0x46cd42=_0x46cd42-0x0;var _0x4c47c1=_0xce97[_0x46cd42];return _0x4c47c1;};'use strict';var Sequelize=require('sequelize');module[_0x7ce9('0x0')]={'priority':{'type':Sequelize[_0x7ce9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7ce9('0x2')],'allowNull':![],'defaultValue':_0x7ce9('0x3')},'appdata':{'type':Sequelize[_0x7ce9('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7ce9('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index cdf3b8d..5b975be 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa56=['undefined','count','limit','Content-Range','reject','save','update','sendStatus','stack','send','index','map','WhatsappApplication','fieldName','type','key','model','name','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset'];(function(_0x32905d,_0x2ed18c){var _0x2c3f12=function(_0x2a478b){while(--_0x2a478b){_0x32905d['push'](_0x32905d['shift']());}};_0x2c3f12(++_0x2ed18c);}(_0xaa56,0xc6));var _0x6aa5=function(_0x53f949,_0x4e529b){_0x53f949=_0x53f949-0x0;var _0x264799=_0xaa56[_0x53f949];return _0x264799;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6aa5('0x0'));var zipdir=require(_0x6aa5('0x1'));var jsonpatch=require(_0x6aa5('0x2'));var rp=require('request-promise');var moment=require(_0x6aa5('0x3'));var BPromise=require(_0x6aa5('0x4'));var Mustache=require(_0x6aa5('0x5'));var util=require(_0x6aa5('0x6'));var path=require(_0x6aa5('0x7'));var sox=require('sox');var csv=require(_0x6aa5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6aa5('0x9'));var _=require(_0x6aa5('0xa'));var squel=require('squel');var crypto=require(_0x6aa5('0xb'));var jsforce=require(_0x6aa5('0xc'));var deskjs=require(_0x6aa5('0xd'));var toCsv=require(_0x6aa5('0x8'));var querystring=require(_0x6aa5('0xe'));var Papa=require(_0x6aa5('0xf'));var Redis=require(_0x6aa5('0x10'));var authService=require(_0x6aa5('0x11'));var qs=require(_0x6aa5('0x12'));var as=require(_0x6aa5('0x13'));var hardwareService=require(_0x6aa5('0x14'));var logger=require(_0x6aa5('0x15'))(_0x6aa5('0x16'));var utils=require(_0x6aa5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6aa5('0x18'));var db=require(_0x6aa5('0x19'))['db'];function respondWithStatusCode(_0x12cfc9,_0x4625fc){_0x4625fc=_0x4625fc||0xcc;return function(_0x4a0aa7){if(_0x4a0aa7){return _0x12cfc9['sendStatus'](_0x4625fc);}return _0x12cfc9['status'](_0x4625fc)[_0x6aa5('0x1a')]();};}function respondWithResult(_0xc0f48e,_0x1173b1){_0x1173b1=_0x1173b1||0xc8;return function(_0x52c335){if(_0x52c335){return _0xc0f48e[_0x6aa5('0x1b')](_0x1173b1)[_0x6aa5('0x1c')](_0x52c335);}};}function respondWithFilteredResult(_0x56268b,_0x3f8dc1){return function(_0x34e4cd){if(_0x34e4cd){var _0x223e7e=typeof _0x3f8dc1[_0x6aa5('0x1d')]==='undefined'&&typeof _0x3f8dc1['limit']===_0x6aa5('0x1e');var _0x56cb7b=_0x34e4cd[_0x6aa5('0x1f')];var _0xea319d=_0x223e7e?0x0:_0x3f8dc1['offset'];var _0x556494=_0x223e7e?_0x34e4cd[_0x6aa5('0x1f')]:_0x3f8dc1[_0x6aa5('0x1d')]+_0x3f8dc1[_0x6aa5('0x20')];var _0x4bbd75;if(_0x556494>=_0x56cb7b){_0x556494=_0x56cb7b;_0x4bbd75=0xc8;}else{_0x4bbd75=0xce;}_0x56268b[_0x6aa5('0x1b')](_0x4bbd75);return _0x56268b['set'](_0x6aa5('0x21'),_0xea319d+'-'+_0x556494+'/'+_0x56cb7b)[_0x6aa5('0x1c')](_0x34e4cd);}return null;};}function patchUpdates(_0x161dc8){return function(_0xaa4e6c){try{jsonpatch['apply'](_0xaa4e6c,_0x161dc8,!![]);}catch(_0x2faeb8){return BPromise[_0x6aa5('0x22')](_0x2faeb8);}return _0xaa4e6c[_0x6aa5('0x23')]();};}function saveUpdates(_0x3aeaed,_0x16234b){return function(_0x523963){if(_0x523963){return _0x523963[_0x6aa5('0x24')](_0x3aeaed)['then'](function(_0x22100b){return _0x22100b;});}return null;};}function removeEntity(_0x5f3b34,_0xd967a4){return function(_0x2e347f){if(_0x2e347f){return _0x2e347f['destroy']()['then'](function(){_0x5f3b34[_0x6aa5('0x1b')](0xcc)[_0x6aa5('0x1a')]();});}};}function handleEntityNotFound(_0x533512,_0x2d46f8){return function(_0xfdc370){if(!_0xfdc370){_0x533512[_0x6aa5('0x25')](0x194);}return _0xfdc370;};}function handleError(_0x4c39b2,_0x2c4e0f){_0x2c4e0f=_0x2c4e0f||0x1f4;return function(_0xa55c2f){logger['error'](_0xa55c2f[_0x6aa5('0x26')]);if(_0xa55c2f['name']){delete _0xa55c2f['name'];}_0x4c39b2[_0x6aa5('0x1b')](_0x2c4e0f)[_0x6aa5('0x27')](_0xa55c2f);};}exports[_0x6aa5('0x28')]=function(_0x4fcac4,_0x36127c){var _0x5996f4={},_0x1aca20={},_0x590f48={'count':0x0,'rows':[]};var _0x49bec1=_[_0x6aa5('0x29')](db[_0x6aa5('0x2a')]['rawAttributes'],function(_0x26c45d){return{'name':_0x26c45d[_0x6aa5('0x2b')],'type':_0x26c45d[_0x6aa5('0x2c')][_0x6aa5('0x2d')]};});_0x1aca20[_0x6aa5('0x2e')]=_[_0x6aa5('0x29')](_0x49bec1,_0x6aa5('0x2f'));_0x1aca20['query']=_[_0x6aa5('0x30')](_0x4fcac4[_0x6aa5('0x31')]);_0x1aca20[_0x6aa5('0x32')]=_['intersection'](_0x1aca20[_0x6aa5('0x2e')],_0x1aca20[_0x6aa5('0x31')]);_0x5996f4[_0x6aa5('0x33')]=_[_0x6aa5('0x34')](_0x1aca20[_0x6aa5('0x2e')],qs[_0x6aa5('0x35')](_0x4fcac4[_0x6aa5('0x31')][_0x6aa5('0x35')]));_0x5996f4[_0x6aa5('0x33')]=_0x5996f4[_0x6aa5('0x33')][_0x6aa5('0x36')]?_0x5996f4['attributes']:_0x1aca20[_0x6aa5('0x2e')];if(!_0x4fcac4[_0x6aa5('0x31')]['hasOwnProperty'](_0x6aa5('0x37'))){_0x5996f4[_0x6aa5('0x20')]=qs[_0x6aa5('0x20')](_0x4fcac4['query'][_0x6aa5('0x20')]);_0x5996f4[_0x6aa5('0x1d')]=qs[_0x6aa5('0x1d')](_0x4fcac4[_0x6aa5('0x31')][_0x6aa5('0x1d')]);}_0x5996f4[_0x6aa5('0x38')]=qs[_0x6aa5('0x39')](_0x4fcac4[_0x6aa5('0x31')][_0x6aa5('0x39')]);_0x5996f4[_0x6aa5('0x3a')]=qs['filters'](_[_0x6aa5('0x3b')](_0x4fcac4[_0x6aa5('0x31')],_0x1aca20[_0x6aa5('0x32')]),_0x49bec1);if(_0x4fcac4[_0x6aa5('0x31')][_0x6aa5('0x3c')]){_0x5996f4[_0x6aa5('0x3a')]=_[_0x6aa5('0x3d')](_0x5996f4[_0x6aa5('0x3a')],{'$or':_[_0x6aa5('0x29')](_0x49bec1,function(_0x1c5d37){if(_0x1c5d37['type']!=='VIRTUAL'){var _0x190b8d={};_0x190b8d[_0x1c5d37[_0x6aa5('0x2f')]]={'$like':'%'+_0x4fcac4['query']['filter']+'%'};return _0x190b8d;}})});}_0x5996f4=_[_0x6aa5('0x3d')]({},_0x5996f4,_0x4fcac4[_0x6aa5('0x3e')]);var _0x2821b8={'where':_0x5996f4[_0x6aa5('0x3a')]};return db['WhatsappApplication']['count'](_0x2821b8)[_0x6aa5('0x3f')](function(_0x34be10){_0x590f48[_0x6aa5('0x1f')]=_0x34be10;if(_0x4fcac4[_0x6aa5('0x31')][_0x6aa5('0x40')]){_0x5996f4[_0x6aa5('0x41')]=[{'all':!![]}];}return db[_0x6aa5('0x2a')][_0x6aa5('0x42')](_0x5996f4);})['then'](function(_0x196d5c){_0x590f48[_0x6aa5('0x43')]=_0x196d5c;return _0x590f48;})['then'](respondWithFilteredResult(_0x36127c,_0x5996f4))[_0x6aa5('0x44')](handleError(_0x36127c,null));};exports[_0x6aa5('0x45')]=function(_0x5415b7,_0x3917a4){var _0xac783a={'raw':!![],'where':{'id':_0x5415b7[_0x6aa5('0x46')]['id']}},_0x1fd652={};_0x1fd652[_0x6aa5('0x2e')]=_[_0x6aa5('0x30')](db[_0x6aa5('0x2a')][_0x6aa5('0x47')]);_0x1fd652[_0x6aa5('0x31')]=_['keys'](_0x5415b7[_0x6aa5('0x31')]);_0x1fd652['filters']=_[_0x6aa5('0x34')](_0x1fd652[_0x6aa5('0x2e')],_0x1fd652['query']);_0xac783a[_0x6aa5('0x33')]=_['intersection'](_0x1fd652[_0x6aa5('0x2e')],qs[_0x6aa5('0x35')](_0x5415b7[_0x6aa5('0x31')][_0x6aa5('0x35')]));_0xac783a[_0x6aa5('0x33')]=_0xac783a[_0x6aa5('0x33')][_0x6aa5('0x36')]?_0xac783a[_0x6aa5('0x33')]:_0x1fd652[_0x6aa5('0x2e')];if(_0x5415b7[_0x6aa5('0x31')][_0x6aa5('0x40')]){_0xac783a['include']=[{'all':!![]}];}_0xac783a=_[_0x6aa5('0x3d')]({},_0xac783a,_0x5415b7[_0x6aa5('0x3e')]);return db[_0x6aa5('0x2a')][_0x6aa5('0x48')](_0xac783a)[_0x6aa5('0x3f')](handleEntityNotFound(_0x3917a4,null))[_0x6aa5('0x3f')](respondWithResult(_0x3917a4,null))[_0x6aa5('0x44')](handleError(_0x3917a4,null));};exports[_0x6aa5('0x49')]=function(_0x3c6f1f,_0xb8766){return db[_0x6aa5('0x2a')][_0x6aa5('0x49')](_0x3c6f1f[_0x6aa5('0x4a')],{})[_0x6aa5('0x3f')](respondWithResult(_0xb8766,0xc9))['catch'](handleError(_0xb8766,null));};exports['update']=function(_0x3edabc,_0xc2c6df){if(_0x3edabc[_0x6aa5('0x4a')]['id']){delete _0x3edabc[_0x6aa5('0x4a')]['id'];}return db[_0x6aa5('0x2a')][_0x6aa5('0x48')]({'where':{'id':_0x3edabc['params']['id']}})[_0x6aa5('0x3f')](handleEntityNotFound(_0xc2c6df,null))['then'](saveUpdates(_0x3edabc[_0x6aa5('0x4a')],null))[_0x6aa5('0x3f')](respondWithResult(_0xc2c6df,null))['catch'](handleError(_0xc2c6df,null));};exports[_0x6aa5('0x4b')]=function(_0x3bdc0f,_0x93cade){return db[_0x6aa5('0x2a')]['find']({'where':{'id':_0x3bdc0f['params']['id']}})[_0x6aa5('0x3f')](handleEntityNotFound(_0x93cade,null))['then'](removeEntity(_0x93cade,null))[_0x6aa5('0x44')](handleError(_0x93cade,null));}; \ No newline at end of file +var _0x505d=['options','includeAll','include','findAll','rows','catch','show','params','WhatsappApplication','keys','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x505d,0x93));var _0xd505=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x505d[_0x16629d];return _0x56ccee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd505('0x0'));var jsonpatch=require(_0xd505('0x1'));var rp=require(_0xd505('0x2'));var moment=require(_0xd505('0x3'));var BPromise=require(_0xd505('0x4'));var Mustache=require('mustache');var util=require(_0xd505('0x5'));var path=require(_0xd505('0x6'));var sox=require(_0xd505('0x7'));var csv=require(_0xd505('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd505('0x9'));var _=require('lodash');var squel=require(_0xd505('0xa'));var crypto=require(_0xd505('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd505('0xc'));var toCsv=require(_0xd505('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd505('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd505('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd505('0xf'));var logger=require('../../config/logger')(_0xd505('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd505('0x11'))['db'];function respondWithStatusCode(_0x52eafa,_0x477f1b){_0x477f1b=_0x477f1b||0xcc;return function(_0x2a292e){if(_0x2a292e){return _0x52eafa['sendStatus'](_0x477f1b);}return _0x52eafa['status'](_0x477f1b)[_0xd505('0x12')]();};}function respondWithResult(_0x39cd89,_0x5d8433){_0x5d8433=_0x5d8433||0xc8;return function(_0x29d0ad){if(_0x29d0ad){return _0x39cd89[_0xd505('0x13')](_0x5d8433)[_0xd505('0x14')](_0x29d0ad);}};}function respondWithFilteredResult(_0x366df6,_0x1052da){return function(_0x20088a){if(_0x20088a){var _0x50e8d2=typeof _0x1052da[_0xd505('0x15')]===_0xd505('0x16')&&typeof _0x1052da[_0xd505('0x17')]==='undefined';var _0x244126=_0x20088a['count'];var _0x561c71=_0x50e8d2?0x0:_0x1052da[_0xd505('0x15')];var _0x52401f=_0x50e8d2?_0x20088a[_0xd505('0x18')]:_0x1052da[_0xd505('0x15')]+_0x1052da[_0xd505('0x17')];var _0x8d42e4;if(_0x52401f>=_0x244126){_0x52401f=_0x244126;_0x8d42e4=0xc8;}else{_0x8d42e4=0xce;}_0x366df6[_0xd505('0x13')](_0x8d42e4);return _0x366df6['set'](_0xd505('0x19'),_0x561c71+'-'+_0x52401f+'/'+_0x244126)[_0xd505('0x14')](_0x20088a);}return null;};}function patchUpdates(_0x5229d2){return function(_0x5ccf7e){try{jsonpatch['apply'](_0x5ccf7e,_0x5229d2,!![]);}catch(_0x24acdb){return BPromise[_0xd505('0x1a')](_0x24acdb);}return _0x5ccf7e['save']();};}function saveUpdates(_0x24c9d6,_0x570d6a){return function(_0x5bdd88){if(_0x5bdd88){return _0x5bdd88[_0xd505('0x1b')](_0x24c9d6)[_0xd505('0x1c')](function(_0x574a7c){return _0x574a7c;});}return null;};}function removeEntity(_0x4118c5,_0x50ebfa){return function(_0x4e885b){if(_0x4e885b){return _0x4e885b[_0xd505('0x1d')]()[_0xd505('0x1c')](function(){_0x4118c5[_0xd505('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f1839,_0x404784){return function(_0x5e4317){if(!_0x5e4317){_0x4f1839['sendStatus'](0x194);}return _0x5e4317;};}function handleError(_0xe66be4,_0x16be66){_0x16be66=_0x16be66||0x1f4;return function(_0xeb2af1){logger[_0xd505('0x1e')](_0xeb2af1[_0xd505('0x1f')]);if(_0xeb2af1[_0xd505('0x20')]){delete _0xeb2af1[_0xd505('0x20')];}_0xe66be4['status'](_0x16be66)[_0xd505('0x21')](_0xeb2af1);};}exports[_0xd505('0x22')]=function(_0x311533,_0x3a58d4){var _0x5894b2={},_0x2d8d67={},_0x38867e={'count':0x0,'rows':[]};var _0x5db0da=_['map'](db['WhatsappApplication'][_0xd505('0x23')],function(_0x3effd7){return{'name':_0x3effd7[_0xd505('0x24')],'type':_0x3effd7['type'][_0xd505('0x25')]};});_0x2d8d67['model']=_[_0xd505('0x26')](_0x5db0da,_0xd505('0x20'));_0x2d8d67[_0xd505('0x27')]=_['keys'](_0x311533[_0xd505('0x27')]);_0x2d8d67[_0xd505('0x28')]=_['intersection'](_0x2d8d67[_0xd505('0x29')],_0x2d8d67[_0xd505('0x27')]);_0x5894b2[_0xd505('0x2a')]=_[_0xd505('0x2b')](_0x2d8d67['model'],qs['fields'](_0x311533[_0xd505('0x27')][_0xd505('0x2c')]));_0x5894b2[_0xd505('0x2a')]=_0x5894b2[_0xd505('0x2a')][_0xd505('0x2d')]?_0x5894b2[_0xd505('0x2a')]:_0x2d8d67['model'];if(!_0x311533[_0xd505('0x27')]['hasOwnProperty'](_0xd505('0x2e'))){_0x5894b2['limit']=qs[_0xd505('0x17')](_0x311533[_0xd505('0x27')][_0xd505('0x17')]);_0x5894b2[_0xd505('0x15')]=qs[_0xd505('0x15')](_0x311533[_0xd505('0x27')][_0xd505('0x15')]);}_0x5894b2[_0xd505('0x2f')]=qs['sort'](_0x311533['query'][_0xd505('0x30')]);_0x5894b2[_0xd505('0x31')]=qs[_0xd505('0x28')](_['pick'](_0x311533[_0xd505('0x27')],_0x2d8d67[_0xd505('0x28')]),_0x5db0da);if(_0x311533[_0xd505('0x27')][_0xd505('0x32')]){_0x5894b2[_0xd505('0x31')]=_[_0xd505('0x33')](_0x5894b2[_0xd505('0x31')],{'$or':_[_0xd505('0x26')](_0x5db0da,function(_0x57228d){if(_0x57228d[_0xd505('0x34')]!==_0xd505('0x35')){var _0x2dd461={};_0x2dd461[_0x57228d['name']]={'$like':'%'+_0x311533[_0xd505('0x27')][_0xd505('0x32')]+'%'};return _0x2dd461;}})});}_0x5894b2=_['merge']({},_0x5894b2,_0x311533[_0xd505('0x36')]);var _0x146b4c={'where':_0x5894b2[_0xd505('0x31')]};return db['WhatsappApplication'][_0xd505('0x18')](_0x146b4c)[_0xd505('0x1c')](function(_0xff0027){_0x38867e[_0xd505('0x18')]=_0xff0027;if(_0x311533[_0xd505('0x27')][_0xd505('0x37')]){_0x5894b2[_0xd505('0x38')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xd505('0x39')](_0x5894b2);})[_0xd505('0x1c')](function(_0x58cd22){_0x38867e[_0xd505('0x3a')]=_0x58cd22;return _0x38867e;})[_0xd505('0x1c')](respondWithFilteredResult(_0x3a58d4,_0x5894b2))[_0xd505('0x3b')](handleError(_0x3a58d4,null));};exports[_0xd505('0x3c')]=function(_0x96ee7,_0x32849d){var _0x55d9ef={'raw':!![],'where':{'id':_0x96ee7[_0xd505('0x3d')]['id']}},_0x530113={};_0x530113[_0xd505('0x29')]=_['keys'](db[_0xd505('0x3e')][_0xd505('0x23')]);_0x530113['query']=_[_0xd505('0x3f')](_0x96ee7[_0xd505('0x27')]);_0x530113[_0xd505('0x28')]=_[_0xd505('0x2b')](_0x530113[_0xd505('0x29')],_0x530113[_0xd505('0x27')]);_0x55d9ef[_0xd505('0x2a')]=_[_0xd505('0x2b')](_0x530113['model'],qs[_0xd505('0x2c')](_0x96ee7[_0xd505('0x27')][_0xd505('0x2c')]));_0x55d9ef[_0xd505('0x2a')]=_0x55d9ef[_0xd505('0x2a')][_0xd505('0x2d')]?_0x55d9ef['attributes']:_0x530113['model'];if(_0x96ee7['query']['includeAll']){_0x55d9ef[_0xd505('0x38')]=[{'all':!![]}];}_0x55d9ef=_[_0xd505('0x33')]({},_0x55d9ef,_0x96ee7['options']);return db[_0xd505('0x3e')][_0xd505('0x40')](_0x55d9ef)[_0xd505('0x1c')](handleEntityNotFound(_0x32849d,null))['then'](respondWithResult(_0x32849d,null))['catch'](handleError(_0x32849d,null));};exports[_0xd505('0x41')]=function(_0x2c62a9,_0x4b66ee){return db['WhatsappApplication']['create'](_0x2c62a9[_0xd505('0x42')],{})['then'](respondWithResult(_0x4b66ee,0xc9))[_0xd505('0x3b')](handleError(_0x4b66ee,null));};exports[_0xd505('0x1b')]=function(_0x1d8f7f,_0x16212e){if(_0x1d8f7f[_0xd505('0x42')]['id']){delete _0x1d8f7f[_0xd505('0x42')]['id'];}return db[_0xd505('0x3e')]['find']({'where':{'id':_0x1d8f7f[_0xd505('0x3d')]['id']}})[_0xd505('0x1c')](handleEntityNotFound(_0x16212e,null))[_0xd505('0x1c')](saveUpdates(_0x1d8f7f['body'],null))[_0xd505('0x1c')](respondWithResult(_0x16212e,null))['catch'](handleError(_0x16212e,null));};exports[_0xd505('0x1d')]=function(_0x18a0cb,_0x19cd38){return db['WhatsappApplication'][_0xd505('0x40')]({'where':{'id':_0x18a0cb['params']['id']}})[_0xd505('0x1c')](handleEntityNotFound(_0x19cd38,null))[_0xd505('0x1c')](removeEntity(_0x19cd38,null))[_0xd505('0x3b')](handleError(_0x19cd38,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7f44c4f..e1e98a3 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34153a,_0x307b44){var _0xaa529e=function(_0x2b20f5){while(--_0x2b20f5){_0x34153a['push'](_0x34153a['shift']());}};_0xaa529e(++_0x307b44);}(_0xedd9,0xfc));var _0x9edd=function(_0x47ea9f,_0x2d6ac5){_0x47ea9f=_0x47ea9f-0x0;var _0xe7e0e0=_0xedd9[_0x47ea9f];return _0xe7e0e0;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9edd('0xb'),'collate':_0x9edd('0xc')});}; \ No newline at end of file +var _0x7579=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','whatsapp_applications'];(function(_0x38f9ec,_0x430eae){var _0x47c433=function(_0x37e340){while(--_0x37e340){_0x38f9ec['push'](_0x38f9ec['shift']());}};_0x47c433(++_0x430eae);}(_0x7579,0x1e2));var _0x9757=function(_0x1c8498,_0x38fd62){_0x1c8498=_0x1c8498-0x0;var _0x4be50b=_0x7579[_0x1c8498];return _0x4be50b;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var logger=require(_0x9757('0x2'))(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var BPromise=require(_0x9757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9757('0x6'));var rimraf=require(_0x9757('0x7'));var config=require(_0x9757('0x8'));var attributes=require(_0x9757('0x9'));module['exports']=function(_0x2aede4,_0x80e411){return _0x2aede4[_0x9757('0xa')]('WhatsappApplication',attributes,{'tableName':_0x9757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9757('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index c7c2e19..a3b1dde 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0bb=['debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x632465,_0x3c08b){var _0x5d1950=function(_0x1e5269){while(--_0x1e5269){_0x632465['push'](_0x632465['shift']());}};_0x5d1950(++_0x3c08b);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x59cf0b,_0x53707a){_0x59cf0b=_0x59cf0b-0x0;var _0x51b771=_0xd0bb[_0x59cf0b];return _0x51b771;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37c205,_0x809599,_0x5eb975){return new BPromise(function(_0x2a4075,_0x4533ff){return client[_0xbd0b('0xa')](_0x37c205,_0x5eb975)[_0xbd0b('0xb')](function(_0x16e185){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'));logger[_0xbd0b('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'),JSON[_0xbd0b('0xe')](_0x16e185));if(_0x16e185['error']){if(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x10')]===0x1f4){logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);return _0x4533ff(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);}logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')]['message']);return _0x2a4075(_0x16e185[_0xbd0b('0xf')]['message']);}else{logger['info'](_0xbd0b('0x11'),_0x809599,_0xbd0b('0xc'));_0x2a4075(_0x16e185[_0xbd0b('0x13')][_0xbd0b('0x12')]);}})[_0xbd0b('0x14')](function(_0x546db3){logger['error'](_0xbd0b('0x11'),_0x809599,_0x546db3);_0x4533ff(_0x546db3);});});} \ No newline at end of file +var _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x7bae[_0x5416db];return _0x243e35;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 11fe7df..7a0faa4 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x236d=['../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1654ad,_0x510205){var _0x48ec82=function(_0x3e2ca4){while(--_0x3e2ca4){_0x1654ad['push'](_0x1654ad['shift']());}};_0x48ec82(++_0x510205);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var path=require('path');var timeout=require(_0xd236('0x2'));var express=require('express');var router=express[_0xd236('0x3')]();var fs_extra=require(_0xd236('0x4'));var auth=require(_0xd236('0x5'));var interaction=require(_0xd236('0x6'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0xd236('0x7')]('/',auth[_0xd236('0x8')](),controller[_0xd236('0x9')]);router[_0xd236('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd236('0xa')]);router[_0xd236('0x7')]('/:id',auth[_0xd236('0x8')](),controller[_0xd236('0xb')]);router['get'](_0xd236('0xc'),auth[_0xd236('0x8')](),controller[_0xd236('0xd')]);router['get'](_0xd236('0xe'),auth[_0xd236('0x8')](),controller[_0xd236('0xf')]);router['post']('/',auth[_0xd236('0x8')](),controller[_0xd236('0x10')]);router[_0xd236('0x11')](_0xd236('0xc'),auth[_0xd236('0x8')](),controller[_0xd236('0x12')]);router[_0xd236('0x11')](_0xd236('0x13'),auth[_0xd236('0x8')](),interaction[_0xd236('0x14')](_0xd236('0x15'),_0xd236('0x16')),controller[_0xd236('0x17')]);router[_0xd236('0x18')](_0xd236('0x19'),auth[_0xd236('0x8')](),interaction[_0xd236('0x14')](_0xd236('0x15'),_0xd236('0x1a')),controller[_0xd236('0x1b')]);router['delete']('/:id',auth[_0xd236('0x8')](),interaction[_0xd236('0x14')]('whatsapp',_0xd236('0x1c')),controller[_0xd236('0x1d')]);router[_0xd236('0x1e')]('/:id/tags',auth[_0xd236('0x8')](),controller[_0xd236('0x1f')]);module[_0xd236('0x20')]=router; \ No newline at end of file +var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/messages','/:id/download','download','create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','multer'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0x7da7,0x10d));var _0x77da=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x7da7[_0x15b380];return _0x232c5c;};'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 fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x77da('0x7')]('/',auth[_0x77da('0x8')](),controller['index']);router[_0x77da('0x7')]('/describe',auth[_0x77da('0x8')](),controller[_0x77da('0x9')]);router[_0x77da('0x7')](_0x77da('0xa'),auth[_0x77da('0x8')](),controller['show']);router[_0x77da('0x7')](_0x77da('0xb'),auth[_0x77da('0x8')](),controller['getMessages']);router[_0x77da('0x7')](_0x77da('0xc'),auth[_0x77da('0x8')](),controller[_0x77da('0xd')]);router['post']('/',auth[_0x77da('0x8')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0x77da('0x10')]);router[_0x77da('0xf')]('/:id/tags',auth[_0x77da('0x8')](),interaction[_0x77da('0x11')](_0x77da('0x12'),_0x77da('0x13')),controller['addTags']);router[_0x77da('0x14')]('/:id',auth[_0x77da('0x8')](),interaction[_0x77da('0x11')](_0x77da('0x12'),_0x77da('0x15')),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x77da('0x11')](_0x77da('0x12'),_0x77da('0x16')),controller[_0x77da('0x17')]);router[_0x77da('0x18')](_0x77da('0x19'),auth[_0x77da('0x8')](),controller[_0x77da('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index d6bfaf9..7d688c0 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe198=['moment','DATE','STRING','ENUM','out','BOOLEAN','sequelize'];(function(_0x2140b0,_0x1e1c0b){var _0x4dfef0=function(_0x20fc64){while(--_0x20fc64){_0x2140b0['push'](_0x2140b0['shift']());}};_0x4dfef0(++_0x1e1c0b);}(_0xe198,0x6f));var _0x8e19=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe198[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x8e19('0x0'));var moment=require(_0x8e19('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8e19('0x2')]},'disposition':{'type':Sequelize[_0x8e19('0x3')]},'secondDisposition':{'type':Sequelize[_0x8e19('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8e19('0x3')]},'note':{'type':Sequelize[_0x8e19('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8e19('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x8e19('0x4')]('in',_0x8e19('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8e19('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8e19('0x4')]('in',_0x8e19('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8e19('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x0c42=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3ab50e,_0x47e224){var _0x2be961=function(_0xe92d85){while(--_0xe92d85){_0x3ab50e['push'](_0x3ab50e['shift']());}};_0x2be961(++_0x47e224);}(_0x0c42,0x191));var _0x20c4=function(_0x3bf2cb,_0x50cbe9){_0x3bf2cb=_0x3bf2cb-0x0;var _0x5abedd=_0x0c42[_0x3bf2cb];return _0x5abedd;};'use strict';var Sequelize=require(_0x20c4('0x0'));var moment=require(_0x20c4('0x1'));module[_0x20c4('0x2')]={'closed':{'type':Sequelize[_0x20c4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20c4('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x20c4('0x5')]},'note':{'type':Sequelize[_0x20c4('0x5')]},'phone':{'type':Sequelize[_0x20c4('0x5')]},'read1stAt':{'type':Sequelize[_0x20c4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x20c4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x20c4('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x20c4('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index c675816..b5b672b 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6334=['../../config/environment','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','key','findAll','whatsapp','query','catch','show','params','model','keys','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','update','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','filters','pick','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','color','emit','removeTags','download','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','fullname','get','mkdirSync','N.A.','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','secret','value','renderFile','views','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api'];(function(_0x4cd2e5,_0x275db7){var _0x45be01=function(_0x1da33c){while(--_0x1da33c){_0x4cd2e5['push'](_0x4cd2e5['shift']());}};_0x45be01(++_0x275db7);}(_0x6334,0x168));var _0x4633=function(_0x34412f,_0x116bea){_0x34412f=_0x34412f-0x0;var _0x4b4b5a=_0x6334[_0x34412f];return _0x4b4b5a;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4633('0x0'));var moment=require(_0x4633('0x1'));var BPromise=require(_0x4633('0x2'));var util=require(_0x4633('0x3'));var path=require(_0x4633('0x4'));var ejs=require(_0x4633('0x5'));var fs=require('fs');var _=require(_0x4633('0x6'));var Redis=require(_0x4633('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x4633('0x8'));var pdf=require(_0x4633('0x9'));var logger=require(_0x4633('0xa'))(_0x4633('0xb'));var config=require(_0x4633('0xc'));var db=require(_0x4633('0xd'))['db'];config[_0x4633('0xe')]=_['defaults'](config[_0x4633('0xe')],{'host':_0x4633('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4633('0xe')]));require(_0x4633('0x10'))[_0x4633('0x11')](socket);function respondWithStatusCode(_0x5778f9,_0x55c622){_0x55c622=_0x55c622||0xcc;return function(_0x224f3b){if(_0x224f3b){return _0x5778f9[_0x4633('0x12')](_0x55c622);}return _0x5778f9[_0x4633('0x13')](_0x55c622)[_0x4633('0x14')]();};}function respondWithResult(_0x196054,_0x2340b3){_0x2340b3=_0x2340b3||0xc8;return function(_0x25f426){if(_0x25f426){return _0x196054[_0x4633('0x13')](_0x2340b3)[_0x4633('0x15')](_0x25f426);}};}function respondWithFilteredResult(_0x587c17,_0x19a89c){return function(_0x32a8d4){if(_0x32a8d4){var _0x35d1bd=typeof _0x19a89c[_0x4633('0x16')]===_0x4633('0x17')&&typeof _0x19a89c[_0x4633('0x18')]===_0x4633('0x17');var _0x43365e=_0x32a8d4[_0x4633('0x19')];var _0xac7758=_0x35d1bd?0x0:_0x19a89c[_0x4633('0x16')];var _0x16eb01=_0x35d1bd?_0x32a8d4['count']:_0x19a89c[_0x4633('0x16')]+_0x19a89c[_0x4633('0x18')];var _0x114960;if(_0x16eb01>=_0x43365e){_0x16eb01=_0x43365e;_0x114960=0xc8;}else{_0x114960=0xce;}_0x587c17[_0x4633('0x13')](_0x114960);return _0x587c17[_0x4633('0x1a')](_0x4633('0x1b'),_0xac7758+'-'+_0x16eb01+'/'+_0x43365e)[_0x4633('0x15')](_0x32a8d4);}return null;};}function saveUpdates(_0x495bf3){return function(_0x131f88){if(_0x131f88){return _0x131f88['update'](_0x495bf3)[_0x4633('0x1c')](function(_0x686372){return _0x686372;});}return null;};}function removeEntity(_0x53a7ad){return function(_0x548739){if(_0x548739){return _0x548739[_0x4633('0x1d')]()['then'](function(){_0x53a7ad['status'](0xcc)[_0x4633('0x14')]();});}};}function handleEntityNotFound(_0x5ef00f){return function(_0x3868c1){if(!_0x3868c1){_0x5ef00f[_0x4633('0x12')](0x194);}return _0x3868c1;};}function handleError(_0xc40abb,_0x2e4b3b){_0x2e4b3b=_0x2e4b3b||0x1f4;return function(_0x19e75d){logger[_0x4633('0x1e')](_0x19e75d[_0x4633('0x1f')]);if(_0x19e75d[_0x4633('0x20')]){delete _0x19e75d[_0x4633('0x20')];}_0xc40abb['status'](_0x2e4b3b)[_0x4633('0x21')](_0x19e75d);};}exports[_0x4633('0x22')]=function(_0x17d319,_0x5ede9a){var _0x382d71={};var _0x562939=_[_0x4633('0x23')](db[_0x4633('0x24')][_0x4633('0x25')],function(_0x348f21){return{'name':_0x348f21[_0x4633('0x26')],'type':_0x348f21['type'][_0x4633('0x27')]};});_0x382d71=qs['getOptions'](_0x562939,_0x17d319);return interaction[_0x4633('0x28')](_0x4633('0x29'),_0x17d319[_0x4633('0x2a')],_0x17d319['user'],_0x382d71,_0x562939)[_0x4633('0x1c')](respondWithFilteredResult(_0x5ede9a,_0x382d71))[_0x4633('0x2b')](handleError(_0x5ede9a,null));};exports[_0x4633('0x2c')]=function(_0x88801a,_0x476908){var _0x3dac85={'raw':![],'where':{'id':_0x88801a[_0x4633('0x2d')]['id']}},_0x2f25b2={};_0x2f25b2[_0x4633('0x2e')]=_[_0x4633('0x2f')](db[_0x4633('0x24')][_0x4633('0x25')]);_0x2f25b2[_0x4633('0x2a')]=_[_0x4633('0x2f')](_0x88801a[_0x4633('0x2a')]);_0x2f25b2['filters']=_[_0x4633('0x30')](_0x2f25b2[_0x4633('0x2e')],_0x2f25b2[_0x4633('0x2a')]);_0x3dac85['attributes']=_[_0x4633('0x30')](_0x2f25b2['model'],qs[_0x4633('0x31')](_0x88801a[_0x4633('0x2a')][_0x4633('0x31')]));_0x3dac85[_0x4633('0x32')]=_0x3dac85[_0x4633('0x32')]['length']?_0x3dac85[_0x4633('0x32')]:_0x2f25b2[_0x4633('0x2e')];if(_0x88801a[_0x4633('0x2a')][_0x4633('0x33')]){_0x3dac85[_0x4633('0x34')]=[{'all':!![]}];}_0x3dac85=_[_0x4633('0x35')]({},_0x3dac85,_0x88801a[_0x4633('0x36')]);return db[_0x4633('0x24')][_0x4633('0x37')](_0x3dac85)[_0x4633('0x1c')](handleEntityNotFound(_0x476908,null))['then'](respondWithResult(_0x476908,null))['catch'](handleError(_0x476908,null));};exports[_0x4633('0x38')]=function(_0x209bf7,_0x23ebc3){return db[_0x4633('0x24')][_0x4633('0x38')](_0x209bf7[_0x4633('0x39')],{})['then'](respondWithResult(_0x23ebc3,0xc9))[_0x4633('0x2b')](handleError(_0x23ebc3,null));};exports[_0x4633('0x3a')]=function(_0x3ceac4,_0x4df5c3){if(_0x3ceac4[_0x4633('0x39')]['id']){delete _0x3ceac4[_0x4633('0x39')]['id'];}return db['WhatsappInteraction'][_0x4633('0x37')]({'where':{'id':_0x3ceac4[_0x4633('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4df5c3,null))[_0x4633('0x1c')](saveUpdates(_0x3ceac4[_0x4633('0x39')],null))['then'](respondWithResult(_0x4df5c3,null))[_0x4633('0x2b')](handleError(_0x4df5c3,null));};exports['destroy']=function(_0x3d46b0,_0x472273){return db[_0x4633('0x24')][_0x4633('0x37')]({'where':{'id':_0x3d46b0[_0x4633('0x2d')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x472273,null))[_0x4633('0x1c')](removeEntity(_0x472273,null))[_0x4633('0x2b')](handleError(_0x472273,null));};exports['describe']=function(_0x9ffaf3,_0x3a7898){return db[_0x4633('0x24')]['describe']()[_0x4633('0x1c')](respondWithResult(_0x3a7898,null))[_0x4633('0x2b')](handleError(_0x3a7898,null));};exports[_0x4633('0x3b')]=function(_0x519259,_0x5a2411){return db[_0x4633('0x3c')][_0x4633('0x37')]({'where':{'id':_0x519259[_0x4633('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5a2411,null))['then'](function(_0x36dc48){if(_0x36dc48){return _0x36dc48[_0x4633('0x3b')](_0x519259[_0x4633('0x39')][_0x4633('0x3d')],_[_0x4633('0x3e')](_0x519259[_0x4633('0x39')],[_0x4633('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x5a2411,null))[_0x4633('0x2b')](handleError(_0x5a2411,null));};exports[_0x4633('0x3f')]=function(_0xd1f6c9,_0x27737b){var _0x18545a={'raw':![],'where':{}};var _0x17318b={};var _0x3e0dcd={'count':0x0,'rows':[]};return db[_0x4633('0x24')][_0x4633('0x40')]({'where':{'id':_0xd1f6c9['params']['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x27737b,null))[_0x4633('0x1c')](function(_0x30b707){if(_0x30b707){_0x17318b['model']=_[_0x4633('0x2f')](db[_0x4633('0x3c')][_0x4633('0x25')]);_0x17318b[_0x4633('0x2a')]=_[_0x4633('0x2f')](_0xd1f6c9[_0x4633('0x2a')]);_0x17318b['filters']=_[_0x4633('0x30')](_0x17318b[_0x4633('0x2e')],_0x17318b['query']);_0x18545a['attributes']=_[_0x4633('0x30')](_0x17318b[_0x4633('0x2e')],qs[_0x4633('0x31')](_0xd1f6c9[_0x4633('0x2a')][_0x4633('0x31')]));_0x18545a[_0x4633('0x32')]=_0x18545a[_0x4633('0x32')]['length']?_0x18545a[_0x4633('0x32')]:_0x17318b[_0x4633('0x2e')];if(!_0xd1f6c9[_0x4633('0x2a')][_0x4633('0x41')](_0x4633('0x42'))){_0x18545a['limit']=qs[_0x4633('0x18')](_0xd1f6c9['query'][_0x4633('0x18')]);_0x18545a[_0x4633('0x16')]=qs[_0x4633('0x16')](_0xd1f6c9[_0x4633('0x2a')][_0x4633('0x16')]);}_0x18545a['order']=qs['sort'](_0xd1f6c9['query']['sort']);_0x18545a['where']=qs[_0x4633('0x43')](_[_0x4633('0x44')](_0xd1f6c9[_0x4633('0x2a')],_0x17318b[_0x4633('0x43')]));_0x18545a[_0x4633('0x45')][_0x4633('0x46')]=_0x30b707['id'];if(_0xd1f6c9['query'][_0x4633('0x47')]){_0x18545a[_0x4633('0x45')]=_[_0x4633('0x35')](_0x18545a[_0x4633('0x45')],{'$or':_[_0x4633('0x23')](_0x18545a[_0x4633('0x32')],function(_0x3bea1b){var _0x4e3556={};_0x4e3556[_0x3bea1b]={'$like':'%'+_0xd1f6c9[_0x4633('0x2a')][_0x4633('0x47')]+'%'};return _0x4e3556;})});}if(_0xd1f6c9[_0x4633('0x2a')]['$gte']){var _0x266d39=_0xd1f6c9[_0x4633('0x2a')][_0x4633('0x48')][_0x4633('0x49')](',');var _0x31d237={};_0x31d237[_0x266d39[0x0]]={'$gte':moment(_0x266d39[0x1])[_0x4633('0x4a')](_0x4633('0x4b'))};_0x18545a[_0x4633('0x45')]=_[_0x4633('0x35')](_0x18545a[_0x4633('0x45')],_0x31d237);}_0x18545a=_['merge']({},_0x18545a,_0xd1f6c9['options']);return db[_0x4633('0x3c')][_0x4633('0x19')]({'where':_0x18545a[_0x4633('0x45')]})[_0x4633('0x1c')](function(_0x11827b){_0x3e0dcd[_0x4633('0x19')]=_0x11827b;if(_0xd1f6c9['query'][_0x4633('0x33')]){_0x18545a[_0x4633('0x34')]=[{'all':!![]}];}return db[_0x4633('0x3c')]['findAll'](_0x18545a);})[_0x4633('0x1c')](function(_0x5e7fcd){_0x3e0dcd['rows']=_0x5e7fcd;return _0x3e0dcd;});}})[_0x4633('0x1c')](respondWithFilteredResult(_0x27737b,_0x18545a))['catch'](handleError(_0x27737b,null));};exports[_0x4633('0x4c')]=function(_0x347b49,_0x1b36e3){return db[_0x4633('0x24')][_0x4633('0x37')]({'where':{'id':_0x347b49[_0x4633('0x2d')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x1b36e3,null))[_0x4633('0x1c')](function(_0x5d9739){if(_0x5d9739){return _0x5d9739['setTags'](_0x347b49[_0x4633('0x39')]['ids'],_[_0x4633('0x3e')](_0x347b49['body'],[_0x4633('0x3d'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x4633('0x20'),_0x4633('0x4d')],'where':{'id':_0x347b49[_0x4633('0x39')][_0x4633('0x3d')]}});})[_0x4633('0x1c')](function(_0x29aa73){socket[_0x4633('0x4e')]('whatsappInteractionTags:save',{'id':Number(_0x347b49[_0x4633('0x2d')]['id']),'tags':_0x29aa73||[]});return{'id':Number(_0x347b49[_0x4633('0x2d')]['id']),'tags':_0x29aa73||[]};});}})[_0x4633('0x1c')](respondWithResult(_0x1b36e3,null))['catch'](handleError(_0x1b36e3,null));};exports[_0x4633('0x4f')]=function(_0x30ea67,_0x412446){return db[_0x4633('0x24')][_0x4633('0x37')]({'where':{'id':_0x30ea67['params']['id']}})['then'](handleEntityNotFound(_0x412446,null))[_0x4633('0x1c')](function(_0x22bec3){if(_0x22bec3){return _0x22bec3[_0x4633('0x4f')](_0x30ea67[_0x4633('0x2a')][_0x4633('0x3d')]);}})['then'](respondWithStatusCode(_0x412446,null))[_0x4633('0x2b')](handleError(_0x412446,null));};exports[_0x4633('0x50')]=function(_0x1b4282,_0x5e4dce){var _0xa76d25=moment()['unix']()[_0x4633('0x51')]();var _0x4c58e0=path[_0x4633('0x52')](config[_0x4633('0x53')],_0x4633('0x54'),_0x4633('0x55'),'tmp');var _0x15bbf5=path[_0x4633('0x52')](config['root'],_0x4633('0x54'),_0x4633('0x55'),_0x4633('0x56'));var _0x4a65aa=path[_0x4633('0x52')](_0x4c58e0,_0xa76d25);var _0x2b977e=util[_0x4633('0x4a')](_0x4633('0x57'),_0x1b4282[_0x4633('0x2d')]['id'],_0xa76d25);var _0x1bef31=path[_0x4633('0x52')](_0x4c58e0,_0x2b977e);var _0x21f971=[];_0x21f971[_0x4633('0x58')]({'model':db[_0x4633('0x59')],'as':_0x4633('0x59'),'attributes':['id','fullname'],'raw':!![]});_0x21f971[_0x4633('0x58')]({'model':db[_0x4633('0x5a')],'as':_0x4633('0x5b'),'attributes':['id',_0x4633('0x5c'),'lastName'],'raw':!![]});if(_0x1b4282['query']['attachments']){_0x21f971[_0x4633('0x58')]({'model':db[_0x4633('0x5d')],'as':_0x4633('0x5d'),'raw':!![]});}var _0x46d557=[{'model':db['WhatsappMessage'],'as':_0x4633('0x5e'),'attributes':['id',_0x4633('0x39'),_0x4633('0x5f'),_0x4633('0x60'),'secret',_0x4633('0x61')],'include':_0x21f971}];_0x46d557[_0x4633('0x58')]({'model':db[_0x4633('0x62')],'as':_0x4633('0x63'),'attributes':['id',_0x4633('0x20')]});_0x46d557['push']({'model':db[_0x4633('0x59')],'as':_0x4633('0x64'),'attributes':['id',_0x4633('0x65')]});return db['WhatsappInteraction'][_0x4633('0x37')]({'where':{'id':_0x1b4282[_0x4633('0x2d')]['id']},'include':_0x46d557})[_0x4633('0x1c')](handleEntityNotFound(_0x5e4dce,null))[_0x4633('0x1c')](function(_0x49d1d3){if(_0x49d1d3){var _0x5dcf31=_0x49d1d3[_0x4633('0x66')]({'plain':!![]});fs[_0x4633('0x67')](_0x4a65aa);var _0x82ec88={'channel':'Whatsapp','account':_0x5dcf31[_0x4633('0x63')]['name'],'agent':_0x5dcf31[_0x4633('0x64')]?_0x5dcf31[_0x4633('0x64')]['fullname']:_0x4633('0x68'),'createdAt':moment(_0x5dcf31[_0x4633('0x5f')])['format'](_0x4633('0x4b'))[_0x4633('0x51')](),'closedAt':_0x5dcf31['closed']?moment(_0x5dcf31[_0x4633('0x69')])[_0x4633('0x4a')](_0x4633('0x4b'))[_0x4633('0x51')]():'','disposition':_0x5dcf31['disposition'],'messages':_(_0x5dcf31[_0x4633('0x5e')])[_0x4633('0x47')]({'secret':![]})[_0x4633('0x23')](function(_0x5bed3d){if(_0x5bed3d[_0x4633('0x5d')]){var _0x1bd452=path[_0x4633('0x52')](_0x15bbf5,_0x5bed3d[_0x4633('0x5d')][_0x4633('0x6a')]);if(fs[_0x4633('0x6b')](_0x1bd452)){fs[_0x4633('0x6c')](_0x1bd452)[_0x4633('0x6d')](fs[_0x4633('0x6e')](path[_0x4633('0x52')](_0x4a65aa,_0x5bed3d['Attachment']['basename'])));}}return{'date':moment(_0x5bed3d[_0x4633('0x5f')])[_0x4633('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x5bed3d['direction']===_0x4633('0x6f')?_0x5bed3d[_0x4633('0x59')]?_0x5bed3d[_0x4633('0x59')][_0x4633('0x65')]:_0x4633('0x70'):_0x5bed3d[_0x4633('0x5b')]['firstName']+(_0x5bed3d[_0x4633('0x5b')]['lastName']?'\x20'+_0x5bed3d[_0x4633('0x5b')][_0x4633('0x71')]:''),'body':_0x5bed3d[_0x4633('0x5d')]?_0x5bed3d[_0x4633('0x5d')]['basename']:_0x5bed3d[_0x4633('0x39')],'direction':_0x5bed3d[_0x4633('0x60')]==='out'?'A':'C','secret':_0x5bed3d[_0x4633('0x72')],'read':_0x5bed3d[_0x4633('0x61')],'attachment':_0x5bed3d[_0x4633('0x5d')]};})[_0x4633('0x73')]()};return ejs[_0x4633('0x74')](path[_0x4633('0x52')](config[_0x4633('0x53')],_0x4633('0x54'),_0x4633('0x75'),'downloadInteraction.ejs'),{'interaction':_0x82ec88})[_0x4633('0x1c')](function(_0x50919a){var _0x10c719=path[_0x4633('0x52')](_0x4a65aa,'transcript-'+_0x5dcf31['id']+'-'+_0xa76d25+_0x4633('0x76'));var _0x23d7a9={'path':_0x10c719,'channel':_0x4633('0x77'),'interactionId':_0x5dcf31['id']};return pdf[_0x4633('0x78')](_0x50919a,_0x23d7a9);})[_0x4633('0x1c')](function(){return new BPromise(function(_0x5aec8d,_0x27714c){zipdir(_0x4a65aa,{'saveTo':_0x1bef31},function(_0x2c150c,_0x1bf46f){if(_0x2c150c)return _0x27714c(_0x2c150c);return _0x5aec8d(_0x1bf46f);});})[_0x4633('0x1c')](function(){return new BPromise(function(_0x7fed8d,_0x60b69d){rimraf(_0x4a65aa,function(_0x10883f){if(_0x10883f)_0x60b69d(_0x10883f);return _0x7fed8d();});});})['then'](function(){return _0x5e4dce['download'](_0x1bef31,_0x2b977e,function(_0x431386){if(_0x431386){console[_0x4633('0x79')](_0x4633('0x7a'),_0x431386);}else{fs[_0x4633('0x7b')](_0x1bef31);}});});});}else{return _0x5e4dce['sendStatus'](0xc8);}})[_0x4633('0x2b')](handleError(_0x5e4dce,null));}; \ No newline at end of file +var _0xfa68=['basename','System','lastName','out','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','log','err','unlinkSync','rimraf','moment','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','localhost','redis','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','params','model','keys','filters','attributes','fields','length','includeAll','merge','options','create','body','find','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','intersection','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','split','format','include','rows','setTags','spread','Tag','emit','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','User','push','CmContact','Contact','firstName','Attachment','direction','read','Owner','fullname','get','mkdirSync','Whatsapp','Account','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','existsSync','pipe','createWriteStream'];(function(_0x2883d7,_0x27b5a1){var _0x57312a=function(_0x5ab377){while(--_0x5ab377){_0x2883d7['push'](_0x2883d7['shift']());}};_0x57312a(++_0x27b5a1);}(_0xfa68,0x10b));var _0x8fa6=function(_0x21d1f2,_0x16342b){_0x21d1f2=_0x21d1f2-0x0;var _0x2f6b31=_0xfa68[_0x21d1f2];return _0x2f6b31;};'use strict';var rimraf=require(_0x8fa6('0x0'));var zipdir=require('zip-dir');var moment=require(_0x8fa6('0x1'));var BPromise=require('bluebird');var util=require(_0x8fa6('0x2'));var path=require(_0x8fa6('0x3'));var ejs=require(_0x8fa6('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x8fa6('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x8fa6('0x6'));var pdf=require(_0x8fa6('0x7'));var logger=require('../../config/logger')(_0x8fa6('0x8'));var config=require(_0x8fa6('0x9'));var db=require(_0x8fa6('0xa'))['db'];config['redis']=_[_0x8fa6('0xb')](config['redis'],{'host':_0x8fa6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8fa6('0xd')]));require(_0x8fa6('0xe'))[_0x8fa6('0xf')](socket);function respondWithStatusCode(_0x1d7a3c,_0x2d41c4){_0x2d41c4=_0x2d41c4||0xcc;return function(_0x10a6b9){if(_0x10a6b9){return _0x1d7a3c['sendStatus'](_0x2d41c4);}return _0x1d7a3c[_0x8fa6('0x10')](_0x2d41c4)[_0x8fa6('0x11')]();};}function respondWithResult(_0xd09087,_0x45fa59){_0x45fa59=_0x45fa59||0xc8;return function(_0x2daed4){if(_0x2daed4){return _0xd09087['status'](_0x45fa59)[_0x8fa6('0x12')](_0x2daed4);}};}function respondWithFilteredResult(_0x11a519,_0x33e625){return function(_0x129055){if(_0x129055){var _0x4f5fb9=typeof _0x33e625[_0x8fa6('0x13')]===_0x8fa6('0x14')&&typeof _0x33e625[_0x8fa6('0x15')]==='undefined';var _0x529854=_0x129055[_0x8fa6('0x16')];var _0x395ec8=_0x4f5fb9?0x0:_0x33e625[_0x8fa6('0x13')];var _0x2a3a6a=_0x4f5fb9?_0x129055[_0x8fa6('0x16')]:_0x33e625[_0x8fa6('0x13')]+_0x33e625[_0x8fa6('0x15')];var _0x299be8;if(_0x2a3a6a>=_0x529854){_0x2a3a6a=_0x529854;_0x299be8=0xc8;}else{_0x299be8=0xce;}_0x11a519[_0x8fa6('0x10')](_0x299be8);return _0x11a519[_0x8fa6('0x17')](_0x8fa6('0x18'),_0x395ec8+'-'+_0x2a3a6a+'/'+_0x529854)['json'](_0x129055);}return null;};}function saveUpdates(_0x532556){return function(_0x3a43b8){if(_0x3a43b8){return _0x3a43b8[_0x8fa6('0x19')](_0x532556)[_0x8fa6('0x1a')](function(_0x2b5047){return _0x2b5047;});}return null;};}function removeEntity(_0x35f9f8){return function(_0x327e26){if(_0x327e26){return _0x327e26[_0x8fa6('0x1b')]()[_0x8fa6('0x1a')](function(){_0x35f9f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d9d9){return function(_0x364959){if(!_0x364959){_0x46d9d9[_0x8fa6('0x1c')](0x194);}return _0x364959;};}function handleError(_0x4933f9,_0x22ecd4){_0x22ecd4=_0x22ecd4||0x1f4;return function(_0x4b05ef){logger[_0x8fa6('0x1d')](_0x4b05ef[_0x8fa6('0x1e')]);if(_0x4b05ef[_0x8fa6('0x1f')]){delete _0x4b05ef['name'];}_0x4933f9[_0x8fa6('0x10')](_0x22ecd4)[_0x8fa6('0x20')](_0x4b05ef);};}exports[_0x8fa6('0x21')]=function(_0x1e21e7,_0x3e66e0){var _0x2affb1={};var _0x5d9155=_[_0x8fa6('0x22')](db[_0x8fa6('0x23')][_0x8fa6('0x24')],function(_0x4cae2e){return{'name':_0x4cae2e[_0x8fa6('0x25')],'type':_0x4cae2e[_0x8fa6('0x26')][_0x8fa6('0x27')]};});_0x2affb1=qs[_0x8fa6('0x28')](_0x5d9155,_0x1e21e7);return interaction[_0x8fa6('0x29')]('whatsapp',_0x1e21e7[_0x8fa6('0x2a')],_0x1e21e7[_0x8fa6('0x2b')],_0x2affb1,_0x5d9155)['then'](respondWithFilteredResult(_0x3e66e0,_0x2affb1))[_0x8fa6('0x2c')](handleError(_0x3e66e0,null));};exports['show']=function(_0x5bf6a9,_0x13a987){var _0x7b9f7f={'raw':![],'where':{'id':_0x5bf6a9[_0x8fa6('0x2d')]['id']}},_0x3b4496={};_0x3b4496[_0x8fa6('0x2e')]=_['keys'](db[_0x8fa6('0x23')][_0x8fa6('0x24')]);_0x3b4496['query']=_[_0x8fa6('0x2f')](_0x5bf6a9[_0x8fa6('0x2a')]);_0x3b4496[_0x8fa6('0x30')]=_['intersection'](_0x3b4496[_0x8fa6('0x2e')],_0x3b4496[_0x8fa6('0x2a')]);_0x7b9f7f[_0x8fa6('0x31')]=_['intersection'](_0x3b4496[_0x8fa6('0x2e')],qs[_0x8fa6('0x32')](_0x5bf6a9[_0x8fa6('0x2a')][_0x8fa6('0x32')]));_0x7b9f7f[_0x8fa6('0x31')]=_0x7b9f7f[_0x8fa6('0x31')][_0x8fa6('0x33')]?_0x7b9f7f[_0x8fa6('0x31')]:_0x3b4496[_0x8fa6('0x2e')];if(_0x5bf6a9[_0x8fa6('0x2a')][_0x8fa6('0x34')]){_0x7b9f7f['include']=[{'all':!![]}];}_0x7b9f7f=_[_0x8fa6('0x35')]({},_0x7b9f7f,_0x5bf6a9[_0x8fa6('0x36')]);return db[_0x8fa6('0x23')]['find'](_0x7b9f7f)[_0x8fa6('0x1a')](handleEntityNotFound(_0x13a987,null))[_0x8fa6('0x1a')](respondWithResult(_0x13a987,null))[_0x8fa6('0x2c')](handleError(_0x13a987,null));};exports[_0x8fa6('0x37')]=function(_0x19f5e5,_0x3564c7){return db[_0x8fa6('0x23')][_0x8fa6('0x37')](_0x19f5e5[_0x8fa6('0x38')],{})[_0x8fa6('0x1a')](respondWithResult(_0x3564c7,0xc9))[_0x8fa6('0x2c')](handleError(_0x3564c7,null));};exports[_0x8fa6('0x19')]=function(_0x41ae65,_0x42d3f5){if(_0x41ae65[_0x8fa6('0x38')]['id']){delete _0x41ae65['body']['id'];}return db[_0x8fa6('0x23')][_0x8fa6('0x39')]({'where':{'id':_0x41ae65[_0x8fa6('0x2d')]['id']}})[_0x8fa6('0x1a')](handleEntityNotFound(_0x42d3f5,null))['then'](saveUpdates(_0x41ae65[_0x8fa6('0x38')],null))['then'](respondWithResult(_0x42d3f5,null))['catch'](handleError(_0x42d3f5,null));};exports['destroy']=function(_0x4d1940,_0x48970d){return db[_0x8fa6('0x23')][_0x8fa6('0x39')]({'where':{'id':_0x4d1940[_0x8fa6('0x2d')]['id']}})[_0x8fa6('0x1a')](handleEntityNotFound(_0x48970d,null))[_0x8fa6('0x1a')](removeEntity(_0x48970d,null))[_0x8fa6('0x2c')](handleError(_0x48970d,null));};exports['describe']=function(_0xa12396,_0xd61016){return db['WhatsappInteraction'][_0x8fa6('0x3a')]()['then'](respondWithResult(_0xd61016,null))[_0x8fa6('0x2c')](handleError(_0xd61016,null));};exports[_0x8fa6('0x3b')]=function(_0x254fb1,_0x26349f){return db[_0x8fa6('0x3c')][_0x8fa6('0x39')]({'where':{'id':_0x254fb1[_0x8fa6('0x2d')]['id']}})[_0x8fa6('0x1a')](handleEntityNotFound(_0x26349f,null))[_0x8fa6('0x1a')](function(_0x55cb4e){if(_0x55cb4e){return _0x55cb4e[_0x8fa6('0x3b')](_0x254fb1[_0x8fa6('0x38')]['ids'],_[_0x8fa6('0x3d')](_0x254fb1[_0x8fa6('0x38')],[_0x8fa6('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x26349f,null))[_0x8fa6('0x2c')](handleError(_0x26349f,null));};exports[_0x8fa6('0x3f')]=function(_0x4cfbd6,_0x18370e){var _0x3249a8={'raw':![],'where':{}};var _0x1303dc={};var _0x3fe019={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x8fa6('0x40')]({'where':{'id':_0x4cfbd6[_0x8fa6('0x2d')]['id']}})['then'](handleEntityNotFound(_0x18370e,null))[_0x8fa6('0x1a')](function(_0x4b3f13){if(_0x4b3f13){_0x1303dc[_0x8fa6('0x2e')]=_['keys'](db[_0x8fa6('0x3c')][_0x8fa6('0x24')]);_0x1303dc['query']=_[_0x8fa6('0x2f')](_0x4cfbd6[_0x8fa6('0x2a')]);_0x1303dc['filters']=_[_0x8fa6('0x41')](_0x1303dc['model'],_0x1303dc[_0x8fa6('0x2a')]);_0x3249a8[_0x8fa6('0x31')]=_[_0x8fa6('0x41')](_0x1303dc[_0x8fa6('0x2e')],qs['fields'](_0x4cfbd6[_0x8fa6('0x2a')][_0x8fa6('0x32')]));_0x3249a8[_0x8fa6('0x31')]=_0x3249a8['attributes'][_0x8fa6('0x33')]?_0x3249a8[_0x8fa6('0x31')]:_0x1303dc[_0x8fa6('0x2e')];if(!_0x4cfbd6[_0x8fa6('0x2a')][_0x8fa6('0x42')](_0x8fa6('0x43'))){_0x3249a8[_0x8fa6('0x15')]=qs[_0x8fa6('0x15')](_0x4cfbd6[_0x8fa6('0x2a')]['limit']);_0x3249a8[_0x8fa6('0x13')]=qs[_0x8fa6('0x13')](_0x4cfbd6[_0x8fa6('0x2a')]['offset']);}_0x3249a8[_0x8fa6('0x44')]=qs[_0x8fa6('0x45')](_0x4cfbd6[_0x8fa6('0x2a')]['sort']);_0x3249a8[_0x8fa6('0x46')]=qs[_0x8fa6('0x30')](_['pick'](_0x4cfbd6[_0x8fa6('0x2a')],_0x1303dc[_0x8fa6('0x30')]));_0x3249a8[_0x8fa6('0x46')][_0x8fa6('0x47')]=_0x4b3f13['id'];if(_0x4cfbd6[_0x8fa6('0x2a')][_0x8fa6('0x48')]){_0x3249a8[_0x8fa6('0x46')]=_[_0x8fa6('0x35')](_0x3249a8[_0x8fa6('0x46')],{'$or':_[_0x8fa6('0x22')](_0x3249a8[_0x8fa6('0x31')],function(_0x12f3c8){var _0x59c4f7={};_0x59c4f7[_0x12f3c8]={'$like':'%'+_0x4cfbd6[_0x8fa6('0x2a')][_0x8fa6('0x48')]+'%'};return _0x59c4f7;})});}if(_0x4cfbd6['query'][_0x8fa6('0x49')]){var _0x273dcc=_0x4cfbd6[_0x8fa6('0x2a')][_0x8fa6('0x49')][_0x8fa6('0x4a')](',');var _0x58d3b8={};_0x58d3b8[_0x273dcc[0x0]]={'$gte':moment(_0x273dcc[0x1])[_0x8fa6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3249a8[_0x8fa6('0x46')]=_[_0x8fa6('0x35')](_0x3249a8[_0x8fa6('0x46')],_0x58d3b8);}_0x3249a8=_['merge']({},_0x3249a8,_0x4cfbd6[_0x8fa6('0x36')]);return db[_0x8fa6('0x3c')][_0x8fa6('0x16')]({'where':_0x3249a8[_0x8fa6('0x46')]})[_0x8fa6('0x1a')](function(_0x1017fd){_0x3fe019[_0x8fa6('0x16')]=_0x1017fd;if(_0x4cfbd6['query']['includeAll']){_0x3249a8[_0x8fa6('0x4c')]=[{'all':!![]}];}return db[_0x8fa6('0x3c')][_0x8fa6('0x29')](_0x3249a8);})[_0x8fa6('0x1a')](function(_0x5cd614){_0x3fe019[_0x8fa6('0x4d')]=_0x5cd614;return _0x3fe019;});}})['then'](respondWithFilteredResult(_0x18370e,_0x3249a8))[_0x8fa6('0x2c')](handleError(_0x18370e,null));};exports['addTags']=function(_0x3ee08d,_0x3da303){return db[_0x8fa6('0x23')]['find']({'where':{'id':_0x3ee08d['params']['id']}})[_0x8fa6('0x1a')](handleEntityNotFound(_0x3da303,null))[_0x8fa6('0x1a')](function(_0x394777){if(_0x394777){return _0x394777[_0x8fa6('0x4e')](_0x3ee08d[_0x8fa6('0x38')][_0x8fa6('0x3e')],_['omit'](_0x3ee08d['body'],['ids','id'])||{})[_0x8fa6('0x4f')](function(){return db[_0x8fa6('0x50')][_0x8fa6('0x29')]({'attributes':['id',_0x8fa6('0x1f'),'color'],'where':{'id':_0x3ee08d['body'][_0x8fa6('0x3e')]}});})[_0x8fa6('0x1a')](function(_0x29bdba){socket[_0x8fa6('0x51')]('whatsappInteractionTags:save',{'id':Number(_0x3ee08d['params']['id']),'tags':_0x29bdba||[]});return{'id':Number(_0x3ee08d[_0x8fa6('0x2d')]['id']),'tags':_0x29bdba||[]};});}})['then'](respondWithResult(_0x3da303,null))[_0x8fa6('0x2c')](handleError(_0x3da303,null));};exports[_0x8fa6('0x52')]=function(_0x48389c,_0x1b40dd){return db[_0x8fa6('0x23')]['find']({'where':{'id':_0x48389c['params']['id']}})[_0x8fa6('0x1a')](handleEntityNotFound(_0x1b40dd,null))['then'](function(_0x59147a){if(_0x59147a){return _0x59147a[_0x8fa6('0x52')](_0x48389c[_0x8fa6('0x2a')][_0x8fa6('0x3e')]);}})[_0x8fa6('0x1a')](respondWithStatusCode(_0x1b40dd,null))[_0x8fa6('0x2c')](handleError(_0x1b40dd,null));};exports[_0x8fa6('0x53')]=function(_0x48636b,_0x5d7bba){var _0x1b71ea=moment()[_0x8fa6('0x54')]()[_0x8fa6('0x55')]();var _0x17b323=path[_0x8fa6('0x56')](config[_0x8fa6('0x57')],_0x8fa6('0x58'),_0x8fa6('0x59'),_0x8fa6('0x5a'));var _0x43ee3c=path[_0x8fa6('0x56')](config[_0x8fa6('0x57')],'server','files',_0x8fa6('0x5b'));var _0x18fbad=path[_0x8fa6('0x56')](_0x17b323,_0x1b71ea);var _0x2d8400=util[_0x8fa6('0x4b')]('transcript-%d-%s.zip',_0x48636b[_0x8fa6('0x2d')]['id'],_0x1b71ea);var _0x19443a=path['join'](_0x17b323,_0x2d8400);var _0x29fb9a=[];_0x29fb9a['push']({'model':db[_0x8fa6('0x5c')],'as':_0x8fa6('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x29fb9a[_0x8fa6('0x5d')]({'model':db[_0x8fa6('0x5e')],'as':_0x8fa6('0x5f'),'attributes':['id',_0x8fa6('0x60'),'lastName'],'raw':!![]});if(_0x48636b[_0x8fa6('0x2a')][_0x8fa6('0x5b')]){_0x29fb9a[_0x8fa6('0x5d')]({'model':db[_0x8fa6('0x61')],'as':_0x8fa6('0x61'),'raw':!![]});}var _0x581b06=[{'model':db[_0x8fa6('0x3c')],'as':'Messages','attributes':['id',_0x8fa6('0x38'),'createdAt',_0x8fa6('0x62'),'secret',_0x8fa6('0x63')],'include':_0x29fb9a}];_0x581b06[_0x8fa6('0x5d')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x8fa6('0x1f')]});_0x581b06[_0x8fa6('0x5d')]({'model':db[_0x8fa6('0x5c')],'as':_0x8fa6('0x64'),'attributes':['id',_0x8fa6('0x65')]});return db[_0x8fa6('0x23')][_0x8fa6('0x39')]({'where':{'id':_0x48636b[_0x8fa6('0x2d')]['id']},'include':_0x581b06})[_0x8fa6('0x1a')](handleEntityNotFound(_0x5d7bba,null))['then'](function(_0x48205d){if(_0x48205d){var _0x60a2e0=_0x48205d[_0x8fa6('0x66')]({'plain':!![]});fs[_0x8fa6('0x67')](_0x18fbad);var _0x3668c2={'channel':_0x8fa6('0x68'),'account':_0x60a2e0[_0x8fa6('0x69')][_0x8fa6('0x1f')],'agent':_0x60a2e0['Owner']?_0x60a2e0[_0x8fa6('0x64')]['fullname']:_0x8fa6('0x6a'),'createdAt':moment(_0x60a2e0[_0x8fa6('0x6b')])[_0x8fa6('0x4b')](_0x8fa6('0x6c'))[_0x8fa6('0x55')](),'closedAt':_0x60a2e0['closed']?moment(_0x60a2e0[_0x8fa6('0x6d')])[_0x8fa6('0x4b')](_0x8fa6('0x6c'))[_0x8fa6('0x55')]():'','disposition':_0x60a2e0[_0x8fa6('0x6e')],'messages':_(_0x60a2e0['Messages'])[_0x8fa6('0x48')]({'secret':![]})[_0x8fa6('0x22')](function(_0x59bcff){if(_0x59bcff[_0x8fa6('0x61')]){var _0x3e8209=path[_0x8fa6('0x56')](_0x43ee3c,_0x59bcff[_0x8fa6('0x61')]['basename']);if(fs[_0x8fa6('0x6f')](_0x3e8209)){fs['createReadStream'](_0x3e8209)[_0x8fa6('0x70')](fs[_0x8fa6('0x71')](path[_0x8fa6('0x56')](_0x18fbad,_0x59bcff[_0x8fa6('0x61')][_0x8fa6('0x72')])));}}return{'date':moment(_0x59bcff['createdAt'])[_0x8fa6('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x59bcff[_0x8fa6('0x62')]==='out'?_0x59bcff[_0x8fa6('0x5c')]?_0x59bcff['User'][_0x8fa6('0x65')]:_0x8fa6('0x73'):_0x59bcff[_0x8fa6('0x5f')][_0x8fa6('0x60')]+(_0x59bcff[_0x8fa6('0x5f')][_0x8fa6('0x74')]?'\x20'+_0x59bcff[_0x8fa6('0x5f')]['lastName']:''),'body':_0x59bcff[_0x8fa6('0x61')]?_0x59bcff[_0x8fa6('0x61')]['basename']:_0x59bcff[_0x8fa6('0x38')],'direction':_0x59bcff['direction']===_0x8fa6('0x75')?'A':'C','secret':_0x59bcff[_0x8fa6('0x76')],'read':_0x59bcff['read'],'attachment':_0x59bcff['Attachment']};})[_0x8fa6('0x77')]()};return ejs[_0x8fa6('0x78')](path[_0x8fa6('0x56')](config[_0x8fa6('0x57')],_0x8fa6('0x58'),_0x8fa6('0x79'),_0x8fa6('0x7a')),{'interaction':_0x3668c2})['then'](function(_0x4818ff){var _0x258159=path['join'](_0x18fbad,_0x8fa6('0x7b')+_0x60a2e0['id']+'-'+_0x1b71ea+'.pdf');var _0x36804c={'path':_0x258159,'channel':_0x8fa6('0x68'),'interactionId':_0x60a2e0['id']};return pdf['createPdfFromHTML'](_0x4818ff,_0x36804c);})['then'](function(){return new BPromise(function(_0x52ffc2,_0x557ac9){zipdir(_0x18fbad,{'saveTo':_0x19443a},function(_0x228eaa,_0x36b323){if(_0x228eaa)return _0x557ac9(_0x228eaa);return _0x52ffc2(_0x36b323);});})[_0x8fa6('0x1a')](function(){return new BPromise(function(_0x22d840,_0x11371d){rimraf(_0x18fbad,function(_0x2261fb){if(_0x2261fb)_0x11371d(_0x2261fb);return _0x22d840();});});})['then'](function(){return _0x5d7bba[_0x8fa6('0x53')](_0x19443a,_0x2d8400,function(_0x5df24f){if(_0x5df24f){console[_0x8fa6('0x7c')](_0x8fa6('0x7d'),_0x5df24f);}else{fs[_0x8fa6('0x7e')](_0x19443a);}});});});}else{return _0x5d7bba['sendStatus'](0xc8);}})['catch'](handleError(_0x5d7bba,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 06084bf..ec4becc 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d4a=['update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x4f7efe,_0x400ab1){var _0x5809ce=function(_0x356bee){while(--_0x356bee){_0x4f7efe['push'](_0x4f7efe['shift']());}};_0x5809ce(++_0x400ab1);}(_0x6d4a,0x117));var _0xa6d4=function(_0x58c8d4,_0x1e829c){_0x58c8d4=_0x58c8d4-0x0;var _0x217633=_0x6d4a[_0x58c8d4];return _0x217633;};'use strict';var EventEmitter=require(_0xa6d4('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xa6d4('0x1')];var WhatsappMessage=require(_0xa6d4('0x2'))['db'][_0xa6d4('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa6d4('0x4')](0x0);var events={'afterCreate':_0xa6d4('0x5'),'afterUpdate':_0xa6d4('0x6'),'afterDestroy':_0xa6d4('0x7')};function emitEvent(_0x422d77){return function(_0x91048f,_0x3a7c95,_0x25a720){_0x91048f[_0xa6d4('0x8')]({'attributes':['id'],'raw':!![]})[_0xa6d4('0x9')](function(_0x444bf9){_0x91048f['setDataValue'](_0xa6d4('0xa'),_0x444bf9[_0xa6d4('0xb')](function(_0x52739a){return{'id':_0x52739a['id']};}));return WhatsappMessage[_0xa6d4('0xc')]({'where':{'WhatsappInteractionId':_0x91048f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa6d4('0x9')](function(_0x2bea15){_0x91048f[_0xa6d4('0xd')](_0xa6d4('0xe'),_0x2bea15['length']);WhatsappInteractionEvents[_0xa6d4('0xf')](_0x422d77+':'+_0x91048f['id'],_0x91048f);WhatsappInteractionEvents[_0xa6d4('0xf')](_0x422d77,_0x91048f);_0x25a720(null);})['catch'](_0x25a720(null));};}for(var e in events){if(events[_0xa6d4('0x10')](e)){var event=events[e];WhatsappInteraction[_0xa6d4('0x11')](e,emitEvent(event));}}module[_0xa6d4('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x851a=['then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x5bf030,_0x13d0d3){var _0x23a7c7=function(_0x164c1d){while(--_0x164c1d){_0x5bf030['push'](_0x5bf030['shift']());}};_0x23a7c7(++_0x13d0d3);}(_0x851a,0x19b));var _0xa851=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x851a[_0x1589dd];return _0x1bddd1;};'use strict';var EventEmitter=require(_0xa851('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xa851('0x1')];var WhatsappMessage=require(_0xa851('0x2'))['db'][_0xa851('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa851('0x4')](0x0);var events={'afterCreate':_0xa851('0x5'),'afterUpdate':_0xa851('0x6'),'afterDestroy':_0xa851('0x7')};function emitEvent(_0x3f317d){return function(_0x4a10c8,_0xdd4995,_0x57a7c4){_0x4a10c8[_0xa851('0x8')]({'attributes':['id'],'raw':!![]})[_0xa851('0x9')](function(_0x2f1f42){_0x4a10c8['setDataValue'](_0xa851('0xa'),_0x2f1f42[_0xa851('0xb')](function(_0x1334a1){return{'id':_0x1334a1['id']};}));return WhatsappMessage[_0xa851('0xc')]({'where':{'WhatsappInteractionId':_0x4a10c8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x393900){_0x4a10c8[_0xa851('0xd')]('unreadMessages',_0x393900[_0xa851('0xe')]);WhatsappInteractionEvents[_0xa851('0xf')](_0x3f317d+':'+_0x4a10c8['id'],_0x4a10c8);WhatsappInteractionEvents[_0xa851('0xf')](_0x3f317d,_0x4a10c8);_0x57a7c4(null);})[_0xa851('0x10')](_0x57a7c4(null));};}for(var e in events){if(events[_0xa851('0x11')](e)){var event=events[e];WhatsappInteraction[_0xa851('0x12')](e,emitEvent(event));}}module[_0xa851('0x13')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index fa8c7d7..2191f0f 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7017=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','whatsapp_interactions','format'];(function(_0x14ca80,_0x43add5){var _0x1a6cbc=function(_0xa35a74){while(--_0xa35a74){_0x14ca80['push'](_0x14ca80['shift']());}};_0x1a6cbc(++_0x43add5);}(_0x7017,0x187));var _0x7701=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7017[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x7701('0x0'));var logger=require(_0x7701('0x1'))(_0x7701('0x2'));var moment=require('moment');var BPromise=require(_0x7701('0x3'));var rp=require(_0x7701('0x4'));var fs=require('fs');var path=require(_0x7701('0x5'));var rimraf=require(_0x7701('0x6'));var config=require(_0x7701('0x7'));var attributes=require(_0x7701('0x8'));module['exports']=function(_0x38d4d3,_0xc3739){return _0x38d4d3[_0x7701('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x7701('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4012cd,_0x1dc772,_0x81e04e){if(_0x4012cd['changed']('closed')){_0x4012cd['closedAt']=moment()[_0x7701('0xb')](_0x7701('0xc'));}_0x81e04e(null,_0x4012cd);}}});}; \ No newline at end of file +var _0x6dda=['exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x6dda,0x13b));var _0xa6dd=function(_0x1900df,_0x329ebf){_0x1900df=_0x1900df-0x0;var _0x416107=_0x6dda[_0x1900df];return _0x416107;};'use strict';var _=require(_0xa6dd('0x0'));var util=require('util');var logger=require(_0xa6dd('0x1'))(_0xa6dd('0x2'));var moment=require(_0xa6dd('0x3'));var BPromise=require(_0xa6dd('0x4'));var rp=require(_0xa6dd('0x5'));var fs=require('fs');var path=require(_0xa6dd('0x6'));var rimraf=require(_0xa6dd('0x7'));var config=require(_0xa6dd('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0xa6dd('0x9')]=function(_0x990de2,_0x1fd077){return _0x990de2[_0xa6dd('0xa')](_0xa6dd('0xb'),attributes,{'tableName':_0xa6dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e84a9,_0x1e0813,_0x2e1d07){if(_0x2e84a9[_0xa6dd('0xd')](_0xa6dd('0xe'))){_0x2e84a9[_0xa6dd('0xf')]=moment()[_0xa6dd('0x10')](_0xa6dd('0x11'));}_0x2e1d07(null,_0x2e84a9);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 9729926..928886f 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88b2=['WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','debug','catch','AddTagsToWhatsappInteraction','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x415080,_0x30708){var _0x492313=function(_0x5bc9ca){while(--_0x5bc9ca){_0x415080['push'](_0x415080['shift']());}};_0x492313(++_0x30708);}(_0x88b2,0xdb));var _0x288b=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x88b2[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x288b('0x0'));var util=require('util');var moment=require(_0x288b('0x1'));var BPromise=require(_0x288b('0x2'));var rs=require(_0x288b('0x3'));var fs=require('fs');var Redis=require(_0x288b('0x4'));var db=require(_0x288b('0x5'))['db'];var utils=require(_0x288b('0x6'));var logger=require(_0x288b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x288b('0x8'));var client=jayson[_0x288b('0x9')][_0x288b('0xa')]({'port':0x232a});config[_0x288b('0xb')]=_['defaults'](config[_0x288b('0xb')],{'host':_0x288b('0xc'),'port':0x18eb});var socket=require(_0x288b('0xd'))(new Redis(config[_0x288b('0xb')]));require(_0x288b('0xe'))[_0x288b('0xf')](socket);function respondWithRpcPromise(_0x242130,_0x380024,_0x441977){return new BPromise(function(_0x38ea0e,_0x7f385c){return client[_0x288b('0x10')](_0x242130,_0x441977)[_0x288b('0x11')](function(_0x2aee7d){logger[_0x288b('0x12')](_0x288b('0x13'),_0x380024,_0x288b('0x14'));logger['debug'](_0x288b('0x15'),_0x380024,'request\x20sent',JSON[_0x288b('0x16')](_0x2aee7d));if(_0x2aee7d[_0x288b('0x17')]){if(_0x2aee7d[_0x288b('0x17')][_0x288b('0x18')]===0x1f4){logger['error'](_0x288b('0x13'),_0x380024,_0x2aee7d[_0x288b('0x17')][_0x288b('0x19')]);return _0x7f385c(_0x2aee7d['error'][_0x288b('0x19')]);}logger[_0x288b('0x17')](_0x288b('0x13'),_0x380024,_0x2aee7d[_0x288b('0x17')]['message']);return _0x38ea0e(_0x2aee7d[_0x288b('0x17')][_0x288b('0x19')]);}else{logger[_0x288b('0x12')](_0x288b('0x13'),_0x380024,_0x288b('0x14'));_0x38ea0e(_0x2aee7d[_0x288b('0x1a')][_0x288b('0x19')]);}})['catch'](function(_0x2a24ef){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x380024,_0x2a24ef);_0x7f385c(_0x2a24ef);});});}exports[_0x288b('0x1b')]=function(_0x24e397){var _0x3f0375=this;return new Promise(function(_0x6ffae,_0x2c3d7a){return db[_0x288b('0x1c')]['update'](_0x24e397[_0x288b('0x1d')],{'raw':_0x24e397[_0x288b('0x1e')]?_0x24e397[_0x288b('0x1e')][_0x288b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e397['options']?_0x24e397[_0x288b('0x1e')][_0x288b('0x20')]||null:null,'attributes':_0x24e397['options']?_0x24e397[_0x288b('0x1e')]['attributes']||null:null,'limit':_0x24e397['options']?_0x24e397[_0x288b('0x1e')][_0x288b('0x21')]||null:null})['then'](function(_0x4361db){logger[_0x288b('0x12')](_0x288b('0x1b'),_0x24e397);logger[_0x288b('0x22')](_0x288b('0x1b'),_0x24e397,JSON[_0x288b('0x16')](_0x4361db));_0x6ffae(_0x4361db);})[_0x288b('0x23')](function(_0x223cad){logger[_0x288b('0x17')](_0x288b('0x1b'),_0x223cad[_0x288b('0x19')],_0x24e397);_0x2c3d7a(_0x3f0375[_0x288b('0x17')](0x1f4,_0x223cad['message']));});});};exports[_0x288b('0x24')]=function(_0x2996cb){return new Promise(function(_0x1a1382,_0x4a0c12){return db[_0x288b('0x1c')]['find']({'where':_0x2996cb[_0x288b('0x1e')]?_0x2996cb[_0x288b('0x1e')][_0x288b('0x20')]||null:null})[_0x288b('0x11')](function(_0x283d3b){if(_0x283d3b){return _0x283d3b['addTags'](_0x2996cb[_0x288b('0x1d')][_0x288b('0x25')],_['omit'](_0x2996cb['body'],[_0x288b('0x25'),'id'])||{});}})[_0x288b('0x26')](function(_0x2a19ed){logger[_0x288b('0x12')](_0x288b('0x27'),_0x2996cb);logger[_0x288b('0x22')](_0x288b('0x27'),_0x2996cb,JSON[_0x288b('0x16')](_0x2a19ed));_0x1a1382(_0x2a19ed);})[_0x288b('0x23')](function(_0x5622a3){logger[_0x288b('0x17')](_0x288b('0x27'),_0x5622a3[_0x288b('0x19')],_0x2996cb);_0x4a0c12(_this[_0x288b('0x17')](0x1f4,_0x5622a3[_0x288b('0x19')]));});});}; \ No newline at end of file +var _0xbe5a=['info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','find','ids','omit','spread','AddTags','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then'];(function(_0xd8768,_0x3fedcb){var _0x46228f=function(_0x65a836){while(--_0x65a836){_0xd8768['push'](_0xd8768['shift']());}};_0x46228f(++_0x3fedcb);}(_0xbe5a,0x1a8));var _0xabe5=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xbe5a[_0x35da42];return _0x370035;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xabe5('0x0'));var BPromise=require('bluebird');var rs=require(_0xabe5('0x1'));var fs=require('fs');var Redis=require(_0xabe5('0x2'));var db=require(_0xabe5('0x3'))['db'];var utils=require(_0xabe5('0x4'));var logger=require(_0xabe5('0x5'))(_0xabe5('0x6'));var config=require(_0xabe5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xabe5('0x8')]['http']({'port':0x232a});config[_0xabe5('0x9')]=_['defaults'](config[_0xabe5('0x9')],{'host':_0xabe5('0xa'),'port':0x18eb});var socket=require(_0xabe5('0xb'))(new Redis(config[_0xabe5('0x9')]));require(_0xabe5('0xc'))[_0xabe5('0xd')](socket);function respondWithRpcPromise(_0x49898d,_0x46c8ab,_0x41cc86){return new BPromise(function(_0x31aa5d,_0x4b560e){return client[_0xabe5('0xe')](_0x49898d,_0x41cc86)[_0xabe5('0xf')](function(_0x5c0ca8){logger[_0xabe5('0x10')](_0xabe5('0x11'),_0x46c8ab,_0xabe5('0x12'));logger[_0xabe5('0x13')](_0xabe5('0x14'),_0x46c8ab,'request\x20sent',JSON[_0xabe5('0x15')](_0x5c0ca8));if(_0x5c0ca8['error']){if(_0x5c0ca8['error'][_0xabe5('0x16')]===0x1f4){logger[_0xabe5('0x17')](_0xabe5('0x11'),_0x46c8ab,_0x5c0ca8['error'][_0xabe5('0x18')]);return _0x4b560e(_0x5c0ca8['error']['message']);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x46c8ab,_0x5c0ca8[_0xabe5('0x17')][_0xabe5('0x18')]);return _0x31aa5d(_0x5c0ca8[_0xabe5('0x17')][_0xabe5('0x18')]);}else{logger[_0xabe5('0x10')](_0xabe5('0x11'),_0x46c8ab,_0xabe5('0x12'));_0x31aa5d(_0x5c0ca8[_0xabe5('0x19')]['message']);}})['catch'](function(_0x5f598f){logger[_0xabe5('0x17')](_0xabe5('0x11'),_0x46c8ab,_0x5f598f);_0x4b560e(_0x5f598f);});});}exports[_0xabe5('0x1a')]=function(_0x3ba5c1){var _0x493e10=this;return new Promise(function(_0x4f4b51,_0x246d5a){return db[_0xabe5('0x1b')]['update'](_0x3ba5c1[_0xabe5('0x1c')],{'raw':_0x3ba5c1[_0xabe5('0x1d')]?_0x3ba5c1['options'][_0xabe5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ba5c1[_0xabe5('0x1d')]?_0x3ba5c1['options'][_0xabe5('0x1f')]||null:null,'attributes':_0x3ba5c1[_0xabe5('0x1d')]?_0x3ba5c1[_0xabe5('0x1d')][_0xabe5('0x20')]||null:null,'limit':_0x3ba5c1[_0xabe5('0x1d')]?_0x3ba5c1[_0xabe5('0x1d')][_0xabe5('0x21')]||null:null})[_0xabe5('0xf')](function(_0x753557){logger['info'](_0xabe5('0x1a'),_0x3ba5c1);logger[_0xabe5('0x13')]('UpdateWhatsappInteraction',_0x3ba5c1,JSON['stringify'](_0x753557));_0x4f4b51(_0x753557);})['catch'](function(_0x14b7e2){logger[_0xabe5('0x17')](_0xabe5('0x1a'),_0x14b7e2[_0xabe5('0x18')],_0x3ba5c1);_0x246d5a(_0x493e10['error'](0x1f4,_0x14b7e2[_0xabe5('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x241f18){return new Promise(function(_0x3c26f6,_0x2f56e4){return db['WhatsappInteraction'][_0xabe5('0x22')]({'where':_0x241f18[_0xabe5('0x1d')]?_0x241f18[_0xabe5('0x1d')][_0xabe5('0x1f')]||null:null})['then'](function(_0x542c2b){if(_0x542c2b){return _0x542c2b['addTags'](_0x241f18['body'][_0xabe5('0x23')],_[_0xabe5('0x24')](_0x241f18[_0xabe5('0x1c')],[_0xabe5('0x23'),'id'])||{});}})[_0xabe5('0x25')](function(_0x227c27){logger[_0xabe5('0x10')](_0xabe5('0x26'),_0x241f18);logger[_0xabe5('0x13')](_0xabe5('0x26'),_0x241f18,JSON['stringify'](_0x227c27));_0x3c26f6(_0x227c27);})[_0xabe5('0x27')](function(_0x476c38){logger[_0xabe5('0x17')](_0xabe5('0x26'),_0x476c38[_0xabe5('0x18')],_0x241f18);_0x2f56e4(_this[_0xabe5('0x17')](0x1f4,_0x476c38[_0xabe5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index d59a986..b089c96 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebfc=['remove','update','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x236f40,_0x7be416){var _0x462aee=function(_0x160723){while(--_0x160723){_0x236f40['push'](_0x236f40['shift']());}};_0x462aee(++_0x7be416);}(_0xebfc,0x194));var _0xcebf=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xebfc[_0xdd2bfa];return _0x55397e;};'use strict';var WhatsappInteractionEvents=require(_0xcebf('0x0'));var events=[_0xcebf('0x1'),_0xcebf('0x2'),_0xcebf('0x3')];function createListener(_0x1b62fb,_0xcd7992){return function(_0x46217a){_0xcd7992['emit'](_0x1b62fb,_0x46217a);};}function removeListener(_0x5bfe5c,_0x4a92c4){return function(){WhatsappInteractionEvents['removeListener'](_0x5bfe5c,_0x4a92c4);};}exports[_0xcebf('0x4')]=function(_0x54c4ad){for(var _0x3ad116=0x0,_0x1a01df=events[_0xcebf('0x5')];_0x3ad116<_0x1a01df;_0x3ad116++){var _0x54275e=events[_0x3ad116];var _0x23727d=createListener(_0xcebf('0x6')+_0x54275e,_0x54c4ad);WhatsappInteractionEvents['on'](_0x54275e,_0x23727d);}}; \ No newline at end of file +var _0x42f1=['register','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','removeListener'];(function(_0x4f1add,_0x13aae0){var _0x324504=function(_0xc2922f){while(--_0xc2922f){_0x4f1add['push'](_0x4f1add['shift']());}};_0x324504(++_0x13aae0);}(_0x42f1,0x1f3));var _0x142f=function(_0x5dd77b,_0x39a535){_0x5dd77b=_0x5dd77b-0x0;var _0xd7942f=_0x42f1[_0x5dd77b];return _0xd7942f;};'use strict';var WhatsappInteractionEvents=require(_0x142f('0x0'));var events=[_0x142f('0x1'),_0x142f('0x2'),_0x142f('0x3')];function createListener(_0x5911e5,_0x12d37c){return function(_0x3a79b3){_0x12d37c['emit'](_0x5911e5,_0x3a79b3);};}function removeListener(_0x5be9f3,_0x2f943e){return function(){WhatsappInteractionEvents[_0x142f('0x4')](_0x5be9f3,_0x2f943e);};}exports[_0x142f('0x5')]=function(_0xd53cfa){for(var _0x16f450=0x0,_0x50ee26=events['length'];_0x16f450<_0x50ee26;_0x16f450++){var _0x42fb0d=events[_0x16f450];var _0x206e2f=createListener(_0x142f('0x6')+_0x42fb0d,_0xd53cfa);WhatsappInteractionEvents['on'](_0x42fb0d,_0x206e2f);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 16f798d..518c495 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c41=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','describe','get','/:id','show','whatsappmessage:create','create','post','/:id/status','status','put','update','/:id/reject','delete','destroy','exports'];(function(_0x33f02e,_0x36329c){var _0x32e17a=function(_0x2fb8c5){while(--_0x2fb8c5){_0x33f02e['push'](_0x33f02e['shift']());}};_0x32e17a(++_0x36329c);}(_0x3c41,0x190));var _0x13c4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3c41[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x13c4('0x0'));var util=require('util');var path=require(_0x13c4('0x1'));var timeout=require(_0x13c4('0x2'));var express=require(_0x13c4('0x3'));var router=express[_0x13c4('0x4')]();var fs_extra=require(_0x13c4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x13c4('0x6'));var config=require('../../config/environment');var controller=require(_0x13c4('0x7'));router['get']('/',auth[_0x13c4('0x8')](),controller[_0x13c4('0x9')]);router['get']('/describe',auth[_0x13c4('0x8')](),controller[_0x13c4('0xa')]);router[_0x13c4('0xb')](_0x13c4('0xc'),auth[_0x13c4('0x8')](),controller[_0x13c4('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0x13c4('0xe')),controller[_0x13c4('0xf')]);router[_0x13c4('0x10')](_0x13c4('0x11'),controller[_0x13c4('0x12')]);router[_0x13c4('0x13')](_0x13c4('0xc'),auth[_0x13c4('0x8')](),controller[_0x13c4('0x14')]);router['put']('/:id/accept',auth[_0x13c4('0x8')](),controller['accept']);router[_0x13c4('0x13')](_0x13c4('0x15'),auth[_0x13c4('0x8')](),controller['reject']);router[_0x13c4('0x16')](_0x13c4('0xc'),auth['isAuthenticated'](),controller[_0x13c4('0x17')]);module[_0x13c4('0x18')]=router; \ No newline at end of file +var _0x7786=['status','put','/:id','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','show','post','whatsapp','whatsappmessage:create','/:id/status'];(function(_0x5767f9,_0x38ea6a){var _0x58c7b3=function(_0x4cbf57){while(--_0x4cbf57){_0x5767f9['push'](_0x5767f9['shift']());}};_0x58c7b3(++_0x38ea6a);}(_0x7786,0x14c));var _0x6778=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7786[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6778('0x0'));var util=require(_0x6778('0x1'));var path=require(_0x6778('0x2'));var timeout=require(_0x6778('0x3'));var express=require(_0x6778('0x4'));var router=express['Router']();var fs_extra=require(_0x6778('0x5'));var auth=require(_0x6778('0x6'));var interaction=require(_0x6778('0x7'));var config=require(_0x6778('0x8'));var controller=require(_0x6778('0x9'));router[_0x6778('0xa')]('/',auth[_0x6778('0xb')](),controller[_0x6778('0xc')]);router['get']('/describe',auth[_0x6778('0xb')](),controller[_0x6778('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6778('0xe')]);router[_0x6778('0xf')]('/',auth[_0x6778('0xb')](),interaction['tracked'](_0x6778('0x10'),_0x6778('0x11')),controller['create']);router[_0x6778('0xf')](_0x6778('0x12'),controller[_0x6778('0x13')]);router[_0x6778('0x14')](_0x6778('0x15'),auth[_0x6778('0xb')](),controller['update']);router[_0x6778('0x14')](_0x6778('0x16'),auth['isAuthenticated'](),controller[_0x6778('0x17')]);router[_0x6778('0x14')]('/:id/reject',auth[_0x6778('0xb')](),controller[_0x6778('0x18')]);router[_0x6778('0x19')](_0x6778('0x15'),auth[_0x6778('0xb')](),controller[_0x6778('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 6899287..ea2a5e3 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fd9=['sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x4f0f6b,_0xbf181a){var _0x178803=function(_0x506416){while(--_0x506416){_0x4f0f6b['push'](_0x4f0f6b['shift']());}};_0x178803(++_0xbf181a);}(_0x8fd9,0x18c));var _0x98fd=function(_0x2110bb,_0x5bf49e){_0x2110bb=_0x2110bb-0x0;var _0x5cf87c=_0x8fd9[_0x2110bb];return _0x5cf87c;};'use strict';var Sequelize=require(_0x98fd('0x0'));module[_0x98fd('0x1')]={'body':{'type':Sequelize[_0x98fd('0x2')](_0x98fd('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x98fd('0x4')]('in',_0x98fd('0x5')),'defaultValue':_0x98fd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x98fd('0x6')]},'readAt':{'type':Sequelize[_0x98fd('0x7')]},'secret':{'type':Sequelize[_0x98fd('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x98fd('0x6')]},'providerResponse':{'type':Sequelize[_0x98fd('0x2')]}}; \ No newline at end of file +var _0xc254=['out','STRING','DATE','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc254,0x1ed));var _0x4c25=function(_0x2bbd2d,_0x37c3c4){_0x2bbd2d=_0x2bbd2d-0x0;var _0x257dc9=_0xc254[_0x2bbd2d];return _0x257dc9;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x4c25('0x0')](_0x4c25('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4c25('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4c25('0x3')]('in',_0x4c25('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x4c25('0x5')]},'readAt':{'type':Sequelize[_0x4c25('0x6')]},'secret':{'type':Sequelize[_0x4c25('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4c25('0x5')]},'providerResponse':{'type':Sequelize[_0x4c25('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 7e4298b..af70578 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2fe8=['sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','keys','options','find','body','update','destroy','describe','accept','whatsapp','read','readAt','format','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0x117713,_0x1b3f0c){var _0x310d68=function(_0x5c266a){while(--_0x5c266a){_0x117713['push'](_0x117713['shift']());}};_0x310d68(++_0x1b3f0c);}(_0x2fe8,0x1b1));var _0x82fe=function(_0x4007e5,_0x55f0df){_0x4007e5=_0x4007e5-0x0;var _0x311887=_0x2fe8[_0x4007e5];return _0x311887;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82fe('0x0'));var zipdir=require(_0x82fe('0x1'));var jsonpatch=require(_0x82fe('0x2'));var rp=require('request-promise');var moment=require(_0x82fe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x82fe('0x4'));var util=require('util');var path=require(_0x82fe('0x5'));var sox=require(_0x82fe('0x6'));var csv=require(_0x82fe('0x7'));var ejs=require(_0x82fe('0x8'));var fs=require('fs');var fs_extra=require(_0x82fe('0x9'));var _=require(_0x82fe('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x82fe('0xb'));var deskjs=require(_0x82fe('0xc'));var toCsv=require(_0x82fe('0x7'));var querystring=require(_0x82fe('0xd'));var Papa=require(_0x82fe('0xe'));var Redis=require(_0x82fe('0xf'));var authService=require(_0x82fe('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x82fe('0x11'));var hardwareService=require(_0x82fe('0x12'));var logger=require(_0x82fe('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x82fe('0x14'));var licenseUtil=require(_0x82fe('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x82fe('0x16')],{'host':_0x82fe('0x17'),'port':0x18eb});var socket=require(_0x82fe('0x18'))(new Redis(config[_0x82fe('0x16')]));require('./whatsappMessage.socket')[_0x82fe('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x82fe('0x1a')][_0x82fe('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b72d5,_0x389549,_0x587fab,_0xe90849){return new BPromise(function(_0x5b9220,_0x106630){var _0x280be6=_0xe90849||client;return _0x280be6[_0x82fe('0x1c')](_0x5b72d5,_0x587fab)[_0x82fe('0x1d')](function(_0x1c691d){logger[_0x82fe('0x1e')](_0x82fe('0x1f'),_0x389549,_0x82fe('0x20'));logger[_0x82fe('0x21')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x389549,_0x82fe('0x20'),JSON[_0x82fe('0x22')](_0x1c691d));if(_0x1c691d[_0x82fe('0x23')]){if(_0x1c691d[_0x82fe('0x23')]['code']===0x1f4){logger[_0x82fe('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x389549,_0x1c691d[_0x82fe('0x23')]['message']);return _0x106630(_0x1c691d[_0x82fe('0x23')]['message']);}logger['error'](_0x82fe('0x1f'),_0x389549,_0x1c691d[_0x82fe('0x23')]['message']);return _0x5b9220(_0x1c691d[_0x82fe('0x23')][_0x82fe('0x24')]);}else{logger[_0x82fe('0x1e')]('WhatsappMessage,\x20%s,\x20%s',_0x389549,_0x82fe('0x20'));_0x5b9220(_0x1c691d['result'][_0x82fe('0x24')]);}})['catch'](function(_0x36f349){logger[_0x82fe('0x23')](_0x82fe('0x1f'),_0x389549,_0x36f349);_0x106630(_0x36f349);});});}function respondWithStatusCode(_0x5dcbc3,_0x3344a5){_0x3344a5=_0x3344a5||0xcc;return function(_0x3d287d){if(_0x3d287d){return _0x5dcbc3[_0x82fe('0x25')](_0x3344a5);}return _0x5dcbc3[_0x82fe('0x26')](_0x3344a5)[_0x82fe('0x27')]();};}function respondWithResult(_0x2a22e6,_0x1295a8){_0x1295a8=_0x1295a8||0xc8;return function(_0x2a8674){if(_0x2a8674){return _0x2a22e6[_0x82fe('0x26')](_0x1295a8)[_0x82fe('0x28')](_0x2a8674);}};}function respondWithFilteredResult(_0x72b233,_0x2e24d0){return function(_0x18b9e9){if(_0x18b9e9){var _0x2cbdc5=typeof _0x2e24d0[_0x82fe('0x29')]===_0x82fe('0x2a')&&typeof _0x2e24d0[_0x82fe('0x2b')]===_0x82fe('0x2a');var _0x282cb2=_0x18b9e9[_0x82fe('0x2c')];var _0x307e34=_0x2cbdc5?0x0:_0x2e24d0[_0x82fe('0x29')];var _0x205eb9=_0x2cbdc5?_0x18b9e9['count']:_0x2e24d0[_0x82fe('0x29')]+_0x2e24d0[_0x82fe('0x2b')];var _0x2648de;if(_0x205eb9>=_0x282cb2){_0x205eb9=_0x282cb2;_0x2648de=0xc8;}else{_0x2648de=0xce;}_0x72b233[_0x82fe('0x26')](_0x2648de);return _0x72b233['set'](_0x82fe('0x2d'),_0x307e34+'-'+_0x205eb9+'/'+_0x282cb2)[_0x82fe('0x28')](_0x18b9e9);}return null;};}function patchUpdates(_0x34178d){return function(_0x220476){try{jsonpatch[_0x82fe('0x2e')](_0x220476,_0x34178d,!![]);}catch(_0x5de414){return BPromise[_0x82fe('0x2f')](_0x5de414);}return _0x220476[_0x82fe('0x30')]();};}function saveUpdates(_0x31a348,_0x574d1e){return function(_0x5054cc){if(_0x5054cc){return _0x5054cc['update'](_0x31a348)[_0x82fe('0x1d')](function(_0x564beb){return _0x564beb;});}return null;};}function removeEntity(_0x48a54b,_0x53a431){return function(_0x33b348){if(_0x33b348){return _0x33b348['destroy']()['then'](function(){_0x48a54b[_0x82fe('0x26')](0xcc)[_0x82fe('0x27')]();});}};}function handleEntityNotFound(_0x1d6100,_0x205565){return function(_0x421569){if(!_0x421569){_0x1d6100[_0x82fe('0x25')](0x194);}return _0x421569;};}function handleError(_0x3ad536,_0x3a9802){_0x3a9802=_0x3a9802||0x1f4;return function(_0x365c8c){logger[_0x82fe('0x23')](_0x365c8c['stack']);if(_0x365c8c[_0x82fe('0x31')]){delete _0x365c8c[_0x82fe('0x31')];}_0x3ad536[_0x82fe('0x26')](_0x3a9802)['send'](_0x365c8c);};}exports[_0x82fe('0x32')]=function(_0x52c91b,_0x2b9a2f){var _0x11130f={},_0x23ceed={},_0x374cbc={'count':0x0,'rows':[]};var _0x44d30a=_[_0x82fe('0x33')](db[_0x82fe('0x34')][_0x82fe('0x35')],function(_0x51a03b){return{'name':_0x51a03b[_0x82fe('0x36')],'type':_0x51a03b[_0x82fe('0x37')][_0x82fe('0x38')]};});_0x23ceed['model']=_[_0x82fe('0x33')](_0x44d30a,_0x82fe('0x31'));_0x23ceed[_0x82fe('0x39')]=_['keys'](_0x52c91b[_0x82fe('0x39')]);_0x23ceed[_0x82fe('0x3a')]=_[_0x82fe('0x3b')](_0x23ceed[_0x82fe('0x3c')],_0x23ceed[_0x82fe('0x39')]);_0x11130f[_0x82fe('0x3d')]=_[_0x82fe('0x3b')](_0x23ceed[_0x82fe('0x3c')],qs[_0x82fe('0x3e')](_0x52c91b[_0x82fe('0x39')][_0x82fe('0x3e')]));_0x11130f[_0x82fe('0x3d')]=_0x11130f[_0x82fe('0x3d')][_0x82fe('0x3f')]?_0x11130f[_0x82fe('0x3d')]:_0x23ceed[_0x82fe('0x3c')];if(!_0x52c91b[_0x82fe('0x39')][_0x82fe('0x40')]('nolimit')){_0x11130f[_0x82fe('0x2b')]=qs[_0x82fe('0x2b')](_0x52c91b[_0x82fe('0x39')]['limit']);_0x11130f[_0x82fe('0x29')]=qs[_0x82fe('0x29')](_0x52c91b[_0x82fe('0x39')][_0x82fe('0x29')]);}_0x11130f[_0x82fe('0x41')]=qs[_0x82fe('0x42')](_0x52c91b[_0x82fe('0x39')]['sort']);_0x11130f['where']=qs['filters'](_[_0x82fe('0x43')](_0x52c91b[_0x82fe('0x39')],_0x23ceed[_0x82fe('0x3a')]),_0x44d30a);if(_0x52c91b['query'][_0x82fe('0x44')]){_0x11130f[_0x82fe('0x45')]=_[_0x82fe('0x46')](_0x11130f[_0x82fe('0x45')],{'$or':_['map'](_0x44d30a,function(_0x44a243){if(_0x44a243[_0x82fe('0x37')]!=='VIRTUAL'){var _0x3048da={};_0x3048da[_0x44a243[_0x82fe('0x31')]]={'$like':'%'+_0x52c91b[_0x82fe('0x39')]['filter']+'%'};return _0x3048da;}})});}_0x11130f=_[_0x82fe('0x46')]({},_0x11130f,_0x52c91b['options']);var _0x173f8c={'where':_0x11130f[_0x82fe('0x45')]};return db['WhatsappMessage']['count'](_0x173f8c)[_0x82fe('0x1d')](function(_0x1a94c8){_0x374cbc[_0x82fe('0x2c')]=_0x1a94c8;if(_0x52c91b[_0x82fe('0x39')][_0x82fe('0x47')]){_0x11130f[_0x82fe('0x48')]=[{'all':!![]}];}return db[_0x82fe('0x34')]['findAll'](_0x11130f);})[_0x82fe('0x1d')](function(_0x116caf){_0x374cbc[_0x82fe('0x49')]=_0x116caf;return _0x374cbc;})[_0x82fe('0x1d')](respondWithFilteredResult(_0x2b9a2f,_0x11130f))[_0x82fe('0x4a')](handleError(_0x2b9a2f,null));};exports[_0x82fe('0x4b')]=function(_0x11b8f0,_0x29c708){var _0x29760f={'raw':!![],'where':{'id':_0x11b8f0[_0x82fe('0x4c')]['id']}},_0x590ec5={};_0x590ec5['model']=_[_0x82fe('0x4d')](db[_0x82fe('0x34')][_0x82fe('0x35')]);_0x590ec5['query']=_[_0x82fe('0x4d')](_0x11b8f0['query']);_0x590ec5[_0x82fe('0x3a')]=_[_0x82fe('0x3b')](_0x590ec5[_0x82fe('0x3c')],_0x590ec5['query']);_0x29760f[_0x82fe('0x3d')]=_[_0x82fe('0x3b')](_0x590ec5[_0x82fe('0x3c')],qs[_0x82fe('0x3e')](_0x11b8f0[_0x82fe('0x39')][_0x82fe('0x3e')]));_0x29760f[_0x82fe('0x3d')]=_0x29760f[_0x82fe('0x3d')][_0x82fe('0x3f')]?_0x29760f['attributes']:_0x590ec5[_0x82fe('0x3c')];if(_0x11b8f0['query'][_0x82fe('0x47')]){_0x29760f[_0x82fe('0x48')]=[{'all':!![]}];}_0x29760f=_[_0x82fe('0x46')]({},_0x29760f,_0x11b8f0[_0x82fe('0x4e')]);return db[_0x82fe('0x34')][_0x82fe('0x4f')](_0x29760f)[_0x82fe('0x1d')](handleEntityNotFound(_0x29c708,null))[_0x82fe('0x1d')](respondWithResult(_0x29c708,null))[_0x82fe('0x4a')](handleError(_0x29c708,null));};exports['create']=function(_0x1444e5,_0x299769){return db['WhatsappMessage']['create'](_0x1444e5[_0x82fe('0x50')],{})['then'](respondWithResult(_0x299769,0xc9))[_0x82fe('0x4a')](handleError(_0x299769,null));};exports[_0x82fe('0x51')]=function(_0x107e72,_0x4eacc1){if(_0x107e72[_0x82fe('0x50')]['id']){delete _0x107e72[_0x82fe('0x50')]['id'];}return db[_0x82fe('0x34')]['find']({'where':{'id':_0x107e72[_0x82fe('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4eacc1,null))['then'](saveUpdates(_0x107e72[_0x82fe('0x50')],null))[_0x82fe('0x1d')](respondWithResult(_0x4eacc1,null))[_0x82fe('0x4a')](handleError(_0x4eacc1,null));};exports[_0x82fe('0x52')]=function(_0x30fa7c,_0x26c86f){return db[_0x82fe('0x34')]['find']({'where':{'id':_0x30fa7c[_0x82fe('0x4c')]['id']}})[_0x82fe('0x1d')](handleEntityNotFound(_0x26c86f,null))['then'](removeEntity(_0x26c86f,null))[_0x82fe('0x4a')](handleError(_0x26c86f,null));};exports[_0x82fe('0x53')]=function(_0x57da6a,_0xf3e670){return db[_0x82fe('0x34')]['describe']()[_0x82fe('0x1d')](respondWithResult(_0xf3e670,null))[_0x82fe('0x4a')](handleError(_0xf3e670,null));};var interaction_log=require(_0x82fe('0x13'))('whatsapp-interactions');exports[_0x82fe('0x54')]=function(_0x5bb1ae,_0x6b1783,_0x1fb3c8){var _0x5e5152={'agent':{},'channel':_0x82fe('0x55')};if(_0x5bb1ae[_0x82fe('0x50')]['id']){delete _0x5bb1ae[_0x82fe('0x50')]['id'];}_0x5bb1ae[_0x82fe('0x50')][_0x82fe('0x56')]=!![];_0x5bb1ae[_0x82fe('0x50')][_0x82fe('0x57')]=moment()[_0x82fe('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x5bb1ae['body'][_0x82fe('0x59')]=_0x5bb1ae[_0x82fe('0x50')][_0x82fe('0x59')]||_0x5bb1ae[_0x82fe('0x5a')]['id'];_0x5e5152['agent']['id']=_0x5bb1ae['body'][_0x82fe('0x59')];return db['WhatsappMessage'][_0x82fe('0x4f')]({'where':{'id':_0x5bb1ae[_0x82fe('0x4c')]['id'],'UserId':null}})[_0x82fe('0x1d')](handleEntityNotFound(_0x6b1783,null))[_0x82fe('0x1d')](saveUpdates(_0x5bb1ae[_0x82fe('0x50')],null))[_0x82fe('0x1d')](function(_0x43b63e){if(_0x43b63e){_0x5e5152[_0x82fe('0x24')]=_0x43b63e[_0x82fe('0x5b')]({'plain':!![]});return db[_0x82fe('0x5c')]['find']({'where':{'id':_0x43b63e[_0x82fe('0x5d')]}});}return null;})[_0x82fe('0x1d')](handleEntityNotFound(_0x6b1783,null))['then'](function(_0x27e5c){if(_0x27e5c){return _0x27e5c[_0x82fe('0x51')]({'UserId':_0x5bb1ae[_0x82fe('0x50')][_0x82fe('0x59')],'read1stAt':_['isNil'](_0x27e5c[_0x82fe('0x5e')])?moment()['format'](_0x82fe('0x5f')):undefined});}return null;})[_0x82fe('0x1d')](function(_0xcf37a){if(_0xcf37a){_0x5e5152[_0x82fe('0x60')]=_0xcf37a['get']({'plain':!![]});interaction_log['info'](_0x82fe('0x61'),_0x5bb1ae[_0x82fe('0x5a')]['id'],_0x5bb1ae[_0x82fe('0x5a')][_0x82fe('0x31')],_0x5bb1ae['user'][_0x82fe('0x62')],_0x5e5152['interaction']['id'],_0x5bb1ae['body']?JSON[_0x82fe('0x22')](_0x5bb1ae['body']):_0x82fe('0x63'));return respondWithRpcPromise('AcceptMessage',_0x82fe('0x64'),_0x5e5152);}return null;})['then'](function(_0x43732a){var _0x202725=_0x82fe('0x65')+_0x43732a['message'][_0x82fe('0x66')];return db[_0x82fe('0x67')][_0x82fe('0x39')](_0x202725,{'type':db[_0x82fe('0x68')][_0x82fe('0x69')][_0x82fe('0x6a')],'raw':!![]})['then'](function(_0x542d79){return _0x542d79;});})[_0x82fe('0x1d')](function(_0x4f7a58){if(_0x4f7a58){_0x5e5152[_0x82fe('0x24')][_0x82fe('0x6b')]=_0x4f7a58[0x0];if(!_0x5bb1ae[_0x82fe('0x50')][_0x82fe('0x59')])return;return db[_0x82fe('0x6c')][_0x82fe('0x4f')]({'where':{'id':_0x5bb1ae[_0x82fe('0x50')][_0x82fe('0x59')],'role':_0x82fe('0x6d')},'attributes':['id',_0x82fe('0x31'),_0x82fe('0x6e'),_0x82fe('0x6f'),_0x82fe('0x70')],'raw':!![]});}return null;})['then'](function(_0x4e0054){if(!_0x4e0054)return null;_0x5e5152[_0x82fe('0x24')][_0x82fe('0x6d')]=_0x4e0054;return _0x5e5152;})[_0x82fe('0x1d')](function(_0x1ed25){if(_0x1ed25){if(_0x5bb1ae[_0x82fe('0x50')][_0x82fe('0x71')]){_0x5e5152[_0x82fe('0x24')][_0x82fe('0x72')]=util[_0x82fe('0x58')](_0x82fe('0x73'),_0x5bb1ae[_0x82fe('0x5a')][_0x82fe('0x31')]);_0x5e5152[_0x82fe('0x24')][_0x82fe('0x74')]=_0x5e5152[_0x82fe('0x74')];_0x5e5152['message'][_0x82fe('0x75')]=_0x5e5152[_0x82fe('0x74')];_0x5e5152[_0x82fe('0x24')][_0x82fe('0x76')]=_0x82fe('0x54');return respondWithRpcPromise('EventManager',_0x82fe('0x77'),{'event':_0x82fe('0x78'),'message':_0x5e5152[_0x82fe('0x24')]},client9002)[_0x82fe('0x1d')](function(){return _0x5e5152;});}return _0x5e5152;}return null;})[_0x82fe('0x1d')](respondWithResult(_0x6b1783,null))[_0x82fe('0x4a')](handleError(_0x6b1783,null));};var interaction_log=require(_0x82fe('0x13'))(_0x82fe('0x79'));exports[_0x82fe('0x2f')]=function(_0x41e6fe,_0x3d7fe3,_0x326acc){var _0x286bae={'agent':{},'channel':_0x82fe('0x55')};if(_0x41e6fe[_0x82fe('0x50')]['id']){delete _0x41e6fe[_0x82fe('0x50')]['id'];}_0x41e6fe[_0x82fe('0x50')][_0x82fe('0x59')]=_0x41e6fe[_0x82fe('0x50')]['UserId']||_0x41e6fe[_0x82fe('0x5a')]['id'];_0x286bae[_0x82fe('0x6d')]['id']=_0x41e6fe[_0x82fe('0x50')][_0x82fe('0x59')];return db[_0x82fe('0x34')][_0x82fe('0x4f')]({'where':{'id':_0x41e6fe[_0x82fe('0x4c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d7fe3,null))[_0x82fe('0x1d')](function(_0x2b6206){if(_0x2b6206){_0x286bae['message']=_0x2b6206['get']({'plain':!![]});return db[_0x82fe('0x5c')][_0x82fe('0x4f')]({'where':{'id':_0x2b6206[_0x82fe('0x5d')]}});}return null;})[_0x82fe('0x1d')](handleEntityNotFound(_0x3d7fe3,null))['then'](function(_0x3bf4f0){if(_0x3bf4f0){_0x286bae[_0x82fe('0x60')]=_0x3bf4f0[_0x82fe('0x5b')]({'plain':!![]});interaction_log[_0x82fe('0x1e')](_0x82fe('0x7a'),_0x41e6fe[_0x82fe('0x5a')]['id'],_0x41e6fe[_0x82fe('0x5a')][_0x82fe('0x31')],_0x41e6fe[_0x82fe('0x5a')][_0x82fe('0x62')],_0x286bae[_0x82fe('0x60')]['id'],_0x41e6fe[_0x82fe('0x50')]?JSON['stringify'](_0x41e6fe[_0x82fe('0x50')]):'null');return respondWithRpcPromise(_0x82fe('0x7b'),_0x82fe('0x7c'),_0x286bae);}return null;})[_0x82fe('0x1d')](function(_0x522c6c){var _0x5e7f50=_0x82fe('0x65')+_0x522c6c['message'][_0x82fe('0x66')];return db[_0x82fe('0x67')]['query'](_0x5e7f50,{'type':db[_0x82fe('0x68')][_0x82fe('0x69')][_0x82fe('0x6a')],'raw':!![]})[_0x82fe('0x1d')](function(_0x3589f7){return _0x3589f7;});})['then'](function(_0x517a1d){if(_0x517a1d){_0x286bae[_0x82fe('0x24')][_0x82fe('0x6b')]=_0x517a1d[0x0];if(!_0x41e6fe[_0x82fe('0x50')][_0x82fe('0x59')])return;return db['User'][_0x82fe('0x4f')]({'where':{'id':_0x41e6fe['body'][_0x82fe('0x59')],'role':_0x82fe('0x6d')},'attributes':['id',_0x82fe('0x31'),'fullname','email',_0x82fe('0x70')],'raw':!![]});}return null;})['then'](function(_0x17de5d){if(!_0x17de5d)return null;_0x286bae[_0x82fe('0x24')][_0x82fe('0x6d')]=_0x17de5d;return _0x286bae;})[_0x82fe('0x1d')](function(_0x1ffd79){if(_0x1ffd79){_0x1ffd79[_0x82fe('0x24')][_0x82fe('0x72')]=util[_0x82fe('0x58')]('SIP/%s',_0x41e6fe[_0x82fe('0x5a')][_0x82fe('0x31')]);_0x1ffd79[_0x82fe('0x24')]['channel']=_0x286bae['channel'];_0x1ffd79[_0x82fe('0x24')][_0x82fe('0x75')]=_0x286bae[_0x82fe('0x74')];_0x1ffd79[_0x82fe('0x24')]['event']=_0x82fe('0x2f');respondWithRpcPromise(_0x82fe('0x77'),_0x82fe('0x77'),{'event':_0x82fe('0x7d'),'message':_0x1ffd79[_0x82fe('0x24')]},client9002);return _0x286bae;}return null;})[_0x82fe('0x1d')](respondWithResult(_0x3d7fe3,null))[_0x82fe('0x4a')](handleError(_0x3d7fe3,null));};exports[_0x82fe('0x26')]=function(_0x30866e,_0x12012e,_0x562ae6){if(_0x30866e[_0x82fe('0x50')]['id']){delete _0x30866e[_0x82fe('0x50')]['id'];}var _0x25fa1b;return db[_0x82fe('0x34')]['find']({'where':{'id':_0x30866e[_0x82fe('0x4c')]['id']}})[_0x82fe('0x1d')](handleEntityNotFound(_0x12012e,null))['then'](function(_0x5f2a50){if(_0x5f2a50){_0x25fa1b=_0x5f2a50;return db[_0x82fe('0x7e')][_0x82fe('0x4f')]({'where':{'id':_0x5f2a50['WhatsappAccountId']}});}})[_0x82fe('0x1d')](handleEntityNotFound(_0x12012e,null))[_0x82fe('0x1d')](function(_0x141c03){if(_0x141c03){logger[_0x82fe('0x21')](_0x82fe('0x7f'),'status',_0x82fe('0x80'),_0x141c03[_0x82fe('0x37')],util['inspect'](_0x30866e[_0x82fe('0x50')],{'showHidden':![],'depth':null}));switch(_0x141c03[_0x82fe('0x37')]){case'twilio':if(_0x30866e[_0x82fe('0x50')][_0x82fe('0x81')]&&_0x30866e['body'][_0x82fe('0x81')]===_0x25fa1b['messageId']&&_0x30866e[_0x82fe('0x50')][_0x82fe('0x82')]&&_0x30866e[_0x82fe('0x50')][_0x82fe('0x82')]===_0x82fe('0x56')){return _0x25fa1b[_0x82fe('0x51')]({'read':!![]});}else{logger[_0x82fe('0x23')](_0x82fe('0x83'),'status',_0x82fe('0x84'),util[_0x82fe('0x85')](_0x30866e[_0x82fe('0x50')],{'showHidden':![],'depth':null}));}break;}return _0x25fa1b;}})['then'](respondWithResult(_0x12012e,null))[_0x82fe('0x4a')](handleError(_0x12012e,null));}; \ No newline at end of file +var _0x221d=['WhatsappMessage','includeAll','findAll','catch','show','keys','find','create','body','params','destroy','describe','whatsapp-interactions','accept','whatsapp','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteractionId','isNil','read1stAt','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','fullname','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','options'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x221d,0x14a));var _0xd221=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x221d[_0xd13a88];return _0x1c993c;};'use strict';var emlformat=require(_0xd221('0x0'));var rimraf=require(_0xd221('0x1'));var zipdir=require(_0xd221('0x2'));var jsonpatch=require(_0xd221('0x3'));var rp=require(_0xd221('0x4'));var moment=require(_0xd221('0x5'));var BPromise=require(_0xd221('0x6'));var Mustache=require(_0xd221('0x7'));var util=require('util');var path=require(_0xd221('0x8'));var sox=require(_0xd221('0x9'));var csv=require(_0xd221('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd221('0xb'));var _=require(_0xd221('0xc'));var squel=require(_0xd221('0xd'));var crypto=require(_0xd221('0xe'));var jsforce=require(_0xd221('0xf'));var deskjs=require(_0xd221('0x10'));var toCsv=require(_0xd221('0xa'));var querystring=require(_0xd221('0x11'));var Papa=require(_0xd221('0x12'));var Redis=require(_0xd221('0x13'));var authService=require(_0xd221('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd221('0x15'))(_0xd221('0x16'));var utils=require('../../config/utils');var config=require(_0xd221('0x17'));var licenseUtil=require(_0xd221('0x18'));var db=require(_0xd221('0x19'))['db'];config[_0xd221('0x1a')]=_[_0xd221('0x1b')](config[_0xd221('0x1a')],{'host':_0xd221('0x1c'),'port':0x18eb});var socket=require(_0xd221('0x1d'))(new Redis(config[_0xd221('0x1a')]));require('./whatsappMessage.socket')[_0xd221('0x1e')](socket);var jayson=require(_0xd221('0x1f'));var client=jayson['client'][_0xd221('0x20')]({'port':0x232c});var client9002=jayson[_0xd221('0x21')][_0xd221('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4c3bb8,_0x14ccc9,_0x4fc1fb,_0x4e57f6){return new BPromise(function(_0x58d1b9,_0x1f8c85){var _0x2e7ac3=_0x4e57f6||client;return _0x2e7ac3[_0xd221('0x22')](_0x4c3bb8,_0x4fc1fb)[_0xd221('0x23')](function(_0xca11c1){logger[_0xd221('0x24')](_0xd221('0x25'),_0x14ccc9,_0xd221('0x26'));logger[_0xd221('0x27')](_0xd221('0x28'),_0x14ccc9,'request\x20sent',JSON[_0xd221('0x29')](_0xca11c1));if(_0xca11c1[_0xd221('0x2a')]){if(_0xca11c1[_0xd221('0x2a')][_0xd221('0x2b')]===0x1f4){logger['error'](_0xd221('0x25'),_0x14ccc9,_0xca11c1[_0xd221('0x2a')]['message']);return _0x1f8c85(_0xca11c1[_0xd221('0x2a')]['message']);}logger[_0xd221('0x2a')](_0xd221('0x25'),_0x14ccc9,_0xca11c1[_0xd221('0x2a')]['message']);return _0x58d1b9(_0xca11c1[_0xd221('0x2a')][_0xd221('0x2c')]);}else{logger[_0xd221('0x24')](_0xd221('0x25'),_0x14ccc9,_0xd221('0x26'));_0x58d1b9(_0xca11c1[_0xd221('0x2d')]['message']);}})['catch'](function(_0x2859a9){logger[_0xd221('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x14ccc9,_0x2859a9);_0x1f8c85(_0x2859a9);});});}function respondWithStatusCode(_0x2f32e6,_0x123459){_0x123459=_0x123459||0xcc;return function(_0x21fe33){if(_0x21fe33){return _0x2f32e6[_0xd221('0x2e')](_0x123459);}return _0x2f32e6[_0xd221('0x2f')](_0x123459)[_0xd221('0x30')]();};}function respondWithResult(_0x5a5be5,_0x301cf6){_0x301cf6=_0x301cf6||0xc8;return function(_0xaa0746){if(_0xaa0746){return _0x5a5be5[_0xd221('0x2f')](_0x301cf6)[_0xd221('0x31')](_0xaa0746);}};}function respondWithFilteredResult(_0x45b3e1,_0x33ccd9){return function(_0x31cc8c){if(_0x31cc8c){var _0x434f72=typeof _0x33ccd9['offset']===_0xd221('0x32')&&typeof _0x33ccd9['limit']===_0xd221('0x32');var _0x473638=_0x31cc8c[_0xd221('0x33')];var _0x2ba458=_0x434f72?0x0:_0x33ccd9[_0xd221('0x34')];var _0x12ac2d=_0x434f72?_0x31cc8c[_0xd221('0x33')]:_0x33ccd9[_0xd221('0x34')]+_0x33ccd9[_0xd221('0x35')];var _0x743329;if(_0x12ac2d>=_0x473638){_0x12ac2d=_0x473638;_0x743329=0xc8;}else{_0x743329=0xce;}_0x45b3e1[_0xd221('0x2f')](_0x743329);return _0x45b3e1[_0xd221('0x36')](_0xd221('0x37'),_0x2ba458+'-'+_0x12ac2d+'/'+_0x473638)[_0xd221('0x31')](_0x31cc8c);}return null;};}function patchUpdates(_0x4a3012){return function(_0x21f674){try{jsonpatch[_0xd221('0x38')](_0x21f674,_0x4a3012,!![]);}catch(_0x2f1190){return BPromise[_0xd221('0x39')](_0x2f1190);}return _0x21f674['save']();};}function saveUpdates(_0x4983a6,_0xeeef8e){return function(_0x1ca438){if(_0x1ca438){return _0x1ca438[_0xd221('0x3a')](_0x4983a6)['then'](function(_0x178710){return _0x178710;});}return null;};}function removeEntity(_0x6436fc,_0x3d84b7){return function(_0x240f1f){if(_0x240f1f){return _0x240f1f['destroy']()['then'](function(){_0x6436fc[_0xd221('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29a2d5,_0x1a4855){return function(_0x4179a3){if(!_0x4179a3){_0x29a2d5[_0xd221('0x2e')](0x194);}return _0x4179a3;};}function handleError(_0x4db07b,_0x325f5c){_0x325f5c=_0x325f5c||0x1f4;return function(_0x194166){logger['error'](_0x194166['stack']);if(_0x194166[_0xd221('0x3b')]){delete _0x194166[_0xd221('0x3b')];}_0x4db07b[_0xd221('0x2f')](_0x325f5c)[_0xd221('0x3c')](_0x194166);};}exports[_0xd221('0x3d')]=function(_0x24d898,_0x4ef0b2){var _0x5854c9={},_0x55db25={},_0x1ffdf7={'count':0x0,'rows':[]};var _0x442057=_['map'](db['WhatsappMessage'][_0xd221('0x3e')],function(_0x56ddcd){return{'name':_0x56ddcd[_0xd221('0x3f')],'type':_0x56ddcd[_0xd221('0x40')][_0xd221('0x41')]};});_0x55db25[_0xd221('0x42')]=_[_0xd221('0x43')](_0x442057,'name');_0x55db25[_0xd221('0x44')]=_['keys'](_0x24d898[_0xd221('0x44')]);_0x55db25[_0xd221('0x45')]=_[_0xd221('0x46')](_0x55db25[_0xd221('0x42')],_0x55db25[_0xd221('0x44')]);_0x5854c9[_0xd221('0x47')]=_[_0xd221('0x46')](_0x55db25[_0xd221('0x42')],qs[_0xd221('0x48')](_0x24d898[_0xd221('0x44')][_0xd221('0x48')]));_0x5854c9[_0xd221('0x47')]=_0x5854c9[_0xd221('0x47')][_0xd221('0x49')]?_0x5854c9[_0xd221('0x47')]:_0x55db25['model'];if(!_0x24d898[_0xd221('0x44')]['hasOwnProperty'](_0xd221('0x4a'))){_0x5854c9[_0xd221('0x35')]=qs[_0xd221('0x35')](_0x24d898['query'][_0xd221('0x35')]);_0x5854c9['offset']=qs['offset'](_0x24d898[_0xd221('0x44')][_0xd221('0x34')]);}_0x5854c9[_0xd221('0x4b')]=qs['sort'](_0x24d898[_0xd221('0x44')][_0xd221('0x4c')]);_0x5854c9[_0xd221('0x4d')]=qs[_0xd221('0x45')](_[_0xd221('0x4e')](_0x24d898[_0xd221('0x44')],_0x55db25[_0xd221('0x45')]),_0x442057);if(_0x24d898['query'][_0xd221('0x4f')]){_0x5854c9[_0xd221('0x4d')]=_['merge'](_0x5854c9[_0xd221('0x4d')],{'$or':_[_0xd221('0x43')](_0x442057,function(_0x362cef){if(_0x362cef[_0xd221('0x40')]!=='VIRTUAL'){var _0x5d0a8b={};_0x5d0a8b[_0x362cef[_0xd221('0x3b')]]={'$like':'%'+_0x24d898[_0xd221('0x44')]['filter']+'%'};return _0x5d0a8b;}})});}_0x5854c9=_['merge']({},_0x5854c9,_0x24d898[_0xd221('0x50')]);var _0x4f21b8={'where':_0x5854c9[_0xd221('0x4d')]};return db[_0xd221('0x51')][_0xd221('0x33')](_0x4f21b8)[_0xd221('0x23')](function(_0x110ccb){_0x1ffdf7[_0xd221('0x33')]=_0x110ccb;if(_0x24d898['query'][_0xd221('0x52')]){_0x5854c9['include']=[{'all':!![]}];}return db[_0xd221('0x51')][_0xd221('0x53')](_0x5854c9);})['then'](function(_0x2a7d2c){_0x1ffdf7['rows']=_0x2a7d2c;return _0x1ffdf7;})[_0xd221('0x23')](respondWithFilteredResult(_0x4ef0b2,_0x5854c9))[_0xd221('0x54')](handleError(_0x4ef0b2,null));};exports[_0xd221('0x55')]=function(_0x10b367,_0x1f4f3a){var _0x38745a={'raw':!![],'where':{'id':_0x10b367['params']['id']}},_0x5cc861={};_0x5cc861[_0xd221('0x42')]=_[_0xd221('0x56')](db[_0xd221('0x51')]['rawAttributes']);_0x5cc861[_0xd221('0x44')]=_['keys'](_0x10b367[_0xd221('0x44')]);_0x5cc861['filters']=_['intersection'](_0x5cc861['model'],_0x5cc861['query']);_0x38745a['attributes']=_[_0xd221('0x46')](_0x5cc861[_0xd221('0x42')],qs[_0xd221('0x48')](_0x10b367[_0xd221('0x44')][_0xd221('0x48')]));_0x38745a[_0xd221('0x47')]=_0x38745a[_0xd221('0x47')][_0xd221('0x49')]?_0x38745a[_0xd221('0x47')]:_0x5cc861['model'];if(_0x10b367[_0xd221('0x44')][_0xd221('0x52')]){_0x38745a['include']=[{'all':!![]}];}_0x38745a=_['merge']({},_0x38745a,_0x10b367['options']);return db[_0xd221('0x51')][_0xd221('0x57')](_0x38745a)[_0xd221('0x23')](handleEntityNotFound(_0x1f4f3a,null))[_0xd221('0x23')](respondWithResult(_0x1f4f3a,null))['catch'](handleError(_0x1f4f3a,null));};exports[_0xd221('0x58')]=function(_0x471be1,_0x3b191d){return db[_0xd221('0x51')][_0xd221('0x58')](_0x471be1['body'],{})[_0xd221('0x23')](respondWithResult(_0x3b191d,0xc9))[_0xd221('0x54')](handleError(_0x3b191d,null));};exports[_0xd221('0x3a')]=function(_0x1f9010,_0x5375fa){if(_0x1f9010['body']['id']){delete _0x1f9010[_0xd221('0x59')]['id'];}return db[_0xd221('0x51')][_0xd221('0x57')]({'where':{'id':_0x1f9010[_0xd221('0x5a')]['id']}})[_0xd221('0x23')](handleEntityNotFound(_0x5375fa,null))[_0xd221('0x23')](saveUpdates(_0x1f9010[_0xd221('0x59')],null))[_0xd221('0x23')](respondWithResult(_0x5375fa,null))[_0xd221('0x54')](handleError(_0x5375fa,null));};exports[_0xd221('0x5b')]=function(_0x51b46f,_0x2a1259){return db[_0xd221('0x51')][_0xd221('0x57')]({'where':{'id':_0x51b46f[_0xd221('0x5a')]['id']}})[_0xd221('0x23')](handleEntityNotFound(_0x2a1259,null))[_0xd221('0x23')](removeEntity(_0x2a1259,null))['catch'](handleError(_0x2a1259,null));};exports[_0xd221('0x5c')]=function(_0x185747,_0x1b9c02){return db[_0xd221('0x51')][_0xd221('0x5c')]()[_0xd221('0x23')](respondWithResult(_0x1b9c02,null))[_0xd221('0x54')](handleError(_0x1b9c02,null));};var interaction_log=require('../../config/logger')(_0xd221('0x5d'));exports[_0xd221('0x5e')]=function(_0x3505ec,_0x4af300,_0x4697b6){var _0x25fe88={'agent':{},'channel':_0xd221('0x5f')};if(_0x3505ec[_0xd221('0x59')]['id']){delete _0x3505ec[_0xd221('0x59')]['id'];}_0x3505ec[_0xd221('0x59')][_0xd221('0x60')]=!![];_0x3505ec[_0xd221('0x59')]['readAt']=moment()['format'](_0xd221('0x61'));_0x3505ec[_0xd221('0x59')][_0xd221('0x62')]=_0x3505ec['body'][_0xd221('0x62')]||_0x3505ec['user']['id'];_0x25fe88[_0xd221('0x63')]['id']=_0x3505ec['body'][_0xd221('0x62')];return db[_0xd221('0x51')][_0xd221('0x57')]({'where':{'id':_0x3505ec[_0xd221('0x5a')]['id'],'UserId':null}})[_0xd221('0x23')](handleEntityNotFound(_0x4af300,null))[_0xd221('0x23')](saveUpdates(_0x3505ec[_0xd221('0x59')],null))[_0xd221('0x23')](function(_0x4dba4e){if(_0x4dba4e){_0x25fe88[_0xd221('0x2c')]=_0x4dba4e['get']({'plain':!![]});return db['WhatsappInteraction'][_0xd221('0x57')]({'where':{'id':_0x4dba4e[_0xd221('0x64')]}});}return null;})[_0xd221('0x23')](handleEntityNotFound(_0x4af300,null))[_0xd221('0x23')](function(_0x1c3f5c){if(_0x1c3f5c){return _0x1c3f5c['update']({'UserId':_0x3505ec[_0xd221('0x59')][_0xd221('0x62')],'read1stAt':_[_0xd221('0x65')](_0x1c3f5c[_0xd221('0x66')])?moment()[_0xd221('0x67')](_0xd221('0x61')):undefined});}return null;})[_0xd221('0x23')](function(_0x9e6387){if(_0x9e6387){_0x25fe88[_0xd221('0x68')]=_0x9e6387[_0xd221('0x69')]({'plain':!![]});interaction_log[_0xd221('0x24')](_0xd221('0x6a'),_0x3505ec[_0xd221('0x6b')]['id'],_0x3505ec['user'][_0xd221('0x3b')],_0x3505ec[_0xd221('0x6b')][_0xd221('0x6c')],_0x25fe88[_0xd221('0x68')]['id'],_0x3505ec['body']?JSON[_0xd221('0x29')](_0x3505ec['body']):_0xd221('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x25fe88);}return null;})['then'](function(_0x512016){var _0x2339de=_0xd221('0x6e')+_0x512016[_0xd221('0x2c')]['ContactId'];return db[_0xd221('0x6f')][_0xd221('0x44')](_0x2339de,{'type':db['Sequelize'][_0xd221('0x70')][_0xd221('0x71')],'raw':!![]})[_0xd221('0x23')](function(_0x2a62a3){return _0x2a62a3;});})[_0xd221('0x23')](function(_0x1fafca){if(_0x1fafca){_0x25fe88['message'][_0xd221('0x72')]=_0x1fafca[0x0];if(!_0x3505ec[_0xd221('0x59')]['UserId'])return;return db[_0xd221('0x73')][_0xd221('0x57')]({'where':{'id':_0x3505ec[_0xd221('0x59')][_0xd221('0x62')],'role':_0xd221('0x63')},'attributes':['id',_0xd221('0x3b'),'fullname',_0xd221('0x74'),_0xd221('0x75')],'raw':!![]});}return null;})['then'](function(_0x32cf5c){if(!_0x32cf5c)return null;_0x25fe88[_0xd221('0x2c')][_0xd221('0x63')]=_0x32cf5c;return _0x25fe88;})[_0xd221('0x23')](function(_0x18ae87){if(_0x18ae87){if(_0x3505ec[_0xd221('0x59')][_0xd221('0x76')]){_0x25fe88[_0xd221('0x2c')]['interface']=util['format'](_0xd221('0x77'),_0x3505ec[_0xd221('0x6b')][_0xd221('0x3b')]);_0x25fe88['message'][_0xd221('0x78')]=_0x25fe88[_0xd221('0x78')];_0x25fe88['message'][_0xd221('0x79')]=_0x25fe88['channel'];_0x25fe88[_0xd221('0x2c')]['event']='accept';return respondWithRpcPromise(_0xd221('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x25fe88[_0xd221('0x2c')]},client9002)[_0xd221('0x23')](function(){return _0x25fe88;});}return _0x25fe88;}return null;})['then'](respondWithResult(_0x4af300,null))[_0xd221('0x54')](handleError(_0x4af300,null));};var interaction_log=require(_0xd221('0x15'))(_0xd221('0x5d'));exports['reject']=function(_0x5c9c9c,_0x39d842,_0x571998){var _0x1a97e2={'agent':{},'channel':_0xd221('0x5f')};if(_0x5c9c9c[_0xd221('0x59')]['id']){delete _0x5c9c9c[_0xd221('0x59')]['id'];}_0x5c9c9c[_0xd221('0x59')][_0xd221('0x62')]=_0x5c9c9c[_0xd221('0x59')][_0xd221('0x62')]||_0x5c9c9c[_0xd221('0x6b')]['id'];_0x1a97e2[_0xd221('0x63')]['id']=_0x5c9c9c[_0xd221('0x59')][_0xd221('0x62')];return db[_0xd221('0x51')][_0xd221('0x57')]({'where':{'id':_0x5c9c9c[_0xd221('0x5a')]['id'],'UserId':null}})[_0xd221('0x23')](handleEntityNotFound(_0x39d842,null))[_0xd221('0x23')](function(_0x275b30){if(_0x275b30){_0x1a97e2[_0xd221('0x2c')]=_0x275b30[_0xd221('0x69')]({'plain':!![]});return db[_0xd221('0x7b')][_0xd221('0x57')]({'where':{'id':_0x275b30[_0xd221('0x64')]}});}return null;})[_0xd221('0x23')](handleEntityNotFound(_0x39d842,null))['then'](function(_0x3aefa0){if(_0x3aefa0){_0x1a97e2[_0xd221('0x68')]=_0x3aefa0[_0xd221('0x69')]({'plain':!![]});interaction_log['info'](_0xd221('0x7c'),_0x5c9c9c[_0xd221('0x6b')]['id'],_0x5c9c9c[_0xd221('0x6b')][_0xd221('0x3b')],_0x5c9c9c['user'][_0xd221('0x6c')],_0x1a97e2[_0xd221('0x68')]['id'],_0x5c9c9c['body']?JSON[_0xd221('0x29')](_0x5c9c9c[_0xd221('0x59')]):_0xd221('0x6d'));return respondWithRpcPromise(_0xd221('0x7d'),'rejectMessage',_0x1a97e2);}return null;})[_0xd221('0x23')](function(_0x4b5bba){var _0x56e973=_0xd221('0x6e')+_0x4b5bba[_0xd221('0x2c')][_0xd221('0x7e')];return db[_0xd221('0x6f')][_0xd221('0x44')](_0x56e973,{'type':db['Sequelize'][_0xd221('0x70')]['SELECT'],'raw':!![]})[_0xd221('0x23')](function(_0x28e6bf){return _0x28e6bf;});})['then'](function(_0x5d238f){if(_0x5d238f){_0x1a97e2['message'][_0xd221('0x72')]=_0x5d238f[0x0];if(!_0x5c9c9c[_0xd221('0x59')][_0xd221('0x62')])return;return db['User'][_0xd221('0x57')]({'where':{'id':_0x5c9c9c[_0xd221('0x59')][_0xd221('0x62')],'role':'agent'},'attributes':['id',_0xd221('0x3b'),_0xd221('0x7f'),_0xd221('0x74'),'internal'],'raw':!![]});}return null;})[_0xd221('0x23')](function(_0x182d42){if(!_0x182d42)return null;_0x1a97e2[_0xd221('0x2c')][_0xd221('0x63')]=_0x182d42;return _0x1a97e2;})['then'](function(_0x26b630){if(_0x26b630){_0x26b630[_0xd221('0x2c')]['interface']=util[_0xd221('0x67')](_0xd221('0x77'),_0x5c9c9c[_0xd221('0x6b')][_0xd221('0x3b')]);_0x26b630[_0xd221('0x2c')][_0xd221('0x78')]=_0x1a97e2[_0xd221('0x78')];_0x26b630[_0xd221('0x2c')][_0xd221('0x79')]=_0x1a97e2[_0xd221('0x78')];_0x26b630[_0xd221('0x2c')][_0xd221('0x80')]='reject';respondWithRpcPromise(_0xd221('0x7a'),_0xd221('0x7a'),{'event':'rejectmessage','message':_0x26b630[_0xd221('0x2c')]},client9002);return _0x1a97e2;}return null;})[_0xd221('0x23')](respondWithResult(_0x39d842,null))[_0xd221('0x54')](handleError(_0x39d842,null));};exports[_0xd221('0x2f')]=function(_0x430ce8,_0x2abeab,_0xe09c9e){if(_0x430ce8[_0xd221('0x59')]['id']){delete _0x430ce8[_0xd221('0x59')]['id'];}var _0x198919;return db[_0xd221('0x51')][_0xd221('0x57')]({'where':{'id':_0x430ce8[_0xd221('0x5a')]['id']}})[_0xd221('0x23')](handleEntityNotFound(_0x2abeab,null))[_0xd221('0x23')](function(_0x15650a){if(_0x15650a){_0x198919=_0x15650a;return db[_0xd221('0x81')]['find']({'where':{'id':_0x15650a[_0xd221('0x82')]}});}})[_0xd221('0x23')](handleEntityNotFound(_0x2abeab,null))[_0xd221('0x23')](function(_0x793aa2){if(_0x793aa2){logger['debug'](_0xd221('0x83'),_0xd221('0x2f'),_0xd221('0x84'),_0x793aa2[_0xd221('0x40')],util['inspect'](_0x430ce8[_0xd221('0x59')],{'showHidden':![],'depth':null}));switch(_0x793aa2[_0xd221('0x40')]){case _0xd221('0x85'):if(_0x430ce8[_0xd221('0x59')][_0xd221('0x86')]&&_0x430ce8['body'][_0xd221('0x86')]===_0x198919['messageId']&&_0x430ce8['body'][_0xd221('0x87')]&&_0x430ce8[_0xd221('0x59')][_0xd221('0x87')]===_0xd221('0x60')){return _0x198919[_0xd221('0x3a')]({'read':!![]});}else{logger[_0xd221('0x2a')](_0xd221('0x88'),'status',_0xd221('0x85'),util['inspect'](_0x430ce8[_0xd221('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x198919;}})['then'](respondWithResult(_0x2abeab,null))[_0xd221('0x54')](handleError(_0x2abeab,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 412b45b..97c08f3 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1752=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x228046,_0x14abd2){var _0x4ff467=function(_0x536af1){while(--_0x536af1){_0x228046['push'](_0x228046['shift']());}};_0x4ff467(++_0x14abd2);}(_0x1752,0xa5));var _0x2175=function(_0x132ccf,_0x43074f){_0x132ccf=_0x132ccf-0x0;var _0x496e49=_0x1752[_0x132ccf];return _0x496e49;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2175('0x0'))['db'][_0x2175('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2175('0x2')](0x0);var events={'afterCreate':_0x2175('0x3'),'afterUpdate':_0x2175('0x4'),'afterDestroy':_0x2175('0x5')};function emitEvent(_0x56c315){return function(_0x1ee277,_0x22c167,_0x12b8d9){WhatsappMessageEvents[_0x2175('0x6')](_0x56c315+':'+_0x1ee277['id'],_0x1ee277);WhatsappMessageEvents[_0x2175('0x6')](_0x56c315,_0x1ee277);_0x12b8d9(null);};}for(var e in events){if(events[_0x2175('0x7')](e)){var event=events[e];WhatsappMessage[_0x2175('0x8')](e,emitEvent(event));}}module[_0x2175('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x6324=['hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','emit'];(function(_0x4ecefd,_0x270199){var _0x5c5978=function(_0x1f0d0b){while(--_0x1f0d0b){_0x4ecefd['push'](_0x4ecefd['shift']());}};_0x5c5978(++_0x270199);}(_0x6324,0x142));var _0x4632=function(_0x30a956,_0x11222e){_0x30a956=_0x30a956-0x0;var _0x2ac17d=_0x6324[_0x30a956];return _0x2ac17d;};'use strict';var EventEmitter=require(_0x4632('0x0'));var WhatsappMessage=require(_0x4632('0x1'))['db'][_0x4632('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4632('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bea40){return function(_0x54c200,_0x13b218,_0x592e39){WhatsappMessageEvents[_0x4632('0x5')](_0x3bea40+':'+_0x54c200['id'],_0x54c200);WhatsappMessageEvents[_0x4632('0x5')](_0x3bea40,_0x54c200);_0x592e39(null);};}for(var e in events){if(events[_0x4632('0x6')](e)){var event=events[e];WhatsappMessage[_0x4632('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index ad07456..8939101 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x67bb=['token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/whatsapp/v1/','text','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','phone','accountSid','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x67bb,0x1a4));var _0xb67b=function(_0x129146,_0x4041ef){_0x129146=_0x129146-0x0;var _0x300e5e=_0x67bb[_0x129146];return _0x300e5e;};'use strict';var _=require(_0xb67b('0x0'));var util=require(_0xb67b('0x1'));var logger=require(_0xb67b('0x2'))('api');var moment=require(_0xb67b('0x3'));var BPromise=require(_0xb67b('0x4'));var rp=require(_0xb67b('0x5'));var fetch=require(_0xb67b('0x6'));var fs=require('fs');var path=require(_0xb67b('0x7'));var rimraf=require(_0xb67b('0x8'));var config=require(_0xb67b('0x9'));var attributes=require(_0xb67b('0xa'));module['exports']=function(_0x373f79,_0x2b36ba){return _0x373f79[_0xb67b('0xb')](_0xb67b('0xc'),attributes,{'tableName':_0xb67b('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb67b('0xe')]},{'name':_0xb67b('0xf'),'fields':[_0xb67b('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39634b,_0x3a3904,_0xbbe0aa){var _0x51d561=_0x373f79[_0xb67b('0x11')];var _0x88cfee=_0x39634b[_0xb67b('0x12')]({'plain':!![]});if(_0x88cfee[_0xb67b('0x13')][_0xb67b('0x14')]()==='in'||_0x88cfee[_0xb67b('0x13')][_0xb67b('0x14')]()===_0xb67b('0x15')&&!_0x88cfee[_0xb67b('0x16')]&&!_[_0xb67b('0x17')](_0x88cfee[_0xb67b('0x18')])){_0x51d561[_0xb67b('0x19')]['findOne']({'where':{'id':_0x88cfee[_0xb67b('0x1a')]}})[_0xb67b('0x1b')](function(_0x623f97){if(_0x623f97){_0x623f97[_0xb67b('0x1c')]({'lastMsgAt':_0x88cfee[_0xb67b('0x1d')],'lastMsgDirection':_0x88cfee['direction'][_0xb67b('0x14')]()});}})[_0xb67b('0x1e')](function(_0x610c4a){console['error'](_0x610c4a);});}if(_0x88cfee[_0xb67b('0x13')]===_0xb67b('0x15')&&!_0x88cfee[_0xb67b('0x16')]){var _0x51a9c3;_0x51d561[_0xb67b('0x1f')][_0xb67b('0x20')]({'where':{'id':_0x88cfee[_0xb67b('0x21')]},'raw':!![]})[_0xb67b('0x1b')](function(_0xc32c91){_0x51a9c3=_0xc32c91;if(_0x51a9c3&&_0x51a9c3[_0xb67b('0x22')]){switch(_0x51a9c3[_0xb67b('0x22')]){case _0xb67b('0x23'):var _0x1b33f3=require(_0xb67b('0x23'));if(_0x51a9c3['accountSid']&&_0x51a9c3['authToken']&&_0x51a9c3[_0xb67b('0x24')]){var _0x57ace4=new _0x1b33f3(_0x51a9c3[_0xb67b('0x25')],_0x51a9c3[_0xb67b('0x26')]);_0x57ace4[_0xb67b('0x27')][_0xb67b('0x28')]({'body':_0x88cfee[_0xb67b('0x10')],'to':'whatsapp:'+_0x88cfee[_0xb67b('0x24')],'from':_0xb67b('0x29')+_0x51a9c3[_0xb67b('0x24')],'statusCallback':_0x51a9c3[_0xb67b('0x2a')]+_0xb67b('0x2b')+_0x88cfee['id']+'/status?token='+_0x51a9c3[_0xb67b('0x2c')]})['then'](function(_0x26ad13){if(_0x26ad13[_0xb67b('0x2d')]){return _0x39634b[_0xb67b('0x1c')]({'messageId':_0x26ad13[_0xb67b('0x2d')]});}})[_0xb67b('0x1e')](function(_0x4c4f27){logger['error'](_0xb67b('0x2e'),'afterCreate',_0xb67b('0x23'),util[_0xb67b('0x2f')](_0x4c4f27,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb67b('0x2e'),_0xb67b('0x30'),'twilio',_0xb67b('0x31'));}break;case'sinch':var _0x4923c7=_0x51a9c3[_0xb67b('0x25')];var _0x3d1074=_0x51a9c3[_0xb67b('0x26')];var _0x5c93b8=_0x51a9c3['baseUrl']+_0xb67b('0x32')+_0x4923c7+'/messages/';var _0x5e7950={'to':[_0x88cfee['phone']],'message':{'type':_0xb67b('0x33'),'text':_0x88cfee[_0xb67b('0x10')]}};var _0xbf0760={'method':'POST','uri':_0x5c93b8,'headers':{'Authorization':_0xb67b('0x34')+_0x3d1074,'Content-Type':'application/json'},'body':_0x5e7950,'json':!![]};rp(_0xbf0760)[_0xb67b('0x1b')](function(_0x5f2954){if(_0x5f2954[_0xb67b('0x35')][0x0][_0xb67b('0x36')]){return _0x39634b[_0xb67b('0x1c')]({'messageId':_0x5f2954[_0xb67b('0x35')][0x0][_0xb67b('0x36')]});}})[_0xb67b('0x1e')](function(_0x18b780){logger[_0xb67b('0x37')](_0xb67b('0x38'),_0x18b780);});break;}}})['finally'](function(){_0xbbe0aa();});}else{_0xbbe0aa();}}},'charset':_0xb67b('0x39'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa049=['err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','secret','WhatsappAccount','then','type','twilio','accountSid','authToken','phone','create','/api/whatsapp/messages/','/status?token=','sid','catch','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id'];(function(_0x307195,_0x275b0c){var _0x16c4f4=function(_0x83c0c1){while(--_0x83c0c1){_0x307195['push'](_0x307195['shift']());}};_0x16c4f4(++_0x275b0c);}(_0xa049,0x136));var _0x9a04=function(_0x3d09c7,_0x3ff87d){_0x3d09c7=_0x3d09c7-0x0;var _0x43db15=_0xa049[_0x3d09c7];return _0x43db15;};'use strict';var _=require('lodash');var util=require(_0x9a04('0x0'));var logger=require(_0x9a04('0x1'))(_0x9a04('0x2'));var moment=require(_0x9a04('0x3'));var BPromise=require(_0x9a04('0x4'));var rp=require(_0x9a04('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x9a04('0x6'));var rimraf=require(_0x9a04('0x7'));var config=require(_0x9a04('0x8'));var attributes=require(_0x9a04('0x9'));module[_0x9a04('0xa')]=function(_0x15d14a,_0x473f53){return _0x15d14a[_0x9a04('0xb')](_0x9a04('0xc'),attributes,{'tableName':_0x9a04('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x9a04('0xe')]},{'name':_0x9a04('0xf'),'fields':[_0x9a04('0x10')],'type':_0x9a04('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3e5780,_0x36d779,_0x337f7f){var _0x2f233d=_0x15d14a[_0x9a04('0x12')];var _0x3e7652=_0x3e5780[_0x9a04('0x13')]({'plain':!![]});if(_0x3e7652[_0x9a04('0x14')]['toLowerCase']()==='in'||_0x3e7652[_0x9a04('0x14')][_0x9a04('0x15')]()===_0x9a04('0x16')&&!_0x3e7652['secret']&&!_[_0x9a04('0x17')](_0x3e7652[_0x9a04('0x18')])){_0x2f233d[_0x9a04('0x19')][_0x9a04('0x1a')]({'where':{'id':_0x3e7652[_0x9a04('0x1b')]}})['then'](function(_0x11ddfb){if(_0x11ddfb){_0x11ddfb[_0x9a04('0x1c')]({'lastMsgAt':_0x3e7652[_0x9a04('0x1d')],'lastMsgDirection':_0x3e7652[_0x9a04('0x14')][_0x9a04('0x15')]()});}})['catch'](function(_0x1c2c66){console['error'](_0x1c2c66);});}if(_0x3e7652[_0x9a04('0x14')]==='out'&&!_0x3e7652[_0x9a04('0x1e')]){var _0x525bad;_0x2f233d[_0x9a04('0x1f')]['find']({'where':{'id':_0x3e7652['WhatsappAccountId']},'raw':!![]})[_0x9a04('0x20')](function(_0x2f4901){_0x525bad=_0x2f4901;if(_0x525bad&&_0x525bad[_0x9a04('0x21')]){switch(_0x525bad[_0x9a04('0x21')]){case _0x9a04('0x22'):var _0x57b027=require(_0x9a04('0x22'));if(_0x525bad[_0x9a04('0x23')]&&_0x525bad[_0x9a04('0x24')]&&_0x525bad[_0x9a04('0x25')]){var _0x13007d=new _0x57b027(_0x525bad[_0x9a04('0x23')],_0x525bad['authToken']);_0x13007d['messages'][_0x9a04('0x26')]({'body':_0x3e7652[_0x9a04('0x10')],'to':'whatsapp:'+_0x3e7652['phone'],'from':'whatsapp:'+_0x525bad['phone'],'statusCallback':_0x525bad['remote']+_0x9a04('0x27')+_0x3e7652['id']+_0x9a04('0x28')+_0x525bad['token']})[_0x9a04('0x20')](function(_0x42c998){if(_0x42c998['sid']){return _0x3e5780[_0x9a04('0x1c')]({'messageId':_0x42c998[_0x9a04('0x29')]});}})[_0x9a04('0x2a')](function(_0x43f7ae){logger[_0x9a04('0x2b')](_0x9a04('0x2c'),_0x9a04('0x2d'),_0x9a04('0x22'),util[_0x9a04('0x2e')](_0x43f7ae,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9a04('0x2d'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x9a04('0x2f'):var _0x23f7e7=_0x525bad[_0x9a04('0x23')];var _0xf1de5=_0x525bad[_0x9a04('0x24')];var _0x51c41d=_0x525bad[_0x9a04('0x30')]+_0x9a04('0x31')+_0x23f7e7+_0x9a04('0x32');var _0x274be9={'to':[_0x3e7652[_0x9a04('0x25')]],'message':{'type':_0x9a04('0x33'),'text':_0x3e7652['body']}};var _0x27821a={'method':_0x9a04('0x34'),'uri':_0x51c41d,'headers':{'Authorization':_0x9a04('0x35')+_0xf1de5,'Content-Type':'application/json'},'body':_0x274be9,'json':!![]};rp(_0x27821a)['then'](function(_0x1aadb4){if(_0x1aadb4[_0x9a04('0x36')][0x0][_0x9a04('0x37')]){return _0x3e5780[_0x9a04('0x1c')]({'messageId':_0x1aadb4['statuses'][0x0][_0x9a04('0x37')]});}})[_0x9a04('0x2a')](function(_0x587f41){logger[_0x9a04('0x38')](_0x9a04('0x39'),_0x587f41);});break;}}})[_0x9a04('0x3a')](function(){_0x337f7f();});}else{_0x337f7f();}}},'charset':_0x9a04('0x3b'),'collate':_0x9a04('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 79ae052..d3c5ea0 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1351=['then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','defaults','register','request'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1351,0x199));var _0x1135=function(_0x3ed6a6,_0x2eb801){_0x3ed6a6=_0x3ed6a6-0x0;var _0x42afee=_0x1351[_0x3ed6a6];return _0x42afee;};'use strict';var _=require('lodash');var util=require(_0x1135('0x0'));var moment=require(_0x1135('0x1'));var BPromise=require(_0x1135('0x2'));var rs=require(_0x1135('0x3'));var fs=require('fs');var Redis=require(_0x1135('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1135('0x5'));var logger=require('../../config/logger')(_0x1135('0x6'));var config=require('../../config/environment');var jayson=require(_0x1135('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1135('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x1135('0x9')](socket);function respondWithRpcPromise(_0x13ca6f,_0x4bec3d,_0x2e4da9){return new BPromise(function(_0x2ae82,_0x7afe3){return client[_0x1135('0xa')](_0x13ca6f,_0x2e4da9)[_0x1135('0xb')](function(_0x22e45b){logger[_0x1135('0xc')](_0x1135('0xd'),_0x4bec3d,_0x1135('0xe'));logger[_0x1135('0xf')](_0x1135('0x10'),_0x4bec3d,_0x1135('0xe'),JSON[_0x1135('0x11')](_0x22e45b));if(_0x22e45b[_0x1135('0x12')]){if(_0x22e45b[_0x1135('0x12')][_0x1135('0x13')]===0x1f4){logger[_0x1135('0x12')](_0x1135('0xd'),_0x4bec3d,_0x22e45b['error'][_0x1135('0x14')]);return _0x7afe3(_0x22e45b[_0x1135('0x12')][_0x1135('0x14')]);}logger['error'](_0x1135('0xd'),_0x4bec3d,_0x22e45b[_0x1135('0x12')][_0x1135('0x14')]);return _0x2ae82(_0x22e45b[_0x1135('0x12')][_0x1135('0x14')]);}else{logger[_0x1135('0xc')](_0x1135('0xd'),_0x4bec3d,_0x1135('0xe'));_0x2ae82(_0x22e45b[_0x1135('0x15')]['message']);}})[_0x1135('0x16')](function(_0x11776c){logger[_0x1135('0x12')](_0x1135('0xd'),_0x4bec3d,_0x11776c);_0x7afe3(_0x11776c);});});}exports[_0x1135('0x17')]=function(_0x1eecb1){var _0x3be98d=this;return new Promise(function(_0x323ffd,_0x45417f){return db[_0x1135('0x18')][_0x1135('0x19')](_0x1eecb1[_0x1135('0x1a')],{'raw':_0x1eecb1[_0x1135('0x1b')]?_0x1eecb1[_0x1135('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1135('0xb')](function(_0x4acbbc){logger[_0x1135('0xc')](_0x1135('0x17'),_0x1eecb1);logger[_0x1135('0xf')]('CreateWhatsappMessage',_0x1eecb1,JSON[_0x1135('0x11')](_0x4acbbc));_0x323ffd(_0x4acbbc);})[_0x1135('0x16')](function(_0x3b6284){logger['error'](_0x1135('0x17'),_0x3b6284[_0x1135('0x14')],_0x1eecb1);_0x45417f(_0x3be98d[_0x1135('0x12')](0x1f4,_0x3b6284[_0x1135('0x14')]));});});}; \ No newline at end of file +var _0x56cc=['WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','then','debug','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56cc,0xcf));var _0xc56c=function(_0x3f3c44,_0x3f032f){_0x3f3c44=_0x3f3c44-0x0;var _0x122fff=_0x56cc[_0x3f3c44];return _0x122fff;};'use strict';var _=require(_0xc56c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc56c('0x1'));var rs=require(_0xc56c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc56c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc56c('0x4'))(_0xc56c('0x5'));var config=require(_0xc56c('0x6'));var jayson=require(_0xc56c('0x7'));var client=jayson[_0xc56c('0x8')][_0xc56c('0x9')]({'port':0x232a});config['redis']=_[_0xc56c('0xa')](config[_0xc56c('0xb')],{'host':_0xc56c('0xc'),'port':0x18eb});var socket=require(_0xc56c('0xd'))(new Redis(config['redis']));require(_0xc56c('0xe'))['register'](socket);function respondWithRpcPromise(_0x5df330,_0x373c1e,_0x401f59){return new BPromise(function(_0x3ef8d4,_0x4c6a4f){return client[_0xc56c('0xf')](_0x5df330,_0x401f59)['then'](function(_0x8fd485){logger[_0xc56c('0x10')](_0xc56c('0x11'),_0x373c1e,'request\x20sent');logger['debug'](_0xc56c('0x12'),_0x373c1e,_0xc56c('0x13'),JSON['stringify'](_0x8fd485));if(_0x8fd485['error']){if(_0x8fd485['error'][_0xc56c('0x14')]===0x1f4){logger[_0xc56c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x373c1e,_0x8fd485[_0xc56c('0x15')][_0xc56c('0x16')]);return _0x4c6a4f(_0x8fd485[_0xc56c('0x15')]['message']);}logger[_0xc56c('0x15')](_0xc56c('0x11'),_0x373c1e,_0x8fd485[_0xc56c('0x15')][_0xc56c('0x16')]);return _0x3ef8d4(_0x8fd485[_0xc56c('0x15')][_0xc56c('0x16')]);}else{logger[_0xc56c('0x10')](_0xc56c('0x11'),_0x373c1e,_0xc56c('0x13'));_0x3ef8d4(_0x8fd485[_0xc56c('0x17')][_0xc56c('0x16')]);}})[_0xc56c('0x18')](function(_0x5915e4){logger[_0xc56c('0x15')](_0xc56c('0x11'),_0x373c1e,_0x5915e4);_0x4c6a4f(_0x5915e4);});});}exports[_0xc56c('0x19')]=function(_0x102edf){var _0x49b2cf=this;return new Promise(function(_0x3929cb,_0x31de0a){return db[_0xc56c('0x1a')][_0xc56c('0x1b')](_0x102edf['body'],{'raw':_0x102edf[_0xc56c('0x1c')]?_0x102edf[_0xc56c('0x1c')][_0xc56c('0x1d')]===undefined?!![]:![]:!![]})[_0xc56c('0x1e')](function(_0x2b7260){logger[_0xc56c('0x10')](_0xc56c('0x19'),_0x102edf);logger[_0xc56c('0x1f')]('CreateWhatsappMessage',_0x102edf,JSON['stringify'](_0x2b7260));_0x3929cb(_0x2b7260);})['catch'](function(_0x2dceee){logger[_0xc56c('0x15')]('CreateWhatsappMessage',_0x2dceee['message'],_0x102edf);_0x31de0a(_0x49b2cf[_0xc56c('0x15')](0x1f4,_0x2dceee[_0xc56c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 1a9279a..cf44c4e 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x046a=['emit','removeListener','length','whatsappMessage:','./whatsappMessage.events','remove'];(function(_0x593bd7,_0x495127){var _0x76657b=function(_0x17fd0d){while(--_0x17fd0d){_0x593bd7['push'](_0x593bd7['shift']());}};_0x76657b(++_0x495127);}(_0x046a,0x9a));var _0xa046=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x046a[_0x126558];return _0x1f6d14;};'use strict';var WhatsappMessageEvents=require(_0xa046('0x0'));var events=['save',_0xa046('0x1'),'update'];function createListener(_0x17a007,_0x1cf928){return function(_0x4d7778){_0x1cf928[_0xa046('0x2')](_0x17a007,_0x4d7778);};}function removeListener(_0x1d2b1f,_0x4d92b0){return function(){WhatsappMessageEvents[_0xa046('0x3')](_0x1d2b1f,_0x4d92b0);};}exports['register']=function(_0x2fccd4){for(var _0x59d95c=0x0,_0x401f9b=events[_0xa046('0x4')];_0x59d95c<_0x401f9b;_0x59d95c++){var _0xd337c3=events[_0x59d95c];var _0x19cfec=createListener(_0xa046('0x5')+_0xd337c3,_0x2fccd4);WhatsappMessageEvents['on'](_0xd337c3,_0x19cfec);}}; \ No newline at end of file +var _0xd524=['removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xd524,0x1db));var _0x4d52=function(_0x481a24,_0x3b8945){_0x481a24=_0x481a24-0x0;var _0x38d627=_0xd524[_0x481a24];return _0x38d627;};'use strict';var WhatsappMessageEvents=require(_0x4d52('0x0'));var events=[_0x4d52('0x1'),_0x4d52('0x2'),_0x4d52('0x3')];function createListener(_0x16c133,_0x4638cb){return function(_0x2a0155){_0x4638cb[_0x4d52('0x4')](_0x16c133,_0x2a0155);};}function removeListener(_0x11aba5,_0x11d9f3){return function(){WhatsappMessageEvents[_0x4d52('0x5')](_0x11aba5,_0x11d9f3);};}exports[_0x4d52('0x6')]=function(_0x5343ad){for(var _0xc3c9b0=0x0,_0x3d240f=events['length'];_0xc3c9b0<_0x3d240f;_0xc3c9b0++){var _0x439010=events[_0xc3c9b0];var _0x22983c=createListener(_0x4d52('0x7')+_0x439010,_0x5343ad);WhatsappMessageEvents['on'](_0x439010,_0x22983c);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 06dfc34..77560c7 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a6f=['fs-extra','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','addTeams','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4a6f,0xcb));var _0xf4a6=function(_0x32b301,_0x380389){_0x32b301=_0x32b301-0x0;var _0xd0c417=_0x4a6f[_0x32b301];return _0xd0c417;};'use strict';var multer=require(_0xf4a6('0x0'));var util=require(_0xf4a6('0x1'));var path=require('path');var timeout=require(_0xf4a6('0x2'));var express=require(_0xf4a6('0x3'));var router=express[_0xf4a6('0x4')]();var fs_extra=require(_0xf4a6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf4a6('0x6'));var config=require('../../config/environment');var controller=require(_0xf4a6('0x7'));router[_0xf4a6('0x8')]('/',auth[_0xf4a6('0x9')](),controller[_0xf4a6('0xa')]);router[_0xf4a6('0x8')](_0xf4a6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf4a6('0xc'),auth[_0xf4a6('0x9')](),controller[_0xf4a6('0xd')]);router[_0xf4a6('0x8')](_0xf4a6('0xe'),auth[_0xf4a6('0x9')](),controller[_0xf4a6('0xf')]);router[_0xf4a6('0x8')]('/:id/teams',auth[_0xf4a6('0x9')](),controller['getTeams']);router[_0xf4a6('0x8')](_0xf4a6('0x10'),auth[_0xf4a6('0x9')](),controller[_0xf4a6('0x11')]);router[_0xf4a6('0x12')]('/',auth[_0xf4a6('0x9')](),controller['create']);router[_0xf4a6('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf4a6('0x13')]);router[_0xf4a6('0x12')](_0xf4a6('0x10'),auth[_0xf4a6('0x9')](),controller['addAgents']);router[_0xf4a6('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf4a6('0x15')]('/:id',auth[_0xf4a6('0x9')](),controller[_0xf4a6('0x16')]);router['delete']('/:id/teams',auth[_0xf4a6('0x9')](),controller[_0xf4a6('0x17')]);router[_0xf4a6('0x15')](_0xf4a6('0x10'),auth[_0xf4a6('0x9')](),controller[_0xf4a6('0x18')]);module[_0xf4a6('0x19')]=router; \ No newline at end of file +var _0x00e7=['destroy','removeTeams','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','delete'];(function(_0xbf8760,_0x1d106b){var _0x25f0ed=function(_0x3c3b59){while(--_0x3c3b59){_0xbf8760['push'](_0xbf8760['shift']());}};_0x25f0ed(++_0x1d106b);}(_0x00e7,0xca));var _0x700e=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x00e7[_0x270adf];return _0x29eda9;};'use strict';var multer=require(_0x700e('0x0'));var util=require(_0x700e('0x1'));var path=require('path');var timeout=require(_0x700e('0x2'));var express=require(_0x700e('0x3'));var router=express['Router']();var fs_extra=require(_0x700e('0x4'));var auth=require(_0x700e('0x5'));var interaction=require(_0x700e('0x6'));var config=require(_0x700e('0x7'));var controller=require('./whatsappQueue.controller');router[_0x700e('0x8')]('/',auth[_0x700e('0x9')](),controller['index']);router[_0x700e('0x8')]('/describe',auth[_0x700e('0x9')](),controller[_0x700e('0xa')]);router['get'](_0x700e('0xb'),auth[_0x700e('0x9')](),controller[_0x700e('0xc')]);router[_0x700e('0x8')](_0x700e('0xd'),auth[_0x700e('0x9')](),controller['getMembers']);router['get'](_0x700e('0xe'),auth[_0x700e('0x9')](),controller[_0x700e('0xf')]);router[_0x700e('0x8')](_0x700e('0x10'),auth[_0x700e('0x9')](),controller[_0x700e('0x11')]);router[_0x700e('0x12')]('/',auth[_0x700e('0x9')](),controller['create']);router[_0x700e('0x12')](_0x700e('0xe'),auth[_0x700e('0x9')](),controller[_0x700e('0x13')]);router[_0x700e('0x12')](_0x700e('0x10'),auth[_0x700e('0x9')](),controller['addAgents']);router[_0x700e('0x14')]('/:id',auth[_0x700e('0x9')](),controller[_0x700e('0x15')]);router[_0x700e('0x16')]('/:id',auth[_0x700e('0x9')](),controller[_0x700e('0x17')]);router[_0x700e('0x16')](_0x700e('0xe'),auth['isAuthenticated'](),controller[_0x700e('0x18')]);router[_0x700e('0x16')](_0x700e('0x10'),auth[_0x700e('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index f904079..3d7535e 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1fd=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x3d5d16,_0x4cf444){_0x3d5d16=_0x3d5d16-0x0;var _0x442a4d=_0xa1fd[_0x3d5d16];return _0x442a4d;};'use strict';var Sequelize=require(_0xda1f('0x0'));module[_0xda1f('0x1')]={'name':{'type':Sequelize[_0xda1f('0x2')],'unique':_0xda1f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xda1f('0x4')](_0xda1f('0x5'),_0xda1f('0x6'),_0xda1f('0x7'))},'description':{'type':Sequelize[_0xda1f('0x2')]}}; \ No newline at end of file +var _0x2285=['INTEGER','ENUM','beepall','roundrobin','exports','STRING','name'];(function(_0x5699dd,_0x1d1244){var _0xb60868=function(_0x141966){while(--_0x141966){_0x5699dd['push'](_0x5699dd['shift']());}};_0xb60868(++_0x1d1244);}(_0x2285,0x177));var _0x5228=function(_0x5bf9ae,_0x4eb807){_0x5bf9ae=_0x5bf9ae-0x0;var _0x39e0b2=_0x2285[_0x5bf9ae];return _0x39e0b2;};'use strict';var Sequelize=require('sequelize');module[_0x5228('0x0')]={'name':{'type':Sequelize[_0x5228('0x1')],'unique':_0x5228('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5228('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5228('0x4')]('rrmemory',_0x5228('0x5'),_0x5228('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d1eb460..b7cc2d8 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7e8=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','sort','where','pick','filters','merge','filter','options','include','WhatsappQueue','findAll','rows','show','length','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','getMembers','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','%s/%s','SIP','findOne','order','hasOwnProperty','getTeams','ids','Team','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','push','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','emit','addAgents','omit','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x4f528d,_0x57c304){var _0x51d091=function(_0x490a6f){while(--_0x490a6f){_0x4f528d['push'](_0x4f528d['shift']());}};_0x51d091(++_0x57c304);}(_0xc7e8,0x77));var _0x8c7e=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xc7e8[_0xdd2bfa];return _0x55397e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c7e('0x0'));var zipdir=require(_0x8c7e('0x1'));var jsonpatch=require(_0x8c7e('0x2'));var rp=require(_0x8c7e('0x3'));var moment=require(_0x8c7e('0x4'));var BPromise=require(_0x8c7e('0x5'));var Mustache=require(_0x8c7e('0x6'));var util=require(_0x8c7e('0x7'));var path=require(_0x8c7e('0x8'));var sox=require(_0x8c7e('0x9'));var csv=require(_0x8c7e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c7e('0xb'));var crypto=require(_0x8c7e('0xc'));var jsforce=require(_0x8c7e('0xd'));var deskjs=require(_0x8c7e('0xe'));var toCsv=require(_0x8c7e('0xa'));var querystring=require(_0x8c7e('0xf'));var Papa=require('papaparse');var Redis=require(_0x8c7e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8c7e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c7e('0x12'));var logger=require(_0x8c7e('0x13'))('api');var utils=require(_0x8c7e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8c7e('0x15'));var db=require(_0x8c7e('0x16'))['db'];config[_0x8c7e('0x17')]=_['defaults'](config['redis'],{'host':_0x8c7e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c7e('0x17')]));require(_0x8c7e('0x19'))[_0x8c7e('0x1a')](socket);function respondWithStatusCode(_0xeda0f2,_0x29777a){_0x29777a=_0x29777a||0xcc;return function(_0x1e9bd1){if(_0x1e9bd1){return _0xeda0f2[_0x8c7e('0x1b')](_0x29777a);}return _0xeda0f2[_0x8c7e('0x1c')](_0x29777a)[_0x8c7e('0x1d')]();};}function respondWithResult(_0x376c7c,_0xe1ff3d){_0xe1ff3d=_0xe1ff3d||0xc8;return function(_0x4b815c){if(_0x4b815c){return _0x376c7c['status'](_0xe1ff3d)['json'](_0x4b815c);}};}function respondWithFilteredResult(_0x4aa50a,_0x2f0630){return function(_0x304c01){if(_0x304c01){var _0x2923aa=typeof _0x2f0630[_0x8c7e('0x1e')]===_0x8c7e('0x1f')&&typeof _0x2f0630[_0x8c7e('0x20')]===_0x8c7e('0x1f');var _0x3d84e2=_0x304c01['count'];var _0xc28592=_0x2923aa?0x0:_0x2f0630[_0x8c7e('0x1e')];var _0x34376b=_0x2923aa?_0x304c01[_0x8c7e('0x21')]:_0x2f0630[_0x8c7e('0x1e')]+_0x2f0630[_0x8c7e('0x20')];var _0x5b582b;if(_0x34376b>=_0x3d84e2){_0x34376b=_0x3d84e2;_0x5b582b=0xc8;}else{_0x5b582b=0xce;}_0x4aa50a[_0x8c7e('0x1c')](_0x5b582b);return _0x4aa50a[_0x8c7e('0x22')]('Content-Range',_0xc28592+'-'+_0x34376b+'/'+_0x3d84e2)[_0x8c7e('0x23')](_0x304c01);}return null;};}function patchUpdates(_0x541b6a){return function(_0x18387b){try{jsonpatch[_0x8c7e('0x24')](_0x18387b,_0x541b6a,!![]);}catch(_0x51eef9){return BPromise[_0x8c7e('0x25')](_0x51eef9);}return _0x18387b[_0x8c7e('0x26')]();};}function saveUpdates(_0x2fbd71,_0x180fbd){return function(_0x18ac2a){if(_0x18ac2a){return _0x18ac2a[_0x8c7e('0x27')](_0x2fbd71)[_0x8c7e('0x28')](function(_0x404905){return _0x404905;});}return null;};}function removeEntity(_0x5d3ecd,_0x52234b){return function(_0x5c0f2c){if(_0x5c0f2c){return _0x5c0f2c['destroy']()[_0x8c7e('0x28')](function(){var _0x282baf=_0x5c0f2c[_0x8c7e('0x29')]({'plain':!![]});var _0x513bc=_0x8c7e('0x2a');return db[_0x8c7e('0x2b')]['destroy']({'where':{'type':_0x513bc,'resourceId':_0x282baf['id']}})[_0x8c7e('0x28')](function(){return _0x5c0f2c;});})[_0x8c7e('0x28')](function(){_0x5d3ecd[_0x8c7e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ad81f,_0x3b0995){return function(_0x3f0f6d){if(!_0x3f0f6d){_0x4ad81f[_0x8c7e('0x1b')](0x194);}return _0x3f0f6d;};}function handleError(_0x2b2518,_0x52f98d){_0x52f98d=_0x52f98d||0x1f4;return function(_0x568a82){logger['error'](_0x568a82['stack']);if(_0x568a82[_0x8c7e('0x2c')]){delete _0x568a82[_0x8c7e('0x2c')];}_0x2b2518['status'](_0x52f98d)[_0x8c7e('0x2d')](_0x568a82);};}exports['index']=function(_0x1a24f3,_0x4e5e33){var _0x59616f={},_0x54e849={},_0x144c85={'count':0x0,'rows':[]};var _0x1956e6=_['map'](db['WhatsappQueue'][_0x8c7e('0x2e')],function(_0x1956b5){return{'name':_0x1956b5[_0x8c7e('0x2f')],'type':_0x1956b5[_0x8c7e('0x30')][_0x8c7e('0x31')]};});_0x54e849[_0x8c7e('0x32')]=_[_0x8c7e('0x33')](_0x1956e6,_0x8c7e('0x2c'));_0x54e849[_0x8c7e('0x34')]=_[_0x8c7e('0x35')](_0x1a24f3['query']);_0x54e849['filters']=_[_0x8c7e('0x36')](_0x54e849['model'],_0x54e849[_0x8c7e('0x34')]);_0x59616f[_0x8c7e('0x37')]=_[_0x8c7e('0x36')](_0x54e849[_0x8c7e('0x32')],qs[_0x8c7e('0x38')](_0x1a24f3['query']['fields']));_0x59616f[_0x8c7e('0x37')]=_0x59616f[_0x8c7e('0x37')]['length']?_0x59616f[_0x8c7e('0x37')]:_0x54e849[_0x8c7e('0x32')];if(!_0x1a24f3['query']['hasOwnProperty'](_0x8c7e('0x39'))){_0x59616f[_0x8c7e('0x20')]=qs[_0x8c7e('0x20')](_0x1a24f3[_0x8c7e('0x34')][_0x8c7e('0x20')]);_0x59616f[_0x8c7e('0x1e')]=qs[_0x8c7e('0x1e')](_0x1a24f3['query'][_0x8c7e('0x1e')]);}_0x59616f['order']=qs[_0x8c7e('0x3a')](_0x1a24f3['query'][_0x8c7e('0x3a')]);_0x59616f[_0x8c7e('0x3b')]=qs['filters'](_[_0x8c7e('0x3c')](_0x1a24f3[_0x8c7e('0x34')],_0x54e849[_0x8c7e('0x3d')]),_0x1956e6);if(_0x1a24f3[_0x8c7e('0x34')]['filter']){_0x59616f[_0x8c7e('0x3b')]=_[_0x8c7e('0x3e')](_0x59616f[_0x8c7e('0x3b')],{'$or':_[_0x8c7e('0x33')](_0x1956e6,function(_0x440246){if(_0x440246[_0x8c7e('0x30')]!=='VIRTUAL'){var _0xcdcc09={};_0xcdcc09[_0x440246['name']]={'$like':'%'+_0x1a24f3['query'][_0x8c7e('0x3f')]+'%'};return _0xcdcc09;}})});}_0x59616f=_[_0x8c7e('0x3e')]({},_0x59616f,_0x1a24f3[_0x8c7e('0x40')]);var _0x4db4b5={'where':_0x59616f[_0x8c7e('0x3b')]};return db['WhatsappQueue']['count'](_0x4db4b5)[_0x8c7e('0x28')](function(_0x355515){_0x144c85[_0x8c7e('0x21')]=_0x355515;if(_0x1a24f3[_0x8c7e('0x34')]['includeAll']){_0x59616f[_0x8c7e('0x41')]=[{'all':!![]}];}return db[_0x8c7e('0x42')][_0x8c7e('0x43')](_0x59616f);})[_0x8c7e('0x28')](function(_0x4b322b){_0x144c85[_0x8c7e('0x44')]=_0x4b322b;return _0x144c85;})['then'](respondWithFilteredResult(_0x4e5e33,_0x59616f))['catch'](handleError(_0x4e5e33,null));};exports[_0x8c7e('0x45')]=function(_0x9f925d,_0x1ea5ff){var _0x335215={'raw':!![],'where':{'id':_0x9f925d['params']['id']}},_0x5d8faa={};_0x5d8faa[_0x8c7e('0x32')]=_['keys'](db['WhatsappQueue'][_0x8c7e('0x2e')]);_0x5d8faa[_0x8c7e('0x34')]=_[_0x8c7e('0x35')](_0x9f925d[_0x8c7e('0x34')]);_0x5d8faa['filters']=_[_0x8c7e('0x36')](_0x5d8faa[_0x8c7e('0x32')],_0x5d8faa[_0x8c7e('0x34')]);_0x335215[_0x8c7e('0x37')]=_[_0x8c7e('0x36')](_0x5d8faa[_0x8c7e('0x32')],qs[_0x8c7e('0x38')](_0x9f925d[_0x8c7e('0x34')][_0x8c7e('0x38')]));_0x335215[_0x8c7e('0x37')]=_0x335215[_0x8c7e('0x37')][_0x8c7e('0x46')]?_0x335215[_0x8c7e('0x37')]:_0x5d8faa[_0x8c7e('0x32')];if(_0x9f925d[_0x8c7e('0x34')][_0x8c7e('0x47')]){_0x335215[_0x8c7e('0x41')]=[{'all':!![]}];}_0x335215=_[_0x8c7e('0x3e')]({},_0x335215,_0x9f925d[_0x8c7e('0x40')]);return db[_0x8c7e('0x42')][_0x8c7e('0x48')](_0x335215)[_0x8c7e('0x28')](handleEntityNotFound(_0x1ea5ff,null))['then'](respondWithResult(_0x1ea5ff,null))['catch'](handleError(_0x1ea5ff,null));};exports[_0x8c7e('0x49')]=function(_0x6c7d19,_0x1f99cd){return db[_0x8c7e('0x42')][_0x8c7e('0x49')](_0x6c7d19[_0x8c7e('0x4a')],{})[_0x8c7e('0x28')](function(_0x58c076){var _0x5a07be=_0x6c7d19[_0x8c7e('0x4b')][_0x8c7e('0x29')]({'plain':!![]});if(!_0x5a07be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a07be[_0x8c7e('0x4c')]===_0x8c7e('0x4b')){var _0x40299c=_0x58c076[_0x8c7e('0x29')]({'plain':!![]});var _0x4a62ad=_0x8c7e('0x2a');return db[_0x8c7e('0x4d')]['find']({'where':{'name':_0x4a62ad,'userProfileId':_0x5a07be[_0x8c7e('0x4e')]},'raw':!![]})['then'](function(_0xdf4d9c){if(_0xdf4d9c&&_0xdf4d9c[_0x8c7e('0x4f')]===0x0){return db[_0x8c7e('0x2b')][_0x8c7e('0x49')]({'name':_0x40299c[_0x8c7e('0x2c')],'resourceId':_0x40299c['id'],'type':_0xdf4d9c[_0x8c7e('0x2c')],'sectionId':_0xdf4d9c['id']},{})[_0x8c7e('0x28')](function(){return _0x58c076;});}else{return _0x58c076;}})[_0x8c7e('0x50')](function(_0x2f9d0b){logger[_0x8c7e('0x51')](_0x8c7e('0x52'),_0x2f9d0b);throw _0x2f9d0b;});}return _0x58c076;})[_0x8c7e('0x28')](respondWithResult(_0x1f99cd,0xc9))[_0x8c7e('0x50')](handleError(_0x1f99cd,null));};exports[_0x8c7e('0x27')]=function(_0xa45d1c,_0x324ed5){if(_0xa45d1c['body']['id']){delete _0xa45d1c['body']['id'];}return db[_0x8c7e('0x42')]['find']({'where':{'id':_0xa45d1c[_0x8c7e('0x53')]['id']}})[_0x8c7e('0x28')](handleEntityNotFound(_0x324ed5,null))['then'](saveUpdates(_0xa45d1c['body'],null))[_0x8c7e('0x28')](respondWithResult(_0x324ed5,null))[_0x8c7e('0x50')](handleError(_0x324ed5,null));};exports[_0x8c7e('0x54')]=function(_0x3976c0,_0x848bd0){return db['WhatsappQueue']['find']({'where':{'id':_0x3976c0[_0x8c7e('0x53')]['id']}})[_0x8c7e('0x28')](handleEntityNotFound(_0x848bd0,null))[_0x8c7e('0x28')](removeEntity(_0x848bd0,null))[_0x8c7e('0x50')](handleError(_0x848bd0,null));};exports[_0x8c7e('0x55')]=function(_0x2b4272,_0x58583f){return db['WhatsappQueue'][_0x8c7e('0x55')]()['then'](respondWithResult(_0x58583f,null))[_0x8c7e('0x50')](handleError(_0x58583f,null));};exports[_0x8c7e('0x56')]=function(_0x5300f7,_0x3d3489,_0x37e704){var _0x4454b3={'raw':!![],'where':{}},_0xce3f1c={},_0x5aad01;return db[_0x8c7e('0x42')]['findOne']({'where':{'id':_0x5300f7[_0x8c7e('0x53')]['id']}})[_0x8c7e('0x28')](handleEntityNotFound(_0x3d3489,null))['then'](function(_0x3f00d4){if(_0x3f00d4){_0x5aad01=_0x3f00d4[_0x8c7e('0x29')]({'plain':!![]});_0xce3f1c[_0x8c7e('0x32')]=_[_0x8c7e('0x35')](db[_0x8c7e('0x57')][_0x8c7e('0x2e')]);_0xce3f1c[_0x8c7e('0x34')]=_[_0x8c7e('0x35')](_0x5300f7[_0x8c7e('0x34')]);_0xce3f1c[_0x8c7e('0x3d')]=_[_0x8c7e('0x36')](_0xce3f1c[_0x8c7e('0x32')],_0xce3f1c['query']);_0x4454b3[_0x8c7e('0x37')]=_[_0x8c7e('0x36')](_0xce3f1c[_0x8c7e('0x32')],qs['fields'](_0x5300f7[_0x8c7e('0x34')][_0x8c7e('0x38')]));_0x4454b3['attributes']=_0x4454b3[_0x8c7e('0x37')][_0x8c7e('0x46')]?_0x4454b3['attributes']:_0xce3f1c['model'];if(!_0x5300f7['query']['hasOwnProperty']('nolimit')){_0x4454b3[_0x8c7e('0x20')]=qs[_0x8c7e('0x20')](_0x5300f7[_0x8c7e('0x34')][_0x8c7e('0x20')]);_0x4454b3[_0x8c7e('0x1e')]=qs[_0x8c7e('0x1e')](_0x5300f7[_0x8c7e('0x34')][_0x8c7e('0x1e')]);}_0x4454b3['order']=qs[_0x8c7e('0x3a')](_0x5300f7['query'][_0x8c7e('0x3a')]);_0x4454b3[_0x8c7e('0x3b')]=qs['filters'](_['pick'](_0x5300f7[_0x8c7e('0x34')],_0xce3f1c[_0x8c7e('0x3d')]));_0x4454b3[_0x8c7e('0x3b')]['WhatsappQueueId']=_0x3f00d4['id'];if(_0x5300f7['query'][_0x8c7e('0x3f')]){_0x4454b3[_0x8c7e('0x3b')]=_['merge'](_0x4454b3[_0x8c7e('0x3b')],{'$or':_[_0x8c7e('0x33')](_0x4454b3[_0x8c7e('0x37')],function(_0x28b033){var _0x4037cd={};_0x4037cd[_0x28b033]={'$like':'%'+_0x5300f7[_0x8c7e('0x34')][_0x8c7e('0x3f')]+'%'};return _0x4037cd;})});}_0x4454b3=_[_0x8c7e('0x3e')]({},_0x4454b3,_0x5300f7[_0x8c7e('0x40')]);return db['UserWhatsappQueue'][_0x8c7e('0x43')](_0x4454b3);}})[_0x8c7e('0x28')](function(_0x39b689){if(_0x39b689){return db[_0x8c7e('0x58')][_0x8c7e('0x59')]({'where':{'id':_[_0x8c7e('0x33')](_0x39b689,_0x8c7e('0x5a')),'role':_0x8c7e('0x5b')},'attributes':['id','name',_0x8c7e('0x5c'),_0x8c7e('0x5d'),_0x8c7e('0x5e')]});}})[_0x8c7e('0x28')](function(_0x538f86){if(_0x538f86){return{'count':_0x538f86[_0x8c7e('0x21')],'rows':_[_0x8c7e('0x33')](_0x538f86[_0x8c7e('0x44')],function(_0x3b197e){return{'membername':_0x3b197e[_0x8c7e('0x2c')],'UserId':_0x3b197e['id'],'queue_name':_0x5aad01[_0x8c7e('0x2c')],'WhatsappQueueId':_0x5aad01['id'],'interface':util['format'](_0x8c7e('0x5f'),_0x8c7e('0x60'),_0x3b197e[_0x8c7e('0x2c')]),'penalty':0x0,'paused':_0x3b197e[_0x8c7e('0x5c')],'createdAt':_0x3b197e[_0x8c7e('0x5e')],'updatedAt':_0x3b197e[_0x8c7e('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8c7e('0x28')](respondWithFilteredResult(_0x3d3489,_0x4454b3))['catch'](handleError(_0x3d3489,null));};exports['getTeams']=function(_0x5dc6db,_0x1b9a58,_0x550849){var _0x50297b={};var _0x24d636={};var _0x25833e;var _0x23110b;return db['WhatsappQueue'][_0x8c7e('0x61')]({'where':{'id':_0x5dc6db[_0x8c7e('0x53')]['id']}})[_0x8c7e('0x28')](handleEntityNotFound(_0x1b9a58,null))[_0x8c7e('0x28')](function(_0x179198){if(_0x179198){_0x25833e=_0x179198;_0x24d636[_0x8c7e('0x32')]=_[_0x8c7e('0x35')](db['Team'][_0x8c7e('0x2e')]);_0x24d636[_0x8c7e('0x34')]=_[_0x8c7e('0x35')](_0x5dc6db['query']);_0x24d636[_0x8c7e('0x3d')]=_['intersection'](_0x24d636[_0x8c7e('0x32')],_0x24d636[_0x8c7e('0x34')]);_0x50297b['attributes']=_[_0x8c7e('0x36')](_0x24d636[_0x8c7e('0x32')],qs[_0x8c7e('0x38')](_0x5dc6db['query'][_0x8c7e('0x38')]));_0x50297b[_0x8c7e('0x37')]=_0x50297b[_0x8c7e('0x37')][_0x8c7e('0x46')]?_0x50297b[_0x8c7e('0x37')]:_0x24d636[_0x8c7e('0x32')];_0x50297b[_0x8c7e('0x62')]=qs[_0x8c7e('0x3a')](_0x5dc6db['query'][_0x8c7e('0x3a')]);_0x50297b['where']=qs[_0x8c7e('0x3d')](_[_0x8c7e('0x3c')](_0x5dc6db[_0x8c7e('0x34')],_0x24d636[_0x8c7e('0x3d')]));if(_0x5dc6db[_0x8c7e('0x34')][_0x8c7e('0x3f')]){_0x50297b[_0x8c7e('0x3b')]=_[_0x8c7e('0x3e')](_0x50297b[_0x8c7e('0x3b')],{'$or':_['map'](_0x50297b[_0x8c7e('0x37')],function(_0x208da3){var _0x11cf8c={};_0x11cf8c[_0x208da3]={'$like':'%'+_0x5dc6db['query'][_0x8c7e('0x3f')]+'%'};return _0x11cf8c;})});}_0x50297b=_[_0x8c7e('0x3e')]({},_0x50297b,_0x5dc6db[_0x8c7e('0x40')]);return _0x25833e['getTeams'](_0x50297b);}})[_0x8c7e('0x28')](function(_0x42260f){if(_0x42260f){_0x23110b=_0x42260f['length'];if(!_0x5dc6db[_0x8c7e('0x34')][_0x8c7e('0x63')](_0x8c7e('0x39'))){_0x50297b[_0x8c7e('0x20')]=qs[_0x8c7e('0x20')](_0x5dc6db[_0x8c7e('0x34')]['limit']);_0x50297b['offset']=qs[_0x8c7e('0x1e')](_0x5dc6db[_0x8c7e('0x34')][_0x8c7e('0x1e')]);}return _0x25833e[_0x8c7e('0x64')](_0x50297b);}})[_0x8c7e('0x28')](function(_0xecb237){if(_0xecb237){return _0xecb237?{'count':_0x23110b,'rows':_0xecb237}:null;}})['then'](respondWithResult(_0x1b9a58,null))['catch'](handleError(_0x1b9a58,null));};exports['addTeams']=function(_0x1d4f5e,_0x3374be,_0x35f0ab){var _0x3789f4=_0x1d4f5e[_0x8c7e('0x4a')][_0x8c7e('0x65')];return db[_0x8c7e('0x66')][_0x8c7e('0x43')]({'where':{'id':_0x3789f4},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x8c7e('0x2c'),_0x8c7e('0x67'),_0x8c7e('0x68'),'interface'],'raw':!![]}]})[_0x8c7e('0x28')](function(_0x1de250){if(_0x1de250){var _0x1b6313=_[_0x8c7e('0x69')](_0x1de250,function(_0x5e83fe){var _0x133387=_0x5e83fe[_0x8c7e('0x29')]({'plain':!![]});return _0x133387['Agents'];});return db['WhatsappQueue'][_0x8c7e('0x48')]({'where':{'id':_0x1d4f5e[_0x8c7e('0x53')]['id']}})['then'](function(_0x45015b){return db[_0x8c7e('0x6a')][_0x8c7e('0x6b')](function(_0x53504c){return _0x45015b[_0x8c7e('0x6c')](_0x3789f4,{'transaction':_0x53504c})[_0x8c7e('0x28')](function(){return BPromise[_0x8c7e('0x6d')](_0x1b6313,function(_0x31759e){return db[_0x8c7e('0x57')][_0x8c7e('0x6e')]({'where':{'UserId':_0x31759e['id'],'WhatsappQueueId':_0x1d4f5e['params']['id']},'transaction':_0x53504c});});})[_0x8c7e('0x28')](function(){_0x1b6313[_0x8c7e('0x6f')](function(_0x56eb76){socket['emit'](_0x8c7e('0x70'),{'UserId':_0x56eb76['id'],'WhatsappQueueId':_0x45015b['id']});});});});});}})[_0x8c7e('0x28')](respondWithStatusCode(_0x3374be,null))['catch'](handleError(_0x3374be,null));};exports[_0x8c7e('0x71')]=function(_0x1547a9,_0x2eeb4b,_0x4f2c61){return db['Team'][_0x8c7e('0x43')]({'where':{'id':_0x1547a9[_0x8c7e('0x34')][_0x8c7e('0x65')]},'attributes':['id'],'include':[{'model':db[_0x8c7e('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2eeb4b,null))[_0x8c7e('0x28')](function(_0x3215d3){var _0x1ca222=_[_0x8c7e('0x33')](_0x3215d3,'id');var _0x30eba9=[];var _0x2ba3ee=[];var _0xebfe1c=squel[_0x8c7e('0x72')]();_0xebfe1c[_0x8c7e('0x73')](_0x8c7e('0x74'))[_0x8c7e('0x75')](_0x8c7e('0x76'),'tq')['join']('user_has_teams','ut',_0x8c7e('0x77'))[_0x8c7e('0x3b')]('WhatsappQueueId\x20=\x20?',_0x1547a9[_0x8c7e('0x53')]['id']);for(var _0x2af564=0x0;_0x2af564<_0x3215d3[_0x8c7e('0x46')];_0x2af564+=0x1){let _0x3830c0=_0x3215d3[_0x2af564];for(var _0x5bfc9e=0x0;_0x5bfc9e<_0x3830c0[_0x8c7e('0x78')][_0x8c7e('0x46')];_0x5bfc9e+=0x1){let _0x537f56=_0x3830c0[_0x8c7e('0x78')][_0x5bfc9e];var _0x3e692e=_0xebfe1c[_0x8c7e('0x79')]();_0x3e692e[_0x8c7e('0x3b')]('ut.UserId\x20=\x20?',_0x537f56['id']);_0x2ba3ee[_0x8c7e('0x7a')](db[_0x8c7e('0x6a')][_0x8c7e('0x34')](_0x3e692e['toString'](),{'type':db['sequelize']['QueryTypes'][_0x8c7e('0x7b')]})['then'](function(_0x2b9b68){if(_0x2b9b68[_0x8c7e('0x46')]===0x1){return _0x537f56['id'];}else{var _0x4bdb73=_[_0x8c7e('0x7c')](_[_0x8c7e('0x33')](_0x2b9b68,_0x8c7e('0x7d')),function(_0xfae269){return _[_0x8c7e('0x7e')](_0x1ca222,_0xfae269);});if(_0x4bdb73){return _0x537f56['id'];}}}));}}return BPromise[_0x8c7e('0x7f')](_0x2ba3ee)[_0x8c7e('0x28')](function(_0x4c72bb){_0x30eba9=_(_0x30eba9)[_0x8c7e('0x80')](_0x4c72bb)['compact']()[_0x8c7e('0x81')]();return db[_0x8c7e('0x42')][_0x8c7e('0x48')]({'where':{'id':_0x1547a9['params']['id']}})[_0x8c7e('0x28')](function(_0x5dce9b){return db[_0x8c7e('0x6a')][_0x8c7e('0x6b')](function(_0x1d1a0b){return _0x5dce9b['removeTeams'](_0x1547a9[_0x8c7e('0x34')][_0x8c7e('0x65')],{'transaction':_0x1d1a0b})[_0x8c7e('0x28')](function(){if(!_[_0x8c7e('0x82')](_0x30eba9)){return _0x5dce9b[_0x8c7e('0x83')](_0x30eba9,{'transaction':_0x1d1a0b});}})['then'](function(){_0x30eba9[_0x8c7e('0x6f')](function(_0x420676){socket[_0x8c7e('0x84')]('userWhatsappQueue:remove',{'UserId':_0x420676,'WhatsappQueueId':_0x5dce9b['id']});});});});});});})[_0x8c7e('0x28')](respondWithStatusCode(_0x2eeb4b,null))[_0x8c7e('0x50')](handleError(_0x2eeb4b,null));};exports[_0x8c7e('0x85')]=function(_0x2b9c52,_0x4cccf3,_0x56d7c1){return db[_0x8c7e('0x42')]['find']({'where':{'id':_0x2b9c52[_0x8c7e('0x53')]['id']}})[_0x8c7e('0x28')](handleEntityNotFound(_0x4cccf3,null))[_0x8c7e('0x28')](function(_0x15a5a9){if(_0x15a5a9){return _0x15a5a9[_0x8c7e('0x85')](_0x2b9c52['body'][_0x8c7e('0x65')],_[_0x8c7e('0x86')](_0x2b9c52[_0x8c7e('0x4a')],[_0x8c7e('0x65'),'id'])||{})['spread'](function(_0x409b13){for(var _0x1a0b8a=0x0;_0x1a0b8a<_0x2b9c52['body']['ids'][_0x8c7e('0x46')];_0x1a0b8a+=0x1){socket[_0x8c7e('0x84')](_0x8c7e('0x70'),{'UserId':Number(_0x2b9c52[_0x8c7e('0x4a')]['ids'][_0x1a0b8a]),'WhatsappQueueId':Number(_0x2b9c52['params']['id'])});}return _0x409b13;});}})['then'](respondWithResult(_0x4cccf3,null))[_0x8c7e('0x50')](handleError(_0x4cccf3,null));};exports['removeAgents']=function(_0x293c18,_0x4dd5fa,_0x1b3d7e){return db['WhatsappQueue']['find']({'where':{'id':_0x293c18[_0x8c7e('0x53')]['id']}})[_0x8c7e('0x28')](handleEntityNotFound(_0x4dd5fa,null))[_0x8c7e('0x28')](function(_0x1471ce){if(_0x1471ce){return _0x1471ce['removeAgents'](_0x293c18['query'][_0x8c7e('0x65')])[_0x8c7e('0x28')](function(){if(_[_0x8c7e('0x87')](_0x293c18[_0x8c7e('0x34')][_0x8c7e('0x65')])){for(var _0x2e5971=0x0;_0x2e5971<_0x293c18['query'][_0x8c7e('0x65')][_0x8c7e('0x46')];_0x2e5971+=0x1){socket[_0x8c7e('0x84')](_0x8c7e('0x88'),{'UserId':Number(_0x293c18[_0x8c7e('0x34')][_0x8c7e('0x65')][_0x2e5971]),'WhatsappQueueId':Number(_0x293c18[_0x8c7e('0x53')]['id'])});}}else{socket[_0x8c7e('0x84')](_0x8c7e('0x88'),{'UserId':Number(_0x293c18['query'][_0x8c7e('0x65')]),'WhatsappQueueId':Number(_0x293c18[_0x8c7e('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x4dd5fa,null))[_0x8c7e('0x50')](handleError(_0x4dd5fa,null));};exports['getAgents']=function(_0x44f60e,_0x165823,_0x48848e){var _0x5a0591={};var _0x244f8b={};var _0x4e5696;var _0x538d7b;return db[_0x8c7e('0x42')]['findOne']({'where':{'id':_0x44f60e[_0x8c7e('0x53')]['id']}})['then'](handleEntityNotFound(_0x165823,null))[_0x8c7e('0x28')](function(_0x22124a){if(_0x22124a){_0x4e5696=_0x22124a;_0x244f8b[_0x8c7e('0x32')]=_[_0x8c7e('0x35')](db[_0x8c7e('0x58')]['rawAttributes']);_0x244f8b['query']=_[_0x8c7e('0x35')](_0x44f60e[_0x8c7e('0x34')]);_0x244f8b['filters']=_[_0x8c7e('0x36')](_0x244f8b[_0x8c7e('0x32')],_0x244f8b[_0x8c7e('0x34')]);_0x5a0591[_0x8c7e('0x37')]=_[_0x8c7e('0x36')](_0x244f8b[_0x8c7e('0x32')],qs['fields'](_0x44f60e['query'][_0x8c7e('0x38')]));_0x5a0591['attributes']=_0x5a0591['attributes']['length']?_0x5a0591[_0x8c7e('0x37')]:_0x244f8b[_0x8c7e('0x32')];_0x5a0591['order']=qs[_0x8c7e('0x3a')](_0x44f60e[_0x8c7e('0x34')][_0x8c7e('0x3a')]);_0x5a0591['where']=qs['filters'](_['pick'](_0x44f60e[_0x8c7e('0x34')],_0x244f8b[_0x8c7e('0x3d')]));if(_0x44f60e[_0x8c7e('0x34')][_0x8c7e('0x3f')]){_0x5a0591[_0x8c7e('0x3b')]=_[_0x8c7e('0x3e')](_0x5a0591['where'],{'$or':_[_0x8c7e('0x33')](_0x5a0591[_0x8c7e('0x37')],function(_0x227b4c){var _0x4d20f0={};_0x4d20f0[_0x227b4c]={'$like':'%'+_0x44f60e[_0x8c7e('0x34')][_0x8c7e('0x3f')]+'%'};return _0x4d20f0;})});}_0x5a0591=_['merge']({},_0x5a0591,_0x44f60e[_0x8c7e('0x40')]);return _0x4e5696['getAgents'](_0x5a0591);}})['then'](function(_0x5f261e){if(_0x5f261e){_0x538d7b=_0x5f261e[_0x8c7e('0x46')];if(!_0x44f60e[_0x8c7e('0x34')][_0x8c7e('0x63')](_0x8c7e('0x39'))){_0x5a0591[_0x8c7e('0x20')]=qs[_0x8c7e('0x20')](_0x44f60e[_0x8c7e('0x34')][_0x8c7e('0x20')]);_0x5a0591[_0x8c7e('0x1e')]=qs['offset'](_0x44f60e['query'][_0x8c7e('0x1e')]);}return _0x4e5696[_0x8c7e('0x89')](_0x5a0591);}})[_0x8c7e('0x28')](function(_0xbb258a){if(_0xbb258a){return _0xbb258a?{'count':_0x538d7b,'rows':_0xbb258a}:null;}})['then'](respondWithResult(_0x165823,null))['catch'](handleError(_0x165823,null));}; \ No newline at end of file +var _0xed19=['find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','emit','removeTeams','Team','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','ids','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','WhatsappQueues','destroy','then','stack','name','map','WhatsappQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','user','get','role','UserProfileSection'];(function(_0x366d92,_0x28e34c){var _0x22c349=function(_0x36372f){while(--_0x36372f){_0x366d92['push'](_0x366d92['shift']());}};_0x22c349(++_0x28e34c);}(_0xed19,0xc8));var _0x9ed1=function(_0x3bb571,_0x32cfb7){_0x3bb571=_0x3bb571-0x0;var _0x54ff33=_0xed19[_0x3bb571];return _0x54ff33;};'use strict';var emlformat=require(_0x9ed1('0x0'));var rimraf=require(_0x9ed1('0x1'));var zipdir=require(_0x9ed1('0x2'));var jsonpatch=require(_0x9ed1('0x3'));var rp=require('request-promise');var moment=require(_0x9ed1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ed1('0x5'));var util=require(_0x9ed1('0x6'));var path=require(_0x9ed1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9ed1('0x8'));var crypto=require(_0x9ed1('0x9'));var jsforce=require(_0x9ed1('0xa'));var deskjs=require(_0x9ed1('0xb'));var toCsv=require(_0x9ed1('0xc'));var querystring=require(_0x9ed1('0xd'));var Papa=require('papaparse');var Redis=require(_0x9ed1('0xe'));var authService=require(_0x9ed1('0xf'));var qs=require(_0x9ed1('0x10'));var as=require(_0x9ed1('0x11'));var hardwareService=require(_0x9ed1('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9ed1('0x13'));var licenseUtil=require(_0x9ed1('0x14'));var db=require(_0x9ed1('0x15'))['db'];config[_0x9ed1('0x16')]=_[_0x9ed1('0x17')](config['redis'],{'host':_0x9ed1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ed1('0x16')]));require(_0x9ed1('0x19'))[_0x9ed1('0x1a')](socket);function respondWithStatusCode(_0x3f302c,_0x5fda98){_0x5fda98=_0x5fda98||0xcc;return function(_0x4c3d9b){if(_0x4c3d9b){return _0x3f302c[_0x9ed1('0x1b')](_0x5fda98);}return _0x3f302c[_0x9ed1('0x1c')](_0x5fda98)[_0x9ed1('0x1d')]();};}function respondWithResult(_0x2315ab,_0xd10eff){_0xd10eff=_0xd10eff||0xc8;return function(_0x244907){if(_0x244907){return _0x2315ab['status'](_0xd10eff)[_0x9ed1('0x1e')](_0x244907);}};}function respondWithFilteredResult(_0x4f606b,_0xce10fe){return function(_0x1e83d2){if(_0x1e83d2){var _0x3b1c18=typeof _0xce10fe[_0x9ed1('0x1f')]==='undefined'&&typeof _0xce10fe['limit']===_0x9ed1('0x20');var _0x729d60=_0x1e83d2[_0x9ed1('0x21')];var _0x2fd7af=_0x3b1c18?0x0:_0xce10fe[_0x9ed1('0x1f')];var _0x2b3ee2=_0x3b1c18?_0x1e83d2[_0x9ed1('0x21')]:_0xce10fe[_0x9ed1('0x1f')]+_0xce10fe[_0x9ed1('0x22')];var _0xe669ae;if(_0x2b3ee2>=_0x729d60){_0x2b3ee2=_0x729d60;_0xe669ae=0xc8;}else{_0xe669ae=0xce;}_0x4f606b[_0x9ed1('0x1c')](_0xe669ae);return _0x4f606b[_0x9ed1('0x23')](_0x9ed1('0x24'),_0x2fd7af+'-'+_0x2b3ee2+'/'+_0x729d60)['json'](_0x1e83d2);}return null;};}function patchUpdates(_0x3a1b2f){return function(_0x3483cb){try{jsonpatch[_0x9ed1('0x25')](_0x3483cb,_0x3a1b2f,!![]);}catch(_0x20c12b){return BPromise[_0x9ed1('0x26')](_0x20c12b);}return _0x3483cb['save']();};}function saveUpdates(_0x27ccbe,_0x462ee7){return function(_0x51c6ec){if(_0x51c6ec){return _0x51c6ec[_0x9ed1('0x27')](_0x27ccbe)['then'](function(_0x4bb06f){return _0x4bb06f;});}return null;};}function removeEntity(_0x394b68,_0x3a4ded){return function(_0x5699ae){if(_0x5699ae){return _0x5699ae['destroy']()['then'](function(){var _0x363178=_0x5699ae['get']({'plain':!![]});var _0x34b8f1=_0x9ed1('0x28');return db['UserProfileResource'][_0x9ed1('0x29')]({'where':{'type':_0x34b8f1,'resourceId':_0x363178['id']}})['then'](function(){return _0x5699ae;});})[_0x9ed1('0x2a')](function(){_0x394b68[_0x9ed1('0x1c')](0xcc)[_0x9ed1('0x1d')]();});}};}function handleEntityNotFound(_0x318df2,_0x208623){return function(_0x1de570){if(!_0x1de570){_0x318df2[_0x9ed1('0x1b')](0x194);}return _0x1de570;};}function handleError(_0x1a7b4b,_0x185454){_0x185454=_0x185454||0x1f4;return function(_0x45f347){logger['error'](_0x45f347[_0x9ed1('0x2b')]);if(_0x45f347[_0x9ed1('0x2c')]){delete _0x45f347[_0x9ed1('0x2c')];}_0x1a7b4b[_0x9ed1('0x1c')](_0x185454)['send'](_0x45f347);};}exports['index']=function(_0x230469,_0x2fadc6){var _0x38fefe={},_0x414a1b={},_0x1ca36f={'count':0x0,'rows':[]};var _0x190507=_[_0x9ed1('0x2d')](db[_0x9ed1('0x2e')][_0x9ed1('0x2f')],function(_0x55e946){return{'name':_0x55e946['fieldName'],'type':_0x55e946[_0x9ed1('0x30')][_0x9ed1('0x31')]};});_0x414a1b[_0x9ed1('0x32')]=_[_0x9ed1('0x2d')](_0x190507,_0x9ed1('0x2c'));_0x414a1b[_0x9ed1('0x33')]=_[_0x9ed1('0x34')](_0x230469['query']);_0x414a1b[_0x9ed1('0x35')]=_['intersection'](_0x414a1b[_0x9ed1('0x32')],_0x414a1b[_0x9ed1('0x33')]);_0x38fefe[_0x9ed1('0x36')]=_[_0x9ed1('0x37')](_0x414a1b[_0x9ed1('0x32')],qs[_0x9ed1('0x38')](_0x230469[_0x9ed1('0x33')][_0x9ed1('0x38')]));_0x38fefe['attributes']=_0x38fefe[_0x9ed1('0x36')][_0x9ed1('0x39')]?_0x38fefe[_0x9ed1('0x36')]:_0x414a1b[_0x9ed1('0x32')];if(!_0x230469[_0x9ed1('0x33')]['hasOwnProperty'](_0x9ed1('0x3a'))){_0x38fefe['limit']=qs[_0x9ed1('0x22')](_0x230469[_0x9ed1('0x33')][_0x9ed1('0x22')]);_0x38fefe[_0x9ed1('0x1f')]=qs[_0x9ed1('0x1f')](_0x230469[_0x9ed1('0x33')][_0x9ed1('0x1f')]);}_0x38fefe[_0x9ed1('0x3b')]=qs[_0x9ed1('0x3c')](_0x230469[_0x9ed1('0x33')][_0x9ed1('0x3c')]);_0x38fefe[_0x9ed1('0x3d')]=qs[_0x9ed1('0x35')](_[_0x9ed1('0x3e')](_0x230469[_0x9ed1('0x33')],_0x414a1b['filters']),_0x190507);if(_0x230469[_0x9ed1('0x33')][_0x9ed1('0x3f')]){_0x38fefe[_0x9ed1('0x3d')]=_[_0x9ed1('0x40')](_0x38fefe[_0x9ed1('0x3d')],{'$or':_[_0x9ed1('0x2d')](_0x190507,function(_0x347e05){if(_0x347e05['type']!==_0x9ed1('0x41')){var _0x16cefb={};_0x16cefb[_0x347e05['name']]={'$like':'%'+_0x230469[_0x9ed1('0x33')][_0x9ed1('0x3f')]+'%'};return _0x16cefb;}})});}_0x38fefe=_['merge']({},_0x38fefe,_0x230469[_0x9ed1('0x42')]);var _0x56286b={'where':_0x38fefe[_0x9ed1('0x3d')]};return db[_0x9ed1('0x2e')][_0x9ed1('0x21')](_0x56286b)[_0x9ed1('0x2a')](function(_0x4ae343){_0x1ca36f[_0x9ed1('0x21')]=_0x4ae343;if(_0x230469[_0x9ed1('0x33')][_0x9ed1('0x43')]){_0x38fefe[_0x9ed1('0x44')]=[{'all':!![]}];}return db[_0x9ed1('0x2e')]['findAll'](_0x38fefe);})[_0x9ed1('0x2a')](function(_0x599a51){_0x1ca36f[_0x9ed1('0x45')]=_0x599a51;return _0x1ca36f;})[_0x9ed1('0x2a')](respondWithFilteredResult(_0x2fadc6,_0x38fefe))[_0x9ed1('0x46')](handleError(_0x2fadc6,null));};exports[_0x9ed1('0x47')]=function(_0x1ab3c0,_0x5c76e6){var _0x42e032={'raw':!![],'where':{'id':_0x1ab3c0['params']['id']}},_0x366375={};_0x366375[_0x9ed1('0x32')]=_[_0x9ed1('0x34')](db[_0x9ed1('0x2e')]['rawAttributes']);_0x366375['query']=_[_0x9ed1('0x34')](_0x1ab3c0[_0x9ed1('0x33')]);_0x366375['filters']=_[_0x9ed1('0x37')](_0x366375[_0x9ed1('0x32')],_0x366375['query']);_0x42e032[_0x9ed1('0x36')]=_[_0x9ed1('0x37')](_0x366375[_0x9ed1('0x32')],qs['fields'](_0x1ab3c0[_0x9ed1('0x33')][_0x9ed1('0x38')]));_0x42e032['attributes']=_0x42e032[_0x9ed1('0x36')][_0x9ed1('0x39')]?_0x42e032[_0x9ed1('0x36')]:_0x366375['model'];if(_0x1ab3c0['query'][_0x9ed1('0x43')]){_0x42e032[_0x9ed1('0x44')]=[{'all':!![]}];}_0x42e032=_[_0x9ed1('0x40')]({},_0x42e032,_0x1ab3c0['options']);return db[_0x9ed1('0x2e')]['find'](_0x42e032)[_0x9ed1('0x2a')](handleEntityNotFound(_0x5c76e6,null))['then'](respondWithResult(_0x5c76e6,null))[_0x9ed1('0x46')](handleError(_0x5c76e6,null));};exports[_0x9ed1('0x48')]=function(_0x1bfe52,_0x5ae704){return db['WhatsappQueue']['create'](_0x1bfe52[_0x9ed1('0x49')],{})[_0x9ed1('0x2a')](function(_0x264331){var _0x10dabe=_0x1bfe52[_0x9ed1('0x4a')][_0x9ed1('0x4b')]({'plain':!![]});if(!_0x10dabe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10dabe[_0x9ed1('0x4c')]===_0x9ed1('0x4a')){var _0x45b711=_0x264331[_0x9ed1('0x4b')]({'plain':!![]});var _0x24d5e6=_0x9ed1('0x28');return db[_0x9ed1('0x4d')][_0x9ed1('0x4e')]({'where':{'name':_0x24d5e6,'userProfileId':_0x10dabe[_0x9ed1('0x4f')]},'raw':!![]})[_0x9ed1('0x2a')](function(_0xa0a5e2){if(_0xa0a5e2&&_0xa0a5e2[_0x9ed1('0x50')]===0x0){return db['UserProfileResource'][_0x9ed1('0x48')]({'name':_0x45b711[_0x9ed1('0x2c')],'resourceId':_0x45b711['id'],'type':_0xa0a5e2[_0x9ed1('0x2c')],'sectionId':_0xa0a5e2['id']},{})[_0x9ed1('0x2a')](function(){return _0x264331;});}else{return _0x264331;}})['catch'](function(_0x5d401d){logger[_0x9ed1('0x51')](_0x9ed1('0x52'),_0x5d401d);throw _0x5d401d;});}return _0x264331;})[_0x9ed1('0x2a')](respondWithResult(_0x5ae704,0xc9))[_0x9ed1('0x46')](handleError(_0x5ae704,null));};exports[_0x9ed1('0x27')]=function(_0x43be37,_0x540c9a){if(_0x43be37['body']['id']){delete _0x43be37['body']['id'];}return db[_0x9ed1('0x2e')][_0x9ed1('0x4e')]({'where':{'id':_0x43be37[_0x9ed1('0x53')]['id']}})['then'](handleEntityNotFound(_0x540c9a,null))['then'](saveUpdates(_0x43be37['body'],null))[_0x9ed1('0x2a')](respondWithResult(_0x540c9a,null))[_0x9ed1('0x46')](handleError(_0x540c9a,null));};exports['destroy']=function(_0x38077d,_0x297e93){return db[_0x9ed1('0x2e')]['find']({'where':{'id':_0x38077d[_0x9ed1('0x53')]['id']}})[_0x9ed1('0x2a')](handleEntityNotFound(_0x297e93,null))[_0x9ed1('0x2a')](removeEntity(_0x297e93,null))[_0x9ed1('0x46')](handleError(_0x297e93,null));};exports[_0x9ed1('0x54')]=function(_0x38ca4d,_0x5ce726){return db[_0x9ed1('0x2e')]['describe']()[_0x9ed1('0x2a')](respondWithResult(_0x5ce726,null))['catch'](handleError(_0x5ce726,null));};exports['getMembers']=function(_0xbe8048,_0x1b31c6,_0x372a0f){var _0x5d5ec3={'raw':!![],'where':{}},_0x1f179c={},_0x5db8c5;return db[_0x9ed1('0x2e')][_0x9ed1('0x55')]({'where':{'id':_0xbe8048[_0x9ed1('0x53')]['id']}})[_0x9ed1('0x2a')](handleEntityNotFound(_0x1b31c6,null))[_0x9ed1('0x2a')](function(_0x5ee811){if(_0x5ee811){_0x5db8c5=_0x5ee811['get']({'plain':!![]});_0x1f179c[_0x9ed1('0x32')]=_['keys'](db[_0x9ed1('0x56')][_0x9ed1('0x2f')]);_0x1f179c[_0x9ed1('0x33')]=_[_0x9ed1('0x34')](_0xbe8048['query']);_0x1f179c[_0x9ed1('0x35')]=_[_0x9ed1('0x37')](_0x1f179c[_0x9ed1('0x32')],_0x1f179c['query']);_0x5d5ec3['attributes']=_['intersection'](_0x1f179c[_0x9ed1('0x32')],qs[_0x9ed1('0x38')](_0xbe8048[_0x9ed1('0x33')][_0x9ed1('0x38')]));_0x5d5ec3[_0x9ed1('0x36')]=_0x5d5ec3[_0x9ed1('0x36')][_0x9ed1('0x39')]?_0x5d5ec3['attributes']:_0x1f179c['model'];if(!_0xbe8048[_0x9ed1('0x33')][_0x9ed1('0x57')](_0x9ed1('0x3a'))){_0x5d5ec3[_0x9ed1('0x22')]=qs[_0x9ed1('0x22')](_0xbe8048['query'][_0x9ed1('0x22')]);_0x5d5ec3['offset']=qs[_0x9ed1('0x1f')](_0xbe8048[_0x9ed1('0x33')][_0x9ed1('0x1f')]);}_0x5d5ec3[_0x9ed1('0x3b')]=qs[_0x9ed1('0x3c')](_0xbe8048[_0x9ed1('0x33')][_0x9ed1('0x3c')]);_0x5d5ec3[_0x9ed1('0x3d')]=qs[_0x9ed1('0x35')](_[_0x9ed1('0x3e')](_0xbe8048[_0x9ed1('0x33')],_0x1f179c['filters']));_0x5d5ec3['where'][_0x9ed1('0x58')]=_0x5ee811['id'];if(_0xbe8048['query'][_0x9ed1('0x3f')]){_0x5d5ec3[_0x9ed1('0x3d')]=_['merge'](_0x5d5ec3[_0x9ed1('0x3d')],{'$or':_['map'](_0x5d5ec3[_0x9ed1('0x36')],function(_0x23cfe4){var _0x468dea={};_0x468dea[_0x23cfe4]={'$like':'%'+_0xbe8048[_0x9ed1('0x33')][_0x9ed1('0x3f')]+'%'};return _0x468dea;})});}_0x5d5ec3=_[_0x9ed1('0x40')]({},_0x5d5ec3,_0xbe8048[_0x9ed1('0x42')]);return db[_0x9ed1('0x56')]['findAll'](_0x5d5ec3);}})[_0x9ed1('0x2a')](function(_0x5e0d4b){if(_0x5e0d4b){return db[_0x9ed1('0x59')]['findAndCountAll']({'where':{'id':_[_0x9ed1('0x2d')](_0x5e0d4b,_0x9ed1('0x5a')),'role':_0x9ed1('0x5b')},'attributes':['id',_0x9ed1('0x2c'),_0x9ed1('0x5c'),_0x9ed1('0x5d'),_0x9ed1('0x5e')]});}})[_0x9ed1('0x2a')](function(_0x1b5019){if(_0x1b5019){return{'count':_0x1b5019['count'],'rows':_[_0x9ed1('0x2d')](_0x1b5019[_0x9ed1('0x45')],function(_0x4142d5){return{'membername':_0x4142d5[_0x9ed1('0x2c')],'UserId':_0x4142d5['id'],'queue_name':_0x5db8c5['name'],'WhatsappQueueId':_0x5db8c5['id'],'interface':util[_0x9ed1('0x5f')](_0x9ed1('0x60'),_0x9ed1('0x61'),_0x4142d5[_0x9ed1('0x2c')]),'penalty':0x0,'paused':_0x4142d5[_0x9ed1('0x5c')],'createdAt':_0x4142d5[_0x9ed1('0x5e')],'updatedAt':_0x4142d5[_0x9ed1('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9ed1('0x2a')](respondWithFilteredResult(_0x1b31c6,_0x5d5ec3))[_0x9ed1('0x46')](handleError(_0x1b31c6,null));};exports['getTeams']=function(_0x53cd50,_0x3b40a1,_0x1e7dc8){var _0x1f5e9d={};var _0x498731={};var _0xe498e9;var _0x3aec0a;return db[_0x9ed1('0x2e')][_0x9ed1('0x55')]({'where':{'id':_0x53cd50[_0x9ed1('0x53')]['id']}})[_0x9ed1('0x2a')](handleEntityNotFound(_0x3b40a1,null))[_0x9ed1('0x2a')](function(_0x3c2b02){if(_0x3c2b02){_0xe498e9=_0x3c2b02;_0x498731[_0x9ed1('0x32')]=_[_0x9ed1('0x34')](db['Team'][_0x9ed1('0x2f')]);_0x498731[_0x9ed1('0x33')]=_[_0x9ed1('0x34')](_0x53cd50[_0x9ed1('0x33')]);_0x498731[_0x9ed1('0x35')]=_['intersection'](_0x498731[_0x9ed1('0x32')],_0x498731['query']);_0x1f5e9d['attributes']=_[_0x9ed1('0x37')](_0x498731[_0x9ed1('0x32')],qs[_0x9ed1('0x38')](_0x53cd50['query'][_0x9ed1('0x38')]));_0x1f5e9d[_0x9ed1('0x36')]=_0x1f5e9d[_0x9ed1('0x36')][_0x9ed1('0x39')]?_0x1f5e9d[_0x9ed1('0x36')]:_0x498731[_0x9ed1('0x32')];_0x1f5e9d[_0x9ed1('0x3b')]=qs['sort'](_0x53cd50[_0x9ed1('0x33')][_0x9ed1('0x3c')]);_0x1f5e9d[_0x9ed1('0x3d')]=qs[_0x9ed1('0x35')](_[_0x9ed1('0x3e')](_0x53cd50[_0x9ed1('0x33')],_0x498731[_0x9ed1('0x35')]));if(_0x53cd50['query'][_0x9ed1('0x3f')]){_0x1f5e9d[_0x9ed1('0x3d')]=_[_0x9ed1('0x40')](_0x1f5e9d[_0x9ed1('0x3d')],{'$or':_[_0x9ed1('0x2d')](_0x1f5e9d['attributes'],function(_0x41e64d){var _0x28b44c={};_0x28b44c[_0x41e64d]={'$like':'%'+_0x53cd50[_0x9ed1('0x33')][_0x9ed1('0x3f')]+'%'};return _0x28b44c;})});}_0x1f5e9d=_[_0x9ed1('0x40')]({},_0x1f5e9d,_0x53cd50['options']);return _0xe498e9[_0x9ed1('0x62')](_0x1f5e9d);}})[_0x9ed1('0x2a')](function(_0x2e81b4){if(_0x2e81b4){_0x3aec0a=_0x2e81b4[_0x9ed1('0x39')];if(!_0x53cd50['query'][_0x9ed1('0x57')]('nolimit')){_0x1f5e9d[_0x9ed1('0x22')]=qs[_0x9ed1('0x22')](_0x53cd50[_0x9ed1('0x33')][_0x9ed1('0x22')]);_0x1f5e9d[_0x9ed1('0x1f')]=qs[_0x9ed1('0x1f')](_0x53cd50[_0x9ed1('0x33')][_0x9ed1('0x1f')]);}return _0xe498e9['getTeams'](_0x1f5e9d);}})[_0x9ed1('0x2a')](function(_0x217787){if(_0x217787){return _0x217787?{'count':_0x3aec0a,'rows':_0x217787}:null;}})[_0x9ed1('0x2a')](respondWithResult(_0x3b40a1,null))['catch'](handleError(_0x3b40a1,null));};exports[_0x9ed1('0x63')]=function(_0x398455,_0x22e2b5,_0x5df96f){var _0x3429c1=_0x398455[_0x9ed1('0x49')]['ids'];return db['Team']['findAll']({'where':{'id':_0x3429c1},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9ed1('0x64'),'attributes':['id',_0x9ed1('0x2c'),_0x9ed1('0x65'),_0x9ed1('0x66'),_0x9ed1('0x67')],'raw':!![]}]})[_0x9ed1('0x2a')](function(_0x27d909){if(_0x27d909){var _0xa96b05=_['flatMap'](_0x27d909,function(_0x5a711a){var _0x5b6dd0=_0x5a711a[_0x9ed1('0x4b')]({'plain':!![]});return _0x5b6dd0['Agents'];});return db[_0x9ed1('0x2e')][_0x9ed1('0x4e')]({'where':{'id':_0x398455[_0x9ed1('0x53')]['id']}})[_0x9ed1('0x2a')](function(_0x177aba){return db[_0x9ed1('0x68')][_0x9ed1('0x69')](function(_0xcee8bb){return _0x177aba['addTeams'](_0x3429c1,{'transaction':_0xcee8bb})[_0x9ed1('0x2a')](function(){return BPromise[_0x9ed1('0x6a')](_0xa96b05,function(_0x4550e4){return db[_0x9ed1('0x56')]['findOrCreate']({'where':{'UserId':_0x4550e4['id'],'WhatsappQueueId':_0x398455[_0x9ed1('0x53')]['id']},'transaction':_0xcee8bb});});})[_0x9ed1('0x2a')](function(){_0xa96b05[_0x9ed1('0x6b')](function(_0x5757dc){socket[_0x9ed1('0x6c')]('userWhatsappQueue:save',{'UserId':_0x5757dc['id'],'WhatsappQueueId':_0x177aba['id']});});});});});}})[_0x9ed1('0x2a')](respondWithStatusCode(_0x22e2b5,null))[_0x9ed1('0x46')](handleError(_0x22e2b5,null));};exports[_0x9ed1('0x6d')]=function(_0x75a6ee,_0x45f4c7,_0x54cccc){return db[_0x9ed1('0x6e')]['findAll']({'where':{'id':_0x75a6ee[_0x9ed1('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9ed1('0x59')],'as':_0x9ed1('0x64'),'attributes':['id'],'raw':!![]}]})[_0x9ed1('0x2a')](handleEntityNotFound(_0x45f4c7,null))['then'](function(_0x4c9292){var _0x46e0b1=_[_0x9ed1('0x2d')](_0x4c9292,'id');var _0xd30e65=[];var _0x274cd0=[];var _0x595bfb=squel['select']();_0x595bfb[_0x9ed1('0x6f')](_0x9ed1('0x70'))[_0x9ed1('0x71')](_0x9ed1('0x72'),'tq')['join'](_0x9ed1('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9ed1('0x3d')](_0x9ed1('0x74'),_0x75a6ee[_0x9ed1('0x53')]['id']);for(var _0x298108=0x0;_0x298108<_0x4c9292['length'];_0x298108+=0x1){let _0x29150c=_0x4c9292[_0x298108];for(var _0x19a9fc=0x0;_0x19a9fc<_0x29150c[_0x9ed1('0x64')]['length'];_0x19a9fc+=0x1){let _0x1c9ed4=_0x29150c['Agents'][_0x19a9fc];var _0x1d7895=_0x595bfb[_0x9ed1('0x75')]();_0x1d7895[_0x9ed1('0x3d')](_0x9ed1('0x76'),_0x1c9ed4['id']);_0x274cd0[_0x9ed1('0x77')](db[_0x9ed1('0x68')][_0x9ed1('0x33')](_0x1d7895[_0x9ed1('0x78')](),{'type':db[_0x9ed1('0x68')][_0x9ed1('0x79')][_0x9ed1('0x7a')]})[_0x9ed1('0x2a')](function(_0x1180b3){if(_0x1180b3[_0x9ed1('0x39')]===0x1){return _0x1c9ed4['id'];}else{var _0x2deee2=_[_0x9ed1('0x7b')](_[_0x9ed1('0x2d')](_0x1180b3,_0x9ed1('0x7c')),function(_0x3f1aab){return _['includes'](_0x46e0b1,_0x3f1aab);});if(_0x2deee2){return _0x1c9ed4['id'];}}}));}}return BPromise[_0x9ed1('0x7d')](_0x274cd0)[_0x9ed1('0x2a')](function(_0x524329){_0xd30e65=_(_0xd30e65)[_0x9ed1('0x7e')](_0x524329)[_0x9ed1('0x7f')]()[_0x9ed1('0x80')]();return db[_0x9ed1('0x2e')][_0x9ed1('0x4e')]({'where':{'id':_0x75a6ee[_0x9ed1('0x53')]['id']}})[_0x9ed1('0x2a')](function(_0x405457){return db[_0x9ed1('0x68')]['transaction'](function(_0x36fae0){return _0x405457[_0x9ed1('0x6d')](_0x75a6ee[_0x9ed1('0x33')][_0x9ed1('0x81')],{'transaction':_0x36fae0})['then'](function(){if(!_[_0x9ed1('0x82')](_0xd30e65)){return _0x405457['removeAgents'](_0xd30e65,{'transaction':_0x36fae0});}})['then'](function(){_0xd30e65[_0x9ed1('0x6b')](function(_0x494ef0){socket[_0x9ed1('0x6c')](_0x9ed1('0x83'),{'UserId':_0x494ef0,'WhatsappQueueId':_0x405457['id']});});});});});});})['then'](respondWithStatusCode(_0x45f4c7,null))[_0x9ed1('0x46')](handleError(_0x45f4c7,null));};exports[_0x9ed1('0x84')]=function(_0x19ebba,_0x429376,_0x4127fc){return db[_0x9ed1('0x2e')][_0x9ed1('0x4e')]({'where':{'id':_0x19ebba[_0x9ed1('0x53')]['id']}})['then'](handleEntityNotFound(_0x429376,null))['then'](function(_0x19a79d){if(_0x19a79d){return _0x19a79d[_0x9ed1('0x84')](_0x19ebba['body'][_0x9ed1('0x81')],_[_0x9ed1('0x85')](_0x19ebba['body'],[_0x9ed1('0x81'),'id'])||{})[_0x9ed1('0x86')](function(_0x4d3724){for(var _0x280c49=0x0;_0x280c49<_0x19ebba['body'][_0x9ed1('0x81')][_0x9ed1('0x39')];_0x280c49+=0x1){socket[_0x9ed1('0x6c')](_0x9ed1('0x87'),{'UserId':Number(_0x19ebba[_0x9ed1('0x49')][_0x9ed1('0x81')][_0x280c49]),'WhatsappQueueId':Number(_0x19ebba[_0x9ed1('0x53')]['id'])});}return _0x4d3724;});}})[_0x9ed1('0x2a')](respondWithResult(_0x429376,null))[_0x9ed1('0x46')](handleError(_0x429376,null));};exports[_0x9ed1('0x88')]=function(_0x3d05f5,_0x447675,_0x27d3f0){return db[_0x9ed1('0x2e')][_0x9ed1('0x4e')]({'where':{'id':_0x3d05f5[_0x9ed1('0x53')]['id']}})[_0x9ed1('0x2a')](handleEntityNotFound(_0x447675,null))[_0x9ed1('0x2a')](function(_0x530b23){if(_0x530b23){return _0x530b23[_0x9ed1('0x88')](_0x3d05f5[_0x9ed1('0x33')][_0x9ed1('0x81')])[_0x9ed1('0x2a')](function(){if(_[_0x9ed1('0x89')](_0x3d05f5[_0x9ed1('0x33')][_0x9ed1('0x81')])){for(var _0x59501f=0x0;_0x59501f<_0x3d05f5[_0x9ed1('0x33')][_0x9ed1('0x81')][_0x9ed1('0x39')];_0x59501f+=0x1){socket[_0x9ed1('0x6c')](_0x9ed1('0x83'),{'UserId':Number(_0x3d05f5[_0x9ed1('0x33')][_0x9ed1('0x81')][_0x59501f]),'WhatsappQueueId':Number(_0x3d05f5[_0x9ed1('0x53')]['id'])});}}else{socket[_0x9ed1('0x6c')](_0x9ed1('0x83'),{'UserId':Number(_0x3d05f5[_0x9ed1('0x33')][_0x9ed1('0x81')]),'WhatsappQueueId':Number(_0x3d05f5[_0x9ed1('0x53')]['id'])});}});}})[_0x9ed1('0x2a')](respondWithStatusCode(_0x447675,null))[_0x9ed1('0x46')](handleError(_0x447675,null));};exports[_0x9ed1('0x8a')]=function(_0x1808f9,_0xb2eeaf,_0x2d6506){var _0x2ee64e={};var _0xfbdf14={};var _0x54de99;var _0x26c559;return db['WhatsappQueue'][_0x9ed1('0x55')]({'where':{'id':_0x1808f9[_0x9ed1('0x53')]['id']}})[_0x9ed1('0x2a')](handleEntityNotFound(_0xb2eeaf,null))[_0x9ed1('0x2a')](function(_0x25ea49){if(_0x25ea49){_0x54de99=_0x25ea49;_0xfbdf14[_0x9ed1('0x32')]=_[_0x9ed1('0x34')](db['User'][_0x9ed1('0x2f')]);_0xfbdf14[_0x9ed1('0x33')]=_[_0x9ed1('0x34')](_0x1808f9['query']);_0xfbdf14['filters']=_[_0x9ed1('0x37')](_0xfbdf14['model'],_0xfbdf14[_0x9ed1('0x33')]);_0x2ee64e[_0x9ed1('0x36')]=_['intersection'](_0xfbdf14[_0x9ed1('0x32')],qs[_0x9ed1('0x38')](_0x1808f9[_0x9ed1('0x33')][_0x9ed1('0x38')]));_0x2ee64e['attributes']=_0x2ee64e['attributes'][_0x9ed1('0x39')]?_0x2ee64e[_0x9ed1('0x36')]:_0xfbdf14['model'];_0x2ee64e[_0x9ed1('0x3b')]=qs[_0x9ed1('0x3c')](_0x1808f9[_0x9ed1('0x33')][_0x9ed1('0x3c')]);_0x2ee64e[_0x9ed1('0x3d')]=qs[_0x9ed1('0x35')](_['pick'](_0x1808f9['query'],_0xfbdf14['filters']));if(_0x1808f9[_0x9ed1('0x33')][_0x9ed1('0x3f')]){_0x2ee64e[_0x9ed1('0x3d')]=_['merge'](_0x2ee64e['where'],{'$or':_[_0x9ed1('0x2d')](_0x2ee64e[_0x9ed1('0x36')],function(_0x46caa2){var _0x36948d={};_0x36948d[_0x46caa2]={'$like':'%'+_0x1808f9[_0x9ed1('0x33')][_0x9ed1('0x3f')]+'%'};return _0x36948d;})});}_0x2ee64e=_[_0x9ed1('0x40')]({},_0x2ee64e,_0x1808f9['options']);return _0x54de99[_0x9ed1('0x8a')](_0x2ee64e);}})[_0x9ed1('0x2a')](function(_0x3cc231){if(_0x3cc231){_0x26c559=_0x3cc231[_0x9ed1('0x39')];if(!_0x1808f9['query'][_0x9ed1('0x57')](_0x9ed1('0x3a'))){_0x2ee64e[_0x9ed1('0x22')]=qs['limit'](_0x1808f9[_0x9ed1('0x33')]['limit']);_0x2ee64e['offset']=qs[_0x9ed1('0x1f')](_0x1808f9[_0x9ed1('0x33')]['offset']);}return _0x54de99[_0x9ed1('0x8a')](_0x2ee64e);}})['then'](function(_0x2815a6){if(_0x2815a6){return _0x2815a6?{'count':_0x26c559,'rows':_0x2815a6}:null;}})[_0x9ed1('0x2a')](respondWithResult(_0xb2eeaf,null))['catch'](handleError(_0xb2eeaf,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index dfd129f..50e0f34 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2be=['update','remove','hook','exports','events','WhatsappQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2be,0xd6));var _0xef2b=function(_0x559eb3,_0x5908ba){_0x559eb3=_0x559eb3-0x0;var _0x2e6ac6=_0xf2be[_0x559eb3];return _0x2e6ac6;};'use strict';var EventEmitter=require(_0xef2b('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xef2b('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xef2b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef2b('0x3'),'afterDestroy':_0xef2b('0x4')};function emitEvent(_0x3657ae){return function(_0x1ef5b7,_0x48e190,_0x4382fd){WhatsappQueueEvents['emit'](_0x3657ae+':'+_0x1ef5b7['id'],_0x1ef5b7);WhatsappQueueEvents['emit'](_0x3657ae,_0x1ef5b7);_0x4382fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xef2b('0x5')](e,emitEvent(event));}}module[_0xef2b('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x0875=['WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xe6bbe2,_0x4eeae3){var _0x1414f3=function(_0x3aef68){while(--_0x3aef68){_0xe6bbe2['push'](_0xe6bbe2['shift']());}};_0x1414f3(++_0x4eeae3);}(_0x0875,0x170));var _0x5087=function(_0x57e57e,_0x5aa90e){_0x57e57e=_0x57e57e-0x0;var _0x34bc10=_0x0875[_0x57e57e];return _0x34bc10;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x5087('0x0'))['db'][_0x5087('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5087('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5087('0x3'),'afterDestroy':_0x5087('0x4')};function emitEvent(_0x1387e7){return function(_0x54cf17,_0x47c080,_0x484242){WhatsappQueueEvents[_0x5087('0x5')](_0x1387e7+':'+_0x54cf17['id'],_0x54cf17);WhatsappQueueEvents[_0x5087('0x5')](_0x1387e7,_0x54cf17);_0x484242(null);};}for(var e in events){if(events[_0x5087('0x6')](e)){var event=events[e];WhatsappQueue[_0x5087('0x7')](e,emitEvent(event));}}module[_0x5087('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 7dfee9b..cec324d 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca6=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','request-promise'];(function(_0x1787fd,_0x1243eb){var _0x45f02a=function(_0x372f36){while(--_0x372f36){_0x1787fd['push'](_0x1787fd['shift']());}};_0x45f02a(++_0x1243eb);}(_0x7ca6,0x197));var _0x67ca=function(_0x3eb072,_0x96dfb2){_0x3eb072=_0x3eb072-0x0;var _0x5c00b9=_0x7ca6[_0x3eb072];return _0x5c00b9;};'use strict';var _=require(_0x67ca('0x0'));var util=require(_0x67ca('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67ca('0x2'));var fs=require('fs');var path=require(_0x67ca('0x3'));var rimraf=require(_0x67ca('0x4'));var config=require(_0x67ca('0x5'));var attributes=require(_0x67ca('0x6'));module[_0x67ca('0x7')]=function(_0x1d2fba,_0x3be347){return _0x1d2fba[_0x67ca('0x8')](_0x67ca('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a71=['../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xbcbad2,_0x57c30e){var _0x34ecd5=function(_0xec2f2f){while(--_0xec2f2f){_0xbcbad2['push'](_0xbcbad2['shift']());}};_0x34ecd5(++_0x57c30e);}(_0x2a71,0x1e2));var _0x12a7=function(_0x41f745,_0x4b5c4a){_0x41f745=_0x41f745-0x0;var _0x2cbbcb=_0x2a71[_0x41f745];return _0x2cbbcb;};'use strict';var _=require(_0x12a7('0x0'));var util=require(_0x12a7('0x1'));var logger=require(_0x12a7('0x2'))('api');var moment=require(_0x12a7('0x3'));var BPromise=require(_0x12a7('0x4'));var rp=require(_0x12a7('0x5'));var fs=require('fs');var path=require(_0x12a7('0x6'));var rimraf=require(_0x12a7('0x7'));var config=require(_0x12a7('0x8'));var attributes=require(_0x12a7('0x9'));module[_0x12a7('0xa')]=function(_0x289446,_0x1bb0e8){return _0x289446[_0x12a7('0xb')](_0x12a7('0xc'),attributes,{'tableName':_0x12a7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 0a9936a..b70c6d3 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc557=['attributes','map','debug','stringify','catch','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','request','then','info','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','model'];(function(_0x2e79f9,_0x3ea3b3){var _0x66948d=function(_0xa5fc31){while(--_0xa5fc31){_0x2e79f9['push'](_0x2e79f9['shift']());}};_0x66948d(++_0x3ea3b3);}(_0xc557,0xf6));var _0x7c55=function(_0xbb5075,_0x50d7f5){_0xbb5075=_0xbb5075-0x0;var _0x902d8=_0xc557[_0xbb5075];return _0x902d8;};'use strict';var _=require(_0x7c55('0x0'));var util=require(_0x7c55('0x1'));var moment=require(_0x7c55('0x2'));var BPromise=require(_0x7c55('0x3'));var rs=require(_0x7c55('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c55('0x5'))['db'];var utils=require(_0x7c55('0x6'));var logger=require(_0x7c55('0x7'))(_0x7c55('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c55('0x9'));var client=jayson[_0x7c55('0xa')][_0x7c55('0xb')]({'port':0x232a});config[_0x7c55('0xc')]=_['defaults'](config[_0x7c55('0xc')],{'host':_0x7c55('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c55('0xc')]));require(_0x7c55('0xe'))['register'](socket);function respondWithRpcPromise(_0x1576f3,_0x1f19a7,_0x287bf0){return new BPromise(function(_0x1e0ad4,_0x4ad872){return client[_0x7c55('0xf')](_0x1576f3,_0x287bf0)[_0x7c55('0x10')](function(_0x2d7fb2){logger[_0x7c55('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x1f19a7,_0x7c55('0x12'));logger['debug'](_0x7c55('0x13'),_0x1f19a7,_0x7c55('0x12'),JSON['stringify'](_0x2d7fb2));if(_0x2d7fb2['error']){if(_0x2d7fb2[_0x7c55('0x14')][_0x7c55('0x15')]===0x1f4){logger['error'](_0x7c55('0x16'),_0x1f19a7,_0x2d7fb2[_0x7c55('0x14')][_0x7c55('0x17')]);return _0x4ad872(_0x2d7fb2[_0x7c55('0x14')][_0x7c55('0x17')]);}logger[_0x7c55('0x14')](_0x7c55('0x16'),_0x1f19a7,_0x2d7fb2[_0x7c55('0x14')][_0x7c55('0x17')]);return _0x1e0ad4(_0x2d7fb2[_0x7c55('0x14')][_0x7c55('0x17')]);}else{logger[_0x7c55('0x11')](_0x7c55('0x16'),_0x1f19a7,_0x7c55('0x12'));_0x1e0ad4(_0x2d7fb2[_0x7c55('0x18')][_0x7c55('0x17')]);}})['catch'](function(_0x9d2ae7){logger['error'](_0x7c55('0x16'),_0x1f19a7,_0x9d2ae7);_0x4ad872(_0x9d2ae7);});});}exports[_0x7c55('0x19')]=function(_0x2c4664){var _0x1ac204=this;return new Promise(function(_0x54f3b4,_0x405290){return db[_0x7c55('0x1a')][_0x7c55('0x1b')]({'raw':_0x2c4664[_0x7c55('0x1c')]?_0x2c4664[_0x7c55('0x1c')][_0x7c55('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c4664['options']?_0x2c4664[_0x7c55('0x1c')][_0x7c55('0x1e')]||null:null,'attributes':_0x2c4664['options']?_0x2c4664['options']['attributes']||null:null,'limit':_0x2c4664[_0x7c55('0x1c')]?_0x2c4664[_0x7c55('0x1c')][_0x7c55('0x1f')]||null:null,'include':_0x2c4664[_0x7c55('0x1c')]?_0x2c4664[_0x7c55('0x1c')]['include']?_['map'](_0x2c4664['options'][_0x7c55('0x20')],function(_0x1b193f){return{'model':db[_0x1b193f[_0x7c55('0x21')]],'as':_0x1b193f['as'],'attributes':_0x1b193f[_0x7c55('0x22')],'include':_0x1b193f[_0x7c55('0x20')]?_[_0x7c55('0x23')](_0x1b193f[_0x7c55('0x20')],function(_0x5ce251){return{'model':db[_0x5ce251[_0x7c55('0x21')]],'as':_0x5ce251['as'],'attributes':_0x5ce251[_0x7c55('0x22')],'include':_0x5ce251[_0x7c55('0x20')]?_[_0x7c55('0x23')](_0x5ce251[_0x7c55('0x20')],function(_0xf437be){return{'model':db[_0xf437be[_0x7c55('0x21')]],'as':_0xf437be['as'],'attributes':_0xf437be[_0x7c55('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7c55('0x10')](function(_0x2d8a24){logger['info'](_0x7c55('0x19'),_0x2c4664);logger[_0x7c55('0x24')](_0x7c55('0x19'),_0x2c4664,JSON[_0x7c55('0x25')](_0x2d8a24));_0x54f3b4(_0x2d8a24);})[_0x7c55('0x26')](function(_0x43b476){logger[_0x7c55('0x14')](_0x7c55('0x19'),_0x43b476[_0x7c55('0x17')],_0x2c4664);_0x405290(_0x1ac204[_0x7c55('0x14')](0x1f4,_0x43b476[_0x7c55('0x17')]));});});};exports[_0x7c55('0x27')]=function(_0xfe6bbf){var _0x42b722=this;return new Promise(function(_0xb9e529,_0x350ee2){return db[_0x7c55('0x1a')]['find']({'raw':_0xfe6bbf[_0x7c55('0x1c')]?_0xfe6bbf[_0x7c55('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xfe6bbf[_0x7c55('0x1c')]?_0xfe6bbf[_0x7c55('0x1c')]['where']||null:null,'attributes':_0xfe6bbf['options']?_0xfe6bbf[_0x7c55('0x1c')]['attributes']||null:null,'include':_0xfe6bbf['options']?_0xfe6bbf[_0x7c55('0x1c')]['include']?_['map'](_0xfe6bbf[_0x7c55('0x1c')][_0x7c55('0x20')],function(_0x450e7f){return{'model':db[_0x450e7f[_0x7c55('0x21')]],'as':_0x450e7f['as'],'attributes':_0x450e7f['attributes'],'include':_0x450e7f[_0x7c55('0x20')]?_[_0x7c55('0x23')](_0x450e7f[_0x7c55('0x20')],function(_0x5db2ae){return{'model':db[_0x5db2ae['model']],'as':_0x5db2ae['as'],'attributes':_0x5db2ae[_0x7c55('0x22')],'include':_0x5db2ae[_0x7c55('0x20')]?_[_0x7c55('0x23')](_0x5db2ae['include'],function(_0x7478b){return{'model':db[_0x7478b[_0x7c55('0x21')]],'as':_0x7478b['as'],'attributes':_0x7478b[_0x7c55('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7c55('0x10')](function(_0xe5c33){logger[_0x7c55('0x11')]('ShowWhatsappQueue',_0xfe6bbf);logger[_0x7c55('0x24')](_0x7c55('0x27'),_0xfe6bbf,JSON[_0x7c55('0x25')](_0xe5c33));_0xb9e529(_0xe5c33);})[_0x7c55('0x26')](function(_0x24d4fe){logger[_0x7c55('0x14')]('ShowWhatsappQueue',_0x24d4fe[_0x7c55('0x17')],_0xfe6bbf);_0x350ee2(_0x42b722[_0x7c55('0x14')](0x1f4,_0x24d4fe['message']));});});}; \ No newline at end of file +var _0xf3c5=['http','redis','./whatsappQueue.socket','request','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4a7868,_0x48d785){var _0x529fa3=function(_0x3a3882){while(--_0x3a3882){_0x4a7868['push'](_0x4a7868['shift']());}};_0x529fa3(++_0x48d785);}(_0xf3c5,0x6a));var _0x5f3c=function(_0x151762,_0x17691f){_0x151762=_0x151762-0x0;var _0x27f596=_0xf3c5[_0x151762];return _0x27f596;};'use strict';var _=require(_0x5f3c('0x0'));var util=require(_0x5f3c('0x1'));var moment=require('moment');var BPromise=require(_0x5f3c('0x2'));var rs=require(_0x5f3c('0x3'));var fs=require('fs');var Redis=require(_0x5f3c('0x4'));var db=require(_0x5f3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f3c('0x6'))(_0x5f3c('0x7'));var config=require(_0x5f3c('0x8'));var jayson=require(_0x5f3c('0x9'));var client=jayson[_0x5f3c('0xa')][_0x5f3c('0xb')]({'port':0x232a});config[_0x5f3c('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f3c('0xc')]));require(_0x5f3c('0xd'))['register'](socket);function respondWithRpcPromise(_0x58eff1,_0x3e78cc,_0x3e68cd){return new BPromise(function(_0x2ad6e1,_0x5e567e){return client[_0x5f3c('0xe')](_0x58eff1,_0x3e68cd)['then'](function(_0x79ba67){logger[_0x5f3c('0xf')]('WhatsappQueue,\x20%s,\x20%s',_0x3e78cc,_0x5f3c('0x10'));logger[_0x5f3c('0x11')](_0x5f3c('0x12'),_0x3e78cc,_0x5f3c('0x10'),JSON[_0x5f3c('0x13')](_0x79ba67));if(_0x79ba67[_0x5f3c('0x14')]){if(_0x79ba67[_0x5f3c('0x14')][_0x5f3c('0x15')]===0x1f4){logger[_0x5f3c('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x3e78cc,_0x79ba67[_0x5f3c('0x14')][_0x5f3c('0x16')]);return _0x5e567e(_0x79ba67[_0x5f3c('0x14')][_0x5f3c('0x16')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x3e78cc,_0x79ba67[_0x5f3c('0x14')][_0x5f3c('0x16')]);return _0x2ad6e1(_0x79ba67[_0x5f3c('0x14')][_0x5f3c('0x16')]);}else{logger['info'](_0x5f3c('0x17'),_0x3e78cc,'request\x20sent');_0x2ad6e1(_0x79ba67[_0x5f3c('0x18')][_0x5f3c('0x16')]);}})['catch'](function(_0x62f4fb){logger[_0x5f3c('0x14')](_0x5f3c('0x17'),_0x3e78cc,_0x62f4fb);_0x5e567e(_0x62f4fb);});});}exports[_0x5f3c('0x19')]=function(_0xaf2255){var _0x3719ba=this;return new Promise(function(_0x3e2e65,_0x5ce9ea){return db[_0x5f3c('0x1a')][_0x5f3c('0x1b')]({'raw':_0xaf2255[_0x5f3c('0x1c')]?_0xaf2255[_0x5f3c('0x1c')][_0x5f3c('0x1d')]===undefined?!![]:![]:!![],'where':_0xaf2255[_0x5f3c('0x1c')]?_0xaf2255[_0x5f3c('0x1c')][_0x5f3c('0x1e')]||null:null,'attributes':_0xaf2255['options']?_0xaf2255[_0x5f3c('0x1c')][_0x5f3c('0x1f')]||null:null,'limit':_0xaf2255[_0x5f3c('0x1c')]?_0xaf2255['options'][_0x5f3c('0x20')]||null:null,'include':_0xaf2255[_0x5f3c('0x1c')]?_0xaf2255['options'][_0x5f3c('0x21')]?_[_0x5f3c('0x22')](_0xaf2255['options']['include'],function(_0x5bca08){return{'model':db[_0x5bca08[_0x5f3c('0x23')]],'as':_0x5bca08['as'],'attributes':_0x5bca08[_0x5f3c('0x1f')],'include':_0x5bca08['include']?_[_0x5f3c('0x22')](_0x5bca08[_0x5f3c('0x21')],function(_0x2cf12f){return{'model':db[_0x2cf12f[_0x5f3c('0x23')]],'as':_0x2cf12f['as'],'attributes':_0x2cf12f[_0x5f3c('0x1f')],'include':_0x2cf12f[_0x5f3c('0x21')]?_[_0x5f3c('0x22')](_0x2cf12f[_0x5f3c('0x21')],function(_0x5e48a3){return{'model':db[_0x5e48a3[_0x5f3c('0x23')]],'as':_0x5e48a3['as'],'attributes':_0x5e48a3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x39d441){logger[_0x5f3c('0xf')]('GetWhatsappQueue',_0xaf2255);logger[_0x5f3c('0x11')]('GetWhatsappQueue',_0xaf2255,JSON[_0x5f3c('0x13')](_0x39d441));_0x3e2e65(_0x39d441);})['catch'](function(_0x3965ed){logger['error'](_0x5f3c('0x19'),_0x3965ed[_0x5f3c('0x16')],_0xaf2255);_0x5ce9ea(_0x3719ba['error'](0x1f4,_0x3965ed[_0x5f3c('0x16')]));});});};exports[_0x5f3c('0x24')]=function(_0x3249c8){var _0x44040b=this;return new Promise(function(_0x2896ed,_0x2fd9eb){return db[_0x5f3c('0x1a')][_0x5f3c('0x25')]({'raw':_0x3249c8[_0x5f3c('0x1c')]?_0x3249c8['options']['raw']===undefined?!![]:![]:!![],'where':_0x3249c8['options']?_0x3249c8[_0x5f3c('0x1c')]['where']||null:null,'attributes':_0x3249c8[_0x5f3c('0x1c')]?_0x3249c8[_0x5f3c('0x1c')]['attributes']||null:null,'include':_0x3249c8[_0x5f3c('0x1c')]?_0x3249c8['options'][_0x5f3c('0x21')]?_[_0x5f3c('0x22')](_0x3249c8[_0x5f3c('0x1c')][_0x5f3c('0x21')],function(_0x23d577){return{'model':db[_0x23d577[_0x5f3c('0x23')]],'as':_0x23d577['as'],'attributes':_0x23d577[_0x5f3c('0x1f')],'include':_0x23d577[_0x5f3c('0x21')]?_[_0x5f3c('0x22')](_0x23d577[_0x5f3c('0x21')],function(_0x1bb3d6){return{'model':db[_0x1bb3d6[_0x5f3c('0x23')]],'as':_0x1bb3d6['as'],'attributes':_0x1bb3d6[_0x5f3c('0x1f')],'include':_0x1bb3d6['include']?_[_0x5f3c('0x22')](_0x1bb3d6[_0x5f3c('0x21')],function(_0x481861){return{'model':db[_0x481861[_0x5f3c('0x23')]],'as':_0x481861['as'],'attributes':_0x481861['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xf780cd){logger[_0x5f3c('0xf')]('ShowWhatsappQueue',_0x3249c8);logger[_0x5f3c('0x11')](_0x5f3c('0x24'),_0x3249c8,JSON[_0x5f3c('0x13')](_0xf780cd));_0x2896ed(_0xf780cd);})[_0x5f3c('0x26')](function(_0x5d00b4){logger[_0x5f3c('0x14')]('ShowWhatsappQueue',_0x5d00b4['message'],_0x3249c8);_0x2fd9eb(_0x44040b['error'](0x1f4,_0x5d00b4['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index aa8abe0..8d4dda2 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb24f=['./whatsappQueue.events','save','remove','update','removeListener','register','whatsappQueue:'];(function(_0x590ef7,_0x175f08){var _0x4c2634=function(_0xf94570){while(--_0xf94570){_0x590ef7['push'](_0x590ef7['shift']());}};_0x4c2634(++_0x175f08);}(_0xb24f,0x1b9));var _0xfb24=function(_0x41c86d,_0x75ac81){_0x41c86d=_0x41c86d-0x0;var _0x4ff7e1=_0xb24f[_0x41c86d];return _0x4ff7e1;};'use strict';var WhatsappQueueEvents=require(_0xfb24('0x0'));var events=[_0xfb24('0x1'),_0xfb24('0x2'),_0xfb24('0x3')];function createListener(_0x16693d,_0x570396){return function(_0x1cc249){_0x570396['emit'](_0x16693d,_0x1cc249);};}function removeListener(_0xa04bef,_0xce648b){return function(){WhatsappQueueEvents[_0xfb24('0x4')](_0xa04bef,_0xce648b);};}exports[_0xfb24('0x5')]=function(_0x233ac8){for(var _0x39648c=0x0,_0x3680f=events['length'];_0x39648c<_0x3680f;_0x39648c++){var _0x580e6e=events[_0x39648c];var _0x1ec6b1=createListener(_0xfb24('0x6')+_0x580e6e,_0x233ac8);WhatsappQueueEvents['on'](_0x580e6e,_0x1ec6b1);}}; \ No newline at end of file +var _0xe5b5=['length','whatsappQueue:','emit','removeListener','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe5b5,0x165));var _0x5e5b=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xe5b5[_0xd13a88];return _0x1c993c;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save','remove','update'];function createListener(_0x7dfe25,_0x27315e){return function(_0x56ab18){_0x27315e[_0x5e5b('0x0')](_0x7dfe25,_0x56ab18);};}function removeListener(_0x635241,_0x21a550){return function(){WhatsappQueueEvents[_0x5e5b('0x1')](_0x635241,_0x21a550);};}exports[_0x5e5b('0x2')]=function(_0x2f8d18){for(var _0x10ca7b=0x0,_0x5c2625=events[_0x5e5b('0x3')];_0x10ca7b<_0x5c2625;_0x10ca7b++){var _0x4e9dba=events[_0x10ca7b];var _0x339bcf=createListener(_0x5e5b('0x4')+_0x4e9dba,_0x2f8d18);WhatsappQueueEvents['on'](_0x4e9dba,_0x339bcf);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 0005704..9f3dc1c 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf88f=['/describe','describe','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x12f6ac,_0x38b243){var _0x387081=function(_0x57ae69){while(--_0x57ae69){_0x12f6ac['push'](_0x12f6ac['shift']());}};_0x387081(++_0x38b243);}(_0xf88f,0x143));var _0xff88=function(_0x3a9ef7,_0x1bd196){_0x3a9ef7=_0x3a9ef7-0x0;var _0x125210=_0xf88f[_0x3a9ef7];return _0x125210;};'use strict';var multer=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var path=require(_0xff88('0x2'));var timeout=require(_0xff88('0x3'));var express=require('express');var router=express[_0xff88('0x4')]();var fs_extra=require(_0xff88('0x5'));var auth=require(_0xff88('0x6'));var interaction=require(_0xff88('0x7'));var config=require(_0xff88('0x8'));var controller=require(_0xff88('0x9'));router[_0xff88('0xa')]('/',auth[_0xff88('0xb')](),controller[_0xff88('0xc')]);router['get'](_0xff88('0xd'),auth[_0xff88('0xb')](),controller[_0xff88('0xe')]);router[_0xff88('0xa')]('/:id',auth[_0xff88('0xb')](),controller[_0xff88('0xf')]);router[_0xff88('0x10')]('/',auth[_0xff88('0xb')](),controller[_0xff88('0x11')]);router[_0xff88('0x12')]('/:id',auth[_0xff88('0xb')](),controller[_0xff88('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xff88('0x14')]=router; \ No newline at end of file +var _0x6a53=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x6a53,0x1ef));var _0x36a5=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x6a53[_0x16337a];return _0x422365;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x36a5('0x0'));var timeout=require(_0x36a5('0x1'));var express=require(_0x36a5('0x2'));var router=express[_0x36a5('0x3')]();var fs_extra=require(_0x36a5('0x4'));var auth=require(_0x36a5('0x5'));var interaction=require(_0x36a5('0x6'));var config=require(_0x36a5('0x7'));var controller=require(_0x36a5('0x8'));router[_0x36a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x36a5('0xa')]);router['get'](_0x36a5('0xb'),auth[_0x36a5('0xc')](),controller[_0x36a5('0xd')]);router[_0x36a5('0x9')](_0x36a5('0xe'),auth[_0x36a5('0xc')](),controller['show']);router['post']('/',auth[_0x36a5('0xc')](),controller[_0x36a5('0xf')]);router[_0x36a5('0x10')](_0x36a5('0xe'),auth[_0x36a5('0xc')](),controller[_0x36a5('0x11')]);router[_0x36a5('0x12')](_0x36a5('0xe'),auth[_0x36a5('0xc')](),controller['destroy']);module[_0x36a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index e2e6350..5f1e647 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x16e86e,_0x2400c6){var _0x82364f=function(_0x1b3fc6){while(--_0x1b3fc6){_0x16e86e['push'](_0x16e86e['shift']());}};_0x82364f(++_0x2400c6);}(_0x7a54,0x106));var _0x47a5=function(_0x57e73d,_0x43a765){_0x57e73d=_0x57e73d-0x0;var _0x3c5ca5=_0x7a54[_0x57e73d];return _0x3c5ca5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x474359,_0x5674e1){var _0x2b779a=function(_0x30310e){while(--_0x30310e){_0x474359['push'](_0x474359['shift']());}};_0x2b779a(++_0x5674e1);}(_0x7a54,0x106));var _0x47a5=function(_0x332610,_0x33eb7d){_0x332610=_0x332610-0x0;var _0x56aa8d=_0x7a54[_0x332610];return _0x56aa8d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 7af35d7..728ad65 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b4=['../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','WhatsappQueueReport','rows','catch','show','params','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1b5e3b,_0x839c32){_0x1b5e3b=_0x1b5e3b-0x0;var _0x3a92df=_0xf7b4[_0x1b5e3b];return _0x3a92df;};'use strict';var emlformat=require(_0x4f7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7b('0x1'));var rp=require(_0x4f7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f7b('0x3'));var util=require(_0x4f7b('0x4'));var path=require(_0x4f7b('0x5'));var sox=require(_0x4f7b('0x6'));var csv=require(_0x4f7b('0x7'));var ejs=require(_0x4f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7b('0x9'));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('0x7'));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 as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd9b349,_0x2e8dd9){_0x2e8dd9=_0x2e8dd9||0xcc;return function(_0x3c55e1){if(_0x3c55e1){return _0xd9b349[_0x4f7b('0x17')](_0x2e8dd9);}return _0xd9b349['status'](_0x2e8dd9)[_0x4f7b('0x18')]();};}function respondWithResult(_0x368091,_0x407cee){_0x407cee=_0x407cee||0xc8;return function(_0x43a51a){if(_0x43a51a){return _0x368091[_0x4f7b('0x19')](_0x407cee)[_0x4f7b('0x1a')](_0x43a51a);}};}function respondWithFilteredResult(_0x40ecb0,_0x2437cc){return function(_0x260667){if(_0x260667){var _0x29fdd5=typeof _0x2437cc[_0x4f7b('0x1b')]===_0x4f7b('0x1c')&&typeof _0x2437cc['limit']===_0x4f7b('0x1c');var _0x496322=_0x260667['count'];var _0x24e5cf=_0x29fdd5?0x0:_0x2437cc[_0x4f7b('0x1b')];var _0x519d90=_0x29fdd5?_0x260667[_0x4f7b('0x1d')]:_0x2437cc[_0x4f7b('0x1b')]+_0x2437cc[_0x4f7b('0x1e')];var _0xf2311f;if(_0x519d90>=_0x496322){_0x519d90=_0x496322;_0xf2311f=0xc8;}else{_0xf2311f=0xce;}_0x40ecb0['status'](_0xf2311f);return _0x40ecb0[_0x4f7b('0x1f')]('Content-Range',_0x24e5cf+'-'+_0x519d90+'/'+_0x496322)[_0x4f7b('0x1a')](_0x260667);}return null;};}function patchUpdates(_0x12374b){return function(_0xa2f54e){try{jsonpatch[_0x4f7b('0x20')](_0xa2f54e,_0x12374b,!![]);}catch(_0x27127b){return BPromise[_0x4f7b('0x21')](_0x27127b);}return _0xa2f54e[_0x4f7b('0x22')]();};}function saveUpdates(_0x1f545e,_0x2a8b50){return function(_0x5508bd){if(_0x5508bd){return _0x5508bd[_0x4f7b('0x23')](_0x1f545e)[_0x4f7b('0x24')](function(_0x2c9ea6){return _0x2c9ea6;});}return null;};}function removeEntity(_0x5bd43f,_0x150f57){return function(_0x4610a4){if(_0x4610a4){return _0x4610a4['destroy']()[_0x4f7b('0x24')](function(){_0x5bd43f['status'](0xcc)[_0x4f7b('0x18')]();});}};}function handleEntityNotFound(_0x2429be,_0x23c820){return function(_0x278c41){if(!_0x278c41){_0x2429be[_0x4f7b('0x17')](0x194);}return _0x278c41;};}function handleError(_0x94478b,_0x181e13){_0x181e13=_0x181e13||0x1f4;return function(_0x3ad769){logger['error'](_0x3ad769[_0x4f7b('0x25')]);if(_0x3ad769[_0x4f7b('0x26')]){delete _0x3ad769[_0x4f7b('0x26')];}_0x94478b['status'](_0x181e13)[_0x4f7b('0x27')](_0x3ad769);};}exports[_0x4f7b('0x28')]=function(_0x1db684,_0x3a56ff){var _0x1ccce0={},_0x4ebffa={},_0xac1f93={'count':0x0,'rows':[]};var _0x3331b2=_[_0x4f7b('0x29')](db['WhatsappQueueReport'][_0x4f7b('0x2a')],function(_0x5d13a1){return{'name':_0x5d13a1['fieldName'],'type':_0x5d13a1[_0x4f7b('0x2b')]['key']};});_0x4ebffa[_0x4f7b('0x2c')]=_[_0x4f7b('0x29')](_0x3331b2,_0x4f7b('0x26'));_0x4ebffa[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x1db684[_0x4f7b('0x2d')]);_0x4ebffa[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],_0x4ebffa[_0x4f7b('0x2d')]);_0x1ccce0[_0x4f7b('0x31')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x1ccce0[_0x4f7b('0x31')]=_0x1ccce0[_0x4f7b('0x31')][_0x4f7b('0x33')]?_0x1ccce0[_0x4f7b('0x31')]:_0x4ebffa[_0x4f7b('0x2c')];if(!_0x1db684[_0x4f7b('0x2d')]['hasOwnProperty'](_0x4f7b('0x34'))){_0x1ccce0['limit']=qs[_0x4f7b('0x1e')](_0x1db684[_0x4f7b('0x2d')]['limit']);_0x1ccce0[_0x4f7b('0x1b')]=qs[_0x4f7b('0x1b')](_0x1db684[_0x4f7b('0x2d')]['offset']);}_0x1ccce0[_0x4f7b('0x35')]=qs[_0x4f7b('0x36')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x36')]);_0x1ccce0[_0x4f7b('0x37')]=qs[_0x4f7b('0x2f')](_[_0x4f7b('0x38')](_0x1db684['query'],_0x4ebffa[_0x4f7b('0x2f')]),_0x3331b2);if(_0x1db684['query'][_0x4f7b('0x39')]){_0x1ccce0[_0x4f7b('0x37')]=_[_0x4f7b('0x3a')](_0x1ccce0['where'],{'$or':_[_0x4f7b('0x29')](_0x3331b2,function(_0x53da14){if(_0x53da14[_0x4f7b('0x2b')]!==_0x4f7b('0x3b')){var _0x49644e={};_0x49644e[_0x53da14['name']]={'$like':'%'+_0x1db684[_0x4f7b('0x2d')]['filter']+'%'};return _0x49644e;}})});}_0x1ccce0=_[_0x4f7b('0x3a')]({},_0x1ccce0,_0x1db684[_0x4f7b('0x3c')]);var _0x54f9e8={'where':_0x1ccce0[_0x4f7b('0x37')]};return db['WhatsappQueueReport']['count'](_0x54f9e8)['then'](function(_0x1e4421){_0xac1f93[_0x4f7b('0x1d')]=_0x1e4421;if(_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x3d')]){_0x1ccce0['include']=[{'all':!![]}];}return db[_0x4f7b('0x3e')]['findAll'](_0x1ccce0);})[_0x4f7b('0x24')](function(_0x586406){_0xac1f93[_0x4f7b('0x3f')]=_0x586406;return _0xac1f93;})['then'](respondWithFilteredResult(_0x3a56ff,_0x1ccce0))[_0x4f7b('0x40')](handleError(_0x3a56ff,null));};exports[_0x4f7b('0x41')]=function(_0x302163,_0x3ab08f){var _0x2986cd={'raw':!![],'where':{'id':_0x302163[_0x4f7b('0x42')]['id']}},_0x325cd6={};_0x325cd6[_0x4f7b('0x2c')]=_[_0x4f7b('0x2e')](db[_0x4f7b('0x3e')][_0x4f7b('0x2a')]);_0x325cd6[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x302163[_0x4f7b('0x2d')]);_0x325cd6[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x325cd6[_0x4f7b('0x2c')],_0x325cd6[_0x4f7b('0x2d')]);_0x2986cd['attributes']=_['intersection'](_0x325cd6[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x302163[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x2986cd['attributes']=_0x2986cd['attributes'][_0x4f7b('0x33')]?_0x2986cd[_0x4f7b('0x31')]:_0x325cd6[_0x4f7b('0x2c')];if(_0x302163[_0x4f7b('0x2d')]['includeAll']){_0x2986cd['include']=[{'all':!![]}];}_0x2986cd=_[_0x4f7b('0x3a')]({},_0x2986cd,_0x302163[_0x4f7b('0x3c')]);return db[_0x4f7b('0x3e')][_0x4f7b('0x43')](_0x2986cd)[_0x4f7b('0x24')](handleEntityNotFound(_0x3ab08f,null))['then'](respondWithResult(_0x3ab08f,null))[_0x4f7b('0x40')](handleError(_0x3ab08f,null));};exports[_0x4f7b('0x44')]=function(_0x35c0ea,_0x5df68e){return db[_0x4f7b('0x3e')][_0x4f7b('0x44')](_0x35c0ea[_0x4f7b('0x45')],{})[_0x4f7b('0x24')](respondWithResult(_0x5df68e,0xc9))[_0x4f7b('0x40')](handleError(_0x5df68e,null));};exports[_0x4f7b('0x23')]=function(_0xee485,_0x2e563f){if(_0xee485[_0x4f7b('0x45')]['id']){delete _0xee485[_0x4f7b('0x45')]['id'];}return db['WhatsappQueueReport'][_0x4f7b('0x43')]({'where':{'id':_0xee485[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x2e563f,null))['then'](saveUpdates(_0xee485[_0x4f7b('0x45')],null))[_0x4f7b('0x24')](respondWithResult(_0x2e563f,null))[_0x4f7b('0x40')](handleError(_0x2e563f,null));};exports[_0x4f7b('0x46')]=function(_0x145dd7,_0x7e624){return db[_0x4f7b('0x3e')][_0x4f7b('0x43')]({'where':{'id':_0x145dd7[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x7e624,null))['then'](removeEntity(_0x7e624,null))[_0x4f7b('0x40')](handleError(_0x7e624,null));};exports[_0x4f7b('0x47')]=function(_0x12b6a6,_0x4d1ac9){return db[_0x4f7b('0x3e')][_0x4f7b('0x47')]()[_0x4f7b('0x24')](respondWithResult(_0x4d1ac9,null))[_0x4f7b('0x40')](handleError(_0x4d1ac9,null));}; \ No newline at end of file +var _0xa902=['ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','WhatsappQueueReport','findAll','rows','catch','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv'];(function(_0x2782ca,_0x541f51){var _0x315641=function(_0x1077a6){while(--_0x1077a6){_0x2782ca['push'](_0x2782ca['shift']());}};_0x315641(++_0x541f51);}(_0xa902,0x8d));var _0x2a90=function(_0x11ecf4,_0x3742dd){_0x11ecf4=_0x11ecf4-0x0;var _0x552b7c=_0xa902[_0x11ecf4];return _0x552b7c;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];function respondWithStatusCode(_0x57458a,_0x1f6953){_0x1f6953=_0x1f6953||0xcc;return function(_0x57aee3){if(_0x57aee3){return _0x57458a[_0x2a90('0x17')](_0x1f6953);}return _0x57458a[_0x2a90('0x18')](_0x1f6953)[_0x2a90('0x19')]();};}function respondWithResult(_0x4c328b,_0x56d1b8){_0x56d1b8=_0x56d1b8||0xc8;return function(_0x57227c){if(_0x57227c){return _0x4c328b[_0x2a90('0x18')](_0x56d1b8)[_0x2a90('0x1a')](_0x57227c);}};}function respondWithFilteredResult(_0x5a2682,_0x1ff63d){return function(_0x21c648){if(_0x21c648){var _0x312782=typeof _0x1ff63d[_0x2a90('0x1b')]===_0x2a90('0x1c')&&typeof _0x1ff63d[_0x2a90('0x1d')]===_0x2a90('0x1c');var _0x10cf94=_0x21c648[_0x2a90('0x1e')];var _0x5c3e4b=_0x312782?0x0:_0x1ff63d[_0x2a90('0x1b')];var _0x1d9a28=_0x312782?_0x21c648[_0x2a90('0x1e')]:_0x1ff63d['offset']+_0x1ff63d[_0x2a90('0x1d')];var _0x1f51a6;if(_0x1d9a28>=_0x10cf94){_0x1d9a28=_0x10cf94;_0x1f51a6=0xc8;}else{_0x1f51a6=0xce;}_0x5a2682[_0x2a90('0x18')](_0x1f51a6);return _0x5a2682[_0x2a90('0x1f')](_0x2a90('0x20'),_0x5c3e4b+'-'+_0x1d9a28+'/'+_0x10cf94)[_0x2a90('0x1a')](_0x21c648);}return null;};}function patchUpdates(_0x312cd5){return function(_0x114d42){try{jsonpatch[_0x2a90('0x21')](_0x114d42,_0x312cd5,!![]);}catch(_0x465284){return BPromise[_0x2a90('0x22')](_0x465284);}return _0x114d42[_0x2a90('0x23')]();};}function saveUpdates(_0x4fdd62,_0x3da7d0){return function(_0x217873){if(_0x217873){return _0x217873[_0x2a90('0x24')](_0x4fdd62)[_0x2a90('0x25')](function(_0x5912fd){return _0x5912fd;});}return null;};}function removeEntity(_0x180485,_0xd033d){return function(_0x4ed9e6){if(_0x4ed9e6){return _0x4ed9e6[_0x2a90('0x26')]()[_0x2a90('0x25')](function(){_0x180485[_0x2a90('0x18')](0xcc)[_0x2a90('0x19')]();});}};}function handleEntityNotFound(_0x2a212c,_0x1303d9){return function(_0x29ed73){if(!_0x29ed73){_0x2a212c[_0x2a90('0x17')](0x194);}return _0x29ed73;};}function handleError(_0x48c2f9,_0x27f883){_0x27f883=_0x27f883||0x1f4;return function(_0x17f978){logger[_0x2a90('0x27')](_0x17f978[_0x2a90('0x28')]);if(_0x17f978[_0x2a90('0x29')]){delete _0x17f978['name'];}_0x48c2f9['status'](_0x27f883)[_0x2a90('0x2a')](_0x17f978);};}exports['index']=function(_0x53391e,_0x4969c3){var _0x2d83b3={},_0x3c78f5={},_0x595638={'count':0x0,'rows':[]};var _0x5bd700=_[_0x2a90('0x2b')](db['WhatsappQueueReport'][_0x2a90('0x2c')],function(_0x6892e1){return{'name':_0x6892e1[_0x2a90('0x2d')],'type':_0x6892e1[_0x2a90('0x2e')][_0x2a90('0x2f')]};});_0x3c78f5[_0x2a90('0x30')]=_[_0x2a90('0x2b')](_0x5bd700,'name');_0x3c78f5[_0x2a90('0x31')]=_[_0x2a90('0x32')](_0x53391e[_0x2a90('0x31')]);_0x3c78f5['filters']=_[_0x2a90('0x33')](_0x3c78f5[_0x2a90('0x30')],_0x3c78f5[_0x2a90('0x31')]);_0x2d83b3[_0x2a90('0x34')]=_['intersection'](_0x3c78f5[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x53391e[_0x2a90('0x31')][_0x2a90('0x35')]));_0x2d83b3[_0x2a90('0x34')]=_0x2d83b3[_0x2a90('0x34')]['length']?_0x2d83b3[_0x2a90('0x34')]:_0x3c78f5[_0x2a90('0x30')];if(!_0x53391e[_0x2a90('0x31')][_0x2a90('0x36')]('nolimit')){_0x2d83b3[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x53391e['query'][_0x2a90('0x1d')]);_0x2d83b3[_0x2a90('0x1b')]=qs['offset'](_0x53391e['query'][_0x2a90('0x1b')]);}_0x2d83b3[_0x2a90('0x37')]=qs[_0x2a90('0x38')](_0x53391e['query'][_0x2a90('0x38')]);_0x2d83b3['where']=qs[_0x2a90('0x39')](_['pick'](_0x53391e[_0x2a90('0x31')],_0x3c78f5['filters']),_0x5bd700);if(_0x53391e['query'][_0x2a90('0x3a')]){_0x2d83b3['where']=_[_0x2a90('0x3b')](_0x2d83b3[_0x2a90('0x3c')],{'$or':_[_0x2a90('0x2b')](_0x5bd700,function(_0x573aee){if(_0x573aee[_0x2a90('0x2e')]!==_0x2a90('0x3d')){var _0x3be438={};_0x3be438[_0x573aee['name']]={'$like':'%'+_0x53391e[_0x2a90('0x31')][_0x2a90('0x3a')]+'%'};return _0x3be438;}})});}_0x2d83b3=_[_0x2a90('0x3b')]({},_0x2d83b3,_0x53391e['options']);var _0x1aa096={'where':_0x2d83b3[_0x2a90('0x3c')]};return db['WhatsappQueueReport'][_0x2a90('0x1e')](_0x1aa096)[_0x2a90('0x25')](function(_0x2a6bea){_0x595638[_0x2a90('0x1e')]=_0x2a6bea;if(_0x53391e[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x2d83b3[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x40')][_0x2a90('0x41')](_0x2d83b3);})[_0x2a90('0x25')](function(_0x45b41c){_0x595638[_0x2a90('0x42')]=_0x45b41c;return _0x595638;})[_0x2a90('0x25')](respondWithFilteredResult(_0x4969c3,_0x2d83b3))[_0x2a90('0x43')](handleError(_0x4969c3,null));};exports['show']=function(_0x45cbc2,_0x3a70fe){var _0x528b41={'raw':!![],'where':{'id':_0x45cbc2[_0x2a90('0x44')]['id']}},_0x1045bb={};_0x1045bb[_0x2a90('0x30')]=_[_0x2a90('0x32')](db[_0x2a90('0x40')]['rawAttributes']);_0x1045bb[_0x2a90('0x31')]=_['keys'](_0x45cbc2[_0x2a90('0x31')]);_0x1045bb['filters']=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],_0x1045bb[_0x2a90('0x31')]);_0x528b41[_0x2a90('0x34')]=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x45cbc2['query']['fields']));_0x528b41[_0x2a90('0x34')]=_0x528b41[_0x2a90('0x34')][_0x2a90('0x45')]?_0x528b41[_0x2a90('0x34')]:_0x1045bb[_0x2a90('0x30')];if(_0x45cbc2[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x528b41[_0x2a90('0x3f')]=[{'all':!![]}];}_0x528b41=_['merge']({},_0x528b41,_0x45cbc2[_0x2a90('0x46')]);return db['WhatsappQueueReport'][_0x2a90('0x47')](_0x528b41)[_0x2a90('0x25')](handleEntityNotFound(_0x3a70fe,null))['then'](respondWithResult(_0x3a70fe,null))[_0x2a90('0x43')](handleError(_0x3a70fe,null));};exports[_0x2a90('0x48')]=function(_0x280e63,_0x1d55db){return db[_0x2a90('0x40')][_0x2a90('0x48')](_0x280e63[_0x2a90('0x49')],{})['then'](respondWithResult(_0x1d55db,0xc9))['catch'](handleError(_0x1d55db,null));};exports[_0x2a90('0x24')]=function(_0x2611d0,_0x42c890){if(_0x2611d0[_0x2a90('0x49')]['id']){delete _0x2611d0[_0x2a90('0x49')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x2611d0[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x42c890,null))['then'](saveUpdates(_0x2611d0['body'],null))['then'](respondWithResult(_0x42c890,null))[_0x2a90('0x43')](handleError(_0x42c890,null));};exports['destroy']=function(_0x370da3,_0x3dfe72){return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x370da3[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x3dfe72,null))['then'](removeEntity(_0x3dfe72,null))[_0x2a90('0x43')](handleError(_0x3dfe72,null));};exports[_0x2a90('0x4a')]=function(_0x48d3bc,_0x265769){return db['WhatsappQueueReport']['describe']()[_0x2a90('0x25')](respondWithResult(_0x265769,null))[_0x2a90('0x43')](handleError(_0x265769,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 917cb8a..1353202 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa6f=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x4247f4,_0xa4fb47){var _0xdda5e=function(_0x1f353a){while(--_0x1f353a){_0x4247f4['push'](_0x4247f4['shift']());}};_0xdda5e(++_0xa4fb47);}(_0xaa6f,0xef));var _0xfaa6=function(_0x5f0209,_0x449121){_0x5f0209=_0x5f0209-0x0;var _0x5418c8=_0xaa6f[_0x5f0209];return _0x5418c8;};'use strict';var _=require(_0xfaa6('0x0'));var util=require(_0xfaa6('0x1'));var logger=require(_0xfaa6('0x2'))(_0xfaa6('0x3'));var moment=require(_0xfaa6('0x4'));var BPromise=require(_0xfaa6('0x5'));var rp=require(_0xfaa6('0x6'));var fs=require('fs');var path=require(_0xfaa6('0x7'));var rimraf=require(_0xfaa6('0x8'));var config=require(_0xfaa6('0x9'));var attributes=require(_0xfaa6('0xa'));module[_0xfaa6('0xb')]=function(_0x563112,_0x4588c2){return _0x563112['define'](_0xfaa6('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xfaa6('0xd'),'fields':[_0xfaa6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0157=['report_whatsapp_queue','uniqueid','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x5d4219,_0x1b754c){var _0x6dc16=function(_0x324718){while(--_0x324718){_0x5d4219['push'](_0x5d4219['shift']());}};_0x6dc16(++_0x1b754c);}(_0x0157,0xd3));var _0x7015=function(_0x28d5c2,_0x4b67ee){_0x28d5c2=_0x28d5c2-0x0;var _0x18a7c6=_0x0157[_0x28d5c2];return _0x18a7c6;};'use strict';var _=require('lodash');var util=require(_0x7015('0x0'));var logger=require(_0x7015('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7015('0x2'));var rp=require(_0x7015('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7015('0x4'));var config=require(_0x7015('0x5'));var attributes=require(_0x7015('0x6'));module[_0x7015('0x7')]=function(_0x421db3,_0x444ded){return _0x421db3['define'](_0x7015('0x8'),attributes,{'tableName':_0x7015('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7015('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index cbadd7b..5fc94d4 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47b1=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','create','body','options','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1f0d02,_0x544507){var _0x7cb25=function(_0x12d57b){while(--_0x12d57b){_0x1f0d02['push'](_0x1f0d02['shift']());}};_0x7cb25(++_0x544507);}(_0x47b1,0x143));var _0x147b=function(_0x22a952,_0x3e4576){_0x22a952=_0x22a952-0x0;var _0x1ff29a=_0x47b1[_0x22a952];return _0x1ff29a;};'use strict';var _=require('lodash');var util=require(_0x147b('0x0'));var moment=require(_0x147b('0x1'));var BPromise=require(_0x147b('0x2'));var rs=require(_0x147b('0x3'));var fs=require('fs');var Redis=require(_0x147b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x147b('0x5'));var logger=require(_0x147b('0x6'))(_0x147b('0x7'));var config=require(_0x147b('0x8'));var jayson=require(_0x147b('0x9'));var client=jayson[_0x147b('0xa')][_0x147b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c4218,_0x455034,_0x3f0a72){return new BPromise(function(_0x56992c,_0x1e0782){return client[_0x147b('0xc')](_0x2c4218,_0x3f0a72)[_0x147b('0xd')](function(_0xb3ef92){logger[_0x147b('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x455034,_0x147b('0xf'));logger[_0x147b('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x455034,_0x147b('0xf'),JSON['stringify'](_0xb3ef92));if(_0xb3ef92[_0x147b('0x11')]){if(_0xb3ef92[_0x147b('0x11')][_0x147b('0x12')]===0x1f4){logger[_0x147b('0x11')](_0x147b('0x13'),_0x455034,_0xb3ef92['error']['message']);return _0x1e0782(_0xb3ef92[_0x147b('0x11')][_0x147b('0x14')]);}logger[_0x147b('0x11')](_0x147b('0x13'),_0x455034,_0xb3ef92[_0x147b('0x11')][_0x147b('0x14')]);return _0x56992c(_0xb3ef92['error']['message']);}else{logger[_0x147b('0xe')](_0x147b('0x13'),_0x455034,'request\x20sent');_0x56992c(_0xb3ef92[_0x147b('0x15')][_0x147b('0x14')]);}})[_0x147b('0x16')](function(_0x51da66){logger[_0x147b('0x11')](_0x147b('0x13'),_0x455034,_0x51da66);_0x1e0782(_0x51da66);});});}exports[_0x147b('0x17')]=function(_0x23d9d9){var _0x50791a=this;return new Promise(function(_0x3041cc,_0x1f72e5){return db['WhatsappQueueReport'][_0x147b('0x18')](_0x23d9d9[_0x147b('0x19')],{'raw':_0x23d9d9[_0x147b('0x1a')]?_0x23d9d9[_0x147b('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x147b('0xd')](function(_0xe38200){logger[_0x147b('0xe')](_0x147b('0x17'),_0x23d9d9);logger['debug'](_0x147b('0x17'),_0x23d9d9,JSON[_0x147b('0x1b')](_0xe38200));_0x3041cc(_0xe38200);})[_0x147b('0x16')](function(_0x42e30c){logger[_0x147b('0x11')](_0x147b('0x17'),_0x42e30c[_0x147b('0x14')],_0x23d9d9);_0x1f72e5(_0x50791a[_0x147b('0x11')](0x1f4,_0x42e30c['message']));});});};exports[_0x147b('0x1c')]=function(_0x479d1b){var _0x2fe7e2=this;return new Promise(function(_0x49bfb7,_0x4c2ad9){return db[_0x147b('0x1d')]['update'](_0x479d1b[_0x147b('0x19')],{'raw':_0x479d1b[_0x147b('0x1a')]?_0x479d1b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x479d1b['options']?_0x479d1b['options'][_0x147b('0x1e')]||null:null,'attributes':_0x479d1b[_0x147b('0x1a')]?_0x479d1b[_0x147b('0x1a')][_0x147b('0x1f')]||null:null,'limit':_0x479d1b['options']?_0x479d1b[_0x147b('0x1a')][_0x147b('0x20')]||null:null})[_0x147b('0xd')](function(_0xcb5b76){logger[_0x147b('0xe')](_0x147b('0x1c'),_0x479d1b);logger[_0x147b('0x10')](_0x147b('0x1c'),_0x479d1b,JSON[_0x147b('0x1b')](_0xcb5b76));_0x49bfb7(_0xcb5b76);})[_0x147b('0x16')](function(_0xded68){logger[_0x147b('0x11')](_0x147b('0x1c'),_0xded68['message'],_0x479d1b);_0x4c2ad9(_0x2fe7e2['error'](0x1f4,_0xded68['message']));});});}; \ No newline at end of file +var _0xa033=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','stringify','UpdateWhatsappQueueReport'];(function(_0x1a1cea,_0x38d164){var _0x3461bb=function(_0x300015){while(--_0x300015){_0x1a1cea['push'](_0x1a1cea['shift']());}};_0x3461bb(++_0x38d164);}(_0xa033,0x1ca));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a03('0x0'));var util=require(_0x3a03('0x1'));var moment=require(_0x3a03('0x2'));var BPromise=require(_0x3a03('0x3'));var rs=require(_0x3a03('0x4'));var fs=require('fs');var Redis=require(_0x3a03('0x5'));var db=require(_0x3a03('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a03('0x7'));var config=require(_0x3a03('0x8'));var jayson=require(_0x3a03('0x9'));var client=jayson[_0x3a03('0xa')][_0x3a03('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c6eb8,_0x322884,_0x43057f){return new BPromise(function(_0x286ce5,_0x8b4052){return client[_0x3a03('0xc')](_0x2c6eb8,_0x43057f)[_0x3a03('0xd')](function(_0x179c91){logger[_0x3a03('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x322884,_0x3a03('0xf'));logger['debug'](_0x3a03('0x10'),_0x322884,_0x3a03('0xf'),JSON['stringify'](_0x179c91));if(_0x179c91[_0x3a03('0x11')]){if(_0x179c91['error'][_0x3a03('0x12')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x322884,_0x179c91[_0x3a03('0x11')][_0x3a03('0x13')]);return _0x8b4052(_0x179c91[_0x3a03('0x11')]['message']);}logger[_0x3a03('0x11')](_0x3a03('0x14'),_0x322884,_0x179c91[_0x3a03('0x11')][_0x3a03('0x13')]);return _0x286ce5(_0x179c91['error'][_0x3a03('0x13')]);}else{logger['info'](_0x3a03('0x14'),_0x322884,_0x3a03('0xf'));_0x286ce5(_0x179c91[_0x3a03('0x15')][_0x3a03('0x13')]);}})[_0x3a03('0x16')](function(_0x3dcb19){logger[_0x3a03('0x11')](_0x3a03('0x14'),_0x322884,_0x3dcb19);_0x8b4052(_0x3dcb19);});});}exports[_0x3a03('0x17')]=function(_0x3e29d){var _0x240d4b=this;return new Promise(function(_0x45e013,_0x37751a){return db[_0x3a03('0x18')][_0x3a03('0x19')](_0x3e29d[_0x3a03('0x1a')],{'raw':_0x3e29d[_0x3a03('0x1b')]?_0x3e29d[_0x3a03('0x1b')][_0x3a03('0x1c')]===undefined?!![]:![]:!![]})[_0x3a03('0xd')](function(_0x1157e9){logger[_0x3a03('0xe')](_0x3a03('0x17'),_0x3e29d);logger[_0x3a03('0x1d')](_0x3a03('0x17'),_0x3e29d,JSON[_0x3a03('0x1e')](_0x1157e9));_0x45e013(_0x1157e9);})[_0x3a03('0x16')](function(_0xb9ebad){logger[_0x3a03('0x11')](_0x3a03('0x17'),_0xb9ebad[_0x3a03('0x13')],_0x3e29d);_0x37751a(_0x240d4b[_0x3a03('0x11')](0x1f4,_0xb9ebad[_0x3a03('0x13')]));});});};exports[_0x3a03('0x1f')]=function(_0x682970){var _0x1acbba=this;return new Promise(function(_0x5eee3c,_0x3358c9){return db['WhatsappQueueReport']['update'](_0x682970['body'],{'raw':_0x682970[_0x3a03('0x1b')]?_0x682970[_0x3a03('0x1b')][_0x3a03('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x682970['options']?_0x682970[_0x3a03('0x1b')][_0x3a03('0x20')]||null:null,'attributes':_0x682970[_0x3a03('0x1b')]?_0x682970['options'][_0x3a03('0x21')]||null:null,'limit':_0x682970[_0x3a03('0x1b')]?_0x682970[_0x3a03('0x1b')][_0x3a03('0x22')]||null:null})['then'](function(_0x3dff3e){logger[_0x3a03('0xe')](_0x3a03('0x1f'),_0x682970);logger['debug'](_0x3a03('0x1f'),_0x682970,JSON[_0x3a03('0x1e')](_0x3dff3e));_0x5eee3c(_0x3dff3e);})[_0x3a03('0x16')](function(_0x4b4686){logger[_0x3a03('0x11')]('UpdateWhatsappQueueReport',_0x4b4686['message'],_0x682970);_0x3358c9(_0x1acbba['error'](0x1f4,_0x4b4686[_0x3a03('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 81128ed..21c3c8a 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x465f=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x465f,0x18b));var _0xf465=function(_0x38335a,_0x1b5bdb){_0x38335a=_0x38335a-0x0;var _0x2a6bd0=_0x465f[_0x38335a];return _0x2a6bd0;};'use strict';var multer=require(_0xf465('0x0'));var util=require(_0xf465('0x1'));var path=require(_0xf465('0x2'));var timeout=require(_0xf465('0x3'));var express=require(_0xf465('0x4'));var router=express['Router']();var fs_extra=require(_0xf465('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf465('0x6'));var config=require(_0xf465('0x7'));var controller=require(_0xf465('0x8'));router[_0xf465('0x9')]('/',auth['isAuthenticated'](),controller[_0xf465('0xa')]);router[_0xf465('0x9')]('/describe',auth[_0xf465('0xb')](),controller[_0xf465('0xc')]);router[_0xf465('0x9')](_0xf465('0xd'),auth[_0xf465('0xb')](),controller[_0xf465('0xe')]);router[_0xf465('0xf')]('/',auth['isAuthenticated'](),controller[_0xf465('0x10')]);router[_0xf465('0x11')](_0xf465('0xd'),auth['isAuthenticated'](),controller[_0xf465('0x12')]);router[_0xf465('0x13')]('/:id',auth[_0xf465('0xb')](),controller[_0xf465('0x14')]);module[_0xf465('0x15')]=router; \ No newline at end of file +var _0x2cfb=['./whatsappTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x396289,_0x4df0e5){var _0x114669=function(_0x2e3f82){while(--_0x2e3f82){_0x396289['push'](_0x396289['shift']());}};_0x114669(++_0x4df0e5);}(_0x2cfb,0x1f0));var _0xb2cf=function(_0x2972cf,_0x343fde){_0x2972cf=_0x2972cf-0x0;var _0x4c173f=_0x2cfb[_0x2972cf];return _0x4c173f;};'use strict';var multer=require(_0xb2cf('0x0'));var util=require(_0xb2cf('0x1'));var path=require(_0xb2cf('0x2'));var timeout=require(_0xb2cf('0x3'));var express=require('express');var router=express[_0xb2cf('0x4')]();var fs_extra=require(_0xb2cf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb2cf('0x6'));var config=require(_0xb2cf('0x7'));var controller=require(_0xb2cf('0x8'));router[_0xb2cf('0x9')]('/',auth['isAuthenticated'](),controller[_0xb2cf('0xa')]);router['get'](_0xb2cf('0xb'),auth['isAuthenticated'](),controller[_0xb2cf('0xc')]);router['get']('/:id',auth[_0xb2cf('0xd')](),controller[_0xb2cf('0xe')]);router[_0xb2cf('0xf')]('/',auth[_0xb2cf('0xd')](),controller[_0xb2cf('0x10')]);router[_0xb2cf('0x11')](_0xb2cf('0x12'),auth[_0xb2cf('0xd')](),controller['update']);router['delete'](_0xb2cf('0x12'),auth[_0xb2cf('0xd')](),controller[_0xb2cf('0x13')]);module[_0xb2cf('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 6d253a4..2c63ca8 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x215d=['STRING','ENUM','account','agent','queue','DATE','sequelize'];(function(_0x5c4dc3,_0x21d80a){var _0xd3b863=function(_0x597d30){while(--_0x597d30){_0x5c4dc3['push'](_0x5c4dc3['shift']());}};_0xd3b863(++_0x21d80a);}(_0x215d,0x187));var _0xd215=function(_0x54b603,_0x18890b){_0x54b603=_0x54b603-0x0;var _0x135a9e=_0x215d[_0x54b603];return _0x135a9e;};'use strict';var Sequelize=require(_0xd215('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd215('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd215('0x2')](_0xd215('0x3'),_0xd215('0x4'),_0xd215('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd215('0x6')]}}; \ No newline at end of file +var _0xb299=['ENUM','account','agent','queue','DATE','sequelize','STRING'];(function(_0x51c09e,_0x58f899){var _0x4ac052=function(_0x2a8fd4){while(--_0x2a8fd4){_0x51c09e['push'](_0x51c09e['shift']());}};_0x4ac052(++_0x58f899);}(_0xb299,0x19b));var _0x9b29=function(_0x3284d9,_0x3cc4c7){_0x3284d9=_0x3284d9-0x0;var _0x45bc75=_0xb299[_0x3284d9];return _0x45bc75;};'use strict';var Sequelize=require(_0x9b29('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9b29('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x9b29('0x2')](_0x9b29('0x3'),_0x9b29('0x4'),_0x9b29('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x9b29('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 6d71d79..c304601 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cdb=['create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','key','map','query','filters','intersection','attributes','model','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','rows','catch','show','keys','fields','include'];(function(_0x154b73,_0x20cf69){var _0x2eca99=function(_0x3a7338){while(--_0x3a7338){_0x154b73['push'](_0x154b73['shift']());}};_0x2eca99(++_0x20cf69);}(_0x3cdb,0xa6));var _0xb3cd=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x3cdb[_0x5c2e5e];return _0x46a5da;};'use strict';var emlformat=require(_0xb3cd('0x0'));var rimraf=require(_0xb3cd('0x1'));var zipdir=require(_0xb3cd('0x2'));var jsonpatch=require(_0xb3cd('0x3'));var rp=require(_0xb3cd('0x4'));var moment=require(_0xb3cd('0x5'));var BPromise=require(_0xb3cd('0x6'));var Mustache=require(_0xb3cd('0x7'));var util=require(_0xb3cd('0x8'));var path=require('path');var sox=require(_0xb3cd('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3cd('0xa'));var _=require(_0xb3cd('0xb'));var squel=require(_0xb3cd('0xc'));var crypto=require(_0xb3cd('0xd'));var jsforce=require(_0xb3cd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb3cd('0xf'));var querystring=require('querystring');var Papa=require(_0xb3cd('0x10'));var Redis=require(_0xb3cd('0x11'));var authService=require(_0xb3cd('0x12'));var qs=require(_0xb3cd('0x13'));var as=require(_0xb3cd('0x14'));var hardwareService=require(_0xb3cd('0x15'));var logger=require(_0xb3cd('0x16'))(_0xb3cd('0x17'));var utils=require(_0xb3cd('0x18'));var config=require(_0xb3cd('0x19'));var licenseUtil=require(_0xb3cd('0x1a'));var db=require(_0xb3cd('0x1b'))['db'];function respondWithStatusCode(_0x13b479,_0x339a46){_0x339a46=_0x339a46||0xcc;return function(_0x480c34){if(_0x480c34){return _0x13b479[_0xb3cd('0x1c')](_0x339a46);}return _0x13b479[_0xb3cd('0x1d')](_0x339a46)[_0xb3cd('0x1e')]();};}function respondWithResult(_0x1ebe2c,_0x443c6a){_0x443c6a=_0x443c6a||0xc8;return function(_0x597137){if(_0x597137){return _0x1ebe2c['status'](_0x443c6a)[_0xb3cd('0x1f')](_0x597137);}};}function respondWithFilteredResult(_0x1dafce,_0x2bb89a){return function(_0x3e43a9){if(_0x3e43a9){var _0x56b7ec=typeof _0x2bb89a[_0xb3cd('0x20')]==='undefined'&&typeof _0x2bb89a[_0xb3cd('0x21')]==='undefined';var _0x523aca=_0x3e43a9['count'];var _0x6d31e1=_0x56b7ec?0x0:_0x2bb89a[_0xb3cd('0x20')];var _0x1b681f=_0x56b7ec?_0x3e43a9['count']:_0x2bb89a[_0xb3cd('0x20')]+_0x2bb89a['limit'];var _0x4a4446;if(_0x1b681f>=_0x523aca){_0x1b681f=_0x523aca;_0x4a4446=0xc8;}else{_0x4a4446=0xce;}_0x1dafce[_0xb3cd('0x1d')](_0x4a4446);return _0x1dafce[_0xb3cd('0x22')](_0xb3cd('0x23'),_0x6d31e1+'-'+_0x1b681f+'/'+_0x523aca)[_0xb3cd('0x1f')](_0x3e43a9);}return null;};}function patchUpdates(_0x3236cd){return function(_0x5cbb83){try{jsonpatch[_0xb3cd('0x24')](_0x5cbb83,_0x3236cd,!![]);}catch(_0x1698db){return BPromise[_0xb3cd('0x25')](_0x1698db);}return _0x5cbb83[_0xb3cd('0x26')]();};}function saveUpdates(_0x19fb16,_0xfbcb3b){return function(_0x1960dd){if(_0x1960dd){return _0x1960dd[_0xb3cd('0x27')](_0x19fb16)[_0xb3cd('0x28')](function(_0x4acac2){return _0x4acac2;});}return null;};}function removeEntity(_0x11475f,_0x15bfa7){return function(_0x620246){if(_0x620246){return _0x620246['destroy']()['then'](function(){_0x11475f[_0xb3cd('0x1d')](0xcc)[_0xb3cd('0x1e')]();});}};}function handleEntityNotFound(_0x2871b1,_0x284f2a){return function(_0x522058){if(!_0x522058){_0x2871b1[_0xb3cd('0x1c')](0x194);}return _0x522058;};}function handleError(_0x55a763,_0x5d31d){_0x5d31d=_0x5d31d||0x1f4;return function(_0x5b156f){logger[_0xb3cd('0x29')](_0x5b156f[_0xb3cd('0x2a')]);if(_0x5b156f[_0xb3cd('0x2b')]){delete _0x5b156f['name'];}_0x55a763['status'](_0x5d31d)[_0xb3cd('0x2c')](_0x5b156f);};}exports[_0xb3cd('0x2d')]=function(_0x588e1f,_0x26c58c){var _0x4f3561={},_0x14371b={},_0x46fe69={'count':0x0,'rows':[]};var _0x5c78d2=_['map'](db[_0xb3cd('0x2e')][_0xb3cd('0x2f')],function(_0x4436ed){return{'name':_0x4436ed['fieldName'],'type':_0x4436ed['type'][_0xb3cd('0x30')]};});_0x14371b['model']=_[_0xb3cd('0x31')](_0x5c78d2,'name');_0x14371b[_0xb3cd('0x32')]=_['keys'](_0x588e1f['query']);_0x14371b[_0xb3cd('0x33')]=_[_0xb3cd('0x34')](_0x14371b['model'],_0x14371b['query']);_0x4f3561[_0xb3cd('0x35')]=_['intersection'](_0x14371b[_0xb3cd('0x36')],qs['fields'](_0x588e1f[_0xb3cd('0x32')]['fields']));_0x4f3561['attributes']=_0x4f3561['attributes'][_0xb3cd('0x37')]?_0x4f3561['attributes']:_0x14371b[_0xb3cd('0x36')];if(!_0x588e1f[_0xb3cd('0x32')][_0xb3cd('0x38')]('nolimit')){_0x4f3561[_0xb3cd('0x21')]=qs[_0xb3cd('0x21')](_0x588e1f[_0xb3cd('0x32')]['limit']);_0x4f3561[_0xb3cd('0x20')]=qs[_0xb3cd('0x20')](_0x588e1f['query'][_0xb3cd('0x20')]);}_0x4f3561[_0xb3cd('0x39')]=qs[_0xb3cd('0x3a')](_0x588e1f[_0xb3cd('0x32')][_0xb3cd('0x3a')]);_0x4f3561[_0xb3cd('0x3b')]=qs[_0xb3cd('0x33')](_[_0xb3cd('0x3c')](_0x588e1f['query'],_0x14371b[_0xb3cd('0x33')]),_0x5c78d2);if(_0x588e1f[_0xb3cd('0x32')]['filter']){_0x4f3561['where']=_[_0xb3cd('0x3d')](_0x4f3561['where'],{'$or':_[_0xb3cd('0x31')](_0x5c78d2,function(_0x246662){if(_0x246662[_0xb3cd('0x3e')]!==_0xb3cd('0x3f')){var _0xdc4269={};_0xdc4269[_0x246662['name']]={'$like':'%'+_0x588e1f[_0xb3cd('0x32')][_0xb3cd('0x40')]+'%'};return _0xdc4269;}})});}_0x4f3561=_[_0xb3cd('0x3d')]({},_0x4f3561,_0x588e1f[_0xb3cd('0x41')]);var _0x183351={'where':_0x4f3561[_0xb3cd('0x3b')]};return db[_0xb3cd('0x2e')][_0xb3cd('0x42')](_0x183351)['then'](function(_0x531e45){_0x46fe69['count']=_0x531e45;if(_0x588e1f[_0xb3cd('0x32')][_0xb3cd('0x43')]){_0x4f3561['include']=[{'all':!![]}];}return db[_0xb3cd('0x2e')]['findAll'](_0x4f3561);})['then'](function(_0x2552d1){_0x46fe69[_0xb3cd('0x44')]=_0x2552d1;return _0x46fe69;})[_0xb3cd('0x28')](respondWithFilteredResult(_0x26c58c,_0x4f3561))[_0xb3cd('0x45')](handleError(_0x26c58c,null));};exports[_0xb3cd('0x46')]=function(_0x8d87c7,_0x4223ff){var _0xc6a58a={'raw':!![],'where':{'id':_0x8d87c7['params']['id']}},_0x54807d={};_0x54807d[_0xb3cd('0x36')]=_[_0xb3cd('0x47')](db[_0xb3cd('0x2e')][_0xb3cd('0x2f')]);_0x54807d[_0xb3cd('0x32')]=_['keys'](_0x8d87c7[_0xb3cd('0x32')]);_0x54807d[_0xb3cd('0x33')]=_[_0xb3cd('0x34')](_0x54807d[_0xb3cd('0x36')],_0x54807d[_0xb3cd('0x32')]);_0xc6a58a[_0xb3cd('0x35')]=_[_0xb3cd('0x34')](_0x54807d[_0xb3cd('0x36')],qs[_0xb3cd('0x48')](_0x8d87c7[_0xb3cd('0x32')]['fields']));_0xc6a58a[_0xb3cd('0x35')]=_0xc6a58a[_0xb3cd('0x35')][_0xb3cd('0x37')]?_0xc6a58a[_0xb3cd('0x35')]:_0x54807d['model'];if(_0x8d87c7[_0xb3cd('0x32')][_0xb3cd('0x43')]){_0xc6a58a[_0xb3cd('0x49')]=[{'all':!![]}];}_0xc6a58a=_[_0xb3cd('0x3d')]({},_0xc6a58a,_0x8d87c7['options']);return db['WhatsappTransferReport']['find'](_0xc6a58a)[_0xb3cd('0x28')](handleEntityNotFound(_0x4223ff,null))['then'](respondWithResult(_0x4223ff,null))[_0xb3cd('0x45')](handleError(_0x4223ff,null));};exports[_0xb3cd('0x4a')]=function(_0x3147e9,_0xcf77ba){return db[_0xb3cd('0x2e')][_0xb3cd('0x4a')](_0x3147e9[_0xb3cd('0x4b')],{})[_0xb3cd('0x28')](respondWithResult(_0xcf77ba,0xc9))[_0xb3cd('0x45')](handleError(_0xcf77ba,null));};exports[_0xb3cd('0x27')]=function(_0x286f9f,_0x5e20e1){if(_0x286f9f[_0xb3cd('0x4b')]['id']){delete _0x286f9f['body']['id'];}return db[_0xb3cd('0x2e')][_0xb3cd('0x4c')]({'where':{'id':_0x286f9f[_0xb3cd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e20e1,null))[_0xb3cd('0x28')](saveUpdates(_0x286f9f[_0xb3cd('0x4b')],null))[_0xb3cd('0x28')](respondWithResult(_0x5e20e1,null))[_0xb3cd('0x45')](handleError(_0x5e20e1,null));};exports[_0xb3cd('0x4e')]=function(_0x10212d,_0x1063e0){return db[_0xb3cd('0x2e')][_0xb3cd('0x4c')]({'where':{'id':_0x10212d[_0xb3cd('0x4d')]['id']}})[_0xb3cd('0x28')](handleEntityNotFound(_0x1063e0,null))[_0xb3cd('0x28')](removeEntity(_0x1063e0,null))[_0xb3cd('0x45')](handleError(_0x1063e0,null));};exports['describe']=function(_0x595195,_0x29022d){return db[_0xb3cd('0x2e')][_0xb3cd('0x4f')]()['then'](respondWithResult(_0x29022d,null))['catch'](handleError(_0x29022d,null));}; \ No newline at end of file +var _0xe2d7=['WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','params','options','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index'];(function(_0x1b4737,_0x3caa41){var _0x1acabb=function(_0x3512c7){while(--_0x3512c7){_0x1b4737['push'](_0x1b4737['shift']());}};_0x1acabb(++_0x3caa41);}(_0xe2d7,0x112));var _0x7e2d=function(_0x1ed443,_0xae65a6){_0x1ed443=_0x1ed443-0x0;var _0x5c9a6f=_0xe2d7[_0x1ed443];return _0x5c9a6f;};'use strict';var emlformat=require(_0x7e2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e2d('0x1'));var jsonpatch=require(_0x7e2d('0x2'));var rp=require(_0x7e2d('0x3'));var moment=require(_0x7e2d('0x4'));var BPromise=require(_0x7e2d('0x5'));var Mustache=require(_0x7e2d('0x6'));var util=require(_0x7e2d('0x7'));var path=require('path');var sox=require(_0x7e2d('0x8'));var csv=require(_0x7e2d('0x9'));var ejs=require(_0x7e2d('0xa'));var fs=require('fs');var fs_extra=require(_0x7e2d('0xb'));var _=require(_0x7e2d('0xc'));var squel=require(_0x7e2d('0xd'));var crypto=require('crypto');var jsforce=require(_0x7e2d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7e2d('0x9'));var querystring=require(_0x7e2d('0xf'));var Papa=require(_0x7e2d('0x10'));var Redis=require(_0x7e2d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7e2d('0x12'));var as=require(_0x7e2d('0x13'));var hardwareService=require(_0x7e2d('0x14'));var logger=require(_0x7e2d('0x15'))(_0x7e2d('0x16'));var utils=require(_0x7e2d('0x17'));var config=require(_0x7e2d('0x18'));var licenseUtil=require(_0x7e2d('0x19'));var db=require(_0x7e2d('0x1a'))['db'];function respondWithStatusCode(_0x42093f,_0x132f8a){_0x132f8a=_0x132f8a||0xcc;return function(_0x2d4817){if(_0x2d4817){return _0x42093f[_0x7e2d('0x1b')](_0x132f8a);}return _0x42093f[_0x7e2d('0x1c')](_0x132f8a)[_0x7e2d('0x1d')]();};}function respondWithResult(_0x524e49,_0x54ca77){_0x54ca77=_0x54ca77||0xc8;return function(_0x1c55d7){if(_0x1c55d7){return _0x524e49[_0x7e2d('0x1c')](_0x54ca77)[_0x7e2d('0x1e')](_0x1c55d7);}};}function respondWithFilteredResult(_0x3ae04b,_0x3ecd4f){return function(_0x13c1b3){if(_0x13c1b3){var _0x28cc4c=typeof _0x3ecd4f[_0x7e2d('0x1f')]===_0x7e2d('0x20')&&typeof _0x3ecd4f[_0x7e2d('0x21')]==='undefined';var _0x23c7a9=_0x13c1b3[_0x7e2d('0x22')];var _0x5ef401=_0x28cc4c?0x0:_0x3ecd4f[_0x7e2d('0x1f')];var _0x5f41b3=_0x28cc4c?_0x13c1b3['count']:_0x3ecd4f[_0x7e2d('0x1f')]+_0x3ecd4f['limit'];var _0x176c2c;if(_0x5f41b3>=_0x23c7a9){_0x5f41b3=_0x23c7a9;_0x176c2c=0xc8;}else{_0x176c2c=0xce;}_0x3ae04b['status'](_0x176c2c);return _0x3ae04b[_0x7e2d('0x23')](_0x7e2d('0x24'),_0x5ef401+'-'+_0x5f41b3+'/'+_0x23c7a9)[_0x7e2d('0x1e')](_0x13c1b3);}return null;};}function patchUpdates(_0xb54606){return function(_0x459dd0){try{jsonpatch[_0x7e2d('0x25')](_0x459dd0,_0xb54606,!![]);}catch(_0x4ca51f){return BPromise[_0x7e2d('0x26')](_0x4ca51f);}return _0x459dd0['save']();};}function saveUpdates(_0xe9d454,_0x472643){return function(_0x365198){if(_0x365198){return _0x365198[_0x7e2d('0x27')](_0xe9d454)[_0x7e2d('0x28')](function(_0x37b249){return _0x37b249;});}return null;};}function removeEntity(_0x2cfb4d,_0x3253c1){return function(_0x4a9f8a){if(_0x4a9f8a){return _0x4a9f8a[_0x7e2d('0x29')]()[_0x7e2d('0x28')](function(){_0x2cfb4d['status'](0xcc)[_0x7e2d('0x1d')]();});}};}function handleEntityNotFound(_0x44aa5c,_0x18d420){return function(_0x5a18f3){if(!_0x5a18f3){_0x44aa5c[_0x7e2d('0x1b')](0x194);}return _0x5a18f3;};}function handleError(_0x4dc9e8,_0x584964){_0x584964=_0x584964||0x1f4;return function(_0x574680){logger[_0x7e2d('0x2a')](_0x574680[_0x7e2d('0x2b')]);if(_0x574680['name']){delete _0x574680['name'];}_0x4dc9e8[_0x7e2d('0x1c')](_0x584964)[_0x7e2d('0x2c')](_0x574680);};}exports[_0x7e2d('0x2d')]=function(_0x5ceb8d,_0x40b623){var _0x33495a={},_0x3d6bcc={},_0x23b89f={'count':0x0,'rows':[]};var _0x1526a4=_['map'](db[_0x7e2d('0x2e')][_0x7e2d('0x2f')],function(_0x1388eb){return{'name':_0x1388eb[_0x7e2d('0x30')],'type':_0x1388eb[_0x7e2d('0x31')][_0x7e2d('0x32')]};});_0x3d6bcc[_0x7e2d('0x33')]=_[_0x7e2d('0x34')](_0x1526a4,_0x7e2d('0x35'));_0x3d6bcc[_0x7e2d('0x36')]=_[_0x7e2d('0x37')](_0x5ceb8d['query']);_0x3d6bcc[_0x7e2d('0x38')]=_[_0x7e2d('0x39')](_0x3d6bcc[_0x7e2d('0x33')],_0x3d6bcc[_0x7e2d('0x36')]);_0x33495a[_0x7e2d('0x3a')]=_[_0x7e2d('0x39')](_0x3d6bcc[_0x7e2d('0x33')],qs[_0x7e2d('0x3b')](_0x5ceb8d['query'][_0x7e2d('0x3b')]));_0x33495a[_0x7e2d('0x3a')]=_0x33495a[_0x7e2d('0x3a')][_0x7e2d('0x3c')]?_0x33495a[_0x7e2d('0x3a')]:_0x3d6bcc[_0x7e2d('0x33')];if(!_0x5ceb8d[_0x7e2d('0x36')][_0x7e2d('0x3d')](_0x7e2d('0x3e'))){_0x33495a[_0x7e2d('0x21')]=qs['limit'](_0x5ceb8d[_0x7e2d('0x36')][_0x7e2d('0x21')]);_0x33495a[_0x7e2d('0x1f')]=qs[_0x7e2d('0x1f')](_0x5ceb8d[_0x7e2d('0x36')][_0x7e2d('0x1f')]);}_0x33495a[_0x7e2d('0x3f')]=qs[_0x7e2d('0x40')](_0x5ceb8d[_0x7e2d('0x36')][_0x7e2d('0x40')]);_0x33495a[_0x7e2d('0x41')]=qs['filters'](_['pick'](_0x5ceb8d[_0x7e2d('0x36')],_0x3d6bcc['filters']),_0x1526a4);if(_0x5ceb8d[_0x7e2d('0x36')][_0x7e2d('0x42')]){_0x33495a['where']=_['merge'](_0x33495a['where'],{'$or':_[_0x7e2d('0x34')](_0x1526a4,function(_0x2c7e9b){if(_0x2c7e9b[_0x7e2d('0x31')]!==_0x7e2d('0x43')){var _0x39ad15={};_0x39ad15[_0x2c7e9b[_0x7e2d('0x35')]]={'$like':'%'+_0x5ceb8d[_0x7e2d('0x36')][_0x7e2d('0x42')]+'%'};return _0x39ad15;}})});}_0x33495a=_[_0x7e2d('0x44')]({},_0x33495a,_0x5ceb8d['options']);var _0x484502={'where':_0x33495a['where']};return db[_0x7e2d('0x2e')][_0x7e2d('0x22')](_0x484502)[_0x7e2d('0x28')](function(_0x2fed08){_0x23b89f[_0x7e2d('0x22')]=_0x2fed08;if(_0x5ceb8d['query'][_0x7e2d('0x45')]){_0x33495a[_0x7e2d('0x46')]=[{'all':!![]}];}return db[_0x7e2d('0x2e')][_0x7e2d('0x47')](_0x33495a);})[_0x7e2d('0x28')](function(_0xcd7585){_0x23b89f[_0x7e2d('0x48')]=_0xcd7585;return _0x23b89f;})['then'](respondWithFilteredResult(_0x40b623,_0x33495a))['catch'](handleError(_0x40b623,null));};exports['show']=function(_0x110a10,_0x3c4403){var _0x312c74={'raw':!![],'where':{'id':_0x110a10[_0x7e2d('0x49')]['id']}},_0x48f864={};_0x48f864[_0x7e2d('0x33')]=_[_0x7e2d('0x37')](db[_0x7e2d('0x2e')][_0x7e2d('0x2f')]);_0x48f864['query']=_[_0x7e2d('0x37')](_0x110a10[_0x7e2d('0x36')]);_0x48f864[_0x7e2d('0x38')]=_[_0x7e2d('0x39')](_0x48f864['model'],_0x48f864['query']);_0x312c74['attributes']=_[_0x7e2d('0x39')](_0x48f864[_0x7e2d('0x33')],qs[_0x7e2d('0x3b')](_0x110a10[_0x7e2d('0x36')][_0x7e2d('0x3b')]));_0x312c74[_0x7e2d('0x3a')]=_0x312c74[_0x7e2d('0x3a')]['length']?_0x312c74[_0x7e2d('0x3a')]:_0x48f864[_0x7e2d('0x33')];if(_0x110a10[_0x7e2d('0x36')][_0x7e2d('0x45')]){_0x312c74['include']=[{'all':!![]}];}_0x312c74=_['merge']({},_0x312c74,_0x110a10[_0x7e2d('0x4a')]);return db[_0x7e2d('0x2e')]['find'](_0x312c74)[_0x7e2d('0x28')](handleEntityNotFound(_0x3c4403,null))[_0x7e2d('0x28')](respondWithResult(_0x3c4403,null))[_0x7e2d('0x4b')](handleError(_0x3c4403,null));};exports[_0x7e2d('0x4c')]=function(_0x27e5da,_0xe7dedc){return db[_0x7e2d('0x2e')]['create'](_0x27e5da[_0x7e2d('0x4d')],{})['then'](respondWithResult(_0xe7dedc,0xc9))[_0x7e2d('0x4b')](handleError(_0xe7dedc,null));};exports[_0x7e2d('0x27')]=function(_0x475b7e,_0x3ff826){if(_0x475b7e[_0x7e2d('0x4d')]['id']){delete _0x475b7e['body']['id'];}return db[_0x7e2d('0x2e')][_0x7e2d('0x4e')]({'where':{'id':_0x475b7e[_0x7e2d('0x49')]['id']}})[_0x7e2d('0x28')](handleEntityNotFound(_0x3ff826,null))[_0x7e2d('0x28')](saveUpdates(_0x475b7e[_0x7e2d('0x4d')],null))[_0x7e2d('0x28')](respondWithResult(_0x3ff826,null))[_0x7e2d('0x4b')](handleError(_0x3ff826,null));};exports[_0x7e2d('0x29')]=function(_0x26c3df,_0x21beb6){return db[_0x7e2d('0x2e')][_0x7e2d('0x4e')]({'where':{'id':_0x26c3df[_0x7e2d('0x49')]['id']}})[_0x7e2d('0x28')](handleEntityNotFound(_0x21beb6,null))[_0x7e2d('0x28')](removeEntity(_0x21beb6,null))['catch'](handleError(_0x21beb6,null));};exports[_0x7e2d('0x4f')]=function(_0x21caf7,_0x113028){return db[_0x7e2d('0x2e')][_0x7e2d('0x4f')]()[_0x7e2d('0x28')](respondWithResult(_0x113028,null))[_0x7e2d('0x4b')](handleError(_0x113028,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 0bad81f..546711b 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b53=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x34852e,_0x1b216f){var _0x4e4f6f=function(_0x6d68ef){while(--_0x6d68ef){_0x34852e['push'](_0x34852e['shift']());}};_0x4e4f6f(++_0x1b216f);}(_0x2b53,0x13d));var _0x32b5=function(_0x40ba7b,_0x4aa904){_0x40ba7b=_0x40ba7b-0x0;var _0x56fcef=_0x2b53[_0x40ba7b];return _0x56fcef;};'use strict';var _=require(_0x32b5('0x0'));var util=require(_0x32b5('0x1'));var logger=require(_0x32b5('0x2'))(_0x32b5('0x3'));var moment=require(_0x32b5('0x4'));var BPromise=require('bluebird');var rp=require(_0x32b5('0x5'));var fs=require('fs');var path=require(_0x32b5('0x6'));var rimraf=require(_0x32b5('0x7'));var config=require(_0x32b5('0x8'));var attributes=require(_0x32b5('0x9'));module['exports']=function(_0x381ba2,_0x1176db){return _0x381ba2[_0x32b5('0xa')](_0x32b5('0xb'),attributes,{'tableName':_0x32b5('0xc'),'paranoid':![],'indexes':[{'name':_0x32b5('0xd'),'fields':[_0x32b5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb73b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb73b,0x8a));var _0xbb73=function(_0x4ff975,_0x3b078f){_0x4ff975=_0x4ff975-0x0;var _0x1767b1=_0xb73b[_0x4ff975];return _0x1767b1;};'use strict';var _=require(_0xbb73('0x0'));var util=require(_0xbb73('0x1'));var logger=require(_0xbb73('0x2'))(_0xbb73('0x3'));var moment=require(_0xbb73('0x4'));var BPromise=require(_0xbb73('0x5'));var rp=require(_0xbb73('0x6'));var fs=require('fs');var path=require(_0xbb73('0x7'));var rimraf=require('rimraf');var config=require(_0xbb73('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0xbb73('0x9')]=function(_0xcc4a2,_0x223260){return _0xcc4a2[_0xbb73('0xa')](_0xbb73('0xb'),attributes,{'tableName':_0xbb73('0xc'),'paranoid':![],'indexes':[{'name':_0xbb73('0xd'),'fields':[_0xbb73('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index a157f3a..4a0ac8c 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dcd=['http','request','then','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','info','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4dcd,0x137));var _0xd4dc=function(_0x18a518,_0x2c0de6){_0x18a518=_0x18a518-0x0;var _0x219c1c=_0x4dcd[_0x18a518];return _0x219c1c;};'use strict';var _=require('lodash');var util=require(_0xd4dc('0x0'));var moment=require(_0xd4dc('0x1'));var BPromise=require(_0xd4dc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4dc('0x3'));var db=require(_0xd4dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4dc('0x5'))(_0xd4dc('0x6'));var config=require('../../config/environment');var jayson=require(_0xd4dc('0x7'));var client=jayson[_0xd4dc('0x8')][_0xd4dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cb950,_0x58fd2d,_0x51885d){return new BPromise(function(_0x28135f,_0x3bc0cd){return client[_0xd4dc('0xa')](_0x1cb950,_0x51885d)[_0xd4dc('0xb')](function(_0x4e0b09){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x58fd2d,_0xd4dc('0xc'));logger[_0xd4dc('0xd')](_0xd4dc('0xe'),_0x58fd2d,_0xd4dc('0xc'),JSON[_0xd4dc('0xf')](_0x4e0b09));if(_0x4e0b09[_0xd4dc('0x10')]){if(_0x4e0b09[_0xd4dc('0x10')]['code']===0x1f4){logger[_0xd4dc('0x10')](_0xd4dc('0x11'),_0x58fd2d,_0x4e0b09[_0xd4dc('0x10')][_0xd4dc('0x12')]);return _0x3bc0cd(_0x4e0b09[_0xd4dc('0x10')][_0xd4dc('0x12')]);}logger[_0xd4dc('0x10')](_0xd4dc('0x11'),_0x58fd2d,_0x4e0b09[_0xd4dc('0x10')][_0xd4dc('0x12')]);return _0x28135f(_0x4e0b09[_0xd4dc('0x10')][_0xd4dc('0x12')]);}else{logger[_0xd4dc('0x13')](_0xd4dc('0x11'),_0x58fd2d,_0xd4dc('0xc'));_0x28135f(_0x4e0b09['result'][_0xd4dc('0x12')]);}})['catch'](function(_0x1a99c6){logger['error'](_0xd4dc('0x11'),_0x58fd2d,_0x1a99c6);_0x3bc0cd(_0x1a99c6);});});} \ No newline at end of file +var _0x5322=['jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x56ac6a,_0x35ed04){var _0x169575=function(_0x1c5694){while(--_0x1c5694){_0x56ac6a['push'](_0x56ac6a['shift']());}};_0x169575(++_0x35ed04);}(_0x5322,0xff));var _0x2532=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x5322[_0x50bf5a];return _0x4ddc1d;};'use strict';var _=require(_0x2532('0x0'));var util=require(_0x2532('0x1'));var moment=require(_0x2532('0x2'));var BPromise=require('bluebird');var rs=require(_0x2532('0x3'));var fs=require('fs');var Redis=require(_0x2532('0x4'));var db=require(_0x2532('0x5'))['db'];var utils=require(_0x2532('0x6'));var logger=require('../../config/logger')(_0x2532('0x7'));var config=require(_0x2532('0x8'));var jayson=require(_0x2532('0x9'));var client=jayson[_0x2532('0xa')][_0x2532('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x374131,_0x57bce6,_0x2589f8){return new BPromise(function(_0x18eae3,_0x1290e6){return client[_0x2532('0xc')](_0x374131,_0x2589f8)[_0x2532('0xd')](function(_0x11488a){logger['info'](_0x2532('0xe'),_0x57bce6,_0x2532('0xf'));logger[_0x2532('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x57bce6,_0x2532('0xf'),JSON[_0x2532('0x11')](_0x11488a));if(_0x11488a[_0x2532('0x12')]){if(_0x11488a[_0x2532('0x12')][_0x2532('0x13')]===0x1f4){logger[_0x2532('0x12')](_0x2532('0xe'),_0x57bce6,_0x11488a[_0x2532('0x12')][_0x2532('0x14')]);return _0x1290e6(_0x11488a[_0x2532('0x12')][_0x2532('0x14')]);}logger[_0x2532('0x12')](_0x2532('0xe'),_0x57bce6,_0x11488a[_0x2532('0x12')][_0x2532('0x14')]);return _0x18eae3(_0x11488a['error'][_0x2532('0x14')]);}else{logger[_0x2532('0x15')](_0x2532('0xe'),_0x57bce6,'request\x20sent');_0x18eae3(_0x11488a[_0x2532('0x16')][_0x2532('0x14')]);}})[_0x2532('0x17')](function(_0xe0f10c){logger['error'](_0x2532('0xe'),_0x57bce6,_0xe0f10c);_0x1290e6(_0xe0f10c);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index dddd860..2af4fdf 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bde=['default','listen','info','start','filter','exitCode','number','length','pm2_env','name','Online\x20apps:','map','join','Offline\x20apps:','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB'];(function(_0x17ea59,_0x10df9){var _0x3a7495=function(_0x46f88c){while(--_0x46f88c){_0x17ea59['push'](_0x17ea59['shift']());}};_0x3a7495(++_0x10df9);}(_0x0bde,0x110));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe0bd('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xe0bd('0x1'));var checkLicense=require(_0xe0bd('0x2'));var rpc=require('./rpc');var config=require(_0xe0bd('0x3'));var logger=require(_0xe0bd('0x4'))(_0xe0bd('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0xe0bd('0x6'));var schedule=require(_0xe0bd('0x7'));var chat=require(_0xe0bd('0x8'));var whatsapp=require(_0xe0bd('0x9'));var transcribe=require(_0xe0bd('0xa'));var provider=require(_0xe0bd('0xb'));function main(){return db[_0xe0bd('0xc')][_0xe0bd('0xd')]()[_0xe0bd('0xe')](function(){if(config[_0xe0bd('0xf')]){return seedDb[_0xe0bd('0x10')]();}})[_0xe0bd('0xe')](function(){return checkLicense[_0xe0bd('0x10')]();})['then'](function(){return rpc[_0xe0bd('0x11')]();})[_0xe0bd('0xe')](function(_0x5a7117){logger[_0xe0bd('0x12')](_0x5a7117);return chat['start']();})[_0xe0bd('0xe')](function(){return whatsapp[_0xe0bd('0x13')]();})[_0xe0bd('0xe')](function(){return schedule[_0xe0bd('0x13')]();})[_0xe0bd('0xe')](function(){return transcribe[_0xe0bd('0x13')]();})[_0xe0bd('0xe')](function(){return provider['start']();})[_0xe0bd('0xe')](function(_0x40c17c){logger[_0xe0bd('0x12')](_0x40c17c);return pm2['start'](pm2Config);})[_0xe0bd('0xe')](function(_0x48afde){var _0x1858b8=_0x48afde[_0xe0bd('0x14')](function(_0x3f5ef7){return typeof _0x3f5ef7[_0xe0bd('0x15')]===_0xe0bd('0x16')&&_0x3f5ef7[_0xe0bd('0x15')]>=0x0;});if(_0x1858b8[_0xe0bd('0x17')]>0x0){throw new Error(_0x1858b8[_0xe0bd('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x1858b8,function(_0x2d2ba3){return'\x22'+_0x2d2ba3[_0xe0bd('0x18')][_0xe0bd('0x19')]+'\x22';}));}logger[_0xe0bd('0x12')](_0xe0bd('0x1a'),_[_0xe0bd('0x1b')](_['filter'](_0x48afde,{'status':'online'}),_0xe0bd('0x19'))[_0xe0bd('0x1c')]());logger[_0xe0bd('0x12')](_0xe0bd('0x1d'),_[_0xe0bd('0x1b')](_[_0xe0bd('0x14')](_0x48afde,function(_0x3dbd98){return _0x3dbd98['status']!=='online';}),_0xe0bd('0x19'))[_0xe0bd('0x1c')]()||_0xe0bd('0x1e'));console[_0xe0bd('0x1f')](_0xe0bd('0x20'));})['catch'](function(_0x30442f){console['log'](_0xe0bd('0x21'),_0x30442f);logger[_0xe0bd('0x22')](_0xe0bd('0x23'),_0x30442f);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x71ad=['App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./config/environment','./config/logger','./config/pm2','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info','start','filter','exitCode','number','length','map','pm2_env','online','name','join','None'];(function(_0x2d31b2,_0x1cf49d){var _0x5328be=function(_0x4dbe9c){while(--_0x4dbe9c){_0x2d31b2['push'](_0x2d31b2['shift']());}};_0x5328be(++_0x1cf49d);}(_0x71ad,0xee));var _0xd71a=function(_0x449729,_0x4a58f6){_0x449729=_0x449729-0x0;var _0x4bc766=_0x71ad[_0x449729];return _0x4bc766;};'use strict';var _=require(_0xd71a('0x0'));var db=require(_0xd71a('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xd71a('0x2'));var rpc=require('./rpc');var config=require(_0xd71a('0x3'));var logger=require(_0xd71a('0x4'))('app');var pm2=require(_0xd71a('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0xd71a('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xd71a('0x7'));var provider=require(_0xd71a('0x8'));function main(){return db[_0xd71a('0x9')][_0xd71a('0xa')]()[_0xd71a('0xb')](function(){if(config[_0xd71a('0xc')]){return seedDb[_0xd71a('0xd')]();}})['then'](function(){return checkLicense[_0xd71a('0xd')]();})['then'](function(){return rpc['listen']();})[_0xd71a('0xb')](function(_0x38af93){logger[_0xd71a('0xe')](_0x38af93);return chat[_0xd71a('0xf')]();})[_0xd71a('0xb')](function(){return whatsapp[_0xd71a('0xf')]();})[_0xd71a('0xb')](function(){return schedule[_0xd71a('0xf')]();})[_0xd71a('0xb')](function(){return transcribe[_0xd71a('0xf')]();})['then'](function(){return provider[_0xd71a('0xf')]();})[_0xd71a('0xb')](function(_0x3bdeea){logger[_0xd71a('0xe')](_0x3bdeea);return pm2[_0xd71a('0xf')](pm2Config);})[_0xd71a('0xb')](function(_0x10c0de){var _0x188886=_0x10c0de[_0xd71a('0x10')](function(_0xfdcc6d){return typeof _0xfdcc6d[_0xd71a('0x11')]===_0xd71a('0x12')&&_0xfdcc6d[_0xd71a('0x11')]>=0x0;});if(_0x188886[_0xd71a('0x13')]>0x0){throw new Error(_0x188886[_0xd71a('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xd71a('0x14')](_0x188886,function(_0x21334d){return'\x22'+_0x21334d[_0xd71a('0x15')]['name']+'\x22';}));}logger['info']('Online\x20apps:',_[_0xd71a('0x14')](_[_0xd71a('0x10')](_0x10c0de,{'status':_0xd71a('0x16')}),_0xd71a('0x17'))[_0xd71a('0x18')]());logger[_0xd71a('0xe')]('Offline\x20apps:',_[_0xd71a('0x14')](_[_0xd71a('0x10')](_0x10c0de,function(_0x4f1eb7){return _0x4f1eb7['status']!==_0xd71a('0x16');}),_0xd71a('0x17'))[_0xd71a('0x18')]()||_0xd71a('0x19'));console['log'](_0xd71a('0x1a'));})[_0xd71a('0x1b')](function(_0x192b76){console[_0xd71a('0x1c')](_0xd71a('0x1d'),_0x192b76);logger[_0xd71a('0x1e')](_0xd71a('0x1f'),_0x192b76);process[_0xd71a('0x20')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 67d0541..66fe8c5 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 _0x00bb=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','use','user','findOne','params','disposition','then','closed','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','User','find','pass','status','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','session','role','fullname','name','internal','permissions','md5secret','voicePause','chatPause','mailPause','smsPause'];(function(_0x15ba84,_0x37bd6a){var _0x2ffb19=function(_0x2f0392){while(--_0x2f0392){_0x15ba84['push'](_0x15ba84['shift']());}};_0x2ffb19(++_0x37bd6a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var db=require(_0xb00b('0x0'))['db'];var config=require(_0xb00b('0x1'));var hardwareConf=require(_0xb00b('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb00b('0x3'));var _=require('lodash');var jwt=require(_0xb00b('0x4'));var expressJwt=require(_0xb00b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xb00b('0x6'));var crypto=require(_0xb00b('0x7'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb00b('0x8')][_0xb00b('0x9')]});var userAttributes=['id',_0xb00b('0xa'),_0xb00b('0xb'),_0xb00b('0xc'),_0xb00b('0xd'),'email','userpic',_0xb00b('0xe'),_0xb00b('0xf'),_0xb00b('0x10'),_0xb00b('0x11'),_0xb00b('0x12'),'faxPause',_0xb00b('0x13'),'openchannelPause','pauseType','showWebBar',_0xb00b('0x14'),_0xb00b('0x15'),_0xb00b('0x16'),_0xb00b('0x17'),_0xb00b('0x18'),_0xb00b('0x19'),'phoneBarAutoAnswer',_0xb00b('0x1a'),_0xb00b('0x1b'),'phoneBarEnableRecording',_0xb00b('0x1c'),_0xb00b('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0xb00b('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xb00b('0x1f'),_0xb00b('0x20'),_0xb00b('0x21'),_0xb00b('0x22'),'wssPort',_0xb00b('0x23'),'downloadOmnichannelInteractions',_0xb00b('0x24'),'ignorePauseForPreviewCalls',_0xb00b('0x25'),'chatAutoanswer',_0xb00b('0x26'),_0xb00b('0x27'),'emailAutoanswerDelay','smsAutoanswer',_0xb00b('0x28'),'openchannelAutoanswer',_0xb00b('0x29'),_0xb00b('0x2a'),_0xb00b('0x2b'),_0xb00b('0x2c'),'whatsappAutoanswerDelay'];exports[_0xb00b('0x2d')]=function(){return this['isAuthenticated'](!![])[_0xb00b('0x2e')](function(_0x121ec7,_0x51b841,_0x231293){if(_0x121ec7[_0xb00b('0x2f')]){_0x231293();}else{return db['ChatInteraction'][_0xb00b('0x30')]({'where':{'id':_0x121ec7[_0xb00b('0x31')]['id']},'attributes':['id','closed',_0xb00b('0x32')],'raw':!![]})[_0xb00b('0x33')](function(_0x3c9500){if(_0x3c9500&&_0x3c9500[_0xb00b('0x34')]){return _0x51b841['status'](_0x3c9500['disposition']===_0xb00b('0x35')?0x195:0x193)['json']({'message':_0x3c9500['disposition']==='unmanaged'?_0xb00b('0x36'):_0xb00b('0x37')});}else{_0x231293();}})[_0xb00b('0x38')](function(_0x3825af){_0x231293(_0x3825af);});}});};exports[_0xb00b('0x39')]=function isAuthenticated(_0x197379){return compose()[_0xb00b('0x2e')](function(_0x4a8d2b,_0x22c22d,_0x503c9c){var _0x450129;if(_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')]){if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x3c'))){var _0x183233=basicAuth(_0x4a8d2b);db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'name':_0x183233[_0xb00b('0xc')]}})[_0xb00b('0x33')](function(_0x149c1a){if(!_0x149c1a||!_0x149c1a['authenticate'](_0x183233[_0xb00b('0x3f')])){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x41')});}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x149c1a['id']};_0x503c9c();})['catch'](function(_0x456241){_0x503c9c(_0x456241);});}else if(_['startsWith'](_0x4a8d2b[_0xb00b('0x3a')][_0xb00b('0x3b')],_0xb00b('0x42'))){validateJwt(_0x4a8d2b,_0x22c22d,_0x503c9c);}else{if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x44')});}}}else if(_0x4a8d2b[_0xb00b('0x45')]['apikey']){try{var _0x57e8f9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};verifyJwt(_0x4a8d2b[_0xb00b('0x45')][_0xb00b('0x47')],_0x57e8f9)[_0xb00b('0x33')](function(_0x5cfa60){return db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0x5cfa60[_0xb00b('0x48')]}})[_0xb00b('0x33')](function(_0x261c80){_0x450129=_0x261c80;return db[_0xb00b('0x49')][_0xb00b('0x30')]({'where':{'id':0x1},'attributes':[_0xb00b('0x4a'),'blockDuration'],'raw':!![]});})['then'](function(_0x2ea41d){if(!_0x450129||!_['isEqual'](_0x450129[_0xb00b('0x4b')],_0x5cfa60[_0xb00b('0x4c')])){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4d')});}if(_0x450129[_0xb00b('0x4e')]){return _0x22c22d[_0xb00b('0x40')](0x191)['json']({'message':_0xb00b('0x4f')});}if(_0x450129[_0xb00b('0x50')]){if(_0x2ea41d[_0xb00b('0x51')]>0x0){if(moment(_0x450129[_0xb00b('0x52')])[_0xb00b('0x53')](_0x2ea41d[_0xb00b('0x51')],'minutes')>moment()){return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x22c22d[_0xb00b('0x40')](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});}}_0x4a8d2b[_0xb00b('0x2f')]={'id':_0x450129['id']};_0x503c9c();});})[_0xb00b('0x38')](function(){return _0x22c22d['status'](0x191)[_0xb00b('0x43')]({'message':_0xb00b('0x4f')});});}catch(_0xb76ede){_0x503c9c(_0xb76ede);}}else if(_0x197379){_0x503c9c();}else{return _0x22c22d[_0xb00b('0x40')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xb00b('0x2e')](function(_0xf6ae0c,_0x10a348,_0x152437){if(_0xf6ae0c[_0xb00b('0x2f')]){db[_0xb00b('0x3d')][_0xb00b('0x3e')]({'where':{'id':_0xf6ae0c['user']['id']},'attributes':userAttributes})[_0xb00b('0x33')](function(_0x3b72c4){if(!_0x3b72c4){return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x54')});}_0xf6ae0c[_0xb00b('0x2f')]=_0x3b72c4;_0x152437();})[_0xb00b('0x38')](function(_0x974a29){_0x152437(_0x974a29);});}else if(_0x197379){_0x152437();}else{return _0x10a348[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x55')});}});};exports[_0xb00b('0x56')]=function canUpdate(){return compose()['use'](function(_0x3da23c,_0x35a0ba,_0xd07fb8){return licenseUtil[_0xb00b('0x57')]()[_0xb00b('0x33')](function(_0x2d9174){if(_0x2d9174[_0xb00b('0x58')]){_0xd07fb8();}else{return _0x35a0ba[_0xb00b('0x40')](0x193)[_0xb00b('0x43')]({'message':_0xb00b('0x59')});}})[_0xb00b('0x38')](function(_0x3b3031){_0xd07fb8(_0x3b3031);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x47c6c0,_0x3f8f60,_0x23d858){return licenseUtil['getLicense']()[_0xb00b('0x33')](function(_0x3c0fa){if(_0x3c0fa[_0xb00b('0x5a')]){_0x23d858();}else{return _0x3f8f60[_0xb00b('0x40')](0x193)['json']({'message':'Forbidden'});}})[_0xb00b('0x38')](function(_0x40c2fd){_0x23d858(_0x40c2fd);});});};exports['isMiddleware']=function(_0x514c5b,_0x154759,_0x3a205d){_0x514c5b['isMiddleware']=!![];return _0x3a205d();};exports[_0xb00b('0x5b')]=function signToken(_0x47a814){return signJwt(_0x47a814);};exports['setTokenCookie']=function(_0x4bcc9e,_0x465d90){if(!_0x4bcc9e['user']){return _0x465d90[_0xb00b('0x40')](0x194)[_0xb00b('0x43')]({'message':_0xb00b('0x5c')});}var _0xe724a5={'payload':{'id':_0x4bcc9e[_0xb00b('0x2f')]['id'],'role':_0x4bcc9e[_0xb00b('0x2f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0xe724a5)['then'](function(_0x1d2a0d){_0x465d90[_0xb00b('0x5d')]('motion.token',_0x1d2a0d);_0x465d90[_0xb00b('0x5e')](_0xb00b('0x5f'));})['catch'](function(_0x15dcbf){return _0x465d90[_0xb00b('0x40')](0x1f4)[_0xb00b('0x60')](_0x15dcbf);});};exports['retrieveApiKey']=function(_0x501cbe){if(_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x4b')])||_[_0xb00b('0x61')](_0x501cbe[_0xb00b('0x62')])){return null;}else{return createJwt(_0x501cbe);}};exports['generateApiKey']=function(_0x380acb){_0x380acb[_0xb00b('0x4b')]=generateNonce();_0x380acb['apiKeyIat']=generateIssuedAt();return createJwt(_0x380acb);};exports['regenerateApiKey']=function(_0x160965,_0x524b05){var _0x1ab196=_0x160965[_0xb00b('0x45')][_0xb00b('0x47')];if(_0x1ab196){var _0x222459={'nonce':_0x524b05[_0xb00b('0x4b')],'iat':_0x524b05[_0xb00b('0x62')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xb00b('0x46')]()};return verifyJwt(_0x1ab196,_0x222459)['then'](function(){return generateApiKey(_0x524b05);});}else{throw{'message':_0xb00b('0x63')};}};exports[_0xb00b('0x64')]=function(_0x4129ba){var _0x5ac79e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5ac79e[_0xb00b('0x65')](_0x4129ba))throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xb00b('0x68')]=function(_0x309ae6,_0x219b74,_0x385029){var _0x131848=encryptor[_0xb00b('0x69')](_0x219b74)[_0xb00b('0x6a')](',');for(var _0x3a0b90=0x0;_0x3a0b90<_0x385029;_0x3a0b90++){if(!_0x131848[_0x3a0b90])break;if(_0x309ae6['toLowerCase']()===_0x131848[_0x3a0b90][_0xb00b('0x6b')]()){var _0x2cbe80=util[_0xb00b('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x385029);if(_0x385029===0x1){_0x2cbe80=_0xb00b('0x6d');}throw new db[(_0xb00b('0x66'))][(_0xb00b('0x67'))](_0x2cbe80);}}return;};exports[_0xb00b('0x6e')]=function(_0x1ad387,_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b?encryptor[_0xb00b('0x69')](_0x4bfe0b)[_0xb00b('0x6a')](','):[];if(_0xfd4ecc[_0xb00b('0x6f')]===0x5){_0xfd4ecc['splice'](-0x1,0x1);}_0xfd4ecc[_0xb00b('0x70')](_0x1ad387);return encryptor[_0xb00b('0x71')](_0xfd4ecc[_0xb00b('0x72')](','));};function signJwt(_0x2d73bb){var _0x161216=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x74')],{'context':jwt});var _0x542223=_0x2d73bb[_0xb00b('0x75')]||config['secrets'][_0xb00b('0x9')];return new BPromise(function(_0x4c2186,_0x3b3272){_0x161216(_0x2d73bb['payload'],_0x542223,_0x2d73bb[_0xb00b('0x76')])['then'](function(_0x3dffaf){_0x4c2186(_0x3dffaf);})[_0xb00b('0x38')](function(_0x3bae02){_0x3b3272(_0x3bae02);});});}function verifyJwt(_0x4d1cec,_0x51fbe2,_0x4f7a59){var _0x21a53d=BPromise[_0xb00b('0x73')](jwt[_0xb00b('0x77')],{'context':jwt});var _0x49246b=_0x4f7a59||config[_0xb00b('0x8')][_0xb00b('0x9')];return new BPromise(function(_0xca87d4,_0x2ddba4){_0x21a53d(_0x4d1cec,_0x49246b,_0x51fbe2)[_0xb00b('0x33')](function(_0x485033){_0xca87d4(_0x485033);})[_0xb00b('0x38')](function(_0x27b13b){_0x2ddba4(_0x27b13b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb00b('0x78')](_0xb00b('0x79'));}function generateIssuedAt(){return Math[_0xb00b('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x359669){var _0x188da7={'payload':{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x359669['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb00b('0x46')]()}};return signJwt(_0x188da7)['then'](function(_0x2434a0){return{'iat':_0x359669[_0xb00b('0x62')],'nonce':_0x359669['apiKeyNonce'],'token':_0x2434a0};});} \ No newline at end of file +var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x2415a1,_0x2b3109){var _0x2577ce=function(_0x178749){while(--_0x178749){_0x2415a1['push'](_0x2415a1['shift']());}};_0x2577ce(++_0x2b3109);}(_0x55ca,0x126));var _0xa55c=function(_0x274208,_0x3182ff){_0x274208=_0x274208-0x0;var _0x209164=_0x55ca[_0x274208];return _0x209164;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index dc04a74..ad32edc 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['findOne','slice','fieldType','keys','type','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','clause','rows','catch','describe','startsWith','cf_','map','CmCustomField'];(function(_0x4489cd,_0x83d7ee){var _0x3d202c=function(_0x134751){while(--_0x134751){_0x4489cd['push'](_0x4489cd['shift']());}};_0x3d202c(++_0x83d7ee);}(_0x757a,0xde));var _0xa757=function(_0x473a79,_0x1e4135){_0x473a79=_0x473a79-0x0;var _0x4672ab=_0x757a[_0x473a79];return _0x4672ab;};'use strict';var _=require('lodash');var sqlUtils=require(_0xa757('0x0'));var db=require(_0xa757('0x1'))['db'];exports['findAll']=function(_0x5c03c3,_0x5709ed,_0x32be3b,_0x1721c6){var _0x1c2932={'count':0x0,'rows':[]};var _0x453d07=sqlUtils[_0xa757('0x2')](_0x5709ed,_0x5c03c3);if(_0x453d07){return Promise[_0xa757('0x3')](_0x1c2932);}var _0x5edca8=sqlUtils[_0xa757('0x4')]();var _0x4343b6={};var _0x53be0e=![];var _0x2930fa=![];return Promise[_0xa757('0x3')]()[_0xa757('0x5')](function(){if(_0x5c03c3[_0xa757('0x6')]){return sqlUtils[_0xa757('0x7')](_0x5c03c3['search'],_0x1721c6);}else{return sqlUtils[_0xa757('0x8')](_0x5c03c3,_0x1721c6);}})[_0xa757('0x5')](function(_0x32f0ec){_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xa')]);_0x5edca8[_0xa757('0x9')](_0x32f0ec[_0xa757('0xb')]);_0x5edca8['where'](_0x32f0ec['filter']);_0x5edca8['where'](_0x32f0ec['user']['clause']);_0x4343b6=_0x32f0ec[_0xa757('0xc')];_0x2930fa=_0x32f0ec['user']['skip'];return sqlUtils[_0xa757('0xd')](_0x5709ed,_0x5c03c3,_0x2930fa);})['then'](function(_0x481508){_0x5edca8[_0xa757('0x9')](_0x481508);var _0x1b670e=_0x5c03c3[_0xa757('0x6')]?_0x4343b6[_0xa757('0xe')]:_0x5c03c3[_0xa757('0xf')];_0x53be0e=_0x1b670e?!![]:![];return sqlUtils[_0xa757('0x10')](_0x5edca8,_0x1b670e);})[_0xa757('0x5')](function(_0x2f7947){_0x1c2932[_0xa757('0x11')]=_0x2f7947;if(_0x1c2932[_0xa757('0x11')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x5edca8,_0x5c03c3[_0xa757('0xb')],_0x32be3b,_0x53be0e,_0x4343b6[_0xa757('0x12')],_0x2930fa);})[_0xa757('0x5')](function(_0x4d9f58){if(!_0x4d9f58){return[];}return sqlUtils['getFilteredContacts'](_0x4d9f58,_0x5c03c3,_0x32be3b);})[_0xa757('0x5')](function(_0x468d45){_0x1c2932[_0xa757('0x13')]=_0x468d45;return _0x1c2932;})[_0xa757('0x14')](function(_0x27f4ba){throw _0x27f4ba;});};exports[_0xa757('0x15')]=function(){var _0x4bd137={};var _0x58954=[];return db['CmContact'][_0xa757('0x15')]()[_0xa757('0x5')](function(_0x14014c){_0x4bd137=_0x14014c;var _0x2c9ec6=Object['keys'](_0x4bd137)['filter'](function(_0x40ec48){return _[_0xa757('0x16')](_0x40ec48,_0xa757('0x17'))?_0x40ec48:undefined;});var _0x8d121f=_0x2c9ec6[_0xa757('0x18')](function(_0x40562f){return db[_0xa757('0x19')][_0xa757('0x1a')]({'where':{'id':_0x40562f[_0xa757('0x1b')](0x3)},'raw':!![]});});return Promise['all'](_0x8d121f);})[_0xa757('0x5')](function(_0x59e9d4){for(var _0x422e9e=0x0;_0x422e9e<_0x59e9d4['length'];_0x422e9e++){if(_0x59e9d4[_0x422e9e]){var _0x40551d=_0xa757('0x17')+_0x59e9d4[_0x422e9e]['id'];_0x4bd137[_0x40551d][_0xa757('0x1c')]=_0x59e9d4[_0x422e9e]['type'];}}_0x58954=_[_0xa757('0x18')](Object[_0xa757('0x1d')](_0x4bd137),function(_0x471e84){return{'name':_0x471e84,'type':_0x4bd137[_0x471e84][_0xa757('0x1e')]};});return _0x58954;})['catch'](function(_0x449a7d){throw _0x449a7d;});}; \ No newline at end of file +var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0xf23b1d,_0x2bcf6c){var _0x38c6d7=function(_0x798320){while(--_0x798320){_0xf23b1d['push'](_0xf23b1d['shift']());}};_0x38c6d7(++_0x2bcf6c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x32358b,_0x5c7c35){_0x32358b=_0x32358b-0x0;var _0x58c21d=_0x0b0e[_0x32358b];return _0x58c21d;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 140a970..008bb4b 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdc3=['squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','autocomplete','true','from','cm_contacts','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','email','ListId','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','castTo','buildExpression','type','default','text','start','value','end','Tag','split','map','tags','clause','and','User','user','uc.UserId\x20=\x20?','skip','compact','Contact','c.ListId\x20IN\x20?','\x20=\x20?','resolve','then','fields','tag','getLists','attributes','select','group','c.id','limit','offset','subqry.id','having','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','where','lodash'];(function(_0x4e7285,_0x156b1b){var _0x15911f=function(_0x101ad2){while(--_0x101ad2){_0x4e7285['push'](_0x4e7285['shift']());}};_0x15911f(++_0x156b1b);}(_0xbdc3,0xcd));var _0x3bdc=function(_0x558220,_0x4db6a7){_0x558220=_0x558220-0x0;var _0x5a13f3=_0xbdc3[_0x558220];return _0x5a13f3;};'use strict';var _=require(_0x3bdc('0x0'));var squel=require(_0x3bdc('0x1'));var as=require(_0x3bdc('0x2'));var qs=require(_0x3bdc('0x3'));var utils=require(_0x3bdc('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x56696f,_0x38a92a){var _0x5d7a46=![];if(_0x56696f[_0x3bdc('0x5')]===_0x3bdc('0x6')&&!_0x38a92a[_0x3bdc('0x7')]&&!_0x38a92a['ListId']&&_0x38a92a[_0x3bdc('0x8')]!==_0x3bdc('0x9')){_0x5d7a46=!![];}return _0x5d7a46;}function getContactsSubquery(){return squel['select']()[_0x3bdc('0xa')](_0x3bdc('0xb'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x14747a,_0x5c6e58){var _0x354a83=_0x5c6e58?'c':_0x3bdc('0xc');_0x14747a['left_join'](_0x3bdc('0xd'),'uc',_0x3bdc('0xe')+_0x354a83+_0x3bdc('0xf'))['left_join'](_0x3bdc('0x10'),'ct','ct.CmContactId\x20=\x20'+_0x354a83+'.id')['left_join'](_0x3bdc('0x11'),'t',_0x3bdc('0x12'));return _0x14747a;}function addFieldsToQuery(_0x39c6a4,_0x59ee88,_0x2d5de8,_0x144764,_0x452889){var _0x25a262=_0x452889?'c':_0x3bdc('0xc');if(!_0x59ee88){_0x59ee88=['id',_0x3bdc('0x13'),_0x3bdc('0x14'),'phone',_0x3bdc('0x15'),'fax',_0x3bdc('0x16'),_0x3bdc('0x17'),_0x3bdc('0x18'),_0x3bdc('0x19'),_0x3bdc('0x1a'),_0x3bdc('0x1b'),_0x3bdc('0x1c')];}else if(!_0x59ee88[_0x3bdc('0x1d')]('id')){_0x59ee88[_0x3bdc('0x1e')]('id');}var _0x295dc5=_0x2d5de8&&_0x452889||!_0x2d5de8&&!_0x452889;if(_0x144764){_0x295dc5=_0x144764&&_0x452889||!_0x144764&&!_0x452889;}_0x59ee88[_0x3bdc('0x1f')](function(_0x4b2a06){if(_0x4b2a06===_0x3bdc('0x1c')){if(_0x295dc5){_0x39c6a4[_0x3bdc('0x20')](_0x3bdc('0x21'),_0x4b2a06);}else if(_0x2d5de8||_0x144764){_0x39c6a4[_0x3bdc('0x20')](_0x25a262+'.'+_0x4b2a06);}}else{_0x39c6a4[_0x3bdc('0x20')](_0x25a262+'.'+_0x4b2a06);}});return _0x39c6a4;}function getSqlClauses(){var _0x573b1e={'default':squel[_0x3bdc('0x22')](),'fields':squel[_0x3bdc('0x22')](),'filter':squel[_0x3bdc('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x3bdc('0x22')](),'skip':![]}};return _0x573b1e;}function parseTagParameter(_0x4a9a50){var _0x555abd=squel[_0x3bdc('0x22')]();if(_0x4a9a50){var _0x515d3e=utils[_0x3bdc('0x23')](_0x4a9a50);_0x515d3e[_0x3bdc('0x1f')](function(_0x5c9c29){_0x555abd['or'](_0x3bdc('0x24'),'%,'+_0x5c9c29+',%');});}return _0x555abd;}function parseSearchFilter(_0x485c5c){var _0x518987=squel['expr']();if(_0x485c5c){var _0x56f1e6=_0x485c5c[_0x3bdc('0x25')]('\x5c','\x5c\x5c')[_0x3bdc('0x25')](/'/g,'\x27\x27');if(_0x56f1e6['split']('\x20')[_0x3bdc('0x26')]>0x1){_0x518987['or'](_0x3bdc('0x27'),qs['getFullTextValue'](_0x56f1e6),null);}else{if(qs['isNumeric'](_0x56f1e6)){_0x518987['or'](_0x3bdc('0x28'),_0x56f1e6+'%');_0x518987['or'](_0x3bdc('0x29'),_0x56f1e6+'%');_0x518987['or']('c.mobile\x20LIKE\x20?',_0x56f1e6+'%');_0x518987['or']('c.fax\x20LIKE\x20?',_0x56f1e6+'%');}else if(qs['isEmail'](_0x56f1e6)){_0x518987['or'](_0x3bdc('0x2a'),_0x56f1e6+'%');}else{_0x518987['or']('c.firstName\x20LIKE\x20?','%'+_0x56f1e6+'%');_0x518987['or'](_0x3bdc('0x2b'),'%'+_0x56f1e6+'%');_0x518987['or'](_0x3bdc('0x2a'),'%'+_0x56f1e6+'%');}}}return _0x518987;}function parseAdvancedSearchFilter(_0x540287,_0x42dfaf){var _0x162555=getSqlClauses();var _0x242cb0=as[_0x3bdc('0x2c')](_0x540287);var _0x8962ac=_0x242cb0[_0x3bdc('0x2d')];for(var _0x585fa5=0x0;_0x585fa5<_0x242cb0[_0x3bdc('0x2e')][_0x3bdc('0x26')];_0x585fa5++){var _0x10b341=_0x242cb0[_0x3bdc('0x2e')][_0x585fa5];var _0x33361f='c';var _0x47c0ae=_[_0x3bdc('0x2f')](_0x42dfaf,[_0x3bdc('0x30'),_0x10b341['field']]);if(_0x47c0ae){if(_0x10b341[_0x3bdc('0x20')]===_0x3bdc('0x31')||_0x47c0ae[_0x3bdc('0x32')]==='datetime'){_0x10b341[_0x3bdc('0x33')]='DATE';}var _0x161cd5=as[_0x3bdc('0x34')](_0x33361f,_0x47c0ae[_0x3bdc('0x35')],_0x10b341);_0x162555[_0x3bdc('0x36')][_0x8962ac](_0x161cd5[_0x3bdc('0x37')],_0x161cd5['value'][_0x3bdc('0x38')],_0x161cd5[_0x3bdc('0x39')][_0x3bdc('0x3a')]);}else{if(_0x10b341[_0x3bdc('0x20')]===_0x3bdc('0x3b')){var _0x5cbdfb=_0x10b341['value'][_0x3bdc('0x3c')](',')[_0x3bdc('0x3d')](function(_0x3cbc10){return Number(_0x3cbc10);});var _0x394398=parseTagParameter(_0x5cbdfb);_0x162555[_0x3bdc('0x3e')][_0x3bdc('0x3f')][_0x3bdc('0x40')](_0x394398);_0x162555[_0x3bdc('0x3e')]['ids']=_0x5cbdfb;}else if(_0x10b341[_0x3bdc('0x20')]===_0x3bdc('0x41')){_0x162555[_0x3bdc('0x42')][_0x3bdc('0x3f')][_0x3bdc('0x40')](_0x3bdc('0x43'),_0x10b341[_0x3bdc('0x39')]);_0x162555[_0x3bdc('0x42')][_0x3bdc('0x44')]=!![];}}}return _0x162555;}function parseModelFields(_0x62137f,_0x14c8ca){var _0x10bafe=squel[_0x3bdc('0x22')]();var _0x3f802c=_(_0x62137f)['keys']()['map'](function(_0x228896){return _['some'](_0x14c8ca,[_0x3bdc('0x30'),_0x228896])?_0x228896:undefined;})[_0x3bdc('0x45')]()[_0x3bdc('0x39')]();if(_0x62137f['Contact']){_0x3f802c[_0x3bdc('0x1e')](_0x3bdc('0x46'));}if(_0x3f802c[_0x3bdc('0x26')]>0x0){_0x3f802c[_0x3bdc('0x1f')](function(_0x9de984){if(_0x9de984===_0x3bdc('0x17')){_0x10bafe[_0x3bdc('0x40')](_0x3bdc('0x47'),[]['concat'](_0x62137f[_0x9de984]));}else if(_0x9de984===_0x3bdc('0x46')){var _0x4b6648='%'+_0x62137f[_0x9de984]+'%';_0x10bafe[_0x3bdc('0x40')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x4b6648);}else{_0x10bafe[_0x3bdc('0x40')]('c.'+_0x9de984+_0x3bdc('0x48'),_0x62137f[_0x9de984]);}});}return _0x10bafe;}function parseQueryParameters(_0xdcc9e8,_0x514798){var _0xc36036=getSqlClauses();return Promise[_0x3bdc('0x49')]()[_0x3bdc('0x4a')](function(){return parseModelFields(_0xdcc9e8,_0x514798);})[_0x3bdc('0x4a')](function(_0x220742){_0xc36036[_0x3bdc('0x4b')]['and'](_0x220742);return parseTagParameter(_0xdcc9e8[_0x3bdc('0x4c')]);})[_0x3bdc('0x4a')](function(_0x46e7b8){_0xc36036[_0x3bdc('0x3e')][_0x3bdc('0x3f')][_0x3bdc('0x40')](_0x46e7b8);return parseSearchFilter(_0xdcc9e8['filter']);})[_0x3bdc('0x4a')](function(_0x1ef09f){_0xc36036['filter']=_0x1ef09f;return _0xc36036;});}function checkListsRestrictions(_0x5e3f80,_0x89a363,_0x5a3197){var _0x25a350=squel['expr']();return Promise[_0x3bdc('0x49')]()['then'](function(){if(_0x89a363[_0x3bdc('0x7')]&&_0x5e3f80[_0x3bdc('0x5')]==='agent'&&!_0x5a3197){return _0x5e3f80[_0x3bdc('0x4d')]({'attributes':['id'],'raw':!![]});}})[_0x3bdc('0x4a')](function(_0x583143){if(_0x583143){if(_0x583143[_0x3bdc('0x26')]===0x0){_0x25a350[_0x3bdc('0x40')]('c.ListId\x20IS\x20NULL');}else{_0x25a350[_0x3bdc('0x40')]('c.ListId\x20IN\x20?',_[_0x3bdc('0x3d')](_0x583143,'id'));}}})['then'](function(){return _0x25a350;});}function buildContactsQuery(_0x46d11d,_0x303f78,_0xba2053,_0x3b0019,_0xfdeb70,_0x38fc11){if(_0x303f78){_0x303f78=_0xba2053[_0x3bdc('0x4e')];}_0x46d11d=addFieldsToQuery(_0x46d11d,_0x303f78,_0x3b0019,_0x38fc11,!![]);var _0x2c3bfd=squel[_0x3bdc('0x4f')]();_0x2c3bfd=addFieldsToQuery(_0x2c3bfd,_0x303f78,_0x3b0019,_0x38fc11,![]);if(_0x3b0019||_0x38fc11){_0x46d11d=applyJoinClauses(_0x46d11d,!![]);_0x46d11d[_0x3bdc('0x50')](_0x3bdc('0x51'));if(_0xba2053['limit']){_0x2c3bfd[_0x3bdc('0x52')](_0xba2053[_0x3bdc('0x52')]);}if(_0xba2053[_0x3bdc('0x53')]){_0x2c3bfd['offset'](_0xba2053[_0x3bdc('0x53')]);}}else{_0x2c3bfd=applyJoinClauses(_0x2c3bfd,![]);_0x2c3bfd[_0x3bdc('0x50')](_0x3bdc('0x54'));if(_0xba2053[_0x3bdc('0x52')]){_0x46d11d[_0x3bdc('0x52')](_0xba2053[_0x3bdc('0x52')]);}if(_0xba2053[_0x3bdc('0x53')]){_0x46d11d[_0x3bdc('0x53')](_0xba2053[_0x3bdc('0x53')]);}}_0x2c3bfd[_0x3bdc('0x55')](_0xfdeb70);if(_0xba2053['order']){_0xba2053[_0x3bdc('0x56')][_0x3bdc('0x1f')](function(_0x64b6db){_0x46d11d[_0x3bdc('0x56')]('c.'+_0x64b6db[0x0],_0x64b6db[0x1]===_0x3bdc('0x57')?![]:!![]);_0x2c3bfd[_0x3bdc('0x56')]('subqry.'+_0x64b6db[0x0],_0x64b6db[0x1]===_0x3bdc('0x57')?![]:!![]);});}_0x2c3bfd[_0x3bdc('0xa')](_0x46d11d,_0x3bdc('0xc'));return _0x2c3bfd;}function getFilteredContacts(_0x19917c){var _0x224a11=[];return db[_0x3bdc('0x3b')][_0x3bdc('0x58')]({'attributes':['id',_0x3bdc('0x30'),_0x3bdc('0x59')],'raw':!![]})[_0x3bdc('0x4a')](function(_0x42d907){_0x224a11=_[_0x3bdc('0x5a')](_0x42d907,'id');var _0xc46ffb={'type':db[_0x3bdc('0x5b')][_0x3bdc('0x5c')][_0x3bdc('0x5d')],'model':db[_0x3bdc('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3bdc('0x5f')][_0x3bdc('0x60')](_0x19917c[_0x3bdc('0x61')](),_0xc46ffb);})['then'](function(_0x1c1d4e){_0x1c1d4e[_0x3bdc('0x1f')](function(_0x13f154){if(_0x13f154[_0x3bdc('0x1c')]){_0x13f154[_0x3bdc('0x62')]=[];_0x13f154[_0x3bdc('0x1c')][_0x3bdc('0x3c')](',')[_0x3bdc('0x1f')](function(_0x38cddb){_0x13f154[_0x3bdc('0x62')][_0x3bdc('0x1e')](_0x224a11[_0x38cddb]);});}delete _0x13f154[_0x3bdc('0x1c')];});return _0x1c1d4e;});}function countFilteredContacts(_0x504751,_0x4bff6c){var _0x1eedf4=_0x504751[_0x3bdc('0x63')]();_0x1eedf4[_0x3bdc('0x20')](_0x3bdc('0x64'));_0x1eedf4=applyJoinClauses(_0x1eedf4,!![]);_0x504751['group'](_0x3bdc('0x51'));var _0x4ce56c=utils[_0x3bdc('0x23')](_0x4bff6c);if(!_[_0x3bdc('0x65')](_0x4ce56c)){_0x1eedf4[_0x3bdc('0x66')]('t.id\x20IN\x20?',_0x4ce56c);}var _0x202078={'type':db[_0x3bdc('0x5b')][_0x3bdc('0x5c')][_0x3bdc('0x5d')],'raw':!![]};return db[_0x3bdc('0x5f')][_0x3bdc('0x60')](_0x1eedf4[_0x3bdc('0x61')](),_0x202078)['then'](function(_0xe79543){return _0xe79543[0x0][_0x3bdc('0x64')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xde18=['search','getLists','c.id','limit','offset','group','order','DESC','subqry.','color','keyBy','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','Sequelize','query','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','lastName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','default','value','start','end','Tag','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','some','name','length','c.ListId\x20IN\x20?','concat','Contact','resolve','fields','tag','then','filter'];(function(_0x3741cb,_0x243aed){var _0x235ba2=function(_0x474be8){while(--_0x474be8){_0x3741cb['push'](_0x3741cb['shift']());}};_0x235ba2(++_0x243aed);}(_0xde18,0x1c9));var _0x8de1=function(_0x4cedd2,_0x243494){_0x4cedd2=_0x4cedd2-0x0;var _0x328ace=_0xde18[_0x4cedd2];return _0x328ace;};'use strict';var _=require(_0x8de1('0x0'));var squel=require(_0x8de1('0x1'));var as=require(_0x8de1('0x2'));var qs=require(_0x8de1('0x3'));var utils=require(_0x8de1('0x4'));var db=require(_0x8de1('0x5'))['db'];function skipContactsQuery(_0x5707ef,_0x4cc9a8){var _0x44b4bb=![];if(_0x5707ef[_0x8de1('0x6')]===_0x8de1('0x7')&&!_0x4cc9a8['search']&&!_0x4cc9a8[_0x8de1('0x8')]&&_0x4cc9a8[_0x8de1('0x9')]!==_0x8de1('0xa')){_0x44b4bb=!![];}return _0x44b4bb;}function getContactsSubquery(){return squel[_0x8de1('0xb')]()[_0x8de1('0xc')](_0x8de1('0xd'),'c')[_0x8de1('0xe')](_0x8de1('0xf'));}function applyJoinClauses(_0x493f05,_0x36fba9){var _0x1a9e58=_0x36fba9?'c':_0x8de1('0x10');_0x493f05[_0x8de1('0x11')](_0x8de1('0x12'),'uc',_0x8de1('0x13')+_0x1a9e58+_0x8de1('0x14'))[_0x8de1('0x11')](_0x8de1('0x15'),'ct',_0x8de1('0x16')+_0x1a9e58+_0x8de1('0x14'))[_0x8de1('0x11')]('tools_tags','t',_0x8de1('0x17'));return _0x493f05;}function addFieldsToQuery(_0x1f42df,_0x48c6d5,_0x578834,_0x4a4166,_0xc2a6d5){var _0x4d2ca8=_0xc2a6d5?'c':_0x8de1('0x10');if(!_0x48c6d5){_0x48c6d5=['id','firstName',_0x8de1('0x18'),'phone',_0x8de1('0x19'),_0x8de1('0x1a'),_0x8de1('0x1b'),'ListId',_0x8de1('0x1c'),_0x8de1('0x1d'),_0x8de1('0x1e'),_0x8de1('0x1f'),_0x8de1('0x20')];}else if(!_0x48c6d5['includes']('id')){_0x48c6d5[_0x8de1('0x21')]('id');}var _0x514268=_0x578834&&_0xc2a6d5||!_0x578834&&!_0xc2a6d5;if(_0x4a4166){_0x514268=_0x4a4166&&_0xc2a6d5||!_0x4a4166&&!_0xc2a6d5;}_0x48c6d5[_0x8de1('0x22')](function(_0x4fe945){if(_0x4fe945===_0x8de1('0x20')){if(_0x514268){_0x1f42df['field'](_0x8de1('0x23'),_0x4fe945);}else if(_0x578834||_0x4a4166){_0x1f42df[_0x8de1('0x24')](_0x4d2ca8+'.'+_0x4fe945);}}else{_0x1f42df['field'](_0x4d2ca8+'.'+_0x4fe945);}});return _0x1f42df;}function getSqlClauses(){var _0x47c18d={'default':squel[_0x8de1('0x25')](),'fields':squel[_0x8de1('0x25')](),'filter':squel[_0x8de1('0x25')](),'tags':{'clause':squel[_0x8de1('0x25')](),'ids':null},'user':{'clause':squel[_0x8de1('0x25')](),'skip':![]}};return _0x47c18d;}function parseTagParameter(_0x26039d){var _0x3bca96=squel['expr']();if(_0x26039d){var _0x3ebc64=utils['getSelectedTags'](_0x26039d);_0x3ebc64[_0x8de1('0x22')](function(_0x5dfb7f){_0x3bca96['or'](_0x8de1('0x26'),'%,'+_0x5dfb7f+',%');});}return _0x3bca96;}function parseSearchFilter(_0x3f2361){var _0x4a50e9=squel[_0x8de1('0x25')]();if(_0x3f2361){var _0x39deab=_0x3f2361[_0x8de1('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x39deab[_0x8de1('0x28')]('\x20')['length']>0x1){_0x4a50e9['or'](_0x8de1('0x29'),qs['getFullTextValue'](_0x39deab),null);}else{if(qs[_0x8de1('0x2a')](_0x39deab)){_0x4a50e9['or'](_0x8de1('0x2b'),_0x39deab+'%');_0x4a50e9['or']('c.phone\x20LIKE\x20?',_0x39deab+'%');_0x4a50e9['or'](_0x8de1('0x2c'),_0x39deab+'%');_0x4a50e9['or'](_0x8de1('0x2d'),_0x39deab+'%');}else if(qs[_0x8de1('0x2e')](_0x39deab)){_0x4a50e9['or'](_0x8de1('0x2f'),_0x39deab+'%');}else{_0x4a50e9['or'](_0x8de1('0x30'),'%'+_0x39deab+'%');_0x4a50e9['or']('c.lastName\x20LIKE\x20?','%'+_0x39deab+'%');_0x4a50e9['or'](_0x8de1('0x2f'),'%'+_0x39deab+'%');}}}return _0x4a50e9;}function parseAdvancedSearchFilter(_0x51e7ac,_0x22d295){var _0x34595e=getSqlClauses();var _0x4a3da6=as[_0x8de1('0x31')](_0x51e7ac);var _0x5142ee=_0x4a3da6[_0x8de1('0x32')];for(var _0x4d40e9=0x0;_0x4d40e9<_0x4a3da6[_0x8de1('0x33')]['length'];_0x4d40e9++){var _0x15a612=_0x4a3da6['conditions'][_0x4d40e9];var _0x144f8a='c';var _0x3cc74a=_['find'](_0x22d295,['name',_0x15a612[_0x8de1('0x24')]]);if(_0x3cc74a){if(_0x15a612[_0x8de1('0x24')]===_0x8de1('0x34')||_0x3cc74a[_0x8de1('0x35')]===_0x8de1('0x36')){_0x15a612[_0x8de1('0x37')]=_0x8de1('0x38');}var _0x159b1d=as[_0x8de1('0x39')](_0x144f8a,_0x3cc74a['type'],_0x15a612);_0x34595e[_0x8de1('0x3a')][_0x5142ee](_0x159b1d['text'],_0x159b1d[_0x8de1('0x3b')][_0x8de1('0x3c')],_0x159b1d[_0x8de1('0x3b')][_0x8de1('0x3d')]);}else{if(_0x15a612['field']===_0x8de1('0x3e')){var _0x18fdb3=_0x15a612[_0x8de1('0x3b')][_0x8de1('0x28')](',')[_0x8de1('0x3f')](function(_0x2aad39){return Number(_0x2aad39);});var _0x4524c4=parseTagParameter(_0x18fdb3);_0x34595e[_0x8de1('0x40')][_0x8de1('0x41')][_0x8de1('0x42')](_0x4524c4);_0x34595e[_0x8de1('0x40')][_0x8de1('0x43')]=_0x18fdb3;}else if(_0x15a612[_0x8de1('0x24')]===_0x8de1('0x44')){_0x34595e[_0x8de1('0x45')]['clause'][_0x8de1('0x42')](_0x8de1('0x46'),_0x15a612['value']);_0x34595e['user'][_0x8de1('0x47')]=!![];}}}return _0x34595e;}function parseModelFields(_0x51dd46,_0x5d0983){var _0x223672=squel[_0x8de1('0x25')]();var _0x331ce4=_(_0x51dd46)['keys']()[_0x8de1('0x3f')](function(_0x21db6e){return _[_0x8de1('0x48')](_0x5d0983,[_0x8de1('0x49'),_0x21db6e])?_0x21db6e:undefined;})['compact']()[_0x8de1('0x3b')]();if(_0x51dd46['Contact']){_0x331ce4[_0x8de1('0x21')]('Contact');}if(_0x331ce4[_0x8de1('0x4a')]>0x0){_0x331ce4[_0x8de1('0x22')](function(_0x4f447b){if(_0x4f447b==='ListId'){_0x223672[_0x8de1('0x42')](_0x8de1('0x4b'),[][_0x8de1('0x4c')](_0x51dd46[_0x4f447b]));}else if(_0x4f447b===_0x8de1('0x4d')){var _0x1366ea='%'+_0x51dd46[_0x4f447b]+'%';_0x223672['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x1366ea);}else{_0x223672[_0x8de1('0x42')]('c.'+_0x4f447b+'\x20=\x20?',_0x51dd46[_0x4f447b]);}});}return _0x223672;}function parseQueryParameters(_0x122bc7,_0x56e104){var _0x57efb9=getSqlClauses();return Promise[_0x8de1('0x4e')]()['then'](function(){return parseModelFields(_0x122bc7,_0x56e104);})['then'](function(_0x3732de){_0x57efb9[_0x8de1('0x4f')][_0x8de1('0x42')](_0x3732de);return parseTagParameter(_0x122bc7[_0x8de1('0x50')]);})[_0x8de1('0x51')](function(_0x35af68){_0x57efb9['tags'][_0x8de1('0x41')]['and'](_0x35af68);return parseSearchFilter(_0x122bc7[_0x8de1('0x52')]);})[_0x8de1('0x51')](function(_0x941991){_0x57efb9['filter']=_0x941991;return _0x57efb9;});}function checkListsRestrictions(_0x433106,_0x4a6df7,_0xea5db3){var _0x464283=squel[_0x8de1('0x25')]();return Promise[_0x8de1('0x4e')]()['then'](function(){if(_0x4a6df7[_0x8de1('0x53')]&&_0x433106[_0x8de1('0x6')]===_0x8de1('0x7')&&!_0xea5db3){return _0x433106[_0x8de1('0x54')]({'attributes':['id'],'raw':!![]});}})[_0x8de1('0x51')](function(_0x39cbdc){if(_0x39cbdc){if(_0x39cbdc[_0x8de1('0x4a')]===0x0){_0x464283[_0x8de1('0x42')]('c.ListId\x20IS\x20NULL');}else{_0x464283[_0x8de1('0x42')](_0x8de1('0x4b'),_[_0x8de1('0x3f')](_0x39cbdc,'id'));}}})[_0x8de1('0x51')](function(){return _0x464283;});}function buildContactsQuery(_0x363897,_0x278b22,_0x493d9a,_0x1f9f1d,_0x5cbd3a,_0x525ad8){if(_0x278b22){_0x278b22=_0x493d9a['attributes'];}_0x363897=addFieldsToQuery(_0x363897,_0x278b22,_0x1f9f1d,_0x525ad8,!![]);var _0x2ccde4=squel['select']();_0x2ccde4=addFieldsToQuery(_0x2ccde4,_0x278b22,_0x1f9f1d,_0x525ad8,![]);if(_0x1f9f1d||_0x525ad8){_0x363897=applyJoinClauses(_0x363897,!![]);_0x363897['group'](_0x8de1('0x55'));if(_0x493d9a[_0x8de1('0x56')]){_0x2ccde4[_0x8de1('0x56')](_0x493d9a[_0x8de1('0x56')]);}if(_0x493d9a['offset']){_0x2ccde4[_0x8de1('0x57')](_0x493d9a['offset']);}}else{_0x2ccde4=applyJoinClauses(_0x2ccde4,![]);_0x2ccde4[_0x8de1('0x58')]('subqry.id');if(_0x493d9a[_0x8de1('0x56')]){_0x363897[_0x8de1('0x56')](_0x493d9a[_0x8de1('0x56')]);}if(_0x493d9a[_0x8de1('0x57')]){_0x363897[_0x8de1('0x57')](_0x493d9a[_0x8de1('0x57')]);}}_0x2ccde4['having'](_0x5cbd3a);if(_0x493d9a[_0x8de1('0x59')]){_0x493d9a[_0x8de1('0x59')][_0x8de1('0x22')](function(_0x3d79fe){_0x363897['order']('c.'+_0x3d79fe[0x0],_0x3d79fe[0x1]===_0x8de1('0x5a')?![]:!![]);_0x2ccde4[_0x8de1('0x59')](_0x8de1('0x5b')+_0x3d79fe[0x0],_0x3d79fe[0x1]===_0x8de1('0x5a')?![]:!![]);});}_0x2ccde4[_0x8de1('0xc')](_0x363897,_0x8de1('0x10'));return _0x2ccde4;}function getFilteredContacts(_0x50ee92){var _0x186c3f=[];return db[_0x8de1('0x3e')]['findAll']({'attributes':['id',_0x8de1('0x49'),_0x8de1('0x5c')],'raw':!![]})[_0x8de1('0x51')](function(_0x489d1a){_0x186c3f=_[_0x8de1('0x5d')](_0x489d1a,'id');var _0x54aca2={'type':db['Sequelize'][_0x8de1('0x5e')][_0x8de1('0x5f')],'model':db[_0x8de1('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x8de1('0x61')]['query'](_0x50ee92[_0x8de1('0x62')](),_0x54aca2);})[_0x8de1('0x51')](function(_0x5340b3){_0x5340b3[_0x8de1('0x22')](function(_0xb0d6e4){if(_0xb0d6e4[_0x8de1('0x20')]){_0xb0d6e4[_0x8de1('0x63')]=[];_0xb0d6e4[_0x8de1('0x20')][_0x8de1('0x28')](',')[_0x8de1('0x22')](function(_0x136c49){_0xb0d6e4['Tags'][_0x8de1('0x21')](_0x186c3f[_0x136c49]);});}delete _0xb0d6e4[_0x8de1('0x20')];});return _0x5340b3;});}function countFilteredContacts(_0x3d0bcc,_0x57b1a){var _0x174a8f=_0x3d0bcc[_0x8de1('0x64')]();_0x174a8f[_0x8de1('0x24')](_0x8de1('0x65'));_0x174a8f=applyJoinClauses(_0x174a8f,!![]);_0x3d0bcc[_0x8de1('0x58')](_0x8de1('0x55'));var _0x17f61f=utils[_0x8de1('0x66')](_0x57b1a);if(!_[_0x8de1('0x67')](_0x17f61f)){_0x174a8f[_0x8de1('0xe')](_0x8de1('0x68'),_0x17f61f);}var _0x41d223={'type':db[_0x8de1('0x69')][_0x8de1('0x5e')][_0x8de1('0x5f')],'raw':!![]};return db[_0x8de1('0x61')][_0x8de1('0x6a')](_0x174a8f[_0x8de1('0x62')](),_0x41d223)[_0x8de1('0x51')](function(_0x3ba995){return _0x3ba995[0x0][_0x8de1('0x65')];});}module[_0x8de1('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 0cddd6e..9796fa8 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 _0x618e=['../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','base64','utf8','crypto','bluebird','lodash'];(function(_0x27ea09,_0x4a4af5){var _0x3b67c1=function(_0x318022){while(--_0x318022){_0x27ea09['push'](_0x27ea09['shift']());}};_0x3b67c1(++_0x4a4af5);}(_0x618e,0x66));var _0xe618=function(_0xb42ec7,_0x4a0132){_0xb42ec7=_0xb42ec7-0x0;var _0x5824d5=_0x618e[_0xb42ec7];return _0x5824d5;};'use strict';var crypto=require(_0xe618('0x0'));var fs=require('fs');var BPromise=require(_0xe618('0x1'));var _=require(_0xe618('0x2'));var config=require('../../config/environment');var logger=require(_0xe618('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xe618('0x4')][_0xe618('0x5')],'algorithm':_0xe618('0x6')};const fileOptions={'algorithm':_0xe618('0x7')};if(config['encrypt']&&config[_0xe618('0x8')][_0xe618('0x9')]){var isSupported=isAlgorithmSupported(config[_0xe618('0x8')]['algorithm']);if(isSupported){fileOptions[_0xe618('0x9')]=config[_0xe618('0x8')][_0xe618('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe618('0xa')](',\x20');logger[_0xe618('0xb')](config[_0xe618('0x8')][_0xe618('0x9')],_0xe618('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x257e83){return AES_SUPPORTED_RX[_0xe618('0xd')](_0x257e83);}function getSupportedCiphers(){return crypto[_0xe618('0xe')]()[_0xe618('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x341ad3){return getSupportedCiphers()[_0xe618('0x10')](_0x341ad3)>-0x1;}function combineOptions(_0x114e70){var _0x301b72={};for(var _0x4c46cc in fileOptions){if(fileOptions['hasOwnProperty'](_0x4c46cc)){_0x301b72[_0x4c46cc]=fileOptions[_0x4c46cc];}}if(_0x114e70){for(var _0x13c9f5 in _0x114e70){if(_0x114e70[_0xe618('0x11')](_0x13c9f5)){_0x301b72[_0x13c9f5]=_0x114e70[_0x13c9f5];}}}return _0x301b72;}exports[_0xe618('0x12')]=function(_0x2a14ce,_0x35d964,_0x138c2f,_0xec8b3){return new BPromise(function(_0x49094b,_0x1da5d1){_0xec8b3=combineOptions(_0xec8b3);var _0x190dec=new Buffer(_0x138c2f);var _0x5b1e50=fs[_0xe618('0x13')](_0x2a14ce);var _0x584e9b=fs[_0xe618('0x14')](_0x35d964);var _0x5da3f5=crypto[_0xe618('0x15')](_0xec8b3[_0xe618('0x9')],_0x190dec);_0x5b1e50['on']('data',function(_0x262301){var _0x3e8616=new Buffer(_0x5da3f5[_0xe618('0x16')](_0x262301),_0xe618('0x17'));_0x584e9b[_0xe618('0x18')](_0x3e8616);});_0x5b1e50['on'](_0xe618('0x19'),function(){try{var _0x1bb32f=new Buffer(_0x5da3f5[_0xe618('0x1a')](_0xe618('0x17')),_0xe618('0x17'));_0x584e9b['write'](_0x1bb32f);_0x584e9b[_0xe618('0x19')]();_0x584e9b['on'](_0xe618('0x1b'),function(){return _0x49094b(_0x35d964);});}catch(_0x48f7b4){fs[_0xe618('0x1c')](_0x35d964);return _0x1da5d1(_0x48f7b4);}});});};exports[_0xe618('0x1d')]=function(_0x39970b,_0x32785b,_0x441d98,_0x20a731){return new BPromise(function(_0xb539b8,_0x2f76e9){_0x20a731=combineOptions(_0x20a731);var _0x17104b=new Buffer(_0x441d98);var _0x1f37ca=fs[_0xe618('0x13')](_0x39970b);var _0x474fbc=fs[_0xe618('0x14')](_0x32785b);var _0x101704=crypto[_0xe618('0x1e')](_0x20a731['algorithm'],_0x17104b);_0x1f37ca['on']('data',function(_0x34a4c9){var _0x4a57fe=new Buffer(_0x101704[_0xe618('0x16')](_0x34a4c9),_0xe618('0x17'));_0x474fbc[_0xe618('0x18')](_0x4a57fe);});_0x1f37ca['on'](_0xe618('0x19'),function(){try{var _0x235bba=new Buffer(_0x101704['final']('binary'),_0xe618('0x17'));_0x474fbc['write'](_0x235bba);_0x474fbc['end']();_0x474fbc['on'](_0xe618('0x1b'),function(){return _0xb539b8(_0x32785b);});}catch(_0x4801e5){fs['unlink'](_0x32785b);return _0x2f76e9(_0x4801e5);}});});};exports[_0xe618('0x1f')]=function(_0x363b5d,_0x4516b6,_0x2c5446){var _0x2acb32=_0x2c5446||stringOptions[_0xe618('0x9')];var _0x59c58c=_0x4516b6||stringOptions[_0xe618('0x20')];var _0x57cc26=crypto['createCipher'](_0x2acb32,_0x59c58c);var _0x23bb60=_0x57cc26[_0xe618('0x16')](_0x363b5d,'utf8',_0xe618('0x21'));_0x23bb60+=_0x57cc26[_0xe618('0x1a')](_0xe618('0x21'));return _0x23bb60;};exports['decryptString']=function(_0x965f66,_0x5aa6b5,_0x33f644){var _0x55c6dc=_0x33f644||stringOptions[_0xe618('0x9')];var _0x43abb2=_0x5aa6b5||stringOptions[_0xe618('0x20')];var _0x3ea9b5=crypto[_0xe618('0x1e')](_0x55c6dc,_0x43abb2);var _0x16e840=_0x3ea9b5[_0xe618('0x16')](_0x965f66,_0xe618('0x21'),'utf8');_0x16e840+=_0x3ea9b5[_0xe618('0x1a')](_0xe618('0x22'));return _0x16e840;}; \ No newline at end of file +var _0xe4eb=['createReadStream','createDecipher','data','encryptString','secret','createCipher','utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','algorithm','encrypt','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','createWriteStream','update','binary','write','end','final','close','unlink','decryptFile'];(function(_0x1c138f,_0x4554ff){var _0x1e92d7=function(_0x52c6ee){while(--_0x52c6ee){_0x1c138f['push'](_0x1c138f['shift']());}};_0x1e92d7(++_0x4554ff);}(_0xe4eb,0x1cf));var _0xbe4e=function(_0x315d21,_0x336633){_0x315d21=_0x315d21-0x0;var _0x22710f=_0xe4eb[_0x315d21];return _0x22710f;};'use strict';var crypto=require(_0xbe4e('0x0'));var fs=require('fs');var BPromise=require(_0xbe4e('0x1'));var _=require(_0xbe4e('0x2'));var config=require(_0xbe4e('0x3'));var logger=require(_0xbe4e('0x4'))(_0xbe4e('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xbe4e('0x6')][_0xbe4e('0x7')],'algorithm':_0xbe4e('0x8')};const fileOptions={'algorithm':_0xbe4e('0x9')};if(config['encrypt']&&config['encrypt'][_0xbe4e('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xbe4e('0xa')]);if(isSupported){fileOptions['algorithm']=config[_0xbe4e('0xb')][_0xbe4e('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xbe4e('0xc')](',\x20');logger['error'](config[_0xbe4e('0xb')][_0xbe4e('0xa')],_0xbe4e('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x943296){return AES_SUPPORTED_RX[_0xbe4e('0xe')](_0x943296);}function getSupportedCiphers(){return crypto[_0xbe4e('0xf')]()[_0xbe4e('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x45dbc0){return getSupportedCiphers()['indexOf'](_0x45dbc0)>-0x1;}function combineOptions(_0x525b8b){var _0x39f34b={};for(var _0x43b1cc in fileOptions){if(fileOptions[_0xbe4e('0x11')](_0x43b1cc)){_0x39f34b[_0x43b1cc]=fileOptions[_0x43b1cc];}}if(_0x525b8b){for(var _0x31edb5 in _0x525b8b){if(_0x525b8b[_0xbe4e('0x11')](_0x31edb5)){_0x39f34b[_0x31edb5]=_0x525b8b[_0x31edb5];}}}return _0x39f34b;}exports['encryptFile']=function(_0x5b784f,_0x1fb015,_0x491a11,_0x1c05b5){return new BPromise(function(_0x5bb311,_0x942dd2){_0x1c05b5=combineOptions(_0x1c05b5);var _0x5bb487=new Buffer(_0x491a11);var _0x1cd033=fs['createReadStream'](_0x5b784f);var _0x527311=fs[_0xbe4e('0x12')](_0x1fb015);var _0x59a1c0=crypto['createCipher'](_0x1c05b5[_0xbe4e('0xa')],_0x5bb487);_0x1cd033['on']('data',function(_0x5c14b4){var _0x48708c=new Buffer(_0x59a1c0[_0xbe4e('0x13')](_0x5c14b4),_0xbe4e('0x14'));_0x527311[_0xbe4e('0x15')](_0x48708c);});_0x1cd033['on'](_0xbe4e('0x16'),function(){try{var _0xefe3fb=new Buffer(_0x59a1c0[_0xbe4e('0x17')](_0xbe4e('0x14')),_0xbe4e('0x14'));_0x527311[_0xbe4e('0x15')](_0xefe3fb);_0x527311[_0xbe4e('0x16')]();_0x527311['on'](_0xbe4e('0x18'),function(){return _0x5bb311(_0x1fb015);});}catch(_0x171073){fs[_0xbe4e('0x19')](_0x1fb015);return _0x942dd2(_0x171073);}});});};exports[_0xbe4e('0x1a')]=function(_0x4e1365,_0x3c5363,_0xafe3f0,_0x30a0cd){return new BPromise(function(_0x171c98,_0x277690){_0x30a0cd=combineOptions(_0x30a0cd);var _0x7f37c4=new Buffer(_0xafe3f0);var _0x4139bd=fs[_0xbe4e('0x1b')](_0x4e1365);var _0x45e08a=fs[_0xbe4e('0x12')](_0x3c5363);var _0xb7fdbb=crypto[_0xbe4e('0x1c')](_0x30a0cd['algorithm'],_0x7f37c4);_0x4139bd['on'](_0xbe4e('0x1d'),function(_0x3aef4c){var _0x4a7dde=new Buffer(_0xb7fdbb[_0xbe4e('0x13')](_0x3aef4c),_0xbe4e('0x14'));_0x45e08a[_0xbe4e('0x15')](_0x4a7dde);});_0x4139bd['on'](_0xbe4e('0x16'),function(){try{var _0x3ca770=new Buffer(_0xb7fdbb['final'](_0xbe4e('0x14')),_0xbe4e('0x14'));_0x45e08a[_0xbe4e('0x15')](_0x3ca770);_0x45e08a['end']();_0x45e08a['on'](_0xbe4e('0x18'),function(){return _0x171c98(_0x3c5363);});}catch(_0x1793ac){fs['unlink'](_0x3c5363);return _0x277690(_0x1793ac);}});});};exports[_0xbe4e('0x1e')]=function(_0x222bb9,_0x1ed10a,_0x5c6962){var _0x45e33c=_0x5c6962||stringOptions[_0xbe4e('0xa')];var _0x4cc3fe=_0x1ed10a||stringOptions[_0xbe4e('0x1f')];var _0x45f34c=crypto[_0xbe4e('0x20')](_0x45e33c,_0x4cc3fe);var _0x4e4f58=_0x45f34c[_0xbe4e('0x13')](_0x222bb9,_0xbe4e('0x21'),_0xbe4e('0x22'));_0x4e4f58+=_0x45f34c[_0xbe4e('0x17')](_0xbe4e('0x22'));return _0x4e4f58;};exports['decryptString']=function(_0x2f4254,_0x473f8f,_0x401ef2){var _0x5ba6f0=_0x401ef2||stringOptions[_0xbe4e('0xa')];var _0x766af4=_0x473f8f||stringOptions[_0xbe4e('0x1f')];var _0x200a87=crypto[_0xbe4e('0x1c')](_0x5ba6f0,_0x766af4);var _0x1c2c75=_0x200a87[_0xbe4e('0x13')](_0x2f4254,_0xbe4e('0x22'),'utf8');_0x1c2c75+=_0x200a87['final']('utf8');return _0x1c2c75;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 4e43a02..0f5f406 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 _0x5ddb=['dbH','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','.csv','join','mkdirSync','each','%s.%s','csv','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','Failed','exit','util','path','lodash','bluebird','../../mysqldb'];(function(_0x2bf0e0,_0xcb695c){var _0x510422=function(_0x20f267){while(--_0x20f267){_0x2bf0e0['push'](_0x2bf0e0['shift']());}};_0x510422(++_0xcb695c);}(_0x5ddb,0xdc));var _0xb5dd=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5ddb[_0x3ab9ee];return _0x82ee88;};'use strict';var util=require(_0xb5dd('0x0'));var path=require(_0xb5dd('0x1'));var _=require(_0xb5dd('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xb5dd('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xb5dd('0x4'))['db'];var dbH=require(_0xb5dd('0x4'))[_0xb5dd('0x5')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb5dd('0x6')][0x2]);var QUERY=process[_0xb5dd('0x6')][0x3];var PATH=process[_0xb5dd('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1f0d80,_0x294854){var _0x4bffab={'status':_0x1f0d80};var _0x193ac0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x294854){_0x4bffab[_0xb5dd('0x7')]=_0x294854;}return db[_0xb5dd('0x8')][_0xb5dd('0x9')](_0x4bffab,_0x193ac0);}function main(){var _0x263f4f=0x1388;var _0x63ba02;logger[_0xb5dd('0xa')](util['format'](_0xb5dd('0xb'),EXTRACTED_REPORT_ID,_0xb5dd('0xc')));return db['Setting'][_0xb5dd('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb5dd('0xe'),'splitSizeCsv']})[_0xb5dd('0xf')](function(_0x77d969){if(_0x77d969){_0x63ba02=_0x77d969;_0x263f4f=_0x63ba02[_0xb5dd('0x10')]||0x1388;}})[_0xb5dd('0xf')](function(){return dbH[_0xb5dd('0x11')]['query'](util['format'](_0xb5dd('0x12'),QUERY),{'type':dbH['sequelize'][_0xb5dd('0x13')]['SELECT']});})[_0xb5dd('0xf')](function(_0x4545ca){if(!_0x4545ca[0x0][_0xb5dd('0x14')]){return analyticExtractedReport(_0xb5dd('0x15'));}var _0x3c3d6d=[];var _0x40805a=0x0;if(_0x63ba02['split']){if(_0x4545ca&&_0x4545ca[_0xb5dd('0x16')]){var _0x111056=_[_0xb5dd('0x17')](_0x4545ca[0x0][_0xb5dd('0x14')]/_0x263f4f);var _0x5a80d1=Number[_0xb5dd('0x18')](_0x4545ca[0x0][_0xb5dd('0x14')]/_0x263f4f)?_0x4545ca[0x0]['num']%_0x263f4f:0x0;_0x111056['forEach'](function(_0x2e171a){if(_0x2e171a>0x0){_0x40805a+=_0x263f4f;}_0x3c3d6d['push'](dbH[_0xb5dd('0x11')][_0xb5dd('0x19')](util[_0xb5dd('0x1a')](_0xb5dd('0x1b'),QUERY,_0x263f4f,_0x40805a),{'type':dbH[_0xb5dd('0x11')][_0xb5dd('0x13')][_0xb5dd('0x1c')]}));});if(_0x5a80d1>0x0){_0x40805a+=_0x263f4f;_0x3c3d6d['push'](dbH[_0xb5dd('0x11')]['query'](util[_0xb5dd('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5a80d1,_0x40805a),{'type':dbH[_0xb5dd('0x11')][_0xb5dd('0x13')][_0xb5dd('0x1c')]}));}}}else{_0x3c3d6d[_0xb5dd('0x1d')](dbH[_0xb5dd('0x11')][_0xb5dd('0x19')](QUERY,{'type':dbH[_0xb5dd('0x11')][_0xb5dd('0x13')][_0xb5dd('0x1c')]}));}var _0x8ac28b=path[_0xb5dd('0x1e')](PATH);var _0x8eed67=path[_0xb5dd('0x1f')](PATH,_0xb5dd('0x20'));var _0x307cc0=_0x63ba02[_0xb5dd('0xe')]&&_0x3c3d6d[_0xb5dd('0x16')]>0x1;var _0x1316aa=[];if(!fs['existsSync'](path[_0xb5dd('0x21')](_0x8ac28b,_0x8eed67))&&_0x307cc0){fs[_0xb5dd('0x22')](path[_0xb5dd('0x21')](_0x8ac28b,_0x8eed67));}return BPromise[_0xb5dd('0x23')](_0x3c3d6d,function(_0x3e69a3){_0x1316aa[_0xb5dd('0x1d')](_0x3e69a3);})[_0xb5dd('0xf')](function(){for(var _0x3df50e=0x0;_0x3df50e<_0x1316aa['length'];_0x3df50e+=0x1){var _0x1e0997;var _0x327adc=_0x1316aa[_0x3df50e];if(_0x307cc0){_0x1e0997=path[_0xb5dd('0x21')](_0x8ac28b,_0x8eed67,util[_0xb5dd('0x1a')]('%s%d.%s',_0x8eed67,_0x3df50e,'csv'));}else{_0x1e0997=path[_0xb5dd('0x21')](_0x8ac28b,util[_0xb5dd('0x1a')](_0xb5dd('0x24'),_0x8eed67,_0xb5dd('0x25')));}fs['writeFileSync'](_0x1e0997,csv(_0x327adc));}})[_0xb5dd('0xf')](function(){if(_0x307cc0){return new Promise(function(_0x3e788d){zipdir(path[_0xb5dd('0x21')](_0x8ac28b,_0x8eed67),{'saveTo':path[_0xb5dd('0x21')](_0x8ac28b,util[_0xb5dd('0x1a')](_0xb5dd('0x24'),_0x8eed67,_0xb5dd('0x26')))},function(_0x33be94,_0x308cd9){rimraf(path[_0xb5dd('0x21')](_0x8ac28b,_0x8eed67),function(){});_0x3e788d('zip\x20finished');});});}})['then'](function(){logger[_0xb5dd('0xa')](util[_0xb5dd('0x1a')](_0xb5dd('0x27'),EXTRACTED_REPORT_ID,_0xb5dd('0xc')));return analyticExtractedReport(_0xb5dd('0x28'),_0x307cc0?util['format']('%s.%s',_0x8eed67,_0x307cc0?_0xb5dd('0x26'):'csv'):null);});})[_0xb5dd('0x29')](function(_0x140fe5){logger['info'](util['format'](_0xb5dd('0x2a'),EXTRACTED_REPORT_ID,_0xb5dd('0xc')),util['inspect'](_0x140fe5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb5dd('0x2b'));})['finally'](function(){process[_0xb5dd('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4969=['zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Failed','finally','exit','util','path','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','%s%d.%s','csv','%s.%s','writeFileSync','zip'];(function(_0x33ca52,_0x1a73c3){var _0x4b2f63=function(_0x58ca13){while(--_0x58ca13){_0x33ca52['push'](_0x33ca52['shift']());}};_0x4b2f63(++_0x1a73c3);}(_0x4969,0xc8));var _0x9496=function(_0x5abb00,_0x342d70){_0x5abb00=_0x5abb00-0x0;var _0xf9b854=_0x4969[_0x5abb00];return _0xf9b854;};'use strict';var util=require(_0x9496('0x0'));var path=require(_0x9496('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x9496('0x2'));var db=require(_0x9496('0x3'))['db'];var dbH=require('../../mysqldb')[_0x9496('0x4')];var logger=require(_0x9496('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x9496('0x6')][0x3];var PATH=process[_0x9496('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x58cc30,_0x395582){var _0xf88d55={'status':_0x58cc30};var _0x4f0bc0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x395582){_0xf88d55[_0x9496('0x7')]=_0x395582;}return db[_0x9496('0x8')][_0x9496('0x9')](_0xf88d55,_0x4f0bc0);}function main(){var _0x1dafb7=0x1388;var _0x5a3d30;logger['info'](util[_0x9496('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9496('0xb')));return db['Setting'][_0x9496('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9496('0xd'),_0x9496('0xe')]})[_0x9496('0xf')](function(_0x4201bc){if(_0x4201bc){_0x5a3d30=_0x4201bc;_0x1dafb7=_0x5a3d30[_0x9496('0xe')]||0x1388;}})[_0x9496('0xf')](function(){return dbH[_0x9496('0x10')][_0x9496('0x11')](util[_0x9496('0xa')](_0x9496('0x12'),QUERY),{'type':dbH['sequelize'][_0x9496('0x13')][_0x9496('0x14')]});})[_0x9496('0xf')](function(_0x4bc667){if(!_0x4bc667[0x0]['num']){return analyticExtractedReport(_0x9496('0x15'));}var _0x4ee625=[];var _0x2fe790=0x0;if(_0x5a3d30[_0x9496('0xd')]){if(_0x4bc667&&_0x4bc667['length']){var _0x5b6d4f=_[_0x9496('0x16')](_0x4bc667[0x0][_0x9496('0x17')]/_0x1dafb7);var _0x478a8b=Number[_0x9496('0x18')](_0x4bc667[0x0][_0x9496('0x17')]/_0x1dafb7)?_0x4bc667[0x0][_0x9496('0x17')]%_0x1dafb7:0x0;_0x5b6d4f[_0x9496('0x19')](function(_0x89fbdb){if(_0x89fbdb>0x0){_0x2fe790+=_0x1dafb7;}_0x4ee625[_0x9496('0x1a')](dbH['sequelize']['query'](util['format'](_0x9496('0x1b'),QUERY,_0x1dafb7,_0x2fe790),{'type':dbH[_0x9496('0x10')][_0x9496('0x13')][_0x9496('0x14')]}));});if(_0x478a8b>0x0){_0x2fe790+=_0x1dafb7;_0x4ee625['push'](dbH['sequelize'][_0x9496('0x11')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x478a8b,_0x2fe790),{'type':dbH['sequelize'][_0x9496('0x13')][_0x9496('0x14')]}));}}}else{_0x4ee625[_0x9496('0x1a')](dbH['sequelize'][_0x9496('0x11')](QUERY,{'type':dbH[_0x9496('0x10')][_0x9496('0x13')]['SELECT']}));}var _0x1fd2e2=path[_0x9496('0x1c')](PATH);var _0x240c74=path[_0x9496('0x1d')](PATH,_0x9496('0x1e'));var _0x58df94=_0x5a3d30['split']&&_0x4ee625[_0x9496('0x1f')]>0x1;var _0x6d8a27=[];if(!fs[_0x9496('0x20')](path[_0x9496('0x21')](_0x1fd2e2,_0x240c74))&&_0x58df94){fs[_0x9496('0x22')](path['join'](_0x1fd2e2,_0x240c74));}return BPromise['each'](_0x4ee625,function(_0x1ef0eb){_0x6d8a27['push'](_0x1ef0eb);})[_0x9496('0xf')](function(){for(var _0x1cbaca=0x0;_0x1cbaca<_0x6d8a27[_0x9496('0x1f')];_0x1cbaca+=0x1){var _0x3e453e;var _0x58e4eb=_0x6d8a27[_0x1cbaca];if(_0x58df94){_0x3e453e=path[_0x9496('0x21')](_0x1fd2e2,_0x240c74,util[_0x9496('0xa')](_0x9496('0x23'),_0x240c74,_0x1cbaca,_0x9496('0x24')));}else{_0x3e453e=path[_0x9496('0x21')](_0x1fd2e2,util[_0x9496('0xa')](_0x9496('0x25'),_0x240c74,_0x9496('0x24')));}fs[_0x9496('0x26')](_0x3e453e,csv(_0x58e4eb));}})[_0x9496('0xf')](function(){if(_0x58df94){return new Promise(function(_0x5103de){zipdir(path[_0x9496('0x21')](_0x1fd2e2,_0x240c74),{'saveTo':path[_0x9496('0x21')](_0x1fd2e2,util[_0x9496('0xa')]('%s.%s',_0x240c74,_0x9496('0x27')))},function(_0x5ab0da,_0x4a8fc7){rimraf(path['join'](_0x1fd2e2,_0x240c74),function(){});_0x5103de(_0x9496('0x28'));});});}})['then'](function(){logger[_0x9496('0x29')](util[_0x9496('0xa')](_0x9496('0x2a'),EXTRACTED_REPORT_ID,_0x9496('0xb')));return analyticExtractedReport(_0x9496('0x2b'),_0x58df94?util['format'](_0x9496('0x25'),_0x240c74,_0x58df94?_0x9496('0x27'):_0x9496('0x24')):null);});})[_0x9496('0x2c')](function(_0x25328e){logger[_0x9496('0x29')](util[_0x9496('0xa')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9496('0xb')),util['inspect'](_0x25328e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9496('0x2d'));})[_0x9496('0x2e')](function(){process[_0x9496('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index f7ab896..2e0802e 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 _0x5f90=['AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','push','body','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','format','header','pageBreak','before','landscape','Arial','num','Setting','find','split','splitSizePdf','then','range','isInteger','forEach','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','mkdirSync','join','each','flatten','%s%d.%s','%s.%s','pdf','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename'];(function(_0x165e8a,_0x20cbf0){var _0x54d115=function(_0x6080a1){while(--_0x6080a1){_0x165e8a['push'](_0x165e8a['shift']());}};_0x54d115(++_0x20cbf0);}(_0x5f90,0x1c0));var _0x05f9=function(_0x2036e4,_0x2da487){_0x2036e4=_0x2036e4-0x0;var _0x46ef54=_0x5f90[_0x2036e4];return _0x46ef54;};'use strict';var _=require(_0x05f9('0x0'));var fs=require('fs');var util=require(_0x05f9('0x1'));var path=require(_0x05f9('0x2'));var moment=require(_0x05f9('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x05f9('0x4'));var zipdir=require(_0x05f9('0x5'));var rimraf=require(_0x05f9('0x6'));var JSDOM=require(_0x05f9('0x7'))[_0x05f9('0x8')];var window=new JSDOM('')[_0x05f9('0x9')];var BPromise=require(_0x05f9('0xa'));var db=require(_0x05f9('0xb'))['db'];var dbH=require(_0x05f9('0xb'))[_0x05f9('0xc')];var logger=require(_0x05f9('0xd'))(_0x05f9('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x05f9('0xf')][0x2]);var QUERY=process[_0x05f9('0xf')][0x3];var PATH=process[_0x05f9('0xf')][0x4];var NAME=process[_0x05f9('0xf')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3fc9f6,_0x10c61e){var _0x4ae7b0={'status':_0x3fc9f6};var _0x177318={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x10c61e){_0x4ae7b0[_0x05f9('0x10')]=_0x10c61e;}return db[_0x05f9('0x11')][_0x05f9('0x12')](_0x4ae7b0,_0x177318);}function getHeaders(_0x4ef804){return _[_0x05f9('0x13')](_0x4ef804,function(_0x157278){return{'text':_0x157278,'style':_0x05f9('0x14')};});}function getRows(_0x337959,_0x4d1472){return _[_0x05f9('0x13')](_0x4d1472,function(_0x109900){return _(_0x109900)[_0x05f9('0x15')](_0x337959)[_0x05f9('0x13')](function(_0x3048eb){return _0x3048eb?_[_0x05f9('0x16')](_0x3048eb):'';})[_0x05f9('0x17')]();});}function createTable(_0x539a36,_0x4c8c57){var _0x215b33={'widths':_[_0x05f9('0x18')](Array(_0x539a36[_0x05f9('0x19')]),0x91),'heights':function(_0x44d09c){return _0x44d09c===0x0?_0x05f9('0x1a'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2ab324=getHeaders(_0x539a36);_0x215b33['body'][_0x05f9('0x1b')](_0x2ab324);var _0x2b6fcc=getRows(_0x539a36,_0x4c8c57);_0x215b33[_0x05f9('0x1c')]=_0x215b33['body']['concat'](_0x2b6fcc);return _0x215b33;}function createTables(_0x3198db){var _0xfc8010=[];var _0x1f11b5=_[_0x05f9('0x1d')](Object[_0x05f9('0x1e')](_0x3198db[0x0]),0x5);_0x1f11b5['forEach'](function(_0x47ae14){_0xfc8010[_0x05f9('0x1b')](createTable(_0x47ae14,_0x3198db));});return _0xfc8010;}function getPDFDocDefinition(_0x9bfc15){var _0x2404b0=util['format'](_0x05f9('0x1f'),NAME,EXTRACTED_REPORT[_0x05f9('0x20')],moment(EXTRACTED_REPORT[_0x05f9('0x21')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x05f9('0x22')])[_0x05f9('0x23')](FORMAT));var _0x8165f9=[];for(var _0x168502=0x0;_0x168502<_0x9bfc15[_0x05f9('0x19')];_0x168502++){var _0x187745=[];if(_0x168502===0x0){_0x187745[_0x05f9('0x1b')]({'text':_0x2404b0,'style':_0x05f9('0x24')});}var _0x39ce1b={'table':_0x9bfc15[_0x168502]};if(_0x168502>0x0){_0x39ce1b[_0x05f9('0x25')]=_0x05f9('0x26');_0x39ce1b['margin']=[0x0,0x46,0x0,0x0];}_0x187745[_0x05f9('0x1b')](_0x39ce1b);_0x8165f9['push'](_0x187745);}return{'pageSize':'A4','pageOrientation':_0x05f9('0x27'),'content':_0x8165f9,'footer':function(_0x9fdb03,_0x3297b4){return{'text':_0x9fdb03['toString']()+'\x20/\x20'+_0x3297b4,'style':'footer'};},'defaultStyle':{'font':_0x05f9('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3a96a3){var _0x514143=0x1388;var _0x15a78b;if(!_0x3a96a3[0x0][_0x05f9('0x29')]){return analyticExtractedReport('Empty');}return db[_0x05f9('0x2a')][_0x05f9('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x05f9('0x2c'),_0x05f9('0x2d')]})[_0x05f9('0x2e')](function(_0x4e90f6){if(_0x4e90f6){_0x15a78b=_0x4e90f6;_0x514143=_0x15a78b[_0x05f9('0x2d')]||0x3e8;}})[_0x05f9('0x2e')](function(){var _0x525d4a=[];var _0x5638fc=0x0;if(_0x15a78b[_0x05f9('0x2c')]){if(_0x3a96a3&&_0x3a96a3[_0x05f9('0x19')]){var _0x1ad372=_[_0x05f9('0x2f')](_0x3a96a3[0x0][_0x05f9('0x29')]/_0x514143);var _0x28216a=Number[_0x05f9('0x30')](_0x3a96a3[0x0]['num']/_0x514143)?_0x3a96a3[0x0][_0x05f9('0x29')]%_0x514143:0x0;_0x1ad372[_0x05f9('0x31')](function(_0x48c35b){if(_0x48c35b>0x0){_0x5638fc+=_0x514143;}_0x525d4a[_0x05f9('0x1b')](dbH[_0x05f9('0x32')][_0x05f9('0x33')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x514143,_0x5638fc),{'type':dbH[_0x05f9('0x32')][_0x05f9('0x34')][_0x05f9('0x35')]}));});if(_0x28216a>0x0){_0x5638fc+=_0x514143;_0x525d4a[_0x05f9('0x1b')](dbH[_0x05f9('0x32')]['query'](util[_0x05f9('0x23')](_0x05f9('0x36'),QUERY,_0x28216a,_0x5638fc),{'type':dbH[_0x05f9('0x32')][_0x05f9('0x34')]['SELECT']}));}}}else{_0x525d4a[_0x05f9('0x1b')](dbH[_0x05f9('0x32')][_0x05f9('0x33')](QUERY,{'type':dbH[_0x05f9('0x32')][_0x05f9('0x34')]['SELECT']}));}var _0x145903=path['dirname'](PATH);var _0x184626=path[_0x05f9('0x37')](PATH,'.pdf');var _0x316583=_0x15a78b[_0x05f9('0x2c')]&&_0x525d4a[_0x05f9('0x19')]>0x1;var _0x1f86a8=[];if(!fs[_0x05f9('0x38')](path['join'](_0x145903,_0x184626))&&_0x316583){fs[_0x05f9('0x39')](path[_0x05f9('0x3a')](_0x145903,_0x184626));}return BPromise[_0x05f9('0x3b')](_0x525d4a,function(_0x1cd908){_0x1f86a8[_0x05f9('0x1b')](_0x1cd908);})[_0x05f9('0x2e')](function(){var _0x3aa77d=[];for(var _0x126db5=0x0;_0x126db5<_0x1f86a8[_0x05f9('0x19')];_0x126db5+=0x1){var _0x5ca3ca=_0x1f86a8[_0x126db5];var _0x467fb7=createTables(_[_0x05f9('0x3c')](_0x5ca3ca));var _0x32256a;var _0x15a6fa=getPDFDocDefinition(_0x467fb7);var _0x165e14=getPDFPrinter();var _0x5c349a=_0x165e14['createPdfKitDocument'](_0x15a6fa);if(_0x316583){_0x32256a=path[_0x05f9('0x3a')](_0x145903,_0x184626,util[_0x05f9('0x23')](_0x05f9('0x3d'),_0x184626,_0x126db5,'pdf'));}else{_0x32256a=path[_0x05f9('0x3a')](_0x145903,util['format'](_0x05f9('0x3e'),_0x184626,_0x05f9('0x3f')));}_0x3aa77d[_0x05f9('0x1b')](writePDFDocument(_0x5c349a,_0x32256a));}return Promise['all'](_0x3aa77d);})[_0x05f9('0x2e')](function(){if(_0x316583){return new Promise(function(_0x5d64b6){zipdir(path['join'](_0x145903,_0x184626),{'saveTo':path[_0x05f9('0x3a')](_0x145903,util[_0x05f9('0x23')](_0x05f9('0x3e'),_0x184626,'zip'))},function(){rimraf(path[_0x05f9('0x3a')](_0x145903,_0x184626),function(){});_0x5d64b6(_0x05f9('0x40'));});});}})['then'](function(){if(!_0x316583)return;rimraf(path[_0x05f9('0x3a')](_0x145903,_0x184626),function(){});})[_0x05f9('0x2e')](function(){logger[_0x05f9('0x41')](util[_0x05f9('0x23')](_0x05f9('0x42'),EXTRACTED_REPORT_ID,_0x05f9('0x43')));return analyticExtractedReport(_0x05f9('0x44'),_0x316583?util[_0x05f9('0x23')](_0x05f9('0x3e'),_0x184626,_0x316583?_0x05f9('0x45'):_0x05f9('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x05f9('0x41')](util['format'](_0x05f9('0x46'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x05f9('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1eadb0){EXTRACTED_REPORT=_0x1eadb0;return dbH[_0x05f9('0x32')][_0x05f9('0x33')](util['format'](_0x05f9('0x47'),QUERY),{'type':dbH['sequelize'][_0x05f9('0x34')][_0x05f9('0x35')]});})[_0x05f9('0x2e')](extractReport)[_0x05f9('0x48')](function(_0x42aa71){logger['info'](util[_0x05f9('0x23')](_0x05f9('0x49'),EXTRACTED_REPORT_ID,_0x05f9('0x43')),util[_0x05f9('0x4a')](_0x42aa71,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x05f9('0x4b'));})[_0x05f9('0x4c')](function(){process[_0x05f9('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x280fd4=new PdfPrinter({'Arial':{'normal':__dirname+_0x05f9('0x4e'),'bold':__dirname+_0x05f9('0x4f'),'italics':__dirname+_0x05f9('0x50'),'bolditalics':__dirname+_0x05f9('0x51')}});return _0x280fd4;}function getPDFDocDefinitionFromHTML(_0x402bf7,_0x4d8303){var _0x1eb04d=util['format'](_0x05f9('0x52'),_0x4d8303[_0x05f9('0x53')],_0x4d8303['interactionId']);var _0x46163d=moment()['format']('YYYY-MM-DD')[_0x05f9('0x16')]();var _0x50b21d=htmlToPdfmake(_0x402bf7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x50b21d],'defaultStyle':{'font':_0x05f9('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x05f9('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x05f9('0x54')}},'header':function(){return[{'text':_0x05f9('0x55'),'style':'header'}];},'footer':function(_0x484c00,_0x4c7f11){return[{'text':util['format'](_0x05f9('0x56'),_0x1eb04d,_0x484c00,_0x4c7f11,_0x46163d),'style':_0x05f9('0x57')}];}};}function writePDFDocument(_0x314871,_0x24fa52){return new Promise(function(_0x182fb9,_0x4757f9){var _0x5b906d=_0x314871[_0x05f9('0x58')](fs[_0x05f9('0x59')](_0x24fa52));_0x5b906d['on'](_0x05f9('0x5a'),function(){_0x182fb9(_0x05f9('0x5a'));});_0x5b906d['on']('error',function(_0x1ef7b3){_0x4757f9(_0x1ef7b3);});_0x314871[_0x05f9('0x5b')]();});}exports[_0x05f9('0x5c')]=function(_0x42d045,_0x3daf11){var _0x1209e1=getPDFPrinter();var _0x21d281=getPDFDocDefinitionFromHTML(_0x42d045,_0x3daf11);var _0x2ea328=_0x1209e1['createPdfKitDocument'](_0x21d281);return writePDFDocument(_0x2ea328,_0x3daf11[_0x05f9('0x2')])[_0x05f9('0x48')](function(_0x98479b){throw _0x98479b;});}; \ No newline at end of file +var _0xbda8=['createPdfFromHTML','lodash','path','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','toString','value','length','auto','body','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','landscape','footer','Arial','black','right','Setting','split','then','range','num','sequelize','query','QueryTypes','SELECT','dirname','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','all','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xbda8,0xad));var _0x8bda=function(_0x1c85f4,_0x3c94b6){_0x1c85f4=_0x1c85f4-0x0;var _0x43d94b=_0xbda8[_0x1c85f4];return _0x43d94b;};'use strict';var _=require(_0x8bda('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x8bda('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x8bda('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x8bda('0x3'));var rimraf=require(_0x8bda('0x4'));var JSDOM=require(_0x8bda('0x5'))[_0x8bda('0x6')];var window=new JSDOM('')[_0x8bda('0x7')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x8bda('0x8'))[_0x8bda('0x9')];var logger=require(_0x8bda('0xa'))(_0x8bda('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x8bda('0xc')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x8bda('0xc')][0x5];var FORMAT=_0x8bda('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4dc394,_0x2be4a6){var _0x24d861={'status':_0x4dc394};var _0x5d0414={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2be4a6){_0x24d861[_0x8bda('0xe')]=_0x2be4a6;}return db[_0x8bda('0xf')][_0x8bda('0x10')](_0x24d861,_0x5d0414);}function getHeaders(_0xe4052b){return _[_0x8bda('0x11')](_0xe4052b,function(_0x1a1736){return{'text':_0x1a1736,'style':'tableHeader'};});}function getRows(_0x23d68d,_0x34840f){return _[_0x8bda('0x11')](_0x34840f,function(_0x58854c){return _(_0x58854c)['pick'](_0x23d68d)[_0x8bda('0x11')](function(_0x161abc){return _0x161abc?_[_0x8bda('0x12')](_0x161abc):'';})[_0x8bda('0x13')]();});}function createTable(_0xb25563,_0x43631b){var _0x253c8e={'widths':_['fill'](Array(_0xb25563[_0x8bda('0x14')]),0x91),'heights':function(_0x17a10f){return _0x17a10f===0x0?_0x8bda('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x125e0e=getHeaders(_0xb25563);_0x253c8e[_0x8bda('0x16')][_0x8bda('0x17')](_0x125e0e);var _0x3bfe1b=getRows(_0xb25563,_0x43631b);_0x253c8e['body']=_0x253c8e['body'][_0x8bda('0x18')](_0x3bfe1b);return _0x253c8e;}function createTables(_0x30ae14){var _0x2d1dd8=[];var _0x3d54d3=_['chunk'](Object[_0x8bda('0x19')](_0x30ae14[0x0]),0x5);_0x3d54d3[_0x8bda('0x1a')](function(_0x1c4641){_0x2d1dd8[_0x8bda('0x17')](createTable(_0x1c4641,_0x30ae14));});return _0x2d1dd8;}function getPDFDocDefinition(_0x34a144){var _0x42ec93=util[_0x8bda('0x1b')](_0x8bda('0x1c'),NAME,EXTRACTED_REPORT[_0x8bda('0x1d')],moment(EXTRACTED_REPORT[_0x8bda('0x1e')])[_0x8bda('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x8bda('0x1f')])[_0x8bda('0x1b')](FORMAT));var _0x3d62c3=[];for(var _0x60860a=0x0;_0x60860a<_0x34a144[_0x8bda('0x14')];_0x60860a++){var _0x371419=[];if(_0x60860a===0x0){_0x371419[_0x8bda('0x17')]({'text':_0x42ec93,'style':_0x8bda('0x20')});}var _0x216ab3={'table':_0x34a144[_0x60860a]};if(_0x60860a>0x0){_0x216ab3[_0x8bda('0x21')]='before';_0x216ab3[_0x8bda('0x22')]=[0x0,0x46,0x0,0x0];}_0x371419[_0x8bda('0x17')](_0x216ab3);_0x3d62c3[_0x8bda('0x17')](_0x371419);}return{'pageSize':'A4','pageOrientation':_0x8bda('0x23'),'content':_0x3d62c3,'footer':function(_0x153cd3,_0x3421e9){return{'text':_0x153cd3['toString']()+'\x20/\x20'+_0x3421e9,'style':_0x8bda('0x24')};},'defaultStyle':{'font':_0x8bda('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8bda('0x26')},'footer':{'alignment':_0x8bda('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5f100e){var _0x5d148d=0x1388;var _0x444ad3;if(!_0x5f100e[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x8bda('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8bda('0x29'),'splitSizePdf']})[_0x8bda('0x2a')](function(_0xe184c2){if(_0xe184c2){_0x444ad3=_0xe184c2;_0x5d148d=_0x444ad3['splitSizePdf']||0x3e8;}})[_0x8bda('0x2a')](function(){var _0x26bf08=[];var _0x47b15c=0x0;if(_0x444ad3[_0x8bda('0x29')]){if(_0x5f100e&&_0x5f100e[_0x8bda('0x14')]){var _0x5527a6=_[_0x8bda('0x2b')](_0x5f100e[0x0][_0x8bda('0x2c')]/_0x5d148d);var _0x28ee42=Number['isInteger'](_0x5f100e[0x0]['num']/_0x5d148d)?_0x5f100e[0x0][_0x8bda('0x2c')]%_0x5d148d:0x0;_0x5527a6[_0x8bda('0x1a')](function(_0x5bbc92){if(_0x5bbc92>0x0){_0x47b15c+=_0x5d148d;}_0x26bf08[_0x8bda('0x17')](dbH[_0x8bda('0x2d')][_0x8bda('0x2e')](util[_0x8bda('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5d148d,_0x47b15c),{'type':dbH[_0x8bda('0x2d')][_0x8bda('0x2f')]['SELECT']}));});if(_0x28ee42>0x0){_0x47b15c+=_0x5d148d;_0x26bf08[_0x8bda('0x17')](dbH[_0x8bda('0x2d')][_0x8bda('0x2e')](util[_0x8bda('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x28ee42,_0x47b15c),{'type':dbH[_0x8bda('0x2d')][_0x8bda('0x2f')][_0x8bda('0x30')]}));}}}else{_0x26bf08[_0x8bda('0x17')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x8bda('0x2d')][_0x8bda('0x2f')]['SELECT']}));}var _0x16e997=path[_0x8bda('0x31')](PATH);var _0x13b394=path['basename'](PATH,_0x8bda('0x32'));var _0x5af1ce=_0x444ad3[_0x8bda('0x29')]&&_0x26bf08[_0x8bda('0x14')]>0x1;var _0x115cc9=[];if(!fs[_0x8bda('0x33')](path[_0x8bda('0x34')](_0x16e997,_0x13b394))&&_0x5af1ce){fs[_0x8bda('0x35')](path['join'](_0x16e997,_0x13b394));}return BPromise['each'](_0x26bf08,function(_0x5e802e){_0x115cc9['push'](_0x5e802e);})['then'](function(){var _0x53bc22=[];for(var _0x13a4ac=0x0;_0x13a4ac<_0x115cc9[_0x8bda('0x14')];_0x13a4ac+=0x1){var _0x1d2ab2=_0x115cc9[_0x13a4ac];var _0x46863b=createTables(_[_0x8bda('0x36')](_0x1d2ab2));var _0x574bc0;var _0x369cbc=getPDFDocDefinition(_0x46863b);var _0x5d05e9=getPDFPrinter();var _0x309792=_0x5d05e9[_0x8bda('0x37')](_0x369cbc);if(_0x5af1ce){_0x574bc0=path[_0x8bda('0x34')](_0x16e997,_0x13b394,util[_0x8bda('0x1b')]('%s%d.%s',_0x13b394,_0x13a4ac,'pdf'));}else{_0x574bc0=path['join'](_0x16e997,util[_0x8bda('0x1b')]('%s.%s',_0x13b394,'pdf'));}_0x53bc22[_0x8bda('0x17')](writePDFDocument(_0x309792,_0x574bc0));}return Promise[_0x8bda('0x38')](_0x53bc22);})[_0x8bda('0x2a')](function(){if(_0x5af1ce){return new Promise(function(_0x2670e3){zipdir(path[_0x8bda('0x34')](_0x16e997,_0x13b394),{'saveTo':path[_0x8bda('0x34')](_0x16e997,util[_0x8bda('0x1b')](_0x8bda('0x39'),_0x13b394,'zip'))},function(){rimraf(path[_0x8bda('0x34')](_0x16e997,_0x13b394),function(){});_0x2670e3('zip\x20finished');});});}})[_0x8bda('0x2a')](function(){if(!_0x5af1ce)return;rimraf(path[_0x8bda('0x34')](_0x16e997,_0x13b394),function(){});})[_0x8bda('0x2a')](function(){logger[_0x8bda('0x3a')](util['format'](_0x8bda('0x3b'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x5af1ce?util[_0x8bda('0x1b')](_0x8bda('0x39'),_0x13b394,_0x5af1ce?_0x8bda('0x3c'):_0x8bda('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8bda('0x3a')](util[_0x8bda('0x1b')](_0x8bda('0x3e'),EXTRACTED_REPORT_ID,_0x8bda('0x3f')));return db['AnalyticExtractedReport'][_0x8bda('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8bda('0x2a')](function(_0x790299){EXTRACTED_REPORT=_0x790299;return dbH[_0x8bda('0x2d')][_0x8bda('0x2e')](util['format'](_0x8bda('0x41'),QUERY),{'type':dbH[_0x8bda('0x2d')]['QueryTypes'][_0x8bda('0x30')]});})[_0x8bda('0x2a')](extractReport)[_0x8bda('0x42')](function(_0x1c3143){logger[_0x8bda('0x3a')](util[_0x8bda('0x1b')](_0x8bda('0x43'),EXTRACTED_REPORT_ID,_0x8bda('0x3f')),util[_0x8bda('0x44')](_0x1c3143,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8bda('0x45'));})[_0x8bda('0x46')](function(){process[_0x8bda('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3b9e09=new PdfPrinter({'Arial':{'normal':__dirname+_0x8bda('0x48'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x8bda('0x49')}});return _0x3b9e09;}function getPDFDocDefinitionFromHTML(_0x508366,_0x57dcbb){var _0xb9fd51=util[_0x8bda('0x1b')](_0x8bda('0x4a'),_0x57dcbb[_0x8bda('0x4b')],_0x57dcbb[_0x8bda('0x4c')]);var _0x16db8a=moment()[_0x8bda('0x1b')](_0x8bda('0x4d'))['toString']();var _0x55102c=htmlToPdfmake(_0x508366,{'window':window,'tableAutoSize':!![]});return{'content':[_0x55102c],'defaultStyle':{'font':_0x8bda('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8bda('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8bda('0x4e')}},'header':function(){return[{'text':_0x8bda('0x4f'),'style':_0x8bda('0x20')}];},'footer':function(_0x46ef00,_0x19120a){return[{'text':util[_0x8bda('0x1b')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0xb9fd51,_0x46ef00,_0x19120a,_0x16db8a),'style':_0x8bda('0x24')}];}};}function writePDFDocument(_0x440a8d,_0x11e509){return new Promise(function(_0x42d2cd,_0x1618cc){var _0x83d2da=_0x440a8d[_0x8bda('0x50')](fs[_0x8bda('0x51')](_0x11e509));_0x83d2da['on'](_0x8bda('0x52'),function(){_0x42d2cd(_0x8bda('0x52'));});_0x83d2da['on'](_0x8bda('0x53'),function(_0x12b43a){_0x1618cc(_0x12b43a);});_0x440a8d[_0x8bda('0x54')]();});}exports[_0x8bda('0x55')]=function(_0x2145e9,_0x12f063){var _0x5dc076=getPDFPrinter();var _0x51bb50=getPDFDocDefinitionFromHTML(_0x2145e9,_0x12f063);var _0x204c2f=_0x5dc076[_0x8bda('0x37')](_0x51bb50);return writePDFDocument(_0x204c2f,_0x12f063[_0x8bda('0x1')])[_0x8bda('0x42')](function(_0xafb74b){throw _0xafb74b;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 40aa91a..d9b8898 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 _0x9731=['zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','push','query','dirname','.xlsx','join','each','%s%d.%s','%s.%s','binary'];(function(_0x95916a,_0x3707d7){var _0x2a0ac4=function(_0x4754c4){while(--_0x4754c4){_0x95916a['push'](_0x95916a['shift']());}};_0x2a0ac4(++_0x3707d7);}(_0x9731,0x1a5));var _0x1973=function(_0x107fab,_0x1aae42){_0x107fab=_0x107fab-0x0;var _0x4a7a0b=_0x9731[_0x107fab];return _0x4a7a0b;};'use strict';var util=require('util');var path=require(_0x1973('0x0'));var _=require(_0x1973('0x1'));var fs=require('fs');var json2xls=require(_0x1973('0x2'));var BPromise=require(_0x1973('0x3'));var zipdir=require(_0x1973('0x4'));var rimraf=require(_0x1973('0x5'));var db=require(_0x1973('0x6'))['db'];var dbH=require(_0x1973('0x6'))[_0x1973('0x7')];var logger=require(_0x1973('0x8'))(_0x1973('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1973('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x20b3f6,_0x23b043){var _0x1068a8={'status':_0x20b3f6};var _0x520ca4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23b043){_0x1068a8['savename']=_0x23b043;}return db[_0x1973('0xb')][_0x1973('0xc')](_0x1068a8,_0x520ca4);}function main(){var _0x873197=0x1388;var _0x313a84;logger['info'](util[_0x1973('0xd')](_0x1973('0xe'),EXTRACTED_REPORT_ID,_0x1973('0xf')));return db[_0x1973('0x10')][_0x1973('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1973('0x12'),_0x1973('0x13')]})['then'](function(_0x3a6d55){if(_0x3a6d55){_0x313a84=_0x3a6d55;_0x873197=_0x313a84['splitSizeXlsx']||0x1388;}})[_0x1973('0x14')](function(){return dbH['sequelize']['query'](util[_0x1973('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1973('0x15')][_0x1973('0x16')][_0x1973('0x17')]});})['then'](function(_0x8a8635){if(!_0x8a8635[0x0][_0x1973('0x18')]){return analyticExtractedReport(_0x1973('0x19'));}var _0x244da5=[];var _0x1c57f8=0x0;if(_0x313a84[_0x1973('0x12')]){if(_0x8a8635&&_0x8a8635[_0x1973('0x1a')]){var _0x39b8d3=_[_0x1973('0x1b')](_0x8a8635[0x0][_0x1973('0x18')]/_0x873197);var _0x4fbf02=Number[_0x1973('0x1c')](_0x8a8635[0x0][_0x1973('0x18')]/_0x873197)?_0x8a8635[0x0][_0x1973('0x18')]%_0x873197:0x0;_0x39b8d3['forEach'](function(_0x807818){if(_0x807818>0x0){_0x1c57f8+=_0x873197;}_0x244da5['push'](dbH[_0x1973('0x15')]['query'](util[_0x1973('0xd')](_0x1973('0x1d'),QUERY,_0x873197,_0x1c57f8),{'type':dbH[_0x1973('0x15')]['QueryTypes']['SELECT']}));});if(_0x4fbf02>0x0){_0x1c57f8+=_0x873197;_0x244da5[_0x1973('0x1e')](dbH['sequelize'][_0x1973('0x1f')](util[_0x1973('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4fbf02,_0x1c57f8),{'type':dbH['sequelize'][_0x1973('0x16')][_0x1973('0x17')]}));}}}else{_0x244da5[_0x1973('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x1973('0x16')]['SELECT']}));}var _0x25d143=path[_0x1973('0x20')](PATH);var _0x226056=path['basename'](PATH,_0x1973('0x21'));var _0x479d83=_0x313a84[_0x1973('0x12')]&&_0x244da5[_0x1973('0x1a')]>0x1;var _0x595fad=[];if(!fs['existsSync'](path[_0x1973('0x22')](_0x25d143,_0x226056))&&_0x479d83){fs['mkdirSync'](path[_0x1973('0x22')](_0x25d143,_0x226056));}return BPromise[_0x1973('0x23')](_0x244da5,function(_0xd5d7b2){_0x595fad[_0x1973('0x1e')](_0xd5d7b2);})[_0x1973('0x14')](function(){for(var _0x4cccf2=0x0;_0x4cccf2<_0x595fad['length'];_0x4cccf2+=0x1){var _0xffbc84;var _0x29e3b0=_0x595fad[_0x4cccf2];if(_0x479d83){_0xffbc84=path[_0x1973('0x22')](_0x25d143,_0x226056,util[_0x1973('0xd')](_0x1973('0x24'),_0x226056,_0x4cccf2,'xlsx'));}else{_0xffbc84=path[_0x1973('0x22')](_0x25d143,util['format'](_0x1973('0x25'),_0x226056,'xlsx'));}fs['writeFileSync'](_0xffbc84,json2xls(_0x29e3b0),_0x1973('0x26'));}})[_0x1973('0x14')](function(){if(_0x479d83){return new Promise(function(_0x45e848){zipdir(path[_0x1973('0x22')](_0x25d143,_0x226056),{'saveTo':path[_0x1973('0x22')](_0x25d143,util[_0x1973('0xd')](_0x1973('0x25'),_0x226056,_0x1973('0x27')))},function(_0x5a17b4,_0x1dd00c){rimraf(path[_0x1973('0x22')](_0x25d143,_0x226056),function(){});_0x45e848(_0x1973('0x28'));});});}})[_0x1973('0x14')](function(){logger[_0x1973('0x29')](util['format'](_0x1973('0x2a'),EXTRACTED_REPORT_ID,_0x1973('0xf')));return analyticExtractedReport('Completed',_0x479d83?util[_0x1973('0xd')](_0x1973('0x25'),_0x226056,_0x479d83?_0x1973('0x27'):'xlsx'):null);});})[_0x1973('0x2b')](function(_0x4aadaa){logger[_0x1973('0x29')](util[_0x1973('0xd')](_0x1973('0x2c'),EXTRACTED_REPORT_ID,_0x1973('0xf')),util['inspect'](_0x4aadaa,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x1973('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdf65=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','Failed','finally','exit','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Completed','catch','info'];(function(_0xbd0dcd,_0x1e9231){var _0x271a9e=function(_0x4dd3cb){while(--_0x4dd3cb){_0xbd0dcd['push'](_0xbd0dcd['shift']());}};_0x271a9e(++_0x1e9231);}(_0xdf65,0x6e));var _0x5df6=function(_0x1abdde,_0x200a7e){_0x1abdde=_0x1abdde-0x0;var _0x112a5a=_0xdf65[_0x1abdde];return _0x112a5a;};'use strict';var util=require('util');var path=require('path');var _=require(_0x5df6('0x0'));var fs=require('fs');var json2xls=require(_0x5df6('0x1'));var BPromise=require('bluebird');var zipdir=require(_0x5df6('0x2'));var rimraf=require(_0x5df6('0x3'));var db=require(_0x5df6('0x4'))['db'];var dbH=require('../../mysqldb')[_0x5df6('0x5')];var logger=require(_0x5df6('0x6'))(_0x5df6('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x5df6('0x8')][0x2]);var QUERY=process[_0x5df6('0x8')][0x3];var PATH=process[_0x5df6('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x38a6a8,_0x11e92d){var _0x205182={'status':_0x38a6a8};var _0x4d5fff={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x11e92d){_0x205182['savename']=_0x11e92d;}return db[_0x5df6('0x9')][_0x5df6('0xa')](_0x205182,_0x4d5fff);}function main(){var _0x466759=0x1388;var _0x3ec257;logger['info'](util[_0x5df6('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5df6('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5df6('0xd'),_0x5df6('0xe')]})['then'](function(_0x38dc63){if(_0x38dc63){_0x3ec257=_0x38dc63;_0x466759=_0x3ec257[_0x5df6('0xe')]||0x1388;}})[_0x5df6('0xf')](function(){return dbH[_0x5df6('0x10')][_0x5df6('0x11')](util[_0x5df6('0xb')](_0x5df6('0x12'),QUERY),{'type':dbH[_0x5df6('0x10')][_0x5df6('0x13')][_0x5df6('0x14')]});})[_0x5df6('0xf')](function(_0x357028){if(!_0x357028[0x0][_0x5df6('0x15')]){return analyticExtractedReport(_0x5df6('0x16'));}var _0x1e2dcf=[];var _0x52fc11=0x0;if(_0x3ec257[_0x5df6('0xd')]){if(_0x357028&&_0x357028[_0x5df6('0x17')]){var _0x1ec801=_[_0x5df6('0x18')](_0x357028[0x0][_0x5df6('0x15')]/_0x466759);var _0x3f0768=Number[_0x5df6('0x19')](_0x357028[0x0][_0x5df6('0x15')]/_0x466759)?_0x357028[0x0][_0x5df6('0x15')]%_0x466759:0x0;_0x1ec801[_0x5df6('0x1a')](function(_0x29ab31){if(_0x29ab31>0x0){_0x52fc11+=_0x466759;}_0x1e2dcf[_0x5df6('0x1b')](dbH[_0x5df6('0x10')]['query'](util[_0x5df6('0xb')](_0x5df6('0x1c'),QUERY,_0x466759,_0x52fc11),{'type':dbH[_0x5df6('0x10')][_0x5df6('0x13')][_0x5df6('0x14')]}));});if(_0x3f0768>0x0){_0x52fc11+=_0x466759;_0x1e2dcf['push'](dbH[_0x5df6('0x10')]['query'](util[_0x5df6('0xb')](_0x5df6('0x1c'),QUERY,_0x3f0768,_0x52fc11),{'type':dbH[_0x5df6('0x10')][_0x5df6('0x13')][_0x5df6('0x14')]}));}}}else{_0x1e2dcf[_0x5df6('0x1b')](dbH[_0x5df6('0x10')][_0x5df6('0x11')](QUERY,{'type':dbH[_0x5df6('0x10')][_0x5df6('0x13')][_0x5df6('0x14')]}));}var _0x6fee24=path[_0x5df6('0x1d')](PATH);var _0x5f28c2=path[_0x5df6('0x1e')](PATH,_0x5df6('0x1f'));var _0x1cc801=_0x3ec257[_0x5df6('0xd')]&&_0x1e2dcf['length']>0x1;var _0x24f8f0=[];if(!fs[_0x5df6('0x20')](path[_0x5df6('0x21')](_0x6fee24,_0x5f28c2))&&_0x1cc801){fs[_0x5df6('0x22')](path[_0x5df6('0x21')](_0x6fee24,_0x5f28c2));}return BPromise[_0x5df6('0x23')](_0x1e2dcf,function(_0x1d496d){_0x24f8f0[_0x5df6('0x1b')](_0x1d496d);})[_0x5df6('0xf')](function(){for(var _0x1f8298=0x0;_0x1f8298<_0x24f8f0[_0x5df6('0x17')];_0x1f8298+=0x1){var _0x46e5c5;var _0x5021ee=_0x24f8f0[_0x1f8298];if(_0x1cc801){_0x46e5c5=path[_0x5df6('0x21')](_0x6fee24,_0x5f28c2,util[_0x5df6('0xb')](_0x5df6('0x24'),_0x5f28c2,_0x1f8298,_0x5df6('0x25')));}else{_0x46e5c5=path[_0x5df6('0x21')](_0x6fee24,util[_0x5df6('0xb')](_0x5df6('0x26'),_0x5f28c2,_0x5df6('0x25')));}fs[_0x5df6('0x27')](_0x46e5c5,json2xls(_0x5021ee),_0x5df6('0x28'));}})[_0x5df6('0xf')](function(){if(_0x1cc801){return new Promise(function(_0x4b75f6){zipdir(path[_0x5df6('0x21')](_0x6fee24,_0x5f28c2),{'saveTo':path[_0x5df6('0x21')](_0x6fee24,util[_0x5df6('0xb')]('%s.%s',_0x5f28c2,_0x5df6('0x29')))},function(_0x2596e2,_0x5a8274){rimraf(path[_0x5df6('0x21')](_0x6fee24,_0x5f28c2),function(){});_0x4b75f6(_0x5df6('0x2a'));});});}})[_0x5df6('0xf')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x5df6('0x2b'),_0x1cc801?util['format'](_0x5df6('0x26'),_0x5f28c2,_0x1cc801?_0x5df6('0x29'):_0x5df6('0x25')):null);});})[_0x5df6('0x2c')](function(_0x5c2212){logger[_0x5df6('0x2d')](util['format'](_0x5df6('0x2e'),EXTRACTED_REPORT_ID,_0x5df6('0x2f')),util[_0x5df6('0x30')](_0x5c2212,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5df6('0x31'));})[_0x5df6('0x32')](function(){process[_0x5df6('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index a545c80..e892886 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 _0x5600=['uniq','map','exten','filter','groupBy','queue','hasOwnProperty','priority','extensions','extension','type','CDR(type)=%s','context','VoiceExtensionId','inbound','push','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','updatedAt','interval','*,*,*,*','tag','length','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}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','Hangup','concat','transaction','destroy','sortBy','catch','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId'];(function(_0x20f8d8,_0x458431){var _0x4ec832=function(_0x5bf1b5){while(--_0x5bf1b5){_0x20f8d8['push'](_0x20f8d8['shift']());}};_0x4ec832(++_0x458431);}(_0x5600,0x107));var _0x0560=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0x5600[_0x21c2c8];return _0x4dd745;};'use strict';var _=require(_0x0560('0x0'));var util=require(_0x0560('0x1'));function rewrite(_0xc29b17,_0xae0e1f){var _0x610ab6=this;return _0xc29b17[_0x0560('0x2')][_0x0560('0x3')][_0x0560('0x4')]({'raw':!![]})[_0x0560('0x5')](function(_0x223c76){_0x610ab6[_0x0560('0x6')]=_0x223c76;return _0xc29b17[_0x0560('0x2')][_0x0560('0x7')][_0x0560('0x4')]({'where':{'IntervalId':_0xae0e1f[_0x0560('0x8')]},'raw':!![]});})[_0x0560('0x5')](function(_0x1462a7){return _0xc29b17[_0x0560('0x2')][_0x0560('0x7')][_0x0560('0x4')]({'where':{'exten':{'$in':_[_0x0560('0x9')](_[_0x0560('0xa')](_0x1462a7,_0x0560('0xb')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x185af2){var _0x472fd1=_[_0x0560('0xc')](_0x185af2,{'priority':'1'});var _0x57ed77=_['filter'](_0x185af2,{'isApp':0x1});var _0x3df59b=_[_0x0560('0xd')](_0x57ed77,_0x0560('0xb'));var _0x31e89f=[_0x0560('0xe'),'playback'];var _0x3aebc4=[];var _0x3215c1=[];for(var _0x9649af in _0x3df59b){if(_0x3df59b[_0x0560('0xf')](_0x9649af)){_0x610ab6[_0x0560('0x10')]=0x2;_0x610ab6[_0x0560('0x11')]=[];_0x610ab6[_0x0560('0x12')]=_['find'](_0x472fd1,{'exten':_0x3df59b[_0x9649af][0x0]['exten']});_0x610ab6['extensions']['push']({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':'Set','appdata':util['format'](_0x0560('0x14'),_0x3df59b[_0x9649af][0x0][_0x0560('0x13')]),'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0]['exten'],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});if(_0x3df59b[_0x9649af][0x0][_0x0560('0x13')]===_0x0560('0x17')){_0x610ab6[_0x0560('0x11')][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':_0x0560('0x19'),'appdata':_0x0560('0x1a')+_0x3df59b[_0x9649af][0x0][_0x0560('0x16')],'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0]['VoiceExtensionId']});}else if(_0x3df59b[_0x9649af][0x0]['type']===_0x0560('0x1b')){if(_0x610ab6[_0x0560('0x12')]){_0x610ab6[_0x0560('0x11')]['push']({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':_0x0560('0x19'),'appdata':_0x0560('0x1c')+(_0x610ab6['extension'][_0x0560('0x1d')]?'${EXTEN:'+_0x610ab6['extension'][_0x0560('0x1d')]+'}':_0x0560('0x1e')),'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});}_0x610ab6[_0x0560('0x11')][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':'Set','appdata':_0x0560('0x1a')+_0x3df59b[_0x9649af][0x0][_0x0560('0x16')],'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0]['exten'],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});var _0x26ced8=_0x610ab6[_0x0560('0x10')]++;_0x610ab6['extensions']['push']({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':_0x0560('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x26ced8+0x2)+_0x0560('0x20')+(_0x26ced8+0x1)+')','context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x26ced8,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});if(_0x610ab6[_0x0560('0x12')]){_0x610ab6[_0x0560('0x11')][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':_0x0560('0x19'),'appdata':_0x610ab6[_0x0560('0x12')][_0x0560('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x610ab6[_0x0560('0x12')][_0x0560('0x1d')]+'}':_0x0560('0x21'),'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});}_0x610ab6[_0x0560('0x11')]['push']({'type':_0x3df59b[_0x9649af][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0x3df59b[_0x9649af][0x0][_0x0560('0x16')],'context':_0x3df59b[_0x9649af][0x0]['context'],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0]['VoiceExtensionId']});if(_0x610ab6[_0x0560('0x12')]&&_0x610ab6[_0x0560('0x12')][_0x0560('0xf')](_0x0560('0x22'))&&_0x610ab6['extension'][_0x0560('0x22')]!==_0x0560('0x23')){_0x610ab6[_0x0560('0x11')][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':_0x0560('0x19'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x610ab6['priority']++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});_0x610ab6[_0x0560('0x11')][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':'Set','appdata':_0x0560('0x24')+_0x610ab6['extension'][_0x0560('0x22')]||_0x0560('0x25'),'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x610ab6['priority']++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0]['VoiceExtensionId']});}}_0x610ab6[_0x0560('0x11')][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':_0x0560('0x19'),'appdata':_0x0560('0x26'),'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0]['exten'],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});_0x610ab6[_0x0560('0x11')][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':'Set','appdata':_0x0560('0x27'),'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0]['exten'],'priority':_0x610ab6['priority']++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});_0x610ab6[_0x0560('0x11')]['push']({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'priority':_0x610ab6[_0x0560('0x10')]++,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});for(var _0x3ccb87=0x0,_0xcc16a4=0x0;_0x3ccb87<_0x3df59b[_0x9649af]['length'];_0x3ccb87+=0x1,_0xcc16a4=0x0){var _0x2e927a=_0x3df59b[_0x9649af][_0x3ccb87];if(_0x2e927a[_0x0560('0x13')]){_0x2e927a['type']=_0x2e927a[_0x0560('0x13')][_0x0560('0x28')]();}var _0x3032fe=[];var _0x355868=[];delete _0x2e927a['id'];delete _0x2e927a['createdAt'];delete _0x2e927a[_0x0560('0x29')];var _0x1d3b74=_0x2e927a[_0x0560('0x2a')]!==_0x0560('0x2b')?[_0x2e927a[_0x0560('0x2a')]]:_0x2e927a[_0x0560('0x8')]?_['map'](_[_0x0560('0xc')](_0x610ab6['intervals'],{'IntervalId':_0x2e927a['IntervalId']}),_0x0560('0x2a')):[];if(_0x2e927a[_0x0560('0xf')]('tag')){if(_0x2e927a[_0x0560('0x2c')]&&_0x2e927a['tag']!=='--'){_0x3032fe['push']({'type':_0x2e927a[_0x0560('0x13')],'app':_0x0560('0x19'),'appdata':'CDR(tag)='+_0x2e927a[_0x0560('0x2c')],'context':_0x2e927a[_0x0560('0x15')],'exten':_0x2e927a[_0x0560('0xb')],'priority':_0x1d3b74[_0x0560('0x2d')]+_0x610ab6['priority']+_0xcc16a4++,'VoiceExtensionId':_0x2e927a[_0x0560('0x16')]});}}if(_0x2e927a[_0x0560('0x13')]==='outbound'&&_0x2e927a[_0x0560('0xf')](_0x0560('0x2e'))){if(_0x2e927a['callerID']){_0x3032fe[_0x0560('0x18')]({'type':_0x2e927a['type'],'app':_0x0560('0x1f'),'appdata':_0x0560('0x2f')+_0x2e927a[_0x0560('0x2e')]+')','context':_0x2e927a[_0x0560('0x15')],'exten':_0x2e927a['exten'],'priority':_0x1d3b74[_0x0560('0x2d')]+_0x610ab6['priority']+_0xcc16a4++,'VoiceExtensionId':_0x2e927a['VoiceExtensionId']});}else{_0x3032fe[_0x0560('0x18')]({'type':_0x2e927a[_0x0560('0x13')],'app':_0x0560('0x1f'),'appdata':_0x0560('0x30'),'context':_0x2e927a[_0x0560('0x15')],'exten':_0x2e927a['exten'],'priority':_0x1d3b74[_0x0560('0x2d')]+_0x610ab6[_0x0560('0x10')]+_0xcc16a4++,'VoiceExtensionId':_0x2e927a[_0x0560('0x16')]});}}if(_0x2e927a['hasOwnProperty'](_0x0560('0x31'))){if(_0x31e89f[_0x0560('0x32')](_0x2e927a[_0x0560('0x33')][_0x0560('0x28')]())>=0x0&&_0x2e927a[_0x0560('0x34')]!==_0x0560('0x35')){if(_0x2e927a[_0x0560('0x31')]){_0x3032fe['push']({'type':_0x2e927a['type'],'app':_0x0560('0x1f'),'appdata':_0x0560('0x36'),'context':_0x2e927a[_0x0560('0x15')],'exten':_0x2e927a['exten'],'priority':_0x1d3b74[_0x0560('0x2d')]+_0x610ab6['priority']+_0xcc16a4++,'VoiceExtensionId':_0x2e927a['VoiceExtensionId']});_0x3032fe['push']({'type':_0x2e927a['type'],'app':_0x0560('0x19'),'appdata':_0x0560('0x37'),'context':_0x2e927a['context'],'exten':_0x2e927a[_0x0560('0xb')],'priority':_0x1d3b74[_0x0560('0x2d')]+_0x610ab6[_0x0560('0x10')]+_0xcc16a4++,'VoiceExtensionId':_0x2e927a[_0x0560('0x16')]});}else{_0x3032fe[_0x0560('0x18')]({'type':_0x2e927a[_0x0560('0x13')],'app':_0x0560('0x1f'),'appdata':_0x0560('0x38'),'context':_0x2e927a[_0x0560('0x15')],'exten':_0x2e927a[_0x0560('0xb')],'priority':_0x1d3b74[_0x0560('0x2d')]+_0x610ab6[_0x0560('0x10')]+_0xcc16a4++,'VoiceExtensionId':_0x2e927a[_0x0560('0x16')]});_0x3032fe['push']({'type':_0x2e927a[_0x0560('0x13')],'app':_0x0560('0x19'),'appdata':_0x0560('0x39'),'context':_0x2e927a['context'],'exten':_0x2e927a['exten'],'priority':_0x1d3b74[_0x0560('0x2d')]+_0x610ab6[_0x0560('0x10')]+_0xcc16a4++,'VoiceExtensionId':_0x2e927a[_0x0560('0x16')]});}}}for(var _0x2d8c91=0x0;_0x2d8c91<_0x1d3b74[_0x0560('0x2d')];_0x2d8c91+=0x1){var _0x323360=_0x610ab6['priority']+_0x1d3b74['length'];var _0x221a16=_0x2d8c91===_0x1d3b74['length']-0x1?_0x610ab6['priority']+_0x3032fe[_0x0560('0x2d')]+_0x355868[_0x0560('0x2d')]+0x2:_0x610ab6[_0x0560('0x10')]+_0x2d8c91+0x1;_0x3032fe[_0x0560('0x3a')](_0x2d8c91,0x0,{'type':_0x2e927a['type'],'app':_0x0560('0x3b'),'appdata':_0x1d3b74[_0x2d8c91]+'?'+_0x2e927a['context']+_0x0560('0x3c')+_0x323360+':'+_0x2e927a['context']+',${EXTEN},'+_0x221a16,'exten':_0x2e927a['exten'],'context':_0x2e927a[_0x0560('0x15')],'priority':_0x610ab6[_0x0560('0x10')]+_0x2d8c91,'VoiceExtensionId':_0x3df59b[_0x9649af][0x0]['VoiceExtensionId']});}_0x2e927a['priority']=_0x3032fe[_0x0560('0x2d')]?_['last'](_0x3032fe)['priority']+0x1:_0x610ab6[_0x0560('0x10')];_0x610ab6['priority']=(_0x355868[_0x0560('0x2d')]?_['last'](_0x355868)[_0x0560('0x10')]:_0x2e927a[_0x0560('0x10')])+0x1;_0x610ab6[_0x0560('0x11')]=_['concat'](_0x610ab6[_0x0560('0x11')],_0x3032fe,[_0x2e927a],_0x355868);}_0x610ab6['extensions'][_0x0560('0x18')]({'type':_0x3df59b[_0x9649af][0x0][_0x0560('0x13')],'app':_0x0560('0x3d'),'exten':_0x3df59b[_0x9649af][0x0][_0x0560('0xb')],'context':_0x3df59b[_0x9649af][0x0][_0x0560('0x15')],'priority':_0x610ab6[_0x0560('0x10')],'VoiceExtensionId':_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]});_0x3aebc4[_0x0560('0x18')](_0x3df59b[_0x9649af][0x0][_0x0560('0x16')]);_0x3215c1=_[_0x0560('0x3e')](_0x3215c1,_0x610ab6[_0x0560('0x11')]);}}return _0xc29b17[_0x0560('0x3f')](function(_0x1753b1){return _0xc29b17['models'][_0x0560('0x7')][_0x0560('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x3aebc4}},'transaction':_0x1753b1})['then'](function(_0x34ebca){return _0xc29b17[_0x0560('0x2')]['VoiceExtension']['bulkCreate'](_[_0x0560('0x41')](_0x3215c1,_0x0560('0x10')),{'transaction':_0x1753b1});});});})[_0x0560('0x42')](function(_0x47f612){console[_0x0560('0x43')](_0x47f612);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x5173=['appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','catch','rewrite','util','Interval','then','models','VoiceExtension','findAll','IntervalId','uniq','map','exten','filter','groupBy','queue','hasOwnProperty','priority','extensions','extension','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','length','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase'];(function(_0x30bdff,_0x308063){var _0x1e7ca9=function(_0x1a6e16){while(--_0x1a6e16){_0x30bdff['push'](_0x30bdff['shift']());}};_0x1e7ca9(++_0x308063);}(_0x5173,0x9a));var _0x3517=function(_0x7106f,_0x3198a8){_0x7106f=_0x7106f-0x0;var _0x4eb56a=_0x5173[_0x7106f];return _0x4eb56a;};'use strict';var _=require('lodash');var util=require(_0x3517('0x0'));function rewrite(_0x42a62,_0x3e78f3){var _0x239d9c=this;return _0x42a62['models'][_0x3517('0x1')]['findAll']({'raw':!![]})[_0x3517('0x2')](function(_0x3c69b0){_0x239d9c['intervals']=_0x3c69b0;return _0x42a62[_0x3517('0x3')][_0x3517('0x4')][_0x3517('0x5')]({'where':{'IntervalId':_0x3e78f3[_0x3517('0x6')]},'raw':!![]});})[_0x3517('0x2')](function(_0x13353a){return _0x42a62['models'][_0x3517('0x4')]['findAll']({'where':{'exten':{'$in':_[_0x3517('0x7')](_[_0x3517('0x8')](_0x13353a,_0x3517('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x3517('0x2')](function(_0x5d6d7c){var _0x42c85b=_[_0x3517('0xa')](_0x5d6d7c,{'priority':'1'});var _0x4044bd=_[_0x3517('0xa')](_0x5d6d7c,{'isApp':0x1});var _0x1fa08f=_[_0x3517('0xb')](_0x4044bd,'exten');var _0x493848=[_0x3517('0xc'),'playback'];var _0xb9c3df=[];var _0x566a00=[];for(var _0x2a6e41 in _0x1fa08f){if(_0x1fa08f[_0x3517('0xd')](_0x2a6e41)){_0x239d9c[_0x3517('0xe')]=0x2;_0x239d9c[_0x3517('0xf')]=[];_0x239d9c[_0x3517('0x10')]=_['find'](_0x42c85b,{'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')]});_0x239d9c['extensions'][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':util[_0x3517('0x14')](_0x3517('0x15'),_0x1fa08f[_0x2a6e41][0x0]['type']),'context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});if(_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')]===_0x3517('0x18')){_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':_0x3517('0x19')+_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')],'context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0]['VoiceExtensionId']});}else if(_0x1fa08f[_0x2a6e41][0x0]['type']===_0x3517('0x1a')){if(_0x239d9c['extension']){_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':_0x3517('0x1b')+(_0x239d9c['extension'][_0x3517('0x1c')]?_0x3517('0x1d')+_0x239d9c[_0x3517('0x10')][_0x3517('0x1c')]+'}':'${EXTEN}'),'context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0]['exten'],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});}_0x239d9c[_0x3517('0xf')]['push']({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':'Set','appdata':_0x3517('0x19')+_0x1fa08f[_0x2a6e41][0x0]['VoiceExtensionId'],'context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c['priority']++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0]['VoiceExtensionId']});var _0x1d218e=_0x239d9c[_0x3517('0xe')]++;_0x239d9c[_0x3517('0xf')]['push']({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':'ExecIf','appdata':_0x3517('0x1e')+(_0x1d218e+0x2)+_0x3517('0x1f')+(_0x1d218e+0x1)+')','context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0]['exten'],'priority':_0x1d218e,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});if(_0x239d9c[_0x3517('0x10')]){_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':_0x239d9c['extension'][_0x3517('0x1c')]?_0x3517('0x20')+_0x239d9c[_0x3517('0x10')]['cutdigits']+'}':_0x3517('0x21'),'context':_0x1fa08f[_0x2a6e41][0x0]['context'],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});}_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0]['type'],'app':_0x3517('0x13'),'appdata':_0x3517('0x22')+_0x1fa08f[_0x2a6e41][0x0]['VoiceExtensionId'],'context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c['priority']++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});if(_0x239d9c['extension']&&_0x239d9c['extension'][_0x3517('0xd')](_0x3517('0x23'))&&_0x239d9c['extension'][_0x3517('0x23')]!==_0x3517('0x24')){_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':'Set','appdata':_0x3517('0x25'),'context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0]['VoiceExtensionId']});_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':_0x3517('0x26')+_0x239d9c[_0x3517('0x10')][_0x3517('0x23')]||_0x3517('0x27'),'context':_0x1fa08f[_0x2a6e41][0x0]['context'],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});}}_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':_0x3517('0x28'),'context':_0x1fa08f[_0x2a6e41][0x0]['context'],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});_0x239d9c[_0x3517('0xf')][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'exten':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x9')],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0]['VoiceExtensionId']});_0x239d9c['extensions'][_0x3517('0x11')]({'type':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x12')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x1fa08f[_0x2a6e41][0x0]['context'],'exten':_0x1fa08f[_0x2a6e41][0x0]['exten'],'priority':_0x239d9c[_0x3517('0xe')]++,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});for(var _0x2b0893=0x0,_0xffed4e=0x0;_0x2b0893<_0x1fa08f[_0x2a6e41][_0x3517('0x29')];_0x2b0893+=0x1,_0xffed4e=0x0){var _0x2f6cbf=_0x1fa08f[_0x2a6e41][_0x2b0893];if(_0x2f6cbf[_0x3517('0x12')]){_0x2f6cbf[_0x3517('0x12')]=_0x2f6cbf[_0x3517('0x12')]['toLowerCase']();}var _0x14cf19=[];var _0x4d61ca=[];delete _0x2f6cbf['id'];delete _0x2f6cbf[_0x3517('0x2a')];delete _0x2f6cbf[_0x3517('0x2b')];var _0x4c29f8=_0x2f6cbf[_0x3517('0x2c')]!==_0x3517('0x2d')?[_0x2f6cbf['interval']]:_0x2f6cbf['IntervalId']?_[_0x3517('0x8')](_['filter'](_0x239d9c[_0x3517('0x2e')],{'IntervalId':_0x2f6cbf[_0x3517('0x6')]}),_0x3517('0x2c')):[];if(_0x2f6cbf[_0x3517('0xd')](_0x3517('0x2f'))){if(_0x2f6cbf[_0x3517('0x2f')]&&_0x2f6cbf[_0x3517('0x2f')]!=='--'){_0x14cf19[_0x3517('0x11')]({'type':_0x2f6cbf[_0x3517('0x12')],'app':'Set','appdata':_0x3517('0x30')+_0x2f6cbf[_0x3517('0x2f')],'context':_0x2f6cbf['context'],'exten':_0x2f6cbf[_0x3517('0x9')],'priority':_0x4c29f8[_0x3517('0x29')]+_0x239d9c[_0x3517('0xe')]+_0xffed4e++,'VoiceExtensionId':_0x2f6cbf['VoiceExtensionId']});}}if(_0x2f6cbf['type']===_0x3517('0x1a')&&_0x2f6cbf['hasOwnProperty'](_0x3517('0x31'))){if(_0x2f6cbf[_0x3517('0x31')]){_0x14cf19['push']({'type':_0x2f6cbf['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2f6cbf[_0x3517('0x31')]+')','context':_0x2f6cbf[_0x3517('0x16')],'exten':_0x2f6cbf['exten'],'priority':_0x4c29f8[_0x3517('0x29')]+_0x239d9c[_0x3517('0xe')]+_0xffed4e++,'VoiceExtensionId':_0x2f6cbf[_0x3517('0x17')]});}else{_0x14cf19[_0x3517('0x11')]({'type':_0x2f6cbf[_0x3517('0x12')],'app':_0x3517('0x32'),'appdata':_0x3517('0x33'),'context':_0x2f6cbf[_0x3517('0x16')],'exten':_0x2f6cbf[_0x3517('0x9')],'priority':_0x4c29f8[_0x3517('0x29')]+_0x239d9c[_0x3517('0xe')]+_0xffed4e++,'VoiceExtensionId':_0x2f6cbf[_0x3517('0x17')]});}}if(_0x2f6cbf[_0x3517('0xd')](_0x3517('0x34'))){if(_0x493848[_0x3517('0x35')](_0x2f6cbf[_0x3517('0x36')][_0x3517('0x37')]())>=0x0&&_0x2f6cbf[_0x3517('0x38')]!==_0x3517('0x39')){if(_0x2f6cbf[_0x3517('0x34')]){_0x14cf19['push']({'type':_0x2f6cbf['type'],'app':_0x3517('0x32'),'appdata':_0x3517('0x3a'),'context':_0x2f6cbf[_0x3517('0x16')],'exten':_0x2f6cbf[_0x3517('0x9')],'priority':_0x4c29f8[_0x3517('0x29')]+_0x239d9c['priority']+_0xffed4e++,'VoiceExtensionId':_0x2f6cbf['VoiceExtensionId']});_0x14cf19[_0x3517('0x11')]({'type':_0x2f6cbf['type'],'app':_0x3517('0x13'),'appdata':_0x3517('0x3b'),'context':_0x2f6cbf[_0x3517('0x16')],'exten':_0x2f6cbf[_0x3517('0x9')],'priority':_0x4c29f8[_0x3517('0x29')]+_0x239d9c[_0x3517('0xe')]+_0xffed4e++,'VoiceExtensionId':_0x2f6cbf['VoiceExtensionId']});}else{_0x14cf19[_0x3517('0x11')]({'type':_0x2f6cbf['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2f6cbf[_0x3517('0x16')],'exten':_0x2f6cbf[_0x3517('0x9')],'priority':_0x4c29f8[_0x3517('0x29')]+_0x239d9c[_0x3517('0xe')]+_0xffed4e++,'VoiceExtensionId':_0x2f6cbf[_0x3517('0x17')]});_0x14cf19[_0x3517('0x11')]({'type':_0x2f6cbf[_0x3517('0x12')],'app':_0x3517('0x13'),'appdata':_0x3517('0x3c'),'context':_0x2f6cbf[_0x3517('0x16')],'exten':_0x2f6cbf['exten'],'priority':_0x4c29f8[_0x3517('0x29')]+_0x239d9c[_0x3517('0xe')]+_0xffed4e++,'VoiceExtensionId':_0x2f6cbf[_0x3517('0x17')]});}}}for(var _0x2c1fc3=0x0;_0x2c1fc3<_0x4c29f8[_0x3517('0x29')];_0x2c1fc3+=0x1){var _0x568b9a=_0x239d9c[_0x3517('0xe')]+_0x4c29f8[_0x3517('0x29')];var _0x45d32e=_0x2c1fc3===_0x4c29f8[_0x3517('0x29')]-0x1?_0x239d9c[_0x3517('0xe')]+_0x14cf19[_0x3517('0x29')]+_0x4d61ca[_0x3517('0x29')]+0x2:_0x239d9c[_0x3517('0xe')]+_0x2c1fc3+0x1;_0x14cf19[_0x3517('0x3d')](_0x2c1fc3,0x0,{'type':_0x2f6cbf[_0x3517('0x12')],'app':_0x3517('0x3e'),'appdata':_0x4c29f8[_0x2c1fc3]+'?'+_0x2f6cbf[_0x3517('0x16')]+_0x3517('0x3f')+_0x568b9a+':'+_0x2f6cbf[_0x3517('0x16')]+_0x3517('0x3f')+_0x45d32e,'exten':_0x2f6cbf['exten'],'context':_0x2f6cbf['context'],'priority':_0x239d9c[_0x3517('0xe')]+_0x2c1fc3,'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});}_0x2f6cbf[_0x3517('0xe')]=_0x14cf19[_0x3517('0x29')]?_[_0x3517('0x40')](_0x14cf19)['priority']+0x1:_0x239d9c[_0x3517('0xe')];_0x239d9c[_0x3517('0xe')]=(_0x4d61ca[_0x3517('0x29')]?_[_0x3517('0x40')](_0x4d61ca)[_0x3517('0xe')]:_0x2f6cbf[_0x3517('0xe')])+0x1;_0x239d9c[_0x3517('0xf')]=_[_0x3517('0x41')](_0x239d9c[_0x3517('0xf')],_0x14cf19,[_0x2f6cbf],_0x4d61ca);}_0x239d9c[_0x3517('0xf')]['push']({'type':_0x1fa08f[_0x2a6e41][0x0]['type'],'app':'Hangup','exten':_0x1fa08f[_0x2a6e41][0x0]['exten'],'context':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x16')],'priority':_0x239d9c[_0x3517('0xe')],'VoiceExtensionId':_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]});_0xb9c3df['push'](_0x1fa08f[_0x2a6e41][0x0][_0x3517('0x17')]);_0x566a00=_[_0x3517('0x41')](_0x566a00,_0x239d9c['extensions']);}}return _0x42a62[_0x3517('0x42')](function(_0x1201b3){return _0x42a62[_0x3517('0x3')][_0x3517('0x4')][_0x3517('0x43')]({'where':{'VoiceExtensionId':{'$in':_0xb9c3df}},'transaction':_0x1201b3})['then'](function(_0x2fc75c){return _0x42a62['models'][_0x3517('0x4')]['bulkCreate'](_['sortBy'](_0x566a00,'priority'),{'transaction':_0x1201b3});});});})[_0x3517('0x44')](function(_0x1f8e4e){console['error'](_0x1f8e4e);});}exports[_0x3517('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 9c61a28..ae48f19 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 _0x41cb=['outbound','CmList','BlackLists','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resolve','unlinkSync','stringify','exit','SIGINT','info','createReadStream','parse','pause','CSV\x20parse\x20error','util','lodash','squel','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','map','errors','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','length','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','id\x20IN\x20?','str','calleridnum','VoiceQueue','findAll','dialCheckDuplicateType','Lists','get','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','all'];(function(_0x1d6b19,_0x102ab0){var _0x5c7ec=function(_0x5f73b7){while(--_0x5f73b7){_0x1d6b19['push'](_0x1d6b19['shift']());}};_0x5c7ec(++_0x102ab0);}(_0x41cb,0x1a7));var _0xb41c=function(_0x48e4e7,_0x5101c5){_0x48e4e7=_0x48e4e7-0x0;var _0x3d306a=_0x41cb[_0x48e4e7];return _0x3d306a;};'use strict';var BPromise=require('bluebird');var util=require(_0xb41c('0x0'));var _=require(_0xb41c('0x1'));var fs=require('fs');var squel=require(_0xb41c('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xb41c('0x3'));config[_0xb41c('0x4')]=_[_0xb41c('0x5')](config[_0xb41c('0x4')],{'host':_0xb41c('0x6'),'port':0x18eb});var socket=require(_0xb41c('0x7'))(new Redis(config[_0xb41c('0x4')]));require(_0xb41c('0x8'))[_0xb41c('0x9')](socket);try{if(!process[_0xb41c('0xa')][0x2]||process[_0xb41c('0xa')][0x2]===_0xb41c('0xb')||process[_0xb41c('0xa')][0x2]===_0xb41c('0xc')){throw new Error(_0xb41c('0xd'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xb41c('0xb')||process[_0xb41c('0xa')][0x3]==='null'||!process[_0xb41c('0xa')][0x4]||process['argv'][0x4]===_0xb41c('0xb')||process[_0xb41c('0xa')][0x4]===_0xb41c('0xc')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xb41c('0xe')](process[_0xb41c('0xa')][0x3][_0xb41c('0xf')](','),process[_0xb41c('0xa')][0x4][_0xb41c('0xf')](','));if(!process['argv'][0x5]||process[_0xb41c('0xa')][0x5]===_0xb41c('0xb')||process[_0xb41c('0xa')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb41c('0xa')][0x5];var COMPANYID=process[_0xb41c('0xa')][0x6]&&process['argv'][0x6]!==_0xb41c('0xb')&&process[_0xb41c('0xa')][0x6]!==_0xb41c('0xc')?process[_0xb41c('0xa')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xb41c('0xa')][0x7]!==_0xb41c('0xb')&&process[_0xb41c('0xa')][0x7]!==_0xb41c('0xc')?process[_0xb41c('0xa')][0x7]:null;if(!process[_0xb41c('0xa')][0x8]||process[_0xb41c('0xa')][0x8]===_0xb41c('0xb')||process['argv'][0x8]===_0xb41c('0xc')){throw new Error(_0xb41c('0x10'));}var SOCKET_TIMESTAMP=process[_0xb41c('0xa')][0x8];}catch(_0x36f15a){logger[_0xb41c('0x11')](_0x36f15a);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(_0x224f6b,_0x63dc61,_0x23a8d3,_0xb86067){var _0x3b076e={'message':_0x63dc61};_0x3b076e[_0x224f6b]=!![];if(_0x23a8d3){_0x3b076e['contact']=_0x23a8d3;}if(_0xb86067){_0x3b076e[_0xb41c('0x12')]=_0xb86067;}return _0x3b076e;}function isEmail(_0x27f29a){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))*$/[_0xb41c('0x13')](_0x27f29a);}function checkRow(_0x2b73ec,_0x843276,_0x3df27c){return new BPromise(function(_0x37a7b9,_0x4f2aa9){if(_[_0xb41c('0x14')](_0x2b73ec)){return _0x4f2aa9(handleCheckRowError(_0xb41c('0x11'),_0xb41c('0x15'),null,_0x3df27c));}if(_0x2b73ec['errors']&&_0x2b73ec['errors']['length']){var _0x204e46=_[_0xb41c('0x16')](_0x2b73ec[_0xb41c('0x17')],'message')['join'](';');return _0x4f2aa9(handleCheckRowError(_0xb41c('0x11'),_0x204e46,null,_0x3df27c));}var _0x1e95e4={};for(var _0xe982b9 in FIELDS){if(FIELDS['hasOwnProperty'](_0xe982b9)&&FIELDS[_0xe982b9]){_0x1e95e4[_0xe982b9]=_0x2b73ec[_0xb41c('0x18')][0x0][FIELDS[_0xe982b9]]||_0x2b73ec[_0xb41c('0x18')][0x0]['\ufeff'+FIELDS[_0xe982b9]];}}if(!_0x1e95e4['firstName']){return _0x4f2aa9(handleCheckRowError(_0xb41c('0x11'),_0xb41c('0x19'),null,_0x3df27c));}if(!_0x1e95e4[_0xb41c('0x1a')]){return _0x4f2aa9(handleCheckRowError(_0xb41c('0x11'),_0xb41c('0x1b'),null,_0x3df27c));}if(_0x1e95e4[_0xb41c('0x1c')]){var _0x1035b6=moment(_0x1e95e4['birthDate'],_0xb41c('0x1d'));if(!_0x1035b6['isValid']()){return _0x4f2aa9(handleCheckRowError('error',_0xb41c('0x1e'),null,_0x3df27c));}}if(_0x1e95e4[_0xb41c('0x1f')]){if(!isEmail(_0x1e95e4['email'])){return _0x4f2aa9(handleCheckRowError(_0xb41c('0x11'),'email\x20format\x20is\x20not\x20valid!',null,_0x3df27c));}}_0x1e95e4[_0xb41c('0x20')]=LISTID;_0x1e95e4['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb41c('0x21')]&&_0x843276){var _0x2ebcc7={};for(var _0x5bdc39=0x0,_0x3ba449=DUPLICATES['length'];_0x5bdc39<_0x3ba449;_0x5bdc39+=0x1){_0x2ebcc7[DUPLICATES[_0x5bdc39]]=_0x1e95e4[DUPLICATES[_0x5bdc39]];}var _0x611a6=_[_0xb41c('0x22')](_0x843276,_0x2ebcc7);if(_0x611a6){return _0x4f2aa9(handleCheckRowError(_0xb41c('0x23'),_0xb41c('0x24'),_0x611a6,_0x3df27c));}}return db[_0xb41c('0x25')]['create'](_0x1e95e4,{'raw':!![],'hooks':![],'fields':_[_0xb41c('0x26')](_0x1e95e4)})[_0xb41c('0x27')](function(_0x4b4e25){if(DUPLICATES&&DUPLICATES[_0xb41c('0x21')]&&_0x843276){_0x843276['push'](_[_0xb41c('0x28')](_0x1e95e4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4b4e25['id'];return _0x37a7b9();})[_0xb41c('0x29')](function(_0x3b7a50){return _0x4f2aa9(handleCheckRowError(_0xb41c('0x11'),_0xb41c('0x2a')+(_0x3b7a50[_0xb41c('0x2b')]||JSON['stringify'](_0x3b7a50)),null,_0x3df27c));});});}function checkHopper(){function _0x5b551d(){return function(_0x452b64){logger[_0xb41c('0x11')](_0xb41c('0x2c'),_0xb41c('0x2d'),util[_0xb41c('0x2e')](_0x452b64,{'showHidden':![],'depth':null}));};}var _0x3c2a6b=function(_0x255ddd,_0x25e292){var _0x1fdc75=squel[_0xb41c('0x2f')]()[_0xb41c('0x30')](_0xb41c('0x31'))[_0xb41c('0x32')]([_0xb41c('0x1a'),_0xb41c('0x33'),_0xb41c('0x34'),'ListId',_0x25e292,_0xb41c('0x35'),_0xb41c('0x36')],squel[_0xb41c('0x37')]()[_0xb41c('0x38')](_0xb41c('0x1a'),_0xb41c('0x1a'))[_0xb41c('0x38')](_0xb41c('0x39'),_0xb41c('0x33'))[_0xb41c('0x38')]('id',_0xb41c('0x34'))[_0xb41c('0x38')](LISTID[_0xb41c('0x3a')](),'ListId')[_0xb41c('0x38')](_0x255ddd['id'][_0xb41c('0x3a')](),_0x25e292)[_0xb41c('0x38')](_0xb41c('0x39'),_0xb41c('0x35'))[_0xb41c('0x38')]('NOW()','updatedAt')['from'](_0xb41c('0x3b'))[_0xb41c('0x3c')](_0xb41c('0x3d'))['where'](_0xb41c('0x3e'),LISTID[_0xb41c('0x3a')]())['where'](_0xb41c('0x3f'))[_0xb41c('0x3c')](_0xb41c('0x40'),squel['select']()[_0xb41c('0x38')](_0xb41c('0x1a'))[_0xb41c('0x41')]('cm_hopper')[_0xb41c('0x3c')](_0x25e292+_0xb41c('0x42'),_0x255ddd['id'][_0xb41c('0x3a')]())))[_0xb41c('0x3a')]();return _0x1fdc75;};var _0xb8109c=function(_0x282d5f,_0x3c202a){var _0x207982=squel[_0xb41c('0x2f')]()[_0xb41c('0x30')](_0xb41c('0x31'))[_0xb41c('0x32')]([_0xb41c('0x1a'),'scheduledAt',_0xb41c('0x34'),_0xb41c('0x20'),_0x3c202a,_0xb41c('0x35'),_0xb41c('0x36')],squel[_0xb41c('0x37')]()[_0xb41c('0x38')](_0xb41c('0x1a'),_0xb41c('0x1a'))[_0xb41c('0x38')](_0xb41c('0x39'),_0xb41c('0x33'))[_0xb41c('0x38')]('id','ContactId')[_0xb41c('0x38')](LISTID[_0xb41c('0x3a')](),_0xb41c('0x20'))[_0xb41c('0x38')](_0x282d5f['id'][_0xb41c('0x3a')](),_0x3c202a)[_0xb41c('0x38')](_0xb41c('0x39'),_0xb41c('0x35'))['field'](_0xb41c('0x39'),_0xb41c('0x36'))['from'](_0xb41c('0x3b'))[_0xb41c('0x3c')](_0xb41c('0x3d'))['where'](_0xb41c('0x3e'),LISTID[_0xb41c('0x3a')]())[_0xb41c('0x3c')](_0xb41c('0x43'),squel[_0xb41c('0x44')](hopperContacts))[_0xb41c('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0xb41c('0x3c')](_0xb41c('0x40'),squel[_0xb41c('0x37')]()['field'](_0xb41c('0x45'))[_0xb41c('0x41')]('cm_hopper_final')[_0xb41c('0x3c')](_0x3c202a+_0xb41c('0x42'),_0x282d5f['id'][_0xb41c('0x3a')]()))[_0xb41c('0x3c')](_0xb41c('0x40'),squel[_0xb41c('0x37')]()[_0xb41c('0x38')]('phone')[_0xb41c('0x41')]('cm_hopper')[_0xb41c('0x3c')](_0x3c202a+_0xb41c('0x42'),_0x282d5f['id'][_0xb41c('0x3a')]())))[_0xb41c('0x3a')]();return _0x207982;};function _0x5e0809(_0x5c77d2,_0xfd460b){var _0xd4f53c=squel[_0xb41c('0x2f')]()['into']('cm_hopper')[_0xb41c('0x32')]([_0xb41c('0x1a'),'scheduledAt',_0xb41c('0x34'),'ListId',_0xfd460b,_0xb41c('0x35'),'updatedAt'],squel['select']()[_0xb41c('0x38')](_0xb41c('0x1a'),_0xb41c('0x1a'))[_0xb41c('0x38')](_0xb41c('0x39'),_0xb41c('0x33'))[_0xb41c('0x38')]('id',_0xb41c('0x34'))[_0xb41c('0x38')](LISTID['toString'](),'ListId')[_0xb41c('0x38')](_0x5c77d2['id'][_0xb41c('0x3a')](),_0xfd460b)['field']('NOW()',_0xb41c('0x35'))[_0xb41c('0x38')](_0xb41c('0x39'),_0xb41c('0x36'))[_0xb41c('0x41')](_0xb41c('0x3b'))[_0xb41c('0x3c')](_0xb41c('0x3d'))[_0xb41c('0x3c')](_0xb41c('0x3e'),LISTID[_0xb41c('0x3a')]())[_0xb41c('0x3c')](_0xb41c('0x43'),squel[_0xb41c('0x44')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb41c('0x3a')]();return _0xd4f53c;}function _0x20ee49(_0x478f3b,_0x4db20f){var _0x397cd9=squel[_0xb41c('0x2f')]()[_0xb41c('0x30')]('cm_hopper_black')[_0xb41c('0x32')]([_0xb41c('0x1a'),'ContactId',_0xb41c('0x20'),_0x4db20f,_0xb41c('0x35'),_0xb41c('0x36')],squel[_0xb41c('0x37')]()[_0xb41c('0x38')](_0xb41c('0x1a'),'phone')[_0xb41c('0x38')]('id',_0xb41c('0x34'))['field'](LISTID[_0xb41c('0x3a')](),_0xb41c('0x20'))[_0xb41c('0x38')](_0x478f3b['id'][_0xb41c('0x3a')](),_0x4db20f)[_0xb41c('0x38')]('NOW()',_0xb41c('0x35'))[_0xb41c('0x38')](_0xb41c('0x39'),_0xb41c('0x36'))['from'](_0xb41c('0x3b'))[_0xb41c('0x3c')]('deletedAt\x20IS\x20NULL')[_0xb41c('0x3c')]('ListId\x20=\x20?',LISTID[_0xb41c('0x3a')]())[_0xb41c('0x3c')](_0xb41c('0x43'),squel[_0xb41c('0x44')](hopperContacts))[_0xb41c('0x3c')](_0xb41c('0x3f')))[_0xb41c('0x3a')]();return _0x397cd9;}return db[_0xb41c('0x46')][_0xb41c('0x47')]({'where':{'type':'outbound'},'attributes':['id',_0xb41c('0x48')],'include':[{'model':db['CmList'],'as':_0xb41c('0x49'),'where':{'id':LISTID}}]})[_0xb41c('0x27')](function(_0x2644a7){var _0x3a92c2=[];if(_0x2644a7){var _0x2ee510;for(var _0x2c54ef=0x0,_0x5929a6;_0x2c54ef<_0x2644a7[_0xb41c('0x21')];_0x2c54ef+=0x1){_0x5929a6=_0x2644a7[_0x2c54ef][_0xb41c('0x4a')]({'plain':!![]});switch(_0x5929a6[_0xb41c('0x48')]){case _0xb41c('0x4b'):_0x3a92c2[_0xb41c('0x4c')](db[_0xb41c('0x4d')][_0xb41c('0x4e')](_0xb8109c(_0x5929a6,_0xb41c('0x4f')))[_0xb41c('0x27')](function(){})['catch'](_0x5b551d()));break;case _0xb41c('0x50'):_0x3a92c2[_0xb41c('0x4c')](db['sequelize'][_0xb41c('0x4e')](_0x3c2a6b(_0x5929a6,_0xb41c('0x4f')))[_0xb41c('0x27')](function(){})[_0xb41c('0x29')](_0x5b551d()));break;default:_0x3a92c2[_0xb41c('0x4c')](db['sequelize'][_0xb41c('0x4e')](_0x5e0809(_0x5929a6,_0xb41c('0x4f')))[_0xb41c('0x27')](function(){})['catch'](_0x5b551d()));}}}return _0x3a92c2;})[_0xb41c('0x51')]()['then'](function(){return db[_0xb41c('0x46')]['findAll']({'where':{'type':_0xb41c('0x52')},'attributes':['id'],'include':[{'model':db[_0xb41c('0x53')],'as':_0xb41c('0x54'),'where':{'id':LISTID}}]})[_0xb41c('0x27')](function(_0x33027f){var _0x35fb4a=[];if(_0x33027f){var _0xd3c4f9;for(var _0x3ad66d=0x0,_0xf0e178;_0x3ad66d<_0x33027f[_0xb41c('0x21')];_0x3ad66d+=0x1){_0xf0e178=_0x33027f[_0x3ad66d][_0xb41c('0x4a')]({'plain':!![]});_0x35fb4a[_0xb41c('0x4c')](db['sequelize']['query'](_0x20ee49(_0xf0e178,_0xb41c('0x4f')))[_0xb41c('0x27')](function(){})[_0xb41c('0x29')](_0x5b551d()));}}return _0x35fb4a;})[_0xb41c('0x51')]();})[_0xb41c('0x27')](function(){return db[_0xb41c('0x55')][_0xb41c('0x47')]({'attributes':['id',_0xb41c('0x48')],'include':[{'model':db['CmList'],'as':_0xb41c('0x49'),'where':{'id':LISTID}}]})[_0xb41c('0x27')](function(_0x202251){var _0x43529f=[];if(_0x202251){for(var _0x52cdf3=0x0,_0x49a69c;_0x52cdf3<_0x202251[_0xb41c('0x21')];_0x52cdf3+=0x1){_0x49a69c=_0x202251[_0x52cdf3][_0xb41c('0x4a')]({'plain':!![]});switch(_0x49a69c[_0xb41c('0x48')]){case _0xb41c('0x4b'):_0x43529f[_0xb41c('0x4c')](db[_0xb41c('0x4d')][_0xb41c('0x4e')](_0xb8109c(_0x49a69c,_0xb41c('0x56')))[_0xb41c('0x27')](function(){})[_0xb41c('0x29')](_0x5b551d()));break;case'onlyIfOpen':_0x43529f[_0xb41c('0x4c')](db[_0xb41c('0x4d')]['query'](_0x3c2a6b(_0x49a69c,_0xb41c('0x56')))[_0xb41c('0x27')](function(){})[_0xb41c('0x29')](_0x5b551d()));break;default:_0x43529f[_0xb41c('0x4c')](db['sequelize'][_0xb41c('0x4e')](_0x5e0809(_0x49a69c,_0xb41c('0x56')))[_0xb41c('0x27')](function(){})[_0xb41c('0x29')](_0x5b551d()));}}}return _0x43529f;})[_0xb41c('0x51')]();})[_0xb41c('0x27')](function(){return db[_0xb41c('0x55')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xb41c('0x53')],'as':_0xb41c('0x54'),'where':{'id':LISTID}}]})[_0xb41c('0x27')](function(_0x294351){var _0x104d7e=[];if(_0x294351){for(var _0x2373ed=0x0,_0x6c5aa8;_0x2373ed<_0x294351[_0xb41c('0x21')];_0x2373ed+=0x1){_0x6c5aa8=_0x294351[_0x2373ed][_0xb41c('0x4a')]({'plain':!![]});_0x104d7e[_0xb41c('0x4c')](db[_0xb41c('0x4d')][_0xb41c('0x4e')](_0x20ee49(_0x6c5aa8,_0xb41c('0x56')))['then'](function(){})[_0xb41c('0x29')](_0x5b551d()));}}return _0x104d7e;})[_0xb41c('0x51')]();})[_0xb41c('0x29')](function(_0x43eef5){logger[_0xb41c('0x11')]('cmContact,\x20%s,\x20%s',_0xb41c('0x57'),_0x43eef5[_0xb41c('0x2b')]);});}var processPromises=function(_0x528107){return BPromise[_0xb41c('0x51')](promises)[_0xb41c('0x27')](function(_0x2b060e){})[_0xb41c('0x29')](function(_0x301253){logger[_0xb41c('0x11')](_0xb41c('0x58'),JSON['stringify'](_0x301253));})['finally'](function(){socket[_0xb41c('0x59')](_0xb41c('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x528107){return _0x528107['resume']();}});};var endCsv=function(){return BPromise[_0xb41c('0x5b')]()[_0xb41c('0x27')](function(){if(hopperContacts){return checkHopper();}})[_0xb41c('0x27')](function(){socket[_0xb41c('0x59')](_0xb41c('0x5a')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb41c('0x5c')](FILEPATH);}catch(_0xe581e6){logger[_0xb41c('0x11')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xb41c('0x5d')](_0xe581e6));}finally{process[_0xb41c('0x5e')](0x0);}});};process['on'](_0xb41c('0x5f'),function(){logger[_0xb41c('0x60')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xb41c('0x5b')]()[_0xb41c('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb41c('0xf')](',');return db[_0xb41c('0x25')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb41c('0x27')](function(_0x18bbd2){var _0x36c671=fs[_0xb41c('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb41c('0x62')](_0x36c671,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4d6cb0,_0x51565a){total+=0x1;var _0x157c1b=total;promises[_0xb41c('0x4c')](checkRow(_0x4d6cb0,_0x18bbd2,_0x157c1b)[_0xb41c('0x27')](function(){success+=0x1;})[_0xb41c('0x29')](function(_0x20c1b1){if(_0x20c1b1['error']){errors+=0x1;delete _0x20c1b1[_0xb41c('0x11')];}else if(_0x20c1b1[_0xb41c('0x23')]){duplicates+=0x1;delete _0x20c1b1[_0xb41c('0x23')];}rows[_0xb41c('0x4c')](_0x20c1b1);}));if(total%0xc8===0x0){_0x51565a[_0xb41c('0x63')]();return processPromises(_0x51565a);}},'complete':function(){return processPromises()[_0xb41c('0x27')](function(){logger[_0xb41c('0x60')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x267e00,_0x40dcc6){logger[_0xb41c('0x60')](_0xb41c('0x64'),JSON[_0xb41c('0x5d')](_0x267e00));endCsv();}});})[_0xb41c('0x29')](function(_0x394bdc){logger[_0xb41c('0x11')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xb41c('0x5d')](_0x394bdc));});}main(); \ No newline at end of file +var _0x618b=['where','phone\x20IS\x20NOT\x20NULL','insert','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','outbound','all','Campaign','Lists','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','finally','resume','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','pause','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','duplicate','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','ListId','from','cm_contacts','ListId\x20=\x20?','toString'];(function(_0x548089,_0x3d9aec){var _0x36ba08=function(_0x432e90){while(--_0x432e90){_0x548089['push'](_0x548089['shift']());}};_0x36ba08(++_0x3d9aec);}(_0x618b,0x95));var _0xb618=function(_0x4ea756,_0x41b54b){_0x4ea756=_0x4ea756-0x0;var _0x1faa00=_0x618b[_0x4ea756];return _0x1faa00;};'use strict';var BPromise=require(_0xb618('0x0'));var util=require(_0xb618('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xb618('0x2'));var Papa=require(_0xb618('0x3'));var Redis=require(_0xb618('0x4'));var db=require(_0xb618('0x5'))['db'];var config=require(_0xb618('0x6'));var logger=require(_0xb618('0x7'))(_0xb618('0x8'));config[_0xb618('0x9')]=_['defaults'](config[_0xb618('0x9')],{'host':_0xb618('0xa'),'port':0x18eb});var socket=require(_0xb618('0xb'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0xb618('0xc')](socket);try{if(!process[_0xb618('0xd')][0x2]||process['argv'][0x2]===_0xb618('0xe')||process['argv'][0x2]===_0xb618('0xf')){throw new Error(_0xb618('0x10'));}var FILEPATH=process[_0xb618('0xd')][0x2];if(!process['argv'][0x3]||process[_0xb618('0xd')][0x3]===_0xb618('0xe')||process[_0xb618('0xd')][0x3]==='null'||!process[_0xb618('0xd')][0x4]||process['argv'][0x4]===_0xb618('0xe')||process[_0xb618('0xd')][0x4]==='null'){throw new Error(_0xb618('0x11'));}var FIELDS=_[_0xb618('0x12')](process[_0xb618('0xd')][0x3][_0xb618('0x13')](','),process[_0xb618('0xd')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xb618('0xe')||process['argv'][0x5]===_0xb618('0xf')){throw new Error(_0xb618('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb618('0xd')][0x6]!==_0xb618('0xe')&&process['argv'][0x6]!=='null'?process[_0xb618('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xb618('0xd')][0x7]!==_0xb618('0xe')&&process[_0xb618('0xd')][0x7]!==_0xb618('0xf')?process[_0xb618('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0xb618('0xd')][0x8]===_0xb618('0xe')||process[_0xb618('0xd')][0x8]===_0xb618('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x1a1737){logger['error'](_0x1a1737);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(_0x14ed7f,_0x4e5e6e,_0xad234,_0x3c0984){var _0x37b00c={'message':_0x4e5e6e};_0x37b00c[_0x14ed7f]=!![];if(_0xad234){_0x37b00c[_0xb618('0x15')]=_0xad234;}if(_0x3c0984){_0x37b00c[_0xb618('0x16')]=_0x3c0984;}return _0x37b00c;}function isEmail(_0x3fb485){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))*$/[_0xb618('0x17')](_0x3fb485);}function checkRow(_0x488469,_0x2aab93,_0x4b7974){return new BPromise(function(_0x3c4e7d,_0x36f0b5){if(_[_0xb618('0x18')](_0x488469)){return _0x36f0b5(handleCheckRowError(_0xb618('0x19'),_0xb618('0x1a'),null,_0x4b7974));}if(_0x488469['errors']&&_0x488469[_0xb618('0x1b')][_0xb618('0x1c')]){var _0x498de3=_['map'](_0x488469['errors'],_0xb618('0x1d'))[_0xb618('0x1e')](';');return _0x36f0b5(handleCheckRowError(_0xb618('0x19'),_0x498de3,null,_0x4b7974));}var _0x3ee69c={};for(var _0x487aad in FIELDS){if(FIELDS[_0xb618('0x1f')](_0x487aad)&&FIELDS[_0x487aad]){_0x3ee69c[_0x487aad]=_0x488469[_0xb618('0x20')][0x0][FIELDS[_0x487aad]]||_0x488469[_0xb618('0x20')][0x0]['\ufeff'+FIELDS[_0x487aad]];}}if(!_0x3ee69c[_0xb618('0x21')]){return _0x36f0b5(handleCheckRowError('error',_0xb618('0x22'),null,_0x4b7974));}if(!_0x3ee69c[_0xb618('0x23')]){return _0x36f0b5(handleCheckRowError(_0xb618('0x19'),'phone\x20not\x20specified!',null,_0x4b7974));}if(_0x3ee69c['birthDate']){var _0x4233d8=moment(_0x3ee69c['birthDate'],_0xb618('0x24'));if(!_0x4233d8[_0xb618('0x25')]()){return _0x36f0b5(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4b7974));}}if(_0x3ee69c[_0xb618('0x26')]){if(!isEmail(_0x3ee69c[_0xb618('0x26')])){return _0x36f0b5(handleCheckRowError(_0xb618('0x19'),_0xb618('0x27'),null,_0x4b7974));}}_0x3ee69c['ListId']=LISTID;_0x3ee69c['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb618('0x1c')]&&_0x2aab93){var _0x3ee917={};for(var _0x471815=0x0,_0x3d4335=DUPLICATES[_0xb618('0x1c')];_0x471815<_0x3d4335;_0x471815+=0x1){_0x3ee917[DUPLICATES[_0x471815]]=_0x3ee69c[DUPLICATES[_0x471815]];}var _0x4b8fa6=_['find'](_0x2aab93,_0x3ee917);if(_0x4b8fa6){return _0x36f0b5(handleCheckRowError(_0xb618('0x28'),'Duplicate\x20Contact',_0x4b8fa6,_0x4b7974));}}return db[_0xb618('0x29')][_0xb618('0x2a')](_0x3ee69c,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3ee69c)})[_0xb618('0x2b')](function(_0x38bd71){if(DUPLICATES&&DUPLICATES['length']&&_0x2aab93){_0x2aab93[_0xb618('0x2c')](_[_0xb618('0x2d')](_0x3ee69c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x38bd71['id'];return _0x3c4e7d();})[_0xb618('0x2e')](function(_0x2a10c5){return _0x36f0b5(handleCheckRowError(_0xb618('0x19'),_0xb618('0x2f')+(_0x2a10c5[_0xb618('0x1d')]||JSON[_0xb618('0x30')](_0x2a10c5)),null,_0x4b7974));});});}function checkHopper(){function _0x5482f7(){return function(_0x2b70c2){logger[_0xb618('0x19')](_0xb618('0x31'),_0xb618('0x32'),util[_0xb618('0x33')](_0x2b70c2,{'showHidden':![],'depth':null}));};}var _0x4b4de0=function(_0x1a1e3b,_0x428864){var _0x44aab9=squel['insert']()[_0xb618('0x34')](_0xb618('0x35'))[_0xb618('0x36')](['phone',_0xb618('0x37'),'ContactId','ListId',_0x428864,_0xb618('0x38'),_0xb618('0x39')],squel[_0xb618('0x3a')]()['field']('phone',_0xb618('0x23'))[_0xb618('0x3b')](_0xb618('0x3c'),'scheduledAt')[_0xb618('0x3b')]('id',_0xb618('0x3d'))[_0xb618('0x3b')](LISTID['toString'](),_0xb618('0x3e'))['field'](_0x1a1e3b['id']['toString'](),_0x428864)['field'](_0xb618('0x3c'),_0xb618('0x38'))[_0xb618('0x3b')]('NOW()',_0xb618('0x39'))[_0xb618('0x3f')](_0xb618('0x40'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xb618('0x41'),LISTID[_0xb618('0x42')]())[_0xb618('0x43')](_0xb618('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xb618('0x3a')]()[_0xb618('0x3b')](_0xb618('0x23'))[_0xb618('0x3f')](_0xb618('0x35'))['where'](_0x428864+'\x20=\x20?',_0x1a1e3b['id']['toString']())))['toString']();return _0x44aab9;};var _0x174e15=function(_0x24459b,_0x510427){var _0x38b7cf=squel[_0xb618('0x45')]()[_0xb618('0x34')](_0xb618('0x35'))[_0xb618('0x36')]([_0xb618('0x23'),_0xb618('0x37'),_0xb618('0x3d'),_0xb618('0x3e'),_0x510427,_0xb618('0x38'),_0xb618('0x39')],squel['select']()['field'](_0xb618('0x23'),_0xb618('0x23'))['field'](_0xb618('0x3c'),_0xb618('0x37'))[_0xb618('0x3b')]('id',_0xb618('0x3d'))[_0xb618('0x3b')](LISTID['toString'](),'ListId')['field'](_0x24459b['id'][_0xb618('0x42')](),_0x510427)['field'](_0xb618('0x3c'),_0xb618('0x38'))['field'](_0xb618('0x3c'),_0xb618('0x39'))[_0xb618('0x3f')]('cm_contacts')['where'](_0xb618('0x46'))['where'](_0xb618('0x41'),LISTID[_0xb618('0x42')]())[_0xb618('0x43')](_0xb618('0x47'),squel[_0xb618('0x48')](hopperContacts))[_0xb618('0x43')](_0xb618('0x44'))[_0xb618('0x43')](_0xb618('0x49'),squel[_0xb618('0x3a')]()[_0xb618('0x3b')](_0xb618('0x4a'))[_0xb618('0x3f')]('cm_hopper_final')['where'](_0x510427+_0xb618('0x4b'),_0x24459b['id'][_0xb618('0x42')]()))[_0xb618('0x43')](_0xb618('0x49'),squel[_0xb618('0x3a')]()[_0xb618('0x3b')](_0xb618('0x23'))[_0xb618('0x3f')](_0xb618('0x35'))[_0xb618('0x43')](_0x510427+_0xb618('0x4b'),_0x24459b['id']['toString']())))[_0xb618('0x42')]();return _0x38b7cf;};function _0x1c3b8a(_0x2a0505,_0x42bfd4){var _0x5af4e7=squel[_0xb618('0x45')]()[_0xb618('0x34')](_0xb618('0x35'))[_0xb618('0x36')](['phone','scheduledAt',_0xb618('0x3d'),_0xb618('0x3e'),_0x42bfd4,_0xb618('0x38'),_0xb618('0x39')],squel[_0xb618('0x3a')]()[_0xb618('0x3b')](_0xb618('0x23'),_0xb618('0x23'))[_0xb618('0x3b')](_0xb618('0x3c'),'scheduledAt')['field']('id',_0xb618('0x3d'))['field'](LISTID[_0xb618('0x42')](),_0xb618('0x3e'))[_0xb618('0x3b')](_0x2a0505['id']['toString'](),_0x42bfd4)[_0xb618('0x3b')](_0xb618('0x3c'),_0xb618('0x38'))[_0xb618('0x3b')](_0xb618('0x3c'),_0xb618('0x39'))[_0xb618('0x3f')](_0xb618('0x40'))[_0xb618('0x43')](_0xb618('0x46'))[_0xb618('0x43')](_0xb618('0x41'),LISTID['toString']())[_0xb618('0x43')](_0xb618('0x47'),squel['str'](hopperContacts))[_0xb618('0x43')](_0xb618('0x44')))[_0xb618('0x42')]();return _0x5af4e7;}function _0x5b4da6(_0x36a8f5,_0x3fe3e1){var _0x204694=squel['insert']()[_0xb618('0x34')](_0xb618('0x4c'))[_0xb618('0x36')](['phone',_0xb618('0x3d'),'ListId',_0x3fe3e1,_0xb618('0x38'),_0xb618('0x39')],squel[_0xb618('0x3a')]()[_0xb618('0x3b')](_0xb618('0x23'),_0xb618('0x23'))['field']('id','ContactId')[_0xb618('0x3b')](LISTID['toString'](),_0xb618('0x3e'))[_0xb618('0x3b')](_0x36a8f5['id'][_0xb618('0x42')](),_0x3fe3e1)[_0xb618('0x3b')](_0xb618('0x3c'),_0xb618('0x38'))[_0xb618('0x3b')](_0xb618('0x3c'),_0xb618('0x39'))[_0xb618('0x3f')](_0xb618('0x40'))[_0xb618('0x43')](_0xb618('0x46'))[_0xb618('0x43')](_0xb618('0x41'),LISTID[_0xb618('0x42')]())['where']('id\x20IN\x20?',squel[_0xb618('0x48')](hopperContacts))[_0xb618('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xb618('0x42')]();return _0x204694;}return db[_0xb618('0x4d')][_0xb618('0x4e')]({'where':{'type':'outbound'},'attributes':['id',_0xb618('0x4f')],'include':[{'model':db[_0xb618('0x50')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x42d47a){var _0xbc2054=[];if(_0x42d47a){var _0xd6250d;for(var _0x56c611=0x0,_0x52738d;_0x56c611<_0x42d47a['length'];_0x56c611+=0x1){_0x52738d=_0x42d47a[_0x56c611][_0xb618('0x51')]({'plain':!![]});switch(_0x52738d[_0xb618('0x4f')]){case _0xb618('0x52'):_0xbc2054['push'](db[_0xb618('0x53')][_0xb618('0x54')](_0x174e15(_0x52738d,_0xb618('0x55')))['then'](function(){})['catch'](_0x5482f7()));break;case _0xb618('0x56'):_0xbc2054[_0xb618('0x2c')](db['sequelize'][_0xb618('0x54')](_0x4b4de0(_0x52738d,'VoiceQueueId'))[_0xb618('0x2b')](function(){})[_0xb618('0x2e')](_0x5482f7()));break;default:_0xbc2054['push'](db[_0xb618('0x53')][_0xb618('0x54')](_0x1c3b8a(_0x52738d,'VoiceQueueId'))[_0xb618('0x2b')](function(){})[_0xb618('0x2e')](_0x5482f7()));}}}return _0xbc2054;})['all']()['then'](function(){return db[_0xb618('0x4d')][_0xb618('0x4e')]({'where':{'type':_0xb618('0x57')},'attributes':['id'],'include':[{'model':db[_0xb618('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb618('0x2b')](function(_0x164f16){var _0x46e306=[];if(_0x164f16){var _0x56e8f7;for(var _0x4e0f2e=0x0,_0x5179ea;_0x4e0f2e<_0x164f16[_0xb618('0x1c')];_0x4e0f2e+=0x1){_0x5179ea=_0x164f16[_0x4e0f2e][_0xb618('0x51')]({'plain':!![]});_0x46e306[_0xb618('0x2c')](db[_0xb618('0x53')]['query'](_0x5b4da6(_0x5179ea,_0xb618('0x55')))['then'](function(){})[_0xb618('0x2e')](_0x5482f7()));}}return _0x46e306;})[_0xb618('0x58')]();})[_0xb618('0x2b')](function(){return db[_0xb618('0x59')]['findAll']({'attributes':['id',_0xb618('0x4f')],'include':[{'model':db[_0xb618('0x50')],'as':_0xb618('0x5a'),'where':{'id':LISTID}}]})[_0xb618('0x2b')](function(_0x436995){var _0x430e12=[];if(_0x436995){for(var _0xbc7e95=0x0,_0x3dd206;_0xbc7e95<_0x436995['length'];_0xbc7e95+=0x1){_0x3dd206=_0x436995[_0xbc7e95][_0xb618('0x51')]({'plain':!![]});switch(_0x3dd206[_0xb618('0x4f')]){case _0xb618('0x52'):_0x430e12['push'](db[_0xb618('0x53')][_0xb618('0x54')](_0x174e15(_0x3dd206,_0xb618('0x5b')))['then'](function(){})[_0xb618('0x2e')](_0x5482f7()));break;case _0xb618('0x56'):_0x430e12['push'](db[_0xb618('0x53')][_0xb618('0x54')](_0x4b4de0(_0x3dd206,'CampaignId'))[_0xb618('0x2b')](function(){})[_0xb618('0x2e')](_0x5482f7()));break;default:_0x430e12[_0xb618('0x2c')](db[_0xb618('0x53')][_0xb618('0x54')](_0x1c3b8a(_0x3dd206,_0xb618('0x5b')))[_0xb618('0x2b')](function(){})[_0xb618('0x2e')](_0x5482f7()));}}}return _0x430e12;})['all']();})[_0xb618('0x2b')](function(){return db[_0xb618('0x59')][_0xb618('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xb618('0x50')],'as':_0xb618('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x1a862c){var _0x578b8e=[];if(_0x1a862c){for(var _0x290327=0x0,_0x42a535;_0x290327<_0x1a862c[_0xb618('0x1c')];_0x290327+=0x1){_0x42a535=_0x1a862c[_0x290327][_0xb618('0x51')]({'plain':!![]});_0x578b8e['push'](db[_0xb618('0x53')][_0xb618('0x54')](_0x5b4da6(_0x42a535,_0xb618('0x5b')))[_0xb618('0x2b')](function(){})[_0xb618('0x2e')](_0x5482f7()));}}return _0x578b8e;})[_0xb618('0x58')]();})[_0xb618('0x2e')](function(_0x2ee77f){logger[_0xb618('0x19')](_0xb618('0x5d'),'generalCheckHopper',_0x2ee77f['message']);});}var processPromises=function(_0x38a42c){return BPromise[_0xb618('0x58')](promises)[_0xb618('0x2b')](function(_0x434f16){})[_0xb618('0x2e')](function(_0x2a8f2f){logger[_0xb618('0x19')]('Error\x20processing\x20rows\x20block:',JSON[_0xb618('0x30')](_0x2a8f2f));})[_0xb618('0x5e')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x38a42c){return _0x38a42c[_0xb618('0x5f')]();}});};var endCsv=function(){return BPromise[_0xb618('0x60')]()[_0xb618('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0xb618('0x2b')](function(){socket[_0xb618('0x61')](_0xb618('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb618('0x63')](FILEPATH);}catch(_0x3fae72){logger[_0xb618('0x19')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xb618('0x30')](_0x3fae72));}finally{process[_0xb618('0x64')](0x0);}});};process['on'](_0xb618('0x65'),function(){logger['info'](_0xb618('0x66'));endCsv();});function main(){return BPromise[_0xb618('0x60')]()[_0xb618('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb618('0x13')](',');return db[_0xb618('0x29')][_0xb618('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x25e27e){var _0x3872dd=fs[_0xb618('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x3872dd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x332da4,_0x9a86b5){total+=0x1;var _0x2cd65b=total;promises[_0xb618('0x2c')](checkRow(_0x332da4,_0x25e27e,_0x2cd65b)[_0xb618('0x2b')](function(){success+=0x1;})[_0xb618('0x2e')](function(_0x209741){if(_0x209741['error']){errors+=0x1;delete _0x209741[_0xb618('0x19')];}else if(_0x209741[_0xb618('0x28')]){duplicates+=0x1;delete _0x209741[_0xb618('0x28')];}rows[_0xb618('0x2c')](_0x209741);}));if(total%0xc8===0x0){_0x9a86b5[_0xb618('0x68')]();return processPromises(_0x9a86b5);}},'complete':function(){return processPromises()['then'](function(){logger[_0xb618('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x34f060,_0x3a1d6d){logger[_0xb618('0x69')](_0xb618('0x6a'),JSON[_0xb618('0x30')](_0x34f060));endCsv();}});})[_0xb618('0x2e')](function(_0x350c01){logger[_0xb618('0x19')](_0xb618('0x6b'),JSON[_0xb618('0x30')](_0x350c01));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 0a6125e..40a32bf 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 _0x543c=['message','exit','errors','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','start','clone','root','server/files/tmp','.csv','header','ContactItemType','name','_description','AdditionalPhones','writeFileSync','parse','createReadStream','find','hasOwnProperty','data','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','itemTypeId','description','replace','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','CampaignId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','squel','../../../config/environment','../../../config/environment/shared','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','then','length','push','all','split','isNil','filter','findOne','update','updated','CmContactHasItem','create','PHONE','inserted','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','insert','cm_hopper_black','ContactId','.CmListId\x20=\x20?','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','fromQuery','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error'];(function(_0x479188,_0x505a1c){var _0x466b0d=function(_0x57c2c8){while(--_0x57c2c8){_0x479188['push'](_0x479188['shift']());}};_0x466b0d(++_0x505a1c);}(_0x543c,0x10f));var _0xc543=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0x543c[_0x15bbf1];return _0x5c4b47;};'use strict';var fs=require('fs');var path=require(_0xc543('0x0'));var _=require(_0xc543('0x1'));var Papa=require('papaparse');var util=require(_0xc543('0x2'));var BPromise=require(_0xc543('0x3'));var moment=require('moment');var squel=require(_0xc543('0x4'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xc543('0x5'));var shared=require(_0xc543('0x6'));var logger=require('../../../config/logger')('import');config[_0xc543('0x7')]=_['defaults'](config[_0xc543('0x7')],{'host':_0xc543('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xc543('0x9')](_0xc543('0xa'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xc543('0x9')](_0xc543('0xa'));function isEmail(_0x3d2788){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))*$/[_0xc543('0xb')](_0x3d2788);}function selectNotIn(_0x2b9f75,_0xe01c7e,_0x17ed7d,_0x1c9649,_0x49a539){return squel[_0xc543('0xc')]()[_0xc543('0xd')](_0xc543('0xe'))[_0xc543('0xf')](_0x1c9649)['join'](_0xe01c7e,null,_0xe01c7e+_0xc543('0x10')+_0x1c9649+'.'+_0x17ed7d)[_0xc543('0x11')](_0x1c9649+'.'+_0x17ed7d+_0xc543('0x12')+_0x2b9f75+'.'+_0x17ed7d)['where'](_0xe01c7e+_0xc543('0x13')+_0x49a539[_0xc543('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x31a61b,_0x5e0c5c){promisesAdditionalPhones=[];return db[_0xc543('0x15')][_0xc543('0x16')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xc543('0x17')](function(_0x3f63c1){if(_0x3f63c1!==null){var _0x169b57=[];for(var _0x47a6f4=0x0;_0x47a6f4<_0x3f63c1[_0xc543('0x18')];_0x47a6f4++){var _0x1d76fa=_0x3f63c1[_0x47a6f4];_0x169b57[_0xc543('0x19')](insertAdditionalPhones(_0x1d76fa));}}Promise[_0xc543('0x1a')](_0x169b57)['then'](function(){_0x31a61b({'val':0x1});});});});}function insertAdditionalPhones(_0x1c8711){return new Promise(function(_0x295362,_0x2a3ea6){var _0x46fa59=_0x1c8711['AdditionalPhones'];var _0xbe96d4=_0x46fa59[_0xc543('0x1b')](';');var _0x465cf3=[];orderBy=0x0;for(var _0x589f57=0x0;_0x589f57<_0xbe96d4[_0xc543('0x18')];_0x589f57++){_0x465cf3[_0xc543('0x19')](splitAdditionalPhone(_0x1c8711['id'],_0xbe96d4[_0x589f57]));}Promise['all'](_0x465cf3)[_0xc543('0x17')](function(){_0x295362({'val':_0xbe96d4['length']});});});}function splitAdditionalPhone(_0x387cea,_0x55267e){return new Promise(function(_0x217b28,_0x4d2db6){var _0x176701=_0x55267e[_0xc543('0x1b')](':');var _0x5b21aa=_0x176701[0x0];var _0x414939=_0x176701[0x1];if(!_[_0xc543('0x1c')](_0x414939)){var _0x424bf9=_0x414939[_0xc543('0x1b')]('|');var _0x257e5f=[];for(var _0x1d95b0=0x0;_0x1d95b0<_0x424bf9['length'];_0x1d95b0++){if(_0x424bf9[_0x1d95b0]!==''){var _0x12b423=_[_0xc543('0x1d')](promisesAdditionalPhones,{'contactId':_0x387cea,'phone':_0x424bf9[_0x1d95b0]});if(_0x12b423['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x387cea,'contactTypeId':_0x5b21aa,'phone':_0x424bf9[_0x1d95b0],'orderBy':orderBy});}}}_0x217b28({'ok':0x1});}else _0x217b28({'res':0x0});});}function createAdditionalPhone(_0x495ec6,_0x574a20,_0x2e2293,_0x5e1df0){var _0x2988e5='';var _0x1e1a73='';var _0x406778=_0x2e2293['split']('§');_0x2988e5=_0x406778[0x0];if(_0x406778[_0xc543('0x18')]==0x2)_0x1e1a73=_0x406778[0x1];return new Promise(function(_0x321be8,_0x530a59){return db['CmContactHasItem'][_0xc543('0x1e')]({'where':{'CmContactId':_0x495ec6,'item':_0x2988e5}})['then'](function(_0x273efd){if(_0x273efd){return db['CmContactHasItem'][_0xc543('0x1f')]({'ItemTypeId':_0x574a20,'description':_0x1e1a73,'OrderBy':_0x5e1df0},{'where':{'CmContactId':_0x495ec6,'item':_0x2988e5}})[_0xc543('0x17')](function(_0x13a9fa){_0x321be8({'res':_0xc543('0x20')});});}else{return db[_0xc543('0x21')][_0xc543('0x22')]({'CmContactId':_0x495ec6,'item':_0x2988e5,'description':_0x1e1a73,'ItemTypeId':_0x574a20,'OrderBy':_0x5e1df0,'ItemClass':_0xc543('0x23')})[_0xc543('0x17')](function(_0x5749f9){_0x321be8({'res':_0xc543('0x24')});});}});});}function insertCmHopper(_0x28babd,_0x577e2d,_0x1011a6,_0x3f3780,_0x3c3c94){var _0x3b77a4=['cm_contacts.phone','cm_contacts.scheduledat',_0xc543('0x25'),_0xc543('0x26'),_0x577e2d+'.'+_0x3f3780,_0xc543('0x27'),_0xc543('0x28'),_0xc543('0x29'),_0xc543('0x2a'),'\x22'+_0x3c3c94+'\x22'];return squel['insert']()[_0xc543('0x2b')](_0xc543('0x2c'))['fromQuery']([_0xc543('0xe'),_0xc543('0x2d'),'ContactId',_0xc543('0x2e'),_0x3f3780,_0xc543('0x2f'),_0xc543('0x30'),_0xc543('0x31'),_0xc543('0x32'),_0xc543('0x33')],squel[_0xc543('0xc')]()[_0xc543('0x34')](_0x3b77a4)[_0xc543('0xf')](_0x577e2d)[_0xc543('0x14')](_0xc543('0x35'),null,_0xc543('0x36')+_0x577e2d+_0xc543('0x37'))[_0xc543('0x14')](_0x1011a6,null,_0x1011a6+_0xc543('0x10')+_0x577e2d+'.'+_0x3f3780)[_0xc543('0x11')](_0x577e2d+'.CmListId\x20=\x20?',_0x28babd)[_0xc543('0x11')](_0xc543('0x38'),NOW)[_0xc543('0x11')](_0xc543('0x39'),selectNotIn(_0x577e2d,_0x1011a6,_0x3f3780,'cm_hopper',[_0xc543('0x3a'),_0xc543('0x3b')]))[_0xc543('0x11')](_0xc543('0x39'),selectNotIn(_0x577e2d,_0x1011a6,_0x3f3780,_0xc543('0x2c'),[_0xc543('0x3a')])))['toString']();}function insertCmHopperBlack(_0x25eebb,_0x456450,_0x68cc09,_0x5207b5){var _0x34323b=[_0xc543('0x3c'),_0xc543('0x25'),_0xc543('0x26'),_0x456450+'.'+_0x5207b5,_0xc543('0x27'),'cm_contacts.updatedAt'];return squel[_0xc543('0x3d')]()[_0xc543('0x2b')](_0xc543('0x3e'))['fromQuery'](['phone',_0xc543('0x3f'),'ListId',_0x5207b5,_0xc543('0x2f'),'updatedAt'],squel[_0xc543('0xc')]()['fields'](_0x34323b)[_0xc543('0xf')](_0x456450)[_0xc543('0x14')]('cm_contacts',null,_0xc543('0x36')+_0x456450+_0xc543('0x37'))['join'](_0x68cc09,null,_0x68cc09+_0xc543('0x10')+_0x456450+'.'+_0x5207b5)['where'](_0x456450+_0xc543('0x40'),_0x25eebb)['where'](_0xc543('0x38'),NOW)['where'](_0xc543('0x39'),squel[_0xc543('0xc')]()['field'](_0xc543('0xe'))[_0xc543('0xf')](_0xc543('0x3e'))[_0xc543('0x11')](_0xc543('0x41'),_0x25eebb)[_0xc543('0x11')](_0x5207b5+'\x20=\x20'+_0x456450+'.'+_0x5207b5)))[_0xc543('0x42')]();}function insertTzCmHopper(_0x907e1,_0xb66d4a,_0x38f2ac,_0x9a4df4,_0xb19c39,_0x437a53){var _0x3cabdd=[_0xc543('0x3c'),_0xc543('0x43')+_0x437a53+_0xc543('0x44'),_0xc543('0x25'),_0xc543('0x26'),_0xb66d4a+'.'+_0x9a4df4,_0xc543('0x27'),_0xc543('0x28'),'cm_contacts.priority',_0xc543('0x2a'),'\x22'+_0xb19c39+'\x22'];var _0x13cc88=squel['insert']()[_0xc543('0x2b')](_0xc543('0x2c'))[_0xc543('0x45')]([_0xc543('0xe'),_0xc543('0x2d'),_0xc543('0x3f'),'ListId',_0x9a4df4,_0xc543('0x2f'),'updatedAt','priority',_0xc543('0x32'),_0xc543('0x33')],squel['select']()[_0xc543('0x34')](_0x3cabdd)['from'](_0xb66d4a)[_0xc543('0x14')](_0xc543('0x35'),null,_0xc543('0x36')+_0xb66d4a+'.CmListId')[_0xc543('0x14')](_0x38f2ac,null,_0x38f2ac+'.id\x20=\x20'+_0xb66d4a+'.'+_0x9a4df4)[_0xc543('0x14')](_0x437a53,null,_0x437a53+_0xc543('0x10')+_0xb66d4a+'.'+_0x9a4df4)[_0xc543('0x11')](_0xb66d4a+'.CmListId\x20=\x20?',_0x907e1)[_0xc543('0x11')](_0xc543('0x38'),NOW)[_0xc543('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xb66d4a,_0x38f2ac,_0x9a4df4,_0xc543('0x2c'),['\x22always\x22',_0xc543('0x3b')]))[_0xc543('0x11')](_0xc543('0x39'),selectNotIn(_0xb66d4a,_0x38f2ac,_0x9a4df4,_0xc543('0x2c'),['\x22always\x22'])))[_0xc543('0x42')]();return _0x13cc88;}function insertTzCmHopperBlack(_0x530064,_0x557ef5,_0xa1f498,_0x3154be){var _0x3c4c1e=[_0xc543('0x3c'),'cm_contacts.id',_0xc543('0x26'),_0x557ef5+'.'+_0x3154be,_0xc543('0x27'),_0xc543('0x28')];return squel['insert']()[_0xc543('0x2b')](_0xc543('0x3e'))[_0xc543('0x45')](['phone','ContactId','ListId',_0x3154be,_0xc543('0x2f'),_0xc543('0x30')],squel[_0xc543('0xc')]()[_0xc543('0x34')](_0x3c4c1e)['from'](_0x557ef5)[_0xc543('0x14')](_0xc543('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x557ef5+_0xc543('0x37'))['join'](_0xa1f498,null,_0xa1f498+_0xc543('0x10')+_0x557ef5+'.'+_0x3154be)[_0xc543('0x11')](_0x557ef5+_0xc543('0x40'),_0x530064)[_0xc543('0x11')](_0xc543('0x38'),NOW)[_0xc543('0x11')](_0xc543('0x39'),squel[_0xc543('0xc')]()['field'](_0xc543('0xe'))[_0xc543('0xf')]('cm_hopper_black')[_0xc543('0x11')](_0xc543('0x41'),_0x530064)[_0xc543('0x11')](_0x3154be+_0xc543('0x12')+_0x557ef5+'.'+_0x3154be)))['toString']();}function insertCmHopperAdditionalPhones(_0x5f30e6){var _0x2328d6=['cm_hopper.id',_0xc543('0x46'),'cm_contact_has_items.OrderBy',_0xc543('0x47'),_0xc543('0x48')];return squel['insert']()[_0xc543('0x2b')](_0xc543('0x49'))[_0xc543('0x45')]([_0xc543('0x4a'),_0xc543('0xe'),_0xc543('0x4b'),_0xc543('0x2f'),_0xc543('0x30')],squel[_0xc543('0xc')]()[_0xc543('0x34')](_0x2328d6)[_0xc543('0xf')](_0xc543('0x2c'))[_0xc543('0x14')](_0xc543('0x35'),null,_0xc543('0x4c'))[_0xc543('0x14')](_0xc543('0x4d'),null,_0xc543('0x4e'))[_0xc543('0x11')](_0xc543('0x4f'),_0x5f30e6)[_0xc543('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xc543('0x42')]();}function insertCmContact(_0x323dc5,_0x39baf2,_0x7128db,_0x1c1d3b){var _0x291196=_[_0xc543('0x50')](_[_0xc543('0x51')](_0x1c1d3b),[_0xc543('0x2e'),'CompanyId',_0xc543('0x2f'),_0xc543('0x30')]);return squel['insert']()[_0xc543('0x2b')](_0xc543('0x35'))[_0xc543('0x45')](_0x291196,squel[_0xc543('0xc')]()[_0xc543('0x34')](_0x291196)[_0xc543('0xf')](_0x39baf2)[_0xc543('0x11')]('('+_0x7128db[_0xc543('0x14')](',')+_0xc543('0x52'),squel[_0xc543('0xc')]()['fields'](_0x7128db)[_0xc543('0xf')](_0xc543('0x35'))[_0xc543('0x11')](_0xc543('0x41'),_0x323dc5)[_0xc543('0x11')](_0xc543('0x53')))['where'](_0xc543('0x54'),squel[_0xc543('0xc')]()['field'](_0xc543('0x55'),_0xc543('0x56'))[_0xc543('0xf')](_0x39baf2)[_0xc543('0x57')](_0x7128db['join'](','))))['toString']();}function handleStop(){logger[_0xc543('0x58')](_0xc543('0x59'));stopped=!![];}function handleUncaughtException(_0x418910){logger[_0xc543('0x5a')](_0x418910[_0xc543('0x5b')]);process[_0xc543('0x5c')](0x1);}function handleError(_0x1a7c08,_0x119a4d){stats[_0xc543('0x5d')]['push']({'name':_0x119a4d[_0xc543('0x5e')],'message':_0x119a4d[_0xc543('0x5b')],'row':_0x1a7c08});}function handleQuery(_0x23f0e1){logger[_0xc543('0x58')](_0x23f0e1);return db[_0xc543('0x5f')][_0xc543('0x60')](_0x23f0e1)[_0xc543('0x61')](function(_0x90fa73){results['push'](_0x90fa73);})[_0xc543('0x62')](function(_0x3962df){logger['error'](_0x3962df[_0xc543('0x5b')]);});}function updateTzCampaigns(_0x31e37a){return new Promise(function(_0x702945,_0x26c6ee){var _0x40d0e4=squel[_0xc543('0xc')]()[_0xc543('0x34')]([_0xc543('0x63'),_0xc543('0x64')])['from'](_0xc543('0x65'))['join'](_0xc543('0x66'),null,_0xc543('0x67'))['where']('campaigns_has_cm_lists.CmListId='+_0x31e37a);db['sequelize'][_0xc543('0x60')](_0x40d0e4[_0xc543('0x42')]())['spread'](function(_0xd76122){var _0x4ea5d0=[];for(var _0x59619b=0x0;_0x59619b<_0xd76122[_0xc543('0x18')];_0x59619b++){_0x4ea5d0[_0xc543('0x19')](getTimezoneData(_0xd76122[_0x59619b],tmp_campaigns));}BPromise[_0xc543('0x1a')](_0x4ea5d0)['then'](function(){_0x702945({'val':0x1});});})[_0xc543('0x62')](function(_0xc19bfc){logger[_0xc543('0x5a')](_0xc19bfc[_0xc543('0x5b')]);_0x702945({'val':0x0});});});}function updateTzVoiceQueues(_0x4cfbbd){return new Promise(function(_0x116bb0,_0x489a06){var _0x1b0c4d=squel[_0xc543('0xc')]()[_0xc543('0x34')]([_0xc543('0x68'),_0xc543('0x69')])[_0xc543('0xf')](_0xc543('0x6a'))[_0xc543('0x14')]('voice_queues_has_cm_lists',null,_0xc543('0x6b'))['where'](_0xc543('0x6c')+_0x4cfbbd);db[_0xc543('0x5f')][_0xc543('0x60')](_0x1b0c4d[_0xc543('0x42')]())['spread'](function(_0x5a49d2){var _0x42907f=[];for(var _0x12aba2=0x0;_0x12aba2<_0x5a49d2[_0xc543('0x18')];_0x12aba2++){_0x42907f[_0xc543('0x19')](getTimezoneData(_0x5a49d2[_0x12aba2],tmp_voice_queues));}BPromise['all'](_0x42907f)[_0xc543('0x17')](function(){_0x116bb0({'val':0x1});});})['catch'](function(_0x51514a){logger['error'](_0x51514a['message']);_0x116bb0({'val':0x0});});});}function getTimezoneData(_0x4d1611,_0x5f385e){return new Promise(function(_0x20dc9b,_0x5bd8e9){var _0x1a5797=shared[_0xc543('0x6d')];var _0x1e86fa=_0x1a5797[_0x4d1611[_0xc543('0x6e')]];if(_['isNil'](_0x1e86fa)){_0x20dc9b({'ret':0x1});}else{var _0x45bd6a=_0x1e86fa[_0xc543('0x6f')];var _0x520e3a=squel[_0xc543('0x3d')]()[_0xc543('0x2b')](_0x5f385e)['set']('id',_0x4d1611['id'])[_0xc543('0x70')](_0xc543('0x71'),_0x45bd6a)[_0xc543('0x70')](_0xc543('0x6e'),_0x4d1611[_0xc543('0x6e')])[_0xc543('0x42')]();return db['sequelize'][_0xc543('0x60')](_0x520e3a)[_0xc543('0x61')](function(_0x1d2b51){_0x20dc9b({'ret':0x1});})[_0xc543('0x62')](function(_0x4834e1){logger['error'](_0x4834e1[_0xc543('0x5b')]);_0x5bd8e9({'ret':0x1});});}});}function handleTZQuery(_0x372c46){logger[_0xc543('0x58')](_0x372c46);return db['sequelize']['query'](_0x372c46)['spread'](function(_0x445042){})[_0xc543('0x62')](function(_0x283b5c){logger[_0xc543('0x5a')](_0x283b5c[_0xc543('0x5b')]);});}function main(_0x3bcb40,_0xbc44ee,_0x1de74d,_0x366f79){logger['info'](_0xc543('0x72'),_0x3bcb40,JSON[_0xc543('0x73')](_0xbc44ee));process[_0xc543('0x74')](_0xc543('0x75'));var _0x27a2cb=_0xbc44ee['binding'];var _0x4bb8af=_[_0xc543('0x76')](_0x27a2cb);var _0x213614=_0xbc44ee['socket_timestamp'];var _0x585f71=path['join'](config[_0xc543('0x77')],_0xc543('0x78'),_0x213614+_0xc543('0x79'));hasTZ=_['keys'](_0x27a2cb)['includes']('dialTimezone');var _0x1749ea=_['keys'](_0x27a2cb)[_0xc543('0x14')]();logger[_0xc543('0x58')](_0xc543('0x7a'),_0x1749ea);db[_0xc543('0x7b')][_0xc543('0x16')]({'raw':!![],'attributes':['id',_0xc543('0x7c')]})[_0xc543('0x17')](function(_0x4e6331){for(var _0xd0887d=0x0;_0xd0887d<_0x4e6331['length'];_0xd0887d++){if(_0x4e6331[_0xd0887d][_0xc543('0x7c')]in _0x27a2cb){contactItemTypes[_0xc543('0x19')](_0x4e6331[_0xd0887d]);delete _0x4bb8af[_0x4e6331[_0xd0887d][_0xc543('0x7c')]];hasAdditionalPhones=!![];}for(var _0x2575c0 in _0x27a2cb){if(_0x4e6331[_0xd0887d][_0xc543('0x7c')]+_0xc543('0x7d')===_0x2575c0){phoneDescriptions[_0xc543('0x19')]({'itemTypeId':_0x4e6331[_0xd0887d]['id'],'description':_0x2575c0});delete _0x4bb8af[_0x2575c0];}}}if(hasAdditionalPhones)_0x4bb8af[_0xc543('0x7e')]='';var _0x1fe09b=_[_0xc543('0x51')](_0x4bb8af)[_0xc543('0x14')]();logger[_0xc543('0x58')](_0xc543('0x7a'),_0x1fe09b);fs[_0xc543('0x7f')](_0x585f71,_0x1fe09b+'\x0a');Papa[_0xc543('0x80')](fs[_0xc543('0x81')](_0x3bcb40),{'header':!![],'skipEmptyLines':!![],'step':function(_0x20b27c,_0x3b66f8){try{for(var _0x53ba35=0x0,_0x2c6e26=[];_0x53ba35<_0x20b27c['data']['length'];_0x53ba35++){stats['rows']+=0x1;if(_0x20b27c['errors'][_0x53ba35]){handleError(_0x20b27c['data'][_0x53ba35],_0x20b27c['errors'][_0x53ba35]);}else{var _0x585e8d=[];var _0x51ba20=[];var _0x4ce3e8={};for(var _0x4353b2 in _0x27a2cb){let _0xefe624=contactItemTypes['find'](_0x74019f=>_0x74019f[_0xc543('0x7c')]===_0x4353b2);let _0xc58f17=contactItemTypes[_0xc543('0x82')](_0x51343d=>_0x51343d[_0xc543('0x7c')]+_0xc543('0x7d')===_0x4353b2);if(_[_0xc543('0x1c')](_0xefe624)&&_[_0xc543('0x1c')](_0xc58f17)){if(_0x27a2cb[_0xc543('0x83')](_0x4353b2)){if(_0x20b27c['data'][_0x53ba35][_0x27a2cb[_0x4353b2]]){var _0x13909e=_['trim'](_0x20b27c[_0xc543('0x84')][_0x53ba35][_0x27a2cb[_0x4353b2]]['replace'](/"/g,'\x27'));switch(_0x4353b2){case _0xc543('0x2d'):var _0xdee0b7=moment(_0x13909e,_0xc543('0xa'),!![]);if(_0xdee0b7['isValid']()){_0x2c6e26[_0xc543('0x19')]('\x22'+_0x13909e+'\x22');}else{_0x585e8d[_0xc543('0x19')](_0xc543('0x85'));}break;case'priority':var _0x421577=parseInt(_0x13909e);_0x13909e=_['isNaN'](_0x421577)||_0x421577<0x0||_0x421577>0x4?_0x366f79?0x3:0x2:_0x421577;_0x2c6e26[_0xc543('0x19')]('\x22'+_0x13909e+'\x22');break;case _0xc543('0x32'):var _0x603e57=parseInt(_0x13909e);if(_[_0xc543('0x86')](_0x603e57)&&_[_0xc543('0x87')](_0x1de74d,_0x603e57)){_0x2c6e26[_0xc543('0x19')]('\x22'+_0x603e57+'\x22');}else{_0x585e8d['push'](_0xc543('0x88'));}break;case _0xc543('0x89'):if(isEmail(_0x13909e)){_0x2c6e26[_0xc543('0x19')]('\x22'+_0x13909e+'\x22');}else{_0x585e8d[_0xc543('0x19')]('email\x20wrong\x20format');}break;case _0xc543('0x8a'):var _0x25a5b1=moment(_0x13909e,_0xc543('0x8b'),!![]);if(_0x25a5b1[_0xc543('0x8c')]()){_0x2c6e26[_0xc543('0x19')]('\x22'+_0x13909e+'\x22');}else{_0x585e8d[_0xc543('0x19')](_0xc543('0x8d'));}break;case _0xc543('0x6e'):var _0xe5e21c=shared['timezones'];var _0x11b0d8=_0xe5e21c[_0x13909e];if(!_[_0xc543('0x1c')](_0x11b0d8)){var _0x37ed6d=_0x11b0d8[_0xc543('0x6f')];_0x2c6e26[_0xc543('0x19')]('\x22'+_0x13909e+'\x22');_0x2c6e26[_0xc543('0x19')]('\x22'+_0x37ed6d+'\x22');}break;default:_0x2c6e26['push']('\x22'+_0x13909e+'\x22');}}else{switch(_0x4353b2){case _0xc543('0x8e'):case'phone':_0x585e8d[_0xc543('0x19')](_0x4353b2+_0xc543('0x8f'));break;default:_0x2c6e26[_0xc543('0x19')]('\x22\x22');}}}}else{var _0x3237b1='';if(!_[_0xc543('0x1c')](_0xefe624)){if(!_0x4ce3e8['hasOwnProperty'](_0xefe624['id'])){if(!_[_0xc543('0x1c')](_0x20b27c[_0xc543('0x84')][_0x53ba35][_0x27a2cb[_0x4353b2]])){var _0x13909e=_[_0xc543('0x90')](_0x20b27c['data'][_0x53ba35][_0x27a2cb[_0x4353b2]]['replace'](/"/g,'\x27'));var _0x21b890=phoneDescriptions[_0xc543('0x82')](_0x55903e=>_0x55903e[_0xc543('0x91')]===_0xefe624['id']);if(!_[_0xc543('0x1c')](_0x21b890)){var _0x531980=_[_0xc543('0x90')](_0x20b27c[_0xc543('0x84')][_0x53ba35][_0x27a2cb[_0x21b890[_0xc543('0x92')]]][_0xc543('0x93')](/"/g,'\x27'));if(!_[_0xc543('0x1c')](_0x531980))_0x13909e=_0x13909e+'§'+_0x531980;}if(_0x3237b1=='')_0x3237b1=_0x13909e;else _0x3237b1+='|'+_0x13909e;}_0x51ba20[_0xc543('0x19')](_0xefe624['id']+':'+_0x3237b1);_0x4ce3e8[_0xefe624['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2c6e26[_0xc543('0x19')]('\x22'+_0x51ba20[_0xc543('0x14')](';')+'\x22');}if(_0x585e8d[_0xc543('0x18')]){handleError(_0x20b27c[_0xc543('0x84')][_0x53ba35],{'code':'SystemRow','message':_0x585e8d[_0xc543('0x14')]()});}else{fs[_0xc543('0x94')](_0x585f71,_0x2c6e26[_0xc543('0x14')]()+'\x0a');}_0x2c6e26=[];}if(!(stats['rows']%0xc8)){socket[_0xc543('0x95')](_0xc543('0x96')+_0x213614,stats);stats['errors']=[];}}if(stopped){logger[_0xc543('0x58')](_0xc543('0x97'));_0x3b66f8[_0xc543('0x98')]();}}catch(_0x1b3bfb){handleError(_0x20b27c[_0xc543('0x84')][_0x53ba35],{'code':_0xc543('0x99'),'message':_0x1b3bfb[_0xc543('0x5b')]});logger['error'](_0xc543('0x9a'),_0x1b3bfb[_0xc543('0x5b')]);}},'complete':function(){try{var _0x3aecf6=[];var _0x1f0afe=[];var _0x253485=_0xc543('0x35');if(_0xbc44ee[_0xc543('0x9b')]&&_0xbc44ee['duplicates'][_0xc543('0x18')]){_0x253485='cm_contacts_'+_0x213614;_0x3aecf6['push'](_0xc543('0x9c')+_0x253485+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xc543('0x9d')+_0x213614;tmp_voice_queues='voice_queues_'+_0x213614;_0x1f0afe['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0xc543('0x9e'));_0x1f0afe[_0xc543('0x19')](_0xc543('0x9c')+tmp_voice_queues+_0xc543('0x9e'));BPromise[_0xc543('0x9f')](_0x1f0afe,handleTZQuery)[_0xc543('0x17')](function(_0x297c4f){updateTzCampaigns(_0xbc44ee[_0xc543('0x2e')])[_0xc543('0x17')](function(_0x51d701){updateTzVoiceQueues(_0xbc44ee['ListId'])[_0xc543('0x17')](function(_0x7e5f3c){if(hasTZ)_0x1fe09b=_0x1fe09b['replace'](_0xc543('0x6e'),'dialTimezone,utcOffset');var _0x3ffd19=util[_0xc543('0x9')]('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',_0x585f71,_0x253485,_0x1fe09b,_0xbc44ee[_0xc543('0x2e')],_0xbc44ee[_0xc543('0xa0')]||null,NOW,NOW);if(_[_0xc543('0x1c')](_0x27a2cb[_0xc543('0x2d')])){_0x3ffd19+=_0xc543('0xa1');}_0x3aecf6[_0xc543('0x19')](_0x3ffd19);if(_0xbc44ee[_0xc543('0x9b')]&&_0xbc44ee[_0xc543('0x9b')][_0xc543('0x18')]){_0x3aecf6['push'](insertCmContact(_0xbc44ee[_0xc543('0x2e')],_0x253485,_0xbc44ee[_0xc543('0x9b')],_0x27a2cb));_0x3aecf6['push'](_0xc543('0xa2')+_0x253485+';');}BPromise[_0xc543('0x9f')](_0x3aecf6,handleQuery)['then'](function(_0x201297){BPromise[_0xc543('0x1a')]([handleAdditionalPhones()])['then'](function(){_0x3aecf6=[];for(var _0x284e17=0x0;_0x284e17_0x44a8d6[_0x22e8('0x76')]===_0x1ed433);let _0x1f935a=contactItemTypes[_0x22e8('0x7b')](_0x21b7e3=>_0x21b7e3['name']+_0x22e8('0x7c')===_0x1ed433);if(_[_0x22e8('0x1e')](_0x2c89c0)&&_['isNil'](_0x1f935a)){if(_0x4200a0['hasOwnProperty'](_0x1ed433)){if(_0x116aa2['data'][_0xe8cb9b][_0x4200a0[_0x1ed433]]){var _0x1b5f19=_[_0x22e8('0x7d')](_0x116aa2['data'][_0xe8cb9b][_0x4200a0[_0x1ed433]][_0x22e8('0x7e')](/"/g,'\x27'));switch(_0x1ed433){case'scheduledat':var _0x484194=moment(_0x1b5f19,_0x22e8('0xe'),!![]);if(_0x484194[_0x22e8('0x7f')]()){_0x507ac4[_0x22e8('0x1b')]('\x22'+_0x1b5f19+'\x22');}else{_0x21c1a6[_0x22e8('0x1b')](_0x22e8('0x80'));}break;case _0x22e8('0x32'):var _0x20c3ea=parseInt(_0x1b5f19);_0x1b5f19=_[_0x22e8('0x81')](_0x20c3ea)||_0x20c3ea<0x0||_0x20c3ea>0x4?_0x4e4ce1?0x3:0x2:_0x20c3ea;_0x507ac4[_0x22e8('0x1b')]('\x22'+_0x1b5f19+'\x22');break;case _0x22e8('0x33'):var _0x403356=parseInt(_0x1b5f19);if(_['isNumber'](_0x403356)&&_[_0x22e8('0x74')](_0x370b60,_0x403356)){_0x507ac4[_0x22e8('0x1b')]('\x22'+_0x403356+'\x22');}else{_0x21c1a6[_0x22e8('0x1b')]('agent\x20not\x20exists');}break;case _0x22e8('0x82'):if(isEmail(_0x1b5f19)){_0x507ac4['push']('\x22'+_0x1b5f19+'\x22');}else{_0x21c1a6['push'](_0x22e8('0x83'));}break;case _0x22e8('0x84'):var _0x1b8f1e=moment(_0x1b5f19,'YYYY-MM-DD',!![]);if(_0x1b8f1e['isValid']()){_0x507ac4['push']('\x22'+_0x1b5f19+'\x22');}else{_0x21c1a6[_0x22e8('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x455766=shared[_0x22e8('0x69')];var _0x2daf0c=_0x455766[_0x1b5f19];if(!_[_0x22e8('0x1e')](_0x2daf0c)){var _0x27e509=_0x2daf0c['utcOffset'];_0x507ac4[_0x22e8('0x1b')]('\x22'+_0x1b5f19+'\x22');_0x507ac4[_0x22e8('0x1b')]('\x22'+_0x27e509+'\x22');}break;default:_0x507ac4['push']('\x22'+_0x1b5f19+'\x22');}}else{switch(_0x1ed433){case _0x22e8('0x85'):case'phone':_0x21c1a6[_0x22e8('0x1b')](_0x1ed433+_0x22e8('0x86'));break;default:_0x507ac4['push']('\x22\x22');}}}}else{var _0x298fba='';if(!_[_0x22e8('0x1e')](_0x2c89c0)){if(!_0x1fe97e[_0x22e8('0x87')](_0x2c89c0['id'])){if(!_[_0x22e8('0x1e')](_0x116aa2[_0x22e8('0x7a')][_0xe8cb9b][_0x4200a0[_0x1ed433]])){var _0x1b5f19=_[_0x22e8('0x7d')](_0x116aa2['data'][_0xe8cb9b][_0x4200a0[_0x1ed433]][_0x22e8('0x7e')](/"/g,'\x27'));var _0x2c724c=phoneDescriptions[_0x22e8('0x7b')](_0x134e3b=>_0x134e3b['itemTypeId']===_0x2c89c0['id']);if(!_[_0x22e8('0x1e')](_0x2c724c)){var _0x572588=_[_0x22e8('0x7d')](_0x116aa2[_0x22e8('0x7a')][_0xe8cb9b][_0x4200a0[_0x2c724c['description']]]['replace'](/"/g,'\x27'));if(!_[_0x22e8('0x1e')](_0x572588))_0x1b5f19=_0x1b5f19+'§'+_0x572588;}if(_0x298fba=='')_0x298fba=_0x1b5f19;else _0x298fba+='|'+_0x1b5f19;}_0x5931b6['push'](_0x2c89c0['id']+':'+_0x298fba);_0x1fe97e[_0x2c89c0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x507ac4[_0x22e8('0x1b')]('\x22'+_0x5931b6['join'](';')+'\x22');}if(_0x21c1a6[_0x22e8('0x1a')]){handleError(_0x116aa2[_0x22e8('0x7a')][_0xe8cb9b],{'code':_0x22e8('0x88'),'message':_0x21c1a6[_0x22e8('0x13')]()});}else{fs[_0x22e8('0x89')](_0x589dfd,_0x507ac4[_0x22e8('0x13')]()+'\x0a');}_0x507ac4=[];}if(!(stats['rows']%0xc8)){socket[_0x22e8('0x8a')](_0x22e8('0x8b')+_0x108bba,stats);stats['errors']=[];}}if(stopped){logger[_0x22e8('0x56')]('Abort\x20parser');_0x594a1d[_0x22e8('0x8c')]();}}catch(_0x5bb1ab){handleError(_0x116aa2[_0x22e8('0x7a')][_0xe8cb9b],{'code':_0x22e8('0x8d'),'message':_0x5bb1ab['message']});logger[_0x22e8('0x58')]('step',_0x5bb1ab[_0x22e8('0x59')]);}},'complete':function(){try{var _0x5c3360=[];var _0xf36950=[];var _0x409ec9='cm_contacts';if(_0x4608dc[_0x22e8('0x8e')]&&_0x4608dc[_0x22e8('0x8e')][_0x22e8('0x1a')]){_0x409ec9=_0x22e8('0x8f')+_0x108bba;_0x5c3360[_0x22e8('0x1b')](_0x22e8('0x90')+_0x409ec9+_0x22e8('0x91'));}tmp_campaigns='campaigns_'+_0x108bba;tmp_voice_queues=_0x22e8('0x92')+_0x108bba;_0xf36950['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x22e8('0x93'));_0xf36950['push'](_0x22e8('0x90')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x22e8('0x94')](_0xf36950,handleTZQuery)[_0x22e8('0x19')](function(_0x4e6e15){updateTzCampaigns(_0x4608dc['ListId'])[_0x22e8('0x19')](function(_0x339bed){updateTzVoiceQueues(_0x4608dc[_0x22e8('0x2f')])[_0x22e8('0x19')](function(_0x382d2f){if(hasTZ)_0x366867=_0x366867[_0x22e8('0x7e')](_0x22e8('0x6a'),'dialTimezone,utcOffset');var _0x189815=util[_0x22e8('0xd')](_0x22e8('0x95'),_0x589dfd,_0x409ec9,_0x366867,_0x4608dc[_0x22e8('0x2f')],_0x4608dc[_0x22e8('0x96')]||null,NOW,NOW);if(_['isNil'](_0x4200a0[_0x22e8('0x45')])){_0x189815+=',\x20scheduledAt\x20=\x20NOW()';}_0x5c3360[_0x22e8('0x1b')](_0x189815);if(_0x4608dc[_0x22e8('0x8e')]&&_0x4608dc[_0x22e8('0x8e')]['length']){_0x5c3360[_0x22e8('0x1b')](insertCmContact(_0x4608dc['ListId'],_0x409ec9,_0x4608dc[_0x22e8('0x8e')],_0x4200a0));_0x5c3360[_0x22e8('0x1b')](_0x22e8('0x97')+_0x409ec9+';');}BPromise['each'](_0x5c3360,handleQuery)['then'](function(_0x2de806){BPromise[_0x22e8('0x1c')]([handleAdditionalPhones()])[_0x22e8('0x19')](function(){_0x5c3360=[];for(var _0x283c86=0x0;_0x283c86\x20\x20');}var _0x4a9652=path[_0x22e8('0x13')](config[_0x22e8('0x72')],'server/files/tmp',process[_0x22e8('0xa4')][0x2]);if(!fs[_0x22e8('0xa5')](_0x4a9652)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x25a6b0={};try{_0x25a6b0=JSON[_0x22e8('0x78')](process[_0x22e8('0xa4')][0x3]);if(!_0x25a6b0[_0x22e8('0x71')]){throw new Error(_0x22e8('0xa6'));}if(!_0x25a6b0[_0x22e8('0x71')][_0x22e8('0x2e')]){throw new Error(_0x22e8('0xa7'));}if(!_0x25a6b0[_0x22e8('0x71')][_0x22e8('0x85')]){throw new Error('firstName\x20is\x20mandatory');}var _0x22270e=0x0;if(_0x25a6b0[_0x22e8('0x71')][_0x22e8('0x33')]){_0x22270e=0x1;}if(!_0x25a6b0[_0x22e8('0x2f')]){throw new Error(_0x22e8('0xa8'));}}catch(_0x4451d9){throw new Error(_0x22e8('0xa9'));}var _0x1ecc85=[];try{_0x1ecc85=_['map'](JSON['parse'](process[_0x22e8('0xa4')][0x4]),'id');}catch(_0x56f5f2){logger[_0x22e8('0x56')](_0x22e8('0xaa'));}main(_0x4a9652,_0x25a6b0,_0x1ecc85,_0x22270e);}validate();process['on'](_0x22e8('0xab'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index a05c328..d2ab9b3 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ace=['send','binding','clone','socket_timestamp','root','.csv','body','ContactItemType','name','_description','header','data','rows','find','hasOwnProperty','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','itemTypeId','trim','description','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contactId','orderBy','DROP\x20TABLE\x20','unlink','catch','exit','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20','where','sequelize','query','spread','length','isNil','AdditionalPhones','push','all','then','error','message','split','CmContactHasItem','findOne','create','PHONE','inserted','CmContact','update','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','insert','cm_hopper_black','createdAt','fields','.CmListId','.CmListId\x20=\x20?','ListId\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','MIN(id)','group','info','errors','code','main','stringify'];(function(_0x181a57,_0x202cae){var _0x16214e=function(_0x29f971){while(--_0x29f971){_0x181a57['push'](_0x181a57['shift']());}};_0x16214e(++_0x202cae);}(_0x7ace,0xd6));var _0xe7ac=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7ace[_0x27af45];return _0x18df21;};'use strict';var fs=require('fs');var path=require(_0xe7ac('0x0'));var _=require(_0xe7ac('0x1'));var Papa=require(_0xe7ac('0x2'));var util=require(_0xe7ac('0x3'));var BPromise=require(_0xe7ac('0x4'));var moment=require(_0xe7ac('0x5'));var squel=require(_0xe7ac('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xe7ac('0x7'))(_0xe7ac('0x8'));config[_0xe7ac('0x9')]=_[_0xe7ac('0xa')](config[_0xe7ac('0x9')],{'host':_0xe7ac('0xb'),'port':0x18eb});var socket=require(_0xe7ac('0xc'))(new Redis(config[_0xe7ac('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xe7ac('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0xe7ac('0xe')+moment()[_0xe7ac('0xd')](_0xe7ac('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x8bd739){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))*$/[_0xe7ac('0x10')](_0x8bd739);}function selectNotIn(_0x590158,_0x44930c,_0x5109c7,_0x10a13d,_0x28f0b4){return squel[_0xe7ac('0x11')]()['field'](_0xe7ac('0x12'))[_0xe7ac('0x13')](_0x10a13d)[_0xe7ac('0x14')](_0x44930c,null,_0x44930c+_0xe7ac('0x15')+_0x10a13d+'.'+_0x5109c7)['where'](_0x10a13d+'.'+_0x5109c7+_0xe7ac('0x16')+_0x590158+'.'+_0x5109c7)[_0xe7ac('0x17')](_0x44930c+'.dialCheckDuplicateType\x20IN\x20('+_0x28f0b4[_0xe7ac('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x26368a,_0x3de7e3){promisesAdditionalPhones=[];promisesContact=[];return db[_0xe7ac('0x18')][_0xe7ac('0x19')]('select\x20*\x20from\x20'+tempTableName)[_0xe7ac('0x1a')](function(_0x13c098){if(_0x13c098!==null){var _0x3fd71e=[];for(var _0x31c39c=0x0;_0x31c39c<_0x13c098[_0xe7ac('0x1b')];_0x31c39c++){var _0x1b56cc=_0x13c098[_0x31c39c];if(!_[_0xe7ac('0x1c')](_0x1b56cc['phone'])){if(!_[_0xe7ac('0x1c')](_0x1b56cc[_0xe7ac('0x1d')]))_0x3fd71e[_0xe7ac('0x1e')](insertAdditionalPhones(_0x1b56cc));promisesContact['push']({'contact':_0x1b56cc});}}}Promise[_0xe7ac('0x1f')](_0x3fd71e)[_0xe7ac('0x20')](function(){_0x26368a({'val':0x1});});})['catch'](function(_0x4348c9){logger[_0xe7ac('0x21')](_0x4348c9[_0xe7ac('0x22')]);});});}function insertAdditionalPhones(_0x1e4dad){return new Promise(function(_0x553305,_0x533b36){var _0xc2d4c5=_0x1e4dad[_0xe7ac('0x1d')];if(_[_0xe7ac('0x1c')](_0xc2d4c5))_0x533b36({'val':0x0});else{var _0x28f1e7=_0xc2d4c5['split'](';');var _0x4ce5fd=[];orderBy=0x0;for(var _0x406d54=0x0;_0x406d54<_0x28f1e7['length'];_0x406d54++){_0x4ce5fd[_0xe7ac('0x1e')](splitAdditionalPhone(_0x1e4dad['id'],_0x28f1e7[_0x406d54]));}Promise[_0xe7ac('0x1f')](_0x4ce5fd)[_0xe7ac('0x20')](function(){_0x553305({'val':_0x28f1e7[_0xe7ac('0x1b')]});});}});}function splitAdditionalPhone(_0x3cdf02,_0x5e5d89){return new Promise(function(_0x2f9196,_0x42d947){var _0x234e2e=_0x5e5d89[_0xe7ac('0x23')](':');var _0x429742=_0x234e2e[0x0];var _0x453e90=_0x234e2e[0x1];if(_0x453e90!==''){var _0x25d173=_0x453e90[_0xe7ac('0x23')]('|');var _0x1a93ac=[];for(var _0x48c4c5=0x0;_0x48c4c5<_0x25d173['length'];_0x48c4c5++){if(_0x25d173[_0x48c4c5]!==''){var _0x420d7f=_['filter'](promisesAdditionalPhones,{'contactId':_0x3cdf02,'phone':_0x25d173[_0x48c4c5]});if(_0x420d7f['length']==0x0){orderBy++;promisesAdditionalPhones[_0xe7ac('0x1e')]({'contactId':_0x3cdf02,'contactTypeId':_0x429742,'phone':_0x25d173[_0x48c4c5],'orderBy':orderBy});}}}_0x2f9196({'ok':0x1});}else _0x2f9196({'res':0x0});});}function createAdditionalPhone(_0x1c0326,_0x460ef6,_0xedaa83,_0x29d8df){var _0x526665='';var _0x1d68c2='';var _0x309b2e=_0xedaa83[_0xe7ac('0x23')]('§');_0x526665=_0x309b2e[0x0];if(_0x309b2e[_0xe7ac('0x1b')]==0x2)_0x1d68c2=_0x309b2e[0x1];return new Promise(function(_0x39ef09,_0x3f2d06){return db[_0xe7ac('0x24')][_0xe7ac('0x25')]({'where':{'CmContactId':_0x1c0326,'item':_0x526665}})['then'](function(_0x413e8d){if(_0x413e8d){return db[_0xe7ac('0x24')]['update']({'ItemTypeId':_0x460ef6,'description':_0x1d68c2,'OrderBy':_0x29d8df},{'where':{'CmContactId':_0x1c0326,'item':_0x526665}})[_0xe7ac('0x20')](function(_0x2c3fcd){_0x39ef09({'res':'updated'});});}else{return db[_0xe7ac('0x24')][_0xe7ac('0x26')]({'CmContactId':_0x1c0326,'item':_0x526665,'ItemTypeId':_0x460ef6,'description':_0x1d68c2,'OrderBy':_0x29d8df,'ItemClass':_0xe7ac('0x27')})[_0xe7ac('0x20')](function(_0x636eea){_0x39ef09({'res':_0xe7ac('0x28')});});}});});}function updateContact(_0x3e4bda){return new Promise(function(_0x20c30c,_0x5e3402){var _0x5c167b=_0x3e4bda['id'];delete _0x3e4bda['id'];return db[_0xe7ac('0x29')][_0xe7ac('0x2a')](_0x3e4bda,{'where':{'id':_0x5c167b}})[_0xe7ac('0x20')](function(_0x366fda){updatedRows+=0x1;return db[_0xe7ac('0x2b')]['update']({'phone':_0x3e4bda['phone']},{'where':{'ContactId':_0x5c167b}})['then'](function(_0xa77b80){_0x20c30c({'ret':'OK'});});});});}function insertCmHopper(_0x49cbe3,_0x30ceb1,_0xe02f62,_0x1e668f,_0x11b912){var _0x582e89=[_0xe7ac('0x2c'),'cm_contacts.scheduledat',_0xe7ac('0x2d'),_0xe7ac('0x2e'),_0x30ceb1+'.'+_0x1e668f,_0xe7ac('0x2f'),_0xe7ac('0x30'),'cm_contacts.priority',_0xe7ac('0x31'),'\x22'+_0x11b912+'\x22'];return squel['insert']()[_0xe7ac('0x32')](_0xe7ac('0x33'))[_0xe7ac('0x34')]([_0xe7ac('0x12'),_0xe7ac('0x35'),_0xe7ac('0x36'),'ListId',_0x1e668f,'createdAt',_0xe7ac('0x37'),_0xe7ac('0x38'),_0xe7ac('0x39'),_0xe7ac('0x3a')],squel['select']()['fields'](_0x582e89)['from'](_0x30ceb1)[_0xe7ac('0x14')](_0xe7ac('0x3b'),null,_0xe7ac('0x3c')+_0x30ceb1+'.CmListId')[_0xe7ac('0x14')](_0xe02f62,null,_0xe02f62+'.id\x20=\x20'+_0x30ceb1+'.'+_0x1e668f)[_0xe7ac('0x17')](_0x30ceb1+'.CmListId\x20=\x20?',_0x49cbe3)[_0xe7ac('0x17')](_0xe7ac('0x3d'),NOW)[_0xe7ac('0x17')](_0xe7ac('0x3e'),selectNotIn(_0x30ceb1,_0xe02f62,_0x1e668f,_0xe7ac('0x33'),['\x22always\x22',_0xe7ac('0x3f')]))['where'](_0xe7ac('0x3e'),selectNotIn(_0x30ceb1,_0xe02f62,_0x1e668f,_0xe7ac('0x33'),[_0xe7ac('0x40')])))['toString']();}function insertCmHopperBlack(_0xd0feaa,_0xe07ccf,_0x5aff91,_0x37b989){var _0x5e268c=[_0xe7ac('0x2c'),_0xe7ac('0x2d'),'cm_contacts.ListId',_0xe07ccf+'.'+_0x37b989,_0xe7ac('0x2f'),'cm_contacts.updatedAt'];return squel[_0xe7ac('0x41')]()[_0xe7ac('0x32')](_0xe7ac('0x42'))[_0xe7ac('0x34')]([_0xe7ac('0x12'),_0xe7ac('0x36'),'ListId',_0x37b989,_0xe7ac('0x43'),_0xe7ac('0x37')],squel[_0xe7ac('0x11')]()[_0xe7ac('0x44')](_0x5e268c)[_0xe7ac('0x13')](_0xe07ccf)['join'](_0xe7ac('0x3b'),null,_0xe7ac('0x3c')+_0xe07ccf+_0xe7ac('0x45'))[_0xe7ac('0x14')](_0x5aff91,null,_0x5aff91+_0xe7ac('0x15')+_0xe07ccf+'.'+_0x37b989)[_0xe7ac('0x17')](_0xe07ccf+_0xe7ac('0x46'),_0xd0feaa)[_0xe7ac('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe7ac('0x17')](_0xe7ac('0x3e'),squel[_0xe7ac('0x11')]()['field']('phone')['from']('cm_hopper_black')['where'](_0xe7ac('0x47'),_0xd0feaa)[_0xe7ac('0x17')](_0x37b989+'\x20=\x20?',_0xe07ccf+'.'+_0x37b989)))[_0xe7ac('0x48')]();}function insertCmHopperAdditionalPhones(_0x525c37){var _0x5acc82=[_0xe7ac('0x49'),_0xe7ac('0x4a'),_0xe7ac('0x4b'),_0xe7ac('0x4c'),_0xe7ac('0x4d')];return squel[_0xe7ac('0x41')]()[_0xe7ac('0x32')](_0xe7ac('0x4e'))[_0xe7ac('0x34')]([_0xe7ac('0x4f'),'phone',_0xe7ac('0x50'),_0xe7ac('0x43'),_0xe7ac('0x37')],squel['select']()['fields'](_0x5acc82)[_0xe7ac('0x13')](_0xe7ac('0x33'))['join'](_0xe7ac('0x3b'),null,_0xe7ac('0x51'))[_0xe7ac('0x14')]('cm_contact_has_items',null,_0xe7ac('0x52'))[_0xe7ac('0x17')]('cm_hopper.ListId\x20=\x20?',_0x525c37)[_0xe7ac('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xe7ac('0x48')]();}function insertCmContact(_0x26c259,_0x852d6b,_0x157757,_0x49306e){var _0x15d678=_['concat'](_[_0xe7ac('0x53')](_0x49306e),[_0xe7ac('0x54'),_0xe7ac('0x55'),_0xe7ac('0x43'),'updatedAt']);return squel[_0xe7ac('0x41')]()['into'](_0xe7ac('0x3b'))['fromQuery'](_0x15d678,squel[_0xe7ac('0x11')]()[_0xe7ac('0x44')](_0x15d678)[_0xe7ac('0x13')](_0x852d6b)[_0xe7ac('0x17')]('('+_0x157757[_0xe7ac('0x14')](',')+_0xe7ac('0x56'),squel[_0xe7ac('0x11')]()['fields'](_0x157757)['from'](_0xe7ac('0x3b'))[_0xe7ac('0x17')](_0xe7ac('0x47'),_0x26c259))[_0xe7ac('0x17')](_0xe7ac('0x57'),squel[_0xe7ac('0x11')]()[_0xe7ac('0x58')](_0xe7ac('0x59'),'min_id')['from'](_0x852d6b)[_0xe7ac('0x5a')](_0x157757[_0xe7ac('0x14')](','))))[_0xe7ac('0x48')]();}function handleStop(){logger[_0xe7ac('0x5b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x44f83d){logger['error'](_0x44f83d['message']);process['exit'](0x1);}function handleError(_0x23c92b,_0x867e9e){stats[_0xe7ac('0x5c')]['push']({'name':_0x867e9e[_0xe7ac('0x5d')],'message':_0x867e9e[_0xe7ac('0x22')],'row':_0x23c92b});}function handleQuery(_0x2376a2){logger['info'](_0x2376a2);return db[_0xe7ac('0x18')][_0xe7ac('0x19')](_0x2376a2)[_0xe7ac('0x1a')](function(_0x4cfeea){results[_0xe7ac('0x1e')](_0x4cfeea);})['catch'](function(_0xe67904){logger[_0xe7ac('0x21')](_0xe67904[_0xe7ac('0x22')]);});}function main(_0x204cea,_0x199df8,_0x6e1c88,_0x40dd42){logger[_0xe7ac('0x5b')](_0xe7ac('0x5e'),_0x204cea,JSON[_0xe7ac('0x5f')](_0x199df8));process[_0xe7ac('0x60')]('start');var _0x374a38=_0x199df8[_0xe7ac('0x61')];var _0x47b9ec=_[_0xe7ac('0x62')](_0x374a38);var _0x378a93=_0x199df8[_0xe7ac('0x63')];var _0x135c44=path[_0xe7ac('0x14')](config[_0xe7ac('0x64')],'server/files/tmp',_0x378a93+_0xe7ac('0x65'));logger['info'](_0xe7ac('0x66'),_0x199df8);db[_0xe7ac('0x67')]['findAll']({'raw':!![],'attributes':['id',_0xe7ac('0x68')]})['then'](function(_0x2fb852){for(var _0x105840=0x0;_0x105840<_0x2fb852[_0xe7ac('0x1b')];_0x105840++){if(_0x2fb852[_0x105840][_0xe7ac('0x68')]in _0x374a38){contactItemTypes[_0xe7ac('0x1e')](_0x2fb852[_0x105840]);delete _0x47b9ec[_0x2fb852[_0x105840][_0xe7ac('0x68')]];hasAdditionalPhones=!![];}for(var _0x1f2277 in _0x374a38){if(_0x2fb852[_0x105840][_0xe7ac('0x68')]+_0xe7ac('0x69')===_0x1f2277){phoneDescriptions['push']({'itemTypeId':_0x2fb852[_0x105840]['id'],'description':_0x1f2277});delete _0x47b9ec[_0x1f2277];}}}if(hasAdditionalPhones)_0x47b9ec[_0xe7ac('0x1d')]='';var _0xfe0720=_['keys'](_0x47b9ec)[_0xe7ac('0x14')]();logger[_0xe7ac('0x5b')](_0xe7ac('0x6a'),_0xfe0720);fs['writeFileSync'](_0x135c44,_0xfe0720+'\x0a');Papa['parse'](fs['createReadStream'](_0x204cea),{'header':!![],'skipEmptyLines':!![],'step':function(_0x28af44,_0x2212a0){try{for(var _0x98820a=0x0,_0x38c3e3=[];_0x98820a<_0x28af44[_0xe7ac('0x6b')][_0xe7ac('0x1b')];_0x98820a++){stats[_0xe7ac('0x6c')]+=0x1;if(_0x28af44['errors'][_0x98820a]){handleError(_0x28af44[_0xe7ac('0x6b')][_0x98820a],_0x28af44['errors'][_0x98820a]);}else{var _0x48de99=[];var _0x39c7b7=[];var _0x4d582b={};for(var _0x576bff in _0x374a38){let _0x558901=contactItemTypes[_0xe7ac('0x6d')](_0x4cdeaa=>_0x4cdeaa[_0xe7ac('0x68')]===_0x576bff);let _0x2a3915=contactItemTypes['find'](_0x161b17=>_0x161b17[_0xe7ac('0x68')]+_0xe7ac('0x69')===_0x576bff);if(_[_0xe7ac('0x1c')](_0x558901)&&_[_0xe7ac('0x1c')](_0x2a3915)){if(_0x374a38[_0xe7ac('0x6e')](_0x576bff)){if(_0x28af44[_0xe7ac('0x6b')][_0x98820a][_0x374a38[_0x576bff]]){var _0x3f42cf=_['trim'](_0x28af44[_0xe7ac('0x6b')][_0x98820a][_0x374a38[_0x576bff]][_0xe7ac('0x6f')](/"/g,'\x27'));switch(_0x576bff){case _0xe7ac('0x35'):var _0x13e908=moment(_0x3f42cf,_0xe7ac('0x70'),!![]);if(_0x13e908['isValid']()){_0x38c3e3['push']('\x22'+_0x3f42cf+'\x22');}else{_0x48de99[_0xe7ac('0x1e')](_0xe7ac('0x71'));}break;case _0xe7ac('0x38'):var _0xb578b6=parseInt(_0x3f42cf);_0x3f42cf=_[_0xe7ac('0x72')](_0xb578b6)||_0xb578b6<0x0||_0xb578b6>0x4?_0x40dd42?0x3:0x2:_0xb578b6;_0x38c3e3[_0xe7ac('0x1e')]('\x22'+_0x3f42cf+'\x22');break;case _0xe7ac('0x39'):var _0xbe033b=parseInt(_0x3f42cf);if(_[_0xe7ac('0x73')](_0xbe033b)&&_[_0xe7ac('0x74')](_0x6e1c88,_0xbe033b)){_0x38c3e3['push']('\x22'+_0xbe033b+'\x22');}else{_0x48de99[_0xe7ac('0x1e')](_0xe7ac('0x75'));}break;case _0xe7ac('0x76'):if(isEmail(_0x3f42cf)){_0x38c3e3['push']('\x22'+_0x3f42cf+'\x22');}else{_0x48de99[_0xe7ac('0x1e')](_0xe7ac('0x77'));}break;case _0xe7ac('0x78'):var _0x4ed4b1=moment(_0x3f42cf,_0xe7ac('0x79'),!![]);if(_0x4ed4b1[_0xe7ac('0x7a')]()){_0x38c3e3['push']('\x22'+_0x3f42cf+'\x22');}else{_0x48de99[_0xe7ac('0x1e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x38c3e3[_0xe7ac('0x1e')]('\x22'+_0x3f42cf+'\x22');}}else{switch(_0x576bff){case _0xe7ac('0x7b'):case _0xe7ac('0x12'):_0x48de99['push'](_0x576bff+'\x20not\x20specified');break;default:_0x38c3e3[_0xe7ac('0x1e')]('\x22\x22');}}}}else{var _0xe22977='';if(!_[_0xe7ac('0x1c')](_0x558901)){if(!_0x4d582b['hasOwnProperty'](_0x558901['id'])){for(var _0x5095e7=0x0;_0x5095e7<_0x374a38[_0x576bff][_0xe7ac('0x1b')];_0x5095e7++){var _0x3f42cf=_['trim'](_0x28af44[_0xe7ac('0x6b')][_0x98820a][_0x374a38[_0x576bff][_0x5095e7]][_0xe7ac('0x6f')](/"/g,'\x27'));var _0x41fe0c=phoneDescriptions[_0xe7ac('0x6d')](_0x182746=>_0x182746[_0xe7ac('0x7c')]===_0x558901['id']);if(!_[_0xe7ac('0x1c')](_0x41fe0c)){var _0x1d9d00=_[_0xe7ac('0x7d')](_0x28af44[_0xe7ac('0x6b')][_0x98820a][_0x374a38[_0x41fe0c[_0xe7ac('0x7e')]][0x0]][_0xe7ac('0x6f')](/"/g,'\x27'));if(!_[_0xe7ac('0x1c')](_0x1d9d00))_0x3f42cf=_0x3f42cf+'§'+_0x1d9d00;}if(_0xe22977=='')_0xe22977=_0x3f42cf;else _0xe22977+='|'+_0x3f42cf;}_0x39c7b7['push'](_0x558901['id']+':'+_0xe22977);_0x4d582b[_0x558901['id']]=0x1;}}}}if(hasAdditionalPhones){_0x38c3e3[_0xe7ac('0x1e')]('\x22'+_0x39c7b7[_0xe7ac('0x14')](';')+'\x22');}if(_0x48de99['length']){handleError(_0x28af44[_0xe7ac('0x6b')][_0x98820a],{'code':'SystemRow','message':_0x48de99['join']()});}else{fs['appendFileSync'](_0x135c44,_0x38c3e3[_0xe7ac('0x14')]()+'\x0a');}_0x38c3e3=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xe7ac('0x7f')+_0x378a93,stats);stats['errors']=[];}}if(stopped){logger[_0xe7ac('0x5b')](_0xe7ac('0x80'));_0x2212a0[_0xe7ac('0x81')]();}}catch(_0x956fbe){handleError(_0x28af44['data'][_0x98820a],{'code':_0xe7ac('0x82'),'message':_0x956fbe[_0xe7ac('0x22')]});logger[_0xe7ac('0x21')](_0xe7ac('0x83'),_0x956fbe[_0xe7ac('0x22')]);}},'complete':function(){try{var _0x513811=[];var _0x13f6a7=tempTableName;_0x513811[_0xe7ac('0x1e')](_0xe7ac('0x84')+_0x13f6a7+'\x20LIKE\x20cm_contacts;');logger[_0xe7ac('0x5b')]('CIS\x20len',contactItemTypes['length']);var _0x554cb1=util['format'](_0xe7ac('0x85'),_0x135c44,_0x13f6a7,_0xfe0720,_0x199df8[_0xe7ac('0x54')],_0x199df8[_0xe7ac('0x55')]||null,NOW,NOW);if(_[_0xe7ac('0x1c')](_0x374a38[_0xe7ac('0x35')])){_0x554cb1+=_0xe7ac('0x86');}_0x513811['push'](_0x554cb1);BPromise[_0xe7ac('0x87')](_0x513811,handleQuery)[_0xe7ac('0x20')](function(_0x327341){BPromise[_0xe7ac('0x1f')]([handleAdditionalPhones()])[_0xe7ac('0x20')](function(){_0x513811=[];for(var _0x25e7fc=0x0;_0x25e7fc\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','all','then','catch','message','split','length','CmContactHasItem','findOne','create','PHONE','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt'];(function(_0x4e586a,_0x1ed058){var _0x32139c=function(_0x31d77e){while(--_0x31d77e){_0x4e586a['push'](_0x4e586a['shift']());}};_0x32139c(++_0x1ed058);}(_0x4e52,0x6e));var _0x24e5=function(_0x5a673d,_0x105505){_0x5a673d=_0x5a673d-0x0;var _0x56e9d1=_0x4e52[_0x5a673d];return _0x56e9d1;};'use strict';var fs=require('fs');var path=require(_0x24e5('0x0'));var _=require(_0x24e5('0x1'));var Papa=require(_0x24e5('0x2'));var util=require(_0x24e5('0x3'));var BPromise=require(_0x24e5('0x4'));var moment=require('moment');var squel=require(_0x24e5('0x5'));var Redis=require(_0x24e5('0x6'));var db=require(_0x24e5('0x7'))['db'];var config=require(_0x24e5('0x8'));var logger=require('../../../config/logger')(_0x24e5('0x9'));config[_0x24e5('0xa')]=_['defaults'](config[_0x24e5('0xa')],{'host':_0x24e5('0xb'),'port':0x18eb});var socket=require(_0x24e5('0xc'))(new Redis(config[_0x24e5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x24e5('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x24e5('0xe')+moment()[_0x24e5('0xd')](_0x24e5('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xa54104){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))*$/[_0x24e5('0x10')](_0xa54104);}function selectNotIn(_0x592e36,_0x4936b2,_0x29618d,_0x8bf265,_0x7e294a){return squel[_0x24e5('0x11')]()[_0x24e5('0x12')](_0x24e5('0x13'))[_0x24e5('0x14')](_0x8bf265)[_0x24e5('0x15')](_0x4936b2,null,_0x4936b2+'.id\x20=\x20'+_0x8bf265+'.'+_0x29618d)[_0x24e5('0x16')](_0x8bf265+'.'+_0x29618d+_0x24e5('0x17')+_0x592e36+'.'+_0x29618d)[_0x24e5('0x16')](_0x4936b2+'.dialCheckDuplicateType\x20IN\x20('+_0x7e294a[_0x24e5('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5594de,_0x1f2841){promisesAdditionalPhones=[];promisesContact=[];return db[_0x24e5('0x18')][_0x24e5('0x19')](_0x24e5('0x1a')+tempTableName)[_0x24e5('0x1b')](function(_0x4d0a39){if(_0x4d0a39!==null){var _0x480887=[];for(var _0x1c1a6b=0x0;_0x1c1a6b<_0x4d0a39['length'];_0x1c1a6b++){var _0x23c492=_0x4d0a39[_0x1c1a6b];if(!_[_0x24e5('0x1c')](_0x23c492['phone'])){if(!_[_0x24e5('0x1c')](_0x23c492[_0x24e5('0x1d')]))_0x480887[_0x24e5('0x1e')](insertAdditionalPhones(_0x23c492));promisesContact[_0x24e5('0x1e')]({'contact':_0x23c492});}}}Promise[_0x24e5('0x1f')](_0x480887)[_0x24e5('0x20')](function(){_0x5594de({'val':0x1});});})[_0x24e5('0x21')](function(_0x9a007f){logger['error'](_0x9a007f[_0x24e5('0x22')]);});});}function insertAdditionalPhones(_0x1d307e){return new Promise(function(_0x461fb1,_0x20fdaa){var _0x67ee8=_0x1d307e[_0x24e5('0x1d')];if(_[_0x24e5('0x1c')](_0x67ee8))_0x20fdaa({'val':0x0});else{var _0xce344e=_0x67ee8[_0x24e5('0x23')](';');var _0x102157=[];orderBy=0x0;for(var _0x3625f7=0x0;_0x3625f7<_0xce344e[_0x24e5('0x24')];_0x3625f7++){_0x102157[_0x24e5('0x1e')](splitAdditionalPhone(_0x1d307e['id'],_0xce344e[_0x3625f7]));}Promise[_0x24e5('0x1f')](_0x102157)['then'](function(){_0x461fb1({'val':_0xce344e[_0x24e5('0x24')]});});}});}function splitAdditionalPhone(_0x22e3aa,_0x4d567a){return new Promise(function(_0x19e1cd,_0x48703f){var _0x4ac163=_0x4d567a['split'](':');var _0x4a7415=_0x4ac163[0x0];var _0x4160f1=_0x4ac163[0x1];if(_0x4160f1!==''){var _0x12d1ac=_0x4160f1[_0x24e5('0x23')]('|');var _0x30693a=[];for(var _0x5d186f=0x0;_0x5d186f<_0x12d1ac[_0x24e5('0x24')];_0x5d186f++){if(_0x12d1ac[_0x5d186f]!==''){var _0x3d7e02=_['filter'](promisesAdditionalPhones,{'contactId':_0x22e3aa,'phone':_0x12d1ac[_0x5d186f]});if(_0x3d7e02[_0x24e5('0x24')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x22e3aa,'contactTypeId':_0x4a7415,'phone':_0x12d1ac[_0x5d186f],'orderBy':orderBy});}}}_0x19e1cd({'ok':0x1});}else _0x19e1cd({'res':0x0});});}function createAdditionalPhone(_0x295639,_0x45ea8e,_0x2a81ff,_0x28214c){var _0x1a3874='';var _0x41e977='';var _0x2882db=_0x2a81ff[_0x24e5('0x23')]('§');_0x1a3874=_0x2882db[0x0];if(_0x2882db[_0x24e5('0x24')]==0x2)_0x41e977=_0x2882db[0x1];return new Promise(function(_0x31b51b,_0x33325e){return db[_0x24e5('0x25')][_0x24e5('0x26')]({'where':{'CmContactId':_0x295639,'item':_0x1a3874}})['then'](function(_0x3f4430){if(_0x3f4430){return db[_0x24e5('0x25')]['update']({'ItemTypeId':_0x45ea8e,'description':_0x41e977,'OrderBy':_0x28214c},{'where':{'CmContactId':_0x295639,'item':_0x1a3874}})[_0x24e5('0x20')](function(_0x1794c5){_0x31b51b({'res':'updated'});});}else{return db[_0x24e5('0x25')][_0x24e5('0x27')]({'CmContactId':_0x295639,'item':_0x1a3874,'ItemTypeId':_0x45ea8e,'description':_0x41e977,'OrderBy':_0x28214c,'ItemClass':_0x24e5('0x28')})[_0x24e5('0x20')](function(_0x13a945){_0x31b51b({'res':'inserted'});});}});});}function updateContact(_0x213990){return new Promise(function(_0x3d903b,_0x26f5c5){var _0x9c2de6=_0x213990['id'];delete _0x213990['id'];return db['CmContact'][_0x24e5('0x29')](_0x213990,{'where':{'id':_0x9c2de6}})[_0x24e5('0x20')](function(_0x5e945d){updatedRows+=0x1;return db[_0x24e5('0x2a')][_0x24e5('0x29')]({'phone':_0x213990[_0x24e5('0x13')]},{'where':{'ContactId':_0x9c2de6}})[_0x24e5('0x20')](function(_0x470e90){_0x3d903b({'ret':'OK'});});});});}function insertCmHopper(_0x4d6674,_0x50ba56,_0x2814df,_0x17bb54,_0x48a829){var _0x5aafd9=[_0x24e5('0x2b'),_0x24e5('0x2c'),_0x24e5('0x2d'),_0x24e5('0x2e'),_0x50ba56+'.'+_0x17bb54,_0x24e5('0x2f'),_0x24e5('0x30'),_0x24e5('0x31'),_0x24e5('0x32'),'\x22'+_0x48a829+'\x22'];return squel['insert']()['into'](_0x24e5('0x33'))[_0x24e5('0x34')](['phone','scheduledat',_0x24e5('0x35'),'ListId',_0x17bb54,'createdAt',_0x24e5('0x36'),'priority','UserId',_0x24e5('0x37')],squel['select']()['fields'](_0x5aafd9)[_0x24e5('0x14')](_0x50ba56)['join'](_0x24e5('0x38'),null,_0x24e5('0x39')+_0x50ba56+_0x24e5('0x3a'))[_0x24e5('0x15')](_0x2814df,null,_0x2814df+_0x24e5('0x3b')+_0x50ba56+'.'+_0x17bb54)[_0x24e5('0x16')](_0x50ba56+_0x24e5('0x3c'),_0x4d6674)['where'](_0x24e5('0x3d'),NOW)['where'](_0x24e5('0x3e'),selectNotIn(_0x50ba56,_0x2814df,_0x17bb54,_0x24e5('0x33'),['\x22always\x22',_0x24e5('0x3f')]))[_0x24e5('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x50ba56,_0x2814df,_0x17bb54,'cm_hopper',[_0x24e5('0x40')])))[_0x24e5('0x41')]();}function insertCmHopperBlack(_0x5ba17e,_0x3d5513,_0x8a0f1e,_0x394e6e){var _0x2058ba=[_0x24e5('0x2b'),_0x24e5('0x2d'),'cm_contacts.ListId',_0x3d5513+'.'+_0x394e6e,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x24e5('0x42')]()[_0x24e5('0x43')]('cm_hopper_black')[_0x24e5('0x34')]([_0x24e5('0x13'),_0x24e5('0x35'),_0x24e5('0x44'),_0x394e6e,_0x24e5('0x45'),_0x24e5('0x36')],squel[_0x24e5('0x11')]()[_0x24e5('0x46')](_0x2058ba)[_0x24e5('0x14')](_0x3d5513)[_0x24e5('0x15')](_0x24e5('0x38'),null,_0x24e5('0x39')+_0x3d5513+_0x24e5('0x3a'))[_0x24e5('0x15')](_0x8a0f1e,null,_0x8a0f1e+'.id\x20=\x20'+_0x3d5513+'.'+_0x394e6e)[_0x24e5('0x16')](_0x3d5513+'.CmListId\x20=\x20?',_0x5ba17e)['where'](_0x24e5('0x3d'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x24e5('0x11')]()['field']('phone')[_0x24e5('0x14')](_0x24e5('0x47'))['where'](_0x24e5('0x48'),_0x5ba17e)[_0x24e5('0x16')](_0x394e6e+_0x24e5('0x49'),_0x3d5513+'.'+_0x394e6e)))[_0x24e5('0x41')]();}function insertCmHopperAdditionalPhones(_0xee2517){var _0x4a4dc7=[_0x24e5('0x4a'),_0x24e5('0x4b'),_0x24e5('0x4c'),_0x24e5('0x4d'),_0x24e5('0x4e')];return squel[_0x24e5('0x42')]()[_0x24e5('0x43')](_0x24e5('0x4f'))[_0x24e5('0x34')]([_0x24e5('0x50'),_0x24e5('0x13'),_0x24e5('0x51'),'createdAt','updatedAt'],squel[_0x24e5('0x11')]()[_0x24e5('0x46')](_0x4a4dc7)[_0x24e5('0x14')](_0x24e5('0x33'))[_0x24e5('0x15')](_0x24e5('0x38'),null,_0x24e5('0x52'))[_0x24e5('0x15')](_0x24e5('0x53'),null,_0x24e5('0x54'))['where'](_0x24e5('0x55'),_0xee2517)[_0x24e5('0x16')](_0x24e5('0x3d'),NOW))[_0x24e5('0x41')]();}function insertCmContact(_0x5c0d48,_0x20f552,_0x4870a3,_0x488fba){var _0x33b880=_['concat'](_[_0x24e5('0x56')](_0x488fba),[_0x24e5('0x44'),_0x24e5('0x57'),_0x24e5('0x45'),'updatedAt']);return squel[_0x24e5('0x42')]()['into']('cm_contacts')[_0x24e5('0x34')](_0x33b880,squel['select']()[_0x24e5('0x46')](_0x33b880)['from'](_0x20f552)[_0x24e5('0x16')]('('+_0x4870a3[_0x24e5('0x15')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x24e5('0x46')](_0x4870a3)[_0x24e5('0x14')]('cm_contacts')[_0x24e5('0x16')](_0x24e5('0x48'),_0x5c0d48))[_0x24e5('0x16')](_0x24e5('0x58'),squel[_0x24e5('0x11')]()[_0x24e5('0x12')]('MIN(id)',_0x24e5('0x59'))[_0x24e5('0x14')](_0x20f552)['group'](_0x4870a3['join'](','))))['toString']();}function handleStop(){logger[_0x24e5('0x5a')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x11cd58){logger[_0x24e5('0x5b')](_0x11cd58[_0x24e5('0x22')]);process['exit'](0x1);}function handleError(_0x39e919,_0x7217e5){stats['errors'][_0x24e5('0x1e')]({'name':_0x7217e5[_0x24e5('0x5c')],'message':_0x7217e5['message'],'row':_0x39e919});}function handleQuery(_0x32d317){logger[_0x24e5('0x5a')](_0x32d317);return db[_0x24e5('0x18')][_0x24e5('0x19')](_0x32d317)[_0x24e5('0x1b')](function(_0x441b70){results[_0x24e5('0x1e')](_0x441b70);})[_0x24e5('0x21')](function(_0x467dce){logger[_0x24e5('0x5b')](_0x467dce[_0x24e5('0x22')]);});}function main(_0x10c768,_0x56ff1c,_0x1efd85,_0x686aa5){logger[_0x24e5('0x5a')]('main',_0x10c768,JSON['stringify'](_0x56ff1c));process[_0x24e5('0x5d')](_0x24e5('0x5e'));var _0x5f4623=_0x56ff1c[_0x24e5('0x5f')];var _0x238651=_[_0x24e5('0x60')](_0x5f4623);var _0x4f180d=_0x56ff1c[_0x24e5('0x61')];var _0x4e8ea8=path[_0x24e5('0x15')](config[_0x24e5('0x62')],_0x24e5('0x63'),_0x4f180d+_0x24e5('0x64'));logger[_0x24e5('0x5a')](_0x24e5('0x65'),_0x56ff1c);db['ContactItemType'][_0x24e5('0x66')]({'raw':!![],'attributes':['id',_0x24e5('0x67')]})[_0x24e5('0x20')](function(_0x1fddd0){for(var _0x315100=0x0;_0x315100<_0x1fddd0[_0x24e5('0x24')];_0x315100++){if(_0x1fddd0[_0x315100]['name']in _0x5f4623){contactItemTypes[_0x24e5('0x1e')](_0x1fddd0[_0x315100]);delete _0x238651[_0x1fddd0[_0x315100][_0x24e5('0x67')]];hasAdditionalPhones=!![];}for(var _0x27c879 in _0x5f4623){if(_0x1fddd0[_0x315100][_0x24e5('0x67')]+'_description'===_0x27c879){phoneDescriptions[_0x24e5('0x1e')]({'itemTypeId':_0x1fddd0[_0x315100]['id'],'description':_0x27c879});delete _0x238651[_0x27c879];}}}if(hasAdditionalPhones)_0x238651['AdditionalPhones']='';var _0x21f6d7=_[_0x24e5('0x56')](_0x238651)[_0x24e5('0x15')]();logger[_0x24e5('0x5a')](_0x24e5('0x68'),_0x21f6d7);fs[_0x24e5('0x69')](_0x4e8ea8,_0x21f6d7+'\x0a');Papa[_0x24e5('0x6a')](fs['createReadStream'](_0x10c768),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5acf08,_0x2d6b9d){try{for(var _0x35864b=0x0,_0x1e66ad=[];_0x35864b<_0x5acf08[_0x24e5('0x6b')][_0x24e5('0x24')];_0x35864b++){stats[_0x24e5('0x6c')]+=0x1;if(_0x5acf08['errors'][_0x35864b]){handleError(_0x5acf08[_0x24e5('0x6b')][_0x35864b],_0x5acf08['errors'][_0x35864b]);}else{var _0x3ff91e=[];var _0x3d143d=[];var _0x167737={};for(var _0x5b4da2 in _0x5f4623){let _0x464ed9=contactItemTypes['find'](_0x4363c2=>_0x4363c2[_0x24e5('0x67')]===_0x5b4da2);let _0x547107=contactItemTypes['find'](_0x5c7b72=>_0x5c7b72[_0x24e5('0x67')]+_0x24e5('0x6d')===_0x5b4da2);if(_[_0x24e5('0x1c')](_0x464ed9)&&_[_0x24e5('0x1c')](_0x547107)){if(_0x5f4623[_0x24e5('0x6e')](_0x5b4da2)){if(_0x5acf08[_0x24e5('0x6b')][_0x35864b][_0x5f4623[_0x5b4da2]]){var _0x30539f=_['trim'](_0x5acf08['data'][_0x35864b][_0x5f4623[_0x5b4da2]][_0x24e5('0x6f')](/"/g,'\x27'));switch(_0x5b4da2){case _0x24e5('0x70'):var _0x56cf38=moment(_0x30539f,_0x24e5('0x71'),!![]);if(_0x56cf38[_0x24e5('0x72')]()){_0x1e66ad[_0x24e5('0x1e')]('\x22'+_0x30539f+'\x22');}else{_0x3ff91e['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x24e5('0x73'):var _0xad7410=parseInt(_0x30539f);_0x30539f=_[_0x24e5('0x74')](_0xad7410)||_0xad7410<0x0||_0xad7410>0x4?_0x686aa5?0x3:0x2:_0xad7410;_0x1e66ad[_0x24e5('0x1e')]('\x22'+_0x30539f+'\x22');break;case _0x24e5('0x75'):var _0x2ddc90=parseInt(_0x30539f);if(_[_0x24e5('0x76')](_0x2ddc90)&&_[_0x24e5('0x77')](_0x1efd85,_0x2ddc90)){_0x1e66ad[_0x24e5('0x1e')]('\x22'+_0x2ddc90+'\x22');}else{_0x3ff91e[_0x24e5('0x1e')]('agent\x20not\x20exists');}break;case _0x24e5('0x78'):if(isEmail(_0x30539f)){_0x1e66ad[_0x24e5('0x1e')]('\x22'+_0x30539f+'\x22');}else{_0x3ff91e['push']('email\x20wrong\x20format');}break;case _0x24e5('0x79'):var _0x4c35a6=moment(_0x30539f,'YYYY-MM-DD',!![]);if(_0x4c35a6[_0x24e5('0x72')]()){_0x1e66ad[_0x24e5('0x1e')]('\x22'+_0x30539f+'\x22');}else{_0x3ff91e[_0x24e5('0x1e')](_0x24e5('0x7a'));}break;default:_0x1e66ad[_0x24e5('0x1e')]('\x22'+_0x30539f+'\x22');}}else{switch(_0x5b4da2){case _0x24e5('0x7b'):case _0x24e5('0x13'):_0x3ff91e[_0x24e5('0x1e')](_0x5b4da2+'\x20not\x20specified');break;default:_0x1e66ad[_0x24e5('0x1e')]('\x22\x22');}}}}else{var _0xcf4e0a='';if(!_['isNil'](_0x464ed9)){if(!_0x167737[_0x24e5('0x6e')](_0x464ed9['id'])){for(var _0x121999=0x0;_0x121999<_0x5f4623[_0x5b4da2][_0x24e5('0x24')];_0x121999++){var _0x30539f=_['trim'](_0x5acf08['data'][_0x35864b][_0x5f4623[_0x5b4da2][_0x121999]][_0x24e5('0x6f')](/"/g,'\x27'));var _0x33f6d8=phoneDescriptions[_0x24e5('0x7c')](_0x8d816c=>_0x8d816c[_0x24e5('0x7d')]===_0x464ed9['id']);if(!_[_0x24e5('0x1c')](_0x33f6d8)){var _0x5cfce0=_['trim'](_0x5acf08['data'][_0x35864b][_0x5f4623[_0x33f6d8[_0x24e5('0x7e')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x24e5('0x1c')](_0x5cfce0))_0x30539f=_0x30539f+'§'+_0x5cfce0;}if(_0xcf4e0a=='')_0xcf4e0a=_0x30539f;else _0xcf4e0a+='|'+_0x30539f;}_0x3d143d['push'](_0x464ed9['id']+':'+_0xcf4e0a);_0x167737[_0x464ed9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1e66ad[_0x24e5('0x1e')]('\x22'+_0x3d143d[_0x24e5('0x15')](';')+'\x22');}if(_0x3ff91e[_0x24e5('0x24')]){handleError(_0x5acf08[_0x24e5('0x6b')][_0x35864b],{'code':_0x24e5('0x7f'),'message':_0x3ff91e[_0x24e5('0x15')]()});}else{fs[_0x24e5('0x80')](_0x4e8ea8,_0x1e66ad[_0x24e5('0x15')]()+'\x0a');}_0x1e66ad=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x4f180d,stats);stats['errors']=[];}}if(stopped){logger[_0x24e5('0x5a')](_0x24e5('0x81'));_0x2d6b9d[_0x24e5('0x82')]();}}catch(_0x297846){handleError(_0x5acf08['data'][_0x35864b],{'code':_0x24e5('0x83'),'message':_0x297846[_0x24e5('0x22')]});logger[_0x24e5('0x5b')](_0x24e5('0x84'),_0x297846[_0x24e5('0x22')]);}},'complete':function(){try{var _0x1aeff7=[];var _0x3758fb=tempTableName;_0x1aeff7['push'](_0x24e5('0x85')+_0x3758fb+_0x24e5('0x86'));logger['info'](_0x24e5('0x87'),contactItemTypes[_0x24e5('0x24')]);var _0x3dabb5=util['format'](_0x24e5('0x88'),_0x4e8ea8,_0x3758fb,_0x21f6d7,_0x56ff1c[_0x24e5('0x44')],_0x56ff1c[_0x24e5('0x57')]||null,NOW,NOW);if(_['isNil'](_0x5f4623[_0x24e5('0x70')])){_0x3dabb5+=',\x20scheduledAt\x20=\x20NOW()';}_0x1aeff7[_0x24e5('0x1e')](_0x3dabb5);BPromise['each'](_0x1aeff7,handleQuery)[_0x24e5('0x20')](function(_0x5ca58b){BPromise['all']([handleAdditionalPhones()])[_0x24e5('0x20')](function(){_0x1aeff7=[];for(var _0x45e12f=0x0;_0x45e12f\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.substatus','i.to','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0x5db8,0xbb));var _0x85db=function(_0x535963,_0x326515){_0x535963=_0x535963-0x0;var _0x3975f6=_0x5db8[_0x535963];return _0x3975f6;};'use strict';var _=require(_0x85db('0x0'));var squel=require(_0x85db('0x1'));var as=require(_0x85db('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0x85db('0x3'))[_0x85db('0x4')];var utils=require(_0x85db('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5b7426,_0x13c216,_0x1182c0){var _0x444ed9=![];var _0x34d71f=utils['getAccountFK'](_0x5b7426);if(_0x13c216['role']===_0x85db('0x6')&&!_0x1182c0[_0x85db('0x7')]&&!_0x1182c0[_0x34d71f]){_0x444ed9=!![];}return _0x444ed9;}function getTagsQuery(){return squel[_0x85db('0x8')]()[_0x85db('0x9')]('id')['field'](_0x85db('0xa'))['field'](_0x85db('0xb'))[_0x85db('0xc')](_0x85db('0xd'));}function getUsersQuery(_0x3e2cf3,_0x5491fa){var _0x54feb2=utils['getInteractionFK'](_0x3e2cf3);var _0x14f838=_0x85db('0xe')+_0x3e2cf3+'_interactions';var _0x11ac68=squel['select']()[_0x85db('0x9')](_0x85db('0xf'))[_0x85db('0x9')](_0x85db('0x10'))[_0x85db('0x9')](_0x85db('0x11')+_0x54feb2)[_0x85db('0xc')](_0x14f838,'ui')[_0x85db('0x12')](_0x85db('0x13'),'u',_0x85db('0x14'));if(_0x5491fa[_0x85db('0x15')]>0x0){_0x11ac68[_0x85db('0x16')](_0x85db('0x11')+_0x54feb2+'\x20IN\x20?',_[_0x85db('0x17')](_0x5491fa,'id'));}return _0x11ac68;}function getInteractionsQuery(_0x175622){var _0x11e7da=utils[_0x85db('0x18')](_0x175622);var _0x2ecd71=utils[_0x85db('0x19')](_0x175622);var _0x3209b3=utils['getInteractionFK'](_0x175622);return squel[_0x85db('0x8')]()[_0x85db('0xc')](_0x11e7da[_0x85db('0x1a')],'i')[_0x85db('0x12')](_0x85db('0x1b'),'c',_0x85db('0x1c'))[_0x85db('0x12')](_0x85db('0x13'),'o',_0x85db('0x1d'))[_0x85db('0x12')](_0x11e7da['accounts'],'a',_0x85db('0x1e')+_0x2ecd71)[_0x85db('0x12')](_0x11e7da[_0x85db('0x1f')],'me',_0x85db('0x20')+_0x3209b3+_0x85db('0x21'))[_0x85db('0x12')](_0x11e7da[_0x85db('0x22')],'it',_0x85db('0x23')+_0x3209b3+'\x20=\x20i.id')[_0x85db('0x12')](_0x85db('0xd'),'t',_0x85db('0x24'));}function getSqlClauses(){var _0x3381ec={'body':squel[_0x85db('0x25')](),'contact':squel[_0x85db('0x25')](),'default':squel['expr'](),'fields':squel[_0x85db('0x25')](),'filter':squel[_0x85db('0x25')](),'read':squel[_0x85db('0x25')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x3381ec;}function parseTagParameter(_0x50ea52){var _0x1e4ddb=squel[_0x85db('0x25')]();if(_0x50ea52){var _0x33448e=utils['getSelectedTags'](_0x50ea52);_0x33448e[_0x85db('0x26')](function(_0xc2abb8){_0x1e4ddb['or'](_0x85db('0x27'),'%,'+_0xc2abb8+',%');});}return _0x1e4ddb;}function parseReadParameter(_0x574bcc){var _0x5c8ddd='';if(_0x574bcc){_0x5c8ddd=_0x85db('0x28');if(_0x574bcc==='1'){_0x5c8ddd=_0x5c8ddd[_0x85db('0x29')](_0x85db('0x2a'),'=');}else{_0x5c8ddd=_0x5c8ddd[_0x85db('0x29')](_0x85db('0x2a'),'>');}}return _0x5c8ddd;}function parseSearchFilter(_0x16ee2a,_0x8af4a4){var _0x4268c5=squel[_0x85db('0x25')]();if(_0x8af4a4){var _0x1edc8d=_0x8af4a4['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x85db('0x2b')](_0x1edc8d)){_0x4268c5['or']('i.id\x20LIKE\x20?',_0x1edc8d+'%');if([_0x85db('0x2c'),_0x85db('0x2d')]['includes'](_0x16ee2a)){_0x4268c5['or'](_0x85db('0x2e'),_0x1edc8d+'%');}else if(_0x16ee2a===_0x85db('0x2f')){_0x4268c5['or'](_0x85db('0x30'),_0x1edc8d+'%');}else if(_0x16ee2a===_0x85db('0x31')){_0x4268c5['or']('i.from\x20LIKE\x20?',_0x1edc8d+'%');}}else if(_0x16ee2a===_0x85db('0x32')&&qs[_0x85db('0x33')](_0x1edc8d)){_0x4268c5['or'](_0x85db('0x34'),_0x1edc8d+'%');}else{if(_0x16ee2a===_0x85db('0x32')){_0x4268c5['or'](_0x85db('0x35'),qs['getFullTextValue'](_0x1edc8d))['or'](_0x85db('0x36'),qs[_0x85db('0x37')](_0x1edc8d));}else{if(_0x16ee2a!==_0x85db('0x2f')){_0x4268c5['or'](_0x85db('0x38'),qs['getFullTextValue'](_0x1edc8d));}_0x4268c5['or'](_0x85db('0x39'),_0x1edc8d+'%');}}}return _0x4268c5;}function parseAdvancedSearchFilter(_0x27fdef,_0x2a07ee){var _0x536398=getSqlClauses();var _0x550194=as[_0x85db('0x3a')](_0x27fdef);var _0x3639bc=_0x550194['sqlOperator'];for(var _0x33b08e=0x0;_0x33b08e<_0x550194[_0x85db('0x3b')][_0x85db('0x15')];_0x33b08e++){var _0x240325=_0x550194[_0x85db('0x3b')][_0x33b08e];var _0xd4a125='i';var _0x1791f3=_[_0x85db('0x3c')](_0x2a07ee,[_0x85db('0xa'),_0x240325[_0x85db('0x9')]]);if(_0x1791f3){var _0x11e333=as[_0x85db('0x3d')](_0xd4a125,_0x1791f3['type'],_0x240325);_0x536398[_0x85db('0x3e')][_0x3639bc](_0x11e333[_0x85db('0x3f')],_0x11e333[_0x85db('0x40')][_0x85db('0x41')],_0x11e333['value'][_0x85db('0x42')]);}else{switch(_0x240325[_0x85db('0x9')]){case _0x85db('0x43'):var _0x36031b=parseReadParameter(_0x240325['value']);_0x536398['read']['and'](_0x36031b);break;case'Contact':if(_0x240325['operator']===_0x85db('0x44')){if(_0x240325[_0x85db('0x40')][_0x85db('0x45')]('\x20')[_0x85db('0x15')]>0x1){_0x536398[_0x85db('0x46')][_0x3639bc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x240325[_0x85db('0x40')]),null);}else{var _0x4eafc5='%'+_0x240325[_0x85db('0x40')]+'%';_0x536398[_0x85db('0x46')][_0x3639bc]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4eafc5,_0x4eafc5,_0x4eafc5);}}else{_0x1791f3=_['find'](_0x2a07ee,[_0x85db('0xa'),_0x85db('0x47')]);_0x240325[_0x85db('0x9')]=_0x85db('0x47');_0x11e333=as[_0x85db('0x3d')](_0xd4a125,_0x1791f3['type'],_0x240325);_0x536398[_0x85db('0x46')][_0x3639bc](_0x11e333[_0x85db('0x3f')],_0x11e333[_0x85db('0x40')]['start'],_0x11e333['value']['end']);}break;case _0x85db('0x48'):var _0x45963b=_0x240325[_0x85db('0x40')]['split'](',')['map'](function(_0x3e4dbc){return Number(_0x3e4dbc);});var _0x48f3ae=parseTagParameter(_0x45963b);_0x536398[_0x85db('0x49')][_0x85db('0x4a')][_0x85db('0x4b')](_0x48f3ae);_0x536398['tags'][_0x85db('0x4c')]=_0x45963b;break;case _0x85db('0x4d'):if(_0x240325[_0x85db('0x4e')]===_0x85db('0x44')){_0x536398[_0x85db('0x4f')][_0x3639bc](_0x85db('0x50'),'%'+_0x240325[_0x85db('0x40')]+'%',null);}else{_0x1791f3=_[_0x85db('0x3c')](_0x2a07ee,[_0x85db('0xa'),'UserId']);_0x240325[_0x85db('0x9')]=_0x85db('0x51');_0x11e333=as[_0x85db('0x3d')](_0xd4a125,_0x1791f3[_0x85db('0x52')],_0x240325);_0x536398[_0x85db('0x4f')][_0x3639bc](_0x11e333[_0x85db('0x3f')],_0x11e333['value'][_0x85db('0x41')],_0x11e333[_0x85db('0x40')][_0x85db('0x42')]);}break;case'body':case'plainBody':_0x11e333=as[_0x85db('0x3d')]('me',null,_0x240325);_0x536398['body'][_0x3639bc](_0x11e333[_0x85db('0x3f')],_0x11e333[_0x85db('0x40')][_0x85db('0x41')],_0x11e333[_0x85db('0x40')][_0x85db('0x42')]);break;}}}return _0x536398;}function parseModelFields(_0x5e1455,_0x5d44ef,_0x40d87c){var _0x8a2d42=utils[_0x85db('0x19')](_0x5e1455);var _0xdd0b4d=squel[_0x85db('0x25')]();var _0x107882=_(_0x5d44ef)[_0x85db('0x53')]()[_0x85db('0x17')](function(_0x4735a0){return _[_0x85db('0x54')](_0x40d87c,['name',_0x4735a0])?_0x4735a0:undefined;})[_0x85db('0x55')]()[_0x85db('0x40')]();if(_0x107882['length']>0x0){_0x107882['forEach'](function(_0x8697f5){if(_0x8697f5===_0x8a2d42){_0xdd0b4d[_0x85db('0x4b')]('i.'+_0x8a2d42+'\x20IN\x20?',[]['concat'](_0x5d44ef[_0x8697f5]));}else if(_0x8697f5===_0x85db('0x56')){var _0x23f398=JSON['parse'](_0x5d44ef[_0x8697f5])[_0x85db('0x57')];var _0x3754e8=JSON[_0x85db('0x58')](_0x5d44ef[_0x8697f5])[_0x85db('0x59')];_0xdd0b4d[_0x85db('0x4b')](_0x85db('0x5a'),_0x23f398,_0x3754e8);}else{if(_0x5d44ef[_0x8697f5]===_0x85db('0x5b')){_0xdd0b4d[_0x85db('0x4b')]('i.'+_0x8697f5+_0x85db('0x5c'));}else{_0xdd0b4d[_0x85db('0x4b')]('i.'+_0x8697f5+'\x20=\x20?',_0x5d44ef[_0x8697f5]);}}});}return _0xdd0b4d;}function parseQueryParameters(_0x4ef4db,_0x283b13,_0x40ebf7){var _0x11c93a=getSqlClauses();return Promise[_0x85db('0x5d')]()[_0x85db('0x5e')](function(){return parseModelFields(_0x4ef4db,_0x283b13,_0x40ebf7);})[_0x85db('0x5e')](function(_0x745266){_0x11c93a[_0x85db('0x5f')][_0x85db('0x4b')](_0x745266);return parseReadParameter(_0x283b13[_0x85db('0x60')]);})[_0x85db('0x5e')](function(_0x27b128){_0x11c93a[_0x85db('0x60')][_0x85db('0x4b')](_0x27b128);return parseTagParameter(_0x283b13['tag']);})[_0x85db('0x5e')](function(_0x2fb5ce){_0x11c93a['tags'][_0x85db('0x4a')][_0x85db('0x4b')](_0x2fb5ce);return parseSearchFilter(_0x4ef4db,_0x283b13[_0x85db('0x61')]);})[_0x85db('0x5e')](function(_0x992a63){_0x11c93a[_0x85db('0x61')]=_0x992a63;return _0x11c93a;});}function checkAccountsRestrictions(_0x43b095,_0x5ede54,_0x35760e){var _0x355be9=utils['getAccountFK'](_0x43b095);var _0x5b38c6=_0x85db('0x62')+_['capitalize'](_0x43b095)+(_0x43b095===_0x85db('0x63')?_0x85db('0x64'):_0x85db('0x65'));var _0x3f39a8=squel['expr']();return Promise[_0x85db('0x5d')]()['then'](function(){if(_0x35760e['search']&&_0x5ede54['role']===_0x85db('0x6')){return _0x5ede54[_0x5b38c6]({'attributes':['id'],'raw':!![]});}})[_0x85db('0x5e')](function(_0x4fdec2){if(_0x4fdec2){if(_0x4fdec2[_0x85db('0x15')]===0x0){_0x3f39a8[_0x85db('0x4b')]('i.'+_0x355be9+'\x20IS\x20NULL');}else{_0x3f39a8[_0x85db('0x4b')]('i.'+_0x355be9+_0x85db('0x66'),_[_0x85db('0x17')](_0x4fdec2,'id'));}}else if(!_0x35760e[_0x355be9]){_0x3f39a8[_0x85db('0x4b')]('i.'+_0x355be9+_0x85db('0x67'));}})[_0x85db('0x5e')](function(){return _0x3f39a8;});}function getClosedOrderClause(_0x4d3859,_0x3fcd58){var _0x427250='';var _0x27f466=[_0x85db('0x68'),_0x85db('0x69'),_0x85db('0x6a')];if(_0x4d3859===_0x85db('0x32')){_0x27f466[_0x85db('0x6b')]('i.substatus');}if(_0x3fcd58['closed']==='0'&&_0x4d3859==='mail'){_0x427250='i.substatus';}else{if(_0x3fcd58[_0x85db('0x6c')]==='1'){_0x27f466[_0x85db('0x6d')]();}_0x427250=_0x85db('0x6e')+_0x27f466[_0x85db('0x6f')](',\x20')+')';}return _0x427250;}function getFilteredInteractions(_0x3b6da1,_0x2f7148,_0x5636fa,_0x367ebe){var _0x6e3240=utils[_0x85db('0x70')](_0x3b6da1);var _0x19f37e=_['capitalize'](_0x3b6da1)+_0x85db('0x71');var _0x3dc6f0=[];var _0x9f80c9=getTagsQuery();var _0x1aa93a={'type':db[_0x85db('0x72')][_0x85db('0x73')][_0x85db('0x74')],'raw':!![]};var _0x2af26e=[];var _0x357a98=[];return db[_0x85db('0x75')]['query'](_0x9f80c9[_0x85db('0x76')](),_0x1aa93a)[_0x85db('0x5e')](function(_0x40ccc6){_0x3dc6f0=_[_0x85db('0x77')](_0x40ccc6,'id');_0x1aa93a=_[_0x85db('0x78')](_0x1aa93a,{'model':db[_0x19f37e],'mapToModel':!![],'nest':!![]});if(_0x5636fa['fields']){_0x367ebe[_0x85db('0x79')][_0x85db('0x26')](function(_0x1ebe67){_0x2f7148[_0x85db('0x9')]('i.'+_0x1ebe67);});}else{_0x2f7148[_0x85db('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x85db('0x43'));_0x2f7148[_0x85db('0x9')](_0x85db('0x7a'),'Account.key');_0x2f7148[_0x85db('0x9')](_0x85db('0x7b'),_0x85db('0x7c'));if(_0x3b6da1==='mail'){_0x2f7148[_0x85db('0x9')](_0x85db('0x7d'),'Account.email');_0x2f7148[_0x85db('0x9')](_0x85db('0x7e'),_0x85db('0x7f'));_0x2f7148[_0x85db('0x9')](_0x85db('0x80'));_0x2f7148[_0x85db('0x9')](_0x85db('0x81'));_0x2f7148[_0x85db('0x9')](_0x85db('0x82'));_0x2f7148[_0x85db('0x9')](_0x85db('0x83'));_0x2f7148[_0x85db('0x9')](_0x85db('0x84'));_0x2f7148[_0x85db('0x9')](_0x85db('0x85'));_0x2f7148['field'](_0x85db('0x86'));_0x2f7148[_0x85db('0x9')](_0x85db('0x87'));_0x2f7148[_0x85db('0x9')]('i.subject');_0x2f7148['field'](_0x85db('0x6a'));_0x2f7148['field'](_0x85db('0x69'));_0x2f7148[_0x85db('0x9')](_0x85db('0x68'));_0x2f7148['field'](_0x85db('0x88'));_0x2f7148[_0x85db('0x9')](_0x85db('0x89'));_0x2f7148[_0x85db('0x9')]('i.ContactId');_0x2f7148[_0x85db('0x9')]('i.MailAccountId');_0x2f7148[_0x85db('0x9')](_0x85db('0x8a'));}else if(_0x3b6da1===_0x85db('0x31')){_0x2f7148[_0x85db('0x9')](_0x85db('0x8b'),_0x85db('0x7f'));}else{_0x2f7148[_0x85db('0x9')](_0x85db('0x8c'),_0x85db('0x7f'));}if(_0x3b6da1!==_0x85db('0x32')){_0x2f7148[_0x85db('0x9')](_0x85db('0x8d'));}_0x2f7148[_0x85db('0x9')]('c.firstName',_0x85db('0x8e'));_0x2f7148['field'](_0x85db('0x8f'),_0x85db('0x90'));_0x2f7148['field'](_0x85db('0x91'),_0x85db('0x92'));_0x2f7148[_0x85db('0x9')]('c.phone',_0x85db('0x93'));_0x2f7148['field'](_0x85db('0x94'),'Contact.mobile');_0x2f7148[_0x85db('0x9')](_0x85db('0x95'),'Contact.fax');_0x2f7148[_0x85db('0x9')](_0x85db('0x96'),_0x85db('0x97'));_0x2f7148[_0x85db('0x9')](_0x85db('0x98'),_0x85db('0x99'));_0x2f7148['field'](_0x85db('0x9a'),_0x85db('0x9b'));}if(_0x367ebe[_0x85db('0x9c')]){_0x2f7148['limit'](_0x367ebe[_0x85db('0x9c')]);}if(_0x367ebe[_0x85db('0x9d')]){_0x2f7148[_0x85db('0x9d')](_0x367ebe[_0x85db('0x9d')]);}return db[_0x85db('0x75')][_0x85db('0x9e')](_0x2f7148[_0x85db('0x76')](),_0x1aa93a);})[_0x85db('0x5e')](function(_0x37d815){_0x2af26e=_0x37d815;var _0x3cd417=getUsersQuery(_0x3b6da1,_0x2af26e);return db[_0x85db('0x75')]['query'](_0x3cd417[_0x85db('0x76')](),_0x1aa93a);})[_0x85db('0x5e')](function(_0xdcb072){_0x357a98=_['groupBy'](_0xdcb072,_0x6e3240);if(_0x3b6da1===_0x85db('0x32')){return db['Setting'][_0x85db('0x9f')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x85db('0x5e')](function(_0x48425e){var _0xdedf9e=_0x48425e?_0x48425e['enableEmailPreview']:undefined;var _0x28741a=_0x2af26e[_0x85db('0x17')](function(_0x4d268a){return updateInteraction(_0x4d268a,_0x3dc6f0,_0x357a98,_0xdedf9e);});return Promise[_0x85db('0xa0')](_0x28741a);});}function countFilteredInteractions(_0x4caabb,_0x5b921c){var _0x911e72=_0x4caabb[_0x85db('0xa1')]();_0x911e72[_0x85db('0x9')](_0x85db('0xa2'));_0x911e72[_0x85db('0x9')](_0x85db('0xa3'),'unreadMessages');var _0x45c568=utils[_0x85db('0xa4')](_0x5b921c);if(!_[_0x85db('0xa5')](_0x45c568)){_0x911e72[_0x85db('0x16')](_0x85db('0xa6'),_0x45c568);}var _0x483cf1={'type':db[_0x85db('0x72')]['QueryTypes'][_0x85db('0x74')],'raw':!![]};return db[_0x85db('0x75')][_0x85db('0x9e')](_0x911e72['toString'](),_0x483cf1);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xaf93=['offset','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','exports','lodash','squel','./update-interaction','updateInteraction','../../mysqldb','getAccountFK','agent','select','name','from','tools_tags','getInteractionFK','user_has_','_interactions','field','u.id','u.fullname','ui.','left_join','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','conditions','find','buildExpression','text','value','start','unreadMessages','and','Contact','operator','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','end','Tag','tags','clause','ids','User','$substring','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','forEach','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','Websites','Accounts','search','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','mail','unshift','closed','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.ContactId','i.UserId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit'];(function(_0xffb2d9,_0x487c5a){var _0x8160bb=function(_0x172a72){while(--_0x172a72){_0xffb2d9['push'](_0xffb2d9['shift']());}};_0x8160bb(++_0x487c5a);}(_0xaf93,0x151));var _0x3af9=function(_0x2096b2,_0x53c8bd){_0x2096b2=_0x2096b2-0x0;var _0x540b16=_0xaf93[_0x2096b2];return _0x540b16;};'use strict';var _=require(_0x3af9('0x0'));var squel=require(_0x3af9('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x3af9('0x2'))[_0x3af9('0x3')];var utils=require('./utils');var db=require(_0x3af9('0x4'))['db'];function skipInteractionsQuery(_0x44ae6e,_0x5add3,_0x189013){var _0x1cbec3=![];var _0x1ad446=utils[_0x3af9('0x5')](_0x44ae6e);if(_0x5add3['role']===_0x3af9('0x6')&&!_0x189013['search']&&!_0x189013[_0x1ad446]){_0x1cbec3=!![];}return _0x1cbec3;}function getTagsQuery(){return squel[_0x3af9('0x7')]()['field']('id')['field'](_0x3af9('0x8'))['field']('color')[_0x3af9('0x9')](_0x3af9('0xa'));}function getUsersQuery(_0x42b89a,_0x17ad50){var _0x507254=utils[_0x3af9('0xb')](_0x42b89a);var _0x412af3=_0x3af9('0xc')+_0x42b89a+_0x3af9('0xd');var _0x17a888=squel[_0x3af9('0x7')]()[_0x3af9('0xe')](_0x3af9('0xf'))['field'](_0x3af9('0x10'))['field'](_0x3af9('0x11')+_0x507254)[_0x3af9('0x9')](_0x412af3,'ui')[_0x3af9('0x12')]('users','u',_0x3af9('0x13'));if(_0x17ad50[_0x3af9('0x14')]>0x0){_0x17a888[_0x3af9('0x15')]('ui.'+_0x507254+_0x3af9('0x16'),_[_0x3af9('0x17')](_0x17ad50,'id'));}return _0x17a888;}function getInteractionsQuery(_0xa92aa4){var _0x29dc4b=utils['getInteractionsTables'](_0xa92aa4);var _0x1d3410=utils[_0x3af9('0x5')](_0xa92aa4);var _0x298135=utils[_0x3af9('0xb')](_0xa92aa4);return squel[_0x3af9('0x7')]()['from'](_0x29dc4b[_0x3af9('0x18')],'i')[_0x3af9('0x12')](_0x3af9('0x19'),'c',_0x3af9('0x1a'))[_0x3af9('0x12')]('users','o',_0x3af9('0x1b'))[_0x3af9('0x12')](_0x29dc4b[_0x3af9('0x1c')],'a',_0x3af9('0x1d')+_0x1d3410)[_0x3af9('0x12')](_0x29dc4b[_0x3af9('0x1e')],'me','me.'+_0x298135+'\x20=\x20i.id')[_0x3af9('0x12')](_0x29dc4b['interactionsTags'],'it','it.'+_0x298135+_0x3af9('0x1f'))['left_join'](_0x3af9('0xa'),'t',_0x3af9('0x20'));}function getSqlClauses(){var _0x4b5a5c={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0x3af9('0x21')](),'fields':squel[_0x3af9('0x21')](),'filter':squel[_0x3af9('0x21')](),'read':squel[_0x3af9('0x21')](),'tags':{'clause':squel[_0x3af9('0x21')](),'ids':null},'user':squel[_0x3af9('0x21')]()};return _0x4b5a5c;}function parseTagParameter(_0x3a3bbb){var _0x22d269=squel['expr']();if(_0x3a3bbb){var _0x24ed9b=utils[_0x3af9('0x22')](_0x3a3bbb);_0x24ed9b['forEach'](function(_0x177650){_0x22d269['or'](_0x3af9('0x23'),'%,'+_0x177650+',%');});}return _0x22d269;}function parseReadParameter(_0x19643f){var _0xf8840='';if(_0x19643f){_0xf8840=_0x3af9('0x24');if(_0x19643f==='1'){_0xf8840=_0xf8840['replace'](_0x3af9('0x25'),'=');}else{_0xf8840=_0xf8840[_0x3af9('0x26')](_0x3af9('0x25'),'>');}}return _0xf8840;}function parseSearchFilter(_0x512b90,_0x4f5024){var _0x1a4932=squel[_0x3af9('0x21')]();if(_0x4f5024){var _0x8867c6=_0x4f5024['replace']('\x5c','\x5c\x5c')[_0x3af9('0x26')](/'/g,'\x27\x27');if(qs[_0x3af9('0x27')](_0x8867c6)){_0x1a4932['or'](_0x3af9('0x28'),_0x8867c6+'%');if(['sms',_0x3af9('0x29')][_0x3af9('0x2a')](_0x512b90)){_0x1a4932['or'](_0x3af9('0x2b'),_0x8867c6+'%');}else if(_0x512b90==='fax'){_0x1a4932['or'](_0x3af9('0x2c'),_0x8867c6+'%');}else if(_0x512b90===_0x3af9('0x2d')){_0x1a4932['or'](_0x3af9('0x2e'),_0x8867c6+'%');}}else if(_0x512b90==='mail'&&qs[_0x3af9('0x2f')](_0x8867c6)){_0x1a4932['or'](_0x3af9('0x30'),_0x8867c6+'%');}else{if(_0x512b90==='mail'){_0x1a4932['or'](_0x3af9('0x31'),qs['getFullTextValue'](_0x8867c6))['or'](_0x3af9('0x32'),qs['getFullTextValue'](_0x8867c6));}else{if(_0x512b90!=='fax'){_0x1a4932['or'](_0x3af9('0x33'),qs['getFullTextValue'](_0x8867c6));}_0x1a4932['or'](_0x3af9('0x34'),_0x8867c6+'%');}}}return _0x1a4932;}function parseAdvancedSearchFilter(_0x310fe9,_0x6f9be5){var _0x4dfdb3=getSqlClauses();var _0x5410f3=as[_0x3af9('0x35')](_0x310fe9);var _0x1bc341=_0x5410f3['sqlOperator'];for(var _0x58d019=0x0;_0x58d019<_0x5410f3[_0x3af9('0x36')]['length'];_0x58d019++){var _0xe17a30=_0x5410f3[_0x3af9('0x36')][_0x58d019];var _0x47db73='i';var _0x554566=_[_0x3af9('0x37')](_0x6f9be5,[_0x3af9('0x8'),_0xe17a30[_0x3af9('0xe')]]);if(_0x554566){var _0x30a6af=as[_0x3af9('0x38')](_0x47db73,_0x554566['type'],_0xe17a30);_0x4dfdb3['default'][_0x1bc341](_0x30a6af[_0x3af9('0x39')],_0x30a6af[_0x3af9('0x3a')][_0x3af9('0x3b')],_0x30a6af[_0x3af9('0x3a')]['end']);}else{switch(_0xe17a30['field']){case _0x3af9('0x3c'):var _0x245c77=parseReadParameter(_0xe17a30[_0x3af9('0x3a')]);_0x4dfdb3['read'][_0x3af9('0x3d')](_0x245c77);break;case _0x3af9('0x3e'):if(_0xe17a30[_0x3af9('0x3f')]==='$substring'){if(_0xe17a30[_0x3af9('0x3a')]['split']('\x20')[_0x3af9('0x14')]>0x1){_0x4dfdb3[_0x3af9('0x40')][_0x1bc341](_0x3af9('0x41'),qs[_0x3af9('0x42')](_0xe17a30[_0x3af9('0x3a')]),null);}else{var _0x18a75c='%'+_0xe17a30[_0x3af9('0x3a')]+'%';_0x4dfdb3[_0x3af9('0x40')][_0x1bc341](_0x3af9('0x43'),_0x18a75c,_0x18a75c,_0x18a75c);}}else{_0x554566=_[_0x3af9('0x37')](_0x6f9be5,[_0x3af9('0x8'),'ContactId']);_0xe17a30[_0x3af9('0xe')]=_0x3af9('0x44');_0x30a6af=as[_0x3af9('0x38')](_0x47db73,_0x554566[_0x3af9('0x45')],_0xe17a30);_0x4dfdb3[_0x3af9('0x40')][_0x1bc341](_0x30a6af[_0x3af9('0x39')],_0x30a6af[_0x3af9('0x3a')][_0x3af9('0x3b')],_0x30a6af[_0x3af9('0x3a')][_0x3af9('0x46')]);}break;case _0x3af9('0x47'):var _0x1f7d8a=_0xe17a30['value']['split'](',')[_0x3af9('0x17')](function(_0x1daea4){return Number(_0x1daea4);});var _0x36e982=parseTagParameter(_0x1f7d8a);_0x4dfdb3[_0x3af9('0x48')][_0x3af9('0x49')][_0x3af9('0x3d')](_0x36e982);_0x4dfdb3[_0x3af9('0x48')][_0x3af9('0x4a')]=_0x1f7d8a;break;case _0x3af9('0x4b'):if(_0xe17a30[_0x3af9('0x3f')]===_0x3af9('0x4c')){_0x4dfdb3[_0x3af9('0x4d')][_0x1bc341](_0x3af9('0x4e'),'%'+_0xe17a30['value']+'%',null);}else{_0x554566=_[_0x3af9('0x37')](_0x6f9be5,[_0x3af9('0x8'),_0x3af9('0x4f')]);_0xe17a30[_0x3af9('0xe')]='UserId';_0x30a6af=as['buildExpression'](_0x47db73,_0x554566[_0x3af9('0x45')],_0xe17a30);_0x4dfdb3['user'][_0x1bc341](_0x30a6af[_0x3af9('0x39')],_0x30a6af[_0x3af9('0x3a')][_0x3af9('0x3b')],_0x30a6af[_0x3af9('0x3a')]['end']);}break;case _0x3af9('0x50'):case _0x3af9('0x51'):_0x30a6af=as[_0x3af9('0x38')]('me',null,_0xe17a30);_0x4dfdb3['body'][_0x1bc341](_0x30a6af['text'],_0x30a6af[_0x3af9('0x3a')]['start'],_0x30a6af['value']['end']);break;}}}return _0x4dfdb3;}function parseModelFields(_0x19bd47,_0x3bc784,_0x8ba5d3){var _0x42b78e=utils[_0x3af9('0x5')](_0x19bd47);var _0x45ca84=squel[_0x3af9('0x21')]();var _0x48377b=_(_0x3bc784)[_0x3af9('0x52')]()[_0x3af9('0x17')](function(_0x38c943){return _[_0x3af9('0x53')](_0x8ba5d3,[_0x3af9('0x8'),_0x38c943])?_0x38c943:undefined;})[_0x3af9('0x54')]()['value']();if(_0x48377b[_0x3af9('0x14')]>0x0){_0x48377b[_0x3af9('0x55')](function(_0x1cbfc7){if(_0x1cbfc7===_0x42b78e){_0x45ca84[_0x3af9('0x3d')]('i.'+_0x42b78e+'\x20IN\x20?',[][_0x3af9('0x56')](_0x3bc784[_0x1cbfc7]));}else if(_0x1cbfc7===_0x3af9('0x57')){var _0x2e55f2=JSON[_0x3af9('0x58')](_0x3bc784[_0x1cbfc7])['$gte'];var _0x1f19ee=JSON[_0x3af9('0x58')](_0x3bc784[_0x1cbfc7])[_0x3af9('0x59')];_0x45ca84[_0x3af9('0x3d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e55f2,_0x1f19ee);}else{if(_0x3bc784[_0x1cbfc7]==='null'){_0x45ca84[_0x3af9('0x3d')]('i.'+_0x1cbfc7+_0x3af9('0x5a'));}else{_0x45ca84[_0x3af9('0x3d')]('i.'+_0x1cbfc7+_0x3af9('0x5b'),_0x3bc784[_0x1cbfc7]);}}});}return _0x45ca84;}function parseQueryParameters(_0x3f087a,_0x268820,_0x3d757b){var _0x364e44=getSqlClauses();return Promise[_0x3af9('0x5c')]()[_0x3af9('0x5d')](function(){return parseModelFields(_0x3f087a,_0x268820,_0x3d757b);})[_0x3af9('0x5d')](function(_0x589747){_0x364e44[_0x3af9('0x5e')][_0x3af9('0x3d')](_0x589747);return parseReadParameter(_0x268820['read']);})['then'](function(_0x296101){_0x364e44['read'][_0x3af9('0x3d')](_0x296101);return parseTagParameter(_0x268820[_0x3af9('0x5f')]);})['then'](function(_0x5870f5){_0x364e44[_0x3af9('0x48')][_0x3af9('0x49')][_0x3af9('0x3d')](_0x5870f5);return parseSearchFilter(_0x3f087a,_0x268820[_0x3af9('0x60')]);})['then'](function(_0x3ed77e){_0x364e44['filter']=_0x3ed77e;return _0x364e44;});}function checkAccountsRestrictions(_0x180a32,_0x3e630,_0x391c9e){var _0x58b2ff=utils[_0x3af9('0x5')](_0x180a32);var _0x1d6c31=_0x3af9('0x61')+_[_0x3af9('0x62')](_0x180a32)+(_0x180a32==='chat'?_0x3af9('0x63'):_0x3af9('0x64'));var _0x1f0d5e=squel[_0x3af9('0x21')]();return Promise[_0x3af9('0x5c')]()[_0x3af9('0x5d')](function(){if(_0x391c9e[_0x3af9('0x65')]&&_0x3e630['role']===_0x3af9('0x6')){return _0x3e630[_0x1d6c31]({'attributes':['id'],'raw':!![]});}})[_0x3af9('0x5d')](function(_0x28e8fb){if(_0x28e8fb){if(_0x28e8fb[_0x3af9('0x14')]===0x0){_0x1f0d5e[_0x3af9('0x3d')]('i.'+_0x58b2ff+'\x20IS\x20NULL');}else{_0x1f0d5e[_0x3af9('0x3d')]('i.'+_0x58b2ff+_0x3af9('0x16'),_[_0x3af9('0x17')](_0x28e8fb,'id'));}}else if(!_0x391c9e[_0x58b2ff]){_0x1f0d5e[_0x3af9('0x3d')]('i.'+_0x58b2ff+_0x3af9('0x66'));}})[_0x3af9('0x5d')](function(){return _0x1f0d5e;});}function getClosedOrderClause(_0x35674b,_0x129712){var _0x40051e='';var _0x2e6e85=['i.thirdDisposition',_0x3af9('0x67'),_0x3af9('0x68')];if(_0x35674b===_0x3af9('0x69')){_0x2e6e85[_0x3af9('0x6a')]('i.substatus');}if(_0x129712[_0x3af9('0x6b')]==='0'&&_0x35674b===_0x3af9('0x69')){_0x40051e=_0x3af9('0x6c');}else{if(_0x129712[_0x3af9('0x6b')]==='1'){_0x2e6e85[_0x3af9('0x6d')]();}_0x40051e=_0x3af9('0x6e')+_0x2e6e85[_0x3af9('0x6f')](',\x20')+')';}return _0x40051e;}function getFilteredInteractions(_0x54c07c,_0x1d9d19,_0x5d7376,_0x30d746){var _0x1a3f20=utils[_0x3af9('0xb')](_0x54c07c);var _0x22cf37=_[_0x3af9('0x62')](_0x54c07c)+_0x3af9('0x70');var _0x50c934=[];var _0x1ef413=getTagsQuery();var _0x498081={'type':db[_0x3af9('0x71')][_0x3af9('0x72')][_0x3af9('0x73')],'raw':!![]};var _0x3e88eb=[];var _0x5e2287=[];return db[_0x3af9('0x74')][_0x3af9('0x75')](_0x1ef413[_0x3af9('0x76')](),_0x498081)[_0x3af9('0x5d')](function(_0x1a7f88){_0x50c934=_[_0x3af9('0x77')](_0x1a7f88,'id');_0x498081=_[_0x3af9('0x78')](_0x498081,{'model':db[_0x22cf37],'mapToModel':!![],'nest':!![]});if(_0x5d7376[_0x3af9('0x5e')]){_0x30d746[_0x3af9('0x79')][_0x3af9('0x55')](function(_0x4831a3){_0x1d9d19[_0x3af9('0xe')]('i.'+_0x4831a3);});}else{_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x7a'),_0x3af9('0x3c'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x7b'),_0x3af9('0x7c'));_0x1d9d19['field'](_0x3af9('0x7d'),_0x3af9('0x7e'));if(_0x54c07c===_0x3af9('0x69')){_0x1d9d19['field'](_0x3af9('0x7f'),_0x3af9('0x80'));_0x1d9d19[_0x3af9('0xe')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x3af9('0x81'));_0x1d9d19[_0x3af9('0xe')]('i.id');_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x82'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x83'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x84'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x85'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x86'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x87'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x88'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x89'));_0x1d9d19['field'](_0x3af9('0x68'));_0x1d9d19[_0x3af9('0xe')]('i.secondDisposition');_0x1d9d19[_0x3af9('0xe')]('i.thirdDisposition');_0x1d9d19['field'](_0x3af9('0x6c'));_0x1d9d19[_0x3af9('0xe')]('i.to');_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x8a'));_0x1d9d19[_0x3af9('0xe')]('i.MailAccountId');_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x8b'));}else if(_0x54c07c===_0x3af9('0x2d')){_0x1d9d19[_0x3af9('0xe')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x3af9('0x81'));}else{_0x1d9d19['field'](_0x3af9('0x8c'),_0x3af9('0x81'));}if(_0x54c07c!=='mail'){_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x8d'));}_0x1d9d19['field'](_0x3af9('0x8e'),_0x3af9('0x8f'));_0x1d9d19['field'](_0x3af9('0x90'),'Contact.lastName');_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x91'),_0x3af9('0x92'));_0x1d9d19[_0x3af9('0xe')]('c.phone',_0x3af9('0x93'));_0x1d9d19['field'](_0x3af9('0x94'),_0x3af9('0x95'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x96'),'Contact.fax');_0x1d9d19[_0x3af9('0xe')]('o.fullname',_0x3af9('0x97'));_0x1d9d19[_0x3af9('0xe')]('o.internal',_0x3af9('0x98'));_0x1d9d19[_0x3af9('0xe')](_0x3af9('0x99'),'TagIds');}if(_0x30d746[_0x3af9('0x9a')]){_0x1d9d19[_0x3af9('0x9a')](_0x30d746[_0x3af9('0x9a')]);}if(_0x30d746[_0x3af9('0x9b')]){_0x1d9d19['offset'](_0x30d746[_0x3af9('0x9b')]);}return db[_0x3af9('0x74')][_0x3af9('0x75')](_0x1d9d19[_0x3af9('0x76')](),_0x498081);})[_0x3af9('0x5d')](function(_0x23801f){_0x3e88eb=_0x23801f;var _0x56215a=getUsersQuery(_0x54c07c,_0x3e88eb);return db[_0x3af9('0x74')][_0x3af9('0x75')](_0x56215a[_0x3af9('0x76')](),_0x498081);})[_0x3af9('0x5d')](function(_0x1ad416){_0x5e2287=_[_0x3af9('0x9c')](_0x1ad416,_0x1a3f20);if(_0x54c07c==='mail'){return db['Setting'][_0x3af9('0x9d')]({'attributes':[_0x3af9('0x9e')],'raw':!![]});}})[_0x3af9('0x5d')](function(_0xe9bbbd){var _0x5dca1e=_0xe9bbbd?_0xe9bbbd[_0x3af9('0x9e')]:undefined;var _0x4f4573=_0x3e88eb[_0x3af9('0x17')](function(_0x4128ed){return updateInteraction(_0x4128ed,_0x50c934,_0x5e2287,_0x5dca1e);});return Promise[_0x3af9('0x9f')](_0x4f4573);});}function countFilteredInteractions(_0x4e910e,_0x20788e){var _0x2344a8=_0x4e910e[_0x3af9('0xa0')]();_0x2344a8[_0x3af9('0xe')](_0x3af9('0xa1'));_0x2344a8[_0x3af9('0xe')](_0x3af9('0x7a'),_0x3af9('0x3c'));var _0x27c280=utils['getSelectedTags'](_0x20788e);if(!_[_0x3af9('0xa2')](_0x27c280)){_0x2344a8[_0x3af9('0x15')]('t.id\x20IN\x20?',_0x27c280);}var _0xf5ff9c={'type':db[_0x3af9('0x71')][_0x3af9('0x72')][_0x3af9('0x73')],'raw':!![]};return db[_0x3af9('0x74')][_0x3af9('0x75')](_0x2344a8[_0x3af9('0x76')](),_0xf5ff9c);}module[_0x3af9('0xa3')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index d5edec8..6ce0f05 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd26=['../../mysqldb','map','fullname','split','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','findOne','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds'];(function(_0x395ed3,_0x3c3236){var _0x4b6935=function(_0x61988){while(--_0x61988){_0x395ed3['push'](_0x395ed3['shift']());}};_0x4b6935(++_0x3c3236);}(_0xcd26,0xd8));var _0x6cd2=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0xcd26[_0x17c483];return _0x112bdb;};'use strict';var _=require('lodash');var db=require(_0x6cd2('0x0'))['db'];function getInteractionUsers(_0x50efd3,_0x5ccd25){return new Promise(function(_0x33e771,_0xfb0639){try{var _0x477d50=[];if(_0x5ccd25[_0x50efd3]){_0x477d50=_0x5ccd25[_0x50efd3][_0x6cd2('0x1')](function(_0x3ed651){return{'id':_0x3ed651['id'],'fullname':_0x3ed651[_0x6cd2('0x2')]};});}return _0x33e771(_0x477d50);}catch(_0x4624d8){_0xfb0639(_0x4624d8);}});}function getInteractionTags(_0x1cb047,_0x12e779){var _0x43e447=[];if(_0x1cb047){_0x1cb047[_0x6cd2('0x3')](',')['forEach'](function(_0xb53f6e){_0x43e447[_0x6cd2('0x4')](_0x12e779[_0xb53f6e]);});}return _0x43e447;}function updateWaitingCounter(_0x4d531b){if(_0x4d531b['waiting']){_0x4d531b[_0x6cd2('0x5')]-=0x1;}}function updateInteractionCounters(_0x4008ef){_0x4008ef[_0x6cd2('0x5')]=0x0;_0x4008ef[_0x6cd2('0x6')]=0x0;_0x4008ef[_0x6cd2('0x7')]=0x0;_0x4008ef[_0x6cd2('0x8')]=0x0;_0x4008ef[_0x6cd2('0x9')]=0x0;_0x4008ef[_0x6cd2('0xa')]=0x0;if(_0x4008ef[_0x6cd2('0xb')]){if(_0x4008ef[_0x6cd2('0xc')]===_0x6cd2('0x9')){_0x4008ef[_0x6cd2('0x9')]+=0x1;updateWaitingCounter(_0x4008ef);}if(_0x4008ef[_0x6cd2('0xd')]){_0x4008ef[_0x6cd2('0x7')]+=0x1;if(_0x4008ef[_0x6cd2('0x6')]){_0x4008ef['talking']-=0x1;}}else{if(_0x4008ef[_0x6cd2('0xc')]){_0x4008ef[_0x6cd2('0x8')]+=0x1;updateWaitingCounter(_0x4008ef);}}}else{if(!_0x4008ef[_0x6cd2('0xd')]){_0x4008ef[_0x6cd2('0x5')]+=0x1;}if(_0x4008ef[_0x6cd2('0xd')]){_0x4008ef['talking']+=0x1;updateWaitingCounter(_0x4008ef);}}_0x4008ef[_0x6cd2('0xa')]+=0x1;return _0x4008ef;}function getLastMessageText(_0x4b58fb){return db['MailMessage'][_0x6cd2('0xe')]({'where':{'$and':[{'MailInteractionId':_0x4b58fb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x6cd2('0xf')],'order':_0x6cd2('0x10'),'raw':!![]})[_0x6cd2('0x11')](function(_0x563a90){if(_0x563a90&&_0x563a90['plainBody']){_0x4b58fb[_0x6cd2('0x12')]=_[_0x6cd2('0x13')](_0x563a90[_0x6cd2('0xf')]);}return _0x4b58fb;})[_0x6cd2('0x14')](function(_0x572c8b){throw _0x572c8b;});}exports[_0x6cd2('0x15')]=function(_0x615793,_0x54b68f,_0x2683c3,_0x3de4b1){return new Promise(function(_0x40029d,_0xf7d635){return getInteractionUsers(_0x615793['id'],_0x2683c3)[_0x6cd2('0x11')](function(_0x3366ad){_0x615793[_0x6cd2('0x16')]=_0x3366ad;return getInteractionTags(_0x615793['TagIds'],_0x54b68f);})[_0x6cd2('0x11')](function(_0x19afee){_0x615793['Tags']=_0x19afee;delete _0x615793[_0x6cd2('0x17')];return updateInteractionCounters(_0x615793);})[_0x6cd2('0x11')](function(_0x3a6283){if(_0x3de4b1){return getLastMessageText(_0x3a6283);}else{return _0x3a6283;}})[_0x6cd2('0x11')](function(_0x41a190){_0x40029d(_0x41a190);})[_0x6cd2('0x14')](function(_0x4ca424){_0xf7d635(_0x4ca424);});});}; \ No newline at end of file +var _0xa901=['trimStart','plainBody','catch','then','Users','TagIds','Tags','lodash','../../mysqldb','map','split','push','waiting','talking','abandoned','total','closed','UserId','answered','unmanaged','MailMessage','findOne','out','-id','lastMsgText'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0xa901,0x84));var _0x1a90=function(_0x214525,_0x5d595c){_0x214525=_0x214525-0x0;var _0x292ccf=_0xa901[_0x214525];return _0x292ccf;};'use strict';var _=require(_0x1a90('0x0'));var db=require(_0x1a90('0x1'))['db'];function getInteractionUsers(_0x3bdf94,_0x257368){return new Promise(function(_0x3e4371,_0x5cc819){try{var _0x39bbf0=[];if(_0x257368[_0x3bdf94]){_0x39bbf0=_0x257368[_0x3bdf94][_0x1a90('0x2')](function(_0x11be6a){return{'id':_0x11be6a['id'],'fullname':_0x11be6a['fullname']};});}return _0x3e4371(_0x39bbf0);}catch(_0x36c433){_0x5cc819(_0x36c433);}});}function getInteractionTags(_0x3e2351,_0x3b6612){var _0x64f948=[];if(_0x3e2351){_0x3e2351[_0x1a90('0x3')](',')['forEach'](function(_0x2bfa59){_0x64f948[_0x1a90('0x4')](_0x3b6612[_0x2bfa59]);});}return _0x64f948;}function updateWaitingCounter(_0x46864e){if(_0x46864e[_0x1a90('0x5')]){_0x46864e[_0x1a90('0x5')]-=0x1;}}function updateInteractionCounters(_0x2112b2){_0x2112b2['waiting']=0x0;_0x2112b2[_0x1a90('0x6')]=0x0;_0x2112b2['answered']=0x0;_0x2112b2['unmanaged']=0x0;_0x2112b2[_0x1a90('0x7')]=0x0;_0x2112b2[_0x1a90('0x8')]=0x0;if(_0x2112b2[_0x1a90('0x9')]){if(_0x2112b2['disposition']===_0x1a90('0x7')){_0x2112b2['abandoned']+=0x1;updateWaitingCounter(_0x2112b2);}if(_0x2112b2[_0x1a90('0xa')]){_0x2112b2[_0x1a90('0xb')]+=0x1;if(_0x2112b2[_0x1a90('0x6')]){_0x2112b2['talking']-=0x1;}}else{if(_0x2112b2['disposition']){_0x2112b2[_0x1a90('0xc')]+=0x1;updateWaitingCounter(_0x2112b2);}}}else{if(!_0x2112b2[_0x1a90('0xa')]){_0x2112b2[_0x1a90('0x5')]+=0x1;}if(_0x2112b2[_0x1a90('0xa')]){_0x2112b2[_0x1a90('0x6')]+=0x1;updateWaitingCounter(_0x2112b2);}}_0x2112b2[_0x1a90('0x8')]+=0x1;return _0x2112b2;}function getLastMessageText(_0x55544c){return db[_0x1a90('0xd')][_0x1a90('0xe')]({'where':{'$and':[{'MailInteractionId':_0x55544c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1a90('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x1a90('0x10'),'raw':!![]})['then'](function(_0x567dd5){if(_0x567dd5&&_0x567dd5['plainBody']){_0x55544c[_0x1a90('0x11')]=_[_0x1a90('0x12')](_0x567dd5[_0x1a90('0x13')]);}return _0x55544c;})[_0x1a90('0x14')](function(_0x2d3de3){throw _0x2d3de3;});}exports['updateInteraction']=function(_0x2f12c6,_0x3f164b,_0x1c70cd,_0x365592){return new Promise(function(_0x151500,_0xa65878){return getInteractionUsers(_0x2f12c6['id'],_0x1c70cd)[_0x1a90('0x15')](function(_0x41fa20){_0x2f12c6[_0x1a90('0x16')]=_0x41fa20;return getInteractionTags(_0x2f12c6[_0x1a90('0x17')],_0x3f164b);})['then'](function(_0x1ba5a9){_0x2f12c6[_0x1a90('0x18')]=_0x1ba5a9;delete _0x2f12c6[_0x1a90('0x17')];return updateInteractionCounters(_0x2f12c6);})[_0x1a90('0x15')](function(_0x5bd4c4){if(_0x365592){return getLastMessageText(_0x5bd4c4);}else{return _0x5bd4c4;}})[_0x1a90('0x15')](function(_0x1ac550){_0x151500(_0x1ac550);})[_0x1a90('0x14')](function(_0x574058){_0xa65878(_0x574058);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index e913963..f9505d1 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c7a=['capitalize','InteractionId','upperFirst','unknown','chat','websites','accounts','_interactions','_interaction_has_tags','_messages','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','info','catch','lodash','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','whatsapp-interactions','Website','Account'];(function(_0x1e2ebf,_0x4a32b0){var _0x5d5f94=function(_0x3b5f85){while(--_0x3b5f85){_0x1e2ebf['push'](_0x1e2ebf['shift']());}};_0x5d5f94(++_0x4a32b0);}(_0x9c7a,0x11a));var _0xa9c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c7a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa9c7('0x0'));var db=require(_0xa9c7('0x1'))['db'];var loggers={'openchannel':require(_0xa9c7('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0xa9c7('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xa9c7('0x2'))(_0xa9c7('0x4')),'chat':require(_0xa9c7('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0xa9c7('0x5'))};function getAccountFK(_0x5d8a2c){return _['capitalize'](_0x5d8a2c)+(_0x5d8a2c==='chat'?_0xa9c7('0x6'):_0xa9c7('0x7'))+'Id';}function getInteractionFK(_0x1424c8){return _[_0xa9c7('0x8')](_0x1424c8)+_0xa9c7('0x9');}function getInteractionId(_0x431146,_0x3eee41,_0x4fa891){if(_0x431146&&_0x431146[_[_0xa9c7('0xa')](_0x4fa891)+'InteractionId']){return _0x431146[_[_0xa9c7('0xa')](_0x4fa891)+_0xa9c7('0x9')];}else if(_0x431146&&_0x431146['id']){return _0x431146['id'];}else if(_0x3eee41&&_0x3eee41['id']){return _0x3eee41['id'];}else{return _0xa9c7('0xb');}}function getInteractionsTables(_0x274b8e){return{'accounts':_0x274b8e+'_'+(_0x274b8e===_0xa9c7('0xc')?_0xa9c7('0xd'):_0xa9c7('0xe')),'interactions':_0x274b8e+_0xa9c7('0xf'),'interactionsTags':_0x274b8e+_0xa9c7('0x10'),'messages':_0x274b8e+_0xa9c7('0x11'),'userInteractions':'user_has_'+_0x274b8e+_0xa9c7('0xf')};}function getSelectedTags(_0xecc8f9){var _0x5529f4=[];if(_0xecc8f9){_0x5529f4=Array['isArray'](_0xecc8f9)?_0xecc8f9:[_0xecc8f9];}return _0x5529f4;}function log(_0x159043,_0x196135,_0x1662fc,_0x43fc3f,_0x208c8b,_0x4b65a6){loggers[_0x208c8b['toLowerCase']()][_0x159043](_0xa9c7('0x12'),_0x4b65a6[_0xa9c7('0x13')](),_0x196135?_0x196135['id']:null,_0x196135?_0x196135[_0xa9c7('0x14')]:null,_0x196135?_0x196135[_0xa9c7('0x15')]:null,getInteractionId(_0x1662fc,_0x43fc3f,_0x208c8b),_0x1662fc?JSON[_0xa9c7('0x16')](_0x1662fc):_0xa9c7('0x17'));}function updateUser(_0x285b50,_0x5c95c6,_0x1a644d,_0x31f6f3,_0x25ac81){db[_[_0xa9c7('0xa')](_0x31f6f3)+_0xa9c7('0x18')][_0xa9c7('0x19')]({'where':{'id':getInteractionId(_0x5c95c6,_0x1a644d,_0x31f6f3)}})[_0xa9c7('0x1a')](function(_0x3ff4aa){if(_0x3ff4aa){return _0x3ff4aa['update']({'UserId':_0x285b50?_0x285b50['id']:null});}})[_0xa9c7('0x1a')](function(_0x1a0d2c){if(_0x1a0d2c){log(_0xa9c7('0x1b'),_0x285b50,_0x5c95c6,_0x1a644d,_0x31f6f3,_0x25ac81);}})[_0xa9c7('0x1c')](function(){log('error',_0x285b50,_0x5c95c6,_0x1a644d,_0x31f6f3,_0x25ac81);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x8158=['[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','lodash','../../mysqldb','mail-interactions','../../config/logger','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','InteractionId','websites','accounts','_interactions','_interaction_has_tags','user_has_','isArray'];(function(_0x30af8c,_0x577577){var _0x3c209d=function(_0x2473c5){while(--_0x2473c5){_0x30af8c['push'](_0x30af8c['shift']());}};_0x3c209d(++_0x577577);}(_0x8158,0x109));var _0x8815=function(_0x293eb4,_0x10b418){_0x293eb4=_0x293eb4-0x0;var _0x3e5914=_0x8158[_0x293eb4];return _0x3e5914;};'use strict';var _=require(_0x8815('0x0'));var db=require(_0x8815('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require('../../config/logger')(_0x8815('0x2')),'fax':require(_0x8815('0x3'))(_0x8815('0x4')),'sms':require(_0x8815('0x3'))(_0x8815('0x5')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x8815('0x3'))(_0x8815('0x6'))};function getAccountFK(_0x12e8b1){return _[_0x8815('0x7')](_0x12e8b1)+(_0x12e8b1==='chat'?'Website':'Account')+'Id';}function getInteractionFK(_0x4d3fe6){return _['capitalize'](_0x4d3fe6)+_0x8815('0x8');}function getInteractionId(_0x5e376c,_0x14c69d,_0x4d39ed){if(_0x5e376c&&_0x5e376c[_['upperFirst'](_0x4d39ed)+'InteractionId']){return _0x5e376c[_['upperFirst'](_0x4d39ed)+_0x8815('0x8')];}else if(_0x5e376c&&_0x5e376c['id']){return _0x5e376c['id'];}else if(_0x14c69d&&_0x14c69d['id']){return _0x14c69d['id'];}else{return'unknown';}}function getInteractionsTables(_0xad1ce0){return{'accounts':_0xad1ce0+'_'+(_0xad1ce0==='chat'?_0x8815('0x9'):_0x8815('0xa')),'interactions':_0xad1ce0+_0x8815('0xb'),'interactionsTags':_0xad1ce0+_0x8815('0xc'),'messages':_0xad1ce0+'_messages','userInteractions':_0x8815('0xd')+_0xad1ce0+_0x8815('0xb')};}function getSelectedTags(_0x5fdce3){var _0x4b2979=[];if(_0x5fdce3){_0x4b2979=Array[_0x8815('0xe')](_0x5fdce3)?_0x5fdce3:[_0x5fdce3];}return _0x4b2979;}function log(_0xb081fd,_0xc0aca4,_0x3b6845,_0x528a97,_0x29660f,_0x4530ba){loggers[_0x29660f['toLowerCase']()][_0xb081fd](_0x8815('0xf'),_0x4530ba[_0x8815('0x10')](),_0xc0aca4?_0xc0aca4['id']:null,_0xc0aca4?_0xc0aca4[_0x8815('0x11')]:null,_0xc0aca4?_0xc0aca4[_0x8815('0x12')]:null,getInteractionId(_0x3b6845,_0x528a97,_0x29660f),_0x3b6845?JSON[_0x8815('0x13')](_0x3b6845):_0x8815('0x14'));}function updateUser(_0x3e3349,_0x2372a7,_0x4ac644,_0x3c1016,_0x13d011){db[_['upperFirst'](_0x3c1016)+_0x8815('0x15')][_0x8815('0x16')]({'where':{'id':getInteractionId(_0x2372a7,_0x4ac644,_0x3c1016)}})[_0x8815('0x17')](function(_0x2e0165){if(_0x2e0165){return _0x2e0165[_0x8815('0x18')]({'UserId':_0x3e3349?_0x3e3349['id']:null});}})[_0x8815('0x17')](function(_0x7b2951){if(_0x7b2951){log(_0x8815('0x19'),_0x3e3349,_0x2372a7,_0x4ac644,_0x3c1016,_0x13d011);}})[_0x8815('0x1a')](function(){log(_0x8815('0x1b'),_0x3e3349,_0x2372a7,_0x4ac644,_0x3c1016,_0x13d011);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index abc6062..c4aa871 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 _0x2b5a=['use','License','findOne','count','then','status','catch','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','hasOwnProperty'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0x2b5a,0x88));var _0xa2b5=function(_0x3465d2,_0x3bbe3a){_0x3465d2=_0x3465d2-0x0;var _0xb9065d=_0x2b5a[_0x3465d2];return _0xb9065d;};'use strict';var crypto=require('crypto');var util=require(_0xa2b5('0x0'));var compose=require(_0xa2b5('0x1'));var db=require(_0xa2b5('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4da9de,_0x2c89d0){if(_0x4da9de&&_0x2c89d0){if(_0x2c89d0[_0xa2b5('0x3')]&&_0x2c89d0[_0xa2b5('0x4')]){var _0x2bd75f=_0x2c89d0[_0xa2b5('0x3')];var _0x11af84=_0x2c89d0[_0xa2b5('0x4')];var _0x4a0450=_0x2bd75f[_0xa2b5('0x5')]('-')[0x4];var _0x9a1841=_0x2bd75f['split']('-')[0x0];var _0x6489ee=crypto[_0xa2b5('0x6')]('aes-256-ctr',util[_0xa2b5('0x7')](_0xa2b5('0x8'),_0x4a0450,_0x2bd75f,_0x9a1841));var _0x14800b=_0x6489ee[_0xa2b5('0x9')](_0x11af84,_0xa2b5('0xa'),_0xa2b5('0xb'));_0x14800b+=_0x6489ee[_0xa2b5('0xc')](_0xa2b5('0xb'));var _0x137120=JSON['parse'](_0x14800b);return _0x137120[_0xa2b5('0xd')](_0x4da9de)?_0x137120[_0x4da9de]:null;}}return null;}function isLimit(_0x2c647f,_0x5a9fc5,_0x53b5cf,_0x37930a){var _0x52f08e=_0x5a9fc5;return compose()[_0xa2b5('0xe')](function(_0x2c48e0,_0x2757d9,_0x46052f){return db[_0xa2b5('0xf')][_0xa2b5('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x49984d){var _0x39d988=getValueFromLicense(_0x2c647f,_0x49984d);return _0x39d988?_0x39d988:_0x52f08e;})['then'](function(_0x3c28bd){_0x52f08e=_0x3c28bd;return _0x53b5cf[_0xa2b5('0x11')](_0x37930a);})[_0xa2b5('0x12')](function(_0x1ec699){if(_0x1ec699>=_0x52f08e){return _0x2757d9[_0xa2b5('0x13')](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2c647f)});}_0x46052f();})[_0xa2b5('0x14')](function(_0x13bc6b){_0x46052f(_0x13bc6b);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xa2b5('0x15')],{'where':{'$or':[{'role':_0xa2b5('0x16')},{'role':_0xa2b5('0x17')}]}});}exports[_0xa2b5('0x18')]=isUserLimit; \ No newline at end of file +var _0x1571=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status'];(function(_0x4d578e,_0x2a820d){var _0x33948e=function(_0x51227b){while(--_0x51227b){_0x4d578e['push'](_0x4d578e['shift']());}};_0x33948e(++_0x2a820d);}(_0x1571,0x1d7));var _0x1157=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0x1571[_0x2e3107];return _0x833d69;};'use strict';var crypto=require('crypto');var util=require(_0x1157('0x0'));var compose=require(_0x1157('0x1'));var db=require(_0x1157('0x2'))['db'];var config=require(_0x1157('0x3'));function getValueFromLicense(_0x17bb2d,_0x281cb1){if(_0x17bb2d&&_0x281cb1){if(_0x281cb1[_0x1157('0x4')]&&_0x281cb1[_0x1157('0x5')]){var _0x1b6c48=_0x281cb1['data1'];var _0x21850e=_0x281cb1[_0x1157('0x5')];var _0x523325=_0x1b6c48[_0x1157('0x6')]('-')[0x4];var _0x3d222b=_0x1b6c48['split']('-')[0x0];var _0x3d0550=crypto[_0x1157('0x7')](_0x1157('0x8'),util[_0x1157('0x9')](_0x1157('0xa'),_0x523325,_0x1b6c48,_0x3d222b));var _0x15250d=_0x3d0550['update'](_0x21850e,_0x1157('0xb'),_0x1157('0xc'));_0x15250d+=_0x3d0550[_0x1157('0xd')](_0x1157('0xc'));var _0x36c99c=JSON[_0x1157('0xe')](_0x15250d);return _0x36c99c[_0x1157('0xf')](_0x17bb2d)?_0x36c99c[_0x17bb2d]:null;}}return null;}function isLimit(_0x2af1b2,_0x276d05,_0x4e0e68,_0x181187){var _0x5e28be=_0x276d05;return compose()[_0x1157('0x10')](function(_0x5f3afc,_0x29da09,_0x35a531){return db[_0x1157('0x11')][_0x1157('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x1157('0x13')](function(_0x5c3767){var _0x118846=getValueFromLicense(_0x2af1b2,_0x5c3767);return _0x118846?_0x118846:_0x5e28be;})[_0x1157('0x13')](function(_0xddd4f6){_0x5e28be=_0xddd4f6;return _0x4e0e68[_0x1157('0x14')](_0x181187);})[_0x1157('0x13')](function(_0xae188f){if(_0xae188f>=_0x5e28be){return _0x29da09[_0x1157('0x15')](0x193)['json']({'message':util[_0x1157('0x9')](_0x1157('0x16'),_0x2af1b2)});}_0x35a531();})[_0x1157('0x17')](function(_0x268e46){_0x35a531(_0x268e46);});});}function isUserLimit(){return isLimit(_0x1157('0x18'),0x1,db[_0x1157('0x19')],{'where':{'$or':[{'role':_0x1157('0x1a')},{'role':_0x1157('0x1b')}]}});}exports[_0x1157('0x1c')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 1231a0b..4c4fb25 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43c4=['days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','start','$endsWith','pop','DATE','utcOffset','add','minutes','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','shift','match','forEach','filter','indexOf','map','push','buildExpression','operator','$eq','$between','includes','$gt','$lte','value'];(function(_0x52ed18,_0x722adb){var _0x5d0a9e=function(_0x464a){while(--_0x464a){_0x52ed18['push'](_0x52ed18['shift']());}};_0x5d0a9e(++_0x722adb);}(_0x43c4,0xbc));var _0x443c=function(_0x3c6c8a,_0xe6f8ee){_0x3c6c8a=_0x3c6c8a-0x0;var _0x2f8e8b=_0x43c4[_0x3c6c8a];return _0x2f8e8b;};'use strict';var _=require('lodash');var moment=require(_0x443c('0x0'));exports['parseSearch']=function(_0x115f51){var _0x104fbd={'conditions':[]};_0x104fbd[_0x443c('0x1')]=_[_0x443c('0x2')](_0x115f51,_0x443c('0x3'))?'or':_0x443c('0x4');var _0x48b95c=_0x115f51[_0x443c('0x5')](_0x443c('0x6'),'')[_0x443c('0x5')](_0x443c('0x3'),'')[_0x443c('0x7')]('||');for(var _0x1f754f=0x0;_0x1f754f<_0x48b95c['length'];_0x1f754f++){var _0x363460=_0x48b95c[_0x1f754f][_0x443c('0x7')](':=');var _0x5de6ec=_0x363460[0x0];var _0x4c4744=_0x363460[_0x443c('0x8')](0x1);_0x4c4744['forEach'](function(_0x4f51d9){var _0x5023c2=_0x4f51d9[_0x443c('0x7')]('[')[_0x443c('0x9')]();var _0x5ec8e5=_0x4f51d9[_0x443c('0xa')](/\[(.*?)\]/g);_0x5ec8e5[_0x443c('0xb')](function(_0x3d450d){var _0x3ff9be=_0x3d450d[_0x443c('0x7')]('[')[_0x443c('0xc')](function(_0x1b323d){return _0x1b323d[_0x443c('0xd')](']')>-0x1;})[_0x443c('0xe')](function(_0x3cc2f1){return _0x3cc2f1['split'](']')[0x0];})[0x0];_0x104fbd['conditions'][_0x443c('0xf')]({'field':_0x5de6ec,'operator':_0x5023c2,'value':_0x3ff9be});});});}return _0x104fbd;};exports[_0x443c('0x10')]=function(_0x21fb5c,_0x5e2e53,_0x37235){var _0x27cc10={};if(_0x5e2e53==='DATE'){if(_0x37235[_0x443c('0x11')]===_0x443c('0x12')){_0x37235[_0x443c('0x11')]=_0x443c('0x13');_0x37235['value']+=','+_0x37235['value'];}else if(_[_0x443c('0x14')]([_0x443c('0x15'),_0x443c('0x16')],_0x37235[_0x443c('0x11')])){_0x37235[_0x443c('0x17')]=moment(_0x37235[_0x443c('0x17')])['add'](0x1,_0x443c('0x18'))[_0x443c('0x19')](_0x443c('0x1a'));}}if(_0x37235[_0x443c('0x1b')]){_0x5e2e53=_0x37235[_0x443c('0x1b')];_0x27cc10[_0x443c('0x1c')]=_0x443c('0x1d')+_0x21fb5c+'.'+_0x37235['field']+_0x443c('0x1e')+_0x37235[_0x443c('0x1b')]+')\x20'+parseOperator(_0x37235[_0x443c('0x11')]);}else{_0x27cc10[_0x443c('0x1c')]=_0x21fb5c+'.'+_0x37235[_0x443c('0x1f')]+'\x20'+parseOperator(_0x37235['operator']);}if(_['includes']([_0x443c('0x20'),_0x443c('0x21')],_0x37235[_0x443c('0x11')]))_0x27cc10['text']='('+_0x27cc10[_0x443c('0x1c')]+'\x20OR\x20'+_0x21fb5c+'.'+_0x37235[_0x443c('0x1f')]+_0x443c('0x22');_0x27cc10[_0x443c('0x17')]=parseValue(_0x5e2e53,_0x37235[_0x443c('0x11')],_0x37235['value']);return _0x27cc10;};function parseOperator(_0x22ea53){var _0x572a01;switch(_0x22ea53){case _0x443c('0x23'):_0x572a01=_0x443c('0x24');break;case'$notIn':_0x572a01='NOT\x20IN\x20?';break;case'$eq':_0x572a01=_0x443c('0x25');break;case'$ne':_0x572a01=_0x443c('0x26');break;case _0x443c('0x27'):case _0x443c('0x28'):case'$endsWith':_0x572a01='LIKE\x20?';break;case _0x443c('0x29'):_0x572a01=_0x443c('0x2a');break;case _0x443c('0x15'):_0x572a01=_0x443c('0x2b');break;case _0x443c('0x16'):_0x572a01=_0x443c('0x2c');break;case _0x443c('0x2d'):_0x572a01='>=\x20?';break;case'$between':_0x572a01='BETWEEN\x20?\x20AND\x20?';break;}return _0x572a01;}function parseValue(_0xde2a08,_0x5c8bae,_0x48aa0f){var _0x38bc3e={'start':undefined,'end':undefined};switch(_0x5c8bae){case _0x443c('0x23'):case _0x443c('0x21'):_0x38bc3e['start']=_0x48aa0f[_0x443c('0x7')](',');break;case _0x443c('0x27'):_0x38bc3e[_0x443c('0x2e')]='%'+_0x48aa0f+'%';break;case _0x443c('0x28'):_0x38bc3e[_0x443c('0x2e')]=_0x48aa0f+'%';break;case _0x443c('0x2f'):_0x38bc3e[_0x443c('0x2e')]='%'+_0x48aa0f;break;case _0x443c('0x13'):var _0x12996c=_0x48aa0f['split'](',');var _0x48aa0f=_0x12996c[_0x443c('0x9')]();var _0x4b0cad=_0x12996c[_0x443c('0x30')]();if(_0xde2a08===_0x443c('0x31')){_0x48aa0f=moment(_0x48aa0f)['utcOffset'](0x0,!![])[_0x443c('0x19')]();_0x4b0cad=moment(_0x4b0cad)[_0x443c('0x32')](0x0,!![])['add'](0x17,'hours')[_0x443c('0x33')](0x3b,_0x443c('0x34'))[_0x443c('0x33')](0x3b,'seconds')[_0x443c('0x19')]();}_0x38bc3e={'start':_0x48aa0f,'end':_0x4b0cad};break;default:_0x38bc3e[_0x443c('0x2e')]=_0x48aa0f;break;}return _0x38bc3e;} \ No newline at end of file +var _0x6252=['shift','filter','indexOf','map','conditions','push','DATE','operator','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo','text','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$in','start','$startsWith','format','utcOffset','add','hours','lodash','moment','parseSearch','sqlOperator','[$or]','replace','split','slice','forEach'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x6252,0xbf));var _0x2625=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x6252[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x2625('0x0'));var moment=require(_0x2625('0x1'));exports[_0x2625('0x2')]=function(_0x51a596){var _0x42c36f={'conditions':[]};_0x42c36f[_0x2625('0x3')]=_['startsWith'](_0x51a596,_0x2625('0x4'))?'or':'and';var _0x208dea=_0x51a596[_0x2625('0x5')]('[$and]','')[_0x2625('0x5')](_0x2625('0x4'),'')['split']('||');for(var _0x26fc1f=0x0;_0x26fc1f<_0x208dea['length'];_0x26fc1f++){var _0x31181b=_0x208dea[_0x26fc1f][_0x2625('0x6')](':=');var _0x26028b=_0x31181b[0x0];var _0x3d91e6=_0x31181b[_0x2625('0x7')](0x1);_0x3d91e6[_0x2625('0x8')](function(_0x2bf731){var _0x3cb34c=_0x2bf731['split']('[')[_0x2625('0x9')]();var _0x2d6f9c=_0x2bf731['match'](/\[(.*?)\]/g);_0x2d6f9c[_0x2625('0x8')](function(_0x1f63b0){var _0x51f93a=_0x1f63b0[_0x2625('0x6')]('[')[_0x2625('0xa')](function(_0x2cd985){return _0x2cd985[_0x2625('0xb')](']')>-0x1;})[_0x2625('0xc')](function(_0x35cfca){return _0x35cfca['split'](']')[0x0];})[0x0];_0x42c36f[_0x2625('0xd')][_0x2625('0xe')]({'field':_0x26028b,'operator':_0x3cb34c,'value':_0x51f93a});});});}return _0x42c36f;};exports['buildExpression']=function(_0x1deb5f,_0x5e2d5e,_0x156b7e){var _0x462d00={};if(_0x5e2d5e===_0x2625('0xf')){if(_0x156b7e[_0x2625('0x10')]==='$eq'){_0x156b7e[_0x2625('0x10')]=_0x2625('0x11');_0x156b7e[_0x2625('0x12')]+=','+_0x156b7e['value'];}else if(_[_0x2625('0x13')]([_0x2625('0x14'),_0x2625('0x15')],_0x156b7e[_0x2625('0x10')])){_0x156b7e[_0x2625('0x12')]=moment(_0x156b7e[_0x2625('0x12')])['add'](0x1,_0x2625('0x16'))['format'](_0x2625('0x17'));}}if(_0x156b7e[_0x2625('0x18')]){_0x5e2d5e=_0x156b7e[_0x2625('0x18')];_0x462d00[_0x2625('0x19')]='CAST('+_0x1deb5f+'.'+_0x156b7e[_0x2625('0x1a')]+'\x20AS\x20'+_0x156b7e[_0x2625('0x18')]+')\x20'+parseOperator(_0x156b7e['operator']);}else{_0x462d00[_0x2625('0x19')]=_0x1deb5f+'.'+_0x156b7e[_0x2625('0x1a')]+'\x20'+parseOperator(_0x156b7e[_0x2625('0x10')]);}if(_[_0x2625('0x13')](['$ne',_0x2625('0x1b')],_0x156b7e[_0x2625('0x10')]))_0x462d00[_0x2625('0x19')]='('+_0x462d00[_0x2625('0x19')]+_0x2625('0x1c')+_0x1deb5f+'.'+_0x156b7e[_0x2625('0x1a')]+_0x2625('0x1d');_0x462d00[_0x2625('0x12')]=parseValue(_0x5e2d5e,_0x156b7e[_0x2625('0x10')],_0x156b7e['value']);return _0x462d00;};function parseOperator(_0x32e9a9){var _0x2bc69c;switch(_0x32e9a9){case'$in':_0x2bc69c=_0x2625('0x1e');break;case'$notIn':_0x2bc69c=_0x2625('0x1f');break;case _0x2625('0x20'):_0x2bc69c=_0x2625('0x21');break;case'$ne':_0x2bc69c=_0x2625('0x22');break;case _0x2625('0x23'):case'$startsWith':case _0x2625('0x24'):_0x2bc69c=_0x2625('0x25');break;case _0x2625('0x26'):_0x2bc69c='<\x20?';break;case'$gt':_0x2bc69c=_0x2625('0x27');break;case _0x2625('0x15'):_0x2bc69c=_0x2625('0x28');break;case _0x2625('0x29'):_0x2bc69c='>=\x20?';break;case _0x2625('0x11'):_0x2bc69c=_0x2625('0x2a');break;}return _0x2bc69c;}function parseValue(_0x1406b9,_0x4d708d,_0x6c9e1d){var _0x4e9a40={'start':undefined,'end':undefined};switch(_0x4d708d){case _0x2625('0x2b'):case _0x2625('0x1b'):_0x4e9a40[_0x2625('0x2c')]=_0x6c9e1d['split'](',');break;case'$substring':_0x4e9a40[_0x2625('0x2c')]='%'+_0x6c9e1d+'%';break;case _0x2625('0x2d'):_0x4e9a40['start']=_0x6c9e1d+'%';break;case _0x2625('0x24'):_0x4e9a40[_0x2625('0x2c')]='%'+_0x6c9e1d;break;case'$between':var _0x41c341=_0x6c9e1d['split'](',');var _0x6c9e1d=_0x41c341['shift']();var _0x314f4a=_0x41c341['pop']();if(_0x1406b9==='DATE'){_0x6c9e1d=moment(_0x6c9e1d)['utcOffset'](0x0,!![])[_0x2625('0x2e')]();_0x314f4a=moment(_0x314f4a)[_0x2625('0x2f')](0x0,!![])[_0x2625('0x30')](0x17,_0x2625('0x31'))[_0x2625('0x30')](0x3b,'minutes')['add'](0x3b,'seconds')[_0x2625('0x2e')]();}_0x4e9a40={'start':_0x6c9e1d,'end':_0x314f4a};break;default:_0x4e9a40[_0x2625('0x2c')]=_0x6c9e1d;break;}return _0x4e9a40;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 89f1760..958ceaf 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 _0xf072=['DESC','unsigned','ASC','omit','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','pick','filter','object','includes','columns','where','merge','type','lower','col','options','lodash','sequelize','moment','parse','keys','fields','split','filters','forOwn','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','sort','map','cast','priority','substr'];(function(_0x44ea17,_0x422059){var _0x1d8af1=function(_0x159a75){while(--_0x159a75){_0x44ea17['push'](_0x44ea17['shift']());}};_0x1d8af1(++_0x422059);}(_0xf072,0x1cf));var _0x2f07=function(_0x245e27,_0xc348a4){_0x245e27=_0x245e27-0x0;var _0x3d005e=_0xf072[_0x245e27];return _0x3d005e;};'use strict';var _=require(_0x2f07('0x0'));var sequelize=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4f62b0){var _0x3c1c25=['ne'];try{var _0x5f20e3=JSON[_0x2f07('0x3')](_0x4f62b0);var _0x432696=Object[_0x2f07('0x4')](_0x5f20e3)[0x0];return _0x3c1c25['includes'](_0x432696);}catch(_0x1d5a33){return![];}}function getOperatorValue(_0x14d6e6){var _0x3643bb=JSON[_0x2f07('0x3')](_0x14d6e6);var _0x235418=Object[_0x2f07('0x4')](_0x3643bb)[0x0];var _0x33b99c=_0x3643bb[_0x235418];return{['$'+_0x235418]:_0x33b99c};}exports[_0x2f07('0x5')]=function(_0x4746c2){var _0x2e167=null;if(_0x4746c2){_0x2e167=_0x4746c2[_0x2f07('0x6')](',');}return _0x2e167;};exports[_0x2f07('0x7')]=function(_0x1a3848,_0x18fe13){var _0x14e237={};if(!_['isEmpty'](_0x1a3848)){_[_0x2f07('0x8')](_0x1a3848,function(_0x2f464b,_0x1d0812){try{if(_0x18fe13){var _0x3525be=_['find'](_0x18fe13,{'name':_0x1d0812})||{};if(hasSequelizeOperator(_0x2f464b)){_0x14e237[_0x1d0812]=getOperatorValue(_0x2f464b);}else if(_0x3525be['type']===_0x2f07('0x9')&&_[_0x2f07('0xa')](_0x2f464b)){var _0x58549c=JSON[_0x2f07('0x3')](_0x2f464b);var _0x34dbd4={'$gte':moment(moment(_0x58549c[_0x2f07('0xb')])['format'](_0x2f07('0xc')))[_0x2f07('0xd')]()[_0x2f07('0xe')](),'$lte':moment(moment(_0x58549c[_0x2f07('0xf')])[_0x2f07('0xe')](_0x2f07('0xc')))['utc']()[_0x2f07('0x10')](0x1,'s')['format']()};_0x14e237[_0x1d0812]=_0x34dbd4;}else if(_0x3525be[_0x2f07('0x11')]===_0x2f07('0x12')){_0x14e237[_0x1d0812]=_0x2f464b;}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}else{_0x14e237[_0x1d0812]=_[_0x2f07('0x13')](_0x2f464b)?_0x2f464b:JSON[_0x2f07('0x3')](_0x2f464b);}}catch(_0x1a6135){_0x14e237[_0x1d0812]=_0x2f464b[_0x2f07('0x6')](',');}});}return _0x14e237;};exports['limit']=function(_0x15c3dd){_0x15c3dd=parseInt(_0x15c3dd,0xa);if(!_0x15c3dd||_0x15c3dd<0x0){_0x15c3dd=LIMIT_VALUE;}return _0x15c3dd;};exports['offset']=function(_0x3cd3c0){_0x3cd3c0=parseInt(_0x3cd3c0,0xa);if(!_0x3cd3c0||_0x3cd3c0<0x0){_0x3cd3c0=0x0;}return _0x3cd3c0;};exports[_0x2f07('0x14')]=function(_0x119b68){var _0xd944d6,_0x2ef47d=null;if(_0x119b68){_0xd944d6=_0x119b68['split'](',');_0x2ef47d=_[_0x2f07('0x15')](_0xd944d6,function(_0x5a0146){if(_0x5a0146['indexOf']('-')===0x0){return[_0x5a0146==='priority'?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),'unsigned'):_0x5a0146[_0x2f07('0x18')](0x1),_0x2f07('0x19')];}else{return[_0x5a0146===_0x2f07('0x17')?sequelize[_0x2f07('0x16')](sequelize['col'](_0x2f07('0x17')),_0x2f07('0x1a')):_0x5a0146,_0x2f07('0x1b')];}});}return _0x2ef47d;};exports['omit']=function(_0x111376,_0x113916){if(_['isEmpty'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x13')](_0x111376)){for(var _0x1c9ca1=0x0;_0x1c9ca1<_0x111376['length'];_0x1c9ca1+=0x1){_0x111376[_0x1c9ca1]=this[_0x2f07('0x1c')](_0x111376[_0x1c9ca1],_0x113916);}return _0x111376;}if(!_['isObject'](_0x111376)){return _0x111376;}if(_[_0x2f07('0x1d')](_0x113916)){_0x113916=[_0x113916];}if(!_[_0x2f07('0x13')](_0x113916)){return _0x111376;}for(var _0x27bd72=0x0;_0x27bd72<_0x113916[_0x2f07('0x1e')];_0x27bd72+=0x1){_[_0x2f07('0x1f')](_0x111376,_0x113916[_0x27bd72]);}for(var _0x139ea8 in _0x111376){if(_0x111376[_0x2f07('0x20')](_0x139ea8)){_0x111376[_0x139ea8]=this[_0x2f07('0x1c')](_0x111376[_0x139ea8],_0x113916);}}return _0x111376;};exports[_0x2f07('0x21')]=function(_0x468cd8){return _0x468cd8[_0x2f07('0x22')](RegExp(_0x2f07('0x23')))?!![]:![];};exports['isEmail']=function(_0x1accef){return _0x1accef[_0x2f07('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x2f07('0x24')]=function(_0x571839){var _0x36d4b8=[];_0x571839[_0x2f07('0x6')](/[ ,]+/)[_0x2f07('0x25')](function(_0x5ad0de){_0x5ad0de=_0x5ad0de[_0x2f07('0x26')](/([^:]")"+/g,'$1');_0x5ad0de='+'+_0x5ad0de+'*';var _0x368e3d=/[ `!@#$%^&*()_\-?~]/;if(_0x5ad0de[_0x2f07('0x22')](_0x368e3d))_0x5ad0de='\x22'+_0x5ad0de+'\x22';_0x36d4b8[_0x2f07('0x27')](_0x5ad0de);});return _0x36d4b8[_0x2f07('0x28')]('\x20');};exports[_0x2f07('0x29')]=function(_0x3fed73,_0x5c7593,_0x1decd1){var _0x5b0407={},_0x3496eb={};if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')]){_0x5c7593[_0x2f07('0x2a')]['id']=_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];delete _0x5c7593[_0x2f07('0x2a')][_0x2f07('0x2b')];}_0x5b0407[_0x2f07('0x2c')]=_[_0x2f07('0x15')](_0x3fed73,_0x2f07('0x11'));_0x5b0407[_0x2f07('0x2a')]=_[_0x2f07('0x4')](_0x5c7593[_0x2f07('0x2a')]);_0x5b0407[_0x2f07('0x7')]=_[_0x2f07('0x2d')](_0x5b0407['model'],_0x5b0407['query']);_0x3496eb[_0x2f07('0x2e')]=_[_0x2f07('0x2d')](_0x5b0407[_0x2f07('0x2c')],this['fields'](_0x5c7593['query'][_0x2f07('0x5')]));_0x3496eb['attributes']=_0x3496eb[_0x2f07('0x2e')][_0x2f07('0x1e')]?_0x3496eb[_0x2f07('0x2e')]:_0x5b0407[_0x2f07('0x2c')];if(!_0x5c7593[_0x2f07('0x2a')]['hasOwnProperty'](_0x2f07('0x2f'))){_0x3496eb['limit']=this[_0x2f07('0x30')](_0x5c7593['query'][_0x2f07('0x30')]);_0x3496eb['offset']=this['offset'](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x31')]);}_0x3496eb['order']=this[_0x2f07('0x14')](_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x14')]);_0x3496eb['where']=this[_0x2f07('0x7')](_[_0x2f07('0x32')](_0x5c7593[_0x2f07('0x2a')],_0x5b0407[_0x2f07('0x7')]),_0x3fed73);if(_0x5c7593[_0x2f07('0x2a')][_0x2f07('0x33')]){var _0x1a0ef2=_0x3fed73;var _0x1a9645=_0x5c7593['query'][_0x2f07('0x33')];if(typeof _0x1a9645===_0x2f07('0x34')){_0x1a0ef2=_[_0x2f07('0x33')](_0x3fed73,function(_0x3f1b6b){return _[_0x2f07('0x35')](_0x1a9645[_0x2f07('0x36')],_0x3f1b6b[_0x2f07('0x11')]);});_0x1a9645=_0x1a9645['value'];}_0x3496eb[_0x2f07('0x37')]=_[_0x2f07('0x38')](_0x3496eb[_0x2f07('0x37')],{'$or':_[_0x2f07('0x15')](_0x1a0ef2,function(_0x3db7ad){if(_0x3db7ad[_0x2f07('0x39')]!=='VIRTUAL'){if(_0x1decd1){return sequelize[_0x2f07('0x37')](sequelize['fn'](_0x2f07('0x3a'),sequelize[_0x2f07('0x3b')](_0x3db7ad[_0x2f07('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x5c7593['query'][_0x2f07('0x33')]+'%')});}else{var _0x437e94={};_0x437e94[_0x3db7ad[_0x2f07('0x11')]]={'$like':'%'+_0x5c7593[_0x2f07('0x2a')]['filter']+'%'};return _0x437e94;}}})});}_0x3496eb=_[_0x2f07('0x38')]({},_0x3496eb,_0x5c7593[_0x2f07('0x3c')]);return _0x3496eb;}; \ No newline at end of file +var _0x814b=['unset','hasOwnProperty','match','^[+]?[0-9]*$','replace','push','join','query','$id','model','attributes','offset','where','filter','object','VIRTUAL','lower','merge','options','lodash','sequelize','moment','keys','includes','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','omit','length','isObject','isString'];(function(_0x21a386,_0x3b6417){var _0x32f656=function(_0x223f06){while(--_0x223f06){_0x21a386['push'](_0x21a386['shift']());}};_0x32f656(++_0x3b6417);}(_0x814b,0x1a2));var _0xb814=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x814b[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0xb814('0x0'));var sequelize=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2f4ece){var _0xfbb64b=['ne'];try{var _0x477725=JSON['parse'](_0x2f4ece);var _0x38c21a=Object[_0xb814('0x3')](_0x477725)[0x0];return _0xfbb64b[_0xb814('0x4')](_0x38c21a);}catch(_0x4237bc){return![];}}function getOperatorValue(_0x44931c){var _0x322a70=JSON['parse'](_0x44931c);var _0x3b0829=Object[_0xb814('0x3')](_0x322a70)[0x0];var _0x5c8539=_0x322a70[_0x3b0829];return{['$'+_0x3b0829]:_0x5c8539};}exports[_0xb814('0x5')]=function(_0x2913a6){var _0x186d5a=null;if(_0x2913a6){_0x186d5a=_0x2913a6[_0xb814('0x6')](',');}return _0x186d5a;};exports[_0xb814('0x7')]=function(_0x21d4a5,_0x1086f8){var _0x19aad8={};if(!_[_0xb814('0x8')](_0x21d4a5)){_[_0xb814('0x9')](_0x21d4a5,function(_0x10e4a6,_0x4b5f14){try{if(_0x1086f8){var _0x43dfe6=_['find'](_0x1086f8,{'name':_0x4b5f14})||{};if(hasSequelizeOperator(_0x10e4a6)){_0x19aad8[_0x4b5f14]=getOperatorValue(_0x10e4a6);}else if(_0x43dfe6[_0xb814('0xa')]===_0xb814('0xb')&&_[_0xb814('0xc')](_0x10e4a6)){var _0x2cc46b=JSON[_0xb814('0xd')](_0x10e4a6);var _0x3bde14={'$gte':moment(moment(_0x2cc46b[_0xb814('0xe')])[_0xb814('0xf')](_0xb814('0x10')))[_0xb814('0x11')]()[_0xb814('0xf')](),'$lte':moment(moment(_0x2cc46b[_0xb814('0x12')])[_0xb814('0xf')](_0xb814('0x10')))[_0xb814('0x11')]()[_0xb814('0x13')](0x1,'s')[_0xb814('0xf')]()};_0x19aad8[_0x4b5f14]=_0x3bde14;}else if(_0x43dfe6[_0xb814('0x14')]===_0xb814('0x15')){_0x19aad8[_0x4b5f14]=_0x10e4a6;}else{_0x19aad8[_0x4b5f14]=_[_0xb814('0x16')](_0x10e4a6)?_0x10e4a6:JSON[_0xb814('0xd')](_0x10e4a6);}}else{_0x19aad8[_0x4b5f14]=_['isArray'](_0x10e4a6)?_0x10e4a6:JSON[_0xb814('0xd')](_0x10e4a6);}}catch(_0x55ba16){_0x19aad8[_0x4b5f14]=_0x10e4a6[_0xb814('0x6')](',');}});}return _0x19aad8;};exports[_0xb814('0x17')]=function(_0x4c3007){_0x4c3007=parseInt(_0x4c3007,0xa);if(!_0x4c3007||_0x4c3007<0x0){_0x4c3007=LIMIT_VALUE;}return _0x4c3007;};exports['offset']=function(_0x55d63c){_0x55d63c=parseInt(_0x55d63c,0xa);if(!_0x55d63c||_0x55d63c<0x0){_0x55d63c=0x0;}return _0x55d63c;};exports[_0xb814('0x18')]=function(_0x4d5276){var _0x57c128,_0xb684ea=null;if(_0x4d5276){_0x57c128=_0x4d5276[_0xb814('0x6')](',');_0xb684ea=_[_0xb814('0x19')](_0x57c128,function(_0x4e139e){if(_0x4e139e[_0xb814('0x1a')]('-')===0x0){return[_0x4e139e==='priority'?sequelize[_0xb814('0x1b')](sequelize[_0xb814('0x1c')](_0xb814('0x1d')),_0xb814('0x1e')):_0x4e139e[_0xb814('0x1f')](0x1),_0xb814('0x20')];}else{return[_0x4e139e===_0xb814('0x1d')?sequelize['cast'](sequelize[_0xb814('0x1c')]('priority'),_0xb814('0x1e')):_0x4e139e,_0xb814('0x21')];}});}return _0xb684ea;};exports[_0xb814('0x22')]=function(_0x208927,_0x1c8a2e){if(_[_0xb814('0x8')](_0x208927)){return _0x208927;}if(_[_0xb814('0x16')](_0x208927)){for(var _0x5755ea=0x0;_0x5755ea<_0x208927[_0xb814('0x23')];_0x5755ea+=0x1){_0x208927[_0x5755ea]=this[_0xb814('0x22')](_0x208927[_0x5755ea],_0x1c8a2e);}return _0x208927;}if(!_[_0xb814('0x24')](_0x208927)){return _0x208927;}if(_[_0xb814('0x25')](_0x1c8a2e)){_0x1c8a2e=[_0x1c8a2e];}if(!_[_0xb814('0x16')](_0x1c8a2e)){return _0x208927;}for(var _0x1d5965=0x0;_0x1d5965<_0x1c8a2e[_0xb814('0x23')];_0x1d5965+=0x1){_[_0xb814('0x26')](_0x208927,_0x1c8a2e[_0x1d5965]);}for(var _0x5a6291 in _0x208927){if(_0x208927[_0xb814('0x27')](_0x5a6291)){_0x208927[_0x5a6291]=this[_0xb814('0x22')](_0x208927[_0x5a6291],_0x1c8a2e);}}return _0x208927;};exports['isNumeric']=function(_0x9008b2){return _0x9008b2[_0xb814('0x28')](RegExp(_0xb814('0x29')))?!![]:![];};exports['isEmail']=function(_0x20577b){return _0x20577b[_0xb814('0x28')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x338a28){var _0x526610=[];_0x338a28[_0xb814('0x6')](/[ ,]+/)['forEach'](function(_0x4cfc58){_0x4cfc58=_0x4cfc58[_0xb814('0x2a')](/([^:]")"+/g,'$1');_0x4cfc58='+'+_0x4cfc58+'*';var _0x4a4f27=/[ `!@#$%^&*()_\-?~]/;if(_0x4cfc58[_0xb814('0x28')](_0x4a4f27))_0x4cfc58='\x22'+_0x4cfc58+'\x22';_0x526610[_0xb814('0x2b')](_0x4cfc58);});return _0x526610[_0xb814('0x2c')]('\x20');};exports['getOptions']=function(_0x51d5ae,_0x26d3a9,_0x336e2b){var _0x523566={},_0x2c8943={};if(_0x26d3a9[_0xb814('0x2d')][_0xb814('0x2e')]){_0x26d3a9[_0xb814('0x2d')]['id']=_0x26d3a9[_0xb814('0x2d')][_0xb814('0x2e')];delete _0x26d3a9[_0xb814('0x2d')]['$id'];}_0x523566[_0xb814('0x2f')]=_[_0xb814('0x19')](_0x51d5ae,_0xb814('0x14'));_0x523566[_0xb814('0x2d')]=_[_0xb814('0x3')](_0x26d3a9['query']);_0x523566[_0xb814('0x7')]=_['intersection'](_0x523566[_0xb814('0x2f')],_0x523566[_0xb814('0x2d')]);_0x2c8943[_0xb814('0x30')]=_['intersection'](_0x523566[_0xb814('0x2f')],this[_0xb814('0x5')](_0x26d3a9['query'][_0xb814('0x5')]));_0x2c8943[_0xb814('0x30')]=_0x2c8943[_0xb814('0x30')][_0xb814('0x23')]?_0x2c8943[_0xb814('0x30')]:_0x523566[_0xb814('0x2f')];if(!_0x26d3a9['query'][_0xb814('0x27')]('nolimit')){_0x2c8943[_0xb814('0x17')]=this['limit'](_0x26d3a9[_0xb814('0x2d')]['limit']);_0x2c8943[_0xb814('0x31')]=this[_0xb814('0x31')](_0x26d3a9['query']['offset']);}_0x2c8943['order']=this['sort'](_0x26d3a9[_0xb814('0x2d')][_0xb814('0x18')]);_0x2c8943[_0xb814('0x32')]=this[_0xb814('0x7')](_['pick'](_0x26d3a9['query'],_0x523566[_0xb814('0x7')]),_0x51d5ae);if(_0x26d3a9['query'][_0xb814('0x33')]){var _0x1098eb=_0x51d5ae;var _0x178823=_0x26d3a9[_0xb814('0x2d')][_0xb814('0x33')];if(typeof _0x178823===_0xb814('0x34')){_0x1098eb=_[_0xb814('0x33')](_0x51d5ae,function(_0x28b2b4){return _[_0xb814('0x4')](_0x178823['columns'],_0x28b2b4['name']);});_0x178823=_0x178823['value'];}_0x2c8943[_0xb814('0x32')]=_['merge'](_0x2c8943[_0xb814('0x32')],{'$or':_['map'](_0x1098eb,function(_0x411723){if(_0x411723[_0xb814('0xa')]!==_0xb814('0x35')){if(_0x336e2b){return sequelize[_0xb814('0x32')](sequelize['fn']('lower',sequelize[_0xb814('0x1c')](_0x411723[_0xb814('0x14')])),{'$like':sequelize['fn'](_0xb814('0x36'),'%'+_0x26d3a9[_0xb814('0x2d')][_0xb814('0x33')]+'%')});}else{var _0x450a08={};_0x450a08[_0x411723['name']]={'$like':'%'+_0x26d3a9[_0xb814('0x2d')][_0xb814('0x33')]+'%'};return _0x450a08;}}})});}_0x2c8943=_[_0xb814('0x37')]({},_0x2c8943,_0x26d3a9[_0xb814('0x38')]);return _0x2c8943;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 3b60471..29e9dda 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5faa=['getAgents','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','name','fullname','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','isNil','voiceStatus','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','getAgentStatus','isArray','startCase','Queue','map','findOne'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x5faa,0x9b));var _0xa5fa=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x5faa[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0xa5fa('0x0'));var jayson=require(_0xa5fa('0x1'));var db=require(_0xa5fa('0x2'))['db'];var amiClient=jayson[_0xa5fa('0x3')][_0xa5fa('0x4')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x579bcb,_0x3276f){var _0x6ef17c=[_0x579bcb[_0xa5fa('0x5')],_0x579bcb[_0xa5fa('0x6')],_0x579bcb[_0xa5fa('0x7')],_0x579bcb[_0xa5fa('0x8')],_0x579bcb[_0xa5fa('0x9')],_0x579bcb[_0xa5fa('0xa')],_0x579bcb[_0xa5fa('0xb')]];if(!_0x3276f)return _['every'](_0x6ef17c);var _0x592ebb=_[_0xa5fa('0xc')](_0x6ef17c);return _0x592ebb['length']>0x0&&_0x592ebb[_0xa5fa('0xd')]<_0x6ef17c[_0xa5fa('0xd')]?!![]:![];}function isIdle(_0x5ee5c3){return _0x5ee5c3===_0xa5fa('0xe')||_0x5ee5c3===_0xa5fa('0xf')||_0x5ee5c3==='unavailable'||_0x5ee5c3==='ringing'||_[_0xa5fa('0x10')](_0x5ee5c3);}function isAgentIdle(_0x2097ea){if(_0x2097ea[_0xa5fa('0x11')]!==_0xa5fa('0xe')&&_0x2097ea[_0xa5fa('0xa')]){_0x2097ea[_0xa5fa('0x11')]=_0xa5fa('0x12');return![];}return _[_0xa5fa('0x13')]([_0x2097ea[_0xa5fa('0x14')],_0x2097ea[_0xa5fa('0x15')],_0x2097ea[_0xa5fa('0x16')],_0x2097ea[_0xa5fa('0x17')],_0x2097ea[_0xa5fa('0x18')],_0x2097ea[_0xa5fa('0x11')],_0x2097ea[_0xa5fa('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa5fa('0x1a')]('Agents',{})[_0xa5fa('0x1b')](function(_0x447c86){if(_0x447c86[_0xa5fa('0x1c')]){throw new Error(_0xa5fa('0x1d'));}var _0x3935f9=_0x447c86[_0xa5fa('0x1e')];return routingClient['request'](_0xa5fa('0x1f'),{})[_0xa5fa('0x1b')](function(_0xa1ee6b){if(_0xa1ee6b[_0xa5fa('0x1c')]){throw new Error(_0xa5fa('0x20'));}var _0x48922f=_0xa1ee6b[_0xa5fa('0x1e')];return _[_0xa5fa('0x21')]({},_0x3935f9,_0x48922f);});})[_0xa5fa('0x22')](function(_0x59291f){throw _0x59291f;});}exports[_0xa5fa('0x23')]=getRealtimeAgents;function getAgentStatus(_0x491c12){var _0x31d039=_0xa5fa('0xf');if(isAgentPaused(_0x491c12))_0x31d039=_0xa5fa('0x12');else if(isAgentPaused(_0x491c12,!![]))_0x31d039=_0xa5fa('0x24');else if(isAgentIdle(_0x491c12))_0x31d039=_0xa5fa('0xe');else _0x31d039='busy';return _0x31d039;}exports[_0xa5fa('0x25')]=getAgentStatus;function getAgentIdsByQueues(_0x2d2774,_0x170e2b){var _0x460187=_[_0xa5fa('0x26')](_0x2d2774)?_0x2d2774:[_0x2d2774];var _0xfa786=_[_0xa5fa('0x27')](_0x170e2b)+_0xa5fa('0x28');var _0x1bd1cb=_[_0xa5fa('0x29')](_0x460187,function(_0x341251){return db[_0xfa786][_0xa5fa('0x2a')]({'where':{'id':_0x341251}})[_0xa5fa('0x1b')](function(_0x4b3d3d){if(!_0x4b3d3d)return[];return _0x4b3d3d[_0xa5fa('0x2b')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x1bd1cb)[_0xa5fa('0x1b')](function(_0x520cf9){var _0x10857a=_(_0x520cf9)['flatten']()['map']('id')[_0xa5fa('0x2c')]()[_0xa5fa('0x2d')]();return _0x10857a;});}exports[_0xa5fa('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5a059b,_0x56a803,_0x2171d1){try{if(_0x56a803[_0xa5fa('0xd')]>0x0){_0x5a059b=_0x5a059b[_0xa5fa('0xc')](function(_0x345a04){return _0x56a803[_0xa5fa('0x2f')](_0x345a04['id']);});}var _0x56996c=_0x5a059b[_0xa5fa('0xc')](function(_0x9399a7){var _0x40ab2b='busy';if(isAgentIdle(_0x9399a7)){_0x40ab2b=_0xa5fa('0xe');}return _0x40ab2b===_0x2171d1;});return _[_0xa5fa('0x29')](_0x56996c,'id');}catch(_0x5bb728){throw _0x5bb728;}}exports[_0xa5fa('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x146da2,_0x5c7ebe,_0x37a9d7){return Promise[_0xa5fa('0x31')]()['then'](function(){if(_0x5c7ebe['length']>0x0){_0x146da2=_0x146da2['filter'](function(_0x4059b4){return _0x5c7ebe['includes'](_0x4059b4['id']);});}return _0x146da2;})['then'](function(){return db['User']['findAll']({'attributes':['id',_0xa5fa('0x32'),_0xa5fa('0x33'),'chatPause',_0xa5fa('0x6'),_0xa5fa('0x7'),_0xa5fa('0x8'),_0xa5fa('0x9'),_0xa5fa('0xa'),_0xa5fa('0xb'),_0xa5fa('0x34')],'where':{'id':{'$in':_['map'](_0x146da2,'id')}},'raw':!![]});})[_0xa5fa('0x1b')](function(_0x236697){return _0x236697[_0xa5fa('0x29')](function(_0x5b1d96){var _0x2d0a31=_[_0xa5fa('0x35')](_0x146da2,['id',_0x5b1d96['id']]);var _0x389a5b=filterAgentAttributes(_0x2d0a31);_[_0xa5fa('0x21')](_0x5b1d96,_0x389a5b);_0x5b1d96[_0xa5fa('0x36')]=getAgentStatus(_0x5b1d96);return _0x5b1d96;});})[_0xa5fa('0x1b')](function(_0x5f4c1d){var _0x5e1c39=sortAgentsByStatus(_0x5f4c1d,_0x37a9d7);return _[_0xa5fa('0x29')](_0x5e1c39,'id');})[_0xa5fa('0x22')](function(_0x855858){throw _0x855858;});}exports[_0xa5fa('0x37')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x248219){var _0xeddc22={'fields':[],'order':null};var _0x128bbf=_0x248219[_0xa5fa('0x38')](',');_0xeddc22[_0xa5fa('0x39')]=_[_0xa5fa('0xc')](_0x128bbf,function(_0x3fae6d){if(!_0x3fae6d[_0xa5fa('0x2f')](_0xa5fa('0x36'))){return!![];}_0xeddc22[_0xa5fa('0x3a')]=_[_0xa5fa('0x3b')](_0x3fae6d,'-')?_0xa5fa('0x3c'):_0xa5fa('0x3d');return![];});return _0xeddc22;}exports[_0xa5fa('0x3e')]=getUpdatedSortOptions;function validateSortParameter(_0x3641ca){if(_0x3641ca[_0xa5fa('0x2f')](_0xa5fa('0x33'))&&!_0x3641ca['includes'](_0xa5fa('0x3f'))){var _0x87ecb3=_0x3641ca[_0xa5fa('0x40')](0x0,_0x3641ca[_0xa5fa('0x41')](_0xa5fa('0x33')));_0x3641ca+=','+_0x87ecb3+_0xa5fa('0x3f');}return _0x3641ca;}exports[_0xa5fa('0x42')]=validateSortParameter;function sortAgentsByStatus(_0x1d22ba,_0x1b4213){var _0x1ae5f9=_0x1d22ba[_0xa5fa('0x43')](function(_0x24b224,_0x9eceff){if(_0x24b224['globalStatus']===_0x9eceff['globalStatus']){if(_0x24b224['globalStatus']===_0xa5fa('0x12')){if(_0x1b4213===_0xa5fa('0x3c')){return(_0x24b224[_0xa5fa('0x34')]||'')<(_0x9eceff['pauseType']||'')||_0x24b224[_0xa5fa('0x33')][_0xa5fa('0x44')]()>_0x9eceff['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x24b224[_0xa5fa('0x34')]||'')<(_0x9eceff[_0xa5fa('0x34')]||'')||_0x24b224[_0xa5fa('0x33')][_0xa5fa('0x44')]()>_0x9eceff[_0xa5fa('0x33')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x1b4213===_0xa5fa('0x3c')){return _0x24b224['fullname']['toLowerCase']()<_0x9eceff[_0xa5fa('0x33')][_0xa5fa('0x44')]()?0x1:-0x1;}else{return _0x24b224['fullname'][_0xa5fa('0x44')]()<_0x9eceff[_0xa5fa('0x33')][_0xa5fa('0x44')]()?-0x1:0x1;}}}else{if(_0x1b4213===_0xa5fa('0x3c')){return _0x24b224['globalStatus']<_0x9eceff['globalStatus']?0x1:-0x1;}else{return _0x24b224['globalStatus']<_0x9eceff['globalStatus']?-0x1:0x1;}}});return _0x1ae5f9;}exports[_0xa5fa('0x45')]=sortAgentsByStatus;function filterAgentAttributes(_0x373438){var _0x4a959a=[_0xa5fa('0x46'),_0xa5fa('0x47'),'lastLoginAt',_0xa5fa('0x48'),_0xa5fa('0x34'),_0xa5fa('0x48'),'internal',_0xa5fa('0x49'),_0xa5fa('0x5'),_0xa5fa('0x8'),_0xa5fa('0x7'),'smsPause',_0xa5fa('0xb'),_0xa5fa('0x6'),_0xa5fa('0xa'),_0xa5fa('0x4a'),_0xa5fa('0x4b'),'mailCapacity',_0xa5fa('0x4c'),_0xa5fa('0x4d'),_0xa5fa('0x4e'),_0xa5fa('0x4f'),_0xa5fa('0x50'),_0xa5fa('0x51'),_0xa5fa('0x52'),_0xa5fa('0x53'),_0xa5fa('0x54'),_0xa5fa('0x14'),'openchannelStatus',_0xa5fa('0x16'),_0xa5fa('0x18'),_0xa5fa('0x19'),'faxStatus',_0xa5fa('0x11'),'chatStatusTime',_0xa5fa('0x55'),_0xa5fa('0x56'),_0xa5fa('0x57'),_0xa5fa('0x58'),_0xa5fa('0x59'),_0xa5fa('0x5a'),_0xa5fa('0x5b'),_0xa5fa('0x5c'),_0xa5fa('0x5d'),'phoneBarEnableScreenRecordingByAgent',_0xa5fa('0x5e'),_0xa5fa('0x5f')];var _0x480af1=['chatPause','openchannelPause',_0xa5fa('0x7'),_0xa5fa('0x9'),_0xa5fa('0xb'),_0xa5fa('0x6'),_0xa5fa('0xa'),_0xa5fa('0x47')];var _0x547af2=_(_0x373438)[_0xa5fa('0x60')](_0x480af1)[_0xa5fa('0x61')](_0x4a959a)[_0xa5fa('0x2d')]();return _0x547af2;}exports[_0xa5fa('0x62')]=filterAgentAttributes; \ No newline at end of file +var _0x99f0=['Queue','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','includes','User','fullname','pauseType','merge','globalStatus','getSortedAgentsIdsByStatus','split','startsWith','DESC','ASC','internal','substring','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','mailStatus','faxStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','unknown','unavailable','isNil','voiceStatus','idle','pause','every','chatStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray'];(function(_0x3a5581,_0x8f7656){var _0x469741=function(_0x3d4e03){while(--_0x3d4e03){_0x3a5581['push'](_0x3a5581['shift']());}};_0x469741(++_0x8f7656);}(_0x99f0,0xea));var _0x099f=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x99f0[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x099f('0x0'));var jayson=require(_0x099f('0x1'));var db=require(_0x099f('0x2'))['db'];var amiClient=jayson[_0x099f('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x099f('0x3')][_0x099f('0x4')]({'port':0x232c});function isAgentPaused(_0x5062be,_0x4c8329){var _0x5e5500=[_0x5062be[_0x099f('0x5')],_0x5062be[_0x099f('0x6')],_0x5062be[_0x099f('0x7')],_0x5062be[_0x099f('0x8')],_0x5062be[_0x099f('0x9')],_0x5062be[_0x099f('0xa')],_0x5062be[_0x099f('0xb')]];if(!_0x4c8329)return _['every'](_0x5e5500);var _0x139e23=_[_0x099f('0xc')](_0x5e5500);return _0x139e23[_0x099f('0xd')]>0x0&&_0x139e23['length']<_0x5e5500['length']?!![]:![];}function isIdle(_0x6f9506){return _0x6f9506==='idle'||_0x6f9506===_0x099f('0xe')||_0x6f9506===_0x099f('0xf')||_0x6f9506==='ringing'||_[_0x099f('0x10')](_0x6f9506);}function isAgentIdle(_0x99921c){if(_0x99921c[_0x099f('0x11')]!==_0x099f('0x12')&&_0x99921c[_0x099f('0xa')]){_0x99921c[_0x099f('0x11')]=_0x099f('0x13');return![];}return _[_0x099f('0x14')]([_0x99921c[_0x099f('0x15')],_0x99921c['faxStatus'],_0x99921c['mailStatus'],_0x99921c['openchannelStatus'],_0x99921c[_0x099f('0x16')],_0x99921c[_0x099f('0x11')],_0x99921c[_0x099f('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x099f('0x18')]('Agents',{})[_0x099f('0x19')](function(_0x1e87e3){if(_0x1e87e3[_0x099f('0x1a')]){throw new Error(_0x099f('0x1b'));}var _0x26a008=_0x1e87e3[_0x099f('0x1c')];return routingClient[_0x099f('0x18')](_0x099f('0x1d'),{})['then'](function(_0x499570){if(_0x499570[_0x099f('0x1a')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x1dd7ab=_0x499570[_0x099f('0x1c')];return _['merge']({},_0x26a008,_0x1dd7ab);});})[_0x099f('0x1e')](function(_0x30de5f){throw _0x30de5f;});}exports[_0x099f('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x253ba3){var _0x7dcaef='unknown';if(isAgentPaused(_0x253ba3))_0x7dcaef=_0x099f('0x13');else if(isAgentPaused(_0x253ba3,!![]))_0x7dcaef=_0x099f('0x20');else if(isAgentIdle(_0x253ba3))_0x7dcaef=_0x099f('0x12');else _0x7dcaef=_0x099f('0x21');return _0x7dcaef;}exports[_0x099f('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x1832e7,_0x5755f9){var _0x527ebe=_[_0x099f('0x23')](_0x1832e7)?_0x1832e7:[_0x1832e7];var _0x572017=_['startCase'](_0x5755f9)+_0x099f('0x24');var _0x13f4a8=_[_0x099f('0x25')](_0x527ebe,function(_0x3cb6ae){return db[_0x572017][_0x099f('0x26')]({'where':{'id':_0x3cb6ae}})[_0x099f('0x19')](function(_0x5bba84){if(!_0x5bba84)return[];return _0x5bba84['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x099f('0x27')](_0x13f4a8)[_0x099f('0x19')](function(_0x408cc3){var _0x4cd4ea=_(_0x408cc3)[_0x099f('0x28')]()[_0x099f('0x25')]('id')[_0x099f('0x29')]()[_0x099f('0x2a')]();return _0x4cd4ea;});}exports[_0x099f('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1aa0aa,_0x4cd3d6,_0x2e05d0){try{if(_0x4cd3d6[_0x099f('0xd')]>0x0){_0x1aa0aa=_0x1aa0aa['filter'](function(_0x1c51a9){return _0x4cd3d6[_0x099f('0x2c')](_0x1c51a9['id']);});}var _0x3ff0e8=_0x1aa0aa[_0x099f('0xc')](function(_0x1c38b5){var _0x5334d6=_0x099f('0x21');if(isAgentIdle(_0x1c38b5)){_0x5334d6=_0x099f('0x12');}return _0x5334d6===_0x2e05d0;});return _[_0x099f('0x25')](_0x3ff0e8,'id');}catch(_0x412f8c){throw _0x412f8c;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2f9746,_0x2b9511,_0x5140ed){return Promise['resolve']()[_0x099f('0x19')](function(){if(_0x2b9511[_0x099f('0xd')]>0x0){_0x2f9746=_0x2f9746[_0x099f('0xc')](function(_0x316434){return _0x2b9511[_0x099f('0x2c')](_0x316434['id']);});}return _0x2f9746;})[_0x099f('0x19')](function(){return db[_0x099f('0x2d')]['findAll']({'attributes':['id','name',_0x099f('0x2e'),_0x099f('0x5'),_0x099f('0x6'),_0x099f('0x7'),'openchannelPause',_0x099f('0x9'),_0x099f('0xa'),'whatsappPause',_0x099f('0x2f')],'where':{'id':{'$in':_[_0x099f('0x25')](_0x2f9746,'id')}},'raw':!![]});})[_0x099f('0x19')](function(_0x2ce411){return _0x2ce411[_0x099f('0x25')](function(_0x1740ab){var _0x152c9a=_['find'](_0x2f9746,['id',_0x1740ab['id']]);var _0x2f8981=filterAgentAttributes(_0x152c9a);_[_0x099f('0x30')](_0x1740ab,_0x2f8981);_0x1740ab[_0x099f('0x31')]=getAgentStatus(_0x1740ab);return _0x1740ab;});})['then'](function(_0x128adc){var _0x581a60=sortAgentsByStatus(_0x128adc,_0x5140ed);return _['map'](_0x581a60,'id');})['catch'](function(_0x34d61b){throw _0x34d61b;});}exports[_0x099f('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x1768fe){var _0x1c130e={'fields':[],'order':null};var _0xad21fb=_0x1768fe[_0x099f('0x33')](',');_0x1c130e['fields']=_[_0x099f('0xc')](_0xad21fb,function(_0x29ec4f){if(!_0x29ec4f['includes']('globalStatus')){return!![];}_0x1c130e['order']=_[_0x099f('0x34')](_0x29ec4f,'-')?_0x099f('0x35'):_0x099f('0x36');return![];});return _0x1c130e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x134be9){if(_0x134be9[_0x099f('0x2c')](_0x099f('0x2e'))&&!_0x134be9['includes'](_0x099f('0x37'))){var _0x351939=_0x134be9[_0x099f('0x38')](0x0,_0x134be9[_0x099f('0x39')](_0x099f('0x2e')));_0x134be9+=','+_0x351939+_0x099f('0x37');}return _0x134be9;}exports[_0x099f('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0xf85eb1,_0x3e2a71){var _0x4653e2=_0xf85eb1['sort'](function(_0x13067e,_0x40713b){if(_0x13067e['globalStatus']===_0x40713b[_0x099f('0x31')]){if(_0x13067e[_0x099f('0x31')]===_0x099f('0x13')){if(_0x3e2a71===_0x099f('0x35')){return(_0x13067e[_0x099f('0x2f')]||'')<(_0x40713b[_0x099f('0x2f')]||'')||_0x13067e[_0x099f('0x2e')][_0x099f('0x3b')]()>_0x40713b['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x13067e[_0x099f('0x2f')]||'')<(_0x40713b[_0x099f('0x2f')]||'')||_0x13067e[_0x099f('0x2e')][_0x099f('0x3b')]()>_0x40713b[_0x099f('0x2e')][_0x099f('0x3b')]()?-0x1:0x1;}}else{if(_0x3e2a71===_0x099f('0x35')){return _0x13067e[_0x099f('0x2e')][_0x099f('0x3b')]()<_0x40713b['fullname'][_0x099f('0x3b')]()?0x1:-0x1;}else{return _0x13067e[_0x099f('0x2e')][_0x099f('0x3b')]()<_0x40713b[_0x099f('0x2e')][_0x099f('0x3b')]()?-0x1:0x1;}}}else{if(_0x3e2a71===_0x099f('0x35')){return _0x13067e[_0x099f('0x31')]<_0x40713b[_0x099f('0x31')]?0x1:-0x1;}else{return _0x13067e[_0x099f('0x31')]<_0x40713b[_0x099f('0x31')]?-0x1:0x1;}}});return _0x4653e2;}exports[_0x099f('0x3c')]=sortAgentsByStatus;function filterAgentAttributes(_0x3d89ee){var _0x19b044=[_0x099f('0x3d'),_0x099f('0x3e'),_0x099f('0x3f'),_0x099f('0x40'),_0x099f('0x2f'),_0x099f('0x40'),_0x099f('0x37'),'address',_0x099f('0x5'),_0x099f('0x8'),'mailPause','smsPause','whatsappPause','faxPause',_0x099f('0xa'),_0x099f('0x41'),_0x099f('0x42'),_0x099f('0x43'),'smsCapacity',_0x099f('0x44'),_0x099f('0x45'),_0x099f('0x46'),'openchannelCurrentCapacity',_0x099f('0x47'),_0x099f('0x48'),_0x099f('0x49'),_0x099f('0x4a'),_0x099f('0x15'),_0x099f('0x4b'),_0x099f('0x4c'),_0x099f('0x16'),_0x099f('0x17'),_0x099f('0x4d'),_0x099f('0x11'),_0x099f('0x4e'),'openchannelStatusTime',_0x099f('0x4f'),_0x099f('0x50'),_0x099f('0x51'),_0x099f('0x52'),_0x099f('0x53'),_0x099f('0x54'),'destconnectedlinenum',_0x099f('0x55'),_0x099f('0x56'),'phoneBarEnableAutomaticScreenRecording',_0x099f('0x57')];var _0x239dbc=[_0x099f('0x5'),'openchannelPause',_0x099f('0x7'),_0x099f('0x9'),_0x099f('0xb'),_0x099f('0x6'),'voicePause',_0x099f('0x3e')];var _0x203668=_(_0x3d89ee)['omit'](_0x239dbc)[_0x099f('0x58')](_0x19b044)[_0x099f('0x2a')]();return _0x203668;}exports[_0x099f('0x59')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 182c81c..7922868 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x3eb998,_0x4f5cee){var _0x272be1=function(_0x10bc96){while(--_0x10bc96){_0x3eb998['push'](_0x3eb998['shift']());}};_0x272be1(++_0x4f5cee);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x1a3243,_0x201872){var _0x33f2ca=function(_0x59d32e){while(--_0x59d32e){_0x1a3243['push'](_0x1a3243['shift']());}};_0x33f2ca(++_0x201872);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 4a15ac4..57920f8 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 _0x7cfe=['bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','digest','substring','lodash','crypto'];(function(_0x4a2b81,_0x3e5d32){var _0x731dc0=function(_0x5b2de2){while(--_0x5b2de2){_0x4a2b81['push'](_0x4a2b81['shift']());}};_0x731dc0(++_0x3e5d32);}(_0x7cfe,0x10e));var _0xe7cf=function(_0xb9268c,_0x174ec1){_0xb9268c=_0xb9268c-0x0;var _0x496b06=_0x7cfe[_0xb9268c];return _0x496b06;};'use strict';var _=require(_0xe7cf('0x0'));var os=require('os');var crypto=require(_0xe7cf('0x1'));var machine=require(_0xe7cf('0x2'));var exec=require(_0xe7cf('0x3'))[_0xe7cf('0x4')];var config=require(_0xe7cf('0x5'));function getInterfaces(){var _0x25515d=[];var _0x43028d=os[_0xe7cf('0x6')]();var _0x6d1e27=_[_0xe7cf('0x7')](_['keys'](_0x43028d));for(var _0x4f6b67=0x0;_0x4f6b67<_0x6d1e27[_0xe7cf('0x8')];_0x4f6b67++){var _0x31a38e=_0x43028d[_0x6d1e27[_0x4f6b67]][_0xe7cf('0x9')](function(_0x277c6e){return _0x277c6e[_0xe7cf('0xa')]===_0xe7cf('0xb')&&_0x277c6e[_0xe7cf('0xc')]===![];});_0x25515d=_0x25515d[_0xe7cf('0xd')](_0x31a38e);}return _0x25515d;}function getFirstInterface(){var _0x323950=_[_0xe7cf('0xe')](getInterfaces());return{'macAddress':_0x323950&&_0x323950[_0xe7cf('0xf')]?_0x323950['mac']:'00:00:00:00:00:00','ipAddress':_0x323950&&_0x323950['address']?_0x323950[_0xe7cf('0x10')]:_0xe7cf('0x11')};}exports[_0xe7cf('0x12')]=getFirstInterface;function getCPUhash(){var _0x52cc4e=_[_0xe7cf('0x7')](os[_0xe7cf('0x13')]()[_0xe7cf('0x14')](function(_0x4569fa){return _0x4569fa[_0xe7cf('0x15')];}))['join'](':');return crypto[_0xe7cf('0x16')]('md5')['update'](_0x52cc4e)['digest'](_0xe7cf('0x17'));}exports[_0xe7cf('0x18')]=function(){var _0xfeb991=os['platform']();var _0x36dc30=/[0-9a-f-]{36}/;if(config[_0xe7cf('0x19')]&&_0x36dc30[_0xe7cf('0x1a')](config[_0xe7cf('0x19')])){return config[_0xe7cf('0x19')];}else if(_0xfeb991===_0xe7cf('0x1b')){return exec(_0xe7cf('0x1c'),{'encoding':_0xe7cf('0x1d')})[_0xe7cf('0x1e')]('\x0d\x0a','');}else{var _0x49c507=getFirstInterface();var _0x433969=getCPUhash();var _0xecb204=_0x433969+'|'+os['hostname']()+'|'+_0x49c507['macAddress']+'|'+_0x49c507[_0xe7cf('0x1f')];var _0x5c13d5=crypto[_0xe7cf('0x16')]('md5')['update'](_0xecb204)[_0xe7cf('0x20')](_0xe7cf('0x17'));return _0x5c13d5[_0xe7cf('0x21')](0x0,0x8)+'-'+_0x5c13d5[_0xe7cf('0x21')](0x8,0xc)+'-'+_0x5c13d5[_0xe7cf('0x21')](0xc,0x10)+'-'+_0x5c13d5['substring'](0x10,0x14)+'-'+_0x5c13d5[_0xe7cf('0x21')](0x14);}}; \ No newline at end of file +var _0x51d0=['length','family','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','hex','getUuid','platform','licenseToken','win32','utf8','replace','hostname','macAddress','ipAddress','digest','substring','bimedia-machine-uuid','child_process','execSync','orderBy','keys'];(function(_0x332ddf,_0x1ed1b5){var _0x4798a9=function(_0x313ebf){while(--_0x313ebf){_0x332ddf['push'](_0x332ddf['shift']());}};_0x4798a9(++_0x1ed1b5);}(_0x51d0,0x1bb));var _0x051d=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x51d0[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x051d('0x0'));var exec=require(_0x051d('0x1'))[_0x051d('0x2')];var config=require('../environment');function getInterfaces(){var _0x238e14=[];var _0x460b61=os['networkInterfaces']();var _0x45e55e=_[_0x051d('0x3')](_[_0x051d('0x4')](_0x460b61));for(var _0x3fce58=0x0;_0x3fce58<_0x45e55e[_0x051d('0x5')];_0x3fce58++){var _0x1c67b4=_0x460b61[_0x45e55e[_0x3fce58]]['filter'](function(_0x4a1dc3){return _0x4a1dc3[_0x051d('0x6')]===_0x051d('0x7')&&_0x4a1dc3['internal']===![];});_0x238e14=_0x238e14['concat'](_0x1c67b4);}return _0x238e14;}function getFirstInterface(){var _0x215e21=_[_0x051d('0x8')](getInterfaces());return{'macAddress':_0x215e21&&_0x215e21[_0x051d('0x9')]?_0x215e21[_0x051d('0x9')]:_0x051d('0xa'),'ipAddress':_0x215e21&&_0x215e21[_0x051d('0xb')]?_0x215e21[_0x051d('0xb')]:_0x051d('0xc')};}exports[_0x051d('0xd')]=getFirstInterface;function getCPUhash(){var _0x47c6f2=_['orderBy'](os[_0x051d('0xe')]()[_0x051d('0xf')](function(_0x2d5181){return _0x2d5181[_0x051d('0x10')];}))[_0x051d('0x11')](':');return crypto[_0x051d('0x12')](_0x051d('0x13'))['update'](_0x47c6f2)['digest'](_0x051d('0x14'));}exports[_0x051d('0x15')]=function(){var _0x22737f=os[_0x051d('0x16')]();var _0x46babf=/[0-9a-f-]{36}/;if(config[_0x051d('0x17')]&&_0x46babf['test'](config[_0x051d('0x17')])){return config[_0x051d('0x17')];}else if(_0x22737f===_0x051d('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x051d('0x19')})[_0x051d('0x1a')]('\x0d\x0a','');}else{var _0x1509ac=getFirstInterface();var _0x154bd4=getCPUhash();var _0x5d57a5=_0x154bd4+'|'+os[_0x051d('0x1b')]()+'|'+_0x1509ac[_0x051d('0x1c')]+'|'+_0x1509ac[_0x051d('0x1d')];var _0x3b49f7=crypto[_0x051d('0x12')](_0x051d('0x13'))['update'](_0x5d57a5)[_0x051d('0x1e')](_0x051d('0x14'));return _0x3b49f7['substring'](0x0,0x8)+'-'+_0x3b49f7[_0x051d('0x1f')](0x8,0xc)+'-'+_0x3b49f7['substring'](0xc,0x10)+'-'+_0x3b49f7['substring'](0x10,0x14)+'-'+_0x3b49f7['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 4cf95f1..bdbe47b 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 _0x9c3d=['THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update'];(function(_0x5b69bc,_0x46c993){var _0x5b661e=function(_0x11e6c7){while(--_0x11e6c7){_0x5b69bc['push'](_0x5b69bc['shift']());}};_0x5b661e(++_0x46c993);}(_0x9c3d,0x11c));var _0xd9c3=function(_0x59591b,_0x354045){_0x59591b=_0x59591b-0x0;var _0x576642=_0x9c3d[_0x59591b];return _0x576642;};'use strict';var util=require(_0xd9c3('0x0'));var moment=require(_0xd9c3('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0xd9c3('0x2'))(module,_0xd9c3('0x3'));var db=require(_0xd9c3('0x4'))['db'];var encryptor=require(_0xd9c3('0x5'));var hardware=require('./hardware');var logger=require(_0xd9c3('0x6'))(_0xd9c3('0x7'));var HOST=_0xd9c3('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x32492a){return new BPromise(function(_0x3bf2b7,_0xf42fc9){var _0x27d542=util[_0xd9c3('0x9')](_0xd9c3('0xa'),HOST,_0x32492a,module[_0xd9c3('0xb')][_0xd9c3('0x3')]);if(oldToken){_0x27d542=util[_0xd9c3('0x9')](_0xd9c3('0xc'),HOST,_0x32492a,module[_0xd9c3('0xb')][_0xd9c3('0x3')],oldToken);}var _0x5d7af0={'uri':_0x27d542,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5d7af0)[_0xd9c3('0xd')](function(_0x246ab5){_0x3bf2b7(_0x246ab5);})['catch'](function(_0x5d021c){_0xf42fc9(_0x5d021c);});});}function manageLicense(_0x25f317,_0x33e8df){var _0x13eaf7=_0x33e8df[_0xd9c3('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x13eaf7[_0xd9c3('0xf')]!==_0x25f317&&!_0x13eaf7[_0xd9c3('0x10')]){oldToken=_0x13eaf7[_0xd9c3('0xf')];}httpRequest(_0x25f317)[_0xd9c3('0xd')](function(_0x236a76){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x236a76['active']){isOldTokenSent=![];if(!_0x13eaf7[_0xd9c3('0x7')]&&_0x13eaf7['license']!=_0x236a76['license']||_0x13eaf7[_0xd9c3('0x7')]&&_0x13eaf7[_0xd9c3('0x10')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x13eaf7[_0xd9c3('0x7')]&&!_0x13eaf7['data2']&&_0x13eaf7[_0xd9c3('0x7')]!=_0x236a76['license']){logger[_0xd9c3('0x11')](_0xd9c3('0x12'));}if(_0x13eaf7[_0xd9c3('0x7')]&&!_0x13eaf7[_0xd9c3('0x10')]&&_0x13eaf7[_0xd9c3('0x7')]==_0x236a76[_0xd9c3('0x7')]){return _0x33e8df;}return _0x33e8df[_0xd9c3('0x13')]({'data1':_0x25f317,'data2':null,'license':_0x236a76['license']});}else{if(_0x236a76[_0xd9c3('0x7')]||_0x13eaf7[_0xd9c3('0x7')]){if(!_0x13eaf7['data2']){if(_0x13eaf7['data1']==_0x25f317){GRAY_PERIOD_REASON='Disabled';logger[_0xd9c3('0x11')](_0xd9c3('0x14'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xd9c3('0x11')](_0xd9c3('0x15'),_0x13eaf7[_0xd9c3('0xf')],_0x25f317);}logger['info'](_0xd9c3('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xd9c3('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x33e8df['update']({'data2':encryptor[_0xd9c3('0x17')](moment()[_0xd9c3('0x9')](_0xd9c3('0x18')))});}else{if(moment()[_0xd9c3('0x19')](encryptor['decryptString'](_0x13eaf7[_0xd9c3('0x10')]),_0xd9c3('0x1a'))>DAYS){logger[_0xd9c3('0x11')](_0xd9c3('0x1b'),moment()[_0xd9c3('0x9')](_0xd9c3('0x18')));isOldTokenSent=![];return _0x33e8df['update']({'data1':_0x25f317,'data2':null,'license':null});}}}else{if(_0x13eaf7['data1']!=_0x25f317){logger[_0xd9c3('0x11')](_0xd9c3('0x15'),_0x13eaf7[_0xd9c3('0xf')],_0x25f317);return _0x33e8df[_0xd9c3('0x13')]({'data1':_0x25f317,'data2':null,'license':null});}}}return _0x33e8df;})[_0xd9c3('0xd')](function(_0x4ddc42){_0x33e8df=_0x4ddc42;})[_0xd9c3('0x1c')](function(_0x1db961){logger[_0xd9c3('0x1d')](_0x1db961[_0xd9c3('0x1e')]);})[_0xd9c3('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0xd9c3('0x20')](),_0x33e8df);},TIME);});}function defaultLicense(){var _0x5035b8=hardware[_0xd9c3('0x20')]();if(_0x5035b8){return db[_0xd9c3('0x21')][_0xd9c3('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x5035b8}})[_0xd9c3('0x23')](function(_0x27a90f,_0x3c473a){logger[_0xd9c3('0x11')](_0xd9c3('0x24'),_0x5035b8);manageLicense(_0x5035b8,_0x27a90f);})[_0xd9c3('0x1c')](function(_0x5a55ed){logger[_0xd9c3('0x1d')](_0x5a55ed['message']);});}}exports[_0xd9c3('0x25')]=defaultLicense; \ No newline at end of file +var _0xff6f=['moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','https://www.xcallymotion.com','exports','format','GET','catch','get','data1','data2','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','then','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util'];(function(_0x2f1172,_0x5f5b26){var _0x58e374=function(_0x1a61fa){while(--_0x1a61fa){_0x2f1172['push'](_0x2f1172['shift']());}};_0x58e374(++_0x5f5b26);}(_0xff6f,0xf5));var _0xfff6=function(_0x1078bc,_0x115563){_0x1078bc=_0x1078bc-0x0;var _0x57d2dd=_0xff6f[_0x1078bc];return _0x57d2dd;};'use strict';var util=require(_0xfff6('0x0'));var moment=require(_0xfff6('0x1'));var rp=require(_0xfff6('0x2'));var BPromise=require(_0xfff6('0x3'));var pkginfo=require(_0xfff6('0x4'))(module,_0xfff6('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xfff6('0x6'));var hardware=require(_0xfff6('0x7'));var logger=require('../logger')('license');var HOST=_0xfff6('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3a28f6){return new BPromise(function(_0x2ac2b8,_0x1780dd){var _0x51d90f=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x3a28f6,module[_0xfff6('0x9')][_0xfff6('0x5')]);if(oldToken){_0x51d90f=util[_0xfff6('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x3a28f6,module['exports'][_0xfff6('0x5')],oldToken);}var _0x443253={'uri':_0x51d90f,'method':_0xfff6('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x443253)['then'](function(_0x56b514){_0x2ac2b8(_0x56b514);})[_0xfff6('0xc')](function(_0x522c27){_0x1780dd(_0x522c27);});});}function manageLicense(_0x443aed,_0x4c72e2){var _0x501261=_0x4c72e2[_0xfff6('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x501261[_0xfff6('0xe')]!==_0x443aed&&!_0x501261[_0xfff6('0xf')]){oldToken=_0x501261['data1'];}httpRequest(_0x443aed)['then'](function(_0x57d8df){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x57d8df[_0xfff6('0x10')]){isOldTokenSent=![];if(!_0x501261[_0xfff6('0x11')]&&_0x501261[_0xfff6('0x11')]!=_0x57d8df[_0xfff6('0x11')]||_0x501261[_0xfff6('0x11')]&&_0x501261['data2']){logger['info'](_0xfff6('0x12'));}if(_0x501261['license']&&!_0x501261[_0xfff6('0xf')]&&_0x501261[_0xfff6('0x11')]!=_0x57d8df[_0xfff6('0x11')]){logger[_0xfff6('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x501261[_0xfff6('0x11')]&&!_0x501261['data2']&&_0x501261[_0xfff6('0x11')]==_0x57d8df['license']){return _0x4c72e2;}return _0x4c72e2['update']({'data1':_0x443aed,'data2':null,'license':_0x57d8df[_0xfff6('0x11')]});}else{if(_0x57d8df[_0xfff6('0x11')]||_0x501261[_0xfff6('0x11')]){if(!_0x501261[_0xfff6('0xf')]){if(_0x501261[_0xfff6('0xe')]==_0x443aed){GRAY_PERIOD_REASON=_0xfff6('0x14');logger[_0xfff6('0x13')](_0xfff6('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xfff6('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x501261[_0xfff6('0xe')],_0x443aed);}logger[_0xfff6('0x13')](_0xfff6('0x16'),GRAY_PERIOD_REASON[_0xfff6('0x17')](),moment()[_0xfff6('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x4c72e2[_0xfff6('0x18')]({'data2':encryptor[_0xfff6('0x19')](moment()[_0xfff6('0xa')](_0xfff6('0x1a')))});}else{if(moment()[_0xfff6('0x1b')](encryptor[_0xfff6('0x1c')](_0x501261[_0xfff6('0xf')]),_0xfff6('0x1d'))>DAYS){logger['info'](_0xfff6('0x1e'),moment()[_0xfff6('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4c72e2['update']({'data1':_0x443aed,'data2':null,'license':null});}}}else{if(_0x501261[_0xfff6('0xe')]!=_0x443aed){logger[_0xfff6('0x13')](_0xfff6('0x1f'),_0x501261[_0xfff6('0xe')],_0x443aed);return _0x4c72e2[_0xfff6('0x18')]({'data1':_0x443aed,'data2':null,'license':null});}}}return _0x4c72e2;})[_0xfff6('0x20')](function(_0x5164c6){_0x4c72e2=_0x5164c6;})[_0xfff6('0xc')](function(_0x56212a){logger[_0xfff6('0x21')](_0x56212a[_0xfff6('0x22')]);})[_0xfff6('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xfff6('0x24')](),_0x4c72e2);},TIME);});}function defaultLicense(){var _0x36b8ad=hardware['getUuid']();if(_0x36b8ad){return db[_0xfff6('0x25')][_0xfff6('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x36b8ad}})['spread'](function(_0x11646d,_0x26873a){logger[_0xfff6('0x13')](_0xfff6('0x27'),_0x36b8ad);manageLicense(_0x36b8ad,_0x11646d);})[_0xfff6('0xc')](function(_0x1ced18){logger['error'](_0x1ced18[_0xfff6('0x22')]);});}}exports[_0xfff6('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b34e8f8..3eef669 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 _0x5480=['catch','pick','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','find','defaults','then','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','days','changed','disabled','message','role','sequelize','col','count','admin','telephone','telephones','forEach'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x5480,0x89));var _0x0548=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x5480[_0x484c03];return _0x294127;};'use strict';var util=require(_0x0548('0x0'));var _=require(_0x0548('0x1'));var moment=require(_0x0548('0x2'));var BPromise=require(_0x0548('0x3'));var hardware=require(_0x0548('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0x0548('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x0548('0x6'),'machineUuid':hardware[_0x0548('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0548('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0548('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x224dc3){return new BPromise(function(_0x4153a5,_0x2e11e7){return db['License'][_0x0548('0xa')](_[_0x0548('0xb')](_0x224dc3,{'raw':!![],'where':{'id':0x1}}))[_0x0548('0xc')](function(_0xdcd7f3){return checkLicense(_0xdcd7f3,null);})[_0x0548('0xc')](function(_0x407edc){_0x4153a5(_0x407edc);return;})['catch'](function(_0x2cf9d2){_0x2e11e7(_0x2cf9d2);});});}function checkLicense(_0x330faa,_0x7f5d4d){if(!_0x330faa){demoLicense[_0x0548('0xd')]=_0x330faa[_0x0548('0xe')];return demoLicense;}try{var _0x1ce2b3=_0x7f5d4d||_0x330faa['license'];if(_[_0x0548('0xf')](_0x1ce2b3)){throw new Error(_0x0548('0x10'));}var _0x2dc442=_0x330faa[_0x0548('0xe')];var _0x5d9d63=_0x330faa[_0x0548('0x11')];var _0x4925a6=_0x2dc442[_0x0548('0x12')]('-')[0x4];var _0x3e25da=_0x2dc442[_0x0548('0x12')]('-')[0x0];var _0x2658e6=encryptor[_0x0548('0x13')](_0x1ce2b3,util[_0x0548('0x14')](_0x0548('0x15'),_0x4925a6,_0x2dc442,_0x3e25da));var _0x3334eb=JSON[_0x0548('0x16')](_0x2658e6);_0x3334eb[_0x0548('0x17')]=![];_0x3334eb[_0x0548('0xd')]=_0x2dc442;_0x3334eb[_0x0548('0x18')]=hardware[_0x0548('0x7')]();if(_0x5d9d63){var _0x2a8347=encryptor['decryptString'](_0x5d9d63);_0x3334eb[_0x0548('0x19')]=_0x2a8347;_0x3334eb[_0x0548('0x1a')]=moment(_0x2a8347)['add'](0x7,_0x0548('0x1b'))[_0x0548('0x14')]();_0x3334eb['grayReason']=_0x3334eb[_0x0548('0xd')]!=_0x3334eb[_0x0548('0x18')]?_0x0548('0x1c'):_0x0548('0x1d');}return _0x3334eb;}catch(_0x29ffba){breakingLicense['uuid']=_0x330faa[_0x0548('0xe')];breakingLicense['message']=_0x29ffba[_0x0548('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x81e98d,_0x43d6ae){getLicense()[_0x0548('0xc')](function(_0x474492){return db['User']['findAll']({'attributes':[_0x0548('0x1f'),[db[_0x0548('0x20')]['fn']('COUNT',db['sequelize'][_0x0548('0x21')]('role')),_0x0548('0x22')]],'group':_0x0548('0x1f'),'where':{'role':{'$or':[_0x0548('0x23'),'user',_0x0548('0x24')]}},'raw':!![]})[_0x0548('0xc')](function(_0x1db48e){var _0x5bc312={'user':_0x474492['users']||0x0,'telephone':_0x474492[_0x0548('0x25')]||0x0};_0x1db48e[_0x0548('0x26')](function(_0x1a69eb){var _0x37e7d8=_0x1a69eb[_0x0548('0x1f')]===_0x0548('0x23')?'user':_0x1a69eb['role'];_0x5bc312[_0x37e7d8]-=_0x1a69eb['count'];if(_0x5bc312[_0x37e7d8]<0x0)_0x5bc312[_0x37e7d8]=0x0;});_0x81e98d(_0x5bc312);return;});})[_0x0548('0x27')](function(_0x1846ae){_0x43d6ae(_0x1846ae);});});}function checkUserLimits(_0x3aea07){return new BPromise(function(_0x2ae931,_0x23101e){getLimits()[_0x0548('0xc')](function(_0x58b5c8){var _0x47d1a9=_[_0x0548('0x28')](_['countBy'](_0x3aea07,_0x0548('0x1f')),[_0x0548('0x23'),_0x0548('0x29'),_0x0548('0x24')]);var _0x32f7ab=(_0x47d1a9[_0x0548('0x23')]||0x0)+(_0x47d1a9[_0x0548('0x29')]||0x0);var _0x31b23c=_0x47d1a9['telephone']||0x0;if(_0x32f7ab>_0x58b5c8['user'])return _0x23101e(_0x0548('0x2a'));if(_0x31b23c>_0x58b5c8[_0x0548('0x24')])return _0x23101e(_0x0548('0x2b'));return _0x2ae931();})[_0x0548('0x27')](function(_0x300f1e){_0x23101e(_0x300f1e);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x6afe=['catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','findAll','sequelize','COUNT','col','count','role','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','defaults','then'];(function(_0x4ae2fb,_0x1c1c67){var _0x4f5268=function(_0x11236b){while(--_0x11236b){_0x4ae2fb['push'](_0x4ae2fb['shift']());}};_0x4f5268(++_0x1c1c67);}(_0x6afe,0x177));var _0xe6af=function(_0xb6b285,_0x596e01){_0xb6b285=_0xb6b285-0x0;var _0x11393c=_0x6afe[_0xb6b285];return _0x11393c;};'use strict';var util=require(_0xe6af('0x0'));var _=require(_0xe6af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0xe6af('0x2'));var encryptor=require(_0xe6af('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe6af('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xe6af('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe6af('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xe6af('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x404be9){return new BPromise(function(_0x10499f,_0x3426d5){return db[_0xe6af('0x6')]['find'](_[_0xe6af('0x7')](_0x404be9,{'raw':!![],'where':{'id':0x1}}))[_0xe6af('0x8')](function(_0x114d59){return checkLicense(_0x114d59,null);})[_0xe6af('0x8')](function(_0x480a90){_0x10499f(_0x480a90);return;})[_0xe6af('0x9')](function(_0x16e347){_0x3426d5(_0x16e347);});});}function checkLicense(_0x169692,_0x379c66){if(!_0x169692){demoLicense['uuid']=_0x169692[_0xe6af('0xa')];return demoLicense;}try{var _0x3f0917=_0x379c66||_0x169692[_0xe6af('0xb')];if(_[_0xe6af('0xc')](_0x3f0917)){throw new Error(_0xe6af('0xd'));}var _0x5f1576=_0x169692[_0xe6af('0xa')];var _0x31c360=_0x169692[_0xe6af('0xe')];var _0x4984e3=_0x5f1576[_0xe6af('0xf')]('-')[0x4];var _0x4ea3d9=_0x5f1576[_0xe6af('0xf')]('-')[0x0];var _0x4bd3ee=encryptor[_0xe6af('0x10')](_0x3f0917,util[_0xe6af('0x11')](_0xe6af('0x12'),_0x4984e3,_0x5f1576,_0x4ea3d9));var _0x3cc92b=JSON[_0xe6af('0x13')](_0x4bd3ee);_0x3cc92b[_0xe6af('0x14')]=![];_0x3cc92b[_0xe6af('0x15')]=_0x5f1576;_0x3cc92b[_0xe6af('0x16')]=hardware[_0xe6af('0x5')]();if(_0x31c360){var _0x5dd9e1=encryptor[_0xe6af('0x10')](_0x31c360);_0x3cc92b[_0xe6af('0x17')]=_0x5dd9e1;_0x3cc92b[_0xe6af('0x18')]=moment(_0x5dd9e1)[_0xe6af('0x19')](0x7,_0xe6af('0x1a'))['format']();_0x3cc92b[_0xe6af('0x1b')]=_0x3cc92b[_0xe6af('0x15')]!=_0x3cc92b[_0xe6af('0x16')]?_0xe6af('0x1c'):_0xe6af('0x1d');}return _0x3cc92b;}catch(_0x2e759a){breakingLicense['uuid']=_0x169692[_0xe6af('0xa')];breakingLicense['message']=_0x2e759a[_0xe6af('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d4f6a,_0x4fdb57){getLicense()['then'](function(_0x2959de){return db['User'][_0xe6af('0x1f')]({'attributes':['role',[db[_0xe6af('0x20')]['fn'](_0xe6af('0x21'),db[_0xe6af('0x20')][_0xe6af('0x22')]('role')),_0xe6af('0x23')]],'group':_0xe6af('0x24'),'where':{'role':{'$or':[_0xe6af('0x25'),_0xe6af('0x26'),_0xe6af('0x27')]}},'raw':!![]})[_0xe6af('0x8')](function(_0x921ecd){var _0x28133e={'user':_0x2959de[_0xe6af('0x28')]||0x0,'telephone':_0x2959de[_0xe6af('0x29')]||0x0};_0x921ecd[_0xe6af('0x2a')](function(_0x23edbf){var _0x151f55=_0x23edbf[_0xe6af('0x24')]===_0xe6af('0x25')?_0xe6af('0x26'):_0x23edbf['role'];_0x28133e[_0x151f55]-=_0x23edbf[_0xe6af('0x23')];if(_0x28133e[_0x151f55]<0x0)_0x28133e[_0x151f55]=0x0;});_0x4d4f6a(_0x28133e);return;});})[_0xe6af('0x9')](function(_0x4e3bed){_0x4fdb57(_0x4e3bed);});});}function checkUserLimits(_0x555184){return new BPromise(function(_0x722000,_0x592b5f){getLimits()[_0xe6af('0x8')](function(_0x13e83a){var _0x3e18d7=_[_0xe6af('0x2b')](_[_0xe6af('0x2c')](_0x555184,'role'),['admin',_0xe6af('0x26'),_0xe6af('0x27')]);var _0x51d5e3=(_0x3e18d7['admin']||0x0)+(_0x3e18d7[_0xe6af('0x26')]||0x0);var _0x3b7e40=_0x3e18d7['telephone']||0x0;if(_0x51d5e3>_0x13e83a[_0xe6af('0x26')])return _0x592b5f(_0xe6af('0x2d'));if(_0x3b7e40>_0x13e83a[_0xe6af('0x27')])return _0x592b5f(_0xe6af('0x2e'));return _0x722000();})[_0xe6af('0x9')](function(_0x331b1b){_0x592b5f(_0x331b1b);});});}module[_0xe6af('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index aecb5e3..c517e7d 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 _0x5f2f=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0xc1e1d9,_0x5efc1f){var _0x34f04f=function(_0x36d43e){while(--_0x36d43e){_0xc1e1d9['push'](_0xc1e1d9['shift']());}};_0x34f04f(++_0x5efc1f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x450a06,_0x296ac3){_0x450a06=_0x450a06-0x0;var _0x4ad848=_0x5f2f[_0x450a06];return _0x4ad848;};'use strict';module[_0xf5f2('0x0')]={'DOMAIN':_0xf5f2('0x1'),'SESSION_SECRET':_0xf5f2('0x2'),'GOOGLE_ID':_0xf5f2('0x3'),'GOOGLE_SECRET':_0xf5f2('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xb10b=['app-id','secret','exports','myappanuglar-secret'];(function(_0x289bb3,_0xe32a54){var _0x557f0e=function(_0x111bc0){while(--_0x111bc0){_0x289bb3['push'](_0x289bb3['shift']());}};_0x557f0e(++_0xe32a54);}(_0xb10b,0x12a));var _0xbb10=function(_0x1eabe2,_0x24666c){_0x1eabe2=_0x1eabe2-0x0;var _0x39adc0=_0xb10b[_0x1eabe2];return _0x39adc0;};'use strict';module[_0xbb10('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xbb10('0x1'),'GOOGLE_ID':_0xbb10('0x2'),'GOOGLE_SECRET':_0xbb10('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index de1fc47..8a09e60 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4abb=['../utils/loggers','fileLogger','exports'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x4abb,0x1e9));var _0xb4ab=function(_0x2e4ee7,_0x42752a){_0x2e4ee7=_0x2e4ee7-0x0;var _0x3cebbf=_0x4abb[_0x2e4ee7];return _0x3cebbf;};'use strict';var fileLogger=require(_0xb4ab('0x0'))[_0xb4ab('0x1')];module[_0xb4ab('0x2')]=fileLogger; \ No newline at end of file +var _0x7c56=['exports','../utils/loggers','fileLogger'];(function(_0x14f80d,_0x3a99aa){var _0x4a25ea=function(_0x5953e2){while(--_0x5953e2){_0x14f80d['push'](_0x14f80d['shift']());}};_0x4a25ea(++_0x3a99aa);}(_0x7c56,0x121));var _0x67c5=function(_0x25dd76,_0x298285){_0x25dd76=_0x25dd76-0x0;var _0x1fef55=_0x7c56[_0x25dd76];return _0x1fef55;};'use strict';var fileLogger=require(_0x67c5('0x0'))[_0x67c5('0x1')];module[_0x67c5('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4d18316..eb1e209 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 _0xa4c2=['../../services/email/index.js','routing','join','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','ami','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x16e2aa,_0x38a1cd){var _0x143121=function(_0xb47e03){while(--_0xb47e03){_0x16e2aa['push'](_0x16e2aa['shift']());}};_0x143121(++_0x38a1cd);}(_0xa4c2,0xe4));var _0x2a4c=function(_0x37bac5,_0x1e4028){_0x37bac5=_0x37bac5-0x0;var _0x5c317e=_0xa4c2[_0x37bac5];return _0x5c317e;};'use strict';var path=require(_0x2a4c('0x0'));var os=require('os');var config={'apps':[{'name':_0x2a4c('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x2a4c('0x2'),'script':path['join'](__dirname,_0x2a4c('0x3'))},{'name':_0x2a4c('0x4'),'script':path['join'](__dirname,_0x2a4c('0x5'))},{'name':'email','script':path['join'](__dirname,_0x2a4c('0x6'))},{'name':_0x2a4c('0x7'),'script':path[_0x2a4c('0x8')](__dirname,_0x2a4c('0x9'))},{'name':_0x2a4c('0xa'),'script':path[_0x2a4c('0x8')](__dirname,_0x2a4c('0xb'))}]};module[_0x2a4c('0xc')]=config; \ No newline at end of file +var _0x80b1=['xdr','../../services/xdr/index.js','path','express','join','ami','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x4953c9,_0x24591d){var _0x263a5e=function(_0x4181bf){while(--_0x4181bf){_0x4953c9['push'](_0x4953c9['shift']());}};_0x263a5e(++_0x24591d);}(_0x80b1,0x146));var _0x180b=function(_0x51fec4,_0xa952b0){_0x51fec4=_0x51fec4-0x0;var _0x31eac1=_0x80b1[_0x51fec4];return _0x31eac1;};'use strict';var path=require(_0x180b('0x0'));var os=require('os');var config={'apps':[{'name':_0x180b('0x1'),'script':path[_0x180b('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x180b('0x3'),'script':path[_0x180b('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x180b('0x4'),'script':path[_0x180b('0x2')](__dirname,_0x180b('0x5'))},{'name':_0x180b('0x6'),'script':path[_0x180b('0x2')](__dirname,_0x180b('0x7'))},{'name':_0x180b('0x8'),'script':path['join'](__dirname,_0x180b('0x9'))},{'name':_0x180b('0xa'),'script':path[_0x180b('0x2')](__dirname,_0x180b('0xb'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b49c357..c8a4f38 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 _0x1d6f=['then','disconnect','stop','restart','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x1d6f,0x133));var _0xf1d6=function(_0x6b2a57,_0x9abfb1){_0x6b2a57=_0x6b2a57-0x0;var _0x328d5b=_0x1d6f[_0x6b2a57];return _0x328d5b;};'use strict';var pm2=require(_0xf1d6('0x0'));var BPromise=require(_0xf1d6('0x1'));var config=require(_0xf1d6('0x2'));function connect(){return new BPromise(function(_0x3169ef,_0x3a664a){return pm2[_0xf1d6('0x3')](function(_0x1cb990){if(_0x1cb990){return _0x3a664a(_0x1cb990);}return _0x3169ef(_0xf1d6('0x4'));});});};exports['start']=function(_0x2fcbac){return connect()[_0xf1d6('0x5')](function(){return new BPromise(function(_0x30c962,_0x426b8d){return pm2['start'](_0x2fcbac,function(_0x45f7d2,_0x21d5b4){if(_0x45f7d2){return _0x426b8d(_0x45f7d2);}pm2[_0xf1d6('0x6')]();return _0x30c962(_0x21d5b4);});});});};exports['stop']=function(_0x957dcc){return connect()[_0xf1d6('0x5')](function(){return new BPromise(function(_0x440147,_0x4f4346){return pm2[_0xf1d6('0x7')](_0x957dcc,function(_0x3ea438,_0x342e71){if(_0x3ea438){return _0x4f4346(_0x3ea438);}pm2[_0xf1d6('0x6')]();return _0x440147(_0x342e71);});});});};exports['restart']=function(_0x2d004c){return connect()[_0xf1d6('0x5')](function(){return new BPromise(function(_0x4db847,_0x241eab){return pm2[_0xf1d6('0x8')](_0x2d004c,function(_0x47e245,_0x5b69b0){if(_0x47e245){return _0x241eab(_0x47e245);}pm2[_0xf1d6('0x6')]();return _0x4db847(_0x5b69b0);});});});};exports['list']=function(){return connect()[_0xf1d6('0x5')](function(){return new BPromise(function(_0x1db2ca,_0x31a2cd){return pm2['list'](function(_0x38e201,_0x7bfc64){if(_0x38e201){return _0x31a2cd(_0x38e201);}pm2[_0xf1d6('0x6')]();return _0x1db2ca(_0x7bfc64);});});});};exports[_0xf1d6('0x9')]=function(_0x3128f9){return connect()[_0xf1d6('0x5')](function(){return new BPromise(function(_0x281eb2,_0x3427bf){return pm2['describe'](_0x3128f9,function(_0x5ed9b6,_0x246127){if(_0x5ed9b6){return _0x3427bf(_0x5ed9b6);}pm2['disconnect']();return _0x281eb2(_0x246127);});});});};exports[_0xf1d6('0xa')]=function(_0x525d31){return connect()[_0xf1d6('0x5')](function(){return new BPromise(function(_0x50a523,_0x94206f){return pm2[_0xf1d6('0xa')](_0x525d31,function(_0x13abf3,_0x3be320){if(_0x13abf3){return _0x94206f(_0x13abf3);}pm2[_0xf1d6('0x6')]();return _0x50a523(_0x3be320);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x30c7fa,_0x4f48e9){return pm2[_0xf1d6('0xb')](function(_0x39edee){if(_0x39edee){return _0x4f48e9(_0x39edee);}return _0x30c7fa(_0xf1d6('0xc'));});});});}; \ No newline at end of file +var _0xa9c2=['restart','list','describe','delete','dump','saved','bluebird','start','then','disconnect','stop'];(function(_0x353856,_0x5ce89d){var _0xa58048=function(_0x2cc6a9){while(--_0x2cc6a9){_0x353856['push'](_0x353856['shift']());}};_0xa58048(++_0x5ce89d);}(_0xa9c2,0xa0));var _0x2a9c=function(_0x5c06c0,_0x3a515f){_0x5c06c0=_0x5c06c0-0x0;var _0x1723c1=_0xa9c2[_0x5c06c0];return _0x1723c1;};'use strict';var pm2=require('pm2');var BPromise=require(_0x2a9c('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x5a4fc6,_0x1f6d84){return pm2['connect'](function(_0x4ef0e1){if(_0x4ef0e1){return _0x1f6d84(_0x4ef0e1);}return _0x5a4fc6('connected');});});};exports[_0x2a9c('0x1')]=function(_0x5924f0){return connect()[_0x2a9c('0x2')](function(){return new BPromise(function(_0x11ddd2,_0x495bc3){return pm2[_0x2a9c('0x1')](_0x5924f0,function(_0x2a74d8,_0x5b75e1){if(_0x2a74d8){return _0x495bc3(_0x2a74d8);}pm2[_0x2a9c('0x3')]();return _0x11ddd2(_0x5b75e1);});});});};exports[_0x2a9c('0x4')]=function(_0x142f9a){return connect()[_0x2a9c('0x2')](function(){return new BPromise(function(_0x59c8be,_0x285294){return pm2['stop'](_0x142f9a,function(_0x2e5ad2,_0x5c8ed8){if(_0x2e5ad2){return _0x285294(_0x2e5ad2);}pm2[_0x2a9c('0x3')]();return _0x59c8be(_0x5c8ed8);});});});};exports[_0x2a9c('0x5')]=function(_0x597936){return connect()[_0x2a9c('0x2')](function(){return new BPromise(function(_0x2ef8e9,_0x3106c7){return pm2[_0x2a9c('0x5')](_0x597936,function(_0x1e4979,_0x1b404c){if(_0x1e4979){return _0x3106c7(_0x1e4979);}pm2[_0x2a9c('0x3')]();return _0x2ef8e9(_0x1b404c);});});});};exports[_0x2a9c('0x6')]=function(){return connect()['then'](function(){return new BPromise(function(_0x42eab7,_0x2cafbd){return pm2[_0x2a9c('0x6')](function(_0x107539,_0x456377){if(_0x107539){return _0x2cafbd(_0x107539);}pm2['disconnect']();return _0x42eab7(_0x456377);});});});};exports[_0x2a9c('0x7')]=function(_0x16c48b){return connect()[_0x2a9c('0x2')](function(){return new BPromise(function(_0x24bab7,_0x5ca605){return pm2[_0x2a9c('0x7')](_0x16c48b,function(_0x4256ff,_0xe12501){if(_0x4256ff){return _0x5ca605(_0x4256ff);}pm2[_0x2a9c('0x3')]();return _0x24bab7(_0xe12501);});});});};exports[_0x2a9c('0x8')]=function(_0x598dce){return connect()[_0x2a9c('0x2')](function(){return new BPromise(function(_0x11c93d,_0x488d6b){return pm2[_0x2a9c('0x8')](_0x598dce,function(_0x169778,_0x324661){if(_0x169778){return _0x488d6b(_0x169778);}pm2[_0x2a9c('0x3')]();return _0x11c93d(_0x324661);});});});};exports[_0x2a9c('0x9')]=function(){return connect()[_0x2a9c('0x2')](function(){return new BPromise(function(_0x4218fe,_0x28cdf0){return pm2[_0x2a9c('0x9')](function(_0x59dbb6){if(_0x59dbb6){return _0x28cdf0(_0x59dbb6);}return _0x4218fe(_0x2a9c('0xa'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f547dc8..29b317f 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 _0x7a70=['system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','defaults','redis','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','info','join','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a70,0xab));var _0x07a7=function(_0x1b95c4,_0x18f957){_0x1b95c4=_0x1b95c4-0x0;var _0x2d29d1=_0x7a70[_0x1b95c4];return _0x2d29d1;};'use strict';var _=require(_0x07a7('0x0'));var moment=require('moment');var Redis=require(_0x07a7('0x1'));var util=require(_0x07a7('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config['redis']=_[_0x07a7('0x3')](config[_0x07a7('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x07a7('0x4')]));function closeInteractions(){var _0x4330cd=0x0;var _0x4effc7=[];return db[_0x07a7('0x5')][_0x07a7('0x6')]({'raw':!![],'attributes':['id',_0x07a7('0x7')],'where':{'id':0x1}})['then'](function(_0x34ca22){_0x4330cd=_0x34ca22[_0x07a7('0x7')];if(_0x4330cd){return db[_0x07a7('0x8')][_0x07a7('0x9')]({'raw':!![],'attributes':['id',_0x07a7('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x07a7('0xb')](_0x34ca22[_0x07a7('0x7')],_0x07a7('0xc'))}}});}else{return[];}})[_0x07a7('0xd')](function(_0x1bc23d){if(_0x1bc23d&&_0x1bc23d[_0x07a7('0xe')]){_0x4effc7=_['map'](_0x1bc23d||[],'id');logger[_0x07a7('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x4effc7[_0x07a7('0x10')]());return db[_0x07a7('0x8')][_0x07a7('0x11')]({'closeReason':_0x07a7('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x07a7('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4effc7}});}})[_0x07a7('0xd')](function(){if(_0x4effc7&&_0x4effc7[_0x07a7('0xe')]){logger['info'](_0x07a7('0x14'),_0x4effc7['join']());for(var _0x571722=0x0;_0x571722<_0x4effc7['length'];_0x571722++){io['emit'](_0x07a7('0x15'),{'id':_0x4effc7[_0x571722],'closed':!![]});}}})[_0x07a7('0x16')](function(_0x4ff93f){logger[_0x07a7('0x17')](_0x07a7('0x18'),_0x4ff93f?util[_0x07a7('0x19')](_0x4ff93f,{'showHidden':![],'depth':null}):'');});}exports[_0x07a7('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe74d=['minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','then','info','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xe74d,0x6d));var _0xde74=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0xe74d[_0x406696];return _0x10e35c;};'use strict';var _=require('lodash');var moment=require(_0xde74('0x0'));var Redis=require('ioredis');var util=require(_0xde74('0x1'));var config=require(_0xde74('0x2'));var db=require(_0xde74('0x3'))['db'];var logger=require(_0xde74('0x4'))(_0xde74('0x5'));config[_0xde74('0x6')]=_[_0xde74('0x7')](config[_0xde74('0x6')],{'host':_0xde74('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xde74('0x6')]));function closeInteractions(){var _0x2711e7=0x0;var _0x3b17c8=[];return db['Setting'][_0xde74('0x9')]({'raw':!![],'attributes':['id',_0xde74('0xa')],'where':{'id':0x1}})['then'](function(_0x2d8a1a){_0x2711e7=_0x2d8a1a[_0xde74('0xa')];if(_0x2711e7){return db[_0xde74('0xb')][_0xde74('0xc')]({'raw':!![],'attributes':['id',_0xde74('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xde74('0xe')](_0x2d8a1a[_0xde74('0xa')],_0xde74('0xf'))}}});}else{return[];}})['then'](function(_0x5dc4fd){if(_0x5dc4fd&&_0x5dc4fd[_0xde74('0x10')]){_0x3b17c8=_[_0xde74('0x11')](_0x5dc4fd||[],'id');logger['info'](_0xde74('0x12'),_0x3b17c8[_0xde74('0x13')]());return db[_0xde74('0xb')][_0xde74('0x14')]({'closeReason':_0xde74('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xde74('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3b17c8}});}})[_0xde74('0x17')](function(){if(_0x3b17c8&&_0x3b17c8['length']){logger[_0xde74('0x18')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3b17c8['join']());for(var _0x1a72df=0x0;_0x1a72df<_0x3b17c8[_0xde74('0x10')];_0x1a72df++){io[_0xde74('0x19')](_0xde74('0x1a'),{'id':_0x3b17c8[_0x1a72df],'closed':!![]});}}})['catch'](function(_0x4366ff){logger[_0xde74('0x1b')](_0xde74('0x1c'),_0x4366ff?util[_0xde74('0x1d')](_0x4366ff,{'showHidden':![],'depth':null}):'');});}exports[_0xde74('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 33e293f..438683b 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b79=['exports','startAllRefreshIntervals'];(function(_0x32bd85,_0x1814d1){var _0x144e49=function(_0x3881cd){while(--_0x3881cd){_0x32bd85['push'](_0x32bd85['shift']());}};_0x144e49(++_0x1814d1);}(_0x2b79,0x125));var _0x92b7=function(_0x2d9a23,_0x481dc4){_0x2d9a23=_0x2d9a23-0x0;var _0x5198ee=_0x2b79[_0x2d9a23];return _0x5198ee;};'use strict';function start(){var _0x462b5d=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x462b5d[_0x92b7('0x0')]();}module[_0x92b7('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xf233=['exports','startAllRefreshIntervals'];(function(_0xd251bf,_0x43e96c){var _0x42a83c=function(_0x56309b){while(--_0x56309b){_0xd251bf['push'](_0xd251bf['shift']());}};_0x42a83c(++_0x43e96c);}(_0xf233,0x147));var _0x3f23=function(_0x42aa34,_0x53c9ba){_0x42aa34=_0x42aa34-0x0;var _0x2f854b=_0xf233[_0x42aa34];return _0x2f854b;};'use strict';function start(){var _0x3678fb=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x3678fb[_0x3f23('0x0')]();}module[_0x3f23('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 86b8194..a805d31 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 _0x7879=['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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','Smtp','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','cron','active','isBetween','startAt','add','start','add\x20cron','exists','stop\x20cron','endAt','update\x20cron','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip'];(function(_0x470b1e,_0x469d95){var _0x58d7ff=function(_0x4388e2){while(--_0x4388e2){_0x470b1e['push'](_0x470b1e['shift']());}};_0x58d7ff(++_0x469d95);}(_0x7879,0x1f4));var _0x9787=function(_0x150aea,_0x43388d){_0x150aea=_0x150aea-0x0;var _0x3e6e0f=_0x7879[_0x150aea];return _0x3e6e0f;};'use strict';var fs=require('fs');var util=require(_0x9787('0x0'));var path=require(_0x9787('0x1'));var _=require(_0x9787('0x2'));var moment=require(_0x9787('0x3'));var CronJobManager=require(_0x9787('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x9787('0x5'));var logger=require(_0x9787('0x6'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x9787('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x9787('0x8')][_0x9787('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4150b7,_0x580e93){return function(){logger[_0x9787('0xa')](_0x9787('0xb'),_0x4150b7[_0x9787('0xc')]);var _0xab4dfc=!![];var _0x3d3c9c=_0x4150b7[_0x9787('0xd')][_0x9787('0xe')]();var _0x33585d={'account':_0x3d3c9c,'message':{'from':util[_0x9787('0xf')]('\x22%s\x22\x20<%s>',_0x4150b7[_0x9787('0xd')]['name'],_0x4150b7[_0x9787('0xd')][_0x9787('0xc')]||_0x4150b7[_0x9787('0xd')]['Smtp'][_0x9787('0x10')]),'to':_0x4150b7[_0x9787('0xc')],'cc':_0x4150b7['cc'],'bcc':_0x4150b7[_0x9787('0x11')],'subject':util[_0x9787('0xf')](_0x9787('0x12'),_0x580e93[_0x9787('0x13')],_0x4150b7[_0x9787('0x14')],_0x4150b7[_0x9787('0x15')])}};var _0x447c24=path[_0x9787('0x16')](__dirname,_0x9787('0x17'));var _0x1e8bc3=_0x580e93[_0x9787('0x18')];var _0xdc806d=util['format']('%s.%s',path[_0x9787('0x19')](_0x580e93[_0x9787('0x18')],path[_0x9787('0x1a')](_0x580e93[_0x9787('0x18')])),_0x9787('0x1b'));var _0x5708b7=path['join'](_0x447c24,_0x1e8bc3);var _0x516756=path[_0x9787('0x16')](_0x447c24,_0xdc806d);if(fs[_0x9787('0x1c')](_0x5708b7)){_0x580e93[_0x9787('0x1d')]='Sent';_0x33585d[_0x9787('0x1e')][_0x9787('0x1f')]=[{'filename':_0x1e8bc3,'path':_0x5708b7}];_0x33585d['message'][_0x9787('0x20')]=util['format'](_0x9787('0x21'),JSON[_0x9787('0x22')](_0x580e93,null,0x2));}else if(fs[_0x9787('0x1c')](_0x516756)){_0x580e93[_0x9787('0x1d')]=_0x9787('0x23');_0x33585d[_0x9787('0x1e')][_0x9787('0x1f')]=[{'filename':_0xdc806d,'path':_0x516756}];}else{_0x33585d[_0x9787('0x1e')]['text']=_0x9787('0x24');if(!_0x4150b7[_0x9787('0x25')]){_0xab4dfc=![];logger['info'](_0x9787('0x26'));}}if(_0xab4dfc){return client[_0x9787('0x27')](_0x9787('0x28'),_0x33585d)[_0x9787('0x29')](function(_0x98137c){if(_0x98137c[_0x9787('0x2a')]){return logger[_0x9787('0x2a')](_0x9787('0x2b'),JSON[_0x9787('0x22')](_0x98137c));}return logger['info']('email\x20sent');})[_0x9787('0x2c')](function(_0x5039d2){return logger[_0x9787('0x2a')](_0x9787('0x2b'),JSON[_0x9787('0x22')](_0x5039d2));});}};}function handleError(){return function(_0xaa0b5a){return logger[_0x9787('0x2a')](JSON['stringify'](_0xaa0b5a));};}function handleResult(_0x3ad434){return function(_0x10af26){logger[_0x9787('0xa')](_0x9787('0x2d'),JSON[_0x9787('0x22')](_0x10af26));if(_0x3ad434[_0x9787('0xd')]&&_0x3ad434['MailAccount']['Smtp']&&!_[_0x9787('0x2e')](_0x3ad434[_0x9787('0xc')])){setTimeout(handleSendEmail(_0x3ad434,_0x10af26),0x3c*0x3e8);}};}function handleJob(_0x38c8c2){return function(){try{if(_[_0x9787('0x2e')](_0x38c8c2[_0x9787('0x14')])){return logger[_0x9787('0xa')](_0x9787('0x2f'));}if(_[_0x9787('0x2e')](_0x38c8c2[_0x9787('0x15')])){return logger[_0x9787('0xa')](_0x9787('0x30'));}var _0x1a6d93={'startDate':moment()[_0x9787('0x31')](_0x38c8c2['subtractNumber'],_0x38c8c2[_0x9787('0x15')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x9787('0xf')](_0x9787('0x32')),'type':_0x9787('0x33'),'output':_0x38c8c2['output'],'name':_0x38c8c2[_0x9787('0x13')]};if(!_[_0x9787('0x2e')](_0x38c8c2[_0x9787('0x34')])){logger[_0x9787('0xa')](_0x9787('0x35'),_0x38c8c2[_0x9787('0x34')]);return analyticDefaultReportController[_0x9787('0x36')]({'id':_0x38c8c2[_0x9787('0x34')]},_0x1a6d93)[_0x9787('0x29')](handleResult(_0x38c8c2))[_0x9787('0x2c')](handleError());}if(!_[_0x9787('0x2e')](_0x38c8c2[_0x9787('0x37')])){logger[_0x9787('0xa')](_0x9787('0x38'),_0x38c8c2[_0x9787('0x37')]);return analyticCustomReportController['runReport']({'id':_0x38c8c2[_0x9787('0x37')]},_0x1a6d93)[_0x9787('0x29')](handleResult(_0x38c8c2))[_0x9787('0x2c')](handleError());}}catch(_0x113314){logger[_0x9787('0x2a')](JSON[_0x9787('0x22')](_0x113314));}return logger[_0x9787('0xa')](_0x9787('0x39'));};}function getJobs(_0x2ead96){var _0x4c7030={};if(_0x2ead96){_0x4c7030['id']=_0x2ead96;}return db[_0x9787('0x3a')][_0x9787('0x3b')]({'where':_0x4c7030,'include':[{'model':db['MailAccount'],'attributes':['id',_0x9787('0x13'),_0x9787('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x9787('0x3c'),'include':[{'model':db[_0x9787('0x3d')],'as':'CloudProvider'}]}]}]})[_0x9787('0x29')](function(_0x36e57b){var _0x5ddefe=_[_0x9787('0x3e')](manager[_0x9787('0x3f')]);var _0x5c5f39=_[_0x9787('0x40')](_0x36e57b,function(_0x53e172){return _0x53e172['id'][_0x9787('0x41')]();});var _0x57706a=_[_0x9787('0x42')](_0x36e57b,function(_0x3e1b81){return _0x3e1b81['id'][_0x9787('0x41')]();});var _0x52aeec=_0x2ead96?_0x5c5f39:_[_0x9787('0x43')](_0x5c5f39,_0x5ddefe);var _0x2cf2d1=_[_0x9787('0x44')](_0x5c5f39,_0x5ddefe);var _0x135cad=_[_0x9787('0x43')](_0x5ddefe,_0x5c5f39);var _0x3a63a1;var _0x536d7d;for(_0x3a63a1=0x0;_0x3a63a1<_0x135cad[_0x9787('0x45')]&&!_0x2ead96;_0x3a63a1+=0x1){_0x536d7d=_0x135cad[_0x3a63a1][_0x9787('0x41')]();if(manager['exists'](_0x536d7d)){manager[_0x9787('0x46')](_0x536d7d);manager[_0x9787('0x47')](_0x536d7d);logger[_0x9787('0xa')](_0x9787('0x48'),_0x536d7d);}}logger['info']('toRun',JSON[_0x9787('0x22')](_0x52aeec));for(_0x3a63a1=0x0;_0x3a63a1<_0x52aeec[_0x9787('0x45')];_0x3a63a1+=0x1){_0x536d7d=_0x52aeec[_0x3a63a1][_0x9787('0x41')]();logger[_0x9787('0xa')](_0x9787('0x49'),_0x536d7d);if(_0x2ead96){logger['info'](_0x9787('0x4a'),_0x2ead96);logger[_0x9787('0xa')](JSON[_0x9787('0x22')](_0x57706a[_0x536d7d]));BPromise[_0x9787('0x4b')]()['then'](handleJob(_0x57706a[_0x536d7d]));logger[_0x9787('0xa')]('run\x20job',_0x57706a[_0x536d7d]['name'],_0x57706a[_0x536d7d][_0x9787('0x4c')]);}else if(_0x57706a[_0x536d7d][_0x9787('0x4c')]&&_0x57706a[_0x536d7d][_0x9787('0x4d')]&&moment()[_0x9787('0x4e')](_0x57706a[_0x536d7d][_0x9787('0x4f')],_0x57706a[_0x536d7d]['endAt'])){manager[_0x9787('0x50')](_0x536d7d,_0x57706a[_0x536d7d][_0x9787('0x4c')],handleJob(_0x57706a[_0x536d7d]));manager[_0x9787('0x51')](_0x536d7d);logger['info'](_0x9787('0x52'),_0x57706a[_0x536d7d][_0x9787('0x13')],_0x57706a[_0x536d7d][_0x9787('0x4c')]);}else if(manager[_0x9787('0x53')](_0x536d7d)){manager['stop'](_0x536d7d);manager[_0x9787('0x47')](_0x536d7d);logger[_0x9787('0xa')](_0x9787('0x54'),_0x57706a[_0x536d7d]['name'],_0x57706a[_0x536d7d]['cron']);}}for(_0x3a63a1=0x0,_0x536d7d;_0x3a63a1<_0x2cf2d1[_0x9787('0x45')]&&!_0x2ead96;_0x3a63a1+=0x1){_0x536d7d=_0x2cf2d1[_0x3a63a1]['toString']();if(manager['exists'](_0x536d7d)){if(_0x57706a[_0x536d7d][_0x9787('0x4c')]&&_0x57706a[_0x536d7d]['active']&&moment()[_0x9787('0x4e')](_0x57706a[_0x536d7d][_0x9787('0x4f')],_0x57706a[_0x536d7d][_0x9787('0x55')])){manager['update'](_0x536d7d,_0x57706a[_0x536d7d]['cron'],handleJob(_0x57706a[_0x536d7d]));logger['info'](_0x9787('0x56'),_0x57706a[_0x536d7d][_0x9787('0x13')],_0x57706a[_0x536d7d]['cron']);}else{manager['stop'](_0x536d7d);manager[_0x9787('0x47')](_0x536d7d);logger['info']('stop\x20cron',_0x57706a[_0x536d7d][_0x9787('0x13')],_0x57706a[_0x536d7d]['cron']);}}}})[_0x9787('0x2c')](function(_0x436796){logger[_0x9787('0x2a')](JSON[_0x9787('0x22')](_0x436796));});}exports[_0x9787('0x57')]=function(_0x5276a4){return getJobs(_0x5276a4);};exports[_0x9787('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xc0c5=['text','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','Smtp','CloudProvider','keys','map','toString','difference','intersection','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','add','start','stop','isBetween','startAt','endAt','update','update\x20cron','run','util','path','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','format','\x22%s\x22\x20<%s>','user','email','Report\x20%s\x20last\x20%s\x20%s','name','../../files/reports','savename','%s.%s','zip','join','existsSync','status','Sent','attachments','message'];(function(_0x145880,_0x1365aa){var _0xd2f1c2=function(_0x5f44d8){while(--_0x5f44d8){_0x145880['push'](_0x145880['shift']());}};_0xd2f1c2(++_0x1365aa);}(_0xc0c5,0x126));var _0x5c0c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc0c5[_0x1ac595];return _0x455fff;};'use strict';var fs=require('fs');var util=require(_0x5c0c('0x0'));var path=require(_0x5c0c('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x5c0c('0x2'));var jayson=require(_0x5c0c('0x3'));var BPromise=require('bluebird');var logger=require(_0x5c0c('0x4'))(_0x5c0c('0x5'));var db=require(_0x5c0c('0x6'))['db'];var analyticCustomReportController=require(_0x5c0c('0x7'));var analyticDefaultReportController=require(_0x5c0c('0x8'));var client=jayson[_0x5c0c('0x9')][_0x5c0c('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xeec9ed,_0x1503eb){return function(){logger[_0x5c0c('0xb')](_0x5c0c('0xc'),_0xeec9ed['email']);var _0x9fef49=!![];var _0x4e45bf=_0xeec9ed[_0x5c0c('0xd')]['getSmtpOptions']();var _0x44879a={'account':_0x4e45bf,'message':{'from':util[_0x5c0c('0xe')](_0x5c0c('0xf'),_0xeec9ed['MailAccount']['name'],_0xeec9ed[_0x5c0c('0xd')]['email']||_0xeec9ed['MailAccount']['Smtp'][_0x5c0c('0x10')]),'to':_0xeec9ed[_0x5c0c('0x11')],'cc':_0xeec9ed['cc'],'bcc':_0xeec9ed['bcc'],'subject':util[_0x5c0c('0xe')](_0x5c0c('0x12'),_0x1503eb[_0x5c0c('0x13')],_0xeec9ed['subtractNumber'],_0xeec9ed['subtractUnit'])}};var _0x53f967=path['join'](__dirname,_0x5c0c('0x14'));var _0x2479c8=_0x1503eb[_0x5c0c('0x15')];var _0x1237b5=util['format'](_0x5c0c('0x16'),path['basename'](_0x1503eb['savename'],path['extname'](_0x1503eb[_0x5c0c('0x15')])),_0x5c0c('0x17'));var _0x3ab056=path[_0x5c0c('0x18')](_0x53f967,_0x2479c8);var _0x37f32c=path['join'](_0x53f967,_0x1237b5);if(fs[_0x5c0c('0x19')](_0x3ab056)){_0x1503eb[_0x5c0c('0x1a')]=_0x5c0c('0x1b');_0x44879a['message'][_0x5c0c('0x1c')]=[{'filename':_0x2479c8,'path':_0x3ab056}];_0x44879a[_0x5c0c('0x1d')][_0x5c0c('0x1e')]=util[_0x5c0c('0xe')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x5c0c('0x1f')](_0x1503eb,null,0x2));}else if(fs[_0x5c0c('0x19')](_0x37f32c)){_0x1503eb[_0x5c0c('0x1a')]=_0x5c0c('0x1b');_0x44879a[_0x5c0c('0x1d')]['attachments']=[{'filename':_0x1237b5,'path':_0x37f32c}];}else{_0x44879a[_0x5c0c('0x1d')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xeec9ed[_0x5c0c('0x20')]){_0x9fef49=![];logger[_0x5c0c('0xb')](_0x5c0c('0x21'));}}if(_0x9fef49){return client[_0x5c0c('0x22')](_0x5c0c('0x23'),_0x44879a)[_0x5c0c('0x24')](function(_0x4f2907){if(_0x4f2907[_0x5c0c('0x25')]){return logger[_0x5c0c('0x25')](_0x5c0c('0x26'),JSON[_0x5c0c('0x1f')](_0x4f2907));}return logger[_0x5c0c('0xb')](_0x5c0c('0x27'));})[_0x5c0c('0x28')](function(_0x857c9a){return logger[_0x5c0c('0x25')]('error\x20mail',JSON[_0x5c0c('0x1f')](_0x857c9a));});}};}function handleError(){return function(_0x309979){return logger['error'](JSON['stringify'](_0x309979));};}function handleResult(_0x379b0f){return function(_0x17fcb1){logger[_0x5c0c('0xb')]('data',JSON[_0x5c0c('0x1f')](_0x17fcb1));if(_0x379b0f[_0x5c0c('0xd')]&&_0x379b0f[_0x5c0c('0xd')]['Smtp']&&!_[_0x5c0c('0x29')](_0x379b0f['email'])){setTimeout(handleSendEmail(_0x379b0f,_0x17fcb1),0x3c*0x3e8);}};}function handleJob(_0x20b537){return function(){try{if(_[_0x5c0c('0x29')](_0x20b537[_0x5c0c('0x2a')])){return logger[_0x5c0c('0xb')](_0x5c0c('0x2b'));}if(_[_0x5c0c('0x29')](_0x20b537[_0x5c0c('0x2c')])){return logger[_0x5c0c('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x13bda1={'startDate':moment()[_0x5c0c('0x2d')](_0x20b537['subtractNumber'],_0x20b537[_0x5c0c('0x2c')])[_0x5c0c('0xe')](_0x5c0c('0x2e')),'endDate':moment()[_0x5c0c('0xe')](_0x5c0c('0x2e')),'type':_0x5c0c('0x2f'),'output':_0x20b537[_0x5c0c('0x30')],'name':_0x20b537[_0x5c0c('0x13')]};if(!_[_0x5c0c('0x29')](_0x20b537[_0x5c0c('0x31')])){logger[_0x5c0c('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x20b537[_0x5c0c('0x31')]);return analyticDefaultReportController[_0x5c0c('0x32')]({'id':_0x20b537[_0x5c0c('0x31')]},_0x13bda1)[_0x5c0c('0x24')](handleResult(_0x20b537))[_0x5c0c('0x28')](handleError());}if(!_[_0x5c0c('0x29')](_0x20b537[_0x5c0c('0x33')])){logger[_0x5c0c('0xb')](_0x5c0c('0x34'),_0x20b537[_0x5c0c('0x33')]);return analyticCustomReportController[_0x5c0c('0x32')]({'id':_0x20b537['CustomReportId']},_0x13bda1)['then'](handleResult(_0x20b537))[_0x5c0c('0x28')](handleError());}}catch(_0x3ad810){logger[_0x5c0c('0x25')](JSON[_0x5c0c('0x1f')](_0x3ad810));}return logger[_0x5c0c('0xb')]('no\x20report\x20id');};}function getJobs(_0x3ddd75){var _0x22a18b={};if(_0x3ddd75){_0x22a18b['id']=_0x3ddd75;}return db[_0x5c0c('0x35')][_0x5c0c('0x36')]({'where':_0x22a18b,'include':[{'model':db[_0x5c0c('0xd')],'attributes':['id','name',_0x5c0c('0x11')],'include':[{'model':db[_0x5c0c('0x37')],'as':_0x5c0c('0x38'),'include':[{'model':db[_0x5c0c('0x39')],'as':_0x5c0c('0x39')}]}]}]})['then'](function(_0x22635d){var _0x39dc89=_[_0x5c0c('0x3a')](manager['jobs']);var _0x30bc09=_[_0x5c0c('0x3b')](_0x22635d,function(_0x4c0c6e){return _0x4c0c6e['id'][_0x5c0c('0x3c')]();});var _0x58fd37=_['keyBy'](_0x22635d,function(_0x566252){return _0x566252['id'][_0x5c0c('0x3c')]();});var _0x3160ed=_0x3ddd75?_0x30bc09:_[_0x5c0c('0x3d')](_0x30bc09,_0x39dc89);var _0x435d64=_[_0x5c0c('0x3e')](_0x30bc09,_0x39dc89);var _0x169a3a=_['difference'](_0x39dc89,_0x30bc09);var _0x1a2018;var _0x3df1b4;for(_0x1a2018=0x0;_0x1a2018<_0x169a3a['length']&&!_0x3ddd75;_0x1a2018+=0x1){_0x3df1b4=_0x169a3a[_0x1a2018][_0x5c0c('0x3c')]();if(manager['exists'](_0x3df1b4)){manager['stop'](_0x3df1b4);manager[_0x5c0c('0x3f')](_0x3df1b4);logger[_0x5c0c('0xb')](_0x5c0c('0x40'),_0x3df1b4);}}logger[_0x5c0c('0xb')](_0x5c0c('0x41'),JSON['stringify'](_0x3160ed));for(_0x1a2018=0x0;_0x1a2018<_0x3160ed[_0x5c0c('0x42')];_0x1a2018+=0x1){_0x3df1b4=_0x3160ed[_0x1a2018][_0x5c0c('0x3c')]();logger[_0x5c0c('0xb')](_0x5c0c('0x43'),_0x3df1b4);if(_0x3ddd75){logger[_0x5c0c('0xb')](_0x5c0c('0x44'),_0x3ddd75);logger[_0x5c0c('0xb')](JSON[_0x5c0c('0x1f')](_0x58fd37[_0x3df1b4]));BPromise[_0x5c0c('0x45')]()[_0x5c0c('0x24')](handleJob(_0x58fd37[_0x3df1b4]));logger['info'](_0x5c0c('0x46'),_0x58fd37[_0x3df1b4]['name'],_0x58fd37[_0x3df1b4][_0x5c0c('0x47')]);}else if(_0x58fd37[_0x3df1b4]['cron']&&_0x58fd37[_0x3df1b4]['active']&&moment()['isBetween'](_0x58fd37[_0x3df1b4]['startAt'],_0x58fd37[_0x3df1b4]['endAt'])){manager[_0x5c0c('0x48')](_0x3df1b4,_0x58fd37[_0x3df1b4][_0x5c0c('0x47')],handleJob(_0x58fd37[_0x3df1b4]));manager[_0x5c0c('0x49')](_0x3df1b4);logger[_0x5c0c('0xb')]('add\x20cron',_0x58fd37[_0x3df1b4][_0x5c0c('0x13')],_0x58fd37[_0x3df1b4][_0x5c0c('0x47')]);}else if(manager['exists'](_0x3df1b4)){manager[_0x5c0c('0x4a')](_0x3df1b4);manager[_0x5c0c('0x3f')](_0x3df1b4);logger[_0x5c0c('0xb')]('stop\x20cron',_0x58fd37[_0x3df1b4][_0x5c0c('0x13')],_0x58fd37[_0x3df1b4]['cron']);}}for(_0x1a2018=0x0,_0x3df1b4;_0x1a2018<_0x435d64[_0x5c0c('0x42')]&&!_0x3ddd75;_0x1a2018+=0x1){_0x3df1b4=_0x435d64[_0x1a2018]['toString']();if(manager['exists'](_0x3df1b4)){if(_0x58fd37[_0x3df1b4][_0x5c0c('0x47')]&&_0x58fd37[_0x3df1b4]['active']&&moment()[_0x5c0c('0x4b')](_0x58fd37[_0x3df1b4][_0x5c0c('0x4c')],_0x58fd37[_0x3df1b4][_0x5c0c('0x4d')])){manager[_0x5c0c('0x4e')](_0x3df1b4,_0x58fd37[_0x3df1b4][_0x5c0c('0x47')],handleJob(_0x58fd37[_0x3df1b4]));logger['info'](_0x5c0c('0x4f'),_0x58fd37[_0x3df1b4][_0x5c0c('0x13')],_0x58fd37[_0x3df1b4][_0x5c0c('0x47')]);}else{manager[_0x5c0c('0x4a')](_0x3df1b4);manager[_0x5c0c('0x3f')](_0x3df1b4);logger[_0x5c0c('0xb')]('stop\x20cron',_0x58fd37[_0x3df1b4][_0x5c0c('0x13')],_0x58fd37[_0x3df1b4][_0x5c0c('0x47')]);}}}})[_0x5c0c('0x28')](function(_0x369ff6){logger[_0x5c0c('0x25')](JSON[_0x5c0c('0x1f')](_0x369ff6));});}exports[_0x5c0c('0x50')]=function(_0x1e19be){return getJobs(_0x1e19be);};exports[_0x5c0c('0x49')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index bc64f5b..0a5a0da 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdac7=['data2','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','inspect','start','lodash','aws-sdk','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','then','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','update','FailureReason','resolve','bucket','Transcript\x20not\x20available'];(function(_0x11548b,_0x4c90dd){var _0x5beaba=function(_0x2d1d63){while(--_0x2d1d63){_0x11548b['push'](_0x11548b['shift']());}};_0x5beaba(++_0x4c90dd);}(_0xdac7,0x180));var _0x7dac=function(_0x2a92f2,_0x1f917d){_0x2a92f2=_0x2a92f2-0x0;var _0x310083=_0xdac7[_0x2a92f2];return _0x310083;};var _=require(_0x7dac('0x0'));var AWS=require(_0x7dac('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require('bluebird');var db=require(_0x7dac('0x2'))['db'];var logger=require(_0x7dac('0x3'))(_0x7dac('0x4'));function getTranscriptionJob(_0x3c4806,_0x56d2ac,_0x4f55eb,_0x4987d1){return new Promise(function(_0x17a05f,_0x2557ee){var _0x505705=new AWS[(_0x7dac('0x5'))]({'accessKeyId':_0x56d2ac,'secretAccessKey':_0x3c4806,'region':_0x4f55eb});_0x505705['getTranscriptionJob']({'TranscriptionJobName':_0x4987d1},function(_0x3b319f,_0x5ccf75){if(_0x3b319f){return _0x2557ee(_0x3b319f);}else{return _0x17a05f(_0x5ccf75);}});});}function sentiment(_0x8746d9,_0x19eaa4,_0x45fbdc,_0x43f23f,_0x11b680){return new Promise(function(_0x2b552f,_0x27eb87){var _0x41e0db=new AWS[(_0x7dac('0x6'))]({'accessKeyId':_0x19eaa4,'secretAccessKey':_0x8746d9,'region':_0x45fbdc});_0x41e0db[_0x7dac('0x7')]({'Text':_0x43f23f,'LanguageCode':_0x11b680['substring'](0x0,0x2)},function(_0x4e3a47,_0x4d4625){if(_0x4e3a47){return _0x27eb87(_0x4e3a47);}else{return _0x2b552f(_0x4d4625);}});});}function checkTranscribeJob(_0x28f4bc,_0x5dd35a,_0x42fbe3){var _0x4e5e65;return new BPromise(function(_0x2413ee,_0x22e197){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0xa'),_0x28f4bc['id'],_0x28f4bc[_0x7dac('0xb')]));return getTranscriptionJob(_0x42fbe3[_0x7dac('0xc')],_0x42fbe3['data2'],_0x5dd35a[_0x7dac('0xd')],_0x28f4bc['transcribeName'])['then'](function(_0x218a2a){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0xe'),_0x28f4bc['id'],_0x28f4bc[_0x7dac('0xb')],_0x218a2a['TranscriptionJob'][_0x7dac('0xf')]));if(!_0x28f4bc['fileText']){switch(_0x218a2a[_0x7dac('0x10')][_0x7dac('0xf')]){case _0x7dac('0x11'):var _0x1ddde7={'transcribeStatus':_0x218a2a[_0x7dac('0x10')][_0x7dac('0xf')],'fileUri':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x12')][_0x7dac('0x13')]};logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x14'),_0x28f4bc['id']));return rp({'uri':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x12')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x12cd84){logger['info'](util[_0x7dac('0x9')](_0x7dac('0x15'),_0x28f4bc['id']));if(_0x12cd84&&_0x12cd84['results']&&_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')]&&_0x12cd84['results'][_0x7dac('0x17')][_0x7dac('0x18')]){_0x1ddde7[_0x7dac('0x19')]='';for(var _0x179881=0x0;_0x179881<_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')][_0x7dac('0x18')];_0x179881++){_0x1ddde7['fileText']+=_0x12cd84[_0x7dac('0x16')][_0x7dac('0x17')][_0x179881][_0x7dac('0x1a')]+'';}}return _0x28f4bc['update'](_0x1ddde7);})['then'](function(){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x1b'),_0x28f4bc['id']));if(!_0x28f4bc[_0x7dac('0x1c')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x1f'));}if(!_0x5dd35a[_0x7dac('0x20')]||!_0x5dd35a[_0x7dac('0x21')]||!_0x5dd35a[_0x7dac('0x22')]||!_0x5dd35a[_0x7dac('0x23')]||!_0x5dd35a['bucket']){throw new db['Sequelize'][(_0x7dac('0x1e'))](_0x7dac('0x24'));}if(!_0x1ddde7[_0x7dac('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x5dd35a[_0x7dac('0x21')]===_0x42fbe3['id']){return _0x42fbe3;}else{return db[_0x7dac('0x25')][_0x7dac('0x26')]({'where':{'id':_settings[_0x7dac('0x21')]}});}})['then'](function(_0x282e3d){if(!_0x282e3d){throw new db['Sequelize'][(_0x7dac('0x1e'))](_0x7dac('0x27'));}if(!_0x282e3d[_0x7dac('0xc')]||!_0x282e3d['data2']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x28'));}_0x4e5e65=_0x282e3d;logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x29'),_0x28f4bc['id']));return sentiment(_0x4e5e65['data1'],_0x4e5e65['data2'],_0x5dd35a['sentimentRegion'],_0x1ddde7[_0x7dac('0x19')],_0x5dd35a[_0x7dac('0x23')]);})[_0x7dac('0x2a')](function(_0x4ec055){logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x2b'),_0x28f4bc['id']));return _0x28f4bc['update']({'sentiment':_0x4ec055[_0x7dac('0x2c')],'sPositive':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x2e')],'sNegative':_0x4ec055[_0x7dac('0x2d')]['Negative'],'sMixed':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x2f')],'sNeutral':_0x4ec055[_0x7dac('0x2d')][_0x7dac('0x30')]});})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util['format'](_0x7dac('0x1b'),_0x28f4bc['id']));_0x2413ee();});case'FAILED':return _0x28f4bc[_0x7dac('0x31')]({'transcribeStatus':'FAILED','failureReason':_0x218a2a[_0x7dac('0x10')][_0x7dac('0x32')]})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util[_0x7dac('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x28f4bc['id']));_0x2413ee();});default:logger['info'](util[_0x7dac('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x28f4bc['id']));break;}}else{return BPromise[_0x7dac('0x33')]()[_0x7dac('0x2a')](function(){if(!_0x28f4bc[_0x7dac('0x1c')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x1f'));}if(!_0x5dd35a['sentiment']||!_0x5dd35a['sentimentAccountId']||!_0x5dd35a[_0x7dac('0x22')]||!_0x5dd35a[_0x7dac('0x23')]||!_0x5dd35a[_0x7dac('0x34')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x24'));}if(!_0x28f4bc['fileText']){throw new Error(_0x7dac('0x35'));}if(_0x5dd35a[_0x7dac('0x21')]===_0x42fbe3['id']){return _0x42fbe3;}else{return db[_0x7dac('0x25')][_0x7dac('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x7dac('0x2a')](function(_0x53e093){if(!_0x53e093){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x27'));}if(!_0x53e093[_0x7dac('0xc')]||!_0x53e093[_0x7dac('0x36')]){throw new db[(_0x7dac('0x1d'))]['ValidationError'](_0x7dac('0x28'));}_0x4e5e65=_0x53e093;logger[_0x7dac('0x8')](util[_0x7dac('0x9')](_0x7dac('0x29'),_0x28f4bc['id']));return sentiment(_0x4e5e65[_0x7dac('0xc')],_0x4e5e65[_0x7dac('0x36')],_0x5dd35a[_0x7dac('0x22')],_0x28f4bc[_0x7dac('0x19')],_0x5dd35a[_0x7dac('0x23')]);})[_0x7dac('0x2a')](function(_0x378bb5){logger['info'](util['format'](_0x7dac('0x2b'),_0x28f4bc['id']));return _0x28f4bc[_0x7dac('0x31')]({'sentiment':_0x378bb5['Sentiment'],'sPositive':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x2e')],'sNegative':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x37')],'sMixed':_0x378bb5[_0x7dac('0x2d')]['Mixed'],'sNeutral':_0x378bb5[_0x7dac('0x2d')][_0x7dac('0x30')],'transcribeStatus':'COMPLETED'});})[_0x7dac('0x2a')](function(){logger[_0x7dac('0x8')](util['format'](_0x7dac('0x1b'),_0x28f4bc['id']));_0x2413ee();});}})[_0x7dac('0x38')](function(_0x1d860b){if(_0x1d860b){if(!_0x1d860b[_0x7dac('0x39')]||_0x1d860b[_0x7dac('0x39')]!==_0x7dac('0x3a')){logger[_0x7dac('0x3b')](util[_0x7dac('0x9')](_0x7dac('0x3c'),_0x28f4bc['id']),util['inspect'](_0x1d860b,{'showHidden':![],'depth':null}));}}_0x2413ee();});});}function checkTranscribe(){var _0x2d2c8b;var _0xe61204;var _0x49804d;return db[_0x7dac('0x3d')][_0x7dac('0x3e')]({'where':{'transcribeStatus':_0x7dac('0x3f')}})[_0x7dac('0x2a')](function(_0x3cd7a9){if(!_0x3cd7a9||!_0x3cd7a9[_0x7dac('0x18')]){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x40'));}_0x2d2c8b=_0x3cd7a9;return db[_0x7dac('0x41')][_0x7dac('0x26')]({'where':{'id':0x1}});})[_0x7dac('0x2a')](function(_0x1da157){if(!_0x1da157){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))]('Settings\x20not\x20available');}_0xe61204=_0x1da157;if(!_0xe61204[_0x7dac('0x4')]||!_0xe61204['transcribeAccountId']||!_0xe61204[_0x7dac('0xd')]||!_0xe61204[_0x7dac('0x23')]||!_0xe61204['bucket']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x42'));}return db['CloudProvider'][_0x7dac('0x26')]({'where':{'id':_0xe61204[_0x7dac('0x43')]}});})[_0x7dac('0x2a')](function(_0x33909c){if(!_0x33909c){throw new db[(_0x7dac('0x1d'))]['ValidationError'](_0x7dac('0x27'));}if(!_0x33909c[_0x7dac('0xc')]||!_0x33909c['data2']){throw new db[(_0x7dac('0x1d'))][(_0x7dac('0x1e'))](_0x7dac('0x28'));}_0x49804d=_0x33909c;var _0x5cd59c=[];_0x2d2c8b[_0x7dac('0x44')](function(_0x1d7739){_0x5cd59c[_0x7dac('0x45')](checkTranscribeJob(_0x1d7739,_0xe61204,_0x49804d));});return BPromise[_0x7dac('0x46')](_0x5cd59c);})[_0x7dac('0x38')](function(_0x3b71fb){if(_0x3b71fb){if(!_0x3b71fb[_0x7dac('0x39')]||_0x3b71fb['name']!=='SequelizeValidationError'){logger['error'](util[_0x7dac('0x47')](_0x3b71fb,{'showHidden':![],'depth':null}));}}});}exports[_0x7dac('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xc0d6=['results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','findOne','Positive','Neutral','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','all','catch','start','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded'];(function(_0x588514,_0x4f924b){var _0x247db2=function(_0x22c5b2){while(--_0x22c5b2){_0x588514['push'](_0x588514['shift']());}};_0x247db2(++_0x4f924b);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x256a25,_0x1302ed){_0x256a25=_0x256a25-0x0;var _0x28535c=_0xc0d6[_0x256a25];return _0x28535c;};var _=require('lodash');var AWS=require(_0x6c0d('0x0'));var rp=require('request-promise');var util=require(_0x6c0d('0x1'));var BPromise=require(_0x6c0d('0x2'));var db=require(_0x6c0d('0x3'))['db'];var logger=require(_0x6c0d('0x4'))(_0x6c0d('0x5'));function getTranscriptionJob(_0x21857a,_0xfc2a1c,_0x15ed87,_0x12c563){return new Promise(function(_0x32cbb6,_0x4caa83){var _0x4d7a9c=new AWS['TranscribeService']({'accessKeyId':_0xfc2a1c,'secretAccessKey':_0x21857a,'region':_0x15ed87});_0x4d7a9c[_0x6c0d('0x6')]({'TranscriptionJobName':_0x12c563},function(_0x266f0c,_0x2fdd21){if(_0x266f0c){return _0x4caa83(_0x266f0c);}else{return _0x32cbb6(_0x2fdd21);}});});}function sentiment(_0x16f430,_0x34ae4b,_0x4fc042,_0x2cf1e3,_0x32bce0){return new Promise(function(_0x514775,_0x3e5300){var _0x1132df=new AWS['Comprehend']({'accessKeyId':_0x34ae4b,'secretAccessKey':_0x16f430,'region':_0x4fc042});_0x1132df['detectSentiment']({'Text':_0x2cf1e3,'LanguageCode':_0x32bce0['substring'](0x0,0x2)},function(_0x73ae4d,_0x206d1d){if(_0x73ae4d){return _0x3e5300(_0x73ae4d);}else{return _0x514775(_0x206d1d);}});});}function checkTranscribeJob(_0x2d5a09,_0x2b1648,_0x595a86){var _0x577815;return new BPromise(function(_0x23d509,_0x4c7ed4){logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')](_0x6c0d('0x9'),_0x2d5a09['id'],_0x2d5a09['transcribeName']));return getTranscriptionJob(_0x595a86[_0x6c0d('0xa')],_0x595a86[_0x6c0d('0xb')],_0x2b1648['transcribeRegion'],_0x2d5a09['transcribeName'])['then'](function(_0x274d2b){logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')](_0x6c0d('0xc'),_0x2d5a09['id'],_0x2d5a09['transcribeName'],_0x274d2b['TranscriptionJob'][_0x6c0d('0xd')]));if(!_0x2d5a09[_0x6c0d('0xe')]){switch(_0x274d2b[_0x6c0d('0xf')][_0x6c0d('0xd')]){case _0x6c0d('0x10'):var _0x16dfa5={'transcribeStatus':_0x274d2b[_0x6c0d('0xf')][_0x6c0d('0xd')],'fileUri':_0x274d2b['TranscriptionJob'][_0x6c0d('0x11')][_0x6c0d('0x12')]};logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')](_0x6c0d('0x13'),_0x2d5a09['id']));return rp({'uri':_0x274d2b['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})['then'](function(_0xf6eeb6){logger[_0x6c0d('0x7')](util['format'](_0x6c0d('0x14'),_0x2d5a09['id']));if(_0xf6eeb6&&_0xf6eeb6[_0x6c0d('0x15')]&&_0xf6eeb6[_0x6c0d('0x15')][_0x6c0d('0x16')]&&_0xf6eeb6['results']['transcripts'][_0x6c0d('0x17')]){_0x16dfa5[_0x6c0d('0xe')]='';for(var _0x109b65=0x0;_0x109b65<_0xf6eeb6['results'][_0x6c0d('0x16')]['length'];_0x109b65++){_0x16dfa5[_0x6c0d('0xe')]+=_0xf6eeb6[_0x6c0d('0x15')][_0x6c0d('0x16')][_0x109b65][_0x6c0d('0x18')]+'';}}return _0x2d5a09[_0x6c0d('0x19')](_0x16dfa5);})[_0x6c0d('0x1a')](function(){logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')](_0x6c0d('0x1b'),_0x2d5a09['id']));if(!_0x2d5a09[_0x6c0d('0x1c')]){throw new db['Sequelize'][(_0x6c0d('0x1d'))](_0x6c0d('0x1e'));}if(!_0x2b1648[_0x6c0d('0x1f')]||!_0x2b1648[_0x6c0d('0x20')]||!_0x2b1648[_0x6c0d('0x21')]||!_0x2b1648[_0x6c0d('0x22')]||!_0x2b1648[_0x6c0d('0x23')]){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x25'));}if(!_0x16dfa5[_0x6c0d('0xe')]){throw new Error(_0x6c0d('0x26'));}if(_0x2b1648[_0x6c0d('0x20')]===_0x595a86['id']){return _0x595a86;}else{return db[_0x6c0d('0x27')]['findOne']({'where':{'id':_settings[_0x6c0d('0x20')]}});}})['then'](function(_0x242246){if(!_0x242246){throw new db[(_0x6c0d('0x24'))]['ValidationError'](_0x6c0d('0x28'));}if(!_0x242246[_0x6c0d('0xa')]||!_0x242246[_0x6c0d('0xb')]){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x29'));}_0x577815=_0x242246;logger[_0x6c0d('0x7')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2d5a09['id']));return sentiment(_0x577815[_0x6c0d('0xa')],_0x577815[_0x6c0d('0xb')],_0x2b1648['sentimentRegion'],_0x16dfa5[_0x6c0d('0xe')],_0x2b1648[_0x6c0d('0x22')]);})[_0x6c0d('0x1a')](function(_0x22a89a){logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2d5a09['id']));return _0x2d5a09[_0x6c0d('0x19')]({'sentiment':_0x22a89a[_0x6c0d('0x2a')],'sPositive':_0x22a89a[_0x6c0d('0x2b')]['Positive'],'sNegative':_0x22a89a[_0x6c0d('0x2b')][_0x6c0d('0x2c')],'sMixed':_0x22a89a[_0x6c0d('0x2b')][_0x6c0d('0x2d')],'sNeutral':_0x22a89a[_0x6c0d('0x2b')]['Neutral']});})[_0x6c0d('0x1a')](function(){logger[_0x6c0d('0x7')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2d5a09['id']));_0x23d509();});case _0x6c0d('0x2e'):return _0x2d5a09[_0x6c0d('0x19')]({'transcribeStatus':_0x6c0d('0x2e'),'failureReason':_0x274d2b[_0x6c0d('0xf')][_0x6c0d('0x2f')]})[_0x6c0d('0x1a')](function(){logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')](_0x6c0d('0x1b'),_0x2d5a09['id']));_0x23d509();});default:logger['info'](util[_0x6c0d('0x8')](_0x6c0d('0x30'),_0x2d5a09['id']));break;}}else{return BPromise[_0x6c0d('0x31')]()[_0x6c0d('0x1a')](function(){if(!_0x2d5a09[_0x6c0d('0x1c')]){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x1e'));}if(!_0x2b1648['sentiment']||!_0x2b1648[_0x6c0d('0x20')]||!_0x2b1648[_0x6c0d('0x21')]||!_0x2b1648[_0x6c0d('0x22')]||!_0x2b1648[_0x6c0d('0x23')]){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x25'));}if(!_0x2d5a09['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x2b1648[_0x6c0d('0x20')]===_0x595a86['id']){return _0x595a86;}else{return db[_0x6c0d('0x27')][_0x6c0d('0x32')]({'where':{'id':_settings[_0x6c0d('0x20')]}});}})[_0x6c0d('0x1a')](function(_0x183803){if(!_0x183803){throw new db['Sequelize'][(_0x6c0d('0x1d'))](_0x6c0d('0x28'));}if(!_0x183803[_0x6c0d('0xa')]||!_0x183803[_0x6c0d('0xb')]){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x29'));}_0x577815=_0x183803;logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2d5a09['id']));return sentiment(_0x577815[_0x6c0d('0xa')],_0x577815[_0x6c0d('0xb')],_0x2b1648[_0x6c0d('0x21')],_0x2d5a09[_0x6c0d('0xe')],_0x2b1648['language']);})[_0x6c0d('0x1a')](function(_0x4c67e0){logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2d5a09['id']));return _0x2d5a09[_0x6c0d('0x19')]({'sentiment':_0x4c67e0['Sentiment'],'sPositive':_0x4c67e0[_0x6c0d('0x2b')][_0x6c0d('0x33')],'sNegative':_0x4c67e0[_0x6c0d('0x2b')][_0x6c0d('0x2c')],'sMixed':_0x4c67e0['SentimentScore']['Mixed'],'sNeutral':_0x4c67e0['SentimentScore'][_0x6c0d('0x34')],'transcribeStatus':_0x6c0d('0x10')});})[_0x6c0d('0x1a')](function(){logger[_0x6c0d('0x7')](util[_0x6c0d('0x8')](_0x6c0d('0x1b'),_0x2d5a09['id']));_0x23d509();});}})['catch'](function(_0x1dadee){if(_0x1dadee){if(!_0x1dadee['name']||_0x1dadee[_0x6c0d('0x35')]!==_0x6c0d('0x36')){logger[_0x6c0d('0x37')](util[_0x6c0d('0x8')](_0x6c0d('0x38'),_0x2d5a09['id']),util[_0x6c0d('0x39')](_0x1dadee,{'showHidden':![],'depth':null}));}}_0x23d509();});});}function checkTranscribe(){var _0x322aa1;var _0xc555b3;var _0x27baf5;return db[_0x6c0d('0x3a')]['findAll']({'where':{'transcribeStatus':_0x6c0d('0x3b')}})[_0x6c0d('0x1a')](function(_0x5a96ac){if(!_0x5a96ac||!_0x5a96ac['length']){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x3c'));}_0x322aa1=_0x5a96ac;return db[_0x6c0d('0x3d')][_0x6c0d('0x32')]({'where':{'id':0x1}});})[_0x6c0d('0x1a')](function(_0x2a4028){if(!_0x2a4028){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x3e'));}_0xc555b3=_0x2a4028;if(!_0xc555b3['transcribe']||!_0xc555b3[_0x6c0d('0x3f')]||!_0xc555b3[_0x6c0d('0x40')]||!_0xc555b3[_0x6c0d('0x22')]||!_0xc555b3[_0x6c0d('0x23')]){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x41'));}return db[_0x6c0d('0x27')][_0x6c0d('0x32')]({'where':{'id':_0xc555b3[_0x6c0d('0x3f')]}});})[_0x6c0d('0x1a')](function(_0x35b00f){if(!_0x35b00f){throw new db['Sequelize'][(_0x6c0d('0x1d'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x35b00f[_0x6c0d('0xa')]||!_0x35b00f[_0x6c0d('0xb')]){throw new db[(_0x6c0d('0x24'))][(_0x6c0d('0x1d'))](_0x6c0d('0x29'));}_0x27baf5=_0x35b00f;var _0xdb62c9=[];_0x322aa1['forEach'](function(_0x5a6f7e){_0xdb62c9['push'](checkTranscribeJob(_0x5a6f7e,_0xc555b3,_0x27baf5));});return BPromise[_0x6c0d('0x42')](_0xdb62c9);})[_0x6c0d('0x43')](function(_0xbc6585){if(_0xbc6585){if(!_0xbc6585[_0x6c0d('0x35')]||_0xbc6585[_0x6c0d('0x35')]!==_0x6c0d('0x36')){logger['error'](util[_0x6c0d('0x39')](_0xbc6585,{'showHidden':![],'depth':null}));}}});}exports[_0x6c0d('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index b42e00a..e42693e 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91fe=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','moment','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length'];(function(_0x57a4e4,_0x53c9fd){var _0x57527c=function(_0x5654bc){while(--_0x5654bc){_0x57a4e4['push'](_0x57a4e4['shift']());}};_0x57527c(++_0x53c9fd);}(_0x91fe,0xf8));var _0xe91f=function(_0x25d3c4,_0x548df1){_0x25d3c4=_0x25d3c4-0x0;var _0x2c6753=_0x91fe[_0x25d3c4];return _0x2c6753;};'use strict';var _=require('lodash');var moment=require(_0xe91f('0x0'));var Redis=require('ioredis');var util=require('util');var config=require(_0xe91f('0x1'));var db=require(_0xe91f('0x2'))['db'];var logger=require(_0xe91f('0x3'))(_0xe91f('0x4'));config[_0xe91f('0x5')]=_['defaults'](config[_0xe91f('0x5')],{'host':_0xe91f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe91f('0x5')]));function closeInteractions(){var _0x305576=[];return db[_0xe91f('0x7')][_0xe91f('0x8')]({'raw':!![],'attributes':['id',_0xe91f('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xe91f('0xa')](0x18,'hours')}}})['then'](function(_0x1e051f){if(_0x1e051f&&_0x1e051f['length']){_0x305576=_[_0xe91f('0xb')](_0x1e051f||[],'id');logger[_0xe91f('0xc')](_0xe91f('0xd'),_0x305576[_0xe91f('0xe')]());return db[_0xe91f('0x7')][_0xe91f('0xf')]({'closeReason':_0xe91f('0x10'),'disposition':_0xe91f('0x11'),'closed':!![],'closedAt':moment()[_0xe91f('0x12')](_0xe91f('0x13'))},{'where':{'id':_0x305576}});}})[_0xe91f('0x14')](function(){if(_0x305576&&_0x305576[_0xe91f('0x15')]){logger[_0xe91f('0xc')](_0xe91f('0x16'),_0x305576[_0xe91f('0xe')]());for(var _0x428f45=0x0;_0x428f45<_0x305576[_0xe91f('0x15')];_0x428f45++){io[_0xe91f('0x17')](_0xe91f('0x18'),{'id':_0x305576[_0x428f45],'closed':!![]});}}})[_0xe91f('0x19')](function(_0x58b66f){logger['error'](_0xe91f('0x1a'),_0x58b66f?util['inspect'](_0x58b66f,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x2ba7=['inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0x1155ef,_0x4a77ea){var _0x1d6614=function(_0x5a46d3){while(--_0x5a46d3){_0x1155ef['push'](_0x1155ef['shift']());}};_0x1d6614(++_0x4a77ea);}(_0x2ba7,0xe9));var _0x72ba=function(_0x3ddd7a,_0x37d533){_0x3ddd7a=_0x3ddd7a-0x0;var _0x3461c2=_0x2ba7[_0x3ddd7a];return _0x3461c2;};'use strict';var _=require(_0x72ba('0x0'));var moment=require(_0x72ba('0x1'));var Redis=require(_0x72ba('0x2'));var util=require(_0x72ba('0x3'));var config=require(_0x72ba('0x4'));var db=require(_0x72ba('0x5'))['db'];var logger=require(_0x72ba('0x6'))(_0x72ba('0x7'));config[_0x72ba('0x8')]=_['defaults'](config[_0x72ba('0x8')],{'host':_0x72ba('0x9'),'port':0x18eb});var io=require(_0x72ba('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x15a964=[];return db[_0x72ba('0xb')][_0x72ba('0xc')]({'raw':!![],'attributes':['id',_0x72ba('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x72ba('0xe')](0x18,_0x72ba('0xf'))}}})[_0x72ba('0x10')](function(_0x6b1a9){if(_0x6b1a9&&_0x6b1a9[_0x72ba('0x11')]){_0x15a964=_[_0x72ba('0x12')](_0x6b1a9||[],'id');logger[_0x72ba('0x13')](_0x72ba('0x14'),_0x15a964[_0x72ba('0x15')]());return db['WhatsappInteraction'][_0x72ba('0x16')]({'closeReason':'system','disposition':_0x72ba('0x17'),'closed':!![],'closedAt':moment()[_0x72ba('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x15a964}});}})[_0x72ba('0x10')](function(){if(_0x15a964&&_0x15a964[_0x72ba('0x11')]){logger['info'](_0x72ba('0x19'),_0x15a964[_0x72ba('0x15')]());for(var _0x3313f1=0x0;_0x3313f1<_0x15a964[_0x72ba('0x11')];_0x3313f1++){io[_0x72ba('0x1a')](_0x72ba('0x1b'),{'id':_0x15a964[_0x3313f1],'closed':!![]});}}})[_0x72ba('0x1c')](function(_0x115a37){logger[_0x72ba('0x1d')](_0x72ba('0x1e'),_0x115a37?util[_0x72ba('0x1f')](_0x115a37,{'showHidden':![],'depth':null}):'');});}exports[_0x72ba('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 45d64b6..4a0c761 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf49c=['destroy','then','log','finished\x20populating','CmHopper','bulkCreate','hopper2','push','Innocenzo','Biondo','innocenzo.biondo','now','CmContact'];(function(_0xbd9b7b,_0x561adc){var _0x221512=function(_0x122b6e){while(--_0x122b6e){_0xbd9b7b['push'](_0xbd9b7b['shift']());}};_0x221512(++_0x561adc);}(_0xf49c,0x13f));var _0xcf49=function(_0xa5675a,_0x42197d){_0xa5675a=_0xa5675a-0x0;var _0xbfece0=_0xf49c[_0xa5675a];return _0xbfece0;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xcf49('0x0')]({'id':i,'firstName':_0xcf49('0x1')+i,'lastName':_0xcf49('0x2')+i,'phone':0xf879fb460+i,'email':_0xcf49('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xcf49('0x0')]({'id':i,'active':![],'scheduledat':Date[_0xcf49('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xcf49('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xcf49('0x0')]({'id':i,'firstName':_0xcf49('0x1')+i,'lastName':_0xcf49('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xcf49('0x0')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcf49('0x4')](),'updatedAt':Date['now']()});}db[_0xcf49('0x5')][_0xcf49('0x6')]({'where':{}})['then'](function(){return db[_0xcf49('0x5')]['bulkCreate'](contacts);})[_0xcf49('0x7')](function(){console[_0xcf49('0x8')](_0xcf49('0x9'),'contacts1');return db['CmHopper'][_0xcf49('0x6')]({'where':{}});})[_0xcf49('0x7')](function(){return db[_0xcf49('0xa')]['bulkCreate'](hopper);})[_0xcf49('0x7')](function(){console[_0xcf49('0x8')](_0xcf49('0x9'),'hopper1');return db[_0xcf49('0x5')][_0xcf49('0xb')](contacts2);})[_0xcf49('0x7')](function(){console[_0xcf49('0x8')](_0xcf49('0x9'),'contacts2');return db[_0xcf49('0xa')][_0xcf49('0xb')](hopper2);})['then'](function(){console[_0xcf49('0x8')](_0xcf49('0x9'),_0xcf49('0xc'));})['catch'](function(_0x203ba7){console['log'](_0x203ba7);}); \ No newline at end of file +var _0xbb0d=['push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','hopper2','util','../mysqldb'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xbb0d,0x17a));var _0xdbb0=function(_0x43ee01,_0x434a22){_0x43ee01=_0x43ee01-0x0;var _0x44b8e5=_0xbb0d[_0x43ee01];return _0x44b8e5;};'use strict';var util=require(_0xdbb0('0x0'));var db=require(_0xdbb0('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xdbb0('0x2')]({'id':i,'firstName':_0xdbb0('0x3')+i,'lastName':_0xdbb0('0x4')+i,'phone':0xf879fb460+i,'email':_0xdbb0('0x5')+i+_0xdbb0('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xdbb0('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xdbb0('0x7')](),'updatedAt':Date[_0xdbb0('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xdbb0('0x2')]({'id':i,'firstName':_0xdbb0('0x3')+i,'lastName':_0xdbb0('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xdbb0('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xdbb0('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xdbb0('0x7')](),'updatedAt':Date[_0xdbb0('0x7')]()});}db[_0xdbb0('0x8')]['destroy']({'where':{}})[_0xdbb0('0x9')](function(){return db['CmContact'][_0xdbb0('0xa')](contacts);})[_0xdbb0('0x9')](function(){console[_0xdbb0('0xb')](_0xdbb0('0xc'),_0xdbb0('0xd'));return db[_0xdbb0('0xe')][_0xdbb0('0xf')]({'where':{}});})['then'](function(){return db[_0xdbb0('0xe')][_0xdbb0('0xa')](hopper);})[_0xdbb0('0x9')](function(){console[_0xdbb0('0xb')](_0xdbb0('0xc'),_0xdbb0('0x10'));return db['CmContact']['bulkCreate'](contacts2);})[_0xdbb0('0x9')](function(){console['log']('finished\x20populating',_0xdbb0('0x11'));return db[_0xdbb0('0xe')]['bulkCreate'](hopper2);})[_0xdbb0('0x9')](function(){console[_0xdbb0('0xb')]('finished\x20populating',_0xdbb0('0x12'));})['catch'](function(_0x58a131){console[_0xdbb0('0xb')](_0x58a131);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index ab75334..31932d3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9827=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','../mysqldb','push','agent','format','%s%s','%s%s@xcally.com','password','friend','udp'];(function(_0x123b3d,_0x93980e){var _0x2194ea=function(_0x47d2fc){while(--_0x47d2fc){_0x123b3d['push'](_0x123b3d['shift']());}};_0x2194ea(++_0x93980e);}(_0x9827,0x137));var _0x7982=function(_0x2cd8d0,_0x5ddefb){_0x2cd8d0=_0x2cd8d0-0x0;var _0x49a221=_0x9827[_0x2cd8d0];return _0x49a221;};'use strict';var util=require('util');var db=require(_0x7982('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7982('0x1')]({'name':util['format']('%s%s',_0x7982('0x2'),i),'fullname':util[_0x7982('0x3')](_0x7982('0x4'),_0x7982('0x2'),i),'email':util[_0x7982('0x3')](_0x7982('0x5'),_0x7982('0x2'),i),'role':'agent','password':_0x7982('0x6'),'internal':0xfa0+i,'type':_0x7982('0x7'),'transport':[_0x7982('0x8'),'ws','wss'],'disallow':[_0x7982('0x9')],'allow':[_0x7982('0xa')],'defaultuser':util['format']('%s%s','agent',i),'encryption':_0x7982('0xb'),'avpf':_0x7982('0xb'),'force_avp':_0x7982('0xb'),'icesupport':_0x7982('0xb'),'dtlsenable':_0x7982('0xb'),'dtlsverify':'no','dtlscertfile':_0x7982('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x7982('0xd'),'callerid':util[_0x7982('0x3')](_0x7982('0xe'),util[_0x7982('0x3')](_0x7982('0x4'),'agent',i),0xfa0+i)});}db[_0x7982('0xf')][_0x7982('0x10')](users)[_0x7982('0x11')](function(){console[_0x7982('0x12')](_0x7982('0x13'));})['catch'](function(_0x3949bf){console[_0x7982('0x12')](_0x3949bf);}); \ No newline at end of file +var _0xbd33=['ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xbd33,0x145));var _0x3bd3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd33[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x3bd3('0x0'));var db=require(_0x3bd3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3bd3('0x2')]({'name':util[_0x3bd3('0x3')](_0x3bd3('0x4'),_0x3bd3('0x5'),i),'fullname':util[_0x3bd3('0x3')]('%s%s','agent',i),'email':util['format'](_0x3bd3('0x6'),_0x3bd3('0x5'),i),'role':'agent','password':_0x3bd3('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x3bd3('0x8'),'ws',_0x3bd3('0x9')],'disallow':[_0x3bd3('0xa')],'allow':[_0x3bd3('0xb')],'defaultuser':util[_0x3bd3('0x3')]('%s%s',_0x3bd3('0x5'),i),'encryption':_0x3bd3('0xc'),'avpf':'yes','force_avp':_0x3bd3('0xc'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3bd3('0xd'),'dtlssetup':_0x3bd3('0xe'),'callerid':util['format'](_0x3bd3('0xf'),util[_0x3bd3('0x3')](_0x3bd3('0x4'),_0x3bd3('0x5'),i),0xfa0+i)});}db['User'][_0x3bd3('0x10')](users)[_0x3bd3('0x11')](function(){console[_0x3bd3('0x12')](_0x3bd3('0x13'));})[_0x3bd3('0x14')](function(_0x3d1ac7){console['log'](_0x3d1ac7);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 345dfea..bc730a9 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b59=['./environment','name','Agents','telephone','agent','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','query','find','role','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','include','VoiceQueue','ChatQueue','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','WhatsappQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','chat','sms','mail','openchannel','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','lodash','util'];(function(_0xfc3f65,_0x21f988){var _0xc3d341=function(_0x1705bc){while(--_0x1705bc){_0xfc3f65['push'](_0xfc3f65['shift']());}};_0xc3d341(++_0x21f988);}(_0x2b59,0x1de));var _0x92b5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2b59[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x92b5('0x0'));var util=require(_0x92b5('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0x92b5('0x2'));var queryQueues={'attributes':['id',_0x92b5('0x3')],'include':[{'as':_0x92b5('0x4'),'model':db['User'],'attributes':['id',_0x92b5('0x3'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x92b5('0x3')],'where':{'role':_0x92b5('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x92b5('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x92b5('0x3')],'where':{'role':_0x92b5('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x92b5('0x3'),'type'],'where':{'type':_0x92b5('0x7')}};function getAssociatedResources(_0x1b57b0,_0x3ddaac,_0x4f06c8){return db[_0x92b5('0x8')]['findOne']({'where':{'name':_0x1b57b0,'userProfileId':_0x3ddaac},'raw':!![]})[_0x92b5('0x9')](function(_0x315384){if(_0x315384){if(_0x315384['autoAssociation']){switch(_0x1b57b0){case _0x92b5('0xa'):case _0x92b5('0xb'):case _0x92b5('0xc'):case _0x92b5('0xd'):case _0x92b5('0xe'):case _0x92b5('0xf'):case'WhatsappQueues':return db[_0x4f06c8]['findAll'](queryQueues);case _0x92b5('0x10'):return db[_0x4f06c8]['findAll'](queryTelephones);case _0x92b5('0x11'):return db[_0x4f06c8][_0x92b5('0x12')](queryTrunks);case _0x92b5('0x13'):return db[_0x4f06c8]['findAll'](queryCampaigns);}}else{return db[_0x92b5('0x14')]['findAll']({'attributes':[_0x92b5('0x15')],'where':{'sectionId':_0x315384['id']},'raw':!![]})[_0x92b5('0x9')](function(_0x52966a){if(_0x52966a){var _0x304bda={'where':{'id':_[_0x92b5('0x16')](_0x52966a,_0x92b5('0x15'))},'raw':!![]};switch(_0x4f06c8){case _0x92b5('0x17'):_0x304bda[_0x92b5('0x18')]['role']=_0x92b5('0x5');break;case _0x92b5('0x19'):_0x304bda[_0x92b5('0x18')][_0x92b5('0x1a')]=_0x92b5('0x7');break;}return db[_0x4f06c8][_0x92b5('0x12')](_0x304bda);}else{return[];}});}}else{return[];}})[_0x92b5('0x9')](function(_0x13009b){return _0x13009b;});}function joinOrLeaveQueues(_0x2e385d,_0x4476bb,_0x2e2a64,_0x5e47b2){_0x2e385d[_0x4476bb](util[_0x92b5('0x1b')](_0x92b5('0x1c'),_0x2e2a64,_0x5e47b2['name']));if(_0x5e47b2['Agents']){for(var _0x252af3=0x0;_0x252af3<_0x5e47b2[_0x92b5('0x4')][_0x92b5('0x1d')];_0x252af3+=0x1){_0x2e385d[_0x4476bb](util['format'](_0x92b5('0x1e'),_0x5e47b2['Agents'][_0x252af3][_0x92b5('0x3')]));}}}function joinOrLeave(_0x35e79f,_0x17bb07,_0x4a7282){var _0x2de28d;if(_0x35e79f[_0x92b5('0x1f')][_0x92b5('0x20')]['id']){db[_0x92b5('0x17')][_0x92b5('0x21')]({'attributes':['id','name',_0x92b5('0x22'),_0x92b5('0x23')],'where':{'id':_0x35e79f[_0x92b5('0x1f')][_0x92b5('0x20')]['id']},'include':[{'model':db[_0x92b5('0x24')],'as':_0x92b5('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x92b5('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x92b5('0x27')],'as':_0x92b5('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x92b5('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x92b5('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x92b5('0x2b')],'as':_0x92b5('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x47d10d){if(_0x47d10d){_0x2de28d=_0x47d10d;_0x35e79f[_0x17bb07](util[_0x92b5('0x1b')](_0x92b5('0x1e'),_0x47d10d[_0x92b5('0x3')]));var _0x2c5629=[];switch(_0x47d10d[_0x92b5('0x22')]){case'admin':_0x35e79f[_0x17bb07](_0x92b5('0x2d'));_0x35e79f[_0x17bb07](_0x92b5('0x2e'));if(queryQueues['hasOwnProperty'](_0x92b5('0x2f'))){delete queryQueues['include'];}_0x2c5629['push'](db[_0x92b5('0x30')][_0x92b5('0x12')](queryQueues));_0x2c5629['push'](db[_0x92b5('0x31')][_0x92b5('0x12')](queryQueues));_0x2c5629[_0x92b5('0x32')](db[_0x92b5('0x33')][_0x92b5('0x12')](queryQueues));_0x2c5629[_0x92b5('0x32')](db[_0x92b5('0x34')][_0x92b5('0x12')](queryQueues));_0x2c5629[_0x92b5('0x32')](db[_0x92b5('0x35')][_0x92b5('0x12')](queryQueues));_0x2c5629[_0x92b5('0x32')](db[_0x92b5('0x36')][_0x92b5('0x12')](queryQueues));_0x2c5629[_0x92b5('0x32')](db[_0x92b5('0x37')][_0x92b5('0x12')](queryQueues));_0x2c5629[_0x92b5('0x32')](db['User'][_0x92b5('0x12')](queryTelephones));_0x2c5629[_0x92b5('0x32')](db['Trunk']['findAll'](queryTrunks));_0x2c5629['push'](db[_0x92b5('0x19')]['findAll'](queryCampaigns));_0x2c5629[_0x92b5('0x32')](db['User']['findAll'](queryAgents));break;case _0x92b5('0x38'):_0x35e79f[_0x17bb07](_0x92b5('0x2d'));_0x35e79f[_0x17bb07](_0x92b5('0x2e'));_0x2c5629[_0x92b5('0x32')](getAssociatedResources('VoiceQueues',_0x47d10d[_0x92b5('0x23')],'VoiceQueue'));_0x2c5629[_0x92b5('0x32')](getAssociatedResources(_0x92b5('0xb'),_0x47d10d[_0x92b5('0x23')],_0x92b5('0x31')));_0x2c5629[_0x92b5('0x32')](getAssociatedResources(_0x92b5('0xc'),_0x47d10d[_0x92b5('0x23')],'FaxQueue'));_0x2c5629[_0x92b5('0x32')](getAssociatedResources('SmsQueues',_0x47d10d[_0x92b5('0x23')],_0x92b5('0x34')));_0x2c5629[_0x92b5('0x32')](getAssociatedResources(_0x92b5('0xe'),_0x47d10d[_0x92b5('0x23')],_0x92b5('0x35')));_0x2c5629['push'](getAssociatedResources('OpenchannelQueues',_0x47d10d['userProfileId'],_0x92b5('0x36')));_0x2c5629['push'](getAssociatedResources(_0x92b5('0x39'),_0x47d10d['userProfileId'],'WhatsappQueue'));_0x2c5629['push'](getAssociatedResources(_0x92b5('0x10'),_0x47d10d[_0x92b5('0x23')],'User'));_0x2c5629[_0x92b5('0x32')](getAssociatedResources(_0x92b5('0x11'),_0x47d10d[_0x92b5('0x23')],'Trunk'));_0x2c5629[_0x92b5('0x32')](getAssociatedResources(_0x92b5('0x13'),_0x47d10d[_0x92b5('0x23')],_0x92b5('0x19')));_0x2c5629[_0x92b5('0x32')](db[_0x92b5('0x17')][_0x92b5('0x12')](queryAgents));break;case _0x92b5('0x6'):_0x35e79f[_0x17bb07](_0x92b5('0x2d'));_0x35e79f[_0x17bb07](_0x92b5('0x2e'));_0x2c5629[_0x92b5('0x32')](_0x47d10d[_0x92b5('0x3a')]({'attributes':['id',_0x92b5('0x3')]}));_0x2c5629['push'](_0x47d10d[_0x92b5('0x3b')]({'attributes':['id','name']}));_0x2c5629[_0x92b5('0x32')](_0x47d10d[_0x92b5('0x3c')]({'attributes':['id',_0x92b5('0x3')]}));_0x2c5629[_0x92b5('0x32')](_0x47d10d[_0x92b5('0x3d')]({'attributes':['id',_0x92b5('0x3')]}));_0x2c5629[_0x92b5('0x32')](_0x47d10d[_0x92b5('0x3e')]({'attributes':['id','name']}));_0x2c5629[_0x92b5('0x32')](_0x47d10d['getOpenchannelQueues']({'attributes':['id','name']}));_0x2c5629[_0x92b5('0x32')](_0x47d10d['getWhatsappQueues']({'attributes':['id',_0x92b5('0x3')]}));break;}return BPromise['all'](_0x2c5629);}})[_0x92b5('0x9')](function(_0x15e755){if(_0x15e755&&_0x15e755['length']){for(var _0x20ae86=0x0;_0x20ae86<_0x15e755[_0x92b5('0x1d')];_0x20ae86+=0x1){for(var _0x29db87=0x0;_0x29db87<_0x15e755[_0x20ae86][_0x92b5('0x1d')];_0x29db87+=0x1){switch(_0x20ae86){case 0x0:joinOrLeaveQueues(_0x35e79f,_0x17bb07,'voice',_0x15e755[_0x20ae86][_0x29db87]);break;case 0x1:joinOrLeaveQueues(_0x35e79f,_0x17bb07,_0x92b5('0x3f'),_0x15e755[_0x20ae86][_0x29db87]);break;case 0x2:joinOrLeaveQueues(_0x35e79f,_0x17bb07,'fax',_0x15e755[_0x20ae86][_0x29db87]);break;case 0x3:joinOrLeaveQueues(_0x35e79f,_0x17bb07,_0x92b5('0x40'),_0x15e755[_0x20ae86][_0x29db87]);break;case 0x4:joinOrLeaveQueues(_0x35e79f,_0x17bb07,_0x92b5('0x41'),_0x15e755[_0x20ae86][_0x29db87]);break;case 0x5:joinOrLeaveQueues(_0x35e79f,_0x17bb07,_0x92b5('0x42'),_0x15e755[_0x20ae86][_0x29db87]);break;case 0x6:joinOrLeaveQueues(_0x35e79f,_0x17bb07,'whatsapp',_0x15e755[_0x20ae86][_0x29db87]);break;case 0x7:if(_0x2de28d['role']!=='agent')_0x35e79f[_0x17bb07](util[_0x92b5('0x1b')](_0x92b5('0x43'),_0x15e755[_0x20ae86][_0x29db87][_0x92b5('0x3')]));break;case 0x8:if(_0x2de28d[_0x92b5('0x22')]!==_0x92b5('0x6'))_0x35e79f[_0x17bb07](util[_0x92b5('0x1b')]('trunk:%s',_0x15e755[_0x20ae86][_0x29db87][_0x92b5('0x3')]));break;case 0x9:if(_0x2de28d[_0x92b5('0x22')]!==_0x92b5('0x6'))_0x35e79f[_0x17bb07](util[_0x92b5('0x1b')](_0x92b5('0x44'),_0x15e755[_0x20ae86][_0x29db87][_0x92b5('0x1a')],_0x15e755[_0x20ae86][_0x29db87][_0x92b5('0x3')]));break;case 0xa:_0x35e79f[_0x17bb07](util['format'](_0x92b5('0x1e'),_0x15e755[_0x20ae86][_0x29db87][_0x92b5('0x3')]));break;}}}}})[_0x92b5('0x9')](function(){if(_0x17bb07===_0x92b5('0x45')){var _0x2ecf19=_[_0x92b5('0x16')](_0x2de28d[_0x92b5('0x25')],'id');return _0x2de28d[_0x92b5('0x46')](_0x2ecf19)['then'](function(){for(var _0x58a820=0x0;_0x58a820<_0x2ecf19[_0x92b5('0x1d')];_0x58a820+=0x1){_0x4a7282[_0x92b5('0x47')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2ecf19[_0x58a820]),'UserId':Number(_0x2de28d['id'])});}});}})[_0x92b5('0x9')](function(){if(_0x17bb07==='leave'){var _0x1fe4ff=_[_0x92b5('0x16')](_0x2de28d[_0x92b5('0x48')],'id');return _0x2de28d[_0x92b5('0x49')](_0x1fe4ff)[_0x92b5('0x9')](function(){for(var _0x4389e4=0x0;_0x4389e4<_0x1fe4ff[_0x92b5('0x1d')];_0x4389e4+=0x1){_0x4a7282[_0x92b5('0x47')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1fe4ff[_0x4389e4]),'UserId':Number(_0x2de28d['id'])});}});}})[_0x92b5('0x9')](function(){if(_0x17bb07===_0x92b5('0x45')){var _0x3642e0=_[_0x92b5('0x16')](_0x2de28d[_0x92b5('0x28')],'id');return _0x2de28d[_0x92b5('0x4a')](_0x3642e0)[_0x92b5('0x9')](function(){for(var _0x2678f4=0x0;_0x2678f4<_0x3642e0['length'];_0x2678f4+=0x1){_0x4a7282[_0x92b5('0x47')](_0x92b5('0x4b'),{'FaxInteractionId':Number(_0x3642e0[_0x2678f4]),'UserId':Number(_0x2de28d['id'])});}});}})[_0x92b5('0x9')](function(){if(_0x17bb07==='leave'){var _0x5c6f50=_[_0x92b5('0x16')](_0x2de28d[_0x92b5('0x4c')],'id');return _0x2de28d['removeSmsInteractions'](_0x5c6f50)[_0x92b5('0x9')](function(){for(var _0x304171=0x0;_0x304171<_0x5c6f50[_0x92b5('0x1d')];_0x304171+=0x1){_0x4a7282['emit'](_0x92b5('0x4d'),{'SmsInteractionId':Number(_0x5c6f50[_0x304171]),'UserId':Number(_0x2de28d['id'])});}});}})[_0x92b5('0x9')](function(){if(_0x17bb07===_0x92b5('0x45')){var _0x5a8855=_[_0x92b5('0x16')](_0x2de28d[_0x92b5('0x2a')],'id');return _0x2de28d[_0x92b5('0x4e')](_0x5a8855)[_0x92b5('0x9')](function(){for(var _0x17371c=0x0;_0x17371c<_0x5a8855[_0x92b5('0x1d')];_0x17371c+=0x1){_0x4a7282['emit'](_0x92b5('0x4f'),{'OpenchannelInteractionId':Number(_0x5a8855[_0x17371c]),'UserId':Number(_0x2de28d['id'])});}});}})[_0x92b5('0x9')](function(){if(_0x17bb07===_0x92b5('0x45')){var _0x4e9ce2=_[_0x92b5('0x16')](_0x2de28d[_0x92b5('0x2c')],'id');return _0x2de28d[_0x92b5('0x50')](_0x4e9ce2)[_0x92b5('0x9')](function(){for(var _0x2a991b=0x0;_0x2a991b<_0x4e9ce2[_0x92b5('0x1d')];_0x2a991b+=0x1){_0x4a7282['emit'](_0x92b5('0x51'),{'WhatsappInteractionId':Number(_0x4e9ce2[_0x2a991b]),'UserId':Number(_0x2de28d['id'])});}});}})['catch'](function(_0x460421){_0x35e79f[_0x92b5('0x52')](_0x460421);});}}function onDisconnect(_0x46ef69,_0x5178b7){joinOrLeave(_0x46ef69,_0x92b5('0x45'),_0x5178b7);}function onConnect(_0x574fb2){joinOrLeave(_0x574fb2,_0x92b5('0x53'));}exports[_0x92b5('0x54')]=function(_0x22f23f){_0x22f23f['on'](_0x92b5('0x55'),function(_0x35d71e){_0x35d71e['setMaxListeners'](0x0);_0x35d71e['address']=_0x35d71e[_0x92b5('0x56')][_0x92b5('0x55')][_0x92b5('0x57')]+':'+_0x35d71e['request'][_0x92b5('0x55')][_0x92b5('0x58')];_0x35d71e[_0x92b5('0x59')]=new Date();_0x35d71e[_0x92b5('0x52')]=function(_0x3b32da){console[_0x92b5('0x52')](_0x92b5('0x5a')+_0x35d71e[_0x92b5('0x5b')]['name']+'['+_0x35d71e[_0x92b5('0x5c')]+']',_0x3b32da);};_0x35d71e['on'](_0x92b5('0x5d'),function(){onDisconnect(_0x35d71e,_0x22f23f);_0x35d71e['log'](_0x92b5('0x5e'));});onConnect(_0x35d71e);_0x35d71e[_0x92b5('0x52')](_0x92b5('0x5f'));});}; \ No newline at end of file +var _0x6f83=['user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','format','%s:queue:%s','user:%s','query','find','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','ChatQueue','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','length','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions'];(function(_0x316e8b,_0x59710b){var _0x25edbf=function(_0x1b80d4){while(--_0x1b80d4){_0x316e8b['push'](_0x316e8b['shift']());}};_0x25edbf(++_0x59710b);}(_0x6f83,0x72));var _0x36f8=function(_0xa6084d,_0x3607b8){_0xa6084d=_0xa6084d-0x0;var _0x12738e=_0x6f83[_0xa6084d];return _0x12738e;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var BPromise=require(_0x36f8('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x36f8('0x2'));var queryQueues={'attributes':['id',_0x36f8('0x3')],'include':[{'as':_0x36f8('0x4'),'model':db[_0x36f8('0x5')],'attributes':['id',_0x36f8('0x3'),_0x36f8('0x6')],'raw':!![],'where':{'role':_0x36f8('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x36f8('0x3')],'where':{'role':_0x36f8('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x36f8('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x36f8('0x3')],'where':{'role':_0x36f8('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x36f8('0x3'),_0x36f8('0x9')],'where':{'type':_0x36f8('0xa')}};function getAssociatedResources(_0x2c9c6f,_0x496f32,_0x48c7b2){return db['UserProfileSection'][_0x36f8('0xb')]({'where':{'name':_0x2c9c6f,'userProfileId':_0x496f32},'raw':!![]})[_0x36f8('0xc')](function(_0x29a8f8){if(_0x29a8f8){if(_0x29a8f8[_0x36f8('0xd')]){switch(_0x2c9c6f){case _0x36f8('0xe'):case _0x36f8('0xf'):case _0x36f8('0x10'):case _0x36f8('0x11'):case _0x36f8('0x12'):case'OpenchannelQueues':case _0x36f8('0x13'):return db[_0x48c7b2][_0x36f8('0x14')](queryQueues);case _0x36f8('0x15'):return db[_0x48c7b2][_0x36f8('0x14')](queryTelephones);case'Trunks':return db[_0x48c7b2][_0x36f8('0x14')](queryTrunks);case _0x36f8('0x16'):return db[_0x48c7b2][_0x36f8('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0x36f8('0x14')]({'attributes':[_0x36f8('0x17')],'where':{'sectionId':_0x29a8f8['id']},'raw':!![]})[_0x36f8('0xc')](function(_0x5048e0){if(_0x5048e0){var _0x429efc={'where':{'id':_[_0x36f8('0x18')](_0x5048e0,_0x36f8('0x17'))},'raw':!![]};switch(_0x48c7b2){case _0x36f8('0x5'):_0x429efc['where']['role']=_0x36f8('0x8');break;case'Campaign':_0x429efc['where'][_0x36f8('0x9')]=_0x36f8('0xa');break;}return db[_0x48c7b2]['findAll'](_0x429efc);}else{return[];}});}}else{return[];}})[_0x36f8('0xc')](function(_0x320be2){return _0x320be2;});}function joinOrLeaveQueues(_0x290e63,_0x337cbb,_0x19d6ce,_0x1086ce){_0x290e63[_0x337cbb](util[_0x36f8('0x19')](_0x36f8('0x1a'),_0x19d6ce,_0x1086ce[_0x36f8('0x3')]));if(_0x1086ce[_0x36f8('0x4')]){for(var _0x26fc64=0x0;_0x26fc64<_0x1086ce[_0x36f8('0x4')]['length'];_0x26fc64+=0x1){_0x290e63[_0x337cbb](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x1086ce[_0x36f8('0x4')][_0x26fc64]['name']));}}}function joinOrLeave(_0x3917f1,_0x52b5ac,_0x362eae){var _0x206075;if(_0x3917f1['handshake'][_0x36f8('0x1c')]['id']){db['User'][_0x36f8('0x1d')]({'attributes':['id',_0x36f8('0x3'),_0x36f8('0x6'),_0x36f8('0x1e')],'where':{'id':_0x3917f1[_0x36f8('0x1f')][_0x36f8('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x36f8('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x21')],'as':_0x36f8('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x23')],'as':_0x36f8('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x25')],'as':_0x36f8('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x27')],'as':_0x36f8('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x36f8('0x29'),'attributes':['id'],'raw':!![]}]})[_0x36f8('0xc')](function(_0x3f01a6){if(_0x3f01a6){_0x206075=_0x3f01a6;_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x3f01a6[_0x36f8('0x3')]));var _0x4fedf6=[];switch(_0x3f01a6[_0x36f8('0x6')]){case _0x36f8('0x2a'):_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));if(queryQueues[_0x36f8('0x2d')](_0x36f8('0x2e'))){delete queryQueues[_0x36f8('0x2e')];}_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x30')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db['ChatQueue']['findAll'](queryQueues));_0x4fedf6['push'](db[_0x36f8('0x31')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db['SmsQueue'][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x32')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x33')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x34')][_0x36f8('0x14')](queryQueues));_0x4fedf6['push'](db[_0x36f8('0x5')][_0x36f8('0x14')](queryTelephones));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x35')][_0x36f8('0x14')](queryTrunks));_0x4fedf6['push'](db[_0x36f8('0x36')][_0x36f8('0x14')](queryCampaigns));_0x4fedf6[_0x36f8('0x2f')](db['User'][_0x36f8('0x14')](queryAgents));break;case _0x36f8('0x37'):_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));_0x4fedf6['push'](getAssociatedResources('VoiceQueues',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x30')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0xf'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x38')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('FaxQueues',_0x3f01a6[_0x36f8('0x1e')],'FaxQueue'));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x11'),_0x3f01a6[_0x36f8('0x1e')],'SmsQueue'));_0x4fedf6['push'](getAssociatedResources(_0x36f8('0x12'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x32')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x39'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x33')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x13'),_0x3f01a6[_0x36f8('0x1e')],'WhatsappQueue'));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x15'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x5')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('Trunks',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x35')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('IvrCampaigns',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x36')));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x5')][_0x36f8('0x14')](queryAgents));break;case'agent':_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3a')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3b')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6['push'](_0x3f01a6[_0x36f8('0x3c')]({'attributes':['id','name']}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3d')]({'attributes':['id','name']}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3e')]({'attributes':['id','name']}));_0x4fedf6['push'](_0x3f01a6[_0x36f8('0x3f')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x40')]({'attributes':['id',_0x36f8('0x3')]}));break;}return BPromise['all'](_0x4fedf6);}})['then'](function(_0x116a18){if(_0x116a18&&_0x116a18[_0x36f8('0x41')]){for(var _0x142ec2=0x0;_0x142ec2<_0x116a18[_0x36f8('0x41')];_0x142ec2+=0x1){for(var _0x3925c7=0x0;_0x3925c7<_0x116a18[_0x142ec2]['length'];_0x3925c7+=0x1){switch(_0x142ec2){case 0x0:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,'voice',_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x1:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x42'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x2:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x43'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x3:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x44'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x4:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x45'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x5:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x46'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x6:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,'whatsapp',_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x7:if(_0x206075[_0x36f8('0x6')]!=='agent')_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x47'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;case 0x8:if(_0x206075['role']!==_0x36f8('0x7'))_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x48'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;case 0x9:if(_0x206075[_0x36f8('0x6')]!=='agent')_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')]('campaign:%s:%s',_0x116a18[_0x142ec2][_0x3925c7]['type'],_0x116a18[_0x142ec2][_0x3925c7]['name']));break;case 0xa:_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;}}}}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x52ad3a=_['map'](_0x206075[_0x36f8('0x20')],'id');return _0x206075[_0x36f8('0x4a')](_0x52ad3a)[_0x36f8('0xc')](function(){for(var _0x1af88d=0x0;_0x1af88d<_0x52ad3a['length'];_0x1af88d+=0x1){_0x362eae['emit'](_0x36f8('0x4b'),{'ChatInteractionId':Number(_0x52ad3a[_0x1af88d]),'UserId':Number(_0x206075['id'])});}});}})['then'](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x38aecc=_['map'](_0x206075[_0x36f8('0x22')],'id');return _0x206075['removeMailInteractions'](_0x38aecc)['then'](function(){for(var _0x34a2f5=0x0;_0x34a2f5<_0x38aecc['length'];_0x34a2f5+=0x1){_0x362eae[_0x36f8('0x4c')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x38aecc[_0x34a2f5]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x2c0e9b=_['map'](_0x206075[_0x36f8('0x24')],'id');return _0x206075[_0x36f8('0x4d')](_0x2c0e9b)[_0x36f8('0xc')](function(){for(var _0x5eeb0e=0x0;_0x5eeb0e<_0x2c0e9b[_0x36f8('0x41')];_0x5eeb0e+=0x1){_0x362eae['emit'](_0x36f8('0x4e'),{'FaxInteractionId':Number(_0x2c0e9b[_0x5eeb0e]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x3e275a=_[_0x36f8('0x18')](_0x206075[_0x36f8('0x26')],'id');return _0x206075[_0x36f8('0x4f')](_0x3e275a)[_0x36f8('0xc')](function(){for(var _0x272d66=0x0;_0x272d66<_0x3e275a[_0x36f8('0x41')];_0x272d66+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x50'),{'SmsInteractionId':Number(_0x3e275a[_0x272d66]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x97feac=_[_0x36f8('0x18')](_0x206075['OpenchannelInteractions'],'id');return _0x206075[_0x36f8('0x51')](_0x97feac)['then'](function(){for(var _0x505e4=0x0;_0x505e4<_0x97feac[_0x36f8('0x41')];_0x505e4+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x52'),{'OpenchannelInteractionId':Number(_0x97feac[_0x505e4]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x65b81c=_[_0x36f8('0x18')](_0x206075[_0x36f8('0x29')],'id');return _0x206075[_0x36f8('0x53')](_0x65b81c)['then'](function(){for(var _0x40bcb7=0x0;_0x40bcb7<_0x65b81c[_0x36f8('0x41')];_0x40bcb7+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x54'),{'WhatsappInteractionId':Number(_0x65b81c[_0x40bcb7]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0x55')](function(_0x122ef3){_0x3917f1[_0x36f8('0x56')](_0x122ef3);});}}function onDisconnect(_0x16cc7a,_0x5d3edd){joinOrLeave(_0x16cc7a,_0x36f8('0x49'),_0x5d3edd);}function onConnect(_0x10ca57){joinOrLeave(_0x10ca57,'join');}exports[_0x36f8('0x57')]=function(_0x1c8713){_0x1c8713['on'](_0x36f8('0x58'),function(_0x3fe1e2){_0x3fe1e2[_0x36f8('0x59')](0x0);_0x3fe1e2[_0x36f8('0x5a')]=_0x3fe1e2[_0x36f8('0x5b')][_0x36f8('0x58')][_0x36f8('0x5c')]+':'+_0x3fe1e2['request'][_0x36f8('0x58')]['remotePort'];_0x3fe1e2[_0x36f8('0x5d')]=new Date();_0x3fe1e2[_0x36f8('0x56')]=function(_0x947aae){console[_0x36f8('0x56')](_0x36f8('0x5e')+_0x3fe1e2['nsp']['name']+'['+_0x3fe1e2['address']+']',_0x947aae);};_0x3fe1e2['on'](_0x36f8('0x5f'),function(){onDisconnect(_0x3fe1e2,_0x1c8713);_0x3fe1e2['log'](_0x36f8('0x60'));});onConnect(_0x3fe1e2);_0x3fe1e2[_0x36f8('0x56')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index cf37dee..5b45b67 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 _0x2b20=['client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','OpenchannelInteraction','Openchannel','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','direction','ContactId','undefined','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','interface','SIP/%s','agent','incomingmessage','AfterCreateMessage','event','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','format','changed','closed','substatus','query','name','AfterUpdate','find','fullname','internal','length','hasOwnProperty','model','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers'];(function(_0x4e9586,_0x39c511){var _0x413c5d=function(_0x5a2435){while(--_0x5a2435){_0x4e9586['push'](_0x4e9586['shift']());}};_0x413c5d(++_0x39c511);}(_0x2b20,0xd4));var _0x02b2=function(_0x256e13,_0x219c8b){_0x256e13=_0x256e13-0x0;var _0x277ea6=_0x2b20[_0x256e13];return _0x277ea6;};'use strict';var util=require(_0x02b2('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x02b2('0x1'));var logger=require(_0x02b2('0x2'))(_0x02b2('0x3'));var client=jayson[_0x02b2('0x4')][_0x02b2('0x5')]({'port':0x232a});var triggers=[{'channel':_0x02b2('0x6'),'model':_0x02b2('0x7'),'event':_0x02b2('0x8'),'condition':_0x02b2('0x9'),'callback':afterCreate},{'channel':_0x02b2('0x6'),'model':_0x02b2('0x7'),'event':_0x02b2('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x02b2('0x6'),'model':'ChatMessage','event':'afterCreate','condition':_0x02b2('0xb'),'callback':afterCreateMessage},{'channel':_0x02b2('0x6'),'model':_0x02b2('0xc'),'event':_0x02b2('0x8'),'condition':_0x02b2('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x02b2('0xd'),'model':_0x02b2('0xe'),'event':'afterCreate','condition':_0x02b2('0x9'),'callback':afterCreate},{'channel':_0x02b2('0xd'),'model':_0x02b2('0xe'),'event':'afterUpdate','condition':_0x02b2('0xf'),'callback':afterUpdate},{'channel':_0x02b2('0xd'),'model':_0x02b2('0x10'),'event':_0x02b2('0x8'),'condition':_0x02b2('0xb'),'callback':afterCreateMessage},{'channel':_0x02b2('0x11'),'model':_0x02b2('0x12'),'event':'afterCreate','condition':_0x02b2('0x9'),'callback':afterCreate},{'channel':_0x02b2('0x11'),'model':'WhatsappInteraction','event':'afterUpdate','condition':_0x02b2('0xf'),'callback':afterUpdate},{'channel':_0x02b2('0x11'),'model':_0x02b2('0x13'),'event':_0x02b2('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x02b2('0x14'),'model':'FaxInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x02b2('0x15'),'event':_0x02b2('0xa'),'condition':_0x02b2('0xf'),'callback':afterUpdate},{'channel':_0x02b2('0x14'),'model':_0x02b2('0x16'),'event':_0x02b2('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x02b2('0x17'),'model':_0x02b2('0x18'),'event':_0x02b2('0x8'),'condition':_0x02b2('0x9'),'callback':afterCreate},{'channel':_0x02b2('0x17'),'model':_0x02b2('0x18'),'event':'afterUpdate','condition':_0x02b2('0xf'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x02b2('0x8'),'condition':_0x02b2('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x02b2('0x19'),'event':_0x02b2('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x02b2('0x1a'),'model':_0x02b2('0x19'),'event':_0x02b2('0xa'),'condition':_0x02b2('0xf'),'callback':afterUpdate},{'channel':_0x02b2('0x1a'),'model':'OpenchannelMessage','event':_0x02b2('0x8'),'condition':_0x02b2('0xb'),'callback':afterCreateMessage}];function request(_0x224a9d){return client[_0x02b2('0x1b')](_0x02b2('0x1c'),_0x224a9d)[_0x02b2('0x1d')](function(_0x4a14a6){logger[_0x02b2('0x1e')](_0x02b2('0x1f'),_0x02b2('0x1c'),_0x4a14a6);if(_0x4a14a6[_0x02b2('0x20')]){if(_0x4a14a6[_0x02b2('0x20')][_0x02b2('0x21')]===0x1f4){logger[_0x02b2('0x20')](_0x02b2('0x1f'),_0x02b2('0x1c'),_0x4a14a6[_0x02b2('0x20')]);}}})[_0x02b2('0x22')](function(_0x18f86a){logger[_0x02b2('0x20')](_0x02b2('0x1f'),'EventManager',_0x18f86a);});}function afterCreateMessage(_0x4c4f1a){return function(_0x22b106){_0x22b106=_0x22b106[_0x02b2('0x23')]({'plain':!![]});_0x22b106[_0x02b2('0x24')]=_0x4c4f1a;_0x22b106[_0x02b2('0x25')]=_0x4c4f1a;_0x22b106['event']=_0x22b106[_0x02b2('0x26')];Promise['resolve']()[_0x02b2('0x1d')](function(){if(typeof _0x22b106[_0x02b2('0x27')]===_0x02b2('0x28'))return null;var _0x57eb6a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x22b106[_0x02b2('0x27')];return db[_0x02b2('0x29')]['query'](_0x57eb6a,{'type':db[_0x02b2('0x2a')][_0x02b2('0x2b')][_0x02b2('0x2c')],'raw':!![]});})[_0x02b2('0x1d')](function(_0x2d27f8){if(_0x2d27f8){_0x22b106[_0x02b2('0x2d')]=_0x2d27f8[0x0];}if(typeof _0x22b106[_0x02b2('0x2e')]===_0x02b2('0x28'))return;return getAgent(_0x22b106[_0x02b2('0x2e')]);})[_0x02b2('0x1d')](function(_0x48f9f3){if(_0x48f9f3){_0x22b106[_0x02b2('0x2f')]=util['format'](_0x02b2('0x30'),_0x48f9f3['name']);_0x22b106[_0x02b2('0x31')]=_0x48f9f3;_0x22b106['channel']=_0x4c4f1a;return request({'event':_0x02b2('0x32'),'message':_0x22b106});}else{return request({'event':'outgoingmessage','message':_0x22b106});}})['catch'](function(_0x440dbe){logger[_0x02b2('0x20')]('Trigger,\x20%s',_0x02b2('0x33'),_0x440dbe);});};}function afterCreateOfflineMessage(_0x409f00){return function(_0x3d8229){_0x3d8229=_0x3d8229[_0x02b2('0x23')]({'plain':!![]});_0x3d8229[_0x02b2('0x24')]=_0x409f00;_0x3d8229['motionChannel']=_0x409f00;_0x3d8229[_0x02b2('0x34')]=_0x02b2('0x35');return request({'event':_0x3d8229['event'],'message':_0x3d8229});};}function afterCreate(_0x48ff61,_0x3d6a5e){return function(_0x3cc5c0){_0x3cc5c0=_0x3cc5c0[_0x02b2('0x23')]({'plain':!![]});_0x3cc5c0[_0x02b2('0x24')]=_0x48ff61;_0x3cc5c0['motionChannel']=_0x48ff61;_0x3cc5c0[_0x02b2('0x34')]=_0x02b2('0x36');Promise['resolve']()[_0x02b2('0x1d')](function(){var _0x2168eb=_0x02b2('0x37')+_0x3cc5c0[_0x02b2('0x27')];return db[_0x02b2('0x29')]['query'](_0x2168eb,{'type':db[_0x02b2('0x2a')][_0x02b2('0x2b')][_0x02b2('0x2c')],'raw':!![]});})[_0x02b2('0x1d')](function(_0x359d17){if(_0x359d17){_0x3cc5c0[_0x02b2('0x2d')]=_0x359d17[0x0];}if(typeof _0x3cc5c0[_0x02b2('0x2e')]===_0x02b2('0x28'))return;return getAgent(_0x3cc5c0[_0x02b2('0x2e')]);})['then'](function(_0x233231){if(_0x233231){_0x3cc5c0[_0x02b2('0x2f')]=util[_0x02b2('0x38')](_0x02b2('0x30'),_0x233231['name']);_0x3cc5c0[_0x02b2('0x31')]=_0x233231;}return request({'event':_0x3d6a5e,'message':_0x3cc5c0});})[_0x02b2('0x22')](function(_0x54ccbf){logger[_0x02b2('0x20')](_0x02b2('0x1f'),'AfterCreate',_0x54ccbf);});};}function afterUpdate(_0x5bb433){return function(_0x20bae5){var _0x2c9c73=_0x20bae5[_0x02b2('0x39')](_0x02b2('0x3a'))&&_0x20bae5[_0x02b2('0x3a')];var _0x28333c=_0x20bae5[_0x02b2('0x39')]('substatus');if(_0x2c9c73||_0x28333c){var _0x382239=_0x2c9c73?'closedinteraction':_0x02b2('0x3b');var _0xaa2b85=_0x20bae5['get']({'plain':!![]});_0xaa2b85[_0x02b2('0x24')]=_0x5bb433;_0xaa2b85['motionChannel']=_0x5bb433;_0xaa2b85[_0x02b2('0x34')]=_0x2c9c73?_0x02b2('0x3a'):_0x02b2('0x3b');var _0x18a92a=_0x02b2('0x37')+_0xaa2b85[_0x02b2('0x27')];return db['sequelize'][_0x02b2('0x3c')](_0x18a92a,{'type':db[_0x02b2('0x2a')]['QueryTypes'][_0x02b2('0x2c')],'raw':!![]})[_0x02b2('0x1d')](function(_0xc2dd48){if(_0xc2dd48){_0xaa2b85[_0x02b2('0x2d')]=_0xc2dd48[0x0];}if(typeof _0xaa2b85[_0x02b2('0x2e')]===_0x02b2('0x28'))return;return getAgent(_0xaa2b85['UserId']);})[_0x02b2('0x1d')](function(_0x7b8233){if(_0x7b8233){_0xaa2b85['interface']=util[_0x02b2('0x38')](_0x02b2('0x30'),_0x7b8233[_0x02b2('0x3d')]);_0xaa2b85[_0x02b2('0x31')]=_0x7b8233;}return request({'event':_0x382239,'message':_0xaa2b85});})[_0x02b2('0x22')](function(_0x2f628d){logger['error'](_0x02b2('0x1f'),_0x02b2('0x3e'),_0x2f628d);});}};}function getAgent(_0x58c4f7){return db['User'][_0x02b2('0x3f')]({'where':{'id':_0x58c4f7},'attributes':['id',_0x02b2('0x3d'),_0x02b2('0x40'),'email',_0x02b2('0x41')],'raw':!![]})[_0x02b2('0x1d')](function(_0x5b920a){return _0x5b920a;});}exports['default']=function(){for(var _0x31c422=0x0;_0x31c422=_0x549b96[_0xf40a('0x13')]){throw Error(_0xf40a('0x14'));}_0x24498e(_0x82a111);})[_0xf40a('0x15')](function(_0x4209aa){_0x30d705(_0x4209aa);});});}; \ No newline at end of file +var _0xede4=['openchannel','getChannels','isValidChannel','includes','updateAttributes','getLicense','role','agent','User','count','then','agents','catch','lodash','bluebird','../mysqldb','voice','mail','chat','fax','sms'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0xede4,0x15d));var _0x4ede=function(_0x385f21,_0x1972c3){_0x385f21=_0x385f21-0x0;var _0x3ba3ea=_0xede4[_0x385f21];return _0x3ba3ea;};'use strict';var _=require(_0x4ede('0x0'));var BPromise=require(_0x4ede('0x1'));var db=require(_0x4ede('0x2'))['db'];var util=require('./license/util');var channels=[_0x4ede('0x3'),_0x4ede('0x4'),_0x4ede('0x5'),_0x4ede('0x6'),_0x4ede('0x7'),'whatsapp',_0x4ede('0x8')];exports[_0x4ede('0x9')]=function(){return channels;};exports[_0x4ede('0xa')]=function(_0x426157){_0x426157=_0x426157['toLowerCase']();return _[_0x4ede('0xb')](channels,_0x426157);};exports['clearBlockUser']=function(_0x57ea43,_0x1a397a,_0x3435e3,_0x46cf0e){var _0x5bd709={'loginAttempts':_0x1a397a,'blocked':_0x3435e3};if(!_['isUndefined'](_0x46cf0e)){_0x5bd709['blockedAt']=_0x46cf0e;}return _0x57ea43[_0x4ede('0xc')](_0x5bd709);};exports[_0x4ede('0xd')]=function(_0x3c6a03){return new BPromise(function(_0x6841d3,_0x206089){var _0x1f693d=0x0;if(_0x3c6a03[_0x4ede('0xe')]!==_0x4ede('0xf')){_0x6841d3(_0x3c6a03);}db[_0x4ede('0x10')][_0x4ede('0x11')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3c6a03['id']}}})[_0x4ede('0x12')](function(_0x49cbfe){_0x1f693d=_0x49cbfe;return util[_0x4ede('0xd')]();})[_0x4ede('0x12')](function(_0x424359){if(_0x424359&&_0x424359[_0x4ede('0x13')]&&_0x1f693d>=_0x424359[_0x4ede('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x6841d3(_0x3c6a03);})[_0x4ede('0x14')](function(_0x5eedb6){_0x206089(_0x5eedb6);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index d276a50..753cc21 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['OutOfInterval','error','status','send','exports','util','api','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','Not\x20Found','inherits','Forbidden'];(function(_0x57ba55,_0x2ff029){var _0x536e93=function(_0x16b93d){while(--_0x16b93d){_0x57ba55['push'](_0x57ba55['shift']());}};_0x536e93(++_0x2ff029);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0xb4e6[_0x1655bb];return _0x5e2020;};'use strict';var util=require(_0x6b4e('0x0'));var logger=require('../config/logger')(_0x6b4e('0x1'));var APIError=function(_0x1afd20,_0x365912){this[_0x6b4e('0x2')]=_0x1afd20||_0x6b4e('0x3');this[_0x6b4e('0x4')]=_0x365912||_0x6b4e('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x40da90){this[_0x6b4e('0x2')]=_0x40da90||_0x6b4e('0x6');this['name']=_0x6b4e('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x4f00be){this[_0x6b4e('0x2')]=_0x4f00be||'Entity\x20not\x20found';this['name']=_0x6b4e('0x7');util[_0x6b4e('0x8')](APINotFoundError,APIError);};function getStatusCode(_0x1e3bf6){switch(_0x1e3bf6){case _0x6b4e('0x6'):return 0x190;case _0x6b4e('0x9'),_0x6b4e('0xa'):return 0x193;case _0x6b4e('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x49c734){return function(_0x39b4ec){logger[_0x6b4e('0xb')](_0x39b4ec['stack']);var _0x2a4d0f=getStatusCode(_0x39b4ec[_0x6b4e('0x4')]);if(_0x39b4ec[_0x6b4e('0x4')])delete _0x39b4ec[_0x6b4e('0x4')];return _0x49c734[_0x6b4e('0xc')](_0x2a4d0f)[_0x6b4e('0xd')](_0x39b4ec);};}module[_0x6b4e('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x9bde=['exports','../config/logger','message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','OutOfInterval','error','stack','send'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9bde,0xe1));var _0xe9bd=function(_0xf24cf7,_0x5639cc){_0xf24cf7=_0xf24cf7-0x0;var _0x37de35=_0x9bde[_0xf24cf7];return _0x37de35;};'use strict';var util=require('util');var logger=require(_0xe9bd('0x0'))('api');var APIError=function(_0xc79e0b,_0x4c63ca){this[_0xe9bd('0x1')]=_0xc79e0b||_0xe9bd('0x2');this[_0xe9bd('0x3')]=_0x4c63ca||_0xe9bd('0x4');util[_0xe9bd('0x5')](APIError,Error);};var APIBadRequestError=function(_0x1a4d14){this[_0xe9bd('0x1')]=_0x1a4d14||'Bad\x20Request';this[_0xe9bd('0x3')]=_0xe9bd('0x6');util[_0xe9bd('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xa66ae2){this[_0xe9bd('0x1')]=_0xa66ae2||_0xe9bd('0x7');this[_0xe9bd('0x3')]=_0xe9bd('0x8');util[_0xe9bd('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x45c7ba){switch(_0x45c7ba){case'Bad\x20Request':return 0x190;case'Forbidden',_0xe9bd('0x9'):return 0x193;case _0xe9bd('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2601ac){return function(_0x581ab9){logger[_0xe9bd('0xa')](_0x581ab9[_0xe9bd('0xb')]);var _0x3339f9=getStatusCode(_0x581ab9[_0xe9bd('0x3')]);if(_0x581ab9['name'])delete _0x581ab9[_0xe9bd('0x3')];return _0x2601ac['status'](_0x3339f9)[_0xe9bd('0xc')](_0x581ab9);};}module[_0xe9bd('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 6615a19..0a0227f 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6a8=['json','send','exports','status','render'];(function(_0x11963b,_0x5d2da7){var _0x5d451e=function(_0x41e9e5){while(--_0x41e9e5){_0x11963b['push'](_0x11963b['shift']());}};_0x5d451e(++_0x5d2da7);}(_0xc6a8,0x106));var _0x8c6a=function(_0x52382a,_0x54d317){_0x52382a=_0x52382a-0x0;var _0x40dc7e=_0xc6a8[_0x52382a];return _0x40dc7e;};'use strict';module[_0x8c6a('0x0')][0x194]=function pageNotFound(_0x3892dc,_0x5227e0){var _0x2d8507='404';var _0x2bb453=0x194;var _0x51f0c6={'status':_0x2bb453};_0x5227e0[_0x8c6a('0x1')](_0x51f0c6[_0x8c6a('0x1')]);_0x5227e0[_0x8c6a('0x2')](_0x2d8507,{},function(_0x3ae9a5,_0x44752c){if(_0x3ae9a5){return _0x5227e0[_0x8c6a('0x1')](_0x51f0c6[_0x8c6a('0x1')])[_0x8c6a('0x3')](_0x51f0c6);}_0x5227e0[_0x8c6a('0x4')](_0x44752c);});}; \ No newline at end of file +var _0x049e=['json','send','exports','status','render'];(function(_0x32f9e5,_0x429238){var _0x39d10b=function(_0x31e7ab){while(--_0x31e7ab){_0x32f9e5['push'](_0x32f9e5['shift']());}};_0x39d10b(++_0x429238);}(_0x049e,0x16a));var _0xe049=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x049e[_0x468b0f];return _0x3e74d9;};'use strict';module[_0xe049('0x0')][0x194]=function pageNotFound(_0x12806c,_0x5efb24){var _0x30ed85='404';var _0x155cb3=0x194;var _0x13cc6a={'status':_0x155cb3};_0x5efb24[_0xe049('0x1')](_0x13cc6a[_0xe049('0x1')]);_0x5efb24[_0xe049('0x2')](_0x30ed85,{},function(_0x50c6dc,_0x352aa6){if(_0x50c6dc){return _0x5efb24[_0xe049('0x1')](_0x13cc6a[_0xe049('0x1')])[_0xe049('0x3')](_0x13cc6a);}_0x5efb24[_0xe049('0x4')](_0x352aa6);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 04a73a5..5409856 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39d0=['MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.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','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','SquareProject','SquareRecording','../api/squareMessage/squareMessage.model','Team','License','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','UserVoicePrefix','UserSetting','User','hasOne','cascade','UserId','userSetting','hasMany','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_chat_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceExtension','SpiedAgents','ChanSpyId','Applications','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','VoiceMail','Messages','mailbox','QueueCalls','VoiceAgentReport','AgentReports','CmContact','Contact','ContactId','MailAccountId','CloudProviderId','MailServerOut','restrict','Smtp','Dispositions','Answers','Interactions','List','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailMessage','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','user_has_mail_interactions','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','IntervalId','MailQueueReport','ListId','Dashboard','FaxAccountId','user_has_fax_accounts','TagId','fax_interaction_has_tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccount','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','ThroughTags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ProactiveActions','ChatQueue','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','CompanyId','CmContactHasItem','Phones','CmContactId','Hoppers','OpenchannelInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Agent','Campaign','CampaignId','OwnerId','All','OneAll','Any','OneAny','Actions','AutomationId','ParentId','Intervals','ChatApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','VoiceMusicOnHold','Mohs','moh_has_sounds','ContactItemType','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Description','Field','VariableId','Descriptions','int_desk_configuration_has_tags','ZohoAccount','Subject','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','FreshsalesConfiguration','FreshsalesField','ChatQueueReport','FromId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','user_has_teams','team_has_chat_queues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ChatTransferReport','ToUserId','ToChatQueueId','ToChatWebsiteId','ToAccount','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','ToSmsQueueId','CustomFields','Queues','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','FromWhatsappAccountId','WhatsappQueueId','Imap','exports','../config/environment','lodash','jstz','sequelize','defaultsDeep','motion2','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','mysql','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model'];(function(_0x485c07,_0x32e620){var _0x4d1222=function(_0x2da426){while(--_0x2da426){_0x485c07['push'](_0x485c07['shift']());}};_0x4d1222(++_0x32e620);}(_0x39d0,0x1c2));var _0x039d=function(_0x40c894,_0x389147){_0x40c894=_0x40c894-0x0;var _0x16c0f3=_0x39d0[_0x40c894];return _0x16c0f3;};'use strict';var config=require(_0x039d('0x0'));var Sequelize=require('sequelize');var _=require(_0x039d('0x1'));var jstz=require(_0x039d('0x2'));var timezone=jstz['determine']();config[_0x039d('0x3')]=_[_0x039d('0x4')](config[_0x039d('0x3')],{'database':_0x039d('0x5'),'username':'xcall','password':_0x039d('0x6'),'options':{'host':_0x039d('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x039d('0x8')},'logging':![],'timezone':timezone[_0x039d('0x9')](),'define':{'charset':_0x039d('0xa'),'collate':_0x039d('0xb')}}});config[_0x039d('0xc')]=_[_0x039d('0x4')](config[_0x039d('0xc')],{'database':_0x039d('0x5'),'username':_0x039d('0xd'),'password':_0x039d('0x6'),'options':{'host':_0x039d('0x7'),'port':0xcea,'dialect':_0x039d('0xe'),'dialectOptions':{'charset':_0x039d('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x039d('0xa'),'collate':_0x039d('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x039d('0xf')],config['sequelize'][_0x039d('0x10')],config[_0x039d('0x3')]['password'],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x039d('0xc')][_0x039d('0xf')],config['sequelizeHistory'][_0x039d('0x10')],config[_0x039d('0xc')][_0x039d('0x11')],config['sequelizeHistory'][_0x039d('0x12')])};db['User']=db['sequelize']['import'](_0x039d('0x13'));db[_0x039d('0x14')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x16'));db[_0x039d('0x17')]=db[_0x039d('0x3')]['import'](_0x039d('0x18'));db['VoiceExtension']=db[_0x039d('0x3')][_0x039d('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x19'));db[_0x039d('0x1a')]=db[_0x039d('0x3')]['import'](_0x039d('0x1b'));db[_0x039d('0x1c')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0x039d('0x1d')]=db['sequelize'][_0x039d('0x15')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db['sequelize'][_0x039d('0x15')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x1e'));db[_0x039d('0x1f')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x20'));db[_0x039d('0x21')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x22'));db['VoiceAgentReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x23'));db[_0x039d('0x24')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x25'));db[_0x039d('0x26')]=db[_0x039d('0x3')]['import'](_0x039d('0x27'));db[_0x039d('0x28')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x29'));db[_0x039d('0x2a')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x2b'));db[_0x039d('0x2c')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x039d('0x2d')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x2e'));db[_0x039d('0x2f')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x30'));db['UserMailQueue']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x31'));db[_0x039d('0x32')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x33'));db[_0x039d('0x34')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x35'));db[_0x039d('0x36')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x37'));db['UserWhatsappQueue']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x38'));db[_0x039d('0x39')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x3a'));db['MailServerOut']=db['sequelize'][_0x039d('0x15')](_0x039d('0x3b'));db[_0x039d('0x3c')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x3d'));db[_0x039d('0x3e')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x3f'));db[_0x039d('0x40')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x41'));db[_0x039d('0x42')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x43'));db['MailMessage']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x44'));db[_0x039d('0x45')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x46'));db['Dashboard']=db[_0x039d('0x3')]['import'](_0x039d('0x47'));db[_0x039d('0x48')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x49'));db['FaxAccount']=db['sequelize'][_0x039d('0x15')](_0x039d('0x4a'));db[_0x039d('0x4b')]=db[_0x039d('0x3')]['import'](_0x039d('0x4c'));db['FaxInteraction']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x4d'));db[_0x039d('0x4e')]=db[_0x039d('0x3')]['import'](_0x039d('0x4f'));db[_0x039d('0x50')]=db['sequelize'][_0x039d('0x15')]('../api/faxQueue/faxQueue.model');db[_0x039d('0x51')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x52'));db['SmsAccount']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x53'));db['SmsApplication']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x54'));db[_0x039d('0x55')]=db[_0x039d('0x3')]['import'](_0x039d('0x56'));db[_0x039d('0x57')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/smsMessage/smsMessage.model');db[_0x039d('0x58')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x59'));db['OpenchannelAccount']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x5a'));db[_0x039d('0x5b')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x5c'));db['OpenchannelInteraction']=db['sequelize']['import'](_0x039d('0x5d'));db['OpenchannelMessage']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x5e'));db[_0x039d('0x5f')]=db[_0x039d('0x3')]['import'](_0x039d('0x60'));db[_0x039d('0x61')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0x039d('0x62')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x63'));db[_0x039d('0x64')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/chatApplication/chatApplication.model');db[_0x039d('0x65')]=db[_0x039d('0x3')]['import'](_0x039d('0x66'));db[_0x039d('0x67')]=db['sequelize'][_0x039d('0x15')]('../api/chatMessage/chatMessage.model');db[_0x039d('0x68')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x69'));db['ChatQueue']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x6a'));db[_0x039d('0x6b')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x6c'));db[_0x039d('0x6d')]=db[_0x039d('0x3')]['import'](_0x039d('0x6e'));db[_0x039d('0x6f')]=db[_0x039d('0x3')]['import'](_0x039d('0x70'));db['CmContact']=db[_0x039d('0x3')][_0x039d('0x15')]('../api/cmContact/cmContact.model');db[_0x039d('0x71')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/cmHopper/cmHopper.model');db[_0x039d('0x72')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x73'));db[_0x039d('0x74')]=db[_0x039d('0x3')]['import'](_0x039d('0x75'));db[_0x039d('0x76')]=db[_0x039d('0x3')]['import'](_0x039d('0x77'));db[_0x039d('0x78')]=db['sequelize']['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0x039d('0x79')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x7a'));db[_0x039d('0x7b')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x7c'));db[_0x039d('0x7d')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x7e'));db[_0x039d('0x7f')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x80'));db[_0x039d('0x81')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x82'));db[_0x039d('0x83')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x84'));db[_0x039d('0x85')]=db['sequelize'][_0x039d('0x15')](_0x039d('0x86'));db[_0x039d('0x87')]=db[_0x039d('0x3')]['import'](_0x039d('0x88'));db[_0x039d('0x89')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x8a'));db[_0x039d('0x8b')]=db[_0x039d('0x3')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x039d('0x8c')]=db[_0x039d('0x3')]['import'](_0x039d('0x8d'));db[_0x039d('0x8e')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x8f'));db[_0x039d('0x90')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x91'));db['ContactItemType']=db['sequelize'][_0x039d('0x15')](_0x039d('0x92'));db['CmContactHasItem']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x93'));db['CmHopperAdditionalPhone']=db[_0x039d('0x3')][_0x039d('0x15')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x039d('0x94')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x95'));db[_0x039d('0x96')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x97'));db[_0x039d('0x98')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x99'));db[_0x039d('0x9a')]=db['sequelize']['import'](_0x039d('0x9b'));db['IntegrationReport']=db[_0x039d('0x3')]['import'](_0x039d('0x9c'));db[_0x039d('0x9d')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x9e'));db['AnalyticDefaultReport']=db[_0x039d('0x3')]['import'](_0x039d('0x9f'));db['AnalyticExtractedReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xa0'));db[_0x039d('0xa1')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/analyticMetric/analyticMetric.model');db[_0x039d('0xa2')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x039d('0xa3')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xa4'));db[_0x039d('0xa5')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xa6'));db[_0x039d('0xa7')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xa8'));db[_0x039d('0xa9')]=db[_0x039d('0x3')]['import'](_0x039d('0xaa'));db['SugarcrmAccount']=db[_0x039d('0x3')][_0x039d('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x039d('0xab')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xac'));db[_0x039d('0xad')]=db['sequelize']['import'](_0x039d('0xae'));db[_0x039d('0xaf')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/intDeskAccount/intDeskAccount.model');db[_0x039d('0xb0')]=db['sequelize']['import'](_0x039d('0xb1'));db[_0x039d('0xb2')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xb3'));db['ZohoAccount']=db['sequelize'][_0x039d('0x15')](_0x039d('0xb4'));db[_0x039d('0xb5')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xb6'));db[_0x039d('0xb7')]=db['sequelize'][_0x039d('0x15')](_0x039d('0xb8'));db['ZendeskAccount']=db['sequelize'][_0x039d('0x15')](_0x039d('0xb9'));db[_0x039d('0xba')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x039d('0xbb')]=db[_0x039d('0x3')]['import'](_0x039d('0xbc'));db[_0x039d('0xbd')]=db['sequelize'][_0x039d('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x039d('0xbe')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xbf'));db['FreshdeskField']=db[_0x039d('0x3')]['import'](_0x039d('0xc0'));db[_0x039d('0xc1')]=db[_0x039d('0x3')]['import'](_0x039d('0xc2'));db['VtigerConfiguration']=db[_0x039d('0x3')]['import'](_0x039d('0xc3'));db[_0x039d('0xc4')]=db[_0x039d('0x3')]['import'](_0x039d('0xc5'));db[_0x039d('0xc6')]=db[_0x039d('0x3')]['import'](_0x039d('0xc7'));db[_0x039d('0xc8')]=db['sequelize']['import'](_0x039d('0xc9'));db[_0x039d('0xca')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/intServicenowField/intServicenowField.model');db[_0x039d('0xcb')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xcc'));db[_0x039d('0xcd')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xce'));db[_0x039d('0xcf')]=db['sequelize'][_0x039d('0x15')](_0x039d('0xd0'));db[_0x039d('0xd1')]=db['sequelize'][_0x039d('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xd2'));db['FreshsalesField']=db[_0x039d('0x3')][_0x039d('0x15')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x039d('0x9a')]=db[_0x039d('0x3')]['import'](_0x039d('0x9b'));db[_0x039d('0xd3')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/network/network.model');db['ChatQueueReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xd4'));db[_0x039d('0xd5')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xd6'));db[_0x039d('0xd7')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xd8'));db['JscriptyQuestionReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xd9'));db[_0x039d('0xda')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xdb'));db['SmsQueueReport']=db['sequelize'][_0x039d('0x15')](_0x039d('0xdc'));db[_0x039d('0xdd')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xde'));db['SquareDetailsReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xdf'));db[_0x039d('0xe0')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xe1'));db['Setting']=db['sequelize']['import']('../api/setting/setting.model');db[_0x039d('0xe2')]=db[_0x039d('0x3')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x039d('0xe3')]=db['sequelize'][_0x039d('0x15')]('../api/squareProject/squareProject.model');db[_0x039d('0xe4')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize']['import'](_0x039d('0xe5'));db[_0x039d('0xe6')]=db[_0x039d('0x3')]['import']('../api/team/team.model');db[_0x039d('0xe7')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/license/license.model');db['Campaign']=db[_0x039d('0x3')]['import'](_0x039d('0xe8'));db[_0x039d('0xe9')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/migration/migration.model');db['Attachment']=db[_0x039d('0x3')]['import'](_0x039d('0xea'));db[_0x039d('0xeb')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xec'));db[_0x039d('0xed')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xee'));db['ChatTransferReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xef'));db['FaxTransferReport']=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xf0'));db[_0x039d('0xf1')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x039d('0x3')]['import'](_0x039d('0xf2'));db[_0x039d('0xf3')]=db['sequelize'][_0x039d('0x15')](_0x039d('0xf4'));db[_0x039d('0xf5')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0x039d('0xf6')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xf7'));db[_0x039d('0xf8')]=db[_0x039d('0x3')]['import'](_0x039d('0xf9'));db[_0x039d('0xfa')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xfb'));db['UserNotification']=db['sequelize'][_0x039d('0x15')](_0x039d('0xfc'));db['WhatsappAccount']=db[_0x039d('0x3')]['import']('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db['sequelize']['import'](_0x039d('0xfd'));db[_0x039d('0xfe')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0xff'));db[_0x039d('0x100')]=db['sequelize'][_0x039d('0x15')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0x039d('0x3')]['import'](_0x039d('0x101'));db[_0x039d('0x102')]=db[_0x039d('0x3')]['import'](_0x039d('0x103'));db[_0x039d('0x104')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x105'));db[_0x039d('0x106')]=db['sequelize']['import'](_0x039d('0x107'));db[_0x039d('0x108')]=db[_0x039d('0x3')][_0x039d('0x15')](_0x039d('0x109'));db['TeamVoicePrefix']=db[_0x039d('0x3')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x039d('0x10a')]=db['sequelize'][_0x039d('0x15')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x039d('0x10b')]=db[_0x039d('0x3')][_0x039d('0x15')]('../api/user-setting/user-setting.model');db[_0x039d('0x10c')][_0x039d('0x10d')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x10f')});db['User']['hasOne'](db['UserSetting'],{'as':_0x039d('0x110'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0x1c')],{'as':'Recordings','foreignKey':'UserId'});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0x2c')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x039d('0x10c')][_0x039d('0x111')](db['VoiceExtension'],{'as':_0x039d('0x112'),'onDelete':_0x039d('0x10e'),'hooks':!![]});db[_0x039d('0x10c')]['hasMany'](db['CmHopperFinal'],{'as':_0x039d('0x113'),'foreignKey':'UserId'});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0x76')],{'as':_0x039d('0x114'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x10c')]['hasMany'](db[_0x039d('0x78')],{'as':'ReportAgentPreview','foreignKey':_0x039d('0x10f')});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0x115')],{'as':'OpenchannelInteractions','foreignKey':_0x039d('0x10f')});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0x65')],{'as':_0x039d('0x116'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0x55')],{'as':_0x039d('0x117'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0x118')],{'as':_0x039d('0x119'),'foreignKey':'UserId'});db[_0x039d('0x10c')]['hasMany'](db['MailInteraction'],{'as':_0x039d('0x11a'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x10c')][_0x039d('0x111')](db[_0x039d('0xfe')],{'as':_0x039d('0x11b'),'foreignKey':_0x039d('0x10f')});db['User'][_0x039d('0x111')](db[_0x039d('0x11c')],{'as':_0x039d('0x11d'),'foreignKey':'SenderId'});db['User']['belongsTo'](db[_0x039d('0xf6')],{'as':'UserProfile','foreignKey':_0x039d('0x11e')});db['User'][_0x039d('0x11f')](db[_0x039d('0x6b')],{'as':'Groups','through':_0x039d('0x120')});db['User']['belongsToMany'](db['CmContact'],{'as':_0x039d('0x121'),'through':_0x039d('0x122')});db['User']['belongsToMany'](db['CmList'],{'as':_0x039d('0x123'),'through':_0x039d('0x124')});db[_0x039d('0x10c')]['belongsToMany'](db[_0x039d('0xe6')],{'through':'user_has_teams'});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x42')],{'as':_0x039d('0x11a'),'through':'user_has_mail_interactions'});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x65')],{'as':_0x039d('0x116'),'through':_0x039d('0x125')});db['User'][_0x039d('0x11f')](db[_0x039d('0x118')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x039d('0x10c')]['belongsToMany'](db['SmsInteraction'],{'as':_0x039d('0x117'),'through':_0x039d('0x126')});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x115')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0xfe')],{'as':_0x039d('0x11b'),'through':_0x039d('0x127')});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x1a')],{'as':_0x039d('0x128'),'through':'UserVoiceQueue','required':![]});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0xf5')],{'as':_0x039d('0x129'),'through':_0x039d('0x10a'),'required':![]});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x3e')],{'as':_0x039d('0x12a'),'through':_0x039d('0x12b'),'required':![]});db[_0x039d('0x10c')]['belongsToMany'](db['ChatQueue'],{'as':_0x039d('0x12c'),'through':_0x039d('0x2f'),'required':![],'hooks':!![]});db[_0x039d('0x10c')]['belongsToMany'](db[_0x039d('0x50')],{'as':_0x039d('0x12d'),'through':_0x039d('0x32'),'required':![]});db['User'][_0x039d('0x11f')](db[_0x039d('0x58')],{'as':_0x039d('0x12e'),'through':'UserSmsQueue','required':![]});db['User'][_0x039d('0x11f')](db['OpenchannelQueue'],{'as':_0x039d('0x12f'),'through':_0x039d('0x36'),'required':![]});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x104')],{'as':_0x039d('0x130'),'through':_0x039d('0x131'),'required':![]});db[_0x039d('0x10c')]['belongsToMany'](db['CmList'],{'through':_0x039d('0x124')});db['User'][_0x039d('0x11f')](db[_0x039d('0x61')],{'as':_0x039d('0x132'),'through':_0x039d('0x133')});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x134')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0x039d('0x11f')](db[_0x039d('0x3c')],{'as':'MailAccounts','through':_0x039d('0x135')});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x136')],{'as':'OpenchannelAccounts','through':_0x039d('0x137')});db[_0x039d('0x10c')]['belongsToMany'](db['SmsAccount'],{'as':_0x039d('0x138'),'through':_0x039d('0x139')});db[_0x039d('0x10c')][_0x039d('0x11f')](db[_0x039d('0x13a')],{'as':_0x039d('0x13b'),'through':_0x039d('0x13c')});db['User'][_0x039d('0x11f')](db[_0x039d('0xe3')],{'as':_0x039d('0x13d'),'through':_0x039d('0x13e')});db[_0x039d('0x14')][_0x039d('0x111')](db[_0x039d('0x13f')],{'as':_0x039d('0x140'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x141')});db[_0x039d('0x17')][_0x039d('0x111')](db[_0x039d('0x13f')],{'onDelete':_0x039d('0x10e')});db['VoiceExtension']['hasMany'](db[_0x039d('0x13f')],{'as':_0x039d('0x142'),'onDelete':_0x039d('0x10e')});db['VoiceMusicOnHold']['belongsToMany'](db['Sound'],{'as':'Sounds','through':'moh_has_sounds'});db[_0x039d('0x1a')][_0x039d('0x111')](db['UserVoiceQueueRt'],{'as':_0x039d('0x143'),'foreignKey':_0x039d('0x144')});db[_0x039d('0x1a')][_0x039d('0x111')](db[_0x039d('0x71')],{'as':'Hoppers','foreignKey':_0x039d('0x144')});db['VoiceQueue'][_0x039d('0x111')](db[_0x039d('0x74')],{'as':_0x039d('0x113'),'foreignKey':_0x039d('0x144')});db[_0x039d('0x1a')][_0x039d('0x111')](db[_0x039d('0x76')],{'as':_0x039d('0x145'),'foreignKey':_0x039d('0x144')});db[_0x039d('0x1a')][_0x039d('0x111')](db[_0x039d('0x78')],{'as':_0x039d('0x78'),'foreignKey':_0x039d('0x144')});db[_0x039d('0x1a')][_0x039d('0x111')](db[_0x039d('0x72')],{'as':_0x039d('0x146'),'foreignKey':_0x039d('0x144')});db[_0x039d('0x1a')][_0x039d('0x111')](db[_0x039d('0xda')],{'as':_0x039d('0x147'),'foreignKey':_0x039d('0x144')});db['VoiceQueue'][_0x039d('0x148')](db[_0x039d('0x28')],{'as':_0x039d('0x28'),'foreignKey':_0x039d('0x149')});db[_0x039d('0x1a')][_0x039d('0x148')](db[_0x039d('0x28')],{'as':_0x039d('0x14a'),'foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0x039d('0x148')](db[_0x039d('0x85')],{'as':_0x039d('0x85'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0x039d('0x148')](db[_0x039d('0x87')],{'as':_0x039d('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x039d('0x1a')][_0x039d('0x11f')](db[_0x039d('0xf3')],{'as':_0x039d('0x123'),'through':_0x039d('0x14c')});db[_0x039d('0x1a')][_0x039d('0x11f')](db['User'],{'as':_0x039d('0x14d'),'through':_0x039d('0x2d')});db[_0x039d('0x1a')][_0x039d('0x11f')](db[_0x039d('0xe6')],{'as':_0x039d('0x14e'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0x039d('0x11f')](db[_0x039d('0xf3')],{'as':'BlackLists','through':_0x039d('0x14f')});db['VoiceRecording']['belongsTo'](db['User'],{'as':'User','foreignKey':_0x039d('0x10f')});db['ScreenRecording'][_0x039d('0x148')](db['User'],{'as':_0x039d('0x10c'),'foreignKey':'UserId'});db[_0x039d('0x150')][_0x039d('0x111')](db['VoiceMailMessage'],{'as':_0x039d('0x151'),'onDelete':_0x039d('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x039d('0x152')});db['VoiceMailMessage'][_0x039d('0x148')](db[_0x039d('0x150')],{'foreignKey':'mailboxuser','targetKey':_0x039d('0x152')});db[_0x039d('0x1f')]['hasMany'](db[_0x039d('0x24')],{'as':_0x039d('0x153'),'foreignKey':'uniqueid','constraints':![]});db[_0x039d('0x1f')][_0x039d('0x111')](db[_0x039d('0x154')],{'as':_0x039d('0x155'),'foreignKey':'uniqueid','constraints':![]});db[_0x039d('0x1f')]['belongsTo'](db[_0x039d('0x10c')],{'as':_0x039d('0x10c'),'foreignKey':_0x039d('0x10f')});db['VoiceCallReport']['belongsTo'](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158')});db[_0x039d('0x39')][_0x039d('0x148')](db[_0x039d('0x3c')],{'as':'MailAccount','foreignKey':_0x039d('0x159')});db[_0x039d('0x39')][_0x039d('0x148')](db[_0x039d('0x106')],{'as':_0x039d('0x106'),'foreignKey':_0x039d('0x15a'),'onDelete':'restrict'});db[_0x039d('0x15b')]['belongsTo'](db[_0x039d('0x3c')],{'as':_0x039d('0x3c'),'foreignKey':'MailAccountId'});db[_0x039d('0x15b')][_0x039d('0x148')](db[_0x039d('0x106')],{'as':'CloudProvider','foreignKey':_0x039d('0x15a'),'onDelete':_0x039d('0x15c')});db[_0x039d('0x3c')][_0x039d('0x10d')](db[_0x039d('0x39')],{'as':'Imap','onDelete':_0x039d('0x10e')});db[_0x039d('0x3c')]['hasOne'](db[_0x039d('0x15b')],{'as':_0x039d('0x15d'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x3c')][_0x039d('0x111')](db[_0x039d('0x81')],{'as':_0x039d('0x15e'),'foreignKey':'MailAccountId','onDelete':_0x039d('0x10e')});db['MailAccount']['hasMany'](db[_0x039d('0x7f')],{'as':_0x039d('0x15f'),'foreignKey':_0x039d('0x159')});db['MailAccount'][_0x039d('0x111')](db['MailMessage'],{'as':_0x039d('0x151'),'foreignKey':_0x039d('0x159')});db[_0x039d('0x3c')][_0x039d('0x111')](db[_0x039d('0x42')],{'as':_0x039d('0x160')});db[_0x039d('0x3c')][_0x039d('0x111')](db['MailApplication'],{'as':'Applications'});db[_0x039d('0x3c')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':'ListId'});db[_0x039d('0x3c')][_0x039d('0x148')](db[_0x039d('0x94')],{'as':'Template','foreignKey':_0x039d('0x162')});db[_0x039d('0x3c')]['belongsTo'](db[_0x039d('0x87')],{'as':_0x039d('0x14b'),'foreignKey':_0x039d('0x163')});db['MailAccount'][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':_0x039d('0x135')});db[_0x039d('0x3e')]['belongsToMany'](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':'UserMailQueue'});db[_0x039d('0x3e')][_0x039d('0x11f')](db[_0x039d('0xe6')],{'through':_0x039d('0x164'),'as':'Teams'});db[_0x039d('0x42')][_0x039d('0x111')](db[_0x039d('0x165')],{'as':_0x039d('0x151'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x166')});db[_0x039d('0x42')]['belongsTo'](db[_0x039d('0x3c')],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x159')});db[_0x039d('0x42')]['belongsTo'](db['CmContact'],{'as':_0x039d('0x157'),'foreignKey':'ContactId'});db[_0x039d('0x42')][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':_0x039d('0x168'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x42')]['belongsToMany'](db[_0x039d('0x90')],{'through':_0x039d('0x169'),'as':_0x039d('0x16a')});db[_0x039d('0x42')][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x169'),'as':'ThroughTags'});db[_0x039d('0x42')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x16b'),'through':_0x039d('0x16c'),'foreignKey':_0x039d('0x166')});db['MailMessage'][_0x039d('0x111')](db[_0x039d('0x16d')],{'as':_0x039d('0x16e'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x165')][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':_0x039d('0x10c')});db['MailMessage'][_0x039d('0x148')](db['CmContact'],{'onDelete':'cascade','as':_0x039d('0x157')});db[_0x039d('0x165')][_0x039d('0x148')](db[_0x039d('0x42')],{'as':_0x039d('0x16f'),'foreignKey':_0x039d('0x166')});db[_0x039d('0x165')][_0x039d('0x148')](db[_0x039d('0x3c')],{'as':_0x039d('0x167'),'foreignKey':'MailAccountId'});db[_0x039d('0x165')]['belongsTo'](db[_0x039d('0x61')],{'as':_0x039d('0x61'),'foreignKey':_0x039d('0x170')});db[_0x039d('0x165')][_0x039d('0x148')](db[_0x039d('0x68')],{'as':_0x039d('0x68'),'foreignKey':_0x039d('0x171')});db[_0x039d('0x45')][_0x039d('0x148')](db['User'],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x45')][_0x039d('0x148')](db[_0x039d('0x3e')],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x45')]['belongsTo'](db['MailAccount'],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x45')][_0x039d('0x148')](db[_0x039d('0x85')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x172')});db['MailApplication']['belongsTo'](db[_0x039d('0x90')],{'onDelete':_0x039d('0x15c'),'foreignKey':'TagId'});db[_0x039d('0x173')][_0x039d('0x148')](db[_0x039d('0x3c')],{});db[_0x039d('0x173')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174')});db[_0x039d('0x173')][_0x039d('0x148')](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':'ContactId'});db[_0x039d('0x173')][_0x039d('0x148')](db['MailInteraction'],{});db['MailQueueReport'][_0x039d('0x148')](db[_0x039d('0x165')],{});db[_0x039d('0x173')][_0x039d('0x148')](db[_0x039d('0x10c')],{});db[_0x039d('0x173')][_0x039d('0x148')](db['MailQueue'],{});db[_0x039d('0x175')][_0x039d('0x111')](db[_0x039d('0x48')],{'as':'Items','onDelete':_0x039d('0x10e')});db[_0x039d('0x134')]['hasMany'](db['Disposition'],{'as':_0x039d('0x15e'),'foreignKey':_0x039d('0x176'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x134')][_0x039d('0x111')](db[_0x039d('0x7f')],{'as':_0x039d('0x15f'),'foreignKey':_0x039d('0x176')});db[_0x039d('0x134')]['hasMany'](db[_0x039d('0x118')],{'as':_0x039d('0x160')});db[_0x039d('0x134')]['hasMany'](db[_0x039d('0x4b')],{'as':_0x039d('0x142')});db[_0x039d('0x134')][_0x039d('0x111')](db[_0x039d('0x13f')],{'as':'Exntensions','onDelete':'cascade'});db[_0x039d('0x134')]['hasMany'](db[_0x039d('0x4e')],{'as':'Messages'});db[_0x039d('0x134')][_0x039d('0x148')](db[_0x039d('0x28')],{'as':'Trunk'});db['FaxAccount'][_0x039d('0x148')](db['CmList'],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174')});db[_0x039d('0x134')]['belongsTo'](db[_0x039d('0x87')],{'as':_0x039d('0x14b'),'foreignKey':_0x039d('0x163')});db[_0x039d('0x134')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':'Agents','through':_0x039d('0x177')});db['FaxApplication'][_0x039d('0x148')](db[_0x039d('0x10c')],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x4b')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x4b')][_0x039d('0x148')](db[_0x039d('0x134')],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x4b')][_0x039d('0x148')](db[_0x039d('0x90')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x178')});db[_0x039d('0x118')][_0x039d('0x111')](db[_0x039d('0x4e')],{'as':_0x039d('0x151'),'onDelete':_0x039d('0x10e'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x039d('0x148')](db[_0x039d('0x134')],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x176')});db['FaxInteraction']['belongsTo'](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':'ContactId'});db[_0x039d('0x118')][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':_0x039d('0x168'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x118')][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x179'),'as':_0x039d('0x16a')});db[_0x039d('0x118')][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x179'),'as':'ThroughTags'});db[_0x039d('0x118')][_0x039d('0x11f')](db['User'],{'as':_0x039d('0x16b'),'through':_0x039d('0x17a'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x039d('0x148')](db[_0x039d('0x10c')],{'onDelete':_0x039d('0x10e'),'as':_0x039d('0x10c')});db['FaxMessage'][_0x039d('0x148')](db[_0x039d('0x118')],{'as':_0x039d('0x16f'),'foreignKey':_0x039d('0x17b')});db[_0x039d('0x4e')][_0x039d('0x148')](db[_0x039d('0x156')],{'onDelete':'cascade','as':_0x039d('0x157')});db[_0x039d('0x4e')]['belongsTo'](db[_0x039d('0x16d')],{'as':'Attachment','foreignKey':_0x039d('0x17c')});db['FaxMessage'][_0x039d('0x148')](db['FaxAccount'],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x176')});db['FaxQueue'][_0x039d('0x11f')](db['User'],{'as':_0x039d('0x14d'),'through':'UserFaxQueue'});db[_0x039d('0x50')][_0x039d('0x11f')](db[_0x039d('0xe6')],{'through':_0x039d('0x17d'),'as':'Teams'});db['FaxQueueReport'][_0x039d('0x148')](db[_0x039d('0x134')],{});db[_0x039d('0x51')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174')});db[_0x039d('0x51')][_0x039d('0x148')](db[_0x039d('0x156')],{'as':'Contact','foreignKey':_0x039d('0x158')});db['FaxQueueReport'][_0x039d('0x148')](db[_0x039d('0x118')],{});db[_0x039d('0x51')][_0x039d('0x148')](db[_0x039d('0x4e')],{});db['FaxQueueReport'][_0x039d('0x148')](db['User'],{});db[_0x039d('0x51')][_0x039d('0x148')](db[_0x039d('0x50')],{});db[_0x039d('0x17e')][_0x039d('0x111')](db[_0x039d('0x81')],{'as':_0x039d('0x15e'),'foreignKey':_0x039d('0x17f'),'onDelete':_0x039d('0x10e')});db['SmsAccount'][_0x039d('0x111')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x039d('0x17f')});db['SmsAccount'][_0x039d('0x111')](db[_0x039d('0x57')],{'as':_0x039d('0x151'),'foreignKey':'SmsAccountId'});db[_0x039d('0x17e')]['hasMany'](db['SmsInteraction'],{'as':_0x039d('0x160')});db['SmsAccount'][_0x039d('0x111')](db[_0x039d('0x180')],{'as':_0x039d('0x142')});db['SmsAccount'][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174')});db['SmsAccount']['belongsTo'](db[_0x039d('0x87')],{'as':_0x039d('0x14b'),'foreignKey':_0x039d('0x163')});db[_0x039d('0x17e')]['belongsToMany'](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':_0x039d('0x139')});db[_0x039d('0x180')][_0x039d('0x148')](db[_0x039d('0x10c')],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x180')][_0x039d('0x148')](db['SmsQueue'],{'onDelete':_0x039d('0x15c')});db['SmsApplication'][_0x039d('0x148')](db['SmsAccount'],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x180')][_0x039d('0x148')](db[_0x039d('0x85')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x172')});db[_0x039d('0x180')]['belongsTo'](db[_0x039d('0x90')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x178')});db[_0x039d('0x55')]['hasMany'](db[_0x039d('0x57')],{'as':'Messages','onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x181')});db[_0x039d('0x55')][_0x039d('0x148')](db[_0x039d('0x17e')],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x17f')});db[_0x039d('0x55')][_0x039d('0x148')](db['CmContact'],{'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158')});db[_0x039d('0x55')][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':_0x039d('0x168'),'foreignKey':_0x039d('0x10f')});db[_0x039d('0x55')]['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x039d('0x16a')});db[_0x039d('0x55')][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x182'),'as':_0x039d('0x183')});db[_0x039d('0x55')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x16b'),'through':_0x039d('0x126'),'foreignKey':_0x039d('0x181')});db['SmsMessage'][_0x039d('0x148')](db['User'],{'as':_0x039d('0x10c')});db[_0x039d('0x57')]['belongsTo'](db['CmContact'],{'onDelete':_0x039d('0x10e'),'as':'Contact'});db[_0x039d('0x57')][_0x039d('0x148')](db[_0x039d('0x55')],{'onDelete':_0x039d('0x10e'),'as':'Interaction','foreignKey':_0x039d('0x181')});db[_0x039d('0x57')]['belongsTo'](db['SmsAccount'],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x17f')});db['SmsQueue']['belongsToMany'](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':'UserSmsQueue','foreignKey':_0x039d('0x184')});db[_0x039d('0x58')][_0x039d('0x11f')](db[_0x039d('0xe6')],{'through':_0x039d('0x185'),'as':_0x039d('0x14e')});db[_0x039d('0x136')][_0x039d('0x111')](db['Disposition'],{'as':_0x039d('0x15e'),'foreignKey':_0x039d('0x186'),'onDelete':'cascade'});db[_0x039d('0x136')][_0x039d('0x111')](db[_0x039d('0x7f')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x039d('0x136')][_0x039d('0x111')](db[_0x039d('0x115')],{'as':_0x039d('0x160'),'foreignKey':_0x039d('0x186')});db[_0x039d('0x136')][_0x039d('0x111')](db[_0x039d('0x187')],{'as':_0x039d('0x151'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x039d('0x111')](db[_0x039d('0x5b')],{'as':_0x039d('0x142'),'foreignKey':_0x039d('0x186')});db['OpenchannelAccount'][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174')});db[_0x039d('0x136')][_0x039d('0x148')](db[_0x039d('0x87')],{'as':_0x039d('0x14b'),'foreignKey':_0x039d('0x163')});db['OpenchannelAccount']['belongsToMany'](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':_0x039d('0x137')});db[_0x039d('0x5b')]['belongsTo'](db[_0x039d('0x10c')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x039d('0x148')](db[_0x039d('0x5f')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x188')});db['OpenchannelApplication'][_0x039d('0x148')](db[_0x039d('0x136')],{'onDelete':'restrict','foreignKey':_0x039d('0x186')});db[_0x039d('0x5b')]['belongsTo'](db['Interval'],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x172')});db[_0x039d('0x5b')][_0x039d('0x148')](db[_0x039d('0x90')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x178')});db[_0x039d('0x115')]['hasMany'](db[_0x039d('0x187')],{'as':'Messages','onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x189')});db[_0x039d('0x115')]['belongsTo'](db[_0x039d('0x136')],{'as':'Account','foreignKey':_0x039d('0x186')});db[_0x039d('0x115')][_0x039d('0x148')](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':'ContactId'});db[_0x039d('0x115')][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':_0x039d('0x168'),'foreignKey':_0x039d('0x10f')});db['OpenchannelInteraction'][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x18a'),'as':_0x039d('0x16a')});db[_0x039d('0x115')][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':'openchannel_interaction_has_tags','as':_0x039d('0x183')});db[_0x039d('0x115')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x16b'),'through':_0x039d('0x18b'),'foreignKey':_0x039d('0x189')});db[_0x039d('0x187')][_0x039d('0x148')](db[_0x039d('0x10c')],{'onDelete':_0x039d('0x10e'),'as':_0x039d('0x10c')});db[_0x039d('0x187')][_0x039d('0x148')](db[_0x039d('0x156')],{'onDelete':_0x039d('0x10e'),'as':_0x039d('0x157')});db[_0x039d('0x187')][_0x039d('0x148')](db[_0x039d('0x115')],{'onDelete':'cascade','as':_0x039d('0x16f'),'foreignKey':'OpenchannelInteractionId'});db[_0x039d('0x187')][_0x039d('0x148')](db[_0x039d('0x16d')],{'as':_0x039d('0x16d'),'foreignKey':_0x039d('0x17c')});db[_0x039d('0x187')][_0x039d('0x148')](db[_0x039d('0x136')],{'as':_0x039d('0x167'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0x039d('0x14d'),'through':_0x039d('0x36'),'foreignKey':_0x039d('0x188')});db[_0x039d('0x5f')][_0x039d('0x11f')](db[_0x039d('0xe6')],{'through':_0x039d('0x18c'),'as':_0x039d('0x14e')});db[_0x039d('0x61')][_0x039d('0x111')](db['Disposition'],{'as':_0x039d('0x15e'),'foreignKey':_0x039d('0x170'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x61')][_0x039d('0x111')](db[_0x039d('0x7f')],{'as':_0x039d('0x15f'),'foreignKey':_0x039d('0x170')});db[_0x039d('0x61')]['hasMany'](db[_0x039d('0x6d')],{'as':_0x039d('0x18d')});db[_0x039d('0x61')][_0x039d('0x111')](db['ChatInteraction'],{'as':_0x039d('0x160')});db['ChatWebsite']['hasMany'](db[_0x039d('0x64')],{'as':_0x039d('0x142')});db['ChatWebsite'][_0x039d('0x111')](db[_0x039d('0x67')],{'as':'Messages'});db[_0x039d('0x61')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':'List','foreignKey':_0x039d('0x174')});db[_0x039d('0x61')][_0x039d('0x148')](db[_0x039d('0x85')],{'as':_0x039d('0x85'),'foreignKey':'IntervalId'});db[_0x039d('0x61')][_0x039d('0x148')](db['MailAccount'],{'as':_0x039d('0x3c'),'foreignKey':'MailAccountId'});db[_0x039d('0x61')]['belongsTo'](db[_0x039d('0x87')],{'as':_0x039d('0x14b'),'foreignKey':_0x039d('0x163')});db[_0x039d('0x61')][_0x039d('0x11f')](db['User'],{'as':_0x039d('0x14d'),'through':_0x039d('0x133')});db[_0x039d('0x62')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x039d('0x62')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':'List','foreignKey':_0x039d('0x174')});db[_0x039d('0x62')][_0x039d('0x148')](db[_0x039d('0x156')],{'as':'Contact','foreignKey':'ContactId'});db[_0x039d('0x62')][_0x039d('0x148')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x039d('0x148')](db[_0x039d('0x187')],{});db[_0x039d('0x62')][_0x039d('0x148')](db[_0x039d('0x10c')],{});db['OpenchannelQueueReport'][_0x039d('0x148')](db[_0x039d('0x5f')],{});db['ChatApplication'][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':'Agent','foreignKey':'UserId','onDelete':_0x039d('0x15c')});db[_0x039d('0x64')][_0x039d('0x148')](db[_0x039d('0x18e')],{'as':_0x039d('0x18f'),'foreignKey':_0x039d('0x190'),'onDelete':_0x039d('0x15c')});db['ChatApplication'][_0x039d('0x148')](db[_0x039d('0x61')],{'as':_0x039d('0x191'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x039d('0x64')]['belongsTo'](db[_0x039d('0x90')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x178')});db[_0x039d('0x65')][_0x039d('0x111')](db['ChatMessage'],{'as':_0x039d('0x151'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x192')});db[_0x039d('0x65')][_0x039d('0x148')](db[_0x039d('0x61')],{'as':'Account','foreignKey':_0x039d('0x170')});db[_0x039d('0x65')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x039d('0x158')});db[_0x039d('0x65')]['belongsTo'](db[_0x039d('0x10c')],{'as':_0x039d('0x168'),'foreignKey':_0x039d('0x10f')});db['ChatInteraction'][_0x039d('0x11f')](db['Tag'],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x039d('0x65')]['belongsToMany'](db[_0x039d('0x90')],{'through':_0x039d('0x193'),'as':_0x039d('0x183')});db['ChatInteraction'][_0x039d('0x11f')](db['User'],{'as':_0x039d('0x16b'),'through':'user_has_chat_interactions','foreignKey':_0x039d('0x192')});db[_0x039d('0x67')][_0x039d('0x148')](db['User'],{'onDelete':'cascade','as':'User'});db[_0x039d('0x67')][_0x039d('0x148')](db[_0x039d('0x156')],{'onDelete':_0x039d('0x10e'),'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158')});db[_0x039d('0x67')][_0x039d('0x148')](db[_0x039d('0x65')],{'onDelete':_0x039d('0x10e'),'as':_0x039d('0x16f'),'foreignKey':_0x039d('0x192')});db[_0x039d('0x67')][_0x039d('0x148')](db[_0x039d('0x16d')],{'as':'Attachment','foreignKey':_0x039d('0x17c')});db[_0x039d('0x67')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x039d('0x68')][_0x039d('0x111')](db[_0x039d('0x16d')],{'as':_0x039d('0x16e'),'foreignKey':_0x039d('0x171'),'onDelete':'cascade','hooks':!![]});db[_0x039d('0x68')][_0x039d('0x148')](db[_0x039d('0x156')],{'onDelete':_0x039d('0x10e'),'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158')});db[_0x039d('0x68')][_0x039d('0x148')](db['ChatWebsite'],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x170')});db[_0x039d('0x18e')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':_0x039d('0x2f'),'hooks':!![]});db['ChatQueue'][_0x039d('0x11f')](db[_0x039d('0xe6')],{'through':'team_has_chat_queues','as':'Teams'});db[_0x039d('0x6b')][_0x039d('0x111')](db[_0x039d('0xd5')],{'as':_0x039d('0x151'),'foreignKey':_0x039d('0x194'),'onDelete':_0x039d('0x10e')});db['ChatGroup'][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x143'),'through':_0x039d('0x120')});db[_0x039d('0x6d')]['belongsTo'](db[_0x039d('0x61')],{'as':_0x039d('0x191'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x039d('0x111')](db['CmContact'],{'as':'Contacts','foreignKey':_0x039d('0x195')});db[_0x039d('0x156')][_0x039d('0x111')](db[_0x039d('0x196')],{'as':_0x039d('0x197'),'foreignKey':_0x039d('0x198')});db[_0x039d('0x156')][_0x039d('0x111')](db[_0x039d('0x71')],{'as':_0x039d('0x199'),'foreignKey':'ContactId'});db[_0x039d('0x156')]['hasMany'](db[_0x039d('0x74')],{'as':_0x039d('0x113'),'foreignKey':_0x039d('0x158')});db['CmContact'][_0x039d('0x111')](db[_0x039d('0x76')],{'as':_0x039d('0x145'),'foreignKey':_0x039d('0x158')});db[_0x039d('0x156')][_0x039d('0x111')](db['ReportAgentPreview'],{'as':_0x039d('0x78'),'foreignKey':'ContactId'});db[_0x039d('0x156')][_0x039d('0x111')](db['JscriptySessionReport'],{'as':_0x039d('0x147'),'foreignKey':_0x039d('0x158')});db[_0x039d('0x156')][_0x039d('0x111')](db[_0x039d('0x115')],{'as':_0x039d('0x19a'),'foreignKey':_0x039d('0x158'),'onDelete':_0x039d('0x15c')});db[_0x039d('0x156')][_0x039d('0x111')](db[_0x039d('0x65')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x039d('0x15c')});db[_0x039d('0x156')]['hasMany'](db[_0x039d('0x55')],{'as':_0x039d('0x117'),'foreignKey':_0x039d('0x158'),'onDelete':_0x039d('0x15c')});db[_0x039d('0x156')][_0x039d('0x111')](db['FaxInteraction'],{'as':_0x039d('0x119'),'foreignKey':_0x039d('0x158'),'onDelete':_0x039d('0x15c')});db['CmContact'][_0x039d('0x111')](db[_0x039d('0x42')],{'as':_0x039d('0x11a'),'foreignKey':_0x039d('0x158'),'onDelete':'restrict'});db[_0x039d('0x156')][_0x039d('0x148')](db[_0x039d('0x6f')],{'as':_0x039d('0x19b'),'foreignKey':'CompanyId'});db[_0x039d('0x156')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':'ListId','onDelete':_0x039d('0x10e')});db[_0x039d('0x156')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x16b'),'through':_0x039d('0x122')});db[_0x039d('0x156')][_0x039d('0x11f')](db['Tag'],{'as':_0x039d('0x16a'),'through':_0x039d('0x19c')});db['CmContact'][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x19c'),'as':_0x039d('0x183')});db[_0x039d('0x71')][_0x039d('0x111')](db[_0x039d('0x19d')],{'as':_0x039d('0x19e'),'foreignKey':_0x039d('0x19f')});db[_0x039d('0x71')][_0x039d('0x148')](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x71')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174'),'onDelete':'cascade'});db[_0x039d('0x71')]['belongsTo'](db[_0x039d('0x10c')],{'as':_0x039d('0x1a0'),'foreignKey':_0x039d('0x10f')});db['CmHopper'][_0x039d('0x148')](db[_0x039d('0x1a')],{'as':'Queue','foreignKey':_0x039d('0x144'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x71')][_0x039d('0x148')](db['Campaign'],{'as':_0x039d('0x1a1'),'foreignKey':_0x039d('0x1a2'),'onDelete':_0x039d('0x10e')});db['CmHopper'][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':_0x039d('0x168'),'foreignKey':_0x039d('0x1a3')});db[_0x039d('0x72')]['belongsTo'](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158'),'onDelete':'cascade'});db[_0x039d('0x72')][_0x039d('0x148')](db['CmList'],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x72')][_0x039d('0x148')](db[_0x039d('0x1a')],{'as':_0x039d('0x18f'),'foreignKey':'VoiceQueueId','onDelete':_0x039d('0x10e')});db[_0x039d('0x72')][_0x039d('0x148')](db[_0x039d('0x1a1')],{'as':_0x039d('0x1a1'),'foreignKey':_0x039d('0x1a2'),'onDelete':_0x039d('0x10e')});db['Automation']['hasMany'](db[_0x039d('0x83')],{'as':{'plural':_0x039d('0x1a4'),'singular':_0x039d('0x1a5')},'foreignKey':'AutomationAllId','onDelete':_0x039d('0x10e'),'hooks':!![]});db['Automation'][_0x039d('0x111')](db[_0x039d('0x83')],{'as':{'plural':_0x039d('0x1a6'),'singular':_0x039d('0x1a7')},'foreignKey':'AutomationAnyId','onDelete':_0x039d('0x10e'),'hooks':!![]});db[_0x039d('0x7d')][_0x039d('0x111')](db[_0x039d('0x7b')],{'as':_0x039d('0x1a8'),'foreignKey':_0x039d('0x1a9'),'onDelete':_0x039d('0x10e'),'hooks':!![]});db[_0x039d('0x81')][_0x039d('0x111')](db['Disposition'],{'as':_0x039d('0x15e'),'foreignKey':_0x039d('0x1aa'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x85')]['hasMany'](db['Interval'],{'as':_0x039d('0x1ab'),'foreignKey':_0x039d('0x172'),'onDelete':_0x039d('0x10e'),'hooks':!![],'required':![]});db['Interval'][_0x039d('0x111')](db['VoiceExtension'],{'as':'Extensions','foreignKey':'IntervalId','onDelete':'restrict'});db[_0x039d('0x85')][_0x039d('0x111')](db[_0x039d('0x45')],{'as':'MailApplications','foreignKey':_0x039d('0x172')});db[_0x039d('0x85')]['hasMany'](db[_0x039d('0x64')],{'as':_0x039d('0x1ac'),'foreignKey':_0x039d('0x172')});db['Interval'][_0x039d('0x111')](db[_0x039d('0x4b')],{'as':'FaxApplications','foreignKey':_0x039d('0x172')});db[_0x039d('0x85')]['hasMany'](db[_0x039d('0x180')],{'as':'SmsApplications','foreignKey':_0x039d('0x172')});db['Schedule'][_0x039d('0x148')](db[_0x039d('0x3c')],{});db['Schedule'][_0x039d('0x148')](db[_0x039d('0x1ad')],{'foreignKey':_0x039d('0x1ae')});db['Schedule'][_0x039d('0x148')](db[_0x039d('0x9d')],{'foreignKey':_0x039d('0x1af')});db['Sound'][_0x039d('0x11f')](db[_0x039d('0x1b0')],{'as':_0x039d('0x1b1'),'through':_0x039d('0x1b2'),'onDelete':_0x039d('0x15c')});db['Tag'][_0x039d('0x11f')](db[_0x039d('0x156')],{'through':_0x039d('0x19c')});db['Tag']['belongsToMany'](db[_0x039d('0x65')],{'through':'chat_interaction_has_tags'});db[_0x039d('0x90')][_0x039d('0x11f')](db[_0x039d('0x42')],{'through':_0x039d('0x169')});db[_0x039d('0x90')]['belongsToMany'](db['SmsInteraction'],{'through':_0x039d('0x182')});db['Tag'][_0x039d('0x11f')](db[_0x039d('0x118')],{'through':_0x039d('0x179')});db[_0x039d('0x90')][_0x039d('0x11f')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x039d('0x90')]['belongsToMany'](db[_0x039d('0xfe')],{'through':'whatsapp_interaction_has_tags'});db[_0x039d('0x196')][_0x039d('0x148')](db[_0x039d('0x1b3')],{'as':_0x039d('0x1b4'),'foreignKey':_0x039d('0x1b5')});db['CmHopperAdditionalPhone']['belongsTo'](db['CmHopper'],{'as':_0x039d('0x1b6'),'foreignKey':_0x039d('0x19f')});db['CmContactHasItem'][_0x039d('0x148')](db[_0x039d('0x156')],{'as':'Contact','foreignKey':_0x039d('0x198')});db[_0x039d('0x96')]['hasMany'](db[_0x039d('0x83')],{'as':{'plural':_0x039d('0x1b7'),'singular':_0x039d('0x1b8')},'foreignKey':_0x039d('0x1b9'),'onDelete':_0x039d('0x10e'),'hooks':!![]});db[_0x039d('0x96')][_0x039d('0x111')](db['Condition'],{'as':{'plural':_0x039d('0x1ba'),'singular':_0x039d('0x1bb')},'foreignKey':'TriggerAnyId','onDelete':_0x039d('0x10e'),'hooks':!![]});db[_0x039d('0x96')]['hasMany'](db[_0x039d('0x7b')],{'as':_0x039d('0x1a8'),'foreignKey':_0x039d('0x1bc'),'onDelete':_0x039d('0x10e'),'hooks':!![]});db[_0x039d('0x9d')][_0x039d('0x111')](db['AnalyticFieldReport'],{'as':_0x039d('0x1bd'),'onDelete':'cascade','foreignKey':_0x039d('0x1af'),'hooks':!![]});db[_0x039d('0x1ad')][_0x039d('0x111')](db['AnalyticFieldReport'],{'as':_0x039d('0x1bd'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1ae')});db[_0x039d('0xa1')][_0x039d('0x111')](db[_0x039d('0xa2')],{'as':_0x039d('0x1bd'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1be')});db[_0x039d('0xa2')][_0x039d('0x148')](db[_0x039d('0xa1')],{'foreignKey':_0x039d('0x1be')});db[_0x039d('0xa5')][_0x039d('0x111')](db[_0x039d('0xa7')],{'as':_0x039d('0x1bf'),'onDelete':'cascade','foreignKey':_0x039d('0x1c0')});db[_0x039d('0xa7')][_0x039d('0x111')](db[_0x039d('0xa9')],{'as':_0x039d('0x1c1'),'onDelete':'cascade','foreignKey':_0x039d('0x1c2')});db[_0x039d('0xa7')][_0x039d('0x111')](db[_0x039d('0xa9')],{'as':'Descriptions','onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xa7')][_0x039d('0x111')](db[_0x039d('0xa9')],{'as':_0x039d('0x1bd'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0xa7')][_0x039d('0x148')](db[_0x039d('0xa5')],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x1c0')});db['SalesforceField'][_0x039d('0x111')](db[_0x039d('0xa9')],{'as':'Subject','foreignKey':_0x039d('0x1c2')});db[_0x039d('0xa9')]['hasMany'](db[_0x039d('0xa9')],{'as':_0x039d('0x1c5'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xa9')]['hasMany'](db[_0x039d('0xa9')],{'as':_0x039d('0x1c6'),'foreignKey':_0x039d('0x1c4')});db['SalesforceField'][_0x039d('0x148')](db['Variable'],{'as':_0x039d('0x98'),'foreignKey':_0x039d('0x1c7')});db['SugarcrmAccount'][_0x039d('0x111')](db[_0x039d('0xab')],{'as':'Configurations','onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c0')});db['SugarcrmConfiguration'][_0x039d('0x111')](db[_0x039d('0xad')],{'as':_0x039d('0x1c1'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c2')});db['SugarcrmConfiguration'][_0x039d('0x111')](db[_0x039d('0xad')],{'as':_0x039d('0x1c8'),'onDelete':_0x039d('0x10e'),'foreignKey':'DescriptionId'});db[_0x039d('0xab')][_0x039d('0x111')](db[_0x039d('0xad')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x039d('0xab')][_0x039d('0x148')](db['SugarcrmAccount'],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x1c0')});db[_0x039d('0xad')][_0x039d('0x111')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0x039d('0x1c2')});db[_0x039d('0xad')][_0x039d('0x111')](db['SugarcrmField'],{'as':'Description','foreignKey':_0x039d('0x1c3')});db[_0x039d('0xad')][_0x039d('0x111')](db[_0x039d('0xad')],{'as':_0x039d('0x1c6'),'foreignKey':_0x039d('0x1c4')});db['SugarcrmField']['belongsTo'](db[_0x039d('0x98')],{'as':'Variable','foreignKey':_0x039d('0x1c7')});db[_0x039d('0xaf')]['hasMany'](db[_0x039d('0xb0')],{'as':_0x039d('0x1bf'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c0')});db[_0x039d('0xb0')][_0x039d('0x111')](db[_0x039d('0xb2')],{'as':'Subjects','onDelete':_0x039d('0x10e'),'foreignKey':'SubjectId'});db[_0x039d('0xb0')]['hasMany'](db[_0x039d('0xb2')],{'as':_0x039d('0x1c8'),'onDelete':'cascade','foreignKey':_0x039d('0x1c3')});db[_0x039d('0xb0')][_0x039d('0x111')](db[_0x039d('0xb2')],{'as':_0x039d('0x1bd'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0xb0')]['belongsTo'](db[_0x039d('0xaf')],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x1c0')});db[_0x039d('0xb0')][_0x039d('0x11f')](db['Tag'],{'through':_0x039d('0x1c9')});db[_0x039d('0xb2')][_0x039d('0x111')](db[_0x039d('0xb2')],{'as':'Subject','foreignKey':_0x039d('0x1c2')});db[_0x039d('0xb2')][_0x039d('0x111')](db[_0x039d('0xb2')],{'as':_0x039d('0x1c5'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xb2')][_0x039d('0x111')](db[_0x039d('0xb2')],{'as':_0x039d('0x1c6'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0xb2')]['belongsTo'](db[_0x039d('0x98')],{'as':_0x039d('0x98'),'foreignKey':'VariableId'});db[_0x039d('0x1ca')][_0x039d('0x111')](db['ZohoConfiguration'],{'as':_0x039d('0x1bf'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x039d('0xb5')][_0x039d('0x111')](db[_0x039d('0xb7')],{'as':_0x039d('0x1c1'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c2')});db['ZohoConfiguration'][_0x039d('0x111')](db[_0x039d('0xb7')],{'as':_0x039d('0x1c8'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xb5')][_0x039d('0x111')](db[_0x039d('0xb7')],{'as':_0x039d('0x1bd'),'onDelete':_0x039d('0x10e'),'foreignKey':'FieldId'});db[_0x039d('0xb5')][_0x039d('0x148')](db[_0x039d('0x1ca')],{'as':'Account','foreignKey':_0x039d('0x1c0')});db['ZohoField']['hasMany'](db[_0x039d('0xb7')],{'as':_0x039d('0x1cb'),'foreignKey':'SubjectId'});db['ZohoField'][_0x039d('0x111')](db[_0x039d('0xb7')],{'as':_0x039d('0x1c5'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xb7')][_0x039d('0x111')](db['ZohoField'],{'as':'Field','foreignKey':_0x039d('0x1c4')});db[_0x039d('0xb7')]['belongsTo'](db[_0x039d('0x98')],{'as':_0x039d('0x98'),'foreignKey':_0x039d('0x1c7')});db['ZendeskAccount']['hasMany'](db[_0x039d('0xba')],{'as':_0x039d('0x1bf'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c0')});db['ZendeskConfiguration']['hasMany'](db[_0x039d('0xbb')],{'as':_0x039d('0x1c1'),'foreignKey':_0x039d('0x1c2')});db[_0x039d('0xba')][_0x039d('0x111')](db[_0x039d('0xbb')],{'as':_0x039d('0x1c8'),'foreignKey':_0x039d('0x1c3')});db['ZendeskConfiguration']['hasMany'](db[_0x039d('0xbb')],{'as':_0x039d('0x1bd'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0xba')][_0x039d('0x148')](db[_0x039d('0x1cc')],{'as':_0x039d('0x167'),'foreignKey':'AccountId'});db[_0x039d('0xba')][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x1cd')});db[_0x039d('0xbb')][_0x039d('0x111')](db['ZendeskField'],{'as':_0x039d('0x1cb'),'foreignKey':'SubjectId'});db[_0x039d('0xbb')][_0x039d('0x111')](db[_0x039d('0xbb')],{'as':_0x039d('0x1c5'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xbb')][_0x039d('0x111')](db[_0x039d('0xbb')],{'as':_0x039d('0x1c6'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0xbb')][_0x039d('0x148')](db[_0x039d('0x98')],{'as':_0x039d('0x98'),'foreignKey':_0x039d('0x1c7')});db[_0x039d('0xbd')][_0x039d('0x111')](db[_0x039d('0xbe')],{'as':_0x039d('0x1bf'),'onDelete':'cascade','foreignKey':_0x039d('0x1c0')});db['FreshdeskConfiguration'][_0x039d('0x111')](db[_0x039d('0x1ce')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x039d('0x111')](db[_0x039d('0x1ce')],{'as':_0x039d('0x1c8'),'onDelete':'cascade','foreignKey':_0x039d('0x1c3')});db[_0x039d('0xbe')]['hasMany'](db[_0x039d('0x1ce')],{'as':_0x039d('0x1bd'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c4')});db['FreshdeskConfiguration']['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x039d('0xbe')][_0x039d('0x11f')](db[_0x039d('0x90')],{'through':_0x039d('0x1cf')});db[_0x039d('0x1ce')]['hasMany'](db[_0x039d('0x1ce')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x039d('0x1ce')][_0x039d('0x111')](db[_0x039d('0x1ce')],{'as':'Description','foreignKey':_0x039d('0x1c3')});db[_0x039d('0x1ce')][_0x039d('0x111')](db[_0x039d('0x1ce')],{'as':_0x039d('0x1c6'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0x1ce')][_0x039d('0x148')](db[_0x039d('0x98')],{'as':'Variable','foreignKey':'VariableId'});db[_0x039d('0xc1')][_0x039d('0x111')](db[_0x039d('0x1d0')],{'as':_0x039d('0x1bf'),'onDelete':_0x039d('0x10e'),'foreignKey':'AccountId'});db[_0x039d('0x1d0')][_0x039d('0x111')](db[_0x039d('0xc4')],{'as':_0x039d('0x1c1'),'foreignKey':_0x039d('0x1c2')});db[_0x039d('0x1d0')][_0x039d('0x111')](db[_0x039d('0xc4')],{'as':'Descriptions','foreignKey':_0x039d('0x1c3')});db[_0x039d('0x1d0')][_0x039d('0x111')](db['VtigerField'],{'as':_0x039d('0x1bd'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0x1d0')][_0x039d('0x148')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x039d('0x1c0')});db['VtigerField'][_0x039d('0x111')](db['VtigerField'],{'as':_0x039d('0x1cb'),'foreignKey':_0x039d('0x1c2')});db[_0x039d('0xc4')][_0x039d('0x111')](db[_0x039d('0xc4')],{'as':_0x039d('0x1c5'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x039d('0x111')](db[_0x039d('0xc4')],{'as':_0x039d('0x1c6'),'foreignKey':_0x039d('0x1c4')});db[_0x039d('0xc4')]['belongsTo'](db[_0x039d('0x98')],{'as':_0x039d('0x98'),'foreignKey':_0x039d('0x1c7')});db['ServicenowAccount'][_0x039d('0x111')](db['ServicenowConfiguration'],{'as':_0x039d('0x1bf'),'onDelete':'cascade','foreignKey':_0x039d('0x1c0')});db['ServicenowConfiguration'][_0x039d('0x111')](db[_0x039d('0xca')],{'as':'Subjects','foreignKey':_0x039d('0x1c2')});db[_0x039d('0xc8')][_0x039d('0x111')](db[_0x039d('0xca')],{'as':_0x039d('0x1c8'),'foreignKey':'DescriptionId'});db[_0x039d('0xc8')][_0x039d('0x111')](db[_0x039d('0xca')],{'as':'Fields','foreignKey':_0x039d('0x1c4')});db[_0x039d('0xc8')][_0x039d('0x148')](db[_0x039d('0xc6')],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x1c0')});db[_0x039d('0xca')]['hasMany'](db[_0x039d('0xca')],{'as':_0x039d('0x1cb'),'foreignKey':_0x039d('0x1c2')});db[_0x039d('0xca')][_0x039d('0x111')](db[_0x039d('0xca')],{'as':_0x039d('0x1c5'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xca')][_0x039d('0x111')](db['ServicenowField'],{'as':'Field','foreignKey':_0x039d('0x1c4')});db[_0x039d('0xca')][_0x039d('0x148')](db[_0x039d('0x98')],{'as':'Variable','foreignKey':_0x039d('0x1c7')});db[_0x039d('0xcb')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x039d('0x1bf'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c0')});db[_0x039d('0xcb')]['belongsTo'](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x039d('0x15a')});db[_0x039d('0xcd')][_0x039d('0x111')](db[_0x039d('0xcf')],{'as':_0x039d('0x1c1'),'onDelete':_0x039d('0x10e'),'foreignKey':'SubjectId'});db[_0x039d('0xcd')][_0x039d('0x111')](db[_0x039d('0xcf')],{'as':_0x039d('0x1c8'),'onDelete':'cascade','foreignKey':_0x039d('0x1c3')});db[_0x039d('0xcd')][_0x039d('0x111')](db[_0x039d('0xcf')],{'as':_0x039d('0x1bd'),'onDelete':'cascade','foreignKey':_0x039d('0x1c4')});db['Dynamics365Configuration']['belongsTo'](db[_0x039d('0xcb')],{'as':_0x039d('0x167'),'foreignKey':_0x039d('0x1c0')});db['Dynamics365Field'][_0x039d('0x111')](db[_0x039d('0xcf')],{'as':_0x039d('0x1cb'),'foreignKey':_0x039d('0x1c2')});db[_0x039d('0xcf')][_0x039d('0x111')](db[_0x039d('0xcf')],{'as':_0x039d('0x1c5'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0xcf')][_0x039d('0x111')](db[_0x039d('0xcf')],{'as':_0x039d('0x1c6'),'foreignKey':'FieldId'});db[_0x039d('0xcf')][_0x039d('0x148')](db[_0x039d('0x98')],{'as':_0x039d('0x98'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0x039d('0x111')](db[_0x039d('0x1d1')],{'as':_0x039d('0x1bf'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1c0')});db['FreshsalesConfiguration'][_0x039d('0x111')](db[_0x039d('0x1d2')],{'as':_0x039d('0x1c1'),'foreignKey':_0x039d('0x1c2')});db[_0x039d('0x1d1')]['hasMany'](db[_0x039d('0x1d2')],{'as':_0x039d('0x1c8'),'foreignKey':_0x039d('0x1c3')});db[_0x039d('0x1d1')][_0x039d('0x111')](db[_0x039d('0x1d2')],{'as':_0x039d('0x1bd'),'foreignKey':'FieldId'});db[_0x039d('0x1d1')][_0x039d('0x148')](db[_0x039d('0xd1')],{'as':_0x039d('0x167'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x039d('0x111')](db[_0x039d('0x1d2')],{'as':_0x039d('0x1cb'),'foreignKey':_0x039d('0x1c2')});db[_0x039d('0x1d2')][_0x039d('0x111')](db[_0x039d('0x1d2')],{'as':'Description','foreignKey':_0x039d('0x1c3')});db['FreshsalesField'][_0x039d('0x111')](db[_0x039d('0x1d2')],{'as':_0x039d('0x1c6'),'foreignKey':'FieldId'});db[_0x039d('0x1d2')][_0x039d('0x148')](db[_0x039d('0x98')],{'as':_0x039d('0x98'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x039d('0x148')](db['ChatWebsite'],{});db['ChatQueueReport'][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':'List','foreignKey':_0x039d('0x174')});db['ChatQueueReport']['belongsTo'](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':'ContactId'});db[_0x039d('0x1d3')][_0x039d('0x148')](db['ChatInteraction'],{});db[_0x039d('0x1d3')][_0x039d('0x148')](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db['User'],{});db[_0x039d('0x1d3')][_0x039d('0x148')](db[_0x039d('0x18e')],{});db['ChatInternalMessage'][_0x039d('0x148')](db[_0x039d('0x10c')],{'onDelete':'cascade','foreignKey':_0x039d('0x1d4')});db[_0x039d('0xd5')]['belongsTo'](db[_0x039d('0x10c')],{'onDelete':_0x039d('0x10e'),'foreignKey':'ToId'});db[_0x039d('0xda')]['hasMany'](db[_0x039d('0x1d5')],{'foreignKey':_0x039d('0x1d6'),'onDelete':_0x039d('0x10e')});db[_0x039d('0xda')]['hasMany'](db[_0x039d('0xd7')],{'foreignKey':_0x039d('0x1d6'),'onDelete':'cascade'});db[_0x039d('0x1d7')]['belongsTo'](db[_0x039d('0x17e')],{});db[_0x039d('0x1d7')][_0x039d('0x148')](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174')});db[_0x039d('0x1d7')]['belongsTo'](db[_0x039d('0x156')],{'as':'Contact','foreignKey':_0x039d('0x158')});db[_0x039d('0x1d7')][_0x039d('0x148')](db[_0x039d('0x55')],{});db[_0x039d('0x1d7')]['belongsTo'](db[_0x039d('0x57')],{});db[_0x039d('0x1d7')][_0x039d('0x148')](db['User'],{});db[_0x039d('0x1d7')]['belongsTo'](db['SmsQueue'],{});db[_0x039d('0xe0')][_0x039d('0x111')](db['JscriptySessionReport'],{'foreignKey':_0x039d('0x1d8')});db[_0x039d('0xe0')]['hasMany'](db[_0x039d('0x1d5')],{'foreignKey':_0x039d('0x1d8')});db[_0x039d('0xe0')][_0x039d('0x111')](db['JscriptyAnswerReport'],{'foreignKey':_0x039d('0x1d8')});db[_0x039d('0xe3')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x16b'),'through':_0x039d('0x13e')});db[_0x039d('0xe6')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':_0x039d('0x1d9')});db['Team'][_0x039d('0x11f')](db[_0x039d('0x1a')],{'through':'TeamVoiceQueue','as':_0x039d('0x128')});db[_0x039d('0xe6')][_0x039d('0x11f')](db[_0x039d('0x3e')],{'through':_0x039d('0x164'),'as':_0x039d('0x12a')});db['Team'][_0x039d('0x11f')](db[_0x039d('0x18e')],{'through':_0x039d('0x1da'),'as':'ChatQueues'});db[_0x039d('0xe6')][_0x039d('0x11f')](db[_0x039d('0x50')],{'through':_0x039d('0x17d'),'as':_0x039d('0x12d')});db[_0x039d('0xe6')][_0x039d('0x11f')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x039d('0x12e')});db[_0x039d('0xe6')][_0x039d('0x11f')](db[_0x039d('0x5f')],{'through':_0x039d('0x18c'),'as':_0x039d('0x12f')});db['Team']['belongsToMany'](db[_0x039d('0x104')],{'through':_0x039d('0x1db'),'as':_0x039d('0x130')});db[_0x039d('0xe6')][_0x039d('0x11f')](db[_0x039d('0xf5')],{'through':_0x039d('0x1dc'),'as':'VoicePrefixes'});db[_0x039d('0x1a1')]['hasMany'](db[_0x039d('0x71')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x039d('0x1a1')][_0x039d('0x111')](db[_0x039d('0x74')],{'as':_0x039d('0x113'),'foreignKey':_0x039d('0x1a2')});db[_0x039d('0x1a1')][_0x039d('0x111')](db[_0x039d('0x76')],{'as':_0x039d('0x145'),'foreignKey':_0x039d('0x1a2')});db[_0x039d('0x1a1')][_0x039d('0x111')](db[_0x039d('0x72')],{'as':_0x039d('0x146'),'foreignKey':'CampaignId'});db[_0x039d('0x1a1')]['belongsTo'](db[_0x039d('0x28')],{'as':_0x039d('0x28'),'foreignKey':_0x039d('0x149')});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0x039d('0x14a'),'foreignKey':_0x039d('0x1dd')});db[_0x039d('0x1a1')]['belongsTo'](db[_0x039d('0x85')],{'as':_0x039d('0x85'),'foreignKey':_0x039d('0x172')});db[_0x039d('0x1a1')][_0x039d('0x148')](db[_0x039d('0xe3')],{'as':_0x039d('0xe3'),'foreignKey':_0x039d('0x1de')});db['Campaign'][_0x039d('0x11f')](db[_0x039d('0xf3')],{'as':_0x039d('0x123'),'through':_0x039d('0x1df')});db[_0x039d('0x1a1')][_0x039d('0x11f')](db[_0x039d('0xf3')],{'as':_0x039d('0x1e0'),'through':_0x039d('0x1e1')});db[_0x039d('0x16d')][_0x039d('0x148')](db['ChatOfflineMessage'],{'as':_0x039d('0x68'),'foreignKey':_0x039d('0x171')});db[_0x039d('0xed')][_0x039d('0x148')](db[_0x039d('0x165')],{});db[_0x039d('0xed')]['belongsTo'](db[_0x039d('0x42')],{});db[_0x039d('0xed')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x039d('0x1e2'),'as':_0x039d('0x1e3')});db[_0x039d('0xed')]['belongsTo'](db[_0x039d('0x10c')],{'foreignKey':_0x039d('0x1e4'),'as':_0x039d('0x1e5')});db[_0x039d('0xed')][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':'ToUserId','as':_0x039d('0x1e6')});db[_0x039d('0xed')]['belongsTo'](db[_0x039d('0x3e')],{'foreignKey':_0x039d('0x1e7'),'as':_0x039d('0x1e8')});db[_0x039d('0xed')][_0x039d('0x148')](db[_0x039d('0x3c')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x039d('0x1e9')][_0x039d('0x148')](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db[_0x039d('0x65')],{});db[_0x039d('0x1e9')][_0x039d('0x148')](db[_0x039d('0x61')],{'foreignKey':'FromChatWebsiteId','as':_0x039d('0x1e3')});db[_0x039d('0x1e9')][_0x039d('0x148')](db['User'],{'foreignKey':_0x039d('0x1e4'),'as':_0x039d('0x1e5')});db['ChatTransferReport'][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':_0x039d('0x1ea'),'as':_0x039d('0x1e6')});db[_0x039d('0x1e9')][_0x039d('0x148')](db[_0x039d('0x18e')],{'foreignKey':_0x039d('0x1eb'),'as':_0x039d('0x1e8')});db[_0x039d('0x1e9')][_0x039d('0x148')](db[_0x039d('0x61')],{'foreignKey':_0x039d('0x1ec'),'as':_0x039d('0x1ed')});db[_0x039d('0x1ee')][_0x039d('0x148')](db['FaxMessage'],{});db['FaxTransferReport'][_0x039d('0x148')](db['FaxInteraction'],{});db[_0x039d('0x1ee')][_0x039d('0x148')](db[_0x039d('0x134')],{'foreignKey':_0x039d('0x1ef'),'as':_0x039d('0x1e3')});db[_0x039d('0x1ee')][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':'FromUserId','as':_0x039d('0x1e5')});db[_0x039d('0x1ee')][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':'ToUserId','as':_0x039d('0x1e6')});db[_0x039d('0x1ee')][_0x039d('0x148')](db[_0x039d('0x50')],{'foreignKey':_0x039d('0x1f0'),'as':_0x039d('0x1e8')});db[_0x039d('0x1ee')][_0x039d('0x148')](db[_0x039d('0x134')],{'foreignKey':_0x039d('0x1f1'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x039d('0x148')](db[_0x039d('0x187')],{});db['OpenchannelTransferReport'][_0x039d('0x148')](db[_0x039d('0x115')],{});db[_0x039d('0xf1')][_0x039d('0x148')](db[_0x039d('0x136')],{'foreignKey':_0x039d('0x1f2'),'as':_0x039d('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0x039d('0x10c')],{'foreignKey':_0x039d('0x1e4'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':'ToUserId','as':_0x039d('0x1e6')});db[_0x039d('0xf1')]['belongsTo'](db[_0x039d('0x5f')],{'foreignKey':_0x039d('0x1f3'),'as':'ToQueue'});db[_0x039d('0xf1')]['belongsTo'](db[_0x039d('0x136')],{'foreignKey':'ToOpenchannelAccountId','as':_0x039d('0x1ed')});db[_0x039d('0x1f4')]['belongsTo'](db[_0x039d('0x57')],{});db[_0x039d('0x1f4')][_0x039d('0x148')](db['SmsInteraction'],{});db[_0x039d('0x1f4')][_0x039d('0x148')](db[_0x039d('0x17e')],{'foreignKey':'FromSmsAccountId','as':_0x039d('0x1e3')});db[_0x039d('0x1f4')][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x039d('0x1f4')][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':_0x039d('0x1ea'),'as':_0x039d('0x1e6')});db['SmsTransferReport'][_0x039d('0x148')](db[_0x039d('0x58')],{'foreignKey':_0x039d('0x1f5'),'as':_0x039d('0x1e8')});db[_0x039d('0x1f4')][_0x039d('0x148')](db[_0x039d('0x17e')],{'foreignKey':'ToSmsAccountId','as':_0x039d('0x1ed')});db[_0x039d('0xf3')]['hasMany'](db[_0x039d('0x81')],{'as':_0x039d('0x15e'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x039d('0xf3')][_0x039d('0x111')](db[_0x039d('0x79')],{'as':_0x039d('0x1f6'),'foreignKey':_0x039d('0x174')});db[_0x039d('0xf3')][_0x039d('0x111')](db['CmContact'],{'as':_0x039d('0x121'),'onDelete':'cascade','foreignKey':_0x039d('0x174')});db[_0x039d('0xf3')][_0x039d('0x111')](db[_0x039d('0x74')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x039d('0xf3')]['hasMany'](db[_0x039d('0x76')],{'as':'HopperHistory','foreignKey':_0x039d('0x174')});db['CmList']['hasMany'](db[_0x039d('0x78')],{'as':_0x039d('0x78'),'foreignKey':_0x039d('0x174')});db[_0x039d('0xf3')][_0x039d('0x11f')](db[_0x039d('0x1a')],{'as':_0x039d('0x1f7'),'through':_0x039d('0x14c')});db[_0x039d('0xf3')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':'Agents','through':_0x039d('0x124')});db[_0x039d('0xf5')][_0x039d('0x111')](db[_0x039d('0x13f')],{'as':_0x039d('0x112'),'onDelete':_0x039d('0x10e')});db[_0x039d('0xf5')][_0x039d('0x11f')](db[_0x039d('0x10c')],{'as':_0x039d('0x14d'),'through':_0x039d('0x10a')});db[_0x039d('0xf5')]['belongsToMany'](db['Team'],{'through':_0x039d('0x1dc'),'as':_0x039d('0x14e')});db[_0x039d('0xf6')][_0x039d('0x111')](db[_0x039d('0x10c')],{'as':_0x039d('0x16b'),'foreignKey':_0x039d('0x11e')});db[_0x039d('0xf6')][_0x039d('0x111')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0x039d('0x11e'),'onDelete':_0x039d('0x10e')});db['UserProfileSection'][_0x039d('0x111')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x039d('0x1f8'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x13a')][_0x039d('0x111')](db[_0x039d('0x81')],{'as':_0x039d('0x15e'),'foreignKey':_0x039d('0x1f9'),'onDelete':_0x039d('0x10e')});db[_0x039d('0x13a')][_0x039d('0x111')](db[_0x039d('0x7f')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x039d('0x13a')][_0x039d('0x111')](db[_0x039d('0x100')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db['WhatsappAccount']['hasMany'](db[_0x039d('0xfe')],{'as':_0x039d('0x160')});db['WhatsappAccount']['hasMany'](db[_0x039d('0x1fa')],{'as':_0x039d('0x142')});db[_0x039d('0x13a')]['belongsTo'](db[_0x039d('0xf3')],{'as':_0x039d('0x161'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x039d('0x148')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x039d('0x163')});db['WhatsappAccount']['belongsToMany'](db[_0x039d('0x10c')],{'as':'Agents','through':_0x039d('0x13c')});db[_0x039d('0x1fa')][_0x039d('0x148')](db[_0x039d('0x10c')],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x1fa')][_0x039d('0x148')](db['WhatsappQueue'],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x1fa')][_0x039d('0x148')](db[_0x039d('0x13a')],{'onDelete':_0x039d('0x15c')});db[_0x039d('0x1fa')]['belongsTo'](db[_0x039d('0x85')],{'onDelete':_0x039d('0x15c'),'foreignKey':_0x039d('0x172')});db[_0x039d('0x1fa')][_0x039d('0x148')](db[_0x039d('0x90')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x039d('0xfe')]['hasMany'](db[_0x039d('0x100')],{'as':_0x039d('0x151'),'onDelete':_0x039d('0x10e'),'foreignKey':_0x039d('0x1fb')});db[_0x039d('0xfe')]['belongsTo'](db[_0x039d('0x13a')],{'as':_0x039d('0x167'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0x039d('0x148')](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158')});db[_0x039d('0xfe')][_0x039d('0x148')](db['User'],{'as':'Owner','foreignKey':_0x039d('0x10f')});db['WhatsappInteraction']['belongsToMany'](db[_0x039d('0x90')],{'through':'whatsapp_interaction_has_tags','as':_0x039d('0x16a')});db[_0x039d('0xfe')]['belongsToMany'](db[_0x039d('0x90')],{'through':_0x039d('0x1fc'),'as':'ThroughTags'});db[_0x039d('0xfe')]['belongsToMany'](db['User'],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x039d('0x1fb')});db[_0x039d('0x100')][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':_0x039d('0x10c')});db[_0x039d('0x100')][_0x039d('0x148')](db[_0x039d('0x156')],{'onDelete':_0x039d('0x10e'),'as':_0x039d('0x157')});db[_0x039d('0x100')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x039d('0x16f'),'foreignKey':_0x039d('0x1fb')});db['WhatsappMessage']['belongsTo'](db[_0x039d('0x13a')],{'as':'Account','foreignKey':_0x039d('0x1f9')});db[_0x039d('0x1fd')][_0x039d('0x148')](db[_0x039d('0x13a')],{});db[_0x039d('0x1fd')][_0x039d('0x148')](db['CmList'],{'as':_0x039d('0x161'),'foreignKey':_0x039d('0x174')});db['WhatsappQueueReport'][_0x039d('0x148')](db[_0x039d('0x156')],{'as':_0x039d('0x157'),'foreignKey':_0x039d('0x158')});db[_0x039d('0x1fd')][_0x039d('0x148')](db[_0x039d('0xfe')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x039d('0x104')],{});db[_0x039d('0x1fd')][_0x039d('0x148')](db[_0x039d('0x100')],{});db[_0x039d('0x1fd')]['belongsTo'](db['User'],{});db[_0x039d('0x102')]['belongsTo'](db[_0x039d('0x100')],{});db[_0x039d('0x102')][_0x039d('0x148')](db[_0x039d('0xfe')],{});db[_0x039d('0x102')]['belongsTo'](db[_0x039d('0x13a')],{'foreignKey':_0x039d('0x1fe'),'as':_0x039d('0x1e3')});db['WhatsappTransferReport'][_0x039d('0x148')](db[_0x039d('0x13a')],{'foreignKey':'ToWhatsappAccountId','as':_0x039d('0x1ed')});db['WhatsappTransferReport'][_0x039d('0x148')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x039d('0x1e8')});db[_0x039d('0x102')][_0x039d('0x148')](db[_0x039d('0x10c')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x039d('0x102')]['belongsTo'](db['User'],{'foreignKey':_0x039d('0x1ea'),'as':'ToAgent'});db[_0x039d('0x104')][_0x039d('0x11f')](db['User'],{'as':_0x039d('0x14d'),'through':'UserWhatsappQueue','foreignKey':_0x039d('0x1ff')});db[_0x039d('0x104')][_0x039d('0x11f')](db['Team'],{'through':_0x039d('0x1db'),'as':'Teams'});db[_0x039d('0x10b')][_0x039d('0x148')](db[_0x039d('0x10c')],{'as':'user','foreignKey':_0x039d('0x10f'),'onDelete':'cascade','hooks':!![]});db[_0x039d('0x106')][_0x039d('0x10d')](db['Dynamics365Account'],{'as':_0x039d('0xcb'),'onDelete':_0x039d('0x15c')});db['CloudProvider']['hasOne'](db['MailServerIn'],{'as':_0x039d('0x200'),'onDelete':'restrict'});db[_0x039d('0x106')][_0x039d('0x10d')](db[_0x039d('0x15b')],{'as':'Smtp','onDelete':_0x039d('0x15c')});module[_0x039d('0x201')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x02a3=['../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueue','ChatQueues','FaxQueue','SmsQueue','SmsQueues','UserSmsQueue','OpenchannelQueue','UserOpenchannelQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailServerIn','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','CannedAnswer','Answers','Messages','Interactions','List','ListId','TemplateId','Agents','Teams','MailInteractionId','Contact','Owner','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','IntervalId','TagId','Items','FaxAccountId','FaxInteraction','Exntensions','FaxApplication','FaxInteractionId','fax_interaction_has_tags','ThroughTags','UserFaxQueue','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CompanyId','Phones','CmContactId','JscriptySessions','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','CmHopperBlack','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','ParentId','ChatApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','SalesforceField','Descriptions','DescriptionId','Subject','Description','Field','FieldId','Variable','SugarcrmAccount','SugarcrmConfiguration','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','FromId','ToId','SessionId','ProjectId','user_has_square_projects','team_has_mail_queues','MailQueues','FaxQueues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','ToQueue','FromChatWebsiteId','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAgent','ToFaxQueueId','ToFaxAccountId','ToAccount','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','voice_queues_has_cm_lists','cm_user_has_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','lodash','jstz','determine','sequelize','xcall','127.0.0.1','name','utf8','sequelizeHistory','defaultsDeep','motion2','xC@LL1234','utf8mb4','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','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','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','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','Action','../api/action/action.model','Automation','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField'];(function(_0x3a25cc,_0x1c256d){var _0x27b28a=function(_0x2ee339){while(--_0x2ee339){_0x3a25cc['push'](_0x3a25cc['shift']());}};_0x27b28a(++_0x1c256d);}(_0x02a3,0x160));var _0x302a=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x02a3[_0x36884e];return _0x1cc367;};'use strict';var config=require(_0x302a('0x0'));var Sequelize=require('sequelize');var _=require(_0x302a('0x1'));var jstz=require(_0x302a('0x2'));var timezone=jstz[_0x302a('0x3')]();config[_0x302a('0x4')]=_['defaultsDeep'](config[_0x302a('0x4')],{'database':'motion2','username':_0x302a('0x5'),'password':'xC@LL1234','options':{'host':_0x302a('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x302a('0x7')](),'define':{'charset':_0x302a('0x8'),'collate':'utf8_general_ci'}}});config[_0x302a('0x9')]=_[_0x302a('0xa')](config['sequelizeHistory'],{'database':_0x302a('0xb'),'username':_0x302a('0x5'),'password':_0x302a('0xc'),'options':{'host':_0x302a('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x302a('0xd')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x302a('0x8'),'collate':_0x302a('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x302a('0xf')],config[_0x302a('0x4')][_0x302a('0x10')],config[_0x302a('0x4')][_0x302a('0x11')],config[_0x302a('0x4')][_0x302a('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x302a('0x9')][_0x302a('0xf')],config[_0x302a('0x9')][_0x302a('0x10')],config[_0x302a('0x9')][_0x302a('0x11')],config['sequelizeHistory'][_0x302a('0x12')])};db[_0x302a('0x13')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x15'));db[_0x302a('0x16')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x17'));db[_0x302a('0x18')]=db[_0x302a('0x4')]['import'](_0x302a('0x19'));db[_0x302a('0x1a')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0x302a('0x1b')]=db[_0x302a('0x4')]['import'](_0x302a('0x1c'));db[_0x302a('0x1d')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x1e'));db[_0x302a('0x1f')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x20'));db['ScreenRecording']=db[_0x302a('0x4')]['import']('../api/screenRecording/screenRecording.model');db[_0x302a('0x21')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x22'));db['VoiceMailMessage']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x23'));db[_0x302a('0x24')]=db[_0x302a('0x4')]['import'](_0x302a('0x25'));db[_0x302a('0x26')]=db[_0x302a('0x4')]['import'](_0x302a('0x27'));db[_0x302a('0x28')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x29'));db[_0x302a('0x2a')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x2b'));db[_0x302a('0x2c')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/memberReport/memberReport.model');db[_0x302a('0x2d')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x2e'));db[_0x302a('0x2f')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x30'));db[_0x302a('0x31')]=db[_0x302a('0x4')]['import'](_0x302a('0x32'));db[_0x302a('0x33')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x34'));db[_0x302a('0x35')]=db['sequelize'][_0x302a('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0x302a('0x36')]=db[_0x302a('0x4')]['import'](_0x302a('0x37'));db['UserFaxQueue']=db[_0x302a('0x4')]['import'](_0x302a('0x38'));db['UserSmsQueue']=db['sequelize'][_0x302a('0x14')](_0x302a('0x39'));db['UserOpenchannelQueue']=db['sequelize'][_0x302a('0x14')](_0x302a('0x3a'));db['UserWhatsappQueue']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x302a('0x3b')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x3c'));db[_0x302a('0x3d')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x3e'));db[_0x302a('0x3f')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x40'));db[_0x302a('0x41')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x42'));db[_0x302a('0x43')]=db[_0x302a('0x4')]['import'](_0x302a('0x44'));db[_0x302a('0x45')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x46'));db[_0x302a('0x47')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x48'));db[_0x302a('0x49')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x4a'));db[_0x302a('0x4b')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x4c'));db[_0x302a('0x4d')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x4e'));db[_0x302a('0x4f')]=db['sequelize']['import'](_0x302a('0x50'));db['FaxApplication']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x302a('0x51')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x52'));db['FaxQueue']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/faxQueue/faxQueue.model');db[_0x302a('0x53')]=db['sequelize'][_0x302a('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x302a('0x54')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x55'));db[_0x302a('0x56')]=db[_0x302a('0x4')]['import'](_0x302a('0x57'));db[_0x302a('0x58')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x59'));db[_0x302a('0x5a')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x5b'));db['SmsQueue']=db[_0x302a('0x4')]['import'](_0x302a('0x5c'));db[_0x302a('0x5d')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0x302a('0x5e')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x5f'));db[_0x302a('0x60')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x61'));db[_0x302a('0x62')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db['sequelize'][_0x302a('0x14')](_0x302a('0x63'));db[_0x302a('0x64')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x65'));db['OpenchannelQueueReport']=db[_0x302a('0x4')]['import'](_0x302a('0x66'));db[_0x302a('0x67')]=db[_0x302a('0x4')]['import']('../api/chatApplication/chatApplication.model');db[_0x302a('0x68')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x69'));db[_0x302a('0x6a')]=db['sequelize'][_0x302a('0x14')]('../api/chatMessage/chatMessage.model');db[_0x302a('0x6b')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x6c'));db['ChatQueue']=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db[_0x302a('0x6d')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x6e'));db['ChatProactiveAction']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x6f'));db[_0x302a('0x70')]=db[_0x302a('0x4')]['import'](_0x302a('0x71'));db[_0x302a('0x72')]=db[_0x302a('0x4')]['import']('../api/cmContact/cmContact.model');db[_0x302a('0x73')]=db['sequelize']['import'](_0x302a('0x74'));db['CmHopperBlack']=db[_0x302a('0x4')]['import'](_0x302a('0x75'));db[_0x302a('0x76')]=db[_0x302a('0x4')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x302a('0x77')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x78'));db[_0x302a('0x79')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x7a'));db[_0x302a('0x7b')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x7c'));db[_0x302a('0x7d')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x7e'));db[_0x302a('0x7f')]=db['sequelize'][_0x302a('0x14')]('../api/automation/automation.model');db['CannedAnswer']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0x302a('0x80')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x81'));db[_0x302a('0x82')]=db['sequelize'][_0x302a('0x14')]('../api/condition/condition.model');db[_0x302a('0x83')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x84'));db[_0x302a('0x85')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x86'));db[_0x302a('0x87')]=db[_0x302a('0x4')]['import'](_0x302a('0x88'));db[_0x302a('0x89')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x8a'));db[_0x302a('0x8b')]=db['sequelize']['import']('../api/schedule/schedule.model');db[_0x302a('0x8c')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/sound/sound.model');db[_0x302a('0x8d')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/tag/tag.model');db[_0x302a('0x8e')]=db[_0x302a('0x4')]['import'](_0x302a('0x8f'));db[_0x302a('0x90')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x91'));db[_0x302a('0x92')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x302a('0x93')]=db['sequelize'][_0x302a('0x14')]('../api/template/template.model');db[_0x302a('0x94')]=db['sequelize']['import'](_0x302a('0x95'));db['Variable']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x96'));db['Integration']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x97'));db[_0x302a('0x98')]=db['sequelize'][_0x302a('0x14')](_0x302a('0x99'));db['AnalyticCustomReport']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x9a'));db[_0x302a('0x9b')]=db['sequelize']['import'](_0x302a('0x9c'));db['AnalyticExtractedReport']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x9d'));db[_0x302a('0x9e')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x9f'));db['AnalyticFieldReport']=db[_0x302a('0x4')]['import'](_0x302a('0xa0'));db['AnalyticTreeReport']=db['sequelize'][_0x302a('0x14')](_0x302a('0xa1'));db[_0x302a('0xa2')]=db['sequelize'][_0x302a('0x14')](_0x302a('0xa3'));db[_0x302a('0xa4')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xa5'));db['SalesforceField']=db['sequelize'][_0x302a('0x14')](_0x302a('0xa6'));db['SugarcrmAccount']=db['sequelize'][_0x302a('0x14')](_0x302a('0xa7'));db['SugarcrmConfiguration']=db[_0x302a('0x4')]['import'](_0x302a('0xa8'));db[_0x302a('0xa9')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xaa'));db['DeskAccount']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize']['import'](_0x302a('0xab'));db[_0x302a('0xac')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xad'));db[_0x302a('0xae')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xaf'));db[_0x302a('0xb0')]=db['sequelize'][_0x302a('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x302a('0x4')]['import'](_0x302a('0xb1'));db[_0x302a('0xb2')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xb3'));db[_0x302a('0xb4')]=db['sequelize'][_0x302a('0x14')](_0x302a('0xb5'));db[_0x302a('0xb6')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xb7'));db[_0x302a('0xb8')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xb9'));db[_0x302a('0xba')]=db['sequelize'][_0x302a('0x14')](_0x302a('0xbb'));db[_0x302a('0xbc')]=db['sequelize'][_0x302a('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x302a('0xbd')]=db['sequelize'][_0x302a('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x302a('0xbe')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x302a('0xbf')]=db[_0x302a('0x4')]['import'](_0x302a('0xc0'));db[_0x302a('0xc1')]=db['sequelize'][_0x302a('0x14')](_0x302a('0xc2'));db['ServicenowConfiguration']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x302a('0xc3')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0x302a('0xc4')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xc5'));db[_0x302a('0xc6')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xc7'));db['Dynamics365Field']=db['sequelize']['import'](_0x302a('0xc8'));db['FreshsalesAccount']=db[_0x302a('0x4')]['import'](_0x302a('0xc9'));db['FreshsalesConfiguration']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x302a('0xca')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xcb'));db[_0x302a('0xcc')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x97'));db[_0x302a('0xcd')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xce'));db[_0x302a('0xcf')]=db[_0x302a('0x4')]['import'](_0x302a('0xd0'));db['ChatInternalMessage']=db[_0x302a('0x4')]['import'](_0x302a('0xd1'));db[_0x302a('0xd2')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xd3'));db[_0x302a('0xd4')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x302a('0xd5')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x302a('0xd6')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xd7'));db[_0x302a('0xd8')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xd9'));db[_0x302a('0xda')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x302a('0xdb')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xdc'));db[_0x302a('0xdd')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xde'));db[_0x302a('0xdf')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xe0'));db[_0x302a('0xe1')]=db['sequelize'][_0x302a('0x14')]('../api/squareProject/squareProject.model');db[_0x302a('0xe2')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xe3'));db['SquareMessage']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xe4'));db[_0x302a('0xe5')]=db[_0x302a('0x4')][_0x302a('0x14')]('../api/team/team.model');db['License']=db[_0x302a('0x4')]['import'](_0x302a('0xe6'));db[_0x302a('0xe7')]=db['sequelize'][_0x302a('0x14')](_0x302a('0xe8'));db[_0x302a('0xe9')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xea'));db[_0x302a('0xeb')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xec'));db[_0x302a('0xed')]=db[_0x302a('0x4')]['import'](_0x302a('0xee'));db['MailTransferReport']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xef'));db[_0x302a('0xf0')]=db['sequelize'][_0x302a('0x14')](_0x302a('0xf1'));db[_0x302a('0xf2')]=db['sequelize']['import'](_0x302a('0xf3'));db[_0x302a('0xf4')]=db['sequelize'][_0x302a('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xf5'));db[_0x302a('0xf6')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xf7'));db[_0x302a('0xf8')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xf9'));db['UserProfile']=db[_0x302a('0x4')]['import'](_0x302a('0xfa'));db[_0x302a('0xfb')]=db[_0x302a('0x4')]['import'](_0x302a('0xfc'));db[_0x302a('0xfd')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0xfe'));db[_0x302a('0xff')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x100'));db['WhatsappAccount']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x101'));db[_0x302a('0x102')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x103'));db[_0x302a('0x104')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x105'));db['WhatsappMessage']=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x106'));db[_0x302a('0x107')]=db[_0x302a('0x4')]['import'](_0x302a('0x108'));db['WhatsappTransferReport']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x302a('0x109')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x10a'));db['CloudProvider']=db['sequelize'][_0x302a('0x14')](_0x302a('0x10b'));db[_0x302a('0x10c')]=db['sequelize'][_0x302a('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x302a('0x4')][_0x302a('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x302a('0x10d')]=db[_0x302a('0x4')][_0x302a('0x14')](_0x302a('0x10e'));db[_0x302a('0x10f')]=db[_0x302a('0x4')]['import'](_0x302a('0x110'));db['User'][_0x302a('0x111')](db[_0x302a('0x21')],{'as':'VoiceMail','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x111')](db[_0x302a('0x10f')],{'as':_0x302a('0x114'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x1f')],{'as':_0x302a('0x116'),'foreignKey':'UserId'});db['User'][_0x302a('0x115')](db[_0x302a('0x31')],{'as':_0x302a('0x117'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x1a')],{'as':_0x302a('0x118'),'onDelete':_0x302a('0x112'),'hooks':!![]});db[_0x302a('0x13')]['hasMany'](db[_0x302a('0x76')],{'as':_0x302a('0x119'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x77')],{'as':_0x302a('0x11a'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x79')],{'as':_0x302a('0x79'),'foreignKey':'UserId'});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x60')],{'as':_0x302a('0x11b'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x68')],{'as':_0x302a('0x11c'),'foreignKey':'UserId'});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x58')],{'as':_0x302a('0x11d'),'foreignKey':_0x302a('0x113')});db['User'][_0x302a('0x115')](db['FaxInteraction'],{'as':_0x302a('0x11e'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x43')],{'as':_0x302a('0x11f'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db[_0x302a('0x104')],{'as':_0x302a('0x120'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x13')][_0x302a('0x115')](db['UserNotification'],{'as':_0x302a('0x121'),'foreignKey':'SenderId'});db[_0x302a('0x13')][_0x302a('0x122')](db[_0x302a('0x123')],{'as':_0x302a('0x123'),'foreignKey':_0x302a('0x124')});db['User'][_0x302a('0x125')](db[_0x302a('0x6d')],{'as':_0x302a('0x126'),'through':_0x302a('0x127')});db['User'][_0x302a('0x125')](db['CmContact'],{'as':_0x302a('0x128'),'through':'cm_user_has_contacts'});db['User'][_0x302a('0x125')](db[_0x302a('0xf6')],{'as':_0x302a('0x129'),'through':'cm_user_has_lists'});db[_0x302a('0x13')][_0x302a('0x125')](db['Team'],{'through':_0x302a('0x12a')});db['User'][_0x302a('0x125')](db[_0x302a('0x43')],{'as':_0x302a('0x11f'),'through':_0x302a('0x12b')});db['User'][_0x302a('0x125')](db[_0x302a('0x68')],{'as':_0x302a('0x11c'),'through':'user_has_chat_interactions'});db[_0x302a('0x13')][_0x302a('0x125')](db['FaxInteraction'],{'as':_0x302a('0x11e'),'through':_0x302a('0x12c')});db['User']['belongsToMany'](db[_0x302a('0x58')],{'as':'SmsInteractions','through':_0x302a('0x12d')});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x60')],{'as':_0x302a('0x11b'),'through':'user_has_openchannel_interactions'});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x104')],{'as':_0x302a('0x120'),'through':_0x302a('0x12e')});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x1d')],{'as':_0x302a('0x12f'),'through':_0x302a('0x33'),'required':![]});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0xf8')],{'as':_0x302a('0x130'),'through':_0x302a('0x10d'),'required':![]});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x3f')],{'as':'MailQueues','through':_0x302a('0x36'),'required':![]});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x131')],{'as':_0x302a('0x132'),'through':_0x302a('0x35'),'required':![],'hooks':!![]});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x133')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x302a('0x13')]['belongsToMany'](db[_0x302a('0x134')],{'as':_0x302a('0x135'),'through':_0x302a('0x136'),'required':![]});db['User'][_0x302a('0x125')](db[_0x302a('0x137')],{'as':'OpenchannelQueues','through':_0x302a('0x138'),'required':![]});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x109')],{'as':_0x302a('0x139'),'through':_0x302a('0x13a'),'required':![]});db['User'][_0x302a('0x125')](db[_0x302a('0xf6')],{'through':'cm_user_has_lists'});db[_0x302a('0x13')]['belongsToMany'](db['ChatWebsite'],{'as':_0x302a('0x13b'),'through':'user_has_chat_websites'});db['User']['belongsToMany'](db[_0x302a('0x4f')],{'as':_0x302a('0x13c'),'through':_0x302a('0x13d')});db[_0x302a('0x13')][_0x302a('0x125')](db[_0x302a('0x3d')],{'as':_0x302a('0x13e'),'through':_0x302a('0x13f')});db['User'][_0x302a('0x125')](db['OpenchannelAccount'],{'as':_0x302a('0x140'),'through':_0x302a('0x141')});db[_0x302a('0x13')]['belongsToMany'](db[_0x302a('0x54')],{'as':'SmsAccounts','through':_0x302a('0x142')});db['User'][_0x302a('0x125')](db[_0x302a('0x143')],{'as':_0x302a('0x144'),'through':_0x302a('0x145')});db[_0x302a('0x13')][_0x302a('0x125')](db['SquareProject'],{'as':_0x302a('0x146'),'through':'user_has_square_projects'});db['VoiceChanSpy'][_0x302a('0x115')](db[_0x302a('0x1a')],{'as':_0x302a('0x147'),'onDelete':'cascade','foreignKey':_0x302a('0x148')});db['VoiceContext']['hasMany'](db[_0x302a('0x1a')],{'onDelete':_0x302a('0x112')});db[_0x302a('0x1a')][_0x302a('0x115')](db[_0x302a('0x1a')],{'as':_0x302a('0x149'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db[_0x302a('0x8c')],{'as':_0x302a('0x14a'),'through':_0x302a('0x14b')});db[_0x302a('0x1d')][_0x302a('0x115')](db[_0x302a('0x31')],{'as':_0x302a('0x14c'),'foreignKey':_0x302a('0x14d')});db[_0x302a('0x1d')]['hasMany'](db[_0x302a('0x73')],{'as':_0x302a('0x14e'),'foreignKey':'VoiceQueueId'});db[_0x302a('0x1d')][_0x302a('0x115')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x302a('0x14d')});db[_0x302a('0x1d')][_0x302a('0x115')](db[_0x302a('0x77')],{'as':_0x302a('0x14f'),'foreignKey':_0x302a('0x14d')});db['VoiceQueue'][_0x302a('0x115')](db['ReportAgentPreview'],{'as':_0x302a('0x79'),'foreignKey':_0x302a('0x14d')});db[_0x302a('0x1d')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x302a('0x14d')});db[_0x302a('0x1d')][_0x302a('0x115')](db[_0x302a('0xd5')],{'as':'JscriptySessions','foreignKey':_0x302a('0x14d')});db[_0x302a('0x1d')][_0x302a('0x122')](db[_0x302a('0x2d')],{'as':_0x302a('0x2d'),'foreignKey':_0x302a('0x150')});db[_0x302a('0x1d')][_0x302a('0x122')](db['Trunk'],{'as':_0x302a('0x151'),'foreignKey':_0x302a('0x152')});db[_0x302a('0x1d')]['belongsTo'](db[_0x302a('0x83')],{'as':_0x302a('0x83'),'foreignKey':'IntervalId'});db[_0x302a('0x1d')]['belongsTo'](db[_0x302a('0x85')],{'as':_0x302a('0x153'),'foreignKey':_0x302a('0x154')});db[_0x302a('0x1d')][_0x302a('0x125')](db[_0x302a('0xf6')],{'as':_0x302a('0x129'),'through':'voice_queues_has_cm_lists'});db[_0x302a('0x1d')][_0x302a('0x125')](db['User'],{'as':'Agents','through':_0x302a('0x33')});db[_0x302a('0x1d')][_0x302a('0x125')](db[_0x302a('0xe5')],{'as':'Teams','through':_0x302a('0x10c')});db[_0x302a('0x1d')][_0x302a('0x125')](db[_0x302a('0xf6')],{'as':'BlackLists','through':_0x302a('0x155')});db[_0x302a('0x1f')][_0x302a('0x122')](db[_0x302a('0x13')],{'as':_0x302a('0x13'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x156')][_0x302a('0x122')](db['User'],{'as':_0x302a('0x13'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x21')][_0x302a('0x115')](db[_0x302a('0x157')],{'as':'Messages','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x158'),'sourceKey':_0x302a('0x159')});db['VoiceMailMessage'][_0x302a('0x122')](db['VoiceMail'],{'foreignKey':_0x302a('0x158'),'targetKey':_0x302a('0x159')});db['VoiceCallReport'][_0x302a('0x115')](db[_0x302a('0x2a')],{'as':_0x302a('0x15a'),'foreignKey':_0x302a('0x15b'),'constraints':![]});db[_0x302a('0x24')][_0x302a('0x115')](db[_0x302a('0x28')],{'as':_0x302a('0x15c'),'foreignKey':'uniqueid','constraints':![]});db[_0x302a('0x24')][_0x302a('0x122')](db[_0x302a('0x13')],{'as':'User','foreignKey':_0x302a('0x113')});db[_0x302a('0x24')][_0x302a('0x122')](db[_0x302a('0x72')],{'as':'Contact','foreignKey':_0x302a('0x15d')});db[_0x302a('0x15e')][_0x302a('0x122')](db[_0x302a('0x3d')],{'as':_0x302a('0x3d'),'foreignKey':_0x302a('0x15f')});db[_0x302a('0x15e')][_0x302a('0x122')](db[_0x302a('0x160')],{'as':_0x302a('0x160'),'foreignKey':_0x302a('0x161'),'onDelete':_0x302a('0x162')});db[_0x302a('0x3b')][_0x302a('0x122')](db['MailAccount'],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x302a('0x3b')]['belongsTo'](db[_0x302a('0x160')],{'as':_0x302a('0x160'),'foreignKey':_0x302a('0x161'),'onDelete':_0x302a('0x162')});db[_0x302a('0x3d')][_0x302a('0x111')](db[_0x302a('0x15e')],{'as':_0x302a('0x163'),'onDelete':'cascade'});db[_0x302a('0x3d')][_0x302a('0x111')](db['MailServerOut'],{'as':_0x302a('0x164'),'onDelete':_0x302a('0x112')});db[_0x302a('0x3d')][_0x302a('0x115')](db['Disposition'],{'as':_0x302a('0x165'),'foreignKey':_0x302a('0x15f'),'onDelete':_0x302a('0x112')});db[_0x302a('0x3d')][_0x302a('0x115')](db[_0x302a('0x166')],{'as':_0x302a('0x167'),'foreignKey':'MailAccountId'});db[_0x302a('0x3d')]['hasMany'](db['MailMessage'],{'as':_0x302a('0x168'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x302a('0x115')](db['MailInteraction'],{'as':_0x302a('0x169')});db[_0x302a('0x3d')]['hasMany'](db[_0x302a('0x47')],{'as':'Applications'});db['MailAccount']['belongsTo'](db['CmList'],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0x3d')]['belongsTo'](db['Template'],{'as':'Template','foreignKey':_0x302a('0x16c')});db[_0x302a('0x3d')]['belongsTo'](db[_0x302a('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0x302a('0x154')});db[_0x302a('0x3d')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x13f')});db[_0x302a('0x3f')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':'Agents','through':_0x302a('0x36')});db[_0x302a('0x3f')][_0x302a('0x125')](db[_0x302a('0xe5')],{'through':'team_has_mail_queues','as':_0x302a('0x16e')});db[_0x302a('0x43')]['hasMany'](db[_0x302a('0x45')],{'as':'Messages','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x16f')});db[_0x302a('0x43')][_0x302a('0x122')](db[_0x302a('0x3d')],{'as':'Account','foreignKey':_0x302a('0x15f')});db[_0x302a('0x43')][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0x43')][_0x302a('0x122')](db['User'],{'as':_0x302a('0x171'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x43')]['belongsToMany'](db[_0x302a('0x8d')],{'through':_0x302a('0x172'),'as':_0x302a('0x173')});db[_0x302a('0x43')][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':_0x302a('0x172'),'as':'ThroughTags'});db[_0x302a('0x43')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x174'),'through':_0x302a('0x12b'),'foreignKey':_0x302a('0x16f')});db[_0x302a('0x45')][_0x302a('0x115')](db[_0x302a('0xeb')],{'as':_0x302a('0x175'),'onDelete':_0x302a('0x112')});db[_0x302a('0x45')][_0x302a('0x122')](db[_0x302a('0x13')],{'as':'User'});db[_0x302a('0x45')][_0x302a('0x122')](db[_0x302a('0x72')],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x170')});db[_0x302a('0x45')]['belongsTo'](db[_0x302a('0x43')],{'as':_0x302a('0x176'),'foreignKey':'MailInteractionId'});db[_0x302a('0x45')][_0x302a('0x122')](db[_0x302a('0x3d')],{'as':_0x302a('0x177'),'foreignKey':'MailAccountId'});db['MailMessage']['belongsTo'](db[_0x302a('0x64')],{'as':_0x302a('0x64'),'foreignKey':_0x302a('0x178')});db['MailMessage']['belongsTo'](db[_0x302a('0x6b')],{'as':_0x302a('0x6b'),'foreignKey':_0x302a('0x179')});db[_0x302a('0x47')][_0x302a('0x122')](db['User'],{'onDelete':'restrict'});db[_0x302a('0x47')]['belongsTo'](db[_0x302a('0x3f')],{'onDelete':_0x302a('0x162')});db[_0x302a('0x47')][_0x302a('0x122')](db[_0x302a('0x3d')],{'onDelete':_0x302a('0x162')});db['MailApplication']['belongsTo'](db[_0x302a('0x83')],{'onDelete':_0x302a('0x162'),'foreignKey':_0x302a('0x17a')});db['MailApplication']['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x302a('0x17b')});db[_0x302a('0x49')][_0x302a('0x122')](db[_0x302a('0x3d')],{});db['MailQueueReport'][_0x302a('0x122')](db['CmList'],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db['MailQueueReport'][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db['MailQueueReport']['belongsTo'](db[_0x302a('0x43')],{});db['MailQueueReport'][_0x302a('0x122')](db[_0x302a('0x45')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db[_0x302a('0x49')][_0x302a('0x122')](db[_0x302a('0x3f')],{});db[_0x302a('0x4b')]['hasMany'](db[_0x302a('0x4d')],{'as':_0x302a('0x17c'),'onDelete':_0x302a('0x112')});db[_0x302a('0x4f')][_0x302a('0x115')](db['Disposition'],{'as':_0x302a('0x165'),'foreignKey':_0x302a('0x17d'),'onDelete':_0x302a('0x112')});db[_0x302a('0x4f')]['hasMany'](db[_0x302a('0x166')],{'as':_0x302a('0x167'),'foreignKey':'FaxAccountId'});db[_0x302a('0x4f')][_0x302a('0x115')](db[_0x302a('0x17e')],{'as':_0x302a('0x169')});db[_0x302a('0x4f')][_0x302a('0x115')](db['FaxApplication'],{'as':_0x302a('0x149')});db[_0x302a('0x4f')][_0x302a('0x115')](db[_0x302a('0x1a')],{'as':_0x302a('0x17f'),'onDelete':'cascade'});db[_0x302a('0x4f')][_0x302a('0x115')](db[_0x302a('0x51')],{'as':_0x302a('0x168')});db[_0x302a('0x4f')][_0x302a('0x122')](db['Trunk'],{'as':_0x302a('0x2d')});db[_0x302a('0x4f')][_0x302a('0x122')](db[_0x302a('0xf6')],{'as':_0x302a('0x16a'),'foreignKey':'ListId'});db['FaxAccount'][_0x302a('0x122')](db[_0x302a('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0x302a('0x154')});db[_0x302a('0x4f')][_0x302a('0x125')](db['User'],{'as':'Agents','through':_0x302a('0x13d')});db[_0x302a('0x180')][_0x302a('0x122')](db['User'],{'onDelete':'restrict'});db[_0x302a('0x180')]['belongsTo'](db[_0x302a('0x133')],{'onDelete':_0x302a('0x162')});db[_0x302a('0x180')][_0x302a('0x122')](db[_0x302a('0x4f')],{'onDelete':_0x302a('0x162')});db[_0x302a('0x180')][_0x302a('0x122')](db[_0x302a('0x8d')],{'onDelete':_0x302a('0x162'),'foreignKey':'TagId'});db['FaxInteraction'][_0x302a('0x115')](db[_0x302a('0x51')],{'as':_0x302a('0x168'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x181')});db[_0x302a('0x17e')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x302a('0x17d')});db[_0x302a('0x17e')][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db['FaxInteraction'][_0x302a('0x122')](db[_0x302a('0x13')],{'as':_0x302a('0x171'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x17e')][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':_0x302a('0x182'),'as':_0x302a('0x173')});db[_0x302a('0x17e')][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':_0x302a('0x182'),'as':_0x302a('0x183')});db[_0x302a('0x17e')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x174'),'through':_0x302a('0x12c'),'foreignKey':_0x302a('0x181')});db[_0x302a('0x51')][_0x302a('0x122')](db[_0x302a('0x13')],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x13')});db[_0x302a('0x51')][_0x302a('0x122')](db[_0x302a('0x17e')],{'as':_0x302a('0x176'),'foreignKey':_0x302a('0x181')});db[_0x302a('0x51')][_0x302a('0x122')](db[_0x302a('0x72')],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x170')});db['FaxMessage'][_0x302a('0x122')](db['Attachment'],{'as':_0x302a('0xeb'),'foreignKey':'AttachmentId'});db[_0x302a('0x51')][_0x302a('0x122')](db[_0x302a('0x4f')],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x17d')});db['FaxQueue'][_0x302a('0x125')](db[_0x302a('0x13')],{'as':'Agents','through':_0x302a('0x184')});db['FaxQueue'][_0x302a('0x125')](db['Team'],{'through':'team_has_fax_queues','as':_0x302a('0x16e')});db[_0x302a('0x53')][_0x302a('0x122')](db[_0x302a('0x4f')],{});db[_0x302a('0x53')][_0x302a('0x122')](db['CmList'],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0x53')]['belongsTo'](db[_0x302a('0x72')],{'as':'Contact','foreignKey':_0x302a('0x15d')});db[_0x302a('0x53')][_0x302a('0x122')](db[_0x302a('0x17e')],{});db[_0x302a('0x53')][_0x302a('0x122')](db['FaxMessage'],{});db['FaxQueueReport'][_0x302a('0x122')](db[_0x302a('0x13')],{});db[_0x302a('0x53')]['belongsTo'](db[_0x302a('0x133')],{});db['SmsAccount']['hasMany'](db[_0x302a('0x80')],{'as':_0x302a('0x165'),'foreignKey':_0x302a('0x185'),'onDelete':_0x302a('0x112')});db[_0x302a('0x54')][_0x302a('0x115')](db[_0x302a('0x166')],{'as':_0x302a('0x167'),'foreignKey':_0x302a('0x185')});db[_0x302a('0x54')][_0x302a('0x115')](db[_0x302a('0x5a')],{'as':_0x302a('0x168'),'foreignKey':_0x302a('0x185')});db['SmsAccount'][_0x302a('0x115')](db[_0x302a('0x58')],{'as':_0x302a('0x169')});db[_0x302a('0x54')][_0x302a('0x115')](db[_0x302a('0x56')],{'as':_0x302a('0x149')});db[_0x302a('0x54')]['belongsTo'](db[_0x302a('0xf6')],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0x54')][_0x302a('0x122')](db[_0x302a('0x85')],{'as':_0x302a('0x153'),'foreignKey':_0x302a('0x154')});db['SmsAccount']['belongsToMany'](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':'user_has_sms_accounts'});db[_0x302a('0x56')]['belongsTo'](db[_0x302a('0x13')],{'onDelete':_0x302a('0x162')});db[_0x302a('0x56')][_0x302a('0x122')](db[_0x302a('0x134')],{'onDelete':'restrict'});db[_0x302a('0x56')][_0x302a('0x122')](db[_0x302a('0x54')],{'onDelete':_0x302a('0x162')});db[_0x302a('0x56')][_0x302a('0x122')](db['Interval'],{'onDelete':_0x302a('0x162'),'foreignKey':_0x302a('0x17a')});db[_0x302a('0x56')][_0x302a('0x122')](db[_0x302a('0x8d')],{'onDelete':'restrict','foreignKey':_0x302a('0x17b')});db[_0x302a('0x58')][_0x302a('0x115')](db[_0x302a('0x5a')],{'as':_0x302a('0x168'),'onDelete':'cascade','foreignKey':_0x302a('0x186')});db[_0x302a('0x58')]['belongsTo'](db[_0x302a('0x54')],{'as':_0x302a('0x177'),'foreignKey':'SmsAccountId'});db[_0x302a('0x58')][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':'ContactId'});db['SmsInteraction'][_0x302a('0x122')](db[_0x302a('0x13')],{'as':_0x302a('0x171'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x58')][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':_0x302a('0x187'),'as':'Tags'});db[_0x302a('0x58')][_0x302a('0x125')](db['Tag'],{'through':_0x302a('0x187'),'as':'ThroughTags'});db[_0x302a('0x58')]['belongsToMany'](db[_0x302a('0x13')],{'as':_0x302a('0x174'),'through':_0x302a('0x12d'),'foreignKey':_0x302a('0x186')});db[_0x302a('0x5a')]['belongsTo'](db[_0x302a('0x13')],{'as':_0x302a('0x13')});db[_0x302a('0x5a')][_0x302a('0x122')](db[_0x302a('0x72')],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x170')});db[_0x302a('0x5a')][_0x302a('0x122')](db['SmsInteraction'],{'onDelete':_0x302a('0x112'),'as':'Interaction','foreignKey':_0x302a('0x186')});db[_0x302a('0x5a')][_0x302a('0x122')](db[_0x302a('0x54')],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x185')});db[_0x302a('0x134')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':'UserSmsQueue','foreignKey':_0x302a('0x188')});db[_0x302a('0x134')][_0x302a('0x125')](db[_0x302a('0xe5')],{'through':_0x302a('0x189'),'as':_0x302a('0x16e')});db[_0x302a('0x5d')][_0x302a('0x115')](db[_0x302a('0x80')],{'as':_0x302a('0x165'),'foreignKey':_0x302a('0x18a'),'onDelete':_0x302a('0x112')});db[_0x302a('0x5d')][_0x302a('0x115')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x302a('0x18a')});db[_0x302a('0x5d')][_0x302a('0x115')](db['OpenchannelInteraction'],{'as':_0x302a('0x169'),'foreignKey':_0x302a('0x18a')});db['OpenchannelAccount'][_0x302a('0x115')](db[_0x302a('0x62')],{'as':'Messages','foreignKey':_0x302a('0x18a')});db[_0x302a('0x5d')][_0x302a('0x115')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x302a('0x18a')});db[_0x302a('0x5d')][_0x302a('0x122')](db['CmList'],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db['OpenchannelAccount'][_0x302a('0x122')](db[_0x302a('0x85')],{'as':_0x302a('0x153'),'foreignKey':_0x302a('0x154')});db['OpenchannelAccount'][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x141')});db[_0x302a('0x5e')][_0x302a('0x122')](db[_0x302a('0x13')],{'onDelete':'restrict'});db[_0x302a('0x5e')]['belongsTo'](db[_0x302a('0x137')],{'onDelete':'restrict','foreignKey':_0x302a('0x18b')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x302a('0x18a')});db[_0x302a('0x5e')][_0x302a('0x122')](db[_0x302a('0x83')],{'onDelete':_0x302a('0x162'),'foreignKey':'IntervalId'});db[_0x302a('0x5e')][_0x302a('0x122')](db[_0x302a('0x8d')],{'onDelete':_0x302a('0x162'),'foreignKey':_0x302a('0x17b')});db['OpenchannelInteraction'][_0x302a('0x115')](db[_0x302a('0x62')],{'as':_0x302a('0x168'),'onDelete':'cascade','foreignKey':_0x302a('0x18c')});db[_0x302a('0x60')][_0x302a('0x122')](db[_0x302a('0x5d')],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x18a')});db['OpenchannelInteraction'][_0x302a('0x122')](db['CmContact'],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db['OpenchannelInteraction'][_0x302a('0x122')](db[_0x302a('0x13')],{'as':_0x302a('0x171'),'foreignKey':'UserId'});db[_0x302a('0x60')][_0x302a('0x125')](db['Tag'],{'through':_0x302a('0x18d'),'as':_0x302a('0x173')});db['OpenchannelInteraction']['belongsToMany'](db[_0x302a('0x8d')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0x302a('0x60')][_0x302a('0x125')](db['User'],{'as':_0x302a('0x174'),'through':_0x302a('0x18e'),'foreignKey':_0x302a('0x18c')});db[_0x302a('0x62')]['belongsTo'](db[_0x302a('0x13')],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x13')});db[_0x302a('0x62')]['belongsTo'](db[_0x302a('0x72')],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x170')});db[_0x302a('0x62')][_0x302a('0x122')](db['OpenchannelInteraction'],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x176'),'foreignKey':_0x302a('0x18c')});db[_0x302a('0x62')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0x302a('0x18f')});db[_0x302a('0x62')][_0x302a('0x122')](db['OpenchannelAccount'],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x18a')});db[_0x302a('0x137')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x138'),'foreignKey':_0x302a('0x18b')});db['OpenchannelQueue']['belongsToMany'](db[_0x302a('0xe5')],{'through':_0x302a('0x190'),'as':_0x302a('0x16e')});db[_0x302a('0x64')][_0x302a('0x115')](db[_0x302a('0x80')],{'as':_0x302a('0x165'),'foreignKey':'ChatWebsiteId','onDelete':_0x302a('0x112')});db[_0x302a('0x64')][_0x302a('0x115')](db[_0x302a('0x166')],{'as':_0x302a('0x167'),'foreignKey':_0x302a('0x178')});db[_0x302a('0x64')][_0x302a('0x115')](db[_0x302a('0x191')],{'as':_0x302a('0x192')});db['ChatWebsite'][_0x302a('0x115')](db[_0x302a('0x68')],{'as':_0x302a('0x169')});db[_0x302a('0x64')]['hasMany'](db[_0x302a('0x67')],{'as':'Applications'});db[_0x302a('0x64')][_0x302a('0x115')](db[_0x302a('0x6a')],{'as':'Messages'});db['ChatWebsite'][_0x302a('0x122')](db['CmList'],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0x64')][_0x302a('0x122')](db[_0x302a('0x83')],{'as':_0x302a('0x83'),'foreignKey':_0x302a('0x17a')});db['ChatWebsite'][_0x302a('0x122')](db['MailAccount'],{'as':_0x302a('0x3d'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0x302a('0x122')](db[_0x302a('0x85')],{'as':_0x302a('0x153'),'foreignKey':_0x302a('0x154')});db['ChatWebsite']['belongsToMany'](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x193')});db[_0x302a('0x194')]['belongsTo'](db[_0x302a('0x5d')],{});db[_0x302a('0x194')][_0x302a('0x122')](db[_0x302a('0xf6')],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0x194')]['belongsTo'](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0x194')]['belongsTo'](db[_0x302a('0x60')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelMessage'],{});db[_0x302a('0x194')]['belongsTo'](db[_0x302a('0x13')],{});db[_0x302a('0x194')][_0x302a('0x122')](db[_0x302a('0x137')],{});db['ChatApplication'][_0x302a('0x122')](db[_0x302a('0x13')],{'as':_0x302a('0x195'),'foreignKey':_0x302a('0x113'),'onDelete':_0x302a('0x162')});db[_0x302a('0x67')][_0x302a('0x122')](db[_0x302a('0x131')],{'as':_0x302a('0x196'),'foreignKey':_0x302a('0x197'),'onDelete':_0x302a('0x162')});db[_0x302a('0x67')]['belongsTo'](db[_0x302a('0x64')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x302a('0x67')][_0x302a('0x122')](db[_0x302a('0x8d')],{'onDelete':_0x302a('0x162'),'foreignKey':_0x302a('0x17b')});db[_0x302a('0x68')][_0x302a('0x115')](db[_0x302a('0x6a')],{'as':_0x302a('0x168'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x198')});db['ChatInteraction']['belongsTo'](db[_0x302a('0x64')],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x178')});db[_0x302a('0x68')][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':'ContactId'});db[_0x302a('0x68')][_0x302a('0x122')](db['User'],{'as':_0x302a('0x171'),'foreignKey':'UserId'});db[_0x302a('0x68')]['belongsToMany'](db['Tag'],{'through':_0x302a('0x199'),'as':_0x302a('0x173')});db[_0x302a('0x68')]['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x302a('0x183')});db[_0x302a('0x68')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':'Users','through':_0x302a('0x19a'),'foreignKey':_0x302a('0x198')});db['ChatMessage'][_0x302a('0x122')](db[_0x302a('0x13')],{'onDelete':'cascade','as':_0x302a('0x13')});db[_0x302a('0x6a')][_0x302a('0x122')](db['CmContact'],{'onDelete':_0x302a('0x112'),'as':'Contact','foreignKey':'ContactId'});db[_0x302a('0x6a')]['belongsTo'](db[_0x302a('0x68')],{'onDelete':_0x302a('0x112'),'as':'Interaction','foreignKey':_0x302a('0x198')});db[_0x302a('0x6a')][_0x302a('0x122')](db['Attachment'],{'as':'Attachment','foreignKey':_0x302a('0x18f')});db[_0x302a('0x6a')][_0x302a('0x122')](db['ChatWebsite'],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x178')});db[_0x302a('0x6b')]['hasMany'](db['Attachment'],{'as':'Attachments','foreignKey':_0x302a('0x179'),'onDelete':_0x302a('0x112'),'hooks':!![]});db[_0x302a('0x6b')][_0x302a('0x122')](db['CmContact'],{'onDelete':_0x302a('0x112'),'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db['ChatOfflineMessage'][_0x302a('0x122')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x302a('0x131')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x35'),'hooks':!![]});db[_0x302a('0x131')][_0x302a('0x125')](db['Team'],{'through':_0x302a('0x19b'),'as':'Teams'});db['ChatGroup']['hasMany'](db[_0x302a('0x19c')],{'as':_0x302a('0x168'),'foreignKey':_0x302a('0x19d'),'onDelete':_0x302a('0x112')});db['ChatGroup'][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x14c'),'through':_0x302a('0x127')});db[_0x302a('0x191')][_0x302a('0x122')](db['ChatWebsite'],{'as':_0x302a('0x19e'),'foreignKey':_0x302a('0x178')});db[_0x302a('0x70')]['hasMany'](db[_0x302a('0x72')],{'as':_0x302a('0x128'),'foreignKey':_0x302a('0x19f')});db[_0x302a('0x72')]['hasMany'](db[_0x302a('0x90')],{'as':_0x302a('0x1a0'),'foreignKey':_0x302a('0x1a1')});db[_0x302a('0x72')][_0x302a('0x115')](db[_0x302a('0x73')],{'as':_0x302a('0x14e'),'foreignKey':'ContactId'});db[_0x302a('0x72')][_0x302a('0x115')](db[_0x302a('0x76')],{'as':'HopperFinals','foreignKey':_0x302a('0x15d')});db[_0x302a('0x72')][_0x302a('0x115')](db['CmHopperHistory'],{'as':_0x302a('0x14f'),'foreignKey':_0x302a('0x15d')});db['CmContact'][_0x302a('0x115')](db[_0x302a('0x79')],{'as':_0x302a('0x79'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0x72')][_0x302a('0x115')](db['JscriptySessionReport'],{'as':_0x302a('0x1a2'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0x72')][_0x302a('0x115')](db[_0x302a('0x60')],{'as':_0x302a('0x11b'),'foreignKey':_0x302a('0x15d'),'onDelete':_0x302a('0x162')});db[_0x302a('0x72')][_0x302a('0x115')](db[_0x302a('0x68')],{'as':_0x302a('0x11c'),'foreignKey':_0x302a('0x15d'),'onDelete':_0x302a('0x162')});db[_0x302a('0x72')][_0x302a('0x115')](db[_0x302a('0x58')],{'as':_0x302a('0x11d'),'foreignKey':_0x302a('0x15d'),'onDelete':_0x302a('0x162')});db[_0x302a('0x72')]['hasMany'](db[_0x302a('0x17e')],{'as':_0x302a('0x11e'),'foreignKey':'ContactId','onDelete':_0x302a('0x162')});db['CmContact'][_0x302a('0x115')](db[_0x302a('0x43')],{'as':_0x302a('0x11f'),'foreignKey':_0x302a('0x15d'),'onDelete':'restrict'});db['CmContact'][_0x302a('0x122')](db[_0x302a('0x70')],{'as':_0x302a('0x1a3'),'foreignKey':_0x302a('0x19f')});db[_0x302a('0x72')][_0x302a('0x122')](db[_0x302a('0xf6')],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b'),'onDelete':_0x302a('0x112')});db[_0x302a('0x72')][_0x302a('0x125')](db['User'],{'as':'Users','through':_0x302a('0x1a4')});db['CmContact'][_0x302a('0x125')](db[_0x302a('0x8d')],{'as':_0x302a('0x173'),'through':_0x302a('0x1a5')});db[_0x302a('0x72')][_0x302a('0x125')](db['Tag'],{'through':_0x302a('0x1a5'),'as':'ThroughTags'});db[_0x302a('0x73')][_0x302a('0x115')](db['CmHopperAdditionalPhone'],{'as':_0x302a('0x1a6'),'foreignKey':_0x302a('0x1a7')});db[_0x302a('0x73')][_0x302a('0x122')](db['CmContact'],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d'),'onDelete':_0x302a('0x112')});db[_0x302a('0x73')][_0x302a('0x122')](db['CmList'],{'as':'List','foreignKey':_0x302a('0x16b'),'onDelete':_0x302a('0x112')});db[_0x302a('0x73')][_0x302a('0x122')](db[_0x302a('0x13')],{'as':_0x302a('0x195'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x73')]['belongsTo'](db[_0x302a('0x1d')],{'as':_0x302a('0x196'),'foreignKey':_0x302a('0x14d'),'onDelete':'cascade'});db[_0x302a('0x73')][_0x302a('0x122')](db[_0x302a('0xe7')],{'as':'Campaign','foreignKey':_0x302a('0x1a8'),'onDelete':_0x302a('0x112')});db[_0x302a('0x73')]['belongsTo'](db[_0x302a('0x13')],{'as':_0x302a('0x171'),'foreignKey':_0x302a('0x1a9')});db['CmHopperBlack'][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d'),'onDelete':_0x302a('0x112')});db[_0x302a('0x1aa')]['belongsTo'](db[_0x302a('0xf6')],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b'),'onDelete':'cascade'});db[_0x302a('0x1aa')][_0x302a('0x122')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x302a('0x14d'),'onDelete':_0x302a('0x112')});db[_0x302a('0x1aa')][_0x302a('0x122')](db['Campaign'],{'as':'Campaign','foreignKey':_0x302a('0x1a8'),'onDelete':'cascade'});db[_0x302a('0x7f')]['hasMany'](db[_0x302a('0x82')],{'as':{'plural':_0x302a('0x1ab'),'singular':_0x302a('0x1ac')},'foreignKey':_0x302a('0x1ad'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x302a('0x115')](db['Condition'],{'as':{'plural':_0x302a('0x1ae'),'singular':'OneAny'},'foreignKey':_0x302a('0x1af'),'onDelete':_0x302a('0x112'),'hooks':!![]});db[_0x302a('0x7f')][_0x302a('0x115')](db[_0x302a('0x7d')],{'as':_0x302a('0x1b0'),'foreignKey':'AutomationId','onDelete':_0x302a('0x112'),'hooks':!![]});db[_0x302a('0x80')][_0x302a('0x115')](db[_0x302a('0x80')],{'as':_0x302a('0x165'),'foreignKey':_0x302a('0x1b1'),'onDelete':_0x302a('0x112')});db[_0x302a('0x83')][_0x302a('0x115')](db['Interval'],{'as':'Intervals','foreignKey':_0x302a('0x17a'),'onDelete':_0x302a('0x112'),'hooks':!![],'required':![]});db[_0x302a('0x83')][_0x302a('0x115')](db[_0x302a('0x1a')],{'as':_0x302a('0x118'),'foreignKey':'IntervalId','onDelete':_0x302a('0x162')});db[_0x302a('0x83')][_0x302a('0x115')](db[_0x302a('0x47')],{'as':'MailApplications','foreignKey':'IntervalId'});db['Interval'][_0x302a('0x115')](db[_0x302a('0x67')],{'as':_0x302a('0x1b2'),'foreignKey':_0x302a('0x17a')});db[_0x302a('0x83')][_0x302a('0x115')](db[_0x302a('0x180')],{'as':'FaxApplications','foreignKey':'IntervalId'});db['Interval'][_0x302a('0x115')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x302a('0x8b')][_0x302a('0x122')](db[_0x302a('0x3d')],{});db['Schedule'][_0x302a('0x122')](db[_0x302a('0x9b')],{'foreignKey':_0x302a('0x1b3')});db['Schedule'][_0x302a('0x122')](db[_0x302a('0x1b4')],{'foreignKey':_0x302a('0x1b5')});db[_0x302a('0x8c')][_0x302a('0x125')](db[_0x302a('0x1b')],{'as':_0x302a('0x1b6'),'through':_0x302a('0x14b'),'onDelete':_0x302a('0x162')});db['Tag'][_0x302a('0x125')](db['CmContact'],{'through':_0x302a('0x1a5')});db[_0x302a('0x8d')][_0x302a('0x125')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0x302a('0x8d')][_0x302a('0x125')](db['MailInteraction'],{'through':_0x302a('0x172')});db[_0x302a('0x8d')]['belongsToMany'](db[_0x302a('0x58')],{'through':_0x302a('0x187')});db[_0x302a('0x8d')][_0x302a('0x125')](db[_0x302a('0x17e')],{'through':'fax_interaction_has_tags'});db['Tag'][_0x302a('0x125')](db[_0x302a('0x60')],{'through':_0x302a('0x18d')});db[_0x302a('0x8d')][_0x302a('0x125')](db[_0x302a('0x104')],{'through':_0x302a('0x1b7')});db[_0x302a('0x90')]['belongsTo'](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x302a('0x1b8')});db[_0x302a('0x92')]['belongsTo'](db[_0x302a('0x73')],{'as':'Hopper','foreignKey':_0x302a('0x1a7')});db['CmContactHasItem']['belongsTo'](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x1a1')});db[_0x302a('0x94')]['hasMany'](db[_0x302a('0x82')],{'as':{'plural':_0x302a('0x1b9'),'singular':'AllCondition'},'foreignKey':_0x302a('0x1ba'),'onDelete':_0x302a('0x112'),'hooks':!![]});db[_0x302a('0x94')][_0x302a('0x115')](db[_0x302a('0x82')],{'as':{'plural':_0x302a('0x1bb'),'singular':_0x302a('0x1bc')},'foreignKey':_0x302a('0x1bd'),'onDelete':_0x302a('0x112'),'hooks':!![]});db[_0x302a('0x94')]['hasMany'](db[_0x302a('0x7d')],{'as':_0x302a('0x1b0'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0x302a('0x1b4')]['hasMany'](db[_0x302a('0x1be')],{'as':_0x302a('0x1bf'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1b5'),'hooks':!![]});db[_0x302a('0x9b')][_0x302a('0x115')](db['AnalyticFieldReport'],{'as':_0x302a('0x1bf'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x302a('0x9e')][_0x302a('0x115')](db[_0x302a('0x1be')],{'as':'Fields','onDelete':_0x302a('0x112'),'foreignKey':'MetricId'});db[_0x302a('0x1be')][_0x302a('0x122')](db[_0x302a('0x9e')],{'foreignKey':_0x302a('0x1c0')});db[_0x302a('0xa2')][_0x302a('0x115')](db['SalesforceConfiguration'],{'as':_0x302a('0x1c1'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c2')});db[_0x302a('0xa4')][_0x302a('0x115')](db['SalesforceField'],{'as':_0x302a('0x1c3'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0xa4')][_0x302a('0x115')](db[_0x302a('0x1c5')],{'as':_0x302a('0x1c6'),'onDelete':'cascade','foreignKey':_0x302a('0x1c7')});db[_0x302a('0xa4')]['hasMany'](db[_0x302a('0x1c5')],{'as':_0x302a('0x1bf'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x302a('0xa4')][_0x302a('0x122')](db[_0x302a('0xa2')],{'as':'Account','foreignKey':_0x302a('0x1c2')});db[_0x302a('0x1c5')][_0x302a('0x115')](db[_0x302a('0x1c5')],{'as':_0x302a('0x1c8'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0x1c5')]['hasMany'](db['SalesforceField'],{'as':_0x302a('0x1c9'),'foreignKey':_0x302a('0x1c7')});db['SalesforceField'][_0x302a('0x115')](db[_0x302a('0x1c5')],{'as':_0x302a('0x1ca'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0x1c5')]['belongsTo'](db[_0x302a('0x1cc')],{'as':_0x302a('0x1cc'),'foreignKey':'VariableId'});db[_0x302a('0x1cd')][_0x302a('0x115')](db['SugarcrmConfiguration'],{'as':_0x302a('0x1c1'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c2')});db[_0x302a('0x1ce')][_0x302a('0x115')](db[_0x302a('0xa9')],{'as':'Subjects','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c4')});db['SugarcrmConfiguration'][_0x302a('0x115')](db[_0x302a('0xa9')],{'as':_0x302a('0x1c6'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0x1ce')]['hasMany'](db[_0x302a('0xa9')],{'as':'Fields','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1cb')});db['SugarcrmConfiguration'][_0x302a('0x122')](db['SugarcrmAccount'],{'as':_0x302a('0x177'),'foreignKey':'AccountId'});db[_0x302a('0xa9')][_0x302a('0x115')](db[_0x302a('0xa9')],{'as':_0x302a('0x1c8'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0xa9')]['hasMany'](db[_0x302a('0xa9')],{'as':'Description','foreignKey':_0x302a('0x1c7')});db[_0x302a('0xa9')][_0x302a('0x115')](db[_0x302a('0xa9')],{'as':_0x302a('0x1ca'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0xa9')][_0x302a('0x122')](db[_0x302a('0x1cc')],{'as':_0x302a('0x1cc'),'foreignKey':_0x302a('0x1cf')});db[_0x302a('0x1d0')][_0x302a('0x115')](db[_0x302a('0x1d1')],{'as':_0x302a('0x1c1'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c2')});db[_0x302a('0x1d1')][_0x302a('0x115')](db[_0x302a('0xac')],{'as':_0x302a('0x1c3'),'onDelete':'cascade','foreignKey':_0x302a('0x1c4')});db[_0x302a('0x1d1')][_0x302a('0x115')](db['DeskField'],{'as':_0x302a('0x1c6'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0x1d1')][_0x302a('0x115')](db['DeskField'],{'as':_0x302a('0x1bf'),'onDelete':_0x302a('0x112'),'foreignKey':'FieldId'});db[_0x302a('0x1d1')][_0x302a('0x122')](db[_0x302a('0x1d0')],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x1c2')});db[_0x302a('0x1d1')][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':_0x302a('0x1d2')});db[_0x302a('0xac')]['hasMany'](db[_0x302a('0xac')],{'as':'Subject','foreignKey':_0x302a('0x1c4')});db[_0x302a('0xac')]['hasMany'](db[_0x302a('0xac')],{'as':_0x302a('0x1c9'),'foreignKey':_0x302a('0x1c7')});db['DeskField'][_0x302a('0x115')](db[_0x302a('0xac')],{'as':_0x302a('0x1ca'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0xac')]['belongsTo'](db[_0x302a('0x1cc')],{'as':'Variable','foreignKey':_0x302a('0x1cf')});db[_0x302a('0xae')][_0x302a('0x115')](db[_0x302a('0xb0')],{'as':_0x302a('0x1c1'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c2')});db[_0x302a('0xb0')][_0x302a('0x115')](db[_0x302a('0x1d3')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x302a('0x1c4')});db[_0x302a('0xb0')][_0x302a('0x115')](db[_0x302a('0x1d3')],{'as':_0x302a('0x1c6'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0xb0')][_0x302a('0x115')](db[_0x302a('0x1d3')],{'as':_0x302a('0x1bf'),'onDelete':'cascade','foreignKey':_0x302a('0x1cb')});db[_0x302a('0xb0')][_0x302a('0x122')](db['ZohoAccount'],{'as':'Account','foreignKey':_0x302a('0x1c2')});db['ZohoField'][_0x302a('0x115')](db[_0x302a('0x1d3')],{'as':_0x302a('0x1c8'),'foreignKey':'SubjectId'});db['ZohoField'][_0x302a('0x115')](db[_0x302a('0x1d3')],{'as':_0x302a('0x1c9'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0x1d3')][_0x302a('0x115')](db['ZohoField'],{'as':_0x302a('0x1ca'),'foreignKey':'FieldId'});db[_0x302a('0x1d3')]['belongsTo'](db['Variable'],{'as':_0x302a('0x1cc'),'foreignKey':'VariableId'});db[_0x302a('0xb2')]['hasMany'](db[_0x302a('0xb4')],{'as':_0x302a('0x1c1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x302a('0xb4')][_0x302a('0x115')](db[_0x302a('0xb6')],{'as':'Subjects','foreignKey':_0x302a('0x1c4')});db[_0x302a('0xb4')]['hasMany'](db['ZendeskField'],{'as':_0x302a('0x1c6'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x302a('0x1bf'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0xb4')][_0x302a('0x122')](db['ZendeskAccount'],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x1c2')});db['ZendeskConfiguration'][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':_0x302a('0x1d4')});db[_0x302a('0xb6')]['hasMany'](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x302a('0xb6')]['hasMany'](db[_0x302a('0xb6')],{'as':_0x302a('0x1c9'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0xb6')][_0x302a('0x115')](db[_0x302a('0xb6')],{'as':'Field','foreignKey':_0x302a('0x1cb')});db['ZendeskField'][_0x302a('0x122')](db[_0x302a('0x1cc')],{'as':'Variable','foreignKey':_0x302a('0x1cf')});db[_0x302a('0xb8')][_0x302a('0x115')](db['FreshdeskConfiguration'],{'as':_0x302a('0x1c1'),'onDelete':'cascade','foreignKey':_0x302a('0x1c2')});db[_0x302a('0xba')][_0x302a('0x115')](db[_0x302a('0xbc')],{'as':_0x302a('0x1c3'),'onDelete':'cascade','foreignKey':_0x302a('0x1c4')});db[_0x302a('0xba')][_0x302a('0x115')](db[_0x302a('0xbc')],{'as':_0x302a('0x1c6'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0xba')][_0x302a('0x115')](db[_0x302a('0xbc')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x302a('0x1cb')});db[_0x302a('0xba')][_0x302a('0x122')](db[_0x302a('0xb8')],{'as':_0x302a('0x177'),'foreignKey':'AccountId'});db[_0x302a('0xba')]['belongsToMany'](db[_0x302a('0x8d')],{'through':_0x302a('0x1d5')});db[_0x302a('0xbc')]['hasMany'](db[_0x302a('0xbc')],{'as':_0x302a('0x1c8'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0xbc')][_0x302a('0x115')](db[_0x302a('0xbc')],{'as':_0x302a('0x1c9'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0xbc')][_0x302a('0x115')](db[_0x302a('0xbc')],{'as':_0x302a('0x1ca'),'foreignKey':'FieldId'});db[_0x302a('0xbc')][_0x302a('0x122')](db[_0x302a('0x1cc')],{'as':_0x302a('0x1cc'),'foreignKey':_0x302a('0x1cf')});db['VtigerAccount'][_0x302a('0x115')](db[_0x302a('0xbe')],{'as':_0x302a('0x1c1'),'onDelete':_0x302a('0x112'),'foreignKey':'AccountId'});db[_0x302a('0xbe')][_0x302a('0x115')](db[_0x302a('0xbf')],{'as':_0x302a('0x1c3'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0xbe')][_0x302a('0x115')](db[_0x302a('0xbf')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x302a('0xbe')]['hasMany'](db[_0x302a('0xbf')],{'as':_0x302a('0x1bf'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0xbe')][_0x302a('0x122')](db['VtigerAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x302a('0xbf')][_0x302a('0x115')](db['VtigerField'],{'as':_0x302a('0x1c8'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0xbf')][_0x302a('0x115')](db[_0x302a('0xbf')],{'as':_0x302a('0x1c9'),'foreignKey':'DescriptionId'});db[_0x302a('0xbf')][_0x302a('0x115')](db[_0x302a('0xbf')],{'as':_0x302a('0x1ca'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0xbf')][_0x302a('0x122')](db[_0x302a('0x1cc')],{'as':'Variable','foreignKey':_0x302a('0x1cf')});db[_0x302a('0xc1')][_0x302a('0x115')](db[_0x302a('0x1d6')],{'as':_0x302a('0x1c1'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c2')});db[_0x302a('0x1d6')][_0x302a('0x115')](db[_0x302a('0xc3')],{'as':_0x302a('0x1c3'),'foreignKey':_0x302a('0x1c4')});db['ServicenowConfiguration']['hasMany'](db[_0x302a('0xc3')],{'as':_0x302a('0x1c6'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0x1d6')]['hasMany'](db[_0x302a('0xc3')],{'as':_0x302a('0x1bf'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0x1d6')][_0x302a('0x122')](db['ServicenowAccount'],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x1c2')});db['ServicenowField']['hasMany'](db[_0x302a('0xc3')],{'as':_0x302a('0x1c8'),'foreignKey':_0x302a('0x1c4')});db['ServicenowField'][_0x302a('0x115')](db[_0x302a('0xc3')],{'as':_0x302a('0x1c9'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0xc3')][_0x302a('0x115')](db[_0x302a('0xc3')],{'as':_0x302a('0x1ca'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0xc3')]['belongsTo'](db['Variable'],{'as':_0x302a('0x1cc'),'foreignKey':_0x302a('0x1cf')});db[_0x302a('0xc4')][_0x302a('0x115')](db[_0x302a('0xc6')],{'as':'Configurations','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c2')});db['Dynamics365Account']['belongsTo'](db[_0x302a('0x160')],{'as':'CloudProvider','foreignKey':_0x302a('0x161')});db[_0x302a('0xc6')][_0x302a('0x115')](db['Dynamics365Field'],{'as':_0x302a('0x1c3'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0xc6')]['hasMany'](db[_0x302a('0x1d7')],{'as':'Descriptions','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0xc6')][_0x302a('0x115')](db[_0x302a('0x1d7')],{'as':_0x302a('0x1bf'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1cb')});db['Dynamics365Configuration']['belongsTo'](db[_0x302a('0xc4')],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x1c2')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x302a('0x1c4')});db[_0x302a('0x1d7')][_0x302a('0x115')](db['Dynamics365Field'],{'as':_0x302a('0x1c9'),'foreignKey':_0x302a('0x1c7')});db['Dynamics365Field'][_0x302a('0x115')](db[_0x302a('0x1d7')],{'as':_0x302a('0x1ca'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0x1d7')]['belongsTo'](db[_0x302a('0x1cc')],{'as':_0x302a('0x1cc'),'foreignKey':_0x302a('0x1cf')});db[_0x302a('0x1d8')][_0x302a('0x115')](db[_0x302a('0x1d9')],{'as':_0x302a('0x1c1'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1c2')});db[_0x302a('0x1d9')][_0x302a('0x115')](db[_0x302a('0xca')],{'as':_0x302a('0x1c3'),'foreignKey':_0x302a('0x1c4')});db[_0x302a('0x1d9')][_0x302a('0x115')](db[_0x302a('0xca')],{'as':_0x302a('0x1c6'),'foreignKey':_0x302a('0x1c7')});db[_0x302a('0x1d9')][_0x302a('0x115')](db['FreshsalesField'],{'as':_0x302a('0x1bf'),'foreignKey':_0x302a('0x1cb')});db[_0x302a('0x1d9')]['belongsTo'](db[_0x302a('0x1d8')],{'as':_0x302a('0x177'),'foreignKey':'AccountId'});db[_0x302a('0xca')][_0x302a('0x115')](db[_0x302a('0xca')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x302a('0xca')][_0x302a('0x115')](db['FreshsalesField'],{'as':'Description','foreignKey':_0x302a('0x1c7')});db[_0x302a('0xca')]['hasMany'](db[_0x302a('0xca')],{'as':_0x302a('0x1ca'),'foreignKey':'FieldId'});db[_0x302a('0xca')][_0x302a('0x122')](db[_0x302a('0x1cc')],{'as':'Variable','foreignKey':_0x302a('0x1cf')});db[_0x302a('0xcf')][_0x302a('0x122')](db[_0x302a('0x64')],{});db['ChatQueueReport'][_0x302a('0x122')](db[_0x302a('0xf6')],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0xcf')]['belongsTo'](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0xcf')][_0x302a('0x122')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x302a('0x122')](db[_0x302a('0x6a')],{});db[_0x302a('0xcf')][_0x302a('0x122')](db[_0x302a('0x13')],{});db[_0x302a('0xcf')]['belongsTo'](db[_0x302a('0x131')],{});db['ChatInternalMessage'][_0x302a('0x122')](db['User'],{'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x1da')});db[_0x302a('0x19c')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x302a('0x1db')});db[_0x302a('0xd5')]['hasMany'](db[_0x302a('0xd4')],{'foreignKey':_0x302a('0x1dc'),'onDelete':_0x302a('0x112')});db['JscriptySessionReport']['hasMany'](db[_0x302a('0xd2')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x302a('0xd6')][_0x302a('0x122')](db[_0x302a('0x54')],{});db[_0x302a('0xd6')][_0x302a('0x122')](db[_0x302a('0xf6')],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0xd6')]['belongsTo'](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0xd6')][_0x302a('0x122')](db[_0x302a('0x58')],{});db[_0x302a('0xd6')]['belongsTo'](db[_0x302a('0x5a')],{});db[_0x302a('0xd6')][_0x302a('0x122')](db[_0x302a('0x13')],{});db[_0x302a('0xd6')][_0x302a('0x122')](db['SmsQueue'],{});db[_0x302a('0xdb')][_0x302a('0x115')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x302a('0xd4')],{'foreignKey':_0x302a('0x1dd')});db[_0x302a('0xdb')]['hasMany'](db[_0x302a('0xd2')],{'foreignKey':_0x302a('0x1dd')});db[_0x302a('0xe1')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x174'),'through':_0x302a('0x1de')});db[_0x302a('0xe5')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':'Agents','through':_0x302a('0x12a')});db['Team'][_0x302a('0x125')](db[_0x302a('0x1d')],{'through':_0x302a('0x10c'),'as':_0x302a('0x12f')});db['Team'][_0x302a('0x125')](db[_0x302a('0x3f')],{'through':_0x302a('0x1df'),'as':_0x302a('0x1e0')});db[_0x302a('0xe5')][_0x302a('0x125')](db[_0x302a('0x131')],{'through':'team_has_chat_queues','as':'ChatQueues'});db['Team'][_0x302a('0x125')](db[_0x302a('0x133')],{'through':'team_has_fax_queues','as':_0x302a('0x1e1')});db[_0x302a('0xe5')]['belongsToMany'](db['SmsQueue'],{'through':_0x302a('0x189'),'as':_0x302a('0x135')});db[_0x302a('0xe5')][_0x302a('0x125')](db[_0x302a('0x137')],{'through':_0x302a('0x190'),'as':_0x302a('0x1e2')});db[_0x302a('0xe5')][_0x302a('0x125')](db[_0x302a('0x109')],{'through':_0x302a('0x1e3'),'as':'WhatsappQueues'});db['Team'][_0x302a('0x125')](db['VoicePrefix'],{'through':_0x302a('0x1e4'),'as':'VoicePrefixes'});db[_0x302a('0xe7')][_0x302a('0x115')](db['CmHopper'],{'as':_0x302a('0x14e'),'foreignKey':_0x302a('0x1a8')});db[_0x302a('0xe7')]['hasMany'](db[_0x302a('0x76')],{'as':_0x302a('0x119'),'foreignKey':_0x302a('0x1a8')});db['Campaign'][_0x302a('0x115')](db[_0x302a('0x77')],{'as':_0x302a('0x14f'),'foreignKey':_0x302a('0x1a8')});db[_0x302a('0xe7')]['hasMany'](db['CmHopperBlack'],{'as':_0x302a('0x1e5'),'foreignKey':_0x302a('0x1a8')});db['Campaign'][_0x302a('0x122')](db[_0x302a('0x2d')],{'as':_0x302a('0x2d'),'foreignKey':_0x302a('0x150')});db[_0x302a('0xe7')][_0x302a('0x122')](db[_0x302a('0x2d')],{'as':_0x302a('0x151'),'foreignKey':_0x302a('0x152')});db['Campaign']['belongsTo'](db['Interval'],{'as':_0x302a('0x83'),'foreignKey':_0x302a('0x17a')});db['Campaign'][_0x302a('0x122')](db['SquareProject'],{'as':_0x302a('0xe1'),'foreignKey':'SquareProjectId'});db[_0x302a('0xe7')][_0x302a('0x125')](db[_0x302a('0xf6')],{'as':_0x302a('0x129'),'through':_0x302a('0x1e6')});db['Campaign']['belongsToMany'](db[_0x302a('0xf6')],{'as':'BlackLists','through':_0x302a('0x1e7')});db[_0x302a('0xeb')]['belongsTo'](db[_0x302a('0x6b')],{'as':_0x302a('0x6b'),'foreignKey':_0x302a('0x179')});db[_0x302a('0x1e8')][_0x302a('0x122')](db[_0x302a('0x45')],{});db[_0x302a('0x1e8')][_0x302a('0x122')](db[_0x302a('0x43')],{});db[_0x302a('0x1e8')][_0x302a('0x122')](db[_0x302a('0x3d')],{'foreignKey':_0x302a('0x1e9'),'as':_0x302a('0x1ea')});db[_0x302a('0x1e8')][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':_0x302a('0x1eb'),'as':'FromAgent'});db[_0x302a('0x1e8')][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x302a('0x1ec')});db[_0x302a('0x1e8')]['belongsTo'](db[_0x302a('0x3d')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x302a('0xf0')][_0x302a('0x122')](db['ChatMessage'],{});db[_0x302a('0xf0')][_0x302a('0x122')](db['ChatInteraction'],{});db[_0x302a('0xf0')][_0x302a('0x122')](db[_0x302a('0x64')],{'foreignKey':_0x302a('0x1ed'),'as':_0x302a('0x1ea')});db[_0x302a('0xf0')]['belongsTo'](db[_0x302a('0x13')],{'foreignKey':'FromUserId','as':_0x302a('0x1ee')});db['ChatTransferReport'][_0x302a('0x122')](db['User'],{'foreignKey':_0x302a('0x1ef'),'as':'ToAgent'});db[_0x302a('0xf0')][_0x302a('0x122')](db[_0x302a('0x131')],{'foreignKey':_0x302a('0x1f0'),'as':'ToQueue'});db[_0x302a('0xf0')][_0x302a('0x122')](db[_0x302a('0x64')],{'foreignKey':_0x302a('0x1f1'),'as':'ToAccount'});db[_0x302a('0xf2')][_0x302a('0x122')](db[_0x302a('0x51')],{});db[_0x302a('0xf2')][_0x302a('0x122')](db['FaxInteraction'],{});db[_0x302a('0xf2')][_0x302a('0x122')](db['FaxAccount'],{'foreignKey':_0x302a('0x1f2'),'as':_0x302a('0x1ea')});db['FaxTransferReport'][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':_0x302a('0x1eb'),'as':_0x302a('0x1ee')});db[_0x302a('0xf2')]['belongsTo'](db[_0x302a('0x13')],{'foreignKey':_0x302a('0x1ef'),'as':_0x302a('0x1f3')});db['FaxTransferReport'][_0x302a('0x122')](db[_0x302a('0x133')],{'foreignKey':_0x302a('0x1f4'),'as':_0x302a('0x1ec')});db['FaxTransferReport']['belongsTo'](db[_0x302a('0x4f')],{'foreignKey':_0x302a('0x1f5'),'as':_0x302a('0x1f6')});db[_0x302a('0xf4')][_0x302a('0x122')](db[_0x302a('0x62')],{});db[_0x302a('0xf4')][_0x302a('0x122')](db[_0x302a('0x60')],{});db[_0x302a('0xf4')][_0x302a('0x122')](db['OpenchannelAccount'],{'foreignKey':_0x302a('0x1f7'),'as':_0x302a('0x1ea')});db[_0x302a('0xf4')][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':_0x302a('0x1eb'),'as':_0x302a('0x1ee')});db[_0x302a('0xf4')][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':_0x302a('0x1ef'),'as':_0x302a('0x1f3')});db[_0x302a('0xf4')][_0x302a('0x122')](db[_0x302a('0x137')],{'foreignKey':_0x302a('0x1f8'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x302a('0x122')](db[_0x302a('0x5d')],{'foreignKey':_0x302a('0x1f9'),'as':_0x302a('0x1f6')});db[_0x302a('0x1fa')]['belongsTo'](db[_0x302a('0x5a')],{});db[_0x302a('0x1fa')][_0x302a('0x122')](db['SmsInteraction'],{});db[_0x302a('0x1fa')][_0x302a('0x122')](db[_0x302a('0x54')],{'foreignKey':_0x302a('0x1fb'),'as':_0x302a('0x1ea')});db[_0x302a('0x1fa')][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':_0x302a('0x1eb'),'as':_0x302a('0x1ee')});db[_0x302a('0x1fa')][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db['SmsTransferReport'][_0x302a('0x122')](db[_0x302a('0x134')],{'foreignKey':_0x302a('0x1fc'),'as':_0x302a('0x1ec')});db[_0x302a('0x1fa')][_0x302a('0x122')](db[_0x302a('0x54')],{'foreignKey':_0x302a('0x1fd'),'as':_0x302a('0x1f6')});db[_0x302a('0xf6')]['hasMany'](db['Disposition'],{'as':_0x302a('0x165'),'foreignKey':_0x302a('0x16b'),'onDelete':_0x302a('0x112')});db[_0x302a('0xf6')]['hasMany'](db[_0x302a('0x7b')],{'as':_0x302a('0x1fe'),'foreignKey':_0x302a('0x16b')});db['CmList']['hasMany'](db['CmContact'],{'as':'Contacts','onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0xf6')][_0x302a('0x115')](db[_0x302a('0x76')],{'as':'HopperFinals','foreignKey':_0x302a('0x16b')});db[_0x302a('0xf6')]['hasMany'](db[_0x302a('0x77')],{'as':_0x302a('0x11a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0xf6')][_0x302a('0x115')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x302a('0x16b')});db['CmList'][_0x302a('0x125')](db[_0x302a('0x1d')],{'as':'Queues','through':_0x302a('0x1ff')});db[_0x302a('0xf6')][_0x302a('0x125')](db['User'],{'as':_0x302a('0x16d'),'through':_0x302a('0x200')});db['VoicePrefix']['hasMany'](db[_0x302a('0x1a')],{'as':_0x302a('0x118'),'onDelete':_0x302a('0x112')});db['VoicePrefix'][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x10d')});db[_0x302a('0xf8')][_0x302a('0x125')](db['Team'],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x302a('0x123')][_0x302a('0x115')](db[_0x302a('0x13')],{'as':_0x302a('0x174'),'foreignKey':_0x302a('0x124')});db[_0x302a('0x123')][_0x302a('0x115')](db[_0x302a('0xfb')],{'as':_0x302a('0x201'),'foreignKey':'userProfileId','onDelete':_0x302a('0x112')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x302a('0x202'),'foreignKey':_0x302a('0x203'),'onDelete':_0x302a('0x112')});db[_0x302a('0x143')][_0x302a('0x115')](db['Disposition'],{'as':_0x302a('0x165'),'foreignKey':_0x302a('0x204'),'onDelete':_0x302a('0x112')});db[_0x302a('0x143')]['hasMany'](db[_0x302a('0x166')],{'as':_0x302a('0x167'),'foreignKey':_0x302a('0x204')});db[_0x302a('0x143')]['hasMany'](db[_0x302a('0x205')],{'as':_0x302a('0x168'),'foreignKey':_0x302a('0x204')});db[_0x302a('0x143')][_0x302a('0x115')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0x302a('0x143')][_0x302a('0x115')](db['WhatsappApplication'],{'as':_0x302a('0x149')});db[_0x302a('0x143')]['belongsTo'](db['CmList'],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db[_0x302a('0x143')][_0x302a('0x122')](db['Pause'],{'as':_0x302a('0x153'),'foreignKey':_0x302a('0x154')});db[_0x302a('0x143')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x145')});db[_0x302a('0x102')][_0x302a('0x122')](db['User'],{'onDelete':_0x302a('0x162')});db[_0x302a('0x102')][_0x302a('0x122')](db[_0x302a('0x109')],{'onDelete':'restrict'});db[_0x302a('0x102')]['belongsTo'](db[_0x302a('0x143')],{'onDelete':_0x302a('0x162')});db[_0x302a('0x102')][_0x302a('0x122')](db[_0x302a('0x83')],{'onDelete':_0x302a('0x162'),'foreignKey':_0x302a('0x17a')});db[_0x302a('0x102')][_0x302a('0x122')](db[_0x302a('0x8d')],{'onDelete':_0x302a('0x162'),'foreignKey':'TagId'});db[_0x302a('0x104')][_0x302a('0x115')](db['WhatsappMessage'],{'as':_0x302a('0x168'),'onDelete':_0x302a('0x112'),'foreignKey':_0x302a('0x206')});db[_0x302a('0x104')][_0x302a('0x122')](db[_0x302a('0x143')],{'as':_0x302a('0x177'),'foreignKey':_0x302a('0x204')});db[_0x302a('0x104')][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0x104')][_0x302a('0x122')](db['User'],{'as':_0x302a('0x171'),'foreignKey':_0x302a('0x113')});db[_0x302a('0x104')][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':_0x302a('0x1b7'),'as':_0x302a('0x173')});db['WhatsappInteraction'][_0x302a('0x125')](db[_0x302a('0x8d')],{'through':'whatsapp_interaction_has_tags','as':_0x302a('0x183')});db['WhatsappInteraction'][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x174'),'through':_0x302a('0x12e'),'foreignKey':_0x302a('0x206')});db[_0x302a('0x205')][_0x302a('0x122')](db[_0x302a('0x13')],{'as':'User'});db['WhatsappMessage']['belongsTo'](db[_0x302a('0x72')],{'onDelete':'cascade','as':'Contact'});db[_0x302a('0x205')]['belongsTo'](db[_0x302a('0x104')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x302a('0x206')});db['WhatsappMessage'][_0x302a('0x122')](db[_0x302a('0x143')],{'as':_0x302a('0x177'),'foreignKey':'WhatsappAccountId'});db[_0x302a('0x107')]['belongsTo'](db[_0x302a('0x143')],{});db[_0x302a('0x107')]['belongsTo'](db['CmList'],{'as':_0x302a('0x16a'),'foreignKey':_0x302a('0x16b')});db['WhatsappQueueReport'][_0x302a('0x122')](db[_0x302a('0x72')],{'as':_0x302a('0x170'),'foreignKey':_0x302a('0x15d')});db[_0x302a('0x107')][_0x302a('0x122')](db[_0x302a('0x104')],{});db[_0x302a('0x107')][_0x302a('0x122')](db[_0x302a('0x109')],{});db['WhatsappQueueReport'][_0x302a('0x122')](db[_0x302a('0x205')],{});db[_0x302a('0x107')]['belongsTo'](db[_0x302a('0x13')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x302a('0x205')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x302a('0x104')],{});db[_0x302a('0x207')][_0x302a('0x122')](db[_0x302a('0x143')],{'foreignKey':_0x302a('0x208'),'as':_0x302a('0x1ea')});db[_0x302a('0x207')]['belongsTo'](db[_0x302a('0x143')],{'foreignKey':'ToWhatsappAccountId','as':_0x302a('0x1f6')});db[_0x302a('0x207')][_0x302a('0x122')](db[_0x302a('0x109')],{'foreignKey':_0x302a('0x209'),'as':_0x302a('0x1ec')});db[_0x302a('0x207')][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':_0x302a('0x1eb'),'as':_0x302a('0x1ee')});db['WhatsappTransferReport'][_0x302a('0x122')](db[_0x302a('0x13')],{'foreignKey':'ToUserId','as':_0x302a('0x1f3')});db[_0x302a('0x109')][_0x302a('0x125')](db[_0x302a('0x13')],{'as':_0x302a('0x16d'),'through':_0x302a('0x13a'),'foreignKey':_0x302a('0x20a')});db[_0x302a('0x109')]['belongsToMany'](db[_0x302a('0xe5')],{'through':'team_has_whatsapp_queues','as':'Teams'});db[_0x302a('0x10f')][_0x302a('0x122')](db[_0x302a('0x13')],{'as':_0x302a('0x20b'),'foreignKey':_0x302a('0x113'),'onDelete':'cascade','hooks':!![]});db[_0x302a('0x160')][_0x302a('0x111')](db[_0x302a('0xc4')],{'as':_0x302a('0xc4'),'onDelete':_0x302a('0x162')});db['CloudProvider'][_0x302a('0x111')](db['MailServerIn'],{'as':_0x302a('0x163'),'onDelete':_0x302a('0x162')});db[_0x302a('0x160')][_0x302a('0x111')](db['MailServerOut'],{'as':_0x302a('0x164'),'onDelete':_0x302a('0x162')});module[_0x302a('0x20c')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index fef7ade..cfaf8cf 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x78e8=['./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowField','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','/api/auth/local','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','/www','/demo','root','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','express','./config/environment','./utils/client-side-logger','./api/client-side-logs','then','use','./api/user','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./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'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x78e8,0xe8));var _0x878e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x78e8[_0x56482c];return _0x5aae7a;};'use strict';var path=require('path');var express=require(_0x878e('0x0'));var errors=require('./errors');var config=require(_0x878e('0x1'));var setupLoggers=require(_0x878e('0x2'))['setupLoggers'];var clientSideLogs=require(_0x878e('0x3'));exports['default']=function(_0x29b65f){return setupLoggers(_0x29b65f)[_0x878e('0x4')](function(){_0x29b65f[_0x878e('0x5')]('/api/users',require(_0x878e('0x6')));_0x29b65f[_0x878e('0x5')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x29b65f[_0x878e('0x5')](_0x878e('0x7'),require(_0x878e('0x8')));_0x29b65f[_0x878e('0x5')]('/api/voice/extensions',require(_0x878e('0x9')));_0x29b65f[_0x878e('0x5')](_0x878e('0xa'),require(_0x878e('0xb')));_0x29b65f[_0x878e('0x5')](_0x878e('0xc'),require(_0x878e('0xd')));_0x29b65f[_0x878e('0x5')](_0x878e('0xe'),require(_0x878e('0xf')));_0x29b65f[_0x878e('0x5')](_0x878e('0x10'),require(_0x878e('0x11')));_0x29b65f[_0x878e('0x5')](_0x878e('0x12'),require(_0x878e('0x13')));_0x29b65f[_0x878e('0x5')](_0x878e('0x14'),require(_0x878e('0x15')));_0x29b65f[_0x878e('0x5')](_0x878e('0x16'),require(_0x878e('0x17')));_0x29b65f['use'](_0x878e('0x18'),require(_0x878e('0x19')));_0x29b65f[_0x878e('0x5')](_0x878e('0x1a'),require(_0x878e('0x1b')));_0x29b65f[_0x878e('0x5')]('/api/voice/queues/reports',require(_0x878e('0x1c')));_0x29b65f[_0x878e('0x5')]('/api/members/reports',require(_0x878e('0x1d')));_0x29b65f[_0x878e('0x5')]('/api/trunks',require('./api/trunk'));_0x29b65f['use'](_0x878e('0x1e'),require(_0x878e('0x1f')));_0x29b65f[_0x878e('0x5')](_0x878e('0x20'),require(_0x878e('0x21')));_0x29b65f[_0x878e('0x5')](_0x878e('0x22'),require(_0x878e('0x23')));_0x29b65f[_0x878e('0x5')](_0x878e('0x24'),require(_0x878e('0x25')));_0x29b65f[_0x878e('0x5')]('/api/mail/substatuses',require(_0x878e('0x26')));_0x29b65f['use'](_0x878e('0x27'),require('./api/mailInteraction'));_0x29b65f[_0x878e('0x5')]('/api/mail/messages',require(_0x878e('0x28')));_0x29b65f['use'](_0x878e('0x29'),require(_0x878e('0x2a')));_0x29b65f['use'](_0x878e('0x2b'),require(_0x878e('0x2c')));_0x29b65f[_0x878e('0x5')](_0x878e('0x2d'),require('./api/dashboard'));_0x29b65f[_0x878e('0x5')](_0x878e('0x2e'),require(_0x878e('0x2f')));_0x29b65f[_0x878e('0x5')]('/api/fax/accounts',require(_0x878e('0x30')));_0x29b65f[_0x878e('0x5')](_0x878e('0x31'),require(_0x878e('0x32')));_0x29b65f[_0x878e('0x5')](_0x878e('0x33'),require(_0x878e('0x34')));_0x29b65f['use'](_0x878e('0x35'),require(_0x878e('0x36')));_0x29b65f[_0x878e('0x5')](_0x878e('0x37'),require(_0x878e('0x38')));_0x29b65f[_0x878e('0x5')](_0x878e('0x39'),require(_0x878e('0x3a')));_0x29b65f['use']('/api/sms/accounts',require(_0x878e('0x3b')));_0x29b65f[_0x878e('0x5')](_0x878e('0x3c'),require(_0x878e('0x3d')));_0x29b65f[_0x878e('0x5')](_0x878e('0x3e'),require(_0x878e('0x3f')));_0x29b65f[_0x878e('0x5')](_0x878e('0x40'),require('./api/smsMessage'));_0x29b65f[_0x878e('0x5')]('/api/sms/queues',require(_0x878e('0x41')));_0x29b65f[_0x878e('0x5')]('/api/openchannel/accounts',require(_0x878e('0x42')));_0x29b65f[_0x878e('0x5')]('/api/openchannel/applications',require(_0x878e('0x43')));_0x29b65f[_0x878e('0x5')](_0x878e('0x44'),require('./api/openchannelInteraction'));_0x29b65f['use'](_0x878e('0x45'),require(_0x878e('0x46')));_0x29b65f[_0x878e('0x5')](_0x878e('0x47'),require(_0x878e('0x48')));_0x29b65f[_0x878e('0x5')]('/api/chat/websites',require(_0x878e('0x49')));_0x29b65f[_0x878e('0x5')](_0x878e('0x4a'),require('./api/openchannelQueueReport'));_0x29b65f['use']('/api/chat/applications',require(_0x878e('0x4b')));_0x29b65f['use'](_0x878e('0x4c'),require(_0x878e('0x4d')));_0x29b65f[_0x878e('0x5')](_0x878e('0x4e'),require('./api/chatMessage'));_0x29b65f[_0x878e('0x5')]('/api/chat/offline_messages',require(_0x878e('0x4f')));_0x29b65f[_0x878e('0x5')]('/api/chat/queues',require(_0x878e('0x50')));_0x29b65f[_0x878e('0x5')](_0x878e('0x51'),require('./api/chatGroup'));_0x29b65f[_0x878e('0x5')](_0x878e('0x52'),require(_0x878e('0x53')));_0x29b65f[_0x878e('0x5')](_0x878e('0x54'),require('./api/cmCompany'));_0x29b65f[_0x878e('0x5')]('/api/cm/contacts',require(_0x878e('0x55')));_0x29b65f[_0x878e('0x5')](_0x878e('0x56'),require(_0x878e('0x57')));_0x29b65f['use'](_0x878e('0x58'),require('./api/cmHopperBlack'));_0x29b65f[_0x878e('0x5')](_0x878e('0x59'),require(_0x878e('0x5a')));_0x29b65f[_0x878e('0x5')](_0x878e('0x5b'),require('./api/cmHopperHistory'));_0x29b65f[_0x878e('0x5')](_0x878e('0x5c'),require(_0x878e('0x5d')));_0x29b65f['use'](_0x878e('0x5e'),require(_0x878e('0x5f')));_0x29b65f[_0x878e('0x5')]('/api/automations',require(_0x878e('0x60')));_0x29b65f[_0x878e('0x5')](_0x878e('0x61'),require(_0x878e('0x62')));_0x29b65f[_0x878e('0x5')](_0x878e('0x63'),require(_0x878e('0x64')));_0x29b65f[_0x878e('0x5')]('/api/conditions',require(_0x878e('0x65')));_0x29b65f[_0x878e('0x5')](_0x878e('0x66'),require('./api/interval'));_0x29b65f[_0x878e('0x5')](_0x878e('0x67'),require('./api/pause'));_0x29b65f['use'](_0x878e('0x68'),require(_0x878e('0x69')));_0x29b65f['use'](_0x878e('0x6a'),require(_0x878e('0x6b')));_0x29b65f[_0x878e('0x5')]('/api/schedules',require(_0x878e('0x6c')));_0x29b65f['use'](_0x878e('0x6d'),require(_0x878e('0x6e')));_0x29b65f[_0x878e('0x5')]('/api/tags',require(_0x878e('0x6f')));_0x29b65f[_0x878e('0x5')]('/api/contact_item_types',require(_0x878e('0x70')));_0x29b65f[_0x878e('0x5')]('/api/cm_contact_has_items',require(_0x878e('0x71')));_0x29b65f[_0x878e('0x5')](_0x878e('0x72'),require(_0x878e('0x73')));_0x29b65f[_0x878e('0x5')](_0x878e('0x74'),require('./api/template'));_0x29b65f[_0x878e('0x5')](_0x878e('0x75'),require(_0x878e('0x76')));_0x29b65f[_0x878e('0x5')]('/api/variables',require(_0x878e('0x77')));_0x29b65f['use'](_0x878e('0x78'),require(_0x878e('0x79')));_0x29b65f[_0x878e('0x5')](_0x878e('0x7a'),require(_0x878e('0x7b')));_0x29b65f[_0x878e('0x5')]('/api/analytics/custom_reports',require(_0x878e('0x7c')));_0x29b65f[_0x878e('0x5')](_0x878e('0x7d'),require(_0x878e('0x7e')));_0x29b65f[_0x878e('0x5')](_0x878e('0x7f'),require(_0x878e('0x80')));_0x29b65f[_0x878e('0x5')](_0x878e('0x81'),require('./api/analyticMetric'));_0x29b65f[_0x878e('0x5')](_0x878e('0x82'),require(_0x878e('0x83')));_0x29b65f[_0x878e('0x5')](_0x878e('0x84'),require(_0x878e('0x85')));_0x29b65f[_0x878e('0x5')](_0x878e('0x86'),require(_0x878e('0x87')));_0x29b65f[_0x878e('0x5')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x29b65f['use'](_0x878e('0x88'),require('./api/intSalesforceField'));_0x29b65f[_0x878e('0x5')](_0x878e('0x89'),require(_0x878e('0x8a')));_0x29b65f[_0x878e('0x5')](_0x878e('0x8b'),require('./api/intSugarcrmConfiguration'));_0x29b65f[_0x878e('0x5')](_0x878e('0x8c'),require(_0x878e('0x8d')));_0x29b65f['use'](_0x878e('0x8e'),require(_0x878e('0x8f')));_0x29b65f['use']('/api/integrations/desk/configurations',require(_0x878e('0x90')));_0x29b65f['use']('/api/integrations/desk/fields',require(_0x878e('0x91')));_0x29b65f[_0x878e('0x5')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x29b65f['use']('/api/integrations/zoho/configurations',require(_0x878e('0x92')));_0x29b65f[_0x878e('0x5')](_0x878e('0x93'),require(_0x878e('0x94')));_0x29b65f[_0x878e('0x5')](_0x878e('0x95'),require('./api/intZendeskAccount'));_0x29b65f[_0x878e('0x5')](_0x878e('0x96'),require(_0x878e('0x97')));_0x29b65f[_0x878e('0x5')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x29b65f[_0x878e('0x5')]('/api/integrations/freshdesk/accounts',require(_0x878e('0x98')));_0x29b65f[_0x878e('0x5')](_0x878e('0x99'),require(_0x878e('0x9a')));_0x29b65f[_0x878e('0x5')](_0x878e('0x9b'),require('./api/intFreshdeskField'));_0x29b65f[_0x878e('0x5')]('/api/integrations/vtiger/accounts',require(_0x878e('0x9c')));_0x29b65f[_0x878e('0x5')](_0x878e('0x9d'),require(_0x878e('0x9e')));_0x29b65f[_0x878e('0x5')](_0x878e('0x9f'),require(_0x878e('0xa0')));_0x29b65f[_0x878e('0x5')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x29b65f[_0x878e('0x5')](_0x878e('0xa1'),require('./api/intServicenowConfiguration'));_0x29b65f['use']('/api/integrations/servicenow/fields',require(_0x878e('0xa2')));_0x29b65f[_0x878e('0x5')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x29b65f[_0x878e('0x5')]('/api/integrations/dynamics365/configurations',require(_0x878e('0xa3')));_0x29b65f[_0x878e('0x5')](_0x878e('0xa4'),require(_0x878e('0xa5')));_0x29b65f[_0x878e('0x5')](_0x878e('0xa6'),require(_0x878e('0xa7')));_0x29b65f[_0x878e('0x5')](_0x878e('0xa8'),require(_0x878e('0xa9')));_0x29b65f[_0x878e('0x5')]('/api/integrations/freshsales/fields',require(_0x878e('0xaa')));_0x29b65f[_0x878e('0x5')](_0x878e('0xab'),require(_0x878e('0xac')));_0x29b65f['use'](_0x878e('0xad'),require(_0x878e('0xae')));_0x29b65f[_0x878e('0x5')](_0x878e('0xaf'),require(_0x878e('0xb0')));_0x29b65f['use'](_0x878e('0xb1'),require(_0x878e('0xb2')));_0x29b65f[_0x878e('0x5')](_0x878e('0xb3'),require(_0x878e('0xb4')));_0x29b65f[_0x878e('0x5')](_0x878e('0xb5'),require(_0x878e('0xb6')));_0x29b65f[_0x878e('0x5')](_0x878e('0xb7'),require(_0x878e('0xb8')));_0x29b65f['use'](_0x878e('0xb9'),require(_0x878e('0xba')));_0x29b65f[_0x878e('0x5')](_0x878e('0xbb'),require('./api/squareReportDetail'));_0x29b65f['use']('/api/jscripty/projects',require('./api/jscriptyProject'));_0x29b65f[_0x878e('0x5')](_0x878e('0xbc'),require('./api/setting'));_0x29b65f[_0x878e('0x5')](_0x878e('0xbd'),require(_0x878e('0xbe')));_0x29b65f[_0x878e('0x5')](_0x878e('0xbf'),require(_0x878e('0xc0')));_0x29b65f[_0x878e('0x5')](_0x878e('0xc1'),require(_0x878e('0xc2')));_0x29b65f['use']('/api/square/messages',require(_0x878e('0xc3')));_0x29b65f[_0x878e('0x5')](_0x878e('0xc4'),require(_0x878e('0xc5')));_0x29b65f[_0x878e('0x5')](_0x878e('0xc6'),require('./api/license'));_0x29b65f[_0x878e('0x5')](_0x878e('0xc7'),require('./api/campaign'));_0x29b65f[_0x878e('0x5')](_0x878e('0xc8'),require(_0x878e('0xc9')));_0x29b65f[_0x878e('0x5')]('/api/attachments',require('./api/attachment'));_0x29b65f[_0x878e('0x5')]('/api/plugins',require(_0x878e('0xca')));_0x29b65f[_0x878e('0x5')](_0x878e('0xcb'),require(_0x878e('0xcc')));_0x29b65f[_0x878e('0x5')]('/api/chat/reports/transfer',require(_0x878e('0xcd')));_0x29b65f['use']('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x29b65f[_0x878e('0x5')](_0x878e('0xce'),require(_0x878e('0xcf')));_0x29b65f[_0x878e('0x5')](_0x878e('0xd0'),require(_0x878e('0xd1')));_0x29b65f[_0x878e('0x5')](_0x878e('0xd2'),require('./api/cmList'));_0x29b65f[_0x878e('0x5')](_0x878e('0xd3'),require(_0x878e('0xd4')));_0x29b65f[_0x878e('0x5')](_0x878e('0xd5'),require(_0x878e('0xd6')));_0x29b65f[_0x878e('0x5')](_0x878e('0xd7'),require(_0x878e('0xd8')));_0x29b65f[_0x878e('0x5')](_0x878e('0xd9'),require(_0x878e('0xda')));_0x29b65f['use']('/api/userNotifications',require(_0x878e('0xdb')));_0x29b65f[_0x878e('0x5')]('/api/whatsapp/accounts',require(_0x878e('0xdc')));_0x29b65f[_0x878e('0x5')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x29b65f[_0x878e('0x5')](_0x878e('0xdd'),require('./api/whatsappInteraction'));_0x29b65f['use'](_0x878e('0xde'),require('./api/whatsappMessage'));_0x29b65f[_0x878e('0x5')]('/api/whatsapp/reports/queue',require(_0x878e('0xdf')));_0x29b65f[_0x878e('0x5')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x29b65f['use'](_0x878e('0xe0'),require(_0x878e('0xe1')));_0x29b65f[_0x878e('0x5')](_0x878e('0xe2'),require(_0x878e('0xe3')));_0x29b65f[_0x878e('0x5')]('/api/realtime',require(_0x878e('0xe4')));_0x29b65f[_0x878e('0x5')](_0x878e('0xe5'),require('./api/user-setting'));_0x29b65f['use'](_0x878e('0xe6'),require('./api/authLocal'));_0x29b65f[_0x878e('0x5')]('/api/auth/google',require(_0x878e('0xe7')));_0x29b65f['use']('/api/auth/activedirectory',require(_0x878e('0xe8')));_0x29b65f[_0x878e('0x5')](_0x878e('0xe9'),require(_0x878e('0xea')));_0x29b65f['use'](_0x878e('0xeb'),require(_0x878e('0xec')));_0x29b65f[_0x878e('0x5')](_0x878e('0xed'),require(_0x878e('0xee')));_0x29b65f[_0x878e('0x5')](_0x878e('0xef'),require(_0x878e('0xf0')));_0x29b65f[_0x878e('0x5')]('/api/pm2',require(_0x878e('0xf1')));_0x29b65f[_0x878e('0x5')]('/api/webbar',require(_0x878e('0xf2')));_0x29b65f[_0x878e('0x5')](_0x878e('0xf3'),clientSideLogs);_0x29b65f['use'](_0x878e('0xf4'),express[_0x878e('0xf5')](path[_0x878e('0xf6')](config['root'],_0x878e('0xf4'))));_0x29b65f[_0x878e('0x5')](_0x878e('0xf7'),express[_0x878e('0xf5')](path['join'](config['root'],_0x878e('0xf7'))));_0x29b65f['use'](_0x878e('0xf8'),express[_0x878e('0xf5')](path[_0x878e('0xf6')](config[_0x878e('0xf9')],_0x878e('0xf8'))));_0x29b65f[_0x878e('0x5')](_0x878e('0xfa'),express['static'](path['join'](config[_0x878e('0xf9')],_0x878e('0xfb'),'3.0.0')));_0x29b65f[_0x878e('0x5')](_0x878e('0xfc'),express[_0x878e('0xf5')](path[_0x878e('0xf6')](config['root'],'/server/files/plugins')));_0x29b65f[_0x878e('0xfd')](_0x878e('0xfe'))['get'](errors[0x194]);_0x29b65f[_0x878e('0xfd')]('/*')['get'](function(_0x2e2ed1,_0x5340c7){_0x5340c7[_0x878e('0xff')](path[_0x878e('0x100')](_0x29b65f['get']('appPath')+'/index.html'));});return _0x29b65f;});}; \ No newline at end of file +var _0x80e9=['./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','/api/voice/chanspy','./api/voiceChanSpy','use','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_hopper_additional_phones','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/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'];(function(_0x37a505,_0x319129){var _0x5d094e=function(_0x5b78ea){while(--_0x5b78ea){_0x37a505['push'](_0x37a505['shift']());}};_0x5d094e(++_0x319129);}(_0x80e9,0x6c));var _0x980e=function(_0x4a6160,_0x4b24cb){_0x4a6160=_0x4a6160-0x0;var _0xb599e2=_0x80e9[_0x4a6160];return _0xb599e2;};'use strict';var path=require(_0x980e('0x0'));var express=require(_0x980e('0x1'));var errors=require(_0x980e('0x2'));var config=require(_0x980e('0x3'));var setupLoggers=require(_0x980e('0x4'))[_0x980e('0x5')];var clientSideLogs=require(_0x980e('0x6'));exports[_0x980e('0x7')]=function(_0x7384b4){return setupLoggers(_0x7384b4)[_0x980e('0x8')](function(){_0x7384b4['use']('/api/users',require('./api/user'));_0x7384b4['use'](_0x980e('0x9'),require(_0x980e('0xa')));_0x7384b4[_0x980e('0xb')]('/api/voice/contexts',require(_0x980e('0xc')));_0x7384b4[_0x980e('0xb')](_0x980e('0xd'),require(_0x980e('0xe')));_0x7384b4[_0x980e('0xb')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x7384b4[_0x980e('0xb')]('/api/voice/queues',require(_0x980e('0xf')));_0x7384b4[_0x980e('0xb')](_0x980e('0x10'),require(_0x980e('0x11')));_0x7384b4[_0x980e('0xb')]('/api/screen/recordings',require(_0x980e('0x12')));_0x7384b4[_0x980e('0xb')](_0x980e('0x13'),require(_0x980e('0x14')));_0x7384b4[_0x980e('0xb')](_0x980e('0x15'),require(_0x980e('0x16')));_0x7384b4['use'](_0x980e('0x17'),require('./api/voiceCallReport'));_0x7384b4['use']('/api/voice/dials/reports',require(_0x980e('0x18')));_0x7384b4['use'](_0x980e('0x19'),require(_0x980e('0x1a')));_0x7384b4[_0x980e('0xb')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x7384b4[_0x980e('0xb')](_0x980e('0x1b'),require(_0x980e('0x1c')));_0x7384b4['use'](_0x980e('0x1d'),require('./api/trunk'));_0x7384b4[_0x980e('0xb')](_0x980e('0x1e'),require(_0x980e('0x1f')));_0x7384b4['use'](_0x980e('0x20'),require(_0x980e('0x21')));_0x7384b4[_0x980e('0xb')](_0x980e('0x22'),require(_0x980e('0x23')));_0x7384b4[_0x980e('0xb')](_0x980e('0x24'),require(_0x980e('0x25')));_0x7384b4[_0x980e('0xb')](_0x980e('0x26'),require('./api/mailSubstatus'));_0x7384b4[_0x980e('0xb')](_0x980e('0x27'),require('./api/mailInteraction'));_0x7384b4[_0x980e('0xb')](_0x980e('0x28'),require(_0x980e('0x29')));_0x7384b4[_0x980e('0xb')]('/api/mail/applications',require(_0x980e('0x2a')));_0x7384b4['use']('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x7384b4[_0x980e('0xb')](_0x980e('0x2b'),require(_0x980e('0x2c')));_0x7384b4[_0x980e('0xb')]('/api/dashboards/items',require('./api/dashboardItem'));_0x7384b4[_0x980e('0xb')](_0x980e('0x2d'),require(_0x980e('0x2e')));_0x7384b4[_0x980e('0xb')](_0x980e('0x2f'),require(_0x980e('0x30')));_0x7384b4['use']('/api/fax/interactions',require(_0x980e('0x31')));_0x7384b4[_0x980e('0xb')]('/api/fax/messages',require(_0x980e('0x32')));_0x7384b4['use'](_0x980e('0x33'),require(_0x980e('0x34')));_0x7384b4[_0x980e('0xb')](_0x980e('0x35'),require(_0x980e('0x36')));_0x7384b4[_0x980e('0xb')](_0x980e('0x37'),require(_0x980e('0x38')));_0x7384b4[_0x980e('0xb')](_0x980e('0x39'),require(_0x980e('0x3a')));_0x7384b4[_0x980e('0xb')](_0x980e('0x3b'),require(_0x980e('0x3c')));_0x7384b4[_0x980e('0xb')](_0x980e('0x3d'),require(_0x980e('0x3e')));_0x7384b4[_0x980e('0xb')](_0x980e('0x3f'),require('./api/smsQueue'));_0x7384b4[_0x980e('0xb')]('/api/openchannel/accounts',require(_0x980e('0x40')));_0x7384b4[_0x980e('0xb')](_0x980e('0x41'),require(_0x980e('0x42')));_0x7384b4['use'](_0x980e('0x43'),require(_0x980e('0x44')));_0x7384b4[_0x980e('0xb')](_0x980e('0x45'),require(_0x980e('0x46')));_0x7384b4[_0x980e('0xb')]('/api/openchannel/queues',require(_0x980e('0x47')));_0x7384b4[_0x980e('0xb')](_0x980e('0x48'),require(_0x980e('0x49')));_0x7384b4[_0x980e('0xb')](_0x980e('0x4a'),require(_0x980e('0x4b')));_0x7384b4['use'](_0x980e('0x4c'),require(_0x980e('0x4d')));_0x7384b4[_0x980e('0xb')](_0x980e('0x4e'),require('./api/chatInteraction'));_0x7384b4[_0x980e('0xb')](_0x980e('0x4f'),require(_0x980e('0x50')));_0x7384b4['use']('/api/chat/offline_messages',require(_0x980e('0x51')));_0x7384b4[_0x980e('0xb')](_0x980e('0x52'),require('./api/chatQueue'));_0x7384b4[_0x980e('0xb')](_0x980e('0x53'),require(_0x980e('0x54')));_0x7384b4[_0x980e('0xb')](_0x980e('0x55'),require(_0x980e('0x56')));_0x7384b4['use']('/api/cm/companies',require('./api/cmCompany'));_0x7384b4[_0x980e('0xb')](_0x980e('0x57'),require(_0x980e('0x58')));_0x7384b4[_0x980e('0xb')](_0x980e('0x59'),require(_0x980e('0x5a')));_0x7384b4[_0x980e('0xb')](_0x980e('0x5b'),require('./api/cmHopperBlack'));_0x7384b4[_0x980e('0xb')](_0x980e('0x5c'),require('./api/cmHopperFinal'));_0x7384b4[_0x980e('0xb')](_0x980e('0x5d'),require(_0x980e('0x5e')));_0x7384b4[_0x980e('0xb')](_0x980e('0x5f'),require(_0x980e('0x60')));_0x7384b4[_0x980e('0xb')]('/api/actions',require('./api/action'));_0x7384b4[_0x980e('0xb')](_0x980e('0x61'),require('./api/automation'));_0x7384b4[_0x980e('0xb')]('/api/canned_answers',require(_0x980e('0x62')));_0x7384b4[_0x980e('0xb')](_0x980e('0x63'),require(_0x980e('0x64')));_0x7384b4[_0x980e('0xb')](_0x980e('0x65'),require(_0x980e('0x66')));_0x7384b4[_0x980e('0xb')](_0x980e('0x67'),require('./api/interval'));_0x7384b4[_0x980e('0xb')](_0x980e('0x68'),require(_0x980e('0x69')));_0x7384b4[_0x980e('0xb')](_0x980e('0x6a'),require(_0x980e('0x6b')));_0x7384b4[_0x980e('0xb')](_0x980e('0x6c'),require(_0x980e('0x6d')));_0x7384b4['use'](_0x980e('0x6e'),require(_0x980e('0x6f')));_0x7384b4['use'](_0x980e('0x70'),require(_0x980e('0x71')));_0x7384b4[_0x980e('0xb')](_0x980e('0x72'),require(_0x980e('0x73')));_0x7384b4['use'](_0x980e('0x74'),require(_0x980e('0x75')));_0x7384b4[_0x980e('0xb')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x7384b4[_0x980e('0xb')](_0x980e('0x76'),require('./api/cmHopperAdditionalPhone'));_0x7384b4[_0x980e('0xb')]('/api/templates',require(_0x980e('0x77')));_0x7384b4[_0x980e('0xb')](_0x980e('0x78'),require(_0x980e('0x79')));_0x7384b4[_0x980e('0xb')](_0x980e('0x7a'),require(_0x980e('0x7b')));_0x7384b4[_0x980e('0xb')](_0x980e('0x7c'),require(_0x980e('0x7d')));_0x7384b4[_0x980e('0xb')](_0x980e('0x7e'),require(_0x980e('0x7f')));_0x7384b4[_0x980e('0xb')](_0x980e('0x80'),require(_0x980e('0x81')));_0x7384b4['use']('/api/analytics/default_reports',require(_0x980e('0x82')));_0x7384b4['use']('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x7384b4['use'](_0x980e('0x83'),require(_0x980e('0x84')));_0x7384b4['use']('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x7384b4[_0x980e('0xb')](_0x980e('0x85'),require('./api/analyticTreeReport'));_0x7384b4[_0x980e('0xb')]('/api/integrations/salesforce/accounts',require(_0x980e('0x86')));_0x7384b4[_0x980e('0xb')](_0x980e('0x87'),require('./api/intSalesforceConfiguration'));_0x7384b4[_0x980e('0xb')](_0x980e('0x88'),require(_0x980e('0x89')));_0x7384b4[_0x980e('0xb')](_0x980e('0x8a'),require(_0x980e('0x8b')));_0x7384b4[_0x980e('0xb')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x7384b4[_0x980e('0xb')](_0x980e('0x8c'),require(_0x980e('0x8d')));_0x7384b4['use'](_0x980e('0x8e'),require(_0x980e('0x8f')));_0x7384b4['use'](_0x980e('0x90'),require(_0x980e('0x91')));_0x7384b4[_0x980e('0xb')](_0x980e('0x92'),require(_0x980e('0x93')));_0x7384b4[_0x980e('0xb')](_0x980e('0x94'),require('./api/intZohoAccount'));_0x7384b4[_0x980e('0xb')](_0x980e('0x95'),require(_0x980e('0x96')));_0x7384b4[_0x980e('0xb')](_0x980e('0x97'),require('./api/intZohoField'));_0x7384b4[_0x980e('0xb')](_0x980e('0x98'),require(_0x980e('0x99')));_0x7384b4[_0x980e('0xb')](_0x980e('0x9a'),require(_0x980e('0x9b')));_0x7384b4['use'](_0x980e('0x9c'),require(_0x980e('0x9d')));_0x7384b4[_0x980e('0xb')](_0x980e('0x9e'),require(_0x980e('0x9f')));_0x7384b4['use'](_0x980e('0xa0'),require(_0x980e('0xa1')));_0x7384b4[_0x980e('0xb')](_0x980e('0xa2'),require('./api/intFreshdeskField'));_0x7384b4['use'](_0x980e('0xa3'),require(_0x980e('0xa4')));_0x7384b4['use'](_0x980e('0xa5'),require(_0x980e('0xa6')));_0x7384b4[_0x980e('0xb')](_0x980e('0xa7'),require('./api/intVtigerField'));_0x7384b4[_0x980e('0xb')](_0x980e('0xa8'),require(_0x980e('0xa9')));_0x7384b4[_0x980e('0xb')](_0x980e('0xaa'),require(_0x980e('0xab')));_0x7384b4[_0x980e('0xb')](_0x980e('0xac'),require('./api/intServicenowField'));_0x7384b4['use'](_0x980e('0xad'),require(_0x980e('0xae')));_0x7384b4[_0x980e('0xb')]('/api/integrations/dynamics365/configurations',require(_0x980e('0xaf')));_0x7384b4[_0x980e('0xb')]('/api/integrations/dynamics365/fields',require(_0x980e('0xb0')));_0x7384b4[_0x980e('0xb')](_0x980e('0xb1'),require('./api/intFreshsalesAccount'));_0x7384b4[_0x980e('0xb')](_0x980e('0xb2'),require(_0x980e('0xb3')));_0x7384b4[_0x980e('0xb')]('/api/integrations/freshsales/fields',require(_0x980e('0xb4')));_0x7384b4[_0x980e('0xb')](_0x980e('0xb5'),require(_0x980e('0xb6')));_0x7384b4[_0x980e('0xb')](_0x980e('0xb7'),require('./api/chatQueueReport'));_0x7384b4[_0x980e('0xb')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x7384b4[_0x980e('0xb')](_0x980e('0xb8'),require('./api/jscriptyAnswerReport'));_0x7384b4[_0x980e('0xb')](_0x980e('0xb9'),require(_0x980e('0xba')));_0x7384b4[_0x980e('0xb')](_0x980e('0xbb'),require(_0x980e('0xbc')));_0x7384b4[_0x980e('0xb')](_0x980e('0xbd'),require(_0x980e('0xbe')));_0x7384b4['use'](_0x980e('0xbf'),require(_0x980e('0xc0')));_0x7384b4[_0x980e('0xb')](_0x980e('0xc1'),require(_0x980e('0xc2')));_0x7384b4['use'](_0x980e('0xc3'),require(_0x980e('0xc4')));_0x7384b4[_0x980e('0xb')](_0x980e('0xc5'),require(_0x980e('0xc6')));_0x7384b4['use'](_0x980e('0xc7'),require('./api/squareOdbc'));_0x7384b4['use'](_0x980e('0xc8'),require(_0x980e('0xc9')));_0x7384b4[_0x980e('0xb')](_0x980e('0xca'),require(_0x980e('0xcb')));_0x7384b4[_0x980e('0xb')](_0x980e('0xcc'),require(_0x980e('0xcd')));_0x7384b4[_0x980e('0xb')](_0x980e('0xce'),require(_0x980e('0xcf')));_0x7384b4[_0x980e('0xb')](_0x980e('0xd0'),require(_0x980e('0xd1')));_0x7384b4['use']('/api/campaigns',require(_0x980e('0xd2')));_0x7384b4[_0x980e('0xb')](_0x980e('0xd3'),require('./api/migration'));_0x7384b4['use']('/api/attachments',require('./api/attachment'));_0x7384b4[_0x980e('0xb')](_0x980e('0xd4'),require('./api/plugin'));_0x7384b4[_0x980e('0xb')](_0x980e('0xd5'),require(_0x980e('0xd6')));_0x7384b4[_0x980e('0xb')](_0x980e('0xd7'),require(_0x980e('0xd8')));_0x7384b4[_0x980e('0xb')](_0x980e('0xd9'),require(_0x980e('0xda')));_0x7384b4['use'](_0x980e('0xdb'),require(_0x980e('0xdc')));_0x7384b4[_0x980e('0xb')]('/api/sms/reports/transfer',require(_0x980e('0xdd')));_0x7384b4['use'](_0x980e('0xde'),require(_0x980e('0xdf')));_0x7384b4['use']('/api/voice/prefixes',require(_0x980e('0xe0')));_0x7384b4[_0x980e('0xb')](_0x980e('0xe1'),require(_0x980e('0xe2')));_0x7384b4['use'](_0x980e('0xe3'),require(_0x980e('0xe4')));_0x7384b4['use'](_0x980e('0xe5'),require('./api/userProfileResource'));_0x7384b4[_0x980e('0xb')](_0x980e('0xe6'),require(_0x980e('0xe7')));_0x7384b4['use'](_0x980e('0xe8'),require(_0x980e('0xe9')));_0x7384b4[_0x980e('0xb')](_0x980e('0xea'),require(_0x980e('0xeb')));_0x7384b4['use']('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x7384b4[_0x980e('0xb')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x7384b4['use'](_0x980e('0xec'),require(_0x980e('0xed')));_0x7384b4[_0x980e('0xb')](_0x980e('0xee'),require(_0x980e('0xef')));_0x7384b4[_0x980e('0xb')](_0x980e('0xf0'),require(_0x980e('0xf1')));_0x7384b4['use']('/api/cloudProviders',require(_0x980e('0xf2')));_0x7384b4[_0x980e('0xb')]('/api/realtime',require('./api/realtime'));_0x7384b4['use']('/api/user-settings',require('./api/user-setting'));_0x7384b4[_0x980e('0xb')](_0x980e('0xf3'),require(_0x980e('0xf4')));_0x7384b4[_0x980e('0xb')](_0x980e('0xf5'),require(_0x980e('0xf6')));_0x7384b4[_0x980e('0xb')](_0x980e('0xf7'),require(_0x980e('0xf8')));_0x7384b4[_0x980e('0xb')](_0x980e('0xf9'),require(_0x980e('0xfa')));_0x7384b4[_0x980e('0xb')](_0x980e('0xfb'),require(_0x980e('0xfc')));_0x7384b4[_0x980e('0xb')]('/api/version',require('./api/version'));_0x7384b4['use']('/api/system',require(_0x980e('0xfd')));_0x7384b4[_0x980e('0xb')](_0x980e('0xfe'),require(_0x980e('0xff')));_0x7384b4['use']('/api/webbar',require(_0x980e('0x100')));_0x7384b4[_0x980e('0xb')](_0x980e('0x101'),clientSideLogs);_0x7384b4[_0x980e('0xb')](_0x980e('0x102'),express[_0x980e('0x103')](path[_0x980e('0x104')](config[_0x980e('0x105')],_0x980e('0x102'))));_0x7384b4[_0x980e('0xb')](_0x980e('0x106'),express['static'](path['join'](config[_0x980e('0x105')],_0x980e('0x106'))));_0x7384b4[_0x980e('0xb')](_0x980e('0x107'),express[_0x980e('0x103')](path['join'](config[_0x980e('0x105')],_0x980e('0x107'))));_0x7384b4['use'](_0x980e('0x108'),express[_0x980e('0x103')](path['join'](config[_0x980e('0x105')],_0x980e('0x109'),'3.0.0')));_0x7384b4[_0x980e('0xb')](_0x980e('0x10a'),express[_0x980e('0x103')](path[_0x980e('0x104')](config[_0x980e('0x105')],_0x980e('0x10b'))));_0x7384b4[_0x980e('0x10c')](_0x980e('0x10d'))[_0x980e('0x10e')](errors[0x194]);_0x7384b4[_0x980e('0x10c')]('/*')[_0x980e('0x10e')](function(_0x50a972,_0x5ecfc5){_0x5ecfc5[_0x980e('0x10f')](path[_0x980e('0x110')](_0x7384b4['get']('appPath')+_0x980e('0x111')));});return _0x7384b4;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ce6858f..57730e4 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x288b=['../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.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/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x288b,0x6f));var _0xb288=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x288b[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xb288('0x0'));var _=require(_0xb288('0x1'));var config=require(_0xb288('0x2'));exports[_0xb288('0x3')]=function(){return new Promise(function(_0xebdd4b,_0x462beb){var _0x483982={};_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x5')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x6')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x7')));_0x483982=_['merge'](_0x483982,require('../api/voiceRecording/voiceRecording.rpc'));_0x483982=_['merge'](_0x483982,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x8')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x9')));_0x483982=_['merge'](_0x483982,require(_0xb288('0xa')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0xb')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0xc')));_0x483982=_['merge'](_0x483982,require(_0xb288('0xd')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0xe')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0xf')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x10')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/mailMessage/mailMessage.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x11')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x12')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x13')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x14')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x15')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/faxMessage/faxMessage.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/faxQueue/faxQueue.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x16')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/smsAccount/smsAccount.rpc'));_0x483982=_['merge'](_0x483982,require(_0xb288('0x17')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x18')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x19')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x1a')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x1b')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x1c')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x1d')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x1e')));_0x483982=_['merge'](_0x483982,require('../api/chatMessage/chatMessage.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x1f')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x20')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x21')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x22')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x23')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x24')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x25')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x26')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x27')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x28')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x29')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x2a')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x2b')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x2c')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x2d')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x2e')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x2f')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x30')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x31')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x32')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x33')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x34')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x35')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x36')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x37')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x38')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/squareOdbc/squareOdbc.rpc'));_0x483982=_['merge'](_0x483982,require('../api/squareProject/squareProject.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x39')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x3a')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x3b')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x3c')));_0x483982=_[_0xb288('0x4')](_0x483982,require('../api/plugin/plugin.rpc'));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x3d')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x3e')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x3f')));_0x483982=_[_0xb288('0x4')](_0x483982,require(_0xb288('0x40')));_0x483982=_['merge'](_0x483982,require(_0xb288('0x41')));var _0x3fc532=jayson[_0xb288('0x42')](_0x483982)[_0xb288('0x43')]();var _0x5c4de7=config[_0xb288('0x44')][_0xb288('0x45')]||config[_0xb288('0x45')]+0x1;var _0x112098=config[_0xb288('0x44')]['ip']||'localhost';_0x3fc532['on'](_0xb288('0x46'),function(_0x51a34a){return _0x462beb(_0x51a34a);});_0x3fc532[_0xb288('0x3')](_0x5c4de7,_0x112098,function(){console['log'](_0xb288('0x47'),_0x112098,_0x5c4de7);require(_0xb288('0x48'))[_0xb288('0x49')]();return _0xebdd4b(_0xb288('0x4a')+_0x112098+':'+_0x5c4de7);});});}; \ No newline at end of file +var _0x5556=['../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc'];(function(_0x14b7a2,_0x2ab4e2){var _0x37aa51=function(_0x3f3fec){while(--_0x3f3fec){_0x14b7a2['push'](_0x14b7a2['shift']());}};_0x37aa51(++_0x2ab4e2);}(_0x5556,0x138));var _0x6555=function(_0x4142b1,_0x1119af){_0x4142b1=_0x4142b1-0x0;var _0x346210=_0x5556[_0x4142b1];return _0x346210;};'use strict';var jayson=require(_0x6555('0x0'));var _=require(_0x6555('0x1'));var config=require(_0x6555('0x2'));exports['listen']=function(){return new Promise(function(_0x5b1fd5,_0x4e97a7){var _0x196c54={};_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/user/user.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x4')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x5')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x6')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x7')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x8')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x9')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/memberReport/memberReport.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/trunk/trunk.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0xa')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0xb')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/mailAccount/mailAccount.rpc'));_0x196c54=_['merge'](_0x196c54,require(_0x6555('0xc')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0xd')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0xe')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/mailApplication/mailApplication.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0xf')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x10')));_0x196c54=_['merge'](_0x196c54,require(_0x6555('0x11')));_0x196c54=_['merge'](_0x196c54,require(_0x6555('0x12')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/faxMessage/faxMessage.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x13')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x14')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x15')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x16')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x17')));_0x196c54=_['merge'](_0x196c54,require(_0x6555('0x18')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x19')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x1a')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x1b')));_0x196c54=_['merge'](_0x196c54,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/chatInteraction/chatInteraction.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x1c')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x1d')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x1e')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x1f')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x20')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x21')));_0x196c54=_['merge'](_0x196c54,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x22')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x23')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x24')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x25')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x26')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x27')));_0x196c54=_['merge'](_0x196c54,require(_0x6555('0x28')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x29')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x2a')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x2b')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x2c')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x2d')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x2e')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x2f')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x30')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x31')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x32')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x33')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x34')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x35')));_0x196c54=_['merge'](_0x196c54,require('../api/squareRecording/squareRecording.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x36')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x37')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/attachment/attachment.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/plugin/plugin.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x196c54=_['merge'](_0x196c54,require(_0x6555('0x38')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x39')));_0x196c54=_[_0x6555('0x3')](_0x196c54,require(_0x6555('0x3a')));var _0x5b9b1b=jayson[_0x6555('0x3b')](_0x196c54)[_0x6555('0x3c')]();var _0x241b3f=config[_0x6555('0x3d')]['port']||config['port']+0x1;var _0xb06e28=config['rpc']['ip']||'localhost';_0x5b9b1b['on'](_0x6555('0x3e'),function(_0x5efe91){return _0x4e97a7(_0x5efe91);});_0x5b9b1b['listen'](_0x241b3f,_0xb06e28,function(){console[_0x6555('0x3f')](_0x6555('0x40'),_0xb06e28,_0x241b3f);require(_0x6555('0x41'))[_0x6555('0x42')]();return _0x5b1fd5('RPC\x20listening\x20on\x20'+_0xb06e28+':'+_0x241b3f);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index d511cd6..5115394 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 _0xeb37=['GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','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','agi','AGI','WAIT','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','prototype','sendRequest','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','extension'];(function(_0x141674,_0xf9461f){var _0xe57f8d=function(_0x7cc11a){while(--_0x7cc11a){_0x141674['push'](_0x141674['shift']());}};_0xe57f8d(++_0xf9461f);}(_0xeb37,0x1ad));var _0x7eb3=function(_0x2441f4,_0x9a11dd){_0x2441f4=_0x2441f4-0x0;var _0xb80097=_0xeb37[_0x2441f4];return _0xb80097;};'use strict';var util=require(_0x7eb3('0x0'));var _=require(_0x7eb3('0x1'));var EventEmitter=require(_0x7eb3('0x2'))[_0x7eb3('0x3')];var AGIReply=require(_0x7eb3('0x4'));var AGIError=require(_0x7eb3('0x5'));function AGIChannel(_0x6fb87c){var _0x3757e3=this,_0x394cfb=new AGIReply(),_0x53b35d=![],_0x182117={};EventEmitter[_0x7eb3('0x6')](_0x3757e3);_0x6fb87c[_0x7eb3('0x7')]('utf8');_0x6fb87c['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x394cfb[_0x7eb3('0x7')](_0x7eb3('0x8'));_0x394cfb['on'](_0x7eb3('0x9'),function(_0x3e37ff){for(var _0xd3c9f in _0x3e37ff){_0x3757e3[_0xd3c9f]=_0x3e37ff[_0xd3c9f];}_0x3757e3['emit'](_0x7eb3('0xa'));});_0x394cfb['on'](_0x7eb3('0xb'),function(_0x7dc04){if(_0x7dc04[_0x7eb3('0xc')]()==_0x7eb3('0xd')){_0x3757e3[_0x7eb3('0xe')](_0x7eb3('0xd'));return;}if(_0x7dc04[_0x7eb3('0xf')](0x0,0xb)==_0x7eb3('0x10')){_0x53b35d=!![];}if(_0x53b35d){_0x182117['rx']+=_0x7dc04+'\x0a';if(_0x7dc04[_0x7eb3('0x11')](_0x7eb3('0x12'))!=-0x1){_0x53b35d=![];}}else{_0x182117['rx']=_0x7dc04;}if(_0x53b35d){return;}if(typeof _0x182117['cb']==_0x7eb3('0x13')){var _0x374e0a=_0x182117['rx']['substring'](0x0,0x3),_0x4a7cf1=null,_0x39d6cc=null;_0x374e0a=parseInt(_0x374e0a);if(isNaN(_0x374e0a)){_0x182117['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x7eb3('0x14')});return;}if(_0x374e0a!=0xc8){_0x182117['cb'](null,{'code':_0x374e0a,'result':-0x1,'extra':'KO'});return;}_0x4a7cf1=_0x182117['rx'][_0x7eb3('0xf')](0x4)[_0x7eb3('0x15')](_0x7eb3('0x16'),'');if(_0x4a7cf1['indexOf']('\x20')!=-0x1){_0x4a7cf1=_0x4a7cf1[_0x7eb3('0x17')](0x0,_0x4a7cf1[_0x7eb3('0x18')]('\x20'));}if(_[_0x7eb3('0x19')](_0x4a7cf1,'-1')){_0x4a7cf1=parseInt(_0x4a7cf1);}_0x39d6cc=_0x182117['rx'][_0x7eb3('0x1a')]('\x20');if(_0x39d6cc[_0x7eb3('0x1b')]==0x3){_0x39d6cc=_0x39d6cc[0x2][_0x7eb3('0xf')](0x1,_0x39d6cc[0x2]['length']-0x1);}else if(_0x39d6cc['length']>0x3){var _0x43b86e=/\((.+)\)/;var _0x264ecb=_0x182117['rx'][_0x7eb3('0x1c')](_0x43b86e);if(_0x264ecb){_0x39d6cc=_0x264ecb[0x1];}else{_0x39d6cc=null;}}else{_0x39d6cc=null;}_0x182117['cb'](null,{'code':_0x374e0a,'result':_0x4a7cf1,'extra':_0x39d6cc});}});_0x6fb87c['on']('error',function(_0x262ef9){_0x3757e3[_0x7eb3('0xe')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x262ef9['code']));});_0x6fb87c['on'](_0x7eb3('0x1d'),function(){_0x3757e3[_0x7eb3('0xe')](_0x7eb3('0x1d'),new AGIError(_0x7eb3('0x1e')));});_0x6fb87c['on'](_0x7eb3('0x1f'),function(){_0x3757e3['emit'](_0x7eb3('0x1f'),new AGIError(_0x7eb3('0x20')));_0x6fb87c['destroy']();});_0x6fb87c[_0x7eb3('0x21')](_0x394cfb);this[_0x7eb3('0x22')]=function(_0x3a81ee,_0x5b00d5){var _0x3a81ee=_0x3a81ee||'',_0x5b00d5=typeof _0x5b00d5==_0x7eb3('0x13')?_0x5b00d5:new Function();_0x182117={'tx':_0x3a81ee,'rx':'','cb':_0x5b00d5};_0x6fb87c[_0x7eb3('0x23')](_0x3a81ee+'\x0a');},this[_0x7eb3('0x1d')]=function(){_0x6fb87c[_0x7eb3('0x24')]();};}util[_0x7eb3('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x27')]=function(_0xc76a5b){return this[_0x7eb3('0x22')][_0x7eb3('0x28')](this,_0xc76a5b);};AGIChannel[_0x7eb3('0x26')]['answer']=function(){return this[_0x7eb3('0x27')](_0x7eb3('0x29'));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x2a')]=function(_0x48614d,_0x44a4b6,_0xa4d1a){_0x48614d=_0x48614d===undefined?_0x7eb3('0x2b'):_0x48614d;_0x44a4b6=_0x44a4b6===undefined?'5':_0x44a4b6;_0xa4d1a=_0xa4d1a===undefined?'1':_0xa4d1a;return this[_0x7eb3('0x27')](util[_0x7eb3('0x2c')](_0x7eb3('0x2d'),_0x48614d,_0x44a4b6*0x3e8,_0xa4d1a));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x2e')]=function(_0x2a367d){_0x2a367d=_0x2a367d||_0x7eb3('0x2f');return this[_0x7eb3('0x27')](util['format']('VERBOSE\x20\x22%s\x22',_0x2a367d));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x30')]=function(_0x33a643,_0x44430b){if(_[_0x7eb3('0x31')](_0x44430b)){return this[_0x7eb3('0x27')](util[_0x7eb3('0x2c')](_0x7eb3('0x32'),_0x33a643,_0x44430b[_0x7eb3('0x33')](',')));}return this[_0x7eb3('0x27')](util['format'](_0x7eb3('0x32'),_0x33a643,_0x44430b));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x34')]=function(_0x3b252d){return this[_0x7eb3('0x27')](util[_0x7eb3('0x2c')](_0x7eb3('0x35'),_0x3b252d));};AGIChannel['prototype'][_0x7eb3('0x36')]=function(_0x5a8dd1){return this[_0x7eb3('0x27')](util['format'](_0x7eb3('0x37'),_0x5a8dd1));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x38')]=function(_0x4b16bf){return this[_0x7eb3('0x27')](util['format'](_0x7eb3('0x39'),_0x4b16bf));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0xd')]=function(){return this[_0x7eb3('0x27')](_0x7eb3('0x3a'));};AGIChannel['prototype'][_0x7eb3('0x3b')]=function(_0x58834c,_0x47bf72){var _0x186427=_[_0x7eb3('0x3c')](_0x47bf72)||_[_0x7eb3('0x3d')](_0x47bf72)?_0x47bf72[_0x7eb3('0x3e')]():_0x47bf72;return this[_0x7eb3('0x27')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x58834c,_0x186427?_0x186427[_0x7eb3('0x3e')]()[_0x7eb3('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x3f')]=function(_0x1d0878,_0x3f8685){return this['sendRequest'](util[_0x7eb3('0x2c')](_0x7eb3('0x40'),_0x1d0878,_0x3f8685));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x41')]=function(_0x14ce30,_0x2adf88){return this['sendRequest'](util[_0x7eb3('0x2c')](_0x7eb3('0x42'),_0x14ce30,_0x2adf88));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x43')]=function(_0x19cb1f,_0x4f9edd){return this[_0x7eb3('0x27')](util[_0x7eb3('0x2c')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x19cb1f,_0x4f9edd));};AGIChannel[_0x7eb3('0x26')]['continueAt']=function(_0xc7846c,_0x4de3a4,_0x6353e7){_0x4de3a4=_0x4de3a4||this[_0x7eb3('0x44')];_0x6353e7=_0x6353e7||0x1;this[_0x7eb3('0x34')](_0xc7846c);this[_0x7eb3('0x36')](_0x4de3a4);this[_0x7eb3('0x38')](_0x6353e7);return this['noop'](util[_0x7eb3('0x2c')](_0x7eb3('0x45'),_0xc7846c,_0x4de3a4,_0x6353e7));};AGIChannel['prototype'][_0x7eb3('0x46')]=function(_0x1f7a10){return this[_0x7eb3('0x27')](util['format'](_0x7eb3('0x47'),_0x1f7a10));};AGIChannel['prototype'][_0x7eb3('0x48')]=function(_0x53c6aa,_0x475a13,_0x19c221,_0x25a665,_0x292b84,_0x576cc8){_0x475a13=_0x475a13||_0x7eb3('0x49');_0x19c221=_0x19c221||'';_0x25a665=_0x25a665===undefined?-0x1:_0x25a665==='-1'?-0x1:_0x25a665*0x3e8;_0x292b84=_0x292b84===undefined?'':'s='+_0x292b84;_0x576cc8=_0x576cc8?_0x7eb3('0x4a'):'';return this['sendRequest'](util[_0x7eb3('0x2c')](_0x7eb3('0x4b'),_0x53c6aa,_0x475a13,_0x19c221,_0x25a665,_0x576cc8,_0x292b84));};AGIChannel[_0x7eb3('0x26')][_0x7eb3('0x4c')]=function(_0xe3d8f,_0x1e8cde){_0x1e8cde=_0x1e8cde||'';return this[_0x7eb3('0x27')](util[_0x7eb3('0x2c')](_0x7eb3('0x4d'),_0xe3d8f,_0x1e8cde));};AGIChannel['prototype'][_0x7eb3('0x4e')]=function(_0x547d27){return this['exec'](_0x7eb3('0x4f'),_0x547d27);};AGIChannel[_0x7eb3('0x26')]['wait']=function(_0x76f81b){return this[_0x7eb3('0x30')](_0x7eb3('0x50'),_0x76f81b);};AGIChannel[_0x7eb3('0x26')]['error']=function(_0x41de40,_0x1feec5){this[_0x7eb3('0x2e')](util[_0x7eb3('0x2c')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x41de40['id'],_0x41de40[_0x7eb3('0x51')],_0x1feec5));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7eb3('0x52')]=AGIChannel; \ No newline at end of file +var _0x9a55=['wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','line','toLowerCase','hangup','emit','substring','520-Invalid','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command','write','inherits','sendRequest','sync','ANSWER','getData','beep','format','NO\x20MESSAGE','prototype','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI'];(function(_0x3a351d,_0x5bb577){var _0x370d12=function(_0x45d07a){while(--_0x45d07a){_0x3a351d['push'](_0x3a351d['shift']());}};_0x370d12(++_0x5bb577);}(_0x9a55,0xe2));var _0x59a5=function(_0x5cac07,_0x2c7376){_0x5cac07=_0x5cac07-0x0;var _0x3e7521=_0x9a55[_0x5cac07];return _0x3e7521;};'use strict';var util=require(_0x59a5('0x0'));var _=require('lodash');var EventEmitter=require(_0x59a5('0x1'))[_0x59a5('0x2')];var AGIReply=require(_0x59a5('0x3'));var AGIError=require('./error');function AGIChannel(_0x19812d){var _0x5856df=this,_0x55e665=new AGIReply(),_0x1a360b=![],_0x4d8e03={};EventEmitter[_0x59a5('0x4')](_0x5856df);_0x19812d[_0x59a5('0x5')](_0x59a5('0x6'));_0x19812d[_0x59a5('0x7')](0x8*0x3c*0x3c*0x3e8);_0x55e665[_0x59a5('0x5')]('utf8');_0x55e665['on']('headers',function(_0x299dfa){for(var _0x481be7 in _0x299dfa){_0x5856df[_0x481be7]=_0x299dfa[_0x481be7];}_0x5856df['emit']('ready');});_0x55e665['on'](_0x59a5('0x8'),function(_0x528959){if(_0x528959[_0x59a5('0x9')]()==_0x59a5('0xa')){_0x5856df[_0x59a5('0xb')](_0x59a5('0xa'));return;}if(_0x528959[_0x59a5('0xc')](0x0,0xb)==_0x59a5('0xd')){_0x1a360b=!![];}if(_0x1a360b){_0x4d8e03['rx']+=_0x528959+'\x0a';if(_0x528959['search']('520\x20End\x20of\x20proper')!=-0x1){_0x1a360b=![];}}else{_0x4d8e03['rx']=_0x528959;}if(_0x1a360b){return;}if(typeof _0x4d8e03['cb']==_0x59a5('0xe')){var _0x427a03=_0x4d8e03['rx'][_0x59a5('0xc')](0x0,0x3),_0x72199=null,_0x324a86=null;_0x427a03=parseInt(_0x427a03);if(isNaN(_0x427a03)){_0x4d8e03['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x59a5('0xf')});return;}if(_0x427a03!=0xc8){_0x4d8e03['cb'](null,{'code':_0x427a03,'result':-0x1,'extra':'KO'});return;}_0x72199=_0x4d8e03['rx'][_0x59a5('0xc')](0x4)[_0x59a5('0x10')]('result=','');if(_0x72199[_0x59a5('0x11')]('\x20')!=-0x1){_0x72199=_0x72199[_0x59a5('0x12')](0x0,_0x72199[_0x59a5('0x11')]('\x20'));}if(_[_0x59a5('0x13')](_0x72199,'-1')){_0x72199=parseInt(_0x72199);}_0x324a86=_0x4d8e03['rx'][_0x59a5('0x14')]('\x20');if(_0x324a86[_0x59a5('0x15')]==0x3){_0x324a86=_0x324a86[0x2][_0x59a5('0xc')](0x1,_0x324a86[0x2][_0x59a5('0x15')]-0x1);}else if(_0x324a86[_0x59a5('0x15')]>0x3){var _0x58c0a9=/\((.+)\)/;var _0x3497ac=_0x4d8e03['rx'][_0x59a5('0x16')](_0x58c0a9);if(_0x3497ac){_0x324a86=_0x3497ac[0x1];}else{_0x324a86=null;}}else{_0x324a86=null;}_0x4d8e03['cb'](null,{'code':_0x427a03,'result':_0x72199,'extra':_0x324a86});}});_0x19812d['on'](_0x59a5('0x17'),function(_0x44ef9a){_0x5856df['emit'](_0x59a5('0x17'),new AGIError(_0x59a5('0x18'),_0x44ef9a[_0x59a5('0x19')]));});_0x19812d['on'](_0x59a5('0x1a'),function(){_0x5856df[_0x59a5('0xb')]('close',new AGIError(_0x59a5('0x1b')));});_0x19812d['on'](_0x59a5('0x1c'),function(){_0x5856df[_0x59a5('0xb')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x19812d[_0x59a5('0x1d')]();});_0x19812d['pipe'](_0x55e665);this[_0x59a5('0x1e')]=function(_0x2c7b16,_0x2ab3e1){var _0x2c7b16=_0x2c7b16||'',_0x2ab3e1=typeof _0x2ab3e1==_0x59a5('0xe')?_0x2ab3e1:new Function();_0x4d8e03={'tx':_0x2c7b16,'rx':'','cb':_0x2ab3e1};_0x19812d[_0x59a5('0x1f')](_0x2c7b16+'\x0a');},this[_0x59a5('0x1a')]=function(){_0x19812d[_0x59a5('0x1d')]();};}util[_0x59a5('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x59a5('0x21')]=function(_0x71ae61){return this[_0x59a5('0x1e')][_0x59a5('0x22')](this,_0x71ae61);};AGIChannel['prototype']['answer']=function(){return this[_0x59a5('0x21')](_0x59a5('0x23'));};AGIChannel['prototype'][_0x59a5('0x24')]=function(_0x4e43cd,_0x2f4aa3,_0x464722){_0x4e43cd=_0x4e43cd===undefined?_0x59a5('0x25'):_0x4e43cd;_0x2f4aa3=_0x2f4aa3===undefined?'5':_0x2f4aa3;_0x464722=_0x464722===undefined?'1':_0x464722;return this[_0x59a5('0x21')](util[_0x59a5('0x26')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4e43cd,_0x2f4aa3*0x3e8,_0x464722));};AGIChannel['prototype']['noop']=function(_0x456049){_0x456049=_0x456049||_0x59a5('0x27');return this['sendRequest'](util['format']('VERBOSE\x20\x22%s\x22',_0x456049));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x29')]=function(_0x549718,_0x39da62){if(_[_0x59a5('0x2a')](_0x39da62)){return this[_0x59a5('0x21')](util[_0x59a5('0x26')](_0x59a5('0x2b'),_0x549718,_0x39da62[_0x59a5('0x2c')](',')));}return this[_0x59a5('0x21')](util['format'](_0x59a5('0x2b'),_0x549718,_0x39da62));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x2d')]=function(_0x56c35f){return this['sendRequest'](util[_0x59a5('0x26')](_0x59a5('0x2e'),_0x56c35f));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x2f')]=function(_0x176435){return this[_0x59a5('0x21')](util[_0x59a5('0x26')]('SET\x20EXTENSION\x20%s',_0x176435));};AGIChannel[_0x59a5('0x28')]['setPriority']=function(_0x3f4df5){return this[_0x59a5('0x21')](util['format'](_0x59a5('0x30'),_0x3f4df5));};AGIChannel[_0x59a5('0x28')]['hangup']=function(){return this[_0x59a5('0x21')](_0x59a5('0x31'));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x32')]=function(_0x32154a,_0x1c78b8){var _0x584962=_[_0x59a5('0x33')](_0x1c78b8)||_[_0x59a5('0x34')](_0x1c78b8)?_0x1c78b8[_0x59a5('0x35')]():_0x1c78b8;return this[_0x59a5('0x21')](util['format'](_0x59a5('0x36'),_0x32154a,_0x584962?_0x584962[_0x59a5('0x35')]()[_0x59a5('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x59a5('0x28')]['sayNumber']=function(_0x4219d2,_0x3639dc){return this[_0x59a5('0x21')](util[_0x59a5('0x26')](_0x59a5('0x37'),_0x4219d2,_0x3639dc));};AGIChannel['prototype'][_0x59a5('0x38')]=function(_0x36afce,_0xab0cfa){return this['sendRequest'](util[_0x59a5('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x36afce,_0xab0cfa));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x39')]=function(_0x4afb12,_0x2b7848){return this[_0x59a5('0x21')](util[_0x59a5('0x26')](_0x59a5('0x3a'),_0x4afb12,_0x2b7848));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x3b')]=function(_0x3d45d3,_0x1fd9c8,_0x2766ce){_0x1fd9c8=_0x1fd9c8||this[_0x59a5('0x3c')];_0x2766ce=_0x2766ce||0x1;this[_0x59a5('0x2d')](_0x3d45d3);this[_0x59a5('0x2f')](_0x1fd9c8);this['setPriority'](_0x2766ce);return this[_0x59a5('0x3d')](util[_0x59a5('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x3d45d3,_0x1fd9c8,_0x2766ce));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x3e')]=function(_0x5169e3){return this['sendRequest'](util[_0x59a5('0x26')](_0x59a5('0x3f'),_0x5169e3));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x40')]=function(_0x2c8830,_0x36d08b,_0xb2993,_0x57fb0e,_0x7d826,_0x469070){_0x36d08b=_0x36d08b||'wav';_0xb2993=_0xb2993||'';_0x57fb0e=_0x57fb0e===undefined?-0x1:_0x57fb0e==='-1'?-0x1:_0x57fb0e*0x3e8;_0x7d826=_0x7d826===undefined?'':'s='+_0x7d826;_0x469070=_0x469070?_0x59a5('0x41'):'';return this[_0x59a5('0x21')](util[_0x59a5('0x26')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2c8830,_0x36d08b,_0xb2993,_0x57fb0e,_0x469070,_0x7d826));};AGIChannel['prototype'][_0x59a5('0x42')]=function(_0x34060b,_0xa5cd67){_0xa5cd67=_0xa5cd67||'';return this[_0x59a5('0x21')](util[_0x59a5('0x26')](_0x59a5('0x43'),_0x34060b,_0xa5cd67));};AGIChannel[_0x59a5('0x28')][_0x59a5('0x44')]=function(_0x56867a){return this['exec'](_0x59a5('0x45'),_0x56867a);};AGIChannel[_0x59a5('0x28')][_0x59a5('0x46')]=function(_0x5cf228){return this[_0x59a5('0x29')](_0x59a5('0x47'),_0x5cf228);};AGIChannel[_0x59a5('0x28')][_0x59a5('0x17')]=function(_0x4eb213,_0x8dab8e){this[_0x59a5('0x3d')](util[_0x59a5('0x26')](_0x59a5('0x48'),_0x4eb213['id'],_0x4eb213[_0x59a5('0x49')],_0x8dab8e));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 ab1c897..7bffd65 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 _0x6804=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6804,0x1dc));var _0x4680=function(_0x4ee4fa,_0x145c14){_0x4ee4fa=_0x4ee4fa-0x0;var _0x32d427=_0x6804[_0x4ee4fa];return _0x32d427;};'use strict';var util=require(_0x4680('0x0'));var error={'E_AGI_UNDEFINED':_0x4680('0x1'),'E_AGI_ARGUMENT_PORT':_0x4680('0x2'),'E_AGI_SERVER_ERROR':_0x4680('0x3'),'E_AGI_SERVER_CLOSE':_0x4680('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x4680('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x4680('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x4680('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x4680('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4680('0x9'),'E_AGI_IVR_ENTRY':_0x4680('0xa')};function AGIError(_0x42bbee){var _0x42bbee=_0x42bbee||null,_0x5cdcb9=_0x5cdcb9||[],_0x525b31=0x1,_0x4f3a5a='';if(!error[_0x42bbee]){_0x42bbee=_0x4680('0xb');}_0x5cdcb9['push'](error[_0x42bbee]);while(arguments[_0x525b31]){_0x5cdcb9[_0x4680('0xc')](arguments[_0x525b31]);_0x525b31++;}_0x4f3a5a=util[_0x4680('0xd')][_0x4680('0xe')](util,_0x5cdcb9);this[_0x4680('0xf')]=_0x4f3a5a;this[_0x4680('0x10')]=_0x42bbee;}module[_0x4680('0x11')]=AGIError; \ No newline at end of file +var _0xbb98=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name','exports','util','Undefined\x20error.'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xbb98,0xfd));var _0x8bb9=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xbb98[_0x2132a3];return _0x21890c;};'use strict';var util=require(_0x8bb9('0x0'));var error={'E_AGI_UNDEFINED':_0x8bb9('0x1'),'E_AGI_ARGUMENT_PORT':_0x8bb9('0x2'),'E_AGI_SERVER_ERROR':_0x8bb9('0x3'),'E_AGI_SERVER_CLOSE':_0x8bb9('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x8bb9('0x5'),'E_AGI_SOCKET_ERROR':_0x8bb9('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x8bb9('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8bb9('0x8'),'E_AGI_IVR_ENTRY':_0x8bb9('0x9')};function AGIError(_0x34aee4){var _0x34aee4=_0x34aee4||null,_0x39c872=_0x39c872||[],_0x45e651=0x1,_0x1f28b5='';if(!error[_0x34aee4]){_0x34aee4='E_AGI_UNDEFINED';}_0x39c872[_0x8bb9('0xa')](error[_0x34aee4]);while(arguments[_0x45e651]){_0x39c872[_0x8bb9('0xa')](arguments[_0x45e651]);_0x45e651++;}_0x1f28b5=util[_0x8bb9('0xb')]['apply'](util,_0x39c872);this[_0x8bb9('0xc')]=_0x1f28b5;this[_0x8bb9('0xd')]=_0x34aee4;}module[_0x8bb9('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 2c11d90..1e57d28 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x386e=['lodash','events','ioredis','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','message','parse','projectUpdate','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x386e,0x195));var _0xe386=function(_0x30e141,_0x450f41){_0x30e141=_0x30e141-0x0;var _0x1d25ab=_0x386e[_0x30e141];return _0x1d25ab;};'use strict';var _=require(_0xe386('0x0'));var EventEmitter=require(_0xe386('0x1'))['EventEmitter'];var Redis=require(_0xe386('0x2'));var AGIError=require('./error');var config=require(_0xe386('0x3'));config[_0xe386('0x4')]=_[_0xe386('0x5')](config[_0xe386('0x4')],{'host':_0xe386('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xe386('0x4')]);sub[_0xe386('0x7')](_0xe386('0x8'),function(_0x45afbb){if(_0x45afbb)return eventEmitter[_0xe386('0x9')](_0xe386('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x45afbb));});sub['on'](_0xe386('0xb'),function(_0x1bac58,_0x3d4450){if(_0x1bac58!==_0xe386('0x8'))return;try{var _0xa99b1=JSON[_0xe386('0xc')](_0x3d4450);eventEmitter['emit'](_0xe386('0xd'),_0xa99b1);}catch(_0x5af2ba){eventEmitter[_0xe386('0x9')](_0xe386('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x5af2ba));}});module[_0xe386('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xa2b8=['../../config/environment','redis','defaults','emit','error','E_AGI_SERVER_ERROR','message','agi','projectUpdate','events','EventEmitter','ioredis','./error'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0xa2b8,0x134));var _0x8a2b=function(_0x10f095,_0x3a17f7){_0x10f095=_0x10f095-0x0;var _0x477873=_0xa2b8[_0x10f095];return _0x477873;};'use strict';var _=require('lodash');var EventEmitter=require(_0x8a2b('0x0'))[_0x8a2b('0x1')];var Redis=require(_0x8a2b('0x2'));var AGIError=require(_0x8a2b('0x3'));var config=require(_0x8a2b('0x4'));config[_0x8a2b('0x5')]=_[_0x8a2b('0x6')](config[_0x8a2b('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x8a2b('0x5')]);sub['subscribe']('agi',function(_0x2c5261){if(_0x2c5261)return eventEmitter[_0x8a2b('0x7')](_0x8a2b('0x8'),new AGIError(_0x8a2b('0x9'),_0x2c5261));});sub['on'](_0x8a2b('0xa'),function(_0x33d2bc,_0x479eab){if(_0x33d2bc!==_0x8a2b('0xb'))return;try{var _0x276c7f=JSON['parse'](_0x479eab);eventEmitter['emit'](_0x8a2b('0xc'),_0x276c7f);}catch(_0x4c5d1c){eventEmitter[_0x8a2b('0x7')](_0x8a2b('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x4c5d1c));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 7651603..5e579a2 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 _0xcc6a=['split','agicommand','vswitch','default','target','menu','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','condition'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xcc6a,0x1cd));var _0xacc6=function(_0x384efc,_0x2a44fa){_0x384efc=_0x384efc-0x0;var _0x30d0db=_0xcc6a[_0x384efc];return _0x30d0db;};'use strict';var _=require(_0xacc6('0x0'));var logger=require(_0xacc6('0x1'))(_0xacc6('0x2'));var verticesWithRetry=['menu',_0xacc6('0x3'),_0xacc6('0x4')];var Graph=function(){this[_0xacc6('0x5')]={};this[_0xacc6('0x6')]={};this[_0xacc6('0x7')]=0x0;};Graph['prototype'][_0xacc6('0x8')]=function(_0x23f324){this[_0xacc6('0x5')][_0x23f324['id']]=_0x23f324;this[_0xacc6('0x6')][_0x23f324['id']]=[];};Graph[_0xacc6('0x9')][_0xacc6('0xa')]=function(_0x2c438c,_0x3bdc4e,_0x115695){this['edges'][_0x2c438c]['push']({'target':_0x3bdc4e,'condition':_0x115695});this[_0xacc6('0x7')]+=0x1;};Graph['prototype']['size']=function(){return _[_0xacc6('0xb')](this[_0xacc6('0x5')]);};Graph[_0xacc6('0x9')][_0xacc6('0xc')]=function(){return this[_0xacc6('0x7')];};Graph[_0xacc6('0x9')][_0xacc6('0xd')]=function(_0x5b5b8a){return this[_0xacc6('0x5')][_0x5b5b8a];};Graph['prototype']['traverseBFS']=function(_0x89e271,_0x295c93){if(!this[_0xacc6('0x5')][_0x89e271]){return logger[_0xacc6('0xe')](_0xacc6('0xf'));}var _0x31f227=_0x295c93(this[_0xacc6('0x5')][_0x89e271]);if(!_0x31f227){return logger[_0xacc6('0xe')](_0xacc6('0x10'));}if(this[_0xacc6('0x6')][_0x89e271]['length']===0x0){return logger[_0xacc6('0xe')]('no\x20edge/s\x20available');}for(var _0x2f3dcc=0x0,_0x14e9b6=[],_0x4dc1c8=![];_0x2f3dcc\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','indexOf','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','name'];(function(_0x5c1a30,_0x2fe9a5){var _0x556236=function(_0x3324e6){while(--_0x3324e6){_0x5c1a30['push'](_0x5c1a30['shift']());}};_0x556236(++_0x2fe9a5);}(_0xb587,0xea));var _0x7b58=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb587[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7b58('0x0'));var syncho=require('syncho');var util=require('util');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x7b58('0x1'));var utilLicense=require('../../config/license/util');var rpc=require(_0x7b58('0x2'));var Project=require(_0x7b58('0x3'));var AGIEmitter=require(_0x7b58('0x4'))[_0x7b58('0x5')];var projects=[];config[_0x7b58('0x1')]=_[_0x7b58('0x6')](config[_0x7b58('0x1')],{'ip':_0x7b58('0x7'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x35a53f){process[_0x7b58('0x8')](function(){syncho(function(){try{setChannelVariables(_0x35a53f);agiHandler(_0x35a53f);}catch(_0x261755){logger[_0x7b58('0x9')](_0x261755[_0x7b58('0xa')]);}});});}function projectUpdateHandler(_0x148a72){try{var _0x9da71f=_[_0x7b58('0xb')](projects,['id',_0x148a72['id']]);if(_0x9da71f>-0x1){if(_0x148a72[_0x7b58('0xc')]===!![]){projects[_0x7b58('0xd')](_0x9da71f,0x1);}else{projects[_0x9da71f]=_0x148a72;}}else{projects[_0x7b58('0xe')](_0x148a72);}}catch(_0x511032){logger[_0x7b58('0x9')](_0x511032['stack']);}}function listeningHandler(){console[_0x7b58('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi']['port']);logger[_0x7b58('0x10')](util[_0x7b58('0x11')](_0x7b58('0x12'),config['agi']['ip'],config['agi'][_0x7b58('0x13')]));}function errorHandler(_0x51ec94){if(_0x51ec94&&_0x51ec94['name']&&_0x51ec94[_0x7b58('0x14')]){logger[_0x7b58('0x9')](util[_0x7b58('0x11')]('[%s]\x20%s',_0x51ec94['name'],_0x51ec94[_0x7b58('0x14')]));}else{logger[_0x7b58('0x9')](util[_0x7b58('0x11')](_0x7b58('0x15'),_0x51ec94[_0x7b58('0xa')]));}}function closeHandler(){logger['info'](util[_0x7b58('0x11')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7b58('0x16')],this[_0x7b58('0x17')],this['callerid'],this[_0x7b58('0x18')],this[_0x7b58('0x19')]));try{createSquareReport(this);}catch(_0x352e5b){logger[_0x7b58('0x9')](_0x352e5b[_0x7b58('0xa')]);}}function timeoutHandler(){logger[_0x7b58('0x10')](util['format'](_0x7b58('0x1a'),this[_0x7b58('0x16')],this[_0x7b58('0x17')],this[_0x7b58('0x1b')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x7b58('0x10')](util[_0x7b58('0x11')](_0x7b58('0x1c'),this['arg_1'],this[_0x7b58('0x17')],this[_0x7b58('0x1b')],this[_0x7b58('0x18')],this['uniqueid']));this[_0x7b58('0x1d')]=!![];}function createSquareReport(_0x56afc5,_0x1561eb){rpc[_0x7b58('0x1e')](_0x56afc5)[_0x7b58('0x1f')](function(_0x195db9){if(_0x1561eb){_0x1561eb(null,_0x195db9);}})['catch'](function(_0x5455f0){if(_0x1561eb){_0x1561eb(null,_0x5455f0);}});}function setChannelVariables(_0x29949c){for(var _0x58acf2 in _0x29949c){if(_0x29949c[_0x7b58('0x20')](_0x58acf2)){if(_0x58acf2[_0x7b58('0x21')]('agi_')===0x0){_0x29949c[_0x58acf2['substring'](0x4)]=_0x29949c[_0x58acf2];delete _0x29949c[_0x58acf2];}}}}function agiHandler(_0x3938ac){logger[_0x7b58('0x22')]('variables',JSON[_0x7b58('0x23')](_0x3938ac,null,0x2));logger[_0x7b58('0x10')](util[_0x7b58('0x11')](_0x7b58('0x24'),_0x3938ac['arg_1'],_0x3938ac[_0x7b58('0x17')],_0x3938ac[_0x7b58('0x1b')],_0x3938ac[_0x7b58('0x18')],_0x3938ac['uniqueid']));_0x3938ac['on']('error',errorHandler);_0x3938ac['on']('close',closeHandler);_0x3938ac['on'](_0x7b58('0x25'),timeoutHandler);_0x3938ac[_0x7b58('0x1d')]=![];_0x3938ac['on'](_0x7b58('0x26'),hangupHandler);var _0x4838bb=_[_0x7b58('0x27')](projects,[_0x7b58('0x28'),_0x3938ac['arg_1']]);if(!_0x4838bb)return Project['handleNotFound'](_0x3938ac);if(!_0x4838bb[_0x7b58('0x29')])return Project[_0x7b58('0x2a')](_0x3938ac);return Project[_0x7b58('0x2b')](_0x4838bb,_0x3938ac);}function main(){var _0x769288;return utilLicense[_0x7b58('0x2c')]()[_0x7b58('0x1f')](function(_0x18f001){if(!_0x18f001)return;if(_0x18f001[_0x7b58('0x2d')]){if(_0x18f001[_0x7b58('0x2e')]&&_0x18f001[_0x7b58('0x2e')]>0x0){logger['info'](util[_0x7b58('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x18f001[_0x7b58('0x2e')]));_0x769288=_0x18f001[_0x7b58('0x2e')];}else{logger[_0x7b58('0x10')](_0x7b58('0x2f'));}}else{logger[_0x7b58('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x769288=-0x1;}})['then'](function(){return Project[_0x7b58('0x30')]();})['then'](function(_0x20eb9e){projects=_0x20eb9e;return;})[_0x7b58('0x31')](function(_0x278548){logger[_0x7b58('0x9')](_0x7b58('0x32'),_0x278548['stack']);})[_0x7b58('0x33')](function(){var _0x502517=require(_0x7b58('0x34'))(config[_0x7b58('0x1')]['port'],config[_0x7b58('0x1')]['ip'],_0x769288);_0x502517['on'](_0x7b58('0x9'),errorHandler);_0x502517['on'](_0x7b58('0x35'),listeningHandler);_0x502517['on']('connection',connectionHandler);_0x502517['on'](_0x7b58('0x36'),closeHandler);});}main(); \ No newline at end of file +var _0xab91=['[LICENSE]\x20CHANNELS:\x20UNLIMITED','catch','[LICENSE]','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','./project','agi','defaults','127.0.0.1','projectUpdate','nextTick','stack','deleted','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','createSquareReport','then','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','find','production','handleUnpublished','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s'];(function(_0x570dce,_0x55a02e){var _0x20f0f9=function(_0x4da3a9){while(--_0x4da3a9){_0x570dce['push'](_0x570dce['shift']());}};_0x20f0f9(++_0x55a02e);}(_0xab91,0xba));var _0x1ab9=function(_0x2b6854,_0xf09496){_0x2b6854=_0x2b6854-0x0;var _0x3a17df=_0xab91[_0x2b6854];return _0x3a17df;};'use strict';var _=require(_0x1ab9('0x0'));var syncho=require(_0x1ab9('0x1'));var util=require(_0x1ab9('0x2'));var config=require(_0x1ab9('0x3'));var logger=require(_0x1ab9('0x4'))('agi');var utilLicense=require(_0x1ab9('0x5'));var rpc=require(_0x1ab9('0x6'));var Project=require(_0x1ab9('0x7'));var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0x1ab9('0x8')]=_[_0x1ab9('0x9')](config['agi'],{'ip':_0x1ab9('0xa'),'port':0x11dd});AGIEmitter['on'](_0x1ab9('0xb'),projectUpdateHandler);function connectionHandler(_0x5c8b35){process[_0x1ab9('0xc')](function(){syncho(function(){try{setChannelVariables(_0x5c8b35);agiHandler(_0x5c8b35);}catch(_0x44964d){logger['error'](_0x44964d[_0x1ab9('0xd')]);}});});}function projectUpdateHandler(_0x805731){try{var _0x39faf0=_['findIndex'](projects,['id',_0x805731['id']]);if(_0x39faf0>-0x1){if(_0x805731[_0x1ab9('0xe')]===!![]){projects[_0x1ab9('0xf')](_0x39faf0,0x1);}else{projects[_0x39faf0]=_0x805731;}}else{projects[_0x1ab9('0x10')](_0x805731);}}catch(_0x4e7e0c){logger[_0x1ab9('0x11')](_0x4e7e0c['stack']);}}function listeningHandler(){console[_0x1ab9('0x12')](_0x1ab9('0x13'),config[_0x1ab9('0x8')][_0x1ab9('0x14')]);logger[_0x1ab9('0x15')](util[_0x1ab9('0x16')](_0x1ab9('0x17'),config[_0x1ab9('0x8')]['ip'],config[_0x1ab9('0x8')][_0x1ab9('0x14')]));}function errorHandler(_0x21ec19){if(_0x21ec19&&_0x21ec19[_0x1ab9('0x18')]&&_0x21ec19[_0x1ab9('0x19')]){logger[_0x1ab9('0x11')](util['format'](_0x1ab9('0x1a'),_0x21ec19['name'],_0x21ec19['message']));}else{logger[_0x1ab9('0x11')](util[_0x1ab9('0x16')](_0x1ab9('0x1b'),_0x21ec19[_0x1ab9('0xd')]));}}function closeHandler(){logger[_0x1ab9('0x15')](util[_0x1ab9('0x16')](_0x1ab9('0x1c'),this[_0x1ab9('0x1d')],this['calleridname'],this[_0x1ab9('0x1e')],this[_0x1ab9('0x1f')],this[_0x1ab9('0x20')]));try{createSquareReport(this);}catch(_0xf036b9){logger[_0x1ab9('0x11')](_0xf036b9['stack']);}}function timeoutHandler(){logger['info'](util['format'](_0x1ab9('0x21'),this[_0x1ab9('0x1d')],this[_0x1ab9('0x22')],this[_0x1ab9('0x1e')],this['dnid'],this[_0x1ab9('0x20')]));}function hangupHandler(){logger['info'](util[_0x1ab9('0x16')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1ab9('0x1d')],this[_0x1ab9('0x22')],this[_0x1ab9('0x1e')],this[_0x1ab9('0x1f')],this[_0x1ab9('0x20')]));this['evtHangup']=!![];}function createSquareReport(_0x5c6acf,_0x41a19){rpc[_0x1ab9('0x23')](_0x5c6acf)[_0x1ab9('0x24')](function(_0x3f650d){if(_0x41a19){_0x41a19(null,_0x3f650d);}})['catch'](function(_0x2f121){if(_0x41a19){_0x41a19(null,_0x2f121);}});}function setChannelVariables(_0xab356a){for(var _0x4aa494 in _0xab356a){if(_0xab356a[_0x1ab9('0x25')](_0x4aa494)){if(_0x4aa494[_0x1ab9('0x26')](_0x1ab9('0x27'))===0x0){_0xab356a[_0x4aa494[_0x1ab9('0x28')](0x4)]=_0xab356a[_0x4aa494];delete _0xab356a[_0x4aa494];}}}}function agiHandler(_0x3a62b6){logger[_0x1ab9('0x29')](_0x1ab9('0x2a'),JSON[_0x1ab9('0x2b')](_0x3a62b6,null,0x2));logger[_0x1ab9('0x15')](util[_0x1ab9('0x16')](_0x1ab9('0x2c'),_0x3a62b6[_0x1ab9('0x1d')],_0x3a62b6[_0x1ab9('0x22')],_0x3a62b6[_0x1ab9('0x1e')],_0x3a62b6['dnid'],_0x3a62b6['uniqueid']));_0x3a62b6['on'](_0x1ab9('0x11'),errorHandler);_0x3a62b6['on'](_0x1ab9('0x2d'),closeHandler);_0x3a62b6['on'](_0x1ab9('0x2e'),timeoutHandler);_0x3a62b6[_0x1ab9('0x2f')]=![];_0x3a62b6['on']('hangup',hangupHandler);var _0x478afe=_[_0x1ab9('0x30')](projects,[_0x1ab9('0x18'),_0x3a62b6[_0x1ab9('0x1d')]]);if(!_0x478afe)return Project['handleNotFound'](_0x3a62b6);if(!_0x478afe[_0x1ab9('0x31')])return Project[_0x1ab9('0x32')](_0x3a62b6);return Project['initialize'](_0x478afe,_0x3a62b6);}function main(){var _0x4b9f91;return utilLicense[_0x1ab9('0x33')]()[_0x1ab9('0x24')](function(_0x2580e3){if(!_0x2580e3)return;if(_0x2580e3['voice']){if(_0x2580e3[_0x1ab9('0x34')]&&_0x2580e3[_0x1ab9('0x34')]>0x0){logger[_0x1ab9('0x15')](util[_0x1ab9('0x16')](_0x1ab9('0x35'),_0x2580e3[_0x1ab9('0x34')]));_0x4b9f91=_0x2580e3[_0x1ab9('0x34')];}else{logger['info'](_0x1ab9('0x36'));}}else{logger[_0x1ab9('0x15')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x4b9f91=-0x1;}})[_0x1ab9('0x24')](function(){return Project['getAll']();})[_0x1ab9('0x24')](function(_0x10d950){projects=_0x10d950;return;})[_0x1ab9('0x37')](function(_0x3e49e3){logger[_0x1ab9('0x11')](_0x1ab9('0x38'),_0x3e49e3[_0x1ab9('0xd')]);})['finally'](function(){var _0x30d57c=require(_0x1ab9('0x39'))(config[_0x1ab9('0x8')][_0x1ab9('0x14')],config['agi']['ip'],_0x4b9f91);_0x30d57c['on']('error',errorHandler);_0x30d57c['on'](_0x1ab9('0x3a'),listeningHandler);_0x30d57c['on'](_0x1ab9('0x3b'),connectionHandler);_0x30d57c['on'](_0x1ab9('0x2d'),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 b57f0bf..319c3cf 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 _0x974f=['error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','request'];(function(_0x9d77b5,_0x4fcdb3){var _0x4b26d0=function(_0xcb79d4){while(--_0xcb79d4){_0x9d77b5['push'](_0x9d77b5['shift']());}};_0x4b26d0(++_0x4fcdb3);}(_0x974f,0x84));var _0xf974=function(_0x519c5a,_0x1bc5ce){_0x519c5a=_0x519c5a-0x0;var _0x38fd21=_0x974f[_0x519c5a];return _0x38fd21;};'use strict';var BPromise=require(_0xf974('0x0'));var jayson=require(_0xf974('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x503b2b,_0x3b0d39){return new BPromise(function(_0x3989dd,_0xe30e95){return client[_0xf974('0x2')](_0x503b2b,_0x3b0d39)['then'](function(_0x1e0606){if(_0x1e0606[_0xf974('0x3')]){return _0xe30e95(_0x1e0606[_0xf974('0x3')][_0xf974('0x4')]);}else{return _0x3989dd(_0x1e0606[_0xf974('0x5')]);}})[_0xf974('0x6')](function(_0x73ae66){return _0xe30e95(_0x73ae66);});});}exports[_0xf974('0x7')]=function(_0x4a3ee7,_0x1e3ee1){return request(_0xf974('0x8'),{'account':_0x4a3ee7,'message':_0x1e3ee1});}; \ No newline at end of file +var _0x4024=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message','catch'];(function(_0x12eaae,_0x1154f4){var _0x33c3f1=function(_0x519853){while(--_0x519853){_0x12eaae['push'](_0x12eaae['shift']());}};_0x33c3f1(++_0x1154f4);}(_0x4024,0x1c4));var _0x4402=function(_0x2923d0,_0x3956b0){_0x2923d0=_0x2923d0-0x0;var _0x21d645=_0x4024[_0x2923d0];return _0x21d645;};'use strict';var BPromise=require(_0x4402('0x0'));var jayson=require(_0x4402('0x1'));var client=jayson[_0x4402('0x2')][_0x4402('0x3')]({'port':0x232b});function request(_0x1dd9b3,_0x55b875){return new BPromise(function(_0x393719,_0x488f5c){return client[_0x4402('0x4')](_0x1dd9b3,_0x55b875)['then'](function(_0x1ad861){if(_0x1ad861[_0x4402('0x5')]){return _0x488f5c(_0x1ad861[_0x4402('0x5')][_0x4402('0x6')]);}else{return _0x393719(_0x1ad861['result']);}})[_0x4402('0x7')](function(_0x218163){return _0x488f5c(_0x218163);});});}exports[_0x4402('0x8')]=function(_0x3f0a81,_0x180e11){return request(_0x4402('0x9'),{'account':_0x3f0a81,'message':_0x180e11});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index e044767..473ccd6 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2bd=['./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','mxGraphModel','inspect','production','start','debug','root','stringify','joinAt','format','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','arg_1','calleridname','dnid','traverseBFS','clear','agicommand','gotoc','info','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','vertex','[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','close','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','../../config/logger','./rpc','./mailRpc','./graph'];(function(_0x2d3344,_0x5504e2){var _0x5b1435=function(_0x5beaad){while(--_0x5beaad){_0x2d3344['push'](_0x2d3344['shift']());}};_0x5b1435(++_0x5504e2);}(_0xb2bd,0xf9));var _0xdb2b=function(_0x210be2,_0x5bfe67){_0x210be2=_0x210be2-0x0;var _0x26152f=_0xb2bd[_0x210be2];return _0x26152f;};'use strict';var _=require('lodash');var moment=require(_0xdb2b('0x0'));var parser=require(_0xdb2b('0x1'));var util=require(_0xdb2b('0x2'));var logger=require(_0xdb2b('0x3'))('agi');var rpc=require(_0xdb2b('0x4'));var mailRpc=require(_0xdb2b('0x5'));var Graph=require(_0xdb2b('0x6'));var Vertices=require(_0xdb2b('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xdb2b('0x8')]()[_0xdb2b('0x9')](function(_0x1ab4b4){logger['error'](_0xdb2b('0xa'),_0x1ab4b4[_0xdb2b('0xb')]);return[];});}function addVertex(_0x4ea43a,_0x23425b,_0x41235e){_0x23425b['agicommand']=_0x41235e;if(_0x23425b[_0xdb2b('0xc')](_0xdb2b('0xd'))){_0x23425b[_0xdb2b('0xe')]=parseInt(_0x23425b[_0xdb2b('0xd')],0xa);}_0x4ea43a[_0xdb2b('0xf')](_['omit'](_0x23425b,_0xdb2b('0x10')));}function initGraph(_0x57dc57,_0x5b835b){var _0x4de80f=new Graph();for(var _0x2c50d5 in _0x57dc57){if(_0x57dc57[_0xdb2b('0xc')](_0x2c50d5)){if(_[_0xdb2b('0x11')](_0x57dc57[_0x2c50d5])){for(var _0x45f134=0x0;_0x45f134<_0x57dc57[_0x2c50d5][_0xdb2b('0x12')];_0x45f134+=0x1){addVertex(_0x4de80f,_0x57dc57[_0x2c50d5][_0x45f134],_0x2c50d5);}}else{addVertex(_0x4de80f,_0x57dc57[_0x2c50d5],_0x2c50d5);}}}for(var _0x187022=0x0;_0x187022<_0x5b835b[_0xdb2b('0x12')];_0x187022+=0x1){if(_0x5b835b[_0x187022][_0xdb2b('0x13')]&&_0x5b835b[_0x187022][_0xdb2b('0x14')]){_0x4de80f[_0xdb2b('0x15')](_0x5b835b[_0x187022][_0xdb2b('0x13')],_0x5b835b[_0x187022][_0xdb2b('0x14')],_0x5b835b[_0x187022][_0xdb2b('0x16')]);}}return _0x4de80f;}function getRoot(_0x550cb1){return parser['toJson'](_0x550cb1,{'object':!![]})[_0xdb2b('0x17')]['root'];}function inspect(_0x450c4e){return util[_0xdb2b('0x18')](_0x450c4e,{'showHidden':![],'depth':null});}function initialize(_0x3413f4,_0x9f91c6){var _0x544c02=getRoot(_0x3413f4[_0xdb2b('0x19')]);if(!_0x544c02||!_0x544c02[_0xdb2b('0x1a')])return;var _0x78beeb,_0x11d963,_0x1ced83;logger[_0xdb2b('0x1b')](_0xdb2b('0x1c'),JSON[_0xdb2b('0x1d')](_0x544c02,null,0x2));_0x9f91c6[_0xdb2b('0x1e')]=moment()[_0xdb2b('0x1f')](_0xdb2b('0x20'));_0x78beeb=initGraph(_['omit'](_0x544c02,_0xdb2b('0x10')),_0x544c02[_0xdb2b('0x10')]);_0x11d963=new Vertices(_0x9f91c6,rpc,mailRpc);logger['info'](util[_0xdb2b('0x1f')](_0xdb2b('0x21'),_0x9f91c6[_0xdb2b('0x22')],_0x9f91c6[_0xdb2b('0x23')],_0x9f91c6['callerid'],_0x9f91c6[_0xdb2b('0x24')],_0x9f91c6['uniqueid']));_0x78beeb[_0xdb2b('0x25')](_0x544c02[_0xdb2b('0x1a')]['id'],function(_0x475bbe){try{_0x475bbe=_0x11d963[_0xdb2b('0x26')](_0x475bbe);logger[_0xdb2b('0x1b')]('vertex',JSON['stringify'](_0x475bbe,null,0x2));if(_0x475bbe[_0xdb2b('0x27')]===_0xdb2b('0x28')){logger[_0xdb2b('0x29')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x9f91c6[_0xdb2b('0x2a')]=_0x475bbe[_0xdb2b('0x2a')]||_0x9f91c6['context'];_0x9f91c6[_0xdb2b('0x2b')]=_0x475bbe[_0xdb2b('0x2b')];_0x9f91c6[_0xdb2b('0x2c')]=_0x475bbe[_0xdb2b('0x2c')]?_0x475bbe[_0xdb2b('0x2c')]-0x1:0x1;return null;}else if(_0x475bbe&&_0x11d963[_0x475bbe[_0xdb2b('0x27')]]){_0x1ced83=_0x11d963[_0x475bbe['agicommand']](_0x475bbe);logger[_0xdb2b('0x29')](_0xdb2b('0x2d'),JSON[_0xdb2b('0x1d')](_0x1ced83,null,0x2));if(_0x1ced83&&_0x1ced83[_0xdb2b('0x2e')]===AGI_CODE_SUCCESS&&_0x1ced83[_0xdb2b('0x2f')]!==AGI_RESULT_ERROR&&!_0x9f91c6[_0xdb2b('0x30')]){logger['debug']('response',inspect(_0x1ced83));return _[_0xdb2b('0x31')](_0x1ced83['result'])?null:_0x1ced83[_0xdb2b('0x2f')][_0xdb2b('0x32')]();}else{logger['error']('response',inspect(_0x1ced83));return null;}}else{logger[_0xdb2b('0x33')](_0xdb2b('0x34'));return null;}}catch(_0x3e38cc){logger[_0xdb2b('0x33')](_0x3e38cc[_0xdb2b('0xb')]);return null;}});if(_0x544c02[_0xdb2b('0x35')]){logger[_0xdb2b('0x29')](util[_0xdb2b('0x1f')](_0xdb2b('0x36'),_0x9f91c6[_0xdb2b('0x22')],_0x9f91c6[_0xdb2b('0x23')],_0x9f91c6[_0xdb2b('0x37')],_0x9f91c6[_0xdb2b('0x24')],_0x9f91c6[_0xdb2b('0x38')]));_0x78beeb[_0xdb2b('0x25')](_0x544c02[_0xdb2b('0x35')]['id'],function(_0x3d9bcb){try{_0x3d9bcb=_0x11d963[_0xdb2b('0x26')](_0x3d9bcb);logger['debug'](_0xdb2b('0x39'),JSON[_0xdb2b('0x1d')](_0x3d9bcb,null,0x2));if(_0x3d9bcb&&_0x11d963[_0x3d9bcb[_0xdb2b('0x27')]]){_0x1ced83=_0x11d963[_0x3d9bcb['agicommand']](_0x3d9bcb);if(_0x1ced83){logger[_0xdb2b('0x1b')](_0xdb2b('0x2d'),inspect(_0x1ced83));return _[_0xdb2b('0x31')](_0x1ced83['result'])?null:_0x1ced83[_0xdb2b('0x2f')][_0xdb2b('0x32')]();}else{logger[_0xdb2b('0x33')]('response',inspect(_0x1ced83));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x1ca6ee){logger[_0xdb2b('0x33')](_0x1ca6ee[_0xdb2b('0xb')]);return null;}});}logger['info'](util[_0xdb2b('0x1f')](_0xdb2b('0x3a'),_0x9f91c6[_0xdb2b('0x22')],_0x9f91c6[_0xdb2b('0x23')],_0x9f91c6['callerid'],_0x9f91c6['dnid'],_0x9f91c6[_0xdb2b('0x38')]));logger[_0xdb2b('0x29')](util[_0xdb2b('0x1f')](_0xdb2b('0x3b'),_0x9f91c6[_0xdb2b('0x2a')],_0x9f91c6[_0xdb2b('0x2b')],parseInt(_0x9f91c6[_0xdb2b('0x2c')],0xa)+0x1));_0x9f91c6[_0xdb2b('0x3c')](_0x9f91c6[_0xdb2b('0x2a')],_0x9f91c6[_0xdb2b('0x2b')],parseInt(_0x9f91c6[_0xdb2b('0x2c')],0xa)+0x1);_0x9f91c6['close']();}function handleNotFound(_0x389603){logger[_0xdb2b('0x33')](util['format']('Project\x20%s\x20not\x20found',_0x389603[_0xdb2b('0x22')]));_0x389603['continueAt'](_0x389603[_0xdb2b('0x2a')],_0x389603[_0xdb2b('0x2b')],parseInt(_0x389603['priority'],0xa)+0x1);_0x389603[_0xdb2b('0x3d')]();}function handleUnpublished(_0x27cf8b){logger[_0xdb2b('0x33')](util['format'](_0xdb2b('0x3e'),_0x27cf8b[_0xdb2b('0x22')]));_0x27cf8b[_0xdb2b('0x3c')](_0x27cf8b[_0xdb2b('0x2a')],_0x27cf8b[_0xdb2b('0x2b')],parseInt(_0x27cf8b[_0xdb2b('0x2c')],0xa)+0x1);_0x27cf8b[_0xdb2b('0x3d')]();}module[_0xdb2b('0x3f')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xcbe9=['stringify','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','error','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','clear','[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','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','lodash','util','./rpc','./mailRpc','./graph','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','target','toJson','mxGraphModel','inspect','production','start','debug','root'];(function(_0x27e280,_0x25f2d6){var _0x511711=function(_0xf06d09){while(--_0xf06d09){_0x27e280['push'](_0x27e280['shift']());}};_0x511711(++_0x25f2d6);}(_0xcbe9,0x91));var _0x9cbe=function(_0x1d7648,_0xe1536b){_0x1d7648=_0x1d7648-0x0;var _0x37e287=_0xcbe9[_0x1d7648];return _0x37e287;};'use strict';var _=require(_0x9cbe('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0x9cbe('0x1'));var logger=require('../../config/logger')('agi');var rpc=require(_0x9cbe('0x2'));var mailRpc=require(_0x9cbe('0x3'));var Graph=require(_0x9cbe('0x4'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9cbe('0x5')]()[_0x9cbe('0x6')](function(_0x5cfc68){logger['error'](_0x9cbe('0x7'),_0x5cfc68['stack']);return[];});}function addVertex(_0x886bf4,_0x16cd53,_0x8bce35){_0x16cd53[_0x9cbe('0x8')]=_0x8bce35;if(_0x16cd53[_0x9cbe('0x9')]('retry')){_0x16cd53[_0x9cbe('0xa')]=parseInt(_0x16cd53[_0x9cbe('0xb')],0xa);}_0x886bf4[_0x9cbe('0xc')](_[_0x9cbe('0xd')](_0x16cd53,_0x9cbe('0xe')));}function initGraph(_0x3e0ea9,_0x9215a9){var _0x8ffd18=new Graph();for(var _0x1c76b1 in _0x3e0ea9){if(_0x3e0ea9['hasOwnProperty'](_0x1c76b1)){if(_[_0x9cbe('0xf')](_0x3e0ea9[_0x1c76b1])){for(var _0x394afc=0x0;_0x394afc<_0x3e0ea9[_0x1c76b1][_0x9cbe('0x10')];_0x394afc+=0x1){addVertex(_0x8ffd18,_0x3e0ea9[_0x1c76b1][_0x394afc],_0x1c76b1);}}else{addVertex(_0x8ffd18,_0x3e0ea9[_0x1c76b1],_0x1c76b1);}}}for(var _0x1d2c93=0x0;_0x1d2c93<_0x9215a9[_0x9cbe('0x10')];_0x1d2c93+=0x1){if(_0x9215a9[_0x1d2c93][_0x9cbe('0x11')]&&_0x9215a9[_0x1d2c93][_0x9cbe('0x12')]){_0x8ffd18['addEdge'](_0x9215a9[_0x1d2c93][_0x9cbe('0x11')],_0x9215a9[_0x1d2c93][_0x9cbe('0x12')],_0x9215a9[_0x1d2c93]['value']);}}return _0x8ffd18;}function getRoot(_0x4fb3d4){return parser[_0x9cbe('0x13')](_0x4fb3d4,{'object':!![]})[_0x9cbe('0x14')]['root'];}function inspect(_0x5238a0){return util[_0x9cbe('0x15')](_0x5238a0,{'showHidden':![],'depth':null});}function initialize(_0x20b669,_0x15405c){var _0x13e9da=getRoot(_0x20b669[_0x9cbe('0x16')]);if(!_0x13e9da||!_0x13e9da[_0x9cbe('0x17')])return;var _0x2d67d7,_0x4af24a,_0x3eb20b;logger[_0x9cbe('0x18')](_0x9cbe('0x19'),JSON[_0x9cbe('0x1a')](_0x13e9da,null,0x2));_0x15405c['joinAt']=moment()[_0x9cbe('0x1b')](_0x9cbe('0x1c'));_0x2d67d7=initGraph(_['omit'](_0x13e9da,_0x9cbe('0xe')),_0x13e9da['mxCell']);_0x4af24a=new Vertices(_0x15405c,rpc,mailRpc);logger[_0x9cbe('0x1d')](util[_0x9cbe('0x1b')](_0x9cbe('0x1e'),_0x15405c[_0x9cbe('0x1f')],_0x15405c[_0x9cbe('0x20')],_0x15405c[_0x9cbe('0x21')],_0x15405c['dnid'],_0x15405c[_0x9cbe('0x22')]));_0x2d67d7[_0x9cbe('0x23')](_0x13e9da[_0x9cbe('0x17')]['id'],function(_0x21899f){try{_0x21899f=_0x4af24a['clear'](_0x21899f);logger[_0x9cbe('0x18')](_0x9cbe('0x24'),JSON[_0x9cbe('0x1a')](_0x21899f,null,0x2));if(_0x21899f[_0x9cbe('0x8')]==='gotoc'){logger[_0x9cbe('0x1d')](_0x9cbe('0x25'));_0x15405c[_0x9cbe('0x26')]=_0x21899f[_0x9cbe('0x26')]||_0x15405c['context'];_0x15405c[_0x9cbe('0x27')]=_0x21899f[_0x9cbe('0x27')];_0x15405c[_0x9cbe('0x28')]=_0x21899f['priority']?_0x21899f['priority']-0x1:0x1;return null;}else if(_0x21899f&&_0x4af24a[_0x21899f[_0x9cbe('0x8')]]){_0x3eb20b=_0x4af24a[_0x21899f[_0x9cbe('0x8')]](_0x21899f);logger[_0x9cbe('0x1d')](_0x9cbe('0x29'),JSON[_0x9cbe('0x1a')](_0x3eb20b,null,0x2));if(_0x3eb20b&&_0x3eb20b['code']===AGI_CODE_SUCCESS&&_0x3eb20b[_0x9cbe('0x2a')]!==AGI_RESULT_ERROR&&!_0x15405c['evtHangup']){logger[_0x9cbe('0x18')](_0x9cbe('0x29'),inspect(_0x3eb20b));return _[_0x9cbe('0x2b')](_0x3eb20b[_0x9cbe('0x2a')])?null:_0x3eb20b[_0x9cbe('0x2a')]['toString']();}else{logger[_0x9cbe('0x2c')]('response',inspect(_0x3eb20b));return null;}}else{logger[_0x9cbe('0x2c')](_0x9cbe('0x2d'));return null;}}catch(_0x164f51){logger['error'](_0x164f51[_0x9cbe('0x2e')]);return null;}});if(_0x13e9da[_0x9cbe('0x2f')]){logger[_0x9cbe('0x1d')](util[_0x9cbe('0x1b')](_0x9cbe('0x30'),_0x15405c[_0x9cbe('0x1f')],_0x15405c[_0x9cbe('0x20')],_0x15405c[_0x9cbe('0x21')],_0x15405c[_0x9cbe('0x31')],_0x15405c[_0x9cbe('0x22')]));_0x2d67d7[_0x9cbe('0x23')](_0x13e9da[_0x9cbe('0x2f')]['id'],function(_0x526e39){try{_0x526e39=_0x4af24a[_0x9cbe('0x32')](_0x526e39);logger[_0x9cbe('0x18')](_0x9cbe('0x24'),JSON[_0x9cbe('0x1a')](_0x526e39,null,0x2));if(_0x526e39&&_0x4af24a[_0x526e39[_0x9cbe('0x8')]]){_0x3eb20b=_0x4af24a[_0x526e39['agicommand']](_0x526e39);if(_0x3eb20b){logger[_0x9cbe('0x18')](_0x9cbe('0x29'),inspect(_0x3eb20b));return _[_0x9cbe('0x2b')](_0x3eb20b['result'])?null:_0x3eb20b['result']['toString']();}else{logger['error'](_0x9cbe('0x29'),inspect(_0x3eb20b));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0xc88984){logger[_0x9cbe('0x2c')](_0xc88984[_0x9cbe('0x2e')]);return null;}});}logger[_0x9cbe('0x1d')](util[_0x9cbe('0x1b')](_0x9cbe('0x33'),_0x15405c['arg_1'],_0x15405c[_0x9cbe('0x20')],_0x15405c[_0x9cbe('0x21')],_0x15405c[_0x9cbe('0x31')],_0x15405c[_0x9cbe('0x22')]));logger[_0x9cbe('0x1d')](util[_0x9cbe('0x1b')](_0x9cbe('0x34'),_0x15405c[_0x9cbe('0x26')],_0x15405c['extension'],parseInt(_0x15405c[_0x9cbe('0x28')],0xa)+0x1));_0x15405c['continueAt'](_0x15405c[_0x9cbe('0x26')],_0x15405c[_0x9cbe('0x27')],parseInt(_0x15405c[_0x9cbe('0x28')],0xa)+0x1);_0x15405c[_0x9cbe('0x35')]();}function handleNotFound(_0x3e71fa){logger['error'](util[_0x9cbe('0x1b')](_0x9cbe('0x36'),_0x3e71fa[_0x9cbe('0x1f')]));_0x3e71fa[_0x9cbe('0x37')](_0x3e71fa[_0x9cbe('0x26')],_0x3e71fa[_0x9cbe('0x27')],parseInt(_0x3e71fa[_0x9cbe('0x28')],0xa)+0x1);_0x3e71fa[_0x9cbe('0x35')]();}function handleUnpublished(_0x32564a){logger[_0x9cbe('0x2c')](util[_0x9cbe('0x1b')](_0x9cbe('0x38'),_0x32564a[_0x9cbe('0x1f')]));_0x32564a[_0x9cbe('0x37')](_0x32564a['context'],_0x32564a[_0x9cbe('0x27')],parseInt(_0x32564a['priority'],0xa)+0x1);_0x32564a[_0x9cbe('0x35')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 7227c6d..9fdd7ac 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 _0x2b42=['_inBody','inherits','prototype','_transform','toString','indexOf','substring','split','slice','trim','emit','headers','line','length','exports','stream','call','_localBuffer'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x2b42,0xe7));var _0x22b4=function(_0x14a321,_0x4889d9){_0x14a321=_0x14a321-0x0;var _0x16dd89=_0x2b42[_0x14a321];return _0x16dd89;};'use strict';var util=require('util');var Transform=require(_0x22b4('0x0'))['Transform'];function AGIReply(_0x15e6d2){Transform[_0x22b4('0x1')](this,_0x15e6d2);this[_0x22b4('0x2')]='';this[_0x22b4('0x3')]=![];}util[_0x22b4('0x4')](AGIReply,Transform);AGIReply[_0x22b4('0x5')][_0x22b4('0x6')]=function(_0x2ae463,_0x46681d,_0x4a6328){var _0x44f3a2='\x0a',_0x10de92=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x1aee57=-0x1,_0x41b540=-0x1,_0x2153ba='',_0xc05021=0x0,_0xc78510='',_0x5a9600='';this['_localBuffer']+=_0x2ae463[_0x22b4('0x7')]();_0xc78510=this['_localBuffer'];if(!this[_0x22b4('0x3')]){_0xc05021=0x0;while(_0x10de92[_0xc05021]){while((_0x41b540=_0xc78510[_0x22b4('0x8')](_0x10de92[_0xc05021]))!=-0x1){_0x2153ba=_0x10de92[_0xc05021];_0x5a9600=_0xc78510[_0x22b4('0x9')](0x0,_0x41b540);_0xc78510=_0xc78510[_0x22b4('0x9')](_0x41b540+_0x2153ba['length']);var _0x507b1f=_0x5a9600[_0x22b4('0xa')](_0x44f3a2),_0x40d770=0x0,_0x599c02={},_0x31924e='',_0x2e4fd0='',_0xc408b0=-0x1;while(_0x507b1f[_0x40d770]){_0xc408b0=_0x507b1f[_0x40d770][_0x22b4('0x8')](':');if(_0xc408b0!=-0x1){_0x31924e=_0x507b1f[_0x40d770][_0x22b4('0xb')](0x0,_0xc408b0)[_0x22b4('0xc')]();_0x2e4fd0=_0x507b1f[_0x40d770][_0x22b4('0xb')](_0xc408b0+0x1)['trim']();if(_0x31924e['length']>0x0){_0x599c02[_0x31924e]=_0x2e4fd0;}}else{}_0x40d770++;}this[_0x22b4('0xd')](_0x22b4('0xe'),_0x599c02);this[_0x22b4('0x3')]=!![];}_0xc05021++;}this[_0x22b4('0x2')]=_0xc78510;}else{while((_0x1aee57=_0xc78510[_0x22b4('0x8')](_0x44f3a2))!=-0x1){_0x5a9600=_0xc78510[_0x22b4('0x9')](0x0,_0x1aee57);this[_0x22b4('0xd')](_0x22b4('0xf'),_0x5a9600);_0xc78510=_0xc78510[_0x22b4('0x9')](_0x1aee57+_0x44f3a2[_0x22b4('0x10')]);}this['_localBuffer']=_0xc78510;}_0x4a6328();};module[_0x22b4('0x11')]=AGIReply; \ No newline at end of file +var _0x071d=['split','slice','trim','emit','Transform','call','_localBuffer','inherits','prototype','toString','_inBody','indexOf','substring','length'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x071d,0x82));var _0xd071=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x071d[_0x479509];return _0x382da8;};'use strict';var util=require('util');var Transform=require('stream')[_0xd071('0x0')];function AGIReply(_0x160075){Transform[_0xd071('0x1')](this,_0x160075);this[_0xd071('0x2')]='';this['_inBody']=![];}util[_0xd071('0x3')](AGIReply,Transform);AGIReply[_0xd071('0x4')]['_transform']=function(_0x24df87,_0x476906,_0x187756){var _0x12025a='\x0a',_0x30216a=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x649f22=-0x1,_0x80236a=-0x1,_0x3f09fb='',_0x40c1cb=0x0,_0x3e4408='',_0x26ae52='';this[_0xd071('0x2')]+=_0x24df87[_0xd071('0x5')]();_0x3e4408=this[_0xd071('0x2')];if(!this[_0xd071('0x6')]){_0x40c1cb=0x0;while(_0x30216a[_0x40c1cb]){while((_0x80236a=_0x3e4408[_0xd071('0x7')](_0x30216a[_0x40c1cb]))!=-0x1){_0x3f09fb=_0x30216a[_0x40c1cb];_0x26ae52=_0x3e4408['substring'](0x0,_0x80236a);_0x3e4408=_0x3e4408[_0xd071('0x8')](_0x80236a+_0x3f09fb[_0xd071('0x9')]);var _0x311b60=_0x26ae52[_0xd071('0xa')](_0x12025a),_0xeeaba5=0x0,_0x211d41={},_0x2de8d4='',_0x5a1464='',_0x124fe8=-0x1;while(_0x311b60[_0xeeaba5]){_0x124fe8=_0x311b60[_0xeeaba5]['indexOf'](':');if(_0x124fe8!=-0x1){_0x2de8d4=_0x311b60[_0xeeaba5][_0xd071('0xb')](0x0,_0x124fe8)[_0xd071('0xc')]();_0x5a1464=_0x311b60[_0xeeaba5][_0xd071('0xb')](_0x124fe8+0x1)['trim']();if(_0x2de8d4[_0xd071('0x9')]>0x0){_0x211d41[_0x2de8d4]=_0x5a1464;}}else{}_0xeeaba5++;}this[_0xd071('0xd')]('headers',_0x211d41);this[_0xd071('0x6')]=!![];}_0x40c1cb++;}this[_0xd071('0x2')]=_0x3e4408;}else{while((_0x649f22=_0x3e4408[_0xd071('0x7')](_0x12025a))!=-0x1){_0x26ae52=_0x3e4408[_0xd071('0x8')](0x0,_0x649f22);this[_0xd071('0xd')]('line',_0x26ae52);_0x3e4408=_0x3e4408[_0xd071('0x8')](_0x649f22+_0x12025a['length']);}this['_localBuffer']=_0x3e4408;}_0x187756();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a439f1e..d0d96fd 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 _0xaba6=['agentLogout','LogoutUser','lodash','moment','request','then','message','catch','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser'];(function(_0x26dbe1,_0x2b9697){var _0x20fb98=function(_0x468408){while(--_0x468408){_0x26dbe1['push'](_0x26dbe1['shift']());}};_0x20fb98(++_0x2b9697);}(_0xaba6,0xe2));var _0x6aba=function(_0x2b2e44,_0x36b38a){_0x2b2e44=_0x2b2e44-0x0;var _0x2d0b45=_0xaba6[_0x2b2e44];return _0x2d0b45;};'use strict';var _=require(_0x6aba('0x0'));var moment=require(_0x6aba('0x1'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x596c18,_0x42fd1f){return new Promise(function(_0x5e8543,_0x58d8a8){return client[_0x6aba('0x2')](_0x596c18,_0x42fd1f)[_0x6aba('0x3')](function(_0x56627c){if(_0x56627c['error']){return _0x58d8a8(_0x56627c['error'][_0x6aba('0x4')]);}else{return _0x5e8543(_0x56627c['result']);}})[_0x6aba('0x5')](function(_0x1a4fbc){return _0x58d8a8(_0x1a4fbc);});});}exports['getSquareProjects']=function(){return request(_0x6aba('0x6'),{'options':{'raw':![],'attributes':['id',_0x6aba('0x7'),'production']}});};exports[_0x6aba('0x8')]=function(_0x1bd238){return request(_0x6aba('0x9'),{'options':{'raw':![],'where':{'name':_0x1bd238},'attributes':[_0x6aba('0xa')]}});};exports[_0x6aba('0xb')]=function(_0x4089c6){return request(_0x6aba('0xc'),{'options':{'raw':![],'where':{'id':_0x4089c6},'include':[{'model':'MailServerOut','as':_0x6aba('0xd'),'include':[{'model':_0x6aba('0xe'),'as':_0x6aba('0xe')}]}],'attributes':['id',_0x6aba('0x7'),'email'],'smtp':!![]}});};exports[_0x6aba('0xf')]=function(_0xcb8096){return request('ShowSquareProject',{'options':{'where':{'id':_0xcb8096},'attributes':[_0x6aba('0x7')]}});};exports[_0x6aba('0x10')]=function(_0x252574){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x252574},'attributes':[_0x6aba('0x7')]}});};exports[_0x6aba('0x11')]=function(_0x15d236){return request('ShowVariable',{'options':{'where':{'id':_0x15d236},'attributes':[_0x6aba('0x7')]}});};exports[_0x6aba('0x12')]=function(_0xa3cb32){return request(_0x6aba('0x13'),{'options':{'where':{'id':_0xa3cb32},'attributes':[_0x6aba('0x14')]}});};exports[_0x6aba('0x15')]=function(_0x3009a9){return request('ShowUser',{'options':{'where':{'id':_0x3009a9},'attributes':[_0x6aba('0x7')]}});};exports[_0x6aba('0x16')]=function(_0x1c2efe){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1c2efe[_0x6aba('0x17')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x4dd600){return request(_0x6aba('0x18'),{'options':{'where':{'id':_0x4dd600},'attributes':['name']}});};exports[_0x6aba('0x19')]=function(_0x1881ae){return request(_0x6aba('0x1a'),{'options':{'where':{'id':_0x1881ae},'attributes':[_0x6aba('0x1b')]}});};exports[_0x6aba('0x1c')]=function(_0x41a3d2){return request(_0x6aba('0x1d'),{'options':{'raw':![],'where':{'id':_0x41a3d2},'include':[{'model':'Interval','as':_0x6aba('0x1e')}]}});};exports[_0x6aba('0x1f')]=function(_0x41744c){return request(_0x6aba('0x20'),{'options':{'where':{'id':_0x41744c},'attributes':['id',_0x6aba('0x7')]}});};exports[_0x6aba('0x21')]=function(_0x44f723){return request(_0x6aba('0x22'),{'body':_0x44f723});};exports[_0x6aba('0x23')]=function(_0x222ad8){return request(_0x6aba('0x24'),{'body':_0x222ad8});};exports[_0x6aba('0x25')]=function(_0x24d1ad){return request(_0x6aba('0x26'),{'body':_[_0x6aba('0x27')](_0x24d1ad,{'project_name':_0x24d1ad[_0x6aba('0x28')],'prev_project_name':_0x24d1ad[_0x6aba('0x29')]||'','is_subproject':_0x24d1ad[_0x6aba('0x29')]?!![]:![],'leaveAt':moment()[_0x6aba('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x335e82){return request('CreateSquareRecording',{'body':_0x335e82});};exports[_0x6aba('0x2b')]=function(_0x108ff1){return request(_0x6aba('0x2c'),{'body':_0x108ff1});};exports[_0x6aba('0x2d')]=function(_0x5eef59){return request(_0x6aba('0x2e'),{'options':{'raw':![],'where':{'phone':_0x5eef59[_0x6aba('0x17')],'ListId':_0x5eef59[_0x6aba('0x2f')]}}})[_0x6aba('0x3')](function(_0x20b06d){if(_0x20b06d){return _0x20b06d;}return request('CreateCmContact',{'body':_0x5eef59});});};exports[_0x6aba('0x30')]=function(_0x5d89aa){return request(_0x6aba('0x31'),{'options':{'where':{'id':_0x5d89aa},'attributes':[_0x6aba('0x7')]}});};exports['agentLogin']=function(_0x4d601a,_0x202a81){return request(_0x6aba('0x32'),{'body':{'interface':_0x202a81},'options':{'where':_0x4d601a}});};exports[_0x6aba('0x33')]=function(_0x1ca375,_0x121908,_0x14d25e){return request(_0x6aba('0x34'),{'body':{'type':_0x121908,'uniqueid':_0x14d25e},'options':{'where':_0x1ca375}});};exports['agentUnpause']=function(_0x25a2bb){return request(_0x6aba('0x35'),{'body':{},'options':{'where':_0x25a2bb}});};exports[_0x6aba('0x36')]=function(_0x586e01){return request(_0x6aba('0x37'),{'body':{},'options':{'where':_0x586e01}});}; \ No newline at end of file +var _0x66fa=['then','error','message','result','GetSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','format','createSquareRecording','CreateSquareRecording','ShowCmHopper','ListId','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','request'];(function(_0x187266,_0x3f99df){var _0x1a83bc=function(_0x189626){while(--_0x189626){_0x187266['push'](_0x187266['shift']());}};_0x1a83bc(++_0x3f99df);}(_0x66fa,0x168));var _0xa66f=function(_0x348829,_0x56b56a){_0x348829=_0x348829-0x0;var _0x48b73b=_0x66fa[_0x348829];return _0x48b73b;};'use strict';var _=require(_0xa66f('0x0'));var moment=require(_0xa66f('0x1'));var jayson=require(_0xa66f('0x2'));var client=jayson['client']['http']({'port':0x2329});function request(_0x3dc747,_0x2325d7){return new Promise(function(_0x3aaeff,_0x2e663b){return client[_0xa66f('0x3')](_0x3dc747,_0x2325d7)[_0xa66f('0x4')](function(_0x342dd9){if(_0x342dd9[_0xa66f('0x5')]){return _0x2e663b(_0x342dd9[_0xa66f('0x5')][_0xa66f('0x6')]);}else{return _0x3aaeff(_0x342dd9[_0xa66f('0x7')]);}})['catch'](function(_0x1cf624){return _0x2e663b(_0x1cf624);});});}exports['getSquareProjects']=function(){return request(_0xa66f('0x8'),{'options':{'raw':![],'attributes':['id',_0xa66f('0x9'),'production']}});};exports[_0xa66f('0xa')]=function(_0x32dc03){return request(_0xa66f('0xb'),{'options':{'raw':![],'where':{'name':_0x32dc03},'attributes':[_0xa66f('0xc')]}});};exports[_0xa66f('0xd')]=function(_0x42f064){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x42f064},'include':[{'model':'MailServerOut','as':_0xa66f('0xe'),'include':[{'model':'CloudProvider','as':_0xa66f('0xf')}]}],'attributes':['id',_0xa66f('0x9'),_0xa66f('0x10')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x26030b){return request(_0xa66f('0xb'),{'options':{'where':{'id':_0x26030b},'attributes':['name']}});};exports[_0xa66f('0x11')]=function(_0x24423a){return request(_0xa66f('0x12'),{'options':{'where':{'id':_0x24423a},'attributes':[_0xa66f('0x9')]}});};exports['getVariableById']=function(_0x3795cb){return request(_0xa66f('0x13'),{'options':{'where':{'id':_0x3795cb},'attributes':['name']}});};exports[_0xa66f('0x14')]=function(_0x33270b){return request(_0xa66f('0x15'),{'options':{'where':{'id':_0x33270b},'attributes':[_0xa66f('0x16')]}});};exports[_0xa66f('0x17')]=function(_0x362988){return request('ShowUser',{'options':{'where':{'id':_0x362988},'attributes':['name']}});};exports[_0xa66f('0x18')]=function(_0x16648b){return request(_0xa66f('0x19'),{'options':{'where':{'phone':_0x16648b[_0xa66f('0x1a')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x1e448e){return request(_0xa66f('0x1b'),{'options':{'where':{'id':_0x1e448e},'attributes':['name']}});};exports[_0xa66f('0x1c')]=function(_0x4b4099){return request(_0xa66f('0x1d'),{'options':{'where':{'id':_0x4b4099},'attributes':[_0xa66f('0x1e')]}});};exports['getIntervalById']=function(_0x585208){return request(_0xa66f('0x1f'),{'options':{'raw':![],'where':{'id':_0x585208},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x535359){return request(_0xa66f('0x20'),{'options':{'where':{'id':_0x535359},'attributes':['id',_0xa66f('0x9')]}});};exports[_0xa66f('0x21')]=function(_0x4cfec6){return request(_0xa66f('0x22'),{'body':_0x4cfec6});};exports[_0xa66f('0x23')]=function(_0x5e8c5b){return request(_0xa66f('0x24'),{'body':_0x5e8c5b});};exports[_0xa66f('0x25')]=function(_0xf6f0b8){return request(_0xa66f('0x26'),{'body':_[_0xa66f('0x27')](_0xf6f0b8,{'project_name':_0xf6f0b8[_0xa66f('0x28')],'prev_project_name':_0xf6f0b8['arg_2']||'','is_subproject':_0xf6f0b8['arg_2']?!![]:![],'leaveAt':moment()[_0xa66f('0x29')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xa66f('0x2a')]=function(_0x278531){return request(_0xa66f('0x2b'),{'body':_0x278531});};exports['createSquareMessage']=function(_0x161f53){return request('CreateSquareMessage',{'body':_0x161f53});};exports['createCmContact']=function(_0x4c7b82){return request(_0xa66f('0x2c'),{'options':{'raw':![],'where':{'phone':_0x4c7b82['phone'],'ListId':_0x4c7b82[_0xa66f('0x2d')]}}})[_0xa66f('0x4')](function(_0x386c4d){if(_0x386c4d){return _0x386c4d;}return request('CreateCmContact',{'body':_0x4c7b82});});};exports['getPauseById']=function(_0x3ad042){return request(_0xa66f('0x2e'),{'options':{'where':{'id':_0x3ad042},'attributes':[_0xa66f('0x9')]}});};exports['agentLogin']=function(_0x46c525,_0x56116a){return request(_0xa66f('0x2f'),{'body':{'interface':_0x56116a},'options':{'where':_0x46c525}});};exports[_0xa66f('0x30')]=function(_0x342dde,_0x36525b,_0x2a1e6b){return request(_0xa66f('0x31'),{'body':{'type':_0x36525b,'uniqueid':_0x2a1e6b},'options':{'where':_0x342dde}});};exports['agentUnpause']=function(_0x3e5b98){return request(_0xa66f('0x32'),{'body':{},'options':{'where':_0x3e5b98}});};exports['agentLogout']=function(_0x1d37c2){return request(_0xa66f('0x33'),{'body':{},'options':{'where':_0x1d37c2}});}; \ 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 7cbe4a2..03654d8 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 _0x8458=['exports','./polly'];(function(_0x170361,_0x5aa382){var _0x243818=function(_0x8b5ba6){while(--_0x8b5ba6){_0x170361['push'](_0x170361['shift']());}};_0x243818(++_0x5aa382);}(_0x8458,0x1a5));var _0x8845=function(_0x494eca,_0x556fce){_0x494eca=_0x494eca-0x0;var _0x2eebcb=_0x8458[_0x494eca];return _0x2eebcb;};var polly=require(_0x8845('0x0'));var lex=require('./lex');module[_0x8845('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x7163=['./polly'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x7163,0x1ef));var _0x3716=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0x7163[_0x5f519b];return _0x2461e2;};var polly=require(_0x3716('0x0'));var lex=require('./lex');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 7867cb3..89ff611 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 _0x5c00=['./lib/api','exports'];(function(_0x352ce2,_0x5e890c){var _0x33e73e=function(_0x59d505){while(--_0x59d505){_0x352ce2['push'](_0x352ce2['shift']());}};_0x33e73e(++_0x5e890c);}(_0x5c00,0x17e));var _0x05c0=function(_0x8585ff,_0x9232d){_0x8585ff=_0x8585ff-0x0;var _0x3ff111=_0x5c00[_0x8585ff];return _0x3ff111;};'use strict';var lex=require(_0x05c0('0x0'));module[_0x05c0('0x1')]=function(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9){return lex(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9);}; \ No newline at end of file +var _0xb43b=['./lib/api','exports'];(function(_0x116c04,_0x4963da){var _0x9e011d=function(_0x143880){while(--_0x143880){_0x116c04['push'](_0x116c04['shift']());}};_0x9e011d(++_0x4963da);}(_0xb43b,0x1b2));var _0xbb43=function(_0x24ec88,_0x8a00c6){_0x24ec88=_0x24ec88-0x0;var _0x520d1d=_0xb43b[_0x24ec88];return _0x520d1d;};'use strict';var lex=require(_0xbb43('0x0'));module[_0xbb43('0x1')]=function(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e){return lex(_0x5c45dd,_0x1bdcfc,_0x1995f8,_0x22bc86,_0x4cf605,_0x131e9e);}; \ 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 8c9748f..ffd34ad 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 _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x54ec20,_0xdc8db6){var _0x747a06=function(_0x2db3c4){while(--_0x2db3c4){_0x54ec20['push'](_0x54ec20['shift']());}};_0x747a06(++_0xdc8db6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x2b9011,_0x33aeb9){var _0x2e71bd=function(_0x425ad9){while(--_0x425ad9){_0x2b9011['push'](_0x2b9011['shift']());}};_0x2e71bd(++_0x33aeb9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ 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 4afa416..3551cae 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 _0x3158=['exports'];(function(_0x311fc0,_0x2c64f0){var _0xce2976=function(_0xb33ed4){while(--_0xb33ed4){_0x311fc0['push'](_0x311fc0['shift']());}};_0xce2976(++_0x2c64f0);}(_0x3158,0x79));var _0x8315=function(_0x2c995d,_0x2f8d99){_0x2c995d=_0x2c995d-0x0;var _0x2b475f=_0x3158[_0x2c995d];return _0x2b475f;};'use strict';var polly=require('./lib/api');module[_0x8315('0x0')]=function(_0x2986d7,_0x4639ef,_0x52a13c,_0x1eb60c,_0xa11192,_0x4e22f1,_0x347294){return polly(_0x2986d7,_0x4639ef,_0x52a13c,_0x1eb60c,_0xa11192,_0x4e22f1,_0x347294);}; \ No newline at end of file +var _0x3ef6=['exports','./lib/api'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3ef6,0x1c9));var _0x63ef=function(_0x223fd2,_0x40b449){_0x223fd2=_0x223fd2-0x0;var _0x5d1701=_0x3ef6[_0x223fd2];return _0x5d1701;};'use strict';var polly=require(_0x63ef('0x0'));module[_0x63ef('0x1')]=function(_0x3c6042,_0x3fa9e7,_0x58a69f,_0x52661c,_0x22dbd7,_0x4272ac,_0x3ac1fe){return polly(_0x3c6042,_0x3fa9e7,_0x58a69f,_0x52661c,_0x22dbd7,_0x4272ac,_0x3ac1fe);}; \ 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 8ae2062..8687763 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 _0x014a=['exports','text','mp3','path','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x014a,0xb7));var _0xa014=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x014a[_0x4e1d03];return _0x362d4b;};'use strict';var fs=require('fs');var path=require(_0xa014('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xa014('0x1'));function pollyResult(_0x473e9c,_0x424950,_0x1fe59a){return new BPromise(function(_0x3baa67,_0x543292){_0x473e9c['synthesizeSpeech'](_0x424950,function(_0x36719b,_0x3c9fd1){if(_0x36719b){_0x543292(_0x36719b);}else if(_0x3c9fd1){if(_0x3c9fd1[_0xa014('0x2')]instanceof Buffer){fs[_0xa014('0x3')](_0x1fe59a,_0x3c9fd1[_0xa014('0x2')],function(_0x598925){if(_0x598925){_0x543292(_0x598925);}else{_0x3baa67();}});}else{_0x543292(new Error(_0xa014('0x4')));}}else{_0x543292(new Error(_0xa014('0x5')));}});});}module[_0xa014('0x6')]=function(_0x5aec2b,_0x2fe79f,_0x1bc056,_0xd0397f,_0x5dca61,_0x1b88bc,_0x58a414){var _0x3e59d2=new AWS['Polly']({'accessKeyId':_0x5aec2b,'secretAccessKey':_0x2fe79f,'region':_0x1bc056});var _0x7b9373={'Text':_0x5dca61,'TextType':_0x1b88bc||_0xa014('0x7'),'OutputFormat':_0xa014('0x8'),'VoiceId':_0xd0397f};return pollyResult(_0x3e59d2,_0x7b9373,_0x58a414);}; \ No newline at end of file +var _0x4404=['mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x1ad64a,_0x1b81ef){var _0x44bdf4=function(_0x3b12a6){while(--_0x3b12a6){_0x1ad64a['push'](_0x1ad64a['shift']());}};_0x44bdf4(++_0x1b81ef);}(_0x4404,0x1c3));var _0x4440=function(_0x4dcf0c,_0x9898af){_0x4dcf0c=_0x4dcf0c-0x0;var _0x1b705d=_0x4404[_0x4dcf0c];return _0x1b705d;};'use strict';var fs=require('fs');var path=require(_0x4440('0x0'));var BPromise=require(_0x4440('0x1'));var rs=require(_0x4440('0x2'));var AWS=require(_0x4440('0x3'));function pollyResult(_0x2dc20c,_0x281479,_0x509152){return new BPromise(function(_0x28989c,_0x141ddf){_0x2dc20c[_0x4440('0x4')](_0x281479,function(_0x574150,_0x3ce3d7){if(_0x574150){_0x141ddf(_0x574150);}else if(_0x3ce3d7){if(_0x3ce3d7['AudioStream']instanceof Buffer){fs['writeFile'](_0x509152,_0x3ce3d7[_0x4440('0x5')],function(_0x4aef1c){if(_0x4aef1c){_0x141ddf(_0x4aef1c);}else{_0x28989c();}});}else{_0x141ddf(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x141ddf(new Error(_0x4440('0x6')));}});});}module[_0x4440('0x7')]=function(_0x2c30ce,_0x28068e,_0x48c17d,_0x34cece,_0xd7a50a,_0x4478,_0x4484c3){var _0x1ec384=new AWS[(_0x4440('0x8'))]({'accessKeyId':_0x2c30ce,'secretAccessKey':_0x28068e,'region':_0x48c17d});var _0x290cbf={'Text':_0xd7a50a,'TextType':_0x4478||'text','OutputFormat':_0x4440('0x9'),'VoiceId':_0x34cece};return pollyResult(_0x1ec384,_0x290cbf,_0x4484c3);}; \ 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 997e1d3..4f51ae7 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 _0x726e=['./lib/api'];(function(_0x3f41e9,_0x5412b3){var _0x10e8a2=function(_0x55710e){while(--_0x55710e){_0x3f41e9['push'](_0x3f41e9['shift']());}};_0x10e8a2(++_0x5412b3);}(_0x726e,0xb1));var _0xe726=function(_0x2f9570,_0xde5b0c){_0x2f9570=_0x2f9570-0x0;var _0x431489=_0x726e[_0x2f9570];return _0x431489;};'use strict';var asr=require(_0xe726('0x0'));module['exports']=function(_0x43f881,_0x3cec7b,_0x1345bc,_0x3c4b58){return asr(_0x43f881,_0x3cec7b,_0x1345bc);}; \ No newline at end of file +var _0xb797=['./lib/api','exports'];(function(_0x34e42d,_0x302472){var _0x4ef0f1=function(_0x36e6ec){while(--_0x36e6ec){_0x34e42d['push'](_0x34e42d['shift']());}};_0x4ef0f1(++_0x302472);}(_0xb797,0xca));var _0x7b79=function(_0x367fb7,_0x4f3c8d){_0x367fb7=_0x367fb7-0x0;var _0x2752d8=_0xb797[_0x367fb7];return _0x2752d8;};'use strict';var asr=require(_0x7b79('0x0'));module[_0x7b79('0x1')]=function(_0x2a241c,_0x482c59,_0x430c33,_0x361cd6){return asr(_0x2a241c,_0x482c59,_0x430c33);}; \ 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 a82cf11..5ac24b4 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 _0xe5b3=['https://speech.googleapis.com','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','bluebird'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe5b3,0x133));var _0x3e5b=function(_0x25aadd,_0x36afd6){_0x25aadd=_0x25aadd-0x0;var _0x2c2ad5=_0xe5b3[_0x25aadd];return _0x2c2ad5;};'use strict';var url=require('url');var BPromise=require(_0x3e5b('0x0'));var fs=require('fs');var host=_0x3e5b('0x1');module[_0x3e5b('0x2')]=function(_0x1c38ed,_0x2a71ef,_0x3171c5){return new BPromise(function(_0x7f1cc0,_0x1e58ed){var _0x320b1e;if(typeof _0x1c38ed!==_0x3e5b('0x3')||_0x1c38ed[_0x3e5b('0x4')]===0x0){return _0x1e58ed('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a71ef!==_0x3e5b('0x3')||_0x2a71ef[_0x3e5b('0x4')]===0x0){return _0x1e58ed('key\x20should\x20be\x20a\x20string');}if(typeof _0x3171c5!==_0x3e5b('0x5')&&(typeof _0x3171c5!==_0x3e5b('0x3')||_0x3171c5[_0x3e5b('0x4')]===0x0)){return _0x1e58ed(_0x3e5b('0x6'));}try{_0x320b1e=fs['readFileSync'](_0x1c38ed)['toString'](_0x3e5b('0x7'));}catch(_0x3d3b6e){return _0x1e58ed(_0x3d3b6e);}return _0x7f1cc0({'method':_0x3e5b('0x8'),'uri':host+_0x3e5b('0x9')+_0x2a71ef,'body':{'config':{'encoding':_0x3e5b('0xa'),'sampleRateHertz':'8000','languageCode':_0x3171c5},'audio':{'content':_0x320b1e}},'json':!![]});});}; \ No newline at end of file +var _0x3140=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string'];(function(_0x5bbf6a,_0x29460a){var _0x5d051a=function(_0x2c76a7){while(--_0x2c76a7){_0x5bbf6a['push'](_0x5bbf6a['shift']());}};_0x5d051a(++_0x29460a);}(_0x3140,0xaf));var _0x0314=function(_0x5d283b,_0x14d1de){_0x5d283b=_0x5d283b-0x0;var _0x3a7d42=_0x3140[_0x5d283b];return _0x3a7d42;};'use strict';var url=require(_0x0314('0x0'));var BPromise=require(_0x0314('0x1'));var fs=require('fs');var host=_0x0314('0x2');module[_0x0314('0x3')]=function(_0x4ac557,_0x4cf353,_0x285be5){return new BPromise(function(_0x26c016,_0x1c0f66){var _0x3e4284;if(typeof _0x4ac557!==_0x0314('0x4')||_0x4ac557[_0x0314('0x5')]===0x0){return _0x1c0f66(_0x0314('0x6'));}if(typeof _0x4cf353!==_0x0314('0x4')||_0x4cf353[_0x0314('0x5')]===0x0){return _0x1c0f66(_0x0314('0x7'));}if(typeof _0x285be5!==_0x0314('0x8')&&(typeof _0x285be5!=='string'||_0x285be5[_0x0314('0x5')]===0x0)){return _0x1c0f66(_0x0314('0x9'));}try{_0x3e4284=fs['readFileSync'](_0x4ac557)['toString'](_0x0314('0xa'));}catch(_0x4e6545){return _0x1c0f66(_0x4e6545);}return _0x26c016({'method':_0x0314('0xb'),'uri':host+_0x0314('0xc')+_0x4cf353,'body':{'config':{'encoding':_0x0314('0xd'),'sampleRateHertz':_0x0314('0xe'),'languageCode':_0x285be5},'audio':{'content':_0x3e4284}},'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 24aac28..0c37997 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 _0x7246=['./asr','exports'];(function(_0xb26fbd,_0x32980e){var _0x1e3329=function(_0x12e5be){while(--_0x12e5be){_0xb26fbd['push'](_0xb26fbd['shift']());}};_0x1e3329(++_0x32980e);}(_0x7246,0xf2));var _0x6724=function(_0x2ffe33,_0x5af94b){_0x2ffe33=_0x2ffe33-0x0;var _0x4874a2=_0x7246[_0x2ffe33];return _0x4874a2;};var asr=require(_0x6724('0x0'));module[_0x6724('0x1')]={'asr':asr}; \ No newline at end of file +var _0x0138=['exports','./asr'];(function(_0x2e3418,_0x59ad24){var _0x2bb55e=function(_0x5d987f){while(--_0x5d987f){_0x2e3418['push'](_0x2e3418['shift']());}};_0x2bb55e(++_0x59ad24);}(_0x0138,0x19b));var _0x8013=function(_0x430979,_0x4006e2){_0x430979=_0x430979-0x0;var _0x9b38fa=_0x0138[_0x430979];return _0x9b38fa;};var asr=require(_0x8013('0x0'));module[_0x8013('0x1')]={'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 52290e4..03ae253 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 _0x5849=['transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','audiofile','dirName','bluebird','dialogflow','https','md5','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','protocol','host','get','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','error','end','https:','path','WHAT_EVER','data','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','text:synthesize','POST','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','utf8','f.req=','stringify','jQ1olc','generic','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.mp3','goggleTTS\x20path','asr','uri','map','alternatives'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5849,0x142));var _0x9584=function(_0x1a8dd9,_0xb96189){_0x1a8dd9=_0x1a8dd9-0x0;var _0x1fc831=_0x5849[_0x1a8dd9];return _0x1fc831;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x9584('0x0'));var dialogflow=require(_0x9584('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x9584('0x2'));var md5=require(_0x9584('0x3'));var path=require('path');var querystring=require(_0x9584('0x4'));var rp=require('request-promise');var rs=require(_0x9584('0x5'));var sox=require(_0x9584('0x6'));var tts=require(_0x9584('0x7'));var urlParse=require(_0x9584('0x8'))[_0x9584('0x9')];var util=require(_0x9584('0xa'));var aws=require(_0x9584('0xb'));var google=require(_0x9584('0xc'));var sestek=require(_0x9584('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x41c527,_0x583927){return new BPromise(function(_0xe01f5c,_0x2e3ca4){var _0x5efdbf=urlParse(_0x41c527);var _0x16b3bf=_0x5efdbf[_0x9584('0xe')]==='https:'?https:http;var _0x424ecc={'host':_0x5efdbf[_0x9584('0xf')],'path':_0x5efdbf['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x16b3bf[_0x9584('0x10')](_0x424ecc,function(_0x192a9a){if(_0x192a9a[_0x9584('0x11')]!==0xc8){logger['error'](_0x9584('0x12')+_0x41c527+'\x20failed,\x20status\x20code\x20=\x20'+_0x192a9a[_0x9584('0x11')]+'\x20('+_0x192a9a[_0x9584('0x13')]+')');_0x2e3ca4(new Error(_0x9584('0x12')+_0x41c527+_0x9584('0x14')+_0x192a9a['statusCode']+'\x20('+_0x192a9a[_0x9584('0x13')]+')'));return;}var _0xfe25c7=fs[_0x9584('0x15')](_0x583927);_0xfe25c7['on'](_0x9584('0x16'),function(){logger[_0x9584('0x17')](_0x9584('0x18'));_0xfe25c7[_0x9584('0x19')](_0xe01f5c);});_0xfe25c7['on']('error',function(_0x353e23){fs[_0x9584('0x1a')](_0x583927);logger['error'](_0x9584('0x1b'),_0x353e23);_0x2e3ca4(_0x353e23);});_0x192a9a['pipe'](_0xfe25c7);})['on']('error',function(_0x235c10){logger[_0x9584('0x1c')](_0x235c10);_0x2e3ca4(_0x235c10);})[_0x9584('0x1d')]();});}function uploadFile(_0x557475){return new BPromise(function(_0x2e35e6,_0x39abc0){var _0x473f2a=urlParse(_0x557475);var _0x4b9172=_0x473f2a[_0x9584('0xe')]===_0x9584('0x1e')?https:http;var _0x45335b={'host':_0x473f2a[_0x9584('0xf')],'path':_0x473f2a[_0x9584('0x1f')],'headers':{'user-agent':_0x9584('0x20')}};_0x4b9172['get'](_0x45335b,function(_0x5af617){if(_0x5af617[_0x9584('0x11')]!==0xc8){_0x39abc0(new Error(_0x9584('0x12')+_0x557475+_0x9584('0x14')+_0x5af617['statusCode']+'\x20('+_0x5af617[_0x9584('0x13')]+')'));return;}var _0x2e123d='';_0x5af617['on'](_0x9584('0x21'),function(_0x2cd9db){_0x2e123d+=_0x2cd9db;});_0x5af617['on'](_0x9584('0x1d'),function(){_0x2e35e6(_0x2e123d);});})['on'](_0x9584('0x1c'),function(_0x4deebc){_0x39abc0(_0x4deebc);})[_0x9584('0x1d')]();});}function convertFile(_0x373990,_0x12179d){return new BPromise(function(_0x143547,_0x248fc2){var _0x353d4f=sox[_0x9584('0x22')](_0x373990,_0x12179d,{'sampleRate':0x1f40,'format':_0x9584('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x353d4f['on'](_0x9584('0x1c'),function(_0x85bb3c){logger[_0x9584('0x1c')]('error\x20convert',_0x85bb3c);_0x248fc2(_0x85bb3c);});_0x353d4f['on'](_0x9584('0x1d'),function(){logger[_0x9584('0x17')](_0x9584('0x24'));_0x143547();});_0x353d4f[_0x9584('0x25')]();});}function base64Decode(_0x564057,_0x1f98d3){var _0xdd1489=path[_0x9584('0x26')](__dirname,_0x9584('0x27'),rs[_0x9584('0x28')](0x4)+_0x9584('0x29'));fs[_0x9584('0x2a')](_0xdd1489,_0x564057,'base64');return convertFile(_0xdd1489,_0x1f98d3)[_0x9584('0x2b')](function(){try{fs[_0x9584('0x1a')](_0xdd1489);fs[_0x9584('0x2c')](_0x1f98d3,_0x9584('0x2d'));}catch(_0x41ec67){logger[_0x9584('0x1c')](_0x41ec67);}return _0x1f98d3[_0x9584('0x2e')]('.')[0x0];});}function base64Encode(_0x403c0a){var _0x14aa19=fs[_0x9584('0x2f')](_0x403c0a);return new Buffer(_0x14aa19)['toString'](_0x9584('0x30'));}exports[_0x9584('0x31')]=function(_0x99821b,_0x4eea72,_0x322455,_0x317b04,_0x1b55d2,_0x5f3f32){var _0x53b734,_0x3eea89;var _0x5a0d58=_0x9584('0x32');var _0xf88d1='?key='+_0x99821b;var _0x1c3b17={};if(_0x4eea72===_0x9584('0x33')){_0x1c3b17[_0x9584('0x34')]={'ssml':_0x322455};}else{_0x1c3b17[_0x9584('0x34')]={'text':_0x322455};};_0x1c3b17['voice']={'languageCode':_0x317b04,'ssmlGender':_0x1b55d2};_0x1c3b17[_0x9584('0x35')]={'audioEncoding':_0x9584('0x36'),'sampleRateHertz':0x1f40};var _0x365514={'url':_0x5a0d58+_0x9584('0x37')+_0xf88d1,'method':_0x9584('0x38'),'json':!![],'body':_0x1c3b17};return rp(_0x365514)['then'](function(_0x20b805){return new BPromise(function(_0xb3edf7,_0x42ed5a){_0x53b734=path[_0x9584('0x26')](__dirname,_0x9584('0x27'),rs['generate'](0x4)+'.mp3');var _0x5a0288=Buffer[_0x9584('0x39')](_0x20b805[_0x9584('0x3a')],_0x9584('0x30'));return fs[_0x9584('0x3b')](_0x53b734,_0x5a0288,function(_0xeee500){_0x42ed5a(_0xeee500);},function(_0x292f9c){fs[_0x9584('0x2c')](_0x53b734,_0x9584('0x2d'));_0xb3edf7(_0x292f9c);});});})[_0x9584('0x2b')](function(_0x42f337){_0x3eea89=path[_0x9584('0x26')](__dirname,'tmp',rs[_0x9584('0x28')](0x4)+'.wav');return convertFile(_0x53b734,_0x3eea89);})[_0x9584('0x2b')](function(){try{fs[_0x9584('0x1a')](_0x53b734);fs[_0x9584('0x2c')](_0x3eea89,'777');}catch(_0x2f3a61){logger[_0x9584('0x1c')](_0x2f3a61);}logger['info'](_0x9584('0x3c'),_0x3eea89['split']('.')[0x0]);return _0x3eea89[_0x9584('0x2e')]('.')[0x0];});};exports[_0x9584('0x3d')]=function(_0x130a0f,_0x28c304){var _0x3f7735='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x1722ef,_0x2e3ba5;var _0x242e58;var _0x23fb44={'encoding':_0x9584('0x3e'),'method':_0x9584('0x38'),'timeout':0x2710,'url':_0x3f7735,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x9584('0x3f')+encodeURIComponent(JSON[_0x9584('0x40')]([[[_0x9584('0x41'),JSON['stringify']([_0x130a0f,_0x28c304||'en',![],'null']),null,_0x9584('0x42')]]]))};return rp(_0x23fb44)[_0x9584('0x2b')](function(_0x62eb8){try{_0x242e58=eval(_0x62eb8['slice'](0x5))[0x0][0x2];}catch(_0x196272){throw new Error('parse\x20response\x20failed:\x0a'+_0x62eb8[_0x9584('0x21')]);}if(!_0x242e58){if(_0x130a0f[_0x9584('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x9584('0x44')+_0x28c304+_0x9584('0x45'));}}try{_0x242e58=eval(_0x242e58)[0x0];}catch(_0x935a11){throw new Error(_0x9584('0x46')+res[_0x9584('0x21')]);}const _0x37708c=_0x242e58;_0x1722ef=path['resolve'](__dirname,_0x9584('0x27'),rs[_0x9584('0x28')](0x4)+_0x9584('0x47'));fs[_0x9584('0x2a')](_0x1722ef,_0x242e58,{'encoding':_0x9584('0x30')});_0x2e3ba5=path['resolve'](__dirname,_0x9584('0x27'),rs[_0x9584('0x28')](0x4)+_0x9584('0x29'));return convertFile(_0x1722ef,_0x2e3ba5);})[_0x9584('0x2b')](function(){try{fs[_0x9584('0x1a')](_0x1722ef);fs[_0x9584('0x2c')](_0x2e3ba5,_0x9584('0x2d'));}catch(_0x2e6214){logger[_0x9584('0x1c')](_0x2e6214);}logger[_0x9584('0x17')](_0x9584('0x48'),_0x2e3ba5[_0x9584('0x2e')]('.')[0x0]);return _0x2e3ba5[_0x9584('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x452f63,_0x8032eb,_0x5891d6){return google[_0x9584('0x49')](_0x452f63,_0x8032eb,_0x5891d6)[_0x9584('0x2b')](function(_0x4e04ab){logger[_0x9584('0x17')](_0x4e04ab[_0x9584('0x4a')]);return rp(_0x4e04ab);})[_0x9584('0x2b')](function(_0x5d6875){var _0x40cadb='';var _0x141818=0x0;try{fs['unlink'](_0x452f63);}catch(_0x40a59a){logger[_0x9584('0x1c')](_0x40a59a);}if(_0x5d6875&&_0x5d6875['results']){_0x40cadb=_0x5d6875['results'][_0x9584('0x4b')](function(_0x1094f6){return _0x1094f6&&_0x1094f6['alternatives'][0x0]&&_0x1094f6[_0x9584('0x4c')][0x0][_0x9584('0x4d')]?_0x1094f6[_0x9584('0x4c')][0x0]['transcript']:'';})[_0x9584('0x4e')]('\x0a');_0x141818=_0x5d6875['results'][_0x9584('0x4b')](function(_0x25317e){return _0x25317e&&_0x25317e['alternatives'][0x0]&&_0x25317e[_0x9584('0x4c')][0x0][_0x9584('0x4f')]?_0x25317e[_0x9584('0x4c')][0x0]['confidence']:0x0;})[_0x9584('0x4e')]('\x0a');}logger[_0x9584('0x17')](_0x9584('0x50'),_0x40cadb);logger[_0x9584('0x17')](_0x9584('0x51'),_0x141818);return{'transcript':_0x40cadb,'confidence':_0x141818};})[_0x9584('0x52')](function(_0x3799e6){logger['error'](_0x9584('0x53'),_0x3799e6['statusCode'],_0x3799e6[_0x9584('0x54')],_0x3799e6[_0x9584('0x55')]);});};exports[_0x9584('0x56')]=function(_0x342600,_0x27049c,_0x2b4072,_0x9566c0){var _0x26d064=apiai(_0x27049c,{'language':_0x9566c0||'en'});return _0x26d064[_0x9584('0x57')](_0x2b4072,{'sessionId':md5(_0x342600)})[_0x9584('0x2b')](function(_0x29be14){logger[_0x9584('0x17')](JSON['stringify'](_0x29be14));return{'source':_0x29be14[_0x9584('0x58')][_0x9584('0x59')],'resolvedQuery':_0x29be14[_0x9584('0x58')][_0x9584('0x5a')],'action':_0x29be14[_0x9584('0x58')][_0x9584('0x5b')],'actionIncomplete':_0x29be14['result'][_0x9584('0x5c')],'speech':_0x29be14['result'][_0x9584('0x5d')]['speech'],'score':_0x29be14['result'][_0x9584('0x5e')],'statusCode':_0x29be14[_0x9584('0x5f')][_0x9584('0x60')],'endConversation':_0x29be14['result']['metadata'][_0x9584('0x61')]||![],'isFallbackIntent':_0x29be14[_0x9584('0x58')]['metadata'][_0x9584('0x62')]};});};exports['googleDialogflowV2']=function(_0x32fa64,_0x33d4b3,_0xa84d10,_0x345f5d,_0x46298f,_0x294bc2){var _0x3f8d29=_0x345f5d[_0x9584('0x63')](/\\n/g,'\x0a');var _0x45a2ef={'credentials':{'private_key':_0x3f8d29,'client_email':_0xa84d10}};var _0x3aa464=new dialogflow[(_0x9584('0x64'))](_0x45a2ef);var _0xd91d57=_0x3aa464[_0x9584('0x65')](_0x33d4b3,md5(_0x32fa64));var _0x5812c1={'session':_0xd91d57,'queryInput':{'text':{'text':_0x46298f,'languageCode':_0x294bc2}}};return _0x3aa464[_0x9584('0x66')](_0x5812c1)[_0x9584('0x2b')](function(_0x85e75b){if(_0x85e75b&&_0x85e75b['length']){logger['info'](_0x9584('0x67'),JSON[_0x9584('0x40')](_0x85e75b));var _0x544d7d=_0x85e75b[0x0];if(_0x544d7d){var _0x34a503={'action':_0x544d7d[_0x9584('0x68')][_0x9584('0x5b')],'allRequiredParamsPresent':_0x544d7d[_0x9584('0x68')]['allRequiredParamsPresent'],'endConversation':_0x544d7d[_0x9584('0x68')][_0x9584('0x69')]&&_0x544d7d['queryResult']['diagnosticInfo'][_0x9584('0x6a')]?_0x544d7d[_0x9584('0x68')]['diagnosticInfo']['fields']['end_conversation'][_0x9584('0x6b')]:![],'fulfillmentText':_0x544d7d[_0x9584('0x68')][_0x9584('0x6c')],'intentName':_0x544d7d['queryResult']['intent'][_0x9584('0x54')],'intentDisplayName':_0x544d7d[_0x9584('0x68')][_0x9584('0x6d')][_0x9584('0x6e')],'isFallbackIntent':_0x544d7d[_0x9584('0x68')]['intent'][_0x9584('0x6f')],'languageCode':_0x544d7d['queryResult'][_0x9584('0x70')],'queryText':_0x544d7d[_0x9584('0x68')]['queryText'],'responseId':_0x544d7d[_0x9584('0x71')],'score':_0x544d7d[_0x9584('0x68')][_0x9584('0x72')],'speech':_0x544d7d[_0x9584('0x68')][_0x9584('0x6c')],'providerResponse':JSON[_0x9584('0x40')](_0x85e75b)};return _0x34a503;}}});};exports[_0x9584('0x73')]=function(_0x100c3b,_0x1d2dc3,_0x2ac682,_0x2d70b5){return tilde[_0x9584('0x49')](_0x100c3b,_0x1d2dc3,_0x2ac682,_0x2d70b5)[_0x9584('0x2b')](function(_0x36aaab){try{fs[_0x9584('0x1a')](_0x100c3b);}catch(_0x4dc17a){logger[_0x9584('0x1c')](_0x4dc17a);}logger[_0x9584('0x17')](_0x9584('0x74'),_0x36aaab[_0x9584('0x4d')]);logger['info']('Tilde\x20ASR\x20confidence',_0x36aaab['confidence']);return _0x36aaab;});};exports[_0x9584('0x75')]=function(_0x1647dd,_0x2de018,_0x284287,_0x38f0a9,_0x238811,_0x553ecb){var _0x172621=path[_0x9584('0x26')](__dirname,_0x9584('0x27'),rs[_0x9584('0x28')](0x4)+_0x9584('0x47'));var _0x1ede10;return aws['polly'](_0x1647dd,_0x2de018,_0x284287,_0x38f0a9,_0x238811,_0x553ecb,_0x172621)[_0x9584('0x2b')](function(){_0x1ede10=path[_0x9584('0x26')](__dirname,_0x9584('0x27'),rs[_0x9584('0x28')](0x4)+_0x9584('0x29'));return convertFile(_0x172621,_0x1ede10);})[_0x9584('0x2b')](function(){try{fs['unlink'](_0x172621);fs[_0x9584('0x2c')](_0x1ede10,_0x9584('0x2d'));}catch(_0x5cf28c){logger[_0x9584('0x1c')](_0x5cf28c);}return _0x1ede10['split']('.')[0x0];});};exports[_0x9584('0x76')]=function(_0x3fce81,_0x2337fd,_0x144564,_0x4bb76e,_0x339c66,_0x587b41){return aws[_0x9584('0x77')](_0x3fce81,_0x2337fd,_0x144564,_0x4bb76e,_0x339c66,_0x587b41)[_0x9584('0x2b')](function(_0x326775){logger[_0x9584('0x17')](JSON[_0x9584('0x40')](_0x326775));return _0x326775;});};exports[_0x9584('0x78')]=function(_0x3aede8,_0xe050e0,_0x49838b,_0x5b96cc){var _0x11b99f=util['format'](_0x9584('0x79'),ISPEECH_API,_0x3aede8,encodeURIComponent(_0xe050e0),_0x49838b,_0x5b96cc);var _0x7edf4d=path[_0x9584('0x26')](__dirname,'tmp',rs[_0x9584('0x28')](0x4)+_0x9584('0x47'));var _0x2c55bc;return downloadFile(_0x11b99f,_0x7edf4d)['then'](function(){_0x2c55bc=path[_0x9584('0x26')](__dirname,_0x9584('0x27'),rs[_0x9584('0x28')](0x4)+'.wav');return convertFile(_0x7edf4d,_0x2c55bc);})[_0x9584('0x2b')](function(){try{fs[_0x9584('0x1a')](_0x7edf4d);fs['chmodSync'](_0x2c55bc,_0x9584('0x2d'));}catch(_0x276cad){logger[_0x9584('0x1c')](_0x276cad);}return _0x2c55bc['split']('.')[0x0];});};exports[_0x9584('0x7a')]=function(_0x1546a8,_0x1f2a4e,_0x281a71,_0x42c482){var _0x3998c5=util[_0x9584('0x7b')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x1f2a4e,_0x281a71,base64Encode(_0x1546a8),_0x42c482?util[_0x9584('0x7b')](_0x9584('0x7c'),encodeURIComponent(_0x42c482)):'freeform=3');return uploadFile(_0x3998c5)[_0x9584('0x2b')](function(_0x55e7cc){return querystring['parse'](_0x55e7cc);});};exports[_0x9584('0x7d')]=function(_0xe1c4c1,_0x5798b4){return sestek[_0x9584('0x7e')](_0xe1c4c1,_0x5798b4)['then'](function(_0x210d12){logger[_0x9584('0x17')](JSON[_0x9584('0x40')](_0x210d12));var _0x5e711e={'speech':_0x210d12[_0x9584('0x7f')],'action':_0x210d12['channelData']?_0x210d12[_0x9584('0x80')]['CustomAction']:undefined,'actiondata':_0x210d12[_0x9584('0x80')]?_0x210d12[_0x9584('0x80')][_0x9584('0x81')]:undefined};if(_0x210d12[_0x9584('0x80')]&&_0x210d12[_0x9584('0x80')]['AudioFromTts']){return base64Decode(_0x210d12['channelData'][_0x9584('0x82')]['Data'],path[_0x9584('0x26')](__dirname,_0x9584('0x27'),rs[_0x9584('0x28')](0x4)+_0x9584('0x29')))[_0x9584('0x2b')](function(_0x4d4d21){_0x5e711e[_0x9584('0x83')]=_0x4d4d21;return _0x5e711e;});}return _0x5e711e;});};exports[_0x9584('0x84')]=function(){return __dirname;}; \ No newline at end of file +var _0x1307=['fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','querystring','request-promise','sox','google-tts-api','url','parse','util','./aws','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','error','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','info','start','resolve','tmp','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','then','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','result','source','resolvedQuery','actionIncomplete','fulfillment','score','code','metadata','endConversation','isFallbackIntent','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1307,0x1b2));var _0x7130=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x1307[_0x3740fe];return _0x55492b;};'use strict';var apiai=require(_0x7130('0x0'));var BPromise=require(_0x7130('0x1'));var dialogflow=require(_0x7130('0x2'));var fs=require('fs');var http=require(_0x7130('0x3'));var https=require(_0x7130('0x4'));var md5=require(_0x7130('0x5'));var path=require('path');var querystring=require(_0x7130('0x6'));var rp=require(_0x7130('0x7'));var rs=require('randomstring');var sox=require(_0x7130('0x8'));var tts=require(_0x7130('0x9'));var urlParse=require(_0x7130('0xa'))[_0x7130('0xb')];var util=require(_0x7130('0xc'));var aws=require(_0x7130('0xd'));var google=require(_0x7130('0xe'));var sestek=require('./sestek');var tilde=require(_0x7130('0xf'));var logger=require(_0x7130('0x10'))('agi');var ISPEECH_API=_0x7130('0x11');function downloadFile(_0x494902,_0x484658){return new BPromise(function(_0x522a9b,_0x20dc12){var _0x5bdded=urlParse(_0x494902);var _0x3f4bd8=_0x5bdded[_0x7130('0x12')]===_0x7130('0x13')?https:http;var _0x25f77d={'host':_0x5bdded[_0x7130('0x14')],'path':_0x5bdded[_0x7130('0x15')],'headers':{'user-agent':_0x7130('0x16')}};_0x3f4bd8[_0x7130('0x17')](_0x25f77d,function(_0x156d0d){if(_0x156d0d[_0x7130('0x18')]!==0xc8){logger['error'](_0x7130('0x19')+_0x494902+_0x7130('0x1a')+_0x156d0d[_0x7130('0x18')]+'\x20('+_0x156d0d[_0x7130('0x1b')]+')');_0x20dc12(new Error(_0x7130('0x19')+_0x494902+'\x20failed,\x20status\x20code\x20=\x20'+_0x156d0d[_0x7130('0x18')]+'\x20('+_0x156d0d[_0x7130('0x1b')]+')'));return;}var _0x24bf35=fs[_0x7130('0x1c')](_0x484658);_0x24bf35['on'](_0x7130('0x1d'),function(){logger['info']('finish\x20download\x20file');_0x24bf35[_0x7130('0x1e')](_0x522a9b);});_0x24bf35['on'](_0x7130('0x1f'),function(_0x28a673){fs[_0x7130('0x20')](_0x484658);logger[_0x7130('0x1f')](_0x7130('0x21'),_0x28a673);_0x20dc12(_0x28a673);});_0x156d0d[_0x7130('0x22')](_0x24bf35);})['on']('error',function(_0x3422c7){logger['error'](_0x3422c7);_0x20dc12(_0x3422c7);})[_0x7130('0x23')]();});}function uploadFile(_0x2b518c){return new BPromise(function(_0x1403c4,_0x271b6b){var _0x52b8f9=urlParse(_0x2b518c);var _0x3fd4d6=_0x52b8f9['protocol']===_0x7130('0x13')?https:http;var _0x3a8192={'host':_0x52b8f9[_0x7130('0x14')],'path':_0x52b8f9[_0x7130('0x15')],'headers':{'user-agent':_0x7130('0x16')}};_0x3fd4d6['get'](_0x3a8192,function(_0x3bd3c1){if(_0x3bd3c1[_0x7130('0x18')]!==0xc8){_0x271b6b(new Error(_0x7130('0x19')+_0x2b518c+'\x20failed,\x20status\x20code\x20=\x20'+_0x3bd3c1['statusCode']+'\x20('+_0x3bd3c1['statusMessage']+')'));return;}var _0x4bce50='';_0x3bd3c1['on'](_0x7130('0x24'),function(_0x2a3286){_0x4bce50+=_0x2a3286;});_0x3bd3c1['on'](_0x7130('0x23'),function(){_0x1403c4(_0x4bce50);});})['on'](_0x7130('0x1f'),function(_0x2b99b8){_0x271b6b(_0x2b99b8);})['end']();});}function convertFile(_0x2f5b79,_0x53df5a){return new BPromise(function(_0x128e91,_0x4c5c15){var _0x3eb7b3=sox[_0x7130('0x25')](_0x2f5b79,_0x53df5a,{'sampleRate':0x1f40,'format':_0x7130('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3eb7b3['on'](_0x7130('0x1f'),function(_0x23272c){logger[_0x7130('0x1f')](_0x7130('0x27'),_0x23272c);_0x4c5c15(_0x23272c);});_0x3eb7b3['on']('end',function(){logger[_0x7130('0x28')]('finish\x20to\x20convert');_0x128e91();});_0x3eb7b3[_0x7130('0x29')]();});}function base64Decode(_0x157ca9,_0x2b3492){var _0x1cad27=path[_0x7130('0x2a')](__dirname,_0x7130('0x2b'),rs['generate'](0x4)+_0x7130('0x2c'));fs[_0x7130('0x2d')](_0x1cad27,_0x157ca9,_0x7130('0x2e'));return convertFile(_0x1cad27,_0x2b3492)['then'](function(){try{fs[_0x7130('0x20')](_0x1cad27);fs[_0x7130('0x2f')](_0x2b3492,_0x7130('0x30'));}catch(_0x148db1){logger[_0x7130('0x1f')](_0x148db1);}return _0x2b3492[_0x7130('0x31')]('.')[0x0];});}function base64Encode(_0x174938){var _0x6b121=fs[_0x7130('0x32')](_0x174938);return new Buffer(_0x6b121)[_0x7130('0x33')](_0x7130('0x2e'));}exports[_0x7130('0x34')]=function(_0x6b7818,_0x3be204,_0x3c88bc,_0x671473,_0x39ea76,_0x55cee3){var _0x1f6483,_0x50db96;var _0x192cc1=_0x7130('0x35');var _0x432487=_0x7130('0x36')+_0x6b7818;var _0x2a6821={};if(_0x3be204===_0x7130('0x37')){_0x2a6821[_0x7130('0x38')]={'ssml':_0x3c88bc};}else{_0x2a6821[_0x7130('0x38')]={'text':_0x3c88bc};};_0x2a6821['voice']={'languageCode':_0x671473,'ssmlGender':_0x39ea76};_0x2a6821[_0x7130('0x39')]={'audioEncoding':_0x7130('0x3a'),'sampleRateHertz':0x1f40};var _0x4f9945={'url':_0x192cc1+_0x7130('0x3b')+_0x432487,'method':_0x7130('0x3c'),'json':!![],'body':_0x2a6821};return rp(_0x4f9945)[_0x7130('0x3d')](function(_0x3c6f72){return new BPromise(function(_0x583573,_0x26e0e4){_0x1f6483=path[_0x7130('0x2a')](__dirname,_0x7130('0x2b'),rs[_0x7130('0x3e')](0x4)+_0x7130('0x3f'));var _0x1a9351=Buffer[_0x7130('0x40')](_0x3c6f72[_0x7130('0x41')],_0x7130('0x2e'));return fs[_0x7130('0x42')](_0x1f6483,_0x1a9351,function(_0xea607c){_0x26e0e4(_0xea607c);},function(_0x185c99){fs['chmodSync'](_0x1f6483,_0x7130('0x30'));_0x583573(_0x185c99);});});})[_0x7130('0x3d')](function(_0x35df0e){_0x50db96=path[_0x7130('0x2a')](__dirname,_0x7130('0x2b'),rs[_0x7130('0x3e')](0x4)+_0x7130('0x2c'));return convertFile(_0x1f6483,_0x50db96);})[_0x7130('0x3d')](function(){try{fs[_0x7130('0x20')](_0x1f6483);fs['chmodSync'](_0x50db96,_0x7130('0x30'));}catch(_0x3e332d){logger['error'](_0x3e332d);}logger['info'](_0x7130('0x43'),_0x50db96[_0x7130('0x31')]('.')[0x0]);return _0x50db96[_0x7130('0x31')]('.')[0x0];});};exports[_0x7130('0x44')]=function(_0x4fe24b,_0x1806b1){var _0x2c799d='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x94b4cc,_0xba1bd1;var _0x4bcc6d;var _0x59e764={'encoding':_0x7130('0x45'),'method':'POST','timeout':0x2710,'url':_0x2c799d,'headers':{'Content-Type':_0x7130('0x46')},'body':'f.req='+encodeURIComponent(JSON[_0x7130('0x47')]([[[_0x7130('0x48'),JSON[_0x7130('0x47')]([_0x4fe24b,_0x1806b1||'en',![],'null']),null,_0x7130('0x49')]]]))};return rp(_0x59e764)['then'](function(_0x4d54e4){try{_0x4bcc6d=eval(_0x4d54e4[_0x7130('0x4a')](0x5))[0x0][0x2];}catch(_0x5c4dd6){throw new Error(_0x7130('0x4b')+_0x4d54e4[_0x7130('0x24')]);}if(!_0x4bcc6d){if(_0x4fe24b[_0x7130('0x4c')]>0xc8){throw new Error(_0x7130('0x4d'));}else{throw new Error('lang\x20\x22'+_0x1806b1+_0x7130('0x4e'));}}try{_0x4bcc6d=eval(_0x4bcc6d)[0x0];}catch(_0x1fc73d){throw new Error(_0x7130('0x4b')+res['data']);}const _0x27366b=_0x4bcc6d;_0x94b4cc=path['resolve'](__dirname,_0x7130('0x2b'),rs[_0x7130('0x3e')](0x4)+_0x7130('0x3f'));fs[_0x7130('0x2d')](_0x94b4cc,_0x4bcc6d,{'encoding':_0x7130('0x2e')});_0xba1bd1=path['resolve'](__dirname,_0x7130('0x2b'),rs['generate'](0x4)+_0x7130('0x2c'));return convertFile(_0x94b4cc,_0xba1bd1);})[_0x7130('0x3d')](function(){try{fs[_0x7130('0x20')](_0x94b4cc);fs[_0x7130('0x2f')](_0xba1bd1,_0x7130('0x30'));}catch(_0x5c0f25){logger[_0x7130('0x1f')](_0x5c0f25);}logger[_0x7130('0x28')]('goggleTTS\x20path',_0xba1bd1[_0x7130('0x31')]('.')[0x0]);return _0xba1bd1[_0x7130('0x31')]('.')[0x0];});};exports[_0x7130('0x4f')]=function(_0x5ed3af,_0x5d5cf6,_0xdb73e2){return google[_0x7130('0x50')](_0x5ed3af,_0x5d5cf6,_0xdb73e2)['then'](function(_0x4fd71f){logger[_0x7130('0x28')](_0x4fd71f[_0x7130('0x51')]);return rp(_0x4fd71f);})[_0x7130('0x3d')](function(_0x175dfd){var _0x45048a='';var _0x5e4c00=0x0;try{fs[_0x7130('0x20')](_0x5ed3af);}catch(_0x629b33){logger[_0x7130('0x1f')](_0x629b33);}if(_0x175dfd&&_0x175dfd[_0x7130('0x52')]){_0x45048a=_0x175dfd[_0x7130('0x52')][_0x7130('0x53')](function(_0x3b1949){return _0x3b1949&&_0x3b1949[_0x7130('0x54')][0x0]&&_0x3b1949['alternatives'][0x0][_0x7130('0x55')]?_0x3b1949[_0x7130('0x54')][0x0][_0x7130('0x55')]:'';})[_0x7130('0x56')]('\x0a');_0x5e4c00=_0x175dfd[_0x7130('0x52')]['map'](function(_0x55b0dc){return _0x55b0dc&&_0x55b0dc[_0x7130('0x54')][0x0]&&_0x55b0dc[_0x7130('0x54')][0x0]['confidence']?_0x55b0dc['alternatives'][0x0]['confidence']:0x0;})[_0x7130('0x56')]('\x0a');}logger[_0x7130('0x28')](_0x7130('0x57'),_0x45048a);logger[_0x7130('0x28')](_0x7130('0x58'),_0x5e4c00);return{'transcript':_0x45048a,'confidence':_0x5e4c00};})[_0x7130('0x59')](function(_0x57dbb9){logger[_0x7130('0x1f')](_0x7130('0x5a'),_0x57dbb9[_0x7130('0x18')],_0x57dbb9['name'],_0x57dbb9['message']);});};exports[_0x7130('0x5b')]=function(_0x3a1442,_0x45dc90,_0x22554b,_0x2ebbc2){var _0x1ab324=apiai(_0x45dc90,{'language':_0x2ebbc2||'en'});return _0x1ab324['textRequest'](_0x22554b,{'sessionId':md5(_0x3a1442)})[_0x7130('0x3d')](function(_0x48d164){logger[_0x7130('0x28')](JSON[_0x7130('0x47')](_0x48d164));return{'source':_0x48d164[_0x7130('0x5c')][_0x7130('0x5d')],'resolvedQuery':_0x48d164[_0x7130('0x5c')][_0x7130('0x5e')],'action':_0x48d164[_0x7130('0x5c')]['action'],'actionIncomplete':_0x48d164[_0x7130('0x5c')][_0x7130('0x5f')],'speech':_0x48d164['result'][_0x7130('0x60')]['speech'],'score':_0x48d164[_0x7130('0x5c')][_0x7130('0x61')],'statusCode':_0x48d164['status'][_0x7130('0x62')],'endConversation':_0x48d164['result'][_0x7130('0x63')][_0x7130('0x64')]||![],'isFallbackIntent':_0x48d164[_0x7130('0x5c')][_0x7130('0x63')][_0x7130('0x65')]};});};exports['googleDialogflowV2']=function(_0x477deb,_0x211dc8,_0x3dc2ff,_0x4a9f2e,_0x3f8fbf,_0x34420b){var _0x3719f1=_0x4a9f2e['replace'](/\\n/g,'\x0a');var _0x56475a={'credentials':{'private_key':_0x3719f1,'client_email':_0x3dc2ff}};var _0x5713db=new dialogflow['SessionsClient'](_0x56475a);var _0x5438ce=_0x5713db[_0x7130('0x66')](_0x211dc8,md5(_0x477deb));var _0x3f9de9={'session':_0x5438ce,'queryInput':{'text':{'text':_0x3f8fbf,'languageCode':_0x34420b}}};return _0x5713db['detectIntent'](_0x3f9de9)[_0x7130('0x3d')](function(_0x3c8704){if(_0x3c8704&&_0x3c8704['length']){logger[_0x7130('0x28')](_0x7130('0x67'),JSON[_0x7130('0x47')](_0x3c8704));var _0x512fc4=_0x3c8704[0x0];if(_0x512fc4){var _0x305168={'action':_0x512fc4[_0x7130('0x68')]['action'],'allRequiredParamsPresent':_0x512fc4[_0x7130('0x68')][_0x7130('0x69')],'endConversation':_0x512fc4[_0x7130('0x68')][_0x7130('0x6a')]&&_0x512fc4[_0x7130('0x68')]['diagnosticInfo']['fields']?_0x512fc4[_0x7130('0x68')]['diagnosticInfo'][_0x7130('0x6b')][_0x7130('0x6c')][_0x7130('0x6d')]:![],'fulfillmentText':_0x512fc4[_0x7130('0x68')][_0x7130('0x6e')],'intentName':_0x512fc4[_0x7130('0x68')][_0x7130('0x6f')][_0x7130('0x70')],'intentDisplayName':_0x512fc4[_0x7130('0x68')][_0x7130('0x6f')][_0x7130('0x71')],'isFallbackIntent':_0x512fc4['queryResult'][_0x7130('0x6f')][_0x7130('0x72')],'languageCode':_0x512fc4[_0x7130('0x68')][_0x7130('0x73')],'queryText':_0x512fc4['queryResult'][_0x7130('0x74')],'responseId':_0x512fc4['responseId'],'score':_0x512fc4[_0x7130('0x68')][_0x7130('0x75')],'speech':_0x512fc4['queryResult'][_0x7130('0x6e')],'providerResponse':JSON['stringify'](_0x3c8704)};return _0x305168;}}});};exports['tildeASR']=function(_0x5843a1,_0x56e36c,_0x2997a3,_0x4c8e12){return tilde[_0x7130('0x50')](_0x5843a1,_0x56e36c,_0x2997a3,_0x4c8e12)['then'](function(_0x1e2790){try{fs[_0x7130('0x20')](_0x5843a1);}catch(_0x1fc6df){logger[_0x7130('0x1f')](_0x1fc6df);}logger[_0x7130('0x28')](_0x7130('0x76'),_0x1e2790['transcript']);logger['info'](_0x7130('0x77'),_0x1e2790[_0x7130('0x78')]);return _0x1e2790;});};exports[_0x7130('0x79')]=function(_0x1bd717,_0x1b2bd9,_0xe311c4,_0x43545f,_0x2f30e6,_0x3bf2fa){var _0x48c48d=path[_0x7130('0x2a')](__dirname,_0x7130('0x2b'),rs[_0x7130('0x3e')](0x4)+_0x7130('0x3f'));var _0x12384c;return aws[_0x7130('0x7a')](_0x1bd717,_0x1b2bd9,_0xe311c4,_0x43545f,_0x2f30e6,_0x3bf2fa,_0x48c48d)[_0x7130('0x3d')](function(){_0x12384c=path[_0x7130('0x2a')](__dirname,'tmp',rs[_0x7130('0x3e')](0x4)+_0x7130('0x2c'));return convertFile(_0x48c48d,_0x12384c);})[_0x7130('0x3d')](function(){try{fs[_0x7130('0x20')](_0x48c48d);fs[_0x7130('0x2f')](_0x12384c,_0x7130('0x30'));}catch(_0x2719c8){logger[_0x7130('0x1f')](_0x2719c8);}return _0x12384c[_0x7130('0x31')]('.')[0x0];});};exports[_0x7130('0x7b')]=function(_0x180de4,_0x469ae3,_0x144e58,_0x5baca7,_0x1aa306,_0x35f07b){return aws['lex'](_0x180de4,_0x469ae3,_0x144e58,_0x5baca7,_0x1aa306,_0x35f07b)[_0x7130('0x3d')](function(_0x4b128f){logger['info'](JSON[_0x7130('0x47')](_0x4b128f));return _0x4b128f;});};exports[_0x7130('0x7c')]=function(_0x470e3d,_0x3146c3,_0x4e8808,_0x539820){var _0x211b90=util[_0x7130('0x7d')](_0x7130('0x7e'),ISPEECH_API,_0x470e3d,encodeURIComponent(_0x3146c3),_0x4e8808,_0x539820);var _0x58913b=path[_0x7130('0x2a')](__dirname,_0x7130('0x2b'),rs[_0x7130('0x3e')](0x4)+'.mp3');var _0x1a8096;return downloadFile(_0x211b90,_0x58913b)['then'](function(){_0x1a8096=path[_0x7130('0x2a')](__dirname,_0x7130('0x2b'),rs['generate'](0x4)+_0x7130('0x2c'));return convertFile(_0x58913b,_0x1a8096);})[_0x7130('0x3d')](function(){try{fs['unlink'](_0x58913b);fs[_0x7130('0x2f')](_0x1a8096,'777');}catch(_0x55759d){logger[_0x7130('0x1f')](_0x55759d);}return _0x1a8096[_0x7130('0x31')]('.')[0x0];});};exports[_0x7130('0x7f')]=function(_0xbe006b,_0x56cc3c,_0x1acb24,_0x14415f){var _0x11968f=util[_0x7130('0x7d')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x56cc3c,_0x1acb24,base64Encode(_0xbe006b),_0x14415f?util['format']('model=%s',encodeURIComponent(_0x14415f)):'freeform=3');return uploadFile(_0x11968f)[_0x7130('0x3d')](function(_0x408b1f){return querystring[_0x7130('0xb')](_0x408b1f);});};exports[_0x7130('0x80')]=function(_0x334195,_0x1e9610){return sestek[_0x7130('0x81')](_0x334195,_0x1e9610)['then'](function(_0x1d11fc){logger[_0x7130('0x28')](JSON[_0x7130('0x47')](_0x1d11fc));var _0x4f7623={'speech':_0x1d11fc[_0x7130('0x82')],'action':_0x1d11fc[_0x7130('0x83')]?_0x1d11fc[_0x7130('0x83')][_0x7130('0x84')]:undefined,'actiondata':_0x1d11fc[_0x7130('0x83')]?_0x1d11fc[_0x7130('0x83')]['CustomActionData']:undefined};if(_0x1d11fc[_0x7130('0x83')]&&_0x1d11fc[_0x7130('0x83')][_0x7130('0x85')]){return base64Decode(_0x1d11fc[_0x7130('0x83')][_0x7130('0x85')]['Data'],path[_0x7130('0x2a')](__dirname,'tmp',rs[_0x7130('0x3e')](0x4)+_0x7130('0x2c')))[_0x7130('0x3d')](function(_0x3a9f16){_0x4f7623[_0x7130('0x86')]=_0x3a9f16;return _0x4f7623;});}return _0x4f7623;});};exports[_0x7130('0x87')]=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 afa1208..499c526 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 _0xe953=['./nda'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xe953,0xde));var _0x3e95=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xe953[_0x36c6eb];return _0x30675b;};var nda=require(_0x3e95('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x21d4=['./nda','exports'];(function(_0x4a9628,_0x3790db){var _0x19d1de=function(_0x9b469d){while(--_0x9b469d){_0x4a9628['push'](_0x4a9628['shift']());}};_0x19d1de(++_0x3790db);}(_0x21d4,0x92));var _0x421d=function(_0x4c1784,_0x1ae244){_0x4c1784=_0x4c1784-0x0;var _0x343a84=_0x21d4[_0x4c1784];return _0x343a84;};var nda=require(_0x421d('0x0'));module[_0x421d('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 3bcc8be..3861d3a 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 _0x2750=['ProjectName','ndagenerate_audio','body','channelData','AudioOutputSettings','custom_action','CustomAction','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','message','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project'];(function(_0x2af170,_0x1eded5){var _0x3c9376=function(_0x6c7b0f){while(--_0x6c7b0f){_0x2af170['push'](_0x2af170['shift']());}};_0x3c9376(++_0x1eded5);}(_0x2750,0x13b));var _0x0275=function(_0x3f9ccc,_0x210bb6){_0x3f9ccc=_0x3f9ccc-0x0;var _0x1de81d=_0x2750[_0x3f9ccc];return _0x1de81d;};'use strict';var rp=require(_0x0275('0x0'));var url=require('url');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));module[_0x0275('0x3')]=function(_0x429a37,_0x101b26){var _0x41ec06={'method':_0x0275('0x4'),'uri':url[_0x0275('0x5')](_0x101b26[_0x0275('0x6')],_0x0275('0x7')),'form':{'grant_type':'password','username':_0x101b26[_0x0275('0x8')],'password':_0x101b26[_0x0275('0x9')]},'json':!![]};return rp(_0x41ec06)[_0x0275('0xa')](function(_0x2e4b5c){var _0x4dffd1={'method':_0x0275('0x4'),'uri':url[_0x0275('0x5')](_0x101b26[_0x0275('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x101b26['ndaactivity_type']||_0x0275('0xc'),'channelId':'Nda','conversation':{'id':_0x429a37[_0x0275('0xd')]},'from':{'id':_0x429a37[_0x0275('0xe')],'name':_0x429a37[_0x0275('0xf')]},'recipient':{'id':_0x429a37[_0x0275('0x10')],'name':_0x429a37[_0x0275('0x11')]},'text':_0x101b26['text'],'channelData':{}},'headers':{'Authorization':_0x0275('0x12')+_0x2e4b5c[_0x0275('0x13')]},'json':!![]};if(_0x101b26[_0x0275('0x14')]){_0x4dffd1['body']['channelData'][_0x0275('0x15')]=_0x101b26[_0x0275('0x14')];}if(_0x101b26[_0x0275('0x16')]=='1'){_0x4dffd1[_0x0275('0x17')][_0x0275('0x18')][_0x0275('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x101b26[_0x0275('0x1a')]){_0x4dffd1[_0x0275('0x17')]['channelData'][_0x0275('0x1b')]=_0x101b26[_0x0275('0x1a')];if(_0x101b26['custom_action_data']){_0x4dffd1[_0x0275('0x17')][_0x0275('0x18')]['CustomActionData']=_0x101b26['custom_action_data'];}}logger['info'](JSON['stringify'](_0x4dffd1));return rp(_0x4dffd1);});}; \ No newline at end of file +var _0x7382=['access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','custom_action_data','CustomActionData','info','stringify','url','exports','POST','resolve','/token','password','username','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','text','Bearer\x20'];(function(_0x33a2e6,_0x278e4f){var _0x56f42=function(_0x1a54b7){while(--_0x1a54b7){_0x33a2e6['push'](_0x33a2e6['shift']());}};_0x56f42(++_0x278e4f);}(_0x7382,0x1f2));var _0x2738=function(_0x15e61a,_0x1e5166){_0x15e61a=_0x15e61a-0x0;var _0x4feeeb=_0x7382[_0x15e61a];return _0x4feeeb;};'use strict';var rp=require('request-promise');var url=require(_0x2738('0x0'));var logger=require('../../../../../config/logger')('agi');module[_0x2738('0x1')]=function(_0x480143,_0x250b3c){var _0x4d5eb0={'method':_0x2738('0x2'),'uri':url[_0x2738('0x3')](_0x250b3c['ndauth_url'],_0x2738('0x4')),'form':{'grant_type':_0x2738('0x5'),'username':_0x250b3c[_0x2738('0x6')],'password':_0x250b3c[_0x2738('0x5')]},'json':!![]};return rp(_0x4d5eb0)['then'](function(_0x99e22e){var _0x20a64f={'method':_0x2738('0x2'),'uri':url[_0x2738('0x3')](_0x250b3c[_0x2738('0x7')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x250b3c[_0x2738('0x8')]||_0x2738('0x9'),'channelId':_0x2738('0xa'),'conversation':{'id':_0x480143[_0x2738('0xb')]},'from':{'id':_0x480143[_0x2738('0xc')],'name':_0x480143['calleridname']},'recipient':{'id':_0x480143['dnid'],'name':_0x480143['extension']},'text':_0x250b3c[_0x2738('0xd')],'channelData':{}},'headers':{'Authorization':_0x2738('0xe')+_0x99e22e[_0x2738('0xf')]},'json':!![]};if(_0x250b3c[_0x2738('0x10')]){_0x20a64f[_0x2738('0x11')][_0x2738('0x12')][_0x2738('0x13')]=_0x250b3c[_0x2738('0x10')];}if(_0x250b3c[_0x2738('0x14')]=='1'){_0x20a64f[_0x2738('0x11')][_0x2738('0x12')][_0x2738('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x250b3c[_0x2738('0x16')]){_0x20a64f[_0x2738('0x11')]['channelData']['CustomAction']=_0x250b3c[_0x2738('0x16')];if(_0x250b3c[_0x2738('0x17')]){_0x20a64f[_0x2738('0x11')]['channelData'][_0x2738('0x18')]=_0x250b3c[_0x2738('0x17')];}}logger[_0x2738('0x19')](JSON[_0x2738('0x1a')](_0x20a64f));return rp(_0x20a64f);});}; \ 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 abee19a..dcbfddd 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 _0x0d1a=['exports'];(function(_0x48f009,_0xa82054){var _0x6c0efc=function(_0x42585a){while(--_0x42585a){_0x48f009['push'](_0x48f009['shift']());}};_0x6c0efc(++_0xa82054);}(_0x0d1a,0x1a3));var _0xa0d1=function(_0x4cd613,_0x228cc8){_0x4cd613=_0x4cd613-0x0;var _0x1aef84=_0x0d1a[_0x4cd613];return _0x1aef84;};'use strict';var asr=require('./lib/api');module[_0xa0d1('0x0')]=function(_0x2acda0,_0x458909,_0x28ad06,_0x52ad5b){return asr(_0x2acda0,_0x458909,_0x28ad06,_0x52ad5b);}; \ No newline at end of file +var _0x88e3=['exports','./lib/api'];(function(_0x559822,_0x57ed58){var _0xa43db8=function(_0x41691e){while(--_0x41691e){_0x559822['push'](_0x559822['shift']());}};_0xa43db8(++_0x57ed58);}(_0x88e3,0x65));var _0x388e=function(_0x2c602e,_0x1d26f5){_0x2c602e=_0x2c602e-0x0;var _0x1a2650=_0x88e3[_0x2c602e];return _0x1a2650;};'use strict';var asr=require(_0x388e('0x0'));module[_0x388e('0x1')]=function(_0x2bab47,_0x2deee4,_0x4bdccb,_0x312578){return asr(_0x2bab47,_0x2deee4,_0x4bdccb,_0x312578);}; \ 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 a1391c7..716396c 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 _0x5dff=['createReadStream','data','close','EOS','error','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','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','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','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','createHash','sha1','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify'];(function(_0x43a86b,_0x419612){var _0x142593=function(_0x27e612){while(--_0x27e612){_0x43a86b['push'](_0x43a86b['shift']());}};_0x142593(++_0x419612);}(_0x5dff,0x87));var _0xf5df=function(_0x5363a3,_0x3c6310){_0x5363a3=_0x5363a3-0x0;var _0x4cd0c6=_0x5dff[_0x5363a3];return _0x4cd0c6;};'use strict';var BPromise=require(_0xf5df('0x0'));var _=require(_0xf5df('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf5df('0x2'));var crypto=require(_0xf5df('0x3'));var logger=require('../../../../../../config/logger')(_0xf5df('0x4'));module[_0xf5df('0x5')]=function(_0x3a967f,_0x282f25,_0x1f1148,_0x54099c){return new BPromise(function(_0x27e6f8,_0x3a540a){logger[_0xf5df('0x6')](_0xf5df('0x7'),_0x54099c||_0xf5df('0x8'));var _0x51c43e=new WebSocket(_0x54099c||_0xf5df('0x8'),{'perMessageDeflate':![]});var _0x429bf7='';var _0x57e4e8='0';var _0x112c78='1';var _0x34cfcb=_0xf5df('0x9');function _0xeccb2a(_0x43b07c){var _0x97c633=crypto[_0xf5df('0xa')](_0xf5df('0xb'));_0x97c633['update'](_0x43b07c);return _0x97c633[_0xf5df('0xc')]('hex');}function _0x3d815e(){try{logger[_0xf5df('0x6')](_0xf5df('0xd'));var _0x11c904=moment()[_0xf5df('0xe')]();var _0x4e8d98=_0xeccb2a(_0x11c904+_0x282f25+_0x1f1148);_0x51c43e[_0xf5df('0xf')](JSON[_0xf5df('0x10')]({'appID':_0x282f25,'timestamp':_0x11c904,'appKey':_0x4e8d98}));var _0x359151=fs[_0xf5df('0x11')](_0x3a967f);_0x359151['on'](_0xf5df('0x12'),function(_0x54fe6c){_0x51c43e[_0xf5df('0xf')](_0x54fe6c);});_0x359151['on'](_0xf5df('0x13'),function(){_0x51c43e[_0xf5df('0xf')](_0xf5df('0x14'));});}catch(_0x560194){logger[_0xf5df('0x15')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf5df('0x10')](_0x560194));_0x51c43e['terminate']();}}function _0x1be9e2(_0x33c9f4){try{if(_0x33c9f4){var _0x3fe2c3=JSON[_0xf5df('0x16')](_0x33c9f4);switch(_0x3fe2c3[_0xf5df('0x17')]){case 0x0:if(_0x3fe2c3[_0xf5df('0x18')]){if(_0x3fe2c3[_0xf5df('0x18')]['final']){logger['info'](_0xf5df('0x19'),JSON[_0xf5df('0x10')](_0x3fe2c3['result'][_0xf5df('0x1a')]));_0x429bf7=_0x3fe2c3[_0xf5df('0x18')][_0xf5df('0x1a')][0x0][_0xf5df('0x1b')];_0x57e4e8=_0x3fe2c3[_0xf5df('0x18')]['hypotheses'][0x0]['likelihood'];_0x112c78='0';_0x34cfcb=_0xf5df('0x1c');_0x51c43e['terminate']();}}break;case 0x1:logger[_0xf5df('0x6')](_0xf5df('0x9'));_0x112c78='1';_0x34cfcb=_0xf5df('0x9');break;case 0x2:logger[_0xf5df('0x6')](_0xf5df('0x1d'));_0x112c78='2';_0x34cfcb=_0xf5df('0x1d');break;case 0x9:logger[_0xf5df('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x112c78='9';_0x34cfcb=_0xf5df('0x1e');break;case 0xa:logger[_0xf5df('0x6')]('Authentication\x20failed.');_0x112c78='10';_0x34cfcb=_0xf5df('0x1f');break;case 0xb:logger[_0xf5df('0x6')](_0xf5df('0x20'));_0x112c78='11';_0x34cfcb=_0xf5df('0x20');}}}catch(_0x3f9b37){logger[_0xf5df('0x15')](_0xf5df('0x21'),JSON[_0xf5df('0x10')](_0x3f9b37));_0x51c43e['terminate']();}}function _0x16662d(){logger[_0xf5df('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x27e6f8({'transcript':_0x429bf7,'confidence':_0x57e4e8,'status':_0x112c78,'status_message':_0x34cfcb});}function _0xd196ca(_0x13ddb5){logger['error'](_0xf5df('0x22'));if(!_[_0xf5df('0x23')](_0x13ddb5)){logger['error'](_['isObject'](_0x13ddb5)?JSON[_0xf5df('0x10')](_0x13ddb5):_0x13ddb5);}}_0x51c43e['on'](_0xf5df('0x24'),_0x3d815e);_0x51c43e['on'](_0xf5df('0x25'),_0x1be9e2);_0x51c43e['on'](_0xf5df('0x13'),_0x16662d);_0x51c43e['on'](_0xf5df('0x15'),_0xd196ca);});}; \ No newline at end of file +var _0xe925=['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','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','../../../../../../config/logger','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','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','stringify','send','close','EOS','error','terminate','parse','status','final','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','Success.'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe925,0x1e9));var _0x5e92=function(_0x13654e,_0x450089){_0x13654e=_0x13654e-0x0;var _0x1881ba=_0xe925[_0x13654e];return _0x1881ba;};'use strict';var BPromise=require(_0x5e92('0x0'));var _=require(_0x5e92('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x5e92('0x2'));var crypto=require('crypto');var logger=require(_0x5e92('0x3'))(_0x5e92('0x4'));module[_0x5e92('0x5')]=function(_0x2e24ab,_0x58146c,_0x10c574,_0x182b97){return new BPromise(function(_0x1a133b,_0x25d8b6){logger[_0x5e92('0x6')](_0x5e92('0x7'),_0x182b97||_0x5e92('0x8'));var _0x51eaf2=new WebSocket(_0x182b97||_0x5e92('0x8'),{'perMessageDeflate':![]});var _0xc52202='';var _0x50e355='0';var _0x27eda6='1';var _0x50c2ff=_0x5e92('0x9');function _0x5163b6(_0x425e7e){var _0x4d55c7=crypto[_0x5e92('0xa')]('sha1');_0x4d55c7[_0x5e92('0xb')](_0x425e7e);return _0x4d55c7[_0x5e92('0xc')](_0x5e92('0xd'));}function _0x11c114(){try{logger[_0x5e92('0x6')](_0x5e92('0xe'));var _0x3b2cf4=moment()['unix']();var _0x525fc2=_0x5163b6(_0x3b2cf4+_0x58146c+_0x10c574);_0x51eaf2['send'](JSON[_0x5e92('0xf')]({'appID':_0x58146c,'timestamp':_0x3b2cf4,'appKey':_0x525fc2}));var _0x2dc823=fs['createReadStream'](_0x2e24ab);_0x2dc823['on']('data',function(_0x146a8a){_0x51eaf2[_0x5e92('0x10')](_0x146a8a);});_0x2dc823['on'](_0x5e92('0x11'),function(){_0x51eaf2[_0x5e92('0x10')](_0x5e92('0x12'));});}catch(_0xccc361){logger[_0x5e92('0x13')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0xccc361));_0x51eaf2[_0x5e92('0x14')]();}}function _0x532b8c(_0x178ff2){try{if(_0x178ff2){var _0x292540=JSON[_0x5e92('0x15')](_0x178ff2);switch(_0x292540[_0x5e92('0x16')]){case 0x0:if(_0x292540['result']){if(_0x292540['result'][_0x5e92('0x17')]){logger[_0x5e92('0x6')](_0x5e92('0x18'),JSON[_0x5e92('0xf')](_0x292540[_0x5e92('0x19')]['hypotheses']));_0xc52202=_0x292540['result'][_0x5e92('0x1a')][0x0][_0x5e92('0x1b')];_0x50e355=_0x292540[_0x5e92('0x19')][_0x5e92('0x1a')][0x0]['likelihood'];_0x27eda6='0';_0x50c2ff=_0x5e92('0x1c');_0x51eaf2[_0x5e92('0x14')]();}}break;case 0x1:logger[_0x5e92('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x27eda6='1';_0x50c2ff=_0x5e92('0x9');break;case 0x2:logger[_0x5e92('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x27eda6='2';_0x50c2ff=_0x5e92('0x1d');break;case 0x9:logger[_0x5e92('0x6')](_0x5e92('0x1e'));_0x27eda6='9';_0x50c2ff='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x5e92('0x6')](_0x5e92('0x1f'));_0x27eda6='10';_0x50c2ff=_0x5e92('0x1f');break;case 0xb:logger[_0x5e92('0x6')](_0x5e92('0x20'));_0x27eda6='11';_0x50c2ff=_0x5e92('0x20');}}}catch(_0x146f67){logger[_0x5e92('0x13')](_0x5e92('0x21'),JSON['stringify'](_0x146f67));_0x51eaf2[_0x5e92('0x14')]();}}function _0x52ecea(){logger[_0x5e92('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x1a133b({'transcript':_0xc52202,'confidence':_0x50e355,'status':_0x27eda6,'status_message':_0x50c2ff});}function _0x3802a8(_0x404da6){logger[_0x5e92('0x13')](_0x5e92('0x22'));if(!_[_0x5e92('0x23')](_0x404da6)){logger[_0x5e92('0x13')](_['isObject'](_0x404da6)?JSON[_0x5e92('0xf')](_0x404da6):_0x404da6);}}_0x51eaf2['on'](_0x5e92('0x24'),_0x11c114);_0x51eaf2['on']('message',_0x532b8c);_0x51eaf2['on'](_0x5e92('0x11'),_0x52ecea);_0x51eaf2['on']('error',_0x3802a8);});}; \ 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 993d70f..1ba843a 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 _0x979a=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x979a,0x1f1));var _0xa979=function(_0x2cb870,_0x178ba3){_0x2cb870=_0x2cb870-0x0;var _0x559f67=_0x979a[_0x2cb870];return _0x559f67;};var asr=require('./asr');module[_0xa979('0x0')]={'asr':asr}; \ No newline at end of file +var _0x2d75=['exports'];(function(_0x3f356d,_0x1bdb3d){var _0x54aff8=function(_0x1cb0f7){while(--_0x1cb0f7){_0x3f356d['push'](_0x3f356d['shift']());}};_0x54aff8(++_0x1bdb3d);}(_0x2d75,0x139));var _0x52d7=function(_0x5459b0,_0x4d2ef8){_0x5459b0=_0x5459b0-0x0;var _0x675a35=_0x2d75[_0x5459b0];return _0x675a35;};var asr=require('./asr');module[_0x52d7('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index afe1b54..1dc5428 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 87103ce..3bc6d2c 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 _0xa321=['google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','no\x20appsecret\x20configured','beep','recordFile','intKey','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','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(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','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','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','failure','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','toLowerCase','macro','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','user','bcc','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','smtpOptions','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','sms_text','sendSMS\x20message','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','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','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','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','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','shelljs','odbc','moment','mustache','../../config/logger','agi','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','lastName','isNil','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','maxRetry','retry','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','list_id','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20variable\x20found','forEach','keys','%s[%s][%s]','sip_id','no\x20user\x20selected','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','test','mindigit','maxdigit','variable_id','hiddendigitsnum','generate','hiddendigitspos','first','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP'];(function(_0x4686cc,_0x4f0d48){var _0x125b21=function(_0x3bcb6c){while(--_0x3bcb6c){_0x4686cc['push'](_0x4686cc['shift']());}};_0x125b21(++_0x4f0d48);}(_0xa321,0x9d));var _0x1a32=function(_0x2a94cf,_0x2b970d){_0x2a94cf=_0x2a94cf-0x0;var _0x22147f=_0xa321[_0x2a94cf];return _0x22147f;};'use strict';var fs=require('fs');var util=require(_0x1a32('0x0'));var _=require(_0x1a32('0x1'));var sh=require(_0x1a32('0x2'));var odbc=require(_0x1a32('0x3'))();var rs=require('randomstring');var moment=require(_0x1a32('0x4'));var Mustache=require(_0x1a32('0x5'));var rp=require('request-promise');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var scripts=require('./scripts');var FILES_PATH=_0x1a32('0x8');var recursiveMapAttributes=['rawHeaders',_0x1a32('0x9')];var verticesWithRetry=[_0x1a32('0xa'),_0x1a32('0xb'),_0x1a32('0xc')];var AGIVertices=function(_0x1d9cb6,_0x59aa55,_0x343faf){this[_0x1a32('0xd')]=_0x1d9cb6;this['rpc']=_0x59aa55;this[_0x1a32('0xe')]=_0x343faf;};AGIVertices[_0x1a32('0xf')][_0x1a32('0x10')]=function(_0x1d2439,_0x2d99fc){this[_0x1a32('0x11')]['getVariableById'](_0x1d2439)[_0x1a32('0x12')](function(_0x2c8a69){_0x2d99fc(null,_0x2c8a69?_0x2c8a69[_0x1a32('0x13')]:![]);})['catch'](function(_0x42a275){_0x2d99fc(_0x42a275);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x14')]=function(_0x1fceb9,_0x171cad){this['rpc'][_0x1a32('0x15')](_0x1fceb9)[_0x1a32('0x12')](function(_0x1838d2){_0x171cad(null,_0x1838d2?_0x1838d2[_0x1a32('0x13')]:![]);})[_0x1a32('0x16')](function(_0x2a66b2){_0x171cad(_0x2a66b2);});};AGIVertices['prototype'][_0x1a32('0x17')]=function(_0x463763,_0x47bb8e){this[_0x1a32('0x11')][_0x1a32('0x18')](_0x463763)[_0x1a32('0x12')](function(_0x3b2983){_0x47bb8e(null,_0x3b2983?_0x3b2983[_0x1a32('0x13')]:![]);})[_0x1a32('0x16')](function(_0x4141c4){_0x47bb8e(_0x4141c4);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x19')]=function(_0x17fcea,_0x2f6381){this['rpc'][_0x1a32('0x1a')](_0x17fcea)[_0x1a32('0x12')](function(_0x235fd0){_0x2f6381(null,_0x235fd0?_0x235fd0['dsn']:![]);})[_0x1a32('0x16')](function(_0xa7c5c1){_0x2f6381(_0xa7c5c1);});};AGIVertices['prototype'][_0x1a32('0x1b')]=function(_0x55c6a0,_0x125504){this[_0x1a32('0x11')]['getUserById'](_0x55c6a0)[_0x1a32('0x12')](function(_0x33fc4f){_0x125504(null,_0x33fc4f?_0x33fc4f[_0x1a32('0x13')]:![]);})['catch'](function(_0x2d6637){_0x125504(_0x2d6637);});};AGIVertices[_0x1a32('0xf')]['getTrunk']=function(_0x372b95,_0x3b46e4){this['rpc'][_0x1a32('0x1c')](_0x372b95)['then'](function(_0x4c183c){_0x3b46e4(null,_0x4c183c?_0x4c183c['name']:![]);})['catch'](function(_0x57eb3c){_0x3b46e4(_0x57eb3c);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1d')]=function(_0x4771b7,_0x2094fa){var _0x382b3c=this;this[_0x1a32('0x11')][_0x1a32('0x1e')](_0x4771b7)[_0x1a32('0x12')](function(_0x48d69d){_0x2094fa(null,_0x48d69d?_0x382b3c[_0x1a32('0x1f')](_0x48d69d[_0x1a32('0x20')]):![]);})[_0x1a32('0x16')](function(_0x10c616){_0x2094fa(_0x10c616);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x21')]=function(_0x821dbf,_0x1211e2){this[_0x1a32('0x11')]['getMailAccountById'](_0x821dbf)[_0x1a32('0x12')](function(_0x355d7f){_0x1211e2(null,_0x355d7f?_0x355d7f:![]);})['catch'](function(_0x48ae59){_0x1211e2(_0x48ae59);});};AGIVertices[_0x1a32('0xf')]['sendMailMessage']=function(_0x5b9f13,_0x1d874e,_0x4ef9fd){this['mailRpc']['sendMailMessage'](_0x5b9f13,_0x1d874e)['then'](function(){_0x4ef9fd(null);})[_0x1a32('0x16')](function(_0x1eeec4){_0x4ef9fd(_0x1eeec4);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x22')]=function(_0x367024,_0x5948b5){this['rpc'][_0x1a32('0x23')](_0x367024)['then'](function(_0xd2455c){if(_0xd2455c){if(_0xd2455c[_0x1a32('0x24')]){_0x5948b5(null,[_0xd2455c[_0x1a32('0x25')]]);}else{_0x5948b5(null,_['map'](_0xd2455c[_0x1a32('0x26')],_0x1a32('0x25')));}}else{_0x5948b5(null,![]);}})[_0x1a32('0x16')](function(_0x4648b7){_0x5948b5(_0x4648b7);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1f')]=function(_0x365ad9){return util[_0x1a32('0x27')](_0x1a32('0x28'),FILES_PATH,_0x365ad9);};AGIVertices['prototype'][_0x1a32('0x29')]=function(_0x16cf73,_0x34771a,_0x54b4e6){odbc[_0x1a32('0x2a')](_0x16cf73,function(_0x3f84a0){if(_0x3f84a0){logger[_0x1a32('0x2b')](_0x1a32('0x2c'),_0x3f84a0);_0x54b4e6(_0x3f84a0);}else{logger[_0x1a32('0x2d')](_0x1a32('0x2e'));odbc[_0x1a32('0x2f')](_0x34771a,function(_0xefae1d,_0x40be8d){if(_0xefae1d){logger[_0x1a32('0x2d')](_0x1a32('0x30'),_0x34771a);_0x54b4e6(_0xefae1d);}else{logger[_0x1a32('0x2d')](_0x1a32('0x31'),_0x34771a);odbc[_0x1a32('0x32')](function(_0x4eb4c){if(_0x4eb4c){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4eb4c);}_0x54b4e6(null,_0x40be8d);});}});}});};AGIVertices['prototype'][_0x1a32('0x33')]=function(_0x35d3ad,_0x1f1a98){this[_0x1a32('0x11')][_0x1a32('0x34')](_0x35d3ad)['then'](function(_0x14b8de){_0x1f1a98(null,_0x14b8de?_0x14b8de:![]);})[_0x1a32('0x16')](function(_0x26e308){_0x1f1a98(_0x26e308);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x35')]=function(_0x466fab,_0x554872){this[_0x1a32('0x11')][_0x1a32('0x35')](_0x466fab)[_0x1a32('0x12')](function(_0xb0186f){_0x554872(null,_0xb0186f);})[_0x1a32('0x16')](function(_0x4d779c){_0x554872(_0x4d779c);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x5e58f7,_0x3ce446,_0x85bc98){this['rpc'][_0x1a32('0x36')]({'uniqueid':this[_0x1a32('0xd')][_0x1a32('0x37')],'node':_0x5e58f7[_0x1a32('0x38')],'application':_0x5e58f7[_0x1a32('0x39')],'data':_0x3ce446||null,'project_name':this[_0x1a32('0xd')][_0x1a32('0x3a')],'callerid':this[_0x1a32('0xd')][_0x1a32('0x3b')]})[_0x1a32('0x12')](function(_0x23630e){if(_0x85bc98){_0x85bc98(null,_0x23630e);}})[_0x1a32('0x16')](function(_0x2a5f0b){if(_0x85bc98){_0x85bc98(_0x2a5f0b);}});};AGIVertices['prototype'][_0x1a32('0x3c')]=function(_0x54d77d,_0x490564,_0x43481e,_0x56409c){this[_0x1a32('0x11')]['createSquareRecording']({'uniqueid':this[_0x1a32('0xd')][_0x1a32('0x37')],'callerid':this[_0x1a32('0xd')][_0x1a32('0x3b')],'calleridname':this[_0x1a32('0xd')][_0x1a32('0x3d')],'context':this[_0x1a32('0xd')][_0x1a32('0x3e')],'extension':this[_0x1a32('0xd')]['extension'],'priority':this[_0x1a32('0xd')][_0x1a32('0x3f')],'accountcode':this[_0x1a32('0xd')]['accountcode'],'dnid':this[_0x1a32('0xd')][_0x1a32('0x40')],'projectName':this[_0x1a32('0xd')][_0x1a32('0x3a')],'saveName':_0x490564,'filename':_0x54d77d[_0x1a32('0x41')]||_0x490564,'savePath':_0x43481e})['then'](function(_0x31e568){_0x56409c(null,_0x31e568);})[_0x1a32('0x16')](function(_0x274a63){_0x56409c(_0x274a63);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x42')]=function(_0x24b75b,_0x10016c,_0x2f814b,_0x37048b,_0x508138){this[_0x1a32('0x11')][_0x1a32('0x42')]({'uniqueid':this[_0x1a32('0xd')]['uniqueid'],'body':_0x24b75b,'direction':_0x10016c,'providerName':_0x2f814b,'providerResponse':_0x37048b})[_0x1a32('0x12')](function(_0x2331ed){if(_0x508138){_0x508138(null,_0x2331ed);}})['catch'](function(_0x3b6097){if(_0x508138){_0x508138(_0x3b6097);}});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x43')]=function(_0x5e428c,_0x138a46){this[_0x1a32('0x11')]['createCmContact']({'firstName':_[_0x1a32('0x44')](_0x5e428c['name'])||_['isNil'](_0x5e428c[_0x1a32('0x13')])?'callback_'+Math['random']():_0x5e428c[_0x1a32('0x13')],'lastName':_[_0x1a32('0x44')](_0x5e428c[_0x1a32('0x45')])||_[_0x1a32('0x46')](_0x5e428c[_0x1a32('0x45')])?null:_0x5e428c[_0x1a32('0x45')],'phone':_0x5e428c[_0x1a32('0x47')],'ListId':_0x5e428c['list_id'],'scheduledat':_0x5e428c['scheduledAt'],'callbackUniqueid':this[_0x1a32('0xd')]['uniqueid'],'tags':_0x1a32('0x48'),'description':_0x1a32('0x49')+_0x5e428c[_0x1a32('0x4a')][_0x1a32('0x4b')](),'priority':_0x5e428c[_0x1a32('0x4c')]})['then'](function(_0x24b55c){_0x138a46(null,_0x24b55c);})[_0x1a32('0x16')](function(_0x9ea88e){_0x138a46(_0x9ea88e);});};AGIVertices['prototype']['getPause']=function(_0x544e84,_0x29a0b9){this[_0x1a32('0x11')][_0x1a32('0x4d')](_0x544e84)[_0x1a32('0x12')](function(_0x2dc62d){_0x29a0b9(null,_0x2dc62d?_0x2dc62d[_0x1a32('0x13')]:![]);})['catch'](function(_0x54f606){_0x29a0b9(_0x54f606);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x4e')]=function(_0x17be7e,_0x206a0a,_0xf102e3){var _0x3d1f6a={'role':_0x1a32('0x4f')};_0x3d1f6a[_0x17be7e]=this['channel'][_0x1a32('0x3b')];this[_0x1a32('0x11')][_0x1a32('0x4e')](_0x3d1f6a,_0x206a0a,this[_0x1a32('0xd')]['uniqueid'])[_0x1a32('0x12')](function(_0x308cde){_0xf102e3(null,_['isNil'](_0x308cde)?![]:!![]);})[_0x1a32('0x16')](function(_0x15fde2){logger[_0x1a32('0x2b')](_0x15fde2);_0xf102e3(null,![]);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x50')]=function(_0x2ca427,_0xa21c2d){var _0x3d55c8={'role':_0x1a32('0x4f')};_0x3d55c8[_0x2ca427]=this[_0x1a32('0xd')]['callerid'];this[_0x1a32('0x11')][_0x1a32('0x50')](_0x3d55c8)['then'](function(_0x40368f){_0xa21c2d(null,_[_0x1a32('0x46')](_0x40368f)?![]:!![]);})['catch'](function(_0x5e1017){logger[_0x1a32('0x2b')](_0x5e1017);_0xa21c2d(null,![]);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x51')]=function(_0x32b3cb,_0x3c034a){var _0x3b5084={'role':_0x1a32('0x4f')};_0x3b5084[_0x32b3cb]=this['channel'][_0x1a32('0x3b')];this[_0x1a32('0x11')]['agentLogout'](_0x3b5084)[_0x1a32('0x12')](function(_0x857ce9){_0x3c034a(null,_[_0x1a32('0x46')](_0x857ce9)?![]:!![]);})[_0x1a32('0x16')](function(_0xaf8e55){logger[_0x1a32('0x2b')](_0xaf8e55);_0x3c034a(null,![]);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x52')]=function(_0x2c6405,_0x2b6426){var _0x2c3954={'role':_0x1a32('0x4f')};_0x2c3954[_0x2c6405]=this['channel']['callerid'];var _0x29ee6d=_0x2c6405!=_0x1a32('0x53')?util[_0x1a32('0x27')](_0x1a32('0x54'),_0x1a32('0x55'),this['channel']['callerid']):undefined;this[_0x1a32('0x11')][_0x1a32('0x52')](_0x2c3954,_0x29ee6d)['then'](function(_0x165dd3){_0x2b6426(null,_[_0x1a32('0x46')](_0x165dd3)?![]:!![]);})[_0x1a32('0x16')](function(_0x5d2de7){logger['error'](_0x5d2de7);_0x2b6426(null,![]);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x56')]=function(_0x1b7a9e,_0x1375c1){sh[_0x1a32('0x57')](_['trim'](_0x1b7a9e),function(_0x5a4015,_0x241d6b){var _0x125b2=_0x241d6b[_0x1a32('0x58')](/(\r\n|\n|\r)/gm,'');_0x1375c1(null,_0x125b2);});};AGIVertices['prototype'][_0x1a32('0x59')]=function(_0x3447db,_0x2276c1){scripts['googleCloudTTS'](_0x3447db['apiKey'],_0x3447db['google_cloud_tts_text_type']||_0x1a32('0x5a'),_0x3447db[_0x1a32('0x5a')],_0x3447db[_0x1a32('0x5b')]||'en-US',_0x3447db[_0x1a32('0x5c')]||_0x1a32('0x5d'),_0x3447db[_0x1a32('0x5e')]||_0x1a32('0x5f'))[_0x1a32('0x12')](function(_0x2a5566){_0x2276c1(null,_0x2a5566);})[_0x1a32('0x16')](function(_0x194207){_0x2276c1(_0x194207);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x60')]=function(_0x5822fd,_0x2105d8){scripts[_0x1a32('0x60')](_0x5822fd[_0x1a32('0x5a')],_0x5822fd[_0x1a32('0x61')]||'en',0x1)[_0x1a32('0x12')](function(_0xac19e1){_0x2105d8(null,_0xac19e1);})[_0x1a32('0x16')](function(_0x22218f){_0x2105d8(_0x22218f);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x62')]=function(_0x191353,_0x1baba7){var _0x3f8f3f={'uri':_0x191353[_0x1a32('0x63')],'method':_0x191353['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x191353[_0x1a32('0x64')])===_0x1a32('0x65')&&parseInt(_0x191353['timeout'])>=0x1?parseInt(_0x191353['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x1a32('0x66')]([_0x1a32('0x67'),_0x1a32('0x68')],_0x3f8f3f[_0x1a32('0x69')][_0x1a32('0x6a')]())){try{_0x3f8f3f[_0x1a32('0x6b')]=_0x191353[_0x1a32('0x9')]?JSON[_0x1a32('0x6c')](_0x191353[_0x1a32('0x9')]):{};}catch(_0x16b1c5){logger[_0x1a32('0x2b')](_0x1a32('0x6d'),_0x16b1c5);}}try{_0x3f8f3f[_0x1a32('0x6e')]=_0x191353[_0x1a32('0x6f')]?JSON[_0x1a32('0x6c')](_0x191353[_0x1a32('0x6f')]):{};}catch(_0x468080){logger[_0x1a32('0x2b')](_0x1a32('0x70'),_0x468080);}if(_0x191353[_0x1a32('0x71')]){try{var _0x3e009a=require(_0x191353[_0x1a32('0x71')])[_0x1a32('0x72')](this,_0x3f8f3f);_0x3f8f3f[_0x1a32('0x73')]=Mustache['render'](_0x191353['url'],_0x3e009a,{},['$$','$$']);if(_0x3f8f3f[_0x1a32('0x6e')]){_0x3f8f3f['headers']=JSON[_0x1a32('0x6c')](Mustache[_0x1a32('0x74')](JSON[_0x1a32('0x75')](_0x3f8f3f[_0x1a32('0x6e')]),_0x3e009a,{},['$$','$$']));}if(_0x3f8f3f[_0x1a32('0x6b')]){_0x3f8f3f[_0x1a32('0x6b')]=JSON[_0x1a32('0x6c')](Mustache['render'](JSON[_0x1a32('0x75')](_0x3f8f3f[_0x1a32('0x6b')]),_0x3e009a,{},['$$','$$']));}}catch(_0xc9c61a){logger[_0x1a32('0x2b')](_0x1a32('0x76'),_0xc9c61a);}}rp(_0x3f8f3f)[_0x1a32('0x12')](function(_0x6cdb87){var _0x40c75b={'statusCode':_0x6cdb87[_0x1a32('0x77')]||0xc8,'statusMessage':_0x6cdb87[_0x1a32('0x78')]||'OK','headers':_0x6cdb87[_0x1a32('0x6e')]||{},'body':_0x6cdb87['body']||{}};_0x1baba7(null,_0x40c75b);})['catch'](function(_0x19e443){var _0x46137c={'statusCode':_0x19e443[_0x1a32('0x77')]||0x1f4,'statusMessage':_0x19e443[_0x1a32('0x79')]||_0x1a32('0x7a'),'headers':_0x19e443[_0x1a32('0x7b')][_0x1a32('0x6e')]||{},'body':_0x19e443[_0x1a32('0x7b')]['body']||{}};_0x1baba7(null,_0x46137c);});};AGIVertices['prototype'][_0x1a32('0x7c')]=function(_0x38b325,_0x34d8e9){scripts['googleDialogflow'](this[_0x1a32('0xd')]['uniqueid'],_0x38b325[_0x1a32('0x7d')],_0x38b325['text'],_0x38b325[_0x1a32('0x7e')]||'en')[_0x1a32('0x12')](function(_0x160460){_0x34d8e9(null,_0x160460);})[_0x1a32('0x16')](function(_0x117f58){_0x34d8e9(_0x117f58);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x37dde6,_0x334c4e){scripts[_0x1a32('0x7f')](this[_0x1a32('0xd')][_0x1a32('0x37')],_0x37dde6[_0x1a32('0x80')],_0x37dde6[_0x1a32('0x81')],_0x37dde6[_0x1a32('0x82')],_0x37dde6['text'],_0x37dde6[_0x1a32('0x83')]||'en')[_0x1a32('0x12')](function(_0x52b52b){_0x334c4e(null,_0x52b52b);})[_0x1a32('0x16')](function(_0x568991){_0x334c4e(_0x568991);});};AGIVertices['prototype'][_0x1a32('0x84')]=function(_0x4cae20,_0x20c316){scripts[_0x1a32('0x84')](this['channel'],_0x4cae20)[_0x1a32('0x12')](function(_0x3d6e75){_0x20c316(null,_0x3d6e75);})[_0x1a32('0x16')](function(_0x47605a){_0x20c316(_0x47605a);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x85')]=function(_0x2f101f,_0x592b38){scripts['ispeechTTS'](_0x2f101f[_0x1a32('0x7d')],_0x2f101f[_0x1a32('0x5a')],_0x2f101f['ispeech_tts_language']||_0x1a32('0x86'),_0x2f101f['speed'])[_0x1a32('0x12')](function(_0x113434){_0x592b38(null,_0x113434);})[_0x1a32('0x16')](function(_0x19154c){_0x592b38(_0x19154c);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x87')]=function(_0x330c2b,_0x57164d,_0x106984){scripts[_0x1a32('0x87')](_0x57164d,_0x330c2b[_0x1a32('0x7d')],_0x330c2b[_0x1a32('0x88')]||_0x1a32('0x86'),this[_0x1a32('0x89')](_0x330c2b[_0x1a32('0x8a')])?_0x330c2b['model']:undefined)[_0x1a32('0x12')](function(_0x519296){_0x106984(null,_0x519296);})['catch'](function(_0x205ad6){_0x106984(_0x205ad6);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x8b')]=function(_0x236636,_0x2cbd2f){scripts['awsPolly'](_0x236636[_0x1a32('0x8c')],_0x236636[_0x1a32('0x8d')],_0x236636[_0x1a32('0x8e')],_0x236636[_0x1a32('0x8f')]||_0x1a32('0x90'),_0x236636[_0x1a32('0x5a')],_0x236636['aws_text_type']||'text')[_0x1a32('0x12')](function(_0x245124){_0x2cbd2f(null,_0x245124);})[_0x1a32('0x16')](function(_0x437f57){_0x2cbd2f(_0x437f57);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x91')]=function(_0x4af005,_0x39f236){scripts[_0x1a32('0x91')](this[_0x1a32('0xd')]['uniqueid'],_0x4af005[_0x1a32('0x8c')],_0x4af005['aws_secret_access_key'],_0x4af005[_0x1a32('0x92')],_0x4af005[_0x1a32('0x5a')],_0x4af005['aws_bot_name'])[_0x1a32('0x12')](function(_0x50d584){_0x39f236(null,_0x50d584);})['catch'](function(_0x25dacd){_0x39f236(_0x25dacd);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x93')]=function(_0xf9c7bf,_0x35efc4,_0x27c971){scripts[_0x1a32('0x93')](_0x35efc4,_0xf9c7bf[_0x1a32('0x7d')],_0xf9c7bf[_0x1a32('0x94')]||_0x1a32('0x86'))[_0x1a32('0x12')](function(_0x5bee01){_0x27c971(null,_0x5bee01);})[_0x1a32('0x16')](function(_0x3d67d1){_0x27c971(_0x3d67d1);});};AGIVertices[_0x1a32('0xf')][_0x1a32('0x95')]=function(_0x431bf4,_0x19bbed,_0x2763b1){scripts[_0x1a32('0x95')](_0x19bbed,_0x431bf4[_0x1a32('0x96')],_0x431bf4[_0x1a32('0x97')],_0x431bf4[_0x1a32('0x73')])[_0x1a32('0x12')](function(_0x5ef9f2){_0x2763b1(null,_0x5ef9f2);})['catch'](function(_0x448131){_0x2763b1(_0x448131);});};AGIVertices[_0x1a32('0xf')]['clear']=function(_0x48b990){var _0x42c24c=_[_0x1a32('0x66')](verticesWithRetry,_0x48b990[_0x1a32('0x39')])?_0x48b990:_['clone'](_0x48b990);for(var _0x13fa2c in _0x42c24c){if(_0x42c24c[_0x1a32('0x98')](_0x13fa2c)){if(_0x42c24c[_0x13fa2c]&&_['isString'](_0x42c24c[_0x13fa2c])){if(_['includes'](recursiveMapAttributes,_0x13fa2c)){_0x42c24c[_0x13fa2c]=this[_0x1a32('0x99')](_0x42c24c[_0x13fa2c]);}else{_0x42c24c[_0x13fa2c]=this[_0x1a32('0x9a')](_0x42c24c[_0x13fa2c]);}}}}return _0x42c24c;};AGIVertices[_0x1a32('0xf')]['recursiveNodeIndex']=function(_0x3abb3d){for(var _0x22c50f in _0x3abb3d){if(_0x3abb3d[_0x1a32('0x98')](_0x22c50f)){if(_['isPlainObject'](_0x3abb3d[_0x22c50f])){this[_0x1a32('0x9b')](_0x3abb3d[_0x22c50f]);}else if(_[_0x1a32('0x9c')](_0x3abb3d[_0x22c50f])){for(var _0x15ca3f=0x0;_0x15ca3f<_0x3abb3d[_0x22c50f][_0x1a32('0x9d')];_0x15ca3f++){this[_0x1a32('0x9b')](_0x3abb3d[_0x22c50f][_0x15ca3f]);}}else if(_[_0x1a32('0x9e')](_0x3abb3d[_0x22c50f])){_0x3abb3d[_0x22c50f]=this[_0x1a32('0x9a')](_0x3abb3d[_0x22c50f]);}}}};AGIVertices[_0x1a32('0xf')][_0x1a32('0x9f')]=function(_0x42897f,_0x2b02b1){for(var _0x49100a in _0x42897f){if(_0x42897f['hasOwnProperty'](_0x49100a)){if(_['isPlainObject'](_0x42897f[_0x49100a])){if(!_[_0x1a32('0x44')](_0x42897f[_0x49100a])){this[_0x1a32('0x9f')](_0x42897f[_0x49100a],util['format'](_0x1a32('0xa0'),_0x2b02b1,_0x49100a));}}else if(_[_0x1a32('0x9c')](_0x42897f[_0x49100a])){for(var _0x49378c=0x0;_0x49378c<_0x42897f[_0x49100a][_0x1a32('0x9d')];_0x49378c++){this['saveRestApiResult'](_0x42897f[_0x49100a][_0x49378c],util['format'](_0x1a32('0xa0'),_0x2b02b1,_0x49100a+'['+_0x49378c+']'));}}else{if(!_[_0x1a32('0x46')](_0x42897f[_0x49100a])){this[_0x1a32('0xd')][_0x1a32('0xa1')](util[_0x1a32('0x27')](_0x1a32('0xa0'),_0x2b02b1,_0x49100a),_0x42897f[_0x49100a]);}}}}};AGIVertices[_0x1a32('0xf')][_0x1a32('0x99')]=function(_0x32c565){try{var _0x4d9048=JSON['parse'](_0x32c565);this['recursiveNodeIndex'](_0x4d9048);return JSON[_0x1a32('0x75')](_0x4d9048);}catch(_0x56143f){return this[_0x1a32('0x9a')](_0x32c565);}};AGIVertices[_0x1a32('0xf')]['replaceAllVariables']=function(_0x809276){var _0x4e22c3=_0x809276['split']('{');for(var _0x4a50a7=0x1;_0x4a50a7<_0x4e22c3[_0x1a32('0x9d')];_0x4a50a7+=0x1){var _0x5d18e5=_0x4e22c3[_0x4a50a7][_0x1a32('0xa2')]('}');if(_0x5d18e5['length']>0x1){_0x809276=_0x809276[_0x1a32('0xa3')]('{'+_0x5d18e5[0x0]+'}',this['channel']['getVariable'](_0x5d18e5[0x0])[_0x1a32('0xa4')]||_0x5d18e5[0x0]);}}if(_0x4e22c3['length']===0x1){return _0x809276['toString']();}return this[_0x1a32('0x9a')](_0x809276);};AGIVertices['prototype']['getAndSetVariable']=function(_0x689c9f,_0x1faf0d){var _0x23468d=this[_0x1a32('0xd')][_0x1a32('0x10')](_0x689c9f);if(_0x23468d['result']===-0x1){return _0x23468d;}logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1faf0d,_0x23468d[_0x1a32('0xa4')]));return this[_0x1a32('0xd')][_0x1a32('0xa1')](_0x1faf0d,_0x23468d[_0x1a32('0xa4')]);};AGIVertices[_0x1a32('0xf')][_0x1a32('0x89')]=function(_0xef1bc1){return _0xef1bc1&&_0xef1bc1!=='0'&&_0xef1bc1!=='-1'&&_0xef1bc1!=='';};AGIVertices['prototype'][_0x1a32('0xa5')]=function(_0x1149c4){this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x1149c4,'-');_0x1149c4[_0x1a32('0xa6')]=_0x1149c4[_0x1a32('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1a32('0xf')]['mrcpsynth']=function(_0x2b5208){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2b5208[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x2b5208['text'])){return this['channel'][_0x1a32('0xa7')](_0x1a32('0xa8'));}var _0xe537fa='\x22'+_0x2b5208[_0x1a32('0x5a')]+'\x22';if(this['isConfigured'](_0x2b5208['options'])){_0xe537fa+=','+_0x2b5208['options'];}var _0x2ce9c0=this[_0x1a32('0xd')][_0x1a32('0x57')](_0x1a32('0xa9'),_0xe537fa);if(_0x2ce9c0[_0x1a32('0xaa')]===-0x1){return _0x2ce9c0;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0xab'),_0xe537fa));};AGIVertices['prototype'][_0x1a32('0xac')]=function(_0x52e13f){logger['info'](util['format'](_0x1a32('0xad'),_0x52e13f[_0x1a32('0x38')]));if(!this['isConfigured'](_0x52e13f[_0x1a32('0xae')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')]('no\x20grammar\x20configured');}var _0x7db4d6=_0x52e13f[_0x1a32('0xae')];if(this[_0x1a32('0x89')](_0x52e13f['options'])){_0x7db4d6+=','+_0x52e13f[_0x1a32('0x7b')];}var _0x2cb926=this['channel'][_0x1a32('0x57')](_0x1a32('0xaf'),_0x7db4d6);if(_0x2cb926[_0x1a32('0xaa')]===-0x1){return _0x2cb926;}var _0x30d6da=this['getAndSetVariable'](_0x1a32('0xb0'),_0x1a32('0xb1'));if(_0x30d6da[_0x1a32('0xaa')]===-0x1){return _0x30d6da;}var _0x2c1362=this[_0x1a32('0xb2')](_0x1a32('0xb3'),_0x1a32('0xb4'));if(_0x2c1362[_0x1a32('0xaa')]===-0x1){return _0x2c1362;}var _0x284675=this[_0x1a32('0xb2')]('RECOG_INSTANCE()',_0x1a32('0xb5'));if(_0x284675[_0x1a32('0xaa')]===-0x1){return _0x284675;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0xb6'),_0x7db4d6));};AGIVertices['prototype']['agi']=function(_0x328e1f){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0xb7'),_0x328e1f['label']));return this[_0x1a32('0xd')][_0x1a32('0x7')]([_0x328e1f['command'],_0x328e1f['args']]);};AGIVertices['prototype'][_0x1a32('0xb8')]=function(_0x4375b6){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0xb9'),_0x4375b6[_0x1a32('0x38')]));if(this['isConfigured'](_0x4375b6[_0x1a32('0x64')])){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0xba'),_0x4375b6[_0x1a32('0x64')]));var _0x170f47=this['channel'][_0x1a32('0xbb')](_0x4375b6[_0x1a32('0x64')]);if(_0x170f47['result']===-0x1){return _0x170f47;}}return this[_0x1a32('0xd')]['answer']();};AGIVertices[_0x1a32('0xf')][_0x1a32('0x48')]=function(_0x254de1){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0xbc'),_0x254de1[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x254de1['list_id'])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x254de1,_0x1a32('0xbd'));}_0x254de1[_0x1a32('0x4a')]=moment();if(this[_0x1a32('0x89')](_0x254de1[_0x1a32('0xbe')])){_0x254de1['scheduledAt']=moment()[_0x1a32('0xbf')](_0x254de1['delay'],_0x1a32('0xc0'));}if(!this[_0x1a32('0x89')](_0x254de1[_0x1a32('0x4c')])){_0x254de1[_0x1a32('0x4c')]=0x2;}this[_0x1a32('0x43')]['sync'](this,_0x254de1);return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0xc1'),_0x254de1[_0x1a32('0x47')],_0x254de1[_0x1a32('0xc2')],_0x254de1[_0x1a32('0x4a')]));};AGIVertices[_0x1a32('0xf')][_0x1a32('0xc3')]=function(_0x24d8e6){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0xc4'),_0x24d8e6['label']));var _0x4c1821=this[_0x1a32('0xd')][_0x1a32('0x57')](_0x24d8e6[_0x1a32('0xc5')],_0x24d8e6[_0x1a32('0x7b')]);if(_0x4c1821[_0x1a32('0xaa')]===-0x1){return _0x4c1821;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0xc6'),_0x24d8e6[_0x1a32('0xc5')],_0x24d8e6[_0x1a32('0x7b')]));};AGIVertices[_0x1a32('0xf')][_0x1a32('0xc7')]=function(_0x110074){logger['info'](util[_0x1a32('0x27')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x110074['label']));if(!this[_0x1a32('0x89')](_0x110074[_0x1a32('0x5a')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xa8'));}var _0x413b39='\x22'+_0x110074['text']+'\x22';if(this[_0x1a32('0x89')](_0x110074['options'])){_0x413b39+=','+_0x110074[_0x1a32('0x7b')];}var _0x301457=this['channel'][_0x1a32('0x57')](_0x1a32('0xa9'),_0x413b39);if(_0x301457[_0x1a32('0xaa')]===-0x1){return _0x301457;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format'](_0x1a32('0xab'),_0x413b39));};AGIVertices[_0x1a32('0xf')]['sestektts']=function(_0x29072e){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0xc8'),_0x29072e[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x29072e[_0x1a32('0x5a')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xa8'));}var _0x3a2c05='\x22'+_0x29072e[_0x1a32('0x5a')]+'\x22';if(this[_0x1a32('0x89')](_0x29072e[_0x1a32('0x7b')])){_0x3a2c05+=','+_0x29072e[_0x1a32('0x7b')];}var _0x3fc8ee=this['channel'][_0x1a32('0x57')]('MRCPSynth',_0x3a2c05);if(_0x3fc8ee['result']===-0x1){return _0x3fc8ee;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format'](_0x1a32('0xab'),_0x3a2c05));};AGIVertices[_0x1a32('0xf')][_0x1a32('0xc9')]=function(_0x3abb1c){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0xca'),_0x3abb1c['label']));if(!this['isConfigured'](_0x3abb1c[_0x1a32('0xae')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xcb'));}var _0x1757e2=_0x3abb1c[_0x1a32('0xae')];if(this[_0x1a32('0x89')](_0x3abb1c['options'])){_0x1757e2+=','+_0x3abb1c[_0x1a32('0x7b')];}var _0x1c246b=this[_0x1a32('0xd')][_0x1a32('0x57')](_0x1a32('0xaf'),_0x1757e2);if(_0x1c246b[_0x1a32('0xaa')]===-0x1){return _0x1c246b;}var _0x5c5102=this[_0x1a32('0xb2')](_0x1a32('0xb0'),_0x1a32('0xcc'));if(_0x5c5102[_0x1a32('0xaa')]===-0x1){return _0x5c5102;}var _0x3bbacb=this[_0x1a32('0xb2')]('RECOG_INPUT()',_0x1a32('0xcd'));if(_0x3bbacb[_0x1a32('0xaa')]===-0x1){return _0x3bbacb;}var _0x30bfa0=this['getAndSetVariable'](_0x1a32('0xce'),'LUMENVOX_ASR_INSTANCE');if(_0x30bfa0[_0x1a32('0xaa')]===-0x1){return _0x30bfa0;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format'](_0x1a32('0xb6'),_0x1757e2));};AGIVertices[_0x1a32('0xf')][_0x1a32('0xcf')]=function(_0x44f871){logger['info'](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x44f871[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x44f871['grammar'])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xcb'));}var _0x40b13b=_0x44f871['grammar'];if(this['isConfigured'](_0x44f871[_0x1a32('0x7b')])){_0x40b13b+=','+_0x44f871[_0x1a32('0x7b')];}var _0xad17fd=this[_0x1a32('0xd')][_0x1a32('0x57')]('MRCPRecog',_0x40b13b);if(_0xad17fd['result']===-0x1){return _0xad17fd;}var _0x51d19a=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x1a32('0xd0'));if(_0x51d19a[_0x1a32('0xaa')]===-0x1){return _0x51d19a;}var _0x4db394=this['getAndSetVariable'](_0x1a32('0xb3'),_0x1a32('0xd1'));if(_0x4db394[_0x1a32('0xaa')]===-0x1){return _0x4db394;}var _0x5f2d80=this[_0x1a32('0xb2')](_0x1a32('0xce'),_0x1a32('0xd2'));if(_0x5f2d80[_0x1a32('0xaa')]===-0x1){return _0x5f2d80;}return this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0xb6'),_0x40b13b));};AGIVertices[_0x1a32('0xf')]['database']=function(_0x32de65){logger['info'](util[_0x1a32('0x27')](_0x1a32('0xd3'),_0x32de65[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x32de65[_0x1a32('0xd4')])){return this['channel']['error'](_0x32de65,_0x1a32('0xd5'));}var _0x3326c2=this['getSquareOdbc'][_0x1a32('0x72')](this,_0x32de65[_0x1a32('0xd4')]);if(!_0x3326c2){return this['channel']['error'](_0x32de65,'no\x20odbc\x20database\x20found');}if(!this[_0x1a32('0x89')](_0x32de65['query'])){return this[_0x1a32('0xd')]['error'](_0x32de65,'no\x20query\x20configured');}var _0x30c8e1=_0x32de65['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')]('query:\x20%s',_0x30c8e1));var _0x3c31ab=this['getQueryOdbc'][_0x1a32('0x72')](this,_0x3326c2,_0x30c8e1);this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x32de65,_0x30c8e1);if(!this[_0x1a32('0x89')](_0x32de65['variable_id'])){return this['channel'][_0x1a32('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4b9fc9=this[_0x1a32('0x10')][_0x1a32('0x72')](this,_0x32de65['variable_id']);if(!_0x4b9fc9){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x32de65,_0x1a32('0xd6'));}var _0x5a35a8=this;_0x3c31ab[_0x1a32('0xd7')](function(_0x59b434,_0x1d4bf5){Object[_0x1a32('0xd8')](_0x59b434)[_0x1a32('0xd7')](function(_0x239df4){_0x5a35a8[_0x1a32('0xd')][_0x1a32('0xa1')](util['format'](_0x1a32('0xd9'),_0x4b9fc9,_0x1d4bf5,_0x239df4),_0x59b434[_0x239df4]);});});this[_0x1a32('0xd')]['setVariable'](util['format']('%s_ROWS_COUNT',_0x4b9fc9),_0x3c31ab['length']);return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')]('variable\x20%s\x20set',_0x4b9fc9));};AGIVertices['prototype']['dial']=function(_0x34e210){logger['debug'](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x34e210[_0x1a32('0x38')]));if(!this['isConfigured'](_0x34e210[_0x1a32('0xda')])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x34e210,_0x1a32('0xdb'));}var _0x4d0f89=this[_0x1a32('0x1b')][_0x1a32('0x72')](this,_0x34e210[_0x1a32('0xda')]);if(!_0x4d0f89){return this[_0x1a32('0xd')]['error'](_0x34e210,'no\x20user\x20found');}var _0x1b3811=this[_0x1a32('0xd')]['exec'](_0x1a32('0xdc'),[util[_0x1a32('0x27')](_0x1a32('0xdd'),_0x4d0f89),_0x34e210[_0x1a32('0x64')],_0x34e210['opts'],_0x34e210[_0x1a32('0x63')]]);if(_0x1b3811[_0x1a32('0xaa')]===-0x1){return _0x1b3811;}return this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0xde'),_0x1a32('0xdc')));};AGIVertices[_0x1a32('0xf')][_0x1a32('0xdf')]=function(_0x5226de){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0xe0'),_0x5226de[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x5226de[_0x1a32('0x7d')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xe1'));}if(!this[_0x1a32('0x89')](_0x5226de[_0x1a32('0x5a')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xa8'));}this[_0x1a32('0xd')][_0x1a32('0xe2')]=!![];this['createSquareDetailsReport'](_0x5226de);this['createSquareMessage'](_0x5226de[_0x1a32('0x5a')],'in','','');this[_0x1a32('0xd')]['noop'](util['format'](_0x1a32('0xe3'),_0x5226de[_0x1a32('0x5a')]));var _0x2cb122=this[_0x1a32('0x7c')][_0x1a32('0x72')](this,_0x5226de);if(_0x2cb122){for(var _0x50c286 in _0x2cb122){if(_0x2cb122[_0x1a32('0x98')](_0x50c286)){this[_0x1a32('0xd')][_0x1a32('0xa1')](util[_0x1a32('0x27')]('DIALOGFLOW_%s',_0x50c286[_0x1a32('0x6a')]()),_0x2cb122[_0x50c286]);}}this[_0x1a32('0x42')](_0x2cb122[_0x1a32('0xe4')],'out','dialogflow','');return this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0xe5'),_0x2cb122['speech']));}return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x5226de,_0x1a32('0xe6'));};AGIVertices[_0x1a32('0xf')][_0x1a32('0xe7')]=function(_0x415e1d){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x415e1d[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x415e1d[_0x1a32('0x80')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xe8'));}if(!this[_0x1a32('0x89')](_0x415e1d[_0x1a32('0x81')])){return this['channel'][_0x1a32('0xa7')](_0x1a32('0xe9'));}if(!this['isConfigured'](_0x415e1d[_0x1a32('0x82')])){return this['channel'][_0x1a32('0xa7')](_0x1a32('0xea'));}if(!this['isConfigured'](_0x415e1d[_0x1a32('0x83')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xeb'));}if(!this[_0x1a32('0x89')](_0x415e1d[_0x1a32('0x5a')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x1a32('0xd')]['bot']=!![];this[_0x1a32('0x36')](_0x415e1d);this[_0x1a32('0x42')](_0x415e1d['text'],'in','','');this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')]('Trying\x20DialogflowV2:\x20%s',_0x415e1d['text']));var _0x5bd73a=this[_0x1a32('0x7f')][_0x1a32('0x72')](this,_0x415e1d);if(_0x5bd73a){for(var _0x4af6f3 in _0x5bd73a){if(_0x5bd73a[_0x1a32('0x98')](_0x4af6f3)){if(_0x4af6f3!==_0x1a32('0xec')){this[_0x1a32('0xd')][_0x1a32('0xa1')](util['format'](_0x1a32('0xed'),_0x4af6f3[_0x1a32('0x6a')]()),_0x5bd73a[_0x4af6f3]);}}}this[_0x1a32('0x42')](_0x5bd73a[_0x1a32('0xe4')],_0x1a32('0xee'),_0x1a32('0xe7'),_0x5bd73a[_0x1a32('0xec')]);return this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0xef'),_0x5bd73a[_0x1a32('0xe4')]));}return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x415e1d,_0x1a32('0xf0'));};AGIVertices[_0x1a32('0xf')]['sesteknda']=function(_0x514ef3){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0xf1'),_0x514ef3[_0x1a32('0x38')]));if(!this['isConfigured'](_0x514ef3[_0x1a32('0xf2')])){return this['channel']['noop'](_0x1a32('0xf3'));}if(!this[_0x1a32('0x89')](_0x514ef3[_0x1a32('0xf4')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')]('no\x20username\x20configured');}if(!this[_0x1a32('0x89')](_0x514ef3['password'])){return this[_0x1a32('0xd')][_0x1a32('0xa7')]('no\x20password\x20configured');}if(!this[_0x1a32('0x89')](_0x514ef3[_0x1a32('0xf5')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xa8'));}this[_0x1a32('0xd')][_0x1a32('0xe2')]=!![];this['createSquareDetailsReport'](_0x514ef3);this[_0x1a32('0x42')](_0x514ef3['text'],'in','','');this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0xf6'),_0x514ef3[_0x1a32('0x5a')]));var _0x13e623=this[_0x1a32('0x84')][_0x1a32('0x72')](this,_0x514ef3);if(_0x13e623){for(var _0x5c5e14 in _0x13e623){if(_0x13e623[_0x1a32('0x98')](_0x5c5e14)){this[_0x1a32('0xd')][_0x1a32('0xa1')](util['format'](_0x1a32('0xf7'),_0x5c5e14[_0x1a32('0x6a')]()),_0x13e623[_0x5c5e14]);}}this[_0x1a32('0x42')](_0x13e623[_0x1a32('0xe4')],_0x1a32('0xee'),_0x1a32('0xf8'),'');if(_0x13e623['audiofile']){this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0xf9'),_0x13e623[_0x1a32('0xfa')]));var _0x5df138=this[_0x1a32('0xd')]['streamFile'](_0x13e623[_0x1a32('0xfa')]);try{fs[_0x1a32('0xfb')](_0x13e623[_0x1a32('0xfa')]+'.wav');}catch(_0x2ee50f){logger[_0x1a32('0x2b')](_0x2ee50f);}return _0x5df138;}else{return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')]('SestekNDA\x20Result\x20%s',_0x13e623['speech']));}}return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x514ef3,_0x1a32('0xfc'));};AGIVertices[_0x1a32('0xf')]['end']=function(_0x53f79c){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('Enter\x20in\x20END\x20(%s)\x20block',_0x53f79c[_0x1a32('0x38')]));return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xfd'));};AGIVertices['prototype'][_0x1a32('0xfe')]=function(_0x103c09){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x103c09['label']));var _0x11396d='';if(_0x103c09['trunk_id']){if(!this[_0x1a32('0x89')](_0x103c09[_0x1a32('0xff')])){return this['channel'][_0x1a32('0x2b')](_0x103c09,_0x1a32('0x100'));}else{var _0x2f3902=parseInt(_0x103c09[_0x1a32('0xff')],0xa);if(isNaN(_0x2f3902)){_0x11396d=_0x103c09[_0x1a32('0xff')];}else{_0x11396d=this['getTrunk']['sync'](this,_0x103c09[_0x1a32('0xff')]);if(!_0x11396d){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x103c09,_0x1a32('0x101'));}}}}else if(_0x103c09[_0x1a32('0x102')]){_0x11396d=_0x103c09[_0x1a32('0x102')];}else{return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x103c09,_0x1a32('0x100'));}var _0x15abab=this[_0x1a32('0xd')][_0x1a32('0x57')](_0x1a32('0xdc'),[util[_0x1a32('0x27')](_0x1a32('0x103'),_0x11396d,_0x103c09[_0x1a32('0x47')]),_0x103c09['timeout'],_0x103c09[_0x1a32('0x104')],_0x103c09[_0x1a32('0x63')]]);if(_0x15abab[_0x1a32('0xaa')]===-0x1){return _0x15abab;}return this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')]('Executed\x20command\x20%s',_0x1a32('0xdc')));};AGIVertices[_0x1a32('0xf')]['finally']=function(_0x132434){logger['info'](util['format'](_0x1a32('0x105'),_0x132434[_0x1a32('0x38')]));return this['channel']['noop'](_0x1a32('0x106'));};AGIVertices[_0x1a32('0xf')][_0x1a32('0xb')]=function(_0x4b050e){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x107'),_0x4b050e['label']));if(_0x4b050e[_0x1a32('0xa6')]===0x0){return this[_0x1a32('0xa5')](_0x4b050e);}_0x4b050e[_0x1a32('0xa6')]-=0x1;if(!this[_0x1a32('0x89')](_0x4b050e[_0x1a32('0x108')])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x4b050e,_0x1a32('0x109'));}var _0x3c6e8b=this[_0x1a32('0x1d')][_0x1a32('0x72')](this,_0x4b050e[_0x1a32('0x108')]);if(!_0x3c6e8b){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x4b050e,_0x1a32('0x10a'));}if(!this[_0x1a32('0x89')](_0x4b050e['variable_id'])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x1a32('0x10b'));}var _0x1d9dbb=this['channel'][_0x1a32('0x10c')](_0x3c6e8b,_0x4b050e[_0x1a32('0x10d')],_0x4b050e['maxdigit']);var _0x35cb0e=_0x1d9dbb[_0x1a32('0xaa')]?_0x1d9dbb[_0x1a32('0xaa')]['toString']():'';logger[_0x1a32('0x2d')](_0x1a32('0x10e'),JSON[_0x1a32('0x75')](_0x1d9dbb));if(_0x1d9dbb['result']===-0x1){this[_0x1a32('0x36')]['sync'](this,_0x4b050e,_0x35cb0e);return _0x1d9dbb;}else if(_0x1d9dbb[_0x1a32('0xa4')]==='timeout'){_0x1d9dbb[_0x1a32('0xaa')]=_0x35cb0e['length']>=parseInt(_0x4b050e[_0x1a32('0x10f')])?'x':'i';}else{_0x1d9dbb[_0x1a32('0xaa')]=_0x35cb0e[_0x1a32('0x9d')]>=parseInt(_0x4b050e['mindigit'])&&_0x35cb0e[_0x1a32('0x9d')]<=parseInt(_0x4b050e[_0x1a32('0x110')])?'x':'i';}var _0x5abdc1=this['getVariable'][_0x1a32('0x72')](this,_0x4b050e[_0x1a32('0x111')]);if(!_0x5abdc1){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x4b050e,_0x1a32('0xd6'));}this[_0x1a32('0xd')][_0x1a32('0xa1')](_0x5abdc1,_0x35cb0e);if(this['isConfigured'](_0x4b050e[_0x1a32('0x112')])){var _0x146e29=parseInt(_0x4b050e[_0x1a32('0x112')],0xa);var _0xdb3a84=rs[_0x1a32('0x113')]({'charset':'*','length':_0x146e29});var _0x6a27a7=_0x35cb0e['length'];if(_0x6a27a7>0x0){if(_0x6a27a7>_0x146e29){this[_0x1a32('0x36')]['sync'](this,_0x4b050e,_0x4b050e[_0x1a32('0x114')]===_0x1a32('0x115')?_0xdb3a84+_0x35cb0e['substr'](_0x146e29):_0x35cb0e['substr'](0x0,_0x6a27a7-_0x146e29)+_0xdb3a84);}else{this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x4b050e,rs['generate']({'charset':'*','length':_0x6a27a7}));}}else{this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x4b050e,'');}}else{this[_0x1a32('0x36')]['sync'](this,_0x4b050e,_0x35cb0e);}return _0x1d9dbb;};AGIVertices[_0x1a32('0xf')][_0x1a32('0xc')]=function(_0x486f1d){logger['info'](util[_0x1a32('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x486f1d[_0x1a32('0x38')]));return this[_0x1a32('0xb')](_0x486f1d);};AGIVertices[_0x1a32('0xf')][_0x1a32('0x116')]=function(_0x34dab3){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x117'),_0x34dab3['label']));this['createSquareDetailsReport']['sync'](this,_0x34dab3,_0x34dab3['goalname']);return this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')]('GOAL\x20%s',_0x34dab3[_0x1a32('0x118')]));};AGIVertices[_0x1a32('0xf')]['awspolly']=function(_0x44e638){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x119'),_0x44e638['label']));if(!this[_0x1a32('0x89')](_0x44e638[_0x1a32('0x8c')])||!this[_0x1a32('0x89')](_0x44e638['aws_secret_access_key'])){return this[_0x1a32('0xd')]['noop'](_0x1a32('0x11a'));}if(!this[_0x1a32('0x89')](_0x44e638[_0x1a32('0x5a')])){return this['channel'][_0x1a32('0xa7')]('no\x20text\x20configured');}this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0x11b'),_0x44e638[_0x1a32('0x5a')]));var _0x20ec28=this[_0x1a32('0x8b')]['sync'](this,_0x44e638);if(_0x20ec28){this['channel'][_0x1a32('0xa7')](util['format'](_0x1a32('0x11c'),_0x20ec28));var _0x52133d=this[_0x1a32('0xd')][_0x1a32('0x11d')](_0x20ec28);try{fs[_0x1a32('0xfb')](_0x20ec28+'.wav');}catch(_0x49d748){logger[_0x1a32('0x2b')](_0x49d748);}return _0x52133d;}return this[_0x1a32('0xd')]['error'](_0x44e638,_0x1a32('0x11e'));};AGIVertices['prototype'][_0x1a32('0x11f')]=function(_0x14f150){logger['info'](util[_0x1a32('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x14f150['label']));if(!this['isConfigured'](_0x14f150['aws_access_key_id'])||!this[_0x1a32('0x89')](_0x14f150[_0x1a32('0x8d')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0x11a'));}if(!this[_0x1a32('0x89')](_0x14f150[_0x1a32('0x120')])){return this[_0x1a32('0xd')]['noop'](_0x1a32('0x121'));}if(!this['isConfigured'](_0x14f150[_0x1a32('0x5a')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xa8'));}this[_0x1a32('0xd')][_0x1a32('0xe2')]=!![];this['createSquareDetailsReport'](_0x14f150);this[_0x1a32('0x42')](_0x14f150[_0x1a32('0x5a')],'in','','');this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x122'),_0x14f150[_0x1a32('0x5a')]));var _0x453ee9=this[_0x1a32('0x91')][_0x1a32('0x72')](this,_0x14f150);if(_0x453ee9){for(var _0x6eed80 in _0x453ee9){if(_0x453ee9['hasOwnProperty'](_0x6eed80)&&_[_0x1a32('0x9e')](_0x453ee9[_0x6eed80])){this[_0x1a32('0xd')][_0x1a32('0xa1')](util[_0x1a32('0x27')]('AWS_LEX_%s',_0x6eed80[_0x1a32('0x6a')]()),_0x453ee9[_0x6eed80]);}}if(_[_0x1a32('0x46')](_0x453ee9[_0x1a32('0x79')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x1a32('0x42')](_0x453ee9[_0x1a32('0x79')],_0x1a32('0xee'),_0x1a32('0x123'),'');return this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0x124'),_0x453ee9[_0x1a32('0x79')]));}}return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x14f150,_0x1a32('0x125'));};AGIVertices[_0x1a32('0xf')]['googleasr']=function(_0x5cc607){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x126'),_0x5cc607[_0x1a32('0x38')],_0x5cc607[_0x1a32('0x64')]));if(!this[_0x1a32('0x89')](_0x5cc607[_0x1a32('0x7d')])){return this[_0x1a32('0xd')]['noop']('no\x20key\x20configured');}var _0x5ea7cc=_0x1a32('0x127');var _0x26e917=util[_0x1a32('0x27')](_0x1a32('0x128'),FILES_PATH,rs['generate'](0x4));var _0xf54096=util['format']('%s.%s',_0x26e917,_0x5ea7cc);var _0xd25c7f=!![];if(_0x5cc607['beep']===_0x1a32('0x129')){_0xd25c7f=![];}var _0x28d898=this[_0x1a32('0xd')]['recordFile'](_0x26e917,_0x5ea7cc,_0x5cc607['intKey'],_0x5cc607[_0x1a32('0x64')],undefined,_0xd25c7f);if(_0x28d898[_0x1a32('0xaa')]!==-0x1){this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format'](_0x1a32('0x12a'),_0xf54096));var _0x5ef56e=this[_0x1a32('0x93')][_0x1a32('0x72')](this,_0x5cc607,_0xf54096);if(_0x5ef56e){for(var _0x2f3456 in _0x5ef56e){if(_0x5ef56e['hasOwnProperty'](_0x2f3456)){this['channel']['setVariable'](util[_0x1a32('0x27')](_0x1a32('0x12b'),_0x2f3456['toUpperCase']()),_0x5ef56e[_0x2f3456]);}}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')]('GoogleASR\x20Result\x20%s',JSON[_0x1a32('0x75')](_0x5ef56e)));}}return _0x28d898;};AGIVertices[_0x1a32('0xf')][_0x1a32('0x12c')]=function(_0x465841){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x465841[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x465841[_0x1a32('0x96')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')]('no\x20appid\x20configured');}if(!this[_0x1a32('0x89')](_0x465841[_0x1a32('0x97')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0x12d'));}var _0x33bffe=_0x1a32('0x127');var _0x208bd6=util['format'](_0x1a32('0x128'),FILES_PATH,rs[_0x1a32('0x113')](0x4));var _0x869135=util['format']('%s.%s',_0x208bd6,_0x33bffe);var _0x448f69=!![];if(_0x465841[_0x1a32('0x12e')]===_0x1a32('0x129')){_0x448f69=![];}var _0x31a715=this[_0x1a32('0xd')][_0x1a32('0x12f')](_0x208bd6,_0x33bffe,_0x465841[_0x1a32('0x130')],_0x465841[_0x1a32('0x64')],undefined,_0x448f69);if(_0x31a715[_0x1a32('0xaa')]!==-0x1){this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format']('tilde\x20%s\x20file\x20created',_0x869135));var _0x39b61a=this[_0x1a32('0x95')][_0x1a32('0x72')](this,_0x465841,_0x869135);if(_0x39b61a){for(var _0x12a3f0 in _0x39b61a){if(_0x39b61a[_0x1a32('0x98')](_0x12a3f0)){this[_0x1a32('0xd')]['setVariable'](util[_0x1a32('0x27')](_0x1a32('0x131'),_0x12a3f0['toUpperCase']()),_0x39b61a[_0x12a3f0]);}}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x132'),JSON[_0x1a32('0x75')](_0x39b61a)));}}return _0x31a715;};AGIVertices['prototype'][_0x1a32('0x133')]=function(_0x252470){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x134'),_0x252470[_0x1a32('0x38')]));return this[_0x1a32('0xd')][_0x1a32('0x135')](_0x252470[_0x1a32('0x3e')],_0x252470[_0x1a32('0x136')],_0x252470[_0x1a32('0x3f')]);};AGIVertices[_0x1a32('0xf')]['gotoif']=function(_0x4d6316){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x137'),_0x4d6316[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x4d6316[_0x1a32('0x138')])){return this[_0x1a32('0xd')]['error'](_0x4d6316,_0x1a32('0x139'));}try{var _0x3e3a63=eval(_0x4d6316[_0x1a32('0x138')])?_0x1a32('0x13a'):_0x1a32('0x13b');this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0x13c'),_0x4d6316[_0x1a32('0x138')],_0x3e3a63));return{'code':0xc8,'result':_0x3e3a63};}catch(_0x1229c7){return{'code':0xc8,'result':_0x1a32('0x13b')};}};AGIVertices[_0x1a32('0xf')][_0x1a32('0x13d')]=function(_0x33589d){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x13e'),_0x33589d[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x33589d['interval_id'])){return this['channel'][_0x1a32('0x2b')](_0x33589d,_0x1a32('0x13f'));}var _0x8f268c=this[_0x1a32('0x22')][_0x1a32('0x72')](this,_0x33589d[_0x1a32('0x140')]);if(!_0x8f268c){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x33589d,_0x1a32('0x141'));}for(var _0x30beb7=0x0;_0x30beb7<_0x8f268c[_0x1a32('0x9d')];_0x30beb7+=0x1){var _0x4f81a3=this[_0x1a32('0xd')][_0x1a32('0x10')](util[_0x1a32('0x27')](_0x1a32('0x142'),_0x8f268c[_0x30beb7]));if(_0x4f81a3[_0x1a32('0xaa')]===-0x1){return _0x4f81a3;}logger['info'](util[_0x1a32('0x27')]('IFTIME\x20%s\x20%s',_0x8f268c[_0x30beb7],_0x4f81a3['extra']));if(_0x4f81a3['extra']===_0x1a32('0x13a')){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x143'),_0x8f268c[_0x30beb7],_0x1a32('0x13a')));this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format'](_0x1a32('0x143'),_0x8f268c[_0x30beb7],_0x1a32('0x13a')));return{'code':0xc8,'result':_0x1a32('0x13a')};}else{logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x143'),_0x8f268c[_0x30beb7],_0x1a32('0x13b')));this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0x143'),_0x8f268c[_0x30beb7],'false'));}}return{'code':0xc8,'result':_0x1a32('0x13b')};};AGIVertices[_0x1a32('0xf')][_0x1a32('0x144')]=function(_0x2d2d14){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x145'),_0x2d2d14[_0x1a32('0x38')]));return this[_0x1a32('0xd')][_0x1a32('0x144')]();};AGIVertices[_0x1a32('0xf')]['ispeechasr']=function(_0x19dcbf){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x146'),_0x19dcbf[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x19dcbf[_0x1a32('0x7d')])){return this['channel'][_0x1a32('0xa7')](_0x1a32('0xe1'));}var _0x53e990='wav';var _0x6c51f2=util[_0x1a32('0x27')](_0x1a32('0x128'),FILES_PATH,rs[_0x1a32('0x113')](0x4));var _0x5d7fbc=util[_0x1a32('0x27')](_0x1a32('0xa0'),_0x6c51f2,_0x53e990);var _0x430ada=!![];if(_0x19dcbf['beep']===_0x1a32('0x129')){_0x430ada=![];}var _0x390d8d=this[_0x1a32('0xd')][_0x1a32('0x12f')](_0x6c51f2,_0x53e990,_0x19dcbf['intKey'],_0x19dcbf['timeout'],undefined,_0x430ada);if(_0x390d8d[_0x1a32('0xaa')]!==-0x1){this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x147'),_0x5d7fbc));var _0x247ed9=this[_0x1a32('0x87')][_0x1a32('0x72')](this,_0x19dcbf,_0x5d7fbc);if(_0x247ed9){for(var _0x36e599 in _0x247ed9){if(_0x247ed9[_0x1a32('0x98')](_0x36e599)){this[_0x1a32('0xd')]['setVariable'](util[_0x1a32('0x27')](_0x1a32('0x148'),_0x36e599[_0x1a32('0x6a')]()),_0x247ed9[_0x36e599]);}}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x149'),JSON[_0x1a32('0x75')](_0x247ed9)));}}return _0x390d8d;};AGIVertices[_0x1a32('0xf')][_0x1a32('0x14a')]=function(_0x4d2c12){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x14b'),_0x4d2c12[_0x1a32('0x38')]));if(!this['isConfigured'](_0x4d2c12['key'])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xe1'));}if(!this[_0x1a32('0x89')](_0x4d2c12[_0x1a32('0x5a')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0xa8'));}this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x14c'),_0x4d2c12[_0x1a32('0x5a')]));var _0x1fa5cd=this[_0x1a32('0x85')][_0x1a32('0x72')](this,_0x4d2c12);if(_0x1fa5cd){this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x147'),_0x1fa5cd));var _0x3c0feb=this['channel'][_0x1a32('0x11d')](_0x1fa5cd,_0x4d2c12[_0x1a32('0x130')]);try{fs[_0x1a32('0xfb')](_0x1fa5cd+_0x1a32('0x14d'));}catch(_0x1ec0f3){logger[_0x1a32('0x2b')](_0x1ec0f3);}return _0x3c0feb;}return this['channel']['error'](_0x4d2c12,_0x1a32('0x14e'));};AGIVertices[_0x1a32('0xf')][_0x1a32('0x14f')]=function(_0x4e566b){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0x150'),_0x4e566b['label']));if(!this[_0x1a32('0x89')](_0x4e566b[_0x1a32('0x151')])){return this['channel'][_0x1a32('0x2b')](_0x4e566b,_0x1a32('0x152'));}logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x153'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x4e566b[_0x1a32('0x151')]));var _0xda0b2a=this[_0x1a32('0x52')][_0x1a32('0x72')](this,_0x4e566b[_0x1a32('0x151')]);if(_0xda0b2a){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x154'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x4e566b['findBy']));this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x154'),this[_0x1a32('0xd')]['callerid'],_0x4e566b[_0x1a32('0x151')]));return{'code':0xc8,'result':_0x1a32('0x155')};}else{logger[_0x1a32('0x2d')](util['format'](_0x1a32('0x156'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x4e566b[_0x1a32('0x151')]));this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x156'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x4e566b['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1a32('0xf')][_0x1a32('0x157')]=function(_0x414df5){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x158'),_0x414df5['label']));if(!this[_0x1a32('0x89')](_0x414df5[_0x1a32('0x151')])){return this['channel']['error'](_0x414df5,_0x1a32('0x152'));}logger['info'](util['format'](_0x1a32('0x153'),this['channel'][_0x1a32('0x3b')],_0x414df5[_0x1a32('0x151')]));var _0x3643a9=this[_0x1a32('0x51')]['sync'](this,_0x414df5[_0x1a32('0x151')]);if(_0x3643a9){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1a32('0xd')]['callerid'],_0x414df5[_0x1a32('0x151')]));this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x414df5['findBy']));return{'code':0xc8,'result':_0x1a32('0x155')};}else{logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x156'),this[_0x1a32('0xd')]['callerid'],_0x414df5[_0x1a32('0x151')]));this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x156'),this[_0x1a32('0xd')]['callerid'],_0x414df5[_0x1a32('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1a32('0xf')]['math']=function(_0x28ca8a){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x159'),_0x28ca8a['label']));if(!this[_0x1a32('0x89')](_0x28ca8a['operation'])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x28ca8a,_0x1a32('0x15a'));}this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x15b'),_0x28ca8a[_0x1a32('0x15c')]));var _0x1b1f08=eval(_0x28ca8a[_0x1a32('0x15c')]);if(!this[_0x1a32('0x89')](_0x28ca8a[_0x1a32('0x111')])){return this[_0x1a32('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3cac9f=this['getVariable']['sync'](this,_0x28ca8a[_0x1a32('0x111')]);if(!_0x3cac9f){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x28ca8a,_0x1a32('0xd6'));}if(_['isArray'](_0x1b1f08)){var _0x677c56=this;_0x1b1f08['forEach'](function(_0x1e6b87,_0x3ad7ea){_0x677c56['channel'][_0x1a32('0xa1')](util[_0x1a32('0x27')](_0x1a32('0x15d'),_0x3cac9f,_0x3ad7ea),_0x1e6b87);});return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x15e'),_0x3cac9f));}else{return this[_0x1a32('0xd')][_0x1a32('0xa1')](_0x3cac9f,_0x1b1f08);}};AGIVertices['prototype'][_0x1a32('0xa')]=function(_0x1ad1e2){logger['info'](util['format'](_0x1a32('0x15f'),_0x1ad1e2['label']));if(_0x1ad1e2[_0x1a32('0xa6')]===0x0){return this[_0x1a32('0xa5')](_0x1ad1e2);}_0x1ad1e2[_0x1a32('0xa6')]-=0x1;if(!this[_0x1a32('0x89')](_0x1ad1e2[_0x1a32('0x108')])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x1ad1e2,_0x1a32('0x109'));}var _0x185341=this[_0x1a32('0x1d')]['sync'](this,_0x1ad1e2[_0x1a32('0x108')]);if(!_0x185341){return this['channel'][_0x1a32('0x2b')](_0x1ad1e2,_0x1a32('0x10a'));}var _0x355ceb=this[_0x1a32('0xd')][_0x1a32('0x10c')](_0x185341,_0x1ad1e2[_0x1a32('0x10d')],_0x1ad1e2[_0x1a32('0x160')]);var _0x5a85db=_0x355ceb[_0x1a32('0xaa')];if(_0x355ceb[_0x1a32('0xaa')]===-0x1){this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x1ad1e2,'-1');return _0x355ceb;}else if(_0x355ceb[_0x1a32('0xa4')]==='timeout'){_0x355ceb['result']=_0x355ceb[_0x1a32('0xaa')][_0x1a32('0x9d')]>0x0?_0x355ceb[_0x1a32('0xaa')]:'t';}else if(_[_0x1a32('0x44')](_0x355ceb['result'])){_0x355ceb['result']='#';_0x5a85db='#';}if(!this['isConfigured'](_0x1ad1e2[_0x1a32('0x111')])){this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0x10b'));}else{var _0x5690b7=this[_0x1a32('0x10')][_0x1a32('0x72')](this,_0x1ad1e2[_0x1a32('0x111')]);if(!_0x5690b7){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x1ad1e2,_0x1a32('0xd6'));}this[_0x1a32('0xd')]['setVariable'](_0x5690b7,_0x5a85db);}this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x1ad1e2,_0x5a85db);return _0x355ceb;};AGIVertices[_0x1a32('0xf')][_0x1a32('0xa7')]=function(_0x51e49f){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x51e49f['label']));return this[_0x1a32('0xd')]['noop'](_0x51e49f[_0x1a32('0x161')]||_0x51e49f[_0x1a32('0x38')]);};AGIVertices['prototype'][_0x1a32('0x162')]=function(_0x26e4f6){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x163'),_0x26e4f6[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x26e4f6['findBy'])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x26e4f6,_0x1a32('0x152'));}logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x153'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x26e4f6[_0x1a32('0x151')]));var _0x962507=this[_0x1a32('0x164')]['sync'](this,_0x26e4f6[_0x1a32('0x165')]);var _0x1beb8e=this[_0x1a32('0x4e')][_0x1a32('0x72')](this,_0x26e4f6['findBy'],_0x962507);if(_0x1beb8e){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x154'),this['channel'][_0x1a32('0x3b')],_0x26e4f6['findBy']));this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x154'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x26e4f6[_0x1a32('0x151')]));return{'code':0xc8,'result':_0x1a32('0x155')};}else{logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x26e4f6[_0x1a32('0x151')]));this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x154'),this['channel'][_0x1a32('0x3b')],_0x26e4f6['findBy']));return{'code':0xc8,'result':_0x1a32('0x166')};}};AGIVertices['prototype']['playback']=function(_0x117a21){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x167'),_0x117a21[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x117a21[_0x1a32('0x108')])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x117a21,_0x1a32('0x109'));}var _0x584346=this[_0x1a32('0x1d')][_0x1a32('0x72')](this,_0x117a21['file_id']);if(!_0x584346){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x117a21,'no\x20file\x20audio\x20found');}var _0x475727=this['channel']['exec'](_0x1a32('0x168'),[_0x584346,_0x117a21[_0x1a32('0x104')]]);if(_0x475727[_0x1a32('0xaa')]===-0x1){return _0x475727;}return this[_0x1a32('0xd')]['noop'](util['format']('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x584346));};AGIVertices['prototype'][_0x1a32('0x169')]=function(_0x1cadc4){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x16a'),_0x1cadc4['label']));if(!this[_0x1a32('0x89')](_0x1cadc4[_0x1a32('0x16b')])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x1cadc4,'no\x20queue\x20selected');}var _0xa7364e='';var _0x51eef4=parseInt(_0x1cadc4[_0x1a32('0x16b')],0xa);if(isNaN(_0x51eef4)){_0xa7364e=_0x1cadc4[_0x1a32('0x16b')];}else{_0xa7364e=this[_0x1a32('0x14')][_0x1a32('0x72')](this,_0x1cadc4['queue_id']);if(!_0xa7364e){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x1cadc4,'no\x20queue\x20found');}}var _0x5ec230='';if(this[_0x1a32('0x89')](_0x1cadc4[_0x1a32('0x108')])){var _0x6497a7=this[_0x1a32('0x1d')][_0x1a32('0x72')](this,_0x1cadc4[_0x1a32('0x108')]);if(_0x6497a7){_0x5ec230=_0x6497a7;}}this['createSquareDetailsReport']['sync'](this,_0x1cadc4,_0xa7364e);if(_0x1cadc4[_0x1a32('0x104')][_0x1a32('0x16c')]('x')<0x0){_0x1cadc4[_0x1a32('0x104')]+='x';}if(_0x1cadc4[_0x1a32('0x104')]['indexOf']('X')<0x0){_0x1cadc4[_0x1a32('0x104')]+='X';}this['channel'][_0x1a32('0xa1')]('XMCS-QUEUE',_0xa7364e?_0xa7364e[_0x1a32('0x16d')]():'');var _0x4b06bf=this[_0x1a32('0xd')][_0x1a32('0x57')]('QUEUE',[_0xa7364e,_0x1cadc4[_0x1a32('0x104')],_0x1cadc4[_0x1a32('0x63')],_0x5ec230,_0x1cadc4[_0x1a32('0x64')],_0x1cadc4[_0x1a32('0x7')],_0x1cadc4[_0x1a32('0x16e')],_0x1cadc4['gosub'],'',_0x1cadc4[_0x1a32('0x16f')]]);if(_0x4b06bf[_0x1a32('0xaa')]===-0x1){return _0x4b06bf;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x1a32('0x170'),_0xa7364e));};AGIVertices['prototype'][_0x1a32('0x171')]=function(_0x2b6a92){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x172'),_0x2b6a92[_0x1a32('0x38')]));var _0x490ed7=_0x2b6a92[_0x1a32('0x173')]||_0x1a32('0x127');var _0x495be8=util[_0x1a32('0x27')](_0x1a32('0x174'),this[_0x1a32('0xd')]['uniqueid'],rs[_0x1a32('0x113')](0x5));var _0x34feeb=util['format'](_0x1a32('0x175'),FILES_PATH,_0x495be8,_0x490ed7);var _0x1f6bde=util[_0x1a32('0x27')](_0x1a32('0x128'),FILES_PATH,_0x495be8);this[_0x1a32('0x3c')][_0x1a32('0x72')](this,_0x2b6a92,_0x495be8,_0x34feeb);this['channel'][_0x1a32('0xa1')](_0x1a32('0x176'),_0x495be8);logger[_0x1a32('0x2d')](_0x1a32('0x177'),_0x1f6bde,_0x490ed7,_0x2b6a92[_0x1a32('0x178')],_0x2b6a92['timeout']);return this[_0x1a32('0xd')][_0x1a32('0x12f')](_0x1f6bde,_0x490ed7,_0x2b6a92[_0x1a32('0x178')],_0x2b6a92[_0x1a32('0x64')],undefined,!![]);};AGIVertices[_0x1a32('0xf')][_0x1a32('0x179')]=function(_0x3ca754){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x17a'),_0x3ca754['label']));if(!this['isConfigured'](_0x3ca754[_0x1a32('0x63')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')]('no\x20url\x20configured');}var _0x31241b=this[_0x1a32('0x62')][_0x1a32('0x72')](this,_0x3ca754);logger[_0x1a32('0x2d')](util['format'](_0x1a32('0x17b'),util[_0x1a32('0x17c')](_0x31241b,{'showHidden':![],'depth':null})));if(!this[_0x1a32('0x89')](_0x3ca754[_0x1a32('0x111')])){return this[_0x1a32('0xd')]['noop'](_0x1a32('0x17d'));}var _0x5c9263=this[_0x1a32('0x10')]['sync'](this,_0x3ca754[_0x1a32('0x111')]);if(!_0x5c9263){return this['channel'][_0x1a32('0x2b')](_0x3ca754,'no\x20variable\x20found');}this[_0x1a32('0xd')][_0x1a32('0xa1')](util[_0x1a32('0x27')](_0x1a32('0x17e'),_0x5c9263),_0x31241b[_0x1a32('0x77')]?_0x31241b['statusCode']:_0x1a32('0x17f'));this[_0x1a32('0xd')][_0x1a32('0xa1')](util['format'](_0x1a32('0x180'),_0x5c9263),_0x31241b[_0x1a32('0x78')]?_0x31241b['statusMessage']:'OK');if(_0x31241b[_0x1a32('0x6b')]){try{this['saveRestApiResult'](_0x31241b[_0x1a32('0x6b')],_0x5c9263);}catch(_0x18b490){logger[_0x1a32('0x2b')](util[_0x1a32('0x27')](_0x1a32('0x181'),_0x5c9263));}}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format']('variable\x20%s\x20set',_0x5c9263));};AGIVertices['prototype']['saydigits']=function(_0x20a923){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x182'),_0x20a923[_0x1a32('0x38')]));return this[_0x1a32('0xd')]['sayDigits'](_0x20a923[_0x1a32('0x183')][_0x1a32('0x58')](/\s+/g,''),_0x20a923['escape_digits']);};AGIVertices[_0x1a32('0xf')][_0x1a32('0x184')]=function(_0x2ed642){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0x185'),_0x2ed642['label']));return this[_0x1a32('0xd')][_0x1a32('0x186')](_0x2ed642[_0x1a32('0x65')]['replace'](/\s+/g,''),_0x2ed642[_0x1a32('0x178')]);};AGIVertices['prototype'][_0x1a32('0x187')]=function(_0x28092c){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0x188'),_0x28092c[_0x1a32('0x38')]));return this[_0x1a32('0xd')][_0x1a32('0x189')](_0x28092c[_0x1a32('0x5a')],_0x28092c[_0x1a32('0x178')]);};AGIVertices[_0x1a32('0xf')]['sendMail']=function(_0x266287){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x18a'),_0x266287[_0x1a32('0x38')]));if(!this['isConfigured'](_0x266287[_0x1a32('0x18b')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0x18c'));}var _0x24c095=this[_0x1a32('0x21')]['sync'](this,_0x266287[_0x1a32('0x18b')]);if(!_0x24c095||!_0x24c095['Smtp']){return this[_0x1a32('0xd')]['error'](_0x266287,'no\x20mail\x20account\x20found');}var _0x41109d={'from':util[_0x1a32('0x27')](_0x1a32('0x18d'),_0x24c095[_0x1a32('0x13')],_0x24c095['email']||_0x24c095['Smtp'][_0x1a32('0x18e')]),'to':_0x266287['to']||'','cc':_0x266287['cc']||'','bcc':_0x266287[_0x1a32('0x18f')]||'','subject':_0x266287[_0x1a32('0x190')],'html':_0x266287[_0x1a32('0x5a')],'text':_0x266287[_0x1a32('0x5a')]};if(this['isConfigured'](_0x266287[_0x1a32('0x191')])){}logger[_0x1a32('0x192')](_0x1a32('0x193'),JSON[_0x1a32('0x75')](_0x41109d));this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x266287,_0x266287[_0x1a32('0x18b')]);this['channel'][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x194'),_0x24c095[_0x1a32('0x13')]));this[_0x1a32('0x195')][_0x1a32('0x72')](this,_0x24c095[_0x1a32('0x196')],_0x41109d);return this['channel'][_0x1a32('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x1a32('0xf')][_0x1a32('0x197')]=function(_0x132b50){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x198'),_0x132b50['label']));return this['channel']['noop'](_0x1a32('0x199'));};AGIVertices[_0x1a32('0xf')][_0x1a32('0x19a')]=function(_0x3b62ab){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x19b'),_0x3b62ab[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x3b62ab[_0x1a32('0x19c')])){return this['channel']['noop']('no\x20sms\x20account\x20configured');}var _0x19fb6c=this['getSmsAccount'][_0x1a32('0x72')](this,_0x3b62ab[_0x1a32('0x19c')]);if(!_0x19fb6c){return this['channel'][_0x1a32('0x2b')](_0x3b62ab,_0x1a32('0x19d'));}var _0x7e90c9={'body':_0x3b62ab[_0x1a32('0x19e')],'phone':_0x3b62ab['to']||'','SmsAccountId':_0x19fb6c['id']};logger[_0x1a32('0x192')](_0x1a32('0x19f'),JSON[_0x1a32('0x75')](_0x7e90c9));this[_0x1a32('0x36')]['sync'](this,_0x3b62ab,_0x3b62ab[_0x1a32('0x19c')]);this['channel'][_0x1a32('0xa7')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x19fb6c[_0x1a32('0x13')]));this[_0x1a32('0x35')][_0x1a32('0x72')](this,_0x7e90c9);return this[_0x1a32('0xd')]['noop'](_0x1a32('0x1a0'));};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1a1')]=function(_0x164678){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x1a2'),_0x164678[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x164678[_0x1a32('0x111')])){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x164678,_0x1a32('0x1a3'));}var _0x28f973=this['getVariable'][_0x1a32('0x72')](this,_0x164678[_0x1a32('0x111')]);if(!_0x28f973){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x164678,'no\x20variable\x20found');}return this['channel'][_0x1a32('0xa1')](_0x28f973,_0x164678[_0x1a32('0x1a4')]);};AGIVertices['prototype'][_0x1a32('0x1a5')]=function(_0x4d9a06){logger[_0x1a32('0x2d')](util['format'](_0x1a32('0x1a6'),_0x4d9a06[_0x1a32('0x38')]));this['channel'][_0x1a32('0xa7')](_0x1a32('0x1a7'));if(_0x4d9a06[_0x1a32('0xb8')]===_0x1a32('0x1a8')){this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0x1a9'));return this[_0x1a32('0xd')]['answer']();}return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0x1aa'));};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1ab')]=function(_0x507d06){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x1ac'),_0x507d06['label']));if(!this[_0x1a32('0x89')](_0x507d06[_0x1a32('0x1ad')])){return this[_0x1a32('0xd')]['error'](_0x507d06,_0x1a32('0x1ae'));}var _0x209ed1=this[_0x1a32('0x17')]['sync'](this,_0x507d06[_0x1a32('0x1ad')]);if(!this[_0x1a32('0x89')](_0x209ed1)){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x507d06,util[_0x1a32('0x27')](_0x1a32('0x1af'),_0x507d06[_0x1a32('0x1ad')]));}if(_0x209ed1===this[_0x1a32('0xd')]['arg_1']){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x507d06,_0x1a32('0x1b0'));}this['createSquareDetailsReport'][_0x1a32('0x72')](this,_0x507d06,_0x209ed1);var _0x1d6f51=this[_0x1a32('0xd')][_0x1a32('0x57')](_0x1a32('0x1b1'),util[_0x1a32('0x27')](_0x1a32('0x1b2'),config[_0x1a32('0x7')][_0x1a32('0x1b3')]||'127.0.0.1',_0x209ed1,this[_0x1a32('0xd')][_0x1a32('0x3a')]));if(_0x1d6f51[_0x1a32('0xaa')]===-0x1){return _0x1d6f51;}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0xc6'),'AGI',_0x209ed1));};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1b4')]=function(_0x5bc03b){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x1b5'),_0x5bc03b[_0x1a32('0x38')]));var _0x4372a3=this[_0x1a32('0x56')][_0x1a32('0x72')](this,_0x5bc03b[_0x1a32('0x1b6')]);this[_0x1a32('0x36')][_0x1a32('0x72')](this,_0x5bc03b,_0x5bc03b[_0x1a32('0x1b6')]);if(this[_0x1a32('0x89')](_0x5bc03b['variable_id'])){var _0xccccf9=this[_0x1a32('0x10')][_0x1a32('0x72')](this,_0x5bc03b['variable_id']);if(_0xccccf9){this[_0x1a32('0xd')]['setVariable'](_0xccccf9,_0x4372a3);return this[_0x1a32('0xd')][_0x1a32('0xa7')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x5bc03b[_0x1a32('0x1b6')],_0xccccf9));}}return this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x1b7'),_0x5bc03b[_0x1a32('0x1b6')]));};AGIVertices[_0x1a32('0xf')]['google_cloud_tts']=function(_0x53bcb9){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x1b8'),_0x53bcb9[_0x1a32('0x38')]));_0x53bcb9['text']=_0x53bcb9[_0x1a32('0x5a')][_0x1a32('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x53bcb9[_0x1a32('0x1b9')])){return this[_0x1a32('0xd')][_0x1a32('0xa7')](_0x1a32('0x1ba'));}if(!this['isConfigured'](_0x53bcb9[_0x1a32('0x5a')])){return this[_0x1a32('0xd')]['noop'](_0x1a32('0xa8'));}this['channel'][_0x1a32('0xa7')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x53bcb9[_0x1a32('0x5a')]));var _0x3f9d19=this[_0x1a32('0x59')][_0x1a32('0x72')](this,_0x53bcb9);if(_0x3f9d19){this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3f9d19));var _0x347c7c=this['channel'][_0x1a32('0x11d')](_0x3f9d19);try{fs[_0x1a32('0xfb')](_0x3f9d19+_0x1a32('0x14d'));}catch(_0x3cd9f1){logger[_0x1a32('0x2b')](_0x3cd9f1);}return _0x347c7c;}return this[_0x1a32('0xd')]['error'](_0x53bcb9,_0x1a32('0x1bb'));};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1bc')]=function(_0x51dbe9){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x1bd'),_0x51dbe9[_0x1a32('0x38')]));_0x51dbe9['text']=_0x51dbe9['text'][_0x1a32('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x51dbe9[_0x1a32('0x5a')])){return this['channel'][_0x1a32('0xa7')](_0x1a32('0xa8'));}this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x51dbe9[_0x1a32('0x5a')]));var _0x338b50=this[_0x1a32('0x60')][_0x1a32('0x72')](this,_0x51dbe9);if(_0x338b50){this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x1be'),_0x338b50));var _0x122990=this[_0x1a32('0xd')][_0x1a32('0x11d')](_0x338b50);try{fs['unlink'](_0x338b50+'.wav');}catch(_0x2b6cae){logger[_0x1a32('0x2b')](_0x2b6cae);}return _0x122990;}return this[_0x1a32('0xd')]['error'](_0x51dbe9,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1bf')]=function(_0x16d6ba){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x16d6ba[_0x1a32('0x38')]));if(!this[_0x1a32('0x89')](_0x16d6ba['findBy'])){return this[_0x1a32('0xd')]['error'](_0x16d6ba,_0x1a32('0x152'));}logger[_0x1a32('0x2d')](util[_0x1a32('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x1a32('0x3b')],_0x16d6ba['findBy']));var _0x7bc0fb=this[_0x1a32('0x50')][_0x1a32('0x72')](this,_0x16d6ba['findBy']);if(_0x7bc0fb){logger['info'](util[_0x1a32('0x27')](_0x1a32('0x154'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x16d6ba[_0x1a32('0x151')]));this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x154'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x16d6ba[_0x1a32('0x151')]));return{'code':0xc8,'result':_0x1a32('0x155')};}else{logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x156'),this['channel'][_0x1a32('0x3b')],_0x16d6ba['findBy']));this[_0x1a32('0xd')][_0x1a32('0xa7')](util[_0x1a32('0x27')](_0x1a32('0x156'),this[_0x1a32('0xd')][_0x1a32('0x3b')],_0x16d6ba['findBy']));return{'code':0xc8,'result':_0x1a32('0x166')};}};AGIVertices[_0x1a32('0xf')][_0x1a32('0x1c0')]=function(_0x4f7a67){logger['info'](util['format'](_0x1a32('0x1c1'),_0x4f7a67['label']));var _0x1ec4fb=this[_0x1a32('0xd')][_0x1a32('0x57')]('VOICEMAIL',[_0x4f7a67[_0x1a32('0x1c2')],_0x4f7a67['options']]);if(_0x1ec4fb['result']===-0x1){return _0x1ec4fb;}return this[_0x1a32('0xd')]['noop'](util[_0x1a32('0x27')](_0x1a32('0xc6'),_0x1a32('0x1c3'),_0x4f7a67['mailbox']));};AGIVertices['prototype'][_0x1a32('0x1c4')]=function(_0x92ac){logger[_0x1a32('0x2d')](util[_0x1a32('0x27')](_0x1a32('0x1c5'),_0x92ac['label']));if(!this[_0x1a32('0x89')](_0x92ac['variable_id'])){return this[_0x1a32('0xd')]['error'](_0x92ac,_0x1a32('0x1a3'));}var _0x53902a=this[_0x1a32('0x10')][_0x1a32('0x72')](this,_0x92ac[_0x1a32('0x111')]);if(!_0x53902a){return this[_0x1a32('0xd')][_0x1a32('0x2b')](_0x92ac,_0x1a32('0xd6'));}var _0x3f22a8=this[_0x1a32('0xd')][_0x1a32('0x10')](_0x53902a);return{'code':0xc8,'result':_0x3f22a8[_0x1a32('0xa4')]?_0x3f22a8['extra']:'-'};};String[_0x1a32('0xf')][_0x1a32('0xa3')]=function(_0x3e1cb1,_0x3c62f7){return this[_0x1a32('0xa2')](_0x3e1cb1)[_0x1a32('0x1c6')](_0x3c62f7);};module['exports']=AGIVertices; \ No newline at end of file +var _0x823c=['aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','split','replaceAll','extra','getAndSetVariable','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','createCmContact','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','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','generate','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','context','priority','gotoif','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','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','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','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','host','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','agentUnpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','channel','rpc','getVariable','getVariableById','name','catch','prototype','getVoiceQueue','getVoiceQueueById','then','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','mailRpc','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','extension','accountcode','dnid','file','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentLogout','agentLogin','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0x823c,0x143));var _0xc823=function(_0x32a9ed,_0x225c13){_0x32a9ed=_0x32a9ed-0x0;var _0x15be6a=_0x823c[_0x32a9ed];return _0x15be6a;};'use strict';var fs=require('fs');var util=require(_0xc823('0x0'));var _=require('lodash');var sh=require(_0xc823('0x1'));var odbc=require(_0xc823('0x2'))();var rs=require(_0xc823('0x3'));var moment=require(_0xc823('0x4'));var Mustache=require(_0xc823('0x5'));var rp=require(_0xc823('0x6'));var logger=require('../../config/logger')(_0xc823('0x7'));var config=require(_0xc823('0x8'));var shared=require(_0xc823('0x9'));var scripts=require(_0xc823('0xa'));var FILES_PATH=_0xc823('0xb');var recursiveMapAttributes=['rawHeaders',_0xc823('0xc')];var verticesWithRetry=[_0xc823('0xd'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x4478fc,_0x39cc25,_0x53d48d){this[_0xc823('0xe')]=_0x4478fc;this[_0xc823('0xf')]=_0x39cc25;this['mailRpc']=_0x53d48d;};AGIVertices['prototype'][_0xc823('0x10')]=function(_0x172c92,_0x3435d6){this[_0xc823('0xf')][_0xc823('0x11')](_0x172c92)['then'](function(_0x3f33e9){_0x3435d6(null,_0x3f33e9?_0x3f33e9[_0xc823('0x12')]:![]);})[_0xc823('0x13')](function(_0x1546b9){_0x3435d6(_0x1546b9);});};AGIVertices[_0xc823('0x14')][_0xc823('0x15')]=function(_0x51ffdb,_0x1e4425){this[_0xc823('0xf')][_0xc823('0x16')](_0x51ffdb)[_0xc823('0x17')](function(_0x55b31d){_0x1e4425(null,_0x55b31d?_0x55b31d['name']:![]);})['catch'](function(_0x5bdfc9){_0x1e4425(_0x5bdfc9);});};AGIVertices[_0xc823('0x14')]['getSquareProject']=function(_0x366c31,_0x122510){this[_0xc823('0xf')][_0xc823('0x18')](_0x366c31)[_0xc823('0x17')](function(_0x1aca6d){_0x122510(null,_0x1aca6d?_0x1aca6d[_0xc823('0x12')]:![]);})['catch'](function(_0x42843e){_0x122510(_0x42843e);});};AGIVertices['prototype'][_0xc823('0x19')]=function(_0x3aa68f,_0x3d3ddb){this['rpc'][_0xc823('0x1a')](_0x3aa68f)[_0xc823('0x17')](function(_0x3a3fcd){_0x3d3ddb(null,_0x3a3fcd?_0x3a3fcd['dsn']:![]);})[_0xc823('0x13')](function(_0x325c8a){_0x3d3ddb(_0x325c8a);});};AGIVertices[_0xc823('0x14')][_0xc823('0x1b')]=function(_0x574c76,_0x414c86){this['rpc'][_0xc823('0x1c')](_0x574c76)['then'](function(_0x510460){_0x414c86(null,_0x510460?_0x510460[_0xc823('0x12')]:![]);})[_0xc823('0x13')](function(_0x52c941){_0x414c86(_0x52c941);});};AGIVertices[_0xc823('0x14')][_0xc823('0x1d')]=function(_0x451f7a,_0x265f92){this[_0xc823('0xf')][_0xc823('0x1e')](_0x451f7a)[_0xc823('0x17')](function(_0xb501ac){_0x265f92(null,_0xb501ac?_0xb501ac[_0xc823('0x12')]:![]);})[_0xc823('0x13')](function(_0x4e4bd4){_0x265f92(_0x4e4bd4);});};AGIVertices[_0xc823('0x14')]['getSound']=function(_0x54e956,_0x15ac97){var _0x21265a=this;this[_0xc823('0xf')][_0xc823('0x1f')](_0x54e956)[_0xc823('0x17')](function(_0x182fcf){_0x15ac97(null,_0x182fcf?_0x21265a[_0xc823('0x20')](_0x182fcf[_0xc823('0x21')]):![]);})[_0xc823('0x13')](function(_0xba0f46){_0x15ac97(_0xba0f46);});};AGIVertices[_0xc823('0x14')][_0xc823('0x22')]=function(_0x352b61,_0xda39a3){this[_0xc823('0xf')]['getMailAccountById'](_0x352b61)[_0xc823('0x17')](function(_0x34af84){_0xda39a3(null,_0x34af84?_0x34af84:![]);})[_0xc823('0x13')](function(_0x351c0b){_0xda39a3(_0x351c0b);});};AGIVertices[_0xc823('0x14')]['sendMailMessage']=function(_0x4e8312,_0x5c6921,_0x35ba13){this[_0xc823('0x23')][_0xc823('0x24')](_0x4e8312,_0x5c6921)[_0xc823('0x17')](function(){_0x35ba13(null);})['catch'](function(_0xc128c7){_0x35ba13(_0xc128c7);});};AGIVertices[_0xc823('0x14')][_0xc823('0x25')]=function(_0xd68524,_0x40fd2a){this[_0xc823('0xf')][_0xc823('0x26')](_0xd68524)[_0xc823('0x17')](function(_0xf69aea){if(_0xf69aea){if(_0xf69aea[_0xc823('0x27')]){_0x40fd2a(null,[_0xf69aea[_0xc823('0x28')]]);}else{_0x40fd2a(null,_[_0xc823('0x29')](_0xf69aea[_0xc823('0x2a')],'interval'));}}else{_0x40fd2a(null,![]);}})[_0xc823('0x13')](function(_0x3bb497){_0x40fd2a(_0x3bb497);});};AGIVertices[_0xc823('0x14')][_0xc823('0x20')]=function(_0x2b7273){return util[_0xc823('0x2b')]('%s/sounds/converted/%s',FILES_PATH,_0x2b7273);};AGIVertices[_0xc823('0x14')][_0xc823('0x2c')]=function(_0x4b70e2,_0x2d18cd,_0x5f215f){odbc[_0xc823('0x2d')](_0x4b70e2,function(_0x970ceb){if(_0x970ceb){logger['error'](_0xc823('0x2e'),_0x970ceb);_0x5f215f(_0x970ceb);}else{logger[_0xc823('0x2f')](_0xc823('0x30'));odbc[_0xc823('0x31')](_0x2d18cd,function(_0x3a2977,_0x2c68fb){if(_0x3a2977){logger[_0xc823('0x2f')]('Error\x20executing\x20query\x20%s',_0x2d18cd);_0x5f215f(_0x3a2977);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x2d18cd);odbc[_0xc823('0x32')](function(_0x86b3e1){if(_0x86b3e1){logger[_0xc823('0x33')](_0xc823('0x34'),_0x86b3e1);}_0x5f215f(null,_0x2c68fb);});}});}});};AGIVertices[_0xc823('0x14')]['getSmsAccount']=function(_0xfef258,_0x28e575){this[_0xc823('0xf')][_0xc823('0x35')](_0xfef258)['then'](function(_0x51b38e){_0x28e575(null,_0x51b38e?_0x51b38e:![]);})['catch'](function(_0x3f72a4){_0x28e575(_0x3f72a4);});};AGIVertices[_0xc823('0x14')][_0xc823('0x36')]=function(_0x4d9ce7,_0x2ca48a){this['rpc'][_0xc823('0x36')](_0x4d9ce7)[_0xc823('0x17')](function(_0x3535b6){_0x2ca48a(null,_0x3535b6);})[_0xc823('0x13')](function(_0x337541){_0x2ca48a(_0x337541);});};AGIVertices[_0xc823('0x14')][_0xc823('0x37')]=function(_0x521e47,_0x1256b6,_0x4d2100){this[_0xc823('0xf')][_0xc823('0x37')]({'uniqueid':this[_0xc823('0xe')][_0xc823('0x38')],'node':_0x521e47[_0xc823('0x39')],'application':_0x521e47[_0xc823('0x3a')],'data':_0x1256b6||null,'project_name':this[_0xc823('0xe')][_0xc823('0x3b')],'callerid':this['channel'][_0xc823('0x3c')]})[_0xc823('0x17')](function(_0x58b784){if(_0x4d2100){_0x4d2100(null,_0x58b784);}})[_0xc823('0x13')](function(_0x4661e5){if(_0x4d2100){_0x4d2100(_0x4661e5);}});};AGIVertices[_0xc823('0x14')][_0xc823('0x3d')]=function(_0x2d6206,_0x336eea,_0x180f2e,_0x12a665){this[_0xc823('0xf')]['createSquareRecording']({'uniqueid':this[_0xc823('0xe')][_0xc823('0x38')],'callerid':this['channel'][_0xc823('0x3c')],'calleridname':this[_0xc823('0xe')]['calleridname'],'context':this[_0xc823('0xe')]['context'],'extension':this[_0xc823('0xe')][_0xc823('0x3e')],'priority':this['channel']['priority'],'accountcode':this[_0xc823('0xe')][_0xc823('0x3f')],'dnid':this[_0xc823('0xe')][_0xc823('0x40')],'projectName':this[_0xc823('0xe')][_0xc823('0x3b')],'saveName':_0x336eea,'filename':_0x2d6206[_0xc823('0x41')]||_0x336eea,'savePath':_0x180f2e})[_0xc823('0x17')](function(_0x4a134e){_0x12a665(null,_0x4a134e);})[_0xc823('0x13')](function(_0x26b20a){_0x12a665(_0x26b20a);});};AGIVertices['prototype']['createSquareMessage']=function(_0xffa480,_0x4db975,_0x491928,_0x5c3217,_0x4e1046){this['rpc']['createSquareMessage']({'uniqueid':this[_0xc823('0xe')]['uniqueid'],'body':_0xffa480,'direction':_0x4db975,'providerName':_0x491928,'providerResponse':_0x5c3217})['then'](function(_0x3683bd){if(_0x4e1046){_0x4e1046(null,_0x3683bd);}})['catch'](function(_0x33b4f8){if(_0x4e1046){_0x4e1046(_0x33b4f8);}});};AGIVertices[_0xc823('0x14')]['createCmContact']=function(_0x43ae9f,_0x1d960c){this[_0xc823('0xf')]['createCmContact']({'firstName':_['isEmpty'](_0x43ae9f[_0xc823('0x12')])||_[_0xc823('0x42')](_0x43ae9f['name'])?_0xc823('0x43')+Math[_0xc823('0x44')]():_0x43ae9f[_0xc823('0x12')],'lastName':_['isEmpty'](_0x43ae9f[_0xc823('0x45')])||_[_0xc823('0x42')](_0x43ae9f[_0xc823('0x45')])?null:_0x43ae9f[_0xc823('0x45')],'phone':_0x43ae9f[_0xc823('0x46')],'ListId':_0x43ae9f[_0xc823('0x47')],'scheduledat':_0x43ae9f[_0xc823('0x48')],'callbackUniqueid':this['channel'][_0xc823('0x38')],'tags':_0xc823('0x49'),'description':_0xc823('0x4a')+_0x43ae9f[_0xc823('0x48')][_0xc823('0x4b')](),'priority':_0x43ae9f[_0xc823('0x4c')]})[_0xc823('0x17')](function(_0x5e7527){_0x1d960c(null,_0x5e7527);})[_0xc823('0x13')](function(_0x2fd2df){_0x1d960c(_0x2fd2df);});};AGIVertices[_0xc823('0x14')][_0xc823('0x4d')]=function(_0x283515,_0x2d20fc){this['rpc'][_0xc823('0x4e')](_0x283515)['then'](function(_0x5dd8ad){_0x2d20fc(null,_0x5dd8ad?_0x5dd8ad['name']:![]);})[_0xc823('0x13')](function(_0x53bf45){_0x2d20fc(_0x53bf45);});};AGIVertices[_0xc823('0x14')]['agentPause']=function(_0x2244bd,_0x100447,_0x50fc62){var _0x2ae99e={'role':'agent'};_0x2ae99e[_0x2244bd]=this['channel'][_0xc823('0x3c')];this['rpc'][_0xc823('0x4f')](_0x2ae99e,_0x100447,this['channel'][_0xc823('0x38')])[_0xc823('0x17')](function(_0x4b40e5){_0x50fc62(null,_[_0xc823('0x42')](_0x4b40e5)?![]:!![]);})[_0xc823('0x13')](function(_0x34ade7){logger[_0xc823('0x33')](_0x34ade7);_0x50fc62(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x54d0b5,_0x4cb43e){var _0x2240de={'role':_0xc823('0x50')};_0x2240de[_0x54d0b5]=this[_0xc823('0xe')][_0xc823('0x3c')];this[_0xc823('0xf')]['agentUnpause'](_0x2240de)[_0xc823('0x17')](function(_0x4e4191){_0x4cb43e(null,_[_0xc823('0x42')](_0x4e4191)?![]:!![]);})[_0xc823('0x13')](function(_0x5efb1b){logger[_0xc823('0x33')](_0x5efb1b);_0x4cb43e(null,![]);});};AGIVertices['prototype'][_0xc823('0x51')]=function(_0x11d3a1,_0x110374){var _0x42f203={'role':'agent'};_0x42f203[_0x11d3a1]=this['channel']['callerid'];this['rpc']['agentLogout'](_0x42f203)[_0xc823('0x17')](function(_0x302720){_0x110374(null,_['isNil'](_0x302720)?![]:!![]);})['catch'](function(_0x2cbd33){logger[_0xc823('0x33')](_0x2cbd33);_0x110374(null,![]);});};AGIVertices[_0xc823('0x14')][_0xc823('0x52')]=function(_0x2b54bb,_0x3f0385){var _0x2b0bdf={'role':'agent'};_0x2b0bdf[_0x2b54bb]=this[_0xc823('0xe')][_0xc823('0x3c')];var _0x3589f6=_0x2b54bb!='internal'?util['format']('%s/%s@from-sip/n',_0xc823('0x53'),this[_0xc823('0xe')]['callerid']):undefined;this[_0xc823('0xf')][_0xc823('0x52')](_0x2b0bdf,_0x3589f6)[_0xc823('0x17')](function(_0x58919c){_0x3f0385(null,_['isNil'](_0x58919c)?![]:!![]);})[_0xc823('0x13')](function(_0x39bfb8){logger[_0xc823('0x33')](_0x39bfb8);_0x3f0385(null,![]);});};AGIVertices['prototype'][_0xc823('0x54')]=function(_0x147481,_0x47d3d2){sh[_0xc823('0x55')](_[_0xc823('0x56')](_0x147481),function(_0x505cce,_0x4eef42){var _0x4cd52c=_0x4eef42[_0xc823('0x57')](/(\r\n|\n|\r)/gm,'');_0x47d3d2(null,_0x4cd52c);});};AGIVertices[_0xc823('0x14')]['googleCloudTTS']=function(_0x2cd33a,_0x1f356c){scripts[_0xc823('0x58')](_0x2cd33a[_0xc823('0x59')],_0x2cd33a[_0xc823('0x5a')]||_0xc823('0x5b'),_0x2cd33a['text'],_0x2cd33a[_0xc823('0x5c')]||'en-US',_0x2cd33a['ssmlGender']||_0xc823('0x5d'),_0x2cd33a['audioEncoding']||_0xc823('0x5e'))[_0xc823('0x17')](function(_0x2e0774){_0x1f356c(null,_0x2e0774);})[_0xc823('0x13')](function(_0x1c198e){_0x1f356c(_0x1c198e);});};AGIVertices[_0xc823('0x14')][_0xc823('0x5f')]=function(_0x51f22a,_0x22f8f5){scripts[_0xc823('0x5f')](_0x51f22a[_0xc823('0x5b')],_0x51f22a[_0xc823('0x60')]||'en',0x1)[_0xc823('0x17')](function(_0x514138){_0x22f8f5(null,_0x514138);})[_0xc823('0x13')](function(_0x1e9439){_0x22f8f5(_0x1e9439);});};AGIVertices[_0xc823('0x14')][_0xc823('0x61')]=function(_0x42406b,_0x5d7b65){var _0x310f3e={'uri':_0x42406b[_0xc823('0x62')],'method':_0x42406b[_0xc823('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x42406b[_0xc823('0x64')])==='number'&&parseInt(_0x42406b[_0xc823('0x64')])>=0x1?parseInt(_0x42406b[_0xc823('0x64')])*0x3e8:0x5*0x3e8};if(_[_0xc823('0x65')]([_0xc823('0x66'),_0xc823('0x67')],_0x310f3e[_0xc823('0x63')]['toUpperCase']())){try{_0x310f3e[_0xc823('0x68')]=_0x42406b['rawBody']?JSON[_0xc823('0x69')](_0x42406b[_0xc823('0xc')]):{};}catch(_0x1d4123){logger['error'](_0xc823('0x6a'),_0x1d4123);}}try{_0x310f3e[_0xc823('0x6b')]=_0x42406b[_0xc823('0x6c')]?JSON[_0xc823('0x69')](_0x42406b[_0xc823('0x6c')]):{};}catch(_0x308f04){logger[_0xc823('0x33')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x308f04);}if(_0x42406b[_0xc823('0x6d')]){try{var _0x280220=require(_0x42406b[_0xc823('0x6d')])[_0xc823('0x6e')](this,_0x310f3e);_0x310f3e[_0xc823('0x6f')]=Mustache[_0xc823('0x70')](_0x42406b[_0xc823('0x62')],_0x280220,{},['$$','$$']);if(_0x310f3e[_0xc823('0x6b')]){_0x310f3e[_0xc823('0x6b')]=JSON[_0xc823('0x69')](Mustache[_0xc823('0x70')](JSON[_0xc823('0x71')](_0x310f3e[_0xc823('0x6b')]),_0x280220,{},['$$','$$']));}if(_0x310f3e[_0xc823('0x68')]){_0x310f3e[_0xc823('0x68')]=JSON[_0xc823('0x69')](Mustache[_0xc823('0x70')](JSON[_0xc823('0x71')](_0x310f3e[_0xc823('0x68')]),_0x280220,{},['$$','$$']));}}catch(_0x473aa1){logger['error'](_0xc823('0x72'),_0x473aa1);}}rp(_0x310f3e)[_0xc823('0x17')](function(_0x28278c){var _0x1927ff={'statusCode':_0x28278c[_0xc823('0x73')]||0xc8,'statusMessage':_0x28278c[_0xc823('0x74')]||'OK','headers':_0x28278c['headers']||{},'body':_0x28278c[_0xc823('0x68')]||{}};_0x5d7b65(null,_0x1927ff);})[_0xc823('0x13')](function(_0x366d8e){var _0x3fa853={'statusCode':_0x366d8e[_0xc823('0x73')]||0x1f4,'statusMessage':_0x366d8e[_0xc823('0x75')]||_0xc823('0x76'),'headers':_0x366d8e['options'][_0xc823('0x6b')]||{},'body':_0x366d8e[_0xc823('0x77')][_0xc823('0x68')]||{}};_0x5d7b65(null,_0x3fa853);});};AGIVertices[_0xc823('0x14')][_0xc823('0x78')]=function(_0x22e758,_0x47d29e){scripts[_0xc823('0x78')](this[_0xc823('0xe')][_0xc823('0x38')],_0x22e758[_0xc823('0x79')],_0x22e758[_0xc823('0x5b')],_0x22e758[_0xc823('0x7a')]||'en')[_0xc823('0x17')](function(_0x5ef927){_0x47d29e(null,_0x5ef927);})['catch'](function(_0x5cf5f9){_0x47d29e(_0x5cf5f9);});};AGIVertices[_0xc823('0x14')]['googleDialogflowV2']=function(_0x35e1e2,_0x411a5d){scripts[_0xc823('0x7b')](this[_0xc823('0xe')]['uniqueid'],_0x35e1e2[_0xc823('0x7c')],_0x35e1e2[_0xc823('0x7d')],_0x35e1e2[_0xc823('0x7e')],_0x35e1e2[_0xc823('0x5b')],_0x35e1e2['dialogflowV2_language']||'en')[_0xc823('0x17')](function(_0x26c8f0){_0x411a5d(null,_0x26c8f0);})['catch'](function(_0x3fc59f){_0x411a5d(_0x3fc59f);});};AGIVertices['prototype'][_0xc823('0x7f')]=function(_0x57e306,_0x417a47){scripts[_0xc823('0x7f')](this[_0xc823('0xe')],_0x57e306)['then'](function(_0xb1e448){_0x417a47(null,_0xb1e448);})['catch'](function(_0x455df5){_0x417a47(_0x455df5);});};AGIVertices[_0xc823('0x14')][_0xc823('0x80')]=function(_0x1f998f,_0xdeaffc){scripts[_0xc823('0x80')](_0x1f998f[_0xc823('0x79')],_0x1f998f[_0xc823('0x5b')],_0x1f998f['ispeech_tts_language']||_0xc823('0x81'),_0x1f998f[_0xc823('0x82')])[_0xc823('0x17')](function(_0x1ec68a){_0xdeaffc(null,_0x1ec68a);})[_0xc823('0x13')](function(_0xeed288){_0xdeaffc(_0xeed288);});};AGIVertices[_0xc823('0x14')][_0xc823('0x83')]=function(_0x1e324b,_0x14bfd3,_0x5cceab){scripts[_0xc823('0x83')](_0x14bfd3,_0x1e324b[_0xc823('0x79')],_0x1e324b['ispeech_asr_language']||_0xc823('0x81'),this[_0xc823('0x84')](_0x1e324b[_0xc823('0x85')])?_0x1e324b[_0xc823('0x85')]:undefined)[_0xc823('0x17')](function(_0x18927e){_0x5cceab(null,_0x18927e);})['catch'](function(_0x596d87){_0x5cceab(_0x596d87);});};AGIVertices[_0xc823('0x14')][_0xc823('0x86')]=function(_0x39d74d,_0x283ddc){scripts['awsPolly'](_0x39d74d['aws_access_key_id'],_0x39d74d[_0xc823('0x87')],_0x39d74d[_0xc823('0x88')],_0x39d74d[_0xc823('0x89')]||_0xc823('0x8a'),_0x39d74d['text'],_0x39d74d[_0xc823('0x8b')]||_0xc823('0x5b'))['then'](function(_0xe59ea8){_0x283ddc(null,_0xe59ea8);})[_0xc823('0x13')](function(_0x433cd3){_0x283ddc(_0x433cd3);});};AGIVertices[_0xc823('0x14')]['awsLex']=function(_0x561a5b,_0x1d76bc){scripts[_0xc823('0x8c')](this[_0xc823('0xe')]['uniqueid'],_0x561a5b[_0xc823('0x8d')],_0x561a5b[_0xc823('0x87')],_0x561a5b[_0xc823('0x8e')],_0x561a5b[_0xc823('0x5b')],_0x561a5b[_0xc823('0x8f')])[_0xc823('0x17')](function(_0x1f0492){_0x1d76bc(null,_0x1f0492);})[_0xc823('0x13')](function(_0x5ae458){_0x1d76bc(_0x5ae458);});};AGIVertices[_0xc823('0x14')][_0xc823('0x90')]=function(_0xc0c51d,_0x4e8854,_0x208271){scripts[_0xc823('0x90')](_0x4e8854,_0xc0c51d[_0xc823('0x79')],_0xc0c51d['google_asr_language']||'en-US')[_0xc823('0x17')](function(_0x30f7da){_0x208271(null,_0x30f7da);})[_0xc823('0x13')](function(_0x3dd90e){_0x208271(_0x3dd90e);});};AGIVertices[_0xc823('0x14')][_0xc823('0x91')]=function(_0x1bbabc,_0x5a382f,_0xb41206){scripts[_0xc823('0x91')](_0x5a382f,_0x1bbabc['appid'],_0x1bbabc[_0xc823('0x92')],_0x1bbabc[_0xc823('0x6f')])['then'](function(_0x22256a){_0xb41206(null,_0x22256a);})[_0xc823('0x13')](function(_0x59d573){_0xb41206(_0x59d573);});};AGIVertices[_0xc823('0x14')][_0xc823('0x93')]=function(_0x34801b){var _0xee3f0a=_[_0xc823('0x65')](verticesWithRetry,_0x34801b['agicommand'])?_0x34801b:_[_0xc823('0x94')](_0x34801b);for(var _0x3ec3ba in _0xee3f0a){if(_0xee3f0a[_0xc823('0x95')](_0x3ec3ba)){if(_0xee3f0a[_0x3ec3ba]&&_[_0xc823('0x96')](_0xee3f0a[_0x3ec3ba])){if(_[_0xc823('0x65')](recursiveMapAttributes,_0x3ec3ba)){_0xee3f0a[_0x3ec3ba]=this[_0xc823('0x97')](_0xee3f0a[_0x3ec3ba]);}else{_0xee3f0a[_0x3ec3ba]=this['replaceAllVariables'](_0xee3f0a[_0x3ec3ba]);}}}}return _0xee3f0a;};AGIVertices[_0xc823('0x14')]['recursiveNodeIndex']=function(_0x5bfed8){for(var _0xbe9ded in _0x5bfed8){if(_0x5bfed8['hasOwnProperty'](_0xbe9ded)){if(_[_0xc823('0x98')](_0x5bfed8[_0xbe9ded])){this[_0xc823('0x99')](_0x5bfed8[_0xbe9ded]);}else if(_[_0xc823('0x9a')](_0x5bfed8[_0xbe9ded])){for(var _0x19bb62=0x0;_0x19bb62<_0x5bfed8[_0xbe9ded][_0xc823('0x9b')];_0x19bb62++){this[_0xc823('0x99')](_0x5bfed8[_0xbe9ded][_0x19bb62]);}}else if(_[_0xc823('0x96')](_0x5bfed8[_0xbe9ded])){_0x5bfed8[_0xbe9ded]=this[_0xc823('0x9c')](_0x5bfed8[_0xbe9ded]);}}}};AGIVertices[_0xc823('0x14')][_0xc823('0x9d')]=function(_0x2a727c,_0x33811d){for(var _0x1df16f in _0x2a727c){if(_0x2a727c[_0xc823('0x95')](_0x1df16f)){if(_['isPlainObject'](_0x2a727c[_0x1df16f])){if(!_['isEmpty'](_0x2a727c[_0x1df16f])){this[_0xc823('0x9d')](_0x2a727c[_0x1df16f],util[_0xc823('0x2b')](_0xc823('0x9e'),_0x33811d,_0x1df16f));}}else if(_[_0xc823('0x9a')](_0x2a727c[_0x1df16f])){for(var _0x2676f8=0x0;_0x2676f8<_0x2a727c[_0x1df16f][_0xc823('0x9b')];_0x2676f8++){this[_0xc823('0x9d')](_0x2a727c[_0x1df16f][_0x2676f8],util[_0xc823('0x2b')](_0xc823('0x9e'),_0x33811d,_0x1df16f+'['+_0x2676f8+']'));}}else{if(!_['isNil'](_0x2a727c[_0x1df16f])){this[_0xc823('0xe')]['setVariable'](util[_0xc823('0x2b')]('%s.%s',_0x33811d,_0x1df16f),_0x2a727c[_0x1df16f]);}}}}};AGIVertices[_0xc823('0x14')][_0xc823('0x97')]=function(_0x1f9934){try{var _0x115c12=JSON[_0xc823('0x69')](_0x1f9934);this['recursiveNodeIndex'](_0x115c12);return JSON[_0xc823('0x71')](_0x115c12);}catch(_0x1313e0){return this['replaceAllVariables'](_0x1f9934);}};AGIVertices['prototype'][_0xc823('0x9c')]=function(_0x2d9d6f){var _0x60be33=_0x2d9d6f[_0xc823('0x9f')]('{');for(var _0x5c92da=0x1;_0x5c92da<_0x60be33[_0xc823('0x9b')];_0x5c92da+=0x1){var _0x33140b=_0x60be33[_0x5c92da][_0xc823('0x9f')]('}');if(_0x33140b['length']>0x1){_0x2d9d6f=_0x2d9d6f[_0xc823('0xa0')]('{'+_0x33140b[0x0]+'}',this['channel'][_0xc823('0x10')](_0x33140b[0x0])[_0xc823('0xa1')]||_0x33140b[0x0]);}}if(_0x60be33['length']===0x1){return _0x2d9d6f[_0xc823('0x4b')]();}return this[_0xc823('0x9c')](_0x2d9d6f);};AGIVertices[_0xc823('0x14')][_0xc823('0xa2')]=function(_0x3a2c18,_0x210d12){var _0x5403ca=this[_0xc823('0xe')][_0xc823('0x10')](_0x3a2c18);if(_0x5403ca['result']===-0x1){return _0x5403ca;}logger['info'](util[_0xc823('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x210d12,_0x5403ca[_0xc823('0xa1')]));return this[_0xc823('0xe')]['setVariable'](_0x210d12,_0x5403ca[_0xc823('0xa1')]);};AGIVertices[_0xc823('0x14')][_0xc823('0x84')]=function(_0x6770b5){return _0x6770b5&&_0x6770b5!=='0'&&_0x6770b5!=='-1'&&_0x6770b5!=='';};AGIVertices['prototype'][_0xc823('0xa3')]=function(_0x15409d){this[_0xc823('0x37')][_0xc823('0x6e')](this,_0x15409d,'-');_0x15409d[_0xc823('0xa4')]=_0x15409d[_0xc823('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc823('0x14')]['mrcpsynth']=function(_0x47ed42){logger[_0xc823('0x2f')](util['format'](_0xc823('0xa5'),_0x47ed42[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x47ed42[_0xc823('0x5b')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xa7'));}var _0x5a615e='\x22'+_0x47ed42[_0xc823('0x5b')]+'\x22';if(this[_0xc823('0x84')](_0x47ed42['options'])){_0x5a615e+=','+_0x47ed42[_0xc823('0x77')];}var _0x2ec443=this['channel'][_0xc823('0x55')]('MRCPSynth',_0x5a615e);if(_0x2ec443[_0xc823('0xa8')]===-0x1){return _0x2ec443;}return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0xa9'),_0x5a615e));};AGIVertices['prototype'][_0xc823('0xaa')]=function(_0x4ae0bd){logger['info'](util[_0xc823('0x2b')](_0xc823('0xab'),_0x4ae0bd[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x4ae0bd[_0xc823('0xac')])){return this[_0xc823('0xe')]['noop'](_0xc823('0xad'));}var _0x3832d5=_0x4ae0bd[_0xc823('0xac')];if(this[_0xc823('0x84')](_0x4ae0bd[_0xc823('0x77')])){_0x3832d5+=','+_0x4ae0bd[_0xc823('0x77')];}var _0x3ef0ff=this[_0xc823('0xe')][_0xc823('0x55')](_0xc823('0xae'),_0x3832d5);if(_0x3ef0ff[_0xc823('0xa8')]===-0x1){return _0x3ef0ff;}var _0x58a659=this[_0xc823('0xa2')]('RECOG_CONFIDENCE()',_0xc823('0xaf'));if(_0x58a659[_0xc823('0xa8')]===-0x1){return _0x58a659;}var _0x4e9763=this[_0xc823('0xa2')](_0xc823('0xb0'),_0xc823('0xb1'));if(_0x4e9763['result']===-0x1){return _0x4e9763;}var _0x55481b=this[_0xc823('0xa2')](_0xc823('0xb2'),_0xc823('0xb3'));if(_0x55481b['result']===-0x1){return _0x55481b;}return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3832d5));};AGIVertices['prototype'][_0xc823('0x7')]=function(_0x33b4dc){logger[_0xc823('0x2f')](util['format'](_0xc823('0xb4'),_0x33b4dc[_0xc823('0x39')]));return this[_0xc823('0xe')]['agi']([_0x33b4dc[_0xc823('0xb5')],_0x33b4dc[_0xc823('0xb6')]]);};AGIVertices[_0xc823('0x14')][_0xc823('0xb7')]=function(_0x3ce7b1){logger[_0xc823('0x2f')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x3ce7b1['label']));if(this[_0xc823('0x84')](_0x3ce7b1[_0xc823('0x64')])){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0xb8'),_0x3ce7b1[_0xc823('0x64')]));var _0x1315d6=this[_0xc823('0xe')][_0xc823('0xb9')](_0x3ce7b1[_0xc823('0x64')]);if(_0x1315d6[_0xc823('0xa8')]===-0x1){return _0x1315d6;}}return this['channel'][_0xc823('0xb7')]();};AGIVertices['prototype'][_0xc823('0x49')]=function(_0x115947){logger['info'](util[_0xc823('0x2b')](_0xc823('0xba'),_0x115947['label']));if(!this[_0xc823('0x84')](_0x115947[_0xc823('0x47')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x115947,_0xc823('0xbb'));}_0x115947[_0xc823('0x48')]=moment();if(this['isConfigured'](_0x115947[_0xc823('0xbc')])){_0x115947[_0xc823('0x48')]=moment()['add'](_0x115947['delay'],_0xc823('0xbd'));}if(!this[_0xc823('0x84')](_0x115947[_0xc823('0x4c')])){_0x115947[_0xc823('0x4c')]=0x2;}this[_0xc823('0xbe')][_0xc823('0x6e')](this,_0x115947);return this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0xbf'),_0x115947['phone'],_0x115947[_0xc823('0x47')],_0x115947[_0xc823('0x48')]));};AGIVertices['prototype'][_0xc823('0xc0')]=function(_0x197a63){logger[_0xc823('0x2f')](util['format'](_0xc823('0xc1'),_0x197a63[_0xc823('0x39')]));var _0x564d2e=this[_0xc823('0xe')][_0xc823('0x55')](_0x197a63[_0xc823('0xc2')],_0x197a63[_0xc823('0x77')]);if(_0x564d2e['result']===-0x1){return _0x564d2e;}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0xc3'),_0x197a63['application'],_0x197a63[_0xc823('0x77')]));};AGIVertices['prototype'][_0xc823('0xc4')]=function(_0x3a53f5){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0xc5'),_0x3a53f5[_0xc823('0x39')]));if(!this['isConfigured'](_0x3a53f5[_0xc823('0x5b')])){return this[_0xc823('0xe')]['noop'](_0xc823('0xa7'));}var _0x32e926='\x22'+_0x3a53f5[_0xc823('0x5b')]+'\x22';if(this['isConfigured'](_0x3a53f5[_0xc823('0x77')])){_0x32e926+=','+_0x3a53f5[_0xc823('0x77')];}var _0x2d1099=this['channel']['exec'](_0xc823('0xc6'),_0x32e926);if(_0x2d1099['result']===-0x1){return _0x2d1099;}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x32e926));};AGIVertices['prototype'][_0xc823('0xc7')]=function(_0x5268cf){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0xc8'),_0x5268cf[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x5268cf[_0xc823('0x5b')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xa7'));}var _0x5dc2f3='\x22'+_0x5268cf[_0xc823('0x5b')]+'\x22';if(this[_0xc823('0x84')](_0x5268cf[_0xc823('0x77')])){_0x5dc2f3+=','+_0x5268cf['options'];}var _0x2c1162=this['channel'][_0xc823('0x55')](_0xc823('0xc6'),_0x5dc2f3);if(_0x2c1162[_0xc823('0xa8')]===-0x1){return _0x2c1162;}return this[_0xc823('0xe')][_0xc823('0xa6')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x5dc2f3));};AGIVertices[_0xc823('0x14')][_0xc823('0xc9')]=function(_0x4e371f){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0xca'),_0x4e371f[_0xc823('0x39')]));if(!this['isConfigured'](_0x4e371f[_0xc823('0xac')])){return this[_0xc823('0xe')]['noop'](_0xc823('0xad'));}var _0x1eb5d0=_0x4e371f[_0xc823('0xac')];if(this['isConfigured'](_0x4e371f['options'])){_0x1eb5d0+=','+_0x4e371f[_0xc823('0x77')];}var _0x780953=this['channel'][_0xc823('0x55')]('MRCPRecog',_0x1eb5d0);if(_0x780953[_0xc823('0xa8')]===-0x1){return _0x780953;}var _0xad9e9d=this[_0xc823('0xa2')](_0xc823('0xcb'),'LUMENVOX_ASR_CONFIDENCE');if(_0xad9e9d[_0xc823('0xa8')]===-0x1){return _0xad9e9d;}var _0x3e1483=this[_0xc823('0xa2')](_0xc823('0xb0'),_0xc823('0xcc'));if(_0x3e1483[_0xc823('0xa8')]===-0x1){return _0x3e1483;}var _0x237cb7=this[_0xc823('0xa2')](_0xc823('0xb2'),_0xc823('0xcd'));if(_0x237cb7[_0xc823('0xa8')]===-0x1){return _0x237cb7;}return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1eb5d0));};AGIVertices[_0xc823('0x14')][_0xc823('0xce')]=function(_0x451f69){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x451f69['label']));if(!this[_0xc823('0x84')](_0x451f69[_0xc823('0xac')])){return this['channel'][_0xc823('0xa6')](_0xc823('0xad'));}var _0x31b0e5=_0x451f69[_0xc823('0xac')];if(this[_0xc823('0x84')](_0x451f69[_0xc823('0x77')])){_0x31b0e5+=','+_0x451f69[_0xc823('0x77')];}var _0x3bb9f6=this[_0xc823('0xe')]['exec'](_0xc823('0xae'),_0x31b0e5);if(_0x3bb9f6[_0xc823('0xa8')]===-0x1){return _0x3bb9f6;}var _0x13dc51=this['getAndSetVariable'](_0xc823('0xcb'),_0xc823('0xcf'));if(_0x13dc51[_0xc823('0xa8')]===-0x1){return _0x13dc51;}var _0xbd6ae6=this[_0xc823('0xa2')](_0xc823('0xb0'),_0xc823('0xd0'));if(_0xbd6ae6['result']===-0x1){return _0xbd6ae6;}var _0x23169a=this[_0xc823('0xa2')](_0xc823('0xb2'),_0xc823('0xd1'));if(_0x23169a['result']===-0x1){return _0x23169a;}return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0xd2'),_0x31b0e5));};AGIVertices[_0xc823('0x14')]['database']=function(_0x4ae169){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0xd3'),_0x4ae169[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x4ae169[_0xc823('0xd4')])){return this[_0xc823('0xe')]['error'](_0x4ae169,_0xc823('0xd5'));}var _0x2b9990=this[_0xc823('0x19')][_0xc823('0x6e')](this,_0x4ae169[_0xc823('0xd4')]);if(!_0x2b9990){return this[_0xc823('0xe')][_0xc823('0x33')](_0x4ae169,_0xc823('0xd6'));}if(!this[_0xc823('0x84')](_0x4ae169[_0xc823('0x31')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x4ae169,_0xc823('0xd7'));}var _0x5f1dbd=_0x4ae169[_0xc823('0x31')][_0xc823('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0xd8'),_0x5f1dbd));var _0x143af7=this[_0xc823('0x2c')][_0xc823('0x6e')](this,_0x2b9990,_0x5f1dbd);this[_0xc823('0x37')][_0xc823('0x6e')](this,_0x4ae169,_0x5f1dbd);if(!this[_0xc823('0x84')](_0x4ae169[_0xc823('0xd9')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xda'));}var _0xbc1938=this['getVariable'][_0xc823('0x6e')](this,_0x4ae169[_0xc823('0xd9')]);if(!_0xbc1938){return this['channel'][_0xc823('0x33')](_0x4ae169,_0xc823('0xdb'));}var _0x22cfcb=this;_0x143af7['forEach'](function(_0x13f778,_0x3906e4){Object['keys'](_0x13f778)[_0xc823('0xdc')](function(_0x393c54){_0x22cfcb[_0xc823('0xe')][_0xc823('0xdd')](util['format'](_0xc823('0xde'),_0xbc1938,_0x3906e4,_0x393c54),_0x13f778[_0x393c54]);});});this[_0xc823('0xe')][_0xc823('0xdd')](util['format'](_0xc823('0xdf'),_0xbc1938),_0x143af7['length']);return this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0xe0'),_0xbc1938));};AGIVertices[_0xc823('0x14')]['dial']=function(_0x26f630){logger[_0xc823('0xe1')](util[_0xc823('0x2b')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x26f630['label']));if(!this[_0xc823('0x84')](_0x26f630['sip_id'])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x26f630,_0xc823('0xe2'));}var _0x158bc0=this[_0xc823('0x1b')][_0xc823('0x6e')](this,_0x26f630[_0xc823('0xe3')]);if(!_0x158bc0){return this[_0xc823('0xe')][_0xc823('0x33')](_0x26f630,_0xc823('0xe4'));}var _0xc4e882=this['channel'][_0xc823('0x55')](_0xc823('0xe5'),[util[_0xc823('0x2b')](_0xc823('0xe6'),_0x158bc0),_0x26f630[_0xc823('0x64')],_0x26f630[_0xc823('0xe7')],_0x26f630[_0xc823('0x62')]]);if(_0xc4e882[_0xc823('0xa8')]===-0x1){return _0xc4e882;}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0xe8'),_0xc823('0xe5')));};AGIVertices[_0xc823('0x14')][_0xc823('0xe9')]=function(_0x5244b8){logger['info'](util[_0xc823('0x2b')](_0xc823('0xea'),_0x5244b8['label']));if(!this[_0xc823('0x84')](_0x5244b8[_0xc823('0x79')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xeb'));}if(!this[_0xc823('0x84')](_0x5244b8['text'])){return this['channel'][_0xc823('0xa6')](_0xc823('0xa7'));}this[_0xc823('0xe')][_0xc823('0xec')]=!![];this[_0xc823('0x37')](_0x5244b8);this[_0xc823('0xed')](_0x5244b8[_0xc823('0x5b')],'in','','');this[_0xc823('0xe')][_0xc823('0xa6')](util['format'](_0xc823('0xee'),_0x5244b8['text']));var _0x441680=this[_0xc823('0x78')][_0xc823('0x6e')](this,_0x5244b8);if(_0x441680){for(var _0x403476 in _0x441680){if(_0x441680[_0xc823('0x95')](_0x403476)){this['channel'][_0xc823('0xdd')](util[_0xc823('0x2b')](_0xc823('0xef'),_0x403476[_0xc823('0xf0')]()),_0x441680[_0x403476]);}}this[_0xc823('0xed')](_0x441680[_0xc823('0xf1')],_0xc823('0xf2'),_0xc823('0xe9'),'');return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')]('Dialogflow\x20Result\x20%s',_0x441680[_0xc823('0xf1')]));}return this[_0xc823('0xe')][_0xc823('0x33')](_0x5244b8,_0xc823('0xf3'));};AGIVertices[_0xc823('0x14')][_0xc823('0xf4')]=function(_0x36677e){logger['info'](util[_0xc823('0x2b')](_0xc823('0xf5'),_0x36677e[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x36677e[_0xc823('0x7c')])){return this[_0xc823('0xe')][_0xc823('0xa6')]('no\x20project_id\x20configured');}if(!this[_0xc823('0x84')](_0x36677e[_0xc823('0x7d')])){return this['channel'][_0xc823('0xa6')](_0xc823('0xf6'));}if(!this[_0xc823('0x84')](_0x36677e[_0xc823('0x7e')])){return this['channel'][_0xc823('0xa6')](_0xc823('0xf7'));}if(!this[_0xc823('0x84')](_0x36677e[_0xc823('0xf8')])){return this[_0xc823('0xe')]['noop'](_0xc823('0xf9'));}if(!this[_0xc823('0x84')](_0x36677e[_0xc823('0x5b')])){return this['channel']['noop'](_0xc823('0xa7'));}this[_0xc823('0xe')][_0xc823('0xec')]=!![];this[_0xc823('0x37')](_0x36677e);this[_0xc823('0xed')](_0x36677e[_0xc823('0x5b')],'in','','');this[_0xc823('0xe')][_0xc823('0xa6')](util['format'](_0xc823('0xfa'),_0x36677e[_0xc823('0x5b')]));var _0x895d38=this[_0xc823('0x7b')][_0xc823('0x6e')](this,_0x36677e);if(_0x895d38){for(var _0x94cb0d in _0x895d38){if(_0x895d38[_0xc823('0x95')](_0x94cb0d)){if(_0x94cb0d!==_0xc823('0xfb')){this[_0xc823('0xe')][_0xc823('0xdd')](util[_0xc823('0x2b')](_0xc823('0xef'),_0x94cb0d[_0xc823('0xf0')]()),_0x895d38[_0x94cb0d]);}}}this[_0xc823('0xed')](_0x895d38[_0xc823('0xf1')],_0xc823('0xf2'),_0xc823('0xf4'),_0x895d38[_0xc823('0xfb')]);return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0xfc'),_0x895d38['speech']));}return this['channel'][_0xc823('0x33')](_0x36677e,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xc823('0x14')]['sesteknda']=function(_0x17dd48){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x17dd48[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x17dd48['ndauth_url'])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xfd'));}if(!this[_0xc823('0x84')](_0x17dd48['username'])){return this['channel'][_0xc823('0xa6')]('no\x20username\x20configured');}if(!this[_0xc823('0x84')](_0x17dd48[_0xc823('0xfe')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xff'));}if(!this['isConfigured'](_0x17dd48['ndassistant_url'])){return this['channel'][_0xc823('0xa6')](_0xc823('0xa7'));}this['channel'][_0xc823('0xec')]=!![];this[_0xc823('0x37')](_0x17dd48);this['createSquareMessage'](_0x17dd48[_0xc823('0x5b')],'in','','');this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x100'),_0x17dd48['text']));var _0x3efa12=this[_0xc823('0x7f')][_0xc823('0x6e')](this,_0x17dd48);if(_0x3efa12){for(var _0x55f7ae in _0x3efa12){if(_0x3efa12[_0xc823('0x95')](_0x55f7ae)){this[_0xc823('0xe')][_0xc823('0xdd')](util['format'](_0xc823('0x101'),_0x55f7ae[_0xc823('0xf0')]()),_0x3efa12[_0x55f7ae]);}}this[_0xc823('0xed')](_0x3efa12[_0xc823('0xf1')],'out',_0xc823('0x102'),'');if(_0x3efa12[_0xc823('0x103')]){this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0x104'),_0x3efa12['audiofile']));var _0xaa21d3=this[_0xc823('0xe')][_0xc823('0x105')](_0x3efa12[_0xc823('0x103')]);try{fs['unlink'](_0x3efa12['audiofile']+'.wav');}catch(_0xccace2){logger[_0xc823('0x33')](_0xccace2);}return _0xaa21d3;}else{return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x106'),_0x3efa12[_0xc823('0xf1')]));}}return this[_0xc823('0xe')]['error'](_0x17dd48,_0xc823('0x107'));};AGIVertices[_0xc823('0x14')][_0xc823('0x108')]=function(_0x380fe1){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x380fe1[_0xc823('0x39')]));return this['channel'][_0xc823('0xa6')]('end');};AGIVertices[_0xc823('0x14')][_0xc823('0x109')]=function(_0x1f1a02){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x1f1a02[_0xc823('0x39')]));var _0x18fa02='';if(_0x1f1a02[_0xc823('0x10a')]){if(!this[_0xc823('0x84')](_0x1f1a02[_0xc823('0x10a')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x1f1a02,'no\x20trunk\x20selected');}else{var _0x4816d8=parseInt(_0x1f1a02[_0xc823('0x10a')],0xa);if(isNaN(_0x4816d8)){_0x18fa02=_0x1f1a02[_0xc823('0x10a')];}else{_0x18fa02=this[_0xc823('0x1d')][_0xc823('0x6e')](this,_0x1f1a02[_0xc823('0x10a')]);if(!_0x18fa02){return this[_0xc823('0xe')][_0xc823('0x33')](_0x1f1a02,_0xc823('0x10b'));}}}}else if(_0x1f1a02[_0xc823('0x10c')]){_0x18fa02=_0x1f1a02[_0xc823('0x10c')];}else{return this[_0xc823('0xe')][_0xc823('0x33')](_0x1f1a02,'no\x20trunk\x20selected');}var _0x5dafa5=this['channel']['exec'](_0xc823('0xe5'),[util[_0xc823('0x2b')](_0xc823('0x10d'),_0x18fa02,_0x1f1a02['phone']),_0x1f1a02['timeout'],_0x1f1a02[_0xc823('0xe7')],_0x1f1a02[_0xc823('0x62')]]);if(_0x5dafa5[_0xc823('0xa8')]===-0x1){return _0x5dafa5;}return this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0xe8'),'DIAL'));};AGIVertices[_0xc823('0x14')]['finally']=function(_0x539ac6){logger[_0xc823('0x2f')](util['format'](_0xc823('0x10e'),_0x539ac6[_0xc823('0x39')]));return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x10f'));};AGIVertices[_0xc823('0x14')][_0xc823('0x110')]=function(_0x128f3c){logger['info'](util[_0xc823('0x2b')](_0xc823('0x111'),_0x128f3c['label']));if(_0x128f3c[_0xc823('0xa4')]===0x0){return this[_0xc823('0xa3')](_0x128f3c);}_0x128f3c[_0xc823('0xa4')]-=0x1;if(!this[_0xc823('0x84')](_0x128f3c[_0xc823('0x112')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x128f3c,_0xc823('0x113'));}var _0x4e67e5=this[_0xc823('0x114')][_0xc823('0x6e')](this,_0x128f3c[_0xc823('0x112')]);if(!_0x4e67e5){return this[_0xc823('0xe')][_0xc823('0x33')](_0x128f3c,_0xc823('0x115'));}if(!this[_0xc823('0x84')](_0x128f3c[_0xc823('0xd9')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0xc823('0xda'));}var _0x2b01d8=this[_0xc823('0xe')][_0xc823('0x116')](_0x4e67e5,_0x128f3c[_0xc823('0x117')],_0x128f3c[_0xc823('0x118')]);var _0x55e449=_0x2b01d8[_0xc823('0xa8')]?_0x2b01d8[_0xc823('0xa8')]['toString']():'';logger['info'](_0xc823('0x119'),JSON[_0xc823('0x71')](_0x2b01d8));if(_0x2b01d8[_0xc823('0xa8')]===-0x1){this[_0xc823('0x37')][_0xc823('0x6e')](this,_0x128f3c,_0x55e449);return _0x2b01d8;}else if(_0x2b01d8[_0xc823('0xa1')]==='timeout'){_0x2b01d8[_0xc823('0xa8')]=_0x55e449[_0xc823('0x9b')]>=parseInt(_0x128f3c[_0xc823('0x11a')])?'x':'i';}else{_0x2b01d8['result']=_0x55e449[_0xc823('0x9b')]>=parseInt(_0x128f3c['mindigit'])&&_0x55e449[_0xc823('0x9b')]<=parseInt(_0x128f3c['maxdigit'])?'x':'i';}var _0x168dcf=this[_0xc823('0x10')][_0xc823('0x6e')](this,_0x128f3c[_0xc823('0xd9')]);if(!_0x168dcf){return this[_0xc823('0xe')][_0xc823('0x33')](_0x128f3c,_0xc823('0xdb'));}this[_0xc823('0xe')][_0xc823('0xdd')](_0x168dcf,_0x55e449);if(this[_0xc823('0x84')](_0x128f3c['hiddendigitsnum'])){var _0x4cb5b5=parseInt(_0x128f3c[_0xc823('0x11b')],0xa);var _0x2565cb=rs['generate']({'charset':'*','length':_0x4cb5b5});var _0x567c93=_0x55e449['length'];if(_0x567c93>0x0){if(_0x567c93>_0x4cb5b5){this['createSquareDetailsReport'][_0xc823('0x6e')](this,_0x128f3c,_0x128f3c[_0xc823('0x11c')]===_0xc823('0x11d')?_0x2565cb+_0x55e449['substr'](_0x4cb5b5):_0x55e449[_0xc823('0x11e')](0x0,_0x567c93-_0x4cb5b5)+_0x2565cb);}else{this[_0xc823('0x37')]['sync'](this,_0x128f3c,rs['generate']({'charset':'*','length':_0x567c93}));}}else{this[_0xc823('0x37')]['sync'](this,_0x128f3c,'');}}else{this[_0xc823('0x37')]['sync'](this,_0x128f3c,_0x55e449);}return _0x2b01d8;};AGIVertices[_0xc823('0x14')][_0xc823('0x11f')]=function(_0x1b473e){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x120'),_0x1b473e[_0xc823('0x39')]));return this[_0xc823('0x110')](_0x1b473e);};AGIVertices[_0xc823('0x14')]['goal']=function(_0x2e5e12){logger['info'](util[_0xc823('0x2b')](_0xc823('0x121'),_0x2e5e12[_0xc823('0x39')]));this[_0xc823('0x37')][_0xc823('0x6e')](this,_0x2e5e12,_0x2e5e12[_0xc823('0x122')]);return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')]('GOAL\x20%s',_0x2e5e12[_0xc823('0x122')]));};AGIVertices[_0xc823('0x14')][_0xc823('0x123')]=function(_0x17377f){logger[_0xc823('0x2f')](util['format'](_0xc823('0x124'),_0x17377f[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x17377f[_0xc823('0x8d')])||!this['isConfigured'](_0x17377f['aws_secret_access_key'])){return this[_0xc823('0xe')][_0xc823('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xc823('0x84')](_0x17377f[_0xc823('0x5b')])){return this['channel'][_0xc823('0xa6')](_0xc823('0xa7'));}this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x125'),_0x17377f[_0xc823('0x5b')]));var _0x17b052=this['awsPolly']['sync'](this,_0x17377f);if(_0x17b052){this[_0xc823('0xe')][_0xc823('0xa6')](util['format'](_0xc823('0x126'),_0x17b052));var _0x2007d4=this[_0xc823('0xe')][_0xc823('0x105')](_0x17b052);try{fs[_0xc823('0x127')](_0x17b052+_0xc823('0x128'));}catch(_0x42aa5f){logger['error'](_0x42aa5f);}return _0x2007d4;}return this[_0xc823('0xe')][_0xc823('0x33')](_0x17377f,_0xc823('0x129'));};AGIVertices[_0xc823('0x14')][_0xc823('0x12a')]=function(_0x243688){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x12b'),_0x243688['label']));if(!this[_0xc823('0x84')](_0x243688[_0xc823('0x8d')])||!this['isConfigured'](_0x243688['aws_secret_access_key'])){return this['channel']['noop'](_0xc823('0x12c'));}if(!this[_0xc823('0x84')](_0x243688['aws_bot_name'])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x12d'));}if(!this[_0xc823('0x84')](_0x243688[_0xc823('0x5b')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xa7'));}this[_0xc823('0xe')][_0xc823('0xec')]=!![];this[_0xc823('0x37')](_0x243688);this['createSquareMessage'](_0x243688[_0xc823('0x5b')],'in','','');this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')]('Trying\x20Amazon\x20Lex:\x20%s',_0x243688[_0xc823('0x5b')]));var _0x84a201=this['awsLex']['sync'](this,_0x243688);if(_0x84a201){for(var _0x2e3d55 in _0x84a201){if(_0x84a201[_0xc823('0x95')](_0x2e3d55)&&_[_0xc823('0x96')](_0x84a201[_0x2e3d55])){this[_0xc823('0xe')]['setVariable'](util[_0xc823('0x2b')](_0xc823('0x12e'),_0x2e3d55[_0xc823('0xf0')]()),_0x84a201[_0x2e3d55]);}}if(_[_0xc823('0x42')](_0x84a201['message'])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x12f'));}else{this['createSquareMessage'](_0x84a201[_0xc823('0x75')],_0xc823('0xf2'),_0xc823('0x130'),'');return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x131'),_0x84a201['message']));}}return this['channel'][_0xc823('0x33')](_0x243688,_0xc823('0x132'));};AGIVertices[_0xc823('0x14')]['googleasr']=function(_0x12355e){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x133'),_0x12355e[_0xc823('0x39')],_0x12355e[_0xc823('0x64')]));if(!this[_0xc823('0x84')](_0x12355e[_0xc823('0x79')])){return this[_0xc823('0xe')]['noop'](_0xc823('0xeb'));}var _0x4d3d0e=_0xc823('0x134');var _0x3ca1ef=util[_0xc823('0x2b')](_0xc823('0x135'),FILES_PATH,rs[_0xc823('0x136')](0x4));var _0x58ad23=util[_0xc823('0x2b')]('%s.%s',_0x3ca1ef,_0x4d3d0e);var _0x2eccd9=!![];if(_0x12355e[_0xc823('0x137')]==='NOBEEP'){_0x2eccd9=![];}var _0x38a564=this[_0xc823('0xe')][_0xc823('0x138')](_0x3ca1ef,_0x4d3d0e,_0x12355e[_0xc823('0x139')],_0x12355e['timeout'],undefined,_0x2eccd9);if(_0x38a564[_0xc823('0xa8')]!==-0x1){this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x13a'),_0x58ad23));var _0x4aaee9=this[_0xc823('0x90')][_0xc823('0x6e')](this,_0x12355e,_0x58ad23);if(_0x4aaee9){for(var _0x10f96e in _0x4aaee9){if(_0x4aaee9[_0xc823('0x95')](_0x10f96e)){this['channel']['setVariable'](util[_0xc823('0x2b')](_0xc823('0x13b'),_0x10f96e['toUpperCase']()),_0x4aaee9[_0x10f96e]);}}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x13c'),JSON[_0xc823('0x71')](_0x4aaee9)));}}return _0x38a564;};AGIVertices[_0xc823('0x14')][_0xc823('0x13d')]=function(_0x26c1b2){logger['info'](util[_0xc823('0x2b')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x26c1b2[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x26c1b2['appid'])){return this['channel'][_0xc823('0xa6')](_0xc823('0x13e'));}if(!this[_0xc823('0x84')](_0x26c1b2[_0xc823('0x92')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x13f'));}var _0x52ecd1=_0xc823('0x134');var _0x1e54d3=util[_0xc823('0x2b')](_0xc823('0x135'),FILES_PATH,rs[_0xc823('0x136')](0x4));var _0x3a63cf=util[_0xc823('0x2b')](_0xc823('0x9e'),_0x1e54d3,_0x52ecd1);var _0x17af99=!![];if(_0x26c1b2[_0xc823('0x137')]===_0xc823('0x140')){_0x17af99=![];}var _0x75b287=this[_0xc823('0xe')][_0xc823('0x138')](_0x1e54d3,_0x52ecd1,_0x26c1b2[_0xc823('0x139')],_0x26c1b2[_0xc823('0x64')],undefined,_0x17af99);if(_0x75b287['result']!==-0x1){this[_0xc823('0xe')][_0xc823('0xa6')](util['format'](_0xc823('0x141'),_0x3a63cf));var _0x465b75=this[_0xc823('0x91')][_0xc823('0x6e')](this,_0x26c1b2,_0x3a63cf);if(_0x465b75){for(var _0x2721ca in _0x465b75){if(_0x465b75[_0xc823('0x95')](_0x2721ca)){this[_0xc823('0xe')][_0xc823('0xdd')](util[_0xc823('0x2b')](_0xc823('0x142'),_0x2721ca[_0xc823('0xf0')]()),_0x465b75[_0x2721ca]);}}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x143'),JSON[_0xc823('0x71')](_0x465b75)));}}return _0x75b287;};AGIVertices[_0xc823('0x14')][_0xc823('0x144')]=function(_0x5cbe9a){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5cbe9a[_0xc823('0x39')]));return this[_0xc823('0xe')]['continueAt'](_0x5cbe9a[_0xc823('0x145')],_0x5cbe9a[_0xc823('0x3e')],_0x5cbe9a[_0xc823('0x146')]);};AGIVertices[_0xc823('0x14')][_0xc823('0x147')]=function(_0x410527){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x410527[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x410527[_0xc823('0x148')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x410527,'no\x20condition\x20configured');}try{var _0x1195a7=eval(_0x410527[_0xc823('0x148')])?_0xc823('0x149'):'false';this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x14a'),_0x410527[_0xc823('0x148')],_0x1195a7));return{'code':0xc8,'result':_0x1195a7};}catch(_0x1776ec){return{'code':0xc8,'result':_0xc823('0x14b')};}};AGIVertices['prototype'][_0xc823('0x14c')]=function(_0x224fe5){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x224fe5[_0xc823('0x39')]));if(!this['isConfigured'](_0x224fe5['interval_id'])){return this['channel'][_0xc823('0x33')](_0x224fe5,_0xc823('0x14d'));}var _0x40bc38=this[_0xc823('0x25')][_0xc823('0x6e')](this,_0x224fe5[_0xc823('0x14e')]);if(!_0x40bc38){return this[_0xc823('0xe')][_0xc823('0x33')](_0x224fe5,_0xc823('0x14f'));}for(var _0x219f8c=0x0;_0x219f8c<_0x40bc38['length'];_0x219f8c+=0x1){var _0xb36105=this['channel'][_0xc823('0x10')](util['format'](_0xc823('0x150'),_0x40bc38[_0x219f8c]));if(_0xb36105['result']===-0x1){return _0xb36105;}logger['info'](util[_0xc823('0x2b')](_0xc823('0x151'),_0x40bc38[_0x219f8c],_0xb36105['extra']));if(_0xb36105[_0xc823('0xa1')]==='true'){logger[_0xc823('0x2f')](util['format'](_0xc823('0x151'),_0x40bc38[_0x219f8c],'true'));this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0x151'),_0x40bc38[_0x219f8c],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xc823('0x2b')](_0xc823('0x151'),_0x40bc38[_0x219f8c],_0xc823('0x14b')));this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x151'),_0x40bc38[_0x219f8c],_0xc823('0x14b')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xc823('0x14')][_0xc823('0x152')]=function(_0x49057e){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x49057e[_0xc823('0x39')]));return this[_0xc823('0xe')][_0xc823('0x152')]();};AGIVertices[_0xc823('0x14')][_0xc823('0x153')]=function(_0x27aa26){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x154'),_0x27aa26[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x27aa26['key'])){return this[_0xc823('0xe')]['noop'](_0xc823('0xeb'));}var _0x57cc57=_0xc823('0x134');var _0x382877=util['format'](_0xc823('0x135'),FILES_PATH,rs[_0xc823('0x136')](0x4));var _0x2924ed=util[_0xc823('0x2b')]('%s.%s',_0x382877,_0x57cc57);var _0x5538f2=!![];if(_0x27aa26[_0xc823('0x137')]==='NOBEEP'){_0x5538f2=![];}var _0x5e568f=this[_0xc823('0xe')]['recordFile'](_0x382877,_0x57cc57,_0x27aa26[_0xc823('0x139')],_0x27aa26['timeout'],undefined,_0x5538f2);if(_0x5e568f[_0xc823('0xa8')]!==-0x1){this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0x155'),_0x2924ed));var _0x2786fc=this[_0xc823('0x83')][_0xc823('0x6e')](this,_0x27aa26,_0x2924ed);if(_0x2786fc){for(var _0x4ba655 in _0x2786fc){if(_0x2786fc[_0xc823('0x95')](_0x4ba655)){this[_0xc823('0xe')][_0xc823('0xdd')](util[_0xc823('0x2b')](_0xc823('0x156'),_0x4ba655['toUpperCase']()),_0x2786fc[_0x4ba655]);}}return this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x157'),JSON[_0xc823('0x71')](_0x2786fc)));}}return _0x5e568f;};AGIVertices[_0xc823('0x14')][_0xc823('0x158')]=function(_0x478fe7){logger[_0xc823('0x2f')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x478fe7[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x478fe7[_0xc823('0x79')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xeb'));}if(!this['isConfigured'](_0x478fe7['text'])){return this[_0xc823('0xe')]['noop']('no\x20text\x20configured');}this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x159'),_0x478fe7['text']));var _0x32db0d=this[_0xc823('0x80')][_0xc823('0x6e')](this,_0x478fe7);if(_0x32db0d){this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x155'),_0x32db0d));var _0x4dc761=this[_0xc823('0xe')][_0xc823('0x105')](_0x32db0d,_0x478fe7[_0xc823('0x139')]);try{fs[_0xc823('0x127')](_0x32db0d+_0xc823('0x128'));}catch(_0x45a7df){logger[_0xc823('0x33')](_0x45a7df);}return _0x4dc761;}return this[_0xc823('0xe')][_0xc823('0x33')](_0x478fe7,_0xc823('0x15a'));};AGIVertices[_0xc823('0x14')]['login']=function(_0x88790c){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x88790c[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x88790c[_0xc823('0x15b')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x88790c,_0xc823('0x15c'));}logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x15d'),this[_0xc823('0xe')][_0xc823('0x3c')],_0x88790c[_0xc823('0x15b')]));var _0x53e750=this[_0xc823('0x52')][_0xc823('0x6e')](this,_0x88790c[_0xc823('0x15b')]);if(_0x53e750){logger['info'](util[_0xc823('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xc823('0x3c')],_0x88790c[_0xc823('0x15b')]));this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0x15e'),this[_0xc823('0xe')][_0xc823('0x3c')],_0x88790c['findBy']));return{'code':0xc8,'result':_0xc823('0x15f')};}else{logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x160'),this['channel'][_0xc823('0x3c')],_0x88790c['findBy']));this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xc823('0x3c')],_0x88790c[_0xc823('0x15b')]));return{'code':0xc8,'result':_0xc823('0x161')};}};AGIVertices[_0xc823('0x14')][_0xc823('0x162')]=function(_0x238ab5){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x163'),_0x238ab5[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x238ab5['findBy'])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x238ab5,_0xc823('0x15c'));}logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x15d'),this[_0xc823('0xe')]['callerid'],_0x238ab5['findBy']));var _0x55263f=this['agentLogout']['sync'](this,_0x238ab5[_0xc823('0x15b')]);if(_0x55263f){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc823('0xe')]['callerid'],_0x238ab5[_0xc823('0x15b')]));this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0x15e'),this[_0xc823('0xe')][_0xc823('0x3c')],_0x238ab5['findBy']));return{'code':0xc8,'result':_0xc823('0x15f')};}else{logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xc823('0x3c')],_0x238ab5['findBy']));this[_0xc823('0xe')][_0xc823('0xa6')](util['format'](_0xc823('0x160'),this[_0xc823('0xe')][_0xc823('0x3c')],_0x238ab5[_0xc823('0x15b')]));return{'code':0xc8,'result':_0xc823('0x161')};}};AGIVertices[_0xc823('0x14')][_0xc823('0x164')]=function(_0x371797){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x165'),_0x371797[_0xc823('0x39')]));if(!this['isConfigured'](_0x371797[_0xc823('0x166')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x371797,'no\x20operation\x20configured');}this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x167'),_0x371797[_0xc823('0x166')]));var _0x360c04=eval(_0x371797[_0xc823('0x166')]);if(!this[_0xc823('0x84')](_0x371797[_0xc823('0xd9')])){return this['channel'][_0xc823('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x16492e=this[_0xc823('0x10')][_0xc823('0x6e')](this,_0x371797[_0xc823('0xd9')]);if(!_0x16492e){return this[_0xc823('0xe')][_0xc823('0x33')](_0x371797,_0xc823('0xdb'));}if(_['isArray'](_0x360c04)){var _0x110279=this;_0x360c04['forEach'](function(_0x2243ff,_0x402fac){_0x110279['channel'][_0xc823('0xdd')](util[_0xc823('0x2b')](_0xc823('0x168'),_0x16492e,_0x402fac),_0x2243ff);});return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0x169'),_0x16492e));}else{return this['channel'][_0xc823('0xdd')](_0x16492e,_0x360c04);}};AGIVertices[_0xc823('0x14')][_0xc823('0xd')]=function(_0x185c75){logger[_0xc823('0x2f')](util['format'](_0xc823('0x16a'),_0x185c75[_0xc823('0x39')]));if(_0x185c75['retry']===0x0){return this[_0xc823('0xa3')](_0x185c75);}_0x185c75[_0xc823('0xa4')]-=0x1;if(!this[_0xc823('0x84')](_0x185c75[_0xc823('0x112')])){return this['channel'][_0xc823('0x33')](_0x185c75,_0xc823('0x113'));}var _0x959dab=this['getSound'][_0xc823('0x6e')](this,_0x185c75[_0xc823('0x112')]);if(!_0x959dab){return this[_0xc823('0xe')]['error'](_0x185c75,_0xc823('0x115'));}var _0x1c79d3=this[_0xc823('0xe')]['getData'](_0x959dab,_0x185c75[_0xc823('0x117')],_0x185c75['digit']);var _0xa5c1f6=_0x1c79d3[_0xc823('0xa8')];if(_0x1c79d3[_0xc823('0xa8')]===-0x1){this[_0xc823('0x37')][_0xc823('0x6e')](this,_0x185c75,'-1');return _0x1c79d3;}else if(_0x1c79d3[_0xc823('0xa1')]===_0xc823('0x64')){_0x1c79d3[_0xc823('0xa8')]=_0x1c79d3[_0xc823('0xa8')][_0xc823('0x9b')]>0x0?_0x1c79d3['result']:'t';}else if(_['isEmpty'](_0x1c79d3[_0xc823('0xa8')])){_0x1c79d3['result']='#';_0xa5c1f6='#';}if(!this[_0xc823('0x84')](_0x185c75[_0xc823('0xd9')])){this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xda'));}else{var _0x454d42=this[_0xc823('0x10')]['sync'](this,_0x185c75[_0xc823('0xd9')]);if(!_0x454d42){return this[_0xc823('0xe')][_0xc823('0x33')](_0x185c75,_0xc823('0xdb'));}this[_0xc823('0xe')][_0xc823('0xdd')](_0x454d42,_0xa5c1f6);}this[_0xc823('0x37')][_0xc823('0x6e')](this,_0x185c75,_0xa5c1f6);return _0x1c79d3;};AGIVertices[_0xc823('0x14')][_0xc823('0xa6')]=function(_0xa142a6){logger['info'](util[_0xc823('0x2b')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0xa142a6[_0xc823('0x39')]));return this[_0xc823('0xe')][_0xc823('0xa6')](_0xa142a6['output']||_0xa142a6[_0xc823('0x39')]);};AGIVertices['prototype'][_0xc823('0x16b')]=function(_0xead1d6){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x16c'),_0xead1d6['label']));if(!this[_0xc823('0x84')](_0xead1d6['findBy'])){return this[_0xc823('0xe')][_0xc823('0x33')](_0xead1d6,'no\x20find\x20by\x20configured');}logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xc823('0x3c')],_0xead1d6['findBy']));var _0x66bbf2=this[_0xc823('0x4d')]['sync'](this,_0xead1d6[_0xc823('0x16d')]);var _0x419ffc=this[_0xc823('0x4f')][_0xc823('0x6e')](this,_0xead1d6['findBy'],_0x66bbf2);if(_0x419ffc){logger['info'](util['format'](_0xc823('0x15e'),this[_0xc823('0xe')]['callerid'],_0xead1d6[_0xc823('0x15b')]));this[_0xc823('0xe')]['noop'](util['format'](_0xc823('0x15e'),this['channel']['callerid'],_0xead1d6[_0xc823('0x15b')]));return{'code':0xc8,'result':_0xc823('0x15f')};}else{logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x160'),this[_0xc823('0xe')]['callerid'],_0xead1d6[_0xc823('0x15b')]));this['channel'][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x15e'),this[_0xc823('0xe')][_0xc823('0x3c')],_0xead1d6[_0xc823('0x15b')]));return{'code':0xc8,'result':_0xc823('0x161')};}};AGIVertices['prototype'][_0xc823('0x16e')]=function(_0x58dadb){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x16f'),_0x58dadb[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x58dadb[_0xc823('0x112')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x58dadb,'no\x20file\x20audio\x20selected');}var _0x27fa4f=this['getSound']['sync'](this,_0x58dadb[_0xc823('0x112')]);if(!_0x27fa4f){return this[_0xc823('0xe')][_0xc823('0x33')](_0x58dadb,_0xc823('0x115'));}var _0x304a9d=this['channel'][_0xc823('0x55')](_0xc823('0x170'),[_0x27fa4f,_0x58dadb[_0xc823('0xe7')]]);if(_0x304a9d[_0xc823('0xa8')]===-0x1){return _0x304a9d;}return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')](_0xc823('0xc3'),_0xc823('0x170'),_0x27fa4f));};AGIVertices['prototype'][_0xc823('0x171')]=function(_0x558e00){logger[_0xc823('0x2f')](util['format'](_0xc823('0x172'),_0x558e00[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x558e00[_0xc823('0x173')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x558e00,_0xc823('0x174'));}var _0x3b0981='';var _0xef05fa=parseInt(_0x558e00[_0xc823('0x173')],0xa);if(isNaN(_0xef05fa)){_0x3b0981=_0x558e00[_0xc823('0x173')];}else{_0x3b0981=this[_0xc823('0x15')]['sync'](this,_0x558e00['queue_id']);if(!_0x3b0981){return this['channel'][_0xc823('0x33')](_0x558e00,_0xc823('0x175'));}}var _0x5598c3='';if(this[_0xc823('0x84')](_0x558e00[_0xc823('0x112')])){var _0x5f4d25=this['getSound'][_0xc823('0x6e')](this,_0x558e00[_0xc823('0x112')]);if(_0x5f4d25){_0x5598c3=_0x5f4d25;}}this[_0xc823('0x37')]['sync'](this,_0x558e00,_0x3b0981);if(_0x558e00[_0xc823('0xe7')][_0xc823('0x176')]('x')<0x0){_0x558e00[_0xc823('0xe7')]+='x';}if(_0x558e00[_0xc823('0xe7')]['indexOf']('X')<0x0){_0x558e00[_0xc823('0xe7')]+='X';}this[_0xc823('0xe')][_0xc823('0xdd')](_0xc823('0x177'),_0x3b0981?_0x3b0981['toLowerCase']():'');var _0x5f57ff=this['channel'][_0xc823('0x55')](_0xc823('0x178'),[_0x3b0981,_0x558e00[_0xc823('0xe7')],_0x558e00[_0xc823('0x62')],_0x5598c3,_0x558e00[_0xc823('0x64')],_0x558e00[_0xc823('0x7')],_0x558e00[_0xc823('0x179')],_0x558e00[_0xc823('0x17a')],'',_0x558e00[_0xc823('0x17b')]]);if(_0x5f57ff['result']===-0x1){return _0x5f57ff;}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0xc3'),_0xc823('0x178'),_0x3b0981));};AGIVertices[_0xc823('0x14')][_0xc823('0x17c')]=function(_0x7d4c06){logger['info'](util[_0xc823('0x2b')](_0xc823('0x17d'),_0x7d4c06[_0xc823('0x39')]));var _0x3ea614=_0x7d4c06[_0xc823('0x17e')]||_0xc823('0x134');var _0x6b5958=util['format'](_0xc823('0x17f'),this['channel'][_0xc823('0x38')],rs[_0xc823('0x136')](0x5));var _0x434ba0=util[_0xc823('0x2b')](_0xc823('0x180'),FILES_PATH,_0x6b5958,_0x3ea614);var _0x34a97d=util[_0xc823('0x2b')](_0xc823('0x135'),FILES_PATH,_0x6b5958);this[_0xc823('0x3d')][_0xc823('0x6e')](this,_0x7d4c06,_0x6b5958,_0x434ba0);this[_0xc823('0xe')][_0xc823('0xdd')](_0xc823('0x181'),_0x6b5958);logger[_0xc823('0x2f')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x34a97d,_0x3ea614,_0x7d4c06[_0xc823('0x182')],_0x7d4c06[_0xc823('0x64')]);return this[_0xc823('0xe')][_0xc823('0x138')](_0x34a97d,_0x3ea614,_0x7d4c06['escape_digits'],_0x7d4c06[_0xc823('0x64')],undefined,!![]);};AGIVertices[_0xc823('0x14')][_0xc823('0x183')]=function(_0x3c4b47){logger['info'](util['format'](_0xc823('0x184'),_0x3c4b47[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x3c4b47['url'])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x185'));}var _0xca27d6=this['restAPI'][_0xc823('0x6e')](this,_0x3c4b47);logger['info'](util[_0xc823('0x2b')](_0xc823('0x186'),util[_0xc823('0x187')](_0xca27d6,{'showHidden':![],'depth':null})));if(!this[_0xc823('0x84')](_0x3c4b47['variable_id'])){return this['channel']['noop'](_0xc823('0x188'));}var _0x3ceeb5=this['getVariable'][_0xc823('0x6e')](this,_0x3c4b47[_0xc823('0xd9')]);if(!_0x3ceeb5){return this[_0xc823('0xe')][_0xc823('0x33')](_0x3c4b47,_0xc823('0xdb'));}this['channel'][_0xc823('0xdd')](util[_0xc823('0x2b')](_0xc823('0x189'),_0x3ceeb5),_0xca27d6[_0xc823('0x73')]?_0xca27d6[_0xc823('0x73')]:'200');this[_0xc823('0xe')][_0xc823('0xdd')](util[_0xc823('0x2b')](_0xc823('0x18a'),_0x3ceeb5),_0xca27d6[_0xc823('0x74')]?_0xca27d6[_0xc823('0x74')]:'OK');if(_0xca27d6[_0xc823('0x68')]){try{this[_0xc823('0x9d')](_0xca27d6[_0xc823('0x68')],_0x3ceeb5);}catch(_0x5864d){logger['error'](util[_0xc823('0x2b')](_0xc823('0x18b'),_0x3ceeb5));}}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')]('variable\x20%s\x20set',_0x3ceeb5));};AGIVertices[_0xc823('0x14')][_0xc823('0x18c')]=function(_0x5f130a){logger['info'](util['format'](_0xc823('0x18d'),_0x5f130a[_0xc823('0x39')]));return this[_0xc823('0xe')]['sayDigits'](_0x5f130a[_0xc823('0x18e')][_0xc823('0x57')](/\s+/g,''),_0x5f130a[_0xc823('0x182')]);};AGIVertices[_0xc823('0x14')]['saynumber']=function(_0x1af9ac){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x18f'),_0x1af9ac[_0xc823('0x39')]));return this[_0xc823('0xe')][_0xc823('0x190')](_0x1af9ac[_0xc823('0x191')][_0xc823('0x57')](/\s+/g,''),_0x1af9ac['escape_digits']);};AGIVertices[_0xc823('0x14')][_0xc823('0x192')]=function(_0x491bef){logger['info'](util[_0xc823('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x491bef['label']));return this[_0xc823('0xe')][_0xc823('0x193')](_0x491bef[_0xc823('0x5b')],_0x491bef[_0xc823('0x182')]);};AGIVertices[_0xc823('0x14')][_0xc823('0x194')]=function(_0x434b3d){logger['info'](util[_0xc823('0x2b')](_0xc823('0x195'),_0x434b3d[_0xc823('0x39')]));if(!this['isConfigured'](_0x434b3d[_0xc823('0x196')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x197'));}var _0x5ba1b1=this[_0xc823('0x22')][_0xc823('0x6e')](this,_0x434b3d[_0xc823('0x196')]);if(!_0x5ba1b1||!_0x5ba1b1[_0xc823('0x198')]){return this[_0xc823('0xe')][_0xc823('0x33')](_0x434b3d,'no\x20mail\x20account\x20found');}var _0x1586e9={'from':util['format'](_0xc823('0x199'),_0x5ba1b1[_0xc823('0x12')],_0x5ba1b1[_0xc823('0x19a')]||_0x5ba1b1[_0xc823('0x198')][_0xc823('0x19b')]),'to':_0x434b3d['to']||'','cc':_0x434b3d['cc']||'','bcc':_0x434b3d[_0xc823('0x19c')]||'','subject':_0x434b3d[_0xc823('0x19d')],'html':_0x434b3d[_0xc823('0x5b')],'text':_0x434b3d[_0xc823('0x5b')]};if(this[_0xc823('0x84')](_0x434b3d['template_id'])){}logger['debug'](_0xc823('0x19e'),JSON[_0xc823('0x71')](_0x1586e9));this['createSquareDetailsReport'][_0xc823('0x6e')](this,_0x434b3d,_0x434b3d['account_id']);this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x19f'),_0x5ba1b1[_0xc823('0x12')]));this[_0xc823('0x24')]['sync'](this,_0x5ba1b1['smtpOptions'],_0x1586e9);return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x1a0'));};AGIVertices[_0xc823('0x14')][_0xc823('0x1a1')]=function(_0x303f66){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x303f66[_0xc823('0x39')]));return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x1a2'));};AGIVertices[_0xc823('0x14')][_0xc823('0x1a3')]=function(_0x1caad3){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x1a4'),_0x1caad3[_0xc823('0x39')]));if(!this['isConfigured'](_0x1caad3[_0xc823('0x1a5')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x1a6'));}var _0x5dbfd0=this[_0xc823('0x1a7')][_0xc823('0x6e')](this,_0x1caad3[_0xc823('0x1a5')]);if(!_0x5dbfd0){return this[_0xc823('0xe')]['error'](_0x1caad3,'no\x20sms\x20account\x20found');}var _0x988dff={'body':_0x1caad3[_0xc823('0x1a8')],'phone':_0x1caad3['to']||'','SmsAccountId':_0x5dbfd0['id']};logger[_0xc823('0xe1')](_0xc823('0x1a9'),JSON[_0xc823('0x71')](_0x988dff));this['createSquareDetailsReport'][_0xc823('0x6e')](this,_0x1caad3,_0x1caad3[_0xc823('0x1a5')]);this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5dbfd0[_0xc823('0x12')]));this[_0xc823('0x36')]['sync'](this,_0x988dff);return this[_0xc823('0xe')]['noop'](_0xc823('0x1aa'));};AGIVertices[_0xc823('0x14')][_0xc823('0x1ab')]=function(_0x3fa684){logger['info'](util[_0xc823('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3fa684[_0xc823('0x39')]));if(!this[_0xc823('0x84')](_0x3fa684[_0xc823('0xd9')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x3fa684,'no\x20variable\x20selected');}var _0x3723f5=this[_0xc823('0x10')]['sync'](this,_0x3fa684[_0xc823('0xd9')]);if(!_0x3723f5){return this[_0xc823('0xe')][_0xc823('0x33')](_0x3fa684,'no\x20variable\x20found');}return this['channel'][_0xc823('0xdd')](_0x3723f5,_0x3fa684[_0xc823('0x1ac')]);};AGIVertices[_0xc823('0x14')][_0xc823('0x1ad')]=function(_0x454bf6){logger['info'](util[_0xc823('0x2b')](_0xc823('0x1ae'),_0x454bf6[_0xc823('0x39')]));this[_0xc823('0xe')][_0xc823('0xa6')]('START\x20CALLY\x20SQUARE');if(_0x454bf6[_0xc823('0xb7')]===_0xc823('0x1af')){this['channel']['noop']('Answer');return this['channel']['answer']();}return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0x1b0'));};AGIVertices[_0xc823('0x14')][_0xc823('0x1b1')]=function(_0x295e84){logger[_0xc823('0x2f')](util['format'](_0xc823('0x1b2'),_0x295e84[_0xc823('0x39')]));if(!this['isConfigured'](_0x295e84[_0xc823('0x1b3')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x295e84,_0xc823('0x1b4'));}var _0x20a987=this[_0xc823('0x1b5')][_0xc823('0x6e')](this,_0x295e84[_0xc823('0x1b3')]);if(!this['isConfigured'](_0x20a987)){return this[_0xc823('0xe')][_0xc823('0x33')](_0x295e84,util['format'](_0xc823('0x1b6'),_0x295e84[_0xc823('0x1b3')]));}if(_0x20a987===this[_0xc823('0xe')][_0xc823('0x3b')]){return this[_0xc823('0xe')][_0xc823('0x33')](_0x295e84,_0xc823('0x1b7'));}this[_0xc823('0x37')][_0xc823('0x6e')](this,_0x295e84,_0x20a987);var _0x129bc6=this[_0xc823('0xe')][_0xc823('0x55')](_0xc823('0x1b8'),util[_0xc823('0x2b')](_0xc823('0x1b9'),config['agi'][_0xc823('0x1ba')]||'127.0.0.1',_0x20a987,this[_0xc823('0xe')][_0xc823('0x3b')]));if(_0x129bc6[_0xc823('0xa8')]===-0x1){return _0x129bc6;}return this[_0xc823('0xe')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xc823('0x1b8'),_0x20a987));};AGIVertices[_0xc823('0x14')]['system']=function(_0x548ffd){logger[_0xc823('0x2f')](util['format'](_0xc823('0x1bb'),_0x548ffd['label']));var _0x2e3c44=this[_0xc823('0x54')][_0xc823('0x6e')](this,_0x548ffd[_0xc823('0xb5')]);this['createSquareDetailsReport']['sync'](this,_0x548ffd,_0x548ffd[_0xc823('0xb5')]);if(this[_0xc823('0x84')](_0x548ffd[_0xc823('0xd9')])){var _0xca1a22=this[_0xc823('0x10')]['sync'](this,_0x548ffd[_0xc823('0xd9')]);if(_0xca1a22){this[_0xc823('0xe')][_0xc823('0xdd')](_0xca1a22,_0x2e3c44);return this[_0xc823('0xe')]['noop'](util[_0xc823('0x2b')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x548ffd[_0xc823('0xb5')],_0xca1a22));}}return this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x1bc'),_0x548ffd[_0xc823('0xb5')]));};AGIVertices[_0xc823('0x14')][_0xc823('0x1bd')]=function(_0x23ca34){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x1be'),_0x23ca34[_0xc823('0x39')]));_0x23ca34[_0xc823('0x5b')]=_0x23ca34['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc823('0x84')](_0x23ca34['apiKey'])){return this['channel'][_0xc823('0xa6')](_0xc823('0x1bf'));}if(!this[_0xc823('0x84')](_0x23ca34[_0xc823('0x5b')])){return this['channel'][_0xc823('0xa6')](_0xc823('0xa7'));}this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x23ca34[_0xc823('0x5b')]));var _0x109a4c=this[_0xc823('0x58')][_0xc823('0x6e')](this,_0x23ca34);if(_0x109a4c){this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x1c0'),_0x109a4c));var _0x225fd5=this[_0xc823('0xe')][_0xc823('0x105')](_0x109a4c);try{fs[_0xc823('0x127')](_0x109a4c+'.wav');}catch(_0xd12c14){logger['error'](_0xd12c14);}return _0x225fd5;}return this['channel']['error'](_0x23ca34,_0xc823('0x1c1'));};AGIVertices[_0xc823('0x14')][_0xc823('0x1c2')]=function(_0x1973fe){logger[_0xc823('0x2f')](util[_0xc823('0x2b')](_0xc823('0x1c3'),_0x1973fe['label']));_0x1973fe[_0xc823('0x5b')]=_0x1973fe[_0xc823('0x5b')][_0xc823('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc823('0x84')](_0x1973fe[_0xc823('0x5b')])){return this[_0xc823('0xe')][_0xc823('0xa6')](_0xc823('0xa7'));}this['channel'][_0xc823('0xa6')](util['format'](_0xc823('0x1c4'),_0x1973fe[_0xc823('0x5b')]));var _0x588d89=this[_0xc823('0x5f')][_0xc823('0x6e')](this,_0x1973fe);if(_0x588d89){this[_0xc823('0xe')]['noop'](util['format'](_0xc823('0x1c5'),_0x588d89));var _0x53b8b3=this[_0xc823('0xe')][_0xc823('0x105')](_0x588d89);try{fs[_0xc823('0x127')](_0x588d89+_0xc823('0x128'));}catch(_0x194fab){logger[_0xc823('0x33')](_0x194fab);}return _0x53b8b3;}return this[_0xc823('0xe')][_0xc823('0x33')](_0x1973fe,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xc823('0x14')][_0xc823('0x1c6')]=function(_0x5987ea){logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5987ea['label']));if(!this[_0xc823('0x84')](_0x5987ea[_0xc823('0x15b')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x5987ea,_0xc823('0x15c'));}logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc823('0xe')][_0xc823('0x3c')],_0x5987ea[_0xc823('0x15b')]));var _0x279934=this[_0xc823('0x1c7')][_0xc823('0x6e')](this,_0x5987ea['findBy']);if(_0x279934){logger[_0xc823('0x2f')](util['format'](_0xc823('0x15e'),this[_0xc823('0xe')]['callerid'],_0x5987ea[_0xc823('0x15b')]));this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc823('0xe')][_0xc823('0x3c')],_0x5987ea[_0xc823('0x15b')]));return{'code':0xc8,'result':_0xc823('0x15f')};}else{logger[_0xc823('0x2f')](util[_0xc823('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc823('0xe')]['callerid'],_0x5987ea[_0xc823('0x15b')]));this[_0xc823('0xe')][_0xc823('0xa6')](util[_0xc823('0x2b')](_0xc823('0x160'),this[_0xc823('0xe')][_0xc823('0x3c')],_0x5987ea['findBy']));return{'code':0xc8,'result':_0xc823('0x161')};}};AGIVertices[_0xc823('0x14')][_0xc823('0x1c8')]=function(_0x180e82){logger[_0xc823('0x2f')](util['format'](_0xc823('0x1c9'),_0x180e82['label']));var _0x63178d=this[_0xc823('0xe')][_0xc823('0x55')](_0xc823('0x1ca'),[_0x180e82[_0xc823('0x1cb')],_0x180e82[_0xc823('0x77')]]);if(_0x63178d['result']===-0x1){return _0x63178d;}return this['channel']['noop'](util[_0xc823('0x2b')](_0xc823('0xc3'),'VOICEMAIL',_0x180e82['mailbox']));};AGIVertices[_0xc823('0x14')]['vswitch']=function(_0x14ffdd){logger['info'](util['format'](_0xc823('0x1cc'),_0x14ffdd['label']));if(!this[_0xc823('0x84')](_0x14ffdd[_0xc823('0xd9')])){return this[_0xc823('0xe')][_0xc823('0x33')](_0x14ffdd,_0xc823('0x1cd'));}var _0x1e4959=this['getVariable'][_0xc823('0x6e')](this,_0x14ffdd[_0xc823('0xd9')]);if(!_0x1e4959){return this[_0xc823('0xe')][_0xc823('0x33')](_0x14ffdd,_0xc823('0xdb'));}var _0x2cf6cd=this[_0xc823('0xe')][_0xc823('0x10')](_0x1e4959);return{'code':0xc8,'result':_0x2cf6cd[_0xc823('0xa1')]?_0x2cf6cd[_0xc823('0xa1')]:'-'};};String[_0xc823('0x14')][_0xc823('0xa0')]=function(_0x112214,_0x351a5e){return this[_0xc823('0x9f')](_0x112214)[_0xc823('0x1ce')](_0x351a5e);};module[_0xc823('0x1cf')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 369f701..83ec5c8 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 _0xb8b0=['[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','message','acw','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','prototype','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally'];(function(_0x41829c,_0x1b1b7d){var _0x2702af=function(_0x142fb5){while(--_0x142fb5){_0x41829c['push'](_0x41829c['shift']());}};_0x2702af(++_0x1b1b7d);}(_0xb8b0,0x170));var _0x0b8b=function(_0x5d1521,_0x144356){_0x5d1521=_0x5d1521-0x0;var _0x492e0c=_0xb8b0[_0x5d1521];return _0x492e0c;};'use strict';var util=require(_0x0b8b('0x0'));var _=require(_0x0b8b('0x1'));var moment=require(_0x0b8b('0x2'));var ami=require(_0x0b8b('0x3'));var logger=require(_0x0b8b('0x4'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x505640){this[_0x0b8b('0x5')]=_0x505640[_0x0b8b('0x5')];this[_0x0b8b('0x6')]=_0x505640['agents'];this[_0x0b8b('0x7')]=_0x505640[_0x0b8b('0x7')];this[_0x0b8b('0x8')]={};ami['on'](_0x0b8b('0x9'),this[_0x0b8b('0xa')][_0x0b8b('0xb')](this));ami['on']('hanguprequest',this[_0x0b8b('0xc')]['bind'](this));ami['on'](_0x0b8b('0xd'),this[_0x0b8b('0xe')][_0x0b8b('0xb')](this));ami['on'](_0x0b8b('0xf'),this['syncAgentRingNoAnswer'][_0x0b8b('0xb')](this));ami['on']('attendedtransfer',this[_0x0b8b('0x10')][_0x0b8b('0xb')](this));ami['on'](_0x0b8b('0x11'),this[_0x0b8b('0x12')][_0x0b8b('0xb')](this));ami['on'](_0x0b8b('0x13'),this[_0x0b8b('0x14')]['bind'](this));}function getDiff(_0xb9cfd8){var _0x4e0e1c=moment()['milliseconds'](0x0);var _0x4bec22=moment(_0xb9cfd8)['milliseconds'](0x0);return _0x4e0e1c[_0x0b8b('0x15')](_0x4bec22,'seconds');}Acw[_0x0b8b('0x16')][_0x0b8b('0x17')]=function(_0x162822){try{var _0x4a1046=this;var _0x3c98ef=this[_0x0b8b('0x8')][_0x162822][_0x0b8b('0x18')];var _0x2315be=this[_0x0b8b('0x8')][_0x162822][_0x0b8b('0x19')];var _0x4d1d2=this[_0x0b8b('0x5')][_0x2315be];var _0x563613=![];var _0x31cbe8=_0x0b8b('0x1a');if(_0x4d1d2['mandatoryDisposition']){if(_0x4d1d2[_0x0b8b('0x1b')][_0x0b8b('0x1c')]){_0x563613=!![];_0x31cbe8=_0x4d1d2['mandatoryDispositionPause']['name'];}}ami[_0x0b8b('0x1d')]({'action':_0x0b8b('0x1e'),'interface':_0x3c98ef,'paused':!![],'reason':_0x31cbe8})[_0x0b8b('0x1f')](function(_0x8fb06d){if(_0x4a1046[_0x0b8b('0x6')][_0x3c98ef]){return RpcUser[_0x0b8b('0x20')](_0x4a1046[_0x0b8b('0x6')][_0x3c98ef]['id'])[_0x0b8b('0x1f')](function(_0x5b8113){if(_0x5b8113&&!_0x5b8113[_0x0b8b('0x21')]){logger[_0x0b8b('0x22')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x162822,_0x3c98ef,_0x2315be);var _0x4a4f63=_0x4a1046[_0x0b8b('0x8')][_0x162822][_0x0b8b('0x23')]&&_0x4a1046[_0x0b8b('0x8')][_0x162822][_0x0b8b('0x24')]?_0x4a1046[_0x0b8b('0x8')][_0x162822][_0x0b8b('0x24')]:_0x162822;return RpcUser[_0x0b8b('0x25')](_0x4a1046[_0x0b8b('0x6')][_0x3c98ef],_0x31cbe8,_0x4a4f63)['then'](function(_0x4d5217){if(!_0x563613){_0x4a1046[_0x0b8b('0x7')][_0x3c98ef]={};logger[_0x0b8b('0x22')](_0x0b8b('0x26'),_0x162822,_0x4a1046['voiceQueues'][_0x2315be][_0x0b8b('0x27')],_0x3c98ef,_0x2315be);_0x4a1046['timers'][_0x3c98ef][_0x0b8b('0x28')]=setTimeout(_0x4a1046[_0x0b8b('0x29')][_0x0b8b('0xb')](_0x4a1046,_0x3c98ef),_0x4a1046[_0x0b8b('0x5')][_0x2315be][_0x0b8b('0x27')]*0x3e8);_0x4a1046[_0x0b8b('0x7')][_0x3c98ef][_0x0b8b('0x2a')]=moment()['format'](_0x0b8b('0x2b'));_0x4a1046[_0x0b8b('0x7')][_0x3c98ef][_0x0b8b('0x2c')]=_0x162822;_0x4a1046['timers'][_0x3c98ef]['queue']=_0x2315be;_0x4a1046[_0x0b8b('0x7')][_0x3c98ef][_0x0b8b('0x2d')]=function(){var _0x26c596=getDiff(_0x4a1046[_0x0b8b('0x7')][_0x3c98ef]['lastPauseAt']);clearTimeout(_0x4a1046[_0x0b8b('0x7')][_0x3c98ef][_0x0b8b('0x28')]);_0x4a1046[_0x0b8b('0x7')][_0x3c98ef][_0x0b8b('0x28')]=![];RpcVoiceAgentReport[_0x0b8b('0x2e')]({'acwtime':_0x26c596},_0x4a1046[_0x0b8b('0x7')][_0x3c98ef][_0x0b8b('0x2c')],_0x3c98ef)['then'](function(_0x54f0d6){logger[_0x0b8b('0x22')](_0x0b8b('0x2f'),_0x162822,_0x26c596,_0x54f0d6);})[_0x0b8b('0x30')](function(_0x59a304){logger[_0x0b8b('0x31')](_0x0b8b('0x32'),_0x162822,_0x59a304);});delete _0x4a1046[_0x0b8b('0x7')][_0x3c98ef];};}});}else{logger[_0x0b8b('0x22')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x162822,_0x3c98ef,_0x2315be);}});}})[_0x0b8b('0x30')](function(_0x6e4960){logger[_0x0b8b('0x31')](_0x0b8b('0x26'),_0x162822,_0x4a1046[_0x0b8b('0x5')][_0x2315be][_0x0b8b('0x27')],_0x3c98ef,_0x2315be);})[_0x0b8b('0x33')](function(){delete _0x4a1046['channels'][_0x162822];});}catch(_0x4669e6){logger[_0x0b8b('0x31')](_0x0b8b('0x34'),_0x4669e6['message']);}};Acw[_0x0b8b('0x16')][_0x0b8b('0x29')]=function(_0x290655){try{var _0x310564=this;if(_0x310564[_0x0b8b('0x7')][_0x290655]){_0x310564[_0x0b8b('0x7')][_0x290655][_0x0b8b('0x28')]=![];var _0x4ff92b=_0x310564[_0x0b8b('0x7')][_0x290655][_0x0b8b('0x2c')];var _0x22e9c8=_0x310564[_0x0b8b('0x7')][_0x290655][_0x0b8b('0x19')];var _0x233ae7=_0x310564[_0x0b8b('0x5')][_0x22e9c8][_0x0b8b('0x27')];logger['info'](_0x0b8b('0x35'),_0x4ff92b,_0x290655);RpcUser[_0x0b8b('0x36')](this[_0x0b8b('0x6')][_0x290655]);RpcVoiceAgentReport[_0x0b8b('0x2e')]({'acwtime':_0x233ae7,'agentacw':!![]},_0x4ff92b,_0x290655)['then'](function(_0x5efaac){logger[_0x0b8b('0x22')](_0x0b8b('0x2f'),_0x4ff92b,_0x233ae7,_0x5efaac);})[_0x0b8b('0x30')](function(_0x301a06){logger[_0x0b8b('0x31')](_0x0b8b('0x32'),_0x4ff92b,_0x301a06);});}else{logger[_0x0b8b('0x31')](_0x0b8b('0x37'),_0x290655);if(_0x310564[_0x0b8b('0x7')]){logger[_0x0b8b('0x22')](_0x0b8b('0x38'),JSON['stringify'](_0x310564['timers']));}}}catch(_0x2c93b1){logger[_0x0b8b('0x31')]('[ACW][STOP]\x20%s',_0x2c93b1[_0x0b8b('0x39')]);}};Acw[_0x0b8b('0x16')][_0x0b8b('0xa')]=function(_0x59e953){try{if(this[_0x0b8b('0x5')][_0x59e953['queue']]&&(this[_0x0b8b('0x5')][_0x59e953[_0x0b8b('0x19')]][_0x0b8b('0x3a')]||this[_0x0b8b('0x5')][_0x59e953[_0x0b8b('0x19')]][_0x0b8b('0x3b')])){if(this['agents'][_0x59e953[_0x0b8b('0x18')]]){this[_0x0b8b('0x8')][_0x59e953[_0x0b8b('0x2c')]]={'queue':_0x59e953[_0x0b8b('0x19')],'interface':_0x59e953[_0x0b8b('0x18')],'destlinkedid':_0x59e953[_0x0b8b('0x24')]};}}}catch(_0x29121f){logger[_0x0b8b('0x31')](_0x0b8b('0x3c'),_0x29121f['message']);}};Acw[_0x0b8b('0x16')][_0x0b8b('0x14')]=function(_0x1d71be){try{if(this[_0x0b8b('0x5')][_0x1d71be[_0x0b8b('0x19')]]&&(this[_0x0b8b('0x5')][_0x1d71be[_0x0b8b('0x19')]][_0x0b8b('0x3a')]||this[_0x0b8b('0x5')][_0x1d71be['queue']][_0x0b8b('0x3b')])){if(this[_0x0b8b('0x6')][_0x1d71be[_0x0b8b('0x18')]]){this[_0x0b8b('0x8')][_0x1d71be[_0x0b8b('0x2c')]]={'queue':_0x1d71be['queue'],'interface':_0x1d71be[_0x0b8b('0x18')]};}}}catch(_0x968fdb){logger[_0x0b8b('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x968fdb[_0x0b8b('0x39')]);}};Acw[_0x0b8b('0x16')][_0x0b8b('0xc')]=function(_0x507c15){try{if(this['channels'][_0x507c15[_0x0b8b('0x2c')]]&&_[_0x0b8b('0x3d')](this['channels'][_0x507c15[_0x0b8b('0x2c')]][_0x0b8b('0x23')])){logger[_0x0b8b('0x22')](_0x0b8b('0x3e'),_0x507c15[_0x0b8b('0x2c')]);this[_0x0b8b('0x17')](_0x507c15['uniqueid']);}else if(this[_0x0b8b('0x8')][_0x507c15['linkedid']]&&_[_0x0b8b('0x3d')](this['channels'][_0x507c15['linkedid']][_0x0b8b('0x23')])){logger[_0x0b8b('0x22')]('[%s][HANGUP:LINKEDID]',_0x507c15[_0x0b8b('0x3f')]);this[_0x0b8b('0x17')](_0x507c15[_0x0b8b('0x3f')]);}}catch(_0x18f3fd){logger[_0x0b8b('0x31')](_0x0b8b('0x40'),_0x18f3fd[_0x0b8b('0x39')]);}};Acw['prototype'][_0x0b8b('0xe')]=function(_0x484f75){try{if(this[_0x0b8b('0x8')][_0x484f75[_0x0b8b('0x2c')]]&&this[_0x0b8b('0x8')][_0x484f75[_0x0b8b('0x2c')]]['attended']){logger[_0x0b8b('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x484f75['uniqueid']);this['startAcw'](_0x484f75[_0x0b8b('0x2c')]);}else if(this[_0x0b8b('0x8')][_0x484f75[_0x0b8b('0x3f')]]&&this[_0x0b8b('0x8')][_0x484f75['linkedid']]['attended']){logger[_0x0b8b('0x22')](_0x0b8b('0x41'),_0x484f75[_0x0b8b('0x3f')]);this[_0x0b8b('0x17')](_0x484f75[_0x0b8b('0x3f')]);}}catch(_0x3b36c7){logger['error'](_0x0b8b('0x42'),_0x3b36c7[_0x0b8b('0x39')]);}};Acw[_0x0b8b('0x16')][_0x0b8b('0x10')]=function(_0x47cb31){try{if(!_[_0x0b8b('0x43')](this[_0x0b8b('0x8')][_0x47cb31[_0x0b8b('0x44')]])){this[_0x0b8b('0x17')](_0x47cb31[_0x0b8b('0x44')]);if(this[_0x0b8b('0x8')][_0x47cb31[_0x0b8b('0x45')]]){this[_0x0b8b('0x8')][_0x47cb31[_0x0b8b('0x45')]][_0x0b8b('0x23')]=!![];this[_0x0b8b('0x8')][_0x47cb31['transfertargetuniqueid']]=this['channels'][_0x47cb31[_0x0b8b('0x45')]];delete this[_0x0b8b('0x8')][_0x47cb31[_0x0b8b('0x45')]];}}else if(!_[_0x0b8b('0x43')](this[_0x0b8b('0x8')][_0x47cb31['transfertargetuniqueid']])){this[_0x0b8b('0x17')](_0x47cb31[_0x0b8b('0x46')]);if(this[_0x0b8b('0x8')][_0x47cb31[_0x0b8b('0x47')]]){this[_0x0b8b('0x8')][_0x47cb31[_0x0b8b('0x47')]][_0x0b8b('0x23')]=!![];this['channels'][_0x47cb31[_0x0b8b('0x44')]]=this[_0x0b8b('0x8')][_0x47cb31[_0x0b8b('0x47')]];delete this['channels'][_0x47cb31['origtransfereruniqueid']];}}}catch(_0x14cad9){logger['error'](_0x0b8b('0x48'),_0x14cad9[_0x0b8b('0x39')]);}};Acw[_0x0b8b('0x16')][_0x0b8b('0x12')]=function(_0x39bbf1){try{if(this[_0x0b8b('0x8')][_0x39bbf1[_0x0b8b('0x49')]]){logger[_0x0b8b('0x22')](_0x0b8b('0x4a'),JSON[_0x0b8b('0x4b')](_0x39bbf1[_0x0b8b('0x49')]));this[_0x0b8b('0x17')](_0x39bbf1[_0x0b8b('0x49')]);}else if(this[_0x0b8b('0x8')][_0x39bbf1['transfererlinkedid']]){logger[_0x0b8b('0x22')](_0x0b8b('0x4c'),JSON[_0x0b8b('0x4b')](_0x39bbf1[_0x0b8b('0x4d')]));this['startAcw'](_0x39bbf1[_0x0b8b('0x4d')]);}}catch(_0x389003){logger[_0x0b8b('0x31')](_0x0b8b('0x4e'),_0x389003[_0x0b8b('0x39')]);}};Acw['prototype'][_0x0b8b('0x4f')]=function(_0x5bd2ee){try{if(this[_0x0b8b('0x5')][_0x5bd2ee[_0x0b8b('0x19')]]&&this[_0x0b8b('0x5')][_0x5bd2ee[_0x0b8b('0x19')]][_0x0b8b('0x50')]==='all'){if(this[_0x0b8b('0x6')][_0x5bd2ee[_0x0b8b('0x18')]]){logger[_0x0b8b('0x22')](_0x0b8b('0x51'),_0x5bd2ee[_0x0b8b('0x2c')],_0x5bd2ee[_0x0b8b('0x18')],_0x5bd2ee[_0x0b8b('0x19')]);return RpcUser[_0x0b8b('0x25')](this[_0x0b8b('0x6')][_0x5bd2ee[_0x0b8b('0x18')]],_0x0b8b('0x52'),_0x5bd2ee[_0x0b8b('0x2c')]);}}}catch(_0x33d1a1){logger[_0x0b8b('0x31')](_0x0b8b('0x53'),_0x33d1a1['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x0f21=['Action','QueuePause','then','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name'];(function(_0x3d7811,_0x59daeb){var _0x927cfa=function(_0x5ce736){while(--_0x5ce736){_0x3d7811['push'](_0x3d7811['shift']());}};_0x927cfa(++_0x59daeb);}(_0x0f21,0x194));var _0x10f2=function(_0x4461fd,_0x59d4a1){_0x4461fd=_0x4461fd-0x0;var _0x391048=_0x0f21[_0x4461fd];return _0x391048;};'use strict';var util=require(_0x10f2('0x0'));var _=require(_0x10f2('0x1'));var moment=require(_0x10f2('0x2'));var ami=require('../ami');var logger=require(_0x10f2('0x3'))(_0x10f2('0x4'));var RpcUser=require(_0x10f2('0x5'));var RpcVoiceAgentReport=require(_0x10f2('0x6'));function Acw(_0x325f23){this[_0x10f2('0x7')]=_0x325f23['voiceQueues'];this[_0x10f2('0x8')]=_0x325f23['agents'];this[_0x10f2('0x9')]=_0x325f23[_0x10f2('0x9')];this[_0x10f2('0xa')]={};ami['on'](_0x10f2('0xb'),this[_0x10f2('0xc')]['bind'](this));ami['on'](_0x10f2('0xd'),this[_0x10f2('0xe')][_0x10f2('0xf')](this));ami['on'](_0x10f2('0x10'),this['syncHangup'][_0x10f2('0xf')](this));ami['on'](_0x10f2('0x11'),this[_0x10f2('0x12')][_0x10f2('0xf')](this));ami['on'](_0x10f2('0x13'),this[_0x10f2('0x14')]['bind'](this));ami['on'](_0x10f2('0x15'),this[_0x10f2('0x16')][_0x10f2('0xf')](this));ami['on'](_0x10f2('0x17'),this[_0x10f2('0x18')][_0x10f2('0xf')](this));}function getDiff(_0x148b94){var _0x2ebdb3=moment()[_0x10f2('0x19')](0x0);var _0x305733=moment(_0x148b94)[_0x10f2('0x19')](0x0);return _0x2ebdb3[_0x10f2('0x1a')](_0x305733,_0x10f2('0x1b'));}Acw[_0x10f2('0x1c')][_0x10f2('0x1d')]=function(_0x5585fa){try{var _0x33ebb1=this;var _0x3a2e6d=this[_0x10f2('0xa')][_0x5585fa][_0x10f2('0x1e')];var _0x31e4c4=this[_0x10f2('0xa')][_0x5585fa][_0x10f2('0x1f')];var _0x31a421=this[_0x10f2('0x7')][_0x31e4c4];var _0x1c1384=![];var _0x7a3cdd=_0x10f2('0x20');if(_0x31a421[_0x10f2('0x21')]){if(_0x31a421[_0x10f2('0x22')]['name']){_0x1c1384=!![];_0x7a3cdd=_0x31a421[_0x10f2('0x22')][_0x10f2('0x23')];}}ami[_0x10f2('0x24')]({'action':_0x10f2('0x25'),'interface':_0x3a2e6d,'paused':!![],'reason':_0x7a3cdd})[_0x10f2('0x26')](function(_0x18fafa){if(_0x33ebb1[_0x10f2('0x8')][_0x3a2e6d]){return RpcUser['getAgent'](_0x33ebb1[_0x10f2('0x8')][_0x3a2e6d]['id'])[_0x10f2('0x26')](function(_0x1159ce){if(_0x1159ce&&!_0x1159ce['voicePause']){logger['info'](_0x10f2('0x27'),_0x5585fa,_0x3a2e6d,_0x31e4c4);var _0x113725=_0x33ebb1[_0x10f2('0xa')][_0x5585fa][_0x10f2('0x28')]&&_0x33ebb1[_0x10f2('0xa')][_0x5585fa][_0x10f2('0x29')]?_0x33ebb1[_0x10f2('0xa')][_0x5585fa][_0x10f2('0x29')]:_0x5585fa;return RpcUser[_0x10f2('0x2a')](_0x33ebb1[_0x10f2('0x8')][_0x3a2e6d],_0x7a3cdd,_0x113725)[_0x10f2('0x26')](function(_0x216325){if(!_0x1c1384){_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d]={};logger[_0x10f2('0x2b')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5585fa,_0x33ebb1[_0x10f2('0x7')][_0x31e4c4]['acwTimeout'],_0x3a2e6d,_0x31e4c4);_0x33ebb1['timers'][_0x3a2e6d][_0x10f2('0x2c')]=setTimeout(_0x33ebb1[_0x10f2('0x2d')][_0x10f2('0xf')](_0x33ebb1,_0x3a2e6d),_0x33ebb1[_0x10f2('0x7')][_0x31e4c4]['acwTimeout']*0x3e8);_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d]['lastPauseAt']=moment()[_0x10f2('0x2e')](_0x10f2('0x2f'));_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d]['uniqueid']=_0x5585fa;_0x33ebb1['timers'][_0x3a2e6d][_0x10f2('0x1f')]=_0x31e4c4;_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d][_0x10f2('0x30')]=function(){var _0x416e23=getDiff(_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d]['lastPauseAt']);clearTimeout(_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d][_0x10f2('0x2c')]);_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d][_0x10f2('0x2c')]=![];RpcVoiceAgentReport[_0x10f2('0x31')]({'acwtime':_0x416e23},_0x33ebb1[_0x10f2('0x9')][_0x3a2e6d][_0x10f2('0x32')],_0x3a2e6d)['then'](function(_0x2b0be4){logger[_0x10f2('0x2b')](_0x10f2('0x33'),_0x5585fa,_0x416e23,_0x2b0be4);})['catch'](function(_0x20aee2){logger[_0x10f2('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x5585fa,_0x20aee2);});delete _0x33ebb1['timers'][_0x3a2e6d];};}});}else{logger[_0x10f2('0x2b')](_0x10f2('0x35'),_0x5585fa,_0x3a2e6d,_0x31e4c4);}});}})['catch'](function(_0x1c05c7){logger[_0x10f2('0x34')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5585fa,_0x33ebb1[_0x10f2('0x7')][_0x31e4c4][_0x10f2('0x36')],_0x3a2e6d,_0x31e4c4);})[_0x10f2('0x37')](function(){delete _0x33ebb1[_0x10f2('0xa')][_0x5585fa];});}catch(_0x3a9470){logger[_0x10f2('0x34')](_0x10f2('0x38'),_0x3a9470[_0x10f2('0x39')]);}};Acw['prototype']['stopAcw']=function(_0x33f79e){try{var _0x3a548e=this;if(_0x3a548e[_0x10f2('0x9')][_0x33f79e]){_0x3a548e[_0x10f2('0x9')][_0x33f79e][_0x10f2('0x2c')]=![];var _0x1534ec=_0x3a548e['timers'][_0x33f79e]['uniqueid'];var _0x41d173=_0x3a548e[_0x10f2('0x9')][_0x33f79e][_0x10f2('0x1f')];var _0x8b4347=_0x3a548e[_0x10f2('0x7')][_0x41d173][_0x10f2('0x36')];logger[_0x10f2('0x2b')](_0x10f2('0x3a'),_0x1534ec,_0x33f79e);RpcUser[_0x10f2('0x3b')](this['agents'][_0x33f79e]);RpcVoiceAgentReport['update']({'acwtime':_0x8b4347,'agentacw':!![]},_0x1534ec,_0x33f79e)[_0x10f2('0x26')](function(_0x2b0826){logger[_0x10f2('0x2b')](_0x10f2('0x33'),_0x1534ec,_0x8b4347,_0x2b0826);})[_0x10f2('0x3c')](function(_0x133a80){logger['error'](_0x10f2('0x3d'),_0x1534ec,_0x133a80);});}else{logger[_0x10f2('0x34')](_0x10f2('0x3e'),_0x33f79e);if(_0x3a548e[_0x10f2('0x9')]){logger['info']('[ACW][TIMERS]',JSON[_0x10f2('0x3f')](_0x3a548e[_0x10f2('0x9')]));}}}catch(_0x531af7){logger['error'](_0x10f2('0x40'),_0x531af7[_0x10f2('0x39')]);}};Acw[_0x10f2('0x1c')][_0x10f2('0xc')]=function(_0x2f23c7){try{if(this['voiceQueues'][_0x2f23c7[_0x10f2('0x1f')]]&&(this['voiceQueues'][_0x2f23c7['queue']][_0x10f2('0x4')]||this[_0x10f2('0x7')][_0x2f23c7[_0x10f2('0x1f')]][_0x10f2('0x21')])){if(this[_0x10f2('0x8')][_0x2f23c7[_0x10f2('0x1e')]]){this[_0x10f2('0xa')][_0x2f23c7[_0x10f2('0x32')]]={'queue':_0x2f23c7[_0x10f2('0x1f')],'interface':_0x2f23c7[_0x10f2('0x1e')],'destlinkedid':_0x2f23c7[_0x10f2('0x29')]};}}}catch(_0x5b31fc){logger[_0x10f2('0x34')](_0x10f2('0x41'),_0x5b31fc['message']);}};Acw[_0x10f2('0x1c')]['syncAgentConnectPreview']=function(_0x1641d0){try{if(this[_0x10f2('0x7')][_0x1641d0[_0x10f2('0x1f')]]&&(this[_0x10f2('0x7')][_0x1641d0[_0x10f2('0x1f')]][_0x10f2('0x4')]||this[_0x10f2('0x7')][_0x1641d0[_0x10f2('0x1f')]][_0x10f2('0x21')])){if(this['agents'][_0x1641d0[_0x10f2('0x1e')]]){this[_0x10f2('0xa')][_0x1641d0['uniqueid']]={'queue':_0x1641d0['queue'],'interface':_0x1641d0[_0x10f2('0x1e')]};}}}catch(_0xb49cce){logger['error'](_0x10f2('0x42'),_0xb49cce[_0x10f2('0x39')]);}};Acw['prototype'][_0x10f2('0xe')]=function(_0x16d16e){try{if(this[_0x10f2('0xa')][_0x16d16e[_0x10f2('0x32')]]&&_[_0x10f2('0x43')](this[_0x10f2('0xa')][_0x16d16e[_0x10f2('0x32')]][_0x10f2('0x28')])){logger[_0x10f2('0x2b')](_0x10f2('0x44'),_0x16d16e[_0x10f2('0x32')]);this[_0x10f2('0x1d')](_0x16d16e[_0x10f2('0x32')]);}else if(this[_0x10f2('0xa')][_0x16d16e[_0x10f2('0x45')]]&&_[_0x10f2('0x43')](this[_0x10f2('0xa')][_0x16d16e['linkedid']][_0x10f2('0x28')])){logger['info'](_0x10f2('0x46'),_0x16d16e[_0x10f2('0x45')]);this[_0x10f2('0x1d')](_0x16d16e[_0x10f2('0x45')]);}}catch(_0x22c29b){logger[_0x10f2('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x22c29b['message']);}};Acw[_0x10f2('0x1c')][_0x10f2('0x47')]=function(_0x42dc63){try{if(this[_0x10f2('0xa')][_0x42dc63[_0x10f2('0x32')]]&&this[_0x10f2('0xa')][_0x42dc63[_0x10f2('0x32')]][_0x10f2('0x28')]){logger[_0x10f2('0x2b')](_0x10f2('0x48'),_0x42dc63[_0x10f2('0x32')]);this['startAcw'](_0x42dc63[_0x10f2('0x32')]);}else if(this[_0x10f2('0xa')][_0x42dc63['linkedid']]&&this[_0x10f2('0xa')][_0x42dc63['linkedid']][_0x10f2('0x28')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x42dc63[_0x10f2('0x45')]);this[_0x10f2('0x1d')](_0x42dc63[_0x10f2('0x45')]);}}catch(_0x3c2cdf){logger[_0x10f2('0x34')](_0x10f2('0x49'),_0x3c2cdf[_0x10f2('0x39')]);}};Acw[_0x10f2('0x1c')][_0x10f2('0x14')]=function(_0x9c25c8){try{if(!_[_0x10f2('0x4a')](this[_0x10f2('0xa')][_0x9c25c8['transfereeuniqueid']])){this[_0x10f2('0x1d')](_0x9c25c8[_0x10f2('0x4b')]);if(this[_0x10f2('0xa')][_0x9c25c8[_0x10f2('0x4c')]]){this[_0x10f2('0xa')][_0x9c25c8[_0x10f2('0x4c')]][_0x10f2('0x28')]=!![];this[_0x10f2('0xa')][_0x9c25c8[_0x10f2('0x4d')]]=this[_0x10f2('0xa')][_0x9c25c8[_0x10f2('0x4c')]];delete this[_0x10f2('0xa')][_0x9c25c8[_0x10f2('0x4c')]];}}else if(!_[_0x10f2('0x4a')](this['channels'][_0x9c25c8[_0x10f2('0x4d')]])){this[_0x10f2('0x1d')](_0x9c25c8[_0x10f2('0x4d')]);if(this['channels'][_0x9c25c8[_0x10f2('0x4e')]]){this[_0x10f2('0xa')][_0x9c25c8['origtransfereruniqueid']][_0x10f2('0x28')]=!![];this['channels'][_0x9c25c8[_0x10f2('0x4b')]]=this['channels'][_0x9c25c8['origtransfereruniqueid']];delete this[_0x10f2('0xa')][_0x9c25c8['origtransfereruniqueid']];}}}catch(_0x2bd47b){logger[_0x10f2('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x2bd47b[_0x10f2('0x39')]);}};Acw[_0x10f2('0x1c')]['syncBlindTransfer']=function(_0x2e817e){try{if(this['channels'][_0x2e817e[_0x10f2('0x4f')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x2e817e[_0x10f2('0x4f')]));this[_0x10f2('0x1d')](_0x2e817e[_0x10f2('0x4f')]);}else if(this[_0x10f2('0xa')][_0x2e817e['transfererlinkedid']]){logger[_0x10f2('0x2b')](_0x10f2('0x50'),JSON[_0x10f2('0x3f')](_0x2e817e['transfererlinkedid']));this[_0x10f2('0x1d')](_0x2e817e[_0x10f2('0x51')]);}}catch(_0x10fdea){logger[_0x10f2('0x34')](_0x10f2('0x52'),_0x10fdea['message']);}};Acw[_0x10f2('0x1c')][_0x10f2('0x12')]=function(_0x453dbc){try{if(this[_0x10f2('0x7')][_0x453dbc[_0x10f2('0x1f')]]&&this[_0x10f2('0x7')][_0x453dbc[_0x10f2('0x1f')]][_0x10f2('0x53')]==='all'){if(this[_0x10f2('0x8')][_0x453dbc['interface']]){logger['info'](_0x10f2('0x54'),_0x453dbc['uniqueid'],_0x453dbc[_0x10f2('0x1e')],_0x453dbc[_0x10f2('0x1f')]);return RpcUser[_0x10f2('0x2a')](this[_0x10f2('0x8')][_0x453dbc[_0x10f2('0x1e')]],_0x10f2('0x55'),_0x453dbc[_0x10f2('0x32')]);}}}catch(_0x12101d){logger[_0x10f2('0x34')](_0x10f2('0x56'),_0x12101d[_0x10f2('0x39')]);}};module[_0x10f2('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 38d793a..ac5b8ee 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 _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x13a3b5,_0x2c6fb5){var _0x50ecab=function(_0x95babb){while(--_0x95babb){_0x13a3b5['push'](_0x13a3b5['shift']());}};_0x50ecab(++_0x2c6fb5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb7e7[_0x138adb];return _0x1b27f2;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x33dea8,_0xa59f51){var _0x1f4ab0=function(_0x4ec920){while(--_0x4ec920){_0x33dea8['push'](_0x33dea8['shift']());}};_0x1f4ab0(++_0xa59f51);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8171a3f..a5112be 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0xe706,0xa3));var _0x6e70=function(_0x11fcba,_0x46ac13){_0x11fcba=_0x11fcba-0x0;var _0x2c792a=_0xe706[_0x11fcba];return _0x2c792a;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x34b6aa,_0x5ddd29){var _0x3ead29=function(_0x53979c){while(--_0x53979c){_0x34b6aa['push'](_0x34b6aa['shift']());}};_0x3ead29(++_0x5ddd29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 9fe2eb5..0974766 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 _0x47da=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','lodash','moment','string','isNil','voiceQueue','uniqueid','name','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5d8957,_0x3e2e35){var _0x5a8a5b=function(_0x25ef27){while(--_0x25ef27){_0x5d8957['push'](_0x5d8957['shift']());}};_0x5a8a5b(++_0x3e2e35);}(_0x47da,0x119));var _0xa47d=function(_0x249ecb,_0x170d5a){_0x249ecb=_0x249ecb-0x0;var _0x5338ff=_0x47da[_0x249ecb];return _0x5338ff;};'use strict';var util=require('util');var _=require(_0xa47d('0x0'));var moment=require(_0xa47d('0x1'));function checkNameSurname(_0x48237d,_0x89081d,_0x188dac){var _0x34dcd4='';if(!_['isNil'](_0x89081d)&&_0xa47d('0x2')===typeof _0x89081d){_0x34dcd4+=_0x89081d;}if(!_[_0xa47d('0x3')](_0x188dac)&&_0xa47d('0x2')===typeof _0x188dac){_0x34dcd4+='\x20'+_0x188dac;}if(_0x34dcd4!==''){return _0x34dcd4;}return _0x48237d;}function Action(_0x14305c,_0x3e9871,_0x24dd26){this[_0xa47d('0x4')]=_0x14305c;this[_0xa47d('0x5')]=_0x24dd26||undefined;this[_0xa47d('0x6')]=checkNameSurname(_0x3e9871[_0xa47d('0x7')]['phone'],_0x3e9871[_0xa47d('0x7')][_0xa47d('0x8')],_0x3e9871[_0xa47d('0x7')][_0xa47d('0x9')]);this[_0xa47d('0xa')]=_0x3e9871['phone'];this[_0xa47d('0xb')]=_0x14305c[_0xa47d('0x6')];this['active']=_0x3e9871[_0xa47d('0xc')]||![];this[_0xa47d('0xd')]=_0x14305c[_0xa47d('0xd')];this[_0xa47d('0xe')]=_0x14305c[_0xa47d('0xe')]||0x3;this['scheduledat']=_0x3e9871[_0xa47d('0xf')];this[_0xa47d('0x10')]=_0x3e9871['countbusyretry'];this['countcongestionretry']=_0x3e9871[_0xa47d('0x11')];this[_0xa47d('0x12')]=_0x3e9871['countnoanswerretry'];this[_0xa47d('0x13')]=_0x3e9871['countnosuchnumberretry'];this[_0xa47d('0x14')]=_0x3e9871[_0xa47d('0x14')];this['countabandonedretry']=_0x3e9871[_0xa47d('0x15')];this[_0xa47d('0x16')]=_0x3e9871[_0xa47d('0x16')];this[_0xa47d('0x17')]=_0x3e9871[_0xa47d('0x17')];this[_0xa47d('0x18')]=_0x3e9871[_0xa47d('0x18')];this[_0xa47d('0x19')]=_0x3e9871[_0xa47d('0x19')];this[_0xa47d('0x1a')]=_0x3e9871[_0xa47d('0x1a')];this[_0xa47d('0x1b')]=_0x3e9871[_0xa47d('0x1b')];this['CampaignId']=_0x3e9871[_0xa47d('0x1c')];this[_0xa47d('0x1d')]=_0x3e9871['id'];this[_0xa47d('0x1e')]=_0x3e9871[_0xa47d('0x7')][_0xa47d('0x8')]||'';this[_0xa47d('0x1f')]=moment()[_0xa47d('0x20')](_0xa47d('0x21'));this[_0xa47d('0x22')]=_0x3e9871['callback'];this[_0xa47d('0x23')]=_0x3e9871[_0xa47d('0x23')];this[_0xa47d('0x24')]=_0x3e9871[_0xa47d('0x24')];this[_0xa47d('0x25')]=_0x3e9871[_0xa47d('0x25')];this[_0xa47d('0x26')]='';this[_0xa47d('0x27')]='';}Action[_0xa47d('0x28')][_0xa47d('0x29')]=function(){return util[_0xa47d('0x20')](_0xa47d('0x2a'),this['name'],this['voiceQueue']['dialCutDigit']>0x0?this[_0xa47d('0xa')]['substring'](this[_0xa47d('0x4')][_0xa47d('0x2b')]):this[_0xa47d('0xa')]);};Action[_0xa47d('0x28')][_0xa47d('0x2c')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0x3391=['callbackat','recallme','originatecalleridnum','prototype','getCaller','dialCutDigit','exports','lodash','moment','isNil','string','voiceQueue','name','Contact','firstName','number','phone','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','callback','callbackuniqueid'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x3391,0x137));var _0x1339=function(_0x55b116,_0x2ad503){_0x55b116=_0x55b116-0x0;var _0x367621=_0x3391[_0x55b116];return _0x367621;};'use strict';var util=require('util');var _=require(_0x1339('0x0'));var moment=require(_0x1339('0x1'));function checkNameSurname(_0xd0fcd,_0x2b3378,_0x123c11){var _0x3589dd='';if(!_[_0x1339('0x2')](_0x2b3378)&&_0x1339('0x3')===typeof _0x2b3378){_0x3589dd+=_0x2b3378;}if(!_['isNil'](_0x123c11)&&_0x1339('0x3')===typeof _0x123c11){_0x3589dd+='\x20'+_0x123c11;}if(_0x3589dd!==''){return _0x3589dd;}return _0xd0fcd;}function Action(_0x34cc39,_0xa8a497,_0x16ec9f){this[_0x1339('0x4')]=_0x34cc39;this['uniqueid']=_0x16ec9f||undefined;this[_0x1339('0x5')]=checkNameSurname(_0xa8a497[_0x1339('0x6')]['phone'],_0xa8a497[_0x1339('0x6')][_0x1339('0x7')],_0xa8a497['Contact']['lastName']);this[_0x1339('0x8')]=_0xa8a497[_0x1339('0x9')];this['queue']=_0x34cc39[_0x1339('0x5')];this[_0x1339('0xa')]=_0xa8a497[_0x1339('0xa')]||![];this[_0x1339('0xb')]=_0x34cc39[_0x1339('0xb')];this['dialQueueTimeout']=_0x34cc39[_0x1339('0xc')]||0x3;this['scheduledat']=_0xa8a497['scheduledat'];this[_0x1339('0xd')]=_0xa8a497['countbusyretry'];this['countcongestionretry']=_0xa8a497[_0x1339('0xe')];this['countnoanswerretry']=_0xa8a497[_0x1339('0xf')];this[_0x1339('0x10')]=_0xa8a497[_0x1339('0x10')];this[_0x1339('0x11')]=_0xa8a497[_0x1339('0x11')];this[_0x1339('0x12')]=_0xa8a497[_0x1339('0x12')];this[_0x1339('0x13')]=_0xa8a497[_0x1339('0x13')];this[_0x1339('0x14')]=_0xa8a497[_0x1339('0x14')];this[_0x1339('0x15')]=_0xa8a497[_0x1339('0x15')];this[_0x1339('0x16')]=_0xa8a497[_0x1339('0x16')];this['UserId']=_0xa8a497[_0x1339('0x17')];this[_0x1339('0x18')]=_0xa8a497[_0x1339('0x18')];this['CampaignId']=_0xa8a497[_0x1339('0x19')];this[_0x1339('0x1a')]=_0xa8a497['id'];this['ContactFirstName']=_0xa8a497[_0x1339('0x6')][_0x1339('0x7')]||'';this[_0x1339('0x1b')]=moment()[_0x1339('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1339('0x1d')]=_0xa8a497[_0x1339('0x1d')];this[_0x1339('0x1e')]=_0xa8a497['callbackuniqueid'];this[_0x1339('0x1f')]=_0xa8a497[_0x1339('0x1f')];this[_0x1339('0x20')]=_0xa8a497[_0x1339('0x20')];this[_0x1339('0x21')]='';this['originatecalleridname']='';}Action[_0x1339('0x22')][_0x1339('0x23')]=function(){return util[_0x1339('0x1c')]('\x22%s\x22\x20<%s>',this[_0x1339('0x5')],this[_0x1339('0x4')][_0x1339('0x24')]>0x0?this[_0x1339('0x8')]['substring'](this['voiceQueue'][_0x1339('0x24')]):this[_0x1339('0x8')]);};Action[_0x1339('0x22')]['getQueue']=function(){return this['queue'];};module[_0x1339('0x25')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 559abc9..e5b0192 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 _0x9fe6=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','endtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x21d000,_0x17b1fe){var _0x3ad4e6=function(_0x127a85){while(--_0x127a85){_0x21d000['push'](_0x21d000['shift']());}};_0x3ad4e6(++_0x17b1fe);}(_0x9fe6,0x1c7));var _0x69fe=function(_0x2d61c6,_0x35d7f0){_0x2d61c6=_0x2d61c6-0x0;var _0x5167f7=_0x9fe6[_0x2d61c6];return _0x5167f7;};'use strict';var util=require(_0x69fe('0x0'));var _=require(_0x69fe('0x1'));var moment=require(_0x69fe('0x2'));function getSeconds(_0x378103,_0x563eef){var _0x246b1a=moment(_0x378103)[_0x69fe('0x3')](0x0);var _0x1387d4=moment(_0x563eef)[_0x69fe('0x3')](0x0);return _0x246b1a['diff'](_0x1387d4,_0x69fe('0x4'));}function AgentComplete(_0x16081f,_0x45a8f6){this[_0x69fe('0x5')]=0x4;this[_0x69fe('0x6')]='Answer';this[_0x69fe('0x7')]=_0x16081f[_0x69fe('0x7')];this[_0x69fe('0x8')]=_0x16081f['type'];this[_0x69fe('0x9')]=_0x16081f[_0x69fe('0x8')]===_0x69fe('0xa')?_0x69fe('0xb'):_0x16081f[_0x69fe('0x8')];this[_0x69fe('0xc')]=_0x16081f['countbusyretry'];this[_0x69fe('0xd')]=_0x16081f['countcongestionretry'];this[_0x69fe('0xe')]=_0x16081f['countnoanswerretry'];this[_0x69fe('0xf')]=_0x16081f[_0x69fe('0xc')]+_0x16081f[_0x69fe('0xd')]+_0x16081f[_0x69fe('0xe')]+_0x16081f[_0x69fe('0x10')]+_0x16081f[_0x69fe('0x11')]+_0x16081f[_0x69fe('0x12')]+_0x16081f[_0x69fe('0x13')]+_0x16081f[_0x69fe('0x14')];this['countnosuchnumberretry']=_0x16081f[_0x69fe('0x10')];this['countdropretry']=_0x16081f['countdropretry'];this['countabandonedretry']=_0x16081f[_0x69fe('0x12')];this[_0x69fe('0x13')]=_0x16081f[_0x69fe('0x13')];this['countagentrejectretry']=_0x16081f[_0x69fe('0x14')];this[_0x69fe('0x15')]=_0x45a8f6[_0x69fe('0x15')];this[_0x69fe('0x16')]=_0x16081f['name'];this[_0x69fe('0x17')]=_0x16081f[_0x69fe('0x18')];this[_0x69fe('0x19')]=_0x16081f[_0x69fe('0x19')];this[_0x69fe('0x1a')]=_0x16081f[_0x69fe('0x1a')];this[_0x69fe('0x1b')]=_0x16081f[_0x69fe('0x1b')];this['endtime']=moment()[_0x69fe('0x1c')](_0x69fe('0x1d'));this[_0x69fe('0x1e')]=getSeconds(_0x16081f[_0x69fe('0x1a')],_0x16081f[_0x69fe('0x19')]);this['holdtime']=getSeconds(_0x16081f['answertime'],_0x16081f[_0x69fe('0x1a')]);this['talktime']=getSeconds(this[_0x69fe('0x1f')],_0x16081f[_0x69fe('0x1b')]);this[_0x69fe('0xb')]=_0x45a8f6['queue'];this[_0x69fe('0x20')]=_0x45a8f6['membername'];this['reason']=_0x45a8f6[_0x69fe('0x21')];this[_0x69fe('0x22')]=_0x16081f['callback'];this['callbackuniqueid']=_0x16081f['callbackuniqueid'];this[_0x69fe('0x23')]=_0x16081f[_0x69fe('0x23')];this[_0x69fe('0x24')]=_0x16081f[_0x69fe('0x24')];this[_0x69fe('0x25')]=_0x16081f[_0x69fe('0x25')];this[_0x69fe('0x26')]=_0x16081f[_0x69fe('0x26')];this[_0x69fe('0x27')]=_0x16081f[_0x69fe('0x27')];this[_0x69fe('0x28')]=_0x16081f['VoiceQueueId'];this[_0x69fe('0x29')]=_0x16081f['CampaignId'];this[_0x69fe('0x2a')]=_0x16081f[_0x69fe('0x2a')]||'';this[_0x69fe('0x2b')]=_0x16081f[_0x69fe('0x2b')]||'';}module[_0x69fe('0x2c')]=AgentComplete; \ No newline at end of file +var _0x83e0=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','holdtime','talktime','queue','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x3a41f1,_0xb42887){var _0xcf0d76=function(_0x4df2dd){while(--_0x4df2dd){_0x3a41f1['push'](_0x3a41f1['shift']());}};_0xcf0d76(++_0xb42887);}(_0x83e0,0x8f));var _0x083e=function(_0x1b9c27,_0x126fd0){_0x1b9c27=_0x1b9c27-0x0;var _0x34d9c3=_0x83e0[_0x1b9c27];return _0x34d9c3;};'use strict';var util=require(_0x083e('0x0'));var _=require(_0x083e('0x1'));var moment=require(_0x083e('0x2'));function getSeconds(_0x6c47c,_0x5c2e40){var _0x5480a8=moment(_0x6c47c)['milliseconds'](0x0);var _0x21672f=moment(_0x5c2e40)[_0x083e('0x3')](0x0);return _0x5480a8[_0x083e('0x4')](_0x21672f,_0x083e('0x5'));}function AgentComplete(_0x5d8372,_0xe687ee){this[_0x083e('0x6')]=0x4;this[_0x083e('0x7')]='Answer';this[_0x083e('0x8')]=_0x5d8372[_0x083e('0x8')];this['type']=_0x5d8372[_0x083e('0x9')];this[_0x083e('0xa')]=_0x5d8372[_0x083e('0x9')]===_0x083e('0xb')?'queue':_0x5d8372[_0x083e('0x9')];this['countbusyretry']=_0x5d8372[_0x083e('0xc')];this[_0x083e('0xd')]=_0x5d8372[_0x083e('0xd')];this[_0x083e('0xe')]=_0x5d8372[_0x083e('0xe')];this[_0x083e('0xf')]=_0x5d8372[_0x083e('0xc')]+_0x5d8372[_0x083e('0xd')]+_0x5d8372[_0x083e('0xe')]+_0x5d8372[_0x083e('0x10')]+_0x5d8372[_0x083e('0x11')]+_0x5d8372['countabandonedretry']+_0x5d8372[_0x083e('0x12')]+_0x5d8372[_0x083e('0x13')];this[_0x083e('0x10')]=_0x5d8372[_0x083e('0x10')];this[_0x083e('0x11')]=_0x5d8372[_0x083e('0x11')];this[_0x083e('0x14')]=_0x5d8372[_0x083e('0x14')];this[_0x083e('0x12')]=_0x5d8372[_0x083e('0x12')];this[_0x083e('0x13')]=_0x5d8372[_0x083e('0x13')];this[_0x083e('0x15')]=_0xe687ee[_0x083e('0x15')];this[_0x083e('0x16')]=_0x5d8372[_0x083e('0x17')];this[_0x083e('0x18')]=_0x5d8372['number'];this['starttime']=_0x5d8372[_0x083e('0x19')];this[_0x083e('0x1a')]=_0x5d8372[_0x083e('0x1a')];this[_0x083e('0x1b')]=_0x5d8372['answertime'];this[_0x083e('0x1c')]=moment()[_0x083e('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x5d8372['responsetime'],_0x5d8372[_0x083e('0x19')]);this[_0x083e('0x1e')]=getSeconds(_0x5d8372[_0x083e('0x1b')],_0x5d8372[_0x083e('0x1a')]);this[_0x083e('0x1f')]=getSeconds(this[_0x083e('0x1c')],_0x5d8372[_0x083e('0x1b')]);this[_0x083e('0x20')]=_0xe687ee[_0x083e('0x20')];this['membername']=_0xe687ee[_0x083e('0x21')];this[_0x083e('0x22')]=_0xe687ee[_0x083e('0x22')];this['callback']=_0x5d8372['callback'];this[_0x083e('0x23')]=_0x5d8372[_0x083e('0x23')];this[_0x083e('0x24')]=_0x5d8372[_0x083e('0x24')];this['recallme']=_0x5d8372[_0x083e('0x25')];this[_0x083e('0x26')]=_0x5d8372[_0x083e('0x26')];this[_0x083e('0x27')]=_0x5d8372[_0x083e('0x27')];this[_0x083e('0x28')]=_0x5d8372[_0x083e('0x28')];this[_0x083e('0x29')]=_0x5d8372[_0x083e('0x29')];this[_0x083e('0x2a')]=_0x5d8372[_0x083e('0x2a')];this[_0x083e('0x2b')]=_0x5d8372['originatecalleridnum']||'';this[_0x083e('0x2c')]=_0x5d8372[_0x083e('0x2c')]||'';}module[_0x083e('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index e0a82b3..7ba4604 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 _0x8d0a=['countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0xf61b37,_0x371eff){var _0x4a1630=function(_0x11376c){while(--_0x11376c){_0xf61b37['push'](_0xf61b37['shift']());}};_0x4a1630(++_0x371eff);}(_0x8d0a,0x65));var _0xa8d0=function(_0xe0bb8b,_0x21b6e9){_0xe0bb8b=_0xe0bb8b-0x0;var _0x428d93=_0x8d0a[_0xe0bb8b];return _0x428d93;};'use strict';var util=require(_0xa8d0('0x0'));var _=require('lodash');var moment=require(_0xa8d0('0x1'));function getSeconds(_0xeeb10b,_0x1e83ea){var _0x10995c=moment(_0xeeb10b)[_0xa8d0('0x2')](0x0);var _0x477190=moment(_0x1e83ea)[_0xa8d0('0x2')](0x0);return _0x10995c[_0xa8d0('0x3')](_0x477190,_0xa8d0('0x4'));}function Final(_0x50bb7b){this[_0xa8d0('0x5')]=_0x50bb7b[_0xa8d0('0x5')];this[_0xa8d0('0x6')]=_0x50bb7b[_0xa8d0('0x6')];this[_0xa8d0('0x7')]=_0x50bb7b['type'];this['campaigntype']=_0x50bb7b[_0xa8d0('0x7')]===_0xa8d0('0x8')?'queue':_0x50bb7b['type'];this['countbusyretry']=_0x50bb7b[_0xa8d0('0x9')];this['countcongestionretry']=_0x50bb7b[_0xa8d0('0xa')];this[_0xa8d0('0xb')]=_0x50bb7b[_0xa8d0('0xb')];this[_0xa8d0('0xc')]=_0x50bb7b[_0xa8d0('0x9')]+_0x50bb7b[_0xa8d0('0xa')]+_0x50bb7b[_0xa8d0('0xb')]+_0x50bb7b[_0xa8d0('0xd')]+_0x50bb7b[_0xa8d0('0xe')]+_0x50bb7b[_0xa8d0('0xf')]+_0x50bb7b[_0xa8d0('0x10')]+_0x50bb7b['countagentrejectretry'];this[_0xa8d0('0xd')]=_0x50bb7b['countnosuchnumberretry'];this['countdropretry']=_0x50bb7b[_0xa8d0('0xe')];this[_0xa8d0('0xf')]=_0x50bb7b['countabandonedretry'];this[_0xa8d0('0x10')]=_0x50bb7b[_0xa8d0('0x10')];this[_0xa8d0('0x11')]=_0x50bb7b[_0xa8d0('0x11')];this[_0xa8d0('0x12')]=_0x50bb7b[_0xa8d0('0x12')];this['calleridname']=_0x50bb7b[_0xa8d0('0x13')];this[_0xa8d0('0x14')]=_0x50bb7b['calleridnum'];this[_0xa8d0('0x15')]=_0x50bb7b[_0xa8d0('0x15')];this['responsetime']=_0x50bb7b[_0xa8d0('0x16')];this[_0xa8d0('0x17')]=_0x50bb7b['responsetime'];this['ringtime']=_0x50bb7b[_0xa8d0('0x18')]||0x0;this[_0xa8d0('0x19')]=_0x50bb7b['holdtime']||0x0;this[_0xa8d0('0x1a')]=_0x50bb7b[_0xa8d0('0x1a')]||0x0;this[_0xa8d0('0x1b')]=_0x50bb7b['callback'];this[_0xa8d0('0x1c')]=_0x50bb7b['callbackuniqueid'];this[_0xa8d0('0x1d')]=_0x50bb7b[_0xa8d0('0x1d')];this[_0xa8d0('0x1e')]=_0x50bb7b[_0xa8d0('0x1e')];this[_0xa8d0('0x1f')]=_0x50bb7b[_0xa8d0('0x1f')];this[_0xa8d0('0x20')]=_0x50bb7b['ListId'];this['UserId']=_0x50bb7b[_0xa8d0('0x21')];this['VoiceQueueId']=_0x50bb7b[_0xa8d0('0x22')];this[_0xa8d0('0x23')]=_0x50bb7b[_0xa8d0('0x23')];this[_0xa8d0('0x24')]=_0x50bb7b[_0xa8d0('0x24')]||'';this['originatecalleridname']=_0x50bb7b[_0xa8d0('0x25')]||'';}module[_0xa8d0('0x26')]=Final; \ No newline at end of file +var _0xa23f=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','ringtime','holdtime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa23f,0x7c));var _0xfa23=function(_0x33ed2f,_0x32bf27){_0x33ed2f=_0x33ed2f-0x0;var _0x4d5b60=_0xa23f[_0x33ed2f];return _0x4d5b60;};'use strict';var util=require(_0xfa23('0x0'));var _=require(_0xfa23('0x1'));var moment=require('moment');function getSeconds(_0x48fd46,_0xb81edf){var _0x3f714c=moment(_0x48fd46)[_0xfa23('0x2')](0x0);var _0x3fe466=moment(_0xb81edf)['milliseconds'](0x0);return _0x3f714c[_0xfa23('0x3')](_0x3fe466,'seconds');}function Final(_0x210057){this[_0xfa23('0x4')]=_0x210057[_0xfa23('0x4')];this[_0xfa23('0x5')]=_0x210057['scheduledat'];this[_0xfa23('0x6')]=_0x210057['type'];this[_0xfa23('0x7')]=_0x210057[_0xfa23('0x6')]===_0xfa23('0x8')?_0xfa23('0x9'):_0x210057[_0xfa23('0x6')];this['countbusyretry']=_0x210057['countbusyretry'];this[_0xfa23('0xa')]=_0x210057['countcongestionretry'];this[_0xfa23('0xb')]=_0x210057['countnoanswerretry'];this[_0xfa23('0xc')]=_0x210057[_0xfa23('0xd')]+_0x210057[_0xfa23('0xa')]+_0x210057['countnoanswerretry']+_0x210057[_0xfa23('0xe')]+_0x210057[_0xfa23('0xf')]+_0x210057[_0xfa23('0x10')]+_0x210057['countmachineretry']+_0x210057['countagentrejectretry'];this[_0xfa23('0xe')]=_0x210057[_0xfa23('0xe')];this[_0xfa23('0xf')]=_0x210057[_0xfa23('0xf')];this['countabandonedretry']=_0x210057[_0xfa23('0x10')];this[_0xfa23('0x11')]=_0x210057[_0xfa23('0x11')];this[_0xfa23('0x12')]=_0x210057['countagentrejectretry'];this[_0xfa23('0x9')]=_0x210057[_0xfa23('0x9')];this[_0xfa23('0x13')]=_0x210057[_0xfa23('0x13')];this[_0xfa23('0x14')]=_0x210057['calleridnum'];this['starttime']=_0x210057['starttime'];this[_0xfa23('0x15')]=_0x210057[_0xfa23('0x15')];this['endtime']=_0x210057[_0xfa23('0x15')];this[_0xfa23('0x16')]=_0x210057[_0xfa23('0x16')]||0x0;this['holdtime']=_0x210057[_0xfa23('0x17')]||0x0;this[_0xfa23('0x18')]=_0x210057['talktime']||0x0;this[_0xfa23('0x19')]=_0x210057[_0xfa23('0x19')];this[_0xfa23('0x1a')]=_0x210057[_0xfa23('0x1a')];this[_0xfa23('0x1b')]=_0x210057[_0xfa23('0x1b')];this[_0xfa23('0x1c')]=_0x210057['recallme'];this[_0xfa23('0x1d')]=_0x210057[_0xfa23('0x1d')];this[_0xfa23('0x1e')]=_0x210057[_0xfa23('0x1e')];this['UserId']=_0x210057[_0xfa23('0x1f')];this['VoiceQueueId']=_0x210057[_0xfa23('0x20')];this[_0xfa23('0x21')]=_0x210057[_0xfa23('0x21')];this[_0xfa23('0x22')]=_0x210057[_0xfa23('0x22')]||'';this[_0xfa23('0x23')]=_0x210057[_0xfa23('0x23')]||'';}module[_0xfa23('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 1238d24..e5697bb 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 _0xc06a=['diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds'];(function(_0x100ea5,_0x2f13b4){var _0x1c331=function(_0x247f46){while(--_0x247f46){_0x100ea5['push'](_0x100ea5['shift']());}};_0x1c331(++_0x2f13b4);}(_0xc06a,0x189));var _0xac06=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc06a[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0xac06('0x0'));var _=require(_0xac06('0x1'));var moment=require('moment');function getSeconds(_0x281f3a,_0x4ea94d){var _0xdb85cb=moment(_0x281f3a)[_0xac06('0x2')](0x0);var _0x104d77=moment(_0x4ea94d)[_0xac06('0x2')](0x0);return _0xdb85cb[_0xac06('0x3')](_0x104d77,_0xac06('0x4'));}function Hangup(_0x2473f6,_0x3f73bd){this[_0xac06('0x5')]=0x4;this[_0xac06('0x6')]=_0xac06('0x7');this[_0xac06('0x8')]=_0x2473f6[_0xac06('0x8')];this[_0xac06('0x9')]=_0x2473f6[_0xac06('0x9')];this[_0xac06('0xa')]=_0x2473f6[_0xac06('0x9')]==='outbound'?_0xac06('0xb'):_0x2473f6[_0xac06('0x9')];this['countbusyretry']=_0x2473f6[_0xac06('0xc')];this[_0xac06('0xd')]=_0x2473f6[_0xac06('0xd')];this[_0xac06('0xe')]=_0x2473f6[_0xac06('0xe')];this[_0xac06('0xf')]=_0x2473f6[_0xac06('0xc')]+_0x2473f6[_0xac06('0xd')]+_0x2473f6[_0xac06('0xe')]+_0x2473f6['countnosuchnumberretry']+_0x2473f6['countdropretry']+_0x2473f6[_0xac06('0x10')]+_0x2473f6[_0xac06('0x11')]+_0x2473f6[_0xac06('0x12')];this[_0xac06('0x13')]=_0x2473f6[_0xac06('0x13')];this[_0xac06('0x14')]=_0x2473f6[_0xac06('0x14')];this[_0xac06('0x10')]=_0x2473f6[_0xac06('0x10')];this[_0xac06('0x11')]=_0x2473f6['countmachineretry'];this[_0xac06('0x12')]=_0x2473f6[_0xac06('0x12')];this[_0xac06('0x15')]=_0x3f73bd[_0xac06('0x15')];this[_0xac06('0x16')]=_0x2473f6[_0xac06('0x17')];this[_0xac06('0x18')]=_0x2473f6[_0xac06('0x19')];this[_0xac06('0x1a')]=_0x2473f6[_0xac06('0x1a')];this[_0xac06('0x1b')]=_0x2473f6['responsetime'];this['endtime']=moment()['format'](_0xac06('0x1c'));this[_0xac06('0x1d')]=getSeconds(_0x2473f6[_0xac06('0x1b')],_0x2473f6['starttime']);this[_0xac06('0x1e')]=0x0;this['talktime']=getSeconds(this[_0xac06('0x1f')],_0x2473f6['responsetime']);this[_0xac06('0xb')]=_0x2473f6[_0xac06('0xb')];this[_0xac06('0x20')]='IVR';this['reason']=_0x3f73bd[_0xac06('0x21')];this[_0xac06('0x22')]=_0x2473f6['callback'];this['callbackuniqueid']=_0x2473f6[_0xac06('0x23')];this[_0xac06('0x24')]=_0x2473f6[_0xac06('0x24')];this[_0xac06('0x25')]=_0x2473f6['recallme'];this[_0xac06('0x26')]=_0x2473f6['ContactId'];this[_0xac06('0x27')]=_0x2473f6[_0xac06('0x27')];this[_0xac06('0x28')]=_0x2473f6[_0xac06('0x28')];this['VoiceQueueId']=_0x2473f6[_0xac06('0x29')];this[_0xac06('0x2a')]=_0x2473f6[_0xac06('0x2a')];}module[_0xac06('0x2b')]=Hangup; \ No newline at end of file +var _0x332a=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','cause-txt','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number'];(function(_0x586d05,_0x2bbb9b){var _0x38c0ed=function(_0x290b73){while(--_0x290b73){_0x586d05['push'](_0x586d05['shift']());}};_0x38c0ed(++_0x2bbb9b);}(_0x332a,0xba));var _0xa332=function(_0x16b148,_0x7ba829){_0x16b148=_0x16b148-0x0;var _0x552b68=_0x332a[_0x16b148];return _0x552b68;};'use strict';var util=require('util');var _=require(_0xa332('0x0'));var moment=require(_0xa332('0x1'));function getSeconds(_0x40d7c2,_0x37e7b2){var _0x283fbc=moment(_0x40d7c2)[_0xa332('0x2')](0x0);var _0xc1457b=moment(_0x37e7b2)[_0xa332('0x2')](0x0);return _0x283fbc['diff'](_0xc1457b,_0xa332('0x3'));}function Hangup(_0x390df8,_0x30be6c){this[_0xa332('0x4')]=0x4;this[_0xa332('0x5')]=_0xa332('0x6');this[_0xa332('0x7')]=_0x390df8[_0xa332('0x7')];this[_0xa332('0x8')]=_0x390df8[_0xa332('0x8')];this[_0xa332('0x9')]=_0x390df8[_0xa332('0x8')]===_0xa332('0xa')?_0xa332('0xb'):_0x390df8[_0xa332('0x8')];this[_0xa332('0xc')]=_0x390df8[_0xa332('0xc')];this['countcongestionretry']=_0x390df8[_0xa332('0xd')];this[_0xa332('0xe')]=_0x390df8[_0xa332('0xe')];this['countglobal']=_0x390df8[_0xa332('0xc')]+_0x390df8[_0xa332('0xd')]+_0x390df8[_0xa332('0xe')]+_0x390df8[_0xa332('0xf')]+_0x390df8[_0xa332('0x10')]+_0x390df8[_0xa332('0x11')]+_0x390df8[_0xa332('0x12')]+_0x390df8[_0xa332('0x13')];this[_0xa332('0xf')]=_0x390df8['countnosuchnumberretry'];this['countdropretry']=_0x390df8[_0xa332('0x10')];this[_0xa332('0x11')]=_0x390df8[_0xa332('0x11')];this[_0xa332('0x12')]=_0x390df8[_0xa332('0x12')];this[_0xa332('0x13')]=_0x390df8[_0xa332('0x13')];this[_0xa332('0x14')]=_0x30be6c[_0xa332('0x14')];this[_0xa332('0x15')]=_0x390df8[_0xa332('0x16')];this['calleridnum']=_0x390df8[_0xa332('0x17')];this[_0xa332('0x18')]=_0x390df8[_0xa332('0x18')];this[_0xa332('0x19')]=_0x390df8[_0xa332('0x19')];this['endtime']=moment()[_0xa332('0x1a')](_0xa332('0x1b'));this[_0xa332('0x1c')]=getSeconds(_0x390df8[_0xa332('0x19')],_0x390df8['starttime']);this['holdtime']=0x0;this[_0xa332('0x1d')]=getSeconds(this['endtime'],_0x390df8[_0xa332('0x19')]);this[_0xa332('0xb')]=_0x390df8[_0xa332('0xb')];this[_0xa332('0x1e')]='IVR';this[_0xa332('0x1f')]=_0x30be6c[_0xa332('0x20')];this['callback']=_0x390df8[_0xa332('0x21')];this['callbackuniqueid']=_0x390df8['callbackuniqueid'];this[_0xa332('0x22')]=_0x390df8[_0xa332('0x22')];this[_0xa332('0x23')]=_0x390df8[_0xa332('0x23')];this['ContactId']=_0x390df8[_0xa332('0x24')];this[_0xa332('0x25')]=_0x390df8[_0xa332('0x25')];this[_0xa332('0x26')]=_0x390df8[_0xa332('0x26')];this[_0xa332('0x27')]=_0x390df8[_0xa332('0x27')];this['CampaignId']=_0x390df8[_0xa332('0x28')];}module[_0xa332('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 34639f4..9ad0819 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 _0xcc1f=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x2afbc1,_0x2737c6){var _0x51bffc=function(_0x133e89){while(--_0x133e89){_0x2afbc1['push'](_0x2afbc1['shift']());}};_0x51bffc(++_0x2737c6);}(_0xcc1f,0x1b8));var _0xfcc1=function(_0x29b29c,_0x470e15){_0x29b29c=_0x29b29c-0x0;var _0x323ed9=_0xcc1f[_0x29b29c];return _0x323ed9;};'use strict';var util=require('util');var _=require(_0xfcc1('0x0'));var moment=require(_0xfcc1('0x1'));function getSeconds(_0x163776,_0x4adad9){var _0x3b258b=moment(_0x163776)[_0xfcc1('0x2')](0x0);var _0x4aaecf=moment(_0x4adad9)[_0xfcc1('0x2')](0x0);return _0x3b258b[_0xfcc1('0x3')](_0x4aaecf,_0xfcc1('0x4'));}function History(_0x3c66f3){this[_0xfcc1('0x5')]=_0x3c66f3[_0xfcc1('0x5')];this[_0xfcc1('0x6')]=_0x3c66f3[_0xfcc1('0x6')]||undefined;this[_0xfcc1('0x7')]=_0x3c66f3[_0xfcc1('0x7')];this[_0xfcc1('0x8')]=_0x3c66f3[_0xfcc1('0x7')]===_0xfcc1('0x9')?_0xfcc1('0xa'):_0x3c66f3[_0xfcc1('0x7')];this[_0xfcc1('0xb')]=_0x3c66f3[_0xfcc1('0xb')];this[_0xfcc1('0xc')]=_0x3c66f3[_0xfcc1('0xc')];this[_0xfcc1('0xd')]=_0x3c66f3[_0xfcc1('0xd')];this[_0xfcc1('0xe')]=_0x3c66f3[_0xfcc1('0xb')]+_0x3c66f3[_0xfcc1('0xc')]+_0x3c66f3['countnoanswerretry']+_0x3c66f3[_0xfcc1('0xf')]+_0x3c66f3[_0xfcc1('0x10')]+_0x3c66f3[_0xfcc1('0x11')]+_0x3c66f3[_0xfcc1('0x12')]+_0x3c66f3[_0xfcc1('0x13')];this[_0xfcc1('0xf')]=_0x3c66f3[_0xfcc1('0xf')];this[_0xfcc1('0x10')]=_0x3c66f3[_0xfcc1('0x10')];this[_0xfcc1('0x11')]=_0x3c66f3['countabandonedretry'];this[_0xfcc1('0x12')]=_0x3c66f3[_0xfcc1('0x12')];this[_0xfcc1('0x13')]=_0x3c66f3[_0xfcc1('0x13')];this[_0xfcc1('0xa')]=_0x3c66f3[_0xfcc1('0xa')];this[_0xfcc1('0x14')]=_0x3c66f3[_0xfcc1('0x15')];this[_0xfcc1('0x16')]=_0x3c66f3[_0xfcc1('0x17')];this[_0xfcc1('0x18')]=_0x3c66f3[_0xfcc1('0x18')];this['responsetime']=_0x3c66f3[_0xfcc1('0x19')];this[_0xfcc1('0x1a')]=_0x3c66f3['responsetime'];this[_0xfcc1('0x1b')]=getSeconds(_0x3c66f3['responsetime'],_0x3c66f3['starttime']);this[_0xfcc1('0x1c')]=0x0;this['talktime']=0x0;this[_0xfcc1('0x1d')]=_0x3c66f3['callback'];this['callbackuniqueid']=_0x3c66f3[_0xfcc1('0x1e')];this[_0xfcc1('0x1f')]=_0x3c66f3['callbackat'];this[_0xfcc1('0x20')]=_0x3c66f3[_0xfcc1('0x20')];this[_0xfcc1('0x21')]=_0x3c66f3[_0xfcc1('0x21')];this[_0xfcc1('0x22')]=_0x3c66f3['ListId'];this[_0xfcc1('0x23')]=_0x3c66f3['UserId'];this[_0xfcc1('0x24')]=_0x3c66f3[_0xfcc1('0x24')];this[_0xfcc1('0x25')]=_0x3c66f3['CampaignId'];this[_0xfcc1('0x26')]=_0x3c66f3['originatecalleridnum']||'';this[_0xfcc1('0x27')]=_0x3c66f3['originatecalleridname']||'';}module[_0xfcc1('0x28')]=History; \ No newline at end of file +var _0x99b9=['countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x99b9,0x7d));var _0x999b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x99b9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x999b('0x0'));function getSeconds(_0x2ac811,_0x4daffe){var _0xcd2f28=moment(_0x2ac811)[_0x999b('0x1')](0x0);var _0x3ed3b5=moment(_0x4daffe)[_0x999b('0x1')](0x0);return _0xcd2f28['diff'](_0x3ed3b5,_0x999b('0x2'));}function History(_0x25b246){this[_0x999b('0x3')]=_0x25b246[_0x999b('0x3')];this['scheduledat']=_0x25b246['scheduledat']||undefined;this[_0x999b('0x4')]=_0x25b246[_0x999b('0x4')];this[_0x999b('0x5')]=_0x25b246[_0x999b('0x4')]===_0x999b('0x6')?_0x999b('0x7'):_0x25b246[_0x999b('0x4')];this[_0x999b('0x8')]=_0x25b246[_0x999b('0x8')];this['countcongestionretry']=_0x25b246['countcongestionretry'];this[_0x999b('0x9')]=_0x25b246[_0x999b('0x9')];this['countglobal']=_0x25b246[_0x999b('0x8')]+_0x25b246[_0x999b('0xa')]+_0x25b246[_0x999b('0x9')]+_0x25b246[_0x999b('0xb')]+_0x25b246[_0x999b('0xc')]+_0x25b246['countabandonedretry']+_0x25b246[_0x999b('0xd')]+_0x25b246[_0x999b('0xe')];this[_0x999b('0xb')]=_0x25b246['countnosuchnumberretry'];this[_0x999b('0xc')]=_0x25b246[_0x999b('0xc')];this[_0x999b('0xf')]=_0x25b246[_0x999b('0xf')];this[_0x999b('0xd')]=_0x25b246[_0x999b('0xd')];this[_0x999b('0xe')]=_0x25b246[_0x999b('0xe')];this[_0x999b('0x7')]=_0x25b246[_0x999b('0x7')];this[_0x999b('0x10')]=_0x25b246[_0x999b('0x11')];this[_0x999b('0x12')]=_0x25b246[_0x999b('0x13')];this[_0x999b('0x14')]=_0x25b246[_0x999b('0x14')];this[_0x999b('0x15')]=_0x25b246[_0x999b('0x15')];this[_0x999b('0x16')]=_0x25b246[_0x999b('0x15')];this['ringtime']=getSeconds(_0x25b246[_0x999b('0x15')],_0x25b246[_0x999b('0x14')]);this['holdtime']=0x0;this['talktime']=0x0;this['callback']=_0x25b246[_0x999b('0x17')];this[_0x999b('0x18')]=_0x25b246[_0x999b('0x18')];this[_0x999b('0x19')]=_0x25b246[_0x999b('0x19')];this[_0x999b('0x1a')]=_0x25b246[_0x999b('0x1a')];this[_0x999b('0x1b')]=_0x25b246[_0x999b('0x1b')];this['ListId']=_0x25b246[_0x999b('0x1c')];this[_0x999b('0x1d')]=_0x25b246['UserId'];this[_0x999b('0x1e')]=_0x25b246[_0x999b('0x1e')];this[_0x999b('0x1f')]=_0x25b246[_0x999b('0x1f')];this[_0x999b('0x20')]=_0x25b246[_0x999b('0x20')]||'';this[_0x999b('0x21')]=_0x25b246[_0x999b('0x21')]||'';}module[_0x999b('0x22')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 79f78db..c49fac4 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 _0x1dff=['getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[actionOriginate]\x20','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\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','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','m\x20=\x20','Umin\x20=\x20','uuid','moment','ioredis','../../../config/environment/','dialer','../../../config/logger','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/setting','./history','./final','./agentComplete','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','bind','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','newexten','syncNewExten','varset','syncVarSet','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','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','predictiveIntervalAnsweredCalls','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\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\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','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','debug','error','stack','inspect','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','available','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','prototype','clearZombieChannels','[actions]','Action','status','channel','catch','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','saveInDb','pick','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','isNil','amdstatus','exten','dialAMDActive','value','uniqueid','outboundAnswerAgiCallsDay','state','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','CampaignId','[rescheduleContact][Machine]','HANGUP','membername','[syncHangupInAMDIvr]','countdropretry','dialGlobalMaxRetry','minutes','syncHangup','ivrAnswerCallsDay','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','[syncHangupIvr][createHistory]','syncAgentComplete','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','[rescheduleContact][Drop]','starttime','calleridname','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','calleridnum','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','predictive','booked','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','checkIsTrunkReachable','dialTimezone','checkDialMethod','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','map','user:dialPreviewRecallReminder','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','phone'];(function(_0x3355e6,_0x5597ed){var _0x12a676=function(_0x4594e6){while(--_0x4594e6){_0x3355e6['push'](_0x3355e6['shift']());}};_0x12a676(++_0x5597ed);}(_0x1dff,0xa4));var _0xf1df=function(_0x567fff,_0xd8acd8){_0x567fff=_0x567fff-0x0;var _0x465a37=_0x1dff[_0x567fff];return _0x465a37;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0xf1df('0x0'));var moment=require(_0xf1df('0x1'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xf1df('0x2'));var ut=require('../preview/util/util');var config=require(_0xf1df('0x3'));var logger=require('../../../config/logger')(_0xf1df('0x4'));var loggerBooked=require(_0xf1df('0x5'))('booked');var loggerPredictive=require(_0xf1df('0x5'))('predictive');var loggerPredictiveCalls=require(_0xf1df('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xf1df('0x5'))(_0xf1df('0x6'));var ami=require(_0xf1df('0x7'));config[_0xf1df('0x8')]=_['defaults'](config[_0xf1df('0x8')],{'host':_0xf1df('0x9'),'port':0x18eb});var io=require(_0xf1df('0xa'))(new Redis(config[_0xf1df('0x8')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf1df('0xb'));var cmHopperAdditionalPhone=require(_0xf1df('0xc'));var cmHopperBlack=require(_0xf1df('0xd'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xf1df('0xe'));var Action=require('./action');var History=require(_0xf1df('0xf'));var Final=require(_0xf1df('0x10'));var AgentComplete=require(_0xf1df('0x11'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xf1df('0x12'));var ipAgi=process['env'][_0xf1df('0x13')]||_0xf1df('0x14');var strategy={'rrmemory':_0xf1df('0x15'),'roundrobin':_0xf1df('0x16')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xf1df('0x17')]=function(_0x5e90a9){this[_0xf1df('0x18')]=this['tail']?this[_0xf1df('0x18')][_0xf1df('0x19')](_0x5e90a9):_0x5e90a9();};function Dialer(_0x3911b6,_0x1296f3){this['sequence']=new Sequence();this['preview']=_0x1296f3;this['voiceQueues']=_0x3911b6[_0xf1df('0x1a')];this[_0xf1df('0x1b')]=_0x3911b6[_0xf1df('0x1b')];this[_0xf1df('0x1c')]=_0x3911b6[_0xf1df('0x1c')];this['trunks']=_0x3911b6[_0xf1df('0x1d')];this[_0xf1df('0x1e')]=config[_0xf1df('0x1e')]||0x2;this['channels']={};this[_0xf1df('0x1f')]={};this['contactsId']={};this[_0xf1df('0x20')]={};this['optionPredictive']={};this['startPredictive']={};this[_0xf1df('0x21')]={};this[_0xf1df('0x22')]={};this[_0xf1df('0x23')]={};this[_0xf1df('0x24')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xf1df('0x25')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xf1df('0x25')](this));ami['on'](_0xf1df('0x26'),this[_0xf1df('0x27')][_0xf1df('0x25')](this));ami['on'](_0xf1df('0x28'),this['syncAgentComplete'][_0xf1df('0x25')](this));ami['on'](_0xf1df('0x29'),this['syncQueueSummary']['bind'](this));ami['on'](_0xf1df('0x2a'),this[_0xf1df('0x2b')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xf1df('0x25')](this));ami['on'](_0xf1df('0x2c'),this[_0xf1df('0x2d')]['bind'](this));ami['on'](_0xf1df('0x2e'),this[_0xf1df('0x2f')][_0xf1df('0x25')](this));ami['on']('queuemember',this['syncQueueMember'][_0xf1df('0x25')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));this[_0xf1df('0x30')]();this[_0xf1df('0x31')]();RpcSetting[_0xf1df('0x32')]()[_0xf1df('0x33')](function(_0x2ed661){previewRecallmeReminderInterval=_0x2ed661[_0xf1df('0x34')];});}function isNotNull(_0x177a40){return _0x177a40!==null&&!_['isUndefined'](_0x177a40);}function checkIsLoggedIn(_0x2c569f,_0x48713b){return function(){if(_0x48713b<=0x0){_0x2c569f['message']=_0xf1df('0x35');throw _0x2c569f[_0xf1df('0x36')]+_0xf1df('0x37');}};}function isActive(_0x5dc105){return _0x5dc105;}function checkIsActive(_0x4eca02,_0x15a8c5){return function(){if(!isActive(_0x15a8c5)){_0x4eca02[_0xf1df('0x38')]=_0xf1df('0x39');throw _0x4eca02[_0xf1df('0x36')]+_0xf1df('0x3a');}};}function checkInterval(_0x25cf47){return function(){if(!isNotNull(_0x25cf47[_0xf1df('0x3b')])){_0x25cf47['message']=_0xf1df('0x3c');throw _0x25cf47[_0xf1df('0x36')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x25cf47['Interval']['Intervals'])){_0x25cf47[_0xf1df('0x38')]=_0xf1df('0x3c');throw _0x25cf47['name']+_0xf1df('0x3d');}if(!isNotNull(_['isEmpty'](_0x25cf47[_0xf1df('0x3b')][_0xf1df('0x3e')]))){_0x25cf47[_0xf1df('0x38')]=_0xf1df('0x3c');throw _0x25cf47['name']+_0xf1df('0x3d');}};}function msgResponse(_0x588725,_0x44b5b4,_0x128685){return{'action':_0x588725,'response':_0x44b5b4,'message':_0x128685,'stack':_0x128685};}function myreject(_0x37c224){return function(_0x44d702){return _0x37c224(msgResponse(_0xf1df('0x3f'),_0xf1df('0x40'),JSON[_0xf1df('0x41')](_0x44d702)));};}function getSeconds(_0x28d5c5,_0x542b48){var _0xa7cb4=moment(_0x28d5c5)[_0xf1df('0x42')](0x0);var _0x20826b=moment(_0x542b48)[_0xf1df('0x42')](0x0);return _0xa7cb4['diff'](_0x20826b,_0xf1df('0x43'));}function emit(_0x4d2614,_0x45481b,_0x18ef3a){io['to'](_0x4d2614)[_0xf1df('0x44')](_0x45481b,_0x18ef3a);}function emitVoiceQueueSummary(_0x2ec16d){if(_0x2ec16d[_0xf1df('0x45')]===_0xf1df('0x46')){var _0x5cba78={'id':_0x2ec16d['id'],'name':_0x2ec16d[_0xf1df('0x36')],'strategy':_0x2ec16d[_0xf1df('0x47')],'answered':_0x2ec16d[_0xf1df('0x48')],'available':_0x2ec16d['available'],'loggedIn':_0x2ec16d[_0xf1df('0x49')],'pTalking':_0x2ec16d[_0xf1df('0x4a')],'sumBillable':_0x2ec16d[_0xf1df('0x4b')],'sumDuration':_0x2ec16d[_0xf1df('0x4c')],'sumHoldTime':_0x2ec16d['sumHoldTime']||0x0,'talking':_0x2ec16d[_0xf1df('0x4d')],'total':_0x2ec16d[_0xf1df('0x4e')],'type':_0x2ec16d['type'],'unmanaged':_0x2ec16d[_0xf1df('0x4f')],'abandoned':_0x2ec16d[_0xf1df('0x50')],'waiting':_0x2ec16d[_0xf1df('0x51')],'loggedInDb':_0x2ec16d['loggedInDb'],'dialActive':_0x2ec16d[_0xf1df('0x52')],'dialMethod':_0x2ec16d[_0xf1df('0x53')],'dialOriginateCallerIdName':_0x2ec16d[_0xf1df('0x54')],'dialOriginateCallerIdNumber':_0x2ec16d['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2ec16d[_0xf1df('0x55')],'dialPrefix':_0x2ec16d[_0xf1df('0x56')],'outboundAnswerAgiCallsDay':_0x2ec16d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2ec16d[_0xf1df('0x57')],'outboundBlacklistCallsDay':_0x2ec16d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2ec16d[_0xf1df('0x58')],'outboundCongestionCallsDay':_0x2ec16d[_0xf1df('0x59')],'outboundDropCallsDayACS':_0x2ec16d[_0xf1df('0x5a')],'outboundDropCallsDayCallersExit':_0x2ec16d[_0xf1df('0x5b')],'outboundDropCallsDayTimeout':_0x2ec16d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2ec16d[_0xf1df('0x5c')],'outboundNoSuchCallsDay':_0x2ec16d[_0xf1df('0x5d')],'outboundOriginateFailureCallsDay':_0x2ec16d[_0xf1df('0x5e')],'outboundReCallsDay':_0x2ec16d[_0xf1df('0x5f')],'outboundRejectCallsDay':_0x2ec16d['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2ec16d[_0xf1df('0x60')],'predictiveIntervalAnsweredCalls':_0x2ec16d['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2ec16d[_0xf1df('0x61')],'predictiveIntervalAvgTalktime':_0x2ec16d[_0xf1df('0x62')],'predictiveIntervalDroppedCallsCallersExit':_0x2ec16d[_0xf1df('0x63')],'predictiveIntervalDroppedCallsTimeout':_0x2ec16d[_0xf1df('0x64')],'predictiveIntervalErlangCalls':_0x2ec16d[_0xf1df('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x2ec16d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2ec16d[_0xf1df('0x66')],'predictiveIntervalMultiplicativeFactor':_0x2ec16d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2ec16d[_0xf1df('0x67')],'predictiveIntervalAvailable':_0x2ec16d['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2ec16d[_0xf1df('0x68')],'message':_0x2ec16d[_0xf1df('0x38')],'originated':_0x2ec16d['originated'],'erlangCalls':_0x2ec16d[_0xf1df('0x69')],'erlangCallToSecond':_0x2ec16d[_0xf1df('0x6a')],'erlangAbandonmentRate':_0x2ec16d[_0xf1df('0x6b')],'erlangBusyFactor':_0x2ec16d[_0xf1df('0x6c')],'startPredictive':_0x2ec16d[_0xf1df('0x6d')],'startProgressive':_0x2ec16d[_0xf1df('0x21')]};if(_0x2ec16d[_0xf1df('0x6e')]){_0x5cba78[_0xf1df('0x6e')]={'id':_0x2ec16d['Trunk']['id'],'name':_0x2ec16d[_0xf1df('0x6e')][_0xf1df('0x36')],'active':_0x2ec16d[_0xf1df('0x6e')][_0xf1df('0x6f')],'callerid':_0x2ec16d[_0xf1df('0x6e')][_0xf1df('0x70')]};}if(_0x2ec16d[_0xf1df('0x3b')]){_0x5cba78[_0xf1df('0x3b')]={'id':_0x2ec16d[_0xf1df('0x3b')]['id'],'name':_0x2ec16d[_0xf1df('0x3b')][_0xf1df('0x36')]};}var _0x3f620e=md5(JSON['stringify'](_0x5cba78));if(_0x2ec16d[_0xf1df('0x71')]!==_0x3f620e){_0x2ec16d['md5']=_0x3f620e;emit(util[_0xf1df('0x72')](_0xf1df('0x73'),_0x5cba78[_0xf1df('0x36')]),'voice_queue:save',_0x5cba78);}}}function emitCampaignSummary(_0x3ad54f){if(_0x3ad54f['type']===_0xf1df('0x74')){emit(util[_0xf1df('0x72')](_0xf1df('0x75'),_0x3ad54f[_0xf1df('0x36')]),_0xf1df('0x76'),_0x3ad54f);}}function checkGetDataPredictive(_0x5874f9){if(isNotNull(_0x5874f9)&&!_[_0xf1df('0x77')](_0x5874f9)){loggerPredictive['info'](_0xf1df('0x78'));loggerPredictive[_0xf1df('0x79')](_0xf1df('0x7a'),_0x5874f9[_0xf1df('0x68')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x7b'),_0x5874f9[_0xf1df('0x7c')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x7d'),_0x5874f9[_0xf1df('0x64')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x7e'),_0x5874f9[_0xf1df('0x63')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x7f'),_0x5874f9[_0xf1df('0x61')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x80'),_0x5874f9[_0xf1df('0x62')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x81'));if(_0x5874f9['predictiveIntervalTotalCalls']>0x0){if(!_[_0xf1df('0x82')](_0x5874f9[_0xf1df('0x62')])&&_0x5874f9[_0xf1df('0x62')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xf1df('0x82')](_0x5874f9[_0xf1df('0x61')])&&_0x5874f9[_0xf1df('0x61')]>0x0){return!![];}loggerPredictive[_0xf1df('0x79')](_0xf1df('0x83'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xf1df('0x79')](_0xf1df('0x84'));}return![];}function mergeDataErlangB(_0x30d035){return function(_0x4ac16f){loggerPredictive[_0xf1df('0x79')](_0xf1df('0x85'));loggerPredictive[_0xf1df('0x79')](_0xf1df('0x86'),_0x4ac16f[_0xf1df('0x69')]);loggerPredictive[_0xf1df('0x79')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ac16f[_0xf1df('0x6a')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x87'),_0x4ac16f[_0xf1df('0x6b')]);loggerPredictive[_0xf1df('0x79')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ac16f[_0xf1df('0x6c')]);loggerPredictive[_0xf1df('0x79')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4ac16f[_0xf1df('0x6b')]);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x81'));_[_0xf1df('0x88')](_0x30d035,_0x4ac16f);};}function getDiff(_0x2dc19a){var _0x54a61d=moment()[_0xf1df('0x42')](0x0);var _0x476cdf=moment(_0x2dc19a)[_0xf1df('0x42')](0x0);return _0x54a61d[_0xf1df('0x89')](_0x476cdf,'seconds');}function ifInterval(_0x180388,_0xc7866d){if(_[_0xf1df('0x82')](_0xc7866d)){return![];}return getDiff(_0xc7866d)<_0x180388*0x3c;}function freeVariablesPredictive(_0x166b3a){if(isNotNull(_0x166b3a)){if(!_[_0xf1df('0x82')](_0x166b3a['startProgressive'])){_0x166b3a['startProgressive']=undefined;loggerPredictive[_0xf1df('0x79')](_0x166b3a[_0xf1df('0x36')],_0xf1df('0x8a'));}if(!_[_0xf1df('0x82')](_0x166b3a[_0xf1df('0x6d')])){_0x166b3a[_0xf1df('0x6d')]=undefined;loggerPredictive['info'](_0x166b3a[_0xf1df('0x36')],_0xf1df('0x8b'));}if(!_[_0xf1df('0x82')](_0x166b3a[_0xf1df('0x8c')])){clearInterval(_0x166b3a[_0xf1df('0x8c')]);_0x166b3a[_0xf1df('0x8c')]=undefined;loggerPredictive[_0xf1df('0x79')](_0x166b3a[_0xf1df('0x36')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x13efff,_0x3a6b0c){if(_0x3a6b0c===0x0){return 0x0;}var _0x4da96b=0x1;for(var _0x6f2eb6=0x1;_0x6f2eb6<=_0x3a6b0c;_0x6f2eb6+=0x1){_0x4da96b=0x1+_0x4da96b*_0x6f2eb6/_0x13efff;}return 0x1/_0x4da96b;}function isVoiceQueueOutbound(_0x1f32e1){return _0x1f32e1==='outbound';}function isNotPreview(_0x2420a8){return _0x2420a8!==_0xf1df('0x8d');}function isCampaignIvr(_0x40f058){return _0x40f058===_0xf1df('0x74');}function getCallerId(_0xbf6627,_0x586e9f,_0x38a14d){if(!_[_0xf1df('0x82')](_0x38a14d)&&typeof _0x38a14d===_0xf1df('0x8e')&&!_[_0xf1df('0x77')](_0x38a14d)){if(!_['isUndefined'](_0x586e9f)&&typeof _0x586e9f===_0xf1df('0x8e')&&!_[_0xf1df('0x77')](_0x586e9f)){return util[_0xf1df('0x72')](_0xf1df('0x8f'),_0x586e9f,_0x38a14d);}return util[_0xf1df('0x72')](_0xf1df('0x8f'),_0x38a14d,_0x38a14d);}if(!_['isUndefined'](_0xbf6627)&&typeof _0xbf6627===_0xf1df('0x8e')&&!_[_0xf1df('0x77')](_0xbf6627)){return _0xbf6627;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2902c4,_0x5b77d1){return function(_0x3f549e){freeVariablesPredictive(_0x5b77d1);emitVoiceQueueSummary(_0x5b77d1);emitCampaignSummary(_0x5b77d1);loggerSyncQueueSummary[_0xf1df('0x90')](_0x2902c4,util['inspect'](_0x3f549e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1d9c5a,_0x4076f6){return function(_0x44067d){loggerPredictive[_0xf1df('0x91')](_0x4076f6[_0xf1df('0x36')],_0x1d9c5a);loggerPredictive[_0xf1df('0x91')](_0x44067d[_0xf1df('0x92')]);freeVariablesPredictive(_0x4076f6);};}function loggerCatch(_0x206384){return function(_0x4615c3){logger[_0xf1df('0x91')](_0x206384,util[_0xf1df('0x93')](_0x4615c3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1c1f41){return _0x1c1f41&&!_[_0xf1df('0x82')](_0x1c1f41)&&_0x1c1f41['length']>0x0;}function decremetOriginate(_0x544019){if(!_['isUndefined'](_0x544019)&&_0x544019!==null){if(typeof _0x544019[_0xf1df('0x94')]!==_0xf1df('0x95')){if(_0x544019['originated']>0x0){_0x544019['originated']-=0x1;}else{logger['error'](_0xf1df('0x96'));}}}else{logger[_0xf1df('0x91')](_0xf1df('0x97'));}}function checkContactLowerLimitOriginate(_0x492044,_0x15e171,_0x36fbc2){if(_0x15e171>_0x36fbc2){for(var _0x160ffa=0x0;_0x160ffa<_0x15e171-_0x36fbc2;_0x160ffa+=0x1){decremetOriginate(_0x492044);}}}function loggerGetContactDialer(_0x4dc28b,_0x3a811e,_0x54c279){return function(_0x21038f){checkContactLowerLimitOriginate(_0x3a811e,_0x54c279,0x0);logger['error'](_0x4dc28b,util['inspect'](_0x21038f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x164317){return function(_0x4c0666){if(isNotNull(_0x4c0666)&&isNotNull(_0x4c0666[0x0])){if(_0x4c0666[0x0][_0xf1df('0x98')]>0x0){_0x164317['message']=_0xf1df('0x99');logger[_0xf1df('0x79')]('[getContactDialer2][ReScheduled]'+_0x164317['name'],_0x4c0666[0x0][_0xf1df('0x98')],_0xf1df('0x9a'));}else{_0x164317['message']=_0xf1df('0x9b');logger[_0xf1df('0x79')]('[getContactDialer2][Empty]'+_0x164317[_0xf1df('0x36')]);}}};}function notSendMessagesQueue(_0x47910c){if(_0x47910c[_0xf1df('0x9c')]){freeVariablesPredictive(_0x47910c);if(_0x47910c[_0xf1df('0x94')]===0x0&&_0x47910c[_0xf1df('0x4d')]===0x0&&_0x47910c[_0xf1df('0x51')]===0x0&&(_0x47910c[_0xf1df('0x4a')]||0x0)===0x0){_0x47910c[_0xf1df('0x9c')]=![];_0x47910c[_0xf1df('0x9d')]=0x0;_0x47910c[_0xf1df('0x38')]=_0xf1df('0x39');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x47910c['name'],_0xf1df('0x9e'));}else{_0x47910c[_0xf1df('0x38')]=_0xf1df('0x9f');loggerSyncQueueSummary[_0xf1df('0x90')](_0xf1df('0xa0'),_0x47910c[_0xf1df('0x36')],_0xf1df('0xa1'));}emitVoiceQueueSummary(_0x47910c);}}function notSendMessagesCampaign(_0x30590c){if(_0x30590c[_0xf1df('0x9c')]){if(_0x30590c[_0xf1df('0x94')]===0x0){_0x30590c[_0xf1df('0x9c')]=![];_0x30590c[_0xf1df('0x38')]=_0xf1df('0x39');loggerSyncQueueSummary['debug'](_0xf1df('0xa2'),_0x30590c[_0xf1df('0x36')],_0xf1df('0x9e'));}else{_0x30590c[_0xf1df('0x38')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xf1df('0x90')](_0xf1df('0xa2'),_0x30590c[_0xf1df('0x36')],_0xf1df('0xa1'));}emitCampaignSummary(_0x30590c);}}function createObjHistory(_0x540d8c,_0x146711,_0x30cab9,_0x104643,_0x3e99cb){_0x540d8c[_0xf1df('0x38')]=_0x30cab9;var _0x4ae603=new Action(_0x540d8c,_0x146711);var _0x367390=new History(_0x4ae603);_0x367390['state']=_0x104643;_0x367390[_0xf1df('0xa3')]=_0x3e99cb;_0x367390[_0xf1df('0xa4')]=_0x4ae603['starttime'];return _0x367390;}Dialer[_0xf1df('0xa5')][_0xf1df('0x31')]=function(){var _0x30b751=this;setInterval(function(){_0x30b751[_0xf1df('0xa6')](_0x30b751['uniqueId'],'[uniqueid]');_0x30b751[_0xf1df('0xa6')](_0x30b751[_0xf1df('0x1f')],_0xf1df('0xa7'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x11f134,_0x414384){var _0xcc5b0=this;for(var _0x5e1eda in _0x11f134){if(typeof _0x11f134[_0x5e1eda]!==_0xf1df('0x95')){this['sequence'][_0xf1df('0x17')](function(){if(!_['isNil'](_0x11f134[_0x5e1eda])){return ami[_0xf1df('0xa8')]({'action':_0xf1df('0xa9'),'channel':_0x11f134[_0x5e1eda][_0xf1df('0xaa')]})[_0xf1df('0xab')](function(_0x1117e9){if(_0x1117e9[_0xf1df('0x38')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x11f134[_0x5e1eda]&&_0x11f134[_0x5e1eda]['type']!=='ivr'){_0xcc5b0['updateOriginated'](_0xcc5b0[_0xf1df('0x1a')][_0x11f134[_0x5e1eda][_0xf1df('0xac')]]);logger[_0xf1df('0x91')](_0xf1df('0xad'),_0x414384,_0x5e1eda,_0x11f134[_0x5e1eda][_0xf1df('0xac')]);delete _0x11f134[_0x5e1eda];}if(_0x11f134[_0x5e1eda]&&_0x11f134[_0x5e1eda][_0xf1df('0x45')]===_0xf1df('0x74')){_0xcc5b0[_0xf1df('0xae')](_0xcc5b0[_0xf1df('0x1b')][_0x11f134[_0x5e1eda][_0xf1df('0xac')]]);logger[_0xf1df('0x91')](_0xf1df('0xaf'),_0x414384,_0x5e1eda,_0x11f134[_0x5e1eda][_0xf1df('0xac')]);delete _0x11f134[_0x5e1eda];}},0x2328);}});}});}}};Dialer[_0xf1df('0xa5')][_0xf1df('0xb0')]=function(_0x562f27){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopper[_0xf1df('0xb0')](_0x562f27))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xb2')));};Dialer['prototype'][_0xf1df('0xb3')]=function(_0x23ef27){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopperBlack[_0xf1df('0xb3')](_0x23ef27))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xb4')));};Dialer['prototype'][_0xf1df('0xb5')]=function(_0x2a3db1,_0x56b76c,_0x31fd28){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopperAdditionalPhone[_0xf1df('0xb5')](_0x2a3db1,_0x56b76c,_0x31fd28))[_0xf1df('0xab')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0xf1df('0xa5')][_0xf1df('0xb6')]=function(_0x2cb6d1,_0x2882f7,_0x554a26){return Promise['resolve']()[_0xf1df('0x33')](cmHopperAdditionalPhone[_0xf1df('0xb6')](_0x2cb6d1,_0x2882f7,_0x554a26))['catch'](loggerCatch(_0xf1df('0xb7')));};Dialer[_0xf1df('0xa5')][_0xf1df('0xb8')]=function(_0x33c993){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopperBlack[_0xf1df('0xb8')](_0x33c993))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xb9')));};Dialer[_0xf1df('0xa5')][_0xf1df('0xba')]=function(_0x116545){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopperHistory['avgHandleTime'](_0x116545))[_0xf1df('0xab')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xf1df('0xbb')]=function(_0x17ced9){return Promise['resolve']()[_0xf1df('0x33')](cmHopper[_0xf1df('0xbb')](_0x17ced9))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xbc')));};Dialer['prototype']['unlockContact']=function(_0x2a44b3,_0x35a8d5,_0x3e7a60){return Promise[_0xf1df('0xb1')]()['then'](cmHopper[_0xf1df('0xbd')](_0x2a44b3,_0x35a8d5,_0x3e7a60))['catch'](loggerCatch(_0xf1df('0xbe')));};Dialer[_0xf1df('0xa5')][_0xf1df('0xbf')]=function(_0x504c4e,_0x19b40e,_0x4bcc76,_0x2a310f,_0x6020a8){return Promise['resolve']()[_0xf1df('0x33')](cmHopper['getContactDialer'](_0x504c4e,_0x19b40e,_0x4bcc76,_0x2a310f))[_0xf1df('0xab')](function(_0x5900cd){_0x6020a8['temp']-=_0x4bcc76;_0x6020a8[_0xf1df('0xc0')]=_0x6020a8[_0xf1df('0xc0')]>0x0?_0x6020a8[_0xf1df('0xc0')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x5900cd);});};Dialer[_0xf1df('0xa5')]['getContactDialerIvr']=function(_0x57c1f5,_0x1d68ee,_0xeb3a44,_0x287c74){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopper[_0xf1df('0xc1')](_0x57c1f5,_0x1d68ee,_0xeb3a44))['catch'](function(_0x438c96){_0x287c74['temp']-=_0x1d68ee;_0x287c74[_0xf1df('0xc0')]=_0x287c74[_0xf1df('0xc0')]>0x0?_0x287c74['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x438c96);});};Dialer['prototype'][_0xf1df('0xc2')]=function(_0x3e7e71){return Promise[_0xf1df('0xb1')]()['then'](voiceQueueRt[_0xf1df('0xc2')](_0x3e7e71))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xc3')));};Dialer[_0xf1df('0xa5')][_0xf1df('0xc4')]=function(_0x296f93){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopper[_0xf1df('0xc4')](_0x296f93))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xc5')));};Dialer[_0xf1df('0xa5')][_0xf1df('0xc6')]=function(_0x1d1271){return Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](cmHopperHistory[_0xf1df('0xc6')](_0x1d1271))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xc7')));};Dialer[_0xf1df('0xa5')]['updateOriginated']=function(_0x4418de){if(!_[_0xf1df('0x82')](_0x4418de)&&_0x4418de!==null){if(typeof _0x4418de['originated']!==_0xf1df('0x95')){if(_0x4418de[_0xf1df('0x94')]>0x0){_0x4418de['originated']-=0x1;}else{logger[_0xf1df('0x91')](_0xf1df('0xc8'));}}}else{logger[_0xf1df('0x91')](_0xf1df('0xc9'));}};Dialer['prototype']['loggerHandler']=function(_0x29b2da,_0x5003bc){var _0x4aafab=this;return function(_0x3399a5){_0x4aafab['updateOriginated'](_0x5003bc);logger['error'](_0x29b2da,util[_0xf1df('0x93')](_0x3399a5,{'showHidden':![],'depth':null}));};};Dialer[_0xf1df('0xa5')][_0xf1df('0xca')]=function(_0x1ca6d2,_0x3c6dbf,_0x2fada5){var _0x240bec={'state':0x19,'statedesc':'notFound'};this[_0xf1df('0xae')](_0x3c6dbf);this[_0xf1df('0xcb')](_[_0xf1df('0x88')](_0x240bec,_[_0xf1df('0xcc')](_0x2fada5,['ContactId','ListId',_0xf1df('0xcd'),_0xf1df('0xce'),'CampaignId'])),_0xf1df('0xcf'),_0xf1df('0xd0'));logger['error'](_0x1ca6d2);};Dialer['prototype'][_0xf1df('0xd1')]=function(_0x26def2){return _0x26def2===_0xf1df('0xd2');};Dialer[_0xf1df('0xa5')][_0xf1df('0xd3')]=function(_0x52c10a){return!_['isUndefined'](_0x52c10a)&&_0x52c10a&&!_['isUndefined'](_0x52c10a['name'])&&!_['isUndefined'](_0x52c10a[_0xf1df('0x6f')])&&_0x52c10a['active']&&(this[_0xf1df('0x1d')][util[_0xf1df('0x72')](_0xf1df('0xd4'),_0x52c10a['name'])]['status']===_0xf1df('0xd5')||this[_0xf1df('0x1d')][util['format'](_0xf1df('0xd4'),_0x52c10a[_0xf1df('0x36')])][_0xf1df('0xa9')]==='unmonitored');};Dialer[_0xf1df('0xa5')]['saveInDb']=function(_0x24346d,_0x24fe37,_0x1706b2){this[_0xf1df('0xc6')](_0x24346d)[_0xf1df('0xab')](loggerCatch(_0x24fe37));this['moveContactManagedDialer'](_0x24346d)[_0xf1df('0xab')](loggerCatch(_0x1706b2));};Dialer[_0xf1df('0xa5')][_0xf1df('0x2f')]=function(_0x35d784){var _0x2dae12=this;var _0x3815f6=this['uniqueId'][_0x35d784['uniqueid']];var _0xbb68e1;if(!_['isNil'](_0x35d784)&&!_['isNil'](_0x35d784['variable'])&&!_[_0xf1df('0xd6')](_0x35d784['variable'][_0xf1df('0xd7')])&&_0x35d784[_0xf1df('0xd8')]==='xcally-motion-dialer'&&_0x3815f6){if(_0x3815f6[_0xf1df('0x45')]!=='ivr'&&this[_0xf1df('0x1a')][_0x3815f6[_0xf1df('0xac')]][_0xf1df('0xd9')]&&_0x35d784[_0xf1df('0xda')]==='HANGUP'){delete this[_0xf1df('0x20')][_0x35d784[_0xf1df('0xdb')]];this[_0xf1df('0xae')](this['voiceQueues'][_0x3815f6[_0xf1df('0xac')]]);this[_0xf1df('0x1a')][_0x3815f6['queue']][_0xf1df('0x57')]+=0x1;this[_0xf1df('0x1a')][_0x3815f6[_0xf1df('0xac')]][_0xf1df('0xdc')]+=0x1;_0xbb68e1=new Hangup(_0x3815f6,_0x35d784);_0xbb68e1[_0xf1df('0xdd')]=0x12;_0xbb68e1[_0xf1df('0xa3')]=_0xf1df('0xde');_0xbb68e1['membername']=_0xf1df('0xdf');ami[_0xf1df('0x44')](_0xf1df('0xe0'),ut[_0xf1df('0xe1')](_0xbb68e1,_0xf1df('0xe2')));this['saveInDb'](_0xbb68e1,_0xf1df('0xe3'),_0xf1df('0xe4'));}if(_0x3815f6[_0xf1df('0x45')]!==_0xf1df('0x74')&&this[_0xf1df('0x1a')][_0x3815f6[_0xf1df('0xac')]][_0xf1df('0xd9')]&&_0x35d784[_0xf1df('0xda')]===_0xf1df('0xe5')){return new Promise(function(_0x15a48f,_0x1771c8){delete _0x2dae12[_0xf1df('0x20')][_0x35d784['uniqueid']];_0x2dae12[_0xf1df('0xae')](_0x2dae12[_0xf1df('0x1a')][_0x3815f6[_0xf1df('0xac')]]);_0x2dae12['voiceQueues'][_0x3815f6['queue']]['outboundAnswerCallsDay']+=0x1;_0x2dae12[_0xf1df('0x1a')][_0x3815f6['queue']][_0xf1df('0xdc')]+=0x1;var _0x1553e8=_0x2dae12[_0xf1df('0x1a')][_0x3815f6[_0xf1df('0xac')]];var _0x50aa89=new Hangup(_0x3815f6,_0x35d784);_0x50aa89[_0xf1df('0xdd')]=0x13;_0x50aa89[_0xf1df('0xa3')]=_0xf1df('0xe6');_0x50aa89['membername']=_0xf1df('0xdf');_0x50aa89[_0xf1df('0xe7')]+=0x1;_0x50aa89[_0xf1df('0xe8')]+=0x1;_0x50aa89[_0xf1df('0xe2')]=!![];ami[_0xf1df('0x44')](_0xf1df('0xe0'),ut[_0xf1df('0xe1')](_0x50aa89,'amd'));_0x2dae12['createHistory'](_0x50aa89)[_0xf1df('0xab')](loggerCatch(_0xf1df('0xe9')));if(_0x50aa89[_0xf1df('0xea')]+_0x50aa89[_0xf1df('0xeb')]+_0x50aa89[_0xf1df('0xec')]+_0x50aa89[_0xf1df('0xed')]+_0x50aa89['countdropretry']+_0x50aa89[_0xf1df('0xee')]+_0x50aa89[_0xf1df('0xe7')]+_0x50aa89[_0xf1df('0xef')]>=_0x1553e8['dialGlobalMaxRetry']){_0x2dae12[_0xf1df('0xf0')](_0x50aa89,_0x15a48f,_0x1771c8,_0xf1df('0xf1'));}else{if(_0x50aa89[_0xf1df('0xe7')]>=_0x1553e8[_0xf1df('0xf2')]){_0x2dae12[_0xf1df('0xf3')](_0x50aa89,_0x15a48f,_0x1771c8,_0xf1df('0xf4'));}else{_0x2dae12['rescheduleContact']({'active':![],'countmachineretry':_0x50aa89[_0xf1df('0xe7')],'scheduledat':moment()[_0xf1df('0xf5')](_0x1553e8[_0xf1df('0xf6')],'minutes')[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x50aa89[_0xf1df('0xf8')],'ListId':_0x50aa89[_0xf1df('0xf9')],'VoiceQueueId':_0x50aa89[_0xf1df('0xce')]||undefined,'CampaignId':_0x50aa89[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch(_0xf1df('0xfb')));_0x15a48f({'reschedule':0x1});}}});}if(_0x3815f6[_0xf1df('0x45')]===_0xf1df('0x74')&&this['campaigns'][_0x3815f6[_0xf1df('0xac')]][_0xf1df('0xd9')]&&_0x35d784[_0xf1df('0xda')]===_0xf1df('0xfc')){delete this[_0xf1df('0x20')][_0x35d784[_0xf1df('0xdb')]];this[_0xf1df('0xae')](this[_0xf1df('0x1b')][_0x3815f6[_0xf1df('0xac')]]);_0xbb68e1=new Hangup(_0x3815f6,_0x35d784);_0xbb68e1[_0xf1df('0xdd')]=0x12;_0xbb68e1[_0xf1df('0xa3')]='HangupInAMD';_0xbb68e1[_0xf1df('0xfd')]='AMD';ami[_0xf1df('0x44')]('custom:amd',ut[_0xf1df('0xe1')](_0xbb68e1,_0xf1df('0xe2')));this[_0xf1df('0xcb')](_0xbb68e1,'[syncHangupInAMDIvr][createHistory]',_0xf1df('0xfe'));}if(_0x3815f6[_0xf1df('0x45')]===_0xf1df('0x74')&&this[_0xf1df('0x1b')][_0x3815f6[_0xf1df('0xac')]][_0xf1df('0xd9')]&&_0x35d784['value']===_0xf1df('0xe5')){return new Promise(function(_0x4968ce,_0x520767){delete _0x2dae12['uniqueId'][_0x35d784[_0xf1df('0xdb')]];_0x2dae12[_0xf1df('0xae')](_0x2dae12[_0xf1df('0x1b')][_0x3815f6[_0xf1df('0xac')]]);_0x2dae12[_0xf1df('0x1b')][_0x3815f6[_0xf1df('0xac')]][_0xf1df('0x57')]+=0x1;_0x2dae12[_0xf1df('0x1b')][_0x3815f6[_0xf1df('0xac')]][_0xf1df('0xdc')]+=0x1;var _0x5efcb3=_0x2dae12['campaigns'][_0x3815f6[_0xf1df('0xac')]];var _0x35e917=new Hangup(_0x3815f6,_0x35d784);_0x35e917[_0xf1df('0xdd')]=0x13;_0x35e917[_0xf1df('0xa3')]=_0xf1df('0xe6');_0x35e917['membername']='AMD';_0x35e917[_0xf1df('0xe7')]+=0x1;_0x35e917[_0xf1df('0xe8')]+=0x1;_0x35e917['amd']=!![];ami['emit'](_0xf1df('0xe0'),ut['buildObj'](_0x35e917,_0xf1df('0xe2')));_0x2dae12[_0xf1df('0xc6')](_0x35e917)[_0xf1df('0xab')](loggerCatch(_0xf1df('0xe9')));if(_0x35e917[_0xf1df('0xea')]+_0x35e917['countcongestionretry']+_0x35e917[_0xf1df('0xec')]+_0x35e917['countnosuchnumberretry']+_0x35e917[_0xf1df('0xff')]+_0x35e917['countabandonedretry']+_0x35e917[_0xf1df('0xe7')]+_0x35e917[_0xf1df('0xef')]>=_0x5efcb3[_0xf1df('0x100')]){_0x2dae12[_0xf1df('0xf0')](_0x35e917,_0x4968ce,_0x520767,_0xf1df('0xf1'));}else{if(_0x35e917[_0xf1df('0xe7')]>=_0x5efcb3[_0xf1df('0xf2')]){_0x2dae12[_0xf1df('0xf3')](_0x35e917,_0x4968ce,_0x520767,_0xf1df('0xf4'));}else{_0x2dae12['rescheduleContact']({'active':![],'countmachineretry':_0x35e917[_0xf1df('0xe7')],'scheduledat':moment()[_0xf1df('0xf5')](_0x5efcb3[_0xf1df('0xf6')],_0xf1df('0x101'))[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x35e917[_0xf1df('0xf8')],'ListId':_0x35e917['ListId'],'VoiceQueueId':_0x35e917['VoiceQueueId']||undefined,'CampaignId':_0x35e917[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch(_0xf1df('0xfb')));_0x4968ce({'reschedule':0x1});}}});}}};Dialer[_0xf1df('0xa5')][_0xf1df('0x102')]=function(_0x2d0181){var _0x45163f=this[_0xf1df('0x20')][_0x2d0181[_0xf1df('0xdb')]];var _0x2ffb25;if(_0x45163f&&_0x45163f[_0xf1df('0x45')]===_0xf1df('0x74')){delete this[_0xf1df('0x20')][_0x2d0181[_0xf1df('0xdb')]];this[_0xf1df('0xae')](this[_0xf1df('0x1b')][_0x45163f[_0xf1df('0xac')]]);this['campaigns'][_0x45163f[_0xf1df('0xac')]][_0xf1df('0x103')]+=0x1;_0x2ffb25=new Hangup(_0x45163f,_0x2d0181);this[_0xf1df('0xc6')](_0x2ffb25)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xf1df('0xc4')](_0x2ffb25)[_0xf1df('0xab')](loggerCatch('[syncHangupIvr]'));}if(_0x45163f&&_0x45163f['type']!==_0xf1df('0x74')&&isNotNull(this[_0xf1df('0x1a')][_0x45163f[_0xf1df('0xac')]]['dialQueueProject'])){delete this[_0xf1df('0x20')][_0x2d0181[_0xf1df('0xdb')]];this['updateOriginated'](this[_0xf1df('0x1a')][_0x45163f[_0xf1df('0xac')]]);this[_0xf1df('0x1a')][_0x45163f[_0xf1df('0xac')]][_0xf1df('0x57')]+=0x1;this[_0xf1df('0x1a')][_0x45163f[_0xf1df('0xac')]][_0xf1df('0xdc')]+=0x1;_0x2ffb25=new Hangup(_0x45163f,_0x2d0181);_0x2ffb25[_0xf1df('0xdd')]=0x10;_0x2ffb25[_0xf1df('0xa3')]=_0xf1df('0x104');_0x2ffb25[_0xf1df('0xfd')]=_0xf1df('0x105');this[_0xf1df('0xc6')](_0x2ffb25)[_0xf1df('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xf1df('0xc4')](_0x2ffb25)['catch'](loggerCatch(_0xf1df('0x106')));}if(_0x45163f&&_0x45163f['type']!==_0xf1df('0x74')&&!isNotNull(this[_0xf1df('0x1a')][_0x45163f[_0xf1df('0xac')]][_0xf1df('0x107')])){delete this['uniqueId'][_0x2d0181[_0xf1df('0xdb')]];this[_0xf1df('0xae')](this[_0xf1df('0x1a')][_0x45163f['queue']]);this[_0xf1df('0x1a')][_0x45163f['queue']][_0xf1df('0x60')]+=0x1;_0x2ffb25=new Hangup(_0x45163f,_0x2d0181);_0x2ffb25[_0xf1df('0xdd')]=0xc;_0x2ffb25[_0xf1df('0xa3')]=_0x2d0181['cause-txt'];_0x2ffb25[_0xf1df('0xfd')]='Unknow';this[_0xf1df('0xc6')](_0x2ffb25)['catch'](loggerCatch(_0xf1df('0x108')));this['moveContactManagedDialer'](_0x2ffb25)[_0xf1df('0xab')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xf1df('0x109')]=function(_0x29e3c7){var _0x218420=this[_0xf1df('0x20')][_0x29e3c7['uniqueid']];if(this['voiceQueues'][_0x29e3c7[_0xf1df('0xac')]]){if(_0x218420&&_0x218420[_0xf1df('0x45')]!==_0xf1df('0x74')){delete this[_0xf1df('0x20')][_0x29e3c7[_0xf1df('0xdb')]];this[_0xf1df('0x1a')][_0x29e3c7['queue']]['outboundAnswerCallsDay']+=0x1;var _0x5d984a=new AgentComplete(_0x218420,_0x29e3c7);if(_0x29e3c7[_0xf1df('0x10a')]==='agent'){_0x5d984a[_0xf1df('0x10b')]=this[_0xf1df('0x1a')][_0x29e3c7[_0xf1df('0xac')]][_0xf1df('0x10c')]&&this[_0xf1df('0x1a')][_0x29e3c7[_0xf1df('0xac')]][_0xf1df('0x10d')]?moment()['format'](_0xf1df('0xf7')):undefined;}this[_0xf1df('0xc6')](_0x5d984a)['catch'](loggerCatch(_0xf1df('0x10e')));this[_0xf1df('0xc4')](_0x5d984a)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x10f')));}}};Dialer[_0xf1df('0xa5')]['syncAgentConnect']=function(_0x4296b4){if(this['voiceQueues'][_0x4296b4[_0xf1df('0xac')]]){if(this[_0xf1df('0x20')][_0x4296b4[_0xf1df('0xdb')]]&&this[_0xf1df('0x20')][_0x4296b4[_0xf1df('0xdb')]][_0xf1df('0x45')]!=='ivr'){this[_0xf1df('0xae')](this['voiceQueues'][_0x4296b4[_0xf1df('0xac')]]);this['uniqueId'][_0x4296b4[_0xf1df('0xdb')]][_0xf1df('0x110')]=moment()[_0xf1df('0x72')](_0xf1df('0xf7'));}}};Dialer['prototype'][_0xf1df('0x111')]=function(_0x1da3cc,_0x63f96f){this[_0xf1df('0xc6')](_0x1da3cc)['catch'](loggerCatch(_0xf1df('0x10e')));if(_0x63f96f==0x0){this['moveContactManagedDialer'](_0x1da3cc)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xf1df('0xa5')]['syncQueueCallerAbandon']=function(_0x4775b7){var _0x513f4d=this['uniqueId'][_0x4775b7[_0xf1df('0xdb')]];var _0x33ec36=this;var _0x227950=![];var _0x21cbb9;var _0xe1f6e2;if(this[_0xf1df('0x1a')][_0x4775b7['queue']]){if(_0x513f4d&&_0x513f4d[_0xf1df('0x45')]!==_0xf1df('0x74')){delete this[_0xf1df('0x20')][_0x4775b7[_0xf1df('0xdb')]];this['updateOriginated'](this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]]);_0x513f4d['droptime']=moment()['format'](_0xf1df('0xf7'));var _0x4ae38c=new QueueCallerAbandon(_0x513f4d,_0x4775b7);if(getSeconds(_0x513f4d[_0xf1df('0x112')],_0x513f4d['responsetime'])>=_0x513f4d[_0xf1df('0x113')]){this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x114')]+=0x1;this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x115')]+=0x1;_0x4ae38c[_0xf1df('0xdd')]=0xa;_0x4ae38c[_0xf1df('0xa3')]=_0xf1df('0x116');_0x4ae38c[_0xf1df('0x117')]=_0xf1df('0x118');_0x4ae38c['agiafterat']=this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x10c')]?moment()['format'](_0xf1df('0xf7')):undefined;_0x4ae38c[_0xf1df('0xff')]+=0x1;_0x4ae38c['countglobal']+=0x1;_0x21cbb9=this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x119')];_0xe1f6e2=this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x11a')];_0x33ec36[_0xf1df('0xb5')](_0x4ae38c,_0x4ae38c[_0xf1df('0xdd')],_0x513f4d[_0xf1df('0x11b')])[_0xf1df('0x33')](function(_0x5887ba){_0x227950=_0x5887ba[_0xf1df('0x11c')]==0x1;if(_0x4ae38c[_0xf1df('0xff')]>=_0x33ec36['voiceQueues'][_0x4775b7[_0xf1df('0xac')]]['dialDropMaxRetry']){_0x33ec36[_0xf1df('0x111')](_0x4ae38c,_0x5887ba['additional']);}else{_0x33ec36['rescheduleContact']({'active':![],'countdropretry':_0x4ae38c[_0xf1df('0xff')],'scheduledat':moment()[_0xf1df('0xf5')](_0x33ec36['voiceQueues'][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x119')],_0xf1df('0x101'))[_0xf1df('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x513f4d['ContactId'],'ListId':_0x513f4d[_0xf1df('0xf9')],'VoiceQueueId':_0x513f4d[_0xf1df('0xce')]||undefined,'CampaignId':_0x513f4d[_0xf1df('0xfa')]||undefined})['catch'](loggerCatch(_0xf1df('0x11d')));var _0x276567=new History(_0x4ae38c);_0x276567['state']=0xa;_0x276567['statedesc']=_0xf1df('0x116');_0x276567['starttime']=moment()['format'](_0xf1df('0xf7'));_0x276567[_0xf1df('0xa4')]=_0x276567[_0xf1df('0x11e')];_0x276567['calleridname']=_0x4ae38c[_0xf1df('0x11f')];_0x276567['calleridnum']=_0x4ae38c['calleridnum'];_0x33ec36['createHistory'](_0x276567)['catch'](loggerCatch(_0xf1df('0x120')));}})[_0xf1df('0x33')](function(){if(_0x227950)_0x33ec36[_0xf1df('0xb6')](_0x4ae38c,_0x21cbb9,_0xe1f6e2)[_0xf1df('0x33')](function(){return 0x1;});});}else{this['voiceQueues'][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x63')]+=0x1;this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x5b')]+=0x1;_0x4ae38c[_0xf1df('0xdd')]=0xb;_0x4ae38c[_0xf1df('0xa3')]='Abandoned';_0x4ae38c['dropreason']=_0xf1df('0x121');_0x4ae38c[_0xf1df('0xee')]+=0x1;_0x4ae38c[_0xf1df('0xe8')]+=0x1;_0x21cbb9=this['voiceQueues'][_0x4775b7[_0xf1df('0xac')]][_0xf1df('0x122')];_0xe1f6e2=this[_0xf1df('0x1a')][_0x4775b7[_0xf1df('0xac')]]['callAdditionalPhoneAfterMin'];_0x33ec36[_0xf1df('0xb5')](_0x4ae38c,_0x4ae38c[_0xf1df('0xdd')],_0x513f4d[_0xf1df('0x11b')])[_0xf1df('0x33')](function(_0x3f0580){if(_0x4ae38c[_0xf1df('0xee')]>=_0x33ec36[_0xf1df('0x1a')][_0x4775b7['queue']][_0xf1df('0x123')]){_0x33ec36['queueCallerAbandonCreateState'](_0x4ae38c,_0x3f0580[_0xf1df('0x11c')]);}else{_0x33ec36[_0xf1df('0xbb')]({'active':![],'countabandonedretry':_0x4ae38c[_0xf1df('0xee')],'scheduledat':moment()[_0xf1df('0xf5')](_0x33ec36['voiceQueues'][_0x4775b7[_0xf1df('0xac')]]['dialAbandonedRetryFrequency'],_0xf1df('0x101'))['format'](_0xf1df('0xf7')),'ContactId':_0x513f4d[_0xf1df('0xf8')],'ListId':_0x513f4d[_0xf1df('0xf9')],'VoiceQueueId':_0x513f4d[_0xf1df('0xce')]||undefined,'CampaignId':_0x513f4d['CampaignId']||undefined})['catch'](loggerCatch(_0xf1df('0x124')));var _0x4f7479=new History(_0x4ae38c);_0x4f7479[_0xf1df('0xdd')]=0xb;_0x4f7479[_0xf1df('0xa3')]=_0xf1df('0x125');_0x4f7479['starttime']=moment()[_0xf1df('0x72')](_0xf1df('0xf7'));_0x4f7479[_0xf1df('0xa4')]=_0x4f7479[_0xf1df('0x11e')];_0x4f7479[_0xf1df('0x11f')]=_0x4ae38c[_0xf1df('0x11f')];_0x4f7479[_0xf1df('0x126')]=_0x4ae38c[_0xf1df('0x126')];_0x33ec36[_0xf1df('0xc6')](_0x4f7479)['catch'](loggerCatch(_0xf1df('0x127')));}})[_0xf1df('0x33')](function(){if(_0x227950)_0x33ec36[_0xf1df('0xb6')](_0x4ae38c,_0x21cbb9,_0xe1f6e2)[_0xf1df('0x33')](function(){return 0x1;});});}}}};Dialer[_0xf1df('0xa5')][_0xf1df('0x2d')]=function(_0x555b4d){if(this[_0xf1df('0x1f')][_0x555b4d[_0xf1df('0xdb')]]){this['actions'][_0x555b4d[_0xf1df('0xdb')]][_0xf1df('0xaa')]=_0x555b4d[_0xf1df('0xaa')];}if(this[_0xf1df('0x20')][_0x555b4d[_0xf1df('0xdb')]]){this[_0xf1df('0x20')][_0x555b4d[_0xf1df('0xdb')]][_0xf1df('0xaa')]=_0x555b4d[_0xf1df('0xaa')];}};Dialer[_0xf1df('0xa5')][_0xf1df('0x128')]=function(_0x55de4c){if(strategy[this[_0xf1df('0x1a')][this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]][_0xf1df('0xac')]][_0xf1df('0x47')]]===_0xf1df('0x16')){if(this[_0xf1df('0x1f')][_0x55de4c['actionid']]&&_[_0xf1df('0xd6')](this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]][_0xf1df('0x12a')])&&_0x55de4c[_0xf1df('0xa9')]==='1'&&_0x55de4c[_0xf1df('0x12b')]==='0'){if(this[_0xf1df('0x1c')][_0x55de4c[_0xf1df('0x12c')]]){if(!this[_0xf1df('0x1c')][_0x55de4c[_0xf1df('0x12c')]]['locked']){this[_0xf1df('0x1c')][_0x55de4c[_0xf1df('0x12c')]][_0xf1df('0x12a')]=!![];this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]][_0xf1df('0x12a')]=!![];this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]][_0xf1df('0x12c')]=_0x55de4c[_0xf1df('0x12c')];}}}}else if((strategy[this[_0xf1df('0x1a')][this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]]['queue']][_0xf1df('0x47')]]||_0xf1df('0x15'))===_0xf1df('0x15')){if(this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]]){if(this[_0xf1df('0x1c')][_0x55de4c[_0xf1df('0x12c')]]){this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]]['stateinterface']=_0x55de4c['stateinterface'];if(_[_0xf1df('0xd6')](this[_0xf1df('0x23')][this[_0xf1df('0x1f')][_0x55de4c['actionid']]['queue']])){this[_0xf1df('0x23')][this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]][_0xf1df('0xac')]]=[];}this[_0xf1df('0x23')][this[_0xf1df('0x1f')][_0x55de4c[_0xf1df('0x129')]][_0xf1df('0xac')]][_0xf1df('0x12d')](_[_0xf1df('0x88')](_['pick'](this['actions'][_0x55de4c[_0xf1df('0x129')]],[_0xf1df('0x12e'),_0xf1df('0x12c')]),{'status':_0x55de4c[_0xf1df('0xa9')],'paused':_0x55de4c['paused']}));}}}};function unlockQueueStatus(_0x19d0fc,_0x5dd863){setTimeout(function(){if(_[_0xf1df('0x82')](_0x19d0fc[_0xf1df('0x12f')])){loggerBooked[_0xf1df('0x91')]('[unlockQueueStatus][undefined]',_0x5dd863);}_0x19d0fc[_0xf1df('0x12f')]=!![];loggerBooked[_0xf1df('0x79')](_0xf1df('0x130'),_0x5dd863,JSON['stringify'](_[_0xf1df('0xcc')](_0x19d0fc,[_0xf1df('0x36'),_0xf1df('0x12f')])));},0x1f3);}Dialer[_0xf1df('0xa5')]['syncQueueStatusComplete']=function(_0x5930c1){var _0x5c9555=this;var _0x1925c8=_0x5c9555[_0xf1df('0x1a')][_0x5c9555[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]['queue']];if(strategy[this[_0xf1df('0x1a')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]['queue']]['strategy']]===_0xf1df('0x16')){if(this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]&&this['actions'][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0x12c')]){this['preview']['run'](this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]['idHopper'],this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]['stateinterface'])['catch'](function(_0x5d1ae6){logger[_0xf1df('0x91')](_0xf1df('0x131'),util[_0xf1df('0x93')](_0x5d1ae6,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5c9555[_0xf1df('0xae')](_0x5c9555['voiceQueues'][_0x5c9555[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]]);_0x5c9555[_0xf1df('0x1c')][_0x5c9555['actions'][_0x5930c1['actionid']][_0xf1df('0x12c')]][_0xf1df('0x12a')]=![];delete _0x5c9555[_0xf1df('0x1f')][_0x5930c1['actionid']];unlockQueueStatus(_0x1925c8);});}else{this[_0xf1df('0xae')](this[_0xf1df('0x1a')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xf8')],'ListId':this['actions'][_0x5930c1[_0xf1df('0x129')]]['ListId'],'VoiceQueueId':this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xce')]||undefined,'CampaignId':this['actions'][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xfa')]||undefined})['catch'](loggerCatch(_0xf1df('0x132')));delete this[_0xf1df('0x1f')][_0x5930c1['actionid']];unlockQueueStatus(_0x1925c8);}}else if((strategy[this[_0xf1df('0x1a')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]][_0xf1df('0x47')]]||_0xf1df('0x15'))===_0xf1df('0x15')){var _0x34aa4f;if(this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]&&!_[_0xf1df('0x77')](this[_0xf1df('0x23')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]])){if(this[_0xf1df('0x24')][_0x5c9555[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]]){this[_0xf1df('0x24')][_0x5c9555[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]['queue']]=this[_0xf1df('0x24')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]]['queue']]?this[_0xf1df('0x24')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]]:this['queueBooked'][this[_0xf1df('0x1f')][_0x5930c1['actionid']][_0xf1df('0xac')]]?this[_0xf1df('0x23')][this['actions'][_0x5930c1[_0xf1df('0x129')]]['queue']][_0xf1df('0x133')]||0x0:0x0;}this[_0xf1df('0x23')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]]['_rr']=this[_0xf1df('0x24')][this[_0xf1df('0x1f')][_0x5930c1[_0xf1df('0x129')]][_0xf1df('0xac')]];for(var _0x1f4da2=0x0;_0x1f4da2=0x0;})[_0xf1df('0xab')](myreject(_0x50ff26)));}}else{_0x3f790f['push'](ami['Action']({'action':'command','command':util['format'](_0xf1df('0x14d'),_0x2fbd65,!_[_0xf1df('0x82')](config[_0xf1df('0x149')][_0xf1ebbd])?_0xf1ebbd:'')})[_0xf1df('0x33')](function(_0x2514a1){return _0x2514a1[_0xf1df('0x14f')][_0xf1df('0x150')](_0xf1df('0x151'))>=0x0;})[_0xf1df('0xab')](myreject(_0x50ff26)));}Promise[_0xf1df('0x152')](_0x3f790f)['then'](function(_0x3860cc){var _0x26dc40=_[_0xf1df('0x153')](_0x3860cc);if(_0x26dc40){return _0x119c79(_0x26dc40);}else{_0x1b886f[_0xf1df('0x38')]=_0x4563a7?_0xf1df('0x154'):_0xf1df('0x155');return _0x50ff26(msgResponse(_0xf1df('0x156'),_0xf1df('0x147'),_0xf1df('0x157')+_0x4563a7+'\x20'+_0x360d5a+_0xf1df('0x158')+util[_0xf1df('0x93')](_0x2fbd65,{'showHidden':![],'depth':null})+_0xf1df('0x159')+_0xf1ebbd));}})[_0xf1df('0xab')](function(_0x582a31){return _0x50ff26(msgResponse(_0xf1df('0x144'),_0xf1df('0x147'),JSON[_0xf1df('0x41')](_0x582a31)));});});};Dialer[_0xf1df('0xa5')]['checkDialMethod']=function(_0x32e514){var _0x51885a=this;return function(){switch(_0x32e514[_0xf1df('0x53')]){case _0xf1df('0x15a'):freeVariablesPredictive(_0x32e514);_0x51885a[_0xf1df('0x15b')](_0x32e514,0x1);break;case _0xf1df('0x15c'):freeVariablesPredictive(_0x32e514);_0x51885a[_0xf1df('0x15b')](_0x32e514,_0x32e514[_0xf1df('0x15d')]);break;case _0xf1df('0x15e'):_0x51885a[_0xf1df('0x15e')](_0x32e514);break;case _0xf1df('0x15f'):freeVariablesPredictive(_0x32e514);_0x51885a['handlePower'](_0x32e514,0x1);break;default:freeVariablesPredictive(_0x32e514);logger['error']('Queue',_0x32e514[_0xf1df('0x36')],'method\x20not\x20recognized');}};};Dialer[_0xf1df('0xa5')][_0xf1df('0x160')]=function(_0x19319c){return Promise[_0xf1df('0xb1')]()['then'](cmHopper[_0xf1df('0x161')](_0x19319c['id'],previewRecallmeReminderInterval))[_0xf1df('0x33')](function(_0x34c3c1){for(var _0x314579=0x0;_0x314579<_0x34c3c1[_0xf1df('0x134')];_0x314579++){var _0x154099=_0x34c3c1[_0x314579][_0xf1df('0x162')]['name'];if(_0x154099)io['to'](util[_0xf1df('0x72')](_0xf1df('0x163'),_0x154099))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x34c3c1[_0x314579]});}})[_0xf1df('0xab')](function(){});};Dialer[_0xf1df('0xa5')][_0xf1df('0x164')]=function(_0xc3c0ce){var _0x4d258f=this;return function(){_0x4d258f['handleIvr'](_0xc3c0ce);};};Dialer[_0xf1df('0xa5')]['syncQueueSummary']=function(_0x6232f2){var _0x41453c=this;if(isNotPreview(_0x6232f2[_0xf1df('0x53')])){if(isVoiceQueueOutbound(_0x6232f2['type'])&&isActive(_0x6232f2[_0xf1df('0x52')])){_0x6232f2[_0xf1df('0x9c')]=!![];Promise[_0xf1df('0xb1')]()[_0xf1df('0x33')](checkIsLoggedIn(_0x6232f2,_0x6232f2['loggedIn']))[_0xf1df('0x33')](checkIsActive(_0x6232f2,_0x6232f2[_0xf1df('0x52')]))[_0xf1df('0x33')](checkInterval(_0x6232f2))['then'](_0x41453c[_0xf1df('0x165')](_0x6232f2))[_0xf1df('0x33')](_0x41453c[_0xf1df('0x143')](_0x6232f2['dialGlobalInterval'],_0x6232f2[_0xf1df('0x166')],_0x6232f2[_0xf1df('0x36')],_0x6232f2))[_0xf1df('0x33')](_0x41453c[_0xf1df('0x145')](_0x6232f2[_0xf1df('0x3b')],_0x6232f2['dialTimezone'],_0x6232f2['name'],_0x6232f2))[_0xf1df('0x33')](_0x41453c[_0xf1df('0x167')](_0x6232f2))[_0xf1df('0xab')](loggerCatchQueueSummary(_0xf1df('0x168'),_0x6232f2));}else{notSendMessagesQueue(_0x6232f2);}}else{freeVariablesPredictive(_0x6232f2);}};Dialer[_0xf1df('0xa5')][_0xf1df('0x2b')]=_[_0xf1df('0x169')](function(){var _0x2706ed=_[_0xf1df('0x16a')](this[_0xf1df('0x1a')],function(_0x4a9f78){return _0x4a9f78[_0xf1df('0x16b')];});var _0xe26ae5=_['filter'](this[_0xf1df('0x1c')],function(_0xa64b1c){return _0xa64b1c[_0xf1df('0x16c')]&&_0xa64b1c['status']===_0xf1df('0xd5');});if(_0x2706ed['length']>0x0&&_0xe26ae5[_0xf1df('0x134')]>0x0){return Promise[_0xf1df('0xb1')]()['then'](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x2706ed,'id'),previewRecallmeReminderInterval,_[_0xf1df('0x16d')](_0xe26ae5,'id')))[_0xf1df('0x33')](function(_0x3f8432){for(var _0x7a60d3=0x0;_0x7a60d3<_0x3f8432[_0xf1df('0x134')];_0x7a60d3++){var _0x21ec77=_0x3f8432[_0x7a60d3][_0xf1df('0x162')][_0xf1df('0x36')];if(_0x21ec77)io['to'](util[_0xf1df('0x72')]('user:%s',_0x21ec77))[_0xf1df('0x44')](_0xf1df('0x16e'),{'hopper':_0x3f8432[_0x7a60d3]});}})[_0xf1df('0xab')](function(_0x2aa2c4){logger[_0xf1df('0x91')]('checkPreviewRecallReminder',_0x2aa2c4);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xf1df('0xa5')]['syncCampaigns']=function(){var _0x3becd1=this;var _0x38f85a;for(var _0x469960 in this['campaigns']){if(typeof this[_0xf1df('0x1b')][_0x469960]!==_0xf1df('0x95')){_0x38f85a=this[_0xf1df('0x1b')][_0x469960];if(isCampaignIvr(_0x38f85a[_0xf1df('0x45')])&&isActive(_0x38f85a[_0xf1df('0x6f')])){_0x38f85a[_0xf1df('0x9c')]=!![];Promise[_0xf1df('0xb1')]()['then'](checkIsActive(_0x38f85a,_0x38f85a[_0xf1df('0x6f')]))[_0xf1df('0x33')](checkInterval(_0x38f85a))[_0xf1df('0x33')](_0x3becd1[_0xf1df('0x165')](_0x38f85a))[_0xf1df('0x33')](_0x3becd1[_0xf1df('0x143')](_0x38f85a[_0xf1df('0x16f')],_0x38f85a[_0xf1df('0x166')],_0x38f85a[_0xf1df('0x36')],_0x38f85a))[_0xf1df('0x33')](_0x3becd1['checkIfTimeIntervals'](_0x38f85a[_0xf1df('0x3b')],_0x38f85a[_0xf1df('0x166')],_0x38f85a['name'],_0x38f85a))[_0xf1df('0x33')](_0x3becd1['launchHandleIvr'](_0x38f85a))[_0xf1df('0xab')](loggerCatchQueueSummary(_0xf1df('0x170'),_0x38f85a));}else{notSendMessagesCampaign(_0x38f85a);}}}};function getCallerIdRandom(_0x5101f1,_0x3c44cc){var _0x4eca14;var _0x2ba479;var _0x34266a;if(_0x3c44cc<=0x0){_0x3c44cc=0x1;}_0x4eca14=new RegExp(_0xf1df('0x171')+_0x3c44cc+'}$');_0x2ba479=Math[_0xf1df('0x172')](0xa,_0x3c44cc-0x1);_0x34266a=Math[_0xf1df('0x172')](0xa,_0x3c44cc)-0x1;return util[_0xf1df('0x72')]('%s',_[_0xf1df('0x173')](_0x5101f1,_0x4eca14,_[_0xf1df('0x174')](_0x2ba479,_0x34266a)));}function extractCalleridName(_0x4dcf32){var _0x5b8fca=_0x4dcf32['match'](/"(.*?)"/);return _0x5b8fca?_0x5b8fca[0x1]:_0x4dcf32;}Dialer[_0xf1df('0xa5')][_0xf1df('0x175')]=function(_0x223861,_0x37c761){var _0x3390f3=this;var _0x5a7322=uuid['v4']();this[_0xf1df('0x1f')][_0x5a7322]=new Action(_0x223861,_0x37c761,_0x5a7322);return new Promise(function(_0xf00e21,_0x3fe124){if(_[_0xf1df('0x82')](_0x223861)&&typeof _0x223861!==_0xf1df('0x176')){return _0x3fe124(msgResponse(_0xf1df('0x177'),_0xf1df('0x147'),'voiceQueue\x20is\x20undefine'));}if(_[_0xf1df('0x82')](_0x37c761[_0xf1df('0x178')])||_0x37c761['phone']===null){return _0x3fe124(msgResponse(_0xf1df('0x177'),_0xf1df('0x147'),'contact\x20is\x20undefine'));}var _0x3a3e4={'XMD-CALLERID':_0x3390f3[_0xf1df('0x1f')][_0x5a7322][_0xf1df('0x179')](),'XMD-AGI':_0x223861['dialQueueProject']?util[_0xf1df('0x72')](_0xf1df('0x17a'),ipAgi,_0x223861[_0xf1df('0x107')]):_0xf1df('0x17b'),'XMD-AGIAFTER':_0x223861[_0xf1df('0x10c')]?util['format'](_0xf1df('0x17a'),ipAgi,_0x223861[_0xf1df('0x10c')]):_0xf1df('0x17b'),'XMD-QUEUE':_0x223861[_0xf1df('0x45')]==='outbound'?util[_0xf1df('0x72')](_0xf1df('0x17c'),_0x223861[_0xf1df('0x36')],_0x223861[_0xf1df('0x17d')]||'',_0x223861['dialAgiAfterHangupAgent']?'c':'',_0x223861[_0xf1df('0x113')]||0x3):_0xf1df('0x17b'),'XMD-CONTACTID':_0x37c761[_0xf1df('0xf8')],'XMD-CDRTYPE':_0xf1df('0x4'),'CALLERID(all)':_0x3390f3[_0xf1df('0x1f')][_0x5a7322][_0xf1df('0x179')](),'XMD-AMD':_0x223861[_0xf1df('0xd9')]?_0xf1df('0x17e'):_0xf1df('0x17b'),'XMD-DESTINATION':_0xf1df('0x17f')};if(_0x223861[_0xf1df('0xd9')]){_0x3a3e4[_0xf1df('0x180')]=_0x223861[_0xf1df('0x181')]||0x9c4;_0x3a3e4['XMD-AMDGREETING']=_0x223861['dialAMDGreeting']||0x5dc;_0x3a3e4['XMD-AMDAFTERGREETINGSILENCE']=_0x223861[_0xf1df('0x182')]||0x320;_0x3a3e4[_0xf1df('0x183')]=_0x223861[_0xf1df('0x184')]||0x1388;_0x3a3e4[_0xf1df('0x185')]=_0x223861[_0xf1df('0x186')]||0x64;_0x3a3e4[_0xf1df('0x187')]=_0x223861[_0xf1df('0x188')]||0x32;_0x3a3e4['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x223861['dialAMDMaximumNumberOfWords']||0x3;_0x3a3e4[_0xf1df('0x189')]=_0x223861['dialAMDSilenceThreshold']||0x100;_0x3a3e4['XMD-AMDMAXIMUMWORDLENGTH']=_0x223861[_0xf1df('0x18a')]||0x1388;}if(_0x223861[_0xf1df('0x45')]==='outbound'){_0x3a3e4[_0xf1df('0x18b')]=_0x37c761[_0xf1df('0xce')];}else{_0x3a3e4[_0xf1df('0x18c')]=_0x37c761[_0xf1df('0xfa')];}for(var _0x1e69aa in _0x37c761['Contact']){if(typeof _0x37c761[_0xf1df('0x18d')][_0x1e69aa]!==_0xf1df('0x95')){if(isNotNull(_0x37c761['Contact'][_0x1e69aa])&&_0x1e69aa!=='id'&&_0x1e69aa!=='tags'&&_0x1e69aa!==_0xf1df('0x18e')&&_0x1e69aa!=='updatedAt'){_0x3a3e4[util[_0xf1df('0x72')](_0xf1df('0x18f'),'XMD-',_[_0xf1df('0x190')](_0x1e69aa))]=_0x37c761['Contact'][_0x1e69aa];}}}var _0x522e53=_0x3390f3[_0xf1df('0xd3')](_0x223861[_0xf1df('0x6e')])?getCallerId(_0x223861[_0xf1df('0x6e')][_0xf1df('0x70')],_0x223861[_0xf1df('0x54')],_0x223861[_0xf1df('0x191')]>0x0?getCallerIdRandom(_0x223861[_0xf1df('0x192')],_0x223861[_0xf1df('0x191')]):_0x223861[_0xf1df('0x192')]):getCallerId(_[_0xf1df('0xd6')](_0x223861['TrunkBackup'])?_0x223861[_0xf1df('0x6e')][_0xf1df('0x70')]:_0x223861[_0xf1df('0x140')][_0xf1df('0x70')],_0x223861['dialOriginateCallerIdName'],_0x223861[_0xf1df('0x191')]>0x0?getCallerIdRandom(_0x223861['dialOriginateCallerIdNumber'],_0x223861[_0xf1df('0x191')]):_0x223861[_0xf1df('0x192')]);if(_0x522e53){_0x3a3e4['XMD-ORIGINATECALLERIDNAME']=_0x3390f3[_0xf1df('0x1f')][_0x5a7322][_0xf1df('0x193')]=extractCalleridName(_0x522e53);_0x3a3e4[_0xf1df('0x194')]=_0x37c761['phone'];}_0x223861['variables']=_0x3a3e4;return ami[_0xf1df('0xa8')]({'actionid':_0x5a7322,'action':_0xf1df('0x177'),'channel':_0x3390f3['isTrunkReachable'](_0x223861['Trunk'])?util[_0xf1df('0x72')]('SIP/%s/%s%s',_0x223861[_0xf1df('0x6e')][_0xf1df('0x36')],isNotNull(_0x223861['dialPrefix'])?_0x223861[_0xf1df('0x56')]['trim']()||'':'',_0x223861['dialCutDigit']>0x0?_0x37c761[_0xf1df('0x178')][_0xf1df('0x195')](_0x223861['dialCutDigit']):_0x37c761[_0xf1df('0x178')]):util[_0xf1df('0x72')]('SIP/%s/%s%s',_[_0xf1df('0xd6')](_0x223861[_0xf1df('0x140')])?_0x223861['Trunk'][_0xf1df('0x36')]:_0x223861[_0xf1df('0x140')][_0xf1df('0x36')],isNotNull(_0x223861[_0xf1df('0x56')])?_0x223861[_0xf1df('0x56')]['trim']()||'':'',_0x223861[_0xf1df('0x196')]>0x0?_0x37c761[_0xf1df('0x178')][_0xf1df('0x195')](_0x223861[_0xf1df('0x196')]):_0x37c761['phone']),'callerid':_0x522e53,'Exten':_0xf1df('0x17f'),'Context':_0xf1df('0x197'),'Priority':'1','variable':_0x3a3e4,'timeout':(_0x223861[_0xf1df('0x55')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5a7322})['then'](function(_0x1dca86){return _0xf00e21(_0x1dca86);})['catch'](function(_0x19f7c1){_0x223861['outboundOriginateFailureCallsDay']+=0x1;var _0x148283=new History(_0x3390f3[_0xf1df('0x1f')][_0x5a7322]);logger['error'](util['format'](_0xf1df('0x198'),JSON[_0xf1df('0x41')](_0x19f7c1)));_0x148283['state']=0xe;_0x148283[_0xf1df('0xa3')]=_0xf1df('0x199');_0x148283['starttime']=moment()['format'](_0xf1df('0xf7'));_0x148283['endtime']=_0x148283['starttime'];_0x3390f3[_0xf1df('0xc6')](_0x148283)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x19a')));_0x3390f3[_0xf1df('0xc4')](_0x148283)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x19a')))['finally'](function(){delete _0x3390f3[_0xf1df('0x1f')][_0x5a7322];return _0x3fe124(msgResponse('originate','Error',_0xf1df('0x19b')));});});});};Dialer[_0xf1df('0xa5')]['syncOriginateResponse']=function(_0xac18dd){var _0x74bba1=this['actions'][_0xac18dd[_0xf1df('0x129')]];if(_0x74bba1){delete this[_0xf1df('0x1f')][_0xac18dd[_0xf1df('0x129')]];_0x74bba1[_0xf1df('0x19c')]=moment()[_0xf1df('0x72')](_0xf1df('0xf7'));var _0x314551=_0x74bba1[_0xf1df('0x45')]===_0xf1df('0x74')?this[_0xf1df('0x1b')][_0x74bba1[_0xf1df('0xac')]]:this[_0xf1df('0x1a')][_0x74bba1[_0xf1df('0x19d')]()];if(!this['isSuccess'](_0xac18dd[_0xf1df('0x19e')])){this[_0xf1df('0xae')](_0x314551);return this[_0xf1df('0x19f')](_0x74bba1,_0x314551,_0xac18dd)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0xf1df('0x20')][_0xac18dd[_0xf1df('0xdb')]]=_0x74bba1;}};Dialer['prototype'][_0xf1df('0x1a0')]=function(_0x155e0e,_0x248546,_0x41fe3d){var _0x55efdc=new History(_0x248546);if(_0x55efdc[_0xf1df('0xea')]+_0x55efdc[_0xf1df('0xeb')]+_0x55efdc['countnoanswerretry']+_0x55efdc[_0xf1df('0xed')]+_0x55efdc[_0xf1df('0xff')]+_0x55efdc[_0xf1df('0xee')]+_0x55efdc['countmachineretry']+_0x55efdc[_0xf1df('0xef')]>=_0x41fe3d[_0xf1df('0x100')]-0x1){return!![];}switch(_0x155e0e){case 0x3:if(_0x55efdc['countnoanswerretry']>=_0x41fe3d[_0xf1df('0x1a1')]-0x1){return!![];}this[_0xf1df('0xbb')]({'active':![],'countnoanswerretry':_0x55efdc[_0xf1df('0xec')]+=0x1,'scheduledat':moment()[_0xf1df('0xf5')](_0x41fe3d['dialNoAnswerRetryFrequency'],_0xf1df('0x101'))['format'](_0xf1df('0xf7')),'ContactId':_0x55efdc['ContactId'],'ListId':_0x55efdc[_0xf1df('0xf9')],'VoiceQueueId':_0x55efdc['VoiceQueueId']||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x55efdc[_0xf1df('0xea')]>=_0x41fe3d[_0xf1df('0x1a2')]-0x1){return!![];}this[_0xf1df('0xbb')]({'active':![],'countbusyretry':_0x55efdc[_0xf1df('0xea')]+=0x1,'scheduledat':moment()[_0xf1df('0xf5')](_0x41fe3d[_0xf1df('0x1a3')],_0xf1df('0x101'))[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x55efdc['ContactId'],'ListId':_0x55efdc[_0xf1df('0xf9')],'VoiceQueueId':_0x55efdc[_0xf1df('0xce')]||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch(_0xf1df('0x1a4')));break;case 0x8:if(_0x55efdc[_0xf1df('0xeb')]>=_0x41fe3d[_0xf1df('0x1a5')]-0x1){return!![];}this[_0xf1df('0xbb')]({'active':![],'countcongestionretry':_0x55efdc[_0xf1df('0xeb')]+=0x1,'scheduledat':moment()[_0xf1df('0xf5')](_0x41fe3d['dialCongestionRetryFrequency'],_0xf1df('0x101'))['format'](_0xf1df('0xf7')),'ContactId':_0x55efdc[_0xf1df('0xf8')],'ListId':_0x55efdc['ListId'],'VoiceQueueId':_0x55efdc['VoiceQueueId']||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x55efdc['countnosuchnumberretry']>=_0x41fe3d[_0xf1df('0x1a6')]-0x1){return!![];}else{this[_0xf1df('0xbb')]({'active':![],'countnosuchnumberretry':_0x55efdc[_0xf1df('0xed')]+=0x1,'scheduledat':moment()[_0xf1df('0xf5')](_0x41fe3d['dialNoSuchNumberRetryFrequency'],_0xf1df('0x101'))[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x55efdc['ContactId'],'ListId':_0x55efdc[_0xf1df('0xf9')],'VoiceQueueId':_0x55efdc[_0xf1df('0xce')]||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})['catch'](loggerCatch(_0xf1df('0x1a7')));}break;case 0xa:if(_0x55efdc[_0xf1df('0xff')]>=_0x41fe3d[_0xf1df('0x1a8')]-0x1){return!![];}this[_0xf1df('0xbb')]({'active':![],'countdropretry':_0x55efdc[_0xf1df('0xff')]+=0x1,'scheduledat':moment()[_0xf1df('0xf5')](_0x41fe3d[_0xf1df('0x119')],_0xf1df('0x101'))[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x55efdc[_0xf1df('0xf8')],'ListId':_0x55efdc[_0xf1df('0xf9')],'VoiceQueueId':_0x55efdc[_0xf1df('0xce')]||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x55efdc[_0xf1df('0xee')]>=_0x41fe3d[_0xf1df('0x123')]-0x1){return!![];}this[_0xf1df('0xbb')]({'active':![],'countabandonedretry':_0x55efdc[_0xf1df('0xee')]+=0x1,'scheduledat':moment()['add'](_0x41fe3d[_0xf1df('0x122')],_0xf1df('0x101'))[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x55efdc[_0xf1df('0xf8')],'ListId':_0x55efdc[_0xf1df('0xf9')],'VoiceQueueId':_0x55efdc[_0xf1df('0xce')]||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x55efdc[_0xf1df('0xe7')]>=_0x41fe3d[_0xf1df('0xf2')]-0x1){return!![];}this[_0xf1df('0xbb')]({'active':![],'countmachineretry':_0x55efdc[_0xf1df('0xe7')]+=0x1,'scheduledat':moment()[_0xf1df('0xf5')](_0x41fe3d[_0xf1df('0xf6')],_0xf1df('0x101'))[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x55efdc['ContactId'],'ListId':_0x55efdc[_0xf1df('0xf9')],'VoiceQueueId':_0x55efdc['VoiceQueueId']||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch(_0xf1df('0xfb')));break;case 0x14:if(_0x55efdc['countagentrejectretry']>=_0x41fe3d[_0xf1df('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x55efdc[_0xf1df('0xef')]+=0x1,'scheduledat':moment()['add'](_0x41fe3d[_0xf1df('0x1aa')],_0xf1df('0x101'))[_0xf1df('0x72')](_0xf1df('0xf7')),'ContactId':_0x55efdc['ContactId'],'ListId':_0x55efdc['ListId'],'VoiceQueueId':_0x55efdc[_0xf1df('0xce')]||undefined,'CampaignId':_0x55efdc[_0xf1df('0xfa')]||undefined})[_0xf1df('0xab')](loggerCatch(_0xf1df('0x1ab')));break;default:return!![];}};Dialer[_0xf1df('0xa5')]['callProgressDetecting']=function(_0x53064e,_0x207731,_0x56d5bf){var _0x223507=this;var _0x28032d=new History(_0x53064e);var _0x378947=![];var _0x1306d1;var _0xf9ada8;return new Promise(function(_0x1b852b,_0x3280ae){if(_[_0xf1df('0x82')](_0x207731)&&typeof _0x207731!==_0xf1df('0x176')){return _0x3280ae(msgResponse(_0xf1df('0x1ac'),_0xf1df('0x147'),'entity\x20is\x20undefine'));}if(_[_0xf1df('0x82')](_0x56d5bf)&&typeof _0x56d5bf!==_0xf1df('0x176')){return _0x3280ae(msgResponse(_0xf1df('0x1ac'),_0xf1df('0x147'),_0xf1df('0x1ad')));}_0x223507['verifyAdditionalPhones'](_0x28032d,_0x56d5bf[_0xf1df('0x10a')],_0x207731)[_0xf1df('0x33')](function(_0x471e5b){if(_0x471e5b[_0xf1df('0x11c')]==0x1)_0x378947=!![];switch(_0x56d5bf[_0xf1df('0x10a')]){case'0':_0x207731[_0xf1df('0x5d')]+=0x1;_0x28032d['state']=0x0;_0x28032d[_0xf1df('0xa3')]='NoSuchNumber';_0x28032d[_0xf1df('0xed')]+=0x1;_0x28032d[_0xf1df('0xe8')]+=0x1;ami[_0xf1df('0x44')](_0xf1df('0x1ae'),ut[_0xf1df('0xe1')](_0x53064e,_0xf1df('0x1af')));_0x1306d1=_0x207731[_0xf1df('0x1b0')];_0xf9ada8=_0x207731['callAdditionalPhoneAfterMin'];_0x223507['createHistory'](_0x28032d)[_0xf1df('0xab')](loggerCatch(_0xf1df('0xe9')));if(_0x223507[_0xf1df('0x1a0')](0x0,_0x53064e,_0x207731)&&!_0x378947){if(_0x28032d[_0xf1df('0xed')]>=_0x207731[_0xf1df('0x1a6')]){_0x223507[_0xf1df('0xf3')](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1b1'));}else{_0x223507['stateGlobal'](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1b1'));}}break;case'3':_0x207731['outboundNoAnswerCallsDay']+=0x1;_0x28032d[_0xf1df('0xdd')]=0x3;_0x28032d['statedesc']=_0xf1df('0x1b2');_0x28032d[_0xf1df('0xec')]+=0x1;_0x28032d['countglobal']+=0x1;var _0x4686e1=ut[_0xf1df('0x1b3')](_0x53064e,_0x207731);ami[_0xf1df('0x44')](_0xf1df('0x1b4'),_0x4686e1);_0x1306d1=_0x207731['dialNoAnswerRetryFrequency'];_0xf9ada8=_0x207731[_0xf1df('0x11a')];_0x223507[_0xf1df('0xc6')](_0x28032d)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x1b5')));if(_0x223507[_0xf1df('0x1a0')](0x3,_0x53064e,_0x207731)&&!_0x378947){if(_0x28032d['countnoanswerretry']>=_0x207731[_0xf1df('0x1a1')]){_0x223507[_0xf1df('0xf3')](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1b6'));}else{_0x223507[_0xf1df('0xf0')](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1b6'));}}break;case'5':_0x207731[_0xf1df('0x58')]+=0x1;_0x28032d[_0xf1df('0xdd')]=0x5;_0x28032d['statedesc']=_0xf1df('0x1b7');_0x28032d['countbusyretry']+=0x1;_0x28032d['countglobal']+=0x1;ami[_0xf1df('0x44')]('custom:agentbusy',ut[_0xf1df('0xe1')](_0x53064e,_0xf1df('0x1b8')));_0x1306d1=_0x207731[_0xf1df('0x1a3')];_0xf9ada8=_0x207731[_0xf1df('0x11a')];_0x223507[_0xf1df('0xc6')](_0x28032d)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x1b9')));if(_0x223507[_0xf1df('0x1a0')](0x5,_0x53064e,_0x207731)&&!_0x378947){if(_0x28032d[_0xf1df('0xea')]>=_0x207731[_0xf1df('0x1a2')]){_0x223507[_0xf1df('0xf3')](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1ba'));}else{_0x223507[_0xf1df('0xf0')](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1ba'));}}break;case'8':_0x207731['outboundCongestionCallsDay']+=0x1;_0x28032d[_0xf1df('0xdd')]=0x8;_0x28032d[_0xf1df('0xa3')]='Congestion';_0x28032d[_0xf1df('0xeb')]+=0x1;_0x28032d[_0xf1df('0xe8')]+=0x1;_0x1306d1=_0x207731['dialCongestionRetryFrequency'];_0xf9ada8=_0x207731[_0xf1df('0x11a')];ami[_0xf1df('0x44')](_0xf1df('0x1bb'),ut[_0xf1df('0xe1')](_0x53064e,'congestion'));_0x223507[_0xf1df('0xc6')](_0x28032d)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x1bc')));if(_0x223507[_0xf1df('0x1a0')](0x8,_0x53064e,_0x207731)&&!_0x378947){if(_0x28032d['countcongestionretry']>=_0x207731[_0xf1df('0x1a5')]){_0x223507['createStateFinal'](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1bd'));}else{_0x223507[_0xf1df('0xf0')](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1bd'));}}break;case'11':_0x207731['outboundAbandonedCallsDay']+=0x1;_0x28032d[_0xf1df('0xdd')]=0xb;_0x28032d[_0xf1df('0xa3')]=_0xf1df('0x125');_0x28032d[_0xf1df('0xee')]+=0x1;_0x28032d[_0xf1df('0xe8')]+=0x1;_0x1306d1=_0x207731['dialAbandonedRetryFrequency'];_0xf9ada8=_0x207731[_0xf1df('0x11a')];_0x223507[_0xf1df('0xc6')](_0x28032d)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x127')));if(_0x223507[_0xf1df('0x1a0')](0xb,_0x53064e,_0x207731)&&!_0x378947){if(_0x28032d[_0xf1df('0xee')]>=_0x207731[_0xf1df('0x123')]){_0x223507['createStateFinal'](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1be'));}else{_0x223507['stateGlobal'](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1be'));}}break;case'20':_0x207731[_0xf1df('0x1bf')]+=0x1;_0x28032d[_0xf1df('0xdd')]=0x14;_0x28032d[_0xf1df('0xa3')]=_0xf1df('0x1c0');_0x28032d[_0xf1df('0xef')]+=0x1;_0x28032d[_0xf1df('0xe8')]+=0x1;_0x1306d1=_0x207731['dialAgentRejectRetryFrequency'];_0xf9ada8=_0x207731['callAdditionalPhoneAfterMin'];ami[_0xf1df('0x44')](_0xf1df('0x1c1'),ut[_0xf1df('0xe1')](_0x53064e,_0xf1df('0x1c2')));_0x223507[_0xf1df('0xc6')](_0x28032d)[_0xf1df('0xab')](loggerCatch(_0xf1df('0x1c3')));if(_0x223507['checkRetriveMax'](0x14,_0x53064e,_0x207731)&&!_0x378947){if(_0x28032d[_0xf1df('0xef')]>=_0x207731[_0xf1df('0x1a9')]){_0x223507[_0xf1df('0xf3')](_0x28032d,_0x1b852b,_0x3280ae,'reason\x2020\x20agentreject');}else{_0x223507[_0xf1df('0xf0')](_0x28032d,_0x1b852b,_0x3280ae,_0xf1df('0x1c4'));}}break;default:_0x207731[_0xf1df('0x60')]+=0x1;_0x28032d[_0xf1df('0xdd')]=0xc;_0x28032d['statedesc']=_0x56d5bf[_0xf1df('0x10a')];_0x1306d1=_0x207731[_0xf1df('0x1aa')];_0xf9ada8=_0x207731['callAdditionalPhoneAfterMin'];_0x223507[_0xf1df('0xc6')](_0x28032d)['catch'](loggerCatch(_0xf1df('0x1c5')));if(_0x223507[_0xf1df('0x1a0')](_0x56d5bf[_0xf1df('0x10a')],_0x53064e,_0x207731)&&!_0x378947){if(_0x28032d[_0xf1df('0xea')]+_0x28032d['countcongestionretry']+_0x28032d[_0xf1df('0xec')]+_0x28032d[_0xf1df('0xed')]+_0x28032d[_0xf1df('0xff')]+_0x28032d['countabandonedretry']+_0x28032d[_0xf1df('0xe7')]+_0x28032d[_0xf1df('0xef')]>=_0x207731['dialGlobalMaxRetry']){_0x223507[_0xf1df('0xf0')](_0x28032d,_0x1b852b,_0x3280ae,_0x56d5bf[_0xf1df('0x10a')]);}else{_0x223507[_0xf1df('0xf3')](_0x28032d,_0x1b852b,_0x3280ae,_0x56d5bf[_0xf1df('0x10a')]);}}}})[_0xf1df('0x33')](function(){if(_0x378947){_0x223507[_0xf1df('0xb6')](_0x28032d,_0x1306d1,_0xf9ada8)['then'](function(){return _0x1b852b(0x1);});}});});};Dialer[_0xf1df('0xa5')][_0xf1df('0xf0')]=function(_0x3359e2,_0x4e31c8,_0x1ed1ea,_0x3c3759){var _0x50042a=new Final(_0x3359e2);_0x50042a[_0xf1df('0xdd')]=0xf;_0x50042a['statedesc']=_0xf1df('0x1c6');this[_0xf1df('0xf3')](_0x50042a,_0x4e31c8,_0x1ed1ea,_0x3c3759);};Dialer[_0xf1df('0xa5')][_0xf1df('0xf3')]=function(_0x397756,_0x562d4f,_0x6c6264,_0x5636b4){this[_0xf1df('0xc4')](_0x397756)[_0xf1df('0x33')](function(){return _0x562d4f(msgResponse(_0xf1df('0x1ac'),_0xf1df('0xd2'),_0x5636b4));})[_0xf1df('0xab')](function(){return _0x6c6264(msgResponse('[moveContactManagedDialer][0]',_0xf1df('0x147'),_0xf1df('0x1c7')));});};Dialer[_0xf1df('0xa5')][_0xf1df('0x15e')]=function(_0x43d92d){var _0x2c7119=_0x43d92d[_0xf1df('0x1c8')]/0x64;var _0x16746c=_0x43d92d[_0xf1df('0x114')]/(_0x43d92d[_0xf1df('0x114')]+_0x43d92d[_0xf1df('0x57')]);var _0x399aad=Math[_0xf1df('0x1c9')](_0x43d92d[_0xf1df('0x1ca')]*(_0x43d92d[_0xf1df('0x1cb')]/0x64));var _0xf754eb=Math['round'](_0x43d92d[_0xf1df('0x1ca')]*(_0x43d92d[_0xf1df('0x1cc')]/0x64));var _0x58b1f6=_0x43d92d['available']+_0x43d92d['talking'];var _0x2cff21=Math['floor'](_0x43d92d[_0xf1df('0x69')]*_0x43d92d[_0xf1df('0x6b')]*_0x43d92d[_0xf1df('0x66')]*_0x43d92d[_0xf1df('0x1cd')]);if(_[_0xf1df('0x82')](_0x43d92d[_0xf1df('0x21')])){if(!_[_0xf1df('0x82')](_0x43d92d[_0xf1df('0x6d')])){_0x43d92d['startPredictive']=undefined;loggerPredictive[_0xf1df('0x91')](_0xf1df('0x1ce'),_0xf1df('0x1cf'));}if(!_[_0xf1df('0x82')](_0x43d92d[_0xf1df('0x8c')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xf1df('0x1d0'));clearInterval(_0x43d92d[_0xf1df('0x8c')]);_0x43d92d['handlePredictive']=undefined;}_0x43d92d[_0xf1df('0x21')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x43d92d[_0xf1df('0x36')],_0xf1df('0x1d1'),_0x43d92d[_0xf1df('0x21')]);this[_0xf1df('0x15b')](_0x43d92d,0x1);}else if(ifInterval(_0x43d92d['dialPredictiveInterval'],_0x43d92d[_0xf1df('0x21')])){this['handlePower'](_0x43d92d,0x1);loggerPredictiveCalls[_0xf1df('0x79')](_0xf1df('0x1d2'),_0x43d92d[_0xf1df('0x21')],_0x43d92d['name']);_0x43d92d[_0xf1df('0x69')]=0x0;_0x43d92d['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x2c7119<_0x16746c&&_0x43d92d[_0xf1df('0x1d3')]===_0xf1df('0x1d4')){freeVariablesPredictive(_0x43d92d);loggerPredictive['info'](_0xf1df('0x1d5'),_0xf1df('0x1d6'),_0x16746c,'startProgressive',_0x43d92d[_0xf1df('0x36')]);}else if(_0x2cff21<_0x43d92d[_0xf1df('0x115')]&&_0x43d92d[_0xf1df('0x1d3')]==='dropRate'){freeVariablesPredictive(_0x43d92d);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x1d7'),'Max\x20Drop\x20',_0x2cff21,_0xf1df('0x1d8'),_0x43d92d[_0xf1df('0x115')],_0xf1df('0x21'),_0x43d92d[_0xf1df('0x36')]);}else if(!ifInterval(_0x43d92d[_0xf1df('0x1d9')],_0x43d92d[_0xf1df('0x21')])&&_[_0xf1df('0x82')](_0x43d92d[_0xf1df('0x6d')])&&!_[_0xf1df('0x82')](_0x43d92d[_0xf1df('0x21')])){_0x43d92d['startPredictive']=moment()['format'](_0xf1df('0xf7'));loggerPredictive[_0xf1df('0x79')](_0x43d92d['name'],'started\x20in\x20predictive\x20at',_0x43d92d['startPredictive']);this[_0xf1df('0xba')](_0x43d92d['dialPredictiveInterval'])[_0xf1df('0x33')](this[_0xf1df('0x1da')](_0x43d92d))[_0xf1df('0x33')](mergeDataErlangB(_0x43d92d))[_0xf1df('0x33')](this['startMethodPredictive'](_0x43d92d))[_0xf1df('0xab')](loggerCatchPredictive(_0xf1df('0x1db'),_0x43d92d));}else if(!ifInterval(_0x43d92d[_0xf1df('0x1d9')],_0x43d92d[_0xf1df('0x6d')])){_0x43d92d['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x43d92d[_0xf1df('0x6d')]=moment()[_0xf1df('0x72')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf1df('0x79')](_0x43d92d['name'],_0xf1df('0x1dc'),_0x43d92d[_0xf1df('0x6d')]);clearInterval(_0x43d92d[_0xf1df('0x8c')]);_0x43d92d[_0xf1df('0x8c')]=undefined;this[_0xf1df('0xba')](_0x43d92d[_0xf1df('0x1d9')])[_0xf1df('0x33')](this[_0xf1df('0x1da')](_0x43d92d))[_0xf1df('0x33')](mergeDataErlangB(_0x43d92d))['then'](this['startMethodPredictive'](_0x43d92d))[_0xf1df('0xab')](loggerCatchPredictive(_0xf1df('0x1dd'),_0x43d92d));}else if(_0x43d92d[_0xf1df('0x1ca')]&&_0x58b1f6<_0x43d92d[_0xf1df('0x1ca')]-_0xf754eb){freeVariablesPredictive(_0x43d92d);loggerPredictive[_0xf1df('0x79')](_0x43d92d['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x58b1f6,_0xf1df('0x1de'),_0x43d92d[_0xf1df('0x1ca')],'-',_0xf754eb,'=',_0x43d92d[_0xf1df('0x1ca')]-_0xf754eb,')');}else if(_0x43d92d[_0xf1df('0x1ca')]&&_0x58b1f6>_0x43d92d['predictiveIntervalAvailable']+_0x399aad){freeVariablesPredictive(_0x43d92d);loggerPredictive['info'](_0x43d92d[_0xf1df('0x36')],_0xf1df('0x1df'),_0x58b1f6,')\x20are\x20more\x20than\x20threshold\x20(',_0x43d92d[_0xf1df('0x1ca')],'+',_0x399aad,'=',_0x43d92d['predictiveIntervalAvailable']+_0x399aad,')');}};Dialer[_0xf1df('0xa5')]['getDataPredictive']=function(_0x488ee7){var _0x3d5dc1=this;return function(_0x1fb37c){return new Promise(function(_0x45a97a,_0x338d35){_[_0xf1df('0x88')](_0x488ee7,_0x1fb37c[0x0]);if(checkGetDataPredictive(_0x1fb37c[0x0])){var _0x20ce14=_0x488ee7[_0xf1df('0x1ca')]=_0x488ee7[_0xf1df('0x4d')]+_0x488ee7[_0xf1df('0x9d')];var _0xc254dd=_0x488ee7[_0xf1df('0x1d9')]*0x3c;var _0x14b9e2=_0x1fb37c[0x0][_0xf1df('0x62')]+_0x1fb37c[0x0][_0xf1df('0x61')];var _0x748a21=(_0x1fb37c[0x0][_0xf1df('0x7c')]+_0x1fb37c[0x0][_0xf1df('0x64')]+_0x1fb37c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1fb37c[0x0][_0xf1df('0x68')];_0x488ee7['predictiveIntervalHitRate']=_0x748a21>0x0?_0x748a21:0x1;switch(_0x488ee7[_0xf1df('0x1d3')]){case _0xf1df('0x1d4'):var _0xe7272f=_0x488ee7['dialPredictiveOptimizationPercentage']/0x64;return _0x3d5dc1[_0xf1df('0x1e0')](_0x20ce14,_0xc254dd,_0x14b9e2,_0x748a21,_0xe7272f)['then'](function(_0x4b7bca){return _0x45a97a(_0x4b7bca);});case _0xf1df('0x1e1'):var _0x1c4313=_0x488ee7[_0xf1df('0x1c8')]/0x64;return _0x3d5dc1[_0xf1df('0x1e2')](_0x20ce14,_0xc254dd,_0x14b9e2,_0x748a21,_0x1c4313)['then'](function(_0xce7c28){return _0x45a97a(_0xce7c28);});default:return _0x338d35(msgResponse(_0xf1df('0x1e3'),_0xf1df('0x147'),_0xf1df('0x1e4')));}}else{return _0x338d35(msgResponse('[getDataPredictive]',_0xf1df('0x147'),'check\x20failure'));}});};};Dialer[_0xf1df('0xa5')][_0xf1df('0x1e5')]=function(_0x2be463){var _0x5dcebf=this;return function(_0x2c0d5b){return new Promise(function(_0x3e6465,_0x21c897){_[_0xf1df('0x88')](_0x2be463,_0x2c0d5b[0x0]);if(checkGetDataPredictive(_0x2c0d5b[0x0])){loggerPredictive[_0xf1df('0x79')](JSON[_0xf1df('0x41')](_0x2c0d5b[0x0]));if(_0x2be463[_0xf1df('0x1d3')]===_0xf1df('0x1d4')){return _0x5dcebf['getVoiceQueueRtPauses'](_0x2be463['id'])[_0xf1df('0x33')](function(_0x42a58b){var _0x566359=_0x2be463['loggedIn']-_0x42a58b[0x0][_0xf1df('0x1e6')];var _0x5a09de=_0x2be463[_0xf1df('0x1d9')]*0x3c;var _0x210736=_0x2c0d5b[0x0][_0xf1df('0x62')]+_0x2c0d5b[0x0][_0xf1df('0x61')];var _0x585f2a=(_0x2c0d5b[0x0][_0xf1df('0x7c')]+_0x2c0d5b[0x0][_0xf1df('0x64')]+_0x2c0d5b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2c0d5b[0x0]['predictiveIntervalTotalCalls'];var _0x492e43=_0x2be463[_0xf1df('0x1c8')]/0x64;_0x2be463[_0xf1df('0x67')]=_0x42a58b[0x0][_0xf1df('0x1e6')]||0x0;_0x2be463['predictiveIntervalHitRate']=_0x585f2a>0x0?_0x585f2a:0x1;return _0x5dcebf['abandonmentRate'](_0x566359,_0x5a09de,_0x210736,_0x585f2a,_0x492e43);})['then'](function(_0x17d39d){return _0x3e6465(_0x17d39d);})[_0xf1df('0xab')](function(_0x441261){return _0x21c897(msgResponse(_0xf1df('0x1e7'),_0xf1df('0x147'),JSON['stringify'](_0x441261)));});}if(_0x2be463['dialPredictiveOptimization']===_0xf1df('0x1e1')){return _0x5dcebf[_0xf1df('0xc2')](_0x2be463['id'])[_0xf1df('0x33')](function(_0x36189b){var _0x3020b1=_0x2be463[_0xf1df('0x49')]-_0x36189b[0x0][_0xf1df('0x1e6')];var _0x4ac47a=_0x2be463[_0xf1df('0x1d9')]*0x3c;var _0x25e6da=_0x2c0d5b[0x0][_0xf1df('0x62')]+_0x2c0d5b[0x0][_0xf1df('0x61')];var _0x14bf70=(_0x2c0d5b[0x0][_0xf1df('0x7c')]+_0x2c0d5b[0x0][_0xf1df('0x64')]+_0x2c0d5b[0x0][_0xf1df('0x63')])/_0x2c0d5b[0x0][_0xf1df('0x68')];var _0x293438=_0x2be463[_0xf1df('0x1c8')]/0x64;_0x2be463['predictiveIntervalPauses']=_0x36189b[0x0]['outboundQueuePauses']||0x0;_0x2be463[_0xf1df('0x66')]=_0x14bf70>0x0?_0x14bf70:0x1;return _0x5dcebf[_0xf1df('0x1e2')](_0x3020b1,_0x4ac47a,_0x25e6da,_0x14bf70,_0x293438);})['then'](function(_0x42748d){return _0x3e6465(_0x42748d);})[_0xf1df('0xab')](function(_0x88cd18){return _0x21c897(msgResponse('[CatchErlangB]',_0xf1df('0x147'),JSON[_0xf1df('0x41')](_0x88cd18)));});}}else{return _0x21c897(msgResponse(_0xf1df('0x1e3'),_0xf1df('0x147'),_0xf1df('0x1e8')));}});};};Dialer[_0xf1df('0xa5')]['startMethodPredictive']=function(_0x4b8d61){var _0x34308c=this;return function(){var _0x5cc2a7=0x0;var _0x5ce43c=Math[_0xf1df('0x1e9')](_0x4b8d61[_0xf1df('0x6a')]*0x3e8);if(_0x5ce43c>0x0){_0x5ce43c=_0x5ce43c<0x64?0x64:_0x5ce43c;loggerPredictive[_0xf1df('0x79')](_0x4b8d61[_0xf1df('0x36')],_0xf1df('0x1ea'),_0x5ce43c,'milliseconds');_0x4b8d61[_0xf1df('0x8c')]=setInterval(function(){_0x34308c[_0xf1df('0x8c')](_0x4b8d61);loggerPredictiveCalls[_0xf1df('0x79')](_0xf1df('0x1eb'),_0x5cc2a7+=0x1);},_0x5ce43c);}else{loggerPredictive['info'](_0x4b8d61[_0xf1df('0x36')],_0xf1df('0x1ec'));}};};Dialer[_0xf1df('0xa5')]['checkContactBlack']=function(_0x3e648d,_0x2bca9e){var _0x412a4c=this;return function(_0x32b0c2){if(_['isEmpty'](_0x32b0c2)){if(_[_0xf1df('0xd6')](_0x2bca9e[_0xf1df('0xcd')])||!_0x2bca9e[_0xf1df('0x1ed')]){if(_0x3e648d[_0xf1df('0x53')]===_0xf1df('0x15f')){_0x3e648d[_0xf1df('0x12f')]=_[_0xf1df('0x82')](_0x3e648d[_0xf1df('0x12f')])?!![]:_0x3e648d[_0xf1df('0x12f')];var _0x14aff3=uuid['v4']();_0x412a4c[_0xf1df('0x1f')][_0x14aff3]=new Action(_0x3e648d,_0x2bca9e,_0x14aff3);loggerBooked['info'](_0xf1df('0x1ee'),_0x14aff3,_0xf1df('0x1ef'),JSON['stringify'](_0x3e648d[_0xf1df('0x12f')]),_0xf1df('0x1f0'),_0x3e648d[_0xf1df('0x36')]);if(_0x3e648d[_0xf1df('0x12f')]){_0x3e648d[_0xf1df('0x12f')]=![];_0x412a4c[_0xf1df('0x23')][_0x412a4c[_0xf1df('0x1f')][_0x14aff3][_0xf1df('0xac')]]=[];ami['Action']({'actionid':_0x14aff3,'action':'queuestatus','queue':_0x3e648d[_0xf1df('0x36')]})[_0xf1df('0xab')](function(){_0x412a4c[_0xf1df('0xae')](_0x3e648d);_0x412a4c[_0xf1df('0xbb')]({'active':![],'ContactId':_0x412a4c[_0xf1df('0x1f')][_0x14aff3][_0xf1df('0xf8')],'ListId':_0x412a4c[_0xf1df('0x1f')][_0x14aff3][_0xf1df('0xf9')],'VoiceQueueId':_0x412a4c[_0xf1df('0x1f')][_0x14aff3][_0xf1df('0xce')]||undefined,'CampaignId':_0x412a4c['actions'][_0x14aff3][_0xf1df('0xfa')]||undefined})['catch'](loggerCatch(_0xf1df('0x1f1')));delete _0x412a4c[_0xf1df('0x1f')][_0x14aff3];});}else{loggerBooked[_0xf1df('0x79')]('[booked][checkContactBlack][else]',JSON[_0xf1df('0x41')](_0x3e648d['queueStatusComplete']),_0xf1df('0x1f0'),_0x3e648d[_0xf1df('0x36')]);_0x412a4c[_0xf1df('0xae')](_0x3e648d);_0x412a4c[_0xf1df('0xbb')]({'active':![],'ContactId':_0x412a4c['actions'][_0x14aff3][_0xf1df('0xf8')],'ListId':_0x412a4c['actions'][_0x14aff3][_0xf1df('0xf9')],'VoiceQueueId':_0x412a4c[_0xf1df('0x1f')][_0x14aff3][_0xf1df('0xce')]||undefined,'CampaignId':_0x412a4c[_0xf1df('0x1f')][_0x14aff3][_0xf1df('0xfa')]||undefined})['catch'](loggerCatch(_0xf1df('0x1f1')));delete _0x412a4c[_0xf1df('0x1f')][_0x14aff3];}}else{return _0x412a4c[_0xf1df('0x175')](_0x3e648d,_0x2bca9e);}}else{if(getDiff(_0x2bca9e['scheduledat'])<_0x3e648d[_0xf1df('0x1f2')]*0x3c){if(_0x2bca9e[_0xf1df('0x162')]&&!_0x2bca9e['Agent']['voicePause']){_0x412a4c[_0xf1df('0x8d')][_0xf1df('0x139')](_0x2bca9e['id'])[_0xf1df('0x19')](function(){_0x412a4c['updateOriginated'](_0x3e648d);});}else{_0x412a4c[_0xf1df('0xbd')]({'active':![]},_0x2bca9e['id'],0x1)[_0xf1df('0x19')](function(){_0x412a4c[_0xf1df('0xae')](_0x3e648d);});}}else{_0x3e648d[_0xf1df('0x5f')]+=0x1;_0x412a4c[_0xf1df('0xae')](_0x3e648d);if(_0x3e648d[_0xf1df('0x1f3')]){_0x412a4c['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2bca9e[_0xf1df('0xf8')],'ListId':_0x2bca9e[_0xf1df('0xf9')],'VoiceQueueId':_0x2bca9e['VoiceQueueId']||undefined,'CampaignId':_0x2bca9e[_0xf1df('0xfa')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x412a4c[_0xf1df('0xc6')](createObjHistory(_0x3e648d,_0x2bca9e,_0xf1df('0x1f4'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0xf1df('0x1f5')));}else{_0x412a4c[_0xf1df('0xcb')](createObjHistory(_0x3e648d,_0x2bca9e,'RECALLFAILEDTIMEOUT',0x16,_0xf1df('0x1f6')),_0xf1df('0x1f7'),'[Originate][HistoryRecallClose]');}}}}else{_0x3e648d[_0xf1df('0x1f8')]+=0x1;_0x412a4c[_0xf1df('0xcb')](createObjHistory(_0x3e648d,_0x2bca9e,_0xf1df('0x1f9'),0xd,_0xf1df('0x1fa')),_0xf1df('0x1fb'),_0xf1df('0x1fc'));throw _0xf1df('0x1fd');}};};Dialer['prototype'][_0xf1df('0x1fe')]=function(_0x252915){var _0x36c933=this;var _0x4cabd7=_0x252915[_0xf1df('0x1ff')]-_0x252915[_0xf1df('0x94')]-_0x252915[_0xf1df('0xc0')];emitCampaignSummary(_0x252915);if(_0x4cabd7>0x0){if(_0x4cabd7>this[_0xf1df('0x1e')]){_0x4cabd7=this[_0xf1df('0x1e')];}_0x252915[_0xf1df('0xc0')]+=_0x4cabd7;this[_0xf1df('0xc1')](_0x252915['id'],_0x4cabd7,_0x252915[_0xf1df('0x200')],_0x252915)[_0xf1df('0x33')](function(_0x3595ce){_0x252915['temp']-=_0x4cabd7;_0x252915[_0xf1df('0xc0')]=_0x252915[_0xf1df('0xc0')]>0x0?_0x252915[_0xf1df('0xc0')]:0x0;if(!checkContactEmpty(_0x3595ce)){_0x252915[_0xf1df('0x38')]=_0xf1df('0x9b');logger[_0xf1df('0x79')](_0xf1df('0x201')+_0x252915[_0xf1df('0x36')]);}else{_0x252915['originated']+=_0x3595ce['length'];_0x252915[_0xf1df('0x38')]=_0xf1df('0x202');for(var _0x3f15be=0x0;_0x3f15be<_0x3595ce['length'];_0x3f15be+=0x1){_0x252915['ivrTotalCallsDays']+=0x1;if(_[_0xf1df('0xd6')](_0x3595ce[_0x3f15be])||_[_0xf1df('0xd6')](_0x3595ce[_0x3f15be]['Contact'])||_[_0xf1df('0xd6')](_0x3595ce[_0x3f15be][_0xf1df('0x178')])){_0x36c933[_0xf1df('0xca')]('[actionOriginate]\x20',_0x252915,_0x3595ce[_0x3f15be]);}else{_0x36c933[_0xf1df('0xb8')](_['pick'](_0x3595ce[_0x3f15be],[_0xf1df('0xfa'),_0xf1df('0x178')]))['then'](_0x36c933['checkContactBlack'](_0x252915,_0x3595ce[_0x3f15be]))['catch'](_0x36c933[_0xf1df('0x203')](_0xf1df('0x204'),_0x252915));}}}})['catch'](loggerGetContactDialer(_0xf1df('0x205'),_0x252915,_0x4cabd7));}};Dialer[_0xf1df('0xa5')][_0xf1df('0x15b')]=function(_0x5d2237,_0x865bb1){var _0x55491e=this;var _0x1beb31=[];var _0x2d48d4=_0x865bb1>=0x1?_0x865bb1:0x1;if(_0x5d2237['dialMethod']==='booked'){_0x2d48d4=0x1;}var _0x4967c1=Math[_0xf1df('0x1e9')](_0x5d2237[_0xf1df('0x9d')]*_0x2d48d4)-_0x5d2237[_0xf1df('0x94')]-_0x5d2237['temp'];emitVoiceQueueSummary(_0x5d2237);if(_0x5d2237['dialLimitQueue']>0x0){var _0x4d5b2d=_0x5d2237[_0xf1df('0x206')]-_0x5d2237[_0xf1df('0x94')]-_0x5d2237[_0xf1df('0x4d')]-_0x5d2237[_0xf1df('0xc0')]-_0x5d2237[_0xf1df('0x4a')];if(_0x4967c1>_0x4d5b2d){_0x4967c1=_0x4d5b2d;}}if(_0x4967c1>0x0){if(_0x5d2237[_0xf1df('0x53')]===_0xf1df('0x15f')){_0x4967c1=0x1;}if(_0x4967c1>this[_0xf1df('0x1e')]){_0x4967c1=this[_0xf1df('0x1e')];}_0x5d2237[_0xf1df('0xc0')]+=_0x4967c1;for(var _0x52f7c8 in this[_0xf1df('0x1c')]){if(typeof this[_0xf1df('0x1c')][_0x52f7c8]!==_0xf1df('0x95')){if(this['agents'][_0x52f7c8]['state']===_0xf1df('0x207')&&this['agents'][_0x52f7c8][_0xf1df('0xa9')]===_0xf1df('0xd5')){_0x1beb31['push'](this['agents'][_0x52f7c8]['id']);}}}this['getContactDialer'](_0x5d2237['id'],_0x1beb31,_0x4967c1,_0x5d2237['dialOrderByScheduledAt'],_0x5d2237)[_0xf1df('0x33')](function(_0x56b11d){_0x5d2237[_0xf1df('0xc0')]-=_0x4967c1;_0x5d2237['temp']=_0x5d2237[_0xf1df('0xc0')]>0x0?_0x5d2237[_0xf1df('0xc0')]:0x0;if(!checkContactEmpty(_0x56b11d)){_0x55491e[_0xf1df('0xb0')](_0x5d2237)[_0xf1df('0x33')](sendMessageReschedule(_0x5d2237))[_0xf1df('0xab')](loggerCatch(_0xf1df('0xb2')));}else{_0x5d2237[_0xf1df('0x94')]+=_0x56b11d[_0xf1df('0x134')];_0x5d2237[_0xf1df('0x38')]=_0x5d2237['dialMethod']===_0xf1df('0x15f')?_0xf1df('0x17e'):_0xf1df('0x202');for(var _0x1f82fe=0x0;_0x1f82fe<_0x56b11d[_0xf1df('0x134')];_0x1f82fe+=0x1){if(_[_0xf1df('0xd6')](_0x56b11d[_0x1f82fe])||_[_0xf1df('0xd6')](_0x56b11d[_0x1f82fe][_0xf1df('0x18d')])||_[_0xf1df('0xd6')](_0x56b11d[_0x1f82fe][_0xf1df('0x178')])){_0x55491e[_0xf1df('0xca')](_0xf1df('0x208'),_0x5d2237,_0x56b11d[_0x1f82fe]);}else{_0x55491e['checkIsBlackList'](_[_0xf1df('0xcc')](_0x56b11d[_0x1f82fe],[_0xf1df('0xce'),'phone']))[_0xf1df('0x33')](_0x55491e[_0xf1df('0x209')](_0x5d2237,_0x56b11d[_0x1f82fe]))[_0xf1df('0xab')](_0x55491e[_0xf1df('0x203')](_0xf1df('0x208'),_0x5d2237));}}}})[_0xf1df('0xab')](loggerGetContactDialer(_0xf1df('0x20a'),_0x5d2237,_0x4967c1));}};Dialer[_0xf1df('0xa5')][_0xf1df('0x8c')]=function(_0x2c5c51){if(_0x2c5c51[_0xf1df('0x206')]>0x0){var _0x37ca72=_0x2c5c51['dialLimitQueue']-_0x2c5c51['originated']-_0x2c5c51[_0xf1df('0x4d')];if(_0x37ca72>0x0){this[_0xf1df('0x20b')](_0x2c5c51);}else{loggerPredictiveCalls[_0xf1df('0x79')](_0xf1df('0x20c'));}}else{this['tryOriginatePredictive'](_0x2c5c51);}};Dialer[_0xf1df('0xa5')]['tryOriginatePredictive']=function(_0x55b40f){var _0x180105=this;var _0x4af365=[];_0x55b40f['originated']+=0x1;for(var _0x2acb62 in this['agents']){if(typeof this[_0xf1df('0x1c')][_0x2acb62]!==_0xf1df('0x95')){if(this['agents'][_0x2acb62][_0xf1df('0xdd')]===_0xf1df('0x207')&&this[_0xf1df('0x1c')][_0x2acb62][_0xf1df('0xa9')]==='reachable'){_0x4af365[_0xf1df('0x12d')](this['agents'][_0x2acb62]['id']);}}}this[_0xf1df('0xbf')](_0x55b40f['id'],_0x4af365,0x1,_0x55b40f[_0xf1df('0x200')],_0x55b40f)[_0xf1df('0x33')](function(_0x2aca63){if(!checkContactEmpty(_0x2aca63)){checkContactLowerLimitOriginate(_0x55b40f,0x1,0x0);_0x180105['countReScheduled'](_0x55b40f)[_0xf1df('0x33')](sendMessageReschedule(_0x55b40f))[_0xf1df('0xab')](loggerCatch('[countReScheduled]\x20'));}else{_0x55b40f[_0xf1df('0x38')]=_0xf1df('0x202');if(_[_0xf1df('0xd6')](_0x2aca63[0x0])||_[_0xf1df('0xd6')](_0x2aca63[0x0][_0xf1df('0x18d')])||_[_0xf1df('0xd6')](_0x2aca63[0x0][_0xf1df('0x178')])){_0x180105['emptyContact'](_0xf1df('0x208'),_0x55b40f,_0x2aca63[0x0]);}else{_0x180105[_0xf1df('0xb3')](_[_0xf1df('0xcc')](_0x2aca63[0x0],['VoiceQueueId',_0xf1df('0x178')]))['then'](_0x180105[_0xf1df('0x209')](_0x55b40f,_0x2aca63[0x0]))['catch'](_0x180105[_0xf1df('0x203')](_0xf1df('0x20d'),_0x55b40f));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x55b40f,0x1));emitVoiceQueueSummary(_0x55b40f);};Dialer['prototype'][_0xf1df('0x1e0')]=function(_0xa4ed,_0x58fca6,_0x2affb8,_0x41f214,_0x323694,_0x2595a5){loggerPredictive[_0xf1df('0x79')](_0xf1df('0x20e'));loggerPredictive[_0xf1df('0x79')](_0xf1df('0x20f'),_0xa4ed);loggerPredictive['info'](_0xf1df('0x210'),_0x58fca6);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x211'),_0x2affb8);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x212'),_0x41f214);loggerPredictive['info'](_0xf1df('0x213'),_0x323694);loggerPredictive['info'](_0xf1df('0x81'));return new Promise(function(_0x5c811c,_0x58bf83){if(_0xa4ed<=0x0||isNaN(_0xa4ed)){return _0x58bf83(msgResponse(_0xf1df('0x214'),'Error','m\x20=\x20'+_0xa4ed));}if(_0x2affb8<=0x0||isNaN(_0x2affb8)){return _0x58bf83(msgResponse(_0xf1df('0x214'),_0xf1df('0x40'),_0xf1df('0x215')+_0x2affb8));}if(_0x41f214<=0x0||isNaN(_0x41f214)){return _0x58bf83(msgResponse('[abandonmentRate]',_0xf1df('0x40'),_0xf1df('0x216')+_0x41f214));}if(_0x58fca6<=0x0||isNaN(_0x58fca6)){return _0x58bf83(msgResponse('[abandonmentRate]',_0xf1df('0x40'),_0xf1df('0x217')+_0x58fca6));}if(_0x323694<=0x0||isNaN(_0x323694)){return _0x58bf83(msgResponse('[abandonmentRate]',_0xf1df('0x40'),'Amax\x20=\x20'+_0x323694));}_0x2595a5=_0x2595a5||0x0;var _0x5fac11=0x1/_0x2affb8;var _0x239194=0x0;var _0x14e6ee=0x0;var _0x350749=0x0;var _0x63c795=0x0;for(var _0x29a495=0x0;_0x350749<_0x323694;_0x29a495+=0x1){_0x14e6ee=_0x29a495/_0x58fca6;_0x239194=(_0x41f214*_0x14e6ee+_0x2595a5)/_0x5fac11;_0x350749=erlangb(_0x239194,_0xa4ed);_0x63c795=_0x239194/_0xa4ed*(0x1-erlangb(_0x239194,_0xa4ed));}return _0x5c811c({'erlangCalls':_0x29a495,'erlangCallToSecond':_0x58fca6/_0x29a495,'erlangAbandonmentRate':_0x350749,'erlangBusyFactor':_0x63c795});});};Dialer['prototype'][_0xf1df('0x1e2')]=function(_0x31e48a,_0x574ac9,_0x55b980,_0xcbacdf,_0x59fb42,_0x3b419b){loggerPredictive[_0xf1df('0x79')](_0xf1df('0x218'));loggerPredictive[_0xf1df('0x79')](_0xf1df('0x20f'),_0x31e48a);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x210'),_0x574ac9);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x211'),_0x55b980);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x212'),_0xcbacdf);loggerPredictive[_0xf1df('0x79')](_0xf1df('0x219'),_0x59fb42);loggerPredictive['info'](_0xf1df('0x81'));return new Promise(function(_0x55dc87,_0x9a9a7e){if(_0x31e48a<=0x0||isNaN(_0x31e48a)){return _0x9a9a7e(msgResponse(_0xf1df('0x21a'),_0xf1df('0x40'),_0xf1df('0x21b')+_0x31e48a));}if(_0x55b980<=0x0||isNaN(_0x55b980)){return _0x9a9a7e(msgResponse(_0xf1df('0x21a'),'Error',_0xf1df('0x215')+_0x55b980));}if(_0xcbacdf<=0x0||isNaN(_0xcbacdf)){return _0x9a9a7e(msgResponse(_0xf1df('0x21a'),'Error',_0xf1df('0x216')+_0xcbacdf));}if(_0x574ac9<=0x0||isNaN(_0x574ac9)){return _0x9a9a7e(msgResponse(_0xf1df('0x21a'),'Error',_0xf1df('0x217')+_0x574ac9));}if(_0x59fb42<=0x0||isNaN(_0x59fb42)){return _0x9a9a7e(msgResponse('[busyFactor]',_0xf1df('0x40'),_0xf1df('0x21c')+_0x59fb42));}_0x3b419b=_0x3b419b||0x0;var _0x4c2053=0x1/_0x55b980;var _0x1318b1=0x0;var _0x18a7d1=0x0;var _0x12489e=0x0;var _0x430f22=0x0;for(var _0x318dc9=0x0;_0x430f22<_0x59fb42;_0x318dc9+=0x1){_0x18a7d1=_0x318dc9/_0x574ac9;_0x1318b1=(_0xcbacdf*_0x18a7d1+_0x3b419b)/_0x4c2053;_0x12489e=erlangb(_0x1318b1,_0x31e48a);_0x430f22=_0x1318b1/_0x31e48a*(0x1-erlangb(_0x1318b1,_0x31e48a));}return _0x55dc87({'erlangCalls':_0x318dc9,'erlangCallToSecond':_0x574ac9/_0x318dc9,'erlangAbandonmentRate':_0x12489e,'erlangBusyFactor':_0x430f22});});};module['exports']=Dialer; \ No newline at end of file +var _0x266f=['[getContactDialer2][Empty]','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','channel','catch','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','merge','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','unmonitored','saveInDb','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','uniqueid','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialAMDActive','dialGlobalMaxRetry','add','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','dialQueueTimeout','dropreason','TIMEOUT','dialDropRetryFrequency','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','queueBooked','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','timezones','content','indexOf','command','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','power','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','Agent','user:%s','launchHandleIvr','handleIvr','dialGlobalInterval','checkIfTimeIntervals','checkDialMethod','[syncQueueSummary]','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','reachable','user:dialPreviewRecallReminder','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','createdAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','originatecalleridname','variables','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','object','reason','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','RUNNING','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[countReScheduled]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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----','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','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]','Umin\x20=\x20','exports','util','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/setting','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','loopCampaigns','getSettings','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','stringify','type','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\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','predictiveIntervalDroppedCallsCallersExit','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','---------------------------','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','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','milliseconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','debug','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x266f,0x18f));var _0xf266=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0x266f[_0x3bd52b];return _0x1e5b89;};'use strict';var util=require(_0xf266('0x0'));var _=require('lodash');var uuid=require(_0xf266('0x1'));var moment=require(_0xf266('0x2'));var rr=require('rr');var md5=require(_0xf266('0x3'));var Redis=require(_0xf266('0x4'));var ut=require(_0xf266('0x5'));var config=require('../../../config/environment/');var logger=require(_0xf266('0x6'))('dialer');var loggerBooked=require(_0xf266('0x6'))(_0xf266('0x7'));var loggerPredictive=require(_0xf266('0x6'))('predictive');var loggerPredictiveCalls=require(_0xf266('0x6'))(_0xf266('0x8'));var loggerSyncQueueSummary=require(_0xf266('0x6'))(_0xf266('0x9'));var ami=require(_0xf266('0xa'));config[_0xf266('0xb')]=_[_0xf266('0xc')](config['redis'],{'host':_0xf266('0xd'),'port':0x18eb});var io=require(_0xf266('0xe'))(new Redis(config[_0xf266('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf266('0xf'));var cmHopperAdditionalPhone=require(_0xf266('0x10'));var cmHopperBlack=require(_0xf266('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xf266('0x12'));var Action=require(_0xf266('0x13'));var History=require('./history');var Final=require(_0xf266('0x14'));var AgentComplete=require(_0xf266('0x15'));var QueueCallerAbandon=require(_0xf266('0x16'));var Hangup=require(_0xf266('0x17'));var ipAgi=process[_0xf266('0x18')]['XCALLY_IP_AGI']||_0xf266('0x19');var strategy={'rrmemory':_0xf266('0x1a'),'roundrobin':_0xf266('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xf266('0x1c')]=function(_0xd9ba1a){this['tail']=this[_0xf266('0x1d')]?this['tail'][_0xf266('0x1e')](_0xd9ba1a):_0xd9ba1a();};function Dialer(_0x1e6bf8,_0x37a835){this[_0xf266('0x1f')]=new Sequence();this[_0xf266('0x20')]=_0x37a835;this[_0xf266('0x21')]=_0x1e6bf8[_0xf266('0x21')];this[_0xf266('0x22')]=_0x1e6bf8[_0xf266('0x22')];this[_0xf266('0x23')]=_0x1e6bf8[_0xf266('0x23')];this[_0xf266('0x24')]=_0x1e6bf8[_0xf266('0x24')];this[_0xf266('0x25')]=config[_0xf266('0x25')]||0x2;this[_0xf266('0x26')]={};this[_0xf266('0x27')]={};this[_0xf266('0x28')]={};this[_0xf266('0x29')]={};this[_0xf266('0x2a')]={};this['startPredictive']={};this['startProgressive']={};this[_0xf266('0x2b')]={};this['queueBooked']={};this[_0xf266('0x2c')]={};ami['on'](_0xf266('0x2d'),this[_0xf266('0x2e')]['bind'](this));ami['on'](_0xf266('0x2f'),this[_0xf266('0x30')][_0xf266('0x31')](this));ami['on'](_0xf266('0x32'),this[_0xf266('0x33')][_0xf266('0x31')](this));ami['on'](_0xf266('0x34'),this[_0xf266('0x35')][_0xf266('0x31')](this));ami['on'](_0xf266('0x36'),this[_0xf266('0x9')][_0xf266('0x31')](this));ami['on'](_0xf266('0x37'),this['syncQueueSummaryComplete'][_0xf266('0x31')](this));ami['on'](_0xf266('0x38'),this[_0xf266('0x39')][_0xf266('0x31')](this));ami['on']('newexten',this[_0xf266('0x3a')]['bind'](this));ami['on'](_0xf266('0x3b'),this[_0xf266('0x3c')]['bind'](this));ami['on']('queuemember',this[_0xf266('0x3d')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));this[_0xf266('0x3e')]();this['loopClearZombieChannels']();RpcSetting[_0xf266('0x3f')]()['then'](function(_0x2ccdac){previewRecallmeReminderInterval=_0x2ccdac['previewRecallmeReminderInterval'];});}function isNotNull(_0x8a07){return _0x8a07!==null&&!_[_0xf266('0x40')](_0x8a07);}function checkIsLoggedIn(_0x4d07e4,_0x5bcf82){return function(){if(_0x5bcf82<=0x0){_0x4d07e4[_0xf266('0x41')]=_0xf266('0x42');throw _0x4d07e4['name']+_0xf266('0x43');}};}function isActive(_0x4658fc){return _0x4658fc;}function checkIsActive(_0xc16d6,_0x1822a3){return function(){if(!isActive(_0x1822a3)){_0xc16d6['message']=_0xf266('0x44');throw _0xc16d6[_0xf266('0x45')]+_0xf266('0x46');}};}function checkInterval(_0x38b8b2){return function(){if(!isNotNull(_0x38b8b2[_0xf266('0x47')])){_0x38b8b2[_0xf266('0x41')]='INTERVAL_IS_NULL';throw _0x38b8b2['name']+_0xf266('0x48');}if(!isNotNull(_0x38b8b2[_0xf266('0x47')][_0xf266('0x49')])){_0x38b8b2[_0xf266('0x41')]=_0xf266('0x4a');throw _0x38b8b2[_0xf266('0x45')]+_0xf266('0x48');}if(!isNotNull(_[_0xf266('0x4b')](_0x38b8b2[_0xf266('0x47')]['Intervals']))){_0x38b8b2['message']='INTERVAL_IS_NULL';throw _0x38b8b2[_0xf266('0x45')]+_0xf266('0x48');}};}function msgResponse(_0x306820,_0x10d661,_0x5acd25){return{'action':_0x306820,'response':_0x10d661,'message':_0x5acd25,'stack':_0x5acd25};}function myreject(_0x20e938){return function(_0x1787c5){return _0x20e938(msgResponse(_0xf266('0x4c'),_0xf266('0x4d'),JSON['stringify'](_0x1787c5)));};}function getSeconds(_0xf44421,_0x21292b){var _0x549781=moment(_0xf44421)['milliseconds'](0x0);var _0x245ca2=moment(_0x21292b)['milliseconds'](0x0);return _0x549781[_0xf266('0x4e')](_0x245ca2,_0xf266('0x4f'));}function emit(_0x2ef7d8,_0x13dbc5,_0x55d61d){io['to'](_0x2ef7d8)[_0xf266('0x50')](_0x13dbc5,_0x55d61d);}function emitVoiceQueueSummary(_0x45bfbc){if(_0x45bfbc['type']===_0xf266('0x51')){var _0x157074={'id':_0x45bfbc['id'],'name':_0x45bfbc[_0xf266('0x45')],'strategy':_0x45bfbc[_0xf266('0x52')],'answered':_0x45bfbc[_0xf266('0x53')],'available':_0x45bfbc[_0xf266('0x54')],'loggedIn':_0x45bfbc[_0xf266('0x55')],'pTalking':_0x45bfbc['pTalking'],'sumBillable':_0x45bfbc['sumBillable'],'sumDuration':_0x45bfbc[_0xf266('0x56')],'sumHoldTime':_0x45bfbc[_0xf266('0x57')]||0x0,'talking':_0x45bfbc[_0xf266('0x58')],'total':_0x45bfbc[_0xf266('0x59')],'type':_0x45bfbc['type'],'unmanaged':_0x45bfbc[_0xf266('0x5a')],'abandoned':_0x45bfbc['abandoned'],'waiting':_0x45bfbc['waiting'],'loggedInDb':_0x45bfbc[_0xf266('0x5b')],'dialActive':_0x45bfbc[_0xf266('0x5c')],'dialMethod':_0x45bfbc[_0xf266('0x5d')],'dialOriginateCallerIdName':_0x45bfbc[_0xf266('0x5e')],'dialOriginateCallerIdNumber':_0x45bfbc['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x45bfbc[_0xf266('0x5f')],'dialPrefix':_0x45bfbc[_0xf266('0x60')],'outboundAnswerAgiCallsDay':_0x45bfbc['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x45bfbc[_0xf266('0x61')],'outboundBlacklistCallsDay':_0x45bfbc['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x45bfbc[_0xf266('0x62')],'outboundCongestionCallsDay':_0x45bfbc[_0xf266('0x63')],'outboundDropCallsDayACS':_0x45bfbc['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x45bfbc['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x45bfbc[_0xf266('0x64')],'outboundNoAnswerCallsDay':_0x45bfbc['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x45bfbc['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x45bfbc[_0xf266('0x65')],'outboundReCallsDay':_0x45bfbc['outboundReCallsDay'],'outboundRejectCallsDay':_0x45bfbc[_0xf266('0x66')],'outboundUnknownCallsDay':_0x45bfbc[_0xf266('0x67')],'predictiveIntervalAnsweredCalls':_0x45bfbc[_0xf266('0x68')],'predictiveIntervalAvgHoldtime':_0x45bfbc[_0xf266('0x69')],'predictiveIntervalAvgTalktime':_0x45bfbc[_0xf266('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x45bfbc['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x45bfbc[_0xf266('0x6b')],'predictiveIntervalErlangCalls':_0x45bfbc['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x45bfbc[_0xf266('0x6c')],'predictiveIntervalHitRate':_0x45bfbc['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x45bfbc['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x45bfbc[_0xf266('0x6d')],'predictiveIntervalAvailable':_0x45bfbc[_0xf266('0x6e')],'predictiveIntervalTotalCalls':_0x45bfbc[_0xf266('0x6f')],'message':_0x45bfbc[_0xf266('0x41')],'originated':_0x45bfbc[_0xf266('0x70')],'erlangCalls':_0x45bfbc[_0xf266('0x71')],'erlangCallToSecond':_0x45bfbc[_0xf266('0x72')],'erlangAbandonmentRate':_0x45bfbc[_0xf266('0x73')],'erlangBusyFactor':_0x45bfbc[_0xf266('0x74')],'startPredictive':_0x45bfbc[_0xf266('0x75')],'startProgressive':_0x45bfbc[_0xf266('0x76')]};if(_0x45bfbc[_0xf266('0x77')]){_0x157074[_0xf266('0x77')]={'id':_0x45bfbc[_0xf266('0x77')]['id'],'name':_0x45bfbc[_0xf266('0x77')][_0xf266('0x45')],'active':_0x45bfbc['Trunk'][_0xf266('0x78')],'callerid':_0x45bfbc['Trunk']['callerid']};}if(_0x45bfbc[_0xf266('0x47')]){_0x157074['Interval']={'id':_0x45bfbc['Interval']['id'],'name':_0x45bfbc[_0xf266('0x47')][_0xf266('0x45')]};}var _0x1c9514=md5(JSON[_0xf266('0x79')](_0x157074));if(_0x45bfbc[_0xf266('0x3')]!==_0x1c9514){_0x45bfbc[_0xf266('0x3')]=_0x1c9514;emit(util['format']('voice:queue:%s',_0x157074[_0xf266('0x45')]),'voice_queue:save',_0x157074);}}}function emitCampaignSummary(_0x585803){if(_0x585803[_0xf266('0x7a')]===_0xf266('0x7b')){emit(util[_0xf266('0x7c')](_0xf266('0x7d'),_0x585803[_0xf266('0x45')]),_0xf266('0x7e'),_0x585803);}}function checkGetDataPredictive(_0x17fcae){if(isNotNull(_0x17fcae)&&!_['isEmpty'](_0x17fcae)){loggerPredictive[_0xf266('0x7f')](_0xf266('0x80'));loggerPredictive[_0xf266('0x7f')](_0xf266('0x81'),_0x17fcae[_0xf266('0x6f')]);loggerPredictive[_0xf266('0x7f')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17fcae['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xf266('0x7f')](_0xf266('0x82'),_0x17fcae[_0xf266('0x6b')]);loggerPredictive[_0xf266('0x7f')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x17fcae[_0xf266('0x83')]);loggerPredictive[_0xf266('0x7f')](_0xf266('0x84'),_0x17fcae[_0xf266('0x69')]);loggerPredictive['info'](_0xf266('0x85'),_0x17fcae[_0xf266('0x6a')]);loggerPredictive[_0xf266('0x7f')](_0xf266('0x86'));if(_0x17fcae[_0xf266('0x6f')]>0x0){if(!_['isUndefined'](_0x17fcae[_0xf266('0x6a')])&&_0x17fcae[_0xf266('0x6a')]>0x0){return!![];}loggerPredictive[_0xf266('0x7f')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xf266('0x40')](_0x17fcae['predictiveIntervalAvgHoldtime'])&&_0x17fcae[_0xf266('0x69')]>0x0){return!![];}loggerPredictive[_0xf266('0x7f')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xf266('0x7f')](_0xf266('0x87'));}}else{loggerPredictive[_0xf266('0x7f')](_0xf266('0x88'));}return![];}function mergeDataErlangB(_0x47955f){return function(_0x56661c){loggerPredictive['info'](_0xf266('0x89'));loggerPredictive[_0xf266('0x7f')](_0xf266('0x8a'),_0x56661c['erlangCalls']);loggerPredictive[_0xf266('0x7f')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x56661c[_0xf266('0x72')]);loggerPredictive[_0xf266('0x7f')](_0xf266('0x8b'),_0x56661c[_0xf266('0x73')]);loggerPredictive['info'](_0xf266('0x8c'),_0x56661c[_0xf266('0x74')]);loggerPredictive[_0xf266('0x7f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x56661c[_0xf266('0x73')]);loggerPredictive[_0xf266('0x7f')]('---------------------------');_['merge'](_0x47955f,_0x56661c);};}function getDiff(_0x4caa61){var _0x36f2c5=moment()[_0xf266('0x8d')](0x0);var _0x482c5e=moment(_0x4caa61)[_0xf266('0x8d')](0x0);return _0x36f2c5[_0xf266('0x4e')](_0x482c5e,_0xf266('0x4f'));}function ifInterval(_0x4eae4e,_0x3dc967){if(_[_0xf266('0x40')](_0x3dc967)){return![];}return getDiff(_0x3dc967)<_0x4eae4e*0x3c;}function freeVariablesPredictive(_0x5e1b7d){if(isNotNull(_0x5e1b7d)){if(!_['isUndefined'](_0x5e1b7d['startProgressive'])){_0x5e1b7d['startProgressive']=undefined;loggerPredictive[_0xf266('0x7f')](_0x5e1b7d[_0xf266('0x45')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xf266('0x40')](_0x5e1b7d['startPredictive'])){_0x5e1b7d['startPredictive']=undefined;loggerPredictive['info'](_0x5e1b7d['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xf266('0x40')](_0x5e1b7d[_0xf266('0x8e')])){clearInterval(_0x5e1b7d['handlePredictive']);_0x5e1b7d['handlePredictive']=undefined;loggerPredictive['info'](_0x5e1b7d['name'],_0xf266('0x8f'));}}}function erlangb(_0x295ca2,_0x46aef6){if(_0x46aef6===0x0){return 0x0;}var _0x35f8fd=0x1;for(var _0x1962cf=0x1;_0x1962cf<=_0x46aef6;_0x1962cf+=0x1){_0x35f8fd=0x1+_0x35f8fd*_0x1962cf/_0x295ca2;}return 0x1/_0x35f8fd;}function isVoiceQueueOutbound(_0x386818){return _0x386818==='outbound';}function isNotPreview(_0x12ba0a){return _0x12ba0a!=='preview';}function isCampaignIvr(_0xbbf682){return _0xbbf682===_0xf266('0x7b');}function getCallerId(_0xf4cea5,_0x4eaa7c,_0x1f8ac1){if(!_[_0xf266('0x40')](_0x1f8ac1)&&typeof _0x1f8ac1==='string'&&!_[_0xf266('0x4b')](_0x1f8ac1)){if(!_['isUndefined'](_0x4eaa7c)&&typeof _0x4eaa7c==='string'&&!_['isEmpty'](_0x4eaa7c)){return util['format'](_0xf266('0x90'),_0x4eaa7c,_0x1f8ac1);}return util[_0xf266('0x7c')]('\x22%s\x22\x20<%s>',_0x1f8ac1,_0x1f8ac1);}if(!_[_0xf266('0x40')](_0xf4cea5)&&typeof _0xf4cea5===_0xf266('0x91')&&!_[_0xf266('0x4b')](_0xf4cea5)){return _0xf4cea5;}return _0xf266('0x92');}function loggerCatchQueueSummary(_0x7891b0,_0x4c5175){return function(_0x3e6ae6){freeVariablesPredictive(_0x4c5175);emitVoiceQueueSummary(_0x4c5175);emitCampaignSummary(_0x4c5175);loggerSyncQueueSummary[_0xf266('0x93')](_0x7891b0,util[_0xf266('0x94')](_0x3e6ae6,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5ab0a2,_0xdb7ff5){return function(_0xca8350){loggerPredictive[_0xf266('0x95')](_0xdb7ff5[_0xf266('0x45')],_0x5ab0a2);loggerPredictive['error'](_0xca8350['stack']);freeVariablesPredictive(_0xdb7ff5);};}function loggerCatch(_0x2d4076){return function(_0x55f10d){logger['error'](_0x2d4076,util[_0xf266('0x94')](_0x55f10d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x50cbb7){return _0x50cbb7&&!_['isUndefined'](_0x50cbb7)&&_0x50cbb7[_0xf266('0x96')]>0x0;}function decremetOriginate(_0x42980b){if(!_[_0xf266('0x40')](_0x42980b)&&_0x42980b!==null){if(typeof _0x42980b['originated']!==_0xf266('0x97')){if(_0x42980b[_0xf266('0x70')]>0x0){_0x42980b[_0xf266('0x70')]-=0x1;}else{logger[_0xf266('0x95')](_0xf266('0x98'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x46195f,_0x408676,_0x42eca9){if(_0x408676>_0x42eca9){for(var _0x33ae18=0x0;_0x33ae18<_0x408676-_0x42eca9;_0x33ae18+=0x1){decremetOriginate(_0x46195f);}}}function loggerGetContactDialer(_0x394dcf,_0x257f5e,_0x5ed0d9){return function(_0x1b2657){checkContactLowerLimitOriginate(_0x257f5e,_0x5ed0d9,0x0);logger['error'](_0x394dcf,util['inspect'](_0x1b2657,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2f7640){return function(_0x5bf639){if(isNotNull(_0x5bf639)&&isNotNull(_0x5bf639[0x0])){if(_0x5bf639[0x0][_0xf266('0x99')]>0x0){_0x2f7640[_0xf266('0x41')]=_0xf266('0x9a');logger[_0xf266('0x7f')]('[getContactDialer2][ReScheduled]'+_0x2f7640[_0xf266('0x45')],_0x5bf639[0x0][_0xf266('0x99')],_0xf266('0x9b'));}else{_0x2f7640['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xf266('0x7f')](_0xf266('0x9c')+_0x2f7640[_0xf266('0x45')]);}}};}function notSendMessagesQueue(_0x4e11b2){if(_0x4e11b2['sendMessageOneNotActive']){freeVariablesPredictive(_0x4e11b2);if(_0x4e11b2['originated']===0x0&&_0x4e11b2[_0xf266('0x58')]===0x0&&_0x4e11b2['waiting']===0x0&&(_0x4e11b2[_0xf266('0x9d')]||0x0)===0x0){_0x4e11b2['sendMessageOneNotActive']=![];_0x4e11b2[_0xf266('0x54')]=0x0;_0x4e11b2[_0xf266('0x41')]=_0xf266('0x44');loggerSyncQueueSummary[_0xf266('0x93')](_0xf266('0x9e'),_0x4e11b2[_0xf266('0x45')],_0xf266('0x9f'));}else{_0x4e11b2[_0xf266('0x41')]=_0xf266('0xa0');loggerSyncQueueSummary[_0xf266('0x93')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4e11b2[_0xf266('0x45')],'is\x20disactive');}emitVoiceQueueSummary(_0x4e11b2);}}function notSendMessagesCampaign(_0x17d1fa){if(_0x17d1fa[_0xf266('0xa1')]){if(_0x17d1fa[_0xf266('0x70')]===0x0){_0x17d1fa[_0xf266('0xa1')]=![];_0x17d1fa[_0xf266('0x41')]=_0xf266('0x44');loggerSyncQueueSummary[_0xf266('0x93')](_0xf266('0xa2'),_0x17d1fa['name'],_0xf266('0x9f'));}else{_0x17d1fa[_0xf266('0x41')]=_0xf266('0xa0');loggerSyncQueueSummary[_0xf266('0x93')](_0xf266('0xa2'),_0x17d1fa[_0xf266('0x45')],'is\x20disactive');}emitCampaignSummary(_0x17d1fa);}}function createObjHistory(_0x4b40ec,_0x3e4b08,_0x3cf7b6,_0xebf226,_0x41d273){_0x4b40ec[_0xf266('0x41')]=_0x3cf7b6;var _0x3029f0=new Action(_0x4b40ec,_0x3e4b08);var _0x32f218=new History(_0x3029f0);_0x32f218[_0xf266('0xa3')]=_0xebf226;_0x32f218[_0xf266('0xa4')]=_0x41d273;_0x32f218[_0xf266('0xa5')]=_0x3029f0[_0xf266('0xa6')];return _0x32f218;}Dialer[_0xf266('0xa7')]['loopClearZombieChannels']=function(){var _0x24ae92=this;setInterval(function(){_0x24ae92[_0xf266('0xa8')](_0x24ae92[_0xf266('0x29')],_0xf266('0xa9'));_0x24ae92[_0xf266('0xa8')](_0x24ae92[_0xf266('0x27')],_0xf266('0xaa'));},0x32c8);};Dialer[_0xf266('0xa7')]['clearZombieChannels']=function(_0x31a69c,_0xe8aee4){var _0x1bacf0=this;for(var _0x39820a in _0x31a69c){if(typeof _0x31a69c[_0x39820a]!=='undefined'){this[_0xf266('0x1f')][_0xf266('0x1c')](function(){if(!_[_0xf266('0xab')](_0x31a69c[_0x39820a])){return ami[_0xf266('0xac')]({'action':'status','channel':_0x31a69c[_0x39820a][_0xf266('0xad')]})[_0xf266('0xae')](function(_0x2ec640){if(_0x2ec640[_0xf266('0x41')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x31a69c[_0x39820a]&&_0x31a69c[_0x39820a][_0xf266('0x7a')]!==_0xf266('0x7b')){_0x1bacf0[_0xf266('0xaf')](_0x1bacf0['voiceQueues'][_0x31a69c[_0x39820a]['queue']]);logger[_0xf266('0x95')](_0xf266('0xb0'),_0xe8aee4,_0x39820a,_0x31a69c[_0x39820a][_0xf266('0xb1')]);delete _0x31a69c[_0x39820a];}if(_0x31a69c[_0x39820a]&&_0x31a69c[_0x39820a][_0xf266('0x7a')]===_0xf266('0x7b')){_0x1bacf0[_0xf266('0xaf')](_0x1bacf0[_0xf266('0x22')][_0x31a69c[_0x39820a]['queue']]);logger[_0xf266('0x95')](_0xf266('0xb2'),_0xe8aee4,_0x39820a,_0x31a69c[_0x39820a]['queue']);delete _0x31a69c[_0x39820a];}},0x2328);}});}});}}};Dialer['prototype'][_0xf266('0xb3')]=function(_0x13e095){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](cmHopper['countReScheduled'](_0x13e095))[_0xf266('0xae')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype']['checkIsBlackList']=function(_0x2825e4){return Promise['resolve']()[_0xf266('0xb5')](cmHopperBlack[_0xf266('0xb6')](_0x2825e4))[_0xf266('0xae')](loggerCatch(_0xf266('0xb7')));};Dialer[_0xf266('0xa7')][_0xf266('0xb8')]=function(_0x26316b,_0x5e806e,_0x564276){return Promise['resolve']()[_0xf266('0xb5')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x26316b,_0x5e806e,_0x564276))[_0xf266('0xae')](loggerCatch(_0xf266('0xb9')));};Dialer[_0xf266('0xa7')][_0xf266('0xba')]=function(_0x42c0a1,_0x54c121,_0x336484){return Promise['resolve']()[_0xf266('0xb5')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x42c0a1,_0x54c121,_0x336484))[_0xf266('0xae')](loggerCatch(_0xf266('0xbb')));};Dialer[_0xf266('0xa7')]['checkIsBlackListIvr']=function(_0x549543){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](cmHopperBlack['checkIsBlackListIvr'](_0x549543))[_0xf266('0xae')](loggerCatch(_0xf266('0xbc')));};Dialer[_0xf266('0xa7')][_0xf266('0xbd')]=function(_0x2050f4){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](cmHopperHistory['avgHandleTime'](_0x2050f4))[_0xf266('0xae')](loggerCatch(_0xf266('0xbe')));};Dialer[_0xf266('0xa7')][_0xf266('0xbf')]=function(_0x20d1cf){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](cmHopper[_0xf266('0xbf')](_0x20d1cf))[_0xf266('0xae')](loggerCatch(_0xf266('0xc0')));};Dialer[_0xf266('0xa7')][_0xf266('0xc1')]=function(_0x1f23f6,_0x47aa71,_0x29b42d){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](cmHopper[_0xf266('0xc1')](_0x1f23f6,_0x47aa71,_0x29b42d))['catch'](loggerCatch(_0xf266('0xc2')));};Dialer['prototype'][_0xf266('0xc3')]=function(_0x9ae635,_0x6c66e7,_0xc4ab20,_0x25bf69,_0x43d28d){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](cmHopper[_0xf266('0xc3')](_0x9ae635,_0x6c66e7,_0xc4ab20,_0x25bf69))[_0xf266('0xae')](function(_0x4d4692){_0x43d28d[_0xf266('0xc4')]-=_0xc4ab20;_0x43d28d[_0xf266('0xc4')]=_0x43d28d['temp']>0x0?_0x43d28d[_0xf266('0xc4')]:0x0;loggerCatch(_0xf266('0xc5'))(_0x4d4692);});};Dialer[_0xf266('0xa7')][_0xf266('0xc6')]=function(_0x346909,_0x241dd9,_0x2be779,_0x126f3a){return Promise['resolve']()[_0xf266('0xb5')](cmHopper[_0xf266('0xc6')](_0x346909,_0x241dd9,_0x2be779))['catch'](function(_0x37f4e2){_0x126f3a[_0xf266('0xc4')]-=_0x241dd9;_0x126f3a[_0xf266('0xc4')]=_0x126f3a['temp']>0x0?_0x126f3a['temp']:0x0;loggerCatch(_0xf266('0xc7'))(_0x37f4e2);});};Dialer[_0xf266('0xa7')]['getVoiceQueueRtPauses']=function(_0x51369c){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](voiceQueueRt[_0xf266('0xc8')](_0x51369c))['catch'](loggerCatch(_0xf266('0xc9')));};Dialer[_0xf266('0xa7')][_0xf266('0xca')]=function(_0x5b29af){return Promise['resolve']()[_0xf266('0xb5')](cmHopper[_0xf266('0xca')](_0x5b29af))[_0xf266('0xae')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xf266('0xa7')][_0xf266('0xcb')]=function(_0x1652b9){return Promise['resolve']()[_0xf266('0xb5')](cmHopperHistory[_0xf266('0xcb')](_0x1652b9))[_0xf266('0xae')](loggerCatch(_0xf266('0xcc')));};Dialer['prototype'][_0xf266('0xaf')]=function(_0x4db366){if(!_[_0xf266('0x40')](_0x4db366)&&_0x4db366!==null){if(typeof _0x4db366[_0xf266('0x70')]!==_0xf266('0x97')){if(_0x4db366[_0xf266('0x70')]>0x0){_0x4db366['originated']-=0x1;}else{logger['error'](_0xf266('0xcd'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xf266('0xa7')][_0xf266('0xce')]=function(_0x439477,_0x22cd14){var _0x556e60=this;return function(_0x629178){_0x556e60[_0xf266('0xaf')](_0x22cd14);logger['error'](_0x439477,util['inspect'](_0x629178,{'showHidden':![],'depth':null}));};};Dialer[_0xf266('0xa7')][_0xf266('0xcf')]=function(_0x323b51,_0x5f4412,_0x4b7b57){var _0x5c98a6={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x5f4412);this['saveInDb'](_[_0xf266('0xd0')](_0x5c98a6,_[_0xf266('0xd1')](_0x4b7b57,[_0xf266('0xd2'),_0xf266('0xd3'),'UserId',_0xf266('0xd4'),_0xf266('0xd5')])),'[emptyContact][createHistory]',_0xf266('0xd6'));logger['error'](_0x323b51);};Dialer['prototype'][_0xf266('0xd7')]=function(_0x222afb){return _0x222afb==='Success';};Dialer[_0xf266('0xa7')][_0xf266('0xd8')]=function(_0x15df46){return!_['isUndefined'](_0x15df46)&&_0x15df46&&!_[_0xf266('0x40')](_0x15df46[_0xf266('0x45')])&&!_[_0xf266('0x40')](_0x15df46[_0xf266('0x78')])&&_0x15df46[_0xf266('0x78')]&&(this[_0xf266('0x24')][util[_0xf266('0x7c')](_0xf266('0xd9'),_0x15df46[_0xf266('0x45')])]['status']==='reachable'||this[_0xf266('0x24')][util['format'](_0xf266('0xd9'),_0x15df46[_0xf266('0x45')])][_0xf266('0xda')]===_0xf266('0xdb'));};Dialer[_0xf266('0xa7')][_0xf266('0xdc')]=function(_0x5b55ce,_0x554d74,_0x3184cb){this[_0xf266('0xcb')](_0x5b55ce)[_0xf266('0xae')](loggerCatch(_0x554d74));this[_0xf266('0xca')](_0x5b55ce)[_0xf266('0xae')](loggerCatch(_0x3184cb));};Dialer[_0xf266('0xa7')][_0xf266('0x3c')]=function(_0x3c2bb0){var _0x732b1e=this;var _0x45eb59=this[_0xf266('0x29')][_0x3c2bb0['uniqueid']];var _0x18c100;if(!_['isNil'](_0x3c2bb0)&&!_[_0xf266('0xab')](_0x3c2bb0[_0xf266('0xdd')])&&!_['isNil'](_0x3c2bb0['variable'][_0xf266('0xde')])&&_0x3c2bb0[_0xf266('0xdf')]===_0xf266('0xe0')&&_0x45eb59){if(_0x45eb59[_0xf266('0x7a')]!==_0xf266('0x7b')&&this[_0xf266('0x21')][_0x45eb59['queue']]['dialAMDActive']&&_0x3c2bb0[_0xf266('0xe1')]===_0xf266('0xe2')){delete this[_0xf266('0x29')][_0x3c2bb0[_0xf266('0xe3')]];this[_0xf266('0xaf')](this[_0xf266('0x21')][_0x45eb59['queue']]);this[_0xf266('0x21')][_0x45eb59[_0xf266('0xb1')]][_0xf266('0x61')]+=0x1;this[_0xf266('0x21')][_0x45eb59[_0xf266('0xb1')]][_0xf266('0xe4')]+=0x1;_0x18c100=new Hangup(_0x45eb59,_0x3c2bb0);_0x18c100[_0xf266('0xa3')]=0x12;_0x18c100[_0xf266('0xa4')]=_0xf266('0xe5');_0x18c100[_0xf266('0xe6')]=_0xf266('0xe7');ami[_0xf266('0x50')](_0xf266('0xe8'),ut['buildObj'](_0x18c100,'amd'));this[_0xf266('0xdc')](_0x18c100,_0xf266('0xe9'),_0xf266('0xea'));}if(_0x45eb59[_0xf266('0x7a')]!==_0xf266('0x7b')&&this[_0xf266('0x21')][_0x45eb59[_0xf266('0xb1')]]['dialAMDActive']&&_0x3c2bb0[_0xf266('0xe1')]===_0xf266('0xeb')){return new Promise(function(_0x4740be,_0x23775a){delete _0x732b1e['uniqueId'][_0x3c2bb0[_0xf266('0xe3')]];_0x732b1e[_0xf266('0xaf')](_0x732b1e[_0xf266('0x21')][_0x45eb59[_0xf266('0xb1')]]);_0x732b1e['voiceQueues'][_0x45eb59['queue']][_0xf266('0x61')]+=0x1;_0x732b1e[_0xf266('0x21')][_0x45eb59[_0xf266('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x53840f=_0x732b1e[_0xf266('0x21')][_0x45eb59[_0xf266('0xb1')]];var _0x5f5cf4=new Hangup(_0x45eb59,_0x3c2bb0);_0x5f5cf4[_0xf266('0xa3')]=0x13;_0x5f5cf4[_0xf266('0xa4')]=_0xf266('0xec');_0x5f5cf4[_0xf266('0xe6')]=_0xf266('0xe7');_0x5f5cf4['countmachineretry']+=0x1;_0x5f5cf4[_0xf266('0xed')]+=0x1;_0x5f5cf4[_0xf266('0xee')]=!![];ami[_0xf266('0x50')](_0xf266('0xe8'),ut[_0xf266('0xef')](_0x5f5cf4,_0xf266('0xee')));_0x732b1e[_0xf266('0xcb')](_0x5f5cf4)[_0xf266('0xae')](loggerCatch(_0xf266('0xf0')));if(_0x5f5cf4[_0xf266('0xf1')]+_0x5f5cf4[_0xf266('0xf2')]+_0x5f5cf4[_0xf266('0xf3')]+_0x5f5cf4[_0xf266('0xf4')]+_0x5f5cf4[_0xf266('0xf5')]+_0x5f5cf4[_0xf266('0xf6')]+_0x5f5cf4[_0xf266('0xf7')]+_0x5f5cf4[_0xf266('0xf8')]>=_0x53840f['dialGlobalMaxRetry']){_0x732b1e[_0xf266('0xf9')](_0x5f5cf4,_0x4740be,_0x23775a,_0xf266('0xfa'));}else{if(_0x5f5cf4['countmachineretry']>=_0x53840f[_0xf266('0xfb')]){_0x732b1e[_0xf266('0xfc')](_0x5f5cf4,_0x4740be,_0x23775a,'reason\x2019\x20machine....');}else{_0x732b1e[_0xf266('0xbf')]({'active':![],'countmachineretry':_0x5f5cf4[_0xf266('0xf7')],'scheduledat':moment()['add'](_0x53840f[_0xf266('0xfd')],_0xf266('0xfe'))['format'](_0xf266('0xff')),'ContactId':_0x5f5cf4[_0xf266('0xd2')],'ListId':_0x5f5cf4[_0xf266('0xd3')],'VoiceQueueId':_0x5f5cf4['VoiceQueueId']||undefined,'CampaignId':_0x5f5cf4[_0xf266('0xd5')]||undefined})[_0xf266('0xae')](loggerCatch(_0xf266('0x100')));_0x4740be({'reschedule':0x1});}}});}if(_0x45eb59[_0xf266('0x7a')]===_0xf266('0x7b')&&this[_0xf266('0x22')][_0x45eb59[_0xf266('0xb1')]]['dialAMDActive']&&_0x3c2bb0['value']===_0xf266('0xe2')){delete this[_0xf266('0x29')][_0x3c2bb0[_0xf266('0xe3')]];this[_0xf266('0xaf')](this[_0xf266('0x22')][_0x45eb59['queue']]);_0x18c100=new Hangup(_0x45eb59,_0x3c2bb0);_0x18c100[_0xf266('0xa3')]=0x12;_0x18c100[_0xf266('0xa4')]='HangupInAMD';_0x18c100[_0xf266('0xe6')]=_0xf266('0xe7');ami[_0xf266('0x50')]('custom:amd',ut[_0xf266('0xef')](_0x18c100,_0xf266('0xee')));this[_0xf266('0xdc')](_0x18c100,_0xf266('0x101'),_0xf266('0x102'));}if(_0x45eb59[_0xf266('0x7a')]===_0xf266('0x7b')&&this['campaigns'][_0x45eb59[_0xf266('0xb1')]][_0xf266('0x103')]&&_0x3c2bb0[_0xf266('0xe1')]===_0xf266('0xeb')){return new Promise(function(_0x2fcbff,_0x38bf87){delete _0x732b1e[_0xf266('0x29')][_0x3c2bb0['uniqueid']];_0x732b1e[_0xf266('0xaf')](_0x732b1e[_0xf266('0x22')][_0x45eb59[_0xf266('0xb1')]]);_0x732b1e[_0xf266('0x22')][_0x45eb59[_0xf266('0xb1')]]['outboundAnswerCallsDay']+=0x1;_0x732b1e[_0xf266('0x22')][_0x45eb59[_0xf266('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x3c7133=_0x732b1e[_0xf266('0x22')][_0x45eb59[_0xf266('0xb1')]];var _0x229152=new Hangup(_0x45eb59,_0x3c2bb0);_0x229152['state']=0x13;_0x229152['statedesc']=_0xf266('0xec');_0x229152[_0xf266('0xe6')]='AMD';_0x229152['countmachineretry']+=0x1;_0x229152[_0xf266('0xed')]+=0x1;_0x229152[_0xf266('0xee')]=!![];ami['emit']('custom:amd',ut[_0xf266('0xef')](_0x229152,_0xf266('0xee')));_0x732b1e[_0xf266('0xcb')](_0x229152)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x229152[_0xf266('0xf1')]+_0x229152[_0xf266('0xf2')]+_0x229152[_0xf266('0xf3')]+_0x229152[_0xf266('0xf4')]+_0x229152[_0xf266('0xf5')]+_0x229152[_0xf266('0xf6')]+_0x229152['countmachineretry']+_0x229152['countagentrejectretry']>=_0x3c7133[_0xf266('0x104')]){_0x732b1e[_0xf266('0xf9')](_0x229152,_0x2fcbff,_0x38bf87,_0xf266('0xfa'));}else{if(_0x229152[_0xf266('0xf7')]>=_0x3c7133[_0xf266('0xfb')]){_0x732b1e[_0xf266('0xfc')](_0x229152,_0x2fcbff,_0x38bf87,'reason\x2019\x20machine....');}else{_0x732b1e[_0xf266('0xbf')]({'active':![],'countmachineretry':_0x229152[_0xf266('0xf7')],'scheduledat':moment()[_0xf266('0x105')](_0x3c7133[_0xf266('0xfd')],_0xf266('0xfe'))[_0xf266('0x7c')](_0xf266('0xff')),'ContactId':_0x229152[_0xf266('0xd2')],'ListId':_0x229152[_0xf266('0xd3')],'VoiceQueueId':_0x229152[_0xf266('0xd4')]||undefined,'CampaignId':_0x229152['CampaignId']||undefined})[_0xf266('0xae')](loggerCatch('[rescheduleContact][Machine]'));_0x2fcbff({'reschedule':0x1});}}});}}};Dialer[_0xf266('0xa7')][_0xf266('0x39')]=function(_0x1db80a){var _0x14506b=this[_0xf266('0x29')][_0x1db80a['uniqueid']];var _0x5490af;if(_0x14506b&&_0x14506b[_0xf266('0x7a')]===_0xf266('0x7b')){delete this[_0xf266('0x29')][_0x1db80a[_0xf266('0xe3')]];this['updateOriginated'](this['campaigns'][_0x14506b[_0xf266('0xb1')]]);this[_0xf266('0x22')][_0x14506b[_0xf266('0xb1')]][_0xf266('0x106')]+=0x1;_0x5490af=new Hangup(_0x14506b,_0x1db80a);this[_0xf266('0xcb')](_0x5490af)[_0xf266('0xae')](loggerCatch(_0xf266('0x107')));this['moveContactManagedDialer'](_0x5490af)[_0xf266('0xae')](loggerCatch(_0xf266('0x108')));}if(_0x14506b&&_0x14506b[_0xf266('0x7a')]!==_0xf266('0x7b')&&isNotNull(this[_0xf266('0x21')][_0x14506b[_0xf266('0xb1')]][_0xf266('0x109')])){delete this[_0xf266('0x29')][_0x1db80a[_0xf266('0xe3')]];this[_0xf266('0xaf')](this[_0xf266('0x21')][_0x14506b['queue']]);this['voiceQueues'][_0x14506b[_0xf266('0xb1')]][_0xf266('0x61')]+=0x1;this['voiceQueues'][_0x14506b[_0xf266('0xb1')]][_0xf266('0xe4')]+=0x1;_0x5490af=new Hangup(_0x14506b,_0x1db80a);_0x5490af[_0xf266('0xa3')]=0x10;_0x5490af['statedesc']='AnswerAGI';_0x5490af['membername']=_0xf266('0x10a');this[_0xf266('0xcb')](_0x5490af)['catch'](loggerCatch(_0xf266('0x107')));this[_0xf266('0xca')](_0x5490af)[_0xf266('0xae')](loggerCatch('[syncHangupIvr]'));}if(_0x14506b&&_0x14506b[_0xf266('0x7a')]!==_0xf266('0x7b')&&!isNotNull(this[_0xf266('0x21')][_0x14506b[_0xf266('0xb1')]][_0xf266('0x109')])){delete this['uniqueId'][_0x1db80a['uniqueid']];this['updateOriginated'](this[_0xf266('0x21')][_0x14506b[_0xf266('0xb1')]]);this[_0xf266('0x21')][_0x14506b[_0xf266('0xb1')]][_0xf266('0x67')]+=0x1;_0x5490af=new Hangup(_0x14506b,_0x1db80a);_0x5490af[_0xf266('0xa3')]=0xc;_0x5490af[_0xf266('0xa4')]=_0x1db80a[_0xf266('0x10b')];_0x5490af[_0xf266('0xe6')]=_0xf266('0x10c');this[_0xf266('0xcb')](_0x5490af)[_0xf266('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x5490af)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xf266('0x35')]=function(_0x12ef7e){var _0x501bbc=this[_0xf266('0x29')][_0x12ef7e[_0xf266('0xe3')]];if(this['voiceQueues'][_0x12ef7e['queue']]){if(_0x501bbc&&_0x501bbc[_0xf266('0x7a')]!=='ivr'){delete this[_0xf266('0x29')][_0x12ef7e[_0xf266('0xe3')]];this[_0xf266('0x21')][_0x12ef7e[_0xf266('0xb1')]][_0xf266('0x61')]+=0x1;var _0xa2a1ba=new AgentComplete(_0x501bbc,_0x12ef7e);if(_0x12ef7e['reason']==='agent'){_0xa2a1ba[_0xf266('0x10d')]=this['voiceQueues'][_0x12ef7e['queue']][_0xf266('0x10e')]&&this[_0xf266('0x21')][_0x12ef7e[_0xf266('0xb1')]][_0xf266('0x10f')]?moment()[_0xf266('0x7c')](_0xf266('0xff')):undefined;}this[_0xf266('0xcb')](_0xa2a1ba)[_0xf266('0xae')](loggerCatch(_0xf266('0x110')));this['moveContactManagedDialer'](_0xa2a1ba)[_0xf266('0xae')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xf266('0xa7')][_0xf266('0x2e')]=function(_0x16d29f){if(this[_0xf266('0x21')][_0x16d29f[_0xf266('0xb1')]]){if(this[_0xf266('0x29')][_0x16d29f[_0xf266('0xe3')]]&&this[_0xf266('0x29')][_0x16d29f['uniqueid']][_0xf266('0x7a')]!=='ivr'){this['updateOriginated'](this[_0xf266('0x21')][_0x16d29f[_0xf266('0xb1')]]);this[_0xf266('0x29')][_0x16d29f['uniqueid']][_0xf266('0x111')]=moment()['format'](_0xf266('0xff'));}}};Dialer[_0xf266('0xa7')][_0xf266('0x112')]=function(_0x53e4ec,_0x41fc05){this[_0xf266('0xcb')](_0x53e4ec)[_0xf266('0xae')](loggerCatch(_0xf266('0x110')));if(_0x41fc05==0x0){this[_0xf266('0xca')](_0x53e4ec)[_0xf266('0xae')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype'][_0xf266('0x30')]=function(_0x229626){var _0x2a6e65=this[_0xf266('0x29')][_0x229626[_0xf266('0xe3')]];var _0x33d471=this;var _0x4cd565=![];var _0x144d57;var _0x305c18;if(this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]]){if(_0x2a6e65&&_0x2a6e65[_0xf266('0x7a')]!==_0xf266('0x7b')){delete this['uniqueId'][_0x229626[_0xf266('0xe3')]];this[_0xf266('0xaf')](this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]]);_0x2a6e65[_0xf266('0x113')]=moment()[_0xf266('0x7c')](_0xf266('0xff'));var _0x50b0e2=new QueueCallerAbandon(_0x2a6e65,_0x229626);if(getSeconds(_0x2a6e65[_0xf266('0x113')],_0x2a6e65['responsetime'])>=_0x2a6e65[_0xf266('0x114')]){this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]][_0xf266('0x6b')]+=0x1;this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]][_0xf266('0x64')]+=0x1;this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]][_0xf266('0x6c')]+=0x1;_0x50b0e2[_0xf266('0xa3')]=0xa;_0x50b0e2['statedesc']='Drop';_0x50b0e2[_0xf266('0x115')]=_0xf266('0x116');_0x50b0e2['agiafterat']=this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]][_0xf266('0x10e')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x50b0e2[_0xf266('0xf5')]+=0x1;_0x50b0e2[_0xf266('0xed')]+=0x1;_0x144d57=this['voiceQueues'][_0x229626['queue']][_0xf266('0x117')];_0x305c18=this[_0xf266('0x21')][_0x229626['queue']]['callAdditionalPhoneAfterMin'];_0x33d471['verifyAdditionalPhones'](_0x50b0e2,_0x50b0e2[_0xf266('0xa3')],_0x2a6e65[_0xf266('0x118')])[_0xf266('0xb5')](function(_0x4d0078){_0x4cd565=_0x4d0078[_0xf266('0x119')]==0x1;if(_0x50b0e2['countdropretry']>=_0x33d471[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]][_0xf266('0x11a')]){_0x33d471[_0xf266('0x112')](_0x50b0e2,_0x4d0078[_0xf266('0x119')]);}else{_0x33d471[_0xf266('0xbf')]({'active':![],'countdropretry':_0x50b0e2['countdropretry'],'scheduledat':moment()[_0xf266('0x105')](_0x33d471[_0xf266('0x21')][_0x229626['queue']]['dialDropRetryFrequency'],_0xf266('0xfe'))[_0xf266('0x7c')](_0xf266('0xff')),'ContactId':_0x2a6e65[_0xf266('0xd2')],'ListId':_0x2a6e65[_0xf266('0xd3')],'VoiceQueueId':_0x2a6e65[_0xf266('0xd4')]||undefined,'CampaignId':_0x2a6e65[_0xf266('0xd5')]||undefined})[_0xf266('0xae')](loggerCatch(_0xf266('0x11b')));var _0x272bad=new History(_0x50b0e2);_0x272bad[_0xf266('0xa3')]=0xa;_0x272bad['statedesc']='Drop';_0x272bad[_0xf266('0xa6')]=moment()[_0xf266('0x7c')](_0xf266('0xff'));_0x272bad[_0xf266('0xa5')]=_0x272bad['starttime'];_0x272bad[_0xf266('0x11c')]=_0x50b0e2[_0xf266('0x11c')];_0x272bad[_0xf266('0x11d')]=_0x50b0e2[_0xf266('0x11d')];_0x33d471['createHistory'](_0x272bad)['catch'](loggerCatch(_0xf266('0x11e')));}})['then'](function(){if(_0x4cd565)_0x33d471['swapAdditionalPhones'](_0x50b0e2,_0x144d57,_0x305c18)['then'](function(){return 0x1;});});}else{this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x229626[_0xf266('0xb1')]][_0xf266('0x11f')]+=0x1;_0x50b0e2[_0xf266('0xa3')]=0xb;_0x50b0e2['statedesc']=_0xf266('0x120');_0x50b0e2[_0xf266('0x115')]='CALLEREXIT';_0x50b0e2[_0xf266('0xf6')]+=0x1;_0x50b0e2[_0xf266('0xed')]+=0x1;_0x144d57=this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]][_0xf266('0x121')];_0x305c18=this[_0xf266('0x21')][_0x229626[_0xf266('0xb1')]][_0xf266('0x122')];_0x33d471[_0xf266('0xb8')](_0x50b0e2,_0x50b0e2[_0xf266('0xa3')],_0x2a6e65['voiceQueue'])['then'](function(_0x358389){if(_0x50b0e2[_0xf266('0xf6')]>=_0x33d471['voiceQueues'][_0x229626['queue']]['dialAbandonedMaxRetry']){_0x33d471[_0xf266('0x112')](_0x50b0e2,_0x358389['additional']);}else{_0x33d471[_0xf266('0xbf')]({'active':![],'countabandonedretry':_0x50b0e2[_0xf266('0xf6')],'scheduledat':moment()[_0xf266('0x105')](_0x33d471['voiceQueues'][_0x229626[_0xf266('0xb1')]][_0xf266('0x121')],'minutes')[_0xf266('0x7c')](_0xf266('0xff')),'ContactId':_0x2a6e65[_0xf266('0xd2')],'ListId':_0x2a6e65[_0xf266('0xd3')],'VoiceQueueId':_0x2a6e65[_0xf266('0xd4')]||undefined,'CampaignId':_0x2a6e65['CampaignId']||undefined})[_0xf266('0xae')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5ed42e=new History(_0x50b0e2);_0x5ed42e['state']=0xb;_0x5ed42e[_0xf266('0xa4')]='Abandoned';_0x5ed42e[_0xf266('0xa6')]=moment()['format'](_0xf266('0xff'));_0x5ed42e['endtime']=_0x5ed42e[_0xf266('0xa6')];_0x5ed42e[_0xf266('0x11c')]=_0x50b0e2[_0xf266('0x11c')];_0x5ed42e['calleridnum']=_0x50b0e2[_0xf266('0x11d')];_0x33d471['createHistory'](_0x5ed42e)['catch'](loggerCatch(_0xf266('0x123')));}})[_0xf266('0xb5')](function(){if(_0x4cd565)_0x33d471[_0xf266('0xba')](_0x50b0e2,_0x144d57,_0x305c18)[_0xf266('0xb5')](function(){return 0x1;});});}}}};Dialer[_0xf266('0xa7')][_0xf266('0x3a')]=function(_0x4bb6be){if(this['actions'][_0x4bb6be[_0xf266('0xe3')]]){this[_0xf266('0x27')][_0x4bb6be[_0xf266('0xe3')]]['channel']=_0x4bb6be['channel'];}if(this['uniqueId'][_0x4bb6be['uniqueid']]){this[_0xf266('0x29')][_0x4bb6be[_0xf266('0xe3')]]['channel']=_0x4bb6be[_0xf266('0xad')];}};Dialer[_0xf266('0xa7')][_0xf266('0x3d')]=function(_0x13e009){if(strategy[this[_0xf266('0x21')][this['actions'][_0x13e009[_0xf266('0x124')]][_0xf266('0xb1')]][_0xf266('0x52')]]===_0xf266('0x1b')){if(this['actions'][_0x13e009[_0xf266('0x124')]]&&_[_0xf266('0xab')](this[_0xf266('0x27')][_0x13e009[_0xf266('0x124')]][_0xf266('0x125')])&&_0x13e009[_0xf266('0xda')]==='1'&&_0x13e009[_0xf266('0x126')]==='0'){if(this[_0xf266('0x23')][_0x13e009[_0xf266('0x127')]]){if(!this['agents'][_0x13e009[_0xf266('0x127')]][_0xf266('0x125')]){this['agents'][_0x13e009['stateinterface']][_0xf266('0x125')]=!![];this[_0xf266('0x27')][_0x13e009['actionid']]['locked']=!![];this[_0xf266('0x27')][_0x13e009[_0xf266('0x124')]][_0xf266('0x127')]=_0x13e009['stateinterface'];}}}}else if((strategy[this[_0xf266('0x21')][this[_0xf266('0x27')][_0x13e009[_0xf266('0x124')]][_0xf266('0xb1')]]['strategy']]||_0xf266('0x1a'))===_0xf266('0x1a')){if(this[_0xf266('0x27')][_0x13e009[_0xf266('0x124')]]){if(this[_0xf266('0x23')][_0x13e009[_0xf266('0x127')]]){this[_0xf266('0x27')][_0x13e009['actionid']][_0xf266('0x127')]=_0x13e009[_0xf266('0x127')];if(_[_0xf266('0xab')](this[_0xf266('0x128')][this['actions'][_0x13e009[_0xf266('0x124')]][_0xf266('0xb1')]])){this[_0xf266('0x128')][this['actions'][_0x13e009['actionid']][_0xf266('0xb1')]]=[];}this[_0xf266('0x128')][this[_0xf266('0x27')][_0x13e009[_0xf266('0x124')]]['queue']][_0xf266('0x129')](_['merge'](_[_0xf266('0xd1')](this[_0xf266('0x27')][_0x13e009[_0xf266('0x124')]],[_0xf266('0x12a'),_0xf266('0x127')]),{'status':_0x13e009[_0xf266('0xda')],'paused':_0x13e009[_0xf266('0x126')]}));}}}};function unlockQueueStatus(_0x1511bb,_0x5cddfd){setTimeout(function(){if(_[_0xf266('0x40')](_0x1511bb['queueStatusComplete'])){loggerBooked['error'](_0xf266('0x12b'),_0x5cddfd);}_0x1511bb[_0xf266('0x12c')]=!![];loggerBooked['info'](_0xf266('0x12d'),_0x5cddfd,JSON[_0xf266('0x79')](_[_0xf266('0xd1')](_0x1511bb,[_0xf266('0x45'),_0xf266('0x12c')])));},0x1f3);}Dialer[_0xf266('0xa7')][_0xf266('0x12e')]=function(_0x249ce4){var _0x35278c=this;var _0x10b88a=_0x35278c[_0xf266('0x21')][_0x35278c[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]['queue']];if(strategy[this[_0xf266('0x21')][this['actions'][_0x249ce4[_0xf266('0x124')]]['queue']][_0xf266('0x52')]]===_0xf266('0x1b')){if(this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]&&this[_0xf266('0x27')][_0x249ce4['actionid']][_0xf266('0x127')]){this['preview'][_0xf266('0x12f')](this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]][_0xf266('0x12a')],this['actions'][_0x249ce4['actionid']][_0xf266('0x127')])['catch'](function(_0x5e0360){logger[_0xf266('0x95')](_0xf266('0x130'),util[_0xf266('0x94')](_0x5e0360,{'showHidden':![],'depth':null}));})['finally'](function(){_0x35278c[_0xf266('0xaf')](_0x35278c[_0xf266('0x21')][_0x35278c[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]['queue']]);_0x35278c[_0xf266('0x23')][_0x35278c[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]][_0xf266('0x127')]][_0xf266('0x125')]=![];delete _0x35278c[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]];unlockQueueStatus(_0x10b88a);});}else{this[_0xf266('0xaf')](this[_0xf266('0x21')][this[_0xf266('0x27')][_0x249ce4['actionid']][_0xf266('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x249ce4['actionid']][_0xf266('0xd2')],'ListId':this['actions'][_0x249ce4[_0xf266('0x124')]][_0xf266('0xd3')],'VoiceQueueId':this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]][_0xf266('0xd4')]||undefined,'CampaignId':this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]][_0xf266('0xd5')]||undefined})[_0xf266('0xae')](loggerCatch(_0xf266('0x131')));delete this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]];unlockQueueStatus(_0x10b88a);}}else if((strategy[this[_0xf266('0x21')][this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]['queue']][_0xf266('0x52')]]||'rrmemory')===_0xf266('0x1a')){var _0x56aa5d;if(this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]&&!_['isEmpty'](this[_0xf266('0x128')][this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]['queue']])){if(this[_0xf266('0x2c')][_0x35278c['actions'][_0x249ce4[_0xf266('0x124')]][_0xf266('0xb1')]]){this[_0xf266('0x2c')][_0x35278c[_0xf266('0x27')][_0x249ce4['actionid']][_0xf266('0xb1')]]=this[_0xf266('0x2c')][this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]['queue']]?this['queueBookedRR'][this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]['queue']]:this[_0xf266('0x128')][this[_0xf266('0x27')][_0x249ce4['actionid']][_0xf266('0xb1')]]?this['queueBooked'][this[_0xf266('0x27')][_0x249ce4[_0xf266('0x124')]]['queue']][_0xf266('0x132')]||0x0:0x0;}this['queueBooked'][this[_0xf266('0x27')][_0x249ce4['actionid']]['queue']]['_rr']=this[_0xf266('0x2c')][this['actions'][_0x249ce4[_0xf266('0x124')]][_0xf266('0xb1')]];for(var _0xe0df0e=0x0;_0xe0df0e=0x0;})[_0xf266('0xae')](myreject(_0x365ccb)));}}else{_0x1e9506[_0xf266('0x129')](ami['Action']({'action':_0xf266('0x14b'),'command':util[_0xf266('0x7c')](_0xf266('0x146'),_0x3955bc,!_[_0xf266('0x40')](config[_0xf266('0x148')][_0x255135])?_0x255135:'')})['then'](function(_0x3b5697){return _0x3b5697[_0xf266('0x149')][_0xf266('0x14a')](_0xf266('0x14c'))>=0x0;})[_0xf266('0xae')](myreject(_0x365ccb)));}Promise[_0xf266('0x14d')](_0x1e9506)[_0xf266('0xb5')](function(_0x61fc42){var _0x5bfa34=_['some'](_0x61fc42);if(_0x5bfa34){return _0x381ac1(_0x5bfa34);}else{_0x490f61[_0xf266('0x41')]=_0x500d81?_0xf266('0x14e'):_0xf266('0x14f');return _0x365ccb(msgResponse(_0xf266('0x150'),_0xf266('0x140'),_0xf266('0x151')+_0x500d81+'\x20'+_0x5f5bd1+_0xf266('0x152')+util[_0xf266('0x94')](_0x3955bc,{'showHidden':![],'depth':null})+_0xf266('0x153')+_0x255135));}})['catch'](function(_0x4ab4ac){return _0x365ccb(msgResponse('ifTime','Failure',JSON[_0xf266('0x79')](_0x4ab4ac)));});});};Dialer[_0xf266('0xa7')]['checkDialMethod']=function(_0x4ac8ca){var _0x25e25c=this;return function(){switch(_0x4ac8ca[_0xf266('0x5d')]){case _0xf266('0x154'):freeVariablesPredictive(_0x4ac8ca);_0x25e25c['handlePower'](_0x4ac8ca,0x1);break;case _0xf266('0x155'):freeVariablesPredictive(_0x4ac8ca);_0x25e25c[_0xf266('0x156')](_0x4ac8ca,_0x4ac8ca[_0xf266('0x157')]);break;case _0xf266('0x158'):_0x25e25c[_0xf266('0x158')](_0x4ac8ca);break;case _0xf266('0x7'):freeVariablesPredictive(_0x4ac8ca);_0x25e25c['handlePower'](_0x4ac8ca,0x1);break;default:freeVariablesPredictive(_0x4ac8ca);logger[_0xf266('0x95')](_0xf266('0x159'),_0x4ac8ca[_0xf266('0x45')],_0xf266('0x15a'));}};};Dialer['prototype'][_0xf266('0x15b')]=function(_0x2c6364){return Promise[_0xf266('0xb4')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x2c6364['id'],previewRecallmeReminderInterval))[_0xf266('0xb5')](function(_0x4df5e7){for(var _0x592564=0x0;_0x592564<_0x4df5e7[_0xf266('0x96')];_0x592564++){var _0x2939ff=_0x4df5e7[_0x592564][_0xf266('0x15c')][_0xf266('0x45')];if(_0x2939ff)io['to'](util['format'](_0xf266('0x15d'),_0x2939ff))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x4df5e7[_0x592564]});}})[_0xf266('0xae')](function(){});};Dialer[_0xf266('0xa7')][_0xf266('0x15e')]=function(_0x4e3ac3){var _0x5db84c=this;return function(){_0x5db84c[_0xf266('0x15f')](_0x4e3ac3);};};Dialer[_0xf266('0xa7')]['syncQueueSummary']=function(_0x3971c1){var _0x251a8d=this;if(isNotPreview(_0x3971c1[_0xf266('0x5d')])){if(isVoiceQueueOutbound(_0x3971c1[_0xf266('0x7a')])&&isActive(_0x3971c1['dialActive'])){_0x3971c1[_0xf266('0xa1')]=!![];Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](checkIsLoggedIn(_0x3971c1,_0x3971c1[_0xf266('0x55')]))['then'](checkIsActive(_0x3971c1,_0x3971c1[_0xf266('0x5c')]))[_0xf266('0xb5')](checkInterval(_0x3971c1))[_0xf266('0xb5')](_0x251a8d['checkIsTrunkReachable'](_0x3971c1))['then'](_0x251a8d[_0xf266('0x13e')](_0x3971c1[_0xf266('0x160')],_0x3971c1['dialTimezone'],_0x3971c1[_0xf266('0x45')],_0x3971c1))[_0xf266('0xb5')](_0x251a8d[_0xf266('0x161')](_0x3971c1[_0xf266('0x47')],_0x3971c1['dialTimezone'],_0x3971c1[_0xf266('0x45')],_0x3971c1))['then'](_0x251a8d[_0xf266('0x162')](_0x3971c1))[_0xf266('0xae')](loggerCatchQueueSummary(_0xf266('0x163'),_0x3971c1));}else{notSendMessagesQueue(_0x3971c1);}}else{freeVariablesPredictive(_0x3971c1);}};Dialer['prototype'][_0xf266('0x164')]=_[_0xf266('0x165')](function(){var _0x597125=_[_0xf266('0x166')](this['voiceQueues'],function(_0x39f2ee){return _0x39f2ee[_0xf266('0x167')];});var _0x111f2d=_[_0xf266('0x166')](this[_0xf266('0x23')],function(_0xbc34cf){return _0xbc34cf[_0xf266('0x168')]&&_0xbc34cf[_0xf266('0xda')]===_0xf266('0x169');});if(_0x597125[_0xf266('0x96')]>0x0&&_0x111f2d[_0xf266('0x96')]>0x0){return Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x597125,'id'),previewRecallmeReminderInterval,_['map'](_0x111f2d,'id')))['then'](function(_0x126d93){for(var _0x19195a=0x0;_0x19195a<_0x126d93[_0xf266('0x96')];_0x19195a++){var _0x3eb22b=_0x126d93[_0x19195a][_0xf266('0x15c')]['name'];if(_0x3eb22b)io['to'](util[_0xf266('0x7c')](_0xf266('0x15d'),_0x3eb22b))[_0xf266('0x50')](_0xf266('0x16a'),{'hopper':_0x126d93[_0x19195a]});}})['catch'](function(_0x51e25b){logger[_0xf266('0x95')]('checkPreviewRecallReminder',_0x51e25b);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xf266('0x13a')]=function(){var _0x6d13ed=this;var _0x4ebcae;for(var _0x529db3 in this[_0xf266('0x22')]){if(typeof this[_0xf266('0x22')][_0x529db3]!==_0xf266('0x97')){_0x4ebcae=this[_0xf266('0x22')][_0x529db3];if(isCampaignIvr(_0x4ebcae[_0xf266('0x7a')])&&isActive(_0x4ebcae[_0xf266('0x78')])){_0x4ebcae[_0xf266('0xa1')]=!![];Promise[_0xf266('0xb4')]()[_0xf266('0xb5')](checkIsActive(_0x4ebcae,_0x4ebcae[_0xf266('0x78')]))[_0xf266('0xb5')](checkInterval(_0x4ebcae))[_0xf266('0xb5')](_0x6d13ed[_0xf266('0x13b')](_0x4ebcae))['then'](_0x6d13ed[_0xf266('0x13e')](_0x4ebcae[_0xf266('0x160')],_0x4ebcae[_0xf266('0x16b')],_0x4ebcae[_0xf266('0x45')],_0x4ebcae))[_0xf266('0xb5')](_0x6d13ed['checkIfTimeIntervals'](_0x4ebcae[_0xf266('0x47')],_0x4ebcae[_0xf266('0x16b')],_0x4ebcae['name'],_0x4ebcae))['then'](_0x6d13ed['launchHandleIvr'](_0x4ebcae))['catch'](loggerCatchQueueSummary(_0xf266('0x16c'),_0x4ebcae));}else{notSendMessagesCampaign(_0x4ebcae);}}}};function getCallerIdRandom(_0x18d610,_0x13165e){var _0x503751;var _0x4f4dbb;var _0x2d47c2;if(_0x13165e<=0x0){_0x13165e=0x1;}_0x503751=new RegExp(_0xf266('0x16d')+_0x13165e+'}$');_0x4f4dbb=Math[_0xf266('0x16e')](0xa,_0x13165e-0x1);_0x2d47c2=Math[_0xf266('0x16e')](0xa,_0x13165e)-0x1;return util['format']('%s',_['replace'](_0x18d610,_0x503751,_[_0xf266('0x16f')](_0x4f4dbb,_0x2d47c2)));}function extractCalleridName(_0x3c0235){var _0x18133c=_0x3c0235[_0xf266('0x170')](/"(.*?)"/);return _0x18133c?_0x18133c[0x1]:_0x3c0235;}Dialer['prototype'][_0xf266('0x171')]=function(_0x27a3b4,_0x44f1dd){var _0x48c0eb=this;var _0x416103=uuid['v4']();this['actions'][_0x416103]=new Action(_0x27a3b4,_0x44f1dd,_0x416103);return new Promise(function(_0x21a472,_0x29798f){if(_[_0xf266('0x40')](_0x27a3b4)&&typeof _0x27a3b4!=='object'){return _0x29798f(msgResponse(_0xf266('0x172'),'Failure',_0xf266('0x173')));}if(_['isUndefined'](_0x44f1dd[_0xf266('0x174')])||_0x44f1dd[_0xf266('0x174')]===null){return _0x29798f(msgResponse('originate','Failure','contact\x20is\x20undefine'));}var _0x3ba608={'XMD-CALLERID':_0x48c0eb[_0xf266('0x27')][_0x416103][_0xf266('0x175')](),'XMD-AGI':_0x27a3b4['dialQueueProject']?util[_0xf266('0x7c')](_0xf266('0x176'),ipAgi,_0x27a3b4[_0xf266('0x109')]):_0xf266('0x177'),'XMD-AGIAFTER':_0x27a3b4[_0xf266('0x10e')]?util[_0xf266('0x7c')](_0xf266('0x176'),ipAgi,_0x27a3b4[_0xf266('0x10e')]):'NONE','XMD-QUEUE':_0x27a3b4['type']==='outbound'?util[_0xf266('0x7c')](_0xf266('0x178'),_0x27a3b4['name'],_0x27a3b4[_0xf266('0x179')]||'',_0x27a3b4[_0xf266('0x10f')]?'c':'',_0x27a3b4['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x44f1dd[_0xf266('0xd2')],'XMD-CDRTYPE':_0xf266('0x17a'),'CALLERID(all)':_0x48c0eb[_0xf266('0x27')][_0x416103]['getCaller'](),'XMD-AMD':_0x27a3b4['dialAMDActive']?_0xf266('0x17b'):_0xf266('0x177'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x27a3b4[_0xf266('0x103')]){_0x3ba608['XMD-AMDINITIALSILENCE']=_0x27a3b4[_0xf266('0x17c')]||0x9c4;_0x3ba608[_0xf266('0x17d')]=_0x27a3b4[_0xf266('0x17e')]||0x5dc;_0x3ba608['XMD-AMDAFTERGREETINGSILENCE']=_0x27a3b4[_0xf266('0x17f')]||0x320;_0x3ba608['XMD-AMDTOTALANALYSISTIME']=_0x27a3b4[_0xf266('0x180')]||0x1388;_0x3ba608['XMD-AMDMINWORDLENGTH']=_0x27a3b4[_0xf266('0x181')]||0x64;_0x3ba608['XMD-AMDBETWEENWORDSSILENCE']=_0x27a3b4[_0xf266('0x182')]||0x32;_0x3ba608[_0xf266('0x183')]=_0x27a3b4[_0xf266('0x184')]||0x3;_0x3ba608[_0xf266('0x185')]=_0x27a3b4[_0xf266('0x186')]||0x100;_0x3ba608[_0xf266('0x187')]=_0x27a3b4[_0xf266('0x188')]||0x1388;}if(_0x27a3b4[_0xf266('0x7a')]===_0xf266('0x51')){_0x3ba608[_0xf266('0x189')]=_0x44f1dd[_0xf266('0xd4')];}else{_0x3ba608['XMD-CAMPAIGNID']=_0x44f1dd['CampaignId'];}for(var _0x35ff45 in _0x44f1dd[_0xf266('0x18a')]){if(typeof _0x44f1dd[_0xf266('0x18a')][_0x35ff45]!==_0xf266('0x97')){if(isNotNull(_0x44f1dd[_0xf266('0x18a')][_0x35ff45])&&_0x35ff45!=='id'&&_0x35ff45!=='tags'&&_0x35ff45!==_0xf266('0x18b')&&_0x35ff45!=='updatedAt'){_0x3ba608[util[_0xf266('0x7c')](_0xf266('0x18c'),_0xf266('0x18d'),_[_0xf266('0x18e')](_0x35ff45))]=_0x44f1dd['Contact'][_0x35ff45];}}}var _0x3bf39e=_0x48c0eb[_0xf266('0xd8')](_0x27a3b4[_0xf266('0x77')])?getCallerId(_0x27a3b4[_0xf266('0x77')][_0xf266('0x18f')],_0x27a3b4[_0xf266('0x5e')],_0x27a3b4[_0xf266('0x190')]>0x0?getCallerIdRandom(_0x27a3b4[_0xf266('0x191')],_0x27a3b4[_0xf266('0x190')]):_0x27a3b4['dialOriginateCallerIdNumber']):getCallerId(_[_0xf266('0xab')](_0x27a3b4[_0xf266('0x13c')])?_0x27a3b4['Trunk']['callerid']:_0x27a3b4['TrunkBackup'][_0xf266('0x18f')],_0x27a3b4[_0xf266('0x5e')],_0x27a3b4[_0xf266('0x190')]>0x0?getCallerIdRandom(_0x27a3b4[_0xf266('0x191')],_0x27a3b4[_0xf266('0x190')]):_0x27a3b4[_0xf266('0x191')]);if(_0x3bf39e){_0x3ba608['XMD-ORIGINATECALLERIDNAME']=_0x48c0eb[_0xf266('0x27')][_0x416103][_0xf266('0x192')]=extractCalleridName(_0x3bf39e);_0x3ba608['XMD-ORIGINATECALLERIDNUM']=_0x44f1dd[_0xf266('0x174')];}_0x27a3b4[_0xf266('0x193')]=_0x3ba608;return ami[_0xf266('0xac')]({'actionid':_0x416103,'action':_0xf266('0x172'),'channel':_0x48c0eb['isTrunkReachable'](_0x27a3b4['Trunk'])?util[_0xf266('0x7c')](_0xf266('0x194'),_0x27a3b4[_0xf266('0x77')][_0xf266('0x45')],isNotNull(_0x27a3b4[_0xf266('0x60')])?_0x27a3b4[_0xf266('0x60')][_0xf266('0x195')]()||'':'',_0x27a3b4['dialCutDigit']>0x0?_0x44f1dd[_0xf266('0x174')]['substring'](_0x27a3b4['dialCutDigit']):_0x44f1dd['phone']):util[_0xf266('0x7c')]('SIP/%s/%s%s',_[_0xf266('0xab')](_0x27a3b4[_0xf266('0x13c')])?_0x27a3b4[_0xf266('0x77')][_0xf266('0x45')]:_0x27a3b4[_0xf266('0x13c')]['name'],isNotNull(_0x27a3b4[_0xf266('0x60')])?_0x27a3b4[_0xf266('0x60')][_0xf266('0x195')]()||'':'',_0x27a3b4[_0xf266('0x196')]>0x0?_0x44f1dd[_0xf266('0x174')][_0xf266('0x197')](_0x27a3b4[_0xf266('0x196')]):_0x44f1dd[_0xf266('0x174')]),'callerid':_0x3bf39e,'Exten':'xcally-motion-dialer','Context':_0xf266('0x198'),'Priority':'1','variable':_0x3ba608,'timeout':(_0x27a3b4[_0xf266('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x416103})[_0xf266('0xb5')](function(_0x371df3){return _0x21a472(_0x371df3);})[_0xf266('0xae')](function(_0x175512){_0x27a3b4[_0xf266('0x65')]+=0x1;var _0x56deb2=new History(_0x48c0eb[_0xf266('0x27')][_0x416103]);logger[_0xf266('0x95')](util[_0xf266('0x7c')](_0xf266('0x199'),JSON['stringify'](_0x175512)));_0x56deb2['state']=0xe;_0x56deb2[_0xf266('0xa4')]=_0xf266('0x19a');_0x56deb2[_0xf266('0xa6')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x56deb2[_0xf266('0xa5')]=_0x56deb2['starttime'];_0x48c0eb['createHistory'](_0x56deb2)[_0xf266('0xae')](loggerCatch(_0xf266('0x19b')));_0x48c0eb[_0xf266('0xca')](_0x56deb2)[_0xf266('0xae')](loggerCatch('[originate][error]'))[_0xf266('0x1e')](function(){delete _0x48c0eb[_0xf266('0x27')][_0x416103];return _0x29798f(msgResponse(_0xf266('0x172'),_0xf266('0x4d'),_0xf266('0x19c')));});});});};Dialer[_0xf266('0xa7')][_0xf266('0x33')]=function(_0x1cc2ae){var _0x23ba05=this[_0xf266('0x27')][_0x1cc2ae[_0xf266('0x124')]];if(_0x23ba05){delete this[_0xf266('0x27')][_0x1cc2ae[_0xf266('0x124')]];_0x23ba05[_0xf266('0x19d')]=moment()[_0xf266('0x7c')](_0xf266('0xff'));var _0x498288=_0x23ba05[_0xf266('0x7a')]===_0xf266('0x7b')?this[_0xf266('0x22')][_0x23ba05[_0xf266('0xb1')]]:this[_0xf266('0x21')][_0x23ba05[_0xf266('0x19e')]()];if(!this[_0xf266('0xd7')](_0x1cc2ae[_0xf266('0x19f')])){this[_0xf266('0xaf')](_0x498288);return this[_0xf266('0x1a0')](_0x23ba05,_0x498288,_0x1cc2ae)[_0xf266('0xae')](loggerCatch(_0xf266('0x1a1')));}this[_0xf266('0x29')][_0x1cc2ae[_0xf266('0xe3')]]=_0x23ba05;}};Dialer[_0xf266('0xa7')][_0xf266('0x1a2')]=function(_0x23dd3f,_0xcf2dd2,_0x3f87bf){var _0x45b27a=new History(_0xcf2dd2);if(_0x45b27a[_0xf266('0xf1')]+_0x45b27a['countcongestionretry']+_0x45b27a[_0xf266('0xf3')]+_0x45b27a[_0xf266('0xf4')]+_0x45b27a[_0xf266('0xf5')]+_0x45b27a[_0xf266('0xf6')]+_0x45b27a[_0xf266('0xf7')]+_0x45b27a['countagentrejectretry']>=_0x3f87bf['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x23dd3f){case 0x3:if(_0x45b27a[_0xf266('0xf3')]>=_0x3f87bf[_0xf266('0x1a3')]-0x1){return!![];}this[_0xf266('0xbf')]({'active':![],'countnoanswerretry':_0x45b27a['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x3f87bf[_0xf266('0x1a4')],_0xf266('0xfe'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a[_0xf266('0xd3')],'VoiceQueueId':_0x45b27a['VoiceQueueId']||undefined,'CampaignId':_0x45b27a['CampaignId']||undefined})[_0xf266('0xae')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x45b27a[_0xf266('0xf1')]>=_0x3f87bf[_0xf266('0x1a5')]-0x1){return!![];}this[_0xf266('0xbf')]({'active':![],'countbusyretry':_0x45b27a[_0xf266('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x3f87bf[_0xf266('0x1a6')],_0xf266('0xfe'))[_0xf266('0x7c')](_0xf266('0xff')),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a['ListId'],'VoiceQueueId':_0x45b27a[_0xf266('0xd4')]||undefined,'CampaignId':_0x45b27a['CampaignId']||undefined})[_0xf266('0xae')](loggerCatch(_0xf266('0x1a7')));break;case 0x8:if(_0x45b27a[_0xf266('0xf2')]>=_0x3f87bf[_0xf266('0x1a8')]-0x1){return!![];}this[_0xf266('0xbf')]({'active':![],'countcongestionretry':_0x45b27a[_0xf266('0xf2')]+=0x1,'scheduledat':moment()[_0xf266('0x105')](_0x3f87bf[_0xf266('0x1a9')],_0xf266('0xfe'))['format'](_0xf266('0xff')),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a[_0xf266('0xd3')],'VoiceQueueId':_0x45b27a['VoiceQueueId']||undefined,'CampaignId':_0x45b27a[_0xf266('0xd5')]||undefined})['catch'](loggerCatch(_0xf266('0x1aa')));break;case 0x0:if(_0x45b27a[_0xf266('0xf4')]>=_0x3f87bf[_0xf266('0x1ab')]-0x1){return!![];}else{this[_0xf266('0xbf')]({'active':![],'countnosuchnumberretry':_0x45b27a[_0xf266('0xf4')]+=0x1,'scheduledat':moment()[_0xf266('0x105')](_0x3f87bf[_0xf266('0x1ac')],_0xf266('0xfe'))[_0xf266('0x7c')](_0xf266('0xff')),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a[_0xf266('0xd3')],'VoiceQueueId':_0x45b27a[_0xf266('0xd4')]||undefined,'CampaignId':_0x45b27a[_0xf266('0xd5')]||undefined})['catch'](loggerCatch(_0xf266('0x1ad')));}break;case 0xa:if(_0x45b27a[_0xf266('0xf5')]>=_0x3f87bf['dialDropMaxRetry']-0x1){return!![];}this[_0xf266('0xbf')]({'active':![],'countdropretry':_0x45b27a['countdropretry']+=0x1,'scheduledat':moment()[_0xf266('0x105')](_0x3f87bf[_0xf266('0x117')],_0xf266('0xfe'))[_0xf266('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a[_0xf266('0xd3')],'VoiceQueueId':_0x45b27a[_0xf266('0xd4')]||undefined,'CampaignId':_0x45b27a[_0xf266('0xd5')]||undefined})['catch'](loggerCatch(_0xf266('0x11b')));break;case 0xb:if(_0x45b27a[_0xf266('0xf6')]>=_0x3f87bf[_0xf266('0x1ae')]-0x1){return!![];}this[_0xf266('0xbf')]({'active':![],'countabandonedretry':_0x45b27a[_0xf266('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x3f87bf['dialAbandonedRetryFrequency'],_0xf266('0xfe'))[_0xf266('0x7c')](_0xf266('0xff')),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a[_0xf266('0xd3')],'VoiceQueueId':_0x45b27a[_0xf266('0xd4')]||undefined,'CampaignId':_0x45b27a[_0xf266('0xd5')]||undefined})[_0xf266('0xae')](loggerCatch(_0xf266('0x1af')));break;case 0x13:if(_0x45b27a['countmachineretry']>=_0x3f87bf[_0xf266('0xfb')]-0x1){return!![];}this[_0xf266('0xbf')]({'active':![],'countmachineretry':_0x45b27a[_0xf266('0xf7')]+=0x1,'scheduledat':moment()[_0xf266('0x105')](_0x3f87bf[_0xf266('0xfd')],_0xf266('0xfe'))[_0xf266('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a[_0xf266('0xd3')],'VoiceQueueId':_0x45b27a[_0xf266('0xd4')]||undefined,'CampaignId':_0x45b27a[_0xf266('0xd5')]||undefined})[_0xf266('0xae')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x45b27a['countagentrejectretry']>=_0x3f87bf[_0xf266('0x1b0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x45b27a[_0xf266('0xf8')]+=0x1,'scheduledat':moment()[_0xf266('0x105')](_0x3f87bf['dialAgentRejectRetryFrequency'],_0xf266('0xfe'))[_0xf266('0x7c')](_0xf266('0xff')),'ContactId':_0x45b27a[_0xf266('0xd2')],'ListId':_0x45b27a[_0xf266('0xd3')],'VoiceQueueId':_0x45b27a[_0xf266('0xd4')]||undefined,'CampaignId':_0x45b27a['CampaignId']||undefined})['catch'](loggerCatch(_0xf266('0x1b1')));break;default:return!![];}};Dialer[_0xf266('0xa7')]['callProgressDetecting']=function(_0x1d740b,_0x2e8901,_0x2b1cb0){var _0x1a5c8a=this;var _0x48a138=new History(_0x1d740b);var _0x2e05eb=![];var _0x121515;var _0x1d7e8f;return new Promise(function(_0x91d8f8,_0x4b88a5){if(_[_0xf266('0x40')](_0x2e8901)&&typeof _0x2e8901!=='object'){return _0x4b88a5(msgResponse(_0xf266('0x1b2'),'Failure',_0xf266('0x1b3')));}if(_[_0xf266('0x40')](_0x2b1cb0)&&typeof _0x2b1cb0!==_0xf266('0x1b4')){return _0x4b88a5(msgResponse(_0xf266('0x1b2'),_0xf266('0x140'),'evt\x20is\x20undefine'));}_0x1a5c8a[_0xf266('0xb8')](_0x48a138,_0x2b1cb0[_0xf266('0x1b5')],_0x2e8901)[_0xf266('0xb5')](function(_0x447b06){if(_0x447b06[_0xf266('0x119')]==0x1)_0x2e05eb=!![];switch(_0x2b1cb0[_0xf266('0x1b5')]){case'0':_0x2e8901[_0xf266('0x1b6')]+=0x1;_0x48a138['state']=0x0;_0x48a138[_0xf266('0xa4')]='NoSuchNumber';_0x48a138['countnosuchnumberretry']+=0x1;_0x48a138[_0xf266('0xed')]+=0x1;ami[_0xf266('0x50')](_0xf266('0x1b7'),ut[_0xf266('0xef')](_0x1d740b,_0xf266('0x1b8')));_0x121515=_0x2e8901['dialNoSuchNumberRetryFrequency'];_0x1d7e8f=_0x2e8901[_0xf266('0x122')];_0x1a5c8a['createHistory'](_0x48a138)[_0xf266('0xae')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1a5c8a[_0xf266('0x1a2')](0x0,_0x1d740b,_0x2e8901)&&!_0x2e05eb){if(_0x48a138[_0xf266('0xf4')]>=_0x2e8901[_0xf266('0x1ab')]){_0x1a5c8a[_0xf266('0xfc')](_0x48a138,_0x91d8f8,_0x4b88a5,_0xf266('0x1b9'));}else{_0x1a5c8a[_0xf266('0xf9')](_0x48a138,_0x91d8f8,_0x4b88a5,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2e8901[_0xf266('0x1ba')]+=0x1;_0x48a138['state']=0x3;_0x48a138[_0xf266('0xa4')]=_0xf266('0x1bb');_0x48a138[_0xf266('0xf3')]+=0x1;_0x48a138[_0xf266('0xed')]+=0x1;var _0x1fb91b=ut[_0xf266('0x1bc')](_0x1d740b,_0x2e8901);ami['emit'](_0xf266('0x1bd'),_0x1fb91b);_0x121515=_0x2e8901[_0xf266('0x1a4')];_0x1d7e8f=_0x2e8901[_0xf266('0x122')];_0x1a5c8a['createHistory'](_0x48a138)['catch'](loggerCatch(_0xf266('0x1be')));if(_0x1a5c8a[_0xf266('0x1a2')](0x3,_0x1d740b,_0x2e8901)&&!_0x2e05eb){if(_0x48a138[_0xf266('0xf3')]>=_0x2e8901['dialNoAnswerMaxRetry']){_0x1a5c8a[_0xf266('0xfc')](_0x48a138,_0x91d8f8,_0x4b88a5,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1a5c8a[_0xf266('0xf9')](_0x48a138,_0x91d8f8,_0x4b88a5,_0xf266('0x1bf'));}}break;case'5':_0x2e8901['outboundBusyCallsDay']+=0x1;_0x48a138[_0xf266('0xa3')]=0x5;_0x48a138[_0xf266('0xa4')]=_0xf266('0x1c0');_0x48a138[_0xf266('0xf1')]+=0x1;_0x48a138[_0xf266('0xed')]+=0x1;ami[_0xf266('0x50')](_0xf266('0x1c1'),ut[_0xf266('0xef')](_0x1d740b,_0xf266('0x1c2')));_0x121515=_0x2e8901[_0xf266('0x1a6')];_0x1d7e8f=_0x2e8901['callAdditionalPhoneAfterMin'];_0x1a5c8a[_0xf266('0xcb')](_0x48a138)[_0xf266('0xae')](loggerCatch(_0xf266('0x1c3')));if(_0x1a5c8a[_0xf266('0x1a2')](0x5,_0x1d740b,_0x2e8901)&&!_0x2e05eb){if(_0x48a138[_0xf266('0xf1')]>=_0x2e8901[_0xf266('0x1a5')]){_0x1a5c8a['createStateFinal'](_0x48a138,_0x91d8f8,_0x4b88a5,_0xf266('0x1c4'));}else{_0x1a5c8a[_0xf266('0xf9')](_0x48a138,_0x91d8f8,_0x4b88a5,_0xf266('0x1c4'));}}break;case'8':_0x2e8901[_0xf266('0x63')]+=0x1;_0x48a138[_0xf266('0xa3')]=0x8;_0x48a138[_0xf266('0xa4')]=_0xf266('0x1c5');_0x48a138[_0xf266('0xf2')]+=0x1;_0x48a138['countglobal']+=0x1;_0x121515=_0x2e8901[_0xf266('0x1a9')];_0x1d7e8f=_0x2e8901[_0xf266('0x122')];ami[_0xf266('0x50')](_0xf266('0x1c6'),ut[_0xf266('0xef')](_0x1d740b,'congestion'));_0x1a5c8a[_0xf266('0xcb')](_0x48a138)[_0xf266('0xae')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1a5c8a[_0xf266('0x1a2')](0x8,_0x1d740b,_0x2e8901)&&!_0x2e05eb){if(_0x48a138[_0xf266('0xf2')]>=_0x2e8901[_0xf266('0x1a8')]){_0x1a5c8a[_0xf266('0xfc')](_0x48a138,_0x91d8f8,_0x4b88a5,'reason\x208\x20congestion');}else{_0x1a5c8a[_0xf266('0xf9')](_0x48a138,_0x91d8f8,_0x4b88a5,'reason\x208\x20congestion');}}break;case'11':_0x2e8901[_0xf266('0x1c7')]+=0x1;_0x48a138['state']=0xb;_0x48a138[_0xf266('0xa4')]=_0xf266('0x120');_0x48a138[_0xf266('0xf6')]+=0x1;_0x48a138[_0xf266('0xed')]+=0x1;_0x121515=_0x2e8901[_0xf266('0x121')];_0x1d7e8f=_0x2e8901[_0xf266('0x122')];_0x1a5c8a['createHistory'](_0x48a138)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1a5c8a['checkRetriveMax'](0xb,_0x1d740b,_0x2e8901)&&!_0x2e05eb){if(_0x48a138[_0xf266('0xf6')]>=_0x2e8901['dialAbandonedMaxRetry']){_0x1a5c8a[_0xf266('0xfc')](_0x48a138,_0x91d8f8,_0x4b88a5,'reason\x2011\x20abandoned');}else{_0x1a5c8a[_0xf266('0xf9')](_0x48a138,_0x91d8f8,_0x4b88a5,_0xf266('0x1c8'));}}break;case'20':_0x2e8901[_0xf266('0x66')]+=0x1;_0x48a138[_0xf266('0xa3')]=0x14;_0x48a138[_0xf266('0xa4')]=_0xf266('0x1c9');_0x48a138[_0xf266('0xf8')]+=0x1;_0x48a138['countglobal']+=0x1;_0x121515=_0x2e8901[_0xf266('0x1ca')];_0x1d7e8f=_0x2e8901[_0xf266('0x122')];ami[_0xf266('0x50')](_0xf266('0x1cb'),ut['buildObj'](_0x1d740b,_0xf266('0x1cc')));_0x1a5c8a['createHistory'](_0x48a138)[_0xf266('0xae')](loggerCatch(_0xf266('0x1cd')));if(_0x1a5c8a[_0xf266('0x1a2')](0x14,_0x1d740b,_0x2e8901)&&!_0x2e05eb){if(_0x48a138['countagentrejectretry']>=_0x2e8901[_0xf266('0x1b0')]){_0x1a5c8a[_0xf266('0xfc')](_0x48a138,_0x91d8f8,_0x4b88a5,'reason\x2020\x20agentreject');}else{_0x1a5c8a['stateGlobal'](_0x48a138,_0x91d8f8,_0x4b88a5,_0xf266('0x1ce'));}}break;default:_0x2e8901[_0xf266('0x67')]+=0x1;_0x48a138[_0xf266('0xa3')]=0xc;_0x48a138[_0xf266('0xa4')]=_0x2b1cb0[_0xf266('0x1b5')];_0x121515=_0x2e8901[_0xf266('0x1ca')];_0x1d7e8f=_0x2e8901['callAdditionalPhoneAfterMin'];_0x1a5c8a[_0xf266('0xcb')](_0x48a138)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1a5c8a['checkRetriveMax'](_0x2b1cb0['reason'],_0x1d740b,_0x2e8901)&&!_0x2e05eb){if(_0x48a138[_0xf266('0xf1')]+_0x48a138[_0xf266('0xf2')]+_0x48a138['countnoanswerretry']+_0x48a138['countnosuchnumberretry']+_0x48a138[_0xf266('0xf5')]+_0x48a138[_0xf266('0xf6')]+_0x48a138['countmachineretry']+_0x48a138[_0xf266('0xf8')]>=_0x2e8901['dialGlobalMaxRetry']){_0x1a5c8a[_0xf266('0xf9')](_0x48a138,_0x91d8f8,_0x4b88a5,_0x2b1cb0[_0xf266('0x1b5')]);}else{_0x1a5c8a[_0xf266('0xfc')](_0x48a138,_0x91d8f8,_0x4b88a5,_0x2b1cb0[_0xf266('0x1b5')]);}}}})[_0xf266('0xb5')](function(){if(_0x2e05eb){_0x1a5c8a[_0xf266('0xba')](_0x48a138,_0x121515,_0x1d7e8f)['then'](function(){return _0x91d8f8(0x1);});}});});};Dialer[_0xf266('0xa7')][_0xf266('0xf9')]=function(_0x48f0aa,_0x228ff0,_0x116ef2,_0x4791a6){var _0xa0a034=new Final(_0x48f0aa);_0xa0a034[_0xf266('0xa3')]=0xf;_0xa0a034[_0xf266('0xa4')]='Global';this['createStateFinal'](_0xa0a034,_0x228ff0,_0x116ef2,_0x4791a6);};Dialer[_0xf266('0xa7')][_0xf266('0xfc')]=function(_0x207e4b,_0xc3af40,_0x87b7e8,_0x1cf048){this['moveContactManagedDialer'](_0x207e4b)[_0xf266('0xb5')](function(){return _0xc3af40(msgResponse(_0xf266('0x1b2'),_0xf266('0x1cf'),_0x1cf048));})[_0xf266('0xae')](function(){return _0x87b7e8(msgResponse(_0xf266('0x1d0'),'Failure',_0xf266('0x1d1')));});};Dialer[_0xf266('0xa7')][_0xf266('0x158')]=function(_0x502eb7){var _0x38882f=_0x502eb7[_0xf266('0x1d2')]/0x64;var _0x4dda57=_0x502eb7['outboundDropCallsDayTimeout']/(_0x502eb7['outboundDropCallsDayTimeout']+_0x502eb7[_0xf266('0x61')]);var _0x2584e2=Math['round'](_0x502eb7[_0xf266('0x6e')]*(_0x502eb7['predictiveIntervalMaxThreshold']/0x64));var _0xe07628=Math['round'](_0x502eb7[_0xf266('0x6e')]*(_0x502eb7[_0xf266('0x1d3')]/0x64));var _0x5dcbcb=_0x502eb7[_0xf266('0x54')]+_0x502eb7[_0xf266('0x58')];var _0x1cc5f1=Math['floor'](_0x502eb7[_0xf266('0x71')]*_0x502eb7[_0xf266('0x73')]*_0x502eb7[_0xf266('0x1d4')]*_0x502eb7[_0xf266('0x1d5')]);if(_[_0xf266('0x40')](_0x502eb7[_0xf266('0x76')])){if(!_['isUndefined'](_0x502eb7[_0xf266('0x75')])){_0x502eb7[_0xf266('0x75')]=undefined;loggerPredictive[_0xf266('0x95')](_0xf266('0x1d6'),_0xf266('0x1d7'));}if(!_[_0xf266('0x40')](_0x502eb7[_0xf266('0x8e')])){loggerPredictive[_0xf266('0x95')](_0xf266('0x1d6'),_0xf266('0x1d8'));clearInterval(_0x502eb7[_0xf266('0x8e')]);_0x502eb7[_0xf266('0x8e')]=undefined;}_0x502eb7[_0xf266('0x76')]=moment()[_0xf266('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf266('0x7f')](_0x502eb7['name'],_0xf266('0x1d9'),_0x502eb7[_0xf266('0x76')]);this['handlePower'](_0x502eb7,0x1);}else if(ifInterval(_0x502eb7[_0xf266('0x1da')],_0x502eb7['startProgressive'])){this[_0xf266('0x156')](_0x502eb7,0x1);loggerPredictiveCalls[_0xf266('0x7f')]('[startMethodPredictive][StartProgressive][Loop]',_0x502eb7[_0xf266('0x76')],_0x502eb7['name']);_0x502eb7[_0xf266('0x71')]=0x0;_0x502eb7[_0xf266('0x6c')]=0x0;}else if(_0x38882f<_0x4dda57&&_0x502eb7[_0xf266('0x1db')]===_0xf266('0x1dc')){freeVariablesPredictive(_0x502eb7);loggerPredictive[_0xf266('0x7f')](_0xf266('0x1dd'),_0xf266('0x1de'),_0x4dda57,_0xf266('0x76'),_0x502eb7[_0xf266('0x45')]);}else if(_0x1cc5f1<_0x502eb7[_0xf266('0x6c')]&&_0x502eb7[_0xf266('0x1db')]===_0xf266('0x1dc')){freeVariablesPredictive(_0x502eb7);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x1cc5f1,_0xf266('0x1df'),_0x502eb7['predictiveIntervalErlangCallsDroppedCalls'],_0xf266('0x76'),_0x502eb7[_0xf266('0x45')]);}else if(!ifInterval(_0x502eb7[_0xf266('0x1da')],_0x502eb7[_0xf266('0x76')])&&_[_0xf266('0x40')](_0x502eb7[_0xf266('0x75')])&&!_['isUndefined'](_0x502eb7[_0xf266('0x76')])){_0x502eb7['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x502eb7[_0xf266('0x45')],_0xf266('0x1e0'),_0x502eb7[_0xf266('0x75')]);this[_0xf266('0xbd')](_0x502eb7['dialPredictiveInterval'])[_0xf266('0xb5')](this[_0xf266('0x1e1')](_0x502eb7))[_0xf266('0xb5')](mergeDataErlangB(_0x502eb7))[_0xf266('0xb5')](this[_0xf266('0x1e2')](_0x502eb7))['catch'](loggerCatchPredictive(_0xf266('0x1e3'),_0x502eb7));}else if(!ifInterval(_0x502eb7[_0xf266('0x1da')],_0x502eb7[_0xf266('0x75')])){_0x502eb7[_0xf266('0x6c')]=0x0;_0x502eb7[_0xf266('0x75')]=moment()[_0xf266('0x7c')](_0xf266('0xff'));loggerPredictive[_0xf266('0x7f')](_0x502eb7[_0xf266('0x45')],_0xf266('0x1e4'),_0x502eb7[_0xf266('0x75')]);clearInterval(_0x502eb7['handlePredictive']);_0x502eb7['handlePredictive']=undefined;this[_0xf266('0xbd')](_0x502eb7[_0xf266('0x1da')])[_0xf266('0xb5')](this[_0xf266('0x1e1')](_0x502eb7))[_0xf266('0xb5')](mergeDataErlangB(_0x502eb7))['then'](this[_0xf266('0x1e2')](_0x502eb7))['catch'](loggerCatchPredictive(_0xf266('0x1e5'),_0x502eb7));}else if(_0x502eb7['predictiveIntervalAvailable']&&_0x5dcbcb<_0x502eb7['predictiveIntervalAvailable']-_0xe07628){freeVariablesPredictive(_0x502eb7);loggerPredictive[_0xf266('0x7f')](_0x502eb7[_0xf266('0x45')],_0xf266('0x1e6'),_0x5dcbcb,_0xf266('0x1e7'),_0x502eb7[_0xf266('0x6e')],'-',_0xe07628,'=',_0x502eb7[_0xf266('0x6e')]-_0xe07628,')');}else if(_0x502eb7[_0xf266('0x6e')]&&_0x5dcbcb>_0x502eb7[_0xf266('0x6e')]+_0x2584e2){freeVariablesPredictive(_0x502eb7);loggerPredictive['info'](_0x502eb7[_0xf266('0x45')],_0xf266('0x1e6'),_0x5dcbcb,_0xf266('0x1e8'),_0x502eb7[_0xf266('0x6e')],'+',_0x2584e2,'=',_0x502eb7['predictiveIntervalAvailable']+_0x2584e2,')');}};Dialer[_0xf266('0xa7')][_0xf266('0x1e1')]=function(_0x464b1f){var _0x278100=this;return function(_0x5f5daa){return new Promise(function(_0x5e7474,_0x592a63){_[_0xf266('0xd0')](_0x464b1f,_0x5f5daa[0x0]);if(checkGetDataPredictive(_0x5f5daa[0x0])){var _0x5c0ec7=_0x464b1f[_0xf266('0x6e')]=_0x464b1f['talking']+_0x464b1f['available'];var _0x3f50c9=_0x464b1f[_0xf266('0x1da')]*0x3c;var _0xf77fa2=_0x5f5daa[0x0]['predictiveIntervalAvgTalktime']+_0x5f5daa[0x0][_0xf266('0x69')];var _0x27c3b0=(_0x5f5daa[0x0]['predictiveIntervalAnsweredCalls']+_0x5f5daa[0x0][_0xf266('0x6b')]+_0x5f5daa[0x0][_0xf266('0x83')])/_0x5f5daa[0x0][_0xf266('0x6f')];_0x464b1f[_0xf266('0x1d4')]=_0x27c3b0>0x0?_0x27c3b0:0x1;switch(_0x464b1f[_0xf266('0x1db')]){case _0xf266('0x1dc'):var _0x236840=_0x464b1f[_0xf266('0x1d2')]/0x64;return _0x278100[_0xf266('0x1e9')](_0x5c0ec7,_0x3f50c9,_0xf77fa2,_0x27c3b0,_0x236840)[_0xf266('0xb5')](function(_0x3e6136){return _0x5e7474(_0x3e6136);});case _0xf266('0x1ea'):var _0x1fd28b=_0x464b1f[_0xf266('0x1d2')]/0x64;return _0x278100[_0xf266('0x1eb')](_0x5c0ec7,_0x3f50c9,_0xf77fa2,_0x27c3b0,_0x1fd28b)[_0xf266('0xb5')](function(_0x201539){return _0x5e7474(_0x201539);});default:return _0x592a63(msgResponse(_0xf266('0x1ec'),_0xf266('0x140'),_0xf266('0x1ed')));}}else{return _0x592a63(msgResponse(_0xf266('0x1ec'),_0xf266('0x140'),_0xf266('0x1ee')));}});};};Dialer[_0xf266('0xa7')][_0xf266('0x1ef')]=function(_0x36170d){var _0x162d0c=this;return function(_0x2cebec){return new Promise(function(_0x2e9126,_0x3486fa){_[_0xf266('0xd0')](_0x36170d,_0x2cebec[0x0]);if(checkGetDataPredictive(_0x2cebec[0x0])){loggerPredictive[_0xf266('0x7f')](JSON[_0xf266('0x79')](_0x2cebec[0x0]));if(_0x36170d[_0xf266('0x1db')]===_0xf266('0x1dc')){return _0x162d0c[_0xf266('0xc8')](_0x36170d['id'])[_0xf266('0xb5')](function(_0x3591f1){var _0x564fb6=_0x36170d['loggedIn']-_0x3591f1[0x0][_0xf266('0x1f0')];var _0x368148=_0x36170d[_0xf266('0x1da')]*0x3c;var _0xbaa278=_0x2cebec[0x0]['predictiveIntervalAvgTalktime']+_0x2cebec[0x0][_0xf266('0x69')];var _0x1aec34=(_0x2cebec[0x0][_0xf266('0x68')]+_0x2cebec[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2cebec[0x0][_0xf266('0x83')])/_0x2cebec[0x0][_0xf266('0x6f')];var _0x50134a=_0x36170d['dialPredictiveOptimizationPercentage']/0x64;_0x36170d[_0xf266('0x6d')]=_0x3591f1[0x0][_0xf266('0x1f0')]||0x0;_0x36170d[_0xf266('0x1d4')]=_0x1aec34>0x0?_0x1aec34:0x1;return _0x162d0c['abandonmentRate'](_0x564fb6,_0x368148,_0xbaa278,_0x1aec34,_0x50134a);})[_0xf266('0xb5')](function(_0x69e15e){return _0x2e9126(_0x69e15e);})[_0xf266('0xae')](function(_0x1f7dc3){return _0x3486fa(msgResponse(_0xf266('0x1f1'),_0xf266('0x140'),JSON[_0xf266('0x79')](_0x1f7dc3)));});}if(_0x36170d[_0xf266('0x1db')]==='agentBusyFactor'){return _0x162d0c[_0xf266('0xc8')](_0x36170d['id'])[_0xf266('0xb5')](function(_0x18122c){var _0x50ac8b=_0x36170d[_0xf266('0x55')]-_0x18122c[0x0][_0xf266('0x1f0')];var _0x5a590c=_0x36170d[_0xf266('0x1da')]*0x3c;var _0x185cfc=_0x2cebec[0x0][_0xf266('0x6a')]+_0x2cebec[0x0][_0xf266('0x69')];var _0x56d2b8=(_0x2cebec[0x0]['predictiveIntervalAnsweredCalls']+_0x2cebec[0x0][_0xf266('0x6b')]+_0x2cebec[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2cebec[0x0]['predictiveIntervalTotalCalls'];var _0x17db94=_0x36170d[_0xf266('0x1d2')]/0x64;_0x36170d['predictiveIntervalPauses']=_0x18122c[0x0][_0xf266('0x1f0')]||0x0;_0x36170d[_0xf266('0x1d4')]=_0x56d2b8>0x0?_0x56d2b8:0x1;return _0x162d0c[_0xf266('0x1eb')](_0x50ac8b,_0x5a590c,_0x185cfc,_0x56d2b8,_0x17db94);})[_0xf266('0xb5')](function(_0xa1b19f){return _0x2e9126(_0xa1b19f);})[_0xf266('0xae')](function(_0x298f51){return _0x3486fa(msgResponse(_0xf266('0x1f1'),'Failure',JSON[_0xf266('0x79')](_0x298f51)));});}}else{return _0x3486fa(msgResponse(_0xf266('0x1ec'),_0xf266('0x140'),_0xf266('0x1ee')));}});};};Dialer[_0xf266('0xa7')][_0xf266('0x1e2')]=function(_0x12e756){var _0x3dfd66=this;return function(){var _0x16251d=0x0;var _0x475a14=Math['floor'](_0x12e756[_0xf266('0x72')]*0x3e8);if(_0x475a14>0x0){_0x475a14=_0x475a14<0x64?0x64:_0x475a14;loggerPredictive['info'](_0x12e756[_0xf266('0x45')],_0xf266('0x1f2'),_0x475a14,_0xf266('0x8d'));_0x12e756[_0xf266('0x8e')]=setInterval(function(){_0x3dfd66[_0xf266('0x8e')](_0x12e756);loggerPredictiveCalls[_0xf266('0x7f')](_0xf266('0x1f3'),_0x16251d+=0x1);},_0x475a14);}else{loggerPredictive[_0xf266('0x7f')](_0x12e756[_0xf266('0x45')],_0xf266('0x1f4'));}};};Dialer['prototype']['checkContactBlack']=function(_0x3dce70,_0x6fbe27){var _0x1996e5=this;return function(_0x3654d8){if(_['isEmpty'](_0x3654d8)){if(_[_0xf266('0xab')](_0x6fbe27[_0xf266('0x1f5')])||!_0x6fbe27[_0xf266('0x1f6')]){if(_0x3dce70['dialMethod']===_0xf266('0x7')){_0x3dce70[_0xf266('0x12c')]=_[_0xf266('0x40')](_0x3dce70[_0xf266('0x12c')])?!![]:_0x3dce70[_0xf266('0x12c')];var _0xcfd30e=uuid['v4']();_0x1996e5['actions'][_0xcfd30e]=new Action(_0x3dce70,_0x6fbe27,_0xcfd30e);loggerBooked['info'](_0xf266('0x1f7'),_0xcfd30e,_0xf266('0x1f8'),JSON[_0xf266('0x79')](_0x3dce70[_0xf266('0x12c')]),'Queue:\x20',_0x3dce70[_0xf266('0x45')]);if(_0x3dce70[_0xf266('0x12c')]){_0x3dce70[_0xf266('0x12c')]=![];_0x1996e5[_0xf266('0x128')][_0x1996e5['actions'][_0xcfd30e][_0xf266('0xb1')]]=[];ami['Action']({'actionid':_0xcfd30e,'action':'queuestatus','queue':_0x3dce70[_0xf266('0x45')]})[_0xf266('0xae')](function(){_0x1996e5[_0xf266('0xaf')](_0x3dce70);_0x1996e5[_0xf266('0xbf')]({'active':![],'ContactId':_0x1996e5[_0xf266('0x27')][_0xcfd30e][_0xf266('0xd2')],'ListId':_0x1996e5['actions'][_0xcfd30e]['ListId'],'VoiceQueueId':_0x1996e5[_0xf266('0x27')][_0xcfd30e][_0xf266('0xd4')]||undefined,'CampaignId':_0x1996e5[_0xf266('0x27')][_0xcfd30e][_0xf266('0xd5')]||undefined})[_0xf266('0xae')](loggerCatch(_0xf266('0x1f9')));delete _0x1996e5[_0xf266('0x27')][_0xcfd30e];});}else{loggerBooked[_0xf266('0x7f')](_0xf266('0x1fa'),JSON[_0xf266('0x79')](_0x3dce70[_0xf266('0x12c')]),_0xf266('0x1fb'),_0x3dce70['name']);_0x1996e5[_0xf266('0xaf')](_0x3dce70);_0x1996e5[_0xf266('0xbf')]({'active':![],'ContactId':_0x1996e5['actions'][_0xcfd30e][_0xf266('0xd2')],'ListId':_0x1996e5[_0xf266('0x27')][_0xcfd30e]['ListId'],'VoiceQueueId':_0x1996e5[_0xf266('0x27')][_0xcfd30e][_0xf266('0xd4')]||undefined,'CampaignId':_0x1996e5[_0xf266('0x27')][_0xcfd30e][_0xf266('0xd5')]||undefined})[_0xf266('0xae')](loggerCatch(_0xf266('0x1f9')));delete _0x1996e5[_0xf266('0x27')][_0xcfd30e];}}else{return _0x1996e5[_0xf266('0x171')](_0x3dce70,_0x6fbe27);}}else{if(getDiff(_0x6fbe27[_0xf266('0x1fc')])<_0x3dce70[_0xf266('0x1fd')]*0x3c){if(_0x6fbe27[_0xf266('0x15c')]&&!_0x6fbe27[_0xf266('0x15c')]['voicePause']){_0x1996e5['preview']['run'](_0x6fbe27['id'])[_0xf266('0x1e')](function(){_0x1996e5[_0xf266('0xaf')](_0x3dce70);});}else{_0x1996e5[_0xf266('0xc1')]({'active':![]},_0x6fbe27['id'],0x1)[_0xf266('0x1e')](function(){_0x1996e5[_0xf266('0xaf')](_0x3dce70);});}}else{_0x3dce70[_0xf266('0x1fe')]+=0x1;_0x1996e5[_0xf266('0xaf')](_0x3dce70);if(_0x3dce70[_0xf266('0x1ff')]){_0x1996e5[_0xf266('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x6fbe27['ContactId'],'ListId':_0x6fbe27[_0xf266('0xd3')],'VoiceQueueId':_0x6fbe27[_0xf266('0xd4')]||undefined,'CampaignId':_0x6fbe27['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1996e5[_0xf266('0xcb')](createObjHistory(_0x3dce70,_0x6fbe27,_0xf266('0x200'),0x17,'RecallInQueue'))[_0xf266('0xae')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1996e5[_0xf266('0xdc')](createObjHistory(_0x3dce70,_0x6fbe27,_0xf266('0x201'),0x16,_0xf266('0x202')),_0xf266('0x203'),_0xf266('0x204'));}}}}else{_0x3dce70[_0xf266('0x205')]+=0x1;_0x1996e5[_0xf266('0xdc')](createObjHistory(_0x3dce70,_0x6fbe27,_0xf266('0x206'),0xd,_0xf266('0x207')),'[Originate][historyBlacklist]',_0xf266('0x208'));throw'inBlackList';}};};Dialer['prototype']['handleIvr']=function(_0x10b372){var _0x4ecfe7=this;var _0x3be22e=_0x10b372[_0xf266('0x209')]-_0x10b372['originated']-_0x10b372[_0xf266('0xc4')];emitCampaignSummary(_0x10b372);if(_0x3be22e>0x0){if(_0x3be22e>this[_0xf266('0x25')]){_0x3be22e=this[_0xf266('0x25')];}_0x10b372[_0xf266('0xc4')]+=_0x3be22e;this[_0xf266('0xc6')](_0x10b372['id'],_0x3be22e,_0x10b372[_0xf266('0x20a')],_0x10b372)['then'](function(_0x1fff20){_0x10b372[_0xf266('0xc4')]-=_0x3be22e;_0x10b372[_0xf266('0xc4')]=_0x10b372[_0xf266('0xc4')]>0x0?_0x10b372[_0xf266('0xc4')]:0x0;if(!checkContactEmpty(_0x1fff20)){_0x10b372[_0xf266('0x41')]=_0xf266('0x20b');logger['info'](_0xf266('0x20c')+_0x10b372[_0xf266('0x45')]);}else{_0x10b372['originated']+=_0x1fff20[_0xf266('0x96')];_0x10b372['message']='RUNNING';for(var _0x82e594=0x0;_0x82e594<_0x1fff20['length'];_0x82e594+=0x1){_0x10b372[_0xf266('0x20d')]+=0x1;if(_[_0xf266('0xab')](_0x1fff20[_0x82e594])||_[_0xf266('0xab')](_0x1fff20[_0x82e594][_0xf266('0x18a')])||_[_0xf266('0xab')](_0x1fff20[_0x82e594]['phone'])){_0x4ecfe7['emptyContact']('[actionOriginate]\x20',_0x10b372,_0x1fff20[_0x82e594]);}else{_0x4ecfe7['checkIsBlackListIvr'](_[_0xf266('0xd1')](_0x1fff20[_0x82e594],['CampaignId',_0xf266('0x174')]))['then'](_0x4ecfe7[_0xf266('0x20e')](_0x10b372,_0x1fff20[_0x82e594]))[_0xf266('0xae')](_0x4ecfe7[_0xf266('0xce')](_0xf266('0x20f'),_0x10b372));}}}})[_0xf266('0xae')](loggerGetContactDialer(_0xf266('0x210'),_0x10b372,_0x3be22e));}};Dialer[_0xf266('0xa7')][_0xf266('0x156')]=function(_0x4319ef,_0x462f84){var _0x4225be=this;var _0x308d27=[];var _0x26b55e=_0x462f84>=0x1?_0x462f84:0x1;if(_0x4319ef[_0xf266('0x5d')]===_0xf266('0x7')){_0x26b55e=0x1;}var _0x2564a5=Math['floor'](_0x4319ef['available']*_0x26b55e)-_0x4319ef['originated']-_0x4319ef['temp'];emitVoiceQueueSummary(_0x4319ef);if(_0x4319ef['dialLimitQueue']>0x0){var _0xac6da=_0x4319ef['dialLimitQueue']-_0x4319ef[_0xf266('0x70')]-_0x4319ef[_0xf266('0x58')]-_0x4319ef['temp']-_0x4319ef[_0xf266('0x9d')];if(_0x2564a5>_0xac6da){_0x2564a5=_0xac6da;}}if(_0x2564a5>0x0){if(_0x4319ef[_0xf266('0x5d')]==='booked'){_0x2564a5=0x1;}if(_0x2564a5>this[_0xf266('0x25')]){_0x2564a5=this[_0xf266('0x25')];}_0x4319ef[_0xf266('0xc4')]+=_0x2564a5;for(var _0x1e9247 in this[_0xf266('0x23')]){if(typeof this[_0xf266('0x23')][_0x1e9247]!=='undefined'){if(this[_0xf266('0x23')][_0x1e9247]['state']===_0xf266('0x211')&&this[_0xf266('0x23')][_0x1e9247][_0xf266('0xda')]===_0xf266('0x169')){_0x308d27[_0xf266('0x129')](this[_0xf266('0x23')][_0x1e9247]['id']);}}}this[_0xf266('0xc3')](_0x4319ef['id'],_0x308d27,_0x2564a5,_0x4319ef['dialOrderByScheduledAt'],_0x4319ef)['then'](function(_0x3a15dc){_0x4319ef[_0xf266('0xc4')]-=_0x2564a5;_0x4319ef['temp']=_0x4319ef[_0xf266('0xc4')]>0x0?_0x4319ef[_0xf266('0xc4')]:0x0;if(!checkContactEmpty(_0x3a15dc)){_0x4225be[_0xf266('0xb3')](_0x4319ef)[_0xf266('0xb5')](sendMessageReschedule(_0x4319ef))[_0xf266('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x4319ef[_0xf266('0x70')]+=_0x3a15dc[_0xf266('0x96')];_0x4319ef[_0xf266('0x41')]=_0x4319ef[_0xf266('0x5d')]==='booked'?_0xf266('0x17b'):_0xf266('0x212');for(var _0x5cf17a=0x0;_0x5cf17a<_0x3a15dc[_0xf266('0x96')];_0x5cf17a+=0x1){if(_['isNil'](_0x3a15dc[_0x5cf17a])||_['isNil'](_0x3a15dc[_0x5cf17a][_0xf266('0x18a')])||_[_0xf266('0xab')](_0x3a15dc[_0x5cf17a]['phone'])){_0x4225be[_0xf266('0xcf')](_0xf266('0x213'),_0x4319ef,_0x3a15dc[_0x5cf17a]);}else{_0x4225be[_0xf266('0xb6')](_[_0xf266('0xd1')](_0x3a15dc[_0x5cf17a],['VoiceQueueId',_0xf266('0x174')]))[_0xf266('0xb5')](_0x4225be['checkContactBlack'](_0x4319ef,_0x3a15dc[_0x5cf17a]))['catch'](_0x4225be[_0xf266('0xce')]('[actionOriginate]\x20',_0x4319ef));}}}})['catch'](loggerGetContactDialer(_0xf266('0x214'),_0x4319ef,_0x2564a5));}};Dialer[_0xf266('0xa7')][_0xf266('0x8e')]=function(_0x22c131){if(_0x22c131[_0xf266('0x215')]>0x0){var _0x1308d4=_0x22c131[_0xf266('0x215')]-_0x22c131[_0xf266('0x70')]-_0x22c131['talking'];if(_0x1308d4>0x0){this[_0xf266('0x216')](_0x22c131);}else{loggerPredictiveCalls[_0xf266('0x7f')](_0xf266('0x217'));}}else{this[_0xf266('0x216')](_0x22c131);}};Dialer[_0xf266('0xa7')]['tryOriginatePredictive']=function(_0x19ff64){var _0x5b9710=this;var _0x4c9cae=[];_0x19ff64[_0xf266('0x70')]+=0x1;for(var _0x5c83c4 in this[_0xf266('0x23')]){if(typeof this[_0xf266('0x23')][_0x5c83c4]!==_0xf266('0x97')){if(this[_0xf266('0x23')][_0x5c83c4][_0xf266('0xa3')]==='not_inuse'&&this[_0xf266('0x23')][_0x5c83c4][_0xf266('0xda')]===_0xf266('0x169')){_0x4c9cae[_0xf266('0x129')](this[_0xf266('0x23')][_0x5c83c4]['id']);}}}this[_0xf266('0xc3')](_0x19ff64['id'],_0x4c9cae,0x1,_0x19ff64['dialOrderByScheduledAt'],_0x19ff64)[_0xf266('0xb5')](function(_0x46c732){if(!checkContactEmpty(_0x46c732)){checkContactLowerLimitOriginate(_0x19ff64,0x1,0x0);_0x5b9710[_0xf266('0xb3')](_0x19ff64)[_0xf266('0xb5')](sendMessageReschedule(_0x19ff64))[_0xf266('0xae')](loggerCatch(_0xf266('0x218')));}else{_0x19ff64[_0xf266('0x41')]=_0xf266('0x212');if(_[_0xf266('0xab')](_0x46c732[0x0])||_[_0xf266('0xab')](_0x46c732[0x0][_0xf266('0x18a')])||_['isNil'](_0x46c732[0x0]['phone'])){_0x5b9710[_0xf266('0xcf')]('[actionOriginate]\x20',_0x19ff64,_0x46c732[0x0]);}else{_0x5b9710[_0xf266('0xb6')](_[_0xf266('0xd1')](_0x46c732[0x0],[_0xf266('0xd4'),_0xf266('0x174')]))[_0xf266('0xb5')](_0x5b9710['checkContactBlack'](_0x19ff64,_0x46c732[0x0]))[_0xf266('0xae')](_0x5b9710['loggerHandler']('[actionOriginatePredictive]\x20',_0x19ff64));}}})[_0xf266('0xae')](loggerGetContactDialer(_0xf266('0x219'),_0x19ff64,0x1));emitVoiceQueueSummary(_0x19ff64);};Dialer['prototype'][_0xf266('0x1e9')]=function(_0x1b9598,_0x481394,_0x266e4d,_0x2511c6,_0x57016b,_0x290871){loggerPredictive['info'](_0xf266('0x21a'));loggerPredictive[_0xf266('0x7f')]('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',_0x1b9598);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x481394);loggerPredictive[_0xf266('0x7f')]('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',_0x266e4d);loggerPredictive[_0xf266('0x7f')]('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',_0x2511c6);loggerPredictive[_0xf266('0x7f')](_0xf266('0x21b'),_0x57016b);loggerPredictive[_0xf266('0x7f')](_0xf266('0x86'));return new Promise(function(_0x246219,_0x4863b1){if(_0x1b9598<=0x0||isNaN(_0x1b9598)){return _0x4863b1(msgResponse(_0xf266('0x21c'),'Error',_0xf266('0x21d')+_0x1b9598));}if(_0x266e4d<=0x0||isNaN(_0x266e4d)){return _0x4863b1(msgResponse(_0xf266('0x21c'),_0xf266('0x4d'),_0xf266('0x21e')+_0x266e4d));}if(_0x2511c6<=0x0||isNaN(_0x2511c6)){return _0x4863b1(msgResponse('[abandonmentRate]',_0xf266('0x4d'),_0xf266('0x21f')+_0x2511c6));}if(_0x481394<=0x0||isNaN(_0x481394)){return _0x4863b1(msgResponse(_0xf266('0x21c'),_0xf266('0x4d'),_0xf266('0x220')+_0x481394));}if(_0x57016b<=0x0||isNaN(_0x57016b)){return _0x4863b1(msgResponse(_0xf266('0x21c'),'Error',_0xf266('0x221')+_0x57016b));}_0x290871=_0x290871||0x0;var _0x4e98fc=0x1/_0x266e4d;var _0x654a39=0x0;var _0x1d0902=0x0;var _0xd3dd35=0x0;var _0x20180f=0x0;for(var _0x54016a=0x0;_0xd3dd35<_0x57016b;_0x54016a+=0x1){_0x1d0902=_0x54016a/_0x481394;_0x654a39=(_0x2511c6*_0x1d0902+_0x290871)/_0x4e98fc;_0xd3dd35=erlangb(_0x654a39,_0x1b9598);_0x20180f=_0x654a39/_0x1b9598*(0x1-erlangb(_0x654a39,_0x1b9598));}return _0x246219({'erlangCalls':_0x54016a,'erlangCallToSecond':_0x481394/_0x54016a,'erlangAbandonmentRate':_0xd3dd35,'erlangBusyFactor':_0x20180f});});};Dialer['prototype']['busyFactor']=function(_0x37d983,_0x4e4d98,_0x4c3064,_0x29cb2c,_0xea3649,_0x4a2c5c){loggerPredictive[_0xf266('0x7f')](_0xf266('0x222'));loggerPredictive[_0xf266('0x7f')](_0xf266('0x223'),_0x37d983);loggerPredictive[_0xf266('0x7f')](_0xf266('0x224'),_0x4e4d98);loggerPredictive[_0xf266('0x7f')](_0xf266('0x225'),_0x4c3064);loggerPredictive['info'](_0xf266('0x226'),_0x29cb2c);loggerPredictive[_0xf266('0x7f')](_0xf266('0x227'),_0xea3649);loggerPredictive[_0xf266('0x7f')](_0xf266('0x86'));return new Promise(function(_0x5a8939,_0x3f270d){if(_0x37d983<=0x0||isNaN(_0x37d983)){return _0x3f270d(msgResponse(_0xf266('0x228'),_0xf266('0x4d'),_0xf266('0x21d')+_0x37d983));}if(_0x4c3064<=0x0||isNaN(_0x4c3064)){return _0x3f270d(msgResponse(_0xf266('0x228'),_0xf266('0x4d'),'Ts\x20=\x20'+_0x4c3064));}if(_0x29cb2c<=0x0||isNaN(_0x29cb2c)){return _0x3f270d(msgResponse(_0xf266('0x228'),'Error',_0xf266('0x21f')+_0x29cb2c));}if(_0x4e4d98<=0x0||isNaN(_0x4e4d98)){return _0x3f270d(msgResponse(_0xf266('0x228'),_0xf266('0x4d'),_0xf266('0x220')+_0x4e4d98));}if(_0xea3649<=0x0||isNaN(_0xea3649)){return _0x3f270d(msgResponse(_0xf266('0x228'),'Error',_0xf266('0x229')+_0xea3649));}_0x4a2c5c=_0x4a2c5c||0x0;var _0x586393=0x1/_0x4c3064;var _0x50ea61=0x0;var _0x154e3b=0x0;var _0x5675a2=0x0;var _0x41e59e=0x0;for(var _0x15ba6f=0x0;_0x41e59e<_0xea3649;_0x15ba6f+=0x1){_0x154e3b=_0x15ba6f/_0x4e4d98;_0x50ea61=(_0x29cb2c*_0x154e3b+_0x4a2c5c)/_0x586393;_0x5675a2=erlangb(_0x50ea61,_0x37d983);_0x41e59e=_0x50ea61/_0x37d983*(0x1-erlangb(_0x50ea61,_0x37d983));}return _0x5a8939({'erlangCalls':_0x15ba6f,'erlangCallToSecond':_0x4e4d98/_0x15ba6f,'erlangAbandonmentRate':_0x5675a2,'erlangBusyFactor':_0x41e59e});});};module[_0xf266('0x22a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 4eebcd1..337b2fa 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 _0x9a05=['membername','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','scheduledat','campaigntype','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','droptime','endtime','holdtime','talktime'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9a05,0x14e));var _0x59a0=function(_0x40fe7a,_0x44449f){_0x40fe7a=_0x40fe7a-0x0;var _0x4b59b7=_0x9a05[_0x40fe7a];return _0x4b59b7;};'use strict';var util=require(_0x59a0('0x0'));var _=require(_0x59a0('0x1'));var moment=require('moment');function getSeconds(_0x34b2b0,_0x1e8ec1){var _0x2fac1b=moment(_0x34b2b0)[_0x59a0('0x2')](0x0);var _0x2c86ee=moment(_0x1e8ec1)[_0x59a0('0x2')](0x0);return _0x2fac1b['diff'](_0x2c86ee,_0x59a0('0x3'));}function QueueCallerAbandon(_0x4cfa86,_0x4c69a7){this[_0x59a0('0x4')]=_0x4cfa86['scheduledat'];this['type']=_0x4cfa86['type'];this[_0x59a0('0x5')]=_0x4cfa86[_0x59a0('0x6')]===_0x59a0('0x7')?_0x59a0('0x8'):_0x4cfa86[_0x59a0('0x6')];this['countbusyretry']=_0x4cfa86['countbusyretry'];this[_0x59a0('0x9')]=_0x4cfa86[_0x59a0('0x9')];this[_0x59a0('0xa')]=_0x4cfa86[_0x59a0('0xa')];this[_0x59a0('0xb')]=_0x4cfa86['countbusyretry']+_0x4cfa86['countcongestionretry']+_0x4cfa86['countnoanswerretry']+_0x4cfa86[_0x59a0('0xc')]+_0x4cfa86[_0x59a0('0xd')]+_0x4cfa86[_0x59a0('0xe')]+_0x4cfa86[_0x59a0('0xf')]+_0x4cfa86['countagentrejectretry'];this[_0x59a0('0xc')]=_0x4cfa86[_0x59a0('0xc')];this[_0x59a0('0xd')]=_0x4cfa86['countdropretry'];this['countabandonedretry']=_0x4cfa86[_0x59a0('0xe')];this[_0x59a0('0xf')]=_0x4cfa86['countmachineretry'];this['countagentrejectretry']=_0x4cfa86[_0x59a0('0x10')];this[_0x59a0('0x11')]=_0x4c69a7[_0x59a0('0x11')];this['calleridname']=_0x4cfa86[_0x59a0('0x12')];this['calleridnum']=_0x4cfa86[_0x59a0('0x13')];this[_0x59a0('0x14')]=_0x4cfa86[_0x59a0('0x14')];this[_0x59a0('0x15')]=_0x4cfa86['responsetime'];this[_0x59a0('0x16')]=_0x4cfa86[_0x59a0('0x16')];this[_0x59a0('0x17')]=this[_0x59a0('0x16')];this['ringtime']=getSeconds(_0x4cfa86['responsetime'],_0x4cfa86[_0x59a0('0x14')]);this[_0x59a0('0x18')]=getSeconds(this['droptime'],_0x4cfa86['responsetime']);this[_0x59a0('0x19')]=0x0;this[_0x59a0('0x8')]=_0x4c69a7[_0x59a0('0x8')];this[_0x59a0('0x1a')]=_0x4c69a7[_0x59a0('0x1b')];this['reason']=_0x4c69a7['reason'];this[_0x59a0('0x1c')]=_0x4cfa86[_0x59a0('0x1c')];this[_0x59a0('0x1d')]=_0x4cfa86[_0x59a0('0x1d')];this[_0x59a0('0x1e')]=_0x4cfa86['callbackat'];this[_0x59a0('0x1f')]=_0x4cfa86['recallme'];this[_0x59a0('0x20')]=_0x4cfa86[_0x59a0('0x20')];this[_0x59a0('0x21')]=_0x4cfa86[_0x59a0('0x21')];this['UserId']=_0x4cfa86[_0x59a0('0x22')];this['VoiceQueueId']=_0x4cfa86[_0x59a0('0x23')];this[_0x59a0('0x24')]=_0x4cfa86[_0x59a0('0x24')];this[_0x59a0('0x25')]=_0x4cfa86[_0x59a0('0x25')]||'';this[_0x59a0('0x26')]=_0x4cfa86[_0x59a0('0x26')]||'';}module[_0x59a0('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x522e=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x29691f,_0x5a569a){var _0x230bd0=function(_0x5d5235){while(--_0x5d5235){_0x29691f['push'](_0x29691f['shift']());}};_0x230bd0(++_0x5a569a);}(_0x522e,0x9c));var _0xe522=function(_0x8e97fb,_0x491639){_0x8e97fb=_0x8e97fb-0x0;var _0x11169e=_0x522e[_0x8e97fb];return _0x11169e;};'use strict';var util=require(_0xe522('0x0'));var _=require(_0xe522('0x1'));var moment=require('moment');function getSeconds(_0x1fdb53,_0x212155){var _0xd01ac8=moment(_0x1fdb53)['milliseconds'](0x0);var _0x5bd53d=moment(_0x212155)[_0xe522('0x2')](0x0);return _0xd01ac8[_0xe522('0x3')](_0x5bd53d,_0xe522('0x4'));}function QueueCallerAbandon(_0x4963e6,_0x180985){this[_0xe522('0x5')]=_0x4963e6[_0xe522('0x5')];this['type']=_0x4963e6[_0xe522('0x6')];this['campaigntype']=_0x4963e6['type']==='outbound'?_0xe522('0x7'):_0x4963e6['type'];this[_0xe522('0x8')]=_0x4963e6[_0xe522('0x8')];this['countcongestionretry']=_0x4963e6[_0xe522('0x9')];this[_0xe522('0xa')]=_0x4963e6[_0xe522('0xa')];this[_0xe522('0xb')]=_0x4963e6['countbusyretry']+_0x4963e6[_0xe522('0x9')]+_0x4963e6['countnoanswerretry']+_0x4963e6['countnosuchnumberretry']+_0x4963e6[_0xe522('0xc')]+_0x4963e6[_0xe522('0xd')]+_0x4963e6[_0xe522('0xe')]+_0x4963e6['countagentrejectretry'];this['countnosuchnumberretry']=_0x4963e6['countnosuchnumberretry'];this[_0xe522('0xc')]=_0x4963e6[_0xe522('0xc')];this[_0xe522('0xd')]=_0x4963e6[_0xe522('0xd')];this[_0xe522('0xe')]=_0x4963e6[_0xe522('0xe')];this[_0xe522('0xf')]=_0x4963e6[_0xe522('0xf')];this['uniqueid']=_0x180985[_0xe522('0x10')];this[_0xe522('0x11')]=_0x4963e6['name'];this['calleridnum']=_0x4963e6['number'];this[_0xe522('0x12')]=_0x4963e6[_0xe522('0x12')];this[_0xe522('0x13')]=_0x4963e6[_0xe522('0x13')];this[_0xe522('0x14')]=_0x4963e6[_0xe522('0x14')];this[_0xe522('0x15')]=this[_0xe522('0x14')];this[_0xe522('0x16')]=getSeconds(_0x4963e6['responsetime'],_0x4963e6[_0xe522('0x12')]);this[_0xe522('0x17')]=getSeconds(this[_0xe522('0x14')],_0x4963e6[_0xe522('0x13')]);this['talktime']=0x0;this[_0xe522('0x7')]=_0x180985[_0xe522('0x7')];this[_0xe522('0x18')]=_0x180985[_0xe522('0x19')];this['reason']=_0x180985[_0xe522('0x1a')];this[_0xe522('0x1b')]=_0x4963e6[_0xe522('0x1b')];this[_0xe522('0x1c')]=_0x4963e6[_0xe522('0x1c')];this[_0xe522('0x1d')]=_0x4963e6[_0xe522('0x1d')];this[_0xe522('0x1e')]=_0x4963e6[_0xe522('0x1e')];this[_0xe522('0x1f')]=_0x4963e6[_0xe522('0x1f')];this['ListId']=_0x4963e6[_0xe522('0x20')];this['UserId']=_0x4963e6[_0xe522('0x21')];this[_0xe522('0x22')]=_0x4963e6[_0xe522('0x22')];this['CampaignId']=_0x4963e6[_0xe522('0x23')];this[_0xe522('0x24')]=_0x4963e6[_0xe522('0x24')]||'';this[_0xe522('0x25')]=_0x4963e6[_0xe522('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index fb9da98..9ceb6fd 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 _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x5bd501,_0x1e6555){var _0x9737d6=function(_0x4bac4a){while(--_0x4bac4a){_0x5bd501['push'](_0x5bd501['shift']());}};_0x9737d6(++_0x1e6555);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2a375f,_0x2e39a5){var _0x42a081=function(_0x181a71){while(--_0x181a71){_0x2a375f['push'](_0x2a375f['shift']());}};_0x42a081(++_0x2e39a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index b689bfb..749233f 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 _0x6412=['response','AttachmentId','update','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','faxpages','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','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','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','pick'];(function(_0x5040c3,_0x3debf8){var _0x256f08=function(_0x428078){while(--_0x428078){_0x5040c3['push'](_0x5040c3['shift']());}};_0x256f08(++_0x3debf8);}(_0x6412,0xad));var _0x2641=function(_0x2253f6,_0x270292){_0x2253f6=_0x2253f6-0x0;var _0x19f1da=_0x6412[_0x2253f6];return _0x19f1da;};'use strict';var util=require(_0x2641('0x0'));var _=require(_0x2641('0x1'));var BPromise=require(_0x2641('0x2'));var uuid=require(_0x2641('0x3'));var moment=require(_0x2641('0x4'));var path=require(_0x2641('0x5'));var tiff2pdf=require(_0x2641('0x6'));var gs=require(_0x2641('0x7'));var logger=require('../../../config/logger')(_0x2641('0x8'));var ami=require(_0x2641('0x9'));var rpcDb=require(_0x2641('0xa'));var Channel=require(_0x2641('0xb'));var ut=require(_0x2641('0xc'));var Action=require(_0x2641('0xd'));var faxAccount=require(_0x2641('0xe'));var attachment=require(_0x2641('0xf'));var faxMessage=require(_0x2641('0x10'));function Fax(_0x21fa2b){this[_0x2641('0x11')]={};this[_0x2641('0x12')]=_0x21fa2b[_0x2641('0x12')];this[_0x2641('0x13')]=_0x21fa2b[_0x2641('0x13')];this[_0x2641('0x14')]={};ami['on'](_0x2641('0x15'),this[_0x2641('0x16')][_0x2641('0x17')](this));ami['on'](_0x2641('0x18'),this[_0x2641('0x19')][_0x2641('0x17')](this));ami['on'](_0x2641('0x1a'),this[_0x2641('0x1b')][_0x2641('0x17')](this));ami['on']('newexten',this[_0x2641('0x1c')][_0x2641('0x17')](this));ami['on']('faxstatus',this[_0x2641('0x1d')][_0x2641('0x17')](this));ami['on'](_0x2641('0x1e'),this[_0x2641('0x1f')]['bind'](this));ami['on'](_0x2641('0x20'),this['syncHangup'][_0x2641('0x17')](this));ami['on']('originateresponse',this[_0x2641('0x21')][_0x2641('0x17')](this));}Fax[_0x2641('0x22')][_0x2641('0x16')]=function(_0x2efca4){if(_0x2efca4[_0x2641('0x23')]===_0x2641('0x24')){for(var _0x3c9578 in this['faxAccounts']){if(this[_0x2641('0x12')][_0x2641('0x25')](_0x3c9578)){if(_0x2efca4['exten']===this[_0x2641('0x12')][_0x3c9578]['localstationid']){this['channels'][_0x2efca4['uniqueid']]={};this[_0x2641('0x11')][_0x2efca4[_0x2641('0x26')]]['channel']=_0x2efca4[_0x2641('0x27')];this[_0x2641('0x11')][_0x2efca4[_0x2641('0x26')]]['id']=this[_0x2641('0x12')][_0x3c9578]['id'];this[_0x2641('0x11')][_0x2efca4['uniqueid']][_0x2641('0x28')]=this[_0x2641('0x12')][_0x3c9578][_0x2641('0x28')];logger[_0x2641('0x29')](_0x2efca4[_0x2641('0x26')],_0x2641('0x2a'));}}}}if(this[_0x2641('0x14')][_0x2efca4['uniqueid']]){this[_0x2641('0x11')][_0x2efca4[_0x2641('0x26')]]={};this[_0x2641('0x11')][_0x2efca4[_0x2641('0x26')]]['channel']=_0x2efca4[_0x2641('0x27')];logger[_0x2641('0x29')](_0x2efca4[_0x2641('0x26')],'\x20syncNewchannel\x20');}};Fax[_0x2641('0x22')][_0x2641('0x19')]=function(_0x6348e5){if(this[_0x2641('0x11')][_0x6348e5[_0x2641('0x26')]]){for(var _0x58c44b in _0x6348e5['variable']){if(_0x6348e5[_0x2641('0x2b')]['hasOwnProperty'](_0x58c44b)){this[_0x2641('0x11')][_0x6348e5['uniqueid']][_0x58c44b]=_0x6348e5[_0x2641('0x2c')];}}}};Fax[_0x2641('0x22')][_0x2641('0x1b')]=function(_0x5a70af){if(this[_0x2641('0x11')][_0x5a70af[_0x2641('0x26')]]){this[_0x2641('0x11')][_0x5a70af['uniqueid']][_0x2641('0x2d')]=_0x5a70af['channelstate'];this[_0x2641('0x11')][_0x5a70af[_0x2641('0x26')]][_0x2641('0x2e')]=_0x5a70af[_0x2641('0x2e')];}};Fax[_0x2641('0x22')][_0x2641('0x1c')]=function(_0x142c96){if(this['channels'][_0x142c96[_0x2641('0x26')]]){for(var _0x55d804 in _0x142c96[_0x2641('0x2b')]){if(_0x142c96[_0x2641('0x2b')][_0x2641('0x25')](_0x55d804)){this['channels'][_0x142c96[_0x2641('0x26')]][_0x55d804]=_0x142c96[_0x2641('0x2c')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x31a2c9){if(this[_0x2641('0x11')][_0x31a2c9[_0x2641('0x26')]]){this[_0x2641('0x11')][_0x31a2c9['uniqueid']][_0x2641('0x2f')]=_0x31a2c9[_0x2641('0x2f')];this['channels'][_0x31a2c9['uniqueid']]['status']=_0x31a2c9[_0x2641('0x30')];this['channels'][_0x31a2c9[_0x2641('0x26')]][_0x2641('0x31')]=_0x31a2c9[_0x2641('0x31')];this[_0x2641('0x11')][_0x31a2c9[_0x2641('0x26')]][_0x2641('0x32')]=_0x31a2c9[_0x2641('0x32')];logger['info'](_0x31a2c9['uniqueid'],_0x2641('0x33'));}};Fax[_0x2641('0x22')]['syncReceiveFax']=function(_0x25a03a){var _0x5780f9=this;if(this[_0x2641('0x11')][_0x25a03a['uniqueid']]){var _0x5c6039=this['channels'][_0x25a03a['uniqueid']]['id'];this[_0x2641('0x11')][_0x25a03a[_0x2641('0x26')]]['remotestationid']=_0x25a03a[_0x2641('0x34')];this[_0x2641('0x11')][_0x25a03a[_0x2641('0x26')]][_0x2641('0x35')]=_0x25a03a['pagestransferred'];this[_0x2641('0x11')][_0x25a03a[_0x2641('0x26')]][_0x2641('0x31')]=_0x25a03a[_0x2641('0x31')];this[_0x2641('0x11')][_0x25a03a[_0x2641('0x26')]][_0x2641('0x36')]=_0x25a03a['resolution'];this[_0x2641('0x11')][_0x25a03a[_0x2641('0x26')]][_0x2641('0x37')]=_0x25a03a[_0x2641('0x37')];this[_0x2641('0x11')][_0x25a03a[_0x2641('0x26')]][_0x2641('0x32')]=_0x25a03a['filename'];this['channels'][_0x25a03a[_0x2641('0x26')]][_0x2641('0x38')]=_0x25a03a['calleridnum'];if(this['channels'][_0x25a03a[_0x2641('0x26')]][_0x2641('0x35')]>0x0){tiff2pdf(_0x25a03a['filename'],_0x2641('0x39'),function(_0x59f475){logger[_0x2641('0x29')](_0x25a03a[_0x2641('0x26')],_0x2641('0x3a'),_0x59f475[_0x2641('0x3b')]);attachment[_0x2641('0x3c')]({'name':path['parse'](_0x25a03a['filename'])[_0x2641('0x28')],'basename':path[_0x2641('0x3d')](_0x25a03a[_0x2641('0x32')])[_0x2641('0x28')]+_0x2641('0x3e'),'type':'application/pdf'})[_0x2641('0x3f')](function(_0x26a649){faxAccount[_0x2641('0x40')](_0x5c6039,{'from':_0x25a03a[_0x2641('0x38')],'mapKey':_0x2641('0x8'),'body':path['parse'](_0x25a03a['filename'])['name']+_0x2641('0x3e'),'AttachmentId':_0x26a649['id']})['catch'](function(_0x2abb8c){logger[_0x2641('0x41')](_0x25a03a[_0x2641('0x26')],_0x2641('0x42'),JSON['stringify'](_0x2abb8c));});})[_0x2641('0x43')](function(_0x5735c0){logger[_0x2641('0x41')](_0x25a03a['uniqueid'],_0x2641('0x44'),JSON[_0x2641('0x45')](_0x5735c0));});});}logger[_0x2641('0x29')](_0x25a03a['uniqueid'],_0x2641('0x44'));}};Fax['prototype']['syncOriginateResponse']=function(_0x4edd2a){if(this['actions'][_0x4edd2a[_0x2641('0x26')]]){_['merge'](this[_0x2641('0x11')][_0x4edd2a[_0x2641('0x26')]],_[_0x2641('0x46')](_0x4edd2a,[_0x2641('0x47'),'reason']));}};function updateStatus(_0x4ec23f){if(_0x4ec23f[_0x2641('0x48')]){faxMessage[_0x2641('0x49')](_0x4ec23f[_0x2641('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x2641('0x3f')](function(_0x29f36f){ut[_0x2641('0x4a')](_0x2641('0x4b'),_0x29f36f);})[_0x2641('0x43')](function(_0x1f2c4f){ut[_0x2641('0x4a')](_0x2641('0x4c'),_0x1f2c4f);});}else{ut[_0x2641('0x4a')](_0x2641('0x4d'));}}Fax[_0x2641('0x22')][_0x2641('0x4e')]=function(_0x2bf679,_0x509bd6,_0x428720){var _0x263227=this;var _0x4668c6={};if(_0x509bd6){_0x4668c6={'read':_0x509bd6};}else{_0x4668c6={'failMessage':_0x428720};}if(this[_0x2641('0x14')][_0x2bf679]['AttachmentId']){faxMessage[_0x2641('0x49')](this[_0x2641('0x14')][_0x2bf679][_0x2641('0x48')],_0x4668c6)['then'](function(_0x25085a){ut[_0x2641('0x4a')](_0x2641('0x4f'),_0x25085a);})[_0x2641('0x43')](function(_0x4e9501){ut[_0x2641('0x4a')](_0x2641('0x50'),_0x4e9501);})[_0x2641('0x51')](function(){delete _0x263227[_0x2641('0x11')][_0x2bf679];delete _0x263227['actions'][_0x2bf679];});}else{ut[_0x2641('0x4a')](_0x2641('0x52'));delete this['channels'][_0x2bf679];delete this[_0x2641('0x14')][_0x2bf679];}};Fax[_0x2641('0x22')][_0x2641('0x53')]=function(_0x8d14da){var _0x4a9692=this;if(this[_0x2641('0x11')][_0x8d14da[_0x2641('0x26')]]){if(this[_0x2641('0x14')][_0x8d14da['uniqueid']]){this[_0x2641('0x11')][_0x8d14da['uniqueid']]['id']=this[_0x2641('0x14')][_0x8d14da[_0x2641('0x26')]]['id'];this[_0x2641('0x11')][_0x8d14da[_0x2641('0x26')]][_0x2641('0x28')]=this[_0x2641('0x14')][_0x8d14da[_0x2641('0x26')]][_0x2641('0x28')];}logger['info'](_0x8d14da[_0x2641('0x26')],this['actions'][_0x8d14da[_0x2641('0x26')]]?_0x2641('0x54'):_0x2641('0x55'),JSON[_0x2641('0x45')](this['channels'][_0x8d14da[_0x2641('0x26')]]));if(this[_0x2641('0x14')][_0x8d14da[_0x2641('0x26')]]){if(this[_0x2641('0x11')][_0x8d14da['uniqueid']][_0x2641('0x56')]>0x0&&this['channels'][_0x8d14da[_0x2641('0x26')]][_0x2641('0x57')]==='SUCCESS'){this[_0x2641('0x4e')](_0x8d14da[_0x2641('0x26')],!![]);}else{this['updateStatus'](_0x8d14da['uniqueid'],![],this[_0x2641('0x11')][_0x8d14da[_0x2641('0x26')]][_0x2641('0x58')]?_0x2641('0x59')+this[_0x2641('0x11')][_0x8d14da[_0x2641('0x26')]][_0x2641('0x58')]:_0x2641('0x5a'));}}}};Fax[_0x2641('0x22')][_0x2641('0x5b')]=function(_0x1b933a){var _0x4e3a5e=this;return new BPromise(function(_0x396523,_0x3be2e7){_0x4e3a5e[_0x2641('0x5c')](_0x1b933a,_0x4e3a5e[_0x2641('0x12')][_0x1b933a[_0x2641('0x5d')]])['then'](function(_0xe0af1){ut[_0x2641('0x4a')](_0x2641('0x5e'),_0xe0af1);_0x396523(ut[_0x2641('0x3b')]('Fax\x20received'));})[_0x2641('0x43')](function(_0x4fb483){ut[_0x2641('0x4a')]('[Fax][execOriginate][failure]',_0x4fb483);updateStatus(_0x1b933a);_0x3be2e7(ut['message'](_0x2641('0x5f')));});});};Fax['prototype']['checkAfterSend']=function(_0x3d8f5a){var _0x1a59a4=this;return new BPromise(function(_0x5b8072,_0x1be3aa){var _0x4542eb=_0x1a59a4['checkTrunk'](_0x1a59a4[_0x2641('0x12')][_0x3d8f5a[_0x2641('0x5d')]][_0x2641('0x60')],_0x3d8f5a);if(_0x4542eb[_0x2641('0x61')]){_0x5b8072(ut[_0x2641('0x3b')](_0x2641('0x62')));}else{_0x1be3aa(ut['message'](_0x4542eb[_0x2641('0x3b')]));}});};function originate(_0x21136d,_0x4b0bf5,_0x51d131){return new BPromise(function(_0x4639de,_0x4f77df){if(_0x51d131){var _0x1d17df=util[_0x2641('0x63')](_0x2641('0x64'),path[_0x2641('0x3d')](_0x21136d[_0x2641('0x5')])['name'],_0x21136d[_0x2641('0x5')]);gs[_0x2641('0x65')](_0x1d17df)[_0x2641('0x3f')](function(){_0x21136d['path']=util[_0x2641('0x63')](_0x2641('0x66'),path[_0x2641('0x3d')](_0x21136d[_0x2641('0x5')])[_0x2641('0x67')],path[_0x2641('0x3d')](_0x21136d[_0x2641('0x5')])[_0x2641('0x28')]);_0x4b0bf5[_0x2641('0x68')]=_0x21136d[_0x2641('0x5')];ut[_0x2641('0x4a')](_0x2641('0x69'),'');ami[_0x2641('0x6a')](ut[_0x2641('0x6b')](_0x21136d,_0x4b0bf5))[_0x2641('0x3f')](function(_0x48d98c){_0x4639de(_0x48d98c);})[_0x2641('0x43')](function(_0x245d4c){_0x4f77df(_0x245d4c);});})['catch'](function(_0x5725ea){_0x4f77df(_0x5725ea);});}else{ami['Action'](ut[_0x2641('0x6b')](_0x21136d,_0x4b0bf5))[_0x2641('0x3f')](function(_0x491dec){_0x4639de(_0x491dec);})[_0x2641('0x43')](function(_0x92659c){_0x4f77df(_0x92659c);});}});}Fax[_0x2641('0x22')]['execOriginate']=function(_0x25f623,_0xc87a08){var _0x443814=this;return new BPromise(function(_0x9ca561,_0x52ec42){var _0x1dae79=uuid['v4']();var _0x2db82b=ut['addVariables'](_0x25f623,_0xc87a08);_0x443814[_0x2641('0x14')][_0x1dae79]=new Action(_0x1dae79,_0xc87a08,_0x25f623);var _0x1b0f44=_0x443814[_0x2641('0x14')][_0x1dae79];if(path['parse'](_0x25f623['path'])[_0x2641('0x6c')]==='.pdf'){originate(_0x1b0f44,_0x2db82b,!![])[_0x2641('0x3f')](function(_0x107dc6){_0x9ca561(_0x107dc6);})['catch'](function(_0x565725){_0x52ec42(_0x565725);});}else{originate(_0x1b0f44,_0x2db82b,![])['then'](function(_0x2b4cdf){_0x9ca561(_0x2b4cdf);})['catch'](function(_0x26a3b9){_0x52ec42(_0x26a3b9);});}});};Fax[_0x2641('0x22')][_0x2641('0x6d')]=function(_0x263b5d){return!_[_0x2641('0x6e')](_0x263b5d)&&!_[_0x2641('0x6e')](_0x263b5d['name'])&&!_[_0x2641('0x6e')](_0x263b5d['active'])&&_0x263b5d['active']&&!_[_0x2641('0x6e')](this['trunks'][util['format'](_0x2641('0x6f'),_0x263b5d[_0x2641('0x28')])])&&!_['isNil'](this[_0x2641('0x13')][util[_0x2641('0x63')]('SIP/%s',_0x263b5d[_0x2641('0x28')])][_0x2641('0x30')])&&(this[_0x2641('0x13')][util[_0x2641('0x63')](_0x2641('0x6f'),_0x263b5d[_0x2641('0x28')])][_0x2641('0x30')]===_0x2641('0x70')||this['trunks'][util[_0x2641('0x63')](_0x2641('0x6f'),_0x263b5d[_0x2641('0x28')])][_0x2641('0x30')]==='unmonitored');};Fax[_0x2641('0x22')][_0x2641('0x71')]=function(_0x330f17,_0x11ea6d){if(!this[_0x2641('0x6d')](_0x330f17)){ut[_0x2641('0x4a')](_0x2641('0x72'),_[_0x2641('0x6e')](_0x330f17)?'':_0x330f17['name']+_0x2641('0x73'));return{'isValid':![],'message':_0x2641('0x74')};}if(_[_0x2641('0x6e')](_0x11ea6d['fax'])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x11ea6d));return{'isValid':![],'message':_0x2641('0x75')};}if(_[_0x2641('0x6e')](_0x11ea6d[_0x2641('0x5')])){ut[_0x2641('0x4a')](_0x2641('0x76'),JSON[_0x2641('0x45')](_0x11ea6d));return{'isValid':![],'message':_0x2641('0x77')};}return{'isValid':!![],'message':_0x2641('0x78')};};module[_0x2641('0x79')]=Fax; \ No newline at end of file +var _0xd027=['notify','catch','error','stringify','\x20receiveFax\x20','merge','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','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','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','status','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','lodash','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','operation','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','message','parse','.pdf','application/pdf'];(function(_0x4b4238,_0x180369){var _0x5c6f26=function(_0x4f5848){while(--_0x4f5848){_0x4b4238['push'](_0x4b4238['shift']());}};_0x5c6f26(++_0x180369);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var _=require(_0x7d02('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x7d02('0x1'));var path=require(_0x7d02('0x2'));var tiff2pdf=require(_0x7d02('0x3'));var gs=require(_0x7d02('0x4'));var logger=require(_0x7d02('0x5'))(_0x7d02('0x6'));var ami=require(_0x7d02('0x7'));var rpcDb=require(_0x7d02('0x8'));var Channel=require('./channel');var ut=require(_0x7d02('0x9'));var Action=require(_0x7d02('0xa'));var faxAccount=require(_0x7d02('0xb'));var attachment=require(_0x7d02('0xc'));var faxMessage=require(_0x7d02('0xd'));function Fax(_0x310426){this[_0x7d02('0xe')]={};this[_0x7d02('0xf')]=_0x310426[_0x7d02('0xf')];this[_0x7d02('0x10')]=_0x310426[_0x7d02('0x10')];this[_0x7d02('0x11')]={};ami['on'](_0x7d02('0x12'),this['syncNewchannel'][_0x7d02('0x13')](this));ami['on'](_0x7d02('0x14'),this['syncVarSet'][_0x7d02('0x13')](this));ami['on'](_0x7d02('0x15'),this[_0x7d02('0x16')][_0x7d02('0x13')](this));ami['on']('newexten',this[_0x7d02('0x17')]['bind'](this));ami['on'](_0x7d02('0x18'),this[_0x7d02('0x19')]['bind'](this));ami['on'](_0x7d02('0x1a'),this[_0x7d02('0x1b')]['bind'](this));ami['on'](_0x7d02('0x1c'),this[_0x7d02('0x1d')][_0x7d02('0x13')](this));ami['on']('originateresponse',this[_0x7d02('0x1e')][_0x7d02('0x13')](this));}Fax[_0x7d02('0x1f')][_0x7d02('0x20')]=function(_0x3c4fa9){if(_0x3c4fa9[_0x7d02('0x21')]===_0x7d02('0x22')){for(var _0x3024d2 in this[_0x7d02('0xf')]){if(this[_0x7d02('0xf')][_0x7d02('0x23')](_0x3024d2)){if(_0x3c4fa9[_0x7d02('0x24')]===this[_0x7d02('0xf')][_0x3024d2][_0x7d02('0x25')]){this[_0x7d02('0xe')][_0x3c4fa9[_0x7d02('0x26')]]={};this['channels'][_0x3c4fa9[_0x7d02('0x26')]][_0x7d02('0x27')]=_0x3c4fa9[_0x7d02('0x27')];this[_0x7d02('0xe')][_0x3c4fa9[_0x7d02('0x26')]]['id']=this[_0x7d02('0xf')][_0x3024d2]['id'];this[_0x7d02('0xe')][_0x3c4fa9['uniqueid']][_0x7d02('0x28')]=this[_0x7d02('0xf')][_0x3024d2][_0x7d02('0x28')];logger[_0x7d02('0x29')](_0x3c4fa9[_0x7d02('0x26')],_0x7d02('0x2a'));}}}}if(this[_0x7d02('0x11')][_0x3c4fa9[_0x7d02('0x26')]]){this[_0x7d02('0xe')][_0x3c4fa9[_0x7d02('0x26')]]={};this[_0x7d02('0xe')][_0x3c4fa9['uniqueid']][_0x7d02('0x27')]=_0x3c4fa9[_0x7d02('0x27')];logger[_0x7d02('0x29')](_0x3c4fa9['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x7d02('0x1f')][_0x7d02('0x2b')]=function(_0x169e1a){if(this[_0x7d02('0xe')][_0x169e1a[_0x7d02('0x26')]]){for(var _0x452b8e in _0x169e1a[_0x7d02('0x2c')]){if(_0x169e1a[_0x7d02('0x2c')]['hasOwnProperty'](_0x452b8e)){this['channels'][_0x169e1a['uniqueid']][_0x452b8e]=_0x169e1a[_0x7d02('0x2d')];}}}};Fax[_0x7d02('0x1f')][_0x7d02('0x16')]=function(_0x2ab1ae){if(this['channels'][_0x2ab1ae[_0x7d02('0x26')]]){this['channels'][_0x2ab1ae['uniqueid']][_0x7d02('0x2e')]=_0x2ab1ae[_0x7d02('0x2e')];this[_0x7d02('0xe')][_0x2ab1ae[_0x7d02('0x26')]]['channelstatedesc']=_0x2ab1ae[_0x7d02('0x2f')];}};Fax[_0x7d02('0x1f')][_0x7d02('0x17')]=function(_0x4bac3e){if(this[_0x7d02('0xe')][_0x4bac3e[_0x7d02('0x26')]]){for(var _0x22cf7e in _0x4bac3e[_0x7d02('0x2c')]){if(_0x4bac3e[_0x7d02('0x2c')][_0x7d02('0x23')](_0x22cf7e)){this[_0x7d02('0xe')][_0x4bac3e[_0x7d02('0x26')]][_0x22cf7e]=_0x4bac3e[_0x7d02('0x2d')];}}}};Fax[_0x7d02('0x1f')][_0x7d02('0x19')]=function(_0x376d78){if(this['channels'][_0x376d78[_0x7d02('0x26')]]){this[_0x7d02('0xe')][_0x376d78[_0x7d02('0x26')]][_0x7d02('0x30')]=_0x376d78['operation'];this['channels'][_0x376d78[_0x7d02('0x26')]]['status']=_0x376d78['status'];this[_0x7d02('0xe')][_0x376d78['uniqueid']]['localstationid']=_0x376d78[_0x7d02('0x25')];this['channels'][_0x376d78[_0x7d02('0x26')]]['filename']=_0x376d78[_0x7d02('0x31')];logger['info'](_0x376d78[_0x7d02('0x26')],_0x7d02('0x32'));}};Fax[_0x7d02('0x1f')]['syncReceiveFax']=function(_0x4e9be4){var _0x388842=this;if(this[_0x7d02('0xe')][_0x4e9be4[_0x7d02('0x26')]]){var _0x6f7a4c=this[_0x7d02('0xe')][_0x4e9be4[_0x7d02('0x26')]]['id'];this[_0x7d02('0xe')][_0x4e9be4[_0x7d02('0x26')]][_0x7d02('0x33')]=_0x4e9be4[_0x7d02('0x33')];this[_0x7d02('0xe')][_0x4e9be4['uniqueid']]['pagestransferred']=_0x4e9be4['pagestransferred'];this[_0x7d02('0xe')][_0x4e9be4[_0x7d02('0x26')]][_0x7d02('0x25')]=_0x4e9be4[_0x7d02('0x25')];this[_0x7d02('0xe')][_0x4e9be4[_0x7d02('0x26')]][_0x7d02('0x34')]=_0x4e9be4[_0x7d02('0x34')];this[_0x7d02('0xe')][_0x4e9be4[_0x7d02('0x26')]][_0x7d02('0x35')]=_0x4e9be4[_0x7d02('0x35')];this[_0x7d02('0xe')][_0x4e9be4['uniqueid']]['filename']=_0x4e9be4[_0x7d02('0x31')];this['channels'][_0x4e9be4['uniqueid']][_0x7d02('0x36')]=_0x4e9be4[_0x7d02('0x36')];if(this[_0x7d02('0xe')][_0x4e9be4[_0x7d02('0x26')]][_0x7d02('0x37')]>0x0){tiff2pdf(_0x4e9be4[_0x7d02('0x31')],_0x7d02('0x38'),function(_0x55019b){logger[_0x7d02('0x29')](_0x4e9be4[_0x7d02('0x26')],'\x20result\x20conversion\x20file\x20',_0x55019b[_0x7d02('0x39')]);attachment['create']({'name':path['parse'](_0x4e9be4[_0x7d02('0x31')])[_0x7d02('0x28')],'basename':path[_0x7d02('0x3a')](_0x4e9be4[_0x7d02('0x31')])[_0x7d02('0x28')]+_0x7d02('0x3b'),'type':_0x7d02('0x3c')})['then'](function(_0x1e68f6){faxAccount[_0x7d02('0x3d')](_0x6f7a4c,{'from':_0x4e9be4[_0x7d02('0x36')],'mapKey':_0x7d02('0x6'),'body':path[_0x7d02('0x3a')](_0x4e9be4['filename'])['name']+_0x7d02('0x3b'),'AttachmentId':_0x1e68f6['id']})[_0x7d02('0x3e')](function(_0x326936){logger[_0x7d02('0x3f')](_0x4e9be4[_0x7d02('0x26')],'\x20notify\x20',JSON[_0x7d02('0x40')](_0x326936));});})['catch'](function(_0x1de432){logger[_0x7d02('0x3f')](_0x4e9be4[_0x7d02('0x26')],_0x7d02('0x41'),JSON[_0x7d02('0x40')](_0x1de432));});});}logger[_0x7d02('0x29')](_0x4e9be4[_0x7d02('0x26')],_0x7d02('0x41'));}};Fax[_0x7d02('0x1f')]['syncOriginateResponse']=function(_0x5283eb){if(this[_0x7d02('0x11')][_0x5283eb[_0x7d02('0x26')]]){_[_0x7d02('0x42')](this['channels'][_0x5283eb[_0x7d02('0x26')]],_[_0x7d02('0x43')](_0x5283eb,['response',_0x7d02('0x44')]));}};function updateStatus(_0x377ce0){if(_0x377ce0['AttachmentId']){faxMessage[_0x7d02('0x45')](_0x377ce0[_0x7d02('0x46')],{'failMessage':_0x7d02('0x47')})[_0x7d02('0x48')](function(_0x3bdf15){ut[_0x7d02('0x49')]('[Fax][Message][Error][Updated]',_0x3bdf15);})['catch'](function(_0x5ca4fb){ut[_0x7d02('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x5ca4fb);});}else{ut[_0x7d02('0x49')](_0x7d02('0x4a'));}}Fax[_0x7d02('0x1f')][_0x7d02('0x4b')]=function(_0x7550a0,_0x3b0295,_0x57542f){var _0xc670e0=this;var _0x249619={};if(_0x3b0295){_0x249619={'read':_0x3b0295};}else{_0x249619={'failMessage':_0x57542f};}if(this[_0x7d02('0x11')][_0x7550a0]['AttachmentId']){faxMessage[_0x7d02('0x45')](this['actions'][_0x7550a0][_0x7d02('0x46')],_0x249619)['then'](function(_0x4bd773){ut[_0x7d02('0x49')](_0x7d02('0x4c'),_0x4bd773);})[_0x7d02('0x3e')](function(_0x587d14){ut[_0x7d02('0x49')]('[Fax][Message][NoUpdate1]',_0x587d14);})[_0x7d02('0x4d')](function(){delete _0xc670e0[_0x7d02('0xe')][_0x7550a0];delete _0xc670e0['actions'][_0x7550a0];});}else{ut[_0x7d02('0x49')](_0x7d02('0x4e'));delete this['channels'][_0x7550a0];delete this[_0x7d02('0x11')][_0x7550a0];}};Fax[_0x7d02('0x1f')][_0x7d02('0x1d')]=function(_0xe88aa6){var _0x5c7032=this;if(this['channels'][_0xe88aa6[_0x7d02('0x26')]]){if(this[_0x7d02('0x11')][_0xe88aa6[_0x7d02('0x26')]]){this[_0x7d02('0xe')][_0xe88aa6[_0x7d02('0x26')]]['id']=this['actions'][_0xe88aa6[_0x7d02('0x26')]]['id'];this[_0x7d02('0xe')][_0xe88aa6[_0x7d02('0x26')]][_0x7d02('0x28')]=this[_0x7d02('0x11')][_0xe88aa6[_0x7d02('0x26')]][_0x7d02('0x28')];}logger[_0x7d02('0x29')](_0xe88aa6[_0x7d02('0x26')],this['actions'][_0xe88aa6[_0x7d02('0x26')]]?'\x20hangup\x20sendFile\x20':_0x7d02('0x4f'),JSON['stringify'](this[_0x7d02('0xe')][_0xe88aa6['uniqueid']]));if(this[_0x7d02('0x11')][_0xe88aa6[_0x7d02('0x26')]]){if(this[_0x7d02('0xe')][_0xe88aa6[_0x7d02('0x26')]][_0x7d02('0x50')]>0x0&&this[_0x7d02('0xe')][_0xe88aa6[_0x7d02('0x26')]][_0x7d02('0x18')]==='SUCCESS'){this[_0x7d02('0x4b')](_0xe88aa6['uniqueid'],!![]);}else{this[_0x7d02('0x4b')](_0xe88aa6['uniqueid'],![],this[_0x7d02('0xe')][_0xe88aa6[_0x7d02('0x26')]][_0x7d02('0x51')]?'SENDING\x20FAILED:\x20'+this[_0x7d02('0xe')][_0xe88aa6[_0x7d02('0x26')]][_0x7d02('0x51')]:_0x7d02('0x52'));}}}};Fax[_0x7d02('0x1f')]['send']=function(_0x1247e0){var _0x567190=this;return new BPromise(function(_0x7931c9,_0x40d6a9){_0x567190['execOriginate'](_0x1247e0,_0x567190[_0x7d02('0xf')][_0x1247e0[_0x7d02('0x53')]])[_0x7d02('0x48')](function(_0x1780db){ut[_0x7d02('0x49')](_0x7d02('0x54'),_0x1780db);_0x7931c9(ut[_0x7d02('0x39')](_0x7d02('0x55')));})[_0x7d02('0x3e')](function(_0x23dbee){ut[_0x7d02('0x49')](_0x7d02('0x56'),_0x23dbee);updateStatus(_0x1247e0);_0x40d6a9(ut['message'](_0x7d02('0x57')));});});};Fax[_0x7d02('0x1f')][_0x7d02('0x58')]=function(_0x43910e){var _0x46eb75=this;return new BPromise(function(_0x58591d,_0x57cf51){var _0x8abcfc=_0x46eb75[_0x7d02('0x59')](_0x46eb75['faxAccounts'][_0x43910e[_0x7d02('0x53')]][_0x7d02('0x5a')],_0x43910e);if(_0x8abcfc[_0x7d02('0x5b')]){_0x58591d(ut[_0x7d02('0x39')](_0x7d02('0x5c')));}else{_0x57cf51(ut[_0x7d02('0x39')](_0x8abcfc[_0x7d02('0x39')]));}});};function originate(_0xdc1a5f,_0x211159,_0x1703a3){return new BPromise(function(_0x5651ca,_0x5e4b89){if(_0x1703a3){var _0x5b9364=util[_0x7d02('0x5d')](_0x7d02('0x5e'),path[_0x7d02('0x3a')](_0xdc1a5f['path'])[_0x7d02('0x28')],_0xdc1a5f['path']);gs[_0x7d02('0x5f')](_0x5b9364)[_0x7d02('0x48')](function(){_0xdc1a5f[_0x7d02('0x2')]=util[_0x7d02('0x5d')](_0x7d02('0x60'),path['parse'](_0xdc1a5f[_0x7d02('0x2')])[_0x7d02('0x61')],path['parse'](_0xdc1a5f[_0x7d02('0x2')])[_0x7d02('0x28')]);_0x211159[_0x7d02('0x62')]=_0xdc1a5f['path'];ut[_0x7d02('0x49')](_0x7d02('0x63'),'');ami[_0x7d02('0x64')](ut[_0x7d02('0x65')](_0xdc1a5f,_0x211159))[_0x7d02('0x48')](function(_0x319519){_0x5651ca(_0x319519);})['catch'](function(_0x13f85d){_0x5e4b89(_0x13f85d);});})[_0x7d02('0x3e')](function(_0xd174e0){_0x5e4b89(_0xd174e0);});}else{ami[_0x7d02('0x64')](ut[_0x7d02('0x65')](_0xdc1a5f,_0x211159))[_0x7d02('0x48')](function(_0x17e39b){_0x5651ca(_0x17e39b);})[_0x7d02('0x3e')](function(_0x4efa48){_0x5e4b89(_0x4efa48);});}});}Fax['prototype']['execOriginate']=function(_0x506f21,_0x325416){var _0x379c54=this;return new BPromise(function(_0x1ac245,_0x10b4d2){var _0x1278c9=uuid['v4']();var _0x5c3d00=ut[_0x7d02('0x66')](_0x506f21,_0x325416);_0x379c54[_0x7d02('0x11')][_0x1278c9]=new Action(_0x1278c9,_0x325416,_0x506f21);var _0x4dc9ad=_0x379c54[_0x7d02('0x11')][_0x1278c9];if(path[_0x7d02('0x3a')](_0x506f21[_0x7d02('0x2')])[_0x7d02('0x67')]==='.pdf'){originate(_0x4dc9ad,_0x5c3d00,!![])[_0x7d02('0x48')](function(_0x2c5727){_0x1ac245(_0x2c5727);})[_0x7d02('0x3e')](function(_0x37f6ca){_0x10b4d2(_0x37f6ca);});}else{originate(_0x4dc9ad,_0x5c3d00,![])[_0x7d02('0x48')](function(_0xe8d893){_0x1ac245(_0xe8d893);})[_0x7d02('0x3e')](function(_0xc9f017){_0x10b4d2(_0xc9f017);});}});};Fax['prototype'][_0x7d02('0x68')]=function(_0xde17f8){return!_[_0x7d02('0x69')](_0xde17f8)&&!_[_0x7d02('0x69')](_0xde17f8['name'])&&!_['isNil'](_0xde17f8[_0x7d02('0x6a')])&&_0xde17f8[_0x7d02('0x6a')]&&!_[_0x7d02('0x69')](this[_0x7d02('0x10')][util[_0x7d02('0x5d')](_0x7d02('0x6b'),_0xde17f8['name'])])&&!_[_0x7d02('0x69')](this[_0x7d02('0x10')][util[_0x7d02('0x5d')](_0x7d02('0x6b'),_0xde17f8[_0x7d02('0x28')])]['status'])&&(this[_0x7d02('0x10')][util[_0x7d02('0x5d')](_0x7d02('0x6b'),_0xde17f8[_0x7d02('0x28')])][_0x7d02('0x6c')]==='reachable'||this[_0x7d02('0x10')][util[_0x7d02('0x5d')](_0x7d02('0x6b'),_0xde17f8['name'])][_0x7d02('0x6c')]===_0x7d02('0x6d'));};Fax['prototype'][_0x7d02('0x59')]=function(_0x4e7698,_0xc9ab15){if(!this['isTrunkReachable'](_0x4e7698)){ut['logger'](_0x7d02('0x6e'),_[_0x7d02('0x69')](_0x4e7698)?'':_0x4e7698[_0x7d02('0x28')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x7d02('0x6f')};}if(_[_0x7d02('0x69')](_0xc9ab15['fax'])){ut[_0x7d02('0x49')](_0x7d02('0x70'),JSON[_0x7d02('0x40')](_0xc9ab15));return{'isValid':![],'message':_0x7d02('0x71')};}if(_[_0x7d02('0x69')](_0xc9ab15[_0x7d02('0x2')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x7d02('0x40')](_0xc9ab15));return{'isValid':![],'message':_0x7d02('0x72')};}return{'isValid':!![],'message':_0x7d02('0x73')};};module[_0x7d02('0x74')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f7f964b..bcede45 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 _0xb473=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then'];(function(_0x48624e,_0x4f46ee){var _0x381b38=function(_0x4a7eac){while(--_0x4a7eac){_0x48624e['push'](_0x48624e['shift']());}};_0x381b38(++_0x4f46ee);}(_0xb473,0xa9));var _0x3b47=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xb473[_0x25d386];return _0x857f4a;};'use strict';var util=require(_0x3b47('0x0'));var BPromise=require(_0x3b47('0x1'));var logger=require(_0x3b47('0x2'))(_0x3b47('0x3'));var _=require(_0x3b47('0x4'));var faxAccount=require(_0x3b47('0x5'));function loggerCatch(_0x5b6e83){return function(_0x122ad0){logger[_0x3b47('0x6')](_0x5b6e83,util[_0x3b47('0x7')](_0x122ad0,{'showHidden':![],'depth':null}));};}exports[_0x3b47('0x8')]=function(_0x3f29b0,_0x3544b2){return BPromise[_0x3b47('0x9')]()[_0x3b47('0xa')](faxAccount[_0x3b47('0x8')](_0x3f29b0,_0x3544b2))['catch'](loggerCatch(_0x3b47('0xb')));}; \ No newline at end of file +var _0xe62d=['inspect','then','notify','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error'];(function(_0x2b7de4,_0x2dc3ad){var _0x58dc02=function(_0x2b3cfb){while(--_0x2b3cfb){_0x2b7de4['push'](_0x2b7de4['shift']());}};_0x58dc02(++_0x2dc3ad);}(_0xe62d,0xaa));var _0xde62=function(_0xe31502,_0x24688d){_0xe31502=_0xe31502-0x0;var _0x171c63=_0xe62d[_0xe31502];return _0x171c63;};'use strict';var util=require('util');var BPromise=require(_0xde62('0x0'));var logger=require(_0xde62('0x1'))(_0xde62('0x2'));var _=require(_0xde62('0x3'));var faxAccount=require(_0xde62('0x4'));function loggerCatch(_0x807262){return function(_0xf537a8){logger[_0xde62('0x5')](_0x807262,util[_0xde62('0x6')](_0xf537a8,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x56de8c,_0x544ac1){return BPromise['resolve']()[_0xde62('0x7')](faxAccount[_0xde62('0x8')](_0x56de8c,_0x544ac1))[_0xde62('0x9')](loggerCatch(_0xde62('0xa')));}; \ 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 c837b18..5eaf0f3 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 _0x58f7=['exec','Exec\x20gs','info','\x20Error\x20:','util','../../../../config/logger','bluebird','child_process'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x58f7,0x104));var _0x758f=function(_0x3fe30d,_0x469e48){_0x3fe30d=_0x3fe30d-0x0;var _0x37b3e1=_0x58f7[_0x3fe30d];return _0x37b3e1;};'use strict';var util=require(_0x758f('0x0'));var logger=require(_0x758f('0x1'))('fax');var BPromise=require(_0x758f('0x2'));var exec=require(_0x758f('0x3'))[_0x758f('0x4')];exports['execute']=function(_0xb3f4c0){return new BPromise(function(_0x41ddba,_0x2a5eba){exec(_0xb3f4c0,function(_0x1fa4f1,_0x2548cb,_0x301f13){logger['info'](_0x758f('0x5'),_0x2548cb);if(_0x1fa4f1){logger[_0x758f('0x6')]('Exec\x20gs',_0x758f('0x7'),util['inspect'](_0x1fa4f1,{'showHidden':![],'depth':null}),_0x2548cb,_0x301f13);_0x2a5eba(_0x1fa4f1);}_0x41ddba(_0x2548cb);});});}; \ No newline at end of file +var _0xcd21=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xcd21,0x1c7));var _0x1cd2=function(_0x273f2b,_0x2d2e73){_0x273f2b=_0x273f2b-0x0;var _0xa29b80=_0xcd21[_0x273f2b];return _0xa29b80;};'use strict';var util=require(_0x1cd2('0x0'));var logger=require(_0x1cd2('0x1'))(_0x1cd2('0x2'));var BPromise=require(_0x1cd2('0x3'));var exec=require(_0x1cd2('0x4'))['exec'];exports[_0x1cd2('0x5')]=function(_0x1dbeb3){return new BPromise(function(_0x2d464f,_0x36ab78){exec(_0x1dbeb3,function(_0x485be6,_0x2215f0,_0x305b8c){logger[_0x1cd2('0x6')](_0x1cd2('0x7'),_0x2215f0);if(_0x485be6){logger[_0x1cd2('0x6')](_0x1cd2('0x7'),_0x1cd2('0x8'),util[_0x1cd2('0x9')](_0x485be6,{'showHidden':![],'depth':null}),_0x2215f0,_0x305b8c);_0x36ab78(_0x485be6);}_0x2d464f(_0x2215f0);});});}; \ 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 eb96721..6d434b0 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 _0x4a0d=['addVariables','ecm','headerinfo','minrate','gateway','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','format','\x22%s\x22\x20<%s>','uniqueid','lodash','moment','../../../../config/logger','fax','logger','info','inspect'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4a0d,0x185));var _0xd4a0=function(_0x458775,_0x523411){_0x458775=_0x458775-0x0;var _0x48eb06=_0x4a0d[_0x458775];return _0x48eb06;};'use strict';var util=require('util');var _=require(_0xd4a0('0x0'));var moment=require(_0xd4a0('0x1'));var logger=require(_0xd4a0('0x2'))(_0xd4a0('0x3'));exports['message']=function(_0x3d371f){return{'message':_0x3d371f};};exports[_0xd4a0('0x4')]=function(_0x1924e9,_0x57cfc0){logger[_0xd4a0('0x5')](_0x1924e9,util[_0xd4a0('0x6')](_0x57cfc0,{'showHidden':![],'depth':null}));};exports[_0xd4a0('0x7')]=function(_0x431add,_0x4ff654){var _0x40c5d8={'XMF-ECM':_0x4ff654[_0xd4a0('0x8')],'XMF-HEADERINFO':_0x4ff654[_0xd4a0('0x9')],'XMF-MINRATE':_0x4ff654[_0xd4a0('0xa')],'XMF-MAXRATE':_0x4ff654['maxrate'],'XMF-MODEM':util['format']('\x22%s\x22',_0x4ff654['modem']),'XMF-GATEWAY':_0x4ff654[_0xd4a0('0xb')],'XMF-FAXDETECT':_0x4ff654['faxdetect'],'XMF-T38TIMEOUT':_0x4ff654[_0xd4a0('0xc')],'XMF-LOCALSTATIONID':_0x4ff654[_0xd4a0('0xd')],'XMF-PATH':_0x431add[_0xd4a0('0xe')]};return _0x40c5d8;};exports[_0xd4a0('0xf')]=function(_0x1e9229,_0x23af59){return{'actionid':_0x1e9229['uniqueid'],'action':_0xd4a0('0x10'),'channel':_0x1e9229[_0xd4a0('0x11')],'Exten':_0xd4a0('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0xd4a0('0x13')](_0xd4a0('0x14'),_0x1e9229[_0xd4a0('0x9')]?_0x1e9229['headerinfo']:'',_0x1e9229['localstationid']),'variable':_0x23af59,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1e9229[_0xd4a0('0x15')]};}; \ No newline at end of file +var _0x0236=['message','logger','info','inspect','ecm','headerinfo','maxrate','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax'];(function(_0x27351f,_0x2a8c87){var _0x31bbc0=function(_0x20b97b){while(--_0x20b97b){_0x27351f['push'](_0x27351f['shift']());}};_0x31bbc0(++_0x2a8c87);}(_0x0236,0xcb));var _0x6023=function(_0x3ef8a9,_0x59a7c2){_0x3ef8a9=_0x3ef8a9-0x0;var _0x424f63=_0x0236[_0x3ef8a9];return _0x424f63;};'use strict';var util=require(_0x6023('0x0'));var _=require(_0x6023('0x1'));var moment=require('moment');var logger=require(_0x6023('0x2'))(_0x6023('0x3'));exports[_0x6023('0x4')]=function(_0x2664a5){return{'message':_0x2664a5};};exports[_0x6023('0x5')]=function(_0x2fd981,_0x3e09a3){logger[_0x6023('0x6')](_0x2fd981,util[_0x6023('0x7')](_0x3e09a3,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2e0645,_0x3b005e){var _0x3194dd={'XMF-ECM':_0x3b005e[_0x6023('0x8')],'XMF-HEADERINFO':_0x3b005e[_0x6023('0x9')],'XMF-MINRATE':_0x3b005e['minrate'],'XMF-MAXRATE':_0x3b005e[_0x6023('0xa')],'XMF-MODEM':util['format'](_0x6023('0xb'),_0x3b005e[_0x6023('0xc')]),'XMF-GATEWAY':_0x3b005e['gateway'],'XMF-FAXDETECT':_0x3b005e['faxdetect'],'XMF-T38TIMEOUT':_0x3b005e[_0x6023('0xd')],'XMF-LOCALSTATIONID':_0x3b005e[_0x6023('0xe')],'XMF-PATH':_0x2e0645[_0x6023('0xf')]};return _0x3194dd;};exports[_0x6023('0x10')]=function(_0x1720fb,_0x3e15cf){return{'actionid':_0x1720fb[_0x6023('0x11')],'action':_0x6023('0x12'),'channel':_0x1720fb[_0x6023('0x13')],'Exten':_0x6023('0x14'),'Context':_0x6023('0x15'),'Priority':'1','callerid':util['format'](_0x6023('0x16'),_0x1720fb[_0x6023('0x9')]?_0x1720fb[_0x6023('0x9')]:'',_0x1720fb[_0x6023('0xe')]),'variable':_0x3e15cf,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1720fb['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f827118..e3e3569 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 _0x4af8=['getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','inspect','catch','[index.js][main]','util','moment','./realtime','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts'];(function(_0x5597a1,_0xa9b3bf){var _0x21b954=function(_0x13462d){while(--_0x13462d){_0x5597a1['push'](_0x5597a1['shift']());}};_0x21b954(++_0xa9b3bf);}(_0x4af8,0x19a));var _0x84af=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4af8[_0xc6be3a];return _0x56a310;};'use strict';var BPromise=require('bluebird');var util=require(_0x84af('0x0'));var moment=require(_0x84af('0x1'));var server=require('./server');var Realtime=require(_0x84af('0x2'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x84af('0x3'));var Dialer=require(_0x84af('0x4'));var Preview=require(_0x84af('0x5'));var Fax=require(_0x84af('0x6'));var user=require(_0x84af('0x7'));var voiceQueue=require(_0x84af('0x8'));var voiceQueueReport=require(_0x84af('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x84af('0xa'));var trigger=require(_0x84af('0xb'));var template=require(_0x84af('0xc'));var cmHopperHistory=require(_0x84af('0xd'));var campaign=require(_0x84af('0xe'));var voiceExtension=require(_0x84af('0xf'));var faxAccount=require(_0x84af('0x10'));var zendesk=require(_0x84af('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x84af('0x12'));var freshdesk=require(_0x84af('0x13'));var desk=require(_0x84af('0x14'));var zoho=require(_0x84af('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x84af('0x16'));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 logger=require(_0x84af('0x17'))(_0x84af('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x84af('0x19')](_0x84af('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x84af('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x84af('0x1b')]()['then'](user[_0x84af('0x1c')]())[_0x84af('0x1d')](realtime[_0x84af('0x1e')]())[_0x84af('0x1d')](user[_0x84af('0x1f')]())[_0x84af('0x1d')](realtime[_0x84af('0x20')]())[_0x84af('0x1d')](trunk[_0x84af('0x21')]())['then'](realtime[_0x84af('0x22')]())['then'](voiceQueue[_0x84af('0x23')]())['then'](realtime['initVoiceQueues']())[_0x84af('0x1d')](trigger['getTriggers']())[_0x84af('0x1d')](realtime[_0x84af('0x24')]())[_0x84af('0x1d')](template[_0x84af('0x25')]())[_0x84af('0x1d')](realtime[_0x84af('0x26')]())[_0x84af('0x1d')](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())[_0x84af('0x1d')](salesforce[_0x84af('0x27')]())['then'](realtime[_0x84af('0x28')]())['then'](sugarcrm[_0x84af('0x29')]())[_0x84af('0x1d')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x84af('0x2a')]())[_0x84af('0x1d')](realtime[_0x84af('0x2b')]())[_0x84af('0x1d')](desk[_0x84af('0x2c')]())['then'](realtime[_0x84af('0x2d')]())[_0x84af('0x1d')](zoho[_0x84af('0x2e')]())['then'](realtime[_0x84af('0x2f')]())['then'](vtiger[_0x84af('0x30')]())[_0x84af('0x1d')](realtime[_0x84af('0x31')]())[_0x84af('0x1d')](freshsales[_0x84af('0x32')]())[_0x84af('0x1d')](realtime[_0x84af('0x33')]())[_0x84af('0x1d')](servicenow[_0x84af('0x34')]())[_0x84af('0x1d')](realtime['initServicenowAccounts']())[_0x84af('0x1d')](dynamics365[_0x84af('0x35')]())[_0x84af('0x1d')](realtime[_0x84af('0x36')]())['then'](campaign['getCampaigns']())[_0x84af('0x1d')](realtime[_0x84af('0x37')]())[_0x84af('0x1d')](voiceExtension[_0x84af('0x38')]())[_0x84af('0x1d')](realtime[_0x84af('0x39')]())['then'](faxAccount[_0x84af('0x3a')]())[_0x84af('0x1d')](realtime[_0x84af('0x3b')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x84af('0x1d')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())[_0x84af('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x84af('0x1d')](realtime[_0x84af('0x3c')]())[_0x84af('0x1d')](cmHopperHistory[_0x84af('0x3d')]())['then'](realtime['initCampaignHopperHistory']())[_0x84af('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x84af('0x1d')](realtime[_0x84af('0x3e')]())['catch'](function(_0x10ee4c){logger['error']('[index.js][initParams]',util[_0x84af('0x3f')](_0x10ee4c,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x84af('0x1d')](function(_0x181c14){return initRealtime();})[_0x84af('0x1d')](function(){return initParams();})[_0x84af('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x84af('0x40')](function(_0x568d54){logger['error'](_0x84af('0x41'),util[_0x84af('0x3f')](_0x568d54,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x8477=['./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','hour','get','resolve','then','getAgents','initAgents','initTelephones','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','sync','./realtime','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue'];(function(_0x3d5eee,_0x4550a4){var _0xb7a22=function(_0x29131f){while(--_0x29131f){_0x3d5eee['push'](_0x3d5eee['shift']());}};_0xb7a22(++_0x4550a4);}(_0x8477,0x198));var _0x7847=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8477[_0x178e48];return _0x440d7e;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require('./server');var Realtime=require(_0x7847('0x0'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x7847('0x1'));var Dialer=require(_0x7847('0x2'));var Preview=require('./preview');var Fax=require(_0x7847('0x3'));var user=require(_0x7847('0x4'));var voiceQueue=require(_0x7847('0x5'));var voiceQueueReport=require(_0x7847('0x6'));var voiceCallReport=require(_0x7847('0x7'));var trunk=require(_0x7847('0x8'));var trigger=require(_0x7847('0x9'));var template=require(_0x7847('0xa'));var cmHopperHistory=require(_0x7847('0xb'));var campaign=require(_0x7847('0xc'));var voiceExtension=require(_0x7847('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x7847('0xe'));var salesforce=require(_0x7847('0xf'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x7847('0x10'));var vtiger=require(_0x7847('0x11'));var freshsales=require(_0x7847('0x12'));var servicenow=require(_0x7847('0x13'));var dynamics365=require('./rpc/integrations/dynamics365');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 logger=require(_0x7847('0x14'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x7847('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7847('0x16')](_0x7847('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7847('0x17')]()[_0x7847('0x18')](user[_0x7847('0x19')]())[_0x7847('0x18')](realtime[_0x7847('0x1a')]())['then'](user['getTelephones']())['then'](realtime[_0x7847('0x1b')]())[_0x7847('0x18')](trunk['getTrunks']())['then'](realtime['initTrunks']())[_0x7847('0x18')](voiceQueue[_0x7847('0x1c')]())['then'](realtime[_0x7847('0x1d')]())[_0x7847('0x18')](trigger[_0x7847('0x1e')]())['then'](realtime[_0x7847('0x1f')]())['then'](template[_0x7847('0x20')]())[_0x7847('0x18')](realtime[_0x7847('0x21')]())[_0x7847('0x18')](zendesk[_0x7847('0x22')]())['then'](realtime[_0x7847('0x23')]())[_0x7847('0x18')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x7847('0x24')]())[_0x7847('0x18')](sugarcrm[_0x7847('0x25')]())[_0x7847('0x18')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x7847('0x26')]())[_0x7847('0x18')](realtime[_0x7847('0x27')]())[_0x7847('0x18')](desk[_0x7847('0x28')]())['then'](realtime[_0x7847('0x29')]())[_0x7847('0x18')](zoho[_0x7847('0x2a')]())[_0x7847('0x18')](realtime['initZohoAccounts']())['then'](vtiger[_0x7847('0x2b')]())[_0x7847('0x18')](realtime['initVtigerAccounts']())[_0x7847('0x18')](freshsales[_0x7847('0x2c')]())[_0x7847('0x18')](realtime[_0x7847('0x2d')]())[_0x7847('0x18')](servicenow[_0x7847('0x2e')]())[_0x7847('0x18')](realtime[_0x7847('0x2f')]())[_0x7847('0x18')](dynamics365[_0x7847('0x30')]())[_0x7847('0x18')](realtime[_0x7847('0x31')]())[_0x7847('0x18')](campaign[_0x7847('0x32')]())[_0x7847('0x18')](realtime[_0x7847('0x33')]())[_0x7847('0x18')](voiceExtension[_0x7847('0x34')]())[_0x7847('0x18')](realtime[_0x7847('0x35')]())['then'](faxAccount[_0x7847('0x36')]())[_0x7847('0x18')](realtime[_0x7847('0x37')]())[_0x7847('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x7847('0x17')]()[_0x7847('0x18')](voiceQueueReport[_0x7847('0x38')]())[_0x7847('0x18')](realtime[_0x7847('0x39')]())['then'](cmHopperHistory[_0x7847('0x3a')]())[_0x7847('0x18')](realtime[_0x7847('0x3b')]())[_0x7847('0x18')](cmHopperHistory[_0x7847('0x3c')]())[_0x7847('0x18')](realtime[_0x7847('0x3d')]())[_0x7847('0x18')](voiceCallReport[_0x7847('0x3e')]())['then'](realtime[_0x7847('0x3f')]())[_0x7847('0x40')](function(_0xbb34c1){logger[_0x7847('0x41')]('[index.js][initParams]',util[_0x7847('0x42')](_0xbb34c1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x7847('0x43')](realtime,preview,fax)[_0x7847('0x18')](function(_0x5f4db8){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x7847('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3f7e45){logger[_0x7847('0x41')]('[index.js][main]',util[_0x7847('0x42')](_0x3f7e45,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 4f23c63..c7cb862 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xedd9,0xfc));var _0x9edd=function(_0x23a731,_0x30326f){_0x23a731=_0x23a731-0x0;var _0xa4fd72=_0xedd9[_0x23a731];return _0xa4fd72;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0xd7629e,_0x5a3eb3){var _0x4762ea=function(_0x479147){while(--_0x479147){_0xd7629e['push'](_0xd7629e['shift']());}};_0x4762ea(++_0x5a3eb3);}(_0xe706,0xa3));var _0x6e70=function(_0x4c5a24,_0x5ef60c){_0x4c5a24=_0x4c5a24-0x0;var _0x4b067e=_0xe706[_0x4c5a24];return _0x4b067e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c1baa8e..4753cbf 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 _0x3f30=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x5b7643,_0x29316e){var _0x3fe5c6=function(_0x85b567){while(--_0x85b567){_0x5b7643['push'](_0x5b7643['shift']());}};_0x3fe5c6(++_0x29316e);}(_0x3f30,0xd4));var _0x03f3=function(_0x486c63,_0x59392a){_0x486c63=_0x486c63-0x0;var _0x2e9b65=_0x3f30[_0x486c63];return _0x2e9b65;};'use strict';function Campaign(_0x39cc8f){this['id']=_0x39cc8f['id']||0x0;this[_0x03f3('0x0')]=_0x39cc8f[_0x03f3('0x0')]||'';this[_0x03f3('0x1')]=_0x39cc8f[_0x03f3('0x1')]||_0x03f3('0x2');this[_0x03f3('0x3')]=0x0;this[_0x03f3('0x4')]=0x0;this[_0x03f3('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x03f3('0x6')]='';this[_0x03f3('0x7')]=!![];this[_0x03f3('0x8')]=_0x39cc8f['active'];this[_0x03f3('0x9')]=_0x39cc8f[_0x03f3('0x9')];this[_0x03f3('0xa')]=_0x39cc8f[_0x03f3('0xa')]||null;this[_0x03f3('0xb')]=_0x39cc8f[_0x03f3('0xb')]?_0x39cc8f[_0x03f3('0xb')]:null;this['dialOriginateCallerIdName']=_0x39cc8f[_0x03f3('0xc')];this[_0x03f3('0xd')]=_0x39cc8f[_0x03f3('0xd')];this[_0x03f3('0xe')]=_0x39cc8f[_0x03f3('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x39cc8f[_0x03f3('0xf')];this[_0x03f3('0x10')]=_0x39cc8f[_0x03f3('0x10')];this['dialBusyMaxRetry']=_0x39cc8f[_0x03f3('0x11')];this[_0x03f3('0x12')]=_0x39cc8f[_0x03f3('0x12')];this[_0x03f3('0x13')]=_0x39cc8f[_0x03f3('0x13')];this[_0x03f3('0x14')]=_0x39cc8f[_0x03f3('0x14')];this[_0x03f3('0x15')]=_0x39cc8f['dialGlobalMaxRetry'];this[_0x03f3('0x16')]=_0x39cc8f[_0x03f3('0x16')]||0x3;this[_0x03f3('0x17')]=_0x39cc8f[_0x03f3('0x17')]||0x96;this[_0x03f3('0x18')]=_0x39cc8f[_0x03f3('0x18')]||0x3;this[_0x03f3('0x19')]=_0x39cc8f[_0x03f3('0x19')]||0x96;this[_0x03f3('0x1a')]=_0x39cc8f[_0x03f3('0x1a')]||0x3;this[_0x03f3('0x1b')]=_0x39cc8f[_0x03f3('0x1b')]||0x96;this[_0x03f3('0x1c')]=_0x39cc8f[_0x03f3('0x1c')]||0x3;this['dialMachineRetryFrequency']=_0x39cc8f['dialMachineRetryFrequency']||0x96;this[_0x03f3('0x1d')]=_0x39cc8f['dialAgentRejectMaxRetry']||0x3;this[_0x03f3('0x1e')]=_0x39cc8f[_0x03f3('0x1e')]||0x96;this[_0x03f3('0x1f')]=_0x39cc8f[_0x03f3('0x1f')]||'DESC';this['dialPrefix']=_0x39cc8f['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x39cc8f[_0x03f3('0x20')]||undefined;this[_0x03f3('0x21')]=_0x39cc8f[_0x03f3('0x21')]||undefined;this[_0x03f3('0x22')]=_0x39cc8f[_0x03f3('0x22')]?_0x39cc8f['TrunkBackup']:undefined;this['Trunk']=_0x39cc8f[_0x03f3('0x23')]?_0x39cc8f['Trunk']:undefined;this[_0x03f3('0x24')]=_0x39cc8f[_0x03f3('0x24')]?_0x39cc8f['Interval']:undefined;this['SquareProject']=_0x39cc8f[_0x03f3('0x25')]?_0x39cc8f[_0x03f3('0x25')]:undefined;this['dialQueueProject']=_0x39cc8f['SquareProject']?_0x39cc8f[_0x03f3('0x25')][_0x03f3('0x0')]:undefined;this['dialAMDActive']=_0x39cc8f[_0x03f3('0x26')]||![];this[_0x03f3('0x27')]=_0x39cc8f[_0x03f3('0x27')];this['dialAMDGreeting']=_0x39cc8f[_0x03f3('0x28')];this[_0x03f3('0x29')]=_0x39cc8f[_0x03f3('0x29')];this['dialAMDTotalAnalysisTime']=_0x39cc8f[_0x03f3('0x2a')];this[_0x03f3('0x2b')]=_0x39cc8f[_0x03f3('0x2b')];this[_0x03f3('0x2c')]=_0x39cc8f[_0x03f3('0x2c')];this[_0x03f3('0x2d')]=_0x39cc8f['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x39cc8f['dialAMDSilenceThreshold'];this[_0x03f3('0x2e')]=_0x39cc8f[_0x03f3('0x2e')];}module['exports']=Campaign; \ No newline at end of file +var _0x1e79=['Trunk','SquareProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','TrunkBackup'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1e79,0xce));var _0x91e7=function(_0x5c6f53,_0x5f08f6){_0x5c6f53=_0x5c6f53-0x0;var _0x4b9fff=_0x1e79[_0x5c6f53];return _0x4b9fff;};'use strict';function Campaign(_0x145e23){this['id']=_0x145e23['id']||0x0;this['name']=_0x145e23['name']||'';this['type']=_0x145e23[_0x91e7('0x0')]||_0x91e7('0x1');this[_0x91e7('0x2')]=0x0;this[_0x91e7('0x3')]=0x0;this[_0x91e7('0x4')]=0x0;this[_0x91e7('0x5')]=0x0;this[_0x91e7('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x91e7('0x7')]=_0x145e23[_0x91e7('0x7')];this[_0x91e7('0x8')]=_0x145e23['limitCalls'];this[_0x91e7('0x9')]=_0x145e23[_0x91e7('0x9')]||null;this['dialGlobalInterval']=_0x145e23[_0x91e7('0xa')]?_0x145e23['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x145e23[_0x91e7('0xb')];this[_0x91e7('0xc')]=_0x145e23[_0x91e7('0xc')];this[_0x91e7('0xd')]=_0x145e23[_0x91e7('0xd')]||0x1e;this[_0x91e7('0xe')]=_0x145e23[_0x91e7('0xe')];this[_0x91e7('0xf')]=_0x145e23['dialCongestionRetryFrequency'];this[_0x91e7('0x10')]=_0x145e23[_0x91e7('0x10')];this[_0x91e7('0x11')]=_0x145e23['dialBusyRetryFrequency'];this[_0x91e7('0x12')]=_0x145e23[_0x91e7('0x12')];this[_0x91e7('0x13')]=_0x145e23['dialNoAnswerRetryFrequency'];this[_0x91e7('0x14')]=_0x145e23[_0x91e7('0x14')];this[_0x91e7('0x15')]=_0x145e23['dialNoSuchNumberMaxRetry']||0x3;this[_0x91e7('0x16')]=_0x145e23[_0x91e7('0x16')]||0x96;this['dialDropMaxRetry']=_0x145e23['dialDropMaxRetry']||0x3;this[_0x91e7('0x17')]=_0x145e23['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x145e23[_0x91e7('0x18')]||0x3;this[_0x91e7('0x19')]=_0x145e23[_0x91e7('0x19')]||0x96;this['dialMachineMaxRetry']=_0x145e23[_0x91e7('0x1a')]||0x3;this[_0x91e7('0x1b')]=_0x145e23[_0x91e7('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x145e23[_0x91e7('0x1c')]||0x3;this[_0x91e7('0x1d')]=_0x145e23[_0x91e7('0x1d')]||0x96;this[_0x91e7('0x1e')]=_0x145e23[_0x91e7('0x1e')]||_0x91e7('0x1f');this['dialPrefix']=_0x145e23['dialPrefix']||undefined;this[_0x91e7('0x20')]=_0x145e23['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x145e23['dialCutDigit']||undefined;this[_0x91e7('0x21')]=_0x145e23[_0x91e7('0x21')]?_0x145e23['TrunkBackup']:undefined;this[_0x91e7('0x22')]=_0x145e23[_0x91e7('0x22')]?_0x145e23[_0x91e7('0x22')]:undefined;this['Interval']=_0x145e23['Interval']?_0x145e23['Interval']:undefined;this[_0x91e7('0x23')]=_0x145e23[_0x91e7('0x23')]?_0x145e23['SquareProject']:undefined;this['dialQueueProject']=_0x145e23[_0x91e7('0x23')]?_0x145e23[_0x91e7('0x23')][_0x91e7('0x24')]:undefined;this[_0x91e7('0x25')]=_0x145e23[_0x91e7('0x25')]||![];this[_0x91e7('0x26')]=_0x145e23[_0x91e7('0x26')];this[_0x91e7('0x27')]=_0x145e23[_0x91e7('0x27')];this[_0x91e7('0x28')]=_0x145e23[_0x91e7('0x28')];this[_0x91e7('0x29')]=_0x145e23[_0x91e7('0x29')];this[_0x91e7('0x2a')]=_0x145e23[_0x91e7('0x2a')];this[_0x91e7('0x2b')]=_0x145e23[_0x91e7('0x2b')];this[_0x91e7('0x2c')]=_0x145e23['dialAMDMaximumNumberOfWords'];this[_0x91e7('0x2d')]=_0x145e23['dialAMDSilenceThreshold'];this[_0x91e7('0x2e')]=_0x145e23['dialAMDMaximumWordLength'];}module[_0x91e7('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index b013050..6d2395c 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 _0x1472=['disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','linkedid','exten','answered','unmanaged','lastapplication','lastdata','duration','holdtime','type'];(function(_0xea5c3f,_0x138fca){var _0x19456e=function(_0xff6f39){while(--_0xff6f39){_0xea5c3f['push'](_0xea5c3f['shift']());}};_0x19456e(++_0x138fca);}(_0x1472,0x166));var _0x2147=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0x1472[_0x42c6f1];return _0x3c7398;};'use strict';function Channel(){this[_0x2147('0x0')]=null;this[_0x2147('0x1')]='';this[_0x2147('0x2')]='';this[_0x2147('0x3')]=0x0;this[_0x2147('0x4')]='';this[_0x2147('0x5')]=undefined;this[_0x2147('0x6')]=undefined;this[_0x2147('0x7')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x2147('0x8')]=0x0;this[_0x2147('0x9')]=0x0;this[_0x2147('0xa')]=![];this['answertime']=null;this['endtime']=null;this[_0x2147('0xb')]=![];this['abandoned']=![];this[_0x2147('0xc')]='';this[_0x2147('0xd')]='';this[_0x2147('0xe')]=0x0;this['billableseconds']=0x0;this[_0x2147('0xf')]=0x0;this[_0x2147('0x10')]=null;this['tag']=null;this[_0x2147('0x11')]=null;this[_0x2147('0x12')]=![];this[_0x2147('0x13')]=null;this[_0x2147('0x14')]=null;this[_0x2147('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x2147('0x16')]=undefined;this['transferType']=undefined;this[_0x2147('0x17')]=0x0;}module[_0x2147('0x18')]=Channel; \ No newline at end of file +var _0x1f20=['holdtime','type','tag','monitor','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','calleridnum','connectedlinenum','connectedlinename','context','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds'];(function(_0x4b851f,_0x2487fe){var _0x4519d1=function(_0x2fa676){while(--_0x2fa676){_0x4b851f['push'](_0x4b851f['shift']());}};_0x4519d1(++_0x2487fe);}(_0x1f20,0x11c));var _0x01f2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1f20[_0x3ab51d];return _0x29a04e;};'use strict';function Channel(){this[_0x01f2('0x0')]=null;this[_0x01f2('0x1')]='';this['destinationchannel']='';this[_0x01f2('0x2')]=0x0;this['calleridname']='';this[_0x01f2('0x3')]=undefined;this[_0x01f2('0x4')]=undefined;this['accountcode']=0x0;this[_0x01f2('0x5')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x01f2('0x6')]=0x0;this[_0x01f2('0x7')]=![];this[_0x01f2('0x8')]=null;this[_0x01f2('0x9')]=null;this[_0x01f2('0xa')]=![];this[_0x01f2('0xb')]=![];this[_0x01f2('0xc')]='';this[_0x01f2('0xd')]='';this[_0x01f2('0xe')]=0x0;this[_0x01f2('0xf')]=0x0;this[_0x01f2('0x10')]=0x0;this[_0x01f2('0x11')]=null;this[_0x01f2('0x12')]=null;this['disposition']=null;this[_0x01f2('0x13')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x01f2('0x14')]=[];this[_0x01f2('0x15')]=undefined;this[_0x01f2('0x16')]=undefined;this[_0x01f2('0x17')]=undefined;this['mohtime']=0x0;}module[_0x01f2('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 30dcebd..ba558b3 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 _0x09fb=['consumerSecret','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','password','consumerKey'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x09fb,0x13b));var _0xb09f=function(_0x5ecac7,_0x3ffd1d){_0x5ecac7=_0x5ecac7-0x0;var _0xa92bea=_0x09fb[_0x5ecac7];return _0xa92bea;};'use strict';function DeskAccount(_0x2c5a66){this['id']=_0x2c5a66['id']||0x0;this[_0xb09f('0x0')]=_0x2c5a66['name']||'';this['username']=_0x2c5a66[_0xb09f('0x1')]||'';this['remoteUri']=_0x2c5a66[_0xb09f('0x2')]||'';this['authType']=_0x2c5a66['authType']||'';this['password']=_0x2c5a66[_0xb09f('0x3')]||'';this['consumerKey']=_0x2c5a66[_0xb09f('0x4')]||'';this[_0xb09f('0x5')]=_0x2c5a66[_0xb09f('0x5')]||'';this['token']=_0x2c5a66['token']||'';this[_0xb09f('0x6')]=_0x2c5a66['tokenSecret']||'';this['type']=_0x2c5a66['type']||'';this[_0xb09f('0x7')]=_0x2c5a66[_0xb09f('0x7')]||'';this[_0xb09f('0x8')]=_0x2c5a66[_0xb09f('0x8')]||{};}module[_0xb09f('0x9')]=DeskAccount; \ No newline at end of file +var _0x300f=['consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType','consumerKey'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0x300f,0x103));var _0xf300=function(_0x2740af,_0x58af9d){_0x2740af=_0x2740af-0x0;var _0x58c9ce=_0x300f[_0x2740af];return _0x58c9ce;};'use strict';function DeskAccount(_0x1c7816){this['id']=_0x1c7816['id']||0x0;this[_0xf300('0x0')]=_0x1c7816[_0xf300('0x0')]||'';this[_0xf300('0x1')]=_0x1c7816[_0xf300('0x1')]||'';this['remoteUri']=_0x1c7816[_0xf300('0x2')]||'';this['authType']=_0x1c7816[_0xf300('0x3')]||'';this['password']=_0x1c7816['password']||'';this[_0xf300('0x4')]=_0x1c7816[_0xf300('0x4')]||'';this[_0xf300('0x5')]=_0x1c7816[_0xf300('0x5')]||'';this[_0xf300('0x6')]=_0x1c7816['token']||'';this[_0xf300('0x7')]=_0x1c7816[_0xf300('0x7')]||'';this['type']=_0x1c7816['type']||'';this[_0xf300('0x8')]=_0x1c7816[_0xf300('0x8')]||'';this[_0xf300('0x9')]=_0x1c7816[_0xf300('0x9')]||{};}module[_0xf300('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 cab2042..41cd26b 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 _0x86d8=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0x86d8,0x124));var _0x886d=function(_0x2de64f,_0x4f0c25){_0x2de64f=_0x2de64f-0x0;var _0x19eb47=_0x86d8[_0x2de64f];return _0x19eb47;};'use strict';function Dynamics365Account(_0x3827b2){this['id']=_0x3827b2['id']||0x0;this[_0x886d('0x0')]=_0x3827b2[_0x886d('0x0')]||'';this[_0x886d('0x1')]=_0x3827b2[_0x886d('0x1')]||'';this['password']=_0x3827b2[_0x886d('0x2')]||'';this[_0x886d('0x3')]=_0x3827b2[_0x886d('0x3')]||'';this[_0x886d('0x4')]=_0x3827b2[_0x886d('0x4')]||'';this['clientId']=_0x3827b2[_0x886d('0x5')]||'';this[_0x886d('0x6')]=_0x3827b2[_0x886d('0x6')]||{};this[_0x886d('0x7')]=_0x3827b2[_0x886d('0x7')]||'';this[_0x886d('0x8')]=_0x3827b2[_0x886d('0x8')]||![];this['Configurations']=_0x3827b2[_0x886d('0x9')]||{};this['CloudProvider']=_0x3827b2[_0x886d('0xa')]||{};}module[_0x886d('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xa15a=['clientSecret','serverUrl','modernAuthentication','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x1d49f3,_0x40c152){var _0x583d8b=function(_0x1c8e4c){while(--_0x1c8e4c){_0x1d49f3['push'](_0x1d49f3['shift']());}};_0x583d8b(++_0x40c152);}(_0xa15a,0x123));var _0xaa15=function(_0x540990,_0x31445d){_0x540990=_0x540990-0x0;var _0x12fb9f=_0xa15a[_0x540990];return _0x12fb9f;};'use strict';function Dynamics365Account(_0x4aa3d9){this['id']=_0x4aa3d9['id']||0x0;this[_0xaa15('0x0')]=_0x4aa3d9[_0xaa15('0x0')]||'';this[_0xaa15('0x1')]=_0x4aa3d9[_0xaa15('0x1')]||'';this[_0xaa15('0x2')]=_0x4aa3d9['password']||'';this[_0xaa15('0x3')]=_0x4aa3d9[_0xaa15('0x3')]||'';this[_0xaa15('0x4')]=_0x4aa3d9['tenantId']||'';this[_0xaa15('0x5')]=_0x4aa3d9[_0xaa15('0x5')]||'';this['clientSecret']=_0x4aa3d9[_0xaa15('0x6')]||{};this[_0xaa15('0x7')]=_0x4aa3d9['serverUrl']||'';this[_0xaa15('0x8')]=_0x4aa3d9[_0xaa15('0x8')]||![];this['Configurations']=_0x4aa3d9['Configurations']||{};this['CloudProvider']=_0x4aa3d9[_0xaa15('0x9')]||{};}module[_0xaa15('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2f14faf..1f45689 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 _0x521e=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0x521e,0x1b3));var _0xe521=function(_0x1b844e,_0x4d87e6){_0x1b844e=_0x1b844e-0x0;var _0x432144=_0x521e[_0x1b844e];return _0x432144;};'use strict';function FaxAccount(_0x266c6f){this['id']=_0x266c6f['id']||0x0;this[_0xe521('0x0')]=_0x266c6f['name']||'';this[_0xe521('0x1')]=_0x266c6f['description'];this[_0xe521('0x2')]=_0x266c6f[_0xe521('0x2')];this['headerinfo']=_0x266c6f[_0xe521('0x3')];this['localstationid']=_0x266c6f[_0xe521('0x4')];this[_0xe521('0x5')]=_0x266c6f[_0xe521('0x5')]||0x960;this[_0xe521('0x6')]=_0x266c6f[_0xe521('0x6')]||0x3840;this['modem']=_0x266c6f[_0xe521('0x7')]||_0xe521('0x8');this[_0xe521('0x9')]=_0x266c6f[_0xe521('0x9')]||'no';this['faxdetect']=_0x266c6f[_0xe521('0xa')]||'no';this[_0xe521('0xb')]=_0x266c6f[_0xe521('0xb')]||0x1388;this[_0xe521('0xc')]=_0x266c6f[_0xe521('0xc')]||_0xe521('0xd');this[_0xe521('0xe')]=_0x266c6f[_0xe521('0xe')]?_0x266c6f[_0xe521('0xe')]:undefined;this[_0xe521('0xf')]=_0x266c6f['ListId'];this[_0xe521('0x10')]=_0x266c6f[_0xe521('0x10')];}module[_0xe521('0x11')]=FaxAccount; \ No newline at end of file +var _0xb391=['tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x1f03ad,_0xf4a230){var _0x1db925=function(_0x256e8a){while(--_0x256e8a){_0x1f03ad['push'](_0x1f03ad['shift']());}};_0x1db925(++_0xf4a230);}(_0xb391,0x137));var _0x1b39=function(_0x416d60,_0x56dde9){_0x416d60=_0x416d60-0x0;var _0x286bd7=_0xb391[_0x416d60];return _0x286bd7;};'use strict';function FaxAccount(_0x3672d6){this['id']=_0x3672d6['id']||0x0;this[_0x1b39('0x0')]=_0x3672d6['name']||'';this[_0x1b39('0x1')]=_0x3672d6[_0x1b39('0x1')];this[_0x1b39('0x2')]=_0x3672d6['ecm'];this[_0x1b39('0x3')]=_0x3672d6[_0x1b39('0x3')];this[_0x1b39('0x4')]=_0x3672d6[_0x1b39('0x4')];this[_0x1b39('0x5')]=_0x3672d6[_0x1b39('0x5')]||0x960;this[_0x1b39('0x6')]=_0x3672d6['maxrate']||0x3840;this[_0x1b39('0x7')]=_0x3672d6[_0x1b39('0x7')]||_0x1b39('0x8');this[_0x1b39('0x9')]=_0x3672d6[_0x1b39('0x9')]||'no';this['faxdetect']=_0x3672d6[_0x1b39('0xa')]||'no';this[_0x1b39('0xb')]=_0x3672d6[_0x1b39('0xb')]||0x1388;this['tech']=_0x3672d6[_0x1b39('0xc')]||'SIP';this[_0x1b39('0xd')]=_0x3672d6[_0x1b39('0xd')]?_0x3672d6[_0x1b39('0xd')]:undefined;this[_0x1b39('0xe')]=_0x3672d6['ListId'];this[_0x1b39('0xf')]=_0x3672d6[_0x1b39('0xf')];}module[_0x1b39('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 899e95e..aa8ce1e 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 _0x02f2=['exports','name','username','apiKey','token','remoteUri','Configurations'];(function(_0x169c09,_0x58cefe){var _0x245f3b=function(_0xbe24b7){while(--_0xbe24b7){_0x169c09['push'](_0x169c09['shift']());}};_0x245f3b(++_0x58cefe);}(_0x02f2,0x15f));var _0x202f=function(_0x14060f,_0x36c43e){_0x14060f=_0x14060f-0x0;var _0x104c4c=_0x02f2[_0x14060f];return _0x104c4c;};'use strict';function FreshdeskAccount(_0x5daa02){this['id']=_0x5daa02['id']||0x0;this[_0x202f('0x0')]=_0x5daa02[_0x202f('0x0')]||'';this[_0x202f('0x1')]=_0x5daa02[_0x202f('0x1')]||'';this[_0x202f('0x2')]=_0x5daa02[_0x202f('0x3')]||'';this[_0x202f('0x4')]=_0x5daa02[_0x202f('0x4')]||'';this['serverUrl']=_0x5daa02['serverUrl']||'';this['Configurations']=_0x5daa02[_0x202f('0x5')]||{};}module[_0x202f('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xa18c=['Configurations','name','username','apiKey','token','serverUrl'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa18c,0x1d5));var _0xca18=function(_0x106f84,_0x4ffb33){_0x106f84=_0x106f84-0x0;var _0x4e0238=_0xa18c[_0x106f84];return _0x4e0238;};'use strict';function FreshdeskAccount(_0x3b393f){this['id']=_0x3b393f['id']||0x0;this[_0xca18('0x0')]=_0x3b393f['name']||'';this[_0xca18('0x1')]=_0x3b393f[_0xca18('0x1')]||'';this[_0xca18('0x2')]=_0x3b393f[_0xca18('0x3')]||'';this['remoteUri']=_0x3b393f['remoteUri']||'';this['serverUrl']=_0x3b393f[_0xca18('0x4')]||'';this[_0xca18('0x5')]=_0x3b393f['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 269755c..f26ad5d 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea81=['token','remoteUri','serverUrl','name','username'];(function(_0x218212,_0x188723){var _0x2e5bb1=function(_0x1e3fb8){while(--_0x1e3fb8){_0x218212['push'](_0x218212['shift']());}};_0x2e5bb1(++_0x188723);}(_0xea81,0x1ed));var _0x1ea8=function(_0x4d20e0,_0x3a6860){_0x4d20e0=_0x4d20e0-0x0;var _0xba8264=_0xea81[_0x4d20e0];return _0xba8264;};'use strict';function FreshsalesAccount(_0x202267){this['id']=_0x202267['id']||0x0;this[_0x1ea8('0x0')]=_0x202267[_0x1ea8('0x0')]||'';this[_0x1ea8('0x1')]=_0x202267['username']||'';this['apiKey']=_0x202267[_0x1ea8('0x2')]||'';this[_0x1ea8('0x3')]=_0x202267[_0x1ea8('0x3')]||'';this[_0x1ea8('0x4')]=_0x202267[_0x1ea8('0x4')]||'';this['Configurations']=_0x202267['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xbea5=['token','remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xbea5,0x177));var _0x5bea=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xbea5[_0x37c22c];return _0x119d79;};'use strict';function FreshsalesAccount(_0x518a55){this['id']=_0x518a55['id']||0x0;this[_0x5bea('0x0')]=_0x518a55['name']||'';this[_0x5bea('0x1')]=_0x518a55[_0x5bea('0x1')]||'';this[_0x5bea('0x2')]=_0x518a55[_0x5bea('0x3')]||'';this[_0x5bea('0x4')]=_0x518a55['remoteUri']||'';this['serverUrl']=_0x518a55[_0x5bea('0x5')]||'';this['Configurations']=_0x518a55[_0x5bea('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index a3909ba..ae7792a 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 _0x3393=['accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x3393,0x92));var _0x3339=function(_0x2c3e61,_0x25e5a3){_0x2c3e61=_0x2c3e61-0x0;var _0x500a7d=_0x3393[_0x2c3e61];return _0x500a7d;};'use strict';function QueueReport(){this['type']=_0x3339('0x0');this[_0x3339('0x1')]='';this[_0x3339('0x2')]='';this['calleridname']='';this['queue']='';this[_0x3339('0x3')]=null;this[_0x3339('0x4')]=null;this[_0x3339('0x5')]=0x1;this[_0x3339('0x6')]=0x1;this[_0x3339('0x7')]=![];this[_0x3339('0x8')]=null;this[_0x3339('0x9')]=![];this[_0x3339('0xa')]=null;this[_0x3339('0xb')]=![];this['queuecallerexitAt']=null;this[_0x3339('0xc')]=0x1;this[_0x3339('0xd')]='';this[_0x3339('0xe')]='';this[_0x3339('0xf')]='';this[_0x3339('0x10')]='';this[_0x3339('0x11')]='';this[_0x3339('0x12')]='';this[_0x3339('0x13')]='';this['holdtime']=0x0;this[_0x3339('0x14')]=![];this[_0x3339('0x15')]='';this[_0x3339('0x16')]=_0x3339('0x17');this[_0x3339('0x18')]=0x0;this[_0x3339('0x19')]={};}module[_0x3339('0x1a')]=QueueReport; \ No newline at end of file +var _0xab71=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','calleridnum','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete'];(function(_0x550839,_0xf664c){var _0x145c26=function(_0x254fc8){while(--_0x254fc8){_0x550839['push'](_0x550839['shift']());}};_0x145c26(++_0xf664c);}(_0xab71,0x163));var _0x1ab7=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xab71[_0x132558];return _0x34f138;};'use strict';function QueueReport(){this[_0x1ab7('0x0')]=_0x1ab7('0x1');this['uniqueid']='';this[_0x1ab7('0x2')]='';this['calleridname']='';this['queue']='';this[_0x1ab7('0x3')]=null;this['queuecallerleaveAt']=null;this[_0x1ab7('0x4')]=0x1;this[_0x1ab7('0x5')]=0x1;this[_0x1ab7('0x6')]=![];this[_0x1ab7('0x7')]=null;this[_0x1ab7('0x8')]=![];this[_0x1ab7('0x9')]=null;this[_0x1ab7('0xa')]=![];this[_0x1ab7('0xb')]=null;this[_0x1ab7('0xc')]=0x1;this[_0x1ab7('0xd')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x1ab7('0xe')]='';this[_0x1ab7('0xf')]='';this[_0x1ab7('0x10')]='';this[_0x1ab7('0x11')]='';this[_0x1ab7('0x12')]=0x0;this[_0x1ab7('0x13')]=![];this[_0x1ab7('0x14')]='';this[_0x1ab7('0x15')]=_0x1ab7('0x16');this[_0x1ab7('0x17')]=0x0;this[_0x1ab7('0x18')]={};}module[_0x1ab7('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 98b4c32..0e42ea2 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 _0x0254=['remoteUri','password','clientId','clientSecret','securityToken','type','Configurations','exports','name'];(function(_0x4f1016,_0x1116a7){var _0xdc9179=function(_0x64190c){while(--_0x64190c){_0x4f1016['push'](_0x4f1016['shift']());}};_0xdc9179(++_0x1116a7);}(_0x0254,0x1b8));var _0x4025=function(_0x2cd943,_0x13ea71){_0x2cd943=_0x2cd943-0x0;var _0x535455=_0x0254[_0x2cd943];return _0x535455;};'use strict';function SalesforceAccount(_0x2997a9){this['id']=_0x2997a9['id']||0x0;this[_0x4025('0x0')]=_0x2997a9['name']||'';this['username']=_0x2997a9['username']||'';this[_0x4025('0x1')]=_0x2997a9[_0x4025('0x1')]||'';this[_0x4025('0x2')]=_0x2997a9[_0x4025('0x2')]||'';this[_0x4025('0x3')]=_0x2997a9[_0x4025('0x3')]||'';this['clientSecret']=_0x2997a9[_0x4025('0x4')]||'';this['securityToken']=_0x2997a9[_0x4025('0x5')]||'';this[_0x4025('0x6')]=_0x2997a9['type']||'integrationTab';this['serverUrl']=_0x2997a9['serverUrl']||'';this[_0x4025('0x7')]=_0x2997a9[_0x4025('0x7')]||{};}module[_0x4025('0x8')]=SalesforceAccount; \ No newline at end of file +var _0x9676=['clientId','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password'];(function(_0x4d18c2,_0x9b85d0){var _0x1cadf9=function(_0xbb421c){while(--_0xbb421c){_0x4d18c2['push'](_0x4d18c2['shift']());}};_0x1cadf9(++_0x9b85d0);}(_0x9676,0xce));var _0x6967=function(_0x5bdccf,_0x2bbf15){_0x5bdccf=_0x5bdccf-0x0;var _0x3c4c74=_0x9676[_0x5bdccf];return _0x3c4c74;};'use strict';function SalesforceAccount(_0x3c23bd){this['id']=_0x3c23bd['id']||0x0;this[_0x6967('0x0')]=_0x3c23bd[_0x6967('0x0')]||'';this[_0x6967('0x1')]=_0x3c23bd[_0x6967('0x1')]||'';this[_0x6967('0x2')]=_0x3c23bd['remoteUri']||'';this[_0x6967('0x3')]=_0x3c23bd[_0x6967('0x3')]||'';this[_0x6967('0x4')]=_0x3c23bd[_0x6967('0x4')]||'';this['clientSecret']=_0x3c23bd['clientSecret']||'';this[_0x6967('0x5')]=_0x3c23bd[_0x6967('0x5')]||'';this[_0x6967('0x6')]=_0x3c23bd[_0x6967('0x6')]||_0x6967('0x7');this['serverUrl']=_0x3c23bd[_0x6967('0x8')]||'';this[_0x6967('0x9')]=_0x3c23bd[_0x6967('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 2c00f86..e4d831d 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 _0x0381=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x119e08,_0x1f6036){var _0x6894ca=function(_0x14f4c4){while(--_0x14f4c4){_0x119e08['push'](_0x119e08['shift']());}};_0x6894ca(++_0x1f6036);}(_0x0381,0x1a4));var _0x1038=function(_0x25f610,_0x1e4e2f){_0x25f610=_0x25f610-0x0;var _0x3c759b=_0x0381[_0x25f610];return _0x3c759b;};'use strict';function ServicenowAccount(_0x540ff9){this['id']=_0x540ff9['id']||0x0;this['name']=_0x540ff9[_0x1038('0x0')]||'';this[_0x1038('0x1')]=_0x540ff9[_0x1038('0x1')]||'';this[_0x1038('0x2')]=_0x540ff9[_0x1038('0x2')]||'';this[_0x1038('0x3')]=_0x540ff9[_0x1038('0x3')]||'';this[_0x1038('0x4')]=_0x540ff9['serverUrl']||'';this['Configurations']=_0x540ff9[_0x1038('0x5')]||{};}module[_0x1038('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x50f1=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1479cc,_0x47b7d2){var _0x47ff61=function(_0x634b3c){while(--_0x634b3c){_0x1479cc['push'](_0x1479cc['shift']());}};_0x47ff61(++_0x47b7d2);}(_0x50f1,0x147));var _0x150f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x50f1[_0x20a584];return _0x4b41a8;};'use strict';function ServicenowAccount(_0x170a3c){this['id']=_0x170a3c['id']||0x0;this[_0x150f('0x0')]=_0x170a3c[_0x150f('0x0')]||'';this['username']=_0x170a3c[_0x150f('0x1')]||'';this[_0x150f('0x2')]=_0x170a3c[_0x150f('0x2')]||'';this[_0x150f('0x3')]=_0x170a3c[_0x150f('0x3')]||'';this[_0x150f('0x4')]=_0x170a3c[_0x150f('0x4')]||'';this[_0x150f('0x5')]=_0x170a3c[_0x150f('0x5')]||{};}module[_0x150f('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 5731344..71e99f3 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 _0xe73b=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe73b,0x1cd));var _0xbe73=function(_0x40bc01,_0x22a9a9){_0x40bc01=_0x40bc01-0x0;var _0x42365b=_0xe73b[_0x40bc01];return _0x42365b;};'use strict';function SugarcrmAccount(_0x27aa90){this['id']=_0x27aa90['id']||0x0;this[_0xbe73('0x0')]=_0x27aa90[_0xbe73('0x0')]||'';this[_0xbe73('0x1')]=_0x27aa90[_0xbe73('0x1')]||'';this[_0xbe73('0x2')]=_0x27aa90['password']||'';this[_0xbe73('0x3')]=_0x27aa90[_0xbe73('0x3')]||'';this[_0xbe73('0x4')]=_0x27aa90[_0xbe73('0x4')]||'';this[_0xbe73('0x5')]=_0x27aa90[_0xbe73('0x5')]||{};}module[_0xbe73('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x42ac=['username','password','serverUrl','Configurations','exports','name'];(function(_0x1abf95,_0x260b49){var _0x4550ae=function(_0x48db67){while(--_0x48db67){_0x1abf95['push'](_0x1abf95['shift']());}};_0x4550ae(++_0x260b49);}(_0x42ac,0xa1));var _0xc42a=function(_0x54fc2b,_0x5767d4){_0x54fc2b=_0x54fc2b-0x0;var _0x4d1b04=_0x42ac[_0x54fc2b];return _0x4d1b04;};'use strict';function SugarcrmAccount(_0x2352b0){this['id']=_0x2352b0['id']||0x0;this[_0xc42a('0x0')]=_0x2352b0[_0xc42a('0x0')]||'';this[_0xc42a('0x1')]=_0x2352b0[_0xc42a('0x1')]||'';this['password']=_0x2352b0[_0xc42a('0x2')]||'';this['remoteUri']=_0x2352b0['remoteUri']||'';this[_0xc42a('0x3')]=_0x2352b0[_0xc42a('0x3')]||'';this[_0xc42a('0x4')]=_0x2352b0[_0xc42a('0x4')]||{};}module[_0xc42a('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index dbb6801..45f37be 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 _0xb01a=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x14f805,_0x29cac6){var _0xe9da30=function(_0x1eb5b9){while(--_0x1eb5b9){_0x14f805['push'](_0x14f805['shift']());}};_0xe9da30(++_0x29cac6);}(_0xb01a,0x1a1));var _0xab01=function(_0x36856f,_0x98b59e){_0x36856f=_0x36856f-0x0;var _0x43ac52=_0xb01a[_0x36856f];return _0x43ac52;};'use strict';function Telephone(_0x2cb93b){this['id']=_0x2cb93b['id']||0x0;this[_0xab01('0x0')]=_0x2cb93b[_0xab01('0x0')]||'';this[_0xab01('0x1')]=_0x2cb93b[_0xab01('0x1')]||'';this[_0xab01('0x2')]=_0xab01('0x3');this[_0xab01('0x4')]=0x0;this[_0xab01('0x5')]=_0xab01('0x3');this[_0xab01('0x6')]='';}module[_0xab01('0x7')]=Telephone; \ No newline at end of file +var _0x7b84=['address','exports','name','accountcode','state','status','unknown'];(function(_0x1af227,_0x39e8ac){var _0x3fb366=function(_0x287295){while(--_0x287295){_0x1af227['push'](_0x1af227['shift']());}};_0x3fb366(++_0x39e8ac);}(_0x7b84,0x80));var _0x47b8=function(_0x1033aa,_0x1463f0){_0x1033aa=_0x1033aa-0x0;var _0x589756=_0x7b84[_0x1033aa];return _0x589756;};'use strict';function Telephone(_0x11d873){this['id']=_0x11d873['id']||0x0;this[_0x47b8('0x0')]=_0x11d873[_0x47b8('0x0')]||'';this['accountcode']=_0x11d873[_0x47b8('0x1')]||'';this[_0x47b8('0x2')]='unknown';this['stateTime']=0x0;this[_0x47b8('0x3')]=_0x47b8('0x4');this[_0x47b8('0x5')]='';}module[_0x47b8('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 3cf118f..f70f438 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 _0xb10b=['name','html'];(function(_0x1703a0,_0x4ff6a4){var _0x1b3832=function(_0x5e6667){while(--_0x5e6667){_0x1703a0['push'](_0x1703a0['shift']());}};_0x1b3832(++_0x4ff6a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x47cd7b,_0x5630af){_0x47cd7b=_0x47cd7b-0x0;var _0x3e6dbf=_0xb10b[_0x47cd7b];return _0x3e6dbf;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x8c9c9a,_0x4020e1){var _0x326e55=function(_0x273258){while(--_0x273258){_0x8c9c9a['push'](_0x8c9c9a['shift']());}};_0x326e55(++_0x4020e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 1375cde..3b13241 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 _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5ca3d6,_0x5c7599){_0x5ca3d6=_0x5ca3d6-0x0;var _0x3a1032=_0x0b0e[_0x5ca3d6];return _0x3a1032;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file +var _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x4ef925,_0x236cb5){var _0x396b8f=function(_0x346cf2){while(--_0x346cf2){_0x4ef925['push'](_0x4ef925['shift']());}};_0x396b8f(++_0x236cb5);}(_0xda3f,0xec));var _0xfda3=function(_0x8ab76e,_0x216e80){_0x8ab76e=_0x8ab76e-0x0;var _0x5a46fd=_0xda3f[_0x8ab76e];return _0x5a46fd;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b883ce3..dcd091c 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 _0x4445=['domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4445,0x139));var _0x5444=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x4445[_0x455c6c];return _0x488242;};'use strict';function Trunk(_0x1607af){this['id']=_0x1607af['id']||0x0;this[_0x5444('0x0')]=_0x1607af['active']||![];this[_0x5444('0x1')]=_0x1607af[_0x5444('0x1')]||'';this[_0x5444('0x2')]=_0x5444('0x3');this[_0x5444('0x4')]=0x0;this[_0x5444('0x5')]=_0x5444('0x3');this[_0x5444('0x6')]=_0x1607af[_0x5444('0x6')]&&_0x1607af[_0x5444('0x6')][_0x5444('0x7')](':')?_0x1607af['registry'][_0x5444('0x8')](':')[0x0]:'';this[_0x5444('0x9')]='';this['port']='';this[_0x5444('0xa')]='';this[_0x5444('0xb')]='';this[_0x5444('0xc')]='';this[_0x5444('0xd')]='unknown';this['registrationtime']='';this[_0x5444('0xe')]='';this[_0x5444('0xf')]=_0x1607af[_0x5444('0xf')]||'';}module[_0x5444('0x10')]=Trunk; \ No newline at end of file +var _0x2600=['state','stateTime','status','unknown','registry','indexOf','split','host','port','domain','domainport','registrationtime','address','defaultuser','exports','active','name'];(function(_0xea57db,_0x2b5907){var _0x36b22e=function(_0x3d6c06){while(--_0x3d6c06){_0xea57db['push'](_0xea57db['shift']());}};_0x36b22e(++_0x2b5907);}(_0x2600,0x174));var _0x0260=function(_0x38cf85,_0x234c29){_0x38cf85=_0x38cf85-0x0;var _0x5a4c10=_0x2600[_0x38cf85];return _0x5a4c10;};'use strict';function Trunk(_0x38b0ef){this['id']=_0x38b0ef['id']||0x0;this[_0x0260('0x0')]=_0x38b0ef[_0x0260('0x0')]||![];this[_0x0260('0x1')]=_0x38b0ef[_0x0260('0x1')]||'';this[_0x0260('0x2')]='unknown';this[_0x0260('0x3')]=0x0;this[_0x0260('0x4')]=_0x0260('0x5');this['registry']=_0x38b0ef[_0x0260('0x6')]&&_0x38b0ef[_0x0260('0x6')][_0x0260('0x7')](':')?_0x38b0ef[_0x0260('0x6')][_0x0260('0x8')](':')[0x0]:'';this[_0x0260('0x9')]='';this[_0x0260('0xa')]='';this[_0x0260('0xb')]='';this[_0x0260('0xc')]='';this['refresh']='';this['stateRegistry']='unknown';this[_0x0260('0xd')]='';this[_0x0260('0xe')]='';this[_0x0260('0xf')]=_0x38b0ef[_0x0260('0xf')]||'';}module[_0x0260('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index f28a5ce..33148f6 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 _0x8f50=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8f50,0x163));var _0x08f5=function(_0x2edb2e,_0x247823){_0x2edb2e=_0x2edb2e-0x0;var _0x32e588=_0x8f50[_0x2edb2e];return _0x32e588;};'use strict';function voiceExtension(_0x1bde81){this['id']=_0x1bde81['id']||0x0;this[_0x08f5('0x0')]=_0x1bde81[_0x08f5('0x0')]||'';this[_0x08f5('0x1')]=_0x1bde81[_0x08f5('0x1')]||_0x08f5('0x2');this[_0x08f5('0x3')]=_0x1bde81['mandatoryDisposition']||![];}module[_0x08f5('0x4')]=voiceExtension; \ No newline at end of file +var _0xc564=['none','exports','exten','recordingFormat'];(function(_0x57a44c,_0x1a41e3){var _0x3fd165=function(_0x3debb9){while(--_0x3debb9){_0x57a44c['push'](_0x57a44c['shift']());}};_0x3fd165(++_0x1a41e3);}(_0xc564,0xfa));var _0x4c56=function(_0x5f1f52,_0x44abd7){_0x5f1f52=_0x5f1f52-0x0;var _0x3a3ae3=_0xc564[_0x5f1f52];return _0x3a3ae3;};'use strict';function voiceExtension(_0x4f159e){this['id']=_0x4f159e['id']||0x0;this['exten']=_0x4f159e[_0x4c56('0x0')]||'';this[_0x4c56('0x1')]=_0x4f159e['recordingFormat']||_0x4c56('0x2');this['mandatoryDisposition']=_0x4f159e['mandatoryDisposition']||![];}module[_0x4c56('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 63aee2e..fcd39b0 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 _0x1c66=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay'];(function(_0x1e278e,_0x4e4886){var _0x3ac23f=function(_0x4127ed){while(--_0x4127ed){_0x1e278e['push'](_0x1e278e['shift']());}};_0x3ac23f(++_0x4e4886);}(_0x1c66,0x174));var _0x61c6=function(_0x2524bc,_0x445198){_0x2524bc=_0x2524bc-0x0;var _0x215556=_0x1c66[_0x2524bc];return _0x215556;};'use strict';var statusDesc=['unknown','not_inuse',_0x61c6('0x0'),_0x61c6('0x1'),_0x61c6('0x2'),_0x61c6('0x3'),_0x61c6('0x4'),'ringinuse',_0x61c6('0x5')];var monitorFormat={'wav':_0x61c6('0x6'),'wav49':_0x61c6('0x7'),'gsm':_0x61c6('0x8')};var strategy={'rrmemory':_0x61c6('0x9'),'roundrobin':_0x61c6('0xa')};function VoiceQueue(_0x5eefcc){this['id']=_0x5eefcc['id']||0x0;this[_0x61c6('0xb')]=_0x5eefcc[_0x61c6('0xb')]||'';this[_0x61c6('0xc')]=_0x5eefcc[_0x61c6('0xc')]||'';this[_0x61c6('0xd')]=_0x5eefcc[_0x61c6('0xd')]||_0x61c6('0xe');this[_0x61c6('0xf')]=0x0;this[_0x61c6('0x10')]=0x0;this['total']=0x0;this[_0x61c6('0x11')]=0x0;this[_0x61c6('0x12')]=0x0;this[_0x61c6('0x13')]=0x0;this[_0x61c6('0x14')]=0x0;this[_0x61c6('0x15')]=0x0;this['abandoned']=0x0;this[_0x61c6('0x16')]=0x0;this[_0x61c6('0x17')]=0x0;this['acw']=_0x5eefcc[_0x61c6('0x18')]||![];this[_0x61c6('0x19')]=_0x5eefcc[_0x61c6('0x19')]||0xa;this[_0x61c6('0x1a')]=_0x5eefcc[_0x61c6('0x1a')]||'no';this[_0x61c6('0x1b')]=!![];this['message']='';this['originated']=0x0;this[_0x61c6('0x1c')]=0x0;this['dialTimezone']=_0x5eefcc[_0x61c6('0x1d')]||null;this[_0x61c6('0x1e')]=_0x5eefcc[_0x61c6('0x1e')]?_0x5eefcc[_0x61c6('0x1e')]:null;this[_0x61c6('0x1f')]=_0x5eefcc[_0x61c6('0x1f')];this[_0x61c6('0x20')]=_0x5eefcc[_0x61c6('0x20')]||_0x61c6('0x21');this[_0x61c6('0x22')]=_0x5eefcc[_0x61c6('0x22')]||0x0;this['dialLimitQueue']=_0x5eefcc['dialLimitQueue']||0x0;this[_0x61c6('0x23')]=_0x5eefcc[_0x61c6('0x23')]||0x1;this['dialPredictiveOptimization']=_0x5eefcc[_0x61c6('0x24')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x5eefcc['dialPredictiveOptimizationPercentage']||0.03;this[_0x61c6('0x25')]=_0x5eefcc[_0x61c6('0x25')]||0x258;this[_0x61c6('0x26')]=_0x5eefcc[_0x61c6('0x26')]||_0x61c6('0x27');this[_0x61c6('0x28')]=_0x5eefcc[_0x61c6('0x28')]||_0x61c6('0x27');this[_0x61c6('0x29')]=_0x5eefcc[_0x61c6('0x29')]||0x1e;this[_0x61c6('0x2a')]=_0x5eefcc[_0x61c6('0x2a')]||_0x61c6('0x2b');this['dialQueueTimeout']=_0x5eefcc[_0x61c6('0x2c')]||0x3;this[_0x61c6('0x2d')]=_0x5eefcc[_0x61c6('0x2d')]||undefined;this[_0x61c6('0x2e')]=_0x5eefcc[_0x61c6('0x2e')]||0x3;this[_0x61c6('0x2f')]=_0x5eefcc['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x5eefcc[_0x61c6('0x30')]||0x3;this[_0x61c6('0x31')]=_0x5eefcc[_0x61c6('0x31')]||0x96;this[_0x61c6('0x32')]=_0x5eefcc[_0x61c6('0x32')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5eefcc[_0x61c6('0x33')]||0x96;this[_0x61c6('0x34')]=_0x5eefcc['dialNoSuchNumberMaxRetry']||0x3;this[_0x61c6('0x35')]=_0x5eefcc[_0x61c6('0x35')]||0x96;this[_0x61c6('0x36')]=_0x5eefcc['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x5eefcc[_0x61c6('0x37')]||0x96;this[_0x61c6('0x38')]=_0x5eefcc[_0x61c6('0x38')]||0x3;this[_0x61c6('0x39')]=_0x5eefcc['dialAbandonedRetryFrequency']||0x96;this[_0x61c6('0x3a')]=_0x5eefcc[_0x61c6('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x5eefcc['dialMachineRetryFrequency']||0x96;this[_0x61c6('0x3b')]=_0x5eefcc[_0x61c6('0x3b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5eefcc[_0x61c6('0x3c')]||0x96;this[_0x61c6('0x3d')]=_0x5eefcc['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x5eefcc['dialGlobalMaxRetry']||0x4;this[_0x61c6('0x3e')]=_0x5eefcc[_0x61c6('0x3e')]?_0x5eefcc[_0x61c6('0x3e')]:undefined;this[_0x61c6('0x3f')]=_0x5eefcc[_0x61c6('0x3f')]?_0x5eefcc[_0x61c6('0x3f')]:undefined;this[_0x61c6('0x40')]=_0x5eefcc[_0x61c6('0x40')]||undefined;this[_0x61c6('0x41')]=_0x5eefcc['Interval']?_0x5eefcc[_0x61c6('0x41')]:undefined;this[_0x61c6('0x42')]=_0x5eefcc[_0x61c6('0x42')]||_0x61c6('0x43');this[_0x61c6('0x44')]=_0x5eefcc[_0x61c6('0x44')]||undefined;this[_0x61c6('0x45')]=_0x5eefcc[_0x61c6('0x45')]||undefined;this[_0x61c6('0x46')]=strategy[_0x5eefcc['strategy']]||_0x61c6('0x9');this[_0x61c6('0x47')]=!![];this['dialAMDActive']=_0x5eefcc[_0x61c6('0x48')]||![];this[_0x61c6('0x49')]=_0x5eefcc[_0x61c6('0x49')];this[_0x61c6('0x4a')]=_0x5eefcc[_0x61c6('0x4a')];this[_0x61c6('0x4b')]=_0x5eefcc[_0x61c6('0x4b')];this[_0x61c6('0x4c')]=_0x5eefcc[_0x61c6('0x4c')];this[_0x61c6('0x4d')]=_0x5eefcc['dialAMDMinWordLength'];this[_0x61c6('0x4e')]=_0x5eefcc[_0x61c6('0x4e')];this[_0x61c6('0x4f')]=_0x5eefcc[_0x61c6('0x4f')];this[_0x61c6('0x50')]=_0x5eefcc['dialAMDSilenceThreshold'];this[_0x61c6('0x51')]=_0x5eefcc[_0x61c6('0x51')];this[_0x61c6('0x52')]=0x0;this[_0x61c6('0x53')]=0x0;this[_0x61c6('0x54')]=_0x5eefcc[_0x61c6('0x54')];this[_0x61c6('0x55')]=0x0;this[_0x61c6('0x56')]=0x0;this[_0x61c6('0x57')]=0x0;this[_0x61c6('0x58')]=0x0;this[_0x61c6('0x59')]=0x0;this[_0x61c6('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x61c6('0x5b')]=0x0;this[_0x61c6('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x61c6('0x5d')]=0x0;this[_0x61c6('0x5e')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x61c6('0x5f')]=undefined;this['handlePredictive']=undefined;this[_0x61c6('0x60')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x61c6('0x61')]=0x0;this[_0x61c6('0x62')]=0x0;this[_0x61c6('0x63')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x61c6('0x64')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x61c6('0x65')]=0x0;this[_0x61c6('0x66')]=_0x5eefcc[_0x61c6('0x67')]||0x14;this[_0x61c6('0x68')]=_0x5eefcc[_0x61c6('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x61c6('0x69')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0x61c6('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x61c6('0x6b')]=0x0;this[_0x61c6('0x6c')]=_0x5eefcc[_0x61c6('0x6c')]||0x1e;this['dialRecallInQueue']=_0x5eefcc['dialRecallInQueue']||![];this[_0x61c6('0x6d')]=!!_0x5eefcc[_0x61c6('0x6d')]||![];this[_0x61c6('0x6e')]=!!_0x5eefcc[_0x61c6('0x6e')]||![];this['dialQueueProject2']=_0x5eefcc['dialQueueProject2']||undefined;this[_0x61c6('0x6f')]=_0x5eefcc['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x5eefcc['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x5eefcc[_0x61c6('0xc')]]?monitorFormat[_0x5eefcc[_0x61c6('0xc')]]:undefined;this[_0x61c6('0x70')]=_0x5eefcc['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x5eefcc[_0x61c6('0x71')]?_0x5eefcc[_0x61c6('0x71')]:undefined;}module[_0x61c6('0x72')]=VoiceQueue; \ No newline at end of file +var _0xeb36=['ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','unknown','not_inuse','busy','unavailable'];(function(_0x15b512,_0x1e3e8c){var _0x21c513=function(_0x1903f7){while(--_0x1903f7){_0x15b512['push'](_0x15b512['shift']());}};_0x21c513(++_0x1e3e8c);}(_0xeb36,0x1cc));var _0x6eb3=function(_0x3f4a26,_0x1cad6c){_0x3f4a26=_0x3f4a26-0x0;var _0x113314=_0xeb36[_0x3f4a26];return _0x113314;};'use strict';var statusDesc=[_0x6eb3('0x0'),_0x6eb3('0x1'),'inuse',_0x6eb3('0x2'),'invalid',_0x6eb3('0x3'),_0x6eb3('0x4'),_0x6eb3('0x5'),_0x6eb3('0x6')];var monitorFormat={'wav':_0x6eb3('0x7'),'wav49':_0x6eb3('0x8'),'gsm':_0x6eb3('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x6eb3('0xa')};function VoiceQueue(_0x5ce8fd){this['id']=_0x5ce8fd['id']||0x0;this[_0x6eb3('0xb')]=_0x5ce8fd[_0x6eb3('0xb')]||'';this[_0x6eb3('0xc')]=_0x5ce8fd['monitor_format']||'';this['type']=_0x5ce8fd[_0x6eb3('0xd')]||_0x6eb3('0xe');this['waiting']=0x0;this[_0x6eb3('0xf')]=0x0;this[_0x6eb3('0x10')]=0x0;this[_0x6eb3('0x11')]=0x0;this[_0x6eb3('0x12')]=0x0;this[_0x6eb3('0x13')]=0x0;this[_0x6eb3('0x14')]=0x0;this[_0x6eb3('0x15')]=0x0;this[_0x6eb3('0x16')]=0x0;this[_0x6eb3('0x17')]=0x0;this[_0x6eb3('0x18')]=0x0;this['acw']=_0x5ce8fd['acw']||![];this[_0x6eb3('0x19')]=_0x5ce8fd[_0x6eb3('0x19')]||0xa;this[_0x6eb3('0x1a')]=_0x5ce8fd['autopause']||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x6eb3('0x1b')]=0x0;this[_0x6eb3('0x1c')]=0x0;this[_0x6eb3('0x1d')]=_0x5ce8fd[_0x6eb3('0x1d')]||null;this[_0x6eb3('0x1e')]=_0x5ce8fd['dialGlobalInterval']?_0x5ce8fd[_0x6eb3('0x1e')]:null;this[_0x6eb3('0x1f')]=_0x5ce8fd[_0x6eb3('0x1f')];this[_0x6eb3('0x20')]=_0x5ce8fd[_0x6eb3('0x20')]||_0x6eb3('0x21');this[_0x6eb3('0x22')]=_0x5ce8fd[_0x6eb3('0x22')]||0x0;this[_0x6eb3('0x23')]=_0x5ce8fd[_0x6eb3('0x23')]||0x0;this[_0x6eb3('0x24')]=_0x5ce8fd['dialPowerLevel']||0x1;this[_0x6eb3('0x25')]=_0x5ce8fd[_0x6eb3('0x25')]||_0x6eb3('0x26');this[_0x6eb3('0x27')]=_0x5ce8fd[_0x6eb3('0x27')]||0.03;this[_0x6eb3('0x28')]=_0x5ce8fd[_0x6eb3('0x28')]||0x258;this[_0x6eb3('0x29')]=_0x5ce8fd[_0x6eb3('0x29')]||_0x6eb3('0x2a');this[_0x6eb3('0x2b')]=_0x5ce8fd[_0x6eb3('0x2b')]||_0x6eb3('0x2a');this[_0x6eb3('0x2c')]=_0x5ce8fd[_0x6eb3('0x2c')]||0x1e;this['dialQueueOptions']=_0x5ce8fd[_0x6eb3('0x2d')]||'tTxX';this[_0x6eb3('0x2e')]=_0x5ce8fd[_0x6eb3('0x2e')]||0x3;this[_0x6eb3('0x2f')]=_0x5ce8fd[_0x6eb3('0x2f')]||undefined;this[_0x6eb3('0x30')]=_0x5ce8fd[_0x6eb3('0x30')]||0x3;this[_0x6eb3('0x31')]=_0x5ce8fd[_0x6eb3('0x31')]||0x96;this['dialBusyMaxRetry']=_0x5ce8fd[_0x6eb3('0x32')]||0x3;this[_0x6eb3('0x33')]=_0x5ce8fd[_0x6eb3('0x33')]||0x96;this[_0x6eb3('0x34')]=_0x5ce8fd[_0x6eb3('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5ce8fd['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x5ce8fd['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5ce8fd[_0x6eb3('0x35')]||0x96;this['dialDropMaxRetry']=_0x5ce8fd[_0x6eb3('0x36')]||0x3;this['dialDropRetryFrequency']=_0x5ce8fd[_0x6eb3('0x37')]||0x96;this[_0x6eb3('0x38')]=_0x5ce8fd[_0x6eb3('0x38')]||0x3;this[_0x6eb3('0x39')]=_0x5ce8fd[_0x6eb3('0x39')]||0x96;this[_0x6eb3('0x3a')]=_0x5ce8fd[_0x6eb3('0x3a')]||0x3;this[_0x6eb3('0x3b')]=_0x5ce8fd[_0x6eb3('0x3b')]||0x96;this[_0x6eb3('0x3c')]=_0x5ce8fd[_0x6eb3('0x3c')]||0x3;this[_0x6eb3('0x3d')]=_0x5ce8fd[_0x6eb3('0x3d')]||0x96;this['callAdditionalPhoneAfterMin']=_0x5ce8fd[_0x6eb3('0x3e')]||0x3;this[_0x6eb3('0x3f')]=_0x5ce8fd[_0x6eb3('0x3f')]||0x4;this[_0x6eb3('0x40')]=_0x5ce8fd[_0x6eb3('0x40')]?_0x5ce8fd[_0x6eb3('0x40')]:undefined;this[_0x6eb3('0x41')]=_0x5ce8fd[_0x6eb3('0x41')]?_0x5ce8fd[_0x6eb3('0x41')]:undefined;this[_0x6eb3('0x42')]=_0x5ce8fd[_0x6eb3('0x42')]||undefined;this[_0x6eb3('0x43')]=_0x5ce8fd[_0x6eb3('0x43')]?_0x5ce8fd['Interval']:undefined;this[_0x6eb3('0x44')]=_0x5ce8fd[_0x6eb3('0x44')]||'DESC';this[_0x6eb3('0x45')]=_0x5ce8fd[_0x6eb3('0x45')]||undefined;this[_0x6eb3('0x46')]=_0x5ce8fd[_0x6eb3('0x46')]||undefined;this[_0x6eb3('0x47')]=strategy[_0x5ce8fd[_0x6eb3('0x47')]]||'rrmemory';this[_0x6eb3('0x48')]=!![];this['dialAMDActive']=_0x5ce8fd[_0x6eb3('0x49')]||![];this[_0x6eb3('0x4a')]=_0x5ce8fd['dialAMDInitialSilence'];this[_0x6eb3('0x4b')]=_0x5ce8fd[_0x6eb3('0x4b')];this['dialAMDAfterGreetingSilence']=_0x5ce8fd[_0x6eb3('0x4c')];this['dialAMDTotalAnalysisTime']=_0x5ce8fd[_0x6eb3('0x4d')];this['dialAMDMinWordLength']=_0x5ce8fd[_0x6eb3('0x4e')];this['dialAMDBetweenWordsSilence']=_0x5ce8fd[_0x6eb3('0x4f')];this[_0x6eb3('0x50')]=_0x5ce8fd[_0x6eb3('0x50')];this['dialAMDSilenceThreshold']=_0x5ce8fd['dialAMDSilenceThreshold'];this[_0x6eb3('0x51')]=_0x5ce8fd[_0x6eb3('0x51')];this[_0x6eb3('0x52')]=0x0;this[_0x6eb3('0x53')]=0x0;this[_0x6eb3('0x54')]=_0x5ce8fd[_0x6eb3('0x54')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x6eb3('0x55')]=0x0;this[_0x6eb3('0x56')]=0x0;this[_0x6eb3('0x57')]=0x0;this[_0x6eb3('0x58')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x6eb3('0x59')]=0x0;this[_0x6eb3('0x5a')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x6eb3('0x5b')]=0x0;this[_0x6eb3('0x5c')]=0x0;this['startProgressive']=undefined;this[_0x6eb3('0x5d')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x6eb3('0x5e')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x6eb3('0x5f')]=0x0;this[_0x6eb3('0x60')]=0x0;this[_0x6eb3('0x61')]=0x0;this[_0x6eb3('0x62')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5ce8fd[_0x6eb3('0x63')]||0x14;this[_0x6eb3('0x64')]=_0x5ce8fd[_0x6eb3('0x63')]||0xa;this[_0x6eb3('0x65')]=0x0;this[_0x6eb3('0x66')]=0x0;this[_0x6eb3('0x67')]=0x1;this[_0x6eb3('0x68')]=0x0;this[_0x6eb3('0x69')]=0x0;this[_0x6eb3('0x6a')]=0x0;this[_0x6eb3('0x6b')]=0x0;this[_0x6eb3('0x6c')]=_0x5ce8fd[_0x6eb3('0x6c')]||0x1e;this[_0x6eb3('0x6d')]=_0x5ce8fd['dialRecallInQueue']||![];this[_0x6eb3('0x6e')]=!!_0x5ce8fd['dialPreviewAutoRecallMe']||![];this[_0x6eb3('0x6f')]=!!_0x5ce8fd[_0x6eb3('0x6f')]||![];this[_0x6eb3('0x70')]=_0x5ce8fd['dialQueueProject2']||undefined;this[_0x6eb3('0x71')]=_0x5ce8fd[_0x6eb3('0x71')]||![];this['dialAgiAfterHangupAgent']=_0x5ce8fd[_0x6eb3('0x72')]||![];this[_0x6eb3('0xc')]=monitorFormat[_0x5ce8fd[_0x6eb3('0xc')]]?monitorFormat[_0x5ce8fd[_0x6eb3('0xc')]]:undefined;this['mandatoryDisposition']=_0x5ce8fd['mandatoryDisposition']||![];this[_0x6eb3('0x73')]=_0x5ce8fd[_0x6eb3('0x73')]?_0x5ce8fd[_0x6eb3('0x73')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 8d8ed7a..691ee03 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 _0x4f7c=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x108a04,_0x3ee8da){var _0x1edc76=function(_0x285315){while(--_0x285315){_0x108a04['push'](_0x108a04['shift']());}};_0x1edc76(++_0x3ee8da);}(_0x4f7c,0x72));var _0xc4f7=function(_0x91f974,_0x1afdc4){_0x91f974=_0x91f974-0x0;var _0x1730a4=_0x4f7c[_0x91f974];return _0x1730a4;};'use strict';function VtigerAccount(_0x2e7f0b){this['id']=_0x2e7f0b['id']||0x0;this['name']=_0x2e7f0b[_0xc4f7('0x0')]||'';this['username']=_0x2e7f0b[_0xc4f7('0x1')]||'';this[_0xc4f7('0x2')]=_0x2e7f0b[_0xc4f7('0x2')]||'';this[_0xc4f7('0x3')]=_0x2e7f0b[_0xc4f7('0x3')]||'';this[_0xc4f7('0x4')]=_0x2e7f0b['serverUrl']||'';this[_0xc4f7('0x5')]=_0x2e7f0b[_0xc4f7('0x5')]||{};}module[_0xc4f7('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd663=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x3462b6,_0x215c99){var _0x766bfd=function(_0x4a05d7){while(--_0x4a05d7){_0x3462b6['push'](_0x3462b6['shift']());}};_0x766bfd(++_0x215c99);}(_0xd663,0xf0));var _0x3d66=function(_0x23c962,_0x29cad2){_0x23c962=_0x23c962-0x0;var _0x4cc2ff=_0xd663[_0x23c962];return _0x4cc2ff;};'use strict';function VtigerAccount(_0x435cc2){this['id']=_0x435cc2['id']||0x0;this[_0x3d66('0x0')]=_0x435cc2[_0x3d66('0x0')]||'';this['username']=_0x435cc2[_0x3d66('0x1')]||'';this[_0x3d66('0x2')]=_0x435cc2[_0x3d66('0x2')]||'';this['remoteUri']=_0x435cc2[_0x3d66('0x3')]||'';this[_0x3d66('0x4')]=_0x435cc2[_0x3d66('0x4')]||'';this['Configurations']=_0x435cc2[_0x3d66('0x5')]||{};}module[_0x3d66('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 6d58569..e57c3e6 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 _0x8828=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x554079,_0x2862dd){var _0x3b5154=function(_0x1857a0){while(--_0x1857a0){_0x554079['push'](_0x554079['shift']());}};_0x3b5154(++_0x2862dd);}(_0x8828,0x169));var _0x8882=function(_0x3aebfc,_0x13e2d4){_0x3aebfc=_0x3aebfc-0x0;var _0x117560=_0x8828[_0x3aebfc];return _0x117560;};'use strict';function ZendeskAccount(_0xbc259f){this['id']=_0xbc259f['id']||0x0;this[_0x8882('0x0')]=_0xbc259f[_0x8882('0x0')]||'';this[_0x8882('0x1')]=_0xbc259f[_0x8882('0x1')]||'';this[_0x8882('0x2')]=_0xbc259f['password']||'';this['token']=_0xbc259f[_0x8882('0x3')]||'';this[_0x8882('0x4')]=_0xbc259f[_0x8882('0x4')]||'';this[_0x8882('0x5')]=_0xbc259f[_0x8882('0x5')]||'';this[_0x8882('0x6')]=_0xbc259f[_0x8882('0x6')]||'integrationTab';this['serverUrl']=_0xbc259f[_0x8882('0x7')]||'';this[_0x8882('0x8')]=_0xbc259f[_0x8882('0x8')]||{};}module[_0x8882('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x8b29=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x8b29,0x1ee));var _0x98b2=function(_0x4b18ed,_0x4099df){_0x4b18ed=_0x4b18ed-0x0;var _0x5e3a07=_0x8b29[_0x4b18ed];return _0x5e3a07;};'use strict';function ZendeskAccount(_0x2aeeeb){this['id']=_0x2aeeeb['id']||0x0;this[_0x98b2('0x0')]=_0x2aeeeb[_0x98b2('0x0')]||'';this['username']=_0x2aeeeb[_0x98b2('0x1')]||'';this[_0x98b2('0x2')]=_0x2aeeeb[_0x98b2('0x2')]||'';this[_0x98b2('0x3')]=_0x2aeeeb[_0x98b2('0x3')]||'';this[_0x98b2('0x4')]=_0x2aeeeb[_0x98b2('0x4')]||'';this[_0x98b2('0x5')]=_0x2aeeeb[_0x98b2('0x5')]||'';this[_0x98b2('0x6')]=_0x2aeeeb['type']||_0x98b2('0x7');this[_0x98b2('0x8')]=_0x2aeeeb[_0x98b2('0x8')]||'';this[_0x98b2('0x9')]=_0x2aeeeb[_0x98b2('0x9')]||{};}module[_0x98b2('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 9e9e32e..a82c02b 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 _0x10f9=['description','host','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name'];(function(_0xdc348c,_0xc113b5){var _0x116b93=function(_0xcfd9f){while(--_0xcfd9f){_0xdc348c['push'](_0xdc348c['shift']());}};_0x116b93(++_0xc113b5);}(_0x10f9,0x86));var _0x910f=function(_0xe04e91,_0xeaf858){_0xe04e91=_0xe04e91-0x0;var _0x2c6ab0=_0x10f9[_0xe04e91];return _0x2c6ab0;};'use strict';function ZohoAccount(_0x2896e8){this['id']=_0x2896e8['id']||0x0;this[_0x910f('0x0')]=_0x2896e8[_0x910f('0x0')]||'';this[_0x910f('0x1')]=_0x2896e8[_0x910f('0x1')]||'';this['host']=_0x2896e8[_0x910f('0x2')]||'';this['zone']=_0x2896e8['zone']||'';this[_0x910f('0x3')]=_0x2896e8[_0x910f('0x3')]||'';this['clientSecret']=_0x2896e8[_0x910f('0x4')]||'';this[_0x910f('0x5')]=_0x2896e8[_0x910f('0x5')]||'';this['code']=_0x2896e8[_0x910f('0x6')]||'';this[_0x910f('0x7')]=_0x2896e8[_0x910f('0x7')]||'';this[_0x910f('0x8')]=_0x2896e8['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xc813=['clientSecret','serverUrl','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x96c6c8,_0x2fd12e){var _0x2e5cee=function(_0x79b4d6){while(--_0x79b4d6){_0x96c6c8['push'](_0x96c6c8['shift']());}};_0x2e5cee(++_0x2fd12e);}(_0xc813,0x145));var _0x3c81=function(_0x5afeab,_0x536dcd){_0x5afeab=_0x5afeab-0x0;var _0x419cd3=_0xc813[_0x5afeab];return _0x419cd3;};'use strict';function ZohoAccount(_0x2c19ff){this['id']=_0x2c19ff['id']||0x0;this[_0x3c81('0x0')]=_0x2c19ff['name']||'';this['description']=_0x2c19ff[_0x3c81('0x1')]||'';this[_0x3c81('0x2')]=_0x2c19ff[_0x3c81('0x2')]||'';this[_0x3c81('0x3')]=_0x2c19ff[_0x3c81('0x3')]||'';this[_0x3c81('0x4')]=_0x2c19ff[_0x3c81('0x4')]||'';this[_0x3c81('0x5')]=_0x2c19ff['clientSecret']||'';this[_0x3c81('0x6')]=_0x2c19ff[_0x3c81('0x6')]||'';this['code']=_0x2c19ff['code']||'';this[_0x3c81('0x7')]=_0x2c19ff['refreshToken']||'';this[_0x3c81('0x8')]=_0x2c19ff[_0x3c81('0x8')]||{};}module[_0x3c81('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 41be4e0..0a1ff0e 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 _0x160f=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','type','campaigntype','queue','Agent','channelAgent','membername','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat'];(function(_0x21e034,_0x59fc14){var _0x1faab3=function(_0x2bd3ba){while(--_0x2bd3ba){_0x21e034['push'](_0x21e034['shift']());}};_0x1faab3(++_0x59fc14);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf160('0x0'));var _=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));function checkNameSurname(_0x2966aa,_0x5bf9e1,_0x4513f1){var _0x2fb414='';if(!_[_0xf160('0x3')](_0x5bf9e1)&&_0xf160('0x4')===typeof _0x5bf9e1){_0x2fb414+=_0x5bf9e1;}if(!_[_0xf160('0x3')](_0x4513f1)&&_0xf160('0x4')===typeof _0x4513f1){_0x2fb414+='\x20'+_0x4513f1;}if(_0x2fb414!==''){return _0x2fb414;}return _0x2966aa;}function Action(_0x4a6f3d,_0x311d63,_0x11902f,_0x49fe49,_0x59440e){this[_0xf160('0x5')]=_0x11902f||undefined;this['idContact']=_0x4a6f3d['id'];this['queue']=_0x311d63['name'];this[_0xf160('0x6')]=_0x311d63[_0xf160('0x6')];this[_0xf160('0x7')]=_0xf160('0x8');this['dialAnswer']=![];this['membername']=_[_0xf160('0x3')](_0x4a6f3d[_0xf160('0x9')])?undefined:_0x4a6f3d[_0xf160('0x9')]['name'];this[_0xf160('0xa')]=this[_0xf160('0xb')]?util[_0xf160('0xc')](_0xf160('0xd'),this[_0xf160('0xb')]):_0x49fe49||undefined;this['calleridname']=checkNameSurname(_0x4a6f3d[_0xf160('0xe')]['phone'],_0x4a6f3d[_0xf160('0xe')][_0xf160('0xf')],_0x4a6f3d[_0xf160('0xe')][_0xf160('0x10')]);this[_0xf160('0x11')]=_0x4a6f3d[_0xf160('0x11')]||![];this[_0xf160('0x12')]=_0x4a6f3d[_0xf160('0x13')];this[_0xf160('0x14')]=_0x4a6f3d['scheduledat'];this[_0xf160('0x15')]=_0x4a6f3d[_0xf160('0x15')]||0x0;this[_0xf160('0x16')]=_0x4a6f3d[_0xf160('0x16')]||0x0;this['countnoanswerretry']=_0x4a6f3d[_0xf160('0x17')]||0x0;this['countglobal']=(_0x4a6f3d[_0xf160('0x15')]||0x0)+(_0x4a6f3d[_0xf160('0x16')]||0x0)+(_0x4a6f3d[_0xf160('0x17')]||0x0)+(_0x4a6f3d[_0xf160('0x18')]||0x0)+(_0x4a6f3d[_0xf160('0x19')]||0x0)+(_0x4a6f3d[_0xf160('0x1a')]||0x0)+(_0x4a6f3d[_0xf160('0x1b')]||0x0)+(_0x4a6f3d[_0xf160('0x1c')]||0x0);this[_0xf160('0x18')]=_0x4a6f3d['countnosuchnumberretry']||0x0;this[_0xf160('0x19')]=_0x4a6f3d[_0xf160('0x19')]||0x0;this[_0xf160('0x1a')]=_0x4a6f3d['countabandonedretry']||0x0;this[_0xf160('0x1b')]=_0x4a6f3d[_0xf160('0x1b')]||0x0;this[_0xf160('0x1c')]=_0x4a6f3d[_0xf160('0x1c')]||0x0;this[_0xf160('0x1d')]=_0x4a6f3d[_0xf160('0x1d')];this[_0xf160('0x1e')]=_0x4a6f3d['callbackuniqueid'];this[_0xf160('0x1f')]=_0x4a6f3d[_0xf160('0x1f')];this[_0xf160('0x20')]=_0x4a6f3d[_0xf160('0x20')];this['ContactId']=_0x4a6f3d[_0xf160('0x21')];this[_0xf160('0x22')]=_0x4a6f3d['ListId'];this['UserId']=_[_0xf160('0x3')](_0x4a6f3d[_0xf160('0x9')])?_0x4a6f3d[_0xf160('0x23')]:_0x4a6f3d['Agent']['id'];this[_0xf160('0x24')]=_0x4a6f3d[_0xf160('0x24')];this[_0xf160('0x25')]='';this[_0xf160('0x26')]='';}Action[_0xf160('0x27')][_0xf160('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0xf160('0x29')]);};module[_0xf160('0x2a')]=Action; \ No newline at end of file +var _0xfb11=['originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xfb11[_0x13e741];return _0x3f8bb3;};'use strict';var util=require(_0x1fb1('0x0'));var _=require('lodash');var moment=require(_0x1fb1('0x1'));function checkNameSurname(_0x34e2d6,_0x51c055,_0x1461ad){var _0x5af9cc='';if(!_[_0x1fb1('0x2')](_0x51c055)&&'string'===typeof _0x51c055){_0x5af9cc+=_0x51c055;}if(!_[_0x1fb1('0x2')](_0x1461ad)&&_0x1fb1('0x3')===typeof _0x1461ad){_0x5af9cc+='\x20'+_0x1461ad;}if(_0x5af9cc!==''){return _0x5af9cc;}return _0x34e2d6;}function Action(_0x5af469,_0x25d44f,_0x133727,_0x4c098d,_0x1859da){this[_0x1fb1('0x4')]=_0x133727||undefined;this[_0x1fb1('0x5')]=_0x5af469['id'];this[_0x1fb1('0x6')]=_0x25d44f[_0x1fb1('0x7')];this[_0x1fb1('0x8')]=_0x25d44f[_0x1fb1('0x8')];this[_0x1fb1('0x9')]=_0x1fb1('0x6');this[_0x1fb1('0xa')]=![];this['membername']=_[_0x1fb1('0x2')](_0x5af469['Agent'])?undefined:_0x5af469[_0x1fb1('0xb')]['name'];this[_0x1fb1('0xc')]=this[_0x1fb1('0xd')]?util[_0x1fb1('0xe')](_0x1fb1('0xf'),this[_0x1fb1('0xd')]):_0x4c098d||undefined;this[_0x1fb1('0x10')]=checkNameSurname(_0x5af469['Contact'][_0x1fb1('0x11')],_0x5af469[_0x1fb1('0x12')][_0x1fb1('0x13')],_0x5af469[_0x1fb1('0x12')][_0x1fb1('0x14')]);this[_0x1fb1('0x15')]=_0x5af469[_0x1fb1('0x15')]||![];this[_0x1fb1('0x16')]=_0x5af469[_0x1fb1('0x11')];this['scheduledat']=_0x5af469['scheduledat'];this[_0x1fb1('0x17')]=_0x5af469[_0x1fb1('0x17')]||0x0;this[_0x1fb1('0x18')]=_0x5af469['countcongestionretry']||0x0;this[_0x1fb1('0x19')]=_0x5af469[_0x1fb1('0x19')]||0x0;this[_0x1fb1('0x1a')]=(_0x5af469[_0x1fb1('0x17')]||0x0)+(_0x5af469[_0x1fb1('0x18')]||0x0)+(_0x5af469[_0x1fb1('0x19')]||0x0)+(_0x5af469[_0x1fb1('0x1b')]||0x0)+(_0x5af469[_0x1fb1('0x1c')]||0x0)+(_0x5af469[_0x1fb1('0x1d')]||0x0)+(_0x5af469['countmachineretry']||0x0)+(_0x5af469[_0x1fb1('0x1e')]||0x0);this['countnosuchnumberretry']=_0x5af469['countnosuchnumberretry']||0x0;this[_0x1fb1('0x1c')]=_0x5af469[_0x1fb1('0x1c')]||0x0;this[_0x1fb1('0x1d')]=_0x5af469['countabandonedretry']||0x0;this[_0x1fb1('0x1f')]=_0x5af469['countmachineretry']||0x0;this['countagentrejectretry']=_0x5af469['countagentrejectretry']||0x0;this[_0x1fb1('0x20')]=_0x5af469[_0x1fb1('0x20')];this[_0x1fb1('0x21')]=_0x5af469[_0x1fb1('0x21')];this[_0x1fb1('0x22')]=_0x5af469['callbackat'];this[_0x1fb1('0x23')]=_0x5af469[_0x1fb1('0x23')];this[_0x1fb1('0x24')]=_0x5af469[_0x1fb1('0x24')];this[_0x1fb1('0x25')]=_0x5af469[_0x1fb1('0x25')];this[_0x1fb1('0x26')]=_[_0x1fb1('0x2')](_0x5af469['Agent'])?_0x5af469[_0x1fb1('0x26')]:_0x5af469[_0x1fb1('0xb')]['id'];this[_0x1fb1('0x27')]=_0x5af469[_0x1fb1('0x27')];this[_0x1fb1('0x28')]='';this[_0x1fb1('0x29')]='';}Action[_0x1fb1('0x2a')][_0x1fb1('0x2b')]=function(){return util[_0x1fb1('0xe')](_0x1fb1('0x2c'),this[_0x1fb1('0x10')],this[_0x1fb1('0x2d')]);};module[_0x1fb1('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 3200639..60d94b6 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 _0xb96d=['custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','total','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','uniqueid','linkedid','BUSY','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','dialBusyMaxRetry','unlockAgent','incrementPreviewCounters','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','swapAdditionalPhones','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countabandonedretry','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','Calling','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','disableContact','getContactPreview','recallme','checkIsBlackList','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','Is\x20Valid','trim','dialCutDigit','SIP/%s/%s%s','substring','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','originatecalleridnum','addVariables','toLowerVariables','starttime','variables','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','response','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','dialstatus','addVariable','keys','variable','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','socket.io-emitter','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','loopCampaigns','type','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','md5','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','DEACTIVATED','\x20is\x20deactivated','prototype','syncCampaigns','hasOwnProperty','outbound','clearZombieChannels','preview','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','sequence','isNil','info','Queue','queue','originated','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','actioncountonusuch','idContact','ANSWER','responsetime','answertime','dialAnswer','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw'];(function(_0xa69592,_0x571583){var _0x4c5ec5=function(_0x4c7050){while(--_0x4c7050){_0xa69592['push'](_0xa69592['shift']());}};_0x4c5ec5(++_0x571583);}(_0xb96d,0x9e));var _0xdb96=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb96d[_0x618414];return _0x21c19a;};'use strict';var util=require('util');var _=require(_0xdb96('0x0'));var uuid=require(_0xdb96('0x1'));var moment=require(_0xdb96('0x2'));var md5=require('md5');var Redis=require(_0xdb96('0x3'));var config=require(_0xdb96('0x4'));var logger=require(_0xdb96('0x5'))('preview');var loggerAction=require('../../../config/logger')(_0xdb96('0x6'));var ami=require(_0xdb96('0x7'));var rpcDb=require(_0xdb96('0x8'));var cmHopperAdditionalPhone=require(_0xdb96('0x9'));var Action=require('./action');var ut=require(_0xdb96('0xa'));config[_0xdb96('0xb')]=_['defaults'](config[_0xdb96('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xdb96('0xc'))(new Redis(config[_0xdb96('0xb')]));var Sequence=function(){};Sequence['prototype'][_0xdb96('0xd')]=function(_0x446431){this['tail']=this[_0xdb96('0xe')]?this[_0xdb96('0xe')][_0xdb96('0xf')](_0x446431):_0x446431();};function Preview(_0x1d4c0c){this['sequence']=new Sequence();this[_0xdb96('0x10')]=_0x1d4c0c[_0xdb96('0x11')];this[_0xdb96('0x12')]=_0x1d4c0c['trunks'];this[_0xdb96('0x13')]={};this[_0xdb96('0x14')]=_0x1d4c0c[_0xdb96('0x14')];this[_0xdb96('0x15')]=0x0;ami['on'](_0xdb96('0x16'),this[_0xdb96('0x17')][_0xdb96('0x18')](this));ami['on'](_0xdb96('0x19'),this[_0xdb96('0x1a')][_0xdb96('0x18')](this));ami['on'](_0xdb96('0x1b'),this[_0xdb96('0x1c')][_0xdb96('0x18')](this));ami['on']('dialend',this[_0xdb96('0x1d')][_0xdb96('0x18')](this));ami['on'](_0xdb96('0x1e'),this[_0xdb96('0x1f')]['bind'](this));ami['on'](_0xdb96('0x20'),this[_0xdb96('0x21')][_0xdb96('0x18')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xdb96('0x18')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xdb96('0x18')](this));this[_0xdb96('0x22')](this[_0xdb96('0x10')]);}function emit(_0x11b7bd,_0x518a91,_0x6c3170){io['to'](_0x11b7bd)['emit'](_0x518a91,_0x6c3170);}function emitCampaignPreview(_0x22b3aa){if(_0x22b3aa[_0xdb96('0x23')]==='outbound'){var _0x111673={'id':_0x22b3aa['id'],'name':_0x22b3aa[_0xdb96('0x24')],'strategy':_0x22b3aa[_0xdb96('0x25')],'answered':_0x22b3aa[_0xdb96('0x26')],'available':_0x22b3aa[_0xdb96('0x27')],'loggedIn':_0x22b3aa[_0xdb96('0x28')],'pTalking':_0x22b3aa[_0xdb96('0x29')],'sumBillable':_0x22b3aa['sumBillable'],'sumDuration':_0x22b3aa[_0xdb96('0x2a')],'sumHoldTime':_0x22b3aa[_0xdb96('0x2b')]||0x0,'talking':_0x22b3aa[_0xdb96('0x2c')],'total':_0x22b3aa['total'],'type':_0x22b3aa[_0xdb96('0x23')],'unmanaged':_0x22b3aa[_0xdb96('0x2d')],'abandoned':_0x22b3aa[_0xdb96('0x2e')],'waiting':_0x22b3aa[_0xdb96('0x2f')],'loggedInDb':_0x22b3aa[_0xdb96('0x30')],'dialActive':_0x22b3aa[_0xdb96('0x31')],'dialMethod':_0x22b3aa[_0xdb96('0x32')],'dialOriginateCallerIdName':_0x22b3aa[_0xdb96('0x33')],'dialOriginateCallerIdNumber':_0x22b3aa[_0xdb96('0x34')],'dialOriginateTimeout':_0x22b3aa['dialOriginateTimeout'],'dialPrefix':_0x22b3aa[_0xdb96('0x35')],'outboundAnswerAgiCallsDay':_0x22b3aa[_0xdb96('0x36')],'outboundAnswerCallsDay':_0x22b3aa['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x22b3aa[_0xdb96('0x37')],'outboundBusyCallsDay':_0x22b3aa[_0xdb96('0x38')],'outboundCongestionCallsDay':_0x22b3aa['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x22b3aa[_0xdb96('0x39')],'outboundDropCallsDayCallersExit':_0x22b3aa[_0xdb96('0x3a')],'outboundDropCallsDayTimeout':_0x22b3aa[_0xdb96('0x3b')],'outboundNoAnswerCallsDay':_0x22b3aa[_0xdb96('0x3c')],'outboundNoSuchCallsDay':_0x22b3aa[_0xdb96('0x3d')],'outboundOriginateFailureCallsDay':_0x22b3aa[_0xdb96('0x3e')],'outboundReCallsDay':_0x22b3aa[_0xdb96('0x3f')],'outboundRejectCallsDay':_0x22b3aa['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x22b3aa[_0xdb96('0x40')],'outboundAbandonedCallsDay':_0x22b3aa[_0xdb96('0x41')],'predictiveIntervalAnsweredCalls':_0x22b3aa[_0xdb96('0x42')],'predictiveIntervalAvgHoldtime':_0x22b3aa[_0xdb96('0x43')],'predictiveIntervalAvgTalktime':_0x22b3aa['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x22b3aa['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x22b3aa[_0xdb96('0x44')],'predictiveIntervalErlangCalls':_0x22b3aa[_0xdb96('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x22b3aa['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x22b3aa[_0xdb96('0x46')],'predictiveIntervalMultiplicativeFactor':_0x22b3aa['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x22b3aa['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x22b3aa['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x22b3aa['predictiveIntervalTotalCalls'],'message':_0x22b3aa[_0xdb96('0x47')],'originated':_0x22b3aa['originated'],'erlangCalls':_0x22b3aa['erlangCalls'],'erlangCallToSecond':_0x22b3aa[_0xdb96('0x48')],'erlangAbandonmentRate':_0x22b3aa[_0xdb96('0x49')],'erlangBusyFactor':_0x22b3aa[_0xdb96('0x4a')],'startPredictive':_0x22b3aa[_0xdb96('0x4b')],'startProgressive':_0x22b3aa['startProgressive']};if(_0x22b3aa[_0xdb96('0x4c')]){_0x111673[_0xdb96('0x4c')]={'id':_0x22b3aa[_0xdb96('0x4c')]['id'],'name':_0x22b3aa[_0xdb96('0x4c')][_0xdb96('0x24')],'active':_0x22b3aa['Trunk'][_0xdb96('0x4d')],'callerid':_0x22b3aa[_0xdb96('0x4c')][_0xdb96('0x4e')]};}if(_0x22b3aa[_0xdb96('0x4f')]){_0x111673[_0xdb96('0x4f')]={'id':_0x22b3aa[_0xdb96('0x4f')]['id'],'name':_0x22b3aa[_0xdb96('0x4f')]['name']};}var _0x5d3a3c=md5(JSON['stringify'](_0x111673));if(_0x22b3aa[_0xdb96('0x50')]!==_0x5d3a3c){_0x22b3aa[_0xdb96('0x50')]=_0x5d3a3c;emit(util[_0xdb96('0x51')](_0xdb96('0x52'),_0x111673['name']),_0xdb96('0x53'),_0x111673);}}}function emitVoiceQueueChannelRemove(_0x496dcf){logger['info'](_0xdb96('0x54'),JSON[_0xdb96('0x55')](_0x496dcf));emit(util[_0xdb96('0x51')](_0xdb96('0x52'),_0x496dcf['name']),_0xdb96('0x56'),_0x496dcf);io[_0xdb96('0x57')](_0xdb96('0x58'),_0x496dcf);}function notSendMessagesQueue(_0xceaa6f){if(_0xceaa6f[_0xdb96('0x59')]){if(_0xceaa6f['originated']===0x0&&_0xceaa6f[_0xdb96('0x29')]===0x0){_0xceaa6f['sendMessageOneNotActive']=![];_0xceaa6f[_0xdb96('0x27')]=0x0;_0xceaa6f[_0xdb96('0x5a')]=0x0;_0xceaa6f[_0xdb96('0x47')]=_0xdb96('0x5b');ut[_0xdb96('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xceaa6f[_0xdb96('0x24')]+'\x20is\x20not\x20active');}else{_0xceaa6f[_0xdb96('0x47')]=_0xdb96('0x5d');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xceaa6f[_0xdb96('0x24')]+_0xdb96('0x5e'));}emitCampaignPreview(_0xceaa6f);}}Preview[_0xdb96('0x5f')][_0xdb96('0x22')]=function(){var _0x29163d=this;setInterval(function(){_0x29163d[_0xdb96('0x60')]();},0x7cf);};Preview['prototype'][_0xdb96('0x60')]=function(){var _0x5266d5=this[_0xdb96('0x10')];this['clockClearZombieChannels']+=0x1;for(var _0x5466e1 in _0x5266d5){if(_0x5266d5[_0xdb96('0x61')](_0x5466e1)&&(_0x5266d5[_0x5466e1]['dialMethod']==='preview'||_0x5266d5[_0x5466e1]['dialMethod']==='booked')&&_0x5266d5[_0x5466e1][_0xdb96('0x23')]===_0xdb96('0x62')){if(this['clockClearZombieChannels']>0x7){this[_0xdb96('0x15')]=0x0;this[_0xdb96('0x63')]();}}if(_0x5266d5[_0xdb96('0x61')](_0x5466e1)&&_0x5266d5[_0x5466e1]['dialMethod']===_0xdb96('0x64')&&_0x5266d5[_0x5466e1][_0xdb96('0x23')]==='outbound'){if(_0x5266d5[_0x5466e1][_0xdb96('0x31')]){this[_0xdb96('0x65')](_0x5266d5[_0x5466e1]);if(_0x5266d5[_0x5466e1][_0xdb96('0x66')])this['recallMe'](_0x5266d5[_0x5466e1]);}else{notSendMessagesQueue(_0x5266d5[_0x5466e1]);}}}};Preview[_0xdb96('0x5f')][_0xdb96('0x67')]=function(_0x21a5f1){var _0x59c843=this;this[_0xdb96('0x68')]['enqueue'](function(){if(!_[_0xdb96('0x69')](_0x59c843[_0xdb96('0x13')][_0x21a5f1])){loggerAction[_0xdb96('0x6a')]('[clearZombieChannels][talking]',_0x21a5f1,_0xdb96('0x6b'),_0x59c843['actions'][_0x21a5f1][_0xdb96('0x6c')],'originated:\x20',JSON['stringify'](_0x59c843['campaignsPreview'][_0x59c843[_0xdb96('0x13')][_0x21a5f1][_0xdb96('0x6c')]][_0xdb96('0x6d')]),_0xdb96('0x6e'),JSON[_0xdb96('0x55')](_0x59c843[_0xdb96('0x10')][_0x59c843[_0xdb96('0x13')][_0x21a5f1][_0xdb96('0x6c')]][_0xdb96('0x29')]),JSON[_0xdb96('0x55')](_0x59c843[_0xdb96('0x13')][_0x21a5f1]['dialAnswer']),JSON[_0xdb96('0x55')](_[_0xdb96('0x6f')](_0x59c843[_0xdb96('0x13')][_0x21a5f1],[_0xdb96('0x70'),_0xdb96('0x71'),_0xdb96('0x72'),_0xdb96('0x73')])));return ami['Action']({'action':'status','channel':_0x59c843[_0xdb96('0x13')][_0x21a5f1][_0xdb96('0x74')]})[_0xdb96('0x75')](function(_0x12cecf){if(_0x12cecf[_0xdb96('0x47')]===_0xdb96('0x76')){setTimeout(function(){if(_0x59c843['actions'][_0x21a5f1]){ut[_0xdb96('0x77')](_0x59c843[_0xdb96('0x10')][_0x59c843['actions'][_0x21a5f1][_0xdb96('0x6c')]],'[clearZombieChannel]');if(_0x59c843['actions'][_0x21a5f1]['dialAnswer']===!![]){ut[_0xdb96('0x78')](_0x59c843['campaignsPreview'][_0x59c843[_0xdb96('0x13')][_0x21a5f1]['queue']],_0xdb96('0x79'));ut[_0xdb96('0x7a')](_0xdb96('0x7b')+_0x21a5f1,_0x59c843[_0xdb96('0x13')][_0x21a5f1][_0xdb96('0x6c')]);}ut[_0xdb96('0x7a')](_0xdb96('0x7c')+_0x21a5f1,_0x59c843[_0xdb96('0x13')][_0x21a5f1][_0xdb96('0x6c')]);delete _0x59c843['actions'][_0x21a5f1];}},0x2328);}});}});};Preview[_0xdb96('0x5f')][_0xdb96('0x63')]=function(){var _0x72b2e8=this;loggerAction[_0xdb96('0x6a')](_0xdb96('0x7d'),_[_0xdb96('0x7e')](this[_0xdb96('0x13')]));for(var _0x31e64d in this[_0xdb96('0x13')]){if(_0x72b2e8['actions'][_0xdb96('0x61')](_0x31e64d)){_0x72b2e8[_0xdb96('0x67')](_0x31e64d);}}};Preview[_0xdb96('0x5f')][_0xdb96('0x7f')]=function(_0x5b5693){var _0x26bc01=this;rpcDb[_0xdb96('0x80')](_0x5b5693['id'],ut[_0xdb96('0x81')](this[_0xdb96('0x14')]))[_0xdb96('0x82')](function(_0x65f125){if(!_['isNil'](_0x65f125)){for(var _0x461d3c=0x0;_0x461d3c<_0x65f125['length'];_0x461d3c+=0x1){if(ut['getDiff'](_0x65f125[_0x461d3c][_0xdb96('0x83')])<_0x5b5693[_0xdb96('0x84')]*0x3c){if(_0x65f125[_0x461d3c]['Agent']&&!_0x65f125[_0x461d3c]['Agent'][_0xdb96('0x85')]){_0x26bc01[_0xdb96('0x86')](_0x65f125[_0x461d3c]['id'])[_0xdb96('0x82')](ut[_0xdb96('0x87')](_0xdb96('0x88')))['catch'](ut[_0xdb96('0x87')](_0xdb96('0x88')));}else{rpcDb['disableContact'](_0x65f125[_0x461d3c]['id']);}}else{var _0x2cd68d=new Action(_0x65f125[_0x461d3c],_0x5b5693);_0x2cd68d['starttime']=moment()['format'](_0xdb96('0x89'));_0x5b5693[_0xdb96('0x3f')]+=0x1;ut[_0xdb96('0x8a')](_0x2cd68d,0x17,_0xdb96('0x8b'));if(_0x5b5693['dialRecallInQueue']){rpcDb[_0xdb96('0x8c')](ut[_0xdb96('0x8d')](_0x65f125[_0x461d3c]));rpcDb[_0xdb96('0x8e')](_0x2cd68d,_0xdb96('0x8f'));}else{ut['logCustomer'](_0x2cd68d,0x16,'RecallFailedTimeout');rpcDb[_0xdb96('0x8e')](_0x2cd68d,_0xdb96('0x90'));rpcDb[_0xdb96('0x91')](_0x2cd68d,_0xdb96('0x90'));}}}}})['catch'](ut[_0xdb96('0x87')]('[getContactRecallMe]'));};Preview['prototype'][_0xdb96('0x65')]=function(_0x37a686){_0x37a686[_0xdb96('0x59')]=!![];if(ut['IsNotLoggedIn'](_0x37a686[_0xdb96('0x28')])){_0x37a686['message']=_0xdb96('0x92');}else if(!ut[_0xdb96('0x93')](_0x37a686[_0xdb96('0x31')])){_0x37a686[_0xdb96('0x47')]=_0xdb96('0x5b');}else if(!this[_0xdb96('0x94')](_0x37a686[_0xdb96('0x4c')])){if(!this[_0xdb96('0x94')](_0x37a686[_0xdb96('0x95')])){_0x37a686[_0xdb96('0x47')]=_0xdb96('0x96');}else{_0x37a686[_0xdb96('0x47')]=_0xdb96('0x97');}}else{_0x37a686[_0xdb96('0x47')]=_0xdb96('0x97');}emitCampaignPreview(_0x37a686);};Preview[_0xdb96('0x5f')][_0xdb96('0x98')]=function(_0x397e80,_0x5a9b9a,_0x2f480a){var _0x3d92f5=this;var _0x3de2a5=this[_0xdb96('0x13')][_0x5a9b9a];var _0x3b60b6=this[_0xdb96('0x10')][_0x3de2a5[_0xdb96('0x6c')]];var _0x39855e;var _0x4af3c2=![];var _0x2d6017=0x2;var _0x409b5a=0x3;if(_0x3b60b6){switch(_0x2f480a){case'1':_0x3b60b6['outboundNoSuchCallsDay']+=0x1;_0x3de2a5[_0xdb96('0x99')]+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut[_0xdb96('0x9b')](_0x3de2a5);ut['logCustomer'](_0x3de2a5,0x0,_0xdb96('0x9c'));ami['emit'](_0xdb96('0x9d'),ut[_0xdb96('0x9e')](_0x3de2a5,_0xdb96('0x9f')));rpcDb[_0xdb96('0x8e')](_0x3de2a5,_0xdb96('0xa0'));_0x3d92f5[_0xdb96('0xa1')](_0x3de2a5,'0',_0x3b60b6)[_0xdb96('0x82')](function(_0x5a4667){_0x4af3c2=_0x5a4667[_0xdb96('0xa2')]==0x1;_0x2d6017=_0x3b60b6[_0xdb96('0xa3')];_0x409b5a=_0x3b60b6[_0xdb96('0xa4')];if(!_0x4af3c2){if(ut[_0xdb96('0x9b')](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut[_0xdb96('0xa6')](_0x3de2a5,0xf,'Global');rpcDb[_0xdb96('0x91')](_0x39855e,_0xdb96('0xa7'));}else{if(_0x3de2a5[_0xdb96('0x99')]>=_0x3b60b6['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x3de2a5,_0xdb96('0xa7'));}else{rpcDb[_0xdb96('0xa8')](ut[_0xdb96('0xa9')](_0x3de2a5,_0xdb96('0x99'),_0x3b60b6[_0xdb96('0xa3')]),_0x3de2a5['unlockAgent'],_0x3de2a5[_0xdb96('0xaa')]);}}delete this[_0xdb96('0x13')][_0x397e80['linkedid']];}else{_0x3de2a5[_0xdb96('0x99')]++;logger[_0xdb96('0x6a')](_0xdb96('0xab'),_0x3de2a5[_0xdb96('0x99')]);logger[_0xdb96('0x6a')]('id',_0x3de2a5[_0xdb96('0xac')]);_0x3d92f5['incrementPreviewCounters']({'id':_0x3de2a5[_0xdb96('0xac')],'field':{'countnosuchnumberretry':_0x3de2a5['countnosuchnumberretry']}})[_0xdb96('0x82')](function(){_0x3d92f5['swapAdditionalPhones'](_0x3de2a5,_0x2d6017,_0x409b5a)[_0xdb96('0x82')](function(){});});}});break;case _0xdb96('0xad'):var _0xeb28ac=moment()[_0xdb96('0x51')](_0xdb96('0x89'));_0x3de2a5[_0xdb96('0xae')]=_0xeb28ac;_0x3de2a5[_0xdb96('0xaf')]=_0xeb28ac;_0x3de2a5[_0xdb96('0xb0')]=!![];_0x3b60b6[_0xdb96('0x29')]+=0x1;logger[_0xdb96('0x6a')](_0xdb96('0xb1'),_0x3de2a5['uniqueid'],_0xdb96('0xb2'),_0x3b60b6['name'],_0xdb96('0x6e'),_0x3b60b6['pTalking']);ami[_0xdb96('0x57')](_0xdb96('0xb3'),ut[_0xdb96('0x9e')](_0x3de2a5,_0xdb96('0xb4'),this[_0xdb96('0x10')][_0x3de2a5[_0xdb96('0x6c')]]));if(_0x3b60b6[_0xdb96('0xb5')]){ami['emit'](_0xdb96('0xb6'),ut['buildAcw'](_0x3de2a5));}break;case'16':ami[_0xdb96('0x57')](_0xdb96('0xb7'),ut['buildObj'](_0x3de2a5,_0xdb96('0xb8'),this['campaignsPreview'][_0x3de2a5[_0xdb96('0x6c')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3de2a5,_0xdb96('0xb8')));_0x3b60b6[_0xdb96('0xb9')]+=0x1;_0x3b60b6[_0xdb96('0xba')]+=0x1;_0x3b60b6[_0xdb96('0x26')]+=0x1;ut[_0xdb96('0x78')](_0x3b60b6,'[16]');_0x3de2a5['countglobal']=ut[_0xdb96('0x9b')](_0x3de2a5);ut[_0xdb96('0x8a')](_0x3de2a5,0x4,_0xdb96('0xbb'));rpcDb[_0xdb96('0x8e')](_0x3de2a5,_0xdb96('0xbc'));rpcDb[_0xdb96('0x91')](_0x3de2a5,_0xdb96('0xbd'));rpcDb[_0xdb96('0xbe')](_0x3de2a5);_0x3b60b6[_0xdb96('0x2a')]+=_0x3de2a5[_0xdb96('0xbf')];_0x3b60b6[_0xdb96('0xc0')]+=_0x3de2a5['talktime'];logger['info']('[syncHangup][talking][decrement]',_0x3de2a5[_0xdb96('0xc1')],_0xdb96('0xb2'),_0x3b60b6[_0xdb96('0x24')],_0xdb96('0x6e'),_0x3b60b6[_0xdb96('0x29')]);delete this[_0xdb96('0x13')][_0x397e80[_0xdb96('0xc2')]];break;case _0xdb96('0xc3'):_0x3b60b6['outboundBusyCallsDay']+=0x1;_0x3de2a5[_0xdb96('0xc4')]+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut[_0xdb96('0x9b')](_0x3de2a5);ut[_0xdb96('0x8a')](_0x3de2a5,0x5,'Busy');_0x2d6017=_0x3b60b6[_0xdb96('0xc5')];_0x409b5a=_0x3b60b6[_0xdb96('0xa4')];ami['emit'](_0xdb96('0xc6'),ut[_0xdb96('0x9e')](_0x3de2a5,_0xdb96('0xc7')));rpcDb[_0xdb96('0x8e')](_0x3de2a5,_0xdb96('0xc8'));_0x3d92f5[_0xdb96('0xa1')](_0x3de2a5,'5',_0x3b60b6)['then'](function(_0xea639b){_0x4af3c2=_0xea639b[_0xdb96('0xa2')]==0x1;if(!_0x4af3c2){if(ut['totalGlobal'](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut[_0xdb96('0xa6')](_0x3de2a5,0xf,_0xdb96('0xc9'));rpcDb[_0xdb96('0x91')](_0x39855e,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3de2a5[_0xdb96('0xc4')]>=_0x3b60b6[_0xdb96('0xca')]){rpcDb[_0xdb96('0x91')](_0x3de2a5,_0xdb96('0xc8'));}else{rpcDb[_0xdb96('0xa8')](ut['scheduledAt'](_0x3de2a5,'countbusyretry',_0x3b60b6[_0xdb96('0xc5')]),_0x3de2a5[_0xdb96('0xcb')],_0x3de2a5[_0xdb96('0xaa')]);}}}else{_0x3de2a5[_0xdb96('0xc4')]++;_0x3d92f5[_0xdb96('0xcc')]({'id':_0x3de2a5[_0xdb96('0xac')],'field':{'countbusyretry':_0x3de2a5['countbusyretry']}})[_0xdb96('0x82')](function(){_0x3d92f5['swapAdditionalPhones'](_0x3de2a5,_0x2d6017,_0x409b5a)['then'](function(){});});}});break;case _0xdb96('0xcd'):_0x3b60b6[_0xdb96('0x3c')]+=0x1;_0x3de2a5[_0xdb96('0xce')]+=0x1;_0x3de2a5['countglobal']=ut[_0xdb96('0x9b')](_0x3de2a5);ut['logCustomer'](_0x3de2a5,0x3,'NoAnswer');_0x2d6017=_0x3b60b6[_0xdb96('0xcf')];_0x409b5a=_0x3b60b6[_0xdb96('0xa4')];var _0x2c0b74=ut[_0xdb96('0xd0')](_0x3de2a5,_0x3b60b6);ami[_0xdb96('0x57')]('custom:agentnoanswer',_0x2c0b74);rpcDb[_0xdb96('0x8e')](_0x3de2a5,_0xdb96('0xd1'));_0x3d92f5[_0xdb96('0xa1')](_0x3de2a5,'3',_0x3b60b6)[_0xdb96('0x82')](function(_0x28b131){_0x4af3c2=_0x28b131[_0xdb96('0xa2')]==0x1;if(!_0x4af3c2){if(ut[_0xdb96('0x9b')](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut['cloneAction'](_0x3de2a5,0xf,_0xdb96('0xc9'));rpcDb[_0xdb96('0x91')](_0x39855e,_0xdb96('0xd2'));}else{if(_0x3de2a5[_0xdb96('0xce')]>=_0x3b60b6[_0xdb96('0xd3')]){rpcDb[_0xdb96('0x91')](_0x3de2a5,_0xdb96('0xd1'));}else{rpcDb[_0xdb96('0xa8')](ut[_0xdb96('0xa9')](_0x3de2a5,_0xdb96('0xce'),_0x3b60b6[_0xdb96('0xcf')]),_0x3de2a5['unlockAgent'],_0x3de2a5[_0xdb96('0xaa')]);}}}else{_0x3de2a5[_0xdb96('0xce')]++;_0x3d92f5['incrementPreviewCounters']({'id':_0x3de2a5[_0xdb96('0xac')],'field':{'countnoanswerretry':_0x3de2a5[_0xdb96('0xce')]}})['then'](function(){_0x3d92f5[_0xdb96('0xd4')](_0x3de2a5,_0x2d6017,_0x409b5a)[_0xdb96('0x82')](function(){});});}});break;case _0xdb96('0xd5'):_0x3b60b6[_0xdb96('0xd6')]+=0x1;_0x3de2a5[_0xdb96('0xd7')]+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut[_0xdb96('0x9b')](_0x3de2a5);ut[_0xdb96('0x8a')](_0x3de2a5,0x8,_0xdb96('0xd8'));_0x2d6017=_0x3b60b6[_0xdb96('0xd9')];_0x409b5a=_0x3b60b6[_0xdb96('0xa4')];ami[_0xdb96('0x57')](_0xdb96('0xda'),ut[_0xdb96('0x9e')](_0x3de2a5,_0xdb96('0xdb')));rpcDb['createCustomerHistory'](_0x3de2a5,'[callProgressDetectingCustomer][logCongestion]');_0x3d92f5[_0xdb96('0xa1')](_0x3de2a5,'8',_0x3b60b6)['then'](function(_0x18824b){_0x4af3c2=_0x18824b[_0xdb96('0xa2')]==0x1;if(!_0x4af3c2){if(ut[_0xdb96('0x9b')](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut['cloneAction'](_0x3de2a5,0xf,'Global');rpcDb[_0xdb96('0x91')](_0x39855e,_0xdb96('0xdc'));}else{if(_0x3de2a5[_0xdb96('0xd7')]>=_0x3b60b6[_0xdb96('0xdd')]){rpcDb[_0xdb96('0x91')](_0x3de2a5,_0xdb96('0xde'));}else{rpcDb[_0xdb96('0xa8')](ut[_0xdb96('0xa9')](_0x3de2a5,_0xdb96('0xd7'),_0x3b60b6[_0xdb96('0xc5')]),_0x3de2a5[_0xdb96('0xcb')],_0x3de2a5['activeContact']);}}}else{_0x3de2a5[_0xdb96('0xd7')]++;_0x3d92f5['incrementPreviewCounters']({'id':_0x3de2a5[_0xdb96('0xac')],'field':{'countcongestionretry':_0x3de2a5[_0xdb96('0xd7')]}})['then'](function(){_0x3d92f5[_0xdb96('0xd4')](_0x3de2a5,_0x2d6017,_0x409b5a)[_0xdb96('0x82')](function(){});});}});break;case _0xdb96('0xdf'):_0x3b60b6['outboundRejectCallsDay']+=0x1;_0x3de2a5['countagentrejectretry']+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut[_0xdb96('0x9b')](_0x3de2a5);ut['logCustomer'](_0x3de2a5,0x14,'AgentReject');_0x2d6017=_0x3b60b6[_0xdb96('0xe0')];_0x409b5a=_0x3b60b6['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentreject',ut[_0xdb96('0x9e')](_0x3de2a5,_0xdb96('0xe1')));rpcDb[_0xdb96('0x8e')](_0x3de2a5,_0xdb96('0xe2'));_0x3d92f5[_0xdb96('0xa1')](_0x3de2a5,'20',_0x3b60b6)['then'](function(_0x14dcbd){_0x4af3c2=_0x14dcbd['additional']==0x1;if(!_0x4af3c2){if(ut[_0xdb96('0x9b')](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut['cloneAction'](_0x3de2a5,0x14,'AgentReject');rpcDb[_0xdb96('0x91')](_0x39855e,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3de2a5[_0xdb96('0xe3')]>=_0x3b60b6[_0xdb96('0xe4')]){rpcDb[_0xdb96('0x91')](_0x3de2a5,_0xdb96('0xe5'));}else{rpcDb[_0xdb96('0xa8')](ut['scheduledAt'](_0x3de2a5,'countagentrejectretry',_0x3b60b6[_0xdb96('0xe0')]),_0x3de2a5['unlockAgent'],_0x3de2a5[_0xdb96('0xaa')]);}}}else{_0x3de2a5[_0xdb96('0xce')]++;_0x3d92f5['incrementPreviewCounters']({'id':_0x3de2a5[_0xdb96('0xac')],'field':{'countnoanswerretry':_0x3de2a5['countnoanswerretry']}})[_0xdb96('0x82')](function(){_0x3d92f5[_0xdb96('0xd4')](_0x3de2a5,_0x2d6017,_0x409b5a)['then'](function(){});});}});break;case _0xdb96('0xe6'):_0x3b60b6[_0xdb96('0x41')]+=0x1;_0x3de2a5['countabandonedretry']+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut['totalGlobal'](_0x3de2a5);ut[_0xdb96('0x8a')](_0x3de2a5,0xb,_0xdb96('0xe7'));rpcDb[_0xdb96('0x8e')](_0x3de2a5,_0xdb96('0xe8'));_0x3d92f5['verifyAdditionalPhones'](_0x3de2a5,'11',_0x3b60b6)[_0xdb96('0x82')](function(_0x43c43c){_0x4af3c2=_0x43c43c['additional']==0x1;if(!_0x4af3c2){if(ut[_0xdb96('0x9b')](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut[_0xdb96('0xa6')](_0x3de2a5,0xf,'Global');rpcDb[_0xdb96('0x91')](_0x39855e,_0xdb96('0xe8'));}else{if(_0x3de2a5['countabandonedetry']>=_0x3b60b6[_0xdb96('0xe9')]){rpcDb[_0xdb96('0x91')](_0x3de2a5,_0xdb96('0xe8'));}else{rpcDb[_0xdb96('0xa8')](ut[_0xdb96('0xa9')](_0x3de2a5,_0xdb96('0xea'),_0x3b60b6['dialAbandonedRetryFrequency']),_0x3de2a5[_0xdb96('0xcb')],_0x3de2a5['activeContact']);}}}else{_0x3de2a5['countnoanswerretry']++;_0x3d92f5['incrementPreviewCounters']({'id':_0x3de2a5[_0xdb96('0xac')],'field':{'countnoanswerretry':_0x3de2a5[_0xdb96('0xce')]}})[_0xdb96('0x82')](function(){_0x3d92f5[_0xdb96('0xd4')](_0x3de2a5,_0x2d6017,_0x409b5a)[_0xdb96('0x82')](function(){});});}});break;case'18':_0x3b60b6[_0xdb96('0x40')]+=0x1;_0x3de2a5['countmachineretry']+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut[_0xdb96('0x9b')](_0x3de2a5);ut[_0xdb96('0x8a')](_0x3de2a5,0x12,_0x397e80['cause-txt']||_0x397e80['dialstatus']);ami[_0xdb96('0x57')](_0xdb96('0xeb'),ut[_0xdb96('0x9e')](_0x3de2a5,'amd'));rpcDb['createCustomerHistory'](_0x3de2a5,_0xdb96('0xec'));_0x3d92f5[_0xdb96('0xa1')](_0x3de2a5,'18',_0x3b60b6)[_0xdb96('0x82')](function(_0x4ed39c){_0x4af3c2=_0x4ed39c[_0xdb96('0xa2')]==0x1;if(!_0x4af3c2){if(ut['totalGlobal'](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut['cloneAction'](_0x3de2a5,0x12,_0xdb96('0xc9'));rpcDb[_0xdb96('0x91')](_0x39855e,_0xdb96('0xec'));}else{rpcDb['createCustomerFinal'](_0x3de2a5,_0xdb96('0xec'));}}else{_0x3de2a5['countnoanswerretry']++;_0x3d92f5[_0xdb96('0xcc')]({'id':_0x3de2a5['idContact'],'field':{'countnoanswerretry':_0x3de2a5[_0xdb96('0xce')]}})[_0xdb96('0x82')](function(){_0x3d92f5[_0xdb96('0xd4')](_0x3de2a5,_0x2d6017,_0x409b5a)['then'](function(){});});}});delete this[_0xdb96('0x13')][_0x397e80[_0xdb96('0xc2')]];break;case'19':_0x3b60b6[_0xdb96('0x40')]+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut[_0xdb96('0x9b')](_0x3de2a5);ut[_0xdb96('0x8a')](_0x3de2a5,0x13,_0x397e80[_0xdb96('0xed')]||_0x397e80['dialstatus']);ami[_0xdb96('0x57')](_0xdb96('0xeb'),ut[_0xdb96('0x9e')](_0x3de2a5,'amd'));rpcDb['createCustomerHistory'](_0x3de2a5,_0xdb96('0xee'));_0x3d92f5[_0xdb96('0xa1')](_0x3de2a5,'18',_0x3b60b6)['then'](function(_0x4abbb6){_0x4af3c2=_0x4abbb6[_0xdb96('0xa2')]==0x1;if(!_0x4af3c2){if(ut[_0xdb96('0x9b')](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut[_0xdb96('0xa6')](_0x3de2a5,0xf,'Global');rpcDb[_0xdb96('0x91')](_0x39855e,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xdb96('0x91')](_0x3de2a5,'[callProgressDetectingCustomer][machine]');}}else{_0x3de2a5[_0xdb96('0xce')]++;_0x3d92f5[_0xdb96('0xcc')]({'id':_0x3de2a5[_0xdb96('0xac')],'field':{'countnoanswerretry':_0x3de2a5[_0xdb96('0xce')]}})['then'](function(){_0x3d92f5[_0xdb96('0xd4')](_0x3de2a5,_0x2d6017,_0x409b5a)[_0xdb96('0x82')](function(){});});}});delete this[_0xdb96('0x13')][_0x397e80[_0xdb96('0xc2')]];break;default:if(_0x3de2a5[_0xdb96('0xb0')]){ut['decrementTalkink'](_0x3b60b6,_0xdb96('0xef'));ut[_0xdb96('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x3b60b6['name'],_0x397e80);}_0x3b60b6[_0xdb96('0x40')]+=0x1;_0x3de2a5[_0xdb96('0x9a')]=ut[_0xdb96('0x9b')](_0x3de2a5);ut['logCustomer'](_0x3de2a5,0xc,_0x397e80['cause-txt']||_0x397e80['dialstatus']);_0x2d6017=_0x3b60b6[_0xdb96('0xe0')];_0x409b5a=_0x3b60b6[_0xdb96('0xa4')];rpcDb[_0xdb96('0x8e')](_0x3de2a5,_0xdb96('0xf0'));_0x3d92f5['verifyAdditionalPhones'](_0x3de2a5,'20',_0x3b60b6)[_0xdb96('0x82')](function(_0x6a3e37){_0x4af3c2=_0x6a3e37[_0xdb96('0xa2')]==0x1;if(!_0x4af3c2){if(ut[_0xdb96('0x9b')](_0x3de2a5)>=_0x3b60b6[_0xdb96('0xa5')]){_0x39855e=ut['cloneAction'](_0x3de2a5,0xf,'Global');rpcDb[_0xdb96('0x91')](_0x39855e,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x3de2a5,_0xdb96('0xf1'));}delete this['actions'][_0x397e80['linkedid']];}else{_0x3d92f5['swapAdditionalPhones'](_0x3de2a5,_0x2d6017,_0x409b5a)['then'](function(){});}});}if(!(_0x3de2a5[_0xdb96('0xb0')]&&_0x2f480a==='16')){ut[_0xdb96('0x77')](_0x3b60b6,'[callProgressDetectingCustomer]');logger[_0xdb96('0x6a')](_0xdb96('0xf2'),_0x3de2a5[_0xdb96('0xc1')],_0xdb96('0xb2'),_0x3b60b6[_0xdb96('0x24')],_0xdb96('0xf3'),_0x3b60b6['originated']);}if(_0x2f480a!==_0xdb96('0xad')){delete this[_0xdb96('0x13')][_0x397e80['linkedid']];delete this[_0xdb96('0x13')][_0x397e80['destlinkedid']];}}};Preview[_0xdb96('0x5f')]['callProgressDetectingAgent']=function(_0x59d2f8,_0x272b2a,_0x5e0407){if(_[_0xdb96('0xf4')](_0x272b2a)&&_0xdb96('0xf5')!==typeof _0x272b2a){return;}if(_[_0xdb96('0xf4')](_0x5e0407)&&_0xdb96('0xf5')!==typeof _0x5e0407){return;}switch(_0x5e0407[_0xdb96('0xf6')]){case'0':ut[_0xdb96('0xf7')](_0x59d2f8,0x0,_0xdb96('0x9c'));rpcDb['createAgentHistory'](_0x59d2f8,_0xdb96('0xf8'));break;case'3':ut[_0xdb96('0xf7')](_0x59d2f8,0x3,_0xdb96('0xf9'));rpcDb[_0xdb96('0xfa')](_0x59d2f8,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xdb96('0xf7')](_0x59d2f8,0x5,_0xdb96('0xfb'));rpcDb[_0xdb96('0xfa')](_0x59d2f8,_0xdb96('0xfc'));break;case'8':ut[_0xdb96('0xf7')](_0x59d2f8,0x8,'Congestion');rpcDb['createAgentHistory'](_0x59d2f8,_0xdb96('0xfd'));break;case'22':ut[_0xdb96('0xf7')](_0x59d2f8,0x16,_0xdb96('0xfe'));rpcDb[_0xdb96('0xfa')](_0x59d2f8,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xdb96('0xf7')](_0x59d2f8,0xc,_0x5e0407[_0xdb96('0xf6')]);rpcDb[_0xdb96('0xfa')](_0x59d2f8,_0xdb96('0xfd'));}ut[_0xdb96('0x77')](_0x272b2a,_0xdb96('0xff'));logger[_0xdb96('0x6a')](_0xdb96('0x100'),_0x59d2f8['uniqueid'],_0xdb96('0xb2'),_0x272b2a[_0xdb96('0x24')],_0xdb96('0xf3'),_0x272b2a['originated']);delete this['actions'][_0x59d2f8[_0xdb96('0xc1')]];};Preview['prototype']['verifyAdditionalPhones']=function(_0x3c0024,_0x135988,_0x2c8f07){return Promise['resolve']()[_0xdb96('0x82')](cmHopperAdditionalPhone[_0xdb96('0xa1')](_0x3c0024,_0x135988,_0x2c8f07))[_0xdb96('0x75')](logger[_0xdb96('0x6a')](_0xdb96('0x101')));};Preview[_0xdb96('0x5f')]['swapAdditionalPhones']=function(_0x1d34f9,_0x4e1c57,_0x5a8056){return Promise['resolve']()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1d34f9,_0x4e1c57,_0x5a8056))['catch'](logger[_0xdb96('0x6a')](_0xdb96('0x102')));};Preview[_0xdb96('0x5f')][_0xdb96('0xcc')]=function(_0x22ca0c){return Promise[_0xdb96('0x103')]()['then'](cmHopperAdditionalPhone[_0xdb96('0xcc')](_0x22ca0c))['catch'](logger[_0xdb96('0x6a')](_0xdb96('0x104')));};Preview[_0xdb96('0x5f')]['checkInBlack']=function(_0x54de37,_0x548b8d,_0xc70308,_0xb39f79,_0x3c9aa6){var _0x102a95=this;return new Promise(function(_0x1c5a55,_0x263176){if(_['isNil'](_0x548b8d)||_['isNil'](_0x548b8d[_0xdb96('0x105')])||_[_0xdb96('0x69')](_0x548b8d[_0xdb96('0x106')])||_[_0xdb96('0x69')](_0x548b8d[_0xdb96('0x72')])){_0x263176(ut[_0xdb96('0x47')](_0xdb96('0x107'),_0xb39f79,_0x3c9aa6));return;}var _0x54bb21=uuid['v4']();var _0x1aa712=_0x102a95[_0xdb96('0x10')][_0x548b8d[_0xdb96('0x6b')][_0xdb96('0x24')]];var _0x131027=_0xc70308?_0x102a95['agents'][_0xc70308]['id']:undefined;_0x102a95[_0xdb96('0x13')][_0x54bb21]=new Action(_0x548b8d,_0x1aa712,_0x54bb21,_0xc70308,_0x131027);var _0x9ccdcc=_0x102a95['actions'][_0x54bb21];_0x9ccdcc[_0xdb96('0xcb')]=_0xb39f79;_0x9ccdcc[_0xdb96('0xaa')]=_0x3c9aa6;_0x9ccdcc['lookAgent']=_0xc70308;if(_[_0xdb96('0x108')](_0x54de37)){_0x102a95[_0xdb96('0x109')](_0x9ccdcc,_0x1aa712,_0x548b8d,_0xc70308)[_0xdb96('0x82')](function(_0x11b78c){logger[_0xdb96('0x6a')]('[Preview][execCall][success]',_0xdb96('0x10a')+_0x9ccdcc[_0xdb96('0x6c')]+_0xdb96('0x10b')+_0x9ccdcc[_0xdb96('0xac')],JSON[_0xdb96('0x55')](_0x11b78c));ami[_0xdb96('0x57')]('custom:agentcalled',ut[_0xdb96('0x9e')](_0x9ccdcc,'called',_0x102a95[_0xdb96('0x10')][_0x9ccdcc['queue']]));_0x1c5a55(ut['message'](_0xdb96('0x10c')));})[_0xdb96('0x75')](function(_0x455c7f){ut[_0xdb96('0x5c')]('[Preview][execCall][failure]',_0x455c7f);_0x263176(ut['message'](_0xdb96('0x10d'),_0xb39f79,_0x3c9aa6));});}else{_0x1aa712[_0xdb96('0x37')]+=0x1;ut['logBlacklist'](_0x9ccdcc);rpcDb[_0xdb96('0x10e')](_0x9ccdcc,_0xdb96('0x10f'));delete _0x102a95[_0xdb96('0x13')][_0x54bb21];_0x263176(ut[_0xdb96('0x47')](_0xdb96('0x110'),_0xb39f79,_0x3c9aa6));}});};Preview['prototype'][_0xdb96('0x94')]=function(_0x57bc50){return!_[_0xdb96('0x69')](_0x57bc50)&&!_[_0xdb96('0x69')](_0x57bc50[_0xdb96('0x24')])&&!_['isNil'](_0x57bc50[_0xdb96('0x4d')])&&_0x57bc50[_0xdb96('0x4d')]&&!_['isNil'](this[_0xdb96('0x12')][util[_0xdb96('0x51')](_0xdb96('0x111'),_0x57bc50[_0xdb96('0x24')])])&&!_[_0xdb96('0x69')](this[_0xdb96('0x12')][util[_0xdb96('0x51')](_0xdb96('0x111'),_0x57bc50['name'])][_0xdb96('0x112')])&&(this[_0xdb96('0x12')][util[_0xdb96('0x51')](_0xdb96('0x111'),_0x57bc50[_0xdb96('0x24')])][_0xdb96('0x112')]===_0xdb96('0x113')||this[_0xdb96('0x12')][util[_0xdb96('0x51')](_0xdb96('0x111'),_0x57bc50[_0xdb96('0x24')])][_0xdb96('0x112')]===_0xdb96('0x114'));};Preview[_0xdb96('0x5f')][_0xdb96('0x86')]=function(_0x2a61da,_0x554798){return this[_0xdb96('0x115')](_0x2a61da,_0x554798)[_0xdb96('0x82')](function(_0x3d561a){return _[_0xdb96('0x6f')](_0x3d561a,[_0xdb96('0x47')]);})[_0xdb96('0x75')](function(_0x41d4e3){if(_0x41d4e3[_0xdb96('0x116')]){rpcDb[_0xdb96('0x117')](_0x2a61da);}if(_0x41d4e3[_0xdb96('0x4d')]){rpcDb[_0xdb96('0x118')](_0x2a61da);}throw _[_0xdb96('0x6f')](_0x41d4e3,[_0xdb96('0x47')]);});};Preview[_0xdb96('0x5f')][_0xdb96('0x115')]=function(_0x393c8b,_0x4e283a){var _0x35214f=this;var _0xcb048d,_0x6580bc;return rpcDb[_0xdb96('0x119')](_0x393c8b)[_0xdb96('0x82')](function(_0x43df66){if(!_['isNil'](_0x43df66[0x0])){_0x6580bc=_0x43df66[0x0][_0xdb96('0x11a')]?![]:!![];_0xcb048d=_0x43df66[0x0][_0xdb96('0x11a')]?!![]:![];_0xcb048d=_0x4e283a?!![]:_0xcb048d;}var _0x1e8288=_0x35214f['validateContact'](_0x43df66);if(_0x1e8288['isValid']){rpcDb[_0xdb96('0x11b')](_[_0xdb96('0x6f')](_0x43df66[0x0],[_0xdb96('0x72'),'phone']))[_0xdb96('0x82')](function(_0x4d916f){_0x35214f[_0xdb96('0x11c')](_0x4d916f,_0x43df66[0x0],_0x4e283a,_0x6580bc,_0xcb048d)[_0xdb96('0x82')](function(_0xf83cda){return _0xf83cda;})[_0xdb96('0x75')](function(_0x441ec7){throw _0x441ec7;});})[_0xdb96('0x75')](function(_0x250b2f){ut[_0xdb96('0x5c')]('[Preview][checkIsBlackList]',_0x250b2f);throw ut[_0xdb96('0x47')](_0xdb96('0x11d'),_0x6580bc,_0xcb048d);});}else{throw ut[_0xdb96('0x47')](_0x1e8288[_0xdb96('0x47')],_0x6580bc,_0xcb048d);}})[_0xdb96('0x75')](function(_0x12b7ca){ut[_0xdb96('0x5c')](_0xdb96('0x11e'),_0x12b7ca);throw ut[_0xdb96('0x47')](_0xdb96('0x11d'),![],!![]);});};Preview['prototype']['validateContact']=function(_0x46366f){if(_['isNil'](_0x46366f)||_[_0xdb96('0x108')](_0x46366f)||!_[_0xdb96('0x69')](_0x46366f[0x0][_0xdb96('0x11f')])&&_[_0xdb96('0x69')](_0x46366f[0x0][_0xdb96('0x11f')]['name'])){ut[_0xdb96('0x5c')]('[Preview][validateContact][Empty\x20Contact]',_0x46366f);return{'isValid':![],'message':_0xdb96('0x120')};}var _0x51feae=this[_0xdb96('0x10')][_0x46366f[0x0][_0xdb96('0x6b')][_0xdb96('0x24')]];_0x51feae[_0xdb96('0x47')]='ACTIVE';if(_[_0xdb96('0x69')](_0x51feae)){ut[_0xdb96('0x5c')](_0xdb96('0x121'),_0x51feae);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xdb96('0x94')](_0x51feae[_0xdb96('0x4c')])){ut['logger'](_0xdb96('0x122'),'campaign\x20Name:\x20'+_0x51feae['name']+_0xdb96('0x123'));if(!this['isTrunkReachable'](_0x51feae[_0xdb96('0x95')])){ut[_0xdb96('0x5c')](_0xdb96('0x122'),_0x51feae[_0xdb96('0x24')]+_0xdb96('0x124'));return{'isValid':![],'message':_0xdb96('0x125')};}}if(!ut[_0xdb96('0x93')](_0x51feae[_0xdb96('0x31')])){ut['logger'](_0xdb96('0x126'),_0x51feae[_0xdb96('0x24')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xdb96('0x127')+_0x51feae[_0xdb96('0x24')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xdb96('0x128')};};Preview[_0xdb96('0x5f')][_0xdb96('0x109')]=function(_0x1606d8,_0x3c6865,_0x2916d6,_0x1e26a2){var _0x3ba39f=this;return new Promise(function(_0x309370,_0x28ad62){var _0x5953a2=_0x1606d8[_0xdb96('0xc1')];var _0x377df8=_0x3ba39f[_0xdb96('0x94')](_0x3c6865[_0xdb96('0x4c')])?util[_0xdb96('0x51')]('SIP/%s/%s%s',_0x3c6865['Trunk'][_0xdb96('0x24')],_[_0xdb96('0x69')](_0x3c6865['dialPrefix'])?'':_0x3c6865['dialPrefix'][_0xdb96('0x129')]()||'',_0x3c6865['dialCutDigit']>0x0?_0x2916d6[_0xdb96('0x106')]['substring'](_0x3c6865[_0xdb96('0x12a')]):_0x2916d6[_0xdb96('0x106')]):util[_0xdb96('0x51')](_0xdb96('0x12b'),_[_0xdb96('0x69')](_0x3c6865[_0xdb96('0x95')])?_0x3c6865['Trunk'][_0xdb96('0x24')]:_0x3c6865[_0xdb96('0x95')][_0xdb96('0x24')],_[_0xdb96('0x69')](_0x3c6865[_0xdb96('0x35')])?'':_0x3c6865[_0xdb96('0x35')][_0xdb96('0x129')]()||'',_0x3c6865[_0xdb96('0x12a')]>0x0?_0x2916d6[_0xdb96('0x106')][_0xdb96('0x12c')](_0x3c6865[_0xdb96('0x12a')]):_0x2916d6[_0xdb96('0x106')]);var _0x5f477b=_0x3ba39f['isTrunkReachable'](_0x3c6865['Trunk'])?ut['getCallerId'](_0x3c6865[_0xdb96('0x4c')]['callerid'],_0x3c6865[_0xdb96('0x33')],_0x3c6865[_0xdb96('0x12d')]>0x0?ut[_0xdb96('0x12e')](_0x3c6865[_0xdb96('0x34')],_0x3c6865['dialRandomLastDigitCallerIdNumber']):_0x3c6865[_0xdb96('0x34')]):ut[_0xdb96('0x12f')](_[_0xdb96('0x69')](_0x3c6865['TrunkBackup'])?_0x3c6865[_0xdb96('0x4c')]['callerid']:_0x3c6865[_0xdb96('0x95')][_0xdb96('0x4e')],_0x3c6865[_0xdb96('0x33')],_0x3c6865[_0xdb96('0x12d')]>0x0?ut[_0xdb96('0x12e')](_0x3c6865[_0xdb96('0x34')],_0x3c6865[_0xdb96('0x12d')]):_0x3c6865[_0xdb96('0x34')]);if(_0x5f477b){_0x1606d8[_0xdb96('0x130')]=ut['extractCalleridName'](_0x5f477b);_0x1606d8[_0xdb96('0x131')]=ut['extractCalleridNumber'](_0x5f477b);}var _0x2f0eb4=ut[_0xdb96('0x132')](_0x3c6865,_0x2916d6,_0x377df8,_0x5f477b,_0x5953a2,_0x1606d8);_['merge'](_0x1606d8,ut[_0xdb96('0x133')](_0x2f0eb4));_0x1606d8[_0xdb96('0x134')]=moment()[_0xdb96('0x51')](_0xdb96('0x89'));_0x3c6865[_0xdb96('0x135')]=_0x2f0eb4;ami[_0xdb96('0x136')](ut['variablesAction'](_0x1606d8,_0x3c6865,_0x2f0eb4,_0x1606d8['activeContact'],_0x1e26a2))[_0xdb96('0x82')](function(_0x3d9f81){_0x3c6865[_0xdb96('0x6d')]+=0x1;logger[_0xdb96('0x6a')](_0xdb96('0x137'),_0x5953a2,'\x20Queue',_0x3c6865[_0xdb96('0x24')],_0xdb96('0xf3'),_0x3c6865[_0xdb96('0x6d')]);_0x309370(_0x3d9f81);})['catch'](function(_0x2d7426){ut[_0xdb96('0xf7')](_0x1606d8,0xe,_0xdb96('0x138'));rpcDb[_0xdb96('0xfa')](_0x1606d8,_0xdb96('0x139'));_0x28ad62(_0x2d7426);});});};Preview[_0xdb96('0x5f')]['syncNewExten']=function(_0x551059){if(this['actions'][_0x551059[_0xdb96('0xc2')]]){this[_0xdb96('0x13')][_0x551059[_0xdb96('0xc2')]][_0xdb96('0x74')]=_0x551059[_0xdb96('0x74')];}};Preview[_0xdb96('0x5f')]['syncOriginateResponse']=function(_0x1954df){var _0x24b0ab=this;var _0x2908e0=this[_0xdb96('0x13')][_0x1954df[_0xdb96('0x13a')]];if(_0x2908e0){if(_0x2908e0['lookAgent']&&this['agents'][_0x2908e0[_0xdb96('0x13b')]]){ut['logLookAgent'](_0x2908e0,this['agents'][_0x2908e0['lookAgent']][_0xdb96('0x24')],this[_0xdb96('0x14')][_0x2908e0[_0xdb96('0x13b')]]['id']);}var _0x3cd7b0=_['clone'](_0x2908e0);_0x3cd7b0['responsetime']=moment()[_0xdb96('0x51')](_0xdb96('0x89'));var _0x100421=_0x24b0ab['campaignsPreview'][_0x2908e0[_0xdb96('0x6c')]];if(ut['isFailure'](_0x1954df[_0xdb96('0x13c')])){if(_0x2908e0[_0xdb96('0xcb')]){rpcDb[_0xdb96('0x117')](_0x2908e0[_0xdb96('0xac')]);}if(_0x2908e0[_0xdb96('0xaa')]){rpcDb[_0xdb96('0x118')](_0x2908e0[_0xdb96('0xac')]);}ami[_0xdb96('0x57')]('custom:agentringnoanswer',ut[_0xdb96('0x9e')](_0x2908e0,_0xdb96('0x13d'),this[_0xdb96('0x10')][_0x2908e0[_0xdb96('0x6c')]]));this[_0xdb96('0x13e')](_0x3cd7b0,_0x100421,_0x1954df);}else{_0x2908e0['starttime']=moment()[_0xdb96('0x51')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xdb96('0xf7')](_0x3cd7b0,0x4,_0xdb96('0xbb'));rpcDb['createAgentHistory'](_0x3cd7b0,_0xdb96('0x13f'));}}};Preview[_0xdb96('0x5f')][_0xdb96('0x1a')]=function(_0x28dc36){var _0x1bc1c1=this['actions'][_0x28dc36[_0xdb96('0xc2')]];var _0x329909;if(_0x1bc1c1){_0x329909=this['campaignsPreview'][_0x1bc1c1[_0xdb96('0x6c')]];logger['info'](_0xdb96('0x140'),_0x28dc36[_0xdb96('0xc2')],_0xdb96('0xb2'),_0x329909['name'],_0xdb96('0x6e'),_0x329909[_0xdb96('0x29')]);}if(this[_0xdb96('0x13')][_0x28dc36[_0xdb96('0xc2')]]&&_0x28dc36[_0xdb96('0xc2')]!==_0x28dc36[_0xdb96('0xc1')]){if(_0x28dc36[_0xdb96('0x141')]==='16'&&this[_0xdb96('0x13')][_0x28dc36[_0xdb96('0xc2')]][_0xdb96('0xb0')]){this['callProgressDetectingCustomer'](_0x28dc36,_0x28dc36[_0xdb96('0xc2')],_0x28dc36['cause']);}else if(this['actions'][_0x28dc36[_0xdb96('0xc2')]][_0xdb96('0xb0')]){logger[_0xdb96('0x6a')](_0xdb96('0x142'),_0x28dc36[_0xdb96('0xc2')],_0x28dc36[_0xdb96('0x141')],_0xdb96('0xb2'),_0x329909['name'],_0xdb96('0x6e'),_0x329909[_0xdb96('0x29')]);this[_0xdb96('0x98')](_0x28dc36,_0x28dc36[_0xdb96('0xc2')],_0x28dc36[_0xdb96('0x141')]);}}else if(_0x1bc1c1&&_[_0xdb96('0x69')](_0x1bc1c1[_0xdb96('0x143')])&&_0x329909[_0xdb96('0x144')]&&_0x28dc36[_0xdb96('0xc2')]===_0x28dc36['uniqueid']&&_[_0xdb96('0x69')](_0x28dc36[_0xdb96('0xf6')])&&_0x28dc36[_0xdb96('0x141')]==='16'&&_0x28dc36[_0xdb96('0x145')]==='6'&&_[_0xdb96('0xf4')](_0x1bc1c1[_0xdb96('0x146')])){if(_0x1bc1c1[_0xdb96('0xcb')]){rpcDb['unlockContact'](_0x1bc1c1['idContact']);}if(_0x1bc1c1[_0xdb96('0xaa')]){rpcDb[_0xdb96('0x118')](_0x1bc1c1[_0xdb96('0xac')]);}_0x28dc36[_0xdb96('0xf6')]='22';this[_0xdb96('0x13e')](_0x1bc1c1,_0x329909,_0x28dc36);}else if(_0x1bc1c1&&_0x1bc1c1[_0xdb96('0x146')]){if(_0x28dc36[_0xdb96('0x141')]==='16'&&this[_0xdb96('0x13')][_0x28dc36[_0xdb96('0xc2')]][_0xdb96('0xb0')]){logger[_0xdb96('0x6a')](_0xdb96('0x147'),_0x28dc36[_0xdb96('0xc2')],_0x28dc36[_0xdb96('0x141')],_0xdb96('0xb2'),_0x329909['name'],'pTalking:\x20',_0x329909[_0xdb96('0x29')]);this[_0xdb96('0x98')](_0x28dc36,_0x28dc36[_0xdb96('0xc2')],_0x28dc36[_0xdb96('0x141')]);}else if(this['actions'][_0x28dc36[_0xdb96('0xc2')]]['dialAnswer']){logger[_0xdb96('0x6a')](_0xdb96('0x142'),_0x28dc36[_0xdb96('0xc2')],_0x28dc36[_0xdb96('0x141')],_0xdb96('0xb2'),_0x329909[_0xdb96('0x24')],'pTalking:\x20',_0x329909[_0xdb96('0x29')]);this[_0xdb96('0x98')](_0x28dc36,_0x28dc36[_0xdb96('0xc2')],_0x28dc36[_0xdb96('0x141')]);}}};Preview[_0xdb96('0x5f')][_0xdb96('0x1d')]=function(_0x2822d5){if(this[_0xdb96('0x13')][_0x2822d5[_0xdb96('0x148')]]&&_0x2822d5['destlinkedid']!==_0x2822d5[_0xdb96('0x149')]){this[_0xdb96('0x98')](_0x2822d5,_0x2822d5[_0xdb96('0x148')],_0x2822d5[_0xdb96('0x14a')]);}};Preview[_0xdb96('0x5f')][_0xdb96('0x1c')]=function(_0x5671f6){if(this[_0xdb96('0x13')][_0x5671f6[_0xdb96('0xc2')]]&&_0x5671f6[_0xdb96('0xc2')]!==_0x5671f6[_0xdb96('0xc1')]&&!this[_0xdb96('0x13')][_0x5671f6[_0xdb96('0xc2')]]['dialAnswer']){if(_0x5671f6[_0xdb96('0x141')]==='1'){this[_0xdb96('0x98')](_0x5671f6,_0x5671f6[_0xdb96('0xc2')],_0x5671f6['cause']);}}};Preview['prototype'][_0xdb96('0x14b')]=function(_0x3c05b3,_0xd31d4d,_0x1e8fec){if(this[_0xdb96('0x13')][_0x3c05b3]){if(_[_0xdb96('0x69')](this[_0xdb96('0x13')][_0x3c05b3]['variables'])){this[_0xdb96('0x13')][_0x3c05b3]['variables']={};}this[_0xdb96('0x13')][_0x3c05b3][_0xdb96('0x135')][_0xd31d4d]=_0x1e8fec;}};Preview[_0xdb96('0x5f')][_0xdb96('0x21')]=function(_0x4909e5){try{if(!_['isNil'](_0x4909e5)){if(ut['filterKey'](_[_0xdb96('0x14c')](_0x4909e5[_0xdb96('0x14d')])[0x0])){this[_0xdb96('0x14b')](_0x4909e5[_0xdb96('0xc1')],_[_0xdb96('0x14c')](_0x4909e5['variable'])[0x0],_0x4909e5['value']);}}}catch(_0x1faf83){logger[_0xdb96('0x14e')]('[syncVarSet][Preview]',util[_0xdb96('0x14f')](_0x1faf83,{'showHidden':![],'depth':null}));}};Preview[_0xdb96('0x5f')][_0xdb96('0x150')]=function(_0x42dbae){if(_0x42dbae){if(this[_0xdb96('0x13')][_0x42dbae[_0xdb96('0x151')]]){this['actions'][_0x42dbae[_0xdb96('0x151')]][_0xdb96('0x146')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x58b021){if(_0x58b021){if(this[_0xdb96('0x13')][_0x58b021[_0xdb96('0x152')]]){this[_0xdb96('0x13')][_0x58b021[_0xdb96('0x152')]][_0xdb96('0x146')]=!![];}}};module[_0xdb96('0x153')]=Preview; \ No newline at end of file +var _0xe71a=['originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice_queue:save','info','voice:queue:%s','emit','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','loopCampaigns','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','actions','Queue','originated:\x20','stringify','queue','dialAnswer','contactId','UserId','ListId','Action','status','channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','totalGlobal','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','Answer','crateCustomerReportQueue','talktime','uniqueid','countbusyretry','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[swapAdditionalPhone]\x20','Contact','phone','VoiceQueueId','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','SIP/%s','reachable','unlock','unlockContact','pick','execRun','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridNumber','addVariables','toLowerVariables','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','callProgressDetectingCustomer','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][cause]','destuniqueid','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','uuid','moment','md5','ioredis','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','type','outbound','name','answered','available','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message'];(function(_0x1d13c8,_0x1554e6){var _0x3a3b03=function(_0x3d488d){while(--_0x3d488d){_0x1d13c8['push'](_0x1d13c8['shift']());}};_0x3a3b03(++_0x1554e6);}(_0xe71a,0x104));var _0xae71=function(_0x144ec4,_0x3a4d44){_0x144ec4=_0x144ec4-0x0;var _0x224de8=_0xe71a[_0x144ec4];return _0x224de8;};'use strict';var util=require(_0xae71('0x0'));var _=require('lodash');var uuid=require(_0xae71('0x1'));var moment=require(_0xae71('0x2'));var md5=require(_0xae71('0x3'));var Redis=require(_0xae71('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xae71('0x5'));var loggerAction=require('../../../config/logger')(_0xae71('0x6'));var ami=require(_0xae71('0x7'));var rpcDb=require(_0xae71('0x8'));var cmHopperAdditionalPhone=require(_0xae71('0x9'));var Action=require(_0xae71('0xa'));var ut=require(_0xae71('0xb'));config[_0xae71('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xae71('0xd'))(new Redis(config[_0xae71('0xc')]));var Sequence=function(){};Sequence[_0xae71('0xe')][_0xae71('0xf')]=function(_0x565d75){this[_0xae71('0x10')]=this[_0xae71('0x10')]?this[_0xae71('0x10')]['finally'](_0x565d75):_0x565d75();};function Preview(_0x4ec752){this['sequence']=new Sequence();this[_0xae71('0x11')]=_0x4ec752[_0xae71('0x12')];this['trunks']=_0x4ec752[_0xae71('0x13')];this['actions']={};this[_0xae71('0x14')]=_0x4ec752[_0xae71('0x14')];this[_0xae71('0x15')]=0x0;ami['on'](_0xae71('0x16'),this[_0xae71('0x17')][_0xae71('0x18')](this));ami['on'](_0xae71('0x19'),this['syncHangup'][_0xae71('0x18')](this));ami['on'](_0xae71('0x1a'),this[_0xae71('0x1b')][_0xae71('0x18')](this));ami['on']('dialend',this[_0xae71('0x1c')][_0xae71('0x18')](this));ami['on']('newexten',this['syncNewExten'][_0xae71('0x18')](this));ami['on'](_0xae71('0x1d'),this[_0xae71('0x1e')][_0xae71('0x18')](this));ami['on'](_0xae71('0x1f'),this[_0xae71('0x20')][_0xae71('0x18')](this));ami['on'](_0xae71('0x21'),this[_0xae71('0x22')][_0xae71('0x18')](this));this['loopCampaigns'](this[_0xae71('0x11')]);}function emit(_0x50d077,_0x13e5f4,_0x2ae262){io['to'](_0x50d077)['emit'](_0x13e5f4,_0x2ae262);}function emitCampaignPreview(_0x44e53a){if(_0x44e53a[_0xae71('0x23')]===_0xae71('0x24')){var _0x403e98={'id':_0x44e53a['id'],'name':_0x44e53a[_0xae71('0x25')],'strategy':_0x44e53a['strategy'],'answered':_0x44e53a[_0xae71('0x26')],'available':_0x44e53a[_0xae71('0x27')],'loggedIn':_0x44e53a['loggedIn'],'pTalking':_0x44e53a[_0xae71('0x28')],'sumBillable':_0x44e53a[_0xae71('0x29')],'sumDuration':_0x44e53a['sumDuration'],'sumHoldTime':_0x44e53a[_0xae71('0x2a')]||0x0,'talking':_0x44e53a[_0xae71('0x2b')],'total':_0x44e53a[_0xae71('0x2c')],'type':_0x44e53a['type'],'unmanaged':_0x44e53a[_0xae71('0x2d')],'abandoned':_0x44e53a[_0xae71('0x2e')],'waiting':_0x44e53a[_0xae71('0x2f')],'loggedInDb':_0x44e53a['loggedInDb'],'dialActive':_0x44e53a[_0xae71('0x30')],'dialMethod':_0x44e53a[_0xae71('0x31')],'dialOriginateCallerIdName':_0x44e53a['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x44e53a[_0xae71('0x32')],'dialOriginateTimeout':_0x44e53a[_0xae71('0x33')],'dialPrefix':_0x44e53a[_0xae71('0x34')],'outboundAnswerAgiCallsDay':_0x44e53a['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x44e53a[_0xae71('0x35')],'outboundBlacklistCallsDay':_0x44e53a[_0xae71('0x36')],'outboundBusyCallsDay':_0x44e53a[_0xae71('0x37')],'outboundCongestionCallsDay':_0x44e53a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x44e53a[_0xae71('0x38')],'outboundDropCallsDayCallersExit':_0x44e53a['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x44e53a[_0xae71('0x39')],'outboundNoAnswerCallsDay':_0x44e53a[_0xae71('0x3a')],'outboundNoSuchCallsDay':_0x44e53a[_0xae71('0x3b')],'outboundOriginateFailureCallsDay':_0x44e53a[_0xae71('0x3c')],'outboundReCallsDay':_0x44e53a['outboundReCallsDay'],'outboundRejectCallsDay':_0x44e53a[_0xae71('0x3d')],'outboundUnknownCallsDay':_0x44e53a[_0xae71('0x3e')],'outboundAbandonedCallsDay':_0x44e53a[_0xae71('0x3f')],'predictiveIntervalAnsweredCalls':_0x44e53a[_0xae71('0x40')],'predictiveIntervalAvgHoldtime':_0x44e53a[_0xae71('0x41')],'predictiveIntervalAvgTalktime':_0x44e53a[_0xae71('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x44e53a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x44e53a[_0xae71('0x43')],'predictiveIntervalErlangCalls':_0x44e53a['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x44e53a[_0xae71('0x44')],'predictiveIntervalHitRate':_0x44e53a['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x44e53a[_0xae71('0x45')],'predictiveIntervalPauses':_0x44e53a[_0xae71('0x46')],'predictiveIntervalAvailable':_0x44e53a[_0xae71('0x47')],'predictiveIntervalTotalCalls':_0x44e53a[_0xae71('0x48')],'message':_0x44e53a[_0xae71('0x49')],'originated':_0x44e53a[_0xae71('0x4a')],'erlangCalls':_0x44e53a[_0xae71('0x4b')],'erlangCallToSecond':_0x44e53a[_0xae71('0x4c')],'erlangAbandonmentRate':_0x44e53a[_0xae71('0x4d')],'erlangBusyFactor':_0x44e53a[_0xae71('0x4e')],'startPredictive':_0x44e53a[_0xae71('0x4f')],'startProgressive':_0x44e53a[_0xae71('0x50')]};if(_0x44e53a[_0xae71('0x51')]){_0x403e98['Trunk']={'id':_0x44e53a[_0xae71('0x51')]['id'],'name':_0x44e53a[_0xae71('0x51')][_0xae71('0x25')],'active':_0x44e53a['Trunk'][_0xae71('0x52')],'callerid':_0x44e53a[_0xae71('0x51')][_0xae71('0x53')]};}if(_0x44e53a['Interval']){_0x403e98[_0xae71('0x54')]={'id':_0x44e53a[_0xae71('0x54')]['id'],'name':_0x44e53a[_0xae71('0x54')]['name']};}var _0x54c774=md5(JSON['stringify'](_0x403e98));if(_0x44e53a[_0xae71('0x3')]!==_0x54c774){_0x44e53a[_0xae71('0x3')]=_0x54c774;emit(util[_0xae71('0x55')]('voice:queue:%s',_0x403e98[_0xae71('0x25')]),_0xae71('0x56'),_0x403e98);}}}function emitVoiceQueueChannelRemove(_0x5e7047){logger[_0xae71('0x57')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x5e7047));emit(util[_0xae71('0x55')](_0xae71('0x58'),_0x5e7047[_0xae71('0x25')]),'voice_queue_channel:remove',_0x5e7047);io[_0xae71('0x59')]('voice_queue_presence:remove',_0x5e7047);}function notSendMessagesQueue(_0x144e13){if(_0x144e13['sendMessageOneNotActive']){if(_0x144e13[_0xae71('0x4a')]===0x0&&_0x144e13['pTalking']===0x0){_0x144e13[_0xae71('0x5a')]=![];_0x144e13[_0xae71('0x27')]=0x0;_0x144e13['paused']=0x0;_0x144e13[_0xae71('0x49')]=_0xae71('0x5b');ut[_0xae71('0x5c')](_0xae71('0x5d'),_0x144e13[_0xae71('0x25')]+_0xae71('0x5e'));}else{_0x144e13['message']='DEACTIVATED';ut[_0xae71('0x5c')](_0xae71('0x5d'),_0x144e13['name']+'\x20is\x20deactivated');}emitCampaignPreview(_0x144e13);}}Preview[_0xae71('0xe')][_0xae71('0x5f')]=function(){var _0x2dbe9d=this;setInterval(function(){_0x2dbe9d[_0xae71('0x60')]();},0x7cf);};Preview['prototype'][_0xae71('0x60')]=function(){var _0x2ed038=this[_0xae71('0x11')];this[_0xae71('0x15')]+=0x1;for(var _0x4161a5 in _0x2ed038){if(_0x2ed038['hasOwnProperty'](_0x4161a5)&&(_0x2ed038[_0x4161a5][_0xae71('0x31')]==='preview'||_0x2ed038[_0x4161a5]['dialMethod']===_0xae71('0x61'))&&_0x2ed038[_0x4161a5][_0xae71('0x23')]==='outbound'){if(this[_0xae71('0x15')]>0x7){this[_0xae71('0x15')]=0x0;this[_0xae71('0x62')]();}}if(_0x2ed038[_0xae71('0x63')](_0x4161a5)&&_0x2ed038[_0x4161a5]['dialMethod']===_0xae71('0x5')&&_0x2ed038[_0x4161a5][_0xae71('0x23')]===_0xae71('0x24')){if(_0x2ed038[_0x4161a5]['dialActive']){this[_0xae71('0x64')](_0x2ed038[_0x4161a5]);if(_0x2ed038[_0x4161a5][_0xae71('0x65')])this[_0xae71('0x66')](_0x2ed038[_0x4161a5]);}else{notSendMessagesQueue(_0x2ed038[_0x4161a5]);}}}};Preview[_0xae71('0xe')][_0xae71('0x67')]=function(_0x15756f){var _0x3c28ab=this;this['sequence'][_0xae71('0xf')](function(){if(!_[_0xae71('0x68')](_0x3c28ab[_0xae71('0x69')][_0x15756f])){loggerAction[_0xae71('0x57')]('[clearZombieChannels][talking]',_0x15756f,_0xae71('0x6a'),_0x3c28ab[_0xae71('0x69')][_0x15756f]['queue'],_0xae71('0x6b'),JSON[_0xae71('0x6c')](_0x3c28ab[_0xae71('0x11')][_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6d')]][_0xae71('0x4a')]),'pTalking:\x20',JSON[_0xae71('0x6c')](_0x3c28ab[_0xae71('0x11')][_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6d')]][_0xae71('0x28')]),JSON[_0xae71('0x6c')](_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6e')]),JSON[_0xae71('0x6c')](_['pick'](_0x3c28ab[_0xae71('0x69')][_0x15756f],[_0xae71('0x6f'),_0xae71('0x70'),'VoiceQueueId',_0xae71('0x71')])));return ami[_0xae71('0x72')]({'action':_0xae71('0x73'),'channel':_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x74')]})['catch'](function(_0x19197b){if(_0x19197b['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x3c28ab['actions'][_0x15756f]){ut[_0xae71('0x75')](_0x3c28ab['campaignsPreview'][_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6d')]],_0xae71('0x76'));if(_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6e')]===!![]){ut['decrementTalkink'](_0x3c28ab[_0xae71('0x11')][_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6d')]],_0xae71('0x76'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x15756f,_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6d')]);}ut[_0xae71('0x77')](_0xae71('0x78')+_0x15756f,_0x3c28ab[_0xae71('0x69')][_0x15756f][_0xae71('0x6d')]);delete _0x3c28ab[_0xae71('0x69')][_0x15756f];}},0x2328);}});}});};Preview[_0xae71('0xe')]['clearZombieChannels']=function(){var _0x5ea02d=this;loggerAction[_0xae71('0x57')](_0xae71('0x79'),_[_0xae71('0x7a')](this[_0xae71('0x69')]));for(var _0x17a4b0 in this['actions']){if(_0x5ea02d['actions'][_0xae71('0x63')](_0x17a4b0)){_0x5ea02d[_0xae71('0x67')](_0x17a4b0);}}};Preview[_0xae71('0xe')][_0xae71('0x66')]=function(_0x5e779a){var _0x5595cf=this;rpcDb['getContactRecallMe'](_0x5e779a['id'],ut[_0xae71('0x7b')](this['agents']))[_0xae71('0x7c')](function(_0x1fa510){if(!_[_0xae71('0x68')](_0x1fa510)){for(var _0x4ba944=0x0;_0x4ba944<_0x1fa510[_0xae71('0x7d')];_0x4ba944+=0x1){if(ut[_0xae71('0x7e')](_0x1fa510[_0x4ba944][_0xae71('0x7f')])<_0x5e779a[_0xae71('0x80')]*0x3c){if(_0x1fa510[_0x4ba944][_0xae71('0x81')]&&!_0x1fa510[_0x4ba944][_0xae71('0x81')][_0xae71('0x82')]){_0x5595cf[_0xae71('0x83')](_0x1fa510[_0x4ba944]['id'])[_0xae71('0x7c')](ut['logger2'](_0xae71('0x84')))[_0xae71('0x85')](ut[_0xae71('0x86')]('[RecallMe]'));}else{rpcDb[_0xae71('0x87')](_0x1fa510[_0x4ba944]['id']);}}else{var _0x1c29fb=new Action(_0x1fa510[_0x4ba944],_0x5e779a);_0x1c29fb[_0xae71('0x88')]=moment()[_0xae71('0x55')](_0xae71('0x89'));_0x5e779a['outboundReCallsDay']+=0x1;ut[_0xae71('0x8a')](_0x1c29fb,0x17,_0xae71('0x8b'));if(_0x5e779a[_0xae71('0x8c')]){rpcDb[_0xae71('0x8d')](ut['createBody'](_0x1fa510[_0x4ba944]));rpcDb['createCustomerHistory'](_0x1c29fb,_0xae71('0x8e'));}else{ut[_0xae71('0x8a')](_0x1c29fb,0x16,_0xae71('0x8f'));rpcDb[_0xae71('0x90')](_0x1c29fb,_0xae71('0x91'));rpcDb[_0xae71('0x92')](_0x1c29fb,_0xae71('0x91'));}}}}})[_0xae71('0x85')](ut['logger2'](_0xae71('0x93')));};Preview['prototype'][_0xae71('0x64')]=function(_0x559249){_0x559249[_0xae71('0x5a')]=!![];if(ut[_0xae71('0x94')](_0x559249[_0xae71('0x95')])){_0x559249[_0xae71('0x49')]=_0xae71('0x96');}else if(!ut[_0xae71('0x97')](_0x559249['dialActive'])){_0x559249[_0xae71('0x49')]=_0xae71('0x5b');}else if(!this[_0xae71('0x98')](_0x559249[_0xae71('0x51')])){if(!this[_0xae71('0x98')](_0x559249[_0xae71('0x99')])){_0x559249[_0xae71('0x49')]=_0xae71('0x9a');}else{_0x559249[_0xae71('0x49')]=_0xae71('0x9b');}}else{_0x559249[_0xae71('0x49')]=_0xae71('0x9b');}emitCampaignPreview(_0x559249);};Preview[_0xae71('0xe')]['callProgressDetectingCustomer']=function(_0x19deee,_0x2b3f6e,_0x311a2b){var _0x249c0d=this;var _0x5480a0=this[_0xae71('0x69')][_0x2b3f6e];var _0x186870=this['campaignsPreview'][_0x5480a0[_0xae71('0x6d')]];var _0x485660;var _0x59c6fd=![];var _0x3d3c7b=0x2;var _0x216923=0x3;if(_0x186870){switch(_0x311a2b){case'1':_0x186870['outboundNoSuchCallsDay']+=0x1;_0x5480a0[_0xae71('0x9c')]+=0x1;_0x5480a0[_0xae71('0x9d')]=ut['totalGlobal'](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x0,'NoSuchNumber');ami[_0xae71('0x59')](_0xae71('0x9e'),ut[_0xae71('0x9f')](_0x5480a0,_0xae71('0xa0')));rpcDb['createCustomerHistory'](_0x5480a0,'[callProgressDetectingCustomer][logNoSuch]');_0x249c0d[_0xae71('0xa1')](_0x5480a0,'0',_0x186870)[_0xae71('0x7c')](function(_0x4fc76e){_0x59c6fd=_0x4fc76e[_0xae71('0xa2')]==0x1;_0x3d3c7b=_0x186870['dialNoSuchNumberRetryFrequency'];_0x216923=_0x186870['callAdditionalPhoneAfterMin'];if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870['dialGlobalMaxRetry']){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0xf,_0xae71('0xa5'));rpcDb[_0xae71('0x92')](_0x485660,_0xae71('0xa6'));}else{if(_0x5480a0[_0xae71('0x9c')]>=_0x186870[_0xae71('0xa7')]){rpcDb[_0xae71('0x92')](_0x5480a0,_0xae71('0xa6'));}else{rpcDb[_0xae71('0xa8')](ut[_0xae71('0xa9')](_0x5480a0,_0xae71('0x9c'),_0x186870[_0xae71('0xaa')]),_0x5480a0[_0xae71('0xab')],_0x5480a0['activeContact']);}}delete this[_0xae71('0x69')][_0x19deee[_0xae71('0xac')]];}else{_0x5480a0['countnosuchnumberretry']++;logger[_0xae71('0x57')]('actioncountonusuch',_0x5480a0[_0xae71('0x9c')]);logger['info']('id',_0x5480a0['idContact']);_0x249c0d[_0xae71('0xad')]({'id':_0x5480a0[_0xae71('0xae')],'field':{'countnosuchnumberretry':_0x5480a0[_0xae71('0x9c')]}})[_0xae71('0x7c')](function(){_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)[_0xae71('0x7c')](function(){});});}});break;case _0xae71('0xb0'):var _0x4d485b=moment()[_0xae71('0x55')](_0xae71('0x89'));_0x5480a0[_0xae71('0xb1')]=_0x4d485b;_0x5480a0[_0xae71('0xb2')]=_0x4d485b;_0x5480a0[_0xae71('0x6e')]=!![];_0x186870[_0xae71('0x28')]+=0x1;logger[_0xae71('0x57')](_0xae71('0xb3'),_0x5480a0['uniqueid'],_0xae71('0xb4'),_0x186870[_0xae71('0x25')],_0xae71('0xb5'),_0x186870[_0xae71('0x28')]);ami[_0xae71('0x59')](_0xae71('0xb6'),ut[_0xae71('0x9f')](_0x5480a0,'connect',this[_0xae71('0x11')][_0x5480a0[_0xae71('0x6d')]]));if(_0x186870[_0xae71('0xb7')]){ami[_0xae71('0x59')](_0xae71('0xb8'),ut[_0xae71('0xb9')](_0x5480a0));}break;case'16':ami[_0xae71('0x59')](_0xae71('0xba'),ut[_0xae71('0x9f')](_0x5480a0,_0xae71('0xbb'),this['campaignsPreview'][_0x5480a0[_0xae71('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0xae71('0x9f')](_0x5480a0,_0xae71('0xbb')));_0x186870[_0xae71('0x35')]+=0x1;_0x186870['total']+=0x1;_0x186870[_0xae71('0x26')]+=0x1;ut[_0xae71('0xbc')](_0x186870,'[16]');_0x5480a0[_0xae71('0x9d')]=ut[_0xae71('0xa3')](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x4,_0xae71('0xbd'));rpcDb[_0xae71('0x90')](_0x5480a0,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xae71('0x92')](_0x5480a0,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xae71('0xbe')](_0x5480a0);_0x186870['sumDuration']+=_0x5480a0['talktime'];_0x186870[_0xae71('0x29')]+=_0x5480a0[_0xae71('0xbf')];logger[_0xae71('0x57')]('[syncHangup][talking][decrement]',_0x5480a0[_0xae71('0xc0')],_0xae71('0xb4'),_0x186870['name'],_0xae71('0xb5'),_0x186870[_0xae71('0x28')]);delete this['actions'][_0x19deee[_0xae71('0xac')]];break;case'BUSY':_0x186870[_0xae71('0x37')]+=0x1;_0x5480a0[_0xae71('0xc1')]+=0x1;_0x5480a0[_0xae71('0x9d')]=ut[_0xae71('0xa3')](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x5,'Busy');_0x3d3c7b=_0x186870[_0xae71('0xc2')];_0x216923=_0x186870[_0xae71('0xc3')];ami[_0xae71('0x59')]('custom:agentbusy',ut[_0xae71('0x9f')](_0x5480a0,'busy'));rpcDb[_0xae71('0x90')](_0x5480a0,_0xae71('0xc4'));_0x249c0d[_0xae71('0xa1')](_0x5480a0,'5',_0x186870)[_0xae71('0x7c')](function(_0x10fa8b){_0x59c6fd=_0x10fa8b[_0xae71('0xa2')]==0x1;if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870[_0xae71('0xc5')]){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0xf,_0xae71('0xa5'));rpcDb[_0xae71('0x92')](_0x485660,_0xae71('0xc6'));}else{if(_0x5480a0[_0xae71('0xc1')]>=_0x186870[_0xae71('0xc7')]){rpcDb[_0xae71('0x92')](_0x5480a0,_0xae71('0xc4'));}else{rpcDb[_0xae71('0xa8')](ut[_0xae71('0xa9')](_0x5480a0,_0xae71('0xc1'),_0x186870[_0xae71('0xc2')]),_0x5480a0[_0xae71('0xab')],_0x5480a0[_0xae71('0xc8')]);}}}else{_0x5480a0[_0xae71('0xc1')]++;_0x249c0d['incrementPreviewCounters']({'id':_0x5480a0[_0xae71('0xae')],'field':{'countbusyretry':_0x5480a0[_0xae71('0xc1')]}})[_0xae71('0x7c')](function(){_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)[_0xae71('0x7c')](function(){});});}});break;case _0xae71('0xc9'):_0x186870[_0xae71('0x3a')]+=0x1;_0x5480a0[_0xae71('0xca')]+=0x1;_0x5480a0['countglobal']=ut[_0xae71('0xa3')](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x3,_0xae71('0xcb'));_0x3d3c7b=_0x186870[_0xae71('0xcc')];_0x216923=_0x186870[_0xae71('0xc3')];var _0x4d413f=ut['buildNoAnswerEventPayload'](_0x5480a0,_0x186870);ami['emit']('custom:agentnoanswer',_0x4d413f);rpcDb[_0xae71('0x90')](_0x5480a0,_0xae71('0xcd'));_0x249c0d[_0xae71('0xa1')](_0x5480a0,'3',_0x186870)[_0xae71('0x7c')](function(_0x2a3bc8){_0x59c6fd=_0x2a3bc8[_0xae71('0xa2')]==0x1;if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870[_0xae71('0xc5')]){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0xf,_0xae71('0xa5'));rpcDb[_0xae71('0x92')](_0x485660,_0xae71('0xce'));}else{if(_0x5480a0[_0xae71('0xca')]>=_0x186870[_0xae71('0xcf')]){rpcDb[_0xae71('0x92')](_0x5480a0,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0xae71('0xa9')](_0x5480a0,'countnoanswerretry',_0x186870[_0xae71('0xcc')]),_0x5480a0[_0xae71('0xab')],_0x5480a0[_0xae71('0xc8')]);}}}else{_0x5480a0[_0xae71('0xca')]++;_0x249c0d[_0xae71('0xad')]({'id':_0x5480a0[_0xae71('0xae')],'field':{'countnoanswerretry':_0x5480a0[_0xae71('0xca')]}})[_0xae71('0x7c')](function(){_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)[_0xae71('0x7c')](function(){});});}});break;case _0xae71('0xd0'):_0x186870[_0xae71('0xd1')]+=0x1;_0x5480a0[_0xae71('0xd2')]+=0x1;_0x5480a0[_0xae71('0x9d')]=ut[_0xae71('0xa3')](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x8,_0xae71('0xd3'));_0x3d3c7b=_0x186870[_0xae71('0xd4')];_0x216923=_0x186870[_0xae71('0xc3')];ami['emit']('custom:agentcongestion',ut[_0xae71('0x9f')](_0x5480a0,'congestion'));rpcDb['createCustomerHistory'](_0x5480a0,_0xae71('0xd5'));_0x249c0d[_0xae71('0xa1')](_0x5480a0,'8',_0x186870)['then'](function(_0xb7f33c){_0x59c6fd=_0xb7f33c[_0xae71('0xa2')]==0x1;if(!_0x59c6fd){if(ut['totalGlobal'](_0x5480a0)>=_0x186870[_0xae71('0xc5')]){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0xf,_0xae71('0xa5'));rpcDb[_0xae71('0x92')](_0x485660,_0xae71('0xd6'));}else{if(_0x5480a0['countcongestionretry']>=_0x186870[_0xae71('0xd7')]){rpcDb[_0xae71('0x92')](_0x5480a0,_0xae71('0xd5'));}else{rpcDb[_0xae71('0xa8')](ut[_0xae71('0xa9')](_0x5480a0,'countcongestionretry',_0x186870[_0xae71('0xc2')]),_0x5480a0['unlockAgent'],_0x5480a0[_0xae71('0xc8')]);}}}else{_0x5480a0[_0xae71('0xd2')]++;_0x249c0d[_0xae71('0xad')]({'id':_0x5480a0['idContact'],'field':{'countcongestionretry':_0x5480a0[_0xae71('0xd2')]}})['then'](function(){_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)[_0xae71('0x7c')](function(){});});}});break;case _0xae71('0xd8'):_0x186870[_0xae71('0x3d')]+=0x1;_0x5480a0['countagentrejectretry']+=0x1;_0x5480a0[_0xae71('0x9d')]=ut[_0xae71('0xa3')](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x14,_0xae71('0xd9'));_0x3d3c7b=_0x186870[_0xae71('0xda')];_0x216923=_0x186870[_0xae71('0xc3')];ami[_0xae71('0x59')](_0xae71('0xdb'),ut[_0xae71('0x9f')](_0x5480a0,'agentreject'));rpcDb[_0xae71('0x90')](_0x5480a0,_0xae71('0xdc'));_0x249c0d['verifyAdditionalPhones'](_0x5480a0,'20',_0x186870)[_0xae71('0x7c')](function(_0x5b8596){_0x59c6fd=_0x5b8596[_0xae71('0xa2')]==0x1;if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870['dialGlobalMaxRetry']){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0x14,_0xae71('0xd9'));rpcDb['createCustomerFinal'](_0x485660,_0xae71('0xdd'));}else{if(_0x5480a0[_0xae71('0xde')]>=_0x186870[_0xae71('0xdf')]){rpcDb['createCustomerFinal'](_0x5480a0,_0xae71('0xdd'));}else{rpcDb[_0xae71('0xa8')](ut['scheduledAt'](_0x5480a0,'countagentrejectretry',_0x186870[_0xae71('0xda')]),_0x5480a0[_0xae71('0xab')],_0x5480a0[_0xae71('0xc8')]);}}}else{_0x5480a0[_0xae71('0xca')]++;_0x249c0d['incrementPreviewCounters']({'id':_0x5480a0[_0xae71('0xae')],'field':{'countnoanswerretry':_0x5480a0[_0xae71('0xca')]}})['then'](function(){_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)['then'](function(){});});}});break;case _0xae71('0xe0'):_0x186870[_0xae71('0x3f')]+=0x1;_0x5480a0[_0xae71('0xe1')]+=0x1;_0x5480a0[_0xae71('0x9d')]=ut['totalGlobal'](_0x5480a0);ut['logCustomer'](_0x5480a0,0xb,_0xae71('0xe2'));rpcDb[_0xae71('0x90')](_0x5480a0,_0xae71('0xe3'));_0x249c0d[_0xae71('0xa1')](_0x5480a0,'11',_0x186870)[_0xae71('0x7c')](function(_0x3d652f){_0x59c6fd=_0x3d652f['additional']==0x1;if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870[_0xae71('0xc5')]){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0xf,'Global');rpcDb['createCustomerFinal'](_0x485660,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x5480a0[_0xae71('0xe4')]>=_0x186870['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x5480a0,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xae71('0xa8')](ut[_0xae71('0xa9')](_0x5480a0,_0xae71('0xe1'),_0x186870['dialAbandonedRetryFrequency']),_0x5480a0[_0xae71('0xab')],_0x5480a0[_0xae71('0xc8')]);}}}else{_0x5480a0[_0xae71('0xca')]++;_0x249c0d[_0xae71('0xad')]({'id':_0x5480a0[_0xae71('0xae')],'field':{'countnoanswerretry':_0x5480a0[_0xae71('0xca')]}})[_0xae71('0x7c')](function(){_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)[_0xae71('0x7c')](function(){});});}});break;case'18':_0x186870[_0xae71('0x3e')]+=0x1;_0x5480a0['countmachineretry']+=0x1;_0x5480a0[_0xae71('0x9d')]=ut[_0xae71('0xa3')](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x12,_0x19deee[_0xae71('0xe5')]||_0x19deee[_0xae71('0xe6')]);ami['emit'](_0xae71('0xe7'),ut[_0xae71('0x9f')](_0x5480a0,_0xae71('0xe8')));rpcDb['createCustomerHistory'](_0x5480a0,'[callProgressDetectingCustomer][hangupInAMD]');_0x249c0d['verifyAdditionalPhones'](_0x5480a0,'18',_0x186870)[_0xae71('0x7c')](function(_0x2002c7){_0x59c6fd=_0x2002c7[_0xae71('0xa2')]==0x1;if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870[_0xae71('0xc5')]){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0x12,_0xae71('0xa5'));rpcDb[_0xae71('0x92')](_0x485660,_0xae71('0xe9'));}else{rpcDb[_0xae71('0x92')](_0x5480a0,_0xae71('0xe9'));}}else{_0x5480a0[_0xae71('0xca')]++;_0x249c0d[_0xae71('0xad')]({'id':_0x5480a0['idContact'],'field':{'countnoanswerretry':_0x5480a0[_0xae71('0xca')]}})[_0xae71('0x7c')](function(){_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)['then'](function(){});});}});delete this[_0xae71('0x69')][_0x19deee['linkedid']];break;case'19':_0x186870['outboundUnknownCallsDay']+=0x1;_0x5480a0[_0xae71('0x9d')]=ut[_0xae71('0xa3')](_0x5480a0);ut[_0xae71('0x8a')](_0x5480a0,0x13,_0x19deee['cause-txt']||_0x19deee[_0xae71('0xe6')]);ami[_0xae71('0x59')](_0xae71('0xe7'),ut[_0xae71('0x9f')](_0x5480a0,_0xae71('0xe8')));rpcDb[_0xae71('0x90')](_0x5480a0,_0xae71('0xea'));_0x249c0d[_0xae71('0xa1')](_0x5480a0,'18',_0x186870)[_0xae71('0x7c')](function(_0x8c54e2){_0x59c6fd=_0x8c54e2['additional']==0x1;if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870[_0xae71('0xc5')]){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0xf,_0xae71('0xa5'));rpcDb['createCustomerFinal'](_0x485660,_0xae71('0xea'));}else{rpcDb[_0xae71('0x92')](_0x5480a0,_0xae71('0xea'));}}else{_0x5480a0[_0xae71('0xca')]++;_0x249c0d[_0xae71('0xad')]({'id':_0x5480a0[_0xae71('0xae')],'field':{'countnoanswerretry':_0x5480a0[_0xae71('0xca')]}})[_0xae71('0x7c')](function(){_0x249c0d['swapAdditionalPhones'](_0x5480a0,_0x3d3c7b,_0x216923)[_0xae71('0x7c')](function(){});});}});delete this[_0xae71('0x69')][_0x19deee[_0xae71('0xac')]];break;default:if(_0x5480a0[_0xae71('0x6e')]){ut[_0xae71('0xbc')](_0x186870,_0xae71('0xeb'));ut[_0xae71('0x77')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x186870[_0xae71('0x25')],_0x19deee);}_0x186870[_0xae71('0x3e')]+=0x1;_0x5480a0['countglobal']=ut['totalGlobal'](_0x5480a0);ut['logCustomer'](_0x5480a0,0xc,_0x19deee[_0xae71('0xe5')]||_0x19deee[_0xae71('0xe6')]);_0x3d3c7b=_0x186870[_0xae71('0xda')];_0x216923=_0x186870[_0xae71('0xc3')];rpcDb[_0xae71('0x90')](_0x5480a0,_0xae71('0xec'));_0x249c0d['verifyAdditionalPhones'](_0x5480a0,'20',_0x186870)[_0xae71('0x7c')](function(_0x6e6fe8){_0x59c6fd=_0x6e6fe8[_0xae71('0xa2')]==0x1;if(!_0x59c6fd){if(ut[_0xae71('0xa3')](_0x5480a0)>=_0x186870[_0xae71('0xc5')]){_0x485660=ut[_0xae71('0xa4')](_0x5480a0,0xf,'Global');rpcDb[_0xae71('0x92')](_0x485660,_0xae71('0xed'));}else{rpcDb[_0xae71('0x92')](_0x5480a0,_0xae71('0xed'));}delete this['actions'][_0x19deee['linkedid']];}else{_0x249c0d[_0xae71('0xaf')](_0x5480a0,_0x3d3c7b,_0x216923)[_0xae71('0x7c')](function(){});}});}if(!(_0x5480a0['dialAnswer']&&_0x311a2b==='16')){ut['updateOriginated'](_0x186870,_0xae71('0xee'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x5480a0[_0xae71('0xc0')],_0xae71('0xb4'),_0x186870[_0xae71('0x25')],_0xae71('0x6b'),_0x186870[_0xae71('0x4a')]);}if(_0x311a2b!==_0xae71('0xb0')){delete this[_0xae71('0x69')][_0x19deee['linkedid']];delete this[_0xae71('0x69')][_0x19deee[_0xae71('0xef')]];}}};Preview[_0xae71('0xe')][_0xae71('0xf0')]=function(_0x100ee1,_0x4d5bca,_0x40e457){if(_[_0xae71('0xf1')](_0x4d5bca)&&_0xae71('0xf2')!==typeof _0x4d5bca){return;}if(_[_0xae71('0xf1')](_0x40e457)&&_0xae71('0xf2')!==typeof _0x40e457){return;}switch(_0x40e457[_0xae71('0xf3')]){case'0':ut[_0xae71('0xf4')](_0x100ee1,0x0,_0xae71('0xf5'));rpcDb['createAgentHistory'](_0x100ee1,_0xae71('0xf6'));break;case'3':ut[_0xae71('0xf4')](_0x100ee1,0x3,_0xae71('0xcb'));rpcDb[_0xae71('0xf7')](_0x100ee1,_0xae71('0xf8'));break;case'5':ut[_0xae71('0xf4')](_0x100ee1,0x5,_0xae71('0xf9'));rpcDb[_0xae71('0xf7')](_0x100ee1,_0xae71('0xfa'));break;case'8':ut[_0xae71('0xf4')](_0x100ee1,0x8,'Congestion');rpcDb['createAgentHistory'](_0x100ee1,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x100ee1,0x16,_0xae71('0xfb'));rpcDb[_0xae71('0xf7')](_0x100ee1,_0xae71('0xfc'));break;default:ut['logAgent'](_0x100ee1,0xc,_0x40e457[_0xae71('0xf3')]);rpcDb[_0xae71('0xf7')](_0x100ee1,_0xae71('0xfd'));}ut['updateOriginated'](_0x4d5bca,_0xae71('0xfe'));logger[_0xae71('0x57')]('[originated][decrement][callProgressDetectingAgent]',_0x100ee1[_0xae71('0xc0')],_0xae71('0xb4'),_0x4d5bca[_0xae71('0x25')],'originated:\x20',_0x4d5bca[_0xae71('0x4a')]);delete this[_0xae71('0x69')][_0x100ee1[_0xae71('0xc0')]];};Preview[_0xae71('0xe')][_0xae71('0xa1')]=function(_0x44bbac,_0x4cd0ec,_0x3b5e94){return Promise['resolve']()[_0xae71('0x7c')](cmHopperAdditionalPhone[_0xae71('0xa1')](_0x44bbac,_0x4cd0ec,_0x3b5e94))[_0xae71('0x85')](logger[_0xae71('0x57')](_0xae71('0xff')));};Preview[_0xae71('0xe')][_0xae71('0xaf')]=function(_0x263754,_0x58cb21,_0x23b9fa){return Promise[_0xae71('0x100')]()[_0xae71('0x7c')](cmHopperAdditionalPhone[_0xae71('0xaf')](_0x263754,_0x58cb21,_0x23b9fa))[_0xae71('0x85')](logger['info'](_0xae71('0x101')));};Preview[_0xae71('0xe')][_0xae71('0xad')]=function(_0x1331ea){return Promise['resolve']()[_0xae71('0x7c')](cmHopperAdditionalPhone[_0xae71('0xad')](_0x1331ea))[_0xae71('0x85')](logger[_0xae71('0x57')]('[incrementPreviewCounters]\x20'));};Preview[_0xae71('0xe')]['checkInBlack']=function(_0x4bd9f2,_0x1c898d,_0x37c1ca,_0x26bc13,_0x3de370){var _0x50f9e2=this;return new Promise(function(_0x312dfb,_0x5f4863){if(_[_0xae71('0x68')](_0x1c898d)||_['isNil'](_0x1c898d[_0xae71('0x102')])||_[_0xae71('0x68')](_0x1c898d[_0xae71('0x103')])||_[_0xae71('0x68')](_0x1c898d[_0xae71('0x104')])){_0x5f4863(ut[_0xae71('0x49')]('Contact\x20is\x20undefined',_0x26bc13,_0x3de370));return;}var _0x39a9af=uuid['v4']();var _0x158897=_0x50f9e2[_0xae71('0x11')][_0x1c898d['Queue'][_0xae71('0x25')]];var _0x878cdf=_0x37c1ca?_0x50f9e2[_0xae71('0x14')][_0x37c1ca]['id']:undefined;_0x50f9e2[_0xae71('0x69')][_0x39a9af]=new Action(_0x1c898d,_0x158897,_0x39a9af,_0x37c1ca,_0x878cdf);var _0x3c2f67=_0x50f9e2[_0xae71('0x69')][_0x39a9af];_0x3c2f67[_0xae71('0xab')]=_0x26bc13;_0x3c2f67[_0xae71('0xc8')]=_0x3de370;_0x3c2f67[_0xae71('0x105')]=_0x37c1ca;if(_[_0xae71('0x106')](_0x4bd9f2)){_0x50f9e2[_0xae71('0x107')](_0x3c2f67,_0x158897,_0x1c898d,_0x37c1ca)[_0xae71('0x7c')](function(_0x385a2c){logger[_0xae71('0x57')](_0xae71('0x108'),_0xae71('0x109')+_0x3c2f67[_0xae71('0x6d')]+_0xae71('0x10a')+_0x3c2f67['idContact'],JSON[_0xae71('0x6c')](_0x385a2c));ami[_0xae71('0x59')](_0xae71('0x10b'),ut[_0xae71('0x9f')](_0x3c2f67,_0xae71('0x10c'),_0x50f9e2['campaignsPreview'][_0x3c2f67[_0xae71('0x6d')]]));_0x312dfb(ut[_0xae71('0x49')](_0xae71('0x10d')));})['catch'](function(_0x43b4e8){ut[_0xae71('0x5c')](_0xae71('0x10e'),_0x43b4e8);_0x5f4863(ut['message'](_0xae71('0x10f'),_0x26bc13,_0x3de370));});}else{_0x158897[_0xae71('0x36')]+=0x1;ut['logBlacklist'](_0x3c2f67);rpcDb[_0xae71('0x110')](_0x3c2f67,_0xae71('0x111'));delete _0x50f9e2[_0xae71('0x69')][_0x39a9af];_0x5f4863(ut['message']('Contact\x20in\x20black\x20List',_0x26bc13,_0x3de370));}});};Preview[_0xae71('0xe')][_0xae71('0x98')]=function(_0x233cff){return!_[_0xae71('0x68')](_0x233cff)&&!_['isNil'](_0x233cff[_0xae71('0x25')])&&!_['isNil'](_0x233cff['active'])&&_0x233cff[_0xae71('0x52')]&&!_[_0xae71('0x68')](this['trunks'][util[_0xae71('0x55')]('SIP/%s',_0x233cff['name'])])&&!_[_0xae71('0x68')](this['trunks'][util['format'](_0xae71('0x112'),_0x233cff['name'])][_0xae71('0x73')])&&(this[_0xae71('0x13')][util['format'](_0xae71('0x112'),_0x233cff[_0xae71('0x25')])][_0xae71('0x73')]===_0xae71('0x113')||this[_0xae71('0x13')][util[_0xae71('0x55')](_0xae71('0x112'),_0x233cff['name'])][_0xae71('0x73')]==='unmonitored');};Preview[_0xae71('0xe')][_0xae71('0x83')]=function(_0x2f1c9f,_0x2bd5b8){var _0x4bf12d=this;return new Promise(function(_0x1cf876,_0xec6bfa){_0x4bf12d['execRun'](_0x2f1c9f,_0x2bd5b8)[_0xae71('0x7c')](function(_0x55a343){_0x1cf876(_['pick'](_0x55a343,[_0xae71('0x49')]));})[_0xae71('0x85')](function(_0xce1ea4){if(_0xce1ea4[_0xae71('0x114')]){rpcDb[_0xae71('0x115')](_0x2f1c9f);}if(_0xce1ea4[_0xae71('0x52')]){rpcDb[_0xae71('0x87')](_0x2f1c9f);}_0xec6bfa(_[_0xae71('0x116')](_0xce1ea4,[_0xae71('0x49')]));});});};Preview[_0xae71('0xe')][_0xae71('0x117')]=function(_0x52dafb,_0x355a0f){var _0xb78ab8=this;return new Promise(function(_0x3acfc4,_0x31034d){var _0x1b7c58,_0x88b1e3;rpcDb[_0xae71('0x118')](_0x52dafb)[_0xae71('0x7c')](function(_0x3534a9){if(!_[_0xae71('0x68')](_0x3534a9[0x0])){_0x88b1e3=_0x3534a9[0x0][_0xae71('0x119')]?![]:!![];_0x1b7c58=_0x3534a9[0x0][_0xae71('0x119')]?!![]:![];_0x1b7c58=_0x355a0f?!![]:_0x1b7c58;}var _0x4b5c44=_0xb78ab8['validateContact'](_0x3534a9);if(_0x4b5c44[_0xae71('0x11a')]){rpcDb[_0xae71('0x11b')](_['pick'](_0x3534a9[0x0],['VoiceQueueId',_0xae71('0x103')]))[_0xae71('0x7c')](function(_0x170156){_0xb78ab8['checkInBlack'](_0x170156,_0x3534a9[0x0],_0x355a0f,_0x88b1e3,_0x1b7c58)[_0xae71('0x7c')](function(_0x3afe67){_0x3acfc4(_0x3afe67);})[_0xae71('0x85')](function(_0x1750fa){_0x31034d(_0x1750fa);});})[_0xae71('0x85')](function(_0x2f8ae4){ut['logger']('[Preview][checkIsBlackList]',_0x2f8ae4);_0x31034d(ut[_0xae71('0x49')]('Call\x20unsuccessful',_0x88b1e3,_0x1b7c58));});}else{_0x31034d(ut['message'](_0x4b5c44[_0xae71('0x49')],_0x88b1e3,_0x1b7c58));}})[_0xae71('0x85')](function(_0x1c5331){ut[_0xae71('0x5c')](_0xae71('0x11c'),_0x1c5331);_0x31034d(ut[_0xae71('0x49')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xae71('0xe')][_0xae71('0x11d')]=function(_0x402e57){if(_['isNil'](_0x402e57)||_[_0xae71('0x106')](_0x402e57)||!_[_0xae71('0x68')](_0x402e57[0x0][_0xae71('0x81')])&&_[_0xae71('0x68')](_0x402e57[0x0][_0xae71('0x81')][_0xae71('0x25')])){ut['logger'](_0xae71('0x11e'),_0x402e57);return{'isValid':![],'message':_0xae71('0x11f')};}var _0x48962d=this[_0xae71('0x11')][_0x402e57[0x0]['Queue']['name']];_0x48962d[_0xae71('0x49')]=_0xae71('0x9b');if(_['isNil'](_0x48962d)){ut[_0xae71('0x5c')](_0xae71('0x120'),_0x48962d);return{'isValid':![],'message':_0xae71('0x121')};}if(!this['isTrunkReachable'](_0x48962d['Trunk'])){ut[_0xae71('0x5c')](_0xae71('0x122'),_0xae71('0x123')+_0x48962d[_0xae71('0x25')]+_0xae71('0x124'));if(!this['isTrunkReachable'](_0x48962d[_0xae71('0x99')])){ut[_0xae71('0x5c')](_0xae71('0x122'),_0x48962d['name']+_0xae71('0x125'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xae71('0x97')](_0x48962d['dialActive'])){ut[_0xae71('0x5c')](_0xae71('0x126'),_0x48962d[_0xae71('0x25')]+_0xae71('0x127'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x48962d['name']+_0xae71('0x127')};}return{'isValid':!![],'message':_0xae71('0x128')};};Preview[_0xae71('0xe')][_0xae71('0x107')]=function(_0x4bf9c0,_0x147c8b,_0x222974,_0x282ee5){var _0x151e1a=this;return new Promise(function(_0x188c37,_0x4e6389){var _0x32f762=_0x4bf9c0['uniqueid'];var _0x4015c1=_0x151e1a[_0xae71('0x98')](_0x147c8b[_0xae71('0x51')])?util[_0xae71('0x55')](_0xae71('0x129'),_0x147c8b[_0xae71('0x51')]['name'],_[_0xae71('0x68')](_0x147c8b[_0xae71('0x34')])?'':_0x147c8b[_0xae71('0x34')][_0xae71('0x12a')]()||'',_0x147c8b[_0xae71('0x12b')]>0x0?_0x222974[_0xae71('0x103')]['substring'](_0x147c8b['dialCutDigit']):_0x222974[_0xae71('0x103')]):util[_0xae71('0x55')]('SIP/%s/%s%s',_[_0xae71('0x68')](_0x147c8b[_0xae71('0x99')])?_0x147c8b['Trunk'][_0xae71('0x25')]:_0x147c8b['TrunkBackup'][_0xae71('0x25')],_[_0xae71('0x68')](_0x147c8b[_0xae71('0x34')])?'':_0x147c8b[_0xae71('0x34')][_0xae71('0x12a')]()||'',_0x147c8b[_0xae71('0x12b')]>0x0?_0x222974[_0xae71('0x103')][_0xae71('0x12c')](_0x147c8b[_0xae71('0x12b')]):_0x222974[_0xae71('0x103')]);var _0x433257=_0x151e1a[_0xae71('0x98')](_0x147c8b['Trunk'])?ut[_0xae71('0x12d')](_0x147c8b[_0xae71('0x51')]['callerid'],_0x147c8b[_0xae71('0x12e')],_0x147c8b[_0xae71('0x12f')]>0x0?ut['getCallerIdRandom'](_0x147c8b[_0xae71('0x32')],_0x147c8b['dialRandomLastDigitCallerIdNumber']):_0x147c8b[_0xae71('0x32')]):ut[_0xae71('0x12d')](_[_0xae71('0x68')](_0x147c8b[_0xae71('0x99')])?_0x147c8b[_0xae71('0x51')][_0xae71('0x53')]:_0x147c8b[_0xae71('0x99')][_0xae71('0x53')],_0x147c8b[_0xae71('0x12e')],_0x147c8b[_0xae71('0x12f')]>0x0?ut['getCallerIdRandom'](_0x147c8b[_0xae71('0x32')],_0x147c8b['dialRandomLastDigitCallerIdNumber']):_0x147c8b[_0xae71('0x32')]);if(_0x433257){_0x4bf9c0[_0xae71('0x130')]=ut['extractCalleridName'](_0x433257);_0x4bf9c0['originatecalleridnum']=ut[_0xae71('0x131')](_0x433257);}var _0x5361fb=ut[_0xae71('0x132')](_0x147c8b,_0x222974,_0x4015c1,_0x433257,_0x32f762,_0x4bf9c0);_['merge'](_0x4bf9c0,ut[_0xae71('0x133')](_0x5361fb));_0x4bf9c0[_0xae71('0x88')]=moment()[_0xae71('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x147c8b[_0xae71('0x134')]=_0x5361fb;ami['Action'](ut['variablesAction'](_0x4bf9c0,_0x147c8b,_0x5361fb,_0x4bf9c0[_0xae71('0xc8')],_0x282ee5))[_0xae71('0x7c')](function(_0x34f172){_0x147c8b[_0xae71('0x4a')]+=0x1;logger[_0xae71('0x57')](_0xae71('0x135'),_0x32f762,'\x20Queue',_0x147c8b[_0xae71('0x25')],_0xae71('0x6b'),_0x147c8b[_0xae71('0x4a')]);_0x188c37(_0x34f172);})[_0xae71('0x85')](function(_0x2516fb){ut[_0xae71('0xf4')](_0x4bf9c0,0xe,_0xae71('0x136'));rpcDb['createAgentHistory'](_0x4bf9c0,_0xae71('0x137'));_0x4e6389(_0x2516fb);});});};Preview[_0xae71('0xe')]['syncNewExten']=function(_0x36431d){if(this[_0xae71('0x69')][_0x36431d[_0xae71('0xac')]]){this['actions'][_0x36431d[_0xae71('0xac')]][_0xae71('0x74')]=_0x36431d[_0xae71('0x74')];}};Preview[_0xae71('0xe')][_0xae71('0x17')]=function(_0x3100b8){var _0x2bff61=this;var _0x4b72f2=this[_0xae71('0x69')][_0x3100b8[_0xae71('0x138')]];if(_0x4b72f2){if(_0x4b72f2['lookAgent']&&this['agents'][_0x4b72f2[_0xae71('0x105')]]){ut[_0xae71('0x139')](_0x4b72f2,this['agents'][_0x4b72f2['lookAgent']][_0xae71('0x25')],this[_0xae71('0x14')][_0x4b72f2[_0xae71('0x105')]]['id']);}var _0xefb7e4=_[_0xae71('0x13a')](_0x4b72f2);_0xefb7e4[_0xae71('0xb1')]=moment()[_0xae71('0x55')](_0xae71('0x89'));var _0x472495=_0x2bff61[_0xae71('0x11')][_0x4b72f2[_0xae71('0x6d')]];if(ut[_0xae71('0x13b')](_0x3100b8['response'])){if(_0x4b72f2['unlockAgent']){rpcDb[_0xae71('0x115')](_0x4b72f2[_0xae71('0xae')]);}if(_0x4b72f2[_0xae71('0xc8')]){rpcDb[_0xae71('0x87')](_0x4b72f2[_0xae71('0xae')]);}ami[_0xae71('0x59')]('custom:agentringnoanswer',ut['buildObj'](_0x4b72f2,_0xae71('0x13c'),this[_0xae71('0x11')][_0x4b72f2['queue']]));this['callProgressDetectingAgent'](_0xefb7e4,_0x472495,_0x3100b8);}else{_0x4b72f2[_0xae71('0x88')]=moment()[_0xae71('0x55')](_0xae71('0x89'));ut[_0xae71('0xf4')](_0xefb7e4,0x4,_0xae71('0xbd'));rpcDb[_0xae71('0xf7')](_0xefb7e4,_0xae71('0x13d'));}}};Preview[_0xae71('0xe')][_0xae71('0x13e')]=function(_0x2c2301){var _0x85cd98=this[_0xae71('0x69')][_0x2c2301[_0xae71('0xac')]];var _0x10000b;if(_0x85cd98){_0x10000b=this[_0xae71('0x11')][_0x85cd98[_0xae71('0x6d')]];logger['info']('[syncHangup][talking]',_0x2c2301[_0xae71('0xac')],'\x20Queue',_0x10000b['name'],_0xae71('0xb5'),_0x10000b[_0xae71('0x28')]);}if(this['actions'][_0x2c2301['linkedid']]&&_0x2c2301[_0xae71('0xac')]!==_0x2c2301[_0xae71('0xc0')]){if(_0x2c2301[_0xae71('0x13f')]==='16'&&this[_0xae71('0x69')][_0x2c2301['linkedid']]['dialAnswer']){this[_0xae71('0x140')](_0x2c2301,_0x2c2301[_0xae71('0xac')],_0x2c2301[_0xae71('0x13f')]);}else if(this[_0xae71('0x69')][_0x2c2301[_0xae71('0xac')]][_0xae71('0x6e')]){logger[_0xae71('0x57')]('[syncHangup][talking][cause]',_0x2c2301['linkedid'],_0x2c2301[_0xae71('0x13f')],_0xae71('0xb4'),_0x10000b[_0xae71('0x25')],_0xae71('0xb5'),_0x10000b[_0xae71('0x28')]);this[_0xae71('0x140')](_0x2c2301,_0x2c2301['linkedid'],_0x2c2301['cause']);}}else if(_0x85cd98&&_['isNil'](_0x85cd98[_0xae71('0x141')])&&_0x10000b[_0xae71('0x142')]&&_0x2c2301[_0xae71('0xac')]===_0x2c2301[_0xae71('0xc0')]&&_['isNil'](_0x2c2301[_0xae71('0xf3')])&&_0x2c2301[_0xae71('0x13f')]==='16'&&_0x2c2301[_0xae71('0x143')]==='6'&&_[_0xae71('0xf1')](_0x85cd98['transfer'])){if(_0x85cd98[_0xae71('0xab')]){rpcDb[_0xae71('0x115')](_0x85cd98[_0xae71('0xae')]);}if(_0x85cd98[_0xae71('0xc8')]){rpcDb[_0xae71('0x87')](_0x85cd98[_0xae71('0xae')]);}_0x2c2301[_0xae71('0xf3')]='22';this[_0xae71('0xf0')](_0x85cd98,_0x10000b,_0x2c2301);}else if(_0x85cd98&&_0x85cd98[_0xae71('0x144')]){if(_0x2c2301[_0xae71('0x13f')]==='16'&&this[_0xae71('0x69')][_0x2c2301[_0xae71('0xac')]][_0xae71('0x6e')]){logger[_0xae71('0x57')]('[syncHangup][talking][transfer]',_0x2c2301[_0xae71('0xac')],_0x2c2301[_0xae71('0x13f')],_0xae71('0xb4'),_0x10000b[_0xae71('0x25')],_0xae71('0xb5'),_0x10000b[_0xae71('0x28')]);this['callProgressDetectingCustomer'](_0x2c2301,_0x2c2301[_0xae71('0xac')],_0x2c2301[_0xae71('0x13f')]);}else if(this['actions'][_0x2c2301['linkedid']][_0xae71('0x6e')]){logger[_0xae71('0x57')](_0xae71('0x145'),_0x2c2301[_0xae71('0xac')],_0x2c2301['cause'],'\x20Queue',_0x10000b[_0xae71('0x25')],'pTalking:\x20',_0x10000b['pTalking']);this['callProgressDetectingCustomer'](_0x2c2301,_0x2c2301[_0xae71('0xac')],_0x2c2301[_0xae71('0x13f')]);}}};Preview['prototype'][_0xae71('0x1c')]=function(_0x1eb3fe){if(this['actions'][_0x1eb3fe[_0xae71('0xef')]]&&_0x1eb3fe[_0xae71('0xef')]!==_0x1eb3fe[_0xae71('0x146')]){this[_0xae71('0x140')](_0x1eb3fe,_0x1eb3fe[_0xae71('0xef')],_0x1eb3fe[_0xae71('0xe6')]);}};Preview['prototype'][_0xae71('0x1b')]=function(_0x535efc){if(this[_0xae71('0x69')][_0x535efc[_0xae71('0xac')]]&&_0x535efc['linkedid']!==_0x535efc['uniqueid']&&!this[_0xae71('0x69')][_0x535efc['linkedid']]['dialAnswer']){if(_0x535efc[_0xae71('0x13f')]==='1'){this[_0xae71('0x140')](_0x535efc,_0x535efc[_0xae71('0xac')],_0x535efc[_0xae71('0x13f')]);}}};Preview[_0xae71('0xe')]['addVariable']=function(_0x5ed107,_0x17a7e9,_0x297373){if(this['actions'][_0x5ed107]){if(_[_0xae71('0x68')](this[_0xae71('0x69')][_0x5ed107][_0xae71('0x134')])){this['actions'][_0x5ed107][_0xae71('0x134')]={};}this[_0xae71('0x69')][_0x5ed107][_0xae71('0x134')][_0x17a7e9]=_0x297373;}};Preview['prototype']['syncVarSet']=function(_0x4da613){try{if(!_[_0xae71('0x68')](_0x4da613)){if(ut['filterKey'](_[_0xae71('0x147')](_0x4da613['variable'])[0x0])){this['addVariable'](_0x4da613[_0xae71('0xc0')],_[_0xae71('0x147')](_0x4da613[_0xae71('0x148')])[0x0],_0x4da613[_0xae71('0x149')]);}}}catch(_0x5d750a){logger['error'](_0xae71('0x14a'),util[_0xae71('0x14b')](_0x5d750a,{'showHidden':![],'depth':null}));}};Preview[_0xae71('0xe')][_0xae71('0x20')]=function(_0x14fe3b){if(_0x14fe3b){if(this['actions'][_0x14fe3b['transfertargetlinkedid']]){this[_0xae71('0x69')][_0x14fe3b[_0xae71('0x14c')]][_0xae71('0x144')]=!![];}}};Preview['prototype'][_0xae71('0x22')]=function(_0x59b313){if(_0x59b313){if(this[_0xae71('0x69')][_0x59b313['transfererlinkedid']]){this['actions'][_0x59b313[_0xae71('0x14d')]][_0xae71('0x144')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 3ac80ee..19a6377 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 _0xf153=['then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','createHistory','[createHistory]\x20','catch'];(function(_0x199500,_0x830a74){var _0x547cbe=function(_0x2d280d){while(--_0x2d280d){_0x199500['push'](_0x199500['shift']());}};_0x547cbe(++_0x830a74);}(_0xf153,0x165));var _0x3f15=function(_0x2f378e,_0x85b30e){_0x2f378e=_0x2f378e-0x0;var _0x1ebee8=_0xf153[_0x2f378e];return _0x1ebee8;};'use strict';var util=require('util');var BPromise=require(_0x3f15('0x0'));var logger=require(_0x3f15('0x1'))(_0x3f15('0x2'));var _=require(_0x3f15('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x3f15('0x4'));var cmHopperHistory=require(_0x3f15('0x5'));var cmHopperBlack=require(_0x3f15('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x3f15('0x7'));var voiceQueueReport=require(_0x3f15('0x8'));function loggerCatch(_0x412b42){return function(_0x4981a9){logger[_0x3f15('0x9')](_0x412b42,util['inspect'](_0x4981a9,{'showHidden':![],'depth':null}));};}function create(_0x232b37){return BPromise[_0x3f15('0xa')]()['then'](cmHopperHistory[_0x3f15('0xb')](_0x232b37))['catch'](loggerCatch(_0x3f15('0xc')));}function createAgent(_0x5dbf3d){return BPromise[_0x3f15('0xa')]()['then'](agentReportPreview['createHistory'](_0x5dbf3d))[_0x3f15('0xd')](loggerCatch(_0x3f15('0xc')));}function moveContact(_0x5441fd){return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](cmHopper[_0x3f15('0xf')](_0x5441fd,!![]))[_0x3f15('0xd')](loggerCatch(_0x3f15('0x10')));}exports[_0x3f15('0x11')]=function(_0x5c3312){return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](cmHopperBlack[_0x3f15('0x11')](_0x5c3312))[_0x3f15('0xd')](loggerCatch(_0x3f15('0x12')));};exports[_0x3f15('0x13')]=function(_0x20152a){return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](cmHopper['getContactPreview'](_0x20152a))[_0x3f15('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x3f15('0xb')]=function(_0x26365e,_0x13b6fa){create(_0x26365e)[_0x3f15('0xd')](loggerCatch(_0x13b6fa));moveContact(_0x26365e)[_0x3f15('0xd')](loggerCatch(_0x13b6fa));};exports[_0x3f15('0x14')]=function(_0x3d06da,_0x35ba45){createAgent(_0x3d06da)[_0x3f15('0xd')](loggerCatch(_0x35ba45));};exports[_0x3f15('0x15')]=function(_0x54e245,_0x2b58a1){create(_0x54e245)['catch'](loggerCatch(_0x2b58a1));};exports[_0x3f15('0x16')]=function(_0x1c480f,_0x32d722){moveContact(_0x1c480f)[_0x3f15('0xd')](loggerCatch(_0x32d722));};exports[_0x3f15('0x17')]=function(_0x3bcf44,_0x5dbe79,_0x1f51db){if(_0x5dbe79){_0x3bcf44[_0x3f15('0x18')]=null;}if(_0x1f51db){_0x3bcf44[_0x3f15('0x19')]=![];}return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](cmHopper[_0x3f15('0x17')](_0x3bcf44))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x3f15('0x1a')]=function(_0x4def74){return BPromise[_0x3f15('0xa')]()['then'](cmHopper[_0x3f15('0x1a')](_0x4def74))['catch'](loggerCatch(_0x3f15('0x1b')));};exports[_0x3f15('0x1c')]=function(_0x534d15){return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](cmHopper[_0x3f15('0x1c')]({'UserId':null},_0x534d15,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x3f15('0x1d')]=function(_0x1f1bbb){return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](cmHopper[_0x3f15('0x1c')]({'active':![]},_0x1f1bbb,0x1))[_0x3f15('0xd')](loggerCatch(_0x3f15('0x1e')));};exports['crateCustomerReportQueue']=function(_0x47030d){var _0x1d25c4={};_0x1d25c4[_0x3f15('0x1f')]=_0x47030d['type'];_0x1d25c4[_0x3f15('0x20')]=_0x47030d[_0x3f15('0x20')];_0x1d25c4[_0x3f15('0x21')]=_0x47030d['calleridnum'];_0x1d25c4[_0x3f15('0x22')]=_0x47030d[_0x3f15('0x22')];_0x1d25c4[_0x3f15('0x23')]=_0x47030d[_0x3f15('0x23')];_0x1d25c4['queuecallerjoinAt']=_0x47030d[_0x3f15('0x24')];_0x1d25c4[_0x3f15('0x25')]=_0x47030d[_0x3f15('0x24')];_0x1d25c4[_0x3f15('0x26')]=0x1;_0x1d25c4[_0x3f15('0x27')]=_0x47030d['endtime'];_0x1d25c4[_0x3f15('0x28')]=_0x47030d[_0x3f15('0x29')];_0x1d25c4['context']=_0x3f15('0x2a');_0x1d25c4[_0x3f15('0x2b')]=_0x3f15('0x2c');_0x1d25c4['holdtime']=0x0;_0x1d25c4[_0x3f15('0x2d')]=0x1;_0x1d25c4[_0x3f15('0x2e')]=_0x47030d[_0x3f15('0x29')];_0x1d25c4['queuecallerexitreason']=_0x3f15('0x2f');return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](voiceQueueReport[_0x3f15('0x30')](_0x1d25c4))['catch'](loggerCatch(_0x3f15('0x31')));};exports[_0x3f15('0x32')]=function(_0x21d9dd,_0x230282){return BPromise[_0x3f15('0xa')]()[_0x3f15('0xe')](cmHopper[_0x3f15('0x32')](_0x21d9dd,_0x230282))['catch'](loggerCatch(_0x3f15('0x33')));};exports['rescheduleContactInQueue']=function(_0x6daf6a){return BPromise['resolve']()[_0x3f15('0xe')](cmHopper[_0x3f15('0x17')](_0x6daf6a,!![],!![]))[_0x3f15('0xd')](loggerCatch(_0x3f15('0x34')));}; \ No newline at end of file +var _0xcd36=['holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','then','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview'];(function(_0x7eee7,_0x3779a1){var _0x469f62=function(_0x553717){while(--_0x553717){_0x7eee7['push'](_0x7eee7['shift']());}};_0x469f62(++_0x3779a1);}(_0xcd36,0xf2));var _0x6cd3=function(_0x25959e,_0x4dd8b5){_0x25959e=_0x25959e-0x0;var _0x9b159f=_0xcd36[_0x25959e];return _0x9b159f;};'use strict';var util=require(_0x6cd3('0x0'));var BPromise=require(_0x6cd3('0x1'));var logger=require('../../../config/logger')(_0x6cd3('0x2'));var _=require(_0x6cd3('0x3'));var cmHopper=require(_0x6cd3('0x4'));var cmHopperFinal=require(_0x6cd3('0x5'));var cmHopperHistory=require(_0x6cd3('0x6'));var cmHopperBlack=require(_0x6cd3('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x6cd3('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4698a3){return function(_0x4a94de){logger[_0x6cd3('0x9')](_0x4698a3,util[_0x6cd3('0xa')](_0x4a94de,{'showHidden':![],'depth':null}));};}function create(_0x195da9){return BPromise['resolve']()[_0x6cd3('0xb')](cmHopperHistory[_0x6cd3('0xc')](_0x195da9))['catch'](loggerCatch(_0x6cd3('0xd')));}function createAgent(_0x3b56a7){return BPromise[_0x6cd3('0xe')]()['then'](agentReportPreview[_0x6cd3('0xc')](_0x3b56a7))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0xd')));}function moveContact(_0x4e987e){return BPromise[_0x6cd3('0xe')]()[_0x6cd3('0xb')](cmHopper[_0x6cd3('0x10')](_0x4e987e,!![]))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0x11')));}exports['checkIsBlackList']=function(_0x4c00fb){return BPromise['resolve']()['then'](cmHopperBlack[_0x6cd3('0x12')](_0x4c00fb))['catch'](loggerCatch(_0x6cd3('0x13')));};exports[_0x6cd3('0x14')]=function(_0x4a3a3d){return BPromise[_0x6cd3('0xe')]()[_0x6cd3('0xb')](cmHopper['getContactPreview'](_0x4a3a3d))['catch'](loggerCatch(_0x6cd3('0x15')));};exports[_0x6cd3('0xc')]=function(_0x4cfb36,_0x24ff67){create(_0x4cfb36)['catch'](loggerCatch(_0x24ff67));moveContact(_0x4cfb36)[_0x6cd3('0xf')](loggerCatch(_0x24ff67));};exports[_0x6cd3('0x16')]=function(_0x4290cc,_0x1ea582){createAgent(_0x4290cc)['catch'](loggerCatch(_0x1ea582));};exports[_0x6cd3('0x17')]=function(_0x461ea2,_0x1a823c){create(_0x461ea2)[_0x6cd3('0xf')](loggerCatch(_0x1a823c));};exports['createCustomerFinal']=function(_0x5cbf2d,_0x3a6d1d){moveContact(_0x5cbf2d)['catch'](loggerCatch(_0x3a6d1d));};exports[_0x6cd3('0x18')]=function(_0x4e73c5,_0x2badc9,_0x35b61d){if(_0x2badc9){_0x4e73c5[_0x6cd3('0x19')]=null;}if(_0x35b61d){_0x4e73c5[_0x6cd3('0x1a')]=![];}return BPromise[_0x6cd3('0xe')]()['then'](cmHopper[_0x6cd3('0x18')](_0x4e73c5))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0x1b')));};exports[_0x6cd3('0x1c')]=function(_0x46fe02){return BPromise[_0x6cd3('0xe')]()['then'](cmHopper['countReScheduled'](_0x46fe02))[_0x6cd3('0xf')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x2ebc75){return BPromise['resolve']()[_0x6cd3('0xb')](cmHopper[_0x6cd3('0x1d')]({'UserId':null},_0x2ebc75,0x1))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0x1e')));};exports[_0x6cd3('0x1f')]=function(_0x5a9b71){return BPromise[_0x6cd3('0xe')]()[_0x6cd3('0xb')](cmHopper['unlockContact']({'active':![]},_0x5a9b71,0x1))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0x20')));};exports['crateCustomerReportQueue']=function(_0x31c01a){var _0x4df85d={};_0x4df85d['type']=_0x31c01a['type'];_0x4df85d[_0x6cd3('0x21')]=_0x31c01a['uniqueid'];_0x4df85d[_0x6cd3('0x22')]=_0x31c01a['calleridnum'];_0x4df85d[_0x6cd3('0x23')]=_0x31c01a['calleridname'];_0x4df85d[_0x6cd3('0x24')]=_0x31c01a[_0x6cd3('0x24')];_0x4df85d[_0x6cd3('0x25')]=_0x31c01a['answertime'];_0x4df85d[_0x6cd3('0x26')]=_0x31c01a[_0x6cd3('0x27')];_0x4df85d[_0x6cd3('0x28')]=0x1;_0x4df85d[_0x6cd3('0x29')]=_0x31c01a[_0x6cd3('0x2a')];_0x4df85d['connectedlinename']=_0x31c01a[_0x6cd3('0x2b')];_0x4df85d[_0x6cd3('0x2c')]=_0x6cd3('0x2d');_0x4df85d[_0x6cd3('0x2e')]=_0x6cd3('0x2f');_0x4df85d[_0x6cd3('0x30')]=0x0;_0x4df85d[_0x6cd3('0x31')]=0x1;_0x4df85d['lastAssignedTo']=_0x31c01a[_0x6cd3('0x2b')];_0x4df85d[_0x6cd3('0x32')]=_0x6cd3('0x33');return BPromise[_0x6cd3('0xe')]()[_0x6cd3('0xb')](voiceQueueReport[_0x6cd3('0x34')](_0x4df85d))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0x35')));};exports[_0x6cd3('0x36')]=function(_0x4015e6,_0x500f60){return BPromise[_0x6cd3('0xe')]()[_0x6cd3('0xb')](cmHopper[_0x6cd3('0x36')](_0x4015e6,_0x500f60))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0x37')));};exports[_0x6cd3('0x38')]=function(_0x4643dd){return BPromise[_0x6cd3('0xe')]()[_0x6cd3('0xb')](cmHopper[_0x6cd3('0x18')](_0x4643dd,!![],!![]))[_0x6cd3('0xf')](loggerCatch(_0x6cd3('0x39')));}; \ 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 526c4f0..226403d 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 _0x5a53=['ringtime','logLookAgent','membername','logCustomer','starttime','talktime','answertime','Failure','RECALL','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countnosuchnumberretry','cloneAction','clone','Global','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','channelAgent','not_inuse','status','reachable','push','getDiff','createBody','idContact','type','campaigntype','dialAnswer','active','scheduledat','countcongestionretry','countnoanswerretry','countglobal','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','info','loggerError','inspect','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','format','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','responsetime','endtime','logAgent','statedesc'];(function(_0x13d1a5,_0x396344){var _0x2639a5=function(_0x141e49){while(--_0x141e49){_0x13d1a5['push'](_0x13d1a5['shift']());}};_0x2639a5(++_0x396344);}(_0x5a53,0x178));var _0x35a5=function(_0x5ecde7,_0x411905){_0x5ecde7=_0x5ecde7-0x0;var _0x4c037e=_0x5a53[_0x5ecde7];return _0x4c037e;};'use strict';var util=require(_0x35a5('0x0'));var _=require(_0x35a5('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x35a5('0x2'));var ipAgi=process[_0x35a5('0x3')]['XCALLY_IP_AGI']||_0x35a5('0x4');function getSeconds(_0x443c54,_0x3bc208){var _0x1ccdea=moment(_0x443c54)['milliseconds'](0x0);var _0x1c0f9b=moment(_0x3bc208)[_0x35a5('0x5')](0x0);return _0x1ccdea[_0x35a5('0x6')](_0x1c0f9b,_0x35a5('0x7'));}exports[_0x35a5('0x8')]=function(_0x146584){return function(_0x296d8b){logger[_0x35a5('0x9')](_0x146584,util['inspect'](_0x296d8b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1f1459,_0x19fd3f){logger[_0x35a5('0xa')](_0x1f1459,util['inspect'](_0x19fd3f,{'showHidden':![],'depth':null}));};exports[_0x35a5('0xb')]=function(_0x2dccc1,_0x1ca3ee){logger['error'](_0x2dccc1,util['inspect'](_0x1ca3ee,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1f39cb){return function(_0x3e1478){logger[_0x35a5('0xa')](_0x1f39cb,util[_0x35a5('0xc')](_0x3e1478,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x534828,_0x652e54,_0x2f988f){return{'message':_0x534828,'unlock':_0x652e54,'active':_0x2f988f};};exports[_0x35a5('0xd')]=function(_0x106be2,_0x41c4e7,_0x370fce){if(!_[_0x35a5('0xe')](_0x370fce)&&_0x35a5('0xf')===typeof _0x370fce&&!_[_0x35a5('0x10')](_0x370fce)){if(!_[_0x35a5('0xe')](_0x41c4e7)&&'string'===typeof _0x41c4e7&&!_[_0x35a5('0x10')](_0x41c4e7)){return util['format'](_0x35a5('0x11'),_0x41c4e7,_0x370fce);}return util['format']('\x22%s\x22\x20<%s>',_0x370fce,_0x370fce);}if(!_[_0x35a5('0xe')](_0x106be2)&&_0x35a5('0xf')===typeof _0x106be2&&!_['isEmpty'](_0x106be2)){return _0x106be2;}return _0x35a5('0x12');};exports['isActive']=function(_0x3b2c41){if(_[_0x35a5('0x13')](_0x3b2c41)){return![];}return _0x3b2c41;};exports[_0x35a5('0x14')]=function(_0x195ae2,_0x3b84bd,_0xfa4984,_0x1e74f0,_0x2dc5aa,_0x5e6697){var _0x528164={'XMD-QUEUE':_0x3b84bd['Queue']?_0x3b84bd[_0x35a5('0x15')][_0x35a5('0x16')]:'','XMD-CALLERID':_0x1e74f0,'XMD-CALLERID-PREVIEW':_0x5e6697?util[_0x35a5('0x17')](_0x35a5('0x11'),_0x5e6697[_0x35a5('0x18')],_0x5e6697[_0x35a5('0x19')]):_0x1e74f0,'XMD-DIALID':_0x2dc5aa,'XMD-CONTACTID':_0x3b84bd['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1e74f0,'XMD-VOICEQUEUEID':_0x3b84bd[_0x35a5('0x1a')],'XMD-DIALCHANNEL':_0xfa4984,'XMD-DIALTIMEOUT':_0x195ae2[_0x35a5('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x35a5('0x17')](_0x35a5('0x1c'),_0x195ae2[_0x35a5('0x1d')]?'g':'',_[_0x35a5('0x10')](_0x195ae2['monitor_format'])?'':_0x35a5('0x1e')),'XMD-DIALURL':_0x195ae2[_0x35a5('0x1f')]||'','XMD-AGI':_0x195ae2[_0x35a5('0x20')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x195ae2[_0x35a5('0x20')]):_0x35a5('0x21'),'XMD-AGIAFTER':_0x195ae2[_0x35a5('0x1d')]?util[_0x35a5('0x17')](_0x35a5('0x22'),ipAgi,_0x195ae2[_0x35a5('0x1d')]):_0x35a5('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x5e6697?_0x5e6697[_0x35a5('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x5e6697?_0x5e6697[_0x35a5('0x24')]:'','XMD-DESTINATION':_0x35a5('0x25'),'SIPADDHEADER':_0x35a5('0x26')};if(!_[_0x35a5('0x10')](_0x195ae2[_0x35a5('0x27')])){_0x528164[util[_0x35a5('0x17')]('%s',_0x35a5('0x28'))]=_0x195ae2[_0x35a5('0x27')];_0x528164[util['format']('%s',_0x35a5('0x29'))]=_0x2dc5aa;}if(_0x3b84bd&&_0x3b84bd[_0x35a5('0x2a')]){for(var _0x10d7be in _0x3b84bd[_0x35a5('0x2a')]){if(_0x3b84bd[_0x35a5('0x2a')]['hasOwnProperty'](_0x10d7be)){if(!_[_0x35a5('0x13')](_0x3b84bd[_0x35a5('0x2a')][_0x10d7be])&&_0x10d7be!=='id'&&_0x10d7be!=='tags'&&_0x10d7be!==_0x35a5('0x2b')&&_0x10d7be!==_0x35a5('0x2c')){_0x528164[util[_0x35a5('0x17')]('%s%s','XMD-',_[_0x35a5('0x2d')](_0x10d7be))]=_0x3b84bd['Contact'][_0x10d7be];}}}}return _0x528164;};exports[_0x35a5('0x2e')]=function(_0x343c02){var _0x1a723c={};for(var _0x2aa784 in _0x343c02){if(_0x343c02[_0x35a5('0x2f')](_0x2aa784)){_0x1a723c[util[_0x35a5('0x17')]('%s',_['toLower'](_0x2aa784))]=_0x343c02[_0x2aa784];}}return{'variables':_0x1a723c};};exports[_0x35a5('0x30')]=function(_0x2ea7ee,_0x406a58){if(!_[_0x35a5('0x13')](_0x2ea7ee)){if(_0x2ea7ee[_0x35a5('0x2f')](_0x35a5('0x31'))){if(_0x2ea7ee['originated']>0x0){_0x2ea7ee[_0x35a5('0x31')]-=0x1;}else{logger[_0x35a5('0x9')](_0x35a5('0x32'),_0x406a58);}}}else{logger[_0x35a5('0x9')](_0x35a5('0x33'),_0x406a58);}};exports['logBlacklist']=function(_0x761431){var _0x2a95b6=moment()[_0x35a5('0x17')](_0x35a5('0x34'));_0x761431[_0x35a5('0x35')]=0xd;_0x761431['statedesc']=_0x35a5('0x36');_0x761431['starttime']=_0x2a95b6;_0x761431[_0x35a5('0x37')]=_0x2a95b6;_0x761431[_0x35a5('0x38')]=_0x2a95b6;};exports[_0x35a5('0x39')]=function(_0x5448e1,_0x3dfe82,_0x5b291d){var _0x5bdb06=moment()[_0x35a5('0x17')]('YYYY-MM-DD\x20HH:mm:ss');_0x5448e1[_0x35a5('0x35')]=_0x3dfe82;_0x5448e1[_0x35a5('0x3a')]=_0x5b291d;_0x5448e1[_0x35a5('0x37')]=_0x5bdb06;_0x5448e1[_0x35a5('0x3b')]=getSeconds(_0x5448e1['responsetime'],_0x5448e1['starttime']);};exports[_0x35a5('0x3c')]=function(_0x4fa76c,_0x3e8982,_0x9f538d){_0x4fa76c[_0x35a5('0x3d')]=_0x3e8982;_0x4fa76c['UserId']=_0x9f538d;};exports[_0x35a5('0x3e')]=function(_0xd6e8d3,_0x1d6a2a,_0x196fbc){var _0x3c4a4d=moment()['format'](_0x35a5('0x34'));_0xd6e8d3[_0x35a5('0x35')]=_0x1d6a2a;_0xd6e8d3[_0x35a5('0x3a')]=_0x196fbc;_0xd6e8d3[_0x35a5('0x37')]=_0xd6e8d3[_0x35a5('0x37')]?_0xd6e8d3[_0x35a5('0x37')]:_0x3c4a4d;_0xd6e8d3[_0x35a5('0x38')]=_0xd6e8d3['endtime']?_0xd6e8d3['endtime']:_0x3c4a4d;_0xd6e8d3[_0x35a5('0x3b')]=getSeconds(_0xd6e8d3[_0x35a5('0x37')]||0x0,_0xd6e8d3[_0x35a5('0x3f')]||0x0);_0xd6e8d3[_0x35a5('0x40')]=_0xd6e8d3[_0x35a5('0x41')]?getSeconds(_0xd6e8d3[_0x35a5('0x38')],_0xd6e8d3[_0x35a5('0x41')]):0x0;};exports['isFailure']=function(_0x1a66fe){return _0x1a66fe===_0x35a5('0x42');};exports['variablesAction']=function(_0x660269,_0x3b933c,_0x594195,_0x305b97,_0xb2fd9d){var _0x1199ab=_0x305b97?_0x35a5('0x43'):_0x660269[_0x35a5('0x18')];_0x1199ab=_0xb2fd9d?'BOOKED':_0x1199ab;return{'actionid':_0x660269[_0x35a5('0x44')],'action':_0x35a5('0x45'),'channel':_0x660269['channelAgent'],'callerid':util[_0x35a5('0x17')](_0x35a5('0x11'),_0x1199ab,_0x660269[_0x35a5('0x19')]),'Exten':_0x35a5('0x25'),'Context':_0x35a5('0x46'),'Priority':'1','variable':_0x594195,'timeout':(_0x3b933c[_0x35a5('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x660269['uniqueid']};};exports[_0x35a5('0x48')]=function(_0xb223a3){return _0xb223a3[_0x35a5('0x49')]+_0xb223a3['countcongestionretry']+_0xb223a3['countnoanswerretry']+_0xb223a3['countagentrejectretry']+_0xb223a3[_0x35a5('0x4a')];};exports[_0x35a5('0x4b')]=function(_0x2ab6f8){var _0x56ade7=_[_0x35a5('0x4c')](_0x2ab6f8);_0x56ade7['state']=0xf;_0x56ade7[_0x35a5('0x3a')]=_0x35a5('0x4d');return _0x56ade7;};exports['scheduledAt']=function(_0xe69d49,_0x19c7c4,_0x4c2f23){var _0x20ed05={};_0x20ed05[_0x19c7c4]=_0xe69d49[_0x19c7c4];_0x20ed05['active']=![];_0x20ed05['scheduledat']=moment()[_0x35a5('0x4e')](_0x4c2f23,_0x35a5('0x4f'))['format'](_0x35a5('0x34'));_0x20ed05[_0x35a5('0x50')]=_0xe69d49[_0x35a5('0x50')];_0x20ed05['ListId']=_0xe69d49[_0x35a5('0x51')];_0x20ed05[_0x35a5('0x1a')]=_0xe69d49['VoiceQueueId']||undefined;return _0x20ed05;};exports[_0x35a5('0x52')]=function(_0x53c8b4,_0x3ac53e){if(!_[_0x35a5('0x13')](_0x53c8b4)){if(_0x53c8b4[_0x35a5('0x53')]>0x0){_0x53c8b4[_0x35a5('0x53')]-=0x1;}else{logger['error'](_0x3ac53e,_0x35a5('0x54'));}}else{logger[_0x35a5('0x9')](_0x3ac53e,_0x35a5('0x55'));}};exports['IsNotLoggedIn']=function(_0x47a70a){if(_0x47a70a<=0x0){return!![];}return![];};function buildObj(_0x2be735,_0x8e0b68,_0xc72e2a){_0x2be735[_0x35a5('0x56')]=_0x8e0b68;_0x2be735[_0x35a5('0x16')]=_0x2be735[_0x35a5('0x57')];_0x2be735[_0x35a5('0x58')]=_0x2be735['channelAgent'];_0x2be735[_0x35a5('0x59')]='voice';if(_0xc72e2a){_0x2be735['mandatoryDisposition']=_0xc72e2a[_0x35a5('0x5a')];}return _0x2be735;}exports[_0x35a5('0x5b')]=buildObj;exports[_0x35a5('0x5c')]=function(_0x598eab){var _0x552b54={};_0x552b54[_0x35a5('0x57')]=_0x598eab[_0x35a5('0x57')];_0x552b54[_0x35a5('0x58')]=_0x598eab[_0x35a5('0x5d')];_0x552b54[_0x35a5('0x44')]=_0x598eab[_0x35a5('0x44')];return _0x552b54;};exports['agentReadyId']=function(_0x329a7f){var _0x30a2ee=[];for(var _0x140903 in _0x329a7f){if(_0x329a7f[_0x35a5('0x2f')](_0x140903)){if(!_[_0x35a5('0x13')](_0x329a7f[_0x140903])&&_0x329a7f[_0x140903][_0x35a5('0x35')]===_0x35a5('0x5e')&&_0x329a7f[_0x140903][_0x35a5('0x5f')]===_0x35a5('0x60')){_0x30a2ee[_0x35a5('0x61')](_0x329a7f[_0x140903]['id']);}}}return _0x30a2ee;};exports[_0x35a5('0x62')]=function(_0x429079){var _0x5e6ccb=moment()[_0x35a5('0x5')](0x0);var _0x140ea4=moment(_0x429079)[_0x35a5('0x5')](0x0);return _0x5e6ccb[_0x35a5('0x6')](_0x140ea4,_0x35a5('0x7'));};exports[_0x35a5('0x63')]=function(_0x340c82){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x340c82['ContactId'],'ListId':_0x340c82[_0x35a5('0x51')],'VoiceQueueId':_0x340c82[_0x35a5('0x1a')]||undefined,'CampaignId':_0x340c82['CampaignId']||undefined};};exports['filterKey']=function(_0x313f78){if(_0x313f78===_0x35a5('0x44')||_0x313f78===_0x35a5('0x64')||_0x313f78===_0x35a5('0x57')||_0x313f78===_0x35a5('0x65')||_0x313f78===_0x35a5('0x66')||_0x313f78===_0x35a5('0x67')||_0x313f78==='membername'||_0x313f78===_0x35a5('0x5d')||_0x313f78===_0x35a5('0x18')||_0x313f78===_0x35a5('0x68')||_0x313f78===_0x35a5('0x19')||_0x313f78===_0x35a5('0x69')||_0x313f78==='countbusyretry'||_0x313f78===_0x35a5('0x6a')||_0x313f78===_0x35a5('0x6b')||_0x313f78===_0x35a5('0x6c')||_0x313f78==='callback'||_0x313f78===_0x35a5('0x6d')||_0x313f78===_0x35a5('0x6e')||_0x313f78==='recallme'||_0x313f78===_0x35a5('0x50')||_0x313f78==='ListId'||_0x313f78===_0x35a5('0x6f')||_0x313f78===_0x35a5('0x1a')||_0x313f78===_0x35a5('0x70')||_0x313f78===_0x35a5('0x71')||_0x313f78===_0x35a5('0x72')||_0x313f78===_0x35a5('0x73')||_0x313f78===_0x35a5('0x74')||_0x313f78===_0x35a5('0x75')||_0x313f78==='xmd-dialtimeout'||_0x313f78===_0x35a5('0x76')||_0x313f78===_0x35a5('0x77')||_0x313f78==='xmd-dialchannel'||_0x313f78===_0x35a5('0x78')||_0x313f78===_0x35a5('0x79')||_0x313f78===_0x35a5('0x7a')||_0x313f78==='xmd-agiafter'||_0x313f78==='xmd-agi'||_0x313f78==='rtpaudioqos'||_0x313f78==='rtpaudioqosbridged'||_0x313f78===_0x35a5('0x7b')||_0x313f78===_0x35a5('0x7c')||_0x313f78==='rtpaudioqosloss'||_0x313f78===_0x35a5('0x7d')||_0x313f78==='rtpaudioqosrtt'||_0x313f78===_0x35a5('0x7e')||_0x313f78===_0x35a5('0x7f')||_0x313f78===_0x35a5('0x80')||_0x313f78==='rtpaudioqosjitter'||_0x313f78===_0x35a5('0x7c')||_0x313f78===_0x35a5('0x81')||_0x313f78==='rtpaudioqoslossbridged'||_0x313f78===_0x35a5('0x82')||_0x313f78===_0x35a5('0x7e')||_0x313f78===_0x35a5('0x83')||_0x313f78==='bridgepvtcallid'||_0x313f78===_0x35a5('0x35')||_0x313f78===_0x35a5('0x3a')){return![];}return!![];};exports[_0x35a5('0x84')]=function(_0x53241a,_0x569f7b){var _0x5683d3,_0x5111ef,_0xca1a7b;if(_0x569f7b<=0x0){_0x569f7b=0x1;}_0x5683d3=new RegExp(_0x35a5('0x85')+_0x569f7b+'}$');_0x5111ef=Math[_0x35a5('0x86')](0xa,_0x569f7b-0x1);_0xca1a7b=Math[_0x35a5('0x86')](0xa,_0x569f7b)-0x1;return util['format']('%s',_[_0x35a5('0x87')](_0x53241a,_0x5683d3,_[_0x35a5('0x88')](_0x5111ef,_0xca1a7b)));};exports[_0x35a5('0x89')]=function(_0x2de657){var _0x437be1=_0x2de657['match'](/"(.*?)"/);return _0x437be1?_0x437be1[0x1]:_0x2de657;};exports[_0x35a5('0x8a')]=function(_0x4b0206){var _0x53ddc0=_0x4b0206[_0x35a5('0x8b')](/<(.*?)>/);return _0x53ddc0?_0x53ddc0[0x1]:_0x4b0206;};function buildNoAnswerEventPayload(_0x5c9685,_0x41361d){var _0x342388=buildObj(_0x5c9685,_0x35a5('0x8c'));if(!_[_0x35a5('0x10')](_0x41361d[_0x35a5('0x8d')])){Object['keys'](_0x41361d[_0x35a5('0x8d')])[_0x35a5('0x8e')](function(_0x34df10){_0x342388[_0x34df10[_0x35a5('0x8f')]()]=_0x41361d[_0x35a5('0x8d')][_0x34df10];});}return _0x342388;}exports[_0x35a5('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xecd8=['minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepeer','\x5cw{0,','pow','replace','extractCalleridName','extractCalleridNumber','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','preview','env','127.0.0.1','milliseconds','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','responsetime','logAgent','state','logLookAgent','membername','UserId','logCustomer','endtime','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','countcongestionretry','countagentrejectretry','cloneAction','clone','scheduledAt','scheduledat','add'];(function(_0x2e1fc1,_0x31f54b){var _0x1249be=function(_0x3700e9){while(--_0x3700e9){_0x2e1fc1['push'](_0x2e1fc1['shift']());}};_0x1249be(++_0x31f54b);}(_0xecd8,0xd3));var _0x8ecd=function(_0x35a6b7,_0x147fc5){_0x35a6b7=_0x35a6b7-0x0;var _0x3822a2=_0xecd8[_0x35a6b7];return _0x3822a2;};'use strict';var util=require(_0x8ecd('0x0'));var _=require(_0x8ecd('0x1'));var moment=require('moment');var logger=require(_0x8ecd('0x2'))(_0x8ecd('0x3'));var ipAgi=process[_0x8ecd('0x4')]['XCALLY_IP_AGI']||_0x8ecd('0x5');function getSeconds(_0x357389,_0x484088){var _0x157ac7=moment(_0x357389)[_0x8ecd('0x6')](0x0);var _0x1e19c2=moment(_0x484088)[_0x8ecd('0x6')](0x0);return _0x157ac7['diff'](_0x1e19c2,_0x8ecd('0x7'));}exports[_0x8ecd('0x8')]=function(_0x562e13){return function(_0x5a9b31){logger['error'](_0x562e13,util[_0x8ecd('0x9')](_0x5a9b31,{'showHidden':![],'depth':null}));};};exports[_0x8ecd('0xa')]=function(_0x691f3a,_0x3598c5){logger[_0x8ecd('0xb')](_0x691f3a,util['inspect'](_0x3598c5,{'showHidden':![],'depth':null}));};exports[_0x8ecd('0xc')]=function(_0x5a6490,_0x5c81ce){logger[_0x8ecd('0xd')](_0x5a6490,util['inspect'](_0x5c81ce,{'showHidden':![],'depth':null}));};exports[_0x8ecd('0xe')]=function(_0xc7607e){return function(_0xbc0442){logger[_0x8ecd('0xb')](_0xc7607e,util[_0x8ecd('0x9')](_0xbc0442,{'showHidden':![],'depth':null}));};};exports[_0x8ecd('0xf')]=function(_0x335375,_0x3fa7f8,_0x2d92fd){return{'message':_0x335375,'unlock':_0x3fa7f8,'active':_0x2d92fd};};exports['getCallerId']=function(_0x4ea305,_0x5f31c5,_0x3462ee){if(!_['isUndefined'](_0x3462ee)&&_0x8ecd('0x10')===typeof _0x3462ee&&!_[_0x8ecd('0x11')](_0x3462ee)){if(!_[_0x8ecd('0x12')](_0x5f31c5)&&_0x8ecd('0x10')===typeof _0x5f31c5&&!_[_0x8ecd('0x11')](_0x5f31c5)){return util[_0x8ecd('0x13')](_0x8ecd('0x14'),_0x5f31c5,_0x3462ee);}return util[_0x8ecd('0x13')](_0x8ecd('0x14'),_0x3462ee,_0x3462ee);}if(!_[_0x8ecd('0x12')](_0x4ea305)&&_0x8ecd('0x10')===typeof _0x4ea305&&!_['isEmpty'](_0x4ea305)){return _0x4ea305;}return'\x22\x22\x20<>';};exports[_0x8ecd('0x15')]=function(_0x30503e){if(_[_0x8ecd('0x16')](_0x30503e)){return![];}return _0x30503e;};exports[_0x8ecd('0x17')]=function(_0x5c4e08,_0x46de11,_0x354739,_0x311184,_0x2e33b0,_0x2bf4b8){var _0x580daf={'XMD-QUEUE':_0x46de11[_0x8ecd('0x18')]?_0x46de11['Queue']['name']:'','XMD-CALLERID':_0x311184,'XMD-CALLERID-PREVIEW':_0x2bf4b8?util[_0x8ecd('0x13')](_0x8ecd('0x14'),_0x2bf4b8[_0x8ecd('0x19')],_0x2bf4b8[_0x8ecd('0x1a')]):_0x311184,'XMD-DIALID':_0x2e33b0,'XMD-CONTACTID':_0x46de11[_0x8ecd('0x1b')],'XMD-CDRTYPE':_0x8ecd('0x1c'),'CALLERID(all)':_0x311184,'XMD-VOICEQUEUEID':_0x46de11[_0x8ecd('0x1d')],'XMD-DIALCHANNEL':_0x354739,'XMD-DIALTIMEOUT':_0x5c4e08['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x8ecd('0x13')](_0x8ecd('0x1e'),_0x5c4e08[_0x8ecd('0x1f')]?'g':'',_[_0x8ecd('0x11')](_0x5c4e08[_0x8ecd('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5c4e08[_0x8ecd('0x21')]||'','XMD-AGI':_0x5c4e08[_0x8ecd('0x22')]?util[_0x8ecd('0x13')](_0x8ecd('0x23'),ipAgi,_0x5c4e08[_0x8ecd('0x22')]):_0x8ecd('0x24'),'XMD-AGIAFTER':_0x5c4e08[_0x8ecd('0x1f')]?util[_0x8ecd('0x13')](_0x8ecd('0x23'),ipAgi,_0x5c4e08[_0x8ecd('0x1f')]):_0x8ecd('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x2bf4b8?_0x2bf4b8[_0x8ecd('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x2bf4b8?_0x2bf4b8['originatecalleridname']:'','XMD-DESTINATION':_0x8ecd('0x26'),'SIPADDHEADER':_0x8ecd('0x27')};if(!_[_0x8ecd('0x11')](_0x5c4e08[_0x8ecd('0x20')])){_0x580daf[util['format']('%s',_0x8ecd('0x28'))]=_0x5c4e08['monitor_format'];_0x580daf[util[_0x8ecd('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2e33b0;}if(_0x46de11&&_0x46de11[_0x8ecd('0x29')]){for(var _0x1da7c2 in _0x46de11[_0x8ecd('0x29')]){if(_0x46de11['Contact'][_0x8ecd('0x2a')](_0x1da7c2)){if(!_[_0x8ecd('0x16')](_0x46de11[_0x8ecd('0x29')][_0x1da7c2])&&_0x1da7c2!=='id'&&_0x1da7c2!==_0x8ecd('0x2b')&&_0x1da7c2!==_0x8ecd('0x2c')&&_0x1da7c2!=='updatedAt'){_0x580daf[util['format'](_0x8ecd('0x2d'),_0x8ecd('0x2e'),_[_0x8ecd('0x2f')](_0x1da7c2))]=_0x46de11[_0x8ecd('0x29')][_0x1da7c2];}}}}return _0x580daf;};exports[_0x8ecd('0x30')]=function(_0x3dc632){var _0x3a441b={};for(var _0xab82d2 in _0x3dc632){if(_0x3dc632[_0x8ecd('0x2a')](_0xab82d2)){_0x3a441b[util[_0x8ecd('0x13')]('%s',_[_0x8ecd('0x31')](_0xab82d2))]=_0x3dc632[_0xab82d2];}}return{'variables':_0x3a441b};};exports[_0x8ecd('0x32')]=function(_0x58e65d,_0xcc03ca){if(!_[_0x8ecd('0x16')](_0x58e65d)){if(_0x58e65d['hasOwnProperty'](_0x8ecd('0x33'))){if(_0x58e65d[_0x8ecd('0x33')]>0x0){_0x58e65d[_0x8ecd('0x33')]-=0x1;}else{logger[_0x8ecd('0xd')](_0x8ecd('0x34'),_0xcc03ca);}}}else{logger['error'](_0x8ecd('0x35'),_0xcc03ca);}};exports[_0x8ecd('0x36')]=function(_0x115f1a){var _0x5e8736=moment()[_0x8ecd('0x13')](_0x8ecd('0x37'));_0x115f1a['state']=0xd;_0x115f1a[_0x8ecd('0x38')]='Blacklist';_0x115f1a[_0x8ecd('0x39')]=_0x5e8736;_0x115f1a[_0x8ecd('0x3a')]=_0x5e8736;_0x115f1a['endtime']=_0x5e8736;};exports[_0x8ecd('0x3b')]=function(_0x437b83,_0x3af46c,_0x47f71d){var _0x357d5c=moment()[_0x8ecd('0x13')](_0x8ecd('0x37'));_0x437b83[_0x8ecd('0x3c')]=_0x3af46c;_0x437b83[_0x8ecd('0x38')]=_0x47f71d;_0x437b83[_0x8ecd('0x3a')]=_0x357d5c;_0x437b83['ringtime']=getSeconds(_0x437b83[_0x8ecd('0x3a')],_0x437b83[_0x8ecd('0x39')]);};exports[_0x8ecd('0x3d')]=function(_0x3d45b2,_0x47b88d,_0x5aa2ee){_0x3d45b2[_0x8ecd('0x3e')]=_0x47b88d;_0x3d45b2[_0x8ecd('0x3f')]=_0x5aa2ee;};exports[_0x8ecd('0x40')]=function(_0x102480,_0x22cebf,_0x521a54){var _0x5644b3=moment()[_0x8ecd('0x13')](_0x8ecd('0x37'));_0x102480[_0x8ecd('0x3c')]=_0x22cebf;_0x102480['statedesc']=_0x521a54;_0x102480['responsetime']=_0x102480['responsetime']?_0x102480[_0x8ecd('0x3a')]:_0x5644b3;_0x102480[_0x8ecd('0x41')]=_0x102480[_0x8ecd('0x41')]?_0x102480[_0x8ecd('0x41')]:_0x5644b3;_0x102480[_0x8ecd('0x42')]=getSeconds(_0x102480['responsetime']||0x0,_0x102480['starttime']||0x0);_0x102480[_0x8ecd('0x43')]=_0x102480[_0x8ecd('0x44')]?getSeconds(_0x102480[_0x8ecd('0x41')],_0x102480[_0x8ecd('0x44')]):0x0;};exports[_0x8ecd('0x45')]=function(_0x5cb592){return _0x5cb592===_0x8ecd('0x46');};exports[_0x8ecd('0x47')]=function(_0x4fe37b,_0x2653c3,_0x38f230,_0x4369a8,_0x5d79ff){var _0x35dab7=_0x4369a8?_0x8ecd('0x48'):_0x4fe37b[_0x8ecd('0x19')];_0x35dab7=_0x5d79ff?_0x8ecd('0x49'):_0x35dab7;return{'actionid':_0x4fe37b[_0x8ecd('0x4a')],'action':_0x8ecd('0x4b'),'channel':_0x4fe37b[_0x8ecd('0x4c')],'callerid':util['format'](_0x8ecd('0x14'),_0x35dab7,_0x4fe37b['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x8ecd('0x4d'),'Priority':'1','variable':_0x38f230,'timeout':(_0x2653c3['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4fe37b[_0x8ecd('0x4a')]};};exports['totalGlobal']=function(_0x11d32c){return _0x11d32c['countbusyretry']+_0x11d32c[_0x8ecd('0x4e')]+_0x11d32c['countnoanswerretry']+_0x11d32c[_0x8ecd('0x4f')]+_0x11d32c['countnosuchnumberretry'];};exports[_0x8ecd('0x50')]=function(_0x4456f4){var _0x1b9e03=_[_0x8ecd('0x51')](_0x4456f4);_0x1b9e03['state']=0xf;_0x1b9e03[_0x8ecd('0x38')]='Global';return _0x1b9e03;};exports[_0x8ecd('0x52')]=function(_0x562e65,_0xbb2508,_0x2770a7){var _0x33c9a6={};_0x33c9a6[_0xbb2508]=_0x562e65[_0xbb2508];_0x33c9a6['active']=![];_0x33c9a6[_0x8ecd('0x53')]=moment()[_0x8ecd('0x54')](_0x2770a7,_0x8ecd('0x55'))['format'](_0x8ecd('0x37'));_0x33c9a6[_0x8ecd('0x1b')]=_0x562e65[_0x8ecd('0x1b')];_0x33c9a6[_0x8ecd('0x56')]=_0x562e65['ListId'];_0x33c9a6[_0x8ecd('0x1d')]=_0x562e65['VoiceQueueId']||undefined;return _0x33c9a6;};exports[_0x8ecd('0x57')]=function(_0x10710a,_0x4e70a7){if(!_[_0x8ecd('0x16')](_0x10710a)){if(_0x10710a[_0x8ecd('0x58')]>0x0){_0x10710a[_0x8ecd('0x58')]-=0x1;}else{logger[_0x8ecd('0xd')](_0x4e70a7,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x8ecd('0xd')](_0x4e70a7,_0x8ecd('0x59'));}};exports['IsNotLoggedIn']=function(_0x1937af){if(_0x1937af<=0x0){return!![];}return![];};function buildObj(_0x5190fb,_0x5745e5,_0x2276b1){_0x5190fb['lastevent']=_0x5745e5;_0x5190fb[_0x8ecd('0x5a')]=_0x5190fb[_0x8ecd('0x5b')];_0x5190fb[_0x8ecd('0x5c')]=_0x5190fb['channelAgent'];_0x5190fb[_0x8ecd('0x5d')]=_0x8ecd('0x5e');if(_0x2276b1){_0x5190fb[_0x8ecd('0x5f')]=_0x2276b1[_0x8ecd('0x5f')];}return _0x5190fb;}exports[_0x8ecd('0x60')]=buildObj;exports[_0x8ecd('0x61')]=function(_0x513a97){var _0x34f736={};_0x34f736[_0x8ecd('0x5b')]=_0x513a97[_0x8ecd('0x5b')];_0x34f736[_0x8ecd('0x5c')]=_0x513a97[_0x8ecd('0x4c')];_0x34f736['uniqueid']=_0x513a97[_0x8ecd('0x4a')];return _0x34f736;};exports[_0x8ecd('0x62')]=function(_0x4c4e36){var _0x8c176d=[];for(var _0x47429b in _0x4c4e36){if(_0x4c4e36[_0x8ecd('0x2a')](_0x47429b)){if(!_[_0x8ecd('0x16')](_0x4c4e36[_0x47429b])&&_0x4c4e36[_0x47429b][_0x8ecd('0x3c')]===_0x8ecd('0x63')&&_0x4c4e36[_0x47429b]['status']===_0x8ecd('0x64')){_0x8c176d[_0x8ecd('0x65')](_0x4c4e36[_0x47429b]['id']);}}}return _0x8c176d;};exports[_0x8ecd('0x66')]=function(_0x3a01ca){var _0xdf6c8b=moment()['milliseconds'](0x0);var _0x412c2c=moment(_0x3a01ca)[_0x8ecd('0x6')](0x0);return _0xdf6c8b['diff'](_0x412c2c,_0x8ecd('0x7'));};exports[_0x8ecd('0x67')]=function(_0x35884d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x35884d['ContactId'],'ListId':_0x35884d[_0x8ecd('0x56')],'VoiceQueueId':_0x35884d[_0x8ecd('0x1d')]||undefined,'CampaignId':_0x35884d[_0x8ecd('0x68')]||undefined};};exports[_0x8ecd('0x69')]=function(_0x21dde1){if(_0x21dde1===_0x8ecd('0x4a')||_0x21dde1===_0x8ecd('0x6a')||_0x21dde1===_0x8ecd('0x5b')||_0x21dde1===_0x8ecd('0x6b')||_0x21dde1===_0x8ecd('0x6c')||_0x21dde1===_0x8ecd('0x6d')||_0x21dde1===_0x8ecd('0x3e')||_0x21dde1===_0x8ecd('0x4c')||_0x21dde1===_0x8ecd('0x19')||_0x21dde1===_0x8ecd('0x6e')||_0x21dde1===_0x8ecd('0x1a')||_0x21dde1===_0x8ecd('0x53')||_0x21dde1===_0x8ecd('0x6f')||_0x21dde1==='countcongestionretry'||_0x21dde1===_0x8ecd('0x70')||_0x21dde1===_0x8ecd('0x71')||_0x21dde1===_0x8ecd('0x72')||_0x21dde1===_0x8ecd('0x73')||_0x21dde1===_0x8ecd('0x74')||_0x21dde1===_0x8ecd('0x75')||_0x21dde1==='ContactId'||_0x21dde1===_0x8ecd('0x56')||_0x21dde1===_0x8ecd('0x3f')||_0x21dde1===_0x8ecd('0x1d')||_0x21dde1===_0x8ecd('0x76')||_0x21dde1==='xmd-voicequeueid'||_0x21dde1===_0x8ecd('0x77')||_0x21dde1==='xmd-phone'||_0x21dde1==='xmd-listid'||_0x21dde1===_0x8ecd('0x78')||_0x21dde1==='xmd-dialtimeout'||_0x21dde1===_0x8ecd('0x79')||_0x21dde1===_0x8ecd('0x7a')||_0x21dde1===_0x8ecd('0x7b')||_0x21dde1===_0x8ecd('0x7c')||_0x21dde1===_0x8ecd('0x7d')||_0x21dde1===_0x8ecd('0x7e')||_0x21dde1===_0x8ecd('0x7f')||_0x21dde1===_0x8ecd('0x80')||_0x21dde1===_0x8ecd('0x81')||_0x21dde1==='rtpaudioqosbridged'||_0x21dde1==='rtpaudioqosjitter'||_0x21dde1==='rtpaudioqosjitterbridged'||_0x21dde1==='rtpaudioqosloss'||_0x21dde1===_0x8ecd('0x82')||_0x21dde1===_0x8ecd('0x83')||_0x21dde1===_0x8ecd('0x84')||_0x21dde1===_0x8ecd('0x81')||_0x21dde1==='rtpaudioqosbridged'||_0x21dde1===_0x8ecd('0x85')||_0x21dde1===_0x8ecd('0x86')||_0x21dde1===_0x8ecd('0x87')||_0x21dde1===_0x8ecd('0x82')||_0x21dde1===_0x8ecd('0x83')||_0x21dde1===_0x8ecd('0x84')||_0x21dde1===_0x8ecd('0x88')||_0x21dde1==='bridgepvtcallid'||_0x21dde1===_0x8ecd('0x3c')||_0x21dde1===_0x8ecd('0x38')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x443110,_0x1daf7a){var _0x51c598,_0x5ec126,_0x4c1044;if(_0x1daf7a<=0x0){_0x1daf7a=0x1;}_0x51c598=new RegExp(_0x8ecd('0x89')+_0x1daf7a+'}$');_0x5ec126=Math[_0x8ecd('0x8a')](0xa,_0x1daf7a-0x1);_0x4c1044=Math[_0x8ecd('0x8a')](0xa,_0x1daf7a)-0x1;return util[_0x8ecd('0x13')]('%s',_[_0x8ecd('0x8b')](_0x443110,_0x51c598,_['random'](_0x5ec126,_0x4c1044)));};exports[_0x8ecd('0x8c')]=function(_0x2f94ae){var _0x5e6621=_0x2f94ae['match'](/"(.*?)"/);return _0x5e6621?_0x5e6621[0x1]:_0x2f94ae;};exports[_0x8ecd('0x8d')]=function(_0xfb9178){var _0x2cd25d=_0xfb9178[_0x8ecd('0x8e')](/<(.*?)>/);return _0x2cd25d?_0x2cd25d[0x1]:_0xfb9178;};function buildNoAnswerEventPayload(_0x266e3d,_0x277acf){var _0x4afedb=buildObj(_0x266e3d,_0x8ecd('0x8f'));if(!_[_0x8ecd('0x11')](_0x277acf[_0x8ecd('0x90')])){Object['keys'](_0x277acf[_0x8ecd('0x90')])[_0x8ecd('0x91')](function(_0x5982ae){_0x4afedb[_0x5982ae[_0x8ecd('0x92')]()]=_0x277acf[_0x8ecd('0x90')][_0x5982ae];});}return _0x4afedb;}exports[_0x8ecd('0x93')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c76ac98..72e5b97 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 _0x16af=['voicechannel','voicequeuechannelredirect','string','number','queueremove','queuepause','boolean','reload'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x16af,0x72));var _0xf16a=function(_0xfc5de,_0x210af9){_0xfc5de=_0xfc5de-0x0;var _0x25ece8=_0x16af[_0xfc5de];return _0x25ece8;};'use strict';exports['queueadd']={'queue':{'type':_0xf16a('0x0'),'required':!![]},'interface':{'type':_0xf16a('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xf16a('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xf16a('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xf16a('0x0'),'required':!![]}};exports[_0xf16a('0x3')]={'interface':{'type':_0xf16a('0x0'),'required':!![]},'paused':{'type':_0xf16a('0x4')},'reason':{'type':_0xf16a('0x0'),'required':![]}};exports[_0xf16a('0x5')]={'module':{'type':_0xf16a('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xf16a('0x0'),'required':!![]}};exports[_0xf16a('0x6')]={'uniqueid':{'type':_0xf16a('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xf16a('0x0')},'mixmonitorid':{'type':_0xf16a('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xf16a('0x0'),'required':!![]}};exports[_0xf16a('0x7')]={'uniqueid':{'type':_0xf16a('0x0'),'required':!![]},'exten':{'type':_0xf16a('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xf99e=['voicequeuechannelredirect','queueadd','string','boolean','queueremove','voicequeuechannelhangup'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf99e,0xd9));var _0xef99=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0xf99e[_0x54bac5];return _0xc15971;};'use strict';exports[_0xef99('0x0')]={'queue':{'type':_0xef99('0x1'),'required':!![]},'interface':{'type':_0xef99('0x1'),'required':!![]},'membername':{'type':_0xef99('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xef99('0x2'),'required':![]}};exports[_0xef99('0x3')]={'queue':{'type':_0xef99('0x1'),'required':!![]},'interface':{'type':_0xef99('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0xef99('0x2')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xef99('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xef99('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xef99('0x1')},'mixmonitorid':{'type':_0xef99('0x1')}};exports[_0xef99('0x4')]={'uniqueid':{'type':_0xef99('0x1'),'required':!![]}};exports[_0xef99('0x5')]={'uniqueid':{'type':_0xef99('0x1'),'required':!![]},'exten':{'type':_0xef99('0x1'),'required':!![]},'context':{'type':_0xef99('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index eba6b80..da8ad7c 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 _0x4e39=['prototype','length','isUndefined','agents','initTelephones','initTrunks','initTriggers','initTemplates','templates','initZendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','queueChannels','timers','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase'];(function(_0x587af4,_0x50e8e3){var _0x3a65fa=function(_0xcf6ed7){while(--_0xcf6ed7){_0x587af4['push'](_0x587af4['shift']());}};_0x3a65fa(++_0x50e8e3);}(_0x4e39,0x95));var _0x94e3=function(_0x53d0f2,_0x461fff){_0x53d0f2=_0x53d0f2-0x0;var _0x4039fe=_0x4e39[_0x53d0f2];return _0x4039fe;};'use strict';var util=require(_0x94e3('0x0'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x94e3('0x1'));var Telephone=require(_0x94e3('0x2'));var Trunk=require(_0x94e3('0x3'));var VoiceQueue=require(_0x94e3('0x4'));var Trigger=require(_0x94e3('0x5'));var Template=require(_0x94e3('0x6'));var Campaign=require(_0x94e3('0x7'));var VoiceExtension=require(_0x94e3('0x8'));var ZendeskAccount=require(_0x94e3('0x9'));var SalesforceAccount=require(_0x94e3('0xa'));var FreshdeskAccount=require(_0x94e3('0xb'));var SugarcrmAccount=require(_0x94e3('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x94e3('0xd'));var VtigerAccount=require(_0x94e3('0xe'));var ServicenowAccount=require(_0x94e3('0xf'));var Dynamics365Account=require(_0x94e3('0x10'));var FreshsalesAccount=require(_0x94e3('0x11'));var FaxAccount=require(_0x94e3('0x12'));var Realtime=function(){this['agents']={};this[_0x94e3('0x13')]={};this[_0x94e3('0x14')]={};this[_0x94e3('0x15')]={};this[_0x94e3('0x16')]={};this[_0x94e3('0x17')]={};this['templates']={};this[_0x94e3('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x94e3('0x19')]={};this['channels']={};this[_0x94e3('0x1a')]={};this['outboundChannels']={};this[_0x94e3('0x1b')]={};this[_0x94e3('0x1c')]={};this[_0x94e3('0x1d')]={};this[_0x94e3('0x1e')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x94e3('0x1f')]={};this[_0x94e3('0x20')]={};this[_0x94e3('0x21')]={};this[_0x94e3('0x22')]={};this[_0x94e3('0x23')]={};this[_0x94e3('0x24')]={};this[_0x94e3('0x25')]={};};function freeIsNotKey(_0x3c768e,_0x1877c2,_0x6495e0){var _0x152a74=_[_0x94e3('0x26')](_0x3c768e,function(_0xb0637e,_0x40cad5){return _0xb0637e[_0x6495e0];});for(var _0x2876a5 in _0x1877c2){if(_0x1877c2['hasOwnProperty'](_0x2876a5)){if(!_0x152a74[_0x2876a5]){delete _0x1877c2[_0x2876a5];}}}}function freeIsNotKeySip(_0x514ad1,_0x556cb4){var _0x5c78a1=_[_0x94e3('0x26')](_0x514ad1,function(_0x6231e,_0x2dea2a){return util[_0x94e3('0x27')](_0x94e3('0x28'),_0x6231e[_0x94e3('0x29')]);});for(var _0x2ec7c9 in _0x556cb4){if(_0x556cb4[_0x94e3('0x2a')](_0x2ec7c9)){if(!_0x5c78a1[_0x2ec7c9]){delete _0x556cb4[_0x2ec7c9];}}}}function freeIsNotKeyAgent(_0x1b8ae0,_0x30aa2d){var _0x3e7ea1=_['mapKeys'](_0x1b8ae0,function(_0xfd2c7a,_0x36365a){var _0x2a7a31=_['isNil'](_0xfd2c7a['interface'])?util[_0x94e3('0x27')](_0x94e3('0x28'),_0xfd2c7a[_0x94e3('0x29')]):_0xfd2c7a[_0x94e3('0x2b')];return _0x2a7a31;});for(var _0x34c571 in _0x30aa2d){if(_0x30aa2d[_0x94e3('0x2a')](_0x34c571)){if(!_0x3e7ea1[_0x34c571]){delete _0x30aa2d[_0x34c571];}}}}function clearVoiceCallReports(_0x5dd56c){_0x5dd56c[_0x94e3('0x2c')]=0x0;_0x5dd56c[_0x94e3('0x2d')]=0x0;_0x5dd56c[_0x94e3('0x2e')]=0x0;_0x5dd56c['sumDuration']=0x0;_0x5dd56c['sumBillable']=0x0;}function clearCampaigns(_0x709586){if(!_[_0x94e3('0x2f')](_0x709586)){for(var _0x3cecba in _0x709586){if(_0x709586[_0x94e3('0x2a')](_0x3cecba)){_0x709586[_0x3cecba][_0x94e3('0x30')]=0x0;_0x709586[_0x3cecba][_0x94e3('0x31')]=0x0;}}}}function clearVoiceQueues(_0x48cbf6){if(!_[_0x94e3('0x2f')](_0x48cbf6)){for(var _0x26b9aa in _0x48cbf6){if(_0x48cbf6[_0x94e3('0x2a')](_0x26b9aa)){_0x48cbf6[_0x26b9aa][_0x94e3('0x2c')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x2d')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x32')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x33')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x2e')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x34')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x35')]=0x0;_0x48cbf6[_0x26b9aa]['outboundAnswerAgiCallsDay']=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x36')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x37')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x38')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x39')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x3a')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x3b')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x3c')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x3d')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x3e')]=0x0;_0x48cbf6[_0x26b9aa]['outboundRejectCallsDay']=0x0;_0x48cbf6[_0x26b9aa]['outboundReCallsDay']=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x3f')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x40')]=0x0;_0x48cbf6[_0x26b9aa][_0x94e3('0x41')]=!![];}}}}Realtime['prototype'][_0x94e3('0x42')]=function(_0x19719b,_0xf5fcf6){for(var _0xec88f4 in _0xf5fcf6){if(_0x19719b[_0x94e3('0x2a')](_0xec88f4)){_0x19719b[_0xec88f4]=_0xf5fcf6[_0xec88f4];}}};Realtime[_0x94e3('0x43')]['initAgents']=function(){var _0x365e1c=this;return function(_0x3ea2ea){if(_0x3ea2ea){freeIsNotKeyAgent(_0x3ea2ea,_0x365e1c['agents']);for(var _0x4699bb=0x0,_0x3743ae={},_0x1fa934={};_0x4699bb<_0x3ea2ea[_0x94e3('0x44')];_0x4699bb+=0x1){_0x3743ae=_0x3ea2ea[_0x4699bb];var _0x219f1e=_['isNil'](_0x3743ae['interface'])?util[_0x94e3('0x27')](_0x94e3('0x28'),_0x3743ae[_0x94e3('0x29')]):_0x3743ae[_0x94e3('0x2b')];if(_[_0x94e3('0x45')](_0x365e1c[_0x94e3('0x46')][_0x219f1e])){_0x365e1c[_0x94e3('0x46')][_0x219f1e]=new Agent(_0x3743ae);}else{_0x365e1c[_0x94e3('0x42')](_0x365e1c[_0x94e3('0x46')][_0x219f1e],_0x3743ae);}}}return _0x365e1c['agents'];};};Realtime[_0x94e3('0x43')][_0x94e3('0x47')]=function(){var _0x29df74=this;return function(_0x3d19b0){if(_0x3d19b0){freeIsNotKeySip(_0x3d19b0,_0x29df74['telephones']);for(var _0x385e1e=0x0,_0x38edf4={},_0x201f29={};_0x385e1e<_0x3d19b0[_0x94e3('0x44')];_0x385e1e+=0x1){_0x38edf4=_0x3d19b0[_0x385e1e];if(_['isUndefined'](_0x29df74['telephones'][util[_0x94e3('0x27')](_0x94e3('0x28'),_0x38edf4[_0x94e3('0x29')])])){_0x29df74[_0x94e3('0x13')][util[_0x94e3('0x27')]('SIP/%s',_0x38edf4[_0x94e3('0x29')])]=new Telephone(_0x38edf4);}else{_0x29df74['mergeFromDatabase'](_0x29df74['telephones'][util[_0x94e3('0x27')](_0x94e3('0x28'),_0x38edf4[_0x94e3('0x29')])],_0x38edf4);}}}return _0x29df74[_0x94e3('0x13')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x48')]=function(){var _0x1945d6=this;return function(_0x3a3a5b){if(_0x3a3a5b){freeIsNotKeySip(_0x3a3a5b,_0x1945d6[_0x94e3('0x14')]);for(var _0x391f68=0x0,_0x49f59b={},_0x26db08={};_0x391f68<_0x3a3a5b[_0x94e3('0x44')];_0x391f68+=0x1){_0x49f59b=_0x3a3a5b[_0x391f68];if(_[_0x94e3('0x45')](_0x1945d6['trunks'][util['format'](_0x94e3('0x28'),_0x49f59b[_0x94e3('0x29')])])){_0x1945d6[_0x94e3('0x14')][util['format']('SIP/%s',_0x49f59b[_0x94e3('0x29')])]=new Trunk(_0x49f59b);}else{_0x1945d6[_0x94e3('0x42')](_0x1945d6[_0x94e3('0x14')][util[_0x94e3('0x27')](_0x94e3('0x28'),_0x49f59b['name'])],_0x49f59b);}}}return _0x1945d6[_0x94e3('0x14')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0xffb532=this;return function(_0x518734){if(_0x518734){freeIsNotKey(_0x518734,_0xffb532[_0x94e3('0x15')],_0x94e3('0x29'));for(var _0x411f9c=0x0,_0x461556={},_0x5b9f0b={};_0x411f9c<_0x518734[_0x94e3('0x44')];_0x411f9c+=0x1){_0x461556=_0x518734[_0x411f9c];if(_['isUndefined'](_0xffb532['voiceQueues'][_0x461556[_0x94e3('0x29')]])){_0xffb532[_0x94e3('0x15')][_0x461556[_0x94e3('0x29')]]=new VoiceQueue(_0x461556);}else{_0xffb532[_0x94e3('0x42')](_0xffb532['voiceQueues'][_0x461556[_0x94e3('0x29')]],_0x461556);}}}return _0xffb532[_0x94e3('0x15')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x49')]=function(){var _0x12e487=this;return function(_0x43b39a){if(_0x43b39a){freeIsNotKey(_0x43b39a,_0x12e487[_0x94e3('0x16')],'id');for(var _0x2cb667=0x0,_0x35a08e={},_0x30a708={};_0x2cb667<_0x43b39a[_0x94e3('0x44')];_0x2cb667+=0x1){_0x35a08e=_0x43b39a[_0x2cb667];if(_[_0x94e3('0x45')](_0x12e487[_0x94e3('0x16')][_0x35a08e['id']])){_0x12e487['triggers'][_0x35a08e['id']]=new Trigger(_0x35a08e);}else{_0x12e487['mergeFromDatabase'](_0x12e487['triggers'][_0x35a08e['id']],_0x35a08e);}}}return _0x12e487[_0x94e3('0x16')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x4a')]=function(){var _0x366ddf=this;return function(_0x5f22a9){if(_0x5f22a9){freeIsNotKey(_0x5f22a9,_0x366ddf[_0x94e3('0x4b')],'id');for(var _0x26ecf9=0x0,_0x30a037={},_0x54d1fc={};_0x26ecf9<_0x5f22a9['length'];_0x26ecf9+=0x1){_0x30a037=_0x5f22a9[_0x26ecf9];if(_[_0x94e3('0x45')](_0x366ddf['templates'][_0x30a037['id']])){_0x366ddf[_0x94e3('0x4b')][_0x30a037['id']]=new Template(_0x30a037);}else{_0x366ddf['mergeFromDatabase'](_0x366ddf[_0x94e3('0x4b')][_0x30a037['id']],_0x30a037);}}}return _0x366ddf[_0x94e3('0x4b')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x4c')]=function(){var _0x5d2a1f=this;return function(_0x3bfca2){if(_0x3bfca2){freeIsNotKey(_0x3bfca2,_0x5d2a1f[_0x94e3('0x1d')],'id');for(var _0x422f6d=0x0,_0x334c34={},_0x22babe={};_0x422f6d<_0x3bfca2[_0x94e3('0x44')];_0x422f6d+=0x1){_0x334c34=_0x3bfca2[_0x422f6d];if(_['isUndefined'](_0x5d2a1f[_0x94e3('0x1d')][_0x334c34['id']])){_0x5d2a1f[_0x94e3('0x1d')][_0x334c34['id']]=new ZendeskAccount(_0x334c34);}else{_0x5d2a1f[_0x94e3('0x42')](_0x5d2a1f[_0x94e3('0x1d')][_0x334c34['id']],_0x334c34);}}}return _0x5d2a1f[_0x94e3('0x1d')];};};Realtime[_0x94e3('0x43')]['initSalesforceAccounts']=function(){var _0x52f423=this;return function(_0x49b9b1){if(_0x49b9b1){freeIsNotKey(_0x49b9b1,_0x52f423[_0x94e3('0x1e')],'id');for(var _0x26335a=0x0,_0x253606={},_0xfe01f9={};_0x26335a<_0x49b9b1[_0x94e3('0x44')];_0x26335a+=0x1){_0x253606=_0x49b9b1[_0x26335a];if(_['isUndefined'](_0x52f423[_0x94e3('0x1e')][_0x253606['id']])){_0x52f423[_0x94e3('0x1e')][_0x253606['id']]=new SalesforceAccount(_0x253606);}else{_0x52f423[_0x94e3('0x42')](_0x52f423[_0x94e3('0x1e')][_0x253606['id']],_0x253606);}}}return _0x52f423[_0x94e3('0x1e')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x4d')]=function(){var _0xa369eb=this;return function(_0xf4e87d){if(_0xf4e87d){freeIsNotKey(_0xf4e87d,_0xa369eb[_0x94e3('0x4e')],'id');for(var _0x572e8=0x0,_0x33f4e0={},_0x41189c={};_0x572e8<_0xf4e87d[_0x94e3('0x44')];_0x572e8+=0x1){_0x33f4e0=_0xf4e87d[_0x572e8];if(_[_0x94e3('0x45')](_0xa369eb['freshdeskAccounts'][_0x33f4e0['id']])){_0xa369eb['freshdeskAccounts'][_0x33f4e0['id']]=new FreshdeskAccount(_0x33f4e0);}else{_0xa369eb[_0x94e3('0x42')](_0xa369eb[_0x94e3('0x4e')][_0x33f4e0['id']],_0x33f4e0);}}}return _0xa369eb[_0x94e3('0x4e')];};};Realtime['prototype'][_0x94e3('0x4f')]=function(){var _0x12385e=this;return function(_0x52d97e){if(_0x52d97e){freeIsNotKey(_0x52d97e,_0x12385e[_0x94e3('0x1f')],'id');for(var _0x45757e=0x0,_0x3f4c08={},_0x3b4c3c={};_0x45757e<_0x52d97e[_0x94e3('0x44')];_0x45757e+=0x1){_0x3f4c08=_0x52d97e[_0x45757e];if(_['isUndefined'](_0x12385e[_0x94e3('0x1f')][_0x3f4c08['id']])){_0x12385e[_0x94e3('0x1f')][_0x3f4c08['id']]=new ZohoAccount(_0x3f4c08);}else{_0x12385e[_0x94e3('0x42')](_0x12385e['zohoAccounts'][_0x3f4c08['id']],_0x3f4c08);}}}return _0x12385e[_0x94e3('0x1f')];};};Realtime['prototype'][_0x94e3('0x50')]=function(){var _0x1ca714=this;return function(_0x38972c){if(_0x38972c){freeIsNotKey(_0x38972c,_0x1ca714[_0x94e3('0x20')],'id');for(var _0x39601f=0x0,_0x2498d5={},_0x14305b={};_0x39601f<_0x38972c[_0x94e3('0x44')];_0x39601f+=0x1){_0x2498d5=_0x38972c[_0x39601f];if(_[_0x94e3('0x45')](_0x1ca714[_0x94e3('0x20')][_0x2498d5['id']])){_0x1ca714[_0x94e3('0x20')][_0x2498d5['id']]=new DeskAccount(_0x2498d5);}else{_0x1ca714[_0x94e3('0x42')](_0x1ca714[_0x94e3('0x20')][_0x2498d5['id']],_0x2498d5);}}}return _0x1ca714[_0x94e3('0x20')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x45dfa7=this;return function(_0x2b34c3){if(_0x2b34c3){freeIsNotKey(_0x2b34c3,_0x45dfa7[_0x94e3('0x51')],'id');for(var _0x17b583=0x0,_0x210c88={},_0x34d93c={};_0x17b583<_0x2b34c3[_0x94e3('0x44')];_0x17b583+=0x1){_0x210c88=_0x2b34c3[_0x17b583];if(_[_0x94e3('0x45')](_0x45dfa7['sugarcrmAccounts'][_0x210c88['id']])){_0x45dfa7[_0x94e3('0x51')][_0x210c88['id']]=new SugarcrmAccount(_0x210c88);}else{_0x45dfa7['mergeFromDatabase'](_0x45dfa7[_0x94e3('0x51')][_0x210c88['id']],_0x210c88);}}}return _0x45dfa7[_0x94e3('0x51')];};};Realtime['prototype'][_0x94e3('0x52')]=function(){var _0x5d01a6=this;return function(_0xc1d4a5){if(_0xc1d4a5){freeIsNotKey(_0xc1d4a5,_0x5d01a6[_0x94e3('0x21')],'id');for(var _0x406b1b=0x0,_0x5d74a1={},_0x5efb56={};_0x406b1b<_0xc1d4a5[_0x94e3('0x44')];_0x406b1b+=0x1){_0x5d74a1=_0xc1d4a5[_0x406b1b];if(_[_0x94e3('0x45')](_0x5d01a6[_0x94e3('0x21')][_0x5d74a1['id']])){_0x5d01a6[_0x94e3('0x21')][_0x5d74a1['id']]=new VtigerAccount(_0x5d74a1);}else{_0x5d01a6[_0x94e3('0x42')](_0x5d01a6['vtigerAccounts'][_0x5d74a1['id']],_0x5d74a1);}}}return _0x5d01a6[_0x94e3('0x21')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x53')]=function(){var _0x3f29a3=this;return function(_0x119066){if(_0x119066){freeIsNotKey(_0x119066,_0x3f29a3[_0x94e3('0x22')],'id');for(var _0x278f61=0x0,_0x55346a={},_0x3012b4={};_0x278f61<_0x119066['length'];_0x278f61+=0x1){_0x55346a=_0x119066[_0x278f61];if(_['isUndefined'](_0x3f29a3['servicenowAccounts'][_0x55346a['id']])){_0x3f29a3[_0x94e3('0x22')][_0x55346a['id']]=new ServicenowAccount(_0x55346a);}else{_0x3f29a3['mergeFromDatabase'](_0x3f29a3[_0x94e3('0x22')][_0x55346a['id']],_0x55346a);}}}return _0x3f29a3['servicenowAccounts'];};};Realtime[_0x94e3('0x43')]['initDynamics365Accounts']=function(){var _0x23b4aa=this;return function(_0x5b59cc){if(_0x5b59cc){freeIsNotKey(_0x5b59cc,_0x23b4aa[_0x94e3('0x23')],'id');for(var _0x47da1d=0x0,_0x1c630b={},_0x2be021={};_0x47da1d<_0x5b59cc[_0x94e3('0x44')];_0x47da1d+=0x1){_0x1c630b=_0x5b59cc[_0x47da1d];if(_[_0x94e3('0x45')](_0x23b4aa['dynamics365Accounts'][_0x1c630b['id']])){_0x23b4aa[_0x94e3('0x23')][_0x1c630b['id']]=new Dynamics365Account(_0x1c630b);}else{_0x23b4aa[_0x94e3('0x42')](_0x23b4aa[_0x94e3('0x23')][_0x1c630b['id']],_0x1c630b);}}}return _0x23b4aa['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x5de5bd=this;return function(_0x2f5cd7){if(_0x2f5cd7){freeIsNotKey(_0x2f5cd7,_0x5de5bd[_0x94e3('0x24')],'id');for(var _0x2eb53c=0x0,_0xacaa0b={},_0x1e4fb6={};_0x2eb53c<_0x2f5cd7[_0x94e3('0x44')];_0x2eb53c+=0x1){_0xacaa0b=_0x2f5cd7[_0x2eb53c];if(_['isUndefined'](_0x5de5bd[_0x94e3('0x24')][_0xacaa0b['id']])){_0x5de5bd[_0x94e3('0x24')][_0xacaa0b['id']]=new FreshsalesAccount(_0xacaa0b);}else{_0x5de5bd['mergeFromDatabase'](_0x5de5bd[_0x94e3('0x24')][_0xacaa0b['id']],_0xacaa0b);}}}return _0x5de5bd['freshsalesAccounts'];};};Realtime[_0x94e3('0x43')][_0x94e3('0x54')]=function(){var _0x2c00ea=this;return function(_0xbc15c1){for(var _0x164585=0x0;_0x164585<_0xbc15c1[_0x94e3('0x44')];_0x164585+=0x1){_['merge'](_0x2c00ea['voiceQueues'][_0xbc15c1[_0x164585]['name']],_0xbc15c1[_0x164585]);}return _0x2c00ea[_0x94e3('0x15')];};};Realtime[_0x94e3('0x43')]['initVoiceQueueReports']=function(){var _0x5173ae=this;return function(_0xee8584){clearVoiceQueues(_0x5173ae['voiceQueues']);if(_0xee8584){_0xee8584=_[_0x94e3('0x55')](_0xee8584,_0x94e3('0x56'));for(var _0x26dcb6 in _0xee8584){if(_0xee8584[_0x94e3('0x2a')](_0x26dcb6)){var _0x586e13={};for(var _0x45cc43=0x0;_0x45cc43<_0xee8584[_0x26dcb6][_0x94e3('0x44')];_0x45cc43+=0x1){var _0x1a4ae5=_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x57')];if(_0x5173ae['voiceQueues'][_0x1a4ae5]){if(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x58')]){_0x5173ae['voiceQueues'][_0x1a4ae5][_0x94e3('0x32')]+=0x1;}if(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x59')]){_0x5173ae[_0x94e3('0x15')][_0x1a4ae5][_0x94e3('0x33')]+=0x1;}_0x5173ae[_0x94e3('0x15')][_0x1a4ae5][_0x94e3('0x2e')]+=moment(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x5a')])[_0x94e3('0x5b')](moment(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x5c')]),_0x94e3('0x5d'))||0x0;if(_0x45cc43===_0xee8584[_0x26dcb6]['length']-0x1){_0x5173ae[_0x94e3('0x15')][_0x1a4ae5]['sumDuration']+=moment(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x5e')]||_0xee8584[_0x26dcb6][_0x45cc43]['queuecallerabandonAt']||_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x5f')])[_0x94e3('0x5b')](moment(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x5c')]),_0x94e3('0x5d'))||0x0;_0x5173ae[_0x94e3('0x15')][_0x1a4ae5]['total']+=0x1;if(_0xee8584[_0x26dcb6][_0x45cc43]['queuecallercomplete']){_0x5173ae[_0x94e3('0x15')][_0x1a4ae5][_0x94e3('0x2d')]+=0x1;_0x5173ae[_0x94e3('0x15')][_0x1a4ae5][_0x94e3('0x35')]+=moment(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x5e')])[_0x94e3('0x5b')](moment(_0xee8584[_0x26dcb6][_0x45cc43][_0x94e3('0x5a')]),_0x94e3('0x5d'))||0x0;}}else{_0x5173ae['voiceQueues'][_0x1a4ae5][_0x94e3('0x34')]+=_0x5173ae[_0x94e3('0x15')][_0x1a4ae5]['sumHoldTime']||0x0;}}}}}}return _0x5173ae[_0x94e3('0x15')];};};Realtime['prototype'][_0x94e3('0x60')]=function(){var _0x4d1f91=this;return function(_0x5d228b){clearVoiceCallReports(_0x4d1f91[_0x94e3('0x18')]);if(_0x5d228b){for(var _0x2b24fa=0x0;_0x2b24fa<_0x5d228b[_0x94e3('0x44')];_0x2b24fa+=0x1){_0x4d1f91['outbound'][_0x94e3('0x2c')]+=0x1;_0x4d1f91[_0x94e3('0x18')][_0x94e3('0x34')]+=_0x5d228b[_0x2b24fa][_0x94e3('0x61')];if(_0x5d228b[_0x2b24fa]['disposition']===_0x94e3('0x62')){_0x4d1f91[_0x94e3('0x18')][_0x94e3('0x2d')]+=0x1;_0x4d1f91['outbound']['sumHoldTime']+=_0x5d228b[_0x2b24fa][_0x94e3('0x61')]-_0x5d228b[_0x2b24fa][_0x94e3('0x63')]||0x0;_0x4d1f91['outbound'][_0x94e3('0x35')]+=_0x5d228b[_0x2b24fa]['billableseconds'];}}}return _0x4d1f91[_0x94e3('0x18')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x64')]=function(){var _0x1ffb20=this;return function(_0x13f500){if(_0x13f500){freeIsNotKey(_0x13f500,_0x1ffb20[_0x94e3('0x17')],_0x94e3('0x29'));for(var _0x356b48=0x0,_0x300760={};_0x356b48<_0x13f500[_0x94e3('0x44')];_0x356b48+=0x1){_0x300760=_0x13f500[_0x356b48];if(_[_0x94e3('0x45')](_0x1ffb20[_0x94e3('0x17')][_0x300760[_0x94e3('0x29')]])){_0x1ffb20[_0x94e3('0x17')][_0x300760[_0x94e3('0x29')]]=new Campaign(_0x300760);}else{_0x1ffb20[_0x94e3('0x42')](_0x1ffb20[_0x94e3('0x17')][_0x300760[_0x94e3('0x29')]],_0x300760);_0x1ffb20[_0x94e3('0x17')][_0x300760[_0x94e3('0x29')]][_0x94e3('0x65')]=_0x300760['SquareProject']?_0x300760[_0x94e3('0x66')][_0x94e3('0x29')]:undefined;}}}return _0x1ffb20[_0x94e3('0x17')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x67')]=function(){var _0x190dea=this;return function(_0x55287a){if(_0x55287a){freeIsNotKey(_0x55287a,_0x190dea[_0x94e3('0x19')],'id');for(var _0x5f0f3c=0x0,_0x13b146={};_0x5f0f3c<_0x55287a['length'];_0x5f0f3c+=0x1){_0x13b146=_0x55287a[_0x5f0f3c];if(_[_0x94e3('0x45')](_0x190dea[_0x94e3('0x19')][_0x13b146['id']])){_0x190dea[_0x94e3('0x19')][_0x13b146['id']]=new VoiceExtension(_0x13b146);}else{_0x190dea[_0x94e3('0x42')](_0x190dea['voiceExtensions'][_0x13b146['id']],_0x13b146);}}}return _0x190dea[_0x94e3('0x19')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x68')]=function(){var _0x5391cc=this;return function(_0x2ba0b5){clearCampaigns(_0x5391cc['campaigns']);for(var _0x32ae59=0x0;_0x32ae59<_0x2ba0b5[_0x94e3('0x44')];_0x32ae59+=0x1){_[_0x94e3('0x69')](_0x5391cc[_0x94e3('0x17')][_0x2ba0b5[_0x32ae59][_0x94e3('0x29')]],_0x2ba0b5[_0x32ae59]);}return _0x5391cc[_0x94e3('0x17')];};};Realtime[_0x94e3('0x43')][_0x94e3('0x6a')]=function(){var _0x4776fe=this;return function(_0x560c2d){if(_0x560c2d){freeIsNotKey(_0x560c2d,_0x4776fe[_0x94e3('0x25')],'id');for(var _0x38a499=0x0,_0x445a1b={},_0x4c2fdf={};_0x38a499<_0x560c2d[_0x94e3('0x44')];_0x38a499+=0x1){_0x445a1b=_0x560c2d[_0x38a499];if(_[_0x94e3('0x45')](_0x4776fe['faxAccounts'][_0x445a1b['id']])){_0x4776fe[_0x94e3('0x25')][_0x445a1b['id']]=new FaxAccount(_0x445a1b);}else{_0x4776fe[_0x94e3('0x42')](_0x4776fe[_0x94e3('0x25')][_0x445a1b['id']],_0x445a1b);}}}return _0x4776fe[_0x94e3('0x25')];};};module[_0x94e3('0x6b')]=Realtime; \ No newline at end of file +var _0x3c72=['outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','merge','faxAccounts','exports','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','format','interface','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c72,0x1ee));var _0x23c7=function(_0x15eeee,_0x1e96ef){_0x15eeee=_0x15eeee-0x0;var _0x3a7658=_0x3c72[_0x15eeee];return _0x3a7658;};'use strict';var util=require(_0x23c7('0x0'));var _=require(_0x23c7('0x1'));var moment=require(_0x23c7('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x23c7('0x3'));var Trunk=require(_0x23c7('0x4'));var VoiceQueue=require(_0x23c7('0x5'));var Trigger=require(_0x23c7('0x6'));var Template=require(_0x23c7('0x7'));var Campaign=require(_0x23c7('0x8'));var VoiceExtension=require(_0x23c7('0x9'));var ZendeskAccount=require(_0x23c7('0xa'));var SalesforceAccount=require(_0x23c7('0xb'));var FreshdeskAccount=require(_0x23c7('0xc'));var SugarcrmAccount=require(_0x23c7('0xd'));var ZohoAccount=require(_0x23c7('0xe'));var DeskAccount=require(_0x23c7('0xf'));var VtigerAccount=require(_0x23c7('0x10'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x23c7('0x11'));var FreshsalesAccount=require(_0x23c7('0x12'));var FaxAccount=require(_0x23c7('0x13'));var Realtime=function(){this[_0x23c7('0x14')]={};this[_0x23c7('0x15')]={};this[_0x23c7('0x16')]={};this[_0x23c7('0x17')]={};this[_0x23c7('0x18')]={};this['campaigns']={};this[_0x23c7('0x19')]={};this[_0x23c7('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0x23c7('0x1b')]={};this[_0x23c7('0x1c')]={};this[_0x23c7('0x1d')]={};this[_0x23c7('0x1e')]={};this[_0x23c7('0x1f')]={};this['freshdeskAccounts']={};this[_0x23c7('0x20')]={};this[_0x23c7('0x21')]={};this[_0x23c7('0x22')]={};this[_0x23c7('0x23')]={};this[_0x23c7('0x24')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x4a8ee3,_0x20090a,_0x3f92d2){var _0x2a2038=_[_0x23c7('0x25')](_0x4a8ee3,function(_0x177adc,_0x3d1b2e){return _0x177adc[_0x3f92d2];});for(var _0x53cc3c in _0x20090a){if(_0x20090a[_0x23c7('0x26')](_0x53cc3c)){if(!_0x2a2038[_0x53cc3c]){delete _0x20090a[_0x53cc3c];}}}}function freeIsNotKeySip(_0x5e9ba1,_0x3bd98e){var _0x5ce1f6=_[_0x23c7('0x25')](_0x5e9ba1,function(_0x2fe5ef,_0x5a1df8){return util['format'](_0x23c7('0x27'),_0x2fe5ef[_0x23c7('0x28')]);});for(var _0x2f5a37 in _0x3bd98e){if(_0x3bd98e['hasOwnProperty'](_0x2f5a37)){if(!_0x5ce1f6[_0x2f5a37]){delete _0x3bd98e[_0x2f5a37];}}}}function freeIsNotKeyAgent(_0x8a83b6,_0x15c115){var _0x40c0e6=_[_0x23c7('0x25')](_0x8a83b6,function(_0x561500,_0x6e9b27){var _0x4ab331=_[_0x23c7('0x29')](_0x561500['interface'])?util[_0x23c7('0x2a')](_0x23c7('0x27'),_0x561500['name']):_0x561500[_0x23c7('0x2b')];return _0x4ab331;});for(var _0x484c00 in _0x15c115){if(_0x15c115['hasOwnProperty'](_0x484c00)){if(!_0x40c0e6[_0x484c00]){delete _0x15c115[_0x484c00];}}}}function clearVoiceCallReports(_0x596756){_0x596756[_0x23c7('0x2c')]=0x0;_0x596756['answered']=0x0;_0x596756[_0x23c7('0x2d')]=0x0;_0x596756[_0x23c7('0x2e')]=0x0;_0x596756[_0x23c7('0x2f')]=0x0;}function clearCampaigns(_0x53b250){if(!_[_0x23c7('0x30')](_0x53b250)){for(var _0x184d46 in _0x53b250){if(_0x53b250[_0x23c7('0x26')](_0x184d46)){_0x53b250[_0x184d46][_0x23c7('0x31')]=0x0;_0x53b250[_0x184d46][_0x23c7('0x32')]=0x0;}}}}function clearVoiceQueues(_0x36ff4b){if(!_[_0x23c7('0x30')](_0x36ff4b)){for(var _0x5d7a61 in _0x36ff4b){if(_0x36ff4b[_0x23c7('0x26')](_0x5d7a61)){_0x36ff4b[_0x5d7a61]['total']=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x33')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x34')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x35')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x2d')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x2e')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x2f')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x36')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x37')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x38')]=0x0;_0x36ff4b[_0x5d7a61]['outboundCongestionCallsDay']=0x0;_0x36ff4b[_0x5d7a61]['outboundNoSuchCallsDay']=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x39')]=0x0;_0x36ff4b[_0x5d7a61]['outboundDropCallsDayTimeout']=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x3a')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x3b')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x3c')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x3d')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x3e')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x36')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x3f')]=0x0;_0x36ff4b[_0x5d7a61][_0x23c7('0x40')]=!![];}}}}Realtime[_0x23c7('0x41')][_0x23c7('0x42')]=function(_0x256e8a,_0x7bff29){for(var _0x47a819 in _0x7bff29){if(_0x256e8a[_0x23c7('0x26')](_0x47a819)){_0x256e8a[_0x47a819]=_0x7bff29[_0x47a819];}}};Realtime['prototype'][_0x23c7('0x43')]=function(){var _0x24d51d=this;return function(_0x27e28a){if(_0x27e28a){freeIsNotKeyAgent(_0x27e28a,_0x24d51d[_0x23c7('0x14')]);for(var _0x48fa91=0x0,_0x31bd8b={},_0x2ab569={};_0x48fa91<_0x27e28a[_0x23c7('0x44')];_0x48fa91+=0x1){_0x31bd8b=_0x27e28a[_0x48fa91];var _0x2a22ac=_[_0x23c7('0x29')](_0x31bd8b['interface'])?util['format']('SIP/%s',_0x31bd8b['name']):_0x31bd8b[_0x23c7('0x2b')];if(_[_0x23c7('0x45')](_0x24d51d[_0x23c7('0x14')][_0x2a22ac])){_0x24d51d['agents'][_0x2a22ac]=new Agent(_0x31bd8b);}else{_0x24d51d[_0x23c7('0x42')](_0x24d51d[_0x23c7('0x14')][_0x2a22ac],_0x31bd8b);}}}return _0x24d51d[_0x23c7('0x14')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x46')]=function(){var _0x3f71f1=this;return function(_0x4d7fa5){if(_0x4d7fa5){freeIsNotKeySip(_0x4d7fa5,_0x3f71f1[_0x23c7('0x15')]);for(var _0x4824ef=0x0,_0xbdb878={},_0x516f19={};_0x4824ef<_0x4d7fa5[_0x23c7('0x44')];_0x4824ef+=0x1){_0xbdb878=_0x4d7fa5[_0x4824ef];if(_[_0x23c7('0x45')](_0x3f71f1['telephones'][util[_0x23c7('0x2a')](_0x23c7('0x27'),_0xbdb878[_0x23c7('0x28')])])){_0x3f71f1['telephones'][util['format'](_0x23c7('0x27'),_0xbdb878['name'])]=new Telephone(_0xbdb878);}else{_0x3f71f1['mergeFromDatabase'](_0x3f71f1[_0x23c7('0x15')][util[_0x23c7('0x2a')](_0x23c7('0x27'),_0xbdb878['name'])],_0xbdb878);}}}return _0x3f71f1['telephones'];};};Realtime[_0x23c7('0x41')][_0x23c7('0x47')]=function(){var _0x1bb9d3=this;return function(_0x21789e){if(_0x21789e){freeIsNotKeySip(_0x21789e,_0x1bb9d3['trunks']);for(var _0x32948c=0x0,_0x23eb87={},_0x4265ae={};_0x32948c<_0x21789e['length'];_0x32948c+=0x1){_0x23eb87=_0x21789e[_0x32948c];if(_[_0x23c7('0x45')](_0x1bb9d3[_0x23c7('0x16')][util[_0x23c7('0x2a')](_0x23c7('0x27'),_0x23eb87['name'])])){_0x1bb9d3[_0x23c7('0x16')][util[_0x23c7('0x2a')](_0x23c7('0x27'),_0x23eb87[_0x23c7('0x28')])]=new Trunk(_0x23eb87);}else{_0x1bb9d3['mergeFromDatabase'](_0x1bb9d3['trunks'][util[_0x23c7('0x2a')](_0x23c7('0x27'),_0x23eb87[_0x23c7('0x28')])],_0x23eb87);}}}return _0x1bb9d3[_0x23c7('0x16')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x48')]=function(){var _0x1ee16a=this;return function(_0x2c88fe){if(_0x2c88fe){freeIsNotKey(_0x2c88fe,_0x1ee16a[_0x23c7('0x17')],_0x23c7('0x28'));for(var _0x5e4e8c=0x0,_0xd5635d={},_0x43c41d={};_0x5e4e8c<_0x2c88fe[_0x23c7('0x44')];_0x5e4e8c+=0x1){_0xd5635d=_0x2c88fe[_0x5e4e8c];if(_['isUndefined'](_0x1ee16a[_0x23c7('0x17')][_0xd5635d[_0x23c7('0x28')]])){_0x1ee16a[_0x23c7('0x17')][_0xd5635d[_0x23c7('0x28')]]=new VoiceQueue(_0xd5635d);}else{_0x1ee16a['mergeFromDatabase'](_0x1ee16a['voiceQueues'][_0xd5635d[_0x23c7('0x28')]],_0xd5635d);}}}return _0x1ee16a[_0x23c7('0x17')];};};Realtime['prototype'][_0x23c7('0x49')]=function(){var _0x513ba0=this;return function(_0x59a81d){if(_0x59a81d){freeIsNotKey(_0x59a81d,_0x513ba0[_0x23c7('0x18')],'id');for(var _0x60a0f4=0x0,_0xb02656={},_0x17ef3e={};_0x60a0f4<_0x59a81d[_0x23c7('0x44')];_0x60a0f4+=0x1){_0xb02656=_0x59a81d[_0x60a0f4];if(_[_0x23c7('0x45')](_0x513ba0[_0x23c7('0x18')][_0xb02656['id']])){_0x513ba0['triggers'][_0xb02656['id']]=new Trigger(_0xb02656);}else{_0x513ba0[_0x23c7('0x42')](_0x513ba0[_0x23c7('0x18')][_0xb02656['id']],_0xb02656);}}}return _0x513ba0[_0x23c7('0x18')];};};Realtime[_0x23c7('0x41')]['initTemplates']=function(){var _0x44035e=this;return function(_0x59004e){if(_0x59004e){freeIsNotKey(_0x59004e,_0x44035e['templates'],'id');for(var _0x3b74d4=0x0,_0x301c40={},_0x3fc277={};_0x3b74d4<_0x59004e[_0x23c7('0x44')];_0x3b74d4+=0x1){_0x301c40=_0x59004e[_0x3b74d4];if(_[_0x23c7('0x45')](_0x44035e[_0x23c7('0x19')][_0x301c40['id']])){_0x44035e[_0x23c7('0x19')][_0x301c40['id']]=new Template(_0x301c40);}else{_0x44035e[_0x23c7('0x42')](_0x44035e[_0x23c7('0x19')][_0x301c40['id']],_0x301c40);}}}return _0x44035e[_0x23c7('0x19')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x3db939=this;return function(_0x72ae6c){if(_0x72ae6c){freeIsNotKey(_0x72ae6c,_0x3db939['zendeskAccounts'],'id');for(var _0x6dceb5=0x0,_0x184bf3={},_0x53f821={};_0x6dceb5<_0x72ae6c[_0x23c7('0x44')];_0x6dceb5+=0x1){_0x184bf3=_0x72ae6c[_0x6dceb5];if(_[_0x23c7('0x45')](_0x3db939[_0x23c7('0x1d')][_0x184bf3['id']])){_0x3db939[_0x23c7('0x1d')][_0x184bf3['id']]=new ZendeskAccount(_0x184bf3);}else{_0x3db939[_0x23c7('0x42')](_0x3db939[_0x23c7('0x1d')][_0x184bf3['id']],_0x184bf3);}}}return _0x3db939[_0x23c7('0x1d')];};};Realtime['prototype'][_0x23c7('0x4a')]=function(){var _0x52aadf=this;return function(_0x52a81c){if(_0x52a81c){freeIsNotKey(_0x52a81c,_0x52aadf['salesforceAccounts'],'id');for(var _0x4e9ce=0x0,_0x32f7aa={},_0x368372={};_0x4e9ce<_0x52a81c['length'];_0x4e9ce+=0x1){_0x32f7aa=_0x52a81c[_0x4e9ce];if(_[_0x23c7('0x45')](_0x52aadf[_0x23c7('0x1e')][_0x32f7aa['id']])){_0x52aadf[_0x23c7('0x1e')][_0x32f7aa['id']]=new SalesforceAccount(_0x32f7aa);}else{_0x52aadf[_0x23c7('0x42')](_0x52aadf[_0x23c7('0x1e')][_0x32f7aa['id']],_0x32f7aa);}}}return _0x52aadf[_0x23c7('0x1e')];};};Realtime[_0x23c7('0x41')]['initFreshdeskAccounts']=function(){var _0x47d522=this;return function(_0x58c64a){if(_0x58c64a){freeIsNotKey(_0x58c64a,_0x47d522['freshdeskAccounts'],'id');for(var _0x9be4b8=0x0,_0x3dbac0={},_0x19e776={};_0x9be4b8<_0x58c64a[_0x23c7('0x44')];_0x9be4b8+=0x1){_0x3dbac0=_0x58c64a[_0x9be4b8];if(_[_0x23c7('0x45')](_0x47d522[_0x23c7('0x4b')][_0x3dbac0['id']])){_0x47d522[_0x23c7('0x4b')][_0x3dbac0['id']]=new FreshdeskAccount(_0x3dbac0);}else{_0x47d522[_0x23c7('0x42')](_0x47d522[_0x23c7('0x4b')][_0x3dbac0['id']],_0x3dbac0);}}}return _0x47d522[_0x23c7('0x4b')];};};Realtime['prototype'][_0x23c7('0x4c')]=function(){var _0x481d66=this;return function(_0x18640f){if(_0x18640f){freeIsNotKey(_0x18640f,_0x481d66[_0x23c7('0x20')],'id');for(var _0x46e233=0x0,_0x317dee={},_0x3f34c9={};_0x46e233<_0x18640f[_0x23c7('0x44')];_0x46e233+=0x1){_0x317dee=_0x18640f[_0x46e233];if(_[_0x23c7('0x45')](_0x481d66[_0x23c7('0x20')][_0x317dee['id']])){_0x481d66[_0x23c7('0x20')][_0x317dee['id']]=new ZohoAccount(_0x317dee);}else{_0x481d66[_0x23c7('0x42')](_0x481d66[_0x23c7('0x20')][_0x317dee['id']],_0x317dee);}}}return _0x481d66[_0x23c7('0x20')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x3c7c51=this;return function(_0x506a7d){if(_0x506a7d){freeIsNotKey(_0x506a7d,_0x3c7c51[_0x23c7('0x21')],'id');for(var _0x44907d=0x0,_0x5b64b7={},_0x3dfb7c={};_0x44907d<_0x506a7d[_0x23c7('0x44')];_0x44907d+=0x1){_0x5b64b7=_0x506a7d[_0x44907d];if(_[_0x23c7('0x45')](_0x3c7c51[_0x23c7('0x21')][_0x5b64b7['id']])){_0x3c7c51[_0x23c7('0x21')][_0x5b64b7['id']]=new DeskAccount(_0x5b64b7);}else{_0x3c7c51[_0x23c7('0x42')](_0x3c7c51['deskAccounts'][_0x5b64b7['id']],_0x5b64b7);}}}return _0x3c7c51[_0x23c7('0x21')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x4d')]=function(){var _0x321f56=this;return function(_0x40f5a2){if(_0x40f5a2){freeIsNotKey(_0x40f5a2,_0x321f56[_0x23c7('0x1f')],'id');for(var _0x4bd94d=0x0,_0x42f508={},_0x16b1bf={};_0x4bd94d<_0x40f5a2[_0x23c7('0x44')];_0x4bd94d+=0x1){_0x42f508=_0x40f5a2[_0x4bd94d];if(_[_0x23c7('0x45')](_0x321f56[_0x23c7('0x1f')][_0x42f508['id']])){_0x321f56[_0x23c7('0x1f')][_0x42f508['id']]=new SugarcrmAccount(_0x42f508);}else{_0x321f56[_0x23c7('0x42')](_0x321f56['sugarcrmAccounts'][_0x42f508['id']],_0x42f508);}}}return _0x321f56[_0x23c7('0x1f')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x4e')]=function(){var _0x5abbc7=this;return function(_0x261ead){if(_0x261ead){freeIsNotKey(_0x261ead,_0x5abbc7['vtigerAccounts'],'id');for(var _0x41980a=0x0,_0x486e2b={},_0x49098e={};_0x41980a<_0x261ead['length'];_0x41980a+=0x1){_0x486e2b=_0x261ead[_0x41980a];if(_[_0x23c7('0x45')](_0x5abbc7[_0x23c7('0x22')][_0x486e2b['id']])){_0x5abbc7[_0x23c7('0x22')][_0x486e2b['id']]=new VtigerAccount(_0x486e2b);}else{_0x5abbc7[_0x23c7('0x42')](_0x5abbc7[_0x23c7('0x22')][_0x486e2b['id']],_0x486e2b);}}}return _0x5abbc7[_0x23c7('0x22')];};};Realtime['prototype'][_0x23c7('0x4f')]=function(){var _0x329bf8=this;return function(_0x9ee39f){if(_0x9ee39f){freeIsNotKey(_0x9ee39f,_0x329bf8[_0x23c7('0x23')],'id');for(var _0x1d0c4f=0x0,_0x2d64c7={},_0x57d43f={};_0x1d0c4f<_0x9ee39f[_0x23c7('0x44')];_0x1d0c4f+=0x1){_0x2d64c7=_0x9ee39f[_0x1d0c4f];if(_[_0x23c7('0x45')](_0x329bf8[_0x23c7('0x23')][_0x2d64c7['id']])){_0x329bf8[_0x23c7('0x23')][_0x2d64c7['id']]=new ServicenowAccount(_0x2d64c7);}else{_0x329bf8[_0x23c7('0x42')](_0x329bf8[_0x23c7('0x23')][_0x2d64c7['id']],_0x2d64c7);}}}return _0x329bf8[_0x23c7('0x23')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x50')]=function(){var _0x28b8e2=this;return function(_0x52ac32){if(_0x52ac32){freeIsNotKey(_0x52ac32,_0x28b8e2[_0x23c7('0x24')],'id');for(var _0x247cee=0x0,_0x3779d9={},_0x19c349={};_0x247cee<_0x52ac32[_0x23c7('0x44')];_0x247cee+=0x1){_0x3779d9=_0x52ac32[_0x247cee];if(_['isUndefined'](_0x28b8e2[_0x23c7('0x24')][_0x3779d9['id']])){_0x28b8e2['dynamics365Accounts'][_0x3779d9['id']]=new Dynamics365Account(_0x3779d9);}else{_0x28b8e2['mergeFromDatabase'](_0x28b8e2[_0x23c7('0x24')][_0x3779d9['id']],_0x3779d9);}}}return _0x28b8e2[_0x23c7('0x24')];};};Realtime['prototype'][_0x23c7('0x51')]=function(){var _0x583583=this;return function(_0x2bd688){if(_0x2bd688){freeIsNotKey(_0x2bd688,_0x583583[_0x23c7('0x52')],'id');for(var _0x473f02=0x0,_0x2713c1={},_0x59196d={};_0x473f02<_0x2bd688[_0x23c7('0x44')];_0x473f02+=0x1){_0x2713c1=_0x2bd688[_0x473f02];if(_[_0x23c7('0x45')](_0x583583[_0x23c7('0x52')][_0x2713c1['id']])){_0x583583[_0x23c7('0x52')][_0x2713c1['id']]=new FreshsalesAccount(_0x2713c1);}else{_0x583583[_0x23c7('0x42')](_0x583583['freshsalesAccounts'][_0x2713c1['id']],_0x2713c1);}}}return _0x583583[_0x23c7('0x52')];};};Realtime[_0x23c7('0x41')]['initVoiceQueueHopperHistory']=function(){var _0x4d44f9=this;return function(_0x12c26f){for(var _0x1abd7f=0x0;_0x1abd7f<_0x12c26f[_0x23c7('0x44')];_0x1abd7f+=0x1){_['merge'](_0x4d44f9[_0x23c7('0x17')][_0x12c26f[_0x1abd7f]['name']],_0x12c26f[_0x1abd7f]);}return _0x4d44f9[_0x23c7('0x17')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x53')]=function(){var _0x2873d9=this;return function(_0x4e46fe){clearVoiceQueues(_0x2873d9[_0x23c7('0x17')]);if(_0x4e46fe){_0x4e46fe=_[_0x23c7('0x54')](_0x4e46fe,_0x23c7('0x55'));for(var _0x550d20 in _0x4e46fe){if(_0x4e46fe[_0x23c7('0x26')](_0x550d20)){var _0x584807={};for(var _0x1125da=0x0;_0x1125da<_0x4e46fe[_0x550d20][_0x23c7('0x44')];_0x1125da+=0x1){var _0x16bd82=_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x56')];if(_0x2873d9['voiceQueues'][_0x16bd82]){if(_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x57')]){_0x2873d9[_0x23c7('0x17')][_0x16bd82][_0x23c7('0x34')]+=0x1;}if(_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x58')]){_0x2873d9[_0x23c7('0x17')][_0x16bd82]['abandoned']+=0x1;}_0x2873d9[_0x23c7('0x17')][_0x16bd82][_0x23c7('0x2d')]+=moment(_0x4e46fe[_0x550d20][_0x1125da]['queuecallerleaveAt'])[_0x23c7('0x59')](moment(_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x5a')]),_0x23c7('0x5b'))||0x0;if(_0x1125da===_0x4e46fe[_0x550d20][_0x23c7('0x44')]-0x1){_0x2873d9['voiceQueues'][_0x16bd82][_0x23c7('0x2e')]+=moment(_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x5c')]||_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x5d')]||_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x5e')])[_0x23c7('0x59')](moment(_0x4e46fe[_0x550d20][_0x1125da]['queuecallerjoinAt']),_0x23c7('0x5b'))||0x0;_0x2873d9['voiceQueues'][_0x16bd82][_0x23c7('0x2c')]+=0x1;if(_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x5f')]){_0x2873d9['voiceQueues'][_0x16bd82][_0x23c7('0x33')]+=0x1;_0x2873d9[_0x23c7('0x17')][_0x16bd82][_0x23c7('0x2f')]+=moment(_0x4e46fe[_0x550d20][_0x1125da]['queuecallercompleteAt'])[_0x23c7('0x59')](moment(_0x4e46fe[_0x550d20][_0x1125da][_0x23c7('0x60')]),_0x23c7('0x5b'))||0x0;}}else{_0x2873d9[_0x23c7('0x17')][_0x16bd82][_0x23c7('0x2e')]+=_0x2873d9[_0x23c7('0x17')][_0x16bd82][_0x23c7('0x2d')]||0x0;}}}}}}return _0x2873d9[_0x23c7('0x17')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x61')]=function(){var _0x5064b3=this;return function(_0x481922){clearVoiceCallReports(_0x5064b3[_0x23c7('0x1a')]);if(_0x481922){for(var _0x268c5c=0x0;_0x268c5c<_0x481922['length'];_0x268c5c+=0x1){_0x5064b3[_0x23c7('0x1a')][_0x23c7('0x2c')]+=0x1;_0x5064b3['outbound'][_0x23c7('0x2e')]+=_0x481922[_0x268c5c][_0x23c7('0x62')];if(_0x481922[_0x268c5c][_0x23c7('0x63')]===_0x23c7('0x64')){_0x5064b3[_0x23c7('0x1a')][_0x23c7('0x33')]+=0x1;_0x5064b3['outbound'][_0x23c7('0x2d')]+=_0x481922[_0x268c5c][_0x23c7('0x62')]-_0x481922[_0x268c5c][_0x23c7('0x65')]||0x0;_0x5064b3[_0x23c7('0x1a')]['sumBillable']+=_0x481922[_0x268c5c]['billableseconds'];}}}return _0x5064b3[_0x23c7('0x1a')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x66')]=function(){var _0x4b3085=this;return function(_0x5c5ebe){if(_0x5c5ebe){freeIsNotKey(_0x5c5ebe,_0x4b3085[_0x23c7('0x67')],_0x23c7('0x28'));for(var _0x3d465a=0x0,_0xcf9e3b={};_0x3d465a<_0x5c5ebe[_0x23c7('0x44')];_0x3d465a+=0x1){_0xcf9e3b=_0x5c5ebe[_0x3d465a];if(_[_0x23c7('0x45')](_0x4b3085[_0x23c7('0x67')][_0xcf9e3b[_0x23c7('0x28')]])){_0x4b3085[_0x23c7('0x67')][_0xcf9e3b['name']]=new Campaign(_0xcf9e3b);}else{_0x4b3085[_0x23c7('0x42')](_0x4b3085[_0x23c7('0x67')][_0xcf9e3b[_0x23c7('0x28')]],_0xcf9e3b);_0x4b3085['campaigns'][_0xcf9e3b[_0x23c7('0x28')]][_0x23c7('0x68')]=_0xcf9e3b['SquareProject']?_0xcf9e3b[_0x23c7('0x69')][_0x23c7('0x28')]:undefined;}}}return _0x4b3085[_0x23c7('0x67')];};};Realtime[_0x23c7('0x41')]['initVoiceExtensions']=function(){var _0x455d0a=this;return function(_0x46eafa){if(_0x46eafa){freeIsNotKey(_0x46eafa,_0x455d0a[_0x23c7('0x6a')],'id');for(var _0x4d040e=0x0,_0x4a3fc4={};_0x4d040e<_0x46eafa[_0x23c7('0x44')];_0x4d040e+=0x1){_0x4a3fc4=_0x46eafa[_0x4d040e];if(_[_0x23c7('0x45')](_0x455d0a[_0x23c7('0x6a')][_0x4a3fc4['id']])){_0x455d0a[_0x23c7('0x6a')][_0x4a3fc4['id']]=new VoiceExtension(_0x4a3fc4);}else{_0x455d0a[_0x23c7('0x42')](_0x455d0a[_0x23c7('0x6a')][_0x4a3fc4['id']],_0x4a3fc4);}}}return _0x455d0a[_0x23c7('0x6a')];};};Realtime[_0x23c7('0x41')][_0x23c7('0x6b')]=function(){var _0x504329=this;return function(_0x220aa8){clearCampaigns(_0x504329['campaigns']);for(var _0x318285=0x0;_0x318285<_0x220aa8['length'];_0x318285+=0x1){_[_0x23c7('0x6c')](_0x504329[_0x23c7('0x67')][_0x220aa8[_0x318285][_0x23c7('0x28')]],_0x220aa8[_0x318285]);}return _0x504329[_0x23c7('0x67')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x2824ed=this;return function(_0x1488c1){if(_0x1488c1){freeIsNotKey(_0x1488c1,_0x2824ed['faxAccounts'],'id');for(var _0x1a3268=0x0,_0x1a1eab={},_0x397271={};_0x1a3268<_0x1488c1[_0x23c7('0x44')];_0x1a3268+=0x1){_0x1a1eab=_0x1488c1[_0x1a3268];if(_[_0x23c7('0x45')](_0x2824ed[_0x23c7('0x6d')][_0x1a1eab['id']])){_0x2824ed[_0x23c7('0x6d')][_0x1a1eab['id']]=new FaxAccount(_0x1a1eab);}else{_0x2824ed[_0x23c7('0x42')](_0x2824ed[_0x23c7('0x6d')][_0x1a1eab['id']],_0x1a1eab);}}}return _0x2824ed['faxAccounts'];};};module[_0x23c7('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 0dc8842..00a53ac 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 _0xa1bf=['callerid','from-sip','destinationchannel','calleridnum','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','type','UserId','split','membername','monitor','monitors','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','voiceAgentReport','forEach','indexOf','mobile','phone','lastIndexOf','blindTransfer','transfererlinkedid','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','length','connectedlinenum','assigned','interface','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','getAgentByInternal','keys','getCallType','channel','outbound','internal','destination','exten','dialer','lastapplication','context','from-voip-provider'];(function(_0x5811f0,_0x13ba47){var _0x3f7013=function(_0x5b9d11){while(--_0x5b9d11){_0x5811f0['push'](_0x5811f0['shift']());}};_0x3f7013(++_0x13ba47);}(_0xa1bf,0x76));var _0xfa1b=function(_0x3c69dc,_0x326c72){_0x3c69dc=_0x3c69dc-0x0;var _0x18ac53=_0xa1bf[_0x3c69dc];return _0x18ac53;};'use strict';var _=require(_0xfa1b('0x0'));var moment=require(_0xfa1b('0x1'));var util=require(_0xfa1b('0x2'));var config=require('../../../config/environment');var ami=require(_0xfa1b('0x3'));var RpcVoiceAgentReport=require(_0xfa1b('0x4'));var RpcVoiceCallReport=require(_0xfa1b('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xfa1b('0x6'));var RpcVoiceQueueReport=require(_0xfa1b('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xfa1b('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xfa1b('0x9'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xfa1b('0xa'));function Report(_0x5157ba){this[_0xfa1b('0xb')]=_0x5157ba;this[_0xfa1b('0xc')]=_0x5157ba[_0xfa1b('0xc')];this[_0xfa1b('0xd')]=_0x5157ba[_0xfa1b('0xd')];}Report[_0xfa1b('0xe')][_0xfa1b('0xf')]=function(_0x1466f6){var _0x1e2399=new VoiceQueueReport(this['realtime']);var _0x4e5903=new VoiceAgentReport(this[_0xfa1b('0xb')]);var _0x2feced=new VoiceDialReport(this[_0xfa1b('0xb')]);var _0x5b3749=new VoiceCallReport(this[_0xfa1b('0xb')]);var _0x4dc5a5=new UserReport(this[_0xfa1b('0xb')]);if(config['xdr']&&config[_0xfa1b('0x10')]['disabled']){ami['on'](_0xfa1b('0x11'),this[_0xfa1b('0x12')][_0xfa1b('0x13')](this));ami['on'](_0xfa1b('0x14'),this[_0xfa1b('0x15')][_0xfa1b('0x13')](this));ami['on'](_0xfa1b('0x16'),this['voiceAgentReport'][_0xfa1b('0x13')](this));ami['on'](_0xfa1b('0x17'),this[_0xfa1b('0x18')][_0xfa1b('0x13')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0xfa1b('0x19'),this[_0xfa1b('0x1a')]['bind'](this));}};Report[_0xfa1b('0xe')][_0xfa1b('0x1b')]=function(_0x4bd9ab){var _0x328cf8;_0x328cf8=_[_0xfa1b('0x1c')](this[_0xfa1b('0xc')],function(_0xf30b0){return _0xf30b0[_0xfa1b('0x1d')]==_0x4bd9ab||_0xf30b0[_0xfa1b('0x1e')]==_0x4bd9ab;});if(_[_0xfa1b('0x1f')](_0x328cf8)){var _0xa6485=_['find'](this[_0xfa1b('0xd')],function(_0x9c5ad2){return _0x9c5ad2[_0xfa1b('0x1d')]==_0x4bd9ab||_0x9c5ad2[_0xfa1b('0x1e')]==_0x4bd9ab;});if(_0xa6485){_0x328cf8=_['find'](this['agents'],function(_0x2f5510){return _0x2f5510['interface']==util['format']('SIP/%s',_0xa6485['name']);});}}return _0x328cf8;};Report[_0xfa1b('0xe')][_0xfa1b('0x12')]=function(_0x109a37){for(var _0x24cfcf=0x0;_0x24cfcf<_0x109a37[_0xfa1b('0x20')];_0x24cfcf+=0x1){var _0x16c381=this[_0xfa1b('0x1b')](_0x109a37[_0x24cfcf][_0xfa1b('0x21')]);if(_0x16c381){_0x109a37[_0x24cfcf][_0xfa1b('0x1d')]=_0x16c381['accountcode'];_0x109a37[_0x24cfcf][_0xfa1b('0x22')]=!![];_0x109a37[_0x24cfcf]['lastAssignedTo']=_0x16c381[_0xfa1b('0x1e')];_0x109a37[_0x24cfcf][_0xfa1b('0x23')]=_[_0xfa1b('0x1f')](_0x16c381[_0xfa1b('0x23')])?util[_0xfa1b('0x24')](_0xfa1b('0x25'),_0x16c381[_0xfa1b('0x1e')]):_0x16c381[_0xfa1b('0x23')];if(_0x109a37[_0x24cfcf][_0xfa1b('0x26')]){_0x109a37[_0x24cfcf][_0xfa1b('0x27')]=moment()[_0xfa1b('0x24')](_0xfa1b('0x28'));}if(_0x109a37[_0x24cfcf][_0xfa1b('0x29')]){_0x109a37[_0x24cfcf]['queuecallerexitAt']=moment()[_0xfa1b('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xfa1b('0x12')](_0x109a37[_0x24cfcf]);}RpcVoiceQueueReport[_0xfa1b('0x2a')](_0x109a37[_0x24cfcf]);}};function extractCalleridNumber(_0x197a8e){var _0x3002f9=_0x197a8e[_0xfa1b('0x2b')](/<(.*?)>/);return _0x3002f9?_0x3002f9[0x1]:_0x197a8e;}Report[_0xfa1b('0xe')][_0xfa1b('0x2c')]=function(_0x26d59e){for(var _0xe0e969=0x0;_0xe0e969/);return _0x5b14d5?_0x5b14d5[0x1]:_0x2fd7c7;}Report[_0x8a4d('0xf')]['getAgentByInternal']=function(_0x3ee406){for(var _0xe9a283=0x0;_0xe9a283',_0x3f6d66[_0x8a4d('0x43')],_0x3f6d66['calleridnum']);}if(RpcVoiceTransferReport[_0x8a4d('0x44')][_0x3f6d66[_0x8a4d('0x45')]]){var _0x869dc9=RpcVoiceTransferReport[_0x8a4d('0x44')][_0x3f6d66[_0x8a4d('0x45')]];_0x869dc9[_0x8a4d('0x46')]=_0x3f6d66['uniqueid'];RpcVoiceTransferReport[_0x8a4d('0x1d')](_0x869dc9);delete RpcVoiceTransferReport[_0x8a4d('0x44')][_0x3f6d66[_0x8a4d('0x45')]];}if(_[_0x8a4d('0x23')](_0x3f6d66[_0x8a4d('0x36')])){_0x3f6d66[_0x8a4d('0x36')]=this[_0x8a4d('0x2f')](_0x3f6d66);}if(_[_0x8a4d('0x23')](_0x3f6d66[_0x8a4d('0x47')])){var _0x4fe5e0=_0x3f6d66[_0x8a4d('0x30')][_0x8a4d('0x48')]('-')[0x0];var _0x3e59d6=this[_0x8a4d('0xd')][_0x4fe5e0];if(!_0x3e59d6)_0x3e59d6=this[_0x8a4d('0x31')](_0x3f6d66[_0x8a4d('0x21')]);if(_0x3e59d6){_0x3f6d66[_0x8a4d('0x47')]=_0x3e59d6['id'];_0x3f6d66['membername']=_0x3e59d6['name'];}}RpcVoiceCallReport['create'](_0x3f6d66);if(_0x3f6d66[_0x8a4d('0x49')]){for(var _0xefc7f8=0x0;_0xefc7f8<_0x3f6d66[_0x8a4d('0x4a')][_0x8a4d('0x26')];_0xefc7f8+=0x1){_0x3f6d66[_0x8a4d('0x4b')]=_0x3f6d66['monitors'][_0xefc7f8][_0x8a4d('0x4c')];_0x3f6d66[_0x8a4d('0x4d')]=_0x3f6d66[_0x8a4d('0x4a')][_0xefc7f8][_0x8a4d('0x4d')];if(_0x3f6d66[_0x8a4d('0x35')]==_0x8a4d('0x3e')){_0x3f6d66['calleridnum']=_0x3f6d66[_0x8a4d('0x27')];_0x3f6d66[_0x8a4d('0x43')]=_0x3f6d66[_0x8a4d('0x4e')];_0x3f6d66[_0x8a4d('0x27')]=_0x3f6d66[_0x8a4d('0x21')];_0x3f6d66[_0x8a4d('0x4e')]=_0x3f6d66[_0x8a4d('0x4f')];_0x3f6d66[_0x8a4d('0x35')]=_0x3f6d66[_0x8a4d('0x40')];}else if(_0x3f6d66[_0x8a4d('0x35')]=='xcally-motion-dialer'){_0x3f6d66['calleridnum']=_0x3f6d66[_0x8a4d('0x34')];_0x3f6d66[_0x8a4d('0x35')]=_0x3f6d66[_0x8a4d('0x40')];}RpcVoiceRecording[_0x8a4d('0x2e')](_0x3f6d66);}}};Report[_0x8a4d('0xf')][_0x8a4d('0x19')]=function(_0x1aa0ee){if(_[_0x8a4d('0x50')](_0x1aa0ee)){_0x1aa0ee[_0x8a4d('0x51')](function(_0x4bb854){RpcVoiceAgentReport[_0x8a4d('0x2e')](_0x4bb854);});}else{RpcVoiceAgentReport[_0x8a4d('0x2e')](_0x1aa0ee);}};Report[_0x8a4d('0xf')]['voiceDialReport']=function(_0x270174){RpcVoiceDialReport['create'](_0x270174);var _0x494d2e;var _0xf3db47;var _0x1a5364=_0x270174[_0x8a4d('0x30')];if(_[_0x8a4d('0x52')](_0x1a5364,'Local')){_0xf3db47=_0x1a5364[_0x8a4d('0x53')](_0x1a5364['indexOf']('/')+0x1,_0x1a5364['indexOf']('@'));_0x494d2e=_[_0x8a4d('0x20')](this['agents'],function(_0x4a1b55){return _0x4a1b55[_0x8a4d('0x54')]==_0xf3db47||_0x4a1b55['phone']==_0xf3db47||_0x4a1b55['accountcode']==_0xf3db47;});}else{_0xf3db47=_0x1a5364[_0x8a4d('0x53')](_0x1a5364[_0x8a4d('0x55')]('/')+0x1,_0x1a5364[_0x8a4d('0x56')]('-'));_0x494d2e=this[_0x8a4d('0x1f')](_0xf3db47);}if(_0x494d2e){_0x270174['interface']=_[_0x8a4d('0x23')](_0x494d2e[_0x8a4d('0x24')])?util[_0x8a4d('0x25')]('SIP/%s',_0x494d2e[_0x8a4d('0x22')]):_0x494d2e[_0x8a4d('0x24')];_0x270174[_0x8a4d('0x4f')]=_0x494d2e[_0x8a4d('0x22')];_0x270174[_0x8a4d('0x21')]=_0x494d2e[_0x8a4d('0x21')];RpcMemberReport[_0x8a4d('0x1b')](_0x270174);}};Report[_0x8a4d('0xf')]['blindTransfer']=function(_0x4cfd7b){RpcVoiceTransferReport[_0x8a4d('0x44')][_0x4cfd7b['transfererlinkedid']]=_0x4cfd7b;};Report[_0x8a4d('0xf')]['attendedTransfer']=function(_0x2c26a7){RpcVoiceTransferReport[_0x8a4d('0x57')](_0x2c26a7);};module[_0x8a4d('0x58')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index a65a13c..ecaea2c 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 _0x625f=['info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]','device','local','toLowerCase','toNumber','stateTime','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','devicestatechange','syncDeviceState','bind','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','catch','inspect','then','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit'];(function(_0x528f03,_0x238c14){var _0x499904=function(_0x21a13d){while(--_0x21a13d){_0x528f03['push'](_0x528f03['shift']());}};_0x499904(++_0x238c14);}(_0x625f,0x1af));var _0xf625=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x625f[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xf625('0x0'));var moment=require(_0xf625('0x1'));var util=require(_0xf625('0x2'));var Redis=require(_0xf625('0x3'));var BPromise=require(_0xf625('0x4'));var config=require(_0xf625('0x5'));var logger=require(_0xf625('0x6'))(_0xf625('0x7'));var ami=require(_0xf625('0x8'));config['redis']=_[_0xf625('0x9')](config[_0xf625('0xa')],{'host':_0xf625('0xb'),'port':0x18eb});var io=require(_0xf625('0xc'))(new Redis(config[_0xf625('0xa')]));function UserReport(_0x18ed33){this[_0xf625('0xd')]=_0x18ed33[_0xf625('0xd')];this[_0xf625('0xe')]=_0x18ed33[_0xf625('0xe')];this[_0xf625('0xf')]=_0x18ed33['telephones'];ami['on'](_0xf625('0x10'),this[_0xf625('0x11')]['bind'](this));ami['on'](_0xf625('0x12'),this['syncRegistry']['bind'](this));ami['on'](_0xf625('0x13'),this[_0xf625('0x14')][_0xf625('0x15')](this));ami['on'](_0xf625('0x16'),this[_0xf625('0x17')][_0xf625('0x15')](this));return this[_0xf625('0x18')]();}function showSipRegistrations(){Promise[_0xf625('0x19')]()['then'](ami['actionSipShowRegistry']())[_0xf625('0x1a')](function(_0x2644cc){logger['error']('[userReport][sipshowregistry]',util[_0xf625('0x1b')](_0x2644cc,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xf625('0x1c')](ami['actionDeviceStateList']())[_0xf625('0x1a')](function(_0x273c6e){logger[_0xf625('0x1d')](_0xf625('0x1e'),util[_0xf625('0x1b')](_0x273c6e,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf625('0x19')]()['then'](ami[_0xf625('0x1f')]())['catch'](function(_0x422e00){logger['error'](_0xf625('0x20'),util[_0xf625('0x1b')](_0x422e00,{'showHidden':![],'depth':null}));});}UserReport[_0xf625('0x21')][_0xf625('0x18')]=function(){setInterval(function(){BPromise[_0xf625('0x19')]()[_0xf625('0x1c')](showSipRegistrations())['then'](listDeviceStates())[_0xf625('0x1c')](showPeersStatus());},0x32c8);};UserReport[_0xf625('0x21')][_0xf625('0x22')]=function(_0x289690){return _0x289690!==null&&!_[_0xf625('0x23')](_0x289690);};UserReport[_0xf625('0x21')]['emit']=function(_0x46ae1f,_0x394b65,_0x3c22c6){io['to'](_0x46ae1f)[_0xf625('0x24')](_0x394b65,_0x3c22c6);};UserReport[_0xf625('0x21')]['syncRegistry']=function(_0x2e2bed){try{if(this[_0xf625('0x22')](_0x2e2bed)){logger[_0xf625('0x25')](_0xf625('0x26'),_0x2e2bed[_0xf625('0x27')],_0x2e2bed[_0xf625('0x28')]);logger[_0xf625('0x29')](_0xf625('0x2a'),util[_0xf625('0x1b')](_0x2e2bed,{'showHidden':![],'depth':null}));var _0x5e34f3=_[_0xf625('0x2b')](this[_0xf625('0xd')],{'defaultuser':_0x2e2bed[_0xf625('0x27')]});if(_0x5e34f3){_0x2e2bed[_0xf625('0x2c')]=_0x2e2bed['state'];_[_0xf625('0x2d')](_0x5e34f3,_[_0xf625('0x2e')](_0x2e2bed,['event',_0xf625('0x2f'),_0xf625('0x27'),'state']));logger['debug'](_0xf625('0x30'),util[_0xf625('0x1b')](_0x5e34f3,{'showHidden':![],'depth':null}));this[_0xf625('0x24')](util['format'](_0xf625('0x31'),_0x5e34f3[_0xf625('0x32')]),_0xf625('0x33'),_0x5e34f3);}}}catch(_0xcaa9d0){logger[_0xf625('0x1d')](_0xf625('0x2a'),util[_0xf625('0x1b')](_0xcaa9d0,{'showHidden':![],'depth':null}));}};UserReport[_0xf625('0x21')]['syncDeviceState']=function(_0x1169d6){try{if(this['isNotNull'](_0x1169d6)){logger[_0xf625('0x25')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x1169d6['device'],_0x1169d6[_0xf625('0x28')]);logger['debug'](_0xf625('0x34'),util[_0xf625('0x1b')](_0x1169d6,{'showHidden':![],'depth':null}));if(this[_0xf625('0xe')][_0x1169d6['device']]){if(!this[_0xf625('0xe')][_0x1169d6[_0xf625('0x35')]][_0xf625('0x36')]||_0x1169d6['state'][_0xf625('0x37')]()=='inuse'){this[_0xf625('0xe')][_0x1169d6[_0xf625('0x35')]]['local']=![];if(this['agents'][_0x1169d6[_0xf625('0x35')]]['state']!==_0x1169d6[_0xf625('0x28')][_0xf625('0x37')]()){this[_0xf625('0xe')][_0x1169d6[_0xf625('0x35')]]['stateTime']=_[_0xf625('0x38')](moment()['format']('x'));}this[_0xf625('0xe')][_0x1169d6[_0xf625('0x35')]][_0xf625('0x28')]=_0x1169d6['state'][_0xf625('0x37')]();this[_0xf625('0xe')][_0x1169d6['device']]['updateStatusRealtime'](_0x1169d6);}}else if(this[_0xf625('0xf')][_0x1169d6[_0xf625('0x35')]]){if(this['telephones'][_0x1169d6[_0xf625('0x35')]]['state']!==_0x1169d6['state'][_0xf625('0x37')]()){this[_0xf625('0xf')][_0x1169d6['device']][_0xf625('0x39')]=_['toNumber'](moment()[_0xf625('0x3a')]('x'));}this[_0xf625('0xf')][_0x1169d6[_0xf625('0x35')]][_0xf625('0x28')]=_0x1169d6[_0xf625('0x28')]['toLowerCase']();logger[_0xf625('0x29')](_0xf625('0x3b'),util['inspect'](this[_0xf625('0xf')][_0x1169d6['device']],{'showHidden':![],'depth':null}));this[_0xf625('0x24')](util[_0xf625('0x3a')](_0xf625('0x3c'),this[_0xf625('0xf')][_0x1169d6[_0xf625('0x35')]][_0xf625('0x32')]),_0xf625('0x3d'),this[_0xf625('0xf')][_0x1169d6['device']]);}else if(this[_0xf625('0xd')][_0x1169d6['device']]){if(this[_0xf625('0xd')][_0x1169d6['device']][_0xf625('0x28')]!==_0x1169d6[_0xf625('0x28')]['toLowerCase']()){this[_0xf625('0xd')][_0x1169d6[_0xf625('0x35')]][_0xf625('0x39')]=_[_0xf625('0x38')](moment()[_0xf625('0x3a')]('x'));}this[_0xf625('0xd')][_0x1169d6['device']]['state']=_0x1169d6['state']['toLowerCase']();logger[_0xf625('0x29')](_0xf625('0x3e'),util[_0xf625('0x1b')](this[_0xf625('0xd')][_0x1169d6['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0xf625('0x3a')](_0xf625('0x31'),this[_0xf625('0xd')][_0x1169d6['device']][_0xf625('0x32')]),_0xf625('0x33'),this['trunks'][_0x1169d6[_0xf625('0x35')]]);}else if(_[_0xf625('0x3f')](_0x1169d6[_0xf625('0x35')],_0xf625('0x40'))){var _0x3a43c4=_0x1169d6['device'];var _0x2f5b4a=_0x3a43c4[_0xf625('0x41')](_0x3a43c4['indexOf']('/')+0x1,_0x3a43c4['indexOf']('@'));var _0x348c1f=_[_0xf625('0x2b')](this[_0xf625('0xe')],function(_0x35e69d){return _0x35e69d[_0xf625('0x42')]==_0x2f5b4a||_0x35e69d[_0xf625('0x43')]==_0x2f5b4a||_0x35e69d[_0xf625('0x44')]==_0x2f5b4a;});if(_0x348c1f){if(_0x348c1f['state']!==_0x1169d6[_0xf625('0x28')][_0xf625('0x37')]()){_0x348c1f[_0xf625('0x39')]=_[_0xf625('0x38')](moment()['format']('x'));}_0x348c1f[_0xf625('0x28')]=_0x1169d6['state'][_0xf625('0x37')]();_0x348c1f[_0xf625('0x36')]=!![];_0x348c1f['updateStatusRealtime'](_0x1169d6);}}}}catch(_0x152bf7){logger[_0xf625('0x1d')](_0xf625('0x34'),util[_0xf625('0x1b')](_0x152bf7,{'showHidden':![],'depth':null}));}};UserReport[_0xf625('0x21')]['syncPeerStatus']=function(_0x16f22c){try{if(this[_0xf625('0x22')](_0x16f22c)&&this[_0xf625('0x22')](_0x16f22c['peerstatus'])){logger[_0xf625('0x25')](_0xf625('0x45'),_0x16f22c[_0xf625('0x46')],_0x16f22c[_0xf625('0x47')],_0x16f22c['peerstatus']);logger['debug']('[userReport][peerstatus]',util[_0xf625('0x1b')](_0x16f22c,{'showHidden':![],'depth':null}));if(this['agents'][_0x16f22c[_0xf625('0x46')]]){if(!this['agents'][_0x16f22c[_0xf625('0x46')]][_0xf625('0x36')]||_0x16f22c['peerstatus']['toLowerCase']()==_0xf625('0x48')){this['agents'][_0x16f22c[_0xf625('0x46')]][_0xf625('0x36')]=![];this[_0xf625('0xe')][_0x16f22c[_0xf625('0x46')]][_0xf625('0x49')]=_0x16f22c[_0xf625('0x16')][_0xf625('0x37')]();this['agents'][_0x16f22c[_0xf625('0x46')]]['address']=_0x16f22c[_0xf625('0x47')];this[_0xf625('0xe')][_0x16f22c['peer']]['updateStatusRealtime'](_0x16f22c);}}else if(this[_0xf625('0xf')][_0x16f22c['peer']]){this['telephones'][_0x16f22c[_0xf625('0x46')]][_0xf625('0x49')]=_0x16f22c[_0xf625('0x16')][_0xf625('0x37')]();this['telephones'][_0x16f22c[_0xf625('0x46')]][_0xf625('0x47')]=_0x16f22c['address'];logger[_0xf625('0x29')](_0xf625('0x4a'),util[_0xf625('0x1b')](this['telephones'][_0x16f22c[_0xf625('0x46')]],{'showHidden':![],'depth':null}));this[_0xf625('0x24')](util[_0xf625('0x3a')](_0xf625('0x3c'),this[_0xf625('0xf')][_0x16f22c['peer']][_0xf625('0x32')]),_0xf625('0x3d'),this[_0xf625('0xf')][_0x16f22c[_0xf625('0x46')]]);}else if(this[_0xf625('0xd')][_0x16f22c[_0xf625('0x46')]]){this[_0xf625('0xd')][_0x16f22c[_0xf625('0x46')]][_0xf625('0x49')]=_0x16f22c[_0xf625('0x16')][_0xf625('0x37')]();this[_0xf625('0xd')][_0x16f22c[_0xf625('0x46')]]['address']=_0x16f22c['address'];logger[_0xf625('0x29')](_0xf625('0x4b'),util[_0xf625('0x1b')](this[_0xf625('0xd')][_0x16f22c[_0xf625('0x46')]],{'showHidden':![],'depth':null}));this[_0xf625('0x24')](util[_0xf625('0x3a')]('trunk:%s',this[_0xf625('0xd')][_0x16f22c[_0xf625('0x46')]][_0xf625('0x32')]),_0xf625('0x33'),this[_0xf625('0xd')][_0x16f22c[_0xf625('0x46')]]);}}}catch(_0x3bb5c9){logger[_0xf625('0x1d')](_0xf625('0x4c'),util[_0xf625('0x1b')](_0x3bb5c9,{'showHidden':![],'depth':null}));}};module[_0xf625('0x4d')]=UserReport; \ No newline at end of file +var _0x796b=['[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','syncDeviceState','device','[userReport][devicestatechange]','agents','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','name','startsWith','Local','substring','indexOf','find','mobile','phone','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','telephones','registryentry','registry','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','then','isUndefined','emit','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','stateRegistry','merge','omit','event','actionid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x796b,0x108));var _0xb796=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x796b[_0x4b7b62];return _0x2280df;};'use strict';var _=require('lodash');var moment=require(_0xb796('0x0'));var util=require('util');var Redis=require(_0xb796('0x1'));var BPromise=require(_0xb796('0x2'));var config=require(_0xb796('0x3'));var logger=require(_0xb796('0x4'))(_0xb796('0x5'));var ami=require(_0xb796('0x6'));config[_0xb796('0x7')]=_[_0xb796('0x8')](config[_0xb796('0x7')],{'host':_0xb796('0x9'),'port':0x18eb});var io=require(_0xb796('0xa'))(new Redis(config['redis']));function UserReport(_0x5030df){this['trunks']=_0x5030df[_0xb796('0xb')];this['agents']=_0x5030df['agents'];this[_0xb796('0xc')]=_0x5030df[_0xb796('0xc')];ami['on'](_0xb796('0xd'),this['syncRegistry']['bind'](this));ami['on'](_0xb796('0xe'),this[_0xb796('0xf')][_0xb796('0x10')](this));ami['on'](_0xb796('0x11'),this['syncDeviceState'][_0xb796('0x10')](this));ami['on'](_0xb796('0x12'),this[_0xb796('0x13')][_0xb796('0x10')](this));return this[_0xb796('0x14')]();}function showSipRegistrations(){Promise[_0xb796('0x15')]()['then'](ami[_0xb796('0x16')]())[_0xb796('0x17')](function(_0x10828a){logger[_0xb796('0x18')](_0xb796('0x19'),util[_0xb796('0x1a')](_0x10828a,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami[_0xb796('0x1b')]())[_0xb796('0x17')](function(_0x57c368){logger['error'](_0xb796('0x1c'),util[_0xb796('0x1a')](_0x57c368,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xb796('0x15')]()['then'](ami['actionSipPeerStatus']())[_0xb796('0x17')](function(_0x54e499){logger['error'](_0xb796('0x1d'),util[_0xb796('0x1a')](_0x54e499,{'showHidden':![],'depth':null}));});}UserReport[_0xb796('0x1e')][_0xb796('0x14')]=function(){setInterval(function(){BPromise[_0xb796('0x15')]()[_0xb796('0x1f')](showSipRegistrations())[_0xb796('0x1f')](listDeviceStates())[_0xb796('0x1f')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x5818c3){return _0x5818c3!==null&&!_[_0xb796('0x20')](_0x5818c3);};UserReport[_0xb796('0x1e')][_0xb796('0x21')]=function(_0x47ab3c,_0x3a4ede,_0x2da2b4){io['to'](_0x47ab3c)['emit'](_0x3a4ede,_0x2da2b4);};UserReport[_0xb796('0x1e')][_0xb796('0xf')]=function(_0x3e873e){try{if(this[_0xb796('0x22')](_0x3e873e)){logger['info'](_0xb796('0x23'),_0x3e873e['username'],_0x3e873e[_0xb796('0x24')]);logger[_0xb796('0x25')](_0xb796('0x26'),util[_0xb796('0x1a')](_0x3e873e,{'showHidden':![],'depth':null}));var _0x1d3912=_['find'](this[_0xb796('0xb')],{'defaultuser':_0x3e873e['username']});if(_0x1d3912){_0x3e873e[_0xb796('0x27')]=_0x3e873e['state'];_[_0xb796('0x28')](_0x1d3912,_[_0xb796('0x29')](_0x3e873e,[_0xb796('0x2a'),_0xb796('0x2b'),'username',_0xb796('0x24')]));logger['debug'](_0xb796('0x2c'),util['inspect'](_0x1d3912,{'showHidden':![],'depth':null}));this[_0xb796('0x21')](util[_0xb796('0x2d')](_0xb796('0x2e'),_0x1d3912['name']),_0xb796('0x2f'),_0x1d3912);}}}catch(_0x33a2db){logger[_0xb796('0x18')]('[userReport][registry]',util[_0xb796('0x1a')](_0x33a2db,{'showHidden':![],'depth':null}));}};UserReport[_0xb796('0x1e')][_0xb796('0x30')]=function(_0x54b0b0){try{if(this['isNotNull'](_0x54b0b0)){logger['info']('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x54b0b0[_0xb796('0x31')],_0x54b0b0['state']);logger['debug'](_0xb796('0x32'),util[_0xb796('0x1a')](_0x54b0b0,{'showHidden':![],'depth':null}));if(this[_0xb796('0x33')][_0x54b0b0[_0xb796('0x31')]]){if(!this[_0xb796('0x33')][_0x54b0b0[_0xb796('0x31')]]['local']||_0x54b0b0[_0xb796('0x24')][_0xb796('0x34')]()==_0xb796('0x35')){this[_0xb796('0x33')][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x36')]=![];if(this[_0xb796('0x33')][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x24')]!==_0x54b0b0[_0xb796('0x24')]['toLowerCase']()){this[_0xb796('0x33')][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x37')]=_[_0xb796('0x38')](moment()[_0xb796('0x2d')]('x'));}this['agents'][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x24')]=_0x54b0b0[_0xb796('0x24')][_0xb796('0x34')]();this[_0xb796('0x33')][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x39')](_0x54b0b0);}}else if(this[_0xb796('0xc')][_0x54b0b0[_0xb796('0x31')]]){if(this[_0xb796('0xc')][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x24')]!==_0x54b0b0['state'][_0xb796('0x34')]()){this[_0xb796('0xc')][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x37')]=_[_0xb796('0x38')](moment()[_0xb796('0x2d')]('x'));}this[_0xb796('0xc')][_0x54b0b0['device']][_0xb796('0x24')]=_0x54b0b0[_0xb796('0x24')][_0xb796('0x34')]();logger[_0xb796('0x25')](_0xb796('0x3a'),util[_0xb796('0x1a')](this[_0xb796('0xc')][_0x54b0b0['device']],{'showHidden':![],'depth':null}));this[_0xb796('0x21')](util['format'](_0xb796('0x3b'),this[_0xb796('0xc')][_0x54b0b0['device']]['name']),_0xb796('0x3c'),this[_0xb796('0xc')][_0x54b0b0[_0xb796('0x31')]]);}else if(this[_0xb796('0xb')][_0x54b0b0['device']]){if(this[_0xb796('0xb')][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x24')]!==_0x54b0b0[_0xb796('0x24')][_0xb796('0x34')]()){this['trunks'][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x37')]=_[_0xb796('0x38')](moment()[_0xb796('0x2d')]('x'));}this['trunks'][_0x54b0b0['device']][_0xb796('0x24')]=_0x54b0b0[_0xb796('0x24')][_0xb796('0x34')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0xb796('0xb')][_0x54b0b0[_0xb796('0x31')]],{'showHidden':![],'depth':null}));this[_0xb796('0x21')](util[_0xb796('0x2d')](_0xb796('0x2e'),this['trunks'][_0x54b0b0[_0xb796('0x31')]][_0xb796('0x3d')]),'trunk:save',this['trunks'][_0x54b0b0[_0xb796('0x31')]]);}else if(_[_0xb796('0x3e')](_0x54b0b0['device'],_0xb796('0x3f'))){var _0x10d534=_0x54b0b0[_0xb796('0x31')];var _0x15a0ab=_0x10d534[_0xb796('0x40')](_0x10d534[_0xb796('0x41')]('/')+0x1,_0x10d534[_0xb796('0x41')]('@'));var _0x25de34=_[_0xb796('0x42')](this[_0xb796('0x33')],function(_0x35adeb){return _0x35adeb[_0xb796('0x43')]==_0x15a0ab||_0x35adeb[_0xb796('0x44')]==_0x15a0ab||_0x35adeb['accountcode']==_0x15a0ab;});if(_0x25de34){if(_0x25de34[_0xb796('0x24')]!==_0x54b0b0[_0xb796('0x24')][_0xb796('0x34')]()){_0x25de34[_0xb796('0x37')]=_[_0xb796('0x38')](moment()['format']('x'));}_0x25de34[_0xb796('0x24')]=_0x54b0b0[_0xb796('0x24')][_0xb796('0x34')]();_0x25de34[_0xb796('0x36')]=!![];_0x25de34[_0xb796('0x39')](_0x54b0b0);}}}}catch(_0x40ac22){logger[_0xb796('0x18')](_0xb796('0x32'),util[_0xb796('0x1a')](_0x40ac22,{'showHidden':![],'depth':null}));}};UserReport[_0xb796('0x1e')][_0xb796('0x13')]=function(_0x5efb39){try{if(this['isNotNull'](_0x5efb39)&&this[_0xb796('0x22')](_0x5efb39['peerstatus'])){logger['info']('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x5efb39[_0xb796('0x45')],_0x5efb39['address'],_0x5efb39['peerstatus']);logger[_0xb796('0x25')](_0xb796('0x46'),util[_0xb796('0x1a')](_0x5efb39,{'showHidden':![],'depth':null}));if(this[_0xb796('0x33')][_0x5efb39[_0xb796('0x45')]]){if(!this['agents'][_0x5efb39[_0xb796('0x45')]][_0xb796('0x36')]||_0x5efb39[_0xb796('0x12')][_0xb796('0x34')]()==_0xb796('0x47')){this[_0xb796('0x33')][_0x5efb39[_0xb796('0x45')]][_0xb796('0x36')]=![];this['agents'][_0x5efb39[_0xb796('0x45')]][_0xb796('0x48')]=_0x5efb39['peerstatus']['toLowerCase']();this['agents'][_0x5efb39[_0xb796('0x45')]][_0xb796('0x49')]=_0x5efb39[_0xb796('0x49')];this[_0xb796('0x33')][_0x5efb39[_0xb796('0x45')]][_0xb796('0x39')](_0x5efb39);}}else if(this[_0xb796('0xc')][_0x5efb39['peer']]){this[_0xb796('0xc')][_0x5efb39['peer']][_0xb796('0x48')]=_0x5efb39[_0xb796('0x12')]['toLowerCase']();this[_0xb796('0xc')][_0x5efb39['peer']]['address']=_0x5efb39['address'];logger[_0xb796('0x25')](_0xb796('0x4a'),util['inspect'](this[_0xb796('0xc')][_0x5efb39[_0xb796('0x45')]],{'showHidden':![],'depth':null}));this[_0xb796('0x21')](util[_0xb796('0x2d')](_0xb796('0x3b'),this['telephones'][_0x5efb39[_0xb796('0x45')]][_0xb796('0x3d')]),'telephone:save',this[_0xb796('0xc')][_0x5efb39['peer']]);}else if(this[_0xb796('0xb')][_0x5efb39['peer']]){this[_0xb796('0xb')][_0x5efb39['peer']][_0xb796('0x48')]=_0x5efb39[_0xb796('0x12')]['toLowerCase']();this[_0xb796('0xb')][_0x5efb39[_0xb796('0x45')]][_0xb796('0x49')]=_0x5efb39[_0xb796('0x49')];logger[_0xb796('0x25')](_0xb796('0x4b'),util[_0xb796('0x1a')](this['trunks'][_0x5efb39['peer']],{'showHidden':![],'depth':null}));this[_0xb796('0x21')](util[_0xb796('0x2d')]('trunk:%s',this[_0xb796('0xb')][_0x5efb39[_0xb796('0x45')]]['name']),_0xb796('0x2f'),this[_0xb796('0xb')][_0x5efb39['peer']]);}}}catch(_0x8a9b5){logger['error'](_0xb796('0x46'),util[_0xb796('0x1a')](_0x8a9b5,{'showHidden':![],'depth':null}));}};module[_0xb796('0x4c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index b172ecf..c32a945 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 _0x68a8=['[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','keys','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','value','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','syncAgentConnect','bind','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','omit','event','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','user:%s','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','interface','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','custom:agentringnoanswer'];(function(_0x3c8e80,_0x39d74d){var _0x2619c0=function(_0x59b22a){while(--_0x59b22a){_0x3c8e80['push'](_0x3c8e80['shift']());}};_0x2619c0(++_0x39d74d);}(_0x68a8,0x170));var _0x868a=function(_0x55d1bc,_0x4c0012){_0x55d1bc=_0x55d1bc-0x0;var _0x576f31=_0x68a8[_0x55d1bc];return _0x576f31;};'use strict';var _=require('lodash');var moment=require(_0x868a('0x0'));var util=require('util');var Redis=require(_0x868a('0x1'));var config=require(_0x868a('0x2'));var logger=require(_0x868a('0x3'))(_0x868a('0x4'));var ami=require(_0x868a('0x5'));config[_0x868a('0x6')]=_['defaults'](config[_0x868a('0x6')],{'host':_0x868a('0x7'),'port':0x18eb});var io=require(_0x868a('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x17aad7){this[_0x868a('0x9')]={};this[_0x868a('0xa')]=_0x17aad7[_0x868a('0x9')];this['voiceQueues']=_0x17aad7[_0x868a('0xb')];this[_0x868a('0xc')]=_0x17aad7[_0x868a('0xc')];this[_0x868a('0xd')]={};ami['on']('agentcalled',this[_0x868a('0xe')]['bind'](this));ami['on']('agentconnect',this[_0x868a('0xf')][_0x868a('0x10')](this));ami['on']('agentringnoanswer',this[_0x868a('0x11')][_0x868a('0x10')](this));ami['on'](_0x868a('0x12'),this[_0x868a('0x13')]['bind'](this));ami['on'](_0x868a('0x14'),this[_0x868a('0x15')]['bind'](this));ami['on']('varset',this[_0x868a('0x16')][_0x868a('0x10')](this));ami['on'](_0x868a('0x17'),this[_0x868a('0x18')]['bind'](this));ami['on'](_0x868a('0x19'),this['syncMusicOnHoldStart'][_0x868a('0x10')](this));ami['on'](_0x868a('0x1a'),this[_0x868a('0x1b')][_0x868a('0x10')](this));ami['on']('attendedtransfer',this[_0x868a('0x1c')][_0x868a('0x10')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x868a('0x10')](this));}VoiceAgentReport[_0x868a('0x1d')]['emit']=function(_0x175215,_0x272051,_0x3c4227){io['to'](_0x175215)[_0x868a('0x1e')](_0x272051,_0x3c4227);};VoiceAgentReport[_0x868a('0x1d')][_0x868a('0x1f')]=function(_0xfee2f5){return _0xfee2f5!==null&&!_[_0x868a('0x20')](_0xfee2f5);};VoiceAgentReport['prototype']['syncAgentCalled']=function(_0x1ddebd){try{if(this[_0x868a('0x1f')](_0x1ddebd)){logger[_0x868a('0x21')](_0x868a('0x22'),_0x1ddebd['uniqueid'],_0x1ddebd[_0x868a('0x23')],_0x1ddebd[_0x868a('0x24')]);logger['debug'](_0x868a('0x25'),_0x1ddebd[_0x868a('0x26')],util[_0x868a('0x27')](_0x1ddebd,{'showHidden':![],'depth':null}));if(_[_0x868a('0x20')](this[_0x868a('0x9')][_0x1ddebd[_0x868a('0x26')]])){this[_0x868a('0x9')][_0x1ddebd[_0x868a('0x26')]]={};}if(_[_0x868a('0x20')](this[_0x868a('0x9')][_0x1ddebd[_0x868a('0x26')]][_0x1ddebd[_0x868a('0x24')]])){this[_0x868a('0x9')][_0x1ddebd[_0x868a('0x26')]][_0x1ddebd[_0x868a('0x24')]]={'agentcalledAt':moment()[_0x868a('0x28')](_0x868a('0x29')),'lastevent':_0x868a('0x2a'),'mandatoryDisposition':this[_0x868a('0xb')][_0x1ddebd[_0x868a('0x2b')]]?this['voiceQueues'][_0x1ddebd[_0x868a('0x2b')]]['mandatoryDisposition']||![]:![],'type':this[_0x868a('0xb')][_0x1ddebd['queue']]?this['voiceQueues'][_0x1ddebd['queue']]['type']||_0x868a('0x2c'):_0x868a('0x2c'),'variables':this[_0x868a('0xd')][_0x1ddebd[_0x868a('0x26')]],'motionChannel':'voice'};}_['merge'](this[_0x868a('0x9')][_0x1ddebd['uniqueid']][_0x1ddebd[_0x868a('0x24')]],_[_0x868a('0x2d')](_0x1ddebd,[_0x868a('0x2e'),'privilege']));logger[_0x868a('0x2f')](_0x868a('0x30'),_0x1ddebd[_0x868a('0x26')],util[_0x868a('0x27')](this[_0x868a('0x9')][_0x1ddebd[_0x868a('0x26')]][_0x1ddebd['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x868a('0x1e')]('custom:agentcalled',this[_0x868a('0x9')][_0x1ddebd['uniqueid']][_0x1ddebd['destuniqueid']]);var _0x3fd1f0={'id':this[_0x868a('0xc')][_0x1ddebd['interface']]['id'],'calleridnum':this[_0x868a('0x9')][_0x1ddebd['uniqueid']][_0x1ddebd['destuniqueid']]['calleridnum'],'queue':this[_0x868a('0x9')][_0x1ddebd[_0x868a('0x26')]][_0x1ddebd[_0x868a('0x24')]][_0x868a('0x2b')],'variables':this[_0x868a('0x9')][_0x1ddebd['uniqueid']][_0x1ddebd[_0x868a('0x24')]][_0x868a('0xd')]};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x1ddebd[_0x868a('0x26')],util[_0x868a('0x27')](_0x3fd1f0,{'showHidden':![],'depth':null}));this[_0x868a('0x1e')](util[_0x868a('0x28')](_0x868a('0x31'),_0x1ddebd['membername']),'user:called',_0x3fd1f0);}}catch(_0xc14699){logger[_0x868a('0x32')](_0x868a('0x33'),_0x1ddebd[_0x868a('0x26')],util[_0x868a('0x27')](_0xc14699,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')][_0x868a('0xf')]=function(_0x4e1970){try{if(this['isNotNull'](_0x4e1970)){if(this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]]){logger['debug'](_0x868a('0x34'),_0x4e1970['uniqueid'],util[_0x868a('0x27')](_0x4e1970,{'showHidden':![],'depth':null}));for(var _0x5a70a4 in this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]]){if(this['channels'][_0x4e1970['uniqueid']][_0x868a('0x35')](_0x5a70a4)){if(_0x4e1970[_0x868a('0x24')]===_0x5a70a4){logger['info'](_0x868a('0x36'),_0x4e1970[_0x868a('0x26')],_0x4e1970[_0x868a('0x23')],_0x4e1970['destuniqueid']);this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x37')]=moment()['format'](_0x868a('0x29'));this[_0x868a('0x9')][_0x4e1970['uniqueid']][_0x5a70a4][_0x868a('0x38')]=_0x4e1970['connectedlinename'];this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x39')]=_0x4e1970[_0x868a('0x39')];this[_0x868a('0x9')][_0x4e1970['uniqueid']][_0x5a70a4][_0x868a('0x3a')]=_0x4e1970[_0x868a('0x3a')];this['channels'][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x3b')]=_0x4e1970['destchannelstatedesc'];this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x3c')]=_0x4e1970['holdtime'];this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x3d')]=_0x868a('0x3e');if(this[_0x868a('0xa')][this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x26')]]){var _0x32503a=this[_0x868a('0xa')][this['channels'][_0x4e1970[_0x868a('0x26')]][_0x5a70a4]['uniqueid']]['routealias'];this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x3f')]=_0x32503a;_0x4e1970[_0x868a('0x3f')]=_0x32503a;}_[_0x868a('0x40')](this['agents'][_0x4e1970[_0x868a('0x41')]],_[_0x868a('0x42')](_0x4e1970,['queue','destconnectedlinenum',_0x868a('0x3f')]));logger['debug'](_0x868a('0x43'),_0x4e1970['uniqueid'],util[_0x868a('0x27')](this[_0x868a('0x9')][_0x4e1970['uniqueid']][_0x4e1970[_0x868a('0x24')]],{'showHidden':![],'depth':null}));ami['emit'](_0x868a('0x44'),this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x4e1970[_0x868a('0x24')]]);logger[_0x868a('0x2f')](_0x868a('0x45'),_0x4e1970['uniqueid'],util[_0x868a('0x27')](this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x4e1970[_0x868a('0x24')]],{'showHidden':![],'depth':null}));this[_0x868a('0x1e')](util[_0x868a('0x28')]('user:%s',_0x4e1970[_0x868a('0x23')]),_0x868a('0x46'),this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x4e1970[_0x868a('0x24')]]);}else if(!this['channels'][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x47')]&&!this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x14')]){logger[_0x868a('0x21')](_0x868a('0x48'),_0x4e1970[_0x868a('0x26')],this[_0x868a('0x9')][_0x4e1970['uniqueid']][_0x5a70a4][_0x868a('0x23')],_0x5a70a4);this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4]['agentringnoanswer']=!![];this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x49')]=moment()[_0x868a('0x28')](_0x868a('0x29'));this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x4a')]=_0x4e1970['destuniqueid'];this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4]['answeredelsewheremembername']=_0x4e1970[_0x868a('0x23')];this[_0x868a('0x9')][_0x4e1970['uniqueid']][_0x5a70a4][_0x868a('0x3d')]='answered_elsewhere';this[_0x868a('0x9')][_0x4e1970[_0x868a('0x26')]][_0x5a70a4][_0x868a('0x4b')]=_0x868a('0x4c');logger[_0x868a('0x2f')](_0x868a('0x4d'),_0x4e1970[_0x868a('0x26')],util['inspect'](this['channels'][_0x4e1970['uniqueid']][_0x5a70a4],{'showHidden':![],'depth':null}));ami[_0x868a('0x1e')]('custom:agentansweredelsewhere',this[_0x868a('0x9')][_0x4e1970['uniqueid']][_0x5a70a4]);}}}}}}catch(_0x4ea2aa){logger[_0x868a('0x32')]('[%s][voiceAgentReport][agentconnect]',_0x4e1970[_0x868a('0x26')],util[_0x868a('0x27')](_0x4ea2aa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')][_0x868a('0x11')]=function(_0x2a8454){try{if(this[_0x868a('0x1f')](_0x2a8454)){logger[_0x868a('0x2f')](_0x868a('0x4e'),_0x2a8454[_0x868a('0x26')],util['inspect'](_0x2a8454,{'showHidden':![],'depth':null}));if(this[_0x868a('0x9')][_0x2a8454['uniqueid']]&&this['channels'][_0x2a8454['uniqueid']][_0x2a8454['destuniqueid']]){logger[_0x868a('0x21')](_0x868a('0x4f'),_0x2a8454[_0x868a('0x26')],_0x2a8454[_0x868a('0x23')],_0x2a8454[_0x868a('0x24')]);this['channels'][_0x2a8454[_0x868a('0x26')]][_0x2a8454[_0x868a('0x24')]][_0x868a('0x47')]=!![];this['channels'][_0x2a8454[_0x868a('0x26')]][_0x2a8454[_0x868a('0x24')]][_0x868a('0x49')]=moment()['format'](_0x868a('0x29'));this[_0x868a('0x9')][_0x2a8454[_0x868a('0x26')]][_0x2a8454[_0x868a('0x24')]]['lastevent']=_0x868a('0x50');this[_0x868a('0x9')][_0x2a8454[_0x868a('0x26')]][_0x2a8454[_0x868a('0x24')]][_0x868a('0x4b')]=_0x868a('0x50');logger[_0x868a('0x2f')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x2a8454[_0x868a('0x26')],util[_0x868a('0x27')](this[_0x868a('0x9')][_0x2a8454[_0x868a('0x26')]][_0x2a8454[_0x868a('0x24')]],{'showHidden':![],'depth':null}));ami[_0x868a('0x1e')](_0x868a('0x51'),this[_0x868a('0x9')][_0x2a8454[_0x868a('0x26')]][_0x2a8454[_0x868a('0x24')]]);}}}catch(_0x3e9321){logger['error'](_0x868a('0x52'),_0x2a8454[_0x868a('0x26')],util[_0x868a('0x27')](_0x3e9321,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')][_0x868a('0x13')]=function(_0xb2f092){try{if(this[_0x868a('0x1f')](_0xb2f092)){logger['debug'](_0x868a('0x53'),_0xb2f092[_0x868a('0x26')],util[_0x868a('0x27')](_0xb2f092,{'showHidden':![],'depth':null}));if(this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]]){for(var _0x424032 in this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]]){if(this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]][_0x868a('0x35')](_0x424032)&&!this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]][_0x424032][_0x868a('0x47')]&&!this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]][_0x424032][_0x868a('0x14')]){logger[_0x868a('0x21')](_0x868a('0x54'),_0xb2f092['uniqueid'],this['channels'][_0xb2f092[_0x868a('0x26')]][_0x424032][_0x868a('0x23')],_0x424032);this['channels'][_0xb2f092[_0x868a('0x26')]][_0x424032]['agentringnoanswer']=!![];this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]][_0x424032][_0x868a('0x49')]=moment()[_0x868a('0x28')](_0x868a('0x29'));this['channels'][_0xb2f092[_0x868a('0x26')]][_0x424032][_0x868a('0x3d')]='abandoned';this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]][_0x424032]['reason']=_0x868a('0x55');logger[_0x868a('0x2f')](_0x868a('0x56'),_0xb2f092[_0x868a('0x26')],util[_0x868a('0x27')](this[_0x868a('0x9')][_0xb2f092[_0x868a('0x26')]][_0x424032],{'showHidden':![],'depth':null}));ami[_0x868a('0x1e')](_0x868a('0x57'),this[_0x868a('0x9')][_0xb2f092['uniqueid']][_0x424032]);}}}}}catch(_0x592859){logger[_0x868a('0x32')](_0x868a('0x58'),_0xb2f092['uniqueid'],util[_0x868a('0x27')](_0x592859,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')]['syncAgentComplete']=function(_0xe3fb4c){try{if(this[_0x868a('0x1f')](_0xe3fb4c)){logger['debug'](_0x868a('0x59'),_0xe3fb4c['uniqueid'],util[_0x868a('0x27')](_0xe3fb4c,{'showHidden':![],'depth':null}));if(this[_0x868a('0x9')][_0xe3fb4c[_0x868a('0x26')]]){for(var _0x1b0368 in this['channels'][_0xe3fb4c['uniqueid']]){if(this[_0x868a('0x9')][_0xe3fb4c['uniqueid']][_0x868a('0x35')](_0x1b0368)){if(this['channels'][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368]['agentconnectAt']&&!this['channels'][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368][_0x868a('0x14')]){logger[_0x868a('0x21')](_0x868a('0x5a'),_0xe3fb4c[_0x868a('0x26')],this['channels'][_0xe3fb4c['uniqueid']][_0x1b0368][_0x868a('0x23')],_0x1b0368);this[_0x868a('0x9')][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368][_0x868a('0x14')]=!![];this['channels'][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368][_0x868a('0x5b')]=moment()[_0x868a('0x28')](_0x868a('0x29'));this[_0x868a('0x9')][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368]['lastevent']=_0x868a('0x5c');this['channels'][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368][_0x868a('0x4b')]=_0xe3fb4c[_0x868a('0x4b')]==_0x868a('0x5d')?'agent':_0xe3fb4c[_0x868a('0x4b')];this[_0x868a('0x9')][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368][_0x868a('0x5e')]=_0xe3fb4c[_0x868a('0x5e')];if(this['voiceQueues'][_0xe3fb4c[_0x868a('0x2b')]]&&this['voiceQueues'][_0xe3fb4c[_0x868a('0x2b')]][_0x868a('0x5f')]){this[_0x868a('0x9')][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368][_0x868a('0x60')]=this[_0x868a('0xb')][_0xe3fb4c[_0x868a('0x2b')]][_0x868a('0x61')];this[_0x868a('0x9')][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368]['agentacw']=!![];}this['agents'][_0xe3fb4c[_0x868a('0x41')]]=_[_0x868a('0x2d')](this[_0x868a('0xc')][_0xe3fb4c[_0x868a('0x41')]],[_0x868a('0x2b'),'destconnectedlinenum']);logger[_0x868a('0x2f')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0xe3fb4c[_0x868a('0x26')],util[_0x868a('0x27')](this[_0x868a('0x9')][_0xe3fb4c['uniqueid']][_0x1b0368],{'showHidden':![],'depth':null}));ami[_0x868a('0x1e')](_0x868a('0x62'),this['channels'][_0xe3fb4c[_0x868a('0x26')]][_0x1b0368]);logger[_0x868a('0x2f')](_0x868a('0x63'),_0xe3fb4c['uniqueid'],util[_0x868a('0x27')]({'id':this['agents'][_0xe3fb4c[_0x868a('0x41')]]['id'],'destaccountcode':_0xe3fb4c[_0x868a('0x64')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x868a('0x31'),_0xe3fb4c['membername']),_0x868a('0x65'),{'id':this[_0x868a('0xc')][_0xe3fb4c['interface']]['id'],'destaccountcode':_0xe3fb4c[_0x868a('0x64')]});}}}}}}catch(_0x508fe2){logger[_0x868a('0x32')](_0x868a('0x66'),_0xe3fb4c[_0x868a('0x26')],util[_0x868a('0x27')](_0x508fe2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x868a('0x16')]=function(_0x11871f){try{if(this[_0x868a('0x1f')](_0x11871f)){logger[_0x868a('0x2f')]('[%s][voiceAgentReport][varset]\x20event:',_0x11871f[_0x868a('0x26')],util[_0x868a('0x27')](_0x11871f,{'showHidden':![],'depth':null}));this['addVariable'](_0x11871f[_0x868a('0x26')],_[_0x868a('0x67')](_0x11871f['variable'])[0x0],_0x11871f['value']);if(this['channels'][_0x11871f['uniqueid']]){for(var _0x5e7fa6 in this[_0x868a('0x9')][_0x11871f[_0x868a('0x26')]]){if(this['channels'][_0x11871f['uniqueid']][_0x868a('0x35')](_0x5e7fa6)){logger[_0x868a('0x21')](_0x868a('0x68'),_0x11871f[_0x868a('0x26')],_0x5e7fa6,_[_0x868a('0x67')](_0x11871f[_0x868a('0x69')])[0x0],_0x11871f[_0x868a('0x6a')]);if(_[_0x868a('0x20')](this[_0x868a('0x9')][_0x11871f[_0x868a('0x26')]][_0x5e7fa6][_0x868a('0xd')])){this[_0x868a('0x9')][_0x11871f[_0x868a('0x26')]][_0x5e7fa6][_0x868a('0xd')]={};}this['channels'][_0x11871f['uniqueid']][_0x5e7fa6][_0x868a('0xd')]=this['variables'][_0x11871f[_0x868a('0x26')]];}}}}}catch(_0x5cb258){logger['error'](_0x868a('0x6b'),_0x11871f[_0x868a('0x26')],util[_0x868a('0x27')](_0x5cb258,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')][_0x868a('0x6c')]=function(_0x4c4206,_0x2f02c7,_0x4176e9){var _0x59bd5e=[_0x868a('0x6d'),_0x868a('0x6e'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x868a('0x6f'),'rtpaudioqoslossbridged',_0x868a('0x70'),_0x868a('0x71'),_0x868a('0x72'),'sipuri',_0x868a('0x73'),'bridgepvtcallid',_0x868a('0x74'),_0x868a('0x75'),_0x868a('0x76'),_0x868a('0x77'),'membername',_0x868a('0x78'),_0x868a('0x79')];if(!_[_0x868a('0x7a')](_0x2f02c7)&&!_[_0x868a('0x7b')](_0x59bd5e,_0x2f02c7)){if(_['isUndefined'](this[_0x868a('0xd')][_0x4c4206])){this[_0x868a('0xd')][_0x4c4206]={};}this[_0x868a('0xd')][_0x4c4206][_0x2f02c7]=_0x4176e9;}};VoiceAgentReport['prototype'][_0x868a('0x18')]=function(_0x4f311b){try{if(this[_0x868a('0x1f')](_0x4f311b)){logger[_0x868a('0x2f')](_0x868a('0x7c'),_0x4f311b[_0x868a('0x26')],util['inspect'](_0x4f311b,{'showHidden':![],'depth':null}));if(this[_0x868a('0x9')][_0x4f311b[_0x868a('0x26')]]){for(var _0x513a16 in this['channels'][_0x4f311b[_0x868a('0x26')]]){if(this[_0x868a('0x9')][_0x4f311b[_0x868a('0x26')]][_0x868a('0x35')](_0x513a16)){if(this[_0x868a('0x9')][_0x4f311b['uniqueid']][_0x513a16][_0x868a('0x4b')]==_0x868a('0x5d')&&this[_0x868a('0x9')][_0x4f311b[_0x868a('0x26')]][_0x513a16][_0x868a('0x14')]){logger[_0x868a('0x21')](_0x868a('0x7d'),_0x4f311b[_0x868a('0x26')],_0x513a16);this['channels'][_0x4f311b[_0x868a('0x26')]][_0x513a16][_0x868a('0x5b')]=moment()[_0x868a('0x28')](_0x868a('0x29'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x4f311b[_0x868a('0x26')],util['inspect'](_[_0x868a('0x7e')](this['channels'][_0x4f311b[_0x868a('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x868a('0x1e')](_0x868a('0x7f'),_[_0x868a('0x7e')](this[_0x868a('0x9')][_0x4f311b[_0x868a('0x26')]]));delete this[_0x868a('0x9')][_0x4f311b[_0x868a('0x26')]];}if(this[_0x868a('0xd')][_0x4f311b[_0x868a('0x26')]]){delete this[_0x868a('0xd')][_0x4f311b['uniqueid']];}}}catch(_0x378d21){logger[_0x868a('0x32')](_0x868a('0x80'),_0x4f311b[_0x868a('0x26')],util[_0x868a('0x27')](_0x378d21,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')][_0x868a('0x1c')]=function(_0x18d8a5){try{if(this[_0x868a('0x1f')](_0x18d8a5)){logger[_0x868a('0x2f')](_0x868a('0x81'),_0x18d8a5[_0x868a('0x26')],util[_0x868a('0x27')](_0x18d8a5,{'showHidden':![],'depth':null}));if(this[_0x868a('0x9')][_0x18d8a5['transfereeuniqueid']]){for(var _0x486ee5 in this['channels'][_0x18d8a5[_0x868a('0x82')]]){if(this[_0x868a('0x9')][_0x18d8a5[_0x868a('0x82')]][_0x868a('0x35')](_0x486ee5)){if(_0x18d8a5['origtransfereruniqueid']===_0x486ee5){logger[_0x868a('0x21')](_0x868a('0x83'),_0x18d8a5['uniqueid'],this[_0x868a('0x9')][_0x18d8a5[_0x868a('0x82')]][_0x486ee5][_0x868a('0x23')],_0x486ee5);var _0x25cd2e=moment();this[_0x868a('0x9')][_0x18d8a5['transfereeuniqueid']][_0x486ee5][_0x868a('0x14')]=!![];this['channels'][_0x18d8a5[_0x868a('0x82')]][_0x486ee5][_0x868a('0x5b')]=moment()[_0x868a('0x28')](_0x868a('0x29'));this['channels'][_0x18d8a5[_0x868a('0x82')]][_0x486ee5][_0x868a('0x3d')]=_0x868a('0x5c');this[_0x868a('0x9')][_0x18d8a5['transfereeuniqueid']][_0x486ee5][_0x868a('0x4b')]='transfer';this[_0x868a('0x9')][_0x18d8a5['transfereeuniqueid']][_0x486ee5][_0x868a('0x5e')]=_0x25cd2e[_0x868a('0x84')](this[_0x868a('0x9')][_0x18d8a5[_0x868a('0x82')]][_0x486ee5]['agentconnectAt'],_0x868a('0x85'));}}}}if(this[_0x868a('0x9')][_0x18d8a5[_0x868a('0x86')]]){var _0x2fd9a2=this[_0x868a('0x9')][_0x18d8a5['secondtransfereruniqueid']];this[_0x868a('0x9')][_0x18d8a5[_0x868a('0x86')]]=this[_0x868a('0x9')][_0x18d8a5[_0x868a('0x82')]];this['channels'][_0x18d8a5[_0x868a('0x82')]]=_0x2fd9a2;}}}catch(_0x222885){logger[_0x868a('0x32')](_0x868a('0x87'),_0x18d8a5[_0x868a('0x26')],util[_0x868a('0x27')](_0x222885,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')]['syncBlindTransfer']=function(_0x4964c7){try{if(this[_0x868a('0x1f')](_0x4964c7)){logger['debug'](_0x868a('0x88'),_0x4964c7[_0x868a('0x26')],util[_0x868a('0x27')](_0x4964c7,{'showHidden':![],'depth':null}));if(this['channels'][_0x4964c7[_0x868a('0x82')]]){for(var _0x54ba66 in this[_0x868a('0x9')][_0x4964c7['transfereeuniqueid']]){if(this[_0x868a('0x9')][_0x4964c7['transfereeuniqueid']][_0x868a('0x35')](_0x54ba66)){if(_0x4964c7['transfereruniqueid']===_0x54ba66){logger[_0x868a('0x21')](_0x868a('0x89'),_0x4964c7['uniqueid'],this['channels'][_0x4964c7[_0x868a('0x82')]][_0x54ba66][_0x868a('0x23')],_0x54ba66);var _0x301007=moment();this[_0x868a('0x9')][_0x4964c7[_0x868a('0x82')]][_0x54ba66][_0x868a('0x14')]=!![];this[_0x868a('0x9')][_0x4964c7[_0x868a('0x82')]][_0x54ba66][_0x868a('0x5b')]=_0x301007;this[_0x868a('0x9')][_0x4964c7['transfereeuniqueid']][_0x54ba66][_0x868a('0x3d')]=_0x868a('0x5c');this[_0x868a('0x9')][_0x4964c7[_0x868a('0x82')]][_0x54ba66][_0x868a('0x4b')]='transfer';this[_0x868a('0x9')][_0x4964c7['transfereeuniqueid']][_0x54ba66]['talktime']=_0x301007[_0x868a('0x84')](this[_0x868a('0x9')][_0x4964c7[_0x868a('0x82')]][_0x54ba66][_0x868a('0x37')],_0x868a('0x85'));}}}}}}catch(_0x43e5e6){logger[_0x868a('0x32')](_0x868a('0x8a'),_0x4964c7['uniqueid'],util['inspect'](_0x43e5e6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x868a('0x1d')][_0x868a('0x8b')]=function(_0x2a403a){var _0x3d1c75='';try{if(this[_0x868a('0x1f')](_0x2a403a)){logger[_0x868a('0x2f')](_0x868a('0x8c'),_0x2a403a[_0x868a('0x26')],util[_0x868a('0x27')](_0x2a403a,{'showHidden':![],'depth':null}));if(_0x2a403a[_0x868a('0x8d')]){_0x3d1c75=_0x2a403a[_0x868a('0x8d')][_0x868a('0x8e')](0x0,_0x2a403a[_0x868a('0x8d')][_0x868a('0x8f')]('-'));if(this[_0x868a('0xc')][_0x3d1c75]){logger[_0x868a('0x21')](_0x868a('0x90'),_0x2a403a[_0x868a('0x26')],_0x3d1c75);this[_0x868a('0xc')][_0x3d1c75][_0x868a('0x91')]=!![];}}}}catch(_0x47c84f){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x2a403a[_0x868a('0x26')],util[_0x868a('0x27')](_0x47c84f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x868a('0x1b')]=function(_0x2ed6d5){var _0x321faf='';try{if(this[_0x868a('0x1f')](_0x2ed6d5)){logger[_0x868a('0x2f')](_0x868a('0x92'),_0x2ed6d5['uniqueid'],util['inspect'](_0x2ed6d5,{'showHidden':![],'depth':null}));if(_0x2ed6d5[_0x868a('0x8d')]){_0x321faf=_0x2ed6d5[_0x868a('0x8d')][_0x868a('0x8e')](0x0,_0x2ed6d5['channel'][_0x868a('0x8f')]('-'));if(this[_0x868a('0xc')][_0x321faf]){logger[_0x868a('0x21')](_0x868a('0x93'),_0x2ed6d5['uniqueid'],_0x321faf);this[_0x868a('0xc')][_0x321faf]['onhold']=![];}}}}catch(_0xfbf35a){logger[_0x868a('0x32')](_0x868a('0x94'),_0x2ed6d5[_0x868a('0x26')],util[_0x868a('0x27')](_0xfbf35a,{'showHidden':![],'depth':null}));}};module[_0x868a('0x95')]=VoiceAgentReport; \ No newline at end of file +var _0x6f54=['custom:agentconnect','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','agent','talktime','acw','acwtime','acwTimeout','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','transfer','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','agentcompleteAt','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','diff','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','bind','queuecallerabandon','agentcomplete','syncAgentComplete','varset','hangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','info','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','queue','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:'];(function(_0x1d586d,_0x3fcc44){var _0x5a0a3e=function(_0xbfcfb0){while(--_0xbfcfb0){_0x1d586d['push'](_0x1d586d['shift']());}};_0x5a0a3e(++_0x3fcc44);}(_0x6f54,0xf2));var _0x46f5=function(_0x3e1ea9,_0xdf10cb){_0x3e1ea9=_0x3e1ea9-0x0;var _0x1b3b68=_0x6f54[_0x3e1ea9];return _0x1b3b68;};'use strict';var _=require(_0x46f5('0x0'));var moment=require('moment');var util=require(_0x46f5('0x1'));var Redis=require(_0x46f5('0x2'));var config=require(_0x46f5('0x3'));var logger=require(_0x46f5('0x4'))(_0x46f5('0x5'));var ami=require(_0x46f5('0x6'));config[_0x46f5('0x7')]=_['defaults'](config[_0x46f5('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x46f5('0x8'))(new Redis(config[_0x46f5('0x7')]));function VoiceAgentReport(_0x15fb75){this[_0x46f5('0x9')]={};this[_0x46f5('0xa')]=_0x15fb75['channels'];this[_0x46f5('0xb')]=_0x15fb75[_0x46f5('0xb')];this[_0x46f5('0xc')]=_0x15fb75[_0x46f5('0xc')];this[_0x46f5('0xd')]={};ami['on'](_0x46f5('0xe'),this[_0x46f5('0xf')]['bind'](this));ami['on'](_0x46f5('0x10'),this[_0x46f5('0x11')]['bind'](this));ami['on']('agentringnoanswer',this[_0x46f5('0x12')][_0x46f5('0x13')](this));ami['on'](_0x46f5('0x14'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x46f5('0x15'),this[_0x46f5('0x16')]['bind'](this));ami['on'](_0x46f5('0x17'),this['syncVarSet'][_0x46f5('0x13')](this));ami['on'](_0x46f5('0x18'),this['syncHangup'][_0x46f5('0x13')](this));ami['on'](_0x46f5('0x19'),this[_0x46f5('0x1a')][_0x46f5('0x13')](this));ami['on']('musiconholdstop',this[_0x46f5('0x1b')][_0x46f5('0x13')](this));ami['on']('attendedtransfer',this[_0x46f5('0x1c')][_0x46f5('0x13')](this));ami['on']('blindtransfer',this[_0x46f5('0x1d')][_0x46f5('0x13')](this));}VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x1f')]=function(_0x5b4ac4,_0x8f3aac,_0x41cf4c){io['to'](_0x5b4ac4)[_0x46f5('0x1f')](_0x8f3aac,_0x41cf4c);};VoiceAgentReport[_0x46f5('0x1e')]['isNotNull']=function(_0x58a313){return _0x58a313!==null&&!_[_0x46f5('0x20')](_0x58a313);};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0xf')]=function(_0xbfaa19){try{if(this[_0x46f5('0x21')](_0xbfaa19)){logger[_0x46f5('0x22')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0xbfaa19[_0x46f5('0x23')],_0xbfaa19[_0x46f5('0x24')],_0xbfaa19[_0x46f5('0x25')]);logger[_0x46f5('0x26')](_0x46f5('0x27'),_0xbfaa19['uniqueid'],util[_0x46f5('0x28')](_0xbfaa19,{'showHidden':![],'depth':null}));if(_[_0x46f5('0x20')](this[_0x46f5('0x9')][_0xbfaa19['uniqueid']])){this[_0x46f5('0x9')][_0xbfaa19[_0x46f5('0x23')]]={};}if(_['isUndefined'](this[_0x46f5('0x9')][_0xbfaa19[_0x46f5('0x23')]][_0xbfaa19[_0x46f5('0x25')]])){this[_0x46f5('0x9')][_0xbfaa19[_0x46f5('0x23')]][_0xbfaa19['destuniqueid']]={'agentcalledAt':moment()[_0x46f5('0x29')](_0x46f5('0x2a')),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0xbfaa19[_0x46f5('0x2b')]]?this[_0x46f5('0xb')][_0xbfaa19['queue']]['mandatoryDisposition']||![]:![],'type':this['voiceQueues'][_0xbfaa19['queue']]?this[_0x46f5('0xb')][_0xbfaa19[_0x46f5('0x2b')]]['type']||_0x46f5('0x2c'):_0x46f5('0x2c'),'variables':this['variables'][_0xbfaa19['uniqueid']],'motionChannel':'voice'};}_[_0x46f5('0x2d')](this[_0x46f5('0x9')][_0xbfaa19['uniqueid']][_0xbfaa19[_0x46f5('0x25')]],_[_0x46f5('0x2e')](_0xbfaa19,[_0x46f5('0x2f'),_0x46f5('0x30')]));logger[_0x46f5('0x26')](_0x46f5('0x31'),_0xbfaa19['uniqueid'],util['inspect'](this[_0x46f5('0x9')][_0xbfaa19[_0x46f5('0x23')]][_0xbfaa19[_0x46f5('0x25')]],{'showHidden':![],'depth':null}));ami[_0x46f5('0x1f')](_0x46f5('0x32'),this['channels'][_0xbfaa19[_0x46f5('0x23')]][_0xbfaa19['destuniqueid']]);var _0x1fc3a6={'id':this[_0x46f5('0xc')][_0xbfaa19[_0x46f5('0x33')]]['id'],'calleridnum':this[_0x46f5('0x9')][_0xbfaa19[_0x46f5('0x23')]][_0xbfaa19[_0x46f5('0x25')]][_0x46f5('0x34')],'queue':this['channels'][_0xbfaa19[_0x46f5('0x23')]][_0xbfaa19[_0x46f5('0x25')]][_0x46f5('0x2b')],'variables':this['channels'][_0xbfaa19[_0x46f5('0x23')]][_0xbfaa19[_0x46f5('0x25')]][_0x46f5('0xd')]};logger['debug'](_0x46f5('0x35'),_0xbfaa19[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x1fc3a6,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x46f5('0x36'),_0xbfaa19[_0x46f5('0x24')]),_0x46f5('0x37'),_0x1fc3a6);}}catch(_0x36cc74){logger[_0x46f5('0x38')](_0x46f5('0x39'),_0xbfaa19[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x36cc74,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x11')]=function(_0x15a488){try{if(this[_0x46f5('0x21')](_0x15a488)){if(this[_0x46f5('0x9')][_0x15a488['uniqueid']]){logger[_0x46f5('0x26')](_0x46f5('0x3a'),_0x15a488[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x15a488,{'showHidden':![],'depth':null}));for(var _0x7211d1 in this['channels'][_0x15a488[_0x46f5('0x23')]]){if(this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]]['hasOwnProperty'](_0x7211d1)){if(_0x15a488[_0x46f5('0x25')]===_0x7211d1){logger[_0x46f5('0x22')](_0x46f5('0x3b'),_0x15a488[_0x46f5('0x23')],_0x15a488['membername'],_0x15a488[_0x46f5('0x25')]);this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x3c')]=moment()[_0x46f5('0x29')](_0x46f5('0x2a'));this['channels'][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x3d')]=_0x15a488[_0x46f5('0x3d')];this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x3e')]=_0x15a488[_0x46f5('0x3e')];this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x3f')]=_0x15a488['destchannelstate'];this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x40')]=_0x15a488[_0x46f5('0x40')];this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1]['holdtime']=_0x15a488[_0x46f5('0x41')];this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1]['lastevent']=_0x46f5('0x42');if(this['voiceChannels'][this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x23')]]){var _0x37daf4=this[_0x46f5('0xa')][this['channels'][_0x15a488['uniqueid']][_0x7211d1][_0x46f5('0x23')]]['routealias'];this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x43')]=_0x37daf4;_0x15a488[_0x46f5('0x43')]=_0x37daf4;}_[_0x46f5('0x2d')](this['agents'][_0x15a488[_0x46f5('0x33')]],_[_0x46f5('0x44')](_0x15a488,['queue','destconnectedlinenum',_0x46f5('0x43')]));logger[_0x46f5('0x26')](_0x46f5('0x45'),_0x15a488[_0x46f5('0x23')],util[_0x46f5('0x28')](this[_0x46f5('0x9')][_0x15a488['uniqueid']][_0x15a488['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x46f5('0x1f')](_0x46f5('0x46'),this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x15a488['destuniqueid']]);logger[_0x46f5('0x26')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x15a488[_0x46f5('0x23')],util['inspect'](this[_0x46f5('0x9')][_0x15a488['uniqueid']][_0x15a488['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x46f5('0x1f')](util[_0x46f5('0x29')](_0x46f5('0x36'),_0x15a488[_0x46f5('0x24')]),_0x46f5('0x47'),this['channels'][_0x15a488[_0x46f5('0x23')]][_0x15a488['destuniqueid']]);}else if(!this[_0x46f5('0x9')][_0x15a488['uniqueid']][_0x7211d1][_0x46f5('0x48')]&&!this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x15')]){logger[_0x46f5('0x22')](_0x46f5('0x49'),_0x15a488[_0x46f5('0x23')],this[_0x46f5('0x9')][_0x15a488['uniqueid']][_0x7211d1][_0x46f5('0x24')],_0x7211d1);this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x48')]=!![];this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x4a')]=moment()[_0x46f5('0x29')](_0x46f5('0x2a'));this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x4b')]=_0x15a488['destuniqueid'];this[_0x46f5('0x9')][_0x15a488['uniqueid']][_0x7211d1][_0x46f5('0x4c')]=_0x15a488[_0x46f5('0x24')];this['channels'][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x4d')]=_0x46f5('0x4e');this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1][_0x46f5('0x4f')]=_0x46f5('0x4e');logger[_0x46f5('0x26')](_0x46f5('0x50'),_0x15a488['uniqueid'],util['inspect'](this['channels'][_0x15a488[_0x46f5('0x23')]][_0x7211d1],{'showHidden':![],'depth':null}));ami['emit'](_0x46f5('0x51'),this[_0x46f5('0x9')][_0x15a488[_0x46f5('0x23')]][_0x7211d1]);}}}}}}catch(_0xe33c76){logger['error'](_0x46f5('0x52'),_0x15a488[_0x46f5('0x23')],util[_0x46f5('0x28')](_0xe33c76,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')]['syncAgentRingNoAnswer']=function(_0x124a88){try{if(this[_0x46f5('0x21')](_0x124a88)){logger[_0x46f5('0x26')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x124a88[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x124a88,{'showHidden':![],'depth':null}));if(this[_0x46f5('0x9')][_0x124a88[_0x46f5('0x23')]]&&this[_0x46f5('0x9')][_0x124a88[_0x46f5('0x23')]][_0x124a88[_0x46f5('0x25')]]){logger[_0x46f5('0x22')](_0x46f5('0x53'),_0x124a88['uniqueid'],_0x124a88[_0x46f5('0x24')],_0x124a88[_0x46f5('0x25')]);this[_0x46f5('0x9')][_0x124a88['uniqueid']][_0x124a88['destuniqueid']]['agentringnoanswer']=!![];this['channels'][_0x124a88[_0x46f5('0x23')]][_0x124a88['destuniqueid']][_0x46f5('0x4a')]=moment()[_0x46f5('0x29')](_0x46f5('0x2a'));this[_0x46f5('0x9')][_0x124a88[_0x46f5('0x23')]][_0x124a88['destuniqueid']][_0x46f5('0x4d')]='rejected';this[_0x46f5('0x9')][_0x124a88['uniqueid']][_0x124a88['destuniqueid']][_0x46f5('0x4f')]='rejected';logger[_0x46f5('0x26')](_0x46f5('0x54'),_0x124a88[_0x46f5('0x23')],util['inspect'](this[_0x46f5('0x9')][_0x124a88['uniqueid']][_0x124a88['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x46f5('0x1f')]('custom:agentringnoanswer',this['channels'][_0x124a88[_0x46f5('0x23')]][_0x124a88[_0x46f5('0x25')]]);}}}catch(_0x39897c){logger['error'](_0x46f5('0x55'),_0x124a88[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x39897c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x56')]=function(_0x3cf608){try{if(this[_0x46f5('0x21')](_0x3cf608)){logger[_0x46f5('0x26')](_0x46f5('0x57'),_0x3cf608[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x3cf608,{'showHidden':![],'depth':null}));if(this[_0x46f5('0x9')][_0x3cf608[_0x46f5('0x23')]]){for(var _0x173be6 in this['channels'][_0x3cf608['uniqueid']]){if(this[_0x46f5('0x9')][_0x3cf608['uniqueid']][_0x46f5('0x58')](_0x173be6)&&!this[_0x46f5('0x9')][_0x3cf608[_0x46f5('0x23')]][_0x173be6][_0x46f5('0x48')]&&!this[_0x46f5('0x9')][_0x3cf608[_0x46f5('0x23')]][_0x173be6][_0x46f5('0x15')]){logger[_0x46f5('0x22')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x3cf608[_0x46f5('0x23')],this[_0x46f5('0x9')][_0x3cf608['uniqueid']][_0x173be6][_0x46f5('0x24')],_0x173be6);this[_0x46f5('0x9')][_0x3cf608['uniqueid']][_0x173be6][_0x46f5('0x48')]=!![];this['channels'][_0x3cf608[_0x46f5('0x23')]][_0x173be6][_0x46f5('0x4a')]=moment()[_0x46f5('0x29')](_0x46f5('0x2a'));this[_0x46f5('0x9')][_0x3cf608['uniqueid']][_0x173be6][_0x46f5('0x4d')]=_0x46f5('0x59');this[_0x46f5('0x9')][_0x3cf608[_0x46f5('0x23')]][_0x173be6][_0x46f5('0x4f')]=_0x46f5('0x59');logger[_0x46f5('0x26')](_0x46f5('0x5a'),_0x3cf608[_0x46f5('0x23')],util[_0x46f5('0x28')](this[_0x46f5('0x9')][_0x3cf608[_0x46f5('0x23')]][_0x173be6],{'showHidden':![],'depth':null}));ami[_0x46f5('0x1f')](_0x46f5('0x5b'),this['channels'][_0x3cf608['uniqueid']][_0x173be6]);}}}}}catch(_0x454a04){logger[_0x46f5('0x38')]('[%s][voiceAgentReport][queuecallerabandon]',_0x3cf608[_0x46f5('0x23')],util['inspect'](_0x454a04,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0xaf8a5e){try{if(this[_0x46f5('0x21')](_0xaf8a5e)){logger['debug'](_0x46f5('0x5c'),_0xaf8a5e['uniqueid'],util[_0x46f5('0x28')](_0xaf8a5e,{'showHidden':![],'depth':null}));if(this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]]){for(var _0x3502e2 in this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]]){if(this['channels'][_0xaf8a5e[_0x46f5('0x23')]][_0x46f5('0x58')](_0x3502e2)){if(this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]][_0x3502e2]['agentconnectAt']&&!this[_0x46f5('0x9')][_0xaf8a5e['uniqueid']][_0x3502e2]['agentcomplete']){logger[_0x46f5('0x22')](_0x46f5('0x5d'),_0xaf8a5e[_0x46f5('0x23')],this[_0x46f5('0x9')][_0xaf8a5e['uniqueid']][_0x3502e2][_0x46f5('0x24')],_0x3502e2);this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]][_0x3502e2][_0x46f5('0x15')]=!![];this['channels'][_0xaf8a5e[_0x46f5('0x23')]][_0x3502e2]['agentcompleteAt']=moment()[_0x46f5('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xaf8a5e['uniqueid']][_0x3502e2][_0x46f5('0x4d')]=_0x46f5('0x5e');this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]][_0x3502e2][_0x46f5('0x4f')]=_0xaf8a5e[_0x46f5('0x4f')]=='transfer'?_0x46f5('0x5f'):_0xaf8a5e[_0x46f5('0x4f')];this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]][_0x3502e2]['talktime']=_0xaf8a5e[_0x46f5('0x60')];if(this[_0x46f5('0xb')][_0xaf8a5e[_0x46f5('0x2b')]]&&this['voiceQueues'][_0xaf8a5e[_0x46f5('0x2b')]][_0x46f5('0x61')]){this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]][_0x3502e2][_0x46f5('0x62')]=this[_0x46f5('0xb')][_0xaf8a5e[_0x46f5('0x2b')]][_0x46f5('0x63')];this[_0x46f5('0x9')][_0xaf8a5e['uniqueid']][_0x3502e2][_0x46f5('0x64')]=!![];}this[_0x46f5('0xc')][_0xaf8a5e[_0x46f5('0x33')]]=_[_0x46f5('0x2e')](this['agents'][_0xaf8a5e[_0x46f5('0x33')]],[_0x46f5('0x2b'),_0x46f5('0x65')]);logger[_0x46f5('0x26')](_0x46f5('0x66'),_0xaf8a5e['uniqueid'],util[_0x46f5('0x28')](this[_0x46f5('0x9')][_0xaf8a5e[_0x46f5('0x23')]][_0x3502e2],{'showHidden':![],'depth':null}));ami[_0x46f5('0x1f')](_0x46f5('0x67'),this[_0x46f5('0x9')][_0xaf8a5e['uniqueid']][_0x3502e2]);logger[_0x46f5('0x26')](_0x46f5('0x68'),_0xaf8a5e[_0x46f5('0x23')],util[_0x46f5('0x28')]({'id':this['agents'][_0xaf8a5e[_0x46f5('0x33')]]['id'],'destaccountcode':_0xaf8a5e[_0x46f5('0x69')]},{'showHidden':![],'depth':null}));this[_0x46f5('0x1f')](util[_0x46f5('0x29')](_0x46f5('0x36'),_0xaf8a5e[_0x46f5('0x24')]),_0x46f5('0x6a'),{'id':this[_0x46f5('0xc')][_0xaf8a5e[_0x46f5('0x33')]]['id'],'destaccountcode':_0xaf8a5e[_0x46f5('0x69')]});}}}}}}catch(_0x4801cc){logger[_0x46f5('0x38')](_0x46f5('0x6b'),_0xaf8a5e[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x4801cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x6c')]=function(_0x1c1316){try{if(this[_0x46f5('0x21')](_0x1c1316)){logger['debug'](_0x46f5('0x6d'),_0x1c1316['uniqueid'],util[_0x46f5('0x28')](_0x1c1316,{'showHidden':![],'depth':null}));this['addVariable'](_0x1c1316[_0x46f5('0x23')],_[_0x46f5('0x6e')](_0x1c1316['variable'])[0x0],_0x1c1316[_0x46f5('0x6f')]);if(this[_0x46f5('0x9')][_0x1c1316['uniqueid']]){for(var _0x15f3f4 in this[_0x46f5('0x9')][_0x1c1316[_0x46f5('0x23')]]){if(this[_0x46f5('0x9')][_0x1c1316['uniqueid']][_0x46f5('0x58')](_0x15f3f4)){logger[_0x46f5('0x22')](_0x46f5('0x70'),_0x1c1316[_0x46f5('0x23')],_0x15f3f4,_['keys'](_0x1c1316[_0x46f5('0x71')])[0x0],_0x1c1316['value']);if(_[_0x46f5('0x20')](this[_0x46f5('0x9')][_0x1c1316[_0x46f5('0x23')]][_0x15f3f4][_0x46f5('0xd')])){this['channels'][_0x1c1316[_0x46f5('0x23')]][_0x15f3f4][_0x46f5('0xd')]={};}this[_0x46f5('0x9')][_0x1c1316['uniqueid']][_0x15f3f4][_0x46f5('0xd')]=this[_0x46f5('0xd')][_0x1c1316[_0x46f5('0x23')]];}}}}}catch(_0x4c16ad){logger['error'](_0x46f5('0x72'),_0x1c1316['uniqueid'],util['inspect'](_0x4c16ad,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x73')]=function(_0x5c0347,_0x51a853,_0x5bc487){var _0x8f5e2b=['rtpaudioqos',_0x46f5('0x74'),_0x46f5('0x75'),'rtpaudioqosjitterbridged',_0x46f5('0x76'),_0x46f5('0x77'),'rtpaudioqosrtt',_0x46f5('0x78'),_0x46f5('0x79'),_0x46f5('0x7a'),'bridgepeer',_0x46f5('0x7b'),_0x46f5('0x7c'),'memberdynamic',_0x46f5('0x7d'),_0x46f5('0x7e'),_0x46f5('0x24'),_0x46f5('0x7f'),_0x46f5('0x80')];if(!_[_0x46f5('0x81')](_0x51a853)&&!_[_0x46f5('0x82')](_0x8f5e2b,_0x51a853)){if(_[_0x46f5('0x20')](this['variables'][_0x5c0347])){this[_0x46f5('0xd')][_0x5c0347]={};}this[_0x46f5('0xd')][_0x5c0347][_0x51a853]=_0x5bc487;}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x83')]=function(_0x2767e8){try{if(this['isNotNull'](_0x2767e8)){logger[_0x46f5('0x26')]('[%s][voiceAgentReport][hangup]\x20event:',_0x2767e8[_0x46f5('0x23')],util['inspect'](_0x2767e8,{'showHidden':![],'depth':null}));if(this[_0x46f5('0x9')][_0x2767e8['uniqueid']]){for(var _0x3fe673 in this[_0x46f5('0x9')][_0x2767e8[_0x46f5('0x23')]]){if(this[_0x46f5('0x9')][_0x2767e8[_0x46f5('0x23')]]['hasOwnProperty'](_0x3fe673)){if(this[_0x46f5('0x9')][_0x2767e8['uniqueid']][_0x3fe673]['reason']==_0x46f5('0x84')&&this[_0x46f5('0x9')][_0x2767e8[_0x46f5('0x23')]][_0x3fe673][_0x46f5('0x15')]){logger[_0x46f5('0x22')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x2767e8['uniqueid'],_0x3fe673);this[_0x46f5('0x9')][_0x2767e8[_0x46f5('0x23')]][_0x3fe673]['agentcompleteAt']=moment()[_0x46f5('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x46f5('0x26')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x2767e8[_0x46f5('0x23')],util[_0x46f5('0x28')](_[_0x46f5('0x85')](this[_0x46f5('0x9')][_0x2767e8['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x46f5('0x1f')](_0x46f5('0x86'),_['values'](this[_0x46f5('0x9')][_0x2767e8[_0x46f5('0x23')]]));delete this['channels'][_0x2767e8[_0x46f5('0x23')]];}if(this['variables'][_0x2767e8[_0x46f5('0x23')]]){delete this[_0x46f5('0xd')][_0x2767e8[_0x46f5('0x23')]];}}}catch(_0x3d01e1){logger['error']('[%s][voiceAgentReport][hangup]',_0x2767e8[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x3d01e1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x1c')]=function(_0x5e78b6){try{if(this['isNotNull'](_0x5e78b6)){logger[_0x46f5('0x26')](_0x46f5('0x87'),_0x5e78b6[_0x46f5('0x23')],util['inspect'](_0x5e78b6,{'showHidden':![],'depth':null}));if(this['channels'][_0x5e78b6[_0x46f5('0x88')]]){for(var _0xc5ab6f in this['channels'][_0x5e78b6['transfereeuniqueid']]){if(this[_0x46f5('0x9')][_0x5e78b6[_0x46f5('0x88')]][_0x46f5('0x58')](_0xc5ab6f)){if(_0x5e78b6[_0x46f5('0x89')]===_0xc5ab6f){logger['info']('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5e78b6[_0x46f5('0x23')],this[_0x46f5('0x9')][_0x5e78b6[_0x46f5('0x88')]][_0xc5ab6f][_0x46f5('0x24')],_0xc5ab6f);var _0x1f721e=moment();this[_0x46f5('0x9')][_0x5e78b6[_0x46f5('0x88')]][_0xc5ab6f]['agentcomplete']=!![];this['channels'][_0x5e78b6[_0x46f5('0x88')]][_0xc5ab6f][_0x46f5('0x8a')]=moment()['format'](_0x46f5('0x2a'));this[_0x46f5('0x9')][_0x5e78b6['transfereeuniqueid']][_0xc5ab6f][_0x46f5('0x4d')]=_0x46f5('0x5e');this[_0x46f5('0x9')][_0x5e78b6[_0x46f5('0x88')]][_0xc5ab6f][_0x46f5('0x4f')]=_0x46f5('0x84');this[_0x46f5('0x9')][_0x5e78b6['transfereeuniqueid']][_0xc5ab6f][_0x46f5('0x60')]=_0x1f721e['diff'](this[_0x46f5('0x9')][_0x5e78b6['transfereeuniqueid']][_0xc5ab6f]['agentconnectAt'],'seconds');}}}}if(this['channels'][_0x5e78b6[_0x46f5('0x8b')]]){var _0x2622f4=this[_0x46f5('0x9')][_0x5e78b6[_0x46f5('0x8b')]];this[_0x46f5('0x9')][_0x5e78b6['secondtransfereruniqueid']]=this[_0x46f5('0x9')][_0x5e78b6[_0x46f5('0x88')]];this[_0x46f5('0x9')][_0x5e78b6[_0x46f5('0x88')]]=_0x2622f4;}}}catch(_0x5706ee){logger[_0x46f5('0x38')](_0x46f5('0x8c'),_0x5e78b6[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x5706ee,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x1d')]=function(_0x5f3500){try{if(this[_0x46f5('0x21')](_0x5f3500)){logger[_0x46f5('0x26')](_0x46f5('0x8d'),_0x5f3500[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x5f3500,{'showHidden':![],'depth':null}));if(this['channels'][_0x5f3500[_0x46f5('0x88')]]){for(var _0x398dd5 in this[_0x46f5('0x9')][_0x5f3500['transfereeuniqueid']]){if(this[_0x46f5('0x9')][_0x5f3500[_0x46f5('0x88')]][_0x46f5('0x58')](_0x398dd5)){if(_0x5f3500[_0x46f5('0x8e')]===_0x398dd5){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5f3500[_0x46f5('0x23')],this[_0x46f5('0x9')][_0x5f3500[_0x46f5('0x88')]][_0x398dd5][_0x46f5('0x24')],_0x398dd5);var _0x3a28ad=moment();this[_0x46f5('0x9')][_0x5f3500[_0x46f5('0x88')]][_0x398dd5][_0x46f5('0x15')]=!![];this['channels'][_0x5f3500[_0x46f5('0x88')]][_0x398dd5][_0x46f5('0x8a')]=_0x3a28ad;this['channels'][_0x5f3500[_0x46f5('0x88')]][_0x398dd5]['lastevent']='complete';this[_0x46f5('0x9')][_0x5f3500[_0x46f5('0x88')]][_0x398dd5][_0x46f5('0x4f')]=_0x46f5('0x84');this[_0x46f5('0x9')][_0x5f3500[_0x46f5('0x88')]][_0x398dd5][_0x46f5('0x60')]=_0x3a28ad[_0x46f5('0x8f')](this[_0x46f5('0x9')][_0x5f3500[_0x46f5('0x88')]][_0x398dd5][_0x46f5('0x3c')],_0x46f5('0x90'));}}}}}}catch(_0x39f21c){logger[_0x46f5('0x38')](_0x46f5('0x91'),_0x5f3500[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x39f21c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')][_0x46f5('0x1a')]=function(_0x2c5e66){var _0xeab1fe='';try{if(this[_0x46f5('0x21')](_0x2c5e66)){logger['debug'](_0x46f5('0x92'),_0x2c5e66[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x2c5e66,{'showHidden':![],'depth':null}));if(_0x2c5e66[_0x46f5('0x93')]){_0xeab1fe=_0x2c5e66['channel']['substring'](0x0,_0x2c5e66[_0x46f5('0x93')][_0x46f5('0x94')]('-'));if(this[_0x46f5('0xc')][_0xeab1fe]){logger[_0x46f5('0x22')](_0x46f5('0x95'),_0x2c5e66[_0x46f5('0x23')],_0xeab1fe);this[_0x46f5('0xc')][_0xeab1fe][_0x46f5('0x96')]=!![];}}}}catch(_0x1ed988){logger[_0x46f5('0x38')](_0x46f5('0x97'),_0x2c5e66[_0x46f5('0x23')],util[_0x46f5('0x28')](_0x1ed988,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x46f5('0x1e')]['syncMusicOnHoldStop']=function(_0x20f121){var _0x25837e='';try{if(this[_0x46f5('0x21')](_0x20f121)){logger[_0x46f5('0x26')](_0x46f5('0x98'),_0x20f121[_0x46f5('0x23')],util['inspect'](_0x20f121,{'showHidden':![],'depth':null}));if(_0x20f121[_0x46f5('0x93')]){_0x25837e=_0x20f121[_0x46f5('0x93')][_0x46f5('0x99')](0x0,_0x20f121[_0x46f5('0x93')][_0x46f5('0x94')]('-'));if(this[_0x46f5('0xc')][_0x25837e]){logger[_0x46f5('0x22')](_0x46f5('0x9a'),_0x20f121['uniqueid'],_0x25837e);this['agents'][_0x25837e][_0x46f5('0x96')]=![];}}}}catch(_0x2bbb6d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x20f121[_0x46f5('0x23')],util['inspect'](_0x2bbb6d,{'showHidden':![],'depth':null}));}};module[_0x46f5('0x9b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 25db5d9..e8d36a4 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 _0xbe77=['push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','sipcalllinkedid','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','resolve','transferType','undefined','isEmpty','getSettings','then','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfereeuniqueid','transfercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','hangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','linkedid','merge','pick','context','from-sip','channel','split','exten','xcally-motion-preview','connectedlinenum','format','user:%s','accountcode','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','blindTransfers','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','user:agentconnect','application','applicationdata','appdata','startsWith','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','toLowerCase','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','diff','connectedlinename','destinationchannel','UserId','membername','answertime','holdtime','routealias','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors'];(function(_0x2c0035,_0x1b0094){var _0x285c53=function(_0x36df6a){while(--_0x36df6a){_0x2c0035['push'](_0x2c0035['shift']());}};_0x285c53(++_0x1b0094);}(_0xbe77,0x1e9));var _0x7be7=function(_0x7c909b,_0x1d3a3b){_0x7c909b=_0x7c909b-0x0;var _0x441257=_0xbe77[_0x7c909b];return _0x441257;};'use strict';var _=require(_0x7be7('0x0'));var moment=require(_0x7be7('0x1'));var util=require(_0x7be7('0x2'));var path=require('path');var Redis=require(_0x7be7('0x3'));var config=require('../../../config/environment');var logger=require(_0x7be7('0x4'))(_0x7be7('0x5'));var ami=require(_0x7be7('0x6'));var Channel=require(_0x7be7('0x7'));var RpcSetting=require(_0x7be7('0x8'));var applications=[_0x7be7('0x9'),_0x7be7('0xa'),_0x7be7('0xb'),'dial',_0x7be7('0xc'),_0x7be7('0xd')];var dispositions=[_0x7be7('0xe'),_0x7be7('0xf'),'FAILED',_0x7be7('0xe'),'NO\x20ANSWER',_0x7be7('0xe'),_0x7be7('0x10'),_0x7be7('0x11'),'FAILED','FAILED',_0x7be7('0xf')];config[_0x7be7('0x12')]=_[_0x7be7('0x13')](config[_0x7be7('0x12')],{'host':_0x7be7('0x14'),'port':0x18eb});var io=require(_0x7be7('0x15'))(new Redis(config[_0x7be7('0x12')]));function VoiceCallReport(_0x458b8d){this[_0x7be7('0x16')]=_0x458b8d[_0x7be7('0x16')];this['agents']=_0x458b8d[_0x7be7('0x17')];this['blindTransfers']={};ami['on'](_0x7be7('0x18'),this[_0x7be7('0x19')][_0x7be7('0x1a')](this));ami['on'](_0x7be7('0x1b'),this[_0x7be7('0x19')][_0x7be7('0x1a')](this));ami['on'](_0x7be7('0x1c'),this[_0x7be7('0x1d')][_0x7be7('0x1a')](this));ami['on']('newstate',this[_0x7be7('0x1e')][_0x7be7('0x1a')](this));ami['on'](_0x7be7('0x1f'),this['syncVarSet'][_0x7be7('0x1a')](this));ami['on'](_0x7be7('0x20'),this['syncHangup'][_0x7be7('0x1a')](this));ami['on']('newcallerid',this[_0x7be7('0x21')]['bind'](this));ami['on'](_0x7be7('0x22'),this[_0x7be7('0x23')][_0x7be7('0x1a')](this));ami['on']('blindtransfer',this[_0x7be7('0x24')]['bind'](this));ami['on'](_0x7be7('0x25'),this[_0x7be7('0x26')][_0x7be7('0x1a')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x7be7('0x1a')](this));try{logger[_0x7be7('0x27')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x7be7('0x28')]();}catch(_0x49a7d9){logger[_0x7be7('0x29')](_0x7be7('0x2a'),util[_0x7be7('0x2b')](_0x49a7d9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x7be7('0x2c')][_0x7be7('0x2d')]=function(_0x545a52){return _0x545a52!==null&&!_[_0x7be7('0x2e')](_0x545a52);};VoiceCallReport[_0x7be7('0x2c')][_0x7be7('0x2f')]=function(_0x2f7cc0,_0x4f52b0,_0x1a5fcf){io['to'](_0x2f7cc0)['emit'](_0x4f52b0,_0x1a5fcf);};VoiceCallReport[_0x7be7('0x2c')]['syncNewCallerId']=function(_0x35a94a){try{if(this['isNotNull'](_0x35a94a)){logger['info'](_0x7be7('0x30'),_0x35a94a[_0x7be7('0x31')],_0x35a94a[_0x7be7('0x32')],_0x35a94a[_0x7be7('0x33')]);logger[_0x7be7('0x34')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x35a94a[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x35a94a,{'showHidden':![],'depth':null}));if(_0x35a94a[_0x7be7('0x31')]===_0x35a94a[_0x7be7('0x35')]){if(!_[_0x7be7('0x2e')](this[_0x7be7('0x16')][_0x35a94a[_0x7be7('0x31')]])){_[_0x7be7('0x36')](this[_0x7be7('0x16')][_0x35a94a[_0x7be7('0x31')]],_[_0x7be7('0x37')](_0x35a94a,_['keys'](this[_0x7be7('0x16')][_0x35a94a['uniqueid']])));}}if(_0x35a94a[_0x7be7('0x38')]===_0x7be7('0x39')){if(this[_0x7be7('0x17')][_0x35a94a[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]){if(_0x35a94a[_0x7be7('0x3c')]==_0x7be7('0x3d')){this[_0x7be7('0x17')][_0x35a94a[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['destconnectedlinenum']=_0x35a94a[_0x7be7('0x3e')];this['emit'](util[_0x7be7('0x3f')](_0x7be7('0x40'),this[_0x7be7('0x17')][_0x35a94a[_0x7be7('0x3a')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x35a94a[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]][_0x7be7('0x41')],'destconnectedlinenum':_0x35a94a[_0x7be7('0x3e')]});}}}}}catch(_0x4ba54b){logger[_0x7be7('0x29')](_0x7be7('0x42'),_0x35a94a[_0x7be7('0x31')],util['inspect'](_0x4ba54b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7be7('0x1d')]=function(_0x50ecd3){try{if(this['isNotNull'](_0x50ecd3)){logger[_0x7be7('0x34')]('[%s][voiceCallReport][newchannel]\x20event:',_0x50ecd3[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x50ecd3,{'showHidden':![],'depth':null}));if(this[_0x7be7('0x16')][_0x50ecd3[_0x7be7('0x31')]])return;if(_0x50ecd3['channel']===_0x7be7('0x43'))return;if(_0x50ecd3['uniqueid']!==_0x50ecd3[_0x7be7('0x35')]&&!this[_0x7be7('0x44')][_0x50ecd3['linkedid']])return;logger['info'](_0x7be7('0x45'),_0x50ecd3['uniqueid'],_0x50ecd3[_0x7be7('0x38')],_0x50ecd3['exten']);this[_0x7be7('0x16')][_0x50ecd3[_0x7be7('0x31')]]=new Channel();this[_0x7be7('0x16')][_0x50ecd3[_0x7be7('0x31')]]['starttime']=moment()[_0x7be7('0x3f')](_0x7be7('0x46'));this[_0x7be7('0x16')][_0x50ecd3[_0x7be7('0x31')]][_0x7be7('0x47')]=dispositions[_[_0x7be7('0x48')](_0x50ecd3[_0x7be7('0x49')])];_[_0x7be7('0x36')](this[_0x7be7('0x16')][_0x50ecd3[_0x7be7('0x31')]],_[_0x7be7('0x37')](_0x50ecd3,_[_0x7be7('0x4a')](this[_0x7be7('0x16')][_0x50ecd3[_0x7be7('0x31')]])));if(_0x50ecd3['context']===_0x7be7('0x39')){if(this[_0x7be7('0x17')][_0x50ecd3[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]){if(_[_0x7be7('0x2e')](this[_0x7be7('0x17')][_0x50ecd3[_0x7be7('0x3a')]['split']('-')[0x0]][_0x7be7('0x4b')])){this[_0x7be7('0x17')][_0x50ecd3[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]][_0x7be7('0x4b')]=_0x50ecd3[_0x7be7('0x3c')];logger[_0x7be7('0x34')](_0x7be7('0x4c'),_0x50ecd3['uniqueid'],util[_0x7be7('0x2b')]({'id':this[_0x7be7('0x17')][_0x50ecd3[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x50ecd3[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x50ecd3[_0x7be7('0x3c')]},{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',this[_0x7be7('0x17')][_0x50ecd3[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]][_0x7be7('0x4d')]),_0x7be7('0x4e'),{'id':this['agents'][_0x50ecd3[_0x7be7('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x7be7('0x17')][_0x50ecd3[_0x7be7('0x3a')]['split']('-')[0x0]][_0x7be7('0x41')],'destconnectedlinenum':_0x50ecd3[_0x7be7('0x3c')]});}}}}}catch(_0x1bf9d4){logger[_0x7be7('0x29')]('[%s][voiceCallReport][newchannel]',_0x50ecd3[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x1bf9d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7be7('0x2c')][_0x7be7('0x19')]=function(_0x32d547){try{if(this[_0x7be7('0x2d')](_0x32d547)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x32d547[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x32d547,{'showHidden':![],'depth':null}));if(_0x32d547['channel']===_0x7be7('0x43')||_0x32d547[_0x7be7('0x3c')]==='h')return;if(_0x32d547[_0x7be7('0x31')]===_0x32d547[_0x7be7('0x35')]||this['blindTransfers'][_0x32d547['linkedid']]){_0x32d547['application']=_0x32d547[_0x7be7('0x4f')]['toLowerCase']();_0x32d547[_0x7be7('0x50')]=_0x32d547[_0x7be7('0x51')]||_0x32d547['applicationdata'];if(_0x32d547[_0x7be7('0x51')]&&!_0x32d547[_0x7be7('0x51')][_0x7be7('0x52')]('CDR(routeAlias)')&&_0x32d547[_0x7be7('0x4f')]!==_0x7be7('0xa')){_0x32d547[_0x7be7('0x50')]=_0x32d547[_0x7be7('0x50')]['toLowerCase']();}logger['info'](_0x7be7('0x53'),_0x32d547[_0x7be7('0x31')],_0x32d547[_0x7be7('0x4f')],_0x32d547['applicationdata']);if(_['isUndefined'](this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]])){this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]]=new Channel();this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]][_0x7be7('0x54')]=_0x32d547[_0x7be7('0x55')]?moment()[_0x7be7('0x56')](moment['duration'](_0x32d547['duration'])[_0x7be7('0x57')](),_0x7be7('0x57'))[_0x7be7('0x3f')](_0x7be7('0x46')):moment()[_0x7be7('0x3f')](_0x7be7('0x46'));this['channels'][_0x32d547['uniqueid']][_0x7be7('0x47')]=_0x7be7('0xe');}_[_0x7be7('0x36')](this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]],_['pick'](_0x32d547,_[_0x7be7('0x4a')](this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]])));if(_[_0x7be7('0x58')](applications,_0x32d547['application'])){this['channels'][_0x32d547[_0x7be7('0x31')]][_0x7be7('0x59')]=_0x32d547[_0x7be7('0x4f')];this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]][_0x7be7('0x5a')]=_0x32d547[_0x7be7('0x50')];if(_0x32d547[_0x7be7('0x4f')]===_0x7be7('0x9')&&_[_0x7be7('0x52')](_0x32d547[_0x7be7('0x50')][_0x7be7('0x5b')](),'cdr(')){var _0x548982=_0x32d547[_0x7be7('0x50')]['split']('=');var _0x3619fe=_0x548982[0x0][_0x7be7('0x5b')]()[_0x7be7('0x5c')](/cdr\((.*)\)/);if(_0x3619fe){if(_0x3619fe[0x1]===_0x7be7('0x5d')&&!_[_0x7be7('0x5e')](this['channels'][_0x32d547['uniqueid']][_0x3619fe[0x1]]))return;this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]][_0x3619fe[0x1]]=_0x548982[0x1];}}else if(_0x32d547[_0x7be7('0x4f')]===_0x7be7('0xa')){this[_0x7be7('0x16')][_0x32d547[_0x7be7('0x31')]]['queue']=_0x32d547[_0x7be7('0x50')][_0x7be7('0x3b')](',')[0x0];}}}}}catch(_0x4c94bd){logger['error'](_0x7be7('0x5f'),_0x32d547[_0x7be7('0x31')],util['inspect'](_0x4c94bd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7be7('0x2c')]['syncNewState']=function(_0x548ac7){try{if(this[_0x7be7('0x2d')](_0x548ac7)){logger[_0x7be7('0x27')](_0x7be7('0x60'),_0x548ac7[_0x7be7('0x31')],_0x548ac7[_0x7be7('0x35')],_0x548ac7[_0x7be7('0x32')],_0x548ac7[_0x7be7('0x33')]);logger[_0x7be7('0x34')](_0x7be7('0x61'),_0x548ac7[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x548ac7,{'showHidden':![],'depth':null}));if(_0x548ac7[_0x7be7('0x49')]!=='6')return;if(_0x548ac7['uniqueid']!==_0x548ac7[_0x7be7('0x35')]){var _0x12b348=moment();if(this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]]){if(!this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]]['answered']){this[_0x7be7('0x16')][_0x548ac7['linkedid']][_0x7be7('0x62')]=!![];this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]]['answertime']=_0x12b348['format']('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x548ac7[_0x7be7('0x35')]][_0x7be7('0x54')]){this['channels'][_0x548ac7[_0x7be7('0x35')]]['holdtime']=_0x12b348[_0x7be7('0x63')](this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]][_0x7be7('0x54')],_0x7be7('0x57'));}}this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]][_0x7be7('0x35')]=_0x548ac7[_0x7be7('0x31')];if(_0x548ac7['calleridnum']!==_0x7be7('0x3d')){this['channels'][_0x548ac7[_0x7be7('0x35')]]['connectedlinenum']=_0x548ac7[_0x7be7('0x33')];}this[_0x7be7('0x16')][_0x548ac7['linkedid']][_0x7be7('0x64')]=_0x548ac7[_0x7be7('0x32')];this['channels'][_0x548ac7[_0x7be7('0x35')]][_0x7be7('0x65')]=_0x548ac7['channel'];this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]]['disposition']=dispositions[_[_0x7be7('0x48')](_0x548ac7[_0x7be7('0x49')])];if(this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]){this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]][_0x7be7('0x66')]=this['agents'][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['id'];this['channels'][_0x548ac7['linkedid']][_0x7be7('0x67')]=this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]][_0x7be7('0x4d')];}}if(this['channels'][_0x548ac7['uniqueid']]){if(!this['channels'][_0x548ac7['uniqueid']][_0x7be7('0x62')]){this[_0x7be7('0x16')][_0x548ac7['uniqueid']][_0x7be7('0x62')]=!![];this['channels'][_0x548ac7[_0x7be7('0x31')]][_0x7be7('0x68')]=_0x12b348[_0x7be7('0x3f')](_0x7be7('0x46'));if(this[_0x7be7('0x16')][_0x548ac7['uniqueid']][_0x7be7('0x54')]){this['channels'][_0x548ac7[_0x7be7('0x31')]][_0x7be7('0x69')]=_0x12b348[_0x7be7('0x63')](this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x31')]]['starttime'],'seconds');}}if(_0x548ac7['calleridnum']!==_0x7be7('0x3d')){this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x31')]][_0x7be7('0x3e')]=_0x548ac7[_0x7be7('0x33')];}this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x31')]][_0x7be7('0x64')]=_0x548ac7[_0x7be7('0x32')];this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x31')]][_0x7be7('0x65')]=_0x548ac7['channel'];this[_0x7be7('0x16')][_0x548ac7['uniqueid']][_0x7be7('0x47')]=dispositions[_[_0x7be7('0x48')](_0x548ac7[_0x7be7('0x49')])];}}else{if(this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x31')]]){if(this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]){this['channels'][_0x548ac7[_0x7be7('0x31')]]['UserId']=this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['id'];this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x31')]]['membername']=this[_0x7be7('0x17')][_0x548ac7['channel'][_0x7be7('0x3b')]('-')[0x0]][_0x7be7('0x4d')];}}}if(_0x548ac7[_0x7be7('0x38')]==='from-sip'){if(this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]){this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]][_0x7be7('0x4b')]=_0x548ac7[_0x7be7('0x3c')];var _0x4c3633,_0x360522;if(this['channels'][_0x548ac7[_0x7be7('0x31')]]){_0x4c3633=this[_0x7be7('0x16')][_0x548ac7['uniqueid']][_0x7be7('0x6a')];_0x360522=this['channels'][_0x548ac7[_0x7be7('0x31')]][_0x7be7('0xa')];}else if(this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]]){_0x4c3633=this['channels'][_0x548ac7[_0x7be7('0x35')]][_0x7be7('0x6a')];_0x360522=this[_0x7be7('0x16')][_0x548ac7[_0x7be7('0x35')]][_0x7be7('0xa')];}this[_0x7be7('0x17')][_0x548ac7['channel']['split']('-')[0x0]][_0x7be7('0xa')]=_0x360522;this['agents'][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['routealias']=_0x4c3633;logger[_0x7be7('0x34')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x548ac7['uniqueid'],util[_0x7be7('0x2b')]({'id':this['agents'][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x548ac7[_0x7be7('0x3c')],'routealias':_0x4c3633,'queue':_0x360522||undefined},{'showHidden':![],'depth':null}));this[_0x7be7('0x2f')](util[_0x7be7('0x3f')]('user:%s',this['agents'][_0x548ac7[_0x7be7('0x3a')]['split']('-')[0x0]]['name']),_0x7be7('0x4e'),{'id':this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x7be7('0x17')][_0x548ac7[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x548ac7[_0x7be7('0x3c')],'routealias':_0x4c3633,'queue':_0x360522||undefined});}}}}catch(_0x55a413){logger[_0x7be7('0x29')]('[%s][voiceCallReport][newstate]',_0x548ac7[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x55a413,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7be7('0x2c')][_0x7be7('0x6b')]=function(_0x16e19e,_0x316108){try{if(this[_0x7be7('0x16')][_0x16e19e]){logger[_0x7be7('0x27')](_0x7be7('0x6c'),_0x16e19e,_0x316108);this[_0x7be7('0x16')][_0x16e19e][_0x7be7('0x6d')]=!![];if(_[_0x7be7('0x6e')](_0x316108,'.wav49')){_0x316108=_0x316108[_0x7be7('0x6f')](_0x7be7('0x70'),_0x7be7('0x71'));}this['channels'][_0x16e19e][_0x7be7('0x72')]=_0x316108;var _0x339ad5=_[_0x7be7('0x73')](this[_0x7be7('0x16')][_0x16e19e][_0x7be7('0x74')],{'filename':_0x316108});if(_['isNil'](_0x339ad5)){this[_0x7be7('0x16')][_0x16e19e][_0x7be7('0x74')][_0x7be7('0x75')]({'filename':_0x316108,'createdAt':moment()[_0x7be7('0x3f')](_0x7be7('0x46')),'mixmonitorid':'','status':_0x7be7('0x76')});}}}catch(_0x576b4){logger[_0x7be7('0x29')](_0x7be7('0x77'),_0x16e19e,util[_0x7be7('0x2b')](_0x576b4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7be7('0x2c')][_0x7be7('0x78')]=function(_0x302265){try{if(this[_0x7be7('0x2d')](_0x302265)){logger[_0x7be7('0x34')](_0x7be7('0x79'),_0x302265[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x302265,{'showHidden':![],'depth':null}));if(this[_0x7be7('0x16')][_0x302265[_0x7be7('0x31')]]&&_0x302265[_0x7be7('0x3a')]!=_0x7be7('0x43')){if(this['isNotNull'](_0x302265['variable'])){if(this[_0x7be7('0x2d')](_0x302265[_0x7be7('0x7a')][_0x7be7('0x7b')])){logger[_0x7be7('0x27')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x302265['uniqueid'],_0x302265['value']);this[_0x7be7('0x6b')](_0x302265[_0x7be7('0x31')],_0x302265['value']);}else if(this[_0x7be7('0x2d')](_0x302265['variable'][_0x7be7('0x7c')])){logger[_0x7be7('0x27')](_0x7be7('0x7d'),_0x302265[_0x7be7('0x31')],_0x302265[_0x7be7('0x7e')]);this['channels'][_0x302265[_0x7be7('0x31')]][_0x7be7('0x33')]=_0x302265[_0x7be7('0x7e')];}else if(this['isNotNull'](_0x302265[_0x7be7('0x7a')][_0x7be7('0x7f')])){logger[_0x7be7('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x302265[_0x7be7('0x31')],_0x302265['value']);this[_0x7be7('0x16')][_0x302265[_0x7be7('0x31')]][_0x7be7('0x80')]=_0x302265[_0x7be7('0x7e')];}else if(this['isNotNull'](_0x302265[_0x7be7('0x7a')][_0x7be7('0x81')])){logger[_0x7be7('0x27')](_0x7be7('0x82'),_0x302265[_0x7be7('0x31')],_0x302265[_0x7be7('0x7e')]);this[_0x7be7('0x16')][_0x302265[_0x7be7('0x31')]]['type']=_0x302265[_0x7be7('0x7e')];}else if(this['isNotNull'](_0x302265[_0x7be7('0x7a')][_0x7be7('0x83')])){logger[_0x7be7('0x27')](_0x7be7('0x84'),_0x302265[_0x7be7('0x31')],_0x302265[_0x7be7('0x7e')]['split'](',')[0x0]);this[_0x7be7('0x16')][_0x302265['uniqueid']][_0x7be7('0xa')]=_0x302265[_0x7be7('0x7e')][_0x7be7('0x3b')](',')[0x0];}else if(this[_0x7be7('0x2d')](_0x302265[_0x7be7('0x7a')][_0x7be7('0x85')])){logger[_0x7be7('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x302265[_0x7be7('0x31')],_0x302265[_0x7be7('0x7e')]);this[_0x7be7('0x16')][_0x302265['uniqueid']][_0x7be7('0x86')]=_0x302265[_0x7be7('0x7e')];}else if(this[_0x7be7('0x2d')](_0x302265[_0x7be7('0x7a')][_0x7be7('0x87')])){logger[_0x7be7('0x27')](_0x7be7('0x88'),_0x302265['uniqueid'],_0x302265[_0x7be7('0x7e')]);this['channels'][_0x302265[_0x7be7('0x31')]][_0x7be7('0x89')]=_0x302265['value'];}else if(this[_0x7be7('0x2d')](_0x302265['variable'][_0x7be7('0x8a')])){logger[_0x7be7('0x27')](_0x7be7('0x8b'),_0x302265[_0x7be7('0x31')],_0x302265[_0x7be7('0x7e')]);this['channels'][_0x302265[_0x7be7('0x31')]][_0x7be7('0x8c')]=_0x302265[_0x7be7('0x7e')];}else if(this['isNotNull'](_0x302265[_0x7be7('0x7a')][_0x7be7('0x8d')])){logger[_0x7be7('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x302265[_0x7be7('0x31')],_0x302265[_0x7be7('0x7e')]);this[_0x7be7('0x16')][_0x302265[_0x7be7('0x31')]][_0x7be7('0xa')]=_0x302265[_0x7be7('0x7e')];}else if(this['isNotNull'](_0x302265['variable']['sipcallid'])){logger[_0x7be7('0x27')](_0x7be7('0x8e'),_0x302265[_0x7be7('0x31')],_0x302265[_0x7be7('0x7e')]);this[_0x7be7('0x16')][_0x302265['uniqueid']]['sipcalluniqueid']=_0x302265[_0x7be7('0x7e')];}}}else if(this[_0x7be7('0x2d')](_0x302265['variable']['mixmonitor_filename'])){if(_0x302265[_0x7be7('0x7e')]){var _0x53af0a=path[_0x7be7('0x8f')](_0x302265['value'])['name'];logger[_0x7be7('0x27')](_0x7be7('0x90'),_0x53af0a,_0x302265[_0x7be7('0x7e')]);this['syncMixMonitorFilename'](_0x53af0a,_0x302265[_0x7be7('0x7e')]);}}else if(this[_0x7be7('0x16')][_0x302265[_0x7be7('0x35')]]){if(this[_0x7be7('0x2d')](_0x302265[_0x7be7('0x7a')])){if(this[_0x7be7('0x2d')](_0x302265['variable'][_0x7be7('0x91')])){logger['info'](_0x7be7('0x8e'),_0x302265[_0x7be7('0x35')],_0x302265[_0x7be7('0x7e')]);this['channels'][_0x302265['linkedid']][_0x7be7('0x92')]=_0x302265['value'];}}}}}catch(_0x40b2c9){logger['error']('[%s][voiceCallReport][varset]',_0x302265[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x40b2c9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7be7('0x2c')][_0x7be7('0x93')]=function(_0x22984d){try{if(this['isNotNull'](_0x22984d)){logger[_0x7be7('0x34')](_0x7be7('0x94'),_0x22984d[_0x7be7('0x31')],util[_0x7be7('0x2b')](_0x22984d,{'showHidden':![],'depth':null}));if(this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]]){if(this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x35')]]){this[_0x7be7('0x16')][this['blindTransfers'][_0x22984d[_0x7be7('0x35')]]['linkedid']][_0x7be7('0x31')]=_0x22984d[_0x7be7('0x31')];this['channels'][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x35')]][_0x7be7('0x62')]=this[_0x7be7('0x16')][_0x22984d['uniqueid']][_0x7be7('0x62')];this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x35')]][_0x7be7('0x68')]=this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]][_0x7be7('0x68')];this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d['linkedid']]['linkedid']][_0x7be7('0x65')]=this['channels'][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]]['linkedid']][_0x7be7('0x3a')];this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x35')]][_0x7be7('0x47')]=this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]][_0x7be7('0x47')];this['channels'][_0x22984d['uniqueid']]=this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x35')]];delete this['channels'][this[_0x7be7('0x44')][_0x22984d['linkedid']]['linkedid']];}else if(this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]]){this[_0x7be7('0x16')][this['blindTransfers'][_0x22984d[_0x7be7('0x35')]]['uniqueid']][_0x7be7('0x31')]=[this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]][_0x7be7('0x35')],this[_0x7be7('0x16')][this['blindTransfers'][_0x22984d['linkedid']][_0x7be7('0x31')]][_0x7be7('0x35')]=this['channels'][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]][_0x7be7('0x31')]][0x0];this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]][_0x7be7('0x62')]=this[_0x7be7('0x16')][_0x22984d['uniqueid']][_0x7be7('0x62')];this[_0x7be7('0x16')][this['blindTransfers'][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]][_0x7be7('0x68')]=this['channels'][_0x22984d[_0x7be7('0x31')]]['answertime'];this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]]['uniqueid']]['destinationchannel']=this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]][_0x7be7('0x3a')];this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]][_0x7be7('0x47')]=this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]][_0x7be7('0x47')];this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]]=this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]];delete this[_0x7be7('0x16')][this[_0x7be7('0x44')][_0x22984d[_0x7be7('0x35')]][_0x7be7('0x31')]];}}if(this['channels'][_0x22984d[_0x7be7('0x31')]]){logger[_0x7be7('0x27')](_0x7be7('0x95'),_0x22984d[_0x7be7('0x31')],_0x22984d[_0x7be7('0x96')]);var _0x3384a9=moment();this['channels'][_0x22984d['uniqueid']][_0x7be7('0x97')]=_0x3384a9['format'](_0x7be7('0x46'));this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]][_0x7be7('0x55')]=_0x3384a9[_0x7be7('0x63')](this['channels'][_0x22984d[_0x7be7('0x31')]]['starttime'],_0x7be7('0x57'));if(this[_0x7be7('0x16')][_0x22984d['uniqueid']]['answered']){this[_0x7be7('0x16')][_0x22984d['uniqueid']][_0x7be7('0x98')]=_0x3384a9[_0x7be7('0x63')](this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]]['answertime'],_0x7be7('0x57'));this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]][_0x7be7('0x69')]=this[_0x7be7('0x16')][_0x22984d[_0x7be7('0x31')]][_0x7be7('0x55')]-this['channels'][_0x22984d[_0x7be7('0x31')]]['billableseconds'];}if(_0x22984d['context']===_0x7be7('0x39')){if(this['agents'][_0x22984d[_0x7be7('0x3a')]['split']('-')[0x0]]){this[_0x7be7('0x17')][_0x22984d[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]=_[_0x7be7('0x99')](this[_0x7be7('0x17')][_0x22984d[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]],[_0x7be7('0x4b')]);logger[_0x7be7('0x34')](_0x7be7('0x9a'),_0x22984d[_0x7be7('0x31')],util[_0x7be7('0x2b')]({'id':this[_0x7be7('0x17')][_0x22984d[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x7be7('0x17')][_0x22984d[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x7be7('0x2f')](util['format'](_0x7be7('0x40'),this[_0x7be7('0x17')][_0x22984d[_0x7be7('0x3a')]['split']('-')[0x0]][_0x7be7('0x4d')]),_0x7be7('0x9b'),{'id':this['agents'][_0x22984d[_0x7be7('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x22984d[_0x7be7('0x3a')][_0x7be7('0x3b')]('-')[0x0]][_0x7be7('0x41')]});for(var _0x6e14=0x0;_0x6e140x0?_0x34de8f:0x0;this['voiceQueues'][_0xed8898[_0x4520('0x69')]][_0x4520('0x30')]=this[_0x4520('0x13')][_0xed8898['queue']]['talking']>_['toNumber'](_0xed8898['loggedin'])?_['toNumber'](_0xed8898[_0x4520('0x6e')]):this[_0x4520('0x13')][_0xed8898['queue']]['talking'];this['emitVoiceQueueSummary'](this[_0x4520('0x13')][_0xed8898['queue']],_0x4520('0x17'));}logger['debug'](_0x4520('0x6f'),util['inspect'](this[_0x4520('0x13')][_0xed8898[_0x4520('0x69')]],{'showHidden':![],'depth':null}));ami[_0x4520('0x43')](_0x4520('0x70'),this['voiceQueues'][_0xed8898[_0x4520('0x69')]]);}}}catch(_0x4d3254){logger[_0x4520('0x3a')](_0x4520('0x68'),util['inspect'](_0x4d3254,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4520('0xc')][_0x4520('0x1a')]=function(_0x30170d){logger[_0x4520('0x44')](_0x4520('0x71'),util[_0x4520('0x3c')](_0x30170d,{'showHidden':![],'depth':null}));ami[_0x4520('0x43')](_0x4520('0x72'),{});this[_0x4520('0x14')]=!![];};VoiceQueueReport['prototype'][_0x4520('0x73')]=function(_0x48be6e){try{if(this[_0x4520('0x63')](_0x48be6e)){logger[_0x4520('0x44')](_0x4520('0x74'),_0x48be6e['uniqueid'],util['inspect'](_0x48be6e,{'showHidden':![],'depth':null}));if(_[_0x4520('0x75')](this['queueReports'][_0x48be6e['uniqueid']]))this[_0x4520('0x10')][_0x48be6e[_0x4520('0x4c')]]=[];if(_['isUndefined'](this[_0x4520('0x12')][_0x48be6e['uniqueid']]))this[_0x4520('0x12')][_0x48be6e[_0x4520('0x4c')]]={};var _0x274fbc=new QueueReport();_0x274fbc[_0x4520('0x49')]=_0x48be6e[_0x4520('0x69')];_0x274fbc[_0x4520('0x5b')]=this[_0x4520('0x13')][_0x274fbc[_0x4520('0x49')]]&&this[_0x4520('0x13')][_0x274fbc[_0x4520('0x49')]][_0x4520('0x5b')]?this['voiceQueues'][_0x274fbc[_0x4520('0x49')]]['type']||_0x4520('0x51'):_0x4520('0x51');_0x274fbc['queue']=_0x48be6e[_0x4520('0x69')];_0x274fbc[_0x4520('0x76')]=moment()[_0x4520('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x274fbc['position']=_0x48be6e['position'];_0x274fbc[_0x4520('0x77')]=_0x48be6e[_0x4520('0x77')];_0x274fbc[_0x4520('0x4c')]=_0x48be6e['uniqueid'];_0x274fbc[_0x4520('0x78')]=this[_0x4520('0x12')][_0x48be6e[_0x4520('0x4c')]][_0x4520('0x78')];logger[_0x4520('0x79')](_0x4520('0x7a'),_0x274fbc[_0x4520('0x49')],_0x274fbc[_0x4520('0x5b')]);_[_0x4520('0x7b')](_0x274fbc,_['pick'](_0x48be6e,_[_0x4520('0x7c')](_0x274fbc)));this[_0x4520('0x10')][_0x48be6e[_0x4520('0x4c')]][_0x4520('0x7d')](_0x274fbc);this[_0x4520('0x12')][_0x48be6e['uniqueid']]=_0x274fbc;this[_0x4520('0x7e')](_0x274fbc,'queuecallerjoin');}}catch(_0x52ed95){logger[_0x4520('0x3a')](_0x4520('0x74'),_0x48be6e['uniqueid'],util[_0x4520('0x3c')](_0x52ed95,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4520('0xc')][_0x4520('0x1e')]=function(_0x392966){try{if(this[_0x4520('0x63')](_0x392966)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x392966[_0x4520('0x4c')],util['inspect'](_0x392966,{'showHidden':![],'depth':null}));if(this[_0x4520('0x10')][_0x392966[_0x4520('0x4c')]]){var _0x45b6a0=_[_0x4520('0x7f')](this[_0x4520('0x10')][_0x392966[_0x4520('0x4c')]]);_0x45b6a0[_0x4520('0x80')]=![];_0x45b6a0[_0x4520('0x81')]=null;_0x45b6a0['holdtime']=_0x392966[_0x4520('0x82')];_0x45b6a0[_0x4520('0x83')]=_0x392966[_0x4520('0x83')];_0x45b6a0['queuecallerabandon']=!![];_0x45b6a0[_0x4520('0x84')]=moment()[_0x4520('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x45b6a0[_0x4520('0x85')]='ABANDONED';_0x45b6a0[_0x4520('0x86')]=null;logger[_0x4520('0x79')](_0x4520('0x87'),_0x45b6a0['name'],_0x45b6a0['type']);this[_0x4520('0x12')][_0x392966[_0x4520('0x4c')]]=_0x45b6a0;this['emitVoiceQueueChannelRemove'](_0x45b6a0,'queuecallerabandon');}}}catch(_0x33cdfb){logger[_0x4520('0x3a')](_0x4520('0x88'),_0x392966[_0x4520('0x4c')],util['inspect'](_0x33cdfb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4520('0xc')][_0x4520('0x20')]=function(_0x501673){try{if(this[_0x4520('0x63')](_0x501673)){logger[_0x4520('0x44')](_0x4520('0x89'),_0x501673['uniqueid'],util[_0x4520('0x3c')](_0x501673,{'showHidden':![],'depth':null}));if(this[_0x4520('0x10')][_0x501673[_0x4520('0x4c')]]){var _0x2ce0d9=_[_0x4520('0x7f')](this['queueReports'][_0x501673['uniqueid']]);_0x2ce0d9[_0x4520('0x8a')]=moment()[_0x4520('0x47')](_0x4520('0x8b'));_0x2ce0d9[_0x4520('0x8c')]=_0x501673[_0x4520('0x8c')];_0x2ce0d9['connectedlinename']=_0x501673[_0x4520('0x8d')];logger[_0x4520('0x79')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2ce0d9['name'],_0x2ce0d9[_0x4520('0x5b')],_0x501673[_0x4520('0x8c')],_0x501673[_0x4520('0x8d')]);this[_0x4520('0x12')][_0x501673[_0x4520('0x4c')]]=_0x2ce0d9;this[_0x4520('0x7e')](_0x2ce0d9,_0x4520('0x1f'));}}}catch(_0x4d1b3b){logger[_0x4520('0x3a')](_0x4520('0x89'),_0x501673['uniqueid'],util[_0x4520('0x3c')](_0x4d1b3b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4520('0xc')][_0x4520('0x23')]=function(_0x471850){try{if(this[_0x4520('0x63')](_0x471850)){logger['debug'](_0x4520('0x8e'),_0x471850['uniqueid'],util[_0x4520('0x3c')](_0x471850,{'showHidden':![],'depth':null}));if(this[_0x4520('0x10')][_0x471850[_0x4520('0x4c')]]){var _0x37ee66=_['last'](this[_0x4520('0x10')][_0x471850[_0x4520('0x4c')]]);_0x37ee66[_0x4520('0x80')]=!![];_0x37ee66['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x4520('0x79')](_0x4520('0x8f'),_0x37ee66[_0x4520('0x49')],_0x37ee66[_0x4520('0x5b')]);}}}catch(_0x5cb0b3){logger[_0x4520('0x3a')](_0x4520('0x8e'),_0x471850[_0x4520('0x4c')],util[_0x4520('0x3c')](_0x5cb0b3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x537d4c){try{if(this['isNotNull'](_0x537d4c)){logger[_0x4520('0x44')](_0x4520('0x90'),_0x537d4c[_0x4520('0x4c')],util[_0x4520('0x3c')](_0x537d4c,{'showHidden':![],'depth':null}));if(this[_0x4520('0x10')][_0x537d4c[_0x4520('0x4c')]]){var _0x36a693=_[_0x4520('0x7f')](this[_0x4520('0x10')][_0x537d4c[_0x4520('0x4c')]]);_0x36a693['queuecallerabandon']=![];_0x36a693[_0x4520('0x84')]=null;_0x36a693[_0x4520('0x91')]=!![];_0x36a693[_0x4520('0x86')]=_0x537d4c['membername'];_0x36a693[_0x4520('0x82')]=_0x537d4c[_0x4520('0x82')];_0x36a693[_0x4520('0x80')]=!![];_0x36a693[_0x4520('0x92')]=![];_0x36a693[_0x4520('0x93')]=null;if(!_0x36a693[_0x4520('0x94')]){if(_0x537d4c[_0x4520('0x95')]==_0x4520('0x94')){_0x36a693[_0x4520('0x85')]=_0x4520('0x96');logger[_0x4520('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x36a693[_0x4520('0x49')],_0x36a693[_0x4520('0x5b')]);}else{if(_[_0x4520('0x97')](_0x537d4c[_0x4520('0x98')][_0x4520('0x99')](),_0x4520('0x9a'))){if(this[_0x4520('0x10')][_0x537d4c['linkedid']]){var _0x2048c3=_[_0x4520('0x7f')](this[_0x4520('0x10')][_0x537d4c[_0x4520('0x9b')]]);_0x2048c3[_0x4520('0x80')]=![];_0x2048c3[_0x4520('0x92')]=!![];_0x2048c3[_0x4520('0x93')]=moment(_0x36a693[_0x4520('0x76')])['add'](_0x537d4c[_0x4520('0x82')],'seconds')[_0x4520('0x47')](_0x4520('0x8b'));_0x2048c3[_0x4520('0x85')]='FORWARDTRANSFER';_0x2048c3[_0x4520('0x94')]=!![];_0x2048c3[_0x4520('0x9c')]=_0x4520('0x9d');_0x2048c3[_0x4520('0x9e')]=_0x537d4c[_0x4520('0x9f')];_0x2048c3[_0x4520('0xa0')]=_0x537d4c[_0x4520('0x4c')];logger[_0x4520('0x79')](_0x4520('0xa1'),_0x2048c3['name'],_0x2048c3[_0x4520('0x5b')]);var _0x450c7e=this[_0x4520('0x10')][_0x537d4c[_0x4520('0x9b')]];this['queueReports'][_0x537d4c[_0x4520('0x9b')]]=this[_0x4520('0x10')][_0x537d4c[_0x4520('0x4c')]];this[_0x4520('0x10')][_0x537d4c[_0x4520('0x4c')]]=_0x450c7e;}}else{_0x36a693[_0x4520('0x85')]=_0x4520('0xa2')+_0x537d4c[_0x4520('0x95')]['toUpperCase']();logger[_0x4520('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x36a693['name'],_0x36a693[_0x4520('0x5b')],_0x36a693[_0x4520('0x85')]);}}}this[_0x4520('0x12')][_0x537d4c[_0x4520('0x4c')]]=_0x36a693;this[_0x4520('0x41')](_0x36a693,_0x4520('0xa3'));}}}catch(_0xdc1c10){logger[_0x4520('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x537d4c[_0x4520('0x4c')],util[_0x4520('0x3c')](_0xdc1c10,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4520('0xa4')]=function(_0x563277){try{if(this[_0x4520('0x63')](_0x563277)){logger[_0x4520('0x44')](_0x4520('0xa5'),_0x563277['uniqueid'],util[_0x4520('0x3c')](_0x563277,{'showHidden':![],'depth':null}));this['addVariable'](_0x563277[_0x4520('0x4c')],_['keys'](_0x563277[_0x4520('0xa6')])[0x0],_0x563277[_0x4520('0xa7')]);if(this[_0x4520('0x10')][_0x563277[_0x4520('0x4c')]]){var _0xd961f=_[_0x4520('0x7f')](this[_0x4520('0x10')][_0x563277[_0x4520('0x4c')]]);if(_0xd961f){if(this[_0x4520('0x63')](_0x563277[_0x4520('0xa6')])&&this[_0x4520('0x63')](_0x563277[_0x4520('0xa6')][_0x4520('0xa8')])){switch(_0x563277[_0x4520('0xa7')]){case'CONTINUE':_0xd961f[_0x4520('0x92')]=![];_0xd961f[_0x4520('0x93')]=null;break;case _0x4520('0xa9'):_0xd961f['lastevent']=_0x4520('0xaa');_0xd961f[_0x4520('0x92')]=!![];_0xd961f['queuecallerexitAt']=moment()[_0x4520('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0xd961f[_0x4520('0x8a')]=moment()[_0x4520('0x47')](_0x4520('0x8b'));logger['debug'](_0x4520('0xab'),_0x563277[_0x4520('0x4c')],util[_0x4520('0x3c')](_0xd961f,{'showHidden':![],'depth':null}));ami[_0x4520('0x43')](_0x4520('0xac'),_0xd961f);break;default:_0xd961f[_0x4520('0x92')]=!![];_0xd961f[_0x4520('0x93')]=moment()['format'](_0x4520('0x8b'));_0xd961f[_0x4520('0x8a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xd961f[_0x4520('0x1d')]=![];_0xd961f[_0x4520('0x84')]=null;_0xd961f['queuecallerexitreason']=_0x563277[_0x4520('0xa7')];this['channels'][_0x563277['uniqueid']]=_0xd961f;this[_0x4520('0x41')](_0xd961f,'varset');}else if(this['isNotNull'](_0x563277[_0x4520('0xa6')])&&this['isNotNull'](_0x563277[_0x4520('0xa6')]['queueposition'])){if(!_0xd961f[_0x4520('0x1d')]){_0xd961f[_0x4520('0x92')]=!![];_0xd961f[_0x4520('0x93')]=moment()[_0x4520('0x47')](_0x4520('0x8b'));_0xd961f['queuecallerexitreason']=_0x4520('0xad');_0xd961f[_0x4520('0x8a')]=moment()[_0x4520('0x47')](_0x4520('0x8b'));this[_0x4520('0x12')][_0x563277['uniqueid']]=_0xd961f;}}logger['info'](_0x4520('0xae'),_0x563277[_0x4520('0x4c')],_0xd961f[_0x4520('0x49')],_0xd961f[_0x4520('0x5b')],_[_0x4520('0x7c')](_0x563277[_0x4520('0xa6')])[0x0],_0x563277[_0x4520('0xa7')]);_0xd961f[_0x4520('0x16')]=this[_0x4520('0x16')][_0x563277[_0x4520('0x4c')]];}}}}catch(_0x40a241){logger[_0x4520('0x3a')](_0x4520('0xa5'),_0x563277['uniqueid'],util['inspect'](_0x40a241,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4520('0xaf')]=function(_0x64051d,_0x5ae2ea,_0x1033ce){var _0xb29778=[_0x4520('0xb0'),_0x4520('0xb1'),_0x4520('0xb2'),_0x4520('0xb3'),'rtpaudioqosloss',_0x4520('0xb4'),_0x4520('0xb5'),'rtpaudioqosrttbridged',_0x4520('0xb6'),_0x4520('0xb7'),_0x4520('0xb8'),_0x4520('0xb9'),_0x4520('0xba'),'memberdynamic',_0x4520('0xbb'),_0x4520('0xbc'),_0x4520('0xbd'),_0x4520('0xbe'),_0x4520('0xbf')];if(!_[_0x4520('0x35')](_0x5ae2ea)&&!_['includes'](_0xb29778,_0x5ae2ea)){if(_['isUndefined'](this[_0x4520('0x16')][_0x64051d])){this[_0x4520('0x16')][_0x64051d]={};}this[_0x4520('0x16')][_0x64051d][_0x5ae2ea]=_0x1033ce;}};VoiceQueueReport[_0x4520('0xc')][_0x4520('0xc0')]=function(_0x544375,_0x2a0345,_0x5d86c2){var _0x441732={};for(var _0x205f21=0x0;_0x205f210x0?_0x249ecb:0x0;this['voiceQueues'][_0x5c64a9[_0x8bc8('0x68')]][_0x8bc8('0x32')]=this[_0x8bc8('0x12')][_0x5c64a9['queue']]['talking']>_[_0x8bc8('0x70')](_0x5c64a9['loggedin'])?_[_0x8bc8('0x70')](_0x5c64a9[_0x8bc8('0x6f')]):this[_0x8bc8('0x12')][_0x5c64a9['queue']]['talking'];this['emitVoiceQueueSummary'](this[_0x8bc8('0x12')][_0x5c64a9[_0x8bc8('0x68')]],'queuesummary');}logger[_0x8bc8('0x4d')](_0x8bc8('0x71'),util[_0x8bc8('0x41')](this['voiceQueues'][_0x5c64a9[_0x8bc8('0x68')]],{'showHidden':![],'depth':null}));ami[_0x8bc8('0x44')](_0x8bc8('0x72'),this[_0x8bc8('0x12')][_0x5c64a9[_0x8bc8('0x68')]]);}}}catch(_0x1b7a26){logger[_0x8bc8('0x3e')](_0x8bc8('0x67'),util[_0x8bc8('0x41')](_0x1b7a26,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8bc8('0x36')]['syncQueueSummaryComplete']=function(_0x52c06d){logger[_0x8bc8('0x4d')](_0x8bc8('0x73'),util[_0x8bc8('0x41')](_0x52c06d,{'showHidden':![],'depth':null}));ami['emit'](_0x8bc8('0x74'),{});this[_0x8bc8('0x13')]=!![];};VoiceQueueReport['prototype'][_0x8bc8('0x1b')]=function(_0x3b0615){try{if(this[_0x8bc8('0x60')](_0x3b0615)){logger['debug'](_0x8bc8('0x75'),_0x3b0615['uniqueid'],util[_0x8bc8('0x41')](_0x3b0615,{'showHidden':![],'depth':null}));if(_[_0x8bc8('0x61')](this['queueReports'][_0x3b0615[_0x8bc8('0x47')]]))this[_0x8bc8('0xe')][_0x3b0615['uniqueid']]=[];if(_[_0x8bc8('0x61')](this['channels'][_0x3b0615[_0x8bc8('0x47')]]))this[_0x8bc8('0x10')][_0x3b0615[_0x8bc8('0x47')]]={};var _0x125b19=new QueueReport();_0x125b19[_0x8bc8('0x4a')]=_0x3b0615[_0x8bc8('0x68')];_0x125b19[_0x8bc8('0x54')]=this[_0x8bc8('0x12')][_0x125b19[_0x8bc8('0x4a')]]&&this[_0x8bc8('0x12')][_0x125b19[_0x8bc8('0x4a')]][_0x8bc8('0x54')]?this[_0x8bc8('0x12')][_0x125b19['name']][_0x8bc8('0x54')]||_0x8bc8('0x55'):_0x8bc8('0x55');_0x125b19[_0x8bc8('0x68')]=_0x3b0615[_0x8bc8('0x68')];_0x125b19[_0x8bc8('0x76')]=moment()[_0x8bc8('0x48')](_0x8bc8('0x77'));_0x125b19[_0x8bc8('0x78')]=_0x3b0615[_0x8bc8('0x78')];_0x125b19[_0x8bc8('0x79')]=_0x3b0615[_0x8bc8('0x79')];_0x125b19[_0x8bc8('0x47')]=_0x3b0615['uniqueid'];_0x125b19[_0x8bc8('0x7a')]=this[_0x8bc8('0x10')][_0x3b0615[_0x8bc8('0x47')]]['routealias'];logger['info'](_0x8bc8('0x7b'),_0x125b19[_0x8bc8('0x4a')],_0x125b19['type']);_[_0x8bc8('0x7c')](_0x125b19,_[_0x8bc8('0x7d')](_0x3b0615,_['keys'](_0x125b19)));this['queueReports'][_0x3b0615[_0x8bc8('0x47')]][_0x8bc8('0x7e')](_0x125b19);this[_0x8bc8('0x10')][_0x3b0615[_0x8bc8('0x47')]]=_0x125b19;this[_0x8bc8('0x45')](_0x125b19,_0x8bc8('0x1a'));}}catch(_0xb5358b){logger[_0x8bc8('0x3e')](_0x8bc8('0x75'),_0x3b0615[_0x8bc8('0x47')],util['inspect'](_0xb5358b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8bc8('0x36')][_0x8bc8('0x1d')]=function(_0x2eb84e){try{if(this[_0x8bc8('0x60')](_0x2eb84e)){logger[_0x8bc8('0x4d')](_0x8bc8('0x7f'),_0x2eb84e[_0x8bc8('0x47')],util['inspect'](_0x2eb84e,{'showHidden':![],'depth':null}));if(this[_0x8bc8('0xe')][_0x2eb84e[_0x8bc8('0x47')]]){var _0x62d184=_['last'](this[_0x8bc8('0xe')][_0x2eb84e['uniqueid']]);_0x62d184[_0x8bc8('0x80')]=![];_0x62d184[_0x8bc8('0x81')]=null;_0x62d184[_0x8bc8('0x82')]=_0x2eb84e[_0x8bc8('0x82')];_0x62d184[_0x8bc8('0x83')]=_0x2eb84e[_0x8bc8('0x83')];_0x62d184[_0x8bc8('0x1c')]=!![];_0x62d184[_0x8bc8('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x62d184[_0x8bc8('0x4f')]='ABANDONED';_0x62d184[_0x8bc8('0x85')]=null;logger[_0x8bc8('0x6a')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x62d184['name'],_0x62d184['type']);this[_0x8bc8('0x10')][_0x2eb84e[_0x8bc8('0x47')]]=_0x62d184;this[_0x8bc8('0x4c')](_0x62d184,_0x8bc8('0x1c'));}}}catch(_0x372ddb){logger[_0x8bc8('0x3e')](_0x8bc8('0x7f'),_0x2eb84e[_0x8bc8('0x47')],util['inspect'](_0x372ddb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8bc8('0x36')][_0x8bc8('0x1e')]=function(_0x29f349){try{if(this[_0x8bc8('0x60')](_0x29f349)){logger['debug'](_0x8bc8('0x86'),_0x29f349[_0x8bc8('0x47')],util['inspect'](_0x29f349,{'showHidden':![],'depth':null}));if(this[_0x8bc8('0xe')][_0x29f349[_0x8bc8('0x47')]]){var _0x7d0117=_['last'](this[_0x8bc8('0xe')][_0x29f349[_0x8bc8('0x47')]]);_0x7d0117[_0x8bc8('0x87')]=moment()['format'](_0x8bc8('0x77'));_0x7d0117[_0x8bc8('0x88')]=_0x29f349[_0x8bc8('0x88')];_0x7d0117['connectedlinename']=_0x29f349['connectedlinename'];logger[_0x8bc8('0x6a')](_0x8bc8('0x89'),_0x7d0117[_0x8bc8('0x4a')],_0x7d0117[_0x8bc8('0x54')],_0x29f349[_0x8bc8('0x88')],_0x29f349[_0x8bc8('0x8a')]);this[_0x8bc8('0x10')][_0x29f349[_0x8bc8('0x47')]]=_0x7d0117;this[_0x8bc8('0x45')](_0x7d0117,'queuecallerleave');}}}catch(_0xf54676){logger[_0x8bc8('0x3e')](_0x8bc8('0x86'),_0x29f349[_0x8bc8('0x47')],util[_0x8bc8('0x41')](_0xf54676,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8bc8('0x36')]['syncAgentConnect']=function(_0xe6bfdf){try{if(this[_0x8bc8('0x60')](_0xe6bfdf)){logger['debug'](_0x8bc8('0x8b'),_0xe6bfdf[_0x8bc8('0x47')],util['inspect'](_0xe6bfdf,{'showHidden':![],'depth':null}));if(this[_0x8bc8('0xe')][_0xe6bfdf['uniqueid']]){var _0x4e3abe=_[_0x8bc8('0x8c')](this[_0x8bc8('0xe')][_0xe6bfdf['uniqueid']]);_0x4e3abe[_0x8bc8('0x80')]=!![];_0x4e3abe[_0x8bc8('0x4f')]=_0x8bc8('0x8d');logger[_0x8bc8('0x6a')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4e3abe[_0x8bc8('0x4a')],_0x4e3abe[_0x8bc8('0x54')]);}}}catch(_0x4cc20f){logger['error']('[%s][voiceQueueReport][agentconnect]',_0xe6bfdf[_0x8bc8('0x47')],util[_0x8bc8('0x41')](_0x4cc20f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8bc8('0x20')]=function(_0x57e13e){try{if(this['isNotNull'](_0x57e13e)){logger['debug'](_0x8bc8('0x8e'),_0x57e13e[_0x8bc8('0x47')],util[_0x8bc8('0x41')](_0x57e13e,{'showHidden':![],'depth':null}));if(this[_0x8bc8('0xe')][_0x57e13e[_0x8bc8('0x47')]]){var _0x3a2a55=_[_0x8bc8('0x8c')](this[_0x8bc8('0xe')][_0x57e13e[_0x8bc8('0x47')]]);_0x3a2a55['queuecallerabandon']=![];_0x3a2a55[_0x8bc8('0x84')]=null;_0x3a2a55[_0x8bc8('0x8f')]=!![];_0x3a2a55['lastAssignedTo']=_0x57e13e[_0x8bc8('0x90')];_0x3a2a55[_0x8bc8('0x82')]=_0x57e13e[_0x8bc8('0x82')];_0x3a2a55[_0x8bc8('0x80')]=!![];_0x3a2a55[_0x8bc8('0x91')]=![];_0x3a2a55['queuecallerexitAt']=null;if(!_0x3a2a55[_0x8bc8('0x92')]){if(_0x57e13e['reason']==_0x8bc8('0x92')){_0x3a2a55[_0x8bc8('0x4f')]=_0x8bc8('0x93');logger[_0x8bc8('0x6a')](_0x8bc8('0x94'),_0x3a2a55[_0x8bc8('0x4a')],_0x3a2a55[_0x8bc8('0x54')]);}else{if(_[_0x8bc8('0x95')](_0x57e13e[_0x8bc8('0x3b')][_0x8bc8('0x96')](),'local/')){if(this[_0x8bc8('0xe')][_0x57e13e['linkedid']]){var _0x5b64ff=_['last'](this[_0x8bc8('0xe')][_0x57e13e[_0x8bc8('0x97')]]);_0x5b64ff[_0x8bc8('0x80')]=![];_0x5b64ff['queuecallerexit']=!![];_0x5b64ff['queuecallerexitAt']=moment(_0x3a2a55['queuecallerjoinAt'])[_0x8bc8('0x98')](_0x57e13e['holdtime'],'seconds')[_0x8bc8('0x48')](_0x8bc8('0x77'));_0x5b64ff[_0x8bc8('0x4f')]=_0x8bc8('0x99');_0x5b64ff[_0x8bc8('0x92')]=!![];_0x5b64ff[_0x8bc8('0x9a')]=_0x8bc8('0x9b');_0x5b64ff[_0x8bc8('0x9c')]=_0x57e13e['destexten'];_0x5b64ff[_0x8bc8('0x9d')]=_0x57e13e['uniqueid'];logger[_0x8bc8('0x6a')](_0x8bc8('0x9e'),_0x5b64ff[_0x8bc8('0x4a')],_0x5b64ff['type']);var _0x587e44=this[_0x8bc8('0xe')][_0x57e13e[_0x8bc8('0x97')]];this[_0x8bc8('0xe')][_0x57e13e[_0x8bc8('0x97')]]=this[_0x8bc8('0xe')][_0x57e13e[_0x8bc8('0x47')]];this[_0x8bc8('0xe')][_0x57e13e[_0x8bc8('0x47')]]=_0x587e44;}}else{_0x3a2a55[_0x8bc8('0x4f')]=_0x8bc8('0x9f')+_0x57e13e[_0x8bc8('0xa0')][_0x8bc8('0xa1')]();logger[_0x8bc8('0x6a')](_0x8bc8('0xa2'),_0x3a2a55[_0x8bc8('0x4a')],_0x3a2a55[_0x8bc8('0x54')],_0x3a2a55[_0x8bc8('0x4f')]);}}}this[_0x8bc8('0x10')][_0x57e13e[_0x8bc8('0x47')]]=_0x3a2a55;this[_0x8bc8('0x4c')](_0x3a2a55,_0x8bc8('0x1f'));}}}catch(_0x30de26){logger[_0x8bc8('0x3e')]('[%s][voiceQueueReport][agentcomplete]',_0x57e13e[_0x8bc8('0x47')],util[_0x8bc8('0x41')](_0x30de26,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8bc8('0x36')]['syncVarSet']=function(_0x181269){try{if(this[_0x8bc8('0x60')](_0x181269)){logger[_0x8bc8('0x4d')]('[%s][voiceQueueReport][varset]',_0x181269[_0x8bc8('0x47')],util['inspect'](_0x181269,{'showHidden':![],'depth':null}));this[_0x8bc8('0xa3')](_0x181269[_0x8bc8('0x47')],_[_0x8bc8('0xa4')](_0x181269[_0x8bc8('0xa5')])[0x0],_0x181269[_0x8bc8('0xa6')]);if(this['queueReports'][_0x181269[_0x8bc8('0x47')]]){var _0x5d3bce=_[_0x8bc8('0x8c')](this[_0x8bc8('0xe')][_0x181269[_0x8bc8('0x47')]]);if(_0x5d3bce){if(this[_0x8bc8('0x60')](_0x181269[_0x8bc8('0xa5')])&&this[_0x8bc8('0x60')](_0x181269[_0x8bc8('0xa5')][_0x8bc8('0xa7')])){switch(_0x181269[_0x8bc8('0xa6')]){case _0x8bc8('0xa8'):_0x5d3bce[_0x8bc8('0x91')]=![];_0x5d3bce['queuecallerexitAt']=null;break;case _0x8bc8('0xa9'):_0x5d3bce['lastevent']=_0x8bc8('0xaa');_0x5d3bce['queuecallerexit']=!![];_0x5d3bce[_0x8bc8('0xab')]=moment()[_0x8bc8('0x48')](_0x8bc8('0x77'));_0x5d3bce[_0x8bc8('0x87')]=moment()['format'](_0x8bc8('0x77'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x181269[_0x8bc8('0x47')],util[_0x8bc8('0x41')](_0x5d3bce,{'showHidden':![],'depth':null}));ami[_0x8bc8('0x44')](_0x8bc8('0xac'),_0x5d3bce);break;default:_0x5d3bce[_0x8bc8('0x91')]=!![];_0x5d3bce['queuecallerexitAt']=moment()['format'](_0x8bc8('0x77'));_0x5d3bce[_0x8bc8('0x87')]=moment()[_0x8bc8('0x48')](_0x8bc8('0x77'));}_0x5d3bce[_0x8bc8('0x1c')]=![];_0x5d3bce[_0x8bc8('0x84')]=null;_0x5d3bce[_0x8bc8('0x4f')]=_0x181269[_0x8bc8('0xa6')];this[_0x8bc8('0x10')][_0x181269[_0x8bc8('0x47')]]=_0x5d3bce;this['emitVoiceQueueChannelRemove'](_0x5d3bce,_0x8bc8('0x23'));}else if(this[_0x8bc8('0x60')](_0x181269[_0x8bc8('0xa5')])&&this[_0x8bc8('0x60')](_0x181269['variable'][_0x8bc8('0xad')])){if(!_0x5d3bce[_0x8bc8('0x1c')]){_0x5d3bce[_0x8bc8('0x91')]=!![];_0x5d3bce[_0x8bc8('0xab')]=moment()[_0x8bc8('0x48')](_0x8bc8('0x77'));_0x5d3bce['queuecallerexitreason']=_0x8bc8('0xae');_0x5d3bce[_0x8bc8('0x87')]=moment()[_0x8bc8('0x48')](_0x8bc8('0x77'));this['channels'][_0x181269[_0x8bc8('0x47')]]=_0x5d3bce;}}logger[_0x8bc8('0x6a')](_0x8bc8('0xaf'),_0x181269[_0x8bc8('0x47')],_0x5d3bce['name'],_0x5d3bce[_0x8bc8('0x54')],_[_0x8bc8('0xa4')](_0x181269[_0x8bc8('0xa5')])[0x0],_0x181269['value']);_0x5d3bce['variables']=this[_0x8bc8('0x15')][_0x181269[_0x8bc8('0x47')]];}}}}catch(_0x1dc279){logger[_0x8bc8('0x3e')](_0x8bc8('0xb0'),_0x181269[_0x8bc8('0x47')],util[_0x8bc8('0x41')](_0x1dc279,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8bc8('0x36')][_0x8bc8('0xa3')]=function(_0x3e918c,_0x1ba2bb,_0x295212){var _0x842427=['rtpaudioqos','rtpaudioqosbridged',_0x8bc8('0xb1'),_0x8bc8('0xb2'),_0x8bc8('0xb3'),_0x8bc8('0xb4'),_0x8bc8('0xb5'),_0x8bc8('0xb6'),'sipcallid',_0x8bc8('0xb7'),_0x8bc8('0xb8'),_0x8bc8('0xb9'),_0x8bc8('0xba'),'memberdynamic',_0x8bc8('0xbb'),_0x8bc8('0xbc'),_0x8bc8('0x90'),_0x8bc8('0xbd'),_0x8bc8('0xbe')];if(!_[_0x8bc8('0x38')](_0x1ba2bb)&&!_['includes'](_0x842427,_0x1ba2bb)){if(_['isUndefined'](this[_0x8bc8('0x15')][_0x3e918c])){this[_0x8bc8('0x15')][_0x3e918c]={};}this[_0x8bc8('0x15')][_0x3e918c][_0x1ba2bb]=_0x295212;}};VoiceQueueReport[_0x8bc8('0x36')][_0x8bc8('0xbf')]=function(_0x3318e8,_0x4ff57e,_0x4adae5){var _0x326960={};for(var _0x3612da=0x0;_0x3612da=0x0?moment(_0x1a7f62[_0x40b2('0x16')])[_0x40b2('0xb')](_0x1a7f62[_0x40b2('0x15')],_0x40b2('0x17')):null,'data1':'outbound','data2':_0x1a7f62['accountcode'],'data3':_0x1a7f62[_0x40b2('0x18')],'data4':_0x1a7f62[_0x40b2('0x19')]||null,'role':_0x40b2('0xf'),'internal':_0x1a7f62[_0x40b2('0x10')]?_[_0x40b2('0x11')](_0x1a7f62[_0x40b2('0x10')]):undefined,'uniqueid':_0x1a7f62[_0x40b2('0x12')]},'log':_0x40b2('0x13')});}; \ No newline at end of file +var _0xa5d8=['../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','voiceDialReport','membername','starttime','endtime','diff','outbound','dialstring','uniqueid','moment','util'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0xa5d8,0x6e));var _0x8a5d=function(_0x36446e,_0x3a22d2){_0x36446e=_0x36446e-0x0;var _0xed77f8=_0xa5d8[_0x36446e];return _0xed77f8;};'use strict';var moment=require(_0x8a5d('0x0'));var _=require('lodash');var util=require(_0x8a5d('0x1'));var client=require(_0x8a5d('0x2'));exports[_0x8a5d('0x3')]=function(_0x3f3b1a){var _0x44c1be=_0x3f3b1a[_0x8a5d('0x4')]||_0x3f3b1a['queuecallerexitAt'];return client[_0x8a5d('0x5')](_0x8a5d('0x6'),{'body':{'channel':_0x8a5d('0x7'),'membername':_0x3f3b1a[_0x8a5d('0x8')],'interface':_['isNil'](_0x3f3b1a[_0x8a5d('0x9')])?util['format'](_0x8a5d('0xa'),_0x3f3b1a['lastAssignedTo']):_0x3f3b1a[_0x8a5d('0x9')],'type':_0x8a5d('0xb'),'enterAt':_0x3f3b1a[_0x8a5d('0xc')],'exitAt':_0x44c1be,'duration':moment(_0x44c1be)['diff'](_0x3f3b1a[_0x8a5d('0xc')],_0x8a5d('0xd')),'data1':_0x8a5d('0xe'),'data2':_0x3f3b1a[_0x8a5d('0xf')],'data3':_0x3f3b1a[_0x8a5d('0x10')],'data4':null,'data5':_0x3f3b1a['queue'],'role':_0x8a5d('0x11'),'internal':_0x3f3b1a[_0x8a5d('0x12')]?_[_0x8a5d('0x13')](_0x3f3b1a[_0x8a5d('0x12')]):undefined,'uniqueid':_0x3f3b1a['uniqueid']},'log':_0x8a5d('0x6')});};exports[_0x8a5d('0x14')]=function(_0x1363c2){return client[_0x8a5d('0x5')]('CreateMemberReport',{'body':{'channel':_0x8a5d('0x7'),'membername':_0x1363c2[_0x8a5d('0x15')],'interface':_0x1363c2[_0x8a5d('0x9')],'type':_0x8a5d('0xb'),'enterAt':_0x1363c2[_0x8a5d('0x16')],'exitAt':_0x1363c2[_0x8a5d('0x17')],'duration':moment(_0x1363c2[_0x8a5d('0x17')])['diff'](_0x1363c2['starttime'],_0x8a5d('0xd'))>=0x0?moment(_0x1363c2[_0x8a5d('0x17')])[_0x8a5d('0x18')](_0x1363c2['starttime'],_0x8a5d('0xd')):null,'data1':_0x8a5d('0x19'),'data2':_0x1363c2[_0x8a5d('0x12')],'data3':_0x1363c2[_0x8a5d('0x10')],'data4':_0x1363c2[_0x8a5d('0x1a')]||null,'role':_0x8a5d('0x11'),'internal':_0x1363c2[_0x8a5d('0x12')]?_['toNumber'](_0x1363c2['accountcode']):undefined,'uniqueid':_0x1363c2[_0x8a5d('0x1b')]},'log':_0x8a5d('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 2720032..09fe366 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9ed=['getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x32fe5b,_0x464e33){var _0x2440e5=function(_0x43522f){while(--_0x43522f){_0x32fe5b['push'](_0x32fe5b['shift']());}};_0x2440e5(++_0x464e33);}(_0xc9ed,0x12b));var _0xdc9e=function(_0x1b857f,_0x286e31){_0x1b857f=_0x1b857f-0x0;var _0x5582e9=_0xc9ed[_0x1b857f];return _0x5582e9;};'use strict';var client=require(_0xdc9e('0x0'));exports[_0xdc9e('0x1')]=function(){return client[_0xdc9e('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xdc9e('0x3'),_0xdc9e('0x4')]},'log':_0xdc9e('0x5')});}; \ No newline at end of file +var _0x0c19=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','../client'];(function(_0x2c86c1,_0x398182){var _0x4a7965=function(_0x3e3c39){while(--_0x3e3c39){_0x2c86c1['push'](_0x2c86c1['shift']());}};_0x4a7965(++_0x398182);}(_0x0c19,0xf5));var _0x90c1=function(_0x17bb57,_0x56b46a){_0x17bb57=_0x17bb57-0x0;var _0x5d40ec=_0x0c19[_0x17bb57];return _0x5d40ec;};'use strict';var client=require(_0x90c1('0x0'));exports[_0x90c1('0x1')]=function(){return client[_0x90c1('0x2')](_0x90c1('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x90c1('0x4'),_0x90c1('0x5')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 54c21da..714408a 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 _0x06a0=['html','../client','GetTemplate','name'];(function(_0x1c85cf,_0xb959d1){var _0x4243ba=function(_0x316cf9){while(--_0x316cf9){_0x1c85cf['push'](_0x1c85cf['shift']());}};_0x4243ba(++_0xb959d1);}(_0x06a0,0x1e1));var _0x006a=function(_0x4d0810,_0x13e15f){_0x4d0810=_0x4d0810-0x0;var _0x3e47e0=_0x06a0[_0x4d0810];return _0x3e47e0;};'use strict';var client=require(_0x006a('0x0'));exports['getTemplates']=function(_0x28f9a0){return function(_0x4cb795){return client['Request'](_0x006a('0x1'),{'options':{'raw':!![],'attributes':['id',_0x006a('0x2'),_0x006a('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x1ae7=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1ae7,0xc6));var _0x71ae=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x1ae7[_0x2160a9];return _0xa88cf7;};'use strict';var client=require(_0x71ae('0x0'));exports[_0x71ae('0x1')]=function(_0x181944){return function(_0x57ade7){return client[_0x71ae('0x2')](_0x71ae('0x3'),{'options':{'raw':!![],'attributes':['id',_0x71ae('0x4'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 9842941..96b2ac8 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 _0xb7df=['Actions','action','data1','data2','data3','data4','data6','data7','GetTrigger','../client','getTriggers','Request','name','channel','status','Condition','AllConditions','field','operator','value','Action'];(function(_0x28da84,_0x42d8dd){var _0x1be6c3=function(_0x37cd95){while(--_0x37cd95){_0x28da84['push'](_0x28da84['shift']());}};_0x1be6c3(++_0x42d8dd);}(_0xb7df,0x9c));var _0xfb7d=function(_0x24f61f,_0x500333){_0x24f61f=_0x24f61f-0x0;var _0x6bfa01=_0xb7df[_0x24f61f];return _0x6bfa01;};'use strict';var client=require(_0xfb7d('0x0'));exports[_0xfb7d('0x1')]=function(_0x4b7c5e){return function(_0x4cccc4){return client[_0xfb7d('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xfb7d('0x3'),_0xfb7d('0x4'),_0xfb7d('0x5')],'include':[{'model':_0xfb7d('0x6'),'as':_0xfb7d('0x7'),'attributes':['id',_0xfb7d('0x8'),_0xfb7d('0x9'),'value']},{'model':_0xfb7d('0x6'),'as':'AnyConditions','attributes':['id','field',_0xfb7d('0x9'),_0xfb7d('0xa')]},{'model':_0xfb7d('0xb'),'as':_0xfb7d('0xc'),'attributes':['id',_0xfb7d('0xd'),_0xfb7d('0xe'),_0xfb7d('0xf'),_0xfb7d('0x10'),_0xfb7d('0x11'),'data5',_0xfb7d('0x12'),_0xfb7d('0x13')]}]},'log':_0xfb7d('0x14')});};}; \ No newline at end of file +var _0xf3d0=['AnyConditions','Actions','action','data1','data2','data3','data4','data6','data7','GetTrigger','Request','name','channel','status','AllConditions','field','operator','value','Condition'];(function(_0x1e0ab4,_0x106dcb){var _0x504c1b=function(_0x225818){while(--_0x225818){_0x1e0ab4['push'](_0x1e0ab4['shift']());}};_0x504c1b(++_0x106dcb);}(_0xf3d0,0x1e5));var _0x0f3d=function(_0xc0ff5d,_0x2cbe29){_0xc0ff5d=_0xc0ff5d-0x0;var _0x1e159e=_0xf3d0[_0xc0ff5d];return _0x1e159e;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x5992b2){return function(_0x58f3b6){return client[_0x0f3d('0x0')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x0f3d('0x1'),_0x0f3d('0x2'),_0x0f3d('0x3')],'include':[{'model':'Condition','as':_0x0f3d('0x4'),'attributes':['id',_0x0f3d('0x5'),_0x0f3d('0x6'),_0x0f3d('0x7')]},{'model':_0x0f3d('0x8'),'as':_0x0f3d('0x9'),'attributes':['id',_0x0f3d('0x5'),'operator',_0x0f3d('0x7')]},{'model':'Action','as':_0x0f3d('0xa'),'attributes':['id',_0x0f3d('0xb'),_0x0f3d('0xc'),_0x0f3d('0xd'),_0x0f3d('0xe'),_0x0f3d('0xf'),'data5',_0x0f3d('0x10'),_0x0f3d('0x11')]}]},'log':_0x0f3d('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 3294959..5f923f7 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 _0x7722=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x3fa7f5,_0x37ebb0){var _0x617a04=function(_0x30be5f){while(--_0x30be5f){_0x3fa7f5['push'](_0x3fa7f5['shift']());}};_0x617a04(++_0x37ebb0);}(_0x7722,0xdd));var _0x2772=function(_0x9b389c,_0x194e93){_0x9b389c=_0x9b389c-0x0;var _0x2d53ab=_0x7722[_0x9b389c];return _0x2d53ab;};'use strict';var client=require(_0x2772('0x0'));exports[_0x2772('0x1')]=function(_0x97db39){return function(_0x52e6c5){return client[_0x2772('0x2')](_0x2772('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2772('0x4'),_0x2772('0x5'),_0x2772('0x6')]},'log':_0x2772('0x3')});};}; \ No newline at end of file +var _0x093a=['defaultuser','GetTrunk','getTrunks','name','registry'];(function(_0xfbd94b,_0x13edfc){var _0x41d0f3=function(_0x565aaa){while(--_0x565aaa){_0xfbd94b['push'](_0xfbd94b['shift']());}};_0x41d0f3(++_0x13edfc);}(_0x093a,0x16a));var _0xa093=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x093a[_0x307d86];return _0x361745;};'use strict';var client=require('../client');exports[_0xa093('0x0')]=function(_0x208b55){return function(_0x197f08){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa093('0x1'),_0xa093('0x2'),_0xa093('0x3')]},'log':_0xa093('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b179c00..f1e11df 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x5e3755,_0xd67e98){var _0x211209=function(_0x230c70){while(--_0x230c70){_0x5e3755['push'](_0x5e3755['shift']());}};_0x211209(++_0xd67e98);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xcb91[_0x1911ed];return _0x11edaa;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x55f7ec,_0x35fed9){var _0x53ce10=function(_0x4a191d){while(--_0x4a191d){_0x55f7ec['push'](_0x55f7ec['shift']());}};_0x53ce10(++_0x35fed9);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 970f769..b1f6145 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 _0x9254=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x9254,0x95));var _0x4925=function(_0x4cd8b8,_0x34a9e7){_0x4cd8b8=_0x4cd8b8-0x0;var _0x5b8b68=_0x9254[_0x4cd8b8];return _0x5b8b68;};'use strict';var client=require(_0x4925('0x0'));exports['create']=function(_0x41c326){return client[_0x4925('0x1')](_0x4925('0x2'),{'body':_0x41c326,'log':_0x4925('0x2')});};exports[_0x4925('0x3')]=function(_0x487300,_0x36522e,_0x4a69cd){return client[_0x4925('0x1')](_0x4925('0x4'),{'body':_0x487300,'options':{'where':{'uniqueid':_0x36522e,'interface':_0x4a69cd,'agentcomplete':!![]}},'log':_0x4925('0x4')});}; \ No newline at end of file +var _0xa813=['update','Request','UpdateVoiceAgentReport','CreateVoiceAgentReport'];(function(_0x42bbed,_0x2ded4a){var _0x5cba04=function(_0x1f0d37){while(--_0x1f0d37){_0x42bbed['push'](_0x42bbed['shift']());}};_0x5cba04(++_0x2ded4a);}(_0xa813,0x73));var _0x3a81=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa813[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports['create']=function(_0x4b9dba){return client['Request'](_0x3a81('0x0'),{'body':_0x4b9dba,'log':_0x3a81('0x0')});};exports[_0x3a81('0x1')]=function(_0x4c0b89,_0x45113f,_0x24dbec){return client[_0x3a81('0x2')](_0x3a81('0x3'),{'body':_0x4c0b89,'options':{'where':{'uniqueid':_0x45113f,'interface':_0x24dbec,'agentcomplete':!![]}},'log':_0x3a81('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index ae7d6c0..fa14a27 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 _0x323b=['../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','moment','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x323b,0x102));var _0xb323=function(_0x244d9e,_0x2b79a4){_0x244d9e=_0x244d9e-0x0;var _0x5590c9=_0x323b[_0x244d9e];return _0x5590c9;};'use strict';var moment=require(_0xb323('0x0'));var util=require('util');var _=require(_0xb323('0x1'));var client=require(_0xb323('0x2'));exports[_0xb323('0x3')]=function(_0x4c841b){return client[_0xb323('0x4')](_0xb323('0x5'),{'body':_['merge'](_0x4c841b,{'source':_0x4c841b[_0xb323('0x6')],'destinationcontext':_0x4c841b[_0xb323('0x7')],'callerid':_0x4c841b[_0xb323('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0xb323('0x5')});};exports[_0xb323('0x9')]=function(){return function(){return client['Request'](_0xb323('0xa'),{'options':{'where':{'type':[_0xb323('0xb')],'createdAt':{'$between':[moment()[_0xb323('0xc')](_0xb323('0xd'))[_0xb323('0xe')](_0xb323('0xf')),moment()[_0xb323('0x10')](_0xb323('0xd'))[_0xb323('0xe')](_0xb323('0xf'))]}},'attributes':[_0xb323('0x11'),'disposition',_0xb323('0x12'),_0xb323('0x13')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xdd73=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf'];(function(_0x1d2935,_0x352b63){var _0x4a4d73=function(_0x151c9c){while(--_0x151c9c){_0x1d2935['push'](_0x1d2935['shift']());}};_0x4a4d73(++_0x352b63);}(_0xdd73,0x9f));var _0x3dd7=function(_0xa72a90,_0x3d2ff5){_0xa72a90=_0xa72a90-0x0;var _0x264a45=_0xdd73[_0xa72a90];return _0x264a45;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x3dd7('0x0'));var client=require('../client');exports[_0x3dd7('0x1')]=function(_0x12e647){return client[_0x3dd7('0x2')](_0x3dd7('0x3'),{'body':_[_0x3dd7('0x4')](_0x12e647,{'source':_0x12e647[_0x3dd7('0x5')],'destinationcontext':_0x12e647[_0x3dd7('0x6')],'callerid':_0x12e647[_0x3dd7('0x7')],'amaflags':_0x3dd7('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x3dd7('0x9')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x3dd7('0xa')],'createdAt':{'$between':[moment()[_0x3dd7('0xb')](_0x3dd7('0xc'))[_0x3dd7('0xd')](_0x3dd7('0xe')),moment()[_0x3dd7('0xf')](_0x3dd7('0xc'))[_0x3dd7('0xd')](_0x3dd7('0xe'))]}},'attributes':[_0x3dd7('0x10'),'disposition',_0x3dd7('0x11'),'billableseconds']},'log':_0x3dd7('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 91cfbcf..ce0fcc3 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 _0x622b=['CreateVoiceDialReport','../client','Request'];(function(_0xe40a76,_0x2086e3){var _0x2632ec=function(_0x432882){while(--_0x432882){_0xe40a76['push'](_0xe40a76['shift']());}};_0x2632ec(++_0x2086e3);}(_0x622b,0x106));var _0xb622=function(_0x2c065a,_0x44e071){_0x2c065a=_0x2c065a-0x0;var _0x16dcf0=_0x622b[_0x2c065a];return _0x16dcf0;};'use strict';var client=require(_0xb622('0x0'));exports['create']=function(_0x5b2960){return client[_0xb622('0x1')](_0xb622('0x2'),{'body':_0x5b2960,'log':_0xb622('0x2')});}; \ No newline at end of file +var _0x9f41=['CreateVoiceDialReport','create','Request'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9f41,0xa6));var _0x19f4=function(_0xf94131,_0x58b63d){_0xf94131=_0xf94131-0x0;var _0xdf5c19=_0x9f41[_0xf94131];return _0xdf5c19;};'use strict';var client=require('../client');exports[_0x19f4('0x0')]=function(_0x180147){return client[_0x19f4('0x1')]('CreateVoiceDialReport',{'body':_0x180147,'log':_0x19f4('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5d01e59..9dcf4c0 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 _0xaf4c=['recordingFormat','getVoiceExtensions','Request','exten'];(function(_0x45bda8,_0x1dcede){var _0x267dde=function(_0x477787){while(--_0x477787){_0x45bda8['push'](_0x45bda8['shift']());}};_0x267dde(++_0x1dcede);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x33ff33,_0x18236e){_0x33ff33=_0x33ff33-0x0;var _0x516d92=_0xaf4c[_0x33ff33];return _0x516d92;};'use strict';var client=require('../client');exports[_0xcaf4('0x0')]=function(){return function(){return client[_0xcaf4('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xcaf4('0x2'),_0xcaf4('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xcaf4('0x0')});};}; \ No newline at end of file +var _0xd547=['recordingFormat','Request','GetVoiceExtension','exten'];(function(_0x2919d5,_0x2e050a){var _0x315e94=function(_0x31b33d){while(--_0x31b33d){_0x2919d5['push'](_0x2919d5['shift']());}};_0x315e94(++_0x2e050a);}(_0xd547,0x1c1));var _0x7d54=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0xd547[_0x2adfb1];return _0xa52d45;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x7d54('0x0')](_0x7d54('0x1'),{'options':{'raw':!![],'attributes':['id',_0x7d54('0x2'),_0x7d54('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index d80e642..15d0946 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 _0x7d45=['dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','dialActive','dialMethod','dialLimitChannel','dialLimitQueue'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x7d45,0x7e));var _0x57d4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7d45[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports[_0x57d4('0x0')]=function(){return function(){return client[_0x57d4('0x1')](_0x57d4('0x2'),{'options':{'raw':![],'attributes':['id',_0x57d4('0x3'),'acw',_0x57d4('0x4'),_0x57d4('0x5'),'monitor_format','type',_0x57d4('0x6'),_0x57d4('0x7'),_0x57d4('0x8'),_0x57d4('0x9'),_0x57d4('0xa'),_0x57d4('0xb'),_0x57d4('0xc'),_0x57d4('0xd'),_0x57d4('0xe'),_0x57d4('0xf'),_0x57d4('0x10'),_0x57d4('0x11'),_0x57d4('0x12'),_0x57d4('0x13'),_0x57d4('0x14'),_0x57d4('0x15'),_0x57d4('0x16'),_0x57d4('0x17'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x57d4('0x18'),_0x57d4('0x19'),_0x57d4('0x1a'),_0x57d4('0x1b'),_0x57d4('0x1c'),_0x57d4('0x1d'),'dialAMDInitialSilence',_0x57d4('0x1e'),_0x57d4('0x1f'),_0x57d4('0x20'),_0x57d4('0x21'),_0x57d4('0x22'),_0x57d4('0x23'),_0x57d4('0x24'),_0x57d4('0x25'),_0x57d4('0x26'),_0x57d4('0x27'),_0x57d4('0x28'),_0x57d4('0x29'),_0x57d4('0x2a'),_0x57d4('0x2b'),_0x57d4('0x2c'),_0x57d4('0x2d'),_0x57d4('0x2e'),_0x57d4('0x2f'),'dialCutDigit',_0x57d4('0x30'),_0x57d4('0x31'),_0x57d4('0x32'),_0x57d4('0x33'),_0x57d4('0x34'),_0x57d4('0x35'),_0x57d4('0x36'),_0x57d4('0x37'),'dialAgentRejectMaxRetry',_0x57d4('0x38'),_0x57d4('0x39'),_0x57d4('0x3a'),_0x57d4('0x3b'),'dialPreviewAutoRecallMe',_0x57d4('0x3c'),'callAdditionalPhoneAfterMin'],'include':[{'model':'Trunk','as':_0x57d4('0x3d'),'attributes':['id','name',_0x57d4('0x3e'),_0x57d4('0x3f')]},{'model':'Pause','as':_0x57d4('0x40'),'attributes':['id','name']},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x57d4('0x3'),_0x57d4('0x3e'),_0x57d4('0x3f')]},{'model':_0x57d4('0x41'),'as':_0x57d4('0x41'),'attributes':['id',_0x57d4('0x3')],'include':[{'model':_0x57d4('0x41'),'as':_0x57d4('0x42'),'attributes':['id',_0x57d4('0x3'),_0x57d4('0x43')]}]}]},'log':_0x57d4('0x0')});};}; \ No newline at end of file +var _0xa0c7=['dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','active','mandatoryDispositionPause','callerid','Interval','getVoiceQueues','Request','name','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x5c883f,_0x38f092){var _0x4210cc=function(_0x51be71){while(--_0x51be71){_0x5c883f['push'](_0x5c883f['shift']());}};_0x4210cc(++_0x38f092);}(_0xa0c7,0x175));var _0x7a0c=function(_0xf404b2,_0x53a38e){_0xf404b2=_0xf404b2-0x0;var _0x581e88=_0xa0c7[_0xf404b2];return _0x581e88;};'use strict';var client=require('../client');exports[_0x7a0c('0x0')]=function(){return function(){return client[_0x7a0c('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x7a0c('0x2'),'acw','acwTimeout',_0x7a0c('0x3'),_0x7a0c('0x4'),'type',_0x7a0c('0x5'),_0x7a0c('0x6'),_0x7a0c('0x7'),'dialLimitQueue',_0x7a0c('0x8'),_0x7a0c('0x9'),_0x7a0c('0xa'),_0x7a0c('0xb'),_0x7a0c('0xc'),'dialOriginateCallerIdNumber',_0x7a0c('0xd'),_0x7a0c('0xe'),_0x7a0c('0xf'),_0x7a0c('0x10'),'dialCongestionMaxRetry',_0x7a0c('0x11'),_0x7a0c('0x12'),_0x7a0c('0x13'),'dialNoAnswerMaxRetry',_0x7a0c('0x14'),_0x7a0c('0x15'),_0x7a0c('0x16'),'dialGlobalInterval','dialPrefix',_0x7a0c('0x17'),_0x7a0c('0x18'),'dialAMDInitialSilence','dialAMDGreeting',_0x7a0c('0x19'),_0x7a0c('0x1a'),_0x7a0c('0x1b'),_0x7a0c('0x1c'),_0x7a0c('0x1d'),_0x7a0c('0x1e'),_0x7a0c('0x1f'),_0x7a0c('0x20'),_0x7a0c('0x21'),_0x7a0c('0x22'),_0x7a0c('0x23'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x7a0c('0x24'),_0x7a0c('0x4'),'strategy',_0x7a0c('0x25'),_0x7a0c('0x26'),'dialNoSuchNumberMaxRetry',_0x7a0c('0x27'),_0x7a0c('0x28'),'dialDropRetryFrequency',_0x7a0c('0x29'),_0x7a0c('0x2a'),'dialMachineMaxRetry',_0x7a0c('0x2b'),_0x7a0c('0x2c'),_0x7a0c('0x2d'),_0x7a0c('0x2e'),_0x7a0c('0x2f'),'dialPredictiveIntervalMinThreshold',_0x7a0c('0x30'),'dialPreviewRecallmeReminder',_0x7a0c('0x31')],'include':[{'model':_0x7a0c('0x32'),'as':_0x7a0c('0x32'),'attributes':['id',_0x7a0c('0x2'),'callerid',_0x7a0c('0x33')]},{'model':'Pause','as':_0x7a0c('0x34'),'attributes':['id',_0x7a0c('0x2')]},{'model':_0x7a0c('0x32'),'as':'TrunkBackup','attributes':['id',_0x7a0c('0x2'),_0x7a0c('0x35'),'active']},{'model':_0x7a0c('0x36'),'as':_0x7a0c('0x36'),'attributes':['id',_0x7a0c('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x7a0c('0x2'),'interval']}]}]},'log':_0x7a0c('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 8d0a1b7..79a71ed 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 _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x732588,_0x3bdf2c){var _0x2c0d67=function(_0x5a77dd){while(--_0x5a77dd){_0x732588['push'](_0x732588['shift']());}};_0x2c0d67(++_0x3bdf2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x46d66d,_0x5988b2){var _0x5b7028=function(_0x67a1b1){while(--_0x67a1b1){_0x46d66d['push'](_0x46d66d['shift']());}};_0x5b7028(++_0x5988b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 8e39e74..288103b 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 _0x9109=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x3d2735,_0x4bd6a4){var _0x2b09e5=function(_0x35c872){while(--_0x35c872){_0x3d2735['push'](_0x3d2735['shift']());}};_0x2b09e5(++_0x4bd6a4);}(_0x9109,0x7b));var _0x9910=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x9109[_0x1df7b8];return _0x29d911;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x472a76){return function(){return client[_0x9910('0x0')](_0x9910('0x1'),{'options':{'where':{'VoiceQueueId':_0x472a76,'paused':!![]},'raw':!![]},'log':_0x9910('0x2')});};}; \ No newline at end of file +var _0x47e5=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x2797be,_0x5934f4){var _0x211244=function(_0x230268){while(--_0x230268){_0x2797be['push'](_0x2797be['shift']());}};_0x211244(++_0x5934f4);}(_0x47e5,0x86));var _0x547e=function(_0x358bf3,_0x40ec1f){_0x358bf3=_0x358bf3-0x0;var _0x248106=_0x47e5[_0x358bf3];return _0x248106;};'use strict';var client=require(_0x547e('0x0'));exports[_0x547e('0x1')]=function(_0x308c4e){return function(){return client[_0x547e('0x2')](_0x547e('0x3'),{'options':{'where':{'VoiceQueueId':_0x308c4e,'paused':!![]},'raw':!![]},'log':_0x547e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d7bed38..56d856f 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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2f60f3,_0x43afee){var _0x39671b=function(_0x43edaa){while(--_0x43edaa){_0x2f60f3['push'](_0x2f60f3['shift']());}};_0x39671b(++_0x43afee);}(_0x7a54,0x106));var _0x47a5=function(_0x47d971,_0x4107d5){_0x47d971=_0x47d971-0x0;var _0x44f265=_0x7a54[_0x47d971];return _0x44f265;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x7230f3,_0x4a25fe){var _0x4740ad=function(_0x54734a){while(--_0x54734a){_0x7230f3['push'](_0x7230f3['shift']());}};_0x4740ad(++_0x4a25fe);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index ba061ff..1b30215 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 _0x2aa3=['secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext'];(function(_0x51ba4e,_0x191c9d){var _0x3962f4=function(_0x9f8174){while(--_0x9f8174){_0x51ba4e['push'](_0x51ba4e['shift']());}};_0x3962f4(++_0x191c9d);}(_0x2aa3,0x142));var _0x32aa=function(_0x3d9d87,_0x1c4962){_0x3d9d87=_0x3d9d87-0x0;var _0x1639f6=_0x2aa3[_0x3d9d87];return _0x1639f6;};'use strict';var client=require(_0x32aa('0x0'));exports[_0x32aa('0x1')]={};exports[_0x32aa('0x2')]=function(_0x37a326){return client[_0x32aa('0x3')](_0x32aa('0x4'),{'body':{'result':_0x37a326[_0x32aa('0x5')],'transfererchannel':_0x37a326[_0x32aa('0x6')],'transferercalleridnum':_0x37a326[_0x32aa('0x7')],'transferercalleridname':_0x37a326[_0x32aa('0x8')],'transfererconnectedlinenum':_0x37a326[_0x32aa('0x9')],'transfererconnectedlinename':_0x37a326[_0x32aa('0xa')],'transfereraccountcode':_0x37a326['transfereraccountcode'],'transferercontext':_0x37a326[_0x32aa('0xb')],'transfererexten':_0x37a326[_0x32aa('0xc')],'transfererlinkedid':_0x37a326[_0x32aa('0xd')],'transfereechannel':_0x37a326['transfereechannel'],'transfereecalleridnum':_0x37a326['transfereecalleridnum'],'transfereecalleridname':_0x37a326[_0x32aa('0xe')],'transfereeconnectedlinenum':_0x37a326['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x37a326[_0x32aa('0xf')],'transfereeaccountcode':_0x37a326[_0x32aa('0x10')],'transfereecontext':_0x37a326[_0x32aa('0x11')],'transfereeexten':_0x37a326[_0x32aa('0x12')],'transfereelinkedid':_0x37a326['transfereelinkedid'],'isexternal':_0x37a326[_0x32aa('0x13')],'context':_0x37a326[_0x32aa('0x14')],'extension':_0x37a326[_0x32aa('0x15')],'type':_0x32aa('0x16')},'log':_0x32aa('0x4')});};exports[_0x32aa('0x17')]=function(_0x583fc0){return client['Request'](_0x32aa('0x4'),{'body':{'result':_0x583fc0[_0x32aa('0x5')],'transfererchannel':_0x583fc0[_0x32aa('0x18')],'transferercalleridnum':_0x583fc0['origtransferercalleridnum'],'transferercalleridname':_0x583fc0['origtransferercalleridname'],'transfererconnectedlinenum':_0x583fc0[_0x32aa('0x19')],'transfererconnectedlinename':_0x583fc0[_0x32aa('0x1a')],'transfereraccountcode':_0x583fc0[_0x32aa('0x1b')],'transferercontext':_0x583fc0[_0x32aa('0x1c')],'transfererexten':_0x583fc0[_0x32aa('0x1d')],'transfererlinkedid':_0x583fc0[_0x32aa('0x1e')],'transfereechannel':_0x583fc0['transfertargetchannel'],'transfereecalleridnum':_0x583fc0['transfertargetcalleridnum'],'transfereecalleridname':_0x583fc0[_0x32aa('0x1f')],'transfereeconnectedlinenum':_0x583fc0['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x583fc0[_0x32aa('0x20')],'transfereeaccountcode':_0x583fc0[_0x32aa('0x21')],'transfereecontext':_0x583fc0[_0x32aa('0x22')],'transfereeexten':_0x583fc0['transfertargetexten'],'transfereelinkedid':_0x583fc0[_0x32aa('0x23')],'isexternal':_0x583fc0['isexternal'],'context':_0x583fc0[_0x32aa('0x24')],'extension':_0x583fc0[_0x32aa('0x25')],'type':_0x32aa('0x26')},'log':_0x32aa('0x4')});}; \ No newline at end of file +var _0x5fcd=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetlinkedid','attended','../client','transfers','blindTransfer','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','CreateVoiceTransferReport','Request','result','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid'];(function(_0x12571a,_0x32a867){var _0x1907cb=function(_0x1e7f40){while(--_0x1e7f40){_0x12571a['push'](_0x12571a['shift']());}};_0x1907cb(++_0x32a867);}(_0x5fcd,0xb1));var _0xd5fc=function(_0x128c6f,_0x1000ca){_0x128c6f=_0x128c6f-0x0;var _0x2210ac=_0x5fcd[_0x128c6f];return _0x2210ac;};'use strict';var client=require(_0xd5fc('0x0'));exports[_0xd5fc('0x1')]={};exports[_0xd5fc('0x2')]=function(_0x18f3b7){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x18f3b7['result'],'transfererchannel':_0x18f3b7['transfererchannel'],'transferercalleridnum':_0x18f3b7[_0xd5fc('0x3')],'transferercalleridname':_0x18f3b7[_0xd5fc('0x4')],'transfererconnectedlinenum':_0x18f3b7[_0xd5fc('0x5')],'transfererconnectedlinename':_0x18f3b7[_0xd5fc('0x6')],'transfereraccountcode':_0x18f3b7[_0xd5fc('0x7')],'transferercontext':_0x18f3b7['transferercontext'],'transfererexten':_0x18f3b7['transfererexten'],'transfererlinkedid':_0x18f3b7[_0xd5fc('0x8')],'transfereechannel':_0x18f3b7[_0xd5fc('0x9')],'transfereecalleridnum':_0x18f3b7['transfereecalleridnum'],'transfereecalleridname':_0x18f3b7[_0xd5fc('0xa')],'transfereeconnectedlinenum':_0x18f3b7[_0xd5fc('0xb')],'transfereeconnectedlinename':_0x18f3b7['transfereeconnectedlinename'],'transfereeaccountcode':_0x18f3b7[_0xd5fc('0xc')],'transfereecontext':_0x18f3b7[_0xd5fc('0xd')],'transfereeexten':_0x18f3b7[_0xd5fc('0xe')],'transfereelinkedid':_0x18f3b7[_0xd5fc('0xf')],'isexternal':_0x18f3b7[_0xd5fc('0x10')],'context':_0x18f3b7[_0xd5fc('0x11')],'extension':_0x18f3b7[_0xd5fc('0x12')],'type':'blind'},'log':_0xd5fc('0x13')});};exports['attendedTransfer']=function(_0x319fae){return client[_0xd5fc('0x14')](_0xd5fc('0x13'),{'body':{'result':_0x319fae[_0xd5fc('0x15')],'transfererchannel':_0x319fae[_0xd5fc('0x16')],'transferercalleridnum':_0x319fae['origtransferercalleridnum'],'transferercalleridname':_0x319fae[_0xd5fc('0x17')],'transfererconnectedlinenum':_0x319fae['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x319fae[_0xd5fc('0x18')],'transfereraccountcode':_0x319fae['origtransfereraccountcode'],'transferercontext':_0x319fae[_0xd5fc('0x19')],'transfererexten':_0x319fae['secondtransfererexten'],'transfererlinkedid':_0x319fae[_0xd5fc('0x1a')],'transfereechannel':_0x319fae[_0xd5fc('0x1b')],'transfereecalleridnum':_0x319fae[_0xd5fc('0x1c')],'transfereecalleridname':_0x319fae[_0xd5fc('0x1d')],'transfereeconnectedlinenum':_0x319fae[_0xd5fc('0x1e')],'transfereeconnectedlinename':_0x319fae['transfertargetconnectedlinename'],'transfereeaccountcode':_0x319fae[_0xd5fc('0x1f')],'transfereecontext':_0x319fae['transfertargetcontext'],'transfereeexten':_0x319fae['transfertargetexten'],'transfereelinkedid':_0x319fae[_0xd5fc('0x20')],'isexternal':_0x319fae[_0xd5fc('0x10')],'context':_0x319fae['origtransferercontext'],'extension':_0x319fae['origtransfererexten'],'type':_0xd5fc('0x21')},'log':_0xd5fc('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index f70bbb9..95c79fe 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 _0x0647=['outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','undefined','values','channels','voicechannel','find','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','isNil','push','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','map','resolve','StopMixMonitor','destinationchannel','monitors','wav','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','send','checkAfterSend','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../../../config/environment','../properties','format','%s/%s','name','timers','timer','agents','updateStatusRealtime','pause','isConnected','error','asterisk','pick','keys','module','Reload','Action','message','catch','username','ami\x20disconnected','join','action','then','content','voiceQueues','hasOwnProperty','strategy','answered','available','sumHoldTime','total','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0647,0xd0));var _0x7064=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x0647[_0x34a8c8];return _0x1fe6e5;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var jayson=require(_0x7064('0x1'));var schema=require(_0x7064('0x2'));var moment=require(_0x7064('0x3'));var config=require(_0x7064('0x4'));var properties=require(_0x7064('0x5'));var ami=require('../ami');exports['listen']=function(_0x313dce,_0x34b4d5,_0x31f6a6){return new Promise(function(_0x44b1bb,_0x2b6f9b){var _0x1101e4={'QueuePause':function(_0x58186b){return new Promise(function(_0x536336){var _0x1c85b1=util[_0x7064('0x6')](_0x7064('0x7'),'SIP',_0x58186b[_0x7064('0x8')]);if(_0x313dce[_0x7064('0x9')]&&_0x313dce['timers'][_0x1c85b1]&&_0x313dce[_0x7064('0x9')][_0x1c85b1][_0x7064('0xa')]){_0x313dce[_0x7064('0x9')][_0x1c85b1]['updateAcw']();}if(_0x313dce[_0x7064('0xb')][_0x1c85b1]){_0x313dce[_0x7064('0xb')][_0x1c85b1][_0x7064('0xc')]({'statePause':_0x58186b[_0x7064('0xd')]?!![]:![]});}_0x536336({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x303dcd){var _0x4151b6=this;return new Promise(function(_0x268a94,_0x44dcbe){if(ami[_0x7064('0xe')]()==![]){return _0x44dcbe(_0x4151b6[_0x7064('0xf')](0x1f4,[config[_0x7064('0x10')]['ip'],config[_0x7064('0x10')]['username'],'ami\x20disconnected']['join']('\x20')));}_0x303dcd=_[_0x7064('0x11')](_0x303dcd,_[_0x7064('0x12')](properties[_0x7064('0x13')]));_0x303dcd['action']=_0x7064('0x14');return ami[_0x7064('0x15')](_0x303dcd)['then'](function(_0x21418e){_0x268a94({'code':0xc8,'message':_0x21418e[_0x7064('0x16')]});})[_0x7064('0x17')](function(_0x203633){_0x44dcbe(_0x4151b6[_0x7064('0xf')](0x1f5,_0x203633[_0x7064('0x16')]));});});},'Command':function(_0x3f3695){var _0x3e8d73=this;return new Promise(function(_0x2779fd,_0x19b456){if(ami[_0x7064('0xe')]()==![]){return _0x19b456(_0x3e8d73[_0x7064('0xf')](0x1f4,[config[_0x7064('0x10')]['ip'],config['asterisk'][_0x7064('0x18')],_0x7064('0x19')][_0x7064('0x1a')]('\x20')));}_0x3f3695=_[_0x7064('0x11')](_0x3f3695,'command');_0x3f3695[_0x7064('0x1b')]='Command';return ami[_0x7064('0x15')](_0x3f3695)[_0x7064('0x1c')](function(_0x4ace22){_0x2779fd({'code':0xc8,'message':_0x4ace22[_0x7064('0x1d')]});})[_0x7064('0x17')](function(_0x1a62a2){_0x19b456(_0x3e8d73[_0x7064('0xf')](0x1f5,_0x1a62a2[_0x7064('0x16')]));});});},'VoiceQueues':function(){return new Promise(function(_0x54817c){var _0x4dbf02=[];for(var _0x33f470 in _0x313dce['voiceQueues']){if(_0x313dce[_0x7064('0x1e')][_0x7064('0x1f')](_0x33f470)){var _0x25d627=_0x313dce['voiceQueues'][_0x33f470];var _0x2749a6={'id':_0x25d627['id'],'name':_0x25d627[_0x7064('0x8')],'strategy':_0x25d627[_0x7064('0x20')],'answered':_0x25d627[_0x7064('0x21')],'available':_0x25d627[_0x7064('0x22')],'loggedIn':_0x25d627['loggedIn'],'pTalking':_0x25d627['pTalking'],'sumBillable':_0x25d627['sumBillable'],'sumDuration':_0x25d627['sumDuration'],'sumHoldTime':_0x25d627[_0x7064('0x23')]||0x0,'talking':_0x25d627['talking'],'total':_0x25d627[_0x7064('0x24')],'type':_0x25d627[_0x7064('0x25')],'unmanaged':_0x25d627['unmanaged'],'abandoned':_0x25d627[_0x7064('0x26')],'waiting':_0x25d627[_0x7064('0x27')],'loggedInDb':_0x25d627[_0x7064('0x28')]};if(_0x25d627[_0x7064('0x25')]===_0x7064('0x29')){_0x2749a6['dialActive']=_0x25d627[_0x7064('0x2a')];_0x2749a6[_0x7064('0x2b')]=_0x25d627[_0x7064('0x2b')];_0x2749a6[_0x7064('0x2c')]=_0x25d627['dialOriginateCallerIdName'];_0x2749a6['dialOriginateCallerIdNumber']=_0x25d627['dialOriginateCallerIdNumber'];_0x2749a6[_0x7064('0x2d')]=_0x25d627['dialOriginateTimeout'];_0x2749a6[_0x7064('0x2e')]=_0x25d627[_0x7064('0x2e')];_0x2749a6['temp']=_0x25d627[_0x7064('0x2f')];_0x2749a6[_0x7064('0x30')]=_0x25d627[_0x7064('0x30')];_0x2749a6[_0x7064('0x31')]=_0x25d627['outboundAnswerCallsDay'];_0x2749a6['outboundBlacklistCallsDay']=_0x25d627[_0x7064('0x32')];_0x2749a6['outboundBusyCallsDay']=_0x25d627[_0x7064('0x33')];_0x2749a6[_0x7064('0x34')]=_0x25d627[_0x7064('0x34')];_0x2749a6['outboundDropCallsDayACS']=_0x25d627[_0x7064('0x35')];_0x2749a6[_0x7064('0x36')]=_0x25d627[_0x7064('0x36')];_0x2749a6[_0x7064('0x37')]=_0x25d627['outboundDropCallsDayTimeout'];_0x2749a6['outboundNoAnswerCallsDay']=_0x25d627[_0x7064('0x38')];_0x2749a6[_0x7064('0x39')]=_0x25d627['outboundNoSuchCallsDay'];_0x2749a6[_0x7064('0x3a')]=_0x25d627[_0x7064('0x3a')];_0x2749a6[_0x7064('0x3b')]=_0x25d627[_0x7064('0x3b')];_0x2749a6[_0x7064('0x3c')]=_0x25d627[_0x7064('0x3c')];_0x2749a6[_0x7064('0x3d')]=_0x25d627[_0x7064('0x3d')];_0x2749a6[_0x7064('0x3e')]=_0x25d627[_0x7064('0x3e')];_0x2749a6[_0x7064('0x3f')]=_0x25d627['predictiveIntervalAvgHoldtime'];_0x2749a6[_0x7064('0x40')]=_0x25d627[_0x7064('0x40')];_0x2749a6[_0x7064('0x41')]=_0x25d627[_0x7064('0x41')];_0x2749a6[_0x7064('0x42')]=_0x25d627['predictiveIntervalDroppedCallsTimeout'];_0x2749a6[_0x7064('0x43')]=_0x25d627[_0x7064('0x43')];_0x2749a6[_0x7064('0x44')]=_0x25d627[_0x7064('0x44')];_0x2749a6[_0x7064('0x45')]=_0x25d627[_0x7064('0x45')];_0x2749a6['predictiveIntervalMultiplicativeFactor']=_0x25d627[_0x7064('0x46')];_0x2749a6[_0x7064('0x47')]=_0x25d627['predictiveIntervalPauses'];_0x2749a6[_0x7064('0x48')]=_0x25d627[_0x7064('0x48')];_0x2749a6[_0x7064('0x49')]=_0x25d627[_0x7064('0x49')];_0x2749a6[_0x7064('0x16')]=_0x25d627[_0x7064('0x16')];_0x2749a6[_0x7064('0x4a')]=_0x25d627[_0x7064('0x4a')];_0x2749a6[_0x7064('0x4b')]=_0x25d627[_0x7064('0x4b')];_0x2749a6[_0x7064('0x4c')]=_0x25d627[_0x7064('0x4c')];_0x2749a6[_0x7064('0x4d')]=_0x25d627['erlangAbandonmentRate'];_0x2749a6[_0x7064('0x4e')]=_0x25d627[_0x7064('0x4e')];_0x2749a6['startPredictive']=_0x25d627[_0x7064('0x4f')];_0x2749a6[_0x7064('0x50')]=_0x25d627[_0x7064('0x50')];}if(_0x25d627[_0x7064('0x51')]){_0x2749a6[_0x7064('0x51')]={'id':_0x25d627[_0x7064('0x51')]['id'],'name':_0x25d627['Trunk']['name'],'active':_0x25d627[_0x7064('0x51')][_0x7064('0x52')],'callerid':_0x25d627['Trunk'][_0x7064('0x53')]};}if(_0x25d627[_0x7064('0x54')]){_0x2749a6['Interval']={'id':_0x25d627[_0x7064('0x54')]['id'],'name':_0x25d627['Interval']['name']};}_0x4dbf02['push'](_0x2749a6);}}_0x54817c({'count':_0x4dbf02[_0x7064('0x55')],'rows':_0x4dbf02});});},'UpdateVoiceQueue':function(_0x47781e){return new Promise(function(_0x59cc5e,_0x46f07c){var _0x202de2=_['find'](_0x313dce[_0x7064('0x1e')],{'id':parseInt(_0x47781e['id'])});var _0x372b95=_['omit'](_0x47781e,['id']);if(_0x202de2){for(var _0x7efe1c in _0x372b95){if(typeof _0x372b95[_0x7efe1c]!==_0x7064('0x56')&&typeof _0x202de2[_0x7efe1c]!==_0x7064('0x56')){_0x202de2[_0x7efe1c]=_0x372b95[_0x7efe1c];}}_0x59cc5e(_0x202de2);}else{_0x46f07c();}});},'VoiceChannels':function(){return new Promise(function(_0x5483d2){var _0x57b568=_[_0x7064('0x57')](_0x313dce[_0x7064('0x58')]);_0x5483d2({'count':_0x57b568[_0x7064('0x55')],'rows':_0x57b568});});},'VoiceChannelMixMonitor':function(_0xf77b74){var _0x3bb575=this;return new Promise(function(_0x1f2281,_0x379aa0){if(ami['isConnected']()==![]){return _0x379aa0(_0x3bb575['error'](0x1f4,[config[_0x7064('0x10')]['ip'],config[_0x7064('0x10')][_0x7064('0x18')],_0x7064('0x19')][_0x7064('0x1a')]('\x20')));}var _0x56fda1=schema(properties[_0x7064('0x59')])['validate'](_0xf77b74);if(_0x56fda1['length']>0x0){return _0x379aa0(_0x3bb575['error'](0x1f4,_['map'](_0x56fda1,'message')['join'](',\x20')));}var _0x4e4759=_[_0x7064('0x5a')](_0x313dce['channels'],{'uniqueid':_0xf77b74[_0x7064('0x5b')]});if(_0x4e4759&&_0x4e4759[_0x7064('0x5c')]){var _0xfa02c0=util[_0x7064('0x6')](_0x7064('0x5d'),_0xf77b74[_0x7064('0x5e')]||_0xf77b74['uniqueid'],_0xf77b74['format']||'wav');return ami[_0x7064('0x15')]({'action':_0x7064('0x5f'),'channel':_0x4e4759['channel'],'file':_0xfa02c0,'options':_0x7064('0x60')})[_0x7064('0x1c')](function(_0x485c30){var _0x425e31=_[_0x7064('0x5a')](_0x4e4759['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0xfa02c0['toLowerCase']()});if(_[_0x7064('0x61')](_0x425e31)){_0x4e4759['monitors'][_0x7064('0x62')]({'filename':_0x7064('0x63')+_0xfa02c0[_0x7064('0x64')](),'createdAt':moment()[_0x7064('0x6')](_0x7064('0x65')),'mixmonitorid':_0x485c30['mixmonitorid'],'status':'rec'});}else{_0x425e31[_0x7064('0x66')]=_0x485c30['mixmonitorid'];_0x425e31[_0x7064('0x67')]=_0x7064('0x68');}_0x1f2281({'code':0xc8,'message':[_0xf77b74[_0x7064('0x5b')],_0x7064('0x69'),_0x485c30[_0x7064('0x66')]][_0x7064('0x1a')]('\x20'),'mixmonitorid':_0x485c30['mixmonitorid']});})['catch'](function(_0xf94918){_0x379aa0(_0x3bb575[_0x7064('0xf')](0x1f5,[_0xf77b74[_0x7064('0x5b')],_0xf94918[_0x7064('0x16')][_0x7064('0x64')]()][_0x7064('0x1a')]('\x20')));});}else{return _0x379aa0(_0x3bb575[_0x7064('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x241a24){var _0x5f251b=this;return new Promise(function(_0x135286,_0x25ab08){if(ami['isConnected']()==![]){return _0x25ab08(_0x5f251b[_0x7064('0xf')](0x1f4,[config[_0x7064('0x10')]['ip'],config[_0x7064('0x10')][_0x7064('0x18')],_0x7064('0x19')][_0x7064('0x1a')]('\x20')));}var _0x4fd648=schema(properties[_0x7064('0x59')])[_0x7064('0x2')](_0x241a24);if(_0x4fd648['length']>0x0){return _0x25ab08(_0x5f251b[_0x7064('0xf')](0x1f4,_[_0x7064('0x6a')](_0x4fd648,_0x7064('0x16'))['join'](',\x20')));}var _0x51ec1e=_[_0x7064('0x5a')](_0x313dce['channels'],{'uniqueid':_0x241a24['uniqueid']});if(_0x51ec1e){return Promise[_0x7064('0x6b')]()['then'](function(){if(_0x51ec1e[_0x7064('0x5c')]){return ami[_0x7064('0x15')]({'action':_0x7064('0x6c'),'channel':_0x51ec1e[_0x7064('0x5c')],'mixmonitorid':_0x241a24[_0x7064('0x66')]})['catch'](function(){});}})['then'](function(){if(_0x51ec1e[_0x7064('0x6d')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x51ec1e[_0x7064('0x6d')],'mixmonitorid':_0x241a24[_0x7064('0x66')]})[_0x7064('0x17')](function(){});}})[_0x7064('0x1c')](function(){var _0x2e55a5=_[_0x7064('0x5a')](_0x51ec1e[_0x7064('0x6e')],{'mixmonitorid':_0x241a24[_0x7064('0x66')]});if(_0x2e55a5){_0x2e55a5[_0x7064('0x67')]='stop';}})['then'](function(){var _0xf9ceda=util[_0x7064('0x6')](_0x7064('0x5d'),_0x241a24[_0x7064('0x5e')]||_0x241a24['uniqueid'],_0x241a24['format']||_0x7064('0x6f'));var _0x1457f7=_[_0x7064('0x5a')](_0x51ec1e[_0x7064('0x6e')],{'filename':'/var/spool/asterisk/monitor/'+_0xf9ceda[_0x7064('0x64')]()});if(_0x1457f7){_0x1457f7[_0x7064('0x67')]=_0x7064('0x70');}})[_0x7064('0x1c')](function(){_0x135286({'code':0xc8,'message':[_0x241a24[_0x7064('0x5b')],_0x7064('0x71')][_0x7064('0x1a')]('\x20')});})[_0x7064('0x17')](function(_0x5ec835){_0x25ab08(_0x5f251b[_0x7064('0xf')](0x1f5,[_0x241a24[_0x7064('0x5b')],_0x5ec835[_0x7064('0x16')][_0x7064('0x64')]()][_0x7064('0x1a')]('\x20')));});}else{return _0x25ab08(_0x5f251b[_0x7064('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0xfa409d){var _0xf94d89=_[_0x7064('0x57')](_0x313dce[_0x7064('0x72')]);_0xfa409d({'count':_0xf94d89['length'],'rows':_0xf94d89});});},'VoiceQueuesChannel':function(_0x158a10){var _0x4d194a=this;return new Promise(function(_0x32f9d6,_0x551b41){var _0x80e6ca=schema(properties[_0x7064('0x73')])[_0x7064('0x2')](_0x158a10);if(_0x80e6ca[_0x7064('0x55')]>0x0){return _0x551b41(_0x4d194a[_0x7064('0xf')](0x1f4,_['map'](_0x80e6ca,_0x7064('0x16'))[_0x7064('0x1a')](',\x20')));}var _0x3ea8ea=_['find'](_0x313dce[_0x7064('0x72')],{'uniqueid':_0x158a10[_0x7064('0x5b')]});if(_0x3ea8ea){_0x32f9d6(_0x3ea8ea);}else{return _0x551b41(_0x4d194a[_0x7064('0xf')](0x1f5,_0x7064('0x74')));}});},'VoiceQueuesChannelHangup':function(_0x30734a){var _0x13304c=this;return new Promise(function(_0x41b1c4,_0x50f527){if(ami['isConnected']()==![]){return _0x50f527(_0x13304c[_0x7064('0xf')](0x1f4,[config[_0x7064('0x10')]['ip'],config[_0x7064('0x10')][_0x7064('0x18')],_0x7064('0x19')][_0x7064('0x1a')]('\x20')));}var _0x1fe9f7=schema(properties[_0x7064('0x75')])['validate'](_0x30734a);if(_0x1fe9f7[_0x7064('0x55')]>0x0){return _0x50f527(_0x13304c['error'](0x1f4,_[_0x7064('0x6a')](_0x1fe9f7,_0x7064('0x16'))[_0x7064('0x1a')](',\x20')));}var _0x24ce41=_[_0x7064('0x5a')](_0x313dce[_0x7064('0x72')],{'uniqueid':_0x30734a['uniqueid']});if(_0x24ce41&&_0x24ce41[_0x7064('0x5c')]){return ami[_0x7064('0x15')]({'action':_0x7064('0x76'),'channel':_0x24ce41['channel']})[_0x7064('0x1c')](function(_0x249f84){_0x41b1c4({'code':0xc8,'message':[_0x30734a['uniqueid'],_0x249f84[_0x7064('0x16')][_0x7064('0x64')]()][_0x7064('0x1a')]('\x20')});})[_0x7064('0x17')](function(_0x189f38){_0x50f527(_0x13304c[_0x7064('0xf')](0x1f5,[_0x30734a[_0x7064('0x5b')],_0x189f38[_0x7064('0x16')][_0x7064('0x64')]()][_0x7064('0x1a')]('\x20')));});}else{return _0x50f527(_0x13304c[_0x7064('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x53fad1){var _0x120b50=this;return new Promise(function(_0x16d5e8,_0x2fc23c){if(ami[_0x7064('0xe')]()==![]){return _0x2fc23c(_0x120b50[_0x7064('0xf')](0x1f4,[config[_0x7064('0x10')]['ip'],config[_0x7064('0x10')]['username'],'ami\x20disconnected'][_0x7064('0x1a')]('\x20')));}var _0x1d83d4=schema(properties['voicequeuechannelredirect'])[_0x7064('0x2')](_0x53fad1);if(_0x1d83d4[_0x7064('0x55')]>0x0){return _0x2fc23c(_0x120b50[_0x7064('0xf')](0x1f4,_[_0x7064('0x6a')](_0x1d83d4,'message')[_0x7064('0x1a')](',\x20')));}var _0x404857=_[_0x7064('0x5a')](_0x313dce[_0x7064('0x72')],{'uniqueid':_0x53fad1[_0x7064('0x5b')]});if(_0x404857&&_0x404857[_0x7064('0x5c')]){return ami[_0x7064('0x15')]({'action':_0x7064('0x77'),'channel':_0x404857['channel'],'exten':_0x53fad1[_0x7064('0x78')],'context':_0x53fad1[_0x7064('0x79')]||_0x404857[_0x7064('0x79')],'priority':0x1})[_0x7064('0x1c')](function(_0x545ee4){_0x16d5e8({'code':0xc8,'message':[_0x53fad1['uniqueid'],_0x545ee4[_0x7064('0x16')]['toLowerCase']()][_0x7064('0x1a')]('\x20')});})[_0x7064('0x17')](function(_0x227452){_0x2fc23c(_0x120b50[_0x7064('0xf')](0x1f5,[_0x53fad1[_0x7064('0x5b')],_0x227452[_0x7064('0x16')][_0x7064('0x64')]()]['join']('\x20')));});}else{return _0x2fc23c(_0x120b50[_0x7064('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3fd45b){return new Promise(function(_0x528884){var _0x560ae8=_[_0x7064('0x57')](_0x313dce[_0x7064('0xb')]);if(_0x3fd45b&&_0x3fd45b['id']){var _0x43946b=_[_0x7064('0x5a')](_0x560ae8,function(_0x75e38a){return _0x75e38a['id']===_0x3fd45b['id'];});_0x528884(_0x43946b);}else{_0x528884({'count':_0x560ae8['length'],'rows':_0x560ae8});}});},'Telephones':function(){return new Promise(function(_0x59bc56){var _0x5333c0=_[_0x7064('0x57')](_0x313dce[_0x7064('0x7a')]);_0x59bc56({'count':_0x5333c0['length'],'rows':_0x5333c0});});},'Trunks':function(){return new Promise(function(_0xcfd8b2){var _0x15d590=_[_0x7064('0x57')](_0x313dce['trunks']);_0xcfd8b2({'count':_0x15d590[_0x7064('0x55')],'rows':_0x15d590});});},'OutboundChannels':function(){return new Promise(function(_0x4b3ff2){var _0x2e7407=_[_0x7064('0x57')](_0x313dce[_0x7064('0x7b')]);_0x4b3ff2({'count':_0x2e7407['length'],'rows':_0x2e7407});});},'Outbound':function(){return new Promise(function(_0x57c792){_0x57c792(_0x313dce['outbound']);});},'Campaigns':function(){return new Promise(function(_0x23aba9){var _0x1647a6=_['values'](_0x313dce[_0x7064('0x7c')]);_0x23aba9({'count':_0x1647a6[_0x7064('0x55')],'rows':_0x1647a6});});},'VoiceQueuesPreview':function(_0x1a6306){var _0x542ac2=this;return new Promise(function(_0xf34434,_0x29e48a){_0x34b4d5[_0x7064('0x7d')](_0x1a6306['id'])[_0x7064('0x1c')](function(_0x4f4e9a){_0xf34434({'code':0xc8,'message':_0x4f4e9a[_0x7064('0x16')]});})[_0x7064('0x17')](function(_0x8450fc){_0x29e48a(_0x542ac2['error'](0x1f4,_0x8450fc[_0x7064('0x16')]));});});},'EventManager':function(_0x3d6436){var _0x4d066c=this;return new Promise(function(_0x3ac545,_0x5c88be){if(!_0x3d6436[_0x7064('0x7e')]){return _0x5c88be(_0x4d066c[_0x7064('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit']('custom:'+_0x3d6436[_0x7064('0x7e')],_0x3d6436[_0x7064('0x16')]);_0x3ac545({'code':0xc8,'message':_0x3d6436});});},'FaxAccounts':function(){return new Promise(function(_0xc7d601){var _0x515bb4=_[_0x7064('0x57')](_0x313dce['faxAccounts']);_0xc7d601({'count':_0x515bb4[_0x7064('0x55')],'rows':_0x515bb4});});},'SendFax':function(_0xf7f9ee){var _0x5f1b3b=this;return new Promise(function(_0x525bdb,_0x58ba4a){_0x31f6a6[_0x7064('0x7f')](_0xf7f9ee)['then'](function(_0x14440c){_0x525bdb({'code':0xc8,'message':_0x14440c[_0x7064('0x16')]});})[_0x7064('0x17')](function(_0x18afb6){_0x58ba4a(_0x5f1b3b['error'](0x1f4,_0x18afb6[_0x7064('0x16')]));});});},'CheckAfterSend':function(_0x5acf25){var _0x41b136=this;return new Promise(function(_0xf67b59,_0x553210){_0x31f6a6[_0x7064('0x80')](_0x5acf25)[_0x7064('0x1c')](function(_0x3f5d3f){_0xf67b59({'code':0xc8,'message':_0x3f5d3f[_0x7064('0x16')]});})[_0x7064('0x17')](function(_0x5c0f6f){_0x553210(_0x41b136['error'](0x1f4,_0x5c0f6f['message']));});});}};var _0x1fd531=jayson['server'](_0x1101e4)[_0x7064('0x81')]();_0x1fd531['on'](_0x7064('0xf'),function(_0x21ccb9){return _0x2b6f9b(_0x21ccb9);});_0x1fd531[_0x7064('0x82')](0x232a,'127.0.0.1',function(){console[_0x7064('0x83')](_0x7064('0x84'),0x232a);return _0x44b1bb(_0x7064('0x85')+0x232a);});});}; \ No newline at end of file +var _0x3495=['startPredictive','startProgressive','Trunk','active','callerid','Interval','push','find','omit','undefined','values','ami\x20disconnected','voicechannel','length','map','uniqueid','channel','format','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','channels','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','Action','catch','message','action','Command','then','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x3495,0x1de));var _0x5349=function(_0x3801ae,_0x49734e){_0x3801ae=_0x3801ae-0x0;var _0xc68e05=_0x3495[_0x3801ae];return _0xc68e05;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var jayson=require(_0x5349('0x2'));var schema=require(_0x5349('0x3'));var moment=require(_0x5349('0x4'));var config=require(_0x5349('0x5'));var properties=require(_0x5349('0x6'));var ami=require(_0x5349('0x7'));exports[_0x5349('0x8')]=function(_0x5912ac,_0x4034ba,_0x8283b5){return new Promise(function(_0x5ce2cd,_0xcb5a1){var _0x538385={'QueuePause':function(_0x6fb5dc){return new Promise(function(_0x529323){var _0x393873=util['format'](_0x5349('0x9'),_0x5349('0xa'),_0x6fb5dc[_0x5349('0xb')]);if(_0x5912ac[_0x5349('0xc')]&&_0x5912ac[_0x5349('0xc')][_0x393873]&&_0x5912ac[_0x5349('0xc')][_0x393873][_0x5349('0xd')]){_0x5912ac['timers'][_0x393873][_0x5349('0xe')]();}if(_0x5912ac['agents'][_0x393873]){_0x5912ac[_0x5349('0xf')][_0x393873][_0x5349('0x10')]({'statePause':_0x6fb5dc[_0x5349('0x11')]?!![]:![]});}_0x529323({'code':0xc8,'message':_0x5349('0x12')});});},'Reload':function(_0x2f5172){var _0x3c592a=this;return new Promise(function(_0x642966,_0x52c253){if(ami[_0x5349('0x13')]()==![]){return _0x52c253(_0x3c592a[_0x5349('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x5349('0x15')][_0x5349('0x16')],'ami\x20disconnected'][_0x5349('0x17')]('\x20')));}_0x2f5172=_[_0x5349('0x18')](_0x2f5172,_[_0x5349('0x19')](properties['module']));_0x2f5172['action']='Reload';return ami[_0x5349('0x1a')](_0x2f5172)['then'](function(_0x25898f){_0x642966({'code':0xc8,'message':_0x25898f['message']});})[_0x5349('0x1b')](function(_0x2c1f1){_0x52c253(_0x3c592a[_0x5349('0x14')](0x1f5,_0x2c1f1[_0x5349('0x1c')]));});});},'Command':function(_0x4e128c){var _0x22d1ca=this;return new Promise(function(_0x24e74c,_0x8abbe3){if(ami[_0x5349('0x13')]()==![]){return _0x8abbe3(_0x22d1ca['error'](0x1f4,[config[_0x5349('0x15')]['ip'],config[_0x5349('0x15')]['username'],'ami\x20disconnected']['join']('\x20')));}_0x4e128c=_[_0x5349('0x18')](_0x4e128c,'command');_0x4e128c[_0x5349('0x1d')]=_0x5349('0x1e');return ami[_0x5349('0x1a')](_0x4e128c)[_0x5349('0x1f')](function(_0x2dda33){_0x24e74c({'code':0xc8,'message':_0x2dda33[_0x5349('0x20')]});})[_0x5349('0x1b')](function(_0x43a0c2){_0x8abbe3(_0x22d1ca[_0x5349('0x14')](0x1f5,_0x43a0c2[_0x5349('0x1c')]));});});},'VoiceQueues':function(){return new Promise(function(_0x1a84ce){var _0x52520=[];for(var _0x57af6c in _0x5912ac[_0x5349('0x21')]){if(_0x5912ac[_0x5349('0x21')][_0x5349('0x22')](_0x57af6c)){var _0x49435a=_0x5912ac[_0x5349('0x21')][_0x57af6c];var _0x5068fa={'id':_0x49435a['id'],'name':_0x49435a[_0x5349('0xb')],'strategy':_0x49435a[_0x5349('0x23')],'answered':_0x49435a[_0x5349('0x24')],'available':_0x49435a['available'],'loggedIn':_0x49435a[_0x5349('0x25')],'pTalking':_0x49435a[_0x5349('0x26')],'sumBillable':_0x49435a[_0x5349('0x27')],'sumDuration':_0x49435a[_0x5349('0x28')],'sumHoldTime':_0x49435a[_0x5349('0x29')]||0x0,'talking':_0x49435a[_0x5349('0x2a')],'total':_0x49435a[_0x5349('0x2b')],'type':_0x49435a[_0x5349('0x2c')],'unmanaged':_0x49435a[_0x5349('0x2d')],'abandoned':_0x49435a['abandoned'],'waiting':_0x49435a[_0x5349('0x2e')],'loggedInDb':_0x49435a[_0x5349('0x2f')]};if(_0x49435a['type']===_0x5349('0x30')){_0x5068fa['dialActive']=_0x49435a[_0x5349('0x31')];_0x5068fa[_0x5349('0x32')]=_0x49435a[_0x5349('0x32')];_0x5068fa[_0x5349('0x33')]=_0x49435a[_0x5349('0x33')];_0x5068fa[_0x5349('0x34')]=_0x49435a['dialOriginateCallerIdNumber'];_0x5068fa[_0x5349('0x35')]=_0x49435a[_0x5349('0x35')];_0x5068fa[_0x5349('0x36')]=_0x49435a[_0x5349('0x36')];_0x5068fa['temp']=_0x49435a['temp'];_0x5068fa[_0x5349('0x37')]=_0x49435a[_0x5349('0x37')];_0x5068fa[_0x5349('0x38')]=_0x49435a['outboundAnswerCallsDay'];_0x5068fa[_0x5349('0x39')]=_0x49435a['outboundBlacklistCallsDay'];_0x5068fa[_0x5349('0x3a')]=_0x49435a[_0x5349('0x3a')];_0x5068fa[_0x5349('0x3b')]=_0x49435a[_0x5349('0x3b')];_0x5068fa[_0x5349('0x3c')]=_0x49435a[_0x5349('0x3c')];_0x5068fa['outboundDropCallsDayCallersExit']=_0x49435a['outboundDropCallsDayCallersExit'];_0x5068fa[_0x5349('0x3d')]=_0x49435a[_0x5349('0x3d')];_0x5068fa[_0x5349('0x3e')]=_0x49435a[_0x5349('0x3e')];_0x5068fa[_0x5349('0x3f')]=_0x49435a[_0x5349('0x3f')];_0x5068fa[_0x5349('0x40')]=_0x49435a['outboundOriginateFailureCallsDay'];_0x5068fa['outboundReCallsDay']=_0x49435a[_0x5349('0x41')];_0x5068fa['outboundRejectCallsDay']=_0x49435a['outboundRejectCallsDay'];_0x5068fa[_0x5349('0x42')]=_0x49435a['outboundUnknownCallsDay'];_0x5068fa[_0x5349('0x43')]=_0x49435a[_0x5349('0x43')];_0x5068fa[_0x5349('0x44')]=_0x49435a['predictiveIntervalAvgHoldtime'];_0x5068fa[_0x5349('0x45')]=_0x49435a['predictiveIntervalAvgTalktime'];_0x5068fa[_0x5349('0x46')]=_0x49435a[_0x5349('0x46')];_0x5068fa[_0x5349('0x47')]=_0x49435a['predictiveIntervalDroppedCallsTimeout'];_0x5068fa['predictiveIntervalErlangCalls']=_0x49435a['predictiveIntervalErlangCalls'];_0x5068fa[_0x5349('0x48')]=_0x49435a[_0x5349('0x48')];_0x5068fa[_0x5349('0x49')]=_0x49435a[_0x5349('0x49')];_0x5068fa[_0x5349('0x4a')]=_0x49435a[_0x5349('0x4a')];_0x5068fa['predictiveIntervalPauses']=_0x49435a['predictiveIntervalPauses'];_0x5068fa[_0x5349('0x4b')]=_0x49435a[_0x5349('0x4b')];_0x5068fa[_0x5349('0x4c')]=_0x49435a['predictiveIntervalTotalCalls'];_0x5068fa[_0x5349('0x1c')]=_0x49435a[_0x5349('0x1c')];_0x5068fa[_0x5349('0x4d')]=_0x49435a[_0x5349('0x4d')];_0x5068fa['erlangCalls']=_0x49435a[_0x5349('0x4e')];_0x5068fa['erlangCallToSecond']=_0x49435a[_0x5349('0x4f')];_0x5068fa[_0x5349('0x50')]=_0x49435a['erlangAbandonmentRate'];_0x5068fa[_0x5349('0x51')]=_0x49435a[_0x5349('0x51')];_0x5068fa[_0x5349('0x52')]=_0x49435a[_0x5349('0x52')];_0x5068fa[_0x5349('0x53')]=_0x49435a[_0x5349('0x53')];}if(_0x49435a[_0x5349('0x54')]){_0x5068fa['Trunk']={'id':_0x49435a['Trunk']['id'],'name':_0x49435a[_0x5349('0x54')][_0x5349('0xb')],'active':_0x49435a[_0x5349('0x54')][_0x5349('0x55')],'callerid':_0x49435a['Trunk'][_0x5349('0x56')]};}if(_0x49435a['Interval']){_0x5068fa['Interval']={'id':_0x49435a[_0x5349('0x57')]['id'],'name':_0x49435a[_0x5349('0x57')][_0x5349('0xb')]};}_0x52520[_0x5349('0x58')](_0x5068fa);}}_0x1a84ce({'count':_0x52520['length'],'rows':_0x52520});});},'UpdateVoiceQueue':function(_0x34f3f4){return new Promise(function(_0x3f1be1,_0x24194f){var _0x36600b=_[_0x5349('0x59')](_0x5912ac[_0x5349('0x21')],{'id':parseInt(_0x34f3f4['id'])});var _0x2c42ee=_[_0x5349('0x5a')](_0x34f3f4,['id']);if(_0x36600b){for(var _0x33ade9 in _0x2c42ee){if(typeof _0x2c42ee[_0x33ade9]!==_0x5349('0x5b')&&typeof _0x36600b[_0x33ade9]!==_0x5349('0x5b')){_0x36600b[_0x33ade9]=_0x2c42ee[_0x33ade9];}}_0x3f1be1(_0x36600b);}else{_0x24194f();}});},'VoiceChannels':function(){return new Promise(function(_0x2ec89b){var _0x1e683=_[_0x5349('0x5c')](_0x5912ac['channels']);_0x2ec89b({'count':_0x1e683['length'],'rows':_0x1e683});});},'VoiceChannelMixMonitor':function(_0x11d862){var _0x2931af=this;return new Promise(function(_0x37b370,_0x366634){if(ami[_0x5349('0x13')]()==![]){return _0x366634(_0x2931af[_0x5349('0x14')](0x1f4,[config['asterisk']['ip'],config[_0x5349('0x15')][_0x5349('0x16')],_0x5349('0x5d')][_0x5349('0x17')]('\x20')));}var _0x26d06a=schema(properties[_0x5349('0x5e')])['validate'](_0x11d862);if(_0x26d06a[_0x5349('0x5f')]>0x0){return _0x366634(_0x2931af['error'](0x1f4,_[_0x5349('0x60')](_0x26d06a,_0x5349('0x1c'))[_0x5349('0x17')](',\x20')));}var _0x3f4db2=_[_0x5349('0x59')](_0x5912ac['channels'],{'uniqueid':_0x11d862[_0x5349('0x61')]});if(_0x3f4db2&&_0x3f4db2[_0x5349('0x62')]){var _0x3891af=util[_0x5349('0x63')]('%s.%s',_0x11d862[_0x5349('0x64')]||_0x11d862[_0x5349('0x61')],_0x11d862[_0x5349('0x63')]||_0x5349('0x65'));return ami[_0x5349('0x1a')]({'action':_0x5349('0x66'),'channel':_0x3f4db2[_0x5349('0x62')],'file':_0x3891af,'options':_0x5349('0x67')})[_0x5349('0x1f')](function(_0x264763){var _0x477782=_[_0x5349('0x59')](_0x3f4db2[_0x5349('0x68')],{'filename':_0x5349('0x69')+_0x3891af[_0x5349('0x6a')]()});if(_[_0x5349('0x6b')](_0x477782)){_0x3f4db2[_0x5349('0x68')][_0x5349('0x58')]({'filename':'/var/spool/asterisk/monitor/'+_0x3891af[_0x5349('0x6a')](),'createdAt':moment()[_0x5349('0x63')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x264763['mixmonitorid'],'status':_0x5349('0x6c')});}else{_0x477782[_0x5349('0x6d')]=_0x264763[_0x5349('0x6d')];_0x477782[_0x5349('0x6e')]=_0x5349('0x6c');}_0x37b370({'code':0xc8,'message':[_0x11d862[_0x5349('0x61')],_0x5349('0x6f'),_0x264763['mixmonitorid']][_0x5349('0x17')]('\x20'),'mixmonitorid':_0x264763[_0x5349('0x6d')]});})[_0x5349('0x1b')](function(_0x590fc8){_0x366634(_0x2931af['error'](0x1f5,[_0x11d862[_0x5349('0x61')],_0x590fc8[_0x5349('0x1c')][_0x5349('0x6a')]()][_0x5349('0x17')]('\x20')));});}else{return _0x366634(_0x2931af[_0x5349('0x14')](0x1f5,_0x5349('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0xe4b289){var _0x1729fe=this;return new Promise(function(_0x494c5f,_0x2425fd){if(ami['isConnected']()==![]){return _0x2425fd(_0x1729fe[_0x5349('0x14')](0x1f4,[config[_0x5349('0x15')]['ip'],config[_0x5349('0x15')][_0x5349('0x16')],'ami\x20disconnected']['join']('\x20')));}var _0x4c8e70=schema(properties[_0x5349('0x5e')])['validate'](_0xe4b289);if(_0x4c8e70[_0x5349('0x5f')]>0x0){return _0x2425fd(_0x1729fe[_0x5349('0x14')](0x1f4,_[_0x5349('0x60')](_0x4c8e70,_0x5349('0x1c'))[_0x5349('0x17')](',\x20')));}var _0x20f789=_['find'](_0x5912ac[_0x5349('0x71')],{'uniqueid':_0xe4b289[_0x5349('0x61')]});if(_0x20f789){return Promise[_0x5349('0x72')]()[_0x5349('0x1f')](function(){if(_0x20f789[_0x5349('0x62')]){return ami['Action']({'action':_0x5349('0x73'),'channel':_0x20f789['channel'],'mixmonitorid':_0xe4b289[_0x5349('0x6d')]})['catch'](function(){});}})['then'](function(){if(_0x20f789[_0x5349('0x74')]){return ami[_0x5349('0x1a')]({'action':_0x5349('0x73'),'channel':_0x20f789[_0x5349('0x74')],'mixmonitorid':_0xe4b289[_0x5349('0x6d')]})[_0x5349('0x1b')](function(){});}})[_0x5349('0x1f')](function(){var _0x15f347=_['find'](_0x20f789[_0x5349('0x68')],{'mixmonitorid':_0xe4b289[_0x5349('0x6d')]});if(_0x15f347){_0x15f347[_0x5349('0x6e')]=_0x5349('0x75');}})[_0x5349('0x1f')](function(){var _0x5c9efe=util[_0x5349('0x63')]('%s.%s',_0xe4b289[_0x5349('0x64')]||_0xe4b289[_0x5349('0x61')],_0xe4b289[_0x5349('0x63')]||'wav');var _0x9a5857=_['find'](_0x20f789[_0x5349('0x68')],{'filename':'/var/spool/asterisk/monitor/'+_0x5c9efe['toLowerCase']()});if(_0x9a5857){_0x9a5857[_0x5349('0x6e')]=_0x5349('0x75');}})['then'](function(){_0x494c5f({'code':0xc8,'message':[_0xe4b289[_0x5349('0x61')],_0x5349('0x76')][_0x5349('0x17')]('\x20')});})['catch'](function(_0x16ddc5){_0x2425fd(_0x1729fe[_0x5349('0x14')](0x1f5,[_0xe4b289['uniqueid'],_0x16ddc5['message'][_0x5349('0x6a')]()]['join']('\x20')));});}else{return _0x2425fd(_0x1729fe['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x5158a9){var _0xffe718=_[_0x5349('0x5c')](_0x5912ac['queueChannels']);_0x5158a9({'count':_0xffe718[_0x5349('0x5f')],'rows':_0xffe718});});},'VoiceQueuesChannel':function(_0xd9b996){var _0x27271e=this;return new Promise(function(_0x5812b0,_0x5239da){var _0x674054=schema(properties[_0x5349('0x77')])[_0x5349('0x3')](_0xd9b996);if(_0x674054[_0x5349('0x5f')]>0x0){return _0x5239da(_0x27271e[_0x5349('0x14')](0x1f4,_[_0x5349('0x60')](_0x674054,_0x5349('0x1c'))[_0x5349('0x17')](',\x20')));}var _0x25b07f=_[_0x5349('0x59')](_0x5912ac[_0x5349('0x78')],{'uniqueid':_0xd9b996[_0x5349('0x61')]});if(_0x25b07f){_0x5812b0(_0x25b07f);}else{return _0x5239da(_0x27271e[_0x5349('0x14')](0x1f5,_0x5349('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x12f4fe){var _0x20706b=this;return new Promise(function(_0x29e4a3,_0x47a9b0){if(ami['isConnected']()==![]){return _0x47a9b0(_0x20706b[_0x5349('0x14')](0x1f4,[config[_0x5349('0x15')]['ip'],config['asterisk'][_0x5349('0x16')],_0x5349('0x5d')][_0x5349('0x17')]('\x20')));}var _0x501ce3=schema(properties['voicequeuechannelhangup'])['validate'](_0x12f4fe);if(_0x501ce3[_0x5349('0x5f')]>0x0){return _0x47a9b0(_0x20706b['error'](0x1f4,_[_0x5349('0x60')](_0x501ce3,_0x5349('0x1c'))[_0x5349('0x17')](',\x20')));}var _0x3273be=_[_0x5349('0x59')](_0x5912ac[_0x5349('0x78')],{'uniqueid':_0x12f4fe[_0x5349('0x61')]});if(_0x3273be&&_0x3273be['channel']){return ami[_0x5349('0x1a')]({'action':'Hangup','channel':_0x3273be[_0x5349('0x62')]})[_0x5349('0x1f')](function(_0x30cf63){_0x29e4a3({'code':0xc8,'message':[_0x12f4fe[_0x5349('0x61')],_0x30cf63[_0x5349('0x1c')][_0x5349('0x6a')]()][_0x5349('0x17')]('\x20')});})[_0x5349('0x1b')](function(_0x5a58e1){_0x47a9b0(_0x20706b['error'](0x1f5,[_0x12f4fe[_0x5349('0x61')],_0x5a58e1['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x47a9b0(_0x20706b[_0x5349('0x14')](0x1f5,_0x5349('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x30c1c6){var _0x34256e=this;return new Promise(function(_0xd2846c,_0xbe6d32){if(ami[_0x5349('0x13')]()==![]){return _0xbe6d32(_0x34256e[_0x5349('0x14')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x5349('0x16')],_0x5349('0x5d')]['join']('\x20')));}var _0x34bc2c=schema(properties[_0x5349('0x79')])[_0x5349('0x3')](_0x30c1c6);if(_0x34bc2c[_0x5349('0x5f')]>0x0){return _0xbe6d32(_0x34256e[_0x5349('0x14')](0x1f4,_[_0x5349('0x60')](_0x34bc2c,'message')[_0x5349('0x17')](',\x20')));}var _0x5e39ff=_[_0x5349('0x59')](_0x5912ac[_0x5349('0x78')],{'uniqueid':_0x30c1c6[_0x5349('0x61')]});if(_0x5e39ff&&_0x5e39ff[_0x5349('0x62')]){return ami[_0x5349('0x1a')]({'action':_0x5349('0x7a'),'channel':_0x5e39ff[_0x5349('0x62')],'exten':_0x30c1c6['exten'],'context':_0x30c1c6[_0x5349('0x7b')]||_0x5e39ff[_0x5349('0x7b')],'priority':0x1})[_0x5349('0x1f')](function(_0x4ae3c2){_0xd2846c({'code':0xc8,'message':[_0x30c1c6[_0x5349('0x61')],_0x4ae3c2[_0x5349('0x1c')][_0x5349('0x6a')]()]['join']('\x20')});})[_0x5349('0x1b')](function(_0x3915b8){_0xbe6d32(_0x34256e[_0x5349('0x14')](0x1f5,[_0x30c1c6[_0x5349('0x61')],_0x3915b8[_0x5349('0x1c')][_0x5349('0x6a')]()][_0x5349('0x17')]('\x20')));});}else{return _0xbe6d32(_0x34256e[_0x5349('0x14')](0x1f5,_0x5349('0x70')));}});},'Agents':function(_0x95a657){return new Promise(function(_0x407f81){var _0x453377=_[_0x5349('0x5c')](_0x5912ac[_0x5349('0xf')]);if(_0x95a657&&_0x95a657['id']){var _0x51d6f3=_[_0x5349('0x59')](_0x453377,function(_0x1e3d66){return _0x1e3d66['id']===_0x95a657['id'];});_0x407f81(_0x51d6f3);}else{_0x407f81({'count':_0x453377[_0x5349('0x5f')],'rows':_0x453377});}});},'Telephones':function(){return new Promise(function(_0x480856){var _0x534094=_['values'](_0x5912ac[_0x5349('0x7c')]);_0x480856({'count':_0x534094[_0x5349('0x5f')],'rows':_0x534094});});},'Trunks':function(){return new Promise(function(_0x59b15f){var _0x4eb212=_[_0x5349('0x5c')](_0x5912ac[_0x5349('0x7d')]);_0x59b15f({'count':_0x4eb212[_0x5349('0x5f')],'rows':_0x4eb212});});},'OutboundChannels':function(){return new Promise(function(_0x8dc58b){var _0x19f0c0=_[_0x5349('0x5c')](_0x5912ac[_0x5349('0x7e')]);_0x8dc58b({'count':_0x19f0c0[_0x5349('0x5f')],'rows':_0x19f0c0});});},'Outbound':function(){return new Promise(function(_0x53bdba){_0x53bdba(_0x5912ac['outbound']);});},'Campaigns':function(){return new Promise(function(_0x45939b){var _0x455c40=_[_0x5349('0x5c')](_0x5912ac[_0x5349('0x7f')]);_0x45939b({'count':_0x455c40[_0x5349('0x5f')],'rows':_0x455c40});});},'VoiceQueuesPreview':function(_0x44b40e){var _0x4c557d=this;return new Promise(function(_0x3d3193,_0x2715cb){_0x4034ba[_0x5349('0x80')](_0x44b40e['id'])['then'](function(_0x292032){_0x3d3193({'code':0xc8,'message':_0x292032[_0x5349('0x1c')]});})[_0x5349('0x1b')](function(_0x4b5655){_0x2715cb(_0x4c557d['error'](0x1f4,_0x4b5655[_0x5349('0x1c')]));});});},'EventManager':function(_0x280559){var _0x12b7ef=this;return new Promise(function(_0x3ae84c,_0x20d431){if(!_0x280559[_0x5349('0x81')]){return _0x20d431(_0x12b7ef['error'](0x1f4,_0x5349('0x82')));}ami['emit'](_0x5349('0x83')+_0x280559[_0x5349('0x81')],_0x280559['message']);_0x3ae84c({'code':0xc8,'message':_0x280559});});},'FaxAccounts':function(){return new Promise(function(_0x4ba597){var _0x1bc421=_[_0x5349('0x5c')](_0x5912ac[_0x5349('0x84')]);_0x4ba597({'count':_0x1bc421['length'],'rows':_0x1bc421});});},'SendFax':function(_0x472b94){var _0x47d22a=this;return new Promise(function(_0x2e9c08,_0xda7ea6){_0x8283b5[_0x5349('0x85')](_0x472b94)['then'](function(_0x425359){_0x2e9c08({'code':0xc8,'message':_0x425359[_0x5349('0x1c')]});})['catch'](function(_0x8a0a4a){_0xda7ea6(_0x47d22a['error'](0x1f4,_0x8a0a4a[_0x5349('0x1c')]));});});},'CheckAfterSend':function(_0x1c3a52){var _0x43f443=this;return new Promise(function(_0x5d000d,_0x3b3f61){_0x8283b5[_0x5349('0x86')](_0x1c3a52)[_0x5349('0x1f')](function(_0x315223){_0x5d000d({'code':0xc8,'message':_0x315223[_0x5349('0x1c')]});})[_0x5349('0x1b')](function(_0x3af9e4){_0x3b3f61(_0x43f443[_0x5349('0x14')](0x1f4,_0x3af9e4[_0x5349('0x1c')]));});});}};var _0x5e4a78=jayson[_0x5349('0x87')](_0x538385)[_0x5349('0x88')]();_0x5e4a78['on'](_0x5349('0x14'),function(_0x5ebddd){return _0xcb5a1(_0x5ebddd);});_0x5e4a78[_0x5349('0x8')](0x232a,'127.0.0.1',function(){console[_0x5349('0x89')](_0x5349('0x8a'),0x232a);return _0x5ce2cd(_0x5349('0x8b')+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 aa714cc..7653e96 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 _0x28ed=['fax','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','format','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','firstName','mobile'];(function(_0x388428,_0xda6d9f){var _0x4a2ffa=function(_0x53ce1a){while(--_0x53ce1a){_0x388428['push'](_0x388428['shift']());}};_0x4a2ffa(++_0xda6d9f);}(_0x28ed,0x17a));var _0xd28e=function(_0x5915f6,_0x8f7722){_0x5915f6=_0x5915f6-0x0;var _0x2ea83c=_0x28ed[_0x5915f6];return _0x2ea83c;};'use strict';var _=require(_0xd28e('0x0'));var BPromise=require(_0xd28e('0x1'));var Redis=require(_0xd28e('0x2'));var util=require(_0xd28e('0x3'));var config=require('../../../../config/environment');var logger=require(_0xd28e('0x4'))('trigger');var cmContactRpc=require(_0xd28e('0x5'));config[_0xd28e('0x6')]=_[_0xd28e('0x7')](config['redis'],{'host':_0xd28e('0x8'),'port':0x18eb});var io=require(_0xd28e('0x9'))(new Redis(config[_0xd28e('0x6')]));function emit(_0x29894b,_0xbf614f,_0x30807f,_0x220e32,_0x3a3ed1){logger['info'](_0xd28e('0xa'),_0x29894b,_0xbf614f['id'],_0x30807f,_0x220e32,JSON['stringify'](_0x3a3ed1));io['to'](_0x30807f)[_0xd28e('0xb')](_0x220e32,_0x3a3ed1);}exports[_0xd28e('0xc')]=function(_0x28dfa8,_0x2fb624,_0xa5f0cf,_0x2c3b04){var _0x4b8ab8,_0x45f8df;var _0x3af6e0={};var _0xad4542;var _0x5238d8=Number(_0xa5f0cf[_0xd28e('0xd')]);var _0x22decd=_0xa5f0cf['data2']?Boolean(Number(_0xa5f0cf[_0xd28e('0xe')])):![];var _0x1657db;var _0x2f8a88=![];if(!_['isNil'](_0xa5f0cf[_0xd28e('0xf')])){if(_0xa5f0cf[_0xd28e('0xf')]=='1')_0x2f8a88=!![];}if(!_0x2f8a88){if(_0x2c3b04[_0xd28e('0x10')]){_0x3af6e0['id']=_0x2c3b04[_0xd28e('0x10')];}}if(!_0x3af6e0['id']){_0x3af6e0[_0xd28e('0x11')]=_0x5238d8;_0x1657db=_0xa5f0cf[_0xd28e('0x12')]&&_0xa5f0cf[_0xd28e('0x12')]!=='0'?_0xa5f0cf[_0xd28e('0x12')][_0xd28e('0x13')](','):[_0xd28e('0x14')];_0x3af6e0[_0xd28e('0x15')]=_[_0xd28e('0x16')](_0x1657db,function(_0x435252){var _0x3772d9={};_0x3772d9[_0x435252]=_0x2c3b04['routeId']?_0x2c3b04[_0xd28e('0x17')]:_0x2c3b04[_0xd28e('0x18')];return _0x3772d9;});_0xad4542=_0x2c3b04[_0xd28e('0x19')]?_0x2c3b04[_0xd28e('0x17')]:_0x2c3b04[_0xd28e('0x18')];}var _0x4e6439=['id',_0xd28e('0x1a'),'lastName',_0xd28e('0x14'),_0xd28e('0x1b'),_0xd28e('0x1c'),_0xd28e('0x11'),'createdAt',_0xd28e('0x1d'),_0xd28e('0x1e')];var _0x207872=_[_0xd28e('0x1f')](_0x4e6439,_0x1657db);BPromise[_0xd28e('0x20')]()[_0xd28e('0x21')](cmContactRpc[_0xd28e('0x22')]({'attributes':_0x207872,'where':_0x3af6e0,'phone':_0xad4542}))[_0xd28e('0x21')](function(_0x387629){_0x45f8df=_0x387629;if(!_[_0xd28e('0x23')](_0x45f8df)){if(_0x45f8df['length']===0x1){_0x4b8ab8=_0x45f8df[0x0];logger[_0xd28e('0x24')](_0xd28e('0x25'),_0x2c3b04[_0xd28e('0x26')],_0x2fb624['id'],_0x4b8ab8['id']);}else{logger['info'](_0xd28e('0x27'),_0x2c3b04[_0xd28e('0x26')],_0x2fb624['id'],_[_0xd28e('0x16')](_0x45f8df,'id')[_0xd28e('0x28')](','));}return;}else{logger[_0xd28e('0x24')](_0xd28e('0x29'),_0x2c3b04[_0xd28e('0x26')],_0x2fb624['id']);var _0x29f21a={'ListId':_0x5238d8};var _0x1860d6=_0xa5f0cf[_0xd28e('0x2a')]&&_0xa5f0cf[_0xd28e('0x2a')]!=='0'?_0xa5f0cf['data4']:_0xd28e('0x14');if(_0x22decd){logger[_0xd28e('0x24')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x2c3b04['uniqueid'],_0x2fb624['id']);_0x29f21a[_0x1860d6]=_[_0xd28e('0x2b')](_0x2c3b04['routeId'])?_0x2c3b04[_0xd28e('0x18')]:_0x2c3b04[_0xd28e('0x17')];if(_[_0xd28e('0x2b')](_0x2c3b04[_0xd28e('0x19')])){_0x29f21a[_0xd28e('0x1a')]=_0x2c3b04[_0xd28e('0x2c')]&&_0x2c3b04[_0xd28e('0x2c')]!==_0xd28e('0x2d')?_0x2c3b04[_0xd28e('0x2c')]:_0xd28e('0x2e');}else{_0x29f21a[_0xd28e('0x1a')]=_0x2c3b04['destcalleridname']&&_0x2c3b04['destcalleridname']!==_0xd28e('0x2d')?_0x2c3b04[_0xd28e('0x2f')]:'Unknown';}return BPromise['resolve']()['then'](cmContactRpc[_0xd28e('0x30')](_0x29f21a))[_0xd28e('0x21')](function(_0x445a62){_0x4b8ab8=_0x445a62;_0x45f8df[_0xd28e('0x31')](_0x445a62);if(_0x4b8ab8){logger[_0xd28e('0x24')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2c3b04[_0xd28e('0x26')],_0x2fb624['id'],_0x4b8ab8['id']);}return;});}else{logger[_0xd28e('0x24')](_0xd28e('0x32'),_0x2c3b04[_0xd28e('0x26')],_0x2fb624['id']);_0x29f21a[_0x1860d6]=_['isNil'](_0x2c3b04[_0xd28e('0x19')])?_0x2c3b04[_0xd28e('0x18')]:_0x2c3b04[_0xd28e('0x17')];if(_['isNil'](_0x2c3b04[_0xd28e('0x19')])){_0x29f21a[_0xd28e('0x1a')]=_0x2c3b04[_0xd28e('0x2c')]&&_0x2c3b04[_0xd28e('0x2c')]!==_0xd28e('0x2d')?_0x2c3b04['calleridname']:'Unknown';}else{_0x29f21a['firstName']=_0x2c3b04[_0xd28e('0x2f')]&&_0x2c3b04[_0xd28e('0x2f')]!==_0xd28e('0x2d')?_0x2c3b04['destcalleridname']:_0xd28e('0x2e');}_0x4b8ab8=_0x29f21a;_0x45f8df[_0xd28e('0x31')](_0x29f21a);return;}}})[_0xd28e('0x21')](function(){if(_0x28dfa8){emit(_0x2c3b04[_0xd28e('0x26')],_0x2fb624,util['format'](_0xd28e('0x33'),_0x28dfa8['name']),util[_0xd28e('0x34')](_0xd28e('0x35'),_0xa5f0cf[_0xd28e('0x36')][_0xd28e('0x37')]()),{'evt':_[_0xd28e('0x38')](_0x2c3b04,{'autoCreate':_0x22decd}),'contact':_0x4b8ab8===undefined?{}:_0x4b8ab8,'contacts':_0x45f8df[_0xd28e('0x39')]===0x0?undefined:_0x45f8df});}});}; \ No newline at end of file +var _0x2540=['../../../../config/environment','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','map','routeId','calleridnum','lastName','phone','mobile','fax','createdAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','destcalleridnum','Unknown','format','name','trigger:%s','bluebird','ioredis','util'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x2540,0x110));var _0x0254=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x2540[_0x29d915];return _0x160f86;};'use strict';var _=require('lodash');var BPromise=require(_0x0254('0x0'));var Redis=require(_0x0254('0x1'));var util=require(_0x0254('0x2'));var config=require(_0x0254('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x0254('0x4'));config[_0x0254('0x5')]=_[_0x0254('0x6')](config['redis'],{'host':_0x0254('0x7'),'port':0x18eb});var io=require(_0x0254('0x8'))(new Redis(config[_0x0254('0x5')]));function emit(_0x3a6c29,_0x4b08dc,_0x195ea8,_0x397ab7,_0x2f55aa){logger['info']('[CM][%s][%s]',_0x3a6c29,_0x4b08dc['id'],_0x195ea8,_0x397ab7,JSON[_0x0254('0x9')](_0x2f55aa));io['to'](_0x195ea8)[_0x0254('0xa')](_0x397ab7,_0x2f55aa);}exports[_0x0254('0xb')]=function(_0x511b41,_0x66235d,_0xc07628,_0x290159){var _0xdfae7f,_0x5cbd29;var _0x17f460={};var _0x137a98;var _0x317347=Number(_0xc07628[_0x0254('0xc')]);var _0x5a8a4d=_0xc07628[_0x0254('0xd')]?Boolean(Number(_0xc07628['data2'])):![];var _0x33f22a;var _0x152783=![];if(!_[_0x0254('0xe')](_0xc07628[_0x0254('0xf')])){if(_0xc07628[_0x0254('0xf')]=='1')_0x152783=!![];}if(!_0x152783){if(_0x290159['xmd-contactid']){_0x17f460['id']=_0x290159[_0x0254('0x10')];}}if(!_0x17f460['id']){_0x17f460[_0x0254('0x11')]=_0x317347;_0x33f22a=_0xc07628[_0x0254('0x12')]&&_0xc07628[_0x0254('0x12')]!=='0'?_0xc07628['data3']['split'](','):['phone'];_0x17f460['$or']=_[_0x0254('0x13')](_0x33f22a,function(_0x45d5bc){var _0x4435c9={};_0x4435c9[_0x45d5bc]=_0x290159[_0x0254('0x14')]?_0x290159['destcalleridnum']:_0x290159[_0x0254('0x15')];return _0x4435c9;});_0x137a98=_0x290159['routeId']?_0x290159['destcalleridnum']:_0x290159[_0x0254('0x15')];}var _0x45c0d0=['id','firstName',_0x0254('0x16'),_0x0254('0x17'),_0x0254('0x18'),_0x0254('0x19'),_0x0254('0x11'),_0x0254('0x1a'),'scheduledAt',_0x0254('0x1b')];var _0x5a050b=_[_0x0254('0x1c')](_0x45c0d0,_0x33f22a);BPromise[_0x0254('0x1d')]()['then'](cmContactRpc[_0x0254('0x1e')]({'attributes':_0x5a050b,'where':_0x17f460,'phone':_0x137a98}))[_0x0254('0x1f')](function(_0x313713){_0x5cbd29=_0x313713;if(!_[_0x0254('0x20')](_0x5cbd29)){if(_0x5cbd29[_0x0254('0x21')]===0x1){_0xdfae7f=_0x5cbd29[0x0];logger[_0x0254('0x22')](_0x0254('0x23'),_0x290159[_0x0254('0x24')],_0x66235d['id'],_0xdfae7f['id']);}else{logger[_0x0254('0x22')](_0x0254('0x25'),_0x290159[_0x0254('0x24')],_0x66235d['id'],_[_0x0254('0x13')](_0x5cbd29,'id')[_0x0254('0x26')](','));}return;}else{logger[_0x0254('0x22')](_0x0254('0x27'),_0x290159[_0x0254('0x24')],_0x66235d['id']);var _0x19ce14={'ListId':_0x317347};var _0x56e35f=_0xc07628['data4']&&_0xc07628[_0x0254('0x28')]!=='0'?_0xc07628[_0x0254('0x28')]:'phone';if(_0x5a8a4d){logger[_0x0254('0x22')](_0x0254('0x29'),_0x290159[_0x0254('0x24')],_0x66235d['id']);_0x19ce14[_0x56e35f]=_[_0x0254('0xe')](_0x290159[_0x0254('0x14')])?_0x290159[_0x0254('0x15')]:_0x290159['destcalleridnum'];if(_[_0x0254('0xe')](_0x290159['routeId'])){_0x19ce14[_0x0254('0x2a')]=_0x290159[_0x0254('0x2b')]&&_0x290159[_0x0254('0x2b')]!==_0x0254('0x2c')?_0x290159[_0x0254('0x2b')]:'Unknown';}else{_0x19ce14[_0x0254('0x2a')]=_0x290159['destcalleridname']&&_0x290159[_0x0254('0x2d')]!==_0x0254('0x2c')?_0x290159[_0x0254('0x2d')]:'Unknown';}return BPromise[_0x0254('0x1d')]()[_0x0254('0x1f')](cmContactRpc[_0x0254('0x2e')](_0x19ce14))[_0x0254('0x1f')](function(_0x16c6a2){_0xdfae7f=_0x16c6a2;_0x5cbd29[_0x0254('0x2f')](_0x16c6a2);if(_0xdfae7f){logger[_0x0254('0x22')](_0x0254('0x30'),_0x290159[_0x0254('0x24')],_0x66235d['id'],_0xdfae7f['id']);}return;});}else{logger['info'](_0x0254('0x31'),_0x290159[_0x0254('0x24')],_0x66235d['id']);_0x19ce14[_0x56e35f]=_[_0x0254('0xe')](_0x290159[_0x0254('0x14')])?_0x290159['calleridnum']:_0x290159[_0x0254('0x32')];if(_[_0x0254('0xe')](_0x290159[_0x0254('0x14')])){_0x19ce14['firstName']=_0x290159[_0x0254('0x2b')]&&_0x290159['calleridname']!==_0x0254('0x2c')?_0x290159[_0x0254('0x2b')]:_0x0254('0x33');}else{_0x19ce14['firstName']=_0x290159['destcalleridname']&&_0x290159[_0x0254('0x2d')]!==''?_0x290159['destcalleridname']:_0x0254('0x33');}_0xdfae7f=_0x19ce14;_0x5cbd29['push'](_0x19ce14);return;}}})['then'](function(){if(_0x511b41){emit(_0x290159[_0x0254('0x24')],_0x66235d,util[_0x0254('0x34')]('user:%s',_0x511b41[_0x0254('0x35')]),util['format'](_0x0254('0x36'),_0xc07628['action']['toLowerCase']()),{'evt':_['merge'](_0x290159,{'autoCreate':_0x5a8a4d}),'contact':_0xdfae7f===undefined?{}:_0xdfae7f,'contacts':_0x5cbd29['length']===0x0?undefined:_0x5cbd29});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5d38120..3d31551 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 _0x356e=['value','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','equals','exports','url','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','winapp','agents','voiceQueues','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','zendeskAccounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','stringify','emit','clone','motionChannel','checkTriggers','hasOwnProperty','triggers','status','checkTrigger','merge','variables','Actions','interface','action','toLowerCase','motionbar','data1','TemplateId','data2','html','templates','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','winArguments','format','name','jscripty','user:%s','contactmanager','exec','queue','routeId','parse','query','length','every','checkConditions','channel','some','AnyConditions','field','chat','ChatWebsiteId','upperFirst','AccountId','operator'];(function(_0x4e1450,_0x46e332){var _0x530fac=function(_0x3f2d40){while(--_0x3f2d40){_0x4e1450['push'](_0x4e1450['shift']());}};_0x530fac(++_0x46e332);}(_0x356e,0x1dc));var _0xe356=function(_0x48105b,_0x266487){_0x48105b=_0x48105b-0x0;var _0x1ca419=_0x356e[_0x48105b];return _0x1ca419;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0xe356('0x0'));var Mustache=require(_0xe356('0x1'));var Redis=require(_0xe356('0x2'));var urlforward=require(_0xe356('0x3'));var integration=require(_0xe356('0x4'));var cmContact=require(_0xe356('0x5'));var script=require('./script');var config=require(_0xe356('0x6'));var logger=require(_0xe356('0x7'))(_0xe356('0x8'));var ami=require(_0xe356('0x9'));config[_0xe356('0xa')]=_['defaults'](config[_0xe356('0xa')],{'host':_0xe356('0xb'),'port':0x18eb});var io=require(_0xe356('0xc'))(new Redis(config[_0xe356('0xa')]));var operators={'equals':function(_0x546e24,_0x450e8e){return _0x546e24==_0x450e8e;},'not_equals':function(_0x24aa3a,_0x5e2342){return _0x24aa3a!=_0x5e2342;}};var barAndWebActions=[_0xe356('0xd'),'url',_0xe356('0xe')];function Trigger(_0x35a146){this['triggers']=_0x35a146['triggers'];this[_0xe356('0xf')]=_0x35a146['agents'];this['voiceQueues']=_0x35a146[_0xe356('0x10')];this['templates']=_0x35a146['templates'];this[_0xe356('0x11')]=_0x35a146['voiceExtensions'];this['zendeskAccounts']=_0x35a146['zendeskAccounts'];this['freshdeskAccounts']=_0x35a146[_0xe356('0x12')];this[_0xe356('0x13')]=_0x35a146['salesforceAccounts'];this[_0xe356('0x14')]=_0x35a146[_0xe356('0x14')];this[_0xe356('0x15')]=_0x35a146[_0xe356('0x15')];this['deskAccounts']=_0x35a146[_0xe356('0x16')];this[_0xe356('0x17')]=_0x35a146[_0xe356('0x17')];this[_0xe356('0x18')]=_0x35a146[_0xe356('0x18')];this[_0xe356('0x19')]=_0x35a146[_0xe356('0x19')];this['freshsalesAccounts']=_0x35a146['freshsalesAccounts'];this[_0xe356('0x1a')]={'zendesk':this[_0xe356('0x1b')],'salesforce':this[_0xe356('0x13')],'freshdesk':this[_0xe356('0x12')],'sugarcrm':this[_0xe356('0x14')],'zoho':this[_0xe356('0x15')],'desk':this[_0xe356('0x16')],'vtiger':this[_0xe356('0x17')],'dynamics365':this[_0xe356('0x19')],'freshsales':this[_0xe356('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0xe356('0x1d'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x20'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x21'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x22'),this[_0xe356('0x1e')]['bind'](this));ami['on'](_0xe356('0x23'),this[_0xe356('0x1e')]['bind'](this));ami['on'](_0xe356('0x24'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xe356('0x1f')](this));ami['on'](_0xe356('0x25'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on']('custom:agentreject',this[_0xe356('0x1e')]['bind'](this));ami['on']('custom:amd',this[_0xe356('0x1e')]['bind'](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0xe356('0x1f')](this));ami['on']('custom:timeout',this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x26'),this[_0xe356('0x27')][_0xe356('0x1f')](this));ami['on']('custom:dialconnect',this[_0xe356('0x27')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x28'),this[_0xe356('0x27')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x29'),this['syncCustomEvent'][_0xe356('0x1f')](this));ami['on'](_0xe356('0x2a'),this[_0xe356('0x1e')]['bind'](this));ami['on'](_0xe356('0x2b'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x2c'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0xe356('0x1e')]['bind'](this));ami['on'](_0xe356('0x2d'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on'](_0xe356('0x2e'),this[_0xe356('0x1e')][_0xe356('0x1f')](this));ami['on']('custom:offlineMessage',this[_0xe356('0x1e')]['bind'](this));}Trigger[_0xe356('0x2f')]['emit']=function(_0x5c28c0,_0x293a00,_0x37bb83){logger['info'](_0x5c28c0,_0x293a00,JSON[_0xe356('0x30')](_0x37bb83));io['to'](_0x5c28c0)[_0xe356('0x31')](_0x293a00,_0x37bb83);};Trigger[_0xe356('0x2f')][_0xe356('0x1e')]=function(_0x4c1b8f){var _0x2b65cc=_[_0xe356('0x32')](_0x4c1b8f);if(typeof _0x2b65cc[_0xe356('0x33')]==='undefined'){_0x2b65cc[_0xe356('0x33')]='voice';}this[_0xe356('0x34')](_0x2b65cc);};Trigger[_0xe356('0x2f')][_0xe356('0x27')]=function(_0x4d70b7){if(this[_0xe356('0xf')][_0x4d70b7['interface']]){this[_0xe356('0x1e')](_0x4d70b7);}};Trigger[_0xe356('0x2f')][_0xe356('0x34')]=function(_0x4b4938){var _0xa547c4;for(var _0x38e609 in this['triggers']){if(this['triggers'][_0xe356('0x35')](_0x38e609)){if(this[_0xe356('0x36')][_0x38e609][_0xe356('0x37')]){_0xa547c4=this[_0xe356('0x38')](this[_0xe356('0x36')][_0x38e609],_0x4b4938);if(_0xa547c4){_[_0xe356('0x39')](_0x4b4938,_0x4b4938[_0xe356('0x3a')]);for(var _0x1254c6=0x0,_0x289bef,_0x2d195c,_0x3882d9;_0x1254c60x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x199730,_0x5444e9){_0x199730=_0x199730-0x0;var _0x507058=_0xe14b[_0x199730];return _0x507058;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ 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 b9f1ed2..1b4f48c 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 _0xa3bf=['Descriptions','format','user:%s','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','password','catch','error','toUpperCase','then','GET','Bearer\x20','value','isNil','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','message','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','4.0','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','idField','indexOf','ticketType','incident','incidents','getString','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','assign','Subjects'];(function(_0x11f36e,_0x55150a){var _0x5cedcb=function(_0x3564e7){while(--_0x3564e7){_0x11f36e['push'](_0x11f36e['shift']());}};_0x5cedcb(++_0x55150a);}(_0xa3bf,0xfb));var _0xfa3b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa3bf[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xfa3b('0x0'));var rp=require(_0xfa3b('0x1'));var util=require(_0xfa3b('0x2'));var intUtil=require(_0xfa3b('0x3'));var md5=require('md5');var Redis=require(_0xfa3b('0x4'));var logger=require(_0xfa3b('0x5'))(_0xfa3b('0x6'));var config=require(_0xfa3b('0x7'));config[_0xfa3b('0x8')]=_[_0xfa3b('0x9')](config['redis'],{'host':_0xfa3b('0xa'),'port':0x18eb});var io=require(_0xfa3b('0xb'))(new Redis(config[_0xfa3b('0x8')]));function getAuthToken(_0x3d21d5,_0x30fd81,_0x3d33d9){if(_0x3d21d5['modernAuthentication']){_0x3d21d5[_0xfa3b('0xc')]=_0x3d21d5[_0xfa3b('0xd')][_0xfa3b('0xe')];_0x3d21d5[_0xfa3b('0xf')]=_0x3d21d5[_0xfa3b('0xd')][_0xfa3b('0x10')];return Promise[_0xfa3b('0x11')](_0x3d21d5['CloudProvider'][_0xfa3b('0x12')]);}var _0x11833e={'method':_0xfa3b('0x13'),'uri':_0x30fd81,'form':{'client_id':_0x3d21d5[_0xfa3b('0x14')],'resource':_0x3d21d5[_0xfa3b('0xc')],'username':_0x3d21d5['username'],'password':_0x3d21d5[_0xfa3b('0x15')],'grant_type':_0xfa3b('0x15'),'client_secret':_0x3d21d5['clientSecret']},'json':!![]};return rp(_0x11833e)['then'](function(_0x17ac9b){return _0x17ac9b['access_token'];})[_0xfa3b('0x16')](function(_0x323a94){logger[_0xfa3b('0x17')]('['+[_0x3d33d9[_0xfa3b('0x18')]()]+']\x20Wrong\x20credentials!');return _0x323a94['message'];});}function getUser(_0x2d14f9,_0x17061b,_0x175346,_0x1f8c9e,_0x227900,_0x5185e0){return new Promise(function(_0x527e23,_0x188acd){return getAuthToken(_0x17061b,_0x1f8c9e,_0x5185e0)[_0xfa3b('0x19')](function(_0x3af791){var _0x9734e8={'method':_0xfa3b('0x1a'),'uri':_0x227900+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xfa3b('0x1b')+_0x3af791,'OData-Version':'4.0'},'json':!![]};return rp(_0x9734e8);})[_0xfa3b('0x19')](function(_0x4a2c8b){var _0x34312d=_0x4a2c8b[_0xfa3b('0x1c')];var _0x58faa6=![];var _0x440cb7=null;if(!_[_0xfa3b('0x1d')](_0x175346)){if(intUtil['validateEmail'](_0x175346[_0xfa3b('0x1e')])){_0x2d14f9['userEmail']=_0x175346[_0xfa3b('0x1e')];for(_0x440cb7=0x0;_0x440cb7<_0x34312d['length'];_0x440cb7++){if(_0x34312d[_0x440cb7]['internalemailaddress']===_0x175346['email']&&!_0x34312d[_0x440cb7][_0xfa3b('0x1f')]){_0x58faa6=!![];logger[_0xfa3b('0x20')]('['+[_0x5185e0[_0xfa3b('0x18')]()]+_0xfa3b('0x21')+_0x34312d[_0x440cb7][_0xfa3b('0x22')]+'!');_0x2d14f9[_0xfa3b('0x23')]=_0x34312d[_0x440cb7]['systemuserid'];}}}}if(!_0x58faa6){logger[_0xfa3b('0x20')]('['+[_0x5185e0[_0xfa3b('0x18')]()]+_0xfa3b('0x24'));_0x2d14f9[_0xfa3b('0x25')]=_0x17061b[_0xfa3b('0x26')];for(_0x440cb7=0x0;_0x440cb7<_0x34312d[_0xfa3b('0x27')];_0x440cb7++){if(_0x34312d[_0x440cb7]['internalemailaddress']===_0x17061b[_0xfa3b('0x26')]){_0x2d14f9[_0xfa3b('0x23')]=_0x34312d[_0x440cb7]['systemuserid'];}}}_0x527e23(_0x2d14f9);})['catch'](function(_0x2564aa){_0x188acd(_0x2564aa['message']);});});}function createEndUser(_0x54c99a,_0x5b01c4,_0x7f895d,_0x59d636,_0xcf838a,_0x2c90eb,_0x118f79){return new Promise(function(_0x384c29,_0x3000d9){return getAuthToken(_0x5b01c4,_0x7f895d,_0x2c90eb)[_0xfa3b('0x19')](function(_0x1cf2fe){var _0x2f218a=_0x2c90eb[_0xfa3b('0x28')]()===_0xfa3b('0x29')?_0xcf838a[_0xfa3b('0x2a')]:_0xcf838a[_0xfa3b('0x2b')];var _0x5b7ad1={'method':'POST','uri':_0x59d636+_0xfa3b('0x2c'),'body':{'fullname':_0x2f218a,'firstname':_0x2f218a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfa3b('0x2d')+_0x54c99a[_0xfa3b('0x23')]+')'},'headers':{'Authorization':_0xfa3b('0x1b')+_0x1cf2fe,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x5b7ad1['body'][_0x118f79]=_0x2f218a;return rp(_0x5b7ad1);})[_0xfa3b('0x19')](function(_0x2f8207){var _0x26ef6d=_0x2f8207[_0xfa3b('0x2e')][_0xfa3b('0x2f')];var _0xffb7c7=_0x26ef6d[_0xfa3b('0x30')](_0x26ef6d[_0xfa3b('0x31')]('(')+0x1,_0x26ef6d[_0xfa3b('0x31')](')'));_0x54c99a[_0xfa3b('0x32')]=_0xffb7c7;_0x384c29(_0x54c99a);})[_0xfa3b('0x16')](function(_0x47df92){_0x3000d9(_0x47df92[_0xfa3b('0x33')]);});});}function getEndUser(_0x163357,_0x5ea074,_0x393a4b,_0x15a053,_0x2b3445,_0x1b9ea1,_0x50a69d,_0x56a96d){var _0x2c202b=_0x1b9ea1[_0xfa3b('0x28')]()===_0xfa3b('0x29')?_0x2b3445[_0xfa3b('0x2a')]:_0x2b3445[_0xfa3b('0x2b')];return getAuthToken(_0x5ea074,_0x393a4b,_0x1b9ea1)[_0xfa3b('0x19')](function(_0x1603c5){_0x56a96d=_0x56a96d?_0x56a96d:_0xfa3b('0x34');var _0x2edc11={'method':_0xfa3b('0x1a'),'uri':_0x15a053+_0xfa3b('0x35')+_0x56a96d+_0xfa3b('0x36')+_0x56a96d+_0xfa3b('0x37')+_0x2c202b[_0xfa3b('0x38')]('+',_0xfa3b('0x39'))+'\x27','headers':{'Authorization':_0xfa3b('0x1b')+_0x1603c5,'If-None-Match':null,'OData-Version':_0xfa3b('0x3a')},'json':!![]};return rp(_0x2edc11);})[_0xfa3b('0x19')](function(_0x3ba85f){var _0x5d476d=![];if(!_0x3ba85f)return _0x5d476d;var _0x3e24db=_0x3ba85f[_0xfa3b('0x1c')];for(var _0x6bdb24=0x0;_0x6bdb24<_0x3e24db[_0xfa3b('0x27')];_0x6bdb24++){if(_0x3e24db[_0x6bdb24][_0x56a96d]===_0x2c202b){_0x5d476d=!![];_0x163357[_0xfa3b('0x32')]=_0x3e24db[_0x6bdb24][_0xfa3b('0x3b')];}}return _0x5d476d;})[_0xfa3b('0x19')](function(_0x4c216a){if(_0x4c216a)return _0x163357;if(_0x50a69d===_0xfa3b('0x3c')){logger[_0xfa3b('0x20')]('['+[_0x1b9ea1[_0xfa3b('0x18')]()]+_0xfa3b('0x3d'));return _0x163357;}return createEndUser(_0x163357,_0x5ea074,_0x393a4b,_0x15a053,_0x2b3445,_0x1b9ea1,_0x56a96d)[_0xfa3b('0x19')](function(_0x43143d){logger['info']('['+[_0x1b9ea1['toUpperCase']()]+_0xfa3b('0x3e'),_0x43143d['enduserId']);return _0x43143d;});});}function getCustomFields(_0x1e17e4,_0x30fca0,_0x1e2548){var _0x375da8={};if(_0x1e17e4[_0xfa3b('0x27')]>0x0){_['forEach'](_0x1e17e4,function(_0x2ce005){if(_[_0xfa3b('0x3f')]([_0xfa3b('0x40'),_0xfa3b('0x41')],_0x2ce005[_0xfa3b('0x42')])&&_0x2ce005[_0xfa3b('0x43')]&&!_0x2ce005['customField']){var _0x384096=_0x2ce005[_0xfa3b('0x44')]['toLowerCase']();var _0x5cff2d=_0x384096[_0xfa3b('0x30')](0x0,_0x384096[_0xfa3b('0x45')]('_'));var _0x473970=_0x384096['substring'](_0x384096[_0xfa3b('0x45')]('_')+0x1);if(_0x5cff2d===_0x1e2548){_0x375da8[_0x473970]=_0x2ce005['content'];}}});}return _0x375da8;}function getTicket(_0x1db79c,_0x5933a3,_0x2619c2,_0x49d05b,_0x306b8d,_0x2aa38a,_0x5b8b27){return new Promise(function(_0x4d08c2,_0x274d24){var _0x125ab6;return getAuthToken(_0x5933a3,_0x2619c2,_0x5b8b27)[_0xfa3b('0x19')](function(_0x15c993){if(_0x2aa38a[_0xfa3b('0x46')]===_0xfa3b('0x47')){_0x125ab6={'method':_0xfa3b('0x13'),'uri':_0x49d05b+_0xfa3b('0x48'),'body':Object['assign']({},{'title':intUtil['getString'](_0x2aa38a['Subjects'],_0x306b8d,'\x20'),'description':intUtil[_0xfa3b('0x49')](_0x2aa38a['Descriptions'],_0x306b8d,'\x0a'),'customerid_contact@odata.bind':_0x1db79c[_0xfa3b('0x32')]?_0xfa3b('0x4a')+_0x1db79c['enduserId']+')':undefined,'ownerid@odata.bind':_0xfa3b('0x2d')+_0x1db79c[_0xfa3b('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x2aa38a[_0xfa3b('0x4b')],_0x306b8d,_0x2aa38a[_0xfa3b('0x46')])),'headers':{'Authorization':_0xfa3b('0x1b')+_0x15c993,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2aa38a['ticketType']===_0xfa3b('0x4c')){var _0x376901=_0x1db79c[_0xfa3b('0x32')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1db79c[_0xfa3b('0x23')]+')','participationtypemask':_0x1db79c[_0xfa3b('0x4d')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xfa3b('0x4a')+_0x1db79c['enduserId']+')','participationtypemask':_0x1db79c[_0xfa3b('0x4d')]===_0xfa3b('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfa3b('0x2d')+_0x1db79c[_0xfa3b('0x23')]+')','participationtypemask':_0x1db79c[_0xfa3b('0x4d')]===_0xfa3b('0x4e')?0x2:0x1}];_0x125ab6={'method':_0xfa3b('0x13'),'uri':_0x49d05b+_0xfa3b('0x4f'),'body':Object[_0xfa3b('0x50')]({},{'subject':intUtil[_0xfa3b('0x49')](_0x2aa38a[_0xfa3b('0x51')],_0x306b8d,'\x20'),'phonenumber':String(_0x306b8d[_0xfa3b('0x2b')]),'description':intUtil['getString'](_0x2aa38a[_0xfa3b('0x52')],_0x306b8d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1db79c[_0xfa3b('0x32')]?_0xfa3b('0x4a')+_0x1db79c[_0xfa3b('0x32')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x1db79c['userId']+')','directioncode':_0x1db79c['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x376901},getCustomFields(_0x2aa38a[_0xfa3b('0x4b')],_0x306b8d,_0x2aa38a[_0xfa3b('0x46')])),'headers':{'Authorization':_0xfa3b('0x1b')+_0x15c993,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x125ab6);})[_0xfa3b('0x19')](function(_0x5db685){var _0x497066=_0x5db685['headers']['odata-entityid'];var _0x2bc7bc=_0x497066[_0xfa3b('0x30')](_0x497066['lastIndexOf']('(')+0x1,_0x497066[_0xfa3b('0x31')](')'));_0x1db79c['ticketId']=_0x2bc7bc;_0x4d08c2(_0x1db79c);})[_0xfa3b('0x16')](function(_0x17faa9){_0x274d24(_0x17faa9[_0xfa3b('0x33')]);});});}function emit(_0x1a7876,_0x44f056,_0x252876,_0xf8f346){var _0x553de7={'uri':util[_0xfa3b('0x53')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x1a7876,_0x252876,_0xf8f346)};io['to'](util[_0xfa3b('0x53')](_0xfa3b('0x54'),_0x44f056))['emit'](_0xfa3b('0x55'),_0x553de7);}exports['cs']=function(_0x2b2dfb,_0x59b8f8,_0x512f79,_0x27e4dd,_0x57ab20,_0x3577e3,_0x28c7fd,_0x129339){var _0x4c54ac={};_0x3577e3[_0xfa3b('0xc')]=_0x3577e3[_0xfa3b('0x56')]?intUtil[_0xfa3b('0x57')](_0x3577e3[_0xfa3b('0xd')][_0xfa3b('0xe')]):intUtil['stripTrailingSlash'](_0x3577e3['remoteUri']);_0x3577e3[_0xfa3b('0x58')]=intUtil[_0xfa3b('0x57')](_0x3577e3[_0xfa3b('0x58')]);_0x4c54ac[_0xfa3b('0x4d')]=_0x129339===_0xfa3b('0x4e')||_0x129339===_0xfa3b('0x59')?_0xfa3b('0x4e'):'outbound';var _0x243b85=_0x3577e3[_0xfa3b('0x56')]?util[_0xfa3b('0x53')]('%s/api/data/v9.0/',_0x3577e3[_0xfa3b('0xd')]['data7']):util[_0xfa3b('0x53')]('%s/api/data/v9.0/',_0x3577e3[_0xfa3b('0xc')]);var _0x5ac7d3=util[_0xfa3b('0x53')](_0xfa3b('0x5a'),_0x3577e3[_0xfa3b('0xf')]);var _0x5cde58=util[_0xfa3b('0x53')](_0xfa3b('0x5b'),_0x3577e3[_0xfa3b('0x58')],_0x59b8f8[_0xfa3b('0x5c')],md5(_0x59b8f8[_0xfa3b('0x5c')]));if(_0x57ab20&&_0x57ab20[_0xfa3b('0x5d')]){logger['info'](_0xfa3b('0x5e'),_0xfa3b('0x5f'));_0x59b8f8[_0xfa3b('0x60')]=_0x5cde58;}else if(_0x28c7fd&&_0x28c7fd[_0xfa3b('0x61')]&&_0x28c7fd[_0xfa3b('0x61')]!==_0xfa3b('0x62')){logger[_0xfa3b('0x20')]('[OUTBOUND]',_0xfa3b('0x5f'));_0x59b8f8['recordingURL']=_0x5cde58;}else{_0x59b8f8[_0xfa3b('0x60')]='';}return getUser(_0x4c54ac,_0x3577e3,_0x27e4dd,_0x5ac7d3,_0x243b85,_0x129339)['then'](function(_0x5ed6a5){logger['info']('['+_0x129339[_0xfa3b('0x18')]()+_0xfa3b('0x63'),_0x5ed6a5[_0xfa3b('0x23')]);logger[_0xfa3b('0x20')]('['+_0x129339[_0xfa3b('0x18')]()+_0xfa3b('0x64'),_0x5ed6a5[_0xfa3b('0x25')]);return getEndUser(_0x5ed6a5,_0x3577e3,_0x5ac7d3,_0x243b85,_0x59b8f8,_0x129339,_0x512f79[_0xfa3b('0x65')],_0x512f79[_0xfa3b('0x66')]);})[_0xfa3b('0x19')](function(_0x1bc9d8){logger[_0xfa3b('0x20')]('['+_0x129339['toUpperCase']()+_0xfa3b('0x67'),_0x1bc9d8[_0xfa3b('0x32')]);logger['info']('['+_0x129339[_0xfa3b('0x18')]()+_0xfa3b('0x68'),_0x59b8f8['calleridnum']);return getTicket(_0x1bc9d8,_0x3577e3,_0x5ac7d3,_0x243b85,_0x59b8f8,_0x512f79,_0x129339);})[_0xfa3b('0x19')](function(_0x1c6ab6){logger[_0xfa3b('0x20')](util[_0xfa3b('0x53')]('['+_0x129339[_0xfa3b('0x18')]()+_0xfa3b('0x69'),_0x512f79[_0xfa3b('0x46')],_0x1c6ab6[_0xfa3b('0x6a')]));logger[_0xfa3b('0x20')](util[_0xfa3b('0x53')]('['+_0x129339['toUpperCase']()+_0xfa3b('0x6b'),_0x129339));if(_0x129339!==_0xfa3b('0x59')&&_0x512f79[_0xfa3b('0x6c')]){logger[_0xfa3b('0x20')]('['+_0x129339[_0xfa3b('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3577e3[_0xfa3b('0xc')],_0x27e4dd[_0xfa3b('0x6d')],_0x512f79[_0xfa3b('0x46')],_0x1c6ab6[_0xfa3b('0x6a')]);}})[_0xfa3b('0x16')](function(_0x563f44){logger[_0xfa3b('0x17')]('['+_0x129339[_0xfa3b('0x18')]()+_0xfa3b('0x6e'),_0x563f44[_0xfa3b('0x33')]);console[_0xfa3b('0x17')]('Error\x20running\x20Dynamics365\x20integration',_0x563f44);});}; \ No newline at end of file +var _0x4b38=['recordingFormat','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','userEmail','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','data5','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','message','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','lastIndexOf','enduserId','outbound','GET','contacts?$select=','\x20eq\x20\x27','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','nameField','customField','idField','substring','indexOf','content','incident','POST','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL'];(function(_0x40be59,_0x752493){var _0x3f6047=function(_0x75215a){while(--_0x75215a){_0x40be59['push'](_0x40be59['shift']());}};_0x3f6047(++_0x752493);}(_0x4b38,0x1b9));var _0x84b3=function(_0x3671ce,_0x1d2539){_0x3671ce=_0x3671ce-0x0;var _0x2c6c2b=_0x4b38[_0x3671ce];return _0x2c6c2b;};'use strict';var _=require(_0x84b3('0x0'));var rp=require('request-promise');var util=require(_0x84b3('0x1'));var intUtil=require(_0x84b3('0x2'));var md5=require(_0x84b3('0x3'));var Redis=require(_0x84b3('0x4'));var logger=require(_0x84b3('0x5'))(_0x84b3('0x6'));var config=require(_0x84b3('0x7'));config[_0x84b3('0x8')]=_['defaults'](config['redis'],{'host':_0x84b3('0x9'),'port':0x18eb});var io=require(_0x84b3('0xa'))(new Redis(config[_0x84b3('0x8')]));function getAuthToken(_0x212722,_0x1281e7,_0x27aba1){if(_0x212722[_0x84b3('0xb')]){_0x212722['remoteUri']=_0x212722[_0x84b3('0xc')][_0x84b3('0xd')];_0x212722[_0x84b3('0xe')]=_0x212722[_0x84b3('0xc')][_0x84b3('0xf')];return Promise[_0x84b3('0x10')](_0x212722['CloudProvider'][_0x84b3('0x11')]);}var _0x54b379={'method':'POST','uri':_0x1281e7,'form':{'client_id':_0x212722[_0x84b3('0x12')],'resource':_0x212722['remoteUri'],'username':_0x212722[_0x84b3('0x13')],'password':_0x212722[_0x84b3('0x14')],'grant_type':_0x84b3('0x14'),'client_secret':_0x212722['clientSecret']},'json':!![]};return rp(_0x54b379)[_0x84b3('0x15')](function(_0xe5fd04){return _0xe5fd04[_0x84b3('0x16')];})[_0x84b3('0x17')](function(_0xbb8009){logger[_0x84b3('0x18')]('['+[_0x27aba1[_0x84b3('0x19')]()]+_0x84b3('0x1a'));return _0xbb8009['message'];});}function getUser(_0x599466,_0xd2c062,_0x2ec459,_0x22e5ec,_0x5d137e,_0x35417a){return new Promise(function(_0x4a4017,_0x22228d){return getAuthToken(_0xd2c062,_0x22e5ec,_0x35417a)[_0x84b3('0x15')](function(_0x50210e){var _0x4df9d5={'method':'GET','uri':_0x5d137e+_0x84b3('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x50210e,'OData-Version':_0x84b3('0x1c')},'json':!![]};return rp(_0x4df9d5);})[_0x84b3('0x15')](function(_0x442fc6){var _0x415cac=_0x442fc6[_0x84b3('0x1d')];var _0x132dbe=![];var _0x31b77e=null;if(!_[_0x84b3('0x1e')](_0x2ec459)){if(intUtil['validateEmail'](_0x2ec459[_0x84b3('0x1f')])){_0x599466['userEmail']=_0x2ec459[_0x84b3('0x1f')];for(_0x31b77e=0x0;_0x31b77e<_0x415cac[_0x84b3('0x20')];_0x31b77e++){if(_0x415cac[_0x31b77e][_0x84b3('0x21')]===_0x2ec459[_0x84b3('0x1f')]&&!_0x415cac[_0x31b77e]['isdisabled']){_0x132dbe=!![];logger[_0x84b3('0x22')]('['+[_0x35417a[_0x84b3('0x19')]()]+_0x84b3('0x23')+_0x415cac[_0x31b77e][_0x84b3('0x24')]+'!');_0x599466[_0x84b3('0x25')]=_0x415cac[_0x31b77e][_0x84b3('0x24')];}}}}if(!_0x132dbe){logger[_0x84b3('0x22')]('['+[_0x35417a[_0x84b3('0x19')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x599466['userEmail']=_0xd2c062[_0x84b3('0x13')];for(_0x31b77e=0x0;_0x31b77e<_0x415cac[_0x84b3('0x20')];_0x31b77e++){if(_0x415cac[_0x31b77e][_0x84b3('0x21')]===_0xd2c062[_0x84b3('0x13')]){_0x599466['userId']=_0x415cac[_0x31b77e][_0x84b3('0x24')];}}}_0x4a4017(_0x599466);})[_0x84b3('0x17')](function(_0x15e037){_0x22228d(_0x15e037[_0x84b3('0x26')]);});});}function createEndUser(_0x19f853,_0x3ceba1,_0x4a4b6,_0x265dc1,_0x2339e1,_0x3da80e,_0x5ed16a){return new Promise(function(_0x63cc7d,_0x278a63){return getAuthToken(_0x3ceba1,_0x4a4b6,_0x3da80e)[_0x84b3('0x15')](function(_0x4d3a60){var _0x513e46=_0x3da80e[_0x84b3('0x27')]()==='outbound'?_0x2339e1[_0x84b3('0x28')]:_0x2339e1[_0x84b3('0x29')];var _0x22b30e={'method':'POST','uri':_0x265dc1+_0x84b3('0x2a'),'body':{'fullname':_0x513e46,'firstname':_0x513e46,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x84b3('0x2b')+_0x19f853['userId']+')'},'headers':{'Authorization':_0x84b3('0x2c')+_0x4d3a60,'OData-Version':_0x84b3('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x22b30e['body'][_0x5ed16a]=_0x513e46;return rp(_0x22b30e);})[_0x84b3('0x15')](function(_0x51fb13){var _0x1c7362=_0x51fb13[_0x84b3('0x2d')][_0x84b3('0x2e')];var _0x36b3d2=_0x1c7362['substring'](_0x1c7362[_0x84b3('0x2f')]('(')+0x1,_0x1c7362[_0x84b3('0x2f')](')'));_0x19f853[_0x84b3('0x30')]=_0x36b3d2;_0x63cc7d(_0x19f853);})[_0x84b3('0x17')](function(_0x4ebb6e){_0x278a63(_0x4ebb6e['message']);});});}function getEndUser(_0x1665c5,_0xcf5654,_0x4e2581,_0x5b10ac,_0x46f224,_0x2cb5d8,_0x445103,_0x112249){var _0x5067ab=_0x2cb5d8[_0x84b3('0x27')]()===_0x84b3('0x31')?_0x46f224[_0x84b3('0x28')]:_0x46f224['calleridnum'];return getAuthToken(_0xcf5654,_0x4e2581,_0x2cb5d8)[_0x84b3('0x15')](function(_0x49b904){_0x112249=_0x112249?_0x112249:'telephone1';var _0x4bcdec={'method':_0x84b3('0x32'),'uri':_0x5b10ac+_0x84b3('0x33')+_0x112249+'&$filter='+_0x112249+_0x84b3('0x34')+_0x5067ab['replace']('+',_0x84b3('0x35'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x49b904,'If-None-Match':null,'OData-Version':_0x84b3('0x1c')},'json':!![]};return rp(_0x4bcdec);})['then'](function(_0x3e0f2f){var _0x549948=![];if(!_0x3e0f2f)return _0x549948;var _0x51fc5a=_0x3e0f2f[_0x84b3('0x1d')];for(var _0xbc5ad9=0x0;_0xbc5ad9<_0x51fc5a['length'];_0xbc5ad9++){if(_0x51fc5a[_0xbc5ad9][_0x112249]===_0x5067ab){_0x549948=!![];_0x1665c5['enduserId']=_0x51fc5a[_0xbc5ad9][_0x84b3('0x36')];}}return _0x549948;})[_0x84b3('0x15')](function(_0x5f3559){if(_0x5f3559)return _0x1665c5;if(_0x445103===_0x84b3('0x37')){logger[_0x84b3('0x22')]('['+[_0x2cb5d8[_0x84b3('0x19')]()]+_0x84b3('0x38'));return _0x1665c5;}return createEndUser(_0x1665c5,_0xcf5654,_0x4e2581,_0x5b10ac,_0x46f224,_0x2cb5d8,_0x112249)[_0x84b3('0x15')](function(_0x2978af){logger[_0x84b3('0x22')]('['+[_0x2cb5d8['toUpperCase']()]+_0x84b3('0x39'),_0x2978af['enduserId']);return _0x2978af;});});}function getCustomFields(_0x4aaa99,_0x5adc9e,_0x57a807){var _0x2ee570={};if(_0x4aaa99[_0x84b3('0x20')]>0x0){_[_0x84b3('0x3a')](_0x4aaa99,function(_0x43e19a){if(_['includes']([_0x84b3('0x3b'),_0x84b3('0x3c')],_0x43e19a[_0x84b3('0x3d')])&&_0x43e19a[_0x84b3('0x3e')]&&!_0x43e19a[_0x84b3('0x3f')]){var _0x376911=_0x43e19a[_0x84b3('0x40')][_0x84b3('0x27')]();var _0x1c4c79=_0x376911[_0x84b3('0x41')](0x0,_0x376911['indexOf']('_'));var _0x2d42bf=_0x376911[_0x84b3('0x41')](_0x376911[_0x84b3('0x42')]('_')+0x1);if(_0x1c4c79===_0x57a807){_0x2ee570[_0x2d42bf]=_0x43e19a[_0x84b3('0x43')];}}});}return _0x2ee570;}function getTicket(_0x5a0035,_0x317fad,_0x27da6f,_0x28fb12,_0x237549,_0x3829af,_0x5175b4){return new Promise(function(_0x4d744d,_0x24042d){var _0x5bb2f9;return getAuthToken(_0x317fad,_0x27da6f,_0x5175b4)[_0x84b3('0x15')](function(_0x18c2a6){if(_0x3829af['ticketType']===_0x84b3('0x44')){_0x5bb2f9={'method':_0x84b3('0x45'),'uri':_0x28fb12+_0x84b3('0x46'),'body':Object[_0x84b3('0x47')]({},{'title':intUtil[_0x84b3('0x48')](_0x3829af[_0x84b3('0x49')],_0x237549,'\x20'),'description':intUtil[_0x84b3('0x48')](_0x3829af[_0x84b3('0x4a')],_0x237549,'\x0a'),'customerid_contact@odata.bind':_0x5a0035[_0x84b3('0x30')]?_0x84b3('0x4b')+_0x5a0035[_0x84b3('0x30')]+')':undefined,'ownerid@odata.bind':_0x84b3('0x2b')+_0x5a0035[_0x84b3('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3829af[_0x84b3('0x4c')],_0x237549,_0x3829af[_0x84b3('0x4d')])),'headers':{'Authorization':_0x84b3('0x2c')+_0x18c2a6,'OData-Version':_0x84b3('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3829af[_0x84b3('0x4d')]==='phonecall'){var _0x510dc5=_0x5a0035[_0x84b3('0x30')]?[{'partyid_systemuser@odata.bind':_0x84b3('0x2b')+_0x5a0035['userId']+')','participationtypemask':_0x5a0035[_0x84b3('0x4e')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x84b3('0x4b')+_0x5a0035[_0x84b3('0x30')]+')','participationtypemask':_0x5a0035[_0x84b3('0x4e')]===_0x84b3('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x5a0035[_0x84b3('0x25')]+')','participationtypemask':_0x5a0035[_0x84b3('0x4e')]===_0x84b3('0x4f')?0x2:0x1}];_0x5bb2f9={'method':'POST','uri':_0x28fb12+'phonecalls','body':Object[_0x84b3('0x47')]({},{'subject':intUtil[_0x84b3('0x48')](_0x3829af['Subjects'],_0x237549,'\x20'),'phonenumber':String(_0x237549[_0x84b3('0x29')]),'description':intUtil[_0x84b3('0x48')](_0x3829af[_0x84b3('0x4a')],_0x237549,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5a0035[_0x84b3('0x30')]?_0x84b3('0x4b')+_0x5a0035[_0x84b3('0x30')]+')':undefined,'ownerid@odata.bind':_0x84b3('0x2b')+_0x5a0035[_0x84b3('0x25')]+')','directioncode':_0x5a0035[_0x84b3('0x4e')]==='queue'?![]:!![],'phonecall_activity_parties':_0x510dc5},getCustomFields(_0x3829af[_0x84b3('0x4c')],_0x237549,_0x3829af[_0x84b3('0x4d')])),'headers':{'Authorization':_0x84b3('0x2c')+_0x18c2a6,'OData-Version':_0x84b3('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5bb2f9);})[_0x84b3('0x15')](function(_0xabce5b){var _0x1a3108=_0xabce5b[_0x84b3('0x2d')]['odata-entityid'];var _0x3cdb9c=_0x1a3108[_0x84b3('0x41')](_0x1a3108[_0x84b3('0x2f')]('(')+0x1,_0x1a3108[_0x84b3('0x2f')](')'));_0x5a0035['ticketId']=_0x3cdb9c;_0x4d744d(_0x5a0035);})['catch'](function(_0x1b9456){_0x24042d(_0x1b9456[_0x84b3('0x26')]);});});}function emit(_0x13ba7f,_0x3cfdd4,_0x20103a,_0x482c66){var _0x2c3997={'uri':util[_0x84b3('0x50')](_0x84b3('0x51'),_0x13ba7f,_0x20103a,_0x482c66)};io['to'](util['format'](_0x84b3('0x52'),_0x3cfdd4))['emit'](_0x84b3('0x53'),_0x2c3997);}exports['cs']=function(_0x307b5d,_0x9ae43e,_0x42b957,_0x34e01f,_0x2e3704,_0x58385d,_0x4deadf,_0x8af22){var _0x48022e={};_0x58385d[_0x84b3('0x54')]=_0x58385d[_0x84b3('0xb')]?intUtil[_0x84b3('0x55')](_0x58385d[_0x84b3('0xc')]['data7']):intUtil[_0x84b3('0x55')](_0x58385d[_0x84b3('0x54')]);_0x58385d[_0x84b3('0x56')]=intUtil[_0x84b3('0x55')](_0x58385d[_0x84b3('0x56')]);_0x48022e['callDirection']=_0x8af22===_0x84b3('0x4f')||_0x8af22===_0x84b3('0x57')?_0x84b3('0x4f'):_0x84b3('0x31');var _0x53ad6c=_0x58385d[_0x84b3('0xb')]?util[_0x84b3('0x50')](_0x84b3('0x58'),_0x58385d[_0x84b3('0xc')][_0x84b3('0xd')]):util[_0x84b3('0x50')](_0x84b3('0x58'),_0x58385d[_0x84b3('0x54')]);var _0x17fa8a=util[_0x84b3('0x50')](_0x84b3('0x59'),_0x58385d[_0x84b3('0xe')]);var _0x366886=util[_0x84b3('0x50')](_0x84b3('0x5a'),_0x58385d['serverUrl'],_0x9ae43e[_0x84b3('0x5b')],md5(_0x9ae43e[_0x84b3('0x5b')]));if(_0x2e3704&&_0x2e3704[_0x84b3('0x5c')]){logger[_0x84b3('0x22')]('[QUEUE]','Recording\x20is\x20enabled!');_0x9ae43e[_0x84b3('0x5d')]=_0x366886;}else if(_0x4deadf&&_0x4deadf[_0x84b3('0x5e')]&&_0x4deadf[_0x84b3('0x5e')]!=='none'){logger[_0x84b3('0x22')]('[OUTBOUND]',_0x84b3('0x5f'));_0x9ae43e[_0x84b3('0x5d')]=_0x366886;}else{_0x9ae43e['recordingURL']='';}return getUser(_0x48022e,_0x58385d,_0x34e01f,_0x17fa8a,_0x53ad6c,_0x8af22)[_0x84b3('0x15')](function(_0x571096){logger[_0x84b3('0x22')]('['+_0x8af22[_0x84b3('0x19')]()+_0x84b3('0x60'),_0x571096[_0x84b3('0x25')]);logger[_0x84b3('0x22')]('['+_0x8af22[_0x84b3('0x19')]()+']\x20The\x20User\x20email\x20is:',_0x571096[_0x84b3('0x61')]);return getEndUser(_0x571096,_0x58385d,_0x17fa8a,_0x53ad6c,_0x9ae43e,_0x8af22,_0x42b957['moduleCreate'],_0x42b957[_0x84b3('0x62')]);})[_0x84b3('0x15')](function(_0x3bf4fc){logger[_0x84b3('0x22')]('['+_0x8af22[_0x84b3('0x19')]()+_0x84b3('0x63'),_0x3bf4fc[_0x84b3('0x30')]);logger[_0x84b3('0x22')]('['+_0x8af22[_0x84b3('0x19')]()+_0x84b3('0x64'),_0x9ae43e[_0x84b3('0x29')]);return getTicket(_0x3bf4fc,_0x58385d,_0x17fa8a,_0x53ad6c,_0x9ae43e,_0x42b957,_0x8af22);})[_0x84b3('0x15')](function(_0x43d204){logger[_0x84b3('0x22')](util[_0x84b3('0x50')]('['+_0x8af22[_0x84b3('0x19')]()+_0x84b3('0x65'),_0x42b957[_0x84b3('0x4d')],_0x43d204[_0x84b3('0x66')]));logger['info'](util[_0x84b3('0x50')]('['+_0x8af22['toUpperCase']()+_0x84b3('0x67'),_0x8af22));if(_0x8af22!==_0x84b3('0x57')&&_0x42b957[_0x84b3('0x68')]){logger['info']('['+_0x8af22['toUpperCase']()+']',_0x84b3('0x69'));emit(_0x58385d[_0x84b3('0x54')],_0x34e01f['name'],_0x42b957[_0x84b3('0x4d')],_0x43d204['ticketId']);}})[_0x84b3('0x17')](function(_0x33005e){logger['error']('['+_0x8af22[_0x84b3('0x19')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x33005e[_0x84b3('0x26')]);console[_0x84b3('0x18')](_0x84b3('0x6a'),_0x33005e);});}; \ 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 1326b24..fb4fc46 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 _0x8032=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','stripTrailingSlash','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','error','unmanaged','toUpperCase','calleridnum','lastevent','lodash','request-promise','md5','util','ioredis','./util','freshdesk','localhost','redis','application/json','info','merge','format','calleridname','getString','Descriptions','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','stringify','defaults','map','includes','type','nameField','toLowerCase','content','toString','string','customField','push','idField','variable','variableName','customVariable','Variable','name','serverUrl','monitor_format','Recording\x20is\x20enabled!'];(function(_0x100dc5,_0xc853e9){var _0x1dc4f6=function(_0x2d4017){while(--_0x2d4017){_0x100dc5['push'](_0x100dc5['shift']());}};_0x1dc4f6(++_0xc853e9);}(_0x8032,0x67));var _0x2803=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x8032[_0x5d07ff];return _0x5226ad;};'use strict';var _=require(_0x2803('0x0'));var rp=require(_0x2803('0x1'));var md5=require(_0x2803('0x2'));var util=require(_0x2803('0x3'));var Redis=require(_0x2803('0x4'));var intUtil=require(_0x2803('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x2803('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x2803('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2803('0x8')]));var headers={'Content-Type':_0x2803('0x9'),'Accept':'application/json'};function emit(_0x5949f8,_0x56d498,_0xc6ab5e){io['to'](_0x5949f8)['emit'](_0x56d498,_0xc6ab5e);}function getTicket(_0x5d00c6,_0x425f9e,_0x27a135,_0x39e145,_0x710e53){logger[_0x2803('0xa')]('Creating\x20new\x20ticket...');var _0x5366f4=_[_0x2803('0xb')]({'responder_id':_0x425f9e['id'],'requester_id':_0x27a135['id'],'name':util[_0x2803('0xc')]('Caller\x20-\x20%s',_0x710e53[_0x2803('0xd')]),'phone':_0x710e53['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2803('0xe')](_0x39e145['Subjects'],_0x710e53,'\x20'),'description':intUtil[_0x2803('0xe')](_0x39e145[_0x2803('0xf')],_0x710e53,'
'),'tags':getTags(_0x39e145['Tags'],'name')},getCustomFields(_0x39e145[_0x2803('0x10')],_0x710e53));_0x5366f4[_0x2803('0x11')]=_[_0x2803('0x12')](_[_0x2803('0x13')](_0x5366f4[_0x2803('0x11')],'id'),_0x2803('0x14'));return request({'uri':util[_0x2803('0xc')](_0x2803('0x15'),_0x5d00c6[_0x2803('0x16')]),'method':_0x2803('0x17'),'body':_0x5366f4})[_0x2803('0x18')](function(_0x523173){logger[_0x2803('0xa')](_0x2803('0x19'));return _0x523173;});}function getUser(_0x28be5c,_0x5e5780){if(intUtil[_0x2803('0x1a')](_0x5e5780)){return request({'uri':util[_0x2803('0xc')](_0x2803('0x1b'),_0x28be5c['remoteUri']),'qs':{'email':_0x5e5780}})[_0x2803('0x18')](function(_0x6923d5){if(_0x6923d5[_0x2803('0x1c')]){logger[_0x2803('0xa')](_0x2803('0x1d'));return _[_0x2803('0x1e')](_0x6923d5,function(_0x180417){return _0x180417['contact'][_0x2803('0x1f')]===_0x5e5780;});}else{logger[_0x2803('0xa')](_0x2803('0x20'));return request({'uri':util[_0x2803('0xc')]('%s/api/v2/agents/me',_0x28be5c[_0x2803('0x16')])})[_0x2803('0x18')](function(_0x2b58f8){logger[_0x2803('0xa')](_0x2803('0x21'));return _0x2b58f8;});}});}else{logger[_0x2803('0xa')](_0x2803('0x22'));return request({'uri':util[_0x2803('0xc')](_0x2803('0x23'),_0x28be5c[_0x2803('0x16')])})[_0x2803('0x18')](function(_0x23f897){logger['info'](_0x2803('0x21'));return _0x23f897;});}}function getEndUser(_0x78f736,_0x4268c4,_0x2b6a8c){logger[_0x2803('0xa')](_0x2803('0x24'),_0x2b6a8c);return request({'uri':util[_0x2803('0xc')](_0x2803('0x25'),_0x78f736[_0x2803('0x16')]),'qs':{'phone':_0x2b6a8c}})[_0x2803('0x18')](function(_0x17a873){if(_0x17a873[_0x2803('0x1c')]){logger['info'](_0x2803('0x26'));return _[_0x2803('0x1e')](_0x17a873,{'phone':_0x2b6a8c});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x2803('0xc')](_0x2803('0x25'),_0x78f736[_0x2803('0x16')]),'method':_0x2803('0x17'),'body':{'name':_0x4268c4,'phone':_0x2b6a8c}})[_0x2803('0x18')](function(_0x15ab35){logger[_0x2803('0xa')](_0x2803('0x27'));return _0x15ab35;});}});}function getAuth(_0x2e7601){return util['format'](_0x2803('0x28'),new Buffer(_0x2e7601[_0x2803('0x29')]+':X')['toString']('base64'));}function request(_0x8c10e4){logger['debug']('[HTTP]',JSON[_0x2803('0x2a')](_0x8c10e4));return rp(_[_0x2803('0x2b')](_0x8c10e4,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1a2e0f,_0x472e39){var _0x45b0ba=[];if(_0x1a2e0f&&_0x1a2e0f[_0x2803('0x1c')]>0x0){_0x45b0ba=_[_0x2803('0x2c')](_0x1a2e0f,_0x472e39);}return _0x45b0ba;}function getCustomFields(_0x46296d,_0x3a9845){var _0x4e938e=[];var _0x4e6fb4={'custom_fields':[]};if(_0x46296d[_0x2803('0x1c')]>0x0){_['forEach'](_0x46296d,function(_0x3e38cb){if(_[_0x2803('0x2d')](['string','picklist'],_0x3e38cb[_0x2803('0x2e')])&&_0x3e38cb[_0x2803('0x2f')]&&!_0x3e38cb['customField']){_0x4e6fb4[_0x3e38cb[_0x2803('0x2f')][_0x2803('0x30')]()]=_0x3e38cb[_0x2803('0x31')][_0x2803('0x32')]();}else if(_[_0x2803('0x2d')]([_0x2803('0x33'),'picklist'],_0x3e38cb[_0x2803('0x2e')])&&_0x3e38cb['idField']&&_0x3e38cb[_0x2803('0x34')]){_0x4e6fb4[_0x2803('0x11')][_0x2803('0x35')]({'id':_0x3e38cb[_0x2803('0x36')],'value':_0x3e38cb[_0x2803('0x31')]['toString']()});}else if(_0x3e38cb[_0x2803('0x2e')]===_0x2803('0x37')&&_0x3e38cb[_0x2803('0x38')]&&_0x3e38cb['idField']&&_0x3e38cb[_0x2803('0x34')]){_0x3a9845[_0x3e38cb[_0x2803('0x38')]]&&_0x4e6fb4['custom_fields'][_0x2803('0x35')]({'id':_0x3e38cb[_0x2803('0x36')],'value':_0x3a9845[_0x3e38cb[_0x2803('0x38')]]['toString']()});}else if(_0x3e38cb[_0x2803('0x2e')]===_0x2803('0x39')&&_0x3e38cb[_0x2803('0x3a')]&&_0x3e38cb[_0x2803('0x3a')][_0x2803('0x3b')]&&_0x3e38cb[_0x2803('0x36')]&&_0x3e38cb['customField']){_0x3a9845[_0x3e38cb['Variable'][_0x2803('0x3b')][_0x2803('0x30')]()]&&_0x4e6fb4[_0x2803('0x11')][_0x2803('0x35')]({'id':_0x3e38cb[_0x2803('0x36')],'value':_0x3a9845[_0x3e38cb[_0x2803('0x3a')][_0x2803('0x3b')][_0x2803('0x30')]()][_0x2803('0x32')]()});}});}return _0x4e6fb4;}exports['queue']=function(_0x432085,_0x3d8c0e,_0x93c58e,_0x2d611f,_0x355432,_0x5c9e2c){var _0x433b15,_0x3a7f66;_0x5c9e2c[_0x2803('0x16')]=intUtil['stripTrailingSlash'](_0x5c9e2c[_0x2803('0x16')]);_0x5c9e2c[_0x2803('0x3c')]=intUtil['stripTrailingSlash'](_0x5c9e2c[_0x2803('0x3c')]);if(_0x355432&&_0x355432[_0x2803('0x3d')]){logger['info']('[QUEUE]',_0x2803('0x3e'));_0x3d8c0e['recordingURL']=util[_0x2803('0xc')](_0x2803('0x3f'),_0x5c9e2c[_0x2803('0x3c')],_0x3d8c0e[_0x2803('0x40')],md5(_0x3d8c0e['uniqueid']));}else{_0x3d8c0e['recordingURL']='';}headers[_0x2803('0x41')]=getAuth(_0x5c9e2c);return getUser(_0x5c9e2c,_0x2d611f[_0x2803('0x1f')])[_0x2803('0x18')](function(_0x1911b8){_0x433b15=_0x1911b8;logger['info']('The\x20User\x20ID\x20is:',_0x433b15['id']);return getEndUser(_0x5c9e2c,_0x3d8c0e[_0x2803('0xd')],_0x3d8c0e['calleridnum']);})[_0x2803('0x18')](function(_0x176992){_0x3a7f66=_0x176992;logger[_0x2803('0xa')](_0x2803('0x42'),_0x3a7f66['id']);return getTicket(_0x5c9e2c,_0x433b15,_0x3a7f66,_0x93c58e,_0x3d8c0e);})[_0x2803('0x18')](function(_0x3804ed){if(_0x3804ed&&_0x3804ed['id']){logger['info']('Ticket\x20created!');logger[_0x2803('0xa')](_0x2803('0x43'),_0x3804ed['id']);logger[_0x2803('0xa')]('[QUEUE]',_0x2803('0x44'));emit(util[_0x2803('0xc')](_0x2803('0x45'),_0x2d611f[_0x2803('0x3b')]),_0x2803('0x46'),{'uri':util[_0x2803('0xc')](_0x2803('0x47'),_0x5c9e2c[_0x2803('0x16')],_0x3804ed['id'])});}})[_0x2803('0x48')](function(_0x4a36db){logger['error']('[QUEUE]',JSON[_0x2803('0x2a')](_0x4a36db));});};exports['outbound']=function(_0x129d2f,_0x169dc6,_0x62de18,_0x4c40de,_0x3e059a,_0x5675b4,_0x19ad05){var _0x383e05,_0x297145;_0x5675b4[_0x2803('0x16')]=intUtil['stripTrailingSlash'](_0x5675b4[_0x2803('0x16')]);_0x5675b4['serverUrl']=intUtil[_0x2803('0x49')](_0x5675b4[_0x2803('0x3c')]);if(_0x19ad05&&_0x19ad05[_0x2803('0x4a')]&&_0x19ad05[_0x2803('0x4a')]!=='none'){logger[_0x2803('0xa')](_0x2803('0x4b'),_0x2803('0x3e'));_0x169dc6[_0x2803('0x4c')]=util['format'](_0x2803('0x3f'),_0x5675b4['serverUrl'],_0x169dc6[_0x2803('0x40')],md5(_0x169dc6[_0x2803('0x40')]));}headers['Authorization']=getAuth(_0x5675b4);return getUser(_0x5675b4,_0x4c40de[_0x2803('0x1f')])['then'](function(_0x430b33){_0x383e05=_0x430b33;logger[_0x2803('0xa')]('The\x20User\x20ID\x20is:',_0x383e05['id']);return getEndUser(_0x5675b4,_0x169dc6[_0x2803('0x4d')],_0x169dc6['destcalleridnum']);})[_0x2803('0x18')](function(_0x56af99){_0x297145=_0x56af99;logger[_0x2803('0xa')](_0x2803('0x42'),_0x297145['id']);return getTicket(_0x5675b4,_0x383e05,_0x297145,_0x62de18,_0x169dc6);})['then'](function(_0x2cd136){if(_0x2cd136&&_0x2cd136['id']){logger[_0x2803('0xa')](_0x2803('0x19'));logger[_0x2803('0xa')](_0x2803('0x43'),_0x2cd136['id']);logger[_0x2803('0xa')](_0x2803('0x4b'),_0x2803('0x44'));emit(util[_0x2803('0xc')](_0x2803('0x45'),_0x4c40de[_0x2803('0x3b')]),'trigger:browser:url',{'uri':util[_0x2803('0xc')]('%s/helpdesk/tickets/%d',_0x5675b4[_0x2803('0x16')],_0x2cd136['id'])});}})[_0x2803('0x48')](function(_0x3e9a64){logger[_0x2803('0x4e')](_0x2803('0x4b'),JSON[_0x2803('0x2a')](_0x3e9a64));});};exports[_0x2803('0x4f')]=function(_0x45efc8,_0x3c427f,_0x27c8d5,_0x107936,_0x2a80bf,_0x112f14){var _0x15d679,_0x3e3acf;_0x112f14[_0x2803('0x16')]=intUtil[_0x2803('0x49')](_0x112f14[_0x2803('0x16')]);_0x112f14['serverUrl']=intUtil[_0x2803('0x49')](_0x112f14[_0x2803('0x3c')]);if(_0x2a80bf&&_0x2a80bf[_0x2803('0x3d')]){logger[_0x2803('0xa')]('['+_0x3c427f['lastevent'][_0x2803('0x50')]()+']',_0x2803('0x3e'));_0x3c427f[_0x2803('0x4c')]=util[_0x2803('0xc')](_0x2803('0x3f'),_0x112f14[_0x2803('0x3c')],_0x3c427f[_0x2803('0x40')],md5(_0x3c427f[_0x2803('0x40')]));}else{_0x3c427f[_0x2803('0x4c')]='';}headers[_0x2803('0x41')]=getAuth(_0x112f14);return getUser(_0x112f14,'')['then'](function(_0x27148a){_0x15d679=_0x27148a;logger[_0x2803('0xa')]('The\x20User\x20ID\x20is:',_0x15d679['id']);return getEndUser(_0x112f14,_0x3c427f[_0x2803('0xd')],_0x3c427f[_0x2803('0x51')]);})['then'](function(_0x2fc4d9){_0x3e3acf=_0x2fc4d9;logger['info'](_0x2803('0x42'),_0x3e3acf['id']);return getTicket(_0x112f14,_0x15d679,_0x3e3acf,_0x27c8d5,_0x3c427f);})['then'](function(_0x1a4dcf){if(_0x1a4dcf){logger[_0x2803('0xa')](_0x2803('0x19'));logger[_0x2803('0xa')](_0x2803('0x43'),_0x1a4dcf['id']);}})[_0x2803('0x48')](function(_0x10a7e1){logger[_0x2803('0x4e')]('['+_0x3c427f[_0x2803('0x52')][_0x2803('0x50')]()+']',JSON[_0x2803('0x2a')](_0x10a7e1));});}; \ No newline at end of file +var _0x3d35=['name','Fields','custom_fields','mapValues','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','Agent\x20found!','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','debug','[HTTP]','stringify','GET','map','forEach','string','type','customField','nameField','toLowerCase','content','toString','includes','picklist','idField','push','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','toUpperCase','calleridname','util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions'];(function(_0x3885b0,_0x5059a4){var _0x339427=function(_0x3bdf4d){while(--_0x3bdf4d){_0x3885b0['push'](_0x3885b0['shift']());}};_0x339427(++_0x5059a4);}(_0x3d35,0x19c));var _0x53d3=function(_0x208b7a,_0x2e3baa){_0x208b7a=_0x208b7a-0x0;var _0x37b7ec=_0x3d35[_0x208b7a];return _0x37b7ec;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x53d3('0x0'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x53d3('0x1'));var logger=require(_0x53d3('0x2'))(_0x53d3('0x3'));config[_0x53d3('0x4')]=_[_0x53d3('0x5')](config[_0x53d3('0x4')],{'host':_0x53d3('0x6'),'port':0x18eb});var io=require(_0x53d3('0x7'))(new Redis(config[_0x53d3('0x4')]));var headers={'Content-Type':_0x53d3('0x8'),'Accept':_0x53d3('0x8')};function emit(_0x41b2b0,_0x3204de,_0x1ccf6d){io['to'](_0x41b2b0)[_0x53d3('0x9')](_0x3204de,_0x1ccf6d);}function getTicket(_0x217830,_0x4482c0,_0x2ad7b3,_0x19c5ca,_0x3811b5){logger[_0x53d3('0xa')](_0x53d3('0xb'));var _0x27dcdc=_[_0x53d3('0xc')]({'responder_id':_0x4482c0['id'],'requester_id':_0x2ad7b3['id'],'name':util[_0x53d3('0xd')](_0x53d3('0xe'),_0x3811b5['calleridname']),'phone':_0x3811b5[_0x53d3('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x53d3('0x10')](_0x19c5ca['Subjects'],_0x3811b5,'\x20'),'description':intUtil['getString'](_0x19c5ca[_0x53d3('0x11')],_0x3811b5,'
'),'tags':getTags(_0x19c5ca['Tags'],_0x53d3('0x12'))},getCustomFields(_0x19c5ca[_0x53d3('0x13')],_0x3811b5));_0x27dcdc[_0x53d3('0x14')]=_[_0x53d3('0x15')](_['keyBy'](_0x27dcdc[_0x53d3('0x14')],'id'),'value');return request({'uri':util[_0x53d3('0xd')](_0x53d3('0x16'),_0x217830['remoteUri']),'method':_0x53d3('0x17'),'body':_0x27dcdc})[_0x53d3('0x18')](function(_0x1b933e){logger['info'](_0x53d3('0x19'));return _0x1b933e;});}function getUser(_0x6542ad,_0x441441){if(intUtil[_0x53d3('0x1a')](_0x441441)){return request({'uri':util['format'](_0x53d3('0x1b'),_0x6542ad[_0x53d3('0x1c')]),'qs':{'email':_0x441441}})[_0x53d3('0x18')](function(_0xd46ba7){if(_0xd46ba7['length']){logger[_0x53d3('0xa')](_0x53d3('0x1d'));return _['find'](_0xd46ba7,function(_0x562ea5){return _0x562ea5[_0x53d3('0x1e')][_0x53d3('0x1f')]===_0x441441;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x53d3('0xd')](_0x53d3('0x20'),_0x6542ad[_0x53d3('0x1c')])})[_0x53d3('0x18')](function(_0x337c05){logger[_0x53d3('0xa')]('Admin\x20account\x20selected.');return _0x337c05;});}});}else{logger[_0x53d3('0xa')](_0x53d3('0x21'));return request({'uri':util[_0x53d3('0xd')](_0x53d3('0x20'),_0x6542ad[_0x53d3('0x1c')])})['then'](function(_0x381ee0){logger['info'](_0x53d3('0x22'));return _0x381ee0;});}}function getEndUser(_0x38cdb6,_0x5a9b2d,_0x251b44){logger[_0x53d3('0xa')]('Searching\x20enduser\x20with\x20phone',_0x251b44);return request({'uri':util[_0x53d3('0xd')](_0x53d3('0x23'),_0x38cdb6['remoteUri']),'qs':{'phone':_0x251b44}})[_0x53d3('0x18')](function(_0x1109ce){if(_0x1109ce[_0x53d3('0x24')]){logger[_0x53d3('0xa')](_0x53d3('0x25'));return _['find'](_0x1109ce,{'phone':_0x251b44});}else{logger[_0x53d3('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x53d3('0xd')](_0x53d3('0x23'),_0x38cdb6[_0x53d3('0x1c')]),'method':'POST','body':{'name':_0x5a9b2d,'phone':_0x251b44}})[_0x53d3('0x18')](function(_0x4ddd28){logger[_0x53d3('0xa')](_0x53d3('0x26'));return _0x4ddd28;});}});}function getAuth(_0xd771ff){return util[_0x53d3('0xd')](_0x53d3('0x27'),new Buffer(_0xd771ff[_0x53d3('0x28')]+':X')['toString']('base64'));}function request(_0x285148){logger[_0x53d3('0x29')](_0x53d3('0x2a'),JSON[_0x53d3('0x2b')](_0x285148));return rp(_['defaults'](_0x285148,{'method':_0x53d3('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0x5b6dd6,_0x43c95a){var _0x4d51d7=[];if(_0x5b6dd6&&_0x5b6dd6['length']>0x0){_0x4d51d7=_[_0x53d3('0x2d')](_0x5b6dd6,_0x43c95a);}return _0x4d51d7;}function getCustomFields(_0x4d5f49,_0x4598a8){var _0x5672b3=[];var _0xb17a7e={'custom_fields':[]};if(_0x4d5f49[_0x53d3('0x24')]>0x0){_[_0x53d3('0x2e')](_0x4d5f49,function(_0x5b1597){if(_['includes']([_0x53d3('0x2f'),'picklist'],_0x5b1597[_0x53d3('0x30')])&&_0x5b1597['nameField']&&!_0x5b1597[_0x53d3('0x31')]){_0xb17a7e[_0x5b1597[_0x53d3('0x32')][_0x53d3('0x33')]()]=_0x5b1597[_0x53d3('0x34')][_0x53d3('0x35')]();}else if(_[_0x53d3('0x36')]([_0x53d3('0x2f'),_0x53d3('0x37')],_0x5b1597[_0x53d3('0x30')])&&_0x5b1597[_0x53d3('0x38')]&&_0x5b1597['customField']){_0xb17a7e[_0x53d3('0x14')][_0x53d3('0x39')]({'id':_0x5b1597[_0x53d3('0x38')],'value':_0x5b1597['content'][_0x53d3('0x35')]()});}else if(_0x5b1597[_0x53d3('0x30')]==='variable'&&_0x5b1597[_0x53d3('0x3a')]&&_0x5b1597[_0x53d3('0x38')]&&_0x5b1597[_0x53d3('0x31')]){_0x4598a8[_0x5b1597[_0x53d3('0x3a')]]&&_0xb17a7e[_0x53d3('0x14')][_0x53d3('0x39')]({'id':_0x5b1597['idField'],'value':_0x4598a8[_0x5b1597[_0x53d3('0x3a')]][_0x53d3('0x35')]()});}else if(_0x5b1597[_0x53d3('0x30')]==='customVariable'&&_0x5b1597[_0x53d3('0x3b')]&&_0x5b1597[_0x53d3('0x3b')]['name']&&_0x5b1597[_0x53d3('0x38')]&&_0x5b1597[_0x53d3('0x31')]){_0x4598a8[_0x5b1597[_0x53d3('0x3b')][_0x53d3('0x12')][_0x53d3('0x33')]()]&&_0xb17a7e[_0x53d3('0x14')]['push']({'id':_0x5b1597[_0x53d3('0x38')],'value':_0x4598a8[_0x5b1597[_0x53d3('0x3b')][_0x53d3('0x12')][_0x53d3('0x33')]()][_0x53d3('0x35')]()});}});}return _0xb17a7e;}exports[_0x53d3('0x3c')]=function(_0x350894,_0x30b49a,_0x36ee6b,_0x1fc285,_0x5595b1,_0x3f756e){var _0x1d6ba8,_0x36a51f;_0x3f756e[_0x53d3('0x1c')]=intUtil['stripTrailingSlash'](_0x3f756e[_0x53d3('0x1c')]);_0x3f756e[_0x53d3('0x3d')]=intUtil[_0x53d3('0x3e')](_0x3f756e['serverUrl']);if(_0x5595b1&&_0x5595b1[_0x53d3('0x3f')]){logger[_0x53d3('0xa')](_0x53d3('0x40'),_0x53d3('0x41'));_0x30b49a['recordingURL']=util[_0x53d3('0xd')](_0x53d3('0x42'),_0x3f756e[_0x53d3('0x3d')],_0x30b49a[_0x53d3('0x43')],md5(_0x30b49a[_0x53d3('0x43')]));}else{_0x30b49a[_0x53d3('0x44')]='';}headers['Authorization']=getAuth(_0x3f756e);return getUser(_0x3f756e,_0x1fc285[_0x53d3('0x1f')])[_0x53d3('0x18')](function(_0x511c58){_0x1d6ba8=_0x511c58;logger[_0x53d3('0xa')](_0x53d3('0x45'),_0x1d6ba8['id']);return getEndUser(_0x3f756e,_0x30b49a['calleridname'],_0x30b49a[_0x53d3('0xf')]);})['then'](function(_0x37e69f){_0x36a51f=_0x37e69f;logger['info'](_0x53d3('0x46'),_0x36a51f['id']);return getTicket(_0x3f756e,_0x1d6ba8,_0x36a51f,_0x36ee6b,_0x30b49a);})[_0x53d3('0x18')](function(_0x33058b){if(_0x33058b&&_0x33058b['id']){logger[_0x53d3('0xa')](_0x53d3('0x19'));logger[_0x53d3('0xa')]('The\x20Ticket\x20ID\x20is:',_0x33058b['id']);logger[_0x53d3('0xa')](_0x53d3('0x40'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x53d3('0xd')](_0x53d3('0x47'),_0x1fc285['name']),_0x53d3('0x48'),{'uri':util[_0x53d3('0xd')](_0x53d3('0x49'),_0x3f756e[_0x53d3('0x1c')],_0x33058b['id'])});}})[_0x53d3('0x4a')](function(_0x37d254){logger[_0x53d3('0x4b')](_0x53d3('0x40'),JSON['stringify'](_0x37d254));});};exports['outbound']=function(_0x555769,_0x16d7bf,_0x10ee76,_0x5880a5,_0x128b2d,_0x13c484,_0x44bbb9){var _0x128d29,_0x22676f;_0x13c484['remoteUri']=intUtil[_0x53d3('0x3e')](_0x13c484[_0x53d3('0x1c')]);_0x13c484['serverUrl']=intUtil[_0x53d3('0x3e')](_0x13c484[_0x53d3('0x3d')]);if(_0x44bbb9&&_0x44bbb9[_0x53d3('0x4c')]&&_0x44bbb9['recordingFormat']!=='none'){logger['info'](_0x53d3('0x4d'),'Recording\x20is\x20enabled!');_0x16d7bf[_0x53d3('0x44')]=util[_0x53d3('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x13c484[_0x53d3('0x3d')],_0x16d7bf['uniqueid'],md5(_0x16d7bf[_0x53d3('0x43')]));}headers[_0x53d3('0x4e')]=getAuth(_0x13c484);return getUser(_0x13c484,_0x5880a5[_0x53d3('0x1f')])['then'](function(_0x23dd26){_0x128d29=_0x23dd26;logger[_0x53d3('0xa')]('The\x20User\x20ID\x20is:',_0x128d29['id']);return getEndUser(_0x13c484,_0x16d7bf[_0x53d3('0x4f')],_0x16d7bf[_0x53d3('0x50')]);})[_0x53d3('0x18')](function(_0xaf654e){_0x22676f=_0xaf654e;logger[_0x53d3('0xa')](_0x53d3('0x46'),_0x22676f['id']);return getTicket(_0x13c484,_0x128d29,_0x22676f,_0x10ee76,_0x16d7bf);})[_0x53d3('0x18')](function(_0x5312a8){if(_0x5312a8&&_0x5312a8['id']){logger[_0x53d3('0xa')]('Ticket\x20created!');logger[_0x53d3('0xa')](_0x53d3('0x51'),_0x5312a8['id']);logger[_0x53d3('0xa')](_0x53d3('0x4d'),_0x53d3('0x52'));emit(util[_0x53d3('0xd')](_0x53d3('0x47'),_0x5880a5[_0x53d3('0x12')]),_0x53d3('0x48'),{'uri':util[_0x53d3('0xd')](_0x53d3('0x49'),_0x13c484[_0x53d3('0x1c')],_0x5312a8['id'])});}})[_0x53d3('0x4a')](function(_0x2e0616){logger[_0x53d3('0x4b')](_0x53d3('0x4d'),JSON[_0x53d3('0x2b')](_0x2e0616));});};exports['unmanaged']=function(_0x5836a2,_0x3d5f37,_0x5966ec,_0x364a97,_0x5b4f3b,_0x13c684){var _0x3fd621,_0x15f6ca;_0x13c684[_0x53d3('0x1c')]=intUtil[_0x53d3('0x3e')](_0x13c684[_0x53d3('0x1c')]);_0x13c684['serverUrl']=intUtil['stripTrailingSlash'](_0x13c684[_0x53d3('0x3d')]);if(_0x5b4f3b&&_0x5b4f3b['monitor_format']){logger[_0x53d3('0xa')]('['+_0x3d5f37[_0x53d3('0x53')][_0x53d3('0x54')]()+']',_0x53d3('0x41'));_0x3d5f37[_0x53d3('0x44')]=util[_0x53d3('0xd')](_0x53d3('0x42'),_0x13c684[_0x53d3('0x3d')],_0x3d5f37[_0x53d3('0x43')],md5(_0x3d5f37[_0x53d3('0x43')]));}else{_0x3d5f37[_0x53d3('0x44')]='';}headers[_0x53d3('0x4e')]=getAuth(_0x13c684);return getUser(_0x13c684,'')[_0x53d3('0x18')](function(_0x45a6e1){_0x3fd621=_0x45a6e1;logger[_0x53d3('0xa')](_0x53d3('0x45'),_0x3fd621['id']);return getEndUser(_0x13c684,_0x3d5f37[_0x53d3('0x55')],_0x3d5f37[_0x53d3('0xf')]);})[_0x53d3('0x18')](function(_0x2c50c7){_0x15f6ca=_0x2c50c7;logger[_0x53d3('0xa')]('The\x20Enduser\x20ID\x20is:',_0x15f6ca['id']);return getTicket(_0x13c684,_0x3fd621,_0x15f6ca,_0x5966ec,_0x3d5f37);})[_0x53d3('0x18')](function(_0x41a898){if(_0x41a898){logger[_0x53d3('0xa')](_0x53d3('0x19'));logger['info'](_0x53d3('0x51'),_0x41a898['id']);}})[_0x53d3('0x4a')](function(_0x221e88){logger[_0x53d3('0x4b')]('['+_0x3d5f37[_0x53d3('0x53')][_0x53d3('0x54')]()+']',JSON[_0x53d3('0x2b')](_0x221e88));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 1d4f65e..000b30c 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd21c=['/contacts/','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','userEmail','User\x20found:','userId','Admin\x20selected','catch','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','task','Task\x20created:','ticketId'];(function(_0x16946b,_0x5ea65a){var _0x322ea3=function(_0x131958){while(--_0x131958){_0x16946b['push'](_0x16946b['shift']());}};_0x322ea3(++_0x5ea65a);}(_0xd21c,0x1c9));var _0xcd21=function(_0x4ed90b,_0x5b8dc5){_0x4ed90b=_0x4ed90b-0x0;var _0x812d6d=_0xd21c[_0x4ed90b];return _0x812d6d;};'use strict';var _=require(_0xcd21('0x0'));var rp=require(_0xcd21('0x1'));var md5=require('md5');var util=require(_0xcd21('0x2'));var moment=require(_0xcd21('0x3'));var Promise=require(_0xcd21('0x4'));var Redis=require(_0xcd21('0x5'));var intUtil=require('./util');var config=require(_0xcd21('0x6'));var logger=require(_0xcd21('0x7'))('freshsales');config[_0xcd21('0x8')]=_[_0xcd21('0x9')](config[_0xcd21('0x8')],{'host':_0xcd21('0xa'),'port':0x18eb});var io=require(_0xcd21('0xb'))(new Redis(config[_0xcd21('0x8')]));function getAdminId(_0x47cd4f,_0x151141,_0x21c733,_0x8719a9){return new Promise(function(_0x19f67a,_0x472eb7){var _0x4e93c6=![];var _0x4f4ade={'method':_0xcd21('0xc'),'uri':_0x8719a9+_0xcd21('0xd'),'json':!![]};_0x4f4ade[_0xcd21('0xe')]=_0x21c733;logger['info'](_0xcd21('0xf'));return rp(_0x4f4ade)[_0xcd21('0x10')](function(_0x3f999d){if(_0x3f999d){var _0x971ff3=_0x3f999d[_0xcd21('0x11')];var _0x12edf5=null;for(_0x12edf5=0x0;_0x12edf5<_0x971ff3['length'];_0x12edf5++){if(_0x971ff3[_0x12edf5][_0xcd21('0x12')]===_0x47cd4f[_0xcd21('0x13')]){_0x47cd4f[_0xcd21('0x14')]=_0x971ff3[_0x12edf5]['id'];_0x4e93c6=!![];}}if(_0x4e93c6){logger[_0xcd21('0x15')](_0xcd21('0x16'),_0x47cd4f[_0xcd21('0x14')]);_0x19f67a(_0x47cd4f);}else{_0x472eb7({'statusCode':0x194,'message':_0xcd21('0x17')});}}else{_0x472eb7({'statusCode':0x194,'message':_0xcd21('0x17')});}})['catch'](function(_0x126f24){logger[_0xcd21('0x18')]('['+[_0x151141[_0xcd21('0x19')]()]+']',_0x126f24[_0xcd21('0x1a')]);_0x472eb7(_0x126f24);});});}function getUser(_0x30d9e5,_0x21543a,_0x4a7ecc){return function(_0x4b3852){return new Promise(function(_0x228d51,_0x2dd01e){var _0x2de2f8={'method':_0xcd21('0xc'),'uri':_0x4a7ecc+_0xcd21('0xd'),'json':!![]};_0x2de2f8[_0xcd21('0xe')]=_0x21543a;logger['info'](_0xcd21('0x1b'));return rp(_0x2de2f8)['then'](function(_0x13189c){if(_0x13189c){var _0x5cb7a1=_0x13189c[_0xcd21('0x11')];var _0x2547c7=![];var _0x262549=null;if(_0x4b3852[_0xcd21('0x1c')]!==null){logger[_0xcd21('0x15')]('Getting\x20user\x20with\x20email',_0x4b3852[_0xcd21('0x1c')]);_0x4b3852[_0xcd21('0x1d')]=_0x4b3852[_0xcd21('0x1c')];for(_0x262549=0x0;_0x262549<_0x5cb7a1['length'];_0x262549++){if(_0x5cb7a1[_0x262549][_0xcd21('0x12')]===_0x4b3852['agentEmail']){_0x2547c7=!![];_0x4b3852['userId']=_0x5cb7a1[_0x262549]['id'];logger['info'](_0xcd21('0x1e'),_0x4b3852[_0xcd21('0x1f')]);}}}if(!_0x2547c7){logger[_0xcd21('0x15')](_0xcd21('0x20'));_0x4b3852['userEmail']=_0x4b3852[_0xcd21('0x13')];_0x4b3852[_0xcd21('0x1f')]=_0x4b3852['adminId'];_0x2547c7=!![];}if(_0x2547c7){_0x228d51(_0x4b3852);}else{_0x2dd01e({'statusCode':0x194,'message':_0xcd21('0x17')});}}else{_0x2dd01e({'statusCode':0x194,'message':_0xcd21('0x17')});}})[_0xcd21('0x21')](function(_0x47ee9a){logger[_0xcd21('0x18')]('['+[_0x30d9e5[_0xcd21('0x19')]()]+']',_0x47ee9a[_0xcd21('0x1a')]);_0x2dd01e(_0x47ee9a);});});};}function searchContact(_0x201b98,_0x58e049,_0x5bb2ab,_0x185851){return new Promise(function(_0x317592,_0x506c1e){var _0x20434a={'method':_0xcd21('0xc'),'headers':_0x58e049,'uri':_0x201b98+'/api/lookup?q='+_0x185851+'&f='+_0x5bb2ab+'&entities=contact','json':!![]};rp(_0x20434a)[_0xcd21('0x10')](function(_0x4d63d5){var _0x2a33a1=_[_0xcd21('0x22')](_0x4d63d5[_0xcd21('0x23')][_0xcd21('0x23')],[_0x5bb2ab,_0x185851]);_0x317592(_0x2a33a1);})[_0xcd21('0x21')](function(_0x934870){_0x506c1e(_0x934870);});});}function getEndUser(_0x2f6f6d,_0x3160cd,_0x2bfddd){return function(_0x5996b3){return new Promise(function(_0x31ed5a,_0x373783){logger[_0xcd21('0x15')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x5996b3[_0xcd21('0x24')]));searchContact(_0x2bfddd,_0x3160cd,_0xcd21('0x25'),_0x5996b3[_0xcd21('0x24')])[_0xcd21('0x10')](function(_0x15ff42){if(_0x15ff42){_0x5996b3[_0xcd21('0x26')]=_0x15ff42['id'];logger[_0xcd21('0x15')](_0xcd21('0x27'),_0x5996b3[_0xcd21('0x26')]);return _0x31ed5a(_0x5996b3);}searchContact(_0x2bfddd,_0x3160cd,_0xcd21('0x28'),_0x5996b3[_0xcd21('0x24')])[_0xcd21('0x10')](function(_0x3ce806){if(_0x3ce806){_0x5996b3[_0xcd21('0x26')]=_0x3ce806['id'];logger[_0xcd21('0x15')](_0xcd21('0x29'),_0x5996b3[_0xcd21('0x26')]);return _0x31ed5a(_0x5996b3);}createEndUser(_0x5996b3,_0x2f6f6d,_0x3160cd,_0x2bfddd)[_0xcd21('0x10')](function(_0x8905ae){logger[_0xcd21('0x15')](_0xcd21('0x2a'),_0x8905ae[_0xcd21('0x26')]);return _0x31ed5a(_0x8905ae);});});})[_0xcd21('0x21')](function(_0x2fa539){_0x373783(_0x2fa539);});});};}function createEndUser(_0x264284,_0x4b1686,_0x92b2e,_0x748faf){return new Promise(function(_0x5c5e49,_0xdfe01a){var _0x5792e2=moment();var _0x2337b9={'method':'POST','uri':_0x748faf+_0xcd21('0x2b'),'body':{'contact':{'last_name':_0x264284[_0xcd21('0x24')],'work_number':_0x264284[_0xcd21('0x24')],'mobile_number':_0x264284['contactNumber'],'owner_id':_0x264284[_0xcd21('0x1f')],'created_at':_0x5792e2[_0xcd21('0x2c')](_0xcd21('0x2d'))}},'json':!![]};_0x2337b9[_0xcd21('0xe')]=_0x92b2e;logger[_0xcd21('0x15')](_0xcd21('0x2e'));return rp(_0x2337b9)[_0xcd21('0x10')](function(_0xb90f99){_0x264284[_0xcd21('0x26')]=_0xb90f99[_0xcd21('0x2f')]['id'];_0x5c5e49(_0x264284);})[_0xcd21('0x21')](function(_0x32ece8){logger[_0xcd21('0x18')]('['+[_0x4b1686['toUpperCase']()]+']',_0x32ece8[_0xcd21('0x1a')]);_0xdfe01a(_0x32ece8[_0xcd21('0x1a')]);});});}function getTicket(_0x98c4d9,_0x2f33ce,_0x9d6c60,_0x4697be,_0x28e172){return function(_0x49e41b){logger[_0xcd21('0x15')](_0xcd21('0x30'));return new Promise(function(_0x232882,_0x5e4991){var _0x14244c=moment();var _0x2cbff2={'method':_0xcd21('0x31'),'uri':_0x9d6c60+_0xcd21('0x32'),'body':{'title':intUtil[_0xcd21('0x33')](_0x4697be[_0xcd21('0x34')],_0x28e172,'\x20'),'description':intUtil[_0xcd21('0x33')](_0x4697be[_0xcd21('0x35')],_0x28e172,'\x0a'),'owner_id':_0x49e41b[_0xcd21('0x1f')],'creater_id':_0x49e41b['adminId'],'targetable_id':_0x49e41b['endUserId'],'targetable_type':_0xcd21('0x36'),'created_at':_0x14244c[_0xcd21('0x2c')](_0xcd21('0x2d')),'due_date':_0x14244c[_0xcd21('0x37')](0x1e,'m')[_0xcd21('0x2c')](_0xcd21('0x2d'))},'json':!![]};_0x2cbff2[_0xcd21('0xe')]=_0x2f33ce;return rp(_0x2cbff2)[_0xcd21('0x10')](function(_0x491f7f){_0x49e41b['ticketId']=_0x491f7f[_0xcd21('0x38')]['id'];logger[_0xcd21('0x15')](_0xcd21('0x39'),_0x49e41b[_0xcd21('0x3a')]);_0x232882(_0x49e41b);})[_0xcd21('0x21')](function(_0x4f8f62){logger[_0xcd21('0x18')]('['+[_0x98c4d9[_0xcd21('0x19')]()]+']',_0x4f8f62[_0xcd21('0x1a')]);_0x5e4991(_0x4f8f62[_0xcd21('0x1a')]);});});};}function emit(_0x37d5d1,_0x34561d,_0x1e2b7a){var _0x597d3e={'uri':_0x37d5d1+_0xcd21('0x3b')+_0x1e2b7a};io['to'](util[_0xcd21('0x2c')](_0xcd21('0x3c'),_0x34561d))['emit'](_0xcd21('0x3d'),_0x597d3e);}exports['cs']=function(_0x480d3e,_0x222df6,_0x4ac667,_0x39ed09,_0x2187a3,_0x1c8e2b,_0x2c3c76,_0x3b4413){var _0x13d09e={};var _0x4256c2={'Authorization':_0xcd21('0x3e')+_0x1c8e2b['apiKey']};_0x1c8e2b[_0xcd21('0x3f')]=intUtil[_0xcd21('0x40')](_0x1c8e2b['remoteUri']);_0x1c8e2b['serverUrl']=intUtil['stripTrailingSlash'](_0x1c8e2b[_0xcd21('0x41')]);var _0x54aeec=_0x1c8e2b[_0xcd21('0x3f')];_0x13d09e[_0xcd21('0x13')]=_0x1c8e2b[_0xcd21('0x42')];_0x13d09e[_0xcd21('0x24')]=_0x3b4413[_0xcd21('0x43')]()===_0xcd21('0x44')?_0x222df6[_0xcd21('0x45')]:_0x222df6[_0xcd21('0x46')];_0x13d09e[_0xcd21('0x47')]=_0x3b4413===_0xcd21('0x48')||_0x3b4413===_0xcd21('0x49')?_0xcd21('0x48'):_0xcd21('0x44');if(_0x39ed09){_0x13d09e[_0xcd21('0x1c')]=_0x39ed09[_0xcd21('0x12')];}var _0x5f2510=util[_0xcd21('0x2c')](_0xcd21('0x4a'),_0x1c8e2b['serverUrl'],_0x222df6[_0xcd21('0x4b')],md5(_0x222df6[_0xcd21('0x4b')]));if(_0x2187a3&&_0x2187a3[_0xcd21('0x4c')]){logger[_0xcd21('0x15')](_0xcd21('0x4d'),_0xcd21('0x4e'));_0x222df6[_0xcd21('0x4f')]=_0x5f2510;}else if(_0x2c3c76&&_0x2c3c76[_0xcd21('0x50')]&&_0x2c3c76[_0xcd21('0x50')]!==_0xcd21('0x51')){logger[_0xcd21('0x15')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x222df6[_0xcd21('0x4f')]=_0x5f2510;}else{_0x222df6[_0xcd21('0x4f')]='';}return getAdminId(_0x13d09e,_0x3b4413,_0x4256c2,_0x54aeec)[_0xcd21('0x10')](getUser(_0x3b4413,_0x4256c2,_0x54aeec))[_0xcd21('0x10')](getEndUser(_0x3b4413,_0x4256c2,_0x54aeec))[_0xcd21('0x10')](getTicket(_0x3b4413,_0x4256c2,_0x54aeec,_0x4ac667,_0x222df6))[_0xcd21('0x10')](function(_0x54e5ff){logger[_0xcd21('0x15')](util[_0xcd21('0x2c')](_0xcd21('0x52'),_0x54e5ff[_0xcd21('0x3a')]));if(_0x3b4413!==_0xcd21('0x49')){logger['info']('['+[_0x3b4413[_0xcd21('0x19')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x54aeec,_0x39ed09[_0xcd21('0x53')],_0x54e5ff[_0xcd21('0x26')]);}})[_0xcd21('0x21')](function(_0x2c3062){logger[_0xcd21('0x18')]('['+[_0x3b4413[_0xcd21('0x19')]()]+_0xcd21('0x54'),util[_0xcd21('0x55')](_0x2c3062,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1d2d=['Admin\x20selected','error','toUpperCase','&f=','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','redis','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','message','headers','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId'];(function(_0x42fd32,_0x12d3ae){var _0x328b6f=function(_0x3b9d38){while(--_0x3b9d38){_0x42fd32['push'](_0x42fd32['shift']());}};_0x328b6f(++_0x12d3ae);}(_0x1d2d,0x89));var _0xd1d2=function(_0x55a2e7,_0x2cdeb6){_0x55a2e7=_0x55a2e7-0x0;var _0x44a5f5=_0x1d2d[_0x55a2e7];return _0x44a5f5;};'use strict';var _=require('lodash');var rp=require(_0xd1d2('0x0'));var md5=require(_0xd1d2('0x1'));var util=require(_0xd1d2('0x2'));var moment=require(_0xd1d2('0x3'));var Promise=require(_0xd1d2('0x4'));var Redis=require(_0xd1d2('0x5'));var intUtil=require('./util');var config=require(_0xd1d2('0x6'));var logger=require('../../../../config/logger')(_0xd1d2('0x7'));config[_0xd1d2('0x8')]=_['defaults'](config[_0xd1d2('0x8')],{'host':_0xd1d2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd1d2('0x8')]));function getAdminId(_0x5d3c8e,_0x24411b,_0x106682,_0x5f120a){return new Promise(function(_0x790c07,_0xfc9eb8){var _0x531463=![];var _0x5a8a3d={'method':_0xd1d2('0xa'),'uri':_0x5f120a+_0xd1d2('0xb'),'json':!![]};_0x5a8a3d['headers']=_0x106682;logger[_0xd1d2('0xc')](_0xd1d2('0xd'));return rp(_0x5a8a3d)['then'](function(_0x8b14ec){if(_0x8b14ec){var _0x5300ea=_0x8b14ec[_0xd1d2('0xe')];var _0x18d705=null;for(_0x18d705=0x0;_0x18d705<_0x5300ea[_0xd1d2('0xf')];_0x18d705++){if(_0x5300ea[_0x18d705][_0xd1d2('0x10')]===_0x5d3c8e[_0xd1d2('0x11')]){_0x5d3c8e[_0xd1d2('0x12')]=_0x5300ea[_0x18d705]['id'];_0x531463=!![];}}if(_0x531463){logger[_0xd1d2('0xc')](_0xd1d2('0x13'),_0x5d3c8e[_0xd1d2('0x12')]);_0x790c07(_0x5d3c8e);}else{_0xfc9eb8({'statusCode':0x194,'message':_0xd1d2('0x14')});}}else{_0xfc9eb8({'statusCode':0x194,'message':_0xd1d2('0x14')});}})[_0xd1d2('0x15')](function(_0x5e22a8){logger['error']('['+[_0x24411b['toUpperCase']()]+']',_0x5e22a8[_0xd1d2('0x16')]);_0xfc9eb8(_0x5e22a8);});});}function getUser(_0x185ac0,_0x147f85,_0x2353c8){return function(_0x987d76){return new Promise(function(_0x1a0811,_0x554a3a){var _0x4b41f5={'method':_0xd1d2('0xa'),'uri':_0x2353c8+_0xd1d2('0xb'),'json':!![]};_0x4b41f5[_0xd1d2('0x17')]=_0x147f85;logger[_0xd1d2('0xc')](_0xd1d2('0x18'));return rp(_0x4b41f5)[_0xd1d2('0x19')](function(_0x282948){if(_0x282948){var _0x5f000c=_0x282948['users'];var _0x53b555=![];var _0xd5e478=null;if(_0x987d76[_0xd1d2('0x1a')]!==null){logger[_0xd1d2('0xc')](_0xd1d2('0x1b'),_0x987d76[_0xd1d2('0x1a')]);_0x987d76[_0xd1d2('0x1c')]=_0x987d76[_0xd1d2('0x1a')];for(_0xd5e478=0x0;_0xd5e478<_0x5f000c['length'];_0xd5e478++){if(_0x5f000c[_0xd5e478]['email']===_0x987d76[_0xd1d2('0x1a')]){_0x53b555=!![];_0x987d76['userId']=_0x5f000c[_0xd5e478]['id'];logger[_0xd1d2('0xc')](_0xd1d2('0x1d'),_0x987d76[_0xd1d2('0x1e')]);}}}if(!_0x53b555){logger[_0xd1d2('0xc')](_0xd1d2('0x1f'));_0x987d76['userEmail']=_0x987d76['adminEmail'];_0x987d76[_0xd1d2('0x1e')]=_0x987d76[_0xd1d2('0x12')];_0x53b555=!![];}if(_0x53b555){_0x1a0811(_0x987d76);}else{_0x554a3a({'statusCode':0x194,'message':_0xd1d2('0x14')});}}else{_0x554a3a({'statusCode':0x194,'message':_0xd1d2('0x14')});}})[_0xd1d2('0x15')](function(_0x10a4da){logger[_0xd1d2('0x20')]('['+[_0x185ac0[_0xd1d2('0x21')]()]+']',_0x10a4da[_0xd1d2('0x16')]);_0x554a3a(_0x10a4da);});});};}function searchContact(_0x561a14,_0x1a1bcf,_0x3501da,_0x55fa72){return new Promise(function(_0x4aee7a,_0x17bbf1){var _0x29fdef={'method':_0xd1d2('0xa'),'headers':_0x1a1bcf,'uri':_0x561a14+'/api/lookup?q='+_0x55fa72+_0xd1d2('0x22')+_0x3501da+'&entities=contact','json':!![]};rp(_0x29fdef)[_0xd1d2('0x19')](function(_0x41f8e9){var _0x6a3267=_[_0xd1d2('0x23')](_0x41f8e9[_0xd1d2('0x24')][_0xd1d2('0x24')],[_0x3501da,_0x55fa72]);_0x4aee7a(_0x6a3267);})[_0xd1d2('0x15')](function(_0x558f6d){_0x17bbf1(_0x558f6d);});});}function getEndUser(_0x19b0e4,_0x4a3d47,_0x2e3a71){return function(_0x45a374){return new Promise(function(_0x20fbea,_0x34e55b){logger[_0xd1d2('0xc')](util['format'](_0xd1d2('0x25'),_0x45a374[_0xd1d2('0x26')]));searchContact(_0x2e3a71,_0x4a3d47,_0xd1d2('0x27'),_0x45a374['contactNumber'])[_0xd1d2('0x19')](function(_0x499748){if(_0x499748){_0x45a374[_0xd1d2('0x28')]=_0x499748['id'];logger[_0xd1d2('0xc')](_0xd1d2('0x29'),_0x45a374['endUserId']);return _0x20fbea(_0x45a374);}searchContact(_0x2e3a71,_0x4a3d47,_0xd1d2('0x2a'),_0x45a374[_0xd1d2('0x26')])[_0xd1d2('0x19')](function(_0x4b2f35){if(_0x4b2f35){_0x45a374['endUserId']=_0x4b2f35['id'];logger[_0xd1d2('0xc')]('Contact\x20found\x20work_number:',_0x45a374[_0xd1d2('0x28')]);return _0x20fbea(_0x45a374);}createEndUser(_0x45a374,_0x19b0e4,_0x4a3d47,_0x2e3a71)[_0xd1d2('0x19')](function(_0x264eb0){logger[_0xd1d2('0xc')](_0xd1d2('0x2b'),_0x264eb0[_0xd1d2('0x28')]);return _0x20fbea(_0x264eb0);});});})[_0xd1d2('0x15')](function(_0x1e69f8){_0x34e55b(_0x1e69f8);});});};}function createEndUser(_0x132ff5,_0x484730,_0x53ca81,_0x27a5de){return new Promise(function(_0x10d4df,_0xd874e){var _0x4b5fd7=moment();var _0x4e1c23={'method':_0xd1d2('0x2c'),'uri':_0x27a5de+_0xd1d2('0x2d'),'body':{'contact':{'last_name':_0x132ff5[_0xd1d2('0x26')],'work_number':_0x132ff5['contactNumber'],'mobile_number':_0x132ff5[_0xd1d2('0x26')],'owner_id':_0x132ff5['userId'],'created_at':_0x4b5fd7[_0xd1d2('0x2e')](_0xd1d2('0x2f'))}},'json':!![]};_0x4e1c23['headers']=_0x53ca81;logger[_0xd1d2('0xc')](_0xd1d2('0x30'));return rp(_0x4e1c23)[_0xd1d2('0x19')](function(_0x3380f4){_0x132ff5[_0xd1d2('0x28')]=_0x3380f4[_0xd1d2('0x31')]['id'];_0x10d4df(_0x132ff5);})[_0xd1d2('0x15')](function(_0x408a3c){logger[_0xd1d2('0x20')]('['+[_0x484730[_0xd1d2('0x21')]()]+']',_0x408a3c[_0xd1d2('0x16')]);_0xd874e(_0x408a3c[_0xd1d2('0x16')]);});});}function getTicket(_0x3c95b4,_0x1ce179,_0x23c533,_0x36ff99,_0x5c0534){return function(_0x2bc30a){logger[_0xd1d2('0xc')](_0xd1d2('0x32'));return new Promise(function(_0x2caa1a,_0x661f96){var _0x160b9b=moment();var _0x25298d={'method':_0xd1d2('0x2c'),'uri':_0x23c533+_0xd1d2('0x33'),'body':{'title':intUtil[_0xd1d2('0x34')](_0x36ff99[_0xd1d2('0x35')],_0x5c0534,'\x20'),'description':intUtil['getString'](_0x36ff99['Descriptions'],_0x5c0534,'\x0a'),'owner_id':_0x2bc30a[_0xd1d2('0x1e')],'creater_id':_0x2bc30a[_0xd1d2('0x12')],'targetable_id':_0x2bc30a['endUserId'],'targetable_type':_0xd1d2('0x36'),'created_at':_0x160b9b[_0xd1d2('0x2e')](_0xd1d2('0x2f')),'due_date':_0x160b9b['add'](0x1e,'m')[_0xd1d2('0x2e')](_0xd1d2('0x2f'))},'json':!![]};_0x25298d[_0xd1d2('0x17')]=_0x1ce179;return rp(_0x25298d)[_0xd1d2('0x19')](function(_0x3eccdf){_0x2bc30a[_0xd1d2('0x37')]=_0x3eccdf[_0xd1d2('0x38')]['id'];logger[_0xd1d2('0xc')](_0xd1d2('0x39'),_0x2bc30a[_0xd1d2('0x37')]);_0x2caa1a(_0x2bc30a);})[_0xd1d2('0x15')](function(_0x2ff50a){logger[_0xd1d2('0x20')]('['+[_0x3c95b4['toUpperCase']()]+']',_0x2ff50a[_0xd1d2('0x16')]);_0x661f96(_0x2ff50a[_0xd1d2('0x16')]);});});};}function emit(_0x223dda,_0x1dc2f9,_0x1d660b){var _0x280d37={'uri':_0x223dda+'/contacts/'+_0x1d660b};io['to'](util[_0xd1d2('0x2e')](_0xd1d2('0x3a'),_0x1dc2f9))[_0xd1d2('0x3b')](_0xd1d2('0x3c'),_0x280d37);}exports['cs']=function(_0x3894e5,_0x8c9528,_0x3da10d,_0x50890e,_0x3cd800,_0x49b72c,_0x336f04,_0x468844){var _0x1169f7={};var _0x1195f0={'Authorization':_0xd1d2('0x3d')+_0x49b72c[_0xd1d2('0x3e')]};_0x49b72c[_0xd1d2('0x3f')]=intUtil[_0xd1d2('0x40')](_0x49b72c[_0xd1d2('0x3f')]);_0x49b72c['serverUrl']=intUtil[_0xd1d2('0x40')](_0x49b72c[_0xd1d2('0x41')]);var _0x400bad=_0x49b72c[_0xd1d2('0x3f')];_0x1169f7['adminEmail']=_0x49b72c[_0xd1d2('0x42')];_0x1169f7[_0xd1d2('0x26')]=_0x468844[_0xd1d2('0x43')]()===_0xd1d2('0x44')?_0x8c9528[_0xd1d2('0x45')]:_0x8c9528[_0xd1d2('0x46')];_0x1169f7['callDirection']=_0x468844===_0xd1d2('0x47')||_0x468844===_0xd1d2('0x48')?_0xd1d2('0x47'):_0xd1d2('0x44');if(_0x50890e){_0x1169f7['agentEmail']=_0x50890e[_0xd1d2('0x10')];}var _0x3e041a=util['format'](_0xd1d2('0x49'),_0x49b72c[_0xd1d2('0x41')],_0x8c9528[_0xd1d2('0x4a')],md5(_0x8c9528[_0xd1d2('0x4a')]));if(_0x3cd800&&_0x3cd800[_0xd1d2('0x4b')]){logger['info'](_0xd1d2('0x4c'),_0xd1d2('0x4d'));_0x8c9528[_0xd1d2('0x4e')]=_0x3e041a;}else if(_0x336f04&&_0x336f04[_0xd1d2('0x4f')]&&_0x336f04[_0xd1d2('0x4f')]!=='none'){logger[_0xd1d2('0xc')](_0xd1d2('0x50'),_0xd1d2('0x4d'));_0x8c9528[_0xd1d2('0x4e')]=_0x3e041a;}else{_0x8c9528[_0xd1d2('0x4e')]='';}return getAdminId(_0x1169f7,_0x468844,_0x1195f0,_0x400bad)[_0xd1d2('0x19')](getUser(_0x468844,_0x1195f0,_0x400bad))[_0xd1d2('0x19')](getEndUser(_0x468844,_0x1195f0,_0x400bad))[_0xd1d2('0x19')](getTicket(_0x468844,_0x1195f0,_0x400bad,_0x3da10d,_0x8c9528))[_0xd1d2('0x19')](function(_0x3d8083){logger['info'](util[_0xd1d2('0x2e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3d8083[_0xd1d2('0x37')]));if(_0x468844!=='unmanaged'){logger['info']('['+[_0x468844[_0xd1d2('0x21')]()]+']',_0xd1d2('0x51'));emit(_0x400bad,_0x50890e[_0xd1d2('0x52')],_0x3d8083[_0xd1d2('0x28')]);}})[_0xd1d2('0x15')](function(_0x1c5cdd){logger[_0xd1d2('0x20')]('['+[_0x468844[_0xd1d2('0x21')]()]+_0xd1d2('0x53'),util['inspect'](_0x1c5cdd,{'showHidden':!![],'depth':null}));});}; \ 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 b2d516b..1922c46 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 _0xce35=['./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0xce35,0xb0));var _0x5ce3=function(_0xdfd4bd,_0x3cbc3b){_0xdfd4bd=_0xdfd4bd-0x0;var _0x3385e5=_0xce35[_0xdfd4bd];return _0x3385e5;};'use strict';var _=require('lodash');var util=require(_0x5ce3('0x0'));var zendesk=require(_0x5ce3('0x1'));var salesforce=require(_0x5ce3('0x2'));var sugarcrm=require(_0x5ce3('0x3'));var freshdesk=require(_0x5ce3('0x4'));var zoho=require(_0x5ce3('0x5'));var desk=require(_0x5ce3('0x6'));var vtiger=require(_0x5ce3('0x7'));var servicenow=require(_0x5ce3('0x8'));var dynamics365=require(_0x5ce3('0x9'));var freshsales=require('./freshsales');var integrations=[_0x5ce3('0xa'),_0x5ce3('0xb'),_0x5ce3('0xc'),_0x5ce3('0xd'),_0x5ce3('0xe'),_0x5ce3('0xf'),_0x5ce3('0x10'),_0x5ce3('0x11'),_0x5ce3('0x12'),_0x5ce3('0x13')];exports['exec']=function(_0x24bffb,_0x2be9b9,_0x586120,_0xd8cc70,_0x569d96,_0x2f502f){if(_0x586120){if(_[_0x5ce3('0x14')](integrations,_0x24bffb[_0x5ce3('0x15')]['toLowerCase']())){try{var _0x522a98=null;var _0x21b93c='';var _0x363d6e=_0x586120[_0x24bffb[_0x5ce3('0x15')][_0x5ce3('0x16')]()];if(_0x363d6e){var _0x3d3fea=_0x363d6e[_0x24bffb[_0x5ce3('0x17')]];if(_0x3d3fea){var _0x30dc12=_[_0x5ce3('0x18')](_0x3d3fea['Configurations'],{'id':parseInt(_0x24bffb[_0x5ce3('0x19')],0xa)});if(_0x30dc12){if(_0xd8cc70){if(_0x569d96&&_0x2be9b9[_0x5ce3('0x1a')]){_0x21b93c='queue';}else if(_0x2be9b9['routeId']){_0x21b93c=_0x5ce3('0x1b');}else{console[_0x5ce3('0x1c')](_0x5ce3('0x1d'),_0x2be9b9);}}else{_0x21b93c=_0x5ce3('0x1e');}switch(_0x24bffb['data1'][_0x5ce3('0x16')]()){case _0x5ce3('0xa'):zendesk[_0x21b93c](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f);break;case'salesforce':salesforce[_0x21b93c](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f);break;case'sugarcrm':sugarcrm[_0x21b93c](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f);break;case'freshdesk':freshdesk[_0x21b93c](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f);break;case _0x5ce3('0xe'):zoho[_0x21b93c](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f);break;case'desk':desk[_0x21b93c](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f);break;case _0x5ce3('0x10'):vtiger[_0x21b93c](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f);break;case'freshsales':freshsales['cs'](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f,_0x21b93c);break;case _0x5ce3('0x13'):servicenow['cs'](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f,_0x21b93c);break;case _0x5ce3('0x11'):dynamics365['cs'](_0x24bffb,_0x2be9b9,_0x30dc12,_0xd8cc70,_0x569d96,_0x3d3fea,_0x2f502f,_0x21b93c);break;default:console['log']('unknown\x20integration');}}else{_0x522a98=require('../../../../config/logger')(_0x24bffb[_0x5ce3('0x15')][_0x5ce3('0x16')]());_0x522a98['error']('[EXEC]',util[_0x5ce3('0x1f')](_0x5ce3('0x20'),_0x24bffb[_0x5ce3('0x15')][_0x5ce3('0x16')](),_0x24bffb[_0x5ce3('0x19')]));}}else{_0x522a98=require(_0x5ce3('0x21'))(_0x24bffb[_0x5ce3('0x15')][_0x5ce3('0x16')]());_0x522a98[_0x5ce3('0x22')](_0x5ce3('0x23'),util['format'](_0x5ce3('0x24'),_0x24bffb[_0x5ce3('0x15')][_0x5ce3('0x16')](),_0x24bffb[_0x5ce3('0x17')]));}}else{}}catch(_0x433444){console[_0x5ce3('0x22')](_0x433444);}}}}; \ No newline at end of file +var _0xfd2f=['routeId','outbound','log','EVENT\x20UNKNOWN','freshdesk','zoho','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue'];(function(_0x23f50f,_0x437357){var _0x26e2f3=function(_0x463099){while(--_0x463099){_0x23f50f['push'](_0x23f50f['shift']());}};_0x26e2f3(++_0x437357);}(_0xfd2f,0x147));var _0xffd2=function(_0x415f3f,_0x4addb7){_0x415f3f=_0x415f3f-0x0;var _0xf78af4=_0xfd2f[_0x415f3f];return _0xf78af4;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xffd2('0x0'));var zoho=require(_0xffd2('0x1'));var desk=require(_0xffd2('0x2'));var vtiger=require(_0xffd2('0x3'));var servicenow=require(_0xffd2('0x4'));var dynamics365=require(_0xffd2('0x5'));var freshsales=require(_0xffd2('0x6'));var integrations=[_0xffd2('0x7'),_0xffd2('0x8'),_0xffd2('0x9'),'freshdesk','zoho',_0xffd2('0xa'),_0xffd2('0xb'),_0xffd2('0xc'),_0xffd2('0xd'),_0xffd2('0xe')];exports[_0xffd2('0xf')]=function(_0x166b52,_0x10e8c6,_0x5be3f5,_0xea568e,_0x458a50,_0x2a1141){if(_0x5be3f5){if(_['includes'](integrations,_0x166b52[_0xffd2('0x10')][_0xffd2('0x11')]())){try{var _0x552286=null;var _0x16b387='';var _0x148481=_0x5be3f5[_0x166b52[_0xffd2('0x10')][_0xffd2('0x11')]()];if(_0x148481){var _0x30f8db=_0x148481[_0x166b52[_0xffd2('0x12')]];if(_0x30f8db){var _0x6ff89e=_[_0xffd2('0x13')](_0x30f8db[_0xffd2('0x14')],{'id':parseInt(_0x166b52[_0xffd2('0x15')],0xa)});if(_0x6ff89e){if(_0xea568e){if(_0x458a50&&_0x10e8c6[_0xffd2('0x16')]){_0x16b387='queue';}else if(_0x10e8c6[_0xffd2('0x17')]){_0x16b387=_0xffd2('0x18');}else{console[_0xffd2('0x19')](_0xffd2('0x1a'),_0x10e8c6);}}else{_0x16b387='unmanaged';}switch(_0x166b52[_0xffd2('0x10')]['toLowerCase']()){case'zendesk':zendesk[_0x16b387](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141);break;case _0xffd2('0x8'):salesforce[_0x16b387](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141);break;case _0xffd2('0x9'):sugarcrm[_0x16b387](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141);break;case _0xffd2('0x1b'):freshdesk[_0x16b387](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141);break;case _0xffd2('0x1c'):zoho[_0x16b387](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141);break;case _0xffd2('0xa'):desk[_0x16b387](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141);break;case _0xffd2('0xb'):vtiger[_0x16b387](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141);break;case _0xffd2('0xd'):freshsales['cs'](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141,_0x16b387);break;case _0xffd2('0xe'):servicenow['cs'](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141,_0x16b387);break;case _0xffd2('0xc'):dynamics365['cs'](_0x166b52,_0x10e8c6,_0x6ff89e,_0xea568e,_0x458a50,_0x30f8db,_0x2a1141,_0x16b387);break;default:console[_0xffd2('0x19')]('unknown\x20integration');}}else{_0x552286=require(_0xffd2('0x1d'))(_0x166b52[_0xffd2('0x10')][_0xffd2('0x11')]());_0x552286[_0xffd2('0x1e')](_0xffd2('0x1f'),util[_0xffd2('0x20')](_0xffd2('0x21'),_0x166b52[_0xffd2('0x10')]['toLowerCase'](),_0x166b52['data3']));}}else{_0x552286=require(_0xffd2('0x1d'))(_0x166b52[_0xffd2('0x10')][_0xffd2('0x11')]());_0x552286[_0xffd2('0x1e')](_0xffd2('0x1f'),util[_0xffd2('0x20')](_0xffd2('0x22'),_0x166b52[_0xffd2('0x10')][_0xffd2('0x11')](),_0x166b52[_0xffd2('0x12')]));}}else{}}catch(_0x298c90){console[_0xffd2('0x1e')](_0x298c90);}}}}; \ 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 27dd9ca..2e27720 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 _0x2f30=['sobject','validateEmail','User','find','execute','then','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','account_contact_lead','additionalSearchAccount','Contact','Lead','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','format','Company','No\x20Company','create','forEach','includes','string','idField','content','toString','variableName','customVariable','Variable','name','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','[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','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','isNil','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','defaults','localhost','socket.io-emitter','redis','getString','Subjects','Descriptions','Task','ActivityDate','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','ticketType','Case','account','AccountId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0x2f30,0x160));var _0x02f3=function(_0x3e4f40,_0x5ab65b){_0x3e4f40=_0x3e4f40-0x0;var _0x258d1d=_0x2f30[_0x3e4f40];return _0x258d1d;};'use strict';var _=require(_0x02f3('0x0'));var rp=require(_0x02f3('0x1'));var moment=require(_0x02f3('0x2'));var BPromise=require(_0x02f3('0x3'));var md5=require(_0x02f3('0x4'));var jsforce=require(_0x02f3('0x5'));var util=require(_0x02f3('0x6'));var Redis=require(_0x02f3('0x7'));var intUtil=require(_0x02f3('0x8'));var config=require('../../../../config/environment');var logger=require(_0x02f3('0x9'))(_0x02f3('0xa'));config['redis']=_[_0x02f3('0xb')](config['redis'],{'host':_0x02f3('0xc'),'port':0x18eb});var io=require(_0x02f3('0xd'))(new Redis(config[_0x02f3('0xe')]));function emit(_0xcd5b34,_0x2a42bb,_0x1bd667){io['to'](_0xcd5b34)['emit'](_0x2a42bb,_0x1bd667);}function getTicket(_0x428657,_0x1364a7,_0x1d09de,_0x9a1629,_0x3be7ad,_0x2471e9,_0x336ee4,_0x44b0ba){var _0x2b4b3b=Object['assign']({},{'OwnerId':_0x1364a7['id'],'Subject':intUtil[_0x02f3('0xf')](_0x9a1629[_0x02f3('0x10')],_0x3be7ad,'\x20'),'Description':intUtil[_0x02f3('0xf')](_0x9a1629[_0x02f3('0x11')],_0x3be7ad,'\x0a')},getCustomFields(_0x2471e9,_0x3be7ad));if(_0x1d09de){if(_0x9a1629['ticketType']===_0x02f3('0x12')){_0x2b4b3b[_0x02f3('0x13')]=moment['utc']();_0x2b4b3b['IsReminderSet']=![];_0x2b4b3b[_0x02f3('0x14')]=![];if(_0x1d09de[_0x02f3('0x15')]===_0x02f3('0x16')||_0x1d09de[_0x02f3('0x15')]===_0x02f3('0x17')){_0x2b4b3b[_0x02f3('0x18')]=_0x1d09de['id'];}else if(_0x1d09de['endUserType']==='account'){_0x2b4b3b[_0x02f3('0x19')]=_0x1d09de['id'];}}else if(_0x9a1629[_0x02f3('0x1a')]===_0x02f3('0x1b')){if(_0x1d09de[_0x02f3('0x15')]===_0x02f3('0x16')){_0x2b4b3b['ContactId']=_0x1d09de['id'];}else if(_0x1d09de[_0x02f3('0x15')]===_0x02f3('0x1c')){_0x2b4b3b[_0x02f3('0x1d')]=_0x1d09de['id'];}else if(_0x1d09de['endUserType']===_0x02f3('0x17')&&_0x9a1629['leadId']){_0x2b4b3b[_0x9a1629['leadId']]=_0x1d09de['id'];}else{logger[_0x02f3('0x1e')](_0x02f3('0x1f'));}}}return _0x336ee4[_0x02f3('0x20')](_0x9a1629[_0x02f3('0x1a')])['create'](_0x2b4b3b);}function getUser(_0x73e6d6,_0x163194,_0x5c0680){if(!_['isNil'](_0x163194)&&intUtil[_0x02f3('0x21')](_0x163194)){var _0x5eb2b8={'Email':_0x163194};var _0x5a3f3f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5c0680[_0x02f3('0x20')](_0x02f3('0x22'))[_0x02f3('0x23')](_0x5eb2b8,_0x5a3f3f)[_0x02f3('0x24')]()[_0x02f3('0x25')](function(_0x293c15){if(_0x293c15['length']){var _0x562b39=_['find'](_0x293c15,function(_0x45b04d){return _0x45b04d[_0x02f3('0x26')]===_0x163194;});if(_0x562b39){logger[_0x02f3('0x1e')](_0x02f3('0x27'),_0x163194);return BPromise['resolve']({'id':_0x562b39['Id'],'name':_0x562b39[_0x02f3('0x28')]});}}else{logger[_0x02f3('0x1e')](_0x02f3('0x29'),_0x163194);return _0x5c0680[_0x02f3('0x2a')]()[_0x02f3('0x25')](function(_0x163d07){return BPromise[_0x02f3('0x2b')]({'id':_0x163d07['user_id'],'name':_0x163d07[_0x02f3('0x2c')]});});}});}else{logger[_0x02f3('0x1e')](_0x02f3('0x29'),_0x163194);return _0x5c0680[_0x02f3('0x2a')]()[_0x02f3('0x25')](function(_0x48f6ff){return BPromise[_0x02f3('0x2b')]({'id':_0x48f6ff['user_id'],'name':_0x48f6ff[_0x02f3('0x2c')]});});}}function getEndUser(_0x55c28b,_0x46f84e,_0x566606,_0x4b03ec,_0x46928a){var _0x5cdeaa={'$or':{'Phone':_0x4b03ec}};var _0x2bb4ef={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x02f3('0x2b')]()[_0x02f3('0x25')](function(){logger[_0x02f3('0x1e')](_0x02f3('0x2d'),_0x4b03ec,_0x46f84e[_0x02f3('0x2e')]);switch(_0x46f84e['moduleSearch']){case _0x02f3('0x2f'):var _0x418b9b=_[_0x02f3('0x30')](_0x5cdeaa);if(_0x46f84e[_0x02f3('0x31')]){var _0x297ed1={};_0x297ed1[_0x46f84e['additionalSearchContact']]=_0x4b03ec;_[_0x02f3('0x32')](_0x418b9b[_0x02f3('0x33')],_0x297ed1);}return _0x46928a[_0x02f3('0x20')]('Contact')[_0x02f3('0x23')](_0x418b9b,_0x2bb4ef)[_0x02f3('0x24')]()[_0x02f3('0x25')](function(_0x4bd7b0){if(_0x4bd7b0&&_0x4bd7b0[_0x02f3('0x34')]){return _0x4bd7b0;}else{var _0x170001=_['cloneDeep'](_0x5cdeaa);if(_0x46f84e[_0x02f3('0x35')]){var _0x5233e0={};_0x5233e0[_0x46f84e[_0x02f3('0x35')]]=_0x4b03ec;_[_0x02f3('0x32')](_0x170001[_0x02f3('0x33')],_0x5233e0);}return _0x46928a[_0x02f3('0x20')]('Lead')[_0x02f3('0x23')](_0x170001,_0x2bb4ef);}});case _0x02f3('0x36'):var _0x135747=_[_0x02f3('0x30')](_0x5cdeaa);if(_0x46f84e['additionalSearchAccount']){var _0x297ed1={};_0x297ed1[_0x46f84e[_0x02f3('0x37')]]=_0x4b03ec;_['merge'](_0x135747[_0x02f3('0x33')],_0x297ed1);}return _0x46928a[_0x02f3('0x20')]('Account')[_0x02f3('0x23')](_0x135747,_0x2bb4ef)['execute']()[_0x02f3('0x25')](function(_0x3899c5){if(_0x3899c5&&_0x3899c5['length']){return _0x3899c5;}else{var _0x17d8f3=_[_0x02f3('0x30')](_0x5cdeaa);if(_0x46f84e['additionalSearchContact']){var _0x2e9126={};_0x2e9126[_0x46f84e[_0x02f3('0x31')]]=_0x4b03ec;_[_0x02f3('0x32')](_0x17d8f3[_0x02f3('0x33')],_0x2e9126);}return _0x46928a[_0x02f3('0x20')](_0x02f3('0x38'))['find'](_0x17d8f3,_0x2bb4ef)['then'](function(_0x3a14be){if(_0x3a14be&&_0x3a14be[_0x02f3('0x34')]){return _0x3a14be;}else{var _0x506d23=_[_0x02f3('0x30')](_0x5cdeaa);if(_0x46f84e[_0x02f3('0x35')]){var _0x3781f1={};_0x3781f1[_0x46f84e['additionalSearchLead']]=_0x4b03ec;_[_0x02f3('0x32')](_0x506d23[_0x02f3('0x33')],_0x3781f1);}return _0x46928a[_0x02f3('0x20')](_0x02f3('0x39'))[_0x02f3('0x23')](_0x506d23,_0x2bb4ef);}});}});case _0x02f3('0x16'):var _0x418b9b=_['cloneDeep'](_0x5cdeaa);if(_0x46f84e[_0x02f3('0x31')]){var _0x297ed1={};_0x297ed1[_0x46f84e['additionalSearchContact']]=_0x4b03ec;_[_0x02f3('0x32')](_0x418b9b[_0x02f3('0x33')],_0x297ed1);}return _0x46928a[_0x02f3('0x20')](_0x02f3('0x38'))[_0x02f3('0x23')](_0x418b9b,_0x2bb4ef)[_0x02f3('0x24')]();case _0x02f3('0x17'):var _0x32379e=_[_0x02f3('0x30')](_0x5cdeaa);if(_0x46f84e['additionalSearchLead']){var _0x297ed1={};_0x297ed1[_0x46f84e[_0x02f3('0x35')]]=_0x4b03ec;_['merge'](_0x32379e[_0x02f3('0x33')],_0x297ed1);}return _0x46928a['sobject'](_0x02f3('0x39'))[_0x02f3('0x23')](_0x32379e,_0x2bb4ef);case _0x02f3('0x1c'):var _0x135747=_[_0x02f3('0x30')](_0x5cdeaa);if(_0x46f84e[_0x02f3('0x37')]){var _0x297ed1={};_0x297ed1[_0x46f84e[_0x02f3('0x37')]]=_0x4b03ec;_[_0x02f3('0x32')](_0x135747[_0x02f3('0x33')],_0x297ed1);}return _0x46928a['sobject']('Account')[_0x02f3('0x23')](_0x135747,_0x2bb4ef);default:return null;}})[_0x02f3('0x25')](function(_0x5a4e18){if(_0x5a4e18&&_0x5a4e18['length']){var _0x356990=_['first'](_0x5a4e18);if(_0x356990){return BPromise[_0x02f3('0x2b')]({'id':_0x356990['Id'],'name':_0x356990[_0x02f3('0x28')],'phone':_0x356990[_0x02f3('0x3a')],'endUserType':_0x356990[_0x02f3('0x3b')][_0x02f3('0x3c')][_0x02f3('0x3d')]()});}}})[_0x02f3('0x25')](function(_0x45c45f){if(_0x45c45f){logger[_0x02f3('0x1e')](_0x02f3('0x3e'),_0x45c45f[_0x02f3('0x15')],_0x4b03ec);return BPromise[_0x02f3('0x2b')](_0x45c45f);}else{logger[_0x02f3('0x1e')](_0x02f3('0x3f'),_0x4b03ec);var _0x484a04={'Phone':_0x4b03ec};if(_0x46f84e[_0x02f3('0x40')]){if(_0x46f84e[_0x02f3('0x40')]===_0x02f3('0x16')){logger[_0x02f3('0x1e')](_0x02f3('0x41'),_0x4b03ec,_0x46f84e[_0x02f3('0x40')]);_0x484a04['LastName']=_0x566606!==_0x02f3('0x42')?_0x566606:util['format'](_0x02f3('0x43'),_0x4b03ec);}else if(_0x46f84e[_0x02f3('0x40')]===_0x02f3('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4b03ec,_0x46f84e[_0x02f3('0x40')]);_0x484a04['LastName']=_0x566606!==_0x02f3('0x42')?_0x566606:util[_0x02f3('0x44')](_0x02f3('0x43'),_0x4b03ec);_0x484a04[_0x02f3('0x45')]=_0x02f3('0x46');}else if(_0x46f84e[_0x02f3('0x40')]===_0x02f3('0x1c')){logger[_0x02f3('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4b03ec,_0x46f84e[_0x02f3('0x40')]);_0x484a04['Name']=_0x566606!==''?_0x566606:util[_0x02f3('0x44')](_0x02f3('0x43'),_0x4b03ec);}else{return null;}}return _0x46928a['sobject'](_['upperFirst'](_0x46f84e[_0x02f3('0x40')]))[_0x02f3('0x47')](_0x484a04)['then'](function(_0x114cbd){return BPromise['resolve']({'id':_0x114cbd['id'],'endUserType':_0x46f84e[_0x02f3('0x40')]});});}});}function getCustomFields(_0x149e63,_0x57348e){var _0x5a8f9b={};if(_0x149e63[_0x02f3('0x34')]>0x0){_[_0x02f3('0x48')](_0x149e63,function(_0x41dbbe){if(_[_0x02f3('0x49')]([_0x02f3('0x4a'),'picklist'],_0x41dbbe[_0x02f3('0x3c')])&&_0x41dbbe[_0x02f3('0x4b')]){_0x5a8f9b[_0x41dbbe[_0x02f3('0x4b')]]=_0x41dbbe[_0x02f3('0x4c')][_0x02f3('0x4d')]();}else if(_0x41dbbe[_0x02f3('0x3c')]==='variable'&&_0x41dbbe[_0x02f3('0x4e')]&&_0x41dbbe['idField']){_0x57348e[_0x41dbbe[_0x02f3('0x4e')]]&&(_0x5a8f9b[_0x41dbbe[_0x02f3('0x4b')]]=_0x57348e[_0x41dbbe[_0x02f3('0x4e')]][_0x02f3('0x4d')]());}else if(_0x41dbbe['type']===_0x02f3('0x4f')&&_0x41dbbe[_0x02f3('0x50')]&&_0x41dbbe['Variable'][_0x02f3('0x51')]&&_0x41dbbe['idField']){_0x57348e[_0x41dbbe[_0x02f3('0x50')][_0x02f3('0x51')][_0x02f3('0x3d')]()]&&(_0x5a8f9b[_0x41dbbe[_0x02f3('0x4b')]]=_0x57348e[_0x41dbbe[_0x02f3('0x50')][_0x02f3('0x51')][_0x02f3('0x3d')]()][_0x02f3('0x4d')]());}});}return _0x5a8f9b;}function getConnection(_0x719a73){var _0x3968e0=_0x719a73['password']['concat'](_0x719a73[_0x02f3('0x52')]);var _0x1e03a9=new jsforce[(_0x02f3('0x53'))]({'oauth2':{'loginUrl':_0x719a73[_0x02f3('0x54')]||_0x02f3('0x55'),'clientId':_0x719a73[_0x02f3('0x56')],'clientSecret':_0x719a73[_0x02f3('0x57')]}});return _0x1e03a9[_0x02f3('0x58')](_0x719a73['username'],_0x3968e0)[_0x02f3('0x25')](function(){logger[_0x02f3('0x1e')](_0x02f3('0x59'));return _0x1e03a9;});}exports[_0x02f3('0x5a')]=function(_0x21353a,_0x322cc6,_0x7a798e,_0x31e5b1,_0x546f0b,_0x5ea3df){var _0x18e105,_0x37e4e3,_0x3fa46e,_0x25f03e;_0x5ea3df[_0x02f3('0x5b')]=intUtil[_0x02f3('0x5c')](_0x5ea3df[_0x02f3('0x5b')]);_0x5ea3df[_0x02f3('0x54')]=intUtil['stripTrailingSlash'](_0x5ea3df[_0x02f3('0x54')]);if(_0x546f0b&&_0x546f0b[_0x02f3('0x5d')]){logger[_0x02f3('0x1e')](_0x02f3('0x5e'),_0x02f3('0x5f'));_0x322cc6[_0x02f3('0x60')]=util[_0x02f3('0x44')](_0x02f3('0x61'),_0x5ea3df[_0x02f3('0x5b')],_0x322cc6['uniqueid'],md5(_0x322cc6[_0x02f3('0x62')]));}else{_0x322cc6[_0x02f3('0x60')]='';}return getConnection(_0x5ea3df)[_0x02f3('0x25')](function(_0x24a30b){_0x25f03e=_0x24a30b;return getUser(_0x5ea3df,_0x31e5b1['email'],_0x25f03e);})[_0x02f3('0x25')](function(_0x3d115a){_0x18e105=_0x3d115a;return getEndUser(_0x5ea3df,_0x7a798e,_0x322cc6['calleridname'],_0x322cc6[_0x02f3('0x63')],_0x25f03e);})[_0x02f3('0x25')](function(_0x503d88){_0x37e4e3=_0x503d88;return getTicket(_0x5ea3df,_0x18e105,_0x37e4e3,_0x7a798e,_0x322cc6,_0x7a798e['Fields'],_0x25f03e,_0x02f3('0x5a'));})[_0x02f3('0x25')](function(_0x72d312){_0x3fa46e=_0x72d312;logger[_0x02f3('0x1e')](_0x02f3('0x64'),_0x3fa46e['id']);logger[_0x02f3('0x1e')](_0x02f3('0x65'),_0x3fa46e['id'],_0x31e5b1[_0x02f3('0x51')],_0x5ea3df[_0x02f3('0x3c')]);switch(_0x5ea3df['type']){case'integrationTab':emit(util['format']('user:%s',_0x31e5b1[_0x02f3('0x51')]),_0x02f3('0x66'),{'recordId':_0x3fa46e['id']});break;case _0x02f3('0x67'):emit(util['format'](_0x02f3('0x68'),_0x31e5b1[_0x02f3('0x51')]),'trigger:browser:url',{'uri':util[_0x02f3('0x44')](_0x02f3('0x69'),_0x25f03e[_0x02f3('0x6a')],_0x3fa46e['id'])});break;default:logger[_0x02f3('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x02f3('0x6c')](function(_0x388569){logger['error'](_0x02f3('0x5e'),_0x388569);});};exports[_0x02f3('0x6d')]=function(_0x579daf,_0xf5896f,_0x1fed2b,_0x55f226,_0x26df16,_0x384f38,_0x4ec376){var _0x155447,_0x5ae3b6,_0x571330,_0x435c35;_0x384f38['serverUrl']=intUtil[_0x02f3('0x5c')](_0x384f38[_0x02f3('0x5b')]);_0x384f38[_0x02f3('0x54')]=intUtil[_0x02f3('0x5c')](_0x384f38[_0x02f3('0x54')]);if(_0x4ec376&&_0x4ec376['recordingFormat']&&_0x4ec376[_0x02f3('0x6e')]!==_0x02f3('0x6f')){logger[_0x02f3('0x1e')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xf5896f[_0x02f3('0x60')]=util[_0x02f3('0x44')](_0x02f3('0x61'),_0x384f38[_0x02f3('0x5b')],_0xf5896f[_0x02f3('0x62')],md5(_0xf5896f[_0x02f3('0x62')]));}return getConnection(_0x384f38)[_0x02f3('0x25')](function(_0x12faa8){_0x435c35=_0x12faa8;return getUser(_0x384f38,_0x55f226[_0x02f3('0x70')],_0x435c35);})[_0x02f3('0x25')](function(_0x37f41f){_0x155447=_0x37f41f;return getEndUser(_0x384f38,_0x1fed2b,_0xf5896f[_0x02f3('0x71')],_0xf5896f[_0x02f3('0x72')],_0x435c35);})[_0x02f3('0x25')](function(_0x456a97){_0x5ae3b6=_0x456a97;return getTicket(_0x384f38,_0x155447,_0x5ae3b6,_0x1fed2b,_0xf5896f,_0x1fed2b[_0x02f3('0x73')],_0x435c35,_0x02f3('0x6d'));})[_0x02f3('0x25')](function(_0x5827a2){_0x571330=_0x5827a2;logger[_0x02f3('0x1e')](_0x02f3('0x74'),_0x571330['id']);logger[_0x02f3('0x1e')](_0x02f3('0x75'),_0x571330['id'],_0x55f226[_0x02f3('0x51')],_0x384f38[_0x02f3('0x3c')]);switch(_0x384f38[_0x02f3('0x3c')]){case _0x02f3('0x76'):emit(util['format']('user:%s',_0x55f226[_0x02f3('0x51')]),_0x02f3('0x66'),{'recordId':_0x571330['id']});break;case _0x02f3('0x67'):emit(util[_0x02f3('0x44')](_0x02f3('0x68'),_0x55f226[_0x02f3('0x51')]),_0x02f3('0x77'),{'uri':util[_0x02f3('0x44')](_0x02f3('0x69'),_0x435c35[_0x02f3('0x6a')],_0x571330['id'])});break;default:logger[_0x02f3('0x6b')](_0x02f3('0x78'),_0x02f3('0x79'));}})[_0x02f3('0x6c')](function(_0x413e4c){logger[_0x02f3('0x6b')](_0x02f3('0x78'),_0x413e4c);});};exports['unmanaged']=function(_0x312aba,_0x59130f,_0x32fbe8,_0x5621da,_0x5a9b9d,_0xff96ac){var _0x321cf1,_0x2ac0ba,_0x496f87,_0x1d90de;_0xff96ac[_0x02f3('0x5b')]=intUtil[_0x02f3('0x5c')](_0xff96ac[_0x02f3('0x5b')]);_0xff96ac[_0x02f3('0x54')]=intUtil[_0x02f3('0x5c')](_0xff96ac[_0x02f3('0x54')]);if(_0x5a9b9d&&_0x5a9b9d['monitor_format']){logger[_0x02f3('0x1e')]('['+_0x59130f[_0x02f3('0x7a')][_0x02f3('0x7b')]()+']',_0x02f3('0x5f'));_0x59130f[_0x02f3('0x60')]=util[_0x02f3('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xff96ac[_0x02f3('0x5b')],_0x59130f[_0x02f3('0x62')],md5(_0x59130f[_0x02f3('0x62')]));}else{_0x59130f['recordingURL']='';}return getConnection(_0xff96ac)['then'](function(_0x5c3947){_0x1d90de=_0x5c3947;if(!_[_0x02f3('0x7c')](_0x5621da)){return getUser(_0xff96ac,_0x5621da[_0x02f3('0x51')],_0x1d90de);}else{return getUser(_0xff96ac,null,_0x1d90de);}})[_0x02f3('0x25')](function(_0x48d422){_0x321cf1=_0x48d422;return getEndUser(_0xff96ac,_0x32fbe8,_0x59130f[_0x02f3('0x7d')],_0x59130f[_0x02f3('0x63')],_0x1d90de);})[_0x02f3('0x25')](function(_0x56337d){_0x2ac0ba=_0x56337d;return getTicket(_0xff96ac,_0x321cf1,_0x2ac0ba,_0x32fbe8,_0x59130f,_0x32fbe8[_0x02f3('0x73')],_0x1d90de);})['then'](function(_0x4ae14a){_0x496f87=_0x4ae14a;logger['info']('['+_0x59130f[_0x02f3('0x7a')][_0x02f3('0x7b')]()+_0x02f3('0x7e'),_0x496f87['id']);logger[_0x02f3('0x1e')]('['+_0x59130f[_0x02f3('0x7a')][_0x02f3('0x7b')]()+_0x02f3('0x7f'),_0xff96ac[_0x02f3('0x3c')]);})[_0x02f3('0x6c')](function(_0x33485a){logger[_0x02f3('0x6b')]('['+_0x59130f[_0x02f3('0x7a')][_0x02f3('0x7b')]()+']',_0x33485a);});}; \ No newline at end of file +var _0xe89a=['cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','length','Contact','contact','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','format','upperFirst','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','newTab','trigger:browser:url','error','catch','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','%s/%s/e','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridnum',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','ticketType','Task','utc','IsReminderSet','endUserType','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','then','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.'];(function(_0xcb45c5,_0x451c98){var _0x3626eb=function(_0x2c652b){while(--_0x2c652b){_0xcb45c5['push'](_0xcb45c5['shift']());}};_0x3626eb(++_0x451c98);}(_0xe89a,0x1c5));var _0xae89=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xe89a[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var rp=require(_0xae89('0x0'));var moment=require(_0xae89('0x1'));var BPromise=require(_0xae89('0x2'));var md5=require(_0xae89('0x3'));var jsforce=require('jsforce');var util=require(_0xae89('0x4'));var Redis=require(_0xae89('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xae89('0x6'))('salesforce');config['redis']=_[_0xae89('0x7')](config[_0xae89('0x8')],{'host':_0xae89('0x9'),'port':0x18eb});var io=require(_0xae89('0xa'))(new Redis(config[_0xae89('0x8')]));function emit(_0x431447,_0x42999c,_0x61edf2){io['to'](_0x431447)[_0xae89('0xb')](_0x42999c,_0x61edf2);}function getTicket(_0x221dde,_0x5bb22f,_0x4984ed,_0x206e17,_0x552345,_0x57252e,_0xc5466,_0x518569){var _0x11aad2=Object[_0xae89('0xc')]({},{'OwnerId':_0x5bb22f['id'],'Subject':intUtil[_0xae89('0xd')](_0x206e17['Subjects'],_0x552345,'\x20'),'Description':intUtil[_0xae89('0xd')](_0x206e17['Descriptions'],_0x552345,'\x0a')},getCustomFields(_0x57252e,_0x552345));if(_0x4984ed){if(_0x206e17[_0xae89('0xe')]===_0xae89('0xf')){_0x11aad2['ActivityDate']=moment[_0xae89('0x10')]();_0x11aad2[_0xae89('0x11')]=![];_0x11aad2['IsRecurrence']=![];if(_0x4984ed[_0xae89('0x12')]==='contact'||_0x4984ed['endUserType']===_0xae89('0x13')){_0x11aad2[_0xae89('0x14')]=_0x4984ed['id'];}else if(_0x4984ed['endUserType']===_0xae89('0x15')){_0x11aad2[_0xae89('0x16')]=_0x4984ed['id'];}}else if(_0x206e17[_0xae89('0xe')]==='Case'){if(_0x4984ed[_0xae89('0x12')]==='contact'){_0x11aad2[_0xae89('0x17')]=_0x4984ed['id'];}else if(_0x4984ed[_0xae89('0x12')]==='account'){_0x11aad2[_0xae89('0x18')]=_0x4984ed['id'];}else if(_0x4984ed[_0xae89('0x12')]===_0xae89('0x13')&&_0x206e17[_0xae89('0x19')]){_0x11aad2[_0x206e17['leadId']]=_0x4984ed['id'];}else{logger['info'](_0xae89('0x1a'));}}}return _0xc5466[_0xae89('0x1b')](_0x206e17['ticketType'])[_0xae89('0x1c')](_0x11aad2);}function getUser(_0x227450,_0x565999,_0x3162a3){if(!_[_0xae89('0x1d')](_0x565999)&&intUtil[_0xae89('0x1e')](_0x565999)){var _0x3cfccb={'Email':_0x565999};var _0x5b9d50={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3162a3[_0xae89('0x1b')]('User')[_0xae89('0x1f')](_0x3cfccb,_0x5b9d50)[_0xae89('0x20')]()['then'](function(_0x4338e7){if(_0x4338e7['length']){var _0x54e127=_['find'](_0x4338e7,function(_0x37c428){return _0x37c428[_0xae89('0x21')]===_0x565999;});if(_0x54e127){logger[_0xae89('0x22')]('Agent\x20%s\x20found.',_0x565999);return BPromise[_0xae89('0x23')]({'id':_0x54e127['Id'],'name':_0x54e127[_0xae89('0x24')]});}}else{logger[_0xae89('0x22')](_0xae89('0x25'),_0x565999);return _0x3162a3[_0xae89('0x26')]()['then'](function(_0x1fff70){return BPromise[_0xae89('0x23')]({'id':_0x1fff70['user_id'],'name':_0x1fff70[_0xae89('0x27')]});});}});}else{logger[_0xae89('0x22')](_0xae89('0x25'),_0x565999);return _0x3162a3['identity']()[_0xae89('0x28')](function(_0x5d0f5f){return BPromise[_0xae89('0x23')]({'id':_0x5d0f5f[_0xae89('0x29')],'name':_0x5d0f5f[_0xae89('0x27')]});});}}function getEndUser(_0x315e1f,_0x463eea,_0x139056,_0x2df7ce,_0x4dda13){var _0x257ef9={'$or':{'Phone':_0x2df7ce}};var _0x36fac4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xae89('0x23')]()['then'](function(){logger['info'](_0xae89('0x2a'),_0x2df7ce,_0x463eea['moduleSearch']);switch(_0x463eea['moduleSearch']){case'contact_lead':var _0x258422=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea[_0xae89('0x2c')]){var _0xfc3e92={};_0xfc3e92[_0x463eea[_0xae89('0x2c')]]=_0x2df7ce;_[_0xae89('0x2d')](_0x258422[_0xae89('0x2e')],_0xfc3e92);}return _0x4dda13[_0xae89('0x1b')]('Contact')[_0xae89('0x1f')](_0x258422,_0x36fac4)[_0xae89('0x20')]()[_0xae89('0x28')](function(_0x97aabd){if(_0x97aabd&&_0x97aabd['length']){return _0x97aabd;}else{var _0x11dda9=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea['additionalSearchLead']){var _0x541373={};_0x541373[_0x463eea[_0xae89('0x2f')]]=_0x2df7ce;_[_0xae89('0x2d')](_0x11dda9[_0xae89('0x2e')],_0x541373);}return _0x4dda13[_0xae89('0x1b')](_0xae89('0x30'))[_0xae89('0x1f')](_0x11dda9,_0x36fac4);}});case _0xae89('0x31'):var _0x35410b=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea['additionalSearchAccount']){var _0xfc3e92={};_0xfc3e92[_0x463eea[_0xae89('0x32')]]=_0x2df7ce;_[_0xae89('0x2d')](_0x35410b[_0xae89('0x2e')],_0xfc3e92);}return _0x4dda13[_0xae89('0x1b')]('Account')['find'](_0x35410b,_0x36fac4)['execute']()[_0xae89('0x28')](function(_0x4bf5c6){if(_0x4bf5c6&&_0x4bf5c6[_0xae89('0x33')]){return _0x4bf5c6;}else{var _0x180ce1=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea[_0xae89('0x2c')]){var _0x5ca0af={};_0x5ca0af[_0x463eea[_0xae89('0x2c')]]=_0x2df7ce;_[_0xae89('0x2d')](_0x180ce1['$or'],_0x5ca0af);}return _0x4dda13[_0xae89('0x1b')](_0xae89('0x34'))['find'](_0x180ce1,_0x36fac4)[_0xae89('0x28')](function(_0x2d5f2b){if(_0x2d5f2b&&_0x2d5f2b['length']){return _0x2d5f2b;}else{var _0x45efb9=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea[_0xae89('0x2f')]){var _0x479366={};_0x479366[_0x463eea[_0xae89('0x2f')]]=_0x2df7ce;_[_0xae89('0x2d')](_0x45efb9[_0xae89('0x2e')],_0x479366);}return _0x4dda13[_0xae89('0x1b')](_0xae89('0x30'))[_0xae89('0x1f')](_0x45efb9,_0x36fac4);}});}});case _0xae89('0x35'):var _0x258422=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea['additionalSearchContact']){var _0xfc3e92={};_0xfc3e92[_0x463eea['additionalSearchContact']]=_0x2df7ce;_['merge'](_0x258422[_0xae89('0x2e')],_0xfc3e92);}return _0x4dda13[_0xae89('0x1b')](_0xae89('0x34'))[_0xae89('0x1f')](_0x258422,_0x36fac4)['execute']();case'lead':var _0x4145e8=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea['additionalSearchLead']){var _0xfc3e92={};_0xfc3e92[_0x463eea[_0xae89('0x2f')]]=_0x2df7ce;_[_0xae89('0x2d')](_0x4145e8[_0xae89('0x2e')],_0xfc3e92);}return _0x4dda13[_0xae89('0x1b')]('Lead')[_0xae89('0x1f')](_0x4145e8,_0x36fac4);case _0xae89('0x15'):var _0x35410b=_[_0xae89('0x2b')](_0x257ef9);if(_0x463eea[_0xae89('0x32')]){var _0xfc3e92={};_0xfc3e92[_0x463eea['additionalSearchAccount']]=_0x2df7ce;_[_0xae89('0x2d')](_0x35410b[_0xae89('0x2e')],_0xfc3e92);}return _0x4dda13[_0xae89('0x1b')]('Account')['find'](_0x35410b,_0x36fac4);default:return null;}})[_0xae89('0x28')](function(_0x2f9662){if(_0x2f9662&&_0x2f9662[_0xae89('0x33')]){var _0x4beb65=_[_0xae89('0x36')](_0x2f9662);if(_0x4beb65){return BPromise[_0xae89('0x23')]({'id':_0x4beb65['Id'],'name':_0x4beb65[_0xae89('0x24')],'phone':_0x4beb65[_0xae89('0x37')],'endUserType':_0x4beb65[_0xae89('0x38')]['type'][_0xae89('0x39')]()});}}})[_0xae89('0x28')](function(_0x37f447){if(_0x37f447){logger[_0xae89('0x22')](_0xae89('0x3a'),_0x37f447[_0xae89('0x12')],_0x2df7ce);return BPromise['resolve'](_0x37f447);}else{logger[_0xae89('0x22')](_0xae89('0x3b'),_0x2df7ce);var _0x34b2df={'Phone':_0x2df7ce};if(_0x463eea[_0xae89('0x3c')]){if(_0x463eea[_0xae89('0x3c')]===_0xae89('0x35')){logger[_0xae89('0x22')](_0xae89('0x3d'),_0x2df7ce,_0x463eea['moduleCreate']);_0x34b2df[_0xae89('0x3e')]=_0x139056!==_0xae89('0x3f')?_0x139056:util['format'](_0xae89('0x40'),_0x2df7ce);}else if(_0x463eea[_0xae89('0x3c')]===_0xae89('0x13')){logger[_0xae89('0x22')](_0xae89('0x3d'),_0x2df7ce,_0x463eea[_0xae89('0x3c')]);_0x34b2df[_0xae89('0x3e')]=_0x139056!==_0xae89('0x3f')?_0x139056:util['format']('Caller\x20-\x20%s',_0x2df7ce);_0x34b2df[_0xae89('0x41')]='No\x20Company';}else if(_0x463eea[_0xae89('0x3c')]===_0xae89('0x15')){logger['info'](_0xae89('0x3d'),_0x2df7ce,_0x463eea[_0xae89('0x3c')]);_0x34b2df[_0xae89('0x24')]=_0x139056!==_0xae89('0x3f')?_0x139056:util[_0xae89('0x42')](_0xae89('0x40'),_0x2df7ce);}else{return null;}}return _0x4dda13[_0xae89('0x1b')](_[_0xae89('0x43')](_0x463eea[_0xae89('0x3c')]))[_0xae89('0x1c')](_0x34b2df)['then'](function(_0x1b4cc6){return BPromise[_0xae89('0x23')]({'id':_0x1b4cc6['id'],'endUserType':_0x463eea[_0xae89('0x3c')]});});}});}function getCustomFields(_0x4081e3,_0x5b67c3){var _0x45d488={};if(_0x4081e3['length']>0x0){_[_0xae89('0x44')](_0x4081e3,function(_0x5588d9){if(_[_0xae89('0x45')]([_0xae89('0x46'),_0xae89('0x47')],_0x5588d9[_0xae89('0x48')])&&_0x5588d9[_0xae89('0x49')]){_0x45d488[_0x5588d9['idField']]=_0x5588d9[_0xae89('0x4a')][_0xae89('0x4b')]();}else if(_0x5588d9[_0xae89('0x48')]===_0xae89('0x4c')&&_0x5588d9[_0xae89('0x4d')]&&_0x5588d9[_0xae89('0x49')]){_0x5b67c3[_0x5588d9[_0xae89('0x4d')]]&&(_0x45d488[_0x5588d9[_0xae89('0x49')]]=_0x5b67c3[_0x5588d9[_0xae89('0x4d')]][_0xae89('0x4b')]());}else if(_0x5588d9[_0xae89('0x48')]===_0xae89('0x4e')&&_0x5588d9[_0xae89('0x4f')]&&_0x5588d9[_0xae89('0x4f')][_0xae89('0x50')]&&_0x5588d9[_0xae89('0x49')]){_0x5b67c3[_0x5588d9[_0xae89('0x4f')][_0xae89('0x50')][_0xae89('0x39')]()]&&(_0x45d488[_0x5588d9[_0xae89('0x49')]]=_0x5b67c3[_0x5588d9[_0xae89('0x4f')][_0xae89('0x50')][_0xae89('0x39')]()][_0xae89('0x4b')]());}});}return _0x45d488;}function getConnection(_0x5f47f0){var _0x11a7df=_0x5f47f0[_0xae89('0x51')][_0xae89('0x52')](_0x5f47f0['securityToken']);var _0x428b0e=new jsforce[(_0xae89('0x53'))]({'oauth2':{'loginUrl':_0x5f47f0[_0xae89('0x54')]||_0xae89('0x55'),'clientId':_0x5f47f0[_0xae89('0x56')],'clientSecret':_0x5f47f0[_0xae89('0x57')]}});return _0x428b0e[_0xae89('0x58')](_0x5f47f0[_0xae89('0x59')],_0x11a7df)[_0xae89('0x28')](function(){logger[_0xae89('0x22')](_0xae89('0x5a'));return _0x428b0e;});}exports[_0xae89('0x5b')]=function(_0x486ef5,_0x5af155,_0x1f223d,_0x4e7a50,_0x38d24e,_0x441a30){var _0x222807,_0x35c83d,_0x503098,_0x525569;_0x441a30['serverUrl']=intUtil[_0xae89('0x5c')](_0x441a30[_0xae89('0x5d')]);_0x441a30[_0xae89('0x54')]=intUtil[_0xae89('0x5c')](_0x441a30[_0xae89('0x54')]);if(_0x38d24e&&_0x38d24e[_0xae89('0x5e')]){logger[_0xae89('0x22')](_0xae89('0x5f'),'Recording\x20is\x20enabled!');_0x5af155[_0xae89('0x60')]=util['format'](_0xae89('0x61'),_0x441a30['serverUrl'],_0x5af155[_0xae89('0x62')],md5(_0x5af155[_0xae89('0x62')]));}else{_0x5af155[_0xae89('0x60')]='';}return getConnection(_0x441a30)['then'](function(_0xa5bd53){_0x525569=_0xa5bd53;return getUser(_0x441a30,_0x4e7a50[_0xae89('0x63')],_0x525569);})[_0xae89('0x28')](function(_0x11a50f){_0x222807=_0x11a50f;return getEndUser(_0x441a30,_0x1f223d,_0x5af155[_0xae89('0x64')],_0x5af155['calleridnum'],_0x525569);})[_0xae89('0x28')](function(_0x104ed7){_0x35c83d=_0x104ed7;return getTicket(_0x441a30,_0x222807,_0x35c83d,_0x1f223d,_0x5af155,_0x1f223d[_0xae89('0x65')],_0x525569,'queue');})['then'](function(_0x57fc4a){_0x503098=_0x57fc4a;logger[_0xae89('0x22')](_0xae89('0x66'),_0x503098['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x503098['id'],_0x4e7a50['name'],_0x441a30['type']);switch(_0x441a30['type']){case _0xae89('0x67'):emit(util['format'](_0xae89('0x68'),_0x4e7a50[_0xae89('0x50')]),'trigger:salesforce:display',{'recordId':_0x503098['id']});break;case _0xae89('0x69'):emit(util[_0xae89('0x42')](_0xae89('0x68'),_0x4e7a50[_0xae89('0x50')]),_0xae89('0x6a'),{'uri':util[_0xae89('0x42')]('%s/%s/e',_0x525569['instanceUrl'],_0x503098['id'])});break;default:logger[_0xae89('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xae89('0x6c')](function(_0xaff12e){logger[_0xae89('0x6b')](_0xae89('0x5f'),_0xaff12e);});};exports[_0xae89('0x6d')]=function(_0x2c0e80,_0x4d0ac0,_0x28c2a0,_0x2d0c63,_0x3da983,_0x263c6e,_0x5c900b){var _0xc11e44,_0x36389f,_0x55c0ab,_0x54b259;_0x263c6e[_0xae89('0x5d')]=intUtil[_0xae89('0x5c')](_0x263c6e[_0xae89('0x5d')]);_0x263c6e[_0xae89('0x54')]=intUtil[_0xae89('0x5c')](_0x263c6e[_0xae89('0x54')]);if(_0x5c900b&&_0x5c900b[_0xae89('0x6e')]&&_0x5c900b['recordingFormat']!=='none'){logger[_0xae89('0x22')](_0xae89('0x6f'),_0xae89('0x70'));_0x4d0ac0[_0xae89('0x60')]=util['format'](_0xae89('0x61'),_0x263c6e[_0xae89('0x5d')],_0x4d0ac0[_0xae89('0x62')],md5(_0x4d0ac0[_0xae89('0x62')]));}return getConnection(_0x263c6e)['then'](function(_0x224b5e){_0x54b259=_0x224b5e;return getUser(_0x263c6e,_0x2d0c63[_0xae89('0x63')],_0x54b259);})[_0xae89('0x28')](function(_0x2d3a7e){_0xc11e44=_0x2d3a7e;return getEndUser(_0x263c6e,_0x28c2a0,_0x4d0ac0[_0xae89('0x71')],_0x4d0ac0[_0xae89('0x72')],_0x54b259);})[_0xae89('0x28')](function(_0x143529){_0x36389f=_0x143529;return getTicket(_0x263c6e,_0xc11e44,_0x36389f,_0x28c2a0,_0x4d0ac0,_0x28c2a0[_0xae89('0x65')],_0x54b259,_0xae89('0x6d'));})[_0xae89('0x28')](function(_0x2d0b34){_0x55c0ab=_0x2d0b34;logger[_0xae89('0x22')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x55c0ab['id']);logger['info'](_0xae89('0x73'),_0x55c0ab['id'],_0x2d0c63[_0xae89('0x50')],_0x263c6e[_0xae89('0x48')]);switch(_0x263c6e[_0xae89('0x48')]){case _0xae89('0x67'):emit(util[_0xae89('0x42')](_0xae89('0x68'),_0x2d0c63[_0xae89('0x50')]),_0xae89('0x74'),{'recordId':_0x55c0ab['id']});break;case _0xae89('0x69'):emit(util[_0xae89('0x42')](_0xae89('0x68'),_0x2d0c63[_0xae89('0x50')]),_0xae89('0x6a'),{'uri':util[_0xae89('0x42')](_0xae89('0x75'),_0x54b259[_0xae89('0x76')],_0x55c0ab['id'])});break;default:logger[_0xae89('0x6b')](_0xae89('0x6f'),_0xae89('0x77'));}})[_0xae89('0x6c')](function(_0x15647f){logger[_0xae89('0x6b')](_0xae89('0x6f'),_0x15647f);});};exports['unmanaged']=function(_0x1cbde0,_0x2d0aca,_0x40b387,_0x17d65b,_0x252d92,_0x153532){var _0x11e897,_0x342c3a,_0x1455cf,_0xd14f05;_0x153532['serverUrl']=intUtil[_0xae89('0x5c')](_0x153532[_0xae89('0x5d')]);_0x153532['remoteUri']=intUtil[_0xae89('0x5c')](_0x153532[_0xae89('0x54')]);if(_0x252d92&&_0x252d92['monitor_format']){logger[_0xae89('0x22')]('['+_0x2d0aca[_0xae89('0x78')][_0xae89('0x79')]()+']',_0xae89('0x70'));_0x2d0aca[_0xae89('0x60')]=util[_0xae89('0x42')](_0xae89('0x61'),_0x153532['serverUrl'],_0x2d0aca[_0xae89('0x62')],md5(_0x2d0aca['uniqueid']));}else{_0x2d0aca[_0xae89('0x60')]='';}return getConnection(_0x153532)['then'](function(_0x21b7ea){_0xd14f05=_0x21b7ea;if(!_[_0xae89('0x1d')](_0x17d65b)){return getUser(_0x153532,_0x17d65b[_0xae89('0x50')],_0xd14f05);}else{return getUser(_0x153532,null,_0xd14f05);}})['then'](function(_0x50dfe8){_0x11e897=_0x50dfe8;return getEndUser(_0x153532,_0x40b387,_0x2d0aca['calleridname'],_0x2d0aca[_0xae89('0x7a')],_0xd14f05);})[_0xae89('0x28')](function(_0x1d7cf9){_0x342c3a=_0x1d7cf9;return getTicket(_0x153532,_0x11e897,_0x342c3a,_0x40b387,_0x2d0aca,_0x40b387[_0xae89('0x65')],_0xd14f05);})[_0xae89('0x28')](function(_0x4ae6ec){_0x1455cf=_0x4ae6ec;logger[_0xae89('0x22')]('['+_0x2d0aca[_0xae89('0x78')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x1455cf['id']);logger[_0xae89('0x22')]('['+_0x2d0aca[_0xae89('0x78')][_0xae89('0x79')]()+_0xae89('0x7b'),_0x153532[_0xae89('0x48')]);})[_0xae89('0x6c')](function(_0x4e8c4f){logger[_0xae89('0x6b')]('['+_0x2d0aca['lastevent'][_0xae89('0x79')]()+']',_0x4e8c4f);});}; \ 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 c48d3ae..718c7ad 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 _0x8bae=['./util','servicenow','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','userEmail','adminEmail','catch','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','includes','string','picklist','customField','nameField','content','toString','idField','type','variableName','toLowerCase','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','true','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','ticketNumber','forEach','push','all','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','lodash','request-promise','util','ioredis'];(function(_0x23428f,_0x288620){var _0x4a1f23=function(_0x4d1f1d){while(--_0x4d1f1d){_0x23428f['push'](_0x23428f['shift']());}};_0x4a1f23(++_0x288620);}(_0x8bae,0x131));var _0xe8ba=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8bae[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xe8ba('0x0'));var Promise=require('bluebird');var rp=require(_0xe8ba('0x1'));var util=require(_0xe8ba('0x2'));var md5=require('md5');var Redis=require(_0xe8ba('0x3'));var intUtil=require(_0xe8ba('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe8ba('0x5'));config[_0xe8ba('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe8ba('0x6')]));function getAdminUser(_0x1efc46,_0x3f296f,_0x36f6e6,_0x43574e,_0x2594a9,_0xb837ef){return new Promise(function(_0x84d36e,_0xf40cb){var _0x35fe6c={'method':_0xe8ba('0x7'),'uri':_0x43574e+_0xe8ba('0x8')+'&'+_0x2594a9+'&'+_0xb837ef,'auth':_0x3f296f,'json':!![]};return rp(_0x35fe6c)[_0xe8ba('0x9')](function(_0x5bae38){if(_0x5bae38[_0xe8ba('0xa')][_0xe8ba('0xb')]>0x0){_0x36f6e6[_0xe8ba('0xc')]=_0x5bae38[_0xe8ba('0xa')][0x0][_0xe8ba('0xd')];}logger[_0xe8ba('0xe')]('['+[_0x1efc46[_0xe8ba('0xf')]()]+'],\x20getAdminUser\x20crm',_0x36f6e6);_0x84d36e(_0x36f6e6);})['catch'](function(_0x5840c1){logger[_0xe8ba('0x10')]('['+[_0x1efc46[_0xe8ba('0xf')]()]+']',_0x5840c1[_0xe8ba('0x11')]);_0xf40cb(_0x5840c1[_0xe8ba('0x11')]);});});}function getUser(_0x2c0160,_0x4b71ba,_0xea56e0,_0x1c8e82,_0x27f38f){return function(_0x1924e3){logger[_0xe8ba('0xe')]('['+[_0x2c0160['toUpperCase']()]+_0xe8ba('0x12'),_0x1924e3);return new Promise(function(_0xbe52ef,_0x32baf4){if(intUtil[_0xe8ba('0x13')](_0x1924e3['userEmail'])){var _0xd957c6={'method':'GET','uri':_0xea56e0+_0xe8ba('0x14')+_0x1924e3['userEmail']+'&'+_0x1c8e82+'&'+_0x27f38f,'auth':_0x4b71ba,'json':!![]};logger[_0xe8ba('0xe')]('['+[_0x2c0160[_0xe8ba('0xf')]()]+_0xe8ba('0x15'),_0xd957c6);return rp(_0xd957c6)[_0xe8ba('0x9')](function(_0x48af2f){logger['info']('['+[_0x2c0160[_0xe8ba('0xf')]()]+_0xe8ba('0x16'),_0x48af2f);if(_0x48af2f[_0xe8ba('0xa')][_0xe8ba('0xb')]>0x0&&String(_0x48af2f[_0xe8ba('0xa')][0x0]['active'])==='true'){_0x1924e3[_0xe8ba('0x17')]=_0x48af2f[_0xe8ba('0xa')][0x0][_0xe8ba('0xd')];}else{_0x1924e3['userId']=_0x1924e3[_0xe8ba('0xc')];_0x1924e3[_0xe8ba('0x18')]=_0x1924e3[_0xe8ba('0x19')];}logger[_0xe8ba('0xe')]('['+[_0x2c0160[_0xe8ba('0xf')]()]+'],\x20getUser\x20crm',_0x1924e3);_0xbe52ef(_0x1924e3);})[_0xe8ba('0x1a')](function(_0x52d9f4){logger['error']('['+[_0x2c0160[_0xe8ba('0xf')]()]+']',_0x52d9f4['message']);_0x32baf4(_0x52d9f4['message']);});}else{logger[_0xe8ba('0xe')]('['+[_0x2c0160[_0xe8ba('0xf')]()]+']\x20using\x20admin\x20profile');_0x1924e3[_0xe8ba('0x17')]=_0x1924e3['adminId'];_0x1924e3[_0xe8ba('0x18')]=_0x1924e3[_0xe8ba('0x19')];_0xbe52ef(_0x1924e3);}});};}function createEndUser(_0x5cd25f,_0x410021,_0x5d372d,_0x4f0e4a,_0x4f4e7f){logger['info']('['+[_0x5cd25f[_0xe8ba('0xf')]()]+'],\x20createEndUser\x20input\x20crm',_0x5d372d);return new Promise(function(_0x85ddeb,_0x45f38c){var _0x52c295={'method':_0xe8ba('0x1b'),'uri':_0x4f0e4a+_0xe8ba('0x1c')+_0x4f4e7f,'body':{'user_name':_0x5d372d[_0xe8ba('0x1d')],'roles':_0xe8ba('0x1e'),'first_name':_0x5d372d[_0xe8ba('0x1d')],'active':'true','date_format':_0xe8ba('0x1f'),'phone':_0x5d372d[_0xe8ba('0x1d')]},'auth':_0x410021,'json':!![]};return rp(_0x52c295)[_0xe8ba('0x9')](function(_0x3f79a7){logger[_0xe8ba('0xe')]('['+[_0x5cd25f[_0xe8ba('0xf')]()]+_0xe8ba('0x20'),_0x3f79a7[_0xe8ba('0xa')]);_0x5d372d[_0xe8ba('0x21')]=_0x3f79a7[_0xe8ba('0xa')]['sys_id'];_0x85ddeb(_0x5d372d);})['catch'](function(_0x18be37){logger['error']('['+[_0x5cd25f[_0xe8ba('0xf')]()]+']',_0x18be37[_0xe8ba('0x11')]);_0x45f38c(_0x18be37[_0xe8ba('0x11')]);});});}function getEndUser(_0x462ea8,_0x53a439,_0x5b3d8a,_0x539083,_0x55d14c){return function(_0xe6afad){logger['info']('['+[_0x462ea8[_0xe8ba('0xf')]()]+_0xe8ba('0x22'),_0xe6afad);return new Promise(function(_0x52703e,_0x8a75e3){var _0x4c1cf0={'method':_0xe8ba('0x7'),'uri':_0x5b3d8a+_0xe8ba('0x23')+_0xe6afad[_0xe8ba('0x1d')]+'&'+_0x539083+'&'+_0x55d14c,'auth':_0x53a439,'json':!![]};return rp(_0x4c1cf0)[_0xe8ba('0x9')](function(_0x229a88){if(_0x229a88[_0xe8ba('0xa')]['length']>0x0){_0xe6afad[_0xe8ba('0x21')]=_0x229a88['result'][0x0][_0xe8ba('0xd')];logger[_0xe8ba('0xe')]('['+[_0x462ea8[_0xe8ba('0xf')]()]+_0xe8ba('0x24'),_0xe6afad);_0x52703e(_0xe6afad);}else{return createEndUser(_0x462ea8,_0x53a439,_0xe6afad,_0x5b3d8a,_0x539083)[_0xe8ba('0x9')](function(_0x104377){logger[_0xe8ba('0xe')]('['+[_0x462ea8[_0xe8ba('0xf')]()]+'],\x20createEndUser\x20crm',_0x104377);_0x52703e(_0x104377);});}})[_0xe8ba('0x1a')](function(_0x2895b3){logger['error']('['+[_0x462ea8[_0xe8ba('0xf')]()]+']',_0x2895b3[_0xe8ba('0x11')]);_0x8a75e3(_0x2895b3['message']);});});};}function getCustomFields(_0x79fc8,_0x44b043){var _0x4cff0a={};if(_0x79fc8[_0xe8ba('0xb')]>0x0){_['forEach'](_0x79fc8,function(_0xd7dbe){if(_[_0xe8ba('0x25')]([_0xe8ba('0x26'),_0xe8ba('0x27')],_0xd7dbe['type'])&&_0xd7dbe['nameField']&&!_0xd7dbe[_0xe8ba('0x28')]){_0x4cff0a[_0xd7dbe[_0xe8ba('0x29')]['toLowerCase']()]=_0xd7dbe[_0xe8ba('0x2a')][_0xe8ba('0x2b')]();}else if(_[_0xe8ba('0x25')]([_0xe8ba('0x26'),_0xe8ba('0x27')],_0xd7dbe['type'])&&_0xd7dbe[_0xe8ba('0x2c')]&&_0xd7dbe['customField']){_0x4cff0a[_0xd7dbe['idField']['toLowerCase']()]=_0xd7dbe[_0xe8ba('0x2a')]['toString']();}else if(_0xd7dbe[_0xe8ba('0x2d')]==='variable'&&_0xd7dbe[_0xe8ba('0x2e')]&&_0xd7dbe[_0xe8ba('0x2c')]&&_0xd7dbe[_0xe8ba('0x28')]){_0x4cff0a[_0xd7dbe[_0xe8ba('0x2c')][_0xe8ba('0x2f')]()]=_0x44b043[_0xd7dbe['variableName']]['toString']();}else if(_0xd7dbe['type']===_0xe8ba('0x30')&&_0xd7dbe[_0xe8ba('0x31')]&&_0xd7dbe[_0xe8ba('0x31')][_0xe8ba('0x32')]&&_0xd7dbe[_0xe8ba('0x2c')]&&_0xd7dbe[_0xe8ba('0x28')]){_0x4cff0a[_0xd7dbe[_0xe8ba('0x2c')]['toLowerCase']()]=_0x44b043[_0xd7dbe['Variable'][_0xe8ba('0x32')][_0xe8ba('0x2f')]()][_0xe8ba('0x2b')]();}});}return _0x4cff0a;}function getTicket(_0x956d3a,_0xf0eb9a,_0xc1d635,_0x5277c0,_0x24bef2,_0x225dff){return function(_0x38f7e8){logger[_0xe8ba('0xe')]('['+[_0x956d3a[_0xe8ba('0xf')]()]+_0xe8ba('0x33'),_0x38f7e8);return new Promise(function(_0x236f56,_0x4c5ca5){var _0x1ef265=_0x956d3a[_0xe8ba('0x2f')]()===_0xe8ba('0x34')?_0x38f7e8[_0xe8ba('0x17')]:_0x38f7e8[_0xe8ba('0x21')];var _0x41472c={'method':_0xe8ba('0x1b'),'uri':_0xc1d635+_0xe8ba('0x35')+'?'+_0x225dff,'body':Object[_0xe8ba('0x36')]({},{'active':_0xe8ba('0x37'),'caller_id':_0x1ef265,'assigned_to':_0x38f7e8[_0xe8ba('0x17')],'short_description':intUtil['getString'](_0x5277c0[_0xe8ba('0x38')],_0x24bef2,'\x20'),'description':intUtil[_0xe8ba('0x39')](_0x5277c0[_0xe8ba('0x3a')],_0x24bef2,'\x0a')},getCustomFields(_0x5277c0[_0xe8ba('0x3b')],_0x24bef2)),'auth':_0xf0eb9a,'json':!![]};return rp(_0x41472c)[_0xe8ba('0x9')](function(_0x35e928){logger['info']('['+[_0x956d3a[_0xe8ba('0xf')]()]+_0xe8ba('0x3c'),_0x35e928[_0xe8ba('0xa')]);_0x38f7e8[_0xe8ba('0x3d')]=_0x35e928['result'][_0xe8ba('0xd')];_0x38f7e8['ticketNumber']=_0x35e928['result'][_0xe8ba('0x3e')];logger[_0xe8ba('0xe')]('['+[_0x956d3a[_0xe8ba('0xf')]()]+']\x20getTicket\x20crm',_0x38f7e8);_0x236f56(_0x38f7e8);})[_0xe8ba('0x1a')](function(_0x2c0bce){logger[_0xe8ba('0x10')]('['+[_0x956d3a['toUpperCase']()]+']',_0x2c0bce[_0xe8ba('0x11')]);_0x4c5ca5(_0x2c0bce['message']);});});};}function createRemoteTag(_0xbaaaee,_0x12ce57,_0x4d1468,_0xcd3d48){return new Promise(function(_0xeb8b8c,_0x105424){var _0x1e054d={'method':_0xe8ba('0x1b'),'uri':_0x4d1468+_0xe8ba('0x3f')+'?'+_0xcd3d48,'body':{'short_description':_0xbaaaee,'global':!![],'active':!![],'name':_0xbaaaee},'auth':_0x12ce57,'json':!![]};return rp(_0x1e054d)[_0xe8ba('0x9')](function(_0x87c780){var _0x2e335d=_0x87c780[_0xe8ba('0xa')][_0xe8ba('0xd')];_0xeb8b8c(_0x2e335d);});});}function getRemoteTag(_0x5ec526,_0x206d07,_0x37b917,_0x31d9f1,_0x55c56a){return new Promise(function(_0x1eb836,_0x6ae45){var _0x304a9b={'method':_0xe8ba('0x7'),'uri':_0x37b917+_0xe8ba('0x3f')+_0xe8ba('0x40')+_0x5ec526+'&'+_0x31d9f1,'auth':_0x206d07,'json':!![]};return rp(_0x304a9b)[_0xe8ba('0x9')](function(_0x505fb0){if(_0x505fb0[_0xe8ba('0xa')][_0xe8ba('0xb')]>0x0){var _0x5c7d99=_0x505fb0[_0xe8ba('0xa')][0x0][_0xe8ba('0xd')];_0x1eb836(_0x5c7d99);}else{return createRemoteTag(_0x5ec526,_0x206d07,_0x37b917,_0x31d9f1)[_0xe8ba('0x9')](function(_0x1cdb0d){_0x1eb836(_0x1cdb0d);});}});});}function assignTagToIncident(_0x5c87b5,_0x48823a,_0x106a1c,_0x1c493d,_0x40b942){return new Promise(function(_0x327862,_0x35c6ad){var _0x449f65={'method':'POST','uri':_0x106a1c+_0xe8ba('0x41')+'?'+_0x40b942,'body':{'label':_0x5c87b5,'table':'incident','id_type':_0xe8ba('0x42'),'table_key':_0x1c493d[_0xe8ba('0x3d')],'title':_0xe8ba('0x43')+_0x1c493d[_0xe8ba('0x44')],'id_display':_0x1c493d[_0xe8ba('0x44')]},'auth':_0x48823a,'json':!![]};return rp(_0x449f65)['then'](function(_0x500e76){_0x327862();})['catch'](function(){_0x327862();});});}function manageTags(_0x177a4e,_0x6e7304,_0x26be2c,_0x30e8d8,_0x42a146,_0x4e1051,_0x26ac4b){return new Promise(function(_0x2ebff1,_0xa20c04){var _0x3b117e=[];_0x6e7304[_0xe8ba('0x45')](function(_0x1b545d){_0x3b117e[_0xe8ba('0x46')](getRemoteTag(_0x1b545d,_0x26be2c,_0x30e8d8,_0x4e1051,_0x26ac4b));});return Promise[_0xe8ba('0x47')](_0x3b117e)['then'](function(_0x47c9a6){if(_0x47c9a6[_0xe8ba('0xb')]){logger[_0xe8ba('0xe')]('['+[_0x177a4e['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x47c9a6);var _0xc127ac=[];_0x47c9a6[_0xe8ba('0x45')](function(_0xac85f4){_0xc127ac['push'](assignTagToIncident(_0xac85f4,_0x26be2c,_0x30e8d8,_0x42a146,_0x4e1051));});return Promise[_0xe8ba('0x47')](_0xc127ac)['then'](function(){_0x2ebff1();})[_0xe8ba('0x1a')](function(){_0x2ebff1();});}else{_0x2ebff1();}});});}function getTags(_0x2e0d74,_0x5cdb82,_0x3b0ba5,_0x3ca1d8,_0x2bbfcd,_0x10ad35){return function(_0x2c667d){return new Promise(function(_0x91727f,_0x28646e){var _0x887a48=[];var _0x295741=_0x3ca1d8[_0xe8ba('0x48')];if(_0x295741&&_0x295741[_0xe8ba('0xb')]>0x0){_0x887a48=_[_0xe8ba('0x49')](_0x295741,_0xe8ba('0x32'));}if(_0x887a48[_0xe8ba('0xb')]>0x0){return manageTags(_0x2e0d74,_0x887a48,_0x5cdb82,_0x3b0ba5,_0x2c667d,_0x2bbfcd,_0x10ad35)['then'](function(){_0x91727f(_0x2c667d);});}else{_0x91727f(_0x2c667d);}});};}function emit(_0x50c6be,_0x1292d5,_0x579e6b){var _0x2aa06a='%26sysparm_record_target%3Dincident'+_0xe8ba('0x4a')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xe8ba('0x4b');var _0x57aa4e={'uri':_0x50c6be+_0xe8ba('0x4c')+_0x579e6b+_0x2aa06a};io['to'](util['format'](_0xe8ba('0x4d'),_0x1292d5))[_0xe8ba('0x4e')](_0xe8ba('0x4f'),_0x57aa4e);}exports['cs']=function(_0x3b43e6,_0x2968af,_0xd0fd5f,_0x2eac86,_0x4dad55,_0xa781a1,_0x170687,_0x2647b0){var _0x2bec3b={};var _0x294f30={'user':_0xa781a1['username'],'pass':_0xa781a1['password']};var _0x3e897f=_0xe8ba('0x50');var _0x15f89=_0xe8ba('0x51');_0xa781a1[_0xe8ba('0x52')]=intUtil[_0xe8ba('0x53')](_0xa781a1[_0xe8ba('0x52')]);_0xa781a1[_0xe8ba('0x54')]=intUtil[_0xe8ba('0x53')](_0xa781a1[_0xe8ba('0x54')]);var _0x295fb0=util[_0xe8ba('0x55')]('%s/api/now/table/',_0xa781a1[_0xe8ba('0x52')]);_0x2bec3b[_0xe8ba('0x18')]=!_['isNil'](_0x2eac86)?_0x2eac86[_0xe8ba('0x56')]:null;_0x2bec3b['adminEmail']=_0xa781a1['email'];_0x2bec3b[_0xe8ba('0x1d')]=_0x2647b0[_0xe8ba('0x2f')]()===_0xe8ba('0x34')?_0x2968af[_0xe8ba('0x57')]:_0x2968af['calleridnum'];_0x2bec3b[_0xe8ba('0x58')]=_0x2647b0===_0xe8ba('0x59')||_0x2647b0===_0xe8ba('0x5a')?_0xe8ba('0x59'):'outbound';var _0x1324b2=util['format'](_0xe8ba('0x5b'),_0xa781a1[_0xe8ba('0x54')],_0x2968af[_0xe8ba('0x5c')],md5(_0x2968af[_0xe8ba('0x5c')]));if(_0x4dad55&&_0x4dad55[_0xe8ba('0x5d')]){logger[_0xe8ba('0xe')](_0xe8ba('0x5e'),'Recording\x20is\x20enabled!');_0x2968af[_0xe8ba('0x5f')]=_0x1324b2;}else if(_0x170687&&_0x170687[_0xe8ba('0x60')]&&_0x170687[_0xe8ba('0x60')]!==_0xe8ba('0x61')){logger[_0xe8ba('0xe')](_0xe8ba('0x62'),_0xe8ba('0x63'));_0x2968af['recordingURL']=_0x1324b2;}else{_0x2968af[_0xe8ba('0x5f')]='';}return getAdminUser(_0x2647b0,_0x294f30,_0x2bec3b,_0x295fb0,_0x15f89,_0x3e897f)[_0xe8ba('0x9')](getUser(_0x2647b0,_0x294f30,_0x295fb0,_0x15f89,_0x3e897f))[_0xe8ba('0x9')](getEndUser(_0x2647b0,_0x294f30,_0x295fb0,_0x15f89,_0x3e897f))[_0xe8ba('0x9')](getTicket(_0x2647b0,_0x294f30,_0x295fb0,_0xd0fd5f,_0x2968af,_0x15f89))[_0xe8ba('0x9')](function(_0x37052d){logger['info'](util[_0xe8ba('0x55')](_0xe8ba('0x64'),_0x37052d[_0xe8ba('0x3d')]));logger[_0xe8ba('0xe')](util['format'](_0xe8ba('0x65'),_0x2647b0));if(_0x2647b0!==_0xe8ba('0x5a')){logger[_0xe8ba('0xe')]('['+[_0x2647b0[_0xe8ba('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xa781a1['remoteUri'],_0x2eac86[_0xe8ba('0x32')],_0x37052d[_0xe8ba('0x3d')]);}})['catch'](function(_0x392b9f){logger[_0xe8ba('0x10')]('['+[_0x2647b0[_0xe8ba('0xf')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xe8ba('0x66')](_0x392b9f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x79ee=['incident','Incident\x20-\x20','forEach','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','message','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','userEmail','adminEmail','],\x20getUser\x20crm','catch','error','POST','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','includes','string','nameField','toLowerCase','content','toString','customField','idField','type','variableName','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry'];(function(_0x466726,_0x1a594b){var _0x2ca489=function(_0x37be6f){while(--_0x37be6f){_0x466726['push'](_0x466726['shift']());}};_0x2ca489(++_0x1a594b);}(_0x79ee,0xf4));var _0xe79e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x79ee[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var Promise=require(_0xe79e('0x0'));var rp=require(_0xe79e('0x1'));var util=require(_0xe79e('0x2'));var md5=require(_0xe79e('0x3'));var Redis=require(_0xe79e('0x4'));var intUtil=require(_0xe79e('0x5'));var config=require('../../../../config/environment');var logger=require(_0xe79e('0x6'))('servicenow');config['redis']=_[_0xe79e('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe79e('0x8'))(new Redis(config['redis']));function getAdminUser(_0x4f5cd8,_0x53a34e,_0x1e278a,_0x35c662,_0x1d7ce1,_0x32399d){return new Promise(function(_0xc493f8,_0x116c69){var _0x198427={'method':_0xe79e('0x9'),'uri':_0x35c662+_0xe79e('0xa')+'&'+_0x1d7ce1+'&'+_0x32399d,'auth':_0x53a34e,'json':!![]};return rp(_0x198427)[_0xe79e('0xb')](function(_0x40c5aa){if(_0x40c5aa[_0xe79e('0xc')][_0xe79e('0xd')]>0x0){_0x1e278a[_0xe79e('0xe')]=_0x40c5aa[_0xe79e('0xc')][0x0][_0xe79e('0xf')];}logger[_0xe79e('0x10')]('['+[_0x4f5cd8[_0xe79e('0x11')]()]+_0xe79e('0x12'),_0x1e278a);_0xc493f8(_0x1e278a);})['catch'](function(_0x32ad47){logger['error']('['+[_0x4f5cd8[_0xe79e('0x11')]()]+']',_0x32ad47['message']);_0x116c69(_0x32ad47[_0xe79e('0x13')]);});});}function getUser(_0x3dade1,_0x31860d,_0x167030,_0x1dd7a9,_0x3f47c8){return function(_0x4c76ff){logger['info']('['+[_0x3dade1['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x4c76ff);return new Promise(function(_0x280c37,_0x3cc333){if(intUtil[_0xe79e('0x14')](_0x4c76ff['userEmail'])){var _0x36b035={'method':_0xe79e('0x9'),'uri':_0x167030+_0xe79e('0x15')+_0x4c76ff['userEmail']+'&'+_0x1dd7a9+'&'+_0x3f47c8,'auth':_0x31860d,'json':!![]};logger[_0xe79e('0x10')]('['+[_0x3dade1['toUpperCase']()]+_0xe79e('0x16'),_0x36b035);return rp(_0x36b035)[_0xe79e('0xb')](function(_0x9e7541){logger[_0xe79e('0x10')]('['+[_0x3dade1['toUpperCase']()]+_0xe79e('0x17'),_0x9e7541);if(_0x9e7541[_0xe79e('0xc')][_0xe79e('0xd')]>0x0&&String(_0x9e7541[_0xe79e('0xc')][0x0][_0xe79e('0x18')])===_0xe79e('0x19')){_0x4c76ff[_0xe79e('0x1a')]=_0x9e7541[_0xe79e('0xc')][0x0][_0xe79e('0xf')];}else{_0x4c76ff[_0xe79e('0x1a')]=_0x4c76ff[_0xe79e('0xe')];_0x4c76ff[_0xe79e('0x1b')]=_0x4c76ff[_0xe79e('0x1c')];}logger['info']('['+[_0x3dade1[_0xe79e('0x11')]()]+_0xe79e('0x1d'),_0x4c76ff);_0x280c37(_0x4c76ff);})[_0xe79e('0x1e')](function(_0x41f953){logger[_0xe79e('0x1f')]('['+[_0x3dade1[_0xe79e('0x11')]()]+']',_0x41f953[_0xe79e('0x13')]);_0x3cc333(_0x41f953[_0xe79e('0x13')]);});}else{logger[_0xe79e('0x10')]('['+[_0x3dade1[_0xe79e('0x11')]()]+']\x20using\x20admin\x20profile');_0x4c76ff['userId']=_0x4c76ff[_0xe79e('0xe')];_0x4c76ff['userEmail']=_0x4c76ff['adminEmail'];_0x280c37(_0x4c76ff);}});};}function createEndUser(_0x2495c2,_0x2d9ca7,_0x59ba15,_0x24e8da,_0x31c60a){logger[_0xe79e('0x10')]('['+[_0x2495c2[_0xe79e('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x59ba15);return new Promise(function(_0x4dca61,_0x40852e){var _0x4845c1={'method':_0xe79e('0x20'),'uri':_0x24e8da+'sys_user?'+_0x31c60a,'body':{'user_name':_0x59ba15[_0xe79e('0x21')],'roles':_0xe79e('0x22'),'first_name':_0x59ba15['endUserNumber'],'active':_0xe79e('0x19'),'date_format':_0xe79e('0x23'),'phone':_0x59ba15[_0xe79e('0x21')]},'auth':_0x2d9ca7,'json':!![]};return rp(_0x4845c1)[_0xe79e('0xb')](function(_0x2012a3){logger[_0xe79e('0x10')]('['+[_0x2495c2[_0xe79e('0x11')]()]+'],\x20EndUser\x20schema',_0x2012a3[_0xe79e('0xc')]);_0x59ba15[_0xe79e('0x24')]=_0x2012a3[_0xe79e('0xc')][_0xe79e('0xf')];_0x4dca61(_0x59ba15);})[_0xe79e('0x1e')](function(_0x4f2cd0){logger[_0xe79e('0x1f')]('['+[_0x2495c2['toUpperCase']()]+']',_0x4f2cd0[_0xe79e('0x13')]);_0x40852e(_0x4f2cd0[_0xe79e('0x13')]);});});}function getEndUser(_0x32c7d6,_0x3b7b7e,_0x44dcb0,_0x259591,_0x1a3c16){return function(_0x73f142){logger[_0xe79e('0x10')]('['+[_0x32c7d6[_0xe79e('0x11')]()]+_0xe79e('0x25'),_0x73f142);return new Promise(function(_0x1bfb64,_0x159151){var _0xe87033={'method':_0xe79e('0x9'),'uri':_0x44dcb0+_0xe79e('0x26')+_0x73f142['endUserNumber']+'&'+_0x259591+'&'+_0x1a3c16,'auth':_0x3b7b7e,'json':!![]};return rp(_0xe87033)['then'](function(_0x4bf3f6){if(_0x4bf3f6[_0xe79e('0xc')][_0xe79e('0xd')]>0x0){_0x73f142[_0xe79e('0x24')]=_0x4bf3f6[_0xe79e('0xc')][0x0]['sys_id'];logger[_0xe79e('0x10')]('['+[_0x32c7d6[_0xe79e('0x11')]()]+'],\x20getEndUser\x20crm',_0x73f142);_0x1bfb64(_0x73f142);}else{return createEndUser(_0x32c7d6,_0x3b7b7e,_0x73f142,_0x44dcb0,_0x259591)[_0xe79e('0xb')](function(_0x5e4220){logger['info']('['+[_0x32c7d6[_0xe79e('0x11')]()]+_0xe79e('0x27'),_0x5e4220);_0x1bfb64(_0x5e4220);});}})[_0xe79e('0x1e')](function(_0x15a224){logger[_0xe79e('0x1f')]('['+[_0x32c7d6[_0xe79e('0x11')]()]+']',_0x15a224[_0xe79e('0x13')]);_0x159151(_0x15a224[_0xe79e('0x13')]);});});};}function getCustomFields(_0x5645b3,_0x5f515e){var _0x19fa45={};if(_0x5645b3[_0xe79e('0xd')]>0x0){_['forEach'](_0x5645b3,function(_0x2f2dc7){if(_[_0xe79e('0x28')]([_0xe79e('0x29'),'picklist'],_0x2f2dc7['type'])&&_0x2f2dc7[_0xe79e('0x2a')]&&!_0x2f2dc7['customField']){_0x19fa45[_0x2f2dc7[_0xe79e('0x2a')][_0xe79e('0x2b')]()]=_0x2f2dc7[_0xe79e('0x2c')][_0xe79e('0x2d')]();}else if(_['includes']([_0xe79e('0x29'),'picklist'],_0x2f2dc7['type'])&&_0x2f2dc7['idField']&&_0x2f2dc7[_0xe79e('0x2e')]){_0x19fa45[_0x2f2dc7[_0xe79e('0x2f')][_0xe79e('0x2b')]()]=_0x2f2dc7[_0xe79e('0x2c')][_0xe79e('0x2d')]();}else if(_0x2f2dc7[_0xe79e('0x30')]==='variable'&&_0x2f2dc7[_0xe79e('0x31')]&&_0x2f2dc7[_0xe79e('0x2f')]&&_0x2f2dc7[_0xe79e('0x2e')]){_0x19fa45[_0x2f2dc7[_0xe79e('0x2f')][_0xe79e('0x2b')]()]=_0x5f515e[_0x2f2dc7[_0xe79e('0x31')]][_0xe79e('0x2d')]();}else if(_0x2f2dc7[_0xe79e('0x30')]==='customVariable'&&_0x2f2dc7['Variable']&&_0x2f2dc7[_0xe79e('0x32')][_0xe79e('0x33')]&&_0x2f2dc7[_0xe79e('0x2f')]&&_0x2f2dc7['customField']){_0x19fa45[_0x2f2dc7['idField']['toLowerCase']()]=_0x5f515e[_0x2f2dc7[_0xe79e('0x32')]['name'][_0xe79e('0x2b')]()]['toString']();}});}return _0x19fa45;}function getTicket(_0x5624bb,_0x11ee85,_0x13fc05,_0x17a93c,_0x1abda5,_0x751b39){return function(_0x3caaae){logger[_0xe79e('0x10')]('['+[_0x5624bb['toUpperCase']()]+_0xe79e('0x34'),_0x3caaae);return new Promise(function(_0xbc0112,_0x1bc87b){var _0x11e62c=_0x5624bb[_0xe79e('0x2b')]()==='outbound'?_0x3caaae[_0xe79e('0x1a')]:_0x3caaae[_0xe79e('0x24')];var _0xe608f3={'method':_0xe79e('0x20'),'uri':_0x13fc05+'incident'+'?'+_0x751b39,'body':Object[_0xe79e('0x35')]({},{'active':_0xe79e('0x19'),'caller_id':_0x11e62c,'assigned_to':_0x3caaae[_0xe79e('0x1a')],'short_description':intUtil[_0xe79e('0x36')](_0x17a93c[_0xe79e('0x37')],_0x1abda5,'\x20'),'description':intUtil['getString'](_0x17a93c[_0xe79e('0x38')],_0x1abda5,'\x0a')},getCustomFields(_0x17a93c['Fields'],_0x1abda5)),'auth':_0x11ee85,'json':!![]};return rp(_0xe608f3)[_0xe79e('0xb')](function(_0x1208b2){logger['info']('['+[_0x5624bb[_0xe79e('0x11')]()]+_0xe79e('0x39'),_0x1208b2[_0xe79e('0xc')]);_0x3caaae[_0xe79e('0x3a')]=_0x1208b2[_0xe79e('0xc')][_0xe79e('0xf')];_0x3caaae[_0xe79e('0x3b')]=_0x1208b2['result'][_0xe79e('0x3c')];logger[_0xe79e('0x10')]('['+[_0x5624bb[_0xe79e('0x11')]()]+_0xe79e('0x3d'),_0x3caaae);_0xbc0112(_0x3caaae);})['catch'](function(_0x5f5dc1){logger[_0xe79e('0x1f')]('['+[_0x5624bb[_0xe79e('0x11')]()]+']',_0x5f5dc1[_0xe79e('0x13')]);_0x1bc87b(_0x5f5dc1[_0xe79e('0x13')]);});});};}function createRemoteTag(_0x3668b0,_0x3ec0d6,_0x168bad,_0x11823f){return new Promise(function(_0x5b3c9a,_0x1691e6){var _0x3919ff={'method':'POST','uri':_0x168bad+'label'+'?'+_0x11823f,'body':{'short_description':_0x3668b0,'global':!![],'active':!![],'name':_0x3668b0},'auth':_0x3ec0d6,'json':!![]};return rp(_0x3919ff)['then'](function(_0x32e439){var _0x4b255d=_0x32e439[_0xe79e('0xc')][_0xe79e('0xf')];_0x5b3c9a(_0x4b255d);});});}function getRemoteTag(_0x38f3c9,_0x4ebe7a,_0x104682,_0x35f958,_0x50d8e5){return new Promise(function(_0x2f05b7,_0x3de505){var _0x32547a={'method':_0xe79e('0x9'),'uri':_0x104682+_0xe79e('0x3e')+_0xe79e('0x3f')+_0x38f3c9+'&'+_0x35f958,'auth':_0x4ebe7a,'json':!![]};return rp(_0x32547a)['then'](function(_0x20416e){if(_0x20416e['result'][_0xe79e('0xd')]>0x0){var _0x48d48d=_0x20416e[_0xe79e('0xc')][0x0][_0xe79e('0xf')];_0x2f05b7(_0x48d48d);}else{return createRemoteTag(_0x38f3c9,_0x4ebe7a,_0x104682,_0x35f958)[_0xe79e('0xb')](function(_0x54060d){_0x2f05b7(_0x54060d);});}});});}function assignTagToIncident(_0x319a22,_0x301bb4,_0x52a72b,_0x1d9faa,_0x412b89){return new Promise(function(_0x1c1b84,_0x10fb5a){var _0x2cb61a={'method':_0xe79e('0x20'),'uri':_0x52a72b+_0xe79e('0x40')+'?'+_0x412b89,'body':{'label':_0x319a22,'table':_0xe79e('0x41'),'id_type':'Incident','table_key':_0x1d9faa[_0xe79e('0x3a')],'title':_0xe79e('0x42')+_0x1d9faa['ticketNumber'],'id_display':_0x1d9faa[_0xe79e('0x3b')]},'auth':_0x301bb4,'json':!![]};return rp(_0x2cb61a)[_0xe79e('0xb')](function(_0x18c725){_0x1c1b84();})['catch'](function(){_0x1c1b84();});});}function manageTags(_0x3f78c3,_0xc414b7,_0x46c2c3,_0x209737,_0x4393a8,_0x312576,_0x360da1){return new Promise(function(_0xc53b74,_0x3ee2ba){var _0x36afb1=[];_0xc414b7[_0xe79e('0x43')](function(_0x55ead8){_0x36afb1[_0xe79e('0x44')](getRemoteTag(_0x55ead8,_0x46c2c3,_0x209737,_0x312576,_0x360da1));});return Promise[_0xe79e('0x45')](_0x36afb1)[_0xe79e('0xb')](function(_0x5ea03a){if(_0x5ea03a[_0xe79e('0xd')]){logger[_0xe79e('0x10')]('['+[_0x3f78c3[_0xe79e('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5ea03a);var _0x1f809a=[];_0x5ea03a[_0xe79e('0x43')](function(_0x310a1e){_0x1f809a[_0xe79e('0x44')](assignTagToIncident(_0x310a1e,_0x46c2c3,_0x209737,_0x4393a8,_0x312576));});return Promise[_0xe79e('0x45')](_0x1f809a)[_0xe79e('0xb')](function(){_0xc53b74();})[_0xe79e('0x1e')](function(){_0xc53b74();});}else{_0xc53b74();}});});}function getTags(_0x525d60,_0x3d044c,_0x1821a8,_0x2fcb88,_0x39a91f,_0x5197a6){return function(_0x155eef){return new Promise(function(_0x33bf43,_0x529d9c){var _0x2ed903=[];var _0x31f301=_0x2fcb88[_0xe79e('0x46')];if(_0x31f301&&_0x31f301['length']>0x0){_0x2ed903=_['map'](_0x31f301,'name');}if(_0x2ed903['length']>0x0){return manageTags(_0x525d60,_0x2ed903,_0x3d044c,_0x1821a8,_0x155eef,_0x39a91f,_0x5197a6)['then'](function(){_0x33bf43(_0x155eef);});}else{_0x33bf43(_0x155eef);}});};}function emit(_0xaf2580,_0x1d2d98,_0x335d80){var _0x4d861e=_0xe79e('0x47')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xe79e('0x48')+_0xe79e('0x49');var _0x32a368={'uri':_0xaf2580+_0xe79e('0x4a')+_0x335d80+_0x4d861e};io['to'](util[_0xe79e('0x4b')](_0xe79e('0x4c'),_0x1d2d98))[_0xe79e('0x4d')](_0xe79e('0x4e'),_0x32a368);}exports['cs']=function(_0x2a9804,_0x53cb02,_0x42a70a,_0x47986a,_0x251a80,_0x334533,_0x25a5aa,_0x2fa123){var _0x13c56e={};var _0x1edc5d={'user':_0x334533[_0xe79e('0x4f')],'pass':_0x334533[_0xe79e('0x50')]};var _0x49785b='sysparm_limit=1';var _0x5dbf9e='sysparm_display_value=true';_0x334533[_0xe79e('0x51')]=intUtil['stripTrailingSlash'](_0x334533[_0xe79e('0x51')]);_0x334533[_0xe79e('0x52')]=intUtil[_0xe79e('0x53')](_0x334533[_0xe79e('0x52')]);var _0x3a829c=util[_0xe79e('0x4b')](_0xe79e('0x54'),_0x334533[_0xe79e('0x51')]);_0x13c56e['userEmail']=!_[_0xe79e('0x55')](_0x47986a)?_0x47986a[_0xe79e('0x56')]:null;_0x13c56e[_0xe79e('0x1c')]=_0x334533[_0xe79e('0x56')];_0x13c56e[_0xe79e('0x21')]=_0x2fa123[_0xe79e('0x2b')]()==='outbound'?_0x53cb02[_0xe79e('0x57')]:_0x53cb02[_0xe79e('0x58')];_0x13c56e[_0xe79e('0x59')]=_0x2fa123===_0xe79e('0x5a')||_0x2fa123==='unmanaged'?'queue':_0xe79e('0x5b');var _0x24af19=util[_0xe79e('0x4b')](_0xe79e('0x5c'),_0x334533[_0xe79e('0x52')],_0x53cb02[_0xe79e('0x5d')],md5(_0x53cb02[_0xe79e('0x5d')]));if(_0x251a80&&_0x251a80[_0xe79e('0x5e')]){logger[_0xe79e('0x10')](_0xe79e('0x5f'),_0xe79e('0x60'));_0x53cb02['recordingURL']=_0x24af19;}else if(_0x25a5aa&&_0x25a5aa[_0xe79e('0x61')]&&_0x25a5aa[_0xe79e('0x61')]!=='none'){logger['info'](_0xe79e('0x62'),_0xe79e('0x60'));_0x53cb02['recordingURL']=_0x24af19;}else{_0x53cb02[_0xe79e('0x63')]='';}return getAdminUser(_0x2fa123,_0x1edc5d,_0x13c56e,_0x3a829c,_0x5dbf9e,_0x49785b)[_0xe79e('0xb')](getUser(_0x2fa123,_0x1edc5d,_0x3a829c,_0x5dbf9e,_0x49785b))[_0xe79e('0xb')](getEndUser(_0x2fa123,_0x1edc5d,_0x3a829c,_0x5dbf9e,_0x49785b))['then'](getTicket(_0x2fa123,_0x1edc5d,_0x3a829c,_0x42a70a,_0x53cb02,_0x5dbf9e))['then'](function(_0x1c4e63){logger[_0xe79e('0x10')](util[_0xe79e('0x4b')](_0xe79e('0x64'),_0x1c4e63['ticketId']));logger[_0xe79e('0x10')](util[_0xe79e('0x4b')]('call\x20direction:\x20%s',_0x2fa123));if(_0x2fa123!=='unmanaged'){logger['info']('['+[_0x2fa123['toUpperCase']()]+']',_0xe79e('0x65'));emit(_0x334533[_0xe79e('0x51')],_0x47986a[_0xe79e('0x33')],_0x1c4e63[_0xe79e('0x3a')]);}})[_0xe79e('0x1e')](function(_0x58ceb2){logger['error']('['+[_0x2fa123[_0xe79e('0x11')]()]+_0xe79e('0x66'),util['inspect'](_0x58ceb2,{'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 eba51c3..71d100e 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 _0xa55b=['The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','error','unmanaged','lastevent','toUpperCase','calleridnum','Fields','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','socket.io-emitter','POST','emit','info','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','replace','duration_minutes','parent_id','Contacts','name','direction','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','name_value_list','value','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','then','find','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','[HTTP]','merge','map','nameField','customField','toLowerCase','content','type','string','custom_fields','push','variable','customVariable','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname'];(function(_0x529b4a,_0x436aac){var _0x386401=function(_0x380898){while(--_0x380898){_0x529b4a['push'](_0x529b4a['shift']());}};_0x386401(++_0x436aac);}(_0xa55b,0x189));var _0xba55=function(_0x5392b4,_0x109c6d){_0x5392b4=_0x5392b4-0x0;var _0xa837fc=_0xa55b[_0x5392b4];return _0xa837fc;};'use strict';var _=require(_0xba55('0x0'));var rp=require(_0xba55('0x1'));var BPromise=require(_0xba55('0x2'));var md5=require(_0xba55('0x3'));var util=require(_0xba55('0x4'));var Redis=require(_0xba55('0x5'));var intUtil=require(_0xba55('0x6'));var config=require(_0xba55('0x7'));var logger=require(_0xba55('0x8'))(_0xba55('0x9'));config['redis']=_[_0xba55('0xa')](config[_0xba55('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xba55('0xc'))(new Redis(config['redis']));var def={'method':_0xba55('0xd'),'json':!![]};function emit(_0x428970,_0x5773c3,_0x5698f7){io['to'](_0x428970)[_0xba55('0xe')](_0x5773c3,_0x5698f7);}function getTicket(_0x2852f8,_0xc19b24,_0x759748,_0x5258fc,_0x5b34cc,_0x506dac,_0x4c144f,_0x3a915b){logger[_0xba55('0xf')]('Creating\x20new\x20ticket...');var _0x2d8924=new Date();var _0x3f75ba=[{'name':'name','value':intUtil[_0xba55('0x10')](_0x5258fc[_0xba55('0x11')],_0x5b34cc,'\x20')},{'name':_0xba55('0x12'),'value':_0xc19b24['id']},{'name':'created_by','value':_0xc19b24['id']},{'name':_0xba55('0x13'),'value':intUtil[_0xba55('0x10')](_0x5258fc[_0xba55('0x14')],_0x5b34cc,'\x0a')},{'name':_0xba55('0x15'),'value':_0x2d8924[_0xba55('0x16')]()['slice'](0x0,0x13)[_0xba55('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xba55('0x18'),'value':'15'},{'name':_0xba55('0x19'),'value':_0x759748['id']},{'name':'parent_type','value':_0xba55('0x1a')},{'name':'parent_name','value':_0x759748[_0xba55('0x1b')]},{'name':_0xba55('0x1c'),'value':_0x3a915b}];if(_0x506dac['length']){_[_0xba55('0x1d')](_0x506dac,function(_0x376af0){if(_0x5b34cc[_0x376af0[_0xba55('0x1e')]]){_0x3f75ba['push']({'name':_0x376af0[_0xba55('0x1f')],'value':_0x5b34cc[_0x376af0[_0xba55('0x1e')]]});}});}return request({'form':{'method':_0xba55('0x20'),'input_type':_0xba55('0x21'),'response_type':_0xba55('0x21'),'rest_data':JSON[_0xba55('0x22')]({'session':_0x4c144f['id'],'module_name':_0xba55('0x23'),'name_value_list':_0x3f75ba})}});}function getAuth(_0x159747){return util[_0xba55('0x24')](_0xba55('0x25'),new Buffer(_0x159747[_0xba55('0x26')]+':X')[_0xba55('0x27')]('base64'));}function getServerInfo(_0x37e9c7){return request({'form':{'method':_0xba55('0x28'),'input_type':_0xba55('0x21'),'response_type':'JSON','rest_data':JSON[_0xba55('0x22')]({'session':_0x37e9c7['id']})}});}function getUser(_0x5bec22,_0xf6d97e,_0x413d1c){if(!_[_0xba55('0x29')](_0xf6d97e)){logger[_0xba55('0xf')](_0xba55('0x2a'),_0xf6d97e);return request({'form':{'method':_0xba55('0x2b'),'input_type':_0xba55('0x21'),'response_type':_0xba55('0x21'),'rest_data':JSON['stringify']({'session':_0x413d1c['id'],'module_name':_0xba55('0x2c'),'query':util[_0xba55('0x24')](_0xba55('0x2d'),_0xf6d97e),'order_by':'','offset':'0','select_fields':['id',_0xba55('0x1b'),_0xba55('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5c8852){if(_0x5c8852[_0xba55('0x2f')][_0xba55('0x30')]){var _0x5c5dd7=_['find'](_0x5c8852[_0xba55('0x2f')],function(_0x46ad26){return _0x46ad26[_0xba55('0x31')][_0xba55('0x2e')][_0xba55('0x32')]===_0xf6d97e;});if(_0x5c5dd7){logger[_0xba55('0xf')]('Agent\x20found!');return BPromise[_0xba55('0x33')]({'id':_0x5c5dd7['name_value_list']['id'][_0xba55('0x32')],'name':_0x5c5dd7[_0xba55('0x31')][_0xba55('0x1b')][_0xba55('0x32')]});}}logger[_0xba55('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xba55('0x33')]({'id':_0x413d1c[_0xba55('0x31')][_0xba55('0x34')]['value'],'name':_0x413d1c[_0xba55('0x31')]['user_name'][_0xba55('0x32')]});});}else{logger[_0xba55('0xf')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xba55('0x33')]({'id':_0x413d1c[_0xba55('0x31')][_0xba55('0x34')][_0xba55('0x32')],'name':_0x413d1c[_0xba55('0x31')][_0xba55('0x2e')][_0xba55('0x32')]});}}function getEndUser(_0x1a3bf6,_0x280695,_0x244872,_0x217427){logger[_0xba55('0xf')](_0xba55('0x35'),_0x244872);return request({'form':{'method':_0xba55('0x2b'),'input_type':_0xba55('0x21'),'response_type':_0xba55('0x21'),'rest_data':JSON[_0xba55('0x22')]({'session':_0x217427['id'],'module_name':_0xba55('0x1a'),'query':util[_0xba55('0x24')](_0xba55('0x36'),_0x244872),'order_by':'','offset':'0','select_fields':['id',_0xba55('0x1b'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xba55('0x37')](function(_0x58c224){if(_0x58c224['entry_list'][_0xba55('0x30')]){var _0x5370cb=_[_0xba55('0x38')](_0x58c224['entry_list'],function(_0x13f34e){return _0x13f34e[_0xba55('0x31')][_0xba55('0x39')][_0xba55('0x32')]===_0x244872;});if(_0x5370cb){logger[_0xba55('0xf')]('Enduser\x20found!');return BPromise[_0xba55('0x33')]({'id':_0x5370cb['name_value_list']['id'][_0xba55('0x32')],'name':_0x5370cb['name_value_list']['name'][_0xba55('0x32')],'phone':_0x5370cb[_0xba55('0x31')][_0xba55('0x39')][_0xba55('0x32')]});}}else{logger['info'](_0xba55('0x3a'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xba55('0x22')]({'session':_0x217427['id'],'module_name':'Contacts','name_value_list':[{'name':_0xba55('0x3b'),'value':_0x280695!==_0xba55('0x3c')?_0x280695:util[_0xba55('0x24')](_0xba55('0x3d'),_0x244872)},{'name':'phone_home','value':_0x244872}]})}})[_0xba55('0x37')](function(_0x271b34){logger['info']('Enduser\x20created.');return BPromise[_0xba55('0x33')]({'id':_0x271b34['id'],'name':_0x271b34['entry_list'][_0xba55('0x3b')]['value'],'phone':_0x271b34[_0xba55('0x2f')][_0xba55('0x39')]['value']});});}});}function request(_0x591107){logger['debug'](_0xba55('0x3e'),JSON['stringify'](_0x591107));return rp(_[_0xba55('0x3f')](def,_0x591107));}function getTags(_0x320140,_0x510adb){var _0x2d8681=[];if(_0x320140&&_0x320140[_0xba55('0x30')]>0x0){_0x2d8681=_[_0xba55('0x40')](_0x320140,_0x510adb);}return _0x2d8681;}function getCustomFields(_0x40d2fb,_0x38ad93){var _0x52b6b3=[];var _0x2b9e71={'custom_fields':[]};if(_0x40d2fb[_0xba55('0x30')]>0x0){_[_0xba55('0x1d')](_0x40d2fb,function(_0x3a72d1){if(_0x3a72d1['type']==='string'&&_0x3a72d1[_0xba55('0x41')]&&!_0x3a72d1[_0xba55('0x42')]){_0x2b9e71[_0x3a72d1[_0xba55('0x41')][_0xba55('0x43')]()]=_0x3a72d1[_0xba55('0x44')][_0xba55('0x27')]();}else if(_0x3a72d1[_0xba55('0x45')]===_0xba55('0x46')&&_0x3a72d1[_0xba55('0x1f')]&&_0x3a72d1[_0xba55('0x42')]){_0x2b9e71[_0xba55('0x47')][_0xba55('0x48')]({'id':_0x3a72d1[_0xba55('0x1f')],'value':_0x3a72d1[_0xba55('0x44')]['toString']()});}else if(_0x3a72d1[_0xba55('0x45')]===_0xba55('0x49')&&_0x3a72d1[_0xba55('0x1e')]&&_0x3a72d1[_0xba55('0x1f')]&&_0x3a72d1[_0xba55('0x42')]){_0x38ad93[_0x3a72d1[_0xba55('0x1e')]]&&_0x2b9e71[_0xba55('0x47')][_0xba55('0x48')]({'id':_0x3a72d1[_0xba55('0x1f')],'value':_0x38ad93[_0x3a72d1[_0xba55('0x1e')]][_0xba55('0x27')]()});}else if(_0x3a72d1[_0xba55('0x45')]===_0xba55('0x4a')&&_0x3a72d1[_0xba55('0x4b')]&&_0x3a72d1[_0xba55('0x4b')][_0xba55('0x1b')]&&_0x3a72d1['idField']&&_0x3a72d1[_0xba55('0x42')]){_0x38ad93[_0x3a72d1['Variable'][_0xba55('0x1b')][_0xba55('0x43')]()]&&_0x2b9e71[_0xba55('0x47')][_0xba55('0x48')]({'id':_0x3a72d1['idField'],'value':_0x38ad93[_0x3a72d1[_0xba55('0x4b')][_0xba55('0x1b')][_0xba55('0x43')]()][_0xba55('0x27')]()});}});}return _0x2b9e71;}function getConnection(_0x3e0795){return request({'method':_0xba55('0xd'),'form':{'method':_0xba55('0x4c'),'input_type':'JSON','response_type':_0xba55('0x21'),'rest_data':JSON[_0xba55('0x22')]({'user_auth':{'user_name':_0x3e0795['username'],'password':_0x3e0795['password'],'encryption':_0xba55('0x4d')},'application':_0xba55('0x4e')})}})['then'](function(_0x5a090f){var _0x1bd2b1=_0x5a090f;if(_0x1bd2b1['id']){def[_0xba55('0x4f')]=_0x1bd2b1['id'];return BPromise[_0xba55('0x33')](_0x1bd2b1);}else{throw new Error(util[_0xba55('0x24')](_0xba55('0x50'),_0x3e0795['id']));}});}function setRelationship(_0x2dd38d,_0x1dfa2d,_0x5a6676,_0xe78378){return request({'form':{'method':_0xba55('0x51'),'input_type':_0xba55('0x21'),'response_type':'JSON','rest_data':JSON[_0xba55('0x22')]({'session':_0x2dd38d['id'],'module_name':'Calls','module_id':_0x5a6676['id'],'link_field_name':_0xe78378,'related_ids':[_0x1dfa2d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xba55('0x52')]=function(_0x2c634c,_0x44ae29,_0x2a7de9,_0x129531,_0x49d0a2,_0x62503a){var _0x4d9ac9,_0xe61246,_0x5c839e,_0x60591d;_0x62503a[_0xba55('0x53')]=intUtil[_0xba55('0x54')](_0x62503a[_0xba55('0x53')]);_0x62503a[_0xba55('0x55')]=intUtil[_0xba55('0x54')](_0x62503a['serverUrl']);def[_0xba55('0x56')]=util[_0xba55('0x24')](_0xba55('0x57'),_0x62503a['remoteUri']);if(_0x49d0a2&&_0x49d0a2[_0xba55('0x58')]){logger['info'](_0xba55('0x59'),_0xba55('0x5a'));_0x44ae29[_0xba55('0x5b')]=util[_0xba55('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x62503a['serverUrl'],_0x44ae29[_0xba55('0x5c')],md5(_0x44ae29[_0xba55('0x5c')]));}else{_0x44ae29[_0xba55('0x5b')]='';}return getConnection(_0x62503a)[_0xba55('0x37')](function(_0x7d5dbc){_0x60591d=_0x7d5dbc;return getUser(_0x62503a,_0x129531[_0xba55('0x1b')],_0x60591d);})['then'](function(_0x4ecd59){_0x4d9ac9=_0x4ecd59;logger[_0xba55('0xf')](_0xba55('0x5d'),_0x4d9ac9['id']);return getEndUser(_0x62503a,_0x44ae29[_0xba55('0x5e')],_0x44ae29['calleridnum'],_0x60591d);})[_0xba55('0x37')](function(_0x420f48){_0xe61246=_0x420f48;logger[_0xba55('0xf')](_0xba55('0x5f'),_0xe61246['id']);return getTicket(_0x62503a,_0x4d9ac9,_0xe61246,_0x2a7de9,_0x44ae29,_0x2a7de9['Fields'],_0x60591d,_0xba55('0x60'));})[_0xba55('0x37')](function(_0x27605c){_0x5c839e=_0x27605c;logger[_0xba55('0xf')](_0xba55('0x61'));logger[_0xba55('0xf')](_0xba55('0x62'),_0x5c839e['id']);return setRelationship(_0x60591d,_0x4d9ac9,_0x5c839e,_0xba55('0x63'));})['then'](function(){return setRelationship(_0x60591d,_0xe61246,_0x5c839e,'contacts');})[_0xba55('0x37')](function(){return getServerInfo(_0x60591d);})[_0xba55('0x37')](function(_0x2fb373){var _0x3283f7=parseInt(_0x2fb373[_0xba55('0x64')][_0xba55('0x65')](0x0));var _0x106bde=util[_0xba55('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x62503a['remoteUri'],_0x5c839e['id']);if(_0x3283f7>0x6){_0x106bde=util[_0xba55('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x62503a[_0xba55('0x53')],_0x5c839e['id']);}logger[_0xba55('0xf')](_0xba55('0x59'),_0xba55('0x66'));emit(util[_0xba55('0x24')]('user:%s',_0x129531['name']),_0xba55('0x67'),{'uri':_0x106bde});})[_0xba55('0x68')](function(_0xb824f7){logger['error']('[QUEUE]',JSON['stringify'](_0xb824f7));});};exports[_0xba55('0x69')]=function(_0x294764,_0x40b78a,_0x33346e,_0x143688,_0x26133c,_0x598a4f,_0x242d98){var _0xf62ec,_0x2e3bd1,_0x2c816f,_0x49f19c;_0x598a4f['remoteUri']=intUtil[_0xba55('0x54')](_0x598a4f['remoteUri']);_0x598a4f[_0xba55('0x55')]=intUtil[_0xba55('0x54')](_0x598a4f[_0xba55('0x55')]);def[_0xba55('0x56')]=util[_0xba55('0x24')](_0xba55('0x57'),_0x598a4f[_0xba55('0x53')]);if(_0x242d98&&_0x242d98[_0xba55('0x6a')]&&_0x242d98[_0xba55('0x6a')]!==_0xba55('0x6b')){logger['info'](_0xba55('0x6c'),_0xba55('0x5a'));_0x40b78a[_0xba55('0x5b')]=util[_0xba55('0x24')](_0xba55('0x6d'),_0x598a4f[_0xba55('0x55')],_0x40b78a[_0xba55('0x5c')],md5(_0x40b78a[_0xba55('0x5c')]));}return getConnection(_0x598a4f)[_0xba55('0x37')](function(_0x2c8ac5){_0x49f19c=_0x2c8ac5;return getUser(_0x598a4f,_0x143688[_0xba55('0x1b')],_0x49f19c);})['then'](function(_0x449b84){_0xf62ec=_0x449b84;logger[_0xba55('0xf')](_0xba55('0x5d'),_0xf62ec['id']);return getEndUser(_0x598a4f,_0x40b78a[_0xba55('0x6e')],_0x40b78a[_0xba55('0x6f')],_0x49f19c);})[_0xba55('0x37')](function(_0x2293ac){_0x2e3bd1=_0x2293ac;logger[_0xba55('0xf')](_0xba55('0x5f'),_0x2e3bd1['id']);return getTicket(_0x598a4f,_0xf62ec,_0x2e3bd1,_0x33346e,_0x40b78a,_0x33346e['Fields'],_0x49f19c,_0xba55('0x70'));})[_0xba55('0x37')](function(_0x5e2feb){_0x2c816f=_0x5e2feb;logger[_0xba55('0xf')]('Ticket\x20created!');logger[_0xba55('0xf')]('The\x20Ticket\x20ID\x20is:',_0x2c816f['id']);return setRelationship(_0x49f19c,_0xf62ec,_0x2c816f,_0xba55('0x63'));})[_0xba55('0x37')](function(){return setRelationship(_0x49f19c,_0x2e3bd1,_0x2c816f,_0xba55('0x71'));})['then'](function(){return getServerInfo(_0x49f19c);})[_0xba55('0x37')](function(_0xdc03af){var _0xf6c9f3=parseInt(_0xdc03af[_0xba55('0x64')]['charAt'](0x0));var _0xd26df2=util[_0xba55('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x598a4f['remoteUri'],_0x2c816f['id']);if(_0xf6c9f3>0x6){_0xd26df2=util[_0xba55('0x24')](_0xba55('0x72'),_0x598a4f[_0xba55('0x53')],_0x2c816f['id']);}logger[_0xba55('0xf')]('[OUTBOUND]',_0xba55('0x66'));emit(util[_0xba55('0x24')](_0xba55('0x73'),_0x143688[_0xba55('0x1b')]),_0xba55('0x67'),{'uri':_0xd26df2});})[_0xba55('0x68')](function(_0x3a7df1){logger[_0xba55('0x74')](_0xba55('0x6c'),JSON[_0xba55('0x22')](_0x3a7df1));});};exports[_0xba55('0x75')]=function(_0x12c9ea,_0x4ee806,_0x59df9e,_0x431678,_0x13d28e,_0x3aee79){var _0x574df3,_0x4dd39d,_0x3a0776,_0x4ff707;_0x3aee79[_0xba55('0x53')]=intUtil['stripTrailingSlash'](_0x3aee79[_0xba55('0x53')]);_0x3aee79['serverUrl']=intUtil[_0xba55('0x54')](_0x3aee79['serverUrl']);def['uri']=util['format'](_0xba55('0x57'),_0x3aee79[_0xba55('0x53')]);if(_0x13d28e&&_0x13d28e[_0xba55('0x58')]){logger[_0xba55('0xf')]('['+_0x4ee806[_0xba55('0x76')][_0xba55('0x77')]()+']',_0xba55('0x5a'));_0x4ee806[_0xba55('0x5b')]=util[_0xba55('0x24')](_0xba55('0x6d'),_0x3aee79[_0xba55('0x55')],_0x4ee806[_0xba55('0x5c')],md5(_0x4ee806[_0xba55('0x5c')]));}else{_0x4ee806[_0xba55('0x5b')]='';}return getConnection(_0x3aee79)['then'](function(_0x2b6814){_0x4ff707=_0x2b6814;if(!_['isNil'](_0x431678)){return getUser(_0x3aee79,_0x431678[_0xba55('0x1b')],_0x4ff707);}else{return getUser(_0x3aee79,null,_0x4ff707);}})[_0xba55('0x37')](function(_0x4babf6){_0x574df3=_0x4babf6;logger[_0xba55('0xf')](_0xba55('0x5d'),_0x574df3['id']);return getEndUser(_0x3aee79,_0x4ee806['calleridname'],_0x4ee806[_0xba55('0x78')],_0x4ff707);})[_0xba55('0x37')](function(_0x1b673c){_0x4dd39d=_0x1b673c;logger[_0xba55('0xf')]('The\x20Enduser\x20ID\x20is:',_0x4dd39d['id']);return getTicket(_0x3aee79,_0x574df3,_0x4dd39d,_0x59df9e,_0x4ee806,_0x59df9e[_0xba55('0x79')],_0x4ff707,_0xba55('0x60'));})[_0xba55('0x37')](function(_0x227458){_0x3a0776=_0x227458;logger[_0xba55('0xf')](_0xba55('0x61'));logger['info'](_0xba55('0x62'),_0x3a0776['id']);return setRelationship(_0x4ff707,_0x574df3,_0x3a0776,_0xba55('0x63'));})[_0xba55('0x37')](function(){return setRelationship(_0x4ff707,_0x4dd39d,_0x3a0776,'contacts');})['then'](function(){return getServerInfo(_0x4ff707);})[_0xba55('0x68')](function(_0x57fbac){logger[_0xba55('0x74')]('['+_0x4ee806[_0xba55('0x76')][_0xba55('0x77')]()+']',JSON['stringify'](_0x57fbac));});}; \ No newline at end of file +var _0xb9d1=['resolve','name_value_list','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!','','Caller\x20-\x20%s','first_name','debug','[HTTP]','map','forEach','type','nameField','customField','content','toString','string','idField','variable','customVariable','Variable','toLowerCase','custom_fields','login','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','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...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','user_name','value','Agent\x20found!'];(function(_0x384e42,_0x43a028){var _0x28465e=function(_0x259ad0){while(--_0x259ad0){_0x384e42['push'](_0x384e42['shift']());}};_0x28465e(++_0x43a028);}(_0xb9d1,0x145));var _0x1b9d=function(_0x38338a,_0x4ff88c){_0x38338a=_0x38338a-0x0;var _0x166c63=_0xb9d1[_0x38338a];return _0x166c63;};'use strict';var _=require(_0x1b9d('0x0'));var rp=require(_0x1b9d('0x1'));var BPromise=require(_0x1b9d('0x2'));var md5=require(_0x1b9d('0x3'));var util=require(_0x1b9d('0x4'));var Redis=require(_0x1b9d('0x5'));var intUtil=require(_0x1b9d('0x6'));var config=require(_0x1b9d('0x7'));var logger=require(_0x1b9d('0x8'))(_0x1b9d('0x9'));config[_0x1b9d('0xa')]=_['defaults'](config[_0x1b9d('0xa')],{'host':_0x1b9d('0xb'),'port':0x18eb});var io=require(_0x1b9d('0xc'))(new Redis(config[_0x1b9d('0xa')]));var def={'method':_0x1b9d('0xd'),'json':!![]};function emit(_0x2b9506,_0x360b26,_0x41babb){io['to'](_0x2b9506)[_0x1b9d('0xe')](_0x360b26,_0x41babb);}function getTicket(_0x110db0,_0x553b22,_0x1c9c78,_0x46b55f,_0x27f6b9,_0x275b7f,_0x4ad054,_0x127ffb){logger[_0x1b9d('0xf')](_0x1b9d('0x10'));var _0x1becf6=new Date();var _0x3ec1ab=[{'name':'name','value':intUtil[_0x1b9d('0x11')](_0x46b55f[_0x1b9d('0x12')],_0x27f6b9,'\x20')},{'name':_0x1b9d('0x13'),'value':_0x553b22['id']},{'name':_0x1b9d('0x14'),'value':_0x553b22['id']},{'name':_0x1b9d('0x15'),'value':intUtil[_0x1b9d('0x11')](_0x46b55f[_0x1b9d('0x16')],_0x27f6b9,'\x0a')},{'name':_0x1b9d('0x17'),'value':_0x1becf6[_0x1b9d('0x18')]()['slice'](0x0,0x13)[_0x1b9d('0x19')]('T','\x20')},{'name':_0x1b9d('0x1a'),'value':'0'},{'name':_0x1b9d('0x1b'),'value':'15'},{'name':_0x1b9d('0x1c'),'value':_0x1c9c78['id']},{'name':_0x1b9d('0x1d'),'value':_0x1b9d('0x1e')},{'name':_0x1b9d('0x1f'),'value':_0x1c9c78[_0x1b9d('0x20')]},{'name':_0x1b9d('0x21'),'value':_0x127ffb}];if(_0x275b7f[_0x1b9d('0x22')]){_['forEach'](_0x275b7f,function(_0x113fe4){if(_0x27f6b9[_0x113fe4[_0x1b9d('0x23')]]){_0x3ec1ab[_0x1b9d('0x24')]({'name':_0x113fe4['idField'],'value':_0x27f6b9[_0x113fe4[_0x1b9d('0x23')]]});}});}return request({'form':{'method':_0x1b9d('0x25'),'input_type':'JSON','response_type':_0x1b9d('0x26'),'rest_data':JSON[_0x1b9d('0x27')]({'session':_0x4ad054['id'],'module_name':_0x1b9d('0x28'),'name_value_list':_0x3ec1ab})}});}function getAuth(_0x4e51aa){return util[_0x1b9d('0x29')](_0x1b9d('0x2a'),new Buffer(_0x4e51aa[_0x1b9d('0x2b')]+':X')['toString'](_0x1b9d('0x2c')));}function getServerInfo(_0x582d71){return request({'form':{'method':_0x1b9d('0x2d'),'input_type':_0x1b9d('0x26'),'response_type':_0x1b9d('0x26'),'rest_data':JSON['stringify']({'session':_0x582d71['id']})}});}function getUser(_0x5a2f67,_0x5e393c,_0x7aa3f0){if(!_[_0x1b9d('0x2e')](_0x5e393c)){logger[_0x1b9d('0xf')]('Getting\x20agent\x20with\x20name',_0x5e393c);return request({'form':{'method':_0x1b9d('0x2f'),'input_type':_0x1b9d('0x26'),'response_type':_0x1b9d('0x26'),'rest_data':JSON['stringify']({'session':_0x7aa3f0['id'],'module_name':_0x1b9d('0x30'),'query':util['format'](_0x1b9d('0x31'),_0x5e393c),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1b9d('0x32')](function(_0x53cd3e){if(_0x53cd3e[_0x1b9d('0x33')]['length']){var _0x259f94=_[_0x1b9d('0x34')](_0x53cd3e['entry_list'],function(_0x18831b){return _0x18831b['name_value_list'][_0x1b9d('0x35')][_0x1b9d('0x36')]===_0x5e393c;});if(_0x259f94){logger[_0x1b9d('0xf')](_0x1b9d('0x37'));return BPromise[_0x1b9d('0x38')]({'id':_0x259f94[_0x1b9d('0x39')]['id']['value'],'name':_0x259f94[_0x1b9d('0x39')][_0x1b9d('0x20')][_0x1b9d('0x36')]});}}logger['info'](_0x1b9d('0x3a'));return BPromise[_0x1b9d('0x38')]({'id':_0x7aa3f0['name_value_list'][_0x1b9d('0x3b')][_0x1b9d('0x36')],'name':_0x7aa3f0[_0x1b9d('0x39')][_0x1b9d('0x35')][_0x1b9d('0x36')]});});}else{logger['info'](_0x1b9d('0x3c'));return BPromise[_0x1b9d('0x38')]({'id':_0x7aa3f0[_0x1b9d('0x39')][_0x1b9d('0x3b')]['value'],'name':_0x7aa3f0['name_value_list'][_0x1b9d('0x35')][_0x1b9d('0x36')]});}}function getEndUser(_0x4c71f4,_0x2b5773,_0x3e01d0,_0x5c51bb){logger[_0x1b9d('0xf')](_0x1b9d('0x3d'),_0x3e01d0);return request({'form':{'method':_0x1b9d('0x2f'),'input_type':_0x1b9d('0x26'),'response_type':_0x1b9d('0x26'),'rest_data':JSON[_0x1b9d('0x27')]({'session':_0x5c51bb['id'],'module_name':_0x1b9d('0x1e'),'query':util[_0x1b9d('0x29')](_0x1b9d('0x3e'),_0x3e01d0),'order_by':'','offset':'0','select_fields':['id','name',_0x1b9d('0x3f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1b9d('0x32')](function(_0x32292a){if(_0x32292a[_0x1b9d('0x33')][_0x1b9d('0x22')]){var _0x2a98d2=_[_0x1b9d('0x34')](_0x32292a['entry_list'],function(_0x2e5459){return _0x2e5459[_0x1b9d('0x39')][_0x1b9d('0x3f')]['value']===_0x3e01d0;});if(_0x2a98d2){logger[_0x1b9d('0xf')](_0x1b9d('0x40'));return BPromise[_0x1b9d('0x38')]({'id':_0x2a98d2[_0x1b9d('0x39')]['id']['value'],'name':_0x2a98d2['name_value_list'][_0x1b9d('0x20')][_0x1b9d('0x36')],'phone':_0x2a98d2[_0x1b9d('0x39')]['phone_home']['value']});}}else{logger[_0x1b9d('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x1b9d('0x25'),'input_type':_0x1b9d('0x26'),'response_type':_0x1b9d('0x26'),'rest_data':JSON[_0x1b9d('0x27')]({'session':_0x5c51bb['id'],'module_name':_0x1b9d('0x1e'),'name_value_list':[{'name':'first_name','value':_0x2b5773!==_0x1b9d('0x41')?_0x2b5773:util[_0x1b9d('0x29')](_0x1b9d('0x42'),_0x3e01d0)},{'name':_0x1b9d('0x3f'),'value':_0x3e01d0}]})}})['then'](function(_0x36366a){logger[_0x1b9d('0xf')]('Enduser\x20created.');return BPromise[_0x1b9d('0x38')]({'id':_0x36366a['id'],'name':_0x36366a[_0x1b9d('0x33')][_0x1b9d('0x43')][_0x1b9d('0x36')],'phone':_0x36366a[_0x1b9d('0x33')][_0x1b9d('0x3f')][_0x1b9d('0x36')]});});}});}function request(_0xbc1aab){logger[_0x1b9d('0x44')](_0x1b9d('0x45'),JSON[_0x1b9d('0x27')](_0xbc1aab));return rp(_['merge'](def,_0xbc1aab));}function getTags(_0x3cfc72,_0x552b05){var _0xa4c3f0=[];if(_0x3cfc72&&_0x3cfc72['length']>0x0){_0xa4c3f0=_[_0x1b9d('0x46')](_0x3cfc72,_0x552b05);}return _0xa4c3f0;}function getCustomFields(_0x2c0584,_0x3c1b49){var _0x32fa93=[];var _0x545b53={'custom_fields':[]};if(_0x2c0584[_0x1b9d('0x22')]>0x0){_[_0x1b9d('0x47')](_0x2c0584,function(_0x35847c){if(_0x35847c[_0x1b9d('0x48')]==='string'&&_0x35847c[_0x1b9d('0x49')]&&!_0x35847c[_0x1b9d('0x4a')]){_0x545b53[_0x35847c['nameField']['toLowerCase']()]=_0x35847c[_0x1b9d('0x4b')][_0x1b9d('0x4c')]();}else if(_0x35847c[_0x1b9d('0x48')]===_0x1b9d('0x4d')&&_0x35847c[_0x1b9d('0x4e')]&&_0x35847c[_0x1b9d('0x4a')]){_0x545b53['custom_fields'][_0x1b9d('0x24')]({'id':_0x35847c['idField'],'value':_0x35847c[_0x1b9d('0x4b')][_0x1b9d('0x4c')]()});}else if(_0x35847c[_0x1b9d('0x48')]===_0x1b9d('0x4f')&&_0x35847c['variableName']&&_0x35847c[_0x1b9d('0x4e')]&&_0x35847c[_0x1b9d('0x4a')]){_0x3c1b49[_0x35847c[_0x1b9d('0x23')]]&&_0x545b53['custom_fields']['push']({'id':_0x35847c[_0x1b9d('0x4e')],'value':_0x3c1b49[_0x35847c['variableName']]['toString']()});}else if(_0x35847c['type']===_0x1b9d('0x50')&&_0x35847c[_0x1b9d('0x51')]&&_0x35847c['Variable'][_0x1b9d('0x20')]&&_0x35847c[_0x1b9d('0x4e')]&&_0x35847c[_0x1b9d('0x4a')]){_0x3c1b49[_0x35847c[_0x1b9d('0x51')][_0x1b9d('0x20')][_0x1b9d('0x52')]()]&&_0x545b53[_0x1b9d('0x53')][_0x1b9d('0x24')]({'id':_0x35847c[_0x1b9d('0x4e')],'value':_0x3c1b49[_0x35847c['Variable']['name'][_0x1b9d('0x52')]()]['toString']()});}});}return _0x545b53;}function getConnection(_0x581d25){return request({'method':_0x1b9d('0xd'),'form':{'method':_0x1b9d('0x54'),'input_type':_0x1b9d('0x26'),'response_type':_0x1b9d('0x26'),'rest_data':JSON[_0x1b9d('0x27')]({'user_auth':{'user_name':_0x581d25['username'],'password':_0x581d25[_0x1b9d('0x55')],'encryption':_0x1b9d('0x56')},'application':_0x1b9d('0x57')})}})[_0x1b9d('0x32')](function(_0x1a9ebc){var _0x203814=_0x1a9ebc;if(_0x203814['id']){def['sessionID']=_0x203814['id'];return BPromise[_0x1b9d('0x38')](_0x203814);}else{throw new Error(util['format'](_0x1b9d('0x58'),_0x581d25['id']));}});}function setRelationship(_0x282f15,_0x3c0d58,_0x245eb3,_0x5b1798){return request({'form':{'method':'set_relationship','input_type':_0x1b9d('0x26'),'response_type':_0x1b9d('0x26'),'rest_data':JSON[_0x1b9d('0x27')]({'session':_0x282f15['id'],'module_name':_0x1b9d('0x28'),'module_id':_0x245eb3['id'],'link_field_name':_0x5b1798,'related_ids':[_0x3c0d58['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1b9d('0x59')]=function(_0x1430a9,_0x3d0422,_0x32570f,_0x590f2a,_0xa66748,_0x11d8af){var _0x28ac19,_0x1848df,_0x2c5e22,_0x509a50;_0x11d8af[_0x1b9d('0x5a')]=intUtil[_0x1b9d('0x5b')](_0x11d8af[_0x1b9d('0x5a')]);_0x11d8af[_0x1b9d('0x5c')]=intUtil[_0x1b9d('0x5b')](_0x11d8af['serverUrl']);def['uri']=util['format'](_0x1b9d('0x5d'),_0x11d8af[_0x1b9d('0x5a')]);if(_0xa66748&&_0xa66748[_0x1b9d('0x5e')]){logger[_0x1b9d('0xf')]('[QUEUE]',_0x1b9d('0x5f'));_0x3d0422[_0x1b9d('0x60')]=util[_0x1b9d('0x29')](_0x1b9d('0x61'),_0x11d8af[_0x1b9d('0x5c')],_0x3d0422[_0x1b9d('0x62')],md5(_0x3d0422['uniqueid']));}else{_0x3d0422[_0x1b9d('0x60')]='';}return getConnection(_0x11d8af)[_0x1b9d('0x32')](function(_0x162a48){_0x509a50=_0x162a48;return getUser(_0x11d8af,_0x590f2a[_0x1b9d('0x20')],_0x509a50);})[_0x1b9d('0x32')](function(_0x178bc4){_0x28ac19=_0x178bc4;logger[_0x1b9d('0xf')]('The\x20User\x20ID\x20is:',_0x28ac19['id']);return getEndUser(_0x11d8af,_0x3d0422[_0x1b9d('0x63')],_0x3d0422[_0x1b9d('0x64')],_0x509a50);})['then'](function(_0x1044b2){_0x1848df=_0x1044b2;logger[_0x1b9d('0xf')]('The\x20Enduser\x20ID\x20is:',_0x1848df['id']);return getTicket(_0x11d8af,_0x28ac19,_0x1848df,_0x32570f,_0x3d0422,_0x32570f[_0x1b9d('0x65')],_0x509a50,'Inbound');})[_0x1b9d('0x32')](function(_0x39be60){_0x2c5e22=_0x39be60;logger[_0x1b9d('0xf')]('Ticket\x20created!');logger[_0x1b9d('0xf')](_0x1b9d('0x66'),_0x2c5e22['id']);return setRelationship(_0x509a50,_0x28ac19,_0x2c5e22,_0x1b9d('0x67'));})[_0x1b9d('0x32')](function(){return setRelationship(_0x509a50,_0x1848df,_0x2c5e22,_0x1b9d('0x68'));})[_0x1b9d('0x32')](function(){return getServerInfo(_0x509a50);})[_0x1b9d('0x32')](function(_0x19d2a0){var _0x41e993=parseInt(_0x19d2a0[_0x1b9d('0x69')][_0x1b9d('0x6a')](0x0));var _0x4ab530=util['format'](_0x1b9d('0x6b'),_0x11d8af[_0x1b9d('0x5a')],_0x2c5e22['id']);if(_0x41e993>0x6){_0x4ab530=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x11d8af[_0x1b9d('0x5a')],_0x2c5e22['id']);}logger[_0x1b9d('0xf')](_0x1b9d('0x6c'),_0x1b9d('0x6d'));emit(util[_0x1b9d('0x29')](_0x1b9d('0x6e'),_0x590f2a[_0x1b9d('0x20')]),_0x1b9d('0x6f'),{'uri':_0x4ab530});})[_0x1b9d('0x70')](function(_0x73a036){logger[_0x1b9d('0x71')](_0x1b9d('0x6c'),JSON['stringify'](_0x73a036));});};exports[_0x1b9d('0x72')]=function(_0x515fc9,_0x2db77a,_0xf76c6e,_0x32883e,_0x5413aa,_0x2ddaf3,_0x128c05){var _0xc33964,_0x4ef854,_0x4585c8,_0x57dec1;_0x2ddaf3[_0x1b9d('0x5a')]=intUtil[_0x1b9d('0x5b')](_0x2ddaf3[_0x1b9d('0x5a')]);_0x2ddaf3['serverUrl']=intUtil[_0x1b9d('0x5b')](_0x2ddaf3[_0x1b9d('0x5c')]);def[_0x1b9d('0x73')]=util['format'](_0x1b9d('0x5d'),_0x2ddaf3[_0x1b9d('0x5a')]);if(_0x128c05&&_0x128c05[_0x1b9d('0x74')]&&_0x128c05[_0x1b9d('0x74')]!==_0x1b9d('0x75')){logger['info']('[OUTBOUND]',_0x1b9d('0x5f'));_0x2db77a[_0x1b9d('0x60')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ddaf3['serverUrl'],_0x2db77a[_0x1b9d('0x62')],md5(_0x2db77a['uniqueid']));}return getConnection(_0x2ddaf3)[_0x1b9d('0x32')](function(_0x5dbd65){_0x57dec1=_0x5dbd65;return getUser(_0x2ddaf3,_0x32883e[_0x1b9d('0x20')],_0x57dec1);})['then'](function(_0x491cf2){_0xc33964=_0x491cf2;logger[_0x1b9d('0xf')](_0x1b9d('0x76'),_0xc33964['id']);return getEndUser(_0x2ddaf3,_0x2db77a['destcalleridname'],_0x2db77a[_0x1b9d('0x77')],_0x57dec1);})[_0x1b9d('0x32')](function(_0x3925e2){_0x4ef854=_0x3925e2;logger[_0x1b9d('0xf')](_0x1b9d('0x78'),_0x4ef854['id']);return getTicket(_0x2ddaf3,_0xc33964,_0x4ef854,_0xf76c6e,_0x2db77a,_0xf76c6e['Fields'],_0x57dec1,'Outbound');})[_0x1b9d('0x32')](function(_0x21a8ba){_0x4585c8=_0x21a8ba;logger[_0x1b9d('0xf')](_0x1b9d('0x79'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4585c8['id']);return setRelationship(_0x57dec1,_0xc33964,_0x4585c8,_0x1b9d('0x67'));})[_0x1b9d('0x32')](function(){return setRelationship(_0x57dec1,_0x4ef854,_0x4585c8,_0x1b9d('0x68'));})[_0x1b9d('0x32')](function(){return getServerInfo(_0x57dec1);})['then'](function(_0x33a17b){var _0x3a2229=parseInt(_0x33a17b[_0x1b9d('0x69')][_0x1b9d('0x6a')](0x0));var _0x11e834=util[_0x1b9d('0x29')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2ddaf3[_0x1b9d('0x5a')],_0x4585c8['id']);if(_0x3a2229>0x6){_0x11e834=util[_0x1b9d('0x29')](_0x1b9d('0x7a'),_0x2ddaf3[_0x1b9d('0x5a')],_0x4585c8['id']);}logger['info']('[OUTBOUND]',_0x1b9d('0x6d'));emit(util[_0x1b9d('0x29')](_0x1b9d('0x6e'),_0x32883e['name']),_0x1b9d('0x6f'),{'uri':_0x11e834});})[_0x1b9d('0x70')](function(_0x4ece27){logger[_0x1b9d('0x71')](_0x1b9d('0x7b'),JSON[_0x1b9d('0x27')](_0x4ece27));});};exports[_0x1b9d('0x7c')]=function(_0x51df1d,_0x1cea0a,_0x29a99f,_0x3bb268,_0x4ed480,_0x3d9d1a){var _0x566c4b,_0x596f8d,_0xd9bf41,_0x1f47c2;_0x3d9d1a[_0x1b9d('0x5a')]=intUtil['stripTrailingSlash'](_0x3d9d1a[_0x1b9d('0x5a')]);_0x3d9d1a['serverUrl']=intUtil[_0x1b9d('0x5b')](_0x3d9d1a[_0x1b9d('0x5c')]);def[_0x1b9d('0x73')]=util[_0x1b9d('0x29')](_0x1b9d('0x5d'),_0x3d9d1a[_0x1b9d('0x5a')]);if(_0x4ed480&&_0x4ed480[_0x1b9d('0x5e')]){logger[_0x1b9d('0xf')]('['+_0x1cea0a[_0x1b9d('0x7d')][_0x1b9d('0x7e')]()+']',_0x1b9d('0x5f'));_0x1cea0a['recordingURL']=util[_0x1b9d('0x29')](_0x1b9d('0x61'),_0x3d9d1a['serverUrl'],_0x1cea0a[_0x1b9d('0x62')],md5(_0x1cea0a[_0x1b9d('0x62')]));}else{_0x1cea0a['recordingURL']='';}return getConnection(_0x3d9d1a)['then'](function(_0x512afe){_0x1f47c2=_0x512afe;if(!_['isNil'](_0x3bb268)){return getUser(_0x3d9d1a,_0x3bb268[_0x1b9d('0x20')],_0x1f47c2);}else{return getUser(_0x3d9d1a,null,_0x1f47c2);}})[_0x1b9d('0x32')](function(_0x3503f4){_0x566c4b=_0x3503f4;logger[_0x1b9d('0xf')](_0x1b9d('0x76'),_0x566c4b['id']);return getEndUser(_0x3d9d1a,_0x1cea0a[_0x1b9d('0x63')],_0x1cea0a[_0x1b9d('0x64')],_0x1f47c2);})[_0x1b9d('0x32')](function(_0x5082eb){_0x596f8d=_0x5082eb;logger[_0x1b9d('0xf')](_0x1b9d('0x78'),_0x596f8d['id']);return getTicket(_0x3d9d1a,_0x566c4b,_0x596f8d,_0x29a99f,_0x1cea0a,_0x29a99f[_0x1b9d('0x65')],_0x1f47c2,'Inbound');})[_0x1b9d('0x32')](function(_0x395a93){_0xd9bf41=_0x395a93;logger['info']('Ticket\x20created!');logger[_0x1b9d('0xf')](_0x1b9d('0x66'),_0xd9bf41['id']);return setRelationship(_0x1f47c2,_0x566c4b,_0xd9bf41,'users');})['then'](function(){return setRelationship(_0x1f47c2,_0x596f8d,_0xd9bf41,_0x1b9d('0x68'));})[_0x1b9d('0x32')](function(){return getServerInfo(_0x1f47c2);})['catch'](function(_0x2e41fc){logger['error']('['+_0x1cea0a[_0x1b9d('0x7d')][_0x1b9d('0x7e')]()+']',JSON[_0x1b9d('0x27')](_0x2e41fc));});}; \ 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 ea9dee6..9ac2859 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 _0x3215=['isNil','lodash','util','getString','length','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','key','format','%s:\x20%s','keyContent','keyType','variable','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail'];(function(_0x21faf8,_0x3cae65){var _0x265ebc=function(_0x140523){while(--_0x140523){_0x21faf8['push'](_0x21faf8['shift']());}};_0x265ebc(++_0x3cae65);}(_0x3215,0x97));var _0x5321=function(_0x14cfea,_0x3e35de){_0x14cfea=_0x14cfea-0x0;var _0x144226=_0x3215[_0x14cfea];return _0x144226;};'use strict';var _=require(_0x5321('0x0'));var util=require(_0x5321('0x1'));exports[_0x5321('0x2')]=function(_0x43939a,_0x5556c2,_0x3d216c){var _0x555f74=[];if(_0x43939a[_0x5321('0x3')]>0x0){var _0x5df028=_['sortBy'](_0x43939a,['id']);for(var _0x11722c=0x0;_0x11722c<_0x5df028[_0x5321('0x3')];_0x11722c++){var _0x21c1c=_0x5df028[_0x11722c];if(_0x21c1c['type']===_0x5321('0x4')){_0x555f74[_0x5321('0x5')](_0x21c1c[_0x5321('0x6')]);}else if(_0x21c1c['type']==='variable'&&_0x21c1c[_0x5321('0x7')]){_0x5556c2[_0x21c1c[_0x5321('0x7')]]&&_0x555f74[_0x5321('0x5')](_0x5556c2[_0x21c1c[_0x5321('0x7')]][_0x5321('0x8')]());}else if(_0x21c1c['type']===_0x5321('0x9')&&_0x21c1c[_0x5321('0xa')]&&_0x21c1c[_0x5321('0xa')][_0x5321('0xb')]){_0x5556c2[_0x21c1c['Variable'][_0x5321('0xb')][_0x5321('0xc')]()]&&_0x555f74[_0x5321('0x5')](_0x5556c2[_0x21c1c[_0x5321('0xa')]['name']['toLowerCase']()][_0x5321('0x8')]());}else if(_0x21c1c['type']==='keyValue'){if(_0x21c1c['keyType']==='string'&&_0x21c1c[_0x5321('0xd')]){_0x555f74[_0x5321('0x5')](util[_0x5321('0xe')](_0x5321('0xf'),_0x21c1c[_0x5321('0xd')],_0x21c1c[_0x5321('0x10')]));}else if(_0x21c1c[_0x5321('0x11')]===_0x5321('0x12')&&_0x21c1c[_0x5321('0x7')]&&_0x21c1c['key']){_0x5556c2[_0x21c1c[_0x5321('0x7')]]&&_0x555f74[_0x5321('0x5')](util[_0x5321('0xe')](_0x5321('0xf'),_0x21c1c[_0x5321('0xd')],_0x5556c2[_0x21c1c[_0x5321('0x7')]]));}else if(_0x21c1c[_0x5321('0x11')]===_0x5321('0x9')&&_0x21c1c[_0x5321('0xa')]&&_0x21c1c['Variable'][_0x5321('0xb')]&&_0x21c1c['key']){_0x5556c2[_0x21c1c[_0x5321('0xa')]['name'][_0x5321('0xc')]()]&&_0x555f74[_0x5321('0x5')](util[_0x5321('0xe')]('%s:\x20%s',_0x21c1c[_0x5321('0xd')],_0x5556c2[_0x21c1c[_0x5321('0xa')][_0x5321('0xb')][_0x5321('0xc')]()]));}}}}return _0x555f74['join'](_0x3d216c);};exports[_0x5321('0x13')]=function(_0x2d83a2){var _0x34b5f6=_0x2d83a2[_0x5321('0x14')](-0x1);if(_0x34b5f6==='/'){_0x2d83a2=_0x2d83a2[_0x5321('0x15')](0x0,_0x2d83a2[_0x5321('0x16')](_0x34b5f6));}return _0x2d83a2;};exports[_0x5321('0x17')]=function(_0xdda20b){if(!_[_0x5321('0x18')](_0xdda20b)&&_0xdda20b!==''){var _0x5f58fb=/^(([^<>()\[\]\\.,;:\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 _0x5f58fb['test'](String(_0xdda20b)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xced2=['keyType','key','format','%s:\x20%s','keyContent','name','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','type','string','content','variable','variableName','push','customVariable','Variable','toLowerCase','toString'];(function(_0x4f3579,_0x22c620){var _0x166fdc=function(_0x219baf){while(--_0x219baf){_0x4f3579['push'](_0x4f3579['shift']());}};_0x166fdc(++_0x22c620);}(_0xced2,0x75));var _0x2ced=function(_0x2d9311,_0x458a07){_0x2d9311=_0x2d9311-0x0;var _0x5e4e1c=_0xced2[_0x2d9311];return _0x5e4e1c;};'use strict';var _=require(_0x2ced('0x0'));var util=require(_0x2ced('0x1'));exports[_0x2ced('0x2')]=function(_0x1697e5,_0x4b5fc1,_0x46c198){var _0x5bb57d=[];if(_0x1697e5['length']>0x0){var _0x23cd7f=_['sortBy'](_0x1697e5,['id']);for(var _0x36a974=0x0;_0x36a974<_0x23cd7f['length'];_0x36a974++){var _0x4105c6=_0x23cd7f[_0x36a974];if(_0x4105c6[_0x2ced('0x3')]===_0x2ced('0x4')){_0x5bb57d['push'](_0x4105c6[_0x2ced('0x5')]);}else if(_0x4105c6[_0x2ced('0x3')]===_0x2ced('0x6')&&_0x4105c6[_0x2ced('0x7')]){_0x4b5fc1[_0x4105c6['variableName']]&&_0x5bb57d[_0x2ced('0x8')](_0x4b5fc1[_0x4105c6['variableName']]['toString']());}else if(_0x4105c6[_0x2ced('0x3')]===_0x2ced('0x9')&&_0x4105c6[_0x2ced('0xa')]&&_0x4105c6[_0x2ced('0xa')]['name']){_0x4b5fc1[_0x4105c6[_0x2ced('0xa')]['name']['toLowerCase']()]&&_0x5bb57d[_0x2ced('0x8')](_0x4b5fc1[_0x4105c6[_0x2ced('0xa')]['name'][_0x2ced('0xb')]()][_0x2ced('0xc')]());}else if(_0x4105c6[_0x2ced('0x3')]==='keyValue'){if(_0x4105c6[_0x2ced('0xd')]===_0x2ced('0x4')&&_0x4105c6[_0x2ced('0xe')]){_0x5bb57d[_0x2ced('0x8')](util[_0x2ced('0xf')](_0x2ced('0x10'),_0x4105c6['key'],_0x4105c6[_0x2ced('0x11')]));}else if(_0x4105c6['keyType']==='variable'&&_0x4105c6[_0x2ced('0x7')]&&_0x4105c6[_0x2ced('0xe')]){_0x4b5fc1[_0x4105c6[_0x2ced('0x7')]]&&_0x5bb57d[_0x2ced('0x8')](util[_0x2ced('0xf')](_0x2ced('0x10'),_0x4105c6['key'],_0x4b5fc1[_0x4105c6[_0x2ced('0x7')]]));}else if(_0x4105c6['keyType']===_0x2ced('0x9')&&_0x4105c6[_0x2ced('0xa')]&&_0x4105c6[_0x2ced('0xa')][_0x2ced('0x12')]&&_0x4105c6[_0x2ced('0xe')]){_0x4b5fc1[_0x4105c6[_0x2ced('0xa')][_0x2ced('0x12')]['toLowerCase']()]&&_0x5bb57d['push'](util[_0x2ced('0xf')]('%s:\x20%s',_0x4105c6['key'],_0x4b5fc1[_0x4105c6['Variable']['name'][_0x2ced('0xb')]()]));}}}}return _0x5bb57d[_0x2ced('0x13')](_0x46c198);};exports[_0x2ced('0x14')]=function(_0xa554ba){var _0x3cb296=_0xa554ba['slice'](-0x1);if(_0x3cb296==='/'){_0xa554ba=_0xa554ba[_0x2ced('0x15')](0x0,_0xa554ba[_0x2ced('0x16')](_0x3cb296));}return _0xa554ba;};exports[_0x2ced('0x17')]=function(_0x2fbb95){if(!_[_0x2ced('0x18')](_0x2fbb95)&&_0x2fbb95!==''){var _0x7cc63c=/^(([^<>()\[\]\\.,;:\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 _0x7cc63c[_0x2ced('0x19')](String(_0x2fbb95)[_0x2ced('0xb')]());}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 85bd250..77c0621 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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0xf6d182,_0x22f289){var _0x226c82=function(_0x282927){while(--_0x282927){_0xf6d182['push'](_0xf6d182['shift']());}};_0x226c82(++_0x22f289);}(_0x34e8,0x12c));var _0x834e=function(_0x80be45,_0x4e18ac){_0x80be45=_0x80be45-0x0;var _0x36111b=_0x34e8[_0x80be45];return _0x36111b;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','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!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x272d4e,_0x4adf01){var _0x17863a=function(_0x1e7829){while(--_0x1e7829){_0x272d4e['push'](_0x272d4e['shift']());}};_0x17863a(++_0x4adf01);}(_0xe706,0xa3));var _0x6e70=function(_0x5cc4de,_0x2df335){_0x5cc4de=_0x5cc4de-0x0;var _0x1bf255=_0xe706[_0x5cc4de];return _0x1bf255;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ 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 3f4e307..833553f 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 _0xb7fc=['Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','password','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]'];(function(_0x47ea2a,_0x44acee){var _0x1e3f06=function(_0x40423a){while(--_0x40423a){_0x47ea2a['push'](_0x47ea2a['shift']());}};_0x1e3f06(++_0x44acee);}(_0xb7fc,0x8d));var _0xcb7f=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0xb7fc[_0x2967c1];return _0x103397;};'use strict';var _=require(_0xcb7f('0x0'));var rp=require('request-promise');var md5=require(_0xcb7f('0x1'));var util=require(_0xcb7f('0x2'));var Redis=require(_0xcb7f('0x3'));var intUtil=require(_0xcb7f('0x4'));var config=require(_0xcb7f('0x5'));var logger=require(_0xcb7f('0x6'))(_0xcb7f('0x7'));config[_0xcb7f('0x8')]=_['defaults'](config['redis'],{'host':_0xcb7f('0x9'),'port':0x18eb});var io=require(_0xcb7f('0xa'))(new Redis(config[_0xcb7f('0x8')]));function emit(_0x185d52,_0x31c6b9,_0x30677c){io['to'](_0x185d52)[_0xcb7f('0xb')](_0x31c6b9,_0x30677c);}var headers={'Content-Type':_0xcb7f('0xc'),'Accept':'application/json'};function getTicket(_0x3710b3,_0x425da2,_0x11a874,_0x5edee1,_0x3204b7){logger[_0xcb7f('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xcb7f('0xe')](_0xcb7f('0xf'),_0x3710b3[_0xcb7f('0x10')]),'method':_0xcb7f('0x11'),'body':{'ticket':_[_0xcb7f('0x12')]({'requester_id':_0x11a874['id'],'submitter_id':_0x425da2?_0x425da2['id']:undefined,'assignee_id':_0x425da2?_0x425da2['id']:undefined,'tags':getTags(_0x5edee1[_0xcb7f('0x13')],_0xcb7f('0x14')),'subject':intUtil[_0xcb7f('0x15')](_0x5edee1[_0xcb7f('0x16')],_0x3204b7,'\x20'),'description':intUtil[_0xcb7f('0x15')](_0x5edee1[_0xcb7f('0x17')],_0x3204b7,'\x0a'),'comment':{'public':![],'body':intUtil[_0xcb7f('0x15')](_0x5edee1[_0xcb7f('0x17')],_0x3204b7,'\x0a')}},getCustomFields(_0x5edee1[_0xcb7f('0x18')],_0x3204b7))}})[_0xcb7f('0x19')](function(_0x42996a){logger['info'](_0xcb7f('0x1a'));return _0x42996a['ticket'];});}function getUser(_0x17d129,_0x2865d7){if(intUtil[_0xcb7f('0x1b')](_0x2865d7)){logger[_0xcb7f('0xd')](_0xcb7f('0x1c'),_0x2865d7);return request({'uri':util['format'](_0xcb7f('0x1d'),_0x17d129[_0xcb7f('0x10')]),'qs':{'query':util[_0xcb7f('0xe')]('type:user\x20role:agent\x20email:%s',_0x2865d7)}})[_0xcb7f('0x19')](function(_0x73fecc){if(_0x73fecc[_0xcb7f('0x1e')]){logger[_0xcb7f('0xd')](_0xcb7f('0x1f'));return _[_0xcb7f('0x20')](_0x73fecc['results'],{'email':_0x2865d7,'role':_0xcb7f('0x21')});}else{logger[_0xcb7f('0xd')](_0xcb7f('0x22'));return request({'uri':util[_0xcb7f('0xe')](_0xcb7f('0x23'),_0x17d129[_0xcb7f('0x10')])})['then'](function(_0x4674d6){logger['info']('Admin\x20account\x20selected.');return _0x4674d6[_0xcb7f('0x24')];});}});}else{logger['info'](_0xcb7f('0x22'));return request({'uri':util[_0xcb7f('0xe')]('%s/users/me.json',_0x17d129[_0xcb7f('0x10')])})[_0xcb7f('0x19')](function(_0x11547c){logger[_0xcb7f('0xd')](_0xcb7f('0x25'));return _0x11547c[_0xcb7f('0x24')];});}}function getEndUser(_0x1fd2d4,_0x508f0c,_0x57d3a9){logger[_0xcb7f('0xd')](_0xcb7f('0x26'),_0x57d3a9);return request({'uri':util[_0xcb7f('0xe')](_0xcb7f('0x1d'),_0x1fd2d4[_0xcb7f('0x10')]),'qs':{'query':util['format'](_0xcb7f('0x27'),_0x57d3a9)}})['then'](function(_0x8f072){var _0x3dd959;if(_0x8f072[_0xcb7f('0x28')][_0xcb7f('0x29')]){_0x8f072[_0xcb7f('0x28')]=_[_0xcb7f('0x2a')](_0x8f072[_0xcb7f('0x28')],{'suspended':![],'role':_0xcb7f('0x2b')});if(_0x8f072[_0xcb7f('0x28')][_0xcb7f('0x29')]){_0x3dd959=_[_0xcb7f('0x2c')](_0x8f072['results']);}}if(_0x3dd959){logger[_0xcb7f('0xd')]('Enduser\x20found!');return _0x3dd959;}else{logger[_0xcb7f('0xd')](_0xcb7f('0x2d'));return request({'uri':util['format']('%s/users.json',_0x1fd2d4[_0xcb7f('0x10')]),'method':_0xcb7f('0x11'),'body':{'user':{'role':_0xcb7f('0x2b'),'name':util['format'](_0xcb7f('0x2e'),_0x508f0c||_0x57d3a9),'phone':_0x57d3a9}}})[_0xcb7f('0x19')](function(_0x442c77){logger[_0xcb7f('0xd')](_0xcb7f('0x2f'));return _0x442c77['user'];});}});}function getAuth(_0x2f49f1){var _0x33ae48;if(_0x2f49f1[_0xcb7f('0x30')]==='password'){_0x33ae48=util[_0xcb7f('0xe')](_0xcb7f('0x31'),_0x2f49f1['username'],_0x2f49f1[_0xcb7f('0x32')]);}else if(_0x2f49f1[_0xcb7f('0x30')]===_0xcb7f('0x33')){_0x33ae48=util[_0xcb7f('0xe')](_0xcb7f('0x34'),_0x2f49f1['username'],_0x2f49f1[_0xcb7f('0x33')]);}return util['format'](_0xcb7f('0x35'),new Buffer(_0x33ae48)[_0xcb7f('0x36')]('base64'));}function request(_0x4b4d92){logger[_0xcb7f('0x37')](_0xcb7f('0x38'),JSON[_0xcb7f('0x39')](_0x4b4d92));return rp(_[_0xcb7f('0x3a')](_0x4b4d92,{'method':_0xcb7f('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x537f5b,_0x24a7d1){var _0x184df2=[];if(_0x537f5b&&_0x537f5b[_0xcb7f('0x29')]>0x0){_0x184df2=_[_0xcb7f('0x3c')](_0x537f5b,_0x24a7d1);}return _0x184df2;}function getCustomFields(_0x29fe51,_0x5e7276){var _0xd57393=[];var _0x3e49b7={'custom_fields':[]};if(_0x29fe51['length']>0x0){_[_0xcb7f('0x3d')](_0x29fe51,function(_0x50429c){if(_[_0xcb7f('0x3e')]([_0xcb7f('0x3f'),_0xcb7f('0x40')],_0x50429c['type'])&&_0x50429c[_0xcb7f('0x41')]&&!_0x50429c[_0xcb7f('0x42')]){_0x3e49b7[_0x50429c[_0xcb7f('0x41')][_0xcb7f('0x43')]()]=_0x50429c[_0xcb7f('0x44')][_0xcb7f('0x36')]();}else if(_[_0xcb7f('0x3e')]([_0xcb7f('0x3f'),_0xcb7f('0x40')],_0x50429c[_0xcb7f('0x45')])&&_0x50429c[_0xcb7f('0x46')]&&_0x50429c['customField']){_0x3e49b7[_0xcb7f('0x47')][_0xcb7f('0x48')]({'id':_0x50429c[_0xcb7f('0x46')],'value':_0x50429c[_0xcb7f('0x44')][_0xcb7f('0x36')]()});}else if(_0x50429c[_0xcb7f('0x45')]===_0xcb7f('0x49')&&_0x50429c[_0xcb7f('0x4a')]&&_0x50429c[_0xcb7f('0x46')]&&_0x50429c[_0xcb7f('0x42')]){_0x5e7276[_0x50429c[_0xcb7f('0x4a')]]&&_0x3e49b7[_0xcb7f('0x47')][_0xcb7f('0x48')]({'id':_0x50429c[_0xcb7f('0x46')],'value':_0x5e7276[_0x50429c[_0xcb7f('0x4a')]][_0xcb7f('0x36')]()});}else if(_0x50429c[_0xcb7f('0x45')]===_0xcb7f('0x4b')&&_0x50429c[_0xcb7f('0x4c')]&&_0x50429c[_0xcb7f('0x4c')][_0xcb7f('0x14')]&&_0x50429c['idField']&&_0x50429c['customField']){_0x5e7276[_0x50429c[_0xcb7f('0x4c')][_0xcb7f('0x14')][_0xcb7f('0x43')]()]&&_0x3e49b7[_0xcb7f('0x47')]['push']({'id':_0x50429c[_0xcb7f('0x46')],'value':_0x5e7276[_0x50429c['Variable'][_0xcb7f('0x14')][_0xcb7f('0x43')]()][_0xcb7f('0x36')]()});}});}return _0x3e49b7;}exports[_0xcb7f('0x4d')]=function(_0x2fbd0d,_0xa265b7,_0x21ae4e,_0xd0612c,_0x22e8cb,_0x2f0e30){var _0x4a9f21,_0x16252c;_0x2f0e30[_0xcb7f('0x10')]=intUtil[_0xcb7f('0x4e')](_0x2f0e30[_0xcb7f('0x10')]);_0x2f0e30[_0xcb7f('0x4f')]=intUtil[_0xcb7f('0x4e')](_0x2f0e30[_0xcb7f('0x4f')]);if(_0x22e8cb&&_0x22e8cb[_0xcb7f('0x50')]){logger[_0xcb7f('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0xa265b7[_0xcb7f('0x51')]=util[_0xcb7f('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f0e30[_0xcb7f('0x4f')],_0xa265b7[_0xcb7f('0x52')],md5(_0xa265b7[_0xcb7f('0x52')]));}else{_0xa265b7[_0xcb7f('0x51')]='';}headers[_0xcb7f('0x53')]=getAuth(_0x2f0e30);return getUser(_0x2f0e30,_0xd0612c[_0xcb7f('0x54')])[_0xcb7f('0x19')](function(_0x2def11){_0x4a9f21=_0x2def11;logger[_0xcb7f('0xd')](_0xcb7f('0x55'),_0x4a9f21['id']);return getEndUser(_0x2f0e30,_0xa265b7[_0xcb7f('0x56')],_0xa265b7[_0xcb7f('0x57')]);})[_0xcb7f('0x19')](function(_0x3382b8){_0x16252c=_0x3382b8;logger['info'](_0xcb7f('0x58'),_0x16252c['id']);return getTicket(_0x2f0e30,_0x4a9f21,_0x16252c,_0x21ae4e,_0xa265b7);})[_0xcb7f('0x19')](function(_0xf31eba){if(_0xf31eba){logger['info']('The\x20Ticket\x20ID\x20is:',_0xf31eba['id']);switch(_0x2f0e30['type']){case _0xcb7f('0x59'):logger[_0xcb7f('0xd')](_0xcb7f('0x5a'),_0xcb7f('0x5b'));return request({'uri':util[_0xcb7f('0xe')](_0xcb7f('0x5c'),_0x2f0e30[_0xcb7f('0x10')],_0x4a9f21['id'],_0xf31eba['id']),'method':_0xcb7f('0x11')});case _0xcb7f('0x5d'):logger[_0xcb7f('0xd')](_0xcb7f('0x5a'),_0xcb7f('0x5e'));emit(util[_0xcb7f('0xe')]('user:%s',_0xd0612c[_0xcb7f('0x14')]),_0xcb7f('0x5f'),{'uri':util[_0xcb7f('0xe')](_0xcb7f('0x60'),_0x2f0e30[_0xcb7f('0x10')][_0xcb7f('0x61')](_0xcb7f('0x62'),''),_0xf31eba['id'])});break;default:logger['error'](_0xcb7f('0x5a'),_0xcb7f('0x63'));}}})[_0xcb7f('0x64')](function(_0x3ee332){logger[_0xcb7f('0x65')](_0xcb7f('0x66'),util[_0xcb7f('0x67')](_0x3ee332,{'showHidden':!![],'depth':null}));});};exports[_0xcb7f('0x68')]=function(_0x1e7a57,_0x2b58ca,_0x28cd10,_0xf33ab4,_0x3c2785,_0x1ec7a3,_0xb9e860){var _0x4288e2,_0x4e020c;_0x1ec7a3[_0xcb7f('0x10')]=intUtil['stripTrailingSlash'](_0x1ec7a3[_0xcb7f('0x10')]);_0x1ec7a3['serverUrl']=intUtil[_0xcb7f('0x4e')](_0x1ec7a3[_0xcb7f('0x4f')]);if(_0xb9e860&&_0xb9e860[_0xcb7f('0x69')]&&_0xb9e860[_0xcb7f('0x69')]!=='none'){logger[_0xcb7f('0xd')]('[OUTBOUND]',_0xcb7f('0x6a'));_0x2b58ca[_0xcb7f('0x51')]=util['format'](_0xcb7f('0x6b'),_0x1ec7a3['serverUrl'],_0x2b58ca['uniqueid'],md5(_0x2b58ca[_0xcb7f('0x52')]));}headers['Authorization']=getAuth(_0x1ec7a3);return getUser(_0x1ec7a3,_0xf33ab4[_0xcb7f('0x54')])[_0xcb7f('0x19')](function(_0x5439f3){_0x4288e2=_0x5439f3;logger[_0xcb7f('0xd')](_0xcb7f('0x55'),_0x4288e2['id']);return getEndUser(_0x1ec7a3,_0x2b58ca[_0xcb7f('0x6c')],_0x2b58ca[_0xcb7f('0x6d')]);})['then'](function(_0x58e924){_0x4e020c=_0x58e924;logger[_0xcb7f('0xd')](_0xcb7f('0x58'),_0x4e020c['id']);return getTicket(_0x1ec7a3,_0x4288e2,_0x4e020c,_0x28cd10,_0x2b58ca);})[_0xcb7f('0x19')](function(_0x3db1bb){if(_0x3db1bb){logger[_0xcb7f('0xd')](_0xcb7f('0x6e'),_0x3db1bb['id']);switch(_0x1ec7a3[_0xcb7f('0x45')]){case _0xcb7f('0x59'):logger[_0xcb7f('0xd')](_0xcb7f('0x6f'),_0xcb7f('0x5b'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1ec7a3[_0xcb7f('0x10')],_0x4288e2['id'],_0x3db1bb['id']),'method':_0xcb7f('0x11')});case _0xcb7f('0x5d'):logger[_0xcb7f('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcb7f('0xe')]('user:%s',_0xf33ab4[_0xcb7f('0x14')]),_0xcb7f('0x5f'),{'uri':util[_0xcb7f('0xe')](_0xcb7f('0x60'),_0x1ec7a3[_0xcb7f('0x10')][_0xcb7f('0x61')](_0xcb7f('0x62'),''),_0x3db1bb['id'])});break;default:logger[_0xcb7f('0x65')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xcb7f('0x64')](function(_0x3546bf){logger[_0xcb7f('0x65')](_0xcb7f('0x70'),util[_0xcb7f('0x67')](_0x3546bf,{'showHidden':!![],'depth':null}));});};exports[_0xcb7f('0x71')]=function(_0x1b009e,_0x47840a,_0x193d6a,_0x2541f8,_0x5a4a85,_0x3bdf55){var _0x357261,_0x264a81;_0x3bdf55[_0xcb7f('0x10')]=intUtil['stripTrailingSlash'](_0x3bdf55[_0xcb7f('0x10')]);_0x3bdf55[_0xcb7f('0x4f')]=intUtil[_0xcb7f('0x4e')](_0x3bdf55[_0xcb7f('0x4f')]);if(_0x5a4a85&&_0x5a4a85[_0xcb7f('0x50')]){logger[_0xcb7f('0xd')]('['+_0x47840a[_0xcb7f('0x72')][_0xcb7f('0x73')]()+']',_0xcb7f('0x6a'));_0x47840a[_0xcb7f('0x51')]=util[_0xcb7f('0xe')](_0xcb7f('0x6b'),_0x3bdf55[_0xcb7f('0x4f')],_0x47840a[_0xcb7f('0x52')],md5(_0x47840a[_0xcb7f('0x52')]));}else{_0x47840a[_0xcb7f('0x51')]='';}headers[_0xcb7f('0x53')]=getAuth(_0x3bdf55);return getUser(_0x3bdf55)[_0xcb7f('0x19')](function(_0x3c82ea){_0x357261=_0x3c82ea;logger[_0xcb7f('0xd')](_0xcb7f('0x55'),_0x357261['id']);return getEndUser(_0x3bdf55,_0x47840a[_0xcb7f('0x56')],_0x47840a[_0xcb7f('0x57')]);})[_0xcb7f('0x19')](function(_0x55b4b7){_0x264a81=_0x55b4b7;logger[_0xcb7f('0xd')]('The\x20Enduser\x20ID\x20is:',_0x264a81['id']);return getTicket(_0x3bdf55,_0x357261,_0x264a81,_0x193d6a,_0x47840a);})[_0xcb7f('0x19')](function(_0x5947e3){if(_0x5947e3){logger[_0xcb7f('0xd')](_0xcb7f('0x6e'),_0x5947e3['id']);}})[_0xcb7f('0x64')](function(_0x11e607){logger['error']('['+_0x47840a[_0xcb7f('0x72')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x11e607,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6a88=['end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','authType','token','%s/token:%s','username','Basic\x20%s','base64','[HTTP]','stringify','forEach','string','picklist','type','nameField','content','toString','includes','customField','custom_fields','push','idField','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','destcalleridname','destcalleridnum','integrationTab','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Descriptions','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','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','length'];(function(_0x5ad190,_0xd39c9e){var _0x518ed3=function(_0x57f03a){while(--_0x57f03a){_0x5ad190['push'](_0x5ad190['shift']());}};_0x518ed3(++_0xd39c9e);}(_0x6a88,0x125));var _0x86a8=function(_0xdb47d8,_0x933e5b){_0xdb47d8=_0xdb47d8-0x0;var _0x5cdfd9=_0x6a88[_0xdb47d8];return _0x5cdfd9;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x86a8('0x0'));var util=require(_0x86a8('0x1'));var Redis=require(_0x86a8('0x2'));var intUtil=require('./util');var config=require(_0x86a8('0x3'));var logger=require(_0x86a8('0x4'))(_0x86a8('0x5'));config[_0x86a8('0x6')]=_[_0x86a8('0x7')](config[_0x86a8('0x6')],{'host':_0x86a8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x86a8('0x6')]));function emit(_0xf73f35,_0x3c4345,_0x25054a){io['to'](_0xf73f35)['emit'](_0x3c4345,_0x25054a);}var headers={'Content-Type':_0x86a8('0x9'),'Accept':_0x86a8('0x9')};function getTicket(_0x486c69,_0x3a7def,_0x5f2a38,_0x2df7af,_0x6b674c){logger[_0x86a8('0xa')](_0x86a8('0xb'));return request({'uri':util[_0x86a8('0xc')](_0x86a8('0xd'),_0x486c69['remoteUri']),'method':_0x86a8('0xe'),'body':{'ticket':_[_0x86a8('0xf')]({'requester_id':_0x5f2a38['id'],'submitter_id':_0x3a7def?_0x3a7def['id']:undefined,'assignee_id':_0x3a7def?_0x3a7def['id']:undefined,'tags':getTags(_0x2df7af[_0x86a8('0x10')],_0x86a8('0x11')),'subject':intUtil[_0x86a8('0x12')](_0x2df7af['Subjects'],_0x6b674c,'\x20'),'description':intUtil['getString'](_0x2df7af[_0x86a8('0x13')],_0x6b674c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x86a8('0x12')](_0x2df7af[_0x86a8('0x13')],_0x6b674c,'\x0a')}},getCustomFields(_0x2df7af['Fields'],_0x6b674c))}})[_0x86a8('0x14')](function(_0x222a76){logger[_0x86a8('0xa')]('Ticket\x20created!');return _0x222a76[_0x86a8('0x15')];});}function getUser(_0x5b6828,_0x4836e9){if(intUtil[_0x86a8('0x16')](_0x4836e9)){logger[_0x86a8('0xa')](_0x86a8('0x17'),_0x4836e9);return request({'uri':util[_0x86a8('0xc')](_0x86a8('0x18'),_0x5b6828[_0x86a8('0x19')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x4836e9)}})['then'](function(_0x502dfd){if(_0x502dfd['count']){logger[_0x86a8('0xa')](_0x86a8('0x1a'));return _[_0x86a8('0x1b')](_0x502dfd[_0x86a8('0x1c')],{'email':_0x4836e9,'role':_0x86a8('0x1d')});}else{logger[_0x86a8('0xa')](_0x86a8('0x1e'));return request({'uri':util[_0x86a8('0xc')]('%s/users/me.json',_0x5b6828[_0x86a8('0x19')])})[_0x86a8('0x14')](function(_0x432e03){logger['info'](_0x86a8('0x1f'));return _0x432e03[_0x86a8('0x20')];});}});}else{logger[_0x86a8('0xa')](_0x86a8('0x1e'));return request({'uri':util[_0x86a8('0xc')](_0x86a8('0x21'),_0x5b6828[_0x86a8('0x19')])})[_0x86a8('0x14')](function(_0x187d84){logger[_0x86a8('0xa')](_0x86a8('0x1f'));return _0x187d84[_0x86a8('0x20')];});}}function getEndUser(_0x5d0671,_0x153d71,_0x3e2340){logger[_0x86a8('0xa')](_0x86a8('0x22'),_0x3e2340);return request({'uri':util[_0x86a8('0xc')](_0x86a8('0x18'),_0x5d0671[_0x86a8('0x19')]),'qs':{'query':util['format'](_0x86a8('0x23'),_0x3e2340)}})[_0x86a8('0x14')](function(_0x32ae1d){var _0x5e6a81;if(_0x32ae1d[_0x86a8('0x1c')][_0x86a8('0x24')]){_0x32ae1d['results']=_['filter'](_0x32ae1d['results'],{'suspended':![],'role':_0x86a8('0x25')});if(_0x32ae1d[_0x86a8('0x1c')][_0x86a8('0x24')]){_0x5e6a81=_[_0x86a8('0x26')](_0x32ae1d['results']);}}if(_0x5e6a81){logger[_0x86a8('0xa')](_0x86a8('0x27'));return _0x5e6a81;}else{logger[_0x86a8('0xa')](_0x86a8('0x28'));return request({'uri':util['format']('%s/users.json',_0x5d0671[_0x86a8('0x19')]),'method':_0x86a8('0xe'),'body':{'user':{'role':_0x86a8('0x25'),'name':util['format'](_0x86a8('0x29'),_0x153d71||_0x3e2340),'phone':_0x3e2340}}})[_0x86a8('0x14')](function(_0xaca6bd){logger['info'](_0x86a8('0x2a'));return _0xaca6bd[_0x86a8('0x20')];});}});}function getAuth(_0x24d9b9){var _0x3c5315;if(_0x24d9b9['authType']===_0x86a8('0x2b')){_0x3c5315=util[_0x86a8('0xc')](_0x86a8('0x2c'),_0x24d9b9['username'],_0x24d9b9[_0x86a8('0x2b')]);}else if(_0x24d9b9[_0x86a8('0x2d')]===_0x86a8('0x2e')){_0x3c5315=util[_0x86a8('0xc')](_0x86a8('0x2f'),_0x24d9b9[_0x86a8('0x30')],_0x24d9b9[_0x86a8('0x2e')]);}return util[_0x86a8('0xc')](_0x86a8('0x31'),new Buffer(_0x3c5315)['toString'](_0x86a8('0x32')));}function request(_0x4362de){logger['debug'](_0x86a8('0x33'),JSON[_0x86a8('0x34')](_0x4362de));return rp(_[_0x86a8('0x7')](_0x4362de,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3ae2a4,_0x3eab7a){var _0x464d57=[];if(_0x3ae2a4&&_0x3ae2a4['length']>0x0){_0x464d57=_['map'](_0x3ae2a4,_0x3eab7a);}return _0x464d57;}function getCustomFields(_0x2b0034,_0x3c0970){var _0x460822=[];var _0x4a7cd3={'custom_fields':[]};if(_0x2b0034['length']>0x0){_[_0x86a8('0x35')](_0x2b0034,function(_0x30c138){if(_['includes']([_0x86a8('0x36'),_0x86a8('0x37')],_0x30c138[_0x86a8('0x38')])&&_0x30c138['nameField']&&!_0x30c138['customField']){_0x4a7cd3[_0x30c138[_0x86a8('0x39')]['toLowerCase']()]=_0x30c138[_0x86a8('0x3a')][_0x86a8('0x3b')]();}else if(_[_0x86a8('0x3c')](['string','picklist'],_0x30c138[_0x86a8('0x38')])&&_0x30c138['idField']&&_0x30c138[_0x86a8('0x3d')]){_0x4a7cd3[_0x86a8('0x3e')][_0x86a8('0x3f')]({'id':_0x30c138[_0x86a8('0x40')],'value':_0x30c138[_0x86a8('0x3a')][_0x86a8('0x3b')]()});}else if(_0x30c138[_0x86a8('0x38')]===_0x86a8('0x41')&&_0x30c138[_0x86a8('0x42')]&&_0x30c138[_0x86a8('0x40')]&&_0x30c138[_0x86a8('0x3d')]){_0x3c0970[_0x30c138[_0x86a8('0x42')]]&&_0x4a7cd3[_0x86a8('0x3e')]['push']({'id':_0x30c138[_0x86a8('0x40')],'value':_0x3c0970[_0x30c138['variableName']]['toString']()});}else if(_0x30c138[_0x86a8('0x38')]===_0x86a8('0x43')&&_0x30c138[_0x86a8('0x44')]&&_0x30c138[_0x86a8('0x44')]['name']&&_0x30c138[_0x86a8('0x40')]&&_0x30c138[_0x86a8('0x3d')]){_0x3c0970[_0x30c138['Variable'][_0x86a8('0x11')]['toLowerCase']()]&&_0x4a7cd3['custom_fields']['push']({'id':_0x30c138[_0x86a8('0x40')],'value':_0x3c0970[_0x30c138['Variable'][_0x86a8('0x11')][_0x86a8('0x45')]()][_0x86a8('0x3b')]()});}});}return _0x4a7cd3;}exports[_0x86a8('0x46')]=function(_0x29efcb,_0x38990d,_0x348c6f,_0x2f5290,_0x1d7370,_0x5673b1){var _0x92fec3,_0x34a236;_0x5673b1[_0x86a8('0x19')]=intUtil[_0x86a8('0x47')](_0x5673b1[_0x86a8('0x19')]);_0x5673b1[_0x86a8('0x48')]=intUtil[_0x86a8('0x47')](_0x5673b1[_0x86a8('0x48')]);if(_0x1d7370&&_0x1d7370[_0x86a8('0x49')]){logger[_0x86a8('0xa')](_0x86a8('0x4a'),_0x86a8('0x4b'));_0x38990d[_0x86a8('0x4c')]=util[_0x86a8('0xc')](_0x86a8('0x4d'),_0x5673b1[_0x86a8('0x48')],_0x38990d[_0x86a8('0x4e')],md5(_0x38990d['uniqueid']));}else{_0x38990d[_0x86a8('0x4c')]='';}headers[_0x86a8('0x4f')]=getAuth(_0x5673b1);return getUser(_0x5673b1,_0x2f5290[_0x86a8('0x50')])[_0x86a8('0x14')](function(_0x55ecd4){_0x92fec3=_0x55ecd4;logger[_0x86a8('0xa')](_0x86a8('0x51'),_0x92fec3['id']);return getEndUser(_0x5673b1,_0x38990d[_0x86a8('0x52')],_0x38990d['calleridnum']);})['then'](function(_0x972ddf){_0x34a236=_0x972ddf;logger['info'](_0x86a8('0x53'),_0x34a236['id']);return getTicket(_0x5673b1,_0x92fec3,_0x34a236,_0x348c6f,_0x38990d);})[_0x86a8('0x14')](function(_0x44cbb5){if(_0x44cbb5){logger[_0x86a8('0xa')](_0x86a8('0x54'),_0x44cbb5['id']);switch(_0x5673b1[_0x86a8('0x38')]){case'integrationTab':logger[_0x86a8('0xa')](_0x86a8('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x86a8('0x55'),_0x5673b1[_0x86a8('0x19')],_0x92fec3['id'],_0x44cbb5['id']),'method':'POST'});case _0x86a8('0x56'):logger[_0x86a8('0xa')](_0x86a8('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x86a8('0xc')](_0x86a8('0x57'),_0x2f5290[_0x86a8('0x11')]),_0x86a8('0x58'),{'uri':util[_0x86a8('0xc')]('%s/agent/tickets/%s',_0x5673b1[_0x86a8('0x19')][_0x86a8('0x59')](_0x86a8('0x5a'),''),_0x44cbb5['id'])});break;default:logger[_0x86a8('0x5b')]('[QUEUE]',_0x86a8('0x5c'));}}})[_0x86a8('0x5d')](function(_0x54961a){logger['error'](_0x86a8('0x5e'),util[_0x86a8('0x5f')](_0x54961a,{'showHidden':!![],'depth':null}));});};exports[_0x86a8('0x60')]=function(_0x54e511,_0x5bdb97,_0xc593fb,_0x3ee695,_0x563209,_0x59baa5,_0x4f1457){var _0x2d716e,_0xa11b0;_0x59baa5[_0x86a8('0x19')]=intUtil[_0x86a8('0x47')](_0x59baa5[_0x86a8('0x19')]);_0x59baa5['serverUrl']=intUtil[_0x86a8('0x47')](_0x59baa5[_0x86a8('0x48')]);if(_0x4f1457&&_0x4f1457[_0x86a8('0x61')]&&_0x4f1457[_0x86a8('0x61')]!==_0x86a8('0x62')){logger['info']('[OUTBOUND]',_0x86a8('0x4b'));_0x5bdb97[_0x86a8('0x4c')]=util[_0x86a8('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x59baa5[_0x86a8('0x48')],_0x5bdb97[_0x86a8('0x4e')],md5(_0x5bdb97[_0x86a8('0x4e')]));}headers[_0x86a8('0x4f')]=getAuth(_0x59baa5);return getUser(_0x59baa5,_0x3ee695['email'])['then'](function(_0xbb1719){_0x2d716e=_0xbb1719;logger[_0x86a8('0xa')]('The\x20User\x20ID\x20is:',_0x2d716e['id']);return getEndUser(_0x59baa5,_0x5bdb97[_0x86a8('0x63')],_0x5bdb97[_0x86a8('0x64')]);})['then'](function(_0x4262ca){_0xa11b0=_0x4262ca;logger[_0x86a8('0xa')](_0x86a8('0x53'),_0xa11b0['id']);return getTicket(_0x59baa5,_0x2d716e,_0xa11b0,_0xc593fb,_0x5bdb97);})[_0x86a8('0x14')](function(_0x22645d){if(_0x22645d){logger[_0x86a8('0xa')](_0x86a8('0x54'),_0x22645d['id']);switch(_0x59baa5[_0x86a8('0x38')]){case _0x86a8('0x65'):logger[_0x86a8('0xa')](_0x86a8('0x66'),_0x86a8('0x67'));return request({'uri':util['format'](_0x86a8('0x55'),_0x59baa5['remoteUri'],_0x2d716e['id'],_0x22645d['id']),'method':'POST'});case'newTab':logger['info'](_0x86a8('0x66'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x86a8('0xc')](_0x86a8('0x57'),_0x3ee695[_0x86a8('0x11')]),'trigger:browser:url',{'uri':util['format'](_0x86a8('0x68'),_0x59baa5[_0x86a8('0x19')][_0x86a8('0x59')]('/api/v2',''),_0x22645d['id'])});break;default:logger[_0x86a8('0x5b')]('[OUTBOUND]',_0x86a8('0x5c'));}}})[_0x86a8('0x5d')](function(_0x4838d){logger[_0x86a8('0x5b')](_0x86a8('0x69'),util['inspect'](_0x4838d,{'showHidden':!![],'depth':null}));});};exports[_0x86a8('0x6a')]=function(_0x2500f2,_0x39f065,_0x18fbae,_0x1f6f05,_0x19a24f,_0xad907f){var _0x199ae2,_0xc6fdc7;_0xad907f[_0x86a8('0x19')]=intUtil[_0x86a8('0x47')](_0xad907f[_0x86a8('0x19')]);_0xad907f[_0x86a8('0x48')]=intUtil['stripTrailingSlash'](_0xad907f[_0x86a8('0x48')]);if(_0x19a24f&&_0x19a24f[_0x86a8('0x49')]){logger[_0x86a8('0xa')]('['+_0x39f065['lastevent'][_0x86a8('0x6b')]()+']',_0x86a8('0x4b'));_0x39f065[_0x86a8('0x4c')]=util[_0x86a8('0xc')](_0x86a8('0x4d'),_0xad907f[_0x86a8('0x48')],_0x39f065[_0x86a8('0x4e')],md5(_0x39f065[_0x86a8('0x4e')]));}else{_0x39f065[_0x86a8('0x4c')]='';}headers[_0x86a8('0x4f')]=getAuth(_0xad907f);return getUser(_0xad907f)['then'](function(_0x5e5e1b){_0x199ae2=_0x5e5e1b;logger[_0x86a8('0xa')](_0x86a8('0x51'),_0x199ae2['id']);return getEndUser(_0xad907f,_0x39f065['calleridname'],_0x39f065['calleridnum']);})[_0x86a8('0x14')](function(_0x5ec5b9){_0xc6fdc7=_0x5ec5b9;logger['info'](_0x86a8('0x53'),_0xc6fdc7['id']);return getTicket(_0xad907f,_0x199ae2,_0xc6fdc7,_0x18fbae,_0x39f065);})['then'](function(_0x38ae40){if(_0x38ae40){logger[_0x86a8('0xa')]('The\x20Ticket\x20ID\x20is:',_0x38ae40['id']);}})[_0x86a8('0x5d')](function(_0xa96e72){logger[_0x86a8('0x5b')]('['+_0x39f065[_0x86a8('0x6c')][_0x86a8('0x6b')]()+']'+_0x86a8('0x6d'),util[_0x86a8('0x5f')](_0xa96e72,{'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 296c19d..0f25017 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 _0x6eb6=['zone','https://accounts.zoho.com','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','then','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Using\x20the\x20admin\x20account!','Administrator','user','profile','stringify','error','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','complete','connect','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','details','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','The\x20User\x20ID\x20is:','calleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','zoho.eu','email','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','com','calleridnum','lastevent','lodash','request-promise','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','forEach','includes','string','picklist','type','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','indexOf','isNil','access_token','isBefore'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0x6eb6,0x1bf));var _0x66eb=function(_0x59e622,_0x206ddf){_0x59e622=_0x59e622-0x0;var _0x8261f2=_0x6eb6[_0x59e622];return _0x8261f2;};'use strict';var _=require(_0x66eb('0x0'));var rp=require(_0x66eb('0x1'));var md5=require('md5');var util=require(_0x66eb('0x2'));var intUtil=require(_0x66eb('0x3'));var moment=require(_0x66eb('0x4'));var Redis=require(_0x66eb('0x5'));var BPromise=require('bluebird');var config=require(_0x66eb('0x6'));var logger=require(_0x66eb('0x7'))(_0x66eb('0x8'));config[_0x66eb('0x9')]=_[_0x66eb('0xa')](config[_0x66eb('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x66eb('0xb'))(new Redis(config['redis']));function emit(_0x29d46b,_0x1ed824,_0x4e0c3e){io['to'](_0x29d46b)[_0x66eb('0xc')](_0x1ed824,_0x4e0c3e);}function request(_0x22c0c1){logger[_0x66eb('0xd')](_0x66eb('0xe'),JSON['stringify'](_0x22c0c1));return rp(_0x22c0c1);}function getCustomFields(_0x16bff1,_0x2f39ab){var _0x123fcd={};if(_0x16bff1['length']>0x0){_[_0x66eb('0xf')](_0x16bff1,function(_0x364e65){if(_[_0x66eb('0x10')]([_0x66eb('0x11'),_0x66eb('0x12')],_0x364e65[_0x66eb('0x13')])&&_0x364e65[_0x66eb('0x14')]){_0x123fcd[_0x364e65[_0x66eb('0x14')]]=_0x364e65[_0x66eb('0x15')]['toString']();}else if(_0x364e65['type']===_0x66eb('0x16')&&_0x364e65[_0x66eb('0x17')]&&_0x364e65[_0x66eb('0x14')]&&_0x2f39ab[_0x364e65[_0x66eb('0x17')]]){_0x123fcd[_0x364e65[_0x66eb('0x14')]]=_0x2f39ab[_0x364e65[_0x66eb('0x17')]]['toString']();}else if(_0x364e65[_0x66eb('0x13')]===_0x66eb('0x18')&&_0x364e65[_0x66eb('0x19')]&&_0x364e65[_0x66eb('0x19')][_0x66eb('0x1a')]&&_0x364e65['idField']&&_0x2f39ab[_0x364e65['Variable']['name'][_0x66eb('0x1b')]()]){_0x123fcd[_0x364e65['idField']]=_0x2f39ab[_0x364e65[_0x66eb('0x19')][_0x66eb('0x1a')][_0x66eb('0x1b')]()][_0x66eb('0x1c')]();}});}return _0x123fcd;}function getName(_0x443bdb){if(_0x443bdb[_0x66eb('0x1d')]('\x20')>0x0){var _0x44d90f=_0x443bdb['split'](/ (.+)/);if(_0x44d90f[0x1]){return _0x44d90f;}}return[_0x443bdb,_0x443bdb];}var accountsTokens={};function getAccessToken(_0x5631c9){return new Promise(function(_0x472f9f,_0x17e0cb){if(!_[_0x66eb('0x1e')](accountsTokens[_0x5631c9['id']])&&!_[_0x66eb('0x1e')](accountsTokens[_0x5631c9['id']][_0x66eb('0x1f')])){if(moment()[_0x66eb('0x20')](accountsTokens[_0x5631c9['id']]['expires_in'])){_0x472f9f(accountsTokens[_0x5631c9['id']]['access_token']);}}var _0x959f70;switch(_0x5631c9[_0x66eb('0x21')]){case'US':_0x959f70=_0x66eb('0x22');break;case'AU':_0x959f70=_0x66eb('0x23');break;case'EU':_0x959f70=_0x66eb('0x24');break;case'IN':_0x959f70=_0x66eb('0x25');break;case'CN':_0x959f70=_0x66eb('0x26');break;default:_0x959f70=_0x66eb('0x24');break;}var _0x1e1aea={'method':_0x66eb('0x27'),'uri':_0x959f70+_0x66eb('0x28'),'qs':{'refresh_token':_0x5631c9[_0x66eb('0x29')],'client_id':_0x5631c9[_0x66eb('0x2a')],'client_secret':_0x5631c9[_0x66eb('0x2b')],'grant_type':_0x66eb('0x2c')},'json':!![]};return rp(_0x1e1aea)[_0x66eb('0x2d')](function(_0x375955){accountsTokens[_0x5631c9['id']]={'access_token':_0x375955[_0x66eb('0x1f')],'expires_in':moment()[_0x66eb('0x2e')](_0x375955[_0x66eb('0x2f')],_0x66eb('0x30'))};_0x472f9f(_0x375955[_0x66eb('0x1f')]);})[_0x66eb('0x31')](function(_0x4d6903){logger['error'](_0x66eb('0x32'),_0x4d6903[_0x66eb('0x33')]);_0x17e0cb(_0x4d6903);});});}function getUser(_0x42ae7f,_0x45402f,_0x2c2eda,_0x2f6465){logger[_0x66eb('0x34')](_0x66eb('0x35'));return request({'method':_0x66eb('0x36'),'uri':util[_0x66eb('0x37')](_0x66eb('0x38'),_0x45402f),'qs':{'type':_0x66eb('0x39')},'headers':{'Authorization':_0x66eb('0x3a')+_0x42ae7f},'json':!![]})['then'](function(_0x171a80){if(_0x171a80[_0x66eb('0x3b')]){var _0x3a13c7=-0x1;if(_[_0x66eb('0x3c')](_0x171a80[_0x66eb('0x3b')])){if(!_[_0x66eb('0x1e')](_0x2f6465)){_0x3a13c7=_[_0x66eb('0x3d')](_0x171a80['users'],function(_0x355bfe){return _0x355bfe['email']===_0x2f6465;});}if(_0x3a13c7>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x66eb('0x34')](_0x66eb('0x3e'));_0x3a13c7=_[_0x66eb('0x3d')](_0x171a80[_0x66eb('0x3b')],function(_0x1aab66){return _0x1aab66['profile']['name']===_0x66eb('0x3f');});}return _0x171a80['users'][_0x3a13c7];}else{if(_0x171a80[_0x66eb('0x40')][_0x66eb('0x41')][_0x66eb('0x1a')]===_0x66eb('0x3f')){logger[_0x66eb('0x34')](_0x66eb('0x3e'));user=_0x171a80[_0x66eb('0x40')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x171a80));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x66eb('0x42')](_0x171a80));}}}else{logger[_0x66eb('0x43')](_0x66eb('0x44'),JSON[_0x66eb('0x42')](_0x171a80));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x66eb('0x42')](_0x171a80));}})['catch'](function(_0x4268ef){console[_0x66eb('0x43')](_0x4268ef);});}function getZohoUser(_0x277791,_0x54aef5){return new BPromise(function(_0x1c64ca,_0x5dbee5){request(_0x277791)[_0x66eb('0x2d')](function(_0x479be5){var _0x517d81=null;if(_0x479be5){_0x517d81=_0x479be5[_0x66eb('0x45')][0x0];_0x517d81[_0x66eb('0x46')]=_0x54aef5;}_0x1c64ca(_0x517d81);})[_0x66eb('0x31')](function(_0x2382e1){_0x5dbee5(_0x2382e1);});});}function createEndUser(_0x696a6,_0x201b40,_0x1bc14c,_0x1746ac,_0x58a44d,_0x4a9a1e){var _0x1bc14c=getName(_0x1bc14c);return request({'method':_0x66eb('0x27'),'uri':_0x66eb('0x47')+_0x201b40+_0x66eb('0x48')+_[_0x66eb('0x49')](_0x4a9a1e[_0x66eb('0x4a')])+'s','body':{'data':[{'Last_Name':_0x1bc14c[0x1],'First_Name':_0x1bc14c[0x0],'Phone':_0x1746ac,'Owner':{'name':!_[_0x66eb('0x1e')](_0x58a44d[_0x66eb('0x4b')]['name'])?_0x58a44d[_0x66eb('0x4b')]['name']:!_[_0x66eb('0x1e')](_0x58a44d[_0x66eb('0x4c')])?_0x58a44d['first_name']+'\x20'+_0x58a44d[_0x66eb('0x4d')]:_0x58a44d['last_name'],'id':_0x58a44d['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x696a6},'json':!![]})[_0x66eb('0x2d')](function(_0x1e5747){if(_0x1e5747&&_0x1e5747[_0x66eb('0x45')][0x0][_0x66eb('0x4e')]===_0x66eb('0x4f')){var _0x2907c7=_0x1e5747[_0x66eb('0x45')][0x0]['details'];_0x2907c7[_0x66eb('0x46')]=_['startCase'](_0x4a9a1e[_0x66eb('0x4a')])+'s';return _0x2907c7;}logger[_0x66eb('0x43')](_0x66eb('0x44'),JSON[_0x66eb('0x42')](data));throw new Error(_0x66eb('0x50')+JSON['stringify'](data));})[_0x66eb('0x31')](function(_0xef2f5d){console[_0x66eb('0x51')](_0x66eb('0x52'),_0xef2f5d);});}function getEndUser(_0x11ea1f,_0x468743,_0x49729c,_0x422571,_0x239f58,_0x58adeb,_0x12534e){var _0xa7adfc={'method':_0x66eb('0x36'),'uri':'','headers':{'Authorization':_0x66eb('0x3a')+_0x11ea1f},'json':!![]};switch(_0x12534e[_0x66eb('0x53')]){case _0x66eb('0x54'):_0xa7adfc[_0x66eb('0x55')]=_0x66eb('0x47')+_0x468743+_0x66eb('0x56')+_0x239f58+'))';return getZohoUser(_0xa7adfc,_0x66eb('0x57'))[_0x66eb('0x2d')](function(_0x4ee1ed){if(_0x4ee1ed)return _0x4ee1ed;_0xa7adfc[_0x66eb('0x55')]=_0x66eb('0x47')+_0x468743+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x239f58+'))';return getZohoUser(_0xa7adfc,_0x66eb('0x58'))[_0x66eb('0x2d')](function(_0x3f1923){if(_0x3f1923)return _0x3f1923;if(_0x12534e[_0x66eb('0x4a')]!=_0x66eb('0x59')){return createEndUser(_0x11ea1f,_0x468743,_0x422571,_0x239f58,_0x58adeb,_0x12534e);}else{return{};}});});break;case _0x66eb('0x5a'):_0xa7adfc['uri']='https://www.zohoapis.'+_0x468743+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x239f58+'))';return getZohoUser(_0xa7adfc,_0x66eb('0x57'))['then'](function(_0x3f322d){if(_0x3f322d)return _0x3f322d;if(_0x12534e['moduleCreate']!='nothing'){return createEndUser(_0x11ea1f,_0x468743,_0x422571,_0x239f58,_0x58adeb,_0x12534e);}else{return{};}});break;case _0x66eb('0x5b'):_0xa7adfc[_0x66eb('0x55')]=_0x66eb('0x47')+_0x468743+_0x66eb('0x5c')+_0x239f58+'))';return getZohoUser(_0xa7adfc,_0x66eb('0x58'))['then'](function(_0x49b7db){if(_0x49b7db)return _0x49b7db;if(_0x12534e[_0x66eb('0x4a')]!=_0x66eb('0x59')){return createEndUser(_0x11ea1f,_0x468743,_0x422571,_0x239f58,_0x58adeb,_0x12534e);}else{return{};}});break;}}function getCall(_0x4184fd,_0x4bfc60,_0x189776,_0x355daf,_0xc67043,_0x1941a8,_0x25b410,_0x2e0a96){logger[_0x66eb('0x34')](_0x66eb('0x5d'));var _0x19ee1e={};_0x19ee1e[_0x66eb('0x5e')]={'name':!_[_0x66eb('0x1e')](_0x355daf[_0x66eb('0x4b')][_0x66eb('0x1a')])&&!_['isNil'](_0x355daf['profile'][_0x66eb('0x1a')])&&_0x355daf[_0x66eb('0x41')][_0x66eb('0x1a')]===_0x66eb('0x5f')?_0x355daf[_0x66eb('0x4b')][_0x66eb('0x1a')]:!_[_0x66eb('0x1e')](_0x355daf[_0x66eb('0x4c')])?_0x355daf[_0x66eb('0x4c')]+'\x20'+_0x355daf['last_name']:_0x355daf[_0x66eb('0x4d')],'id':_0x355daf['id']};_0x19ee1e[_0x66eb('0x60')]=intUtil['getString'](_0x1941a8['Subjects'],_0x25b410,'\x20');_0x19ee1e[_0x66eb('0x61')]=intUtil['getString'](_0x1941a8[_0x66eb('0x62')],_0x25b410,'\x0a');if(_0xc67043[_0x66eb('0x46')]===_0x66eb('0x57')){_0x19ee1e[_0x66eb('0x63')]={'name':!_[_0x66eb('0x1e')](_0xc67043[_0x66eb('0x64')])?_0xc67043[_0x66eb('0x64')]:!_[_0x66eb('0x1e')](_0xc67043[_0x66eb('0x65')])?_0xc67043[_0x66eb('0x65')]+'\x20'+_0xc67043[_0x66eb('0x66')]:_0xc67043['Last_Name'],'id':_0xc67043['id']};}if(_0xc67043[_0x66eb('0x46')]===_0x66eb('0x58')){_0x19ee1e[_0x66eb('0x67')]={'name':!_[_0x66eb('0x1e')](_0xc67043['Full_Name'])?_0xc67043[_0x66eb('0x64')]:!_[_0x66eb('0x1e')](_0xc67043['First_Name'])?_0xc67043[_0x66eb('0x65')]+'\x20'+_0xc67043[_0x66eb('0x66')]:_0xc67043[_0x66eb('0x66')],'id':_0xc67043['id']};_0x19ee1e[_0x66eb('0x68')]=_[_0x66eb('0x49')](_0xc67043[_0x66eb('0x46')]);}if(_0x25b410['talktime']){_0x19ee1e[_0x66eb('0x69')]=moment[_0x66eb('0x6a')](parseInt(_0x25b410[_0x66eb('0x6b')])*0x3e8)[_0x66eb('0x37')](_0x66eb('0x6c'));}else if(_0x25b410[_0x66eb('0x6d')]&&_0x25b410['endtime']){_0x19ee1e['Call_Duration']=moment[_0x66eb('0x6a')](moment(_0x25b410[_0x66eb('0x6e')],_0x66eb('0x6f'))[_0x66eb('0x70')](moment(_0x25b410[_0x66eb('0x71')],_0x66eb('0x6f'))))[_0x66eb('0x37')](_0x66eb('0x6c'));}switch(_0x25b410['lastevent']){case'called':_0x19ee1e[_0x66eb('0x72')]='Called';break;case _0x66eb('0x73'):case _0x66eb('0x74'):_0x19ee1e[_0x66eb('0x72')]='Answered';break;case'rejected':_0x19ee1e[_0x66eb('0x72')]=_0x66eb('0x75');break;case _0x66eb('0x76'):_0x19ee1e[_0x66eb('0x72')]=_0x66eb('0x77');break;case _0x66eb('0x78'):_0x19ee1e[_0x66eb('0x72')]=_0x66eb('0x79');default:}_0x19ee1e[_0x66eb('0x7a')]=(_0x2e0a96===_0x66eb('0x7b')?moment(_0x25b410['starttime'])[_0x66eb('0x37')](_0x66eb('0x6f')):moment(_0x25b410[_0x66eb('0x7c')])[_0x66eb('0x37')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x66eb('0x37')](_0x66eb('0x6f'));_0x19ee1e[_0x66eb('0x7d')]=_0x2e0a96||_0x66eb('0x7e');_0x19ee1e=_[_0x66eb('0x7f')](_0x19ee1e,getCustomFields(_0x1941a8['Fields'],_0x25b410));return request({'method':_0x66eb('0x27'),'uri':_0x66eb('0x47')+_0x4bfc60+'/crm/v2/Calls','headers':{'Authorization':_0x66eb('0x3a')+_0x4184fd},'body':{'data':[_0x19ee1e]},'json':!![]})[_0x66eb('0x2d')](function(_0x2e7251){if(_0x2e7251&&_0x2e7251[_0x66eb('0x45')][0x0][_0x66eb('0x4e')]===_0x66eb('0x4f')){logger[_0x66eb('0x34')]('Call\x20created!');return{'id':_0x2e7251[_0x66eb('0x45')][0x0][_0x66eb('0x80')]['id']};}})[_0x66eb('0x31')](function(_0x43a220){logger[_0x66eb('0x34')](_0x66eb('0x81'),_0x43a220[_0x66eb('0x33')]);console[_0x66eb('0x51')](_0x66eb('0x81'),_0x43a220);});}exports[_0x66eb('0x82')]=function(_0x211df2,_0x452610,_0x119bef,_0x3659d2,_0x548c44,_0xa8336d){var _0x9945d0,_0x33a8b9,_0x4292f2;_0xa8336d[_0x66eb('0x83')]=intUtil['stripTrailingSlash'](_0xa8336d['host']);_0xa8336d[_0x66eb('0x84')]=intUtil[_0x66eb('0x85')](_0xa8336d[_0x66eb('0x84')]);if(_0x548c44&&_0x548c44[_0x66eb('0x86')]){logger[_0x66eb('0x34')](_0x66eb('0x87'),'Recording\x20is\x20enabled!');_0x452610[_0x66eb('0x88')]=_0xa8336d[_0x66eb('0x84')]+_0x66eb('0x89')+_0x452610['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x452610[_0x66eb('0x8a')]);}else{_0x452610[_0x66eb('0x88')]='';}var _0x32a4c3=_0xa8336d[_0x66eb('0x83')]==='zoho.eu'?'eu':'com';return getAccessToken(_0xa8336d)['then'](function(_0x70d27d){_0x4292f2=_0x70d27d;return getUser(_0x4292f2,_0x32a4c3,_0xa8336d,_0x3659d2['email']);})[_0x66eb('0x2d')](function(_0x4ebd46){_0x9945d0=_0x4ebd46;logger[_0x66eb('0x34')](_0x66eb('0x8b'),_0x9945d0['id']);return getEndUser(_0x4292f2,_0x32a4c3,_0xa8336d,_0x452610[_0x66eb('0x8c')],_0x452610['calleridnum'],_0x9945d0,_0x119bef);})[_0x66eb('0x2d')](function(_0x515265){_0x33a8b9=_0x515265;return getCall(_0x4292f2,_0x32a4c3,_0xa8336d,_0x9945d0,_0x33a8b9,_0x119bef,_0x452610,'Inbound');})[_0x66eb('0x2d')](function(_0x391838){if(_0x391838){logger[_0x66eb('0x34')]('The\x20Call\x20ID\x20is:',_0x391838['id']);logger[_0x66eb('0x34')]('[QUEUE]',_0x66eb('0x8d'));emit(util[_0x66eb('0x37')](_0x66eb('0x8e'),_0x3659d2['name']),_0x66eb('0x8f'),{'uri':_0x66eb('0x90')+_0xa8336d[_0x66eb('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x391838['id']});}})['catch'](function(_0x5753f9){logger[_0x66eb('0x43')](_0x66eb('0x87'),JSON['stringify'](_0x5753f9));});};exports['outbound']=function(_0x59daf6,_0x53787c,_0x33fde4,_0x217212,_0x9388cc,_0x3e6a35,_0x15ba8f){var _0x3d528d,_0x3acf6e,_0x5f3241;_0x3e6a35[_0x66eb('0x83')]=intUtil[_0x66eb('0x85')](_0x3e6a35[_0x66eb('0x83')]);_0x3e6a35[_0x66eb('0x84')]=intUtil[_0x66eb('0x85')](_0x3e6a35[_0x66eb('0x84')]);if(_0x15ba8f&&_0x15ba8f[_0x66eb('0x91')]&&_0x15ba8f['recordingFormat']!==_0x66eb('0x92')){logger[_0x66eb('0x34')](_0x66eb('0x93'),_0x66eb('0x94'));_0x53787c['recordingURL']=_0x3e6a35[_0x66eb('0x84')]+_0x66eb('0x89')+_0x53787c[_0x66eb('0x8a')]+'/downloads?type=uniqueid&token='+md5(_0x53787c[_0x66eb('0x8a')]);}var _0x56932f=_0x3e6a35['host']===_0x66eb('0x95')?'eu':'com';return getAccessToken(_0x3e6a35)[_0x66eb('0x2d')](function(_0x4ef1a0){_0x5f3241=_0x4ef1a0;return getUser(_0x5f3241,_0x56932f,_0x3e6a35,_0x217212[_0x66eb('0x96')]);})[_0x66eb('0x2d')](function(_0x590cec){_0x3d528d=_0x590cec;logger[_0x66eb('0x34')](_0x66eb('0x8b'),_0x3d528d['id']);return getEndUser(_0x5f3241,_0x56932f,_0x3e6a35,_0x53787c[_0x66eb('0x97')],_0x53787c[_0x66eb('0x98')],_0x3d528d,_0x33fde4);})['then'](function(_0x53d9ab){_0x3acf6e=_0x53d9ab;return getCall(_0x5f3241,_0x56932f,_0x3e6a35,_0x3d528d,_0x3acf6e,_0x33fde4,_0x53787c,_0x66eb('0x99'));})['then'](function(_0x125dfb){if(_0x125dfb){logger[_0x66eb('0x34')](_0x66eb('0x9a'),_0x125dfb['id']);logger[_0x66eb('0x34')](_0x66eb('0x93'),_0x66eb('0x8d'));emit(util['format'](_0x66eb('0x8e'),_0x217212[_0x66eb('0x1a')]),'trigger:browser:url',{'uri':_0x66eb('0x90')+_0x3e6a35[_0x66eb('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x125dfb['id']});}})[_0x66eb('0x31')](function(_0x5b19ee){logger['error'](_0x66eb('0x93'),JSON[_0x66eb('0x42')](_0x5b19ee));});};exports[_0x66eb('0x9b')]=function(_0xad539a,_0x12153a,_0x1b51dc,_0x2673f5,_0x39ddde,_0x3750e9){var _0x9aba05,_0x25cddf,_0x8c7bab;_0x3750e9['host']=intUtil['stripTrailingSlash'](_0x3750e9['host']);_0x3750e9[_0x66eb('0x84')]=intUtil['stripTrailingSlash'](_0x3750e9[_0x66eb('0x84')]);if(_0x39ddde&&_0x39ddde[_0x66eb('0x86')]){logger[_0x66eb('0x34')]('['+_0x12153a['lastevent'][_0x66eb('0x9c')]()+']','Recording\x20is\x20enabled!');_0x12153a[_0x66eb('0x88')]=_0x3750e9['serverUrl']+_0x66eb('0x89')+_0x12153a[_0x66eb('0x8a')]+'/downloads?type=uniqueid&token='+md5(_0x12153a[_0x66eb('0x8a')]);}else{_0x12153a['recordingURL']='';}var _0x4b6af8=_0x3750e9[_0x66eb('0x83')]===_0x66eb('0x95')?'eu':_0x66eb('0x9d');return getAccessToken(_0x3750e9)[_0x66eb('0x2d')](function(_0x3ab4ad){_0x8c7bab=_0x3ab4ad;return getUser(_0x8c7bab,_0x4b6af8,_0x3750e9);})['then'](function(_0xbb9139){_0x9aba05=_0xbb9139;logger[_0x66eb('0x34')]('The\x20User\x20ID\x20is:',_0x9aba05['id']);return getEndUser(_0x8c7bab,_0x4b6af8,_0x3750e9,_0x12153a['calleridname'],_0x12153a[_0x66eb('0x9e')],_0x9aba05,_0x1b51dc);})[_0x66eb('0x2d')](function(_0x39623a){_0x25cddf=_0x39623a;return getCall(_0x8c7bab,_0x4b6af8,_0x3750e9,_0x9aba05,_0x25cddf,_0x1b51dc,_0x12153a,_0x66eb('0x7e'));})['then'](function(_0x68f5c9){if(_0x68f5c9){logger[_0x66eb('0x34')]('The\x20Call\x20ID\x20is:',_0x68f5c9['id']);}})[_0x66eb('0x31')](function(_0x1e26f4){logger['error']('['+_0x12153a[_0x66eb('0x9f')][_0x66eb('0x9c')]()+']',JSON[_0x66eb('0x42')](_0x1e26f4));});}; \ No newline at end of file +var _0x928f=['isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','complete','Answered','rejected','abandoned','Abandoned','timeout','Call_Start_Time','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','queue','stripTrailingSlash','host','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','calleridname','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','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','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users'];(function(_0x46376c,_0x9c88d0){var _0x1477a0=function(_0x4c5ad1){while(--_0x4c5ad1){_0x46376c['push'](_0x46376c['shift']());}};_0x1477a0(++_0x9c88d0);}(_0x928f,0x196));var _0xf928=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x928f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf928('0x0'));var rp=require('request-promise');var md5=require(_0xf928('0x1'));var util=require('util');var intUtil=require(_0xf928('0x2'));var moment=require(_0xf928('0x3'));var Redis=require(_0xf928('0x4'));var BPromise=require(_0xf928('0x5'));var config=require(_0xf928('0x6'));var logger=require(_0xf928('0x7'))(_0xf928('0x8'));config[_0xf928('0x9')]=_[_0xf928('0xa')](config[_0xf928('0x9')],{'host':_0xf928('0xb'),'port':0x18eb});var io=require(_0xf928('0xc'))(new Redis(config[_0xf928('0x9')]));function emit(_0x43cb43,_0x211e1e,_0x1ddc66){io['to'](_0x43cb43)[_0xf928('0xd')](_0x211e1e,_0x1ddc66);}function request(_0x29e635){logger[_0xf928('0xe')](_0xf928('0xf'),JSON[_0xf928('0x10')](_0x29e635));return rp(_0x29e635);}function getCustomFields(_0x41f04a,_0x4f3ebf){var _0x5dc7dc={};if(_0x41f04a[_0xf928('0x11')]>0x0){_['forEach'](_0x41f04a,function(_0xc8ac48){if(_[_0xf928('0x12')]([_0xf928('0x13'),_0xf928('0x14')],_0xc8ac48[_0xf928('0x15')])&&_0xc8ac48[_0xf928('0x16')]){_0x5dc7dc[_0xc8ac48['idField']]=_0xc8ac48[_0xf928('0x17')][_0xf928('0x18')]();}else if(_0xc8ac48[_0xf928('0x15')]===_0xf928('0x19')&&_0xc8ac48['variableName']&&_0xc8ac48[_0xf928('0x16')]&&_0x4f3ebf[_0xc8ac48[_0xf928('0x1a')]]){_0x5dc7dc[_0xc8ac48[_0xf928('0x16')]]=_0x4f3ebf[_0xc8ac48[_0xf928('0x1a')]][_0xf928('0x18')]();}else if(_0xc8ac48[_0xf928('0x15')]===_0xf928('0x1b')&&_0xc8ac48['Variable']&&_0xc8ac48[_0xf928('0x1c')][_0xf928('0x1d')]&&_0xc8ac48['idField']&&_0x4f3ebf[_0xc8ac48[_0xf928('0x1c')][_0xf928('0x1d')][_0xf928('0x1e')]()]){_0x5dc7dc[_0xc8ac48[_0xf928('0x16')]]=_0x4f3ebf[_0xc8ac48['Variable'][_0xf928('0x1d')][_0xf928('0x1e')]()]['toString']();}});}return _0x5dc7dc;}function getName(_0x4b43f0){if(_0x4b43f0[_0xf928('0x1f')]('\x20')>0x0){var _0x25a9f2=_0x4b43f0[_0xf928('0x20')](/ (.+)/);if(_0x25a9f2[0x1]){return _0x25a9f2;}}return[_0x4b43f0,_0x4b43f0];}var accountsTokens={};function getAccessToken(_0x33ebaa){return new Promise(function(_0x506ec4,_0x256567){if(!_[_0xf928('0x21')](accountsTokens[_0x33ebaa['id']])&&!_[_0xf928('0x21')](accountsTokens[_0x33ebaa['id']][_0xf928('0x22')])){if(moment()[_0xf928('0x23')](accountsTokens[_0x33ebaa['id']][_0xf928('0x24')])){_0x506ec4(accountsTokens[_0x33ebaa['id']][_0xf928('0x22')]);}}var _0x5c1c6c;switch(_0x33ebaa[_0xf928('0x25')]){case'US':_0x5c1c6c=_0xf928('0x26');break;case'AU':_0x5c1c6c=_0xf928('0x27');break;case'EU':_0x5c1c6c=_0xf928('0x28');break;case'IN':_0x5c1c6c=_0xf928('0x29');break;case'CN':_0x5c1c6c=_0xf928('0x2a');break;default:_0x5c1c6c='https://accounts.zoho.eu';break;}var _0x26f99e={'method':_0xf928('0x2b'),'uri':_0x5c1c6c+_0xf928('0x2c'),'qs':{'refresh_token':_0x33ebaa[_0xf928('0x2d')],'client_id':_0x33ebaa[_0xf928('0x2e')],'client_secret':_0x33ebaa[_0xf928('0x2f')],'grant_type':_0xf928('0x30')},'json':!![]};return rp(_0x26f99e)['then'](function(_0x1db87e){accountsTokens[_0x33ebaa['id']]={'access_token':_0x1db87e[_0xf928('0x22')],'expires_in':moment()[_0xf928('0x31')](_0x1db87e['expires_in'],_0xf928('0x32'))};_0x506ec4(_0x1db87e['access_token']);})[_0xf928('0x33')](function(_0x14d1a1){logger[_0xf928('0x34')]('Failing\x20creating\x20the\x20access_token',_0x14d1a1[_0xf928('0x35')]);_0x256567(_0x14d1a1);});});}function getUser(_0x2c0621,_0x4171f3,_0x51e612,_0x48f798){logger[_0xf928('0x36')](_0xf928('0x37'));return request({'method':_0xf928('0x38'),'uri':util[_0xf928('0x39')](_0xf928('0x3a'),_0x4171f3),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xf928('0x3b')+_0x2c0621},'json':!![]})[_0xf928('0x3c')](function(_0x340c5f){if(_0x340c5f[_0xf928('0x3d')]){var _0x321b77=-0x1;if(_[_0xf928('0x3e')](_0x340c5f[_0xf928('0x3d')])){if(!_[_0xf928('0x21')](_0x48f798)){_0x321b77=_[_0xf928('0x3f')](_0x340c5f[_0xf928('0x3d')],function(_0x40b8f3){return _0x40b8f3[_0xf928('0x40')]===_0x48f798;});}if(_0x321b77>=0x0){logger[_0xf928('0x36')](_0xf928('0x41'));}else{logger['info'](_0xf928('0x42'));_0x321b77=_['findIndex'](_0x340c5f[_0xf928('0x3d')],function(_0x4459b0){return _0x4459b0['profile'][_0xf928('0x1d')]===_0xf928('0x43');});}return _0x340c5f['users'][_0x321b77];}else{if(_0x340c5f['user'][_0xf928('0x44')]['name']===_0xf928('0x43')){logger[_0xf928('0x36')](_0xf928('0x42'));user=_0x340c5f['user'];return user;}else{logger[_0xf928('0x34')](_0xf928('0x45'),JSON['stringify'](_0x340c5f));throw new Error(_0xf928('0x46')+JSON[_0xf928('0x10')](_0x340c5f));}}}else{logger['error'](_0xf928('0x45'),JSON[_0xf928('0x10')](_0x340c5f));throw new Error(_0xf928('0x46')+JSON[_0xf928('0x10')](_0x340c5f));}})[_0xf928('0x33')](function(_0x29950e){console[_0xf928('0x34')](_0x29950e);});}function getZohoUser(_0x3b119f,_0x54169f){return new BPromise(function(_0x2f03ee,_0x491ad8){request(_0x3b119f)[_0xf928('0x3c')](function(_0x1e5e94){var _0x176084=null;if(_0x1e5e94){_0x176084=_0x1e5e94[_0xf928('0x47')][0x0];_0x176084[_0xf928('0x48')]=_0x54169f;}_0x2f03ee(_0x176084);})['catch'](function(_0x3dd926){_0x491ad8(_0x3dd926);});});}function createEndUser(_0x2ad237,_0x36ff95,_0x4938b1,_0x4d2938,_0x1c7335,_0x5d40bd){var _0x4938b1=getName(_0x4938b1);return request({'method':_0xf928('0x2b'),'uri':_0xf928('0x49')+_0x36ff95+_0xf928('0x4a')+_[_0xf928('0x4b')](_0x5d40bd[_0xf928('0x4c')])+'s','body':{'data':[{'Last_Name':_0x4938b1[0x1],'First_Name':_0x4938b1[0x0],'Phone':_0x4d2938,'Owner':{'name':!_[_0xf928('0x21')](_0x1c7335[_0xf928('0x4d')][_0xf928('0x1d')])?_0x1c7335['role'][_0xf928('0x1d')]:!_[_0xf928('0x21')](_0x1c7335['first_name'])?_0x1c7335[_0xf928('0x4e')]+'\x20'+_0x1c7335[_0xf928('0x4f')]:_0x1c7335[_0xf928('0x4f')],'id':_0x1c7335['id']}}]},'headers':{'Authorization':_0xf928('0x3b')+_0x2ad237},'json':!![]})[_0xf928('0x3c')](function(_0xd0fb49){if(_0xd0fb49&&_0xd0fb49[_0xf928('0x47')][0x0][_0xf928('0x50')]===_0xf928('0x51')){var _0x1ee870=_0xd0fb49[_0xf928('0x47')][0x0][_0xf928('0x52')];_0x1ee870[_0xf928('0x48')]=_['startCase'](_0x5d40bd[_0xf928('0x4c')])+'s';return _0x1ee870;}logger['error'](_0xf928('0x45'),JSON[_0xf928('0x10')](data));throw new Error(_0xf928('0x53')+JSON[_0xf928('0x10')](data));})[_0xf928('0x33')](function(_0x364bb9){console['log'](_0xf928('0x54'),_0x364bb9);});}function getEndUser(_0x760d35,_0x3ea6c8,_0x3e1b71,_0x30af45,_0xdb41fe,_0x2e92b1,_0x3d9aa2){var _0x38b295={'method':_0xf928('0x38'),'uri':'','headers':{'Authorization':_0xf928('0x3b')+_0x760d35},'json':!![]};switch(_0x3d9aa2['moduleSearch']){case _0xf928('0x55'):_0x38b295['uri']=_0xf928('0x49')+_0x3ea6c8+_0xf928('0x56')+_0xdb41fe+'))';return getZohoUser(_0x38b295,_0xf928('0x57'))['then'](function(_0xaf22fb){if(_0xaf22fb)return _0xaf22fb;_0x38b295[_0xf928('0x58')]='https://www.zohoapis.'+_0x3ea6c8+_0xf928('0x59')+_0xdb41fe+'))';return getZohoUser(_0x38b295,_0xf928('0x5a'))['then'](function(_0x33aea7){if(_0x33aea7)return _0x33aea7;if(_0x3d9aa2[_0xf928('0x4c')]!=_0xf928('0x5b')){return createEndUser(_0x760d35,_0x3ea6c8,_0x30af45,_0xdb41fe,_0x2e92b1,_0x3d9aa2);}else{return{};}});});break;case'contact':_0x38b295[_0xf928('0x58')]=_0xf928('0x49')+_0x3ea6c8+_0xf928('0x56')+_0xdb41fe+'))';return getZohoUser(_0x38b295,_0xf928('0x57'))[_0xf928('0x3c')](function(_0x4ed0e4){if(_0x4ed0e4)return _0x4ed0e4;if(_0x3d9aa2[_0xf928('0x4c')]!=_0xf928('0x5b')){return createEndUser(_0x760d35,_0x3ea6c8,_0x30af45,_0xdb41fe,_0x2e92b1,_0x3d9aa2);}else{return{};}});break;case'lead':_0x38b295[_0xf928('0x58')]=_0xf928('0x49')+_0x3ea6c8+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xdb41fe+'))';return getZohoUser(_0x38b295,_0xf928('0x5a'))[_0xf928('0x3c')](function(_0x2613bb){if(_0x2613bb)return _0x2613bb;if(_0x3d9aa2['moduleCreate']!='nothing'){return createEndUser(_0x760d35,_0x3ea6c8,_0x30af45,_0xdb41fe,_0x2e92b1,_0x3d9aa2);}else{return{};}});break;}}function getCall(_0x5ea90a,_0x2a11d7,_0x1b523a,_0x1cad07,_0x525274,_0x2d9c40,_0x129ed4,_0x1fb89f){logger[_0xf928('0x36')]('Creating\x20new\x20call...');var _0x173992={};_0x173992[_0xf928('0x5c')]={'name':!_['isNil'](_0x1cad07[_0xf928('0x4d')][_0xf928('0x1d')])&&!_[_0xf928('0x21')](_0x1cad07[_0xf928('0x44')][_0xf928('0x1d')])&&_0x1cad07['profile'][_0xf928('0x1d')]===_0xf928('0x5d')?_0x1cad07[_0xf928('0x4d')][_0xf928('0x1d')]:!_[_0xf928('0x21')](_0x1cad07[_0xf928('0x4e')])?_0x1cad07[_0xf928('0x4e')]+'\x20'+_0x1cad07['last_name']:_0x1cad07['last_name'],'id':_0x1cad07['id']};_0x173992[_0xf928('0x5e')]=intUtil[_0xf928('0x5f')](_0x2d9c40['Subjects'],_0x129ed4,'\x20');_0x173992[_0xf928('0x60')]=intUtil[_0xf928('0x5f')](_0x2d9c40[_0xf928('0x61')],_0x129ed4,'\x0a');if(_0x525274['enduserType']===_0xf928('0x57')){_0x173992[_0xf928('0x62')]={'name':!_[_0xf928('0x21')](_0x525274[_0xf928('0x63')])?_0x525274['Full_Name']:!_['isNil'](_0x525274['First_Name'])?_0x525274[_0xf928('0x64')]+'\x20'+_0x525274[_0xf928('0x65')]:_0x525274[_0xf928('0x65')],'id':_0x525274['id']};}if(_0x525274['enduserType']===_0xf928('0x5a')){_0x173992[_0xf928('0x66')]={'name':!_[_0xf928('0x21')](_0x525274['Full_Name'])?_0x525274[_0xf928('0x63')]:!_[_0xf928('0x21')](_0x525274[_0xf928('0x64')])?_0x525274[_0xf928('0x64')]+'\x20'+_0x525274[_0xf928('0x65')]:_0x525274[_0xf928('0x65')],'id':_0x525274['id']};_0x173992[_0xf928('0x67')]=_[_0xf928('0x4b')](_0x525274[_0xf928('0x48')]);}if(_0x129ed4[_0xf928('0x68')]){_0x173992[_0xf928('0x69')]=moment[_0xf928('0x6a')](parseInt(_0x129ed4[_0xf928('0x68')])*0x3e8)['format'](_0xf928('0x6b'));}else if(_0x129ed4[_0xf928('0x6c')]&&_0x129ed4[_0xf928('0x6d')]){_0x173992[_0xf928('0x69')]=moment[_0xf928('0x6a')](moment(_0x129ed4[_0xf928('0x6d')],_0xf928('0x6e'))[_0xf928('0x6f')](moment(_0x129ed4[_0xf928('0x70')],'YYYY-MM-DDTHH:mm:ss')))[_0xf928('0x39')]('mm:ss');}switch(_0x129ed4[_0xf928('0x71')]){case'called':_0x173992[_0xf928('0x72')]='Called';break;case _0xf928('0x73'):case'connect':_0x173992[_0xf928('0x72')]=_0xf928('0x74');break;case _0xf928('0x75'):_0x173992['Call_Result']='Rejected';break;case _0xf928('0x76'):_0x173992[_0xf928('0x72')]=_0xf928('0x77');break;case _0xf928('0x78'):_0x173992[_0xf928('0x72')]='Timeout';default:}_0x173992[_0xf928('0x79')]=(_0x1fb89f==='outbound'?moment(_0x129ed4[_0xf928('0x70')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x129ed4['agentcalledAt'])[_0xf928('0x39')](_0xf928('0x6e')))||moment()[_0xf928('0x39')]('YYYY-MM-DDTHH:mm:ss');_0x173992[_0xf928('0x7a')]=_0x1fb89f||_0xf928('0x7b');_0x173992=_[_0xf928('0x7c')](_0x173992,getCustomFields(_0x2d9c40[_0xf928('0x7d')],_0x129ed4));return request({'method':_0xf928('0x2b'),'uri':_0xf928('0x49')+_0x2a11d7+_0xf928('0x7e'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5ea90a},'body':{'data':[_0x173992]},'json':!![]})[_0xf928('0x3c')](function(_0x103a7b){if(_0x103a7b&&_0x103a7b[_0xf928('0x47')][0x0][_0xf928('0x50')]==='SUCCESS'){logger['info']('Call\x20created!');return{'id':_0x103a7b['data'][0x0]['details']['id']};}})[_0xf928('0x33')](function(_0x82150b){logger[_0xf928('0x36')]('err',_0x82150b[_0xf928('0x35')]);console['log']('err',_0x82150b);});}exports[_0xf928('0x7f')]=function(_0x313989,_0x2e69e7,_0x3335ce,_0x489a28,_0x1124ed,_0x541032){var _0x4096be,_0x555efe,_0x382c66;_0x541032['host']=intUtil[_0xf928('0x80')](_0x541032[_0xf928('0x81')]);_0x541032['serverUrl']=intUtil[_0xf928('0x80')](_0x541032[_0xf928('0x82')]);if(_0x1124ed&&_0x1124ed['monitor_format']){logger[_0xf928('0x36')]('[QUEUE]',_0xf928('0x83'));_0x2e69e7[_0xf928('0x84')]=_0x541032[_0xf928('0x82')]+_0xf928('0x85')+_0x2e69e7[_0xf928('0x86')]+_0xf928('0x87')+md5(_0x2e69e7['uniqueid']);}else{_0x2e69e7[_0xf928('0x84')]='';}var _0x3672ec=_0x541032[_0xf928('0x81')]==='zoho.eu'?'eu':_0xf928('0x88');return getAccessToken(_0x541032)[_0xf928('0x3c')](function(_0x204833){_0x382c66=_0x204833;return getUser(_0x382c66,_0x3672ec,_0x541032,_0x489a28['email']);})[_0xf928('0x3c')](function(_0xcbe68a){_0x4096be=_0xcbe68a;logger['info']('The\x20User\x20ID\x20is:',_0x4096be['id']);return getEndUser(_0x382c66,_0x3672ec,_0x541032,_0x2e69e7['calleridname'],_0x2e69e7[_0xf928('0x89')],_0x4096be,_0x3335ce);})[_0xf928('0x3c')](function(_0x41648c){_0x555efe=_0x41648c;return getCall(_0x382c66,_0x3672ec,_0x541032,_0x4096be,_0x555efe,_0x3335ce,_0x2e69e7,_0xf928('0x7b'));})[_0xf928('0x3c')](function(_0x372997){if(_0x372997){logger[_0xf928('0x36')](_0xf928('0x8a'),_0x372997['id']);logger[_0xf928('0x36')](_0xf928('0x8b'),_0xf928('0x8c'));emit(util[_0xf928('0x39')](_0xf928('0x8d'),_0x489a28[_0xf928('0x1d')]),_0xf928('0x8e'),{'uri':_0xf928('0x8f')+_0x541032[_0xf928('0x81')]+_0xf928('0x90')+_0x372997['id']});}})[_0xf928('0x33')](function(_0xb9e5bb){logger[_0xf928('0x34')](_0xf928('0x8b'),JSON[_0xf928('0x10')](_0xb9e5bb));});};exports[_0xf928('0x91')]=function(_0xb15c24,_0x45cc69,_0x1636e3,_0x4f2f4a,_0xe3641a,_0x26ffa2,_0x1842b4){var _0x2b731d,_0x47b3d2,_0x23f565;_0x26ffa2['host']=intUtil[_0xf928('0x80')](_0x26ffa2[_0xf928('0x81')]);_0x26ffa2[_0xf928('0x82')]=intUtil[_0xf928('0x80')](_0x26ffa2[_0xf928('0x82')]);if(_0x1842b4&&_0x1842b4[_0xf928('0x92')]&&_0x1842b4['recordingFormat']!=='none'){logger['info'](_0xf928('0x93'),'Recording\x20is\x20enabled!');_0x45cc69[_0xf928('0x84')]=_0x26ffa2[_0xf928('0x82')]+_0xf928('0x85')+_0x45cc69[_0xf928('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x45cc69[_0xf928('0x86')]);}var _0x186e7b=_0x26ffa2['host']===_0xf928('0x94')?'eu':_0xf928('0x88');return getAccessToken(_0x26ffa2)[_0xf928('0x3c')](function(_0xb4231f){_0x23f565=_0xb4231f;return getUser(_0x23f565,_0x186e7b,_0x26ffa2,_0x4f2f4a[_0xf928('0x40')]);})[_0xf928('0x3c')](function(_0x234a92){_0x2b731d=_0x234a92;logger['info'](_0xf928('0x95'),_0x2b731d['id']);return getEndUser(_0x23f565,_0x186e7b,_0x26ffa2,_0x45cc69[_0xf928('0x96')],_0x45cc69[_0xf928('0x97')],_0x2b731d,_0x1636e3);})[_0xf928('0x3c')](function(_0x2a5c2a){_0x47b3d2=_0x2a5c2a;return getCall(_0x23f565,_0x186e7b,_0x26ffa2,_0x2b731d,_0x47b3d2,_0x1636e3,_0x45cc69,_0xf928('0x98'));})[_0xf928('0x3c')](function(_0x49b50d){if(_0x49b50d){logger[_0xf928('0x36')](_0xf928('0x8a'),_0x49b50d['id']);logger[_0xf928('0x36')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x4f2f4a[_0xf928('0x1d')]),'trigger:browser:url',{'uri':_0xf928('0x8f')+_0x26ffa2['host']+_0xf928('0x90')+_0x49b50d['id']});}})[_0xf928('0x33')](function(_0xfb753b){logger[_0xf928('0x34')](_0xf928('0x93'),JSON['stringify'](_0xfb753b));});};exports[_0xf928('0x99')]=function(_0x2bd50e,_0x49d9ea,_0x2a7b71,_0x24e83e,_0x146962,_0x34e2a0){var _0x2bad7f,_0x2ddccf,_0x26e9c1;_0x34e2a0[_0xf928('0x81')]=intUtil[_0xf928('0x80')](_0x34e2a0['host']);_0x34e2a0[_0xf928('0x82')]=intUtil[_0xf928('0x80')](_0x34e2a0[_0xf928('0x82')]);if(_0x146962&&_0x146962['monitor_format']){logger[_0xf928('0x36')]('['+_0x49d9ea[_0xf928('0x71')][_0xf928('0x9a')]()+']',_0xf928('0x83'));_0x49d9ea[_0xf928('0x84')]=_0x34e2a0[_0xf928('0x82')]+_0xf928('0x85')+_0x49d9ea[_0xf928('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x49d9ea[_0xf928('0x86')]);}else{_0x49d9ea[_0xf928('0x84')]='';}var _0x505221=_0x34e2a0['host']===_0xf928('0x94')?'eu':_0xf928('0x88');return getAccessToken(_0x34e2a0)[_0xf928('0x3c')](function(_0x2ac6f1){_0x26e9c1=_0x2ac6f1;return getUser(_0x26e9c1,_0x505221,_0x34e2a0);})[_0xf928('0x3c')](function(_0x2bce85){_0x2bad7f=_0x2bce85;logger[_0xf928('0x36')](_0xf928('0x95'),_0x2bad7f['id']);return getEndUser(_0x26e9c1,_0x505221,_0x34e2a0,_0x49d9ea[_0xf928('0x9b')],_0x49d9ea[_0xf928('0x89')],_0x2bad7f,_0x2a7b71);})[_0xf928('0x3c')](function(_0x83b7cc){_0x2ddccf=_0x83b7cc;return getCall(_0x26e9c1,_0x505221,_0x34e2a0,_0x2bad7f,_0x2ddccf,_0x2a7b71,_0x49d9ea,_0xf928('0x7b'));})[_0xf928('0x3c')](function(_0x507986){if(_0x507986){logger[_0xf928('0x36')]('The\x20Call\x20ID\x20is:',_0x507986['id']);}})[_0xf928('0x33')](function(_0x47a466){logger['error']('['+_0x49d9ea[_0xf928('0x71')][_0xf928('0x9a')]()+']',JSON[_0xf928('0x10')](_0x47a466));});}; \ 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 ec5d598..338c09a 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 _0xc7dc=['exec','data2','data3','error','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger'];(function(_0x2b35c8,_0x4ce40){var _0x310c65=function(_0x48115f){while(--_0x48115f){_0x2b35c8['push'](_0x2b35c8['shift']());}};_0x310c65(++_0x4ce40);}(_0xc7dc,0x88));var _0xcc7d=function(_0x40c499,_0x38a649){_0x40c499=_0x40c499-0x0;var _0x12a5bc=_0xc7dc[_0x40c499];return _0x12a5bc;};'use strict';var util=require(_0xcc7d('0x0'));var sh=require(_0xcc7d('0x1'));var Mustache=require(_0xcc7d('0x2'));var logger=require('../../../../config/logger')(_0xcc7d('0x3'));exports[_0xcc7d('0x4')]=function(_0x3d7ec8,_0x23d8e9){var _0x4db33b=_0x3d7ec8[_0xcc7d('0x5')]?_0x3d7ec8[_0xcc7d('0x5')]:'Script';var _0x56f6db=_0x3d7ec8[_0xcc7d('0x6')]?Mustache['render'](_0x3d7ec8[_0xcc7d('0x6')],_0x23d8e9):_0x23d8e9;sh[_0xcc7d('0x4')](_0x56f6db,function(_0x267202,_0x1dfd7b,_0x10e814){if(_0x267202!==0x0){logger[_0xcc7d('0x7')](util[_0xcc7d('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x4db33b,_0x56f6db,_0x267202,_0x10e814));}else{logger['info'](util[_0xcc7d('0x8')](_0xcc7d('0x9'),_0x4db33b,_0x56f6db,_0x1dfd7b));}});}; \ No newline at end of file +var _0x28ba=['../../../../config/logger','trigger','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','util','shelljs','mustache'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x28ba,0xb3));var _0xa28b=function(_0x5134fd,_0x491a63){_0x5134fd=_0x5134fd-0x0;var _0x5981cf=_0x28ba[_0x5134fd];return _0x5981cf;};'use strict';var util=require(_0xa28b('0x0'));var sh=require(_0xa28b('0x1'));var Mustache=require(_0xa28b('0x2'));var logger=require(_0xa28b('0x3'))(_0xa28b('0x4'));exports['exec']=function(_0x71e761,_0x1d34db){var _0x132af1=_0x71e761[_0xa28b('0x5')]?_0x71e761[_0xa28b('0x5')]:_0xa28b('0x6');var _0x527f48=_0x71e761[_0xa28b('0x7')]?Mustache[_0xa28b('0x8')](_0x71e761['data3'],_0x1d34db):_0x1d34db;sh['exec'](_0x527f48,function(_0x5b4c64,_0x270567,_0xca173c){if(_0x5b4c64!==0x0){logger[_0xa28b('0x9')](util['format'](_0xa28b('0xa'),_0x132af1,_0x527f48,_0x5b4c64,_0xca173c));}else{logger[_0xa28b('0xb')](util[_0xa28b('0xc')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x132af1,_0x527f48,_0x270567));}});}; \ 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 d896f81..ca29d48 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 _0x3c18=['render','data2','data5','data6','parse','error','stack','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase'];(function(_0x357e1f,_0x1786a9){var _0x331126=function(_0x32b705){while(--_0x32b705){_0x357e1f['push'](_0x357e1f['shift']());}};_0x331126(++_0x1786a9);}(_0x3c18,0xe1));var _0x83c1=function(_0x246b37,_0x47ede5){_0x246b37=_0x246b37-0x0;var _0x5ce2f4=_0x3c18[_0x246b37];return _0x5ce2f4;};'use strict';var rp=require('request-promise');var util=require(_0x83c1('0x0'));var _=require(_0x83c1('0x1'));var Mustache=require(_0x83c1('0x2'));var logger=require(_0x83c1('0x3'))(_0x83c1('0x4'));exports['exec']=function(_0x521c9a,_0x2dac9f){var _0x10fe44,_0x173fed;var _0x30da53={'method':_0x521c9a[_0x83c1('0x5')][_0x83c1('0x6')](),'uri':Mustache[_0x83c1('0x7')](_0x521c9a[_0x83c1('0x8')],_0x2dac9f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x521c9a['data5'])==='number'&&parseInt(_0x521c9a['data5'])>=0x1&&parseInt(_0x521c9a[_0x83c1('0x9')])<=0xa?parseInt(_0x521c9a['data5'])*0x3e8:0x5*0x3e8};try{_0x30da53['headers']=_0x521c9a[_0x83c1('0xa')]?JSON[_0x83c1('0xb')](Mustache[_0x83c1('0x7')](_0x521c9a[_0x83c1('0xa')],_0x2dac9f)):{};}catch(_0x77bca5){logger[_0x83c1('0xc')](_0x77bca5[_0x83c1('0xd')]);}switch(_0x521c9a[_0x83c1('0x5')]['toUpperCase']()){case'GET':case _0x83c1('0xe'):_0x10fe44=null;_0x30da53['qs']=_0x2dac9f;break;case _0x83c1('0xf'):case'PUT':if(_0x521c9a[_0x83c1('0x10')]){try{_0x10fe44=JSON['parse'](Mustache['render'](_0x521c9a[_0x83c1('0x10')],_0x2dac9f));_0x30da53[_0x83c1('0x11')]=_0x10fe44;}catch(_0x4b9350){logger['error'](_0x4b9350[_0x83c1('0xd')]);logger[_0x83c1('0xc')](_0x83c1('0x12'));}}else{_0x10fe44=_0x2dac9f;_0x30da53[_0x83c1('0x11')]=_0x10fe44;}break;}logger[_0x83c1('0x13')](util[_0x83c1('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x521c9a[_0x83c1('0x5')],_0x521c9a[_0x83c1('0x8')],JSON[_0x83c1('0x15')](_0x30da53)));rp(_0x30da53)['then'](function(_0x4238dc){_0x10fe44=!_[_0x83c1('0x16')](_0x10fe44)?_0x83c1('0x17')+_0x10fe44:'';_0x173fed=typeof _0x4238dc[_0x83c1('0x11')]==='object'?JSON['stringify'](_0x4238dc[_0x83c1('0x11')]):_0x4238dc[_0x83c1('0x11')];logger[_0x83c1('0x13')](util[_0x83c1('0x14')](_0x83c1('0x18'),_0x521c9a[_0x83c1('0x5')],_0x521c9a[_0x83c1('0x8')],_0x4238dc['statusCode'],_0x173fed));})['catch'](function(_0x18181d){logger['error'](util['format'](_0x83c1('0x19'),_0x521c9a[_0x83c1('0x5')],_0x521c9a['data2'],_0x18181d[_0x83c1('0x1a')],_0x18181d[_0x83c1('0x1b')],_0x18181d[_0x83c1('0x1c')]));});}; \ No newline at end of file +var _0xe570=['render','data2','data5','number','headers','data6','parse','GET','DELETE','POST','data7','body','error','info','format','then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','../../../../config/logger','trigger','data1','toUpperCase'];(function(_0x539dcb,_0x3c188f){var _0xc7987a=function(_0x534022){while(--_0x534022){_0x539dcb['push'](_0x539dcb['shift']());}};_0xc7987a(++_0x3c188f);}(_0xe570,0x1d6));var _0x0e57=function(_0x8efbff,_0x8be49e){_0x8efbff=_0x8efbff-0x0;var _0x1a9aef=_0xe570[_0x8efbff];return _0x1a9aef;};'use strict';var rp=require(_0x0e57('0x0'));var util=require('util');var _=require(_0x0e57('0x1'));var Mustache=require('mustache');var logger=require(_0x0e57('0x2'))(_0x0e57('0x3'));exports['exec']=function(_0xf38d0,_0x234bff){var _0x1561b7,_0x8502b;var _0x32b8ae={'method':_0xf38d0[_0x0e57('0x4')][_0x0e57('0x5')](),'uri':Mustache[_0x0e57('0x6')](_0xf38d0[_0x0e57('0x7')],_0x234bff),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xf38d0[_0x0e57('0x8')])===_0x0e57('0x9')&&parseInt(_0xf38d0[_0x0e57('0x8')])>=0x1&&parseInt(_0xf38d0[_0x0e57('0x8')])<=0xa?parseInt(_0xf38d0[_0x0e57('0x8')])*0x3e8:0x5*0x3e8};try{_0x32b8ae[_0x0e57('0xa')]=_0xf38d0[_0x0e57('0xb')]?JSON[_0x0e57('0xc')](Mustache[_0x0e57('0x6')](_0xf38d0[_0x0e57('0xb')],_0x234bff)):{};}catch(_0x45dbec){logger['error'](_0x45dbec['stack']);}switch(_0xf38d0[_0x0e57('0x4')]['toUpperCase']()){case _0x0e57('0xd'):case _0x0e57('0xe'):_0x1561b7=null;_0x32b8ae['qs']=_0x234bff;break;case _0x0e57('0xf'):case'PUT':if(_0xf38d0[_0x0e57('0x10')]){try{_0x1561b7=JSON[_0x0e57('0xc')](Mustache[_0x0e57('0x6')](_0xf38d0[_0x0e57('0x10')],_0x234bff));_0x32b8ae[_0x0e57('0x11')]=_0x1561b7;}catch(_0x315dbd){logger['error'](_0x315dbd['stack']);logger[_0x0e57('0x12')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x1561b7=_0x234bff;_0x32b8ae[_0x0e57('0x11')]=_0x1561b7;}break;}logger[_0x0e57('0x13')](util[_0x0e57('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xf38d0[_0x0e57('0x4')],_0xf38d0[_0x0e57('0x7')],JSON['stringify'](_0x32b8ae)));rp(_0x32b8ae)[_0x0e57('0x15')](function(_0x264422){_0x1561b7=!_['isNil'](_0x1561b7)?_0x0e57('0x16')+_0x1561b7:'';_0x8502b=typeof _0x264422[_0x0e57('0x11')]===_0x0e57('0x17')?JSON['stringify'](_0x264422['body']):_0x264422[_0x0e57('0x11')];logger[_0x0e57('0x13')](util[_0x0e57('0x14')](_0x0e57('0x18'),_0xf38d0[_0x0e57('0x4')],_0xf38d0['data2'],_0x264422[_0x0e57('0x19')],_0x8502b));})['catch'](function(_0x3a6f39){logger[_0x0e57('0x12')](util[_0x0e57('0x14')](_0x0e57('0x1a'),_0xf38d0[_0x0e57('0x4')],_0xf38d0[_0x0e57('0x7')],_0x3a6f39[_0x0e57('0x19')],_0x3a6f39[_0x0e57('0x1b')],_0x3a6f39['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index af08235..c29a164 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 _0xe1a4=['jayson/promise','bluebird','../../config/logger','client','http','Request','request','debug','rpc','routing','error','message','result','catch'];(function(_0x74af41,_0x1110f1){var _0x4e9ad7=function(_0x3bf64e){while(--_0x3bf64e){_0x74af41['push'](_0x74af41['shift']());}};_0x4e9ad7(++_0x1110f1);}(_0xe1a4,0x142));var _0x4e1a=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xe1a4[_0x5b561d];return _0x431060;};'use strict';var jayson=require(_0x4e1a('0x0'));var BPromise=require(_0x4e1a('0x1'));var logger=require(_0x4e1a('0x2'))('routing');var client=jayson[_0x4e1a('0x3')][_0x4e1a('0x4')]({'port':0x2329});client[_0x4e1a('0x5')]=function(_0x556a24,_0x18bb97){return new BPromise(function(_0x189b67,_0x7042fb){return client[_0x4e1a('0x6')](_0x556a24,_0x18bb97)['then'](function(_0x1966da){logger[_0x4e1a('0x7')](_0x4e1a('0x8'),_0x4e1a('0x9'),_0x556a24,_0x18bb97,_0x1966da);if(_0x1966da[_0x4e1a('0xa')]){logger[_0x4e1a('0xa')](_0x4e1a('0x8'),'routing',_0x556a24,_0x1966da[_0x4e1a('0xa')][_0x4e1a('0xb')],_0x18bb97);return _0x7042fb(_0x1966da['error'][_0x4e1a('0xb')]);}else{return _0x189b67(_0x1966da[_0x4e1a('0xc')]);}})[_0x4e1a('0xd')](function(_0x48b477){logger[_0x4e1a('0xa')](_0x4e1a('0x8'),_0x4e1a('0x9'),_0x556a24,_0x48b477,_0x18bb97);return _0x7042fb(_0x48b477);});});};module['exports']=client; \ No newline at end of file +var _0x73a8=['debug','rpc','error','routing','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client','request','then'];(function(_0x3fea78,_0x2a1ee1){var _0x3d818d=function(_0x2a93bf){while(--_0x2a93bf){_0x3fea78['push'](_0x3fea78['shift']());}};_0x3d818d(++_0x2a1ee1);}(_0x73a8,0xf6));var _0x873a=function(_0x9dae95,_0x18843d){_0x9dae95=_0x9dae95-0x0;var _0x19b7c6=_0x73a8[_0x9dae95];return _0x19b7c6;};'use strict';var jayson=require(_0x873a('0x0'));var BPromise=require(_0x873a('0x1'));var logger=require(_0x873a('0x2'))('routing');var client=jayson[_0x873a('0x3')]['http']({'port':0x2329});client['Request']=function(_0x1d9312,_0x5ec768){return new BPromise(function(_0xf51117,_0x2a895a){return client[_0x873a('0x4')](_0x1d9312,_0x5ec768)[_0x873a('0x5')](function(_0x4de86f){logger[_0x873a('0x6')](_0x873a('0x7'),'routing',_0x1d9312,_0x5ec768,_0x4de86f);if(_0x4de86f[_0x873a('0x8')]){logger[_0x873a('0x8')](_0x873a('0x7'),_0x873a('0x9'),_0x1d9312,_0x4de86f[_0x873a('0x8')][_0x873a('0xa')],_0x5ec768);return _0x2a895a(_0x4de86f[_0x873a('0x8')][_0x873a('0xa')]);}else{return _0xf51117(_0x4de86f[_0x873a('0xb')]);}})[_0x873a('0xc')](function(_0x4d8411){logger[_0x873a('0x8')](_0x873a('0x7'),_0x873a('0x9'),_0x1d9312,_0x4d8411,_0x5ec768);return _0x2a895a(_0x4d8411);});});};module[_0x873a('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 3bfaa15..680ab5e 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 _0x06c9=['listen','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','refresh','mailAccounts'];(function(_0xa12a87,_0x25728c){var _0x439d61=function(_0x1fbd0c){while(--_0x1fbd0c){_0xa12a87['push'](_0xa12a87['shift']());}};_0x439d61(++_0x25728c);}(_0x06c9,0x131));var _0x906c=function(_0x996657,_0x56c536){_0x996657=_0x996657-0x0;var _0x30be0e=_0x06c9[_0x996657];return _0x30be0e;};'use strict';var server=require('./server');var Realtime=require(_0x906c('0x0'));var EmailChannel=require(_0x906c('0x1'));var mailAccount=require(_0x906c('0x2'));var setting=require(_0x906c('0x3'));var logger=require('../../config/logger')(_0x906c('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x906c('0x5')]()[_0x906c('0x6')](mailAccount[_0x906c('0x7')]())[_0x906c('0x6')](realtime['initMailAccounts']())[_0x906c('0x6')](function(){email[_0x906c('0x8')](realtime[_0x906c('0x9')]);return realtime;});}function main(){return server[_0x906c('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0x906c('0x6')](function(){return setting[_0x906c('0xb')]();})['then'](function(_0x242501){return setInterval(initRealtime,_0x242501[_0x906c('0xc')]*0x3e8);})['catch'](function(_0x4275dd){logger[_0x906c('0xd')](_0x906c('0xe'),_0x4275dd);});}main(); \ No newline at end of file +var _0x4b16=['./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x53b862,_0x36d23e){var _0x183468=function(_0x4957b5){while(--_0x4957b5){_0x53b862['push'](_0x53b862['shift']());}};_0x183468(++_0x36d23e);}(_0x4b16,0xa3));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var server=require(_0x64b1('0x0'));var Realtime=require(_0x64b1('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x64b1('0x2'));var setting=require(_0x64b1('0x3'));var logger=require('../../config/logger')(_0x64b1('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x64b1('0x5')]()[_0x64b1('0x6')](mailAccount[_0x64b1('0x7')]())['then'](realtime['initMailAccounts']())['then'](function(){email[_0x64b1('0x8')](realtime[_0x64b1('0x9')]);return realtime;});}function main(){return server[_0x64b1('0xa')](realtime,email)[_0x64b1('0x6')](function(){return initRealtime();})[_0x64b1('0x6')](function(){return setting[_0x64b1('0xb')]();})['then'](function(_0x259cbd){return setInterval(initRealtime,_0x259cbd[_0x64b1('0xc')]*0x3e8);})['catch'](function(_0x5a2a32){logger[_0x64b1('0xd')](_0x64b1('0xe'),_0x5a2a32);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e56ebb0..67a3660 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 _0xfe74=['redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','smtp','prototype','emit','mailAccounts','name','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','service','provider','custom','imapAccounts','box','bind','end','handleImapEnd','error','disabled','handleImapBox','status','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapError','sendMail','verifySmtp','Smtp','verify','verified','exports','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email'];(function(_0x5c547b,_0x46698b){var _0x2cf95f=function(_0x1d0037){while(--_0x1d0037){_0x5c547b['push'](_0x5c547b['shift']());}};_0x2cf95f(++_0x46698b);}(_0xfe74,0x10d));var _0x4fe7=function(_0x5f3eda,_0x1132bc){_0x5f3eda=_0x5f3eda-0x0;var _0x116747=_0xfe74[_0x5f3eda];return _0x116747;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x4fe7('0x0'));var md5=require(_0x4fe7('0x1'));var Redis=require(_0x4fe7('0x2'));var config=require(_0x4fe7('0x3'));var logger=require(_0x4fe7('0x4'))(_0x4fe7('0x5'));config[_0x4fe7('0x6')]=_[_0x4fe7('0x7')](config[_0x4fe7('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4fe7('0x8'))(new Redis(config[_0x4fe7('0x6')]));var EmailImap=require(_0x4fe7('0x9'));var EmailSmtp=require(_0x4fe7('0xa'));var mailAccount=require(_0x4fe7('0xb'));var md5Accounts={};function EmailChannel(_0x3387fc){logger[_0x4fe7('0xc')](_0x4fe7('0xd'));this['mailAccounts']=_0x3387fc['mailAccounts'];this['imapAccounts']={};this[_0x4fe7('0xe')]=new EmailSmtp();}EmailChannel[_0x4fe7('0xf')][_0x4fe7('0x10')]=function(_0x18be7a){var _0x32f489=this[_0x4fe7('0x11')][_0x18be7a];var _0x5757d1={'id':_0x32f489['id'],'name':_0x32f489[_0x4fe7('0x12')],'key':_0x32f489[_0x4fe7('0x13')],'active':_0x32f489[_0x4fe7('0x14')],'Imap':{'status':_0x32f489[_0x4fe7('0x15')]['status'],'messageStatus':_0x32f489[_0x4fe7('0x15')][_0x4fe7('0x16')],'total':_0x32f489[_0x4fe7('0x15')][_0x4fe7('0x17')]}};if(_[_0x4fe7('0x18')](md5Accounts[_0x18be7a])){md5Accounts[_0x18be7a]={};}var _0x2f2d6c=md5(JSON[_0x4fe7('0x19')](_0x5757d1));if(md5Accounts[_0x18be7a][_0x4fe7('0x1')]!==_0x2f2d6c){md5Accounts[_0x18be7a]['md5']=_0x2f2d6c;io[_0x4fe7('0x10')](_0x4fe7('0x1a'),_0x5757d1);}};EmailChannel['prototype'][_0x4fe7('0x1b')]=function(_0x1c60f7){for(var _0x449d43 in _0x1c60f7){if(_0x1c60f7['hasOwnProperty'](_0x449d43)){if(_0x1c60f7[_0x449d43][_0x4fe7('0x15')]&&_0x1c60f7[_0x449d43][_0x4fe7('0x14')]){var _0x5b7a96=_0x1c60f7[_0x449d43]['Imap'];if(!_0x5b7a96[_0x4fe7('0x1c')]&&_0x1c60f7[_0x449d43][_0x4fe7('0x1d')]!==_0x4fe7('0x1e'))_0x5b7a96['service']=_0x1c60f7[_0x449d43][_0x4fe7('0x1d')];if(!this['imapAccounts']['hasOwnProperty'](_0x5b7a96['id'])){this[_0x4fe7('0x1f')][_0x5b7a96['id']]=new EmailImap(_0x5b7a96,_0x1c60f7[_0x449d43][_0x4fe7('0x5')]);this['imapAccounts'][_0x5b7a96['id']]['on'](_0x4fe7('0x20'),this['handleImapBox'][_0x4fe7('0x21')](this,_0x449d43));this['imapAccounts'][_0x5b7a96['id']]['on'](_0x4fe7('0x5'),this['handleImapEmail'][_0x4fe7('0x21')](this,_0x449d43));this[_0x4fe7('0x1f')][_0x5b7a96['id']]['on'](_0x4fe7('0x22'),this[_0x4fe7('0x23')][_0x4fe7('0x21')](this,_0x449d43));this[_0x4fe7('0x1f')][_0x5b7a96['id']]['on'](_0x4fe7('0x24'),this['handleImapError'][_0x4fe7('0x21')](this,_0x449d43));}}else{if(_[_0x4fe7('0x18')](this[_0x4fe7('0x11')][_0x449d43][_0x4fe7('0x15')])){this[_0x4fe7('0x11')][_0x449d43][_0x4fe7('0x15')]={};}this[_0x4fe7('0x11')][_0x449d43][_0x4fe7('0x15')]['status']=_0x4fe7('0x25');this[_0x4fe7('0x11')][_0x449d43][_0x4fe7('0x15')][_0x4fe7('0x16')]='';this['emit'](_0x449d43);}}}};EmailChannel[_0x4fe7('0xf')][_0x4fe7('0x26')]=function(_0x28b993,_0x5b9305){if(this['mailAccounts'][_0x28b993]){this[_0x4fe7('0x11')][_0x28b993]['Imap'][_0x4fe7('0x27')]='connected';this[_0x4fe7('0x11')][_0x28b993][_0x4fe7('0x15')][_0x4fe7('0x16')]=_0x5b9305[_0x4fe7('0x12')];if(_0x5b9305['messages']){this[_0x4fe7('0x11')][_0x28b993][_0x4fe7('0x15')][_0x4fe7('0x17')]=_0x5b9305[_0x4fe7('0x28')][_0x4fe7('0x17')];}return this[_0x4fe7('0x10')](_0x28b993);}};EmailChannel[_0x4fe7('0xf')]['handleImapEmail']=function(_0x146993,_0xa23ca0){logger[_0x4fe7('0xc')](_0x4fe7('0x29'),_0xa23ca0[_0x4fe7('0x2a')],_0xa23ca0['lastName'],_0xa23ca0['from'],_0x146993);if(this[_0x4fe7('0x11')][_0x146993]){return mailAccount[_0x4fe7('0x2b')](_0x146993,_0xa23ca0)[_0x4fe7('0x2c')](function(_0xdcbae1){if(_0xdcbae1){logger[_0x4fe7('0xc')](_0x4fe7('0x2d'));}})[_0x4fe7('0x2e')](function(_0xccd297){logger[_0x4fe7('0x24')](_0x4fe7('0x2f'),JSON['stringify'](_0xccd297));});}};EmailChannel[_0x4fe7('0xf')]['handleImapEnd']=function(_0xca6bbe){if(this[_0x4fe7('0x11')][_0xca6bbe]&&this['mailAccounts'][_0xca6bbe][_0x4fe7('0x15')]){if(this['imapAccounts'][this['mailAccounts'][_0xca6bbe][_0x4fe7('0x15')]['id']]){delete this[_0x4fe7('0x1f')][this[_0x4fe7('0x11')][_0xca6bbe][_0x4fe7('0x15')]['id']];}this[_0x4fe7('0x11')][_0xca6bbe][_0x4fe7('0x15')]['lastSync']=moment();this[_0x4fe7('0x10')](_0xca6bbe);}};EmailChannel[_0x4fe7('0xf')][_0x4fe7('0x30')]=function(_0x28cfba,_0x43b4c3){if(this[_0x4fe7('0x11')][_0x28cfba]){this[_0x4fe7('0x11')][_0x28cfba]['Imap']['status']='error';this[_0x4fe7('0x11')][_0x28cfba][_0x4fe7('0x15')]['messageStatus']=_0x43b4c3;return this[_0x4fe7('0x10')](_0x28cfba);}};EmailChannel[_0x4fe7('0xf')][_0x4fe7('0x31')]=function(_0x34cba2,_0x3c6123){return this['smtp']['send'](_0x34cba2,_0x3c6123);};EmailChannel['prototype'][_0x4fe7('0x32')]=function(_0x57426d){var _0x48283c=this;if(this[_0x4fe7('0x11')][_0x57426d['id']]){if(_[_0x4fe7('0x18')](this[_0x4fe7('0x11')][_0x57426d['id']][_0x4fe7('0x33')])){this[_0x4fe7('0x11')][_0x57426d['id']][_0x4fe7('0x33')]={};}this['mailAccounts'][_0x57426d['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x4a5af6,_0x32db2b){return _0x48283c[_0x4fe7('0xe')][_0x4fe7('0x34')](_0x57426d)[_0x4fe7('0x2c')](function(_0x47ce1b){_0x48283c[_0x4fe7('0x11')][_0x57426d['id']][_0x4fe7('0x33')][_0x4fe7('0x27')]=_0x4fe7('0x35');_0x48283c[_0x4fe7('0x11')][_0x57426d['id']][_0x4fe7('0x33')]['messageStatus']='';_0x48283c[_0x4fe7('0x10')](_0x57426d['id']);_0x4a5af6(_0x47ce1b);})[_0x4fe7('0x2e')](function(_0x398f69){_0x48283c[_0x4fe7('0x11')][_0x57426d['id']][_0x4fe7('0x33')][_0x4fe7('0x27')]=_0x4fe7('0x24');_0x48283c[_0x4fe7('0x11')][_0x57426d['id']][_0x4fe7('0x33')][_0x4fe7('0x16')]=_0x398f69;_0x48283c[_0x4fe7('0x10')](_0x57426d['id']);_0x32db2b(_0x398f69);});});}return this['smtp'][_0x4fe7('0x34')](_0x57426d);};module[_0x4fe7('0x36')]=EmailChannel; \ No newline at end of file +var _0x4ec8=['firstName','lastName','from','lastSync','sendMail','send','Smtp','then','catch','verify','exports','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','custom','provider','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s'];(function(_0x174902,_0x5f25b8){var _0x4b9e31=function(_0x2e0b58){while(--_0x2e0b58){_0x174902['push'](_0x174902['shift']());}};_0x4b9e31(++_0x5f25b8);}(_0x4ec8,0x1df));var _0x84ec=function(_0x15c8bf,_0x3f3c50){_0x15c8bf=_0x15c8bf-0x0;var _0x72f98c=_0x4ec8[_0x15c8bf];return _0x72f98c;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x84ec('0x0'));var md5=require(_0x84ec('0x1'));var Redis=require(_0x84ec('0x2'));var config=require('../../../config/environment');var logger=require(_0x84ec('0x3'))(_0x84ec('0x4'));config[_0x84ec('0x5')]=_[_0x84ec('0x6')](config[_0x84ec('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x84ec('0x7'))(new Redis(config[_0x84ec('0x5')]));var EmailImap=require(_0x84ec('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x22d23c){logger[_0x84ec('0x9')](_0x84ec('0xa'));this[_0x84ec('0xb')]=_0x22d23c['mailAccounts'];this[_0x84ec('0xc')]={};this[_0x84ec('0xd')]=new EmailSmtp();}EmailChannel[_0x84ec('0xe')][_0x84ec('0xf')]=function(_0x347d9e){var _0x16dddb=this['mailAccounts'][_0x347d9e];var _0x2a6911={'id':_0x16dddb['id'],'name':_0x16dddb[_0x84ec('0x10')],'key':_0x16dddb[_0x84ec('0x11')],'active':_0x16dddb[_0x84ec('0x12')],'Imap':{'status':_0x16dddb[_0x84ec('0x13')][_0x84ec('0x14')],'messageStatus':_0x16dddb['Imap'][_0x84ec('0x15')],'total':_0x16dddb[_0x84ec('0x13')][_0x84ec('0x16')]}};if(_[_0x84ec('0x17')](md5Accounts[_0x347d9e])){md5Accounts[_0x347d9e]={};}var _0x1d1aee=md5(JSON[_0x84ec('0x18')](_0x2a6911));if(md5Accounts[_0x347d9e]['md5']!==_0x1d1aee){md5Accounts[_0x347d9e][_0x84ec('0x1')]=_0x1d1aee;io[_0x84ec('0xf')](_0x84ec('0x19'),_0x2a6911);}};EmailChannel['prototype'][_0x84ec('0x1a')]=function(_0x18c6cc){for(var _0x299a84 in _0x18c6cc){if(_0x18c6cc['hasOwnProperty'](_0x299a84)){if(_0x18c6cc[_0x299a84]['Imap']&&_0x18c6cc[_0x299a84][_0x84ec('0x12')]){var _0x106e5f=_0x18c6cc[_0x299a84][_0x84ec('0x13')];if(!_0x106e5f['service']&&_0x18c6cc[_0x299a84]['provider']!==_0x84ec('0x1b'))_0x106e5f['service']=_0x18c6cc[_0x299a84][_0x84ec('0x1c')];if(!this[_0x84ec('0xc')][_0x84ec('0x1d')](_0x106e5f['id'])){this['imapAccounts'][_0x106e5f['id']]=new EmailImap(_0x106e5f,_0x18c6cc[_0x299a84][_0x84ec('0x4')]);this[_0x84ec('0xc')][_0x106e5f['id']]['on'](_0x84ec('0x1e'),this['handleImapBox'][_0x84ec('0x1f')](this,_0x299a84));this[_0x84ec('0xc')][_0x106e5f['id']]['on'](_0x84ec('0x4'),this[_0x84ec('0x20')]['bind'](this,_0x299a84));this[_0x84ec('0xc')][_0x106e5f['id']]['on'](_0x84ec('0x21'),this[_0x84ec('0x22')][_0x84ec('0x1f')](this,_0x299a84));this[_0x84ec('0xc')][_0x106e5f['id']]['on'](_0x84ec('0x23'),this[_0x84ec('0x24')]['bind'](this,_0x299a84));}}else{if(_[_0x84ec('0x17')](this['mailAccounts'][_0x299a84][_0x84ec('0x13')])){this['mailAccounts'][_0x299a84][_0x84ec('0x13')]={};}this[_0x84ec('0xb')][_0x299a84][_0x84ec('0x13')][_0x84ec('0x14')]=_0x84ec('0x25');this[_0x84ec('0xb')][_0x299a84][_0x84ec('0x13')][_0x84ec('0x15')]='';this[_0x84ec('0xf')](_0x299a84);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x37b5ba,_0x42f905){if(this[_0x84ec('0xb')][_0x37b5ba]){this[_0x84ec('0xb')][_0x37b5ba][_0x84ec('0x13')][_0x84ec('0x14')]=_0x84ec('0x26');this[_0x84ec('0xb')][_0x37b5ba][_0x84ec('0x13')][_0x84ec('0x15')]=_0x42f905[_0x84ec('0x10')];if(_0x42f905[_0x84ec('0x27')]){this[_0x84ec('0xb')][_0x37b5ba][_0x84ec('0x13')][_0x84ec('0x16')]=_0x42f905[_0x84ec('0x27')][_0x84ec('0x16')];}return this[_0x84ec('0xf')](_0x37b5ba);}};EmailChannel[_0x84ec('0xe')]['handleImapEmail']=function(_0x2d7eeb,_0xffb46c){logger[_0x84ec('0x9')](_0x84ec('0x28'),_0xffb46c[_0x84ec('0x29')],_0xffb46c[_0x84ec('0x2a')],_0xffb46c[_0x84ec('0x2b')],_0x2d7eeb);if(this[_0x84ec('0xb')][_0x2d7eeb]){return mailAccount['notify'](_0x2d7eeb,_0xffb46c)['then'](function(_0x27cf35){if(_0x27cf35){logger['info']('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x4e91fc){logger[_0x84ec('0x23')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x84ec('0x18')](_0x4e91fc));});}};EmailChannel[_0x84ec('0xe')][_0x84ec('0x22')]=function(_0x304090){if(this[_0x84ec('0xb')][_0x304090]&&this[_0x84ec('0xb')][_0x304090][_0x84ec('0x13')]){if(this[_0x84ec('0xc')][this[_0x84ec('0xb')][_0x304090][_0x84ec('0x13')]['id']]){delete this[_0x84ec('0xc')][this['mailAccounts'][_0x304090]['Imap']['id']];}this['mailAccounts'][_0x304090][_0x84ec('0x13')][_0x84ec('0x2c')]=moment();this[_0x84ec('0xf')](_0x304090);}};EmailChannel[_0x84ec('0xe')][_0x84ec('0x24')]=function(_0x5d91a6,_0x379c6c){if(this[_0x84ec('0xb')][_0x5d91a6]){this[_0x84ec('0xb')][_0x5d91a6]['Imap'][_0x84ec('0x14')]=_0x84ec('0x23');this[_0x84ec('0xb')][_0x5d91a6][_0x84ec('0x13')][_0x84ec('0x15')]=_0x379c6c;return this[_0x84ec('0xf')](_0x5d91a6);}};EmailChannel[_0x84ec('0xe')][_0x84ec('0x2d')]=function(_0x516565,_0x54702b){return this[_0x84ec('0xd')][_0x84ec('0x2e')](_0x516565,_0x54702b);};EmailChannel['prototype']['verifySmtp']=function(_0x535ddc){var _0x47b9e7=this;if(this['mailAccounts'][_0x535ddc['id']]){if(_[_0x84ec('0x17')](this[_0x84ec('0xb')][_0x535ddc['id']][_0x84ec('0x2f')])){this[_0x84ec('0xb')][_0x535ddc['id']][_0x84ec('0x2f')]={};}this['mailAccounts'][_0x535ddc['id']][_0x84ec('0x2f')][_0x84ec('0x2c')]=moment();return new BPromise(function(_0x1fd701,_0x558a5d){return _0x47b9e7[_0x84ec('0xd')]['verify'](_0x535ddc)[_0x84ec('0x30')](function(_0x1a81df){_0x47b9e7['mailAccounts'][_0x535ddc['id']][_0x84ec('0x2f')][_0x84ec('0x14')]='verified';_0x47b9e7['mailAccounts'][_0x535ddc['id']]['Smtp'][_0x84ec('0x15')]='';_0x47b9e7[_0x84ec('0xf')](_0x535ddc['id']);_0x1fd701(_0x1a81df);})[_0x84ec('0x31')](function(_0x35cf62){_0x47b9e7[_0x84ec('0xb')][_0x535ddc['id']][_0x84ec('0x2f')]['status']='error';_0x47b9e7[_0x84ec('0xb')][_0x535ddc['id']][_0x84ec('0x2f')][_0x84ec('0x15')]=_0x35cf62;_0x47b9e7[_0x84ec('0xf')](_0x535ddc['id']);_0x558a5d(_0x35cf62);});});}return this['smtp'][_0x84ec('0x32')](_0x535ddc);};module[_0x84ec('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b0c80e3..5d3930e 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 _0xfc46=['data5','password','authentication','host','port','tls','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','account','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2'];(function(_0x3282c6,_0x319ea1){var _0x3a2a4e=function(_0x356edd){while(--_0x356edd){_0x3282c6['push'](_0x3282c6['shift']());}};_0x3a2a4e(++_0x319ea1);}(_0xfc46,0x9a));var _0x6fc4=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0xfc46[_0x5a99db];return _0x3aad62;};'use strict';var _=require(_0x6fc4('0x0'));var util=require('util');var Imap=require(_0x6fc4('0x1'));var simpleParser=require(_0x6fc4('0x2'))[_0x6fc4('0x3')];var Iconv=require('iconv')[_0x6fc4('0x4')];var EventEmitter=require(_0x6fc4('0x5'))[_0x6fc4('0x6')];var utils=require(_0x6fc4('0x7'));var logger=require('../../../config/logger')(_0x6fc4('0x8'));function EmailImap(_0xf57aa9,_0x3100a0){this[_0x6fc4('0x9')]=_0x6fc4('0xa');this[_0x6fc4('0xb')]=this['getAccount'](_0xf57aa9,_0x3100a0);this[_0x6fc4('0x1')]=new Imap(this['account']);this[_0x6fc4('0x1')][_0x6fc4('0xc')]('ready',this[_0x6fc4('0xd')][_0x6fc4('0xe')](this));this[_0x6fc4('0x1')][_0x6fc4('0xc')](_0x6fc4('0xf'),this[_0x6fc4('0x10')][_0x6fc4('0xe')](this));this[_0x6fc4('0x1')]['on'](_0x6fc4('0x11'),this[_0x6fc4('0x12')][_0x6fc4('0xe')](this));this[_0x6fc4('0x1')][_0x6fc4('0x13')]();}util[_0x6fc4('0x14')](EmailImap,EventEmitter);EmailImap[_0x6fc4('0x15')][_0x6fc4('0x16')]=function(_0xcd9d73,_0x519c52){var _0x56383b={'connTimeout':_0xcd9d73[_0x6fc4('0x17')]?_0xcd9d73[_0x6fc4('0x17')]*0x3e8:0x2710,'authTimeout':_0xcd9d73[_0x6fc4('0x18')]?_0xcd9d73[_0x6fc4('0x18')]*0x3e8:0x1388};if(_0xcd9d73[_0x6fc4('0x19')]){_0x56383b[_0x6fc4('0x1a')]=_0xcd9d73[_0x6fc4('0x1a')];_0x56383b[_0x6fc4('0x8')]=_0x519c52||_0xcd9d73[_0x6fc4('0x1a')]||'anonymous@xcally.com';if(_0xcd9d73[_0x6fc4('0x1b')]){_0x56383b[_0x6fc4('0x1c')]=utils['generateXOAuth2Token'](_0xcd9d73['CloudProvider'][_0x6fc4('0x1d')],_0xcd9d73[_0x6fc4('0x1a')]);}else{_0x56383b['password']=_0xcd9d73[_0x6fc4('0x1e')];}}else{if(_0xcd9d73[_0x6fc4('0x1f')]){_0x56383b[_0x6fc4('0x1a')]=_0xcd9d73['user'];_0x56383b[_0x6fc4('0x1e')]=_0xcd9d73[_0x6fc4('0x1e')];}}_0x56383b[_0x6fc4('0x20')]=_0xcd9d73['host'];_0x56383b[_0x6fc4('0x21')]=_0xcd9d73[_0x6fc4('0x21')]||0x3e1;if(_0xcd9d73['tls']){_0x56383b['tls']=!![];}else{_0x56383b[_0x6fc4('0x22')]=![];_0x56383b['autotls']='required';}return _0x56383b;};EmailImap['prototype'][_0x6fc4('0xd')]=function(){this[_0x6fc4('0x1')][_0x6fc4('0x23')](this['mailbox'],![],this[_0x6fc4('0x24')][_0x6fc4('0xe')](this));};EmailImap['prototype'][_0x6fc4('0x24')]=function(_0x1e93d2,_0x2b9811){if(_0x1e93d2){this[_0x6fc4('0x12')](_0x1e93d2,!![]);}else{this[_0x6fc4('0x25')](_0x6fc4('0x26'),_0x2b9811);this[_0x6fc4('0x27')]();}};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x28')]=function(_0x308c46){if(_0x308c46){this[_0x6fc4('0x12')](_0x308c46,!![]);}else{this[_0x6fc4('0x1')][_0x6fc4('0xf')]();}};EmailImap['prototype'][_0x6fc4('0x27')]=function(){this[_0x6fc4('0x1')][_0x6fc4('0x29')]([_0x6fc4('0x2a')],this[_0x6fc4('0x2b')][_0x6fc4('0xe')](this));};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x2b')]=function(_0x3816b5,_0x264918){if(_0x3816b5){this[_0x6fc4('0x12')](_0x3816b5,!![]);}else{if(_0x264918[_0x6fc4('0x2c')]){try{var _0x5d9b7c=this[_0x6fc4('0x1')]['fetch'](_0x264918,{'bodies':'','markSeen':!![]});_0x5d9b7c['on']('message',this[_0x6fc4('0x2d')][_0x6fc4('0xe')](this));_0x5d9b7c[_0x6fc4('0xc')](_0x6fc4('0x11'),this[_0x6fc4('0x2e')][_0x6fc4('0xe')](this));_0x5d9b7c['once'](_0x6fc4('0xf'),this[_0x6fc4('0x2f')][_0x6fc4('0xe')](this));}catch(_0x2efc7d){logger[_0x6fc4('0x11')](_0x2efc7d);}}else{this[_0x6fc4('0x1')][_0x6fc4('0x30')](!![],this[_0x6fc4('0x28')]['bind'](this));}}};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x2d')]=function(_0x288420){_0x288420['on'](_0x6fc4('0x31'),this[_0x6fc4('0x32')][_0x6fc4('0xe')](this));_0x288420[_0x6fc4('0xc')](_0x6fc4('0x33'),this[_0x6fc4('0x34')]['bind'](this));_0x288420['once'](_0x6fc4('0xf'),this[_0x6fc4('0x35')][_0x6fc4('0xe')](this));};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x32')]=function(_0x2c4000){simpleParser(_0x2c4000,{'Iconv':Iconv},this['handleSimpleParser'][_0x6fc4('0xe')](this));};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x34')]=function(){};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x35')]=function(){};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x36')]=function(_0x20c009,_0x3f0096){if(_0x20c009){logger[_0x6fc4('0x11')](_0x20c009);}else{var _0xebe06e=this;utils[_0x6fc4('0x37')](this[_0x6fc4('0xb')],_0x3f0096,function(_0xea500e){_0xebe06e['emit'](_0x6fc4('0x8'),_0xea500e);});}};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x2f')]=function(){this['imap'][_0x6fc4('0x30')](!![],this[_0x6fc4('0x28')][_0x6fc4('0xe')](this));};EmailImap[_0x6fc4('0x15')][_0x6fc4('0x2e')]=function(_0x1aed89){this[_0x6fc4('0x12')](_0x1aed89);this[_0x6fc4('0x1')][_0x6fc4('0x30')](!![],this[_0x6fc4('0x28')][_0x6fc4('0xe')](this));};EmailImap[_0x6fc4('0x15')]['handleEnd']=function(){this[_0x6fc4('0x25')](_0x6fc4('0xf'));};EmailImap[_0x6fc4('0x15')]['handleError']=function(_0xcf729c,_0x2c8cc4){logger[_0x6fc4('0x11')]('handleError',this['account'][_0x6fc4('0x8')],JSON[_0x6fc4('0x38')](_0xcf729c));var _0x211e0b='';if(_0xcf729c){if(_0xcf729c['textCode']){_0x211e0b=_0xcf729c[_0x6fc4('0x39')];}else{for(var _0x3d80d9 in _0xcf729c){if(_0xcf729c[_0x6fc4('0x3a')](_0x3d80d9)){_0x211e0b+=_[_0x6fc4('0x3b')](_0x3d80d9)+':\x20'+_0xcf729c[_0x3d80d9]+'\x0a';}}}}if(_0x2c8cc4){this[_0x6fc4('0x1')][_0x6fc4('0xf')]();}else{this[_0x6fc4('0x25')](_0x6fc4('0x11'),_0x211e0b);this[_0x6fc4('0x25')]('end');}};module[_0x6fc4('0x3c')]=EmailImap; \ No newline at end of file +var _0x3e24=['handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleMessageAttributes','parser','account','stringify','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','once','handleReady','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen'];(function(_0x509f3f,_0x14bdc5){var _0x59a37e=function(_0x287463){while(--_0x287463){_0x509f3f['push'](_0x509f3f['shift']());}};_0x59a37e(++_0x14bdc5);}(_0x3e24,0x167));var _0x43e2=function(_0x53dc8a,_0x35549d){_0x53dc8a=_0x53dc8a-0x0;var _0x145ca7=_0x3e24[_0x53dc8a];return _0x145ca7;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var Imap=require(_0x43e2('0x2'));var simpleParser=require(_0x43e2('0x3'))[_0x43e2('0x4')];var Iconv=require('iconv')[_0x43e2('0x5')];var EventEmitter=require(_0x43e2('0x6'))['EventEmitter'];var utils=require(_0x43e2('0x7'));var logger=require(_0x43e2('0x8'))(_0x43e2('0x9'));function EmailImap(_0x28b144,_0x43b5a7){this[_0x43e2('0xa')]=_0x43e2('0xb');this['account']=this[_0x43e2('0xc')](_0x28b144,_0x43b5a7);this[_0x43e2('0x2')]=new Imap(this['account']);this[_0x43e2('0x2')][_0x43e2('0xd')]('ready',this[_0x43e2('0xe')][_0x43e2('0xf')](this));this['imap'][_0x43e2('0xd')]('end',this['handleEnd']['bind'](this));this[_0x43e2('0x2')]['on'](_0x43e2('0x10'),this[_0x43e2('0x11')][_0x43e2('0xf')](this));this[_0x43e2('0x2')][_0x43e2('0x12')]();}util[_0x43e2('0x13')](EmailImap,EventEmitter);EmailImap[_0x43e2('0x14')][_0x43e2('0xc')]=function(_0x218ae7,_0x377097){var _0x3ccccd={'connTimeout':_0x218ae7['connTimeout']?_0x218ae7[_0x43e2('0x15')]*0x3e8:0x2710,'authTimeout':_0x218ae7[_0x43e2('0x16')]?_0x218ae7[_0x43e2('0x16')]*0x3e8:0x1388};if(_0x218ae7[_0x43e2('0x17')]){_0x3ccccd['user']=_0x218ae7['user'];_0x3ccccd[_0x43e2('0x9')]=_0x377097||_0x218ae7[_0x43e2('0x18')]||_0x43e2('0x19');if(_0x218ae7[_0x43e2('0x1a')]){_0x3ccccd[_0x43e2('0x1b')]=utils[_0x43e2('0x1c')](_0x218ae7[_0x43e2('0x1d')][_0x43e2('0x1e')],_0x218ae7[_0x43e2('0x18')]);}else{_0x3ccccd[_0x43e2('0x1f')]=_0x218ae7['password'];}}else{if(_0x218ae7[_0x43e2('0x20')]){_0x3ccccd[_0x43e2('0x18')]=_0x218ae7['user'];_0x3ccccd[_0x43e2('0x1f')]=_0x218ae7['password'];}}_0x3ccccd[_0x43e2('0x21')]=_0x218ae7[_0x43e2('0x21')];_0x3ccccd[_0x43e2('0x22')]=_0x218ae7[_0x43e2('0x22')]||0x3e1;if(_0x218ae7[_0x43e2('0x23')]){_0x3ccccd['tls']=!![];}else{_0x3ccccd[_0x43e2('0x23')]=![];_0x3ccccd[_0x43e2('0x24')]=_0x43e2('0x25');}return _0x3ccccd;};EmailImap['prototype'][_0x43e2('0xe')]=function(){this[_0x43e2('0x2')][_0x43e2('0x26')](this[_0x43e2('0xa')],![],this['handleOpenBox'][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x27')]=function(_0x3b7b22,_0x178223){if(_0x3b7b22){this[_0x43e2('0x11')](_0x3b7b22,!![]);}else{this[_0x43e2('0x28')](_0x43e2('0x29'),_0x178223);this[_0x43e2('0x2a')]();}};EmailImap[_0x43e2('0x14')][_0x43e2('0x2b')]=function(_0x1de7e1){if(_0x1de7e1){this['handleError'](_0x1de7e1,!![]);}else{this[_0x43e2('0x2')][_0x43e2('0x2c')]();}};EmailImap['prototype'][_0x43e2('0x2a')]=function(){this[_0x43e2('0x2')][_0x43e2('0x2d')]([_0x43e2('0x2e')],this[_0x43e2('0x2f')]['bind'](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x2f')]=function(_0x1779f9,_0x3d8e16){if(_0x1779f9){this[_0x43e2('0x11')](_0x1779f9,!![]);}else{if(_0x3d8e16[_0x43e2('0x30')]){try{var _0x53f797=this['imap'][_0x43e2('0x31')](_0x3d8e16,{'bodies':'','markSeen':!![]});_0x53f797['on'](_0x43e2('0x32'),this[_0x43e2('0x33')][_0x43e2('0xf')](this));_0x53f797[_0x43e2('0xd')]('error',this[_0x43e2('0x34')][_0x43e2('0xf')](this));_0x53f797[_0x43e2('0xd')](_0x43e2('0x2c'),this[_0x43e2('0x35')][_0x43e2('0xf')](this));}catch(_0x2fcdd4){logger['error'](_0x2fcdd4);}}else{this['imap'][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')]['bind'](this));}}};EmailImap[_0x43e2('0x14')][_0x43e2('0x33')]=function(_0x4e79ed){_0x4e79ed['on'](_0x43e2('0x37'),this['handleMessageBody']['bind'](this));_0x4e79ed['once'](_0x43e2('0x38'),this['handleMessageAttributes'][_0x43e2('0xf')](this));_0x4e79ed[_0x43e2('0xd')](_0x43e2('0x2c'),this[_0x43e2('0x39')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x3a')]=function(_0x13be86){simpleParser(_0x13be86,{'Iconv':Iconv},this[_0x43e2('0x3b')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x3c')]=function(){};EmailImap[_0x43e2('0x14')][_0x43e2('0x39')]=function(){};EmailImap[_0x43e2('0x14')][_0x43e2('0x3b')]=function(_0x16fac0,_0x47f74c){if(_0x16fac0){logger['error'](_0x16fac0);}else{var _0x4c3f7d=this;utils[_0x43e2('0x3d')](this[_0x43e2('0x3e')],_0x47f74c,function(_0x490f4d){_0x4c3f7d['emit'](_0x43e2('0x9'),_0x490f4d);});}};EmailImap[_0x43e2('0x14')][_0x43e2('0x35')]=function(){this[_0x43e2('0x2')][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x34')]=function(_0x39bf87){this[_0x43e2('0x11')](_0x39bf87);this[_0x43e2('0x2')][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')]['bind'](this));};EmailImap[_0x43e2('0x14')]['handleEnd']=function(){this[_0x43e2('0x28')]('end');};EmailImap[_0x43e2('0x14')][_0x43e2('0x11')]=function(_0x273323,_0x4918bc){logger[_0x43e2('0x10')]('handleError',this[_0x43e2('0x3e')][_0x43e2('0x9')],JSON[_0x43e2('0x3f')](_0x273323));var _0x169a61='';if(_0x273323){if(_0x273323['textCode']){_0x169a61=_0x273323['textCode'];}else{for(var _0x95b22f in _0x273323){if(_0x273323[_0x43e2('0x40')](_0x95b22f)){_0x169a61+=_[_0x43e2('0x41')](_0x95b22f)+':\x20'+_0x273323[_0x95b22f]+'\x0a';}}}}if(_0x4918bc){this[_0x43e2('0x2')]['end']();}else{this[_0x43e2('0x28')](_0x43e2('0x10'),_0x169a61);this[_0x43e2('0x28')](_0x43e2('0x2c'));}};module[_0x43e2('0x42')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d92b9e1..0d6a907 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 _0xb78a=['compile','sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','use'];(function(_0x571fd6,_0x5223fc){var _0x4d6af6=function(_0xfc2c26){while(--_0xfc2c26){_0x571fd6['push'](_0x571fd6['shift']());}};_0x4d6af6(++_0x5223fc);}(_0xb78a,0x1b7));var _0xab78=function(_0x5b4615,_0x3fad71){_0x5b4615=_0x5b4615-0x0;var _0x44eb78=_0xb78a[_0x5b4615];return _0x44eb78;};'use strict';var nodemailer=require(_0xab78('0x0'));var inlineBase64=require(_0xab78('0x1'));function EmailSmtp(){}EmailSmtp[_0xab78('0x2')][_0xab78('0x3')]=function(_0x35bf6c,_0x1c6d63){return new Promise(function(_0x21768c,_0x54f9f5){var _0x3f7034=nodemailer['createTransport'](_0x35bf6c);_0x3f7034[_0xab78('0x4')](_0xab78('0x5'),inlineBase64());_0x3f7034[_0xab78('0x6')](_0x1c6d63,function(_0x248597,_0x154f84){if(_0x248597){_0x54f9f5(_0x248597[_0xab78('0x7')]());}else{_0x21768c(_0x154f84);}});});};EmailSmtp[_0xab78('0x2')]['verify']=function(_0x23eede){return new Promise(function(_0x2ebe11,_0x41c1b4){var _0x58861e=nodemailer[_0xab78('0x8')](_0x23eede);_0x58861e[_0xab78('0x9')](function(_0x303549,_0x1ddf3c){if(_0x303549){_0x41c1b4(_0x303549[_0xab78('0x7')]());}else{if(_0x1ddf3c){_0x2ebe11(_0x1ddf3c);}else{_0x41c1b4(_0xab78('0xa'));}}});});};module[_0xab78('0xb')]=EmailSmtp; \ No newline at end of file +var _0x2746=['nodemailer-plugin-inline-base64','prototype','use','sendMail','toString','verify','exports'];(function(_0x5c9d64,_0xc138de){var _0x12eb80=function(_0x338e22){while(--_0x338e22){_0x5c9d64['push'](_0x5c9d64['shift']());}};_0x12eb80(++_0xc138de);}(_0x2746,0x12d));var _0x6274=function(_0x132379,_0x21ed53){_0x132379=_0x132379-0x0;var _0x3bd030=_0x2746[_0x132379];return _0x3bd030;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x6274('0x0'));function EmailSmtp(){}EmailSmtp[_0x6274('0x1')]['send']=function(_0x591166,_0x465b30){return new Promise(function(_0x1bf4d2,_0x26179c){var _0x3d41c1=nodemailer['createTransport'](_0x591166);_0x3d41c1[_0x6274('0x2')]('compile',inlineBase64());_0x3d41c1[_0x6274('0x3')](_0x465b30,function(_0x2f4e3f,_0x3afac2){if(_0x2f4e3f){_0x26179c(_0x2f4e3f[_0x6274('0x4')]());}else{_0x1bf4d2(_0x3afac2);}});});};EmailSmtp['prototype'][_0x6274('0x5')]=function(_0x2f15d4){return new Promise(function(_0x4b613f,_0x9fb7d7){var _0x1538ec=nodemailer['createTransport'](_0x2f15d4);_0x1538ec[_0x6274('0x5')](function(_0x2f6cc2,_0xb77b91){if(_0x2f6cc2){_0x9fb7d7(_0x2f6cc2['toString']());}else{if(_0xb77b91){_0x4b613f(_0xb77b91);}else{_0x9fb7d7('Not\x20verifired');}}});});};module[_0x6274('0x6')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index af19290..74d8edf 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 _0x57c8=['slice','join','pop','isEmpty','html','test','replace','Empty\x20message

','Attachments','Title','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','path','util','../../../config/logger','../../../config/environment','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length'];(function(_0x170f9d,_0xba5fad){var _0x44d5f5=function(_0x1a165f){while(--_0x1a165f){_0x170f9d['push'](_0x170f9d['shift']());}};_0x44d5f5(++_0xba5fad);}(_0x57c8,0x1a0));var _0x857c=function(_0xcf5b6,_0x505ffa){_0xcf5b6=_0xcf5b6-0x0;var _0x27a544=_0x57c8[_0xcf5b6];return _0x27a544;};'use strict';var _=require(_0x857c('0x0'));var moment=require('moment');var random=require(_0x857c('0x1'));var fs=require('fs');var path=require(_0x857c('0x2'));var util=require(_0x857c('0x3'));var tnef=require('node-tnef');var logger=require(_0x857c('0x4'))('email');var config=require(_0x857c('0x5'));function getAddress(_0x5b82f6){var _0x16c769=_['head'](_0x5b82f6[_0x857c('0x6')]);return _0x16c769&&_0x16c769[_0x857c('0x7')]?_0x16c769['address']:_0x857c('0x8')+random[_0x857c('0x9')](0x6)+_0x857c('0xa');}function getFirstName(_0x18903c){var _0x2f7cba=_['head'](_0x18903c[_0x857c('0x6')]);if(_0x2f7cba&&_0x2f7cba[_0x857c('0xb')]){if(_0x2f7cba[_0x857c('0xb')]==_0x2f7cba[_0x857c('0x7')]){return _0x2f7cba['name'][_0x857c('0xc')](0x0,_0x2f7cba[_0x857c('0xb')][_0x857c('0xd')]('@'));}var _0x8567fe=_0x2f7cba[_0x857c('0xb')][_0x857c('0xe')](/\s+/);return _0x8567fe[_0x857c('0xf')]>0x1?_0x8567fe[_0x857c('0x10')](0x0,-0x1)[_0x857c('0x11')]('\x20'):_0x2f7cba[_0x857c('0xb')];}return'Anonymous';}function getLastName(_0xee8816){var _0x61f7f4=_['head'](_0xee8816[_0x857c('0x6')]);if(_0x61f7f4&&_0x61f7f4[_0x857c('0xb')]){var _0x3b9e07=_0x61f7f4[_0x857c('0xb')][_0x857c('0xe')](/\s+/);return _0x3b9e07['length']>0x1?_0x3b9e07[_0x857c('0x12')]():'';}return'';}function getMails(_0x482c15,_0x1c104c){var _0xd372a1='';for(var _0x44d21b=0x0;_0x44d21b<_0x1c104c[_0x857c('0x6')][_0x857c('0xf')];_0x44d21b+=0x1){if(_0x1c104c['value'][_0x44d21b][_0x857c('0x7')]!==_0x482c15){if(!_[_0x857c('0x13')](_0xd372a1)){_0xd372a1+=',';}_0xd372a1+=_0x1c104c[_0x857c('0x6')][_0x44d21b]['name']||_0x1c104c['value'][_0x44d21b]['address']||'';_0xd372a1+='\x20<';_0xd372a1+=_0x1c104c[_0x857c('0x6')][_0x44d21b][_0x857c('0x7')]?_0x1c104c['value'][_0x44d21b][_0x857c('0x7')]:'anonymous'+random['generate'](0x6)+_0x857c('0xa');_0xd372a1+='>';}}return _0xd372a1;}function parseEmail(_0xa821ef,_0x30ca18,_0x1f5327){if(_0x30ca18[_0x857c('0x14')]){var _0x2c788a=/)<[^<]*)*<\/script>/gi;while(_0x2c788a[_0x857c('0x15')](_0x30ca18['html'])){_0x30ca18[_0x857c('0x14')]=_0x30ca18[_0x857c('0x14')][_0x857c('0x16')](_0x2c788a,'');}if(_0x30ca18[_0x857c('0x14')]['includes'](_0x857c('0x17'))){var _0x42fa42=[];_0x30ca18['attachments'][_0x857c('0x18')](_0x199746=>{_0x42fa42[_0x857c('0x19')](_0x199746[_0x857c('0x1a')]);});var _0x30c141=/]+>/g;var _0x33b99c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x325be=_0x30ca18['html']['replace'](_0x33b99c,_0x857c('0x1b'));var _0x4aaf9a=_0x325be[_0x857c('0x16')](_0x30c141,_0x857c('0x1c'));for(let _0x360c28=0x0;_0x360c28<_0x42fa42[_0x857c('0xf')];_0x360c28++){var _0x32e510=_0x4aaf9a[_0x857c('0x16')](_0x857c('0x1c'),'\x20[Attachment:\x20'+_0x42fa42[_0x360c28]+'\x20]');_0x4aaf9a=_0x32e510;}_0x30ca18[_0x857c('0x14')]=_0x4aaf9a;}_0x1f5327['body']=_0x30ca18[_0x857c('0x14')];}else{_0x1f5327[_0x857c('0x1d')]=_0x30ca18[_0x857c('0x1e')];}if(_0x1f5327[_0x857c('0x1d')]){_0x1f5327['body']=_0x1f5327[_0x857c('0x1d')][_0x857c('0x16')](/0x0){var _0x1aa35b=[_0x857c('0x30'),_0x857c('0x31'),_0x857c('0x32')];for(var _0x5e8702=0x0;_0x5e8702<_0x30ca18['headerLines'][_0x857c('0xf')];_0x5e8702++){var _0x3fc309=_[_0x857c('0xd')](_0x1aa35b,_0x30ca18['headerLines'][_0x5e8702]['line']);if(_0x3fc309>=0x0){_0x1f5327[_0x857c('0x33')]=!![];}}}return _0x1f5327;}exports[_0x857c('0x34')]=function(_0x4aaa75,_0xd29dc9,_0x4c0b53){var _0x3be1cc={'from':getAddress(_0xd29dc9[_0x857c('0x35')]),'firstName':getFirstName(_0xd29dc9[_0x857c('0x35')]),'lastName':getLastName(_0xd29dc9[_0x857c('0x35')]),'mapKey':_0x857c('0x21'),'message':{'from':getMails(_0x4aaa75[_0x857c('0x21')],_0xd29dc9[_0x857c('0x35')]),'to':_0x4aaa75['email'],'cc':'','subject':_0xd29dc9['subject']||'','messageId':_0xd29dc9['messageId'],'inReplyTo':_0xd29dc9[_0x857c('0x36')],'sentAt':moment(_0xd29dc9['date'])[_0x857c('0x29')](_0x857c('0x37')),'attach':![],'attachments':[]}};if(!_0xd29dc9[_0x857c('0x14')]&&!_0xd29dc9['textAsHtml']){var _0x1577a4=_['filter'](_0xd29dc9['attachments'],{'contentType':_0x857c('0x38')});if(_0x1577a4[_0x857c('0xf')]){logger[_0x857c('0x39')](util[_0x857c('0x29')](_0x857c('0x3a'),_0xd29dc9[_0x857c('0x3b')]));tnef[_0x857c('0x3c')](_[_0x857c('0x3d')](_0x1577a4)[_0x857c('0x3e')],function(_0xa7fb16,_0x11217b){if(_0x11217b){_0xd29dc9['html']=_0x11217b[_0x857c('0x3f')]||_0x857c('0x40');if(_0x11217b[_0x857c('0x41')]){for(var _0x1f8896=0x0;_0x1f8896<_0x11217b[_0x857c('0x41')][_0x857c('0xf')];_0x1f8896++){var _0x54100d=_0x11217b['Attachments'][_0x1f8896];_0x3be1cc[_0x857c('0x20')][_0x857c('0x26')]['push']({'filename':_0x54100d[_0x857c('0x42')],'content':Buffer['from'](_0x54100d['Data'])});}}}_0x4c0b53(parseEmail(_0x4aaa75,_0xd29dc9,_0x3be1cc));});}else{_0xd29dc9[_0x857c('0x14')]='

Empty\x20message

';_0x4c0b53(parseEmail(_0x4aaa75,_0xd29dc9,_0x3be1cc));}}else{_0x4c0b53(parseEmail(_0x4aaa75,_0xd29dc9,_0x3be1cc));}};exports[_0x857c('0x43')]=function(_0x3c75bf,_0x4e6e66){var _0x33f65a=['user='+(_0x4e6e66||''),_0x857c('0x44')+_0x3c75bf,'',''];return Buffer[_0x857c('0x35')](_0x33f65a[_0x857c('0x11')](''),_0x857c('0x45'))[_0x857c('0x46')](_0x857c('0x47'));}; \ No newline at end of file +var _0x1be0=['html','test','includes','attachments','forEach','push','replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','textAsHtml','body','message','originTo','originCc','email','bcc','attach','type','attachment-','format','%s-%s','now','root','server/files/attachments/','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty'];(function(_0x311e77,_0x49a459){var _0x559c54=function(_0x283a97){while(--_0x283a97){_0x311e77['push'](_0x311e77['shift']());}};_0x559c54(++_0x49a459);}(_0x1be0,0x121));var _0x01be=function(_0x2d51da,_0x35d5da){_0x2d51da=_0x2d51da-0x0;var _0x3137a3=_0x1be0[_0x2d51da];return _0x3137a3;};'use strict';var _=require(_0x01be('0x0'));var moment=require(_0x01be('0x1'));var random=require(_0x01be('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x01be('0x3'));var tnef=require(_0x01be('0x4'));var logger=require(_0x01be('0x5'))('email');var config=require(_0x01be('0x6'));function getAddress(_0x37570c){var _0xe23691=_[_0x01be('0x7')](_0x37570c[_0x01be('0x8')]);return _0xe23691&&_0xe23691['address']?_0xe23691[_0x01be('0x9')]:_0x01be('0xa')+random[_0x01be('0xb')](0x6)+_0x01be('0xc');}function getFirstName(_0x423d9e){var _0xae19dd=_['head'](_0x423d9e[_0x01be('0x8')]);if(_0xae19dd&&_0xae19dd[_0x01be('0xd')]){if(_0xae19dd['name']==_0xae19dd[_0x01be('0x9')]){return _0xae19dd[_0x01be('0xd')][_0x01be('0xe')](0x0,_0xae19dd[_0x01be('0xd')][_0x01be('0xf')]('@'));}var _0x54e08a=_0xae19dd['name'][_0x01be('0x10')](/\s+/);return _0x54e08a[_0x01be('0x11')]>0x1?_0x54e08a[_0x01be('0x12')](0x0,-0x1)[_0x01be('0x13')]('\x20'):_0xae19dd[_0x01be('0xd')];}return _0x01be('0x14');}function getLastName(_0x17ce17){var _0x2f32ab=_[_0x01be('0x7')](_0x17ce17[_0x01be('0x8')]);if(_0x2f32ab&&_0x2f32ab[_0x01be('0xd')]){var _0x1eb6c8=_0x2f32ab[_0x01be('0xd')][_0x01be('0x10')](/\s+/);return _0x1eb6c8[_0x01be('0x11')]>0x1?_0x1eb6c8[_0x01be('0x15')]():'';}return'';}function getMails(_0x3eb6eb,_0x5d9a60){var _0xa71b58='';for(var _0x24fd81=0x0;_0x24fd81<_0x5d9a60['value']['length'];_0x24fd81+=0x1){if(_0x5d9a60[_0x01be('0x8')][_0x24fd81]['address']!==_0x3eb6eb){if(!_[_0x01be('0x16')](_0xa71b58)){_0xa71b58+=',';}_0xa71b58+=_0x5d9a60[_0x01be('0x8')][_0x24fd81][_0x01be('0xd')]||_0x5d9a60[_0x01be('0x8')][_0x24fd81]['address']||'';_0xa71b58+='\x20<';_0xa71b58+=_0x5d9a60['value'][_0x24fd81][_0x01be('0x9')]?_0x5d9a60[_0x01be('0x8')][_0x24fd81][_0x01be('0x9')]:_0x01be('0xa')+random['generate'](0x6)+_0x01be('0xc');_0xa71b58+='>';}}return _0xa71b58;}function parseEmail(_0x8ba4fd,_0xcf4fe3,_0x2855bd){if(_0xcf4fe3[_0x01be('0x17')]){var _0x5b1f56=/)<[^<]*)*<\/script>/gi;while(_0x5b1f56[_0x01be('0x18')](_0xcf4fe3['html'])){_0xcf4fe3[_0x01be('0x17')]=_0xcf4fe3['html']['replace'](_0x5b1f56,'');}if(_0xcf4fe3[_0x01be('0x17')][_0x01be('0x19')]('{_0x34e064[_0x01be('0x1c')](_0x4e299e['filename']);});var _0x3db4ed=/]+>/g;var _0x43b570=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x35c0da=_0xcf4fe3[_0x01be('0x17')][_0x01be('0x1d')](_0x43b570,_0x01be('0x1e'));var _0x2bd878=_0x35c0da[_0x01be('0x1d')](_0x3db4ed,_0x01be('0x1f'));for(let _0x23f689=0x0;_0x23f689<_0x34e064['length'];_0x23f689++){var _0x5d8ce6=_0x2bd878[_0x01be('0x1d')](_0x01be('0x1f'),_0x01be('0x20')+_0x34e064[_0x23f689]+_0x01be('0x21'));_0x2bd878=_0x5d8ce6;}_0xcf4fe3[_0x01be('0x17')]=_0x2bd878;}_0x2855bd['body']=_0xcf4fe3['html'];}else{_0x2855bd['body']=_0xcf4fe3[_0x01be('0x22')];}if(_0x2855bd[_0x01be('0x23')]){_0x2855bd['body']=_0x2855bd[_0x01be('0x23')][_0x01be('0x1d')](/0x0){var _0x4a6f15=['Auto-Submitted:\x20auto-replied',_0x01be('0x34'),_0x01be('0x35')];for(var _0x5e325d=0x0;_0x5e325d<_0xcf4fe3[_0x01be('0x33')][_0x01be('0x11')];_0x5e325d++){var _0x4cd6ab=_['indexOf'](_0x4a6f15,_0xcf4fe3[_0x01be('0x33')][_0x5e325d][_0x01be('0x36')]);if(_0x4cd6ab>=0x0){_0x2855bd[_0x01be('0x37')]=!![];}}}return _0x2855bd;}exports[_0x01be('0x38')]=function(_0x20ea0f,_0x308ea0,_0x227569){var _0x244532={'from':getAddress(_0x308ea0['from']),'firstName':getFirstName(_0x308ea0[_0x01be('0x39')]),'lastName':getLastName(_0x308ea0[_0x01be('0x39')]),'mapKey':_0x01be('0x27'),'message':{'from':getMails(_0x20ea0f['email'],_0x308ea0['from']),'to':_0x20ea0f[_0x01be('0x27')],'cc':'','subject':_0x308ea0[_0x01be('0x3a')]||'','messageId':_0x308ea0[_0x01be('0x3b')],'inReplyTo':_0x308ea0[_0x01be('0x3c')],'sentAt':moment(_0x308ea0[_0x01be('0x3d')])[_0x01be('0x2c')](_0x01be('0x3e')),'attach':![],'attachments':[]}};if(!_0x308ea0[_0x01be('0x17')]&&!_0x308ea0['textAsHtml']){var _0x1b5584=_[_0x01be('0x3f')](_0x308ea0[_0x01be('0x1a')],{'contentType':_0x01be('0x40')});if(_0x1b5584[_0x01be('0x11')]){logger[_0x01be('0x41')](util[_0x01be('0x2c')](_0x01be('0x42'),_0x308ea0[_0x01be('0x3b')]));tnef['parseBuffer'](_[_0x01be('0x43')](_0x1b5584)['content'],function(_0x281768,_0x216fe3){if(_0x216fe3){_0x308ea0[_0x01be('0x17')]=_0x216fe3['BodyHTML']||_0x01be('0x44');if(_0x216fe3[_0x01be('0x45')]){for(var _0x561317=0x0;_0x561317<_0x216fe3[_0x01be('0x45')][_0x01be('0x11')];_0x561317++){var _0x2e3d54=_0x216fe3['Attachments'][_0x561317];_0x244532[_0x01be('0x24')]['attachments'][_0x01be('0x1c')]({'filename':_0x2e3d54[_0x01be('0x46')],'content':Buffer[_0x01be('0x39')](_0x2e3d54[_0x01be('0x47')])});}}}_0x227569(parseEmail(_0x20ea0f,_0x308ea0,_0x244532));});}else{_0x308ea0['html']=_0x01be('0x44');_0x227569(parseEmail(_0x20ea0f,_0x308ea0,_0x244532));}}else{_0x227569(parseEmail(_0x20ea0f,_0x308ea0,_0x244532));}};exports[_0x01be('0x48')]=function(_0x5ccab8,_0x5ad9ca){var _0x36d7cf=[_0x01be('0x49')+(_0x5ad9ca||''),_0x01be('0x4a')+_0x5ccab8,'',''];return Buffer[_0x01be('0x39')](_0x36d7cf['join'](''),_0x01be('0x4b'))[_0x01be('0x4c')](_0x01be('0x4d'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 7ba8d62..e5166f4 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 _0xaafa=['key','SERV','active','Imap','Smtp','name','Service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaafa,0x140));var _0xaaaf=function(_0x8f1a68,_0x20e754){_0x8f1a68=_0x8f1a68-0x0;var _0x4b73c0=_0xaafa[_0x8f1a68];return _0x4b73c0;};'use strict';var _=require('lodash');function MailAccount(_0x38cde9){this['id']=_0x38cde9['id']||0x0;this[_0xaaaf('0x0')]=_0x38cde9[_0xaaaf('0x0')]||_0xaaaf('0x1');this[_0xaaaf('0x2')]=_0x38cde9[_0xaaaf('0x2')]||_0xaaaf('0x3');this[_0xaaaf('0x4')]=_0x38cde9[_0xaaaf('0x4')]||![];this[_0xaaaf('0x5')]=_0x38cde9[_0xaaaf('0x5')]||[];this[_0xaaaf('0x6')]=_0x38cde9[_0xaaaf('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x979f=['key','active','Imap','Smtp','lodash','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x979f,0x178));var _0xf979=function(_0xf1d8f2,_0x42e56f){_0xf1d8f2=_0xf1d8f2-0x0;var _0x207931=_0x979f[_0xf1d8f2];return _0x207931;};'use strict';var _=require(_0xf979('0x0'));function MailAccount(_0x2b9b8f){this['id']=_0x2b9b8f['id']||0x0;this[_0xf979('0x1')]=_0x2b9b8f[_0xf979('0x1')]||'Service';this[_0xf979('0x2')]=_0x2b9b8f[_0xf979('0x2')]||'SERV';this[_0xf979('0x3')]=_0x2b9b8f['active']||![];this[_0xf979('0x4')]=_0x2b9b8f[_0xf979('0x4')]||[];this[_0xf979('0x5')]=_0x2b9b8f[_0xf979('0x5')]||[];}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 89a0684..78864ef 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 _0xe42c=['hasOwnProperty','isUndefined','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase'];(function(_0x461f62,_0x319929){var _0x4ec011=function(_0x8bb085){while(--_0x8bb085){_0x461f62['push'](_0x461f62['shift']());}};_0x4ec011(++_0x319929);}(_0xe42c,0x1c5));var _0xce42=function(_0x26a4d0,_0x40b326){_0x26a4d0=_0x26a4d0-0x0;var _0x3d84f0=_0xe42c[_0x26a4d0];return _0x3d84f0;};'use strict';var _=require(_0xce42('0x0'));var MailAccount=require(_0xce42('0x1'));var Realtime=function(){this[_0xce42('0x2')]={};};function freeIsNotKey(_0x41212e,_0x1ee1df,_0x4a8d78){var _0x2fc3d3=_[_0xce42('0x3')](_0x41212e,function(_0x12d814,_0x1f8b89){return _0x12d814[_0x4a8d78];});for(var _0x160430 in _0x1ee1df){if(_0x1ee1df['hasOwnProperty'](_0x160430)){if(!_0x2fc3d3[_0x160430]){delete _0x1ee1df[_0x160430];}}}}Realtime[_0xce42('0x4')][_0xce42('0x5')]=function(_0x369765,_0x5cc975){for(var _0x2161b6 in _0x5cc975){if(_0x369765[_0xce42('0x6')](_0x2161b6)){_0x369765[_0x2161b6]=_0x5cc975[_0x2161b6];}}};Realtime[_0xce42('0x4')]['initMailAccounts']=function(){var _0x451db4=this;return function(_0x2101a8){if(_0x2101a8){freeIsNotKey(_0x2101a8,_0x451db4[_0xce42('0x2')],'id');for(var _0x6e6695=0x0,_0x4e8000={},_0x541992={};_0x6e6695<_0x2101a8['length'];_0x6e6695+=0x1){_0x4e8000=_0x2101a8[_0x6e6695];if(_[_0xce42('0x7')](_0x451db4[_0xce42('0x2')][_0x4e8000['id']])){_0x451db4['mailAccounts'][_0x4e8000['id']]=new MailAccount(_0x4e8000);}else{_['merge'](_0x451db4['mailAccounts'][_0x4e8000['id']],_0x4e8000);}}}return _0x451db4[_0xce42('0x2')];};};module[_0xce42('0x8')]=Realtime; \ No newline at end of file +var _0xb776=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x4e5cd6,_0x3f0a14){var _0x3a86db=function(_0x2ccfb3){while(--_0x2ccfb3){_0x4e5cd6['push'](_0x4e5cd6['shift']());}};_0x3a86db(++_0x3f0a14);}(_0xb776,0x13d));var _0x6b77=function(_0x691206,_0x4c9726){_0x691206=_0x691206-0x0;var _0x4bffb4=_0xb776[_0x691206];return _0x4bffb4;};'use strict';var _=require(_0x6b77('0x0'));var MailAccount=require(_0x6b77('0x1'));var Realtime=function(){this[_0x6b77('0x2')]={};};function freeIsNotKey(_0x44d794,_0x201e9d,_0x412f0f){var _0x457864=_[_0x6b77('0x3')](_0x44d794,function(_0x2846fb,_0x31836a){return _0x2846fb[_0x412f0f];});for(var _0x62c10f in _0x201e9d){if(_0x201e9d[_0x6b77('0x4')](_0x62c10f)){if(!_0x457864[_0x62c10f]){delete _0x201e9d[_0x62c10f];}}}}Realtime[_0x6b77('0x5')][_0x6b77('0x6')]=function(_0x29068f,_0x472c6b){for(var _0x51cc83 in _0x472c6b){if(_0x29068f['hasOwnProperty'](_0x51cc83)){_0x29068f[_0x51cc83]=_0x472c6b[_0x51cc83];}}};Realtime[_0x6b77('0x5')][_0x6b77('0x7')]=function(){var _0x304cfb=this;return function(_0x47e584){if(_0x47e584){freeIsNotKey(_0x47e584,_0x304cfb['mailAccounts'],'id');for(var _0x4cb1d9=0x0,_0x403913={},_0x56457f={};_0x4cb1d9<_0x47e584[_0x6b77('0x8')];_0x4cb1d9+=0x1){_0x403913=_0x47e584[_0x4cb1d9];if(_[_0x6b77('0x9')](_0x304cfb[_0x6b77('0x2')][_0x403913['id']])){_0x304cfb[_0x6b77('0x2')][_0x403913['id']]=new MailAccount(_0x403913);}else{_[_0x6b77('0xa')](_0x304cfb[_0x6b77('0x2')][_0x403913['id']],_0x403913);}}}return _0x304cfb[_0x6b77('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b9a459d..53c8cdb 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 _0x77ed=['service','active','key','ListId','TemplateId','MailServerIn','Imap','name','type','CloudProvider','MailServerOut','Smtp','getMailAccount','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','provider'];(function(_0x3d5263,_0x338007){var _0x2058e0=function(_0x199fa6){while(--_0x199fa6){_0x3d5263['push'](_0x3d5263['shift']());}};_0x2058e0(++_0x338007);}(_0x77ed,0x152));var _0xd77e=function(_0x2e86cd,_0x5de995){_0x2e86cd=_0x2e86cd-0x0;var _0xec19db=_0x77ed[_0x2e86cd];return _0xec19db;};'use strict';var client=require(_0xd77e('0x0'));exports[_0xd77e('0x1')]=function(){return function(){return client['Request'](_0xd77e('0x2'),{'options':{'attributes':['id','name',_0xd77e('0x3'),_0xd77e('0x4'),'email',_0xd77e('0x5'),_0xd77e('0x6'),_0xd77e('0x7'),_0xd77e('0x8')],'raw':![],'include':[{'model':_0xd77e('0x9'),'as':_0xd77e('0xa'),'include':[{'model':'CloudProvider','attributes':['id',_0xd77e('0xb'),'service',_0xd77e('0xc'),'data5'],'as':_0xd77e('0xd')}]},{'model':_0xd77e('0xe'),'as':_0xd77e('0xf'),'include':[{'model':_0xd77e('0xd'),'attributes':['id','name',_0xd77e('0x4'),_0xd77e('0xc'),'data5'],'as':_0xd77e('0xd')}]}]},'log':_0xd77e('0x10')});};};exports['notify']=function(_0x16dcb9,_0x5c86a4){return client[_0xd77e('0x11')]('NotifyMailAccount',{'account':{'id':_0x16dcb9},'body':_0x5c86a4,'log':_0xd77e('0x12')});}; \ No newline at end of file +var _0x3144=['getMailAccounts','Request','GetMailAccount','provider','service','email','active','ListId','TemplateId','MailServerIn','Imap','type','data5','CloudProvider','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount'];(function(_0x7ff255,_0x262c6a){var _0x2c99e4=function(_0x5b2b06){while(--_0x5b2b06){_0x7ff255['push'](_0x7ff255['shift']());}};_0x2c99e4(++_0x262c6a);}(_0x3144,0x17c));var _0x4314=function(_0x42f493,_0x5d99e9){_0x42f493=_0x42f493-0x0;var _0x4aee00=_0x3144[_0x42f493];return _0x4aee00;};'use strict';var client=require('../client');exports[_0x4314('0x0')]=function(){return function(){return client[_0x4314('0x1')](_0x4314('0x2'),{'options':{'attributes':['id','name',_0x4314('0x3'),_0x4314('0x4'),_0x4314('0x5'),_0x4314('0x6'),'key',_0x4314('0x7'),_0x4314('0x8')],'raw':![],'include':[{'model':_0x4314('0x9'),'as':_0x4314('0xa'),'include':[{'model':'CloudProvider','attributes':['id','name','service',_0x4314('0xb'),_0x4314('0xc')],'as':_0x4314('0xd')}]},{'model':_0x4314('0xe'),'as':_0x4314('0xf'),'include':[{'model':'CloudProvider','attributes':['id','name','service',_0x4314('0xb'),'data5'],'as':'CloudProvider'}]}]},'log':_0x4314('0x10')});};};exports[_0x4314('0x11')]=function(_0x3b44ef,_0x20e84c){return client['Request'](_0x4314('0x12'),{'account':{'id':_0x3b44ef},'body':_0x20e84c,'log':_0x4314('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4a0819c..9f0f98e 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbf6=['getSettings','Request','ShowSetting','GetSettings','../client'];(function(_0x576f4d,_0x18aa23){var _0x579061=function(_0x469608){while(--_0x469608){_0x576f4d['push'](_0x576f4d['shift']());}};_0x579061(++_0x18aa23);}(_0xbbf6,0x18a));var _0x6bbf=function(_0x27180f,_0x4bf5c5){_0x27180f=_0x27180f-0x0;var _0x5d084f=_0xbbf6[_0x27180f];return _0x5d084f;};'use strict';var client=require(_0x6bbf('0x0'));exports[_0x6bbf('0x1')]=function(){return client[_0x6bbf('0x2')](_0x6bbf('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x6bbf('0x4')});}; \ No newline at end of file +var _0xf3e3=['Request','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x2f4363,_0x2f3e1b){var _0xd9e20b=function(_0x2bfbc9){while(--_0x2bfbc9){_0x2f4363['push'](_0x2f4363['shift']());}};_0xd9e20b(++_0x2f3e1b);}(_0xf3e3,0xea));var _0x3f3e=function(_0x310006,_0x33a375){_0x310006=_0x310006-0x0;var _0x5109d4=_0xf3e3[_0x310006];return _0x5109d4;};'use strict';var client=require(_0x3f3e('0x0'));exports['getSettings']=function(){return client[_0x3f3e('0x1')](_0x3f3e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3f3e('0x3')]},'log':_0x3f3e('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index eefd42e..99b5743 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 _0xa9e0=['catch','values','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','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','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','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index fe5193d..d42caf9 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 _0x1b24=['default','../../config/socketio','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','../../config/environment','createServer','timeout','port','socket.io','redis','localhost','adapter','socket.io-redis'];(function(_0x340e2c,_0x5ba6b4){var _0x5a4fc1=function(_0x138568){while(--_0x138568){_0x340e2c['push'](_0x340e2c['shift']());}};_0x5a4fc1(++_0x5ba6b4);}(_0x1b24,0x1e7));var _0x41b2=function(_0x931072,_0x4badd5){_0x931072=_0x931072-0x0;var _0x35047a=_0x1b24[_0x931072];return _0x35047a;};'use strict';var _=require(_0x41b2('0x0'));var http=require(_0x41b2('0x1'));var express=require(_0x41b2('0x2'));var sticky=require(_0x41b2('0x3'));var Redis=require('ioredis');var config=require(_0x41b2('0x4'));var app=express();var server=http[_0x41b2('0x5')](app);server[_0x41b2('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x41b2('0x7')])){var socketio=require(_0x41b2('0x8'))(server,{'transports':['websocket','polling']});config[_0x41b2('0x9')]=_['defaults'](config[_0x41b2('0x9')],{'host':_0x41b2('0xa'),'port':0x18eb});socketio[_0x41b2('0xb')](require(_0x41b2('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x41b2('0xd')]();require(_0x41b2('0xe'))['default'](socketio);require('../../config/express')[_0x41b2('0xd')](app);require(_0x41b2('0xf'))['default'](app);}else{server[_0x41b2('0x10')]('listening',function(){console[_0x41b2('0x11')](_0x41b2('0x12'),config['port']);});}exports=module[_0x41b2('0x13')]=app; \ No newline at end of file +var _0x5a0e=['localhost','adapter','socket.io-redis','default','../../config/express','once','listening','log','port','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','polling','redis','defaults'];(function(_0x52c538,_0x48f45a){var _0x33cb72=function(_0x337637){while(--_0x337637){_0x52c538['push'](_0x52c538['shift']());}};_0x33cb72(++_0x48f45a);}(_0x5a0e,0xe6));var _0xe5a0=function(_0x540f0d,_0x2a093b){_0x540f0d=_0x540f0d-0x0;var _0x5d2fc3=_0x5a0e[_0x540f0d];return _0x5d2fc3;};'use strict';var _=require(_0xe5a0('0x0'));var http=require(_0xe5a0('0x1'));var express=require(_0xe5a0('0x2'));var sticky=require(_0xe5a0('0x3'));var Redis=require(_0xe5a0('0x4'));var config=require(_0xe5a0('0x5'));var app=express();var server=http[_0xe5a0('0x6')](app);server[_0xe5a0('0x7')]=0xdbba0;if(sticky[_0xe5a0('0x8')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xe5a0('0x9')]});config[_0xe5a0('0xa')]=_[_0xe5a0('0xb')](config[_0xe5a0('0xa')],{'host':_0xe5a0('0xc'),'port':0x18eb});socketio[_0xe5a0('0xd')](require(_0xe5a0('0xe'))({'pubClient':new Redis(config[_0xe5a0('0xa')]),'subClient':new Redis(config[_0xe5a0('0xa')])}));require('../../config/triggers')[_0xe5a0('0xf')]();require('../../config/socketio')[_0xe5a0('0xf')](socketio);require(_0xe5a0('0x10'))[_0xe5a0('0xf')](app);require('../../routes')[_0xe5a0('0xf')](app);}else{server[_0xe5a0('0x11')](_0xe5a0('0x12'),function(){console[_0xe5a0('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe5a0('0x14')]);});}exports=module[_0xe5a0('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index b26981d..8583ff5 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 _0x3355=['../../config/logger','routing','Request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x3792dc,_0xba8727){var _0x5a3891=function(_0x9056fa){while(--_0x9056fa){_0x3792dc['push'](_0x3792dc['shift']());}};_0x5a3891(++_0xba8727);}(_0x3355,0x9a));var _0x5335=function(_0x33bf76,_0x581d67){_0x33bf76=_0x33bf76-0x0;var _0x1534f6=_0x3355[_0x33bf76];return _0x1534f6;};'use strict';var jayson=require(_0x5335('0x0'));var BPromise=require(_0x5335('0x1'));var logger=require(_0x5335('0x2'))(_0x5335('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0x5335('0x4')]=function(_0x5be3fa,_0x1293a5){return new BPromise(function(_0x5d57d5,_0x50ec42){return client['request'](_0x5be3fa,_0x1293a5)[_0x5335('0x5')](function(_0x3f560b){logger['debug'](_0x5335('0x6'),_0x5335('0x3'),_0x5be3fa,_0x1293a5,_0x3f560b);if(_0x3f560b['error']){logger[_0x5335('0x7')](_0x5335('0x6'),_0x5335('0x3'),_0x5be3fa,_0x3f560b[_0x5335('0x7')][_0x5335('0x8')],_0x1293a5);return _0x50ec42(_0x3f560b['error'][_0x5335('0x8')]);}else{return _0x5d57d5(_0x3f560b[_0x5335('0x9')]);}})[_0x5335('0xa')](function(_0x15389d){logger[_0x5335('0x7')](_0x5335('0x6'),_0x5335('0x3'),_0x5be3fa,_0x15389d,_0x1293a5);return _0x50ec42(_0x15389d);});});};module[_0x5335('0xb')]=client; \ No newline at end of file +var _0xc7bc=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc7bc,0xb3));var _0xcc7b=function(_0x28da07,_0x119907){_0x28da07=_0x28da07-0x0;var _0x23b5e0=_0xc7bc[_0x28da07];return _0x23b5e0;};'use strict';var jayson=require(_0xcc7b('0x0'));var BPromise=require(_0xcc7b('0x1'));var logger=require(_0xcc7b('0x2'))(_0xcc7b('0x3'));var client=jayson[_0xcc7b('0x4')][_0xcc7b('0x5')]({'port':0x2329});client[_0xcc7b('0x6')]=function(_0x5b2f01,_0x356644){return new BPromise(function(_0x529770,_0x348fe8){return client[_0xcc7b('0x7')](_0x5b2f01,_0x356644)[_0xcc7b('0x8')](function(_0xb38ef6){logger[_0xcc7b('0x9')](_0xcc7b('0xa'),_0xcc7b('0x3'),_0x5b2f01,_0x356644,_0xb38ef6);if(_0xb38ef6[_0xcc7b('0xb')]){logger[_0xcc7b('0xb')]('rpc',_0xcc7b('0x3'),_0x5b2f01,_0xb38ef6[_0xcc7b('0xb')][_0xcc7b('0xc')],_0x356644);return _0x348fe8(_0xb38ef6[_0xcc7b('0xb')]['message']);}else{return _0x529770(_0xb38ef6[_0xcc7b('0xd')]);}})[_0xcc7b('0xe')](function(_0x6a7e81){logger[_0xcc7b('0xb')](_0xcc7b('0xa'),_0xcc7b('0x3'),_0x5b2f01,_0x6a7e81,_0x356644);return _0x348fe8(_0x6a7e81);});});};module[_0xcc7b('0xf')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 38e6175..0b9fbd9 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 _0x2d0a=['initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues'];(function(_0x327259,_0x401134){var _0x42c219=function(_0x103dbe){while(--_0x103dbe){_0x327259['push'](_0x327259['shift']());}};_0x42c219(++_0x401134);}(_0x2d0a,0x1c3));var _0xa2d0=function(_0x57975e,_0x899b07){_0x57975e=_0x57975e-0x0;var _0x2482c3=_0x2d0a[_0x57975e];return _0x2482c3;};'use strict';var BPromise=require('bluebird');var server=require(_0xa2d0('0x0'));var Realtime=require(_0xa2d0('0x1'));var user=require(_0xa2d0('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xa2d0('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xa2d0('0x4'));var mailQueue=require(_0xa2d0('0x5'));var faxQueue=require(_0xa2d0('0x6'));var whatsappQueue=require(_0xa2d0('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa2d0('0x8')]()['then'](user[_0xa2d0('0x9')]())['then'](realtime['initAgents']())[_0xa2d0('0xa')](interval[_0xa2d0('0xb')]())[_0xa2d0('0xa')](realtime[_0xa2d0('0xc')]())[_0xa2d0('0xa')](openchannelQueue[_0xa2d0('0xd')]())['then'](realtime[_0xa2d0('0xe')]())['then'](chatQueue['getChatQueues']())[_0xa2d0('0xa')](realtime[_0xa2d0('0xf')]())[_0xa2d0('0xa')](smsQueue[_0xa2d0('0x10')]())[_0xa2d0('0xa')](realtime[_0xa2d0('0x11')]())['then'](mailQueue[_0xa2d0('0x12')]())[_0xa2d0('0xa')](realtime[_0xa2d0('0x13')]())[_0xa2d0('0xa')](faxQueue[_0xa2d0('0x14')]())['then'](realtime['initFaxQueues']())[_0xa2d0('0xa')](whatsappQueue[_0xa2d0('0x15')]())['then'](realtime[_0xa2d0('0x16')]())[_0xa2d0('0xa')](function(){return realtime;});}function main(){return server[_0xa2d0('0x17')](realtime)['then'](function(_0x355b71){return initRealtime();})['then'](function(_0x1d0165){return setInterval(initRealtime,0x1388);})[_0xa2d0('0x18')](function(_0x7c49a9){console[_0xa2d0('0x19')](_0x7c49a9);});}main(); \ No newline at end of file +var _0x74e0=['initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues'];(function(_0x147bd8,_0x15126a){var _0x3d8573=function(_0x4e3475){while(--_0x4e3475){_0x147bd8['push'](_0x147bd8['shift']());}};_0x3d8573(++_0x15126a);}(_0x74e0,0x15a));var _0x074e=function(_0xd457f7,_0x2e2b0b){_0xd457f7=_0xd457f7-0x0;var _0x4bbab0=_0x74e0[_0xd457f7];return _0x4bbab0;};'use strict';var BPromise=require('bluebird');var server=require(_0x074e('0x0'));var Realtime=require(_0x074e('0x1'));var user=require(_0x074e('0x2'));var interval=require(_0x074e('0x3'));var openchannelQueue=require(_0x074e('0x4'));var chatQueue=require(_0x074e('0x5'));var smsQueue=require(_0x074e('0x6'));var mailQueue=require(_0x074e('0x7'));var faxQueue=require(_0x074e('0x8'));var whatsappQueue=require(_0x074e('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x074e('0xa')]()[_0x074e('0xb')](user[_0x074e('0xc')]())[_0x074e('0xb')](realtime[_0x074e('0xd')]())[_0x074e('0xb')](interval[_0x074e('0xe')]())[_0x074e('0xb')](realtime[_0x074e('0xf')]())[_0x074e('0xb')](openchannelQueue[_0x074e('0x10')]())[_0x074e('0xb')](realtime['initOpenchannelQueues']())[_0x074e('0xb')](chatQueue[_0x074e('0x11')]())[_0x074e('0xb')](realtime[_0x074e('0x12')]())[_0x074e('0xb')](smsQueue[_0x074e('0x13')]())[_0x074e('0xb')](realtime[_0x074e('0x14')]())[_0x074e('0xb')](mailQueue[_0x074e('0x15')]())['then'](realtime[_0x074e('0x16')]())[_0x074e('0xb')](faxQueue[_0x074e('0x17')]())['then'](realtime['initFaxQueues']())[_0x074e('0xb')](whatsappQueue[_0x074e('0x18')]())[_0x074e('0xb')](realtime[_0x074e('0x19')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x074e('0xb')](function(_0x313d23){return initRealtime();})[_0x074e('0xb')](function(_0x45edd9){return setInterval(initRealtime,0x1388);})[_0x074e('0x1a')](function(_0x1a8a88){console[_0x074e('0x1b')](_0x1a8a88);});}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 c15284d..63f0b0f 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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x56a314,_0x4b4da8){var _0x490282=function(_0x5fd354){while(--_0x5fd354){_0x56a314['push'](_0x56a314['shift']());}};_0x490282(++_0x4b4da8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0x5fc3[_0x333798];return _0x389f4e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x142fe9,_0xd62236){var _0x26f320=function(_0x2e8d58){while(--_0x2e8d58){_0x142fe9['push'](_0x142fe9['shift']());}};_0x26f320(++_0xd62236);}(_0x326f,0xd1));var _0xf326=function(_0x4cc4a0,_0x41ceb7){_0x4cc4a0=_0x4cc4a0-0x0;var _0x4db81d=_0x326f[_0x4cc4a0];return _0x4db81d;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 4468033..4137b6c 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 _0x0baa=['http','request','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x0baa,0xd7));var _0xa0ba=function(_0x54e5c4,_0x51451c){_0x54e5c4=_0x54e5c4-0x0;var _0xcca5e9=_0x0baa[_0x54e5c4];return _0xcca5e9;};'use strict';var BPromise=require(_0xa0ba('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa0ba('0x1')]({'port':0x232b});function request(_0x54fea2,_0x1af3cb){return new BPromise(function(_0x12360f,_0xe608d3){return client[_0xa0ba('0x2')](_0x54fea2,_0x1af3cb)['then'](function(_0x28afa4){if(_0x28afa4[_0xa0ba('0x3')]){return _0xe608d3(_0x28afa4['error'][_0xa0ba('0x4')]);}else{return _0x12360f(_0x28afa4[_0xa0ba('0x5')]);}})[_0xa0ba('0x6')](function(_0x5ee582){return _0xe608d3(_0x5ee582);});});}exports[_0xa0ba('0x7')]=function(_0x4b840b,_0x1c251c){return request(_0xa0ba('0x8'),{'account':_0x4b840b,'message':_0x1c251c});}; \ No newline at end of file +var _0x8ac9=['http','request','then','error','catch','sendMailMessage','SendMail','bluebird','client'];(function(_0x70e04,_0x41d243){var _0x5d35b5=function(_0x266583){while(--_0x266583){_0x70e04['push'](_0x70e04['shift']());}};_0x5d35b5(++_0x41d243);}(_0x8ac9,0x178));var _0x98ac=function(_0x298e61,_0x20d8db){_0x298e61=_0x298e61-0x0;var _0x5ba522=_0x8ac9[_0x298e61];return _0x5ba522;};'use strict';var BPromise=require(_0x98ac('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x98ac('0x1')][_0x98ac('0x2')]({'port':0x232b});function request(_0x3a6082,_0x431fa5){return new BPromise(function(_0xe537c8,_0x442ed3){return client[_0x98ac('0x3')](_0x3a6082,_0x431fa5)[_0x98ac('0x4')](function(_0x298107){if(_0x298107[_0x98ac('0x5')]){return _0x442ed3(_0x298107[_0x98ac('0x5')]['message']);}else{return _0xe537c8(_0x298107['result']);}})[_0x98ac('0x6')](function(_0x28fe7c){return _0x442ed3(_0x28fe7c);});});}exports[_0x98ac('0x7')]=function(_0x5cbb58,_0x53b1e6){return request(_0x98ac('0x8'),{'account':_0x5cbb58,'message':_0x53b1e6});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index d524557..10dcf85 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 _0xb25b=['mailStatus','smsStatus','smsStatusTime','busyQueue','stringify','emit','user:save','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','sms','whatsapp','length','Status','StatusTime','toNumber','chatPause','chatStatusTime','chatCapacity'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb25b,0x80));var _0xbb25=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb25b[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var moment=require(_0xbb25('0x0'));var md5=require(_0xbb25('0x1'));var Redis=require(_0xbb25('0x2'));var config=require(_0xbb25('0x3'));config['redis']=_[_0xbb25('0x4')](config[_0xbb25('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb25('0x5')]));function Agent(_0x656f32){this['id']=_0x656f32['id']||0x0;this[_0xbb25('0x6')]=_0x656f32[_0xbb25('0x6')]||'';this['online']=_0x656f32[_0xbb25('0x7')]||!![];this[_0xbb25('0x8')]=_0x656f32[_0xbb25('0x8')]||![];this['chatPause']=_0x656f32['chatPause']||![];this['mailPause']=_0x656f32[_0xbb25('0x9')]||![];this[_0xbb25('0xa')]=_0x656f32[_0xbb25('0xa')]||![];this[_0xbb25('0xb')]=_0x656f32['smsPause']||![];this['openchannelPause']=_0x656f32[_0xbb25('0xc')]||![];this[_0xbb25('0xd')]=_0xbb25('0xe');this['chatStatusTime']=0x0;this['chatCapacity']=_0x656f32['chatCapacity']||0x0;this[_0xbb25('0xf')]=0x0;this['mailStatus']=_0xbb25('0xe');this[_0xbb25('0x10')]=0x0;this[_0xbb25('0x11')]=_0x656f32[_0xbb25('0x11')]||0x0;this[_0xbb25('0x12')]=0x0;this[_0xbb25('0x13')]='unknown';this[_0xbb25('0x14')]=0x0;this[_0xbb25('0x15')]=_0x656f32[_0xbb25('0x15')]||0x0;this[_0xbb25('0x16')]=0x0;this['smsStatus']=_0xbb25('0xe');this['smsStatusTime']=0x0;this['smsCapacity']=_0x656f32[_0xbb25('0x17')]||0x0;this[_0xbb25('0x18')]=0x0;this[_0xbb25('0x19')]=_0xbb25('0xe');this[_0xbb25('0x1a')]=0x0;this['whatsappCapacity']=_0x656f32[_0xbb25('0x1b')]||0x0;this[_0xbb25('0x1c')]=0x0;this[_0xbb25('0x1d')]=_0xbb25('0xe');this[_0xbb25('0x1e')]=0x0;this[_0xbb25('0x1f')]=_0x656f32[_0xbb25('0x1f')]||0x0;this[_0xbb25('0x20')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xbb25('0x1')]='';this[_0xbb25('0x21')]();}Agent[_0xbb25('0x22')][_0xbb25('0x23')]=function(_0x6bbfda){if(this[_0x6bbfda+_0xbb25('0x24')]>0x0){if(this[_0x6bbfda+'Capacity']>0x0&&this[_0x6bbfda+_0xbb25('0x24')]>=this[_0x6bbfda+_0xbb25('0x25')]){return _0xbb25('0x26');}else{return _0xbb25('0x27');}}else{return _0xbb25('0x28');}};Agent[_0xbb25('0x22')][_0xbb25('0x21')]=function(){var _0x561936=[_0xbb25('0x29'),_0xbb25('0x2a'),'openchannel','fax',_0xbb25('0x2b'),_0xbb25('0x2c')];for(var _0x27ffb9=0x0;_0x27ffb9<_0x561936[_0xbb25('0x2d')];_0x27ffb9+=0x1){var _0x37201d=this[_0xbb25('0x23')](_0x561936[_0x27ffb9]);if(this[_0x561936[_0x27ffb9]+_0xbb25('0x2e')]!==_0x37201d){this[_0x561936[_0x27ffb9]+_0xbb25('0x2f')]=_[_0xbb25('0x30')](moment()['format']('x'));}this[_0x561936[_0x27ffb9]+'Status']=_0x37201d;}var _0x1276d7={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xbb25('0x8')],'chatPause':this[_0xbb25('0x31')],'mailPause':this[_0xbb25('0x9')],'smsPause':this[_0xbb25('0xb')],'faxPause':this[_0xbb25('0xa')],'openchannelPause':this[_0xbb25('0xc')],'chatStatus':this[_0xbb25('0xd')],'chatStatusTime':this[_0xbb25('0x32')],'chatCapacity':this[_0xbb25('0x33')],'chatCurrentCapacity':this[_0xbb25('0xf')],'mailStatus':this[_0xbb25('0x34')],'mailStatusTime':this[_0xbb25('0x10')],'mailCapacity':this[_0xbb25('0x11')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xbb25('0x13')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xbb25('0x15')],'faxCurrentCapacity':this[_0xbb25('0x16')],'smsStatus':this[_0xbb25('0x35')],'smsStatusTime':this[_0xbb25('0x36')],'smsCapacity':this[_0xbb25('0x17')],'smsCurrentCapacity':this[_0xbb25('0x18')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xbb25('0x1a')],'whatsappCapacity':this[_0xbb25('0x1b')],'whatsappCurrentCapacity':this[_0xbb25('0x1c')],'openchannelStatus':this[_0xbb25('0x1d')],'openchannelStatusTime':this[_0xbb25('0x1e')],'openchannelCapacity':this[_0xbb25('0x1f')],'openchannelCurrentCapacity':this[_0xbb25('0x20')],'busy':this['busy'],'busyQueue':this[_0xbb25('0x37')]};var _0x5b219f=md5(JSON[_0xbb25('0x38')](_0x1276d7));if(this[_0xbb25('0x1')]!==_0x5b219f){this[_0xbb25('0x1')]=_0x5b219f;io[_0xbb25('0x39')](_0xbb25('0x3a'),_0x1276d7);}};module[_0xbb25('0x3b')]=Agent; \ No newline at end of file +var _0x3e30=['faxCurrentCapacity','smsStatusTime','openchannelStatusTime','busyQueue','stringify','emit','user:save','lodash','moment','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','idle','chat','openchannel','fax','whatsapp','length','Status','StatusTime','toNumber','format'];(function(_0x156784,_0x41f00d){var _0x277951=function(_0x24de86){while(--_0x24de86){_0x156784['push'](_0x156784['shift']());}};_0x277951(++_0x41f00d);}(_0x3e30,0x12e));var _0x03e3=function(_0x2ddf0c,_0x134849){_0x2ddf0c=_0x2ddf0c-0x0;var _0x1cb3d2=_0x3e30[_0x2ddf0c];return _0x1cb3d2;};'use strict';var _=require(_0x03e3('0x0'));var moment=require(_0x03e3('0x1'));var md5=require(_0x03e3('0x2'));var Redis=require('ioredis');var config=require(_0x03e3('0x3'));config[_0x03e3('0x4')]=_[_0x03e3('0x5')](config[_0x03e3('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x03e3('0x6'))(new Redis(config[_0x03e3('0x4')]));function Agent(_0x2f304f){this['id']=_0x2f304f['id']||0x0;this['name']=_0x2f304f[_0x03e3('0x7')]||'';this[_0x03e3('0x8')]=_0x2f304f['online']||!![];this['voicePause']=_0x2f304f[_0x03e3('0x9')]||![];this[_0x03e3('0xa')]=_0x2f304f[_0x03e3('0xa')]||![];this[_0x03e3('0xb')]=_0x2f304f['mailPause']||![];this[_0x03e3('0xc')]=_0x2f304f[_0x03e3('0xc')]||![];this[_0x03e3('0xd')]=_0x2f304f[_0x03e3('0xd')]||![];this[_0x03e3('0xe')]=_0x2f304f[_0x03e3('0xe')]||![];this[_0x03e3('0xf')]='unknown';this[_0x03e3('0x10')]=0x0;this[_0x03e3('0x11')]=_0x2f304f[_0x03e3('0x11')]||0x0;this[_0x03e3('0x12')]=0x0;this[_0x03e3('0x13')]=_0x03e3('0x14');this[_0x03e3('0x15')]=0x0;this['mailCapacity']=_0x2f304f[_0x03e3('0x16')]||0x0;this[_0x03e3('0x17')]=0x0;this[_0x03e3('0x18')]=_0x03e3('0x14');this[_0x03e3('0x19')]=0x0;this[_0x03e3('0x1a')]=_0x2f304f[_0x03e3('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x03e3('0x1b')]=_0x03e3('0x14');this['smsStatusTime']=0x0;this[_0x03e3('0x1c')]=_0x2f304f['smsCapacity']||0x0;this[_0x03e3('0x1d')]=0x0;this[_0x03e3('0x1e')]='unknown';this[_0x03e3('0x1f')]=0x0;this[_0x03e3('0x20')]=_0x2f304f[_0x03e3('0x20')]||0x0;this[_0x03e3('0x21')]=0x0;this[_0x03e3('0x22')]=_0x03e3('0x14');this['openchannelStatusTime']=0x0;this[_0x03e3('0x23')]=_0x2f304f['openchannelCapacity']||0x0;this[_0x03e3('0x24')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x03e3('0x2')]='';this[_0x03e3('0x25')]();}Agent[_0x03e3('0x26')][_0x03e3('0x27')]=function(_0x114725){if(this[_0x114725+_0x03e3('0x28')]>0x0){if(this[_0x114725+_0x03e3('0x29')]>0x0&&this[_0x114725+_0x03e3('0x28')]>=this[_0x114725+_0x03e3('0x29')]){return'maxcapacity';}else{return'working';}}else{return _0x03e3('0x2a');}};Agent[_0x03e3('0x26')][_0x03e3('0x25')]=function(){var _0x2267d9=['mail',_0x03e3('0x2b'),_0x03e3('0x2c'),_0x03e3('0x2d'),'sms',_0x03e3('0x2e')];for(var _0x33632f=0x0;_0x33632f<_0x2267d9[_0x03e3('0x2f')];_0x33632f+=0x1){var _0x548caa=this[_0x03e3('0x27')](_0x2267d9[_0x33632f]);if(this[_0x2267d9[_0x33632f]+_0x03e3('0x30')]!==_0x548caa){this[_0x2267d9[_0x33632f]+_0x03e3('0x31')]=_[_0x03e3('0x32')](moment()[_0x03e3('0x33')]('x'));}this[_0x2267d9[_0x33632f]+'Status']=_0x548caa;}var _0x1ba688={'id':this['id'],'name':this['name'],'online':this[_0x03e3('0x8')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x03e3('0xd')],'faxPause':this[_0x03e3('0xc')],'openchannelPause':this[_0x03e3('0xe')],'chatStatus':this[_0x03e3('0xf')],'chatStatusTime':this[_0x03e3('0x10')],'chatCapacity':this[_0x03e3('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x03e3('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x03e3('0x17')],'faxStatus':this[_0x03e3('0x18')],'faxStatusTime':this[_0x03e3('0x19')],'faxCapacity':this[_0x03e3('0x1a')],'faxCurrentCapacity':this[_0x03e3('0x34')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x03e3('0x35')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x03e3('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x03e3('0x20')],'whatsappCurrentCapacity':this[_0x03e3('0x21')],'openchannelStatus':this[_0x03e3('0x22')],'openchannelStatusTime':this[_0x03e3('0x36')],'openchannelCapacity':this[_0x03e3('0x23')],'openchannelCurrentCapacity':this[_0x03e3('0x24')],'busy':this['busy'],'busyQueue':this[_0x03e3('0x37')]};var _0x1dd100=md5(JSON[_0x03e3('0x38')](_0x1ba688));if(this['md5']!==_0x1dd100){this[_0x03e3('0x2')]=_0x1dd100;io[_0x03e3('0x39')](_0x03e3('0x3a'),_0x1ba688);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 91c2922..5c112c1 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 _0x7624=['chat:queue:%s','chat_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','chatPause','paused','available','stringify','format'];(function(_0x515362,_0x1d853c){var _0x4d7b5c=function(_0x562f5f){while(--_0x562f5f){_0x515362['push'](_0x515362['shift']());}};_0x4d7b5c(++_0x1d853c);}(_0x7624,0x196));var _0x4762=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7624[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x4762('0x0'));var md5=require('md5');var util=require(_0x4762('0x1'));var Redis=require('ioredis');var config=require(_0x4762('0x2'));config[_0x4762('0x3')]=_[_0x4762('0x4')](config['redis'],{'host':_0x4762('0x5'),'port':0x18eb});var io=require(_0x4762('0x6'))(new Redis(config[_0x4762('0x3')]));function ChatQueue(_0x5b0e4d){this['id']=_0x5b0e4d['id']||0x0;this['name']=_0x5b0e4d[_0x4762('0x7')]||'';this[_0x4762('0x8')]=_0x5b0e4d[_0x4762('0x8')]||0xa;this[_0x4762('0x9')]=_0x5b0e4d[_0x4762('0x9')]||_0x4762('0xa');this['Agents']=_0x5b0e4d[_0x4762('0xb')];this[_0x4762('0xc')]={};this[_0x4762('0xd')]=0x0;this[_0x4762('0xe')]='';this[_0x4762('0xf')]();this[_0x4762('0x10')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x25cec2=this[_0x4762('0xc')][_0x4762('0x11')];this[_0x4762('0xc')]=_[_0x4762('0x12')](this[_0x4762('0xb')],'id');this[_0x4762('0xc')][_0x4762('0x11')]=_0x25cec2;};ChatQueue[_0x4762('0x13')][_0x4762('0x10')]=function(){this[_0x4762('0x14')]=0x0;this['paused']=0x0;for(var _0x549477=0x0;_0x549477=0x0?this['available']:0x0;var _0x43eecd={'id':this['id'],'available':this[_0x4762('0x19')],'loggedIn':this['loggedIn'],'name':this[_0x4762('0x7')],'paused':this[_0x4762('0x18')],'waiting':this[_0x4762('0xd')]};var _0xf7c95=md5(JSON[_0x4762('0x1a')](_0x43eecd));if(this[_0x4762('0xe')]!==_0xf7c95){this[_0x4762('0xe')]=_0xf7c95;io['to'](util[_0x4762('0x1b')](_0x4762('0x1c'),_0x43eecd[_0x4762('0x7')]))['emit'](_0x4762('0x1d'),_0x43eecd);}};module[_0x4762('0x1e')]=ChatQueue; \ No newline at end of file +var _0x6d52=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s','emit','exports','lodash','md5','util'];(function(_0x32b260,_0x5b128f){var _0x354d8f=function(_0x253c79){while(--_0x253c79){_0x32b260['push'](_0x32b260['shift']());}};_0x354d8f(++_0x5b128f);}(_0x6d52,0x114));var _0x26d5=function(_0x4d996a,_0x358bd2){_0x4d996a=_0x4d996a-0x0;var _0x2dd100=_0x6d52[_0x4d996a];return _0x2dd100;};'use strict';var _=require(_0x26d5('0x0'));var md5=require(_0x26d5('0x1'));var util=require(_0x26d5('0x2'));var Redis=require(_0x26d5('0x3'));var config=require(_0x26d5('0x4'));config[_0x26d5('0x5')]=_[_0x26d5('0x6')](config[_0x26d5('0x5')],{'host':_0x26d5('0x7'),'port':0x18eb});var io=require(_0x26d5('0x8'))(new Redis(config['redis']));function ChatQueue(_0x1a5b7f){this['id']=_0x1a5b7f['id']||0x0;this[_0x26d5('0x9')]=_0x1a5b7f[_0x26d5('0x9')]||'';this[_0x26d5('0xa')]=_0x1a5b7f[_0x26d5('0xa')]||0xa;this['strategy']=_0x1a5b7f[_0x26d5('0xb')]||_0x26d5('0xc');this[_0x26d5('0xd')]=_0x1a5b7f[_0x26d5('0xd')];this[_0x26d5('0xe')]={};this[_0x26d5('0xf')]=0x0;this[_0x26d5('0x1')]='';this[_0x26d5('0x10')]();this[_0x26d5('0x11')]();}ChatQueue[_0x26d5('0x12')][_0x26d5('0x10')]=function(){var _0x1558be=this[_0x26d5('0xe')][_0x26d5('0x13')];this[_0x26d5('0xe')]=_[_0x26d5('0x14')](this[_0x26d5('0xd')],'id');this[_0x26d5('0xe')][_0x26d5('0x13')]=_0x1558be;};ChatQueue['prototype'][_0x26d5('0x11')]=function(){this[_0x26d5('0x15')]=0x0;this[_0x26d5('0x16')]=0x0;for(var _0x1a5571=0x0;_0x1a5571=0x0?this[_0x26d5('0x1a')]:0x0;var _0x281c95={'id':this['id'],'available':this['available'],'loggedIn':this[_0x26d5('0x15')],'name':this[_0x26d5('0x9')],'paused':this[_0x26d5('0x16')],'waiting':this[_0x26d5('0xf')]};var _0x2104d7=md5(JSON[_0x26d5('0x1b')](_0x281c95));if(this[_0x26d5('0x1')]!==_0x2104d7){this[_0x26d5('0x1')]=_0x2104d7;io['to'](util['format'](_0x26d5('0x1c'),_0x281c95[_0x26d5('0x9')]))[_0x26d5('0x1d')]('chat_queue:save',_0x281c95);}};module[_0x26d5('0x1e')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 60c59fc..2bf74e0 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 _0xf621=['stringify','md5','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','faxPause','available','paused','waiting'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xf621,0x163));var _0x1f62=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xf621[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0x1f62('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x1f62('0x1'));var config=require('../../../config/environment');config[_0x1f62('0x2')]=_[_0x1f62('0x3')](config[_0x1f62('0x2')],{'host':_0x1f62('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x3ad671){this['id']=_0x3ad671['id']||0x0;this[_0x1f62('0x5')]=_0x3ad671[_0x1f62('0x5')]||'';this['timeout']=_0x3ad671[_0x1f62('0x6')]||0xa;this['strategy']=_0x3ad671[_0x1f62('0x7')]||_0x1f62('0x8');this[_0x1f62('0x9')]=_0x3ad671[_0x1f62('0x9')];this[_0x1f62('0xa')]={};this['waiting']=0x0;this['md5']='';this[_0x1f62('0xb')]();this['updateRealtime']();}FaxQueue[_0x1f62('0xc')][_0x1f62('0xb')]=function(){var _0x2e679c=this['mapAgentsId'][_0x1f62('0xd')];this['mapAgentsId']=_[_0x1f62('0xe')](this[_0x1f62('0x9')],'id');this[_0x1f62('0xa')][_0x1f62('0xd')]=_0x2e679c;};FaxQueue[_0x1f62('0xc')][_0x1f62('0xf')]=function(){this[_0x1f62('0x10')]=0x0;this['paused']=0x0;for(var _0x542453=0x0;_0x542453=0x0?this[_0x1f62('0x13')]:0x0;var _0x506aa2={'id':this['id'],'available':this[_0x1f62('0x13')],'loggedIn':this[_0x1f62('0x10')],'name':this[_0x1f62('0x5')],'paused':this[_0x1f62('0x14')],'waiting':this[_0x1f62('0x15')]};var _0x43816e=md5(JSON[_0x1f62('0x16')](_0x506aa2));if(this[_0x1f62('0x17')]!==_0x43816e){this[_0x1f62('0x17')]=_0x43816e;io['to'](util[_0x1f62('0x18')](_0x1f62('0x19'),_0x506aa2[_0x1f62('0x5')]))[_0x1f62('0x1a')](_0x1f62('0x1b'),_0x506aa2);}};module[_0x1f62('0x1c')]=FaxQueue; \ No newline at end of file +var _0xe897=['updateRealtime','loggedIn','paused','length','online','available','stringify','fax:queue:%s','exports','md5','ioredis','../../../config/environment','redis','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting'];(function(_0x15d76b,_0xff1299){var _0x2ca157=function(_0x2e7882){while(--_0x2e7882){_0x15d76b['push'](_0x15d76b['shift']());}};_0x2ca157(++_0xff1299);}(_0xe897,0x72));var _0x7e89=function(_0x4b735f,_0x499cac){_0x4b735f=_0x4b735f-0x0;var _0x57eb76=_0xe897[_0x4b735f];return _0x57eb76;};'use strict';var _=require('lodash');var md5=require(_0x7e89('0x0'));var util=require('util');var Redis=require(_0x7e89('0x1'));var config=require(_0x7e89('0x2'));config[_0x7e89('0x3')]=_['defaults'](config[_0x7e89('0x3')],{'host':_0x7e89('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x56c51c){this['id']=_0x56c51c['id']||0x0;this[_0x7e89('0x5')]=_0x56c51c['name']||'';this[_0x7e89('0x6')]=_0x56c51c[_0x7e89('0x6')]||0xa;this['strategy']=_0x56c51c['strategy']||_0x7e89('0x7');this[_0x7e89('0x8')]=_0x56c51c['Agents'];this[_0x7e89('0x9')]={};this[_0x7e89('0xa')]=0x0;this[_0x7e89('0x0')]='';this[_0x7e89('0xb')]();this[_0x7e89('0xc')]();}FaxQueue['prototype'][_0x7e89('0xb')]=function(){var _0x2a974e=this['mapAgentsId']['_rr'];this[_0x7e89('0x9')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x2a974e;};FaxQueue['prototype'][_0x7e89('0xc')]=function(){this[_0x7e89('0xd')]=0x0;this[_0x7e89('0xe')]=0x0;for(var _0x2d2ee5=0x0;_0x2d2ee5=0x0?this[_0x7e89('0x11')]:0x0;var _0x24defb={'id':this['id'],'available':this[_0x7e89('0x11')],'loggedIn':this[_0x7e89('0xd')],'name':this[_0x7e89('0x5')],'paused':this['paused'],'waiting':this[_0x7e89('0xa')]};var _0x573e69=md5(JSON[_0x7e89('0x12')](_0x24defb));if(this[_0x7e89('0x0')]!==_0x573e69){this[_0x7e89('0x0')]=_0x573e69;io['to'](util['format'](_0x7e89('0x13'),_0x24defb[_0x7e89('0x5')]))['emit']('fax_queue:save',_0x24defb);}};module[_0x7e89('0x14')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 491638b..4f317ab 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 _0xfeba=['name','Intervals','exports'];(function(_0x2a3901,_0x12fcc7){var _0x32d9bc=function(_0x11b38b){while(--_0x11b38b){_0x2a3901['push'](_0x2a3901['shift']());}};_0x32d9bc(++_0x12fcc7);}(_0xfeba,0x17d));var _0xafeb=function(_0x2f7c1c,_0x99e46d){_0x2f7c1c=_0x2f7c1c-0x0;var _0x257a47=_0xfeba[_0x2f7c1c];return _0x257a47;};'use strict';function Interval(_0x31938f){this['id']=_0x31938f['id']||0x0;this[_0xafeb('0x0')]=_0x31938f['name']||'';this[_0xafeb('0x1')]=_0x31938f[_0xafeb('0x1')]||{};}module[_0xafeb('0x2')]=Interval; \ No newline at end of file +var _0x07ef=['name','Intervals','exports'];(function(_0x16a2f1,_0x267357){var _0x7f2ce7=function(_0x3a5689){while(--_0x3a5689){_0x16a2f1['push'](_0x16a2f1['shift']());}};_0x7f2ce7(++_0x267357);}(_0x07ef,0x183));var _0xf07e=function(_0x434467,_0x2c6a75){_0x434467=_0x434467-0x0;var _0x5248ba=_0x07ef[_0x434467];return _0x5248ba;};'use strict';function Interval(_0x2755a4){this['id']=_0x2755a4['id']||0x0;this[_0xf07e('0x0')]=_0x2755a4[_0xf07e('0x0')]||'';this[_0xf07e('0x1')]=_0x2755a4[_0xf07e('0x1')]||{};}module[_0xf07e('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 94c3937..6b2d3a8 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 _0x37d3=['../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','length','online','mailPause','paused','available','stringify','format','emit','mail_queue:save','lodash','md5','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37d3,0x192));var _0x337d=function(_0x58c3ff,_0x124777){_0x58c3ff=_0x58c3ff-0x0;var _0x4e5a30=_0x37d3[_0x58c3ff];return _0x4e5a30;};'use strict';var _=require(_0x337d('0x0'));var md5=require(_0x337d('0x1'));var util=require(_0x337d('0x2'));var Redis=require('ioredis');var config=require(_0x337d('0x3'));config[_0x337d('0x4')]=_[_0x337d('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x337d('0x4')]));function MailQueue(_0x36a5cb){this['id']=_0x36a5cb['id']||0x0;this[_0x337d('0x6')]=_0x36a5cb[_0x337d('0x6')]||'';this[_0x337d('0x7')]=_0x36a5cb[_0x337d('0x7')]||0xa;this[_0x337d('0x8')]=_0x36a5cb['strategy']||_0x337d('0x9');this[_0x337d('0xa')]=_0x36a5cb[_0x337d('0xa')];this[_0x337d('0xb')]={};this[_0x337d('0xc')]=0x0;this[_0x337d('0x1')]='';this[_0x337d('0xd')]();this[_0x337d('0xe')]();}MailQueue[_0x337d('0xf')][_0x337d('0xd')]=function(){var _0x28e5a0=this[_0x337d('0xb')]['_rr'];this[_0x337d('0xb')]=_[_0x337d('0x10')](this[_0x337d('0xa')],'id');this[_0x337d('0xb')]['_rr']=_0x28e5a0;};MailQueue['prototype']['updateRealtime']=function(){this[_0x337d('0x11')]=0x0;this['paused']=0x0;for(var _0x6a28ec=0x0;_0x6a28ec=0x0?this[_0x337d('0x16')]:0x0;var _0x4d07cb={'id':this['id'],'available':this[_0x337d('0x16')],'loggedIn':this[_0x337d('0x11')],'name':this[_0x337d('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x52e5bd=md5(JSON[_0x337d('0x17')](_0x4d07cb));if(this[_0x337d('0x1')]!==_0x52e5bd){this[_0x337d('0x1')]=_0x52e5bd;io['to'](util[_0x337d('0x18')]('mail:queue:%s',_0x4d07cb[_0x337d('0x6')]))[_0x337d('0x19')](_0x337d('0x1a'),_0x4d07cb);}};module['exports']=MailQueue; \ No newline at end of file +var _0xd7c2=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','updateRealtime','loggedIn','paused','online','available','stringify','format','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults'];(function(_0x201f40,_0x548741){var _0x382401=function(_0x44735b){while(--_0x44735b){_0x201f40['push'](_0x201f40['shift']());}};_0x382401(++_0x548741);}(_0xd7c2,0x1c5));var _0x2d7c=function(_0x1209cb,_0x1491d3){_0x1209cb=_0x1209cb-0x0;var _0x8badb8=_0xd7c2[_0x1209cb];return _0x8badb8;};'use strict';var _=require(_0x2d7c('0x0'));var md5=require(_0x2d7c('0x1'));var util=require(_0x2d7c('0x2'));var Redis=require(_0x2d7c('0x3'));var config=require('../../../config/environment');config[_0x2d7c('0x4')]=_[_0x2d7c('0x5')](config[_0x2d7c('0x4')],{'host':_0x2d7c('0x6'),'port':0x18eb});var io=require(_0x2d7c('0x7'))(new Redis(config['redis']));function MailQueue(_0x3d9662){this['id']=_0x3d9662['id']||0x0;this[_0x2d7c('0x8')]=_0x3d9662['name']||'';this[_0x2d7c('0x9')]=_0x3d9662[_0x2d7c('0x9')]||0xa;this[_0x2d7c('0xa')]=_0x3d9662[_0x2d7c('0xa')]||_0x2d7c('0xb');this[_0x2d7c('0xc')]=_0x3d9662[_0x2d7c('0xc')];this[_0x2d7c('0xd')]={};this[_0x2d7c('0xe')]=0x0;this[_0x2d7c('0x1')]='';this[_0x2d7c('0xf')]();this['updateRealtime']();}MailQueue['prototype']['updateRouting']=function(){var _0x392240=this['mapAgentsId'][_0x2d7c('0x10')];this[_0x2d7c('0xd')]=_['map'](this[_0x2d7c('0xc')],'id');this[_0x2d7c('0xd')][_0x2d7c('0x10')]=_0x392240;};MailQueue['prototype'][_0x2d7c('0x11')]=function(){this[_0x2d7c('0x12')]=0x0;this[_0x2d7c('0x13')]=0x0;for(var _0x55894a=0x0;_0x55894a=0x0?this[_0x2d7c('0x15')]:0x0;var _0x5c34b0={'id':this['id'],'available':this[_0x2d7c('0x15')],'loggedIn':this[_0x2d7c('0x12')],'name':this[_0x2d7c('0x8')],'paused':this[_0x2d7c('0x13')],'waiting':this[_0x2d7c('0xe')]};var _0x4ed1ee=md5(JSON[_0x2d7c('0x16')](_0x5c34b0));if(this[_0x2d7c('0x1')]!==_0x4ed1ee){this[_0x2d7c('0x1')]=_0x4ed1ee;io['to'](util[_0x2d7c('0x17')]('mail:queue:%s',_0x5c34b0['name']))[_0x2d7c('0x18')](_0x2d7c('0x19'),_0x5c34b0);}};module[_0x2d7c('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f6c1f1e..4cbf2c8 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x45b2d0,_0x2c9af9){_0x45b2d0=_0x45b2d0-0x0;var _0x12d777=_0x7a54[_0x45b2d0];return _0x12d777;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x326f,0xd1));var _0xf326=function(_0x2177cb,_0x121c38){_0x2177cb=_0x2177cb-0x0;var _0x31d817=_0x326f[_0x2177cb];return _0x31d817;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 43eb2c8..d367ba2 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 _0x49e9=['exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x949e('0x0'));var md5=require(_0x949e('0x1'));var util=require('util');var Redis=require(_0x949e('0x2'));var config=require(_0x949e('0x3'));config[_0x949e('0x4')]=_['defaults'](config['redis'],{'host':_0x949e('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x949e('0x4')]));function SmsQueue(_0xb1aae0){this['id']=_0xb1aae0['id']||0x0;this[_0x949e('0x6')]=_0xb1aae0['name']||'';this[_0x949e('0x7')]=_0xb1aae0[_0x949e('0x7')]||0xa;this[_0x949e('0x8')]=_0xb1aae0[_0x949e('0x8')]||_0x949e('0x9');this[_0x949e('0xa')]=_0xb1aae0[_0x949e('0xa')];this['mapAgentsId']={};this[_0x949e('0xb')]=0x0;this['md5']='';this[_0x949e('0xc')]();this[_0x949e('0xd')]();}SmsQueue[_0x949e('0xe')]['updateRouting']=function(){var _0x2e401f=this[_0x949e('0xf')][_0x949e('0x10')];this[_0x949e('0xf')]=_[_0x949e('0x11')](this[_0x949e('0xa')],'id');this[_0x949e('0xf')][_0x949e('0x10')]=_0x2e401f;};SmsQueue[_0x949e('0xe')][_0x949e('0xd')]=function(){this[_0x949e('0x12')]=0x0;this[_0x949e('0x13')]=0x0;for(var _0x3e0e54=0x0;_0x3e0e54=0x0?this[_0x949e('0x17')]:0x0;var _0x868913={'id':this['id'],'available':this[_0x949e('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x949e('0x6')],'paused':this[_0x949e('0x13')],'waiting':this[_0x949e('0xb')]};var _0x2f0f57=md5(JSON[_0x949e('0x18')](_0x868913));if(this[_0x949e('0x1')]!==_0x2f0f57){this[_0x949e('0x1')]=_0x2f0f57;io['to'](util[_0x949e('0x19')](_0x949e('0x1a'),_0x868913[_0x949e('0x6')]))[_0x949e('0x1b')](_0x949e('0x1c'),_0x868913);}};module[_0x949e('0x1d')]=SmsQueue; \ No newline at end of file +var _0x2e35=['redis','defaults','socket.io-emitter','name','strategy','Agents','waiting','updateRealtime','updateRouting','mapAgentsId','map','length','online','loggedIn','smsPause','paused','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','../../../config/environment'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0x2e35,0x1d0));var _0x52e3=function(_0x57bc5f,_0x13691f){_0x57bc5f=_0x57bc5f-0x0;var _0x551301=_0x2e35[_0x57bc5f];return _0x551301;};'use strict';var _=require(_0x52e3('0x0'));var md5=require(_0x52e3('0x1'));var util=require(_0x52e3('0x2'));var Redis=require('ioredis');var config=require(_0x52e3('0x3'));config[_0x52e3('0x4')]=_[_0x52e3('0x5')](config[_0x52e3('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x52e3('0x6'))(new Redis(config[_0x52e3('0x4')]));function SmsQueue(_0x1f6987){this['id']=_0x1f6987['id']||0x0;this[_0x52e3('0x7')]=_0x1f6987['name']||'';this['timeout']=_0x1f6987['timeout']||0xa;this[_0x52e3('0x8')]=_0x1f6987['strategy']||'beepall';this[_0x52e3('0x9')]=_0x1f6987[_0x52e3('0x9')];this['mapAgentsId']={};this[_0x52e3('0xa')]=0x0;this[_0x52e3('0x1')]='';this['updateRouting']();this[_0x52e3('0xb')]();}SmsQueue['prototype'][_0x52e3('0xc')]=function(){var _0x10f70f=this[_0x52e3('0xd')]['_rr'];this[_0x52e3('0xd')]=_[_0x52e3('0xe')](this['Agents'],'id');this[_0x52e3('0xd')]['_rr']=_0x10f70f;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x105c80=0x0;_0x105c80=0x0?this['available']:0x0;var _0x3088a2={'id':this['id'],'available':this[_0x52e3('0x14')],'loggedIn':this[_0x52e3('0x11')],'name':this[_0x52e3('0x7')],'paused':this[_0x52e3('0x13')],'waiting':this[_0x52e3('0xa')]};var _0x3f628a=md5(JSON[_0x52e3('0x15')](_0x3088a2));if(this[_0x52e3('0x1')]!==_0x3f628a){this[_0x52e3('0x1')]=_0x3f628a;io['to'](util[_0x52e3('0x16')](_0x52e3('0x17'),_0x3088a2[_0x52e3('0x7')]))[_0x52e3('0x18')](_0x52e3('0x19'),_0x3088a2);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index fe25fa5..b17fbc2 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf0b=['online','available','format','whatsapp:queue:%s','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','loggedIn','paused','length'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdf0b,0x155));var _0xbdf0=function(_0x5c6b27,_0xe5a2ea){_0x5c6b27=_0x5c6b27-0x0;var _0x44d081=_0xdf0b[_0x5c6b27];return _0x44d081;};'use strict';var _=require(_0xbdf0('0x0'));var md5=require(_0xbdf0('0x1'));var util=require(_0xbdf0('0x2'));var Redis=require(_0xbdf0('0x3'));var config=require(_0xbdf0('0x4'));config[_0xbdf0('0x5')]=_[_0xbdf0('0x6')](config['redis'],{'host':_0xbdf0('0x7'),'port':0x18eb});var io=require(_0xbdf0('0x8'))(new Redis(config[_0xbdf0('0x5')]));function WhatsappQueue(_0x4f5346){this['id']=_0x4f5346['id']||0x0;this['name']=_0x4f5346[_0xbdf0('0x9')]||'';this[_0xbdf0('0xa')]=_0x4f5346['timeout']||0xa;this['strategy']=_0x4f5346[_0xbdf0('0xb')]||_0xbdf0('0xc');this[_0xbdf0('0xd')]=_0x4f5346[_0xbdf0('0xd')];this[_0xbdf0('0xe')]={};this[_0xbdf0('0xf')]=0x0;this['md5']='';this[_0xbdf0('0x10')]();this['updateRealtime']();}WhatsappQueue[_0xbdf0('0x11')][_0xbdf0('0x10')]=function(){var _0x27fa23=this[_0xbdf0('0xe')][_0xbdf0('0x12')];this[_0xbdf0('0xe')]=_[_0xbdf0('0x13')](this[_0xbdf0('0xd')],'id');this['mapAgentsId']['_rr']=_0x27fa23;};WhatsappQueue[_0xbdf0('0x11')]['updateRealtime']=function(){this[_0xbdf0('0x14')]=0x0;this[_0xbdf0('0x15')]=0x0;for(var _0x5c324f=0x0;_0x5c324f=0x0?this[_0xbdf0('0x18')]:0x0;var _0x5729d0={'id':this['id'],'available':this[_0xbdf0('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xbdf0('0x15')],'waiting':this[_0xbdf0('0xf')]};var _0x2283a7=md5(JSON['stringify'](_0x5729d0));if(this[_0xbdf0('0x1')]!==_0x2283a7){this[_0xbdf0('0x1')]=_0x2283a7;io['to'](util[_0xbdf0('0x19')](_0xbdf0('0x1a'),_0x5729d0[_0xbdf0('0x9')]))['emit'](_0xbdf0('0x1b'),_0x5729d0);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x8650=['Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8650,0x6b));var _0x0865=function(_0x25c2a2,_0x56fdd3){_0x25c2a2=_0x25c2a2-0x0;var _0x2cc6df=_0x8650[_0x25c2a2];return _0x2cc6df;};'use strict';var _=require(_0x0865('0x0'));var md5=require(_0x0865('0x1'));var util=require(_0x0865('0x2'));var Redis=require(_0x0865('0x3'));var config=require(_0x0865('0x4'));config[_0x0865('0x5')]=_[_0x0865('0x6')](config[_0x0865('0x5')],{'host':_0x0865('0x7'),'port':0x18eb});var io=require(_0x0865('0x8'))(new Redis(config[_0x0865('0x5')]));function WhatsappQueue(_0x4f0939){this['id']=_0x4f0939['id']||0x0;this[_0x0865('0x9')]=_0x4f0939['name']||'';this[_0x0865('0xa')]=_0x4f0939[_0x0865('0xa')]||0xa;this[_0x0865('0xb')]=_0x4f0939[_0x0865('0xb')]||_0x0865('0xc');this[_0x0865('0xd')]=_0x4f0939['Agents'];this[_0x0865('0xe')]={};this[_0x0865('0xf')]=0x0;this[_0x0865('0x1')]='';this['updateRouting']();this[_0x0865('0x10')]();}WhatsappQueue[_0x0865('0x11')][_0x0865('0x12')]=function(){var _0x2d203b=this['mapAgentsId'][_0x0865('0x13')];this[_0x0865('0xe')]=_['map'](this[_0x0865('0xd')],'id');this['mapAgentsId'][_0x0865('0x13')]=_0x2d203b;};WhatsappQueue['prototype'][_0x0865('0x10')]=function(){this[_0x0865('0x14')]=0x0;this[_0x0865('0x15')]=0x0;for(var _0x2600d7=0x0;_0x2600d7=0x0?this['available']:0x0;var _0x428c33={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0865('0x14')],'name':this['name'],'paused':this[_0x0865('0x15')],'waiting':this[_0x0865('0xf')]};var _0x513698=md5(JSON[_0x0865('0x19')](_0x428c33));if(this[_0x0865('0x1')]!==_0x513698){this[_0x0865('0x1')]=_0x513698;io['to'](util[_0x0865('0x1a')](_0x0865('0x1b'),_0x428c33[_0x0865('0x9')]))[_0x0865('0x1c')](_0x0865('0x1d'),_0x428c33);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 652ead3..850a0d1 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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 5024307..5f58f23 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 _0x55d1=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x232583,_0x44bdb5){var _0x49ddc1=function(_0x134f3f){while(--_0x134f3f){_0x232583['push'](_0x232583['shift']());}};_0x49ddc1(++_0x44bdb5);}(_0x55d1,0xec));var _0x155d=function(_0x1cce35,_0x4fd31a){_0x1cce35=_0x1cce35-0x0;var _0x172b90=_0x55d1[_0x1cce35];return _0x172b90;};'use strict';var client=require(_0x155d('0x0'));exports[_0x155d('0x1')]=function(_0x20c292,_0x27ea5a){return client[_0x155d('0x2')](_0x155d('0x3'),{'body':_0x27ea5a,'options':{'where':{'id':_0x20c292}},'log':_0x155d('0x4')});};exports[_0x155d('0x5')]=function(_0xc4a4a1,_0x20eb8e){return client['Request'](_0x155d('0x6'),{'body':_0x20eb8e,'options':{'where':{'id':_0xc4a4a1}},'log':_0x155d('0x7')});}; \ No newline at end of file +var _0x41f7=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client','update','Request'];(function(_0x4e5e6c,_0x959eb4){var _0xcf9053=function(_0x3bce18){while(--_0x3bce18){_0x4e5e6c['push'](_0x4e5e6c['shift']());}};_0xcf9053(++_0x959eb4);}(_0x41f7,0x7b));var _0x741f=function(_0x4d9816,_0x5c5aaf){_0x4d9816=_0x4d9816-0x0;var _0x3ed66f=_0x41f7[_0x4d9816];return _0x3ed66f;};'use strict';var client=require(_0x741f('0x0'));exports[_0x741f('0x1')]=function(_0x41555b,_0x7790cd){return client[_0x741f('0x2')](_0x741f('0x3'),{'body':_0x7790cd,'options':{'where':{'id':_0x41555b}},'log':_0x741f('0x4')});};exports[_0x741f('0x5')]=function(_0x1c53f3,_0x2d1fb2){return client[_0x741f('0x2')](_0x741f('0x6'),{'body':_0x2d1fb2,'options':{'where':{'id':_0x1c53f3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ca2f8ab..2c9a11d 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 _0x2b7e=['Request','create'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x2b7e,0x11f));var _0xe2b7=function(_0x4cd456,_0x5ed25f){_0x4cd456=_0x4cd456-0x0;var _0x434181=_0x2b7e[_0x4cd456];return _0x434181;};'use strict';var client=require('../client');exports[_0xe2b7('0x0')]=function(_0xfee785){return client[_0xe2b7('0x1')]('CreateChatMessage',{'body':_0xfee785,'log':'createChatMessage'});}; \ No newline at end of file +var _0x15da=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15da,0x124));var _0xa15d=function(_0x316b13,_0x21c7b3){_0x316b13=_0x316b13-0x0;var _0x29ab59=_0x15da[_0x316b13];return _0x29ab59;};'use strict';var client=require(_0xa15d('0x0'));exports[_0xa15d('0x1')]=function(_0x482f51){return client[_0xa15d('0x2')](_0xa15d('0x3'),{'body':_0x482f51,'log':_0xa15d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3db3a68..7b17600 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 _0x2e65=['User','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x3e1ccd,_0x3d3880){var _0x3e02ed=function(_0x45edb0){while(--_0x45edb0){_0x3e1ccd['push'](_0x3e1ccd['shift']());}};_0x3e02ed(++_0x3d3880);}(_0x2e65,0x193));var _0x52e6=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x2e65[_0x468b0f];return _0x3e74d9;};'use strict';var client=require(_0x52e6('0x0'));exports[_0x52e6('0x1')]=function(){return function(){return client[_0x52e6('0x2')](_0x52e6('0x3'),{'options':{'raw':![],'attributes':['id',_0x52e6('0x4'),_0x52e6('0x5'),_0x52e6('0x6')],'include':[{'model':_0x52e6('0x7'),'as':'Agents','attributes':['id',_0x52e6('0x4'),_0x52e6('0x8'),_0x52e6('0x9')]}]},'log':_0x52e6('0x1')});};}; \ No newline at end of file +var _0x95d9=['chatPause','../client','getChatQueues','Request','GetChatQueue','timeout','strategy','User','name','online'];(function(_0x21397a,_0x19977b){var _0x48f419=function(_0x476308){while(--_0x476308){_0x21397a['push'](_0x21397a['shift']());}};_0x48f419(++_0x19977b);}(_0x95d9,0x97));var _0x995d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x95d9[_0xac151d];return _0x111dba;};'use strict';var client=require(_0x995d('0x0'));exports[_0x995d('0x1')]=function(){return function(){return client[_0x995d('0x2')](_0x995d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x995d('0x4'),_0x995d('0x5')],'include':[{'model':_0x995d('0x6'),'as':'Agents','attributes':['id',_0x995d('0x7'),_0x995d('0x8'),_0x995d('0x9')]}]},'log':_0x995d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 33f5530..f0e0b60 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 _0xc5c7=['DESC','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x258199,_0x42adcb){_0x258199=_0x258199-0x0;var _0x5aa047=_0xc5c7[_0x258199];return _0x5aa047;};'use strict';var client=require('../client');exports[_0x7c5c('0x0')]=function(_0x28e1a9){return client[_0x7c5c('0x1')](_0x7c5c('0x2'),{'body':_0x28e1a9,'log':_0x7c5c('0x2')});};exports[_0x7c5c('0x3')]=function(_0x4d3807,_0xff325e){return client[_0x7c5c('0x1')](_0x7c5c('0x4'),{'body':_0xff325e,'options':{'where':{'uniqueid':_0x4d3807},'order':[['id',_0x7c5c('0x5')]],'limit':0x1},'log':_0x7c5c('0x4')});}; \ No newline at end of file +var _0xc678=['Request','CreateChatQueueReport','update','DESC'];(function(_0x9f493f,_0x30c4d8){var _0x827c92=function(_0x35ff1f){while(--_0x35ff1f){_0x9f493f['push'](_0x9f493f['shift']());}};_0x827c92(++_0x30c4d8);}(_0xc678,0x1b4));var _0x8c67=function(_0xf46a3e,_0x51903b){_0xf46a3e=_0xf46a3e-0x0;var _0x30b27b=_0xc678[_0xf46a3e];return _0x30b27b;};'use strict';var client=require('../client');exports['create']=function(_0x3002e5){return client[_0x8c67('0x0')](_0x8c67('0x1'),{'body':_0x3002e5,'log':'CreateChatQueueReport'});};exports[_0x8c67('0x2')]=function(_0x3b01cc,_0xcfea76){return client[_0x8c67('0x0')]('UpdateChatQueueReport',{'body':_0xcfea76,'options':{'where':{'uniqueid':_0x3b01cc},'order':[['id',_0x8c67('0x3')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index c7f763a..c0466c7 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3f758f,_0x302451){var _0x26e4ae=function(_0x54beae){while(--_0x54beae){_0x3f758f['push'](_0x3f758f['shift']());}};_0x26e4ae(++_0x302451);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3ce6b2,_0x1fc0b0){var _0x98a558=function(_0x2031d8){while(--_0x2031d8){_0x3ce6b2['push'](_0x3ce6b2['shift']());}};_0x98a558(++_0x1fc0b0);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 0727c2f..68d9c05 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 _0x5b7c=['../client','create','Request'];(function(_0xd72000,_0x472aa5){var _0x8aaf7c=function(_0x29535c){while(--_0x29535c){_0xd72000['push'](_0xd72000['shift']());}};_0x8aaf7c(++_0x472aa5);}(_0x5b7c,0x120));var _0xc5b7=function(_0x174fff,_0x3b1bc9){_0x174fff=_0x174fff-0x0;var _0x16ad8a=_0x5b7c[_0x174fff];return _0x16ad8a;};'use strict';var client=require(_0xc5b7('0x0'));exports[_0xc5b7('0x1')]=function(_0x23b809){return client[_0xc5b7('0x2')]('CreateFaxMessage',{'body':_0x23b809,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xd997=['create','CreateFaxMessage','createFaxMessage'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xd997,0x1c2));var _0x7d99=function(_0x3d0017,_0x4d0eea){_0x3d0017=_0x3d0017-0x0;var _0x53c942=_0xd997[_0x3d0017];return _0x53c942;};'use strict';var client=require('../client');exports[_0x7d99('0x0')]=function(_0x33cf14){return client['Request'](_0x7d99('0x1'),{'body':_0x33cf14,'log':_0x7d99('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 29ba8e2..9856473 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 _0x4256=['getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause','../client'];(function(_0x5a2fc2,_0x2e8acd){var _0x5c4ee6=function(_0x1f2b3b){while(--_0x1f2b3b){_0x5a2fc2['push'](_0x5a2fc2['shift']());}};_0x5c4ee6(++_0x2e8acd);}(_0x4256,0x154));var _0x6425=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0x4256[_0x254076];return _0x21a93e;};'use strict';var client=require(_0x6425('0x0'));exports[_0x6425('0x1')]=function(){return function(){return client[_0x6425('0x2')](_0x6425('0x3'),{'options':{'raw':![],'attributes':['id',_0x6425('0x4'),_0x6425('0x5'),_0x6425('0x6')],'include':[{'model':_0x6425('0x7'),'as':_0x6425('0x8'),'attributes':['id',_0x6425('0x4'),_0x6425('0x9'),_0x6425('0xa')]}]},'log':_0x6425('0x1')});};}; \ No newline at end of file +var _0x3cf1=['../client','Request','GetFaxQueue','name','strategy','User','Agents','online','getFaxQueues'];(function(_0x57f4c9,_0x34e059){var _0x2a974c=function(_0x2fd75b){while(--_0x2fd75b){_0x57f4c9['push'](_0x57f4c9['shift']());}};_0x2a974c(++_0x34e059);}(_0x3cf1,0x144));var _0x13cf=function(_0x1521d1,_0x3f41db){_0x1521d1=_0x1521d1-0x0;var _0x33b625=_0x3cf1[_0x1521d1];return _0x33b625;};'use strict';var client=require(_0x13cf('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x13cf('0x1')](_0x13cf('0x2'),{'options':{'raw':![],'attributes':['id',_0x13cf('0x3'),'timeout',_0x13cf('0x4')],'include':[{'model':_0x13cf('0x5'),'as':_0x13cf('0x6'),'attributes':['id','name',_0x13cf('0x7'),'faxPause']}]},'log':_0x13cf('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 1fa4fb9..6820bf7 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 _0x7fa0=['Request','CreateFaxQueueReport','UpdateFaxQueueReport','create'];(function(_0x40ad82,_0x7bddb4){var _0x350447=function(_0x396f20){while(--_0x396f20){_0x40ad82['push'](_0x40ad82['shift']());}};_0x350447(++_0x7bddb4);}(_0x7fa0,0x6b));var _0x07fa=function(_0x5338c1,_0xeff4b){_0x5338c1=_0x5338c1-0x0;var _0x44b8eb=_0x7fa0[_0x5338c1];return _0x44b8eb;};'use strict';var client=require('../client');exports[_0x07fa('0x0')]=function(_0x13c25a){return client[_0x07fa('0x1')](_0x07fa('0x2'),{'body':_0x13c25a,'log':_0x07fa('0x2')});};exports['update']=function(_0x2a662a,_0x5f270d){return client[_0x07fa('0x1')](_0x07fa('0x3'),{'body':_0x5f270d,'options':{'where':{'uniqueid':_0x2a662a},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xe51a=['CreateFaxQueueReport','update','DESC','../client','create','Request'];(function(_0x47ad08,_0x28fcd1){var _0x302699=function(_0x45a213){while(--_0x45a213){_0x47ad08['push'](_0x47ad08['shift']());}};_0x302699(++_0x28fcd1);}(_0xe51a,0x9f));var _0xae51=function(_0x22c4ad,_0x6478b6){_0x22c4ad=_0x22c4ad-0x0;var _0x81b639=_0xe51a[_0x22c4ad];return _0x81b639;};'use strict';var client=require(_0xae51('0x0'));exports[_0xae51('0x1')]=function(_0x4495ac){return client[_0xae51('0x2')]('CreateFaxQueueReport',{'body':_0x4495ac,'log':_0xae51('0x3')});};exports[_0xae51('0x4')]=function(_0x570c5e,_0x4d975d){return client[_0xae51('0x2')]('UpdateFaxQueueReport',{'body':_0x4d975d,'options':{'where':{'uniqueid':_0x570c5e},'order':[['id',_0xae51('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 7ae8572..79b8055 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 _0x9045=['GetInterval','name','Intervals','getIntervals','../client'];(function(_0x3aaeaa,_0x359997){var _0xcf3400=function(_0x9369be){while(--_0x9369be){_0x3aaeaa['push'](_0x3aaeaa['shift']());}};_0xcf3400(++_0x359997);}(_0x9045,0x1cb));var _0x5904=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x9045[_0x37c22c];return _0x119d79;};'use strict';var client=require(_0x5904('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x5904('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5904('0x2')],'include':[{'model':'Interval','as':_0x5904('0x3'),'attributes':['id',_0x5904('0x2'),'interval']}]},'log':_0x5904('0x4')});};}; \ No newline at end of file +var _0x3ca7=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x3ca7,0x1bf));var _0x73ca=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x3ca7[_0x503950];return _0x1657a9;};'use strict';var client=require(_0x73ca('0x0'));exports[_0x73ca('0x1')]=function(){return function(){return client[_0x73ca('0x2')](_0x73ca('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x73ca('0x4')],'include':[{'model':_0x73ca('0x5'),'as':_0x73ca('0x6'),'attributes':['id',_0x73ca('0x4'),_0x73ca('0x7')]}]},'log':_0x73ca('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index a18b560..f7480fb 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 _0x8e3f=['UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x2c61f8,_0xb8a4dd){var _0x4badd1=function(_0x548e80){while(--_0x548e80){_0x2c61f8['push'](_0x2c61f8['shift']());}};_0x4badd1(++_0xb8a4dd);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xf8e3('0x0'));exports[_0xf8e3('0x1')]=function(_0x46e6a5,_0x4d334a){return client[_0xf8e3('0x2')](_0xf8e3('0x3'),{'body':_0x4d334a,'options':{'where':{'id':_0x46e6a5}},'log':_0xf8e3('0x4')});};exports['addTags']=function(_0x15d6ea,_0x41bc05){return client['Request'](_0xf8e3('0x5'),{'body':_0x41bc05,'options':{'where':{'id':_0x15d6ea}},'log':_0xf8e3('0x6')});}; \ No newline at end of file +var _0x6a55=['Request','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0xde8f9f,_0x40ad3d){var _0x271d5f=function(_0x5a2b19){while(--_0x5a2b19){_0xde8f9f['push'](_0xde8f9f['shift']());}};_0x271d5f(++_0x40ad3d);}(_0x6a55,0xdb));var _0x56a5=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x6a55[_0x199b1f];return _0x267ac9;};'use strict';var client=require(_0x56a5('0x0'));exports['update']=function(_0x5d894b,_0x4ec858){return client[_0x56a5('0x1')]('UpdateMailInteraction',{'body':_0x4ec858,'options':{'where':{'id':_0x5d894b}},'log':'updateMailInteraction'});};exports[_0x56a5('0x2')]=function(_0x5e5a32,_0x3ff76a){return client['Request'](_0x56a5('0x3'),{'body':_0x3ff76a,'options':{'where':{'id':_0x5e5a32}},'log':_0x56a5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6ed0191..485ab89 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 _0x9981=['Request'];(function(_0x2b7583,_0x48da26){var _0x46f187=function(_0x13079b){while(--_0x13079b){_0x2b7583['push'](_0x2b7583['shift']());}};_0x46f187(++_0x48da26);}(_0x9981,0xaa));var _0x1998=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x9981[_0x49d41c];return _0xb64c5f;};'use strict';var client=require('../client');exports['create']=function(_0x13d420){return client[_0x1998('0x0')]('CreateMailMessage',{'body':_0x13d420,'log':'createMailMessage'});}; \ No newline at end of file +var _0x9645=['Request','CreateMailMessage','create'];(function(_0x2706db,_0x2c03f6){var _0x19939b=function(_0x24266a){while(--_0x24266a){_0x2706db['push'](_0x2706db['shift']());}};_0x19939b(++_0x2c03f6);}(_0x9645,0x1df));var _0x5964=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0x9645[_0x1b2422];return _0x376573;};'use strict';var client=require('../client');exports[_0x5964('0x0')]=function(_0x4ed95c){return client[_0x5964('0x1')](_0x5964('0x2'),{'body':_0x4ed95c,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b3bac36..0d9990c 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 _0x3c86=['GetMailQueue','name','User','Agents','online','mailPause','getMailQueues'];(function(_0x55a7d3,_0x29747f){var _0x455034=function(_0x4e9526){while(--_0x4e9526){_0x55a7d3['push'](_0x55a7d3['shift']());}};_0x455034(++_0x29747f);}(_0x3c86,0x9a));var _0x63c8=function(_0x199db5,_0x5510ff){_0x199db5=_0x199db5-0x0;var _0x37e152=_0x3c86[_0x199db5];return _0x37e152;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client['Request'](_0x63c8('0x0'),{'options':{'raw':![],'attributes':['id',_0x63c8('0x1'),'timeout','strategy'],'include':[{'model':_0x63c8('0x2'),'as':_0x63c8('0x3'),'attributes':['id',_0x63c8('0x1'),_0x63c8('0x4'),_0x63c8('0x5')]}]},'log':_0x63c8('0x6')});};}; \ No newline at end of file +var _0x49d6=['timeout','name','online','mailPause','../client','getMailQueues','GetMailQueue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x49d6,0x1c4));var _0x649d=function(_0x78e878,_0xacf0b8){_0x78e878=_0x78e878-0x0;var _0x3e6eca=_0x49d6[_0x78e878];return _0x3e6eca;};'use strict';var client=require(_0x649d('0x0'));exports[_0x649d('0x1')]=function(){return function(){return client['Request'](_0x649d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x649d('0x3'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x649d('0x4'),_0x649d('0x5'),_0x649d('0x6')]}]},'log':_0x649d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4df03e6..ee4e3a1 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 _0x0ce4=['create','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client'];(function(_0x393659,_0x2f34c4){var _0x191210=function(_0x2f1f82){while(--_0x2f1f82){_0x393659['push'](_0x393659['shift']());}};_0x191210(++_0x2f34c4);}(_0x0ce4,0xe6));var _0x40ce=function(_0x4e4c37,_0x3c5f53){_0x4e4c37=_0x4e4c37-0x0;var _0x2462b3=_0x0ce4[_0x4e4c37];return _0x2462b3;};'use strict';var client=require(_0x40ce('0x0'));exports[_0x40ce('0x1')]=function(_0x2cd95a){return client['Request']('CreateMailQueueReport',{'body':_0x2cd95a,'log':_0x40ce('0x2')});};exports[_0x40ce('0x3')]=function(_0x1e52aa,_0x3f2314){return client[_0x40ce('0x4')](_0x40ce('0x5'),{'body':_0x3f2314,'options':{'where':{'uniqueid':_0x1e52aa},'order':[['id',_0x40ce('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x4c57=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','create','Request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4c57,0xf3));var _0x74c5=function(_0x338435,_0x4f296c){_0x338435=_0x338435-0x0;var _0x3c48a5=_0x4c57[_0x338435];return _0x3c48a5;};'use strict';var client=require(_0x74c5('0x0'));exports[_0x74c5('0x1')]=function(_0x45732d){return client[_0x74c5('0x2')](_0x74c5('0x3'),{'body':_0x45732d,'log':_0x74c5('0x3')});};exports[_0x74c5('0x4')]=function(_0x5f08fa,_0x192fdd){return client[_0x74c5('0x2')](_0x74c5('0x5'),{'body':_0x192fdd,'options':{'where':{'uniqueid':_0x5f08fa},'order':[['id','DESC']],'limit':0x1},'log':_0x74c5('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b006394..f92bc39 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 _0xa2f4=['Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa2f4,0xa0));var _0x4a2f=function(_0x4711fc,_0x31742c){_0x4711fc=_0x4711fc-0x0;var _0x4c1eaf=_0xa2f4[_0x4711fc];return _0x4c1eaf;};'use strict';var client=require(_0x4a2f('0x0'));exports[_0x4a2f('0x1')]=function(_0x3add4e,_0x5e94ee){return client[_0x4a2f('0x2')](_0x4a2f('0x3'),{'body':_0x5e94ee,'options':{'where':{'id':_0x3add4e}},'log':'updateOpenchannelInteraction'});};exports[_0x4a2f('0x4')]=function(_0x3c1cb7,_0x23a573){return client[_0x4a2f('0x2')](_0x4a2f('0x5'),{'body':_0x23a573,'options':{'where':{'id':_0x3c1cb7}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xd5d6=['Request','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x4c8b9f,_0x27d603){var _0x5d8463=function(_0x179f14){while(--_0x179f14){_0x4c8b9f['push'](_0x4c8b9f['shift']());}};_0x5d8463(++_0x27d603);}(_0xd5d6,0x8e));var _0x6d5d=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xd5d6[_0x363ef8];return _0x148822;};'use strict';var client=require(_0x6d5d('0x0'));exports[_0x6d5d('0x1')]=function(_0x421454,_0x5c6487){return client[_0x6d5d('0x2')](_0x6d5d('0x3'),{'body':_0x5c6487,'options':{'where':{'id':_0x421454}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x47b011,_0x47a558){return client[_0x6d5d('0x2')](_0x6d5d('0x4'),{'body':_0x47a558,'options':{'where':{'id':_0x47b011}},'log':_0x6d5d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index e351697..b3dc1d4 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 _0x3a33=['createOpenchannelMessage','CreateOpenchannelMessage'];(function(_0x36c537,_0x6a977e){var _0x33c111=function(_0x4d4b93){while(--_0x4d4b93){_0x36c537['push'](_0x36c537['shift']());}};_0x33c111(++_0x6a977e);}(_0x3a33,0x1a7));var _0x33a3=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x3a33[_0x279d37];return _0x530173;};'use strict';var client=require('../client');exports['create']=function(_0x2623df){return client['Request'](_0x33a3('0x0'),{'body':_0x2623df,'log':_0x33a3('0x1')});}; \ No newline at end of file +var _0xabbd=['createOpenchannelMessage','../client','Request','CreateOpenchannelMessage'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xabbd,0x9d));var _0xdabb=function(_0x29adf6,_0x13e21e){_0x29adf6=_0x29adf6-0x0;var _0x49039d=_0xabbd[_0x29adf6];return _0x49039d;};'use strict';var client=require(_0xdabb('0x0'));exports['create']=function(_0x4f1a42){return client[_0xdabb('0x1')](_0xdabb('0x2'),{'body':_0x4f1a42,'log':_0xdabb('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 79b038c..c434441 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 _0xa0fa=['name','online','../client','getOpenchannelQueues','Request','timeout','strategy','User','Agents'];(function(_0xe90797,_0x2a00e0){var _0x3b557e=function(_0x5e4895){while(--_0x5e4895){_0xe90797['push'](_0xe90797['shift']());}};_0x3b557e(++_0x2a00e0);}(_0xa0fa,0xd1));var _0xaa0f=function(_0x47d84e,_0x2c1006){_0x47d84e=_0x47d84e-0x0;var _0x386ee4=_0xa0fa[_0x47d84e];return _0x386ee4;};'use strict';var client=require(_0xaa0f('0x0'));exports[_0xaa0f('0x1')]=function(){return function(){return client[_0xaa0f('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0xaa0f('0x3'),_0xaa0f('0x4')],'include':[{'model':_0xaa0f('0x5'),'as':_0xaa0f('0x6'),'attributes':['id',_0xaa0f('0x7'),_0xaa0f('0x8'),'openchannelPause']}]},'log':_0xaa0f('0x1')});};}; \ No newline at end of file +var _0xf966=['User','Agents','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x3e9859,_0x1da4ed){var _0xa930bd=function(_0x11a845){while(--_0x11a845){_0x3e9859['push'](_0x3e9859['shift']());}};_0xa930bd(++_0x1da4ed);}(_0xf966,0x13b));var _0x6f96=function(_0x3b9322,_0x5337c1){_0x3b9322=_0x3b9322-0x0;var _0x579528=_0xf966[_0x3b9322];return _0x579528;};'use strict';var client=require(_0x6f96('0x0'));exports[_0x6f96('0x1')]=function(){return function(){return client[_0x6f96('0x2')](_0x6f96('0x3'),{'options':{'raw':![],'attributes':['id',_0x6f96('0x4'),'timeout','strategy'],'include':[{'model':_0x6f96('0x5'),'as':_0x6f96('0x6'),'attributes':['id',_0x6f96('0x4'),'online',_0x6f96('0x7')]}]},'log':_0x6f96('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b5a5ec6..3839bb5 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 _0x3192=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x4a292f,_0x39b693){var _0x4762b0=function(_0x385a60){while(--_0x385a60){_0x4a292f['push'](_0x4a292f['shift']());}};_0x4762b0(++_0x39b693);}(_0x3192,0x147));var _0x2319=function(_0x5a2587,_0x9bf7c4){_0x5a2587=_0x5a2587-0x0;var _0x202469=_0x3192[_0x5a2587];return _0x202469;};'use strict';var client=require('../client');exports['create']=function(_0x1419c7){return client[_0x2319('0x0')](_0x2319('0x1'),{'body':_0x1419c7,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x9c2b91,_0x4f6619){return client[_0x2319('0x0')](_0x2319('0x2'),{'body':_0x4f6619,'options':{'where':{'uniqueid':_0x9c2b91},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x59a6=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x4bcbe,_0x3a38c0){var _0x4c0af9=function(_0x3dfc1f){while(--_0x3dfc1f){_0x4bcbe['push'](_0x4bcbe['shift']());}};_0x4c0af9(++_0x3a38c0);}(_0x59a6,0x1b5));var _0x659a=function(_0xadbc49,_0x2214e6){_0xadbc49=_0xadbc49-0x0;var _0x3b05d1=_0x59a6[_0xadbc49];return _0x3b05d1;};'use strict';var client=require(_0x659a('0x0'));exports[_0x659a('0x1')]=function(_0x3f0d29){return client[_0x659a('0x2')](_0x659a('0x3'),{'body':_0x3f0d29,'log':_0x659a('0x3')});};exports[_0x659a('0x4')]=function(_0x51761f,_0x1b13bd){return client[_0x659a('0x2')](_0x659a('0x5'),{'body':_0x1b13bd,'options':{'where':{'uniqueid':_0x51761f},'order':[['id',_0x659a('0x6')]],'limit':0x1},'log':_0x659a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0b631c6..bb2019f 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 _0x919e=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x54f336,_0x171826){var _0x3fea0c=function(_0x43fa58){while(--_0x43fa58){_0x54f336['push'](_0x54f336['shift']());}};_0x3fea0c(++_0x171826);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe919('0x0'));exports[_0xe919('0x1')]=function(_0x24d2f4,_0x5d7d06){return client[_0xe919('0x2')]('UpdateSmsInteraction',{'body':_0x5d7d06,'options':{'where':{'id':_0x24d2f4}},'log':'updateSmsInteraction'});};exports[_0xe919('0x3')]=function(_0x3a1192,_0x2bf552){return client[_0xe919('0x2')](_0xe919('0x4'),{'body':_0x2bf552,'options':{'where':{'id':_0x3a1192}},'log':_0xe919('0x5')});}; \ No newline at end of file +var _0x0fda=['addTags','AddTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x2756c3,_0x2f2a68){_0x2756c3=_0x2756c3-0x0;var _0x1d3dfc=_0x0fda[_0x2756c3];return _0x1d3dfc;};'use strict';var client=require(_0xa0fd('0x0'));exports['update']=function(_0x8c3855,_0x28e34c){return client[_0xa0fd('0x1')](_0xa0fd('0x2'),{'body':_0x28e34c,'options':{'where':{'id':_0x8c3855}},'log':_0xa0fd('0x3')});};exports[_0xa0fd('0x4')]=function(_0x13c734,_0x574fca){return client['Request'](_0xa0fd('0x5'),{'body':_0x574fca,'options':{'where':{'id':_0x13c734}},'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 be83395..cbbf390 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 _0x0ffb=['Request','CreateSmsMessage','../client','create'];(function(_0x25e0d2,_0x28e66e){var _0x386589=function(_0x5c9f48){while(--_0x5c9f48){_0x25e0d2['push'](_0x25e0d2['shift']());}};_0x386589(++_0x28e66e);}(_0x0ffb,0x166));var _0xb0ff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0ffb[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xb0ff('0x0'));exports[_0xb0ff('0x1')]=function(_0x1663ca){return client[_0xb0ff('0x2')](_0xb0ff('0x3'),{'body':_0x1663ca,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x363e=['Request','createSmsMessage'];(function(_0x1b90ed,_0xb2f502){var _0x2eac56=function(_0x49097e){while(--_0x49097e){_0x1b90ed['push'](_0x1b90ed['shift']());}};_0x2eac56(++_0xb2f502);}(_0x363e,0x1cc));var _0xe363=function(_0x1164d9,_0x45f6de){_0x1164d9=_0x1164d9-0x0;var _0x24e6dc=_0x363e[_0x1164d9];return _0x24e6dc;};'use strict';var client=require('../client');exports['create']=function(_0x575661){return client[_0xe363('0x0')]('CreateSmsMessage',{'body':_0x575661,'log':_0xe363('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6bcd34c..c5f8947 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x2dddf5,_0x52aaf2){var _0x33dc0f=function(_0x41fdda){while(--_0x41fdda){_0x2dddf5['push'](_0x2dddf5['shift']());}};_0x33dc0f(++_0x52aaf2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0xcb91[_0x4be8ba];return _0x1af822;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x5d7359,_0x5dc4c1){var _0x59e242=function(_0x52cda3){while(--_0x52cda3){_0x5d7359['push'](_0x5d7359['shift']());}};_0x59e242(++_0x5dc4c1);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xb7e7[_0x9fd887];return _0x1a54ab;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c3cc7b0..43a3c00 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x1f36e2,_0x5cd9b1){var _0x3b0394=function(_0x552914){while(--_0x552914){_0x1f36e2['push'](_0x1f36e2['shift']());}};_0x3b0394(++_0x5cd9b1);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x220e01,_0x379427){var _0x49e7ac=function(_0x3983b8){while(--_0x3983b8){_0x220e01['push'](_0x220e01['shift']());}};_0x49e7ac(++_0x379427);}(_0x55ca,0x126));var _0xa55c=function(_0x17e174,_0x4991f8){_0x17e174=_0x17e174-0x0;var _0x3f26f1=_0x55ca[_0x17e174];return _0x3f26f1;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 5975511..5d6dde9 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 _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0xea0959,_0x534467){var _0x5f22b4=function(_0x28ec12){while(--_0x28ec12){_0xea0959['push'](_0xea0959['shift']());}};_0x5f22b4(++_0x534467);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x565fcc,_0x42d390){var _0x4178c2=function(_0x15e74a){while(--_0x15e74a){_0x565fcc['push'](_0x565fcc['shift']());}};_0x4178c2(++_0x42d390);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index a218531..b02fc21 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b20=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x594a85,_0x1dd9d0){var _0x64e157=function(_0x1f78c0){while(--_0x1f78c0){_0x594a85['push'](_0x594a85['shift']());}};_0x64e157(++_0x1dd9d0);}(_0x1b20,0x66));var _0x01b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b20[_0x502c7d];return _0x30b7ed;};'use strict';var client=require('../client');exports[_0x01b2('0x0')]=function(_0x37ae5c,_0x4a27f9){return client['Request'](_0x01b2('0x1'),{'body':_0x4a27f9,'options':{'where':{'id':_0x37ae5c}},'log':_0x01b2('0x2')});};exports[_0x01b2('0x3')]=function(_0x1150fc,_0x1cf757){return client[_0x01b2('0x4')](_0x01b2('0x5'),{'body':_0x1cf757,'options':{'where':{'id':_0x1150fc}},'log':_0x01b2('0x6')});}; \ No newline at end of file +var _0xd663=['addTags','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x158a01,_0x50bcb8){var _0x94b215=function(_0x295679){while(--_0x295679){_0x158a01['push'](_0x158a01['shift']());}};_0x94b215(++_0x50bcb8);}(_0xd663,0x1ed));var _0x3d66=function(_0x3166f0,_0xa6934c){_0x3166f0=_0x3166f0-0x0;var _0x553e2a=_0xd663[_0x3166f0];return _0x553e2a;};'use strict';var client=require(_0x3d66('0x0'));exports[_0x3d66('0x1')]=function(_0x55a3d4,_0x1fdc60){return client[_0x3d66('0x2')](_0x3d66('0x3'),{'body':_0x1fdc60,'options':{'where':{'id':_0x55a3d4}},'log':_0x3d66('0x4')});};exports[_0x3d66('0x5')]=function(_0x4e9001,_0x28d76b){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x28d76b,'options':{'where':{'id':_0x4e9001}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 1087710..e8afca8 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8e5e=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8e5e,0x1f3));var _0xe8e5=function(_0xf1a005,_0x361fee){_0xf1a005=_0xf1a005-0x0;var _0x5313f6=_0x8e5e[_0xf1a005];return _0x5313f6;};'use strict';var client=require(_0xe8e5('0x0'));exports[_0xe8e5('0x1')]=function(_0x126a6b){return client[_0xe8e5('0x2')](_0xe8e5('0x3'),{'body':_0x126a6b,'log':_0xe8e5('0x4')});}; \ No newline at end of file +var _0x8ae3=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x3c8366,_0x46df4c){var _0xae08f1=function(_0x5da3ef){while(--_0x5da3ef){_0x3c8366['push'](_0x3c8366['shift']());}};_0xae08f1(++_0x46df4c);}(_0x8ae3,0x16f));var _0x38ae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8ae3[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x38ae('0x0'));exports[_0x38ae('0x1')]=function(_0x5d2675){return client[_0x38ae('0x2')](_0x38ae('0x3'),{'body':_0x5d2675,'log':_0x38ae('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 1f06da9..3175bc6 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9a9=['strategy','Agents','whatsappPause','../client','getWhatsappQueues','Request','name','timeout'];(function(_0x36f79c,_0x41e72e){var _0x4978a6=function(_0x50b4dd){while(--_0x50b4dd){_0x36f79c['push'](_0x36f79c['shift']());}};_0x4978a6(++_0x41e72e);}(_0xe9a9,0xcb));var _0x9e9a=function(_0x14250a,_0x426c35){_0x14250a=_0x14250a-0x0;var _0xfbc2cd=_0xe9a9[_0x14250a];return _0xfbc2cd;};'use strict';var client=require(_0x9e9a('0x0'));exports[_0x9e9a('0x1')]=function(){return function(){return client[_0x9e9a('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x9e9a('0x3'),_0x9e9a('0x4'),_0x9e9a('0x5')],'include':[{'model':'User','as':_0x9e9a('0x6'),'attributes':['id','name','online',_0x9e9a('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xabf4=['name','strategy','User','Agents','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0xb3b90c,_0x288be3){var _0x247a13=function(_0x4dbb32){while(--_0x4dbb32){_0xb3b90c['push'](_0xb3b90c['shift']());}};_0x247a13(++_0x288be3);}(_0xabf4,0x15b));var _0x4abf=function(_0x338c7d,_0x2efd72){_0x338c7d=_0x338c7d-0x0;var _0x2664ac=_0xabf4[_0x338c7d];return _0x2664ac;};'use strict';var client=require(_0x4abf('0x0'));exports[_0x4abf('0x1')]=function(){return function(){return client['Request'](_0x4abf('0x2'),{'options':{'raw':![],'attributes':['id',_0x4abf('0x3'),'timeout',_0x4abf('0x4')],'include':[{'model':_0x4abf('0x5'),'as':_0x4abf('0x6'),'attributes':['id',_0x4abf('0x3'),'online','whatsappPause']}]},'log':_0x4abf('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 3ec647e..c9980b1 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc391=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x52c05b,_0x22fbb3){var _0x2af1e7=function(_0xd586c2){while(--_0xd586c2){_0x52c05b['push'](_0x52c05b['shift']());}};_0x2af1e7(++_0x22fbb3);}(_0xc391,0xbd));var _0x1c39=function(_0xa3feb7,_0x4b1f46){_0xa3feb7=_0xa3feb7-0x0;var _0x380f2b=_0xc391[_0xa3feb7];return _0x380f2b;};'use strict';var client=require(_0x1c39('0x0'));exports[_0x1c39('0x1')]=function(_0xf69332){return client[_0x1c39('0x2')](_0x1c39('0x3'),{'body':_0xf69332,'log':_0x1c39('0x3')});};exports[_0x1c39('0x4')]=function(_0x43a180,_0x38b97d){return client[_0x1c39('0x2')](_0x1c39('0x5'),{'body':_0x38b97d,'options':{'where':{'uniqueid':_0x43a180},'order':[['id','DESC']],'limit':0x1},'log':_0x1c39('0x5')});}; \ No newline at end of file +var _0x122c=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x847809,_0x51e79e){var _0x598c3f=function(_0x3b1b13){while(--_0x3b1b13){_0x847809['push'](_0x847809['shift']());}};_0x598c3f(++_0x51e79e);}(_0x122c,0x118));var _0xc122=function(_0x439c9b,_0x523f09){_0x439c9b=_0x439c9b-0x0;var _0x30f989=_0x122c[_0x439c9b];return _0x30f989;};'use strict';var client=require(_0xc122('0x0'));exports[_0xc122('0x1')]=function(_0x3a2219){return client[_0xc122('0x2')](_0xc122('0x3'),{'body':_0x3a2219,'log':_0xc122('0x3')});};exports[_0xc122('0x4')]=function(_0x387f94,_0x276120){return client[_0xc122('0x2')](_0xc122('0x5'),{'body':_0x276120,'options':{'where':{'uniqueid':_0x387f94},'order':[['id',_0xc122('0x6')]],'limit':0x1},'log':_0xc122('0x5')});}; \ 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 2ccf875..387b3af 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 _0x60ca=['[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end'];(function(_0x3f8094,_0xe19ba1){var _0x1c450c=function(_0x494843){while(--_0x494843){_0x3f8094['push'](_0x3f8094['shift']());}};_0x1c450c(++_0xe19ba1);}(_0x60ca,0x127));var _0xa60c=function(_0x1bec59,_0x417ac7){_0x1bec59=_0x1bec59-0x0;var _0x4c7ccd=_0x60ca[_0x1bec59];return _0x4c7ccd;};'use strict';var schema=require(_0xa60c('0x0'));var _=require(_0xa60c('0x1'));var util=require('util');var seqqueue=require(_0xa60c('0x2'));var logger=require(_0xa60c('0x3'))(_0xa60c('0x4'));var strategy=require(_0xa60c('0x5'));var queue=schema({'name':{'type':_0xa60c('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa60c('0x7'),'message':_0xa60c('0x8')}});function writeLog(_0x3b975b,_0x2f0fa7,_0x545a9c){return logger[_0xa60c('0x9')](util[_0xa60c('0xa')](_0xa60c('0xb'),_0x3b975b,_0x2f0fa7['name'],_0x545a9c));}function handleFindAgent(_0x1b4cfd){return function(_0x36a272){return _0x36a272[_0xa60c('0xc')][_0xa60c('0xd')]()===_0x1b4cfd['toLowerCase']();};}exports[_0xa60c('0xe')]=function(_0x1e41a9,_0x1f6d20,_0x44a347,_0x40d45d){return function(_0x353c45){try{var _0x2fd022={'name':_0x1f6d20[0x0],'timeout':_0x1f6d20[0x1]};var _0x23ec07=queue['validate'](_0x2fd022,{'typecast':!![]});if(_0x23ec07[_0xa60c('0xf')]){logger[_0xa60c('0x10')](_0xa60c('0x11'),_0x1e41a9,_['map'](_0x23ec07,_0xa60c('0x12'))[_0xa60c('0x13')](',\x20'));_0x353c45[_0xa60c('0x14')]();}else{var _0x1211e0=_['find'](_0x44a347[_0xa60c('0x15')],handleFindAgent(_0x2fd022[_0xa60c('0xc')]));if(_0x1211e0){var _0xf3fec8=(_0x2fd022[_0xa60c('0x16')]||0xa)*0x3e8;var _0xdc43b4,_0x256db4;var _0x4063c2=seqqueue[_0xa60c('0x17')](_0xf3fec8);_0x4063c2['id']=_0x1e41a9;_0x4063c2[_0xa60c('0x18')]=_0xf3fec8;_0x4063c2[_0xa60c('0x19')]=_0x40d45d['channel'];writeLog(_0x1e41a9,_0x1211e0,util[_0xa60c('0xa')](_0xa60c('0x1a'),_0xf3fec8));_0x44a347[_0xa60c('0x1b')][_0x1e41a9]['on'](_0xa60c('0x1c'),function(){logger[_0xa60c('0x9')](_0xa60c('0x1d'),_0x1e41a9);clearTimeout(_0x256db4);_0x256db4=undefined;_0x4063c2[_0xa60c('0x1e')]();if(_0x44a347[_0xa60c('0x1b')][_0x1e41a9]){delete _0x44a347[_0xa60c('0x1b')][_0x1e41a9];}_0x353c45[_0xa60c('0x14')]();});_0x44a347[_0xa60c('0x1b')][_0x1e41a9]['on'](_0xa60c('0x1f'),function(){if(_0x44a347[_0xa60c('0x1b')][_0x1e41a9]){delete _0x44a347[_0xa60c('0x1b')][_0x1e41a9];}});_0x256db4=setTimeout(function(){logger[_0xa60c('0x9')](_0xa60c('0x20'),_0x1e41a9);clearTimeout(_0x256db4);_0x4063c2[_0xa60c('0x1e')]();_0x353c45['next']();},_0xf3fec8);strategy[_0xa60c('0x21')](_0x4063c2,_0x1211e0,_0x44a347,_0x40d45d);}else{logger[_0xa60c('0x10')](_0xa60c('0x22'),_0x1e41a9,_0x2fd022[_0xa60c('0xc')]);_0x353c45[_0xa60c('0x14')]();}}}catch(_0x3d8e73){console[_0xa60c('0x23')](_0x3d8e73);logger[_0xa60c('0x10')]('[%s][QUEUE]\x20%s',_0x1e41a9,_0x3d8e73['stack']);_0x353c45[_0xa60c('0x14')]();}};}; \ No newline at end of file +var _0xcbfe=['channel','START:%s','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xcbfe,0xc9));var _0xecbf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcbfe[_0x20a584];return _0x4b41a8;};'use strict';var schema=require(_0xecbf('0x0'));var _=require(_0xecbf('0x1'));var util=require(_0xecbf('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xecbf('0x3'))(_0xecbf('0x4'));var strategy=require(_0xecbf('0x5'));var queue=schema({'name':{'type':_0xecbf('0x6'),'required':!![],'message':_0xecbf('0x7')},'timeout':{'type':'number','message':_0xecbf('0x8')}});function writeLog(_0x58a6f7,_0x4ec8cd,_0x26589c){return logger[_0xecbf('0x9')](util[_0xecbf('0xa')](_0xecbf('0xb'),_0x58a6f7,_0x4ec8cd[_0xecbf('0xc')],_0x26589c));}function handleFindAgent(_0x4eebfd){return function(_0x440108){return _0x440108[_0xecbf('0xc')]['toLowerCase']()===_0x4eebfd[_0xecbf('0xd')]();};}exports[_0xecbf('0xe')]=function(_0x488c7f,_0x546ac7,_0x3bfbf2,_0x2eb746){return function(_0x244d71){try{var _0x4af7aa={'name':_0x546ac7[0x0],'timeout':_0x546ac7[0x1]};var _0x3e0cf5=queue[_0xecbf('0x0')](_0x4af7aa,{'typecast':!![]});if(_0x3e0cf5[_0xecbf('0xf')]){logger[_0xecbf('0x10')](_0xecbf('0x11'),_0x488c7f,_[_0xecbf('0x12')](_0x3e0cf5,_0xecbf('0x13'))[_0xecbf('0x14')](',\x20'));_0x244d71[_0xecbf('0x15')]();}else{var _0x256d54=_[_0xecbf('0x16')](_0x3bfbf2[_0xecbf('0x17')],handleFindAgent(_0x4af7aa[_0xecbf('0xc')]));if(_0x256d54){var _0x31cbcf=(_0x4af7aa[_0xecbf('0x18')]||0xa)*0x3e8;var _0x116321,_0x16384d;var _0x3b47e3=seqqueue[_0xecbf('0x19')](_0x31cbcf);_0x3b47e3['id']=_0x488c7f;_0x3b47e3[_0xecbf('0x1a')]=_0x31cbcf;_0x3b47e3[_0xecbf('0x1b')]=_0x2eb746[_0xecbf('0x1b')];writeLog(_0x488c7f,_0x256d54,util[_0xecbf('0xa')](_0xecbf('0x1c'),_0x31cbcf));_0x3bfbf2['rules'][_0x488c7f]['on']('end',function(){logger[_0xecbf('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x488c7f);clearTimeout(_0x16384d);_0x16384d=undefined;_0x3b47e3[_0xecbf('0x1d')]();if(_0x3bfbf2['rules'][_0x488c7f]){delete _0x3bfbf2[_0xecbf('0x1e')][_0x488c7f];}_0x244d71['stop']();});_0x3bfbf2[_0xecbf('0x1e')][_0x488c7f]['on'](_0xecbf('0x1f'),function(){if(_0x3bfbf2['rules'][_0x488c7f]){delete _0x3bfbf2[_0xecbf('0x1e')][_0x488c7f];}});_0x16384d=setTimeout(function(){logger[_0xecbf('0x9')](_0xecbf('0x20'),_0x488c7f);clearTimeout(_0x16384d);_0x3b47e3['close']();_0x244d71[_0xecbf('0x21')]();},_0x31cbcf);strategy['agent'](_0x3b47e3,_0x256d54,_0x3bfbf2,_0x2eb746);}else{logger[_0xecbf('0x10')](_0xecbf('0x22'),_0x488c7f,_0x4af7aa[_0xecbf('0xc')]);_0x244d71[_0xecbf('0x15')]();}}}catch(_0x5b573c){console[_0xecbf('0x23')](_0x5b573c);logger[_0xecbf('0x10')](_0xecbf('0x24'),_0x488c7f,_0x5b573c[_0xecbf('0x25')]);_0x244d71[_0xecbf('0x15')]();}};}; \ 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 ec6066d..41dd1ad 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 _0x6ec5=['created','isEmpty','body','Message','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','postText','message','amazonlex','providerResponse','then','catch','lodash','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x6ec5,0x6e));var _0x56ec=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6ec5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x56ec('0x0'));var moment=require('moment');var AWS=require(_0x56ec('0x1'));var utils=require(_0x56ec('0x2'));var logger=require(_0x56ec('0x3'))('routing');var rpc={'chatMessage':require(_0x56ec('0x4')),'openchannelMessage':require(_0x56ec('0x5')),'mailMessage':require(_0x56ec('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x56ec('0x7')),'whatsappMessage':require(_0x56ec('0x8'))};exports[_0x56ec('0x9')]=function(_0x178c70,_0x277929){return function(_0x46a30b){try{if(!_['isNil'](this[_0x56ec('0xa')]['UserId'])){logger[_0x56ec('0xb')](_0x56ec('0xc'),_0x178c70,_0x56ec('0xd'));return _0x46a30b[_0x56ec('0xe')]();}var _0x552f14={'ContactId':this[_0x56ec('0xf')]['id'],'sentAt':moment()[_0x56ec('0x10')](_0x56ec('0x11')),'direction':_0x56ec('0x12')};if(this['channel']===_0x56ec('0x13')||this[_0x56ec('0x14')]===_0x56ec('0x15')){_0x552f14[_0x56ec('0x16')]=this[_0x56ec('0xa')][_0x56ec('0x16')];}var _0x534bf0=this['channel'];if(_0x534bf0===_0x56ec('0x17')){_0x552f14['ChatWebsiteId']=this[_0x56ec('0x18')]['id'];}else{_0x552f14[_[_0x56ec('0x19')](_0x534bf0)+_0x56ec('0x1a')]=this[_0x56ec('0x18')]['id'];}_0x552f14[_[_0x56ec('0x19')](_0x534bf0)+_0x56ec('0x1b')]=this[_0x56ec('0xa')]['id'];if(this[_0x56ec('0xa')][_0x56ec('0x1c')]){var _0x3001a9=_0x277929[0x4];if(!_[_0x56ec('0x1d')](_0x3001a9)){_0x552f14[_0x56ec('0x1e')]=utils['getMustacheRender'](_0x3001a9,this);return rpc[_0x534bf0+_0x56ec('0x1f')]['create'](_0x552f14)['then'](function(_0x5c73fe){logger[_0x56ec('0xb')](_0x56ec('0xc'),_0x178c70,_0x552f14[_0x56ec('0x1e')]);})['catch'](function(_0x5c7776){logger[_0x56ec('0x20')](_0x56ec('0xc'),_0x178c70,JSON[_0x56ec('0x21')](_0x5c7776));})[_0x56ec('0x22')](function(){logger[_0x56ec('0xb')](_0x56ec('0x23'),_0x178c70);_0x46a30b['stop']();});}else{logger[_0x56ec('0xb')](_0x56ec('0x24'),_0x178c70);_0x46a30b['stop']();}}else{var _0x553b28=this;var _0x32fb19=new AWS[(_0x56ec('0x25'))]({'accessKeyId':_0x277929[0x0],'secretAccessKey':_0x277929[0x1],'region':_0x277929[0x2]});var _0x5c8bc1={'botAlias':_0x56ec('0x26'),'botName':_0x277929[0x3],'inputText':this['message'][_0x56ec('0x1e')],'userId':this[_0x56ec('0x14')]+':'+this[_0x56ec('0xa')]['id'][_0x56ec('0x27')]()};_0x32fb19[_0x56ec('0x28')](_0x5c8bc1,function(_0x15640b,_0x2e4fe6){if(_0x15640b){logger['error'](_0x56ec('0xc'),_0x178c70,_0x15640b[_0x56ec('0x29')]);_0x46a30b[_0x56ec('0xe')]();}else if(_0x2e4fe6&&_0x2e4fe6[_0x56ec('0x29')]){_0x553b28[_0x56ec('0x1e')][_0x56ec('0x2a')]=_0x2e4fe6;_0x552f14[_0x56ec('0x1e')]=_0x2e4fe6[_0x56ec('0x29')];_0x552f14['providerName']='amazonlex';_0x552f14[_0x56ec('0x2b')]=JSON['stringify'](_0x2e4fe6);return rpc[_0x534bf0+_0x56ec('0x1f')]['create'](_0x552f14)[_0x56ec('0x2c')](function(_0x377bfb){logger[_0x56ec('0xb')](_0x56ec('0xc'),_0x178c70,_0x552f14['body']);if(_0x2e4fe6['dialogState']=='Failed'){_0x46a30b[_0x56ec('0xe')]();}else{_0x46a30b['stop']();}})[_0x56ec('0x2d')](function(_0x4c5fa9){logger['error'](_0x56ec('0xc'),_0x178c70,JSON[_0x56ec('0x21')](_0x4c5fa9));_0x46a30b['next']();});}else{_0x46a30b['next']();}});}}catch(_0x299c47){logger['error'](_0x56ec('0xc'),_0x178c70,JSON['stringify'](_0x299c47));_0x46a30b['stop']();}};}; \ No newline at end of file +var _0xe305=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','AccountId','upperFirst','isEmpty','body','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','postText','amazonlex','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing'];(function(_0x16dd0c,_0xfc6585){var _0x31d29c=function(_0x30e860){while(--_0x30e860){_0x16dd0c['push'](_0x16dd0c['shift']());}};_0x31d29c(++_0xfc6585);}(_0xe305,0xb6));var _0x5e30=function(_0x552ddd,_0x1d3201){_0x552ddd=_0x552ddd-0x0;var _0x5d4422=_0xe305[_0x552ddd];return _0x5d4422;};'use strict';var _=require(_0x5e30('0x0'));var moment=require(_0x5e30('0x1'));var AWS=require(_0x5e30('0x2'));var utils=require(_0x5e30('0x3'));var logger=require(_0x5e30('0x4'))(_0x5e30('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5e30('0x6')),'mailMessage':require(_0x5e30('0x7')),'smsMessage':require(_0x5e30('0x8')),'faxMessage':require(_0x5e30('0x9')),'whatsappMessage':require(_0x5e30('0xa'))};exports[_0x5e30('0xb')]=function(_0x27e4ba,_0x22f760){return function(_0x5cb398){try{if(!_[_0x5e30('0xc')](this[_0x5e30('0xd')][_0x5e30('0xe')])){logger[_0x5e30('0xf')](_0x5e30('0x10'),_0x27e4ba,_0x5e30('0x11'));return _0x5cb398[_0x5e30('0x12')]();}var _0x1b7065={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5e30('0x13')](_0x5e30('0x14')),'direction':_0x5e30('0x15')};if(this[_0x5e30('0x16')]===_0x5e30('0x17')||this[_0x5e30('0x16')]===_0x5e30('0x18')){_0x1b7065[_0x5e30('0x19')]=this[_0x5e30('0xd')][_0x5e30('0x19')];}var _0x462621=this[_0x5e30('0x16')];if(_0x462621==='chat'){_0x1b7065[_0x5e30('0x1a')]=this[_0x5e30('0x1b')]['id'];}else{_0x1b7065[_['upperFirst'](_0x462621)+_0x5e30('0x1c')]=this[_0x5e30('0x1b')]['id'];}_0x1b7065[_[_0x5e30('0x1d')](_0x462621)+'InteractionId']=this[_0x5e30('0xd')]['id'];if(this[_0x5e30('0xd')]['created']){var _0x664e1a=_0x22f760[0x4];if(!_[_0x5e30('0x1e')](_0x664e1a)){_0x1b7065[_0x5e30('0x1f')]=utils['getMustacheRender'](_0x664e1a,this);return rpc[_0x462621+_0x5e30('0x20')][_0x5e30('0x21')](_0x1b7065)[_0x5e30('0x22')](function(_0x5976fa){logger[_0x5e30('0xf')](_0x5e30('0x10'),_0x27e4ba,_0x1b7065['body']);})[_0x5e30('0x23')](function(_0x3220cf){logger[_0x5e30('0x24')](_0x5e30('0x10'),_0x27e4ba,JSON[_0x5e30('0x25')](_0x3220cf));})[_0x5e30('0x26')](function(){logger[_0x5e30('0xf')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x27e4ba);_0x5cb398['stop']();});}else{logger[_0x5e30('0xf')](_0x5e30('0x27'),_0x27e4ba);_0x5cb398[_0x5e30('0x28')]();}}else{var _0x12b0ff=this;var _0x29b5fe=new AWS[(_0x5e30('0x29'))]({'accessKeyId':_0x22f760[0x0],'secretAccessKey':_0x22f760[0x1],'region':_0x22f760[0x2]});var _0xa60be2={'botAlias':_0x5e30('0x2a'),'botName':_0x22f760[0x3],'inputText':this[_0x5e30('0x2b')][_0x5e30('0x1f')],'userId':this[_0x5e30('0x16')]+':'+this[_0x5e30('0xd')]['id']['toString']()};_0x29b5fe[_0x5e30('0x2c')](_0xa60be2,function(_0x59aff4,_0x8166e){if(_0x59aff4){logger[_0x5e30('0x24')](_0x5e30('0x10'),_0x27e4ba,_0x59aff4[_0x5e30('0x2b')]);_0x5cb398['next']();}else if(_0x8166e&&_0x8166e['message']){_0x12b0ff['body']['amazonlex']=_0x8166e;_0x1b7065['body']=_0x8166e[_0x5e30('0x2b')];_0x1b7065['providerName']=_0x5e30('0x2d');_0x1b7065['providerResponse']=JSON[_0x5e30('0x25')](_0x8166e);return rpc[_0x462621+_0x5e30('0x20')][_0x5e30('0x21')](_0x1b7065)[_0x5e30('0x22')](function(_0x3de0b0){logger[_0x5e30('0xf')]('[%s][AMAZONLEX]\x20%s',_0x27e4ba,_0x1b7065[_0x5e30('0x1f')]);if(_0x8166e[_0x5e30('0x2e')]=='Failed'){_0x5cb398[_0x5e30('0x12')]();}else{_0x5cb398[_0x5e30('0x28')]();}})['catch'](function(_0x564681){logger[_0x5e30('0x24')](_0x5e30('0x10'),_0x27e4ba,JSON[_0x5e30('0x25')](_0x564681));_0x5cb398[_0x5e30('0x12')]();});}else{_0x5cb398[_0x5e30('0x12')]();}});}}catch(_0xfc50e8){logger['error'](_0x5e30('0x10'),_0x27e4ba,JSON['stringify'](_0xfc50e8));_0x5cb398[_0x5e30('0x28')]();}};}; \ 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 3495a17..88a59e5 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 _0x3432=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','contact','out','getMustacheRender','body','message','from','phone','read','subject','startsWith','chat','ChatWebsiteId','upperFirst','InteractionId','Message','inReplyTo','html','','replace','';_0x12c9b7['headers']={'Auto-Submitted':_0x2343('0x32'),'X-Auto-Response-Suppress':_0x2343('0x33'),'Precedence':_0x2343('0x34')};return mailRpc[_0x2343('0x35')](this['account']['smtpOptions'],_0x12c9b7)[_0x2343('0x36')](function(_0xe50c9d){logger[_0x2343('0x13')](_0x2343('0x37'),_0x3bf923);_0x12c9b7[_0x2343('0x38')]=_0xe50c9d[_0x2343('0x21')]['messageId'];return rpc[_0x620d49+'Message'][_0x2343('0x39')](_0x12c9b7);})[_0x2343('0x36')](function(_0x5c0f4b){logger[_0x2343('0x13')](_0x2343('0x18'),_0x3bf923,JSON[_0x2343('0x3a')](_0x5c0f4b));})[_0x2343('0x3b')](function(_0x5406f9){logger[_0x2343('0x3c')](_0x2343('0x3d'),_0x3bf923,JSON[_0x2343('0x3a')](_0x5406f9));})[_0x2343('0x3e')](function(){Promise[_0x2343('0x3f')]()[_0x2343('0x36')](function(){if(_0x39563d[0x0]!=='2'||_0x3698ba[_0x2343('0x19')])return;return rpc[_0x620d49+_0x2343('0x40')][_0x2343('0x41')](_0x3698ba['id'],{'autoreplyExecuted':!![]})[_0x2343('0x36')](function(_0x5481bc){logger[_0x2343('0x13')](_0x2343('0x1a'),_0x3bf923,JSON[_0x2343('0x3a')](_0x5481bc));})[_0x2343('0x3b')](function(_0x2d4724){logger[_0x2343('0x3c')](_0x2343('0x42'),_0x3bf923,JSON[_0x2343('0x3a')](_0x2d4724));});})[_0x2343('0x36')](function(){_0x4a2a3f['next']();});});}else{return rpc[this[_0x2343('0x10')]+_0x2343('0x2b')][_0x2343('0x39')](_0x12c9b7)[_0x2343('0x36')](function(){logger['info'](_0x2343('0x18'),_0x3bf923,_0x12c9b7[_0x2343('0x20')]);})[_0x2343('0x3b')](function(_0x418e19){logger['error'](_0x2343('0x18'),_0x3bf923,JSON[_0x2343('0x3a')](_0x418e19));})[_0x2343('0x3e')](function(){Promise[_0x2343('0x3f')]()['then'](function(){if(_0x39563d[0x0]!=='2'||_0x3698ba[_0x2343('0x19')])return;return rpc[_0x620d49+_0x2343('0x40')]['update'](_0x3698ba['id'],{'autoreplyExecuted':!![]})[_0x2343('0x36')](function(_0xa1d503){logger['info'](_0x2343('0x1a'),_0x3bf923,JSON[_0x2343('0x3a')](_0xa1d503));})['catch'](function(_0x71372f){logger['error'](_0x2343('0x42'),_0x3bf923,JSON[_0x2343('0x3a')](_0x71372f));});})[_0x2343('0x36')](function(){_0x4a2a3f[_0x2343('0x1c')]();});});}}}catch(_0x28db7c){logger['error'](_0x2343('0x18'),_0x3bf923,JSON['stringify'](_0x28db7c));_0x4a2a3f[_0x2343('0x43')]();}};}; \ No newline at end of file +var _0xeaaf=['[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','smtpOptions','then'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_0xeaaf,0x19d));var _0xfeaa=function(_0x49bec4,_0x541f3c){_0x49bec4=_0x49bec4-0x0;var _0x4c68ed=_0xeaaf[_0x49bec4];return _0x4c68ed;};'use strict';var _=require(_0xfeaa('0x0'));var moment=require(_0xfeaa('0x1'));var utils=require(_0xfeaa('0x2'));var logger=require(_0xfeaa('0x3'))(_0xfeaa('0x4'));var rpc={'chatMessage':require(_0xfeaa('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfeaa('0x6')),'faxMessage':require(_0xfeaa('0x7')),'whatsappMessage':require(_0xfeaa('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xfeaa('0x9')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xfeaa('0xa')),'whatsappInteraction':require(_0xfeaa('0xb'))};var mailRpc=require(_0xfeaa('0xc'));exports['consequence']=function(_0x52ffe5,_0x15c5b1,_0x1198c1,_0x54b5d3){return function(_0x3061a6){try{var _0xaba1b5=this[_0xfeaa('0xd')];if(_0xaba1b5===_0xfeaa('0xe')&&_0x54b5d3[_0xfeaa('0xf')][_0xfeaa('0x10')]){logger[_0xfeaa('0x11')](_0xfeaa('0x12'),_0x52ffe5,_0xfeaa('0x13'));return _0x3061a6[_0xfeaa('0x14')]();}if(_0x15c5b1[0x0]==='1'&&(_[_0xfeaa('0x15')](this['interaction'][_0xfeaa('0x16')])||!this[_0xfeaa('0x17')]['created'])){logger['info'](_0xfeaa('0x12'),_0x52ffe5,'Autoreply\x20already\x20sent');return _0x3061a6[_0xfeaa('0x14')]();}if(_0x15c5b1[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger['info'](_0xfeaa('0x18'),_0x52ffe5,_0xfeaa('0x19'));return _0x3061a6[_0xfeaa('0x14')]();}var _0x22d682={'ContactId':this[_0xfeaa('0x1a')]['id'],'sentAt':moment()[_0xfeaa('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xfeaa('0xd')]===_0xfeaa('0xe')){_0x22d682['body']=utils[_0xfeaa('0x1c')](_0x15c5b1[0x2],this);}else{_0x22d682[_0xfeaa('0xf')]=utils[_0xfeaa('0x1c')](_0x15c5b1[0x1],this);}if(this[_0xfeaa('0x1d')]){_0x22d682['to']=this[_0xfeaa('0x1d')][_0xfeaa('0x1e')]||'';if(this[_0xfeaa('0xd')]===_0xfeaa('0xe')&&_0x15c5b1[0x1]==='1'){_0x22d682['cc']=this['message']['cc']||'';}_0x22d682['from']=this[_0xfeaa('0x1d')]['to']||'';_0x22d682[_0xfeaa('0x1f')]=this['message'][_0xfeaa('0x1f')]||'';_0x22d682[_0xfeaa('0x20')]=!![];if(this[_0xfeaa('0x1d')][_0xfeaa('0x21')]){_0x22d682[_0xfeaa('0x21')]='';_0x22d682[_0xfeaa('0x21')]+=_['startsWith'](this[_0xfeaa('0x1d')][_0xfeaa('0x21')],_0xfeaa('0x22'))?'':_0xfeaa('0x23');_0x22d682[_0xfeaa('0x21')]+=this[_0xfeaa('0x1d')][_0xfeaa('0x21')];}}if(this[_0xfeaa('0xd')]==='chat'){_0x22d682[_0xfeaa('0x24')]=this[_0xfeaa('0x25')]['id'];}else{_0x22d682[_[_0xfeaa('0x26')](this[_0xfeaa('0xd')])+_0xfeaa('0x27')]=this['account']['id'];}_0x22d682[_[_0xfeaa('0x26')](this['channel'])+_0xfeaa('0x28')]=this[_0xfeaa('0x17')]['id'];var _0x3a9738=this[_0xfeaa('0x17')];if(rpc[this[_0xfeaa('0xd')]+_0xfeaa('0x29')]){if(this['channel']===_0xfeaa('0xe')){_0x22d682[_0xfeaa('0x2a')]=this[_0xfeaa('0x1d')][_0xfeaa('0x2b')];_0x22d682[_0xfeaa('0x2c')]=_0xfeaa('0x2d')+_[_0xfeaa('0x2e')](_0x22d682[_0xfeaa('0xf')],_0xfeaa('0x2f'),_0xfeaa('0x30'))+_0xfeaa('0x31');_0x22d682[_0xfeaa('0x32')]={'Auto-Submitted':_0xfeaa('0x33'),'X-Auto-Response-Suppress':_0xfeaa('0x34'),'Precedence':_0xfeaa('0x35')};return mailRpc['sendMailMessage'](this[_0xfeaa('0x25')][_0xfeaa('0x36')],_0x22d682)[_0xfeaa('0x37')](function(_0x249238){logger['info'](_0xfeaa('0x38'),_0x52ffe5);_0x22d682[_0xfeaa('0x2b')]=_0x249238[_0xfeaa('0x1d')][_0xfeaa('0x2b')];return rpc[_0xaba1b5+_0xfeaa('0x29')][_0xfeaa('0x39')](_0x22d682);})[_0xfeaa('0x37')](function(_0x3fb20c){logger['info'](_0xfeaa('0x12'),_0x52ffe5,JSON[_0xfeaa('0x3a')](_0x3fb20c));})[_0xfeaa('0x3b')](function(_0x1ca738){logger[_0xfeaa('0x3c')]('[RPC][%s][AUTOREPLY]\x20%s',_0x52ffe5,JSON[_0xfeaa('0x3a')](_0x1ca738));})['finally'](function(){Promise['resolve']()[_0xfeaa('0x37')](function(){if(_0x15c5b1[0x0]!=='2'||_0x3a9738[_0xfeaa('0x3d')])return;return rpc[_0xaba1b5+_0xfeaa('0x3e')][_0xfeaa('0x3f')](_0x3a9738['id'],{'autoreplyExecuted':!![]})[_0xfeaa('0x37')](function(_0xa68ec8){logger[_0xfeaa('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x52ffe5,JSON[_0xfeaa('0x3a')](_0xa68ec8));})[_0xfeaa('0x3b')](function(_0xc73084){logger[_0xfeaa('0x3c')](_0xfeaa('0x40'),_0x52ffe5,JSON[_0xfeaa('0x3a')](_0xc73084));});})[_0xfeaa('0x37')](function(){_0x3061a6[_0xfeaa('0x14')]();});});}else{return rpc[this['channel']+_0xfeaa('0x29')][_0xfeaa('0x39')](_0x22d682)[_0xfeaa('0x37')](function(){logger[_0xfeaa('0x11')](_0xfeaa('0x12'),_0x52ffe5,_0x22d682[_0xfeaa('0xf')]);})[_0xfeaa('0x3b')](function(_0x5f169c){logger['error'](_0xfeaa('0x12'),_0x52ffe5,JSON[_0xfeaa('0x3a')](_0x5f169c));})['finally'](function(){Promise[_0xfeaa('0x41')]()['then'](function(){if(_0x15c5b1[0x0]!=='2'||_0x3a9738[_0xfeaa('0x3d')])return;return rpc[_0xaba1b5+'Interaction'][_0xfeaa('0x3f')](_0x3a9738['id'],{'autoreplyExecuted':!![]})[_0xfeaa('0x37')](function(_0x5b267b){logger[_0xfeaa('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x52ffe5,JSON[_0xfeaa('0x3a')](_0x5b267b));})[_0xfeaa('0x3b')](function(_0x46502d){logger[_0xfeaa('0x3c')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x52ffe5,JSON[_0xfeaa('0x3a')](_0x46502d));});})[_0xfeaa('0x37')](function(){_0x3061a6['next']();});});}}}catch(_0x6b6e6){logger[_0xfeaa('0x3c')](_0xfeaa('0x12'),_0x52ffe5,JSON[_0xfeaa('0x3a')](_0x6b6e6));_0x3061a6[_0xfeaa('0x42')]();}};}; \ 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 994c69c..957fb0d 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 _0x5117=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then'];(function(_0x532cc3,_0x2399d9){var _0x2e1880=function(_0x5ab2b8){while(--_0x5ab2b8){_0x532cc3['push'](_0x532cc3['shift']());}};_0x2e1880(++_0x2399d9);}(_0x5117,0x193));var _0x7511=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x5117[_0x209ec9];return _0x129b1b;};'use strict';var moment=require(_0x7511('0x0'));var logger=require('../../../../config/logger')(_0x7511('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7511('0x2')),'smsInteraction':require(_0x7511('0x3')),'mailInteraction':require(_0x7511('0x4')),'faxInteraction':require(_0x7511('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x7511('0x6')]=function(_0x10567c,_0x2e0eaa,_0x8f381b,_0x19f4fc){return function(_0xd86b37){try{logger[_0x7511('0x7')](_0x7511('0x8'),_0x10567c,_0x2e0eaa[0x0]);var _0x5959ae={'closed':0x1,'closedAt':moment()['format'](_0x7511('0x9')),'closeReason':_0x7511('0xa'),'disposition':_0x2e0eaa[0x0]};if(rpc[_0x19f4fc[_0x7511('0xb')]+_0x7511('0xc')]){rpc[_0x19f4fc[_0x7511('0xb')]+_0x7511('0xc')]['update'](_0x19f4fc[_0x7511('0xd')]['id'],_0x5959ae)[_0x7511('0xe')](function(_0x3be850){logger[_0x7511('0x7')](_0x7511('0xf'),_0x10567c,_0x19f4fc[_0x7511('0xd')]['id']);})[_0x7511('0x10')](function(_0x4117ba){logger[_0x7511('0x11')](_0x7511('0x12'),_0x10567c,JSON[_0x7511('0x13')](_0x4117ba));})[_0x7511('0x14')](function(){_0xd86b37[_0x7511('0x15')]();});}}catch(_0x5df843){logger['error']('[%s][CLOSE]\x20%s',_0x10567c,JSON[_0x7511('0x13')](_0x5df843));_0xd86b37['stop']();}};}; \ No newline at end of file +var _0x0db9=['finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','stringify'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0db9,0xbb));var _0x90db=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x0db9[_0x67f95e];return _0x538f5a;};'use strict';var moment=require(_0x90db('0x0'));var logger=require(_0x90db('0x1'))(_0x90db('0x2'));var rpc={'chatInteraction':require(_0x90db('0x3')),'openchannelInteraction':require(_0x90db('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x90db('0x5')),'faxInteraction':require(_0x90db('0x6')),'whatsappInteraction':require(_0x90db('0x7'))};exports['consequence']=function(_0x3e2e3d,_0x1e9645,_0x1d7ddc,_0x1d794f){return function(_0x42b21d){try{logger['info'](_0x90db('0x8'),_0x3e2e3d,_0x1e9645[0x0]);var _0x50252b={'closed':0x1,'closedAt':moment()[_0x90db('0x9')](_0x90db('0xa')),'closeReason':'system','disposition':_0x1e9645[0x0]};if(rpc[_0x1d794f['channel']+'Interaction']){rpc[_0x1d794f[_0x90db('0xb')]+_0x90db('0xc')][_0x90db('0xd')](_0x1d794f[_0x90db('0xe')]['id'],_0x50252b)[_0x90db('0xf')](function(_0x4497de){logger[_0x90db('0x10')](_0x90db('0x11'),_0x3e2e3d,_0x1d794f['interaction']['id']);})['catch'](function(_0x22765b){logger[_0x90db('0x12')]('[%s][CLOSE]\x20%s',_0x3e2e3d,JSON[_0x90db('0x13')](_0x22765b));})[_0x90db('0x14')](function(){_0x42b21d[_0x90db('0x15')]();});}}catch(_0x4772dd){logger[_0x90db('0x12')](_0x90db('0x16'),_0x3e2e3d,JSON['stringify'](_0x4772dd));_0x42b21d[_0x90db('0x15')]();}};}; \ 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 b8e71b1..e4ac2a4 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 _0x644f=['apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','chat','ChatWebsiteId','InteractionId','created','isEmpty','body','create','then','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','speech','providerName','Message','result','metadata','endConversation','moment'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0x644f,0x177));var _0xf644=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x644f[_0x27c068];return _0xe5a67f;};'use strict';var _=require('lodash');var moment=require(_0xf644('0x0'));var apiai=require(_0xf644('0x1'));var md5=require(_0xf644('0x2'));var utils=require(_0xf644('0x3'));var logger=require(_0xf644('0x4'))(_0xf644('0x5'));var rpc={'chatMessage':require(_0xf644('0x6')),'openchannelMessage':require(_0xf644('0x7')),'mailMessage':require(_0xf644('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf644('0x9'))};exports[_0xf644('0xa')]=function(_0xdb0991,_0x5e44d4){return function(_0x1f826a){try{if(!_[_0xf644('0xb')](this[_0xf644('0xc')][_0xf644('0xd')])){logger[_0xf644('0xe')]('[%s][DIALOGFLOW]\x20%s',_0xdb0991,_0xf644('0xf'));return _0x1f826a[_0xf644('0x10')]();}var _0x33a2c2={'ContactId':this[_0xf644('0x11')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf644('0x12')};if(this['channel']==='sms'||this[_0xf644('0x13')]===_0xf644('0x14')){_0x33a2c2[_0xf644('0x15')]=this['interaction'][_0xf644('0x15')];}var _0x19ace3=this[_0xf644('0x13')];if(_0x19ace3===_0xf644('0x16')){_0x33a2c2[_0xf644('0x17')]=this['account']['id'];}else{_0x33a2c2[_['upperFirst'](_0x19ace3)+'AccountId']=this['account']['id'];}_0x33a2c2[_['upperFirst'](_0x19ace3)+_0xf644('0x18')]=this['interaction']['id'];if(this[_0xf644('0xc')][_0xf644('0x19')]){var _0x43095a=_0x5e44d4[0x2];if(!_[_0xf644('0x1a')](_0x43095a)){_0x33a2c2[_0xf644('0x1b')]=utils['getMustacheRender'](_0x43095a,this);return rpc[_0x19ace3+'Message'][_0xf644('0x1c')](_0x33a2c2)[_0xf644('0x1d')](function(_0x12ee4d){logger[_0xf644('0xe')](_0xf644('0x1e'),_0xdb0991,_0x33a2c2[_0xf644('0x1b')]);})[_0xf644('0x1f')](function(_0x412c3a){logger[_0xf644('0x20')](_0xf644('0x1e'),_0xdb0991,JSON[_0xf644('0x21')](_0x412c3a));})['finally'](function(){logger[_0xf644('0xe')](_0xf644('0x22'),_0xdb0991);_0x1f826a[_0xf644('0x23')]();});}else{logger[_0xf644('0xe')](_0xf644('0x24'),_0xdb0991);_0x1f826a['stop']();}}else{var _0x440314=this;var _0x1aa245=apiai(_0x5e44d4[0x0],{'language':_0x5e44d4[0x1]||'en'});return _0x1aa245[_0xf644('0x25')](this[_0xf644('0x26')][_0xf644('0x1b')],{'sessionId':md5(this['interaction']['id'])})[_0xf644('0x1d')](function(_0x2fe394){_0x440314[_0xf644('0x1b')][_0xf644('0x27')]=_0x2fe394;_0x33a2c2['body']=_0x2fe394['result'][_0xf644('0x28')][_0xf644('0x29')];_0x33a2c2[_0xf644('0x2a')]='dialogflow';_0x33a2c2['providerResponse']=JSON[_0xf644('0x21')](_0x2fe394);return rpc[_0x19ace3+_0xf644('0x2b')][_0xf644('0x1c')](_0x33a2c2)['then'](function(_0x2cec3f){logger['info'](_0xf644('0x1e'),_0xdb0991,_0x33a2c2[_0xf644('0x1b')]);if(_0x2fe394[_0xf644('0x2c')][_0xf644('0x2d')][_0xf644('0x2e')]){_0x1f826a['next']();}else{_0x1f826a['stop']();}})[_0xf644('0x1f')](function(_0x1cd792){logger[_0xf644('0x20')]('[%s][DIALOGFLOW]\x20%s',_0xdb0991,JSON[_0xf644('0x21')](_0x1cd792));_0x1f826a[_0xf644('0x10')]();});})[_0xf644('0x1f')](function(_0x42351e){logger[_0xf644('0x20')]('[%s][DIALOGFLOW]\x20%s',_0xdb0991,_0x42351e[_0xf644('0x26')]);_0x1f826a[_0xf644('0x10')]();});}}catch(_0x21254e){logger['error']('[%s][DIALOGFLOW]\x20%s',_0xdb0991,JSON[_0xf644('0x21')](_0x21254e));_0x1f826a['stop']();}};}; \ No newline at end of file +var _0x9bd9=['interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','body','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','then','dialogflow','result','fulfillment','providerName','stringify','metadata','endConversation','error','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil'];(function(_0x1a7ab0,_0x30092f){var _0x4a8687=function(_0x160df1){while(--_0x160df1){_0x1a7ab0['push'](_0x1a7ab0['shift']());}};_0x4a8687(++_0x30092f);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x1867e3,_0x30e5ce){_0x1867e3=_0x1867e3-0x0;var _0x494e32=_0x9bd9[_0x1867e3];return _0x494e32;};'use strict';var _=require(_0x99bd('0x0'));var moment=require(_0x99bd('0x1'));var apiai=require(_0x99bd('0x2'));var md5=require(_0x99bd('0x3'));var utils=require(_0x99bd('0x4'));var logger=require(_0x99bd('0x5'))('routing');var rpc={'chatMessage':require(_0x99bd('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x99bd('0x7')),'smsMessage':require(_0x99bd('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x99bd('0x9'))};exports[_0x99bd('0xa')]=function(_0x1628ac,_0x3807cd){return function(_0x2b8c78){try{if(!_[_0x99bd('0xb')](this[_0x99bd('0xc')][_0x99bd('0xd')])){logger[_0x99bd('0xe')](_0x99bd('0xf'),_0x1628ac,_0x99bd('0x10'));return _0x2b8c78[_0x99bd('0x11')]();}var _0x2ded61={'ContactId':this[_0x99bd('0x12')]['id'],'sentAt':moment()['format'](_0x99bd('0x13')),'direction':'out'};if(this[_0x99bd('0x14')]==='sms'||this[_0x99bd('0x14')]===_0x99bd('0x15')){_0x2ded61['phone']=this[_0x99bd('0xc')]['phone'];}var _0x223921=this['channel'];if(_0x223921===_0x99bd('0x16')){_0x2ded61[_0x99bd('0x17')]=this[_0x99bd('0x18')]['id'];}else{_0x2ded61[_['upperFirst'](_0x223921)+_0x99bd('0x19')]=this[_0x99bd('0x18')]['id'];}_0x2ded61[_[_0x99bd('0x1a')](_0x223921)+_0x99bd('0x1b')]=this[_0x99bd('0xc')]['id'];if(this[_0x99bd('0xc')][_0x99bd('0x1c')]){var _0x1ee2d2=_0x3807cd[0x2];if(!_[_0x99bd('0x1d')](_0x1ee2d2)){_0x2ded61['body']=utils[_0x99bd('0x1e')](_0x1ee2d2,this);return rpc[_0x223921+_0x99bd('0x1f')][_0x99bd('0x20')](_0x2ded61)['then'](function(_0x4b98fc){logger[_0x99bd('0xe')](_0x99bd('0xf'),_0x1628ac,_0x2ded61[_0x99bd('0x21')]);})[_0x99bd('0x22')](function(_0x1bc297){logger['error'](_0x99bd('0xf'),_0x1628ac,JSON['stringify'](_0x1bc297));})[_0x99bd('0x23')](function(){logger[_0x99bd('0xe')](_0x99bd('0x24'),_0x1628ac);_0x2b8c78[_0x99bd('0x25')]();});}else{logger[_0x99bd('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1628ac);_0x2b8c78[_0x99bd('0x25')]();}}else{var _0x229322=this;var _0x3e339c=apiai(_0x3807cd[0x0],{'language':_0x3807cd[0x1]||'en'});return _0x3e339c['textRequest'](this[_0x99bd('0x26')]['body'],{'sessionId':md5(this['interaction']['id'])})[_0x99bd('0x27')](function(_0xfdc455){_0x229322['body'][_0x99bd('0x28')]=_0xfdc455;_0x2ded61[_0x99bd('0x21')]=_0xfdc455[_0x99bd('0x29')][_0x99bd('0x2a')]['speech'];_0x2ded61[_0x99bd('0x2b')]='dialogflow';_0x2ded61['providerResponse']=JSON[_0x99bd('0x2c')](_0xfdc455);return rpc[_0x223921+'Message'][_0x99bd('0x20')](_0x2ded61)['then'](function(_0x348e18){logger[_0x99bd('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x1628ac,_0x2ded61['body']);if(_0xfdc455[_0x99bd('0x29')][_0x99bd('0x2d')][_0x99bd('0x2e')]){_0x2b8c78['next']();}else{_0x2b8c78[_0x99bd('0x25')]();}})[_0x99bd('0x22')](function(_0x2250d8){logger['error'](_0x99bd('0xf'),_0x1628ac,JSON[_0x99bd('0x2c')](_0x2250d8));_0x2b8c78['next']();});})[_0x99bd('0x22')](function(_0x733bca){logger[_0x99bd('0x2f')](_0x99bd('0xf'),_0x1628ac,_0x733bca['message']);_0x2b8c78[_0x99bd('0x11')]();});}}catch(_0x22ef33){logger['error'](_0x99bd('0xf'),_0x1628ac,JSON['stringify'](_0x22ef33));_0x2b8c78['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 545eefd..000f136 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf684=['isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','InteractionId','created','isEmpty','finally','info','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','next','lodash','md5','bluebird','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence'];(function(_0x2c850d,_0x726486){var _0x314bb3=function(_0x396207){while(--_0x396207){_0x2c850d['push'](_0x2c850d['shift']());}};_0x314bb3(++_0x726486);}(_0xf684,0x1d9));var _0x4f68=function(_0x31bf90,_0x577339){_0x31bf90=_0x31bf90-0x0;var _0x106cd8=_0xf684[_0x31bf90];return _0x106cd8;};'use strict';var _=require(_0x4f68('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x4f68('0x1'));var moment=require('moment');var Promise=require(_0x4f68('0x2'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x4f68('0x3'));var rpc={'chatMessage':require(_0x4f68('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4f68('0x5')),'smsMessage':require(_0x4f68('0x6')),'faxMessage':require(_0x4f68('0x7')),'whatsappMessage':require(_0x4f68('0x8'))};function createMessage(_0x2ffcbc,_0x439a57,_0x573572,_0x476cd3){return new Promise(function(_0x528f90,_0x475dcf){var _0x4f2d3d=_['clone'](_0x573572);_0x4f2d3d[_0x4f68('0x9')]=_0x476cd3;return rpc[_0x439a57+'Message'][_0x4f68('0xa')](_0x4f2d3d)[_0x4f68('0xb')](function(){logger['info'](_0x4f68('0xc'),_0x2ffcbc,_0x4f2d3d[_0x4f68('0x9')]);_0x528f90();})[_0x4f68('0xd')](function(_0x42f620){logger[_0x4f68('0xe')](_0x4f68('0xc'),_0x2ffcbc,JSON[_0x4f68('0xf')](_0x42f620));_0x475dcf(_0x42f620);});});}exports[_0x4f68('0x10')]=function(_0x492728,_0x47b658){return function(_0x486cd6){try{if(!_[_0x4f68('0x11')](this[_0x4f68('0x12')][_0x4f68('0x13')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x492728,_0x4f68('0x14'));return _0x486cd6['next']();}var _0x3d7e1a={'ContactId':this[_0x4f68('0x15')]['id'],'sentAt':moment()[_0x4f68('0x16')](_0x4f68('0x17')),'direction':_0x4f68('0x18')};if(this[_0x4f68('0x19')]==='sms'||this['channel']===_0x4f68('0x1a')){_0x3d7e1a[_0x4f68('0x1b')]=this[_0x4f68('0x12')][_0x4f68('0x1b')];}var _0x2a513d=this[_0x4f68('0x19')];if(_0x2a513d===_0x4f68('0x1c')){_0x3d7e1a[_0x4f68('0x1d')]=this['account']['id'];}else{_0x3d7e1a[_['upperFirst'](_0x2a513d)+_0x4f68('0x1e')]=this['account']['id'];}_0x3d7e1a[_['upperFirst'](_0x2a513d)+_0x4f68('0x1f')]=this[_0x4f68('0x12')]['id'];if(this[_0x4f68('0x12')][_0x4f68('0x20')]){var _0x16c540=_0x47b658[0x4];if(!_[_0x4f68('0x21')](_0x16c540)){_0x3d7e1a[_0x4f68('0x9')]=utils['getMustacheRender'](_0x16c540,this);return rpc[_0x2a513d+'Message'][_0x4f68('0xa')](_0x3d7e1a)[_0x4f68('0xb')](function(_0xfaac70){logger['info'](_0x4f68('0xc'),_0x492728,_0x3d7e1a[_0x4f68('0x9')]);})['catch'](function(_0x48712a){logger[_0x4f68('0xe')](_0x4f68('0xc'),_0x492728,JSON[_0x4f68('0xf')](_0x48712a));})[_0x4f68('0x22')](function(){logger[_0x4f68('0x23')](_0x4f68('0x24'),_0x492728);_0x486cd6[_0x4f68('0x25')]();});}else{logger['info'](_0x4f68('0x26'),_0x492728);_0x486cd6[_0x4f68('0x25')]();}}else{var _0x15443f=this;var _0x1f2e75=_0x47b658[0x2]['replace'](/\\n/g,'\x0a');var _0x1a8e2a={'credentials':{'private_key':_0x1f2e75,'client_email':_0x47b658[0x1]}};var _0x5c54e0=new dialogflow[(_0x4f68('0x27'))](_0x1a8e2a);var _0x454f24=_0x5c54e0[_0x4f68('0x28')](_0x47b658[0x0],md5(_0x15443f[_0x4f68('0x12')]['id']));var _0x19630a={'session':_0x454f24,'queryInput':{'text':{'text':_0x15443f[_0x4f68('0x29')][_0x4f68('0x9')],'languageCode':_0x47b658[0x3]||'en'}}};return _0x5c54e0[_0x4f68('0x2a')](_0x19630a)[_0x4f68('0xb')](function(_0x464833){if(_0x464833&&_0x464833[_0x4f68('0x2b')]){_0x15443f[_0x4f68('0x9')][_0x4f68('0x2c')]=_0x464833;var _0x291dbd=_0x464833[0x0];var _0x102c0b=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')]&&_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')][_0x4f68('0x2f')]?_0x291dbd[_0x4f68('0x2d')]['diagnosticInfo'][_0x4f68('0x2f')][_0x4f68('0x30')][_0x4f68('0x31')]:![];_0x15443f[_0x4f68('0x9')]['DIALOGFLOWV2_ACTION']=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x32')];_0x15443f[_0x4f68('0x9')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x291dbd[_0x4f68('0x2d')]['allRequiredParamsPresent'];_0x15443f[_0x4f68('0x9')][_0x4f68('0x33')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')]&&_0x291dbd[_0x4f68('0x2d')]['diagnosticInfo'][_0x4f68('0x2f')]?_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x2e')][_0x4f68('0x2f')]['end_conversation']['boolValue']:![];_0x15443f[_0x4f68('0x9')][_0x4f68('0x34')]=_0x291dbd[_0x4f68('0x2d')]['intent'][_0x4f68('0x35')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x36')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x37')][_0x4f68('0x38')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x39')]=_0x291dbd['queryResult']['intent'][_0x4f68('0x3a')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x3b')]=_0x291dbd[_0x4f68('0x2d')]['languageCode'];_0x15443f[_0x4f68('0x9')][_0x4f68('0x3c')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x3d')];_0x15443f[_0x4f68('0x9')][_0x4f68('0x3e')]=_0x291dbd[_0x4f68('0x2d')][_0x4f68('0x3f')];_0x3d7e1a[_0x4f68('0x40')]=_0x4f68('0x2c');_0x3d7e1a[_0x4f68('0x41')]=JSON[_0x4f68('0xf')](_0x464833);var _0x58c48d=[];for(var _0x2ea873=0x0;_0x2ea873<_0x464833['length'];_0x2ea873++){var _0x378eff=_0x464833[_0x2ea873];if(_0x378eff&&_0x378eff[_0x4f68('0x2d')]&&_0x378eff[_0x4f68('0x2d')]['fulfillmentText']){_0x58c48d[_0x4f68('0x42')](createMessage(_0x492728,_0x2a513d,_0x3d7e1a,_0x378eff[_0x4f68('0x2d')][_0x4f68('0x43')]));}}return Promise[_0x4f68('0x44')](_0x58c48d)[_0x4f68('0xb')](function(){if(_0x102c0b){_0x486cd6[_0x4f68('0x45')]();}else{_0x486cd6[_0x4f68('0x25')]();}})[_0x4f68('0xd')](function(_0x5becf0){logger[_0x4f68('0xe')](_0x4f68('0xc'),_0x492728,JSON[_0x4f68('0xf')](_0x5becf0));_0x486cd6['next']();});}})[_0x4f68('0xd')](function(_0x2f39db){logger['error'](_0x4f68('0xc'),_0x492728,_0x2f39db['message']);_0x486cd6[_0x4f68('0x45')]();});}}catch(_0x31461e){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x492728,JSON[_0x4f68('0xf')](_0x31461e));_0x486cd6[_0x4f68('0x25')]();}};}; \ No newline at end of file +var _0xe288=['../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','consequence','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','account','upperFirst','AccountId','getMustacheRender','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','length','fulfillmentText','push','all','next','error','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe288,0x104));var _0x8e28=function(_0x1df14f,_0x122ced){_0x1df14f=_0x1df14f-0x0;var _0x3f6e46=_0xe288[_0x1df14f];return _0x3f6e46;};'use strict';var _=require(_0x8e28('0x0'));var dialogflow=require(_0x8e28('0x1'));var md5=require(_0x8e28('0x2'));var moment=require(_0x8e28('0x3'));var Promise=require(_0x8e28('0x4'));var logger=require(_0x8e28('0x5'))(_0x8e28('0x6'));var utils=require(_0x8e28('0x7'));var rpc={'chatMessage':require(_0x8e28('0x8')),'openchannelMessage':require(_0x8e28('0x9')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8e28('0xa')),'faxMessage':require(_0x8e28('0xb')),'whatsappMessage':require(_0x8e28('0xc'))};function createMessage(_0x53dc76,_0x807217,_0x455626,_0x59374a){return new Promise(function(_0x444f2a,_0x10a3e1){var _0x31b00c=_[_0x8e28('0xd')](_0x455626);_0x31b00c[_0x8e28('0xe')]=_0x59374a;return rpc[_0x807217+_0x8e28('0xf')][_0x8e28('0x10')](_0x31b00c)[_0x8e28('0x11')](function(){logger['info'](_0x8e28('0x12'),_0x53dc76,_0x31b00c[_0x8e28('0xe')]);_0x444f2a();})[_0x8e28('0x13')](function(_0x4850b1){logger['error'](_0x8e28('0x12'),_0x53dc76,JSON[_0x8e28('0x14')](_0x4850b1));_0x10a3e1(_0x4850b1);});});}exports[_0x8e28('0x15')]=function(_0x46d60d,_0x570864){return function(_0x2de3af){try{if(!_['isNil'](this[_0x8e28('0x16')]['UserId'])){logger[_0x8e28('0x17')]('[%s][DIALOGFLOWV2]\x20%s',_0x46d60d,_0x8e28('0x18'));return _0x2de3af['next']();}var _0x129928={'ContactId':this[_0x8e28('0x19')]['id'],'sentAt':moment()[_0x8e28('0x1a')](_0x8e28('0x1b')),'direction':_0x8e28('0x1c')};if(this['channel']==='sms'||this[_0x8e28('0x1d')]===_0x8e28('0x1e')){_0x129928['phone']=this[_0x8e28('0x16')][_0x8e28('0x1f')];}var _0x5a325a=this[_0x8e28('0x1d')];if(_0x5a325a===_0x8e28('0x20')){_0x129928['ChatWebsiteId']=this[_0x8e28('0x21')]['id'];}else{_0x129928[_[_0x8e28('0x22')](_0x5a325a)+_0x8e28('0x23')]=this[_0x8e28('0x21')]['id'];}_0x129928[_[_0x8e28('0x22')](_0x5a325a)+'InteractionId']=this['interaction']['id'];if(this[_0x8e28('0x16')]['created']){var _0x3306ab=_0x570864[0x4];if(!_['isEmpty'](_0x3306ab)){_0x129928[_0x8e28('0xe')]=utils[_0x8e28('0x24')](_0x3306ab,this);return rpc[_0x5a325a+_0x8e28('0xf')]['create'](_0x129928)['then'](function(_0x55ac67){logger[_0x8e28('0x17')](_0x8e28('0x12'),_0x46d60d,_0x129928['body']);})[_0x8e28('0x13')](function(_0x4d61e7){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x46d60d,JSON[_0x8e28('0x14')](_0x4d61e7));})['finally'](function(){logger[_0x8e28('0x17')](_0x8e28('0x25'),_0x46d60d);_0x2de3af[_0x8e28('0x26')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x46d60d);_0x2de3af[_0x8e28('0x26')]();}}else{var _0x1680f8=this;var _0x21bfd7=_0x570864[0x2][_0x8e28('0x27')](/\\n/g,'\x0a');var _0x45c644={'credentials':{'private_key':_0x21bfd7,'client_email':_0x570864[0x1]}};var _0x449197=new dialogflow[(_0x8e28('0x28'))](_0x45c644);var _0x49f009=_0x449197[_0x8e28('0x29')](_0x570864[0x0],md5(_0x1680f8[_0x8e28('0x16')]['id']));var _0x2f6c54={'session':_0x49f009,'queryInput':{'text':{'text':_0x1680f8[_0x8e28('0x2a')]['body'],'languageCode':_0x570864[0x3]||'en'}}};return _0x449197['detectIntent'](_0x2f6c54)[_0x8e28('0x11')](function(_0x22d336){if(_0x22d336&&_0x22d336['length']){_0x1680f8[_0x8e28('0xe')][_0x8e28('0x2b')]=_0x22d336;var _0x354174=_0x22d336[0x0];var _0x3d7f19=_0x354174[_0x8e28('0x2c')][_0x8e28('0x2d')]&&_0x354174[_0x8e28('0x2c')][_0x8e28('0x2d')][_0x8e28('0x2e')]?_0x354174[_0x8e28('0x2c')]['diagnosticInfo'][_0x8e28('0x2e')][_0x8e28('0x2f')]['boolValue']:![];_0x1680f8[_0x8e28('0xe')][_0x8e28('0x30')]=_0x354174[_0x8e28('0x2c')][_0x8e28('0x31')];_0x1680f8[_0x8e28('0xe')][_0x8e28('0x32')]=_0x354174['queryResult']['allRequiredParamsPresent'];_0x1680f8['body'][_0x8e28('0x33')]=_0x354174[_0x8e28('0x2c')][_0x8e28('0x2d')]&&_0x354174[_0x8e28('0x2c')][_0x8e28('0x2d')][_0x8e28('0x2e')]?_0x354174[_0x8e28('0x2c')][_0x8e28('0x2d')][_0x8e28('0x2e')][_0x8e28('0x2f')]['boolValue']:![];_0x1680f8[_0x8e28('0xe')]['DIALOGFLOWV2_INTENTNAME']=_0x354174[_0x8e28('0x2c')]['intent'][_0x8e28('0x34')];_0x1680f8[_0x8e28('0xe')][_0x8e28('0x35')]=_0x354174['queryResult'][_0x8e28('0x36')]['displayName'];_0x1680f8[_0x8e28('0xe')][_0x8e28('0x37')]=_0x354174['queryResult'][_0x8e28('0x36')]['isFallback'];_0x1680f8[_0x8e28('0xe')][_0x8e28('0x38')]=_0x354174[_0x8e28('0x2c')][_0x8e28('0x39')];_0x1680f8['body'][_0x8e28('0x3a')]=_0x354174[_0x8e28('0x2c')][_0x8e28('0x3b')];_0x1680f8[_0x8e28('0xe')]['DIALOGFLOWV2_SCORE']=_0x354174[_0x8e28('0x2c')][_0x8e28('0x3c')];_0x129928[_0x8e28('0x3d')]=_0x8e28('0x2b');_0x129928['providerResponse']=JSON[_0x8e28('0x14')](_0x22d336);var _0x45ce06=[];for(var _0x57f753=0x0;_0x57f753<_0x22d336[_0x8e28('0x3e')];_0x57f753++){var _0x44dae1=_0x22d336[_0x57f753];if(_0x44dae1&&_0x44dae1[_0x8e28('0x2c')]&&_0x44dae1[_0x8e28('0x2c')][_0x8e28('0x3f')]){_0x45ce06[_0x8e28('0x40')](createMessage(_0x46d60d,_0x5a325a,_0x129928,_0x44dae1[_0x8e28('0x2c')]['fulfillmentText']));}}return Promise[_0x8e28('0x41')](_0x45ce06)[_0x8e28('0x11')](function(){if(_0x3d7f19){_0x2de3af[_0x8e28('0x42')]();}else{_0x2de3af['stop']();}})[_0x8e28('0x13')](function(_0x4db567){logger[_0x8e28('0x43')](_0x8e28('0x12'),_0x46d60d,JSON[_0x8e28('0x14')](_0x4db567));_0x2de3af[_0x8e28('0x42')]();});}})[_0x8e28('0x13')](function(_0x2ef73f){logger[_0x8e28('0x43')](_0x8e28('0x12'),_0x46d60d,_0x2ef73f[_0x8e28('0x2a')]);_0x2de3af[_0x8e28('0x42')]();});}}catch(_0x503fe8){logger[_0x8e28('0x43')](_0x8e28('0x12'),_0x46d60d,JSON['stringify'](_0x503fe8));_0x2de3af[_0x8e28('0x26')]();}};}; \ 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 77c5a13..09ca3aa 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 _0x9cda=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','./utils','../../../../config/logger','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next'];(function(_0x320fea,_0x3486e1){var _0x40160c=function(_0x3e0590){while(--_0x3e0590){_0x320fea['push'](_0x320fea['shift']());}};_0x40160c(++_0x3486e1);}(_0x9cda,0x13f));var _0xa9cd=function(_0x5c48f7,_0x1e4676){_0x5c48f7=_0x5c48f7-0x0;var _0x53fb6b=_0x9cda[_0x5c48f7];return _0x53fb6b;};'use strict';var schema=require(_0xa9cd('0x0'));var _=require(_0xa9cd('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xa9cd('0x2'));var logger=require(_0xa9cd('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xa9cd('0x4')}});exports[_0xa9cd('0x5')]=function(_0x238dcf,_0x476689){return function(_0x33d373){try{var _0x262a62={'condition':htmlToText['fromString'](utils[_0xa9cd('0x6')](_0x476689[0x0],this),{'wordwrap':![]})[_0xa9cd('0x7')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x476689[0x1],'priorityFalse':_0x476689[0x2]};var _0x37ec0a=gotoif[_0xa9cd('0x0')](_0x262a62,{'typecast':!![]});if(_0x37ec0a['length']){logger[_0xa9cd('0x8')](_0xa9cd('0x9'),_0x238dcf,_[_0xa9cd('0xa')](_0x37ec0a,'message')[_0xa9cd('0xb')](',\x20'));_0x33d373[_0xa9cd('0xc')]();}else{try{var _0x291d86=eval('('+_0x262a62[_0xa9cd('0xd')]+')');var _0x5a302b=_0x291d86?_0x262a62[_0xa9cd('0xe')]:_0x262a62[_0xa9cd('0xf')];logger[_0xa9cd('0x10')](_0xa9cd('0x11'),_0x238dcf,_0x262a62[_0xa9cd('0xd')],_0x291d86,_0x5a302b||_0xa9cd('0x12'));if(_0x5a302b){var _0x3cf4fc=_[_0xa9cd('0x13')](_0x33d373[_0xa9cd('0x14')](),{'p':_0x5a302b});if(_0x3cf4fc>=0x0){logger[_0xa9cd('0x10')](_0xa9cd('0x15'),_0x238dcf,_0x5a302b||_0xa9cd('0x12'),_0x3cf4fc);_0x33d373[_0xa9cd('0x12')](_0x3cf4fc);}else{logger[_0xa9cd('0x10')](_0xa9cd('0x16'),_0x238dcf,_0x5a302b||_0xa9cd('0x12'));_0x33d373['stop']();}}else{_0x33d373[_0xa9cd('0x12')]();}}catch(_0x4e157e){logger[_0xa9cd('0x8')](_0xa9cd('0x17'),_0x238dcf,_0x4e157e[_0xa9cd('0x18')]);_0x33d373['stop']();}}}catch(_0x326fe6){logger['error'](_0xa9cd('0x9'),_0x238dcf,JSON[_0xa9cd('0x19')](_0x326fe6));_0x33d373['stop']();}};}; \ No newline at end of file +var _0x7f84=['priorityTrue','info','condition','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','error','[%s][GOTOIF]\x20%s','map','message','join','stop'];(function(_0x5574ad,_0x57ef3f){var _0x91880e=function(_0x352000){while(--_0x352000){_0x5574ad['push'](_0x5574ad['shift']());}};_0x91880e(++_0x57ef3f);}(_0x7f84,0x1b7));var _0x47f8=function(_0x391d2a,_0x16b229){_0x391d2a=_0x391d2a-0x0;var _0x27deab=_0x7f84[_0x391d2a];return _0x27deab;};'use strict';var schema=require(_0x47f8('0x0'));var _=require(_0x47f8('0x1'));var htmlToText=require(_0x47f8('0x2'));var utils=require(_0x47f8('0x3'));var logger=require('../../../../config/logger')(_0x47f8('0x4'));var gotoif=schema({'condition':{'type':_0x47f8('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x47f8('0x6')},'priorityFalse':{'type':_0x47f8('0x7'),'message':_0x47f8('0x8')}});exports[_0x47f8('0x9')]=function(_0x1fc1d7,_0x517a49){return function(_0x5808a4){try{var _0x530f73={'condition':htmlToText[_0x47f8('0xa')](utils['getMustacheRender'](_0x517a49[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x517a49[0x1],'priorityFalse':_0x517a49[0x2]};var _0x163f42=gotoif['validate'](_0x530f73,{'typecast':!![]});if(_0x163f42['length']){logger[_0x47f8('0xb')](_0x47f8('0xc'),_0x1fc1d7,_[_0x47f8('0xd')](_0x163f42,_0x47f8('0xe'))[_0x47f8('0xf')](',\x20'));_0x5808a4[_0x47f8('0x10')]();}else{try{var _0x5816f5=eval('('+_0x530f73['condition']+')');var _0x35ace1=_0x5816f5?_0x530f73[_0x47f8('0x11')]:_0x530f73['priorityFalse'];logger[_0x47f8('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1fc1d7,_0x530f73[_0x47f8('0x13')],_0x5816f5,_0x35ace1||'next');if(_0x35ace1){var _0x544d90=_['findIndex'](_0x5808a4['rules'](),{'p':_0x35ace1});if(_0x544d90>=0x0){logger[_0x47f8('0x12')](_0x47f8('0x14'),_0x1fc1d7,_0x35ace1||_0x47f8('0x15'),_0x544d90);_0x5808a4['next'](_0x544d90);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1fc1d7,_0x35ace1||_0x47f8('0x15'));_0x5808a4['stop']();}}else{_0x5808a4[_0x47f8('0x15')]();}}catch(_0x4039fa){logger[_0x47f8('0xb')](_0x47f8('0x16'),_0x1fc1d7,_0x4039fa[_0x47f8('0xe')]);_0x5808a4[_0x47f8('0x10')]();}}}catch(_0x5e53be){logger[_0x47f8('0xb')](_0x47f8('0xc'),_0x1fc1d7,JSON[_0x47f8('0x17')](_0x5e53be));_0x5808a4[_0x47f8('0x10')]();}};}; \ 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 c07768b..90ffdeb 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 _0x2702=['[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash','../../../../config/logger','routing','length','error'];(function(_0x9edad2,_0x80d042){var _0x3e68f6=function(_0xdcaf0){while(--_0xdcaf0){_0x9edad2['push'](_0x9edad2['shift']());}};_0x3e68f6(++_0x80d042);}(_0x2702,0x18a));var _0x2270=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x2702[_0x484e36];return _0xafc85d;};'use strict';var schema=require(_0x2270('0x0'));var _=require(_0x2270('0x1'));var logger=require(_0x2270('0x2'))(_0x2270('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x41e43c,_0x14e61d){return function(_0x2164ee){try{var _0x4bf569={'priority':_0x14e61d[0x0]};var _0x1633ab=gotop[_0x2270('0x0')](_0x4bf569,{'typecast':!![]});if(_0x1633ab[_0x2270('0x4')]){logger[_0x2270('0x5')](_0x2270('0x6'),_0x41e43c,_['map'](_0x1633ab,_0x2270('0x7'))[_0x2270('0x8')](',\x20'));_0x2164ee[_0x2270('0x9')]();}else{logger[_0x2270('0xa')](_0x2270('0xb'),_0x41e43c,_0x4bf569[_0x2270('0xc')]);if(_0x4bf569[_0x2270('0xc')]){var _0x159960=_['findIndex'](_0x2164ee[_0x2270('0xd')](),{'p':_0x4bf569[_0x2270('0xc')]});if(_0x159960>=0x0){logger[_0x2270('0xa')](_0x2270('0xe'),_0x41e43c,_0x4bf569[_0x2270('0xc')]||_0x2270('0xf'),_0x159960);_0x2164ee['next'](_0x159960);}else{logger[_0x2270('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x41e43c,_0x4bf569[_0x2270('0xc')]||_0x2270('0xf'));_0x2164ee[_0x2270('0x9')]();}}else{_0x2164ee[_0x2270('0xf')]();}}}catch(_0x44a83a){logger['error'](_0x2270('0x6'),_0x41e43c,JSON['stringify'](_0x44a83a));_0x2164ee[_0x2270('0x9')]();}};}; \ No newline at end of file +var _0x7f1a=['validate','length','error','map','message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x7c10ec,_0x4bde9a){var _0xa7bd3=function(_0x57a0e6){while(--_0x57a0e6){_0x7c10ec['push'](_0x7c10ec['shift']());}};_0xa7bd3(++_0x4bde9a);}(_0x7f1a,0x1f3));var _0xa7f1=function(_0x262b2c,_0x50dc7c){_0x262b2c=_0x262b2c-0x0;var _0x109846=_0x7f1a[_0x262b2c];return _0x109846;};'use strict';var schema=require('validate');var _=require(_0xa7f1('0x0'));var logger=require(_0xa7f1('0x1'))('routing');var gotop=schema({'priority':{'type':_0xa7f1('0x2'),'required':!![],'message':_0xa7f1('0x3')}});exports[_0xa7f1('0x4')]=function(_0xa7fa5a,_0x3c1b39){return function(_0x59da87){try{var _0x26eb42={'priority':_0x3c1b39[0x0]};var _0x5209f2=gotop[_0xa7f1('0x5')](_0x26eb42,{'typecast':!![]});if(_0x5209f2[_0xa7f1('0x6')]){logger[_0xa7f1('0x7')]('[%s][GOTOP]\x20%s',_0xa7fa5a,_[_0xa7f1('0x8')](_0x5209f2,_0xa7f1('0x9'))[_0xa7f1('0xa')](',\x20'));_0x59da87[_0xa7f1('0xb')]();}else{logger[_0xa7f1('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0xa7fa5a,_0x26eb42['priority']);if(_0x26eb42[_0xa7f1('0xd')]){var _0x5834e0=_[_0xa7f1('0xe')](_0x59da87[_0xa7f1('0xf')](),{'p':_0x26eb42[_0xa7f1('0xd')]});if(_0x5834e0>=0x0){logger[_0xa7f1('0xc')](_0xa7f1('0x10'),_0xa7fa5a,_0x26eb42[_0xa7f1('0xd')]||_0xa7f1('0x11'),_0x5834e0);_0x59da87[_0xa7f1('0x11')](_0x5834e0);}else{logger[_0xa7f1('0xc')](_0xa7f1('0x12'),_0xa7fa5a,_0x26eb42[_0xa7f1('0xd')]||_0xa7f1('0x11'));_0x59da87[_0xa7f1('0xb')]();}}else{_0x59da87['next']();}}}catch(_0x3a9689){logger[_0xa7f1('0x7')](_0xa7f1('0x13'),_0xa7fa5a,JSON[_0xa7f1('0x14')](_0x3a9689));_0x59da87[_0xa7f1('0xb')]();}};}; \ 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 bcb59cf..9790eee 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 _0x3134=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','../../../../config/logger','../../rpc/chatMessage'];(function(_0x174ee,_0x17c7cb){var _0x4be1f4=function(_0x2234ae){while(--_0x2234ae){_0x174ee['push'](_0x174ee['shift']());}};_0x4be1f4(++_0x17c7cb);}(_0x3134,0x99));var _0x4313=function(_0xd9f925,_0x562018){_0xd9f925=_0xd9f925-0x0;var _0x3ed453=_0x3134[_0xd9f925];return _0x3ed453;};'use strict';var _=require(_0x4313('0x0'));var utils=require('./utils');var logger=require(_0x4313('0x1'))('routing');var rpc={'chatMessage':require(_0x4313('0x2')),'openchannelMessage':require(_0x4313('0x3')),'mailMessage':require(_0x4313('0x4')),'smsMessage':require(_0x4313('0x5')),'faxMessage':require(_0x4313('0x6')),'whatsappMessage':require(_0x4313('0x7'))};exports[_0x4313('0x8')]=function(_0x4445c9,_0x4a9780){return function(_0x48df23){try{var _0x2854ac={'body':utils[_0x4313('0x9')](_0x4a9780[0x0],this),'ContactId':this['contact']['id']};if(this[_0x4313('0xa')]==='chat'){_0x2854ac[_0x4313('0xb')]=this[_0x4313('0xc')]['id'];}else{_0x2854ac[_[_0x4313('0xd')](this[_0x4313('0xa')])+_0x4313('0xe')]=this[_0x4313('0xc')]['id'];}_0x2854ac[_['upperFirst'](this['channel'])+_0x4313('0xf')]=this[_0x4313('0x10')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x4313('0xa')]+'Message'][_0x4313('0x11')](_0x2854ac)[_0x4313('0x12')](function(_0xfd8e4b){logger['info'](_0x4313('0x13'),_0x4445c9,_0x2854ac[_0x4313('0x14')]);_0x48df23[_0x4313('0x15')]();})[_0x4313('0x16')](function(_0xcc005a){logger[_0x4313('0x17')](_0x4313('0x13'),_0x4445c9,JSON['stringify'](_0xcc005a));_0x48df23['stop']();});}}catch(_0x3ba7b0){logger[_0x4313('0x17')]('[%s][MESSAGE]\x20%s',_0x4445c9,JSON[_0x4313('0x18')](_0x3ba7b0));_0x48df23[_0x4313('0x19')]();}};}; \ No newline at end of file +var _0x282b=['../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing'];(function(_0x512b68,_0x5a6877){var _0x2544d9=function(_0x30f4d5){while(--_0x30f4d5){_0x512b68['push'](_0x512b68['shift']());}};_0x2544d9(++_0x5a6877);}(_0x282b,0xec));var _0xb282=function(_0x250722,_0xf50231){_0x250722=_0x250722-0x0;var _0x38892c=_0x282b[_0x250722];return _0x38892c;};'use strict';var _=require(_0xb282('0x0'));var utils=require(_0xb282('0x1'));var logger=require(_0xb282('0x2'))(_0xb282('0x3'));var rpc={'chatMessage':require(_0xb282('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb282('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb282('0x6'))};exports[_0xb282('0x7')]=function(_0x283325,_0x1dd19b){return function(_0x3cad41){try{var _0x33635f={'body':utils['getMustacheRender'](_0x1dd19b[0x0],this),'ContactId':this['contact']['id']};if(this[_0xb282('0x8')]===_0xb282('0x9')){_0x33635f['ChatWebsiteId']=this[_0xb282('0xa')]['id'];}else{_0x33635f[_[_0xb282('0xb')](this[_0xb282('0x8')])+_0xb282('0xc')]=this['account']['id'];}_0x33635f[_['upperFirst'](this[_0xb282('0x8')])+_0xb282('0xd')]=this[_0xb282('0xe')]['id'];if(rpc[this[_0xb282('0x8')]+_0xb282('0xf')]){return rpc[this['channel']+'Message'][_0xb282('0x10')](_0x33635f)[_0xb282('0x11')](function(_0x40d7b8){logger[_0xb282('0x12')](_0xb282('0x13'),_0x283325,_0x33635f['body']);_0x3cad41[_0xb282('0x14')]();})['catch'](function(_0xe1d53){logger[_0xb282('0x15')]('[%s][MESSAGE]\x20%s',_0x283325,JSON['stringify'](_0xe1d53));_0x3cad41['stop']();});}}catch(_0x13cea1){logger[_0xb282('0x15')](_0xb282('0x13'),_0x283325,JSON[_0xb282('0x16')](_0x13cea1));_0x3cad41[_0xb282('0x17')]();}};}; \ 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 4caf74d..2af7da8 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 _0x4729=['./utils','../../../../config/logger','routing','consequence','info','error','stringify'];(function(_0x21a0f3,_0x4091d2){var _0xcb094b=function(_0xaeb6ee){while(--_0xaeb6ee){_0x21a0f3['push'](_0x21a0f3['shift']());}};_0xcb094b(++_0x4091d2);}(_0x4729,0x8c));var _0x9472=function(_0x3c00e6,_0x5574d0){_0x3c00e6=_0x3c00e6-0x0;var _0x32387b=_0x4729[_0x3c00e6];return _0x32387b;};'use strict';var utils=require(_0x9472('0x0'));var logger=require(_0x9472('0x1'))(_0x9472('0x2'));exports[_0x9472('0x3')]=function(_0x2dbb71,_0x499a05){return function(_0x3a0709){try{logger[_0x9472('0x4')]('[%s][NOOP]\x20%s',_0x2dbb71,utils['getMustacheRender'](_0x499a05[0x0],this));_0x3a0709['next']();}catch(_0x3863b6){logger[_0x9472('0x5')]('[%s][NOOP]\x20%s',_0x2dbb71,JSON[_0x9472('0x6')](_0x3863b6));_0x3a0709['stop']();}};}; \ No newline at end of file +var _0x209a=['../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','./utils'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x209a,0xc7));var _0xa209=function(_0x23815e,_0x4bb3d6){_0x23815e=_0x23815e-0x0;var _0x15c6c7=_0x209a[_0x23815e];return _0x15c6c7;};'use strict';var utils=require(_0xa209('0x0'));var logger=require(_0xa209('0x1'))(_0xa209('0x2'));exports[_0xa209('0x3')]=function(_0x323728,_0x36df31){return function(_0x3310b7){try{logger['info'](_0xa209('0x4'),_0x323728,utils[_0xa209('0x5')](_0x36df31[0x0],this));_0x3310b7[_0xa209('0x6')]();}catch(_0x274085){logger['error']('[%s][NOOP]\x20%s',_0x323728,JSON[_0xa209('0x7')](_0x274085));_0x3310b7['stop']();}};}; \ 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 2151bee..1b59447 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 _0x36ad=['lodash','util','seq-queue','moment','ioredis','../../../../config/logger','./strategy','redis','defaults','socket.io-emitter','queue_id','queue','from','joinAt','clone','account','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','toLowerCase','map','join','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate'];(function(_0x16e569,_0x249923){var _0x112561=function(_0x32b6b0){while(--_0x32b6b0){_0x16e569['push'](_0x16e569['shift']());}};_0x112561(++_0x249923);}(_0x36ad,0x95));var _0xd36a=function(_0x414a24,_0x1d4c99){_0x414a24=_0x414a24-0x0;var _0xb70834=_0x36ad[_0x414a24];return _0xb70834;};'use strict';var schema=require(_0xd36a('0x0'));var _=require(_0xd36a('0x1'));var util=require(_0xd36a('0x2'));var seqqueue=require(_0xd36a('0x3'));var moment=require(_0xd36a('0x4'));var Redis=require(_0xd36a('0x5'));var config=require('../../../../config/environment');var logger=require(_0xd36a('0x6'))('routing');var strategy=require(_0xd36a('0x7'));config[_0xd36a('0x8')]=_[_0xd36a('0x9')](config[_0xd36a('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd36a('0xa'))(new Redis(config[_0xd36a('0x8')]));var attributes=['id',_0xd36a('0xb'),'account',_0xd36a('0xc'),_0xd36a('0xd'),_0xd36a('0xe')];function emit(_0x335c36,_0x1cb86b,_0x39b0f0){io['to'](_0x335c36)['emit'](_0x1cb86b,_0x39b0f0);}function emitChannelQueueInteraction(_0x257088,_0x27aded,_0x1e8e62,_0x2047fe,_0x57c05c,_0x14bc50,_0x4e7b03,_0x1d0bd0){var _0x45108e=_[_0xd36a('0xf')](_0x1e8e62);_0x45108e['queue_id']=_0x1d0bd0;_0x45108e[_0xd36a('0xc')]=_0x27aded;_0x45108e[_0xd36a('0x10')]=_0x2047fe;_0x45108e['id']=_0x57c05c;if(_0x14bc50){_0x4e7b03[util['format']('%sQueuesWaitingInteractions',_0x257088)][_0x57c05c]=_[_0xd36a('0x11')](_0x45108e,attributes);}else{delete _0x4e7b03[util[_0xd36a('0x12')]('%sQueuesWaitingInteractions',_0x257088)][_0x57c05c];}emit(util['format'](_0xd36a('0x13'),_0x257088,_0x27aded),util[_0xd36a('0x12')](_0xd36a('0x14'),_0x257088,_0x14bc50?_0xd36a('0x15'):'remove'),_[_0xd36a('0x11')](_0x45108e,attributes));}var rpc={'openchannelQueueReport':require(_0xd36a('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xd36a('0x17')),'smsQueueReport':require(_0xd36a('0x18')),'faxQueueReport':require(_0xd36a('0x19')),'whatsappQueueReport':require(_0xd36a('0x1a'))};var queue=schema({'name':{'type':_0xd36a('0x1b'),'required':!![],'message':_0xd36a('0x1c')},'timeout':{'type':_0xd36a('0x1d'),'message':_0xd36a('0x1e')}});function startRouting(_0x4f6f10,_0x126067,_0x1f99ee,_0x5c82f3){if(_0x4f6f10&&_0x126067&&_0x1f99ee){_0x126067[_0xd36a('0x1f')]+=0x1;var _0x5e398b={'uniqueid':_0x4f6f10,'from':_0x1f99ee[_0xd36a('0x20')]?_0x1f99ee[_0xd36a('0x20')]['from']:'','joinAt':moment()[_0xd36a('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1f99ee[_0xd36a('0x21')]?_0x1f99ee[_0xd36a('0x21')]['id']:null,'ListId':_0x1f99ee[_0xd36a('0x22')]?_0x1f99ee['list']['id']:null};_0x5e398b[_[_0xd36a('0x23')](_0x1f99ee['channel'])+'QueueId']=_0x126067['id']||null;_0x5e398b[_[_0xd36a('0x23')](_0x1f99ee[_0xd36a('0x24')])+_0xd36a('0x25')]=_0x1f99ee[_0xd36a('0x26')]?_0x1f99ee['interaction']['id']:null;_0x5e398b[_['upperFirst'](_0x1f99ee[_0xd36a('0x24')])+_0xd36a('0x27')]=_0x1f99ee['message']?_0x1f99ee[_0xd36a('0x28')]['id']:null;_0x5e398b[_['upperFirst'](_0x1f99ee[_0xd36a('0x24')])+(_0x1f99ee[_0xd36a('0x24')]!==_0xd36a('0x29')?_0xd36a('0x2a'):_0xd36a('0x2b'))]=_0x1f99ee['account']?_0x1f99ee['account']['id']:null;logger[_0xd36a('0x2c')](util['format'](_0xd36a('0x2d'),_0x4f6f10,_0x126067[_0xd36a('0x2e')]));emitChannelQueueInteraction(_0x1f99ee[_0xd36a('0x24')],_0x126067[_0xd36a('0x2e')],_0x5e398b,_0x1f99ee[_0xd36a('0x10')][_0xd36a('0x2e')],_0x1f99ee[_0xd36a('0x28')]['id'],!![],_0x5c82f3,_0x126067['id']);if(rpc[_0x1f99ee['channel']+_0xd36a('0x2f')]){return rpc[_0x1f99ee[_0xd36a('0x24')]+_0xd36a('0x2f')][_0xd36a('0x30')](_0x5e398b)['catch'](function(_0x1ff616){logger[_0xd36a('0x31')](_0xd36a('0x32'));});}}}function stopRouting(_0x167577,_0xb5b266,_0x2cee20,_0x5301d8){if(_0x167577&&_0xb5b266){_0xb5b266[_0xd36a('0x1f')]-=0x1;var _0x4c7f97={'leaveAt':moment()[_0xd36a('0x12')](_0xd36a('0x33')),'acceptAt':moment()[_0xd36a('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xd36a('0x34')};logger['info'](util[_0xd36a('0x12')](_0xd36a('0x35'),_0x167577,_0xb5b266[_0xd36a('0x2e')]));emitChannelQueueInteraction(_0x2cee20[_0xd36a('0x24')],_0xb5b266['name'],_0x2cee20[_0xd36a('0x20')],_0x2cee20[_0xd36a('0x10')]['name'],_0x2cee20[_0xd36a('0x28')]['id'],![],_0x5301d8,_0xb5b266['id']);if(rpc[_0x2cee20['channel']+_0xd36a('0x2f')]){return rpc[_0x2cee20[_0xd36a('0x24')]+_0xd36a('0x2f')][_0xd36a('0x36')](_0x167577,_0x4c7f97)[_0xd36a('0x37')](function(_0x312718){logger[_0xd36a('0x31')](_0xd36a('0x38'));});}}}function endRouting(_0x187c7c,_0x4bca53,_0x57ddf6,_0x5ac632){if(_0x187c7c&&_0x4bca53){_0x4bca53[_0xd36a('0x1f')]-=0x1;var _0x39dadb={'leaveAt':moment()[_0xd36a('0x12')](_0xd36a('0x33')),'exitAt':moment()[_0xd36a('0x12')](_0xd36a('0x33')),'reason':_0xd36a('0x39')};logger['info'](util[_0xd36a('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x187c7c,_0x4bca53['name']));emitChannelQueueInteraction(_0x57ddf6[_0xd36a('0x24')],_0x4bca53[_0xd36a('0x2e')],_0x57ddf6['body'],_0x57ddf6[_0xd36a('0x10')][_0xd36a('0x2e')],_0x57ddf6[_0xd36a('0x28')]['id'],![],_0x5ac632);if(rpc[_0x57ddf6[_0xd36a('0x24')]+_0xd36a('0x2f')]){return rpc[_0x57ddf6[_0xd36a('0x24')]+_0xd36a('0x2f')][_0xd36a('0x36')](_0x187c7c,_0x39dadb)['catch'](function(_0xa7e19d){logger[_0xd36a('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x14dfc9){return function(_0x25711d){return _0x25711d[_0xd36a('0x2e')][_0xd36a('0x3a')]()===_0x14dfc9[_0xd36a('0x3a')]();};}exports['consequence']=function(_0x471896,_0x900f3d,_0x1d632b,_0x53de66){return function(_0x2fce32){try{var _0x7935a8={'name':_0x900f3d[0x0],'timeout':_0x900f3d[0x1]};var _0x2cadc4=queue[_0xd36a('0x0')](_0x7935a8,{'typecast':!![]});if(_0x2cadc4['length']){logger[_0xd36a('0x31')]('[%s][QUEUE]\x20%s',_0x471896,_[_0xd36a('0x3b')](_0x2cadc4,_0xd36a('0x28'))[_0xd36a('0x3c')](',\x20'));_0x2fce32['stop']();}else{var _0xb69b23=_['find'](_0x1d632b[_0x53de66['channel']+'Queues'],handleFindQueue(_0x7935a8['name']));if(_0xb69b23){startRouting(_0x471896,_0xb69b23,_0x53de66,_0x1d632b);var _0x412306=(_0xb69b23['timeout']||0xa)*0x3e8;var _0x5dd253=(_0x7935a8['timeout']||0x14)*0x3e8;var _0x47b785,_0x320786;if(_0x412306>_0x5dd253){_0x5dd253=_0x412306;}var _0x38a8d1=seqqueue['createQueue'](_0x412306);_0x38a8d1['id']=_0x471896;_0x38a8d1[_0xd36a('0x3d')]=_0x412306;_0x38a8d1[_0xd36a('0x3e')]=_0x5dd253;_0x38a8d1['channel']=_0x53de66[_0xd36a('0x24')];_0x1d632b[_0xd36a('0x3f')][_0x471896]['on']('end',function(){logger[_0xd36a('0x2c')](_0xd36a('0x40'),_0x471896);stopRouting(_0x471896,_0xb69b23,_0x53de66,_0x1d632b);clearTimeout(_0x47b785);_0x47b785=undefined;_0x38a8d1[_0xd36a('0x41')](!![]);if(_0x1d632b[_0xd36a('0x3f')][_0x471896]){delete _0x1d632b[_0xd36a('0x3f')][_0x471896];}_0x2fce32[_0xd36a('0x42')]();});_0x1d632b[_0xd36a('0x3f')][_0x471896]['on'](_0xd36a('0x43'),function(){if(_0x1d632b[_0xd36a('0x3f')][_0x471896]){delete _0x1d632b[_0xd36a('0x3f')][_0x471896];}});_0x47b785=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x471896);endRouting(_0x471896,_0xb69b23,_0x53de66,_0x1d632b);clearTimeout(_0x47b785);_0x38a8d1[_0xd36a('0x41')](!![]);_0x2fce32[_0xd36a('0x44')]();},_0x5dd253);switch(_0xb69b23[_0xd36a('0x45')]){case _0xd36a('0x46'):strategy[_0xd36a('0x46')](_0x38a8d1,_0xb69b23,_0x1d632b,_0x53de66);break;default:strategy[_0xd36a('0x47')](_0x38a8d1,_0xb69b23,_0x1d632b,_0x53de66);}}else{logger['error'](_0xd36a('0x48'),_0x471896,_0x7935a8['name']);_0x2fce32['stop']();}}}catch(_0x147670){console[_0xd36a('0x49')](_0x147670);logger[_0xd36a('0x31')]('[%s][QUEUE]\x20%s',_0x471896,_0x147670[_0xd36a('0x4a')]);_0x2fce32[_0xd36a('0x42')]();}};}; \ No newline at end of file +var _0x413e=['error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','timeout','[%s][END:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','length','join','Queues','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','stop','complete','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','util','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','queue','from','clone','queue_id','account','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','interaction','upperFirst','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch'];(function(_0x42b5e3,_0x530bc0){var _0x1ed5b2=function(_0x4e9538){while(--_0x4e9538){_0x42b5e3['push'](_0x42b5e3['shift']());}};_0x1ed5b2(++_0x530bc0);}(_0x413e,0x14b));var _0xe413=function(_0x13731b,_0x40d15d){_0x13731b=_0x13731b-0x0;var _0xd306cf=_0x413e[_0x13731b];return _0xd306cf;};'use strict';var schema=require(_0xe413('0x0'));var _=require('lodash');var util=require(_0xe413('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xe413('0x2'));var Redis=require(_0xe413('0x3'));var config=require(_0xe413('0x4'));var logger=require('../../../../config/logger')(_0xe413('0x5'));var strategy=require(_0xe413('0x6'));config[_0xe413('0x7')]=_[_0xe413('0x8')](config[_0xe413('0x7')],{'host':_0xe413('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe413('0x7')]));var attributes=['id','queue_id','account',_0xe413('0xa'),_0xe413('0xb'),'joinAt'];function emit(_0x2071d1,_0x24267d,_0x54e422){io['to'](_0x2071d1)['emit'](_0x24267d,_0x54e422);}function emitChannelQueueInteraction(_0x4e2bfd,_0x220f48,_0x146057,_0x1af134,_0x2b89f9,_0x22f3af,_0x508560,_0x41b0a3){var _0x51806d=_[_0xe413('0xc')](_0x146057);_0x51806d[_0xe413('0xd')]=_0x41b0a3;_0x51806d[_0xe413('0xa')]=_0x220f48;_0x51806d[_0xe413('0xe')]=_0x1af134;_0x51806d['id']=_0x2b89f9;if(_0x22f3af){_0x508560[util[_0xe413('0xf')](_0xe413('0x10'),_0x4e2bfd)][_0x2b89f9]=_[_0xe413('0x11')](_0x51806d,attributes);}else{delete _0x508560[util['format'](_0xe413('0x10'),_0x4e2bfd)][_0x2b89f9];}emit(util[_0xe413('0xf')]('%s:queue:%s',_0x4e2bfd,_0x220f48),util[_0xe413('0xf')](_0xe413('0x12'),_0x4e2bfd,_0x22f3af?_0xe413('0x13'):_0xe413('0x14')),_[_0xe413('0x11')](_0x51806d,attributes));}var rpc={'openchannelQueueReport':require(_0xe413('0x15')),'mailQueueReport':require(_0xe413('0x16')),'chatQueueReport':require(_0xe413('0x17')),'smsQueueReport':require(_0xe413('0x18')),'faxQueueReport':require(_0xe413('0x19')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xe413('0x1a'),'required':!![],'message':_0xe413('0x1b')},'timeout':{'type':_0xe413('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x25b0b9,_0x4fd12f,_0x156543,_0x4cd8f0){if(_0x25b0b9&&_0x4fd12f&&_0x156543){_0x4fd12f[_0xe413('0x1d')]+=0x1;var _0x5893fe={'uniqueid':_0x25b0b9,'from':_0x156543[_0xe413('0x1e')]?_0x156543[_0xe413('0x1e')][_0xe413('0xb')]:'','joinAt':moment()[_0xe413('0xf')](_0xe413('0x1f')),'ContactId':_0x156543['contact']?_0x156543[_0xe413('0x20')]['id']:null,'ListId':_0x156543[_0xe413('0x21')]?_0x156543[_0xe413('0x21')]['id']:null};_0x5893fe[_['upperFirst'](_0x156543[_0xe413('0x22')])+_0xe413('0x23')]=_0x4fd12f['id']||null;_0x5893fe[_['upperFirst'](_0x156543[_0xe413('0x22')])+'InteractionId']=_0x156543[_0xe413('0x24')]?_0x156543[_0xe413('0x24')]['id']:null;_0x5893fe[_[_0xe413('0x25')](_0x156543[_0xe413('0x22')])+_0xe413('0x26')]=_0x156543[_0xe413('0x27')]?_0x156543[_0xe413('0x27')]['id']:null;_0x5893fe[_[_0xe413('0x25')](_0x156543[_0xe413('0x22')])+(_0x156543['channel']!==_0xe413('0x28')?_0xe413('0x29'):_0xe413('0x2a'))]=_0x156543['account']?_0x156543[_0xe413('0xe')]['id']:null;logger[_0xe413('0x2b')](util[_0xe413('0xf')](_0xe413('0x2c'),_0x25b0b9,_0x4fd12f[_0xe413('0x2d')]));emitChannelQueueInteraction(_0x156543[_0xe413('0x22')],_0x4fd12f[_0xe413('0x2d')],_0x5893fe,_0x156543[_0xe413('0xe')][_0xe413('0x2d')],_0x156543[_0xe413('0x27')]['id'],!![],_0x4cd8f0,_0x4fd12f['id']);if(rpc[_0x156543[_0xe413('0x22')]+_0xe413('0x2e')]){return rpc[_0x156543[_0xe413('0x22')]+_0xe413('0x2e')][_0xe413('0x2f')](_0x5893fe)[_0xe413('0x30')](function(_0x46fa5f){logger[_0xe413('0x31')](_0xe413('0x32'));});}}}function stopRouting(_0x1a7999,_0x574b64,_0x4e4839,_0x46e328){if(_0x1a7999&&_0x574b64){_0x574b64[_0xe413('0x1d')]-=0x1;var _0x4f0d88={'leaveAt':moment()[_0xe413('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xe413('0x33')};logger[_0xe413('0x2b')](util[_0xe413('0xf')](_0xe413('0x34'),_0x1a7999,_0x574b64[_0xe413('0x2d')]));emitChannelQueueInteraction(_0x4e4839[_0xe413('0x22')],_0x574b64[_0xe413('0x2d')],_0x4e4839[_0xe413('0x1e')],_0x4e4839[_0xe413('0xe')]['name'],_0x4e4839['message']['id'],![],_0x46e328,_0x574b64['id']);if(rpc[_0x4e4839[_0xe413('0x22')]+_0xe413('0x2e')]){return rpc[_0x4e4839[_0xe413('0x22')]+_0xe413('0x2e')]['update'](_0x1a7999,_0x4f0d88)[_0xe413('0x30')](function(_0x2137cd){logger[_0xe413('0x31')]('update\x20queue\x20report');});}}}function endRouting(_0x1876ab,_0x2de603,_0x314874,_0x11a5b1){if(_0x1876ab&&_0x2de603){_0x2de603[_0xe413('0x1d')]-=0x1;var _0x1a172e={'leaveAt':moment()[_0xe413('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xe413('0x35')};logger[_0xe413('0x2b')](util[_0xe413('0xf')](_0xe413('0x36'),_0x1876ab,_0x2de603[_0xe413('0x2d')]));emitChannelQueueInteraction(_0x314874[_0xe413('0x22')],_0x2de603[_0xe413('0x2d')],_0x314874['body'],_0x314874[_0xe413('0xe')]['name'],_0x314874['message']['id'],![],_0x11a5b1);if(rpc[_0x314874[_0xe413('0x22')]+_0xe413('0x2e')]){return rpc[_0x314874[_0xe413('0x22')]+_0xe413('0x2e')][_0xe413('0x37')](_0x1876ab,_0x1a172e)[_0xe413('0x30')](function(_0x3149af){logger[_0xe413('0x31')](_0xe413('0x38'));});}}}function handleFindQueue(_0x2ec52b){return function(_0x3e4a46){return _0x3e4a46['name'][_0xe413('0x39')]()===_0x2ec52b[_0xe413('0x39')]();};}exports[_0xe413('0x3a')]=function(_0x4d5732,_0x583fa0,_0x389bcc,_0x1090d2){return function(_0x404517){try{var _0x2b3024={'name':_0x583fa0[0x0],'timeout':_0x583fa0[0x1]};var _0x5a7ba4=queue['validate'](_0x2b3024,{'typecast':!![]});if(_0x5a7ba4[_0xe413('0x3b')]){logger[_0xe413('0x31')]('[%s][QUEUE]\x20%s',_0x4d5732,_['map'](_0x5a7ba4,'message')[_0xe413('0x3c')](',\x20'));_0x404517['stop']();}else{var _0x1c317f=_['find'](_0x389bcc[_0x1090d2[_0xe413('0x22')]+_0xe413('0x3d')],handleFindQueue(_0x2b3024[_0xe413('0x2d')]));if(_0x1c317f){startRouting(_0x4d5732,_0x1c317f,_0x1090d2,_0x389bcc);var _0x73c8bc=(_0x1c317f['timeout']||0xa)*0x3e8;var _0x15af1f=(_0x2b3024['timeout']||0x14)*0x3e8;var _0x312a4e,_0x55c6ad;if(_0x73c8bc>_0x15af1f){_0x15af1f=_0x73c8bc;}var _0x4c0206=seqqueue[_0xe413('0x3e')](_0x73c8bc);_0x4c0206['id']=_0x4d5732;_0x4c0206[_0xe413('0x3f')]=_0x73c8bc;_0x4c0206[_0xe413('0x40')]=_0x15af1f;_0x4c0206['channel']=_0x1090d2[_0xe413('0x22')];_0x389bcc['rules'][_0x4d5732]['on'](_0xe413('0x41'),function(){logger[_0xe413('0x2b')](_0xe413('0x42'),_0x4d5732);stopRouting(_0x4d5732,_0x1c317f,_0x1090d2,_0x389bcc);clearTimeout(_0x312a4e);_0x312a4e=undefined;_0x4c0206[_0xe413('0x43')](!![]);if(_0x389bcc[_0xe413('0x44')][_0x4d5732]){delete _0x389bcc[_0xe413('0x44')][_0x4d5732];}_0x404517[_0xe413('0x45')]();});_0x389bcc[_0xe413('0x44')][_0x4d5732]['on'](_0xe413('0x46'),function(){if(_0x389bcc[_0xe413('0x44')][_0x4d5732]){delete _0x389bcc[_0xe413('0x44')][_0x4d5732];}});_0x312a4e=setTimeout(function(){logger[_0xe413('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4d5732);endRouting(_0x4d5732,_0x1c317f,_0x1090d2,_0x389bcc);clearTimeout(_0x312a4e);_0x4c0206[_0xe413('0x43')](!![]);_0x404517[_0xe413('0x47')]();},_0x15af1f);switch(_0x1c317f['strategy']){case _0xe413('0x48'):strategy['rrmemory'](_0x4c0206,_0x1c317f,_0x389bcc,_0x1090d2);break;default:strategy[_0xe413('0x49')](_0x4c0206,_0x1c317f,_0x389bcc,_0x1090d2);}}else{logger[_0xe413('0x31')](_0xe413('0x4a'),_0x4d5732,_0x2b3024[_0xe413('0x2d')]);_0x404517[_0xe413('0x45')]();}}}catch(_0x5b73d2){console['log'](_0x5b73d2);logger[_0xe413('0x31')](_0xe413('0x4b'),_0x4d5732,_0x5b73d2['stack']);_0x404517[_0xe413('0x45')]();}};}; \ 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 3add3ab..e78c57b 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 _0x6d3d=['handleRun','bind','timeout','handleTimeout','handleDrained','prototype','debug','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push'];(function(_0x5d363e,_0x16240b){var _0x93db6e=function(_0x427e31){while(--_0x427e31){_0x5d363e['push'](_0x5d363e['shift']());}};_0x93db6e(++_0x16240b);}(_0x6d3d,0x183));var _0xd6d3=function(_0x95ab80,_0x176679){_0x95ab80=_0x95ab80-0x0;var _0x2754b8=_0x6d3d[_0x95ab80];return _0x2754b8;};'use strict';var _=require('lodash');var uuid=require(_0xd6d3('0x0'));var util=require(_0xd6d3('0x1'));var logger=require(_0xd6d3('0x2'))(_0xd6d3('0x3'));var Agent=function(_0x2d9d4d,_0x2a5b75,_0x1359da,_0x14313d){this[_0xd6d3('0x4')]=uuid['v4']();this[_0xd6d3('0x5')]=_0x2d9d4d;this[_0xd6d3('0x6')]=_0x2a5b75;this[_0xd6d3('0x7')]=_0x1359da;this['routing']=_0x14313d;this[_0xd6d3('0x5')][_0xd6d3('0x8')](this[_0xd6d3('0x9')][_0xd6d3('0xa')](this),this['handleTimeout']['bind'](this));this[_0xd6d3('0x5')]['on'](_0xd6d3('0xb'),this[_0xd6d3('0xc')][_0xd6d3('0xa')](this));this['squeue']['on']('drained',this[_0xd6d3('0xd')]['bind'](this));};Agent[_0xd6d3('0xe')][_0xd6d3('0x8')]=function(){this['squeue'][_0xd6d3('0x8')](this[_0xd6d3('0x9')][_0xd6d3('0xa')](this),this[_0xd6d3('0xc')][_0xd6d3('0xa')](this));};Agent[_0xd6d3('0xe')][_0xd6d3('0xd')]=function(){this[_0xd6d3('0xc')](!![]);};Agent[_0xd6d3('0xe')]['handleRun']=function(){logger[_0xd6d3('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0xd6d3('0x6')]['id']);if(_[_0xd6d3('0x10')](this[_0xd6d3('0x7')][_0xd6d3('0x11')][this[_0xd6d3('0x6')]['id']])){logger[_0xd6d3('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xd6d3('0x6')]['id']);setTimeout(this[_0xd6d3('0x8')]['bind'](this),0x3e8);}else{if(this[_0xd6d3('0x3')][_0xd6d3('0x12')]||util[_0xd6d3('0x13')](this[_0xd6d3('0x5')]['id'],this[_0xd6d3('0x7')][_0xd6d3('0x11')][this[_0xd6d3('0x6')]['id']],this[_0xd6d3('0x5')][_0xd6d3('0x14')],![])){this['realtime']['agents'][this[_0xd6d3('0x6')]['id']][_0xd6d3('0x15')]=!![];this[_0xd6d3('0x7')][_0xd6d3('0x11')][this['agent']['id']][_0xd6d3('0x16')]=undefined;util[_0xd6d3('0x17')](this[_0xd6d3('0x4')],this['squeue']['id'],this[_0xd6d3('0x7')]['agents'][this[_0xd6d3('0x6')]['id']],null,this[_0xd6d3('0x3')]);util['writeLog'](this[_0xd6d3('0x5')]['id'],this[_0xd6d3('0x7')][_0xd6d3('0x11')][this['agent']['id']],_0xd6d3('0x18')+(this[_0xd6d3('0x3')]['forcedOwnership']?_0xd6d3('0x19'):''));}else{logger[_0xd6d3('0xf')](_0xd6d3('0x1a'),this[_0xd6d3('0x5')]['id'],this[_0xd6d3('0x6')]['id']);setTimeout(this['push'][_0xd6d3('0xa')](this),0x3e8);}}};Agent['prototype'][_0xd6d3('0xc')]=function(_0x3cef74){if(_[_0xd6d3('0x10')](this[_0xd6d3('0x7')][_0xd6d3('0x11')][this['agent']['id']])){return logger[_0xd6d3('0xf')](_0xd6d3('0x1b'),this[_0xd6d3('0x5')]['id'],this['agent']['id']);}else{logger[_0xd6d3('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xd6d3('0x5')]['id'],this[_0xd6d3('0x6')]['id']);util[_0xd6d3('0x1c')](this[_0xd6d3('0x4')],this[_0xd6d3('0x5')]['id'],this['realtime'][_0xd6d3('0x11')][this[_0xd6d3('0x6')]['id']],null,this['routing']);this[_0xd6d3('0x7')][_0xd6d3('0x11')][this[_0xd6d3('0x6')]['id']]['busy']=![];this['realtime'][_0xd6d3('0x11')][this[_0xd6d3('0x6')]['id']][_0xd6d3('0x16')]=undefined;util[_0xd6d3('0x1d')](this[_0xd6d3('0x5')]['id'],this['realtime'][_0xd6d3('0x11')][this[_0xd6d3('0x6')]['id']],_0x3cef74?_0xd6d3('0x1e'):_0xd6d3('0x1f'));}if(!_0x3cef74){setTimeout(this[_0xd6d3('0x8')][_0xd6d3('0xa')](this),0x3e8);}};function agent(_0x425a45,_0x258432,_0x2a8f9c,_0x40cbfe){return new Agent(_0x425a45,_0x258432,_0x2a8f9c,_0x40cbfe);}module[_0xd6d3('0x20')]=agent; \ No newline at end of file +var _0xb493=['push','handleRun','bind','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue'];(function(_0x3e42ee,_0x22cde0){var _0x5e68a9=function(_0x168988){while(--_0x168988){_0x3e42ee['push'](_0x3e42ee['shift']());}};_0x5e68a9(++_0x22cde0);}(_0xb493,0x10f));var _0x3b49=function(_0x5d0768,_0x349515){_0x5d0768=_0x5d0768-0x0;var _0x3d6115=_0xb493[_0x5d0768];return _0x3d6115;};'use strict';var _=require(_0x3b49('0x0'));var uuid=require(_0x3b49('0x1'));var util=require(_0x3b49('0x2'));var logger=require('../../../../../config/logger')(_0x3b49('0x3'));var Agent=function(_0x3cb3e6,_0x5133de,_0x4ea249,_0x3acb74){this[_0x3b49('0x4')]=uuid['v4']();this['squeue']=_0x3cb3e6;this[_0x3b49('0x5')]=_0x5133de;this[_0x3b49('0x6')]=_0x4ea249;this['routing']=_0x3acb74;this[_0x3b49('0x7')][_0x3b49('0x8')](this[_0x3b49('0x9')][_0x3b49('0xa')](this),this['handleTimeout'][_0x3b49('0xa')](this));this[_0x3b49('0x7')]['on'](_0x3b49('0xb'),this['handleTimeout'][_0x3b49('0xa')](this));this[_0x3b49('0x7')]['on'](_0x3b49('0xc'),this[_0x3b49('0xd')][_0x3b49('0xa')](this));};Agent[_0x3b49('0xe')][_0x3b49('0x8')]=function(){this[_0x3b49('0x7')][_0x3b49('0x8')](this[_0x3b49('0x9')]['bind'](this),this['handleTimeout'][_0x3b49('0xa')](this));};Agent['prototype'][_0x3b49('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x3b49('0xe')]['handleRun']=function(){logger[_0x3b49('0xf')](_0x3b49('0x10'),this[_0x3b49('0x7')]['id'],this[_0x3b49('0x5')]['id']);if(_[_0x3b49('0x11')](this[_0x3b49('0x6')][_0x3b49('0x12')][this[_0x3b49('0x5')]['id']])){logger[_0x3b49('0xf')](_0x3b49('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x3b49('0x8')][_0x3b49('0xa')](this),0x3e8);}else{if(this[_0x3b49('0x3')][_0x3b49('0x14')]||util['isAgentAvailable'](this[_0x3b49('0x7')]['id'],this[_0x3b49('0x6')][_0x3b49('0x12')][this['agent']['id']],this[_0x3b49('0x7')][_0x3b49('0x15')],![])){this[_0x3b49('0x6')]['agents'][this[_0x3b49('0x5')]['id']]['busy']=!![];this['realtime'][_0x3b49('0x12')][this['agent']['id']][_0x3b49('0x16')]=undefined;util[_0x3b49('0x17')](this[_0x3b49('0x4')],this[_0x3b49('0x7')]['id'],this[_0x3b49('0x6')][_0x3b49('0x12')][this[_0x3b49('0x5')]['id']],null,this['routing']);util['writeLog'](this[_0x3b49('0x7')]['id'],this[_0x3b49('0x6')]['agents'][this[_0x3b49('0x5')]['id']],_0x3b49('0x18')+(this[_0x3b49('0x3')]['forcedOwnership']?_0x3b49('0x19'):''));}else{logger[_0x3b49('0xf')](_0x3b49('0x1a'),this[_0x3b49('0x7')]['id'],this['agent']['id']);setTimeout(this[_0x3b49('0x8')][_0x3b49('0xa')](this),0x3e8);}}};Agent[_0x3b49('0xe')]['handleTimeout']=function(_0x20b92d){if(_['isNil'](this[_0x3b49('0x6')][_0x3b49('0x12')][this['agent']['id']])){return logger['debug'](_0x3b49('0x13'),this[_0x3b49('0x7')]['id'],this['agent']['id']);}else{logger[_0x3b49('0xf')](_0x3b49('0x1b'),this[_0x3b49('0x7')]['id'],this['agent']['id']);util[_0x3b49('0x1c')](this['notificationId'],this[_0x3b49('0x7')]['id'],this[_0x3b49('0x6')]['agents'][this[_0x3b49('0x5')]['id']],null,this[_0x3b49('0x3')]);this['realtime'][_0x3b49('0x12')][this[_0x3b49('0x5')]['id']]['busy']=![];this[_0x3b49('0x6')]['agents'][this[_0x3b49('0x5')]['id']]['busyQueue']=undefined;util[_0x3b49('0x1d')](this['squeue']['id'],this[_0x3b49('0x6')]['agents'][this[_0x3b49('0x5')]['id']],_0x20b92d?_0x3b49('0x1e'):'TIMEOUT');}if(!_0x20b92d){setTimeout(this[_0x3b49('0x8')][_0x3b49('0xa')](this),0x3e8);}};function agent(_0x1c53b7,_0x5da1e6,_0x29710f,_0x3cec38){return new Agent(_0x1c53b7,_0x5da1e6,_0x29710f,_0x3cec38);}module['exports']=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 2bde89c..9a943e4 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 _0x5ab4=['[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','bind','handleTimeout','timeout','drained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','realtime','busyQueue'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x5ab4,0x9f));var _0x45ab=function(_0x4e045a,_0x12360b){_0x4e045a=_0x4e045a-0x0;var _0x25df5f=_0x5ab4[_0x4e045a];return _0x25df5f;};'use strict';var _=require(_0x45ab('0x0'));var uuid=require(_0x45ab('0x1'));var util=require(_0x45ab('0x2'));var logger=require(_0x45ab('0x3'))(_0x45ab('0x4'));var Beepall=function(_0x4e22bc,_0xc77fdd,_0x2d0e3b,_0x3d5dbd){this[_0x45ab('0x5')]=uuid['v4']();this[_0x45ab('0x6')]=_0x4e22bc;this[_0x45ab('0x7')]=_0xc77fdd;this['realtime']=_0x2d0e3b;this[_0x45ab('0x4')]=_0x3d5dbd;this[_0x45ab('0x6')][_0x45ab('0x8')](this[_0x45ab('0x9')][_0x45ab('0xa')](this),this[_0x45ab('0xb')][_0x45ab('0xa')](this));this[_0x45ab('0x6')]['on'](_0x45ab('0xc'),this[_0x45ab('0xb')][_0x45ab('0xa')](this));this[_0x45ab('0x6')]['on'](_0x45ab('0xd'),this['handleDrained'][_0x45ab('0xa')](this));};Beepall[_0x45ab('0xe')][_0x45ab('0x8')]=function(){this[_0x45ab('0x6')][_0x45ab('0x8')](this[_0x45ab('0x9')][_0x45ab('0xa')](this),this[_0x45ab('0xb')][_0x45ab('0xa')](this));};Beepall['prototype']['handleDrained']=function(){this[_0x45ab('0xb')](!![]);};Beepall[_0x45ab('0xe')][_0x45ab('0x9')]=function(){var _0x2b26d3=!![];if(!_[_0x45ab('0xf')](this[_0x45ab('0x7')])&&!_[_0x45ab('0xf')](this[_0x45ab('0x7')]['Agents'])&&this[_0x45ab('0x7')][_0x45ab('0x10')]['length']>0x0){for(var _0x3a9e8b=0x0,_0x57ffea;_0x3a9e8b0x0){for(var _0xbac830=0x0,_0x80245;_0xbac8300x0&&_0x224b54[_0x328f21+'CurrentCapacity']>=_0x224b54[_0x328f21+_0x4ee1('0x22')]){writeLog(_0x160a26,_0x224b54,_0x328f21[_0x4ee1('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x4ee1('0x25')]=function(_0x213db8,_0x36654c,_0x215949,_0x2d699c,_0x3c7b2a){return sendNotification(!![],_0x213db8,_0x36654c,_0x215949,_0x2d699c,_0x3c7b2a);};exports[_0x4ee1('0x26')]=function(_0x56c4d3,_0x1f7b74,_0x59029c,_0x4746c2,_0x4ec408){return sendNotification(![],_0x56c4d3,_0x1f7b74,_0x59029c,_0x4746c2,_0x4ec408);};exports[_0x4ee1('0x27')]=writeLog; \ No newline at end of file +var _0x31f0=['BUSY','PAUSE','hasOwnProperty','Capacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','format','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','notification:%s','save','remove','debug','isAgentAvailable'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x31f0,0xb7));var _0x031f=function(_0x4b6cfa,_0x1c5f96){_0x4b6cfa=_0x4b6cfa-0x0;var _0x7bc5ab=_0x31f0[_0x4b6cfa];return _0x7bc5ab;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var utils=require(_0x031f('0x1'));var Redis=require('ioredis');var config=require(_0x031f('0x2'));var logger=require(_0x031f('0x3'))(_0x031f('0x4'));config[_0x031f('0x5')]=_['defaults'](config[_0x031f('0x5')],{'host':_0x031f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function sendNotification(_0x56328c,_0x3dc98e,_0x487e65,_0x365f59,_0x4300b4,_0x2569b6){io['to'](util[_0x031f('0x7')]('user:%s',_0x365f59[_0x031f('0x8')]))[_0x031f('0x9')](_0x031f('0xa'),_0x365f59);var _0x439940=_0x2569b6||{};var _0x3dd729=_0x487e65[_0x031f('0xb')]('.');var _0x2202dc={'uniqueid':_0x3dc98e,'channel':_0x3dd729[0x0],'id':_0x3dd729[0x1],'title':_0x3dd729[0x0]+_0x031f('0xc'),'interactionId':_0x3dd729[0x2],'queue':_0x4300b4?_0x4300b4['name']:null,'sound':_0x439940[_0x031f('0xd')][_0x031f('0xe')],'shake':_0x439940[_0x031f('0xd')][_0x031f('0xf')]};try{if(!_0x439940[_0x031f('0x10')]){_0x439940[_0x031f('0x10')]={};}if(_0x4300b4){_0x439940[_0x031f('0x10')]['queue']=_0x4300b4;}else if(_0x439940[_0x031f('0x10')][_0x031f('0x11')]){delete _0x439940[_0x031f('0x10')][_0x031f('0x11')];}_0x2202dc[_0x031f('0x12')]=utils['getMustacheRender'](_0x439940['account'][_0x031f('0x13')],_0x439940);}catch(_0x3a10aa){_0x2202dc[_0x031f('0x12')]=_0x031f('0x14');logger['error'](util[_0x031f('0x7')](_0x031f('0x15'),_0x3dc98e,_0x3a10aa['message']));}io['to'](util[_0x031f('0x7')]('user:%s',_0x365f59[_0x031f('0x8')]))[_0x031f('0x9')](util[_0x031f('0x7')](_0x031f('0x16'),_0x56328c?_0x031f('0x17'):_0x031f('0x18')),_0x2202dc);}function writeLog(_0x1b76d6,_0x2825ef,_0xf76f1b){return logger[_0x031f('0x19')](util[_0x031f('0x7')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1b76d6,_0x2825ef[_0x031f('0x8')],_0xf76f1b));}exports[_0x031f('0x1a')]=function(_0x451328,_0x4d6706,_0x5c4184,_0xa11a2b){if(_0x4d6706['busy']){writeLog(_0x451328,_0x4d6706,_0x031f('0x1b'));return![];}if(!_0x4d6706['online']){writeLog(_0x451328,_0x4d6706,'OFFLINE');return![];}if(_0x4d6706[_0x5c4184+'Pause']){writeLog(_0x451328,_0x4d6706,_0x031f('0x1c'));return![];}if(_0xa11a2b&&_0x4d6706[_0x031f('0x1d')](_0x5c4184+_0x031f('0x1e'))&&_0x4d6706[_0x031f('0x1d')](_0x5c4184+'CurrentCapacity')){if(_0x4d6706[_0x5c4184+_0x031f('0x1e')]>0x0&&_0x4d6706[_0x5c4184+'CurrentCapacity']>=_0x4d6706[_0x5c4184+_0x031f('0x1e')]){writeLog(_0x451328,_0x4d6706,_0x5c4184[_0x031f('0x1f')]()+_0x031f('0x20'));return![];}}return!![];};exports['showNotification']=function(_0x35af16,_0x3b2a51,_0x54b44e,_0x3847b2,_0x28a617){return sendNotification(!![],_0x35af16,_0x3b2a51,_0x54b44e,_0x3847b2,_0x28a617);};exports[_0x031f('0x21')]=function(_0x5395ea,_0xa308b,_0x114e34,_0xb6ed6c,_0xaf5bea){return sendNotification(![],_0x5395ea,_0xa308b,_0x114e34,_0xb6ed6c,_0xaf5bea);};exports[_0x031f('0x22')]=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 03f6afc..2f1c5b0 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 _0xf807=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20%s','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','info'];(function(_0x2bcd61,_0x10be4a){var _0x40b193=function(_0xadfc5){while(--_0xadfc5){_0x2bcd61['push'](_0x2bcd61['shift']());}};_0x40b193(++_0x10be4a);}(_0xf807,0x75));var _0x7f80=function(_0x3e130f,_0x309c01){_0x3e130f=_0x3e130f-0x0;var _0xf4d530=_0xf807[_0x3e130f];return _0xf4d530;};'use strict';var schema=require(_0x7f80('0x0'));var sh=require('shelljs');var _=require(_0x7f80('0x1'));var utils=require(_0x7f80('0x2'));var logger=require(_0x7f80('0x3'))(_0x7f80('0x4'));var system=schema({'command':{'type':_0x7f80('0x5'),'required':!![],'message':_0x7f80('0x6')}});exports[_0x7f80('0x7')]=function(_0x2c002b,_0x2cf984){return function(_0xbda7bf){try{var _0x10b7fa={'command':_0x2cf984[0x0]};var _0x3391b2=system[_0x7f80('0x0')](_0x10b7fa,{'typecast':!![]});if(_0x3391b2[_0x7f80('0x8')]){logger[_0x7f80('0x9')]('[%s][SYSTEM]\x20%s',_0x2c002b,_['map'](_0x3391b2,_0x7f80('0xa'))[_0x7f80('0xb')](',\x20'));logger[_0x7f80('0xc')](_0x7f80('0xd'),_0x2c002b);_0xbda7bf[_0x7f80('0xe')]();}else{var _0x1a9907=this;var _0x12e837=utils[_0x7f80('0xf')](_0x2cf984[0x0],this);logger[_0x7f80('0xc')](_0x7f80('0x10'),_0x2c002b,_0x12e837);sh[_0x7f80('0x11')](_['trim'](_0x12e837),function(_0x49d4d2,_0x546ef4){logger[_0x7f80('0xc')](_0x7f80('0x12'),_0x2c002b,_0x49d4d2);if(_0x49d4d2==0x0){var _0x350793=_0x546ef4[_0x7f80('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x7f80('0x14')](_0x2cf984[0x1])||_['isEmpty'](_0x2cf984[0x1])){logger[_0x7f80('0xc')](_0x7f80('0x15'),_0x2c002b);_0x1a9907[_0x7f80('0x16')][_0x2cf984[0x1]]=_0x350793;}else{logger[_0x7f80('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x2c002b,_0x2cf984[0x1],_0x350793);_0x1a9907['body'][_0x2cf984[0x1]]=_0x350793;}}_0xbda7bf[_0x7f80('0xe')]();});}}catch(_0x443843){logger[_0x7f80('0x9')](_0x7f80('0x17'),_0x2c002b,_[_0x7f80('0x18')](_0x443843)?JSON[_0x7f80('0x19')](_0x443843):_0x443843);logger[_0x7f80('0xc')](_0x7f80('0xd'),_0x2c002b);_0xbda7bf[_0x7f80('0xe')]();}};}; \ No newline at end of file +var _0xa952=['isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x48744b,_0x25223f){var _0x50920f=function(_0x56e8f8){while(--_0x56e8f8){_0x48744b['push'](_0x48744b['shift']());}};_0x50920f(++_0x25223f);}(_0xa952,0x1b2));var _0x2a95=function(_0x559aca,_0x41a249){_0x559aca=_0x559aca-0x0;var _0x5627fe=_0xa952[_0x559aca];return _0x5627fe;};'use strict';var schema=require(_0x2a95('0x0'));var sh=require(_0x2a95('0x1'));var _=require(_0x2a95('0x2'));var utils=require(_0x2a95('0x3'));var logger=require(_0x2a95('0x4'))(_0x2a95('0x5'));var system=schema({'command':{'type':_0x2a95('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x2a95('0x7')]=function(_0x40acda,_0x3663f9){return function(_0x1c7820){try{var _0x53c54f={'command':_0x3663f9[0x0]};var _0x153806=system[_0x2a95('0x0')](_0x53c54f,{'typecast':!![]});if(_0x153806[_0x2a95('0x8')]){logger['error'](_0x2a95('0x9'),_0x40acda,_['map'](_0x153806,_0x2a95('0xa'))[_0x2a95('0xb')](',\x20'));logger[_0x2a95('0xc')](_0x2a95('0xd'),_0x40acda);_0x1c7820['next']();}else{var _0x38990b=this;var _0x6edd7e=utils['getMustacheRender'](_0x3663f9[0x0],this);logger[_0x2a95('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x40acda,_0x6edd7e);sh[_0x2a95('0xe')](_[_0x2a95('0xf')](_0x6edd7e),function(_0xe06e19,_0x2a6ac9){logger[_0x2a95('0xc')](_0x2a95('0x10'),_0x40acda,_0xe06e19);if(_0xe06e19==0x0){var _0x31e060=_0x2a6ac9[_0x2a95('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x2a95('0x12')](_0x3663f9[0x1])||_['isEmpty'](_0x3663f9[0x1])){logger[_0x2a95('0xc')](_0x2a95('0x13'),_0x40acda);_0x38990b[_0x2a95('0x14')][_0x3663f9[0x1]]=_0x31e060;}else{logger[_0x2a95('0xc')](_0x2a95('0x15'),_0x40acda,_0x3663f9[0x1],_0x31e060);_0x38990b[_0x2a95('0x14')][_0x3663f9[0x1]]=_0x31e060;}}_0x1c7820['next']();});}}catch(_0x4cf661){logger['error'](_0x2a95('0x9'),_0x40acda,_[_0x2a95('0x16')](_0x4cf661)?JSON[_0x2a95('0x17')](_0x4cf661):_0x4cf661);logger[_0x2a95('0xc')](_0x2a95('0xd'),_0x40acda);_0x1c7820['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 a5a0812..91dd9d0 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 _0x9623=['interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','stringify','finally','isObject','validate','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','addTags'];(function(_0x1c3863,_0x4b03a5){var _0x5a3070=function(_0x2805d9){while(--_0x2805d9){_0x1c3863['push'](_0x1c3863['shift']());}};_0x5a3070(++_0x4b03a5);}(_0x9623,0x131));var _0x3962=function(_0xbd8642,_0x271159){_0xbd8642=_0xbd8642-0x0;var _0x1744ed=_0x9623[_0xbd8642];return _0x1744ed;};'use strict';var schema=require(_0x3962('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x3962('0x1')),'mailInteraction':require(_0x3962('0x2')),'faxInteraction':require(_0x3962('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x3962('0x4'))(_0x3962('0x5'));var tag=schema({'tag':{'type':_0x3962('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x3962('0x7')]=function(_0x4f42b1,_0x12d3e9,_0x5620cb,_0x2a8f10){return function(_0x461cfe){try{var _0x25fde8={'tag':_0x12d3e9[0x0]};var _0x5b40b5=tag[_0x3962('0x0')](_0x25fde8,{'typecast':!![]});if(_0x5b40b5[_0x3962('0x8')]){logger[_0x3962('0x9')](_0x3962('0xa'),_0x4f42b1,_[_0x3962('0xb')](_0x5b40b5,_0x3962('0xc'))[_0x3962('0xd')](',\x20'));logger[_0x3962('0xe')](_0x3962('0xf'),_0x4f42b1);_0x461cfe[_0x3962('0x10')]();}else{var _0x2ceaf2={'ids':[_0x12d3e9[0x0]]};if(rpc[_0x2a8f10['channel']+'Interaction']){rpc[_0x2a8f10['channel']+_0x3962('0x11')][_0x3962('0x12')](_0x2a8f10[_0x3962('0x13')]['id'],_0x2ceaf2)[_0x3962('0x14')](function(_0xea9e95){logger[_0x3962('0xe')](_0x3962('0x15'),_0x4f42b1,_0x12d3e9[0x1],_0x2a8f10[_0x3962('0x16')],_0x2a8f10['interaction']['id']);})[_0x3962('0x17')](function(_0x5a9ec5){logger['error'](_0x3962('0xa'),_0x4f42b1,JSON[_0x3962('0x18')](_0x5a9ec5));logger[_0x3962('0xe')](_0x3962('0xf'),_0x4f42b1);})[_0x3962('0x19')](function(){_0x461cfe[_0x3962('0x10')]();});}}}catch(_0x863e25){logger[_0x3962('0x9')](_0x3962('0xa'),_0x4f42b1,_[_0x3962('0x1a')](_0x863e25)?JSON[_0x3962('0x18')](_0x863e25):_0x863e25);logger['info'](_0x3962('0xf'),_0x4f42b1);_0x461cfe['next']();}};}; \ No newline at end of file +var _0x0cee=['consequence','length','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x46dcfd,_0x122133){var _0x18b3af=function(_0xd8daa6){while(--_0xd8daa6){_0x46dcfd['push'](_0x46dcfd['shift']());}};_0x18b3af(++_0x122133);}(_0x0cee,0x1d2));var _0xe0ce=function(_0x4da392,_0xb29ed2){_0x4da392=_0x4da392-0x0;var _0xe03c5c=_0x0cee[_0x4da392];return _0xe03c5c;};'use strict';var schema=require(_0xe0ce('0x0'));var _=require(_0xe0ce('0x1'));var rpc={'chatInteraction':require(_0xe0ce('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xe0ce('0x3')),'mailInteraction':require(_0xe0ce('0x4')),'faxInteraction':require(_0xe0ce('0x5')),'whatsappInteraction':require(_0xe0ce('0x6'))};var logger=require(_0xe0ce('0x7'))('routing');var tag=schema({'tag':{'type':_0xe0ce('0x8'),'required':!![],'message':_0xe0ce('0x9')}});exports[_0xe0ce('0xa')]=function(_0x35f6a9,_0x52600c,_0x508e8f,_0x3ef28f){return function(_0x344ef1){try{var _0x2ec422={'tag':_0x52600c[0x0]};var _0x2166ea=tag[_0xe0ce('0x0')](_0x2ec422,{'typecast':!![]});if(_0x2166ea[_0xe0ce('0xb')]){logger['error'](_0xe0ce('0xc'),_0x35f6a9,_['map'](_0x2166ea,_0xe0ce('0xd'))[_0xe0ce('0xe')](',\x20'));logger[_0xe0ce('0xf')](_0xe0ce('0x10'),_0x35f6a9);_0x344ef1[_0xe0ce('0x11')]();}else{var _0x1434b9={'ids':[_0x52600c[0x0]]};if(rpc[_0x3ef28f[_0xe0ce('0x12')]+_0xe0ce('0x13')]){rpc[_0x3ef28f[_0xe0ce('0x12')]+_0xe0ce('0x13')][_0xe0ce('0x14')](_0x3ef28f[_0xe0ce('0x15')]['id'],_0x1434b9)['then'](function(_0x25df5c){logger[_0xe0ce('0xf')](_0xe0ce('0x16'),_0x35f6a9,_0x52600c[0x1],_0x3ef28f[_0xe0ce('0x12')],_0x3ef28f[_0xe0ce('0x15')]['id']);})[_0xe0ce('0x17')](function(_0x2e8cd4){logger[_0xe0ce('0x18')](_0xe0ce('0xc'),_0x35f6a9,JSON[_0xe0ce('0x19')](_0x2e8cd4));logger[_0xe0ce('0xf')](_0xe0ce('0x10'),_0x35f6a9);})[_0xe0ce('0x1a')](function(){_0x344ef1[_0xe0ce('0x11')]();});}}}catch(_0x4db846){logger[_0xe0ce('0x18')](_0xe0ce('0xc'),_0x35f6a9,_[_0xe0ce('0x1b')](_0x4db846)?JSON['stringify'](_0x4db846):_0x4db846);logger[_0xe0ce('0xf')](_0xe0ce('0x10'),_0x35f6a9);_0x344ef1[_0xe0ce('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 9ea2e9e..d92b7fa 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e7d=['parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','stringify','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','jsonrpc','2.0','method','login','params'];(function(_0x1378fe,_0x2caffe){var _0x261323=function(_0x531c91){while(--_0x531c91){_0x1378fe['push'](_0x1378fe['shift']());}};_0x261323(++_0x2caffe);}(_0x4e7d,0xbc));var _0xd4e7=function(_0x1ccb5b,_0x16fc55){_0x1ccb5b=_0x1ccb5b-0x0;var _0x21203a=_0x4e7d[_0x1ccb5b];return _0x21203a;};'use strict';var rp=require('request-promise');var logger=require(_0xd4e7('0x0'))(_0xd4e7('0x1'));var _=require(_0xd4e7('0x2'));var arr=[];exports[_0xd4e7('0x3')]=function(_0x3e0d4f,_0x308e80){return function(_0x16f503){var _0x547435=_0x308e80[0xa];var _0x1451d1=_0x308e80[0xb];var _0x29a23e=_0x308e80[0xc];var _0x421ecf=_0x308e80[0xd];var _0x4bb99b=_0x308e80[0xe];var _0x5985fe=_0x308e80[0xf]['replace'](/\n/g,_0xd4e7('0x4'));var _0x561f6d=_0x308e80[0x10][_0xd4e7('0x5')](/\n/g,'\x20');if(!arr[_0xd4e7('0x6')](_0x1451d1)){arr[_0xd4e7('0x7')](_0x1451d1);var _0x552c2e=_0x308e80[0x3];var _0x2a0e41=_0x308e80[0x4];var _0x82f2c4=_0x308e80[0x1];var _0x1c8c44=_0x308e80[0x0];var _0x32c78e={};_0x32c78e[_0xd4e7('0x8')]=_0x308e80[0x8]+_0xd4e7('0x9')+_0x29a23e+'|'+_0x547435+'|'+_0x421ecf+'|'+_0x1451d1+'|'+_0x4bb99b;_0x32c78e['urlOnRing']=_0x308e80[0x7]+_0xd4e7('0x9')+_0x29a23e+'|'+_0x547435+'|'+_0x421ecf+'|'+_0x1451d1+'|'+_0x4bb99b+'|'+_0x5985fe+'|'+_0x561f6d;_0x32c78e['title']=_0x308e80[0x9];var _0x533a43={};_0x533a43[_0xd4e7('0xa')]=_0xd4e7('0xb');_0x533a43[_0xd4e7('0xc')]=_0xd4e7('0xd');var _0x51082e=[];_0x51082e['push'](_0x308e80[0x2]);_0x51082e[_0xd4e7('0x7')](_0x308e80[0x5]);_0x51082e['push'](_0x308e80[0x6]);_0x533a43[_0xd4e7('0xe')]=_0x51082e;_0x533a43['id']=0x1;var _0x5e19d0=JSON['stringify'](_0x533a43);var _0x4e7cbb={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x552c2e,'headers':{'Content-Type':'application/json-rpc'},'body':_0x5e19d0};return rp(_0x4e7cbb)['then'](function(_0x2f4724){const _0x405d77=JSON[_0xd4e7('0xf')](_0x2f4724);if(!_0x405d77['result'][_0xd4e7('0x10')]){throw new Error(_0xd4e7('0x11'));}var _0x28f4dc=_0x1451d1;var _0x5eda61='channelId='+_0x82f2c4+_0xd4e7('0x12')+_0x1c8c44+'&sessionId='+_0x28f4dc+_0xd4e7('0x13')+JSON['stringify'](_0x32c78e);var _0x2c2b0d=_0x2a0e41+'?'+_0x5eda61;return rp(_0x2c2b0d);})[_0xd4e7('0x14')](function(_0x16229b){logger[_0xd4e7('0x15')](_0xd4e7('0x16'),_0x3e0d4f,_0x16229b);_0x16f503[_0xd4e7('0x17')]();})[_0xd4e7('0x18')](function(_0x410676){logger['error'](_0xd4e7('0x19'),_0x3e0d4f,_['isObject'](_0x410676)?JSON[_0xd4e7('0x1a')](_0x410676):_0x410676);_0x16f503['stop']();});}else{logger[_0xd4e7('0x15')](_0xd4e7('0x1b'),_0x3e0d4f);_0x16f503[_0xd4e7('0x1c')]();}};}; \ No newline at end of file +var _0x639e=['urlOnAnswer','?params=','title','jsonrpc','2.0','method','stringify','utf8','POST','application/json-rpc','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','lodash','replace','push'];(function(_0x3a9aac,_0x299e9b){var _0x31b6f5=function(_0x19c315){while(--_0x19c315){_0x3a9aac['push'](_0x3a9aac['shift']());}};_0x31b6f5(++_0x299e9b);}(_0x639e,0x113));var _0xe639=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x639e[_0x10291b];return _0x1d5fbe;};'use strict';var rp=require(_0xe639('0x0'));var logger=require(_0xe639('0x1'))('routing');var _=require(_0xe639('0x2'));var arr=[];exports['consequence']=function(_0x3b9fb2,_0x348148){return function(_0x3a0019){var _0x509da6=_0x348148[0xa];var _0x31ff49=_0x348148[0xb];var _0x780fbf=_0x348148[0xc];var _0x353c2b=_0x348148[0xd];var _0x359fac=_0x348148[0xe];var _0x4749f3=_0x348148[0xf][_0xe639('0x3')](/\n/g,'\x20-\x20');var _0x21ec68=_0x348148[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x31ff49)){arr[_0xe639('0x4')](_0x31ff49);var _0x21d216=_0x348148[0x3];var _0x2b97f5=_0x348148[0x4];var _0x36e423=_0x348148[0x1];var _0xc72822=_0x348148[0x0];var _0x47c736={};_0x47c736[_0xe639('0x5')]=_0x348148[0x8]+_0xe639('0x6')+_0x780fbf+'|'+_0x509da6+'|'+_0x353c2b+'|'+_0x31ff49+'|'+_0x359fac;_0x47c736['urlOnRing']=_0x348148[0x7]+_0xe639('0x6')+_0x780fbf+'|'+_0x509da6+'|'+_0x353c2b+'|'+_0x31ff49+'|'+_0x359fac+'|'+_0x4749f3+'|'+_0x21ec68;_0x47c736[_0xe639('0x7')]=_0x348148[0x9];var _0x21e129={};_0x21e129[_0xe639('0x8')]=_0xe639('0x9');_0x21e129[_0xe639('0xa')]='login';var _0x445b6d=[];_0x445b6d[_0xe639('0x4')](_0x348148[0x2]);_0x445b6d['push'](_0x348148[0x5]);_0x445b6d[_0xe639('0x4')](_0x348148[0x6]);_0x21e129['params']=_0x445b6d;_0x21e129['id']=0x1;var _0x4662ac=JSON[_0xe639('0xb')](_0x21e129);var _0x38cdef={'encoding':_0xe639('0xc'),'method':_0xe639('0xd'),'timeout':0x2710,'url':_0x21d216,'headers':{'Content-Type':_0xe639('0xe')},'body':_0x4662ac};return rp(_0x38cdef)['then'](function(_0x516d81){const _0x2f33d6=JSON[_0xe639('0xf')](_0x516d81);if(!_0x2f33d6['result'][_0xe639('0x10')]){throw new Error(_0xe639('0x11'));}var _0x59eccf=_0x31ff49;var _0x4a71e5=_0xe639('0x12')+_0x36e423+_0xe639('0x13')+_0xc72822+'&sessionId='+_0x59eccf+_0xe639('0x14')+JSON[_0xe639('0xb')](_0x47c736);var _0x540c88=_0x2b97f5+'?'+_0x4a71e5;return rp(_0x540c88);})['then'](function(_0x3b26c1){logger[_0xe639('0x15')](_0xe639('0x16'),_0x3b9fb2,_0x3b26c1);_0x3a0019[_0xe639('0x17')]();})[_0xe639('0x18')](function(_0x35f437){logger['error'](_0xe639('0x19'),_0x3b9fb2,_[_0xe639('0x1a')](_0x35f437)?JSON[_0xe639('0xb')](_0x35f437):_0x35f437);_0x3a0019['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x3b9fb2);_0x3a0019[_0xe639('0x1b')]();}};}; \ 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 6997916..11854d3 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x3d3c54,_0x206706){var _0x209c8a=function(_0x3269a8){while(--_0x3269a8){_0x3d3c54['push'](_0x3d3c54['shift']());}};_0x209c8a(++_0x206706);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x4e4c50,_0x637a2f){var _0x4146d7=function(_0x371c10){while(--_0x371c10){_0x4e4c50['push'](_0x4e4c50['shift']());}};_0x4146d7(++_0x637a2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index a17d0ed..0cb9b4e 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 _0x524a=['complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','listen','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel','message','interaction','applications','isArray','length','app','.js','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','emit'];(function(_0x5d0814,_0x30b9f5){var _0x5f28ef=function(_0x43991a){while(--_0x43991a){_0x5d0814['push'](_0x5d0814['shift']());}};_0x5f28ef(++_0x30b9f5);}(_0x524a,0xf5));var _0xa524=function(_0x299e1b,_0xc4ecba){_0x299e1b=_0x299e1b-0x0;var _0x3ae88d=_0x524a[_0x299e1b];return _0x3ae88d;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var fs=require('fs');var jayson=require(_0xa524('0x3'));var BPromise=require('bluebird');var utils=require(_0xa524('0x4'));var logger=require(_0xa524('0x5'))(_0xa524('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xa524('0x7')),'smsQueueReport':require(_0xa524('0x8')),'faxQueueReport':require(_0xa524('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xa524('0xa'));function getId(_0x56bd0e,_0x3a2dd6,_0x11aa98){return util['format'](_0xa524('0xb'),_0x56bd0e,_0x3a2dd6||0x0,_0x11aa98||0x0);}function getIntervals(_0x1db5bb,_0x228ffe){var _0x13076e=[];if(!_[_0xa524('0xc')](_0x228ffe['IntervalId'])&&!_[_0xa524('0xc')](_0x1db5bb[_0x228ffe[_0xa524('0xd')]])&&!_['isNil'](_0x1db5bb[_0x228ffe['IntervalId']][_0xa524('0xe')])){_0x13076e=_[_0xa524('0xf')](_0x1db5bb[_0x228ffe[_0xa524('0xd')]]['Intervals'],'interval');}else if(!_[_0xa524('0xc')](_0x228ffe['interval'])){_0x13076e=[_0x228ffe[_0xa524('0x10')]];}return _0x13076e;}exports['listen']=function(_0x2c0864){_0x2c0864['rules']={};return new BPromise(function(_0x75bfe8,_0x281137){var _0x59620d={'Start':function(_0x2d8bdb){var _0x15b14c=this;return new Promise(function(_0xe85361,_0x1de01e){if(_0x2d8bdb){try{var _0x45347f=[];var _0x433c8a=getId(_0x2d8bdb[_0xa524('0x11')],_0x2d8bdb['message']?_0x2d8bdb[_0xa524('0x12')]['id']:0x0,_0x2d8bdb[_0xa524('0x13')]?_0x2d8bdb[_0xa524('0x13')]['id']:0x0);if(_0x2d8bdb[_0xa524('0x14')]&&_[_0xa524('0x15')](_0x2d8bdb[_0xa524('0x14')])&&_0x2d8bdb[_0xa524('0x14')][_0xa524('0x16')]){for(var _0x54b249=0x0;_0x54b249<_0x2d8bdb[_0xa524('0x14')][_0xa524('0x16')];_0x54b249+=0x1){var _0xb31e2d=_0x2d8bdb[_0xa524('0x14')][_0x54b249];if(fs['existsSync'](path['join'](__dirname,_0xa524('0x14'),_0xb31e2d[_0xa524('0x17')]+_0xa524('0x18')))){var _0x1093cc=[];switch(_0xb31e2d[_0xa524('0x17')][_0xa524('0x19')]()){case'autoreply':var _0x262eac=_0xb31e2d[_0xa524('0x1a')][_0xa524('0x1b')](',');if(_0x2d8bdb[_0xa524('0x11')]===_0xa524('0x1c')){_0x1093cc[_0xa524('0x1d')](_0x262eac[0x0]);_0x1093cc[_0xa524('0x1d')](_0x262eac[0x1]);_0x1093cc['push'](_0x262eac[_0xa524('0x1e')](0x2,_0x262eac[_0xa524('0x16')])['join'](','));}else{_0x1093cc['push'](_0x262eac[0x0]);_0x1093cc[_0xa524('0x1d')](_0x262eac[_0xa524('0x1e')](0x1,_0x262eac[_0xa524('0x16')])[_0xa524('0x1f')](','));}break;case _0xa524('0x20'):var _0x546060=_0xb31e2d['appdata'][_0xa524('0x1b')](',');_0x1093cc[_0xa524('0x1d')](_0x546060[0x0]);_0x1093cc[_0xa524('0x1d')](_0x546060[0x1]);_0x1093cc[_0xa524('0x1d')](_0x546060['slice'](0x2,_0x546060[_0xa524('0x16')])[_0xa524('0x1f')](','));break;case'dialogflowv2':var _0x27f53a=_0xb31e2d[_0xa524('0x1a')]['split'](',');_0x1093cc[_0xa524('0x1d')](_0x27f53a[0x0]);_0x1093cc['push'](_0x27f53a[0x1]);_0x1093cc[_0xa524('0x1d')](_0x27f53a[0x2]);_0x1093cc[_0xa524('0x1d')](_0x27f53a[0x3]);_0x1093cc[_0xa524('0x1d')](_0x27f53a[_0xa524('0x1e')](0x4,_0x27f53a[_0xa524('0x16')])[_0xa524('0x1f')](','));break;case _0xa524('0x21'):var _0x201545=_0xb31e2d[_0xa524('0x1a')]['split'](',');_0x1093cc['push'](_0x201545[0x0]);_0x1093cc[_0xa524('0x1d')](_0x201545[0x1]);_0x1093cc['push'](_0x201545[0x2]);_0x1093cc['push'](_0x201545[0x3]);_0x1093cc[_0xa524('0x1d')](_0x201545[_0xa524('0x1e')](0x4,_0x201545[_0xa524('0x16')])[_0xa524('0x1f')](','));break;case'message':_0x1093cc['push'](_0xb31e2d[_0xa524('0x1a')]);break;case'tag':_0x1093cc['push'](_0xb31e2d[_0xa524('0x22')]);_0x1093cc[_0xa524('0x1d')](_0xb31e2d[_0xa524('0x1a')]);break;case _0xa524('0x23'):var _0x1bf6f6=utils[_0xa524('0x24')](_0x2d8bdb[_0xa524('0x25')][_0xa524('0x26')],_0x2d8bdb);var _0xa0a63f=_0xb31e2d[_0xa524('0x1a')][_0xa524('0x1b')](',');_0x1093cc[_0xa524('0x1d')](_0xa0a63f[0x0]);_0x1093cc['push'](_0xa0a63f[0x1]);_0x1093cc['push'](_0xa0a63f[0x2]);_0x1093cc['push'](_0xa0a63f[0x3]);_0x1093cc[_0xa524('0x1d')](_0xa0a63f[0x4]);_0x1093cc[_0xa524('0x1d')](_0xa0a63f[0x5]);_0x1093cc['push'](_0xa0a63f[0x6]);_0x1093cc[_0xa524('0x1d')](_0xa0a63f[0x7]);_0x1093cc['push'](_0xa0a63f[0x8]);_0x1093cc[_0xa524('0x1d')](_0xa0a63f[0x9]);_0x1093cc[_0xa524('0x1d')](_0xa0a63f[0xa]);_0x1093cc['push'](_0x2d8bdb[_0xa524('0x13')]['id']);_0x1093cc[_0xa524('0x1d')](_0x2d8bdb[_0xa524('0x12')]['id']);_0x1093cc['push'](_0xb31e2d[_0xa524('0x27')]);_0x1093cc[_0xa524('0x1d')](_0x2d8bdb['interaction'][_0xa524('0x28')]);_0x1093cc[_0xa524('0x1d')](_0x2d8bdb['body'][_0xa524('0x29')]);_0x1093cc[_0xa524('0x1d')](_0x1bf6f6);break;default:_0x1093cc=_['isNil'](_0xb31e2d[_0xa524('0x1a')])?[]:_0xb31e2d[_0xa524('0x1a')][_0xa524('0x1b')](',');}var _0x38238c={'id':util[_0xa524('0x2a')](_0xa524('0x2b'),_0x433c8a,_0xb31e2d['id'],_0xb31e2d[_0xa524('0x17')]),'condition':require(_0xa524('0x2c'))[_0xa524('0x2d')](_0x433c8a,getIntervals(_0x2c0864[_0xa524('0x2e')],_0xb31e2d),_0x2c0864),'consequence':require(_0xa524('0x2f')+_0xb31e2d['app'])[_0xa524('0x30')](_0x433c8a,_0x1093cc,_0x2c0864,_0x2d8bdb),'p':_0xb31e2d['priority']||0x0};logger[_0xa524('0x31')](_0xa524('0x32'),_0x38238c['id'],_0xa524('0x33'),getIntervals(_0x2c0864[_0xa524('0x2e')],_0xb31e2d)[_0xa524('0x1f')](_0xa524('0x34')));_0x45347f[_0xa524('0x1d')](_0x38238c);}else{logger[_0xa524('0x35')](_0xa524('0x36'),path[_0xa524('0x1f')](__dirname,'applications',_0xb31e2d[_0xa524('0x17')]+_0xa524('0x18')));}}_0x2c0864['rules'][_0x433c8a]=new RuleEngine(_0x45347f);_0x2c0864[_0xa524('0x37')][_0x433c8a][_0xa524('0x38')](_0x2d8bdb,function(_0x4885a4){logger['info']('Applications\x20executed',JSON['stringify'](_0x4885a4['matchPath']));if(_0x2c0864[_0xa524('0x37')][_0x433c8a]){_0x2c0864[_0xa524('0x37')][_0x433c8a][_0xa524('0x39')](_0xa524('0x3a'));}});return _0xe85361({'code':0xc8,'message':_0x2d8bdb});}else{logger['info'](_0xa524('0x3b'));return _0xe85361({'code':0xc8,'message':_0x2d8bdb});}}catch(_0x44b3e8){logger[_0xa524('0x35')](_0x44b3e8[_0xa524('0x3c')]);return _0x1de01e(_0x15b14c['error'](0x1f4,_0x44b3e8));}}return _0x1de01e(_0xa524('0x3d'));});},'AcceptMessage':function(_0x17675a){var _0x21dce0=this;return new Promise(function(_0x44ed59,_0x239c77){if(_0x17675a['agent']&&_0x17675a[_0xa524('0x3e')]['id']){if(_0x2c0864[_0xa524('0x3f')][_0x17675a[_0xa524('0x3e')]['id']]){_0x2c0864[_0xa524('0x3f')][_0x17675a[_0xa524('0x3e')]['id']][_0xa524('0x40')]=![];_0x2c0864[_0xa524('0x3f')][_0x17675a[_0xa524('0x3e')]['id']][_0xa524('0x41')]=undefined;}}if(_0x17675a['message']&&_0x17675a['message']['id']){try{var _0x14ab60=getId(_0x17675a[_0xa524('0x11')],_0x17675a[_0xa524('0x12')]?_0x17675a[_0xa524('0x12')]['id']:0x0,_0x17675a[_0xa524('0x13')]?_0x17675a[_0xa524('0x13')]['id']:0x0);if(_0x2c0864['rules'][_0x14ab60]){_0x2c0864[_0xa524('0x37')][_0x14ab60][_0xa524('0x39')](_0xa524('0x42'));if(rpc[_0x17675a[_0xa524('0x11')]+_0xa524('0x43')]){rpc[_0x17675a[_0xa524('0x11')]+'QueueReport'][_0xa524('0x44')](_0x14ab60,{'UserId':_0x17675a[_0xa524('0x12')][_0xa524('0x45')]})[_0xa524('0x46')](function(){logger[_0xa524('0x35')](_0xa524('0x47'));});}}return _0x44ed59({'code':0xc8,'message':_0x17675a});}catch(_0xef18b7){logger[_0xa524('0x35')](_0xef18b7[_0xa524('0x3c')]);return _0x239c77(_0x21dce0[_0xa524('0x35')](0x1f4,_0xef18b7));}}logger[_0xa524('0x35')](_0xa524('0x48'));return _0x239c77(_0x21dce0[_0xa524('0x35')](0x1f4,_0xa524('0x48')));});},'RejectMessage':function(_0x25e04b){var _0x5e9919=this;return new Promise(function(_0x1264f5,_0x3a6000){if(_0x25e04b['agent']&&_0x25e04b['agent']['id']){try{if(_0x2c0864[_0xa524('0x3f')][_0x25e04b[_0xa524('0x3e')]['id']]){_0x2c0864[_0xa524('0x3f')][_0x25e04b[_0xa524('0x3e')]['id']][_0xa524('0x40')]=![];_0x2c0864[_0xa524('0x3f')][_0x25e04b[_0xa524('0x3e')]['id']]['busyQueue']=undefined;}return _0x1264f5({'code':0xc8,'message':_0x25e04b});}catch(_0x1d9552){logger[_0xa524('0x35')](_0x1d9552[_0xa524('0x3c')]);return _0x3a6000(_0x5e9919[_0xa524('0x35')](0x1f4,_0x1d9552));}}logger[_0xa524('0x35')]('message\x20is\x20empty');return _0x3a6000(_0x5e9919[_0xa524('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x205a09){var _0x47217a=this;return new Promise(function(_0x1441da,_0x3f5694){if(_0x205a09[_0xa524('0x11')]&&_0x205a09[_0xa524('0x13')]&&_0x205a09[_0xa524('0x13')]['id']){try{var _0x5c173a=getId(_0x205a09['channel'],_0x205a09[_0xa524('0x12')]?_0x205a09[_0xa524('0x12')]['id']:0x0,_0x205a09[_0xa524('0x13')]?_0x205a09['interaction']['id']:0x0);if(_0x2c0864[_0xa524('0x37')][_0x5c173a]){_0x2c0864[_0xa524('0x37')][_0x5c173a]['emit'](_0xa524('0x42'));}return _0x1441da({'code':0xc8,'message':_0x205a09});}catch(_0x208d94){logger[_0xa524('0x35')](_0x208d94[_0xa524('0x3c')]);return _0x3f5694(_0x47217a[_0xa524('0x35')](0x1f4,_0x208d94));}}logger[_0xa524('0x35')](_0xa524('0x48'));return _0x3f5694(_0x47217a['error'](0x1f4,_0xa524('0x48')));});},'AgentCapacity':function(_0xa4c535){var _0x467144=this;return new Promise(function(_0x1ef1aa,_0x5f2de3){if(_0x2c0864[_0xa524('0x3f')][_0xa524('0x49')](_0xa4c535['id'])){for(var _0x5cd707 in _0xa4c535[_0xa524('0x4a')]){if(_0xa4c535[_0xa524('0x4a')][_0xa524('0x49')](_0x5cd707)){if(_0x2c0864[_0xa524('0x3f')][_0xa4c535['id']]['hasOwnProperty'](_0x5cd707+'CurrentCapacity')){_0x2c0864[_0xa524('0x3f')][_0xa4c535['id']][_0x5cd707+'CurrentCapacity']=parseInt(_0xa4c535['capacity'][_0x5cd707],0xa);}}}_0x2c0864['agents'][_0xa4c535['id']][_0xa524('0x4b')]();return _0x1ef1aa({'code':0xc8,'message':_0x2c0864['agents'][_0xa4c535['id']]});}else{return _0x5f2de3(_0x467144['error'](0x1f4,_0xa524('0x4c')));}});},'Agents':function(_0x3e4255){return new Promise(function(_0x1675de){var _0x11fda3=_['values'](_0x2c0864[_0xa524('0x3f')]);if(_0x3e4255&&_0x3e4255['id']){var _0x2878e5=_[_0xa524('0x4d')](_0x11fda3,function(_0x4fbe19){return _0x4fbe19['id']===_0x3e4255['id'];});_0x1675de(_0x2878e5);}else{_0x1675de({'count':_0x11fda3[_0xa524('0x16')],'rows':_0x11fda3});}});},'ChatQueues':function(){return new Promise(function(_0xbea3d5){var _0x5da1de=[];for(var _0x578dd0 in _0x2c0864[_0xa524('0x4e')]){if(_0x2c0864[_0xa524('0x4e')][_0xa524('0x49')](_0x578dd0)){var _0x1cdbf3=_0x2c0864['chatQueues'][_0x578dd0];var _0x4d1f65={'id':_0x1cdbf3['id'],'available':_0x1cdbf3[_0xa524('0x4f')],'loggedIn':_0x1cdbf3[_0xa524('0x50')],'name':_0x1cdbf3[_0xa524('0x51')],'paused':_0x1cdbf3['paused'],'waiting':_0x1cdbf3['waiting']};_0x5da1de[_0xa524('0x1d')](_0x4d1f65);}}_0xbea3d5({'count':_0x5da1de['length'],'rows':_0x5da1de});});},'MailQueues':function(){return new Promise(function(_0x4d9915){var _0x5bae79=[];for(var _0x4f71b1 in _0x2c0864[_0xa524('0x52')]){if(_0x2c0864[_0xa524('0x52')]['hasOwnProperty'](_0x4f71b1)){var _0x4ab4bc=_0x2c0864[_0xa524('0x52')][_0x4f71b1];var _0x19da31={'id':_0x4ab4bc['id'],'available':_0x4ab4bc['available'],'loggedIn':_0x4ab4bc[_0xa524('0x50')],'name':_0x4ab4bc[_0xa524('0x51')],'paused':_0x4ab4bc[_0xa524('0x53')],'waiting':_0x4ab4bc[_0xa524('0x54')]};_0x5bae79[_0xa524('0x1d')](_0x19da31);}}_0x4d9915({'count':_0x5bae79[_0xa524('0x16')],'rows':_0x5bae79});});},'OpenchannelQueues':function(){return new Promise(function(_0x3b2aea){var _0x27552b=[];for(var _0xf1a9b in _0x2c0864[_0xa524('0x55')]){if(_0x2c0864['openchannelQueues'][_0xa524('0x49')](_0xf1a9b)){var _0x122cdb=_0x2c0864[_0xa524('0x55')][_0xf1a9b];var _0x1f6f53={'id':_0x122cdb['id'],'available':_0x122cdb[_0xa524('0x4f')],'loggedIn':_0x122cdb[_0xa524('0x50')],'name':_0x122cdb['name'],'paused':_0x122cdb['paused'],'waiting':_0x122cdb[_0xa524('0x54')]};_0x27552b['push'](_0x1f6f53);}}_0x3b2aea({'count':_0x27552b[_0xa524('0x16')],'rows':_0x27552b});});},'SmsQueues':function(){return new Promise(function(_0x37e767){var _0x3dc533=[];for(var _0x4975bb in _0x2c0864[_0xa524('0x56')]){if(_0x2c0864[_0xa524('0x56')][_0xa524('0x49')](_0x4975bb)){var _0x2c9001=_0x2c0864[_0xa524('0x56')][_0x4975bb];var _0x106168={'id':_0x2c9001['id'],'available':_0x2c9001[_0xa524('0x4f')],'loggedIn':_0x2c9001['loggedIn'],'name':_0x2c9001[_0xa524('0x51')],'paused':_0x2c9001[_0xa524('0x53')],'waiting':_0x2c9001[_0xa524('0x54')]};_0x3dc533[_0xa524('0x1d')](_0x106168);}}_0x37e767({'count':_0x3dc533[_0xa524('0x16')],'rows':_0x3dc533});});},'FaxQueues':function(){return new Promise(function(_0x3852b9){var _0x54d86b=[];for(var _0x224d75 in _0x2c0864[_0xa524('0x57')]){if(_0x2c0864[_0xa524('0x57')]['hasOwnProperty'](_0x224d75)){var _0x526e59=_0x2c0864[_0xa524('0x57')][_0x224d75];var _0x3a58b4={'id':_0x526e59['id'],'available':_0x526e59[_0xa524('0x4f')],'loggedIn':_0x526e59[_0xa524('0x50')],'name':_0x526e59[_0xa524('0x51')],'paused':_0x526e59[_0xa524('0x53')],'waiting':_0x526e59[_0xa524('0x54')]};_0x54d86b[_0xa524('0x1d')](_0x3a58b4);}}_0x3852b9({'count':_0x54d86b[_0xa524('0x16')],'rows':_0x54d86b});});},'WhatsappQueues':function(){return new Promise(function(_0x4a77d9){var _0x1b9563=[];for(var _0x3d65a1 in _0x2c0864['whatsappQueues']){if(_0x2c0864[_0xa524('0x58')][_0xa524('0x49')](_0x3d65a1)){var _0x34e5a6=_0x2c0864[_0xa524('0x58')][_0x3d65a1];var _0x2ad4c0={'id':_0x34e5a6['id'],'available':_0x34e5a6[_0xa524('0x4f')],'loggedIn':_0x34e5a6['loggedIn'],'name':_0x34e5a6['name'],'paused':_0x34e5a6['paused'],'waiting':_0x34e5a6[_0xa524('0x54')]};_0x1b9563['push'](_0x2ad4c0);}}_0x4a77d9({'count':_0x1b9563['length'],'rows':_0x1b9563});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x172035){var _0x297723=_[_0xa524('0x59')](_0x2c0864[_0xa524('0x5a')]);_0x172035({'count':_0x297723[_0xa524('0x16')],'rows':_0x297723});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x5598be){var _0x5b1beb=_[_0xa524('0x59')](_0x2c0864[_0xa524('0x5b')]);_0x5598be({'count':_0x5b1beb['length'],'rows':_0x5b1beb});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1d1319){var _0x5e8bc2=_[_0xa524('0x59')](_0x2c0864[_0xa524('0x5c')]);_0x1d1319({'count':_0x5e8bc2['length'],'rows':_0x5e8bc2});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3a850c){var _0x59f653=_['values'](_0x2c0864[_0xa524('0x5d')]);_0x3a850c({'count':_0x59f653[_0xa524('0x16')],'rows':_0x59f653});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2c453e){var _0x38e170=_[_0xa524('0x59')](_0x2c0864[_0xa524('0x5e')]);_0x2c453e({'count':_0x38e170[_0xa524('0x16')],'rows':_0x38e170});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4053b0){var _0x40b92e=_[_0xa524('0x59')](_0x2c0864['whatsappQueuesWaitingInteractions']);_0x4053b0({'count':_0x40b92e[_0xa524('0x16')],'rows':_0x40b92e});});}};var _0x13d0f3=jayson[_0xa524('0x5f')](_0x59620d)[_0xa524('0x60')]();_0x13d0f3['on'](_0xa524('0x35'),function(_0x3a3b99){logger[_0xa524('0x35')](JSON[_0xa524('0x61')](_0x3a3b99));return _0x281137(_0x3a3b99);});_0x13d0f3[_0xa524('0x62')](0x232c,'127.0.0.1',function(){console[_0xa524('0x63')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x75bfe8(_0xa524('0x64')+0x232c);});});}; \ No newline at end of file +var _0xac55=['channel','message','interaction','isArray','applications','length','join','.js','app','toLowerCase','appdata','split','mail','push','slice','dialogflow','amazonlex','getMustacheRender','ChatWebsiteId','ContactId','body','./interval','./applications/','consequence','priority','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','stack','agent','agents','busyQueue','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval'];(function(_0x143c8e,_0x270a76){var _0x1e8d0c=function(_0x436bcf){while(--_0x436bcf){_0x143c8e['push'](_0x143c8e['shift']());}};_0x1e8d0c(++_0x270a76);}(_0xac55,0x1c8));var _0x5ac5=function(_0x3c909d,_0x169bbc){_0x3c909d=_0x3c909d-0x0;var _0x27c53e=_0xac55[_0x3c909d];return _0x27c53e;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var path=require(_0x5ac5('0x2'));var fs=require('fs');var jayson=require(_0x5ac5('0x3'));var BPromise=require('bluebird');var utils=require(_0x5ac5('0x4'));var logger=require(_0x5ac5('0x5'))(_0x5ac5('0x6'));var rpc={'openchannelQueueReport':require(_0x5ac5('0x7')),'mailQueueReport':require(_0x5ac5('0x8')),'chatQueueReport':require(_0x5ac5('0x9')),'smsQueueReport':require(_0x5ac5('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x5ac5('0xb'));function getId(_0x247752,_0x2bee03,_0x42551a){return util[_0x5ac5('0xc')](_0x5ac5('0xd'),_0x247752,_0x2bee03||0x0,_0x42551a||0x0);}function getIntervals(_0x18f785,_0x5b84a3){var _0x5ea6f4=[];if(!_[_0x5ac5('0xe')](_0x5b84a3[_0x5ac5('0xf')])&&!_['isNil'](_0x18f785[_0x5b84a3[_0x5ac5('0xf')]])&&!_[_0x5ac5('0xe')](_0x18f785[_0x5b84a3['IntervalId']][_0x5ac5('0x10')])){_0x5ea6f4=_[_0x5ac5('0x11')](_0x18f785[_0x5b84a3['IntervalId']][_0x5ac5('0x10')],_0x5ac5('0x12'));}else if(!_[_0x5ac5('0xe')](_0x5b84a3[_0x5ac5('0x12')])){_0x5ea6f4=[_0x5b84a3[_0x5ac5('0x12')]];}return _0x5ea6f4;}exports['listen']=function(_0xe37d9a){_0xe37d9a['rules']={};return new BPromise(function(_0x1ce256,_0x40ee8a){var _0x58e6f7={'Start':function(_0x1633d1){var _0x57377b=this;return new Promise(function(_0x2a145d,_0x340195){if(_0x1633d1){try{var _0x30244d=[];var _0x1282be=getId(_0x1633d1[_0x5ac5('0x13')],_0x1633d1[_0x5ac5('0x14')]?_0x1633d1[_0x5ac5('0x14')]['id']:0x0,_0x1633d1['interaction']?_0x1633d1[_0x5ac5('0x15')]['id']:0x0);if(_0x1633d1['applications']&&_[_0x5ac5('0x16')](_0x1633d1[_0x5ac5('0x17')])&&_0x1633d1['applications'][_0x5ac5('0x18')]){for(var _0x5725b6=0x0;_0x5725b6<_0x1633d1[_0x5ac5('0x17')]['length'];_0x5725b6+=0x1){var _0x5aa45d=_0x1633d1[_0x5ac5('0x17')][_0x5725b6];if(fs['existsSync'](path[_0x5ac5('0x19')](__dirname,_0x5ac5('0x17'),_0x5aa45d['app']+_0x5ac5('0x1a')))){var _0x4ac526=[];switch(_0x5aa45d[_0x5ac5('0x1b')][_0x5ac5('0x1c')]()){case'autoreply':var _0x47a898=_0x5aa45d[_0x5ac5('0x1d')][_0x5ac5('0x1e')](',');if(_0x1633d1[_0x5ac5('0x13')]===_0x5ac5('0x1f')){_0x4ac526[_0x5ac5('0x20')](_0x47a898[0x0]);_0x4ac526['push'](_0x47a898[0x1]);_0x4ac526[_0x5ac5('0x20')](_0x47a898[_0x5ac5('0x21')](0x2,_0x47a898[_0x5ac5('0x18')])[_0x5ac5('0x19')](','));}else{_0x4ac526['push'](_0x47a898[0x0]);_0x4ac526[_0x5ac5('0x20')](_0x47a898['slice'](0x1,_0x47a898[_0x5ac5('0x18')])[_0x5ac5('0x19')](','));}break;case _0x5ac5('0x22'):var _0x2cb82f=_0x5aa45d[_0x5ac5('0x1d')][_0x5ac5('0x1e')](',');_0x4ac526['push'](_0x2cb82f[0x0]);_0x4ac526[_0x5ac5('0x20')](_0x2cb82f[0x1]);_0x4ac526['push'](_0x2cb82f[_0x5ac5('0x21')](0x2,_0x2cb82f[_0x5ac5('0x18')])[_0x5ac5('0x19')](','));break;case'dialogflowv2':var _0x283c41=_0x5aa45d[_0x5ac5('0x1d')][_0x5ac5('0x1e')](',');_0x4ac526[_0x5ac5('0x20')](_0x283c41[0x0]);_0x4ac526['push'](_0x283c41[0x1]);_0x4ac526[_0x5ac5('0x20')](_0x283c41[0x2]);_0x4ac526['push'](_0x283c41[0x3]);_0x4ac526[_0x5ac5('0x20')](_0x283c41[_0x5ac5('0x21')](0x4,_0x283c41[_0x5ac5('0x18')])[_0x5ac5('0x19')](','));break;case _0x5ac5('0x23'):var _0x4b3c1a=_0x5aa45d[_0x5ac5('0x1d')][_0x5ac5('0x1e')](',');_0x4ac526[_0x5ac5('0x20')](_0x4b3c1a[0x0]);_0x4ac526['push'](_0x4b3c1a[0x1]);_0x4ac526[_0x5ac5('0x20')](_0x4b3c1a[0x2]);_0x4ac526['push'](_0x4b3c1a[0x3]);_0x4ac526[_0x5ac5('0x20')](_0x4b3c1a[_0x5ac5('0x21')](0x4,_0x4b3c1a[_0x5ac5('0x18')])[_0x5ac5('0x19')](','));break;case _0x5ac5('0x14'):_0x4ac526['push'](_0x5aa45d[_0x5ac5('0x1d')]);break;case'tag':_0x4ac526[_0x5ac5('0x20')](_0x5aa45d['TagId']);_0x4ac526[_0x5ac5('0x20')](_0x5aa45d[_0x5ac5('0x1d')]);break;case'tvox':var _0x2bd707=utils[_0x5ac5('0x24')](_0x1633d1['account']['notificationTemplate'],_0x1633d1);var _0x1391c5=_0x5aa45d[_0x5ac5('0x1d')][_0x5ac5('0x1e')](',');_0x4ac526[_0x5ac5('0x20')](_0x1391c5[0x0]);_0x4ac526[_0x5ac5('0x20')](_0x1391c5[0x1]);_0x4ac526[_0x5ac5('0x20')](_0x1391c5[0x2]);_0x4ac526['push'](_0x1391c5[0x3]);_0x4ac526['push'](_0x1391c5[0x4]);_0x4ac526['push'](_0x1391c5[0x5]);_0x4ac526[_0x5ac5('0x20')](_0x1391c5[0x6]);_0x4ac526[_0x5ac5('0x20')](_0x1391c5[0x7]);_0x4ac526['push'](_0x1391c5[0x8]);_0x4ac526[_0x5ac5('0x20')](_0x1391c5[0x9]);_0x4ac526[_0x5ac5('0x20')](_0x1391c5[0xa]);_0x4ac526[_0x5ac5('0x20')](_0x1633d1[_0x5ac5('0x15')]['id']);_0x4ac526[_0x5ac5('0x20')](_0x1633d1[_0x5ac5('0x14')]['id']);_0x4ac526[_0x5ac5('0x20')](_0x5aa45d[_0x5ac5('0x25')]);_0x4ac526[_0x5ac5('0x20')](_0x1633d1['interaction'][_0x5ac5('0x26')]);_0x4ac526['push'](_0x1633d1[_0x5ac5('0x27')][_0x5ac5('0x27')]);_0x4ac526[_0x5ac5('0x20')](_0x2bd707);break;default:_0x4ac526=_[_0x5ac5('0xe')](_0x5aa45d[_0x5ac5('0x1d')])?[]:_0x5aa45d[_0x5ac5('0x1d')][_0x5ac5('0x1e')](',');}var _0x37cfad={'id':util[_0x5ac5('0xc')]('%s:%s:%s',_0x1282be,_0x5aa45d['id'],_0x5aa45d[_0x5ac5('0x1b')]),'condition':require(_0x5ac5('0x28'))['condition'](_0x1282be,getIntervals(_0xe37d9a['intervals'],_0x5aa45d),_0xe37d9a),'consequence':require(_0x5ac5('0x29')+_0x5aa45d['app'])[_0x5ac5('0x2a')](_0x1282be,_0x4ac526,_0xe37d9a,_0x1633d1),'p':_0x5aa45d[_0x5ac5('0x2b')]||0x0};logger['info']('Push\x20new\x20rule',_0x37cfad['id'],_0x5ac5('0x2c'),getIntervals(_0xe37d9a[_0x5ac5('0x2d')],_0x5aa45d)[_0x5ac5('0x19')](_0x5ac5('0x2e')));_0x30244d[_0x5ac5('0x20')](_0x37cfad);}else{logger[_0x5ac5('0x2f')](_0x5ac5('0x30'),path['join'](__dirname,_0x5ac5('0x17'),_0x5aa45d[_0x5ac5('0x1b')]+_0x5ac5('0x1a')));}}_0xe37d9a[_0x5ac5('0x31')][_0x1282be]=new RuleEngine(_0x30244d);_0xe37d9a[_0x5ac5('0x31')][_0x1282be][_0x5ac5('0x32')](_0x1633d1,function(_0x5b5f84){logger[_0x5ac5('0x33')](_0x5ac5('0x34'),JSON[_0x5ac5('0x35')](_0x5b5f84[_0x5ac5('0x36')]));if(_0xe37d9a['rules'][_0x1282be]){_0xe37d9a[_0x5ac5('0x31')][_0x1282be][_0x5ac5('0x37')](_0x5ac5('0x38'));}});return _0x2a145d({'code':0xc8,'message':_0x1633d1});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x2a145d({'code':0xc8,'message':_0x1633d1});}}catch(_0x1835be){logger[_0x5ac5('0x2f')](_0x1835be[_0x5ac5('0x39')]);return _0x340195(_0x57377b[_0x5ac5('0x2f')](0x1f4,_0x1835be));}}return _0x340195('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2d7475){var _0x5d143b=this;return new Promise(function(_0x3aff8f,_0x3dfeba){if(_0x2d7475['agent']&&_0x2d7475[_0x5ac5('0x3a')]['id']){if(_0xe37d9a['agents'][_0x2d7475[_0x5ac5('0x3a')]['id']]){_0xe37d9a[_0x5ac5('0x3b')][_0x2d7475[_0x5ac5('0x3a')]['id']]['busy']=![];_0xe37d9a['agents'][_0x2d7475[_0x5ac5('0x3a')]['id']][_0x5ac5('0x3c')]=undefined;}}if(_0x2d7475[_0x5ac5('0x14')]&&_0x2d7475[_0x5ac5('0x14')]['id']){try{var _0xbe6f34=getId(_0x2d7475[_0x5ac5('0x13')],_0x2d7475[_0x5ac5('0x14')]?_0x2d7475[_0x5ac5('0x14')]['id']:0x0,_0x2d7475[_0x5ac5('0x15')]?_0x2d7475['interaction']['id']:0x0);if(_0xe37d9a[_0x5ac5('0x31')][_0xbe6f34]){_0xe37d9a[_0x5ac5('0x31')][_0xbe6f34][_0x5ac5('0x37')]('end');if(rpc[_0x2d7475['channel']+_0x5ac5('0x3d')]){rpc[_0x2d7475[_0x5ac5('0x13')]+_0x5ac5('0x3d')]['update'](_0xbe6f34,{'UserId':_0x2d7475[_0x5ac5('0x14')][_0x5ac5('0x3e')]})[_0x5ac5('0x3f')](function(){logger[_0x5ac5('0x2f')](_0x5ac5('0x40'));});}}return _0x3aff8f({'code':0xc8,'message':_0x2d7475});}catch(_0x327952){logger[_0x5ac5('0x2f')](_0x327952['stack']);return _0x3dfeba(_0x5d143b['error'](0x1f4,_0x327952));}}logger['error'](_0x5ac5('0x41'));return _0x3dfeba(_0x5d143b[_0x5ac5('0x2f')](0x1f4,_0x5ac5('0x41')));});},'RejectMessage':function(_0x503623){var _0x1973f6=this;return new Promise(function(_0x31345e,_0x270825){if(_0x503623[_0x5ac5('0x3a')]&&_0x503623[_0x5ac5('0x3a')]['id']){try{if(_0xe37d9a['agents'][_0x503623['agent']['id']]){_0xe37d9a['agents'][_0x503623[_0x5ac5('0x3a')]['id']][_0x5ac5('0x42')]=![];_0xe37d9a[_0x5ac5('0x3b')][_0x503623[_0x5ac5('0x3a')]['id']][_0x5ac5('0x3c')]=undefined;}return _0x31345e({'code':0xc8,'message':_0x503623});}catch(_0x2501c3){logger[_0x5ac5('0x2f')](_0x2501c3[_0x5ac5('0x39')]);return _0x270825(_0x1973f6[_0x5ac5('0x2f')](0x1f4,_0x2501c3));}}logger[_0x5ac5('0x2f')](_0x5ac5('0x41'));return _0x270825(_0x1973f6[_0x5ac5('0x2f')](0x1f4,_0x5ac5('0x41')));});},'AbandonInteraction':function(_0x252030){var _0x285e1d=this;return new Promise(function(_0x49b721,_0x3a2945){if(_0x252030[_0x5ac5('0x13')]&&_0x252030['interaction']&&_0x252030[_0x5ac5('0x15')]['id']){try{var _0x45bd57=getId(_0x252030[_0x5ac5('0x13')],_0x252030[_0x5ac5('0x14')]?_0x252030[_0x5ac5('0x14')]['id']:0x0,_0x252030[_0x5ac5('0x15')]?_0x252030['interaction']['id']:0x0);if(_0xe37d9a[_0x5ac5('0x31')][_0x45bd57]){_0xe37d9a[_0x5ac5('0x31')][_0x45bd57][_0x5ac5('0x37')]('end');}return _0x49b721({'code':0xc8,'message':_0x252030});}catch(_0x26b9d4){logger[_0x5ac5('0x2f')](_0x26b9d4['stack']);return _0x3a2945(_0x285e1d[_0x5ac5('0x2f')](0x1f4,_0x26b9d4));}}logger[_0x5ac5('0x2f')]('message\x20is\x20empty');return _0x3a2945(_0x285e1d['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x277090){var _0x7429bf=this;return new Promise(function(_0x2bd926,_0x6df231){if(_0xe37d9a[_0x5ac5('0x3b')][_0x5ac5('0x43')](_0x277090['id'])){for(var _0x4ee231 in _0x277090[_0x5ac5('0x44')]){if(_0x277090[_0x5ac5('0x44')][_0x5ac5('0x43')](_0x4ee231)){if(_0xe37d9a[_0x5ac5('0x3b')][_0x277090['id']][_0x5ac5('0x43')](_0x4ee231+'CurrentCapacity')){_0xe37d9a['agents'][_0x277090['id']][_0x4ee231+'CurrentCapacity']=parseInt(_0x277090[_0x5ac5('0x44')][_0x4ee231],0xa);}}}_0xe37d9a[_0x5ac5('0x3b')][_0x277090['id']][_0x5ac5('0x45')]();return _0x2bd926({'code':0xc8,'message':_0xe37d9a[_0x5ac5('0x3b')][_0x277090['id']]});}else{return _0x6df231(_0x7429bf['error'](0x1f4,_0x5ac5('0x46')));}});},'Agents':function(_0x38b128){return new Promise(function(_0x3a72ea){var _0x4b30d7=_['values'](_0xe37d9a['agents']);if(_0x38b128&&_0x38b128['id']){var _0x2190e2=_[_0x5ac5('0x47')](_0x4b30d7,function(_0x41b98d){return _0x41b98d['id']===_0x38b128['id'];});_0x3a72ea(_0x2190e2);}else{_0x3a72ea({'count':_0x4b30d7[_0x5ac5('0x18')],'rows':_0x4b30d7});}});},'ChatQueues':function(){return new Promise(function(_0x387cab){var _0x3b7e70=[];for(var _0x53a641 in _0xe37d9a[_0x5ac5('0x48')]){if(_0xe37d9a['chatQueues']['hasOwnProperty'](_0x53a641)){var _0x3eda7f=_0xe37d9a[_0x5ac5('0x48')][_0x53a641];var _0x2b9438={'id':_0x3eda7f['id'],'available':_0x3eda7f[_0x5ac5('0x49')],'loggedIn':_0x3eda7f[_0x5ac5('0x4a')],'name':_0x3eda7f[_0x5ac5('0x4b')],'paused':_0x3eda7f[_0x5ac5('0x4c')],'waiting':_0x3eda7f[_0x5ac5('0x4d')]};_0x3b7e70[_0x5ac5('0x20')](_0x2b9438);}}_0x387cab({'count':_0x3b7e70[_0x5ac5('0x18')],'rows':_0x3b7e70});});},'MailQueues':function(){return new Promise(function(_0x13e80b){var _0x1f7768=[];for(var _0x299b02 in _0xe37d9a[_0x5ac5('0x4e')]){if(_0xe37d9a[_0x5ac5('0x4e')][_0x5ac5('0x43')](_0x299b02)){var _0x356f1b=_0xe37d9a[_0x5ac5('0x4e')][_0x299b02];var _0x116126={'id':_0x356f1b['id'],'available':_0x356f1b[_0x5ac5('0x49')],'loggedIn':_0x356f1b[_0x5ac5('0x4a')],'name':_0x356f1b['name'],'paused':_0x356f1b[_0x5ac5('0x4c')],'waiting':_0x356f1b['waiting']};_0x1f7768[_0x5ac5('0x20')](_0x116126);}}_0x13e80b({'count':_0x1f7768['length'],'rows':_0x1f7768});});},'OpenchannelQueues':function(){return new Promise(function(_0x27457e){var _0x58b9e2=[];for(var _0x565620 in _0xe37d9a[_0x5ac5('0x4f')]){if(_0xe37d9a['openchannelQueues'][_0x5ac5('0x43')](_0x565620)){var _0x396c9d=_0xe37d9a['openchannelQueues'][_0x565620];var _0x337645={'id':_0x396c9d['id'],'available':_0x396c9d[_0x5ac5('0x49')],'loggedIn':_0x396c9d[_0x5ac5('0x4a')],'name':_0x396c9d[_0x5ac5('0x4b')],'paused':_0x396c9d[_0x5ac5('0x4c')],'waiting':_0x396c9d[_0x5ac5('0x4d')]};_0x58b9e2['push'](_0x337645);}}_0x27457e({'count':_0x58b9e2[_0x5ac5('0x18')],'rows':_0x58b9e2});});},'SmsQueues':function(){return new Promise(function(_0x5b5758){var _0x23cbe6=[];for(var _0x2099a6 in _0xe37d9a[_0x5ac5('0x50')]){if(_0xe37d9a['smsQueues'][_0x5ac5('0x43')](_0x2099a6)){var _0xca16ec=_0xe37d9a[_0x5ac5('0x50')][_0x2099a6];var _0x4c5c66={'id':_0xca16ec['id'],'available':_0xca16ec[_0x5ac5('0x49')],'loggedIn':_0xca16ec[_0x5ac5('0x4a')],'name':_0xca16ec[_0x5ac5('0x4b')],'paused':_0xca16ec[_0x5ac5('0x4c')],'waiting':_0xca16ec[_0x5ac5('0x4d')]};_0x23cbe6['push'](_0x4c5c66);}}_0x5b5758({'count':_0x23cbe6['length'],'rows':_0x23cbe6});});},'FaxQueues':function(){return new Promise(function(_0x201713){var _0x220c1c=[];for(var _0x19aca2 in _0xe37d9a[_0x5ac5('0x51')]){if(_0xe37d9a[_0x5ac5('0x51')][_0x5ac5('0x43')](_0x19aca2)){var _0x53dd2d=_0xe37d9a[_0x5ac5('0x51')][_0x19aca2];var _0x2442a4={'id':_0x53dd2d['id'],'available':_0x53dd2d[_0x5ac5('0x49')],'loggedIn':_0x53dd2d[_0x5ac5('0x4a')],'name':_0x53dd2d[_0x5ac5('0x4b')],'paused':_0x53dd2d[_0x5ac5('0x4c')],'waiting':_0x53dd2d[_0x5ac5('0x4d')]};_0x220c1c[_0x5ac5('0x20')](_0x2442a4);}}_0x201713({'count':_0x220c1c[_0x5ac5('0x18')],'rows':_0x220c1c});});},'WhatsappQueues':function(){return new Promise(function(_0x2aae0c){var _0x579499=[];for(var _0x38e4fc in _0xe37d9a[_0x5ac5('0x52')]){if(_0xe37d9a[_0x5ac5('0x52')]['hasOwnProperty'](_0x38e4fc)){var _0x5a97f4=_0xe37d9a[_0x5ac5('0x52')][_0x38e4fc];var _0x27777b={'id':_0x5a97f4['id'],'available':_0x5a97f4[_0x5ac5('0x49')],'loggedIn':_0x5a97f4[_0x5ac5('0x4a')],'name':_0x5a97f4[_0x5ac5('0x4b')],'paused':_0x5a97f4[_0x5ac5('0x4c')],'waiting':_0x5a97f4['waiting']};_0x579499[_0x5ac5('0x20')](_0x27777b);}}_0x2aae0c({'count':_0x579499['length'],'rows':_0x579499});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1411d2){var _0x816369=_[_0x5ac5('0x53')](_0xe37d9a[_0x5ac5('0x54')]);_0x1411d2({'count':_0x816369['length'],'rows':_0x816369});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x29f547){var _0x4ad41b=_[_0x5ac5('0x53')](_0xe37d9a[_0x5ac5('0x55')]);_0x29f547({'count':_0x4ad41b[_0x5ac5('0x18')],'rows':_0x4ad41b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5046e0){var _0x28dd3d=_['values'](_0xe37d9a[_0x5ac5('0x56')]);_0x5046e0({'count':_0x28dd3d[_0x5ac5('0x18')],'rows':_0x28dd3d});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2b7943){var _0xdf5bdd=_['values'](_0xe37d9a['smsQueuesWaitingInteractions']);_0x2b7943({'count':_0xdf5bdd[_0x5ac5('0x18')],'rows':_0xdf5bdd});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5493af){var _0x59010a=_[_0x5ac5('0x53')](_0xe37d9a[_0x5ac5('0x57')]);_0x5493af({'count':_0x59010a[_0x5ac5('0x18')],'rows':_0x59010a});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2b248e){var _0x5cde48=_[_0x5ac5('0x53')](_0xe37d9a[_0x5ac5('0x58')]);_0x2b248e({'count':_0x5cde48[_0x5ac5('0x18')],'rows':_0x5cde48});});}};var _0x4d4082=jayson[_0x5ac5('0x59')](_0x58e6f7)[_0x5ac5('0x5a')]();_0x4d4082['on']('error',function(_0x164709){logger['error'](JSON[_0x5ac5('0x35')](_0x164709));return _0x40ee8a(_0x164709);});_0x4d4082[_0x5ac5('0x5b')](0x232c,_0x5ac5('0x5c'),function(){console[_0x5ac5('0x5d')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1ce256(_0x5ac5('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 6c0428f..10de3e6 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 _0xf038=['catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','bluebird','jayson/promise','../../../config/logger','routing','client','http','then','error','message','result'];(function(_0x22e571,_0x443a32){var _0x5b3f1c=function(_0x52a0ce){while(--_0x52a0ce){_0x22e571['push'](_0x22e571['shift']());}};_0x5b3f1c(++_0x443a32);}(_0xf038,0x92));var _0x8f03=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xf038[_0x5834bc];return _0x3e183a;};'use strict';var util=require('util');var BPromise=require(_0x8f03('0x0'));var jayson=require(_0x8f03('0x1'));var _=require('lodash');var logger=require(_0x8f03('0x2'))(_0x8f03('0x3'));var client=jayson[_0x8f03('0x4')][_0x8f03('0x5')]({'port':0x232a});function request(_0x59acd2,_0x3264c8){return new BPromise(function(_0x4910f8,_0x1e33b5){return client['request'](_0x59acd2,_0x3264c8)[_0x8f03('0x6')](function(_0x53dc1e){if(_0x53dc1e['error']){return _0x1e33b5(_0x53dc1e[_0x8f03('0x7')][_0x8f03('0x8')]);}else{return _0x4910f8(_0x53dc1e[_0x8f03('0x9')]);}})[_0x8f03('0xa')](function(_0x3285f6){return _0x1e33b5(_0x3285f6);});});}exports['condition']=function(_0x2e93c8,_0x52a1c8,_0x40e5ef){return function(_0x5a425a){if(_0x40e5ef[_0x8f03('0xb')]&&!_0x40e5ef['rules'][_0x2e93c8]){logger['info'](_0x8f03('0xc'),_0x2e93c8);return _0x5a425a[_0x8f03('0xd')]();}var _0x5b91a1=[];for(var _0x5e685d=0x0;_0x5e685d<_0x52a1c8[_0x8f03('0xe')];_0x5e685d+=0x1){_0x5b91a1[_0x8f03('0xf')](request('Command',{'command':util[_0x8f03('0x10')](_0x8f03('0x11'),_0x52a1c8[_0x5e685d])})[_0x8f03('0x6')](function(_0x26d443){return _0x26d443&&_0x26d443['message']&&_0x26d443['message'][_0x8f03('0x12')]('true')>=0x0?!![]:![];})[_0x8f03('0xa')](function(_0x4e52e2){logger[_0x8f03('0x7')](_0x8f03('0x13'),_0x2e93c8,_0x52a1c8[_0x5e685d]);}));}BPromise[_0x8f03('0x14')](_0x5b91a1)[_0x8f03('0x6')](function(_0x2e93fe){var _0x4e9b54=_['some'](_0x2e93fe);logger['info'](_0x8f03('0x15'),_0x2e93c8,_0x52a1c8[_0x8f03('0x16')]('\x20|\x20'),_0x4e9b54);_0x5a425a[_0x8f03('0x17')](_0x4e9b54);})[_0x8f03('0xa')](function(_0x293756){console[_0x8f03('0x18')](_0x293756);logger['error'](_0x8f03('0x15'),_0x2e93c8,_0x52a1c8[_0x8f03('0x16')](_0x8f03('0x19')),_0x293756['stack']);_0x5a425a[_0x8f03('0xd')]();});};}; \ No newline at end of file +var _0x7ef4=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','lodash','routing','client','http','then','error','result','catch','condition','info'];(function(_0x52ea0e,_0x46d90c){var _0x2f0922=function(_0x27afb5){while(--_0x27afb5){_0x52ea0e['push'](_0x52ea0e['shift']());}};_0x2f0922(++_0x46d90c);}(_0x7ef4,0xfa));var _0x47ef=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7ef4[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x47ef('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0x47ef('0x1'));var logger=require('../../../config/logger')(_0x47ef('0x2'));var client=jayson[_0x47ef('0x3')][_0x47ef('0x4')]({'port':0x232a});function request(_0x65f094,_0x1339fb){return new BPromise(function(_0x109a6a,_0x11356f){return client['request'](_0x65f094,_0x1339fb)[_0x47ef('0x5')](function(_0x945b2c){if(_0x945b2c[_0x47ef('0x6')]){return _0x11356f(_0x945b2c['error']['message']);}else{return _0x109a6a(_0x945b2c[_0x47ef('0x7')]);}})[_0x47ef('0x8')](function(_0x27e2ec){return _0x11356f(_0x27e2ec);});});}exports[_0x47ef('0x9')]=function(_0x1f08a4,_0x202d3b,_0x3fbcbd){return function(_0x2c0c96){if(_0x3fbcbd['rules']&&!_0x3fbcbd['rules'][_0x1f08a4]){logger[_0x47ef('0xa')](_0x47ef('0xb'),_0x1f08a4);return _0x2c0c96[_0x47ef('0xc')]();}var _0x22e529=[];for(var _0x6092bc=0x0;_0x6092bc<_0x202d3b[_0x47ef('0xd')];_0x6092bc+=0x1){_0x22e529['push'](request(_0x47ef('0xe'),{'command':util[_0x47ef('0xf')](_0x47ef('0x10'),_0x202d3b[_0x6092bc])})['then'](function(_0x2868ec){return _0x2868ec&&_0x2868ec['message']&&_0x2868ec[_0x47ef('0x11')][_0x47ef('0x12')](_0x47ef('0x13'))>=0x0?!![]:![];})[_0x47ef('0x8')](function(_0x4680c8){logger[_0x47ef('0x6')](_0x47ef('0x14'),_0x1f08a4,_0x202d3b[_0x6092bc]);}));}BPromise[_0x47ef('0x15')](_0x22e529)[_0x47ef('0x5')](function(_0x434f47){var _0x47d8aa=_[_0x47ef('0x16')](_0x434f47);logger['info'](_0x47ef('0x17'),_0x1f08a4,_0x202d3b[_0x47ef('0x18')](_0x47ef('0x19')),_0x47d8aa);_0x2c0c96[_0x47ef('0x1a')](_0x47d8aa);})['catch'](function(_0x70eb4c){console[_0x47ef('0x1b')](_0x70eb4c);logger[_0x47ef('0x6')](_0x47ef('0x17'),_0x1f08a4,_0x202d3b[_0x47ef('0x18')](_0x47ef('0x19')),_0x70eb4c[_0x47ef('0x1c')]);_0x2c0c96[_0x47ef('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 84386bc..bc166d8 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 _0x6f7a=['indexOf','splice','agent','complete','diffTime','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','called','connectedlinename','error','agentringnoanswer','agentringnoanswerAt','reason','timeout','holdtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','agentcomplete','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x178889,_0x4426f1){_0x178889=_0x178889-0x0;var _0x3ba07e=_0x6f7a[_0x178889];return _0x3ba07e;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var utils=require(_0xa6f7('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x982062,_0x4dd99d){utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')](_0xa6f7('0x5'),_0x982062[_0xa6f7('0x6')],_0x982062[_0xa6f7('0x7')],_0x982062[_0xa6f7('0x8')],_0x982062[_0xa6f7('0x9')],_0x982062[_0xa6f7('0xa')],_0x982062[_0xa6f7('0xb')],_0x982062[_0xa6f7('0xc')],_0x982062[_0xa6f7('0xd')]));if(_0x982062['queue']){utils['getVoiceQueueByName'](_0x982062[_0xa6f7('0x8')])[_0xa6f7('0xe')](function(_0x397020){if(_0x397020){_0x982062[_0xa6f7('0xf')]=_0x397020[_0xa6f7('0xf')];_0x982062['agentacw']=_0x982062['agentcomplete']?_0x397020[_0xa6f7('0x10')]:![];_0x982062[_0xa6f7('0x11')]=_0x982062['agentacw']?_0x397020[_0xa6f7('0x12')]:0x0;}utils['request'](_0xa6f7('0x13'),_0x982062);});}else{utils[_0xa6f7('0x14')](_0xa6f7('0x13'),_0x982062);}if(_0x4dd99d){delete transfers[_0x982062[_0xa6f7('0x6')]];}else{delete agents[_0x982062['destuniqueid']];}}exports[_0xa6f7('0x15')]=function(_0x532352){try{utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')](_0xa6f7('0x17'),_0x532352['uniqueid']),_0x532352);agents[_0x532352[_0xa6f7('0x18')]]=_0x532352;agents[_0x532352['destuniqueid']][_0xa6f7('0x19')]=utils['now']();agents[_0x532352[_0xa6f7('0x18')]][_0xa6f7('0xd')]=_0xa6f7('0x1a');agents[_0x532352['destuniqueid']][_0xa6f7('0xc')]=null;agents[_0x532352[_0xa6f7('0x18')]][_0xa6f7('0x1b')]=null;utils[_0xa6f7('0x3')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x532352[_0xa6f7('0x6')],agents[_0x532352['destuniqueid']][_0xa6f7('0x9')],_0x532352[_0xa6f7('0x18')]));}catch(_0x5d16d0){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x17'),_0x532352[_0xa6f7('0x6')]),_0x5d16d0);}};exports[_0xa6f7('0x1d')]=function(_0x1aa8dc){try{if(!_['isNil'](agents[_0x1aa8dc[_0xa6f7('0x18')]])){utils[_0xa6f7('0x16')](util['format']('[%s][agents][agentringnoanswer]',_0x1aa8dc['uniqueid']),_0x1aa8dc);utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x1aa8dc['uniqueid'],agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0x9')],_0x1aa8dc[_0xa6f7('0x18')]));agents[_0x1aa8dc[_0xa6f7('0x18')]]['agentringnoanswer']=!![];agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0x1e')]=utils['now']();agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0xd')]='timeout';agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x1f')]=_0xa6f7('0x20');agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x21')]=_0x1aa8dc['ringtime']?parseInt(_0x1aa8dc['ringtime'])/0x3e8:0x0;agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x22')]=0x0;unanswered['push'](_0x1aa8dc[_0xa6f7('0x18')]);}}catch(_0x27babb){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x23'),_0x1aa8dc[_0xa6f7('0x6')]),_0x27babb);}};exports[_0xa6f7('0x24')]=function(_0x54f72c){try{_[_0xa6f7('0x25')](agents,function(_0x3dee2e,_0x40b0f8){if(_0x3dee2e[_0xa6f7('0x6')]==_0x54f72c['uniqueid']&&!_[_0xa6f7('0x26')](unanswered,_0x3dee2e[_0xa6f7('0x18')])){utils['debug'](util[_0xa6f7('0x4')](_0xa6f7('0x27'),_0x54f72c['uniqueid']),_0x54f72c);utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x28'),_0x54f72c[_0xa6f7('0x6')],_0x3dee2e[_0xa6f7('0x9')],_0x3dee2e[_0xa6f7('0x18')]));_0x3dee2e['agentringnoanswer']=!![];_0x3dee2e['agentringnoanswerAt']=utils[_0xa6f7('0x29')]();_0x3dee2e['lastevent']=_0xa6f7('0x2a');_0x3dee2e[_0xa6f7('0x1f')]=_0xa6f7('0x2a');_0x3dee2e[_0xa6f7('0x21')]=_0x54f72c[_0xa6f7('0x21')];_0x3dee2e[_0xa6f7('0x22')]=0x0;writeDB(_0x3dee2e);}});}catch(_0x4d2d38){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x27'),_0x54f72c['uniqueid']),_0x4d2d38);}};exports[_0xa6f7('0x2b')]=function(_0x5ab03d){try{if(agents[_0x5ab03d[_0xa6f7('0x18')]]){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][agentconnect]',_0x5ab03d[_0xa6f7('0x6')]),_0x5ab03d);utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')](_0xa6f7('0x2c'),_0x5ab03d[_0xa6f7('0x6')],agents[_0x5ab03d[_0xa6f7('0x18')]]['membername'],_0x5ab03d[_0xa6f7('0x18')]));agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0x2d')]=utils[_0xa6f7('0x29')]();agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0xc')]=_0x5ab03d[_0xa6f7('0xc')];agents[_0x5ab03d[_0xa6f7('0x18')]]['connectedlinename']=_0x5ab03d[_0xa6f7('0x1b')];agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0x21')]=_0x5ab03d['ringtime'];agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0xd')]='connect';_[_0xa6f7('0x25')](agents,function(_0x13c7c4,_0x3ecb88){if(_0x13c7c4[_0xa6f7('0x18')]!=_0x5ab03d[_0xa6f7('0x18')]&&_0x13c7c4['uniqueid']==_0x5ab03d[_0xa6f7('0x6')]){_0x13c7c4[_0xa6f7('0x22')]=0x0;_0x13c7c4[_0xa6f7('0x21')]=_0x5ab03d[_0xa6f7('0x2e')];_0x13c7c4[_0xa6f7('0x1d')]=!![];_0x13c7c4[_0xa6f7('0x1e')]=utils[_0xa6f7('0x29')]();_0x13c7c4[_0xa6f7('0xd')]='answered_elsewhere';_0x13c7c4['reason']=_0xa6f7('0x2f');_0x13c7c4[_0xa6f7('0x30')]=_0x5ab03d[_0xa6f7('0x18')];_0x13c7c4[_0xa6f7('0x31')]=_0x5ab03d[_0xa6f7('0x9')];writeDB(_0x13c7c4);}});}}catch(_0x387714){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x32'),_0x5ab03d[_0xa6f7('0x6')]),_0x387714);}};exports['agentcomplete']=function(_0x41917c){try{if(!_[_0xa6f7('0x33')](agents[_0x41917c['destuniqueid']])){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')](_0xa6f7('0x34'),_0x41917c[_0xa6f7('0x6')]),_0x41917c);utils['info'](util[_0xa6f7('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x41917c['uniqueid'],agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x9')],_0x41917c[_0xa6f7('0x18')]));agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x35')]=!![];agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x36')]=utils['now']();agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x22')]=utils['diffTime'](agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x36')],agents[_0x41917c[_0xa6f7('0x18')]]['agentconnectAt']);agents[_0x41917c[_0xa6f7('0x18')]]['reason']=_0x41917c[_0xa6f7('0x1f')];agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0xd')]='complete';writeDB(agents[_0x41917c['destuniqueid']]);}}catch(_0x2b06b5){utils['error'](util[_0xa6f7('0x4')]('[%s][agents][agentcomplete]',_0x41917c['uniqueid']),_0x2b06b5);}};exports[_0xa6f7('0x37')]=function(_0x2e3a04){try{if(!_[_0xa6f7('0x33')](agents[_0x2e3a04[_0xa6f7('0x38')]])){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][blindtransfer]',_0x2e3a04[_0xa6f7('0x6')]),_0x2e3a04);utils[_0xa6f7('0x3')](util['format'](_0xa6f7('0x39'),_0x2e3a04['uniqueid'],agents[_0x2e3a04[_0xa6f7('0x38')]]['membername'],agents[_0x2e3a04['transfereruniqueid']][_0xa6f7('0x6')]));agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3a')]=!![];agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3b')]='blind';agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3c')]=_0x2e3a04['extension'];agents[_0x2e3a04[_0xa6f7('0x38')]]['transferuniqueid']=agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x6')];}}catch(_0x134dd7){utils['error'](util[_0xa6f7('0x4')]('[%s][agents][blindtransfer]',_0x2e3a04[_0xa6f7('0x6')]),_0x134dd7);}};exports[_0xa6f7('0x3d')]=function(_0x236372){try{utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][attendedtransfer]',_0x236372['origtransfereruniqueid']),_0x236372);if(_0x236372[_0xa6f7('0x3e')]==_0x236372[_0xa6f7('0x3f')]){if(!_[_0xa6f7('0x33')](agents[_0x236372[_0xa6f7('0x40')]])){utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x41'),_0x236372[_0xa6f7('0x3e')],agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x9')]));agents[_0x236372[_0xa6f7('0x40')]]['transfer']=!![];agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x3b')]=_0xa6f7('0x42');agents[_0x236372['secondtransfereruniqueid']][_0xa6f7('0x3c')]=_0x236372[_0xa6f7('0x43')];agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x44')]=_0x236372['origtransfereruniqueid'];}if(_0x236372['transfereeuniqueid']&&agents[_0x236372[_0xa6f7('0x45')]]){agents[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x46')]=0x1;transfers[_0x236372[_0xa6f7('0x45')]]=_[_0xa6f7('0x47')](agents[_0x236372[_0xa6f7('0x45')]]);transfers[_0x236372[_0xa6f7('0x45')]]['calleridnum']=agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0xb')];transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x48')]=agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x48')];transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x19')]=utils[_0xa6f7('0x29')]();transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x2d')]=utils['now']();transfers[_0x236372[_0xa6f7('0x45')]]['holdtime']=0x0;transfers[_0x236372[_0xa6f7('0x45')]]['agententerreason']=0x2;}}else if(_0x236372[_0xa6f7('0x40')]==_0x236372[_0xa6f7('0x49')]){if(!_['isNil'](agents[_0x236372[_0xa6f7('0x3e')]])){utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x236372[_0xa6f7('0x3e')],agents[_0x236372['origtransfereruniqueid']][_0xa6f7('0x9')]));agents[_0x236372[_0xa6f7('0x3e')]]['transfer']=!![];agents[_0x236372[_0xa6f7('0x3e')]]['transfertype']=_0xa6f7('0x42');agents[_0x236372['origtransfereruniqueid']][_0xa6f7('0x3c')]=_0x236372[_0xa6f7('0x4a')];agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0x44')]=_0x236372[_0xa6f7('0x40')];}if(_0x236372[_0xa6f7('0x4b')]&&agents[_0x236372[_0xa6f7('0x4b')]]){agents[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x46')]=0x1;transfers[_0x236372[_0xa6f7('0x4b')]]=_[_0xa6f7('0x47')](agents[_0x236372[_0xa6f7('0x4b')]]);transfers[_0x236372['transfertargetuniqueid']][_0xa6f7('0xb')]=agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0xb')];transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x48')]=agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0x48')];transfers[_0x236372[_0xa6f7('0x4b')]]['agentcalledAt']=utils[_0xa6f7('0x29')]();transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x2d')]=utils['now']();transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x21')]=0x0;transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x46')]=0x2;}}}catch(_0x1a1055){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x4c'),_0x236372['origtransfereruniqueid']),_0x1a1055);}};exports['hangup']=function(_0x265194){try{utils[_0xa6f7('0x16')](util['format'](_0xa6f7('0x4d'),_0x265194[_0xa6f7('0x6')]),_0x265194);if(agents[_0x265194[_0xa6f7('0x6')]]&&agents[_0x265194['uniqueid']][_0xa6f7('0x1f')]==='timeout'){if(_0x265194['cause']==='21'){agents[_0x265194['uniqueid']]['reason']='rejected';agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]=_0xa6f7('0x4e');}utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x4f'),_0x265194[_0xa6f7('0x6')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]));writeDB(agents[_0x265194[_0xa6f7('0x6')]]);var _0x55ad6b=unanswered[_0xa6f7('0x50')](_0x265194[_0xa6f7('0x6')]);if(_0x55ad6b>-0x1){unanswered[_0xa6f7('0x51')](_0x55ad6b,0x1);}}if(transfers[_0x265194[_0xa6f7('0x6')]]){transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x35')]=!![];transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x36')]=utils[_0xa6f7('0x29')]();transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x22')]=utils['diffTime'](transfers[_0x265194['uniqueid']][_0xa6f7('0x36')],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]);transfers[_0x265194['uniqueid']][_0xa6f7('0x1f')]=_0xa6f7('0x52');transfers[_0x265194['uniqueid']][_0xa6f7('0xd')]=_0xa6f7('0x53');utils['info'](util['format'](_0xa6f7('0x4f'),_0x265194['uniqueid'],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],transfers[_0x265194['uniqueid']]['reason'],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]));writeDB(transfers[_0x265194[_0xa6f7('0x6')]],!![]);}if(agents[_0x265194['uniqueid']]&&agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]){agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x35')]=!![];agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x36')]=utils[_0xa6f7('0x29')]();agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x22')]=utils[_0xa6f7('0x54')](agents[_0x265194[_0xa6f7('0x6')]]['agentcompleteAt'],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]);agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')]=agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x3a')]?'transfer':_0xa6f7('0x52');agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]=_0xa6f7('0x53');utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x265194['uniqueid'],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')],agents[_0x265194[_0xa6f7('0x6')]]['lastevent']));writeDB(agents[_0x265194[_0xa6f7('0x6')]]);}}catch(_0x4c7383){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')]('[%s][agents][hangup]',_0x265194['uniqueid']),_0x4c7383);}}; \ No newline at end of file +var _0x44a3=['agentacw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','uniqueid','destuniqueid','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','forIn','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','then','type','agentcomplete','acw'];(function(_0x26a9ad,_0x11a04f){var _0x31d9bc=function(_0x44a770){while(--_0x44a770){_0x26a9ad['push'](_0x26a9ad['shift']());}};_0x31d9bc(++_0x11a04f);}(_0x44a3,0x1a9));var _0x344a=function(_0x53361f,_0x3b2cb6){_0x53361f=_0x53361f-0x0;var _0x279237=_0x44a3[_0x53361f];return _0x279237;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var utils=require(_0x344a('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x23cef2,_0xdffe0b){utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x5'),_0x23cef2['uniqueid'],_0x23cef2[_0x344a('0x6')],_0x23cef2[_0x344a('0x7')],_0x23cef2[_0x344a('0x8')],_0x23cef2[_0x344a('0x9')],_0x23cef2[_0x344a('0xa')],_0x23cef2['connectedlinenum'],_0x23cef2['lastevent']));if(_0x23cef2['queue']){utils['getVoiceQueueByName'](_0x23cef2[_0x344a('0x7')])[_0x344a('0xb')](function(_0x3c725e){if(_0x3c725e){_0x23cef2[_0x344a('0xc')]=_0x3c725e[_0x344a('0xc')];_0x23cef2['agentacw']=_0x23cef2[_0x344a('0xd')]?_0x3c725e[_0x344a('0xe')]:![];_0x23cef2['acwtime']=_0x23cef2[_0x344a('0xf')]?_0x3c725e['acwTimeout']:0x0;}utils[_0x344a('0x10')]('CreateVoiceAgentReport',_0x23cef2);});}else{utils[_0x344a('0x10')](_0x344a('0x11'),_0x23cef2);}if(_0xdffe0b){delete transfers[_0x23cef2['uniqueid']];}else{delete agents[_0x23cef2['destuniqueid']];}}exports[_0x344a('0x12')]=function(_0x2ad7eb){try{utils[_0x344a('0x13')](util[_0x344a('0x4')](_0x344a('0x14'),_0x2ad7eb[_0x344a('0x15')]),_0x2ad7eb);agents[_0x2ad7eb['destuniqueid']]=_0x2ad7eb;agents[_0x2ad7eb[_0x344a('0x16')]][_0x344a('0x17')]=utils[_0x344a('0x18')]();agents[_0x2ad7eb[_0x344a('0x16')]]['lastevent']='called';agents[_0x2ad7eb[_0x344a('0x16')]][_0x344a('0x19')]=null;agents[_0x2ad7eb[_0x344a('0x16')]][_0x344a('0x1a')]=null;utils['info'](util[_0x344a('0x4')](_0x344a('0x1b'),_0x2ad7eb['uniqueid'],agents[_0x2ad7eb[_0x344a('0x16')]][_0x344a('0x8')],_0x2ad7eb[_0x344a('0x16')]));}catch(_0x45a827){utils[_0x344a('0x1c')](util[_0x344a('0x4')](_0x344a('0x14'),_0x2ad7eb[_0x344a('0x15')]),_0x45a827);}};exports[_0x344a('0x1d')]=function(_0x450922){try{if(!_['isNil'](agents[_0x450922[_0x344a('0x16')]])){utils[_0x344a('0x13')](util[_0x344a('0x4')](_0x344a('0x1e'),_0x450922[_0x344a('0x15')]),_0x450922);utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x1f'),_0x450922[_0x344a('0x15')],agents[_0x450922[_0x344a('0x16')]][_0x344a('0x8')],_0x450922[_0x344a('0x16')]));agents[_0x450922[_0x344a('0x16')]][_0x344a('0x1d')]=!![];agents[_0x450922['destuniqueid']][_0x344a('0x20')]=utils['now']();agents[_0x450922[_0x344a('0x16')]]['lastevent']=_0x344a('0x21');agents[_0x450922[_0x344a('0x16')]][_0x344a('0x22')]=_0x344a('0x21');agents[_0x450922[_0x344a('0x16')]][_0x344a('0x23')]=_0x450922[_0x344a('0x24')]?parseInt(_0x450922[_0x344a('0x24')])/0x3e8:0x0;agents[_0x450922['destuniqueid']][_0x344a('0x25')]=0x0;unanswered[_0x344a('0x26')](_0x450922[_0x344a('0x16')]);}}catch(_0xc02d6){utils[_0x344a('0x1c')](util[_0x344a('0x4')]('[%s][agents][agentringnoanswer]',_0x450922[_0x344a('0x15')]),_0xc02d6);}};exports['queuecallerabandon']=function(_0x593cf6){try{_[_0x344a('0x27')](agents,function(_0x14fa86,_0x5a36bb){if(_0x14fa86['uniqueid']==_0x593cf6['uniqueid']&&!_['includes'](unanswered,_0x14fa86[_0x344a('0x16')])){utils[_0x344a('0x13')](util[_0x344a('0x4')]('[%s][agents][queuecallerabandon]',_0x593cf6[_0x344a('0x15')]),_0x593cf6);utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x28'),_0x593cf6[_0x344a('0x15')],_0x14fa86[_0x344a('0x8')],_0x14fa86[_0x344a('0x16')]));_0x14fa86['agentringnoanswer']=!![];_0x14fa86[_0x344a('0x20')]=utils['now']();_0x14fa86['lastevent']='abandoned';_0x14fa86[_0x344a('0x22')]=_0x344a('0x29');_0x14fa86[_0x344a('0x23')]=_0x593cf6[_0x344a('0x23')];_0x14fa86[_0x344a('0x25')]=0x0;writeDB(_0x14fa86);}});}catch(_0xdf6a8f){utils['error'](util[_0x344a('0x4')](_0x344a('0x2a'),_0x593cf6[_0x344a('0x15')]),_0xdf6a8f);}};exports['agentconnect']=function(_0x3698eb){try{if(agents[_0x3698eb[_0x344a('0x16')]]){utils[_0x344a('0x13')](util[_0x344a('0x4')](_0x344a('0x2b'),_0x3698eb['uniqueid']),_0x3698eb);utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x2c'),_0x3698eb[_0x344a('0x15')],agents[_0x3698eb[_0x344a('0x16')]]['membername'],_0x3698eb[_0x344a('0x16')]));agents[_0x3698eb[_0x344a('0x16')]][_0x344a('0x2d')]=utils[_0x344a('0x18')]();agents[_0x3698eb[_0x344a('0x16')]]['connectedlinenum']=_0x3698eb[_0x344a('0x19')];agents[_0x3698eb[_0x344a('0x16')]][_0x344a('0x1a')]=_0x3698eb[_0x344a('0x1a')];agents[_0x3698eb[_0x344a('0x16')]][_0x344a('0x23')]=_0x3698eb[_0x344a('0x24')];agents[_0x3698eb[_0x344a('0x16')]]['lastevent']=_0x344a('0x2e');_[_0x344a('0x27')](agents,function(_0x3d34c3,_0x28bad9){if(_0x3d34c3[_0x344a('0x16')]!=_0x3698eb['destuniqueid']&&_0x3d34c3[_0x344a('0x15')]==_0x3698eb[_0x344a('0x15')]){_0x3d34c3[_0x344a('0x25')]=0x0;_0x3d34c3[_0x344a('0x23')]=_0x3698eb[_0x344a('0x24')];_0x3d34c3[_0x344a('0x1d')]=!![];_0x3d34c3[_0x344a('0x20')]=utils[_0x344a('0x18')]();_0x3d34c3[_0x344a('0x2f')]='answered_elsewhere';_0x3d34c3[_0x344a('0x22')]=_0x344a('0x30');_0x3d34c3[_0x344a('0x31')]=_0x3698eb[_0x344a('0x16')];_0x3d34c3['answeredelsewheremembername']=_0x3698eb[_0x344a('0x8')];writeDB(_0x3d34c3);}});}}catch(_0x3069ca){utils[_0x344a('0x1c')](util[_0x344a('0x4')](_0x344a('0x2b'),_0x3698eb[_0x344a('0x15')]),_0x3069ca);}};exports[_0x344a('0xd')]=function(_0x372e7d){try{if(!_[_0x344a('0x32')](agents[_0x372e7d[_0x344a('0x16')]])){utils[_0x344a('0x13')](util['format'](_0x344a('0x33'),_0x372e7d[_0x344a('0x15')]),_0x372e7d);utils['info'](util[_0x344a('0x4')](_0x344a('0x34'),_0x372e7d['uniqueid'],agents[_0x372e7d[_0x344a('0x16')]][_0x344a('0x8')],_0x372e7d['destuniqueid']));agents[_0x372e7d[_0x344a('0x16')]][_0x344a('0xd')]=!![];agents[_0x372e7d[_0x344a('0x16')]]['agentcompleteAt']=utils[_0x344a('0x18')]();agents[_0x372e7d['destuniqueid']][_0x344a('0x25')]=utils[_0x344a('0x35')](agents[_0x372e7d[_0x344a('0x16')]][_0x344a('0x36')],agents[_0x372e7d['destuniqueid']]['agentconnectAt']);agents[_0x372e7d[_0x344a('0x16')]][_0x344a('0x22')]=_0x372e7d[_0x344a('0x22')];agents[_0x372e7d[_0x344a('0x16')]][_0x344a('0x2f')]=_0x344a('0x37');writeDB(agents[_0x372e7d[_0x344a('0x16')]]);}}catch(_0x23c214){utils[_0x344a('0x1c')](util[_0x344a('0x4')]('[%s][agents][agentcomplete]',_0x372e7d[_0x344a('0x15')]),_0x23c214);}};exports[_0x344a('0x38')]=function(_0x6fad37){try{if(!_[_0x344a('0x32')](agents[_0x6fad37['transfereruniqueid']])){utils[_0x344a('0x13')](util['format']('[%s][agents][blindtransfer]',_0x6fad37[_0x344a('0x15')]),_0x6fad37);utils[_0x344a('0x3')](util['format'](_0x344a('0x39'),_0x6fad37[_0x344a('0x15')],agents[_0x6fad37[_0x344a('0x3a')]][_0x344a('0x8')],agents[_0x6fad37['transfereruniqueid']][_0x344a('0x15')]));agents[_0x6fad37[_0x344a('0x3a')]][_0x344a('0x3b')]=!![];agents[_0x6fad37[_0x344a('0x3a')]][_0x344a('0x3c')]=_0x344a('0x3d');agents[_0x6fad37[_0x344a('0x3a')]][_0x344a('0x3e')]=_0x6fad37[_0x344a('0x3f')];agents[_0x6fad37[_0x344a('0x3a')]]['transferuniqueid']=agents[_0x6fad37[_0x344a('0x3a')]]['uniqueid'];}}catch(_0x1b7f6c){utils[_0x344a('0x1c')](util[_0x344a('0x4')]('[%s][agents][blindtransfer]',_0x6fad37[_0x344a('0x15')]),_0x1b7f6c);}};exports[_0x344a('0x40')]=function(_0x188c6b){try{utils[_0x344a('0x13')](util[_0x344a('0x4')](_0x344a('0x41'),_0x188c6b[_0x344a('0x42')]),_0x188c6b);if(_0x188c6b[_0x344a('0x42')]==_0x188c6b[_0x344a('0x43')]){if(!_['isNil'](agents[_0x188c6b[_0x344a('0x44')]])){utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x45'),_0x188c6b[_0x344a('0x42')],agents[_0x188c6b['secondtransfereruniqueid']][_0x344a('0x8')]));agents[_0x188c6b[_0x344a('0x44')]][_0x344a('0x3b')]=!![];agents[_0x188c6b[_0x344a('0x44')]]['transfertype']=_0x344a('0x46');agents[_0x188c6b[_0x344a('0x44')]]['transferexten']=_0x188c6b[_0x344a('0x47')];agents[_0x188c6b[_0x344a('0x44')]][_0x344a('0x48')]=_0x188c6b[_0x344a('0x42')];}if(_0x188c6b[_0x344a('0x49')]&&agents[_0x188c6b[_0x344a('0x49')]]){agents[_0x188c6b[_0x344a('0x49')]]['agententerreason']=0x1;transfers[_0x188c6b['transfereeuniqueid']]=_['clone'](agents[_0x188c6b[_0x344a('0x49')]]);transfers[_0x188c6b[_0x344a('0x49')]][_0x344a('0xa')]=agents[_0x188c6b[_0x344a('0x44')]]['calleridnum'];transfers[_0x188c6b[_0x344a('0x49')]]['calleridname']=agents[_0x188c6b['secondtransfereruniqueid']]['calleridname'];transfers[_0x188c6b['transfereeuniqueid']][_0x344a('0x17')]=utils[_0x344a('0x18')]();transfers[_0x188c6b[_0x344a('0x49')]][_0x344a('0x2d')]=utils['now']();transfers[_0x188c6b['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x188c6b[_0x344a('0x49')]][_0x344a('0x4a')]=0x2;}}else if(_0x188c6b[_0x344a('0x44')]==_0x188c6b[_0x344a('0x4b')]){if(!_[_0x344a('0x32')](agents[_0x188c6b['origtransfereruniqueid']])){utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x45'),_0x188c6b['origtransfereruniqueid'],agents[_0x188c6b[_0x344a('0x42')]]['membername']));agents[_0x188c6b['origtransfereruniqueid']][_0x344a('0x3b')]=!![];agents[_0x188c6b['origtransfereruniqueid']]['transfertype']=_0x344a('0x46');agents[_0x188c6b[_0x344a('0x42')]]['transferexten']=_0x188c6b[_0x344a('0x4c')];agents[_0x188c6b['origtransfereruniqueid']][_0x344a('0x48')]=_0x188c6b[_0x344a('0x44')];}if(_0x188c6b[_0x344a('0x4d')]&&agents[_0x188c6b['transfertargetuniqueid']]){agents[_0x188c6b['transfertargetuniqueid']][_0x344a('0x4a')]=0x1;transfers[_0x188c6b[_0x344a('0x4d')]]=_[_0x344a('0x4e')](agents[_0x188c6b[_0x344a('0x4d')]]);transfers[_0x188c6b['transfertargetuniqueid']]['calleridnum']=agents[_0x188c6b[_0x344a('0x42')]][_0x344a('0xa')];transfers[_0x188c6b[_0x344a('0x4d')]]['calleridname']=agents[_0x188c6b[_0x344a('0x42')]][_0x344a('0x4f')];transfers[_0x188c6b['transfertargetuniqueid']][_0x344a('0x17')]=utils['now']();transfers[_0x188c6b[_0x344a('0x4d')]]['agentconnectAt']=utils['now']();transfers[_0x188c6b['transfertargetuniqueid']][_0x344a('0x23')]=0x0;transfers[_0x188c6b[_0x344a('0x4d')]][_0x344a('0x4a')]=0x2;}}}catch(_0xce0446){utils[_0x344a('0x1c')](util[_0x344a('0x4')]('[%s][agents][attendedtransfer]',_0x188c6b[_0x344a('0x42')]),_0xce0446);}};exports[_0x344a('0x50')]=function(_0x20a892){try{utils[_0x344a('0x13')](util[_0x344a('0x4')]('[%s][agents][hangup]',_0x20a892[_0x344a('0x15')]),_0x20a892);if(agents[_0x20a892[_0x344a('0x15')]]&&agents[_0x20a892['uniqueid']][_0x344a('0x22')]===_0x344a('0x21')){if(_0x20a892[_0x344a('0x51')]==='21'){agents[_0x20a892[_0x344a('0x15')]]['reason']=_0x344a('0x52');agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x2f')]=_0x344a('0x52');}utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x53'),_0x20a892[_0x344a('0x15')],agents[_0x20a892['uniqueid']][_0x344a('0x8')],agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x22')],agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x2f')]));writeDB(agents[_0x20a892[_0x344a('0x15')]]);var _0x212b08=unanswered[_0x344a('0x54')](_0x20a892['uniqueid']);if(_0x212b08>-0x1){unanswered[_0x344a('0x55')](_0x212b08,0x1);}}if(transfers[_0x20a892[_0x344a('0x15')]]){transfers[_0x20a892[_0x344a('0x15')]][_0x344a('0xd')]=!![];transfers[_0x20a892['uniqueid']][_0x344a('0x36')]=utils[_0x344a('0x18')]();transfers[_0x20a892[_0x344a('0x15')]][_0x344a('0x25')]=utils[_0x344a('0x35')](transfers[_0x20a892[_0x344a('0x15')]][_0x344a('0x36')],transfers[_0x20a892[_0x344a('0x15')]]['agentconnectAt']);transfers[_0x20a892[_0x344a('0x15')]][_0x344a('0x22')]=_0x344a('0x56');transfers[_0x20a892[_0x344a('0x15')]]['lastevent']=_0x344a('0x37');utils[_0x344a('0x3')](util[_0x344a('0x4')](_0x344a('0x53'),_0x20a892[_0x344a('0x15')],transfers[_0x20a892[_0x344a('0x15')]]['membername'],transfers[_0x20a892[_0x344a('0x15')]][_0x344a('0x22')],transfers[_0x20a892[_0x344a('0x15')]]['lastevent']));writeDB(transfers[_0x20a892[_0x344a('0x15')]],!![]);}if(agents[_0x20a892[_0x344a('0x15')]]&&agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x2d')]){agents[_0x20a892[_0x344a('0x15')]]['agentcomplete']=!![];agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x36')]=utils[_0x344a('0x18')]();agents[_0x20a892['uniqueid']][_0x344a('0x25')]=utils['diffTime'](agents[_0x20a892['uniqueid']][_0x344a('0x36')],agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x2d')]);agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x22')]=agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x3b')]?_0x344a('0x3b'):'agent';agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x2f')]='complete';utils['info'](util[_0x344a('0x4')](_0x344a('0x53'),_0x20a892[_0x344a('0x15')],agents[_0x20a892[_0x344a('0x15')]]['membername'],agents[_0x20a892[_0x344a('0x15')]][_0x344a('0x22')],agents[_0x20a892[_0x344a('0x15')]]['lastevent']));writeDB(agents[_0x20a892[_0x344a('0x15')]]);}}catch(_0x1c50c3){utils[_0x344a('0x1c')](util['format'](_0x344a('0x57'),_0x20a892[_0x344a('0x15')]),_0x1c50c3);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index dba80a7..0abe43e 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 _0x044a=['variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','appdata','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','DOCUMENTATION','error','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','toNumber','ANSWERED','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','duration','diffTime','starttime','billableseconds','endtime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','_attended','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]'];(function(_0x5f4192,_0x4ed539){var _0x21ee5c=function(_0x5c9061){while(--_0x5c9061){_0x5f4192['push'](_0x5f4192['shift']());}};_0x21ee5c(++_0x4ed539);}(_0x044a,0x173));var _0xa044=function(_0x4e5cad,_0x2e96f0){_0x4e5cad=_0x4e5cad-0x0;var _0x421183=_0x044a[_0x4e5cad];return _0x421183;};'use strict';var _=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var utils=require(_0xa044('0x2'));var transfers=require(_0xa044('0x3'));var dispositions=[_0xa044('0x4'),_0xa044('0x5'),_0xa044('0x5'),_0xa044('0x4'),_0xa044('0x4'),_0xa044('0x4'),'ANSWERED',_0xa044('0x6'),_0xa044('0x5'),_0xa044('0x5'),_0xa044('0x5')];var channels={};function writeDB(_0x59b81b){var _0xe12f7d;if(transfers[_0xa044('0x7')][_0x59b81b[_0xa044('0x8')]]){_0xe12f7d=_0x59b81b[_0xa044('0x8')];_0x59b81b['uniqueid']=transfers[_0xa044('0x7')][_0x59b81b[_0xa044('0x8')]][_0xa044('0x9')];}utils['info'](util[_0xa044('0xa')](_0xa044('0xb'),_0x59b81b[_0xa044('0x8')],_0x59b81b[_0xa044('0xc')],_0x59b81b['queue'],_0x59b81b[_0xa044('0xd')],_0x59b81b['interface'],_0x59b81b['calleridnum'],_0x59b81b[_0xa044('0xe')],_0x59b81b[_0xa044('0xf')]));if(_0x59b81b[_0xa044('0x10')]){utils[_0xa044('0x11')](_0x59b81b[_0xa044('0x10')])[_0xa044('0x12')](function(_0xe9a838){if(_0xe9a838){_0x59b81b['UserId']=_0xe9a838['id'];}utils[_0xa044('0x13')]('CreateVoiceCallReport',_0x59b81b);});}else{utils[_0xa044('0x13')](_0xa044('0x14'),_0x59b81b);}if(channels[_0x59b81b[_0xa044('0x8')]]){delete channels[_0x59b81b[_0xa044('0x8')]];}else if(_0xe12f7d&&channels[_0xe12f7d]){if(!transfers[_0xa044('0x7')][_0xe12f7d]['recording'])delete transfers['blinds'][_0xe12f7d];delete channels[_0xe12f7d];}}exports[_0xa044('0x15')]=function(_0x4a5bba){try{utils[_0xa044('0x16')](util[_0xa044('0xa')](_0xa044('0x17'),_0x4a5bba[_0xa044('0x8')]),_0x4a5bba);if(_0x4a5bba[_0xa044('0x8')]==_0x4a5bba['linkedid']&&_0x4a5bba['channel']!='OutgoingSpoolFailed'){utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x19'),_0x4a5bba['uniqueid'],_0x4a5bba[_0xa044('0x1a')],_0x4a5bba[_0xa044('0x1b')]));channels[_0x4a5bba['uniqueid']]={'uniqueid':_0x4a5bba[_0xa044('0x8')],'accountcode':_0x4a5bba[_0xa044('0x10')],'source':_0x4a5bba[_0xa044('0x1c')],'destination':_0x4a5bba['exten'],'destinationcontext':_0x4a5bba[_0xa044('0x1a')],'channel':_0x4a5bba[_0xa044('0xc')],'starttime':utils[_0xa044('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa044('0x4'),'amaflags':_0xa044('0x1e')};}}catch(_0x3f4d03){utils[_0xa044('0x1f')](util[_0xa044('0xa')](_0xa044('0x17'),_0x4a5bba['uniqueid']),_0x3f4d03);}};exports['newstate']=function(_0x311e76){try{utils[_0xa044('0x16')](util[_0xa044('0xa')]('[%s][calls][newstate]',_0x311e76[_0xa044('0x8')]),_0x311e76);if(!_[_0xa044('0x20')](channels[_0x311e76['uniqueid']])&&_0x311e76[_0xa044('0x21')]==0x6){utils[_0xa044('0x18')](util['format'](_0xa044('0x22'),_0x311e76[_0xa044('0x8')],_0x311e76['context'],_0x311e76['channel']));if(_['isNil'](channels[_0x311e76[_0xa044('0x8')]][_0xa044('0x23')])){channels[_0x311e76[_0xa044('0x8')]]['systemanswertime']=utils[_0xa044('0x1d')]();}}else if(!_[_0xa044('0x20')](channels[_0x311e76['linkedid']])&&_0x311e76[_0xa044('0x21')]==0x6&&_0x311e76['context']!='transfer'){utils[_0xa044('0x18')](util['format'](_0xa044('0x24'),_0x311e76[_0xa044('0x8')],_0x311e76[_0xa044('0x25')],_0x311e76[_0xa044('0x1a')],_0x311e76[_0xa044('0xc')]));channels[_0x311e76[_0xa044('0x25')]]['accountcode']=_0x311e76[_0xa044('0x10')];channels[_0x311e76[_0xa044('0x25')]][_0xa044('0x26')]=_0x311e76[_0xa044('0xc')];if(_['isNil'](channels[_0x311e76[_0xa044('0x25')]][_0xa044('0x27')])){channels[_0x311e76['linkedid']]['answertime']=utils[_0xa044('0x1d')]();}channels[_0x311e76[_0xa044('0x25')]]['disposition']=dispositions[_[_0xa044('0x28')](_0x311e76[_0xa044('0x21')])]||_0xa044('0x29');}}catch(_0x56e734){utils[_0xa044('0x1f')](util[_0xa044('0xa')](_0xa044('0x2a'),_0x311e76[_0xa044('0x8')]),_0x56e734);}};exports[_0xa044('0x2b')]=function(_0x51ffa1){try{if(!_[_0xa044('0x20')](channels[_0x51ffa1[_0xa044('0x8')]])){utils[_0xa044('0x16')](util['format'](_0xa044('0x2c'),_0x51ffa1[_0xa044('0x8')]),_0x51ffa1);if(_['isNil'](channels[_0x51ffa1[_0xa044('0x8')]][_0xa044('0x2d')])){channels[_0x51ffa1[_0xa044('0x8')]][_0xa044('0x2d')]=_0x51ffa1[_0xa044('0x2e')]+'\x20<'+_0x51ffa1[_0xa044('0x1c')]+'>';}utils[_0xa044('0x18')](util[_0xa044('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x51ffa1[_0xa044('0x8')],channels[_0x51ffa1[_0xa044('0x8')]][_0xa044('0x2d')],_0x51ffa1[_0xa044('0x2f')]));channels[_0x51ffa1[_0xa044('0x8')]]['endtime']=utils[_0xa044('0x1d')]();channels[_0x51ffa1['uniqueid']][_0xa044('0x30')]=utils[_0xa044('0x31')](channels[_0x51ffa1['uniqueid']]['endtime'],channels[_0x51ffa1['uniqueid']][_0xa044('0x32')]);channels[_0x51ffa1[_0xa044('0x8')]][_0xa044('0x33')]=channels[_0x51ffa1[_0xa044('0x8')]][_0xa044('0x27')]?utils[_0xa044('0x31')](channels[_0x51ffa1[_0xa044('0x8')]][_0xa044('0x34')],channels[_0x51ffa1[_0xa044('0x8')]][_0xa044('0x27')]):0x0;writeDB(channels[_0x51ffa1['uniqueid']]);}}catch(_0x3f3897){utils[_0xa044('0x1f')](util[_0xa044('0xa')](_0xa044('0x2c'),_0x51ffa1[_0xa044('0x8')]),_0x3f3897);}};exports[_0xa044('0x35')]=function(_0x2373ad){try{if(!_[_0xa044('0x20')](channels[_0x2373ad[_0xa044('0x36')]])){utils[_0xa044('0x16')](util['format']('[%s][calls][attendedtransfer]',_0x2373ad[_0xa044('0x37')]),_0x2373ad);if(channels[_0x2373ad['localtwolinkedid']][_0xa044('0xc')]==_0x2373ad[_0xa044('0x38')]){utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x39'),_0x2373ad[_0xa044('0x37')],_0x2373ad['localtwolinkedid'],_0x2373ad[_0xa044('0x3a')]));channels[_0x2373ad['localtwolinkedid']][_0xa044('0x26')]=_0x2373ad[_0xa044('0x3a')];channels[_0x2373ad[_0xa044('0x36')]]['userfield']='_attended';}else if(channels[_0x2373ad[_0xa044('0x36')]][_0xa044('0xc')]=_0x2373ad[_0xa044('0x3b')]){utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x39'),_0x2373ad['origtransfereruniqueid'],_0x2373ad[_0xa044('0x36')],_0x2373ad[_0xa044('0x3c')]));channels[_0x2373ad[_0xa044('0x36')]][_0xa044('0x26')]=_0x2373ad[_0xa044('0x3c')];channels[_0x2373ad[_0xa044('0x36')]][_0xa044('0x3d')]=_0xa044('0x3e');}}}catch(_0xb46587){utils[_0xa044('0x1f')](util[_0xa044('0xa')](_0xa044('0x3f'),_0x2373ad[_0xa044('0x37')]),_0xb46587);}};exports['musiconholdstart']=function(_0x3c12be){try{if(!_[_0xa044('0x20')](channels[_0x3c12be[_0xa044('0x8')]])){utils[_0xa044('0x16')](util[_0xa044('0xa')](_0xa044('0x40'),_0x3c12be[_0xa044('0x8')]),_0x3c12be);channels[_0x3c12be['uniqueid']]['musiconholdstartAt']=utils[_0xa044('0x1d')]();utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x41'),_0x3c12be['uniqueid'],channels[_0x3c12be[_0xa044('0x8')]][_0xa044('0x42')]));}}catch(_0x44fc63){utils[_0xa044('0x1f')](util[_0xa044('0xa')](_0xa044('0x40'),_0x3c12be['uniqueid']),_0x44fc63);}};exports[_0xa044('0x43')]=function(_0x4d1f5d){try{if(!_['isNil'](channels[_0x4d1f5d[_0xa044('0x8')]])){utils[_0xa044('0x16')](util[_0xa044('0xa')](_0xa044('0x44'),_0x4d1f5d['uniqueid']),_0x4d1f5d);if(!_['isNil'](channels[_0x4d1f5d['uniqueid']][_0xa044('0x42')])){channels[_0x4d1f5d[_0xa044('0x8')]]['mohtime']+=utils[_0xa044('0x31')](utils[_0xa044('0x1d')](),channels[_0x4d1f5d['uniqueid']]['musiconholdstartAt']);utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x45'),_0x4d1f5d[_0xa044('0x8')],channels[_0x4d1f5d['uniqueid']][_0xa044('0x46')]));delete channels[_0x4d1f5d[_0xa044('0x8')]][_0xa044('0x42')];}}}catch(_0x2c48d5){utils[_0xa044('0x1f')](util[_0xa044('0xa')](_0xa044('0x44'),_0x4d1f5d[_0xa044('0x8')]),_0x2c48d5);}};exports[_0xa044('0x47')]=function(_0x39b2e8){try{if(!_[_0xa044('0x20')](channels[_0x39b2e8[_0xa044('0x8')]])){utils[_0xa044('0x16')](util[_0xa044('0xa')](_0xa044('0x48'),_0x39b2e8['uniqueid']),_0x39b2e8);if(!_[_0xa044('0x20')](_0x39b2e8[_0xa044('0x49')][_0xa044('0x4a')])){utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x4b'),_0x39b2e8['uniqueid'],_0x39b2e8[_0xa044('0x4c')]));channels[_0x39b2e8[_0xa044('0x8')]][_0xa044('0x4d')]=_0x39b2e8[_0xa044('0x4c')];}if(!_[_0xa044('0x20')](_0x39b2e8['variable'][_0xa044('0x4e')])){utils['info'](util['format'](_0xa044('0x4f'),_0x39b2e8[_0xa044('0x8')],_0x39b2e8['value']));channels[_0x39b2e8[_0xa044('0x8')]][_0xa044('0x50')]=_0x39b2e8['value'];channels[_0x39b2e8[_0xa044('0x8')]]['callerid']='\x22'+_0x39b2e8['value']+_0xa044('0x51')+_0x39b2e8['value']+'>';}if(!_['isNil'](_0x39b2e8[_0xa044('0x49')][_0xa044('0x52')])||!_[_0xa044('0x20')](_0x39b2e8['variable'][_0xa044('0x53')])){utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x54'),_0x39b2e8[_0xa044('0x8')],!_[_0xa044('0x20')](_0x39b2e8[_0xa044('0x49')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0xa044('0x53'),_0x39b2e8[_0xa044('0x4c')]));channels[_0x39b2e8[_0xa044('0x8')]][_0xa044('0x2d')]=_0x39b2e8[_0xa044('0x4c')];}if(!_['isNil'](_0x39b2e8[_0xa044('0x49')]['xmd-queue'])||!_[_0xa044('0x20')](_0x39b2e8[_0xa044('0x49')]['xmcs-queue'])){utils['info'](util[_0xa044('0xa')](_0xa044('0x54'),_0x39b2e8[_0xa044('0x8')],!_[_0xa044('0x20')](_0x39b2e8[_0xa044('0x49')][_0xa044('0x55')])?_0xa044('0x55'):_0xa044('0x56'),_0x39b2e8[_0xa044('0x4c')]));channels[_0x39b2e8[_0xa044('0x8')]][_0xa044('0x57')]='Queue';channels[_0x39b2e8['uniqueid']][_0xa044('0x58')]=_0x39b2e8[_0xa044('0x4c')];channels[_0x39b2e8[_0xa044('0x8')]][_0xa044('0x59')]=!![];}if(!_['isNil'](_0x39b2e8['variable'][_0xa044('0x5a')])){utils[_0xa044('0x18')](util[_0xa044('0xa')](_0xa044('0x5b'),_0x39b2e8['uniqueid'],_0x39b2e8['value']));channels[_0x39b2e8[_0xa044('0x8')]]['ContactId']=_0x39b2e8['value'];}if(!_['isNil'](_0x39b2e8[_0xa044('0x49')]['xmd-cdrtype'])){utils[_0xa044('0x18')](util[_0xa044('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x39b2e8['uniqueid'],_0x39b2e8[_0xa044('0x4c')]));channels[_0x39b2e8[_0xa044('0x8')]][_0xa044('0x5c')]=_0x39b2e8[_0xa044('0x4c')];}if(!_[_0xa044('0x20')](_0x39b2e8[_0xa044('0x49')]['outboundrouteid'])){utils['info'](util[_0xa044('0xa')](_0xa044('0x5d'),_0x39b2e8['uniqueid'],_0x39b2e8[_0xa044('0x4c')]));channels[_0x39b2e8[_0xa044('0x8')]][_0xa044('0x5e')]=_0x39b2e8[_0xa044('0x4c')];}if(!_[_0xa044('0x20')](_0x39b2e8[_0xa044('0x49')][_0xa044('0x5f')])){utils[_0xa044('0x18')](util[_0xa044('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x39b2e8[_0xa044('0x8')],_0x39b2e8[_0xa044('0x4c')]));channels[_0x39b2e8[_0xa044('0x8')]]['sipcallid']=_0x39b2e8['value'];}}}catch(_0x549bb6){utils['error'](util[_0xa044('0xa')]('[%s][calls][varset]',_0x39b2e8[_0xa044('0x8')]),_0x549bb6);}};exports[_0xa044('0x60')]=function(_0x2915f8){try{if(!_[_0xa044('0x20')](channels[_0x2915f8[_0xa044('0x8')]])){utils[_0xa044('0x16')](util[_0xa044('0xa')]('[%s][calls][newexten]',_0x2915f8[_0xa044('0x8')]),_0x2915f8);utils['info'](util[_0xa044('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2915f8[_0xa044('0x8')],_0x2915f8['application'],_0x2915f8['appdata']));if(_0x2915f8[_0xa044('0x61')][_0xa044('0x62')]()==_0xa044('0x63')&&_[_0xa044('0x64')](_0x2915f8['appdata'][_0xa044('0x62')](),_0xa044('0x65'))){var _0x395ac0=_0x2915f8['appdata'][_0xa044('0x66')]('=');var _0x7e0a9c=_0x395ac0[0x0][_0xa044('0x67')](_0x395ac0[0x0][_0xa044('0x68')]('(')+0x1,_0x395ac0[0x0][_0xa044('0x68')](')'));var _0x41d6e4=_0x395ac0[0x1];channels[_0x2915f8[_0xa044('0x8')]][_0x7e0a9c]=_0x41d6e4;}if(!_[_0xa044('0x69')]([_0xa044('0x2b'),_0xa044('0x6a'),_0xa044('0x6b'),_0xa044('0x63'),_0xa044('0x6c')],_0x2915f8[_0xa044('0x61')][_0xa044('0x62')]())){channels[_0x2915f8['uniqueid']][_0xa044('0x57')]=_0x2915f8[_0xa044('0x61')];channels[_0x2915f8[_0xa044('0x8')]][_0xa044('0x58')]=_0x2915f8[_0xa044('0x6d')];}}}catch(_0x3b986c){utils[_0xa044('0x1f')](util[_0xa044('0xa')](_0xa044('0x6e'),_0x2915f8[_0xa044('0x8')]),_0x3b986c);}}; \ No newline at end of file +var _0x8e20=['xmd-queue','lastapplication','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','substring','lastIndexOf','includes','noop','set','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','calleridnum','accountcode','request','CreateVoiceCallReport','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','source','variable','value','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue'];(function(_0x10f9fe,_0x207c91){var _0x161aae=function(_0x587603){while(--_0x587603){_0x10f9fe['push'](_0x10f9fe['shift']());}};_0x161aae(++_0x207c91);}(_0x8e20,0x1af));var _0x08e2=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x8e20[_0x425716];return _0x2d39af;};'use strict';var _=require(_0x08e2('0x0'));var util=require(_0x08e2('0x1'));var utils=require(_0x08e2('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x08e2('0x3'),_0x08e2('0x4'),'FAILED',_0x08e2('0x3'),_0x08e2('0x3'),_0x08e2('0x3'),_0x08e2('0x5'),_0x08e2('0x6'),'FAILED',_0x08e2('0x4'),_0x08e2('0x4')];var channels={};function writeDB(_0x5e5a52){var _0x24af30;if(transfers[_0x08e2('0x7')][_0x5e5a52[_0x08e2('0x8')]]){_0x24af30=_0x5e5a52[_0x08e2('0x8')];_0x5e5a52[_0x08e2('0x8')]=transfers[_0x08e2('0x7')][_0x5e5a52['uniqueid']][_0x08e2('0x9')];}utils['info'](util['format'](_0x08e2('0xa'),_0x5e5a52[_0x08e2('0x8')],_0x5e5a52[_0x08e2('0xb')],_0x5e5a52[_0x08e2('0xc')],_0x5e5a52['membername'],_0x5e5a52['interface'],_0x5e5a52[_0x08e2('0xd')],_0x5e5a52['connectedlinenum'],_0x5e5a52['lastevent']));if(_0x5e5a52[_0x08e2('0xe')]){utils['getUserByInternal'](_0x5e5a52[_0x08e2('0xe')])['then'](function(_0x42b1c0){if(_0x42b1c0){_0x5e5a52['UserId']=_0x42b1c0['id'];}utils['request']('CreateVoiceCallReport',_0x5e5a52);});}else{utils[_0x08e2('0xf')](_0x08e2('0x10'),_0x5e5a52);}if(channels[_0x5e5a52[_0x08e2('0x8')]]){delete channels[_0x5e5a52['uniqueid']];}else if(_0x24af30&&channels[_0x24af30]){if(!transfers['blinds'][_0x24af30]['recording'])delete transfers['blinds'][_0x24af30];delete channels[_0x24af30];}}exports['newchannel']=function(_0x5daeeb){try{utils[_0x08e2('0x11')](util[_0x08e2('0x12')](_0x08e2('0x13'),_0x5daeeb[_0x08e2('0x8')]),_0x5daeeb);if(_0x5daeeb[_0x08e2('0x8')]==_0x5daeeb[_0x08e2('0x14')]&&_0x5daeeb[_0x08e2('0xb')]!=_0x08e2('0x15')){utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x17'),_0x5daeeb['uniqueid'],_0x5daeeb['context'],_0x5daeeb['exten']));channels[_0x5daeeb[_0x08e2('0x8')]]={'uniqueid':_0x5daeeb[_0x08e2('0x8')],'accountcode':_0x5daeeb['accountcode'],'source':_0x5daeeb[_0x08e2('0xd')],'destination':_0x5daeeb['exten'],'destinationcontext':_0x5daeeb[_0x08e2('0x18')],'channel':_0x5daeeb['channel'],'starttime':utils[_0x08e2('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x08e2('0x3'),'amaflags':_0x08e2('0x1a')};}}catch(_0x3dbd7e){utils[_0x08e2('0x1b')](util['format']('[%s][calls][newchannel]',_0x5daeeb['uniqueid']),_0x3dbd7e);}};exports[_0x08e2('0x1c')]=function(_0x1cf01a){try{utils[_0x08e2('0x11')](util[_0x08e2('0x12')](_0x08e2('0x1d'),_0x1cf01a['uniqueid']),_0x1cf01a);if(!_['isNil'](channels[_0x1cf01a[_0x08e2('0x8')]])&&_0x1cf01a[_0x08e2('0x1e')]==0x6){utils[_0x08e2('0x16')](util[_0x08e2('0x12')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1cf01a[_0x08e2('0x8')],_0x1cf01a['context'],_0x1cf01a[_0x08e2('0xb')]));if(_[_0x08e2('0x1f')](channels[_0x1cf01a[_0x08e2('0x8')]][_0x08e2('0x20')])){channels[_0x1cf01a[_0x08e2('0x8')]][_0x08e2('0x20')]=utils[_0x08e2('0x19')]();}}else if(!_[_0x08e2('0x1f')](channels[_0x1cf01a['linkedid']])&&_0x1cf01a[_0x08e2('0x1e')]==0x6&&_0x1cf01a[_0x08e2('0x18')]!=_0x08e2('0x21')){utils[_0x08e2('0x16')](util['format'](_0x08e2('0x22'),_0x1cf01a[_0x08e2('0x8')],_0x1cf01a['linkedid'],_0x1cf01a[_0x08e2('0x18')],_0x1cf01a['channel']));channels[_0x1cf01a['linkedid']][_0x08e2('0xe')]=_0x1cf01a[_0x08e2('0xe')];channels[_0x1cf01a[_0x08e2('0x14')]][_0x08e2('0x23')]=_0x1cf01a[_0x08e2('0xb')];if(_['isNil'](channels[_0x1cf01a[_0x08e2('0x14')]][_0x08e2('0x24')])){channels[_0x1cf01a['linkedid']][_0x08e2('0x24')]=utils[_0x08e2('0x19')]();}channels[_0x1cf01a['linkedid']][_0x08e2('0x25')]=dispositions[_[_0x08e2('0x26')](_0x1cf01a['channelstate'])]||_0x08e2('0x5');}}catch(_0x3777dc){utils[_0x08e2('0x1b')](util[_0x08e2('0x12')](_0x08e2('0x1d'),_0x1cf01a['uniqueid']),_0x3777dc);}};exports[_0x08e2('0x27')]=function(_0x2c4768){try{if(!_[_0x08e2('0x1f')](channels[_0x2c4768['uniqueid']])){utils[_0x08e2('0x11')](util[_0x08e2('0x12')](_0x08e2('0x28'),_0x2c4768[_0x08e2('0x8')]),_0x2c4768);if(_[_0x08e2('0x1f')](channels[_0x2c4768[_0x08e2('0x8')]][_0x08e2('0x29')])){channels[_0x2c4768['uniqueid']]['callerid']=_0x2c4768[_0x08e2('0x2a')]+'\x20<'+_0x2c4768[_0x08e2('0xd')]+'>';}utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x2b'),_0x2c4768[_0x08e2('0x8')],channels[_0x2c4768[_0x08e2('0x8')]]['callerid'],_0x2c4768['cause-txt']));channels[_0x2c4768[_0x08e2('0x8')]]['endtime']=utils[_0x08e2('0x19')]();channels[_0x2c4768[_0x08e2('0x8')]][_0x08e2('0x2c')]=utils[_0x08e2('0x2d')](channels[_0x2c4768[_0x08e2('0x8')]][_0x08e2('0x2e')],channels[_0x2c4768['uniqueid']][_0x08e2('0x2f')]);channels[_0x2c4768[_0x08e2('0x8')]][_0x08e2('0x30')]=channels[_0x2c4768['uniqueid']][_0x08e2('0x24')]?utils['diffTime'](channels[_0x2c4768[_0x08e2('0x8')]][_0x08e2('0x2e')],channels[_0x2c4768[_0x08e2('0x8')]]['answertime']):0x0;writeDB(channels[_0x2c4768[_0x08e2('0x8')]]);}}catch(_0x5bdf91){utils[_0x08e2('0x1b')](util[_0x08e2('0x12')]('[%s][calls][hangup]',_0x2c4768[_0x08e2('0x8')]),_0x5bdf91);}};exports[_0x08e2('0x31')]=function(_0x3a6861){try{if(!_[_0x08e2('0x1f')](channels[_0x3a6861[_0x08e2('0x32')]])){utils[_0x08e2('0x11')](util[_0x08e2('0x12')](_0x08e2('0x33'),_0x3a6861[_0x08e2('0x34')]),_0x3a6861);if(channels[_0x3a6861[_0x08e2('0x32')]][_0x08e2('0xb')]==_0x3a6861[_0x08e2('0x35')]){utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x36'),_0x3a6861[_0x08e2('0x34')],_0x3a6861[_0x08e2('0x32')],_0x3a6861['secondtransfererchannel']));channels[_0x3a6861[_0x08e2('0x32')]]['destinationchannel']=_0x3a6861[_0x08e2('0x37')];channels[_0x3a6861[_0x08e2('0x32')]][_0x08e2('0x38')]=_0x08e2('0x39');}else if(channels[_0x3a6861[_0x08e2('0x32')]][_0x08e2('0xb')]=_0x3a6861[_0x08e2('0x3a')]){utils[_0x08e2('0x16')](util['format'](_0x08e2('0x36'),_0x3a6861[_0x08e2('0x34')],_0x3a6861[_0x08e2('0x32')],_0x3a6861[_0x08e2('0x3b')]));channels[_0x3a6861[_0x08e2('0x32')]]['destinationchannel']=_0x3a6861[_0x08e2('0x3b')];channels[_0x3a6861['localtwolinkedid']][_0x08e2('0x38')]=_0x08e2('0x39');}}}catch(_0x234a7e){utils[_0x08e2('0x1b')](util[_0x08e2('0x12')](_0x08e2('0x33'),_0x3a6861[_0x08e2('0x34')]),_0x234a7e);}};exports[_0x08e2('0x3c')]=function(_0x909eb0){try{if(!_[_0x08e2('0x1f')](channels[_0x909eb0[_0x08e2('0x8')]])){utils[_0x08e2('0x11')](util[_0x08e2('0x12')](_0x08e2('0x3d'),_0x909eb0['uniqueid']),_0x909eb0);channels[_0x909eb0[_0x08e2('0x8')]][_0x08e2('0x3e')]=utils[_0x08e2('0x19')]();utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x3f'),_0x909eb0[_0x08e2('0x8')],channels[_0x909eb0[_0x08e2('0x8')]][_0x08e2('0x3e')]));}}catch(_0x470b5d){utils[_0x08e2('0x1b')](util[_0x08e2('0x12')](_0x08e2('0x3d'),_0x909eb0['uniqueid']),_0x470b5d);}};exports[_0x08e2('0x40')]=function(_0x49c079){try{if(!_[_0x08e2('0x1f')](channels[_0x49c079['uniqueid']])){utils[_0x08e2('0x11')](util[_0x08e2('0x12')](_0x08e2('0x41'),_0x49c079['uniqueid']),_0x49c079);if(!_[_0x08e2('0x1f')](channels[_0x49c079[_0x08e2('0x8')]]['musiconholdstartAt'])){channels[_0x49c079[_0x08e2('0x8')]][_0x08e2('0x42')]+=utils[_0x08e2('0x2d')](utils['now'](),channels[_0x49c079['uniqueid']][_0x08e2('0x3e')]);utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x43'),_0x49c079[_0x08e2('0x8')],channels[_0x49c079[_0x08e2('0x8')]][_0x08e2('0x42')]));delete channels[_0x49c079['uniqueid']][_0x08e2('0x3e')];}}}catch(_0x244a0e){utils['error'](util[_0x08e2('0x12')](_0x08e2('0x41'),_0x49c079['uniqueid']),_0x244a0e);}};exports['varset']=function(_0x26a456){try{if(!_[_0x08e2('0x1f')](channels[_0x26a456['uniqueid']])){utils[_0x08e2('0x11')](util[_0x08e2('0x12')](_0x08e2('0x44'),_0x26a456['uniqueid']),_0x26a456);if(!_[_0x08e2('0x1f')](_0x26a456['variable'][_0x08e2('0x45')])){utils[_0x08e2('0x16')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x26a456[_0x08e2('0x8')],_0x26a456['value']));channels[_0x26a456[_0x08e2('0x8')]][_0x08e2('0x46')]=_0x26a456['value'];}if(!_[_0x08e2('0x1f')](_0x26a456[_0x08e2('0x47')]['xmd-phone'])){utils[_0x08e2('0x16')](util[_0x08e2('0x12')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x26a456[_0x08e2('0x8')],_0x26a456[_0x08e2('0x48')]));channels[_0x26a456[_0x08e2('0x8')]][_0x08e2('0x49')]=_0x26a456[_0x08e2('0x48')];channels[_0x26a456[_0x08e2('0x8')]][_0x08e2('0x29')]='\x22'+_0x26a456[_0x08e2('0x48')]+_0x08e2('0x4a')+_0x26a456[_0x08e2('0x48')]+'>';}if(!_[_0x08e2('0x1f')](_0x26a456[_0x08e2('0x47')][_0x08e2('0x4b')])||!_['isNil'](_0x26a456[_0x08e2('0x47')][_0x08e2('0x4c')])){utils[_0x08e2('0x16')](util['format'](_0x08e2('0x4d'),_0x26a456[_0x08e2('0x8')],!_[_0x08e2('0x1f')](_0x26a456[_0x08e2('0x47')][_0x08e2('0x4b')])?_0x08e2('0x4b'):_0x08e2('0x4c'),_0x26a456[_0x08e2('0x48')]));channels[_0x26a456[_0x08e2('0x8')]][_0x08e2('0x29')]=_0x26a456[_0x08e2('0x48')];}if(!_[_0x08e2('0x1f')](_0x26a456[_0x08e2('0x47')]['xmd-queue'])||!_[_0x08e2('0x1f')](_0x26a456[_0x08e2('0x47')][_0x08e2('0x4e')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x26a456[_0x08e2('0x8')],!_['isNil'](_0x26a456['variable'][_0x08e2('0x4f')])?_0x08e2('0x4f'):_0x08e2('0x4e'),_0x26a456[_0x08e2('0x48')]));channels[_0x26a456[_0x08e2('0x8')]][_0x08e2('0x50')]='Queue';channels[_0x26a456['uniqueid']][_0x08e2('0x51')]=_0x26a456[_0x08e2('0x48')];channels[_0x26a456[_0x08e2('0x8')]]['queue']=!![];}if(!_[_0x08e2('0x1f')](_0x26a456['variable'][_0x08e2('0x52')])){utils[_0x08e2('0x16')](util[_0x08e2('0x12')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x26a456[_0x08e2('0x8')],_0x26a456[_0x08e2('0x48')]));channels[_0x26a456['uniqueid']][_0x08e2('0x53')]=_0x26a456[_0x08e2('0x48')];}if(!_[_0x08e2('0x1f')](_0x26a456[_0x08e2('0x47')][_0x08e2('0x54')])){utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x55'),_0x26a456[_0x08e2('0x8')],_0x26a456[_0x08e2('0x48')]));channels[_0x26a456[_0x08e2('0x8')]][_0x08e2('0x56')]=_0x26a456[_0x08e2('0x48')];}if(!_[_0x08e2('0x1f')](_0x26a456['variable']['outboundrouteid'])){utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x57'),_0x26a456['uniqueid'],_0x26a456[_0x08e2('0x48')]));channels[_0x26a456[_0x08e2('0x8')]]['routeid']=_0x26a456[_0x08e2('0x48')];}if(!_[_0x08e2('0x1f')](_0x26a456[_0x08e2('0x47')]['sipcallid'])){utils[_0x08e2('0x16')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x26a456[_0x08e2('0x8')],_0x26a456['value']));channels[_0x26a456[_0x08e2('0x8')]][_0x08e2('0x58')]=_0x26a456['value'];}}}catch(_0x3bf9ab){utils[_0x08e2('0x1b')](util[_0x08e2('0x12')](_0x08e2('0x44'),_0x26a456[_0x08e2('0x8')]),_0x3bf9ab);}};exports['newexten']=function(_0x3127b3){try{if(!_['isNil'](channels[_0x3127b3[_0x08e2('0x8')]])){utils[_0x08e2('0x11')](util['format'](_0x08e2('0x59'),_0x3127b3[_0x08e2('0x8')]),_0x3127b3);utils[_0x08e2('0x16')](util[_0x08e2('0x12')](_0x08e2('0x5a'),_0x3127b3[_0x08e2('0x8')],_0x3127b3[_0x08e2('0x5b')],_0x3127b3[_0x08e2('0x5c')]));if(_0x3127b3[_0x08e2('0x5b')][_0x08e2('0x5d')]()=='set'&&_[_0x08e2('0x5e')](_0x3127b3[_0x08e2('0x5c')]['toLowerCase'](),'cdr')){var _0x3b4f14=_0x3127b3[_0x08e2('0x5c')][_0x08e2('0x5f')]('=');var _0x53d249=_0x3b4f14[0x0][_0x08e2('0x60')](_0x3b4f14[0x0][_0x08e2('0x61')]('(')+0x1,_0x3b4f14[0x0][_0x08e2('0x61')](')'));var _0x345824=_0x3b4f14[0x1];channels[_0x3127b3[_0x08e2('0x8')]][_0x53d249]=_0x345824;}if(!_[_0x08e2('0x62')]([_0x08e2('0x27'),_0x08e2('0x63'),'execif',_0x08e2('0x64'),_0x08e2('0x65')],_0x3127b3[_0x08e2('0x5b')]['toLowerCase']())){channels[_0x3127b3[_0x08e2('0x8')]]['lastapplication']=_0x3127b3[_0x08e2('0x5b')];channels[_0x3127b3['uniqueid']][_0x08e2('0x51')]=_0x3127b3['appdata'];}}}catch(_0x184fa3){utils[_0x08e2('0x1b')](util[_0x08e2('0x12')](_0x08e2('0x59'),_0x3127b3[_0x08e2('0x8')]),_0x184fa3);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 60c98bd..dca46d5 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 _0x656b=['[core]\x20error','close','[core]\x20close','managerevent','info','[core]\x20shutdown','error'];(function(_0x255bd2,_0x1c20bc){var _0x5061f6=function(_0x51a788){while(--_0x51a788){_0x255bd2['push'](_0x255bd2['shift']());}};_0x5061f6(++_0x1c20bc);}(_0x656b,0x185));var _0xb656=function(_0x1da101,_0x32fe90){_0x1da101=_0x1da101-0x0;var _0x29c718=_0x656b[_0x1da101];return _0x29c718;};'use strict';var utils=require('./utils');exports['connect']=function(){utils['info']('[core]\x20connected');};exports['shutdown']=function(){utils[_0xb656('0x0')](_0xb656('0x1'));};exports['fullybooted']=function(){utils[_0xb656('0x0')]('[core]\x20fullybooted');};exports[_0xb656('0x2')]=function(_0x1ab8a9){utils['error'](_0xb656('0x3'),_0x1ab8a9);};exports[_0xb656('0x4')]=function(){utils['info'](_0xb656('0x5'));};exports[_0xb656('0x6')]=function(_0x309b23){}; \ No newline at end of file +var _0x3b55=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info'];(function(_0x270dfc,_0x6d8431){var _0x44fecb=function(_0x510743){while(--_0x510743){_0x270dfc['push'](_0x270dfc['shift']());}};_0x44fecb(++_0x6d8431);}(_0x3b55,0x98));var _0x53b5=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x3b55[_0x2fd69d];return _0x5d5ef3;};'use strict';var utils=require('./utils');exports[_0x53b5('0x0')]=function(){utils[_0x53b5('0x1')](_0x53b5('0x2'));};exports[_0x53b5('0x3')]=function(){utils[_0x53b5('0x1')](_0x53b5('0x4'));};exports[_0x53b5('0x5')]=function(){utils[_0x53b5('0x1')]('[core]\x20fullybooted');};exports[_0x53b5('0x6')]=function(_0x5407e2){utils[_0x53b5('0x6')](_0x53b5('0x7'),_0x5407e2);};exports[_0x53b5('0x8')]=function(){utils[_0x53b5('0x1')](_0x53b5('0x9'));};exports[_0x53b5('0xa')]=function(_0x330587){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f3472ff..bce3499 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 _0x1217=['[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','hangup'];(function(_0x4b99a0,_0x118d08){var _0x568dc2=function(_0x446e6f){while(--_0x446e6f){_0x4b99a0['push'](_0x4b99a0['shift']());}};_0x568dc2(++_0x118d08);}(_0x1217,0x154));var _0x7121=function(_0x49930d,_0x4d0769){_0x49930d=_0x49930d-0x0;var _0x57a5a7=_0x1217[_0x49930d];return _0x57a5a7;};'use strict';var _=require(_0x7121('0x0'));var util=require('util');var utils=require(_0x7121('0x1'));var dials={};function writeDB(_0x508e76){utils[_0x7121('0x2')](util[_0x7121('0x3')](_0x7121('0x4'),_0x508e76[_0x7121('0x5')],_0x508e76[_0x7121('0x6')],_0x508e76[_0x7121('0x7')],_0x508e76[_0x7121('0x8')],_0x508e76[_0x7121('0x9')],_0x508e76[_0x7121('0xa')]));utils['request'](_0x7121('0xb'),_0x508e76);delete dials[_0x508e76[_0x7121('0x5')]];}exports[_0x7121('0xc')]=function(_0x4d1074){try{utils[_0x7121('0xd')](util['format'](_0x7121('0xe'),_0x4d1074[_0x7121('0x5')]),_0x4d1074);utils['info'](util[_0x7121('0x3')](_0x7121('0xf'),_0x4d1074[_0x7121('0x5')],_0x4d1074[_0x7121('0x10')],_0x4d1074[_0x7121('0x11')]));if(_0x4d1074['application'][_0x7121('0x12')]()==_0x7121('0x13')&&_[_0x7121('0x14')](_0x4d1074[_0x7121('0x11')]['toLowerCase'](),_0x7121('0x15'))){var _0x4bc3f8=_0x4d1074[_0x7121('0x11')][_0x7121('0x16')]('=');dials[_0x4d1074[_0x7121('0x5')]]={'routeId':_0x4bc3f8[0x1]};}}catch(_0x369e90){utils[_0x7121('0x17')](util['format']('[%s][dials][newexten]',_0x4d1074['uniqueid']),_0x369e90);}};exports[_0x7121('0x18')]=function(_0x173574){try{utils['debug'](util[_0x7121('0x3')]('[%s][dials][varset]',_0x173574[_0x7121('0x5')]),_0x173574);if(!_[_0x7121('0x19')](_0x173574[_0x7121('0x1a')][_0x7121('0x1b')])){utils[_0x7121('0x2')](util[_0x7121('0x3')](_0x7121('0x1c'),_0x173574['uniqueid'],_0x173574['value']));dials[_0x173574[_0x7121('0x5')]]={'routeId':_0x173574['value']};}}catch(_0x3112c7){utils[_0x7121('0x17')](util[_0x7121('0x3')](_0x7121('0x1d'),_0x173574[_0x7121('0x5')]),_0x3112c7);}};exports[_0x7121('0x1e')]=function(_0x16f529){try{if(!_[_0x7121('0x19')](dials[_0x16f529['uniqueid']])){utils['debug'](util[_0x7121('0x3')](_0x7121('0x1f'),_0x16f529[_0x7121('0x5')]),_0x16f529);dials[_0x16f529[_0x7121('0x5')]]=_[_0x7121('0x20')](dials[_0x16f529['uniqueid']],_0x16f529);dials[_0x16f529[_0x7121('0x5')]][_0x7121('0x21')]=utils['now']();dials[_0x16f529[_0x7121('0x5')]][_0x7121('0x22')]=_0x7121('0x23');utils[_0x7121('0x2')](util[_0x7121('0x3')](_0x7121('0x24'),_0x16f529['uniqueid'],dials[_0x16f529[_0x7121('0x5')]][_0x7121('0x21')]));}}catch(_0x3415a4){utils[_0x7121('0x17')](util[_0x7121('0x3')](_0x7121('0x1f'),_0x16f529[_0x7121('0x5')]),_0x3415a4);}};exports[_0x7121('0x25')]=function(_0x1fdac4){try{if(!_['isNil'](dials[_0x1fdac4[_0x7121('0x5')]])){utils['debug'](util[_0x7121('0x3')](_0x7121('0x26'),_0x1fdac4[_0x7121('0x5')]),_0x1fdac4);dials[_0x1fdac4[_0x7121('0x5')]][_0x7121('0xa')]=_0x1fdac4[_0x7121('0xa')];if(_0x1fdac4[_0x7121('0xa')]==_0x7121('0x27')){dials[_0x1fdac4[_0x7121('0x5')]]=_['assign'](dials[_0x1fdac4['uniqueid']],_0x1fdac4);dials[_0x1fdac4[_0x7121('0x5')]]['answertime']=utils[_0x7121('0x28')]();dials[_0x1fdac4['uniqueid']][_0x7121('0x22')]=_0x7121('0x29');utils[_0x7121('0x2')](util[_0x7121('0x3')](_0x7121('0x2a'),_0x1fdac4[_0x7121('0x5')],_0x1fdac4[_0x7121('0xa')],dials[_0x1fdac4[_0x7121('0x5')]][_0x7121('0x2b')]));}else{utils[_0x7121('0x2')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x1fdac4[_0x7121('0x5')],_0x1fdac4[_0x7121('0xa')]));}}}catch(_0x2e65be){utils[_0x7121('0x17')](util[_0x7121('0x3')](_0x7121('0x26'),_0x1fdac4[_0x7121('0x5')]),_0x2e65be);}};exports[_0x7121('0x2c')]=function(_0x497512){try{if(!_[_0x7121('0x19')](dials[_0x497512[_0x7121('0x5')]])){utils[_0x7121('0xd')](util[_0x7121('0x3')](_0x7121('0x2d'),_0x497512[_0x7121('0x5')]),_0x497512);utils[_0x7121('0x2')](util[_0x7121('0x3')](_0x7121('0x2e'),_0x497512[_0x7121('0x5')],_0x497512[_0x7121('0x8')],_0x497512[_0x7121('0x2f')],_0x497512[_0x7121('0x30')]));dials[_0x497512[_0x7121('0x5')]]=_[_0x7121('0x20')](dials[_0x497512['uniqueid']],{'endtime':utils[_0x7121('0x28')](),'lastevent':_0x7121('0x31')});dials[_0x497512[_0x7121('0x5')]][_0x7121('0x32')]=utils[_0x7121('0x33')](dials[_0x497512[_0x7121('0x5')]][_0x7121('0x34')],dials[_0x497512[_0x7121('0x5')]][_0x7121('0x21')]);dials[_0x497512[_0x7121('0x5')]][_0x7121('0x35')]=utils[_0x7121('0x33')](dials[_0x497512[_0x7121('0x5')]][_0x7121('0x2b')]||dials[_0x497512[_0x7121('0x5')]][_0x7121('0x34')],dials[_0x497512[_0x7121('0x5')]]['starttime']);dials[_0x497512[_0x7121('0x5')]][_0x7121('0x36')]=dials[_0x497512[_0x7121('0x5')]]['answertime']?utils[_0x7121('0x33')](dials[_0x497512[_0x7121('0x5')]]['endtime'],dials[_0x497512[_0x7121('0x5')]]['answertime']):0x0;writeDB(dials[_0x497512[_0x7121('0x5')]]);}}catch(_0xdc2cfb){utils[_0x7121('0x17')](util['format'](_0x7121('0x2d'),_0x497512['uniqueid']),_0xdc2cfb);}}; \ No newline at end of file +var _0x757b=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','answertime','lodash','util','./utils','format','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x757b,0x71));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb757('0x0'));var util=require(_0xb757('0x1'));var utils=require(_0xb757('0x2'));var dials={};function writeDB(_0x1d72a7){utils['info'](util[_0xb757('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1d72a7[_0xb757('0x4')],_0x1d72a7['channel'],_0x1d72a7[_0xb757('0x5')],_0x1d72a7[_0xb757('0x6')],_0x1d72a7[_0xb757('0x7')],_0x1d72a7[_0xb757('0x8')]));utils[_0xb757('0x9')](_0xb757('0xa'),_0x1d72a7);delete dials[_0x1d72a7['uniqueid']];}exports[_0xb757('0xb')]=function(_0x34c182){try{utils[_0xb757('0xc')](util[_0xb757('0x3')](_0xb757('0xd'),_0x34c182[_0xb757('0x4')]),_0x34c182);utils[_0xb757('0xe')](util[_0xb757('0x3')](_0xb757('0xf'),_0x34c182[_0xb757('0x4')],_0x34c182['application'],_0x34c182[_0xb757('0x10')]));if(_0x34c182[_0xb757('0x11')][_0xb757('0x12')]()==_0xb757('0x13')&&_[_0xb757('0x14')](_0x34c182[_0xb757('0x10')][_0xb757('0x12')](),_0xb757('0x15'))){var _0x4f0495=_0x34c182[_0xb757('0x10')][_0xb757('0x16')]('=');dials[_0x34c182['uniqueid']]={'routeId':_0x4f0495[0x1]};}}catch(_0x402a22){utils[_0xb757('0x17')](util[_0xb757('0x3')](_0xb757('0xd'),_0x34c182['uniqueid']),_0x402a22);}};exports[_0xb757('0x18')]=function(_0x43f9b8){try{utils[_0xb757('0xc')](util[_0xb757('0x3')](_0xb757('0x19'),_0x43f9b8[_0xb757('0x4')]),_0x43f9b8);if(!_[_0xb757('0x1a')](_0x43f9b8[_0xb757('0x1b')][_0xb757('0x1c')])){utils[_0xb757('0xe')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x43f9b8[_0xb757('0x4')],_0x43f9b8[_0xb757('0x1d')]));dials[_0x43f9b8[_0xb757('0x4')]]={'routeId':_0x43f9b8[_0xb757('0x1d')]};}}catch(_0x300509){utils[_0xb757('0x17')](util[_0xb757('0x3')]('[%s][dials][varset]',_0x43f9b8['uniqueid']),_0x300509);}};exports['dialbegin']=function(_0x2a6339){try{if(!_['isNil'](dials[_0x2a6339[_0xb757('0x4')]])){utils[_0xb757('0xc')](util[_0xb757('0x3')](_0xb757('0x1e'),_0x2a6339[_0xb757('0x4')]),_0x2a6339);dials[_0x2a6339[_0xb757('0x4')]]=_[_0xb757('0x1f')](dials[_0x2a6339[_0xb757('0x4')]],_0x2a6339);dials[_0x2a6339[_0xb757('0x4')]][_0xb757('0x20')]=utils[_0xb757('0x21')]();dials[_0x2a6339[_0xb757('0x4')]][_0xb757('0x22')]=_0xb757('0x23');utils[_0xb757('0xe')](util[_0xb757('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2a6339[_0xb757('0x4')],dials[_0x2a6339['uniqueid']][_0xb757('0x20')]));}}catch(_0x508b25){utils[_0xb757('0x17')](util[_0xb757('0x3')](_0xb757('0x1e'),_0x2a6339[_0xb757('0x4')]),_0x508b25);}};exports[_0xb757('0x24')]=function(_0x3c0136){try{if(!_[_0xb757('0x1a')](dials[_0x3c0136[_0xb757('0x4')]])){utils[_0xb757('0xc')](util[_0xb757('0x3')]('[%s][dials][dialend]',_0x3c0136[_0xb757('0x4')]),_0x3c0136);dials[_0x3c0136[_0xb757('0x4')]][_0xb757('0x8')]=_0x3c0136[_0xb757('0x8')];if(_0x3c0136[_0xb757('0x8')]==_0xb757('0x25')){dials[_0x3c0136[_0xb757('0x4')]]=_[_0xb757('0x1f')](dials[_0x3c0136[_0xb757('0x4')]],_0x3c0136);dials[_0x3c0136[_0xb757('0x4')]]['answertime']=utils[_0xb757('0x21')]();dials[_0x3c0136[_0xb757('0x4')]][_0xb757('0x22')]=_0xb757('0x26');utils['info'](util[_0xb757('0x3')](_0xb757('0x27'),_0x3c0136[_0xb757('0x4')],_0x3c0136['dialstatus'],dials[_0x3c0136[_0xb757('0x4')]]['answertime']));}else{utils[_0xb757('0xe')](util[_0xb757('0x3')](_0xb757('0x28'),_0x3c0136['uniqueid'],_0x3c0136[_0xb757('0x8')]));}}}catch(_0x21615e){utils[_0xb757('0x17')](util[_0xb757('0x3')]('[%s][dials][dialend]',_0x3c0136['uniqueid']),_0x21615e);}};exports[_0xb757('0x29')]=function(_0x2a6dca){try{if(!_['isNil'](dials[_0x2a6dca[_0xb757('0x4')]])){utils[_0xb757('0xc')](util['format'](_0xb757('0x2a'),_0x2a6dca[_0xb757('0x4')]),_0x2a6dca);utils['info'](util['format'](_0xb757('0x2b'),_0x2a6dca[_0xb757('0x4')],_0x2a6dca['calleridnum'],_0x2a6dca[_0xb757('0x2c')],_0x2a6dca[_0xb757('0x2d')]));dials[_0x2a6dca[_0xb757('0x4')]]=_[_0xb757('0x1f')](dials[_0x2a6dca['uniqueid']],{'endtime':utils[_0xb757('0x21')](),'lastevent':'complete'});dials[_0x2a6dca['uniqueid']][_0xb757('0x2e')]=utils[_0xb757('0x2f')](dials[_0x2a6dca[_0xb757('0x4')]][_0xb757('0x30')],dials[_0x2a6dca[_0xb757('0x4')]][_0xb757('0x20')]);dials[_0x2a6dca[_0xb757('0x4')]][_0xb757('0x31')]=utils[_0xb757('0x2f')](dials[_0x2a6dca[_0xb757('0x4')]]['answertime']||dials[_0x2a6dca['uniqueid']][_0xb757('0x30')],dials[_0x2a6dca[_0xb757('0x4')]][_0xb757('0x20')]);dials[_0x2a6dca['uniqueid']][_0xb757('0x32')]=dials[_0x2a6dca[_0xb757('0x4')]]['answertime']?utils[_0xb757('0x2f')](dials[_0x2a6dca[_0xb757('0x4')]]['endtime'],dials[_0x2a6dca[_0xb757('0x4')]][_0xb757('0x33')]):0x0;writeDB(dials[_0x2a6dca[_0xb757('0x4')]]);}}catch(_0x301177){utils[_0xb757('0x17')](util[_0xb757('0x3')](_0xb757('0x2a'),_0x2a6dca['uniqueid']),_0x301177);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 6d90d2c..d856f0f 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 _0x85a1=['asterisk','port','username','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','debug','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local'];(function(_0x3125e0,_0x52e932){var _0x2816ac=function(_0x55a916){while(--_0x55a916){_0x3125e0['push'](_0x3125e0['shift']());}};_0x2816ac(++_0x52e932);}(_0x85a1,0xcf));var _0x185a=function(_0x28bd68,_0x152dc6){_0x28bd68=_0x28bd68-0x0;var _0x171993=_0x85a1[_0x28bd68];return _0x171993;};var AsteriskManager=require(_0x185a('0x0'));var config=require(_0x185a('0x1'));var utils=require(_0x185a('0x2'));var util=require(_0x185a('0x3'));var isXDREnabled=config[_0x185a('0x4')]&&config[_0x185a('0x4')][_0x185a('0x5')]?!config[_0x185a('0x4')][_0x185a('0x5')]:!![];var isProduction=config[_0x185a('0x6')]===_0x185a('0x7')||![];var isLocalAsterisk=config[_0x185a('0x4')]&&config[_0x185a('0x4')][_0x185a('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0x185a('0x9')][_0x185a('0xa')],config[_0x185a('0x9')]['ip'],config[_0x185a('0x9')][_0x185a('0xb')],config[_0x185a('0x9')]['password'],!![]);ami[_0x185a('0xc')]();if(!isXDREnabled){utils['info'](_0x185a('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x185a('0xe')](_0x185a('0xf'));}else{var agents=require(_0x185a('0x10'));var calls=require(_0x185a('0x11'));var queues=require(_0x185a('0x12'));var recordings=require('./recordings.controller');var members=require(_0x185a('0x13'));var dials=require(_0x185a('0x14'));var transfers=require(_0x185a('0x15'));var core=require(_0x185a('0x16'));ami['on'](_0x185a('0x17'),core['connect']);ami['on'](_0x185a('0x18'),core[_0x185a('0x18')]);ami['on'](_0x185a('0x19'),core[_0x185a('0x19')]);ami['on'](_0x185a('0x1a'),core[_0x185a('0x1a')]);ami['on'](_0x185a('0x1b'),core[_0x185a('0x1b')]);ami['on'](_0x185a('0x1c'),core[_0x185a('0x1c')]);ami['on'](_0x185a('0x1d'),function(_0x1e170b){try{utils['debug'](util['format']('[%s][index][devicestatechange]',_0x1e170b['device']),_0x1e170b);members[_0x185a('0x1d')](_0x1e170b);}catch(_0x15192f){utils['error'](util[_0x185a('0x1e')](_0x185a('0x1f'),_0x1e170b['device']),_0x15192f);}});ami['on'](_0x185a('0x20'),function(_0x15989c){try{utils['debug'](util[_0x185a('0x1e')](_0x185a('0x21'),_0x15989c[_0x185a('0x22')]),_0x15989c);agents['agentcalled'](_0x15989c);}catch(_0x167b2c){utils['error'](util['format'](_0x185a('0x21'),_0x15989c[_0x185a('0x22')]),_0x167b2c);}});ami['on'](_0x185a('0x23'),function(_0x46937e){try{utils['debug'](util[_0x185a('0x1e')](_0x185a('0x24'),_0x46937e['uniqueid']),_0x46937e);agents[_0x185a('0x23')](_0x46937e);}catch(_0x9bdd74){utils['error'](util[_0x185a('0x1e')](_0x185a('0x24'),_0x46937e[_0x185a('0x22')]),_0x9bdd74);}});ami['on'](_0x185a('0x25'),function(_0x5ef1fc){try{utils['debug'](util[_0x185a('0x1e')](_0x185a('0x26'),_0x5ef1fc[_0x185a('0x22')]),_0x5ef1fc);agents[_0x185a('0x25')](_0x5ef1fc);queues['agentconnect'](_0x5ef1fc);}catch(_0x773f17){utils[_0x185a('0x1a')](util['format'](_0x185a('0x26'),_0x5ef1fc[_0x185a('0x22')]),_0x773f17);}});ami['on'](_0x185a('0x27'),function(_0x161a13){try{utils['debug'](util[_0x185a('0x1e')]('[%s][index][agentcomplete]',_0x161a13[_0x185a('0x22')]),_0x161a13);agents[_0x185a('0x27')](_0x161a13);queues[_0x185a('0x27')](_0x161a13);members[_0x185a('0x27')](_0x161a13);}catch(_0x46bb5c){utils['error'](util[_0x185a('0x1e')](_0x185a('0x28'),_0x161a13[_0x185a('0x22')]),_0x46bb5c);}});ami['on']('queuecallerabandon',function(_0x3f37a1){try{utils[_0x185a('0x29')](util['format'](_0x185a('0x2a'),_0x3f37a1[_0x185a('0x22')]),_0x3f37a1);agents[_0x185a('0x2b')](_0x3f37a1);queues[_0x185a('0x2b')](_0x3f37a1);}catch(_0x199125){utils[_0x185a('0x1a')](util['format'](_0x185a('0x2a'),_0x3f37a1[_0x185a('0x22')]),_0x199125);}});ami['on'](_0x185a('0x2c'),function(_0x255ea2){try{utils['debug'](util[_0x185a('0x1e')]('[%s][index][queuecallerjoin]',_0x255ea2['uniqueid']),_0x255ea2);queues[_0x185a('0x2c')](_0x255ea2);recordings[_0x185a('0x2c')](_0x255ea2);}catch(_0x573bad){utils[_0x185a('0x1a')](util[_0x185a('0x1e')](_0x185a('0x2d'),_0x255ea2['uniqueid']),_0x573bad);}});ami['on'](_0x185a('0x2e'),function(_0x2138fc){try{utils[_0x185a('0x29')](util[_0x185a('0x1e')](_0x185a('0x2f'),_0x2138fc[_0x185a('0x22')]),_0x2138fc);queues[_0x185a('0x2e')](_0x2138fc);}catch(_0xedabc4){utils[_0x185a('0x1a')](util['format'](_0x185a('0x2f'),_0x2138fc[_0x185a('0x22')]),_0xedabc4);}});ami['on']('musiconholdstart',function(_0x518efb){try{utils[_0x185a('0x29')](util['format']('[%s][index][musiconholdstart]',_0x518efb[_0x185a('0x22')]),_0x518efb);queues[_0x185a('0x30')](_0x518efb);calls[_0x185a('0x30')](_0x518efb);}catch(_0x2137ed){utils[_0x185a('0x1a')](util[_0x185a('0x1e')](_0x185a('0x31'),_0x518efb[_0x185a('0x22')]),_0x2137ed);}});ami['on'](_0x185a('0x32'),function(_0x4ca834){try{utils[_0x185a('0x29')](util[_0x185a('0x1e')]('[%s][index][musiconholdstop]',_0x4ca834[_0x185a('0x22')]),_0x4ca834);queues[_0x185a('0x32')](_0x4ca834);calls['musiconholdstop'](_0x4ca834);}catch(_0x15e3ea){utils['error'](util[_0x185a('0x1e')]('[%s][index][musiconholdstop]',_0x4ca834[_0x185a('0x22')]),_0x15e3ea);}});ami['on']('newstate',function(_0x9e9958){try{utils[_0x185a('0x29')](util[_0x185a('0x1e')](_0x185a('0x33'),_0x9e9958['uniqueid']),_0x9e9958);calls['newstate'](_0x9e9958);recordings[_0x185a('0x34')](_0x9e9958);}catch(_0x21854f){utils[_0x185a('0x1a')](util[_0x185a('0x1e')]('[%s][index][newstate]',_0x9e9958[_0x185a('0x22')]),_0x21854f);}});ami['on'](_0x185a('0x35'),function(_0x52e102){try{utils[_0x185a('0x29')](util['format']('[%s][index][hangup]',_0x52e102[_0x185a('0x22')]),_0x52e102);calls[_0x185a('0x35')](_0x52e102);recordings[_0x185a('0x35')](_0x52e102);dials[_0x185a('0x35')](_0x52e102);agents['hangup'](_0x52e102);queues[_0x185a('0x35')](_0x52e102);}catch(_0x4fa104){utils[_0x185a('0x1a')](util[_0x185a('0x1e')](_0x185a('0x36'),_0x52e102[_0x185a('0x22')]),_0x4fa104);}});ami['on'](_0x185a('0x37'),function(_0x28f948){try{utils['debug'](util['format']('[%s][index][cdr]',_0x28f948[_0x185a('0x22')]),_0x28f948);members[_0x185a('0x37')](_0x28f948);}catch(_0x3aaf75){utils[_0x185a('0x1a')](util[_0x185a('0x1e')]('[%s][index][cdr]',_0x28f948[_0x185a('0x22')]),_0x3aaf75);}});ami['on'](_0x185a('0x38'),function(_0x75d31e){try{utils['debug'](util[_0x185a('0x1e')]('[%s][index][blindtransfer]',_0x75d31e[_0x185a('0x22')]),_0x75d31e);queues[_0x185a('0x38')](_0x75d31e);agents[_0x185a('0x38')](_0x75d31e);transfers[_0x185a('0x38')](_0x75d31e);recordings[_0x185a('0x38')](_0x75d31e);}catch(_0x4e5889){utils[_0x185a('0x1a')](util[_0x185a('0x1e')](_0x185a('0x39'),_0x75d31e[_0x185a('0x22')]),_0x4e5889);}});ami['on'](_0x185a('0x3a'),function(_0x11e96b){try{utils['debug'](util[_0x185a('0x1e')](_0x185a('0x3b'),_0x11e96b[_0x185a('0x3c')]),_0x11e96b);queues[_0x185a('0x3a')](_0x11e96b);transfers['attendedtransfer'](_0x11e96b);agents[_0x185a('0x3a')](_0x11e96b);calls[_0x185a('0x3a')](_0x11e96b);}catch(_0x23fb45){utils[_0x185a('0x1a')](util[_0x185a('0x1e')](_0x185a('0x3b'),_0x11e96b[_0x185a('0x3c')]),_0x23fb45);}});ami['on']('varset',function(_0x73842a){try{utils[_0x185a('0x29')](util[_0x185a('0x1e')](_0x185a('0x3d'),_0x73842a[_0x185a('0x22')]),_0x73842a);queues[_0x185a('0x3e')](_0x73842a);recordings['varset'](_0x73842a);calls[_0x185a('0x3e')](_0x73842a);dials[_0x185a('0x3e')](_0x73842a);}catch(_0x57fc26){utils[_0x185a('0x1a')](util['format'](_0x185a('0x3d'),_0x73842a['uniqueid']),_0x57fc26);}});ami['on']('newexten',function(_0x4c5adb){try{utils[_0x185a('0x29')](util['format'](_0x185a('0x3f'),_0x4c5adb[_0x185a('0x22')]),_0x4c5adb);calls['newexten'](_0x4c5adb);recordings[_0x185a('0x40')](_0x4c5adb);dials['newexten'](_0x4c5adb);}catch(_0x460404){utils['error'](util['format']('[%s][index][newexten]',_0x4c5adb[_0x185a('0x22')]),_0x460404);}});ami['on'](_0x185a('0x41'),function(_0x366b11){try{utils[_0x185a('0x29')](util[_0x185a('0x1e')](_0x185a('0x42'),_0x366b11[_0x185a('0x22')]),_0x366b11);calls['newchannel'](_0x366b11);recordings[_0x185a('0x41')](_0x366b11);}catch(_0x35f126){utils[_0x185a('0x1a')](util[_0x185a('0x1e')](_0x185a('0x42'),_0x366b11[_0x185a('0x22')]),_0x35f126);}});ami['on'](_0x185a('0x43'),function(_0x57aa95){try{utils['debug'](util[_0x185a('0x1e')](_0x185a('0x44'),_0x57aa95[_0x185a('0x22')]),_0x57aa95);dials[_0x185a('0x43')](_0x57aa95);}catch(_0x26fb48){utils[_0x185a('0x1a')](util['format'](_0x185a('0x45'),_0x57aa95[_0x185a('0x22')]),_0x26fb48);}});ami['on']('dialend',function(_0x5a1e42){try{utils['debug'](util[_0x185a('0x1e')](_0x185a('0x46'),_0x5a1e42[_0x185a('0x22')]),_0x5a1e42);dials[_0x185a('0x47')](_0x5a1e42);}catch(_0x16cbac){utils[_0x185a('0x1a')](util[_0x185a('0x1e')](_0x185a('0x46'),_0x5a1e42[_0x185a('0x22')]),_0x16cbac);}});} \ No newline at end of file +var _0x7f99=['[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','util','xdr','disabled','env','production','local','asterisk','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer'];(function(_0x22dbc6,_0x47a0c1){var _0x29d561=function(_0x2c4ecc){while(--_0x2c4ecc){_0x22dbc6['push'](_0x22dbc6['shift']());}};_0x29d561(++_0x47a0c1);}(_0x7f99,0xfd));var _0x97f9=function(_0x5cd32e,_0x223795){_0x5cd32e=_0x5cd32e-0x0;var _0xfe4afc=_0x7f99[_0x5cd32e];return _0xfe4afc;};var AsteriskManager=require('asterisk-manager');var config=require(_0x97f9('0x0'));var utils=require('./utils');var util=require(_0x97f9('0x1'));var isXDREnabled=config[_0x97f9('0x2')]&&config[_0x97f9('0x2')][_0x97f9('0x3')]?!config[_0x97f9('0x2')][_0x97f9('0x3')]:!![];var isProduction=config[_0x97f9('0x4')]===_0x97f9('0x5')||![];var isLocalAsterisk=config[_0x97f9('0x2')]&&config[_0x97f9('0x2')][_0x97f9('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x97f9('0x7')]['port'],config['asterisk']['ip'],config['asterisk']['username'],config[_0x97f9('0x7')]['password'],!![]);ami[_0x97f9('0x8')]();if(!isXDREnabled){utils[_0x97f9('0x9')](_0x97f9('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x97f9('0x9')](_0x97f9('0xb'));}else{var agents=require(_0x97f9('0xc'));var calls=require(_0x97f9('0xd'));var queues=require(_0x97f9('0xe'));var recordings=require(_0x97f9('0xf'));var members=require(_0x97f9('0x10'));var dials=require(_0x97f9('0x11'));var transfers=require(_0x97f9('0x12'));var core=require(_0x97f9('0x13'));ami['on'](_0x97f9('0x14'),core['connect']);ami['on']('shutdown',core[_0x97f9('0x15')]);ami['on']('fullybooted',core[_0x97f9('0x16')]);ami['on']('error',core[_0x97f9('0x17')]);ami['on']('close',core[_0x97f9('0x18')]);ami['on'](_0x97f9('0x19'),core['managerevent']);ami['on'](_0x97f9('0x1a'),function(_0x2577c9){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')]('[%s][index][devicestatechange]',_0x2577c9[_0x97f9('0x1d')]),_0x2577c9);members[_0x97f9('0x1a')](_0x2577c9);}catch(_0x9c929){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x1e'),_0x2577c9[_0x97f9('0x1d')]),_0x9c929);}});ami['on'](_0x97f9('0x1f'),function(_0x36da50){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')](_0x97f9('0x20'),_0x36da50['uniqueid']),_0x36da50);agents['agentcalled'](_0x36da50);}catch(_0x14e6b8){utils[_0x97f9('0x17')](util['format'](_0x97f9('0x20'),_0x36da50[_0x97f9('0x21')]),_0x14e6b8);}});ami['on'](_0x97f9('0x22'),function(_0x2ddbb7){try{utils['debug'](util[_0x97f9('0x1c')]('[%s][index][agentringnoanswer]',_0x2ddbb7['uniqueid']),_0x2ddbb7);agents['agentringnoanswer'](_0x2ddbb7);}catch(_0x4faf6){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x23'),_0x2ddbb7[_0x97f9('0x21')]),_0x4faf6);}});ami['on'](_0x97f9('0x24'),function(_0x2e50b2){try{utils[_0x97f9('0x1b')](util['format']('[%s][index][agentconnect]',_0x2e50b2[_0x97f9('0x21')]),_0x2e50b2);agents[_0x97f9('0x24')](_0x2e50b2);queues[_0x97f9('0x24')](_0x2e50b2);}catch(_0xe20c20){utils[_0x97f9('0x17')](util['format'](_0x97f9('0x25'),_0x2e50b2[_0x97f9('0x21')]),_0xe20c20);}});ami['on'](_0x97f9('0x26'),function(_0x58918a){try{utils['debug'](util[_0x97f9('0x1c')](_0x97f9('0x27'),_0x58918a[_0x97f9('0x21')]),_0x58918a);agents[_0x97f9('0x26')](_0x58918a);queues[_0x97f9('0x26')](_0x58918a);members[_0x97f9('0x26')](_0x58918a);}catch(_0x519fab){utils['error'](util['format']('[%s][index][agentcomplete]',_0x58918a['uniqueid']),_0x519fab);}});ami['on'](_0x97f9('0x28'),function(_0x434c8b){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')](_0x97f9('0x29'),_0x434c8b[_0x97f9('0x21')]),_0x434c8b);agents[_0x97f9('0x28')](_0x434c8b);queues[_0x97f9('0x28')](_0x434c8b);}catch(_0x430fad){utils['error'](util[_0x97f9('0x1c')](_0x97f9('0x29'),_0x434c8b['uniqueid']),_0x430fad);}});ami['on'](_0x97f9('0x2a'),function(_0x3eba33){try{utils['debug'](util[_0x97f9('0x1c')](_0x97f9('0x2b'),_0x3eba33['uniqueid']),_0x3eba33);queues[_0x97f9('0x2a')](_0x3eba33);recordings['queuecallerjoin'](_0x3eba33);}catch(_0x1ad4aa){utils['error'](util[_0x97f9('0x1c')](_0x97f9('0x2b'),_0x3eba33['uniqueid']),_0x1ad4aa);}});ami['on'](_0x97f9('0x2c'),function(_0x3f6784){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')](_0x97f9('0x2d'),_0x3f6784[_0x97f9('0x21')]),_0x3f6784);queues[_0x97f9('0x2c')](_0x3f6784);}catch(_0x2cd8a5){utils[_0x97f9('0x17')](util['format'](_0x97f9('0x2d'),_0x3f6784[_0x97f9('0x21')]),_0x2cd8a5);}});ami['on']('musiconholdstart',function(_0x5bc6a1){try{utils['debug'](util['format'](_0x97f9('0x2e'),_0x5bc6a1['uniqueid']),_0x5bc6a1);queues[_0x97f9('0x2f')](_0x5bc6a1);calls[_0x97f9('0x2f')](_0x5bc6a1);}catch(_0x544010){utils[_0x97f9('0x17')](util['format']('[%s][index][musiconholdstart]',_0x5bc6a1[_0x97f9('0x21')]),_0x544010);}});ami['on'](_0x97f9('0x30'),function(_0x1391c1){try{utils[_0x97f9('0x1b')](util['format'](_0x97f9('0x31'),_0x1391c1[_0x97f9('0x21')]),_0x1391c1);queues[_0x97f9('0x30')](_0x1391c1);calls['musiconholdstop'](_0x1391c1);}catch(_0x5f3702){utils[_0x97f9('0x17')](util['format']('[%s][index][musiconholdstop]',_0x1391c1[_0x97f9('0x21')]),_0x5f3702);}});ami['on']('newstate',function(_0x48044d){try{utils[_0x97f9('0x1b')](util['format'](_0x97f9('0x32'),_0x48044d['uniqueid']),_0x48044d);calls[_0x97f9('0x33')](_0x48044d);recordings['newstate'](_0x48044d);}catch(_0x2c7449){utils[_0x97f9('0x17')](util['format'](_0x97f9('0x32'),_0x48044d[_0x97f9('0x21')]),_0x2c7449);}});ami['on']('hangup',function(_0x9df79d){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')]('[%s][index][hangup]',_0x9df79d['uniqueid']),_0x9df79d);calls[_0x97f9('0x34')](_0x9df79d);recordings['hangup'](_0x9df79d);dials['hangup'](_0x9df79d);agents[_0x97f9('0x34')](_0x9df79d);queues['hangup'](_0x9df79d);}catch(_0x46418b){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x35'),_0x9df79d[_0x97f9('0x21')]),_0x46418b);}});ami['on']('cdr',function(_0x30b3dd){try{utils[_0x97f9('0x1b')](util['format'](_0x97f9('0x36'),_0x30b3dd[_0x97f9('0x21')]),_0x30b3dd);members[_0x97f9('0x37')](_0x30b3dd);}catch(_0x33b8d2){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x36'),_0x30b3dd[_0x97f9('0x21')]),_0x33b8d2);}});ami['on'](_0x97f9('0x38'),function(_0x1bef12){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')](_0x97f9('0x39'),_0x1bef12[_0x97f9('0x21')]),_0x1bef12);queues[_0x97f9('0x38')](_0x1bef12);agents[_0x97f9('0x38')](_0x1bef12);transfers[_0x97f9('0x38')](_0x1bef12);recordings[_0x97f9('0x38')](_0x1bef12);}catch(_0x394d5c){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x39'),_0x1bef12['uniqueid']),_0x394d5c);}});ami['on'](_0x97f9('0x3a'),function(_0x35a2e9){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')](_0x97f9('0x3b'),_0x35a2e9[_0x97f9('0x3c')]),_0x35a2e9);queues[_0x97f9('0x3a')](_0x35a2e9);transfers[_0x97f9('0x3a')](_0x35a2e9);agents['attendedtransfer'](_0x35a2e9);calls['attendedtransfer'](_0x35a2e9);}catch(_0x277814){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x3b'),_0x35a2e9['origtransfereruniqueid']),_0x277814);}});ami['on'](_0x97f9('0x3d'),function(_0x363c19){try{utils['debug'](util[_0x97f9('0x1c')](_0x97f9('0x3e'),_0x363c19['uniqueid']),_0x363c19);queues[_0x97f9('0x3d')](_0x363c19);recordings['varset'](_0x363c19);calls[_0x97f9('0x3d')](_0x363c19);dials[_0x97f9('0x3d')](_0x363c19);}catch(_0x2aa747){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x3e'),_0x363c19['uniqueid']),_0x2aa747);}});ami['on'](_0x97f9('0x3f'),function(_0x1ae876){try{utils['debug'](util[_0x97f9('0x1c')](_0x97f9('0x40'),_0x1ae876[_0x97f9('0x21')]),_0x1ae876);calls[_0x97f9('0x3f')](_0x1ae876);recordings[_0x97f9('0x3f')](_0x1ae876);dials[_0x97f9('0x3f')](_0x1ae876);}catch(_0x2e9f91){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x40'),_0x1ae876['uniqueid']),_0x2e9f91);}});ami['on'](_0x97f9('0x41'),function(_0x1dc5cf){try{utils[_0x97f9('0x1b')](util['format'](_0x97f9('0x42'),_0x1dc5cf[_0x97f9('0x21')]),_0x1dc5cf);calls['newchannel'](_0x1dc5cf);recordings[_0x97f9('0x41')](_0x1dc5cf);}catch(_0x3d92bd){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x42'),_0x1dc5cf[_0x97f9('0x21')]),_0x3d92bd);}});ami['on']('dialbegin',function(_0x407179){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')](_0x97f9('0x43'),_0x407179['uniqueid']),_0x407179);dials[_0x97f9('0x44')](_0x407179);}catch(_0x114bb0){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x45'),_0x407179['uniqueid']),_0x114bb0);}});ami['on'](_0x97f9('0x46'),function(_0x41a6a1){try{utils[_0x97f9('0x1b')](util[_0x97f9('0x1c')](_0x97f9('0x47'),_0x41a6a1[_0x97f9('0x21')]),_0x41a6a1);dials[_0x97f9('0x46')](_0x41a6a1);}catch(_0x3fc1a2){utils[_0x97f9('0x17')](util[_0x97f9('0x1c')](_0x97f9('0x47'),_0x41a6a1[_0x97f9('0x21')]),_0x3fc1a2);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b1963e0..61df520 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 _0x51f4=['queue','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','type','getUserByInterface','then','membername','name','internal','CreateMemberReport','getUserByName','split','request','catch','error','format','uniqueid','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','now','agent','isNil','exitAt','duration','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign'];(function(_0x1dd78b,_0x213fd9){var _0x2d9bf6=function(_0x2c749a){while(--_0x2c749a){_0x1dd78b['push'](_0x1dd78b['shift']());}};_0x2d9bf6(++_0x213fd9);}(_0x51f4,0x1c2));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x451f('0x0'));var util=require(_0x451f('0x1'));var utils=require(_0x451f('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x451f('0x3')];function writeDB(_0x444171){utils[_0x451f('0x4')](util['format'](_0x451f('0x5'),_0x444171['uniqueid'],_0x444171[_0x451f('0x6')],_0x444171[_0x451f('0x7')],_0x444171[_0x451f('0x8')],_0x444171['membername'],_0x444171[_0x451f('0x9')]));if(_0x444171[_0x451f('0x6')]){utils[_0x451f('0xa')](_0x444171['interface'])[_0x451f('0xb')](function(_0x4e9848){if(_0x4e9848){_0x444171[_0x451f('0xc')]=_0x4e9848[_0x451f('0xd')];_0x444171['internal']=_0x4e9848[_0x451f('0xe')];utils['request'](_0x451f('0xf'),_0x444171);}else{utils[_0x451f('0x10')](_0x444171[_0x451f('0x6')][_0x451f('0x11')]('/')[0x1])[_0x451f('0xb')](function(_0x1c66fd){if(_0x1c66fd){_0x444171[_0x451f('0xc')]=_0x1c66fd['name'];_0x444171[_0x451f('0xe')]=_0x1c66fd[_0x451f('0xe')];utils[_0x451f('0x12')]('CreateMemberReport',_0x444171);}});}})[_0x451f('0x13')](function(_0x37af22){utils[_0x451f('0x14')](util[_0x451f('0x15')]('[%s][members][writeDB]',_0x444171[_0x451f('0x16')]),_0x37af22);});}delete members[_0x444171['interface']];}function startsWith(_0x183e4d,_0x4a58a7){return _['some'](_0x183e4d,function(_0x242390){return _['startsWith'](_0x4a58a7,_0x242390);});}exports[_0x451f('0x17')]=function(_0x53b34a){try{utils['debug'](util['format'](_0x451f('0x18'),members[_0x53b34a['device']]?members[_0x53b34a['device']][_0x451f('0x16')]:_0x53b34a[_0x451f('0x19')]),_0x53b34a);utils[_0x451f('0x4')](util['format'](_0x451f('0x1a'),members[_0x53b34a[_0x451f('0x19')]]?members[_0x53b34a[_0x451f('0x19')]]['uniqueid']:_0x53b34a['device'],_0x53b34a['state'],_0x53b34a['device']));switch(_0x53b34a[_0x451f('0x1b')]){case'INUSE':case _0x451f('0x1c'):if(!startsWith(exclude,_0x53b34a[_0x451f('0x19')])){members[_0x53b34a['device']]={'channel':'voice','interface':_0x53b34a['device'],'type':'TALKING','enterAt':utils[_0x451f('0x1d')](),'role':_0x451f('0x1e')};}break;case'NOT_INUSE':if(!_[_0x451f('0x1f')](members[_0x53b34a[_0x451f('0x19')]])){members[_0x53b34a[_0x451f('0x19')]][_0x451f('0x20')]=utils[_0x451f('0x1d')]();members[_0x53b34a[_0x451f('0x19')]][_0x451f('0x21')]=utils['diffTime'](members[_0x53b34a['device']][_0x451f('0x20')],members[_0x53b34a[_0x451f('0x19')]][_0x451f('0x22')]);if(members[_0x53b34a[_0x451f('0x19')]][_0x451f('0x16')]){writeDB(members[_0x53b34a['device']]);}}break;default:break;}}catch(_0x4492e0){utils[_0x451f('0x14')](util[_0x451f('0x15')](_0x451f('0x18'),members[_0x53b34a[_0x451f('0x19')]]?members[_0x53b34a['device']][_0x451f('0x16')]:_0x53b34a[_0x451f('0x19')]),_0x4492e0);}};exports[_0x451f('0x23')]=function(_0x128739){try{if(!_[_0x451f('0x1f')](members[_0x128739[_0x451f('0x6')]])){utils[_0x451f('0x24')](util[_0x451f('0x15')](_0x451f('0x25'),_0x128739[_0x451f('0x16')]),_0x128739);utils[_0x451f('0x4')](util[_0x451f('0x15')](_0x451f('0x26'),_0x128739['uniqueid'],_0x128739[_0x451f('0x6')],_0x128739['queue']));members[_0x128739['interface']]=_[_0x451f('0x27')](members[_0x128739[_0x451f('0x6')]],{'data4':_0x128739[_0x451f('0x28')],'uniqueid':_0x128739[_0x451f('0x16')]});}}catch(_0x43d1f5){utils['error'](util['format'](_0x451f('0x25'),_0x128739[_0x451f('0x16')]),_0x43d1f5);}};exports[_0x451f('0x29')]=function(_0x1f7d53){try{utils[_0x451f('0x24')](util[_0x451f('0x15')](_0x451f('0x2a'),_0x1f7d53[_0x451f('0x16')]),_0x1f7d53);if(_0x1f7d53[_0x451f('0x7')]){var _0xfe24a1=_0x1f7d53['channel'][_0x451f('0x11')]('-')[0x0];if(!_['isNil'](members[_0xfe24a1])){members[_0xfe24a1]=_[_0x451f('0x27')](members[_0xfe24a1],{'data1':members[_0xfe24a1][_0x451f('0x2b')]||_0x1f7d53[_0x451f('0x9')],'data2':members[_0xfe24a1][_0x451f('0x8')]||_0x1f7d53[_0x451f('0x2c')],'data3':members[_0xfe24a1][_0x451f('0x2d')]||_0x1f7d53[_0x451f('0x2e')],'uniqueid':members[_0xfe24a1]['uniqueid']||_0x1f7d53['uniqueid']});utils[_0x451f('0x4')](util['format'](_0x451f('0x2f'),_0x1f7d53[_0x451f('0x16')],members[_0xfe24a1][_0x451f('0x2b')],members[_0xfe24a1][_0x451f('0x8')],members[_0xfe24a1]['data3']));if(members[_0xfe24a1][_0x451f('0x20')]){writeDB(members[_0xfe24a1]);}}}if(_0x1f7d53[_0x451f('0x30')]){var _0x4dcd49=_0x1f7d53[_0x451f('0x30')]['split']('-')[0x0];if(!_[_0x451f('0x1f')](members[_0x4dcd49])){members[_0x4dcd49]=_[_0x451f('0x27')](members[_0x4dcd49],{'data1':members[_0x4dcd49][_0x451f('0x2b')]||_0x1f7d53[_0x451f('0x9')],'data2':members[_0x4dcd49][_0x451f('0x8')]||_0x1f7d53[_0x451f('0x2c')],'data3':members[_0x4dcd49]['data3']||_0x1f7d53[_0x451f('0x2e')],'uniqueid':members[_0x4dcd49]['uniqueid']||_0x1f7d53['uniqueid']});utils['info'](util[_0x451f('0x15')](_0x451f('0x2f'),_0x1f7d53[_0x451f('0x16')],members[_0x4dcd49][_0x451f('0x2b')],members[_0x4dcd49]['data2'],members[_0x4dcd49][_0x451f('0x2d')]));if(members[_0x4dcd49][_0x451f('0x20')]){writeDB(members[_0x4dcd49]);}}}}catch(_0x87eef7){utils['error'](util[_0x451f('0x15')]('[%s][members][cdr]',_0x1f7d53[_0x451f('0x16')]),_0x87eef7);}}; \ No newline at end of file +var _0x80c7=['some','startsWith','devicestatechange','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration','diffTime','error','agentcomplete','isNil','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','catch','[%s][members][writeDB]'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x80c7,0x8d));var _0x780c=function(_0x1f7bf0,_0x1c02b4){_0x1f7bf0=_0x1f7bf0-0x0;var _0xf0049c=_0x80c7[_0x1f7bf0];return _0xf0049c;};'use strict';var _=require(_0x780c('0x0'));var util=require(_0x780c('0x1'));var utils=require(_0x780c('0x2'));var members={};var exclude=[_0x780c('0x3'),'Queue:'];function writeDB(_0x5589b0){utils[_0x780c('0x4')](util['format'](_0x780c('0x5'),_0x5589b0[_0x780c('0x6')],_0x5589b0[_0x780c('0x7')],_0x5589b0[_0x780c('0x8')],_0x5589b0[_0x780c('0x9')],_0x5589b0[_0x780c('0xa')],_0x5589b0[_0x780c('0xb')]));if(_0x5589b0[_0x780c('0x7')]){utils[_0x780c('0xc')](_0x5589b0[_0x780c('0x7')])[_0x780c('0xd')](function(_0x54a4ed){if(_0x54a4ed){_0x5589b0[_0x780c('0xa')]=_0x54a4ed[_0x780c('0xe')];_0x5589b0['internal']=_0x54a4ed[_0x780c('0xf')];utils[_0x780c('0x10')](_0x780c('0x11'),_0x5589b0);}else{utils['getUserByName'](_0x5589b0[_0x780c('0x7')][_0x780c('0x12')]('/')[0x1])[_0x780c('0xd')](function(_0x24fe4e){if(_0x24fe4e){_0x5589b0[_0x780c('0xa')]=_0x24fe4e[_0x780c('0xe')];_0x5589b0[_0x780c('0xf')]=_0x24fe4e[_0x780c('0xf')];utils[_0x780c('0x10')](_0x780c('0x11'),_0x5589b0);}});}})[_0x780c('0x13')](function(_0x24dc45){utils['error'](util['format'](_0x780c('0x14'),_0x5589b0[_0x780c('0x6')]),_0x24dc45);});}delete members[_0x5589b0['interface']];}function startsWith(_0x5b74fb,_0x2c8c23){return _[_0x780c('0x15')](_0x5b74fb,function(_0x21b69b){return _[_0x780c('0x16')](_0x2c8c23,_0x21b69b);});}exports[_0x780c('0x17')]=function(_0x33c514){try{utils['debug'](util[_0x780c('0x18')](_0x780c('0x19'),members[_0x33c514[_0x780c('0x1a')]]?members[_0x33c514[_0x780c('0x1a')]]['uniqueid']:_0x33c514[_0x780c('0x1a')]),_0x33c514);utils[_0x780c('0x4')](util[_0x780c('0x18')](_0x780c('0x1b'),members[_0x33c514['device']]?members[_0x33c514[_0x780c('0x1a')]][_0x780c('0x6')]:_0x33c514['device'],_0x33c514['state'],_0x33c514['device']));switch(_0x33c514[_0x780c('0x1c')]){case _0x780c('0x1d'):case _0x780c('0x1e'):if(!startsWith(exclude,_0x33c514[_0x780c('0x1a')])){members[_0x33c514[_0x780c('0x1a')]]={'channel':_0x780c('0x1f'),'interface':_0x33c514[_0x780c('0x1a')],'type':_0x780c('0x20'),'enterAt':utils[_0x780c('0x21')](),'role':_0x780c('0x22')};}break;case _0x780c('0x23'):if(!_['isNil'](members[_0x33c514[_0x780c('0x1a')]])){members[_0x33c514[_0x780c('0x1a')]][_0x780c('0x24')]=utils['now']();members[_0x33c514[_0x780c('0x1a')]][_0x780c('0x25')]=utils[_0x780c('0x26')](members[_0x33c514[_0x780c('0x1a')]][_0x780c('0x24')],members[_0x33c514[_0x780c('0x1a')]]['enterAt']);if(members[_0x33c514[_0x780c('0x1a')]][_0x780c('0x6')]){writeDB(members[_0x33c514[_0x780c('0x1a')]]);}}break;default:break;}}catch(_0x56ca81){utils[_0x780c('0x27')](util[_0x780c('0x18')](_0x780c('0x19'),members[_0x33c514[_0x780c('0x1a')]]?members[_0x33c514[_0x780c('0x1a')]][_0x780c('0x6')]:_0x33c514[_0x780c('0x1a')]),_0x56ca81);}};exports[_0x780c('0x28')]=function(_0x2a19b1){try{if(!_[_0x780c('0x29')](members[_0x2a19b1[_0x780c('0x7')]])){utils[_0x780c('0x2a')](util[_0x780c('0x18')](_0x780c('0x2b'),_0x2a19b1['uniqueid']),_0x2a19b1);utils[_0x780c('0x4')](util[_0x780c('0x18')](_0x780c('0x2c'),_0x2a19b1[_0x780c('0x6')],_0x2a19b1[_0x780c('0x7')],_0x2a19b1[_0x780c('0x2d')]));members[_0x2a19b1['interface']]=_[_0x780c('0x2e')](members[_0x2a19b1[_0x780c('0x7')]],{'data4':_0x2a19b1[_0x780c('0x2d')],'uniqueid':_0x2a19b1[_0x780c('0x6')]});}}catch(_0x5c52ef){utils['error'](util[_0x780c('0x18')](_0x780c('0x2b'),_0x2a19b1['uniqueid']),_0x5c52ef);}};exports['cdr']=function(_0x57932b){try{utils[_0x780c('0x2a')](util[_0x780c('0x18')](_0x780c('0x2f'),_0x57932b['uniqueid']),_0x57932b);if(_0x57932b[_0x780c('0x8')]){var _0x483f75=_0x57932b['channel'][_0x780c('0x12')]('-')[0x0];if(!_[_0x780c('0x29')](members[_0x483f75])){members[_0x483f75]=_[_0x780c('0x2e')](members[_0x483f75],{'data1':members[_0x483f75][_0x780c('0x30')]||_0x57932b[_0x780c('0xb')],'data2':members[_0x483f75][_0x780c('0x9')]||_0x57932b['source'],'data3':members[_0x483f75][_0x780c('0x31')]||_0x57932b[_0x780c('0x32')],'uniqueid':members[_0x483f75]['uniqueid']||_0x57932b['uniqueid']});utils[_0x780c('0x4')](util[_0x780c('0x18')](_0x780c('0x33'),_0x57932b[_0x780c('0x6')],members[_0x483f75][_0x780c('0x30')],members[_0x483f75][_0x780c('0x9')],members[_0x483f75][_0x780c('0x31')]));if(members[_0x483f75][_0x780c('0x24')]){writeDB(members[_0x483f75]);}}}if(_0x57932b[_0x780c('0x34')]){var _0x2ea276=_0x57932b['destinationchannel'][_0x780c('0x12')]('-')[0x0];if(!_[_0x780c('0x29')](members[_0x2ea276])){members[_0x2ea276]=_['assign'](members[_0x2ea276],{'data1':members[_0x2ea276][_0x780c('0x30')]||_0x57932b[_0x780c('0xb')],'data2':members[_0x2ea276]['data2']||_0x57932b[_0x780c('0x35')],'data3':members[_0x2ea276]['data3']||_0x57932b[_0x780c('0x32')],'uniqueid':members[_0x2ea276][_0x780c('0x6')]||_0x57932b[_0x780c('0x6')]});utils['info'](util['format'](_0x780c('0x33'),_0x57932b[_0x780c('0x6')],members[_0x2ea276][_0x780c('0x30')],members[_0x2ea276][_0x780c('0x9')],members[_0x2ea276][_0x780c('0x31')]));if(members[_0x2ea276][_0x780c('0x24')]){writeDB(members[_0x2ea276]);}}}}catch(_0x35631a){utils[_0x780c('0x27')](util['format'](_0x780c('0x2f'),_0x57932b[_0x780c('0x6')]),_0x35631a);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index f897768..3ac9bbb 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 _0xc064=['TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','extension','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','origtransfererlinkedid','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','type','CreateVoiceQueueReport','request','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','hangup','isNil','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','error','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','queueposition','queuecallerabandon','queuecallerabandonAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','membername','reason','transfer'];(function(_0x1b72f8,_0x567ed0){var _0x25d416=function(_0x315732){while(--_0x315732){_0x1b72f8['push'](_0x1b72f8['shift']());}};_0x25d416(++_0x567ed0);}(_0xc064,0x8d));var _0x4c06=function(_0x4a5629,_0xc7d97c){_0x4a5629=_0x4a5629-0x0;var _0x366705=_0xc064[_0x4a5629];return _0x366705;};'use strict';var _=require('lodash');var util=require(_0x4c06('0x0'));var utils=require(_0x4c06('0x1'));var queues={};function writeDB(_0x2fc735){utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x4'),_0x2fc735[_0x4c06('0x5')],_0x2fc735[_0x4c06('0x6')],_0x2fc735[_0x4c06('0x7')],_0x2fc735['lastAssignedTo'],_0x2fc735[_0x4c06('0x8')],_0x2fc735[_0x4c06('0x9')],_0x2fc735[_0x4c06('0xa')]));if(_0x2fc735[_0x4c06('0x7')]){utils['getVoiceQueueByName'](_0x2fc735[_0x4c06('0x7')])['then'](function(_0x4cc2b5){if(_0x4cc2b5){_0x2fc735['type']=_0x4cc2b5[_0x4c06('0xb')];}utils['request'](_0x4c06('0xc'),_0x2fc735);});}else{utils[_0x4c06('0xd')](_0x4c06('0xc'),_0x2fc735);}if(_0x2fc735[_0x4c06('0xe')]){delete queues[_0x2fc735['transfereduniqueid']];}else{delete queues[_0x2fc735[_0x4c06('0x5')]];}}exports['queuecallerjoin']=function(_0x56e9e9){try{utils[_0x4c06('0xf')](util[_0x4c06('0x3')](_0x4c06('0x10'),_0x56e9e9[_0x4c06('0x5')]),_0x56e9e9);utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x11'),_0x56e9e9['uniqueid'],_0x56e9e9['queue'],_0x56e9e9[_0x4c06('0x12')]));queues[_0x56e9e9['uniqueid']]=_[_0x4c06('0x13')](_0x56e9e9,{'originalposition':_0x56e9e9['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x281f12){utils['error'](util[_0x4c06('0x3')](_0x4c06('0x10'),_0x56e9e9[_0x4c06('0x5')]),_0x281f12);}};exports[_0x4c06('0x14')]=function(_0x1d593b){try{if(!_[_0x4c06('0x15')](queues[_0x1d593b['uniqueid']])){utils[_0x4c06('0xf')](util[_0x4c06('0x3')]('[%s][queues][hangup]',_0x1d593b[_0x4c06('0x5')]),_0x1d593b);if(queues[_0x1d593b[_0x4c06('0x5')]]['queuecallerleaveAt']){if(!queues[_0x1d593b['uniqueid']]['queuecallerabandon']&&!queues[_0x1d593b['uniqueid']][_0x4c06('0x16')]){queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0x17')]=!![];queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0x18')]=utils[_0x4c06('0x19')]();queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0xa')]=_0x4c06('0x1a');}utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x1b'),_0x1d593b[_0x4c06('0x5')],queues[_0x1d593b[_0x4c06('0x5')]]['name'],queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0xa')]));writeDB(queues[_0x1d593b[_0x4c06('0x5')]]);}else if(queues[_0x1d593b['uniqueid']][_0x4c06('0xe')]){utils['info'](util[_0x4c06('0x3')](_0x4c06('0x1c'),_0x1d593b['uniqueid'],queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0x1d')],queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0xe')]));queues[queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0xe')]]=queues[_0x1d593b[_0x4c06('0x5')]];queues[queues[_0x1d593b[_0x4c06('0x5')]][_0x4c06('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x1d593b[_0x4c06('0x5')]];}}}catch(_0x23fe3f){utils[_0x4c06('0x1e')](util['format'](_0x4c06('0x1f'),_0x1d593b[_0x4c06('0x5')]),_0x23fe3f);}};exports[_0x4c06('0x20')]=function(_0x4408c9){try{utils[_0x4c06('0xf')](util[_0x4c06('0x3')](_0x4c06('0x21'),_0x4408c9[_0x4c06('0x5')]),_0x4408c9);if(!_[_0x4c06('0x15')](_0x4408c9[_0x4c06('0x22')][_0x4c06('0x23')])&&_0x4408c9[_0x4c06('0x24')][_0x4c06('0x25')]()!==_0x4c06('0x26')){if(!_[_0x4c06('0x15')](queues[_0x4408c9[_0x4c06('0x5')]])){queues[_0x4408c9[_0x4c06('0x5')]]['queuecallerabandon']=![];queues[_0x4408c9['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4408c9['uniqueid']]['queuecallerexit']=!![];queues[_0x4408c9['uniqueid']][_0x4c06('0x27')]=utils['now']();queues[_0x4408c9[_0x4c06('0x5')]][_0x4c06('0xa')]=_0x4408c9[_0x4c06('0x24')][_0x4c06('0x25')]();utils['info'](util[_0x4c06('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4408c9[_0x4c06('0x5')],queues[_0x4408c9[_0x4c06('0x5')]][_0x4c06('0x1d')],_0x4408c9[_0x4c06('0x24')],queues[_0x4408c9[_0x4c06('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x4408c9[_0x4c06('0x5')]]);}}else if(!_[_0x4c06('0x15')](_0x4408c9[_0x4c06('0x22')][_0x4c06('0x28')])){if(!_[_0x4c06('0x15')](queues[_0x4408c9[_0x4c06('0x5')]])&&!queues[_0x4408c9[_0x4c06('0x5')]][_0x4c06('0x29')]){queues[_0x4408c9[_0x4c06('0x5')]][_0x4c06('0x29')]=![];queues[_0x4408c9[_0x4c06('0x5')]][_0x4c06('0x2a')]=null;queues[_0x4408c9[_0x4c06('0x5')]]['queuecallerexit']=!![];queues[_0x4408c9['uniqueid']][_0x4c06('0x27')]=utils['now']();queues[_0x4408c9[_0x4c06('0x5')]][_0x4c06('0xa')]=_0x4c06('0x2b');utils['info'](util[_0x4c06('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4408c9[_0x4c06('0x5')],queues[_0x4408c9[_0x4c06('0x5')]]['name'],_0x4408c9[_0x4c06('0x24')],queues[_0x4408c9[_0x4c06('0x5')]][_0x4c06('0xa')]));}}}catch(_0x5e179e){utils['error'](util[_0x4c06('0x3')](_0x4c06('0x21'),_0x4408c9[_0x4c06('0x5')]),_0x5e179e);}};exports[_0x4c06('0x29')]=function(_0x416c58){try{if(!_[_0x4c06('0x15')](queues[_0x416c58['uniqueid']])){utils[_0x4c06('0xf')](util[_0x4c06('0x3')](_0x4c06('0x2c'),_0x416c58[_0x4c06('0x5')]),_0x416c58);queues[_0x416c58[_0x4c06('0x5')]]['queuecallerexit']=![];queues[_0x416c58['uniqueid']][_0x4c06('0x27')]=null;queues[_0x416c58['uniqueid']][_0x4c06('0x29')]=!![];queues[_0x416c58[_0x4c06('0x5')]][_0x4c06('0x2a')]=utils[_0x4c06('0x19')]();queues[_0x416c58[_0x4c06('0x5')]]['queuecallerexitreason']=_0x4c06('0x2d');utils['info'](util[_0x4c06('0x3')](_0x4c06('0x2e'),_0x416c58['uniqueid'],queues[_0x416c58[_0x4c06('0x5')]][_0x4c06('0x1d')],queues[_0x416c58[_0x4c06('0x5')]][_0x4c06('0xa')]));}}catch(_0x570440){utils[_0x4c06('0x1e')](util['format']('[%s][queues][queuecallerabandon]',_0x416c58[_0x4c06('0x5')]),_0x570440);}};exports[_0x4c06('0x2f')]=function(_0x3c540c){try{if(!_[_0x4c06('0x15')](queues[_0x3c540c[_0x4c06('0x5')]])){utils['debug'](util[_0x4c06('0x3')](_0x4c06('0x30'),_0x3c540c['uniqueid']),_0x3c540c);utils['info'](util['format'](_0x4c06('0x31'),_0x3c540c[_0x4c06('0x5')],queues[_0x3c540c[_0x4c06('0x5')]]['name'],_0x3c540c[_0x4c06('0x32')],_0x3c540c[_0x4c06('0x33')]));queues[_0x3c540c[_0x4c06('0x5')]][_0x4c06('0x2f')]=!![];queues[_0x3c540c[_0x4c06('0x5')]][_0x4c06('0x34')]=utils['now']();queues[_0x3c540c[_0x4c06('0x5')]]['holdtime']=utils[_0x4c06('0x35')](queues[_0x3c540c[_0x4c06('0x5')]][_0x4c06('0x34')],queues[_0x3c540c[_0x4c06('0x5')]][_0x4c06('0x36')]);queues[_0x3c540c[_0x4c06('0x5')]][_0x4c06('0x12')]=_0x3c540c[_0x4c06('0x12')];queues[_0x3c540c['uniqueid']]['count']=_0x3c540c[_0x4c06('0x37')];queues[_0x3c540c[_0x4c06('0x5')]][_0x4c06('0x32')]=_0x3c540c[_0x4c06('0x32')];queues[_0x3c540c[_0x4c06('0x5')]]['connectedlinename']=_0x3c540c[_0x4c06('0x33')];}}catch(_0x5e32b3){utils[_0x4c06('0x1e')](util[_0x4c06('0x3')](_0x4c06('0x30'),_0x3c540c['uniqueid']),_0x5e32b3);}};exports[_0x4c06('0x38')]=function(_0x52feae){try{if(!_[_0x4c06('0x15')](queues[_0x52feae[_0x4c06('0x5')]])){utils['debug'](util[_0x4c06('0x3')](_0x4c06('0x39'),_0x52feae[_0x4c06('0x5')]),_0x52feae);utils['info'](util[_0x4c06('0x3')](_0x4c06('0x3a'),_0x52feae[_0x4c06('0x5')],queues[_0x52feae['uniqueid']]['name'],_0x52feae['membername'],_0x52feae[_0x4c06('0x3b')]));queues[_0x52feae[_0x4c06('0x5')]][_0x4c06('0x29')]=![];queues[_0x52feae['uniqueid']][_0x4c06('0x29')]=![];queues[_0x52feae[_0x4c06('0x5')]][_0x4c06('0x2a')]=null;queues[_0x52feae[_0x4c06('0x5')]][_0x4c06('0x16')]=![];queues[_0x52feae[_0x4c06('0x5')]][_0x4c06('0xa')]=null;queues[_0x52feae[_0x4c06('0x5')]][_0x4c06('0x27')]=null;queues[_0x52feae[_0x4c06('0x5')]][_0x4c06('0x3c')]=!![];queues[_0x52feae['uniqueid']][_0x4c06('0x9')]=_0x52feae[_0x4c06('0x3b')];queues[_0x52feae['uniqueid']][_0x4c06('0x3d')]=_0x52feae['membername'];}}catch(_0x366a34){utils[_0x4c06('0x1e')](util['format']('[%s][queues][agentconnect]',_0x52feae[_0x4c06('0x5')]),_0x366a34);}};exports[_0x4c06('0x3e')]=function(_0x37f034){try{if(!_['isNil'](queues[_0x37f034[_0x4c06('0x5')]])){if(queues[_0x37f034[_0x4c06('0x5')]]['queuecallerleaveAt']){utils[_0x4c06('0xf')](util[_0x4c06('0x3')](_0x4c06('0x3f'),_0x37f034[_0x4c06('0x5')]),_0x37f034);queues[_0x37f034['uniqueid']][_0x4c06('0x29')]=![];queues[_0x37f034[_0x4c06('0x5')]]['queuecallerabandon']=![];queues[_0x37f034[_0x4c06('0x5')]]['queuecallerabandonAt']=null;queues[_0x37f034['uniqueid']][_0x4c06('0x16')]=![];queues[_0x37f034[_0x4c06('0x5')]]['queuecallerexitAt']=null;queues[_0x37f034[_0x4c06('0x5')]][_0x4c06('0x3c')]=!![];queues[_0x37f034['uniqueid']][_0x4c06('0x3d')]=_0x37f034[_0x4c06('0x40')];queues[_0x37f034['uniqueid']]['queuecallercomplete']=!![];queues[_0x37f034[_0x4c06('0x5')]]['queuecallercompleteAt']=utils[_0x4c06('0x19')]();if(_0x37f034[_0x4c06('0x41')]==_0x4c06('0x42')){if(!queues[_0x37f034[_0x4c06('0x5')]][_0x4c06('0x42')]){queues[_0x37f034[_0x4c06('0x5')]][_0x4c06('0xa')]=_0x4c06('0x43');}}else{queues[_0x37f034['uniqueid']][_0x4c06('0xa')]=_0x4c06('0x44')+_0x37f034[_0x4c06('0x41')][_0x4c06('0x25')]();}utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x45'),_0x37f034[_0x4c06('0x5')],queues[_0x37f034[_0x4c06('0x5')]][_0x4c06('0x1d')],_0x37f034[_0x4c06('0x40')],queues[_0x37f034[_0x4c06('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x37f034[_0x4c06('0x5')]]);}}}catch(_0xc2f006){utils[_0x4c06('0x1e')](util['format'](_0x4c06('0x3f'),_0x37f034[_0x4c06('0x5')]),_0xc2f006);}};exports[_0x4c06('0x46')]=function(_0x3e0670){try{if(!_[_0x4c06('0x15')](queues[_0x3e0670[_0x4c06('0x47')]])){utils[_0x4c06('0xf')](util[_0x4c06('0x3')](_0x4c06('0x48'),_0x3e0670[_0x4c06('0x5')]),_0x3e0670);queues[_0x3e0670[_0x4c06('0x47')]][_0x4c06('0x42')]=!![];queues[_0x3e0670[_0x4c06('0x47')]]['transfertype']='BLIND';queues[_0x3e0670[_0x4c06('0x47')]]['transferexten']=_0x3e0670[_0x4c06('0x49')];queues[_0x3e0670[_0x4c06('0x47')]]['transferuniqueid']=_0x3e0670[_0x4c06('0x47')];queues[_0x3e0670[_0x4c06('0x47')]][_0x4c06('0xa')]=_0x4c06('0x4a');utils[_0x4c06('0x2')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3e0670[_0x4c06('0x5')],queues[_0x3e0670[_0x4c06('0x47')]][_0x4c06('0x1d')],_0x3e0670[_0x4c06('0x47')],_0x3e0670[_0x4c06('0x49')]));}}catch(_0x194f28){utils['error'](util[_0x4c06('0x3')]('[%s][queues][blindtransfer]',_0x3e0670['uniqueid']),_0x194f28);}};exports[_0x4c06('0x4b')]=function(_0x1875a6){try{utils['debug'](util[_0x4c06('0x3')]('[%s][queues][attendedtransfer]',_0x1875a6[_0x4c06('0x4c')]),_0x1875a6);if(_0x1875a6[_0x4c06('0x4c')]==_0x1875a6['origtransfererlinkedid']){if(!_[_0x4c06('0x15')](queues[_0x1875a6[_0x4c06('0x4d')]])){utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x4e'),_0x1875a6[_0x4c06('0x4c')],queues[_0x1875a6['secondtransfererlinkedid']]['name'],_0x1875a6[_0x4c06('0x4f')]));queues[_0x1875a6['secondtransfererlinkedid']]['transfer']=!![];queues[_0x1875a6[_0x4c06('0x4d')]][_0x4c06('0x50')]='ATTENDED';queues[_0x1875a6[_0x4c06('0x4d')]][_0x4c06('0x51')]=_0x1875a6[_0x4c06('0x4f')];queues[_0x1875a6[_0x4c06('0x4d')]][_0x4c06('0x52')]=_0x1875a6[_0x4c06('0x4c')];queues[_0x1875a6[_0x4c06('0x4d')]][_0x4c06('0xa')]=_0x4c06('0x53');}if(!_[_0x4c06('0x15')](queues[_0x1875a6['origtransfererlinkedid']])){if(_0x1875a6[_0x4c06('0x54')]&&queues[_0x1875a6[_0x4c06('0x54')]]){queues[_0x1875a6['transfereelinkedid']][_0x4c06('0x55')]=0x1;queues[_0x1875a6['transfereeuniqueid']]=_[_0x4c06('0x56')](queues[_0x1875a6[_0x4c06('0x54')]]);queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0xe')]=_0x1875a6[_0x4c06('0x57')];queues[_0x1875a6['transfereeuniqueid']][_0x4c06('0x55')]=0x2;queues[_0x1875a6['transfereeuniqueid']]['calleridnum']=queues[_0x1875a6['secondtransfererlinkedid']][_0x4c06('0x8')];queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0x58')]=queues[_0x1875a6[_0x4c06('0x4d')]]['calleridname'];queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0x36')]=utils['now']();queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0x34')]=utils['now']();queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0x59')]=0x0;queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0x5a')]=0x0;utils[_0x4c06('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1875a6[_0x4c06('0x4c')],queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0x1d')],queues[_0x1875a6[_0x4c06('0x47')]][_0x4c06('0x8')],queues[_0x1875a6['transfereeuniqueid']][_0x4c06('0x58')]));}else{utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x5b'),_0x1875a6[_0x4c06('0x4c')],queues[_0x1875a6[_0x4c06('0x5c')]]['name'],_0x1875a6[_0x4c06('0x4d')]));queues[_0x1875a6[_0x4c06('0x5c')]]['transfereduniqueid']=_0x1875a6['secondtransfererlinkedid'];}}}else if(_0x1875a6[_0x4c06('0x5d')]==_0x1875a6[_0x4c06('0x4d')]){if(!_[_0x4c06('0x15')](queues[_0x1875a6[_0x4c06('0x5c')]])){utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x5e'),_0x1875a6['origtransfereruniqueid'],queues[_0x1875a6[_0x4c06('0x5c')]][_0x4c06('0x1d')],_0x1875a6[_0x4c06('0x5d')],_0x1875a6['secondtransfererexten']));queues[_0x1875a6[_0x4c06('0x5c')]]['transfer']=!![];queues[_0x1875a6[_0x4c06('0x5c')]][_0x4c06('0x50')]=_0x4c06('0x5f');queues[_0x1875a6[_0x4c06('0x5c')]]['transferexten']=_0x1875a6[_0x4c06('0x60')];queues[_0x1875a6[_0x4c06('0x5c')]][_0x4c06('0x52')]=_0x1875a6[_0x4c06('0x5d')];queues[_0x1875a6['origtransfererlinkedid']]['queuecallerexitreason']=_0x4c06('0x53');}if(!_[_0x4c06('0x15')](queues[_0x1875a6[_0x4c06('0x4d')]])){if(_0x1875a6[_0x4c06('0x61')]&&queues[_0x1875a6[_0x4c06('0x61')]]){queues[_0x1875a6[_0x4c06('0x61')]]['queuecallerenterreason']=0x1;queues[_0x1875a6[_0x4c06('0x57')]]=_[_0x4c06('0x56')](queues[_0x1875a6[_0x4c06('0x61')]]);queues[_0x1875a6['transfertargetuniqueid']][_0x4c06('0xe')]=_0x1875a6['transfertargetuniqueid'];queues[_0x1875a6['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x1875a6[_0x4c06('0x57')]][_0x4c06('0x8')]=queues[_0x1875a6[_0x4c06('0x5c')]][_0x4c06('0x8')];queues[_0x1875a6['transfertargetuniqueid']][_0x4c06('0x58')]=queues[_0x1875a6['origtransfererlinkedid']]['calleridname'];queues[_0x1875a6[_0x4c06('0x57')]]['queuecallerjoinAt']=utils[_0x4c06('0x19')]();queues[_0x1875a6['transfertargetuniqueid']][_0x4c06('0x34')]=utils[_0x4c06('0x19')]();queues[_0x1875a6[_0x4c06('0x57')]][_0x4c06('0x59')]=0x0;queues[_0x1875a6[_0x4c06('0x57')]][_0x4c06('0x5a')]=0x0;utils[_0x4c06('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1875a6[_0x4c06('0x4c')],queues[_0x1875a6['transfertargetuniqueid']][_0x4c06('0x1d')],queues[_0x1875a6['transfertargetuniqueid']][_0x4c06('0xe')],queues[_0x1875a6['transfertargetuniqueid']]['calleridnum'],queues[_0x1875a6['transfertargetuniqueid']][_0x4c06('0x58')]));}else{utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x5b'),_0x1875a6[_0x4c06('0x4c')],queues[_0x1875a6[_0x4c06('0x4d')]][_0x4c06('0x1d')],_0x1875a6['origtransfererlinkedid']));queues[_0x1875a6['secondtransfererlinkedid']][_0x4c06('0xe')]=_0x1875a6[_0x4c06('0x5c')];}}}}catch(_0x3e3f07){utils[_0x4c06('0x1e')](util[_0x4c06('0x3')]('[%s][queues][attendedtransfer]',_0x1875a6['origtransfereruniqueid']),_0x3e3f07);}};exports[_0x4c06('0x62')]=function(_0xb21ea1){try{if(!_[_0x4c06('0x15')](queues[_0xb21ea1[_0x4c06('0x5')]])){utils[_0x4c06('0xf')](util['format'](_0x4c06('0x63'),_0xb21ea1[_0x4c06('0x5')]),_0xb21ea1);queues[_0xb21ea1[_0x4c06('0x5')]]['musiconholdstartAt']=utils[_0x4c06('0x19')]();utils[_0x4c06('0x2')](util[_0x4c06('0x3')](_0x4c06('0x64'),_0xb21ea1[_0x4c06('0x5')],queues[_0xb21ea1[_0x4c06('0x5')]][_0x4c06('0x1d')],queues[_0xb21ea1[_0x4c06('0x5')]][_0x4c06('0x65')]));}}catch(_0x55a165){utils[_0x4c06('0x1e')](util[_0x4c06('0x3')](_0x4c06('0x63'),_0xb21ea1[_0x4c06('0x5')]),_0x55a165);}};exports[_0x4c06('0x66')]=function(_0x12ea5c){try{if(!_[_0x4c06('0x15')](queues[_0x12ea5c[_0x4c06('0x5')]])){if(!_[_0x4c06('0x15')](queues[_0x12ea5c['uniqueid']][_0x4c06('0x65')])){utils[_0x4c06('0xf')](util[_0x4c06('0x3')](_0x4c06('0x67'),_0x12ea5c['uniqueid']),_0x12ea5c);queues[_0x12ea5c['uniqueid']][_0x4c06('0x5a')]+=utils[_0x4c06('0x35')](utils[_0x4c06('0x19')](),queues[_0x12ea5c[_0x4c06('0x5')]][_0x4c06('0x65')]);utils[_0x4c06('0x2')](util[_0x4c06('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x12ea5c[_0x4c06('0x5')],queues[_0x12ea5c[_0x4c06('0x5')]][_0x4c06('0x1d')],queues[_0x12ea5c[_0x4c06('0x5')]][_0x4c06('0x5a')]));delete queues[_0x12ea5c[_0x4c06('0x5')]][_0x4c06('0x65')];}}}catch(_0x5dbb0b){utils[_0x4c06('0x1e')](util[_0x4c06('0x3')](_0x4c06('0x67'),_0x12ea5c[_0x4c06('0x5')]),_0x5dbb0b);}}; \ No newline at end of file +var _0xd9c9=['secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','variable','queuestatus','CONTINUE','queuecallerabandonAt','value','toUpperCase','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','agentcomplete','assigned','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','transferexten','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerleaveAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','origtransfererlinkedid'];(function(_0x410194,_0x235ccc){var _0x1724fa=function(_0x25ec64){while(--_0x25ec64){_0x410194['push'](_0x410194['shift']());}};_0x1724fa(++_0x235ccc);}(_0xd9c9,0x6f));var _0x9d9c=function(_0x1c0e91,_0xd8625e){_0x1c0e91=_0x1c0e91-0x0;var _0x34322c=_0xd9c9[_0x1c0e91];return _0x34322c;};'use strict';var _=require(_0x9d9c('0x0'));var util=require(_0x9d9c('0x1'));var utils=require(_0x9d9c('0x2'));var queues={};function writeDB(_0x1e3861){utils['info'](util['format'](_0x9d9c('0x3'),_0x1e3861[_0x9d9c('0x4')],_0x1e3861['channel'],_0x1e3861[_0x9d9c('0x5')],_0x1e3861['lastAssignedTo'],_0x1e3861['calleridnum'],_0x1e3861[_0x9d9c('0x6')],_0x1e3861[_0x9d9c('0x7')]));if(_0x1e3861[_0x9d9c('0x5')]){utils[_0x9d9c('0x8')](_0x1e3861[_0x9d9c('0x5')])[_0x9d9c('0x9')](function(_0x3492ee){if(_0x3492ee){_0x1e3861[_0x9d9c('0xa')]=_0x3492ee[_0x9d9c('0xa')];}utils[_0x9d9c('0xb')](_0x9d9c('0xc'),_0x1e3861);});}else{utils[_0x9d9c('0xb')](_0x9d9c('0xc'),_0x1e3861);}if(_0x1e3861[_0x9d9c('0xd')]){delete queues[_0x1e3861[_0x9d9c('0xd')]];}else{delete queues[_0x1e3861['uniqueid']];}}exports[_0x9d9c('0xe')]=function(_0x531806){try{utils[_0x9d9c('0xf')](util['format'](_0x9d9c('0x10'),_0x531806[_0x9d9c('0x4')]),_0x531806);utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')](_0x9d9c('0x13'),_0x531806[_0x9d9c('0x4')],_0x531806['queue'],_0x531806[_0x9d9c('0x14')]));queues[_0x531806[_0x9d9c('0x4')]]=_[_0x9d9c('0x15')](_0x531806,{'originalposition':_0x531806[_0x9d9c('0x14')],'queuecallerjoinAt':utils[_0x9d9c('0x16')](),'mohtime':0x0});}catch(_0x4ab5f3){utils[_0x9d9c('0x17')](util[_0x9d9c('0x12')](_0x9d9c('0x10'),_0x531806[_0x9d9c('0x4')]),_0x4ab5f3);}};exports['hangup']=function(_0x40c2ab){try{if(!_[_0x9d9c('0x18')](queues[_0x40c2ab['uniqueid']])){utils[_0x9d9c('0xf')](util['format']('[%s][queues][hangup]',_0x40c2ab[_0x9d9c('0x4')]),_0x40c2ab);if(queues[_0x40c2ab['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0x19')]&&!queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0x1a')]){queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0x1b')]=!![];queues[_0x40c2ab['uniqueid']][_0x9d9c('0x1c')]=utils[_0x9d9c('0x16')]();queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0x7')]=_0x9d9c('0x1d');}utils['info'](util[_0x9d9c('0x12')](_0x9d9c('0x1e'),_0x40c2ab[_0x9d9c('0x4')],queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0x1f')],queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0x7')]));writeDB(queues[_0x40c2ab[_0x9d9c('0x4')]]);}else if(queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0xd')]){utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x40c2ab[_0x9d9c('0x4')],queues[_0x40c2ab[_0x9d9c('0x4')]]['name'],queues[_0x40c2ab['uniqueid']][_0x9d9c('0xd')]));queues[queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0xd')]]=queues[_0x40c2ab[_0x9d9c('0x4')]];queues[queues[_0x40c2ab[_0x9d9c('0x4')]][_0x9d9c('0xd')]][_0x9d9c('0x20')]=0x2;delete queues[_0x40c2ab[_0x9d9c('0x4')]];}}}catch(_0x27ef6a){utils['error'](util[_0x9d9c('0x12')](_0x9d9c('0x21'),_0x40c2ab['uniqueid']),_0x27ef6a);}};exports[_0x9d9c('0x22')]=function(_0x4f6ac2){try{utils['debug'](util[_0x9d9c('0x12')]('[%s][queues][varset]',_0x4f6ac2[_0x9d9c('0x4')]),_0x4f6ac2);if(!_['isNil'](_0x4f6ac2[_0x9d9c('0x23')][_0x9d9c('0x24')])&&_0x4f6ac2['value']['toUpperCase']()!==_0x9d9c('0x25')){if(!_[_0x9d9c('0x18')](queues[_0x4f6ac2[_0x9d9c('0x4')]])){queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x19')]=![];queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x26')]=null;queues[_0x4f6ac2[_0x9d9c('0x4')]]['queuecallerexit']=!![];queues[_0x4f6ac2[_0x9d9c('0x4')]]['queuecallerexitAt']=utils[_0x9d9c('0x16')]();queues[_0x4f6ac2['uniqueid']]['queuecallerexitreason']=_0x4f6ac2[_0x9d9c('0x27')][_0x9d9c('0x28')]();utils['info'](util[_0x9d9c('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4f6ac2['uniqueid'],queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x1f')],_0x4f6ac2[_0x9d9c('0x27')],queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x7')]));writeDB(queues[_0x4f6ac2['uniqueid']]);}}else if(!_[_0x9d9c('0x18')](_0x4f6ac2[_0x9d9c('0x23')][_0x9d9c('0x29')])){if(!_['isNil'](queues[_0x4f6ac2[_0x9d9c('0x4')]])&&!queues[_0x4f6ac2[_0x9d9c('0x4')]]['queuecallerabandon']){queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x19')]=![];queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x26')]=null;queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x1a')]=!![];queues[_0x4f6ac2['uniqueid']][_0x9d9c('0x2a')]=utils[_0x9d9c('0x16')]();queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x7')]=_0x9d9c('0x2b');utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')](_0x9d9c('0x2c'),_0x4f6ac2[_0x9d9c('0x4')],queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x1f')],_0x4f6ac2[_0x9d9c('0x27')],queues[_0x4f6ac2[_0x9d9c('0x4')]][_0x9d9c('0x7')]));}}}catch(_0x4b7085){utils[_0x9d9c('0x17')](util[_0x9d9c('0x12')]('[%s][queues][varset]',_0x4f6ac2[_0x9d9c('0x4')]),_0x4b7085);}};exports['queuecallerabandon']=function(_0x5ea84a){try{if(!_[_0x9d9c('0x18')](queues[_0x5ea84a[_0x9d9c('0x4')]])){utils[_0x9d9c('0xf')](util[_0x9d9c('0x12')](_0x9d9c('0x2d'),_0x5ea84a[_0x9d9c('0x4')]),_0x5ea84a);queues[_0x5ea84a[_0x9d9c('0x4')]][_0x9d9c('0x1a')]=![];queues[_0x5ea84a[_0x9d9c('0x4')]][_0x9d9c('0x2a')]=null;queues[_0x5ea84a[_0x9d9c('0x4')]]['queuecallerabandon']=!![];queues[_0x5ea84a['uniqueid']][_0x9d9c('0x26')]=utils[_0x9d9c('0x16')]();queues[_0x5ea84a[_0x9d9c('0x4')]]['queuecallerexitreason']=_0x9d9c('0x2e');utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')](_0x9d9c('0x2f'),_0x5ea84a[_0x9d9c('0x4')],queues[_0x5ea84a[_0x9d9c('0x4')]][_0x9d9c('0x1f')],queues[_0x5ea84a[_0x9d9c('0x4')]][_0x9d9c('0x7')]));}}catch(_0x4b3556){utils[_0x9d9c('0x17')](util['format'](_0x9d9c('0x2d'),_0x5ea84a[_0x9d9c('0x4')]),_0x4b3556);}};exports[_0x9d9c('0x30')]=function(_0x591281){try{if(!_[_0x9d9c('0x18')](queues[_0x591281[_0x9d9c('0x4')]])){utils[_0x9d9c('0xf')](util[_0x9d9c('0x12')](_0x9d9c('0x31'),_0x591281[_0x9d9c('0x4')]),_0x591281);utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x591281[_0x9d9c('0x4')],queues[_0x591281[_0x9d9c('0x4')]]['name'],_0x591281[_0x9d9c('0x32')],_0x591281[_0x9d9c('0x33')]));queues[_0x591281['uniqueid']][_0x9d9c('0x30')]=!![];queues[_0x591281[_0x9d9c('0x4')]]['queuecallerleaveAt']=utils[_0x9d9c('0x16')]();queues[_0x591281['uniqueid']][_0x9d9c('0x34')]=utils[_0x9d9c('0x35')](queues[_0x591281[_0x9d9c('0x4')]]['queuecallerleaveAt'],queues[_0x591281[_0x9d9c('0x4')]][_0x9d9c('0x36')]);queues[_0x591281[_0x9d9c('0x4')]]['position']=_0x591281[_0x9d9c('0x14')];queues[_0x591281[_0x9d9c('0x4')]][_0x9d9c('0x37')]=_0x591281['count'];queues[_0x591281[_0x9d9c('0x4')]][_0x9d9c('0x32')]=_0x591281['connectedlinenum'];queues[_0x591281[_0x9d9c('0x4')]][_0x9d9c('0x33')]=_0x591281[_0x9d9c('0x33')];}}catch(_0x2e3313){utils[_0x9d9c('0x17')](util[_0x9d9c('0x12')](_0x9d9c('0x31'),_0x591281[_0x9d9c('0x4')]),_0x2e3313);}};exports[_0x9d9c('0x38')]=function(_0x7e664f){try{if(!_[_0x9d9c('0x18')](queues[_0x7e664f[_0x9d9c('0x4')]])){utils[_0x9d9c('0xf')](util[_0x9d9c('0x12')](_0x9d9c('0x39'),_0x7e664f[_0x9d9c('0x4')]),_0x7e664f);utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')](_0x9d9c('0x3a'),_0x7e664f[_0x9d9c('0x4')],queues[_0x7e664f[_0x9d9c('0x4')]][_0x9d9c('0x1f')],_0x7e664f[_0x9d9c('0x3b')],_0x7e664f[_0x9d9c('0x3c')]));queues[_0x7e664f[_0x9d9c('0x4')]][_0x9d9c('0x19')]=![];queues[_0x7e664f['uniqueid']][_0x9d9c('0x19')]=![];queues[_0x7e664f[_0x9d9c('0x4')]][_0x9d9c('0x26')]=null;queues[_0x7e664f[_0x9d9c('0x4')]][_0x9d9c('0x1a')]=![];queues[_0x7e664f['uniqueid']][_0x9d9c('0x7')]=null;queues[_0x7e664f['uniqueid']][_0x9d9c('0x2a')]=null;queues[_0x7e664f[_0x9d9c('0x4')]]['assigned']=!![];queues[_0x7e664f['uniqueid']][_0x9d9c('0x6')]=_0x7e664f['destaccountcode'];queues[_0x7e664f[_0x9d9c('0x4')]][_0x9d9c('0x3d')]=_0x7e664f[_0x9d9c('0x3b')];}}catch(_0x47c04a){utils[_0x9d9c('0x17')](util[_0x9d9c('0x12')](_0x9d9c('0x39'),_0x7e664f[_0x9d9c('0x4')]),_0x47c04a);}};exports[_0x9d9c('0x3e')]=function(_0x98f522){try{if(!_['isNil'](queues[_0x98f522[_0x9d9c('0x4')]])){if(queues[_0x98f522[_0x9d9c('0x4')]]['queuecallerleaveAt']){utils[_0x9d9c('0xf')](util[_0x9d9c('0x12')]('[%s][queues][agentcomplete]',_0x98f522[_0x9d9c('0x4')]),_0x98f522);queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x19')]=![];queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x19')]=![];queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x26')]=null;queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x1a')]=![];queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x2a')]=null;queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x3f')]=!![];queues[_0x98f522[_0x9d9c('0x4')]]['lastAssignedTo']=_0x98f522['membername'];queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x1b')]=!![];queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x1c')]=utils[_0x9d9c('0x16')]();if(_0x98f522[_0x9d9c('0x40')]=='transfer'){if(!queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x41')]){queues[_0x98f522['uniqueid']][_0x9d9c('0x7')]=_0x9d9c('0x42');}}else{queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x7')]='COMPLETEDBY'+_0x98f522[_0x9d9c('0x40')]['toUpperCase']();}utils['info'](util['format'](_0x9d9c('0x43'),_0x98f522[_0x9d9c('0x4')],queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x1f')],_0x98f522[_0x9d9c('0x3b')],queues[_0x98f522[_0x9d9c('0x4')]][_0x9d9c('0x7')]));writeDB(queues[_0x98f522[_0x9d9c('0x4')]]);}}}catch(_0x5b5908){utils[_0x9d9c('0x17')](util['format'](_0x9d9c('0x44'),_0x98f522['uniqueid']),_0x5b5908);}};exports['blindtransfer']=function(_0x4ee947){try{if(!_[_0x9d9c('0x18')](queues[_0x4ee947['transfereeuniqueid']])){utils[_0x9d9c('0xf')](util['format'](_0x9d9c('0x45'),_0x4ee947[_0x9d9c('0x4')]),_0x4ee947);queues[_0x4ee947[_0x9d9c('0x46')]][_0x9d9c('0x41')]=!![];queues[_0x4ee947['transfereeuniqueid']][_0x9d9c('0x47')]=_0x9d9c('0x48');queues[_0x4ee947['transfereeuniqueid']]['transferexten']=_0x4ee947[_0x9d9c('0x49')];queues[_0x4ee947[_0x9d9c('0x46')]]['transferuniqueid']=_0x4ee947['transfereeuniqueid'];queues[_0x4ee947[_0x9d9c('0x46')]][_0x9d9c('0x7')]='BLINDTRANSFER';utils['info'](util[_0x9d9c('0x12')](_0x9d9c('0x4a'),_0x4ee947[_0x9d9c('0x4')],queues[_0x4ee947[_0x9d9c('0x46')]][_0x9d9c('0x1f')],_0x4ee947[_0x9d9c('0x46')],_0x4ee947['extension']));}}catch(_0x5a332e){utils[_0x9d9c('0x17')](util['format']('[%s][queues][blindtransfer]',_0x4ee947['uniqueid']),_0x5a332e);}};exports[_0x9d9c('0x4b')]=function(_0x4c7776){try{utils[_0x9d9c('0xf')](util[_0x9d9c('0x12')](_0x9d9c('0x4c'),_0x4c7776['origtransfereruniqueid']),_0x4c7776);if(_0x4c7776[_0x9d9c('0x4d')]==_0x4c7776['origtransfererlinkedid']){if(!_[_0x9d9c('0x18')](queues[_0x4c7776[_0x9d9c('0x4e')]])){utils['info'](util['format'](_0x9d9c('0x4f'),_0x4c7776['origtransfereruniqueid'],queues[_0x4c7776[_0x9d9c('0x4e')]][_0x9d9c('0x1f')],_0x4c7776['origtransfererexten']));queues[_0x4c7776[_0x9d9c('0x4e')]]['transfer']=!![];queues[_0x4c7776[_0x9d9c('0x4e')]][_0x9d9c('0x47')]=_0x9d9c('0x50');queues[_0x4c7776[_0x9d9c('0x4e')]][_0x9d9c('0x51')]=_0x4c7776[_0x9d9c('0x52')];queues[_0x4c7776[_0x9d9c('0x4e')]]['transferuniqueid']=_0x4c7776['origtransfereruniqueid'];queues[_0x4c7776['secondtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x9d9c('0x18')](queues[_0x4c7776['origtransfererlinkedid']])){if(_0x4c7776[_0x9d9c('0x53')]&&queues[_0x4c7776['transfereelinkedid']]){queues[_0x4c7776[_0x9d9c('0x53')]][_0x9d9c('0x20')]=0x1;queues[_0x4c7776['transfereeuniqueid']]=_[_0x9d9c('0x54')](queues[_0x4c7776['transfereelinkedid']]);queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0xd')]=_0x4c7776[_0x9d9c('0x55')];queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0x20')]=0x2;queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0x56')]=queues[_0x4c7776[_0x9d9c('0x4e')]][_0x9d9c('0x56')];queues[_0x4c7776[_0x9d9c('0x46')]]['calleridname']=queues[_0x4c7776[_0x9d9c('0x4e')]][_0x9d9c('0x57')];queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0x36')]=utils['now']();queues[_0x4c7776['transfereeuniqueid']][_0x9d9c('0x58')]=utils[_0x9d9c('0x16')]();queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0x34')]=0x0;queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0x59')]=0x0;utils['info'](util[_0x9d9c('0x12')](_0x9d9c('0x5a'),_0x4c7776['origtransfereruniqueid'],queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0x1f')],queues[_0x4c7776['transfereeuniqueid']][_0x9d9c('0x56')],queues[_0x4c7776[_0x9d9c('0x46')]][_0x9d9c('0x57')]));}else{utils['info'](util[_0x9d9c('0x12')](_0x9d9c('0x5b'),_0x4c7776['origtransfereruniqueid'],queues[_0x4c7776[_0x9d9c('0x5c')]]['name'],_0x4c7776[_0x9d9c('0x4e')]));queues[_0x4c7776[_0x9d9c('0x5c')]][_0x9d9c('0xd')]=_0x4c7776[_0x9d9c('0x4e')];}}}else if(_0x4c7776[_0x9d9c('0x5d')]==_0x4c7776[_0x9d9c('0x4e')]){if(!_['isNil'](queues[_0x4c7776[_0x9d9c('0x5c')]])){utils['info'](util[_0x9d9c('0x12')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4c7776[_0x9d9c('0x4d')],queues[_0x4c7776[_0x9d9c('0x5c')]][_0x9d9c('0x1f')],_0x4c7776[_0x9d9c('0x5d')],_0x4c7776[_0x9d9c('0x5e')]));queues[_0x4c7776[_0x9d9c('0x5c')]][_0x9d9c('0x41')]=!![];queues[_0x4c7776['origtransfererlinkedid']][_0x9d9c('0x47')]=_0x9d9c('0x50');queues[_0x4c7776[_0x9d9c('0x5c')]][_0x9d9c('0x51')]=_0x4c7776[_0x9d9c('0x5e')];queues[_0x4c7776[_0x9d9c('0x5c')]]['transferuniqueid']=_0x4c7776[_0x9d9c('0x5d')];queues[_0x4c7776[_0x9d9c('0x5c')]][_0x9d9c('0x7')]=_0x9d9c('0x5f');}if(!_[_0x9d9c('0x18')](queues[_0x4c7776[_0x9d9c('0x4e')]])){if(_0x4c7776['transfertargetlinkedid']&&queues[_0x4c7776[_0x9d9c('0x60')]]){queues[_0x4c7776[_0x9d9c('0x60')]][_0x9d9c('0x20')]=0x1;queues[_0x4c7776[_0x9d9c('0x55')]]=_['clone'](queues[_0x4c7776[_0x9d9c('0x60')]]);queues[_0x4c7776[_0x9d9c('0x55')]]['transfereduniqueid']=_0x4c7776[_0x9d9c('0x55')];queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0x20')]=0x2;queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0x56')]=queues[_0x4c7776[_0x9d9c('0x5c')]]['calleridnum'];queues[_0x4c7776['transfertargetuniqueid']][_0x9d9c('0x57')]=queues[_0x4c7776[_0x9d9c('0x5c')]][_0x9d9c('0x57')];queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0x36')]=utils[_0x9d9c('0x16')]();queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0x58')]=utils[_0x9d9c('0x16')]();queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0x34')]=0x0;queues[_0x4c7776['transfertargetuniqueid']][_0x9d9c('0x59')]=0x0;utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x4c7776['origtransfereruniqueid'],queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0x1f')],queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0xd')],queues[_0x4c7776[_0x9d9c('0x55')]][_0x9d9c('0x56')],queues[_0x4c7776[_0x9d9c('0x55')]]['calleridname']));}else{utils['info'](util[_0x9d9c('0x12')](_0x9d9c('0x5b'),_0x4c7776[_0x9d9c('0x4d')],queues[_0x4c7776[_0x9d9c('0x4e')]][_0x9d9c('0x1f')],_0x4c7776[_0x9d9c('0x5c')]));queues[_0x4c7776[_0x9d9c('0x4e')]][_0x9d9c('0xd')]=_0x4c7776[_0x9d9c('0x5c')];}}}}catch(_0x228dd0){utils[_0x9d9c('0x17')](util['format'](_0x9d9c('0x4c'),_0x4c7776['origtransfereruniqueid']),_0x228dd0);}};exports[_0x9d9c('0x61')]=function(_0x43e621){try{if(!_[_0x9d9c('0x18')](queues[_0x43e621['uniqueid']])){utils['debug'](util[_0x9d9c('0x12')](_0x9d9c('0x62'),_0x43e621[_0x9d9c('0x4')]),_0x43e621);queues[_0x43e621[_0x9d9c('0x4')]]['musiconholdstartAt']=utils[_0x9d9c('0x16')]();utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x43e621['uniqueid'],queues[_0x43e621[_0x9d9c('0x4')]][_0x9d9c('0x1f')],queues[_0x43e621[_0x9d9c('0x4')]][_0x9d9c('0x63')]));}}catch(_0x3f550f){utils['error'](util[_0x9d9c('0x12')](_0x9d9c('0x62'),_0x43e621[_0x9d9c('0x4')]),_0x3f550f);}};exports[_0x9d9c('0x64')]=function(_0x20c3a8){try{if(!_['isNil'](queues[_0x20c3a8[_0x9d9c('0x4')]])){if(!_[_0x9d9c('0x18')](queues[_0x20c3a8['uniqueid']][_0x9d9c('0x63')])){utils['debug'](util[_0x9d9c('0x12')]('[%s][queues][musiconholdstop]',_0x20c3a8[_0x9d9c('0x4')]),_0x20c3a8);queues[_0x20c3a8[_0x9d9c('0x4')]][_0x9d9c('0x59')]+=utils[_0x9d9c('0x35')](utils['now'](),queues[_0x20c3a8['uniqueid']][_0x9d9c('0x63')]);utils[_0x9d9c('0x11')](util[_0x9d9c('0x12')](_0x9d9c('0x65'),_0x20c3a8[_0x9d9c('0x4')],queues[_0x20c3a8[_0x9d9c('0x4')]][_0x9d9c('0x1f')],queues[_0x20c3a8[_0x9d9c('0x4')]][_0x9d9c('0x59')]));delete queues[_0x20c3a8[_0x9d9c('0x4')]][_0x9d9c('0x63')];}}}catch(_0x1987e6){utils['error'](util[_0x9d9c('0x12')]('[%s][queues][musiconholdstop]',_0x20c3a8['uniqueid']),_0x1987e6);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5061863..323ef22 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 _0x54d6=['newchannel','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','forEach','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x54d6,0x1a1));var _0x654d=function(_0x158074,_0x597069){_0x158074=_0x158074-0x0;var _0x298d3f=_0x54d6[_0x158074];return _0x298d3f;};'use strict';var _=require(_0x654d('0x0'));var util=require(_0x654d('0x1'));var utils=require(_0x654d('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x51a89c){var _0x201c8d;utils[_0x654d('0x3')](util[_0x654d('0x4')]('[%s][recordings][writeDB]',_0x51a89c['uniqueid']));if(transfers['blinds'][_0x51a89c[_0x654d('0x5')]]){_0x201c8d=_0x51a89c[_0x654d('0x5')];_0x51a89c['uniqueid']=transfers[_0x654d('0x6')][_0x51a89c['uniqueid']][_0x654d('0x7')];}if(_0x51a89c[_0x654d('0x8')]){utils[_0x654d('0x9')](_0x51a89c[_0x654d('0x8')])['then'](function(_0x43d86b){if(_0x43d86b){_0x51a89c[_0x654d('0xa')]=_0x43d86b[_0x654d('0xb')];_0x51a89c[_0x654d('0xc')]=_0x43d86b['id'];}utils[_0x654d('0xd')](_0x654d('0xe'),_0x51a89c);});}else{utils[_0x654d('0xd')]('CreateVoiceRecording',_0x51a89c);}if(_0x201c8d)delete transfers[_0x654d('0x6')][_0x201c8d];}exports[_0x654d('0xf')]=function(_0x3b20b2){try{utils['debug'](util[_0x654d('0x4')](_0x654d('0x10'),_0x3b20b2['uniqueid']),_0x3b20b2);if(_0x3b20b2[_0x654d('0x5')]==_0x3b20b2['linkedid']){utils[_0x654d('0x3')](util[_0x654d('0x4')](_0x654d('0x11'),_0x3b20b2[_0x654d('0x5')],_0x3b20b2[_0x654d('0x12')],_0x3b20b2['exten']));recordings[_0x3b20b2[_0x654d('0x5')]]={'uniqueid':_0x3b20b2[_0x654d('0x5')],'accountcode':_0x3b20b2[_0x654d('0x8')],'exten':_0x3b20b2['exten'],'context':_0x3b20b2['context'],'channel':_0x3b20b2[_0x654d('0x13')],'monitors':[]};}}catch(_0x26a5f1){utils[_0x654d('0x14')](util['format'](_0x654d('0x10'),_0x3b20b2[_0x654d('0x5')]),_0x26a5f1);}};exports[_0x654d('0x15')]=function(_0x17e0b6){try{utils[_0x654d('0x16')](util[_0x654d('0x4')](_0x654d('0x17'),_0x17e0b6[_0x654d('0x5')]),_0x17e0b6);if(!_[_0x654d('0x18')](recordings[_0x17e0b6[_0x654d('0x5')]])&&_0x17e0b6[_0x654d('0x19')]==0x6){utils[_0x654d('0x3')](util[_0x654d('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x17e0b6[_0x654d('0x5')],_0x17e0b6[_0x654d('0x12')],_0x17e0b6['channel']));}else if(!_[_0x654d('0x18')](recordings[_0x17e0b6[_0x654d('0x1a')]])&&_0x17e0b6[_0x654d('0x19')]==0x6&&_0x17e0b6['context']!=_0x654d('0x1b')){utils[_0x654d('0x3')](util[_0x654d('0x4')](_0x654d('0x1c'),_0x17e0b6['uniqueid'],_0x17e0b6['linkedid'],_0x17e0b6['context'],_0x17e0b6['channel']));recordings[_0x17e0b6['linkedid']][_0x654d('0x8')]=_0x17e0b6[_0x654d('0x8')];}}catch(_0x183d60){utils['error'](util['format'](_0x654d('0x17'),_0x17e0b6['uniqueid']),_0x183d60);}};exports[_0x654d('0x1d')]=function(_0x5b2aab){try{if(!_['isNil'](_0x5b2aab[_0x654d('0x1e')])&&!_[_0x654d('0x18')](_0x5b2aab[_0x654d('0x1e')][_0x654d('0x1f')])){utils['debug'](util[_0x654d('0x4')]('[%s][recordings][varset]',_0x5b2aab[_0x654d('0x5')]),_0x5b2aab);utils[_0x654d('0x3')](util[_0x654d('0x4')](_0x654d('0x20'),_0x5b2aab['uniqueid'],_0x5b2aab['variable'],_0x5b2aab[_0x654d('0x21')]));if(_[_0x654d('0x22')](_0x5b2aab[_0x654d('0x21')],_0x654d('0x23'))){_0x5b2aab[_0x654d('0x21')]=_0x5b2aab[_0x654d('0x21')][_0x654d('0x24')](_0x654d('0x23'),_0x654d('0x25'));}if(recordings[_0x5b2aab['linkedid']]){var _0x160ccd=_['find'](recordings[_0x5b2aab[_0x654d('0x1a')]]['monitors'],{'value':_0x5b2aab[_0x654d('0x21')]});if(_[_0x654d('0x18')](_0x160ccd)){recordings[_0x5b2aab[_0x654d('0x1a')]][_0x654d('0x26')][_0x654d('0x27')]({'value':_0x5b2aab[_0x654d('0x21')]});}}}}catch(_0x5215f7){utils[_0x654d('0x14')](util['format'](_0x654d('0x28'),_0x5b2aab[_0x654d('0x5')]),_0x5215f7);}};exports[_0x654d('0x29')]=function(_0x478b6d){try{if(!_['isNil'](recordings[_0x478b6d[_0x654d('0x5')]])){utils[_0x654d('0x16')](util[_0x654d('0x4')](_0x654d('0x2a'),_0x478b6d[_0x654d('0x5')]),_0x478b6d);utils[_0x654d('0x3')](util[_0x654d('0x4')](_0x654d('0x2b'),_0x478b6d[_0x654d('0x5')],_0x478b6d['calleridnum'],_0x478b6d[_0x654d('0x2c')],_0x478b6d[_0x654d('0x2d')]));recordings[_0x478b6d[_0x654d('0x5')]][_0x654d('0x2e')]=_0x478b6d[_0x654d('0x2e')];recordings[_0x478b6d['uniqueid']][_0x654d('0x2c')]=_0x478b6d['calleridname'];recordings[_0x478b6d[_0x654d('0x5')]][_0x654d('0x2f')]=_0x478b6d['connectedlinenum'];recordings[_0x478b6d[_0x654d('0x5')]]['connectedlinename']=_0x478b6d[_0x654d('0x30')];if(recordings[_0x478b6d[_0x654d('0x5')]]['type']=='outbound'&&recordings[_0x478b6d[_0x654d('0x5')]][_0x654d('0x8')]){recordings[_0x478b6d[_0x654d('0x5')]][_0x654d('0x2f')]=recordings[_0x478b6d[_0x654d('0x5')]][_0x654d('0x8')];recordings[_0x478b6d['uniqueid']][_0x654d('0x30')]='';}recordings[_0x478b6d[_0x654d('0x5')]][_0x654d('0x26')][_0x654d('0x31')](function(_0x3df674){var _0x5ad855=_['clone'](recordings[_0x478b6d['uniqueid']]);_0x5ad855['value']=_0x3df674['value'];writeDB(_0x5ad855);});delete recordings[_0x478b6d[_0x654d('0x5')]];}}catch(_0x259634){utils[_0x654d('0x14')](util['format'](_0x654d('0x2a'),_0x478b6d[_0x654d('0x5')]),_0x259634);}};exports['newexten']=function(_0x3cbe3b){try{if(!_[_0x654d('0x18')](recordings[_0x3cbe3b[_0x654d('0x5')]])){utils[_0x654d('0x16')](util['format'](_0x654d('0x32'),_0x3cbe3b[_0x654d('0x5')]),_0x3cbe3b);utils[_0x654d('0x3')](util[_0x654d('0x4')](_0x654d('0x33'),_0x3cbe3b[_0x654d('0x5')],_0x3cbe3b[_0x654d('0x34')],_0x3cbe3b[_0x654d('0x35')]));if(_0x3cbe3b['application'][_0x654d('0x36')]()==_0x654d('0x37')&&_[_0x654d('0x38')](_0x3cbe3b[_0x654d('0x35')][_0x654d('0x36')](),_0x654d('0x39'))){var _0xda2945=_0x3cbe3b[_0x654d('0x35')][_0x654d('0x3a')]('=');var _0xa9572e=_0xda2945[0x0][_0x654d('0x3b')](_0xda2945[0x0][_0x654d('0x3c')]('(')+0x1,_0xda2945[0x0][_0x654d('0x3c')](')'));var _0x5066e7=_0xda2945[0x1];recordings[_0x3cbe3b[_0x654d('0x5')]][_0xa9572e]=_0x5066e7;}}}catch(_0x4abbff){utils['error'](util[_0x654d('0x4')](_0x654d('0x32'),_0x3cbe3b[_0x654d('0x5')]),_0x4abbff);}};exports[_0x654d('0x3d')]=function(_0x3fe06b){try{if(!_[_0x654d('0x18')](recordings[_0x3fe06b['uniqueid']])){utils[_0x654d('0x16')](util[_0x654d('0x4')](_0x654d('0x3e'),_0x3fe06b[_0x654d('0x5')]),_0x3fe06b);utils[_0x654d('0x3')](util[_0x654d('0x4')](_0x654d('0x3f'),_0x3fe06b[_0x654d('0x5')],_0x3fe06b[_0x654d('0x40')]));recordings[_0x3fe06b[_0x654d('0x5')]][_0x654d('0x40')]=_0x3fe06b['queue'];}}catch(_0x5e5748){utils[_0x654d('0x14')](util[_0x654d('0x4')](_0x654d('0x3e'),_0x3fe06b[_0x654d('0x5')]),_0x5e5748);}};exports['blindtransfer']=function(_0x3cb022){try{utils['debug'](util[_0x654d('0x4')](_0x654d('0x41'),_0x3cb022['uniqueid']),_0x3cb022);utils[_0x654d('0x3')](util['format'](_0x654d('0x42'),_0x3cb022[_0x654d('0x5')],_0x3cb022['transferercalleridnum'],_0x3cb022[_0x654d('0x43')],_0x3cb022[_0x654d('0x44')],_0x3cb022[_0x654d('0x45')]));if(recordings[_0x3cb022['transfereruniqueid']]&&transfers['blinds'][_0x3cb022['transfereruniqueid']]){transfers[_0x654d('0x6')][_0x3cb022[_0x654d('0x46')]][_0x654d('0x47')]=!![];}}catch(_0x544bb3){utils['error'](util[_0x654d('0x4')](_0x654d('0x41'),_0x3cb022['uniqueid']),_0x544bb3);}}; \ No newline at end of file +var _0xa2d9=['queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','[%s][recordings][writeDB]','uniqueid','blinds','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','format','channelstate','info','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','accountcode','[%s][recordings][newstate]','varset','variable','isNil','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','monitors','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','split','lastIndexOf','[%s][recordings][newexten]'];(function(_0x29b848,_0x4daf42){var _0x1603ca=function(_0xe01238){while(--_0xe01238){_0x29b848['push'](_0x29b848['shift']());}};_0x1603ca(++_0x4daf42);}(_0xa2d9,0x9e));var _0x9a2d=function(_0x58ad5c,_0x553b93){_0x58ad5c=_0x58ad5c-0x0;var _0x2005d3=_0xa2d9[_0x58ad5c];return _0x2005d3;};'use strict';var _=require(_0x9a2d('0x0'));var util=require('util');var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x3cb9b6){var _0x1e5be9;utils['info'](util['format'](_0x9a2d('0x1'),_0x3cb9b6[_0x9a2d('0x2')]));if(transfers['blinds'][_0x3cb9b6[_0x9a2d('0x2')]]){_0x1e5be9=_0x3cb9b6[_0x9a2d('0x2')];_0x3cb9b6[_0x9a2d('0x2')]=transfers[_0x9a2d('0x3')][_0x3cb9b6['uniqueid']]['transfereeuniqueid'];}if(_0x3cb9b6['accountcode']){utils[_0x9a2d('0x4')](_0x3cb9b6['accountcode'])[_0x9a2d('0x5')](function(_0x5ec210){if(_0x5ec210){_0x3cb9b6[_0x9a2d('0x6')]=_0x5ec210[_0x9a2d('0x7')];_0x3cb9b6[_0x9a2d('0x8')]=_0x5ec210['id'];}utils['request']('CreateVoiceRecording',_0x3cb9b6);});}else{utils[_0x9a2d('0x9')](_0x9a2d('0xa'),_0x3cb9b6);}if(_0x1e5be9)delete transfers[_0x9a2d('0x3')][_0x1e5be9];}exports[_0x9a2d('0xb')]=function(_0x267910){try{utils[_0x9a2d('0xc')](util['format'](_0x9a2d('0xd'),_0x267910['uniqueid']),_0x267910);if(_0x267910['uniqueid']==_0x267910[_0x9a2d('0xe')]){utils['info'](util['format'](_0x9a2d('0xf'),_0x267910['uniqueid'],_0x267910[_0x9a2d('0x10')],_0x267910[_0x9a2d('0x11')]));recordings[_0x267910[_0x9a2d('0x2')]]={'uniqueid':_0x267910['uniqueid'],'accountcode':_0x267910['accountcode'],'exten':_0x267910['exten'],'context':_0x267910[_0x9a2d('0x10')],'channel':_0x267910['channel'],'monitors':[]};}}catch(_0x325229){utils[_0x9a2d('0x12')](util['format'](_0x9a2d('0xd'),_0x267910[_0x9a2d('0x2')]),_0x325229);}};exports[_0x9a2d('0x13')]=function(_0x2e41da){try{utils[_0x9a2d('0xc')](util[_0x9a2d('0x14')]('[%s][recordings][newstate]',_0x2e41da[_0x9a2d('0x2')]),_0x2e41da);if(!_['isNil'](recordings[_0x2e41da['uniqueid']])&&_0x2e41da[_0x9a2d('0x15')]==0x6){utils[_0x9a2d('0x16')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2e41da[_0x9a2d('0x2')],_0x2e41da[_0x9a2d('0x10')],_0x2e41da['channel']));}else if(!_['isNil'](recordings[_0x2e41da[_0x9a2d('0xe')]])&&_0x2e41da[_0x9a2d('0x15')]==0x6&&_0x2e41da[_0x9a2d('0x10')]!=_0x9a2d('0x17')){utils[_0x9a2d('0x16')](util['format'](_0x9a2d('0x18'),_0x2e41da[_0x9a2d('0x2')],_0x2e41da[_0x9a2d('0xe')],_0x2e41da[_0x9a2d('0x10')],_0x2e41da[_0x9a2d('0x19')]));recordings[_0x2e41da[_0x9a2d('0xe')]]['accountcode']=_0x2e41da[_0x9a2d('0x1a')];}}catch(_0x47c055){utils[_0x9a2d('0x12')](util[_0x9a2d('0x14')](_0x9a2d('0x1b'),_0x2e41da[_0x9a2d('0x2')]),_0x47c055);}};exports[_0x9a2d('0x1c')]=function(_0x17a49e){try{if(!_['isNil'](_0x17a49e[_0x9a2d('0x1d')])&&!_[_0x9a2d('0x1e')](_0x17a49e[_0x9a2d('0x1d')][_0x9a2d('0x1f')])){utils[_0x9a2d('0xc')](util[_0x9a2d('0x14')](_0x9a2d('0x20'),_0x17a49e[_0x9a2d('0x2')]),_0x17a49e);utils['info'](util[_0x9a2d('0x14')](_0x9a2d('0x21'),_0x17a49e['uniqueid'],_0x17a49e[_0x9a2d('0x1d')],_0x17a49e[_0x9a2d('0x22')]));if(_[_0x9a2d('0x23')](_0x17a49e[_0x9a2d('0x22')],_0x9a2d('0x24'))){_0x17a49e['value']=_0x17a49e[_0x9a2d('0x22')][_0x9a2d('0x25')](_0x9a2d('0x24'),_0x9a2d('0x26'));}if(recordings[_0x17a49e[_0x9a2d('0xe')]]){var _0x1a583e=_[_0x9a2d('0x27')](recordings[_0x17a49e[_0x9a2d('0xe')]]['monitors'],{'value':_0x17a49e[_0x9a2d('0x22')]});if(_['isNil'](_0x1a583e)){recordings[_0x17a49e[_0x9a2d('0xe')]]['monitors'][_0x9a2d('0x28')]({'value':_0x17a49e[_0x9a2d('0x22')]});}}}}catch(_0x55b329){utils[_0x9a2d('0x12')](util['format'](_0x9a2d('0x20'),_0x17a49e[_0x9a2d('0x2')]),_0x55b329);}};exports['hangup']=function(_0x3f767f){try{if(!_[_0x9a2d('0x1e')](recordings[_0x3f767f[_0x9a2d('0x2')]])){utils[_0x9a2d('0xc')](util[_0x9a2d('0x14')](_0x9a2d('0x29'),_0x3f767f['uniqueid']),_0x3f767f);utils[_0x9a2d('0x16')](util[_0x9a2d('0x14')](_0x9a2d('0x2a'),_0x3f767f['uniqueid'],_0x3f767f[_0x9a2d('0x2b')],_0x3f767f[_0x9a2d('0x2c')],_0x3f767f['cause-txt']));recordings[_0x3f767f[_0x9a2d('0x2')]][_0x9a2d('0x2b')]=_0x3f767f[_0x9a2d('0x2b')];recordings[_0x3f767f[_0x9a2d('0x2')]]['calleridname']=_0x3f767f[_0x9a2d('0x2c')];recordings[_0x3f767f['uniqueid']][_0x9a2d('0x2d')]=_0x3f767f[_0x9a2d('0x2d')];recordings[_0x3f767f['uniqueid']][_0x9a2d('0x2e')]=_0x3f767f[_0x9a2d('0x2e')];if(recordings[_0x3f767f[_0x9a2d('0x2')]][_0x9a2d('0x2f')]==_0x9a2d('0x30')&&recordings[_0x3f767f['uniqueid']][_0x9a2d('0x1a')]){recordings[_0x3f767f[_0x9a2d('0x2')]][_0x9a2d('0x2d')]=recordings[_0x3f767f[_0x9a2d('0x2')]][_0x9a2d('0x1a')];recordings[_0x3f767f[_0x9a2d('0x2')]][_0x9a2d('0x2e')]='';}recordings[_0x3f767f['uniqueid']][_0x9a2d('0x31')][_0x9a2d('0x32')](function(_0xa1780c){var _0x40cf4a=_[_0x9a2d('0x33')](recordings[_0x3f767f[_0x9a2d('0x2')]]);_0x40cf4a[_0x9a2d('0x22')]=_0xa1780c[_0x9a2d('0x22')];writeDB(_0x40cf4a);});delete recordings[_0x3f767f[_0x9a2d('0x2')]];}}catch(_0x28ae72){utils[_0x9a2d('0x12')](util['format'](_0x9a2d('0x29'),_0x3f767f[_0x9a2d('0x2')]),_0x28ae72);}};exports[_0x9a2d('0x34')]=function(_0x1fff72){try{if(!_[_0x9a2d('0x1e')](recordings[_0x1fff72[_0x9a2d('0x2')]])){utils[_0x9a2d('0xc')](util['format']('[%s][recordings][newexten]',_0x1fff72[_0x9a2d('0x2')]),_0x1fff72);utils['info'](util[_0x9a2d('0x14')](_0x9a2d('0x35'),_0x1fff72['uniqueid'],_0x1fff72[_0x9a2d('0x36')],_0x1fff72[_0x9a2d('0x37')]));if(_0x1fff72[_0x9a2d('0x36')]['toLowerCase']()==_0x9a2d('0x38')&&_[_0x9a2d('0x39')](_0x1fff72['appdata']['toLowerCase'](),'cdr')){var _0x5afc44=_0x1fff72['appdata'][_0x9a2d('0x3a')]('=');var _0x95da51=_0x5afc44[0x0]['substring'](_0x5afc44[0x0][_0x9a2d('0x3b')]('(')+0x1,_0x5afc44[0x0]['lastIndexOf'](')'));var _0x3d3e4e=_0x5afc44[0x1];recordings[_0x1fff72['uniqueid']][_0x95da51]=_0x3d3e4e;}}}catch(_0x380796){utils[_0x9a2d('0x12')](util[_0x9a2d('0x14')](_0x9a2d('0x3c'),_0x1fff72['uniqueid']),_0x380796);}};exports[_0x9a2d('0x3d')]=function(_0x3e2cb8){try{if(!_[_0x9a2d('0x1e')](recordings[_0x3e2cb8[_0x9a2d('0x2')]])){utils[_0x9a2d('0xc')](util[_0x9a2d('0x14')](_0x9a2d('0x3e'),_0x3e2cb8[_0x9a2d('0x2')]),_0x3e2cb8);utils[_0x9a2d('0x16')](util[_0x9a2d('0x14')](_0x9a2d('0x3f'),_0x3e2cb8['uniqueid'],_0x3e2cb8[_0x9a2d('0x40')]));recordings[_0x3e2cb8[_0x9a2d('0x2')]]['queue']=_0x3e2cb8[_0x9a2d('0x40')];}}catch(_0x50a4af){utils[_0x9a2d('0x12')](util[_0x9a2d('0x14')](_0x9a2d('0x3e'),_0x3e2cb8[_0x9a2d('0x2')]),_0x50a4af);}};exports[_0x9a2d('0x41')]=function(_0x5732b9){try{utils[_0x9a2d('0xc')](util[_0x9a2d('0x14')](_0x9a2d('0x42'),_0x5732b9[_0x9a2d('0x2')]),_0x5732b9);utils[_0x9a2d('0x16')](util[_0x9a2d('0x14')](_0x9a2d('0x43'),_0x5732b9[_0x9a2d('0x2')],_0x5732b9[_0x9a2d('0x44')],_0x5732b9[_0x9a2d('0x45')],_0x5732b9['transfereecalleridnum'],_0x5732b9[_0x9a2d('0x46')]));if(recordings[_0x5732b9['transfereruniqueid']]&&transfers['blinds'][_0x5732b9[_0x9a2d('0x47')]]){transfers['blinds'][_0x5732b9[_0x9a2d('0x47')]][_0x9a2d('0x48')]=!![];}}catch(_0x131458){utils[_0x9a2d('0x12')](util[_0x9a2d('0x14')](_0x9a2d('0x42'),_0x5732b9['uniqueid']),_0x131458);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 639a2e2..1a68d52 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 _0x0793=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','transfereechannel','assign','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','transfertargetcalleridname','origtransfererchannel'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0793,0xe2));var _0x3079=function(_0x57e89f,_0x301ab4){_0x57e89f=_0x57e89f-0x0;var _0x41f526=_0x0793[_0x57e89f];return _0x41f526;};'use strict';var _=require('lodash');var util=require(_0x3079('0x0'));var utils=require(_0x3079('0x1'));function writeDB(_0x33a425){utils['info'](util[_0x3079('0x2')](_0x3079('0x3'),_0x33a425[_0x3079('0x4')]===_0x3079('0x5')?_0x33a425[_0x3079('0x6')]:_0x33a425['uniqueid'],_0x33a425[_0x3079('0x4')]));utils[_0x3079('0x7')]('CreateVoiceTransferReport',_0x33a425);}exports[_0x3079('0x8')]={};exports[_0x3079('0x9')]=function(_0x3fa371){try{utils[_0x3079('0xa')](util[_0x3079('0x2')](_0x3079('0xb'),_0x3fa371[_0x3079('0xc')]),_0x3fa371);utils[_0x3079('0xd')](util['format'](_0x3079('0xe'),_0x3fa371[_0x3079('0xc')],_0x3fa371[_0x3079('0xf')],_0x3fa371[_0x3079('0x10')],_0x3fa371['transfereecalleridnum'],_0x3fa371[_0x3079('0x11')]));_0x3fa371['type']=_0x3079('0x12');exports[_0x3079('0x8')][_0x3fa371[_0x3079('0x13')]]=_0x3fa371;writeDB(_0x3fa371);}catch(_0x48c4fd){utils[_0x3079('0x14')](util['format'](_0x3079('0xb'),_0x3fa371[_0x3079('0xc')]),_0x48c4fd);}};exports[_0x3079('0x15')]=function(_0x38fd85){try{utils['debug'](util[_0x3079('0x2')](_0x3079('0x16'),_0x38fd85[_0x3079('0x6')]),_0x38fd85);utils[_0x3079('0xd')](util[_0x3079('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x38fd85[_0x3079('0x6')],_0x38fd85[_0x3079('0x17')],_0x38fd85['origtransferercalleridname'],_0x38fd85['transfertargetcalleridnum'],_0x38fd85[_0x3079('0x18')]));_0x38fd85=_['assign'](_0x38fd85,{'transfererchannel':_0x38fd85[_0x3079('0x19')],'transferercalleridnum':_0x38fd85[_0x3079('0x17')],'transferercalleridname':_0x38fd85[_0x3079('0x1a')],'transfererconnectedlinenum':_0x38fd85[_0x3079('0x1b')],'transfererconnectedlinename':_0x38fd85[_0x3079('0x1c')],'transfereraccountcode':_0x38fd85[_0x3079('0x1d')],'transferercontext':_0x38fd85[_0x3079('0x1e')],'transfererexten':_0x38fd85[_0x3079('0x1f')],'transfererlinkedid':_0x38fd85['origtransfererlinkedid'],'context':_0x38fd85['origtransferercontext'],'extension':_0x38fd85[_0x3079('0x20')],'type':'attended'});if(_['isNil'](_0x38fd85[_0x3079('0x21')])){_0x38fd85=_[_0x3079('0x22')](_0x38fd85,{'transfereechannel':_0x38fd85['transfertargetchannel'],'transfereecalleridnum':_0x38fd85[_0x3079('0x23')],'transfereecalleridname':_0x38fd85[_0x3079('0x18')],'transfereeconnectedlinenum':_0x38fd85[_0x3079('0x24')],'transfereeconnectedlinename':_0x38fd85[_0x3079('0x25')],'transfereeaccountcode':_0x38fd85[_0x3079('0x26')],'transfereecontext':_0x38fd85[_0x3079('0x27')],'transfereeexten':_0x38fd85[_0x3079('0x28')],'transfereelinkedid':_0x38fd85[_0x3079('0x29')]});}writeDB(_0x38fd85);}catch(_0x2e2cc4){utils['error'](util[_0x3079('0x2')](_0x3079('0x16'),_0x38fd85[_0x3079('0x6')]),_0x2e2cc4);}}; \ No newline at end of file +var _0x1bd8=['transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil'];(function(_0x576cd5,_0x48085b){var _0x1b1bb1=function(_0x177d2b){while(--_0x177d2b){_0x576cd5['push'](_0x576cd5['shift']());}};_0x1b1bb1(++_0x48085b);}(_0x1bd8,0xe2));var _0x81bd=function(_0x479795,_0x1afcba){_0x479795=_0x479795-0x0;var _0x5f09b7=_0x1bd8[_0x479795];return _0x5f09b7;};'use strict';var _=require(_0x81bd('0x0'));var util=require(_0x81bd('0x1'));var utils=require(_0x81bd('0x2'));function writeDB(_0x3459a3){utils[_0x81bd('0x3')](util[_0x81bd('0x4')](_0x81bd('0x5'),_0x3459a3[_0x81bd('0x6')]===_0x81bd('0x7')?_0x3459a3[_0x81bd('0x8')]:_0x3459a3[_0x81bd('0x9')],_0x3459a3[_0x81bd('0x6')]));utils[_0x81bd('0xa')](_0x81bd('0xb'),_0x3459a3);}exports['blinds']={};exports['blindtransfer']=function(_0x2ac9c7){try{utils[_0x81bd('0xc')](util['format']('[%s][transfers][blindtransfer]',_0x2ac9c7[_0x81bd('0x9')]),_0x2ac9c7);utils['info'](util['format'](_0x81bd('0xd'),_0x2ac9c7[_0x81bd('0x9')],_0x2ac9c7['transferercalleridnum'],_0x2ac9c7[_0x81bd('0xe')],_0x2ac9c7[_0x81bd('0xf')],_0x2ac9c7[_0x81bd('0x10')]));_0x2ac9c7[_0x81bd('0x6')]=_0x81bd('0x11');exports['blinds'][_0x2ac9c7[_0x81bd('0x12')]]=_0x2ac9c7;writeDB(_0x2ac9c7);}catch(_0x2fb7f1){utils[_0x81bd('0x13')](util['format']('[%s][transfers][blindtransfer]',_0x2ac9c7[_0x81bd('0x9')]),_0x2fb7f1);}};exports[_0x81bd('0x14')]=function(_0x59e09e){try{utils[_0x81bd('0xc')](util['format'](_0x81bd('0x15'),_0x59e09e[_0x81bd('0x8')]),_0x59e09e);utils[_0x81bd('0x3')](util[_0x81bd('0x4')](_0x81bd('0x16'),_0x59e09e['origtransfereruniqueid'],_0x59e09e[_0x81bd('0x17')],_0x59e09e[_0x81bd('0x18')],_0x59e09e[_0x81bd('0x19')],_0x59e09e[_0x81bd('0x1a')]));_0x59e09e=_[_0x81bd('0x1b')](_0x59e09e,{'transfererchannel':_0x59e09e[_0x81bd('0x1c')],'transferercalleridnum':_0x59e09e[_0x81bd('0x17')],'transferercalleridname':_0x59e09e[_0x81bd('0x18')],'transfererconnectedlinenum':_0x59e09e[_0x81bd('0x1d')],'transfererconnectedlinename':_0x59e09e[_0x81bd('0x1e')],'transfereraccountcode':_0x59e09e[_0x81bd('0x1f')],'transferercontext':_0x59e09e[_0x81bd('0x20')],'transfererexten':_0x59e09e[_0x81bd('0x21')],'transfererlinkedid':_0x59e09e[_0x81bd('0x22')],'context':_0x59e09e[_0x81bd('0x23')],'extension':_0x59e09e[_0x81bd('0x24')],'type':'attended'});if(_[_0x81bd('0x25')](_0x59e09e[_0x81bd('0x26')])){_0x59e09e=_[_0x81bd('0x1b')](_0x59e09e,{'transfereechannel':_0x59e09e[_0x81bd('0x27')],'transfereecalleridnum':_0x59e09e[_0x81bd('0x19')],'transfereecalleridname':_0x59e09e[_0x81bd('0x1a')],'transfereeconnectedlinenum':_0x59e09e[_0x81bd('0x28')],'transfereeconnectedlinename':_0x59e09e[_0x81bd('0x29')],'transfereeaccountcode':_0x59e09e[_0x81bd('0x2a')],'transfereecontext':_0x59e09e['transfertargetcontext'],'transfereeexten':_0x59e09e['transfertargetexten'],'transfereelinkedid':_0x59e09e[_0x81bd('0x2b')]});}writeDB(_0x59e09e);}catch(_0x1bc681){utils['error'](util[_0x81bd('0x4')](_0x81bd('0x15'),_0x59e09e[_0x81bd('0x8')]),_0x1bc681);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 5406f3a..03f4202 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 _0x218e=['notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found'];(function(_0x22658d,_0x328f29){var _0x49a56b=function(_0x27b3a7){while(--_0x27b3a7){_0x22658d['push'](_0x22658d['shift']());}};_0x49a56b(++_0x328f29);}(_0x218e,0x1c8));var _0xe218=function(_0x14660c,_0x5f488e){_0x14660c=_0x14660c-0x0;var _0x285942=_0x218e[_0x14660c];return _0x285942;};'use strict';var BPromise=require(_0xe218('0x0'));var jayson=require(_0xe218('0x1'));var moment=require(_0xe218('0x2'));var util=require(_0xe218('0x3'));var client=jayson[_0xe218('0x4')][_0xe218('0x5')]({'port':0x2329});var logger=require(_0xe218('0x6'))(_0xe218('0x7'));exports[_0xe218('0x8')]=function(_0x593b94,_0x35f46f){logger[_0xe218('0x8')](_0x593b94,_0x35f46f?util[_0xe218('0x9')](_0x35f46f,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4debb4,_0x24df5b){logger[_0xe218('0xa')](_0x4debb4,_0x24df5b?util[_0xe218('0x9')](_0x24df5b,{'showHidden':![],'depth':null}):'');};exports[_0xe218('0xb')]=function(_0x3cec3e,_0x278ee8){logger['error'](_0x3cec3e,_0x278ee8?util[_0xe218('0x9')](_0x278ee8,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x28eb79,_0x198ba8){return client[_0xe218('0xc')](_0x28eb79,{'body':_0x198ba8})['then'](function(_0x2522ee){logger[_0xe218('0xa')](_0xe218('0xd'),_0x28eb79,_0x2522ee?util[_0xe218('0x9')](_0x2522ee,{'showHidden':![],'depth':null}):'');})[_0xe218('0xe')](function(_0x46ba70){logger[_0xe218('0xb')]('[utils][request]\x20name:%s',_0x28eb79,_0x46ba70?util[_0xe218('0x9')](_0x46ba70,{'showHidden':![],'depth':null}):'');});};function getUser(_0x41a5a8){return client[_0xe218('0xc')](_0xe218('0xf'),{'options':{'raw':!![],'attributes':['id','internal',_0xe218('0x10'),_0xe218('0x11')],'where':_0x41a5a8,'limit':0x1}})[_0xe218('0x12')](function(_0xa0f66b){logger[_0xe218('0xa')](_0xe218('0x13'),JSON[_0xe218('0x14')](_0x41a5a8),_0xa0f66b?util[_0xe218('0x9')](_0xa0f66b,{'showHidden':![],'depth':null}):'');return _0xa0f66b[_0xe218('0x15')]['length']?_0xa0f66b[_0xe218('0x15')][0x0]:null;});}exports['getUserByInternal']=function(_0x54ee25){return new BPromise(function(_0x4adb39,_0x3e1066){if(_0x54ee25){return getUser({'internal':_0x54ee25})[_0xe218('0x12')](function(_0x2d6f7a){logger['info'](_0xe218('0x16'),_0x54ee25,_0x2d6f7a?_0xe218('0x17'):_0xe218('0x18'));return _0x4adb39(_0x2d6f7a);})[_0xe218('0xe')](function(_0x485890){logger[_0xe218('0xb')](_0xe218('0x19'),_0x485890?util[_0xe218('0x9')](_0x485890,{'showHidden':![],'depth':null}):'');return _0x4adb39(null);});}return _0x4adb39(null);});};exports[_0xe218('0x1a')]=function(_0x1e87e4){return new BPromise(function(_0x275888,_0x241045){if(_0x1e87e4){return getUser({'interface':_0x1e87e4})[_0xe218('0x12')](function(_0x4c5147){logger[_0xe218('0x8')](_0xe218('0x1b'),_0x1e87e4,_0x4c5147?_0xe218('0x17'):_0xe218('0x18'));return _0x275888(_0x4c5147);})[_0xe218('0xe')](function(_0x26c8f0){logger['error'](_0xe218('0x1c'),_0x26c8f0?util[_0xe218('0x9')](_0x26c8f0,{'showHidden':![],'depth':null}):'');return _0x275888(null);});}return _0x275888(null);});};exports['getUserByName']=function(_0x2d7db7){return new BPromise(function(_0x567983,_0x49d58d){if(_0x2d7db7){return getUser({'name':_0x2d7db7})[_0xe218('0x12')](function(_0x6175ec){logger[_0xe218('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x2d7db7,_0x6175ec?'found':_0xe218('0x18'));return _0x567983(_0x6175ec);})['catch'](function(_0x4d0488){logger['error'](_0xe218('0x1d'),_0x4d0488?util[_0xe218('0x9')](_0x4d0488,{'showHidden':![],'depth':null}):'');return _0x567983(null);});}return _0x567983(null);});};exports[_0xe218('0x1e')]=function(_0x4d1622){return new BPromise(function(_0x233c01,_0xcae45b){if(_0x4d1622){return client[_0xe218('0xc')](_0xe218('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xe218('0x10'),_0xe218('0x20'),_0xe218('0x21'),'acwTimeout'],'where':{'name':_0x4d1622},'limit':0x1}})[_0xe218('0x12')](function(_0x42fbcc){logger[_0xe218('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x4d1622,_0x42fbcc?util[_0xe218('0x9')](_0x42fbcc,{'showHidden':![],'depth':null}):'');logger[_0xe218('0x8')](_0xe218('0x22'),_0x4d1622,_0x42fbcc?_0xe218('0x17'):_0xe218('0x18'));return _0x233c01(_0x42fbcc['result'][_0xe218('0x23')]?_0x42fbcc[_0xe218('0x15')][0x0]:null);})[_0xe218('0xe')](function(_0x355788){logger[_0xe218('0xb')](_0xe218('0x24'),_0x355788?util[_0xe218('0x9')](_0x355788,{'showHidden':![],'depth':null}):'');return _0x233c01(null);});}return _0x233c01(null);});};exports[_0xe218('0x25')]=function(_0x164d8b,_0x21fa9f){return moment(_0x164d8b)[_0xe218('0x26')](_0x21fa9f,_0xe218('0x27'))[_0xe218('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x442a0,_0x2f809b){return moment(_0x442a0)[_0xe218('0x29')](_0x2f809b,_0xe218('0x27'))[_0xe218('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe218('0x2a')]=function(_0x3fcd55,_0x41ba2d){return moment(_0x3fcd55)[_0xe218('0x2b')](moment(_0x41ba2d),_0xe218('0x27'));};exports[_0xe218('0x2c')]=function(_0x159921,_0x40e443){return parseInt(_0x159921,0xa)+parseInt(_0x40e443,0xa);};exports[_0xe218('0x2d')]=function(){return moment()[_0xe218('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe218('0x2e')]=function(_0x29948f,_0xecc523){if(_0xecc523){return moment(_0x29948f)[_0xe218('0x2e')](_0xecc523);}return!![];};exports[_0xe218('0x2f')]=function(_0x1e3a3e,_0x38c5af){if(_0x38c5af){return moment(_0x1e3a3e)[_0xe218('0x2f')](_0x38c5af);}else if(_0x1e3a3e){return!![];}return![];}; \ No newline at end of file +var _0xced7=['type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','subtractTime','subtract','seconds','format','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xced7,0xc7));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x7ced('0x0'));var jayson=require(_0x7ced('0x1'));var moment=require(_0x7ced('0x2'));var util=require(_0x7ced('0x3'));var client=jayson[_0x7ced('0x4')][_0x7ced('0x5')]({'port':0x2329});var logger=require(_0x7ced('0x6'))(_0x7ced('0x7'));exports[_0x7ced('0x8')]=function(_0x58a642,_0x1caa0d){logger[_0x7ced('0x8')](_0x58a642,_0x1caa0d?util[_0x7ced('0x9')](_0x1caa0d,{'showHidden':![],'depth':null}):'');};exports[_0x7ced('0xa')]=function(_0x1bb692,_0x2229cb){logger[_0x7ced('0xa')](_0x1bb692,_0x2229cb?util[_0x7ced('0x9')](_0x2229cb,{'showHidden':![],'depth':null}):'');};exports[_0x7ced('0xb')]=function(_0x1a61a7,_0x3e2627){logger['error'](_0x1a61a7,_0x3e2627?util[_0x7ced('0x9')](_0x3e2627,{'showHidden':![],'depth':null}):'');};exports[_0x7ced('0xc')]=function(_0x2475be,_0x7a2bae){return client[_0x7ced('0xc')](_0x2475be,{'body':_0x7a2bae})[_0x7ced('0xd')](function(_0x56fa6d){logger[_0x7ced('0xa')](_0x7ced('0xe'),_0x2475be,_0x56fa6d?util[_0x7ced('0x9')](_0x56fa6d,{'showHidden':![],'depth':null}):'');})[_0x7ced('0xf')](function(_0x326002){logger[_0x7ced('0xb')](_0x7ced('0xe'),_0x2475be,_0x326002?util[_0x7ced('0x9')](_0x326002,{'showHidden':![],'depth':null}):'');});};function getUser(_0x20eb4f){return client[_0x7ced('0xc')](_0x7ced('0x10'),{'options':{'raw':!![],'attributes':['id',_0x7ced('0x11'),'name','interface'],'where':_0x20eb4f,'limit':0x1}})['then'](function(_0x4c3095){logger[_0x7ced('0xa')](_0x7ced('0x12'),JSON[_0x7ced('0x13')](_0x20eb4f),_0x4c3095?util[_0x7ced('0x9')](_0x4c3095,{'showHidden':![],'depth':null}):'');return _0x4c3095[_0x7ced('0x14')][_0x7ced('0x15')]?_0x4c3095[_0x7ced('0x14')][0x0]:null;});}exports['getUserByInternal']=function(_0x4c5f41){return new BPromise(function(_0x25fcad,_0x2ec70a){if(_0x4c5f41){return getUser({'internal':_0x4c5f41})[_0x7ced('0xd')](function(_0x186c3b){logger[_0x7ced('0x8')](_0x7ced('0x16'),_0x4c5f41,_0x186c3b?'found':_0x7ced('0x17'));return _0x25fcad(_0x186c3b);})[_0x7ced('0xf')](function(_0xcc6faa){logger['error']('[utils][getUserByInternal]',_0xcc6faa?util['inspect'](_0xcc6faa,{'showHidden':![],'depth':null}):'');return _0x25fcad(null);});}return _0x25fcad(null);});};exports[_0x7ced('0x18')]=function(_0x4dc200){return new BPromise(function(_0x4dab4a,_0x7be5cb){if(_0x4dc200){return getUser({'interface':_0x4dc200})[_0x7ced('0xd')](function(_0x4768b6){logger[_0x7ced('0x8')](_0x7ced('0x19'),_0x4dc200,_0x4768b6?_0x7ced('0x1a'):'notfound');return _0x4dab4a(_0x4768b6);})[_0x7ced('0xf')](function(_0x13fd9a){logger[_0x7ced('0xb')](_0x7ced('0x1b'),_0x13fd9a?util[_0x7ced('0x9')](_0x13fd9a,{'showHidden':![],'depth':null}):'');return _0x4dab4a(null);});}return _0x4dab4a(null);});};exports['getUserByName']=function(_0x46e5ab){return new BPromise(function(_0x33a9db,_0x2b2d55){if(_0x46e5ab){return getUser({'name':_0x46e5ab})['then'](function(_0x15527b){logger[_0x7ced('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x46e5ab,_0x15527b?'found':_0x7ced('0x17'));return _0x33a9db(_0x15527b);})[_0x7ced('0xf')](function(_0xa095df){logger[_0x7ced('0xb')](_0x7ced('0x1c'),_0xa095df?util['inspect'](_0xa095df,{'showHidden':![],'depth':null}):'');return _0x33a9db(null);});}return _0x33a9db(null);});};exports[_0x7ced('0x1d')]=function(_0x29e426){return new BPromise(function(_0x1bca00,_0x397506){if(_0x29e426){return client[_0x7ced('0xc')](_0x7ced('0x1e'),{'options':{'raw':!![],'attributes':['id','name',_0x7ced('0x1f'),'acw',_0x7ced('0x20')],'where':{'name':_0x29e426},'limit':0x1}})[_0x7ced('0xd')](function(_0x5ec3f0){logger[_0x7ced('0xa')](_0x7ced('0x21'),_0x29e426,_0x5ec3f0?util[_0x7ced('0x9')](_0x5ec3f0,{'showHidden':![],'depth':null}):'');logger[_0x7ced('0x8')](_0x7ced('0x22'),_0x29e426,_0x5ec3f0?_0x7ced('0x1a'):_0x7ced('0x17'));return _0x1bca00(_0x5ec3f0[_0x7ced('0x14')][_0x7ced('0x15')]?_0x5ec3f0[_0x7ced('0x14')][0x0]:null);})['catch'](function(_0x52d0e3){logger['error'](_0x7ced('0x23'),_0x52d0e3?util['inspect'](_0x52d0e3,{'showHidden':![],'depth':null}):'');return _0x1bca00(null);});}return _0x1bca00(null);});};exports[_0x7ced('0x24')]=function(_0x3c664c,_0x39aed7){return moment(_0x3c664c)['add'](_0x39aed7,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7ced('0x25')]=function(_0x5360a7,_0x36e260){return moment(_0x5360a7)[_0x7ced('0x26')](_0x36e260,_0x7ced('0x27'))[_0x7ced('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7ced('0x29')]=function(_0x2cfeab,_0x1141ab){return moment(_0x2cfeab)['diff'](moment(_0x1141ab),_0x7ced('0x27'));};exports[_0x7ced('0x2a')]=function(_0x3806e9,_0x30666a){return parseInt(_0x3806e9,0xa)+parseInt(_0x30666a,0xa);};exports[_0x7ced('0x2b')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7ced('0x2c')]=function(_0x11579d,_0x1beaaa){if(_0x1beaaa){return moment(_0x11579d)[_0x7ced('0x2c')](_0x1beaaa);}return!![];};exports['isBefore']=function(_0x446325,_0x503899){if(_0x503899){return moment(_0x446325)[_0x7ced('0x2d')](_0x503899);}else if(_0x446325){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 49fc94b..63c1595 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe079=['ensureDir','catch','then','user','no-user','data','timestamp','error','api','auth','set','use','isEmpty','\x20body=%s','body','format','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','name','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_id','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','role'];(function(_0x1436fa,_0x66fa0b){var _0x31b3a5=function(_0x4f7499){while(--_0x4f7499){_0x1436fa['push'](_0x1436fa['shift']());}};_0x31b3a5(++_0x66fa0b);}(_0xe079,0x1db));var _0x9e07=function(_0x1fbc42,_0x3c471f){_0x1fbc42=_0x1fbc42-0x0;var _0x54669f=_0xe079[_0x1fbc42];return _0x54669f;};var fs=require(_0x9e07('0x0'));var _=require(_0x9e07('0x1'));var ewinston=require('express-winston');var path=require(_0x9e07('0x2'));var util=require(_0x9e07('0x3'));var fileLogger=require(_0x9e07('0x4'))[_0x9e07('0x5')];var safeTemplate=require(_0x9e07('0x6'))[_0x9e07('0x7')];var maskSensitiveData=require(_0x9e07('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x4b36cb(_0x20d1dc){var _0x312a43=path[_0x9e07('0x9')](_0x9e07('0xa'),_0x9e07('0xb'),_0x9e07('0xc'));var _0x131a58=path[_0x9e07('0x9')](_0x9e07('0xd'),_0x20d1dc[_0x9e07('0xe')]+'-'+_0x20d1dc['name']);return fs[_0x9e07('0xf')](path['join'](_0x312a43,_0x131a58))['then'](function(){var _0x156b1b=fileLogger('client',path[_0x9e07('0x9')](_0x312a43,_0x131a58));return _0x156b1b;})[_0x9e07('0x10')](function(_0x4c3438){throw _0x4c3438;});}this[_0x9e07('0xb')]=function(_0x488899,_0x912c5,_0x5133e1,_0x40067d){return _0x4b36cb(_0x488899['user'])[_0x9e07('0x11')](function(_0x562e1e){var _0x4f9c69=_0x562e1e[_0x912c5];return _0x4f9c69;})['then'](function(_0x2f1928){var _0x171275=_0x488899[_0x9e07('0x12')]?_0x488899[_0x9e07('0x12')]['id']:_0x9e07('0x13');var _0xcf8c52=_0x40067d[_0x9e07('0x14')];var _0x41f7c3=_0x40067d[_0x9e07('0x15')];var _0x41fd5f=new Date(Number(_0x41f7c3));return _0x2f1928(_0x171275,_0x41fd5f,_0x5133e1,_0xcf8c52);})[_0x9e07('0x10')](function(_0xd5e76c){fileLogger(_0x9e07('0xd'))[_0x9e07('0x16')](_0xd5e76c);});};}function setupLoggers(_0x545dd8){return new Promise(function(_0x378e7d){var _0x150e08=new ClientSideLogger();var _0x176e10=fileLogger(_0x9e07('0x17'));var _0x247729=fileLogger(_0x9e07('0x18'));_0x545dd8[_0x9e07('0x19')]('client-side-logger',_0x150e08);_0x545dd8[_0x9e07('0x1a')](ewinston['logger']({'winstonInstance':_0x176e10,'meta':![],'statusLevels':!![],'msg':function(_0x59e117,_0x5dd278){var _0x2d665e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x9e07('0x1b')](_0x59e117['body'])){_0x2d665e+=_0x9e07('0x1c');var _0x47fa45=_0x59e117[_0x9e07('0x1d')];maskSensitiveData(_0x47fa45);}return safeTemplate(util[_0x9e07('0x1e')](_0x2d665e,_0x59e117[_0x9e07('0x1f')],_0x59e117['headers'][_0x9e07('0x20')]?_0x59e117[_0x9e07('0x21')]['x-forwarded-for']:_0x59e117[_0x9e07('0x22')][_0x9e07('0x23')]||_0x59e117['ip'],_0x59e117[_0x9e07('0x24')],_0x5dd278[_0x9e07('0x25')],_0x5dd278[_0x9e07('0x26')],_0x59e117[_0x9e07('0x12')]?_0x59e117['user']['id']:null,_0x59e117['user']?_0x59e117[_0x9e07('0x12')][_0x9e07('0x27')]:null,_0x59e117[_0x9e07('0x12')]?_0x59e117['user'][_0x9e07('0xe')]:null,_0x47fa45?util[_0x9e07('0x28')](_0x47fa45,![],null):''));}}));_0x545dd8[_0x9e07('0x1a')](ewinston[_0x9e07('0x29')]({'winstonInstance':_0x247729,'meta':![],'statusLevels':!![],'msg':function(_0x8697a1,_0x31ebce){var _0x6a95c8=_0x9e07('0x2a');if(_0x8697a1['body']&&_0x8697a1[_0x9e07('0x1d')][_0x9e07('0x2b')]&&_0x8697a1[_0x9e07('0x1d')]['agent_id']){_0x6a95c8=_0x9e07('0x2c');}return util[_0x9e07('0x1e')](_0x6a95c8,_0x8697a1['method'],_0x8697a1[_0x9e07('0x21')][_0x9e07('0x20')]?_0x8697a1[_0x9e07('0x21')][_0x9e07('0x20')]:_0x8697a1[_0x9e07('0x22')][_0x9e07('0x23')]||_0x8697a1['ip'],_0x8697a1['url'],_0x31ebce[_0x9e07('0x25')],_0x31ebce[_0x9e07('0x26')],_0x8697a1['user']?_0x8697a1['user']['id']:null,_0x8697a1[_0x9e07('0x12')]?_0x8697a1[_0x9e07('0x12')][_0x9e07('0x27')]:null,_0x8697a1[_0x9e07('0x12')]?_0x8697a1[_0x9e07('0x12')]['role']:null,_0x8697a1[_0x9e07('0x1d')]&&_0x8697a1[_0x9e07('0x1d')][_0x9e07('0x2b')]?_0x8697a1[_0x9e07('0x1d')][_0x9e07('0x2b')]:'other',_0x8697a1[_0x9e07('0x1d')]&&_0x8697a1[_0x9e07('0x1d')][_0x9e07('0x2d')]?_0x8697a1[_0x9e07('0x1d')]['agent_id']:'',_0x8697a1[_0x9e07('0x1d')]&&_0x8697a1[_0x9e07('0x1d')][_0x9e07('0x2e')]?_0x8697a1[_0x9e07('0x1d')][_0x9e07('0x2e')]:'');},'ignoreRoute':function(_0x5db7c9){var _0x46f955=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x46f955[_0x9e07('0x2f')](_0x5db7c9[_0x9e07('0x24')]);}}));return _0x378e7d();});}exports[_0x9e07('0x30')]=setupLoggers; \ No newline at end of file +var _0x811b=['client','role','name','ensureDir','catch','user','then','no-user','data','timestamp','error','api','auth','set','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','statusCode','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','responseTime','agent_name','test','url','setupLoggers','fs-extra','path','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally'];(function(_0x25362f,_0x12e601){var _0x34d3a5=function(_0x395cba){while(--_0x395cba){_0x25362f['push'](_0x25362f['shift']());}};_0x34d3a5(++_0x12e601);}(_0x811b,0x1a4));var _0xb811=function(_0x78d11b,_0x1c2611){_0x78d11b=_0x78d11b-0x0;var _0x5f2e27=_0x811b[_0x78d11b];return _0x5f2e27;};var fs=require(_0xb811('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require(_0xb811('0x1'));var util=require(_0xb811('0x2'));var fileLogger=require(_0xb811('0x3'))[_0xb811('0x4')];var safeTemplate=require(_0xb811('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xb811('0x6'))[_0xb811('0x7')];function ClientSideLogger(){function _0x2c351e(_0x1a86eb){var _0x8f45e=path[_0xb811('0x8')](_0xb811('0x9'),_0xb811('0xa'),_0xb811('0xb'));var _0x53d4b8=path[_0xb811('0x8')](_0xb811('0xc'),_0x1a86eb[_0xb811('0xd')]+'-'+_0x1a86eb[_0xb811('0xe')]);return fs[_0xb811('0xf')](path[_0xb811('0x8')](_0x8f45e,_0x53d4b8))['then'](function(){var _0x422c7f=fileLogger('client',path[_0xb811('0x8')](_0x8f45e,_0x53d4b8));return _0x422c7f;})[_0xb811('0x10')](function(_0x34f0d1){throw _0x34f0d1;});}this[_0xb811('0xa')]=function(_0x45670d,_0x2e4318,_0x4e9600,_0xf2f371){return _0x2c351e(_0x45670d[_0xb811('0x11')])[_0xb811('0x12')](function(_0x210ae6){var _0x31e569=_0x210ae6[_0x2e4318];return _0x31e569;})[_0xb811('0x12')](function(_0x3dae41){var _0x246699=_0x45670d[_0xb811('0x11')]?_0x45670d['user']['id']:_0xb811('0x13');var _0x3bcd13=_0xf2f371[_0xb811('0x14')];var _0x36898f=_0xf2f371[_0xb811('0x15')];var _0x1ab806=new Date(Number(_0x36898f));return _0x3dae41(_0x246699,_0x1ab806,_0x4e9600,_0x3bcd13);})['catch'](function(_0x44705f){fileLogger(_0xb811('0xc'))[_0xb811('0x16')](_0x44705f);});};}function setupLoggers(_0x5e44ce){return new Promise(function(_0x2a143c){var _0x23501b=new ClientSideLogger();var _0x1d3d12=fileLogger(_0xb811('0x17'));var _0x439534=fileLogger(_0xb811('0x18'));_0x5e44ce[_0xb811('0x19')]('client-side-logger',_0x23501b);_0x5e44ce['use'](ewinston['logger']({'winstonInstance':_0x1d3d12,'meta':![],'statusLevels':!![],'msg':function(_0x2ff3a1,_0x9b12b1){var _0x9cc7e=_0xb811('0x1a');if(!_[_0xb811('0x1b')](_0x2ff3a1[_0xb811('0x1c')])){_0x9cc7e+=_0xb811('0x1d');var _0x28eac5=_0x2ff3a1[_0xb811('0x1c')];maskSensitiveData(_0x28eac5);}return safeTemplate(util[_0xb811('0x1e')](_0x9cc7e,_0x2ff3a1['method'],_0x2ff3a1[_0xb811('0x1f')][_0xb811('0x20')]?_0x2ff3a1[_0xb811('0x1f')][_0xb811('0x20')]:_0x2ff3a1[_0xb811('0x21')][_0xb811('0x22')]||_0x2ff3a1['ip'],_0x2ff3a1['url'],_0x9b12b1[_0xb811('0x23')],_0x9b12b1['responseTime'],_0x2ff3a1['user']?_0x2ff3a1[_0xb811('0x11')]['id']:null,_0x2ff3a1[_0xb811('0x11')]?_0x2ff3a1['user'][_0xb811('0xe')]:null,_0x2ff3a1['user']?_0x2ff3a1[_0xb811('0x11')]['role']:null,_0x28eac5?util[_0xb811('0x24')](_0x28eac5,![],null):''));}}));_0x5e44ce[_0xb811('0x25')](ewinston['logger']({'winstonInstance':_0x439534,'meta':![],'statusLevels':!![],'msg':function(_0x67a362,_0x42c3c3){var _0x27219c=_0xb811('0x26');if(_0x67a362[_0xb811('0x1c')]&&_0x67a362[_0xb811('0x1c')][_0xb811('0x27')]&&_0x67a362[_0xb811('0x1c')][_0xb811('0x28')]){_0x27219c=_0xb811('0x29');}return util[_0xb811('0x1e')](_0x27219c,_0x67a362[_0xb811('0x2a')],_0x67a362[_0xb811('0x1f')][_0xb811('0x20')]?_0x67a362[_0xb811('0x1f')][_0xb811('0x20')]:_0x67a362['connection']['remoteAddress']||_0x67a362['ip'],_0x67a362['url'],_0x42c3c3['statusCode'],_0x42c3c3[_0xb811('0x2b')],_0x67a362[_0xb811('0x11')]?_0x67a362['user']['id']:null,_0x67a362[_0xb811('0x11')]?_0x67a362[_0xb811('0x11')][_0xb811('0xe')]:null,_0x67a362[_0xb811('0x11')]?_0x67a362[_0xb811('0x11')][_0xb811('0xd')]:null,_0x67a362[_0xb811('0x1c')]&&_0x67a362[_0xb811('0x1c')][_0xb811('0x27')]?_0x67a362[_0xb811('0x1c')]['device']:'other',_0x67a362[_0xb811('0x1c')]&&_0x67a362['body'][_0xb811('0x28')]?_0x67a362[_0xb811('0x1c')][_0xb811('0x28')]:'',_0x67a362[_0xb811('0x1c')]&&_0x67a362['body'][_0xb811('0x2c')]?_0x67a362[_0xb811('0x1c')][_0xb811('0x2c')]:'');},'ignoreRoute':function(_0xa4afe1){var _0x1c3099=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1c3099[_0xb811('0x2d')](_0xa4afe1[_0xb811('0x2e')]);}}));return _0x2a143c();});}exports[_0xb811('0x2f')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index ee196cd..eecaca4 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a83=['white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','fileLogger','path','moment','winston','debugLevel','toLowerCase','info','redBG\x20white'];(function(_0x5dcd95,_0x1e72d4){var _0x271b17=function(_0x57b81b){while(--_0x57b81b){_0x5dcd95['push'](_0x5dcd95['shift']());}};_0x271b17(++_0x1e72d4);}(_0x6a83,0x81));var _0x36a8=function(_0x24ff30,_0x20001b){_0x24ff30=_0x24ff30-0x0;var _0x3e7449=_0x6a83[_0x24ff30];return _0x3e7449;};'use strict';var path=require(_0x36a8('0x0'));var util=require('util');var moment=require(_0x36a8('0x1'));var winston=require(_0x36a8('0x2'));var config=require('../config/environment');var debugLevel=config[_0x36a8('0x3')]?config['debugLevel'][_0x36a8('0x4')]():_0x36a8('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x36a8('0x6'),'error':'red','warn':'bold\x20yellow','info':_0x36a8('0x7'),'print':_0x36a8('0x8'),'success':_0x36a8('0x9'),'http':_0x36a8('0xa'),'verbose':_0x36a8('0xb'),'debug':_0x36a8('0xc'),'silly':_0x36a8('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x272931,_0x469da5,_0x45760b){var _0x344a04=_0x272931||_0x36a8('0xe');return path['join'](_0x344a04,util[_0x36a8('0xf')]('%s-%s.log',_0x469da5,_0x45760b));}function formatter(_0x115ee4,_0x4a33f9){_0x4a33f9['message']=_0x4a33f9[_0x36a8('0x10')][_0x36a8('0x11')](/@@{/g,_0x36a8('0x12'))['replace'](/}@@/g,_0x36a8('0x13'))[_0x36a8('0x11')](/@{/g,'{{')[_0x36a8('0x11')](/}@/g,'}}');return util[_0x36a8('0xf')](_0x36a8('0x14'),moment()[_0x36a8('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4a33f9[_0x36a8('0x15')][_0x36a8('0x16')](),_0x115ee4,_0x4a33f9[_0x36a8('0x10')]);}function fileFormat(_0x115b5b,_0x7e5cca){_0x7e5cca[_0x36a8('0x10')]=_0x7e5cca[_0x36a8('0x10')][_0x36a8('0x11')](/@@{/g,'{{{')[_0x36a8('0x11')](/}@@/g,'}}}')[_0x36a8('0x11')](/@{/g,'{{')[_0x36a8('0x11')](/}@/g,'}}');var _0x2b7181=_0x7e5cca['meta']&&Object['keys'](_0x7e5cca[_0x36a8('0x17')])['length']?'\x0a\x09'+JSON['stringify'](_0x7e5cca[_0x36a8('0x17')]):'';return util[_0x36a8('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x36a8('0xf')](_0x36a8('0x18')),_0x7e5cca[_0x36a8('0x15')][_0x36a8('0x16')](),_0x115b5b,_0x7e5cca[_0x36a8('0x10')],_0x2b7181);}function consoleLogger(){var _0x4de0a5=new winston[(_0x36a8('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x36a8('0x1a'))][(_0x36a8('0x1b'))]({'level':_0x36a8('0x1c'),'json':![],'formatter':function(_0x4efe21){return formatter('',_0x4efe21);}})]});return _0x4de0a5;}function fileLogger(_0x582c42,_0x37eace){var _0x4c5fd8=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x36a8('0x1a'))][(_0x36a8('0x1d'))]({'name':util[_0x36a8('0xf')]('%s-%s',_0x582c42,_0x36a8('0x1e')),'filename':getLogFileName(_0x37eace,_0x582c42,_0x36a8('0x1e')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42cb6d){return fileFormat(_0x582c42,_0x42cb6d);}}),new winston[(_0x36a8('0x1a'))][(_0x36a8('0x1d'))]({'name':util[_0x36a8('0xf')](_0x36a8('0x1f'),_0x582c42,debugLevel),'filename':getLogFileName(_0x37eace,_0x582c42,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x49f628){return fileFormat(_0x582c42,_0x49f628);}}),new winston[(_0x36a8('0x1a'))][(_0x36a8('0x1b'))]({'level':_0x36a8('0x1c'),'json':![],'formatter':function(_0x56bcbc){return fileFormat(_0x582c42,_0x56bcbc);}})]});return _0x4c5fd8;}exports[_0x36a8('0x20')]=consoleLogger;exports[_0x36a8('0x21')]=fileLogger; \ No newline at end of file +var _0x1287=['Logger','error','File','%s-%s','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','%s-%s.log','message','replace','{{{','format','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','transports','Console','warn'];(function(_0x431af1,_0x546240){var _0x5187a3=function(_0x805b4a){while(--_0x805b4a){_0x431af1['push'](_0x431af1['shift']());}};_0x5187a3(++_0x546240);}(_0x1287,0x71));var _0x7128=function(_0x66af67,_0x4b0284){_0x66af67=_0x66af67-0x0;var _0x4202a9=_0x1287[_0x66af67];return _0x4202a9;};'use strict';var path=require(_0x7128('0x0'));var util=require(_0x7128('0x1'));var moment=require(_0x7128('0x2'));var winston=require(_0x7128('0x3'));var config=require(_0x7128('0x4'));var debugLevel=config[_0x7128('0x5')]?config['debugLevel'][_0x7128('0x6')]():_0x7128('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x7128('0x8'),'warn':'bold\x20yellow','info':_0x7128('0x9'),'print':_0x7128('0xa'),'success':_0x7128('0xb'),'http':_0x7128('0xc'),'verbose':_0x7128('0xd'),'debug':_0x7128('0xe'),'silly':_0x7128('0xf')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1f66e0,_0x1f7895,_0x35d9c6){var _0x5aa83a=_0x1f66e0||'/var/log/xcally';return path['join'](_0x5aa83a,util['format'](_0x7128('0x10'),_0x1f7895,_0x35d9c6));}function formatter(_0x2a921c,_0x6416c2){_0x6416c2[_0x7128('0x11')]=_0x6416c2['message'][_0x7128('0x12')](/@@{/g,_0x7128('0x13'))[_0x7128('0x12')](/}@@/g,'}}}')[_0x7128('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x7128('0x14')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x7128('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x6416c2['level'][_0x7128('0x15')](),_0x2a921c,_0x6416c2[_0x7128('0x11')]);}function fileFormat(_0x271b90,_0x3fe8f1){_0x3fe8f1[_0x7128('0x11')]=_0x3fe8f1[_0x7128('0x11')][_0x7128('0x12')](/@@{/g,'{{{')[_0x7128('0x12')](/}@@/g,'}}}')[_0x7128('0x12')](/@{/g,'{{')[_0x7128('0x12')](/}@/g,'}}');var _0x1e77ea=_0x3fe8f1[_0x7128('0x16')]&&Object[_0x7128('0x17')](_0x3fe8f1[_0x7128('0x16')])[_0x7128('0x18')]?'\x0a\x09'+JSON[_0x7128('0x19')](_0x3fe8f1[_0x7128('0x16')]):'';return util[_0x7128('0x14')](_0x7128('0x1a'),moment()[_0x7128('0x14')](_0x7128('0x1b')),_0x3fe8f1['level'][_0x7128('0x15')](),_0x271b90,_0x3fe8f1[_0x7128('0x11')],_0x1e77ea);}function consoleLogger(){var _0x52c5e6=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x7128('0x1c'))][(_0x7128('0x1d'))]({'level':_0x7128('0x1e'),'json':![],'formatter':function(_0x3b3b74){return formatter('',_0x3b3b74);}})]});return _0x52c5e6;}function fileLogger(_0x5ab4d4,_0x154088){var _0x368c50=new winston[(_0x7128('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x7128('0x1c'))]['File']({'name':util[_0x7128('0x14')]('%s-%s',_0x5ab4d4,_0x7128('0x20')),'filename':getLogFileName(_0x154088,_0x5ab4d4,_0x7128('0x20')),'level':_0x7128('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1fd449){return fileFormat(_0x5ab4d4,_0x1fd449);}}),new winston['transports'][(_0x7128('0x21'))]({'name':util[_0x7128('0x14')](_0x7128('0x22'),_0x5ab4d4,debugLevel),'filename':getLogFileName(_0x154088,_0x5ab4d4,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x39408b){return fileFormat(_0x5ab4d4,_0x39408b);}}),new winston['transports'][(_0x7128('0x1d'))]({'level':_0x7128('0x1e'),'json':![],'formatter':function(_0x44bd63){return fileFormat(_0x5ab4d4,_0x44bd63);}})]});return _0x368c50;}exports[_0x7128('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 1313df0..e967058 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x0295,0x1f0));var _0x5029=function(_0xeec31d,_0x189f0c){_0xeec31d=_0xeec31d-0x0;var _0x5915e1=_0x0295[_0xeec31d];return _0x5915e1;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x1967,0x173));var _0x7196=function(_0x5597c6,_0x5bf618){_0x5597c6=_0x5597c6-0x0;var _0x122dfa=_0x1967[_0x5597c6];return _0x122dfa;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 03b1669..3d3e8bc 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','reduce','exports','safeTemplate'];(function(_0xc57d9f,_0x487986){var _0x35575a=function(_0x10870c){while(--_0x10870c){_0xc57d9f['push'](_0xc57d9f['shift']());}};_0x35575a(++_0x487986);}(_0xb688,0xcf));var _0x8b68=function(_0x4fe1a8,_0x255cd9){_0x4fe1a8=_0x4fe1a8-0x0;var _0x81662f=_0xb688[_0x4fe1a8];return _0x81662f;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x39c8c5){return _0x39c8c5==='{{'?_0x8b68('0x0'):_0x8b68('0x1');}function safeTemplate(_0x1080e8){var _0x23bbaa=_0x1080e8;if(typeof _0x1080e8===_0x8b68('0x2')){_0x23bbaa=_0x1080e8['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x8b68('0x3')](_0x1080e8)){_0x23bbaa=_0x1080e8[_0x8b68('0x4')](function(_0x30f33d){return safeTemplate(_0x30f33d);});}else if(_[_0x8b68('0x5')](_0x1080e8)){_0x23bbaa=Object['keys'](_0x1080e8)[_0x8b68('0x6')](function(_0x57ee56,_0x37677d){_0x57ee56[_0x37677d]=safeTemplate(_0x1080e8[_0x37677d]);return _0x57ee56;},{});}return _0x23bbaa;}module[_0x8b68('0x7')][_0x8b68('0x8')]=safeTemplate; \ No newline at end of file +var _0x1775=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x26dddb,_0x357835){var _0x5a1b78=function(_0x30a782){while(--_0x30a782){_0x26dddb['push'](_0x26dddb['shift']());}};_0x5a1b78(++_0x357835);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0xb5c9b1){return _0xb5c9b1==='{{'?_0x5177('0x0'):_0x5177('0x1');}function safeTemplate(_0x2ca33b){var _0xaad33e=_0x2ca33b;if(typeof _0x2ca33b===_0x5177('0x2')){_0xaad33e=_0x2ca33b[_0x5177('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5177('0x4')](_0x2ca33b)){_0xaad33e=_0x2ca33b[_0x5177('0x5')](function(_0x51275f){return safeTemplate(_0x51275f);});}else if(_[_0x5177('0x6')](_0x2ca33b)){_0xaad33e=Object[_0x5177('0x7')](_0x2ca33b)[_0x5177('0x8')](function(_0x2ac1c6,_0x300b43){_0x2ac1c6[_0x300b43]=safeTemplate(_0x2ca33b[_0x300b43]);return _0x2ac1c6;},{});}return _0xaad33e;}module[_0x5177('0x9')][_0x5177('0xa')]=safeTemplate; \ No newline at end of file -- 1.7.1